From: support Date: Tue, 22 Mar 2022 09:25:06 +0000 (+0000) Subject: Built motion from commit 6d0b49e9.|2.6.7 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=fe382b814b9b38d8b0c683b26407fda60adc979a;p=motion2.git Built motion from commit 6d0b49e9.|2.6.7 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index cdb9018..3c8cd6b 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-22T08:56:27.615Z", + "time": "2022-03-22T09:17:24.788Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index e960364..60fc86b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-03-22T08:56:27.615Z", + "time": "2022-03-22T09:17:24.788Z", "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 d971da4..564dc9a 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 _0x58a7=['integration','motionbar','jscripty','browser','bot','script','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]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x391b46,_0x582609){var _0x577fd5=function(_0x5d4a11){while(--_0x5d4a11){_0x391b46['push'](_0x391b46['shift']());}};_0x577fd5(++_0x582609);}(_0x58a7,0x1e7));var _0x758a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x58a7[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x758a('0x0'));module[_0x758a('0x1')]={'name':{'type':Sequelize[_0x758a('0x2')],'get':function(_0x554b9c){return this[_0x758a('0x3')](_0x758a('0x4'));}},'action':{'type':Sequelize[_0x758a('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x758a('0x6'),_0x758a('0x7'),_0x758a('0x8'),_0x758a('0x9'),'urlForward',_0x758a('0xa'),_0x758a('0xb'),_0x758a('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x758a('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x758a('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x758a('0xe')},'data4':{'type':Sequelize[_0x758a('0x5')](0x1000),'comments':_0x758a('0xf')},'data5':{'type':Sequelize[_0x758a('0x5')](0x1000),'comments':_0x758a('0x10')},'data6':{'type':Sequelize[_0x758a('0x5')],'comments':_0x758a('0x11')},'data7':{'type':Sequelize[_0x758a('0x12')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xa54f=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xa54f,0x173));var _0xfa54=function(_0x4f8bbf,_0x1b1a45){_0x4f8bbf=_0x4f8bbf-0x0;var _0x5aa7a7=_0xa54f[_0x4f8bbf];return _0x5aa7a7;};'use strict';var Sequelize=require(_0xfa54('0x0'));module[_0xfa54('0x1')]={'name':{'type':Sequelize[_0xfa54('0x2')],'get':function(_0x51fa50){return this['getDataValue']('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xfa54('0x3'),_0xfa54('0x4'),_0xfa54('0x5'),_0xfa54('0x6'),_0xfa54('0x7'),'browser',_0xfa54('0x8'),_0xfa54('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfa54('0xa')},'data1':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comment':_0xfa54('0xc')},'data2':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comment':_0xfa54('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfa54('0xe')},'data4':{'type':Sequelize[_0xfa54('0xb')](0x1000),'comments':_0xfa54('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xfa54('0x10')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xfa54('0x11')],'comments':_0xfa54('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3e9334a..fea535e 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 _0x67ba=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x18e9d5,_0x36e419){var _0x441065=function(_0x55ac72){while(--_0x55ac72){_0x18e9d5['push'](_0x18e9d5['shift']());}};_0x441065(++_0x36e419);}(_0x67ba,0xce));var _0xa67b=function(_0x44b57e,_0xdaa741){_0x44b57e=_0x44b57e-0x0;var _0x5128d8=_0x67ba[_0x44b57e];return _0x5128d8;};'use strict';var emlformat=require(_0xa67b('0x0'));var rimraf=require(_0xa67b('0x1'));var zipdir=require(_0xa67b('0x2'));var jsonpatch=require(_0xa67b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa67b('0x4'));var Mustache=require(_0xa67b('0x5'));var util=require(_0xa67b('0x6'));var path=require(_0xa67b('0x7'));var sox=require('sox');var csv=require(_0xa67b('0x8'));var ejs=require(_0xa67b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa67b('0xa'));var crypto=require(_0xa67b('0xb'));var jsforce=require(_0xa67b('0xc'));var deskjs=require(_0xa67b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa67b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa67b('0xf'));var authService=require(_0xa67b('0x10'));var qs=require(_0xa67b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa67b('0x12'))(_0xa67b('0x13'));var utils=require('../../config/utils');var config=require(_0xa67b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa67b('0x15'))['db'];function respondWithStatusCode(_0x5282d3,_0xadc759){_0xadc759=_0xadc759||0xcc;return function(_0x7933fe){if(_0x7933fe){return _0x5282d3[_0xa67b('0x16')](_0xadc759);}return _0x5282d3[_0xa67b('0x17')](_0xadc759)[_0xa67b('0x18')]();};}function respondWithResult(_0x5d9715,_0x4c9201){_0x4c9201=_0x4c9201||0xc8;return function(_0x13c94a){if(_0x13c94a){return _0x5d9715[_0xa67b('0x17')](_0x4c9201)[_0xa67b('0x19')](_0x13c94a);}};}function respondWithFilteredResult(_0x45b6a6,_0x275bc3){return function(_0x3c292c){if(_0x3c292c){var _0x327eda=typeof _0x275bc3['offset']===_0xa67b('0x1a')&&typeof _0x275bc3[_0xa67b('0x1b')]===_0xa67b('0x1a');var _0xdb0d65=_0x3c292c['count'];var _0x436168=_0x327eda?0x0:_0x275bc3[_0xa67b('0x1c')];var _0x8e0d2a=_0x327eda?_0x3c292c[_0xa67b('0x1d')]:_0x275bc3[_0xa67b('0x1c')]+_0x275bc3['limit'];var _0x343e7d;if(_0x8e0d2a>=_0xdb0d65){_0x8e0d2a=_0xdb0d65;_0x343e7d=0xc8;}else{_0x343e7d=0xce;}_0x45b6a6[_0xa67b('0x17')](_0x343e7d);return _0x45b6a6[_0xa67b('0x1e')](_0xa67b('0x1f'),_0x436168+'-'+_0x8e0d2a+'/'+_0xdb0d65)['json'](_0x3c292c);}return null;};}function patchUpdates(_0x1084d0){return function(_0x1371a8){try{jsonpatch[_0xa67b('0x20')](_0x1371a8,_0x1084d0,!![]);}catch(_0x4711aa){return BPromise['reject'](_0x4711aa);}return _0x1371a8[_0xa67b('0x21')]();};}function saveUpdates(_0x5a2c07,_0x52037f){return function(_0x362cd7){if(_0x362cd7){return _0x362cd7[_0xa67b('0x22')](_0x5a2c07)[_0xa67b('0x23')](function(_0x1167f5){return _0x1167f5;});}return null;};}function removeEntity(_0x4e21ee,_0x35ca4d){return function(_0x442e63){if(_0x442e63){return _0x442e63[_0xa67b('0x24')]()['then'](function(){_0x4e21ee[_0xa67b('0x17')](0xcc)[_0xa67b('0x18')]();});}};}function handleEntityNotFound(_0x3536a3,_0x4b18a6){return function(_0x2b0151){if(!_0x2b0151){_0x3536a3[_0xa67b('0x16')](0x194);}return _0x2b0151;};}function handleError(_0x2360ee,_0x1035a8){_0x1035a8=_0x1035a8||0x1f4;return function(_0x5d9e4a){logger[_0xa67b('0x25')](_0x5d9e4a['stack']);if(_0x5d9e4a[_0xa67b('0x26')]){delete _0x5d9e4a[_0xa67b('0x26')];}_0x2360ee[_0xa67b('0x17')](_0x1035a8)[_0xa67b('0x27')](_0x5d9e4a);};}exports['update']=function(_0x31e1a2,_0x4a1071){if(_0x31e1a2[_0xa67b('0x28')]['id']){delete _0x31e1a2[_0xa67b('0x28')]['id'];}return db[_0xa67b('0x29')][_0xa67b('0x2a')]({'where':{'id':_0x31e1a2[_0xa67b('0x2b')]['id']}})[_0xa67b('0x23')](handleEntityNotFound(_0x4a1071,null))[_0xa67b('0x23')](saveUpdates(_0x31e1a2['body'],null))[_0xa67b('0x23')](respondWithResult(_0x4a1071,null))[_0xa67b('0x2c')](handleError(_0x4a1071,null));};exports['destroy']=function(_0x1502b9,_0x5176b8){return db[_0xa67b('0x29')][_0xa67b('0x2a')]({'where':{'id':_0x1502b9[_0xa67b('0x2b')]['id']}})[_0xa67b('0x23')](handleEntityNotFound(_0x5176b8,null))[_0xa67b('0x23')](removeEntity(_0x5176b8,null))[_0xa67b('0x2c')](handleError(_0x5176b8,null));}; \ No newline at end of file +var _0xa220=['count','offset','set','Content-Range','apply','reject','update','destroy','then','name','send','body','Action','params','find','catch','eml-format','rimraf','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0xa220,0x124));var _0x0a22=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa220[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x0a22('0x0'));var rimraf=require(_0x0a22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a22('0x2'));var rp=require(_0x0a22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0a22('0x4'));var path=require('path');var sox=require(_0x0a22('0x5'));var csv=require('to-csv');var ejs=require(_0x0a22('0x6'));var fs=require('fs');var fs_extra=require(_0x0a22('0x7'));var _=require(_0x0a22('0x8'));var squel=require('squel');var crypto=require(_0x0a22('0x9'));var jsforce=require(_0x0a22('0xa'));var deskjs=require(_0x0a22('0xb'));var toCsv=require(_0x0a22('0xc'));var querystring=require(_0x0a22('0xd'));var Papa=require(_0x0a22('0xe'));var Redis=require(_0x0a22('0xf'));var authService=require(_0x0a22('0x10'));var qs=require(_0x0a22('0x11'));var as=require(_0x0a22('0x12'));var hardwareService=require(_0x0a22('0x13'));var logger=require('../../config/logger')(_0x0a22('0x14'));var utils=require(_0x0a22('0x15'));var config=require(_0x0a22('0x16'));var licenseUtil=require(_0x0a22('0x17'));var db=require(_0x0a22('0x18'))['db'];function respondWithStatusCode(_0x5b5eaa,_0x30bc68){_0x30bc68=_0x30bc68||0xcc;return function(_0x4ec771){if(_0x4ec771){return _0x5b5eaa[_0x0a22('0x19')](_0x30bc68);}return _0x5b5eaa[_0x0a22('0x1a')](_0x30bc68)[_0x0a22('0x1b')]();};}function respondWithResult(_0x4fbb91,_0x3c53d8){_0x3c53d8=_0x3c53d8||0xc8;return function(_0x2afa2c){if(_0x2afa2c){return _0x4fbb91[_0x0a22('0x1a')](_0x3c53d8)[_0x0a22('0x1c')](_0x2afa2c);}};}function respondWithFilteredResult(_0x29192c,_0x5a857b){return function(_0x295ae9){if(_0x295ae9){var _0x110f59=typeof _0x5a857b['offset']==='undefined'&&typeof _0x5a857b[_0x0a22('0x1d')]==='undefined';var _0x329f1a=_0x295ae9[_0x0a22('0x1e')];var _0x561671=_0x110f59?0x0:_0x5a857b[_0x0a22('0x1f')];var _0x1baca9=_0x110f59?_0x295ae9[_0x0a22('0x1e')]:_0x5a857b['offset']+_0x5a857b[_0x0a22('0x1d')];var _0x38c914;if(_0x1baca9>=_0x329f1a){_0x1baca9=_0x329f1a;_0x38c914=0xc8;}else{_0x38c914=0xce;}_0x29192c[_0x0a22('0x1a')](_0x38c914);return _0x29192c[_0x0a22('0x20')](_0x0a22('0x21'),_0x561671+'-'+_0x1baca9+'/'+_0x329f1a)['json'](_0x295ae9);}return null;};}function patchUpdates(_0x1c97eb){return function(_0x24666a){try{jsonpatch[_0x0a22('0x22')](_0x24666a,_0x1c97eb,!![]);}catch(_0xbe4188){return BPromise[_0x0a22('0x23')](_0xbe4188);}return _0x24666a['save']();};}function saveUpdates(_0x313a70,_0x3aac7c){return function(_0x44b5c4){if(_0x44b5c4){return _0x44b5c4[_0x0a22('0x24')](_0x313a70)['then'](function(_0xec873f){return _0xec873f;});}return null;};}function removeEntity(_0x27f330,_0x287170){return function(_0x2390af){if(_0x2390af){return _0x2390af[_0x0a22('0x25')]()[_0x0a22('0x26')](function(){_0x27f330[_0x0a22('0x1a')](0xcc)[_0x0a22('0x1b')]();});}};}function handleEntityNotFound(_0x12f9ba,_0xbd86cf){return function(_0x14fdc9){if(!_0x14fdc9){_0x12f9ba['sendStatus'](0x194);}return _0x14fdc9;};}function handleError(_0x2f1c00,_0x4cad03){_0x4cad03=_0x4cad03||0x1f4;return function(_0x407801){logger['error'](_0x407801['stack']);if(_0x407801[_0x0a22('0x27')]){delete _0x407801['name'];}_0x2f1c00[_0x0a22('0x1a')](_0x4cad03)[_0x0a22('0x28')](_0x407801);};}exports[_0x0a22('0x24')]=function(_0x3e6a46,_0x5edf6d){if(_0x3e6a46[_0x0a22('0x29')]['id']){delete _0x3e6a46['body']['id'];}return db[_0x0a22('0x2a')]['find']({'where':{'id':_0x3e6a46[_0x0a22('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5edf6d,null))['then'](saveUpdates(_0x3e6a46[_0x0a22('0x29')],null))[_0x0a22('0x26')](respondWithResult(_0x5edf6d,null))['catch'](handleError(_0x5edf6d,null));};exports[_0x0a22('0x25')]=function(_0x48e9f2,_0x281284){return db[_0x0a22('0x2a')][_0x0a22('0x2c')]({'where':{'id':_0x48e9f2[_0x0a22('0x2b')]['id']}})[_0x0a22('0x26')](handleEntityNotFound(_0x281284,null))[_0x0a22('0x26')](removeEntity(_0x281284,null))[_0x0a22('0x2d')](handleError(_0x281284,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2c5b414..b82f8d3 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 _0x342f=['request-promise','rimraf','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x521378,_0x2f8004){var _0x4b2fc4=function(_0x25511e){while(--_0x25511e){_0x521378['push'](_0x521378['shift']());}};_0x4b2fc4(++_0x2f8004);}(_0x342f,0x1d4));var _0xf342=function(_0x4d7d43,_0x5ecccb){_0x4d7d43=_0x4d7d43-0x0;var _0x9e0feb=_0x342f[_0x4d7d43];return _0x9e0feb;};'use strict';var _=require(_0xf342('0x0'));var util=require(_0xf342('0x1'));var logger=require(_0xf342('0x2'))(_0xf342('0x3'));var moment=require(_0xf342('0x4'));var BPromise=require('bluebird');var rp=require(_0xf342('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf342('0x6'));var config=require('../../config/environment');var attributes=require(_0xf342('0x7'));module[_0xf342('0x8')]=function(_0x50027b,_0x267387){return _0x50027b['define'](_0xf342('0x9'),attributes,{'tableName':_0xf342('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d55=['exports','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2c3c35,_0x7a5001){var _0x1f9506=function(_0x514625){while(--_0x514625){_0x2c3c35['push'](_0x2c3c35['shift']());}};_0x1f9506(++_0x7a5001);}(_0x3d55,0x141));var _0x53d5=function(_0x8efbee,_0x107af1){_0x8efbee=_0x8efbee-0x0;var _0x1e92c1=_0x3d55[_0x8efbee];return _0x1e92c1;};'use strict';var _=require(_0x53d5('0x0'));var util=require(_0x53d5('0x1'));var logger=require(_0x53d5('0x2'))(_0x53d5('0x3'));var moment=require(_0x53d5('0x4'));var BPromise=require(_0x53d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53d5('0x6'));var rimraf=require(_0x53d5('0x7'));var config=require(_0x53d5('0x8'));var attributes=require('./action.attributes');module[_0x53d5('0x9')]=function(_0x38a18e,_0x14b38c){return _0x38a18e['define']('Action',attributes,{'tableName':_0x53d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 798d70d..b025f15 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5df7ad,_0x26db74){var _0x2a46f0=function(_0x3bf107){while(--_0x3bf107){_0x5df7ad['push'](_0x5df7ad['shift']());}};_0x2a46f0(++_0x26db74);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x57669f,_0x2196b8){var _0x183977=function(_0x1606ff){while(--_0x1606ff){_0x57669f['push'](_0x57669f['shift']());}};_0x183977(++_0x2196b8);}(_0x1261,0x144));var _0x1126=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x1261[_0xc5a279];return _0xc755d3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 9e15d4c..0b9c84c 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 _0x5ba3=['put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0xd6802,_0x3e4d3f){var _0x5ebf43=function(_0x477ecb){while(--_0x477ecb){_0xd6802['push'](_0xd6802['shift']());}};_0x5ebf43(++_0x3e4d3f);}(_0x5ba3,0xd9));var _0x35ba=function(_0x54becc,_0x9bcfc8){_0x54becc=_0x54becc-0x0;var _0x3f5ef5=_0x5ba3[_0x54becc];return _0x3f5ef5;};'use strict';var multer=require(_0x35ba('0x0'));var util=require(_0x35ba('0x1'));var path=require('path');var timeout=require(_0x35ba('0x2'));var express=require(_0x35ba('0x3'));var router=express[_0x35ba('0x4')]();var fs_extra=require(_0x35ba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35ba('0x6'));var controller=require('./action.controller');router[_0x35ba('0x7')]('/:id',auth[_0x35ba('0x8')](),controller[_0x35ba('0x9')]);router[_0x35ba('0xa')](_0x35ba('0xb'),auth[_0x35ba('0x8')](),controller[_0x35ba('0xc')]);module[_0x35ba('0xd')]=router; \ No newline at end of file +var _0x6bc0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','delete','destroy','util','path'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6bc0,0x15a));var _0x06bc=function(_0x4bf342,_0x2f8c4e){_0x4bf342=_0x4bf342-0x0;var _0x210afe=_0x6bc0[_0x4bf342];return _0x210afe;};'use strict';var multer=require('multer');var util=require(_0x06bc('0x0'));var path=require(_0x06bc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x06bc('0x2')]();var fs_extra=require(_0x06bc('0x3'));var auth=require(_0x06bc('0x4'));var interaction=require(_0x06bc('0x5'));var config=require('../../config/environment');var controller=require(_0x06bc('0x6'));router[_0x06bc('0x7')](_0x06bc('0x8'),auth[_0x06bc('0x9')](),controller['update']);router[_0x06bc('0xa')](_0x06bc('0x8'),auth[_0x06bc('0x9')](),controller[_0x06bc('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 526498c..5b71ba1 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 _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x37dc97,_0x1dbe04){var _0x16f2dd=function(_0x2d67dd){while(--_0x2d67dd){_0x37dc97['push'](_0x37dc97['shift']());}};_0x16f2dd(++_0x1dbe04);}(_0x5496,0x175));var _0x6549=function(_0x3bfe19,_0x5e8fd0){_0x3bfe19=_0x3bfe19-0x0;var _0x12b965=_0x5496[_0x3bfe19];return _0x12b965;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x83221c,_0x3975ef){var _0x2fa1fc=function(_0x26d691){while(--_0x26d691){_0x83221c['push'](_0x83221c['shift']());}};_0x2fa1fc(++_0x3975ef);}(_0x5fab,0x177));var _0xb5fa=function(_0x1ee611,_0x377a3a){_0x1ee611=_0x1ee611-0x0;var _0x3bce0a=_0x5fab[_0x1ee611];return _0x3bce0a;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d421912..89ea99a 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 _0x0c8c=['Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','DATE(%s)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','DESC','output','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','ROUND(%s)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0c8c,0x129));var _0xc0c8=function(_0x36e3b4,_0xba85ae){_0x36e3b4=_0x36e3b4-0x0;var _0x1f764c=_0x0c8c[_0x36e3b4];return _0x1f764c;};'use strict';var emlformat=require(_0xc0c8('0x0'));var rimraf=require(_0xc0c8('0x1'));var zipdir=require(_0xc0c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0c8('0x3'));var moment=require(_0xc0c8('0x4'));var BPromise=require(_0xc0c8('0x5'));var Mustache=require(_0xc0c8('0x6'));var util=require(_0xc0c8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc0c8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0c8('0x9'));var _=require('lodash');var squel=require(_0xc0c8('0xa'));var crypto=require(_0xc0c8('0xb'));var jsforce=require(_0xc0c8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc0c8('0x8'));var querystring=require('querystring');var Papa=require(_0xc0c8('0xd'));var Redis=require(_0xc0c8('0xe'));var authService=require(_0xc0c8('0xf'));var qs=require(_0xc0c8('0x10'));var as=require(_0xc0c8('0x11'));var hardwareService=require(_0xc0c8('0x12'));var logger=require(_0xc0c8('0x13'))(_0xc0c8('0x14'));var utils=require(_0xc0c8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc0c8('0x16'));var db=require(_0xc0c8('0x17'))['db'];var dbH=require(_0xc0c8('0x17'))[_0xc0c8('0x18')];function respondWithStatusCode(_0x5043cc,_0x44e7ba){_0x44e7ba=_0x44e7ba||0xcc;return function(_0x171466){if(_0x171466){return _0x5043cc[_0xc0c8('0x19')](_0x44e7ba);}return _0x5043cc[_0xc0c8('0x1a')](_0x44e7ba)[_0xc0c8('0x1b')]();};}function respondWithResult(_0x5b2acf,_0x47af96){_0x47af96=_0x47af96||0xc8;return function(_0x309c47){if(_0x309c47){return _0x5b2acf[_0xc0c8('0x1a')](_0x47af96)[_0xc0c8('0x1c')](_0x309c47);}};}function respondWithFilteredResult(_0x216629,_0x22a9fd){return function(_0x2fcb85){if(_0x2fcb85){var _0x2cbc91=typeof _0x22a9fd[_0xc0c8('0x1d')]===_0xc0c8('0x1e')&&typeof _0x22a9fd['limit']===_0xc0c8('0x1e');var _0x5605d4=_0x2fcb85[_0xc0c8('0x1f')];var _0x2a80e7=_0x2cbc91?0x0:_0x22a9fd['offset'];var _0x19e440=_0x2cbc91?_0x2fcb85['count']:_0x22a9fd['offset']+_0x22a9fd['limit'];var _0x281ac8;if(_0x19e440>=_0x5605d4){_0x19e440=_0x5605d4;_0x281ac8=0xc8;}else{_0x281ac8=0xce;}_0x216629[_0xc0c8('0x1a')](_0x281ac8);return _0x216629[_0xc0c8('0x20')](_0xc0c8('0x21'),_0x2a80e7+'-'+_0x19e440+'/'+_0x5605d4)['json'](_0x2fcb85);}return null;};}function patchUpdates(_0x3a0176){return function(_0x3b3aca){try{jsonpatch['apply'](_0x3b3aca,_0x3a0176,!![]);}catch(_0x52852a){return BPromise[_0xc0c8('0x22')](_0x52852a);}return _0x3b3aca['save']();};}function saveUpdates(_0x15178d,_0x190b7b){return function(_0x53c6f9){if(_0x53c6f9){return _0x53c6f9[_0xc0c8('0x23')](_0x15178d)[_0xc0c8('0x24')](function(_0x1284ce){return _0x1284ce;});}return null;};}function removeEntity(_0x5b0b42,_0x30752f){return function(_0x3aa9ab){if(_0x3aa9ab){return _0x3aa9ab[_0xc0c8('0x25')]()[_0xc0c8('0x24')](function(){var _0x31abff=_0x3aa9ab['get']({'plain':!![]});var _0x6c3296=_0xc0c8('0x26');return db[_0xc0c8('0x27')][_0xc0c8('0x25')]({'where':{'type':_0x6c3296,'resourceId':_0x31abff['id']}})[_0xc0c8('0x24')](function(){return _0x3aa9ab;});})['then'](function(){_0x5b0b42[_0xc0c8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd5217e,_0x1731c8){return function(_0x5927fa){if(!_0x5927fa){_0xd5217e[_0xc0c8('0x19')](0x194);}return _0x5927fa;};}function handleError(_0x2bcc42,_0x4c5da5){_0x4c5da5=_0x4c5da5||0x1f4;return function(_0x1799c5){logger['error'](_0x1799c5['stack']);if(_0x1799c5[_0xc0c8('0x28')]){delete _0x1799c5[_0xc0c8('0x28')];}_0x2bcc42[_0xc0c8('0x1a')](_0x4c5da5)[_0xc0c8('0x29')](_0x1799c5);};}exports[_0xc0c8('0x2a')]=function(_0x23cac7,_0xb29cda){var _0x49b3d8={},_0x149c9f={},_0x36aad7={'count':0x0,'rows':[]};var _0x2a4bdd=_[_0xc0c8('0x2b')](db[_0xc0c8('0x2c')][_0xc0c8('0x2d')],function(_0x1ba1f7){return{'name':_0x1ba1f7[_0xc0c8('0x2e')],'type':_0x1ba1f7[_0xc0c8('0x2f')][_0xc0c8('0x30')]};});_0x149c9f[_0xc0c8('0x31')]=_['map'](_0x2a4bdd,_0xc0c8('0x28'));_0x149c9f[_0xc0c8('0x32')]=_['keys'](_0x23cac7[_0xc0c8('0x32')]);_0x149c9f[_0xc0c8('0x33')]=_[_0xc0c8('0x34')](_0x149c9f['model'],_0x149c9f[_0xc0c8('0x32')]);_0x49b3d8[_0xc0c8('0x35')]=_[_0xc0c8('0x34')](_0x149c9f[_0xc0c8('0x31')],qs[_0xc0c8('0x36')](_0x23cac7['query'][_0xc0c8('0x36')]));_0x49b3d8['attributes']=_0x49b3d8[_0xc0c8('0x35')][_0xc0c8('0x37')]?_0x49b3d8['attributes']:_0x149c9f[_0xc0c8('0x31')];if(!_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x38')](_0xc0c8('0x39'))){_0x49b3d8['limit']=qs[_0xc0c8('0x3a')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3a')]);_0x49b3d8[_0xc0c8('0x1d')]=qs[_0xc0c8('0x1d')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x1d')]);}_0x49b3d8[_0xc0c8('0x3b')]=qs[_0xc0c8('0x3c')](_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3c')]);_0x49b3d8['where']=qs[_0xc0c8('0x33')](_[_0xc0c8('0x3d')](_0x23cac7[_0xc0c8('0x32')],_0x149c9f[_0xc0c8('0x33')]),_0x2a4bdd);if(_0x23cac7[_0xc0c8('0x32')][_0xc0c8('0x3e')]){_0x49b3d8[_0xc0c8('0x3f')]=_[_0xc0c8('0x40')](_0x49b3d8['where'],{'$or':_[_0xc0c8('0x2b')](_0x2a4bdd,function(_0x332e1a){if(_0x332e1a['type']!==_0xc0c8('0x41')){var _0x2db947={};_0x2db947[_0x332e1a[_0xc0c8('0x28')]]={'$like':'%'+_0x23cac7[_0xc0c8('0x32')]['filter']+'%'};return _0x2db947;}})});}_0x49b3d8=_[_0xc0c8('0x40')]({},_0x49b3d8,_0x23cac7[_0xc0c8('0x42')]);var _0x21b976={'where':_0x49b3d8[_0xc0c8('0x3f')]};return db[_0xc0c8('0x2c')]['count'](_0x21b976)[_0xc0c8('0x24')](function(_0x40b36c){_0x36aad7[_0xc0c8('0x1f')]=_0x40b36c;if(_0x23cac7['query']['includeAll']){_0x49b3d8[_0xc0c8('0x43')]=[{'all':!![]}];}return db[_0xc0c8('0x2c')][_0xc0c8('0x44')](_0x49b3d8);})[_0xc0c8('0x24')](function(_0x3c6ee2){_0x36aad7[_0xc0c8('0x45')]=_0x3c6ee2;return _0x36aad7;})[_0xc0c8('0x24')](respondWithFilteredResult(_0xb29cda,_0x49b3d8))[_0xc0c8('0x46')](handleError(_0xb29cda,null));};exports[_0xc0c8('0x47')]=function(_0x5a0b9c,_0x3bbd00){var _0x5ad762={'raw':![],'where':{'id':_0x5a0b9c[_0xc0c8('0x48')]['id']}},_0x1ed916={};_0x1ed916[_0xc0c8('0x31')]=_[_0xc0c8('0x49')](db[_0xc0c8('0x2c')][_0xc0c8('0x2d')]);_0x1ed916[_0xc0c8('0x32')]=_[_0xc0c8('0x49')](_0x5a0b9c[_0xc0c8('0x32')]);_0x1ed916[_0xc0c8('0x33')]=_[_0xc0c8('0x34')](_0x1ed916[_0xc0c8('0x31')],_0x1ed916[_0xc0c8('0x32')]);_0x5ad762['attributes']=_[_0xc0c8('0x34')](_0x1ed916[_0xc0c8('0x31')],qs[_0xc0c8('0x36')](_0x5a0b9c['query']['fields']));_0x5ad762[_0xc0c8('0x35')]=_0x5ad762[_0xc0c8('0x35')][_0xc0c8('0x37')]?_0x5ad762[_0xc0c8('0x35')]:_0x1ed916[_0xc0c8('0x31')];if(_0x5a0b9c[_0xc0c8('0x32')][_0xc0c8('0x4a')]){_0x5ad762[_0xc0c8('0x43')]=[{'all':!![]}];}_0x5ad762=_[_0xc0c8('0x40')]({},_0x5ad762,_0x5a0b9c[_0xc0c8('0x42')]);return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')](_0x5ad762)[_0xc0c8('0x24')](handleEntityNotFound(_0x3bbd00,null))[_0xc0c8('0x24')](respondWithResult(_0x3bbd00,null))[_0xc0c8('0x46')](handleError(_0x3bbd00,null));};exports[_0xc0c8('0x4c')]=function(_0x2abac0,_0xcec5f9){return db[_0xc0c8('0x2c')][_0xc0c8('0x4c')](_0x2abac0[_0xc0c8('0x4d')],{})['then'](function(_0x3af1bc){var _0x45693b=_0x2abac0[_0xc0c8('0x4e')][_0xc0c8('0x4f')]({'plain':!![]});if(!_0x45693b)throw new Error(_0xc0c8('0x50'));if(_0x45693b['role']===_0xc0c8('0x4e')){var _0x494883=_0x3af1bc[_0xc0c8('0x4f')]({'plain':!![]});var _0x4cf72a='Reports';return db[_0xc0c8('0x51')][_0xc0c8('0x4b')]({'where':{'name':_0x4cf72a,'userProfileId':_0x45693b['userProfileId']},'raw':!![]})[_0xc0c8('0x24')](function(_0x167d86){if(_0x167d86&&_0x167d86[_0xc0c8('0x52')]===0x0){return db[_0xc0c8('0x27')][_0xc0c8('0x4c')]({'name':_0x494883[_0xc0c8('0x28')],'resourceId':_0x494883['id'],'type':'CustomReports','sectionId':_0x167d86['id']},{})['then'](function(){return _0x3af1bc;});}else{return _0x3af1bc;}})[_0xc0c8('0x46')](function(_0x550256){logger[_0xc0c8('0x53')](_0xc0c8('0x54'),_0x550256);throw _0x550256;});}return _0x3af1bc;})[_0xc0c8('0x24')](respondWithResult(_0xcec5f9,0xc9))[_0xc0c8('0x46')](handleError(_0xcec5f9,null));};exports['update']=function(_0x13cc93,_0x4b0a20){if(_0x13cc93[_0xc0c8('0x4d')]['id']){delete _0x13cc93[_0xc0c8('0x4d')]['id'];}return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')]({'where':{'id':_0x13cc93[_0xc0c8('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b0a20,null))[_0xc0c8('0x24')](saveUpdates(_0x13cc93[_0xc0c8('0x4d')],null))[_0xc0c8('0x24')](respondWithResult(_0x4b0a20,null))[_0xc0c8('0x46')](handleError(_0x4b0a20,null));};exports[_0xc0c8('0x25')]=function(_0x4ba5a5,_0x133758){return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')]({'where':{'id':_0x4ba5a5['params']['id']}})[_0xc0c8('0x24')](handleEntityNotFound(_0x133758,null))['then'](removeEntity(_0x133758,null))['catch'](handleError(_0x133758,null));};exports[_0xc0c8('0x55')]=function(_0x1740f3,_0xb84b31){var _0x588fc1=0xa;var _0x3134d6=[_0xc0c8('0x56'),_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x263bd8={'SUM':_0xc0c8('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc0c8('0x5b'),'MAX':_0xc0c8('0x5c'),'MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc0c8('0x5f'),'GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x5764e0={'SEC_TO_TIME':_0xc0c8('0x61'),'DATE':'DATE(%s)','HOUR':_0xc0c8('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc0c8('0x63')};var _0x56fcf9=function(_0x5895f2){return!_[_0xc0c8('0x64')]([_0xc0c8('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xc0c8('0x66')],_0x5895f2);};var _0x458cbb=function(_0x5312c7){if(!_0x5312c7||!_0x5312c7[_0xc0c8('0x67')][_0xc0c8('0x37')]){return'';}for(var _0x2d37d9='(',_0x2a574c=0x0;_0x2a574c<_0x5312c7[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x2a574c+=0x1){_0x2a574c>0x0&&(_0x2d37d9+='\x20'+_0x5312c7[_0xc0c8('0x68')]+'\x20');_0x2d37d9+=_0x5312c7[_0xc0c8('0x67')][_0x2a574c]['group']?_0x458cbb(_0x5312c7['rules'][_0x2a574c][_0xc0c8('0x69')]):_0x5312c7[_0xc0c8('0x67')][_0x2a574c][_0xc0c8('0x6a')]+'\x20'+_0x5312c7['rules'][_0x2a574c]['condition']+(_0x56fcf9(_0x5312c7['rules'][_0x2a574c][_0xc0c8('0x6b')])?'\x20'+_0x5312c7[_0xc0c8('0x67')][_0x2a574c][_0xc0c8('0x6c')]:'');}return _0x2d37d9+')';};var _0x47af9c={'where':{'id':_0x1740f3[_0xc0c8('0x48')]['id']}},_0x5a63e1,_0x30cdce,_0x40a8cb,_0x20db77,_0x1dfc51;_0x47af9c=_['merge']({},_0x47af9c,_0x1740f3[_0xc0c8('0x42')]);return db[_0xc0c8('0x2c')][_0xc0c8('0x4b')](_0x47af9c)['then'](function(_0x24abd9){if(_0x24abd9){_0x5a63e1=_0x24abd9;return _0x24abd9[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x10c804){if(_0x10c804){if(!_0x10c804[_0xc0c8('0x37')]){throw new db[(_0xc0c8('0x6e'))][(_0xc0c8('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x30cdce=_0x10c804;return db[_0xc0c8('0x70')][_0xc0c8('0x44')]({'raw':!![]});}return null;})[_0xc0c8('0x24')](function(_0x1b91f4){if(_0x1b91f4){_0x40a8cb=_[_0xc0c8('0x71')](_0x1b91f4,'id');var _0x3f039c;var _0x31fee6=squel[_0xc0c8('0x72')]();_0x31fee6['from'](_0x5a63e1[_0xc0c8('0x73')]);for(var _0x25ac99=0x0;_0x25ac99<_0x30cdce[_0xc0c8('0x37')];_0x25ac99+=0x1){_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x74')]?_0x40a8cb[_0x30cdce[_0x25ac99][_0xc0c8('0x74')]][_0xc0c8('0x75')]:_0x30cdce[_0x25ac99][_0xc0c8('0x6a')];_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x76')]?_['replace'](_0x263bd8[_0x30cdce[_0x25ac99][_0xc0c8('0x76')]],'%s',_0x3f039c):_0x3f039c;_0x3f039c=_0x30cdce[_0x25ac99][_0xc0c8('0x77')]?_[_0xc0c8('0x78')](_0x5764e0[_0x30cdce[_0x25ac99]['format']],'%s',_0x3f039c):_0x3f039c;if(_0x30cdce[_0x25ac99][_0xc0c8('0x79')]){_0x31fee6['group'](_0x3f039c);}_0x30cdce[_0x25ac99][_0xc0c8('0x7a')]&&_0x31fee6['order'](_0x3f039c,_0x30cdce[_0x25ac99][_0xc0c8('0x7a')]==='DESC'?![]:!![]);_0x31fee6[_0xc0c8('0x6a')](_0x3f039c,_0x30cdce[_0x25ac99][_0xc0c8('0x7b')]||_0x3f039c);}if(_0x5a63e1[_0xc0c8('0x7c')]){_0x5a63e1[_0xc0c8('0x7c')]=JSON['parse'](_0x5a63e1[_0xc0c8('0x7c')]);for(var _0x28a1e6=0x0;_0x28a1e6<_0x5a63e1[_0xc0c8('0x7c')]['length'];_0x28a1e6+=0x1){if(_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6]['type']&&_[_0xc0c8('0x64')](_0x3134d6,_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x2f')])&&_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7d')]&&_0x5a63e1['joins'][_0x28a1e6][_0xc0c8('0x7e')]&&_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7f')]){_0x31fee6[_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x2f')]](_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7e')],null,util[_0xc0c8('0x77')](_0xc0c8('0x80'),_0x5a63e1[_0xc0c8('0x73')],_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6][_0xc0c8('0x7d')],_0x5a63e1[_0xc0c8('0x7c')][_0x28a1e6]['foreignTable'],_0x5a63e1['joins'][_0x28a1e6][_0xc0c8('0x7f')]));}}}if(_0x5a63e1[_0xc0c8('0x81')]){_0x5a63e1[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x5a63e1['conditions']);_0x31fee6[_0xc0c8('0x3f')](_0x458cbb(_0x5a63e1[_0xc0c8('0x81')]['group']));}_0x1dfc51=_0x31fee6[_0xc0c8('0x83')]();_0x31fee6[_0xc0c8('0x3a')](_0x588fc1);_0x31fee6[_0xc0c8('0x1d')](0x0);logger[_0xc0c8('0x84')](_0xc0c8('0x85'),_0x31fee6[_0xc0c8('0x86')]());return dbH['sequelize'][_0xc0c8('0x32')](_0x31fee6[_0xc0c8('0x86')](),{'type':dbH[_0xc0c8('0x87')][_0xc0c8('0x88')][_0xc0c8('0x89')]});}})[_0xc0c8('0x24')](respondWithResult(_0xb84b31,null))[_0xc0c8('0x46')](handleError(_0xb84b31,null));};function runReport(_0xf0ce98,_0x37a265,_0x44b62b){var _0x323b9f=_0x37a265['name'];var _0x4d735e=0xa;var _0x23ec2a=[_0xc0c8('0x56'),_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x5e0248={'SUM':'SUM(%s)','COUNT':_0xc0c8('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc0c8('0x5c'),'MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':_0xc0c8('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x1c7cdf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc0c8('0x8c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5ada18=function(_0x15327e){return!_[_0xc0c8('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc0c8('0x8d'),'IS\x20NOT\x20EMPTY'],_0x15327e);};var _0x528fdf=function(_0x494acc){if(!_0x494acc||!_0x494acc[_0xc0c8('0x67')]['length']){return'';}for(var _0x1d5dde='(',_0x171502=0x0;_0x171502<_0x494acc[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x171502+=0x1){_0x171502>0x0&&(_0x1d5dde+='\x20'+_0x494acc['operator']+'\x20');_0x1d5dde+=_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x69')]?_0x528fdf(_0x494acc[_0xc0c8('0x67')][_0x171502]['group']):_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6a')]+'\x20'+_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6b')]+(_0x5ada18(_0x494acc['rules'][_0x171502][_0xc0c8('0x6b')])?'\x20'+_0x494acc[_0xc0c8('0x67')][_0x171502][_0xc0c8('0x6c')]:'');}return _0x1d5dde+')';};var _0xcfcb5f={'where':{'id':_0xf0ce98['id']}},_0x3d8b01,_0x598e2a,_0x5a249f,_0x641e07,_0x13bfc1;_0xcfcb5f=_['merge']({},_0xcfcb5f,_0x44b62b);return db[_0xc0c8('0x2c')]['find'](_0xcfcb5f)[_0xc0c8('0x24')](function(_0x2eabf3){if(_0x2eabf3){_0x3d8b01=_0x2eabf3;return _0x2eabf3[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x338cb8){if(_0x338cb8){if(!_0x338cb8[_0xc0c8('0x37')]){throw new db['Sequelize'][(_0xc0c8('0x6f'))](_0xc0c8('0x8e'),0x193);}_0x598e2a=_0x338cb8;return db[_0xc0c8('0x70')][_0xc0c8('0x44')]({'raw':!![]});}return null;})[_0xc0c8('0x24')](function(_0x4e0cd2){if(_0x4e0cd2){_0x5a249f=_[_0xc0c8('0x71')](_0x4e0cd2,'id');var _0x4b369d;var _0x255ffa=squel[_0xc0c8('0x72')]();_0x255ffa[_0xc0c8('0x8f')](_0x3d8b01[_0xc0c8('0x73')]);for(var _0x39440c=0x0;_0x39440c<_0x598e2a['length'];_0x39440c+=0x1){_0x4b369d=_0x598e2a[_0x39440c][_0xc0c8('0x74')]?_0x5a249f[_0x598e2a[_0x39440c]['MetricId']][_0xc0c8('0x75')]:_0x598e2a[_0x39440c][_0xc0c8('0x6a')];_0x4b369d=_0x598e2a[_0x39440c]['function']?_[_0xc0c8('0x78')](_0x5e0248[_0x598e2a[_0x39440c][_0xc0c8('0x76')]],'%s',_0x4b369d):_0x4b369d;_0x4b369d=_0x598e2a[_0x39440c][_0xc0c8('0x77')]?_[_0xc0c8('0x78')](_0x1c7cdf[_0x598e2a[_0x39440c][_0xc0c8('0x77')]],'%s',_0x4b369d):_0x4b369d;if(_0x598e2a[_0x39440c][_0xc0c8('0x79')]){_0x255ffa[_0xc0c8('0x69')](_0x4b369d);}_0x598e2a[_0x39440c][_0xc0c8('0x7a')]&&_0x255ffa['order'](_0x4b369d,_0x598e2a[_0x39440c][_0xc0c8('0x7a')]===_0xc0c8('0x90')?![]:!![]);_0x255ffa[_0xc0c8('0x6a')](_0x4b369d,_0x598e2a[_0x39440c][_0xc0c8('0x7b')]||_0x4b369d);}if(_0x3d8b01[_0xc0c8('0x7c')]){_0x3d8b01[_0xc0c8('0x7c')]=JSON[_0xc0c8('0x82')](_0x3d8b01[_0xc0c8('0x7c')]);for(var _0xd9f9b8=0x0;_0xd9f9b8<_0x3d8b01[_0xc0c8('0x7c')][_0xc0c8('0x37')];_0xd9f9b8+=0x1){if(_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x2f')]&&_[_0xc0c8('0x64')](_0x23ec2a,_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x2f')])&&_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7d')]&&_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7e')]&&_0x3d8b01['joins'][_0xd9f9b8][_0xc0c8('0x7f')]){_0x255ffa[_0x3d8b01['joins'][_0xd9f9b8][_0xc0c8('0x2f')]](_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignTable'],null,util[_0xc0c8('0x77')](_0xc0c8('0x80'),_0x3d8b01[_0xc0c8('0x73')],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8][_0xc0c8('0x7d')],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignTable'],_0x3d8b01[_0xc0c8('0x7c')][_0xd9f9b8]['foreignKey']));}}}if(_0x3d8b01[_0xc0c8('0x81')]){_0x3d8b01[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x3d8b01['conditions']);_0x255ffa[_0xc0c8('0x3f')](_0x528fdf(_0x3d8b01[_0xc0c8('0x81')][_0xc0c8('0x69')]));}_0x13bfc1=_0x255ffa[_0xc0c8('0x83')]();_0x255ffa['limit'](_0x4d735e);_0x255ffa[_0xc0c8('0x1d')](0x0);return;}})['then'](function(){if(_0x37a265[_0xc0c8('0x91')]==='web'){return null;}var _0x1ae2de=_[_0xc0c8('0x40')](_0x37a265,{'name':_0x37a265[_0xc0c8('0x92')]||_0x37a265['name']||_0x3d8b01[_0xc0c8('0x28')],'basename':_0x323b9f,'savename':util[_0xc0c8('0x77')](_0xc0c8('0x93'),_0x37a265[_0xc0c8('0x28')]||_0x3d8b01['name'],require(_0xc0c8('0x94'))['generate'](0x4),_0x37a265['output']||'csv'),'reportId':_0x3d8b01['id'],'reportType':_0xc0c8('0x95')});return db[_0xc0c8('0x96')]['create'](_0x1ae2de,{'raw':!![]});})[_0xc0c8('0x24')](function(_0xc7a17){if(_0x3d8b01['table']===_0xc0c8('0x97')){_0x13bfc1[_0xc0c8('0x3f')](_0x3d8b01[_0xc0c8('0x73')]+_0xc0c8('0x98'),_0x37a265[_0xc0c8('0x99')],_0x37a265['endDate']);}else{_0x13bfc1[_0xc0c8('0x3f')](_0x3d8b01[_0xc0c8('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x37a265[_0xc0c8('0x99')],_0x37a265[_0xc0c8('0x9a')]);}if(_0xc7a17){logger[_0xc0c8('0x9b')](_0xc0c8('0x9c'),_0x13bfc1[_0xc0c8('0x86')]());require(_0xc0c8('0x9d'))[_0xc0c8('0x9e')](path[_0xc0c8('0x56')](__dirname,_0xc0c8('0x9f'),_0xc7a17[_0xc0c8('0x91')]),[_0xc7a17['id'],_0x13bfc1[_0xc0c8('0x86')](),path[_0xc0c8('0x56')](__dirname,'../../files/reports',_0xc7a17[_0xc0c8('0xa0')]),_0x323b9f]);return _0xc7a17;}else{var _0x237751=squel[_0xc0c8('0x72')]();_0x237751['from']('('+_0x13bfc1[_0xc0c8('0x86')]()+')',_0xc0c8('0xa1'));_0x237751[_0xc0c8('0x6a')]('COUNT(*)','count');_0x13bfc1[_0xc0c8('0x3a')](_0x37a265[_0xc0c8('0x3a')]||_0x4d735e);_0x13bfc1[_0xc0c8('0x1d')](_0x37a265[_0xc0c8('0x1d')]||0x0);return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x237751[_0xc0c8('0x86')](),{'type':dbH[_0xc0c8('0x87')]['QueryTypes']['SELECT']})[_0xc0c8('0x24')](function(_0x3b7dfe){if(!_0x3b7dfe[_0xc0c8('0x37')]){_0x641e07=0x0;}else{_0x641e07=_0x3b7dfe[0x0][_0xc0c8('0x1f')]||0x0;}return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x13bfc1['toString'](),{'type':dbH[_0xc0c8('0x87')]['QueryTypes'][_0xc0c8('0x89')]});})[_0xc0c8('0x24')](function(_0x4ae91d){return{'rows':_0x4ae91d||[],'count':_0x641e07};});}});}exports[_0xc0c8('0xa2')]=function(_0x13a1e1,_0x3e4a60){return runReport(_0x13a1e1[_0xc0c8('0x48')],_0x13a1e1['query'],_0x13a1e1[_0xc0c8('0x42')])[_0xc0c8('0x24')](respondWithResult(_0x3e4a60,null))[_0xc0c8('0x46')](handleError(_0x3e4a60,null));};exports['runReport']=runReport;exports[_0xc0c8('0x32')]=function(_0x49ca5f,_0x35ae6e){var _0x7a29fb=0xa;var _0x97ea9c=['join',_0xc0c8('0x57'),_0xc0c8('0x58'),_0xc0c8('0x59')];var _0x51a65e={'SUM':_0xc0c8('0x5a'),'COUNT':_0xc0c8('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc0c8('0x5d'),'AVG':_0xc0c8('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc0c8('0x5f'),'GROUP_CONCAT DESC':_0xc0c8('0x60')};var _0x320005={'SEC_TO_TIME':_0xc0c8('0x61'),'DATE':'DATE(%s)','HOUR':_0xc0c8('0x62'),'ROUND':_0xc0c8('0xa3'),'UNIX_TIMESTAMP':_0xc0c8('0x63')};var _0x265c97=function(_0x39994c){return!_[_0xc0c8('0x64')]([_0xc0c8('0x65'),_0xc0c8('0xa4'),_0xc0c8('0x8d'),_0xc0c8('0x66')],_0x39994c);};var _0x5b442b=function(_0x40ea6b){if(!_0x40ea6b||!_0x40ea6b[_0xc0c8('0x67')]['length']){return'';}for(var _0x17fad8='(',_0x1a0725=0x0;_0x1a0725<_0x40ea6b[_0xc0c8('0x67')][_0xc0c8('0x37')];_0x1a0725+=0x1){_0x1a0725>0x0&&(_0x17fad8+='\x20'+_0x40ea6b[_0xc0c8('0x68')]+'\x20');_0x17fad8+=_0x40ea6b[_0xc0c8('0x67')][_0x1a0725]['group']?_0x5b442b(_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x69')]):_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6a')]+'\x20'+_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6b')]+(_0x265c97(_0x40ea6b[_0xc0c8('0x67')][_0x1a0725][_0xc0c8('0x6b')])?'\x20'+_0x40ea6b['rules'][_0x1a0725]['value']:'');}return _0x17fad8+')';};var _0x224480={'where':{'id':_0x49ca5f[_0xc0c8('0x48')]['id']}},_0x34aa2d,_0x2370b0,_0x25dd64,_0x3bcf34,_0x11b2a0;_0x224480=_['merge']({},_0x224480,_0x49ca5f['options']);return db['AnalyticCustomReport'][_0xc0c8('0x4b')](_0x224480)[_0xc0c8('0x24')](function(_0x2f5c16){if(_0x2f5c16){_0x34aa2d=_0x2f5c16;return _0x2f5c16[_0xc0c8('0x6d')]();}return null;})['then'](function(_0x27ad7c){if(_0x27ad7c){if(!_0x27ad7c['length']){throw new db['Sequelize'][(_0xc0c8('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2370b0=_0x27ad7c;return db[_0xc0c8('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3ce367){if(_0x3ce367){_0x25dd64=_['keyBy'](_0x3ce367,'id');var _0x10e53c;var _0x2f992f=squel[_0xc0c8('0x72')]();_0x2f992f[_0xc0c8('0x8f')](_0x34aa2d[_0xc0c8('0x73')]);for(var _0x1266b4=0x0;_0x1266b4<_0x2370b0[_0xc0c8('0x37')];_0x1266b4+=0x1){_0x10e53c=_0x2370b0[_0x1266b4][_0xc0c8('0x74')]?_0x25dd64[_0x2370b0[_0x1266b4][_0xc0c8('0x74')]][_0xc0c8('0x75')]:_0x2370b0[_0x1266b4][_0xc0c8('0x6a')];_0x10e53c=_0x2370b0[_0x1266b4][_0xc0c8('0x76')]?_[_0xc0c8('0x78')](_0x51a65e[_0x2370b0[_0x1266b4][_0xc0c8('0x76')]],'%s',_0x10e53c):_0x10e53c;_0x10e53c=_0x2370b0[_0x1266b4]['format']?_[_0xc0c8('0x78')](_0x320005[_0x2370b0[_0x1266b4][_0xc0c8('0x77')]],'%s',_0x10e53c):_0x10e53c;if(_0x2370b0[_0x1266b4][_0xc0c8('0x79')]){_0x2f992f[_0xc0c8('0x69')](_0x10e53c);}_0x2370b0[_0x1266b4][_0xc0c8('0x7a')]&&_0x2f992f[_0xc0c8('0x3b')](_0x10e53c,_0x2370b0[_0x1266b4][_0xc0c8('0x7a')]===_0xc0c8('0x90')?![]:!![]);_0x2f992f[_0xc0c8('0x6a')](_0x10e53c,_0x2370b0[_0x1266b4][_0xc0c8('0x7b')]||_0x10e53c);}if(_0x34aa2d[_0xc0c8('0x7c')]){_0x34aa2d[_0xc0c8('0x7c')]=JSON[_0xc0c8('0x82')](_0x34aa2d[_0xc0c8('0x7c')]);for(var _0x566541=0x0;_0x566541<_0x34aa2d['joins'][_0xc0c8('0x37')];_0x566541+=0x1){if(_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['type']&&_['includes'](_0x97ea9c,_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['type'])&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7d')]&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')]&&_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['foreignKey']){_0x2f992f[_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x2f')]](_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')],null,util['format'](_0xc0c8('0x80'),_0x34aa2d['table'],_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7d')],_0x34aa2d[_0xc0c8('0x7c')][_0x566541][_0xc0c8('0x7e')],_0x34aa2d[_0xc0c8('0x7c')][_0x566541]['foreignKey']));}}}if(_0x34aa2d[_0xc0c8('0x81')]){_0x34aa2d[_0xc0c8('0x81')]=JSON[_0xc0c8('0x82')](_0x34aa2d[_0xc0c8('0x81')]);_0x2f992f[_0xc0c8('0x3f')](_0x5b442b(_0x34aa2d['conditions']['group']));}_0x11b2a0=_0x2f992f[_0xc0c8('0x83')]();_0x2f992f['limit'](_0x7a29fb);_0x2f992f[_0xc0c8('0x1d')](0x0);logger['debug'](_0xc0c8('0x85'),_0x2f992f[_0xc0c8('0x86')]());return dbH[_0xc0c8('0x87')][_0xc0c8('0x32')](_0x2f992f['toString'](),{'type':dbH[_0xc0c8('0x87')][_0xc0c8('0x88')][_0xc0c8('0x89')]});}})[_0xc0c8('0x24')](function(){return{'sql':_0x11b2a0[_0xc0c8('0x86')]()};})[_0xc0c8('0x24')](respondWithResult(_0x35ae6e,null))['catch'](handleError(_0x35ae6e,null));}; \ No newline at end of file +var _0xe16c=['Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','type','filter','options','includeAll','include','AnalyticCustomReport','findAll','rows','show','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','MetricId','function','replace','format','groupBy','orderBy','order','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','MIN(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','operator','value','ValidationErrorItem','select','from','alias','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','countTable','SELECT','run','runReport','COUNT(%s)','metric','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x13b1d8,_0x10a06f){var _0x3d000b=function(_0x13b070){while(--_0x13b070){_0x13b1d8['push'](_0x13b1d8['shift']());}};_0x3d000b(++_0x10a06f);}(_0xe16c,0x89));var _0xce16=function(_0x66eb90,_0x4d9dcd){_0x66eb90=_0x66eb90-0x0;var _0x593592=_0xe16c[_0x66eb90];return _0x593592;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce16('0x0'));var zipdir=require(_0xce16('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce16('0x2'));var moment=require('moment');var BPromise=require(_0xce16('0x3'));var Mustache=require(_0xce16('0x4'));var util=require('util');var path=require(_0xce16('0x5'));var sox=require('sox');var csv=require(_0xce16('0x6'));var ejs=require(_0xce16('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xce16('0x8'));var crypto=require(_0xce16('0x9'));var jsforce=require(_0xce16('0xa'));var deskjs=require(_0xce16('0xb'));var toCsv=require('to-csv');var querystring=require(_0xce16('0xc'));var Papa=require(_0xce16('0xd'));var Redis=require(_0xce16('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xce16('0xf'));var as=require(_0xce16('0x10'));var hardwareService=require(_0xce16('0x11'));var logger=require('../../config/logger')(_0xce16('0x12'));var utils=require(_0xce16('0x13'));var config=require(_0xce16('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xce16('0x15'))['db'];var dbH=require('../../mysqldb')[_0xce16('0x16')];function respondWithStatusCode(_0x217df0,_0x5e8b44){_0x5e8b44=_0x5e8b44||0xcc;return function(_0x4f3dd1){if(_0x4f3dd1){return _0x217df0[_0xce16('0x17')](_0x5e8b44);}return _0x217df0[_0xce16('0x18')](_0x5e8b44)[_0xce16('0x19')]();};}function respondWithResult(_0x3c250e,_0x29b2db){_0x29b2db=_0x29b2db||0xc8;return function(_0x56e0e8){if(_0x56e0e8){return _0x3c250e['status'](_0x29b2db)[_0xce16('0x1a')](_0x56e0e8);}};}function respondWithFilteredResult(_0x12e64a,_0x1e064f){return function(_0x25f7a7){if(_0x25f7a7){var _0x33056e=typeof _0x1e064f[_0xce16('0x1b')]===_0xce16('0x1c')&&typeof _0x1e064f['limit']===_0xce16('0x1c');var _0x45f65e=_0x25f7a7[_0xce16('0x1d')];var _0x388d64=_0x33056e?0x0:_0x1e064f['offset'];var _0xdaa57a=_0x33056e?_0x25f7a7['count']:_0x1e064f[_0xce16('0x1b')]+_0x1e064f[_0xce16('0x1e')];var _0x58bdc8;if(_0xdaa57a>=_0x45f65e){_0xdaa57a=_0x45f65e;_0x58bdc8=0xc8;}else{_0x58bdc8=0xce;}_0x12e64a[_0xce16('0x18')](_0x58bdc8);return _0x12e64a[_0xce16('0x1f')](_0xce16('0x20'),_0x388d64+'-'+_0xdaa57a+'/'+_0x45f65e)[_0xce16('0x1a')](_0x25f7a7);}return null;};}function patchUpdates(_0x426cd2){return function(_0x275b04){try{jsonpatch[_0xce16('0x21')](_0x275b04,_0x426cd2,!![]);}catch(_0x42d383){return BPromise[_0xce16('0x22')](_0x42d383);}return _0x275b04[_0xce16('0x23')]();};}function saveUpdates(_0x35e1b9,_0x458e91){return function(_0x531318){if(_0x531318){return _0x531318['update'](_0x35e1b9)['then'](function(_0x5778f4){return _0x5778f4;});}return null;};}function removeEntity(_0x54454f,_0x377564){return function(_0x3d1bda){if(_0x3d1bda){return _0x3d1bda[_0xce16('0x24')]()[_0xce16('0x25')](function(){var _0x4577d9=_0x3d1bda[_0xce16('0x26')]({'plain':!![]});var _0x324ab5='CustomReports';return db[_0xce16('0x27')][_0xce16('0x24')]({'where':{'type':_0x324ab5,'resourceId':_0x4577d9['id']}})[_0xce16('0x25')](function(){return _0x3d1bda;});})['then'](function(){_0x54454f[_0xce16('0x18')](0xcc)[_0xce16('0x19')]();});}};}function handleEntityNotFound(_0x312c6d,_0x27ac06){return function(_0x3cc4aa){if(!_0x3cc4aa){_0x312c6d[_0xce16('0x17')](0x194);}return _0x3cc4aa;};}function handleError(_0x291f8e,_0x57c19e){_0x57c19e=_0x57c19e||0x1f4;return function(_0x2f8236){logger['error'](_0x2f8236[_0xce16('0x28')]);if(_0x2f8236['name']){delete _0x2f8236[_0xce16('0x29')];}_0x291f8e[_0xce16('0x18')](_0x57c19e)['send'](_0x2f8236);};}exports[_0xce16('0x2a')]=function(_0x2b384d,_0x56f233){var _0x13e45e={},_0x2b65b8={},_0x22b096={'count':0x0,'rows':[]};var _0x1be622=_[_0xce16('0x2b')](db['AnalyticCustomReport'][_0xce16('0x2c')],function(_0x582781){return{'name':_0x582781[_0xce16('0x2d')],'type':_0x582781['type'][_0xce16('0x2e')]};});_0x2b65b8[_0xce16('0x2f')]=_[_0xce16('0x2b')](_0x1be622,_0xce16('0x29'));_0x2b65b8[_0xce16('0x30')]=_[_0xce16('0x31')](_0x2b384d[_0xce16('0x30')]);_0x2b65b8['filters']=_['intersection'](_0x2b65b8['model'],_0x2b65b8[_0xce16('0x30')]);_0x13e45e[_0xce16('0x32')]=_[_0xce16('0x33')](_0x2b65b8[_0xce16('0x2f')],qs[_0xce16('0x34')](_0x2b384d[_0xce16('0x30')][_0xce16('0x34')]));_0x13e45e[_0xce16('0x32')]=_0x13e45e[_0xce16('0x32')][_0xce16('0x35')]?_0x13e45e[_0xce16('0x32')]:_0x2b65b8[_0xce16('0x2f')];if(!_0x2b384d[_0xce16('0x30')][_0xce16('0x36')](_0xce16('0x37'))){_0x13e45e[_0xce16('0x1e')]=qs[_0xce16('0x1e')](_0x2b384d[_0xce16('0x30')]['limit']);_0x13e45e[_0xce16('0x1b')]=qs[_0xce16('0x1b')](_0x2b384d[_0xce16('0x30')][_0xce16('0x1b')]);}_0x13e45e['order']=qs[_0xce16('0x38')](_0x2b384d[_0xce16('0x30')][_0xce16('0x38')]);_0x13e45e[_0xce16('0x39')]=qs[_0xce16('0x3a')](_[_0xce16('0x3b')](_0x2b384d[_0xce16('0x30')],_0x2b65b8[_0xce16('0x3a')]),_0x1be622);if(_0x2b384d['query']['filter']){_0x13e45e[_0xce16('0x39')]=_['merge'](_0x13e45e[_0xce16('0x39')],{'$or':_['map'](_0x1be622,function(_0x3e916c){if(_0x3e916c[_0xce16('0x3c')]!=='VIRTUAL'){var _0x2250bc={};_0x2250bc[_0x3e916c['name']]={'$like':'%'+_0x2b384d[_0xce16('0x30')][_0xce16('0x3d')]+'%'};return _0x2250bc;}})});}_0x13e45e=_['merge']({},_0x13e45e,_0x2b384d[_0xce16('0x3e')]);var _0x304095={'where':_0x13e45e[_0xce16('0x39')]};return db['AnalyticCustomReport'][_0xce16('0x1d')](_0x304095)[_0xce16('0x25')](function(_0x5d220c){_0x22b096[_0xce16('0x1d')]=_0x5d220c;if(_0x2b384d[_0xce16('0x30')][_0xce16('0x3f')]){_0x13e45e[_0xce16('0x40')]=[{'all':!![]}];}return db[_0xce16('0x41')][_0xce16('0x42')](_0x13e45e);})[_0xce16('0x25')](function(_0x588b09){_0x22b096[_0xce16('0x43')]=_0x588b09;return _0x22b096;})['then'](respondWithFilteredResult(_0x56f233,_0x13e45e))['catch'](handleError(_0x56f233,null));};exports[_0xce16('0x44')]=function(_0x3f6574,_0x14b87f){var _0x7f75f={'raw':![],'where':{'id':_0x3f6574[_0xce16('0x45')]['id']}},_0x32b070={};_0x32b070[_0xce16('0x2f')]=_[_0xce16('0x31')](db[_0xce16('0x41')][_0xce16('0x2c')]);_0x32b070[_0xce16('0x30')]=_[_0xce16('0x31')](_0x3f6574[_0xce16('0x30')]);_0x32b070[_0xce16('0x3a')]=_[_0xce16('0x33')](_0x32b070['model'],_0x32b070[_0xce16('0x30')]);_0x7f75f[_0xce16('0x32')]=_[_0xce16('0x33')](_0x32b070[_0xce16('0x2f')],qs[_0xce16('0x34')](_0x3f6574['query'][_0xce16('0x34')]));_0x7f75f['attributes']=_0x7f75f[_0xce16('0x32')][_0xce16('0x35')]?_0x7f75f[_0xce16('0x32')]:_0x32b070[_0xce16('0x2f')];if(_0x3f6574[_0xce16('0x30')][_0xce16('0x3f')]){_0x7f75f['include']=[{'all':!![]}];}_0x7f75f=_[_0xce16('0x46')]({},_0x7f75f,_0x3f6574[_0xce16('0x3e')]);return db[_0xce16('0x41')][_0xce16('0x47')](_0x7f75f)[_0xce16('0x25')](handleEntityNotFound(_0x14b87f,null))['then'](respondWithResult(_0x14b87f,null))[_0xce16('0x48')](handleError(_0x14b87f,null));};exports[_0xce16('0x49')]=function(_0x4753d9,_0x500a35){return db[_0xce16('0x41')][_0xce16('0x49')](_0x4753d9[_0xce16('0x4a')],{})[_0xce16('0x25')](function(_0x5e8408){var _0x19a48c=_0x4753d9[_0xce16('0x4b')][_0xce16('0x26')]({'plain':!![]});if(!_0x19a48c)throw new Error(_0xce16('0x4c'));if(_0x19a48c[_0xce16('0x4d')]==='user'){var _0x4e3edb=_0x5e8408[_0xce16('0x26')]({'plain':!![]});var _0x17e81e=_0xce16('0x4e');return db[_0xce16('0x4f')][_0xce16('0x47')]({'where':{'name':_0x17e81e,'userProfileId':_0x19a48c[_0xce16('0x50')]},'raw':!![]})[_0xce16('0x25')](function(_0x4086ab){if(_0x4086ab&&_0x4086ab[_0xce16('0x51')]===0x0){return db['UserProfileResource'][_0xce16('0x49')]({'name':_0x4e3edb[_0xce16('0x29')],'resourceId':_0x4e3edb['id'],'type':_0xce16('0x52'),'sectionId':_0x4086ab['id']},{})[_0xce16('0x25')](function(){return _0x5e8408;});}else{return _0x5e8408;}})[_0xce16('0x48')](function(_0x59d751){logger[_0xce16('0x53')](_0xce16('0x54'),_0x59d751);throw _0x59d751;});}return _0x5e8408;})['then'](respondWithResult(_0x500a35,0xc9))[_0xce16('0x48')](handleError(_0x500a35,null));};exports[_0xce16('0x55')]=function(_0x284c4c,_0x4cf8ba){if(_0x284c4c[_0xce16('0x4a')]['id']){delete _0x284c4c['body']['id'];}return db[_0xce16('0x41')][_0xce16('0x47')]({'where':{'id':_0x284c4c[_0xce16('0x45')]['id']}})[_0xce16('0x25')](handleEntityNotFound(_0x4cf8ba,null))[_0xce16('0x25')](saveUpdates(_0x284c4c[_0xce16('0x4a')],null))[_0xce16('0x25')](respondWithResult(_0x4cf8ba,null))[_0xce16('0x48')](handleError(_0x4cf8ba,null));};exports[_0xce16('0x24')]=function(_0x1f2b4c,_0x2db024){return db[_0xce16('0x41')][_0xce16('0x47')]({'where':{'id':_0x1f2b4c['params']['id']}})[_0xce16('0x25')](handleEntityNotFound(_0x2db024,null))[_0xce16('0x25')](removeEntity(_0x2db024,null))[_0xce16('0x48')](handleError(_0x2db024,null));};exports[_0xce16('0x56')]=function(_0x9617fd,_0x46369a){var _0x352b1d=0xa;var _0x19322b=['join',_0xce16('0x57'),_0xce16('0x58'),_0xce16('0x59')];var _0x5bc511={'SUM':_0xce16('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce16('0x5b'),'MAX':_0xce16('0x5c'),'MIN':'MIN(%s)','AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':_0xce16('0x60')};var _0x4d7ef1={'SEC_TO_TIME':_0xce16('0x61'),'DATE':'DATE(%s)','HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b8ca2=function(_0xb68433){return!_['includes']([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),_0xce16('0x67')],_0xb68433);};var _0x5e9cfe=function(_0x5372d1){if(!_0x5372d1||!_0x5372d1[_0xce16('0x68')]['length']){return'';}for(var _0x382744='(',_0x396c00=0x0;_0x396c00<_0x5372d1[_0xce16('0x68')][_0xce16('0x35')];_0x396c00+=0x1){_0x396c00>0x0&&(_0x382744+='\x20'+_0x5372d1['operator']+'\x20');_0x382744+=_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x69')]?_0x5e9cfe(_0x5372d1[_0xce16('0x68')][_0x396c00]['group']):_0x5372d1['rules'][_0x396c00][_0xce16('0x6a')]+'\x20'+_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x6b')]+(_0x4b8ca2(_0x5372d1[_0xce16('0x68')][_0x396c00][_0xce16('0x6b')])?'\x20'+_0x5372d1[_0xce16('0x68')][_0x396c00]['value']:'');}return _0x382744+')';};var _0x13d828={'where':{'id':_0x9617fd[_0xce16('0x45')]['id']}},_0x33951b,_0xbcdd0c,_0x11a1b7,_0x66d52b,_0x5ba2ef;_0x13d828=_['merge']({},_0x13d828,_0x9617fd[_0xce16('0x3e')]);return db[_0xce16('0x41')]['find'](_0x13d828)['then'](function(_0x4ce7b6){if(_0x4ce7b6){_0x33951b=_0x4ce7b6;return _0x4ce7b6[_0xce16('0x6c')]();}return null;})['then'](function(_0x1325c7){if(_0x1325c7){if(!_0x1325c7[_0xce16('0x35')]){throw new db[(_0xce16('0x6d'))]['ValidationErrorItem'](_0xce16('0x6e'),0x193);}_0xbcdd0c=_0x1325c7;return db[_0xce16('0x6f')][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0x26a06e){if(_0x26a06e){_0x11a1b7=_[_0xce16('0x70')](_0x26a06e,'id');var _0x4bd519;var _0x1ebef8=squel['select']();_0x1ebef8['from'](_0x33951b['table']);for(var _0x8e5ebc=0x0;_0x8e5ebc<_0xbcdd0c['length'];_0x8e5ebc+=0x1){_0x4bd519=_0xbcdd0c[_0x8e5ebc][_0xce16('0x71')]?_0x11a1b7[_0xbcdd0c[_0x8e5ebc][_0xce16('0x71')]]['metric']:_0xbcdd0c[_0x8e5ebc][_0xce16('0x6a')];_0x4bd519=_0xbcdd0c[_0x8e5ebc][_0xce16('0x72')]?_[_0xce16('0x73')](_0x5bc511[_0xbcdd0c[_0x8e5ebc][_0xce16('0x72')]],'%s',_0x4bd519):_0x4bd519;_0x4bd519=_0xbcdd0c[_0x8e5ebc]['format']?_[_0xce16('0x73')](_0x4d7ef1[_0xbcdd0c[_0x8e5ebc][_0xce16('0x74')]],'%s',_0x4bd519):_0x4bd519;if(_0xbcdd0c[_0x8e5ebc][_0xce16('0x75')]){_0x1ebef8[_0xce16('0x69')](_0x4bd519);}_0xbcdd0c[_0x8e5ebc][_0xce16('0x76')]&&_0x1ebef8[_0xce16('0x77')](_0x4bd519,_0xbcdd0c[_0x8e5ebc][_0xce16('0x76')]==='DESC'?![]:!![]);_0x1ebef8[_0xce16('0x6a')](_0x4bd519,_0xbcdd0c[_0x8e5ebc]['alias']||_0x4bd519);}if(_0x33951b[_0xce16('0x78')]){_0x33951b['joins']=JSON[_0xce16('0x79')](_0x33951b[_0xce16('0x78')]);for(var _0x3666ab=0x0;_0x3666ab<_0x33951b[_0xce16('0x78')]['length'];_0x3666ab+=0x1){if(_0x33951b['joins'][_0x3666ab]['type']&&_[_0xce16('0x7a')](_0x19322b,_0x33951b['joins'][_0x3666ab][_0xce16('0x3c')])&&_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7b')]&&_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7c')]&&_0x33951b['joins'][_0x3666ab][_0xce16('0x7d')]){_0x1ebef8[_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x3c')]](_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7c')],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x33951b[_0xce16('0x7f')],_0x33951b[_0xce16('0x78')][_0x3666ab]['parentKey'],_0x33951b['joins'][_0x3666ab][_0xce16('0x7c')],_0x33951b[_0xce16('0x78')][_0x3666ab][_0xce16('0x7d')]));}}}if(_0x33951b['conditions']){_0x33951b[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x33951b[_0xce16('0x80')]);_0x1ebef8[_0xce16('0x39')](_0x5e9cfe(_0x33951b[_0xce16('0x80')]['group']));}_0x5ba2ef=_0x1ebef8['clone']();_0x1ebef8['limit'](_0x352b1d);_0x1ebef8[_0xce16('0x1b')](0x0);logger[_0xce16('0x81')](_0xce16('0x82'),_0x1ebef8[_0xce16('0x83')]());return dbH[_0xce16('0x84')][_0xce16('0x30')](_0x1ebef8['toString'](),{'type':dbH[_0xce16('0x84')][_0xce16('0x85')]['SELECT']});}})[_0xce16('0x25')](respondWithResult(_0x46369a,null))[_0xce16('0x48')](handleError(_0x46369a,null));};function runReport(_0x1e1865,_0x106327,_0x50ed40){var _0x4844f9=_0x106327[_0xce16('0x29')];var _0x23c20f=0xa;var _0x499e88=[_0xce16('0x86'),'left_join',_0xce16('0x58'),_0xce16('0x59')];var _0x4c345d={'SUM':_0xce16('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce16('0x5b'),'MAX':_0xce16('0x5c'),'MIN':_0xce16('0x87'),'AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4e506b={'SEC_TO_TIME':_0xce16('0x61'),'DATE':_0xce16('0x88'),'HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':_0xce16('0x89')};var _0x5b9096=function(_0x1e9703){return!_[_0xce16('0x7a')]([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),'IS\x20NOT\x20EMPTY'],_0x1e9703);};var _0x2dcadd=function(_0x2f84ae){if(!_0x2f84ae||!_0x2f84ae['rules'][_0xce16('0x35')]){return'';}for(var _0x46807a='(',_0x3400f8=0x0;_0x3400f8<_0x2f84ae[_0xce16('0x68')][_0xce16('0x35')];_0x3400f8+=0x1){_0x3400f8>0x0&&(_0x46807a+='\x20'+_0x2f84ae[_0xce16('0x8a')]+'\x20');_0x46807a+=_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x69')]?_0x2dcadd(_0x2f84ae['rules'][_0x3400f8][_0xce16('0x69')]):_0x2f84ae['rules'][_0x3400f8][_0xce16('0x6a')]+'\x20'+_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x6b')]+(_0x5b9096(_0x2f84ae['rules'][_0x3400f8][_0xce16('0x6b')])?'\x20'+_0x2f84ae[_0xce16('0x68')][_0x3400f8][_0xce16('0x8b')]:'');}return _0x46807a+')';};var _0x3b49d3={'where':{'id':_0x1e1865['id']}},_0x445a6b,_0xa961f0,_0x3c79e0,_0x1052a9,_0x1a0ac6;_0x3b49d3=_['merge']({},_0x3b49d3,_0x50ed40);return db[_0xce16('0x41')][_0xce16('0x47')](_0x3b49d3)[_0xce16('0x25')](function(_0x31942f){if(_0x31942f){_0x445a6b=_0x31942f;return _0x31942f[_0xce16('0x6c')]();}return null;})['then'](function(_0x12f3c7){if(_0x12f3c7){if(!_0x12f3c7[_0xce16('0x35')]){throw new db[(_0xce16('0x6d'))][(_0xce16('0x8c'))](_0xce16('0x6e'),0x193);}_0xa961f0=_0x12f3c7;return db['AnalyticMetric'][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0x5ed22b){if(_0x5ed22b){_0x3c79e0=_[_0xce16('0x70')](_0x5ed22b,'id');var _0x11acc3;var _0xfa3426=squel[_0xce16('0x8d')]();_0xfa3426[_0xce16('0x8e')](_0x445a6b[_0xce16('0x7f')]);for(var _0xf51611=0x0;_0xf51611<_0xa961f0[_0xce16('0x35')];_0xf51611+=0x1){_0x11acc3=_0xa961f0[_0xf51611]['MetricId']?_0x3c79e0[_0xa961f0[_0xf51611][_0xce16('0x71')]]['metric']:_0xa961f0[_0xf51611][_0xce16('0x6a')];_0x11acc3=_0xa961f0[_0xf51611][_0xce16('0x72')]?_[_0xce16('0x73')](_0x4c345d[_0xa961f0[_0xf51611]['function']],'%s',_0x11acc3):_0x11acc3;_0x11acc3=_0xa961f0[_0xf51611][_0xce16('0x74')]?_['replace'](_0x4e506b[_0xa961f0[_0xf51611]['format']],'%s',_0x11acc3):_0x11acc3;if(_0xa961f0[_0xf51611]['groupBy']){_0xfa3426[_0xce16('0x69')](_0x11acc3);}_0xa961f0[_0xf51611][_0xce16('0x76')]&&_0xfa3426[_0xce16('0x77')](_0x11acc3,_0xa961f0[_0xf51611][_0xce16('0x76')]==='DESC'?![]:!![]);_0xfa3426[_0xce16('0x6a')](_0x11acc3,_0xa961f0[_0xf51611][_0xce16('0x8f')]||_0x11acc3);}if(_0x445a6b[_0xce16('0x78')]){_0x445a6b['joins']=JSON['parse'](_0x445a6b[_0xce16('0x78')]);for(var _0x15511d=0x0;_0x15511d<_0x445a6b[_0xce16('0x78')][_0xce16('0x35')];_0x15511d+=0x1){if(_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x3c')]&&_[_0xce16('0x7a')](_0x499e88,_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x3c')])&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7b')]&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7c')]&&_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7d')]){_0xfa3426[_0x445a6b['joins'][_0x15511d][_0xce16('0x3c')]](_0x445a6b[_0xce16('0x78')][_0x15511d]['foreignTable'],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x445a6b[_0xce16('0x7f')],_0x445a6b['joins'][_0x15511d][_0xce16('0x7b')],_0x445a6b[_0xce16('0x78')][_0x15511d][_0xce16('0x7c')],_0x445a6b[_0xce16('0x78')][_0x15511d]['foreignKey']));}}}if(_0x445a6b['conditions']){_0x445a6b[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x445a6b['conditions']);_0xfa3426[_0xce16('0x39')](_0x2dcadd(_0x445a6b['conditions'][_0xce16('0x69')]));}_0x1a0ac6=_0xfa3426[_0xce16('0x90')]();_0xfa3426['limit'](_0x23c20f);_0xfa3426['offset'](0x0);return;}})['then'](function(){if(_0x106327['output']===_0xce16('0x91')){return null;}var _0x117816=_[_0xce16('0x46')](_0x106327,{'name':_0x106327[_0xce16('0x92')]||_0x106327['name']||_0x445a6b[_0xce16('0x29')],'basename':_0x4844f9,'savename':util['format'](_0xce16('0x93'),_0x106327[_0xce16('0x29')]||_0x445a6b['name'],require(_0xce16('0x94'))[_0xce16('0x95')](0x4),_0x106327[_0xce16('0x96')]||_0xce16('0x97')),'reportId':_0x445a6b['id'],'reportType':'custom'});return db[_0xce16('0x98')][_0xce16('0x49')](_0x117816,{'raw':!![]});})[_0xce16('0x25')](function(_0x4722b9){if(_0x445a6b[_0xce16('0x7f')]===_0xce16('0x99')){_0x1a0ac6[_0xce16('0x39')](_0x445a6b[_0xce16('0x7f')]+_0xce16('0x9a'),_0x106327[_0xce16('0x9b')],_0x106327[_0xce16('0x9c')]);}else{_0x1a0ac6[_0xce16('0x39')](_0x445a6b[_0xce16('0x7f')]+_0xce16('0x9d'),_0x106327[_0xce16('0x9b')],_0x106327[_0xce16('0x9c')]);}if(_0x4722b9){logger[_0xce16('0x9e')](_0xce16('0x9f'),_0x1a0ac6[_0xce16('0x83')]());require(_0xce16('0xa0'))[_0xce16('0xa1')](path['join'](__dirname,'../../components/export/',_0x4722b9[_0xce16('0x96')]),[_0x4722b9['id'],_0x1a0ac6[_0xce16('0x83')](),path[_0xce16('0x86')](__dirname,'../../files/reports',_0x4722b9[_0xce16('0xa2')]),_0x4844f9]);return _0x4722b9;}else{var _0x5ae125=squel[_0xce16('0x8d')]();_0x5ae125[_0xce16('0x8e')]('('+_0x1a0ac6[_0xce16('0x83')]()+')',_0xce16('0xa3'));_0x5ae125[_0xce16('0x6a')]('COUNT(*)','count');_0x1a0ac6[_0xce16('0x1e')](_0x106327[_0xce16('0x1e')]||_0x23c20f);_0x1a0ac6[_0xce16('0x1b')](_0x106327[_0xce16('0x1b')]||0x0);return dbH[_0xce16('0x84')][_0xce16('0x30')](_0x5ae125[_0xce16('0x83')](),{'type':dbH[_0xce16('0x84')][_0xce16('0x85')][_0xce16('0xa4')]})['then'](function(_0x520de0){if(!_0x520de0['length']){_0x1052a9=0x0;}else{_0x1052a9=_0x520de0[0x0]['count']||0x0;}return dbH['sequelize'][_0xce16('0x30')](_0x1a0ac6[_0xce16('0x83')](),{'type':dbH['sequelize'][_0xce16('0x85')]['SELECT']});})['then'](function(_0xa2fc7a){return{'rows':_0xa2fc7a||[],'count':_0x1052a9};});}});}exports[_0xce16('0xa5')]=function(_0x6dd44f,_0x8fc98e){return runReport(_0x6dd44f[_0xce16('0x45')],_0x6dd44f['query'],_0x6dd44f[_0xce16('0x3e')])[_0xce16('0x25')](respondWithResult(_0x8fc98e,null))[_0xce16('0x48')](handleError(_0x8fc98e,null));};exports[_0xce16('0xa6')]=runReport;exports['query']=function(_0x5a81ad,_0x33ac99){var _0x478714=0xa;var _0x4672fe=[_0xce16('0x86'),_0xce16('0x57'),_0xce16('0x58'),_0xce16('0x59')];var _0x13a6e3={'SUM':_0xce16('0x5a'),'COUNT':_0xce16('0xa7'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xce16('0x5c'),'MIN':_0xce16('0x87'),'AVG':_0xce16('0x5d'),'GROUP_CONCAT':_0xce16('0x5e'),'GROUP_CONCAT ASC':_0xce16('0x5f'),'GROUP_CONCAT DESC':_0xce16('0x60')};var _0x16196b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xce16('0x62'),'ROUND':_0xce16('0x63'),'UNIX_TIMESTAMP':_0xce16('0x89')};var _0x305baf=function(_0x1c4b49){return!_[_0xce16('0x7a')]([_0xce16('0x64'),_0xce16('0x65'),_0xce16('0x66'),_0xce16('0x67')],_0x1c4b49);};var _0x7352d6=function(_0x1c2228){if(!_0x1c2228||!_0x1c2228[_0xce16('0x68')][_0xce16('0x35')]){return'';}for(var _0x8737c6='(',_0x5c502d=0x0;_0x5c502d<_0x1c2228[_0xce16('0x68')][_0xce16('0x35')];_0x5c502d+=0x1){_0x5c502d>0x0&&(_0x8737c6+='\x20'+_0x1c2228[_0xce16('0x8a')]+'\x20');_0x8737c6+=_0x1c2228[_0xce16('0x68')][_0x5c502d]['group']?_0x7352d6(_0x1c2228[_0xce16('0x68')][_0x5c502d]['group']):_0x1c2228[_0xce16('0x68')][_0x5c502d]['field']+'\x20'+_0x1c2228[_0xce16('0x68')][_0x5c502d][_0xce16('0x6b')]+(_0x305baf(_0x1c2228['rules'][_0x5c502d][_0xce16('0x6b')])?'\x20'+_0x1c2228[_0xce16('0x68')][_0x5c502d][_0xce16('0x8b')]:'');}return _0x8737c6+')';};var _0x17bd1c={'where':{'id':_0x5a81ad[_0xce16('0x45')]['id']}},_0x159b47,_0x21731a,_0x49196,_0x43eec5,_0x45b1f6;_0x17bd1c=_['merge']({},_0x17bd1c,_0x5a81ad[_0xce16('0x3e')]);return db[_0xce16('0x41')][_0xce16('0x47')](_0x17bd1c)[_0xce16('0x25')](function(_0x3a5488){if(_0x3a5488){_0x159b47=_0x3a5488;return _0x3a5488[_0xce16('0x6c')]();}return null;})[_0xce16('0x25')](function(_0x111e04){if(_0x111e04){if(!_0x111e04['length']){throw new db['Sequelize'][(_0xce16('0x8c'))](_0xce16('0x6e'),0x193);}_0x21731a=_0x111e04;return db['AnalyticMetric'][_0xce16('0x42')]({'raw':!![]});}return null;})[_0xce16('0x25')](function(_0xe28015){if(_0xe28015){_0x49196=_['keyBy'](_0xe28015,'id');var _0x23a2da;var _0x26c20a=squel[_0xce16('0x8d')]();_0x26c20a[_0xce16('0x8e')](_0x159b47[_0xce16('0x7f')]);for(var _0x50df2a=0x0;_0x50df2a<_0x21731a[_0xce16('0x35')];_0x50df2a+=0x1){_0x23a2da=_0x21731a[_0x50df2a]['MetricId']?_0x49196[_0x21731a[_0x50df2a][_0xce16('0x71')]][_0xce16('0xa8')]:_0x21731a[_0x50df2a][_0xce16('0x6a')];_0x23a2da=_0x21731a[_0x50df2a][_0xce16('0x72')]?_[_0xce16('0x73')](_0x13a6e3[_0x21731a[_0x50df2a][_0xce16('0x72')]],'%s',_0x23a2da):_0x23a2da;_0x23a2da=_0x21731a[_0x50df2a][_0xce16('0x74')]?_['replace'](_0x16196b[_0x21731a[_0x50df2a][_0xce16('0x74')]],'%s',_0x23a2da):_0x23a2da;if(_0x21731a[_0x50df2a]['groupBy']){_0x26c20a[_0xce16('0x69')](_0x23a2da);}_0x21731a[_0x50df2a][_0xce16('0x76')]&&_0x26c20a['order'](_0x23a2da,_0x21731a[_0x50df2a][_0xce16('0x76')]==='DESC'?![]:!![]);_0x26c20a[_0xce16('0x6a')](_0x23a2da,_0x21731a[_0x50df2a][_0xce16('0x8f')]||_0x23a2da);}if(_0x159b47[_0xce16('0x78')]){_0x159b47[_0xce16('0x78')]=JSON['parse'](_0x159b47[_0xce16('0x78')]);for(var _0x5914c3=0x0;_0x5914c3<_0x159b47[_0xce16('0x78')][_0xce16('0x35')];_0x5914c3+=0x1){if(_0x159b47['joins'][_0x5914c3][_0xce16('0x3c')]&&_[_0xce16('0x7a')](_0x4672fe,_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x3c')])&&_0x159b47['joins'][_0x5914c3]['parentKey']&&_0x159b47['joins'][_0x5914c3][_0xce16('0x7c')]&&_0x159b47[_0xce16('0x78')][_0x5914c3]['foreignKey']){_0x26c20a[_0x159b47[_0xce16('0x78')][_0x5914c3]['type']](_0x159b47[_0xce16('0x78')][_0x5914c3]['foreignTable'],null,util[_0xce16('0x74')](_0xce16('0x7e'),_0x159b47[_0xce16('0x7f')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7b')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7c')],_0x159b47[_0xce16('0x78')][_0x5914c3][_0xce16('0x7d')]));}}}if(_0x159b47[_0xce16('0x80')]){_0x159b47[_0xce16('0x80')]=JSON[_0xce16('0x79')](_0x159b47['conditions']);_0x26c20a[_0xce16('0x39')](_0x7352d6(_0x159b47[_0xce16('0x80')]['group']));}_0x45b1f6=_0x26c20a[_0xce16('0x90')]();_0x26c20a['limit'](_0x478714);_0x26c20a[_0xce16('0x1b')](0x0);logger[_0xce16('0x81')]('Limited\x20Query:',_0x26c20a[_0xce16('0x83')]());return dbH[_0xce16('0x84')]['query'](_0x26c20a[_0xce16('0x83')](),{'type':dbH['sequelize'][_0xce16('0x85')][_0xce16('0xa4')]});}})['then'](function(){return{'sql':_0x45b1f6[_0xce16('0x83')]()};})[_0xce16('0x25')](respondWithResult(_0x33ac99,null))['catch'](handleError(_0x33ac99,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index a754cda..fe4dfa2 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 _0x7e74=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1cb41c,_0x4fbffe){var _0x41ea58=function(_0x2ce1aa){while(--_0x2ce1aa){_0x1cb41c['push'](_0x1cb41c['shift']());}};_0x41ea58(++_0x4fbffe);}(_0x7e74,0x165));var _0x47e7=function(_0x41ea3a,_0x3139aa){_0x41ea3a=_0x41ea3a-0x0;var _0x55ebf1=_0x7e74[_0x41ea3a];return _0x55ebf1;};'use strict';var _=require('lodash');var util=require(_0x47e7('0x0'));var logger=require(_0x47e7('0x1'))(_0x47e7('0x2'));var moment=require(_0x47e7('0x3'));var BPromise=require(_0x47e7('0x4'));var rp=require(_0x47e7('0x5'));var fs=require('fs');var path=require(_0x47e7('0x6'));var rimraf=require(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x47e7('0x9')]=function(_0x267e1f,_0x48eb13){return _0x267e1f[_0x47e7('0xa')](_0x47e7('0xb'),attributes,{'tableName':_0x47e7('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf61=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x2514b4,_0x219880){var _0x4bcaa5=function(_0x6d2472){while(--_0x6d2472){_0x2514b4['push'](_0x2514b4['shift']());}};_0x4bcaa5(++_0x219880);}(_0xcf61,0x157));var _0x1cf6=function(_0x247e29,_0x540032){_0x247e29=_0x247e29-0x0;var _0x5ec66e=_0xcf61[_0x247e29];return _0x5ec66e;};'use strict';var _=require(_0x1cf6('0x0'));var util=require(_0x1cf6('0x1'));var logger=require(_0x1cf6('0x2'))(_0x1cf6('0x3'));var moment=require(_0x1cf6('0x4'));var BPromise=require(_0x1cf6('0x5'));var rp=require(_0x1cf6('0x6'));var fs=require('fs');var path=require(_0x1cf6('0x7'));var rimraf=require(_0x1cf6('0x8'));var config=require(_0x1cf6('0x9'));var attributes=require(_0x1cf6('0xa'));module['exports']=function(_0xd35121,_0x311844){return _0xd35121['define']('AnalyticCustomReport',attributes,{'tableName':_0x1cf6('0xb'),'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 d6c0012..299a379 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 _0xb1e5=['../../mysqldb','../../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','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1be767,_0x1386e0){var _0x45124e=function(_0x49f8da){while(--_0x49f8da){_0x1be767['push'](_0x1be767['shift']());}};_0x45124e(++_0x1386e0);}(_0xb1e5,0xcb));var _0x5b1e=function(_0x507245,_0x3d87ed){_0x507245=_0x507245-0x0;var _0x39a50e=_0xb1e5[_0x507245];return _0x39a50e;};'use strict';var _=require(_0x5b1e('0x0'));var util=require(_0x5b1e('0x1'));var moment=require('moment');var BPromise=require(_0x5b1e('0x2'));var rs=require(_0x5b1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b1e('0x5'))(_0x5b1e('0x6'));var config=require(_0x5b1e('0x7'));var jayson=require(_0x5b1e('0x8'));var client=jayson['client'][_0x5b1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b7661,_0x19fb90,_0x4316a0){return new BPromise(function(_0x3152a9,_0x15edc8){return client[_0x5b1e('0xa')](_0x3b7661,_0x4316a0)[_0x5b1e('0xb')](function(_0x16efd0){logger[_0x5b1e('0xc')](_0x5b1e('0xd'),_0x19fb90,_0x5b1e('0xe'));logger[_0x5b1e('0xf')](_0x5b1e('0x10'),_0x19fb90,_0x5b1e('0xe'),JSON[_0x5b1e('0x11')](_0x16efd0));if(_0x16efd0[_0x5b1e('0x12')]){if(_0x16efd0['error'][_0x5b1e('0x13')]===0x1f4){logger[_0x5b1e('0x12')](_0x5b1e('0xd'),_0x19fb90,_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);return _0x15edc8(_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);}logger[_0x5b1e('0x12')](_0x5b1e('0xd'),_0x19fb90,_0x16efd0[_0x5b1e('0x12')][_0x5b1e('0x14')]);return _0x3152a9(_0x16efd0[_0x5b1e('0x12')]['message']);}else{logger[_0x5b1e('0xc')](_0x5b1e('0xd'),_0x19fb90,_0x5b1e('0xe'));_0x3152a9(_0x16efd0[_0x5b1e('0x15')][_0x5b1e('0x14')]);}})[_0x5b1e('0x16')](function(_0x17cb68){logger[_0x5b1e('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x19fb90,_0x17cb68);_0x15edc8(_0x17cb68);});});} \ No newline at end of file +var _0x04bc=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4bb956,_0x33236b){var _0x4099a3=function(_0x37f993){while(--_0x37f993){_0x4bb956['push'](_0x4bb956['shift']());}};_0x4099a3(++_0x33236b);}(_0x04bc,0x1ba));var _0xc04b=function(_0x3cf8f1,_0x574345){_0x3cf8f1=_0x3cf8f1-0x0;var _0x1e8db8=_0x04bc[_0x3cf8f1];return _0x1e8db8;};'use strict';var _=require('lodash');var util=require(_0xc04b('0x0'));var moment=require('moment');var BPromise=require(_0xc04b('0x1'));var rs=require(_0xc04b('0x2'));var fs=require('fs');var Redis=require(_0xc04b('0x3'));var db=require(_0xc04b('0x4'))['db'];var utils=require(_0xc04b('0x5'));var logger=require(_0xc04b('0x6'))('rpc');var config=require(_0xc04b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc04b('0x8')][_0xc04b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e0063,_0x4c4963,_0x46d200){return new BPromise(function(_0x486774,_0x4dc2d8){return client['request'](_0x4e0063,_0x46d200)[_0xc04b('0xa')](function(_0x1abb0f){logger[_0xc04b('0xb')](_0xc04b('0xc'),_0x4c4963,_0xc04b('0xd'));logger[_0xc04b('0xe')](_0xc04b('0xf'),_0x4c4963,_0xc04b('0xd'),JSON[_0xc04b('0x10')](_0x1abb0f));if(_0x1abb0f[_0xc04b('0x11')]){if(_0x1abb0f[_0xc04b('0x11')]['code']===0x1f4){logger['error'](_0xc04b('0xc'),_0x4c4963,_0x1abb0f[_0xc04b('0x11')]['message']);return _0x4dc2d8(_0x1abb0f[_0xc04b('0x11')][_0xc04b('0x12')]);}logger[_0xc04b('0x11')](_0xc04b('0xc'),_0x4c4963,_0x1abb0f['error']['message']);return _0x486774(_0x1abb0f['error'][_0xc04b('0x12')]);}else{logger[_0xc04b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c4963,_0xc04b('0xd'));_0x486774(_0x1abb0f[_0xc04b('0x13')]['message']);}})[_0xc04b('0x14')](function(_0x469557){logger[_0xc04b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c4963,_0x469557);_0x4dc2d8(_0x469557);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 6e5e28d..e751e5d 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 _0xa01a=['/:id/query','query','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run'];(function(_0x15e961,_0x27e7f4){var _0x1b8be3=function(_0x3434d0){while(--_0x3434d0){_0x15e961['push'](_0x15e961['shift']());}};_0x1b8be3(++_0x27e7f4);}(_0xa01a,0x166));var _0xaa01=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa01a[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0xaa01('0x0'));var path=require(_0xaa01('0x1'));var timeout=require(_0xaa01('0x2'));var express=require(_0xaa01('0x3'));var router=express['Router']();var fs_extra=require(_0xaa01('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaa01('0x5'));var config=require(_0xaa01('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xaa01('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa01('0x8')]);router['get'](_0xaa01('0x9'),auth[_0xaa01('0xa')](),controller[_0xaa01('0xb')]);router[_0xaa01('0x7')](_0xaa01('0xc'),auth[_0xaa01('0xa')](),controller[_0xaa01('0xd')]);router[_0xaa01('0x7')](_0xaa01('0xe'),auth['isAuthenticated'](),controller[_0xaa01('0xf')]);router[_0xaa01('0x7')](_0xaa01('0x10'),auth['isAuthenticated'](),controller[_0xaa01('0x11')]);router['post']('/',auth[_0xaa01('0xa')](),controller['create']);router['put'](_0xaa01('0x9'),auth['isAuthenticated'](),controller[_0xaa01('0x12')]);router[_0xaa01('0x13')](_0xaa01('0x9'),auth['isAuthenticated'](),controller[_0xaa01('0x14')]);module[_0xaa01('0x15')]=router; \ No newline at end of file +var _0xaedd=['fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/run','run','/:id/query','create','put','update','delete','/:id','multer','util','Router'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xaedd,0x96));var _0xdaed=function(_0xbc90d4,_0x568e8a){_0xbc90d4=_0xbc90d4-0x0;var _0x4e0548=_0xaedd[_0xbc90d4];return _0x4e0548;};'use strict';var multer=require(_0xdaed('0x0'));var util=require(_0xdaed('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdaed('0x2')]();var fs_extra=require(_0xdaed('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdaed('0x4'));var config=require('../../config/environment');var controller=require(_0xdaed('0x5'));router[_0xdaed('0x6')]('/',auth[_0xdaed('0x7')](),controller['index']);router[_0xdaed('0x6')]('/:id',auth[_0xdaed('0x7')](),controller[_0xdaed('0x8')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xdaed('0x6')](_0xdaed('0x9'),auth[_0xdaed('0x7')](),controller[_0xdaed('0xa')]);router['get'](_0xdaed('0xb'),auth[_0xdaed('0x7')](),controller['query']);router['post']('/',auth[_0xdaed('0x7')](),controller[_0xdaed('0xc')]);router[_0xdaed('0xd')]('/:id',auth[_0xdaed('0x7')](),controller[_0xdaed('0xe')]);router[_0xdaed('0xf')](_0xdaed('0x10'),auth[_0xdaed('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 451c053..d6abcd2 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x16462,_0x37c6d0){var _0x308bf3=function(_0x118202){while(--_0x118202){_0x16462['push'](_0x16462['shift']());}};_0x308bf3(++_0x37c6d0);}(_0x326f,0xd1));var _0xf326=function(_0x1101f0,_0x48c216){_0x1101f0=_0x1101f0-0x0;var _0x30acf2=_0x326f[_0x1101f0];return _0x30acf2;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file +var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x4eee80,_0x4a0b9a){var _0x10d6f0=function(_0x1ac511){while(--_0x1ac511){_0x4eee80['push'](_0x4eee80['shift']());}};_0x10d6f0(++_0x4a0b9a);}(_0xf494,0x1c6));var _0x4f49=function(_0x1204f3,_0x3eaf4d){_0x1204f3=_0x1204f3-0x0;var _0x57e89a=_0xf494[_0x1204f3];return _0x57e89a;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d4c1ef6..d1670ef 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x10b2c4,_0x4b10ed){var _0xb10a8e=function(_0x58ff68){while(--_0x58ff68){_0x10b2c4['push'](_0x10b2c4['shift']());}};_0xb10a8e(++_0x4b10ed);}(_0x4819,0xcd));var _0x9481=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0x4819[_0x476c6c];return _0xbb94db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file +var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x169dab,_0x3dcafb){var _0x5e2d3e=function(_0x143edd){while(--_0x143edd){_0x169dab['push'](_0x169dab['shift']());}};_0x5e2d3e(++_0x3dcafb);}(_0x46ed,0x168));var _0xd46e=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x46ed[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4e1ca35..1a6c509 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 _0x3298=['bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','moment'];(function(_0x43839e,_0x54d3c7){var _0x3d538a=function(_0x57013e){while(--_0x57013e){_0x43839e['push'](_0x43839e['shift']());}};_0x3d538a(++_0x54d3c7);}(_0x3298,0x1b5));var _0x8329=function(_0x3f90ee,_0xbaa884){_0x3f90ee=_0x3f90ee-0x0;var _0x1eab5a=_0x3298[_0x3f90ee];return _0x1eab5a;};'use strict';var _=require(_0x8329('0x0'));var util=require('util');var logger=require(_0x8329('0x1'))('api');var moment=require(_0x8329('0x2'));var BPromise=require(_0x8329('0x3'));var rp=require(_0x8329('0x4'));var fs=require('fs');var path=require(_0x8329('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8329('0x6'));module[_0x8329('0x7')]=function(_0x513d96,_0x25d0af){return _0x513d96[_0x8329('0x8')](_0x8329('0x9'),attributes,{'tableName':_0x8329('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a0=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x49d4c1,_0x548f27){var _0x4d43db=function(_0x933e46){while(--_0x933e46){_0x49d4c1['push'](_0x49d4c1['shift']());}};_0x4d43db(++_0x548f27);}(_0x72a0,0xb5));var _0x072a=function(_0x4a6682,_0x98e04d){_0x4a6682=_0x4a6682-0x0;var _0x1a1e62=_0x72a0[_0x4a6682];return _0x1a1e62;};'use strict';var _=require(_0x072a('0x0'));var util=require(_0x072a('0x1'));var logger=require(_0x072a('0x2'))('api');var moment=require(_0x072a('0x3'));var BPromise=require('bluebird');var rp=require(_0x072a('0x4'));var fs=require('fs');var path=require(_0x072a('0x5'));var rimraf=require(_0x072a('0x6'));var config=require(_0x072a('0x7'));var attributes=require(_0x072a('0x8'));module[_0x072a('0x9')]=function(_0x14bdd0,_0x204c8f){return _0x14bdd0['define']('AnalyticDefaultReport',attributes,{'tableName':_0x072a('0xa'),'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 e75e7a8..b96119f 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 _0xdcd9=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x31f0a7,_0x40a73a){var _0xfe717d=function(_0x514262){while(--_0x514262){_0x31f0a7['push'](_0x31f0a7['shift']());}};_0xfe717d(++_0x40a73a);}(_0xdcd9,0x125));var _0x9dcd=function(_0x47cd2a,_0x166558){_0x47cd2a=_0x47cd2a-0x0;var _0x245e4f=_0xdcd9[_0x47cd2a];return _0x245e4f;};'use strict';var _=require(_0x9dcd('0x0'));var util=require('util');var moment=require(_0x9dcd('0x1'));var BPromise=require(_0x9dcd('0x2'));var rs=require(_0x9dcd('0x3'));var fs=require('fs');var Redis=require(_0x9dcd('0x4'));var db=require(_0x9dcd('0x5'))['db'];var utils=require(_0x9dcd('0x6'));var logger=require(_0x9dcd('0x7'))(_0x9dcd('0x8'));var config=require(_0x9dcd('0x9'));var jayson=require(_0x9dcd('0xa'));var client=jayson[_0x9dcd('0xb')][_0x9dcd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46d905,_0x40da01,_0x3a2f6d){return new BPromise(function(_0x3f9e73,_0x487155){return client[_0x9dcd('0xd')](_0x46d905,_0x3a2f6d)[_0x9dcd('0xe')](function(_0x166ddf){logger[_0x9dcd('0xf')](_0x9dcd('0x10'),_0x40da01,_0x9dcd('0x11'));logger[_0x9dcd('0x12')](_0x9dcd('0x13'),_0x40da01,_0x9dcd('0x11'),JSON[_0x9dcd('0x14')](_0x166ddf));if(_0x166ddf[_0x9dcd('0x15')]){if(_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x16')]===0x1f4){logger[_0x9dcd('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x40da01,_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x17')]);return _0x487155(_0x166ddf[_0x9dcd('0x15')]['message']);}logger[_0x9dcd('0x15')](_0x9dcd('0x10'),_0x40da01,_0x166ddf['error'][_0x9dcd('0x17')]);return _0x3f9e73(_0x166ddf[_0x9dcd('0x15')][_0x9dcd('0x17')]);}else{logger['info'](_0x9dcd('0x10'),_0x40da01,_0x9dcd('0x11'));_0x3f9e73(_0x166ddf[_0x9dcd('0x18')]['message']);}})[_0x9dcd('0x19')](function(_0x1283f1){logger[_0x9dcd('0x15')](_0x9dcd('0x10'),_0x40da01,_0x1283f1);_0x487155(_0x1283f1);});});} \ No newline at end of file +var _0xf21a=['error','code','message','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x348a38,_0x5295d5){var _0x4edc31=function(_0xeef470){while(--_0xeef470){_0x348a38['push'](_0x348a38['shift']());}};_0x4edc31(++_0x5295d5);}(_0xf21a,0x146));var _0xaf21=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf21a[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xaf21('0x0'));var moment=require(_0xaf21('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf21('0x2'));var db=require(_0xaf21('0x3'))['db'];var utils=require(_0xaf21('0x4'));var logger=require(_0xaf21('0x5'))(_0xaf21('0x6'));var config=require('../../config/environment');var jayson=require(_0xaf21('0x7'));var client=jayson[_0xaf21('0x8')][_0xaf21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37ca86,_0x25685c,_0x44f780){return new BPromise(function(_0xb86ef1,_0x452d01){return client['request'](_0x37ca86,_0x44f780)[_0xaf21('0xa')](function(_0x335f39){logger[_0xaf21('0xb')](_0xaf21('0xc'),_0x25685c,'request\x20sent');logger[_0xaf21('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x25685c,_0xaf21('0xe'),JSON[_0xaf21('0xf')](_0x335f39));if(_0x335f39[_0xaf21('0x10')]){if(_0x335f39[_0xaf21('0x10')][_0xaf21('0x11')]===0x1f4){logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x335f39[_0xaf21('0x10')]['message']);return _0x452d01(_0x335f39['error'][_0xaf21('0x12')]);}logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x335f39['error'][_0xaf21('0x12')]);return _0xb86ef1(_0x335f39[_0xaf21('0x10')]['message']);}else{logger['info'](_0xaf21('0xc'),_0x25685c,_0xaf21('0xe'));_0xb86ef1(_0x335f39['result']['message']);}})['catch'](function(_0x1b9103){logger[_0xaf21('0x10')](_0xaf21('0xc'),_0x25685c,_0x1b9103);_0x452d01(_0x1b9103);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7017472..682d4db 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 _0x6b06=['show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','update','delete','/:id','exports','multer','util','path','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x6b06,0xd4));var _0x66b0=function(_0x478b35,_0x49dced){_0x478b35=_0x478b35-0x0;var _0x542c50=_0x6b06[_0x478b35];return _0x542c50;};'use strict';var multer=require(_0x66b0('0x0'));var util=require(_0x66b0('0x1'));var path=require(_0x66b0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x66b0('0x3'));var controller=require(_0x66b0('0x4'));router[_0x66b0('0x5')]('/',auth[_0x66b0('0x6')](),controller[_0x66b0('0x7')]);router[_0x66b0('0x5')]('/:id',auth[_0x66b0('0x6')](),controller[_0x66b0('0x8')]);router[_0x66b0('0x5')](_0x66b0('0x9'),auth['isAuthenticated'](),controller[_0x66b0('0xa')]);router[_0x66b0('0x5')](_0x66b0('0xb'),auth[_0x66b0('0x6')](),controller[_0x66b0('0xc')]);router[_0x66b0('0x5')](_0x66b0('0xd'),auth[_0x66b0('0x6')](),controller['query']);router[_0x66b0('0xe')]('/',auth['isAuthenticated'](),controller[_0x66b0('0xf')]);router['put']('/:id',auth[_0x66b0('0x6')](),controller[_0x66b0('0x10')]);router[_0x66b0('0x11')](_0x66b0('0x12'),auth[_0x66b0('0x6')](),controller['destroy']);module[_0x66b0('0x13')]=router; \ No newline at end of file +var _0x4eb3=['post','create','delete','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run','query'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4eb3,0x17f));var _0x34eb=function(_0x3c059c,_0x2dc0cb){_0x3c059c=_0x3c059c-0x0;var _0x1323e4=_0x4eb3[_0x3c059c];return _0x1323e4;};'use strict';var multer=require(_0x34eb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34eb('0x1'));var express=require('express');var router=express[_0x34eb('0x2')]();var fs_extra=require(_0x34eb('0x3'));var auth=require(_0x34eb('0x4'));var interaction=require(_0x34eb('0x5'));var config=require(_0x34eb('0x6'));var controller=require(_0x34eb('0x7'));router['get']('/',auth[_0x34eb('0x8')](),controller[_0x34eb('0x9')]);router['get'](_0x34eb('0xa'),auth[_0x34eb('0x8')](),controller['show']);router[_0x34eb('0xb')](_0x34eb('0xc'),auth[_0x34eb('0x8')](),controller[_0x34eb('0xd')]);router[_0x34eb('0xb')](_0x34eb('0xe'),auth[_0x34eb('0x8')](),controller['run']);router[_0x34eb('0xb')]('/:id/query',auth[_0x34eb('0x8')](),controller[_0x34eb('0xf')]);router[_0x34eb('0x10')]('/',auth[_0x34eb('0x8')](),controller[_0x34eb('0x11')]);router['put']('/:id',auth[_0x34eb('0x8')](),controller['update']);router[_0x34eb('0x12')](_0x34eb('0xa'),auth[_0x34eb('0x8')](),controller['destroy']);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 c8981c8..e9a732a 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 _0x7de2=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv'];(function(_0x496fe4,_0x272d02){var _0x52729b=function(_0x581515){while(--_0x581515){_0x496fe4['push'](_0x496fe4['shift']());}};_0x52729b(++_0x272d02);}(_0x7de2,0xaf));var _0x27de=function(_0x473898,_0x13fe84){_0x473898=_0x473898-0x0;var _0x3d9a17=_0x7de2[_0x473898];return _0x3d9a17;};'use strict';var Sequelize=require(_0x27de('0x0'));var moment=require('moment');module[_0x27de('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x27de('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x4'),_0x27de('0x5'),_0x27de('0x6')),'allowNull':![],'defaultValue':_0x27de('0x4')},'savename':{'type':Sequelize[_0x27de('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x27de('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x27de('0x2')],'defaultValue':_0x27de('0x8')},'type':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x9'),_0x27de('0xa')),'allowNull':![],'defaultValue':_0x27de('0x9')},'reportId':{'type':Sequelize[_0x27de('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x27de('0x2')]}}; \ No newline at end of file +var _0xed62=['sequelize','exports','STRING','ENUM','csv','pdf','DATE','manual','scheduled','UNSIGNED'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0xed62,0xc8));var _0x2ed6=function(_0x23c549,_0x2e12c5){_0x23c549=_0x23c549-0x0;var _0x35e1b7=_0xed62[_0x23c549];return _0x35e1b7;};'use strict';var Sequelize=require(_0x2ed6('0x0'));var moment=require('moment');module[_0x2ed6('0x1')]={'name':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2ed6('0x3')](_0x2ed6('0x4'),_0x2ed6('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2ed6('0x4')},'savename':{'type':Sequelize[_0x2ed6('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2ed6('0x6')]},'endDate':{'type':Sequelize[_0x2ed6('0x6')]},'status':{'type':Sequelize[_0x2ed6('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x2ed6('0x3')](_0x2ed6('0x7'),_0x2ed6('0x8')),'allowNull':![],'defaultValue':_0x2ed6('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2ed6('0x9')]},'reportType':{'type':Sequelize[_0x2ed6('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index a42ec79..d274717 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 _0x7ecd=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','get','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','AnalyticExtractedReport','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x54cd0b,_0x182ab9){var _0x2dbfb7=function(_0x41d47e){while(--_0x41d47e){_0x54cd0b['push'](_0x54cd0b['shift']());}};_0x2dbfb7(++_0x182ab9);}(_0x7ecd,0x87));var _0xd7ec=function(_0x3526d1,_0x4f18fa){_0x3526d1=_0x3526d1-0x0;var _0x32442f=_0x7ecd[_0x3526d1];return _0x32442f;};'use strict';var emlformat=require(_0xd7ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd7ec('0x1'));var jsonpatch=require(_0xd7ec('0x2'));var rp=require('request-promise');var moment=require(_0xd7ec('0x3'));var BPromise=require(_0xd7ec('0x4'));var Mustache=require('mustache');var util=require(_0xd7ec('0x5'));var path=require(_0xd7ec('0x6'));var sox=require(_0xd7ec('0x7'));var csv=require('to-csv');var ejs=require(_0xd7ec('0x8'));var fs=require('fs');var fs_extra=require(_0xd7ec('0x9'));var _=require(_0xd7ec('0xa'));var squel=require(_0xd7ec('0xb'));var crypto=require(_0xd7ec('0xc'));var jsforce=require(_0xd7ec('0xd'));var deskjs=require(_0xd7ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd7ec('0xf'));var Papa=require(_0xd7ec('0x10'));var Redis=require(_0xd7ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd7ec('0x12'));var as=require(_0xd7ec('0x13'));var hardwareService=require(_0xd7ec('0x14'));var logger=require(_0xd7ec('0x15'))(_0xd7ec('0x16'));var utils=require(_0xd7ec('0x17'));var config=require(_0xd7ec('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7ec('0x19'))['db'];function respondWithStatusCode(_0x360aef,_0x2f6c19){_0x2f6c19=_0x2f6c19||0xcc;return function(_0x56e446){if(_0x56e446){return _0x360aef[_0xd7ec('0x1a')](_0x2f6c19);}return _0x360aef[_0xd7ec('0x1b')](_0x2f6c19)[_0xd7ec('0x1c')]();};}function respondWithResult(_0xaa461b,_0x2eaa92){_0x2eaa92=_0x2eaa92||0xc8;return function(_0x36144d){if(_0x36144d){return _0xaa461b[_0xd7ec('0x1b')](_0x2eaa92)[_0xd7ec('0x1d')](_0x36144d);}};}function respondWithFilteredResult(_0x354bd5,_0x2135dc){return function(_0xba1ed2){if(_0xba1ed2){var _0x4180e3=typeof _0x2135dc['offset']==='undefined'&&typeof _0x2135dc[_0xd7ec('0x1e')]===_0xd7ec('0x1f');var _0x4aac9a=_0xba1ed2[_0xd7ec('0x20')];var _0x22f5e9=_0x4180e3?0x0:_0x2135dc[_0xd7ec('0x21')];var _0x8bddc0=_0x4180e3?_0xba1ed2[_0xd7ec('0x20')]:_0x2135dc['offset']+_0x2135dc[_0xd7ec('0x1e')];var _0x3bb6ff;if(_0x8bddc0>=_0x4aac9a){_0x8bddc0=_0x4aac9a;_0x3bb6ff=0xc8;}else{_0x3bb6ff=0xce;}_0x354bd5[_0xd7ec('0x1b')](_0x3bb6ff);return _0x354bd5['set'](_0xd7ec('0x22'),_0x22f5e9+'-'+_0x8bddc0+'/'+_0x4aac9a)['json'](_0xba1ed2);}return null;};}function patchUpdates(_0x594bd3){return function(_0x5528bb){try{jsonpatch[_0xd7ec('0x23')](_0x5528bb,_0x594bd3,!![]);}catch(_0xd5b339){return BPromise['reject'](_0xd5b339);}return _0x5528bb[_0xd7ec('0x24')]();};}function saveUpdates(_0x49b05f,_0x3df27d){return function(_0x255189){if(_0x255189){return _0x255189[_0xd7ec('0x25')](_0x49b05f)[_0xd7ec('0x26')](function(_0x28d4d1){return _0x28d4d1;});}return null;};}function removeEntity(_0x3e4602,_0x321978){return function(_0x4c98bf){if(_0x4c98bf){return _0x4c98bf[_0xd7ec('0x27')]()[_0xd7ec('0x26')](function(){var _0x4f2a13=_0x4c98bf['get']({'plain':!![]});var _0xe437b9='ExtractedReports';return db[_0xd7ec('0x28')][_0xd7ec('0x27')]({'where':{'type':_0xe437b9,'resourceId':_0x4f2a13['id']}})['then'](function(){return _0x4c98bf;});})['then'](function(){_0x3e4602['status'](0xcc)[_0xd7ec('0x1c')]();});}};}function handleEntityNotFound(_0x1eb63f,_0x323044){return function(_0x2fe22d){if(!_0x2fe22d){_0x1eb63f[_0xd7ec('0x1a')](0x194);}return _0x2fe22d;};}function handleError(_0xff84f5,_0x1ad3e1){_0x1ad3e1=_0x1ad3e1||0x1f4;return function(_0x47f543){logger[_0xd7ec('0x29')](_0x47f543[_0xd7ec('0x2a')]);if(_0x47f543[_0xd7ec('0x2b')]){delete _0x47f543[_0xd7ec('0x2b')];}_0xff84f5['status'](_0x1ad3e1)['send'](_0x47f543);};}exports['index']=function(_0x4ef5e5,_0x32733f){var _0x7ec9fd={},_0xb9b7a6={},_0x4934e1={'count':0x0,'rows':[]};var _0x220617=_['map'](db[_0xd7ec('0x2c')][_0xd7ec('0x2d')],function(_0x33556a){return{'name':_0x33556a['fieldName'],'type':_0x33556a[_0xd7ec('0x2e')][_0xd7ec('0x2f')]};});_0xb9b7a6[_0xd7ec('0x30')]=_[_0xd7ec('0x31')](_0x220617,_0xd7ec('0x2b'));_0xb9b7a6[_0xd7ec('0x32')]=_['keys'](_0x4ef5e5[_0xd7ec('0x32')]);_0xb9b7a6[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](_0xb9b7a6[_0xd7ec('0x30')],_0xb9b7a6[_0xd7ec('0x32')]);_0x7ec9fd['attributes']=_[_0xd7ec('0x34')](_0xb9b7a6[_0xd7ec('0x30')],qs[_0xd7ec('0x35')](_0x4ef5e5[_0xd7ec('0x32')][_0xd7ec('0x35')]));_0x7ec9fd[_0xd7ec('0x36')]=_0x7ec9fd[_0xd7ec('0x36')][_0xd7ec('0x37')]?_0x7ec9fd[_0xd7ec('0x36')]:_0xb9b7a6['model'];if(!_0x4ef5e5['query'][_0xd7ec('0x38')](_0xd7ec('0x39'))){_0x7ec9fd[_0xd7ec('0x1e')]=qs[_0xd7ec('0x1e')](_0x4ef5e5['query'][_0xd7ec('0x1e')]);_0x7ec9fd[_0xd7ec('0x21')]=qs['offset'](_0x4ef5e5['query'][_0xd7ec('0x21')]);}_0x7ec9fd[_0xd7ec('0x3a')]=qs['sort'](_0x4ef5e5['query'][_0xd7ec('0x3b')]);_0x7ec9fd[_0xd7ec('0x3c')]=qs[_0xd7ec('0x33')](_[_0xd7ec('0x3d')](_0x4ef5e5[_0xd7ec('0x32')],_0xb9b7a6[_0xd7ec('0x33')]),_0x220617);if(_0x4ef5e5[_0xd7ec('0x32')][_0xd7ec('0x3e')]){_0x7ec9fd[_0xd7ec('0x3c')]=_[_0xd7ec('0x3f')](_0x7ec9fd[_0xd7ec('0x3c')],{'$or':_['map'](_0x220617,function(_0x45dc93){if(_0x45dc93[_0xd7ec('0x2e')]!==_0xd7ec('0x40')){var _0x418c35={};_0x418c35[_0x45dc93[_0xd7ec('0x2b')]]={'$like':'%'+_0x4ef5e5['query'][_0xd7ec('0x3e')]+'%'};return _0x418c35;}})});}_0x7ec9fd=_[_0xd7ec('0x3f')]({},_0x7ec9fd,_0x4ef5e5[_0xd7ec('0x41')]);var _0x5c3bbe={'where':_0x7ec9fd[_0xd7ec('0x3c')]};return db['AnalyticExtractedReport'][_0xd7ec('0x20')](_0x5c3bbe)[_0xd7ec('0x26')](function(_0x4899ec){_0x4934e1['count']=_0x4899ec;if(_0x4ef5e5[_0xd7ec('0x32')]['includeAll']){_0x7ec9fd[_0xd7ec('0x42')]=[{'all':!![]}];}return db[_0xd7ec('0x2c')][_0xd7ec('0x43')](_0x7ec9fd);})[_0xd7ec('0x26')](function(_0x151b60){_0x4934e1[_0xd7ec('0x44')]=_0x151b60;return _0x4934e1;})[_0xd7ec('0x26')](respondWithFilteredResult(_0x32733f,_0x7ec9fd))[_0xd7ec('0x45')](handleError(_0x32733f,null));};exports[_0xd7ec('0x46')]=function(_0x4813f2,_0x356d08){var _0x350484={'raw':!![],'where':{'id':_0x4813f2['params']['id']}},_0x3f144e={};_0x3f144e[_0xd7ec('0x30')]=_['keys'](db[_0xd7ec('0x2c')]['rawAttributes']);_0x3f144e[_0xd7ec('0x32')]=_[_0xd7ec('0x47')](_0x4813f2[_0xd7ec('0x32')]);_0x3f144e[_0xd7ec('0x33')]=_[_0xd7ec('0x34')](_0x3f144e[_0xd7ec('0x30')],_0x3f144e[_0xd7ec('0x32')]);_0x350484[_0xd7ec('0x36')]=_[_0xd7ec('0x34')](_0x3f144e['model'],qs[_0xd7ec('0x35')](_0x4813f2[_0xd7ec('0x32')][_0xd7ec('0x35')]));_0x350484[_0xd7ec('0x36')]=_0x350484['attributes']['length']?_0x350484[_0xd7ec('0x36')]:_0x3f144e['model'];if(_0x4813f2['query']['includeAll']){_0x350484[_0xd7ec('0x42')]=[{'all':!![]}];}_0x350484=_[_0xd7ec('0x3f')]({},_0x350484,_0x4813f2['options']);return db['AnalyticExtractedReport'][_0xd7ec('0x48')](_0x350484)[_0xd7ec('0x26')](handleEntityNotFound(_0x356d08,null))[_0xd7ec('0x26')](respondWithResult(_0x356d08,null))[_0xd7ec('0x45')](handleError(_0x356d08,null));};exports[_0xd7ec('0x49')]=function(_0xc2c6ce,_0x2eb690){return db[_0xd7ec('0x2c')]['create'](_0xc2c6ce[_0xd7ec('0x4a')],{})[_0xd7ec('0x26')](function(_0x6229d4){var _0xbd2d54=_0xc2c6ce['user'][_0xd7ec('0x4b')]({'plain':!![]});if(!_0xbd2d54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbd2d54['role']===_0xd7ec('0x4c')){var _0x37ba9d=_0x6229d4[_0xd7ec('0x4b')]({'plain':!![]});var _0x2cb584=_0xd7ec('0x4d');return db[_0xd7ec('0x4e')][_0xd7ec('0x48')]({'where':{'name':_0x2cb584,'userProfileId':_0xbd2d54['userProfileId']},'raw':!![]})[_0xd7ec('0x26')](function(_0x49165d){if(_0x49165d&&_0x49165d[_0xd7ec('0x4f')]===0x0){return db[_0xd7ec('0x28')][_0xd7ec('0x49')]({'name':_0x37ba9d[_0xd7ec('0x2b')],'resourceId':_0x37ba9d['id'],'type':_0x49165d[_0xd7ec('0x2b')],'sectionId':_0x49165d['id']},{})['then'](function(){return _0x6229d4;});}else{return _0x6229d4;}})['catch'](function(_0xc370fd){logger[_0xd7ec('0x29')](_0xd7ec('0x50'),_0xc370fd);throw _0xc370fd;});}return _0x6229d4;})[_0xd7ec('0x26')](respondWithResult(_0x2eb690,0xc9))[_0xd7ec('0x45')](handleError(_0x2eb690,null));};exports[_0xd7ec('0x25')]=function(_0x190c4f,_0x548a16){if(_0x190c4f[_0xd7ec('0x4a')]['id']){delete _0x190c4f[_0xd7ec('0x4a')]['id'];}return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0x190c4f[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x26')](handleEntityNotFound(_0x548a16,null))[_0xd7ec('0x26')](saveUpdates(_0x190c4f[_0xd7ec('0x4a')],null))['then'](respondWithResult(_0x548a16,null))[_0xd7ec('0x45')](handleError(_0x548a16,null));};exports['destroy']=function(_0xfadeae,_0x9c108b){return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0xfadeae[_0xd7ec('0x51')]['id']}})[_0xd7ec('0x26')](handleEntityNotFound(_0x9c108b,null))[_0xd7ec('0x26')](removeEntity(_0x9c108b,null))[_0xd7ec('0x45')](handleError(_0x9c108b,null));};exports[_0xd7ec('0x52')]=function(_0x29b561,_0x19a8c8,_0x27cb7a){return db[_0xd7ec('0x2c')][_0xd7ec('0x48')]({'where':{'id':_0x29b561[_0xd7ec('0x51')]['id']},'attributes':[_0xd7ec('0x2b'),_0xd7ec('0x53'),_0xd7ec('0x54'),_0xd7ec('0x55')],'raw':!![]})[_0xd7ec('0x26')](handleEntityNotFound(_0x19a8c8,null))['then'](function(_0x5085bf){if(_0x5085bf){if(!fs[_0xd7ec('0x56')](path[_0xd7ec('0x57')](config[_0xd7ec('0x58')],_0xd7ec('0x59'),_0x5085bf[_0xd7ec('0x54')]))){throw new db[(_0xd7ec('0x5a'))]['ValidationError'](_0xd7ec('0x5b'));}if(_0x29b561['query'][_0xd7ec('0x5c')]){return _0x19a8c8[_0xd7ec('0x1a')](0xc8);}return _0x19a8c8[_0xd7ec('0x52')](path[_0xd7ec('0x57')](config[_0xd7ec('0x58')],_0xd7ec('0x59'),_0x5085bf[_0xd7ec('0x54')]),util[_0xd7ec('0x5d')](_0xd7ec('0x5e'),_0x5085bf[_0xd7ec('0x53')]||_0x5085bf[_0xd7ec('0x2b')],_0x5085bf['output'][_0xd7ec('0x5f')]()));}})[_0xd7ec('0x45')](handleError(_0x19a8c8,null));}; \ No newline at end of file +var _0xb2c0=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','then','get','ExtractedReports','destroy','error','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','rows','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox'];(function(_0xe93ec7,_0x1cbb61){var _0x3d36ed=function(_0x34a909){while(--_0x34a909){_0xe93ec7['push'](_0xe93ec7['shift']());}};_0x3d36ed(++_0x1cbb61);}(_0xb2c0,0x16f));var _0x0b2c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2c0[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x0b2c('0x0'));var rimraf=require(_0x0b2c('0x1'));var zipdir=require(_0x0b2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b2c('0x3'));var moment=require(_0x0b2c('0x4'));var BPromise=require(_0x0b2c('0x5'));var Mustache=require('mustache');var util=require(_0x0b2c('0x6'));var path=require(_0x0b2c('0x7'));var sox=require(_0x0b2c('0x8'));var csv=require(_0x0b2c('0x9'));var ejs=require(_0x0b2c('0xa'));var fs=require('fs');var fs_extra=require(_0x0b2c('0xb'));var _=require(_0x0b2c('0xc'));var squel=require(_0x0b2c('0xd'));var crypto=require(_0x0b2c('0xe'));var jsforce=require(_0x0b2c('0xf'));var deskjs=require(_0x0b2c('0x10'));var toCsv=require(_0x0b2c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b2c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0b2c('0x12'));var hardwareService=require(_0x0b2c('0x13'));var logger=require('../../config/logger')(_0x0b2c('0x14'));var utils=require(_0x0b2c('0x15'));var config=require(_0x0b2c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120314,_0x22892b){_0x22892b=_0x22892b||0xcc;return function(_0x2cafda){if(_0x2cafda){return _0x120314[_0x0b2c('0x17')](_0x22892b);}return _0x120314[_0x0b2c('0x18')](_0x22892b)[_0x0b2c('0x19')]();};}function respondWithResult(_0x27d0ac,_0x408143){_0x408143=_0x408143||0xc8;return function(_0x2f7051){if(_0x2f7051){return _0x27d0ac['status'](_0x408143)[_0x0b2c('0x1a')](_0x2f7051);}};}function respondWithFilteredResult(_0x3005c1,_0x73f60d){return function(_0x242cfb){if(_0x242cfb){var _0xbd48e3=typeof _0x73f60d[_0x0b2c('0x1b')]==='undefined'&&typeof _0x73f60d[_0x0b2c('0x1c')]===_0x0b2c('0x1d');var _0x469a77=_0x242cfb[_0x0b2c('0x1e')];var _0x3034eb=_0xbd48e3?0x0:_0x73f60d['offset'];var _0x48594a=_0xbd48e3?_0x242cfb['count']:_0x73f60d['offset']+_0x73f60d[_0x0b2c('0x1c')];var _0x24d360;if(_0x48594a>=_0x469a77){_0x48594a=_0x469a77;_0x24d360=0xc8;}else{_0x24d360=0xce;}_0x3005c1[_0x0b2c('0x18')](_0x24d360);return _0x3005c1['set']('Content-Range',_0x3034eb+'-'+_0x48594a+'/'+_0x469a77)[_0x0b2c('0x1a')](_0x242cfb);}return null;};}function patchUpdates(_0x1f9e92){return function(_0x9d0fc0){try{jsonpatch[_0x0b2c('0x1f')](_0x9d0fc0,_0x1f9e92,!![]);}catch(_0x75391f){return BPromise['reject'](_0x75391f);}return _0x9d0fc0[_0x0b2c('0x20')]();};}function saveUpdates(_0xe12453,_0x38ebe6){return function(_0x132ce7){if(_0x132ce7){return _0x132ce7['update'](_0xe12453)['then'](function(_0x27feaa){return _0x27feaa;});}return null;};}function removeEntity(_0x106cdf,_0x4b712b){return function(_0x337093){if(_0x337093){return _0x337093['destroy']()[_0x0b2c('0x21')](function(){var _0x492914=_0x337093[_0x0b2c('0x22')]({'plain':!![]});var _0x38ade3=_0x0b2c('0x23');return db['UserProfileResource'][_0x0b2c('0x24')]({'where':{'type':_0x38ade3,'resourceId':_0x492914['id']}})['then'](function(){return _0x337093;});})[_0x0b2c('0x21')](function(){_0x106cdf[_0x0b2c('0x18')](0xcc)[_0x0b2c('0x19')]();});}};}function handleEntityNotFound(_0x5f064f,_0x915b25){return function(_0x4a1e15){if(!_0x4a1e15){_0x5f064f[_0x0b2c('0x17')](0x194);}return _0x4a1e15;};}function handleError(_0x190cc8,_0x2b5e5f){_0x2b5e5f=_0x2b5e5f||0x1f4;return function(_0x189d0f){logger[_0x0b2c('0x25')](_0x189d0f['stack']);if(_0x189d0f['name']){delete _0x189d0f[_0x0b2c('0x26')];}_0x190cc8[_0x0b2c('0x18')](_0x2b5e5f)['send'](_0x189d0f);};}exports[_0x0b2c('0x27')]=function(_0x4e696a,_0x50b63d){var _0xcd5f54={},_0x1c6870={},_0x1bdc6f={'count':0x0,'rows':[]};var _0x5bda99=_['map'](db['AnalyticExtractedReport'][_0x0b2c('0x28')],function(_0x25ebde){return{'name':_0x25ebde[_0x0b2c('0x29')],'type':_0x25ebde[_0x0b2c('0x2a')]['key']};});_0x1c6870[_0x0b2c('0x2b')]=_[_0x0b2c('0x2c')](_0x5bda99,_0x0b2c('0x26'));_0x1c6870[_0x0b2c('0x2d')]=_[_0x0b2c('0x2e')](_0x4e696a['query']);_0x1c6870[_0x0b2c('0x2f')]=_['intersection'](_0x1c6870['model'],_0x1c6870[_0x0b2c('0x2d')]);_0xcd5f54['attributes']=_['intersection'](_0x1c6870[_0x0b2c('0x2b')],qs[_0x0b2c('0x30')](_0x4e696a[_0x0b2c('0x2d')]['fields']));_0xcd5f54[_0x0b2c('0x31')]=_0xcd5f54['attributes'][_0x0b2c('0x32')]?_0xcd5f54[_0x0b2c('0x31')]:_0x1c6870[_0x0b2c('0x2b')];if(!_0x4e696a[_0x0b2c('0x2d')][_0x0b2c('0x33')](_0x0b2c('0x34'))){_0xcd5f54[_0x0b2c('0x1c')]=qs['limit'](_0x4e696a['query'][_0x0b2c('0x1c')]);_0xcd5f54[_0x0b2c('0x1b')]=qs['offset'](_0x4e696a['query'][_0x0b2c('0x1b')]);}_0xcd5f54['order']=qs[_0x0b2c('0x35')](_0x4e696a[_0x0b2c('0x2d')]['sort']);_0xcd5f54[_0x0b2c('0x36')]=qs[_0x0b2c('0x2f')](_[_0x0b2c('0x37')](_0x4e696a['query'],_0x1c6870[_0x0b2c('0x2f')]),_0x5bda99);if(_0x4e696a['query'][_0x0b2c('0x38')]){_0xcd5f54[_0x0b2c('0x36')]=_[_0x0b2c('0x39')](_0xcd5f54[_0x0b2c('0x36')],{'$or':_[_0x0b2c('0x2c')](_0x5bda99,function(_0x453862){if(_0x453862[_0x0b2c('0x2a')]!==_0x0b2c('0x3a')){var _0x347c88={};_0x347c88[_0x453862[_0x0b2c('0x26')]]={'$like':'%'+_0x4e696a[_0x0b2c('0x2d')]['filter']+'%'};return _0x347c88;}})});}_0xcd5f54=_['merge']({},_0xcd5f54,_0x4e696a[_0x0b2c('0x3b')]);var _0x5bcdd3={'where':_0xcd5f54['where']};return db[_0x0b2c('0x3c')][_0x0b2c('0x1e')](_0x5bcdd3)['then'](function(_0x29db5d){_0x1bdc6f[_0x0b2c('0x1e')]=_0x29db5d;if(_0x4e696a[_0x0b2c('0x2d')][_0x0b2c('0x3d')]){_0xcd5f54['include']=[{'all':!![]}];}return db[_0x0b2c('0x3c')]['findAll'](_0xcd5f54);})[_0x0b2c('0x21')](function(_0x187aaf){_0x1bdc6f[_0x0b2c('0x3e')]=_0x187aaf;return _0x1bdc6f;})[_0x0b2c('0x21')](respondWithFilteredResult(_0x50b63d,_0xcd5f54))[_0x0b2c('0x3f')](handleError(_0x50b63d,null));};exports[_0x0b2c('0x40')]=function(_0x59c2c1,_0x525526){var _0x1574f1={'raw':!![],'where':{'id':_0x59c2c1[_0x0b2c('0x41')]['id']}},_0x4de976={};_0x4de976[_0x0b2c('0x2b')]=_[_0x0b2c('0x2e')](db[_0x0b2c('0x3c')][_0x0b2c('0x28')]);_0x4de976[_0x0b2c('0x2d')]=_[_0x0b2c('0x2e')](_0x59c2c1[_0x0b2c('0x2d')]);_0x4de976[_0x0b2c('0x2f')]=_[_0x0b2c('0x42')](_0x4de976['model'],_0x4de976[_0x0b2c('0x2d')]);_0x1574f1[_0x0b2c('0x31')]=_[_0x0b2c('0x42')](_0x4de976[_0x0b2c('0x2b')],qs['fields'](_0x59c2c1[_0x0b2c('0x2d')][_0x0b2c('0x30')]));_0x1574f1['attributes']=_0x1574f1['attributes'][_0x0b2c('0x32')]?_0x1574f1[_0x0b2c('0x31')]:_0x4de976['model'];if(_0x59c2c1[_0x0b2c('0x2d')][_0x0b2c('0x3d')]){_0x1574f1[_0x0b2c('0x43')]=[{'all':!![]}];}_0x1574f1=_[_0x0b2c('0x39')]({},_0x1574f1,_0x59c2c1[_0x0b2c('0x3b')]);return db[_0x0b2c('0x3c')][_0x0b2c('0x44')](_0x1574f1)[_0x0b2c('0x21')](handleEntityNotFound(_0x525526,null))[_0x0b2c('0x21')](respondWithResult(_0x525526,null))[_0x0b2c('0x3f')](handleError(_0x525526,null));};exports[_0x0b2c('0x45')]=function(_0xb38752,_0x44d967){return db['AnalyticExtractedReport'][_0x0b2c('0x45')](_0xb38752[_0x0b2c('0x46')],{})[_0x0b2c('0x21')](function(_0x465fd2){var _0x555e65=_0xb38752[_0x0b2c('0x47')][_0x0b2c('0x22')]({'plain':!![]});if(!_0x555e65)throw new Error(_0x0b2c('0x48'));if(_0x555e65[_0x0b2c('0x49')]==='user'){var _0x4d644c=_0x465fd2[_0x0b2c('0x22')]({'plain':!![]});var _0x3f6203=_0x0b2c('0x23');return db[_0x0b2c('0x4a')][_0x0b2c('0x44')]({'where':{'name':_0x3f6203,'userProfileId':_0x555e65[_0x0b2c('0x4b')]},'raw':!![]})['then'](function(_0x238a74){if(_0x238a74&&_0x238a74[_0x0b2c('0x4c')]===0x0){return db[_0x0b2c('0x4d')][_0x0b2c('0x45')]({'name':_0x4d644c[_0x0b2c('0x26')],'resourceId':_0x4d644c['id'],'type':_0x238a74[_0x0b2c('0x26')],'sectionId':_0x238a74['id']},{})[_0x0b2c('0x21')](function(){return _0x465fd2;});}else{return _0x465fd2;}})['catch'](function(_0x65dadb){logger['error'](_0x0b2c('0x4e'),_0x65dadb);throw _0x65dadb;});}return _0x465fd2;})[_0x0b2c('0x21')](respondWithResult(_0x44d967,0xc9))['catch'](handleError(_0x44d967,null));};exports[_0x0b2c('0x4f')]=function(_0x15a1cb,_0x526b4e){if(_0x15a1cb[_0x0b2c('0x46')]['id']){delete _0x15a1cb[_0x0b2c('0x46')]['id'];}return db['AnalyticExtractedReport'][_0x0b2c('0x44')]({'where':{'id':_0x15a1cb[_0x0b2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x526b4e,null))['then'](saveUpdates(_0x15a1cb[_0x0b2c('0x46')],null))[_0x0b2c('0x21')](respondWithResult(_0x526b4e,null))[_0x0b2c('0x3f')](handleError(_0x526b4e,null));};exports[_0x0b2c('0x24')]=function(_0x4d0fe9,_0x1b11ff){return db[_0x0b2c('0x3c')][_0x0b2c('0x44')]({'where':{'id':_0x4d0fe9[_0x0b2c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b11ff,null))[_0x0b2c('0x21')](removeEntity(_0x1b11ff,null))[_0x0b2c('0x3f')](handleError(_0x1b11ff,null));};exports[_0x0b2c('0x50')]=function(_0x4f7b31,_0x5a1cb9,_0x1ee0d0){return db[_0x0b2c('0x3c')][_0x0b2c('0x44')]({'where':{'id':_0x4f7b31[_0x0b2c('0x41')]['id']},'attributes':[_0x0b2c('0x26'),'basename',_0x0b2c('0x51'),_0x0b2c('0x52')],'raw':!![]})[_0x0b2c('0x21')](handleEntityNotFound(_0x5a1cb9,null))[_0x0b2c('0x21')](function(_0x3c24a8){if(_0x3c24a8){if(!fs[_0x0b2c('0x53')](path[_0x0b2c('0x54')](config[_0x0b2c('0x55')],_0x0b2c('0x56'),_0x3c24a8[_0x0b2c('0x51')]))){throw new db[(_0x0b2c('0x57'))][(_0x0b2c('0x58'))](_0x0b2c('0x59'));}if(_0x4f7b31[_0x0b2c('0x2d')][_0x0b2c('0x5a')]){return _0x5a1cb9[_0x0b2c('0x17')](0xc8);}return _0x5a1cb9[_0x0b2c('0x50')](path['join'](config[_0x0b2c('0x55')],'server/files/reports',_0x3c24a8['savename']),util['format'](_0x0b2c('0x5b'),_0x3c24a8[_0x0b2c('0x5c')]||_0x3c24a8[_0x0b2c('0x26')],_0x3c24a8[_0x0b2c('0x52')][_0x0b2c('0x5d')]()));}})[_0x0b2c('0x3f')](handleError(_0x5a1cb9,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 64ec67f..eef57a6 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 _0x640c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x569848,_0x5223da){var _0x247e93=function(_0x1b01ea){while(--_0x1b01ea){_0x569848['push'](_0x569848['shift']());}};_0x247e93(++_0x5223da);}(_0x640c,0x136));var _0xc640=function(_0x31adf9,_0x511868){_0x31adf9=_0x31adf9-0x0;var _0x4412b5=_0x640c[_0x31adf9];return _0x4412b5;};'use strict';var _=require(_0xc640('0x0'));var util=require(_0xc640('0x1'));var logger=require('../../config/logger')(_0xc640('0x2'));var moment=require(_0xc640('0x3'));var BPromise=require(_0xc640('0x4'));var rp=require(_0xc640('0x5'));var fs=require('fs');var path=require(_0xc640('0x6'));var rimraf=require(_0xc640('0x7'));var config=require(_0xc640('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xc640('0x9')]=function(_0x4d0fec,_0x42e81b){return _0x4d0fec[_0xc640('0xa')](_0xc640('0xb'),attributes,{'tableName':_0xc640('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8576=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','request-promise','rimraf'];(function(_0x1960c6,_0x5e4732){var _0x2b03d6=function(_0x54702d){while(--_0x54702d){_0x1960c6['push'](_0x1960c6['shift']());}};_0x2b03d6(++_0x5e4732);}(_0x8576,0xc3));var _0x6857=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x8576[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x6857('0x0'));var util=require(_0x6857('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6857('0x2'));var BPromise=require('bluebird');var rp=require(_0x6857('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6857('0x4'));var config=require(_0x6857('0x5'));var attributes=require(_0x6857('0x6'));module['exports']=function(_0x447e0c,_0x5f239d){return _0x447e0c[_0x6857('0x7')](_0x6857('0x8'),attributes,{'tableName':_0x6857('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index b795088..ecaa282 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 _0x78b0=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x484453,_0x2fb41e){var _0x23106d=function(_0xc42e83){while(--_0xc42e83){_0x484453['push'](_0x484453['shift']());}};_0x23106d(++_0x2fb41e);}(_0x78b0,0x173));var _0x078b=function(_0x1a06d0,_0x2d77e2){_0x1a06d0=_0x1a06d0-0x0;var _0x370e6d=_0x78b0[_0x1a06d0];return _0x370e6d;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require('moment');var BPromise=require(_0x078b('0x2'));var rs=require(_0x078b('0x3'));var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x078b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa46e,_0x160f91,_0x3c3f1c){return new BPromise(function(_0xbed569,_0x3a9648){return client[_0x078b('0xa')](_0x3fa46e,_0x3c3f1c)[_0x078b('0xb')](function(_0x47948b){logger[_0x078b('0xc')](_0x078b('0xd'),_0x160f91,_0x078b('0xe'));logger['debug'](_0x078b('0xf'),_0x160f91,_0x078b('0xe'),JSON[_0x078b('0x10')](_0x47948b));if(_0x47948b[_0x078b('0x11')]){if(_0x47948b[_0x078b('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x47948b['error']['message']);return _0x3a9648(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x47948b[_0x078b('0x11')]['message']);return _0xbed569(_0x47948b[_0x078b('0x11')][_0x078b('0x12')]);}else{logger[_0x078b('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x160f91,_0x078b('0xe'));_0xbed569(_0x47948b['result'][_0x078b('0x12')]);}})[_0x078b('0x13')](function(_0x3f4c68){logger[_0x078b('0x11')](_0x078b('0xd'),_0x160f91,_0x3f4c68);_0x3a9648(_0x3f4c68);});});} \ No newline at end of file +var _0x521e=['../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x521e,0x101));var _0xe521=function(_0x396896,_0x393c90){_0x396896=_0x396896-0x0;var _0x2cf0dc=_0x521e[_0x396896];return _0x2cf0dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe521('0x0'));var BPromise=require(_0xe521('0x1'));var rs=require(_0xe521('0x2'));var fs=require('fs');var Redis=require(_0xe521('0x3'));var db=require(_0xe521('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe521('0x5'))(_0xe521('0x6'));var config=require(_0xe521('0x7'));var jayson=require(_0xe521('0x8'));var client=jayson[_0xe521('0x9')][_0xe521('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x414b24,_0x3e3622,_0x5dda6a){return new BPromise(function(_0x286c0b,_0x58087b){return client[_0xe521('0xb')](_0x414b24,_0x5dda6a)[_0xe521('0xc')](function(_0x25abde){logger['info'](_0xe521('0xd'),_0x3e3622,_0xe521('0xe'));logger[_0xe521('0xf')](_0xe521('0x10'),_0x3e3622,_0xe521('0xe'),JSON[_0xe521('0x11')](_0x25abde));if(_0x25abde['error']){if(_0x25abde[_0xe521('0x12')][_0xe521('0x13')]===0x1f4){logger[_0xe521('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0x25abde[_0xe521('0x12')]['message']);return _0x58087b(_0x25abde[_0xe521('0x12')][_0xe521('0x14')]);}logger['error'](_0xe521('0xd'),_0x3e3622,_0x25abde['error']['message']);return _0x286c0b(_0x25abde[_0xe521('0x12')][_0xe521('0x14')]);}else{logger[_0xe521('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0xe521('0xe'));_0x286c0b(_0x25abde[_0xe521('0x16')][_0xe521('0x14')]);}})[_0xe521('0x17')](function(_0x3fe959){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e3622,_0x3fe959);_0x58087b(_0x3fe959);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index aeb7b74..6c82a7c 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 _0xfe73=['/:id/download','download','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x14e0cb,_0x49da14){var _0x5398ca=function(_0x4167e3){while(--_0x4167e3){_0x14e0cb['push'](_0x14e0cb['shift']());}};_0x5398ca(++_0x49da14);}(_0xfe73,0xc5));var _0x3fe7=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xfe73[_0x62c958];return _0x57ec61;};'use strict';var multer=require('multer');var util=require(_0x3fe7('0x0'));var path=require('path');var timeout=require(_0x3fe7('0x1'));var express=require(_0x3fe7('0x2'));var router=express[_0x3fe7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fe7('0x4'));var interaction=require(_0x3fe7('0x5'));var config=require(_0x3fe7('0x6'));var controller=require(_0x3fe7('0x7'));router[_0x3fe7('0x8')]('/',auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xa')]);router[_0x3fe7('0x8')](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xc')]);router[_0x3fe7('0x8')](_0x3fe7('0xd'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0xe')]);router[_0x3fe7('0xf')]('/',auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x10')]);router['put'](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x11')]);router[_0x3fe7('0x12')](_0x3fe7('0xb'),auth[_0x3fe7('0x9')](),controller[_0x3fe7('0x13')]);module[_0x3fe7('0x14')]=router; \ No newline at end of file +var _0x6695=['index','show','download','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x12a969,_0x3ac462){var _0x3e0f11=function(_0x4c3877){while(--_0x4c3877){_0x12a969['push'](_0x12a969['shift']());}};_0x3e0f11(++_0x3ac462);}(_0x6695,0x15c));var _0x5669=function(_0x4ff444,_0x5dbb45){_0x4ff444=_0x4ff444-0x0;var _0x533fbd=_0x6695[_0x4ff444];return _0x533fbd;};'use strict';var multer=require(_0x5669('0x0'));var util=require('util');var path=require(_0x5669('0x1'));var timeout=require('connect-timeout');var express=require(_0x5669('0x2'));var router=express[_0x5669('0x3')]();var fs_extra=require(_0x5669('0x4'));var auth=require(_0x5669('0x5'));var interaction=require(_0x5669('0x6'));var config=require(_0x5669('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x5669('0x8')]('/',auth['isAuthenticated'](),controller[_0x5669('0x9')]);router[_0x5669('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5669('0xa')]);router[_0x5669('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x5669('0xb')]);router[_0x5669('0xc')]('/',auth[_0x5669('0xd')](),controller[_0x5669('0xe')]);router[_0x5669('0xf')](_0x5669('0x10'),auth[_0x5669('0xd')](),controller[_0x5669('0x11')]);router[_0x5669('0x12')](_0x5669('0x10'),auth[_0x5669('0xd')](),controller[_0x5669('0x13')]);module[_0x5669('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 18e9dac..161b9ea 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 _0x6803=['STRING','BOOLEAN','exports','TEXT'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x6803,0x1c6));var _0x3680=function(_0x16e1fe,_0x6dd51e){_0x16e1fe=_0x16e1fe-0x0;var _0x56187a=_0x6803[_0x16e1fe];return _0x56187a;};'use strict';var Sequelize=require('sequelize');module[_0x3680('0x0')]={'field':{'type':Sequelize[_0x3680('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3680('0x2')]},'format':{'type':Sequelize[_0x3680('0x2')]},'groupBy':{'type':Sequelize[_0x3680('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x541c=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x541c,0x6c));var _0xc541=function(_0x4496d4,_0x35a23c){_0x4496d4=_0x4496d4-0x0;var _0x549149=_0x541c[_0x4496d4];return _0x549149;};'use strict';var Sequelize=require(_0xc541('0x0'));module['exports']={'field':{'type':Sequelize[_0xc541('0x1')]},'alias':{'type':Sequelize[_0xc541('0x2')]},'function':{'type':Sequelize[_0xc541('0x2')]},'format':{'type':Sequelize[_0xc541('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc541('0x2')]},'custom':{'type':Sequelize[_0xc541('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5ba208f..444b41c 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 _0xe706=['VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x14b8c7,_0x4839ea){var _0x4bb5a3=function(_0x17cf53){while(--_0x17cf53){_0x14b8c7['push'](_0x14b8c7['shift']());}};_0x4bb5a3(++_0x4839ea);}(_0xe706,0x1e8));var _0x6e70=function(_0x39285d,_0x4e7c32){_0x39285d=_0x39285d-0x0;var _0x5b809b=_0xe706[_0x39285d];return _0x5b809b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e70('0x0'));var jsonpatch=require(_0x6e70('0x1'));var rp=require(_0x6e70('0x2'));var moment=require('moment');var BPromise=require(_0x6e70('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e70('0x4'));var sox=require(_0x6e70('0x5'));var csv=require(_0x6e70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e70('0x7'));var squel=require(_0x6e70('0x8'));var crypto=require(_0x6e70('0x9'));var jsforce=require(_0x6e70('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6e70('0x6'));var querystring=require(_0x6e70('0xb'));var Papa=require(_0x6e70('0xc'));var Redis=require(_0x6e70('0xd'));var authService=require(_0x6e70('0xe'));var qs=require(_0x6e70('0xf'));var as=require(_0x6e70('0x10'));var hardwareService=require(_0x6e70('0x11'));var logger=require(_0x6e70('0x12'))(_0x6e70('0x13'));var utils=require('../../config/utils');var config=require(_0x6e70('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdde585,_0x2ba483){_0x2ba483=_0x2ba483||0xcc;return function(_0x3c3d2d){if(_0x3c3d2d){return _0xdde585[_0x6e70('0x15')](_0x2ba483);}return _0xdde585[_0x6e70('0x16')](_0x2ba483)[_0x6e70('0x17')]();};}function respondWithResult(_0x49f976,_0x33be97){_0x33be97=_0x33be97||0xc8;return function(_0x85dbdb){if(_0x85dbdb){return _0x49f976[_0x6e70('0x16')](_0x33be97)[_0x6e70('0x18')](_0x85dbdb);}};}function respondWithFilteredResult(_0x100e70,_0x2b3e66){return function(_0x16992c){if(_0x16992c){var _0x44e4a1=typeof _0x2b3e66[_0x6e70('0x19')]==='undefined'&&typeof _0x2b3e66[_0x6e70('0x1a')]===_0x6e70('0x1b');var _0x1d3b36=_0x16992c[_0x6e70('0x1c')];var _0x978ca1=_0x44e4a1?0x0:_0x2b3e66['offset'];var _0x523da4=_0x44e4a1?_0x16992c[_0x6e70('0x1c')]:_0x2b3e66['offset']+_0x2b3e66[_0x6e70('0x1a')];var _0x249784;if(_0x523da4>=_0x1d3b36){_0x523da4=_0x1d3b36;_0x249784=0xc8;}else{_0x249784=0xce;}_0x100e70[_0x6e70('0x16')](_0x249784);return _0x100e70[_0x6e70('0x1d')](_0x6e70('0x1e'),_0x978ca1+'-'+_0x523da4+'/'+_0x1d3b36)['json'](_0x16992c);}return null;};}function patchUpdates(_0x4cb3f7){return function(_0x191d72){try{jsonpatch[_0x6e70('0x1f')](_0x191d72,_0x4cb3f7,!![]);}catch(_0x212b1b){return BPromise[_0x6e70('0x20')](_0x212b1b);}return _0x191d72[_0x6e70('0x21')]();};}function saveUpdates(_0x4e14be,_0xf79d62){return function(_0x202fdf){if(_0x202fdf){return _0x202fdf[_0x6e70('0x22')](_0x4e14be)[_0x6e70('0x23')](function(_0x5421e3){return _0x5421e3;});}return null;};}function removeEntity(_0x4da378,_0x21d061){return function(_0xc0c57c){if(_0xc0c57c){return _0xc0c57c[_0x6e70('0x24')]()[_0x6e70('0x23')](function(){_0x4da378[_0x6e70('0x16')](0xcc)[_0x6e70('0x17')]();});}};}function handleEntityNotFound(_0x474c04,_0x5d901b){return function(_0x564f31){if(!_0x564f31){_0x474c04['sendStatus'](0x194);}return _0x564f31;};}function handleError(_0x1840be,_0x7a3a77){_0x7a3a77=_0x7a3a77||0x1f4;return function(_0x130bb7){logger['error'](_0x130bb7[_0x6e70('0x25')]);if(_0x130bb7[_0x6e70('0x26')]){delete _0x130bb7[_0x6e70('0x26')];}_0x1840be[_0x6e70('0x16')](_0x7a3a77)[_0x6e70('0x27')](_0x130bb7);};}exports[_0x6e70('0x28')]=function(_0x2dcebe,_0x21f4d5){var _0x5a2ac0={},_0x449117={},_0x556e37={'count':0x0,'rows':[]};var _0x1d62d9=_[_0x6e70('0x29')](db[_0x6e70('0x2a')]['rawAttributes'],function(_0xd6eafd){return{'name':_0xd6eafd['fieldName'],'type':_0xd6eafd[_0x6e70('0x2b')]['key']};});_0x449117[_0x6e70('0x2c')]=_[_0x6e70('0x29')](_0x1d62d9,_0x6e70('0x26'));_0x449117[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](_0x2dcebe['query']);_0x449117[_0x6e70('0x2f')]=_['intersection'](_0x449117[_0x6e70('0x2c')],_0x449117['query']);_0x5a2ac0[_0x6e70('0x30')]=_['intersection'](_0x449117[_0x6e70('0x2c')],qs[_0x6e70('0x31')](_0x2dcebe[_0x6e70('0x2d')]['fields']));_0x5a2ac0[_0x6e70('0x30')]=_0x5a2ac0[_0x6e70('0x30')][_0x6e70('0x32')]?_0x5a2ac0['attributes']:_0x449117['model'];if(!_0x2dcebe['query'][_0x6e70('0x33')](_0x6e70('0x34'))){_0x5a2ac0[_0x6e70('0x1a')]=qs[_0x6e70('0x1a')](_0x2dcebe['query'][_0x6e70('0x1a')]);_0x5a2ac0[_0x6e70('0x19')]=qs['offset'](_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x19')]);}_0x5a2ac0['order']=qs[_0x6e70('0x35')](_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x35')]);_0x5a2ac0[_0x6e70('0x36')]=qs[_0x6e70('0x2f')](_[_0x6e70('0x37')](_0x2dcebe[_0x6e70('0x2d')],_0x449117[_0x6e70('0x2f')]),_0x1d62d9);if(_0x2dcebe[_0x6e70('0x2d')][_0x6e70('0x38')]){_0x5a2ac0[_0x6e70('0x36')]=_[_0x6e70('0x39')](_0x5a2ac0[_0x6e70('0x36')],{'$or':_[_0x6e70('0x29')](_0x1d62d9,function(_0x55e79f){if(_0x55e79f['type']!==_0x6e70('0x3a')){var _0x275c06={};_0x275c06[_0x55e79f[_0x6e70('0x26')]]={'$like':'%'+_0x2dcebe['query'][_0x6e70('0x38')]+'%'};return _0x275c06;}})});}_0x5a2ac0=_[_0x6e70('0x39')]({},_0x5a2ac0,_0x2dcebe[_0x6e70('0x3b')]);var _0x48b0a7={'where':_0x5a2ac0['where']};return db['AnalyticFieldReport'][_0x6e70('0x1c')](_0x48b0a7)['then'](function(_0xd7c063){_0x556e37[_0x6e70('0x1c')]=_0xd7c063;if(_0x2dcebe[_0x6e70('0x2d')]['includeAll']){_0x5a2ac0[_0x6e70('0x3c')]=[{'all':!![]}];}return db[_0x6e70('0x2a')][_0x6e70('0x3d')](_0x5a2ac0);})[_0x6e70('0x23')](function(_0x38756f){_0x556e37[_0x6e70('0x3e')]=_0x38756f;return _0x556e37;})['then'](respondWithFilteredResult(_0x21f4d5,_0x5a2ac0))[_0x6e70('0x3f')](handleError(_0x21f4d5,null));};exports[_0x6e70('0x40')]=function(_0x569dc4,_0x24f1be){var _0x5cc9fc={'raw':![],'where':{'id':_0x569dc4[_0x6e70('0x41')]['id']}},_0x59bd20={};_0x59bd20[_0x6e70('0x2c')]=_[_0x6e70('0x2e')](db[_0x6e70('0x2a')][_0x6e70('0x42')]);_0x59bd20[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](_0x569dc4[_0x6e70('0x2d')]);_0x59bd20[_0x6e70('0x2f')]=_[_0x6e70('0x43')](_0x59bd20[_0x6e70('0x2c')],_0x59bd20[_0x6e70('0x2d')]);_0x5cc9fc[_0x6e70('0x30')]=_[_0x6e70('0x43')](_0x59bd20['model'],qs[_0x6e70('0x31')](_0x569dc4[_0x6e70('0x2d')]['fields']));_0x5cc9fc[_0x6e70('0x30')]=_0x5cc9fc[_0x6e70('0x30')][_0x6e70('0x32')]?_0x5cc9fc['attributes']:_0x59bd20[_0x6e70('0x2c')];if(_0x569dc4[_0x6e70('0x2d')][_0x6e70('0x44')]){_0x5cc9fc[_0x6e70('0x3c')]=[{'all':!![]}];}_0x5cc9fc=_[_0x6e70('0x39')]({},_0x5cc9fc,_0x569dc4[_0x6e70('0x3b')]);return db[_0x6e70('0x2a')][_0x6e70('0x45')](_0x5cc9fc)['then'](handleEntityNotFound(_0x24f1be,null))[_0x6e70('0x23')](respondWithResult(_0x24f1be,null))[_0x6e70('0x3f')](handleError(_0x24f1be,null));};exports['create']=function(_0x5b6cef,_0x40ef18){return db['AnalyticFieldReport']['create'](_0x5b6cef[_0x6e70('0x46')],{})['then'](respondWithResult(_0x40ef18,0xc9))[_0x6e70('0x3f')](handleError(_0x40ef18,null));};exports[_0x6e70('0x47')]=function(_0x767988,_0xa9c1a6){return db[_0x6e70('0x2a')][_0x6e70('0x47')](_0x767988[_0x6e70('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xa9c1a6,0xc9))[_0x6e70('0x3f')](handleError(_0xa9c1a6,null));};exports[_0x6e70('0x22')]=function(_0x1f779c,_0xb8c10b){if(_0x1f779c[_0x6e70('0x46')]['id']){delete _0x1f779c['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x1f779c['params']['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0xb8c10b,null))[_0x6e70('0x23')](saveUpdates(_0x1f779c[_0x6e70('0x46')],null))['then'](respondWithResult(_0xb8c10b,null))['catch'](handleError(_0xb8c10b,null));};exports[_0x6e70('0x24')]=function(_0x3a9ab5,_0x4969b1){return db['AnalyticFieldReport'][_0x6e70('0x45')]({'where':{'id':_0x3a9ab5[_0x6e70('0x41')]['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0x4969b1,null))['then'](removeEntity(_0x4969b1,null))[_0x6e70('0x3f')](handleError(_0x4969b1,null));};exports[_0x6e70('0x48')]=function(_0x42e093,_0x512573){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x42e093[_0x6e70('0x2d')][_0x6e70('0x49')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x512573,0xcc))['catch'](handleError(_0x512573,null));};exports[_0x6e70('0x4a')]=function(_0x2ccde2,_0x44bb5b,_0x4bb228){return db[_0x6e70('0x4b')]['findOne']({'where':{'id':_0x2ccde2[_0x6e70('0x41')]['id']}})[_0x6e70('0x23')](handleEntityNotFound(_0x44bb5b,null))['then'](function(_0x48bb94){if(_0x48bb94){return db['sequelize'][_0x6e70('0x4c')](function(_0x8f565a){return db['AnalyticFieldReport'][_0x6e70('0x24')]({'where':{'CustomReportId':_0x2ccde2[_0x6e70('0x41')]['id']},'transaction':_0x8f565a})[_0x6e70('0x23')](function(_0x1de062){var _0x50887b=_[_0x6e70('0x29')](_0x2ccde2[_0x6e70('0x46')],function(_0x484717){delete _0x484717['id'];_0x484717[_0x6e70('0x4d')]=_0x2ccde2[_0x6e70('0x41')]['id'];return _0x484717;});return db[_0x6e70('0x2a')]['bulkCreate'](_0x50887b,{'transaction':_0x8f565a});});})['then'](function(){return db[_0x6e70('0x2a')]['findAll']({'where':{'CustomReportId':_0x2ccde2[_0x6e70('0x41')]['id']}});});}})[_0x6e70('0x23')](respondWithResult(_0x44bb5b,null))[_0x6e70('0x3f')](handleError(_0x44bb5b,null));}; \ No newline at end of file +var _0x457c=['../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3bbd9f,_0x109c13){var _0x4fd1c1=function(_0x19d46c){while(--_0x19d46c){_0x3bbd9f['push'](_0x3bbd9f['shift']());}};_0x4fd1c1(++_0x109c13);}(_0x457c,0xdf));var _0xc457=function(_0x3ab96b,_0x584427){_0x3ab96b=_0x3ab96b-0x0;var _0x1cc885=_0x457c[_0x3ab96b];return _0x1cc885;};'use strict';var emlformat=require(_0xc457('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc457('0x1'));var jsonpatch=require(_0xc457('0x2'));var rp=require(_0xc457('0x3'));var moment=require(_0xc457('0x4'));var BPromise=require(_0xc457('0x5'));var Mustache=require(_0xc457('0x6'));var util=require(_0xc457('0x7'));var path=require('path');var sox=require(_0xc457('0x8'));var csv=require(_0xc457('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc457('0xa'));var squel=require(_0xc457('0xb'));var crypto=require(_0xc457('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc457('0xd'));var toCsv=require(_0xc457('0x9'));var querystring=require('querystring');var Papa=require(_0xc457('0xe'));var Redis=require(_0xc457('0xf'));var authService=require(_0xc457('0x10'));var qs=require(_0xc457('0x11'));var as=require(_0xc457('0x12'));var hardwareService=require(_0xc457('0x13'));var logger=require(_0xc457('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc457('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47b87e,_0x1d9688){_0x1d9688=_0x1d9688||0xcc;return function(_0x2486b4){if(_0x2486b4){return _0x47b87e[_0xc457('0x16')](_0x1d9688);}return _0x47b87e[_0xc457('0x17')](_0x1d9688)['end']();};}function respondWithResult(_0x24ba82,_0x30ea2b){_0x30ea2b=_0x30ea2b||0xc8;return function(_0x548612){if(_0x548612){return _0x24ba82[_0xc457('0x17')](_0x30ea2b)['json'](_0x548612);}};}function respondWithFilteredResult(_0x3e2c2b,_0x5a64b0){return function(_0x2364f8){if(_0x2364f8){var _0x58e66c=typeof _0x5a64b0[_0xc457('0x18')]===_0xc457('0x19')&&typeof _0x5a64b0[_0xc457('0x1a')]===_0xc457('0x19');var _0x2f7c78=_0x2364f8['count'];var _0x37c431=_0x58e66c?0x0:_0x5a64b0['offset'];var _0xfccc38=_0x58e66c?_0x2364f8[_0xc457('0x1b')]:_0x5a64b0[_0xc457('0x18')]+_0x5a64b0[_0xc457('0x1a')];var _0x2e604e;if(_0xfccc38>=_0x2f7c78){_0xfccc38=_0x2f7c78;_0x2e604e=0xc8;}else{_0x2e604e=0xce;}_0x3e2c2b[_0xc457('0x17')](_0x2e604e);return _0x3e2c2b['set'](_0xc457('0x1c'),_0x37c431+'-'+_0xfccc38+'/'+_0x2f7c78)['json'](_0x2364f8);}return null;};}function patchUpdates(_0x126396){return function(_0x5c9294){try{jsonpatch[_0xc457('0x1d')](_0x5c9294,_0x126396,!![]);}catch(_0x4e0bc4){return BPromise[_0xc457('0x1e')](_0x4e0bc4);}return _0x5c9294[_0xc457('0x1f')]();};}function saveUpdates(_0x57ebf8,_0x25a03b){return function(_0xf20e92){if(_0xf20e92){return _0xf20e92[_0xc457('0x20')](_0x57ebf8)[_0xc457('0x21')](function(_0x14506e){return _0x14506e;});}return null;};}function removeEntity(_0x14d5b1,_0x105797){return function(_0x4bc17e){if(_0x4bc17e){return _0x4bc17e['destroy']()[_0xc457('0x21')](function(){_0x14d5b1[_0xc457('0x17')](0xcc)[_0xc457('0x22')]();});}};}function handleEntityNotFound(_0x1b3884,_0x4f77bd){return function(_0x209626){if(!_0x209626){_0x1b3884[_0xc457('0x16')](0x194);}return _0x209626;};}function handleError(_0x180e09,_0x2139d4){_0x2139d4=_0x2139d4||0x1f4;return function(_0x2099d2){logger[_0xc457('0x23')](_0x2099d2[_0xc457('0x24')]);if(_0x2099d2[_0xc457('0x25')]){delete _0x2099d2[_0xc457('0x25')];}_0x180e09[_0xc457('0x17')](_0x2139d4)[_0xc457('0x26')](_0x2099d2);};}exports[_0xc457('0x27')]=function(_0x17412a,_0x4e8c58){var _0x580549={},_0xe59bfa={},_0xf44a37={'count':0x0,'rows':[]};var _0x5d5a23=_['map'](db[_0xc457('0x28')][_0xc457('0x29')],function(_0x223ac3){return{'name':_0x223ac3[_0xc457('0x2a')],'type':_0x223ac3[_0xc457('0x2b')]['key']};});_0xe59bfa['model']=_[_0xc457('0x2c')](_0x5d5a23,_0xc457('0x25'));_0xe59bfa[_0xc457('0x2d')]=_[_0xc457('0x2e')](_0x17412a[_0xc457('0x2d')]);_0xe59bfa[_0xc457('0x2f')]=_[_0xc457('0x30')](_0xe59bfa[_0xc457('0x31')],_0xe59bfa['query']);_0x580549[_0xc457('0x32')]=_[_0xc457('0x30')](_0xe59bfa['model'],qs[_0xc457('0x33')](_0x17412a['query'][_0xc457('0x33')]));_0x580549[_0xc457('0x32')]=_0x580549['attributes'][_0xc457('0x34')]?_0x580549[_0xc457('0x32')]:_0xe59bfa['model'];if(!_0x17412a[_0xc457('0x2d')][_0xc457('0x35')](_0xc457('0x36'))){_0x580549[_0xc457('0x1a')]=qs[_0xc457('0x1a')](_0x17412a['query'][_0xc457('0x1a')]);_0x580549[_0xc457('0x18')]=qs[_0xc457('0x18')](_0x17412a[_0xc457('0x2d')][_0xc457('0x18')]);}_0x580549[_0xc457('0x37')]=qs['sort'](_0x17412a[_0xc457('0x2d')][_0xc457('0x38')]);_0x580549[_0xc457('0x39')]=qs['filters'](_[_0xc457('0x3a')](_0x17412a[_0xc457('0x2d')],_0xe59bfa['filters']),_0x5d5a23);if(_0x17412a[_0xc457('0x2d')][_0xc457('0x3b')]){_0x580549[_0xc457('0x39')]=_[_0xc457('0x3c')](_0x580549[_0xc457('0x39')],{'$or':_[_0xc457('0x2c')](_0x5d5a23,function(_0x48b571){if(_0x48b571[_0xc457('0x2b')]!==_0xc457('0x3d')){var _0x4136ef={};_0x4136ef[_0x48b571[_0xc457('0x25')]]={'$like':'%'+_0x17412a[_0xc457('0x2d')]['filter']+'%'};return _0x4136ef;}})});}_0x580549=_[_0xc457('0x3c')]({},_0x580549,_0x17412a[_0xc457('0x3e')]);var _0x20dbe0={'where':_0x580549['where']};return db[_0xc457('0x28')][_0xc457('0x1b')](_0x20dbe0)['then'](function(_0x181574){_0xf44a37[_0xc457('0x1b')]=_0x181574;if(_0x17412a[_0xc457('0x2d')][_0xc457('0x3f')]){_0x580549[_0xc457('0x40')]=[{'all':!![]}];}return db[_0xc457('0x28')][_0xc457('0x41')](_0x580549);})[_0xc457('0x21')](function(_0x3d822a){_0xf44a37[_0xc457('0x42')]=_0x3d822a;return _0xf44a37;})[_0xc457('0x21')](respondWithFilteredResult(_0x4e8c58,_0x580549))[_0xc457('0x43')](handleError(_0x4e8c58,null));};exports[_0xc457('0x44')]=function(_0x106ece,_0xf192cf){var _0x18f565={'raw':![],'where':{'id':_0x106ece[_0xc457('0x45')]['id']}},_0x16835f={};_0x16835f[_0xc457('0x31')]=_[_0xc457('0x2e')](db[_0xc457('0x28')][_0xc457('0x29')]);_0x16835f[_0xc457('0x2d')]=_[_0xc457('0x2e')](_0x106ece['query']);_0x16835f[_0xc457('0x2f')]=_[_0xc457('0x30')](_0x16835f['model'],_0x16835f['query']);_0x18f565[_0xc457('0x32')]=_[_0xc457('0x30')](_0x16835f[_0xc457('0x31')],qs['fields'](_0x106ece[_0xc457('0x2d')][_0xc457('0x33')]));_0x18f565[_0xc457('0x32')]=_0x18f565[_0xc457('0x32')][_0xc457('0x34')]?_0x18f565[_0xc457('0x32')]:_0x16835f['model'];if(_0x106ece[_0xc457('0x2d')][_0xc457('0x3f')]){_0x18f565['include']=[{'all':!![]}];}_0x18f565=_['merge']({},_0x18f565,_0x106ece[_0xc457('0x3e')]);return db['AnalyticFieldReport'][_0xc457('0x46')](_0x18f565)['then'](handleEntityNotFound(_0xf192cf,null))[_0xc457('0x21')](respondWithResult(_0xf192cf,null))[_0xc457('0x43')](handleError(_0xf192cf,null));};exports[_0xc457('0x47')]=function(_0x41e59e,_0x46ac3a){return db[_0xc457('0x28')]['create'](_0x41e59e[_0xc457('0x48')],{})[_0xc457('0x21')](respondWithResult(_0x46ac3a,0xc9))[_0xc457('0x43')](handleError(_0x46ac3a,null));};exports[_0xc457('0x49')]=function(_0x3539bd,_0x593ec9){return db[_0xc457('0x28')][_0xc457('0x49')](_0x3539bd[_0xc457('0x48')],{'raw':![],'individualHooks':!![]})[_0xc457('0x21')](respondWithResult(_0x593ec9,0xc9))[_0xc457('0x43')](handleError(_0x593ec9,null));};exports[_0xc457('0x20')]=function(_0x1df66a,_0x31af1a){if(_0x1df66a['body']['id']){delete _0x1df66a['body']['id'];}return db['AnalyticFieldReport'][_0xc457('0x46')]({'where':{'id':_0x1df66a[_0xc457('0x45')]['id']}})['then'](handleEntityNotFound(_0x31af1a,null))['then'](saveUpdates(_0x1df66a['body'],null))[_0xc457('0x21')](respondWithResult(_0x31af1a,null))[_0xc457('0x43')](handleError(_0x31af1a,null));};exports[_0xc457('0x4a')]=function(_0x4a2f50,_0x4c8a9d){return db[_0xc457('0x28')]['find']({'where':{'id':_0x4a2f50[_0xc457('0x45')]['id']}})[_0xc457('0x21')](handleEntityNotFound(_0x4c8a9d,null))[_0xc457('0x21')](removeEntity(_0x4c8a9d,null))[_0xc457('0x43')](handleError(_0x4c8a9d,null));};exports[_0xc457('0x4b')]=function(_0xd695e0,_0x4b88aa){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0xd695e0['query'][_0xc457('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc457('0x21')](respondWithResult(_0x4b88aa,0xcc))[_0xc457('0x43')](handleError(_0x4b88aa,null));};exports[_0xc457('0x4d')]=function(_0x32900e,_0x56aa47,_0x630da9){return db[_0xc457('0x4e')]['findOne']({'where':{'id':_0x32900e[_0xc457('0x45')]['id']}})[_0xc457('0x21')](handleEntityNotFound(_0x56aa47,null))[_0xc457('0x21')](function(_0x18f3bb){if(_0x18f3bb){return db[_0xc457('0x4f')][_0xc457('0x50')](function(_0x2a5649){return db[_0xc457('0x28')][_0xc457('0x4a')]({'where':{'CustomReportId':_0x32900e[_0xc457('0x45')]['id']},'transaction':_0x2a5649})[_0xc457('0x21')](function(_0x27532d){var _0x5bdb15=_[_0xc457('0x2c')](_0x32900e[_0xc457('0x48')],function(_0x55f839){delete _0x55f839['id'];_0x55f839['CustomReportId']=_0x32900e[_0xc457('0x45')]['id'];return _0x55f839;});return db[_0xc457('0x28')][_0xc457('0x49')](_0x5bdb15,{'transaction':_0x2a5649});});})['then'](function(){return db[_0xc457('0x28')][_0xc457('0x41')]({'where':{'CustomReportId':_0x32900e[_0xc457('0x45')]['id']}});});}})[_0xc457('0x21')](respondWithResult(_0x56aa47,null))[_0xc457('0x43')](handleError(_0x56aa47,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ee19062..569551e 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 _0x642f=['rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c5ef3,_0x55eafe){var _0x1a3742=function(_0x1b5e68){while(--_0x1b5e68){_0x4c5ef3['push'](_0x4c5ef3['shift']());}};_0x1a3742(++_0x55eafe);}(_0x642f,0x138));var _0xf642=function(_0x527f7b,_0x263c43){_0x527f7b=_0x527f7b-0x0;var _0x68e917=_0x642f[_0x527f7b];return _0x68e917;};'use strict';var _=require(_0xf642('0x0'));var util=require(_0xf642('0x1'));var logger=require(_0xf642('0x2'))(_0xf642('0x3'));var moment=require(_0xf642('0x4'));var BPromise=require(_0xf642('0x5'));var rp=require(_0xf642('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf642('0x7'));var config=require(_0xf642('0x8'));var attributes=require(_0xf642('0x9'));module['exports']=function(_0x2b4dab,_0x29fa15){return _0x2b4dab['define'](_0xf642('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8588=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3b0f80,_0x1a666a){var _0x52d4bf=function(_0x4ffda1){while(--_0x4ffda1){_0x3b0f80['push'](_0x3b0f80['shift']());}};_0x52d4bf(++_0x1a666a);}(_0x8588,0x74));var _0x8858=function(_0x8fe148,_0x288331){_0x8fe148=_0x8fe148-0x0;var _0x18ccfd=_0x8588[_0x8fe148];return _0x18ccfd;};'use strict';var _=require(_0x8858('0x0'));var util=require('util');var logger=require(_0x8858('0x1'))(_0x8858('0x2'));var moment=require(_0x8858('0x3'));var BPromise=require(_0x8858('0x4'));var rp=require(_0x8858('0x5'));var fs=require('fs');var path=require(_0x8858('0x6'));var rimraf=require(_0x8858('0x7'));var config=require(_0x8858('0x8'));var attributes=require(_0x8858('0x9'));module[_0x8858('0xa')]=function(_0x4d3ded,_0x2cd6f0){return _0x4d3ded[_0x8858('0xb')](_0x8858('0xc'),attributes,{'tableName':_0x8858('0xd'),'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 cb5f948..e8a8ba8 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 _0x1135=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26191d,_0x5142e5){var _0x1b644f=function(_0x146a4a){while(--_0x146a4a){_0x26191d['push'](_0x26191d['shift']());}};_0x1b644f(++_0x5142e5);}(_0x1135,0x6a));var _0x5113=function(_0x388a00,_0x18d2cd){_0x388a00=_0x388a00-0x0;var _0xee6010=_0x1135[_0x388a00];return _0xee6010;};'use strict';var _=require(_0x5113('0x0'));var util=require(_0x5113('0x1'));var moment=require(_0x5113('0x2'));var BPromise=require(_0x5113('0x3'));var rs=require(_0x5113('0x4'));var fs=require('fs');var Redis=require(_0x5113('0x5'));var db=require(_0x5113('0x6'))['db'];var utils=require(_0x5113('0x7'));var logger=require(_0x5113('0x8'))('rpc');var config=require(_0x5113('0x9'));var jayson=require(_0x5113('0xa'));var client=jayson['client'][_0x5113('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52456b,_0x4def68,_0x32d0c5){return new BPromise(function(_0x31df06,_0x492b3a){return client[_0x5113('0xc')](_0x52456b,_0x32d0c5)[_0x5113('0xd')](function(_0xf44298){logger[_0x5113('0xe')](_0x5113('0xf'),_0x4def68,_0x5113('0x10'));logger[_0x5113('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4def68,_0x5113('0x10'),JSON[_0x5113('0x12')](_0xf44298));if(_0xf44298['error']){if(_0xf44298[_0x5113('0x13')][_0x5113('0x14')]===0x1f4){logger['error'](_0x5113('0xf'),_0x4def68,_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);return _0x492b3a(_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);}logger['error'](_0x5113('0xf'),_0x4def68,_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);return _0x31df06(_0xf44298[_0x5113('0x13')][_0x5113('0x15')]);}else{logger[_0x5113('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4def68,'request\x20sent');_0x31df06(_0xf44298[_0x5113('0x16')][_0x5113('0x15')]);}})['catch'](function(_0x584c39){logger['error'](_0x5113('0xf'),_0x4def68,_0x584c39);_0x492b3a(_0x584c39);});});} \ No newline at end of file +var _0x9e10=['AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9e10,0x7b));var _0x09e1=function(_0x24bfce,_0x2364d8){_0x24bfce=_0x24bfce-0x0;var _0x10f7c8=_0x9e10[_0x24bfce];return _0x10f7c8;};'use strict';var _=require(_0x09e1('0x0'));var util=require('util');var moment=require(_0x09e1('0x1'));var BPromise=require(_0x09e1('0x2'));var rs=require(_0x09e1('0x3'));var fs=require('fs');var Redis=require(_0x09e1('0x4'));var db=require(_0x09e1('0x5'))['db'];var utils=require(_0x09e1('0x6'));var logger=require(_0x09e1('0x7'))(_0x09e1('0x8'));var config=require(_0x09e1('0x9'));var jayson=require(_0x09e1('0xa'));var client=jayson[_0x09e1('0xb')][_0x09e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x153407,_0x36a9d0,_0x27bb8a){return new BPromise(function(_0x1357c9,_0x4e7b44){return client['request'](_0x153407,_0x27bb8a)[_0x09e1('0xd')](function(_0x1c49f3){logger[_0x09e1('0xe')](_0x09e1('0xf'),_0x36a9d0,'request\x20sent');logger['debug'](_0x09e1('0x10'),_0x36a9d0,_0x09e1('0x11'),JSON[_0x09e1('0x12')](_0x1c49f3));if(_0x1c49f3['error']){if(_0x1c49f3['error'][_0x09e1('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x36a9d0,_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);return _0x4e7b44(_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);}logger[_0x09e1('0x14')](_0x09e1('0xf'),_0x36a9d0,_0x1c49f3['error'][_0x09e1('0x15')]);return _0x1357c9(_0x1c49f3[_0x09e1('0x14')][_0x09e1('0x15')]);}else{logger[_0x09e1('0xe')](_0x09e1('0xf'),_0x36a9d0,_0x09e1('0x11'));_0x1357c9(_0x1c49f3[_0x09e1('0x16')][_0x09e1('0x15')]);}})['catch'](function(_0x4c9373){logger[_0x09e1('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x36a9d0,_0x4c9373);_0x4e7b44(_0x4c9373);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 696554d..0356cb7 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(_0x233984,_0x2d2be1){var _0x30f6b7=function(_0x18d3df){while(--_0x18d3df){_0x233984['push'](_0x233984['shift']());}};_0x30f6b7(++_0x2d2be1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x34e434,_0x4c74d4){var _0x55be27=function(_0x45cf2b){while(--_0x45cf2b){_0x34e434['push'](_0x34e434['shift']());}};_0x55be27(++_0x4c74d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 ed1c404..985fd70 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 _0x83cd=['exports','STRING','name','sequelize'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_0x83cd,0x17b));var _0xd83c=function(_0x49eba4,_0x4f3802){_0x49eba4=_0x49eba4-0x0;var _0x1c2e93=_0x83cd[_0x49eba4];return _0x1c2e93;};'use strict';var Sequelize=require(_0xd83c('0x0'));module[_0xd83c('0x1')]={'name':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':_0xd83c('0x3')},'table':{'type':Sequelize[_0xd83c('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd83c('0x2')]}}; \ No newline at end of file +var _0x0c71=['name','STRING','TEXT','exports'];(function(_0x4081a5,_0x27e9e2){var _0x59f5d9=function(_0x5b7420){while(--_0x5b7420){_0x4081a5['push'](_0x4081a5['shift']());}};_0x59f5d9(++_0x27e9e2);}(_0x0c71,0xfb));var _0x10c7=function(_0x275db9,_0x352089){_0x275db9=_0x275db9-0x0;var _0x4cf532=_0x0c71[_0x275db9];return _0x4cf532;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x10c7('0x1')},'table':{'type':Sequelize[_0x10c7('0x2')]},'metric':{'type':Sequelize[_0x10c7('0x3')]},'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 2fc2321..9bec68d 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 _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,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(_0x4b8208,_0x293c87){var _0x1f6fac=function(_0x50d65c){while(--_0x50d65c){_0x4b8208['push'](_0x4b8208['shift']());}};_0x1f6fac(++_0x293c87);}(_0x98a8,0x12c));var _0x898a=function(_0x4b5cf3,_0xc54638){_0x4b5cf3=_0x4b5cf3-0x0;var _0x3455dc=_0x98a8[_0x4b5cf3];return _0x3455dc;};'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 2c131ce..93135bc 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 _0x624c=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x327d7a,_0x16d23c){var _0x3a59db=function(_0x59a56a){while(--_0x59a56a){_0x327d7a['push'](_0x327d7a['shift']());}};_0x3a59db(++_0x16d23c);}(_0x624c,0x1ee));var _0xc624=function(_0x1d4be2,_0x12c7ec){_0x1d4be2=_0x1d4be2-0x0;var _0x3df399=_0x624c[_0x1d4be2];return _0x3df399;};'use strict';var _=require('lodash');var util=require(_0xc624('0x0'));var logger=require(_0xc624('0x1'))(_0xc624('0x2'));var moment=require(_0xc624('0x3'));var BPromise=require(_0xc624('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc624('0x5'));var rimraf=require('rimraf');var config=require(_0xc624('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xc624('0x7')]=function(_0x2d1db7,_0x39759e){return _0x2d1db7[_0xc624('0x8')](_0xc624('0x9'),attributes,{'tableName':_0xc624('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8be8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x20e070,_0x3373b4){var _0x4805c1=function(_0x5a1c80){while(--_0x5a1c80){_0x20e070['push'](_0x20e070['shift']());}};_0x4805c1(++_0x3373b4);}(_0x8be8,0xf6));var _0x88be=function(_0x20e200,_0x35bee2){_0x20e200=_0x20e200-0x0;var _0x2e257a=_0x8be8[_0x20e200];return _0x2e257a;};'use strict';var _=require(_0x88be('0x0'));var util=require(_0x88be('0x1'));var logger=require(_0x88be('0x2'))(_0x88be('0x3'));var moment=require(_0x88be('0x4'));var BPromise=require(_0x88be('0x5'));var rp=require(_0x88be('0x6'));var fs=require('fs');var path=require(_0x88be('0x7'));var rimraf=require(_0x88be('0x8'));var config=require('../../config/environment');var attributes=require(_0x88be('0x9'));module['exports']=function(_0xc7c5,_0x57da87){return _0xc7c5[_0x88be('0xa')](_0x88be('0xb'),attributes,{'tableName':_0x88be('0xc'),'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 9f9c0d0..fea225a 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 _0xd7a9=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xd7a9,0x128));var _0x9d7a=function(_0x3e1ccd,_0x3d3880){_0x3e1ccd=_0x3e1ccd-0x0;var _0x3e02ed=_0xd7a9[_0x3e1ccd];return _0x3e02ed;};'use strict';var _=require('lodash');var util=require(_0x9d7a('0x0'));var moment=require(_0x9d7a('0x1'));var BPromise=require(_0x9d7a('0x2'));var rs=require(_0x9d7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d7a('0x4'))['db'];var utils=require(_0x9d7a('0x5'));var logger=require(_0x9d7a('0x6'))('rpc');var config=require(_0x9d7a('0x7'));var jayson=require(_0x9d7a('0x8'));var client=jayson[_0x9d7a('0x9')][_0x9d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47d090,_0x1bbb17,_0x251d27){return new BPromise(function(_0x450167,_0x13b55d){return client[_0x9d7a('0xb')](_0x47d090,_0x251d27)[_0x9d7a('0xc')](function(_0x45ecd8){logger[_0x9d7a('0xd')](_0x9d7a('0xe'),_0x1bbb17,_0x9d7a('0xf'));logger[_0x9d7a('0x10')](_0x9d7a('0x11'),_0x1bbb17,'request\x20sent',JSON[_0x9d7a('0x12')](_0x45ecd8));if(_0x45ecd8[_0x9d7a('0x13')]){if(_0x45ecd8['error'][_0x9d7a('0x14')]===0x1f4){logger['error'](_0x9d7a('0xe'),_0x1bbb17,_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);return _0x13b55d(_0x45ecd8['error'][_0x9d7a('0x15')]);}logger['error'](_0x9d7a('0xe'),_0x1bbb17,_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);return _0x450167(_0x45ecd8[_0x9d7a('0x13')][_0x9d7a('0x15')]);}else{logger[_0x9d7a('0xd')](_0x9d7a('0xe'),_0x1bbb17,_0x9d7a('0xf'));_0x450167(_0x45ecd8[_0x9d7a('0x16')][_0x9d7a('0x15')]);}})[_0x9d7a('0x17')](function(_0x476f8d){logger[_0x9d7a('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1bbb17,_0x476f8d);_0x13b55d(_0x476f8d);});});} \ No newline at end of file +var _0x4a8c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','util'];(function(_0x2b226e,_0x94c72c){var _0x24006c=function(_0x300d81){while(--_0x300d81){_0x2b226e['push'](_0x2b226e['shift']());}};_0x24006c(++_0x94c72c);}(_0x4a8c,0x83));var _0xc4a8=function(_0x16f22d,_0x4ccd65){_0x16f22d=_0x16f22d-0x0;var _0x1b3140=_0x4a8c[_0x16f22d];return _0x1b3140;};'use strict';var _=require('lodash');var util=require(_0xc4a8('0x0'));var moment=require(_0xc4a8('0x1'));var BPromise=require(_0xc4a8('0x2'));var rs=require(_0xc4a8('0x3'));var fs=require('fs');var Redis=require(_0xc4a8('0x4'));var db=require(_0xc4a8('0x5'))['db'];var utils=require(_0xc4a8('0x6'));var logger=require(_0xc4a8('0x7'))(_0xc4a8('0x8'));var config=require(_0xc4a8('0x9'));var jayson=require(_0xc4a8('0xa'));var client=jayson['client'][_0xc4a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c091,_0x1b7734,_0x5b002b){return new BPromise(function(_0x46d045,_0x2c897b){return client[_0xc4a8('0xc')](_0x55c091,_0x5b002b)[_0xc4a8('0xd')](function(_0x12f4d2){logger['info'](_0xc4a8('0xe'),_0x1b7734,_0xc4a8('0xf'));logger[_0xc4a8('0x10')](_0xc4a8('0x11'),_0x1b7734,'request\x20sent',JSON['stringify'](_0x12f4d2));if(_0x12f4d2[_0xc4a8('0x12')]){if(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x13')]===0x1f4){logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x1b7734,_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);return _0x2c897b(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);}logger[_0xc4a8('0x12')](_0xc4a8('0xe'),_0x1b7734,_0x12f4d2[_0xc4a8('0x12')]['message']);return _0x46d045(_0x12f4d2[_0xc4a8('0x12')][_0xc4a8('0x14')]);}else{logger[_0xc4a8('0x15')](_0xc4a8('0xe'),_0x1b7734,_0xc4a8('0xf'));_0x46d045(_0x12f4d2['result'][_0xc4a8('0x14')]);}})['catch'](function(_0x4c6619){logger['error'](_0xc4a8('0xe'),_0x1b7734,_0x4c6619);_0x2c897b(_0x4c6619);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 3ee4d50..678df46 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 _0xb7a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','util','path'];(function(_0xaa1cab,_0x5f54b2){var _0x48cbeb=function(_0x58c0c8){while(--_0x58c0c8){_0xaa1cab['push'](_0xaa1cab['shift']());}};_0x48cbeb(++_0x5f54b2);}(_0xb7a8,0xec));var _0x8b7a=function(_0x3ca393,_0x6def48){_0x3ca393=_0x3ca393-0x0;var _0xfa6ac0=_0xb7a8[_0x3ca393];return _0xfa6ac0;};'use strict';var multer=require('multer');var util=require(_0x8b7a('0x0'));var path=require(_0x8b7a('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b7a('0x2'));var router=express[_0x8b7a('0x3')]();var fs_extra=require(_0x8b7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var controller=require(_0x8b7a('0x7'));router[_0x8b7a('0x8')]('/',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xa')]);router[_0x8b7a('0x8')](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xc')]);router[_0x8b7a('0xd')]('/',auth[_0x8b7a('0x9')](),controller['create']);router[_0x8b7a('0xe')]('/:id',auth[_0x8b7a('0x9')](),controller[_0x8b7a('0xf')]);router['delete'](_0x8b7a('0xb'),auth[_0x8b7a('0x9')](),controller[_0x8b7a('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4819=['/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x1c910c,_0x1f99f4){var _0x111c74=function(_0x105f83){while(--_0x105f83){_0x1c910c['push'](_0x1c910c['shift']());}};_0x111c74(++_0x1f99f4);}(_0x4819,0xcd));var _0x9481=function(_0xef89d,_0x287047){_0xef89d=_0xef89d-0x0;var _0x23d599=_0x4819[_0xef89d];return _0x23d599;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')]('/',auth[_0x9481('0xa')](),controller['create']);router[_0x9481('0xe')]('/:id',auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0xf')](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b9c80a9..688b842 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 _0x263b=['sequelize','exports','TEXT'];(function(_0x4a1d23,_0x411bea){var _0x32c71c=function(_0x4f9845){while(--_0x4f9845){_0x4a1d23['push'](_0x4a1d23['shift']());}};_0x32c71c(++_0x411bea);}(_0x263b,0x144));var _0xb263=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x263b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb263('0x0'));module[_0xb263('0x1')]={'tree':{'type':Sequelize[_0xb263('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa8fb=['TEXT','sequelize','exports'];(function(_0x1a1ac0,_0x754906){var _0x539145=function(_0x2aec93){while(--_0x2aec93){_0x1a1ac0['push'](_0x1a1ac0['shift']());}};_0x539145(++_0x754906);}(_0xa8fb,0xa9));var _0xba8f=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xa8fb[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0xba8f('0x0'));module[_0xba8f('0x1')]={'tree':{'type':Sequelize[_0xba8f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 971646f..5ca2020 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 _0x4a98=['ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0x4a98,0x1b9));var _0x84a9=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x4a98[_0x503641];return _0x17757d;};'use strict';var emlformat=require(_0x84a9('0x0'));var rimraf=require(_0x84a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84a9('0x2'));var rp=require(_0x84a9('0x3'));var moment=require(_0x84a9('0x4'));var BPromise=require(_0x84a9('0x5'));var Mustache=require(_0x84a9('0x6'));var util=require('util');var path=require(_0x84a9('0x7'));var sox=require('sox');var csv=require(_0x84a9('0x8'));var ejs=require(_0x84a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84a9('0xa'));var squel=require('squel');var crypto=require(_0x84a9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84a9('0xc'));var Papa=require(_0x84a9('0xd'));var Redis=require(_0x84a9('0xe'));var authService=require(_0x84a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x84a9('0x10'));var hardwareService=require(_0x84a9('0x11'));var logger=require(_0x84a9('0x12'))(_0x84a9('0x13'));var utils=require(_0x84a9('0x14'));var config=require(_0x84a9('0x15'));var licenseUtil=require(_0x84a9('0x16'));var db=require(_0x84a9('0x17'))['db'];function respondWithStatusCode(_0x42ce74,_0x164fa7){_0x164fa7=_0x164fa7||0xcc;return function(_0x110809){if(_0x110809){return _0x42ce74[_0x84a9('0x18')](_0x164fa7);}return _0x42ce74[_0x84a9('0x19')](_0x164fa7)[_0x84a9('0x1a')]();};}function respondWithResult(_0x11c9ec,_0x585a76){_0x585a76=_0x585a76||0xc8;return function(_0x424e8){if(_0x424e8){return _0x11c9ec['status'](_0x585a76)[_0x84a9('0x1b')](_0x424e8);}};}function respondWithFilteredResult(_0x37dece,_0x119ad3){return function(_0x1bba91){if(_0x1bba91){var _0x2b2999=typeof _0x119ad3['offset']===_0x84a9('0x1c')&&typeof _0x119ad3[_0x84a9('0x1d')]===_0x84a9('0x1c');var _0xc261b6=_0x1bba91['count'];var _0x29b59d=_0x2b2999?0x0:_0x119ad3[_0x84a9('0x1e')];var _0x126bd3=_0x2b2999?_0x1bba91['count']:_0x119ad3[_0x84a9('0x1e')]+_0x119ad3[_0x84a9('0x1d')];var _0x2cd18e;if(_0x126bd3>=_0xc261b6){_0x126bd3=_0xc261b6;_0x2cd18e=0xc8;}else{_0x2cd18e=0xce;}_0x37dece[_0x84a9('0x19')](_0x2cd18e);return _0x37dece[_0x84a9('0x1f')](_0x84a9('0x20'),_0x29b59d+'-'+_0x126bd3+'/'+_0xc261b6)[_0x84a9('0x1b')](_0x1bba91);}return null;};}function patchUpdates(_0x3205b5){return function(_0xaa4176){try{jsonpatch['apply'](_0xaa4176,_0x3205b5,!![]);}catch(_0x5c9b91){return BPromise[_0x84a9('0x21')](_0x5c9b91);}return _0xaa4176[_0x84a9('0x22')]();};}function saveUpdates(_0x2e73ad,_0x570d1c){return function(_0x4b5b36){if(_0x4b5b36){return _0x4b5b36[_0x84a9('0x23')](_0x2e73ad)[_0x84a9('0x24')](function(_0x36656f){return _0x36656f;});}return null;};}function removeEntity(_0x431959,_0x4edd4b){return function(_0x3a0375){if(_0x3a0375){return _0x3a0375[_0x84a9('0x25')]()[_0x84a9('0x24')](function(){_0x431959[_0x84a9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8e8fb,_0x2289e3){return function(_0x4d3f35){if(!_0x4d3f35){_0xd8e8fb[_0x84a9('0x18')](0x194);}return _0x4d3f35;};}function handleError(_0x4ff03a,_0x6700f8){_0x6700f8=_0x6700f8||0x1f4;return function(_0x543e52){logger['error'](_0x543e52[_0x84a9('0x26')]);if(_0x543e52[_0x84a9('0x27')]){delete _0x543e52[_0x84a9('0x27')];}_0x4ff03a['status'](_0x6700f8)[_0x84a9('0x28')](_0x543e52);};}exports[_0x84a9('0x29')]=function(_0x42de6c,_0x52d9e5){var _0x4196c1={},_0x211aa0={},_0x5697fa={'count':0x0,'rows':[]};var _0x4bb4c1=_['map'](db['AnalyticTreeReport'][_0x84a9('0x2a')],function(_0x3b5693){return{'name':_0x3b5693[_0x84a9('0x2b')],'type':_0x3b5693['type'][_0x84a9('0x2c')]};});_0x211aa0['model']=_[_0x84a9('0x2d')](_0x4bb4c1,_0x84a9('0x27'));_0x211aa0[_0x84a9('0x2e')]=_[_0x84a9('0x2f')](_0x42de6c[_0x84a9('0x2e')]);_0x211aa0[_0x84a9('0x30')]=_[_0x84a9('0x31')](_0x211aa0[_0x84a9('0x32')],_0x211aa0[_0x84a9('0x2e')]);_0x4196c1[_0x84a9('0x33')]=_['intersection'](_0x211aa0[_0x84a9('0x32')],qs[_0x84a9('0x34')](_0x42de6c[_0x84a9('0x2e')]['fields']));_0x4196c1[_0x84a9('0x33')]=_0x4196c1[_0x84a9('0x33')]['length']?_0x4196c1[_0x84a9('0x33')]:_0x211aa0['model'];if(!_0x42de6c[_0x84a9('0x2e')][_0x84a9('0x35')](_0x84a9('0x36'))){_0x4196c1[_0x84a9('0x1d')]=qs[_0x84a9('0x1d')](_0x42de6c[_0x84a9('0x2e')]['limit']);_0x4196c1[_0x84a9('0x1e')]=qs['offset'](_0x42de6c['query'][_0x84a9('0x1e')]);}_0x4196c1[_0x84a9('0x37')]=qs[_0x84a9('0x38')](_0x42de6c[_0x84a9('0x2e')]['sort']);_0x4196c1['where']=qs[_0x84a9('0x30')](_[_0x84a9('0x39')](_0x42de6c['query'],_0x211aa0[_0x84a9('0x30')]),_0x4bb4c1);if(_0x42de6c[_0x84a9('0x2e')][_0x84a9('0x3a')]){_0x4196c1[_0x84a9('0x3b')]=_[_0x84a9('0x3c')](_0x4196c1['where'],{'$or':_[_0x84a9('0x2d')](_0x4bb4c1,function(_0x268aba){if(_0x268aba[_0x84a9('0x3d')]!==_0x84a9('0x3e')){var _0x213433={};_0x213433[_0x268aba[_0x84a9('0x27')]]={'$like':'%'+_0x42de6c[_0x84a9('0x2e')]['filter']+'%'};return _0x213433;}})});}_0x4196c1=_[_0x84a9('0x3c')]({},_0x4196c1,_0x42de6c['options']);var _0x4066e8={'where':_0x4196c1['where']};return db['AnalyticTreeReport']['count'](_0x4066e8)[_0x84a9('0x24')](function(_0x2278bd){_0x5697fa[_0x84a9('0x3f')]=_0x2278bd;if(_0x42de6c['query'][_0x84a9('0x40')]){_0x4196c1[_0x84a9('0x41')]=[{'all':!![]}];}return db[_0x84a9('0x42')][_0x84a9('0x43')](_0x4196c1);})[_0x84a9('0x24')](function(_0x2c1fc2){_0x5697fa[_0x84a9('0x44')]=_0x2c1fc2;return _0x5697fa;})[_0x84a9('0x24')](respondWithFilteredResult(_0x52d9e5,_0x4196c1))[_0x84a9('0x45')](handleError(_0x52d9e5,null));};exports[_0x84a9('0x46')]=function(_0x214ed3,_0x31c554){var _0x40b236={'raw':!![],'where':{'id':_0x214ed3[_0x84a9('0x47')]['id']}},_0x41fa4b={};_0x41fa4b['model']=_[_0x84a9('0x2f')](db[_0x84a9('0x42')][_0x84a9('0x2a')]);_0x41fa4b[_0x84a9('0x2e')]=_['keys'](_0x214ed3[_0x84a9('0x2e')]);_0x41fa4b[_0x84a9('0x30')]=_[_0x84a9('0x31')](_0x41fa4b[_0x84a9('0x32')],_0x41fa4b['query']);_0x40b236[_0x84a9('0x33')]=_[_0x84a9('0x31')](_0x41fa4b[_0x84a9('0x32')],qs['fields'](_0x214ed3['query'][_0x84a9('0x34')]));_0x40b236['attributes']=_0x40b236[_0x84a9('0x33')]['length']?_0x40b236[_0x84a9('0x33')]:_0x41fa4b['model'];if(_0x214ed3['query'][_0x84a9('0x40')]){_0x40b236[_0x84a9('0x41')]=[{'all':!![]}];}_0x40b236=_[_0x84a9('0x3c')]({},_0x40b236,_0x214ed3['options']);return db[_0x84a9('0x42')]['find'](_0x40b236)['then'](handleEntityNotFound(_0x31c554,null))[_0x84a9('0x24')](respondWithResult(_0x31c554,null))[_0x84a9('0x45')](handleError(_0x31c554,null));};exports[_0x84a9('0x48')]=function(_0x1e0ff0,_0x128153){return db['AnalyticTreeReport'][_0x84a9('0x48')](_0x1e0ff0['body'],{})[_0x84a9('0x24')](respondWithResult(_0x128153,0xc9))[_0x84a9('0x45')](handleError(_0x128153,null));};exports[_0x84a9('0x23')]=function(_0xdb7247,_0x2bfd84){if(_0xdb7247[_0x84a9('0x49')]['id']){delete _0xdb7247[_0x84a9('0x49')]['id'];}return db[_0x84a9('0x42')][_0x84a9('0x4a')]({'where':{'id':_0xdb7247['params']['id']}})[_0x84a9('0x24')](handleEntityNotFound(_0x2bfd84,null))[_0x84a9('0x24')](saveUpdates(_0xdb7247['body'],null))[_0x84a9('0x24')](respondWithResult(_0x2bfd84,null))[_0x84a9('0x45')](handleError(_0x2bfd84,null));};exports[_0x84a9('0x25')]=function(_0x500779,_0x5cb1e5){return db[_0x84a9('0x42')]['find']({'where':{'id':_0x500779[_0x84a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cb1e5,null))['then'](removeEntity(_0x5cb1e5,null))[_0x84a9('0x45')](handleError(_0x5cb1e5,null));}; \ No newline at end of file +var _0xf5f5=['error','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x313d6f,_0x122c8d){var _0x2059ac=function(_0x49c551){while(--_0x49c551){_0x313d6f['push'](_0x313d6f['shift']());}};_0x2059ac(++_0x122c8d);}(_0xf5f5,0xfe));var _0x5f5f=function(_0x236001,_0x243c37){_0x236001=_0x236001-0x0;var _0x5741a2=_0xf5f5[_0x236001];return _0x5741a2;};'use strict';var emlformat=require(_0x5f5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f5f('0x1'));var jsonpatch=require(_0x5f5f('0x2'));var rp=require(_0x5f5f('0x3'));var moment=require('moment');var BPromise=require(_0x5f5f('0x4'));var Mustache=require('mustache');var util=require(_0x5f5f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5f5f('0x6'));var ejs=require(_0x5f5f('0x7'));var fs=require('fs');var fs_extra=require(_0x5f5f('0x8'));var _=require(_0x5f5f('0x9'));var squel=require(_0x5f5f('0xa'));var crypto=require(_0x5f5f('0xb'));var jsforce=require(_0x5f5f('0xc'));var deskjs=require(_0x5f5f('0xd'));var toCsv=require(_0x5f5f('0x6'));var querystring=require('querystring');var Papa=require(_0x5f5f('0xe'));var Redis=require(_0x5f5f('0xf'));var authService=require(_0x5f5f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f5f('0x11'));var logger=require(_0x5f5f('0x12'))(_0x5f5f('0x13'));var utils=require(_0x5f5f('0x14'));var config=require(_0x5f5f('0x15'));var licenseUtil=require(_0x5f5f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x434b4a,_0x526920){_0x526920=_0x526920||0xcc;return function(_0x352efe){if(_0x352efe){return _0x434b4a[_0x5f5f('0x17')](_0x526920);}return _0x434b4a['status'](_0x526920)[_0x5f5f('0x18')]();};}function respondWithResult(_0x30c463,_0x26672c){_0x26672c=_0x26672c||0xc8;return function(_0x32f7ee){if(_0x32f7ee){return _0x30c463[_0x5f5f('0x19')](_0x26672c)['json'](_0x32f7ee);}};}function respondWithFilteredResult(_0xabc1ae,_0x2c9b1c){return function(_0x30f982){if(_0x30f982){var _0x280c51=typeof _0x2c9b1c[_0x5f5f('0x1a')]===_0x5f5f('0x1b')&&typeof _0x2c9b1c[_0x5f5f('0x1c')]==='undefined';var _0xe0a2b9=_0x30f982[_0x5f5f('0x1d')];var _0x1934ac=_0x280c51?0x0:_0x2c9b1c[_0x5f5f('0x1a')];var _0x3f1759=_0x280c51?_0x30f982[_0x5f5f('0x1d')]:_0x2c9b1c['offset']+_0x2c9b1c['limit'];var _0x4b05cb;if(_0x3f1759>=_0xe0a2b9){_0x3f1759=_0xe0a2b9;_0x4b05cb=0xc8;}else{_0x4b05cb=0xce;}_0xabc1ae[_0x5f5f('0x19')](_0x4b05cb);return _0xabc1ae[_0x5f5f('0x1e')]('Content-Range',_0x1934ac+'-'+_0x3f1759+'/'+_0xe0a2b9)[_0x5f5f('0x1f')](_0x30f982);}return null;};}function patchUpdates(_0x3c1640){return function(_0x326ca0){try{jsonpatch[_0x5f5f('0x20')](_0x326ca0,_0x3c1640,!![]);}catch(_0x352051){return BPromise[_0x5f5f('0x21')](_0x352051);}return _0x326ca0[_0x5f5f('0x22')]();};}function saveUpdates(_0x5548a1,_0x55c669){return function(_0x52b7f7){if(_0x52b7f7){return _0x52b7f7[_0x5f5f('0x23')](_0x5548a1)['then'](function(_0x41fcbe){return _0x41fcbe;});}return null;};}function removeEntity(_0x40677a,_0x214d6c){return function(_0x3af4e1){if(_0x3af4e1){return _0x3af4e1[_0x5f5f('0x24')]()[_0x5f5f('0x25')](function(){_0x40677a[_0x5f5f('0x19')](0xcc)[_0x5f5f('0x18')]();});}};}function handleEntityNotFound(_0x5513c0,_0x2f8b32){return function(_0x457049){if(!_0x457049){_0x5513c0[_0x5f5f('0x17')](0x194);}return _0x457049;};}function handleError(_0x599e1f,_0x4adf45){_0x4adf45=_0x4adf45||0x1f4;return function(_0x232558){logger[_0x5f5f('0x26')](_0x232558['stack']);if(_0x232558['name']){delete _0x232558['name'];}_0x599e1f[_0x5f5f('0x19')](_0x4adf45)[_0x5f5f('0x27')](_0x232558);};}exports[_0x5f5f('0x28')]=function(_0x51d26f,_0x4ac8a6){var _0x1ddfdb={},_0x2e1c06={},_0x424f3c={'count':0x0,'rows':[]};var _0x1d5162=_[_0x5f5f('0x29')](db['AnalyticTreeReport'][_0x5f5f('0x2a')],function(_0x4ff504){return{'name':_0x4ff504[_0x5f5f('0x2b')],'type':_0x4ff504[_0x5f5f('0x2c')]['key']};});_0x2e1c06[_0x5f5f('0x2d')]=_[_0x5f5f('0x29')](_0x1d5162,'name');_0x2e1c06[_0x5f5f('0x2e')]=_[_0x5f5f('0x2f')](_0x51d26f['query']);_0x2e1c06[_0x5f5f('0x30')]=_['intersection'](_0x2e1c06[_0x5f5f('0x2d')],_0x2e1c06['query']);_0x1ddfdb[_0x5f5f('0x31')]=_[_0x5f5f('0x32')](_0x2e1c06[_0x5f5f('0x2d')],qs[_0x5f5f('0x33')](_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x33')]));_0x1ddfdb[_0x5f5f('0x31')]=_0x1ddfdb[_0x5f5f('0x31')][_0x5f5f('0x34')]?_0x1ddfdb[_0x5f5f('0x31')]:_0x2e1c06[_0x5f5f('0x2d')];if(!_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x35')](_0x5f5f('0x36'))){_0x1ddfdb[_0x5f5f('0x1c')]=qs[_0x5f5f('0x1c')](_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x1c')]);_0x1ddfdb[_0x5f5f('0x1a')]=qs[_0x5f5f('0x1a')](_0x51d26f['query'][_0x5f5f('0x1a')]);}_0x1ddfdb[_0x5f5f('0x37')]=qs[_0x5f5f('0x38')](_0x51d26f['query'][_0x5f5f('0x38')]);_0x1ddfdb['where']=qs['filters'](_[_0x5f5f('0x39')](_0x51d26f[_0x5f5f('0x2e')],_0x2e1c06[_0x5f5f('0x30')]),_0x1d5162);if(_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x3a')]){_0x1ddfdb[_0x5f5f('0x3b')]=_[_0x5f5f('0x3c')](_0x1ddfdb[_0x5f5f('0x3b')],{'$or':_[_0x5f5f('0x29')](_0x1d5162,function(_0x318dca){if(_0x318dca[_0x5f5f('0x2c')]!=='VIRTUAL'){var _0x5892cd={};_0x5892cd[_0x318dca['name']]={'$like':'%'+_0x51d26f['query'][_0x5f5f('0x3a')]+'%'};return _0x5892cd;}})});}_0x1ddfdb=_[_0x5f5f('0x3c')]({},_0x1ddfdb,_0x51d26f[_0x5f5f('0x3d')]);var _0x30817b={'where':_0x1ddfdb[_0x5f5f('0x3b')]};return db['AnalyticTreeReport']['count'](_0x30817b)['then'](function(_0x115ffe){_0x424f3c[_0x5f5f('0x1d')]=_0x115ffe;if(_0x51d26f[_0x5f5f('0x2e')][_0x5f5f('0x3e')]){_0x1ddfdb[_0x5f5f('0x3f')]=[{'all':!![]}];}return db[_0x5f5f('0x40')][_0x5f5f('0x41')](_0x1ddfdb);})[_0x5f5f('0x25')](function(_0x3ea1c9){_0x424f3c[_0x5f5f('0x42')]=_0x3ea1c9;return _0x424f3c;})[_0x5f5f('0x25')](respondWithFilteredResult(_0x4ac8a6,_0x1ddfdb))[_0x5f5f('0x43')](handleError(_0x4ac8a6,null));};exports[_0x5f5f('0x44')]=function(_0x15348d,_0x40e936){var _0x137f1c={'raw':!![],'where':{'id':_0x15348d['params']['id']}},_0x1640e6={};_0x1640e6[_0x5f5f('0x2d')]=_[_0x5f5f('0x2f')](db[_0x5f5f('0x40')][_0x5f5f('0x2a')]);_0x1640e6['query']=_['keys'](_0x15348d[_0x5f5f('0x2e')]);_0x1640e6[_0x5f5f('0x30')]=_[_0x5f5f('0x32')](_0x1640e6['model'],_0x1640e6[_0x5f5f('0x2e')]);_0x137f1c['attributes']=_[_0x5f5f('0x32')](_0x1640e6[_0x5f5f('0x2d')],qs[_0x5f5f('0x33')](_0x15348d[_0x5f5f('0x2e')]['fields']));_0x137f1c[_0x5f5f('0x31')]=_0x137f1c['attributes'][_0x5f5f('0x34')]?_0x137f1c['attributes']:_0x1640e6['model'];if(_0x15348d[_0x5f5f('0x2e')][_0x5f5f('0x3e')]){_0x137f1c[_0x5f5f('0x3f')]=[{'all':!![]}];}_0x137f1c=_['merge']({},_0x137f1c,_0x15348d[_0x5f5f('0x3d')]);return db[_0x5f5f('0x40')][_0x5f5f('0x45')](_0x137f1c)['then'](handleEntityNotFound(_0x40e936,null))['then'](respondWithResult(_0x40e936,null))['catch'](handleError(_0x40e936,null));};exports[_0x5f5f('0x46')]=function(_0x2bc0b2,_0x18b00a){return db['AnalyticTreeReport'][_0x5f5f('0x46')](_0x2bc0b2[_0x5f5f('0x47')],{})['then'](respondWithResult(_0x18b00a,0xc9))['catch'](handleError(_0x18b00a,null));};exports['update']=function(_0x3cd8fa,_0x1ff282){if(_0x3cd8fa[_0x5f5f('0x47')]['id']){delete _0x3cd8fa[_0x5f5f('0x47')]['id'];}return db[_0x5f5f('0x40')][_0x5f5f('0x45')]({'where':{'id':_0x3cd8fa[_0x5f5f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ff282,null))['then'](saveUpdates(_0x3cd8fa['body'],null))[_0x5f5f('0x25')](respondWithResult(_0x1ff282,null))[_0x5f5f('0x43')](handleError(_0x1ff282,null));};exports[_0x5f5f('0x24')]=function(_0x996d53,_0x3edc5a){return db[_0x5f5f('0x40')][_0x5f5f('0x45')]({'where':{'id':_0x996d53[_0x5f5f('0x48')]['id']}})[_0x5f5f('0x25')](handleEntityNotFound(_0x3edc5a,null))[_0x5f5f('0x25')](removeEntity(_0x3edc5a,null))[_0x5f5f('0x43')](handleError(_0x3edc5a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0437726..8fe1578 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 _0x7869=['lodash','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x40570d,_0x173745){var _0x53bc05=function(_0x2e0259){while(--_0x2e0259){_0x40570d['push'](_0x40570d['shift']());}};_0x53bc05(++_0x173745);}(_0x7869,0x172));var _0x9786=function(_0xb434e5,_0x4d78d3){_0xb434e5=_0xb434e5-0x0;var _0x1775bf=_0x7869[_0xb434e5];return _0x1775bf;};'use strict';var _=require(_0x9786('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9786('0x1'));var BPromise=require(_0x9786('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9786('0x3'));var rimraf=require(_0x9786('0x4'));var config=require(_0x9786('0x5'));var attributes=require(_0x9786('0x6'));module['exports']=function(_0x140015,_0x262c6d){return _0x140015[_0x9786('0x7')](_0x9786('0x8'),attributes,{'tableName':_0x9786('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6527=['bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x4e713e,_0x1ac682){var _0x296ac0=function(_0x26a297){while(--_0x26a297){_0x4e713e['push'](_0x4e713e['shift']());}};_0x296ac0(++_0x1ac682);}(_0x6527,0x10d));var _0x7652=function(_0x508d96,_0x4774cb){_0x508d96=_0x508d96-0x0;var _0x445799=_0x6527[_0x508d96];return _0x445799;};'use strict';var _=require(_0x7652('0x0'));var util=require(_0x7652('0x1'));var logger=require(_0x7652('0x2'))(_0x7652('0x3'));var moment=require('moment');var BPromise=require(_0x7652('0x4'));var rp=require(_0x7652('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7652('0x6'));var config=require(_0x7652('0x7'));var attributes=require(_0x7652('0x8'));module[_0x7652('0x9')]=function(_0x3986be,_0xf31d96){return _0x3986be[_0x7652('0xa')](_0x7652('0xb'),attributes,{'tableName':_0x7652('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index e8d5950..7af6320 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x54dd29,_0x4417dd){var _0x370bc6=function(_0x1f5391){while(--_0x1f5391){_0x54dd29['push'](_0x54dd29['shift']());}};_0x370bc6(++_0x4417dd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x266d8c,_0x1d0f0b){var _0x1ca7a1=function(_0x3ab29c){while(--_0x3ab29c){_0x266d8c['push'](_0x266d8c['shift']());}};_0x1ca7a1(++_0x1d0f0b);}(_0xdb28,0x106));var _0x8db2=function(_0x474a36,_0x3f534a){_0x474a36=_0x474a36-0x0;var _0x4a4529=_0xdb28[_0x474a36];return _0x4a4529;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 20a21bf..5b683a5 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 _0x8794=['../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','util','fs-extra','../../components/interaction/service'];(function(_0x3c0569,_0x11da9f){var _0x142524=function(_0x59a41e){while(--_0x59a41e){_0x3c0569['push'](_0x3c0569['shift']());}};_0x142524(++_0x11da9f);}(_0x8794,0x6c));var _0x4879=function(_0x1a4dd7,_0x5487e5){_0x1a4dd7=_0x1a4dd7-0x0;var _0x48c2af=_0x8794[_0x1a4dd7];return _0x48c2af;};'use strict';var multer=require(_0x4879('0x0'));var util=require(_0x4879('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4879('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x4879('0x3'));var config=require(_0x4879('0x4'));var controller=require(_0x4879('0x5'));router['get']('/',auth[_0x4879('0x6')](),controller[_0x4879('0x7')]);router['get'](_0x4879('0x8'),auth[_0x4879('0x6')](),controller['show']);router['post']('/',auth[_0x4879('0x6')](),controller[_0x4879('0x9')]);router[_0x4879('0xa')](_0x4879('0x8'),auth[_0x4879('0x6')](),controller[_0x4879('0xb')]);router[_0x4879('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4879('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa437=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','isAuthenticated','show','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0xa437,0xd1));var _0x7a43=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa437[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x7a43('0x0'));var util=require('util');var path=require(_0x7a43('0x1'));var timeout=require(_0x7a43('0x2'));var express=require(_0x7a43('0x3'));var router=express[_0x7a43('0x4')]();var fs_extra=require(_0x7a43('0x5'));var auth=require(_0x7a43('0x6'));var interaction=require(_0x7a43('0x7'));var config=require(_0x7a43('0x8'));var controller=require(_0x7a43('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a43('0xa')]);router[_0x7a43('0xb')]('/:id',auth[_0x7a43('0xc')](),controller[_0x7a43('0xd')]);router['post']('/',auth[_0x7a43('0xc')](),controller['create']);router[_0x7a43('0xe')](_0x7a43('0xf'),auth[_0x7a43('0xc')](),controller['update']);router[_0x7a43('0x10')](_0x7a43('0xf'),auth['isAuthenticated'](),controller[_0x7a43('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 34c3874..3650453 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 _0xac95=['sequelize','exports','STRING'];(function(_0x2e5590,_0x522539){var _0x358234=function(_0x43a45b){while(--_0x43a45b){_0x2e5590['push'](_0x2e5590['shift']());}};_0x358234(++_0x522539);}(_0xac95,0xa8));var _0x5ac9=function(_0x5e8836,_0x207ce8){_0x5e8836=_0x5e8836-0x0;var _0x30c99a=_0xac95[_0x5e8836];return _0x30c99a;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'name':{'type':Sequelize[_0x5ac9('0x2')]},'basename':{'type':Sequelize[_0x5ac9('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0eec=['sequelize','STRING'];(function(_0x32e7d6,_0x214dda){var _0x481e8c=function(_0x1c800a){while(--_0x1c800a){_0x32e7d6['push'](_0x32e7d6['shift']());}};_0x481e8c(++_0x214dda);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc0ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc0ee('0x1')]},'type':{'type':Sequelize[_0xc0ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 249e688..758ed87 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 _0x13a7=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','count','includeAll','include','catch','params','merge','find','clone','intersection','updatedAt','omit','body','createdAt','create','destroy','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5276f1,_0x1fcf3f){var _0xa2d451=function(_0x59de19){while(--_0x59de19){_0x5276f1['push'](_0x5276f1['shift']());}};_0xa2d451(++_0x1fcf3f);}(_0x13a7,0x159));var _0x713a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13a7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x713a('0x0'));var rimraf=require(_0x713a('0x1'));var zipdir=require(_0x713a('0x2'));var jsonpatch=require(_0x713a('0x3'));var rp=require(_0x713a('0x4'));var moment=require(_0x713a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x713a('0x6'));var util=require('util');var path=require(_0x713a('0x7'));var sox=require(_0x713a('0x8'));var csv=require(_0x713a('0x9'));var ejs=require(_0x713a('0xa'));var fs=require('fs');var fs_extra=require(_0x713a('0xb'));var _=require('lodash');var squel=require(_0x713a('0xc'));var crypto=require(_0x713a('0xd'));var jsforce=require(_0x713a('0xe'));var deskjs=require(_0x713a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x713a('0x10'));var Papa=require(_0x713a('0x11'));var Redis=require(_0x713a('0x12'));var authService=require(_0x713a('0x13'));var qs=require(_0x713a('0x14'));var as=require(_0x713a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x713a('0x16'));var utils=require(_0x713a('0x17'));var config=require(_0x713a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41fcd2,_0x311de8){_0x311de8=_0x311de8||0xcc;return function(_0x22b4a3){if(_0x22b4a3){return _0x41fcd2[_0x713a('0x19')](_0x311de8);}return _0x41fcd2[_0x713a('0x1a')](_0x311de8)[_0x713a('0x1b')]();};}function respondWithResult(_0x190c33,_0x5b4842){_0x5b4842=_0x5b4842||0xc8;return function(_0x36d00d){if(_0x36d00d){return _0x190c33[_0x713a('0x1a')](_0x5b4842)['json'](_0x36d00d);}};}function respondWithFilteredResult(_0xae7ae1,_0x2446ed){return function(_0x1b5768){if(_0x1b5768){var _0x12bf50=typeof _0x2446ed['offset']===_0x713a('0x1c')&&typeof _0x2446ed[_0x713a('0x1d')]===_0x713a('0x1c');var _0x5cb65b=_0x1b5768['count'];var _0x5c2129=_0x12bf50?0x0:_0x2446ed[_0x713a('0x1e')];var _0x227e56=_0x12bf50?_0x1b5768['count']:_0x2446ed[_0x713a('0x1e')]+_0x2446ed['limit'];var _0x4772d3;if(_0x227e56>=_0x5cb65b){_0x227e56=_0x5cb65b;_0x4772d3=0xc8;}else{_0x4772d3=0xce;}_0xae7ae1[_0x713a('0x1a')](_0x4772d3);return _0xae7ae1['set'](_0x713a('0x1f'),_0x5c2129+'-'+_0x227e56+'/'+_0x5cb65b)[_0x713a('0x20')](_0x1b5768);}return null;};}function patchUpdates(_0x639efd){return function(_0x1015e3){try{jsonpatch[_0x713a('0x21')](_0x1015e3,_0x639efd,!![]);}catch(_0x30f9a2){return BPromise[_0x713a('0x22')](_0x30f9a2);}return _0x1015e3[_0x713a('0x23')]();};}function saveUpdates(_0x495664,_0x552ae7){return function(_0x38b1f6){if(_0x38b1f6){return _0x38b1f6[_0x713a('0x24')](_0x495664)[_0x713a('0x25')](function(_0x5defcc){return _0x5defcc;});}return null;};}function removeEntity(_0x313f28,_0x43c8c6){return function(_0x2b4ead){if(_0x2b4ead){return _0x2b4ead['destroy']()['then'](function(){_0x313f28['status'](0xcc)[_0x713a('0x1b')]();});}};}function handleEntityNotFound(_0x1cd189,_0x237fe9){return function(_0x16c2c9){if(!_0x16c2c9){_0x1cd189[_0x713a('0x19')](0x194);}return _0x16c2c9;};}function handleError(_0x5726f1,_0xb65dcd){_0xb65dcd=_0xb65dcd||0x1f4;return function(_0x29a67f){logger[_0x713a('0x26')](_0x29a67f[_0x713a('0x27')]);if(_0x29a67f[_0x713a('0x28')]){delete _0x29a67f['name'];}_0x5726f1[_0x713a('0x1a')](_0xb65dcd)['send'](_0x29a67f);};}exports[_0x713a('0x29')]=function(_0x59435d,_0x50a136){var _0x4fa258={},_0x2f6292={},_0x15b39b={'count':0x0,'rows':[]};var _0xac389a=_[_0x713a('0x2a')](db[_0x713a('0x2b')][_0x713a('0x2c')],function(_0x1bd869){return{'name':_0x1bd869[_0x713a('0x2d')],'type':_0x1bd869['type'][_0x713a('0x2e')]};});_0x2f6292[_0x713a('0x2f')]=_[_0x713a('0x2a')](_0xac389a,_0x713a('0x28'));_0x2f6292[_0x713a('0x30')]=_[_0x713a('0x31')](_0x59435d[_0x713a('0x30')]);_0x2f6292[_0x713a('0x32')]=_['intersection'](_0x2f6292['model'],_0x2f6292['query']);_0x4fa258[_0x713a('0x33')]=_['intersection'](_0x2f6292[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x59435d[_0x713a('0x30')]['fields']));_0x4fa258[_0x713a('0x33')]=_0x4fa258[_0x713a('0x33')][_0x713a('0x35')]?_0x4fa258[_0x713a('0x33')]:_0x2f6292['model'];if(!_0x59435d[_0x713a('0x30')][_0x713a('0x36')]('nolimit')){_0x4fa258[_0x713a('0x1d')]=qs[_0x713a('0x1d')](_0x59435d[_0x713a('0x30')][_0x713a('0x1d')]);_0x4fa258[_0x713a('0x1e')]=qs['offset'](_0x59435d[_0x713a('0x30')][_0x713a('0x1e')]);}_0x4fa258[_0x713a('0x37')]=qs[_0x713a('0x38')](_0x59435d['query'][_0x713a('0x38')]);_0x4fa258[_0x713a('0x39')]=qs['filters'](_[_0x713a('0x3a')](_0x59435d[_0x713a('0x30')],_0x2f6292[_0x713a('0x32')]),_0xac389a);if(_0x59435d[_0x713a('0x30')]['filter']){_0x4fa258[_0x713a('0x39')]=_['merge'](_0x4fa258[_0x713a('0x39')],{'$or':_[_0x713a('0x2a')](_0xac389a,function(_0x5c47bf){if(_0x5c47bf[_0x713a('0x3b')]!==_0x713a('0x3c')){var _0x369a68={};_0x369a68[_0x5c47bf[_0x713a('0x28')]]={'$like':'%'+_0x59435d[_0x713a('0x30')][_0x713a('0x3d')]+'%'};return _0x369a68;}})});}_0x4fa258=_['merge']({},_0x4fa258,_0x59435d[_0x713a('0x3e')]);var _0x2d0381={'where':_0x4fa258[_0x713a('0x39')]};return db[_0x713a('0x2b')][_0x713a('0x3f')](_0x2d0381)['then'](function(_0x29ee4b){_0x15b39b['count']=_0x29ee4b;if(_0x59435d[_0x713a('0x30')][_0x713a('0x40')]){_0x4fa258[_0x713a('0x41')]=[{'all':!![]}];}return db[_0x713a('0x2b')]['findAll'](_0x4fa258);})[_0x713a('0x25')](function(_0x5b4e67){_0x15b39b['rows']=_0x5b4e67;return _0x15b39b;})[_0x713a('0x25')](respondWithFilteredResult(_0x50a136,_0x4fa258))[_0x713a('0x42')](handleError(_0x50a136,null));};exports['show']=function(_0x5f35b0,_0x4851f7){var _0x569e5c={'raw':!![],'where':{'id':_0x5f35b0[_0x713a('0x43')]['id']}},_0x5bb7a1={};_0x5bb7a1['model']=_['keys'](db['Attachment'][_0x713a('0x2c')]);_0x5bb7a1[_0x713a('0x30')]=_[_0x713a('0x31')](_0x5f35b0['query']);_0x5bb7a1[_0x713a('0x32')]=_['intersection'](_0x5bb7a1[_0x713a('0x2f')],_0x5bb7a1['query']);_0x569e5c['attributes']=_['intersection'](_0x5bb7a1[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x5f35b0['query'][_0x713a('0x34')]));_0x569e5c[_0x713a('0x33')]=_0x569e5c['attributes'][_0x713a('0x35')]?_0x569e5c[_0x713a('0x33')]:_0x5bb7a1['model'];if(_0x5f35b0[_0x713a('0x30')][_0x713a('0x40')]){_0x569e5c[_0x713a('0x41')]=[{'all':!![]}];}_0x569e5c=_[_0x713a('0x44')]({},_0x569e5c,_0x5f35b0[_0x713a('0x3e')]);return db[_0x713a('0x2b')][_0x713a('0x45')](_0x569e5c)['then'](handleEntityNotFound(_0x4851f7,null))[_0x713a('0x25')](respondWithResult(_0x4851f7,null))[_0x713a('0x42')](handleError(_0x4851f7,null));};exports[_0x713a('0x46')]=function(_0x1c2817,_0x526063){var _0x1731dc={'where':{'id':_0x1c2817[_0x713a('0x43')]['id']}},_0x4c0cb6={};_0x4c0cb6['model']=_[_0x713a('0x31')](db['Attachment'][_0x713a('0x2c')]);_0x1731dc[_0x713a('0x33')]=_[_0x713a('0x47')](_0x4c0cb6[_0x713a('0x2f')],qs[_0x713a('0x34')](_0x1c2817['query'][_0x713a('0x34')]));_0x1731dc['attributes']=_0x1731dc[_0x713a('0x33')][_0x713a('0x35')]?_0x1731dc['attributes']:_0x4c0cb6[_0x713a('0x2f')];if(_0x1c2817[_0x713a('0x30')][_0x713a('0x40')]){_0x1731dc[_0x713a('0x41')]=[{'all':!![]}];}_0x1731dc=_[_0x713a('0x44')]({},_0x1731dc,_0x1c2817['options']);return db[_0x713a('0x2b')][_0x713a('0x45')](_0x1731dc)[_0x713a('0x25')](handleEntityNotFound(_0x526063,null))[_0x713a('0x25')](function(_0x1f5a1a){if(_0x1f5a1a){var _0x171b09=_0x1f5a1a['get']({'plain':!![]});_0x171b09=qs['omit'](_0x171b09,['id','createdAt',_0x713a('0x48')]);_0x1c2817['body']=_[_0x713a('0x49')](_0x1c2817[_0x713a('0x4a')],['id',_0x713a('0x4b'),_0x713a('0x48')]);return db[_0x713a('0x2b')][_0x713a('0x4c')](_['merge'](_0x171b09,_0x1c2817[_0x713a('0x4a')]),{'include':_0x1c2817[_0x713a('0x30')][_0x713a('0x40')]?[{'all':!![]}]:undefined});}})[_0x713a('0x25')](respondWithResult(_0x526063,0xc9))[_0x713a('0x42')](handleError(_0x526063,null));};exports['update']=function(_0x291ffe,_0x50af43){if(_0x291ffe[_0x713a('0x4a')]['id']){delete _0x291ffe[_0x713a('0x4a')]['id'];}return db[_0x713a('0x2b')][_0x713a('0x45')]({'where':{'id':_0x291ffe[_0x713a('0x43')]['id']}})[_0x713a('0x25')](handleEntityNotFound(_0x50af43,null))['then'](saveUpdates(_0x291ffe[_0x713a('0x4a')],null))[_0x713a('0x25')](respondWithResult(_0x50af43,null))[_0x713a('0x42')](handleError(_0x50af43,null));};exports[_0x713a('0x4d')]=function(_0x4898be,_0x2f2255){return db[_0x713a('0x2b')][_0x713a('0x45')]({'where':{'id':_0x4898be[_0x713a('0x43')]['id']}})[_0x713a('0x25')](handleEntityNotFound(_0x2f2255,null))[_0x713a('0x25')](removeEntity(_0x2f2255,null))['catch'](handleError(_0x2f2255,null));};exports['create']=function(_0x4847a2,_0x146a80,_0x2fa097){_0x4847a2[_0x713a('0x4a')][_0x713a('0x28')]=_0x4847a2[_0x713a('0x4e')][_0x713a('0x4f')];_0x4847a2[_0x713a('0x4a')][_0x713a('0x50')]=_0x4847a2[_0x713a('0x4e')][_0x713a('0x51')];_0x4847a2[_0x713a('0x4a')][_0x713a('0x3b')]=_0x4847a2[_0x713a('0x4e')]['mimetype'];return db[_0x713a('0x2b')][_0x713a('0x4c')](_0x4847a2[_0x713a('0x4a')])[_0x713a('0x25')](respondWithResult(_0x146a80,0xc9))[_0x713a('0x42')](handleError(_0x146a80,null));};exports[_0x713a('0x52')]=function(_0x1e19da,_0x6ab91e,_0x37a51b){return db[_0x713a('0x2b')][_0x713a('0x53')]({'where':{'id':_0x1e19da[_0x713a('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x6ab91e,null))[_0x713a('0x25')](function(_0x52842f){if(_0x52842f){var _0x44926a=_0x52842f[_0x713a('0x54')]!==null;var _0x58f767=path[_0x713a('0x55')](config['root'],_0x713a('0x56'));if(_0x44926a){_0x58f767=path['join'](_0x58f767,_0x713a('0x57'));}var _0x4b6ac6=path[_0x713a('0x55')](_0x58f767,_0x52842f[_0x713a('0x50')]);return _0x6ab91e[_0x713a('0x52')](_0x4b6ac6);}})[_0x713a('0x42')](handleError(_0x6ab91e,null));}; \ No newline at end of file +var _0x7899=['length','hasOwnProperty','nolimit','offset','order','sort','where','filters','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','clone','find','get','omit','createdAt','updatedAt','body','basename','file','create','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','set','apply','save','update','then','error','stack','name','send','index','map','Attachment','key','query','keys','intersection','model','attributes','fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7899,0x11a));var _0x9789=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x7899[_0x2b49bc];return _0x43cc65;};'use strict';var emlformat=require(_0x9789('0x0'));var rimraf=require(_0x9789('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9789('0x2'));var rp=require(_0x9789('0x3'));var moment=require(_0x9789('0x4'));var BPromise=require(_0x9789('0x5'));var Mustache=require(_0x9789('0x6'));var util=require(_0x9789('0x7'));var path=require(_0x9789('0x8'));var sox=require(_0x9789('0x9'));var csv=require(_0x9789('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9789('0xb'));var _=require(_0x9789('0xc'));var squel=require(_0x9789('0xd'));var crypto=require(_0x9789('0xe'));var jsforce=require(_0x9789('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9789('0xa'));var querystring=require(_0x9789('0x10'));var Papa=require(_0x9789('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9789('0x12'));var as=require(_0x9789('0x13'));var hardwareService=require(_0x9789('0x14'));var logger=require(_0x9789('0x15'))(_0x9789('0x16'));var utils=require('../../config/utils');var config=require(_0x9789('0x17'));var licenseUtil=require(_0x9789('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53ad89,_0x31699f){_0x31699f=_0x31699f||0xcc;return function(_0x4dfb9c){if(_0x4dfb9c){return _0x53ad89[_0x9789('0x19')](_0x31699f);}return _0x53ad89[_0x9789('0x1a')](_0x31699f)[_0x9789('0x1b')]();};}function respondWithResult(_0x233190,_0x2b8fff){_0x2b8fff=_0x2b8fff||0xc8;return function(_0x2be765){if(_0x2be765){return _0x233190[_0x9789('0x1a')](_0x2b8fff)['json'](_0x2be765);}};}function respondWithFilteredResult(_0x2f31fd,_0x3b5e50){return function(_0xd24e2e){if(_0xd24e2e){var _0x56ed6d=typeof _0x3b5e50['offset']==='undefined'&&typeof _0x3b5e50[_0x9789('0x1c')]===_0x9789('0x1d');var _0x1d1812=_0xd24e2e[_0x9789('0x1e')];var _0x49c822=_0x56ed6d?0x0:_0x3b5e50['offset'];var _0x57b96a=_0x56ed6d?_0xd24e2e[_0x9789('0x1e')]:_0x3b5e50['offset']+_0x3b5e50[_0x9789('0x1c')];var _0x16ce56;if(_0x57b96a>=_0x1d1812){_0x57b96a=_0x1d1812;_0x16ce56=0xc8;}else{_0x16ce56=0xce;}_0x2f31fd[_0x9789('0x1a')](_0x16ce56);return _0x2f31fd[_0x9789('0x1f')]('Content-Range',_0x49c822+'-'+_0x57b96a+'/'+_0x1d1812)['json'](_0xd24e2e);}return null;};}function patchUpdates(_0x3bde61){return function(_0x35c74c){try{jsonpatch[_0x9789('0x20')](_0x35c74c,_0x3bde61,!![]);}catch(_0x18dfa3){return BPromise['reject'](_0x18dfa3);}return _0x35c74c[_0x9789('0x21')]();};}function saveUpdates(_0x4a8e78,_0x18c39a){return function(_0x441ccb){if(_0x441ccb){return _0x441ccb[_0x9789('0x22')](_0x4a8e78)[_0x9789('0x23')](function(_0x121588){return _0x121588;});}return null;};}function removeEntity(_0x1990e0,_0x256ff4){return function(_0x183353){if(_0x183353){return _0x183353['destroy']()[_0x9789('0x23')](function(){_0x1990e0[_0x9789('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d030a,_0x20931d){return function(_0x54e19f){if(!_0x54e19f){_0x5d030a['sendStatus'](0x194);}return _0x54e19f;};}function handleError(_0x254180,_0xa217dc){_0xa217dc=_0xa217dc||0x1f4;return function(_0x174916){logger[_0x9789('0x24')](_0x174916[_0x9789('0x25')]);if(_0x174916[_0x9789('0x26')]){delete _0x174916[_0x9789('0x26')];}_0x254180[_0x9789('0x1a')](_0xa217dc)[_0x9789('0x27')](_0x174916);};}exports[_0x9789('0x28')]=function(_0x3bc7e8,_0x2fed92){var _0x188780={},_0x70d603={},_0x383b49={'count':0x0,'rows':[]};var _0x3735e8=_[_0x9789('0x29')](db[_0x9789('0x2a')]['rawAttributes'],function(_0x34d3b2){return{'name':_0x34d3b2['fieldName'],'type':_0x34d3b2['type'][_0x9789('0x2b')]};});_0x70d603['model']=_[_0x9789('0x29')](_0x3735e8,_0x9789('0x26'));_0x70d603[_0x9789('0x2c')]=_[_0x9789('0x2d')](_0x3bc7e8[_0x9789('0x2c')]);_0x70d603['filters']=_[_0x9789('0x2e')](_0x70d603[_0x9789('0x2f')],_0x70d603[_0x9789('0x2c')]);_0x188780[_0x9789('0x30')]=_[_0x9789('0x2e')](_0x70d603['model'],qs[_0x9789('0x31')](_0x3bc7e8[_0x9789('0x2c')]['fields']));_0x188780[_0x9789('0x30')]=_0x188780[_0x9789('0x30')][_0x9789('0x32')]?_0x188780[_0x9789('0x30')]:_0x70d603[_0x9789('0x2f')];if(!_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x33')](_0x9789('0x34'))){_0x188780[_0x9789('0x1c')]=qs[_0x9789('0x1c')](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x1c')]);_0x188780[_0x9789('0x35')]=qs['offset'](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x35')]);}_0x188780[_0x9789('0x36')]=qs['sort'](_0x3bc7e8[_0x9789('0x2c')][_0x9789('0x37')]);_0x188780[_0x9789('0x38')]=qs[_0x9789('0x39')](_['pick'](_0x3bc7e8[_0x9789('0x2c')],_0x70d603['filters']),_0x3735e8);if(_0x3bc7e8[_0x9789('0x2c')]['filter']){_0x188780[_0x9789('0x38')]=_['merge'](_0x188780[_0x9789('0x38')],{'$or':_[_0x9789('0x29')](_0x3735e8,function(_0x37f230){if(_0x37f230[_0x9789('0x3a')]!==_0x9789('0x3b')){var _0x292e02={};_0x292e02[_0x37f230[_0x9789('0x26')]]={'$like':'%'+_0x3bc7e8['query']['filter']+'%'};return _0x292e02;}})});}_0x188780=_[_0x9789('0x3c')]({},_0x188780,_0x3bc7e8['options']);var _0xaf277b={'where':_0x188780[_0x9789('0x38')]};return db[_0x9789('0x2a')]['count'](_0xaf277b)['then'](function(_0x4786e7){_0x383b49[_0x9789('0x1e')]=_0x4786e7;if(_0x3bc7e8['query'][_0x9789('0x3d')]){_0x188780[_0x9789('0x3e')]=[{'all':!![]}];}return db[_0x9789('0x2a')][_0x9789('0x3f')](_0x188780);})[_0x9789('0x23')](function(_0x45540d){_0x383b49[_0x9789('0x40')]=_0x45540d;return _0x383b49;})['then'](respondWithFilteredResult(_0x2fed92,_0x188780))[_0x9789('0x41')](handleError(_0x2fed92,null));};exports[_0x9789('0x42')]=function(_0x2d854e,_0x5ba6ae){var _0x545fd1={'raw':!![],'where':{'id':_0x2d854e[_0x9789('0x43')]['id']}},_0x8d17dc={};_0x8d17dc[_0x9789('0x2f')]=_[_0x9789('0x2d')](db[_0x9789('0x2a')][_0x9789('0x44')]);_0x8d17dc[_0x9789('0x2c')]=_['keys'](_0x2d854e['query']);_0x8d17dc[_0x9789('0x39')]=_[_0x9789('0x2e')](_0x8d17dc[_0x9789('0x2f')],_0x8d17dc[_0x9789('0x2c')]);_0x545fd1[_0x9789('0x30')]=_[_0x9789('0x2e')](_0x8d17dc[_0x9789('0x2f')],qs[_0x9789('0x31')](_0x2d854e[_0x9789('0x2c')][_0x9789('0x31')]));_0x545fd1[_0x9789('0x30')]=_0x545fd1[_0x9789('0x30')][_0x9789('0x32')]?_0x545fd1[_0x9789('0x30')]:_0x8d17dc[_0x9789('0x2f')];if(_0x2d854e[_0x9789('0x2c')][_0x9789('0x3d')]){_0x545fd1[_0x9789('0x3e')]=[{'all':!![]}];}_0x545fd1=_[_0x9789('0x3c')]({},_0x545fd1,_0x2d854e[_0x9789('0x45')]);return db[_0x9789('0x2a')]['find'](_0x545fd1)[_0x9789('0x23')](handleEntityNotFound(_0x5ba6ae,null))[_0x9789('0x23')](respondWithResult(_0x5ba6ae,null))[_0x9789('0x41')](handleError(_0x5ba6ae,null));};exports[_0x9789('0x46')]=function(_0x44c219,_0x38f40f){var _0x39b746={'where':{'id':_0x44c219[_0x9789('0x43')]['id']}},_0xce4c77={};_0xce4c77['model']=_[_0x9789('0x2d')](db['Attachment'][_0x9789('0x44')]);_0x39b746[_0x9789('0x30')]=_['intersection'](_0xce4c77[_0x9789('0x2f')],qs[_0x9789('0x31')](_0x44c219[_0x9789('0x2c')][_0x9789('0x31')]));_0x39b746[_0x9789('0x30')]=_0x39b746['attributes'][_0x9789('0x32')]?_0x39b746[_0x9789('0x30')]:_0xce4c77['model'];if(_0x44c219['query'][_0x9789('0x3d')]){_0x39b746[_0x9789('0x3e')]=[{'all':!![]}];}_0x39b746=_['merge']({},_0x39b746,_0x44c219[_0x9789('0x45')]);return db[_0x9789('0x2a')][_0x9789('0x47')](_0x39b746)[_0x9789('0x23')](handleEntityNotFound(_0x38f40f,null))[_0x9789('0x23')](function(_0x28fc2d){if(_0x28fc2d){var _0xdf39e2=_0x28fc2d[_0x9789('0x48')]({'plain':!![]});_0xdf39e2=qs[_0x9789('0x49')](_0xdf39e2,['id',_0x9789('0x4a'),_0x9789('0x4b')]);_0x44c219[_0x9789('0x4c')]=_[_0x9789('0x49')](_0x44c219[_0x9789('0x4c')],['id',_0x9789('0x4a'),'updatedAt']);return db[_0x9789('0x2a')]['create'](_[_0x9789('0x3c')](_0xdf39e2,_0x44c219[_0x9789('0x4c')]),{'include':_0x44c219[_0x9789('0x2c')][_0x9789('0x3d')]?[{'all':!![]}]:undefined});}})[_0x9789('0x23')](respondWithResult(_0x38f40f,0xc9))[_0x9789('0x41')](handleError(_0x38f40f,null));};exports[_0x9789('0x22')]=function(_0x5adc3d,_0xf3b5b5){if(_0x5adc3d[_0x9789('0x4c')]['id']){delete _0x5adc3d[_0x9789('0x4c')]['id'];}return db[_0x9789('0x2a')]['find']({'where':{'id':_0x5adc3d['params']['id']}})['then'](handleEntityNotFound(_0xf3b5b5,null))[_0x9789('0x23')](saveUpdates(_0x5adc3d[_0x9789('0x4c')],null))['then'](respondWithResult(_0xf3b5b5,null))['catch'](handleError(_0xf3b5b5,null));};exports['destroy']=function(_0x3f988f,_0x4aa6f7){return db['Attachment'][_0x9789('0x47')]({'where':{'id':_0x3f988f[_0x9789('0x43')]['id']}})['then'](handleEntityNotFound(_0x4aa6f7,null))[_0x9789('0x23')](removeEntity(_0x4aa6f7,null))[_0x9789('0x41')](handleError(_0x4aa6f7,null));};exports['create']=function(_0x165735,_0x457140,_0x219409){_0x165735[_0x9789('0x4c')][_0x9789('0x26')]=_0x165735['file']['originalname'];_0x165735[_0x9789('0x4c')][_0x9789('0x4d')]=_0x165735[_0x9789('0x4e')]['filename'];_0x165735['body']['type']=_0x165735[_0x9789('0x4e')]['mimetype'];return db[_0x9789('0x2a')][_0x9789('0x4f')](_0x165735[_0x9789('0x4c')])[_0x9789('0x23')](respondWithResult(_0x457140,0xc9))[_0x9789('0x41')](handleError(_0x457140,null));};exports['download']=function(_0x3889bb,_0x54cbea,_0x2183bb){return db['Attachment']['findOne']({'where':{'id':_0x3889bb['params']['id']},'raw':!![]})[_0x9789('0x23')](handleEntityNotFound(_0x54cbea,null))['then'](function(_0x47041b){if(_0x47041b){var _0x569d61=_0x47041b[_0x9789('0x50')]!==null;var _0x26339f=path[_0x9789('0x51')](config['root'],_0x9789('0x52'));if(_0x569d61){_0x26339f=path['join'](_0x26339f,'offline-chat/');}var _0x4c4247=path[_0x9789('0x51')](_0x26339f,_0x47041b[_0x9789('0x4d')]);return _0x54cbea['download'](_0x4c4247);}})['catch'](handleError(_0x54cbea,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3194f62..adf23c8 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 _0xf567=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xf567,0x1ab));var _0x7f56=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf567[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var logger=require(_0x7f56('0x2'))(_0x7f56('0x3'));var moment=require(_0x7f56('0x4'));var BPromise=require(_0x7f56('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f56('0x6'));var rimraf=require(_0x7f56('0x7'));var config=require(_0x7f56('0x8'));var attributes=require(_0x7f56('0x9'));module[_0x7f56('0xa')]=function(_0x17e2c3,_0x49b41a){return _0x17e2c3[_0x7f56('0xb')](_0x7f56('0xc'),attributes,{'tableName':_0x7f56('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xace5=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise','path','rimraf','./attachment.attributes'];(function(_0x2b702e,_0x267442){var _0x2eddf7=function(_0x2158be){while(--_0x2158be){_0x2b702e['push'](_0x2b702e['shift']());}};_0x2eddf7(++_0x267442);}(_0xace5,0xb8));var _0x5ace=function(_0x13c471,_0x50a390){_0x13c471=_0x13c471-0x0;var _0x33b8f1=_0xace5[_0x13c471];return _0x33b8f1;};'use strict';var _=require(_0x5ace('0x0'));var util=require(_0x5ace('0x1'));var logger=require(_0x5ace('0x2'))(_0x5ace('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ace('0x4'));var fs=require('fs');var path=require(_0x5ace('0x5'));var rimraf=require(_0x5ace('0x6'));var config=require('../../config/environment');var attributes=require(_0x5ace('0x7'));module[_0x5ace('0x8')]=function(_0xa557aa,_0x408677){return _0xa557aa[_0x5ace('0x9')](_0x5ace('0xa'),attributes,{'tableName':_0x5ace('0xb'),'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 a8ea856..55589f0 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 _0x5b02=['then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ae3a3,_0x1d4c57){var _0xf3058a=function(_0x46b3b8){while(--_0x46b3b8){_0x3ae3a3['push'](_0x3ae3a3['shift']());}};_0xf3058a(++_0x1d4c57);}(_0x5b02,0xe9));var _0x25b0=function(_0x18373d,_0x4674a2){_0x18373d=_0x18373d-0x0;var _0x315df6=_0x5b02[_0x18373d];return _0x315df6;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('Attachment,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('Attachment,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});}exports['CreateAttachment']=function(_0x1d850f){var _0x213a77=this;return new Promise(function(_0x20762e,_0x385334){return db[_0x25b0('0x16')][_0x25b0('0x17')](_0x1d850f['body'],{'raw':_0x1d850f[_0x25b0('0x18')]?_0x1d850f[_0x25b0('0x18')][_0x25b0('0x19')]===undefined?!![]:![]:!![]})[_0x25b0('0xa')](function(_0x1dc691){logger[_0x25b0('0xb')](_0x25b0('0x1a'),_0x1d850f);logger[_0x25b0('0xd')](_0x25b0('0x1a'),_0x1d850f,JSON[_0x25b0('0xf')](_0x1dc691));_0x20762e(_0x1dc691);})[_0x25b0('0x15')](function(_0x3ce1da){logger['error'](_0x25b0('0x1a'),_0x3ce1da[_0x25b0('0x13')],_0x1d850f);_0x385334(_0x213a77['error'](0x1f4,_0x3ce1da[_0x25b0('0x13')]));});});}; \ No newline at end of file +var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0xa44259,_0x153a71){var _0xbef6f0=function(_0x593a70){while(--_0x593a70){_0xa44259['push'](_0xa44259['shift']());}};_0xbef6f0(++_0x153a71);}(_0x07c3,0x1bf));var _0x307c=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x07c3[_0xa4c85];return _0x172c1f;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e44809a..066a840 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x15196a,_0x42cbaf){var _0x3d9ee6=function(_0x13b540){while(--_0x13b540){_0x15196a['push'](_0x15196a['shift']());}};_0x3d9ee6(++_0x42cbaf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x29551f,_0x589fd9){_0x29551f=_0x29551f-0x0;var _0x4c7b83=_0x5f2f[_0x29551f];return _0x4c7b83;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 100da41..47a49c7 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 _0x689b=['domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','disabled','blockedAt','online','admin','user','name','blocked','add','minutes','clearBlockUser','getLicense','status','send','message','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','use','ad-login','User','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x689b,0x85));var _0xb689=function(_0x4a11c2,_0x292670){_0x4a11c2=_0x4a11c2-0x0;var _0x2d94e7=_0x689b[_0x4a11c2];return _0x2d94e7;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xb689('0x0'))[_0xb689('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xb689('0x2'));var util=require(_0xb689('0x3'));var db=require(_0xb689('0x4'))['db'];var authService=require(_0xb689('0x5'));var utils=require(_0xb689('0x6'));var config=require(_0xb689('0x7'));var logger=require(_0xb689('0x8'))(_0xb689('0x9'));function isActiveDirectoryConfigured(_0x92d93b){var _0x35cd17=![];if(typeof _0x92d93b[_0xb689('0xa')]!==_0xb689('0xb')){_0x35cd17=_0x92d93b[_0xb689('0xa')][_0xb689('0xc')]&&_0x92d93b[_0xb689('0xa')][_0xb689('0xd')]&&_0x92d93b[_0xb689('0xa')][_0xb689('0xe')];}return _0x35cd17;}function adAuthenticate(_0x540d0a,_0x28bf5a,_0x8c1455){return new BPromise(function(_0x329dbd,_0x32b34a){try{var _0x485f70=new ActiveDirectory(_0x540d0a);_0x485f70['authenticate'](_0x28bf5a,_0x8c1455,function(_0x3c213c,_0x2820b1){if(_0x3c213c){logger[_0xb689('0xf')](_0xb689('0x10'),_0x28bf5a,util[_0xb689('0x11')](_0x3c213c,{'showHidden':![],'depth':null}));_0x32b34a(_0xb689('0x12'));}else if(!_0x2820b1){logger[_0xb689('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x28bf5a);_0x32b34a(_0xb689('0x12'));}else{_0x329dbd(_0x2820b1);}});}catch(_0x225fa4){_0x32b34a(_0x225fa4);}});}function ActiveDirectoryAuthenticate(_0xf7e61b,_0x2352c3,_0x1dad8d,_0x2d49d4){var _0x499c46,_0x347112;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xb689('0x13'),_0x2352c3);return _0x2d49d4(null,![],{'message':_0xb689('0x12')});}return db['Setting'][_0xb689('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xb689('0x15')],'raw':!![]})[_0xb689('0x16')](function(_0x192276){_0x499c46=_0x192276;if(!_0x499c46[_0xb689('0x17')]){logger[_0xb689('0xf')](_0xb689('0x18'),_0x2352c3);throw new Error(_0xb689('0x12'));}return _0xf7e61b['findOne']({'attributes':['id','name',_0xb689('0x19'),_0xb689('0x1a'),'role',_0xb689('0x1b'),'blocked',_0xb689('0x1c'),_0xb689('0x1d')],'where':{'name':_0x2352c3,'role':{'$or':[_0xb689('0x1e'),_0xb689('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xb689('0x16')](function(_0x1e94aa){if(!_0x1e94aa||_0x1e94aa&&_0x1e94aa[_0xb689('0x20')]!==_0x2352c3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x347112=_0x1e94aa;var _0x4e52d3=_0x347112[_0xb689('0x20')]+'@'+config[_0xb689('0xa')][_0xb689('0xe')];return adAuthenticate(config['activedirectory'],_0x4e52d3,_0x1dad8d);})[_0xb689('0x16')](function(_0x1edcf3){if(_0x347112[_0xb689('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x499c46[_0xb689('0x15')]>0x0){if(_0x347112[_0xb689('0x21')]){if(moment(_0x347112[_0xb689('0x1c')])[_0xb689('0x22')](_0x499c46[_0xb689('0x15')],_0xb689('0x23'))>moment()){throw new Error(_0xb689('0x12'));}return utils[_0xb689('0x24')](_0x347112,0x0,![],null)[_0xb689('0x16')](function(){return utils[_0xb689('0x25')](_0x347112);})[_0xb689('0x16')](function(){return _0x2d49d4(null,_0x347112);});}else{return utils[_0xb689('0x25')](_0x347112)['then'](function(){return _0x2d49d4(null,_0x347112);});}}else{return utils['getLicense'](_0x347112)['then'](function(){return _0x2d49d4(null,_0x347112);});}})['catch'](function(_0x4ac21c){return _0x2d49d4(null,![],_0x4ac21c);});}function handleError(_0x33df38,_0x4b7ffa,_0x4cda0e){return _0x33df38[_0xb689('0x26')](_0x4b7ffa||0x1f4)[_0xb689('0x27')]({'message':_0x4cda0e?_0x4cda0e[_0xb689('0x28')]||_0x4cda0e:''});}exports[_0xb689('0x29')]=function(_0x5b27e0,_0x2f4679,_0x160fa9){passport[_0xb689('0x2a')]('ad-login',function(_0x557c2d,_0x56b12a,_0x32b4ce){var _0x1e4912=_0x557c2d||_0x32b4ce;if(_0x1e4912){return handleError(_0x2f4679,0x191,_0x1e4912);}if(!_0x56b12a){return handleError(_0x2f4679,0x194,{'message':_0xb689('0x2b')});}else{var _0x1a49ee={'payload':{'id':_0x56b12a['id'],'role':_0x56b12a[_0xb689('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0xb689('0x2d')](_0x1a49ee)[_0xb689('0x16')](function(_0x10756d){_0x2f4679['json']({'id':_0x56b12a['id'],'token':_0x10756d,'statusCall':'','isAlreadyLogged':_0x56b12a[_0xb689('0x1d')]});});}})(_0x5b27e0,_0x2f4679,_0x160fa9);};passport[_0xb689('0x2e')](_0xb689('0x2f'),new LocalStrategy({'usernameField':_0xb689('0x20'),'passwordField':'password'},function(_0x36eec0,_0x553e97,_0x3e4b93){return ActiveDirectoryAuthenticate(db[_0xb689('0x30')],_0x36eec0,_0x553e97,_0x3e4b93);})); \ No newline at end of file +var _0x427e=['authenticate','ad-login','role','json','use','User','passport','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','domain','error','inspect','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','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blocked','blockedAt','online','admin','user','agent','disabled','add','clearBlockUser','getLicense','catch','status','send','message','login'];(function(_0x1d7ef5,_0x38cb8a){var _0xd108dd=function(_0x40242c){while(--_0x40242c){_0x1d7ef5['push'](_0x1d7ef5['shift']());}};_0xd108dd(++_0x38cb8a);}(_0x427e,0x11a));var _0xe427=function(_0xcc68e1,_0x246c14){_0xcc68e1=_0xcc68e1-0x0;var _0x40a451=_0x427e[_0xcc68e1];return _0x40a451;};'use strict';var passport=require(_0xe427('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xe427('0x1'));var BPromise=require('bluebird');var util=require(_0xe427('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xe427('0x3'));var utils=require(_0xe427('0x4'));var config=require('../../config/environment');var logger=require(_0xe427('0x5'))(_0xe427('0x6'));function isActiveDirectoryConfigured(_0x34498b){var _0x4567f1=![];if(typeof _0x34498b[_0xe427('0x7')]!==_0xe427('0x8')){_0x4567f1=_0x34498b[_0xe427('0x7')][_0xe427('0x9')]&&_0x34498b['activedirectory']['url']&&_0x34498b[_0xe427('0x7')][_0xe427('0xa')];}return _0x4567f1;}function adAuthenticate(_0x381c7f,_0x25a1bc,_0x3b3f9d){return new BPromise(function(_0x2aecd7,_0x159375){try{var _0x308179=new ActiveDirectory(_0x381c7f);_0x308179['authenticate'](_0x25a1bc,_0x3b3f9d,function(_0x49d014,_0x1777b5){if(_0x49d014){logger[_0xe427('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x25a1bc,util[_0xe427('0xc')](_0x49d014,{'showHidden':![],'depth':null}));_0x159375(_0xe427('0xd'));}else if(!_0x1777b5){logger[_0xe427('0xb')](_0xe427('0xe'),_0x25a1bc);_0x159375(_0xe427('0xd'));}else{_0x2aecd7(_0x1777b5);}});}catch(_0x9608c5){_0x159375(_0x9608c5);}});}function ActiveDirectoryAuthenticate(_0x17d319,_0x2fac68,_0x22c29b,_0x4bb104){var _0x4b7347,_0x307498;if(!isActiveDirectoryConfigured(config)){logger[_0xe427('0xb')](_0xe427('0xf'),_0x2fac68);return _0x4bb104(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe427('0x10')][_0xe427('0x11')]({'where':{'id':0x1},'attributes':[_0xe427('0x12'),_0xe427('0x13')],'raw':!![]})[_0xe427('0x14')](function(_0x537730){_0x4b7347=_0x537730;if(!_0x4b7347[_0xe427('0x12')]){logger[_0xe427('0xb')](_0xe427('0x15'),_0x2fac68);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x17d319[_0xe427('0x11')]({'attributes':['id',_0xe427('0x16'),_0xe427('0x17'),_0xe427('0x18'),'role','disabled',_0xe427('0x19'),_0xe427('0x1a'),_0xe427('0x1b')],'where':{'name':_0x2fac68,'role':{'$or':[_0xe427('0x1c'),_0xe427('0x1d'),_0xe427('0x1e')]},'adSsoEnabled':!![]}});})[_0xe427('0x14')](function(_0x3e39b5){if(!_0x3e39b5||_0x3e39b5&&_0x3e39b5[_0xe427('0x16')]!==_0x2fac68){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x307498=_0x3e39b5;var _0x14e8c8=_0x307498[_0xe427('0x16')]+'@'+config[_0xe427('0x7')][_0xe427('0xa')];return adAuthenticate(config[_0xe427('0x7')],_0x14e8c8,_0x22c29b);})[_0xe427('0x14')](function(_0x4f07dd){if(_0x307498[_0xe427('0x1f')]){throw new Error(_0xe427('0xd'));}if(_0x4b7347['blockDuration']>0x0){if(_0x307498[_0xe427('0x19')]){if(moment(_0x307498[_0xe427('0x1a')])[_0xe427('0x20')](_0x4b7347[_0xe427('0x13')],'minutes')>moment()){throw new Error(_0xe427('0xd'));}return utils[_0xe427('0x21')](_0x307498,0x0,![],null)[_0xe427('0x14')](function(){return utils[_0xe427('0x22')](_0x307498);})[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}else{return utils[_0xe427('0x22')](_0x307498)[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}}else{return utils['getLicense'](_0x307498)[_0xe427('0x14')](function(){return _0x4bb104(null,_0x307498);});}})[_0xe427('0x23')](function(_0x2bc7f3){return _0x4bb104(null,![],_0x2bc7f3);});}function handleError(_0x582a35,_0x3e49c0,_0x5ef4cf){return _0x582a35[_0xe427('0x24')](_0x3e49c0||0x1f4)[_0xe427('0x25')]({'message':_0x5ef4cf?_0x5ef4cf[_0xe427('0x26')]||_0x5ef4cf:''});}exports[_0xe427('0x27')]=function(_0x4db304,_0x1ffdb2,_0x4f944d){passport[_0xe427('0x28')](_0xe427('0x29'),function(_0x12a0dd,_0x48e476,_0x575f84){var _0x57f41c=_0x12a0dd||_0x575f84;if(_0x57f41c){return handleError(_0x1ffdb2,0x191,_0x57f41c);}if(!_0x48e476){return handleError(_0x1ffdb2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xad160a={'payload':{'id':_0x48e476['id'],'role':_0x48e476[_0xe427('0x2a')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xad160a)[_0xe427('0x14')](function(_0x4f2dbe){_0x1ffdb2[_0xe427('0x2b')]({'id':_0x48e476['id'],'token':_0x4f2dbe,'statusCall':'','isAlreadyLogged':_0x48e476['online']});});}})(_0x4db304,_0x1ffdb2,_0x4f944d);};passport[_0xe427('0x2c')]('ad-login',new LocalStrategy({'usernameField':_0xe427('0x16'),'passwordField':'password'},function(_0x2a1507,_0x427e58,_0x42b6af){return ActiveDirectoryAuthenticate(db[_0xe427('0x2d')],_0x2a1507,_0x427e58,_0x42b6af);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 7a4dcef..3290cac 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 _0x38e9=['express','./authActiveDirectory.controller','exports'];(function(_0x2bf451,_0x293261){var _0x327a73=function(_0x594345){while(--_0x594345){_0x2bf451['push'](_0x2bf451['shift']());}};_0x327a73(++_0x293261);}(_0x38e9,0x1dd));var _0x938e=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x38e9[_0x3dfea6];return _0x567aca;};'use strict';var express=require(_0x938e('0x0'));var router=express['Router']();var controller=require(_0x938e('0x1'));router['post']('/',controller['login']);module[_0x938e('0x2')]=router; \ No newline at end of file +var _0xca88=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xca88,0xe0));var _0x8ca8=function(_0x429fd5,_0x21156c){_0x429fd5=_0x429fd5-0x0;var _0x125acf=_0xca88[_0x429fd5];return _0x125acf;};'use strict';var express=require(_0x8ca8('0x0'));var router=express[_0x8ca8('0x1')]();var controller=require(_0x8ca8('0x2'));router[_0x8ca8('0x3')]('/',controller['login']);module[_0x8ca8('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e1b8297..386f687 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3aace3,_0x257273){var _0x572543=function(_0xe93782){while(--_0xe93782){_0x3aace3['push'](_0x3aace3['shift']());}};_0x572543(++_0x257273);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3f3d54,_0x1e03ef){var _0x2e1d4a=function(_0x46fd35){while(--_0x46fd35){_0x3f3d54['push'](_0x3f3d54['shift']());}};_0x2e1d4a(++_0x1e03ef);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 83d260a..4f9a335 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 _0xbb8f=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller'];(function(_0x4aa2c1,_0x2a1da8){var _0x477fa0=function(_0x2e9b94){while(--_0x2e9b94){_0x4aa2c1['push'](_0x4aa2c1['shift']());}};_0x477fa0(++_0x2a1da8);}(_0xbb8f,0x99));var _0xfbb8=function(_0x4635cc,_0x4f7e6){_0x4635cc=_0x4635cc-0x0;var _0x5a255c=_0xbb8f[_0x4635cc];return _0x5a255c;};'use strict';var express=require(_0xfbb8('0x0'));var passport=require('passport');var router=express[_0xfbb8('0x1')]();var controller=require(_0xfbb8('0x2'));var userController=require(_0xfbb8('0x3'));var authService=require(_0xfbb8('0x4'));router[_0xfbb8('0x5')]('/',controller[_0xfbb8('0x6')]);router[_0xfbb8('0x5')](_0xfbb8('0x7'),controller[_0xfbb8('0x8')],authService[_0xfbb8('0x9')],userController[_0xfbb8('0x6')],authService[_0xfbb8('0xa')]);module[_0xfbb8('0xb')]=router; \ No newline at end of file +var _0x01db=['get','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js','login'];(function(_0x3d5f38,_0x4efe53){var _0x5bde8b=function(_0xff28f1){while(--_0xff28f1){_0x3d5f38['push'](_0x3d5f38['shift']());}};_0x5bde8b(++_0x4efe53);}(_0x01db,0x9e));var _0xb01d=function(_0x3fdc90,_0x266b97){_0x3fdc90=_0x3fdc90-0x0;var _0x5bf230=_0x01db[_0x3fdc90];return _0x5bf230;};'use strict';var express=require(_0xb01d('0x0'));var passport=require(_0xb01d('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb01d('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller[_0xb01d('0x3')]);router[_0xb01d('0x4')](_0xb01d('0x5'),controller[_0xb01d('0x6')],authService['isMiddleware'],userController[_0xb01d('0x3')],authService[_0xb01d('0x7')]);module[_0xb01d('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 5568d94..b57ae0c 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 _0x1eb9=['forgot','body','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','role','json','online'];(function(_0x127fb7,_0x47c4b8){var _0x49252a=function(_0x176220){while(--_0x176220){_0x127fb7['push'](_0x127fb7['shift']());}};_0x49252a(++_0x47c4b8);}(_0x1eb9,0xc7));var _0x91eb=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x1eb9[_0x47643e];return _0x2aa5db;};'use strict';var util=require(_0x91eb('0x0'));var passport=require(_0x91eb('0x1'));var LocalStrategy=require(_0x91eb('0x2'))[_0x91eb('0x3')];var jayson=require(_0x91eb('0x4'));var _=require(_0x91eb('0x5'));var rs=require(_0x91eb('0x6'));var moment=require('moment');var db=require(_0x91eb('0x7'))['db'];var authService=require(_0x91eb('0x8'));var utils=require(_0x91eb('0x9'));var client=jayson[_0x91eb('0xa')][_0x91eb('0xb')]({'port':0x232b});function localAuthenticate(_0x1d7fa,_0x3430a4,_0xe09132,_0x5a79e6){var _0x214ea3,_0x22e087;return db[_0x91eb('0xc')][_0x91eb('0xd')]({'where':{'id':0x1},'attributes':[_0x91eb('0xe'),_0x91eb('0xf')],'raw':!![]})['then'](function(_0x1ad114){_0x214ea3=_0x1ad114;return _0x1d7fa['findOne']({'attributes':['id',_0x91eb('0x10'),'password',_0x91eb('0x11'),'role',_0x91eb('0x12'),_0x91eb('0x13'),'blockedAt',_0x91eb('0x14')],'where':{'name':_0x3430a4,'role':{'$or':[_0x91eb('0x15'),_0x91eb('0x16'),'agent']}}});})['then'](function(_0x5d053e){if(!_0x5d053e||_0x5d053e&&_0x5d053e[_0x91eb('0x10')]!==_0x3430a4){throw new Error(_0x91eb('0x17'));}else{_0x22e087=_0x5d053e;return _0x22e087;}})[_0x91eb('0x18')](function(){_0x22e087[_0x91eb('0x19')](_0xe09132,function(_0x4cac57,_0x4afc06){var _0x4a9f57=_0x22e087[_0x91eb('0x14')]+0x1;if(_0x4cac57){return _0x5a79e6(_0x4cac57);}else if(!_0x4afc06){if(_0x22e087[_0x91eb('0x12')]){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else if(_0x214ea3[_0x91eb('0xe')]>0x0){if(_0x22e087[_0x91eb('0x13')]){if(_0x214ea3[_0x91eb('0xf')]>0x0){if(moment(_0x22e087[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x214ea3[_0x91eb('0xf')],_0x91eb('0x1c'))>moment()){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else{return utils[_0x91eb('0x1d')](_0x22e087,_0x4a9f57,![],null)['then'](function(){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});});}}else{return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}}else{if(_0x4a9f57>=_0x214ea3['allowedLoginAttempts']){return utils[_0x91eb('0x1d')](_0x22e087,0x0,!![],moment())['then'](function(){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});});}else{return utils[_0x91eb('0x1d')](_0x22e087,_0x4a9f57,![],null)[_0x91eb('0x18')](function(){return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}}else{if(_0x22e087[_0x91eb('0x12')]){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else if(_0x214ea3[_0x91eb('0xe')]>0x0){if(_0x22e087[_0x91eb('0x13')]){if(_0x214ea3[_0x91eb('0xf')]>0x0){if(moment(_0x22e087[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x214ea3[_0x91eb('0xf')],_0x91eb('0x1c'))>moment()){return _0x5a79e6(null,![],{'message':_0x91eb('0x17')});}else{return utils[_0x91eb('0x1d')](_0x22e087,0x0,![],null)['then'](function(){return utils[_0x91eb('0x1e')](_0x22e087);})[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);});}}else{return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x91eb('0x1d')](_0x22e087,0x0,![],null)[_0x91eb('0x18')](function(){return utils[_0x91eb('0x1e')](_0x22e087);})[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);})[_0x91eb('0x1f')](function(_0x26196a){return _0x5a79e6(null,![],_0x26196a);});}}else{if(_0x22e087[_0x91eb('0x13')]){return _0x5a79e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x91eb('0x1e')](_0x22e087)[_0x91eb('0x18')](function(){return _0x5a79e6(null,_0x22e087);});}}}});})[_0x91eb('0x1f')](function(_0x26ee4a){return _0x5a79e6(null,![],_0x26ee4a);});}function sendServiceMail(_0x5f106a){return db[_0x91eb('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x91eb('0x10'),_0x91eb('0x21')],'include':[{'model':db[_0x91eb('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x91eb('0x23')}]}]})[_0x91eb('0x18')](function(_0x123438){if(!_0x123438){throw new Error(_0x91eb('0x24'));}var _0x4d34ad=_0x123438[_0x91eb('0x25')]();var _0x189c8a={'account':_0x4d34ad,'message':_[_0x91eb('0x26')]({'from':util[_0x91eb('0x27')](_0x91eb('0x28'),_0x123438[_0x91eb('0x10')],_0x123438['email']||_0x123438[_0x91eb('0x29')][_0x91eb('0x16')])},_0x5f106a)};return client[_0x91eb('0x2a')](_0x91eb('0x2b'),_0x189c8a);})[_0x91eb('0x18')](function(_0x1e5f8e){if(_0x1e5f8e[_0x91eb('0x2c')]){throw new Error(util[_0x91eb('0x27')](_0x91eb('0x2d'),_0x1e5f8e['error'][_0x91eb('0x2e')]||JSON['stringify'](_0x1e5f8e[_0x91eb('0x2c')])));}return!![];});}function handleError(_0x63deab,_0x316f49,_0x1d9fa2){return _0x63deab[_0x91eb('0x2f')](_0x316f49||0x1f4)['send']({'message':_0x1d9fa2?_0x1d9fa2[_0x91eb('0x2e')]||_0x1d9fa2:''});}exports[_0x91eb('0x30')]=function(_0x25076e,_0x2be86b,_0x499fca){passport[_0x91eb('0x19')](_0x91eb('0x31'),function(_0xb1090e,_0x500ef6,_0x1922a7){var _0x21199e=_0xb1090e||_0x1922a7;if(_0x21199e){return handleError(_0x2be86b,0x191,_0x21199e);}if(!_0x500ef6){return handleError(_0x2be86b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x59d792={'payload':{'id':_0x500ef6['id'],'role':_0x500ef6[_0x91eb('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59d792)[_0x91eb('0x18')](function(_0x24a3bf){_0x2be86b[_0x91eb('0x33')]({'id':_0x500ef6['id'],'token':_0x24a3bf,'statusCall':'','isAlreadyLogged':_0x500ef6[_0x91eb('0x34')]});});}})(_0x25076e,_0x2be86b,_0x499fca);};exports[_0x91eb('0x35')]=function(_0xfd7c67,_0x223207){if(!_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]){return handleError(_0x223207,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2fa333=rs[_0x91eb('0x37')]();_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]=_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')][_0x91eb('0x38')]()[_0x91eb('0x39')]();var _0x38fab3;return db[_0x91eb('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x91eb('0xe'),_0x91eb('0xf')],'raw':!![]})[_0x91eb('0x18')](function(_0x3ed368){_0x38fab3=_0x3ed368;return db[_0x91eb('0x3a')][_0x91eb('0x3b')]({'where':{'email':_0xfd7c67[_0x91eb('0x36')][_0x91eb('0x21')]}});})[_0x91eb('0x18')](function(_0x56a620){if(!_0x56a620){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56a620[_0x91eb('0x12')]){throw new Error(_0x91eb('0x3c'));}if(_0x56a620[_0x91eb('0x13')]){if(moment(_0x56a620[_0x91eb('0x1a')])[_0x91eb('0x1b')](_0x38fab3[_0x91eb('0xf')],'minutes')>moment()){throw new Error(_0x91eb('0x3d'));}else{_0x56a620[_0x91eb('0x13')]=![];_0x56a620['blockedAt']=null;}}_0x56a620[_0x91eb('0x3e')]=_0x2fa333;_0x56a620[_0x91eb('0x3f')]=Date[_0x91eb('0x40')]()+0x36ee80;return _0x56a620[_0x91eb('0x41')]();})[_0x91eb('0x18')](function(){return sendServiceMail({'to':_0xfd7c67['body']['email'],'subject':_0x91eb('0x42'),'text':_0x91eb('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0xfd7c67[_0x91eb('0x44')][_0x91eb('0x45')]+'/reset/'+_0x2fa333+'\x0a\x0a'+_0x91eb('0x46')});})['then'](function(){_0x223207['status'](0xc8)[_0x91eb('0x47')]({'message':_0x91eb('0x48')});})['catch'](function(_0x24f5fb){return handleError(_0x223207,0x1f4,_0x24f5fb);});};exports[_0x91eb('0x49')]=function(_0x50f62d,_0x117d82){return db[_0x91eb('0x3a')][_0x91eb('0x3b')]({'where':{'resetPasswordToken':_0x50f62d[_0x91eb('0x4a')][_0x91eb('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x484a2a){if(!_0x484a2a){throw new Error(_0x91eb('0x4c'));}return db[_0x91eb('0xc')][_0x91eb('0xd')]({'attributes':['id',_0x91eb('0x4d'),_0x91eb('0x4e'),_0x91eb('0x4f')]})['then'](function(_0x21e1c9){if(_0x21e1c9[_0x91eb('0x4d')])authService[_0x91eb('0x50')](_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')]);if(!_0x21e1c9[_0x91eb('0x4e')]||!_0x484a2a[_0x91eb('0x52')])return _0x484a2a;authService['validatePasswordHistory'](_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')],_0x484a2a[_0x91eb('0x52')],_0x21e1c9[_0x91eb('0x4f')]);return _0x484a2a;})[_0x91eb('0x18')](function(){_0x484a2a['password']=_0x50f62d[_0x91eb('0x36')][_0x91eb('0x51')];_0x484a2a[_0x91eb('0x3e')]=null;_0x484a2a[_0x91eb('0x3f')]=null;return _0x484a2a[_0x91eb('0x41')]();});})[_0x91eb('0x18')](function(){_0x117d82[_0x91eb('0x2f')](0xc8)[_0x91eb('0x47')]({'message':_0x91eb('0x53')});})[_0x91eb('0x1f')](function(_0x27b941){return handleError(_0x117d82,0x1f4,_0x27b941);});};passport['use'](_0x91eb('0x31'),new LocalStrategy({'usernameField':_0x91eb('0x10'),'passwordField':_0x91eb('0x51')},function(_0x146d9e,_0x395810,_0x437540){return localAuthenticate(db['User'],_0x146d9e,_0x395810,_0x437540);})); \ No newline at end of file +var _0x4602=['host','/reset/','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','jayson/promise','lodash','randomstring','moment','../../config/utils','http','Setting','blockDuration','findOne','name','password','salt','disabled','blockedAt','loginAttempts','user','agent','then','authenticate','allowedLoginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','add','minutes','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers'];(function(_0x56da57,_0x234ac0){var _0x825fab=function(_0x24cfc8){while(--_0x24cfc8){_0x56da57['push'](_0x56da57['shift']());}};_0x825fab(++_0x234ac0);}(_0x4602,0x14b));var _0x2460=function(_0x9780e1,_0x23d9da){_0x9780e1=_0x9780e1-0x0;var _0x3183ca=_0x4602[_0x9780e1];return _0x3183ca;};'use strict';var util=require(_0x2460('0x0'));var passport=require(_0x2460('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x2460('0x2'));var _=require(_0x2460('0x3'));var rs=require(_0x2460('0x4'));var moment=require(_0x2460('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x2460('0x6'));var client=jayson['client'][_0x2460('0x7')]({'port':0x232b});function localAuthenticate(_0x1e9242,_0xb43454,_0x3065b8,_0x1cf89b){var _0x10844e,_0x484ae6;return db[_0x2460('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2460('0x9')],'raw':!![]})['then'](function(_0x5719c5){_0x10844e=_0x5719c5;return _0x1e9242[_0x2460('0xa')]({'attributes':['id',_0x2460('0xb'),_0x2460('0xc'),_0x2460('0xd'),'role',_0x2460('0xe'),'blocked',_0x2460('0xf'),_0x2460('0x10')],'where':{'name':_0xb43454,'role':{'$or':['admin',_0x2460('0x11'),_0x2460('0x12')]}}});})[_0x2460('0x13')](function(_0x534050){if(!_0x534050||_0x534050&&_0x534050[_0x2460('0xb')]!==_0xb43454){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x484ae6=_0x534050;return _0x484ae6;}})['then'](function(){_0x484ae6[_0x2460('0x14')](_0x3065b8,function(_0x13a619,_0x9d0ee2){var _0x25832b=_0x484ae6[_0x2460('0x10')]+0x1;if(_0x13a619){return _0x1cf89b(_0x13a619);}else if(!_0x9d0ee2){if(_0x484ae6['disabled']){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x10844e[_0x2460('0x15')]>0x0){if(_0x484ae6['blocked']){if(_0x10844e[_0x2460('0x9')]>0x0){if(moment(_0x484ae6[_0x2460('0xf')])['add'](_0x10844e['blockDuration'],'minutes')>moment()){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['clearBlockUser'](_0x484ae6,_0x25832b,![],null)['then'](function(){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{if(_0x25832b>=_0x10844e['allowedLoginAttempts']){return utils['clearBlockUser'](_0x484ae6,0x0,!![],moment())[_0x2460('0x13')](function(){return _0x1cf89b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x2460('0x17')](_0x484ae6,_0x25832b,![],null)['then'](function(){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});});}}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{if(_0x484ae6['disabled']){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else if(_0x10844e[_0x2460('0x15')]>0x0){if(_0x484ae6[_0x2460('0x18')]){if(_0x10844e[_0x2460('0x9')]>0x0){if(moment(_0x484ae6[_0x2460('0xf')])[_0x2460('0x19')](_0x10844e[_0x2460('0x9')],_0x2460('0x1a'))>moment()){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['clearBlockUser'](_0x484ae6,0x0,![],null)[_0x2460('0x13')](function(){return utils[_0x2460('0x1b')](_0x484ae6);})[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);});}}else{return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}}else{return utils[_0x2460('0x17')](_0x484ae6,0x0,![],null)['then'](function(){return utils[_0x2460('0x1b')](_0x484ae6);})[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);})[_0x2460('0x1c')](function(_0xe977b){return _0x1cf89b(null,![],_0xe977b);});}}else{if(_0x484ae6[_0x2460('0x18')]){return _0x1cf89b(null,![],{'message':_0x2460('0x16')});}else{return utils['getLicense'](_0x484ae6)[_0x2460('0x13')](function(){return _0x1cf89b(null,_0x484ae6);});}}}});})[_0x2460('0x1c')](function(_0x3baabc){return _0x1cf89b(null,![],_0x3baabc);});}function sendServiceMail(_0x5f0dc3){return db[_0x2460('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x2460('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x2460('0x1f'),'include':[{'model':db[_0x2460('0x20')],'as':_0x2460('0x20')}]}]})[_0x2460('0x13')](function(_0x389eca){if(!_0x389eca){throw new Error(_0x2460('0x21'));}var _0x542d06=_0x389eca[_0x2460('0x22')]();var _0x2a2953={'account':_0x542d06,'message':_['merge']({'from':util[_0x2460('0x23')]('\x22%s\x22\x20<%s>',_0x389eca['name'],_0x389eca[_0x2460('0x1e')]||_0x389eca[_0x2460('0x1f')]['user'])},_0x5f0dc3)};return client['request']('SendMail',_0x2a2953);})['then'](function(_0x5aa88c){if(_0x5aa88c[_0x2460('0x24')]){throw new Error(util[_0x2460('0x23')](_0x2460('0x25'),_0x5aa88c[_0x2460('0x24')][_0x2460('0x26')]||JSON[_0x2460('0x27')](_0x5aa88c['error'])));}return!![];});}function handleError(_0x5bc79c,_0x5d04a3,_0x65a381){return _0x5bc79c[_0x2460('0x28')](_0x5d04a3||0x1f4)[_0x2460('0x29')]({'message':_0x65a381?_0x65a381[_0x2460('0x26')]||_0x65a381:''});}exports[_0x2460('0x2a')]=function(_0x294450,_0x2f4744,_0x27b1a5){passport[_0x2460('0x14')]('local-login',function(_0x302bdc,_0x471de6,_0x1fb4d3){var _0x437d4a=_0x302bdc||_0x1fb4d3;if(_0x437d4a){return handleError(_0x2f4744,0x191,_0x437d4a);}if(!_0x471de6){return handleError(_0x2f4744,0x194,{'message':_0x2460('0x2b')});}else{var _0x5960ca={'payload':{'id':_0x471de6['id'],'role':_0x471de6['role']},'options':{'expiresIn':0x15180}};return authService[_0x2460('0x2c')](_0x5960ca)[_0x2460('0x13')](function(_0x4d32c0){_0x2f4744[_0x2460('0x2d')]({'id':_0x471de6['id'],'token':_0x4d32c0,'statusCall':'','isAlreadyLogged':_0x471de6['online']});});}})(_0x294450,_0x2f4744,_0x27b1a5);};exports[_0x2460('0x2e')]=function(_0x4aadc9,_0x2b8727){if(!_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]){return handleError(_0x2b8727,0x1f4,{'message':_0x2460('0x30')});}var _0x5e10fc=rs[_0x2460('0x31')]();_0x4aadc9[_0x2460('0x2f')]['email']=_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]['trim']()[_0x2460('0x32')]();var _0x5072d1;return db[_0x2460('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x2460('0x15'),_0x2460('0x9')],'raw':!![]})[_0x2460('0x13')](function(_0xbb7903){_0x5072d1=_0xbb7903;return db[_0x2460('0x33')][_0x2460('0x34')]({'where':{'email':_0x4aadc9[_0x2460('0x2f')][_0x2460('0x1e')]}});})[_0x2460('0x13')](function(_0x1d221d){if(!_0x1d221d){throw new Error(_0x2460('0x35'));}if(_0x1d221d[_0x2460('0xe')]){throw new Error(_0x2460('0x36'));}if(_0x1d221d[_0x2460('0x18')]){if(moment(_0x1d221d[_0x2460('0xf')])['add'](_0x5072d1[_0x2460('0x9')],_0x2460('0x1a'))>moment()){throw new Error(_0x2460('0x37'));}else{_0x1d221d[_0x2460('0x18')]=![];_0x1d221d[_0x2460('0xf')]=null;}}_0x1d221d[_0x2460('0x38')]=_0x5e10fc;_0x1d221d['resetPasswordExpires']=Date[_0x2460('0x39')]()+0x36ee80;return _0x1d221d[_0x2460('0x3a')]();})[_0x2460('0x13')](function(){return sendServiceMail({'to':_0x4aadc9[_0x2460('0x2f')]['email'],'subject':_0x2460('0x3b'),'text':_0x2460('0x3c')+_0x2460('0x3d')+_0x2460('0x3e')+_0x4aadc9[_0x2460('0x3f')][_0x2460('0x40')]+_0x2460('0x41')+_0x5e10fc+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2460('0x13')](function(){_0x2b8727[_0x2460('0x28')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x2460('0x1c')](function(_0x396f97){return handleError(_0x2b8727,0x1f4,_0x396f97);});};exports[_0x2460('0x42')]=function(_0x493ccf,_0x110abb){return db[_0x2460('0x33')][_0x2460('0x34')]({'where':{'resetPasswordToken':_0x493ccf[_0x2460('0x43')][_0x2460('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2460('0x13')](function(_0x45fee6){if(!_0x45fee6){throw new Error(_0x2460('0x45'));}return db[_0x2460('0x8')]['findOne']({'attributes':['id',_0x2460('0x46'),'enforcePasswordHistory',_0x2460('0x47')]})['then'](function(_0xbd2cb2){if(_0xbd2cb2[_0x2460('0x46')])authService['validatePasswordPattern'](_0x493ccf['body'][_0x2460('0xc')]);if(!_0xbd2cb2[_0x2460('0x48')]||!_0x45fee6['previousPasswords'])return _0x45fee6;authService[_0x2460('0x49')](_0x493ccf[_0x2460('0x2f')][_0x2460('0xc')],_0x45fee6[_0x2460('0x4a')],_0xbd2cb2['passwordHistoryLimit']);return _0x45fee6;})[_0x2460('0x13')](function(){_0x45fee6[_0x2460('0xc')]=_0x493ccf['body'][_0x2460('0xc')];_0x45fee6[_0x2460('0x38')]=null;_0x45fee6[_0x2460('0x4b')]=null;return _0x45fee6[_0x2460('0x3a')]();});})[_0x2460('0x13')](function(){_0x110abb['status'](0xc8)[_0x2460('0x29')]({'message':_0x2460('0x4c')});})[_0x2460('0x1c')](function(_0x329bd5){return handleError(_0x110abb,0x1f4,_0x329bd5);});};passport[_0x2460('0x4d')](_0x2460('0x4e'),new LocalStrategy({'usernameField':_0x2460('0xb'),'passwordField':_0x2460('0xc')},function(_0x3edd2f,_0x2d63b3,_0x4dfddc){return localAuthenticate(db[_0x2460('0x33')],_0x3edd2f,_0x2d63b3,_0x4dfddc);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8a817b5..eb80c48 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 _0xdef8=['reset','exports','express','./authLocal.controller','login','post','/forgot','/reset/:token'];(function(_0x39e1e3,_0x45ba4d){var _0x4946ab=function(_0x21835d){while(--_0x21835d){_0x39e1e3['push'](_0x39e1e3['shift']());}};_0x4946ab(++_0x45ba4d);}(_0xdef8,0x11a));var _0x8def=function(_0xa54301,_0x2bc8e0){_0xa54301=_0xa54301-0x0;var _0x6834c1=_0xdef8[_0xa54301];return _0x6834c1;};'use strict';var express=require(_0x8def('0x0'));var router=express['Router']();var controller=require(_0x8def('0x1'));router['post']('/',controller[_0x8def('0x2')]);router[_0x8def('0x3')](_0x8def('0x4'),controller['forgot']);router['post'](_0x8def('0x5'),controller[_0x8def('0x6')]);module[_0x8def('0x7')]=router; \ No newline at end of file +var _0x9cb8=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x35825e,_0x657421){var _0x4f4d90=function(_0x160265){while(--_0x160265){_0x35825e['push'](_0x35825e['shift']());}};_0x4f4d90(++_0x657421);}(_0x9cb8,0x192));var _0x89cb=function(_0x251c5a,_0x173cbe){_0x251c5a=_0x251c5a-0x0;var _0x1cb570=_0x9cb8[_0x251c5a];return _0x1cb570;};'use strict';var express=require('express');var router=express[_0x89cb('0x0')]();var controller=require(_0x89cb('0x1'));router[_0x89cb('0x2')]('/',controller[_0x89cb('0x3')]);router[_0x89cb('0x2')](_0x89cb('0x4'),controller[_0x89cb('0x5')]);router[_0x89cb('0x2')](_0x89cb('0x6'),controller[_0x89cb('0x7')]);module[_0x89cb('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 4e5d16f..d86c7d7 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 _0x6d65=['INTEGER','sequelize','exports','STRING'];(function(_0x138a60,_0x25ce07){var _0x1a967c=function(_0x24f1d9){while(--_0x24f1d9){_0x138a60['push'](_0x138a60['shift']());}};_0x1a967c(++_0x25ce07);}(_0x6d65,0x191));var _0x56d6=function(_0x1f22d5,_0x33e246){_0x1f22d5=_0x1f22d5-0x0;var _0x5bc93b=_0x6d65[_0x1f22d5];return _0x5bc93b;};'use strict';var Sequelize=require(_0x56d6('0x0'));module[_0x56d6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x56d6('0x2')]},'description':{'type':Sequelize[_0x56d6('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x56d6('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xff07=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x59ec5e,_0x5096b9){var _0xbb997a=function(_0x3911e2){while(--_0x3911e2){_0x59ec5e['push'](_0x59ec5e['shift']());}};_0xbb997a(++_0x5096b9);}(_0xff07,0x180));var _0x7ff0=function(_0x2b90dc,_0x10b832){_0x2b90dc=_0x2b90dc-0x0;var _0x4794a6=_0xff07[_0x2b90dc];return _0x4794a6;};'use strict';var Sequelize=require('sequelize');module[_0x7ff0('0x0')]={'name':{'type':Sequelize[_0x7ff0('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7ff0('0x1')]},'description':{'type':Sequelize[_0x7ff0('0x1')]},'status':{'type':Sequelize[_0x7ff0('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7ff0('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index fc7aa4e..c6cf812 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 _0x3f9b=['show','params','includeAll','include','find','create','body','Condition','addConditions','omit','ids','findOne','getConditions','addActions','Action','getActions','hasOwnProperty','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','model','keys','filters','attributes','intersection','fields','length','query','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch'];(function(_0x2b5a65,_0x395f84){var _0xf4ab8=function(_0x43c09f){while(--_0x43c09f){_0x2b5a65['push'](_0x2b5a65['shift']());}};_0xf4ab8(++_0x395f84);}(_0x3f9b,0x110));var _0xb3f9=function(_0x27c96e,_0x2074ef){_0x27c96e=_0x27c96e-0x0;var _0x1dea73=_0x3f9b[_0x27c96e];return _0x1dea73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb3f9('0x0'));var rp=require(_0xb3f9('0x1'));var moment=require('moment');var BPromise=require(_0xb3f9('0x2'));var Mustache=require(_0xb3f9('0x3'));var util=require(_0xb3f9('0x4'));var path=require(_0xb3f9('0x5'));var sox=require(_0xb3f9('0x6'));var csv=require(_0xb3f9('0x7'));var ejs=require(_0xb3f9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3f9('0x9'));var squel=require(_0xb3f9('0xa'));var crypto=require('crypto');var jsforce=require(_0xb3f9('0xb'));var deskjs=require(_0xb3f9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb3f9('0xd'));var Papa=require(_0xb3f9('0xe'));var Redis=require('ioredis');var authService=require(_0xb3f9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb3f9('0x10'));var hardwareService=require(_0xb3f9('0x11'));var logger=require(_0xb3f9('0x12'))(_0xb3f9('0x13'));var utils=require(_0xb3f9('0x14'));var config=require(_0xb3f9('0x15'));var licenseUtil=require(_0xb3f9('0x16'));var db=require(_0xb3f9('0x17'))['db'];function respondWithStatusCode(_0x5eb9d3,_0x46c230){_0x46c230=_0x46c230||0xcc;return function(_0x5b10e4){if(_0x5b10e4){return _0x5eb9d3['sendStatus'](_0x46c230);}return _0x5eb9d3['status'](_0x46c230)[_0xb3f9('0x18')]();};}function respondWithResult(_0x218e40,_0x109ad0){_0x109ad0=_0x109ad0||0xc8;return function(_0x460efa){if(_0x460efa){return _0x218e40[_0xb3f9('0x19')](_0x109ad0)[_0xb3f9('0x1a')](_0x460efa);}};}function respondWithFilteredResult(_0x34a7e9,_0x3f117b){return function(_0x559989){if(_0x559989){var _0xb51f0b=typeof _0x3f117b[_0xb3f9('0x1b')]===_0xb3f9('0x1c')&&typeof _0x3f117b[_0xb3f9('0x1d')]===_0xb3f9('0x1c');var _0x452fbb=_0x559989[_0xb3f9('0x1e')];var _0x4ae838=_0xb51f0b?0x0:_0x3f117b[_0xb3f9('0x1b')];var _0x5f353e=_0xb51f0b?_0x559989[_0xb3f9('0x1e')]:_0x3f117b[_0xb3f9('0x1b')]+_0x3f117b[_0xb3f9('0x1d')];var _0x2b5a00;if(_0x5f353e>=_0x452fbb){_0x5f353e=_0x452fbb;_0x2b5a00=0xc8;}else{_0x2b5a00=0xce;}_0x34a7e9[_0xb3f9('0x19')](_0x2b5a00);return _0x34a7e9['set'](_0xb3f9('0x1f'),_0x4ae838+'-'+_0x5f353e+'/'+_0x452fbb)[_0xb3f9('0x1a')](_0x559989);}return null;};}function patchUpdates(_0x674166){return function(_0x34048d){try{jsonpatch[_0xb3f9('0x20')](_0x34048d,_0x674166,!![]);}catch(_0x47519b){return BPromise[_0xb3f9('0x21')](_0x47519b);}return _0x34048d[_0xb3f9('0x22')]();};}function saveUpdates(_0x55f8c7,_0x5041a7){return function(_0x4f32f9){if(_0x4f32f9){return _0x4f32f9[_0xb3f9('0x23')](_0x55f8c7)[_0xb3f9('0x24')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x567a0c,_0x3cdca6){return function(_0x3bb486){if(_0x3bb486){return _0x3bb486[_0xb3f9('0x25')]()[_0xb3f9('0x24')](function(){_0x567a0c[_0xb3f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2002f6,_0xbf03dd){return function(_0x3e4253){if(!_0x3e4253){_0x2002f6[_0xb3f9('0x26')](0x194);}return _0x3e4253;};}function handleError(_0x8c1f72,_0x192736){_0x192736=_0x192736||0x1f4;return function(_0x5b633f){logger[_0xb3f9('0x27')](_0x5b633f[_0xb3f9('0x28')]);if(_0x5b633f[_0xb3f9('0x29')]){delete _0x5b633f[_0xb3f9('0x29')];}_0x8c1f72[_0xb3f9('0x19')](_0x192736)['send'](_0x5b633f);};}exports[_0xb3f9('0x2a')]=function(_0x17e981,_0x15f087){var _0x463e94={},_0x347193={},_0x2b7f20={'count':0x0,'rows':[]};var _0x24b2b3=_[_0xb3f9('0x2b')](db[_0xb3f9('0x2c')][_0xb3f9('0x2d')],function(_0x1ab486){return{'name':_0x1ab486['fieldName'],'type':_0x1ab486[_0xb3f9('0x2e')][_0xb3f9('0x2f')]};});_0x347193[_0xb3f9('0x30')]=_[_0xb3f9('0x2b')](_0x24b2b3,_0xb3f9('0x29'));_0x347193['query']=_[_0xb3f9('0x31')](_0x17e981['query']);_0x347193[_0xb3f9('0x32')]=_['intersection'](_0x347193[_0xb3f9('0x30')],_0x347193['query']);_0x463e94[_0xb3f9('0x33')]=_[_0xb3f9('0x34')](_0x347193[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0x17e981['query'][_0xb3f9('0x35')]));_0x463e94['attributes']=_0x463e94[_0xb3f9('0x33')][_0xb3f9('0x36')]?_0x463e94[_0xb3f9('0x33')]:_0x347193[_0xb3f9('0x30')];if(!_0x17e981[_0xb3f9('0x37')]['hasOwnProperty'](_0xb3f9('0x38'))){_0x463e94[_0xb3f9('0x1d')]=qs['limit'](_0x17e981['query']['limit']);_0x463e94['offset']=qs[_0xb3f9('0x1b')](_0x17e981[_0xb3f9('0x37')][_0xb3f9('0x1b')]);}_0x463e94[_0xb3f9('0x39')]=qs['sort'](_0x17e981[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x463e94[_0xb3f9('0x3b')]=qs[_0xb3f9('0x32')](_[_0xb3f9('0x3c')](_0x17e981[_0xb3f9('0x37')],_0x347193[_0xb3f9('0x32')]),_0x24b2b3);if(_0x17e981['query'][_0xb3f9('0x3d')]){_0x463e94['where']=_['merge'](_0x463e94['where'],{'$or':_[_0xb3f9('0x2b')](_0x24b2b3,function(_0x5d5721){if(_0x5d5721['type']!==_0xb3f9('0x3e')){var _0x139805={};_0x139805[_0x5d5721[_0xb3f9('0x29')]]={'$like':'%'+_0x17e981['query'][_0xb3f9('0x3d')]+'%'};return _0x139805;}})});}_0x463e94=_[_0xb3f9('0x3f')]({},_0x463e94,_0x17e981[_0xb3f9('0x40')]);var _0x597eed={'where':_0x463e94[_0xb3f9('0x3b')]};return db[_0xb3f9('0x2c')][_0xb3f9('0x1e')](_0x597eed)[_0xb3f9('0x24')](function(_0x2e0d72){_0x2b7f20[_0xb3f9('0x1e')]=_0x2e0d72;if(_0x17e981['query']['includeAll']){_0x463e94['include']=[{'all':!![]}];}return db[_0xb3f9('0x2c')][_0xb3f9('0x41')](_0x463e94);})['then'](function(_0x1130a3){_0x2b7f20[_0xb3f9('0x42')]=_0x1130a3;return _0x2b7f20;})[_0xb3f9('0x24')](respondWithFilteredResult(_0x15f087,_0x463e94))[_0xb3f9('0x43')](handleError(_0x15f087,null));};exports[_0xb3f9('0x44')]=function(_0x27cb5b,_0x469239){var _0x14aab2={'raw':![],'where':{'id':_0x27cb5b[_0xb3f9('0x45')]['id']}},_0x182e16={};_0x182e16['model']=_[_0xb3f9('0x31')](db[_0xb3f9('0x2c')][_0xb3f9('0x2d')]);_0x182e16[_0xb3f9('0x37')]=_[_0xb3f9('0x31')](_0x27cb5b['query']);_0x182e16['filters']=_['intersection'](_0x182e16[_0xb3f9('0x30')],_0x182e16['query']);_0x14aab2[_0xb3f9('0x33')]=_[_0xb3f9('0x34')](_0x182e16[_0xb3f9('0x30')],qs['fields'](_0x27cb5b[_0xb3f9('0x37')][_0xb3f9('0x35')]));_0x14aab2[_0xb3f9('0x33')]=_0x14aab2['attributes'][_0xb3f9('0x36')]?_0x14aab2[_0xb3f9('0x33')]:_0x182e16[_0xb3f9('0x30')];if(_0x27cb5b[_0xb3f9('0x37')][_0xb3f9('0x46')]){_0x14aab2[_0xb3f9('0x47')]=[{'all':!![]}];}_0x14aab2=_[_0xb3f9('0x3f')]({},_0x14aab2,_0x27cb5b[_0xb3f9('0x40')]);return db[_0xb3f9('0x2c')][_0xb3f9('0x48')](_0x14aab2)[_0xb3f9('0x24')](handleEntityNotFound(_0x469239,null))['then'](respondWithResult(_0x469239,null))[_0xb3f9('0x43')](handleError(_0x469239,null));};exports[_0xb3f9('0x49')]=function(_0x2c1e55,_0x2feffd){return db['Automation']['create'](_0x2c1e55['body'],{})[_0xb3f9('0x24')](respondWithResult(_0x2feffd,0xc9))['catch'](handleError(_0x2feffd,null));};exports[_0xb3f9('0x23')]=function(_0x127481,_0x49aecd){if(_0x127481[_0xb3f9('0x4a')]['id']){delete _0x127481['body']['id'];}return db[_0xb3f9('0x2c')][_0xb3f9('0x48')]({'where':{'id':_0x127481['params']['id']}})['then'](handleEntityNotFound(_0x49aecd,null))[_0xb3f9('0x24')](saveUpdates(_0x127481[_0xb3f9('0x4a')],null))[_0xb3f9('0x24')](respondWithResult(_0x49aecd,null))[_0xb3f9('0x43')](handleError(_0x49aecd,null));};exports[_0xb3f9('0x25')]=function(_0x19a518,_0x20cd9f){return db[_0xb3f9('0x2c')]['find']({'where':{'id':_0x19a518['params']['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x20cd9f,null))['then'](removeEntity(_0x20cd9f,null))[_0xb3f9('0x43')](handleError(_0x20cd9f,null));};exports['addConditions']=function(_0x16ac45,_0xda0d54,_0x2863df){return db[_0xb3f9('0x4b')][_0xb3f9('0x48')]({'where':{'id':_0x16ac45[_0xb3f9('0x45')]['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0xda0d54,null))[_0xb3f9('0x24')](function(_0x22be9d){if(_0x22be9d){return _0x22be9d[_0xb3f9('0x4c')](_0x16ac45[_0xb3f9('0x4a')]['ids'],_[_0xb3f9('0x4d')](_0x16ac45['body'],[_0xb3f9('0x4e'),'id'])||{});}})[_0xb3f9('0x24')](respondWithResult(_0xda0d54,null))[_0xb3f9('0x43')](handleError(_0xda0d54,null));};exports['getConditions']=function(_0x327447,_0x4495cf,_0x572911){var _0x4c90ff={};var _0x217273={};var _0x262697;var _0x15da18;return db[_0xb3f9('0x2c')][_0xb3f9('0x4f')]({'where':{'id':_0x327447['params']['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x4495cf,null))[_0xb3f9('0x24')](function(_0x130174){if(_0x130174){_0x262697=_0x130174;_0x217273[_0xb3f9('0x30')]=_[_0xb3f9('0x31')](db[_0xb3f9('0x4b')][_0xb3f9('0x2d')]);_0x217273['query']=_[_0xb3f9('0x31')](_0x327447[_0xb3f9('0x37')]);_0x217273[_0xb3f9('0x32')]=_['intersection'](_0x217273['model'],_0x217273['query']);_0x4c90ff['attributes']=_['intersection'](_0x217273[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0x327447[_0xb3f9('0x37')]['fields']));_0x4c90ff[_0xb3f9('0x33')]=_0x4c90ff[_0xb3f9('0x33')][_0xb3f9('0x36')]?_0x4c90ff[_0xb3f9('0x33')]:_0x217273['model'];_0x4c90ff[_0xb3f9('0x39')]=qs[_0xb3f9('0x3a')](_0x327447[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x4c90ff[_0xb3f9('0x3b')]=qs['filters'](_['pick'](_0x327447[_0xb3f9('0x37')],_0x217273['filters']));if(_0x327447[_0xb3f9('0x37')][_0xb3f9('0x3d')]){_0x4c90ff[_0xb3f9('0x3b')]=_[_0xb3f9('0x3f')](_0x4c90ff[_0xb3f9('0x3b')],{'$or':_[_0xb3f9('0x2b')](_0x4c90ff[_0xb3f9('0x33')],function(_0x412b68){var _0x23667d={};_0x23667d[_0x412b68]={'$like':'%'+_0x327447['query'][_0xb3f9('0x3d')]+'%'};return _0x23667d;})});}_0x4c90ff=_[_0xb3f9('0x3f')]({},_0x4c90ff,_0x327447[_0xb3f9('0x40')]);return _0x262697[_0xb3f9('0x50')](_0x4c90ff);}})[_0xb3f9('0x24')](function(_0xd543ba){if(_0xd543ba){_0x15da18=_0xd543ba[_0xb3f9('0x36')];if(!_0x327447[_0xb3f9('0x37')]['hasOwnProperty'](_0xb3f9('0x38'))){_0x4c90ff[_0xb3f9('0x1d')]=qs[_0xb3f9('0x1d')](_0x327447[_0xb3f9('0x37')]['limit']);_0x4c90ff[_0xb3f9('0x1b')]=qs[_0xb3f9('0x1b')](_0x327447[_0xb3f9('0x37')]['offset']);}return _0x262697['getConditions'](_0x4c90ff);}})[_0xb3f9('0x24')](function(_0x19d18e){if(_0x19d18e){return _0x19d18e?{'count':_0x15da18,'rows':_0x19d18e}:null;}})[_0xb3f9('0x24')](respondWithResult(_0x4495cf,null))[_0xb3f9('0x43')](handleError(_0x4495cf,null));};exports[_0xb3f9('0x51')]=function(_0x30d085,_0x3c6269,_0x1ae0b8){return db[_0xb3f9('0x52')][_0xb3f9('0x48')]({'where':{'id':_0x30d085[_0xb3f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c6269,null))[_0xb3f9('0x24')](function(_0x2454d1){if(_0x2454d1){return _0x2454d1[_0xb3f9('0x51')](_0x30d085[_0xb3f9('0x4a')][_0xb3f9('0x4e')],_['omit'](_0x30d085['body'],['ids','id'])||{});}})[_0xb3f9('0x24')](respondWithResult(_0x3c6269,null))[_0xb3f9('0x43')](handleError(_0x3c6269,null));};exports[_0xb3f9('0x53')]=function(_0xe27b47,_0x59a8dd,_0x23d4fa){var _0x1046b0={};var _0x4939be={};var _0x4a3158;var _0x40abac;return db[_0xb3f9('0x2c')][_0xb3f9('0x4f')]({'where':{'id':_0xe27b47[_0xb3f9('0x45')]['id']}})[_0xb3f9('0x24')](handleEntityNotFound(_0x59a8dd,null))['then'](function(_0x4a2c55){if(_0x4a2c55){_0x4a3158=_0x4a2c55;_0x4939be[_0xb3f9('0x30')]=_[_0xb3f9('0x31')](db[_0xb3f9('0x52')][_0xb3f9('0x2d')]);_0x4939be[_0xb3f9('0x37')]=_[_0xb3f9('0x31')](_0xe27b47[_0xb3f9('0x37')]);_0x4939be[_0xb3f9('0x32')]=_['intersection'](_0x4939be[_0xb3f9('0x30')],_0x4939be[_0xb3f9('0x37')]);_0x1046b0['attributes']=_[_0xb3f9('0x34')](_0x4939be[_0xb3f9('0x30')],qs[_0xb3f9('0x35')](_0xe27b47[_0xb3f9('0x37')]['fields']));_0x1046b0[_0xb3f9('0x33')]=_0x1046b0['attributes'][_0xb3f9('0x36')]?_0x1046b0['attributes']:_0x4939be[_0xb3f9('0x30')];_0x1046b0[_0xb3f9('0x39')]=qs['sort'](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x3a')]);_0x1046b0[_0xb3f9('0x3b')]=qs['filters'](_[_0xb3f9('0x3c')](_0xe27b47[_0xb3f9('0x37')],_0x4939be[_0xb3f9('0x32')]));if(_0xe27b47[_0xb3f9('0x37')]['filter']){_0x1046b0[_0xb3f9('0x3b')]=_[_0xb3f9('0x3f')](_0x1046b0[_0xb3f9('0x3b')],{'$or':_[_0xb3f9('0x2b')](_0x1046b0[_0xb3f9('0x33')],function(_0x100b2d){var _0x4483c1={};_0x4483c1[_0x100b2d]={'$like':'%'+_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x3d')]+'%'};return _0x4483c1;})});}_0x1046b0=_[_0xb3f9('0x3f')]({},_0x1046b0,_0xe27b47[_0xb3f9('0x40')]);return _0x4a3158[_0xb3f9('0x53')](_0x1046b0);}})[_0xb3f9('0x24')](function(_0x5c3d6a){if(_0x5c3d6a){_0x40abac=_0x5c3d6a['length'];if(!_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x54')]('nolimit')){_0x1046b0['limit']=qs[_0xb3f9('0x1d')](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x1d')]);_0x1046b0['offset']=qs[_0xb3f9('0x1b')](_0xe27b47[_0xb3f9('0x37')][_0xb3f9('0x1b')]);}return _0x4a3158[_0xb3f9('0x53')](_0x1046b0);}})[_0xb3f9('0x24')](function(_0x1dfc49){if(_0x1dfc49){return _0x1dfc49?{'count':_0x40abac,'rows':_0x1dfc49}:null;}})[_0xb3f9('0x24')](respondWithResult(_0x59a8dd,null))[_0xb3f9('0x43')](handleError(_0x59a8dd,null));}; \ No newline at end of file +var _0xc0ae=['getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','includeAll','catch','show','params','length','include','options','create','body','find','addConditions','Condition','omit','ids','findOne','order','pick','getConditions','addActions','Action'];(function(_0x23cf72,_0x22e108){var _0x3bc541=function(_0x59ef43){while(--_0x59ef43){_0x23cf72['push'](_0x23cf72['shift']());}};_0x3bc541(++_0x22e108);}(_0xc0ae,0xeb));var _0xec0a=function(_0x1438fb,_0x415ec0){_0x1438fb=_0x1438fb-0x0;var _0xbd63b=_0xc0ae[_0x1438fb];return _0xbd63b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec0a('0x0'));var zipdir=require(_0xec0a('0x1'));var jsonpatch=require(_0xec0a('0x2'));var rp=require(_0xec0a('0x3'));var moment=require('moment');var BPromise=require(_0xec0a('0x4'));var Mustache=require(_0xec0a('0x5'));var util=require(_0xec0a('0x6'));var path=require('path');var sox=require(_0xec0a('0x7'));var csv=require(_0xec0a('0x8'));var ejs=require(_0xec0a('0x9'));var fs=require('fs');var fs_extra=require(_0xec0a('0xa'));var _=require(_0xec0a('0xb'));var squel=require(_0xec0a('0xc'));var crypto=require(_0xec0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec0a('0xe'));var toCsv=require(_0xec0a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec0a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec0a('0x10'));var as=require(_0xec0a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec0a('0x12'))('api');var utils=require(_0xec0a('0x13'));var config=require(_0xec0a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xec0a('0x15'))['db'];function respondWithStatusCode(_0x230342,_0x3ee866){_0x3ee866=_0x3ee866||0xcc;return function(_0x10ae66){if(_0x10ae66){return _0x230342[_0xec0a('0x16')](_0x3ee866);}return _0x230342[_0xec0a('0x17')](_0x3ee866)[_0xec0a('0x18')]();};}function respondWithResult(_0xb302e7,_0x587167){_0x587167=_0x587167||0xc8;return function(_0x4e8b06){if(_0x4e8b06){return _0xb302e7[_0xec0a('0x17')](_0x587167)['json'](_0x4e8b06);}};}function respondWithFilteredResult(_0x44a8b4,_0x1cbe44){return function(_0x5a65dd){if(_0x5a65dd){var _0x4daa20=typeof _0x1cbe44[_0xec0a('0x19')]==='undefined'&&typeof _0x1cbe44[_0xec0a('0x1a')]==='undefined';var _0x5211f9=_0x5a65dd[_0xec0a('0x1b')];var _0x59f622=_0x4daa20?0x0:_0x1cbe44[_0xec0a('0x19')];var _0x5e79a8=_0x4daa20?_0x5a65dd[_0xec0a('0x1b')]:_0x1cbe44[_0xec0a('0x19')]+_0x1cbe44[_0xec0a('0x1a')];var _0x1a0fa0;if(_0x5e79a8>=_0x5211f9){_0x5e79a8=_0x5211f9;_0x1a0fa0=0xc8;}else{_0x1a0fa0=0xce;}_0x44a8b4['status'](_0x1a0fa0);return _0x44a8b4[_0xec0a('0x1c')](_0xec0a('0x1d'),_0x59f622+'-'+_0x5e79a8+'/'+_0x5211f9)['json'](_0x5a65dd);}return null;};}function patchUpdates(_0x20cfbe){return function(_0x198b84){try{jsonpatch['apply'](_0x198b84,_0x20cfbe,!![]);}catch(_0x58a813){return BPromise['reject'](_0x58a813);}return _0x198b84['save']();};}function saveUpdates(_0x584814,_0x20ec4e){return function(_0x5e2f7b){if(_0x5e2f7b){return _0x5e2f7b[_0xec0a('0x1e')](_0x584814)[_0xec0a('0x1f')](function(_0x26bd59){return _0x26bd59;});}return null;};}function removeEntity(_0xe1739a,_0x5edffc){return function(_0x1555bd){if(_0x1555bd){return _0x1555bd[_0xec0a('0x20')]()[_0xec0a('0x1f')](function(){_0xe1739a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3d18,_0x531569){return function(_0xfd4cd0){if(!_0xfd4cd0){_0x3f3d18[_0xec0a('0x16')](0x194);}return _0xfd4cd0;};}function handleError(_0x479d5e,_0x47ce03){_0x47ce03=_0x47ce03||0x1f4;return function(_0x1fee77){logger[_0xec0a('0x21')](_0x1fee77[_0xec0a('0x22')]);if(_0x1fee77['name']){delete _0x1fee77[_0xec0a('0x23')];}_0x479d5e['status'](_0x47ce03)[_0xec0a('0x24')](_0x1fee77);};}exports[_0xec0a('0x25')]=function(_0xe2cf51,_0x52d6f4){var _0x3959a7={},_0x97654a={},_0x585f2e={'count':0x0,'rows':[]};var _0x5434f6=_[_0xec0a('0x26')](db[_0xec0a('0x27')][_0xec0a('0x28')],function(_0x406569){return{'name':_0x406569[_0xec0a('0x29')],'type':_0x406569[_0xec0a('0x2a')][_0xec0a('0x2b')]};});_0x97654a[_0xec0a('0x2c')]=_[_0xec0a('0x26')](_0x5434f6,'name');_0x97654a[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0xe2cf51[_0xec0a('0x2d')]);_0x97654a['filters']=_[_0xec0a('0x2f')](_0x97654a[_0xec0a('0x2c')],_0x97654a[_0xec0a('0x2d')]);_0x3959a7[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x97654a[_0xec0a('0x2c')],qs[_0xec0a('0x31')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x3959a7['attributes']=_0x3959a7[_0xec0a('0x30')]['length']?_0x3959a7[_0xec0a('0x30')]:_0x97654a[_0xec0a('0x2c')];if(!_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x3959a7[_0xec0a('0x1a')]=qs[_0xec0a('0x1a')](_0xe2cf51['query']['limit']);_0x3959a7[_0xec0a('0x19')]=qs[_0xec0a('0x19')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x19')]);}_0x3959a7['order']=qs[_0xec0a('0x34')](_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x3959a7['where']=qs[_0xec0a('0x35')](_['pick'](_0xe2cf51[_0xec0a('0x2d')],_0x97654a[_0xec0a('0x35')]),_0x5434f6);if(_0xe2cf51['query'][_0xec0a('0x36')]){_0x3959a7[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x3959a7['where'],{'$or':_[_0xec0a('0x26')](_0x5434f6,function(_0x306d32){if(_0x306d32[_0xec0a('0x2a')]!=='VIRTUAL'){var _0x431c0f={};_0x431c0f[_0x306d32['name']]={'$like':'%'+_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x36')]+'%'};return _0x431c0f;}})});}_0x3959a7=_[_0xec0a('0x38')]({},_0x3959a7,_0xe2cf51['options']);var _0x38f1e1={'where':_0x3959a7[_0xec0a('0x37')]};return db[_0xec0a('0x27')][_0xec0a('0x1b')](_0x38f1e1)[_0xec0a('0x1f')](function(_0x390b37){_0x585f2e[_0xec0a('0x1b')]=_0x390b37;if(_0xe2cf51[_0xec0a('0x2d')][_0xec0a('0x39')]){_0x3959a7['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x3959a7);})[_0xec0a('0x1f')](function(_0x1d4a87){_0x585f2e['rows']=_0x1d4a87;return _0x585f2e;})[_0xec0a('0x1f')](respondWithFilteredResult(_0x52d6f4,_0x3959a7))[_0xec0a('0x3a')](handleError(_0x52d6f4,null));};exports[_0xec0a('0x3b')]=function(_0x32c116,_0x4210a4){var _0x5d6c8e={'raw':![],'where':{'id':_0x32c116[_0xec0a('0x3c')]['id']}},_0x1f070d={};_0x1f070d['model']=_[_0xec0a('0x2e')](db['Automation'][_0xec0a('0x28')]);_0x1f070d[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0x32c116[_0xec0a('0x2d')]);_0x1f070d[_0xec0a('0x35')]=_[_0xec0a('0x2f')](_0x1f070d['model'],_0x1f070d[_0xec0a('0x2d')]);_0x5d6c8e[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x1f070d['model'],qs[_0xec0a('0x31')](_0x32c116[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x5d6c8e[_0xec0a('0x30')]=_0x5d6c8e[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x5d6c8e['attributes']:_0x1f070d[_0xec0a('0x2c')];if(_0x32c116[_0xec0a('0x2d')][_0xec0a('0x39')]){_0x5d6c8e[_0xec0a('0x3e')]=[{'all':!![]}];}_0x5d6c8e=_[_0xec0a('0x38')]({},_0x5d6c8e,_0x32c116[_0xec0a('0x3f')]);return db['Automation']['find'](_0x5d6c8e)[_0xec0a('0x1f')](handleEntityNotFound(_0x4210a4,null))[_0xec0a('0x1f')](respondWithResult(_0x4210a4,null))[_0xec0a('0x3a')](handleError(_0x4210a4,null));};exports[_0xec0a('0x40')]=function(_0x46ef16,_0x4a1bfe){return db['Automation'][_0xec0a('0x40')](_0x46ef16['body'],{})['then'](respondWithResult(_0x4a1bfe,0xc9))[_0xec0a('0x3a')](handleError(_0x4a1bfe,null));};exports[_0xec0a('0x1e')]=function(_0x1af951,_0x15bde3){if(_0x1af951['body']['id']){delete _0x1af951[_0xec0a('0x41')]['id'];}return db['Automation']['find']({'where':{'id':_0x1af951[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x15bde3,null))[_0xec0a('0x1f')](saveUpdates(_0x1af951[_0xec0a('0x41')],null))[_0xec0a('0x1f')](respondWithResult(_0x15bde3,null))['catch'](handleError(_0x15bde3,null));};exports[_0xec0a('0x20')]=function(_0x46f2f9,_0x436336){return db[_0xec0a('0x27')][_0xec0a('0x42')]({'where':{'id':_0x46f2f9[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x436336,null))[_0xec0a('0x1f')](removeEntity(_0x436336,null))['catch'](handleError(_0x436336,null));};exports[_0xec0a('0x43')]=function(_0x29e2db,_0x42d444,_0x32457c){return db[_0xec0a('0x44')][_0xec0a('0x42')]({'where':{'id':_0x29e2db[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x42d444,null))[_0xec0a('0x1f')](function(_0xb01fde){if(_0xb01fde){return _0xb01fde['addConditions'](_0x29e2db[_0xec0a('0x41')]['ids'],_[_0xec0a('0x45')](_0x29e2db['body'],[_0xec0a('0x46'),'id'])||{});}})[_0xec0a('0x1f')](respondWithResult(_0x42d444,null))[_0xec0a('0x3a')](handleError(_0x42d444,null));};exports['getConditions']=function(_0x40be08,_0x419dd6,_0x53bf50){var _0x31ea3d={};var _0x11ab12={};var _0x42c501;var _0xe729bf;return db[_0xec0a('0x27')][_0xec0a('0x47')]({'where':{'id':_0x40be08[_0xec0a('0x3c')]['id']}})[_0xec0a('0x1f')](handleEntityNotFound(_0x419dd6,null))[_0xec0a('0x1f')](function(_0x3801e0){if(_0x3801e0){_0x42c501=_0x3801e0;_0x11ab12[_0xec0a('0x2c')]=_['keys'](db[_0xec0a('0x44')][_0xec0a('0x28')]);_0x11ab12[_0xec0a('0x2d')]=_[_0xec0a('0x2e')](_0x40be08['query']);_0x11ab12[_0xec0a('0x35')]=_[_0xec0a('0x2f')](_0x11ab12['model'],_0x11ab12[_0xec0a('0x2d')]);_0x31ea3d[_0xec0a('0x30')]=_[_0xec0a('0x2f')](_0x11ab12[_0xec0a('0x2c')],qs[_0xec0a('0x31')](_0x40be08[_0xec0a('0x2d')]['fields']));_0x31ea3d[_0xec0a('0x30')]=_0x31ea3d[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x31ea3d['attributes']:_0x11ab12['model'];_0x31ea3d[_0xec0a('0x48')]=qs[_0xec0a('0x34')](_0x40be08[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x31ea3d[_0xec0a('0x37')]=qs[_0xec0a('0x35')](_[_0xec0a('0x49')](_0x40be08['query'],_0x11ab12[_0xec0a('0x35')]));if(_0x40be08[_0xec0a('0x2d')]['filter']){_0x31ea3d[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x31ea3d[_0xec0a('0x37')],{'$or':_[_0xec0a('0x26')](_0x31ea3d[_0xec0a('0x30')],function(_0x62b558){var _0x3af7f1={};_0x3af7f1[_0x62b558]={'$like':'%'+_0x40be08[_0xec0a('0x2d')][_0xec0a('0x36')]+'%'};return _0x3af7f1;})});}_0x31ea3d=_[_0xec0a('0x38')]({},_0x31ea3d,_0x40be08[_0xec0a('0x3f')]);return _0x42c501[_0xec0a('0x4a')](_0x31ea3d);}})[_0xec0a('0x1f')](function(_0x2cb9c8){if(_0x2cb9c8){_0xe729bf=_0x2cb9c8['length'];if(!_0x40be08[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x31ea3d['limit']=qs[_0xec0a('0x1a')](_0x40be08[_0xec0a('0x2d')][_0xec0a('0x1a')]);_0x31ea3d[_0xec0a('0x19')]=qs['offset'](_0x40be08['query'][_0xec0a('0x19')]);}return _0x42c501[_0xec0a('0x4a')](_0x31ea3d);}})[_0xec0a('0x1f')](function(_0x1ef3c7){if(_0x1ef3c7){return _0x1ef3c7?{'count':_0xe729bf,'rows':_0x1ef3c7}:null;}})[_0xec0a('0x1f')](respondWithResult(_0x419dd6,null))[_0xec0a('0x3a')](handleError(_0x419dd6,null));};exports[_0xec0a('0x4b')]=function(_0x1e2a2d,_0x1943fd,_0xbfd383){return db[_0xec0a('0x4c')][_0xec0a('0x42')]({'where':{'id':_0x1e2a2d['params']['id']}})['then'](handleEntityNotFound(_0x1943fd,null))['then'](function(_0x24d841){if(_0x24d841){return _0x24d841[_0xec0a('0x4b')](_0x1e2a2d['body'][_0xec0a('0x46')],_[_0xec0a('0x45')](_0x1e2a2d[_0xec0a('0x41')],[_0xec0a('0x46'),'id'])||{});}})[_0xec0a('0x1f')](respondWithResult(_0x1943fd,null))['catch'](handleError(_0x1943fd,null));};exports[_0xec0a('0x4d')]=function(_0x25a0d9,_0x21862f,_0x5b715e){var _0x3700bb={};var _0x35be5f={};var _0x1ceff4;var _0x379bc3;return db['Automation'][_0xec0a('0x47')]({'where':{'id':_0x25a0d9[_0xec0a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21862f,null))[_0xec0a('0x1f')](function(_0x1d90a0){if(_0x1d90a0){_0x1ceff4=_0x1d90a0;_0x35be5f['model']=_[_0xec0a('0x2e')](db[_0xec0a('0x4c')][_0xec0a('0x28')]);_0x35be5f[_0xec0a('0x2d')]=_['keys'](_0x25a0d9['query']);_0x35be5f['filters']=_[_0xec0a('0x2f')](_0x35be5f['model'],_0x35be5f[_0xec0a('0x2d')]);_0x3700bb['attributes']=_[_0xec0a('0x2f')](_0x35be5f['model'],qs[_0xec0a('0x31')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x31')]));_0x3700bb['attributes']=_0x3700bb[_0xec0a('0x30')][_0xec0a('0x3d')]?_0x3700bb['attributes']:_0x35be5f[_0xec0a('0x2c')];_0x3700bb[_0xec0a('0x48')]=qs[_0xec0a('0x34')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x34')]);_0x3700bb[_0xec0a('0x37')]=qs['filters'](_[_0xec0a('0x49')](_0x25a0d9[_0xec0a('0x2d')],_0x35be5f['filters']));if(_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x36')]){_0x3700bb[_0xec0a('0x37')]=_[_0xec0a('0x38')](_0x3700bb['where'],{'$or':_[_0xec0a('0x26')](_0x3700bb[_0xec0a('0x30')],function(_0x1b1669){var _0x387fe1={};_0x387fe1[_0x1b1669]={'$like':'%'+_0x25a0d9[_0xec0a('0x2d')]['filter']+'%'};return _0x387fe1;})});}_0x3700bb=_['merge']({},_0x3700bb,_0x25a0d9['options']);return _0x1ceff4[_0xec0a('0x4d')](_0x3700bb);}})[_0xec0a('0x1f')](function(_0x653591){if(_0x653591){_0x379bc3=_0x653591[_0xec0a('0x3d')];if(!_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x32')](_0xec0a('0x33'))){_0x3700bb[_0xec0a('0x1a')]=qs[_0xec0a('0x1a')](_0x25a0d9[_0xec0a('0x2d')][_0xec0a('0x1a')]);_0x3700bb[_0xec0a('0x19')]=qs[_0xec0a('0x19')](_0x25a0d9[_0xec0a('0x2d')]['offset']);}return _0x1ceff4['getActions'](_0x3700bb);}})['then'](function(_0x44305d){if(_0x44305d){return _0x44305d?{'count':_0x379bc3,'rows':_0x44305d}:null;}})['then'](respondWithResult(_0x21862f,null))[_0xec0a('0x3a')](handleError(_0x21862f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 9d31b35..5f5a27b 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 _0xe0d9=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','moment','request-promise'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xe0d9,0x16e));var _0x9e0d=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xe0d9[_0x21f9c2];return _0x3da17f;};'use strict';var _=require(_0x9e0d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9e0d('0x1'));var moment=require(_0x9e0d('0x2'));var BPromise=require('bluebird');var rp=require(_0x9e0d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e0d('0x4'));var attributes=require(_0x9e0d('0x5'));module[_0x9e0d('0x6')]=function(_0x4b04c8,_0x1efd3d){return _0x4b04c8[_0x9e0d('0x7')](_0x9e0d('0x8'),attributes,{'tableName':_0x9e0d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69f4=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0xca1f03,_0xa6241c){var _0x57bcf5=function(_0x2c8494){while(--_0x2c8494){_0xca1f03['push'](_0xca1f03['shift']());}};_0x57bcf5(++_0xa6241c);}(_0x69f4,0x87));var _0x469f=function(_0x474de6,_0x300052){_0x474de6=_0x474de6-0x0;var _0x83599a=_0x69f4[_0x474de6];return _0x83599a;};'use strict';var _=require(_0x469f('0x0'));var util=require(_0x469f('0x1'));var logger=require(_0x469f('0x2'))(_0x469f('0x3'));var moment=require(_0x469f('0x4'));var BPromise=require(_0x469f('0x5'));var rp=require(_0x469f('0x6'));var fs=require('fs');var path=require(_0x469f('0x7'));var rimraf=require(_0x469f('0x8'));var config=require('../../config/environment');var attributes=require(_0x469f('0x9'));module[_0x469f('0xa')]=function(_0x4d5c3f,_0x306a9c){return _0x4d5c3f[_0x469f('0xb')](_0x469f('0xc'),attributes,{'tableName':_0x469f('0xd'),'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 d343885..659a486 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 _0xc17d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c6f44,_0x413a03){var _0x5ee4b9=function(_0x61a78c){while(--_0x61a78c){_0x4c6f44['push'](_0x4c6f44['shift']());}};_0x5ee4b9(++_0x413a03);}(_0xc17d,0x96));var _0xdc17=function(_0x193b08,_0x3284d4){_0x193b08=_0x193b08-0x0;var _0x4bba83=_0xc17d[_0x193b08];return _0x4bba83;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a11b,_0x16ac50,_0x373463){return new BPromise(function(_0x53143d,_0x5ccdc5){return client[_0xdc17('0xa')](_0x52a11b,_0x373463)[_0xdc17('0xb')](function(_0x17c626){logger[_0xdc17('0xc')](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));logger[_0xdc17('0xf')](_0xdc17('0x10'),_0x16ac50,'request\x20sent',JSON[_0xdc17('0x11')](_0x17c626));if(_0x17c626[_0xdc17('0x12')]){if(_0x17c626[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x5ccdc5(_0x17c626['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')]['message']);return _0x53143d(_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);}else{logger['info'](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));_0x53143d(_0x17c626[_0xdc17('0x14')][_0xdc17('0x13')]);}})[_0xdc17('0x15')](function(_0x3adc90){logger['error'](_0xdc17('0xd'),_0x16ac50,_0x3adc90);_0x5ccdc5(_0x3adc90);});});} \ No newline at end of file +var _0x38b8=['client','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c516c,_0x2d3e96,_0x15184b){return new BPromise(function(_0x4b9530,_0x552245){return client[_0x838b('0x8')](_0x5c516c,_0x15184b)[_0x838b('0x9')](function(_0x31ba84){logger['info'](_0x838b('0xa'),_0x2d3e96,'request\x20sent');logger[_0x838b('0xb')](_0x838b('0xc'),_0x2d3e96,_0x838b('0xd'),JSON[_0x838b('0xe')](_0x31ba84));if(_0x31ba84[_0x838b('0xf')]){if(_0x31ba84[_0x838b('0xf')]['code']===0x1f4){logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);return _0x552245(_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);}logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')]['message']);return _0x4b9530(_0x31ba84[_0x838b('0xf')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x2d3e96,_0x838b('0xd'));_0x4b9530(_0x31ba84[_0x838b('0x11')][_0x838b('0x10')]);}})[_0x838b('0x12')](function(_0x94e893){logger['error'](_0x838b('0xa'),_0x2d3e96,_0x94e893);_0x552245(_0x94e893);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index cfd7f87..8fe2acc 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 _0x89fe=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x89fe,0x83));var _0xe89f=function(_0x7af9db,_0x4f1dd6){_0x7af9db=_0x7af9db-0x0;var _0x5d901e=_0x89fe[_0x7af9db];return _0x5d901e;};'use strict';var multer=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var path=require(_0xe89f('0x2'));var timeout=require(_0xe89f('0x3'));var express=require('express');var router=express[_0xe89f('0x4')]();var fs_extra=require(_0xe89f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe89f('0x6'));var config=require(_0xe89f('0x7'));var controller=require(_0xe89f('0x8'));router[_0xe89f('0x9')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0xb')]);router[_0xe89f('0x9')]('/:id',auth[_0xe89f('0xa')](),controller[_0xe89f('0xc')]);router[_0xe89f('0x9')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['getConditions']);router[_0xe89f('0x9')](_0xe89f('0xe'),auth[_0xe89f('0xa')](),controller[_0xe89f('0xf')]);router[_0xe89f('0x10')]('/',auth[_0xe89f('0xa')](),controller[_0xe89f('0x11')]);router[_0xe89f('0x10')](_0xe89f('0xd'),auth[_0xe89f('0xa')](),controller['addConditions']);router['post']('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0xe89f('0x12')](_0xe89f('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xe89f('0x14')](_0xe89f('0x13'),auth[_0xe89f('0xa')](),controller[_0xe89f('0x15')]);module[_0xe89f('0x16')]=router; \ No newline at end of file +var _0xd405=['/:id/conditions','addActions','put','update','delete','destroy','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create'];(function(_0xaa7de4,_0x517895){var _0x1988da=function(_0x2d5a5b){while(--_0x2d5a5b){_0xaa7de4['push'](_0xaa7de4['shift']());}};_0x1988da(++_0x517895);}(_0xd405,0x1d2));var _0x5d40=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xd405[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5d40('0x0'));var router=express[_0x5d40('0x1')]();var fs_extra=require(_0x5d40('0x2'));var auth=require(_0x5d40('0x3'));var interaction=require(_0x5d40('0x4'));var config=require(_0x5d40('0x5'));var controller=require(_0x5d40('0x6'));router[_0x5d40('0x7')]('/',auth['isAuthenticated'](),controller[_0x5d40('0x8')]);router['get'](_0x5d40('0x9'),auth[_0x5d40('0xa')](),controller[_0x5d40('0xb')]);router[_0x5d40('0x7')]('/:id/conditions',auth[_0x5d40('0xa')](),controller[_0x5d40('0xc')]);router[_0x5d40('0x7')](_0x5d40('0xd'),auth[_0x5d40('0xa')](),controller[_0x5d40('0xe')]);router[_0x5d40('0xf')]('/',auth[_0x5d40('0xa')](),controller[_0x5d40('0x10')]);router['post'](_0x5d40('0x11'),auth['isAuthenticated'](),controller['addConditions']);router[_0x5d40('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x5d40('0x12')]);router[_0x5d40('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5d40('0x14')]);router[_0x5d40('0x15')]('/:id',auth[_0x5d40('0xa')](),controller[_0x5d40('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 51d2fe5..f179781 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 _0x723c=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x723c,0x1ad));var _0xc723=function(_0x17b83f,_0x6f1d6){_0x17b83f=_0x17b83f-0x0;var _0x184af4=_0x723c[_0x17b83f];return _0x184af4;};'use strict';var Sequelize=require('sequelize');module[_0xc723('0x0')]={'name':{'type':Sequelize[_0xc723('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc723('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xc723('0x3')},'description':{'type':Sequelize[_0xc723('0x1')]},'active':{'type':Sequelize[_0xc723('0x4')],'defaultValue':0x0,'comment':_0xc723('0x5')},'limitCalls':{'type':Sequelize[_0xc723('0x6')](0x4)[_0xc723('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc723('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc723('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc723('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'comment':_0xc723('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc723('0xf')},'dialTimezone':{'type':Sequelize[_0xc723('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc723('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc723('0x11'),_0xc723('0x12')),'defaultValue':_0xc723('0x13')},'dialAMDActive':{'type':Sequelize[_0xc723('0x4')],'defaultValue':0x0,'comment':_0xc723('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc723('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc723('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc723('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc723('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc723('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc723('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc723('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc723('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc723('0x6')](0x9)[_0xc723('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc723('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc723('0x2')]('DESC',_0xc723('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xc723('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc723('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc723('0x6')](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc723('0x6')](0x3)[_0xc723('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc723('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc723('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xa936=['name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING'];(function(_0x48ac7f,_0xb8ec44){var _0x50a9b6=function(_0x46d1fa){while(--_0x46d1fa){_0x48ac7f['push'](_0x48ac7f['shift']());}};_0x50a9b6(++_0xb8ec44);}(_0xa936,0x107));var _0x6a93=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa936[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6a93('0x0')],'unique':_0x6a93('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6a93('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x6a93('0x3')},'description':{'type':Sequelize[_0x6a93('0x0')]},'active':{'type':Sequelize[_0x6a93('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x6a93('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6a93('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6a93('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6a93('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x6a93('0x2')](_0x6a93('0xe'),_0x6a93('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6a93('0x4')],'defaultValue':0x0,'comment':_0x6a93('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6a93('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6a93('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6a93('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x6a93('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6a93('0x5')](0x9)[_0x6a93('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6a93('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6a93('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6a93('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6a93('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x6a93('0x17'),_0x6a93('0x18')),'defaultValue':_0x6a93('0x17')},'dialPrefix':{'type':Sequelize[_0x6a93('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6a93('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)[_0x6a93('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6a93('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6a93('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6a93('0x5')](0x5)[_0x6a93('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 887bcd2..43875ce 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 _0xf53d=['end','sendStatus','stack','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','order','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','error','getHoppers','findOne','nolimit','sort','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','NOW()','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','IvrCampaigns','UserProfileResource','status'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf53d,0x199));var _0xdf53=function(_0x508083,_0x1e53c6){_0x508083=_0x508083-0x0;var _0x5d5912=_0xf53d[_0x508083];return _0x5d5912;};'use strict';var emlformat=require(_0xdf53('0x0'));var rimraf=require(_0xdf53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf53('0x2'));var rp=require(_0xdf53('0x3'));var moment=require(_0xdf53('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf53('0x5'));var util=require('util');var path=require(_0xdf53('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf53('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdf53('0x8'));var squel=require(_0xdf53('0x9'));var crypto=require(_0xdf53('0xa'));var jsforce=require(_0xdf53('0xb'));var deskjs=require(_0xdf53('0xc'));var toCsv=require(_0xdf53('0xd'));var querystring=require(_0xdf53('0xe'));var Papa=require(_0xdf53('0xf'));var Redis=require('ioredis');var authService=require(_0xdf53('0x10'));var qs=require(_0xdf53('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf53('0x12'));var logger=require('../../config/logger')(_0xdf53('0x13'));var utils=require(_0xdf53('0x14'));var config=require(_0xdf53('0x15'));var licenseUtil=require(_0xdf53('0x16'));var db=require(_0xdf53('0x17'))['db'];function respondWithStatusCode(_0x336304,_0x4c1eee){_0x4c1eee=_0x4c1eee||0xcc;return function(_0x4082e3){if(_0x4082e3){return _0x336304['sendStatus'](_0x4c1eee);}return _0x336304['status'](_0x4c1eee)['end']();};}function respondWithResult(_0x433315,_0x25f7c3){_0x25f7c3=_0x25f7c3||0xc8;return function(_0x1cca6c){if(_0x1cca6c){return _0x433315['status'](_0x25f7c3)[_0xdf53('0x18')](_0x1cca6c);}};}function respondWithFilteredResult(_0x3f24f3,_0x2476ee){return function(_0x174b19){if(_0x174b19){var _0x22deb2=typeof _0x2476ee[_0xdf53('0x19')]===_0xdf53('0x1a')&&typeof _0x2476ee[_0xdf53('0x1b')]===_0xdf53('0x1a');var _0x5965a3=_0x174b19[_0xdf53('0x1c')];var _0x92b79f=_0x22deb2?0x0:_0x2476ee['offset'];var _0x340176=_0x22deb2?_0x174b19['count']:_0x2476ee[_0xdf53('0x19')]+_0x2476ee[_0xdf53('0x1b')];var _0x1040ac;if(_0x340176>=_0x5965a3){_0x340176=_0x5965a3;_0x1040ac=0xc8;}else{_0x1040ac=0xce;}_0x3f24f3['status'](_0x1040ac);return _0x3f24f3[_0xdf53('0x1d')](_0xdf53('0x1e'),_0x92b79f+'-'+_0x340176+'/'+_0x5965a3)[_0xdf53('0x18')](_0x174b19);}return null;};}function patchUpdates(_0x4edc1f){return function(_0x4a381b){try{jsonpatch['apply'](_0x4a381b,_0x4edc1f,!![]);}catch(_0x528861){return BPromise[_0xdf53('0x1f')](_0x528861);}return _0x4a381b['save']();};}function saveUpdates(_0x1e003d,_0x21cc09){return function(_0x213703){if(_0x213703){return _0x213703[_0xdf53('0x20')](_0x1e003d)[_0xdf53('0x21')](function(_0xd5f7f8){return _0xd5f7f8;});}return null;};}function removeEntity(_0x433622,_0x5b0303){return function(_0x3fa668){if(_0x3fa668){return _0x3fa668[_0xdf53('0x22')]()[_0xdf53('0x21')](function(){var _0x260cb3=_0x3fa668['get']({'plain':!![]});var _0x35a387=_0xdf53('0x23');return db[_0xdf53('0x24')][_0xdf53('0x22')]({'where':{'type':_0x35a387,'resourceId':_0x260cb3['id']}})[_0xdf53('0x21')](function(){return _0x3fa668;});})[_0xdf53('0x21')](function(){_0x433622[_0xdf53('0x25')](0xcc)[_0xdf53('0x26')]();});}};}function handleEntityNotFound(_0x159942,_0x2e023c){return function(_0x19928f){if(!_0x19928f){_0x159942[_0xdf53('0x27')](0x194);}return _0x19928f;};}function handleError(_0x413c3d,_0x344ab4){_0x344ab4=_0x344ab4||0x1f4;return function(_0x1ed29a){logger['error'](_0x1ed29a[_0xdf53('0x28')]);if(_0x1ed29a['name']){delete _0x1ed29a['name'];}_0x413c3d[_0xdf53('0x25')](_0x344ab4)[_0xdf53('0x29')](_0x1ed29a);};}exports[_0xdf53('0x2a')]=function(_0x442d88,_0x2754dd){var _0x3e8363={},_0x2ad1d4={},_0x18a805={'count':0x0,'rows':[]};var _0x52ef02=_[_0xdf53('0x2b')](db[_0xdf53('0x2c')][_0xdf53('0x2d')],function(_0x1268a7){return{'name':_0x1268a7[_0xdf53('0x2e')],'type':_0x1268a7[_0xdf53('0x2f')][_0xdf53('0x30')]};});_0x2ad1d4[_0xdf53('0x31')]=_[_0xdf53('0x2b')](_0x52ef02,_0xdf53('0x32'));_0x2ad1d4[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x442d88[_0xdf53('0x33')]);_0x2ad1d4[_0xdf53('0x35')]=_['intersection'](_0x2ad1d4[_0xdf53('0x31')],_0x2ad1d4['query']);_0x3e8363[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x2ad1d4['model'],qs[_0xdf53('0x38')](_0x442d88['query'][_0xdf53('0x38')]));_0x3e8363['attributes']=_0x3e8363[_0xdf53('0x36')][_0xdf53('0x39')]?_0x3e8363[_0xdf53('0x36')]:_0x2ad1d4['model'];if(!_0x442d88[_0xdf53('0x33')]['hasOwnProperty']('nolimit')){_0x3e8363[_0xdf53('0x1b')]=qs['limit'](_0x442d88['query'][_0xdf53('0x1b')]);_0x3e8363[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x442d88[_0xdf53('0x33')]['offset']);}_0x3e8363[_0xdf53('0x3a')]=qs['sort'](_0x442d88[_0xdf53('0x33')]['sort']);_0x3e8363[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_['pick'](_0x442d88[_0xdf53('0x33')],_0x2ad1d4[_0xdf53('0x35')]),_0x52ef02);if(_0x442d88[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x3e8363[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x3e8363[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x52ef02,function(_0x2f81f5){if(_0x2f81f5[_0xdf53('0x2f')]!==_0xdf53('0x3e')){var _0x33bd35={};_0x33bd35[_0x2f81f5['name']]={'$like':'%'+_0x442d88[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x33bd35;}})});}_0x3e8363=_[_0xdf53('0x3d')]({},_0x3e8363,_0x442d88[_0xdf53('0x3f')]);var _0x28ec41={'where':_0x3e8363[_0xdf53('0x3b')]};return db[_0xdf53('0x2c')][_0xdf53('0x1c')](_0x28ec41)['then'](function(_0x491704){_0x18a805[_0xdf53('0x1c')]=_0x491704;if(_0x442d88[_0xdf53('0x33')]['includeAll']){_0x3e8363['include']=[{'all':!![]}];}return db[_0xdf53('0x2c')][_0xdf53('0x40')](_0x3e8363);})['then'](function(_0x296362){_0x18a805[_0xdf53('0x41')]=_0x296362;return _0x18a805;})[_0xdf53('0x21')](respondWithFilteredResult(_0x2754dd,_0x3e8363))[_0xdf53('0x42')](handleError(_0x2754dd,null));};exports['show']=function(_0x2977a9,_0x289434){var _0x1bf714={'raw':![],'where':{'id':_0x2977a9[_0xdf53('0x43')]['id']}},_0x16e3be={};_0x16e3be[_0xdf53('0x31')]=_['keys'](db['Campaign'][_0xdf53('0x2d')]);_0x16e3be['query']=_['keys'](_0x2977a9[_0xdf53('0x33')]);_0x16e3be[_0xdf53('0x35')]=_['intersection'](_0x16e3be[_0xdf53('0x31')],_0x16e3be[_0xdf53('0x33')]);_0x1bf714[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x16e3be['model'],qs[_0xdf53('0x38')](_0x2977a9[_0xdf53('0x33')][_0xdf53('0x38')]));_0x1bf714['attributes']=_0x1bf714[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1bf714['attributes']:_0x16e3be['model'];if(_0x2977a9['query'][_0xdf53('0x44')]){_0x1bf714[_0xdf53('0x45')]=[{'all':!![]}];}_0x1bf714=_[_0xdf53('0x3d')]({},_0x1bf714,_0x2977a9[_0xdf53('0x3f')]);return db[_0xdf53('0x2c')][_0xdf53('0x46')](_0x1bf714)[_0xdf53('0x21')](handleEntityNotFound(_0x289434,null))['then'](respondWithResult(_0x289434,null))['catch'](handleError(_0x289434,null));};exports[_0xdf53('0x47')]=function(_0x37f56c,_0x11e94c){return db[_0xdf53('0x2c')][_0xdf53('0x47')](_0x37f56c[_0xdf53('0x48')],{})[_0xdf53('0x21')](function(_0xe28459){var _0x233457=_0x37f56c[_0xdf53('0x49')][_0xdf53('0x4a')]({'plain':!![]});if(!_0x233457)throw new Error(_0xdf53('0x4b'));if(_0x233457[_0xdf53('0x4c')]===_0xdf53('0x49')){var _0x3808fd=_0xe28459[_0xdf53('0x4a')]({'plain':!![]});var _0x3371b5=_0xdf53('0x23');return db[_0xdf53('0x4d')]['find']({'where':{'name':_0x3371b5,'userProfileId':_0x233457[_0xdf53('0x4e')]},'raw':!![]})[_0xdf53('0x21')](function(_0x239494){if(_0x239494&&_0x239494['autoAssociation']===0x0){return db[_0xdf53('0x24')][_0xdf53('0x47')]({'name':_0x3808fd['name'],'resourceId':_0x3808fd['id'],'type':_0x239494[_0xdf53('0x32')],'sectionId':_0x239494['id']},{})['then'](function(){return _0xe28459;});}else{return _0xe28459;}})[_0xdf53('0x42')](function(_0x33853b){logger['error'](_0xdf53('0x4f'),_0x33853b);throw _0x33853b;});}return _0xe28459;})[_0xdf53('0x21')](respondWithResult(_0x11e94c,0xc9))[_0xdf53('0x42')](handleError(_0x11e94c,null));};exports[_0xdf53('0x50')]=function(_0x1cbef5,_0x81150d){var _0x2274b5={'where':{'id':_0x1cbef5['params']['id']}},_0x2fdef4={};_0x2fdef4['model']=_[_0xdf53('0x34')](db[_0xdf53('0x2c')][_0xdf53('0x2d')]);_0x2274b5[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x2fdef4['model'],qs['fields'](_0x1cbef5['query'][_0xdf53('0x38')]));_0x2274b5['attributes']=_0x2274b5[_0xdf53('0x36')][_0xdf53('0x39')]?_0x2274b5[_0xdf53('0x36')]:_0x2fdef4[_0xdf53('0x31')];if(_0x1cbef5[_0xdf53('0x33')][_0xdf53('0x44')]){_0x2274b5[_0xdf53('0x45')]=[{'all':!![]}];}_0x2274b5=_[_0xdf53('0x3d')]({},_0x2274b5,_0x1cbef5[_0xdf53('0x3f')]);return db[_0xdf53('0x2c')][_0xdf53('0x46')](_0x2274b5)[_0xdf53('0x21')](handleEntityNotFound(_0x81150d,null))[_0xdf53('0x21')](function(_0x359e56){if(_0x359e56){var _0x5568b1=_0x359e56[_0xdf53('0x4a')]({'plain':!![]});_0x5568b1=qs[_0xdf53('0x51')](_0x5568b1,['id','createdAt',_0xdf53('0x52')]);_0x1cbef5[_0xdf53('0x48')]=_[_0xdf53('0x51')](_0x1cbef5['body'],['id',_0xdf53('0x53'),_0xdf53('0x52')]);return db[_0xdf53('0x2c')][_0xdf53('0x47')](_[_0xdf53('0x3d')](_0x5568b1,_0x1cbef5[_0xdf53('0x48')]),{'include':_0x1cbef5[_0xdf53('0x33')][_0xdf53('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x46e5ca){var _0x180f5c=_0x1cbef5[_0xdf53('0x49')][_0xdf53('0x4a')]({'plain':!![]});if(!_0x180f5c)throw new Error(_0xdf53('0x4b'));if(_0x180f5c[_0xdf53('0x4c')]==='user'){var _0x47fe92=_0x46e5ca[_0xdf53('0x4a')]({'plain':!![]});var _0x354819='IvrCampaigns';return db[_0xdf53('0x4d')][_0xdf53('0x46')]({'where':{'name':_0x354819,'userProfileId':_0x180f5c[_0xdf53('0x4e')]},'raw':!![]})['then'](function(_0x4dc662){if(_0x4dc662&&_0x4dc662[_0xdf53('0x54')]===0x0){return db[_0xdf53('0x24')][_0xdf53('0x47')]({'name':_0x47fe92['name'],'resourceId':_0x47fe92['id'],'type':_0x4dc662[_0xdf53('0x32')],'sectionId':_0x4dc662['id']},{})['then'](function(){return _0x46e5ca;});}else{return _0x46e5ca;}})[_0xdf53('0x42')](function(_0xfcc470){logger[_0xdf53('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfcc470);throw _0xfcc470;});}return _0x46e5ca;});}})['then'](respondWithResult(_0x81150d,0xc9))[_0xdf53('0x42')](handleError(_0x81150d,null));};exports['update']=function(_0x25ff8b,_0x4a2039){if(_0x25ff8b['body']['id']){delete _0x25ff8b['body']['id'];}return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x25ff8b[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x4a2039,null))['then'](saveUpdates(_0x25ff8b[_0xdf53('0x48')],null))[_0xdf53('0x21')](respondWithResult(_0x4a2039,null))[_0xdf53('0x42')](handleError(_0x4a2039,null));};exports[_0xdf53('0x22')]=function(_0x1153cf,_0x43011c){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x1153cf['params']['id']}})['then'](handleEntityNotFound(_0x43011c,null))[_0xdf53('0x21')](removeEntity(_0x43011c,null))['catch'](handleError(_0x43011c,null));};exports[_0xdf53('0x56')]=function(_0x23be71,_0x33a653,_0x352c5b){var _0x1b8323={'raw':!![],'where':{}};var _0x1dbf59={};var _0x1476cf={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x23be71[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x33a653,null))[_0xdf53('0x21')](function(_0x5c8ae9){if(_0x5c8ae9){_0x1dbf59[_0xdf53('0x31')]=_[_0xdf53('0x34')](db['CmHopper'][_0xdf53('0x2d')]);_0x1dbf59[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x23be71['query']);_0x1dbf59[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x1dbf59[_0xdf53('0x31')],_0x1dbf59['query']);_0x1b8323[_0xdf53('0x36')]=_['intersection'](_0x1dbf59['model'],qs[_0xdf53('0x38')](_0x23be71[_0xdf53('0x33')]['fields']));_0x1b8323['attributes']=_0x1b8323[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1b8323[_0xdf53('0x36')]:_0x1dbf59[_0xdf53('0x31')];if(!_0x23be71[_0xdf53('0x33')]['hasOwnProperty'](_0xdf53('0x58'))){_0x1b8323[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0x23be71[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x1b8323['offset']=qs[_0xdf53('0x19')](_0x23be71[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x1b8323[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x23be71['query']['sort']);_0x1b8323['where']=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x23be71[_0xdf53('0x33')],_0x1dbf59[_0xdf53('0x35')]));_0x1b8323['where'][_0xdf53('0x5b')]=_0x5c8ae9['id'];if(_0x23be71[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x1b8323[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x1b8323[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x1b8323[_0xdf53('0x36')],function(_0x51a6ea){var _0xf3916f={};_0xf3916f[_0x51a6ea]={'$like':'%'+_0x23be71[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0xf3916f;})});}_0x1b8323=_[_0xdf53('0x3d')]({},_0x1b8323,_0x23be71['options']);return db[_0xdf53('0x5c')][_0xdf53('0x1c')]({'where':_0x1b8323['where']})[_0xdf53('0x21')](function(_0x49c57d){_0x1476cf[_0xdf53('0x1c')]=_0x49c57d;if(_0x23be71[_0xdf53('0x33')][_0xdf53('0x44')]){_0x1b8323[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x5c')][_0xdf53('0x40')](_0x1b8323);})[_0xdf53('0x21')](function(_0x5ddefb){_0x1476cf[_0xdf53('0x41')]=_0x5ddefb;return _0x1476cf;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x33a653,_0x1b8323))[_0xdf53('0x42')](handleError(_0x33a653,null));};exports[_0xdf53('0x5d')]=function(_0x289733,_0x5578b6,_0x2940ce){var _0x1d7529={'raw':!![],'where':{}};var _0x5d0167={};var _0x5e5caa={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x289733['params']['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x5578b6,null))[_0xdf53('0x21')](function(_0x635ba8){if(_0x635ba8){_0x5d0167[_0xdf53('0x31')]=_['keys'](db['CmHopperHistory'][_0xdf53('0x2d')]);_0x5d0167[_0xdf53('0x33')]=_['keys'](_0x289733[_0xdf53('0x33')]);_0x5d0167[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x5d0167[_0xdf53('0x31')],_0x5d0167[_0xdf53('0x33')]);_0x1d7529['attributes']=_[_0xdf53('0x37')](_0x5d0167[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x289733[_0xdf53('0x33')][_0xdf53('0x38')]));_0x1d7529[_0xdf53('0x36')]=_0x1d7529[_0xdf53('0x36')][_0xdf53('0x39')]?_0x1d7529[_0xdf53('0x36')]:_0x5d0167[_0xdf53('0x31')];if(!_0x289733['query']['hasOwnProperty'](_0xdf53('0x58'))){_0x1d7529[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0x289733[_0xdf53('0x33')]['limit']);_0x1d7529[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x289733[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x1d7529[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x289733[_0xdf53('0x33')][_0xdf53('0x59')]);_0x1d7529['where']=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x289733[_0xdf53('0x33')],_0x5d0167[_0xdf53('0x35')]));_0x1d7529['where'][_0xdf53('0x5b')]=_0x635ba8['id'];if(_0x289733[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x1d7529[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x1d7529[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x1d7529[_0xdf53('0x36')],function(_0x577d47){var _0x37d776={};_0x37d776[_0x577d47]={'$like':'%'+_0x289733['query'][_0xdf53('0x3c')]+'%'};return _0x37d776;})});}_0x1d7529=_[_0xdf53('0x3d')]({},_0x1d7529,_0x289733[_0xdf53('0x3f')]);return db[_0xdf53('0x5e')]['count']({'where':_0x1d7529[_0xdf53('0x3b')]})[_0xdf53('0x21')](function(_0x4a4a8b){_0x5e5caa[_0xdf53('0x1c')]=_0x4a4a8b;if(_0x289733[_0xdf53('0x33')]['includeAll']){_0x1d7529[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x5e')][_0xdf53('0x40')](_0x1d7529);})[_0xdf53('0x21')](function(_0x3a8bd8){_0x5e5caa[_0xdf53('0x41')]=_0x3a8bd8;return _0x5e5caa;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x5578b6,_0x1d7529))[_0xdf53('0x42')](handleError(_0x5578b6,null));};exports[_0xdf53('0x5f')]=function(_0x3b004b,_0x1ffff0,_0x2149a5){var _0x5e1448={'raw':!![],'where':{}};var _0x391863={};var _0x1c8d09={'count':0x0,'rows':[]};return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x3b004b[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x1ffff0,null))['then'](function(_0x4ae492){if(_0x4ae492){_0x391863[_0xdf53('0x31')]=_['keys'](db[_0xdf53('0x60')][_0xdf53('0x2d')]);_0x391863[_0xdf53('0x33')]=_['keys'](_0x3b004b[_0xdf53('0x33')]);_0x391863[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x391863[_0xdf53('0x31')],_0x391863[_0xdf53('0x33')]);_0x5e1448[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x391863[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x3b004b[_0xdf53('0x33')]['fields']));_0x5e1448[_0xdf53('0x36')]=_0x5e1448['attributes'][_0xdf53('0x39')]?_0x5e1448[_0xdf53('0x36')]:_0x391863['model'];if(!_0x3b004b['query'][_0xdf53('0x61')](_0xdf53('0x58'))){_0x5e1448[_0xdf53('0x1b')]=qs['limit'](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x5e1448[_0xdf53('0x19')]=qs['offset'](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x5e1448[_0xdf53('0x3a')]=qs[_0xdf53('0x59')](_0x3b004b[_0xdf53('0x33')][_0xdf53('0x59')]);_0x5e1448[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x3b004b[_0xdf53('0x33')],_0x391863[_0xdf53('0x35')]));_0x5e1448[_0xdf53('0x3b')][_0xdf53('0x5b')]=_0x4ae492['id'];if(_0x3b004b[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x5e1448[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x5e1448[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x5e1448[_0xdf53('0x36')],function(_0x174829){var _0x244527={};_0x244527[_0x174829]={'$like':'%'+_0x3b004b[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x244527;})});}_0x5e1448=_[_0xdf53('0x3d')]({},_0x5e1448,_0x3b004b[_0xdf53('0x3f')]);return db[_0xdf53('0x60')][_0xdf53('0x1c')]({'where':_0x5e1448[_0xdf53('0x3b')]})[_0xdf53('0x21')](function(_0xe4cf76){_0x1c8d09['count']=_0xe4cf76;if(_0x3b004b['query'][_0xdf53('0x44')]){_0x5e1448[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x60')]['findAll'](_0x5e1448);})[_0xdf53('0x21')](function(_0xa61795){_0x1c8d09['rows']=_0xa61795;return _0x1c8d09;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x1ffff0,_0x5e1448))[_0xdf53('0x42')](handleError(_0x1ffff0,null));};exports[_0xdf53('0x62')]=function(_0xae30c9,_0x3474ef,_0x4109d9){var _0x82f676={'raw':!![],'where':{}};var _0x44deef={};var _0x3bbee1={'count':0x0,'rows':[]};return db['Campaign'][_0xdf53('0x57')]({'where':{'id':_0xae30c9[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x3474ef,null))['then'](function(_0x309ede){if(_0x309ede){_0x44deef['model']=_[_0xdf53('0x34')](db['CmHopperBlack'][_0xdf53('0x2d')]);_0x44deef[_0xdf53('0x33')]=_['keys'](_0xae30c9[_0xdf53('0x33')]);_0x44deef[_0xdf53('0x35')]=_['intersection'](_0x44deef[_0xdf53('0x31')],_0x44deef[_0xdf53('0x33')]);_0x82f676[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x44deef[_0xdf53('0x31')],qs['fields'](_0xae30c9['query']['fields']));_0x82f676[_0xdf53('0x36')]=_0x82f676[_0xdf53('0x36')][_0xdf53('0x39')]?_0x82f676[_0xdf53('0x36')]:_0x44deef['model'];if(!_0xae30c9[_0xdf53('0x33')][_0xdf53('0x61')](_0xdf53('0x58'))){_0x82f676[_0xdf53('0x1b')]=qs[_0xdf53('0x1b')](_0xae30c9['query'][_0xdf53('0x1b')]);_0x82f676['offset']=qs[_0xdf53('0x19')](_0xae30c9[_0xdf53('0x33')][_0xdf53('0x19')]);}_0x82f676[_0xdf53('0x3a')]=qs['sort'](_0xae30c9[_0xdf53('0x33')][_0xdf53('0x59')]);_0x82f676[_0xdf53('0x3b')]=qs['filters'](_[_0xdf53('0x5a')](_0xae30c9[_0xdf53('0x33')],_0x44deef[_0xdf53('0x35')]));_0x82f676['where'][_0xdf53('0x5b')]=_0x309ede['id'];if(_0xae30c9[_0xdf53('0x33')][_0xdf53('0x3c')]){_0x82f676[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x82f676[_0xdf53('0x3b')],{'$or':_['map'](_0x82f676[_0xdf53('0x36')],function(_0x492d3a){var _0x5058b8={};_0x5058b8[_0x492d3a]={'$like':'%'+_0xae30c9[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x5058b8;})});}_0x82f676=_[_0xdf53('0x3d')]({},_0x82f676,_0xae30c9[_0xdf53('0x3f')]);return db[_0xdf53('0x63')][_0xdf53('0x1c')]({'where':_0x82f676[_0xdf53('0x3b')]})['then'](function(_0x3282a7){_0x3bbee1[_0xdf53('0x1c')]=_0x3282a7;if(_0xae30c9[_0xdf53('0x33')][_0xdf53('0x44')]){_0x82f676[_0xdf53('0x45')]=[{'all':!![]}];}return db[_0xdf53('0x63')][_0xdf53('0x40')](_0x82f676);})[_0xdf53('0x21')](function(_0x1690ec){_0x3bbee1['rows']=_0x1690ec;return _0x3bbee1;});}})[_0xdf53('0x21')](respondWithFilteredResult(_0x3474ef,_0x82f676))[_0xdf53('0x42')](handleError(_0x3474ef,null));};exports[_0xdf53('0x64')]=function(_0x3ded4d,_0x514687,_0x7ddf1d){var _0x204712={};var _0x508811={};var _0x2c5455;var _0x5d20ba;return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x3ded4d[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x514687,null))[_0xdf53('0x21')](function(_0x547464){if(_0x547464){_0x2c5455=_0x547464;_0x508811[_0xdf53('0x31')]=_[_0xdf53('0x34')](db[_0xdf53('0x65')][_0xdf53('0x2d')]);_0x508811[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x3ded4d['query']);_0x508811[_0xdf53('0x35')]=_[_0xdf53('0x37')](_0x508811[_0xdf53('0x31')],_0x508811[_0xdf53('0x33')]);_0x204712[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x508811[_0xdf53('0x31')],qs['fields'](_0x3ded4d['query'][_0xdf53('0x38')]));_0x204712[_0xdf53('0x36')]=_0x204712[_0xdf53('0x36')]['length']?_0x204712[_0xdf53('0x36')]:_0x508811[_0xdf53('0x31')];_0x204712['order']=qs['sort'](_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x59')]);_0x204712[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x3ded4d[_0xdf53('0x33')],_0x508811[_0xdf53('0x35')]));if(_0x3ded4d[_0xdf53('0x33')]['filter']){_0x204712[_0xdf53('0x3b')]=_[_0xdf53('0x3d')](_0x204712['where'],{'$or':_[_0xdf53('0x2b')](_0x204712[_0xdf53('0x36')],function(_0x28d0f7){var _0x292f0f={};_0x292f0f[_0x28d0f7]={'$like':'%'+_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x292f0f;})});}_0x204712=_[_0xdf53('0x3d')]({},_0x204712,_0x3ded4d[_0xdf53('0x3f')]);return _0x2c5455[_0xdf53('0x64')](_0x204712);}})['then'](function(_0x580dee){if(_0x580dee){_0x5d20ba=_0x580dee['length'];if(!_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x61')]('nolimit')){_0x204712[_0xdf53('0x1b')]=qs['limit'](_0x3ded4d['query'][_0xdf53('0x1b')]);_0x204712['offset']=qs[_0xdf53('0x19')](_0x3ded4d[_0xdf53('0x33')][_0xdf53('0x19')]);}return _0x2c5455[_0xdf53('0x64')](_0x204712);}})[_0xdf53('0x21')](function(_0x5992e6){if(_0x5992e6){return _0x5992e6?{'count':_0x5d20ba,'rows':_0x5992e6}:null;}})[_0xdf53('0x21')](respondWithResult(_0x514687,null))[_0xdf53('0x42')](handleError(_0x514687,null));};exports[_0xdf53('0x66')]=function(_0x445347,_0x734018,_0x5436e1){var _0x37d8b7,_0x454957;var _0x9d80fe=[];var _0x628a2d=moment()[_0xdf53('0x67')](_0xdf53('0x68'));return db[_0xdf53('0x2c')]['find']({'where':{'id':_0x445347[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x734018,null))[_0xdf53('0x21')](function(_0x46f26f){if(_0x46f26f){_0x454957=_0x46f26f;return _0x46f26f['addLists'](_0x445347[_0xdf53('0x48')][_0xdf53('0x69')],_[_0xdf53('0x51')](_0x445347[_0xdf53('0x48')],[_0xdf53('0x69'),'id'])||{});}return null;})[_0xdf53('0x6a')](function(_0x32fa91){var _0x773016;var _0x418f0b;_0x37d8b7=_0x32fa91||[];var _0x5c1b78=[];if(_0x32fa91){for(var _0x18e54b=0x0;_0x18e54b<_0x32fa91[_0xdf53('0x39')];_0x18e54b+=0x1){var _0x8568af=_0x32fa91[_0x18e54b][_0xdf53('0x4a')]({'plain':!![]});_0x454957[_0xdf53('0x6b')]=_0x445347[_0xdf53('0x48')][_0xdf53('0x6b')]?_0x445347[_0xdf53('0x48')][_0xdf53('0x6b')]:_0x454957[_0xdf53('0x6b')];switch(_0x454957[_0xdf53('0x6b')]){case _0xdf53('0x6c'):_0x773016=squel[_0xdf53('0x6d')]()[_0xdf53('0x6e')](_0xdf53('0x6f'))[_0xdf53('0x70')]([_0xdf53('0x71'),_0xdf53('0x72'),_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel[_0xdf53('0x75')]()[_0xdf53('0x76')]('phone',_0xdf53('0x71'))[_0xdf53('0x76')]('NOW()','scheduledAt')['field']('id',_0xdf53('0x73'))[_0xdf53('0x76')](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),'ListId')['field'](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),'CampaignId')[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27','createdAt')['field']('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xdf53('0x7b'),_0x8568af['CmListId'][_0xdf53('0x78')]())['where'](_0xdf53('0x7c'))[_0xdf53('0x3b')](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()[_0xdf53('0x76')]('COALESCE(calleridnum,\x27\x27)')[_0xdf53('0x79')](_0xdf53('0x7e'))[_0xdf53('0x3b')](_0xdf53('0x7f'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]()))['where'](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()['field']('COALESCE(phone,\x27\x27)')[_0xdf53('0x79')]('cm_hopper')[_0xdf53('0x3b')](_0xdf53('0x7f'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())))[_0xdf53('0x78')]();break;case _0xdf53('0x80'):_0x773016=squel['insert']()[_0xdf53('0x6e')](_0xdf53('0x6f'))[_0xdf53('0x70')](['phone',_0xdf53('0x72'),_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel['select']()[_0xdf53('0x76')](_0xdf53('0x71'),_0xdf53('0x71'))['field'](_0xdf53('0x81'),_0xdf53('0x72'))[_0xdf53('0x76')]('id',_0xdf53('0x73'))[_0xdf53('0x76')](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),'ListId')[_0xdf53('0x76')](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),_0xdf53('0x5b'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x53'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27','updatedAt')[_0xdf53('0x79')](_0xdf53('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xdf53('0x7b'),_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')]())[_0xdf53('0x3b')](_0xdf53('0x7c'))['where'](_0xdf53('0x7d'),squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x82'))[_0xdf53('0x79')](_0xdf53('0x6f'))['where']('CampaignId\x20=\x20?',_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())))[_0xdf53('0x78')]();break;default:_0x773016=squel[_0xdf53('0x6d')]()['into'](_0xdf53('0x6f'))[_0xdf53('0x70')](['phone','scheduledAt',_0xdf53('0x73'),_0xdf53('0x74'),_0xdf53('0x5b'),_0xdf53('0x53'),'updatedAt'],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x71'),'phone')['field'](_0xdf53('0x81'),_0xdf53('0x72'))['field']('id','ContactId')['field'](_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')](),_0xdf53('0x74'))[_0xdf53('0x76')](_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')](),_0xdf53('0x5b'))['field']('\x27'+_0x628a2d+'\x27','createdAt')[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x7a'))['where'](_0xdf53('0x83'))[_0xdf53('0x3b')]('ListId\x20=\x20?',_0x8568af[_0xdf53('0x77')]['toString']())[_0xdf53('0x3b')](_0xdf53('0x7c')))[_0xdf53('0x78')]();}_0x418f0b=squel[_0xdf53('0x6d')]()['into']('cm_hopper_additional_phones')[_0xdf53('0x70')](['cmHopperId',_0xdf53('0x72'),_0xdf53('0x71'),_0xdf53('0x84'),_0xdf53('0x53'),'updatedAt'],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x85'),'id')[_0xdf53('0x76')]('NOW()','scheduledAt')[_0xdf53('0x76')](_0xdf53('0x86'),_0xdf53('0x71'))[_0xdf53('0x76')](_0xdf53('0x87'),_0xdf53('0x84'))['field']('\x27'+_0x628a2d+'\x27',_0xdf53('0x53'))[_0xdf53('0x76')]('\x27'+_0x628a2d+'\x27',_0xdf53('0x52'))[_0xdf53('0x79')](_0xdf53('0x88'),'ci')['join']('cm_hopper','h',_0xdf53('0x89'))[_0xdf53('0x3b')](_0xdf53('0x8a'),_0x8568af[_0xdf53('0x77')][_0xdf53('0x78')]())[_0xdf53('0x3b')](_0xdf53('0x8b'),_0x445347[_0xdf53('0x43')]['id'][_0xdf53('0x78')]())['where'](_0xdf53('0x8c'),_0x628a2d))[_0xdf53('0x78')]();_0x5c1b78[_0xdf53('0x8d')](db[_0xdf53('0x8e')]['query'](_0x773016));_0x9d80fe['push'](db[_0xdf53('0x8e')][_0xdf53('0x33')](_0x418f0b));}return BPromise[_0xdf53('0x8f')](_0x5c1b78);}})[_0xdf53('0x21')](function(){return BPromise[_0xdf53('0x8f')](_0x9d80fe);})[_0xdf53('0x21')](function(){return _0x37d8b7;})['then'](respondWithResult(_0x734018,null))['catch'](handleError(_0x734018,null));};exports[_0xdf53('0x90')]=function(_0x237f24,_0xcc8264,_0x2d2814){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x237f24[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0xcc8264,null))[_0xdf53('0x21')](function(_0x1d86b7){if(_0x1d86b7){return _0x1d86b7[_0xdf53('0x90')](_0x237f24[_0xdf53('0x33')][_0xdf53('0x69')]);}})[_0xdf53('0x21')](function(_0x75373d){if(_0x75373d){return db['CmHopper'][_0xdf53('0x22')]({'where':{'ListId':_0x237f24[_0xdf53('0x33')][_0xdf53('0x69')],'CampaignId':_0x237f24['params']['id']}})[_0xdf53('0x21')](function(){return _0x75373d;});}})[_0xdf53('0x21')](respondWithStatusCode(_0xcc8264,null))['catch'](handleError(_0xcc8264,null));};exports[_0xdf53('0x91')]=function(_0x17115f,_0x56fc63,_0x545168){var _0x4780d1={};var _0x3adad8={};var _0x31d980;var _0x433693;return db[_0xdf53('0x2c')][_0xdf53('0x57')]({'where':{'id':_0x17115f['params']['id']}})['then'](handleEntityNotFound(_0x56fc63,null))['then'](function(_0x2a2dd1){if(_0x2a2dd1){_0x31d980=_0x2a2dd1;_0x3adad8[_0xdf53('0x31')]=_[_0xdf53('0x34')](db[_0xdf53('0x65')][_0xdf53('0x2d')]);_0x3adad8[_0xdf53('0x33')]=_[_0xdf53('0x34')](_0x17115f[_0xdf53('0x33')]);_0x3adad8['filters']=_[_0xdf53('0x37')](_0x3adad8[_0xdf53('0x31')],_0x3adad8[_0xdf53('0x33')]);_0x4780d1[_0xdf53('0x36')]=_['intersection'](_0x3adad8[_0xdf53('0x31')],qs[_0xdf53('0x38')](_0x17115f[_0xdf53('0x33')][_0xdf53('0x38')]));_0x4780d1[_0xdf53('0x36')]=_0x4780d1[_0xdf53('0x36')][_0xdf53('0x39')]?_0x4780d1[_0xdf53('0x36')]:_0x3adad8[_0xdf53('0x31')];_0x4780d1[_0xdf53('0x3a')]=qs['sort'](_0x17115f[_0xdf53('0x33')][_0xdf53('0x59')]);_0x4780d1[_0xdf53('0x3b')]=qs[_0xdf53('0x35')](_[_0xdf53('0x5a')](_0x17115f[_0xdf53('0x33')],_0x3adad8['filters']));if(_0x17115f[_0xdf53('0x33')]['filter']){_0x4780d1[_0xdf53('0x3b')]=_['merge'](_0x4780d1[_0xdf53('0x3b')],{'$or':_[_0xdf53('0x2b')](_0x4780d1['attributes'],function(_0x3a6c80){var _0x5314dc={};_0x5314dc[_0x3a6c80]={'$like':'%'+_0x17115f[_0xdf53('0x33')][_0xdf53('0x3c')]+'%'};return _0x5314dc;})});}_0x4780d1=_[_0xdf53('0x3d')]({},_0x4780d1,_0x17115f[_0xdf53('0x3f')]);return _0x31d980['getBlackLists'](_0x4780d1);}})[_0xdf53('0x21')](function(_0x3c59f2){if(_0x3c59f2){_0x433693=_0x3c59f2[_0xdf53('0x39')];if(!_0x17115f[_0xdf53('0x33')][_0xdf53('0x61')](_0xdf53('0x58'))){_0x4780d1[_0xdf53('0x1b')]=qs['limit'](_0x17115f[_0xdf53('0x33')][_0xdf53('0x1b')]);_0x4780d1[_0xdf53('0x19')]=qs[_0xdf53('0x19')](_0x17115f[_0xdf53('0x33')][_0xdf53('0x19')]);}return _0x31d980[_0xdf53('0x91')](_0x4780d1);}})[_0xdf53('0x21')](function(_0x228172){if(_0x228172){return _0x228172?{'count':_0x433693,'rows':_0x228172}:null;}})[_0xdf53('0x21')](respondWithResult(_0x56fc63,null))['catch'](handleError(_0x56fc63,null));};exports[_0xdf53('0x92')]=function(_0x67a262,_0x5157b,_0x54b0b7){var _0x129100,_0x3886a8;var _0x35912c=[];var _0x3f364f=moment()[_0xdf53('0x67')](_0xdf53('0x68'));return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x67a262[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x5157b,null))['then'](function(_0x5506f1){if(_0x5506f1){_0x3886a8=_0x5506f1;return _0x5506f1[_0xdf53('0x92')](_0x67a262[_0xdf53('0x48')]['ids'],_['omit'](_0x67a262['body'],[_0xdf53('0x69'),'id'])||{});}return null;})[_0xdf53('0x6a')](function(_0x5b23c5){var _0x5a8dca;var _0x4bfb2e;_0x129100=_0x5b23c5||[];var _0x1048bc=[];if(_0x5b23c5){for(var _0x1104b5=0x0;_0x1104b5<_0x5b23c5[_0xdf53('0x39')];_0x1104b5+=0x1){var _0x374990=_0x5b23c5[_0x1104b5][_0xdf53('0x4a')]({'plain':!![]});_0x5a8dca=squel[_0xdf53('0x6d')]()[_0xdf53('0x6e')](_0xdf53('0x93'))[_0xdf53('0x70')](['phone',_0xdf53('0x73'),'ListId',_0xdf53('0x5b'),_0xdf53('0x53'),_0xdf53('0x52')],squel[_0xdf53('0x75')]()[_0xdf53('0x76')](_0xdf53('0x71'),_0xdf53('0x71'))['field']('id','ContactId')[_0xdf53('0x76')](_0x374990[_0xdf53('0x77')][_0xdf53('0x78')](),_0xdf53('0x74'))['field'](_0x67a262[_0xdf53('0x43')]['id']['toString'](),_0xdf53('0x5b'))['field'](_0xdf53('0x81'),_0xdf53('0x53'))['field'](_0xdf53('0x81'),_0xdf53('0x52'))[_0xdf53('0x79')]('cm_contacts')[_0xdf53('0x3b')]('deletedAt\x20IS\x20NULL')[_0xdf53('0x3b')]('ListId\x20=\x20?',_0x374990['CmListId'][_0xdf53('0x78')]())['where'](_0xdf53('0x7c')))[_0xdf53('0x78')]();_0x1048bc[_0xdf53('0x8d')](db[_0xdf53('0x8e')][_0xdf53('0x33')](_0x5a8dca));}return BPromise[_0xdf53('0x8f')](_0x1048bc);}})[_0xdf53('0x21')](function(){return _0x129100;})['then'](respondWithResult(_0x5157b,null))[_0xdf53('0x42')](handleError(_0x5157b,null));};exports[_0xdf53('0x94')]=function(_0x7030fe,_0x149407,_0x40b703){return db[_0xdf53('0x2c')][_0xdf53('0x46')]({'where':{'id':_0x7030fe[_0xdf53('0x43')]['id']}})[_0xdf53('0x21')](handleEntityNotFound(_0x149407,null))['then'](function(_0x1e731d){if(_0x1e731d){return _0x1e731d[_0xdf53('0x94')](_0x7030fe[_0xdf53('0x33')]['ids']);}})[_0xdf53('0x21')](function(_0x5f4931){if(_0x5f4931){return db[_0xdf53('0x63')]['destroy']({'where':{'ListId':_0x7030fe[_0xdf53('0x33')][_0xdf53('0x69')],'CampaignId':_0x7030fe[_0xdf53('0x43')]['id']}})['then'](function(){return _0x5f4931;});}})['then'](respondWithStatusCode(_0x149407,null))[_0xdf53('0x42')](handleError(_0x149407,null));}; \ No newline at end of file +var _0x73f5=['cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','show','params','model','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','autoAssociation','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x73f5,0x1cb));var _0x573f=function(_0x32cc8a,_0x500424){_0x32cc8a=_0x32cc8a-0x0;var _0x5eb4e3=_0x73f5[_0x32cc8a];return _0x5eb4e3;};'use strict';var emlformat=require(_0x573f('0x0'));var rimraf=require(_0x573f('0x1'));var zipdir=require(_0x573f('0x2'));var jsonpatch=require(_0x573f('0x3'));var rp=require('request-promise');var moment=require(_0x573f('0x4'));var BPromise=require(_0x573f('0x5'));var Mustache=require(_0x573f('0x6'));var util=require(_0x573f('0x7'));var path=require(_0x573f('0x8'));var sox=require(_0x573f('0x9'));var csv=require(_0x573f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x573f('0xb'));var _=require('lodash');var squel=require(_0x573f('0xc'));var crypto=require('crypto');var jsforce=require(_0x573f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x573f('0xa'));var querystring=require(_0x573f('0xe'));var Papa=require(_0x573f('0xf'));var Redis=require('ioredis');var authService=require(_0x573f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x573f('0x11'));var hardwareService=require(_0x573f('0x12'));var logger=require(_0x573f('0x13'))(_0x573f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x573f('0x15'))['db'];function respondWithStatusCode(_0x2493f3,_0x11ea43){_0x11ea43=_0x11ea43||0xcc;return function(_0x322304){if(_0x322304){return _0x2493f3[_0x573f('0x16')](_0x11ea43);}return _0x2493f3['status'](_0x11ea43)['end']();};}function respondWithResult(_0x57290c,_0x2718bd){_0x2718bd=_0x2718bd||0xc8;return function(_0x149144){if(_0x149144){return _0x57290c[_0x573f('0x17')](_0x2718bd)['json'](_0x149144);}};}function respondWithFilteredResult(_0x3550bf,_0x544e9f){return function(_0x55d73f){if(_0x55d73f){var _0x51c32d=typeof _0x544e9f[_0x573f('0x18')]===_0x573f('0x19')&&typeof _0x544e9f[_0x573f('0x1a')]===_0x573f('0x19');var _0x3c1584=_0x55d73f['count'];var _0x4de5ef=_0x51c32d?0x0:_0x544e9f[_0x573f('0x18')];var _0x1202c8=_0x51c32d?_0x55d73f[_0x573f('0x1b')]:_0x544e9f['offset']+_0x544e9f[_0x573f('0x1a')];var _0x3d4253;if(_0x1202c8>=_0x3c1584){_0x1202c8=_0x3c1584;_0x3d4253=0xc8;}else{_0x3d4253=0xce;}_0x3550bf[_0x573f('0x17')](_0x3d4253);return _0x3550bf[_0x573f('0x1c')](_0x573f('0x1d'),_0x4de5ef+'-'+_0x1202c8+'/'+_0x3c1584)[_0x573f('0x1e')](_0x55d73f);}return null;};}function patchUpdates(_0x5c4308){return function(_0x77ba9f){try{jsonpatch[_0x573f('0x1f')](_0x77ba9f,_0x5c4308,!![]);}catch(_0x3eebba){return BPromise[_0x573f('0x20')](_0x3eebba);}return _0x77ba9f[_0x573f('0x21')]();};}function saveUpdates(_0x1fd5e4,_0x5f5f48){return function(_0x206e5d){if(_0x206e5d){return _0x206e5d[_0x573f('0x22')](_0x1fd5e4)[_0x573f('0x23')](function(_0x3da73b){return _0x3da73b;});}return null;};}function removeEntity(_0x31dfe8,_0x429f2b){return function(_0x10eda6){if(_0x10eda6){return _0x10eda6[_0x573f('0x24')]()[_0x573f('0x23')](function(){var _0x3acd35=_0x10eda6['get']({'plain':!![]});var _0x50139c=_0x573f('0x25');return db[_0x573f('0x26')]['destroy']({'where':{'type':_0x50139c,'resourceId':_0x3acd35['id']}})['then'](function(){return _0x10eda6;});})[_0x573f('0x23')](function(){_0x31dfe8[_0x573f('0x17')](0xcc)[_0x573f('0x27')]();});}};}function handleEntityNotFound(_0x54ae1a,_0x32c273){return function(_0x146975){if(!_0x146975){_0x54ae1a[_0x573f('0x16')](0x194);}return _0x146975;};}function handleError(_0x253e2c,_0x343296){_0x343296=_0x343296||0x1f4;return function(_0x54eef1){logger[_0x573f('0x28')](_0x54eef1[_0x573f('0x29')]);if(_0x54eef1[_0x573f('0x2a')]){delete _0x54eef1[_0x573f('0x2a')];}_0x253e2c['status'](_0x343296)['send'](_0x54eef1);};}exports[_0x573f('0x2b')]=function(_0x3eb44a,_0x1b2582){var _0x164a4e={},_0x30c1b4={},_0x17ba36={'count':0x0,'rows':[]};var _0x1a43a2=_[_0x573f('0x2c')](db['Campaign'][_0x573f('0x2d')],function(_0x2169aa){return{'name':_0x2169aa[_0x573f('0x2e')],'type':_0x2169aa[_0x573f('0x2f')][_0x573f('0x30')]};});_0x30c1b4['model']=_[_0x573f('0x2c')](_0x1a43a2,_0x573f('0x2a'));_0x30c1b4[_0x573f('0x31')]=_['keys'](_0x3eb44a[_0x573f('0x31')]);_0x30c1b4[_0x573f('0x32')]=_[_0x573f('0x33')](_0x30c1b4['model'],_0x30c1b4[_0x573f('0x31')]);_0x164a4e[_0x573f('0x34')]=_[_0x573f('0x33')](_0x30c1b4['model'],qs['fields'](_0x3eb44a['query'][_0x573f('0x35')]));_0x164a4e['attributes']=_0x164a4e[_0x573f('0x34')]['length']?_0x164a4e[_0x573f('0x34')]:_0x30c1b4['model'];if(!_0x3eb44a[_0x573f('0x31')][_0x573f('0x36')](_0x573f('0x37'))){_0x164a4e[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x3eb44a[_0x573f('0x31')][_0x573f('0x1a')]);_0x164a4e[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x3eb44a[_0x573f('0x31')][_0x573f('0x18')]);}_0x164a4e['order']=qs[_0x573f('0x38')](_0x3eb44a[_0x573f('0x31')]['sort']);_0x164a4e[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x3eb44a[_0x573f('0x31')],_0x30c1b4['filters']),_0x1a43a2);if(_0x3eb44a[_0x573f('0x31')][_0x573f('0x3b')]){_0x164a4e[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x164a4e['where'],{'$or':_['map'](_0x1a43a2,function(_0x29e5a4){if(_0x29e5a4[_0x573f('0x2f')]!==_0x573f('0x3d')){var _0x52d508={};_0x52d508[_0x29e5a4[_0x573f('0x2a')]]={'$like':'%'+_0x3eb44a[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x52d508;}})});}_0x164a4e=_[_0x573f('0x3c')]({},_0x164a4e,_0x3eb44a[_0x573f('0x3e')]);var _0x2b3419={'where':_0x164a4e[_0x573f('0x39')]};return db[_0x573f('0x3f')][_0x573f('0x1b')](_0x2b3419)['then'](function(_0x427126){_0x17ba36['count']=_0x427126;if(_0x3eb44a[_0x573f('0x31')][_0x573f('0x40')]){_0x164a4e[_0x573f('0x41')]=[{'all':!![]}];}return db[_0x573f('0x3f')]['findAll'](_0x164a4e);})['then'](function(_0x2660dc){_0x17ba36[_0x573f('0x42')]=_0x2660dc;return _0x17ba36;})['then'](respondWithFilteredResult(_0x1b2582,_0x164a4e))[_0x573f('0x43')](handleError(_0x1b2582,null));};exports[_0x573f('0x44')]=function(_0xff317f,_0x7537c){var _0xc755c4={'raw':![],'where':{'id':_0xff317f[_0x573f('0x45')]['id']}},_0x38ee04={};_0x38ee04[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x3f')][_0x573f('0x2d')]);_0x38ee04['query']=_[_0x573f('0x47')](_0xff317f['query']);_0x38ee04[_0x573f('0x32')]=_['intersection'](_0x38ee04[_0x573f('0x46')],_0x38ee04['query']);_0xc755c4[_0x573f('0x34')]=_[_0x573f('0x33')](_0x38ee04[_0x573f('0x46')],qs['fields'](_0xff317f[_0x573f('0x31')][_0x573f('0x35')]));_0xc755c4[_0x573f('0x34')]=_0xc755c4[_0x573f('0x34')][_0x573f('0x48')]?_0xc755c4[_0x573f('0x34')]:_0x38ee04[_0x573f('0x46')];if(_0xff317f[_0x573f('0x31')][_0x573f('0x40')]){_0xc755c4[_0x573f('0x41')]=[{'all':!![]}];}_0xc755c4=_['merge']({},_0xc755c4,_0xff317f[_0x573f('0x3e')]);return db[_0x573f('0x3f')]['find'](_0xc755c4)['then'](handleEntityNotFound(_0x7537c,null))['then'](respondWithResult(_0x7537c,null))['catch'](handleError(_0x7537c,null));};exports[_0x573f('0x49')]=function(_0x2ccde3,_0x354a83){return db[_0x573f('0x3f')][_0x573f('0x49')](_0x2ccde3['body'],{})['then'](function(_0x5ccbf9){var _0xbf5d44=_0x2ccde3[_0x573f('0x4a')]['get']({'plain':!![]});if(!_0xbf5d44)throw new Error(_0x573f('0x4b'));if(_0xbf5d44[_0x573f('0x4c')]==='user'){var _0x5d2d97=_0x5ccbf9[_0x573f('0x4d')]({'plain':!![]});var _0x4d2ceb=_0x573f('0x25');return db[_0x573f('0x4e')][_0x573f('0x4f')]({'where':{'name':_0x4d2ceb,'userProfileId':_0xbf5d44[_0x573f('0x50')]},'raw':!![]})['then'](function(_0x2851e2){if(_0x2851e2&&_0x2851e2['autoAssociation']===0x0){return db[_0x573f('0x26')]['create']({'name':_0x5d2d97[_0x573f('0x2a')],'resourceId':_0x5d2d97['id'],'type':_0x2851e2[_0x573f('0x2a')],'sectionId':_0x2851e2['id']},{})[_0x573f('0x23')](function(){return _0x5ccbf9;});}else{return _0x5ccbf9;}})['catch'](function(_0x3ffb02){logger[_0x573f('0x28')](_0x573f('0x51'),_0x3ffb02);throw _0x3ffb02;});}return _0x5ccbf9;})['then'](respondWithResult(_0x354a83,0xc9))['catch'](handleError(_0x354a83,null));};exports[_0x573f('0x52')]=function(_0x35cea3,_0x3a70b1){var _0x1e8162={'where':{'id':_0x35cea3[_0x573f('0x45')]['id']}},_0x1d7c2a={};_0x1d7c2a[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x3f')]['rawAttributes']);_0x1e8162['attributes']=_['intersection'](_0x1d7c2a[_0x573f('0x46')],qs[_0x573f('0x35')](_0x35cea3['query'][_0x573f('0x35')]));_0x1e8162[_0x573f('0x34')]=_0x1e8162[_0x573f('0x34')]['length']?_0x1e8162['attributes']:_0x1d7c2a['model'];if(_0x35cea3[_0x573f('0x31')][_0x573f('0x40')]){_0x1e8162[_0x573f('0x41')]=[{'all':!![]}];}_0x1e8162=_['merge']({},_0x1e8162,_0x35cea3[_0x573f('0x3e')]);return db[_0x573f('0x3f')]['find'](_0x1e8162)[_0x573f('0x23')](handleEntityNotFound(_0x3a70b1,null))[_0x573f('0x23')](function(_0x3da2d6){if(_0x3da2d6){var _0x78b369=_0x3da2d6[_0x573f('0x4d')]({'plain':!![]});_0x78b369=qs[_0x573f('0x53')](_0x78b369,['id',_0x573f('0x54'),_0x573f('0x55')]);_0x35cea3['body']=_[_0x573f('0x53')](_0x35cea3[_0x573f('0x56')],['id',_0x573f('0x54'),_0x573f('0x55')]);return db['Campaign'][_0x573f('0x49')](_[_0x573f('0x3c')](_0x78b369,_0x35cea3[_0x573f('0x56')]),{'include':_0x35cea3['query'][_0x573f('0x40')]?[{'all':!![]}]:undefined})[_0x573f('0x23')](function(_0x24bab6){var _0x298ca8=_0x35cea3[_0x573f('0x4a')]['get']({'plain':!![]});if(!_0x298ca8)throw new Error(_0x573f('0x4b'));if(_0x298ca8[_0x573f('0x4c')]===_0x573f('0x4a')){var _0x52b8f8=_0x24bab6[_0x573f('0x4d')]({'plain':!![]});var _0x17192b=_0x573f('0x25');return db[_0x573f('0x4e')][_0x573f('0x4f')]({'where':{'name':_0x17192b,'userProfileId':_0x298ca8[_0x573f('0x50')]},'raw':!![]})[_0x573f('0x23')](function(_0x17c120){if(_0x17c120&&_0x17c120[_0x573f('0x57')]===0x0){return db[_0x573f('0x26')][_0x573f('0x49')]({'name':_0x52b8f8[_0x573f('0x2a')],'resourceId':_0x52b8f8['id'],'type':_0x17c120['name'],'sectionId':_0x17c120['id']},{})[_0x573f('0x23')](function(){return _0x24bab6;});}else{return _0x24bab6;}})[_0x573f('0x43')](function(_0x481a78){logger[_0x573f('0x28')](_0x573f('0x51'),_0x481a78);throw _0x481a78;});}return _0x24bab6;});}})[_0x573f('0x23')](respondWithResult(_0x3a70b1,0xc9))['catch'](handleError(_0x3a70b1,null));};exports['update']=function(_0xa94d6a,_0x479e91){if(_0xa94d6a[_0x573f('0x56')]['id']){delete _0xa94d6a[_0x573f('0x56')]['id'];}return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0xa94d6a[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x479e91,null))[_0x573f('0x23')](saveUpdates(_0xa94d6a[_0x573f('0x56')],null))[_0x573f('0x23')](respondWithResult(_0x479e91,null))[_0x573f('0x43')](handleError(_0x479e91,null));};exports[_0x573f('0x24')]=function(_0x56510d,_0x29f6cf){return db[_0x573f('0x3f')]['find']({'where':{'id':_0x56510d[_0x573f('0x45')]['id']}})['then'](handleEntityNotFound(_0x29f6cf,null))[_0x573f('0x23')](removeEntity(_0x29f6cf,null))[_0x573f('0x43')](handleError(_0x29f6cf,null));};exports['getHoppers']=function(_0x1b79c3,_0x3d0895,_0x165c06){var _0x563c07={'raw':!![],'where':{}};var _0x490af5={};var _0x5e78c7={'count':0x0,'rows':[]};return db['Campaign'][_0x573f('0x58')]({'where':{'id':_0x1b79c3[_0x573f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d0895,null))[_0x573f('0x23')](function(_0x3bb905){if(_0x3bb905){_0x490af5[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x59')][_0x573f('0x2d')]);_0x490af5['query']=_['keys'](_0x1b79c3[_0x573f('0x31')]);_0x490af5['filters']=_[_0x573f('0x33')](_0x490af5[_0x573f('0x46')],_0x490af5[_0x573f('0x31')]);_0x563c07[_0x573f('0x34')]=_[_0x573f('0x33')](_0x490af5[_0x573f('0x46')],qs[_0x573f('0x35')](_0x1b79c3[_0x573f('0x31')]['fields']));_0x563c07[_0x573f('0x34')]=_0x563c07[_0x573f('0x34')][_0x573f('0x48')]?_0x563c07['attributes']:_0x490af5[_0x573f('0x46')];if(!_0x1b79c3[_0x573f('0x31')]['hasOwnProperty'](_0x573f('0x37'))){_0x563c07[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x1b79c3[_0x573f('0x31')]['limit']);_0x563c07[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x1b79c3[_0x573f('0x31')][_0x573f('0x18')]);}_0x563c07['order']=qs[_0x573f('0x38')](_0x1b79c3[_0x573f('0x31')][_0x573f('0x38')]);_0x563c07['where']=qs[_0x573f('0x32')](_['pick'](_0x1b79c3['query'],_0x490af5['filters']));_0x563c07[_0x573f('0x39')][_0x573f('0x5a')]=_0x3bb905['id'];if(_0x1b79c3[_0x573f('0x31')][_0x573f('0x3b')]){_0x563c07[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x563c07[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x563c07[_0x573f('0x34')],function(_0x36008){var _0x2f79ac={};_0x2f79ac[_0x36008]={'$like':'%'+_0x1b79c3[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x2f79ac;})});}_0x563c07=_['merge']({},_0x563c07,_0x1b79c3[_0x573f('0x3e')]);return db[_0x573f('0x59')]['count']({'where':_0x563c07['where']})[_0x573f('0x23')](function(_0x370837){_0x5e78c7[_0x573f('0x1b')]=_0x370837;if(_0x1b79c3[_0x573f('0x31')]['includeAll']){_0x563c07['include']=[{'all':!![]}];}return db[_0x573f('0x59')]['findAll'](_0x563c07);})[_0x573f('0x23')](function(_0x3918c6){_0x5e78c7[_0x573f('0x42')]=_0x3918c6;return _0x5e78c7;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x3d0895,_0x563c07))['catch'](handleError(_0x3d0895,null));};exports[_0x573f('0x5b')]=function(_0x2dd5ea,_0x536f8c,_0x464d41){var _0x290511={'raw':!![],'where':{}};var _0x4121b5={};var _0x5af3da={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x2dd5ea[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x536f8c,null))[_0x573f('0x23')](function(_0x126d7d){if(_0x126d7d){_0x4121b5[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x5c')][_0x573f('0x2d')]);_0x4121b5[_0x573f('0x31')]=_[_0x573f('0x47')](_0x2dd5ea[_0x573f('0x31')]);_0x4121b5[_0x573f('0x32')]=_[_0x573f('0x33')](_0x4121b5[_0x573f('0x46')],_0x4121b5['query']);_0x290511[_0x573f('0x34')]=_['intersection'](_0x4121b5[_0x573f('0x46')],qs[_0x573f('0x35')](_0x2dd5ea[_0x573f('0x31')]['fields']));_0x290511[_0x573f('0x34')]=_0x290511[_0x573f('0x34')][_0x573f('0x48')]?_0x290511[_0x573f('0x34')]:_0x4121b5[_0x573f('0x46')];if(!_0x2dd5ea['query']['hasOwnProperty']('nolimit')){_0x290511[_0x573f('0x1a')]=qs['limit'](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x1a')]);_0x290511[_0x573f('0x18')]=qs['offset'](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x18')]);}_0x290511[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x2dd5ea[_0x573f('0x31')][_0x573f('0x38')]);_0x290511[_0x573f('0x39')]=qs['filters'](_[_0x573f('0x3a')](_0x2dd5ea[_0x573f('0x31')],_0x4121b5[_0x573f('0x32')]));_0x290511['where'][_0x573f('0x5a')]=_0x126d7d['id'];if(_0x2dd5ea[_0x573f('0x31')][_0x573f('0x3b')]){_0x290511[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x290511['where'],{'$or':_['map'](_0x290511[_0x573f('0x34')],function(_0x3724a0){var _0x37915e={};_0x37915e[_0x3724a0]={'$like':'%'+_0x2dd5ea[_0x573f('0x31')]['filter']+'%'};return _0x37915e;})});}_0x290511=_[_0x573f('0x3c')]({},_0x290511,_0x2dd5ea[_0x573f('0x3e')]);return db['CmHopperHistory'][_0x573f('0x1b')]({'where':_0x290511['where']})[_0x573f('0x23')](function(_0x58010e){_0x5af3da['count']=_0x58010e;if(_0x2dd5ea[_0x573f('0x31')][_0x573f('0x40')]){_0x290511['include']=[{'all':!![]}];}return db[_0x573f('0x5c')][_0x573f('0x5e')](_0x290511);})[_0x573f('0x23')](function(_0x134a12){_0x5af3da[_0x573f('0x42')]=_0x134a12;return _0x5af3da;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x536f8c,_0x290511))[_0x573f('0x43')](handleError(_0x536f8c,null));};exports[_0x573f('0x5f')]=function(_0x2be1d8,_0x5464c6,_0x4396ca){var _0x3c4326={'raw':!![],'where':{}};var _0x29edf3={};var _0x3a8cb6={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x2be1d8[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x5464c6,null))[_0x573f('0x23')](function(_0x59bc43){if(_0x59bc43){_0x29edf3['model']=_[_0x573f('0x47')](db[_0x573f('0x60')][_0x573f('0x2d')]);_0x29edf3[_0x573f('0x31')]=_[_0x573f('0x47')](_0x2be1d8[_0x573f('0x31')]);_0x29edf3[_0x573f('0x32')]=_[_0x573f('0x33')](_0x29edf3[_0x573f('0x46')],_0x29edf3[_0x573f('0x31')]);_0x3c4326[_0x573f('0x34')]=_[_0x573f('0x33')](_0x29edf3['model'],qs[_0x573f('0x35')](_0x2be1d8['query']['fields']));_0x3c4326[_0x573f('0x34')]=_0x3c4326[_0x573f('0x34')]['length']?_0x3c4326[_0x573f('0x34')]:_0x29edf3[_0x573f('0x46')];if(!_0x2be1d8[_0x573f('0x31')][_0x573f('0x36')]('nolimit')){_0x3c4326[_0x573f('0x1a')]=qs['limit'](_0x2be1d8[_0x573f('0x31')][_0x573f('0x1a')]);_0x3c4326[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x2be1d8[_0x573f('0x31')]['offset']);}_0x3c4326[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x2be1d8[_0x573f('0x31')]['sort']);_0x3c4326[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x2be1d8[_0x573f('0x31')],_0x29edf3[_0x573f('0x32')]));_0x3c4326[_0x573f('0x39')][_0x573f('0x5a')]=_0x59bc43['id'];if(_0x2be1d8[_0x573f('0x31')][_0x573f('0x3b')]){_0x3c4326[_0x573f('0x39')]=_[_0x573f('0x3c')](_0x3c4326[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x3c4326[_0x573f('0x34')],function(_0x556f72){var _0x73e1ef={};_0x73e1ef[_0x556f72]={'$like':'%'+_0x2be1d8[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x73e1ef;})});}_0x3c4326=_[_0x573f('0x3c')]({},_0x3c4326,_0x2be1d8[_0x573f('0x3e')]);return db[_0x573f('0x60')]['count']({'where':_0x3c4326[_0x573f('0x39')]})[_0x573f('0x23')](function(_0x32b05c){_0x3a8cb6['count']=_0x32b05c;if(_0x2be1d8['query'][_0x573f('0x40')]){_0x3c4326['include']=[{'all':!![]}];}return db[_0x573f('0x60')][_0x573f('0x5e')](_0x3c4326);})[_0x573f('0x23')](function(_0x409367){_0x3a8cb6[_0x573f('0x42')]=_0x409367;return _0x3a8cb6;});}})[_0x573f('0x23')](respondWithFilteredResult(_0x5464c6,_0x3c4326))[_0x573f('0x43')](handleError(_0x5464c6,null));};exports['getHopperBlacks']=function(_0xfc3fc2,_0x3575d8,_0x317837){var _0x128e5e={'raw':!![],'where':{}};var _0xbaa101={};var _0x218690={'count':0x0,'rows':[]};return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0xfc3fc2[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x3575d8,null))[_0x573f('0x23')](function(_0x5085ba){if(_0x5085ba){_0xbaa101[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x61')]['rawAttributes']);_0xbaa101['query']=_['keys'](_0xfc3fc2[_0x573f('0x31')]);_0xbaa101[_0x573f('0x32')]=_[_0x573f('0x33')](_0xbaa101[_0x573f('0x46')],_0xbaa101[_0x573f('0x31')]);_0x128e5e['attributes']=_['intersection'](_0xbaa101['model'],qs[_0x573f('0x35')](_0xfc3fc2[_0x573f('0x31')]['fields']));_0x128e5e[_0x573f('0x34')]=_0x128e5e[_0x573f('0x34')][_0x573f('0x48')]?_0x128e5e[_0x573f('0x34')]:_0xbaa101[_0x573f('0x46')];if(!_0xfc3fc2['query'][_0x573f('0x36')]('nolimit')){_0x128e5e[_0x573f('0x1a')]=qs['limit'](_0xfc3fc2[_0x573f('0x31')][_0x573f('0x1a')]);_0x128e5e[_0x573f('0x18')]=qs[_0x573f('0x18')](_0xfc3fc2['query'][_0x573f('0x18')]);}_0x128e5e[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0xfc3fc2[_0x573f('0x31')]['sort']);_0x128e5e[_0x573f('0x39')]=qs[_0x573f('0x32')](_['pick'](_0xfc3fc2[_0x573f('0x31')],_0xbaa101[_0x573f('0x32')]));_0x128e5e['where'][_0x573f('0x5a')]=_0x5085ba['id'];if(_0xfc3fc2[_0x573f('0x31')][_0x573f('0x3b')]){_0x128e5e[_0x573f('0x39')]=_['merge'](_0x128e5e['where'],{'$or':_[_0x573f('0x2c')](_0x128e5e[_0x573f('0x34')],function(_0xcfe444){var _0x128795={};_0x128795[_0xcfe444]={'$like':'%'+_0xfc3fc2['query'][_0x573f('0x3b')]+'%'};return _0x128795;})});}_0x128e5e=_[_0x573f('0x3c')]({},_0x128e5e,_0xfc3fc2[_0x573f('0x3e')]);return db[_0x573f('0x61')][_0x573f('0x1b')]({'where':_0x128e5e['where']})[_0x573f('0x23')](function(_0x5dc8e3){_0x218690[_0x573f('0x1b')]=_0x5dc8e3;if(_0xfc3fc2[_0x573f('0x31')][_0x573f('0x40')]){_0x128e5e['include']=[{'all':!![]}];}return db[_0x573f('0x61')][_0x573f('0x5e')](_0x128e5e);})[_0x573f('0x23')](function(_0xa72188){_0x218690['rows']=_0xa72188;return _0x218690;});}})['then'](respondWithFilteredResult(_0x3575d8,_0x128e5e))[_0x573f('0x43')](handleError(_0x3575d8,null));};exports[_0x573f('0x62')]=function(_0x41bbc3,_0x56be9d,_0x2f1e26){var _0x13570c={};var _0x18e428={};var _0x3563d2;var _0xe204a8;return db[_0x573f('0x3f')][_0x573f('0x58')]({'where':{'id':_0x41bbc3[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x56be9d,null))[_0x573f('0x23')](function(_0x5d8b54){if(_0x5d8b54){_0x3563d2=_0x5d8b54;_0x18e428[_0x573f('0x46')]=_[_0x573f('0x47')](db[_0x573f('0x63')][_0x573f('0x2d')]);_0x18e428['query']=_['keys'](_0x41bbc3[_0x573f('0x31')]);_0x18e428[_0x573f('0x32')]=_['intersection'](_0x18e428[_0x573f('0x46')],_0x18e428[_0x573f('0x31')]);_0x13570c['attributes']=_[_0x573f('0x33')](_0x18e428[_0x573f('0x46')],qs[_0x573f('0x35')](_0x41bbc3[_0x573f('0x31')]['fields']));_0x13570c[_0x573f('0x34')]=_0x13570c[_0x573f('0x34')][_0x573f('0x48')]?_0x13570c[_0x573f('0x34')]:_0x18e428[_0x573f('0x46')];_0x13570c[_0x573f('0x5d')]=qs[_0x573f('0x38')](_0x41bbc3['query'][_0x573f('0x38')]);_0x13570c[_0x573f('0x39')]=qs[_0x573f('0x32')](_[_0x573f('0x3a')](_0x41bbc3['query'],_0x18e428[_0x573f('0x32')]));if(_0x41bbc3[_0x573f('0x31')][_0x573f('0x3b')]){_0x13570c[_0x573f('0x39')]=_['merge'](_0x13570c[_0x573f('0x39')],{'$or':_['map'](_0x13570c[_0x573f('0x34')],function(_0xcd5358){var _0x28b296={};_0x28b296[_0xcd5358]={'$like':'%'+_0x41bbc3['query'][_0x573f('0x3b')]+'%'};return _0x28b296;})});}_0x13570c=_[_0x573f('0x3c')]({},_0x13570c,_0x41bbc3[_0x573f('0x3e')]);return _0x3563d2[_0x573f('0x62')](_0x13570c);}})[_0x573f('0x23')](function(_0xf32878){if(_0xf32878){_0xe204a8=_0xf32878[_0x573f('0x48')];if(!_0x41bbc3[_0x573f('0x31')][_0x573f('0x36')](_0x573f('0x37'))){_0x13570c[_0x573f('0x1a')]=qs[_0x573f('0x1a')](_0x41bbc3[_0x573f('0x31')][_0x573f('0x1a')]);_0x13570c[_0x573f('0x18')]=qs[_0x573f('0x18')](_0x41bbc3[_0x573f('0x31')][_0x573f('0x18')]);}return _0x3563d2[_0x573f('0x62')](_0x13570c);}})['then'](function(_0x465ac6){if(_0x465ac6){return _0x465ac6?{'count':_0xe204a8,'rows':_0x465ac6}:null;}})[_0x573f('0x23')](respondWithResult(_0x56be9d,null))[_0x573f('0x43')](handleError(_0x56be9d,null));};exports[_0x573f('0x64')]=function(_0x2403a7,_0x332267,_0x2a19da){var _0x224bbf,_0x35454d;var _0x23d4c7=[];var _0x3edbeb=moment()['format'](_0x573f('0x65'));return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0x2403a7[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x332267,null))[_0x573f('0x23')](function(_0x4f68dc){if(_0x4f68dc){_0x35454d=_0x4f68dc;return _0x4f68dc[_0x573f('0x64')](_0x2403a7['body'][_0x573f('0x66')],_['omit'](_0x2403a7[_0x573f('0x56')],['ids','id'])||{});}return null;})['spread'](function(_0x283a08){var _0x45dd87;var _0x2d7348;_0x224bbf=_0x283a08||[];var _0x21ddd8=[];if(_0x283a08){for(var _0x33e6ea=0x0;_0x33e6ea<_0x283a08[_0x573f('0x48')];_0x33e6ea+=0x1){var _0x3f8f63=_0x283a08[_0x33e6ea]['get']({'plain':!![]});_0x35454d[_0x573f('0x67')]=_0x2403a7[_0x573f('0x56')][_0x573f('0x67')]?_0x2403a7[_0x573f('0x56')][_0x573f('0x67')]:_0x35454d[_0x573f('0x67')];switch(_0x35454d[_0x573f('0x67')]){case'always':_0x45dd87=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),'ContactId',_0x573f('0x6e'),_0x573f('0x5a'),_0x573f('0x54'),'updatedAt'],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),_0x573f('0x6c'))['field'](_0x573f('0x71'),'scheduledAt')[_0x573f('0x70')]('id',_0x573f('0x72'))['field'](_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')](),'ListId')[_0x573f('0x70')](_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')](),_0x573f('0x5a'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x54'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x76'))[_0x573f('0x39')](_0x573f('0x77'))[_0x573f('0x39')](_0x573f('0x78'),_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')]())[_0x573f('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x573f('0x39')](_0x573f('0x79'),squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x7a'))[_0x573f('0x75')](_0x573f('0x7b'))[_0x573f('0x39')]('CampaignId\x20=\x20?',_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]()))[_0x573f('0x39')](_0x573f('0x79'),squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x7c'))[_0x573f('0x75')](_0x573f('0x6a'))[_0x573f('0x39')](_0x573f('0x7d'),_0x2403a7['params']['id'][_0x573f('0x74')]())))[_0x573f('0x74')]();break;case _0x573f('0x7e'):_0x45dd87=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),_0x573f('0x72'),'ListId',_0x573f('0x5a'),'createdAt',_0x573f('0x55')],squel[_0x573f('0x6f')]()[_0x573f('0x70')]('phone',_0x573f('0x6c'))[_0x573f('0x70')](_0x573f('0x71'),'scheduledAt')[_0x573f('0x70')]('id','ContactId')[_0x573f('0x70')](_0x3f8f63[_0x573f('0x73')]['toString'](),_0x573f('0x6e'))[_0x573f('0x70')](_0x2403a7[_0x573f('0x45')]['id']['toString'](),_0x573f('0x5a'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','createdAt')['field']('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x573f('0x78'),_0x3f8f63['CmListId']['toString']())[_0x573f('0x39')](_0x573f('0x7f'))[_0x573f('0x39')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x573f('0x70')](_0x573f('0x7c'))[_0x573f('0x75')]('cm_hopper')[_0x573f('0x39')](_0x573f('0x7d'),_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]())))[_0x573f('0x74')]();break;default:_0x45dd87=squel[_0x573f('0x68')]()['into'](_0x573f('0x6a'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x6d'),_0x573f('0x72'),_0x573f('0x6e'),_0x573f('0x5a'),'createdAt','updatedAt'],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),_0x573f('0x6c'))['field']('NOW()',_0x573f('0x6d'))[_0x573f('0x70')]('id','ContactId')[_0x573f('0x70')](_0x3f8f63[_0x573f('0x73')]['toString'](),_0x573f('0x6e'))['field'](_0x2403a7[_0x573f('0x45')]['id']['toString'](),'CampaignId')[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','createdAt')[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27','updatedAt')[_0x573f('0x75')](_0x573f('0x76'))[_0x573f('0x39')]('deletedAt\x20IS\x20NULL')[_0x573f('0x39')](_0x573f('0x78'),_0x3f8f63['CmListId'][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x7f')))[_0x573f('0x74')]();}_0x2d7348=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x80'))[_0x573f('0x6b')]([_0x573f('0x81'),_0x573f('0x6d'),'phone',_0x573f('0x82'),_0x573f('0x54'),_0x573f('0x55')],squel[_0x573f('0x6f')]()['field']('h.id','id')[_0x573f('0x70')]('NOW()',_0x573f('0x6d'))[_0x573f('0x70')](_0x573f('0x83'),_0x573f('0x6c'))[_0x573f('0x70')](_0x573f('0x84'),_0x573f('0x82'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x54'))[_0x573f('0x70')]('\x27'+_0x3edbeb+'\x27',_0x573f('0x55'))[_0x573f('0x75')](_0x573f('0x85'),'ci')[_0x573f('0x86')](_0x573f('0x6a'),'h',_0x573f('0x87'))['where'](_0x573f('0x88'),_0x3f8f63[_0x573f('0x73')][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x89'),_0x2403a7[_0x573f('0x45')]['id'][_0x573f('0x74')]())[_0x573f('0x39')]('h.createdAt\x20=\x20?',_0x3edbeb))['toString']();_0x21ddd8[_0x573f('0x8a')](db[_0x573f('0x8b')]['query'](_0x45dd87));_0x23d4c7[_0x573f('0x8a')](db[_0x573f('0x8b')][_0x573f('0x31')](_0x2d7348));}return BPromise[_0x573f('0x8c')](_0x21ddd8);}})[_0x573f('0x23')](function(){return BPromise['all'](_0x23d4c7);})[_0x573f('0x23')](function(){return _0x224bbf;})['then'](respondWithResult(_0x332267,null))[_0x573f('0x43')](handleError(_0x332267,null));};exports[_0x573f('0x8d')]=function(_0x430a94,_0x2423fe,_0xc60e2c){return db[_0x573f('0x3f')][_0x573f('0x4f')]({'where':{'id':_0x430a94['params']['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x2423fe,null))['then'](function(_0x5b8aae){if(_0x5b8aae){return _0x5b8aae['removeLists'](_0x430a94['query'][_0x573f('0x66')]);}})[_0x573f('0x23')](function(_0xcee634){if(_0xcee634){return db[_0x573f('0x59')]['destroy']({'where':{'ListId':_0x430a94[_0x573f('0x31')][_0x573f('0x66')],'CampaignId':_0x430a94[_0x573f('0x45')]['id']}})[_0x573f('0x23')](function(){return _0xcee634;});}})[_0x573f('0x23')](respondWithStatusCode(_0x2423fe,null))[_0x573f('0x43')](handleError(_0x2423fe,null));};exports[_0x573f('0x8e')]=function(_0x217efc,_0x2837d1,_0xbbf98c){var _0x205171={};var _0x2c2f30={};var _0x2e65a9;var _0x3bbca8;return db[_0x573f('0x3f')]['findOne']({'where':{'id':_0x217efc[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x2837d1,null))[_0x573f('0x23')](function(_0x4e10f8){if(_0x4e10f8){_0x2e65a9=_0x4e10f8;_0x2c2f30[_0x573f('0x46')]=_[_0x573f('0x47')](db['CmList'][_0x573f('0x2d')]);_0x2c2f30['query']=_[_0x573f('0x47')](_0x217efc['query']);_0x2c2f30['filters']=_[_0x573f('0x33')](_0x2c2f30[_0x573f('0x46')],_0x2c2f30[_0x573f('0x31')]);_0x205171[_0x573f('0x34')]=_[_0x573f('0x33')](_0x2c2f30['model'],qs[_0x573f('0x35')](_0x217efc[_0x573f('0x31')][_0x573f('0x35')]));_0x205171['attributes']=_0x205171[_0x573f('0x34')]['length']?_0x205171[_0x573f('0x34')]:_0x2c2f30['model'];_0x205171[_0x573f('0x5d')]=qs['sort'](_0x217efc[_0x573f('0x31')][_0x573f('0x38')]);_0x205171[_0x573f('0x39')]=qs[_0x573f('0x32')](_['pick'](_0x217efc[_0x573f('0x31')],_0x2c2f30['filters']));if(_0x217efc['query'][_0x573f('0x3b')]){_0x205171['where']=_['merge'](_0x205171[_0x573f('0x39')],{'$or':_[_0x573f('0x2c')](_0x205171[_0x573f('0x34')],function(_0x2c530b){var _0x1e18f8={};_0x1e18f8[_0x2c530b]={'$like':'%'+_0x217efc[_0x573f('0x31')][_0x573f('0x3b')]+'%'};return _0x1e18f8;})});}_0x205171=_['merge']({},_0x205171,_0x217efc[_0x573f('0x3e')]);return _0x2e65a9[_0x573f('0x8e')](_0x205171);}})[_0x573f('0x23')](function(_0x41c056){if(_0x41c056){_0x3bbca8=_0x41c056[_0x573f('0x48')];if(!_0x217efc['query'][_0x573f('0x36')](_0x573f('0x37'))){_0x205171[_0x573f('0x1a')]=qs['limit'](_0x217efc[_0x573f('0x31')][_0x573f('0x1a')]);_0x205171['offset']=qs[_0x573f('0x18')](_0x217efc['query'][_0x573f('0x18')]);}return _0x2e65a9[_0x573f('0x8e')](_0x205171);}})[_0x573f('0x23')](function(_0x3855d8){if(_0x3855d8){return _0x3855d8?{'count':_0x3bbca8,'rows':_0x3855d8}:null;}})[_0x573f('0x23')](respondWithResult(_0x2837d1,null))['catch'](handleError(_0x2837d1,null));};exports['addBlackLists']=function(_0x523e0d,_0x4ffd05,_0x19fb3f){var _0x3b0ec9,_0x349964;var _0x5fba85=[];var _0x4f4f4e=moment()[_0x573f('0x8f')](_0x573f('0x65'));return db[_0x573f('0x3f')]['find']({'where':{'id':_0x523e0d[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x4ffd05,null))[_0x573f('0x23')](function(_0x5eff84){if(_0x5eff84){_0x349964=_0x5eff84;return _0x5eff84[_0x573f('0x90')](_0x523e0d[_0x573f('0x56')]['ids'],_['omit'](_0x523e0d['body'],[_0x573f('0x66'),'id'])||{});}return null;})[_0x573f('0x91')](function(_0x32e46d){var _0x1936b1;var _0x47a17c;_0x3b0ec9=_0x32e46d||[];var _0xd840d5=[];if(_0x32e46d){for(var _0x4d1bbe=0x0;_0x4d1bbe<_0x32e46d[_0x573f('0x48')];_0x4d1bbe+=0x1){var _0x1d019e=_0x32e46d[_0x4d1bbe][_0x573f('0x4d')]({'plain':!![]});_0x1936b1=squel[_0x573f('0x68')]()[_0x573f('0x69')](_0x573f('0x92'))[_0x573f('0x6b')]([_0x573f('0x6c'),_0x573f('0x72'),_0x573f('0x6e'),'CampaignId',_0x573f('0x54'),_0x573f('0x55')],squel[_0x573f('0x6f')]()[_0x573f('0x70')](_0x573f('0x6c'),'phone')[_0x573f('0x70')]('id',_0x573f('0x72'))['field'](_0x1d019e[_0x573f('0x73')][_0x573f('0x74')](),_0x573f('0x6e'))[_0x573f('0x70')](_0x523e0d['params']['id'][_0x573f('0x74')](),_0x573f('0x5a'))[_0x573f('0x70')](_0x573f('0x71'),_0x573f('0x54'))[_0x573f('0x70')](_0x573f('0x71'),_0x573f('0x55'))['from'](_0x573f('0x76'))['where'](_0x573f('0x77'))[_0x573f('0x39')](_0x573f('0x78'),_0x1d019e['CmListId'][_0x573f('0x74')]())[_0x573f('0x39')](_0x573f('0x7f')))[_0x573f('0x74')]();_0xd840d5[_0x573f('0x8a')](db[_0x573f('0x8b')][_0x573f('0x31')](_0x1936b1));}return BPromise[_0x573f('0x8c')](_0xd840d5);}})[_0x573f('0x23')](function(){return _0x3b0ec9;})[_0x573f('0x23')](respondWithResult(_0x4ffd05,null))[_0x573f('0x43')](handleError(_0x4ffd05,null));};exports[_0x573f('0x93')]=function(_0x162d57,_0x4b2e4d,_0xe52833){return db['Campaign'][_0x573f('0x4f')]({'where':{'id':_0x162d57[_0x573f('0x45')]['id']}})[_0x573f('0x23')](handleEntityNotFound(_0x4b2e4d,null))[_0x573f('0x23')](function(_0x277321){if(_0x277321){return _0x277321['removeBlackLists'](_0x162d57[_0x573f('0x31')][_0x573f('0x66')]);}})[_0x573f('0x23')](function(_0x56d0d0){if(_0x56d0d0){return db['CmHopperBlack'][_0x573f('0x24')]({'where':{'ListId':_0x162d57[_0x573f('0x31')][_0x573f('0x66')],'CampaignId':_0x162d57[_0x573f('0x45')]['id']}})[_0x573f('0x23')](function(){return _0x56d0d0;});}})[_0x573f('0x23')](respondWithStatusCode(_0x4b2e4d,null))[_0x573f('0x43')](handleError(_0x4b2e4d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 29ecc5a..fd47691 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x442d25,_0x53c66b){var _0x14fb3d=function(_0x9cd927){while(--_0x9cd927){_0x442d25['push'](_0x442d25['shift']());}};_0x14fb3d(++_0x53c66b);}(_0x7a54,0x106));var _0x47a5=function(_0x56b3bb,_0x2a51e4){_0x56b3bb=_0x56b3bb-0x0;var _0x17831e=_0x7a54[_0x56b3bb];return _0x17831e;};'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 +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3c19ca,_0x131d1c){var _0x425bee=function(_0x463ae3){while(--_0x463ae3){_0x3c19ca['push'](_0x3c19ca['shift']());}};_0x425bee(++_0x131d1c);}(_0x7a54,0x106));var _0x47a5=function(_0x1654d1,_0x425511){_0x1654d1=_0x1654d1-0x0;var _0x144d90=_0x7a54[_0x1654d1];return _0x144d90;};'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 07f8611..55964bf 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 _0xa8a8=['Campaign,\x20%s,\x20%s','message','catch','Campaign','findAll','where','options','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa8a8,0xec));var _0x8a8a=function(_0x320d7f,_0x3ac648){_0x320d7f=_0x320d7f-0x0;var _0xf7dc0f=_0xa8a8[_0x320d7f];return _0xf7dc0f;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}exports['GetCampaign']=function(_0x9d55f9){var _0x3d165c=this;return new Promise(function(_0x262ca9,_0x2bce13){return db[_0x8a8a('0x17')][_0x8a8a('0x18')]({'raw':_0x9d55f9['options']?_0x9d55f9['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d55f9['options']?_0x9d55f9['options'][_0x8a8a('0x19')]||null:null,'attributes':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1b')]||null:null,'limit':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1c')]||null:null,'include':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')],function(_0x625c1b){return{'model':db[_0x625c1b[_0x8a8a('0x1f')]],'as':_0x625c1b['as'],'attributes':_0x625c1b['attributes'],'include':_0x625c1b[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x625c1b[_0x8a8a('0x1d')],function(_0x7662e){return{'model':db[_0x7662e[_0x8a8a('0x1f')]],'as':_0x7662e['as'],'attributes':_0x7662e[_0x8a8a('0x1b')],'include':_0x7662e[_0x8a8a('0x1d')]?_['map'](_0x7662e[_0x8a8a('0x1d')],function(_0x38c1e0){return{'model':db[_0x38c1e0[_0x8a8a('0x1f')]],'as':_0x38c1e0['as'],'attributes':_0x38c1e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafcd){logger[_0x8a8a('0xe')]('GetCampaign',_0x9d55f9);logger['debug']('GetCampaign',_0x9d55f9,JSON[_0x8a8a('0x11')](_0x2dafcd));_0x262ca9(_0x2dafcd);})['catch'](function(_0x10b916){logger[_0x8a8a('0x12')]('GetCampaign',_0x10b916[_0x8a8a('0x15')],_0x9d55f9);_0x2bce13(_0x3d165c[_0x8a8a('0x12')](0x1f4,_0x10b916[_0x8a8a('0x15')]));});});}; \ No newline at end of file +var _0xa44a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash'];(function(_0x461a37,_0x56b40e){var _0x2d740b=function(_0x3fd4d9){while(--_0x3fd4d9){_0x461a37['push'](_0x461a37['shift']());}};_0x2d740b(++_0x56b40e);}(_0xa44a,0x9a));var _0xaa44=function(_0x2262e7,_0x1c8a15){_0x2262e7=_0x2262e7-0x0;var _0x45bd84=_0xa44a[_0x2262e7];return _0x45bd84;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa44('0x1'));var rs=require(_0xaa44('0x2'));var fs=require('fs');var Redis=require(_0xaa44('0x3'));var db=require(_0xaa44('0x4'))['db'];var utils=require(_0xaa44('0x5'));var logger=require(_0xaa44('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa44('0x7'));var client=jayson[_0xaa44('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x247589,_0x54b139,_0x3459c5){return new BPromise(function(_0x37cdeb,_0x513d81){return client[_0xaa44('0x9')](_0x247589,_0x3459c5)[_0xaa44('0xa')](function(_0x5f57d4){logger[_0xaa44('0xb')](_0xaa44('0xc'),_0x54b139,_0xaa44('0xd'));logger[_0xaa44('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x54b139,_0xaa44('0xd'),JSON['stringify'](_0x5f57d4));if(_0x5f57d4[_0xaa44('0xf')]){if(_0x5f57d4['error']['code']===0x1f4){logger['error'](_0xaa44('0xc'),_0x54b139,_0x5f57d4[_0xaa44('0xf')][_0xaa44('0x10')]);return _0x513d81(_0x5f57d4['error'][_0xaa44('0x10')]);}logger[_0xaa44('0xf')]('Campaign,\x20%s,\x20%s',_0x54b139,_0x5f57d4['error'][_0xaa44('0x10')]);return _0x37cdeb(_0x5f57d4[_0xaa44('0xf')]['message']);}else{logger['info'](_0xaa44('0xc'),_0x54b139,'request\x20sent');_0x37cdeb(_0x5f57d4[_0xaa44('0x11')]['message']);}})[_0xaa44('0x12')](function(_0x1c1514){logger[_0xaa44('0xf')](_0xaa44('0xc'),_0x54b139,_0x1c1514);_0x513d81(_0x1c1514);});});}exports[_0xaa44('0x13')]=function(_0x4b54cf){var _0x542595=this;return new Promise(function(_0x16fa2c,_0xa2fa67){return db[_0xaa44('0x14')][_0xaa44('0x15')]({'raw':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x17')]===undefined?!![]:![]:!![],'where':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf['options'][_0xaa44('0x18')]||null:null,'attributes':_0x4b54cf['options']?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x19')]||null:null,'limit':_0x4b54cf['options']?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1a')]||null:null,'include':_0x4b54cf[_0xaa44('0x16')]?_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1b')]?_[_0xaa44('0x1c')](_0x4b54cf[_0xaa44('0x16')][_0xaa44('0x1b')],function(_0x17afa1){return{'model':db[_0x17afa1[_0xaa44('0x1d')]],'as':_0x17afa1['as'],'attributes':_0x17afa1['attributes'],'include':_0x17afa1[_0xaa44('0x1b')]?_[_0xaa44('0x1c')](_0x17afa1[_0xaa44('0x1b')],function(_0x39830b){return{'model':db[_0x39830b[_0xaa44('0x1d')]],'as':_0x39830b['as'],'attributes':_0x39830b[_0xaa44('0x19')],'include':_0x39830b[_0xaa44('0x1b')]?_['map'](_0x39830b[_0xaa44('0x1b')],function(_0x2b1941){return{'model':db[_0x2b1941[_0xaa44('0x1d')]],'as':_0x2b1941['as'],'attributes':_0x2b1941[_0xaa44('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12fcca){logger[_0xaa44('0xb')](_0xaa44('0x13'),_0x4b54cf);logger[_0xaa44('0xe')](_0xaa44('0x13'),_0x4b54cf,JSON[_0xaa44('0x1e')](_0x12fcca));_0x16fa2c(_0x12fcca);})[_0xaa44('0x12')](function(_0x2b4e06){logger[_0xaa44('0xf')](_0xaa44('0x13'),_0x2b4e06[_0xaa44('0x10')],_0x4b54cf);_0xa2fa67(_0x542595['error'](0x1f4,_0x2b4e06[_0xaa44('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 39c6e8c..a8d5f98 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 _0x8e18=['/:id/lists','addLists','put','delete','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','post','/:id/clone'];(function(_0x5460c8,_0x312bcc){var _0x2b8bc6=function(_0x5eefff){while(--_0x5eefff){_0x5460c8['push'](_0x5460c8['shift']());}};_0x2b8bc6(++_0x312bcc);}(_0x8e18,0x1ba));var _0x88e1=function(_0x55bc0b,_0x52d197){_0x55bc0b=_0x55bc0b-0x0;var _0x55141d=_0x8e18[_0x55bc0b];return _0x55141d;};'use strict';var multer=require('multer');var util=require(_0x88e1('0x0'));var path=require('path');var timeout=require(_0x88e1('0x1'));var express=require(_0x88e1('0x2'));var router=express[_0x88e1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x88e1('0x4'));var config=require(_0x88e1('0x5'));var controller=require(_0x88e1('0x6'));router[_0x88e1('0x7')]('/',auth[_0x88e1('0x8')](),controller[_0x88e1('0x9')]);router[_0x88e1('0x7')](_0x88e1('0xa'),auth['isAuthenticated'](),controller[_0x88e1('0xb')]);router['get'](_0x88e1('0xc'),auth['isAuthenticated'](),controller[_0x88e1('0xd')]);router[_0x88e1('0x7')]('/:id/hopper_histories',auth[_0x88e1('0x8')](),controller[_0x88e1('0xe')]);router['get'](_0x88e1('0xf'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x10')]);router[_0x88e1('0x7')](_0x88e1('0x11'),auth['isAuthenticated'](),controller[_0x88e1('0x12')]);router[_0x88e1('0x7')]('/:id/lists',auth[_0x88e1('0x8')](),controller['getLists']);router[_0x88e1('0x7')](_0x88e1('0x13'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x14')]);router['post']('/',auth[_0x88e1('0x8')](),controller['create']);router[_0x88e1('0x15')](_0x88e1('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0x88e1('0x15')](_0x88e1('0x17'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x18')]);router[_0x88e1('0x15')](_0x88e1('0x13'),auth[_0x88e1('0x8')](),controller['addBlackLists']);router[_0x88e1('0x19')](_0x88e1('0xa'),auth[_0x88e1('0x8')](),controller['update']);router[_0x88e1('0x1a')](_0x88e1('0xa'),auth[_0x88e1('0x8')](),controller[_0x88e1('0x1b')]);router['delete'](_0x88e1('0x17'),auth['isAuthenticated'](),controller[_0x88e1('0x1c')]);router[_0x88e1('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x88e1('0x1d')]);module[_0x88e1('0x1e')]=router; \ No newline at end of file +var _0x4a52=['post','create','/:id/clone','clone','addLists','/:id/blacklists','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists'];(function(_0x2fbf8f,_0x4720ff){var _0x36f428=function(_0x1c9c79){while(--_0x1c9c79){_0x2fbf8f['push'](_0x2fbf8f['shift']());}};_0x36f428(++_0x4720ff);}(_0x4a52,0x15e));var _0x24a5=function(_0x5201f1,_0x5a01e1){_0x5201f1=_0x5201f1-0x0;var _0x36a73a=_0x4a52[_0x5201f1];return _0x36a73a;};'use strict';var multer=require(_0x24a5('0x0'));var util=require(_0x24a5('0x1'));var path=require(_0x24a5('0x2'));var timeout=require(_0x24a5('0x3'));var express=require(_0x24a5('0x4'));var router=express['Router']();var fs_extra=require(_0x24a5('0x5'));var auth=require(_0x24a5('0x6'));var interaction=require(_0x24a5('0x7'));var config=require(_0x24a5('0x8'));var controller=require(_0x24a5('0x9'));router[_0x24a5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x24a5('0xa')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0xd')]);router['get'](_0x24a5('0xe'),auth[_0x24a5('0xc')](),controller[_0x24a5('0xf')]);router[_0x24a5('0xa')]('/:id/hopper_histories',auth[_0x24a5('0xc')](),controller[_0x24a5('0x10')]);router[_0x24a5('0xa')](_0x24a5('0x11'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x12')]);router['get'](_0x24a5('0x13'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x14')]);router['get'](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x16')]);router['get']('/:id/blacklists',auth[_0x24a5('0xc')](),controller[_0x24a5('0x17')]);router[_0x24a5('0x18')]('/',auth[_0x24a5('0xc')](),controller[_0x24a5('0x19')]);router[_0x24a5('0x18')](_0x24a5('0x1a'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1b')]);router['post'](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1c')]);router[_0x24a5('0x18')](_0x24a5('0x1d'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x24a5('0x1e')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x1f')]);router[_0x24a5('0x20')](_0x24a5('0xb'),auth[_0x24a5('0xc')](),controller[_0x24a5('0x21')]);router[_0x24a5('0x20')](_0x24a5('0x15'),auth[_0x24a5('0xc')](),controller['removeLists']);router[_0x24a5('0x20')](_0x24a5('0x1d'),auth[_0x24a5('0xc')](),controller['removeBlackLists']);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 16cbc6b..a6b04d3 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 _0xd4b4=['exports','STRING','getDataValue','key','sequelize'];(function(_0x9ef996,_0x4be935){var _0x491614=function(_0x362293){while(--_0x362293){_0x9ef996['push'](_0x9ef996['shift']());}};_0x491614(++_0x4be935);}(_0xd4b4,0x176));var _0x4d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4d4b('0x0'));module[_0x4d4b('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4d4b('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4d4b('0x3')](_0x4d4b('0x4'));}}}; \ No newline at end of file +var _0xa683=['getDataValue','exports','TEXT','STRING','VIRTUAL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa683,0x14b));var _0x3a68=function(_0x13973f,_0x4d5e3b){_0x13973f=_0x13973f-0x0;var _0x499f77=_0xa683[_0x13973f];return _0x499f77;};'use strict';var Sequelize=require('sequelize');module[_0x3a68('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3a68('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3a68('0x2')]},'name':{'type':Sequelize[_0x3a68('0x3')],'get':function(){return this[_0x3a68('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7dcd225..d8e6956 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 _0x7261=['attributes','fields','length','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','map','CannedAnswer','fieldName','key','keys','filters','intersection','model','query'];(function(_0x1b9efc,_0x31bb67){var _0x1c9db0=function(_0x4c5a8d){while(--_0x4c5a8d){_0x1b9efc['push'](_0x1b9efc['shift']());}};_0x1c9db0(++_0x31bb67);}(_0x7261,0x176));var _0x1726=function(_0x38941d,_0x1b1b28){_0x38941d=_0x38941d-0x0;var _0x380991=_0x7261[_0x38941d];return _0x380991;};'use strict';var emlformat=require(_0x1726('0x0'));var rimraf=require(_0x1726('0x1'));var zipdir=require(_0x1726('0x2'));var jsonpatch=require(_0x1726('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1726('0x4'));var Mustache=require(_0x1726('0x5'));var util=require(_0x1726('0x6'));var path=require(_0x1726('0x7'));var sox=require('sox');var csv=require(_0x1726('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1726('0x9'));var squel=require(_0x1726('0xa'));var crypto=require(_0x1726('0xb'));var jsforce=require(_0x1726('0xc'));var deskjs=require(_0x1726('0xd'));var toCsv=require(_0x1726('0x8'));var querystring=require(_0x1726('0xe'));var Papa=require(_0x1726('0xf'));var Redis=require(_0x1726('0x10'));var authService=require(_0x1726('0x11'));var qs=require(_0x1726('0x12'));var as=require(_0x1726('0x13'));var hardwareService=require(_0x1726('0x14'));var logger=require(_0x1726('0x15'))(_0x1726('0x16'));var utils=require(_0x1726('0x17'));var config=require(_0x1726('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1726('0x19'))['db'];function respondWithStatusCode(_0x45bd8a,_0x593e0d){_0x593e0d=_0x593e0d||0xcc;return function(_0x2c6b4f){if(_0x2c6b4f){return _0x45bd8a[_0x1726('0x1a')](_0x593e0d);}return _0x45bd8a[_0x1726('0x1b')](_0x593e0d)[_0x1726('0x1c')]();};}function respondWithResult(_0x5bc43e,_0x453c80){_0x453c80=_0x453c80||0xc8;return function(_0x5ca910){if(_0x5ca910){return _0x5bc43e['status'](_0x453c80)[_0x1726('0x1d')](_0x5ca910);}};}function respondWithFilteredResult(_0x5611e7,_0x5e000a){return function(_0x2c580b){if(_0x2c580b){var _0x2f8c93=typeof _0x5e000a[_0x1726('0x1e')]===_0x1726('0x1f')&&typeof _0x5e000a['limit']===_0x1726('0x1f');var _0x9edb8e=_0x2c580b[_0x1726('0x20')];var _0xc453f3=_0x2f8c93?0x0:_0x5e000a[_0x1726('0x1e')];var _0x42b76e=_0x2f8c93?_0x2c580b[_0x1726('0x20')]:_0x5e000a['offset']+_0x5e000a[_0x1726('0x21')];var _0x1cccbd;if(_0x42b76e>=_0x9edb8e){_0x42b76e=_0x9edb8e;_0x1cccbd=0xc8;}else{_0x1cccbd=0xce;}_0x5611e7['status'](_0x1cccbd);return _0x5611e7[_0x1726('0x22')](_0x1726('0x23'),_0xc453f3+'-'+_0x42b76e+'/'+_0x9edb8e)[_0x1726('0x1d')](_0x2c580b);}return null;};}function patchUpdates(_0x1ec974){return function(_0xf56938){try{jsonpatch[_0x1726('0x24')](_0xf56938,_0x1ec974,!![]);}catch(_0x53dae4){return BPromise[_0x1726('0x25')](_0x53dae4);}return _0xf56938[_0x1726('0x26')]();};}function saveUpdates(_0x53e10a,_0x4f9cea){return function(_0x481aa6){if(_0x481aa6){return _0x481aa6[_0x1726('0x27')](_0x53e10a)[_0x1726('0x28')](function(_0x733f42){return _0x733f42;});}return null;};}function removeEntity(_0x2b0202,_0x59a03c){return function(_0x1adeaa){if(_0x1adeaa){return _0x1adeaa['destroy']()[_0x1726('0x28')](function(){var _0x53cc26=_0x1adeaa[_0x1726('0x29')]({'plain':!![]});var _0x5913f9=_0x1726('0x2a');return db[_0x1726('0x2b')][_0x1726('0x2c')]({'where':{'type':_0x5913f9,'resourceId':_0x53cc26['id']}})[_0x1726('0x28')](function(){return _0x1adeaa;});})[_0x1726('0x28')](function(){_0x2b0202[_0x1726('0x1b')](0xcc)[_0x1726('0x1c')]();});}};}function handleEntityNotFound(_0x360b64,_0x4d0bd2){return function(_0x1fbdde){if(!_0x1fbdde){_0x360b64[_0x1726('0x1a')](0x194);}return _0x1fbdde;};}function handleError(_0x5495dc,_0x487bc6){_0x487bc6=_0x487bc6||0x1f4;return function(_0x10d18a){logger['error'](_0x10d18a[_0x1726('0x2d')]);if(_0x10d18a[_0x1726('0x2e')]){delete _0x10d18a[_0x1726('0x2e')];}_0x5495dc[_0x1726('0x1b')](_0x487bc6)['send'](_0x10d18a);};}exports['index']=function(_0x3c5f5e,_0x22c6d8){var _0x57e119={},_0xac904b={},_0x2762cc={'count':0x0,'rows':[]};var _0x658bc0=_[_0x1726('0x2f')](db[_0x1726('0x30')]['rawAttributes'],function(_0x255f9){return{'name':_0x255f9[_0x1726('0x31')],'type':_0x255f9['type'][_0x1726('0x32')]};});_0xac904b['model']=_[_0x1726('0x2f')](_0x658bc0,_0x1726('0x2e'));_0xac904b['query']=_[_0x1726('0x33')](_0x3c5f5e['query']);_0xac904b[_0x1726('0x34')]=_[_0x1726('0x35')](_0xac904b[_0x1726('0x36')],_0xac904b[_0x1726('0x37')]);_0x57e119[_0x1726('0x38')]=_[_0x1726('0x35')](_0xac904b[_0x1726('0x36')],qs[_0x1726('0x39')](_0x3c5f5e[_0x1726('0x37')]['fields']));_0x57e119['attributes']=_0x57e119[_0x1726('0x38')][_0x1726('0x3a')]?_0x57e119[_0x1726('0x38')]:_0xac904b[_0x1726('0x36')];if(!_0x3c5f5e[_0x1726('0x37')]['hasOwnProperty']('nolimit')){_0x57e119[_0x1726('0x21')]=qs[_0x1726('0x21')](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x21')]);_0x57e119[_0x1726('0x1e')]=qs['offset'](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x1e')]);}_0x57e119[_0x1726('0x3b')]=qs[_0x1726('0x3c')](_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3c')]);_0x57e119[_0x1726('0x3d')]=qs[_0x1726('0x34')](_['pick'](_0x3c5f5e[_0x1726('0x37')],_0xac904b[_0x1726('0x34')]),_0x658bc0);if(_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]){_0x57e119['where']=_[_0x1726('0x3f')](_0x57e119[_0x1726('0x3d')],{'$or':[{'key':{'$like':'%'+_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3c5f5e[_0x1726('0x37')][_0x1726('0x3e')]+'%'}}]});}_0x57e119=_[_0x1726('0x3f')]({},_0x57e119,_0x3c5f5e[_0x1726('0x40')]);var _0x32f2e6={'where':_0x57e119['where']};return db[_0x1726('0x30')][_0x1726('0x20')](_0x32f2e6)['then'](function(_0x3440a4){_0x2762cc[_0x1726('0x20')]=_0x3440a4;if(_0x3c5f5e[_0x1726('0x37')][_0x1726('0x41')]){_0x57e119[_0x1726('0x42')]=[{'all':!![]}];}return db[_0x1726('0x30')][_0x1726('0x43')](_0x57e119);})['then'](function(_0x3d4371){_0x2762cc[_0x1726('0x44')]=_0x3d4371;return _0x2762cc;})[_0x1726('0x28')](respondWithFilteredResult(_0x22c6d8,_0x57e119))[_0x1726('0x45')](handleError(_0x22c6d8,null));};exports[_0x1726('0x46')]=function(_0x2015e8,_0x1767aa){var _0x54a170={'raw':!![],'where':{'id':_0x2015e8['params']['id']}},_0x1ed485={};_0x1ed485[_0x1726('0x36')]=_['keys'](db[_0x1726('0x30')][_0x1726('0x47')]);_0x1ed485[_0x1726('0x37')]=_[_0x1726('0x33')](_0x2015e8[_0x1726('0x37')]);_0x1ed485['filters']=_['intersection'](_0x1ed485[_0x1726('0x36')],_0x1ed485[_0x1726('0x37')]);_0x54a170[_0x1726('0x38')]=_[_0x1726('0x35')](_0x1ed485[_0x1726('0x36')],qs['fields'](_0x2015e8[_0x1726('0x37')][_0x1726('0x39')]));_0x54a170[_0x1726('0x38')]=_0x54a170['attributes'][_0x1726('0x3a')]?_0x54a170[_0x1726('0x38')]:_0x1ed485[_0x1726('0x36')];if(_0x2015e8['query']['includeAll']){_0x54a170['include']=[{'all':!![]}];}_0x54a170=_[_0x1726('0x3f')]({},_0x54a170,_0x2015e8[_0x1726('0x40')]);return db[_0x1726('0x30')]['find'](_0x54a170)['then'](handleEntityNotFound(_0x1767aa,null))['then'](respondWithResult(_0x1767aa,null))[_0x1726('0x45')](handleError(_0x1767aa,null));};exports[_0x1726('0x27')]=function(_0x554e84,_0x5d69ae){if(_0x554e84[_0x1726('0x48')]['id']){delete _0x554e84['body']['id'];}return db['CannedAnswer'][_0x1726('0x49')]({'where':{'id':_0x554e84[_0x1726('0x4a')]['id']}})[_0x1726('0x28')](handleEntityNotFound(_0x5d69ae,null))[_0x1726('0x28')](saveUpdates(_0x554e84['body'],null))[_0x1726('0x28')](respondWithResult(_0x5d69ae,null))[_0x1726('0x45')](handleError(_0x5d69ae,null));};exports[_0x1726('0x2c')]=function(_0x37a3c3,_0x424839){return db[_0x1726('0x30')][_0x1726('0x49')]({'where':{'id':_0x37a3c3[_0x1726('0x4a')]['id']}})[_0x1726('0x28')](handleEntityNotFound(_0x424839,null))['then'](removeEntity(_0x424839,null))[_0x1726('0x45')](handleError(_0x424839,null));};exports[_0x1726('0x4b')]=function(_0x114518,_0x272757){var _0x3d0722={'key':_0x114518[_0x1726('0x48')]['key']};if(_0x114518[_0x1726('0x48')][_0x1726('0x4c')]){_0x3d0722[_0x1726('0x4c')]=_0x114518[_0x1726('0x48')][_0x1726('0x4c')];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4d')]){_0x3d0722['SmsAccountId']=_0x114518['body'][_0x1726('0x4d')];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4e')]){_0x3d0722['OpenchannelAccountId']=_0x114518[_0x1726('0x48')]['OpenchannelAccountId'];}else if(_0x114518[_0x1726('0x48')][_0x1726('0x4f')]){_0x3d0722['ChatWebsiteId']=_0x114518[_0x1726('0x48')][_0x1726('0x4f')];}return db[_0x1726('0x30')][_0x1726('0x49')]({'where':_0x3d0722})['then'](function(_0x3a8741){if(_0x3a8741){throw new db['Sequelize']['ValidationError'](_0x1726('0x50'));}return db['CannedAnswer']['create'](_0x114518[_0x1726('0x48')]);})[_0x1726('0x28')](function(_0x1a5075){var _0x35a92d=_0x114518['user']['get']({'plain':!![]});if(!_0x35a92d)throw new Error(_0x1726('0x51'));if(_0x35a92d[_0x1726('0x52')]===_0x1726('0x53')){var _0x250ccb=_0x1a5075[_0x1726('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x1726('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x35a92d['userProfileId']},'raw':!![]})[_0x1726('0x28')](function(_0x172a2f){if(_0x172a2f&&_0x172a2f[_0x1726('0x54')]===0x0){return db[_0x1726('0x2b')]['create']({'name':_0x250ccb[_0x1726('0x2e')],'resourceId':_0x250ccb['id'],'type':_0x172a2f['name'],'sectionId':_0x172a2f['id']},{})[_0x1726('0x28')](function(){return _0x1a5075;});}else{return _0x1a5075;}})['catch'](function(_0x822678){logger['error'](_0x1726('0x55'),_0x822678);throw _0x822678;});}return _0x1a5075;})[_0x1726('0x28')](respondWithResult(_0x272757,0xc9))[_0x1726('0x45')](handleError(_0x272757,null));}; \ No newline at end of file +var _0xb2ec=['name','send','map','CannedAnswer','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','catch','show','options','find','body','params','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','get','CannedAnswers','error','stack'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xb2ec,0x86));var _0xcb2e=function(_0x2d7e98,_0x10de4e){_0x2d7e98=_0x2d7e98-0x0;var _0x212be6=_0xb2ec[_0x2d7e98];return _0x212be6;};'use strict';var emlformat=require(_0xcb2e('0x0'));var rimraf=require(_0xcb2e('0x1'));var zipdir=require(_0xcb2e('0x2'));var jsonpatch=require(_0xcb2e('0x3'));var rp=require(_0xcb2e('0x4'));var moment=require(_0xcb2e('0x5'));var BPromise=require(_0xcb2e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcb2e('0x7'));var sox=require(_0xcb2e('0x8'));var csv=require('to-csv');var ejs=require(_0xcb2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb2e('0xa'));var squel=require(_0xcb2e('0xb'));var crypto=require(_0xcb2e('0xc'));var jsforce=require(_0xcb2e('0xd'));var deskjs=require(_0xcb2e('0xe'));var toCsv=require(_0xcb2e('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcb2e('0x10'));var authService=require(_0xcb2e('0x11'));var qs=require(_0xcb2e('0x12'));var as=require(_0xcb2e('0x13'));var hardwareService=require(_0xcb2e('0x14'));var logger=require(_0xcb2e('0x15'))(_0xcb2e('0x16'));var utils=require(_0xcb2e('0x17'));var config=require(_0xcb2e('0x18'));var licenseUtil=require(_0xcb2e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4425af,_0x12e490){_0x12e490=_0x12e490||0xcc;return function(_0x37fa1b){if(_0x37fa1b){return _0x4425af[_0xcb2e('0x1a')](_0x12e490);}return _0x4425af[_0xcb2e('0x1b')](_0x12e490)[_0xcb2e('0x1c')]();};}function respondWithResult(_0x5d02e1,_0x4f11ae){_0x4f11ae=_0x4f11ae||0xc8;return function(_0x470b35){if(_0x470b35){return _0x5d02e1[_0xcb2e('0x1b')](_0x4f11ae)[_0xcb2e('0x1d')](_0x470b35);}};}function respondWithFilteredResult(_0x1b0e30,_0x57e6da){return function(_0x277e72){if(_0x277e72){var _0x10cf08=typeof _0x57e6da[_0xcb2e('0x1e')]==='undefined'&&typeof _0x57e6da[_0xcb2e('0x1f')]===_0xcb2e('0x20');var _0x5933f3=_0x277e72[_0xcb2e('0x21')];var _0x48659d=_0x10cf08?0x0:_0x57e6da[_0xcb2e('0x1e')];var _0x4cbbf1=_0x10cf08?_0x277e72[_0xcb2e('0x21')]:_0x57e6da[_0xcb2e('0x1e')]+_0x57e6da['limit'];var _0x4bc027;if(_0x4cbbf1>=_0x5933f3){_0x4cbbf1=_0x5933f3;_0x4bc027=0xc8;}else{_0x4bc027=0xce;}_0x1b0e30['status'](_0x4bc027);return _0x1b0e30['set']('Content-Range',_0x48659d+'-'+_0x4cbbf1+'/'+_0x5933f3)[_0xcb2e('0x1d')](_0x277e72);}return null;};}function patchUpdates(_0x5f21d0){return function(_0x23b3b1){try{jsonpatch[_0xcb2e('0x22')](_0x23b3b1,_0x5f21d0,!![]);}catch(_0x3e6d5d){return BPromise[_0xcb2e('0x23')](_0x3e6d5d);}return _0x23b3b1['save']();};}function saveUpdates(_0x4f7378,_0x240eb5){return function(_0x1306d0){if(_0x1306d0){return _0x1306d0[_0xcb2e('0x24')](_0x4f7378)['then'](function(_0x2d7f40){return _0x2d7f40;});}return null;};}function removeEntity(_0x2bfa10,_0x27a67d){return function(_0x48e3aa){if(_0x48e3aa){return _0x48e3aa['destroy']()[_0xcb2e('0x25')](function(){var _0x150222=_0x48e3aa[_0xcb2e('0x26')]({'plain':!![]});var _0x48b74d=_0xcb2e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x48b74d,'resourceId':_0x150222['id']}})[_0xcb2e('0x25')](function(){return _0x48e3aa;});})[_0xcb2e('0x25')](function(){_0x2bfa10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d133,_0x446438){return function(_0x29dcb6){if(!_0x29dcb6){_0x26d133[_0xcb2e('0x1a')](0x194);}return _0x29dcb6;};}function handleError(_0x4a9eb1,_0x6f9c6d){_0x6f9c6d=_0x6f9c6d||0x1f4;return function(_0xf551a1){logger[_0xcb2e('0x28')](_0xf551a1[_0xcb2e('0x29')]);if(_0xf551a1[_0xcb2e('0x2a')]){delete _0xf551a1[_0xcb2e('0x2a')];}_0x4a9eb1[_0xcb2e('0x1b')](_0x6f9c6d)[_0xcb2e('0x2b')](_0xf551a1);};}exports['index']=function(_0x210995,_0xa6e5e1){var _0x27aaf8={},_0x3f584a={},_0x5a4e0a={'count':0x0,'rows':[]};var _0x2dbb70=_[_0xcb2e('0x2c')](db[_0xcb2e('0x2d')][_0xcb2e('0x2e')],function(_0x1c0c44){return{'name':_0x1c0c44[_0xcb2e('0x2f')],'type':_0x1c0c44['type'][_0xcb2e('0x30')]};});_0x3f584a['model']=_['map'](_0x2dbb70,'name');_0x3f584a[_0xcb2e('0x31')]=_[_0xcb2e('0x32')](_0x210995['query']);_0x3f584a[_0xcb2e('0x33')]=_[_0xcb2e('0x34')](_0x3f584a[_0xcb2e('0x35')],_0x3f584a[_0xcb2e('0x31')]);_0x27aaf8[_0xcb2e('0x36')]=_['intersection'](_0x3f584a['model'],qs[_0xcb2e('0x37')](_0x210995[_0xcb2e('0x31')]['fields']));_0x27aaf8[_0xcb2e('0x36')]=_0x27aaf8[_0xcb2e('0x36')][_0xcb2e('0x38')]?_0x27aaf8[_0xcb2e('0x36')]:_0x3f584a[_0xcb2e('0x35')];if(!_0x210995[_0xcb2e('0x31')][_0xcb2e('0x39')](_0xcb2e('0x3a'))){_0x27aaf8[_0xcb2e('0x1f')]=qs[_0xcb2e('0x1f')](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x1f')]);_0x27aaf8[_0xcb2e('0x1e')]=qs['offset'](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x1e')]);}_0x27aaf8[_0xcb2e('0x3b')]=qs['sort'](_0x210995[_0xcb2e('0x31')][_0xcb2e('0x3c')]);_0x27aaf8[_0xcb2e('0x3d')]=qs[_0xcb2e('0x33')](_['pick'](_0x210995[_0xcb2e('0x31')],_0x3f584a['filters']),_0x2dbb70);if(_0x210995[_0xcb2e('0x31')][_0xcb2e('0x3e')]){_0x27aaf8['where']=_['merge'](_0x27aaf8['where'],{'$or':[{'key':{'$like':'%'+_0x210995['query'][_0xcb2e('0x3e')]+'%'}},{'value':{'$like':'%'+_0x210995['query']['filter']+'%'}}]});}_0x27aaf8=_[_0xcb2e('0x3f')]({},_0x27aaf8,_0x210995['options']);var _0x1d339e={'where':_0x27aaf8[_0xcb2e('0x3d')]};return db[_0xcb2e('0x2d')]['count'](_0x1d339e)[_0xcb2e('0x25')](function(_0x4eae17){_0x5a4e0a[_0xcb2e('0x21')]=_0x4eae17;if(_0x210995[_0xcb2e('0x31')][_0xcb2e('0x40')]){_0x27aaf8[_0xcb2e('0x41')]=[{'all':!![]}];}return db[_0xcb2e('0x2d')]['findAll'](_0x27aaf8);})[_0xcb2e('0x25')](function(_0x304b8e){_0x5a4e0a['rows']=_0x304b8e;return _0x5a4e0a;})[_0xcb2e('0x25')](respondWithFilteredResult(_0xa6e5e1,_0x27aaf8))[_0xcb2e('0x42')](handleError(_0xa6e5e1,null));};exports[_0xcb2e('0x43')]=function(_0x22bbf8,_0x54ffef){var _0x3ce8f0={'raw':!![],'where':{'id':_0x22bbf8['params']['id']}},_0x292852={};_0x292852[_0xcb2e('0x35')]=_[_0xcb2e('0x32')](db[_0xcb2e('0x2d')][_0xcb2e('0x2e')]);_0x292852[_0xcb2e('0x31')]=_['keys'](_0x22bbf8[_0xcb2e('0x31')]);_0x292852[_0xcb2e('0x33')]=_[_0xcb2e('0x34')](_0x292852[_0xcb2e('0x35')],_0x292852[_0xcb2e('0x31')]);_0x3ce8f0[_0xcb2e('0x36')]=_[_0xcb2e('0x34')](_0x292852[_0xcb2e('0x35')],qs[_0xcb2e('0x37')](_0x22bbf8[_0xcb2e('0x31')]['fields']));_0x3ce8f0[_0xcb2e('0x36')]=_0x3ce8f0[_0xcb2e('0x36')]['length']?_0x3ce8f0[_0xcb2e('0x36')]:_0x292852['model'];if(_0x22bbf8[_0xcb2e('0x31')][_0xcb2e('0x40')]){_0x3ce8f0[_0xcb2e('0x41')]=[{'all':!![]}];}_0x3ce8f0=_['merge']({},_0x3ce8f0,_0x22bbf8[_0xcb2e('0x44')]);return db[_0xcb2e('0x2d')][_0xcb2e('0x45')](_0x3ce8f0)[_0xcb2e('0x25')](handleEntityNotFound(_0x54ffef,null))['then'](respondWithResult(_0x54ffef,null))['catch'](handleError(_0x54ffef,null));};exports[_0xcb2e('0x24')]=function(_0x44c82b,_0x153c0e){if(_0x44c82b[_0xcb2e('0x46')]['id']){delete _0x44c82b[_0xcb2e('0x46')]['id'];}return db[_0xcb2e('0x2d')][_0xcb2e('0x45')]({'where':{'id':_0x44c82b[_0xcb2e('0x47')]['id']}})['then'](handleEntityNotFound(_0x153c0e,null))[_0xcb2e('0x25')](saveUpdates(_0x44c82b['body'],null))['then'](respondWithResult(_0x153c0e,null))['catch'](handleError(_0x153c0e,null));};exports[_0xcb2e('0x48')]=function(_0x16c546,_0x5a8e2d){return db['CannedAnswer']['find']({'where':{'id':_0x16c546[_0xcb2e('0x47')]['id']}})[_0xcb2e('0x25')](handleEntityNotFound(_0x5a8e2d,null))[_0xcb2e('0x25')](removeEntity(_0x5a8e2d,null))['catch'](handleError(_0x5a8e2d,null));};exports[_0xcb2e('0x49')]=function(_0xa7433b,_0x5773ad){var _0x367a5b={'key':_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x30')]};if(_0xa7433b[_0xcb2e('0x46')]['MailAccountId']){_0x367a5b[_0xcb2e('0x4a')]=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4a')];}else if(_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4b')]){_0x367a5b['SmsAccountId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4b')];}else if(_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4c')]){_0x367a5b['OpenchannelAccountId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4c')];}else if(_0xa7433b[_0xcb2e('0x46')]['ChatWebsiteId']){_0x367a5b['ChatWebsiteId']=_0xa7433b[_0xcb2e('0x46')][_0xcb2e('0x4d')];}return db[_0xcb2e('0x2d')]['find']({'where':_0x367a5b})[_0xcb2e('0x25')](function(_0x185169){if(_0x185169){throw new db[(_0xcb2e('0x4e'))][(_0xcb2e('0x4f'))](_0xcb2e('0x50'));}return db['CannedAnswer']['create'](_0xa7433b[_0xcb2e('0x46')]);})[_0xcb2e('0x25')](function(_0x1103d6){var _0x4c5c06=_0xa7433b['user'][_0xcb2e('0x26')]({'plain':!![]});if(!_0x4c5c06)throw new Error(_0xcb2e('0x51'));if(_0x4c5c06['role']===_0xcb2e('0x52')){var _0x6e9bbc=_0x1103d6[_0xcb2e('0x26')]({'plain':!![]});return db[_0xcb2e('0x53')][_0xcb2e('0x45')]({'where':{'name':_0xcb2e('0x27'),'userProfileId':_0x4c5c06[_0xcb2e('0x54')]},'raw':!![]})['then'](function(_0x28d4d3){if(_0x28d4d3&&_0x28d4d3[_0xcb2e('0x55')]===0x0){return db[_0xcb2e('0x56')][_0xcb2e('0x49')]({'name':_0x6e9bbc['name'],'resourceId':_0x6e9bbc['id'],'type':_0x28d4d3[_0xcb2e('0x2a')],'sectionId':_0x28d4d3['id']},{})['then'](function(){return _0x1103d6;});}else{return _0x1103d6;}})[_0xcb2e('0x42')](function(_0xd59100){logger['error'](_0xcb2e('0x57'),_0xd59100);throw _0xd59100;});}return _0x1103d6;})[_0xcb2e('0x25')](respondWithResult(_0x5773ad,0xc9))[_0xcb2e('0x42')](handleError(_0x5773ad,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 57ab9e1..155ebaf 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 _0xa359=['./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path'];(function(_0x358dcb,_0x46b304){var _0x321b74=function(_0x26bb47){while(--_0x26bb47){_0x358dcb['push'](_0x358dcb['shift']());}};_0x321b74(++_0x46b304);}(_0xa359,0xb6));var _0x9a35=function(_0x455d96,_0x310919){_0x455d96=_0x455d96-0x0;var _0x84b523=_0xa359[_0x455d96];return _0x84b523;};'use strict';var _=require('lodash');var util=require(_0x9a35('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9a35('0x1'));var BPromise=require(_0x9a35('0x2'));var rp=require(_0x9a35('0x3'));var fs=require('fs');var path=require(_0x9a35('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a35('0x5'));module[_0x9a35('0x6')]=function(_0x2a2264,_0x22bc97){return _0x2a2264[_0x9a35('0x7')](_0x9a35('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a35('0x9'),'collate':_0x9a35('0xa')});}; \ No newline at end of file +var _0xff07=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5adbcf,_0x4398a0){var _0x1f73b5=function(_0x1d29a1){while(--_0x1d29a1){_0x5adbcf['push'](_0x5adbcf['shift']());}};_0x1f73b5(++_0x4398a0);}(_0xff07,0x1ac));var _0x7ff0=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xff07[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x7ff0('0x0'));var util=require(_0x7ff0('0x1'));var logger=require(_0x7ff0('0x2'))(_0x7ff0('0x3'));var moment=require(_0x7ff0('0x4'));var BPromise=require(_0x7ff0('0x5'));var rp=require(_0x7ff0('0x6'));var fs=require('fs');var path=require(_0x7ff0('0x7'));var rimraf=require(_0x7ff0('0x8'));var config=require(_0x7ff0('0x9'));var attributes=require(_0x7ff0('0xa'));module[_0x7ff0('0xb')]=function(_0x5bc19f,_0x26bf9a){return _0x5bc19f[_0x7ff0('0xc')](_0x7ff0('0xd'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7ff0('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 276302d..4501756 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(_0xbb6f43,_0x459bbf){var _0x48a780=function(_0x2b9e64){while(--_0x2b9e64){_0xbb6f43['push'](_0xbb6f43['shift']());}};_0x48a780(++_0x459bbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x5d3767,_0x58eedc){var _0x57f2ea=function(_0x3cc4f6){while(--_0x3cc4f6){_0x5d3767['push'](_0x5d3767['shift']());}};_0x57f2ea(++_0x58eedc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 8d16c3e..b8cf3af 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 _0x680d=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3edab6,_0xb15016){var _0xa8b6ae=function(_0x3596d2){while(--_0x3596d2){_0x3edab6['push'](_0x3edab6['shift']());}};_0xa8b6ae(++_0xb15016);}(_0x680d,0x79));var _0xd680=function(_0x57063b,_0x5ab441){_0x57063b=_0x57063b-0x0;var _0x5d22f8=_0x680d[_0x57063b];return _0x5d22f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd680('0x0'));var timeout=require(_0xd680('0x1'));var express=require('express');var router=express[_0xd680('0x2')]();var fs_extra=require(_0xd680('0x3'));var auth=require(_0xd680('0x4'));var interaction=require(_0xd680('0x5'));var config=require(_0xd680('0x6'));var controller=require(_0xd680('0x7'));router[_0xd680('0x8')]('/',auth[_0xd680('0x9')](),controller['index']);router[_0xd680('0x8')](_0xd680('0xa'),auth['isAuthenticated'](),controller[_0xd680('0xb')]);router[_0xd680('0xc')]('/',auth[_0xd680('0x9')](),controller[_0xd680('0xd')]);router[_0xd680('0xe')](_0xd680('0xa'),auth[_0xd680('0x9')](),controller[_0xd680('0xf')]);router[_0xd680('0x10')](_0xd680('0xa'),auth[_0xd680('0x9')](),controller['destroy']);module[_0xd680('0x11')]=router; \ No newline at end of file +var _0xb371=['get','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xb371,0x14d));var _0x1b37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb371[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b37('0x0'));var timeout=require(_0x1b37('0x1'));var express=require(_0x1b37('0x2'));var router=express[_0x1b37('0x3')]();var fs_extra=require(_0x1b37('0x4'));var auth=require(_0x1b37('0x5'));var interaction=require(_0x1b37('0x6'));var config=require(_0x1b37('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x1b37('0x8')](),controller['index']);router[_0x1b37('0x9')](_0x1b37('0xa'),auth[_0x1b37('0x8')](),controller[_0x1b37('0xb')]);router[_0x1b37('0xc')]('/',auth[_0x1b37('0x8')](),controller[_0x1b37('0xd')]);router[_0x1b37('0xe')](_0x1b37('0xa'),auth['isAuthenticated'](),controller[_0x1b37('0xf')]);router['delete'](_0x1b37('0xa'),auth['isAuthenticated'](),controller[_0x1b37('0x10')]);module[_0x1b37('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 69a9dc0..102e05d 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 _0xd110=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x5200b9,_0x22ca30){var _0x2de02d=function(_0x220142){while(--_0x220142){_0x5200b9['push'](_0x5200b9['shift']());}};_0x2de02d(++_0x22ca30);}(_0xd110,0x1e8));var _0x0d11=function(_0x5f2575,_0x21d1cb){_0x5f2575=_0x5f2575-0x0;var _0x1b845f=_0xd110[_0x5f2575];return _0x1b845f;};'use strict';var Sequelize=require(_0x0d11('0x0'));module[_0x0d11('0x1')]={'calldate':{'type':Sequelize[_0x0d11('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0d11('0x3')]},'src':{'type':Sequelize[_0x0d11('0x3')]},'dst':{'type':Sequelize[_0x0d11('0x3')]},'dcontext':{'type':Sequelize[_0x0d11('0x3')]},'channel':{'type':Sequelize[_0x0d11('0x3')]},'dstchannel':{'type':Sequelize[_0x0d11('0x3')]},'lastapp':{'type':Sequelize[_0x0d11('0x3')]},'lastdata':{'type':Sequelize[_0x0d11('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d11('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0d11('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0d11('0x3')]},'linkedid':{'type':Sequelize[_0x0d11('0x3')]},'sequence':{'type':Sequelize[_0x0d11('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0d11('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe235=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe235,0xe4));var _0x5e23=function(_0x23c949,_0x1c73b5){_0x23c949=_0x23c949-0x0;var _0x26562c=_0xe235[_0x23c949];return _0x26562c;};'use strict';var Sequelize=require(_0x5e23('0x0'));module[_0x5e23('0x1')]={'calldate':{'type':Sequelize[_0x5e23('0x2')],'allowNull':![],'defaultValue':_0x5e23('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x5e23('0x4')]},'dcontext':{'type':Sequelize[_0x5e23('0x4')]},'channel':{'type':Sequelize[_0x5e23('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5e23('0x4')]},'duration':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e23('0x4')]},'amaflags':{'type':Sequelize[_0x5e23('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5e23('0x4')]},'userfield':{'type':Sequelize[_0x5e23('0x4')]},'uniqueid':{'type':Sequelize[_0x5e23('0x4')]},'linkedid':{'type':Sequelize[_0x5e23('0x4')]},'sequence':{'type':Sequelize[_0x5e23('0x4')]},'peeraccount':{'type':Sequelize[_0x5e23('0x4')]},'type':{'type':Sequelize[_0x5e23('0x4')]},'tag':{'type':Sequelize[_0x5e23('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 5466712..26f72d6 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 _0xa9b1=['where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={},_0x1d981e={},_0x5362b8={'count':0x0,'rows':[]};var _0x30278b=_[_0x1a9b('0x29')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')],function(_0x1a5085){return{'name':_0x1a5085[_0x1a9b('0x2c')],'type':_0x1a5085[_0x1a9b('0x2d')]['key']};});_0x1d981e[_0x1a9b('0x2e')]=_[_0x1a9b('0x29')](_0x30278b,_0x1a9b('0x26'));_0x1d981e[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2f')]);_0x1d981e[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x1d981e[_0x1a9b('0x2e')],_0x1d981e[_0x1a9b('0x2f')]);_0x3f8e98[_0x1a9b('0x33')]=_['intersection'](_0x1d981e['model'],qs[_0x1a9b('0x34')](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x3f8e98['attributes']=_0x3f8e98[_0x1a9b('0x33')]['length']?_0x3f8e98[_0x1a9b('0x33')]:_0x1d981e['model'];if(!_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0x3f8e98[_0x1a9b('0x1c')]=qs['limit'](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x3f8e98[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x5d70dc['query'][_0x1a9b('0x1a')]);}_0x3f8e98[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x5d70dc['query'][_0x1a9b('0x37')]);_0x3f8e98['where']=qs['filters'](_[_0x1a9b('0x38')](_0x5d70dc[_0x1a9b('0x2f')],_0x1d981e[_0x1a9b('0x31')]),_0x30278b);if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x3f8e98[_0x1a9b('0x3a')]=_[_0x1a9b('0x3b')](_0x3f8e98['where'],{'$or':_[_0x1a9b('0x29')](_0x30278b,function(_0x230fc6){if(_0x230fc6[_0x1a9b('0x2d')]!=='VIRTUAL'){var _0x466827={};_0x466827[_0x230fc6[_0x1a9b('0x26')]]={'$like':'%'+_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]+'%'};return _0x466827;}})});}_0x3f8e98=_['merge']({},_0x3f8e98,_0x5d70dc['options']);var _0x10e80f={'where':_0x3f8e98[_0x1a9b('0x3a')]};return db[_0x1a9b('0x2a')]['count'](_0x10e80f)['then'](function(_0x2b9bcf){_0x5362b8[_0x1a9b('0x1d')]=_0x2b9bcf;if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x3f8e98[_0x1a9b('0x3d')]=[{'all':!![]}];}return db[_0x1a9b('0x2a')][_0x1a9b('0x3e')](_0x3f8e98);})['then'](function(_0x313921){_0x5362b8[_0x1a9b('0x3f')]=_0x313921;return _0x5362b8;})[_0x1a9b('0x23')](respondWithFilteredResult(_0x5d7e8c,_0x3f8e98))[_0x1a9b('0x40')](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x41')]=function(_0x1decb8,_0xb4cbf4){var _0x398db3={'raw':!![],'where':{'id':_0x1decb8[_0x1a9b('0x42')]['id']}},_0x35f6d8={};_0x35f6d8[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')]);_0x35f6d8[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x1decb8['query']);_0x35f6d8[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x35f6d8['model'],_0x35f6d8[_0x1a9b('0x2f')]);_0x398db3['attributes']=_['intersection'](_0x35f6d8[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x398db3[_0x1a9b('0x33')]=_0x398db3[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x398db3['attributes']:_0x35f6d8[_0x1a9b('0x2e')];if(_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x398db3[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x398db3=_['merge']({},_0x398db3,_0x1decb8[_0x1a9b('0x44')]);return db[_0x1a9b('0x2a')][_0x1a9b('0x45')](_0x398db3)[_0x1a9b('0x23')](handleEntityNotFound(_0xb4cbf4,null))['then'](respondWithResult(_0xb4cbf4,null))[_0x1a9b('0x40')](handleError(_0xb4cbf4,null));};exports[_0x1a9b('0x46')]=function(_0x41e9fc,_0x1e93df){return db[_0x1a9b('0x2a')]['create'](_0x41e9fc['body'],{})[_0x1a9b('0x23')](respondWithResult(_0x1e93df,0xc9))[_0x1a9b('0x40')](handleError(_0x1e93df,null));};exports['update']=function(_0x52b06e,_0x252140){if(_0x52b06e[_0x1a9b('0x47')]['id']){delete _0x52b06e[_0x1a9b('0x47')]['id'];}return db['Cdr'][_0x1a9b('0x45')]({'where':{'id':_0x52b06e[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x23')](saveUpdates(_0x52b06e[_0x1a9b('0x47')],null))[_0x1a9b('0x23')](respondWithResult(_0x252140,null))[_0x1a9b('0x40')](handleError(_0x252140,null));};exports['destroy']=function(_0x54b9ac,_0x5465d0){return db[_0x1a9b('0x2a')][_0x1a9b('0x45')]({'where':{'id':_0x54b9ac[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5465d0,null))[_0x1a9b('0x23')](removeEntity(_0x5465d0,null))['catch'](handleError(_0x5465d0,null));};exports[_0x1a9b('0x48')]=function(_0x222bba,_0x3b1fdf){return db[_0x1a9b('0x2a')][_0x1a9b('0x48')]()[_0x1a9b('0x23')](respondWithResult(_0x3b1fdf,null))[_0x1a9b('0x40')](handleError(_0x3b1fdf,null));}; \ No newline at end of file +var _0x1224=['sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','Cdr','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x5a2601,_0x3fd7d1){var _0x27ab50=function(_0x53f6ca){while(--_0x53f6ca){_0x5a2601['push'](_0x5a2601['shift']());}};_0x27ab50(++_0x3fd7d1);}(_0x1224,0x10d));var _0x4122=function(_0x30fc13,_0x126c3f){_0x30fc13=_0x30fc13-0x0;var _0x5d0365=_0x1224[_0x30fc13];return _0x5d0365;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={},_0x43c51c={},_0x79c85={'count':0x0,'rows':[]};var _0x31f141=_['map'](db[_0x4122('0x30')]['rawAttributes'],function(_0x3e4eee){return{'name':_0x3e4eee[_0x4122('0x31')],'type':_0x3e4eee[_0x4122('0x32')][_0x4122('0x33')]};});_0x43c51c[_0x4122('0x34')]=_[_0x4122('0x35')](_0x31f141,_0x4122('0x2d'));_0x43c51c[_0x4122('0x36')]=_['keys'](_0xfefaf6[_0x4122('0x36')]);_0x43c51c[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x34')],_0x43c51c[_0x4122('0x36')]);_0x2e5bc2[_0x4122('0x38')]=_[_0x4122('0x39')](_0x43c51c['model'],qs[_0x4122('0x3a')](_0xfefaf6[_0x4122('0x36')]['fields']));_0x2e5bc2['attributes']=_0x2e5bc2[_0x4122('0x38')]['length']?_0x2e5bc2[_0x4122('0x38')]:_0x43c51c[_0x4122('0x34')];if(!_0xfefaf6['query'][_0x4122('0x3b')](_0x4122('0x3c'))){_0x2e5bc2[_0x4122('0x3d')]=qs['limit'](_0xfefaf6[_0x4122('0x36')]['limit']);_0x2e5bc2[_0x4122('0x22')]=qs[_0x4122('0x22')](_0xfefaf6[_0x4122('0x36')]['offset']);}_0x2e5bc2[_0x4122('0x3e')]=qs['sort'](_0xfefaf6[_0x4122('0x36')][_0x4122('0x3f')]);_0x2e5bc2['where']=qs['filters'](_['pick'](_0xfefaf6[_0x4122('0x36')],_0x43c51c['filters']),_0x31f141);if(_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]){_0x2e5bc2[_0x4122('0x41')]=_[_0x4122('0x42')](_0x2e5bc2[_0x4122('0x41')],{'$or':_['map'](_0x31f141,function(_0x5c20ec){if(_0x5c20ec[_0x4122('0x32')]!=='VIRTUAL'){var _0xf4ab54={};_0xf4ab54[_0x5c20ec['name']]={'$like':'%'+_0xfefaf6[_0x4122('0x36')][_0x4122('0x40')]+'%'};return _0xf4ab54;}})});}_0x2e5bc2=_['merge']({},_0x2e5bc2,_0xfefaf6[_0x4122('0x43')]);var _0x2b7d56={'where':_0x2e5bc2[_0x4122('0x41')]};return db[_0x4122('0x30')][_0x4122('0x24')](_0x2b7d56)[_0x4122('0x2a')](function(_0x5b8fe2){_0x79c85[_0x4122('0x24')]=_0x5b8fe2;if(_0xfefaf6['query'][_0x4122('0x44')]){_0x2e5bc2['include']=[{'all':!![]}];}return db[_0x4122('0x30')][_0x4122('0x45')](_0x2e5bc2);})[_0x4122('0x2a')](function(_0x469fdd){_0x79c85[_0x4122('0x46')]=_0x469fdd;return _0x79c85;})['then'](respondWithFilteredResult(_0x5f32c5,_0x2e5bc2))[_0x4122('0x47')](handleError(_0x5f32c5,null));};exports[_0x4122('0x48')]=function(_0x59ed80,_0x589b39){var _0x5853ae={'raw':!![],'where':{'id':_0x59ed80[_0x4122('0x49')]['id']}},_0x297937={};_0x297937[_0x4122('0x34')]=_[_0x4122('0x4a')](db[_0x4122('0x30')][_0x4122('0x4b')]);_0x297937[_0x4122('0x36')]=_[_0x4122('0x4a')](_0x59ed80[_0x4122('0x36')]);_0x297937['filters']=_[_0x4122('0x39')](_0x297937['model'],_0x297937['query']);_0x5853ae[_0x4122('0x38')]=_[_0x4122('0x39')](_0x297937[_0x4122('0x34')],qs['fields'](_0x59ed80[_0x4122('0x36')][_0x4122('0x3a')]));_0x5853ae['attributes']=_0x5853ae[_0x4122('0x38')][_0x4122('0x4c')]?_0x5853ae[_0x4122('0x38')]:_0x297937[_0x4122('0x34')];if(_0x59ed80['query'][_0x4122('0x44')]){_0x5853ae[_0x4122('0x4d')]=[{'all':!![]}];}_0x5853ae=_[_0x4122('0x42')]({},_0x5853ae,_0x59ed80[_0x4122('0x43')]);return db[_0x4122('0x30')]['find'](_0x5853ae)['then'](handleEntityNotFound(_0x589b39,null))[_0x4122('0x2a')](respondWithResult(_0x589b39,null))[_0x4122('0x47')](handleError(_0x589b39,null));};exports[_0x4122('0x4e')]=function(_0x13cc1d,_0x144d4c){return db['Cdr'][_0x4122('0x4e')](_0x13cc1d[_0x4122('0x4f')],{})[_0x4122('0x2a')](respondWithResult(_0x144d4c,0xc9))['catch'](handleError(_0x144d4c,null));};exports[_0x4122('0x29')]=function(_0x53f7d9,_0x39515c){if(_0x53f7d9[_0x4122('0x4f')]['id']){delete _0x53f7d9[_0x4122('0x4f')]['id'];}return db[_0x4122('0x30')]['find']({'where':{'id':_0x53f7d9['params']['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x39515c,null))[_0x4122('0x2a')](saveUpdates(_0x53f7d9[_0x4122('0x4f')],null))[_0x4122('0x2a')](respondWithResult(_0x39515c,null))['catch'](handleError(_0x39515c,null));};exports[_0x4122('0x50')]=function(_0x5678ff,_0x376782){return db['Cdr'][_0x4122('0x51')]({'where':{'id':_0x5678ff[_0x4122('0x49')]['id']}})[_0x4122('0x2a')](handleEntityNotFound(_0x376782,null))[_0x4122('0x2a')](removeEntity(_0x376782,null))[_0x4122('0x47')](handleError(_0x376782,null));};exports[_0x4122('0x52')]=function(_0x4fb7ac,_0xf265ed){return db['Cdr'][_0x4122('0x52')]()[_0x4122('0x2a')](respondWithResult(_0xf265ed,null))[_0x4122('0x47')](handleError(_0xf265ed,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 557ae0e..abfe3c4 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(_0x1c341b,_0x157953){var _0x5e8591=function(_0x1e29cd){while(--_0x1e29cd){_0x1c341b['push'](_0x1c341b['shift']());}};_0x5e8591(++_0x157953);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5ce743,_0xc5caca){var _0x2a3fd1=function(_0x218b48){while(--_0x218b48){_0x5ce743['push'](_0x5ce743['shift']());}};_0x2a3fd1(++_0xc5caca);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index f9967ff..af7a837 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 _0x708f=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x529f36,_0x6b4496){var _0x64d301=function(_0x5a1399){while(--_0x5a1399){_0x529f36['push'](_0x529f36['shift']());}};_0x64d301(++_0x6b4496);}(_0x708f,0x117));var _0xf708=function(_0x57dae8,_0x14f493){_0x57dae8=_0x57dae8-0x0;var _0x2da89a=_0x708f[_0x57dae8];return _0x2da89a;};'use strict';var _=require(_0xf708('0x0'));var util=require(_0xf708('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf708('0x2'));var fs=require('fs');var Redis=require(_0xf708('0x3'));var db=require(_0xf708('0x4'))['db'];var utils=require(_0xf708('0x5'));var logger=require(_0xf708('0x6'))('rpc');var config=require(_0xf708('0x7'));var jayson=require(_0xf708('0x8'));var client=jayson[_0xf708('0x9')][_0xf708('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6072f,_0x2adf2a,_0x28f807){return new BPromise(function(_0x166465,_0x5ccb1d){return client[_0xf708('0xb')](_0xf6072f,_0x28f807)[_0xf708('0xc')](function(_0x2108fd){logger[_0xf708('0xd')](_0xf708('0xe'),_0x2adf2a,_0xf708('0xf'));logger['debug'](_0xf708('0x10'),_0x2adf2a,_0xf708('0xf'),JSON[_0xf708('0x11')](_0x2108fd));if(_0x2108fd[_0xf708('0x12')]){if(_0x2108fd[_0xf708('0x12')][_0xf708('0x13')]===0x1f4){logger[_0xf708('0x12')](_0xf708('0xe'),_0x2adf2a,_0x2108fd[_0xf708('0x12')][_0xf708('0x14')]);return _0x5ccb1d(_0x2108fd[_0xf708('0x12')]['message']);}logger['error'](_0xf708('0xe'),_0x2adf2a,_0x2108fd[_0xf708('0x12')][_0xf708('0x14')]);return _0x166465(_0x2108fd[_0xf708('0x12')]['message']);}else{logger[_0xf708('0xd')](_0xf708('0xe'),_0x2adf2a,_0xf708('0xf'));_0x166465(_0x2108fd[_0xf708('0x15')]['message']);}})[_0xf708('0x16')](function(_0x33cd4b){logger['error'](_0xf708('0xe'),_0x2adf2a,_0x33cd4b);_0x5ccb1d(_0x33cd4b);});});} \ No newline at end of file +var _0x94a7=['../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a43b8,_0x2e0eb2){var _0x26eeef=function(_0x4b1451){while(--_0x4b1451){_0x5a43b8['push'](_0x5a43b8['shift']());}};_0x26eeef(++_0x2e0eb2);}(_0x94a7,0x10b));var _0x794a=function(_0x189ece,_0x34dd60){_0x189ece=_0x189ece-0x0;var _0x3eda01=_0x94a7[_0x189ece];return _0x3eda01;};'use strict';var _=require(_0x794a('0x0'));var util=require(_0x794a('0x1'));var moment=require(_0x794a('0x2'));var BPromise=require(_0x794a('0x3'));var rs=require(_0x794a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x794a('0x5'))['db'];var utils=require(_0x794a('0x6'));var logger=require(_0x794a('0x7'))(_0x794a('0x8'));var config=require(_0x794a('0x9'));var jayson=require(_0x794a('0xa'));var client=jayson['client'][_0x794a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d11eb,_0x544df5,_0x265332){return new BPromise(function(_0x4df1bc,_0x1b29fc){return client[_0x794a('0xc')](_0x3d11eb,_0x265332)[_0x794a('0xd')](function(_0x650e1d){logger[_0x794a('0xe')](_0x794a('0xf'),_0x544df5,_0x794a('0x10'));logger['debug'](_0x794a('0x11'),_0x544df5,_0x794a('0x10'),JSON[_0x794a('0x12')](_0x650e1d));if(_0x650e1d[_0x794a('0x13')]){if(_0x650e1d['error'][_0x794a('0x14')]===0x1f4){logger[_0x794a('0x13')](_0x794a('0xf'),_0x544df5,_0x650e1d[_0x794a('0x13')]['message']);return _0x1b29fc(_0x650e1d[_0x794a('0x13')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x544df5,_0x650e1d[_0x794a('0x13')][_0x794a('0x15')]);return _0x4df1bc(_0x650e1d[_0x794a('0x13')][_0x794a('0x15')]);}else{logger['info'](_0x794a('0xf'),_0x544df5,'request\x20sent');_0x4df1bc(_0x650e1d['result']['message']);}})[_0x794a('0x16')](function(_0x935ceb){logger[_0x794a('0x13')]('Cdr,\x20%s,\x20%s',_0x544df5,_0x935ceb);_0x1b29fc(_0x935ceb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 7e0e12e..1fb4ff7 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x288267,_0x12e1e3){var _0x5b245c=function(_0x4716ab){while(--_0x4716ab){_0x288267['push'](_0x288267['shift']());}};_0x5b245c(++_0x12e1e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d6398,_0x5af583){var _0xf652d6=function(_0x1e6c52){while(--_0x1e6c52){_0x5d6398['push'](_0x5d6398['shift']());}};_0xf652d6(++_0x5af583);}(_0xb10b,0x12a));var _0xbb10=function(_0x155924,_0x2a5368){_0x155924=_0x155924-0x0;var _0x262e4b=_0xb10b[_0x155924];return _0x262e4b;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 9083bd6..1a8a005 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 _0x2870=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x482fc8,_0x29e418){var _0x402339=function(_0x501171){while(--_0x501171){_0x482fc8['push'](_0x482fc8['shift']());}};_0x402339(++_0x29e418);}(_0x2870,0xba));var _0x0287=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x2870[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require(_0x0287('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0287('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0287('0x2')],'allowNull':![],'defaultValue':_0x0287('0x3')},'appdata':{'type':Sequelize[_0x0287('0x4')]()},'description':{'type':Sequelize[_0x0287('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0287('0x5')}}; \ No newline at end of file +var _0x9a26=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x118cda,_0x46f01a){var _0x75fce3=function(_0x422085){while(--_0x422085){_0x118cda['push'](_0x118cda['shift']());}};_0x75fce3(++_0x46f01a);}(_0x9a26,0xdb));var _0x69a2=function(_0x2e64e0,_0x1642bb){_0x2e64e0=_0x2e64e0-0x0;var _0x29aa5f=_0x9a26[_0x2e64e0];return _0x29aa5f;};'use strict';var Sequelize=require(_0x69a2('0x0'));module[_0x69a2('0x1')]={'priority':{'type':Sequelize[_0x69a2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x69a2('0x3')]()},'description':{'type':Sequelize[_0x69a2('0x4')]},'interval':{'type':Sequelize[_0x69a2('0x4')],'defaultValue':_0x69a2('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8522a58..3bf56e5 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 _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x40a69b,_0x30a7e9){var _0x31c177=function(_0x572694){while(--_0x572694){_0x40a69b['push'](_0x40a69b['shift']());}};_0x31c177(++_0x30a7e9);}(_0x3c2c,0x160));var _0xc3c2=function(_0x537e09,_0x4c175a){_0x537e09=_0x537e09-0x0;var _0x38ac68=_0x3c2c[_0x537e09];return _0x38ac68;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));}; \ No newline at end of file +var _0x7633=['find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','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','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x7633,0x1c4));var _0x3763=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7633[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x3763('0x0'));var rimraf=require(_0x3763('0x1'));var zipdir=require(_0x3763('0x2'));var jsonpatch=require(_0x3763('0x3'));var rp=require(_0x3763('0x4'));var moment=require('moment');var BPromise=require(_0x3763('0x5'));var Mustache=require(_0x3763('0x6'));var util=require('util');var path=require(_0x3763('0x7'));var sox=require(_0x3763('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3763('0x9'));var _=require(_0x3763('0xa'));var squel=require(_0x3763('0xb'));var crypto=require(_0x3763('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3763('0xd'));var querystring=require(_0x3763('0xe'));var Papa=require('papaparse');var Redis=require(_0x3763('0xf'));var authService=require(_0x3763('0x10'));var qs=require(_0x3763('0x11'));var as=require(_0x3763('0x12'));var hardwareService=require(_0x3763('0x13'));var logger=require(_0x3763('0x14'))(_0x3763('0x15'));var utils=require(_0x3763('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3763('0x17'));var db=require(_0x3763('0x18'))['db'];function respondWithStatusCode(_0x11d390,_0x52728b){_0x52728b=_0x52728b||0xcc;return function(_0x59980c){if(_0x59980c){return _0x11d390[_0x3763('0x19')](_0x52728b);}return _0x11d390['status'](_0x52728b)[_0x3763('0x1a')]();};}function respondWithResult(_0x12582e,_0xf9d237){_0xf9d237=_0xf9d237||0xc8;return function(_0x3d91da){if(_0x3d91da){return _0x12582e[_0x3763('0x1b')](_0xf9d237)[_0x3763('0x1c')](_0x3d91da);}};}function respondWithFilteredResult(_0x1110e0,_0x4c877a){return function(_0xa95c5b){if(_0xa95c5b){var _0x368434=typeof _0x4c877a[_0x3763('0x1d')]==='undefined'&&typeof _0x4c877a['limit']==='undefined';var _0x1bb7bc=_0xa95c5b[_0x3763('0x1e')];var _0x33dd0e=_0x368434?0x0:_0x4c877a[_0x3763('0x1d')];var _0x23087d=_0x368434?_0xa95c5b[_0x3763('0x1e')]:_0x4c877a[_0x3763('0x1d')]+_0x4c877a['limit'];var _0x38a33f;if(_0x23087d>=_0x1bb7bc){_0x23087d=_0x1bb7bc;_0x38a33f=0xc8;}else{_0x38a33f=0xce;}_0x1110e0[_0x3763('0x1b')](_0x38a33f);return _0x1110e0[_0x3763('0x1f')](_0x3763('0x20'),_0x33dd0e+'-'+_0x23087d+'/'+_0x1bb7bc)['json'](_0xa95c5b);}return null;};}function patchUpdates(_0x485836){return function(_0x2cb398){try{jsonpatch[_0x3763('0x21')](_0x2cb398,_0x485836,!![]);}catch(_0x427c15){return BPromise[_0x3763('0x22')](_0x427c15);}return _0x2cb398['save']();};}function saveUpdates(_0x36ff74,_0x5e5f4e){return function(_0xafb9f5){if(_0xafb9f5){return _0xafb9f5[_0x3763('0x23')](_0x36ff74)['then'](function(_0x3083e){return _0x3083e;});}return null;};}function removeEntity(_0x195945,_0xa53ba5){return function(_0xd6086f){if(_0xd6086f){return _0xd6086f[_0x3763('0x24')]()[_0x3763('0x25')](function(){_0x195945[_0x3763('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57036c,_0x51e77a){return function(_0x434fa3){if(!_0x434fa3){_0x57036c[_0x3763('0x19')](0x194);}return _0x434fa3;};}function handleError(_0x28a17a,_0xe5beb5){_0xe5beb5=_0xe5beb5||0x1f4;return function(_0x3f6644){logger[_0x3763('0x26')](_0x3f6644[_0x3763('0x27')]);if(_0x3f6644[_0x3763('0x28')]){delete _0x3f6644[_0x3763('0x28')];}_0x28a17a[_0x3763('0x1b')](_0xe5beb5)[_0x3763('0x29')](_0x3f6644);};}exports[_0x3763('0x2a')]=function(_0x4f9a96,_0xd128d8){var _0xb1b938={'raw':!![],'where':{'id':_0x4f9a96['params']['id']}},_0x2f6e9d={};_0x2f6e9d[_0x3763('0x2b')]=_[_0x3763('0x2c')](db[_0x3763('0x2d')]['rawAttributes']);_0x2f6e9d[_0x3763('0x2e')]=_[_0x3763('0x2c')](_0x4f9a96[_0x3763('0x2e')]);_0x2f6e9d[_0x3763('0x2f')]=_[_0x3763('0x30')](_0x2f6e9d['model'],_0x2f6e9d['query']);_0xb1b938[_0x3763('0x31')]=_[_0x3763('0x30')](_0x2f6e9d[_0x3763('0x2b')],qs[_0x3763('0x32')](_0x4f9a96[_0x3763('0x2e')][_0x3763('0x32')]));_0xb1b938[_0x3763('0x31')]=_0xb1b938[_0x3763('0x31')]['length']?_0xb1b938[_0x3763('0x31')]:_0x2f6e9d[_0x3763('0x2b')];if(_0x4f9a96[_0x3763('0x2e')][_0x3763('0x33')]){_0xb1b938['include']=[{'all':!![]}];}_0xb1b938=_['merge']({},_0xb1b938,_0x4f9a96['options']);return db['ChatApplication'][_0x3763('0x34')](_0xb1b938)[_0x3763('0x25')](handleEntityNotFound(_0xd128d8,null))['then'](respondWithResult(_0xd128d8,null))[_0x3763('0x35')](handleError(_0xd128d8,null));};exports[_0x3763('0x23')]=function(_0x51e756,_0x805718){if(_0x51e756[_0x3763('0x36')]['id']){delete _0x51e756[_0x3763('0x36')]['id'];}return db[_0x3763('0x2d')][_0x3763('0x34')]({'where':{'id':_0x51e756[_0x3763('0x37')]['id']}})[_0x3763('0x25')](handleEntityNotFound(_0x805718,null))[_0x3763('0x25')](saveUpdates(_0x51e756['body'],null))[_0x3763('0x25')](respondWithResult(_0x805718,null))[_0x3763('0x35')](handleError(_0x805718,null));};exports['destroy']=function(_0x3a52f1,_0x231aa4){return db[_0x3763('0x2d')]['find']({'where':{'id':_0x3a52f1[_0x3763('0x37')]['id']}})['then'](handleEntityNotFound(_0x231aa4,null))[_0x3763('0x25')](removeEntity(_0x231aa4,null))['catch'](handleError(_0x231aa4,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 194da35..8c916fb 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 _0xd8b4=['request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x37d80e,_0xb03875){var _0x28d5a9=function(_0x4631cd){while(--_0x4631cd){_0x37d80e['push'](_0x37d80e['shift']());}};_0x28d5a9(++_0xb03875);}(_0xd8b4,0xff));var _0x4d8b=function(_0x418627,_0x4e30ac){_0x418627=_0x418627-0x0;var _0x384d53=_0xd8b4[_0x418627];return _0x384d53;};'use strict';var _=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var logger=require(_0x4d8b('0x2'))('api');var moment=require(_0x4d8b('0x3'));var BPromise=require(_0x4d8b('0x4'));var rp=require(_0x4d8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d8b('0x6'));var attributes=require(_0x4d8b('0x7'));module[_0x4d8b('0x8')]=function(_0x5254c8,_0x59b779){return _0x5254c8[_0x4d8b('0x9')](_0x4d8b('0xa'),attributes,{'tableName':_0x4d8b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4d8b('0xc')});}; \ No newline at end of file +var _0x03aa=['moment','bluebird','../../config/environment','exports','define','chat_applications','utf8mb4','lodash','util','api'];(function(_0x12ab5b,_0x71f67a){var _0x481a2c=function(_0x4571c7){while(--_0x4571c7){_0x12ab5b['push'](_0x12ab5b['shift']());}};_0x481a2c(++_0x71f67a);}(_0x03aa,0xe3));var _0xa03a=function(_0x579bab,_0x6fac55){_0x579bab=_0x579bab-0x0;var _0x5bbb34=_0x03aa[_0x579bab];return _0x5bbb34;};'use strict';var _=require(_0xa03a('0x0'));var util=require(_0xa03a('0x1'));var logger=require('../../config/logger')(_0xa03a('0x2'));var moment=require(_0xa03a('0x3'));var BPromise=require(_0xa03a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa03a('0x5'));var attributes=require('./chatApplication.attributes');module[_0xa03a('0x6')]=function(_0x3ba950,_0x333c93){return _0x3ba950[_0xa03a('0x7')]('ChatApplication',attributes,{'tableName':_0xa03a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa03a('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b41c1a1..032efb9 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 _0xdd3f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatApplication,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x502195,_0x24a1d8){var _0x490cfd=function(_0x89a7fd){while(--_0x89a7fd){_0x502195['push'](_0x502195['shift']());}};_0x490cfd(++_0x24a1d8);}(_0xdd3f,0xb4));var _0xfdd3=function(_0x9d835b,_0x150225){_0x9d835b=_0x9d835b-0x0;var _0xe0e98c=_0xdd3f[_0x9d835b];return _0xe0e98c;};'use strict';var _=require(_0xfdd3('0x0'));var util=require('util');var moment=require(_0xfdd3('0x1'));var BPromise=require(_0xfdd3('0x2'));var rs=require(_0xfdd3('0x3'));var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require(_0xfdd3('0x7'))(_0xfdd3('0x8'));var config=require(_0xfdd3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfdd3('0xa')][_0xfdd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b0e8,_0x2e4d17,_0x47ad60){return new BPromise(function(_0x2e150d,_0x18d978){return client[_0xfdd3('0xc')](_0x15b0e8,_0x47ad60)['then'](function(_0xb50d84){logger['info']('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xfdd3('0xd'));logger['debug'](_0xfdd3('0xe'),_0x2e4d17,'request\x20sent',JSON[_0xfdd3('0xf')](_0xb50d84));if(_0xb50d84[_0xfdd3('0x10')]){if(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x11')]===0x1f4){logger[_0xfdd3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xb50d84['error'][_0xfdd3('0x12')]);return _0x18d978(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);}logger[_0xfdd3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);return _0x2e150d(_0xb50d84[_0xfdd3('0x10')][_0xfdd3('0x12')]);}else{logger[_0xfdd3('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2e4d17,'request\x20sent');_0x2e150d(_0xb50d84[_0xfdd3('0x14')][_0xfdd3('0x12')]);}})[_0xfdd3('0x15')](function(_0x5df678){logger[_0xfdd3('0x10')](_0xfdd3('0x16'),_0x2e4d17,_0x5df678);_0x18d978(_0x5df678);});});} \ No newline at end of file +var _0x8532=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x22708b,_0x2bee57){var _0x3e0055=function(_0x2215a2){while(--_0x2215a2){_0x22708b['push'](_0x22708b['shift']());}};_0x3e0055(++_0x2bee57);}(_0x8532,0x1f3));var _0x2853=function(_0x499def,_0x1db2ff){_0x499def=_0x499def-0x0;var _0x5c33ec=_0x8532[_0x499def];return _0x5c33ec;};'use strict';var _=require(_0x2853('0x0'));var util=require(_0x2853('0x1'));var moment=require(_0x2853('0x2'));var BPromise=require('bluebird');var rs=require(_0x2853('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2853('0x4'))['db'];var utils=require(_0x2853('0x5'));var logger=require(_0x2853('0x6'))(_0x2853('0x7'));var config=require(_0x2853('0x8'));var jayson=require(_0x2853('0x9'));var client=jayson[_0x2853('0xa')][_0x2853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x268bf8,_0x290559,_0x3f1da4){return new BPromise(function(_0x56c7ab,_0x112af5){return client[_0x2853('0xc')](_0x268bf8,_0x3f1da4)[_0x2853('0xd')](function(_0x4df9b7){logger[_0x2853('0xe')](_0x2853('0xf'),_0x290559,_0x2853('0x10'));logger[_0x2853('0x11')](_0x2853('0x12'),_0x290559,'request\x20sent',JSON['stringify'](_0x4df9b7));if(_0x4df9b7[_0x2853('0x13')]){if(_0x4df9b7[_0x2853('0x13')][_0x2853('0x14')]===0x1f4){logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);return _0x112af5(_0x4df9b7[_0x2853('0x13')]['message']);}logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);return _0x56c7ab(_0x4df9b7[_0x2853('0x13')][_0x2853('0x15')]);}else{logger['info'](_0x2853('0xf'),_0x290559,'request\x20sent');_0x56c7ab(_0x4df9b7[_0x2853('0x16')][_0x2853('0x15')]);}})[_0x2853('0x17')](function(_0x44490e){logger[_0x2853('0x13')](_0x2853('0xf'),_0x290559,_0x44490e);_0x112af5(_0x44490e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 57a8a43..593438d 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 _0x98d2=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','multer'];(function(_0x37951b,_0x41b79c){var _0x5d2855=function(_0x37432c){while(--_0x37432c){_0x37951b['push'](_0x37951b['shift']());}};_0x5d2855(++_0x41b79c);}(_0x98d2,0xfb));var _0x298d=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x98d2[_0x2c1e7a];return _0xcacb4f;};'use strict';var multer=require(_0x298d('0x0'));var util=require(_0x298d('0x1'));var path=require(_0x298d('0x2'));var timeout=require('connect-timeout');var express=require(_0x298d('0x3'));var router=express['Router']();var fs_extra=require(_0x298d('0x4'));var auth=require(_0x298d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x298d('0x6'));var controller=require(_0x298d('0x7'));router[_0x298d('0x8')](_0x298d('0x9'),auth[_0x298d('0xa')](),controller[_0x298d('0xb')]);router[_0x298d('0xc')](_0x298d('0x9'),auth[_0x298d('0xa')](),controller[_0x298d('0xd')]);router['delete'](_0x298d('0x9'),auth[_0x298d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2176=['/:id','show','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get'];(function(_0x46723d,_0x3d6bd5){var _0x5e2b3a=function(_0x1a3c33){while(--_0x1a3c33){_0x46723d['push'](_0x46723d['shift']());}};_0x5e2b3a(++_0x3d6bd5);}(_0x2176,0x17e));var _0x6217=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2176[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6217('0x0'));var util=require(_0x6217('0x1'));var path=require(_0x6217('0x2'));var timeout=require(_0x6217('0x3'));var express=require(_0x6217('0x4'));var router=express['Router']();var fs_extra=require(_0x6217('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6217('0x6'));var controller=require('./chatApplication.controller');router[_0x6217('0x7')](_0x6217('0x8'),auth['isAuthenticated'](),controller[_0x6217('0x9')]);router[_0x6217('0xa')](_0x6217('0x8'),auth[_0x6217('0xb')](),controller[_0x6217('0xc')]);router[_0x6217('0xd')](_0x6217('0x8'),auth[_0x6217('0xb')](),controller['destroy']);module[_0x6217('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 9c408ca..870f261 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 _0x3249=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x3249,0xd2));var _0x9324=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3249[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x9324('0x0'));module[_0x9324('0x1')]={'name':{'type':Sequelize[_0x9324('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9324('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdb82=['sequelize','STRING'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xdb82,0x1dc));var _0x2db8=function(_0x19bfd1,_0xa61e9c){_0x19bfd1=_0x19bfd1-0x0;var _0xd5d89a=_0xdb82[_0x19bfd1];return _0xd5d89a;};'use strict';var Sequelize=require(_0x2db8('0x0'));module['exports']={'name':{'type':Sequelize[_0x2db8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2db8('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b642575..78cb1eb 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 _0x9a9d=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf'];(function(_0x1a2ecd,_0xc517f8){var _0x3f7b51=function(_0x4c6f99){while(--_0x4c6f99){_0x1a2ecd['push'](_0x1a2ecd['shift']());}};_0x3f7b51(++_0xc517f8);}(_0x9a9d,0x17e));var _0xd9a9=function(_0x23f071,_0x50c494){_0x23f071=_0x23f071-0x0;var _0x1020be=_0x9a9d[_0x23f071];return _0x1020be;};'use strict';var emlformat=require(_0xd9a9('0x0'));var rimraf=require(_0xd9a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd9a9('0x3'));var Mustache=require(_0xd9a9('0x4'));var util=require(_0xd9a9('0x5'));var path=require(_0xd9a9('0x6'));var sox=require(_0xd9a9('0x7'));var csv=require(_0xd9a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9a9('0x9'));var _=require(_0xd9a9('0xa'));var squel=require(_0xd9a9('0xb'));var crypto=require(_0xd9a9('0xc'));var jsforce=require(_0xd9a9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd9a9('0x8'));var querystring=require(_0xd9a9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd9a9('0x10'));var hardwareService=require(_0xd9a9('0x11'));var logger=require(_0xd9a9('0x12'))(_0xd9a9('0x13'));var utils=require(_0xd9a9('0x14'));var config=require(_0xd9a9('0x15'));var licenseUtil=require(_0xd9a9('0x16'));var db=require('../../mysqldb')['db'];config[_0xd9a9('0x17')]=_[_0xd9a9('0x18')](config[_0xd9a9('0x17')],{'host':_0xd9a9('0x19'),'port':0x18eb});var socket=require(_0xd9a9('0x1a'))(new Redis(config[_0xd9a9('0x17')]));require('./chatGroup.socket')[_0xd9a9('0x1b')](socket);function respondWithStatusCode(_0x1358da,_0x4a3195){_0x4a3195=_0x4a3195||0xcc;return function(_0x368cbb){if(_0x368cbb){return _0x1358da[_0xd9a9('0x1c')](_0x4a3195);}return _0x1358da['status'](_0x4a3195)[_0xd9a9('0x1d')]();};}function respondWithResult(_0x3b633f,_0x300fdf){_0x300fdf=_0x300fdf||0xc8;return function(_0x1b483d){if(_0x1b483d){return _0x3b633f[_0xd9a9('0x1e')](_0x300fdf)[_0xd9a9('0x1f')](_0x1b483d);}};}function respondWithFilteredResult(_0xb0fce2,_0x3957a2){return function(_0x5cf1c5){if(_0x5cf1c5){var _0x1cc3d9=typeof _0x3957a2['offset']===_0xd9a9('0x20')&&typeof _0x3957a2[_0xd9a9('0x21')]===_0xd9a9('0x20');var _0x2bc4af=_0x5cf1c5[_0xd9a9('0x22')];var _0x78a7fe=_0x1cc3d9?0x0:_0x3957a2[_0xd9a9('0x23')];var _0x142fba=_0x1cc3d9?_0x5cf1c5[_0xd9a9('0x22')]:_0x3957a2[_0xd9a9('0x23')]+_0x3957a2[_0xd9a9('0x21')];var _0x253f62;if(_0x142fba>=_0x2bc4af){_0x142fba=_0x2bc4af;_0x253f62=0xc8;}else{_0x253f62=0xce;}_0xb0fce2[_0xd9a9('0x1e')](_0x253f62);return _0xb0fce2[_0xd9a9('0x24')](_0xd9a9('0x25'),_0x78a7fe+'-'+_0x142fba+'/'+_0x2bc4af)[_0xd9a9('0x1f')](_0x5cf1c5);}return null;};}function patchUpdates(_0x3e9986){return function(_0x55add9){try{jsonpatch[_0xd9a9('0x26')](_0x55add9,_0x3e9986,!![]);}catch(_0x494051){return BPromise[_0xd9a9('0x27')](_0x494051);}return _0x55add9['save']();};}function saveUpdates(_0x2310d1,_0x1f2f34){return function(_0x16f2c7){if(_0x16f2c7){return _0x16f2c7[_0xd9a9('0x28')](_0x2310d1)['then'](function(_0x2436f0){return _0x2436f0;});}return null;};}function removeEntity(_0x4f0e1f,_0x5316c4){return function(_0x575751){if(_0x575751){return _0x575751['destroy']()[_0xd9a9('0x29')](function(){_0x4f0e1f[_0xd9a9('0x1e')](0xcc)[_0xd9a9('0x1d')]();});}};}function handleEntityNotFound(_0xd44fcd,_0x26c4a6){return function(_0x4c7794){if(!_0x4c7794){_0xd44fcd[_0xd9a9('0x1c')](0x194);}return _0x4c7794;};}function handleError(_0x17eaf6,_0x968d0b){_0x968d0b=_0x968d0b||0x1f4;return function(_0x432c84){logger[_0xd9a9('0x2a')](_0x432c84[_0xd9a9('0x2b')]);if(_0x432c84[_0xd9a9('0x2c')]){delete _0x432c84[_0xd9a9('0x2c')];}_0x17eaf6[_0xd9a9('0x1e')](_0x968d0b)[_0xd9a9('0x2d')](_0x432c84);};}exports['index']=function(_0x2c0f5f,_0x6c24d5){var _0x373417={},_0x59bc40={},_0x367478={'count':0x0,'rows':[]};var _0x3d6184=_[_0xd9a9('0x2e')](db[_0xd9a9('0x2f')][_0xd9a9('0x30')],function(_0x2d2a39){return{'name':_0x2d2a39[_0xd9a9('0x31')],'type':_0x2d2a39[_0xd9a9('0x32')]['key']};});_0x59bc40[_0xd9a9('0x33')]=_[_0xd9a9('0x2e')](_0x3d6184,_0xd9a9('0x2c'));_0x59bc40['query']=_['keys'](_0x2c0f5f[_0xd9a9('0x34')]);_0x59bc40[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x59bc40[_0xd9a9('0x33')],_0x59bc40[_0xd9a9('0x34')]);_0x373417[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x59bc40[_0xd9a9('0x33')],qs[_0xd9a9('0x38')](_0x2c0f5f[_0xd9a9('0x34')]['fields']));_0x373417['attributes']=_0x373417[_0xd9a9('0x37')][_0xd9a9('0x39')]?_0x373417[_0xd9a9('0x37')]:_0x59bc40[_0xd9a9('0x33')];if(!_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x3a')](_0xd9a9('0x3b'))){_0x373417[_0xd9a9('0x21')]=qs[_0xd9a9('0x21')](_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x21')]);_0x373417['offset']=qs[_0xd9a9('0x23')](_0x2c0f5f[_0xd9a9('0x34')]['offset']);}_0x373417[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x2c0f5f['query'][_0xd9a9('0x3d')]);_0x373417[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_[_0xd9a9('0x3f')](_0x2c0f5f[_0xd9a9('0x34')],_0x59bc40[_0xd9a9('0x35')]),_0x3d6184);if(_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x373417[_0xd9a9('0x3e')]=_['merge'](_0x373417['where'],{'$or':_[_0xd9a9('0x2e')](_0x3d6184,function(_0x4611e4){if(_0x4611e4[_0xd9a9('0x32')]!==_0xd9a9('0x41')){var _0x16cae0={};_0x16cae0[_0x4611e4[_0xd9a9('0x2c')]]={'$like':'%'+_0x2c0f5f[_0xd9a9('0x34')][_0xd9a9('0x40')]+'%'};return _0x16cae0;}})});}_0x373417=_[_0xd9a9('0x42')]({},_0x373417,_0x2c0f5f['options']);var _0x29ed93={'where':_0x373417[_0xd9a9('0x3e')]};return db[_0xd9a9('0x2f')][_0xd9a9('0x22')](_0x29ed93)[_0xd9a9('0x29')](function(_0x3eacab){_0x367478[_0xd9a9('0x22')]=_0x3eacab;if(_0x2c0f5f['query'][_0xd9a9('0x43')]){_0x373417['include']=[{'all':!![]}];}return db[_0xd9a9('0x2f')][_0xd9a9('0x44')](_0x373417);})[_0xd9a9('0x29')](function(_0x40f1aa){_0x367478[_0xd9a9('0x45')]=_0x40f1aa;return _0x367478;})[_0xd9a9('0x29')](respondWithFilteredResult(_0x6c24d5,_0x373417))['catch'](handleError(_0x6c24d5,null));};exports[_0xd9a9('0x46')]=function(_0x3ec264,_0x4d61f6){var _0x505ac8={'raw':!![],'where':{'id':_0x3ec264[_0xd9a9('0x47')]['id']}},_0x3453ba={};_0x3453ba[_0xd9a9('0x33')]=_[_0xd9a9('0x48')](db['ChatGroup']['rawAttributes']);_0x3453ba[_0xd9a9('0x34')]=_[_0xd9a9('0x48')](_0x3ec264[_0xd9a9('0x34')]);_0x3453ba[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x3453ba[_0xd9a9('0x33')],_0x3453ba[_0xd9a9('0x34')]);_0x505ac8[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x3453ba[_0xd9a9('0x33')],qs[_0xd9a9('0x38')](_0x3ec264[_0xd9a9('0x34')][_0xd9a9('0x38')]));_0x505ac8[_0xd9a9('0x37')]=_0x505ac8[_0xd9a9('0x37')]['length']?_0x505ac8[_0xd9a9('0x37')]:_0x3453ba[_0xd9a9('0x33')];if(_0x3ec264[_0xd9a9('0x34')][_0xd9a9('0x43')]){_0x505ac8[_0xd9a9('0x49')]=[{'all':!![]}];}_0x505ac8=_[_0xd9a9('0x42')]({},_0x505ac8,_0x3ec264[_0xd9a9('0x4a')]);return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')](_0x505ac8)[_0xd9a9('0x29')](handleEntityNotFound(_0x4d61f6,null))['then'](respondWithResult(_0x4d61f6,null))[_0xd9a9('0x4c')](handleError(_0x4d61f6,null));};exports[_0xd9a9('0x4d')]=function(_0x31469e,_0x5d068d){return db[_0xd9a9('0x2f')][_0xd9a9('0x4d')](_0x31469e['body'],{})[_0xd9a9('0x29')](respondWithResult(_0x5d068d,0xc9))[_0xd9a9('0x4c')](handleError(_0x5d068d,null));};exports[_0xd9a9('0x28')]=function(_0x2eac5f,_0x1fc12b){if(_0x2eac5f['body']['id']){delete _0x2eac5f['body']['id'];}return db['ChatGroup'][_0xd9a9('0x4b')]({'where':{'id':_0x2eac5f[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x1fc12b,null))[_0xd9a9('0x29')](saveUpdates(_0x2eac5f[_0xd9a9('0x4e')],null))['then'](respondWithResult(_0x1fc12b,null))[_0xd9a9('0x4c')](handleError(_0x1fc12b,null));};exports['destroy']=function(_0x5d3225,_0x369280){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x5d3225[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x369280,null))[_0xd9a9('0x29')](removeEntity(_0x369280,null))[_0xd9a9('0x4c')](handleError(_0x369280,null));};exports[_0xd9a9('0x4f')]=function(_0x28a69a,_0x4642ea){return db[_0xd9a9('0x2f')][_0xd9a9('0x4f')]()[_0xd9a9('0x29')](respondWithResult(_0x4642ea,null))[_0xd9a9('0x4c')](handleError(_0x4642ea,null));};exports['getUnread']=function(_0x2d6c4a,_0x415a1e,_0x5a67b4){return db[_0xd9a9('0x50')][_0xd9a9('0x22')]({'where':{'ChatGroupId':_0x2d6c4a[_0xd9a9('0x47')]['id'],'ToId':_0x2d6c4a[_0xd9a9('0x51')]['id'],'read':![]}})[_0xd9a9('0x29')](function(_0x3ebd29){return{'id':_[_0xd9a9('0x52')](_0x2d6c4a['params']['id']),'count':_0x3ebd29};})[_0xd9a9('0x29')](respondWithResult(_0x415a1e,null))[_0xd9a9('0x4c')](handleError(_0x415a1e,null));};exports[_0xd9a9('0x53')]=function(_0x35b923,_0x31b550,_0x3c915a){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x35b923[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x31b550,null))['then'](function(_0x309bb9){if(_0x309bb9){return _0x309bb9['addMembers'](_0x35b923[_0xd9a9('0x4e')][_0xd9a9('0x54')],_[_0xd9a9('0x55')](_0x35b923[_0xd9a9('0x4e')],[_0xd9a9('0x54'),'id'])||{});}})['then'](respondWithResult(_0x31b550,null))[_0xd9a9('0x4c')](handleError(_0x31b550,null));};exports[_0xd9a9('0x56')]=function(_0x617f58,_0x27773a,_0x2ea197){var _0x568bec={};var _0x57a0c2={};var _0x1f2059;var _0x40baee;return db[_0xd9a9('0x2f')][_0xd9a9('0x57')]({'where':{'id':_0x617f58['params']['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x27773a,null))['then'](function(_0x54a1c7){if(_0x54a1c7){_0x1f2059=_0x54a1c7;_0x57a0c2[_0xd9a9('0x33')]=_[_0xd9a9('0x48')](db[_0xd9a9('0x58')]['rawAttributes']);_0x57a0c2[_0xd9a9('0x34')]=_[_0xd9a9('0x48')](_0x617f58['query']);_0x57a0c2[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x57a0c2[_0xd9a9('0x33')],_0x57a0c2[_0xd9a9('0x34')]);_0x568bec[_0xd9a9('0x37')]=_['intersection'](_0x57a0c2['model'],qs['fields'](_0x617f58[_0xd9a9('0x34')]['fields']));_0x568bec['attributes']=_0x568bec[_0xd9a9('0x37')]['length']?_0x568bec[_0xd9a9('0x37')]:_0x57a0c2[_0xd9a9('0x33')];_0x568bec[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x3d')]);_0x568bec[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_['pick'](_0x617f58[_0xd9a9('0x34')],_0x57a0c2[_0xd9a9('0x35')]));if(_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x568bec[_0xd9a9('0x3e')]=_['merge'](_0x568bec['where'],{'$or':_[_0xd9a9('0x2e')](_0x568bec['attributes'],function(_0x378111){var _0x1bef37={};_0x1bef37[_0x378111]={'$like':'%'+_0x617f58['query'][_0xd9a9('0x40')]+'%'};return _0x1bef37;})});}_0x568bec=_[_0xd9a9('0x42')]({},_0x568bec,_0x617f58[_0xd9a9('0x4a')]);return _0x1f2059[_0xd9a9('0x56')](_0x568bec);}})[_0xd9a9('0x29')](function(_0x1cd86b){if(_0x1cd86b){_0x40baee=_0x1cd86b[_0xd9a9('0x39')];if(!_0x617f58['query']['hasOwnProperty'](_0xd9a9('0x3b'))){_0x568bec['limit']=qs['limit'](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x21')]);_0x568bec[_0xd9a9('0x23')]=qs['offset'](_0x617f58[_0xd9a9('0x34')][_0xd9a9('0x23')]);}return _0x1f2059['getMembers'](_0x568bec);}})['then'](function(_0x49cc50){if(_0x49cc50){return _0x49cc50?{'count':_0x40baee,'rows':_0x49cc50}:null;}})[_0xd9a9('0x29')](respondWithResult(_0x27773a,null))[_0xd9a9('0x4c')](handleError(_0x27773a,null));};exports[_0xd9a9('0x59')]=function(_0x49ddb1,_0x25e948,_0x4898e8){return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0x49ddb1[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x25e948,null))['then'](function(_0x4da13a){if(_0x4da13a){return _0x4da13a['removeMembers'](_0x49ddb1[_0xd9a9('0x34')][_0xd9a9('0x54')]);}})[_0xd9a9('0x29')](respondWithStatusCode(_0x25e948,null))[_0xd9a9('0x4c')](handleError(_0x25e948,null));};exports['addMessage']=function(_0xa56403,_0xafe1c5,_0x4667dc){if(_0xa56403[_0xd9a9('0x4e')]['id']){delete _0xa56403[_0xd9a9('0x4e')]['id'];}return db[_0xd9a9('0x2f')][_0xd9a9('0x4b')]({'where':{'id':_0xa56403[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0xafe1c5,null))[_0xd9a9('0x29')](function(_0x2db257){if(_0x2db257){_0xa56403['body'][_0xd9a9('0x5a')]=_0x2db257['id'];return db['ChatInternalMessage'][_0xd9a9('0x4d')](_0xa56403[_0xd9a9('0x4e')]);}})['then'](respondWithResult(_0xafe1c5,null))['catch'](handleError(_0xafe1c5,null));};exports['getMessages']=function(_0x37dbf4,_0x456ff8,_0x122f4e){var _0x30366a={};var _0x4d5b22={};var _0x4b2bfe;var _0xd5914b;return db[_0xd9a9('0x2f')][_0xd9a9('0x57')]({'where':{'id':_0x37dbf4[_0xd9a9('0x47')]['id']}})[_0xd9a9('0x29')](handleEntityNotFound(_0x456ff8,null))['then'](function(_0x50065b){if(_0x50065b){_0x4b2bfe=_0x50065b;_0x4d5b22['model']=_[_0xd9a9('0x48')](db['ChatInternalMessage'][_0xd9a9('0x30')]);_0x4d5b22[_0xd9a9('0x34')]=_['keys'](_0x37dbf4[_0xd9a9('0x34')]);_0x4d5b22[_0xd9a9('0x35')]=_[_0xd9a9('0x36')](_0x4d5b22[_0xd9a9('0x33')],_0x4d5b22[_0xd9a9('0x34')]);_0x30366a[_0xd9a9('0x37')]=_[_0xd9a9('0x36')](_0x4d5b22['model'],qs[_0xd9a9('0x38')](_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x38')]));_0x30366a['attributes']=_0x30366a[_0xd9a9('0x37')]['length']?_0x30366a[_0xd9a9('0x37')]:_0x4d5b22[_0xd9a9('0x33')];_0x30366a[_0xd9a9('0x3c')]=qs[_0xd9a9('0x3d')](_0x37dbf4['query'][_0xd9a9('0x3d')]);_0x30366a[_0xd9a9('0x3e')]=qs[_0xd9a9('0x35')](_[_0xd9a9('0x3f')](_0x37dbf4[_0xd9a9('0x34')],_0x4d5b22[_0xd9a9('0x35')]));if(_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x40')]){_0x30366a[_0xd9a9('0x3e')]=_[_0xd9a9('0x42')](_0x30366a[_0xd9a9('0x3e')],{'$or':_[_0xd9a9('0x2e')](_0x30366a[_0xd9a9('0x37')],function(_0x224f98){var _0x59c761={};_0x59c761[_0x224f98]={'$like':'%'+_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x40')]+'%'};return _0x59c761;})});}if(_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x5b')]){var _0xf6af49=_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x5b')][_0xd9a9('0x5c')](',');var _0x4669b2={};_0x4669b2[_0xf6af49[0x0]]={'$gte':moment(_0xf6af49[0x1])[_0xd9a9('0x5d')](_0xd9a9('0x5e'))};_0x30366a[_0xd9a9('0x3e')]=_[_0xd9a9('0x42')](_0x30366a['where'],_0x4669b2);}_0x30366a=_['merge']({},_0x30366a,_0x37dbf4[_0xd9a9('0x4a')]);return _0x4b2bfe['getMessages'](_0x30366a);}})[_0xd9a9('0x29')](function(_0x22ce17){if(_0x22ce17){_0xd5914b=_0x22ce17[_0xd9a9('0x39')];if(!_0x37dbf4[_0xd9a9('0x34')][_0xd9a9('0x3a')](_0xd9a9('0x3b'))){_0x30366a[_0xd9a9('0x21')]=qs[_0xd9a9('0x21')](_0x37dbf4[_0xd9a9('0x34')]['limit']);_0x30366a['offset']=qs[_0xd9a9('0x23')](_0x37dbf4['query'][_0xd9a9('0x23')]);}return _0x4b2bfe[_0xd9a9('0x5f')](_0x30366a);}})[_0xd9a9('0x29')](function(_0x563728){if(_0x563728){return _0x563728?{'count':_0xd5914b,'rows':_0x563728}:null;}})['then'](respondWithResult(_0x456ff8,null))['catch'](handleError(_0x456ff8,null));}; \ No newline at end of file +var _0x945d=['util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','User','removeMembers','addMessage','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x295df8,_0x1f9924){var _0x1c4b61=function(_0x55f262){while(--_0x55f262){_0x295df8['push'](_0x295df8['shift']());}};_0x1c4b61(++_0x1f9924);}(_0x945d,0x112));var _0xd945=function(_0x482f68,_0x274c1d){_0x482f68=_0x482f68-0x0;var _0x2b5a77=_0x945d[_0x482f68];return _0x2b5a77;};'use strict';var emlformat=require(_0xd945('0x0'));var rimraf=require(_0xd945('0x1'));var zipdir=require(_0xd945('0x2'));var jsonpatch=require(_0xd945('0x3'));var rp=require(_0xd945('0x4'));var moment=require(_0xd945('0x5'));var BPromise=require(_0xd945('0x6'));var Mustache=require(_0xd945('0x7'));var util=require(_0xd945('0x8'));var path=require(_0xd945('0x9'));var sox=require(_0xd945('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd945('0xb'));var _=require(_0xd945('0xc'));var squel=require(_0xd945('0xd'));var crypto=require(_0xd945('0xe'));var jsforce=require(_0xd945('0xf'));var deskjs=require(_0xd945('0x10'));var toCsv=require(_0xd945('0x11'));var querystring=require(_0xd945('0x12'));var Papa=require(_0xd945('0x13'));var Redis=require('ioredis');var authService=require(_0xd945('0x14'));var qs=require(_0xd945('0x15'));var as=require(_0xd945('0x16'));var hardwareService=require(_0xd945('0x17'));var logger=require(_0xd945('0x18'))(_0xd945('0x19'));var utils=require(_0xd945('0x1a'));var config=require(_0xd945('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd945('0x1c'))['db'];config[_0xd945('0x1d')]=_['defaults'](config[_0xd945('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd945('0x1d')]));require(_0xd945('0x1e'))[_0xd945('0x1f')](socket);function respondWithStatusCode(_0x2a6ff6,_0x2ec2a7){_0x2ec2a7=_0x2ec2a7||0xcc;return function(_0x3fe7a0){if(_0x3fe7a0){return _0x2a6ff6[_0xd945('0x20')](_0x2ec2a7);}return _0x2a6ff6[_0xd945('0x21')](_0x2ec2a7)[_0xd945('0x22')]();};}function respondWithResult(_0x1cfebf,_0x2bce57){_0x2bce57=_0x2bce57||0xc8;return function(_0xe36b23){if(_0xe36b23){return _0x1cfebf['status'](_0x2bce57)[_0xd945('0x23')](_0xe36b23);}};}function respondWithFilteredResult(_0xa324e7,_0xe4a797){return function(_0x4b8a5f){if(_0x4b8a5f){var _0x4d7419=typeof _0xe4a797[_0xd945('0x24')]===_0xd945('0x25')&&typeof _0xe4a797[_0xd945('0x26')]===_0xd945('0x25');var _0x5aac17=_0x4b8a5f['count'];var _0x4e7139=_0x4d7419?0x0:_0xe4a797[_0xd945('0x24')];var _0x1efe3b=_0x4d7419?_0x4b8a5f['count']:_0xe4a797[_0xd945('0x24')]+_0xe4a797[_0xd945('0x26')];var _0x43d69a;if(_0x1efe3b>=_0x5aac17){_0x1efe3b=_0x5aac17;_0x43d69a=0xc8;}else{_0x43d69a=0xce;}_0xa324e7[_0xd945('0x21')](_0x43d69a);return _0xa324e7[_0xd945('0x27')]('Content-Range',_0x4e7139+'-'+_0x1efe3b+'/'+_0x5aac17)[_0xd945('0x23')](_0x4b8a5f);}return null;};}function patchUpdates(_0x2ef7cb){return function(_0x4292dc){try{jsonpatch['apply'](_0x4292dc,_0x2ef7cb,!![]);}catch(_0xddcafe){return BPromise[_0xd945('0x28')](_0xddcafe);}return _0x4292dc['save']();};}function saveUpdates(_0x5951af,_0x2b4717){return function(_0x2f8eb0){if(_0x2f8eb0){return _0x2f8eb0['update'](_0x5951af)[_0xd945('0x29')](function(_0xc0a73d){return _0xc0a73d;});}return null;};}function removeEntity(_0x147c69,_0x5a26a2){return function(_0x12e1ad){if(_0x12e1ad){return _0x12e1ad[_0xd945('0x2a')]()[_0xd945('0x29')](function(){_0x147c69[_0xd945('0x21')](0xcc)[_0xd945('0x22')]();});}};}function handleEntityNotFound(_0x552276,_0x30dd2c){return function(_0x118bb1){if(!_0x118bb1){_0x552276[_0xd945('0x20')](0x194);}return _0x118bb1;};}function handleError(_0x5de59c,_0x2a2534){_0x2a2534=_0x2a2534||0x1f4;return function(_0x5409c9){logger[_0xd945('0x2b')](_0x5409c9[_0xd945('0x2c')]);if(_0x5409c9['name']){delete _0x5409c9[_0xd945('0x2d')];}_0x5de59c[_0xd945('0x21')](_0x2a2534)['send'](_0x5409c9);};}exports[_0xd945('0x2e')]=function(_0x4b7786,_0x2139a5){var _0x37cbd8={},_0x45640a={},_0x32dc93={'count':0x0,'rows':[]};var _0x22170f=_[_0xd945('0x2f')](db[_0xd945('0x30')][_0xd945('0x31')],function(_0x5b57d1){return{'name':_0x5b57d1['fieldName'],'type':_0x5b57d1[_0xd945('0x32')]['key']};});_0x45640a[_0xd945('0x33')]=_[_0xd945('0x2f')](_0x22170f,_0xd945('0x2d'));_0x45640a[_0xd945('0x34')]=_[_0xd945('0x35')](_0x4b7786['query']);_0x45640a[_0xd945('0x36')]=_[_0xd945('0x37')](_0x45640a[_0xd945('0x33')],_0x45640a['query']);_0x37cbd8[_0xd945('0x38')]=_[_0xd945('0x37')](_0x45640a[_0xd945('0x33')],qs['fields'](_0x4b7786[_0xd945('0x34')][_0xd945('0x39')]));_0x37cbd8[_0xd945('0x38')]=_0x37cbd8['attributes'][_0xd945('0x3a')]?_0x37cbd8[_0xd945('0x38')]:_0x45640a[_0xd945('0x33')];if(!_0x4b7786[_0xd945('0x34')][_0xd945('0x3b')](_0xd945('0x3c'))){_0x37cbd8[_0xd945('0x26')]=qs[_0xd945('0x26')](_0x4b7786[_0xd945('0x34')][_0xd945('0x26')]);_0x37cbd8[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x4b7786[_0xd945('0x34')]['offset']);}_0x37cbd8[_0xd945('0x3d')]=qs[_0xd945('0x3e')](_0x4b7786[_0xd945('0x34')][_0xd945('0x3e')]);_0x37cbd8[_0xd945('0x3f')]=qs['filters'](_[_0xd945('0x40')](_0x4b7786[_0xd945('0x34')],_0x45640a[_0xd945('0x36')]),_0x22170f);if(_0x4b7786[_0xd945('0x34')][_0xd945('0x41')]){_0x37cbd8['where']=_[_0xd945('0x42')](_0x37cbd8[_0xd945('0x3f')],{'$or':_[_0xd945('0x2f')](_0x22170f,function(_0x375ea0){if(_0x375ea0['type']!==_0xd945('0x43')){var _0x414eab={};_0x414eab[_0x375ea0[_0xd945('0x2d')]]={'$like':'%'+_0x4b7786[_0xd945('0x34')][_0xd945('0x41')]+'%'};return _0x414eab;}})});}_0x37cbd8=_['merge']({},_0x37cbd8,_0x4b7786['options']);var _0x56c8b9={'where':_0x37cbd8[_0xd945('0x3f')]};return db[_0xd945('0x30')][_0xd945('0x44')](_0x56c8b9)[_0xd945('0x29')](function(_0x6b2a98){_0x32dc93[_0xd945('0x44')]=_0x6b2a98;if(_0x4b7786[_0xd945('0x34')][_0xd945('0x45')]){_0x37cbd8[_0xd945('0x46')]=[{'all':!![]}];}return db[_0xd945('0x30')][_0xd945('0x47')](_0x37cbd8);})[_0xd945('0x29')](function(_0x5272b3){_0x32dc93[_0xd945('0x48')]=_0x5272b3;return _0x32dc93;})[_0xd945('0x29')](respondWithFilteredResult(_0x2139a5,_0x37cbd8))[_0xd945('0x49')](handleError(_0x2139a5,null));};exports['show']=function(_0x1f8650,_0x3bc9c0){var _0x21132a={'raw':!![],'where':{'id':_0x1f8650[_0xd945('0x4a')]['id']}},_0x1100e4={};_0x1100e4[_0xd945('0x33')]=_['keys'](db[_0xd945('0x30')][_0xd945('0x31')]);_0x1100e4[_0xd945('0x34')]=_[_0xd945('0x35')](_0x1f8650[_0xd945('0x34')]);_0x1100e4[_0xd945('0x36')]=_[_0xd945('0x37')](_0x1100e4[_0xd945('0x33')],_0x1100e4[_0xd945('0x34')]);_0x21132a['attributes']=_[_0xd945('0x37')](_0x1100e4[_0xd945('0x33')],qs[_0xd945('0x39')](_0x1f8650[_0xd945('0x34')]['fields']));_0x21132a[_0xd945('0x38')]=_0x21132a[_0xd945('0x38')][_0xd945('0x3a')]?_0x21132a[_0xd945('0x38')]:_0x1100e4['model'];if(_0x1f8650[_0xd945('0x34')][_0xd945('0x45')]){_0x21132a[_0xd945('0x46')]=[{'all':!![]}];}_0x21132a=_[_0xd945('0x42')]({},_0x21132a,_0x1f8650[_0xd945('0x4b')]);return db[_0xd945('0x30')][_0xd945('0x4c')](_0x21132a)[_0xd945('0x29')](handleEntityNotFound(_0x3bc9c0,null))[_0xd945('0x29')](respondWithResult(_0x3bc9c0,null))[_0xd945('0x49')](handleError(_0x3bc9c0,null));};exports[_0xd945('0x4d')]=function(_0x5e076d,_0x52f7fc){return db[_0xd945('0x30')][_0xd945('0x4d')](_0x5e076d[_0xd945('0x4e')],{})[_0xd945('0x29')](respondWithResult(_0x52f7fc,0xc9))[_0xd945('0x49')](handleError(_0x52f7fc,null));};exports[_0xd945('0x4f')]=function(_0x2c3086,_0x3a38f7){if(_0x2c3086[_0xd945('0x4e')]['id']){delete _0x2c3086['body']['id'];}return db[_0xd945('0x30')][_0xd945('0x4c')]({'where':{'id':_0x2c3086[_0xd945('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a38f7,null))['then'](saveUpdates(_0x2c3086['body'],null))[_0xd945('0x29')](respondWithResult(_0x3a38f7,null))[_0xd945('0x49')](handleError(_0x3a38f7,null));};exports[_0xd945('0x2a')]=function(_0x5df992,_0x4048e9){return db[_0xd945('0x30')][_0xd945('0x4c')]({'where':{'id':_0x5df992[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x4048e9,null))[_0xd945('0x29')](removeEntity(_0x4048e9,null))[_0xd945('0x49')](handleError(_0x4048e9,null));};exports[_0xd945('0x50')]=function(_0x941b74,_0x4f1ae7){return db[_0xd945('0x30')][_0xd945('0x50')]()[_0xd945('0x29')](respondWithResult(_0x4f1ae7,null))[_0xd945('0x49')](handleError(_0x4f1ae7,null));};exports[_0xd945('0x51')]=function(_0x5245b2,_0x12a59e,_0x36adfd){return db[_0xd945('0x52')][_0xd945('0x44')]({'where':{'ChatGroupId':_0x5245b2['params']['id'],'ToId':_0x5245b2[_0xd945('0x53')]['id'],'read':![]}})['then'](function(_0x1692ec){return{'id':_['toInteger'](_0x5245b2[_0xd945('0x4a')]['id']),'count':_0x1692ec};})[_0xd945('0x29')](respondWithResult(_0x12a59e,null))[_0xd945('0x49')](handleError(_0x12a59e,null));};exports[_0xd945('0x54')]=function(_0x216877,_0x44ed16,_0x3e0b8f){return db['ChatGroup'][_0xd945('0x4c')]({'where':{'id':_0x216877[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x44ed16,null))[_0xd945('0x29')](function(_0xaa8c7){if(_0xaa8c7){return _0xaa8c7['addMembers'](_0x216877['body'][_0xd945('0x55')],_['omit'](_0x216877['body'],[_0xd945('0x55'),'id'])||{});}})[_0xd945('0x29')](respondWithResult(_0x44ed16,null))[_0xd945('0x49')](handleError(_0x44ed16,null));};exports[_0xd945('0x56')]=function(_0x2a0556,_0x1f6740,_0x136544){var _0x4e9b66={};var _0x338a54={};var _0x4652f0;var _0x1cef46;return db[_0xd945('0x30')]['findOne']({'where':{'id':_0x2a0556['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x1f6740,null))['then'](function(_0x3f3d63){if(_0x3f3d63){_0x4652f0=_0x3f3d63;_0x338a54['model']=_['keys'](db[_0xd945('0x57')][_0xd945('0x31')]);_0x338a54[_0xd945('0x34')]=_['keys'](_0x2a0556['query']);_0x338a54['filters']=_[_0xd945('0x37')](_0x338a54['model'],_0x338a54['query']);_0x4e9b66[_0xd945('0x38')]=_['intersection'](_0x338a54['model'],qs[_0xd945('0x39')](_0x2a0556[_0xd945('0x34')][_0xd945('0x39')]));_0x4e9b66['attributes']=_0x4e9b66['attributes'][_0xd945('0x3a')]?_0x4e9b66[_0xd945('0x38')]:_0x338a54['model'];_0x4e9b66['order']=qs['sort'](_0x2a0556[_0xd945('0x34')][_0xd945('0x3e')]);_0x4e9b66[_0xd945('0x3f')]=qs['filters'](_[_0xd945('0x40')](_0x2a0556['query'],_0x338a54['filters']));if(_0x2a0556[_0xd945('0x34')][_0xd945('0x41')]){_0x4e9b66[_0xd945('0x3f')]=_['merge'](_0x4e9b66[_0xd945('0x3f')],{'$or':_['map'](_0x4e9b66[_0xd945('0x38')],function(_0x4afb2b){var _0x1c60c8={};_0x1c60c8[_0x4afb2b]={'$like':'%'+_0x2a0556[_0xd945('0x34')][_0xd945('0x41')]+'%'};return _0x1c60c8;})});}_0x4e9b66=_[_0xd945('0x42')]({},_0x4e9b66,_0x2a0556[_0xd945('0x4b')]);return _0x4652f0[_0xd945('0x56')](_0x4e9b66);}})[_0xd945('0x29')](function(_0x54b49a){if(_0x54b49a){_0x1cef46=_0x54b49a['length'];if(!_0x2a0556[_0xd945('0x34')][_0xd945('0x3b')]('nolimit')){_0x4e9b66['limit']=qs[_0xd945('0x26')](_0x2a0556[_0xd945('0x34')][_0xd945('0x26')]);_0x4e9b66[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x2a0556[_0xd945('0x34')][_0xd945('0x24')]);}return _0x4652f0[_0xd945('0x56')](_0x4e9b66);}})['then'](function(_0x4f6145){if(_0x4f6145){return _0x4f6145?{'count':_0x1cef46,'rows':_0x4f6145}:null;}})[_0xd945('0x29')](respondWithResult(_0x1f6740,null))[_0xd945('0x49')](handleError(_0x1f6740,null));};exports['removeMembers']=function(_0x28d730,_0x55503b,_0x4de674){return db['ChatGroup'][_0xd945('0x4c')]({'where':{'id':_0x28d730['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x55503b,null))[_0xd945('0x29')](function(_0x17826d){if(_0x17826d){return _0x17826d[_0xd945('0x58')](_0x28d730['query']['ids']);}})[_0xd945('0x29')](respondWithStatusCode(_0x55503b,null))[_0xd945('0x49')](handleError(_0x55503b,null));};exports[_0xd945('0x59')]=function(_0x1fd1e1,_0x4725ce,_0x1a54d0){if(_0x1fd1e1[_0xd945('0x4e')]['id']){delete _0x1fd1e1[_0xd945('0x4e')]['id'];}return db[_0xd945('0x30')]['find']({'where':{'id':_0x1fd1e1['params']['id']}})[_0xd945('0x29')](handleEntityNotFound(_0x4725ce,null))[_0xd945('0x29')](function(_0xf9c75f){if(_0xf9c75f){_0x1fd1e1[_0xd945('0x4e')]['ChatGroupId']=_0xf9c75f['id'];return db[_0xd945('0x52')][_0xd945('0x4d')](_0x1fd1e1[_0xd945('0x4e')]);}})[_0xd945('0x29')](respondWithResult(_0x4725ce,null))[_0xd945('0x49')](handleError(_0x4725ce,null));};exports[_0xd945('0x5a')]=function(_0x1c6f53,_0xb0caca,_0x4c64c9){var _0x78c95b={};var _0x499552={};var _0xf108c4;var _0x2fbd71;return db[_0xd945('0x30')][_0xd945('0x5b')]({'where':{'id':_0x1c6f53[_0xd945('0x4a')]['id']}})[_0xd945('0x29')](handleEntityNotFound(_0xb0caca,null))[_0xd945('0x29')](function(_0x295267){if(_0x295267){_0xf108c4=_0x295267;_0x499552['model']=_[_0xd945('0x35')](db[_0xd945('0x52')][_0xd945('0x31')]);_0x499552[_0xd945('0x34')]=_[_0xd945('0x35')](_0x1c6f53['query']);_0x499552[_0xd945('0x36')]=_[_0xd945('0x37')](_0x499552[_0xd945('0x33')],_0x499552[_0xd945('0x34')]);_0x78c95b[_0xd945('0x38')]=_[_0xd945('0x37')](_0x499552['model'],qs[_0xd945('0x39')](_0x1c6f53[_0xd945('0x34')][_0xd945('0x39')]));_0x78c95b[_0xd945('0x38')]=_0x78c95b[_0xd945('0x38')][_0xd945('0x3a')]?_0x78c95b['attributes']:_0x499552[_0xd945('0x33')];_0x78c95b[_0xd945('0x3d')]=qs[_0xd945('0x3e')](_0x1c6f53[_0xd945('0x34')][_0xd945('0x3e')]);_0x78c95b[_0xd945('0x3f')]=qs[_0xd945('0x36')](_[_0xd945('0x40')](_0x1c6f53[_0xd945('0x34')],_0x499552['filters']));if(_0x1c6f53[_0xd945('0x34')][_0xd945('0x41')]){_0x78c95b[_0xd945('0x3f')]=_[_0xd945('0x42')](_0x78c95b['where'],{'$or':_[_0xd945('0x2f')](_0x78c95b[_0xd945('0x38')],function(_0x31156c){var _0x2a0970={};_0x2a0970[_0x31156c]={'$like':'%'+_0x1c6f53[_0xd945('0x34')]['filter']+'%'};return _0x2a0970;})});}if(_0x1c6f53[_0xd945('0x34')]['$gte']){var _0x3f391c=_0x1c6f53[_0xd945('0x34')]['$gte']['split'](',');var _0x30487c={};_0x30487c[_0x3f391c[0x0]]={'$gte':moment(_0x3f391c[0x1])[_0xd945('0x5c')](_0xd945('0x5d'))};_0x78c95b['where']=_[_0xd945('0x42')](_0x78c95b['where'],_0x30487c);}_0x78c95b=_[_0xd945('0x42')]({},_0x78c95b,_0x1c6f53['options']);return _0xf108c4[_0xd945('0x5a')](_0x78c95b);}})['then'](function(_0x2334a8){if(_0x2334a8){_0x2fbd71=_0x2334a8['length'];if(!_0x1c6f53[_0xd945('0x34')][_0xd945('0x3b')]('nolimit')){_0x78c95b[_0xd945('0x26')]=qs['limit'](_0x1c6f53[_0xd945('0x34')]['limit']);_0x78c95b[_0xd945('0x24')]=qs[_0xd945('0x24')](_0x1c6f53[_0xd945('0x34')]['offset']);}return _0xf108c4[_0xd945('0x5a')](_0x78c95b);}})[_0xd945('0x29')](function(_0x4a6c42){if(_0x4a6c42){return _0x4a6c42?{'count':_0x2fbd71,'rows':_0x4a6c42}:null;}})[_0xd945('0x29')](respondWithResult(_0xb0caca,null))['catch'](handleError(_0xb0caca,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 814faf4..ac1c9b9 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 _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xa83a04,_0x4d24fc){var _0x30e8ab=function(_0x34b936){while(--_0x34b936){_0xa83a04['push'](_0xa83a04['shift']());}};_0x30e8ab(++_0x4d24fc);}(_0x50a5,0xd1));var _0x550a=function(_0x4f451d,_0x46a97e){_0x4f451d=_0x4f451d-0x0;var _0x588972=_0x50a5[_0x4f451d];return _0x588972;};'use strict';var EventEmitter=require(_0x550a('0x0'));var ChatGroup=require(_0x550a('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){ChatGroupEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);ChatGroupEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];ChatGroup[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xa143=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xa143,0x115));var _0x3a14=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa143[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x3a14('0x0'));var ChatGroup=require(_0x3a14('0x1'))['db'][_0x3a14('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3a14('0x3')](0x0);var events={'afterCreate':_0x3a14('0x4'),'afterUpdate':_0x3a14('0x5'),'afterDestroy':_0x3a14('0x6')};function emitEvent(_0x363b10){return function(_0x3c6622,_0x238839,_0x446a1c){ChatGroupEvents[_0x3a14('0x7')](_0x363b10+':'+_0x3c6622['id'],_0x3c6622);ChatGroupEvents['emit'](_0x363b10,_0x3c6622);_0x446a1c(null);};}for(var e in events){if(events[_0x3a14('0x8')](e)){var event=events[e];ChatGroup[_0x3a14('0x9')](e,emitEvent(event));}}module[_0x3a14('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 04f7180..f9e0af4 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 _0x63dc=['define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x63dc,0x1d1));var _0xc63d=function(_0x23f3ca,_0x3fc171){_0x23f3ca=_0x23f3ca-0x0;var _0x33688a=_0x63dc[_0x23f3ca];return _0x33688a;};'use strict';var _=require('lodash');var util=require(_0xc63d('0x0'));var logger=require(_0xc63d('0x1'))(_0xc63d('0x2'));var moment=require(_0xc63d('0x3'));var BPromise=require(_0xc63d('0x4'));var rp=require(_0xc63d('0x5'));var fs=require('fs');var path=require(_0xc63d('0x6'));var rimraf=require(_0xc63d('0x7'));var config=require(_0xc63d('0x8'));var attributes=require(_0xc63d('0x9'));module[_0xc63d('0xa')]=function(_0x5b8676,_0x4530be){return _0x5b8676[_0xc63d('0xb')](_0xc63d('0xc'),attributes,{'tableName':_0xc63d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cfe=['lodash','api','moment','bluebird','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0x8cfe,0x183));var _0xe8cf=function(_0x251028,_0x3eef2a){_0x251028=_0x251028-0x0;var _0x415051=_0x8cfe[_0x251028];return _0x415051;};'use strict';var _=require(_0xe8cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe8cf('0x1'));var moment=require(_0xe8cf('0x2'));var BPromise=require(_0xe8cf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8cf('0x4'));var config=require(_0xe8cf('0x5'));var attributes=require(_0xe8cf('0x6'));module['exports']=function(_0x16915b,_0x6cc976){return _0x16915b[_0xe8cf('0x7')](_0xe8cf('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 1b8fe0c..aedcc49 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 _0x594d=['message','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x594d,0x172));var _0xd594=function(_0x223b26,_0x2c883f){_0x223b26=_0x223b26-0x0;var _0x691749=_0x594d[_0x223b26];return _0x691749;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd594('0x0'));var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require(_0xd594('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require(_0xd594('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd594('0x9')](config[_0xd594('0xa')],{'host':_0xd594('0xb'),'port':0x18eb});var socket=require(_0xd594('0xc'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xd594('0xd')](socket);function respondWithRpcPromise(_0x30413d,_0x46397c,_0x204faf){return new BPromise(function(_0x512c4e,_0x50abb3){return client[_0xd594('0xe')](_0x30413d,_0x204faf)[_0xd594('0xf')](function(_0x4b53ee){logger['info']('ChatGroup,\x20%s,\x20%s',_0x46397c,_0xd594('0x10'));logger['debug'](_0xd594('0x11'),_0x46397c,_0xd594('0x10'),JSON[_0xd594('0x12')](_0x4b53ee));if(_0x4b53ee['error']){if(_0x4b53ee[_0xd594('0x13')]['code']===0x1f4){logger[_0xd594('0x13')](_0xd594('0x14'),_0x46397c,_0x4b53ee['error'][_0xd594('0x15')]);return _0x50abb3(_0x4b53ee[_0xd594('0x13')][_0xd594('0x15')]);}logger[_0xd594('0x13')]('ChatGroup,\x20%s,\x20%s',_0x46397c,_0x4b53ee[_0xd594('0x13')]['message']);return _0x512c4e(_0x4b53ee[_0xd594('0x13')][_0xd594('0x15')]);}else{logger[_0xd594('0x16')]('ChatGroup,\x20%s,\x20%s',_0x46397c,_0xd594('0x10'));_0x512c4e(_0x4b53ee['result'][_0xd594('0x15')]);}})['catch'](function(_0x50ba67){logger[_0xd594('0x13')](_0xd594('0x14'),_0x46397c,_0x50ba67);_0x50abb3(_0x50ba67);});});} \ No newline at end of file +var _0x6b71=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0xb5f383,_0x4890b3){var _0x1608e8=function(_0x42907d){while(--_0x42907d){_0xb5f383['push'](_0xb5f383['shift']());}};_0x1608e8(++_0x4890b3);}(_0x6b71,0x12c));var _0x16b7=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x6b71[_0xe24fc0];return _0x185c6b;};'use strict';var _=require(_0x16b7('0x0'));var util=require(_0x16b7('0x1'));var moment=require('moment');var BPromise=require(_0x16b7('0x2'));var rs=require(_0x16b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16b7('0x4'))['db'];var utils=require(_0x16b7('0x5'));var logger=require(_0x16b7('0x6'))(_0x16b7('0x7'));var config=require(_0x16b7('0x8'));var jayson=require(_0x16b7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x16b7('0xa')]=_['defaults'](config[_0x16b7('0xa')],{'host':_0x16b7('0xb'),'port':0x18eb});var socket=require(_0x16b7('0xc'))(new Redis(config[_0x16b7('0xa')]));require('./chatGroup.socket')[_0x16b7('0xd')](socket);function respondWithRpcPromise(_0x537abb,_0xd05d11,_0x50c2a1){return new BPromise(function(_0x46c08d,_0x4b11f4){return client['request'](_0x537abb,_0x50c2a1)[_0x16b7('0xe')](function(_0x4f762f){logger['info'](_0x16b7('0xf'),_0xd05d11,_0x16b7('0x10'));logger[_0x16b7('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xd05d11,_0x16b7('0x10'),JSON[_0x16b7('0x12')](_0x4f762f));if(_0x4f762f[_0x16b7('0x13')]){if(_0x4f762f[_0x16b7('0x13')][_0x16b7('0x14')]===0x1f4){logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x4f762f[_0x16b7('0x13')][_0x16b7('0x15')]);return _0x4b11f4(_0x4f762f['error']['message']);}logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x4f762f[_0x16b7('0x13')]['message']);return _0x46c08d(_0x4f762f[_0x16b7('0x13')][_0x16b7('0x15')]);}else{logger[_0x16b7('0x16')](_0x16b7('0xf'),_0xd05d11,_0x16b7('0x10'));_0x46c08d(_0x4f762f[_0x16b7('0x17')]['message']);}})[_0x16b7('0x18')](function(_0x2d1df9){logger[_0x16b7('0x13')](_0x16b7('0xf'),_0xd05d11,_0x2d1df9);_0x4b11f4(_0x2d1df9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6394599..cc204c0 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 _0x6ef6=['emit','removeListener','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6ef6,0xff));var _0x66ef=function(_0x4e4f15,_0xc99f54){_0x4e4f15=_0x4e4f15-0x0;var _0x2f0a16=_0x6ef6[_0x4e4f15];return _0x2f0a16;};'use strict';var ChatGroupEvents=require(_0x66ef('0x0'));var events=[_0x66ef('0x1'),_0x66ef('0x2'),'update'];function createListener(_0x775994,_0x45107b){return function(_0x10af6c){_0x45107b[_0x66ef('0x3')](_0x775994,_0x10af6c);};}function removeListener(_0x1bb764,_0x2856be){return function(){ChatGroupEvents[_0x66ef('0x4')](_0x1bb764,_0x2856be);};}exports['register']=function(_0x3f3886){for(var _0x2e425f=0x0,_0x2be0fc=events['length'];_0x2e425f<_0x2be0fc;_0x2e425f++){var _0x2821da=events[_0x2e425f];var _0xdef69c=createListener(_0x66ef('0x5')+_0x2821da,_0x3f3886);ChatGroupEvents['on'](_0x2821da,_0xdef69c);}}; \ No newline at end of file +var _0xdf47=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdf47,0x1e2));var _0x7df4=function(_0x37a690,_0x50bebc){_0x37a690=_0x37a690-0x0;var _0x5c2f74=_0xdf47[_0x37a690];return _0x5c2f74;};'use strict';var ChatGroupEvents=require(_0x7df4('0x0'));var events=[_0x7df4('0x1'),_0x7df4('0x2'),_0x7df4('0x3')];function createListener(_0x51ef53,_0x534a70){return function(_0x45e5f9){_0x534a70[_0x7df4('0x4')](_0x51ef53,_0x45e5f9);};}function removeListener(_0x12a2fd,_0x4ebfc4){return function(){ChatGroupEvents[_0x7df4('0x5')](_0x12a2fd,_0x4ebfc4);};}exports[_0x7df4('0x6')]=function(_0x5ecb85){for(var _0x3922a2=0x0,_0x1298d1=events[_0x7df4('0x7')];_0x3922a2<_0x1298d1;_0x3922a2++){var _0x1ac8cb=events[_0x3922a2];var _0x1b8a49=createListener('chatGroup:'+_0x1ac8cb,_0x5ecb85);ChatGroupEvents['on'](_0x1ac8cb,_0x1b8a49);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index eb3eaef..b3f73bc 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 _0x7a93=['index','/describe','describe','getUnread','post','create','/:id/members','addMembers','addMessage','put','/:id','delete','destroy','removeMembers','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x7a93,0x15f));var _0x37a9=function(_0x2b8fa7,_0x3df05b){_0x2b8fa7=_0x2b8fa7-0x0;var _0x3fc766=_0x7a93[_0x2b8fa7];return _0x3fc766;};'use strict';var multer=require('multer');var util=require(_0x37a9('0x0'));var path=require('path');var timeout=require(_0x37a9('0x1'));var express=require(_0x37a9('0x2'));var router=express[_0x37a9('0x3')]();var fs_extra=require(_0x37a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37a9('0x5'));var config=require(_0x37a9('0x6'));var controller=require('./chatGroup.controller');router[_0x37a9('0x7')]('/',auth[_0x37a9('0x8')](),controller[_0x37a9('0x9')]);router[_0x37a9('0x7')](_0x37a9('0xa'),auth[_0x37a9('0x8')](),controller[_0x37a9('0xb')]);router[_0x37a9('0x7')]('/:id',auth[_0x37a9('0x8')](),controller['show']);router[_0x37a9('0x7')]('/:id/unread',auth[_0x37a9('0x8')](),controller[_0x37a9('0xc')]);router[_0x37a9('0x7')]('/:id/members',auth[_0x37a9('0x8')](),controller['getMembers']);router[_0x37a9('0x7')]('/:id/messages',auth[_0x37a9('0x8')](),controller['getMessages']);router[_0x37a9('0xd')]('/',auth[_0x37a9('0x8')](),controller[_0x37a9('0xe')]);router[_0x37a9('0xd')](_0x37a9('0xf'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x10')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x37a9('0x11')]);router[_0x37a9('0x12')](_0x37a9('0x13'),auth[_0x37a9('0x8')](),controller['update']);router[_0x37a9('0x14')](_0x37a9('0x13'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x15')]);router[_0x37a9('0x14')](_0x37a9('0xf'),auth[_0x37a9('0x8')](),controller[_0x37a9('0x16')]);module[_0x37a9('0x17')]=router; \ No newline at end of file +var _0xee0c=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMessages','post','addMembers','put','/:id','delete','destroy','removeMembers'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xee0c,0x1cc));var _0xcee0=function(_0x52020e,_0x940e91){_0x52020e=_0x52020e-0x0;var _0x34e724=_0xee0c[_0x52020e];return _0x34e724;};'use strict';var multer=require(_0xcee0('0x0'));var util=require(_0xcee0('0x1'));var path=require(_0xcee0('0x2'));var timeout=require(_0xcee0('0x3'));var express=require(_0xcee0('0x4'));var router=express[_0xcee0('0x5')]();var fs_extra=require(_0xcee0('0x6'));var auth=require(_0xcee0('0x7'));var interaction=require(_0xcee0('0x8'));var config=require(_0xcee0('0x9'));var controller=require('./chatGroup.controller');router[_0xcee0('0xa')]('/',auth[_0xcee0('0xb')](),controller[_0xcee0('0xc')]);router[_0xcee0('0xa')](_0xcee0('0xd'),auth[_0xcee0('0xb')](),controller[_0xcee0('0xe')]);router[_0xcee0('0xa')]('/:id',auth[_0xcee0('0xb')](),controller[_0xcee0('0xf')]);router[_0xcee0('0xa')](_0xcee0('0x10'),auth[_0xcee0('0xb')](),controller['getUnread']);router[_0xcee0('0xa')](_0xcee0('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xcee0('0xa')]('/:id/messages',auth[_0xcee0('0xb')](),controller[_0xcee0('0x12')]);router['post']('/',auth[_0xcee0('0xb')](),controller['create']);router[_0xcee0('0x13')](_0xcee0('0x11'),auth['isAuthenticated'](),controller[_0xcee0('0x14')]);router[_0xcee0('0x13')]('/:id/messages',auth[_0xcee0('0xb')](),controller['addMessage']);router[_0xcee0('0x15')](_0xcee0('0x16'),auth[_0xcee0('0xb')](),controller['update']);router[_0xcee0('0x17')](_0xcee0('0x16'),auth[_0xcee0('0xb')](),controller[_0xcee0('0x18')]);router[_0xcee0('0x17')]('/:id/members',auth[_0xcee0('0xb')](),controller[_0xcee0('0x19')]);module[_0xcee0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index a93a432..5c5fd17 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 _0x3423=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x49f98a,_0x481c5b){var _0x1f38a2=function(_0x45238e){while(--_0x45238e){_0x49f98a['push'](_0x49f98a['shift']());}};_0x1f38a2(++_0x481c5b);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3342('0x1')]},'ratingType':{'type':Sequelize[_0x3342('0x2')](_0x3342('0x3'),_0x3342('0x4')),'defaultValue':_0x3342('0x3')},'ratingMessage':{'type':Sequelize[_0x3342('0x5')]},'pathTranscript':{'type':Sequelize[_0x3342('0x5')]},'mailTranscript':{'type':Sequelize[_0x3342('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3342('0x7')]},'disposition':{'type':Sequelize[_0x3342('0x6')]},'secondDisposition':{'type':Sequelize[_0x3342('0x6')]},'thirdDisposition':{'type':Sequelize[_0x3342('0x6')]},'note':{'type':Sequelize[_0x3342('0x6')]},'browserName':{'type':Sequelize[_0x3342('0x6')]},'browserVersion':{'type':Sequelize[_0x3342('0x6')]},'osName':{'type':Sequelize[_0x3342('0x6')]},'osVersion':{'type':Sequelize[_0x3342('0x6')]},'deviceModel':{'type':Sequelize[_0x3342('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3342('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3342('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3342('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3342('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3342('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x3342('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0x74f4=['sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING','long','DATE','out'];(function(_0x47eae0,_0x243f1b){var _0x260347=function(_0x221977){while(--_0x221977){_0x47eae0['push'](_0x47eae0['shift']());}};_0x260347(++_0x243f1b);}(_0x74f4,0xaa));var _0x474f=function(_0x337e2b,_0x483b3b){_0x337e2b=_0x337e2b-0x0;var _0x569e62=_0x74f4[_0x337e2b];return _0x569e62;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x474f('0x2')]},'ratingType':{'type':Sequelize[_0x474f('0x3')]('star',_0x474f('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x474f('0x5')]},'pathTranscript':{'type':Sequelize[_0x474f('0x5')]},'mailTranscript':{'type':Sequelize[_0x474f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x474f('0x6')]},'secondDisposition':{'type':Sequelize[_0x474f('0x6')]},'thirdDisposition':{'type':Sequelize[_0x474f('0x6')]},'note':{'type':Sequelize[_0x474f('0x6')]},'browserName':{'type':Sequelize[_0x474f('0x6')]},'browserVersion':{'type':Sequelize[_0x474f('0x6')]},'osName':{'type':Sequelize[_0x474f('0x6')]},'osVersion':{'type':Sequelize[_0x474f('0x6')]},'deviceModel':{'type':Sequelize[_0x474f('0x6')]},'deviceVendor':{'type':Sequelize[_0x474f('0x6')]},'deviceType':{'type':Sequelize[_0x474f('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x474f('0x6')]},'formData':{'type':Sequelize[_0x474f('0x5')](_0x474f('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x474f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x474f('0x3')]('in',_0x474f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x474f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x474f('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 6d42310..3a30db3 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 _0xd64b=['`\x20=\x200','`\x20>\x200','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','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','includeAll','include','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooMetadata','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','System','Visitor','agentIdentifier','%s%d','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','sort','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Owner','Chat','Account','closedAt','browserName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','request-promise','bluebird','mustache','util','path','ejs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','send','render','body','contact','agent','interaction','account','Users','map','fullname','TagIds','forEach','Tags','push','answered','total','closed','UserId','waiting','talking','disposition','abandoned','unmanaged','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','select','field','name','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0xd64b,0xc1));var _0xbd64=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xd64b[_0x4551f6];return _0x581dc2;};'use strict';var rimraf=require(_0xbd64('0x0'));var zipdir=require('zip-dir');var rp=require(_0xbd64('0x1'));var moment=require('moment');var BPromise=require(_0xbd64('0x2'));var Mustache=require(_0xbd64('0x3'));var util=require(_0xbd64('0x4'));var path=require(_0xbd64('0x5'));var ejs=require(_0xbd64('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xbd64('0x7'));var pdf=require(_0xbd64('0x8'));var logger=require(_0xbd64('0x9'))(_0xbd64('0xa'));var config=require(_0xbd64('0xb'));var db=require(_0xbd64('0xc'))['db'];config[_0xbd64('0xd')]=_['defaults'](config['redis'],{'host':_0xbd64('0xe'),'port':0x18eb});var socket=require(_0xbd64('0xf'))(new Redis(config[_0xbd64('0xd')]));require('./chatInteraction.socket')[_0xbd64('0x10')](socket);var jayson=require(_0xbd64('0x11'));var client=jayson[_0xbd64('0x12')][_0xbd64('0x13')]({'port':0x232b});var client9004=jayson['client'][_0xbd64('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5f2adf,_0x136f60,_0x2729d8,_0x3a941c){return new BPromise(function(_0x2183e2,_0x367824){var _0x27438c=_0x3a941c||client;return _0x27438c[_0xbd64('0x14')](_0x5f2adf,_0x2729d8)[_0xbd64('0x15')](function(_0x2b5808){logger['info'](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));logger[_0xbd64('0x18')](_0xbd64('0x19'),_0x136f60,_0xbd64('0x17'),JSON['stringify'](_0x2b5808));if(_0x2b5808[_0xbd64('0x1a')]){if(_0x2b5808['error'][_0xbd64('0x1b')]===0x1f4){logger[_0xbd64('0x1a')](_0xbd64('0x16'),_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x367824(_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);}logger[_0xbd64('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x136f60,_0x2b5808[_0xbd64('0x1a')][_0xbd64('0x1c')]);return _0x2183e2(_0x2b5808['error']['message']);}else{logger[_0xbd64('0x1d')](_0xbd64('0x16'),_0x136f60,_0xbd64('0x17'));_0x2183e2(_0x2b5808[_0xbd64('0x1e')][_0xbd64('0x1c')]);}})[_0xbd64('0x1f')](function(_0x5dc2bd){logger['error'](_0xbd64('0x16'),_0x136f60,_0x5dc2bd);_0x367824(_0x5dc2bd);});});}function respondWithStatusCode(_0x41f2f,_0x12f67b){_0x12f67b=_0x12f67b||0xcc;return function(_0x365d88){if(_0x365d88){return _0x41f2f['sendStatus'](_0x12f67b);}return _0x41f2f['status'](_0x12f67b)[_0xbd64('0x20')]();};}function respondWithResult(_0x4afaff,_0x46ab38){_0x46ab38=_0x46ab38||0xc8;return function(_0x5b356b){if(_0x5b356b){return _0x4afaff[_0xbd64('0x21')](_0x46ab38)[_0xbd64('0x22')](_0x5b356b);}};}function respondWithFilteredResult(_0x3d12a0,_0x2d0993){return function(_0x5ae417){if(_0x5ae417){var _0x9d0fb8=typeof _0x2d0993[_0xbd64('0x23')]===_0xbd64('0x24')&&typeof _0x2d0993[_0xbd64('0x25')]==='undefined';var _0x4e8719=_0x5ae417[_0xbd64('0x26')];var _0x49eac5=_0x9d0fb8?0x0:_0x2d0993['offset'];var _0xfa918=_0x9d0fb8?_0x5ae417['count']:_0x2d0993[_0xbd64('0x23')]+_0x2d0993['limit'];var _0x28199c;if(_0xfa918>=_0x4e8719){_0xfa918=_0x4e8719;_0x28199c=0xc8;}else{_0x28199c=0xce;}_0x3d12a0['status'](_0x28199c);return _0x3d12a0[_0xbd64('0x27')](_0xbd64('0x28'),_0x49eac5+'-'+_0xfa918+'/'+_0x4e8719)[_0xbd64('0x22')](_0x5ae417);}return null;};}function saveUpdates(_0x210fff){return function(_0x306f19){if(_0x306f19){return _0x306f19[_0xbd64('0x29')](_0x210fff)['then'](function(_0x35bdd5){return _0x35bdd5;});}return null;};}function removeEntity(_0xe876c9){return function(_0xc44280){if(_0xc44280){return _0xc44280[_0xbd64('0x2a')]()[_0xbd64('0x15')](function(){_0xe876c9[_0xbd64('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5961){return function(_0x1e4593){if(!_0x1e4593){_0x4c5961['sendStatus'](0x194);}return _0x1e4593;};}function handleError(_0xebed78,_0x3bce1b){_0x3bce1b=_0x3bce1b||0x1f4;return function(_0x54459f){logger['error'](_0x54459f[_0xbd64('0x2b')]);if(_0x54459f['name']){delete _0x54459f['name'];}_0xebed78[_0xbd64('0x21')](_0x3bce1b)[_0xbd64('0x2c')](_0x54459f);};}function getMustacheRender(_0x192ca3,_0x50c58e){return Mustache[_0xbd64('0x2d')](_0x192ca3,_['merge'](_0x50c58e[_0xbd64('0x2e')],{'contact':_0x50c58e[_0xbd64('0x2f')],'message':_0x50c58e[_0xbd64('0x1c')],'agent':_0x50c58e[_0xbd64('0x30')],'interaction':_0x50c58e[_0xbd64('0x31')],'account':_0x50c58e[_0xbd64('0x32')]}))||'';}function getInteractionUsers(_0x513339,_0x4d870e){return new BPromise(function(_0x1a3c0f,_0x2be110){try{if(_0x4d870e[_0x513339['id']]){_0x513339[_0xbd64('0x33')]=_[_0xbd64('0x34')](_0x4d870e[_0x513339['id']],function(_0x5cf522){return{'id':_0x5cf522['id'],'fullname':_0x5cf522[_0xbd64('0x35')]};});}}catch(_0x54784f){_0x2be110(_0x54784f);}_0x1a3c0f(_0x513339);});}function getInteractionTags(_0x5a74a9,_0x1db1fa){return new BPromise(function(_0x1bcd4c,_0x21f518){try{if(_0x5a74a9['TagIds']){_0x5a74a9['Tags']=[];_0x5a74a9[_0xbd64('0x36')]['split'](',')[_0xbd64('0x37')](function(_0x4e1f11){_0x5a74a9[_0xbd64('0x38')][_0xbd64('0x39')](_0x1db1fa[_0x4e1f11]);});}delete _0x5a74a9['TagIds'];}catch(_0x107da1){_0x21f518(_0x107da1);}_0x1bcd4c(_0x5a74a9);});}function updateChatInteraction(_0x51ae42,_0x534091,_0x380f32){return new BPromise(function(_0x195d89,_0x252fc4){return getInteractionUsers(_0x51ae42,_0x380f32)['then'](function(_0x540e2a){return getInteractionTags(_0x540e2a,_0x534091);})['then'](function(_0x344d46){return getStateInteraction(_0x344d46);})[_0xbd64('0x15')](function(_0x51d54b){_0x195d89(_0x51d54b);})[_0xbd64('0x1f')](function(_0x34b19a){_0x252fc4(_0x34b19a);});});}function getStateInteraction(_0x19832c){return new BPromise(function(_0x27fd12){_0x19832c['waiting']=0x0;_0x19832c['talking']=0x0;_0x19832c[_0xbd64('0x3a')]=0x0;_0x19832c['unmanaged']=0x0;_0x19832c['abandoned']=0x0;_0x19832c[_0xbd64('0x3b')]=0x0;if(!_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3e')]+=0x1;}if(!_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x3d')]){_0x19832c[_0xbd64('0x3f')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c['waiting']-=0x1;}}if(_0x19832c[_0xbd64('0x3c')]&&_0x19832c[_0xbd64('0x40')]==='abandoned'){_0x19832c[_0xbd64('0x41')]+=0x1;if(_0x19832c[_0xbd64('0x3e')]){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c[_0xbd64('0x3c')]&&!_0x19832c[_0xbd64('0x3d')]&&_0x19832c[_0xbd64('0x40')]){_0x19832c[_0xbd64('0x42')]+=0x1;if(_0x19832c['waiting']){_0x19832c[_0xbd64('0x3e')]-=0x1;}}else if(_0x19832c['closed']&&_0x19832c[_0xbd64('0x3d')]){_0x19832c['answered']+=0x1;if(_0x19832c[_0xbd64('0x3f')]){_0x19832c[_0xbd64('0x3f')]-=0x1;}}_0x19832c[_0xbd64('0x3b')]+=0x1;_0x27fd12(_0x19832c);});}exports['index']=function(_0x23bf21,_0x495522){var _0x526705={},_0x553fa0={},_0x3304b7={'count':0x0,'rows':[]};var _0x2abe23=_[_0xbd64('0x34')](db[_0xbd64('0x43')][_0xbd64('0x44')],function(_0x3079b6){return{'name':_0x3079b6[_0xbd64('0x45')],'type':_0x3079b6['type'][_0xbd64('0x46')]};});_0x553fa0[_0xbd64('0x47')]=_[_0xbd64('0x34')](_0x2abe23,'name');_0x553fa0[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x23bf21[_0xbd64('0x48')]);_0x553fa0[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x553fa0['model'],_0x553fa0[_0xbd64('0x48')]);_0x526705[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x553fa0[_0xbd64('0x47')],qs['fields'](_0x23bf21['query'][_0xbd64('0x4d')]));_0x526705[_0xbd64('0x4c')]=_0x526705[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x526705[_0xbd64('0x4c')]:_0x553fa0[_0xbd64('0x47')];if(!_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x526705[_0xbd64('0x25')]=qs[_0xbd64('0x25')](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x25')]);_0x526705[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x23bf21['query'][_0xbd64('0x23')]);}_0x526705['order']=qs['sort'](_0x23bf21['query']['sort']);_0x526705[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x23bf21[_0xbd64('0x48')],_0x553fa0[_0xbd64('0x4a')]),_0x2abe23);var _0x46a3af=[];var _0x57e811=squel[_0xbd64('0x52')]()[_0xbd64('0x53')]('id')[_0xbd64('0x53')](_0xbd64('0x54'))[_0xbd64('0x53')](_0xbd64('0x55'))['from']('tools_tags');var _0x4bd09c=squel[_0xbd64('0x52')]()[_0xbd64('0x53')](_0xbd64('0x56'))[_0xbd64('0x53')]('u.fullname')[_0xbd64('0x53')](_0xbd64('0x57'))[_0xbd64('0x58')](_0xbd64('0x59'),'ui')[_0xbd64('0x5a')](_0xbd64('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x270910=squel[_0xbd64('0x52')]()[_0xbd64('0x58')](_0xbd64('0x5c'),'i')[_0xbd64('0x5a')](_0xbd64('0x5d'),'c',_0xbd64('0x5e'))[_0xbd64('0x5a')](_0xbd64('0x5b'),'o',_0xbd64('0x5f'))[_0xbd64('0x5a')](_0xbd64('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xbd64('0x61'),'me',_0xbd64('0x62'))['left_join']('chat_interaction_has_tags','it',_0xbd64('0x63'))[_0xbd64('0x5a')]('tools_tags','t',_0xbd64('0x64'));var _0x13f083=squel[_0xbd64('0x65')]();var _0x3b592e=[];var _0x713652=squel[_0xbd64('0x65')]();var _0x2d788;if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]){_0x2d788=as['parseSearch'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x66')]);var _0x166783=_0x2d788['sqlOperator'];for(var _0x8ec428=0x0;_0x8ec428<_0x2d788[_0xbd64('0x67')]['length'];_0x8ec428++){var _0x4423d9=_0x2d788[_0xbd64('0x67')][_0x8ec428];var _0x16634d='i';var _0x220603=_[_0xbd64('0x68')](_0x2abe23,[_0xbd64('0x54'),_0x4423d9['field']]);if(!_0x220603){switch(_0x4423d9[_0xbd64('0x53')]){case _0xbd64('0x69'):if(_0x4423d9[_0xbd64('0x6a')]==0x1){_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6c'));}else{_0x270910[_0xbd64('0x6b')]('`'+_0x4423d9['field']+_0xbd64('0x6d'));}break;case'Contact':if(_0x4423d9[_0xbd64('0x6e')]===_0xbd64('0x6f')){if(_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')]('\x20')['length']>0x1){_0x13f083[_0x166783](_0xbd64('0x71'),qs[_0xbd64('0x72')](_0x4423d9[_0xbd64('0x6a')]),null);}else{var _0x23925c='%'+_0x4423d9[_0xbd64('0x6a')]+'%';_0x13f083[_0x166783](_0xbd64('0x73'),_0x23925c,_0x23925c,_0x23925c);}}else{_0x220603=_['find'](_0x2abe23,['name','ContactId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x74');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x78'):var _0x333720=_0x4423d9[_0xbd64('0x6a')][_0xbd64('0x70')](',')[_0xbd64('0x34')](function(_0x3d7e47){return Number(_0x3d7e47);});_0x333720[_0xbd64('0x37')](function(_0x18e724){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x18e724+',%');});_0x3b592e=_[_0xbd64('0x7a')](_0x3b592e,_0x333720);break;case'User':if(_0x4423d9['operator']===_0xbd64('0x6f')){_0x13f083[_0x166783](_0xbd64('0x7b'),'%'+_0x4423d9[_0xbd64('0x6a')]+'%',null);}else{_0x220603=_['find'](_0x2abe23,[_0xbd64('0x54'),'UserId']);_0x4423d9[_0xbd64('0x53')]=_0xbd64('0x3d');_0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0['text'],_0x2b95a0[_0xbd64('0x6a')]['start'],_0x2b95a0[_0xbd64('0x6a')][_0xbd64('0x20')]);}break;case _0xbd64('0x2e'):_0x2b95a0=as[_0xbd64('0x75')]('me',null,_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0[_0xbd64('0x6a')]['end']);break;}}else{var _0x2b95a0=as[_0xbd64('0x75')](_0x16634d,_0x220603[_0xbd64('0x76')],_0x4423d9);_0x13f083[_0x166783](_0x2b95a0[_0xbd64('0x77')],_0x2b95a0['value'][_0xbd64('0x7c')],_0x2b95a0['value'][_0xbd64('0x20')]);}}}else{var _0x4de7e0=_(_0x23bf21[_0xbd64('0x48')])['keys']()['map'](function(_0x51e0b0){return _['some'](_0x2abe23,[_0xbd64('0x54'),_0x51e0b0])?_0x51e0b0:undefined;})[_0xbd64('0x7d')]()[_0xbd64('0x6a')]();if(!_[_0xbd64('0x7e')](_0x4de7e0)){_0x4de7e0[_0xbd64('0x37')](function(_0x4ea72d){if(_0x4ea72d===_0xbd64('0x7f')){_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),[][_0xbd64('0x81')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d]));}else if(_0x4ea72d==='createdAt'){var _0x1abf2f=JSON[_0xbd64('0x82')](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x83')];var _0x5875da=JSON['parse'](_0x23bf21[_0xbd64('0x48')][_0x4ea72d])[_0xbd64('0x84')];_0x270910[_0xbd64('0x51')](_0xbd64('0x85'),_0x1abf2f,_0x5875da);}else{if(_0x23bf21[_0xbd64('0x48')][_0x4ea72d]===_0xbd64('0x86')){_0x270910[_0xbd64('0x51')]('i.'+_0x4ea72d+_0xbd64('0x87'));}else{_0x270910['where']('i.'+_0x4ea72d+_0xbd64('0x88'),_0x23bf21['query'][_0x4ea72d]);}}});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x89')]){if(_0x23bf21[_0xbd64('0x48')]['read']==0x1){_0x270910[_0xbd64('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x270910['having'](_0xbd64('0x8a'));}}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]){_0x3b592e=_['isArray'](_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')])?_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8b')]:new Array(_0x23bf21['query'][_0xbd64('0x8b')]);_0x3b592e[_0xbd64('0x37')](function(_0x355b87){_0x713652['or'](_0xbd64('0x79'),'%,'+_0x355b87+',%');});}if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')]){var _0x3bc2e8=_0x23bf21[_0xbd64('0x48')][_0xbd64('0x8c')][_0xbd64('0x8d')]('\x5c','\x5c\x5c')[_0xbd64('0x8d')](/'/g,'\x27\x27');if(qs[_0xbd64('0x8e')](_0x3bc2e8)){_0x13f083['or'](_0xbd64('0x8f'),_0x3bc2e8+'%');}else{_0x13f083['or'](_0xbd64('0x90'),qs['getFullTextValue'](_0x3bc2e8))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3bc2e8+'%');}}}_0x270910[_0xbd64('0x51')](_0x13f083);_0x270910[_0xbd64('0x91')](_0xbd64('0x92'));var _0x586056={'type':db[_0xbd64('0x93')]['QueryTypes'][_0xbd64('0x94')],'raw':!![]};var _0x99ee7f=_0x270910[_0xbd64('0x95')]();_0x99ee7f[_0xbd64('0x53')]('i.id');_0x99ee7f[_0xbd64('0x53')](_0xbd64('0x96'),'unreadMessages');if(_0x526705[_0xbd64('0x97')]){_0x526705['order'][_0xbd64('0x37')](function(_0x2415a8){var _0x38e860=_0x2415a8[0x0]===_0xbd64('0x98')?_0x2415a8[0x0]:'i.'+_0x2415a8[0x0];_0x270910[_0xbd64('0x97')](_0x38e860,_0x2415a8[0x1]===_0xbd64('0x99')?![]:!![]);});}if(!_['isEmpty'](_0x3b592e)){_0x270910[_0xbd64('0x6b')](_0x713652);_0x99ee7f['where'](_0xbd64('0x9a'),_0x3b592e);}BPromise[_0xbd64('0x9b')]()['then'](function(){if(!_0x2d788){if(_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return;_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x9c'));_0x270910[_0xbd64('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9e')]!==_0xbd64('0x30'))return;return _0x23bf21[_0xbd64('0x9d')][_0xbd64('0x9f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58efa2){if(_[_0xbd64('0x7e')](_0x58efa2)){_0x99ee7f[_0xbd64('0x51')](_0xbd64('0xa0'));_0x270910[_0xbd64('0x51')](_0xbd64('0xa0'));}else{_0x99ee7f[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));_0x270910[_0xbd64('0x51')](_0xbd64('0x80'),_[_0xbd64('0x34')](_0x58efa2,'id'));}});})[_0xbd64('0x15')](function(){if(_0x23bf21[_0xbd64('0x9d')]['role']===_0xbd64('0x30')&&!_0x2d788&&!_0x23bf21[_0xbd64('0x48')]['ChatWebsiteId'])return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x99ee7f[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x4e948c){_0x3304b7['count']=_0x4e948c[_0xbd64('0x4e')];if(_0x3304b7[_0xbd64('0x26')]===0x0)return[];return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x57e811[_0xbd64('0xa2')](),_0x586056)[_0xbd64('0x15')](function(_0x23cead){_0x46a3af=_[_0xbd64('0xa3')](_0x23cead,'id');_0x586056=_[_0xbd64('0xa4')](_0x586056,{'model':db[_0xbd64('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23bf21[_0xbd64('0x48')][_0xbd64('0x4d')]){_0x526705['attributes'][_0xbd64('0x37')](function(_0x13c379){_0x270910[_0xbd64('0x53')]('i.'+_0x13c379);});}else{_0x270910['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbd64('0x69'));_0x270910[_0xbd64('0x53')]('a.key',_0xbd64('0xa5'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa6'),_0xbd64('0xa7'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa8'),_0xbd64('0x98'));_0x270910[_0xbd64('0x53')](_0xbd64('0xa9'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaa'),_0xbd64('0xab'));_0x270910['field'](_0xbd64('0xac'),'Contact.lastName');_0x270910[_0xbd64('0x53')](_0xbd64('0xad'),_0xbd64('0xae'));_0x270910[_0xbd64('0x53')](_0xbd64('0xaf'),'Contact.phone');_0x270910[_0xbd64('0x53')](_0xbd64('0xb0'),_0xbd64('0xb1'));_0x270910[_0xbd64('0x53')]('c.fax',_0xbd64('0xb2'));_0x270910['field'](_0xbd64('0xb3'),_0xbd64('0xb4'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb5'),_0xbd64('0xb6'));_0x270910[_0xbd64('0x53')](_0xbd64('0xb7'),'TagIds');}if(_0x526705[_0xbd64('0x25')])_0x270910[_0xbd64('0x25')](_0x526705[_0xbd64('0x25')]);if(_0x526705[_0xbd64('0x23')])_0x270910['offset'](_0x526705[_0xbd64('0x23')]);return db[_0xbd64('0xa1')][_0xbd64('0x48')](_0x270910[_0xbd64('0xa2')](),_0x586056);})[_0xbd64('0x15')](function(_0x2add60){if(_0x2add60[_0xbd64('0x4e')]>0x0)_0x4bd09c['where'](_0xbd64('0xb8'),_['map'](_0x2add60,'id'));return db[_0xbd64('0xa1')]['query'](_0x4bd09c['toString'](),_0x586056)[_0xbd64('0x15')](function(_0x1c2d76){var _0x29706a=_['groupBy'](_0x1c2d76,_0xbd64('0xb9'));var _0x49d6fe=[];_0x2add60[_0xbd64('0x37')](function(_0x48a1b1){_0x49d6fe['push'](updateChatInteraction(_0x48a1b1,_0x46a3af,_0x29706a));});return BPromise[_0xbd64('0xba')](_0x49d6fe);});});})[_0xbd64('0x15')](function(_0x30a8b4){_0x3304b7[_0xbd64('0xbb')]=_0x30a8b4;return _0x3304b7;})[_0xbd64('0x15')](respondWithFilteredResult(_0x495522,_0x526705))[_0xbd64('0x1f')](handleError(_0x495522,null));};exports[_0xbd64('0xbc')]=function(_0x475506,_0x5ecd1e){var _0x58d2c6={'raw':![],'where':{'id':_0x475506['params']['id']}},_0xd7e9dd={};_0xd7e9dd[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0x43')]['rawAttributes']);_0xd7e9dd[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475506['query']);_0xd7e9dd[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0xd7e9dd['model'],_0xd7e9dd['query']);_0x58d2c6[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0xd7e9dd[_0xbd64('0x47')],qs[_0xbd64('0x4d')](_0x475506[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x58d2c6[_0xbd64('0x4c')]=_0x58d2c6[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x58d2c6[_0xbd64('0x4c')]:_0xd7e9dd[_0xbd64('0x47')];if(_0x475506[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x58d2c6[_0xbd64('0xbe')]=[{'all':!![]}];}_0x58d2c6=_[_0xbd64('0xa4')]({},_0x58d2c6,_0x475506['options']);return db[_0xbd64('0x43')]['find'](_0x58d2c6)[_0xbd64('0x15')](handleEntityNotFound(_0x5ecd1e,null))[_0xbd64('0x15')](respondWithResult(_0x5ecd1e,null))['catch'](handleError(_0x5ecd1e,null));};exports[_0xbd64('0xbf')]=function(_0x4ad565,_0x2614bf){return db[_0xbd64('0x43')][_0xbd64('0xbf')](_0x4ad565[_0xbd64('0x2e')],{})['then'](respondWithResult(_0x2614bf,0xc9))[_0xbd64('0x1f')](handleError(_0x2614bf,null));};exports[_0xbd64('0x29')]=function(_0x291861,_0x459a16){if(_0x291861['body']['id']){delete _0x291861['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x291861[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x459a16,null))[_0xbd64('0x15')](saveUpdates(_0x291861['body'],null))[_0xbd64('0x15')](respondWithResult(_0x459a16,null))[_0xbd64('0x1f')](handleError(_0x459a16,null));};exports[_0xbd64('0x2a')]=function(_0x3337a5,_0x37ca27){return db['ChatInteraction']['find']({'where':{'id':_0x3337a5[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x37ca27,null))[_0xbd64('0x15')](removeEntity(_0x37ca27,null))['catch'](handleError(_0x37ca27,null));};exports[_0xbd64('0xc1')]=function(_0x4e1359,_0x11ab17){return db[_0xbd64('0x43')][_0xbd64('0xc1')]()['then'](respondWithResult(_0x11ab17,null))[_0xbd64('0x1f')](handleError(_0x11ab17,null));};exports[_0xbd64('0xc2')]=function(_0x496475,_0x4d5ad0){var _0x13be0b=_0x496475['params']['id'];var _0x4d1a95;var _0x1442ee;var _0x237a8c;return db['ChatInteraction'][_0xbd64('0xc3')]({'where':{'id':_0x13be0b}})['then'](function(_0x4011c5){_0x4d1a95=_0x4011c5;return db[_0xbd64('0xc4')][_0xbd64('0xc3')]({'where':{'id':_0x4011c5['ChatWebsiteId']},'attributes':['id',_0xbd64('0xc5'),'vidaooEscalation','vidaooTopic','vidaooNote',_0xbd64('0xc6')],'raw':!![]});})[_0xbd64('0x15')](function(_0xdf1c41){if(_0xdf1c41&&_0xdf1c41['vidaooApiKey']&&_0xdf1c41[_0xbd64('0xc7')]){_0x1442ee=_0xdf1c41;var _0x4a745f={'interaction':{'id':_0x13be0b},'agent':{'id':_0x496475[_0xbd64('0x9d')]['id'],'name':_0x496475['user']['name'],'fullname':_0x496475['user'][_0xbd64('0x35')],'email':_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]},'contact':_0x496475[_0xbd64('0x2e')]['contact'],'account':_0x496475[_0xbd64('0x2e')][_0xbd64('0x32')]};var _0xef51de={'rejectUnauthorized':![],'method':'POST','url':_0xbd64('0xc9'),'headers':{'X-APIKEY':_0xdf1c41['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x496475[_0xbd64('0x9d')][_0xbd64('0xc8')]],'buttons':null,'topic':_0x1442ee[_0xbd64('0xca')],'note':_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xcc')])?null:getMustacheRender(_0x1442ee[_0xbd64('0xcc')],_0x4a745f),'metadata':null},'redirect':_0xbd64('0xcd'),'json':!![]};try{if(!_[_0xbd64('0xcb')](_0x1442ee[_0xbd64('0xc6')])){var _0x871906=getMustacheRender(_0x1442ee[_0xbd64('0xc6')],_0x4a745f);var _0x17f82d=JSON[_0xbd64('0x82')](_0x871906);_0xef51de['body']['metadata']=_0x17f82d;}}catch(_0x3ccf53){throw new db[(_0xbd64('0x93'))][(_0xbd64('0xce'))](_0xbd64('0xcf'));}return rp(_0xef51de);}else{throw new db['Sequelize'][(_0xbd64('0xce'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xbd64('0x15')](function(_0x5ecf80){_0x237a8c=_0x5ecf80;if(_0x237a8c['id']){var _0x5b7dbd={'body':_0x237a8c[_0xbd64('0xd0')],'ChatWebsiteId':_0x1442ee['id'],'ChatInteractionId':_0x4d1a95['id'],'direction':_0xbd64('0xd1'),'UserId':_0x496475['user']['id']};return db[_0xbd64('0xd2')]['create'](_0x5b7dbd,{});}else{throw new db[(_0xbd64('0x93'))]['ValidationError'](_0xbd64('0xd3'));}})[_0xbd64('0x15')](function(){return _0x4d1a95[_0xbd64('0xd4')]({'vidaooSessionId':_0x237a8c['id']});})['then'](respondWithResult(_0x4d5ad0,null))[_0xbd64('0x1f')](handleError(_0x4d5ad0,null));};exports[_0xbd64('0xd5')]=function(_0x314899,_0x3fac1a){if(_0x314899[_0xbd64('0x2e')]['id']){delete _0x314899[_0xbd64('0x2e')]['id'];}return db[_0xbd64('0x43')]['find']({'where':{'id':_0x314899[_0xbd64('0xc0')]['id']},'include':[{'model':db[_0xbd64('0xd6')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x3fac1a,null))['then'](saveUpdates(_0x314899[_0xbd64('0x2e')],null))[_0xbd64('0x15')](respondWithResult(_0x3fac1a,null))[_0xbd64('0x1f')](handleError(_0x3fac1a,null));};exports['abandon']=function(_0x1b2a3e,_0x5d1231){if(_0x1b2a3e[_0xbd64('0x2e')]['id']){delete _0x1b2a3e['body']['id'];}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x1b2a3e[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](function(_0xe1837c){if(!_0xe1837c){logger[_0xbd64('0x1a')](_0xbd64('0xd7'),_0xbd64('0xd8'),0x194,_0xbd64('0xd9'));_0x5d1231[_0xbd64('0xda')](0x194);}else{if(_0xe1837c[_0xbd64('0x3d')]){throw new db['Sequelize'][(_0xbd64('0xce'))](_0xbd64('0xdb'));}}return _0xe1837c;})[_0xbd64('0x15')](function(_0x23fd87){if(_0x23fd87){return _0x23fd87[_0xbd64('0x29')]({'closed':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x3c')],'disposition':_0x1b2a3e[_0xbd64('0x2e')][_0xbd64('0x40')]})['then'](function(_0x5e5211){return _0x5e5211;});}})[_0xbd64('0x15')](function(){return respondWithRpcPromise(_0xbd64('0xdc'),'abandon',_0x1b2a3e[_0xbd64('0x2e')],client9004);})[_0xbd64('0x15')](respondWithResult(_0x5d1231,null))['catch'](handleError(_0x5d1231,null));};exports[_0xbd64('0xdd')]=function(_0x4fdc08,_0x368998){_0x4fdc08[_0xbd64('0x2e')][_0xbd64('0x54')]=_0x4fdc08[_0xbd64('0xde')][_0xbd64('0xdf')];_0x4fdc08['body']['basename']=_0x4fdc08['file']['filename'];_0x4fdc08[_0xbd64('0x2e')]['type']=_0x4fdc08[_0xbd64('0xde')]['mimetype'];return db['Attachment'][_0xbd64('0xbf')](_0x4fdc08[_0xbd64('0x2e')])[_0xbd64('0x15')](respondWithResult(_0x368998,0xc9))[_0xbd64('0x1f')](handleError(_0x368998,null));};exports[_0xbd64('0xe0')]=function(_0x385178,_0x13fae5){return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x385178[_0xbd64('0xc0')]['id']},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null))[_0xbd64('0x15')](function(_0x5efd7c){if(_0x5efd7c){if(_0x5efd7c[_0xbd64('0x3c')]){return _0x13fae5[_0xbd64('0x21')](0x193)[_0xbd64('0x22')]({'status':0x193,'message':_0xbd64('0xe1')});}return db[_0xbd64('0xe2')][_0xbd64('0xc3')]({'where':{'id':_0x385178['query'][_0xbd64('0xe3')]},'raw':!![]})[_0xbd64('0x15')](handleEntityNotFound(_0x13fae5,null));}})[_0xbd64('0x15')](function(_0x2c2664){if(_0x2c2664){var _0x52011f=_0x2c2664[_0xbd64('0xe4')]!==null;var _0x117595=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server/files/attachments/');if(_0x52011f){_0x117595=path[_0xbd64('0xe5')](_0x117595,'offline-chat/');}var _0x5dd4db=path['join'](_0x117595,_0x2c2664[_0xbd64('0xe7')]);return _0x13fae5[_0xbd64('0xe8')](_0x5dd4db);}})['catch'](handleError(_0x13fae5,null));};exports['close']=function(_0x54831a,_0x1d8739){var _0x1c64ca=null;var _0x65c02b=null;var _0x545933=null;if(_0x54831a['body']['id']){delete _0x54831a[_0xbd64('0x2e')]['id'];}if(_0x54831a['body'][_0xbd64('0xe9')]){_0x545933=path['join'](config[_0xbd64('0xe6')],_0xbd64('0xea'),util[_0xbd64('0xeb')](_0xbd64('0xec'),Date['now']()));_0x54831a[_0xbd64('0x2e')][_0xbd64('0xed')]=_0x545933;}return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x54831a['params']['id']},'include':[{'model':db[_0xbd64('0xd2')],'as':_0xbd64('0xee'),'include':[{'model':db[_0xbd64('0xef')],'as':_0xbd64('0xef')}]}]})[_0xbd64('0x15')](handleEntityNotFound(_0x1d8739,null))[_0xbd64('0x15')](saveUpdates(_0x54831a[_0xbd64('0x2e')],null))[_0xbd64('0x15')](function(_0x3d02a3){if(_0x3d02a3){_0x1c64ca=_0x3d02a3;return db['ChatWebsite']['find']({'where':{'id':_0x1c64ca[_0xbd64('0x7f')]}});}})['then'](function(_0x1b4d1a){if(_0x1b4d1a){_0x65c02b=_0x1b4d1a;return db[_0xbd64('0xd6')][_0xbd64('0x68')]({'where':{'id':_0x1c64ca['ContactId']}});}})['then'](function(_0x1798e1){if(_0x1798e1){if(_0x545933){var _0x394dd0=null;for(var _0x2b532a=0x1;_0x2b532a<_0x1c64ca[_0xbd64('0xee')][_0xbd64('0x4e')];++_0x2b532a){_0x394dd0=_0x1c64ca[_0xbd64('0xee')][_0x2b532a];var _0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')]('%s%d',_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');var _0x4022da=_0x54831a[_0xbd64('0x2e')]['customer']||util[_0xbd64('0xeb')]('%s%d',_0xbd64('0xf1'),_0x394dd0['ContactId']);switch(_0x65c02b[_0xbd64('0xf2')]){case'website_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b[_0xbd64('0xf4')],_0x394dd0[_0xbd64('0x3d')]):_0xbd64('0xf0');break;case'agent_alias':_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0xf5')]||_0x394dd0['User']['fullname']:_0xbd64('0xf0');break;case _0xbd64('0xf6'):_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?_0x394dd0['User'][_0xbd64('0x35')]:_0xbd64('0xf0');break;default:_0x1ac26f=_0x394dd0[_0xbd64('0x3d')]?util[_0xbd64('0xeb')](_0xbd64('0xf3'),_0x65c02b['agentAlias'],_0x394dd0[_0xbd64('0x3d')]):'System';}var _0x5ec435=util[_0xbd64('0xeb')](_0xbd64('0xf7'),moment(_0x394dd0[_0xbd64('0xf8')])[_0xbd64('0xeb')](_0xbd64('0xf9')),_0x394dd0[_0xbd64('0xfa')]==='in'?_0x4022da:_0x1ac26f,_0x394dd0[_0xbd64('0x2e')]);if(!_0x394dd0[_0xbd64('0xfb')]){fs[_0xbd64('0xfc')](_0x545933,_0x5ec435);}}return db[_0xbd64('0xfd')][_0xbd64('0xc3')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbd64('0xfe'),'raw':!![],'include':[{'model':db[_0xbd64('0xff')],'as':_0xbd64('0xff'),'raw':!![]}]}]});}}})[_0xbd64('0x15')](function(_0x4e69f8){if(!_0x4e69f8||!_0x4e69f8[_0xbd64('0xfe')]||!_0x54831a[_0xbd64('0x2e')])return _0x1c64ca;var _0x4a6ea9=_0x4e69f8['getSmtpOptions']();return respondWithRpcPromise(_0xbd64('0x100'),_0xbd64('0x101'),{'account':_0x4a6ea9,'message':{'from':util[_0xbd64('0xeb')](_0xbd64('0x102'),_0x4e69f8[_0xbd64('0x54')],_0x4e69f8[_0xbd64('0xc8')]||_0x4e69f8['Smtp'][_0xbd64('0x9d')]),'to':_0x54831a[_0xbd64('0x2e')][_0xbd64('0xe9')],'subject':_0xbd64('0x103'),'text':util['format'](_0xbd64('0x104'),_0x54831a['body'][_0xbd64('0xe9')]),'attachments':[{'path':_0x545933}]}})[_0xbd64('0x15')](function(){return _0x1c64ca;})[_0xbd64('0x1f')](function(_0x44662a){logger['error'](_0x44662a);});})[_0xbd64('0x15')](respondWithStatusCode(_0x1d8739,0xc8))['catch'](handleError(_0x1d8739,null));};exports[_0xbd64('0x105')]=function(_0x4cf6ec,_0x28ae53){return db['ChatMessage'][_0xbd64('0x68')]({'where':{'id':_0x4cf6ec[_0xbd64('0xc0')]['id']}})['then'](handleEntityNotFound(_0x28ae53,null))[_0xbd64('0x15')](function(_0x4238ae){if(_0x4238ae){return _0x4238ae['addMessage'](_0x4cf6ec[_0xbd64('0x2e')][_0xbd64('0x106')],_[_0xbd64('0x107')](_0x4cf6ec['body'],[_0xbd64('0x106'),'id'])||{});}})[_0xbd64('0x15')](respondWithResult(_0x28ae53,null))[_0xbd64('0x1f')](handleError(_0x28ae53,null));};exports['getMessages']=function(_0x475fc3,_0x46f980){var _0x5c9a2f={'raw':![],'where':{}};var _0x512f76={};var _0x4452ba={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x475fc3[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x46f980,null))[_0xbd64('0x15')](function(_0x5423f1){if(_0x5423f1){_0x512f76[_0xbd64('0x47')]=_['keys'](db[_0xbd64('0xd2')]['rawAttributes']);_0x512f76[_0xbd64('0x48')]=_[_0xbd64('0x49')](_0x475fc3['query']);_0x512f76[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x512f76[_0xbd64('0x47')],_0x512f76[_0xbd64('0x48')]);_0x5c9a2f[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x512f76['model'],qs[_0xbd64('0x4d')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4d')]));_0x5c9a2f[_0xbd64('0x4c')]=_0x5c9a2f[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x5c9a2f['attributes']:_0x512f76['model'];if(!_0x475fc3[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x5c9a2f['limit']=qs[_0xbd64('0x25')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x25')]);_0x5c9a2f[_0xbd64('0x23')]=qs[_0xbd64('0x23')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x5c9a2f['order']=qs[_0xbd64('0x108')](_0x475fc3[_0xbd64('0x48')][_0xbd64('0x108')]);_0x5c9a2f[_0xbd64('0x51')]=qs['filters'](_['pick'](_0x475fc3['query'],_0x512f76[_0xbd64('0x4a')]));_0x5c9a2f['where'][_0xbd64('0xb9')]=_0x5423f1['id'];if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]){_0x5c9a2f['where']=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],{'$or':_[_0xbd64('0x34')](_0x5c9a2f[_0xbd64('0x4c')],function(_0x3248fa){var _0x996723={};_0x996723[_0x3248fa]={'$like':'%'+_0x475fc3[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x996723;})});}if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]){var _0x217a57=_0x475fc3[_0xbd64('0x48')][_0xbd64('0x83')]['split'](',');var _0x233441={};_0x233441[_0x217a57[0x0]]={'$gte':moment(_0x217a57[0x1])['format'](_0xbd64('0x109'))};_0x5c9a2f[_0xbd64('0x51')]=_[_0xbd64('0xa4')](_0x5c9a2f[_0xbd64('0x51')],_0x233441);}_0x5c9a2f=_[_0xbd64('0xa4')]({},_0x5c9a2f,_0x475fc3[_0xbd64('0x10a')]);return db['ChatMessage']['count']({'where':_0x5c9a2f['where']})['then'](function(_0x2f75d1){_0x4452ba[_0xbd64('0x26')]=_0x2f75d1;if(_0x475fc3[_0xbd64('0x48')][_0xbd64('0xbd')]){_0x5c9a2f[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')][_0xbd64('0x10b')](_0x5c9a2f);})[_0xbd64('0x15')](function(_0x50abe1){_0x4452ba[_0xbd64('0xbb')]=_0x50abe1;return _0x4452ba;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x46f980,_0x5c9a2f))['catch'](handleError(_0x46f980,null));};exports[_0xbd64('0x10c')]=function(_0x41294f,_0x3f3cd6){var _0x47806e={'where':{}},_0x39b3c7={},_0x325f67={'count':0x0,'rows':[]};return db[_0xbd64('0x43')][_0xbd64('0xc3')]({'where':{'id':_0x41294f[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x3f3cd6,null))[_0xbd64('0x15')](function(_0x489033){if(_0x489033){_0x39b3c7[_0xbd64('0x47')]=_[_0xbd64('0x49')](db[_0xbd64('0xd2')]['rawAttributes']);_0x39b3c7[_0xbd64('0x48')]=_['keys'](_0x41294f[_0xbd64('0x48')]);_0x39b3c7[_0xbd64('0x4a')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],_0x39b3c7['query']);_0x47806e[_0xbd64('0x4c')]=_[_0xbd64('0x4b')](_0x39b3c7['model'],qs[_0xbd64('0x4d')](_0x41294f['query'][_0xbd64('0x4d')]));_0x47806e[_0xbd64('0x4c')]=_0x47806e[_0xbd64('0x4c')][_0xbd64('0x4e')]?_0x47806e[_0xbd64('0x4c')]:_0x39b3c7[_0xbd64('0x47')];if(!_0x41294f[_0xbd64('0x48')][_0xbd64('0x4f')](_0xbd64('0x50'))){_0x47806e[_0xbd64('0x25')]=qs['limit'](_0x41294f['query'][_0xbd64('0x25')]);_0x47806e[_0xbd64('0x23')]=qs['offset'](_0x41294f[_0xbd64('0x48')][_0xbd64('0x23')]);}_0x47806e[_0xbd64('0x97')]=qs[_0xbd64('0x108')](_0x41294f['query'][_0xbd64('0x108')]);_0x47806e[_0xbd64('0x51')]=qs[_0xbd64('0x4a')](_['pick'](_0x41294f['query'],_0x39b3c7[_0xbd64('0x4a')]));_0x47806e[_0xbd64('0x51')][_0xbd64('0xb9')]=_0x489033['id'];if(_0x41294f['query'][_0xbd64('0x8c')]){_0x47806e['where']=_[_0xbd64('0xa4')](_0x47806e['where'],{'$or':_[_0xbd64('0x34')](_0x47806e['attributes'],function(_0x305199){var _0x37498c={};_0x37498c[_0x305199]={'$like':'%'+_0x41294f[_0xbd64('0x48')][_0xbd64('0x8c')]+'%'};return _0x37498c;})});}_0x47806e['where'][_0xbd64('0xfb')]=![];if(_0x41294f[_0xbd64('0x48')]['id']){_0x47806e[_0xbd64('0x51')]['id']={'$gt':_0x41294f[_0xbd64('0x48')]['id']};}_0x47806e=_[_0xbd64('0xa4')]({},_0x47806e,_0x41294f[_0xbd64('0x10a')]);return db[_0xbd64('0xd2')][_0xbd64('0x26')]({'where':_0x47806e[_0xbd64('0x51')]})[_0xbd64('0x15')](function(_0x197e24){_0x325f67['count']=_0x197e24;_0x47806e[_0xbd64('0xbe')]=[];if(_0x41294f[_0xbd64('0x48')]['includeAgent']){_0x47806e['include'][_0xbd64('0x39')]({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35'),_0xbd64('0xf5')]});}if(_0x41294f[_0xbd64('0x48')]['includeAll']){_0x47806e[_0xbd64('0xbe')]=[{'all':!![]}];}return db[_0xbd64('0xd2')]['findAll'](_0x47806e);})[_0xbd64('0x15')](function(_0x17cacc){_0x325f67[_0xbd64('0xbb')]=_0x17cacc;return _0x325f67;});}})[_0xbd64('0x15')](respondWithFilteredResult(_0x3f3cd6,_0x47806e))[_0xbd64('0x1f')](handleError(_0x3f3cd6,null));};exports[_0xbd64('0x10d')]=function(_0x1d759c,_0x171d75){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x1d759c['params']['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x171d75,null))['then'](function(_0x2acfac){if(_0x2acfac){return _0x2acfac['setTags'](_0x1d759c[_0xbd64('0x2e')]['ids'],_[_0xbd64('0x107')](_0x1d759c[_0xbd64('0x2e')],['ids','id'])||{})[_0xbd64('0x10e')](function(){return db[_0xbd64('0x78')][_0xbd64('0x10b')]({'attributes':['id',_0xbd64('0x54'),_0xbd64('0x55')],'where':{'id':_0x1d759c[_0xbd64('0x2e')][_0xbd64('0x106')]}});})[_0xbd64('0x15')](function(_0x160744){socket[_0xbd64('0x10f')](_0xbd64('0x110'),{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]});return{'id':Number(_0x1d759c[_0xbd64('0xc0')]['id']),'tags':_0x160744||[]};});}})[_0xbd64('0x15')](respondWithResult(_0x171d75,null))[_0xbd64('0x1f')](handleError(_0x171d75,null));};exports[_0xbd64('0x111')]=function(_0x384d15,_0x24eec6){return db[_0xbd64('0x43')]['find']({'where':{'id':_0x384d15[_0xbd64('0xc0')]['id']}})[_0xbd64('0x15')](handleEntityNotFound(_0x24eec6,null))[_0xbd64('0x15')](function(_0x483727){if(_0x483727){return _0x483727[_0xbd64('0x111')](_0x384d15[_0xbd64('0x48')][_0xbd64('0x106')]);}})[_0xbd64('0x15')](respondWithStatusCode(_0x24eec6,null))[_0xbd64('0x1f')](handleError(_0x24eec6,null));};exports[_0xbd64('0xe8')]=function(_0x89472a,_0x22dd66){var _0x2137fc=moment()[_0xbd64('0x112')]()[_0xbd64('0xa2')]();var _0x1267c8=path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],_0xbd64('0x113'),'files',_0xbd64('0x114'));var _0x356b58=path[_0xbd64('0xe5')](config['root'],_0xbd64('0x113'),_0xbd64('0x115'),_0xbd64('0x116'));var _0x23e5d8=path[_0xbd64('0xe5')](_0x1267c8,_0x2137fc);var _0x18b84f=util[_0xbd64('0xeb')](_0xbd64('0x117'),_0x89472a[_0xbd64('0xc0')]['id'],_0x2137fc);var _0x281df6=path['join'](_0x1267c8,_0x18b84f);var _0x4021f2=[];_0x4021f2['push']({'model':db[_0xbd64('0xef')],'as':'User','attributes':['id',_0xbd64('0x35')],'raw':!![]});_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xd6')],'as':_0xbd64('0x118'),'attributes':['id',_0xbd64('0x119'),_0xbd64('0x11a')],'raw':!![]});if(_0x89472a[_0xbd64('0x48')][_0xbd64('0x116')]){_0x4021f2[_0xbd64('0x39')]({'model':db[_0xbd64('0xe2')],'as':_0xbd64('0xe2'),'raw':!![]});}var _0x3edc3b=[{'model':db[_0xbd64('0xd2')],'as':'Messages','attributes':['id','body',_0xbd64('0xf8'),_0xbd64('0xfa'),_0xbd64('0xfb'),_0xbd64('0x89')],'include':_0x4021f2}];_0x3edc3b[_0xbd64('0x39')]({'model':db[_0xbd64('0xc4')],'as':'Account','attributes':['id',_0xbd64('0x54')]});_0x3edc3b['push']({'model':db[_0xbd64('0xef')],'as':_0xbd64('0x11b'),'attributes':['id','fullname']});return db[_0xbd64('0x43')][_0xbd64('0x68')]({'where':{'id':_0x89472a[_0xbd64('0xc0')]['id']},'include':_0x3edc3b})[_0xbd64('0x15')](handleEntityNotFound(_0x22dd66,null))[_0xbd64('0x15')](function(_0x10a22f){if(_0x10a22f){var _0x3db848=_0x10a22f['get']({'plain':!![]});fs['mkdirSync'](_0x23e5d8);var _0x5422bc={'channel':_0xbd64('0x11c'),'account':_0x3db848[_0xbd64('0x11d')][_0xbd64('0x54')],'agent':_0x3db848[_0xbd64('0x11b')]?_0x3db848['Owner'][_0xbd64('0x35')]:'N.A.','createdAt':moment(_0x3db848['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'closedAt':_0x3db848[_0xbd64('0x3c')]?moment(_0x3db848[_0xbd64('0x11e')])[_0xbd64('0xeb')](_0xbd64('0x109'))['toString']():'','disposition':_0x3db848[_0xbd64('0x40')],'chatInfo':{'browser':_0x3db848[_0xbd64('0x11f')],'os':_0x3db848['osName'],'referer':_0x3db848['referer'],'customerIp':_0x3db848[_0xbd64('0x120')],'customerPort':_0x3db848['customerPort']?_0x3db848[_0xbd64('0x121')]:_0xbd64('0x122')},'messages':_(_0x3db848[_0xbd64('0xee')])[_0xbd64('0x123')]()[_0xbd64('0x8c')]({'secret':![]})[_0xbd64('0x34')](function(_0x20bdb5){if(_0x20bdb5[_0xbd64('0xe2')]){var _0x4020a1=path[_0xbd64('0xe5')](_0x356b58,_0x20bdb5[_0xbd64('0xe2')][_0xbd64('0xe7')]);if(fs[_0xbd64('0x124')](_0x4020a1)){fs[_0xbd64('0x125')](_0x4020a1)['pipe'](fs[_0xbd64('0x126')](path['join'](_0x23e5d8,_0x20bdb5[_0xbd64('0xe2')]['basename'])));}}return{'date':moment(_0x20bdb5[_0xbd64('0xf8')])[_0xbd64('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbd64('0xa2')](),'sender':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?_0x20bdb5['User']?_0x20bdb5[_0xbd64('0xef')][_0xbd64('0x35')]:_0xbd64('0xf0'):_0x20bdb5[_0xbd64('0x118')][_0xbd64('0x119')]+(_0x20bdb5['Contact'][_0xbd64('0x11a')]?'\x20'+_0x20bdb5['Contact']['lastName']:''),'body':_0x20bdb5['Attachment']?_0x20bdb5[_0xbd64('0xe2')]['basename']:_0x20bdb5[_0xbd64('0x2e')],'direction':_0x20bdb5[_0xbd64('0xfa')]===_0xbd64('0xd1')?'A':'C','secret':_0x20bdb5[_0xbd64('0xfb')],'read':_0x20bdb5[_0xbd64('0x89')],'attachment':_0x20bdb5['Attachment']};})[_0xbd64('0x6a')]()};return ejs['renderFile'](path[_0xbd64('0xe5')](config[_0xbd64('0xe6')],'server',_0xbd64('0x127'),_0xbd64('0x128')),{'interaction':_0x5422bc})[_0xbd64('0x15')](function(_0x1f5879){var _0x142845=path[_0xbd64('0xe5')](_0x23e5d8,_0xbd64('0x129')+_0x3db848['id']+'-'+_0x2137fc+_0xbd64('0x12a'));var _0x33a5c9={'path':_0x142845,'channel':'Chat','interactionId':_0x3db848['id']};return pdf[_0xbd64('0x12b')](_0x1f5879,_0x33a5c9);})['then'](function(){return new Promise(function(_0x5df014,_0x5d8bf1){zipdir(_0x23e5d8,{'saveTo':_0x281df6},function(_0x101acc,_0x4fceed){if(_0x101acc)return _0x5d8bf1(_0x101acc);return _0x5df014(_0x4fceed);});})[_0xbd64('0x15')](function(){return new BPromise(function(_0x4996bb,_0x1da281){rimraf(_0x23e5d8,function(_0x516378){if(_0x516378)_0x1da281(_0x516378);return _0x4996bb();});});})[_0xbd64('0x15')](function(){return _0x22dd66[_0xbd64('0xe8')](_0x281df6,_0x18b84f,function(_0x2583cd){if(_0x2583cd){logger[_0xbd64('0x1a')](_0xbd64('0x12c'),_0x2583cd);}else{fs['unlinkSync'](_0x281df6);}});});});}else{return _0x22dd66[_0xbd64('0xda')](0xc8);}})[_0xbd64('0x1f')](handleError(_0x22dd66,null));}; \ No newline at end of file +var _0x5b02=['closed','disposition','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','field','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','rawAttributes','includeAll','include','options','create','params','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','format','transcript-%s.txt','now','Messages','User','ChatWebsite','CmContact','agentAlias','System','%s%d','Visitor','website_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','hasOwnProperty','sort','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','util','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','stack','name','render','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','talking','answered','unmanaged','abandoned','total','UserId','waiting'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x5b02,0xe9));var _0x25b0=function(_0x114b63,_0x332fce){_0x114b63=_0x114b63-0x0;var _0x17caef=_0x5b02[_0x114b63];return _0x17caef;};'use strict';var rimraf=require(_0x25b0('0x0'));var zipdir=require(_0x25b0('0x1'));var rp=require(_0x25b0('0x2'));var moment=require(_0x25b0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25b0('0x4'));var path=require('path');var ejs=require(_0x25b0('0x5'));var fs=require('fs');var _=require(_0x25b0('0x6'));var squel=require(_0x25b0('0x7'));var Redis=require(_0x25b0('0x8'));var qs=require(_0x25b0('0x9'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x25b0('0xa'));var logger=require(_0x25b0('0xb'))('api');var config=require(_0x25b0('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x25b0('0xd')](config[_0x25b0('0xe')],{'host':_0x25b0('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25b0('0xe')]));require(_0x25b0('0x10'))[_0x25b0('0x11')](socket);var jayson=require(_0x25b0('0x12'));var client=jayson[_0x25b0('0x13')][_0x25b0('0x14')]({'port':0x232b});var client9004=jayson[_0x25b0('0x13')][_0x25b0('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x193c2b,_0x1d3178,_0x184452,_0x26a34f){return new BPromise(function(_0x2048dc,_0x3655c2){var _0x1ceeb1=_0x26a34f||client;return _0x1ceeb1[_0x25b0('0x15')](_0x193c2b,_0x184452)[_0x25b0('0x16')](function(_0x211658){logger[_0x25b0('0x17')](_0x25b0('0x18'),_0x1d3178,_0x25b0('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1d3178,_0x25b0('0x19'),JSON['stringify'](_0x211658));if(_0x211658[_0x25b0('0x1a')]){if(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1b')]===0x1f4){logger[_0x25b0('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x1d3178,_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);return _0x3655c2(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);}logger[_0x25b0('0x1a')](_0x25b0('0x18'),_0x1d3178,_0x211658['error'][_0x25b0('0x1c')]);return _0x2048dc(_0x211658[_0x25b0('0x1a')][_0x25b0('0x1c')]);}else{logger[_0x25b0('0x17')](_0x25b0('0x18'),_0x1d3178,_0x25b0('0x19'));_0x2048dc(_0x211658[_0x25b0('0x1d')][_0x25b0('0x1c')]);}})[_0x25b0('0x1e')](function(_0x35939f){logger[_0x25b0('0x1a')](_0x25b0('0x18'),_0x1d3178,_0x35939f);_0x3655c2(_0x35939f);});});}function respondWithStatusCode(_0x5cb746,_0x9f432e){_0x9f432e=_0x9f432e||0xcc;return function(_0x16623c){if(_0x16623c){return _0x5cb746['sendStatus'](_0x9f432e);}return _0x5cb746[_0x25b0('0x1f')](_0x9f432e)[_0x25b0('0x20')]();};}function respondWithResult(_0x3546f0,_0x498fef){_0x498fef=_0x498fef||0xc8;return function(_0x4b87c9){if(_0x4b87c9){return _0x3546f0['status'](_0x498fef)[_0x25b0('0x21')](_0x4b87c9);}};}function respondWithFilteredResult(_0x433085,_0x99bd3a){return function(_0x24f847){if(_0x24f847){var _0xdbb459=typeof _0x99bd3a[_0x25b0('0x22')]===_0x25b0('0x23')&&typeof _0x99bd3a[_0x25b0('0x24')]===_0x25b0('0x23');var _0x596d14=_0x24f847[_0x25b0('0x25')];var _0xbfba84=_0xdbb459?0x0:_0x99bd3a['offset'];var _0x567775=_0xdbb459?_0x24f847['count']:_0x99bd3a[_0x25b0('0x22')]+_0x99bd3a[_0x25b0('0x24')];var _0x251fad;if(_0x567775>=_0x596d14){_0x567775=_0x596d14;_0x251fad=0xc8;}else{_0x251fad=0xce;}_0x433085[_0x25b0('0x1f')](_0x251fad);return _0x433085[_0x25b0('0x26')](_0x25b0('0x27'),_0xbfba84+'-'+_0x567775+'/'+_0x596d14)[_0x25b0('0x21')](_0x24f847);}return null;};}function saveUpdates(_0x227287){return function(_0x36b81d){if(_0x36b81d){return _0x36b81d[_0x25b0('0x28')](_0x227287)[_0x25b0('0x16')](function(_0x3161c1){return _0x3161c1;});}return null;};}function removeEntity(_0x1ea374){return function(_0x4f640f){if(_0x4f640f){return _0x4f640f['destroy']()[_0x25b0('0x16')](function(){_0x1ea374['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3317fc){return function(_0x419975){if(!_0x419975){_0x3317fc[_0x25b0('0x29')](0x194);}return _0x419975;};}function handleError(_0x2338fa,_0xb68653){_0xb68653=_0xb68653||0x1f4;return function(_0x5d64dc){logger[_0x25b0('0x1a')](_0x5d64dc[_0x25b0('0x2a')]);if(_0x5d64dc['name']){delete _0x5d64dc[_0x25b0('0x2b')];}_0x2338fa[_0x25b0('0x1f')](_0xb68653)['send'](_0x5d64dc);};}function getMustacheRender(_0x215fb8,_0x49b3a5){return Mustache[_0x25b0('0x2c')](_0x215fb8,_[_0x25b0('0x2d')](_0x49b3a5[_0x25b0('0x2e')],{'contact':_0x49b3a5[_0x25b0('0x2f')],'message':_0x49b3a5[_0x25b0('0x1c')],'agent':_0x49b3a5[_0x25b0('0x30')],'interaction':_0x49b3a5[_0x25b0('0x31')],'account':_0x49b3a5[_0x25b0('0x32')]}))||'';}function getInteractionUsers(_0x2f123c,_0x4790fe){return new BPromise(function(_0x461a06,_0x434bda){try{if(_0x4790fe[_0x2f123c['id']]){_0x2f123c[_0x25b0('0x33')]=_[_0x25b0('0x34')](_0x4790fe[_0x2f123c['id']],function(_0xc6180){return{'id':_0xc6180['id'],'fullname':_0xc6180[_0x25b0('0x35')]};});}}catch(_0x1eee05){_0x434bda(_0x1eee05);}_0x461a06(_0x2f123c);});}function getInteractionTags(_0x847eba,_0x29e810){return new BPromise(function(_0x2d798b,_0x4c6a19){try{if(_0x847eba[_0x25b0('0x36')]){_0x847eba[_0x25b0('0x37')]=[];_0x847eba[_0x25b0('0x36')]['split'](',')[_0x25b0('0x38')](function(_0x42a0ed){_0x847eba[_0x25b0('0x37')][_0x25b0('0x39')](_0x29e810[_0x42a0ed]);});}delete _0x847eba[_0x25b0('0x36')];}catch(_0xa35c6a){_0x4c6a19(_0xa35c6a);}_0x2d798b(_0x847eba);});}function updateChatInteraction(_0x28f1cd,_0x391493,_0x5297f7){return new BPromise(function(_0x4ae0aa,_0x447a18){return getInteractionUsers(_0x28f1cd,_0x5297f7)[_0x25b0('0x16')](function(_0x3f4ae0){return getInteractionTags(_0x3f4ae0,_0x391493);})['then'](function(_0x9c6ab4){return getStateInteraction(_0x9c6ab4);})['then'](function(_0x3eb6d4){_0x4ae0aa(_0x3eb6d4);})[_0x25b0('0x1e')](function(_0xbd0db5){_0x447a18(_0xbd0db5);});});}function getStateInteraction(_0x255e31){return new BPromise(function(_0x8a2eeb){_0x255e31['waiting']=0x0;_0x255e31[_0x25b0('0x3a')]=0x0;_0x255e31[_0x25b0('0x3b')]=0x0;_0x255e31[_0x25b0('0x3c')]=0x0;_0x255e31[_0x25b0('0x3d')]=0x0;_0x255e31[_0x25b0('0x3e')]=0x0;if(!_0x255e31['closed']&&!_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x40')]+=0x1;}if(!_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x3a')]+=0x1;if(_0x255e31[_0x25b0('0x40')]){_0x255e31[_0x25b0('0x40')]-=0x1;}}if(_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x42')]===_0x25b0('0x3d')){_0x255e31[_0x25b0('0x3d')]+=0x1;if(_0x255e31['waiting']){_0x255e31[_0x25b0('0x40')]-=0x1;}}else if(_0x255e31['closed']&&!_0x255e31[_0x25b0('0x3f')]&&_0x255e31[_0x25b0('0x42')]){_0x255e31[_0x25b0('0x3c')]+=0x1;if(_0x255e31[_0x25b0('0x40')]){_0x255e31['waiting']-=0x1;}}else if(_0x255e31[_0x25b0('0x41')]&&_0x255e31[_0x25b0('0x3f')]){_0x255e31[_0x25b0('0x3b')]+=0x1;if(_0x255e31['talking']){_0x255e31[_0x25b0('0x3a')]-=0x1;}}_0x255e31[_0x25b0('0x3e')]+=0x1;_0x8a2eeb(_0x255e31);});}exports[_0x25b0('0x43')]=function(_0x4434b1,_0x3b6679){var _0x3c6ec1={},_0x28bdc4={},_0x55ff4c={'count':0x0,'rows':[]};var _0x3ad3b3=_[_0x25b0('0x34')](db[_0x25b0('0x44')]['rawAttributes'],function(_0xbaeb06){return{'name':_0xbaeb06[_0x25b0('0x45')],'type':_0xbaeb06[_0x25b0('0x46')][_0x25b0('0x47')]};});_0x28bdc4[_0x25b0('0x48')]=_['map'](_0x3ad3b3,_0x25b0('0x2b'));_0x28bdc4[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x4434b1['query']);_0x28bdc4[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x28bdc4[_0x25b0('0x48')],_0x28bdc4[_0x25b0('0x49')]);_0x3c6ec1[_0x25b0('0x4d')]=_[_0x25b0('0x4c')](_0x28bdc4['model'],qs['fields'](_0x4434b1['query'][_0x25b0('0x4e')]));_0x3c6ec1['attributes']=_0x3c6ec1['attributes'][_0x25b0('0x4f')]?_0x3c6ec1['attributes']:_0x28bdc4[_0x25b0('0x48')];if(!_0x4434b1['query']['hasOwnProperty'](_0x25b0('0x50'))){_0x3c6ec1[_0x25b0('0x24')]=qs[_0x25b0('0x24')](_0x4434b1[_0x25b0('0x49')][_0x25b0('0x24')]);_0x3c6ec1[_0x25b0('0x22')]=qs[_0x25b0('0x22')](_0x4434b1[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x3c6ec1[_0x25b0('0x51')]=qs['sort'](_0x4434b1['query']['sort']);_0x3c6ec1[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x4434b1[_0x25b0('0x49')],_0x28bdc4[_0x25b0('0x4b')]),_0x3ad3b3);var _0x3f460f=[];var _0x735ebb=squel['select']()[_0x25b0('0x54')]('id')['field'](_0x25b0('0x2b'))['field']('color')[_0x25b0('0x55')]('tools_tags');var _0x58d4ad=squel[_0x25b0('0x56')]()[_0x25b0('0x54')](_0x25b0('0x57'))[_0x25b0('0x54')](_0x25b0('0x58'))[_0x25b0('0x54')](_0x25b0('0x59'))[_0x25b0('0x55')](_0x25b0('0x5a'),'ui')[_0x25b0('0x5b')]('users','u','u.id\x20=\x20ui.UserId');var _0x163a05=squel[_0x25b0('0x56')]()['from'](_0x25b0('0x5c'),'i')[_0x25b0('0x5b')](_0x25b0('0x5d'),'c',_0x25b0('0x5e'))[_0x25b0('0x5b')]('users','o',_0x25b0('0x5f'))[_0x25b0('0x5b')](_0x25b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x25b0('0x5b')](_0x25b0('0x61'),'me',_0x25b0('0x62'))[_0x25b0('0x5b')](_0x25b0('0x63'),'it',_0x25b0('0x64'))[_0x25b0('0x5b')](_0x25b0('0x65'),'t',_0x25b0('0x66'));var _0x39a5e3=squel[_0x25b0('0x67')]();var _0x131049=[];var _0x2db834=squel[_0x25b0('0x67')]();var _0x561634;if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x68')]){_0x561634=as['parseSearch'](_0x4434b1[_0x25b0('0x49')]['search']);var _0x3d3060=_0x561634[_0x25b0('0x69')];for(var _0x4cd91f=0x0;_0x4cd91f<_0x561634[_0x25b0('0x6a')][_0x25b0('0x4f')];_0x4cd91f++){var _0x25fab4=_0x561634['conditions'][_0x4cd91f];var _0x135f75='i';var _0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,[_0x25b0('0x2b'),_0x25fab4['field']]);if(!_0x5534ab){switch(_0x25fab4[_0x25b0('0x54')]){case _0x25b0('0x6c'):if(_0x25fab4['value']==0x1){_0x163a05[_0x25b0('0x6d')]('`'+_0x25fab4['field']+'`\x20=\x200');}else{_0x163a05['having']('`'+_0x25fab4[_0x25b0('0x54')]+_0x25b0('0x6e'));}break;case _0x25b0('0x6f'):if(_0x25fab4['operator']===_0x25b0('0x70')){if(_0x25fab4[_0x25b0('0x71')][_0x25b0('0x72')]('\x20')[_0x25b0('0x4f')]>0x1){_0x39a5e3[_0x3d3060](_0x25b0('0x73'),qs[_0x25b0('0x74')](_0x25fab4[_0x25b0('0x71')]),null);}else{var _0x452f19='%'+_0x25fab4[_0x25b0('0x71')]+'%';_0x39a5e3[_0x3d3060](_0x25b0('0x75'),_0x452f19,_0x452f19,_0x452f19);}}else{_0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,[_0x25b0('0x2b'),_0x25b0('0x76')]);_0x25fab4[_0x25b0('0x54')]=_0x25b0('0x76');_0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab[_0x25b0('0x46')],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d['text'],_0x55a48d[_0x25b0('0x71')]['start'],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x20')]);}break;case _0x25b0('0x78'):var _0x139eef=_0x25fab4['value'][_0x25b0('0x72')](',')[_0x25b0('0x34')](function(_0x3e326c){return Number(_0x3e326c);});_0x139eef[_0x25b0('0x38')](function(_0x46a1d1){_0x2db834['or'](_0x25b0('0x79'),'%,'+_0x46a1d1+',%');});_0x131049=_['union'](_0x131049,_0x139eef);break;case'User':if(_0x25fab4[_0x25b0('0x7a')]==='$substring'){_0x39a5e3[_0x3d3060](_0x25b0('0x7b'),'%'+_0x25fab4[_0x25b0('0x71')]+'%',null);}else{_0x5534ab=_[_0x25b0('0x6b')](_0x3ad3b3,['name',_0x25b0('0x3f')]);_0x25fab4[_0x25b0('0x54')]=_0x25b0('0x3f');_0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab['type'],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x7d')],_0x55a48d['value'][_0x25b0('0x20')]);}break;case _0x25b0('0x2e'):_0x55a48d=as[_0x25b0('0x77')]('me',null,_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x7d')],_0x55a48d[_0x25b0('0x71')][_0x25b0('0x20')]);break;}}else{var _0x55a48d=as[_0x25b0('0x77')](_0x135f75,_0x5534ab[_0x25b0('0x46')],_0x25fab4);_0x39a5e3[_0x3d3060](_0x55a48d[_0x25b0('0x7c')],_0x55a48d[_0x25b0('0x71')]['start'],_0x55a48d['value'][_0x25b0('0x20')]);}}}else{var _0x330daa=_(_0x4434b1[_0x25b0('0x49')])[_0x25b0('0x4a')]()['map'](function(_0x3315bf){return _[_0x25b0('0x7e')](_0x3ad3b3,['name',_0x3315bf])?_0x3315bf:undefined;})[_0x25b0('0x7f')]()[_0x25b0('0x71')]();if(!_['isEmpty'](_0x330daa)){_0x330daa['forEach'](function(_0xef147b){if(_0xef147b===_0x25b0('0x80')){_0x163a05[_0x25b0('0x52')](_0x25b0('0x81'),[][_0x25b0('0x82')](_0x4434b1[_0x25b0('0x49')][_0xef147b]));}else if(_0xef147b===_0x25b0('0x83')){var _0x12fd93=JSON[_0x25b0('0x84')](_0x4434b1[_0x25b0('0x49')][_0xef147b])[_0x25b0('0x85')];var _0x43b334=JSON[_0x25b0('0x84')](_0x4434b1['query'][_0xef147b])[_0x25b0('0x86')];_0x163a05['where'](_0x25b0('0x87'),_0x12fd93,_0x43b334);}else{if(_0x4434b1[_0x25b0('0x49')][_0xef147b]==='null'){_0x163a05[_0x25b0('0x52')]('i.'+_0xef147b+_0x25b0('0x88'));}else{_0x163a05[_0x25b0('0x52')]('i.'+_0xef147b+_0x25b0('0x89'),_0x4434b1[_0x25b0('0x49')][_0xef147b]);}}});}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8a')]){if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8a')]==0x1){_0x163a05[_0x25b0('0x6d')](_0x25b0('0x8b'));}else{_0x163a05['having']('`unreadMessages`\x20>\x200');}}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8c')]){_0x131049=_['isArray'](_0x4434b1['query'][_0x25b0('0x8c')])?_0x4434b1['query'][_0x25b0('0x8c')]:new Array(_0x4434b1[_0x25b0('0x49')]['tag']);_0x131049[_0x25b0('0x38')](function(_0xd49a10){_0x2db834['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd49a10+',%');});}if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8d')]){var _0x9ee86f=_0x4434b1[_0x25b0('0x49')][_0x25b0('0x8d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x25b0('0x8e')](_0x9ee86f)){_0x39a5e3['or']('i.id\x20LIKE\x20?',_0x9ee86f+'%');}else{_0x39a5e3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x9ee86f))['or'](_0x25b0('0x8f'),_0x9ee86f+'%');}}}_0x163a05[_0x25b0('0x52')](_0x39a5e3);_0x163a05[_0x25b0('0x90')]('i.id');var _0x57f494={'type':db[_0x25b0('0x91')][_0x25b0('0x92')]['SELECT'],'raw':!![]};var _0x4e9ac3=_0x163a05['clone']();_0x4e9ac3[_0x25b0('0x54')](_0x25b0('0x93'));_0x4e9ac3[_0x25b0('0x54')](_0x25b0('0x94'),'unreadMessages');if(_0x3c6ec1[_0x25b0('0x51')]){_0x3c6ec1[_0x25b0('0x51')][_0x25b0('0x38')](function(_0xd956a5){var _0x35d1a0=_0xd956a5[0x0]===_0x25b0('0x95')?_0xd956a5[0x0]:'i.'+_0xd956a5[0x0];_0x163a05[_0x25b0('0x51')](_0x35d1a0,_0xd956a5[0x1]===_0x25b0('0x96')?![]:!![]);});}if(!_[_0x25b0('0x97')](_0x131049)){_0x163a05[_0x25b0('0x6d')](_0x2db834);_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x98'),_0x131049);}BPromise[_0x25b0('0x99')]()[_0x25b0('0x16')](function(){if(!_0x561634){if(_0x4434b1[_0x25b0('0x49')][_0x25b0('0x80')])return;_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x9a'));_0x163a05['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4434b1[_0x25b0('0x9b')]['role']!==_0x25b0('0x30'))return;return _0x4434b1['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x4cb24c){if(_['isEmpty'](_0x4cb24c)){_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x9c'));_0x163a05[_0x25b0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4e9ac3[_0x25b0('0x52')](_0x25b0('0x81'),_['map'](_0x4cb24c,'id'));_0x163a05[_0x25b0('0x52')](_0x25b0('0x81'),_[_0x25b0('0x34')](_0x4cb24c,'id'));}});})[_0x25b0('0x16')](function(){if(_0x4434b1[_0x25b0('0x9b')][_0x25b0('0x9d')]===_0x25b0('0x30')&&!_0x561634&&!_0x4434b1[_0x25b0('0x49')][_0x25b0('0x80')])return[];return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x4e9ac3[_0x25b0('0x9f')](),_0x57f494);})[_0x25b0('0x16')](function(_0x2e1c98){_0x55ff4c[_0x25b0('0x25')]=_0x2e1c98[_0x25b0('0x4f')];if(_0x55ff4c[_0x25b0('0x25')]===0x0)return[];return db['sequelize'][_0x25b0('0x49')](_0x735ebb[_0x25b0('0x9f')](),_0x57f494)[_0x25b0('0x16')](function(_0x2a6a2a){_0x3f460f=_[_0x25b0('0xa0')](_0x2a6a2a,'id');_0x57f494=_['merge'](_0x57f494,{'model':db[_0x25b0('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4434b1['query'][_0x25b0('0x4e')]){_0x3c6ec1['attributes']['forEach'](function(_0x4fe408){_0x163a05['field']('i.'+_0x4fe408);});}else{_0x163a05[_0x25b0('0x54')](_0x25b0('0x94'),'unreadMessages');_0x163a05[_0x25b0('0x54')](_0x25b0('0xa1'),_0x25b0('0xa2'));_0x163a05[_0x25b0('0x54')]('a.mandatoryDisposition',_0x25b0('0xa3'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa4'),'contactName');_0x163a05[_0x25b0('0x54')](_0x25b0('0xa5'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa6'),_0x25b0('0xa7'));_0x163a05['field']('c.lastName',_0x25b0('0xa8'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xa9'),_0x25b0('0xaa'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xab'),_0x25b0('0xac'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xad'),_0x25b0('0xae'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xaf'),_0x25b0('0xb0'));_0x163a05['field'](_0x25b0('0xb1'),'Owner.fullname');_0x163a05[_0x25b0('0x54')](_0x25b0('0xb2'),_0x25b0('0xb3'));_0x163a05[_0x25b0('0x54')](_0x25b0('0xb4'),_0x25b0('0x36'));}if(_0x3c6ec1['limit'])_0x163a05[_0x25b0('0x24')](_0x3c6ec1['limit']);if(_0x3c6ec1[_0x25b0('0x22')])_0x163a05['offset'](_0x3c6ec1[_0x25b0('0x22')]);return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x163a05[_0x25b0('0x9f')](),_0x57f494);})[_0x25b0('0x16')](function(_0xcf7098){if(_0xcf7098['length']>0x0)_0x58d4ad['where'](_0x25b0('0xb5'),_[_0x25b0('0x34')](_0xcf7098,'id'));return db[_0x25b0('0x9e')][_0x25b0('0x49')](_0x58d4ad['toString'](),_0x57f494)[_0x25b0('0x16')](function(_0x5e0ae3){var _0x220a3b=_[_0x25b0('0xb6')](_0x5e0ae3,'ChatInteractionId');var _0x2b20e8=[];_0xcf7098[_0x25b0('0x38')](function(_0x52bcb7){_0x2b20e8[_0x25b0('0x39')](updateChatInteraction(_0x52bcb7,_0x3f460f,_0x220a3b));});return BPromise[_0x25b0('0xb7')](_0x2b20e8);});});})[_0x25b0('0x16')](function(_0x6d1e07){_0x55ff4c[_0x25b0('0xb8')]=_0x6d1e07;return _0x55ff4c;})[_0x25b0('0x16')](respondWithFilteredResult(_0x3b6679,_0x3c6ec1))[_0x25b0('0x1e')](handleError(_0x3b6679,null));};exports[_0x25b0('0xb9')]=function(_0xa6b29d,_0x39c3d8){var _0x5e2169={'raw':![],'where':{'id':_0xa6b29d['params']['id']}},_0x40b592={};_0x40b592[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0x44')][_0x25b0('0xba')]);_0x40b592[_0x25b0('0x49')]=_['keys'](_0xa6b29d[_0x25b0('0x49')]);_0x40b592[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x40b592[_0x25b0('0x48')],_0x40b592[_0x25b0('0x49')]);_0x5e2169['attributes']=_['intersection'](_0x40b592[_0x25b0('0x48')],qs[_0x25b0('0x4e')](_0xa6b29d[_0x25b0('0x49')][_0x25b0('0x4e')]));_0x5e2169['attributes']=_0x5e2169[_0x25b0('0x4d')]['length']?_0x5e2169[_0x25b0('0x4d')]:_0x40b592[_0x25b0('0x48')];if(_0xa6b29d[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x5e2169[_0x25b0('0xbc')]=[{'all':!![]}];}_0x5e2169=_[_0x25b0('0x2d')]({},_0x5e2169,_0xa6b29d[_0x25b0('0xbd')]);return db[_0x25b0('0x44')][_0x25b0('0x6b')](_0x5e2169)['then'](handleEntityNotFound(_0x39c3d8,null))[_0x25b0('0x16')](respondWithResult(_0x39c3d8,null))['catch'](handleError(_0x39c3d8,null));};exports[_0x25b0('0xbe')]=function(_0x44c6e6,_0x43401e){return db[_0x25b0('0x44')][_0x25b0('0xbe')](_0x44c6e6['body'],{})[_0x25b0('0x16')](respondWithResult(_0x43401e,0xc9))[_0x25b0('0x1e')](handleError(_0x43401e,null));};exports[_0x25b0('0x28')]=function(_0x40d6fb,_0x50dbb7){if(_0x40d6fb['body']['id']){delete _0x40d6fb[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')][_0x25b0('0x6b')]({'where':{'id':_0x40d6fb[_0x25b0('0xbf')]['id']}})['then'](handleEntityNotFound(_0x50dbb7,null))['then'](saveUpdates(_0x40d6fb[_0x25b0('0x2e')],null))['then'](respondWithResult(_0x50dbb7,null))[_0x25b0('0x1e')](handleError(_0x50dbb7,null));};exports[_0x25b0('0xc0')]=function(_0x42bc42,_0x107814){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x42bc42[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x107814,null))[_0x25b0('0x16')](removeEntity(_0x107814,null))['catch'](handleError(_0x107814,null));};exports[_0x25b0('0xc1')]=function(_0x31908d,_0x42c9b5){return db['ChatInteraction'][_0x25b0('0xc1')]()['then'](respondWithResult(_0x42c9b5,null))['catch'](handleError(_0x42c9b5,null));};exports[_0x25b0('0xc2')]=function(_0xcb86ba,_0x584acd){var _0x17cd9e=_0xcb86ba['params']['id'];var _0x35d3f5;var _0x503ad7;var _0x4ad548;return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x17cd9e}})[_0x25b0('0x16')](function(_0x4539bf){_0x35d3f5=_0x4539bf;return db['ChatWebsite'][_0x25b0('0xc3')]({'where':{'id':_0x4539bf['ChatWebsiteId']},'attributes':['id',_0x25b0('0xc4'),_0x25b0('0xc5'),_0x25b0('0xc6'),_0x25b0('0xc7'),_0x25b0('0xc8')],'raw':!![]});})[_0x25b0('0x16')](function(_0x210e42){if(_0x210e42&&_0x210e42[_0x25b0('0xc4')]&&_0x210e42[_0x25b0('0xc5')]){_0x503ad7=_0x210e42;var _0x4bf695={'interaction':{'id':_0x17cd9e},'agent':{'id':_0xcb86ba[_0x25b0('0x9b')]['id'],'name':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0x2b')],'fullname':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0x35')],'email':_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0xc9')]},'contact':_0xcb86ba[_0x25b0('0x2e')][_0x25b0('0x2f')],'account':_0xcb86ba['body']['account']};var _0x3fc765={'rejectUnauthorized':![],'method':_0x25b0('0xca'),'url':_0x25b0('0xcb'),'headers':{'X-APIKEY':_0x210e42[_0x25b0('0xc4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xcb86ba[_0x25b0('0x9b')][_0x25b0('0xc9')]],'buttons':null,'topic':_0x503ad7[_0x25b0('0xc6')],'note':_[_0x25b0('0xcc')](_0x503ad7[_0x25b0('0xc7')])?null:getMustacheRender(_0x503ad7[_0x25b0('0xc7')],_0x4bf695),'metadata':null},'redirect':_0x25b0('0xcd'),'json':!![]};try{if(!_['isNull'](_0x503ad7[_0x25b0('0xc8')])){var _0xecf0f6=getMustacheRender(_0x503ad7[_0x25b0('0xc8')],_0x4bf695);var _0x4db8a4=JSON[_0x25b0('0x84')](_0xecf0f6);_0x3fc765[_0x25b0('0x2e')][_0x25b0('0xce')]=_0x4db8a4;}}catch(_0x48c6d1){throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3fc765);}else{throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x25b0('0x16')](function(_0x26b8f6){_0x4ad548=_0x26b8f6;if(_0x4ad548['id']){var _0x14fa4d={'body':_0x4ad548[_0x25b0('0xd0')],'ChatWebsiteId':_0x503ad7['id'],'ChatInteractionId':_0x35d3f5['id'],'direction':'out','UserId':_0xcb86ba[_0x25b0('0x9b')]['id']};return db[_0x25b0('0xd1')][_0x25b0('0xbe')](_0x14fa4d,{});}else{throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))](_0x25b0('0xd2'));}})[_0x25b0('0x16')](function(){return _0x35d3f5[_0x25b0('0xd3')]({'vidaooSessionId':_0x4ad548['id']});})[_0x25b0('0x16')](respondWithResult(_0x584acd,null))[_0x25b0('0x1e')](handleError(_0x584acd,null));};exports['customUpdate']=function(_0x547f76,_0x3a2bed){if(_0x547f76['body']['id']){delete _0x547f76[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')][_0x25b0('0x6b')]({'where':{'id':_0x547f76[_0x25b0('0xbf')]['id']},'include':[{'model':db['CmContact'],'as':_0x25b0('0x6f')}]})[_0x25b0('0x16')](handleEntityNotFound(_0x3a2bed,null))['then'](saveUpdates(_0x547f76[_0x25b0('0x2e')],null))[_0x25b0('0x16')](respondWithResult(_0x3a2bed,null))[_0x25b0('0x1e')](handleError(_0x3a2bed,null));};exports[_0x25b0('0xd4')]=function(_0x2a06ab,_0x3c0cec){if(_0x2a06ab[_0x25b0('0x2e')]['id']){delete _0x2a06ab[_0x25b0('0x2e')]['id'];}return db[_0x25b0('0x44')]['find']({'where':{'id':_0x2a06ab[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](function(_0x5f4940){if(!_0x5f4940){logger[_0x25b0('0x1a')](_0x25b0('0xd5'),_0x25b0('0xd4'),0x194,_0x25b0('0xd6'));_0x3c0cec[_0x25b0('0x29')](0x194);}else{if(_0x5f4940[_0x25b0('0x3f')]){throw new db[(_0x25b0('0x91'))][(_0x25b0('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x5f4940;})[_0x25b0('0x16')](function(_0x197800){if(_0x197800){return _0x197800[_0x25b0('0x28')]({'closed':_0x2a06ab[_0x25b0('0x2e')]['closed'],'disposition':_0x2a06ab[_0x25b0('0x2e')][_0x25b0('0x42')]})[_0x25b0('0x16')](function(_0x2b85ee){return _0x2b85ee;});}})[_0x25b0('0x16')](function(){return respondWithRpcPromise(_0x25b0('0xd7'),_0x25b0('0xd4'),_0x2a06ab[_0x25b0('0x2e')],client9004);})['then'](respondWithResult(_0x3c0cec,null))[_0x25b0('0x1e')](handleError(_0x3c0cec,null));};exports['attachmentUpload']=function(_0x410b30,_0x1b7969){_0x410b30['body']['name']=_0x410b30[_0x25b0('0xd8')]['originalname'];_0x410b30[_0x25b0('0x2e')][_0x25b0('0xd9')]=_0x410b30[_0x25b0('0xd8')][_0x25b0('0xda')];_0x410b30['body'][_0x25b0('0x46')]=_0x410b30[_0x25b0('0xd8')][_0x25b0('0xdb')];return db[_0x25b0('0xdc')][_0x25b0('0xbe')](_0x410b30['body'])[_0x25b0('0x16')](respondWithResult(_0x1b7969,0xc9))[_0x25b0('0x1e')](handleError(_0x1b7969,null));};exports[_0x25b0('0xdd')]=function(_0x395766,_0x143814){return db[_0x25b0('0x44')]['findOne']({'where':{'id':_0x395766['params']['id']},'raw':!![]})[_0x25b0('0x16')](handleEntityNotFound(_0x143814,null))[_0x25b0('0x16')](function(_0x3faa59){if(_0x3faa59){if(_0x3faa59['closed']){return _0x143814[_0x25b0('0x1f')](0x193)[_0x25b0('0x21')]({'status':0x193,'message':_0x25b0('0xde')});}return db[_0x25b0('0xdc')][_0x25b0('0xc3')]({'where':{'id':_0x395766['query'][_0x25b0('0xdf')]},'raw':!![]})[_0x25b0('0x16')](handleEntityNotFound(_0x143814,null));}})[_0x25b0('0x16')](function(_0x5bce7e){if(_0x5bce7e){var _0x2de633=_0x5bce7e[_0x25b0('0xe0')]!==null;var _0x1a2303=path['join'](config[_0x25b0('0xe1')],'server/files/attachments/');if(_0x2de633){_0x1a2303=path[_0x25b0('0xe2')](_0x1a2303,'offline-chat/');}var _0xa3304d=path[_0x25b0('0xe2')](_0x1a2303,_0x5bce7e[_0x25b0('0xd9')]);return _0x143814[_0x25b0('0xe3')](_0xa3304d);}})['catch'](handleError(_0x143814,null));};exports['close']=function(_0x2b89e2,_0x2fefe3){var _0x45e535=null;var _0x4a2977=null;var _0x4b2667=null;if(_0x2b89e2[_0x25b0('0x2e')]['id']){delete _0x2b89e2['body']['id'];}if(_0x2b89e2[_0x25b0('0x2e')]['mailTranscript']){_0x4b2667=path[_0x25b0('0xe2')](config[_0x25b0('0xe1')],'server/files/chat/upload/',util[_0x25b0('0xe4')](_0x25b0('0xe5'),Date[_0x25b0('0xe6')]()));_0x2b89e2['body']['pathTranscript']=_0x4b2667;}return db[_0x25b0('0x44')]['find']({'where':{'id':_0x2b89e2['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x25b0('0xe7'),'include':[{'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8')}]}]})[_0x25b0('0x16')](handleEntityNotFound(_0x2fefe3,null))[_0x25b0('0x16')](saveUpdates(_0x2b89e2[_0x25b0('0x2e')],null))['then'](function(_0x56d12a){if(_0x56d12a){_0x45e535=_0x56d12a;return db[_0x25b0('0xe9')]['find']({'where':{'id':_0x45e535[_0x25b0('0x80')]}});}})[_0x25b0('0x16')](function(_0x3425e1){if(_0x3425e1){_0x4a2977=_0x3425e1;return db[_0x25b0('0xea')][_0x25b0('0x6b')]({'where':{'id':_0x45e535['ContactId']}});}})['then'](function(_0x1c3e46){if(_0x1c3e46){if(_0x4b2667){var _0x1a0041=null;for(var _0x1778d5=0x1;_0x1778d5<_0x45e535[_0x25b0('0xe7')][_0x25b0('0x4f')];++_0x1778d5){_0x1a0041=_0x45e535[_0x25b0('0xe7')][_0x1778d5];var _0x413d9f=_0x1a0041[_0x25b0('0x3f')]?util[_0x25b0('0xe4')]('%s%d',_0x4a2977[_0x25b0('0xeb')],_0x1a0041['UserId']):_0x25b0('0xec');var _0x464671=_0x2b89e2[_0x25b0('0x2e')]['customer']||util['format'](_0x25b0('0xed'),_0x25b0('0xee'),_0x1a0041['ContactId']);switch(_0x4a2977['agentIdentifier']){case _0x25b0('0xef'):_0x413d9f=_0x1a0041['UserId']?util[_0x25b0('0xe4')]('%s%d',_0x4a2977['agentAlias'],_0x1a0041[_0x25b0('0x3f')]):'System';break;case'agent_alias':_0x413d9f=_0x1a0041[_0x25b0('0x3f')]?_0x1a0041[_0x25b0('0xe8')][_0x25b0('0xf0')]||_0x1a0041[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec');break;case'agent_fullname':_0x413d9f=_0x1a0041['UserId']?_0x1a0041[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec');break;default:_0x413d9f=_0x1a0041[_0x25b0('0x3f')]?util[_0x25b0('0xe4')]('%s%d',_0x4a2977['agentAlias'],_0x1a0041[_0x25b0('0x3f')]):_0x25b0('0xec');}var _0x3421d0=util[_0x25b0('0xe4')](_0x25b0('0xf1'),moment(_0x1a0041[_0x25b0('0x83')])['format'](_0x25b0('0xf2')),_0x1a0041['direction']==='in'?_0x464671:_0x413d9f,_0x1a0041[_0x25b0('0x2e')]);if(!_0x1a0041[_0x25b0('0xf3')]){fs[_0x25b0('0xf4')](_0x4b2667,_0x3421d0);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x25b0('0xf5'),'raw':!![],'include':[{'model':db[_0x25b0('0xf6')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x25b0('0x16')](function(_0x49456a){if(!_0x49456a||!_0x49456a[_0x25b0('0xf5')]||!_0x2b89e2[_0x25b0('0x2e')])return _0x45e535;var _0x1fcb61=_0x49456a[_0x25b0('0xf7')]();return respondWithRpcPromise(_0x25b0('0xf8'),_0x25b0('0xf9'),{'account':_0x1fcb61,'message':{'from':util[_0x25b0('0xe4')]('\x22%s\x22\x20<%s>',_0x49456a[_0x25b0('0x2b')],_0x49456a[_0x25b0('0xc9')]||_0x49456a['Smtp'][_0x25b0('0x9b')]),'to':_0x2b89e2['body'][_0x25b0('0xfa')],'subject':_0x25b0('0xfb'),'text':util[_0x25b0('0xe4')](_0x25b0('0xfc'),_0x2b89e2['body']['mailTranscript']),'attachments':[{'path':_0x4b2667}]}})[_0x25b0('0x16')](function(){return _0x45e535;})[_0x25b0('0x1e')](function(_0x47f740){logger[_0x25b0('0x1a')](_0x47f740);});})['then'](respondWithStatusCode(_0x2fefe3,0xc8))[_0x25b0('0x1e')](handleError(_0x2fefe3,null));};exports[_0x25b0('0xfd')]=function(_0x1727e8,_0x42c085){return db[_0x25b0('0xd1')]['find']({'where':{'id':_0x1727e8['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x42c085,null))[_0x25b0('0x16')](function(_0x539c7d){if(_0x539c7d){return _0x539c7d[_0x25b0('0xfd')](_0x1727e8['body']['ids'],_[_0x25b0('0xfe')](_0x1727e8[_0x25b0('0x2e')],['ids','id'])||{});}})[_0x25b0('0x16')](respondWithResult(_0x42c085,null))[_0x25b0('0x1e')](handleError(_0x42c085,null));};exports[_0x25b0('0xff')]=function(_0x3a4a59,_0x5567c9){var _0x200edc={'raw':![],'where':{}};var _0x4975f4={};var _0x24f13f={'count':0x0,'rows':[]};return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x3a4a59[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x5567c9,null))[_0x25b0('0x16')](function(_0x3d5609){if(_0x3d5609){_0x4975f4[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0xd1')][_0x25b0('0xba')]);_0x4975f4[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x3a4a59[_0x25b0('0x49')]);_0x4975f4[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x4975f4[_0x25b0('0x48')],_0x4975f4[_0x25b0('0x49')]);_0x200edc[_0x25b0('0x4d')]=_['intersection'](_0x4975f4[_0x25b0('0x48')],qs['fields'](_0x3a4a59[_0x25b0('0x49')]['fields']));_0x200edc['attributes']=_0x200edc[_0x25b0('0x4d')][_0x25b0('0x4f')]?_0x200edc['attributes']:_0x4975f4[_0x25b0('0x48')];if(!_0x3a4a59['query'][_0x25b0('0x100')](_0x25b0('0x50'))){_0x200edc['limit']=qs['limit'](_0x3a4a59[_0x25b0('0x49')]['limit']);_0x200edc[_0x25b0('0x22')]=qs['offset'](_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x200edc['order']=qs[_0x25b0('0x101')](_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x101')]);_0x200edc[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x3a4a59[_0x25b0('0x49')],_0x4975f4[_0x25b0('0x4b')]));_0x200edc[_0x25b0('0x52')][_0x25b0('0x102')]=_0x3d5609['id'];if(_0x3a4a59[_0x25b0('0x49')]['filter']){_0x200edc[_0x25b0('0x52')]=_['merge'](_0x200edc[_0x25b0('0x52')],{'$or':_['map'](_0x200edc['attributes'],function(_0x3144ca){var _0x37cef6={};_0x37cef6[_0x3144ca]={'$like':'%'+_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x8d')]+'%'};return _0x37cef6;})});}if(_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x85')]){var _0x5429f8=_0x3a4a59[_0x25b0('0x49')][_0x25b0('0x85')]['split'](',');var _0x350f71={};_0x350f71[_0x5429f8[0x0]]={'$gte':moment(_0x5429f8[0x1])[_0x25b0('0xe4')](_0x25b0('0x103'))};_0x200edc['where']=_[_0x25b0('0x2d')](_0x200edc[_0x25b0('0x52')],_0x350f71);}_0x200edc=_['merge']({},_0x200edc,_0x3a4a59[_0x25b0('0xbd')]);return db['ChatMessage'][_0x25b0('0x25')]({'where':_0x200edc[_0x25b0('0x52')]})[_0x25b0('0x16')](function(_0x1011bf){_0x24f13f[_0x25b0('0x25')]=_0x1011bf;if(_0x3a4a59[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x200edc[_0x25b0('0xbc')]=[{'all':!![]}];}return db['ChatMessage'][_0x25b0('0x104')](_0x200edc);})['then'](function(_0x4281a5){_0x24f13f[_0x25b0('0xb8')]=_0x4281a5;return _0x24f13f;});}})['then'](respondWithFilteredResult(_0x5567c9,_0x200edc))['catch'](handleError(_0x5567c9,null));};exports[_0x25b0('0x105')]=function(_0x169ce2,_0x6e2707){var _0x2fd32f={'where':{}},_0x23343a={},_0x5e8e3a={'count':0x0,'rows':[]};return db[_0x25b0('0x44')][_0x25b0('0xc3')]({'where':{'id':_0x169ce2['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x6e2707,null))['then'](function(_0x1a5f25){if(_0x1a5f25){_0x23343a[_0x25b0('0x48')]=_[_0x25b0('0x4a')](db[_0x25b0('0xd1')][_0x25b0('0xba')]);_0x23343a[_0x25b0('0x49')]=_[_0x25b0('0x4a')](_0x169ce2[_0x25b0('0x49')]);_0x23343a[_0x25b0('0x4b')]=_[_0x25b0('0x4c')](_0x23343a[_0x25b0('0x48')],_0x23343a[_0x25b0('0x49')]);_0x2fd32f[_0x25b0('0x4d')]=_['intersection'](_0x23343a[_0x25b0('0x48')],qs['fields'](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x4e')]));_0x2fd32f[_0x25b0('0x4d')]=_0x2fd32f[_0x25b0('0x4d')]['length']?_0x2fd32f[_0x25b0('0x4d')]:_0x23343a[_0x25b0('0x48')];if(!_0x169ce2[_0x25b0('0x49')][_0x25b0('0x100')](_0x25b0('0x50'))){_0x2fd32f['limit']=qs[_0x25b0('0x24')](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x24')]);_0x2fd32f['offset']=qs[_0x25b0('0x22')](_0x169ce2[_0x25b0('0x49')][_0x25b0('0x22')]);}_0x2fd32f['order']=qs[_0x25b0('0x101')](_0x169ce2['query'][_0x25b0('0x101')]);_0x2fd32f[_0x25b0('0x52')]=qs[_0x25b0('0x4b')](_[_0x25b0('0x53')](_0x169ce2[_0x25b0('0x49')],_0x23343a[_0x25b0('0x4b')]));_0x2fd32f[_0x25b0('0x52')]['ChatInteractionId']=_0x1a5f25['id'];if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0x8d')]){_0x2fd32f[_0x25b0('0x52')]=_[_0x25b0('0x2d')](_0x2fd32f['where'],{'$or':_[_0x25b0('0x34')](_0x2fd32f[_0x25b0('0x4d')],function(_0x14252c){var _0x578a4c={};_0x578a4c[_0x14252c]={'$like':'%'+_0x169ce2[_0x25b0('0x49')][_0x25b0('0x8d')]+'%'};return _0x578a4c;})});}_0x2fd32f[_0x25b0('0x52')]['secret']=![];if(_0x169ce2[_0x25b0('0x49')]['id']){_0x2fd32f['where']['id']={'$gt':_0x169ce2[_0x25b0('0x49')]['id']};}_0x2fd32f=_[_0x25b0('0x2d')]({},_0x2fd32f,_0x169ce2['options']);return db[_0x25b0('0xd1')][_0x25b0('0x25')]({'where':_0x2fd32f[_0x25b0('0x52')]})[_0x25b0('0x16')](function(_0x2af676){_0x5e8e3a[_0x25b0('0x25')]=_0x2af676;_0x2fd32f[_0x25b0('0xbc')]=[];if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0x106')]){_0x2fd32f[_0x25b0('0xbc')][_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8'),'attributes':['id',_0x25b0('0x35'),_0x25b0('0xf0')]});}if(_0x169ce2[_0x25b0('0x49')][_0x25b0('0xbb')]){_0x2fd32f[_0x25b0('0xbc')]=[{'all':!![]}];}return db['ChatMessage'][_0x25b0('0x104')](_0x2fd32f);})[_0x25b0('0x16')](function(_0x450cdb){_0x5e8e3a[_0x25b0('0xb8')]=_0x450cdb;return _0x5e8e3a;});}})[_0x25b0('0x16')](respondWithFilteredResult(_0x6e2707,_0x2fd32f))[_0x25b0('0x1e')](handleError(_0x6e2707,null));};exports[_0x25b0('0x107')]=function(_0x43a5fc,_0x23e93c){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x43a5fc[_0x25b0('0xbf')]['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x23e93c,null))[_0x25b0('0x16')](function(_0x5a96da){if(_0x5a96da){return _0x5a96da[_0x25b0('0x108')](_0x43a5fc[_0x25b0('0x2e')][_0x25b0('0x109')],_[_0x25b0('0xfe')](_0x43a5fc[_0x25b0('0x2e')],['ids','id'])||{})[_0x25b0('0x10a')](function(){return db['Tag']['findAll']({'attributes':['id',_0x25b0('0x2b'),'color'],'where':{'id':_0x43a5fc[_0x25b0('0x2e')]['ids']}});})[_0x25b0('0x16')](function(_0x4953c5){socket[_0x25b0('0x10b')](_0x25b0('0x10c'),{'id':Number(_0x43a5fc[_0x25b0('0xbf')]['id']),'tags':_0x4953c5||[]});return{'id':Number(_0x43a5fc[_0x25b0('0xbf')]['id']),'tags':_0x4953c5||[]};});}})[_0x25b0('0x16')](respondWithResult(_0x23e93c,null))[_0x25b0('0x1e')](handleError(_0x23e93c,null));};exports['removeTags']=function(_0x4c3b11,_0x3429be){return db[_0x25b0('0x44')]['find']({'where':{'id':_0x4c3b11['params']['id']}})[_0x25b0('0x16')](handleEntityNotFound(_0x3429be,null))[_0x25b0('0x16')](function(_0x3b81ec){if(_0x3b81ec){return _0x3b81ec[_0x25b0('0x10d')](_0x4c3b11['query'][_0x25b0('0x109')]);}})[_0x25b0('0x16')](respondWithStatusCode(_0x3429be,null))[_0x25b0('0x1e')](handleError(_0x3429be,null));};exports['download']=function(_0x1748a6,_0x7c474f){var _0xaf5ba4=moment()[_0x25b0('0x10e')]()['toString']();var _0x5ab8b3=path[_0x25b0('0xe2')](config[_0x25b0('0xe1')],'server','files',_0x25b0('0x10f'));var _0x4e40af=path['join'](config[_0x25b0('0xe1')],_0x25b0('0x110'),'files',_0x25b0('0x111'));var _0xa8f0f0=path[_0x25b0('0xe2')](_0x5ab8b3,_0xaf5ba4);var _0xd1a53b=util[_0x25b0('0xe4')](_0x25b0('0x112'),_0x1748a6[_0x25b0('0xbf')]['id'],_0xaf5ba4);var _0x48fb2e=path['join'](_0x5ab8b3,_0xd1a53b);var _0x37990b=[];_0x37990b[_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0xe8'),'attributes':['id',_0x25b0('0x35')],'raw':!![]});_0x37990b[_0x25b0('0x39')]({'model':db['CmContact'],'as':_0x25b0('0x6f'),'attributes':['id',_0x25b0('0x113'),_0x25b0('0x114')],'raw':!![]});if(_0x1748a6[_0x25b0('0x49')][_0x25b0('0x111')]){_0x37990b[_0x25b0('0x39')]({'model':db[_0x25b0('0xdc')],'as':_0x25b0('0xdc'),'raw':!![]});}var _0x29056f=[{'model':db[_0x25b0('0xd1')],'as':'Messages','attributes':['id',_0x25b0('0x2e'),'createdAt',_0x25b0('0x115'),_0x25b0('0xf3'),_0x25b0('0x8a')],'include':_0x37990b}];_0x29056f[_0x25b0('0x39')]({'model':db[_0x25b0('0xe9')],'as':_0x25b0('0x116'),'attributes':['id',_0x25b0('0x2b')]});_0x29056f[_0x25b0('0x39')]({'model':db[_0x25b0('0xe8')],'as':_0x25b0('0x117'),'attributes':['id',_0x25b0('0x35')]});return db['ChatInteraction']['find']({'where':{'id':_0x1748a6[_0x25b0('0xbf')]['id']},'include':_0x29056f})[_0x25b0('0x16')](handleEntityNotFound(_0x7c474f,null))['then'](function(_0x2943a9){if(_0x2943a9){var _0xa6bfaa=_0x2943a9[_0x25b0('0x118')]({'plain':!![]});fs[_0x25b0('0x119')](_0xa8f0f0);var _0x511ee9={'channel':_0x25b0('0x11a'),'account':_0xa6bfaa[_0x25b0('0x116')][_0x25b0('0x2b')],'agent':_0xa6bfaa['Owner']?_0xa6bfaa[_0x25b0('0x117')][_0x25b0('0x35')]:_0x25b0('0x11b'),'createdAt':moment(_0xa6bfaa[_0x25b0('0x83')])[_0x25b0('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x25b0('0x9f')](),'closedAt':_0xa6bfaa['closed']?moment(_0xa6bfaa['closedAt'])[_0x25b0('0xe4')](_0x25b0('0x103'))[_0x25b0('0x9f')]():'','disposition':_0xa6bfaa[_0x25b0('0x42')],'chatInfo':{'browser':_0xa6bfaa[_0x25b0('0x11c')],'os':_0xa6bfaa['osName'],'referer':_0xa6bfaa[_0x25b0('0x11d')],'customerIp':_0xa6bfaa[_0x25b0('0x11e')],'customerPort':_0xa6bfaa[_0x25b0('0x11f')]?_0xa6bfaa[_0x25b0('0x11f')]:_0x25b0('0x11b')},'messages':_(_0xa6bfaa[_0x25b0('0xe7')])[_0x25b0('0x120')]()['filter']({'secret':![]})[_0x25b0('0x34')](function(_0x23edf3){if(_0x23edf3['Attachment']){var _0x67d139=path[_0x25b0('0xe2')](_0x4e40af,_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')]);if(fs[_0x25b0('0x121')](_0x67d139)){fs['createReadStream'](_0x67d139)['pipe'](fs[_0x25b0('0x122')](path[_0x25b0('0xe2')](_0xa8f0f0,_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')])));}}return{'date':moment(_0x23edf3['createdAt'])['format'](_0x25b0('0x103'))[_0x25b0('0x9f')](),'sender':_0x23edf3[_0x25b0('0x115')]===_0x25b0('0x123')?_0x23edf3['User']?_0x23edf3[_0x25b0('0xe8')][_0x25b0('0x35')]:_0x25b0('0xec'):_0x23edf3[_0x25b0('0x6f')]['firstName']+(_0x23edf3[_0x25b0('0x6f')][_0x25b0('0x114')]?'\x20'+_0x23edf3[_0x25b0('0x6f')][_0x25b0('0x114')]:''),'body':_0x23edf3[_0x25b0('0xdc')]?_0x23edf3[_0x25b0('0xdc')][_0x25b0('0xd9')]:_0x23edf3['body'],'direction':_0x23edf3[_0x25b0('0x115')]===_0x25b0('0x123')?'A':'C','secret':_0x23edf3['secret'],'read':_0x23edf3['read'],'attachment':_0x23edf3['Attachment']};})[_0x25b0('0x71')]()};return ejs[_0x25b0('0x124')](path[_0x25b0('0xe2')](config['root'],_0x25b0('0x110'),'views','downloadInteraction.ejs'),{'interaction':_0x511ee9})['then'](function(_0xaee691){var _0x2848df=path[_0x25b0('0xe2')](_0xa8f0f0,_0x25b0('0x125')+_0xa6bfaa['id']+'-'+_0xaf5ba4+_0x25b0('0x126'));var _0x90f7cd={'path':_0x2848df,'channel':_0x25b0('0x11a'),'interactionId':_0xa6bfaa['id']};return pdf[_0x25b0('0x127')](_0xaee691,_0x90f7cd);})['then'](function(){return new Promise(function(_0x2bf536,_0xa177ce){zipdir(_0xa8f0f0,{'saveTo':_0x48fb2e},function(_0x69cfe4,_0x435e3e){if(_0x69cfe4)return _0xa177ce(_0x69cfe4);return _0x2bf536(_0x435e3e);});})[_0x25b0('0x16')](function(){return new BPromise(function(_0x3c3409,_0x133c12){rimraf(_0xa8f0f0,function(_0x4c2e1b){if(_0x4c2e1b)_0x133c12(_0x4c2e1b);return _0x3c3409();});});})[_0x25b0('0x16')](function(){return _0x7c474f[_0x25b0('0xe3')](_0x48fb2e,_0xd1a53b,function(_0x22339b){if(_0x22339b){logger[_0x25b0('0x1a')](_0x25b0('0x128'),_0x22339b);}else{fs[_0x25b0('0x129')](_0x48fb2e);}});});});}else{return _0x7c474f[_0x25b0('0x29')](0xc8);}})[_0x25b0('0x1e')](handleError(_0x7c474f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 7a9daac..a063362 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 _0xb35b=['save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x4e10c9,_0x327a63){var _0x587f22=function(_0x16b50a){while(--_0x16b50a){_0x4e10c9['push'](_0x4e10c9['shift']());}};_0x587f22(++_0x327a63);}(_0xb35b,0x164));var _0xbb35=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xb35b[_0x21aec3];return _0x288bbc;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbb35('0x0'))['db'][_0xbb35('0x1')];var ChatMessage=require(_0xbb35('0x0'))['db'][_0xbb35('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbb35('0x3')](0x0);var events={'afterCreate':_0xbb35('0x4'),'afterUpdate':_0xbb35('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12ed26){return function(_0xb3e402,_0x3bb2c7,_0x158201){_0xb3e402[_0xbb35('0x6')]({'attributes':['id'],'raw':!![]})[_0xbb35('0x7')](function(_0x5b304b){_0xb3e402[_0xbb35('0x8')]('Users',_0x5b304b[_0xbb35('0x9')](function(_0x383f12){return{'id':_0x383f12['id']};}));return ChatMessage[_0xbb35('0xa')]({'where':{'ChatInteractionId':_0xb3e402['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb35('0x7')](function(_0x4f1bdd){_0xb3e402[_0xbb35('0x8')](_0xbb35('0xb'),_0x4f1bdd[_0xbb35('0xc')]);ChatInteractionEvents[_0xbb35('0xd')](_0x12ed26+':'+_0xb3e402['id'],_0xb3e402);ChatInteractionEvents['emit'](_0x12ed26,_0xb3e402);_0x158201(null);})[_0xbb35('0xe')](_0x158201(null));};}for(var e in events){if(events[_0xbb35('0xf')](e)){var event=events[e];ChatInteraction[_0xbb35('0x10')](e,emitEvent(event));}}module[_0xbb35('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x9102=['map','findAll','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x3cd216,_0x55d550){var _0x182cfb=function(_0x371368){while(--_0x371368){_0x3cd216['push'](_0x3cd216['shift']());}};_0x182cfb(++_0x55d550);}(_0x9102,0x1a6));var _0x2910=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x9102[_0x37a79c];return _0x561d89;};'use strict';var EventEmitter=require(_0x2910('0x0'));var ChatInteraction=require(_0x2910('0x1'))['db'][_0x2910('0x2')];var ChatMessage=require(_0x2910('0x1'))['db'][_0x2910('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2910('0x4')](0x0);var events={'afterCreate':_0x2910('0x5'),'afterUpdate':'update','afterDestroy':_0x2910('0x6')};function emitEvent(_0x331c43){return function(_0x2cba50,_0x4f35e5,_0x97fbbc){_0x2cba50[_0x2910('0x7')]({'attributes':['id'],'raw':!![]})[_0x2910('0x8')](function(_0x229cb3){_0x2cba50[_0x2910('0x9')]('Users',_0x229cb3[_0x2910('0xa')](function(_0x4b0891){return{'id':_0x4b0891['id']};}));return ChatMessage[_0x2910('0xb')]({'where':{'ChatInteractionId':_0x2cba50['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2910('0x8')](function(_0x35ee5f){_0x2cba50[_0x2910('0x9')](_0x2910('0xc'),_0x35ee5f[_0x2910('0xd')]);ChatInteractionEvents['emit'](_0x331c43+':'+_0x2cba50['id'],_0x2cba50);ChatInteractionEvents['emit'](_0x331c43,_0x2cba50);_0x97fbbc(null);})[_0x2910('0xe')](_0x97fbbc(null));};}for(var e in events){if(events[_0x2910('0xf')](e)){var event=events[e];ChatInteraction[_0x2910('0x10')](e,emitEvent(event));}}module[_0x2910('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 73fc836..8843ec8 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 _0x2b2c=['changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x2cfc8e,_0x46fc38){var _0x25cd3a=function(_0x159022){while(--_0x159022){_0x2cfc8e['push'](_0x2cfc8e['shift']());}};_0x25cd3a(++_0x46fc38);}(_0x2b2c,0x95));var _0xc2b2=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2b2c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc2b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc2b2('0x1'));var moment=require('moment');var BPromise=require(_0xc2b2('0x2'));var rp=require(_0xc2b2('0x3'));var fs=require('fs');var path=require(_0xc2b2('0x4'));var rimraf=require('rimraf');var config=require(_0xc2b2('0x5'));var attributes=require(_0xc2b2('0x6'));module[_0xc2b2('0x7')]=function(_0x18bd55,_0x3bd1ac){return _0x18bd55[_0xc2b2('0x8')](_0xc2b2('0x9'),attributes,{'tableName':_0xc2b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20ad08,_0x31205e,_0x38bcde){if(_0x20ad08[_0xc2b2('0xb')](_0xc2b2('0xc'))){_0x20ad08['closedAt']=moment()['format'](_0xc2b2('0xd'));}_0x38bcde(null,_0x20ad08);}},'charset':_0xc2b2('0xe'),'collate':_0xc2b2('0xf')});}; \ No newline at end of file +var _0x1522=['rimraf','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x22b4df,_0x2971f3){var _0xb778a6=function(_0x355607){while(--_0x355607){_0x22b4df['push'](_0x22b4df['shift']());}};_0xb778a6(++_0x2971f3);}(_0x1522,0x16f));var _0x2152=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1522[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2152('0x0'));var util=require(_0x2152('0x1'));var logger=require(_0x2152('0x2'))(_0x2152('0x3'));var moment=require('moment');var BPromise=require(_0x2152('0x4'));var rp=require(_0x2152('0x5'));var fs=require('fs');var path=require(_0x2152('0x6'));var rimraf=require(_0x2152('0x7'));var config=require(_0x2152('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x2152('0x9')]=function(_0x2a47b1,_0x6fd713){return _0x2a47b1['define'](_0x2152('0xa'),attributes,{'tableName':_0x2152('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcb0c3d,_0x30a614,_0x2ff6ab){if(_0xcb0c3d[_0x2152('0xc')](_0x2152('0xd'))){_0xcb0c3d[_0x2152('0xe')]=moment()[_0x2152('0xf')](_0x2152('0x10'));}_0x2ff6ab(null,_0xcb0c3d);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index d99cd69..b16b372 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 _0xb18e=['randomstring','ioredis','../../mysqldb','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','debug','AddTagsToChatInteraction','find','omit','ids','spread','AddTags','lodash','util','bluebird'];(function(_0x3f7d53,_0x334a69){var _0x280969=function(_0xdb9d43){while(--_0xdb9d43){_0x3f7d53['push'](_0x3f7d53['shift']());}};_0x280969(++_0x334a69);}(_0xb18e,0xe1));var _0xeb18=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0xb18e[_0x1044e5];return _0x5ad0dd;};'use strict';var _=require(_0xeb18('0x0'));var util=require(_0xeb18('0x1'));var moment=require('moment');var BPromise=require(_0xeb18('0x2'));var rs=require(_0xeb18('0x3'));var fs=require('fs');var Redis=require(_0xeb18('0x4'));var db=require(_0xeb18('0x5'))['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[_0xeb18('0x6')]['http']({'port':0x232a});config[_0xeb18('0x7')]=_[_0xeb18('0x8')](config[_0xeb18('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb18('0x9'))(new Redis(config['redis']));require(_0xeb18('0xa'))[_0xeb18('0xb')](socket);function respondWithRpcPromise(_0x1e9955,_0x47dfa7,_0x58d6ec){return new BPromise(function(_0x22c9ad,_0x16eca5){return client[_0xeb18('0xc')](_0x1e9955,_0x58d6ec)['then'](function(_0x22a928){logger[_0xeb18('0xd')](_0xeb18('0xe'),_0x47dfa7,_0xeb18('0xf'));logger['debug'](_0xeb18('0x10'),_0x47dfa7,_0xeb18('0xf'),JSON[_0xeb18('0x11')](_0x22a928));if(_0x22a928[_0xeb18('0x12')]){if(_0x22a928[_0xeb18('0x12')]['code']===0x1f4){logger['error'](_0xeb18('0xe'),_0x47dfa7,_0x22a928[_0xeb18('0x12')]['message']);return _0x16eca5(_0x22a928['error'][_0xeb18('0x13')]);}logger['error'](_0xeb18('0xe'),_0x47dfa7,_0x22a928['error']['message']);return _0x22c9ad(_0x22a928['error'][_0xeb18('0x13')]);}else{logger[_0xeb18('0xd')](_0xeb18('0xe'),_0x47dfa7,_0xeb18('0xf'));_0x22c9ad(_0x22a928[_0xeb18('0x14')][_0xeb18('0x13')]);}})[_0xeb18('0x15')](function(_0x4bfd61){logger[_0xeb18('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x47dfa7,_0x4bfd61);_0x16eca5(_0x4bfd61);});});}exports[_0xeb18('0x16')]=function(_0x4e161b){var _0x26f60a=this;return new Promise(function(_0x24a166,_0x4b2e2c){return db[_0xeb18('0x17')][_0xeb18('0x18')](_0x4e161b[_0xeb18('0x19')],{'raw':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1c')]||null:null,'attributes':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b[_0xeb18('0x1a')][_0xeb18('0x1d')]||null:null,'limit':_0x4e161b[_0xeb18('0x1a')]?_0x4e161b['options']['limit']||null:null})[_0xeb18('0x1e')](function(_0x146a97){logger['info'](_0xeb18('0x16'),_0x4e161b);logger[_0xeb18('0x1f')](_0xeb18('0x16'),_0x4e161b,JSON[_0xeb18('0x11')](_0x146a97));_0x24a166(_0x146a97);})[_0xeb18('0x15')](function(_0x4b6ed3){logger[_0xeb18('0x12')]('UpdateChatInteraction',_0x4b6ed3[_0xeb18('0x13')],_0x4e161b);_0x4b2e2c(_0x26f60a[_0xeb18('0x12')](0x1f4,_0x4b6ed3[_0xeb18('0x13')]));});});};exports[_0xeb18('0x20')]=function(_0x567caa){return new Promise(function(_0x40ef23,_0x415560){return db['ChatInteraction'][_0xeb18('0x21')]({'where':_0x567caa[_0xeb18('0x1a')]?_0x567caa[_0xeb18('0x1a')][_0xeb18('0x1c')]||null:null})[_0xeb18('0x1e')](function(_0x3920d5){if(_0x3920d5){return _0x3920d5['addTags'](_0x567caa[_0xeb18('0x19')]['ids'],_[_0xeb18('0x22')](_0x567caa[_0xeb18('0x19')],[_0xeb18('0x23'),'id'])||{});}})[_0xeb18('0x24')](function(_0x4a78fe){logger[_0xeb18('0xd')](_0xeb18('0x25'),_0x567caa);logger['debug'](_0xeb18('0x25'),_0x567caa,JSON[_0xeb18('0x11')](_0x4a78fe));_0x40ef23(_0x4a78fe);})['catch'](function(_0x54e267){logger[_0xeb18('0x12')](_0xeb18('0x25'),_0x54e267[_0xeb18('0x13')],_0x567caa);_0x415560(_this[_0xeb18('0x12')](0x1f4,_0x54e267[_0xeb18('0x13')]));});});}; \ No newline at end of file +var _0x0598=['register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x246b3e,_0x5f458e){var _0x10fb9b=function(_0x436942){while(--_0x436942){_0x246b3e['push'](_0x246b3e['shift']());}};_0x10fb9b(++_0x5f458e);}(_0x0598,0x1a8));var _0x8059=function(_0x2a9b99,_0x4daa75){_0x2a9b99=_0x2a9b99-0x0;var _0x223f0d=_0x0598[_0x2a9b99];return _0x223f0d;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require(_0x8059('0x2'));var BPromise=require(_0x8059('0x3'));var rs=require(_0x8059('0x4'));var fs=require('fs');var Redis=require(_0x8059('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8059('0x6'));var logger=require('../../config/logger')(_0x8059('0x7'));var config=require(_0x8059('0x8'));var jayson=require(_0x8059('0x9'));var client=jayson['client'][_0x8059('0xa')]({'port':0x232a});config[_0x8059('0xb')]=_[_0x8059('0xc')](config[_0x8059('0xb')],{'host':_0x8059('0xd'),'port':0x18eb});var socket=require(_0x8059('0xe'))(new Redis(config['redis']));require(_0x8059('0xf'))[_0x8059('0x10')](socket);function respondWithRpcPromise(_0x233797,_0x219ca0,_0x27e3f4){return new BPromise(function(_0x5aa846,_0x1bec6a){return client['request'](_0x233797,_0x27e3f4)['then'](function(_0x180c87){logger[_0x8059('0x11')](_0x8059('0x12'),_0x219ca0,_0x8059('0x13'));logger[_0x8059('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x219ca0,_0x8059('0x13'),JSON[_0x8059('0x15')](_0x180c87));if(_0x180c87[_0x8059('0x16')]){if(_0x180c87[_0x8059('0x16')][_0x8059('0x17')]===0x1f4){logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x180c87[_0x8059('0x16')][_0x8059('0x18')]);return _0x1bec6a(_0x180c87[_0x8059('0x16')][_0x8059('0x18')]);}logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x180c87[_0x8059('0x16')]['message']);return _0x5aa846(_0x180c87['error'][_0x8059('0x18')]);}else{logger[_0x8059('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x219ca0,_0x8059('0x13'));_0x5aa846(_0x180c87['result'][_0x8059('0x18')]);}})[_0x8059('0x19')](function(_0x174a1f){logger[_0x8059('0x16')](_0x8059('0x12'),_0x219ca0,_0x174a1f);_0x1bec6a(_0x174a1f);});});}exports[_0x8059('0x1a')]=function(_0x1a56ed){var _0x430da7=this;return new Promise(function(_0x4bac1c,_0x536fd8){return db[_0x8059('0x1b')][_0x8059('0x1c')](_0x1a56ed[_0x8059('0x1d')],{'raw':_0x1a56ed[_0x8059('0x1e')]?_0x1a56ed[_0x8059('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a56ed['options']?_0x1a56ed['options'][_0x8059('0x1f')]||null:null,'attributes':_0x1a56ed[_0x8059('0x1e')]?_0x1a56ed[_0x8059('0x1e')][_0x8059('0x20')]||null:null,'limit':_0x1a56ed['options']?_0x1a56ed['options'][_0x8059('0x21')]||null:null})[_0x8059('0x22')](function(_0x239998){logger[_0x8059('0x11')](_0x8059('0x1a'),_0x1a56ed);logger[_0x8059('0x14')](_0x8059('0x1a'),_0x1a56ed,JSON['stringify'](_0x239998));_0x4bac1c(_0x239998);})[_0x8059('0x19')](function(_0x4fc4af){logger[_0x8059('0x16')](_0x8059('0x1a'),_0x4fc4af['message'],_0x1a56ed);_0x536fd8(_0x430da7[_0x8059('0x16')](0x1f4,_0x4fc4af[_0x8059('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x123fce){return new Promise(function(_0x699ee7,_0x30dedc){return db[_0x8059('0x1b')][_0x8059('0x23')]({'where':_0x123fce[_0x8059('0x1e')]?_0x123fce[_0x8059('0x1e')][_0x8059('0x1f')]||null:null})[_0x8059('0x22')](function(_0x4497e6){if(_0x4497e6){return _0x4497e6[_0x8059('0x24')](_0x123fce[_0x8059('0x1d')][_0x8059('0x25')],_['omit'](_0x123fce[_0x8059('0x1d')],[_0x8059('0x25'),'id'])||{});}})[_0x8059('0x26')](function(_0x14a09d){logger['info'](_0x8059('0x27'),_0x123fce);logger['debug'](_0x8059('0x27'),_0x123fce,JSON[_0x8059('0x15')](_0x14a09d));_0x699ee7(_0x14a09d);})[_0x8059('0x19')](function(_0xfad949){logger['error'](_0x8059('0x27'),_0xfad949[_0x8059('0x18')],_0x123fce);_0x30dedc(_this['error'](0x1f4,_0xfad949[_0x8059('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f260b97..4bbb1ec 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 _0x5577=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x422bb1,_0x41eb73){var _0xfe5f30=function(_0x1314ca){while(--_0x1314ca){_0x422bb1['push'](_0x422bb1['shift']());}};_0xfe5f30(++_0x41eb73);}(_0x5577,0x120));var _0x7557=function(_0x4e944b,_0x3e910f){_0x4e944b=_0x4e944b-0x0;var _0x4eec32=_0x5577[_0x4e944b];return _0x4eec32;};'use strict';var ChatInteractionEvents=require(_0x7557('0x0'));var events=[_0x7557('0x1'),_0x7557('0x2'),_0x7557('0x3')];function createListener(_0x4dea0f,_0x33eb23){return function(_0x38def7){_0x33eb23[_0x7557('0x4')](_0x4dea0f,_0x38def7);};}function removeListener(_0x498861,_0x26a15e){return function(){ChatInteractionEvents[_0x7557('0x5')](_0x498861,_0x26a15e);};}exports['register']=function(_0x30e97c){for(var _0x2f64f0=0x0,_0x47b1ee=events['length'];_0x2f64f0<_0x47b1ee;_0x2f64f0++){var _0x41fd3e=events[_0x2f64f0];var _0x428205=createListener(_0x7557('0x6')+_0x41fd3e,_0x30e97c);ChatInteractionEvents['on'](_0x41fd3e,_0x428205);}}; \ No newline at end of file +var _0x9eca=['./chatInteraction.events','remove','update','register','length'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9eca,0xd2));var _0xa9ec=function(_0x259fca,_0x53360c){_0x259fca=_0x259fca-0x0;var _0x387fc5=_0x9eca[_0x259fca];return _0x387fc5;};'use strict';var ChatInteractionEvents=require(_0xa9ec('0x0'));var events=['save',_0xa9ec('0x1'),_0xa9ec('0x2')];function createListener(_0x311a3d,_0x29f64a){return function(_0x440ed3){_0x29f64a['emit'](_0x311a3d,_0x440ed3);};}function removeListener(_0x331d90,_0x49e2ae){return function(){ChatInteractionEvents['removeListener'](_0x331d90,_0x49e2ae);};}exports[_0xa9ec('0x3')]=function(_0x4f4638){for(var _0x50bea8=0x0,_0xfc1912=events[_0xa9ec('0x4')];_0x50bea8<_0xfc1912;_0x50bea8++){var _0x5da681=events[_0x50bea8];var _0x1345b9=createListener('chatInteraction:'+_0x5da681,_0x4f4638);ChatInteractionEvents['on'](_0x5da681,_0x1345b9);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 92bd4d1..6a022ce 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 _0xf45d=['addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','diskStorage','root','format','%s-%s','replace','/:id/attachment_upload','file','attachmentUpload'];(function(_0x326086,_0x5bac35){var _0x468e45=function(_0x1de2f0){while(--_0x1de2f0){_0x326086['push'](_0x326086['shift']());}};_0x468e45(++_0x5bac35);}(_0xf45d,0x1cc));var _0xdf45=function(_0x4c1e4c,_0x5048b0){_0x4c1e4c=_0x4c1e4c-0x0;var _0xef475f=_0xf45d[_0x4c1e4c];return _0xef475f;};'use strict';var multer=require(_0xdf45('0x0'));var util=require(_0xdf45('0x1'));var path=require(_0xdf45('0x2'));var timeout=require(_0xdf45('0x3'));var express=require(_0xdf45('0x4'));var router=express[_0xdf45('0x5')]();var fs_extra=require(_0xdf45('0x6'));var auth=require(_0xdf45('0x7'));var interaction=require(_0xdf45('0x8'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xdf45('0x9')]('/',auth[_0xdf45('0xa')](),controller['index']);router['get'](_0xdf45('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xdf45('0x9')]('/:id',auth[_0xdf45('0xc')](),controller['show']);router['get'](_0xdf45('0xd'),auth[_0xdf45('0xc')](),controller[_0xdf45('0xe')]);router[_0xdf45('0x9')](_0xdf45('0xf'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x10')]);router['get'](_0xdf45('0x11'),auth[_0xdf45('0xc')](),controller['getMyMessages']);router[_0xdf45('0x9')](_0xdf45('0x12'),auth[_0xdf45('0xa')](),controller[_0xdf45('0x13')]);router[_0xdf45('0x14')]('/',auth[_0xdf45('0xa')](),controller['create']);router['post'](_0xdf45('0x15'),auth[_0xdf45('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xdf45('0x16')]({'destination':function(_0x3c0e59,_0x2b641a,_0x398abd){_0x398abd(null,path['join'](config[_0xdf45('0x17')],'server/files/attachments/'));},'filename':function(_0x86a165,_0x447694,_0xf2ebc5){_0xf2ebc5(null,util[_0xdf45('0x18')](_0xdf45('0x19'),Date['now'](),_0x447694['originalname'][_0xdf45('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdf45('0x14')](_0xdf45('0x1b'),upload['single'](_0xdf45('0x1c')),controller[_0xdf45('0x1d')]);router[_0xdf45('0x14')]('/:id/messages',auth[_0xdf45('0xc')](),controller[_0xdf45('0x1e')]);router[_0xdf45('0x14')](_0xdf45('0x1f'),auth[_0xdf45('0xa')](),interaction[_0xdf45('0x20')](_0xdf45('0x21'),_0xdf45('0x22')),controller[_0xdf45('0x23')]);router[_0xdf45('0x24')](_0xdf45('0x25'),auth['isAuthenticated'](),interaction[_0xdf45('0x20')]('chat',_0xdf45('0x26')),controller[_0xdf45('0x27')]);router['put']('/:id/custom_update',controller[_0xdf45('0x28')]);router[_0xdf45('0x24')](_0xdf45('0x29'),auth[_0xdf45('0xc')](),controller[_0xdf45('0x2a')]);router[_0xdf45('0x24')]('/:id/close',controller[_0xdf45('0x2b')]);router['delete'](_0xdf45('0x25'),auth[_0xdf45('0xa')](),interaction[_0xdf45('0x20')]('chat',_0xdf45('0x2c')),controller[_0xdf45('0x2d')]);router[_0xdf45('0x2e')](_0xdf45('0x1f'),auth['isAuthenticated'](),controller[_0xdf45('0x2f')]);module[_0xdf45('0x30')]=router; \ No newline at end of file +var _0x106a=['originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x106a,0x1b5));var _0xa106=function(_0x5daeb2,_0x4b007c){_0x5daeb2=_0x5daeb2-0x0;var _0x2dbb9f=_0x106a[_0x5daeb2];return _0x2dbb9f;};'use strict';var multer=require(_0xa106('0x0'));var util=require(_0xa106('0x1'));var path=require(_0xa106('0x2'));var timeout=require('connect-timeout');var express=require(_0xa106('0x3'));var router=express[_0xa106('0x4')]();var fs_extra=require(_0xa106('0x5'));var auth=require(_0xa106('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa106('0x7'));var controller=require('./chatInteraction.controller');router[_0xa106('0x8')]('/',auth[_0xa106('0x9')](),controller['index']);router[_0xa106('0x8')]('/describe',auth[_0xa106('0x9')](),controller[_0xa106('0xa')]);router[_0xa106('0x8')](_0xa106('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa106('0xc')]);router[_0xa106('0x8')](_0xa106('0xd'),auth[_0xa106('0xe')](),controller['attachmentDownload']);router[_0xa106('0x8')](_0xa106('0xf'),auth[_0xa106('0x9')](),controller[_0xa106('0x10')]);router[_0xa106('0x8')](_0xa106('0x11'),auth[_0xa106('0xe')](),controller[_0xa106('0x12')]);router[_0xa106('0x8')](_0xa106('0x13'),auth[_0xa106('0x9')](),controller[_0xa106('0x14')]);router[_0xa106('0x15')]('/',auth[_0xa106('0x9')](),controller[_0xa106('0x16')]);router[_0xa106('0x15')](_0xa106('0x17'),auth[_0xa106('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa106('0x18')]({'destination':function(_0x37c45f,_0x58512a,_0xeee3aa){_0xeee3aa(null,path[_0xa106('0x19')](config[_0xa106('0x1a')],_0xa106('0x1b')));},'filename':function(_0x247808,_0x34ea15,_0x558daf){_0x558daf(null,util[_0xa106('0x1c')](_0xa106('0x1d'),Date[_0xa106('0x1e')](),_0x34ea15[_0xa106('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa106('0x15')](_0xa106('0x20'),upload[_0xa106('0x21')](_0xa106('0x22')),controller[_0xa106('0x23')]);router[_0xa106('0x15')](_0xa106('0xf'),auth[_0xa106('0xe')](),controller[_0xa106('0x24')]);router[_0xa106('0x15')](_0xa106('0x25'),auth[_0xa106('0x9')](),interaction[_0xa106('0x26')](_0xa106('0x27'),_0xa106('0x28')),controller[_0xa106('0x29')]);router[_0xa106('0x2a')](_0xa106('0xb'),auth[_0xa106('0x9')](),interaction[_0xa106('0x26')](_0xa106('0x27'),'chatinteraction:update'),controller[_0xa106('0x2b')]);router[_0xa106('0x2a')](_0xa106('0x2c'),controller[_0xa106('0x2d')]);router[_0xa106('0x2a')]('/:id/abandon',auth[_0xa106('0xe')](),controller[_0xa106('0x2e')]);router[_0xa106('0x2a')](_0xa106('0x2f'),controller[_0xa106('0x30')]);router[_0xa106('0x31')](_0xa106('0xb'),auth[_0xa106('0x9')](),interaction['tracked'](_0xa106('0x27'),_0xa106('0x32')),controller[_0xa106('0x33')]);router[_0xa106('0x31')](_0xa106('0x25'),auth[_0xa106('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 64cb197..ba5d27a 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 _0xfb98=['sequelize','exports','TEXT','medium'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xfb98,0x94));var _0x8fb9=function(_0x5bbb65,_0x33159b){_0x5bbb65=_0x5bbb65-0x0;var _0x56c547=_0xfb98[_0x5bbb65];return _0x56c547;};'use strict';var Sequelize=require(_0x8fb9('0x0'));module[_0x8fb9('0x1')]={'body':{'type':Sequelize[_0x8fb9('0x2')](_0x8fb9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe699=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x52e43f,_0x20c65c){var _0x4d7c4d=function(_0x287927){while(--_0x287927){_0x52e43f['push'](_0x52e43f['shift']());}};_0x4d7c4d(++_0x20c65c);}(_0xe699,0x153));var _0x9e69=function(_0x561534,_0x82908a){_0x561534=_0x561534-0x0;var _0x500ba1=_0xe699[_0x561534];return _0x500ba1;};'use strict';var Sequelize=require(_0x9e69('0x0'));module['exports']={'body':{'type':Sequelize[_0x9e69('0x1')](_0x9e69('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9e69('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9e69('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 8f25524..ffed1ac 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 _0x88e2=['catch','show','intersection','options','create','body','find','params','describe','get','lastMessageAt','lastMessage','format','getUsers','User','agent','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','createdAt','FromId','ToId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x246769,_0x49cd30){var _0x560e5d=function(_0x3b5331){while(--_0x3b5331){_0x246769['push'](_0x246769['shift']());}};_0x560e5d(++_0x49cd30);}(_0x88e2,0x9c));var _0x288e=function(_0x3a8663,_0x5c4df1){_0x3a8663=_0x3a8663-0x0;var _0x404900=_0x88e2[_0x3a8663];return _0x404900;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x288e('0x0'));var zipdir=require(_0x288e('0x1'));var jsonpatch=require(_0x288e('0x2'));var rp=require(_0x288e('0x3'));var moment=require(_0x288e('0x4'));var BPromise=require(_0x288e('0x5'));var Mustache=require(_0x288e('0x6'));var util=require(_0x288e('0x7'));var path=require(_0x288e('0x8'));var sox=require(_0x288e('0x9'));var csv=require(_0x288e('0xa'));var ejs=require(_0x288e('0xb'));var fs=require('fs');var fs_extra=require(_0x288e('0xc'));var _=require('lodash');var squel=require(_0x288e('0xd'));var crypto=require(_0x288e('0xe'));var jsforce=require(_0x288e('0xf'));var deskjs=require(_0x288e('0x10'));var toCsv=require(_0x288e('0xa'));var querystring=require(_0x288e('0x11'));var Papa=require(_0x288e('0x12'));var Redis=require(_0x288e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x288e('0x14'));var as=require(_0x288e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x288e('0x16'))(_0x288e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x288e('0x18')]=_[_0x288e('0x19')](config[_0x288e('0x18')],{'host':_0x288e('0x1a'),'port':0x18eb});var socket=require(_0x288e('0x1b'))(new Redis(config[_0x288e('0x18')]));require(_0x288e('0x1c'))[_0x288e('0x1d')](socket);function respondWithStatusCode(_0xface85,_0x4ca747){_0x4ca747=_0x4ca747||0xcc;return function(_0xea6b27){if(_0xea6b27){return _0xface85[_0x288e('0x1e')](_0x4ca747);}return _0xface85[_0x288e('0x1f')](_0x4ca747)[_0x288e('0x20')]();};}function respondWithResult(_0x55406f,_0x589e77){_0x589e77=_0x589e77||0xc8;return function(_0x12b3fc){if(_0x12b3fc){return _0x55406f[_0x288e('0x1f')](_0x589e77)[_0x288e('0x21')](_0x12b3fc);}};}function respondWithFilteredResult(_0x455707,_0xf3288f){return function(_0x53688e){if(_0x53688e){var _0x44001b=typeof _0xf3288f[_0x288e('0x22')]===_0x288e('0x23')&&typeof _0xf3288f[_0x288e('0x24')]==='undefined';var _0x2ae21a=_0x53688e[_0x288e('0x25')];var _0x1bd4b8=_0x44001b?0x0:_0xf3288f[_0x288e('0x22')];var _0x340f71=_0x44001b?_0x53688e[_0x288e('0x25')]:_0xf3288f['offset']+_0xf3288f['limit'];var _0x301fdd;if(_0x340f71>=_0x2ae21a){_0x340f71=_0x2ae21a;_0x301fdd=0xc8;}else{_0x301fdd=0xce;}_0x455707[_0x288e('0x1f')](_0x301fdd);return _0x455707['set']('Content-Range',_0x1bd4b8+'-'+_0x340f71+'/'+_0x2ae21a)[_0x288e('0x21')](_0x53688e);}return null;};}function patchUpdates(_0x7df4b0){return function(_0x35ab6c){try{jsonpatch[_0x288e('0x26')](_0x35ab6c,_0x7df4b0,!![]);}catch(_0x504244){return BPromise[_0x288e('0x27')](_0x504244);}return _0x35ab6c[_0x288e('0x28')]();};}function saveUpdates(_0x2b2f91,_0x3b5a8c){return function(_0x58c79e){if(_0x58c79e){return _0x58c79e[_0x288e('0x29')](_0x2b2f91)[_0x288e('0x2a')](function(_0xc72d1c){return _0xc72d1c;});}return null;};}function removeEntity(_0x35e442,_0x14b220){return function(_0x555b33){if(_0x555b33){return _0x555b33[_0x288e('0x2b')]()[_0x288e('0x2a')](function(){_0x35e442[_0x288e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9645bd,_0x5a1792){return function(_0x138ff6){if(!_0x138ff6){_0x9645bd[_0x288e('0x1e')](0x194);}return _0x138ff6;};}function handleError(_0x576c25,_0xd15d2a){_0xd15d2a=_0xd15d2a||0x1f4;return function(_0x57b844){logger[_0x288e('0x2c')](_0x57b844[_0x288e('0x2d')]);if(_0x57b844[_0x288e('0x2e')]){delete _0x57b844['name'];}_0x576c25['status'](_0xd15d2a)[_0x288e('0x2f')](_0x57b844);};}exports[_0x288e('0x30')]=function(_0xf8a9a6,_0x16a997){var _0x3eb6a8={},_0x532f1f={},_0x32fdff={'count':0x0,'rows':[]};var _0x48b3bd=_[_0x288e('0x31')](db[_0x288e('0x32')][_0x288e('0x33')],function(_0x37b3d4){return{'name':_0x37b3d4[_0x288e('0x34')],'type':_0x37b3d4[_0x288e('0x35')][_0x288e('0x36')]};});_0x532f1f[_0x288e('0x37')]=_[_0x288e('0x31')](_0x48b3bd,_0x288e('0x2e'));_0x532f1f[_0x288e('0x38')]=_[_0x288e('0x39')](_0xf8a9a6['query']);_0x532f1f[_0x288e('0x3a')]=_['intersection'](_0x532f1f[_0x288e('0x37')],_0x532f1f['query']);_0x3eb6a8[_0x288e('0x3b')]=_['intersection'](_0x532f1f[_0x288e('0x37')],qs[_0x288e('0x3c')](_0xf8a9a6[_0x288e('0x38')][_0x288e('0x3c')]));_0x3eb6a8['attributes']=_0x3eb6a8['attributes'][_0x288e('0x3d')]?_0x3eb6a8[_0x288e('0x3b')]:_0x532f1f[_0x288e('0x37')];if(!_0xf8a9a6['query']['hasOwnProperty'](_0x288e('0x3e'))){_0x3eb6a8[_0x288e('0x24')]=qs[_0x288e('0x24')](_0xf8a9a6['query'][_0x288e('0x24')]);_0x3eb6a8[_0x288e('0x22')]=qs[_0x288e('0x22')](_0xf8a9a6[_0x288e('0x38')]['offset']);}_0x3eb6a8[_0x288e('0x3f')]=qs[_0x288e('0x40')](_0xf8a9a6['query'][_0x288e('0x40')]);_0x3eb6a8[_0x288e('0x41')]=qs[_0x288e('0x3a')](_[_0x288e('0x42')](_0xf8a9a6['query'],_0x532f1f[_0x288e('0x3a')]),_0x48b3bd);if(_0xf8a9a6['query']['filter']){_0x3eb6a8[_0x288e('0x41')]=_[_0x288e('0x43')](_0x3eb6a8[_0x288e('0x41')],{'$or':_[_0x288e('0x31')](_0x48b3bd,function(_0x5d8766){if(_0x5d8766[_0x288e('0x35')]!==_0x288e('0x44')){var _0x17a421={};_0x17a421[_0x5d8766[_0x288e('0x2e')]]={'$like':'%'+_0xf8a9a6[_0x288e('0x38')][_0x288e('0x45')]+'%'};return _0x17a421;}})});}_0x3eb6a8=_[_0x288e('0x43')]({},_0x3eb6a8,_0xf8a9a6['options']);var _0x19f2bf={'where':_0x3eb6a8[_0x288e('0x41')]};return db[_0x288e('0x32')][_0x288e('0x25')](_0x19f2bf)[_0x288e('0x2a')](function(_0x3b66a0){_0x32fdff[_0x288e('0x25')]=_0x3b66a0;if(_0xf8a9a6[_0x288e('0x38')][_0x288e('0x46')]){_0x3eb6a8[_0x288e('0x47')]=[{'all':!![]}];}return db[_0x288e('0x32')][_0x288e('0x48')](_0x3eb6a8);})[_0x288e('0x2a')](function(_0x2fd609){_0x32fdff[_0x288e('0x49')]=_0x2fd609;return _0x32fdff;})[_0x288e('0x2a')](respondWithFilteredResult(_0x16a997,_0x3eb6a8))[_0x288e('0x4a')](handleError(_0x16a997,null));};exports[_0x288e('0x4b')]=function(_0x1ac699,_0x429c21){var _0xd0e9e4={'raw':!![],'where':{'id':_0x1ac699['params']['id']}},_0x1e9a47={};_0x1e9a47['model']=_[_0x288e('0x39')](db[_0x288e('0x32')]['rawAttributes']);_0x1e9a47['query']=_[_0x288e('0x39')](_0x1ac699[_0x288e('0x38')]);_0x1e9a47[_0x288e('0x3a')]=_['intersection'](_0x1e9a47[_0x288e('0x37')],_0x1e9a47['query']);_0xd0e9e4[_0x288e('0x3b')]=_[_0x288e('0x4c')](_0x1e9a47[_0x288e('0x37')],qs[_0x288e('0x3c')](_0x1ac699['query'][_0x288e('0x3c')]));_0xd0e9e4[_0x288e('0x3b')]=_0xd0e9e4[_0x288e('0x3b')][_0x288e('0x3d')]?_0xd0e9e4[_0x288e('0x3b')]:_0x1e9a47['model'];if(_0x1ac699[_0x288e('0x38')][_0x288e('0x46')]){_0xd0e9e4[_0x288e('0x47')]=[{'all':!![]}];}_0xd0e9e4=_[_0x288e('0x43')]({},_0xd0e9e4,_0x1ac699[_0x288e('0x4d')]);return db[_0x288e('0x32')]['find'](_0xd0e9e4)[_0x288e('0x2a')](handleEntityNotFound(_0x429c21,null))[_0x288e('0x2a')](respondWithResult(_0x429c21,null))[_0x288e('0x4a')](handleError(_0x429c21,null));};exports[_0x288e('0x4e')]=function(_0x33482b,_0x185c90){return db[_0x288e('0x32')][_0x288e('0x4e')](_0x33482b[_0x288e('0x4f')],{})[_0x288e('0x2a')](respondWithResult(_0x185c90,0xc9))[_0x288e('0x4a')](handleError(_0x185c90,null));};exports[_0x288e('0x29')]=function(_0x4bd050,_0x2daf13){if(_0x4bd050[_0x288e('0x4f')]['id']){delete _0x4bd050[_0x288e('0x4f')]['id'];}return db['ChatInternalMessage'][_0x288e('0x50')]({'where':{'id':_0x4bd050['params']['id']}})['then'](handleEntityNotFound(_0x2daf13,null))[_0x288e('0x2a')](saveUpdates(_0x4bd050[_0x288e('0x4f')],null))['then'](respondWithResult(_0x2daf13,null))[_0x288e('0x4a')](handleError(_0x2daf13,null));};exports[_0x288e('0x2b')]=function(_0x4e46cd,_0x5e0a92){return db[_0x288e('0x32')]['find']({'where':{'id':_0x4e46cd[_0x288e('0x51')]['id']}})[_0x288e('0x2a')](handleEntityNotFound(_0x5e0a92,null))[_0x288e('0x2a')](removeEntity(_0x5e0a92,null))[_0x288e('0x4a')](handleError(_0x5e0a92,null));};exports[_0x288e('0x52')]=function(_0x3fd97c,_0xcb4b0d){return db[_0x288e('0x32')][_0x288e('0x52')]()['then'](respondWithResult(_0xcb4b0d,null))[_0x288e('0x4a')](handleError(_0xcb4b0d,null));};function wrapUser(_0x108998){return function(_0x55ef49){var _0x50e03c=_0x108998[_0x288e('0x53')]({'plain':!![]});_0x50e03c['messages']=[];if(_0x55ef49){_0x50e03c[_0x288e('0x54')]=_0x55ef49['createdAt'];_0x50e03c[_0x288e('0x55')]=_0x55ef49;}else{_0x50e03c[_0x288e('0x54')]=moment(0x0)[_0x288e('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x50e03c[_0x288e('0x55')]={};}return _0x50e03c;};}exports[_0x288e('0x57')]=function(_0x3ef5dd,_0x674d4e,_0x19ba6a){var _0x1178f0=[];return db[_0x288e('0x58')][_0x288e('0x48')]({'where':{'role':[_0x288e('0x59'),'admin',_0x288e('0x5a')]},'attributes':['id',_0x288e('0x5b'),_0x288e('0x2e'),_0x288e('0x5c'),'userpic',_0x288e('0x5d'),_0x288e('0x5e'),_0x288e('0x5f'),_0x288e('0x60'),_0x288e('0x61')],'order':qs['sort'](_0x288e('0x62')),'include':[{'model':db[_0x288e('0x63')],'as':_0x288e('0x64'),'attributes':['id','name',_0x288e('0x35')],'through':{'attributes':[]}}]})[_0x288e('0x2a')](function(_0x5d48ef){if(_0x5d48ef){var _0x1f17ad=_0x3ef5dd['user'][_0x288e('0x53')]({'plain':!![]});if(!_0x1f17ad)throw new Error(_0x288e('0x65'));if(_0x1f17ad[_0x288e('0x5c')]===_0x288e('0x5a')){return db[_0x288e('0x66')]['find']({'where':{'name':_0x288e('0x67'),'userProfileId':_0x1f17ad[_0x288e('0x68')]},'raw':!![]})[_0x288e('0x2a')](function(_0x1fb6e4){if(_0x1fb6e4){if(_0x1fb6e4[_0x288e('0x69')]===0x0){return db[_0x288e('0x6a')][_0x288e('0x48')]({'where':{'sectionId':_0x1fb6e4['id']},'raw':!![]})[_0x288e('0x2a')](function(_0x24a71d){var _0x2b8216=[];if(_[_0x288e('0x6b')](_0x24a71d)){_0x2b8216=_[_0x288e('0x45')](_0x5d48ef,function(_0x5cf978){if(_0x5cf978[_0x288e('0x5c')]!==_0x288e('0x59')){return _0x5cf978;}});return _0x2b8216;}else{for(var _0x517ed1=0x0;_0x517ed1<_0x5d48ef[_0x288e('0x3d')];_0x517ed1++){var _0xbfbdd8=_0x5d48ef[_0x517ed1];if(_0xbfbdd8[_0x288e('0x5c')]==='agent'){var _0x39f90e=_['find'](_0x24a71d,function(_0x4bbce5){return _0x4bbce5['resourceId']===_0xbfbdd8['id'];});if(_0x39f90e)_0x2b8216[_0x288e('0x6c')](_0xbfbdd8);}else{_0x2b8216['push'](_0xbfbdd8);}}return _0x2b8216;}});}else{return _0x5d48ef;}}else{var _0x4de743=_[_0x288e('0x45')](_0x5d48ef,function(_0x3a45df){if(_0x3a45df[_0x288e('0x5c')]!==_0x288e('0x59')){return _0x3a45df;}});return _0x4de743;}});}else{return _0x5d48ef;}}})[_0x288e('0x2a')](function(_0x3be6ff){var _0x56966a=[];if(_0x3be6ff){_0x1178f0=_0x3be6ff;for(var _0x296f58=0x0;_0x296f58<_0x3be6ff[_0x288e('0x3d')];_0x296f58+=0x1){_0x1178f0[_0x296f58][_0x288e('0x6d')]=[];_0x56966a[_0x288e('0x6c')](db[_0x288e('0x32')][_0x288e('0x50')]({'where':{'FromId':[_0x3ef5dd[_0x288e('0x5a')]['id'],_0x3be6ff[_0x296f58]['id']],'ToId':[_0x3ef5dd[_0x288e('0x5a')]['id'],_0x3be6ff[_0x296f58]['id']],'ChatGroupId':null},'attributes':['id',_0x288e('0x6e'),_0x288e('0x6f'),_0x288e('0x70'),'read',_0x288e('0x4f')],'order':qs[_0x288e('0x40')](_0x288e('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x288e('0x2a')](wrapUser(_0x3be6ff[_0x296f58])));}return BPromise[_0x288e('0x72')](_0x56966a);}return[];})[_0x288e('0x2a')](function(_0x591365){return{'rows':_0x591365,'count':_0x591365[_0x288e('0x3d')]};})['then'](respondWithResult(_0x674d4e,null))[_0x288e('0x4a')](handleError(_0x674d4e,null));}; \ No newline at end of file +var _0x0a14=['order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit'];(function(_0x416273,_0x39f3fb){var _0x34f447=function(_0xe062d7){while(--_0xe062d7){_0x416273['push'](_0x416273['shift']());}};_0x34f447(++_0x39f3fb);}(_0x0a14,0x115));var _0x40a1=function(_0x562677,_0x24729f){_0x562677=_0x562677-0x0;var _0x59975e=_0x0a14[_0x562677];return _0x59975e;};'use strict';var emlformat=require(_0x40a1('0x0'));var rimraf=require(_0x40a1('0x1'));var zipdir=require(_0x40a1('0x2'));var jsonpatch=require(_0x40a1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x40a1('0x4'));var Mustache=require(_0x40a1('0x5'));var util=require(_0x40a1('0x6'));var path=require('path');var sox=require(_0x40a1('0x7'));var csv=require(_0x40a1('0x8'));var ejs=require(_0x40a1('0x9'));var fs=require('fs');var fs_extra=require(_0x40a1('0xa'));var _=require('lodash');var squel=require(_0x40a1('0xb'));var crypto=require(_0x40a1('0xc'));var jsforce=require(_0x40a1('0xd'));var deskjs=require(_0x40a1('0xe'));var toCsv=require(_0x40a1('0x8'));var querystring=require(_0x40a1('0xf'));var Papa=require(_0x40a1('0x10'));var Redis=require('ioredis');var authService=require(_0x40a1('0x11'));var qs=require(_0x40a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40a1('0x13'));var logger=require(_0x40a1('0x14'))('api');var utils=require(_0x40a1('0x15'));var config=require(_0x40a1('0x16'));var licenseUtil=require(_0x40a1('0x17'));var db=require(_0x40a1('0x18'))['db'];config[_0x40a1('0x19')]=_[_0x40a1('0x1a')](config[_0x40a1('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40a1('0x19')]));require('./chatInternalMessage.socket')[_0x40a1('0x1b')](socket);function respondWithStatusCode(_0x3c8a88,_0x27f3d9){_0x27f3d9=_0x27f3d9||0xcc;return function(_0x384ec0){if(_0x384ec0){return _0x3c8a88[_0x40a1('0x1c')](_0x27f3d9);}return _0x3c8a88[_0x40a1('0x1d')](_0x27f3d9)[_0x40a1('0x1e')]();};}function respondWithResult(_0x4763e5,_0x544fd4){_0x544fd4=_0x544fd4||0xc8;return function(_0x5d7726){if(_0x5d7726){return _0x4763e5[_0x40a1('0x1d')](_0x544fd4)[_0x40a1('0x1f')](_0x5d7726);}};}function respondWithFilteredResult(_0x16405b,_0x3654f1){return function(_0x3a06ff){if(_0x3a06ff){var _0x8c3dfe=typeof _0x3654f1[_0x40a1('0x20')]===_0x40a1('0x21')&&typeof _0x3654f1[_0x40a1('0x22')]===_0x40a1('0x21');var _0x720307=_0x3a06ff[_0x40a1('0x23')];var _0x492c88=_0x8c3dfe?0x0:_0x3654f1[_0x40a1('0x20')];var _0x57cad4=_0x8c3dfe?_0x3a06ff['count']:_0x3654f1[_0x40a1('0x20')]+_0x3654f1[_0x40a1('0x22')];var _0x183e31;if(_0x57cad4>=_0x720307){_0x57cad4=_0x720307;_0x183e31=0xc8;}else{_0x183e31=0xce;}_0x16405b['status'](_0x183e31);return _0x16405b[_0x40a1('0x24')](_0x40a1('0x25'),_0x492c88+'-'+_0x57cad4+'/'+_0x720307)[_0x40a1('0x1f')](_0x3a06ff);}return null;};}function patchUpdates(_0x242d5d){return function(_0x26ca0d){try{jsonpatch[_0x40a1('0x26')](_0x26ca0d,_0x242d5d,!![]);}catch(_0x1bfc98){return BPromise[_0x40a1('0x27')](_0x1bfc98);}return _0x26ca0d[_0x40a1('0x28')]();};}function saveUpdates(_0x23ba5c,_0x58f980){return function(_0x5172f1){if(_0x5172f1){return _0x5172f1[_0x40a1('0x29')](_0x23ba5c)['then'](function(_0x144793){return _0x144793;});}return null;};}function removeEntity(_0x47533d,_0x3f575a){return function(_0x4462d8){if(_0x4462d8){return _0x4462d8[_0x40a1('0x2a')]()[_0x40a1('0x2b')](function(){_0x47533d[_0x40a1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2653,_0x2fbeba){return function(_0x5cc7e6){if(!_0x5cc7e6){_0x4e2653[_0x40a1('0x1c')](0x194);}return _0x5cc7e6;};}function handleError(_0x514ad0,_0x2d7365){_0x2d7365=_0x2d7365||0x1f4;return function(_0x1e93e2){logger['error'](_0x1e93e2[_0x40a1('0x2c')]);if(_0x1e93e2[_0x40a1('0x2d')]){delete _0x1e93e2[_0x40a1('0x2d')];}_0x514ad0[_0x40a1('0x1d')](_0x2d7365)['send'](_0x1e93e2);};}exports['index']=function(_0x2292d5,_0xea8642){var _0x4eb0ac={},_0x1b5791={},_0x5cd4ae={'count':0x0,'rows':[]};var _0x54ac37=_[_0x40a1('0x2e')](db[_0x40a1('0x2f')][_0x40a1('0x30')],function(_0x29cde4){return{'name':_0x29cde4[_0x40a1('0x31')],'type':_0x29cde4[_0x40a1('0x32')]['key']};});_0x1b5791[_0x40a1('0x33')]=_[_0x40a1('0x2e')](_0x54ac37,'name');_0x1b5791['query']=_[_0x40a1('0x34')](_0x2292d5[_0x40a1('0x35')]);_0x1b5791['filters']=_[_0x40a1('0x36')](_0x1b5791['model'],_0x1b5791[_0x40a1('0x35')]);_0x4eb0ac[_0x40a1('0x37')]=_[_0x40a1('0x36')](_0x1b5791[_0x40a1('0x33')],qs[_0x40a1('0x38')](_0x2292d5['query']['fields']));_0x4eb0ac[_0x40a1('0x37')]=_0x4eb0ac[_0x40a1('0x37')][_0x40a1('0x39')]?_0x4eb0ac[_0x40a1('0x37')]:_0x1b5791[_0x40a1('0x33')];if(!_0x2292d5[_0x40a1('0x35')]['hasOwnProperty'](_0x40a1('0x3a'))){_0x4eb0ac['limit']=qs[_0x40a1('0x22')](_0x2292d5['query']['limit']);_0x4eb0ac[_0x40a1('0x20')]=qs['offset'](_0x2292d5[_0x40a1('0x35')][_0x40a1('0x20')]);}_0x4eb0ac[_0x40a1('0x3b')]=qs[_0x40a1('0x3c')](_0x2292d5['query'][_0x40a1('0x3c')]);_0x4eb0ac[_0x40a1('0x3d')]=qs[_0x40a1('0x3e')](_[_0x40a1('0x3f')](_0x2292d5[_0x40a1('0x35')],_0x1b5791[_0x40a1('0x3e')]),_0x54ac37);if(_0x2292d5['query']['filter']){_0x4eb0ac[_0x40a1('0x3d')]=_[_0x40a1('0x40')](_0x4eb0ac[_0x40a1('0x3d')],{'$or':_['map'](_0x54ac37,function(_0x34b340){if(_0x34b340['type']!==_0x40a1('0x41')){var _0x240627={};_0x240627[_0x34b340[_0x40a1('0x2d')]]={'$like':'%'+_0x2292d5[_0x40a1('0x35')][_0x40a1('0x42')]+'%'};return _0x240627;}})});}_0x4eb0ac=_[_0x40a1('0x40')]({},_0x4eb0ac,_0x2292d5[_0x40a1('0x43')]);var _0x5977dc={'where':_0x4eb0ac[_0x40a1('0x3d')]};return db[_0x40a1('0x2f')][_0x40a1('0x23')](_0x5977dc)['then'](function(_0x1ac5f5){_0x5cd4ae[_0x40a1('0x23')]=_0x1ac5f5;if(_0x2292d5['query'][_0x40a1('0x44')]){_0x4eb0ac[_0x40a1('0x45')]=[{'all':!![]}];}return db[_0x40a1('0x2f')]['findAll'](_0x4eb0ac);})[_0x40a1('0x2b')](function(_0x51a559){_0x5cd4ae[_0x40a1('0x46')]=_0x51a559;return _0x5cd4ae;})['then'](respondWithFilteredResult(_0xea8642,_0x4eb0ac))[_0x40a1('0x47')](handleError(_0xea8642,null));};exports[_0x40a1('0x48')]=function(_0xc400c7,_0x5f503b){var _0x51852b={'raw':!![],'where':{'id':_0xc400c7[_0x40a1('0x49')]['id']}},_0x11fc52={};_0x11fc52[_0x40a1('0x33')]=_[_0x40a1('0x34')](db[_0x40a1('0x2f')][_0x40a1('0x30')]);_0x11fc52['query']=_[_0x40a1('0x34')](_0xc400c7[_0x40a1('0x35')]);_0x11fc52[_0x40a1('0x3e')]=_[_0x40a1('0x36')](_0x11fc52['model'],_0x11fc52['query']);_0x51852b[_0x40a1('0x37')]=_[_0x40a1('0x36')](_0x11fc52['model'],qs[_0x40a1('0x38')](_0xc400c7[_0x40a1('0x35')][_0x40a1('0x38')]));_0x51852b[_0x40a1('0x37')]=_0x51852b[_0x40a1('0x37')]['length']?_0x51852b[_0x40a1('0x37')]:_0x11fc52[_0x40a1('0x33')];if(_0xc400c7[_0x40a1('0x35')]['includeAll']){_0x51852b[_0x40a1('0x45')]=[{'all':!![]}];}_0x51852b=_['merge']({},_0x51852b,_0xc400c7[_0x40a1('0x43')]);return db[_0x40a1('0x2f')][_0x40a1('0x4a')](_0x51852b)[_0x40a1('0x2b')](handleEntityNotFound(_0x5f503b,null))['then'](respondWithResult(_0x5f503b,null))[_0x40a1('0x47')](handleError(_0x5f503b,null));};exports[_0x40a1('0x4b')]=function(_0x4fef2b,_0x37855a){return db['ChatInternalMessage']['create'](_0x4fef2b[_0x40a1('0x4c')],{})['then'](respondWithResult(_0x37855a,0xc9))[_0x40a1('0x47')](handleError(_0x37855a,null));};exports[_0x40a1('0x29')]=function(_0x2cc6b6,_0x28ad93){if(_0x2cc6b6[_0x40a1('0x4c')]['id']){delete _0x2cc6b6[_0x40a1('0x4c')]['id'];}return db[_0x40a1('0x2f')][_0x40a1('0x4a')]({'where':{'id':_0x2cc6b6[_0x40a1('0x49')]['id']}})[_0x40a1('0x2b')](handleEntityNotFound(_0x28ad93,null))['then'](saveUpdates(_0x2cc6b6[_0x40a1('0x4c')],null))['then'](respondWithResult(_0x28ad93,null))[_0x40a1('0x47')](handleError(_0x28ad93,null));};exports[_0x40a1('0x2a')]=function(_0x2cb07c,_0x3edb5c){return db['ChatInternalMessage']['find']({'where':{'id':_0x2cb07c[_0x40a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3edb5c,null))[_0x40a1('0x2b')](removeEntity(_0x3edb5c,null))[_0x40a1('0x47')](handleError(_0x3edb5c,null));};exports[_0x40a1('0x4d')]=function(_0x554932,_0x57b129){return db[_0x40a1('0x2f')][_0x40a1('0x4d')]()[_0x40a1('0x2b')](respondWithResult(_0x57b129,null))[_0x40a1('0x47')](handleError(_0x57b129,null));};function wrapUser(_0xf94ff){return function(_0x4e955b){var _0x50d527=_0xf94ff['get']({'plain':!![]});_0x50d527[_0x40a1('0x4e')]=[];if(_0x4e955b){_0x50d527[_0x40a1('0x4f')]=_0x4e955b[_0x40a1('0x50')];_0x50d527[_0x40a1('0x51')]=_0x4e955b;}else{_0x50d527['lastMessageAt']=moment(0x0)[_0x40a1('0x52')](_0x40a1('0x53'));_0x50d527['lastMessage']={};}return _0x50d527;};}exports[_0x40a1('0x54')]=function(_0x398d85,_0x1c94e7,_0x284e48){var _0x14b4fa=[];return db[_0x40a1('0x55')][_0x40a1('0x56')]({'where':{'role':['agent','admin',_0x40a1('0x57')]},'attributes':['id',_0x40a1('0x58'),_0x40a1('0x2d'),'role',_0x40a1('0x59'),_0x40a1('0x5a'),_0x40a1('0x5b'),_0x40a1('0x5c'),_0x40a1('0x5d'),_0x40a1('0x5e')],'order':qs[_0x40a1('0x3c')](_0x40a1('0x5f')),'include':[{'model':db[_0x40a1('0x60')],'as':_0x40a1('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x33abe3){if(_0x33abe3){var _0x135ed1=_0x398d85[_0x40a1('0x57')][_0x40a1('0x62')]({'plain':!![]});if(!_0x135ed1)throw new Error(_0x40a1('0x63'));if(_0x135ed1[_0x40a1('0x64')]===_0x40a1('0x57')){return db[_0x40a1('0x65')][_0x40a1('0x4a')]({'where':{'name':_0x40a1('0x66'),'userProfileId':_0x135ed1['userProfileId']},'raw':!![]})['then'](function(_0x3762f3){if(_0x3762f3){if(_0x3762f3[_0x40a1('0x67')]===0x0){return db[_0x40a1('0x68')][_0x40a1('0x56')]({'where':{'sectionId':_0x3762f3['id']},'raw':!![]})['then'](function(_0x52cad5){var _0xde3143=[];if(_[_0x40a1('0x69')](_0x52cad5)){_0xde3143=_[_0x40a1('0x42')](_0x33abe3,function(_0x352dff){if(_0x352dff[_0x40a1('0x64')]!==_0x40a1('0x6a')){return _0x352dff;}});return _0xde3143;}else{for(var _0x46b434=0x0;_0x46b434<_0x33abe3[_0x40a1('0x39')];_0x46b434++){var _0x5adf1c=_0x33abe3[_0x46b434];if(_0x5adf1c[_0x40a1('0x64')]==='agent'){var _0x384c6e=_['find'](_0x52cad5,function(_0x2afd22){return _0x2afd22[_0x40a1('0x6b')]===_0x5adf1c['id'];});if(_0x384c6e)_0xde3143[_0x40a1('0x6c')](_0x5adf1c);}else{_0xde3143[_0x40a1('0x6c')](_0x5adf1c);}}return _0xde3143;}});}else{return _0x33abe3;}}else{var _0x5d2404=_[_0x40a1('0x42')](_0x33abe3,function(_0x3b0cc6){if(_0x3b0cc6['role']!==_0x40a1('0x6a')){return _0x3b0cc6;}});return _0x5d2404;}});}else{return _0x33abe3;}}})[_0x40a1('0x2b')](function(_0x547067){var _0x16f1c8=[];if(_0x547067){_0x14b4fa=_0x547067;for(var _0x4524ed=0x0;_0x4524ed<_0x547067[_0x40a1('0x39')];_0x4524ed+=0x1){_0x14b4fa[_0x4524ed]['messages']=[];_0x16f1c8[_0x40a1('0x6c')](db['ChatInternalMessage'][_0x40a1('0x4a')]({'where':{'FromId':[_0x398d85[_0x40a1('0x57')]['id'],_0x547067[_0x4524ed]['id']],'ToId':[_0x398d85['user']['id'],_0x547067[_0x4524ed]['id']],'ChatGroupId':null},'attributes':['id',_0x40a1('0x50'),'FromId',_0x40a1('0x6d'),_0x40a1('0x6e'),_0x40a1('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x40a1('0x2b')](wrapUser(_0x547067[_0x4524ed])));}return BPromise[_0x40a1('0x6f')](_0x16f1c8);}return[];})[_0x40a1('0x2b')](function(_0x21f4c3){return{'rows':_0x21f4c3,'count':_0x21f4c3['length']};})['then'](respondWithResult(_0x1c94e7,null))[_0x40a1('0x47')](handleError(_0x1c94e7,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 0b050c8..b4a1a2a 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 _0xd4b2=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x498fd2,_0x285a2d){var _0x337b69=function(_0x5af854){while(--_0x5af854){_0x498fd2['push'](_0x498fd2['shift']());}};_0x337b69(++_0x285a2d);}(_0xd4b2,0x1da));var _0x2d4b=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0xd4b2[_0x3c6310];return _0x320122;};'use strict';var EventEmitter=require(_0x2d4b('0x0'));var ChatInternalMessage=require(_0x2d4b('0x1'))['db'][_0x2d4b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2d4b('0x3')](0x0);var events={'afterCreate':_0x2d4b('0x4'),'afterUpdate':_0x2d4b('0x5'),'afterDestroy':_0x2d4b('0x6')};function emitEvent(_0x2e4ce6){return function(_0xd5abd7,_0xb3eea1,_0xb83cd){ChatInternalMessageEvents[_0x2d4b('0x7')](_0x2e4ce6+':'+_0xd5abd7['id'],_0xd5abd7);ChatInternalMessageEvents[_0x2d4b('0x7')](_0x2e4ce6,_0xd5abd7);_0xb83cd(null);};}for(var e in events){if(events[_0x2d4b('0x8')](e)){var event=events[e];ChatInternalMessage[_0x2d4b('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x29e5=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x29e5,0x8f));var _0x529e=function(_0x1e9f73,_0x53009f){_0x1e9f73=_0x1e9f73-0x0;var _0x4f7de7=_0x29e5[_0x1e9f73];return _0x4f7de7;};'use strict';var EventEmitter=require(_0x529e('0x0'));var ChatInternalMessage=require(_0x529e('0x1'))['db'][_0x529e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x529e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x529e('0x4'),'afterDestroy':_0x529e('0x5')};function emitEvent(_0xf57499){return function(_0x6750bd,_0x41217e,_0x2e2b71){ChatInternalMessageEvents[_0x529e('0x6')](_0xf57499+':'+_0x6750bd['id'],_0x6750bd);ChatInternalMessageEvents[_0x529e('0x6')](_0xf57499,_0x6750bd);_0x2e2b71(null);};}for(var e in events){if(events[_0x529e('0x7')](e)){var event=events[e];ChatInternalMessage[_0x529e('0x8')](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 471b1b0..f84da94 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 _0xaf73=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xaf73,0x112));var _0x3af7=function(_0x307d97,_0x4990e9){_0x307d97=_0x307d97-0x0;var _0x2d1985=_0xaf73[_0x307d97];return _0x2d1985;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require(_0x3af7('0x2'))('api');var moment=require(_0x3af7('0x3'));var BPromise=require(_0x3af7('0x4'));var rp=require(_0x3af7('0x5'));var fs=require('fs');var path=require(_0x3af7('0x6'));var rimraf=require(_0x3af7('0x7'));var config=require(_0x3af7('0x8'));var attributes=require(_0x3af7('0x9'));module[_0x3af7('0xa')]=function(_0x51fe10,_0x3fc6a9){return _0x51fe10[_0x3af7('0xb')](_0x3af7('0xc'),attributes,{'tableName':_0x3af7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3af7('0xe'),'collate':_0x3af7('0xf')});}; \ No newline at end of file +var _0x4e72=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0x4e72,0x152));var _0x24e7=function(_0x40d077,_0x173490){_0x40d077=_0x40d077-0x0;var _0x3e01e9=_0x4e72[_0x40d077];return _0x3e01e9;};'use strict';var _=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var logger=require(_0x24e7('0x2'))(_0x24e7('0x3'));var moment=require(_0x24e7('0x4'));var BPromise=require(_0x24e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x24e7('0x6'));var config=require(_0x24e7('0x7'));var attributes=require(_0x24e7('0x8'));module['exports']=function(_0x6e6f57,_0x5b1e65){return _0x6e6f57[_0x24e7('0x9')](_0x24e7('0xa'),attributes,{'tableName':_0x24e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24e7('0xc'),'collate':_0x24e7('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6f2b2a1..1bc38d4 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 _0x4745=['../../config/environment','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2dab8a,_0x3d36a6){var _0x4cb52e=function(_0x266c50){while(--_0x266c50){_0x2dab8a['push'](_0x2dab8a['shift']());}};_0x4cb52e(++_0x3d36a6);}(_0x4745,0xf3));var _0x5474=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4745[_0x55f8b4];return _0x2475f9;};'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'))('rpc');var config=require(_0x5474('0x9'));var jayson=require(_0x5474('0xa'));var client=jayson['client'][_0x5474('0xb')]({'port':0x232a});config[_0x5474('0xc')]=_['defaults'](config[_0x5474('0xc')],{'host':_0x5474('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5474('0xc')]));require(_0x5474('0xe'))[_0x5474('0xf')](socket);function respondWithRpcPromise(_0x87493a,_0xb76daf,_0x3adea0){return new BPromise(function(_0x2ae99a,_0x6339f0){return client[_0x5474('0x10')](_0x87493a,_0x3adea0)[_0x5474('0x11')](function(_0x4d6a48){logger['info'](_0x5474('0x12'),_0xb76daf,_0x5474('0x13'));logger[_0x5474('0x14')](_0x5474('0x15'),_0xb76daf,'request\x20sent',JSON['stringify'](_0x4d6a48));if(_0x4d6a48[_0x5474('0x16')]){if(_0x4d6a48['error'][_0x5474('0x17')]===0x1f4){logger[_0x5474('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0xb76daf,_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);return _0x6339f0(_0x4d6a48['error'][_0x5474('0x18')]);}logger[_0x5474('0x16')](_0x5474('0x12'),_0xb76daf,_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);return _0x2ae99a(_0x4d6a48[_0x5474('0x16')][_0x5474('0x18')]);}else{logger[_0x5474('0x19')](_0x5474('0x12'),_0xb76daf,_0x5474('0x13'));_0x2ae99a(_0x4d6a48[_0x5474('0x1a')]['message']);}})[_0x5474('0x1b')](function(_0x4c7879){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xb76daf,_0x4c7879);_0x6339f0(_0x4c7879);});});} \ No newline at end of file +var _0xdc5d=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0xdc5d,0x1a4));var _0xddc5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xdc5d[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require(_0xddc5('0x0'));var moment=require('moment');var BPromise=require(_0xddc5('0x1'));var rs=require(_0xddc5('0x2'));var fs=require('fs');var Redis=require(_0xddc5('0x3'));var db=require(_0xddc5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xddc5('0x5'));var jayson=require(_0xddc5('0x6'));var client=jayson[_0xddc5('0x7')][_0xddc5('0x8')]({'port':0x232a});config['redis']=_[_0xddc5('0x9')](config[_0xddc5('0xa')],{'host':_0xddc5('0xb'),'port':0x18eb});var socket=require(_0xddc5('0xc'))(new Redis(config['redis']));require(_0xddc5('0xd'))[_0xddc5('0xe')](socket);function respondWithRpcPromise(_0x4bd083,_0x11996c,_0x1428c7){return new BPromise(function(_0x1868b5,_0xd4a252){return client[_0xddc5('0xf')](_0x4bd083,_0x1428c7)[_0xddc5('0x10')](function(_0x4713ac){logger[_0xddc5('0x11')](_0xddc5('0x12'),_0x11996c,'request\x20sent');logger[_0xddc5('0x13')](_0xddc5('0x14'),_0x11996c,_0xddc5('0x15'),JSON[_0xddc5('0x16')](_0x4713ac));if(_0x4713ac['error']){if(_0x4713ac[_0xddc5('0x17')][_0xddc5('0x18')]===0x1f4){logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x4713ac[_0xddc5('0x17')][_0xddc5('0x19')]);return _0xd4a252(_0x4713ac[_0xddc5('0x17')]['message']);}logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x4713ac['error'][_0xddc5('0x19')]);return _0x1868b5(_0x4713ac['error'][_0xddc5('0x19')]);}else{logger[_0xddc5('0x11')](_0xddc5('0x12'),_0x11996c,_0xddc5('0x15'));_0x1868b5(_0x4713ac[_0xddc5('0x1a')][_0xddc5('0x19')]);}})[_0xddc5('0x1b')](function(_0x113d64){logger[_0xddc5('0x17')](_0xddc5('0x12'),_0x11996c,_0x113d64);_0xd4a252(_0x113d64);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 40e4275..fddea40 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 _0x682f=['emit','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x682f,0x184));var _0xf682=function(_0x23dceb,_0x2a4bcc){_0x23dceb=_0x23dceb-0x0;var _0xce17bc=_0x682f[_0x23dceb];return _0xce17bc;};'use strict';var ChatInternalMessageEvents=require(_0xf682('0x0'));var events=[_0xf682('0x1'),_0xf682('0x2'),_0xf682('0x3')];function createListener(_0x858461,_0x5cc60a){return function(_0x16f11e){_0x5cc60a[_0xf682('0x4')](_0x858461,_0x16f11e);};}function removeListener(_0x386cb5,_0xe44d7a){return function(){ChatInternalMessageEvents['removeListener'](_0x386cb5,_0xe44d7a);};}exports['register']=function(_0x7a9f5b){for(var _0x43436e=0x0,_0x365683=events[_0xf682('0x5')];_0x43436e<_0x365683;_0x43436e++){var _0x444e33=events[_0x43436e];var _0x5b436f=createListener(_0xf682('0x6')+_0x444e33,_0x7a9f5b);ChatInternalMessageEvents['on'](_0x444e33,_0x5b436f);}}; \ No newline at end of file +var _0xd61c=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xf0940e,_0x23b020){var _0x21c011=function(_0x473e38){while(--_0x473e38){_0xf0940e['push'](_0xf0940e['shift']());}};_0x21c011(++_0x23b020);}(_0xd61c,0x12c));var _0xcd61=function(_0x4beeb9,_0x53d210){_0x4beeb9=_0x4beeb9-0x0;var _0x55aea8=_0xd61c[_0x4beeb9];return _0x55aea8;};'use strict';var ChatInternalMessageEvents=require(_0xcd61('0x0'));var events=[_0xcd61('0x1'),'remove',_0xcd61('0x2')];function createListener(_0x4b78f6,_0x2e254a){return function(_0x10f491){_0x2e254a[_0xcd61('0x3')](_0x4b78f6,_0x10f491);};}function removeListener(_0x4d075b,_0x2c4647){return function(){ChatInternalMessageEvents[_0xcd61('0x4')](_0x4d075b,_0x2c4647);};}exports[_0xcd61('0x5')]=function(_0x2a0c66){for(var _0x727c30=0x0,_0x4e3f2b=events[_0xcd61('0x6')];_0x727c30<_0x4e3f2b;_0x727c30++){var _0x7385d=events[_0x727c30];var _0x215616=createListener(_0xcd61('0x7')+_0x7385d,_0x2a0c66);ChatInternalMessageEvents['on'](_0x7385d,_0x215616);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 9cdac78..a84b8f2 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 _0x14b6=['put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x2e26e0,_0x59fc69){var _0x432020=function(_0x138bf0){while(--_0x138bf0){_0x2e26e0['push'](_0x2e26e0['shift']());}};_0x432020(++_0x59fc69);}(_0x14b6,0x146));var _0x614b=function(_0x1e06d8,_0x11916d){_0x1e06d8=_0x1e06d8-0x0;var _0x224eb1=_0x14b6[_0x1e06d8];return _0x224eb1;};'use strict';var multer=require('multer');var util=require(_0x614b('0x0'));var path=require('path');var timeout=require(_0x614b('0x1'));var express=require(_0x614b('0x2'));var router=express[_0x614b('0x3')]();var fs_extra=require(_0x614b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x614b('0x5'));var config=require(_0x614b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x614b('0x7')]('/',auth[_0x614b('0x8')](),controller[_0x614b('0x9')]);router[_0x614b('0x7')](_0x614b('0xa'),auth[_0x614b('0x8')](),controller[_0x614b('0xb')]);router[_0x614b('0x7')](_0x614b('0xc'),auth[_0x614b('0x8')](),controller[_0x614b('0xd')]);router['get'](_0x614b('0xe'),auth[_0x614b('0x8')](),controller[_0x614b('0xf')]);router['post']('/',auth[_0x614b('0x8')](),controller['create']);router[_0x614b('0x10')]('/:id',controller['update']);router['delete'](_0x614b('0xe'),auth[_0x614b('0x8')](),controller[_0x614b('0x11')]);module[_0x614b('0x12')]=router; \ No newline at end of file +var _0xe4b6=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/users','getUsers','post','create','put','/:id','update','delete','exports','multer','path'];(function(_0x3620a3,_0x1e8376){var _0x55985f=function(_0x3da5d4){while(--_0x3da5d4){_0x3620a3['push'](_0x3620a3['shift']());}};_0x55985f(++_0x1e8376);}(_0xe4b6,0x18e));var _0x6e4b=function(_0x26cc1c,_0x4f6b44){_0x26cc1c=_0x26cc1c-0x0;var _0x23d79c=_0xe4b6[_0x26cc1c];return _0x23d79c;};'use strict';var multer=require(_0x6e4b('0x0'));var util=require('util');var path=require(_0x6e4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e4b('0x2'));var router=express['Router']();var fs_extra=require(_0x6e4b('0x3'));var auth=require(_0x6e4b('0x4'));var interaction=require(_0x6e4b('0x5'));var config=require(_0x6e4b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x6e4b('0x7')]('/',auth['isAuthenticated'](),controller[_0x6e4b('0x8')]);router[_0x6e4b('0x7')](_0x6e4b('0x9'),auth[_0x6e4b('0xa')](),controller['describe']);router['get'](_0x6e4b('0xb'),auth[_0x6e4b('0xa')](),controller[_0x6e4b('0xc')]);router[_0x6e4b('0x7')]('/:id',auth[_0x6e4b('0xa')](),controller['show']);router[_0x6e4b('0xd')]('/',auth[_0x6e4b('0xa')](),controller[_0x6e4b('0xe')]);router[_0x6e4b('0xf')](_0x6e4b('0x10'),controller[_0x6e4b('0x11')]);router[_0x6e4b('0x12')](_0x6e4b('0x10'),auth[_0x6e4b('0xa')](),controller['destroy']);module[_0x6e4b('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2123406..7b64622 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 _0x69d3=['TEXT','BOOLEAN','out','sequelize','exports'];(function(_0x5840a5,_0x374e6c){var _0x2d3e92=function(_0x96cad4){while(--_0x96cad4){_0x5840a5['push'](_0x5840a5['shift']());}};_0x2d3e92(++_0x374e6c);}(_0x69d3,0xda));var _0x369d=function(_0x5f598a,_0x21cffb){_0x5f598a=_0x5f598a-0x0;var _0x33845a=_0x69d3[_0x5f598a];return _0x33845a;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'body':{'type':Sequelize[_0x369d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x369d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x369d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x369d('0x2')]}}; \ No newline at end of file +var _0x2fe3=['ENUM','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x1717ad,_0x12b953){var _0x153a6e=function(_0x6c3348){while(--_0x6c3348){_0x1717ad['push'](_0x1717ad['shift']());}};_0x153a6e(++_0x12b953);}(_0x2fe3,0x87));var _0x32fe=function(_0x3824b2,_0x335028){_0x3824b2=_0x3824b2-0x0;var _0x19a232=_0x2fe3[_0x3824b2];return _0x19a232;};'use strict';var Sequelize=require(_0x32fe('0x0'));module[_0x32fe('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x32fe('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x32fe('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x32fe('0x4')]},'providerName':{'type':Sequelize[_0x32fe('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 287c733..2dd8739 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 _0x04af=['agent','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','get','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','ChatMessage','findAll','show','params','length','find','create','body','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x3f29fe,_0x4f7a72){var _0x5da19c=function(_0x15d9eb){while(--_0x15d9eb){_0x3f29fe['push'](_0x3f29fe['shift']());}};_0x5da19c(++_0x4f7a72);}(_0x04af,0x1ac));var _0xf04a=function(_0x168cb7,_0x5c802a){_0x168cb7=_0x168cb7-0x0;var _0x5086ef=_0x04af[_0x168cb7];return _0x5086ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf04a('0x0'));var zipdir=require(_0xf04a('0x1'));var jsonpatch=require(_0xf04a('0x2'));var rp=require(_0xf04a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf04a('0x4'));var util=require(_0xf04a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf04a('0x6'));var ejs=require(_0xf04a('0x7'));var fs=require('fs');var fs_extra=require(_0xf04a('0x8'));var _=require(_0xf04a('0x9'));var squel=require('squel');var crypto=require(_0xf04a('0xa'));var jsforce=require(_0xf04a('0xb'));var deskjs=require(_0xf04a('0xc'));var toCsv=require(_0xf04a('0x6'));var querystring=require(_0xf04a('0xd'));var Papa=require(_0xf04a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf04a('0xf'));var as=require(_0xf04a('0x10'));var hardwareService=require(_0xf04a('0x11'));var logger=require(_0xf04a('0x12'))(_0xf04a('0x13'));var utils=require(_0xf04a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf04a('0x15'))['db'];config['redis']=_[_0xf04a('0x16')](config['redis'],{'host':_0xf04a('0x17'),'port':0x18eb});var socket=require(_0xf04a('0x18'))(new Redis(config[_0xf04a('0x19')]));require(_0xf04a('0x1a'))[_0xf04a('0x1b')](socket);var jayson=require(_0xf04a('0x1c'));var client=jayson['client'][_0xf04a('0x1d')]({'port':0x232c});var client9002=jayson[_0xf04a('0x1e')][_0xf04a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29ce0e,_0x46958a,_0x512f1c,_0x4b9941){return new BPromise(function(_0x4d542b,_0x455e9f){var _0x490996=_0x4b9941||client;return _0x490996[_0xf04a('0x1f')](_0x29ce0e,_0x512f1c)[_0xf04a('0x20')](function(_0x499744){logger[_0xf04a('0x21')](_0xf04a('0x22'),_0x46958a,'request\x20sent');logger[_0xf04a('0x23')](_0xf04a('0x24'),_0x46958a,'request\x20sent',JSON[_0xf04a('0x25')](_0x499744));if(_0x499744[_0xf04a('0x26')]){if(_0x499744['error'][_0xf04a('0x27')]===0x1f4){logger[_0xf04a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x46958a,_0x499744['error']['message']);return _0x455e9f(_0x499744['error'][_0xf04a('0x28')]);}logger[_0xf04a('0x26')](_0xf04a('0x22'),_0x46958a,_0x499744[_0xf04a('0x26')][_0xf04a('0x28')]);return _0x4d542b(_0x499744['error'][_0xf04a('0x28')]);}else{logger[_0xf04a('0x21')](_0xf04a('0x22'),_0x46958a,_0xf04a('0x29'));_0x4d542b(_0x499744[_0xf04a('0x2a')][_0xf04a('0x28')]);}})[_0xf04a('0x2b')](function(_0x443352){logger['error']('ChatMessage,\x20%s,\x20%s',_0x46958a,_0x443352);_0x455e9f(_0x443352);});});}function respondWithStatusCode(_0x1538e3,_0x45124c){_0x45124c=_0x45124c||0xcc;return function(_0x4da877){if(_0x4da877){return _0x1538e3[_0xf04a('0x2c')](_0x45124c);}return _0x1538e3[_0xf04a('0x2d')](_0x45124c)[_0xf04a('0x2e')]();};}function respondWithResult(_0x5846ee,_0x5daf65){_0x5daf65=_0x5daf65||0xc8;return function(_0x4767b1){if(_0x4767b1){return _0x5846ee[_0xf04a('0x2d')](_0x5daf65)[_0xf04a('0x2f')](_0x4767b1);}};}function respondWithFilteredResult(_0x586e1a,_0x3ec0cf){return function(_0x151ccd){if(_0x151ccd){var _0x5ee698=typeof _0x3ec0cf['offset']===_0xf04a('0x30')&&typeof _0x3ec0cf[_0xf04a('0x31')]===_0xf04a('0x30');var _0x5a265f=_0x151ccd[_0xf04a('0x32')];var _0x1901cf=_0x5ee698?0x0:_0x3ec0cf[_0xf04a('0x33')];var _0x28b533=_0x5ee698?_0x151ccd['count']:_0x3ec0cf[_0xf04a('0x33')]+_0x3ec0cf[_0xf04a('0x31')];var _0x2bc079;if(_0x28b533>=_0x5a265f){_0x28b533=_0x5a265f;_0x2bc079=0xc8;}else{_0x2bc079=0xce;}_0x586e1a[_0xf04a('0x2d')](_0x2bc079);return _0x586e1a[_0xf04a('0x34')](_0xf04a('0x35'),_0x1901cf+'-'+_0x28b533+'/'+_0x5a265f)[_0xf04a('0x2f')](_0x151ccd);}return null;};}function patchUpdates(_0x4fd861){return function(_0x4327be){try{jsonpatch[_0xf04a('0x36')](_0x4327be,_0x4fd861,!![]);}catch(_0x3ead78){return BPromise['reject'](_0x3ead78);}return _0x4327be[_0xf04a('0x37')]();};}function saveUpdates(_0xa74127,_0x1c796d){return function(_0x17b373){if(_0x17b373){return _0x17b373['update'](_0xa74127)['then'](function(_0x24aa70){return _0x24aa70;});}return null;};}function removeEntity(_0x201e03,_0x5cd761){return function(_0x118f9c){if(_0x118f9c){return _0x118f9c[_0xf04a('0x38')]()[_0xf04a('0x20')](function(){_0x201e03['status'](0xcc)[_0xf04a('0x2e')]();});}};}function handleEntityNotFound(_0x40d943,_0x516bd4){return function(_0x4bc4be){if(!_0x4bc4be){_0x40d943[_0xf04a('0x2c')](0x194);}return _0x4bc4be;};}function handleError(_0x3aefd5,_0x231ce0){_0x231ce0=_0x231ce0||0x1f4;return function(_0x4001cc){logger[_0xf04a('0x26')](_0x4001cc[_0xf04a('0x39')]);if(_0x4001cc[_0xf04a('0x3a')]){delete _0x4001cc[_0xf04a('0x3a')];}_0x3aefd5[_0xf04a('0x2d')](_0x231ce0)[_0xf04a('0x3b')](_0x4001cc);};}exports[_0xf04a('0x3c')]=function(_0x10b891,_0x325624){var _0x81b408={},_0x2f90dd={},_0x1fa523={'count':0x0,'rows':[]};var _0xdc8b6e=_[_0xf04a('0x3d')](db['ChatMessage'][_0xf04a('0x3e')],function(_0x41d841){return{'name':_0x41d841['fieldName'],'type':_0x41d841[_0xf04a('0x3f')]['key']};});_0x2f90dd[_0xf04a('0x40')]=_[_0xf04a('0x3d')](_0xdc8b6e,_0xf04a('0x3a'));_0x2f90dd[_0xf04a('0x41')]=_[_0xf04a('0x42')](_0x10b891[_0xf04a('0x41')]);_0x2f90dd[_0xf04a('0x43')]=_[_0xf04a('0x44')](_0x2f90dd['model'],_0x2f90dd[_0xf04a('0x41')]);_0x81b408[_0xf04a('0x45')]=_[_0xf04a('0x44')](_0x2f90dd[_0xf04a('0x40')],qs['fields'](_0x10b891[_0xf04a('0x41')][_0xf04a('0x46')]));_0x81b408[_0xf04a('0x45')]=_0x81b408[_0xf04a('0x45')]['length']?_0x81b408[_0xf04a('0x45')]:_0x2f90dd['model'];if(!_0x10b891['query'][_0xf04a('0x47')]('nolimit')){_0x81b408[_0xf04a('0x31')]=qs[_0xf04a('0x31')](_0x10b891[_0xf04a('0x41')][_0xf04a('0x31')]);_0x81b408['offset']=qs[_0xf04a('0x33')](_0x10b891['query'][_0xf04a('0x33')]);}_0x81b408[_0xf04a('0x48')]=qs[_0xf04a('0x49')](_0x10b891[_0xf04a('0x41')]['sort']);_0x81b408[_0xf04a('0x4a')]=qs[_0xf04a('0x43')](_['pick'](_0x10b891[_0xf04a('0x41')],_0x2f90dd[_0xf04a('0x43')]),_0xdc8b6e);if(_0x10b891[_0xf04a('0x41')]['filter']){_0x81b408['where']=_[_0xf04a('0x4b')](_0x81b408[_0xf04a('0x4a')],{'$or':_[_0xf04a('0x3d')](_0xdc8b6e,function(_0x554d2c){if(_0x554d2c[_0xf04a('0x3f')]!==_0xf04a('0x4c')){var _0x240675={};_0x240675[_0x554d2c[_0xf04a('0x3a')]]={'$like':'%'+_0x10b891['query']['filter']+'%'};return _0x240675;}})});}_0x81b408=_[_0xf04a('0x4b')]({},_0x81b408,_0x10b891[_0xf04a('0x4d')]);var _0x1d8f5e={'where':_0x81b408[_0xf04a('0x4a')]};return db['ChatMessage'][_0xf04a('0x32')](_0x1d8f5e)['then'](function(_0x5e5f6b){_0x1fa523[_0xf04a('0x32')]=_0x5e5f6b;if(_0x10b891[_0xf04a('0x41')][_0xf04a('0x4e')]){_0x81b408['include']=[{'all':!![]}];}return db[_0xf04a('0x4f')][_0xf04a('0x50')](_0x81b408);})['then'](function(_0x3285c1){_0x1fa523['rows']=_0x3285c1;return _0x1fa523;})[_0xf04a('0x20')](respondWithFilteredResult(_0x325624,_0x81b408))[_0xf04a('0x2b')](handleError(_0x325624,null));};exports[_0xf04a('0x51')]=function(_0xeed8d4,_0x40c031){var _0x16d1fb={'raw':!![],'where':{'id':_0xeed8d4[_0xf04a('0x52')]['id']}},_0x2f39c2={};_0x2f39c2[_0xf04a('0x40')]=_[_0xf04a('0x42')](db['ChatMessage'][_0xf04a('0x3e')]);_0x2f39c2['query']=_[_0xf04a('0x42')](_0xeed8d4[_0xf04a('0x41')]);_0x2f39c2['filters']=_[_0xf04a('0x44')](_0x2f39c2[_0xf04a('0x40')],_0x2f39c2[_0xf04a('0x41')]);_0x16d1fb[_0xf04a('0x45')]=_[_0xf04a('0x44')](_0x2f39c2[_0xf04a('0x40')],qs[_0xf04a('0x46')](_0xeed8d4['query']['fields']));_0x16d1fb['attributes']=_0x16d1fb[_0xf04a('0x45')][_0xf04a('0x53')]?_0x16d1fb[_0xf04a('0x45')]:_0x2f39c2[_0xf04a('0x40')];if(_0xeed8d4['query'][_0xf04a('0x4e')]){_0x16d1fb['include']=[{'all':!![]}];}_0x16d1fb=_[_0xf04a('0x4b')]({},_0x16d1fb,_0xeed8d4[_0xf04a('0x4d')]);return db[_0xf04a('0x4f')][_0xf04a('0x54')](_0x16d1fb)[_0xf04a('0x20')](handleEntityNotFound(_0x40c031,null))['then'](respondWithResult(_0x40c031,null))[_0xf04a('0x2b')](handleError(_0x40c031,null));};exports[_0xf04a('0x55')]=function(_0x18cc9f,_0x2afcf6){return db[_0xf04a('0x4f')][_0xf04a('0x55')](_0x18cc9f[_0xf04a('0x56')],{})[_0xf04a('0x20')](respondWithResult(_0x2afcf6,0xc9))[_0xf04a('0x2b')](handleError(_0x2afcf6,null));};exports['update']=function(_0x574b5b,_0x16c782){if(_0x574b5b[_0xf04a('0x56')]['id']){delete _0x574b5b['body']['id'];}return db['ChatMessage']['find']({'where':{'id':_0x574b5b[_0xf04a('0x52')]['id']}})[_0xf04a('0x20')](handleEntityNotFound(_0x16c782,null))[_0xf04a('0x20')](saveUpdates(_0x574b5b[_0xf04a('0x56')],null))[_0xf04a('0x20')](respondWithResult(_0x16c782,null))[_0xf04a('0x2b')](handleError(_0x16c782,null));};exports[_0xf04a('0x38')]=function(_0x47c4e1,_0x372549){return db['ChatMessage']['find']({'where':{'id':_0x47c4e1[_0xf04a('0x52')]['id']}})[_0xf04a('0x20')](handleEntityNotFound(_0x372549,null))['then'](removeEntity(_0x372549,null))['catch'](handleError(_0x372549,null));};exports[_0xf04a('0x57')]=function(_0x4cafa9,_0x5f479e){return db['ChatMessage'][_0xf04a('0x57')]()['then'](respondWithResult(_0x5f479e,null))[_0xf04a('0x2b')](handleError(_0x5f479e,null));};var interaction_log=require(_0xf04a('0x12'))(_0xf04a('0x58'));exports[_0xf04a('0x59')]=function(_0x9b1192,_0x4a3708,_0x13e5a6){var _0x52d430={'agent':{},'channel':'chat'};if(_0x9b1192[_0xf04a('0x56')]['id']){delete _0x9b1192[_0xf04a('0x56')]['id'];}_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5a')]=!![];_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5b')]=moment()[_0xf04a('0x5c')](_0xf04a('0x5d'));_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')]=_0x9b1192[_0xf04a('0x56')]['UserId']||_0x9b1192[_0xf04a('0x5f')]['id'];_0x52d430[_0xf04a('0x60')]['id']=_0x9b1192['body']['UserId'];return db[_0xf04a('0x4f')][_0xf04a('0x54')]({'where':{'id':_0x9b1192['params']['id'],'UserId':null}})[_0xf04a('0x20')](handleEntityNotFound(_0x4a3708,null))[_0xf04a('0x20')](saveUpdates(_0x9b1192[_0xf04a('0x56')],null))[_0xf04a('0x20')](function(_0x50a43c){if(_0x50a43c){_0x52d430['message']=_0x50a43c['get']({'plain':!![]});return db[_0xf04a('0x61')][_0xf04a('0x54')]({'where':{'id':_0x50a43c[_0xf04a('0x62')]}});}return null;})[_0xf04a('0x20')](handleEntityNotFound(_0x4a3708,null))[_0xf04a('0x20')](function(_0x1a079a){if(_0x1a079a){return _0x1a079a[_0xf04a('0x63')]({'UserId':_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')],'read1stAt':_[_0xf04a('0x64')](_0x1a079a[_0xf04a('0x65')])?moment()[_0xf04a('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf04a('0x20')](function(_0xbd18fe){if(_0xbd18fe){_0x52d430[_0xf04a('0x66')]=_0xbd18fe[_0xf04a('0x67')]({'plain':!![]});interaction_log[_0xf04a('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9b1192[_0xf04a('0x5f')]['id'],_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x3a')],_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x68')],_0x52d430[_0xf04a('0x66')]['id'],_0x9b1192[_0xf04a('0x56')]?JSON[_0xf04a('0x25')](_0x9b1192[_0xf04a('0x56')]):_0xf04a('0x69'));return respondWithRpcPromise(_0xf04a('0x6a'),'acceptMessage',_0x52d430);}return null;})[_0xf04a('0x20')](function(_0x1901c1){var _0x37cd3c=_0xf04a('0x6b')+_0x1901c1[_0xf04a('0x28')]['ContactId'];return db['sequelize']['query'](_0x37cd3c,{'type':db['Sequelize'][_0xf04a('0x6c')][_0xf04a('0x6d')],'raw':!![]})['then'](function(_0x49fc83){return _0x49fc83;});})[_0xf04a('0x20')](function(_0x13b26c){if(_0x13b26c){_0x52d430['message'][_0xf04a('0x6e')]=_0x13b26c[0x0];if(!_0x9b1192[_0xf04a('0x56')]['UserId'])return;return db[_0xf04a('0x6f')][_0xf04a('0x54')]({'where':{'id':_0x9b1192[_0xf04a('0x56')][_0xf04a('0x5e')],'role':_0xf04a('0x60')},'attributes':['id','name',_0xf04a('0x70'),'email',_0xf04a('0x71')],'raw':!![]});}return null;})[_0xf04a('0x20')](function(_0x3bd762){if(!_0x3bd762)return null;_0x52d430[_0xf04a('0x28')][_0xf04a('0x60')]=_0x3bd762;return _0x52d430;})['then'](function(_0x4ba8ef){if(_0x4ba8ef){if(_0x9b1192[_0xf04a('0x56')][_0xf04a('0x72')]){_0x52d430[_0xf04a('0x28')][_0xf04a('0x73')]=util[_0xf04a('0x5c')]('SIP/%s',_0x9b1192[_0xf04a('0x5f')][_0xf04a('0x3a')]);_0x52d430[_0xf04a('0x28')][_0xf04a('0x74')]=_0x52d430[_0xf04a('0x74')];_0x52d430[_0xf04a('0x28')][_0xf04a('0x75')]=_0x52d430['channel'];_0x52d430[_0xf04a('0x28')][_0xf04a('0x76')]=_0xf04a('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xf04a('0x77'),'message':_[_0xf04a('0x4b')](_0x52d430[_0xf04a('0x28')],JSON[_0xf04a('0x78')](_0x52d430[_0xf04a('0x66')][_0xf04a('0x79')]))},client9002)[_0xf04a('0x20')](function(){return _0x52d430;});}return _0x52d430;}return null;})[_0xf04a('0x20')](respondWithResult(_0x4a3708,null))[_0xf04a('0x2b')](handleError(_0x4a3708,null));};var interaction_log=require(_0xf04a('0x12'))(_0xf04a('0x58'));exports[_0xf04a('0x7a')]=function(_0x2bb4a1,_0x272833,_0x31c875){var _0x403c82={'agent':{},'channel':'chat'};if(_0x2bb4a1[_0xf04a('0x56')]['id']){delete _0x2bb4a1['body']['id'];}_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')]=_0x2bb4a1[_0xf04a('0x56')]['UserId']||_0x2bb4a1['user']['id'];_0x403c82[_0xf04a('0x60')]['id']=_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')];return db[_0xf04a('0x4f')][_0xf04a('0x54')]({'where':{'id':_0x2bb4a1[_0xf04a('0x52')]['id'],'UserId':null}})[_0xf04a('0x20')](handleEntityNotFound(_0x272833,null))[_0xf04a('0x20')](function(_0x3ed5c4){if(_0x3ed5c4){_0x403c82[_0xf04a('0x28')]=_0x3ed5c4['get']({'plain':!![]});return db[_0xf04a('0x61')][_0xf04a('0x54')]({'where':{'id':_0x3ed5c4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x272833,null))[_0xf04a('0x20')](function(_0x3b44b8){if(_0x3b44b8){_0x403c82[_0xf04a('0x66')]=_0x3b44b8[_0xf04a('0x67')]({'plain':!![]});interaction_log[_0xf04a('0x21')](_0xf04a('0x7b'),_0x2bb4a1[_0xf04a('0x5f')]['id'],_0x2bb4a1[_0xf04a('0x5f')][_0xf04a('0x3a')],_0x2bb4a1[_0xf04a('0x5f')][_0xf04a('0x68')],_0x403c82[_0xf04a('0x66')]['id'],_0x2bb4a1['body']?JSON['stringify'](_0x2bb4a1[_0xf04a('0x56')]):_0xf04a('0x69'));return respondWithRpcPromise(_0xf04a('0x7c'),_0xf04a('0x7d'),_0x403c82);}return null;})[_0xf04a('0x20')](function(_0xe02a40){var _0x330e71=_0xf04a('0x6b')+_0xe02a40[_0xf04a('0x28')]['ContactId'];return db[_0xf04a('0x7e')]['query'](_0x330e71,{'type':db[_0xf04a('0x7f')][_0xf04a('0x6c')][_0xf04a('0x6d')],'raw':!![]})['then'](function(_0x4cf898){return _0x4cf898;});})[_0xf04a('0x20')](function(_0x523325){if(_0x523325){_0x403c82[_0xf04a('0x28')][_0xf04a('0x6e')]=_0x523325[0x0];if(!_0x2bb4a1['body'][_0xf04a('0x5e')])return;return db[_0xf04a('0x6f')]['find']({'where':{'id':_0x2bb4a1[_0xf04a('0x56')][_0xf04a('0x5e')],'role':'agent'},'attributes':['id',_0xf04a('0x3a'),_0xf04a('0x70'),_0xf04a('0x80'),'internal'],'raw':!![]});}return null;})[_0xf04a('0x20')](function(_0x211011){if(!_0x211011)return null;_0x403c82['message'][_0xf04a('0x60')]=_0x211011;return _0x403c82;})['then'](function(_0x318cfe){if(_0x318cfe){_0x318cfe['message'][_0xf04a('0x73')]=util[_0xf04a('0x5c')]('SIP/%s',_0x2bb4a1['user'][_0xf04a('0x3a')]);_0x318cfe['message'][_0xf04a('0x74')]=_0x403c82[_0xf04a('0x74')];_0x318cfe[_0xf04a('0x28')]['motionChannel']=_0x403c82['channel'];_0x318cfe[_0xf04a('0x28')][_0xf04a('0x76')]=_0xf04a('0x7a');respondWithRpcPromise('EventManager',_0xf04a('0x81'),{'event':_0xf04a('0x82'),'message':_[_0xf04a('0x4b')](_0x403c82[_0xf04a('0x28')],JSON[_0xf04a('0x78')](_0x403c82['interaction']['formData']))},client9002);return _0x403c82;}return null;})[_0xf04a('0x20')](respondWithResult(_0x272833,null))[_0xf04a('0x2b')](handleError(_0x272833,null));}; \ No newline at end of file +var _0xc4a1=['result','catch','sendStatus','status','end','count','offset','limit','set','apply','save','update','destroy','stack','name','index','map','ChatMessage','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','params','rawAttributes','options','find','create','body','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','formData','get','role','RejectMessage','rejectMessage','sequelize','QueryTypes','contact','interface','parse','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','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','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x14e632,_0x10917d){var _0x11d216=function(_0x44d132){while(--_0x44d132){_0x14e632['push'](_0x14e632['shift']());}};_0x11d216(++_0x10917d);}(_0xc4a1,0x1e5));var _0x1c4a=function(_0x462d34,_0x132731){_0x462d34=_0x462d34-0x0;var _0x1b0e53=_0xc4a1[_0x462d34];return _0x1b0e53;};'use strict';var emlformat=require(_0x1c4a('0x0'));var rimraf=require(_0x1c4a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c4a('0x2'));var rp=require(_0x1c4a('0x3'));var moment=require(_0x1c4a('0x4'));var BPromise=require(_0x1c4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c4a('0x6'));var sox=require(_0x1c4a('0x7'));var csv=require(_0x1c4a('0x8'));var ejs=require(_0x1c4a('0x9'));var fs=require('fs');var fs_extra=require(_0x1c4a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c4a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1c4a('0x8'));var querystring=require(_0x1c4a('0xc'));var Papa=require('papaparse');var Redis=require(_0x1c4a('0xd'));var authService=require(_0x1c4a('0xe'));var qs=require(_0x1c4a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c4a('0x10'));var logger=require(_0x1c4a('0x11'))(_0x1c4a('0x12'));var utils=require(_0x1c4a('0x13'));var config=require(_0x1c4a('0x14'));var licenseUtil=require(_0x1c4a('0x15'));var db=require(_0x1c4a('0x16'))['db'];config[_0x1c4a('0x17')]=_[_0x1c4a('0x18')](config['redis'],{'host':_0x1c4a('0x19'),'port':0x18eb});var socket=require(_0x1c4a('0x1a'))(new Redis(config[_0x1c4a('0x17')]));require(_0x1c4a('0x1b'))['register'](socket);var jayson=require(_0x1c4a('0x1c'));var client=jayson[_0x1c4a('0x1d')][_0x1c4a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1c4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x539e46,_0x3600c6,_0xdd99e1,_0x8911ac){return new BPromise(function(_0x4be33f,_0x45186b){var _0x38a6bc=_0x8911ac||client;return _0x38a6bc[_0x1c4a('0x1f')](_0x539e46,_0xdd99e1)['then'](function(_0xc074c4){logger[_0x1c4a('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0x1c4a('0x21'));logger[_0x1c4a('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3600c6,_0x1c4a('0x21'),JSON['stringify'](_0xc074c4));if(_0xc074c4[_0x1c4a('0x23')]){if(_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x24')]===0x1f4){logger[_0x1c4a('0x23')](_0x1c4a('0x25'),_0x3600c6,_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);return _0x45186b(_0xc074c4[_0x1c4a('0x23')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);return _0x4be33f(_0xc074c4[_0x1c4a('0x23')][_0x1c4a('0x26')]);}else{logger[_0x1c4a('0x20')](_0x1c4a('0x25'),_0x3600c6,_0x1c4a('0x21'));_0x4be33f(_0xc074c4[_0x1c4a('0x27')]['message']);}})[_0x1c4a('0x28')](function(_0xe0f854){logger[_0x1c4a('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3600c6,_0xe0f854);_0x45186b(_0xe0f854);});});}function respondWithStatusCode(_0x45a9df,_0x28773b){_0x28773b=_0x28773b||0xcc;return function(_0x481aa3){if(_0x481aa3){return _0x45a9df[_0x1c4a('0x29')](_0x28773b);}return _0x45a9df[_0x1c4a('0x2a')](_0x28773b)[_0x1c4a('0x2b')]();};}function respondWithResult(_0x402eb6,_0x16de1c){_0x16de1c=_0x16de1c||0xc8;return function(_0x5200fc){if(_0x5200fc){return _0x402eb6[_0x1c4a('0x2a')](_0x16de1c)['json'](_0x5200fc);}};}function respondWithFilteredResult(_0x1f04c5,_0x11a2db){return function(_0x4268e5){if(_0x4268e5){var _0x34ee13=typeof _0x11a2db['offset']==='undefined'&&typeof _0x11a2db['limit']==='undefined';var _0x424080=_0x4268e5[_0x1c4a('0x2c')];var _0x5b8808=_0x34ee13?0x0:_0x11a2db[_0x1c4a('0x2d')];var _0x3c538b=_0x34ee13?_0x4268e5[_0x1c4a('0x2c')]:_0x11a2db[_0x1c4a('0x2d')]+_0x11a2db[_0x1c4a('0x2e')];var _0x149aeb;if(_0x3c538b>=_0x424080){_0x3c538b=_0x424080;_0x149aeb=0xc8;}else{_0x149aeb=0xce;}_0x1f04c5[_0x1c4a('0x2a')](_0x149aeb);return _0x1f04c5[_0x1c4a('0x2f')]('Content-Range',_0x5b8808+'-'+_0x3c538b+'/'+_0x424080)['json'](_0x4268e5);}return null;};}function patchUpdates(_0x1e73a4){return function(_0x1162e7){try{jsonpatch[_0x1c4a('0x30')](_0x1162e7,_0x1e73a4,!![]);}catch(_0x30f69e){return BPromise['reject'](_0x30f69e);}return _0x1162e7[_0x1c4a('0x31')]();};}function saveUpdates(_0x14ca89,_0x168c42){return function(_0x42bfc5){if(_0x42bfc5){return _0x42bfc5[_0x1c4a('0x32')](_0x14ca89)['then'](function(_0x5a8993){return _0x5a8993;});}return null;};}function removeEntity(_0xe228ec,_0x4b7b29){return function(_0x21d69f){if(_0x21d69f){return _0x21d69f[_0x1c4a('0x33')]()['then'](function(){_0xe228ec[_0x1c4a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed329,_0x1ee4ef){return function(_0x2e5b25){if(!_0x2e5b25){_0x3ed329['sendStatus'](0x194);}return _0x2e5b25;};}function handleError(_0x2987c3,_0x38146c){_0x38146c=_0x38146c||0x1f4;return function(_0x39e64a){logger[_0x1c4a('0x23')](_0x39e64a[_0x1c4a('0x34')]);if(_0x39e64a[_0x1c4a('0x35')]){delete _0x39e64a[_0x1c4a('0x35')];}_0x2987c3[_0x1c4a('0x2a')](_0x38146c)['send'](_0x39e64a);};}exports[_0x1c4a('0x36')]=function(_0x5b9e56,_0x5a3c54){var _0x2fe862={},_0x5df219={},_0x244b58={'count':0x0,'rows':[]};var _0x46e3c3=_[_0x1c4a('0x37')](db[_0x1c4a('0x38')]['rawAttributes'],function(_0x1c3b98){return{'name':_0x1c3b98[_0x1c4a('0x39')],'type':_0x1c3b98[_0x1c4a('0x3a')][_0x1c4a('0x3b')]};});_0x5df219[_0x1c4a('0x3c')]=_['map'](_0x46e3c3,'name');_0x5df219[_0x1c4a('0x3d')]=_[_0x1c4a('0x3e')](_0x5b9e56[_0x1c4a('0x3d')]);_0x5df219['filters']=_['intersection'](_0x5df219[_0x1c4a('0x3c')],_0x5df219[_0x1c4a('0x3d')]);_0x2fe862[_0x1c4a('0x3f')]=_[_0x1c4a('0x40')](_0x5df219['model'],qs[_0x1c4a('0x41')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x41')]));_0x2fe862['attributes']=_0x2fe862['attributes'][_0x1c4a('0x42')]?_0x2fe862[_0x1c4a('0x3f')]:_0x5df219['model'];if(!_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x43')](_0x1c4a('0x44'))){_0x2fe862[_0x1c4a('0x2e')]=qs[_0x1c4a('0x2e')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x2e')]);_0x2fe862[_0x1c4a('0x2d')]=qs[_0x1c4a('0x2d')](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x2d')]);}_0x2fe862[_0x1c4a('0x45')]=qs['sort'](_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x46')]);_0x2fe862[_0x1c4a('0x47')]=qs[_0x1c4a('0x48')](_[_0x1c4a('0x49')](_0x5b9e56[_0x1c4a('0x3d')],_0x5df219[_0x1c4a('0x48')]),_0x46e3c3);if(_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x4a')]){_0x2fe862[_0x1c4a('0x47')]=_[_0x1c4a('0x4b')](_0x2fe862['where'],{'$or':_['map'](_0x46e3c3,function(_0x49e868){if(_0x49e868['type']!==_0x1c4a('0x4c')){var _0x1bfe9d={};_0x1bfe9d[_0x49e868[_0x1c4a('0x35')]]={'$like':'%'+_0x5b9e56[_0x1c4a('0x3d')]['filter']+'%'};return _0x1bfe9d;}})});}_0x2fe862=_[_0x1c4a('0x4b')]({},_0x2fe862,_0x5b9e56['options']);var _0x5caf00={'where':_0x2fe862[_0x1c4a('0x47')]};return db['ChatMessage']['count'](_0x5caf00)[_0x1c4a('0x4d')](function(_0x3d4b59){_0x244b58[_0x1c4a('0x2c')]=_0x3d4b59;if(_0x5b9e56[_0x1c4a('0x3d')][_0x1c4a('0x4e')]){_0x2fe862[_0x1c4a('0x4f')]=[{'all':!![]}];}return db[_0x1c4a('0x38')][_0x1c4a('0x50')](_0x2fe862);})['then'](function(_0x152f2b){_0x244b58[_0x1c4a('0x51')]=_0x152f2b;return _0x244b58;})[_0x1c4a('0x4d')](respondWithFilteredResult(_0x5a3c54,_0x2fe862))[_0x1c4a('0x28')](handleError(_0x5a3c54,null));};exports['show']=function(_0x35bc26,_0x4fd8d1){var _0x59f6af={'raw':!![],'where':{'id':_0x35bc26[_0x1c4a('0x52')]['id']}},_0x5ab6f7={};_0x5ab6f7[_0x1c4a('0x3c')]=_['keys'](db[_0x1c4a('0x38')][_0x1c4a('0x53')]);_0x5ab6f7[_0x1c4a('0x3d')]=_[_0x1c4a('0x3e')](_0x35bc26['query']);_0x5ab6f7[_0x1c4a('0x48')]=_['intersection'](_0x5ab6f7[_0x1c4a('0x3c')],_0x5ab6f7['query']);_0x59f6af[_0x1c4a('0x3f')]=_[_0x1c4a('0x40')](_0x5ab6f7[_0x1c4a('0x3c')],qs[_0x1c4a('0x41')](_0x35bc26[_0x1c4a('0x3d')][_0x1c4a('0x41')]));_0x59f6af['attributes']=_0x59f6af[_0x1c4a('0x3f')][_0x1c4a('0x42')]?_0x59f6af[_0x1c4a('0x3f')]:_0x5ab6f7[_0x1c4a('0x3c')];if(_0x35bc26[_0x1c4a('0x3d')][_0x1c4a('0x4e')]){_0x59f6af[_0x1c4a('0x4f')]=[{'all':!![]}];}_0x59f6af=_['merge']({},_0x59f6af,_0x35bc26[_0x1c4a('0x54')]);return db[_0x1c4a('0x38')][_0x1c4a('0x55')](_0x59f6af)[_0x1c4a('0x4d')](handleEntityNotFound(_0x4fd8d1,null))[_0x1c4a('0x4d')](respondWithResult(_0x4fd8d1,null))['catch'](handleError(_0x4fd8d1,null));};exports['create']=function(_0x26d96a,_0x4d9115){return db['ChatMessage'][_0x1c4a('0x56')](_0x26d96a['body'],{})[_0x1c4a('0x4d')](respondWithResult(_0x4d9115,0xc9))[_0x1c4a('0x28')](handleError(_0x4d9115,null));};exports[_0x1c4a('0x32')]=function(_0x4ab690,_0x20fb0d){if(_0x4ab690[_0x1c4a('0x57')]['id']){delete _0x4ab690[_0x1c4a('0x57')]['id'];}return db[_0x1c4a('0x38')]['find']({'where':{'id':_0x4ab690['params']['id']}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x20fb0d,null))[_0x1c4a('0x4d')](saveUpdates(_0x4ab690['body'],null))[_0x1c4a('0x4d')](respondWithResult(_0x20fb0d,null))[_0x1c4a('0x28')](handleError(_0x20fb0d,null));};exports['destroy']=function(_0x45a05b,_0x285a5a){return db[_0x1c4a('0x38')][_0x1c4a('0x55')]({'where':{'id':_0x45a05b[_0x1c4a('0x52')]['id']}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x285a5a,null))[_0x1c4a('0x4d')](removeEntity(_0x285a5a,null))[_0x1c4a('0x28')](handleError(_0x285a5a,null));};exports['describe']=function(_0x4b872b,_0x1e09d3){return db['ChatMessage']['describe']()[_0x1c4a('0x4d')](respondWithResult(_0x1e09d3,null))[_0x1c4a('0x28')](handleError(_0x1e09d3,null));};var interaction_log=require(_0x1c4a('0x11'))('chat-interactions');exports['accept']=function(_0x26e21b,_0x198283,_0x5cac8a){var _0x5b964d={'agent':{},'channel':_0x1c4a('0x58')};if(_0x26e21b['body']['id']){delete _0x26e21b[_0x1c4a('0x57')]['id'];}_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x59')]=!![];_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5a')]=moment()[_0x1c4a('0x5b')](_0x1c4a('0x5c'));_0x26e21b['body'][_0x1c4a('0x5d')]=_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')]||_0x26e21b[_0x1c4a('0x5e')]['id'];_0x5b964d['agent']['id']=_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')];return db['ChatMessage'][_0x1c4a('0x55')]({'where':{'id':_0x26e21b[_0x1c4a('0x52')]['id'],'UserId':null}})[_0x1c4a('0x4d')](handleEntityNotFound(_0x198283,null))[_0x1c4a('0x4d')](saveUpdates(_0x26e21b[_0x1c4a('0x57')],null))[_0x1c4a('0x4d')](function(_0x1179fd){if(_0x1179fd){_0x5b964d['message']=_0x1179fd['get']({'plain':!![]});return db[_0x1c4a('0x5f')][_0x1c4a('0x55')]({'where':{'id':_0x1179fd[_0x1c4a('0x60')]}});}return null;})[_0x1c4a('0x4d')](handleEntityNotFound(_0x198283,null))[_0x1c4a('0x4d')](function(_0x52b288){if(_0x52b288){return _0x52b288[_0x1c4a('0x32')]({'UserId':_0x26e21b[_0x1c4a('0x57')]['UserId'],'read1stAt':_[_0x1c4a('0x61')](_0x52b288[_0x1c4a('0x62')])?moment()['format'](_0x1c4a('0x5c')):undefined});}return null;})[_0x1c4a('0x4d')](function(_0x3d5135){if(_0x3d5135){_0x5b964d[_0x1c4a('0x63')]=_0x3d5135['get']({'plain':!![]});interaction_log[_0x1c4a('0x20')](_0x1c4a('0x64'),_0x26e21b[_0x1c4a('0x5e')]['id'],_0x26e21b[_0x1c4a('0x5e')][_0x1c4a('0x35')],_0x26e21b['user']['role'],_0x5b964d[_0x1c4a('0x63')]['id'],_0x26e21b[_0x1c4a('0x57')]?JSON[_0x1c4a('0x65')](_0x26e21b[_0x1c4a('0x57')]):_0x1c4a('0x66'));return respondWithRpcPromise(_0x1c4a('0x67'),'acceptMessage',_0x5b964d);}return null;})[_0x1c4a('0x4d')](function(_0x155897){var _0x371fb9=_0x1c4a('0x68')+_0x155897[_0x1c4a('0x26')][_0x1c4a('0x69')];return db['sequelize'][_0x1c4a('0x3d')](_0x371fb9,{'type':db[_0x1c4a('0x6a')]['QueryTypes'][_0x1c4a('0x6b')],'raw':!![]})['then'](function(_0x329026){return _0x329026;});})[_0x1c4a('0x4d')](function(_0x48ad86){if(_0x48ad86){_0x5b964d['message']['contact']=_0x48ad86[0x0];if(!_0x26e21b['body'][_0x1c4a('0x5d')])return;return db[_0x1c4a('0x6c')][_0x1c4a('0x55')]({'where':{'id':_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x5d')],'role':_0x1c4a('0x6d')},'attributes':['id',_0x1c4a('0x35'),_0x1c4a('0x6e'),_0x1c4a('0x6f'),_0x1c4a('0x70')],'raw':!![]});}return null;})['then'](function(_0x597032){if(!_0x597032)return null;_0x5b964d['message'][_0x1c4a('0x6d')]=_0x597032;return _0x5b964d;})[_0x1c4a('0x4d')](function(_0xfb80ce){if(_0xfb80ce){if(_0x26e21b[_0x1c4a('0x57')][_0x1c4a('0x71')]){_0x5b964d[_0x1c4a('0x26')]['interface']=util[_0x1c4a('0x5b')](_0x1c4a('0x72'),_0x26e21b[_0x1c4a('0x5e')][_0x1c4a('0x35')]);_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x73')]=_0x5b964d['channel'];_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x74')]=_0x5b964d['channel'];_0x5b964d[_0x1c4a('0x26')][_0x1c4a('0x75')]=_0x1c4a('0x76');return respondWithRpcPromise(_0x1c4a('0x77'),_0x1c4a('0x77'),{'event':_0x1c4a('0x78'),'message':_[_0x1c4a('0x4b')](_0x5b964d[_0x1c4a('0x26')],JSON['parse'](_0x5b964d['interaction'][_0x1c4a('0x79')]))},client9002)[_0x1c4a('0x4d')](function(){return _0x5b964d;});}return _0x5b964d;}return null;})[_0x1c4a('0x4d')](respondWithResult(_0x198283,null))[_0x1c4a('0x28')](handleError(_0x198283,null));};var interaction_log=require(_0x1c4a('0x11'))('chat-interactions');exports['reject']=function(_0x39b480,_0x14748f,_0x140049){var _0x51e44b={'agent':{},'channel':'chat'};if(_0x39b480['body']['id']){delete _0x39b480[_0x1c4a('0x57')]['id'];}_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')]=_0x39b480['body'][_0x1c4a('0x5d')]||_0x39b480[_0x1c4a('0x5e')]['id'];_0x51e44b[_0x1c4a('0x6d')]['id']=_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')];return db[_0x1c4a('0x38')][_0x1c4a('0x55')]({'where':{'id':_0x39b480[_0x1c4a('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14748f,null))[_0x1c4a('0x4d')](function(_0x326e55){if(_0x326e55){_0x51e44b[_0x1c4a('0x26')]=_0x326e55[_0x1c4a('0x7a')]({'plain':!![]});return db[_0x1c4a('0x5f')]['find']({'where':{'id':_0x326e55['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x14748f,null))['then'](function(_0x5454f5){if(_0x5454f5){_0x51e44b[_0x1c4a('0x63')]=_0x5454f5['get']({'plain':!![]});interaction_log[_0x1c4a('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39b480[_0x1c4a('0x5e')]['id'],_0x39b480['user'][_0x1c4a('0x35')],_0x39b480[_0x1c4a('0x5e')][_0x1c4a('0x7b')],_0x51e44b[_0x1c4a('0x63')]['id'],_0x39b480[_0x1c4a('0x57')]?JSON['stringify'](_0x39b480[_0x1c4a('0x57')]):_0x1c4a('0x66'));return respondWithRpcPromise(_0x1c4a('0x7c'),_0x1c4a('0x7d'),_0x51e44b);}return null;})[_0x1c4a('0x4d')](function(_0x5c7813){var _0x13a209=_0x1c4a('0x68')+_0x5c7813[_0x1c4a('0x26')][_0x1c4a('0x69')];return db[_0x1c4a('0x7e')][_0x1c4a('0x3d')](_0x13a209,{'type':db[_0x1c4a('0x6a')][_0x1c4a('0x7f')][_0x1c4a('0x6b')],'raw':!![]})[_0x1c4a('0x4d')](function(_0x4afebf){return _0x4afebf;});})[_0x1c4a('0x4d')](function(_0x56e83a){if(_0x56e83a){_0x51e44b[_0x1c4a('0x26')][_0x1c4a('0x80')]=_0x56e83a[0x0];if(!_0x39b480[_0x1c4a('0x57')]['UserId'])return;return db[_0x1c4a('0x6c')][_0x1c4a('0x55')]({'where':{'id':_0x39b480[_0x1c4a('0x57')][_0x1c4a('0x5d')],'role':_0x1c4a('0x6d')},'attributes':['id','name',_0x1c4a('0x6e'),_0x1c4a('0x6f'),_0x1c4a('0x70')],'raw':!![]});}return null;})[_0x1c4a('0x4d')](function(_0x14633e){if(!_0x14633e)return null;_0x51e44b[_0x1c4a('0x26')][_0x1c4a('0x6d')]=_0x14633e;return _0x51e44b;})[_0x1c4a('0x4d')](function(_0x363b8b){if(_0x363b8b){_0x363b8b['message'][_0x1c4a('0x81')]=util[_0x1c4a('0x5b')](_0x1c4a('0x72'),_0x39b480['user'][_0x1c4a('0x35')]);_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x73')]=_0x51e44b[_0x1c4a('0x73')];_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x74')]=_0x51e44b['channel'];_0x363b8b[_0x1c4a('0x26')][_0x1c4a('0x75')]='reject';respondWithRpcPromise('EventManager',_0x1c4a('0x77'),{'event':'rejectmessage','message':_[_0x1c4a('0x4b')](_0x51e44b[_0x1c4a('0x26')],JSON[_0x1c4a('0x82')](_0x51e44b[_0x1c4a('0x63')][_0x1c4a('0x79')]))},client9002);return _0x51e44b;}return null;})[_0x1c4a('0x4d')](respondWithResult(_0x14748f,null))[_0x1c4a('0x28')](handleError(_0x14748f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 47df007..838f20f 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 _0xd738=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x42c108,_0x3845fb){var _0x2c9996=function(_0x54ea99){while(--_0x54ea99){_0x42c108['push'](_0x42c108['shift']());}};_0x2c9996(++_0x3845fb);}(_0xd738,0x13e));var _0x8d73=function(_0x3122ca,_0x560490){_0x3122ca=_0x3122ca-0x0;var _0x364e70=_0xd738[_0x3122ca];return _0x364e70;};'use strict';var EventEmitter=require(_0x8d73('0x0'));var ChatMessage=require(_0x8d73('0x1'))['db'][_0x8d73('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8d73('0x3')](0x0);var events={'afterCreate':_0x8d73('0x4'),'afterUpdate':_0x8d73('0x5'),'afterDestroy':_0x8d73('0x6')};function emitEvent(_0x40a05c){return function(_0xedfb09,_0x5cdf0e,_0x177540){ChatMessageEvents[_0x8d73('0x7')](_0x40a05c+':'+_0xedfb09['id'],_0xedfb09);ChatMessageEvents[_0x8d73('0x7')](_0x40a05c,_0xedfb09);_0x177540(null);};}for(var e in events){if(events[_0x8d73('0x8')](e)){var event=events[e];ChatMessage[_0x8d73('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xdc03=['hasOwnProperty','hook','events','../../mysqldb','ChatMessage','update','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc03,0x172));var _0x3dc0=function(_0x46f286,_0x29a1d1){_0x46f286=_0x46f286-0x0;var _0x4fa39a=_0xdc03[_0x46f286];return _0x4fa39a;};'use strict';var EventEmitter=require(_0x3dc0('0x0'));var ChatMessage=require(_0x3dc0('0x1'))['db'][_0x3dc0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dc0('0x3'),'afterDestroy':_0x3dc0('0x4')};function emitEvent(_0x569d44){return function(_0x5a4313,_0x6fbc4f,_0x22ae05){ChatMessageEvents['emit'](_0x569d44+':'+_0x5a4313['id'],_0x5a4313);ChatMessageEvents[_0x3dc0('0x5')](_0x569d44,_0x5a4313);_0x22ae05(null);};}for(var e in events){if(events[_0x3dc0('0x6')](e)){var event=events[e];ChatMessage[_0x3dc0('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 86e4126..428959f 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 _0x92ba=['request-promise','path','rimraf','../../config/environment','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x92ba,0x1ad));var _0xa92b=function(_0x3788fe,_0x3421c9){_0x3788fe=_0x3788fe-0x0;var _0x9deb3=_0x92ba[_0x3788fe];return _0x9deb3;};'use strict';var _=require(_0xa92b('0x0'));var util=require(_0xa92b('0x1'));var logger=require(_0xa92b('0x2'))(_0xa92b('0x3'));var moment=require(_0xa92b('0x4'));var BPromise=require(_0xa92b('0x5'));var rp=require(_0xa92b('0x6'));var fs=require('fs');var path=require(_0xa92b('0x7'));var rimraf=require(_0xa92b('0x8'));var config=require(_0xa92b('0x9'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x537428,_0x14db25){return _0x537428[_0xa92b('0xa')](_0xa92b('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa92b('0xc'),'fields':[_0xa92b('0xd')],'type':_0xa92b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x432634,_0x1e4986,_0x3d9ffe){var _0x3dbbb5=_0x537428[_0xa92b('0xf')];var _0x3aea7e=_0x432634[_0xa92b('0x10')]({'plain':!![]});if(_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()==='in'||_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()===_0xa92b('0x13')&&!_0x3aea7e[_0xa92b('0x14')]&&!_[_0xa92b('0x15')](_0x3aea7e['UserId'])){_0x3dbbb5[_0xa92b('0x16')][_0xa92b('0x17')]({'where':{'id':_0x3aea7e['ChatInteractionId']}})['then'](function(_0x7345fc){if(_0x7345fc){_0x7345fc[_0xa92b('0x18')]({'lastMsgAt':_0x3aea7e[_0xa92b('0x19')],'lastMsgDirection':_0x3aea7e[_0xa92b('0x11')][_0xa92b('0x12')]()});}})['catch'](function(_0x4add8b){console[_0xa92b('0x1a')](_0x4add8b);});}_0x3d9ffe();}},'charset':_0xa92b('0x1b'),'collate':_0xa92b('0x1c')});}; \ No newline at end of file +var _0x962c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5edb6b,_0x452143){var _0x29ac06=function(_0x431129){while(--_0x431129){_0x5edb6b['push'](_0x5edb6b['shift']());}};_0x29ac06(++_0x452143);}(_0x962c,0x1ed));var _0xc962=function(_0x4dc4fb,_0x537433){_0x4dc4fb=_0x4dc4fb-0x0;var _0xdb856b=_0x962c[_0x4dc4fb];return _0xdb856b;};'use strict';var _=require(_0xc962('0x0'));var util=require(_0xc962('0x1'));var logger=require(_0xc962('0x2'))(_0xc962('0x3'));var moment=require(_0xc962('0x4'));var BPromise=require(_0xc962('0x5'));var rp=require(_0xc962('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc962('0x7'));var config=require(_0xc962('0x8'));var attributes=require(_0xc962('0x9'));module[_0xc962('0xa')]=function(_0x140e5c,_0x3f67d0){return _0x140e5c[_0xc962('0xb')](_0xc962('0xc'),attributes,{'tableName':_0xc962('0xd'),'paranoid':![],'indexes':[{'name':_0xc962('0xe'),'fields':[_0xc962('0xf')],'type':_0xc962('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48eced,_0x19a483,_0x43ce2e){var _0x541a72=_0x140e5c[_0xc962('0x11')];var _0x23a955=_0x48eced['get']({'plain':!![]});if(_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()==='in'||_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()===_0xc962('0x14')&&!_0x23a955[_0xc962('0x15')]&&!_[_0xc962('0x16')](_0x23a955['UserId'])){_0x541a72[_0xc962('0x17')][_0xc962('0x18')]({'where':{'id':_0x23a955[_0xc962('0x19')]}})[_0xc962('0x1a')](function(_0x144f32){if(_0x144f32){_0x144f32[_0xc962('0x1b')]({'lastMsgAt':_0x23a955[_0xc962('0x1c')],'lastMsgDirection':_0x23a955[_0xc962('0x12')][_0xc962('0x13')]()});}})[_0xc962('0x1d')](function(_0x202950){console[_0xc962('0x1e')](_0x202950);});}_0x43ce2e();}},'charset':_0xc962('0x1f'),'collate':_0xc962('0x20')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f122961..20f4f90 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 _0x94ff=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage','body','options','raw','CreateChatMessage','debug','lodash'];(function(_0xb85451,_0x3f5873){var _0x2d2873=function(_0x5f4ebf){while(--_0x5f4ebf){_0xb85451['push'](_0xb85451['shift']());}};_0x2d2873(++_0x3f5873);}(_0x94ff,0xc3));var _0xf94f=function(_0x52d80a,_0x1256a3){_0x52d80a=_0x52d80a-0x0;var _0x5bb920=_0x94ff[_0x52d80a];return _0x5bb920;};'use strict';var _=require(_0xf94f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf94f('0x1'));var fs=require('fs');var Redis=require(_0xf94f('0x2'));var db=require(_0xf94f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf94f('0x4'))(_0xf94f('0x5'));var config=require('../../config/environment');var jayson=require(_0xf94f('0x6'));var client=jayson[_0xf94f('0x7')]['http']({'port':0x232a});config[_0xf94f('0x8')]=_['defaults'](config[_0xf94f('0x8')],{'host':_0xf94f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf94f('0x8')]));require(_0xf94f('0xa'))[_0xf94f('0xb')](socket);function respondWithRpcPromise(_0x57b900,_0x5c518f,_0x510972){return new BPromise(function(_0x2d3ea6,_0x234f34){return client[_0xf94f('0xc')](_0x57b900,_0x510972)[_0xf94f('0xd')](function(_0x18a8a6){logger[_0xf94f('0xe')](_0xf94f('0xf'),_0x5c518f,_0xf94f('0x10'));logger['debug'](_0xf94f('0x11'),_0x5c518f,_0xf94f('0x10'),JSON[_0xf94f('0x12')](_0x18a8a6));if(_0x18a8a6[_0xf94f('0x13')]){if(_0x18a8a6['error'][_0xf94f('0x14')]===0x1f4){logger[_0xf94f('0x13')](_0xf94f('0xf'),_0x5c518f,_0x18a8a6[_0xf94f('0x13')][_0xf94f('0x15')]);return _0x234f34(_0x18a8a6[_0xf94f('0x13')]['message']);}logger[_0xf94f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5c518f,_0x18a8a6[_0xf94f('0x13')][_0xf94f('0x15')]);return _0x2d3ea6(_0x18a8a6['error']['message']);}else{logger['info'](_0xf94f('0xf'),_0x5c518f,'request\x20sent');_0x2d3ea6(_0x18a8a6['result'][_0xf94f('0x15')]);}})['catch'](function(_0x33defc){logger['error'](_0xf94f('0xf'),_0x5c518f,_0x33defc);_0x234f34(_0x33defc);});});}exports['CreateChatMessage']=function(_0x18aedc){var _0x124ef6=this;return new Promise(function(_0x5779ea,_0x412de1){return db[_0xf94f('0x16')]['create'](_0x18aedc[_0xf94f('0x17')],{'raw':_0x18aedc[_0xf94f('0x18')]?_0x18aedc['options'][_0xf94f('0x19')]===undefined?!![]:![]:!![]})[_0xf94f('0xd')](function(_0x5beb9c){logger[_0xf94f('0xe')](_0xf94f('0x1a'),_0x18aedc);logger[_0xf94f('0x1b')](_0xf94f('0x1a'),_0x18aedc,JSON[_0xf94f('0x12')](_0x5beb9c));_0x5779ea(_0x5beb9c);})['catch'](function(_0x2af18d){logger[_0xf94f('0x13')](_0xf94f('0x1a'),_0x2af18d['message'],_0x18aedc);_0x412de1(_0x124ef6[_0xf94f('0x13')](0x1f4,_0x2af18d[_0xf94f('0x15')]));});});}; \ No newline at end of file +var _0xc8af=['error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','create','body','options','raw','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3b1988,_0x3f0132){var _0x63a434=function(_0x260efb){while(--_0x260efb){_0x3b1988['push'](_0x3b1988['shift']());}};_0x63a434(++_0x3f0132);}(_0xc8af,0x19e));var _0xfc8a=function(_0xf1990d,_0x32f2f0){_0xf1990d=_0xf1990d-0x0;var _0x195641=_0xc8af[_0xf1990d];return _0x195641;};'use strict';var _=require(_0xfc8a('0x0'));var util=require(_0xfc8a('0x1'));var moment=require(_0xfc8a('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc8a('0x4'))['db'];var utils=require(_0xfc8a('0x5'));var logger=require('../../config/logger')(_0xfc8a('0x6'));var config=require(_0xfc8a('0x7'));var jayson=require(_0xfc8a('0x8'));var client=jayson['client'][_0xfc8a('0x9')]({'port':0x232a});config['redis']=_[_0xfc8a('0xa')](config[_0xfc8a('0xb')],{'host':_0xfc8a('0xc'),'port':0x18eb});var socket=require(_0xfc8a('0xd'))(new Redis(config[_0xfc8a('0xb')]));require(_0xfc8a('0xe'))[_0xfc8a('0xf')](socket);function respondWithRpcPromise(_0x4e95e5,_0x593841,_0x1a99d5){return new BPromise(function(_0x3d6bfd,_0x2c67d7){return client['request'](_0x4e95e5,_0x1a99d5)['then'](function(_0x4cdb7f){logger[_0xfc8a('0x10')]('ChatMessage,\x20%s,\x20%s',_0x593841,_0xfc8a('0x11'));logger[_0xfc8a('0x12')](_0xfc8a('0x13'),_0x593841,'request\x20sent',JSON['stringify'](_0x4cdb7f));if(_0x4cdb7f[_0xfc8a('0x14')]){if(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x15')]===0x1f4){logger[_0xfc8a('0x14')](_0xfc8a('0x16'),_0x593841,_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);return _0x2c67d7(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);}logger['error'](_0xfc8a('0x16'),_0x593841,_0x4cdb7f['error'][_0xfc8a('0x17')]);return _0x3d6bfd(_0x4cdb7f[_0xfc8a('0x14')][_0xfc8a('0x17')]);}else{logger[_0xfc8a('0x10')](_0xfc8a('0x16'),_0x593841,_0xfc8a('0x11'));_0x3d6bfd(_0x4cdb7f['result'][_0xfc8a('0x17')]);}})[_0xfc8a('0x18')](function(_0x23c3ad){logger['error']('ChatMessage,\x20%s,\x20%s',_0x593841,_0x23c3ad);_0x2c67d7(_0x23c3ad);});});}exports[_0xfc8a('0x19')]=function(_0x3e9609){var _0x20c1ab=this;return new Promise(function(_0x398e8a,_0x8e337e){return db['ChatMessage'][_0xfc8a('0x1a')](_0x3e9609[_0xfc8a('0x1b')],{'raw':_0x3e9609[_0xfc8a('0x1c')]?_0x3e9609[_0xfc8a('0x1c')][_0xfc8a('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x550d24){logger[_0xfc8a('0x10')](_0xfc8a('0x19'),_0x3e9609);logger['debug'](_0xfc8a('0x19'),_0x3e9609,JSON[_0xfc8a('0x1e')](_0x550d24));_0x398e8a(_0x550d24);})[_0xfc8a('0x18')](function(_0x7ddc3e){logger[_0xfc8a('0x14')](_0xfc8a('0x19'),_0x7ddc3e[_0xfc8a('0x17')],_0x3e9609);_0x8e337e(_0x20c1ab['error'](0x1f4,_0x7ddc3e[_0xfc8a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 37cf72c..00aa897 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 _0x37a7=['chatMessage:','./chatMessage.events','save','removeListener','register'];(function(_0x5d99dd,_0x4bb40b){var _0x148a26=function(_0x25df5f){while(--_0x25df5f){_0x5d99dd['push'](_0x5d99dd['shift']());}};_0x148a26(++_0x4bb40b);}(_0x37a7,0x6f));var _0x737a=function(_0x4cdf14,_0x3eeb3a){_0x4cdf14=_0x4cdf14-0x0;var _0x52646e=_0x37a7[_0x4cdf14];return _0x52646e;};'use strict';var ChatMessageEvents=require(_0x737a('0x0'));var events=[_0x737a('0x1'),'remove','update'];function createListener(_0x5a259b,_0x2d4b54){return function(_0xc5eaef){_0x2d4b54['emit'](_0x5a259b,_0xc5eaef);};}function removeListener(_0x524516,_0x4af128){return function(){ChatMessageEvents[_0x737a('0x2')](_0x524516,_0x4af128);};}exports[_0x737a('0x3')]=function(_0x7f4eed){for(var _0x11109c=0x0,_0x2f6800=events['length'];_0x11109c<_0x2f6800;_0x11109c++){var _0x244850=events[_0x11109c];var _0x249898=createListener(_0x737a('0x4')+_0x244850,_0x7f4eed);ChatMessageEvents['on'](_0x244850,_0x249898);}}; \ No newline at end of file +var _0x0fda=['register','length','./chatMessage.events','remove','update','emit'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x50488f,_0x587041){_0x50488f=_0x50488f-0x0;var _0x1a818=_0x0fda[_0x50488f];return _0x1a818;};'use strict';var ChatMessageEvents=require(_0xa0fd('0x0'));var events=['save',_0xa0fd('0x1'),_0xa0fd('0x2')];function createListener(_0x314a1a,_0x2f71f3){return function(_0x426242){_0x2f71f3[_0xa0fd('0x3')](_0x314a1a,_0x426242);};}function removeListener(_0x13c734,_0x574fca){return function(){ChatMessageEvents['removeListener'](_0x13c734,_0x574fca);};}exports[_0xa0fd('0x4')]=function(_0x4aec58){for(var _0x49b3c1=0x0,_0x868183=events[_0xa0fd('0x5')];_0x49b3c1<_0x868183;_0x49b3c1++){var _0x1aab41=events[_0x49b3c1];var _0x248cca=createListener('chatMessage:'+_0x1aab41,_0x4aec58);ChatMessageEvents['on'](_0x1aab41,_0x248cca);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 55d8592..1ff7537 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 _0x8322=['show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8322,0xe5));var _0x2832=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x8322[_0x511b76];return _0x5424ff;};'use strict';var multer=require(_0x2832('0x0'));var util=require('util');var path=require(_0x2832('0x1'));var timeout=require('connect-timeout');var express=require(_0x2832('0x2'));var router=express[_0x2832('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2832('0x4'));var controller=require('./chatMessage.controller');router[_0x2832('0x5')]('/',auth['isAuthenticated'](),controller[_0x2832('0x6')]);router['get'](_0x2832('0x7'),auth['isAuthenticated'](),controller[_0x2832('0x8')]);router[_0x2832('0x5')](_0x2832('0x9'),auth[_0x2832('0xa')](),controller[_0x2832('0xb')]);router[_0x2832('0xc')]('/',auth[_0x2832('0xa')](),interaction[_0x2832('0xd')](_0x2832('0xe'),'chatmessage:create'),controller[_0x2832('0xf')]);router[_0x2832('0x10')]('/:id',controller[_0x2832('0x11')]);router['put'](_0x2832('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x2832('0x13'),auth['isAuthenticated'](),controller[_0x2832('0x14')]);router[_0x2832('0x15')](_0x2832('0x9'),auth[_0x2832('0xa')](),controller[_0x2832('0x16')]);module[_0x2832('0x17')]=router; \ No newline at end of file +var _0x6f6a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','update','put','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x6f6a,0xff));var _0xa6f6=function(_0x16ffb1,_0x23ff79){_0x16ffb1=_0x16ffb1-0x0;var _0x2703be=_0x6f6a[_0x16ffb1];return _0x2703be;};'use strict';var multer=require(_0xa6f6('0x0'));var util=require(_0xa6f6('0x1'));var path=require('path');var timeout=require(_0xa6f6('0x2'));var express=require(_0xa6f6('0x3'));var router=express[_0xa6f6('0x4')]();var fs_extra=require(_0xa6f6('0x5'));var auth=require(_0xa6f6('0x6'));var interaction=require(_0xa6f6('0x7'));var config=require(_0xa6f6('0x8'));var controller=require(_0xa6f6('0x9'));router['get']('/',auth[_0xa6f6('0xa')](),controller[_0xa6f6('0xb')]);router[_0xa6f6('0xc')](_0xa6f6('0xd'),auth['isAuthenticated'](),controller[_0xa6f6('0xe')]);router['get'](_0xa6f6('0xf'),auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x10')]);router[_0xa6f6('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0xa6f6('0x12')),controller['create']);router['put'](_0xa6f6('0xf'),controller[_0xa6f6('0x13')]);router[_0xa6f6('0x14')](_0xa6f6('0x15'),auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x16')]);router['put']('/:id/reject',auth[_0xa6f6('0xa')](),controller[_0xa6f6('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa6f6('0x18')]);module[_0xa6f6('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4a8a316..9bdbe96 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['medium','TEXT','exports'];(function(_0x14ee26,_0x166414){var _0x521aa9=function(_0xf2420c){while(--_0xf2420c){_0x14ee26['push'](_0x14ee26['shift']());}};_0x521aa9(++_0x166414);}(_0xadb5,0xad));var _0x5adb=function(_0x5cbb86,_0x318b0f){_0x5cbb86=_0x5cbb86-0x0;var _0x199d82=_0xadb5[_0x5cbb86];return _0x199d82;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x1e1f2f,_0x2ad54f){var _0x20db03=function(_0x31106e){while(--_0x31106e){_0x1e1f2f['push'](_0x1e1f2f['shift']());}};_0x20db03(++_0x2ad54f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d4460,_0x400e28){_0x5d4460=_0x5d4460-0x0;var _0x5bdc5e=_0xb10b[_0x5d4460];return _0x5bdc5e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 2e65525..a67f25d 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4f89ce,_0x4aff54){var _0x1e4ff9=function(_0x57d720){while(--_0x57d720){_0x4f89ce['push'](_0x4f89ce['shift']());}};_0x1e4ff9(++_0x4aff54);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x248afb,_0x2b0f28){var _0x4ed56e=function(_0x191893){while(--_0x191893){_0x248afb['push'](_0x248afb['shift']());}};_0x4ed56e(++_0x2b0f28);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 3050e85..fc5660c 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52ad=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x52ad,0x1d8));var _0xd52a=function(_0x2f67a6,_0x49c531){_0x2f67a6=_0x2f67a6-0x0;var _0x1c74ef=_0x52ad[_0x2f67a6];return _0x1c74ef;};'use strict';var EventEmitter=require(_0xd52a('0x0'));var ChatOfflineMessage=require(_0xd52a('0x1'))['db'][_0xd52a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xd52a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd52a('0x4'),'afterDestroy':_0xd52a('0x5')};function emitEvent(_0x2dbf7a){return function(_0xf1d12e,_0x69fd93,_0xc135cb){ChatOfflineMessageEvents[_0xd52a('0x6')](_0x2dbf7a+':'+_0xf1d12e['id'],_0xf1d12e);ChatOfflineMessageEvents[_0xd52a('0x6')](_0x2dbf7a,_0xf1d12e);_0xc135cb(null);};}for(var e in events){if(events[_0xd52a('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xd52a('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x8ad5=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hook'];(function(_0x501308,_0x2c9dfe){var _0x174f25=function(_0x1acdb9){while(--_0x1acdb9){_0x501308['push'](_0x501308['shift']());}};_0x174f25(++_0x2c9dfe);}(_0x8ad5,0xf1));var _0x58ad=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8ad5[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require(_0x58ad('0x0'));var ChatOfflineMessage=require(_0x58ad('0x1'))['db'][_0x58ad('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x58ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x58ad('0x4')};function emitEvent(_0x3ea384){return function(_0x223e54,_0x22aba9,_0x13711c){ChatOfflineMessageEvents[_0x58ad('0x5')](_0x3ea384+':'+_0x223e54['id'],_0x223e54);ChatOfflineMessageEvents['emit'](_0x3ea384,_0x223e54);_0x13711c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x58ad('0x6')](e,emitEvent(event));}}module[_0x58ad('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 50068a4..db7f4cd 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 _0x1a36=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x479ddb,_0x13d5f9){var _0x5c6429=function(_0x55134e){while(--_0x55134e){_0x479ddb['push'](_0x479ddb['shift']());}};_0x5c6429(++_0x13d5f9);}(_0x1a36,0x9a));var _0x61a3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1a36[_0x413feb];return _0x40ee88;};'use strict';var attributes=require(_0x61a3('0x0'));module[_0x61a3('0x1')]=function(_0xd56919){return _0xd56919['define'](_0x61a3('0x2'),attributes,{'tableName':_0x61a3('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61a3('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3f38=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x56cfef,_0x14617c){var _0x5b0a2d=function(_0x1661da){while(--_0x1661da){_0x56cfef['push'](_0x56cfef['shift']());}};_0x5b0a2d(++_0x14617c);}(_0x3f38,0x119));var _0x83f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f38[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x83f3('0x0'));module[_0x83f3('0x1')]=function(_0x468b83){return _0x468b83[_0x83f3('0x2')](_0x83f3('0x3'),attributes,{'tableName':_0x83f3('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x83f3('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index eed7378..02cc5bb 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 _0x9fe3=['../../config/logger','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x554f35,_0x3a33b2){var _0x32fe11=function(_0x3bcf54){while(--_0x3bcf54){_0x554f35['push'](_0x554f35['shift']());}};_0x32fe11(++_0x3a33b2);}(_0x9fe3,0x1b1));var _0x39fe=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x9fe3[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x39fe('0x0'));var util=require('util');var moment=require(_0x39fe('0x1'));var BPromise=require(_0x39fe('0x2'));var rs=require(_0x39fe('0x3'));var fs=require('fs');var Redis=require(_0x39fe('0x4'));var db=require(_0x39fe('0x5'))['db'];var utils=require(_0x39fe('0x6'));var logger=require(_0x39fe('0x7'))(_0x39fe('0x8'));var config=require(_0x39fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x39fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418bc4,_0x42be6d,_0x228ecd){return new BPromise(function(_0x4fcd91,_0x32490c){return client[_0x39fe('0xb')](_0x418bc4,_0x228ecd)[_0x39fe('0xc')](function(_0x207175){logger['info'](_0x39fe('0xd'),_0x42be6d,_0x39fe('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x42be6d,_0x39fe('0xe'),JSON[_0x39fe('0xf')](_0x207175));if(_0x207175['error']){if(_0x207175['error']['code']===0x1f4){logger[_0x39fe('0x10')](_0x39fe('0xd'),_0x42be6d,_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);return _0x32490c(_0x207175[_0x39fe('0x10')]['message']);}logger[_0x39fe('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x42be6d,_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);return _0x4fcd91(_0x207175[_0x39fe('0x10')][_0x39fe('0x11')]);}else{logger['info'](_0x39fe('0xd'),_0x42be6d,_0x39fe('0xe'));_0x4fcd91(_0x207175[_0x39fe('0x12')][_0x39fe('0x11')]);}})[_0x39fe('0x13')](function(_0x1235d5){logger[_0x39fe('0x10')](_0x39fe('0xd'),_0x42be6d,_0x1235d5);_0x32490c(_0x1235d5);});});} \ No newline at end of file +var _0xcf70=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcf70,0x94));var _0x0cf7=function(_0x23584a,_0x7abb50){_0x23584a=_0x23584a-0x0;var _0x5bd540=_0xcf70[_0x23584a];return _0x5bd540;};'use strict';var _=require(_0x0cf7('0x0'));var util=require(_0x0cf7('0x1'));var moment=require(_0x0cf7('0x2'));var BPromise=require(_0x0cf7('0x3'));var rs=require(_0x0cf7('0x4'));var fs=require('fs');var Redis=require(_0x0cf7('0x5'));var db=require(_0x0cf7('0x6'))['db'];var utils=require(_0x0cf7('0x7'));var logger=require(_0x0cf7('0x8'))(_0x0cf7('0x9'));var config=require('../../config/environment');var jayson=require(_0x0cf7('0xa'));var client=jayson['client'][_0x0cf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aac7,_0x59758a,_0x6f757f){return new BPromise(function(_0x352126,_0x39e5c8){return client[_0x0cf7('0xc')](_0x28aac7,_0x6f757f)[_0x0cf7('0xd')](function(_0x5192f8){logger[_0x0cf7('0xe')](_0x0cf7('0xf'),_0x59758a,_0x0cf7('0x10'));logger[_0x0cf7('0x11')](_0x0cf7('0x12'),_0x59758a,_0x0cf7('0x10'),JSON['stringify'](_0x5192f8));if(_0x5192f8['error']){if(_0x5192f8['error'][_0x0cf7('0x13')]===0x1f4){logger[_0x0cf7('0x14')](_0x0cf7('0xf'),_0x59758a,_0x5192f8[_0x0cf7('0x14')][_0x0cf7('0x15')]);return _0x39e5c8(_0x5192f8[_0x0cf7('0x14')]['message']);}logger['error'](_0x0cf7('0xf'),_0x59758a,_0x5192f8[_0x0cf7('0x14')]['message']);return _0x352126(_0x5192f8[_0x0cf7('0x14')][_0x0cf7('0x15')]);}else{logger['info'](_0x0cf7('0xf'),_0x59758a,'request\x20sent');_0x352126(_0x5192f8[_0x0cf7('0x16')][_0x0cf7('0x15')]);}})[_0x0cf7('0x17')](function(_0x4c5bca){logger[_0x0cf7('0x14')](_0x0cf7('0xf'),_0x59758a,_0x4c5bca);_0x39e5c8(_0x4c5bca);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 94e292c..0c6e80d 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 _0x0c33=['../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x0c33,0x1a0));var _0x30c3=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0c33[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x30c3('0x0'));var util=require(_0x30c3('0x1'));var path=require('path');var timeout=require(_0x30c3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x30c3('0x3'));var auth=require(_0x30c3('0x4'));var interaction=require(_0x30c3('0x5'));var config=require('../../config/environment');var controller=require(_0x30c3('0x6'));router[_0x30c3('0x7')]('/',auth['isAuthenticated'](),controller[_0x30c3('0x8')]);router['get'](_0x30c3('0x9'),auth[_0x30c3('0xa')](),controller[_0x30c3('0xb')]);router[_0x30c3('0x7')](_0x30c3('0xc'),auth[_0x30c3('0xa')](),controller[_0x30c3('0xd')]);router[_0x30c3('0xe')]('/',auth[_0x30c3('0xa')](),controller[_0x30c3('0xf')]);router[_0x30c3('0x10')](_0x30c3('0xc'),auth['isAuthenticated'](),controller[_0x30c3('0x11')]);router['delete']('/:id',auth[_0x30c3('0xa')](),controller[_0x30c3('0x12')]);module[_0x30c3('0x13')]=router; \ No newline at end of file +var _0xabfc=['destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x49f8c2,_0x5166b7){var _0x3e63ec=function(_0x575c26){while(--_0x575c26){_0x49f8c2['push'](_0x49f8c2['shift']());}};_0x3e63ec(++_0x5166b7);}(_0xabfc,0xc2));var _0xcabf=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xabfc[_0x40dd56];return _0x4f850f;};'use strict';var multer=require(_0xcabf('0x0'));var util=require(_0xcabf('0x1'));var path=require('path');var timeout=require(_0xcabf('0x2'));var express=require('express');var router=express[_0xcabf('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcabf('0x4'));var config=require(_0xcabf('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xcabf('0x6')]('/',auth[_0xcabf('0x7')](),controller[_0xcabf('0x8')]);router['get'](_0xcabf('0x9'),auth[_0xcabf('0x7')](),controller['describe']);router[_0xcabf('0x6')](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller[_0xcabf('0xb')]);router[_0xcabf('0xc')]('/',auth[_0xcabf('0x7')](),controller['create']);router[_0xcabf('0xd')](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller['update']);router['delete'](_0xcabf('0xa'),auth[_0xcabf('0x7')](),controller[_0xcabf('0xe')]);module[_0xcabf('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3e6e7dd..c6ba527 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 _0xbfe7=['sequelize','STRING','mouseOver','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfe7,0x1ec));var _0x7bfe=function(_0x516c67,_0xd6ef4){_0x516c67=_0x516c67-0x0;var _0xaf96d3=_0xbfe7[_0x516c67];return _0xaf96d3;};'use strict';var Sequelize=require(_0x7bfe('0x0'));module['exports']={'name':{'type':Sequelize[_0x7bfe('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7bfe('0x2'),'timeout'),'defaultValue':_0x7bfe('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7bfe('0x3')]}}; \ No newline at end of file +var _0xb865=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xb865,0x140));var _0x5b86=function(_0x15805a,_0x31801d){_0x15805a=_0x15805a-0x0;var _0x11b989=_0xb865[_0x15805a];return _0x11b989;};'use strict';var Sequelize=require(_0x5b86('0x0'));module[_0x5b86('0x1')]={'name':{'type':Sequelize[_0x5b86('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5b86('0x3')](_0x5b86('0x4'),_0x5b86('0x5')),'defaultValue':_0x5b86('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5b86('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7e9e67f..8b61829 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 _0x8784=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','includeAll','merge','options','find','create','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x4d5fb5,_0x33c249){var _0x54e091=function(_0x4f88e3){while(--_0x4f88e3){_0x4d5fb5['push'](_0x4d5fb5['shift']());}};_0x54e091(++_0x33c249);}(_0x8784,0x172));var _0x4878=function(_0x3cd91d,_0x163516){_0x3cd91d=_0x3cd91d-0x0;var _0x3b4fab=_0x8784[_0x3cd91d];return _0x3b4fab;};'use strict';var emlformat=require(_0x4878('0x0'));var rimraf=require(_0x4878('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4878('0x2'));var rp=require(_0x4878('0x3'));var moment=require(_0x4878('0x4'));var BPromise=require(_0x4878('0x5'));var Mustache=require(_0x4878('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4878('0x7'));var csv=require(_0x4878('0x8'));var ejs=require(_0x4878('0x9'));var fs=require('fs');var fs_extra=require(_0x4878('0xa'));var _=require(_0x4878('0xb'));var squel=require(_0x4878('0xc'));var crypto=require(_0x4878('0xd'));var jsforce=require(_0x4878('0xe'));var deskjs=require(_0x4878('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4878('0x10'));var Papa=require(_0x4878('0x11'));var Redis=require(_0x4878('0x12'));var authService=require(_0x4878('0x13'));var qs=require(_0x4878('0x14'));var as=require(_0x4878('0x15'));var hardwareService=require(_0x4878('0x16'));var logger=require(_0x4878('0x17'))(_0x4878('0x18'));var utils=require(_0x4878('0x19'));var config=require(_0x4878('0x1a'));var licenseUtil=require(_0x4878('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3b6c,_0x462485){_0x462485=_0x462485||0xcc;return function(_0x188e81){if(_0x188e81){return _0xa3b6c['sendStatus'](_0x462485);}return _0xa3b6c[_0x4878('0x1c')](_0x462485)[_0x4878('0x1d')]();};}function respondWithResult(_0x4f6486,_0x32c5ea){_0x32c5ea=_0x32c5ea||0xc8;return function(_0x5e67cc){if(_0x5e67cc){return _0x4f6486['status'](_0x32c5ea)[_0x4878('0x1e')](_0x5e67cc);}};}function respondWithFilteredResult(_0x41fefd,_0x2b7ccc){return function(_0x297b43){if(_0x297b43){var _0x37a150=typeof _0x2b7ccc['offset']===_0x4878('0x1f')&&typeof _0x2b7ccc[_0x4878('0x20')]==='undefined';var _0x4319a8=_0x297b43['count'];var _0x2c2529=_0x37a150?0x0:_0x2b7ccc['offset'];var _0x5267ff=_0x37a150?_0x297b43[_0x4878('0x21')]:_0x2b7ccc[_0x4878('0x22')]+_0x2b7ccc[_0x4878('0x20')];var _0x3219f7;if(_0x5267ff>=_0x4319a8){_0x5267ff=_0x4319a8;_0x3219f7=0xc8;}else{_0x3219f7=0xce;}_0x41fefd[_0x4878('0x1c')](_0x3219f7);return _0x41fefd['set'](_0x4878('0x23'),_0x2c2529+'-'+_0x5267ff+'/'+_0x4319a8)[_0x4878('0x1e')](_0x297b43);}return null;};}function patchUpdates(_0x35a0e1){return function(_0x436f62){try{jsonpatch[_0x4878('0x24')](_0x436f62,_0x35a0e1,!![]);}catch(_0x3ffa0c){return BPromise['reject'](_0x3ffa0c);}return _0x436f62[_0x4878('0x25')]();};}function saveUpdates(_0x7767d1,_0x3f3f11){return function(_0x5482f5){if(_0x5482f5){return _0x5482f5[_0x4878('0x26')](_0x7767d1)[_0x4878('0x27')](function(_0x57d9b3){return _0x57d9b3;});}return null;};}function removeEntity(_0x21d4d7,_0x10e25d){return function(_0x3b2d57){if(_0x3b2d57){return _0x3b2d57['destroy']()[_0x4878('0x27')](function(){_0x21d4d7[_0x4878('0x1c')](0xcc)[_0x4878('0x1d')]();});}};}function handleEntityNotFound(_0x476ec3,_0x2938f9){return function(_0x5b1222){if(!_0x5b1222){_0x476ec3[_0x4878('0x28')](0x194);}return _0x5b1222;};}function handleError(_0x4458fb,_0x522157){_0x522157=_0x522157||0x1f4;return function(_0x48f8f){logger[_0x4878('0x29')](_0x48f8f[_0x4878('0x2a')]);if(_0x48f8f[_0x4878('0x2b')]){delete _0x48f8f[_0x4878('0x2b')];}_0x4458fb[_0x4878('0x1c')](_0x522157)[_0x4878('0x2c')](_0x48f8f);};}exports[_0x4878('0x2d')]=function(_0xcff66b,_0xe7a731){var _0x3b09f1={'raw':!![],'where':{'id':_0xcff66b[_0x4878('0x2e')]['id']}},_0x38400b={};_0x38400b['model']=_[_0x4878('0x2f')](db[_0x4878('0x30')]['rawAttributes']);_0x38400b['query']=_[_0x4878('0x2f')](_0xcff66b[_0x4878('0x31')]);_0x38400b[_0x4878('0x32')]=_[_0x4878('0x33')](_0x38400b[_0x4878('0x34')],_0x38400b[_0x4878('0x31')]);_0x3b09f1[_0x4878('0x35')]=_['intersection'](_0x38400b[_0x4878('0x34')],qs[_0x4878('0x36')](_0xcff66b[_0x4878('0x31')][_0x4878('0x36')]));_0x3b09f1[_0x4878('0x35')]=_0x3b09f1['attributes']['length']?_0x3b09f1['attributes']:_0x38400b[_0x4878('0x34')];if(_0xcff66b[_0x4878('0x31')][_0x4878('0x37')]){_0x3b09f1['include']=[{'all':!![]}];}_0x3b09f1=_[_0x4878('0x38')]({},_0x3b09f1,_0xcff66b[_0x4878('0x39')]);return db['ChatProactiveAction'][_0x4878('0x3a')](_0x3b09f1)['then'](handleEntityNotFound(_0xe7a731,null))[_0x4878('0x27')](respondWithResult(_0xe7a731,null))['catch'](handleError(_0xe7a731,null));};exports['create']=function(_0x179116,_0x535b44){return db[_0x4878('0x30')][_0x4878('0x3b')](_0x179116['body'],{})[_0x4878('0x27')](respondWithResult(_0x535b44,0xc9))[_0x4878('0x3c')](handleError(_0x535b44,null));};exports['update']=function(_0x1bda87,_0x305f44){if(_0x1bda87['body']['id']){delete _0x1bda87[_0x4878('0x3d')]['id'];}return db['ChatProactiveAction'][_0x4878('0x3a')]({'where':{'id':_0x1bda87[_0x4878('0x2e')]['id']}})[_0x4878('0x27')](handleEntityNotFound(_0x305f44,null))[_0x4878('0x27')](saveUpdates(_0x1bda87['body'],null))[_0x4878('0x27')](respondWithResult(_0x305f44,null))[_0x4878('0x3c')](handleError(_0x305f44,null));};exports[_0x4878('0x3e')]=function(_0x38d6c2,_0x5e1709){return db[_0x4878('0x30')]['find']({'where':{'id':_0x38d6c2[_0x4878('0x2e')]['id']}})[_0x4878('0x27')](handleEntityNotFound(_0x5e1709,null))['then'](removeEntity(_0x5e1709,null))[_0x4878('0x3c')](handleError(_0x5e1709,null));}; \ No newline at end of file +var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x2f149d,_0x3ccd01){var _0x347ec4=function(_0x43fbbe){while(--_0x43fbbe){_0x2f149d['push'](_0x2f149d['shift']());}};_0x347ec4(++_0x3ccd01);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x165c4e,_0x16942c){_0x165c4e=_0x165c4e-0x0;var _0x15e35f=_0xbcc7[_0x165c4e];return _0x15e35f;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0b7aaa5..98e69bf 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 _0x5350=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatProactiveAction'];(function(_0x3fc5d3,_0x4a1df1){var _0x3a8bf1=function(_0x2f264a){while(--_0x2f264a){_0x3fc5d3['push'](_0x3fc5d3['shift']());}};_0x3a8bf1(++_0x4a1df1);}(_0x5350,0xaa));var _0x0535=function(_0x5bf752,_0x29c9fa){_0x5bf752=_0x5bf752-0x0;var _0x3c74fd=_0x5350[_0x5bf752];return _0x3c74fd;};'use strict';var _=require(_0x0535('0x0'));var util=require(_0x0535('0x1'));var logger=require(_0x0535('0x2'))(_0x0535('0x3'));var moment=require(_0x0535('0x4'));var BPromise=require(_0x0535('0x5'));var rp=require(_0x0535('0x6'));var fs=require('fs');var path=require(_0x0535('0x7'));var rimraf=require(_0x0535('0x8'));var config=require(_0x0535('0x9'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x3e88ea,_0xc5b73f){return _0x3e88ea[_0x0535('0xa')](_0x0535('0xb'),attributes,{'tableName':_0x0535('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d60=['api','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x298845,_0x4382b2){var _0x52d93a=function(_0x5369fd){while(--_0x5369fd){_0x298845['push'](_0x298845['shift']());}};_0x52d93a(++_0x4382b2);}(_0x0d60,0x1ca));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x00d6('0x0'));var util=require(_0x00d6('0x1'));var logger=require('../../config/logger')(_0x00d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x00d6('0x3'));var rimraf=require('rimraf');var config=require(_0x00d6('0x4'));var attributes=require(_0x00d6('0x5'));module[_0x00d6('0x6')]=function(_0x4e862d,_0xe78a18){return _0x4e862d[_0x00d6('0x7')](_0x00d6('0x8'),attributes,{'tableName':_0x00d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 4edc1e9..66296a8 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 _0xd596=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x42c3a2,_0x22a366){var _0x406e0e=function(_0x5a25e1){while(--_0x5a25e1){_0x42c3a2['push'](_0x42c3a2['shift']());}};_0x406e0e(++_0x22a366);}(_0xd596,0x1d5));var _0x6d59=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xd596[_0x4de1b1];return _0x639f27;};'use strict';var _=require(_0x6d59('0x0'));var util=require(_0x6d59('0x1'));var moment=require(_0x6d59('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d59('0x3'));var fs=require('fs');var Redis=require(_0x6d59('0x4'));var db=require(_0x6d59('0x5'))['db'];var utils=require(_0x6d59('0x6'));var logger=require(_0x6d59('0x7'))(_0x6d59('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d59('0x9'));var client=jayson[_0x6d59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5690e0,_0x5b22c3,_0x16d6b2){return new BPromise(function(_0x17123b,_0x1915cf){return client['request'](_0x5690e0,_0x16d6b2)[_0x6d59('0xb')](function(_0x42a35e){logger[_0x6d59('0xc')](_0x6d59('0xd'),_0x5b22c3,_0x6d59('0xe'));logger[_0x6d59('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b22c3,'request\x20sent',JSON['stringify'](_0x42a35e));if(_0x42a35e[_0x6d59('0x10')]){if(_0x42a35e[_0x6d59('0x10')][_0x6d59('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5b22c3,_0x42a35e[_0x6d59('0x10')]['message']);return _0x1915cf(_0x42a35e[_0x6d59('0x10')]['message']);}logger[_0x6d59('0x10')](_0x6d59('0xd'),_0x5b22c3,_0x42a35e[_0x6d59('0x10')][_0x6d59('0x12')]);return _0x17123b(_0x42a35e[_0x6d59('0x10')][_0x6d59('0x12')]);}else{logger[_0x6d59('0xc')](_0x6d59('0xd'),_0x5b22c3,_0x6d59('0xe'));_0x17123b(_0x42a35e[_0x6d59('0x13')][_0x6d59('0x12')]);}})[_0x6d59('0x14')](function(_0x30a54f){logger[_0x6d59('0x10')](_0x6d59('0xd'),_0x5b22c3,_0x30a54f);_0x1915cf(_0x30a54f);});});} \ No newline at end of file +var _0x6df4=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x3348e0,_0x3d3ce9){var _0x2a556d=function(_0x113f3c){while(--_0x113f3c){_0x3348e0['push'](_0x3348e0['shift']());}};_0x2a556d(++_0x3d3ce9);}(_0x6df4,0x150));var _0x46df=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x6df4[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0x46df('0x0'));var util=require(_0x46df('0x1'));var moment=require('moment');var BPromise=require(_0x46df('0x2'));var rs=require(_0x46df('0x3'));var fs=require('fs');var Redis=require(_0x46df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46df('0x5'));var logger=require(_0x46df('0x6'))(_0x46df('0x7'));var config=require(_0x46df('0x8'));var jayson=require(_0x46df('0x9'));var client=jayson['client'][_0x46df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a7d41,_0x4f8776,_0x3a525a){return new BPromise(function(_0x53731e,_0x317c4b){return client[_0x46df('0xb')](_0x1a7d41,_0x3a525a)[_0x46df('0xc')](function(_0x4aa812){logger[_0x46df('0xd')](_0x46df('0xe'),_0x4f8776,_0x46df('0xf'));logger[_0x46df('0x10')](_0x46df('0x11'),_0x4f8776,_0x46df('0xf'),JSON[_0x46df('0x12')](_0x4aa812));if(_0x4aa812['error']){if(_0x4aa812['error'][_0x46df('0x13')]===0x1f4){logger[_0x46df('0x14')](_0x46df('0xe'),_0x4f8776,_0x4aa812[_0x46df('0x14')]['message']);return _0x317c4b(_0x4aa812['error'][_0x46df('0x15')]);}logger[_0x46df('0x14')](_0x46df('0xe'),_0x4f8776,_0x4aa812[_0x46df('0x14')][_0x46df('0x15')]);return _0x53731e(_0x4aa812['error'][_0x46df('0x15')]);}else{logger[_0x46df('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f8776,'request\x20sent');_0x53731e(_0x4aa812[_0x46df('0x16')][_0x46df('0x15')]);}})[_0x46df('0x17')](function(_0x309056){logger[_0x46df('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f8776,_0x309056);_0x317c4b(_0x309056);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 525ff2d..13bb59a 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x59daf0,_0x5b22bd){var _0x1f7841=function(_0x5e403a){while(--_0x5e403a){_0x59daf0['push'](_0x59daf0['shift']());}};_0x1f7841(++_0x5b22bd);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1b1107,_0x1cae6b){_0x1b1107=_0x1b1107-0x0;var _0x32a5b9=_0xd8fb[_0x1b1107];return _0x32a5b9;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file +var _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x1555bf,_0x1051e6){var _0x5ee4ab=function(_0x2d54c4){while(--_0x2d54c4){_0x1555bf['push'](_0x1555bf['shift']());}};_0x5ee4ab(++_0x1051e6);}(_0x5d17,0x114));var _0x75d1=function(_0x1325b5,_0x20c67e){_0x1325b5=_0x1325b5-0x0;var _0x49e29c=_0x5d17[_0x1325b5];return _0x49e29c;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 08be0a1..4787a3d 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 _0xff22=['sequelize','exports','name','STRING','INTEGER','rrmemory','roundrobin'];(function(_0x5201c0,_0x171649){var _0x11222a=function(_0x3c0499){while(--_0x3c0499){_0x5201c0['push'](_0x5201c0['shift']());}};_0x11222a(++_0x171649);}(_0xff22,0x17a));var _0x2ff2=function(_0x115310,_0x16e3af){_0x115310=_0x115310-0x0;var _0x3a0c3d=_0xff22[_0x115310];return _0x3a0c3d;};'use strict';var Sequelize=require(_0x2ff2('0x0'));module[_0x2ff2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2ff2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2ff2('0x3')]},'timeout':{'type':Sequelize[_0x2ff2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2ff2('0x5'),'beepall',_0x2ff2('0x6'))}}; \ No newline at end of file +var _0xe663=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0xb54a3d,_0x1a97c8){var _0x411f46=function(_0x3358bd){while(--_0x3358bd){_0xb54a3d['push'](_0xb54a3d['shift']());}};_0x411f46(++_0x1a97c8);}(_0xe663,0xbb));var _0x3e66=function(_0x1a66dc,_0x5412ef){_0x1a66dc=_0x1a66dc-0x0;var _0x14849a=_0xe663[_0x1a66dc];return _0x14849a;};'use strict';var Sequelize=require(_0x3e66('0x0'));module[_0x3e66('0x1')]={'name':{'type':Sequelize[_0x3e66('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e66('0x2')]},'timeout':{'type':Sequelize[_0x3e66('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e66('0x4')](_0x3e66('0x5'),_0x3e66('0x6'),_0x3e66('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0ad6779..1f5c985 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 _0xed95=['user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserChatQueue','findAndCountAll','agent','chatPause','updatedAt','SIP','createdAt','findOne','Team','getTeams','addTeams','ids','User','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','Agents','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','ChatQueue','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1e58c8,_0x21ef59){var _0x228aee=function(_0x1a9652){while(--_0x1a9652){_0x1e58c8['push'](_0x1e58c8['shift']());}};_0x228aee(++_0x21ef59);}(_0xed95,0x16d));var _0x5ed9=function(_0x365d8d,_0x5c2840){_0x365d8d=_0x365d8d-0x0;var _0x369f87=_0xed95[_0x365d8d];return _0x369f87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ed9('0x0'));var zipdir=require(_0x5ed9('0x1'));var jsonpatch=require(_0x5ed9('0x2'));var rp=require(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var Mustache=require('mustache');var util=require(_0x5ed9('0x6'));var path=require(_0x5ed9('0x7'));var sox=require(_0x5ed9('0x8'));var csv=require('to-csv');var ejs=require(_0x5ed9('0x9'));var fs=require('fs');var fs_extra=require(_0x5ed9('0xa'));var _=require(_0x5ed9('0xb'));var squel=require(_0x5ed9('0xc'));var crypto=require(_0x5ed9('0xd'));var jsforce=require(_0x5ed9('0xe'));var deskjs=require(_0x5ed9('0xf'));var toCsv=require(_0x5ed9('0x10'));var querystring=require('querystring');var Papa=require(_0x5ed9('0x11'));var Redis=require(_0x5ed9('0x12'));var authService=require(_0x5ed9('0x13'));var qs=require(_0x5ed9('0x14'));var as=require(_0x5ed9('0x15'));var hardwareService=require(_0x5ed9('0x16'));var logger=require('../../config/logger')(_0x5ed9('0x17'));var utils=require(_0x5ed9('0x18'));var config=require(_0x5ed9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ed9('0x1a'))['db'];config['redis']=_[_0x5ed9('0x1b')](config[_0x5ed9('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ed9('0x1d'))(new Redis(config[_0x5ed9('0x1c')]));require(_0x5ed9('0x1e'))[_0x5ed9('0x1f')](socket);var jayson=require(_0x5ed9('0x20'));var client=jayson['client'][_0x5ed9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2faa88,_0x2704fc,_0x1ad808,_0xe37159){return new BPromise(function(_0x5ccf0c,_0x18c14c){var _0x37eaec=_0xe37159||client;return _0x37eaec['request'](_0x2faa88,_0x1ad808)[_0x5ed9('0x22')](function(_0x50268b){logger[_0x5ed9('0x23')](_0x5ed9('0x24'),_0x2704fc,_0x5ed9('0x25'));logger[_0x5ed9('0x26')](_0x5ed9('0x27'),_0x2704fc,_0x5ed9('0x25'),JSON[_0x5ed9('0x28')](_0x50268b));if(_0x50268b[_0x5ed9('0x29')]){if(_0x50268b[_0x5ed9('0x29')][_0x5ed9('0x2a')]===0x1f4){logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x50268b['error'][_0x5ed9('0x2b')]);return _0x18c14c(_0x50268b[_0x5ed9('0x29')]['message']);}logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x50268b[_0x5ed9('0x29')]['message']);return _0x5ccf0c(_0x50268b[_0x5ed9('0x29')][_0x5ed9('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2704fc,_0x5ed9('0x25'));_0x5ccf0c(_0x50268b[_0x5ed9('0x2c')][_0x5ed9('0x2b')]);}})[_0x5ed9('0x2d')](function(_0x2fd1eb){logger[_0x5ed9('0x29')](_0x5ed9('0x24'),_0x2704fc,_0x2fd1eb);_0x18c14c(_0x2fd1eb);});});}function respondWithStatusCode(_0xb035ab,_0x1775b2){_0x1775b2=_0x1775b2||0xcc;return function(_0x3b0c2e){if(_0x3b0c2e){return _0xb035ab['sendStatus'](_0x1775b2);}return _0xb035ab['status'](_0x1775b2)['end']();};}function respondWithResult(_0x452224,_0x569ff0){_0x569ff0=_0x569ff0||0xc8;return function(_0x4df88b){if(_0x4df88b){return _0x452224[_0x5ed9('0x2e')](_0x569ff0)[_0x5ed9('0x2f')](_0x4df88b);}};}function respondWithFilteredResult(_0x4436fe,_0x24dd8f){return function(_0x2beb48){if(_0x2beb48){var _0x4fd6d0=typeof _0x24dd8f[_0x5ed9('0x30')]===_0x5ed9('0x31')&&typeof _0x24dd8f[_0x5ed9('0x32')]===_0x5ed9('0x31');var _0x3f3b6f=_0x2beb48[_0x5ed9('0x33')];var _0x3aad3d=_0x4fd6d0?0x0:_0x24dd8f[_0x5ed9('0x30')];var _0x365a87=_0x4fd6d0?_0x2beb48[_0x5ed9('0x33')]:_0x24dd8f[_0x5ed9('0x30')]+_0x24dd8f[_0x5ed9('0x32')];var _0x26e3c5;if(_0x365a87>=_0x3f3b6f){_0x365a87=_0x3f3b6f;_0x26e3c5=0xc8;}else{_0x26e3c5=0xce;}_0x4436fe[_0x5ed9('0x2e')](_0x26e3c5);return _0x4436fe[_0x5ed9('0x34')](_0x5ed9('0x35'),_0x3aad3d+'-'+_0x365a87+'/'+_0x3f3b6f)[_0x5ed9('0x2f')](_0x2beb48);}return null;};}function patchUpdates(_0x37d611){return function(_0x3f66e0){try{jsonpatch[_0x5ed9('0x36')](_0x3f66e0,_0x37d611,!![]);}catch(_0x18538a){return BPromise[_0x5ed9('0x37')](_0x18538a);}return _0x3f66e0[_0x5ed9('0x38')]();};}function saveUpdates(_0xc33f26,_0x5457ec){return function(_0x2540d5){if(_0x2540d5){return _0x2540d5['update'](_0xc33f26)['then'](function(_0xa2b194){return _0xa2b194;});}return null;};}function removeEntity(_0x5c78ad,_0x3513a9){return function(_0x5dc43c){if(_0x5dc43c){return _0x5dc43c[_0x5ed9('0x39')]()[_0x5ed9('0x22')](function(){var _0x1488e7=_0x5dc43c[_0x5ed9('0x3a')]({'plain':!![]});var _0x8aa3ea=_0x5ed9('0x3b');return db[_0x5ed9('0x3c')][_0x5ed9('0x39')]({'where':{'type':_0x8aa3ea,'resourceId':_0x1488e7['id']}})[_0x5ed9('0x22')](function(){return _0x5dc43c;});})[_0x5ed9('0x22')](function(){_0x5c78ad[_0x5ed9('0x2e')](0xcc)[_0x5ed9('0x3d')]();});}};}function handleEntityNotFound(_0x35ba64,_0x572cff){return function(_0x141d3f){if(!_0x141d3f){_0x35ba64[_0x5ed9('0x3e')](0x194);}return _0x141d3f;};}function handleError(_0x2a07c2,_0x1431d0){_0x1431d0=_0x1431d0||0x1f4;return function(_0x21c48c){logger[_0x5ed9('0x29')](_0x21c48c[_0x5ed9('0x3f')]);if(_0x21c48c['name']){delete _0x21c48c[_0x5ed9('0x40')];}_0x2a07c2[_0x5ed9('0x2e')](_0x1431d0)[_0x5ed9('0x41')](_0x21c48c);};}exports[_0x5ed9('0x42')]=function(_0x2d2a33,_0x2e8394){var _0x459e82={},_0x40019c={},_0x12d3d0={'count':0x0,'rows':[]};var _0x3d6c96=_[_0x5ed9('0x43')](db[_0x5ed9('0x44')]['rawAttributes'],function(_0x4a2ff1){return{'name':_0x4a2ff1[_0x5ed9('0x45')],'type':_0x4a2ff1[_0x5ed9('0x46')]['key']};});_0x40019c[_0x5ed9('0x47')]=_[_0x5ed9('0x43')](_0x3d6c96,_0x5ed9('0x40'));_0x40019c[_0x5ed9('0x48')]=_['keys'](_0x2d2a33['query']);_0x40019c[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x40019c[_0x5ed9('0x47')],_0x40019c[_0x5ed9('0x48')]);_0x459e82['attributes']=_[_0x5ed9('0x4a')](_0x40019c[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x459e82[_0x5ed9('0x4c')]=_0x459e82[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0x459e82['attributes']:_0x40019c[_0x5ed9('0x47')];if(!_0x2d2a33['query'][_0x5ed9('0x4e')](_0x5ed9('0x4f'))){_0x459e82['limit']=qs[_0x5ed9('0x32')](_0x2d2a33[_0x5ed9('0x48')]['limit']);_0x459e82[_0x5ed9('0x30')]=qs['offset'](_0x2d2a33[_0x5ed9('0x48')]['offset']);}_0x459e82[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0x459e82[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_[_0x5ed9('0x53')](_0x2d2a33[_0x5ed9('0x48')],_0x40019c[_0x5ed9('0x49')]),_0x3d6c96);if(_0x2d2a33[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0x459e82['where']=_[_0x5ed9('0x55')](_0x459e82[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x3d6c96,function(_0x4e62b2){if(_0x4e62b2[_0x5ed9('0x46')]!=='VIRTUAL'){var _0x614321={};_0x614321[_0x4e62b2['name']]={'$like':'%'+_0x2d2a33['query'][_0x5ed9('0x54')]+'%'};return _0x614321;}})});}_0x459e82=_[_0x5ed9('0x55')]({},_0x459e82,_0x2d2a33[_0x5ed9('0x56')]);var _0x3984f8={'where':_0x459e82[_0x5ed9('0x52')]};return db[_0x5ed9('0x44')][_0x5ed9('0x33')](_0x3984f8)[_0x5ed9('0x22')](function(_0x570893){_0x12d3d0[_0x5ed9('0x33')]=_0x570893;if(_0x2d2a33[_0x5ed9('0x48')]['includeAll']){_0x459e82[_0x5ed9('0x57')]=[{'all':!![]}];}return db[_0x5ed9('0x44')][_0x5ed9('0x58')](_0x459e82);})[_0x5ed9('0x22')](function(_0x52c797){_0x12d3d0[_0x5ed9('0x59')]=_0x52c797;return _0x12d3d0;})['then'](respondWithFilteredResult(_0x2e8394,_0x459e82))[_0x5ed9('0x2d')](handleError(_0x2e8394,null));};exports[_0x5ed9('0x5a')]=function(_0x1490d3,_0x269bd6){var _0x5cffba={'raw':!![],'where':{'id':_0x1490d3[_0x5ed9('0x5b')]['id']}},_0x2a0279={};_0x2a0279[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db[_0x5ed9('0x44')][_0x5ed9('0x5d')]);_0x2a0279[_0x5ed9('0x48')]=_[_0x5ed9('0x5c')](_0x1490d3[_0x5ed9('0x48')]);_0x2a0279[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x2a0279[_0x5ed9('0x47')],_0x2a0279[_0x5ed9('0x48')]);_0x5cffba['attributes']=_[_0x5ed9('0x4a')](_0x2a0279[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x1490d3[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x5cffba[_0x5ed9('0x4c')]=_0x5cffba['attributes']['length']?_0x5cffba[_0x5ed9('0x4c')]:_0x2a0279[_0x5ed9('0x47')];if(_0x1490d3[_0x5ed9('0x48')][_0x5ed9('0x5e')]){_0x5cffba[_0x5ed9('0x57')]=[{'all':!![]}];}_0x5cffba=_[_0x5ed9('0x55')]({},_0x5cffba,_0x1490d3[_0x5ed9('0x56')]);return db[_0x5ed9('0x44')][_0x5ed9('0x5f')](_0x5cffba)['then'](handleEntityNotFound(_0x269bd6,null))[_0x5ed9('0x22')](respondWithResult(_0x269bd6,null))[_0x5ed9('0x2d')](handleError(_0x269bd6,null));};exports[_0x5ed9('0x60')]=function(_0x49a260,_0x38c4dc){return db[_0x5ed9('0x44')][_0x5ed9('0x60')](_0x49a260[_0x5ed9('0x61')],{})['then'](function(_0x13b4d0){var _0x18a757=_0x49a260['user']['get']({'plain':!![]});if(!_0x18a757)throw new Error(_0x5ed9('0x62'));if(_0x18a757[_0x5ed9('0x63')]===_0x5ed9('0x64')){var _0x264512=_0x13b4d0[_0x5ed9('0x3a')]({'plain':!![]});var _0x2756f7=_0x5ed9('0x3b');return db[_0x5ed9('0x65')][_0x5ed9('0x5f')]({'where':{'name':_0x2756f7,'userProfileId':_0x18a757[_0x5ed9('0x66')]},'raw':!![]})[_0x5ed9('0x22')](function(_0x30a243){if(_0x30a243&&_0x30a243[_0x5ed9('0x67')]===0x0){return db['UserProfileResource'][_0x5ed9('0x60')]({'name':_0x264512[_0x5ed9('0x40')],'resourceId':_0x264512['id'],'type':_0x30a243['name'],'sectionId':_0x30a243['id']},{})[_0x5ed9('0x22')](function(){return _0x13b4d0;});}else{return _0x13b4d0;}})[_0x5ed9('0x2d')](function(_0x9edc92){logger[_0x5ed9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9edc92);throw _0x9edc92;});}return _0x13b4d0;})['then'](respondWithResult(_0x38c4dc,0xc9))[_0x5ed9('0x2d')](handleError(_0x38c4dc,null));};exports['update']=function(_0x26d84b,_0x35095f){if(_0x26d84b[_0x5ed9('0x61')]['id']){delete _0x26d84b[_0x5ed9('0x61')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x26d84b[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x35095f,null))['then'](saveUpdates(_0x26d84b[_0x5ed9('0x61')],null))[_0x5ed9('0x22')](respondWithResult(_0x35095f,null))[_0x5ed9('0x2d')](handleError(_0x35095f,null));};exports[_0x5ed9('0x39')]=function(_0x442215,_0x4d6f15){return db[_0x5ed9('0x44')][_0x5ed9('0x5f')]({'where':{'id':_0x442215[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x4d6f15,null))['then'](removeEntity(_0x4d6f15,null))[_0x5ed9('0x2d')](handleError(_0x4d6f15,null));};exports[_0x5ed9('0x68')]=function(_0x5703e6,_0x5cf1e0){return db[_0x5ed9('0x44')][_0x5ed9('0x68')]()[_0x5ed9('0x22')](respondWithResult(_0x5cf1e0,null))[_0x5ed9('0x2d')](handleError(_0x5cf1e0,null));};exports[_0x5ed9('0x69')]=function(_0x2f17ed,_0x483b4f,_0xbf0b31){var _0xc7e46b={'raw':!![],'where':{}},_0x3b1f1a={},_0x628ba1;return db[_0x5ed9('0x44')]['findOne']({'where':{'id':_0x2f17ed['params']['id']}})['then'](handleEntityNotFound(_0x483b4f,null))['then'](function(_0x10a13b){if(_0x10a13b){_0x628ba1=_0x10a13b['get']({'plain':!![]});_0x3b1f1a[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db['UserChatQueue'][_0x5ed9('0x5d')]);_0x3b1f1a[_0x5ed9('0x48')]=_['keys'](_0x2f17ed[_0x5ed9('0x48')]);_0x3b1f1a[_0x5ed9('0x49')]=_[_0x5ed9('0x4a')](_0x3b1f1a[_0x5ed9('0x47')],_0x3b1f1a[_0x5ed9('0x48')]);_0xc7e46b[_0x5ed9('0x4c')]=_[_0x5ed9('0x4a')](_0x3b1f1a[_0x5ed9('0x47')],qs['fields'](_0x2f17ed[_0x5ed9('0x48')]['fields']));_0xc7e46b[_0x5ed9('0x4c')]=_0xc7e46b[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0xc7e46b[_0x5ed9('0x4c')]:_0x3b1f1a[_0x5ed9('0x47')];if(!_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x4e')]('nolimit')){_0xc7e46b[_0x5ed9('0x32')]=qs[_0x5ed9('0x32')](_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x32')]);_0xc7e46b[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x2f17ed['query'][_0x5ed9('0x30')]);}_0xc7e46b[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0xc7e46b[_0x5ed9('0x52')]=qs['filters'](_['pick'](_0x2f17ed[_0x5ed9('0x48')],_0x3b1f1a[_0x5ed9('0x49')]));_0xc7e46b[_0x5ed9('0x52')]['ChatQueueId']=_0x10a13b['id'];if(_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0xc7e46b['where']=_[_0x5ed9('0x55')](_0xc7e46b[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0xc7e46b['attributes'],function(_0xc63322){var _0x5bd69b={};_0x5bd69b[_0xc63322]={'$like':'%'+_0x2f17ed[_0x5ed9('0x48')][_0x5ed9('0x54')]+'%'};return _0x5bd69b;})});}_0xc7e46b=_[_0x5ed9('0x55')]({},_0xc7e46b,_0x2f17ed[_0x5ed9('0x56')]);return db[_0x5ed9('0x6a')]['findAll'](_0xc7e46b);}})['then'](function(_0x9fd27){if(_0x9fd27){return db['User'][_0x5ed9('0x6b')]({'where':{'id':_[_0x5ed9('0x43')](_0x9fd27,'UserId'),'role':_0x5ed9('0x6c')},'attributes':['id','name',_0x5ed9('0x6d'),_0x5ed9('0x6e'),'createdAt']});}})[_0x5ed9('0x22')](function(_0x4ea298){if(_0x4ea298){return{'count':_0x4ea298[_0x5ed9('0x33')],'rows':_[_0x5ed9('0x43')](_0x4ea298[_0x5ed9('0x59')],function(_0x2626ce){return{'membername':_0x2626ce[_0x5ed9('0x40')],'UserId':_0x2626ce['id'],'queue_name':_0x628ba1[_0x5ed9('0x40')],'ChatQueueId':_0x628ba1['id'],'interface':util['format']('%s/%s',_0x5ed9('0x6f'),_0x2626ce[_0x5ed9('0x40')]),'penalty':0x0,'paused':_0x2626ce[_0x5ed9('0x6d')],'createdAt':_0x2626ce[_0x5ed9('0x70')],'updatedAt':_0x2626ce[_0x5ed9('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5ed9('0x22')](respondWithFilteredResult(_0x483b4f,_0xc7e46b))['catch'](handleError(_0x483b4f,null));};exports['getTeams']=function(_0x43fb7e,_0x246eaf,_0x517cc7){var _0x29395e={};var _0x4c86cb={};var _0x2dcccd;var _0x466b91;return db[_0x5ed9('0x44')][_0x5ed9('0x71')]({'where':{'id':_0x43fb7e[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x246eaf,null))[_0x5ed9('0x22')](function(_0x3fbf03){if(_0x3fbf03){_0x2dcccd=_0x3fbf03;_0x4c86cb[_0x5ed9('0x47')]=_[_0x5ed9('0x5c')](db[_0x5ed9('0x72')]['rawAttributes']);_0x4c86cb[_0x5ed9('0x48')]=_['keys'](_0x43fb7e[_0x5ed9('0x48')]);_0x4c86cb[_0x5ed9('0x49')]=_['intersection'](_0x4c86cb['model'],_0x4c86cb[_0x5ed9('0x48')]);_0x29395e['attributes']=_[_0x5ed9('0x4a')](_0x4c86cb[_0x5ed9('0x47')],qs[_0x5ed9('0x4b')](_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x29395e[_0x5ed9('0x4c')]=_0x29395e[_0x5ed9('0x4c')]['length']?_0x29395e[_0x5ed9('0x4c')]:_0x4c86cb[_0x5ed9('0x47')];_0x29395e[_0x5ed9('0x50')]=qs[_0x5ed9('0x51')](_0x43fb7e[_0x5ed9('0x48')]['sort']);_0x29395e[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_['pick'](_0x43fb7e[_0x5ed9('0x48')],_0x4c86cb[_0x5ed9('0x49')]));if(_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x54')]){_0x29395e[_0x5ed9('0x52')]=_[_0x5ed9('0x55')](_0x29395e[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x29395e['attributes'],function(_0xfbf41f){var _0x17f096={};_0x17f096[_0xfbf41f]={'$like':'%'+_0x43fb7e[_0x5ed9('0x48')]['filter']+'%'};return _0x17f096;})});}_0x29395e=_[_0x5ed9('0x55')]({},_0x29395e,_0x43fb7e['options']);return _0x2dcccd[_0x5ed9('0x73')](_0x29395e);}})[_0x5ed9('0x22')](function(_0x3f25cc){if(_0x3f25cc){_0x466b91=_0x3f25cc[_0x5ed9('0x4d')];if(!_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x4e')]('nolimit')){_0x29395e[_0x5ed9('0x32')]=qs[_0x5ed9('0x32')](_0x43fb7e[_0x5ed9('0x48')][_0x5ed9('0x32')]);_0x29395e[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x43fb7e['query']['offset']);}return _0x2dcccd[_0x5ed9('0x73')](_0x29395e);}})[_0x5ed9('0x22')](function(_0x1c835a){if(_0x1c835a){return _0x1c835a?{'count':_0x466b91,'rows':_0x1c835a}:null;}})[_0x5ed9('0x22')](respondWithResult(_0x246eaf,null))[_0x5ed9('0x2d')](handleError(_0x246eaf,null));};exports[_0x5ed9('0x74')]=function(_0x21be2f,_0x5e95ce,_0x388ddd){var _0x4011ad=_0x21be2f['body'][_0x5ed9('0x75')];return db['Team'][_0x5ed9('0x58')]({'where':{'id':_0x4011ad},'attributes':['id'],'include':[{'model':db[_0x5ed9('0x76')],'as':'Agents','attributes':['id',_0x5ed9('0x40'),_0x5ed9('0x77'),_0x5ed9('0x78'),'interface'],'raw':!![]}]})[_0x5ed9('0x22')](function(_0x112347){if(_0x112347){var _0x70e4e=_[_0x5ed9('0x79')](_0x112347,function(_0x59f4af){var _0x332ee6=_0x59f4af['get']({'plain':!![]});return _0x332ee6['Agents'];});return db['ChatQueue'][_0x5ed9('0x5f')]({'where':{'id':_0x21be2f[_0x5ed9('0x5b')]['id']}})['then'](function(_0x18a44c){return db[_0x5ed9('0x7a')][_0x5ed9('0x7b')](function(_0x241b70){return _0x18a44c[_0x5ed9('0x74')](_0x4011ad,{'transaction':_0x241b70})['then'](function(){return BPromise[_0x5ed9('0x7c')](_0x70e4e,function(_0xaccc85){return db['UserChatQueue'][_0x5ed9('0x7d')]({'where':{'UserId':_0xaccc85['id'],'ChatQueueId':_0x21be2f['params']['id']},'transaction':_0x241b70});});})[_0x5ed9('0x22')](function(){_0x70e4e[_0x5ed9('0x7e')](function(_0x27faa4){socket[_0x5ed9('0x7f')](_0x5ed9('0x80'),{'UserId':_0x27faa4['id'],'ChatQueueId':_0x18a44c['id']});});});});});}})[_0x5ed9('0x22')](respondWithStatusCode(_0x5e95ce,null))[_0x5ed9('0x2d')](handleError(_0x5e95ce,null));};exports[_0x5ed9('0x81')]=function(_0x8cee17,_0x861768,_0x2e68d7){return db[_0x5ed9('0x72')][_0x5ed9('0x58')]({'where':{'id':_0x8cee17[_0x5ed9('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5ed9('0x76')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5ed9('0x22')](handleEntityNotFound(_0x861768,null))['then'](function(_0x3fbdd7){var _0x5e0cf0=_['map'](_0x3fbdd7,'id');var _0x2af98e=[];var _0x2b24ad=[];var _0x11af3e=squel['select']();_0x11af3e[_0x5ed9('0x82')](_0x5ed9('0x83'))[_0x5ed9('0x84')](_0x5ed9('0x85'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5ed9('0x52')](_0x5ed9('0x86'),_0x8cee17['params']['id']);for(var _0x134ba1=0x0;_0x134ba1<_0x3fbdd7[_0x5ed9('0x4d')];_0x134ba1+=0x1){let _0x18364b=_0x3fbdd7[_0x134ba1];for(var _0x43c907=0x0;_0x43c907<_0x18364b[_0x5ed9('0x87')][_0x5ed9('0x4d')];_0x43c907+=0x1){let _0x5153ec=_0x18364b[_0x5ed9('0x87')][_0x43c907];var _0x4f91b6=_0x11af3e[_0x5ed9('0x88')]();_0x4f91b6['where']('ut.UserId\x20=\x20?',_0x5153ec['id']);_0x2b24ad[_0x5ed9('0x89')](db[_0x5ed9('0x7a')]['query'](_0x4f91b6[_0x5ed9('0x8a')](),{'type':db[_0x5ed9('0x7a')][_0x5ed9('0x8b')][_0x5ed9('0x8c')]})[_0x5ed9('0x22')](function(_0x4882d9){if(_0x4882d9[_0x5ed9('0x4d')]===0x1){return _0x5153ec['id'];}else{var _0x16a98b=_[_0x5ed9('0x8d')](_[_0x5ed9('0x43')](_0x4882d9,_0x5ed9('0x8e')),function(_0x3c66ee){return _[_0x5ed9('0x8f')](_0x5e0cf0,_0x3c66ee);});if(_0x16a98b){return _0x5153ec['id'];}}}));}}return BPromise['all'](_0x2b24ad)[_0x5ed9('0x22')](function(_0x30fab9){_0x2af98e=_(_0x2af98e)[_0x5ed9('0x90')](_0x30fab9)[_0x5ed9('0x91')]()[_0x5ed9('0x92')]();return db[_0x5ed9('0x44')][_0x5ed9('0x5f')]({'where':{'id':_0x8cee17[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](function(_0x9fa205){return db[_0x5ed9('0x7a')]['transaction'](function(_0x3e9030){return _0x9fa205['removeTeams'](_0x8cee17[_0x5ed9('0x48')][_0x5ed9('0x75')],{'transaction':_0x3e9030})['then'](function(){if(!_[_0x5ed9('0x93')](_0x2af98e)){return _0x9fa205[_0x5ed9('0x94')](_0x2af98e,{'transaction':_0x3e9030});}})[_0x5ed9('0x22')](function(){_0x2af98e['forEach'](function(_0xd12b27){socket[_0x5ed9('0x7f')](_0x5ed9('0x95'),{'UserId':_0xd12b27,'ChatQueueId':_0x9fa205['id']});});});});});});})['then'](respondWithStatusCode(_0x861768,null))[_0x5ed9('0x2d')](handleError(_0x861768,null));};exports['addAgents']=function(_0x29501f,_0x169785,_0x597300){return db[_0x5ed9('0x44')]['find']({'where':{'id':_0x29501f['params']['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x169785,null))[_0x5ed9('0x22')](function(_0x57ddc4){if(_0x57ddc4){return _0x57ddc4[_0x5ed9('0x96')](_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')],_[_0x5ed9('0x97')](_0x29501f['body'],[_0x5ed9('0x75'),'id'])||{})[_0x5ed9('0x98')](function(_0x34fc1d){for(var _0x1d696e=0x0;_0x1d696e<_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')][_0x5ed9('0x4d')];_0x1d696e+=0x1){socket[_0x5ed9('0x7f')]('userChatQueue:save',{'UserId':Number(_0x29501f[_0x5ed9('0x61')][_0x5ed9('0x75')][_0x1d696e]),'ChatQueueId':Number(_0x29501f[_0x5ed9('0x5b')]['id'])});}return _0x34fc1d;});}})['then'](respondWithResult(_0x169785,null))['catch'](handleError(_0x169785,null));};exports[_0x5ed9('0x94')]=function(_0x404ce6,_0x19b4b3,_0x2b53d5){return db['ChatQueue'][_0x5ed9('0x5f')]({'where':{'id':_0x404ce6[_0x5ed9('0x5b')]['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x19b4b3,null))[_0x5ed9('0x22')](function(_0x41ae3a){if(_0x41ae3a){return _0x41ae3a[_0x5ed9('0x94')](_0x404ce6[_0x5ed9('0x48')][_0x5ed9('0x75')])[_0x5ed9('0x22')](function(){if(_[_0x5ed9('0x99')](_0x404ce6['query'][_0x5ed9('0x75')])){for(var _0x557102=0x0;_0x557102<_0x404ce6[_0x5ed9('0x48')]['ids'][_0x5ed9('0x4d')];_0x557102+=0x1){socket[_0x5ed9('0x7f')](_0x5ed9('0x95'),{'UserId':Number(_0x404ce6[_0x5ed9('0x48')][_0x5ed9('0x75')][_0x557102]),'ChatQueueId':Number(_0x404ce6['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x404ce6['query'][_0x5ed9('0x75')]),'ChatQueueId':Number(_0x404ce6[_0x5ed9('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x19b4b3,null))['catch'](handleError(_0x19b4b3,null));};exports['getAgents']=function(_0x68e47e,_0x2a1949,_0x509344){var _0x4a084f={};var _0x2ed3c0={};var _0x12f397;var _0x16bedd;return db[_0x5ed9('0x44')][_0x5ed9('0x71')]({'where':{'id':_0x68e47e['params']['id']}})[_0x5ed9('0x22')](handleEntityNotFound(_0x2a1949,null))['then'](function(_0xc7708){if(_0xc7708){_0x12f397=_0xc7708;_0x2ed3c0['model']=_['keys'](db[_0x5ed9('0x76')][_0x5ed9('0x5d')]);_0x2ed3c0[_0x5ed9('0x48')]=_[_0x5ed9('0x5c')](_0x68e47e[_0x5ed9('0x48')]);_0x2ed3c0['filters']=_[_0x5ed9('0x4a')](_0x2ed3c0[_0x5ed9('0x47')],_0x2ed3c0[_0x5ed9('0x48')]);_0x4a084f[_0x5ed9('0x4c')]=_['intersection'](_0x2ed3c0['model'],qs[_0x5ed9('0x4b')](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x4b')]));_0x4a084f[_0x5ed9('0x4c')]=_0x4a084f[_0x5ed9('0x4c')][_0x5ed9('0x4d')]?_0x4a084f[_0x5ed9('0x4c')]:_0x2ed3c0[_0x5ed9('0x47')];_0x4a084f[_0x5ed9('0x50')]=qs['sort'](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x51')]);_0x4a084f[_0x5ed9('0x52')]=qs[_0x5ed9('0x49')](_[_0x5ed9('0x53')](_0x68e47e['query'],_0x2ed3c0[_0x5ed9('0x49')]));if(_0x68e47e['query']['filter']){_0x4a084f['where']=_[_0x5ed9('0x55')](_0x4a084f[_0x5ed9('0x52')],{'$or':_[_0x5ed9('0x43')](_0x4a084f[_0x5ed9('0x4c')],function(_0x21fcc3){var _0x235c94={};_0x235c94[_0x21fcc3]={'$like':'%'+_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x54')]+'%'};return _0x235c94;})});}_0x4a084f=_['merge']({},_0x4a084f,_0x68e47e[_0x5ed9('0x56')]);return _0x12f397[_0x5ed9('0x9a')](_0x4a084f);}})[_0x5ed9('0x22')](function(_0x42c156){if(_0x42c156){_0x16bedd=_0x42c156[_0x5ed9('0x4d')];if(!_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x4e')](_0x5ed9('0x4f'))){_0x4a084f[_0x5ed9('0x32')]=qs['limit'](_0x68e47e['query'][_0x5ed9('0x32')]);_0x4a084f[_0x5ed9('0x30')]=qs[_0x5ed9('0x30')](_0x68e47e[_0x5ed9('0x48')][_0x5ed9('0x30')]);}return _0x12f397[_0x5ed9('0x9a')](_0x4a084f);}})['then'](function(_0x5b5aeb){if(_0x5b5aeb){return _0x5b5aeb?{'count':_0x16bedd,'rows':_0x5b5aeb}:null;}})[_0x5ed9('0x22')](respondWithResult(_0x2a1949,null))[_0x5ed9('0x2d')](handleError(_0x2a1949,null));}; \ No newline at end of file +var _0x7fec=['fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','ChatQueue','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','sort','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','format','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x7fec,0x128));var _0xc7fe=function(_0x339150,_0x109c60){_0x339150=_0x339150-0x0;var _0x222333=_0x7fec[_0x339150];return _0x222333;};'use strict';var emlformat=require(_0xc7fe('0x0'));var rimraf=require(_0xc7fe('0x1'));var zipdir=require(_0xc7fe('0x2'));var jsonpatch=require(_0xc7fe('0x3'));var rp=require(_0xc7fe('0x4'));var moment=require(_0xc7fe('0x5'));var BPromise=require(_0xc7fe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc7fe('0x7'));var sox=require(_0xc7fe('0x8'));var csv=require('to-csv');var ejs=require(_0xc7fe('0x9'));var fs=require('fs');var fs_extra=require(_0xc7fe('0xa'));var _=require('lodash');var squel=require(_0xc7fe('0xb'));var crypto=require(_0xc7fe('0xc'));var jsforce=require(_0xc7fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc7fe('0xe'));var querystring=require('querystring');var Papa=require(_0xc7fe('0xf'));var Redis=require(_0xc7fe('0x10'));var authService=require(_0xc7fe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc7fe('0x12'));var hardwareService=require(_0xc7fe('0x13'));var logger=require(_0xc7fe('0x14'))(_0xc7fe('0x15'));var utils=require(_0xc7fe('0x16'));var config=require(_0xc7fe('0x17'));var licenseUtil=require(_0xc7fe('0x18'));var db=require(_0xc7fe('0x19'))['db'];config['redis']=_[_0xc7fe('0x1a')](config[_0xc7fe('0x1b')],{'host':_0xc7fe('0x1c'),'port':0x18eb});var socket=require(_0xc7fe('0x1d'))(new Redis(config[_0xc7fe('0x1b')]));require('./chatQueue.socket')[_0xc7fe('0x1e')](socket);var jayson=require(_0xc7fe('0x1f'));var client=jayson[_0xc7fe('0x20')][_0xc7fe('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x150aaf,_0x203d1b,_0x52c60e,_0x1b061d){return new BPromise(function(_0x3fc4c5,_0x1d1bf8){var _0x35b059=_0x1b061d||client;return _0x35b059['request'](_0x150aaf,_0x52c60e)[_0xc7fe('0x22')](function(_0xc775b0){logger[_0xc7fe('0x23')](_0xc7fe('0x24'),_0x203d1b,_0xc7fe('0x25'));logger[_0xc7fe('0x26')](_0xc7fe('0x27'),_0x203d1b,_0xc7fe('0x25'),JSON[_0xc7fe('0x28')](_0xc775b0));if(_0xc775b0[_0xc7fe('0x29')]){if(_0xc775b0['error'][_0xc7fe('0x2a')]===0x1f4){logger[_0xc7fe('0x29')](_0xc7fe('0x24'),_0x203d1b,_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);return _0x1d1bf8(_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);}logger[_0xc7fe('0x29')](_0xc7fe('0x24'),_0x203d1b,_0xc775b0[_0xc7fe('0x29')][_0xc7fe('0x2b')]);return _0x3fc4c5(_0xc775b0['error'][_0xc7fe('0x2b')]);}else{logger[_0xc7fe('0x23')]('ChatQueue,\x20%s,\x20%s',_0x203d1b,_0xc7fe('0x25'));_0x3fc4c5(_0xc775b0[_0xc7fe('0x2c')][_0xc7fe('0x2b')]);}})[_0xc7fe('0x2d')](function(_0xafc489){logger[_0xc7fe('0x29')]('ChatQueue,\x20%s,\x20%s',_0x203d1b,_0xafc489);_0x1d1bf8(_0xafc489);});});}function respondWithStatusCode(_0x18f795,_0x3dd728){_0x3dd728=_0x3dd728||0xcc;return function(_0x152d5d){if(_0x152d5d){return _0x18f795[_0xc7fe('0x2e')](_0x3dd728);}return _0x18f795[_0xc7fe('0x2f')](_0x3dd728)[_0xc7fe('0x30')]();};}function respondWithResult(_0x37c579,_0x4a0848){_0x4a0848=_0x4a0848||0xc8;return function(_0x4e05d8){if(_0x4e05d8){return _0x37c579[_0xc7fe('0x2f')](_0x4a0848)[_0xc7fe('0x31')](_0x4e05d8);}};}function respondWithFilteredResult(_0x4c070b,_0x3098db){return function(_0x3e2b0e){if(_0x3e2b0e){var _0x31505a=typeof _0x3098db[_0xc7fe('0x32')]===_0xc7fe('0x33')&&typeof _0x3098db[_0xc7fe('0x34')]===_0xc7fe('0x33');var _0xeccfee=_0x3e2b0e[_0xc7fe('0x35')];var _0x44d736=_0x31505a?0x0:_0x3098db[_0xc7fe('0x32')];var _0xeec5ce=_0x31505a?_0x3e2b0e[_0xc7fe('0x35')]:_0x3098db[_0xc7fe('0x32')]+_0x3098db[_0xc7fe('0x34')];var _0x1b4254;if(_0xeec5ce>=_0xeccfee){_0xeec5ce=_0xeccfee;_0x1b4254=0xc8;}else{_0x1b4254=0xce;}_0x4c070b['status'](_0x1b4254);return _0x4c070b[_0xc7fe('0x36')](_0xc7fe('0x37'),_0x44d736+'-'+_0xeec5ce+'/'+_0xeccfee)[_0xc7fe('0x31')](_0x3e2b0e);}return null;};}function patchUpdates(_0x48c58d){return function(_0x3aa1b3){try{jsonpatch['apply'](_0x3aa1b3,_0x48c58d,!![]);}catch(_0x5f143d){return BPromise[_0xc7fe('0x38')](_0x5f143d);}return _0x3aa1b3[_0xc7fe('0x39')]();};}function saveUpdates(_0x52280f,_0x34c4ec){return function(_0x5020ac){if(_0x5020ac){return _0x5020ac['update'](_0x52280f)[_0xc7fe('0x22')](function(_0x594b78){return _0x594b78;});}return null;};}function removeEntity(_0xd5ca2e,_0x49953e){return function(_0x4ab5a5){if(_0x4ab5a5){return _0x4ab5a5[_0xc7fe('0x3a')]()[_0xc7fe('0x22')](function(){var _0x41c121=_0x4ab5a5[_0xc7fe('0x3b')]({'plain':!![]});var _0x5c9b4a=_0xc7fe('0x3c');return db[_0xc7fe('0x3d')][_0xc7fe('0x3a')]({'where':{'type':_0x5c9b4a,'resourceId':_0x41c121['id']}})['then'](function(){return _0x4ab5a5;});})[_0xc7fe('0x22')](function(){_0xd5ca2e[_0xc7fe('0x2f')](0xcc)[_0xc7fe('0x30')]();});}};}function handleEntityNotFound(_0x7e8651,_0x8c43a){return function(_0x449f5b){if(!_0x449f5b){_0x7e8651[_0xc7fe('0x2e')](0x194);}return _0x449f5b;};}function handleError(_0x5cdede,_0x329fc7){_0x329fc7=_0x329fc7||0x1f4;return function(_0x2a66ff){logger[_0xc7fe('0x29')](_0x2a66ff[_0xc7fe('0x3e')]);if(_0x2a66ff[_0xc7fe('0x3f')]){delete _0x2a66ff[_0xc7fe('0x3f')];}_0x5cdede[_0xc7fe('0x2f')](_0x329fc7)[_0xc7fe('0x40')](_0x2a66ff);};}exports['index']=function(_0x14d640,_0x4ab194){var _0xc556fc={},_0x59a184={},_0x4a5810={'count':0x0,'rows':[]};var _0x2b5245=_['map'](db['ChatQueue'][_0xc7fe('0x41')],function(_0x45bfe7){return{'name':_0x45bfe7['fieldName'],'type':_0x45bfe7[_0xc7fe('0x42')][_0xc7fe('0x43')]};});_0x59a184[_0xc7fe('0x44')]=_['map'](_0x2b5245,_0xc7fe('0x3f'));_0x59a184[_0xc7fe('0x45')]=_[_0xc7fe('0x46')](_0x14d640[_0xc7fe('0x45')]);_0x59a184[_0xc7fe('0x47')]=_['intersection'](_0x59a184[_0xc7fe('0x44')],_0x59a184[_0xc7fe('0x45')]);_0xc556fc[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x59a184['model'],qs[_0xc7fe('0x4a')](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0xc556fc[_0xc7fe('0x48')]=_0xc556fc[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0xc556fc[_0xc7fe('0x48')]:_0x59a184[_0xc7fe('0x44')];if(!_0x14d640['query'][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0xc556fc[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x34')]);_0xc556fc['offset']=qs['offset'](_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x32')]);}_0xc556fc[_0xc7fe('0x4e')]=qs['sort'](_0x14d640[_0xc7fe('0x45')]['sort']);_0xc556fc[_0xc7fe('0x4f')]=qs['filters'](_[_0xc7fe('0x50')](_0x14d640[_0xc7fe('0x45')],_0x59a184['filters']),_0x2b5245);if(_0x14d640['query'][_0xc7fe('0x51')]){_0xc556fc[_0xc7fe('0x4f')]=_['merge'](_0xc556fc['where'],{'$or':_[_0xc7fe('0x52')](_0x2b5245,function(_0x53c8dd){if(_0x53c8dd['type']!==_0xc7fe('0x53')){var _0x23827d={};_0x23827d[_0x53c8dd[_0xc7fe('0x3f')]]={'$like':'%'+_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x51')]+'%'};return _0x23827d;}})});}_0xc556fc=_[_0xc7fe('0x54')]({},_0xc556fc,_0x14d640[_0xc7fe('0x55')]);var _0x3c86a7={'where':_0xc556fc['where']};return db['ChatQueue'][_0xc7fe('0x35')](_0x3c86a7)[_0xc7fe('0x22')](function(_0xa8b85f){_0x4a5810[_0xc7fe('0x35')]=_0xa8b85f;if(_0x14d640[_0xc7fe('0x45')][_0xc7fe('0x56')]){_0xc556fc[_0xc7fe('0x57')]=[{'all':!![]}];}return db[_0xc7fe('0x58')]['findAll'](_0xc556fc);})[_0xc7fe('0x22')](function(_0x255ae6){_0x4a5810[_0xc7fe('0x59')]=_0x255ae6;return _0x4a5810;})['then'](respondWithFilteredResult(_0x4ab194,_0xc556fc))[_0xc7fe('0x2d')](handleError(_0x4ab194,null));};exports[_0xc7fe('0x5a')]=function(_0x166e23,_0xc97d79){var _0x584d10={'raw':!![],'where':{'id':_0x166e23[_0xc7fe('0x5b')]['id']}},_0x16af92={};_0x16af92[_0xc7fe('0x44')]=_['keys'](db[_0xc7fe('0x58')][_0xc7fe('0x41')]);_0x16af92['query']=_[_0xc7fe('0x46')](_0x166e23[_0xc7fe('0x45')]);_0x16af92[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x16af92[_0xc7fe('0x44')],_0x16af92[_0xc7fe('0x45')]);_0x584d10['attributes']=_[_0xc7fe('0x49')](_0x16af92[_0xc7fe('0x44')],qs['fields'](_0x166e23[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0x584d10['attributes']=_0x584d10[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0x584d10[_0xc7fe('0x48')]:_0x16af92['model'];if(_0x166e23[_0xc7fe('0x45')]['includeAll']){_0x584d10[_0xc7fe('0x57')]=[{'all':!![]}];}_0x584d10=_['merge']({},_0x584d10,_0x166e23[_0xc7fe('0x55')]);return db[_0xc7fe('0x58')][_0xc7fe('0x5c')](_0x584d10)[_0xc7fe('0x22')](handleEntityNotFound(_0xc97d79,null))[_0xc7fe('0x22')](respondWithResult(_0xc97d79,null))[_0xc7fe('0x2d')](handleError(_0xc97d79,null));};exports['create']=function(_0x97f041,_0x346209){return db[_0xc7fe('0x58')][_0xc7fe('0x5d')](_0x97f041[_0xc7fe('0x5e')],{})[_0xc7fe('0x22')](function(_0x46577a){var _0x3da62d=_0x97f041[_0xc7fe('0x5f')][_0xc7fe('0x3b')]({'plain':!![]});if(!_0x3da62d)throw new Error(_0xc7fe('0x60'));if(_0x3da62d['role']==='user'){var _0x385049=_0x46577a[_0xc7fe('0x3b')]({'plain':!![]});var _0xa26c51='ChatQueues';return db[_0xc7fe('0x61')][_0xc7fe('0x5c')]({'where':{'name':_0xa26c51,'userProfileId':_0x3da62d[_0xc7fe('0x62')]},'raw':!![]})[_0xc7fe('0x22')](function(_0xd166ea){if(_0xd166ea&&_0xd166ea[_0xc7fe('0x63')]===0x0){return db[_0xc7fe('0x3d')]['create']({'name':_0x385049[_0xc7fe('0x3f')],'resourceId':_0x385049['id'],'type':_0xd166ea['name'],'sectionId':_0xd166ea['id']},{})[_0xc7fe('0x22')](function(){return _0x46577a;});}else{return _0x46577a;}})['catch'](function(_0x1ca3ef){logger[_0xc7fe('0x29')](_0xc7fe('0x64'),_0x1ca3ef);throw _0x1ca3ef;});}return _0x46577a;})[_0xc7fe('0x22')](respondWithResult(_0x346209,0xc9))['catch'](handleError(_0x346209,null));};exports['update']=function(_0x52f6ef,_0x283f0d){if(_0x52f6ef[_0xc7fe('0x5e')]['id']){delete _0x52f6ef[_0xc7fe('0x5e')]['id'];}return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x52f6ef['params']['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x283f0d,null))['then'](saveUpdates(_0x52f6ef[_0xc7fe('0x5e')],null))[_0xc7fe('0x22')](respondWithResult(_0x283f0d,null))['catch'](handleError(_0x283f0d,null));};exports[_0xc7fe('0x3a')]=function(_0x9e6558,_0x220fc1){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x9e6558[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x220fc1,null))[_0xc7fe('0x22')](removeEntity(_0x220fc1,null))[_0xc7fe('0x2d')](handleError(_0x220fc1,null));};exports[_0xc7fe('0x65')]=function(_0x2cfab4,_0x529e27){return db['ChatQueue'][_0xc7fe('0x65')]()[_0xc7fe('0x22')](respondWithResult(_0x529e27,null))[_0xc7fe('0x2d')](handleError(_0x529e27,null));};exports[_0xc7fe('0x66')]=function(_0x1f54b1,_0x5e23fc,_0x530541){var _0x4ddf42={'raw':!![],'where':{}},_0x23c298={},_0x29727b;return db[_0xc7fe('0x58')]['findOne']({'where':{'id':_0x1f54b1[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x5e23fc,null))['then'](function(_0x50946a){if(_0x50946a){_0x29727b=_0x50946a['get']({'plain':!![]});_0x23c298[_0xc7fe('0x44')]=_['keys'](db[_0xc7fe('0x67')][_0xc7fe('0x41')]);_0x23c298['query']=_[_0xc7fe('0x46')](_0x1f54b1[_0xc7fe('0x45')]);_0x23c298[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x23c298['model'],_0x23c298[_0xc7fe('0x45')]);_0x4ddf42[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x23c298[_0xc7fe('0x44')],qs[_0xc7fe('0x4a')](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x4a')]));_0x4ddf42['attributes']=_0x4ddf42[_0xc7fe('0x48')]['length']?_0x4ddf42[_0xc7fe('0x48')]:_0x23c298[_0xc7fe('0x44')];if(!_0x1f54b1['query'][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x4ddf42[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x1f54b1[_0xc7fe('0x45')]['limit']);_0x4ddf42[_0xc7fe('0x32')]=qs['offset'](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x32')]);}_0x4ddf42[_0xc7fe('0x4e')]=qs[_0xc7fe('0x68')](_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x68')]);_0x4ddf42[_0xc7fe('0x4f')]=qs['filters'](_[_0xc7fe('0x50')](_0x1f54b1['query'],_0x23c298[_0xc7fe('0x47')]));_0x4ddf42[_0xc7fe('0x4f')][_0xc7fe('0x69')]=_0x50946a['id'];if(_0x1f54b1['query'][_0xc7fe('0x51')]){_0x4ddf42[_0xc7fe('0x4f')]=_['merge'](_0x4ddf42[_0xc7fe('0x4f')],{'$or':_[_0xc7fe('0x52')](_0x4ddf42[_0xc7fe('0x48')],function(_0x5cfc1c){var _0x386050={};_0x386050[_0x5cfc1c]={'$like':'%'+_0x1f54b1[_0xc7fe('0x45')][_0xc7fe('0x51')]+'%'};return _0x386050;})});}_0x4ddf42=_[_0xc7fe('0x54')]({},_0x4ddf42,_0x1f54b1['options']);return db[_0xc7fe('0x67')][_0xc7fe('0x6a')](_0x4ddf42);}})['then'](function(_0x131567){if(_0x131567){return db[_0xc7fe('0x6b')][_0xc7fe('0x6c')]({'where':{'id':_[_0xc7fe('0x52')](_0x131567,_0xc7fe('0x6d')),'role':_0xc7fe('0x6e')},'attributes':['id',_0xc7fe('0x3f'),_0xc7fe('0x6f'),'updatedAt','createdAt']});}})['then'](function(_0x3f42ab){if(_0x3f42ab){return{'count':_0x3f42ab[_0xc7fe('0x35')],'rows':_['map'](_0x3f42ab[_0xc7fe('0x59')],function(_0x366405){return{'membername':_0x366405[_0xc7fe('0x3f')],'UserId':_0x366405['id'],'queue_name':_0x29727b['name'],'ChatQueueId':_0x29727b['id'],'interface':util[_0xc7fe('0x70')]('%s/%s',_0xc7fe('0x71'),_0x366405[_0xc7fe('0x3f')]),'penalty':0x0,'paused':_0x366405[_0xc7fe('0x6f')],'createdAt':_0x366405[_0xc7fe('0x72')],'updatedAt':_0x366405['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7fe('0x22')](respondWithFilteredResult(_0x5e23fc,_0x4ddf42))['catch'](handleError(_0x5e23fc,null));};exports[_0xc7fe('0x73')]=function(_0x2aad39,_0x3276e1,_0x1cd56d){var _0x3240fc={};var _0x3d146b={};var _0x32ad8;var _0x5a5e03;return db[_0xc7fe('0x58')]['findOne']({'where':{'id':_0x2aad39[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x3276e1,null))[_0xc7fe('0x22')](function(_0x163c16){if(_0x163c16){_0x32ad8=_0x163c16;_0x3d146b['model']=_[_0xc7fe('0x46')](db[_0xc7fe('0x74')][_0xc7fe('0x41')]);_0x3d146b[_0xc7fe('0x45')]=_['keys'](_0x2aad39[_0xc7fe('0x45')]);_0x3d146b[_0xc7fe('0x47')]=_[_0xc7fe('0x49')](_0x3d146b['model'],_0x3d146b[_0xc7fe('0x45')]);_0x3240fc[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x3d146b[_0xc7fe('0x44')],qs[_0xc7fe('0x4a')](_0x2aad39['query']['fields']));_0x3240fc[_0xc7fe('0x48')]=_0x3240fc[_0xc7fe('0x48')][_0xc7fe('0x4b')]?_0x3240fc[_0xc7fe('0x48')]:_0x3d146b[_0xc7fe('0x44')];_0x3240fc[_0xc7fe('0x4e')]=qs[_0xc7fe('0x68')](_0x2aad39[_0xc7fe('0x45')]['sort']);_0x3240fc['where']=qs['filters'](_[_0xc7fe('0x50')](_0x2aad39['query'],_0x3d146b['filters']));if(_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x51')]){_0x3240fc[_0xc7fe('0x4f')]=_[_0xc7fe('0x54')](_0x3240fc[_0xc7fe('0x4f')],{'$or':_[_0xc7fe('0x52')](_0x3240fc[_0xc7fe('0x48')],function(_0x4fc30b){var _0x8cf4cc={};_0x8cf4cc[_0x4fc30b]={'$like':'%'+_0x2aad39[_0xc7fe('0x45')]['filter']+'%'};return _0x8cf4cc;})});}_0x3240fc=_[_0xc7fe('0x54')]({},_0x3240fc,_0x2aad39[_0xc7fe('0x55')]);return _0x32ad8[_0xc7fe('0x73')](_0x3240fc);}})[_0xc7fe('0x22')](function(_0x21c33f){if(_0x21c33f){_0x5a5e03=_0x21c33f[_0xc7fe('0x4b')];if(!_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x3240fc[_0xc7fe('0x34')]=qs[_0xc7fe('0x34')](_0x2aad39[_0xc7fe('0x45')]['limit']);_0x3240fc[_0xc7fe('0x32')]=qs[_0xc7fe('0x32')](_0x2aad39[_0xc7fe('0x45')][_0xc7fe('0x32')]);}return _0x32ad8['getTeams'](_0x3240fc);}})['then'](function(_0x2ab78f){if(_0x2ab78f){return _0x2ab78f?{'count':_0x5a5e03,'rows':_0x2ab78f}:null;}})['then'](respondWithResult(_0x3276e1,null))[_0xc7fe('0x2d')](handleError(_0x3276e1,null));};exports[_0xc7fe('0x75')]=function(_0x4b547e,_0x5e27e5,_0x33203a){var _0x6257c0=_0x4b547e[_0xc7fe('0x5e')][_0xc7fe('0x76')];return db[_0xc7fe('0x74')][_0xc7fe('0x6a')]({'where':{'id':_0x6257c0},'attributes':['id'],'include':[{'model':db[_0xc7fe('0x6b')],'as':_0xc7fe('0x77'),'attributes':['id',_0xc7fe('0x3f'),'online','voicePause',_0xc7fe('0x78')],'raw':!![]}]})[_0xc7fe('0x22')](function(_0xd77d28){if(_0xd77d28){var _0x53e732=_['flatMap'](_0xd77d28,function(_0x11836c){var _0x10345d=_0x11836c[_0xc7fe('0x3b')]({'plain':!![]});return _0x10345d['Agents'];});return db['ChatQueue'][_0xc7fe('0x5c')]({'where':{'id':_0x4b547e[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](function(_0x36cbc6){return db[_0xc7fe('0x79')][_0xc7fe('0x7a')](function(_0x2a41b7){return _0x36cbc6[_0xc7fe('0x75')](_0x6257c0,{'transaction':_0x2a41b7})[_0xc7fe('0x22')](function(){return BPromise[_0xc7fe('0x7b')](_0x53e732,function(_0x2ab1fe){return db[_0xc7fe('0x67')][_0xc7fe('0x7c')]({'where':{'UserId':_0x2ab1fe['id'],'ChatQueueId':_0x4b547e['params']['id']},'transaction':_0x2a41b7});});})[_0xc7fe('0x22')](function(){_0x53e732[_0xc7fe('0x7d')](function(_0x1954a4){socket[_0xc7fe('0x7e')](_0xc7fe('0x7f'),{'UserId':_0x1954a4['id'],'ChatQueueId':_0x36cbc6['id']});});});});});}})[_0xc7fe('0x22')](respondWithStatusCode(_0x5e27e5,null))[_0xc7fe('0x2d')](handleError(_0x5e27e5,null));};exports[_0xc7fe('0x80')]=function(_0x19791f,_0x4af615,_0x45b963){return db[_0xc7fe('0x74')]['findAll']({'where':{'id':_0x19791f[_0xc7fe('0x45')][_0xc7fe('0x76')]},'attributes':['id'],'include':[{'model':db[_0xc7fe('0x6b')],'as':_0xc7fe('0x77'),'attributes':['id'],'raw':!![]}]})[_0xc7fe('0x22')](handleEntityNotFound(_0x4af615,null))[_0xc7fe('0x22')](function(_0xab13db){var _0x28ece9=_[_0xc7fe('0x52')](_0xab13db,'id');var _0x14d181=[];var _0x41aad6=[];var _0x46a694=squel['select']();_0x46a694[_0xc7fe('0x81')](_0xc7fe('0x82'))[_0xc7fe('0x83')](_0xc7fe('0x84'),'tq')[_0xc7fe('0x85')]('user_has_teams','ut',_0xc7fe('0x86'))[_0xc7fe('0x4f')](_0xc7fe('0x87'),_0x19791f[_0xc7fe('0x5b')]['id']);for(var _0x3a93e7=0x0;_0x3a93e7<_0xab13db[_0xc7fe('0x4b')];_0x3a93e7+=0x1){let _0x3f7b15=_0xab13db[_0x3a93e7];for(var _0x4d0edb=0x0;_0x4d0edb<_0x3f7b15[_0xc7fe('0x77')][_0xc7fe('0x4b')];_0x4d0edb+=0x1){let _0x354bb7=_0x3f7b15[_0xc7fe('0x77')][_0x4d0edb];var _0x1d4093=_0x46a694[_0xc7fe('0x88')]();_0x1d4093[_0xc7fe('0x4f')](_0xc7fe('0x89'),_0x354bb7['id']);_0x41aad6['push'](db[_0xc7fe('0x79')]['query'](_0x1d4093[_0xc7fe('0x8a')](),{'type':db[_0xc7fe('0x79')][_0xc7fe('0x8b')][_0xc7fe('0x8c')]})[_0xc7fe('0x22')](function(_0x8ab728){if(_0x8ab728[_0xc7fe('0x4b')]===0x1){return _0x354bb7['id'];}else{var _0x328e30=_[_0xc7fe('0x8d')](_['map'](_0x8ab728,_0xc7fe('0x8e')),function(_0x697259){return _['includes'](_0x28ece9,_0x697259);});if(_0x328e30){return _0x354bb7['id'];}}}));}}return BPromise['all'](_0x41aad6)['then'](function(_0x1b7304){_0x14d181=_(_0x14d181)[_0xc7fe('0x8f')](_0x1b7304)[_0xc7fe('0x90')]()[_0xc7fe('0x91')]();return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x19791f['params']['id']}})[_0xc7fe('0x22')](function(_0x2b79e8){return db['sequelize'][_0xc7fe('0x7a')](function(_0x53217e){return _0x2b79e8[_0xc7fe('0x80')](_0x19791f[_0xc7fe('0x45')][_0xc7fe('0x76')],{'transaction':_0x53217e})['then'](function(){if(!_[_0xc7fe('0x92')](_0x14d181)){return _0x2b79e8[_0xc7fe('0x93')](_0x14d181,{'transaction':_0x53217e});}})[_0xc7fe('0x22')](function(){_0x14d181['forEach'](function(_0x3c408d){socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':_0x3c408d,'ChatQueueId':_0x2b79e8['id']});});});});});});})[_0xc7fe('0x22')](respondWithStatusCode(_0x4af615,null))[_0xc7fe('0x2d')](handleError(_0x4af615,null));};exports[_0xc7fe('0x95')]=function(_0x638af5,_0x2335a9,_0x204bd9){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x638af5[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x2335a9,null))['then'](function(_0xb44dc9){if(_0xb44dc9){return _0xb44dc9[_0xc7fe('0x95')](_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')],_['omit'](_0x638af5[_0xc7fe('0x5e')],[_0xc7fe('0x76'),'id'])||{})[_0xc7fe('0x96')](function(_0x69303b){for(var _0x211cd8=0x0;_0x211cd8<_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')]['length'];_0x211cd8+=0x1){socket[_0xc7fe('0x7e')]('userChatQueue:save',{'UserId':Number(_0x638af5[_0xc7fe('0x5e')][_0xc7fe('0x76')][_0x211cd8]),'ChatQueueId':Number(_0x638af5[_0xc7fe('0x5b')]['id'])});}return _0x69303b;});}})[_0xc7fe('0x22')](respondWithResult(_0x2335a9,null))[_0xc7fe('0x2d')](handleError(_0x2335a9,null));};exports[_0xc7fe('0x93')]=function(_0x3c083e,_0x179a25,_0x38d709){return db[_0xc7fe('0x58')][_0xc7fe('0x5c')]({'where':{'id':_0x3c083e[_0xc7fe('0x5b')]['id']}})['then'](handleEntityNotFound(_0x179a25,null))['then'](function(_0x4c1d61){if(_0x4c1d61){return _0x4c1d61[_0xc7fe('0x93')](_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')])[_0xc7fe('0x22')](function(){if(_['isArray'](_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')])){for(var _0x4de991=0x0;_0x4de991<_0x3c083e[_0xc7fe('0x45')]['ids'][_0xc7fe('0x4b')];_0x4de991+=0x1){socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':Number(_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')][_0x4de991]),'ChatQueueId':Number(_0x3c083e[_0xc7fe('0x5b')]['id'])});}}else{socket[_0xc7fe('0x7e')](_0xc7fe('0x94'),{'UserId':Number(_0x3c083e[_0xc7fe('0x45')][_0xc7fe('0x76')]),'ChatQueueId':Number(_0x3c083e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x179a25,null))['catch'](handleError(_0x179a25,null));};exports[_0xc7fe('0x97')]=function(_0x27f614,_0x583edc,_0x42a624){var _0x37eddb={};var _0x549e17={};var _0x4e3eda;var _0x5a7e8c;return db[_0xc7fe('0x58')][_0xc7fe('0x98')]({'where':{'id':_0x27f614[_0xc7fe('0x5b')]['id']}})[_0xc7fe('0x22')](handleEntityNotFound(_0x583edc,null))['then'](function(_0x454373){if(_0x454373){_0x4e3eda=_0x454373;_0x549e17[_0xc7fe('0x44')]=_[_0xc7fe('0x46')](db[_0xc7fe('0x6b')][_0xc7fe('0x41')]);_0x549e17[_0xc7fe('0x45')]=_[_0xc7fe('0x46')](_0x27f614[_0xc7fe('0x45')]);_0x549e17['filters']=_[_0xc7fe('0x49')](_0x549e17[_0xc7fe('0x44')],_0x549e17['query']);_0x37eddb[_0xc7fe('0x48')]=_[_0xc7fe('0x49')](_0x549e17[_0xc7fe('0x44')],qs['fields'](_0x27f614['query'][_0xc7fe('0x4a')]));_0x37eddb[_0xc7fe('0x48')]=_0x37eddb[_0xc7fe('0x48')]['length']?_0x37eddb[_0xc7fe('0x48')]:_0x549e17[_0xc7fe('0x44')];_0x37eddb[_0xc7fe('0x4e')]=qs['sort'](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x68')]);_0x37eddb['where']=qs[_0xc7fe('0x47')](_[_0xc7fe('0x50')](_0x27f614[_0xc7fe('0x45')],_0x549e17['filters']));if(_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x51')]){_0x37eddb[_0xc7fe('0x4f')]=_[_0xc7fe('0x54')](_0x37eddb['where'],{'$or':_[_0xc7fe('0x52')](_0x37eddb[_0xc7fe('0x48')],function(_0x1ee6f0){var _0x442429={};_0x442429[_0x1ee6f0]={'$like':'%'+_0x27f614['query'][_0xc7fe('0x51')]+'%'};return _0x442429;})});}_0x37eddb=_['merge']({},_0x37eddb,_0x27f614['options']);return _0x4e3eda[_0xc7fe('0x97')](_0x37eddb);}})[_0xc7fe('0x22')](function(_0x265eb3){if(_0x265eb3){_0x5a7e8c=_0x265eb3[_0xc7fe('0x4b')];if(!_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x4c')](_0xc7fe('0x4d'))){_0x37eddb[_0xc7fe('0x34')]=qs['limit'](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x34')]);_0x37eddb[_0xc7fe('0x32')]=qs[_0xc7fe('0x32')](_0x27f614[_0xc7fe('0x45')][_0xc7fe('0x32')]);}return _0x4e3eda[_0xc7fe('0x97')](_0x37eddb);}})['then'](function(_0x2ef053){if(_0x2ef053){return _0x2ef053?{'count':_0x5a7e8c,'rows':_0x2ef053}:null;}})[_0xc7fe('0x22')](respondWithResult(_0x583edc,null))[_0xc7fe('0x2d')](handleError(_0x583edc,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index af093b4..d7537fc 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 _0x5824=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x5824,0x14c));var _0x4582=function(_0x124472,_0x3f6e2d){_0x124472=_0x124472-0x0;var _0x3fc192=_0x5824[_0x124472];return _0x3fc192;};'use strict';var EventEmitter=require(_0x4582('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4582('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4582('0x2')](0x0);var events={'afterCreate':_0x4582('0x3'),'afterUpdate':_0x4582('0x4'),'afterDestroy':_0x4582('0x5')};function emitEvent(_0x2d499e){return function(_0x630c6b,_0x19a9c0,_0x3f5149){ChatQueueEvents[_0x4582('0x6')](_0x2d499e+':'+_0x630c6b['id'],_0x630c6b);ChatQueueEvents[_0x4582('0x6')](_0x2d499e,_0x630c6b);_0x3f5149(null);};}for(var e in events){if(events[_0x4582('0x7')](e)){var event=events[e];ChatQueue[_0x4582('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x2cc4=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','emit'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x2cc4,0x1f3));var _0x42cc=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x2cc4[_0x504df1];return _0x1063b5;};'use strict';var EventEmitter=require(_0x42cc('0x0'));var ChatQueue=require(_0x42cc('0x1'))['db'][_0x42cc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x42cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56e2ff){return function(_0x3eb4c3,_0x217489,_0x21a59a){ChatQueueEvents[_0x42cc('0x4')](_0x56e2ff+':'+_0x3eb4c3['id'],_0x3eb4c3);ChatQueueEvents[_0x42cc('0x4')](_0x56e2ff,_0x3eb4c3);_0x21a59a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x42cc('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 24bff93..ccfa794 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 _0x9849=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x41cd97,_0x3e477a){var _0x4f39c2=function(_0x4feb10){while(--_0x4feb10){_0x41cd97['push'](_0x41cd97['shift']());}};_0x4f39c2(++_0x3e477a);}(_0x9849,0xc8));var _0x9984=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x9849[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var logger=require(_0x9984('0x2'))(_0x9984('0x3'));var moment=require(_0x9984('0x4'));var BPromise=require(_0x9984('0x5'));var rp=require(_0x9984('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9984('0x7'));var attributes=require(_0x9984('0x8'));module[_0x9984('0x9')]=function(_0x10964a,_0x3ff7fe){return _0x10964a[_0x9984('0xa')](_0x9984('0xb'),attributes,{'tableName':_0x9984('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1393=['api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x3e1134,_0x16fce7){var _0x218791=function(_0xe5635a){while(--_0xe5635a){_0x3e1134['push'](_0x3e1134['shift']());}};_0x218791(++_0x16fce7);}(_0x1393,0xcf));var _0x3139=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1393[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3139('0x0'));var util=require(_0x3139('0x1'));var logger=require(_0x3139('0x2'))(_0x3139('0x3'));var moment=require(_0x3139('0x4'));var BPromise=require('bluebird');var rp=require(_0x3139('0x5'));var fs=require('fs');var path=require(_0x3139('0x6'));var rimraf=require(_0x3139('0x7'));var config=require(_0x3139('0x8'));var attributes=require(_0x3139('0x9'));module[_0x3139('0xa')]=function(_0x572d88,_0x1bb503){return _0x572d88[_0x3139('0xb')](_0x3139('0xc'),attributes,{'tableName':_0x3139('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c200b59..cc08efd 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 _0xefda=['rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','model','map','find','where','ShowChatQueue','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b1ca2,_0x2f82ac){var _0x4f3ac5=function(_0x5cc1f0){while(--_0x5cc1f0){_0x3b1ca2['push'](_0x3b1ca2['shift']());}};_0x4f3ac5(++_0x2f82ac);}(_0xefda,0x96));var _0xaefd=function(_0x57f901,_0x37fef1){_0x57f901=_0x57f901-0x0;var _0x18863b=_0xefda[_0x57f901];return _0x18863b;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});}exports[_0xaefd('0x1b')]=function(_0x1260dd){var _0x45ebf2=this;return new Promise(function(_0x1f302c,_0x5282ed){return db[_0xaefd('0x1c')][_0xaefd('0x1d')]({'raw':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x1f')]===undefined?!![]:![]:!![],'where':_0x1260dd['options']?_0x1260dd['options']['where']||null:null,'attributes':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x20')]||null:null,'limit':_0x1260dd['options']?_0x1260dd[_0xaefd('0x1e')]['limit']||null:null,'include':_0x1260dd[_0xaefd('0x1e')]?_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x21')]?_['map'](_0x1260dd[_0xaefd('0x1e')][_0xaefd('0x21')],function(_0x18e720){return{'model':db[_0x18e720[_0xaefd('0x22')]],'as':_0x18e720['as'],'attributes':_0x18e720[_0xaefd('0x20')],'include':_0x18e720['include']?_[_0xaefd('0x23')](_0x18e720['include'],function(_0x810bf){return{'model':db[_0x810bf[_0xaefd('0x22')]],'as':_0x810bf['as'],'attributes':_0x810bf['attributes'],'include':_0x810bf[_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x810bf['include'],function(_0xbeb1b8){return{'model':db[_0xbeb1b8[_0xaefd('0x22')]],'as':_0xbeb1b8['as'],'attributes':_0xbeb1b8[_0xaefd('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f0e8){logger['info'](_0xaefd('0x1b'),_0x1260dd);logger['debug']('GetChatQueue',_0x1260dd,JSON[_0xaefd('0x15')](_0x45f0e8));_0x1f302c(_0x45f0e8);})[_0xaefd('0x1a')](function(_0x4a032d){logger['error']('GetChatQueue',_0x4a032d[_0xaefd('0x18')],_0x1260dd);_0x5282ed(_0x45ebf2[_0xaefd('0x16')](0x1f4,_0x4a032d['message']));});});};exports['ShowChatQueue']=function(_0x62ef86){var _0x465d99=this;return new Promise(function(_0x3f4947,_0x21d358){return db['ChatQueue'][_0xaefd('0x24')]({'raw':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x1f')]===undefined?!![]:![]:!![],'where':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x25')]||null:null,'attributes':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x20')]||null:null,'include':_0x62ef86[_0xaefd('0x1e')]?_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x62ef86[_0xaefd('0x1e')][_0xaefd('0x21')],function(_0x554e48){return{'model':db[_0x554e48[_0xaefd('0x22')]],'as':_0x554e48['as'],'attributes':_0x554e48[_0xaefd('0x20')],'include':_0x554e48[_0xaefd('0x21')]?_['map'](_0x554e48[_0xaefd('0x21')],function(_0x577389){return{'model':db[_0x577389[_0xaefd('0x22')]],'as':_0x577389['as'],'attributes':_0x577389[_0xaefd('0x20')],'include':_0x577389[_0xaefd('0x21')]?_[_0xaefd('0x23')](_0x577389[_0xaefd('0x21')],function(_0x2f1548){return{'model':db[_0x2f1548[_0xaefd('0x22')]],'as':_0x2f1548['as'],'attributes':_0x2f1548[_0xaefd('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xf')](function(_0x28491b){logger[_0xaefd('0x10')](_0xaefd('0x26'),_0x62ef86);logger[_0xaefd('0x13')](_0xaefd('0x26'),_0x62ef86,JSON['stringify'](_0x28491b));_0x3f4947(_0x28491b);})[_0xaefd('0x1a')](function(_0x56ec96){logger[_0xaefd('0x16')](_0xaefd('0x26'),_0x56ec96[_0xaefd('0x18')],_0x62ef86);_0x21d358(_0x465d99[_0xaefd('0x16')](0x1f4,_0x56ec96[_0xaefd('0x18')]));});});}; \ No newline at end of file +var _0x93e9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','find','then','debug','ShowChatQueue','lodash'];(function(_0x3b2369,_0x4c68b9){var _0x5a1367=function(_0x58ddcf){while(--_0x58ddcf){_0x3b2369['push'](_0x3b2369['shift']());}};_0x5a1367(++_0x4c68b9);}(_0x93e9,0xcc));var _0x993e=function(_0x50794f,_0xc14361){_0x50794f=_0x50794f-0x0;var _0x378b49=_0x93e9[_0x50794f];return _0x378b49;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});config[_0x993e('0xc')]=_[_0x993e('0xd')](config[_0x993e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x993e('0xe'))(new Redis(config[_0x993e('0xc')]));require(_0x993e('0xf'))[_0x993e('0x10')](socket);function respondWithRpcPromise(_0x2cd389,_0x27a28f,_0x1c2324){return new BPromise(function(_0x48291a,_0x196f6d){return client[_0x993e('0x11')](_0x2cd389,_0x1c2324)['then'](function(_0x5ebc8c){logger[_0x993e('0x12')]('ChatQueue,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27a28f,_0x993e('0x13'),JSON[_0x993e('0x14')](_0x5ebc8c));if(_0x5ebc8c[_0x993e('0x15')]){if(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x16')]===0x1f4){logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x196f6d(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}logger[_0x993e('0x15')](_0x993e('0x17'),_0x27a28f,_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);return _0x48291a(_0x5ebc8c[_0x993e('0x15')][_0x993e('0x18')]);}else{logger['info'](_0x993e('0x17'),_0x27a28f,_0x993e('0x13'));_0x48291a(_0x5ebc8c[_0x993e('0x19')][_0x993e('0x18')]);}})[_0x993e('0x1a')](function(_0x3eda77){logger['error'](_0x993e('0x17'),_0x27a28f,_0x3eda77);_0x196f6d(_0x3eda77);});});}exports[_0x993e('0x1b')]=function(_0x1eaf57){var _0x22390e=this;return new Promise(function(_0x130a8a,_0x425ab4){return db[_0x993e('0x1c')][_0x993e('0x1d')]({'raw':_0x1eaf57['options']?_0x1eaf57[_0x993e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x1f')]||null:null,'attributes':_0x1eaf57['options']?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x20')]||null:null,'limit':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x21')]||null:null,'include':_0x1eaf57[_0x993e('0x1e')]?_0x1eaf57[_0x993e('0x1e')][_0x993e('0x22')]?_[_0x993e('0x23')](_0x1eaf57[_0x993e('0x1e')][_0x993e('0x22')],function(_0x3603fa){return{'model':db[_0x3603fa['model']],'as':_0x3603fa['as'],'attributes':_0x3603fa[_0x993e('0x20')],'include':_0x3603fa[_0x993e('0x22')]?_['map'](_0x3603fa[_0x993e('0x22')],function(_0x4f5cc1){return{'model':db[_0x4f5cc1[_0x993e('0x24')]],'as':_0x4f5cc1['as'],'attributes':_0x4f5cc1[_0x993e('0x20')],'include':_0x4f5cc1[_0x993e('0x22')]?_[_0x993e('0x23')](_0x4f5cc1['include'],function(_0x48d457){return{'model':db[_0x48d457[_0x993e('0x24')]],'as':_0x48d457['as'],'attributes':_0x48d457[_0x993e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x223af0){logger[_0x993e('0x12')](_0x993e('0x1b'),_0x1eaf57);logger['debug'](_0x993e('0x1b'),_0x1eaf57,JSON[_0x993e('0x14')](_0x223af0));_0x130a8a(_0x223af0);})[_0x993e('0x1a')](function(_0x1fa8a5){logger[_0x993e('0x15')]('GetChatQueue',_0x1fa8a5[_0x993e('0x18')],_0x1eaf57);_0x425ab4(_0x22390e['error'](0x1f4,_0x1fa8a5[_0x993e('0x18')]));});});};exports['ShowChatQueue']=function(_0x1da357){var _0x567ed4=this;return new Promise(function(_0x3b9c3c,_0x2ce5d5){return db[_0x993e('0x1c')][_0x993e('0x25')]({'raw':_0x1da357[_0x993e('0x1e')]?_0x1da357[_0x993e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1da357[_0x993e('0x1e')]?_0x1da357['options']['where']||null:null,'attributes':_0x1da357[_0x993e('0x1e')]?_0x1da357['options'][_0x993e('0x20')]||null:null,'include':_0x1da357[_0x993e('0x1e')]?_0x1da357[_0x993e('0x1e')][_0x993e('0x22')]?_[_0x993e('0x23')](_0x1da357[_0x993e('0x1e')][_0x993e('0x22')],function(_0x14424a){return{'model':db[_0x14424a[_0x993e('0x24')]],'as':_0x14424a['as'],'attributes':_0x14424a[_0x993e('0x20')],'include':_0x14424a[_0x993e('0x22')]?_[_0x993e('0x23')](_0x14424a[_0x993e('0x22')],function(_0x28a481){return{'model':db[_0x28a481[_0x993e('0x24')]],'as':_0x28a481['as'],'attributes':_0x28a481['attributes'],'include':_0x28a481[_0x993e('0x22')]?_[_0x993e('0x23')](_0x28a481[_0x993e('0x22')],function(_0x9a9f42){return{'model':db[_0x9a9f42[_0x993e('0x24')]],'as':_0x9a9f42['as'],'attributes':_0x9a9f42[_0x993e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x993e('0x26')](function(_0x416afd){logger[_0x993e('0x12')]('ShowChatQueue',_0x1da357);logger[_0x993e('0x27')]('ShowChatQueue',_0x1da357,JSON[_0x993e('0x14')](_0x416afd));_0x3b9c3c(_0x416afd);})[_0x993e('0x1a')](function(_0x3f5e2b){logger[_0x993e('0x15')](_0x993e('0x28'),_0x3f5e2b[_0x993e('0x18')],_0x1da357);_0x2ce5d5(_0x567ed4[_0x993e('0x15')](0x1f4,_0x3f5e2b[_0x993e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5e2777b..eaacd21 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 _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x1d2d9e,_0x30fa7e){var _0x2005d6=function(_0x402e47){while(--_0x402e47){_0x1d2d9e['push'](_0x1d2d9e['shift']());}};_0x2005d6(++_0x30fa7e);}(_0x9b67,0xf6));var _0x79b6=function(_0x37c641,_0x13b222){_0x37c641=_0x37c641-0x0;var _0xe81d07=_0x9b67[_0x37c641];return _0xe81d07;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}}; \ No newline at end of file +var _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b667b01..cd8d89a 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5531b4,_0x4d9d33){var _0x344b6d=function(_0x273879){while(--_0x273879){_0x5531b4['push'](_0x5531b4['shift']());}};_0x344b6d(++_0x4d9d33);}(_0x55ca,0x126));var _0xa55c=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x55ca[_0x55821d];return _0x58ea8a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['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['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x7b43ce,_0x536b72){var _0x129be8=function(_0x2d92e1){while(--_0x2d92e1){_0x7b43ce['push'](_0x7b43ce['shift']());}};_0x129be8(++_0x536b72);}(_0xe14b,0x93));var _0xbe14=function(_0x3a24f4,_0x587cc2){_0x3a24f4=_0x3a24f4-0x0;var _0x3e30d6=_0xe14b[_0x3a24f4];return _0x3e30d6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5c9f409..3bcdeb7 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 _0x81ef=['moment','sequelize','exports','STRING','DATE'];(function(_0x7f4719,_0x1d4aee){var _0x2f9135=function(_0x54d820){while(--_0x54d820){_0x7f4719['push'](_0x7f4719['shift']());}};_0x2f9135(++_0x1d4aee);}(_0x81ef,0xc3));var _0xf81e=function(_0x218543,_0x2fed46){_0x218543=_0x218543-0x0;var _0x3dad81=_0x81ef[_0x218543];return _0x3dad81;};'use strict';var moment=require(_0xf81e('0x0'));var Sequelize=require(_0xf81e('0x1'));module[_0xf81e('0x2')]={'uniqueid':{'type':Sequelize[_0xf81e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf81e('0x3')]},'joinAt':{'type':Sequelize[_0xf81e('0x4')]},'leaveAt':{'type':Sequelize[_0xf81e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf81e('0x3')]}}; \ No newline at end of file +var _0xe9a2=['exports','DATE','STRING','moment','sequelize'];(function(_0x57ccb4,_0xe7da75){var _0x325fa5=function(_0x40f669){while(--_0x40f669){_0x57ccb4['push'](_0x57ccb4['shift']());}};_0x325fa5(++_0xe7da75);}(_0xe9a2,0x71));var _0x2e9a=function(_0x495f68,_0x46bdae){_0x495f68=_0x495f68-0x0;var _0x278ba0=_0xe9a2[_0x495f68];return _0x278ba0;};'use strict';var moment=require(_0x2e9a('0x0'));var Sequelize=require(_0x2e9a('0x1'));module[_0x2e9a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2e9a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2e9a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2e9a('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 340f166..facc1fc 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 _0x1bce=['Content-Range','then','destroy','status','end','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','set'];(function(_0x16ef3a,_0x1bea31){var _0x3d4966=function(_0x202a8f){while(--_0x202a8f){_0x16ef3a['push'](_0x16ef3a['shift']());}};_0x3d4966(++_0x1bea31);}(_0x1bce,0x73));var _0xe1bc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1bce[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe1bc('0x0'));var rimraf=require(_0xe1bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1bc('0x2'));var rp=require(_0xe1bc('0x3'));var moment=require(_0xe1bc('0x4'));var BPromise=require(_0xe1bc('0x5'));var Mustache=require(_0xe1bc('0x6'));var util=require(_0xe1bc('0x7'));var path=require(_0xe1bc('0x8'));var sox=require(_0xe1bc('0x9'));var csv=require(_0xe1bc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1bc('0xb'));var squel=require(_0xe1bc('0xc'));var crypto=require(_0xe1bc('0xd'));var jsforce=require(_0xe1bc('0xe'));var deskjs=require(_0xe1bc('0xf'));var toCsv=require(_0xe1bc('0xa'));var querystring=require('querystring');var Papa=require(_0xe1bc('0x10'));var Redis=require('ioredis');var authService=require(_0xe1bc('0x11'));var qs=require(_0xe1bc('0x12'));var as=require(_0xe1bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1bc('0x14'))(_0xe1bc('0x15'));var utils=require('../../config/utils');var config=require(_0xe1bc('0x16'));var licenseUtil=require(_0xe1bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c8b9f,_0xdb61b){_0xdb61b=_0xdb61b||0xcc;return function(_0xc89560){if(_0xc89560){return _0x5c8b9f[_0xe1bc('0x18')](_0xdb61b);}return _0x5c8b9f['status'](_0xdb61b)['end']();};}function respondWithResult(_0x161955,_0x16b0cd){_0x16b0cd=_0x16b0cd||0xc8;return function(_0x402a22){if(_0x402a22){return _0x161955['status'](_0x16b0cd)[_0xe1bc('0x19')](_0x402a22);}};}function respondWithFilteredResult(_0x3a073e,_0x17cfc3){return function(_0x46ab48){if(_0x46ab48){var _0x556001=typeof _0x17cfc3[_0xe1bc('0x1a')]==='undefined'&&typeof _0x17cfc3[_0xe1bc('0x1b')]===_0xe1bc('0x1c');var _0x4acd5b=_0x46ab48[_0xe1bc('0x1d')];var _0x1ed85d=_0x556001?0x0:_0x17cfc3[_0xe1bc('0x1a')];var _0x3fd489=_0x556001?_0x46ab48[_0xe1bc('0x1d')]:_0x17cfc3[_0xe1bc('0x1a')]+_0x17cfc3['limit'];var _0x2d2caa;if(_0x3fd489>=_0x4acd5b){_0x3fd489=_0x4acd5b;_0x2d2caa=0xc8;}else{_0x2d2caa=0xce;}_0x3a073e['status'](_0x2d2caa);return _0x3a073e[_0xe1bc('0x1e')](_0xe1bc('0x1f'),_0x1ed85d+'-'+_0x3fd489+'/'+_0x4acd5b)[_0xe1bc('0x19')](_0x46ab48);}return null;};}function patchUpdates(_0x1d222c){return function(_0x2a79f1){try{jsonpatch['apply'](_0x2a79f1,_0x1d222c,!![]);}catch(_0x313b16){return BPromise['reject'](_0x313b16);}return _0x2a79f1['save']();};}function saveUpdates(_0x3a5f82,_0x2a999c){return function(_0x5cc42d){if(_0x5cc42d){return _0x5cc42d['update'](_0x3a5f82)[_0xe1bc('0x20')](function(_0x7a8e22){return _0x7a8e22;});}return null;};}function removeEntity(_0x26582e,_0x126ae3){return function(_0x229b43){if(_0x229b43){return _0x229b43[_0xe1bc('0x21')]()[_0xe1bc('0x20')](function(){_0x26582e[_0xe1bc('0x22')](0xcc)[_0xe1bc('0x23')]();});}};}function handleEntityNotFound(_0x16631e,_0x927963){return function(_0x3d1946){if(!_0x3d1946){_0x16631e[_0xe1bc('0x18')](0x194);}return _0x3d1946;};}function handleError(_0x584622,_0x4dd024){_0x4dd024=_0x4dd024||0x1f4;return function(_0x6311aa){logger['error'](_0x6311aa[_0xe1bc('0x24')]);if(_0x6311aa['name']){delete _0x6311aa[_0xe1bc('0x25')];}_0x584622['status'](_0x4dd024)['send'](_0x6311aa);};}exports[_0xe1bc('0x26')]=function(_0x3958a4,_0x58a667){var _0x47d9b3={},_0x39017e={},_0x23caa1={'count':0x0,'rows':[]};var _0x345da1=_[_0xe1bc('0x27')](db[_0xe1bc('0x28')][_0xe1bc('0x29')],function(_0x122da8){return{'name':_0x122da8[_0xe1bc('0x2a')],'type':_0x122da8[_0xe1bc('0x2b')]['key']};});_0x39017e[_0xe1bc('0x2c')]=_[_0xe1bc('0x27')](_0x345da1,_0xe1bc('0x25'));_0x39017e['query']=_[_0xe1bc('0x2d')](_0x3958a4[_0xe1bc('0x2e')]);_0x39017e[_0xe1bc('0x2f')]=_[_0xe1bc('0x30')](_0x39017e[_0xe1bc('0x2c')],_0x39017e['query']);_0x47d9b3[_0xe1bc('0x31')]=_['intersection'](_0x39017e['model'],qs[_0xe1bc('0x32')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x47d9b3['attributes']=_0x47d9b3[_0xe1bc('0x31')][_0xe1bc('0x33')]?_0x47d9b3['attributes']:_0x39017e[_0xe1bc('0x2c')];if(!_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x34')](_0xe1bc('0x35'))){_0x47d9b3[_0xe1bc('0x1b')]=qs[_0xe1bc('0x1b')](_0x3958a4['query'][_0xe1bc('0x1b')]);_0x47d9b3[_0xe1bc('0x1a')]=qs['offset'](_0x3958a4[_0xe1bc('0x2e')]['offset']);}_0x47d9b3[_0xe1bc('0x36')]=qs[_0xe1bc('0x37')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x37')]);_0x47d9b3['where']=qs[_0xe1bc('0x2f')](_[_0xe1bc('0x38')](_0x3958a4[_0xe1bc('0x2e')],_0x39017e[_0xe1bc('0x2f')]),_0x345da1);if(_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]){_0x47d9b3[_0xe1bc('0x3a')]=_[_0xe1bc('0x3b')](_0x47d9b3[_0xe1bc('0x3a')],{'$or':_[_0xe1bc('0x27')](_0x345da1,function(_0x344b42){if(_0x344b42[_0xe1bc('0x2b')]!==_0xe1bc('0x3c')){var _0x45ddd3={};_0x45ddd3[_0x344b42['name']]={'$like':'%'+_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]+'%'};return _0x45ddd3;}})});}_0x47d9b3=_['merge']({},_0x47d9b3,_0x3958a4[_0xe1bc('0x3d')]);var _0x4e3d2d={'where':_0x47d9b3[_0xe1bc('0x3a')]};return db[_0xe1bc('0x28')][_0xe1bc('0x1d')](_0x4e3d2d)[_0xe1bc('0x20')](function(_0x254e8b){_0x23caa1['count']=_0x254e8b;if(_0x3958a4['query'][_0xe1bc('0x3e')]){_0x47d9b3[_0xe1bc('0x3f')]=[{'all':!![]}];}return db[_0xe1bc('0x28')][_0xe1bc('0x40')](_0x47d9b3);})[_0xe1bc('0x20')](function(_0xbe9e0e){_0x23caa1['rows']=_0xbe9e0e;return _0x23caa1;})[_0xe1bc('0x20')](respondWithFilteredResult(_0x58a667,_0x47d9b3))[_0xe1bc('0x41')](handleError(_0x58a667,null));};exports[_0xe1bc('0x42')]=function(_0x5b0339,_0x3fee8f){var _0x4c5634={'raw':!![],'where':{'id':_0x5b0339[_0xe1bc('0x43')]['id']}},_0x22cc17={};_0x22cc17[_0xe1bc('0x2c')]=_['keys'](db[_0xe1bc('0x28')][_0xe1bc('0x29')]);_0x22cc17[_0xe1bc('0x2e')]=_['keys'](_0x5b0339[_0xe1bc('0x2e')]);_0x22cc17['filters']=_['intersection'](_0x22cc17['model'],_0x22cc17['query']);_0x4c5634['attributes']=_['intersection'](_0x22cc17[_0xe1bc('0x2c')],qs[_0xe1bc('0x32')](_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x4c5634[_0xe1bc('0x31')]=_0x4c5634[_0xe1bc('0x31')]['length']?_0x4c5634[_0xe1bc('0x31')]:_0x22cc17[_0xe1bc('0x2c')];if(_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x3e')]){_0x4c5634[_0xe1bc('0x3f')]=[{'all':!![]}];}_0x4c5634=_['merge']({},_0x4c5634,_0x5b0339[_0xe1bc('0x3d')]);return db[_0xe1bc('0x28')]['find'](_0x4c5634)[_0xe1bc('0x20')](handleEntityNotFound(_0x3fee8f,null))[_0xe1bc('0x20')](respondWithResult(_0x3fee8f,null))['catch'](handleError(_0x3fee8f,null));};exports[_0xe1bc('0x44')]=function(_0x52263b,_0x1ec1dc){return db['ChatQueueReport']['create'](_0x52263b[_0xe1bc('0x45')],{})[_0xe1bc('0x20')](respondWithResult(_0x1ec1dc,0xc9))[_0xe1bc('0x41')](handleError(_0x1ec1dc,null));};exports[_0xe1bc('0x46')]=function(_0xd4884c,_0x2dccb7){if(_0xd4884c['body']['id']){delete _0xd4884c[_0xe1bc('0x45')]['id'];}return db[_0xe1bc('0x28')]['find']({'where':{'id':_0xd4884c[_0xe1bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dccb7,null))[_0xe1bc('0x20')](saveUpdates(_0xd4884c['body'],null))[_0xe1bc('0x20')](respondWithResult(_0x2dccb7,null))[_0xe1bc('0x41')](handleError(_0x2dccb7,null));};exports[_0xe1bc('0x21')]=function(_0x5bc275,_0x3b6165){return db['ChatQueueReport'][_0xe1bc('0x47')]({'where':{'id':_0x5bc275[_0xe1bc('0x43')]['id']}})[_0xe1bc('0x20')](handleEntityNotFound(_0x3b6165,null))['then'](removeEntity(_0x3b6165,null))[_0xe1bc('0x41')](handleError(_0x3b6165,null));};exports['describe']=function(_0x274131,_0x4594bd){return db['ChatQueueReport'][_0xe1bc('0x48')]()['then'](respondWithResult(_0x4594bd,null))[_0xe1bc('0x41')](handleError(_0x4594bd,null));}; \ No newline at end of file +var _0xd43e=['to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueueReport','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd43e,0x88));var _0xed43=function(_0x47b1a7,_0x666d32){_0x47b1a7=_0x47b1a7-0x0;var _0x410f7a=_0xd43e[_0x47b1a7];return _0x410f7a;};'use strict';var emlformat=require(_0xed43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed43('0x1'));var jsonpatch=require(_0xed43('0x2'));var rp=require(_0xed43('0x3'));var moment=require(_0xed43('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed43('0x5'));var path=require(_0xed43('0x6'));var sox=require(_0xed43('0x7'));var csv=require(_0xed43('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed43('0x9'));var _=require(_0xed43('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed43('0xb'));var toCsv=require(_0xed43('0x8'));var querystring=require(_0xed43('0xc'));var Papa=require(_0xed43('0xd'));var Redis=require(_0xed43('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xed43('0xf'));var as=require(_0xed43('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed43('0x11'))(_0xed43('0x12'));var utils=require(_0xed43('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xed43('0x14'))['db'];function respondWithStatusCode(_0x34027b,_0x4eed04){_0x4eed04=_0x4eed04||0xcc;return function(_0x1519aa){if(_0x1519aa){return _0x34027b[_0xed43('0x15')](_0x4eed04);}return _0x34027b[_0xed43('0x16')](_0x4eed04)[_0xed43('0x17')]();};}function respondWithResult(_0x2adbc5,_0x403a89){_0x403a89=_0x403a89||0xc8;return function(_0x597544){if(_0x597544){return _0x2adbc5[_0xed43('0x16')](_0x403a89)['json'](_0x597544);}};}function respondWithFilteredResult(_0x2ec9c3,_0x4a9621){return function(_0x2d457a){if(_0x2d457a){var _0x4caa03=typeof _0x4a9621['offset']===_0xed43('0x18')&&typeof _0x4a9621['limit']===_0xed43('0x18');var _0x1ada9c=_0x2d457a[_0xed43('0x19')];var _0x5f5093=_0x4caa03?0x0:_0x4a9621[_0xed43('0x1a')];var _0xa8a443=_0x4caa03?_0x2d457a['count']:_0x4a9621['offset']+_0x4a9621[_0xed43('0x1b')];var _0x46a875;if(_0xa8a443>=_0x1ada9c){_0xa8a443=_0x1ada9c;_0x46a875=0xc8;}else{_0x46a875=0xce;}_0x2ec9c3[_0xed43('0x16')](_0x46a875);return _0x2ec9c3['set'](_0xed43('0x1c'),_0x5f5093+'-'+_0xa8a443+'/'+_0x1ada9c)[_0xed43('0x1d')](_0x2d457a);}return null;};}function patchUpdates(_0x5bbd5c){return function(_0x3570ef){try{jsonpatch[_0xed43('0x1e')](_0x3570ef,_0x5bbd5c,!![]);}catch(_0x336ce7){return BPromise['reject'](_0x336ce7);}return _0x3570ef['save']();};}function saveUpdates(_0x2a6329,_0x42fb48){return function(_0x7f4c4c){if(_0x7f4c4c){return _0x7f4c4c[_0xed43('0x1f')](_0x2a6329)[_0xed43('0x20')](function(_0x45a24a){return _0x45a24a;});}return null;};}function removeEntity(_0x556440,_0x414c7a){return function(_0x30b5cf){if(_0x30b5cf){return _0x30b5cf[_0xed43('0x21')]()['then'](function(){_0x556440[_0xed43('0x16')](0xcc)[_0xed43('0x17')]();});}};}function handleEntityNotFound(_0x28a908,_0x90350a){return function(_0x549f91){if(!_0x549f91){_0x28a908[_0xed43('0x15')](0x194);}return _0x549f91;};}function handleError(_0x53f575,_0x3e7442){_0x3e7442=_0x3e7442||0x1f4;return function(_0xed8706){logger[_0xed43('0x22')](_0xed8706[_0xed43('0x23')]);if(_0xed8706['name']){delete _0xed8706[_0xed43('0x24')];}_0x53f575['status'](_0x3e7442)['send'](_0xed8706);};}exports[_0xed43('0x25')]=function(_0x51f128,_0x587d85){var _0x1b2f66={},_0x139750={},_0x325ab5={'count':0x0,'rows':[]};var _0x1f1207=_[_0xed43('0x26')](db['ChatQueueReport'][_0xed43('0x27')],function(_0x32c395){return{'name':_0x32c395[_0xed43('0x28')],'type':_0x32c395[_0xed43('0x29')][_0xed43('0x2a')]};});_0x139750['model']=_[_0xed43('0x26')](_0x1f1207,_0xed43('0x24'));_0x139750[_0xed43('0x2b')]=_['keys'](_0x51f128[_0xed43('0x2b')]);_0x139750[_0xed43('0x2c')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],_0x139750[_0xed43('0x2b')]);_0x1b2f66[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x139750[_0xed43('0x2e')],qs['fields'](_0x51f128['query'][_0xed43('0x30')]));_0x1b2f66['attributes']=_0x1b2f66[_0xed43('0x2f')][_0xed43('0x31')]?_0x1b2f66['attributes']:_0x139750[_0xed43('0x2e')];if(!_0x51f128[_0xed43('0x2b')][_0xed43('0x32')](_0xed43('0x33'))){_0x1b2f66[_0xed43('0x1b')]=qs[_0xed43('0x1b')](_0x51f128[_0xed43('0x2b')][_0xed43('0x1b')]);_0x1b2f66['offset']=qs['offset'](_0x51f128[_0xed43('0x2b')][_0xed43('0x1a')]);}_0x1b2f66[_0xed43('0x34')]=qs[_0xed43('0x35')](_0x51f128[_0xed43('0x2b')]['sort']);_0x1b2f66[_0xed43('0x36')]=qs['filters'](_[_0xed43('0x37')](_0x51f128[_0xed43('0x2b')],_0x139750[_0xed43('0x2c')]),_0x1f1207);if(_0x51f128['query'][_0xed43('0x38')]){_0x1b2f66[_0xed43('0x36')]=_['merge'](_0x1b2f66[_0xed43('0x36')],{'$or':_[_0xed43('0x26')](_0x1f1207,function(_0x5bf247){if(_0x5bf247[_0xed43('0x29')]!=='VIRTUAL'){var _0x16c207={};_0x16c207[_0x5bf247[_0xed43('0x24')]]={'$like':'%'+_0x51f128['query'][_0xed43('0x38')]+'%'};return _0x16c207;}})});}_0x1b2f66=_[_0xed43('0x39')]({},_0x1b2f66,_0x51f128[_0xed43('0x3a')]);var _0x4a6ff6={'where':_0x1b2f66[_0xed43('0x36')]};return db[_0xed43('0x3b')][_0xed43('0x19')](_0x4a6ff6)[_0xed43('0x20')](function(_0xa6a7c3){_0x325ab5[_0xed43('0x19')]=_0xa6a7c3;if(_0x51f128['query'][_0xed43('0x3c')]){_0x1b2f66['include']=[{'all':!![]}];}return db[_0xed43('0x3b')][_0xed43('0x3d')](_0x1b2f66);})[_0xed43('0x20')](function(_0x2a9a15){_0x325ab5[_0xed43('0x3e')]=_0x2a9a15;return _0x325ab5;})[_0xed43('0x20')](respondWithFilteredResult(_0x587d85,_0x1b2f66))[_0xed43('0x3f')](handleError(_0x587d85,null));};exports[_0xed43('0x40')]=function(_0x19d7de,_0x32ddec){var _0x3ec9c0={'raw':!![],'where':{'id':_0x19d7de[_0xed43('0x41')]['id']}},_0x57ac6b={};_0x57ac6b[_0xed43('0x2e')]=_[_0xed43('0x42')](db['ChatQueueReport'][_0xed43('0x27')]);_0x57ac6b[_0xed43('0x2b')]=_[_0xed43('0x42')](_0x19d7de['query']);_0x57ac6b[_0xed43('0x2c')]=_['intersection'](_0x57ac6b['model'],_0x57ac6b[_0xed43('0x2b')]);_0x3ec9c0[_0xed43('0x2f')]=_[_0xed43('0x2d')](_0x57ac6b[_0xed43('0x2e')],qs['fields'](_0x19d7de[_0xed43('0x2b')][_0xed43('0x30')]));_0x3ec9c0['attributes']=_0x3ec9c0['attributes'][_0xed43('0x31')]?_0x3ec9c0['attributes']:_0x57ac6b[_0xed43('0x2e')];if(_0x19d7de['query'][_0xed43('0x3c')]){_0x3ec9c0[_0xed43('0x43')]=[{'all':!![]}];}_0x3ec9c0=_[_0xed43('0x39')]({},_0x3ec9c0,_0x19d7de[_0xed43('0x3a')]);return db[_0xed43('0x3b')][_0xed43('0x44')](_0x3ec9c0)['then'](handleEntityNotFound(_0x32ddec,null))[_0xed43('0x20')](respondWithResult(_0x32ddec,null))[_0xed43('0x3f')](handleError(_0x32ddec,null));};exports[_0xed43('0x45')]=function(_0x2ff4cf,_0x298662){return db[_0xed43('0x3b')]['create'](_0x2ff4cf[_0xed43('0x46')],{})[_0xed43('0x20')](respondWithResult(_0x298662,0xc9))[_0xed43('0x3f')](handleError(_0x298662,null));};exports[_0xed43('0x1f')]=function(_0x567327,_0xeda46e){if(_0x567327[_0xed43('0x46')]['id']){delete _0x567327['body']['id'];}return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x567327[_0xed43('0x41')]['id']}})[_0xed43('0x20')](handleEntityNotFound(_0xeda46e,null))[_0xed43('0x20')](saveUpdates(_0x567327[_0xed43('0x46')],null))[_0xed43('0x20')](respondWithResult(_0xeda46e,null))[_0xed43('0x3f')](handleError(_0xeda46e,null));};exports[_0xed43('0x21')]=function(_0x5f1968,_0x47cb1e){return db[_0xed43('0x3b')][_0xed43('0x44')]({'where':{'id':_0x5f1968[_0xed43('0x41')]['id']}})['then'](handleEntityNotFound(_0x47cb1e,null))['then'](removeEntity(_0x47cb1e,null))[_0xed43('0x3f')](handleError(_0x47cb1e,null));};exports[_0xed43('0x47')]=function(_0x399b30,_0x31846d){return db[_0xed43('0x3b')][_0xed43('0x47')]()[_0xed43('0x20')](respondWithResult(_0x31846d,null))[_0xed43('0x3f')](handleError(_0x31846d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 0f9f880..3878569 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b9169,_0x40f904){_0x1b9169=_0x1b9169-0x0;var _0x59ea07=_0xb10b[_0x1b9169];return _0x59ea07;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x1b9d67,_0x2ac333){var _0x5f3794=function(_0x4f6479){while(--_0x4f6479){_0x1b9d67['push'](_0x1b9d67['shift']());}};_0x5f3794(++_0x2ac333);}(_0x757a,0xde));var _0xa757=function(_0x4e0d5c,_0x3f0ea4){_0x4e0d5c=_0x4e0d5c-0x0;var _0xe79eb1=_0x757a[_0x4e0d5c];return _0xe79eb1;};'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 40ed1f6..5bf56d9 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 _0xbab2=['rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','attributes','limit','UpdateChatQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x338b15,_0x3202d8){var _0x466e43=function(_0x3c79ae){while(--_0x3c79ae){_0x338b15['push'](_0x338b15['shift']());}};_0x466e43(++_0x3202d8);}(_0xbab2,0x1ea));var _0x2bab=function(_0x36f94d,_0x4919a9){_0x36f94d=_0x36f94d-0x0;var _0x8efbfb=_0xbab2[_0x36f94d];return _0x8efbfb;};'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')]('ChatQueueReport,\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);});});}exports[_0x2bab('0x15')]=function(_0x43fe3d){var _0x5b7b31=this;return new Promise(function(_0x5f35db,_0x38b615){return db[_0x2bab('0x16')][_0x2bab('0x17')](_0x43fe3d[_0x2bab('0x18')],{'raw':_0x43fe3d[_0x2bab('0x19')]?_0x43fe3d[_0x2bab('0x19')][_0x2bab('0x1a')]===undefined?!![]:![]:!![]})[_0x2bab('0xa')](function(_0x3c9f52){logger[_0x2bab('0xb')](_0x2bab('0x15'),_0x43fe3d);logger['debug']('CreateChatQueueReport',_0x43fe3d,JSON[_0x2bab('0x10')](_0x3c9f52));_0x5f35db(_0x3c9f52);})['catch'](function(_0x325fc3){logger[_0x2bab('0x11')]('CreateChatQueueReport',_0x325fc3['message'],_0x43fe3d);_0x38b615(_0x5b7b31['error'](0x1f4,_0x325fc3[_0x2bab('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x58f98f){var _0x443825=this;return new Promise(function(_0x138d52,_0x5e2d1b){return db[_0x2bab('0x16')]['update'](_0x58f98f[_0x2bab('0x18')],{'raw':_0x58f98f['options']?_0x58f98f[_0x2bab('0x19')][_0x2bab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f98f[_0x2bab('0x19')]?_0x58f98f[_0x2bab('0x19')][_0x2bab('0x1b')]||null:null,'attributes':_0x58f98f[_0x2bab('0x19')]?_0x58f98f['options'][_0x2bab('0x1c')]||null:null,'limit':_0x58f98f[_0x2bab('0x19')]?_0x58f98f['options'][_0x2bab('0x1d')]||null:null})[_0x2bab('0xa')](function(_0x3753a7){logger[_0x2bab('0xb')](_0x2bab('0x1e'),_0x58f98f);logger[_0x2bab('0xe')](_0x2bab('0x1e'),_0x58f98f,JSON[_0x2bab('0x10')](_0x3753a7));_0x138d52(_0x3753a7);})[_0x2bab('0x14')](function(_0x4cf279){logger[_0x2bab('0x11')](_0x2bab('0x1e'),_0x4cf279[_0x2bab('0x12')],_0x58f98f);_0x5e2d1b(_0x443825[_0x2bab('0x11')](0x1f4,_0x4cf279['message']));});});}; \ No newline at end of file +var _0xc98e=['CreateChatQueueReport','ChatQueueReport','create','body','raw','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x4060cb,_0x354071){var _0x25d8fa=function(_0x248ad8){while(--_0x248ad8){_0x4060cb['push'](_0x4060cb['shift']());}};_0x25d8fa(++_0x354071);}(_0xc98e,0x1eb));var _0xec98=function(_0x96a10d,_0x2f5500){_0x96a10d=_0x96a10d-0x0;var _0x375445=_0xc98e[_0x96a10d];return _0x375445;};'use strict';var _=require(_0xec98('0x0'));var util=require('util');var moment=require(_0xec98('0x1'));var BPromise=require(_0xec98('0x2'));var rs=require(_0xec98('0x3'));var fs=require('fs');var Redis=require(_0xec98('0x4'));var db=require(_0xec98('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec98('0x6'));var config=require(_0xec98('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17180c,_0x25d6f1,_0xb06fa0){return new BPromise(function(_0x2e330d,_0x1d4914){return client[_0xec98('0x9')](_0x17180c,_0xb06fa0)[_0xec98('0xa')](function(_0x7c3c34){logger[_0xec98('0xb')](_0xec98('0xc'),_0x25d6f1,_0xec98('0xd'));logger[_0xec98('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x25d6f1,_0xec98('0xd'),JSON[_0xec98('0xf')](_0x7c3c34));if(_0x7c3c34[_0xec98('0x10')]){if(_0x7c3c34[_0xec98('0x10')][_0xec98('0x11')]===0x1f4){logger[_0xec98('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x25d6f1,_0x7c3c34[_0xec98('0x10')][_0xec98('0x12')]);return _0x1d4914(_0x7c3c34['error'][_0xec98('0x12')]);}logger[_0xec98('0x10')](_0xec98('0xc'),_0x25d6f1,_0x7c3c34[_0xec98('0x10')][_0xec98('0x12')]);return _0x2e330d(_0x7c3c34[_0xec98('0x10')]['message']);}else{logger[_0xec98('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x25d6f1,_0xec98('0xd'));_0x2e330d(_0x7c3c34[_0xec98('0x13')][_0xec98('0x12')]);}})[_0xec98('0x14')](function(_0x19534a){logger[_0xec98('0x10')](_0xec98('0xc'),_0x25d6f1,_0x19534a);_0x1d4914(_0x19534a);});});}exports[_0xec98('0x15')]=function(_0x177fc5){var _0x2e24c7=this;return new Promise(function(_0x439bed,_0x11c713){return db[_0xec98('0x16')][_0xec98('0x17')](_0x177fc5[_0xec98('0x18')],{'raw':_0x177fc5['options']?_0x177fc5['options'][_0xec98('0x19')]===undefined?!![]:![]:!![]})[_0xec98('0xa')](function(_0x2f294b){logger[_0xec98('0xb')](_0xec98('0x15'),_0x177fc5);logger[_0xec98('0xe')]('CreateChatQueueReport',_0x177fc5,JSON[_0xec98('0xf')](_0x2f294b));_0x439bed(_0x2f294b);})['catch'](function(_0xfdd257){logger[_0xec98('0x10')]('CreateChatQueueReport',_0xfdd257[_0xec98('0x12')],_0x177fc5);_0x11c713(_0x2e24c7[_0xec98('0x10')](0x1f4,_0xfdd257['message']));});});};exports['UpdateChatQueueReport']=function(_0x5dfe85){var _0x38a224=this;return new Promise(function(_0x400afa,_0x3d2703){return db['ChatQueueReport'][_0xec98('0x1a')](_0x5dfe85[_0xec98('0x18')],{'raw':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85[_0xec98('0x1b')][_0xec98('0x1c')]||null:null,'attributes':_0x5dfe85[_0xec98('0x1b')]?_0x5dfe85[_0xec98('0x1b')][_0xec98('0x1d')]||null:null,'limit':_0x5dfe85['options']?_0x5dfe85['options'][_0xec98('0x1e')]||null:null})['then'](function(_0x476925){logger[_0xec98('0xb')](_0xec98('0x1f'),_0x5dfe85);logger[_0xec98('0xe')](_0xec98('0x1f'),_0x5dfe85,JSON[_0xec98('0xf')](_0x476925));_0x400afa(_0x476925);})[_0xec98('0x14')](function(_0x3447d8){logger['error'](_0xec98('0x1f'),_0x3447d8['message'],_0x5dfe85);_0x3d2703(_0x38a224[_0xec98('0x10')](0x1f4,_0x3447d8[_0xec98('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index bbec6cd..d8743ce 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 _0xff1f=['fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x2fef39,_0x253198){var _0x4e2ff6=function(_0x5086de){while(--_0x5086de){_0x2fef39['push'](_0x2fef39['shift']());}};_0x4e2ff6(++_0x253198);}(_0xff1f,0x140));var _0xfff1=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xff1f[_0x3db122];return _0x325b67;};'use strict';var multer=require('multer');var util=require(_0xfff1('0x0'));var path=require(_0xfff1('0x1'));var timeout=require(_0xfff1('0x2'));var express=require('express');var router=express[_0xfff1('0x3')]();var fs_extra=require(_0xfff1('0x4'));var auth=require(_0xfff1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfff1('0x6'));router[_0xfff1('0x7')]('/',auth[_0xfff1('0x8')](),controller['index']);router[_0xfff1('0x7')](_0xfff1('0x9'),auth[_0xfff1('0x8')](),controller['describe']);router[_0xfff1('0x7')](_0xfff1('0xa'),auth[_0xfff1('0x8')](),controller['show']);router[_0xfff1('0xb')]('/',auth[_0xfff1('0x8')](),controller[_0xfff1('0xc')]);router[_0xfff1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xfff1('0xe')]);router[_0xfff1('0xf')](_0xfff1('0xa'),auth[_0xfff1('0x8')](),controller[_0xfff1('0x10')]);module[_0xfff1('0x11')]=router; \ No newline at end of file +var _0xce7c=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','index','isAuthenticated','show','post','put'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xce7c,0x1a9));var _0xcce7=function(_0x20fa63,_0x65c8d3){_0x20fa63=_0x20fa63-0x0;var _0x4c37ae=_0xce7c[_0x20fa63];return _0x4c37ae;};'use strict';var multer=require(_0xcce7('0x0'));var util=require(_0xcce7('0x1'));var path=require(_0xcce7('0x2'));var timeout=require(_0xcce7('0x3'));var express=require(_0xcce7('0x4'));var router=express[_0xcce7('0x5')]();var fs_extra=require(_0xcce7('0x6'));var auth=require(_0xcce7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcce7('0x8'));var controller=require(_0xcce7('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xcce7('0xa')]);router['get']('/describe',auth[_0xcce7('0xb')](),controller['describe']);router['get']('/:id',auth[_0xcce7('0xb')](),controller[_0xcce7('0xc')]);router[_0xcce7('0xd')]('/',auth[_0xcce7('0xb')](),controller['create']);router[_0xcce7('0xe')](_0xcce7('0xf'),auth[_0xcce7('0xb')](),controller[_0xcce7('0x10')]);router[_0xcce7('0x11')]('/:id',auth[_0xcce7('0xb')](),controller[_0xcce7('0x12')]);module[_0xcce7('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 1dbc97a..730ec81 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2b01d9,_0x2e54aa){var _0x3b9d60=function(_0x2f00f8){while(--_0x2f00f8){_0x2b01d9['push'](_0x2b01d9['shift']());}};_0x3b9d60(++_0x2e54aa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x198fa0,_0x43dce9){_0x198fa0=_0x198fa0-0x0;var _0x24e23f=_0xf4eb[_0x198fa0];return _0x24e23f;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5466c2,_0x3308cb){var _0x4b03f8=function(_0x535156){while(--_0x535156){_0x5466c2['push'](_0x5466c2['shift']());}};_0x4b03f8(++_0x3308cb);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3a8cd0,_0x17f29d){_0x3a8cd0=_0x3a8cd0-0x0;var _0x3d6f44=_0xf4eb[_0x3a8cd0];return _0x3d6f44;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 3e5f7a3..2815782 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 _0xfde9=['catch','show','params','rawAttributes','includeAll','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','index','map','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatTransferReport','include','findAll','rows'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xfde9,0x1d2));var _0x9fde=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xfde9[_0x372515];return _0xa3bf4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fde('0x0'));var zipdir=require(_0x9fde('0x1'));var jsonpatch=require(_0x9fde('0x2'));var rp=require('request-promise');var moment=require(_0x9fde('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9fde('0x4'));var sox=require(_0x9fde('0x5'));var csv=require(_0x9fde('0x6'));var ejs=require(_0x9fde('0x7'));var fs=require('fs');var fs_extra=require(_0x9fde('0x8'));var _=require(_0x9fde('0x9'));var squel=require(_0x9fde('0xa'));var crypto=require(_0x9fde('0xb'));var jsforce=require(_0x9fde('0xc'));var deskjs=require(_0x9fde('0xd'));var toCsv=require(_0x9fde('0x6'));var querystring=require(_0x9fde('0xe'));var Papa=require(_0x9fde('0xf'));var Redis=require(_0x9fde('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9fde('0x11'));var as=require(_0x9fde('0x12'));var hardwareService=require(_0x9fde('0x13'));var logger=require('../../config/logger')(_0x9fde('0x14'));var utils=require(_0x9fde('0x15'));var config=require(_0x9fde('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fde('0x17'))['db'];function respondWithStatusCode(_0x28d9c5,_0x1efe7d){_0x1efe7d=_0x1efe7d||0xcc;return function(_0x555629){if(_0x555629){return _0x28d9c5[_0x9fde('0x18')](_0x1efe7d);}return _0x28d9c5[_0x9fde('0x19')](_0x1efe7d)[_0x9fde('0x1a')]();};}function respondWithResult(_0x569c7b,_0x3fe94c){_0x3fe94c=_0x3fe94c||0xc8;return function(_0x29530c){if(_0x29530c){return _0x569c7b[_0x9fde('0x19')](_0x3fe94c)[_0x9fde('0x1b')](_0x29530c);}};}function respondWithFilteredResult(_0x554b4d,_0x2e4349){return function(_0x565e03){if(_0x565e03){var _0xe533aa=typeof _0x2e4349[_0x9fde('0x1c')]==='undefined'&&typeof _0x2e4349[_0x9fde('0x1d')]==='undefined';var _0x795587=_0x565e03[_0x9fde('0x1e')];var _0xfc9197=_0xe533aa?0x0:_0x2e4349[_0x9fde('0x1c')];var _0xea296d=_0xe533aa?_0x565e03[_0x9fde('0x1e')]:_0x2e4349['offset']+_0x2e4349[_0x9fde('0x1d')];var _0x4d2f1c;if(_0xea296d>=_0x795587){_0xea296d=_0x795587;_0x4d2f1c=0xc8;}else{_0x4d2f1c=0xce;}_0x554b4d[_0x9fde('0x19')](_0x4d2f1c);return _0x554b4d[_0x9fde('0x1f')](_0x9fde('0x20'),_0xfc9197+'-'+_0xea296d+'/'+_0x795587)['json'](_0x565e03);}return null;};}function patchUpdates(_0x29c08a){return function(_0x2cc2a4){try{jsonpatch[_0x9fde('0x21')](_0x2cc2a4,_0x29c08a,!![]);}catch(_0x5b6a3e){return BPromise[_0x9fde('0x22')](_0x5b6a3e);}return _0x2cc2a4[_0x9fde('0x23')]();};}function saveUpdates(_0x2ed48d,_0x5b75a0){return function(_0x3f1a9a){if(_0x3f1a9a){return _0x3f1a9a['update'](_0x2ed48d)[_0x9fde('0x24')](function(_0x153614){return _0x153614;});}return null;};}function removeEntity(_0x28839e,_0x38ece0){return function(_0x5d788d){if(_0x5d788d){return _0x5d788d[_0x9fde('0x25')]()['then'](function(){_0x28839e[_0x9fde('0x19')](0xcc)[_0x9fde('0x1a')]();});}};}function handleEntityNotFound(_0x41f67f,_0x9ac7c4){return function(_0x389c8d){if(!_0x389c8d){_0x41f67f[_0x9fde('0x18')](0x194);}return _0x389c8d;};}function handleError(_0xf6890,_0x3b0837){_0x3b0837=_0x3b0837||0x1f4;return function(_0x1d9ec7){logger[_0x9fde('0x26')](_0x1d9ec7[_0x9fde('0x27')]);if(_0x1d9ec7['name']){delete _0x1d9ec7['name'];}_0xf6890[_0x9fde('0x19')](_0x3b0837)['send'](_0x1d9ec7);};}exports[_0x9fde('0x28')]=function(_0x51b088,_0x459347){var _0x2d0065={},_0x5640fa={},_0x4d1e4e={'count':0x0,'rows':[]};var _0x4db725=_[_0x9fde('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x2a0290){return{'name':_0x2a0290[_0x9fde('0x2a')],'type':_0x2a0290[_0x9fde('0x2b')][_0x9fde('0x2c')]};});_0x5640fa['model']=_['map'](_0x4db725,_0x9fde('0x2d'));_0x5640fa['query']=_[_0x9fde('0x2e')](_0x51b088[_0x9fde('0x2f')]);_0x5640fa[_0x9fde('0x30')]=_[_0x9fde('0x31')](_0x5640fa[_0x9fde('0x32')],_0x5640fa[_0x9fde('0x2f')]);_0x2d0065[_0x9fde('0x33')]=_[_0x9fde('0x31')](_0x5640fa[_0x9fde('0x32')],qs[_0x9fde('0x34')](_0x51b088['query']['fields']));_0x2d0065[_0x9fde('0x33')]=_0x2d0065[_0x9fde('0x33')][_0x9fde('0x35')]?_0x2d0065[_0x9fde('0x33')]:_0x5640fa[_0x9fde('0x32')];if(!_0x51b088[_0x9fde('0x2f')][_0x9fde('0x36')]('nolimit')){_0x2d0065['limit']=qs[_0x9fde('0x1d')](_0x51b088['query'][_0x9fde('0x1d')]);_0x2d0065[_0x9fde('0x1c')]=qs['offset'](_0x51b088[_0x9fde('0x2f')][_0x9fde('0x1c')]);}_0x2d0065[_0x9fde('0x37')]=qs[_0x9fde('0x38')](_0x51b088['query']['sort']);_0x2d0065[_0x9fde('0x39')]=qs[_0x9fde('0x30')](_[_0x9fde('0x3a')](_0x51b088[_0x9fde('0x2f')],_0x5640fa[_0x9fde('0x30')]),_0x4db725);if(_0x51b088[_0x9fde('0x2f')][_0x9fde('0x3b')]){_0x2d0065[_0x9fde('0x39')]=_[_0x9fde('0x3c')](_0x2d0065[_0x9fde('0x39')],{'$or':_[_0x9fde('0x29')](_0x4db725,function(_0x5aac3a){if(_0x5aac3a[_0x9fde('0x2b')]!=='VIRTUAL'){var _0x5f396c={};_0x5f396c[_0x5aac3a[_0x9fde('0x2d')]]={'$like':'%'+_0x51b088[_0x9fde('0x2f')][_0x9fde('0x3b')]+'%'};return _0x5f396c;}})});}_0x2d0065=_[_0x9fde('0x3c')]({},_0x2d0065,_0x51b088[_0x9fde('0x3d')]);var _0x7e3093={'where':_0x2d0065[_0x9fde('0x39')]};return db[_0x9fde('0x3e')][_0x9fde('0x1e')](_0x7e3093)[_0x9fde('0x24')](function(_0x4c3b05){_0x4d1e4e[_0x9fde('0x1e')]=_0x4c3b05;if(_0x51b088['query']['includeAll']){_0x2d0065[_0x9fde('0x3f')]=[{'all':!![]}];}return db[_0x9fde('0x3e')][_0x9fde('0x40')](_0x2d0065);})['then'](function(_0x555136){_0x4d1e4e[_0x9fde('0x41')]=_0x555136;return _0x4d1e4e;})[_0x9fde('0x24')](respondWithFilteredResult(_0x459347,_0x2d0065))[_0x9fde('0x42')](handleError(_0x459347,null));};exports[_0x9fde('0x43')]=function(_0xe1514a,_0x2da18b){var _0x50cfba={'raw':!![],'where':{'id':_0xe1514a[_0x9fde('0x44')]['id']}},_0xbde840={};_0xbde840[_0x9fde('0x32')]=_['keys'](db[_0x9fde('0x3e')][_0x9fde('0x45')]);_0xbde840[_0x9fde('0x2f')]=_[_0x9fde('0x2e')](_0xe1514a[_0x9fde('0x2f')]);_0xbde840[_0x9fde('0x30')]=_[_0x9fde('0x31')](_0xbde840[_0x9fde('0x32')],_0xbde840[_0x9fde('0x2f')]);_0x50cfba['attributes']=_['intersection'](_0xbde840[_0x9fde('0x32')],qs[_0x9fde('0x34')](_0xe1514a[_0x9fde('0x2f')][_0x9fde('0x34')]));_0x50cfba['attributes']=_0x50cfba[_0x9fde('0x33')]['length']?_0x50cfba[_0x9fde('0x33')]:_0xbde840[_0x9fde('0x32')];if(_0xe1514a[_0x9fde('0x2f')][_0x9fde('0x46')]){_0x50cfba[_0x9fde('0x3f')]=[{'all':!![]}];}_0x50cfba=_['merge']({},_0x50cfba,_0xe1514a[_0x9fde('0x3d')]);return db[_0x9fde('0x3e')][_0x9fde('0x47')](_0x50cfba)[_0x9fde('0x24')](handleEntityNotFound(_0x2da18b,null))[_0x9fde('0x24')](respondWithResult(_0x2da18b,null))['catch'](handleError(_0x2da18b,null));};exports[_0x9fde('0x48')]=function(_0x153752,_0x3a33ba){return db[_0x9fde('0x3e')][_0x9fde('0x48')](_0x153752[_0x9fde('0x49')],{})['then'](respondWithResult(_0x3a33ba,0xc9))[_0x9fde('0x42')](handleError(_0x3a33ba,null));};exports[_0x9fde('0x4a')]=function(_0x8d1a6a,_0x3e7085){if(_0x8d1a6a['body']['id']){delete _0x8d1a6a['body']['id'];}return db[_0x9fde('0x3e')]['find']({'where':{'id':_0x8d1a6a['params']['id']}})[_0x9fde('0x24')](handleEntityNotFound(_0x3e7085,null))['then'](saveUpdates(_0x8d1a6a[_0x9fde('0x49')],null))['then'](respondWithResult(_0x3e7085,null))[_0x9fde('0x42')](handleError(_0x3e7085,null));};exports['destroy']=function(_0x404534,_0x2997ab){return db['ChatTransferReport'][_0x9fde('0x47')]({'where':{'id':_0x404534[_0x9fde('0x44')]['id']}})['then'](handleEntityNotFound(_0x2997ab,null))[_0x9fde('0x24')](removeEntity(_0x2997ab,null))[_0x9fde('0x42')](handleError(_0x2997ab,null));};exports[_0x9fde('0x4b')]=function(_0x1fbb62,_0x301bc1){return db[_0x9fde('0x3e')][_0x9fde('0x4b')]()[_0x9fde('0x24')](respondWithResult(_0x301bc1,null))[_0x9fde('0x42')](handleError(_0x301bc1,null));}; \ No newline at end of file +var _0x9e8e=['end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x535c96,_0x380486){var _0x10bb40=function(_0x10012c){while(--_0x10012c){_0x535c96['push'](_0x535c96['shift']());}};_0x10bb40(++_0x380486);}(_0x9e8e,0x179));var _0xe9e8=function(_0x15f019,_0x41b4f2){_0x15f019=_0x15f019-0x0;var _0x2a462f=_0x9e8e[_0x15f019];return _0x2a462f;};'use strict';var emlformat=require(_0xe9e8('0x0'));var rimraf=require(_0xe9e8('0x1'));var zipdir=require(_0xe9e8('0x2'));var jsonpatch=require(_0xe9e8('0x3'));var rp=require('request-promise');var moment=require(_0xe9e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe9e8('0x5'));var sox=require('sox');var csv=require(_0xe9e8('0x6'));var ejs=require(_0xe9e8('0x7'));var fs=require('fs');var fs_extra=require(_0xe9e8('0x8'));var _=require('lodash');var squel=require(_0xe9e8('0x9'));var crypto=require(_0xe9e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe9e8('0xb'));var toCsv=require(_0xe9e8('0x6'));var querystring=require(_0xe9e8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9e8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe9e8('0xe'));var licenseUtil=require(_0xe9e8('0xf'));var db=require(_0xe9e8('0x10'))['db'];function respondWithStatusCode(_0x38cde1,_0x4b4861){_0x4b4861=_0x4b4861||0xcc;return function(_0x144a7e){if(_0x144a7e){return _0x38cde1[_0xe9e8('0x11')](_0x4b4861);}return _0x38cde1[_0xe9e8('0x12')](_0x4b4861)['end']();};}function respondWithResult(_0x404d1d,_0x4f98ce){_0x4f98ce=_0x4f98ce||0xc8;return function(_0x132a83){if(_0x132a83){return _0x404d1d[_0xe9e8('0x12')](_0x4f98ce)[_0xe9e8('0x13')](_0x132a83);}};}function respondWithFilteredResult(_0x2935db,_0x39daac){return function(_0x5c8f8b){if(_0x5c8f8b){var _0x29848b=typeof _0x39daac['offset']===_0xe9e8('0x14')&&typeof _0x39daac[_0xe9e8('0x15')]==='undefined';var _0x91f843=_0x5c8f8b[_0xe9e8('0x16')];var _0x42178b=_0x29848b?0x0:_0x39daac[_0xe9e8('0x17')];var _0x597fbe=_0x29848b?_0x5c8f8b['count']:_0x39daac[_0xe9e8('0x17')]+_0x39daac[_0xe9e8('0x15')];var _0x162e2e;if(_0x597fbe>=_0x91f843){_0x597fbe=_0x91f843;_0x162e2e=0xc8;}else{_0x162e2e=0xce;}_0x2935db[_0xe9e8('0x12')](_0x162e2e);return _0x2935db['set'](_0xe9e8('0x18'),_0x42178b+'-'+_0x597fbe+'/'+_0x91f843)[_0xe9e8('0x13')](_0x5c8f8b);}return null;};}function patchUpdates(_0x405a46){return function(_0x289b1e){try{jsonpatch[_0xe9e8('0x19')](_0x289b1e,_0x405a46,!![]);}catch(_0x87a9d2){return BPromise[_0xe9e8('0x1a')](_0x87a9d2);}return _0x289b1e[_0xe9e8('0x1b')]();};}function saveUpdates(_0x34174a,_0x2746d9){return function(_0x1b9f9a){if(_0x1b9f9a){return _0x1b9f9a[_0xe9e8('0x1c')](_0x34174a)['then'](function(_0x326e15){return _0x326e15;});}return null;};}function removeEntity(_0x453d2e,_0x591d4d){return function(_0x701dca){if(_0x701dca){return _0x701dca[_0xe9e8('0x1d')]()[_0xe9e8('0x1e')](function(){_0x453d2e[_0xe9e8('0x12')](0xcc)[_0xe9e8('0x1f')]();});}};}function handleEntityNotFound(_0x30e1fb,_0x51312b){return function(_0xbd9dcd){if(!_0xbd9dcd){_0x30e1fb['sendStatus'](0x194);}return _0xbd9dcd;};}function handleError(_0x84847c,_0x14d85d){_0x14d85d=_0x14d85d||0x1f4;return function(_0xe8c7c6){logger[_0xe9e8('0x20')](_0xe8c7c6[_0xe9e8('0x21')]);if(_0xe8c7c6[_0xe9e8('0x22')]){delete _0xe8c7c6['name'];}_0x84847c[_0xe9e8('0x12')](_0x14d85d)[_0xe9e8('0x23')](_0xe8c7c6);};}exports[_0xe9e8('0x24')]=function(_0x1938c7,_0x4d3695){var _0x3771e7={},_0x5255be={},_0x277ca4={'count':0x0,'rows':[]};var _0x427193=_[_0xe9e8('0x25')](db[_0xe9e8('0x26')][_0xe9e8('0x27')],function(_0x1425a5){return{'name':_0x1425a5[_0xe9e8('0x28')],'type':_0x1425a5['type']['key']};});_0x5255be[_0xe9e8('0x29')]=_[_0xe9e8('0x25')](_0x427193,_0xe9e8('0x22'));_0x5255be[_0xe9e8('0x2a')]=_['keys'](_0x1938c7[_0xe9e8('0x2a')]);_0x5255be[_0xe9e8('0x2b')]=_[_0xe9e8('0x2c')](_0x5255be[_0xe9e8('0x29')],_0x5255be['query']);_0x3771e7['attributes']=_[_0xe9e8('0x2c')](_0x5255be[_0xe9e8('0x29')],qs[_0xe9e8('0x2d')](_0x1938c7['query']['fields']));_0x3771e7[_0xe9e8('0x2e')]=_0x3771e7[_0xe9e8('0x2e')][_0xe9e8('0x2f')]?_0x3771e7[_0xe9e8('0x2e')]:_0x5255be[_0xe9e8('0x29')];if(!_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x30')]('nolimit')){_0x3771e7[_0xe9e8('0x15')]=qs['limit'](_0x1938c7['query'][_0xe9e8('0x15')]);_0x3771e7[_0xe9e8('0x17')]=qs[_0xe9e8('0x17')](_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x17')]);}_0x3771e7[_0xe9e8('0x31')]=qs['sort'](_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x32')]);_0x3771e7[_0xe9e8('0x33')]=qs[_0xe9e8('0x2b')](_[_0xe9e8('0x34')](_0x1938c7[_0xe9e8('0x2a')],_0x5255be[_0xe9e8('0x2b')]),_0x427193);if(_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x35')]){_0x3771e7[_0xe9e8('0x33')]=_[_0xe9e8('0x36')](_0x3771e7[_0xe9e8('0x33')],{'$or':_[_0xe9e8('0x25')](_0x427193,function(_0x5a233a){if(_0x5a233a['type']!==_0xe9e8('0x37')){var _0x7164ae={};_0x7164ae[_0x5a233a[_0xe9e8('0x22')]]={'$like':'%'+_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x35')]+'%'};return _0x7164ae;}})});}_0x3771e7=_[_0xe9e8('0x36')]({},_0x3771e7,_0x1938c7[_0xe9e8('0x38')]);var _0x1daad8={'where':_0x3771e7[_0xe9e8('0x33')]};return db['ChatTransferReport'][_0xe9e8('0x16')](_0x1daad8)[_0xe9e8('0x1e')](function(_0x57efd6){_0x277ca4['count']=_0x57efd6;if(_0x1938c7[_0xe9e8('0x2a')][_0xe9e8('0x39')]){_0x3771e7[_0xe9e8('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe9e8('0x3b')](_0x3771e7);})[_0xe9e8('0x1e')](function(_0x1ca91a){_0x277ca4[_0xe9e8('0x3c')]=_0x1ca91a;return _0x277ca4;})[_0xe9e8('0x1e')](respondWithFilteredResult(_0x4d3695,_0x3771e7))[_0xe9e8('0x3d')](handleError(_0x4d3695,null));};exports['show']=function(_0xf36ad1,_0x82da5){var _0x10282c={'raw':!![],'where':{'id':_0xf36ad1[_0xe9e8('0x3e')]['id']}},_0x37635c={};_0x37635c[_0xe9e8('0x29')]=_[_0xe9e8('0x3f')](db['ChatTransferReport'][_0xe9e8('0x27')]);_0x37635c[_0xe9e8('0x2a')]=_[_0xe9e8('0x3f')](_0xf36ad1[_0xe9e8('0x2a')]);_0x37635c['filters']=_[_0xe9e8('0x2c')](_0x37635c[_0xe9e8('0x29')],_0x37635c[_0xe9e8('0x2a')]);_0x10282c['attributes']=_[_0xe9e8('0x2c')](_0x37635c['model'],qs[_0xe9e8('0x2d')](_0xf36ad1[_0xe9e8('0x2a')][_0xe9e8('0x2d')]));_0x10282c[_0xe9e8('0x2e')]=_0x10282c[_0xe9e8('0x2e')][_0xe9e8('0x2f')]?_0x10282c[_0xe9e8('0x2e')]:_0x37635c[_0xe9e8('0x29')];if(_0xf36ad1[_0xe9e8('0x2a')][_0xe9e8('0x39')]){_0x10282c[_0xe9e8('0x3a')]=[{'all':!![]}];}_0x10282c=_[_0xe9e8('0x36')]({},_0x10282c,_0xf36ad1[_0xe9e8('0x38')]);return db['ChatTransferReport'][_0xe9e8('0x40')](_0x10282c)[_0xe9e8('0x1e')](handleEntityNotFound(_0x82da5,null))[_0xe9e8('0x1e')](respondWithResult(_0x82da5,null))[_0xe9e8('0x3d')](handleError(_0x82da5,null));};exports[_0xe9e8('0x41')]=function(_0x5021f1,_0x49e4cc){return db[_0xe9e8('0x26')]['create'](_0x5021f1['body'],{})[_0xe9e8('0x1e')](respondWithResult(_0x49e4cc,0xc9))[_0xe9e8('0x3d')](handleError(_0x49e4cc,null));};exports[_0xe9e8('0x1c')]=function(_0x484aa0,_0x42a47a){if(_0x484aa0[_0xe9e8('0x42')]['id']){delete _0x484aa0['body']['id'];}return db[_0xe9e8('0x26')][_0xe9e8('0x40')]({'where':{'id':_0x484aa0[_0xe9e8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42a47a,null))[_0xe9e8('0x1e')](saveUpdates(_0x484aa0[_0xe9e8('0x42')],null))[_0xe9e8('0x1e')](respondWithResult(_0x42a47a,null))[_0xe9e8('0x3d')](handleError(_0x42a47a,null));};exports[_0xe9e8('0x1d')]=function(_0x1ef052,_0x6393d4){return db['ChatTransferReport'][_0xe9e8('0x40')]({'where':{'id':_0x1ef052[_0xe9e8('0x3e')]['id']}})[_0xe9e8('0x1e')](handleEntityNotFound(_0x6393d4,null))[_0xe9e8('0x1e')](removeEntity(_0x6393d4,null))[_0xe9e8('0x3d')](handleError(_0x6393d4,null));};exports['describe']=function(_0x399e14,_0x286c2a){return db['ChatTransferReport'][_0xe9e8('0x43')]()[_0xe9e8('0x1e')](respondWithResult(_0x286c2a,null))['catch'](handleError(_0x286c2a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d3ba085..df976db 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 _0xf5f2=['request-promise','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3f4bab,_0xbf42f9){var _0x27fd30=function(_0x531b17){while(--_0x531b17){_0x3f4bab['push'](_0x3f4bab['shift']());}};_0x27fd30(++_0xbf42f9);}(_0xf5f2,0x14d));var _0x2f5f=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf5f2[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x2f5f('0x0'));var util=require('util');var logger=require(_0x2f5f('0x1'))(_0x2f5f('0x2'));var moment=require(_0x2f5f('0x3'));var BPromise=require(_0x2f5f('0x4'));var rp=require(_0x2f5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f5f('0x7'));module[_0x2f5f('0x8')]=function(_0x5a1df6,_0x3e5ca1){return _0x5a1df6[_0x2f5f('0x9')](_0x2f5f('0xa'),attributes,{'tableName':_0x2f5f('0xb'),'paranoid':![],'indexes':[{'name':_0x2f5f('0xc'),'fields':[_0x2f5f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd24=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x3c33c1,_0x200481){var _0x1ce9c1=function(_0x255c5b){while(--_0x255c5b){_0x3c33c1['push'](_0x3c33c1['shift']());}};_0x1ce9c1(++_0x200481);}(_0xdd24,0x9b));var _0x4dd2=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xdd24[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x4dd2('0x0'));var logger=require(_0x4dd2('0x1'))('api');var moment=require(_0x4dd2('0x2'));var BPromise=require('bluebird');var rp=require(_0x4dd2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4dd2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4dd2('0x5'));module[_0x4dd2('0x6')]=function(_0x3a602f,_0x94aedd){return _0x3a602f[_0x4dd2('0x7')](_0x4dd2('0x8'),attributes,{'tableName':_0x4dd2('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','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 e8dadf9..07ec961 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 _0xccad=['then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccad,0x1d9));var _0xdcca=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xccad[_0x256b72];return _0x2183e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdcca('0x0'));var rs=require(_0xdcca('0x1'));var fs=require('fs');var Redis=require(_0xdcca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcca('0x3'));var logger=require(_0xdcca('0x4'))(_0xdcca('0x5'));var config=require(_0xdcca('0x6'));var jayson=require(_0xdcca('0x7'));var client=jayson['client'][_0xdcca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41966d,_0x4511bf,_0x420d49){return new BPromise(function(_0x586d9c,_0x1b4d1e){return client[_0xdcca('0x9')](_0x41966d,_0x420d49)[_0xdcca('0xa')](function(_0x34e804){logger[_0xdcca('0xb')](_0xdcca('0xc'),_0x4511bf,_0xdcca('0xd'));logger[_0xdcca('0xe')](_0xdcca('0xf'),_0x4511bf,_0xdcca('0xd'),JSON[_0xdcca('0x10')](_0x34e804));if(_0x34e804[_0xdcca('0x11')]){if(_0x34e804[_0xdcca('0x11')][_0xdcca('0x12')]===0x1f4){logger[_0xdcca('0x11')](_0xdcca('0xc'),_0x4511bf,_0x34e804[_0xdcca('0x11')]['message']);return _0x1b4d1e(_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);}logger[_0xdcca('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4511bf,_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);return _0x586d9c(_0x34e804[_0xdcca('0x11')][_0xdcca('0x13')]);}else{logger[_0xdcca('0xb')](_0xdcca('0xc'),_0x4511bf,_0xdcca('0xd'));_0x586d9c(_0x34e804[_0xdcca('0x14')][_0xdcca('0x13')]);}})['catch'](function(_0x5afb11){logger[_0xdcca('0x11')](_0xdcca('0xc'),_0x4511bf,_0x5afb11);_0x1b4d1e(_0x5afb11);});});} \ No newline at end of file +var _0xf981=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf981,0xaa));var _0x1f98=function(_0x240e0d,_0x551a41){_0x240e0d=_0x240e0d-0x0;var _0x45a0f3=_0xf981[_0x240e0d];return _0x45a0f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f98('0x0'));var BPromise=require(_0x1f98('0x1'));var rs=require(_0x1f98('0x2'));var fs=require('fs');var Redis=require(_0x1f98('0x3'));var db=require(_0x1f98('0x4'))['db'];var utils=require(_0x1f98('0x5'));var logger=require('../../config/logger')(_0x1f98('0x6'));var config=require('../../config/environment');var jayson=require(_0x1f98('0x7'));var client=jayson[_0x1f98('0x8')][_0x1f98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8ff00c,_0x15049a,_0x38b0d7){return new BPromise(function(_0x1466ba,_0x3165cc){return client['request'](_0x8ff00c,_0x38b0d7)[_0x1f98('0xa')](function(_0x1e1d1c){logger[_0x1f98('0xb')](_0x1f98('0xc'),_0x15049a,_0x1f98('0xd'));logger[_0x1f98('0xe')](_0x1f98('0xf'),_0x15049a,_0x1f98('0xd'),JSON['stringify'](_0x1e1d1c));if(_0x1e1d1c[_0x1f98('0x10')]){if(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x11')]===0x1f4){logger[_0x1f98('0x10')](_0x1f98('0xc'),_0x15049a,_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);return _0x3165cc(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);}logger['error'](_0x1f98('0xc'),_0x15049a,_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);return _0x1466ba(_0x1e1d1c[_0x1f98('0x10')][_0x1f98('0x12')]);}else{logger['info'](_0x1f98('0xc'),_0x15049a,_0x1f98('0xd'));_0x1466ba(_0x1e1d1c[_0x1f98('0x13')][_0x1f98('0x12')]);}})[_0x1f98('0x14')](function(_0x22748d){logger[_0x1f98('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x15049a,_0x22748d);_0x3165cc(_0x22748d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index c83e6da..ac7e1ad 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 _0x5162=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x249e56,_0x48b38b){var _0x33d16f=function(_0x48823d){while(--_0x48823d){_0x249e56['push'](_0x249e56['shift']());}};_0x33d16f(++_0x48b38b);}(_0x5162,0x7d));var _0x2516=function(_0x39cff5,_0x234f0c){_0x39cff5=_0x39cff5-0x0;var _0x430437=_0x5162[_0x39cff5];return _0x430437;};'use strict';var multer=require('multer');var util=require(_0x2516('0x0'));var path=require(_0x2516('0x1'));var timeout=require(_0x2516('0x2'));var express=require('express');var router=express[_0x2516('0x3')]();var fs_extra=require(_0x2516('0x4'));var auth=require(_0x2516('0x5'));var interaction=require(_0x2516('0x6'));var config=require('../../config/environment');var controller=require(_0x2516('0x7'));router[_0x2516('0x8')]('/',auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x8')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router[_0x2516('0x8')](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0xe')]);router[_0x2516('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2516('0x10')]('/:id',auth[_0x2516('0x9')](),controller[_0x2516('0x11')]);router[_0x2516('0x12')](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0x13')]);module[_0x2516('0x14')]=router; \ No newline at end of file +var _0x09c0=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','show','post'];(function(_0x164f9a,_0x1342ca){var _0x3062e3=function(_0x2dcd24){while(--_0x2dcd24){_0x164f9a['push'](_0x164f9a['shift']());}};_0x3062e3(++_0x1342ca);}(_0x09c0,0x79));var _0x009c=function(_0x47fa0f,_0x2a471e){_0x47fa0f=_0x47fa0f-0x0;var _0x30005a=_0x09c0[_0x47fa0f];return _0x30005a;};'use strict';var multer=require(_0x009c('0x0'));var util=require(_0x009c('0x1'));var path=require(_0x009c('0x2'));var timeout=require(_0x009c('0x3'));var express=require(_0x009c('0x4'));var router=express[_0x009c('0x5')]();var fs_extra=require(_0x009c('0x6'));var auth=require(_0x009c('0x7'));var interaction=require(_0x009c('0x8'));var config=require(_0x009c('0x9'));var controller=require(_0x009c('0xa'));router[_0x009c('0xb')]('/',auth[_0x009c('0xc')](),controller[_0x009c('0xd')]);router[_0x009c('0xb')]('/describe',auth[_0x009c('0xc')](),controller[_0x009c('0xe')]);router[_0x009c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x009c('0xf')]);router[_0x009c('0x10')]('/',auth[_0x009c('0xc')](),controller[_0x009c('0x11')]);router[_0x009c('0x12')](_0x009c('0x13'),auth[_0x009c('0xc')](),controller[_0x009c('0x14')]);router[_0x009c('0x15')](_0x009c('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x009c('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 5e6624c..ae5fdf0 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 _0x5ff3=['text','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','input','name'];(function(_0x45b0b3,_0x565a05){var _0x282d6f=function(_0x13a774){while(--_0x13a774){_0x45b0b3['push'](_0x45b0b3['shift']());}};_0x282d6f(++_0x565a05);}(_0x5ff3,0x17d));var _0x35ff=function(_0x96ed10,_0x4dbe3f){_0x96ed10=_0x96ed10-0x0;var _0x4d603f=_0x5ff3[_0x96ed10];return _0x4d603f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x35ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35ff('0x2')},'description':{'type':Sequelize[_0x35ff('0x1')]},'mapKey':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x3')},'key':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x4')},'customerAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35ff('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x35ff('0x1')]},'animation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x35ff('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x9')},'offline_chat_button':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xb')},'download_transcript':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x35ff('0xe')]},'closingQuestion':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x11')},'noteTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x12')},'placeholderMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x13')},'closingMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0xa')},'skipMessageButton':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'conditionAgreement':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x35ff('0x16')](_0x35ff('0x17'),_0x35ff('0x18')),'defaultValue':_0x35ff('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x35ff('0x19'),'variable':null,'config':{'placeholder':_0x35ff('0x1a'),'type':_0x35ff('0x1b'),'required':!![]},'props':{'title':_0x35ff('0x1a'),'helpText':''}},{'type':_0x35ff('0x19'),'props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x1d'))?JSON['parse'](this[_0x35ff('0x1c')]('onlineForm')):{};},'set':function(_0x4c46b7){return this[_0x35ff('0x1e')](_0x35ff('0x1d'),JSON[_0x35ff('0x1f')](_0x4c46b7));}},'offlineForm':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return JSON[_0x35ff('0x1f')]({'items':[{'type':'input','props':{'title':_0x35ff('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x35ff('0x3'),'type':_0x35ff('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x35ff('0x20')},'props':{'title':_0x35ff('0x20'),'helpText':_0x35ff('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x35ff('0x1c')](_0x35ff('0x22'))?JSON[_0x35ff('0x23')](this[_0x35ff('0x1c')](_0x35ff('0x22'))):{};},'set':function(_0x105e58){return this['setDataValue'](_0x35ff('0x22'),JSON['stringify'](_0x105e58));}},'token':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return rs[_0x35ff('0x24')]();}},'autoclose':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x35ff('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x35ff('0x1')]},'waitingTitle':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x35ff('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x27')},'skipUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x15')},'sendUnmanaged':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x35ff('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x35ff('0x1')]},'notificationTemplate':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':function(){return _0x35ff('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2b')},'messagesAlignment':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2c')},'defaultTitle':{'type':Sequelize[_0x35ff('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x35ff('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35ff('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':_0x35ff('0x2d')},'systemAvatar':{'type':Sequelize[_0x35ff('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35ff('0xc')],'comment':_0x35ff('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x550c09){if(!_0x550c09)this[_0x35ff('0x1e')](_0x35ff('0x2f'),null);this[_0x35ff('0x1e')](_0x35ff('0x30'),_0x550c09);}},'vidaooEscalation':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![],'defaultValue':_0x35ff('0x31')},'vidaooNote':{'type':Sequelize[_0x35ff('0x1')],'defaultValue':function(){return _0x35ff('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x35ff('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x35ff('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','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','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x3ef9f7,_0x1bfbf6){var _0x4c9ded=function(_0x32c994){while(--_0x32c994){_0x3ef9f7['push'](_0x3ef9f7['shift']());}};_0x4c9ded(++_0x1bfbf6);}(_0x9f62,0x154));var _0x29f6=function(_0x4135fd,_0x4dd3c8){_0x4135fd=_0x4135fd-0x0;var _0x3ab658=_0x9f62[_0x4135fd];return _0x3ab658;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4f385af..e7e2dba 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 _0x520c=['includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','server/files/images/avatars/system_avatar.png','notify','user-agent','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','Contacts','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','user','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','email','NotifyMailAccount','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','addApplications','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','ChatOfflineMessage','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','params','mandatoryDispositionPause'];(function(_0x1988a6,_0x92744b){var _0x48ca22=function(_0x159a67){while(--_0x159a67){_0x1988a6['push'](_0x1988a6['shift']());}};_0x48ca22(++_0x92744b);}(_0x520c,0xd5));var _0xc520=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x520c[_0xabbd2f];return _0x34a040;};'use strict';var BPromise=require(_0xc520('0x0'));var Mustache=require(_0xc520('0x1'));var util=require(_0xc520('0x2'));var path=require('path');var ejs=require(_0xc520('0x3'));var fs=require('fs');var fs_extra=require(_0xc520('0x4'));var _=require(_0xc520('0x5'));var querystring=require(_0xc520('0x6'));var Redis=require('ioredis');var qs=require(_0xc520('0x7'));var logger=require(_0xc520('0x8'))(_0xc520('0x9'));var config=require(_0xc520('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc520('0xb')](config[_0xc520('0xc')],{'host':_0xc520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc520('0xc')]));require(_0xc520('0xe'))[_0xc520('0xf')](socket);var htmlToText=require(_0xc520('0x10'));var jayson=require('jayson/promise');var client=jayson[_0xc520('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc520('0x11')][_0xc520('0x12')]({'port':0x232a});var client9003=jayson[_0xc520('0x11')][_0xc520('0x12')]({'port':0x232b});var client9001=jayson[_0xc520('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4beb3c,_0x32db26,_0x24ab50,_0x30cf1f){return new BPromise(function(_0x54a39e,_0x3fc182){var _0x9b0c49=_0x30cf1f||client;return _0x9b0c49[_0xc520('0x13')](_0x4beb3c,_0x24ab50)[_0xc520('0x14')](function(_0x467ef5){logger[_0xc520('0x15')](_0xc520('0x16'),_0x32db26,'request\x20sent');logger['debug'](_0xc520('0x17'),_0x32db26,_0xc520('0x18'),JSON[_0xc520('0x19')](_0x467ef5));if(_0x467ef5[_0xc520('0x1a')]){if(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1b')]===0x1f4){logger[_0xc520('0x1a')](_0xc520('0x16'),_0x32db26,_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);return _0x3fc182(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);}logger[_0xc520('0x1a')](_0xc520('0x16'),_0x32db26,_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);return _0x54a39e(_0x467ef5[_0xc520('0x1a')][_0xc520('0x1c')]);}else{logger[_0xc520('0x15')](_0xc520('0x16'),_0x32db26,'request\x20sent');_0x54a39e(_0x467ef5[_0xc520('0x1d')][_0xc520('0x1c')]);}})[_0xc520('0x1e')](function(_0x19c612){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x32db26,_0x19c612);_0x3fc182(_0x19c612);});});}function respondWithStatusCode(_0x5e19a0,_0x268d06){_0x268d06=_0x268d06||0xcc;return function(_0x294cfe){if(_0x294cfe){return _0x5e19a0['sendStatus'](_0x268d06);}return _0x5e19a0[_0xc520('0x1f')](_0x268d06)['end']();};}function respondWithResult(_0xfbf124,_0x194586){_0x194586=_0x194586||0xc8;return function(_0x3a6bf3){if(_0x3a6bf3){return _0xfbf124['status'](_0x194586)[_0xc520('0x20')](_0x3a6bf3);}};}function respondWithFilteredResult(_0x2f8c43,_0x17b651){return function(_0x458697){if(_0x458697){var _0x3c6d98=typeof _0x17b651[_0xc520('0x21')]===_0xc520('0x22')&&typeof _0x17b651[_0xc520('0x23')]===_0xc520('0x22');var _0x570e8d=_0x458697[_0xc520('0x24')];var _0x37ae7f=_0x3c6d98?0x0:_0x17b651[_0xc520('0x21')];var _0x163d97=_0x3c6d98?_0x458697['count']:_0x17b651[_0xc520('0x21')]+_0x17b651[_0xc520('0x23')];var _0x398712;if(_0x163d97>=_0x570e8d){_0x163d97=_0x570e8d;_0x398712=0xc8;}else{_0x398712=0xce;}_0x2f8c43[_0xc520('0x1f')](_0x398712);return _0x2f8c43[_0xc520('0x25')](_0xc520('0x26'),_0x37ae7f+'-'+_0x163d97+'/'+_0x570e8d)[_0xc520('0x20')](_0x458697);}return null;};}function saveUpdates(_0x46b207){return function(_0x17199e){if(_0x17199e){return _0x17199e[_0xc520('0x27')](_0x46b207)[_0xc520('0x14')](function(_0x24a078){return _0x24a078;});}return null;};}function removeEntity(_0x48b3c4){return function(_0x1ca8e6){if(_0x1ca8e6){return _0x1ca8e6[_0xc520('0x28')]()['then'](function(){var _0x33a479=_0x1ca8e6[_0xc520('0x29')]({'plain':!![]});var _0x1b61f2=_0xc520('0x2a');return db[_0xc520('0x2b')][_0xc520('0x28')]({'where':{'type':_0x1b61f2,'resourceId':_0x33a479['id']}})[_0xc520('0x14')](function(){return _0x1ca8e6;});})[_0xc520('0x14')](function(){_0x48b3c4[_0xc520('0x1f')](0xcc)[_0xc520('0x2c')]();});}};}function handleEntityNotFound(_0x1e97b3){return function(_0x44524a){if(!_0x44524a){_0x1e97b3[_0xc520('0x2d')](0x194);}return _0x44524a;};}function handleError(_0x376b4e,_0xb5591e){_0xb5591e=_0xb5591e||0x1f4;return function(_0x1bde96){logger[_0xc520('0x1a')](_0x1bde96[_0xc520('0x2e')]);if(_0x1bde96[_0xc520('0x2f')]){delete _0x1bde96[_0xc520('0x2f')];}_0x376b4e[_0xc520('0x1f')](_0xb5591e)['send'](_0x1bde96);};}exports[_0xc520('0x30')]=function(_0x3b467f,_0x375cc8){var _0x2ee155={'include':[{'model':db[_0xc520('0x31')],'as':'mandatoryDispositionPause'}]},_0x13a2da={},_0x3b8e64={'count':0x0,'rows':[]};var _0x5e50fd=_[_0xc520('0x32')](db[_0xc520('0x33')][_0xc520('0x34')],function(_0x133bc6){return{'name':_0x133bc6[_0xc520('0x35')],'type':_0x133bc6[_0xc520('0x36')]['key']};});_0x13a2da['model']=_[_0xc520('0x32')](_0x5e50fd,_0xc520('0x2f'));_0x13a2da[_0xc520('0x37')]=_[_0xc520('0x38')](_0x3b467f[_0xc520('0x37')]);_0x13a2da[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x13a2da['model'],_0x13a2da['query']);_0x2ee155[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x13a2da[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x3b467f[_0xc520('0x37')][_0xc520('0x3d')]));_0x2ee155[_0xc520('0x3b')]=_0x2ee155[_0xc520('0x3b')][_0xc520('0x3e')]?_0x2ee155[_0xc520('0x3b')]:_0x13a2da[_0xc520('0x3c')];if(!_0x3b467f[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0x2ee155[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x3b467f['query'][_0xc520('0x23')]);_0x2ee155[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x3b467f[_0xc520('0x37')][_0xc520('0x21')]);}_0x2ee155[_0xc520('0x41')]=qs['sort'](_0x3b467f['query'][_0xc520('0x42')]);_0x2ee155[_0xc520('0x43')]=qs[_0xc520('0x39')](_['pick'](_0x3b467f['query'],_0x13a2da['filters']),_0x5e50fd);if(_0x3b467f[_0xc520('0x37')][_0xc520('0x44')]){_0x2ee155['where']=_[_0xc520('0x45')](_0x2ee155[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x5e50fd,function(_0x474c88){if(_0x474c88[_0xc520('0x36')]!==_0xc520('0x46')){var _0x44e4f1={};_0x44e4f1[_0x474c88[_0xc520('0x2f')]]={'$like':'%'+_0x3b467f[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x44e4f1;}})});}_0x2ee155=_['merge']({},_0x2ee155,_0x3b467f['options']);var _0x17fdd2={'where':_0x2ee155[_0xc520('0x43')]};return db[_0xc520('0x33')]['count'](_0x17fdd2)[_0xc520('0x14')](function(_0x4608d1){_0x3b8e64[_0xc520('0x24')]=_0x4608d1;if(_0x3b467f[_0xc520('0x37')]['includeAll']){_0x2ee155[_0xc520('0x47')]=[{'all':!![]}];}return db[_0xc520('0x33')][_0xc520('0x48')](_0x2ee155);})[_0xc520('0x14')](function(_0x9d2a4f){_0x3b8e64[_0xc520('0x49')]=_0x9d2a4f;return _0x3b8e64;})['then'](respondWithFilteredResult(_0x375cc8,_0x2ee155))[_0xc520('0x1e')](handleError(_0x375cc8,null));};exports['show']=function(_0x47cd58,_0x2a7af5){var _0xe9508d={'raw':![],'where':{'id':_0x47cd58[_0xc520('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xc520('0x4b')}]},_0x1d7bbe={};_0x1d7bbe[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0x33')][_0xc520('0x34')]);_0x1d7bbe[_0xc520('0x37')]=_[_0xc520('0x38')](_0x47cd58[_0xc520('0x37')]);_0x1d7bbe[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x1d7bbe[_0xc520('0x3c')],_0x1d7bbe[_0xc520('0x37')]);_0xe9508d[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x1d7bbe['model'],qs[_0xc520('0x3d')](_0x47cd58[_0xc520('0x37')]['fields']));_0xe9508d[_0xc520('0x3b')]=_0xe9508d[_0xc520('0x3b')][_0xc520('0x3e')]?_0xe9508d['attributes']:_0x1d7bbe[_0xc520('0x3c')];if(_0x47cd58['query'][_0xc520('0x4c')]){_0xe9508d[_0xc520('0x47')]=[{'all':!![]}];}_0xe9508d=_['merge']({},_0xe9508d,_0x47cd58[_0xc520('0x4d')]);return db['ChatWebsite'][_0xc520('0x4e')](_0xe9508d)[_0xc520('0x14')](handleEntityNotFound(_0x2a7af5,null))['then'](respondWithResult(_0x2a7af5,null))[_0xc520('0x1e')](handleError(_0x2a7af5,null));};exports[_0xc520('0x4f')]=function(_0x1e844a,_0x11f398){return db['ChatWebsite'][_0xc520('0x4f')](_0x1e844a['body'],{})[_0xc520('0x14')](function(_0x5ec85f){var _0x2a82a8=_0x1e844a['user'][_0xc520('0x29')]({'plain':!![]});if(!_0x2a82a8)throw new Error(_0xc520('0x50'));if(_0x2a82a8[_0xc520('0x51')]==='user'){var _0x2d7e9a=_0x5ec85f[_0xc520('0x29')]({'plain':!![]});var _0x2fd347='ChatWebsites';return db[_0xc520('0x52')][_0xc520('0x4e')]({'where':{'name':_0x2fd347,'userProfileId':_0x2a82a8[_0xc520('0x53')]},'raw':!![]})['then'](function(_0x5ef7a0){if(_0x5ef7a0&&_0x5ef7a0[_0xc520('0x54')]===0x0){return db[_0xc520('0x2b')]['create']({'name':_0x2d7e9a[_0xc520('0x2f')],'resourceId':_0x2d7e9a['id'],'type':_0x5ef7a0[_0xc520('0x2f')],'sectionId':_0x5ef7a0['id']},{})['then'](function(){return _0x5ec85f;});}else{return _0x5ec85f;}})['catch'](function(_0x14192a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14192a);throw _0x14192a;});}return _0x5ec85f;})[_0xc520('0x14')](respondWithResult(_0x11f398,0xc9))[_0xc520('0x1e')](handleError(_0x11f398,null));};exports[_0xc520('0x27')]=function(_0x383a35,_0x242e33){if(_0x383a35[_0xc520('0x55')]['id']){delete _0x383a35[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x383a35['params']['id']},'include':[{'model':db[_0xc520('0x31')],'as':_0xc520('0x4b')}]})[_0xc520('0x14')](handleEntityNotFound(_0x242e33,null))['then'](saveUpdates(_0x383a35[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x242e33,null))[_0xc520('0x1e')](handleError(_0x242e33,null));};exports[_0xc520('0x28')]=function(_0x14f9e2,_0x4e90f1){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x14f9e2[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4e90f1,null))['then'](removeEntity(_0x4e90f1,null))['catch'](handleError(_0x4e90f1,null));};exports['describe']=function(_0x5332ea,_0x22cc15){return db[_0xc520('0x33')][_0xc520('0x56')]()[_0xc520('0x14')](respondWithResult(_0x22cc15,null))[_0xc520('0x1e')](handleError(_0x22cc15,null));};exports['addDisposition']=function(_0x14bf5d,_0x9b209d){if(_0x14bf5d[_0xc520('0x55')]['id']){delete _0x14bf5d[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x14bf5d[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x9b209d,null))[_0xc520('0x14')](function(_0x5d4682){if(_0x5d4682){_0x14bf5d[_0xc520('0x55')][_0xc520('0x57')]=_0x5d4682['id'];return db[_0xc520('0x58')][_0xc520('0x4f')](_0x14bf5d[_0xc520('0x55')]);}})[_0xc520('0x14')](respondWithResult(_0x9b209d,null))['catch'](handleError(_0x9b209d,null));};exports[_0xc520('0x59')]=function(_0x2f4433,_0x507599){var _0x4d9742={'raw':![],'where':{}};var _0x5f4051={};var _0x336a59={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x2f4433[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x507599,null))[_0xc520('0x14')](function(_0x2b3512){if(_0x2b3512){_0x5f4051['model']=_[_0xc520('0x38')](db['Disposition'][_0xc520('0x34')]);_0x5f4051[_0xc520('0x37')]=_[_0xc520('0x38')](_0x2f4433[_0xc520('0x37')]);_0x5f4051[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x5f4051[_0xc520('0x3c')],_0x5f4051[_0xc520('0x37')]);_0x4d9742[_0xc520('0x3b')]=_['intersection'](_0x5f4051['model'],qs['fields'](_0x2f4433[_0xc520('0x37')][_0xc520('0x3d')]));_0x4d9742['attributes']=_0x4d9742['attributes'][_0xc520('0x3e')]?_0x4d9742['attributes']:_0x5f4051[_0xc520('0x3c')];if(!_0x2f4433[_0xc520('0x37')][_0xc520('0x3f')]('nolimit')){_0x4d9742[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x2f4433[_0xc520('0x37')][_0xc520('0x23')]);_0x4d9742[_0xc520('0x21')]=qs['offset'](_0x2f4433[_0xc520('0x37')][_0xc520('0x21')]);}_0x4d9742[_0xc520('0x41')]=qs['sort'](_0x2f4433[_0xc520('0x37')]['sort']);_0x4d9742[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x2f4433[_0xc520('0x37')],_0x5f4051[_0xc520('0x39')]));_0x4d9742[_0xc520('0x43')][_0xc520('0x57')]=_0x2b3512['id'];if(_0x2f4433[_0xc520('0x37')][_0xc520('0x44')]){_0x4d9742[_0xc520('0x43')]=_['merge'](_0x4d9742['where'],{'$or':_[_0xc520('0x32')](_0x4d9742['attributes'],function(_0x28e5fe){var _0x465839={};_0x465839[_0x28e5fe]={'$like':'%'+_0x2f4433['query']['filter']+'%'};return _0x465839;})});}_0x4d9742=_[_0xc520('0x45')]({},_0x4d9742,_0x2f4433['options']);return db[_0xc520('0x58')][_0xc520('0x24')]({'where':_0x4d9742[_0xc520('0x43')]})['then'](function(_0x52c44b){_0x336a59['count']=_0x52c44b;if(_0x2f4433['query']['includeAll']){_0x4d9742[_0xc520('0x47')]=[{'all':!![]}];}return db['Disposition'][_0xc520('0x48')](_0x4d9742);})[_0xc520('0x14')](function(_0x19716a){_0x336a59[_0xc520('0x49')]=_0x19716a;return _0x336a59;});}})['then'](respondWithFilteredResult(_0x507599,_0x4d9742))['catch'](handleError(_0x507599,null));};exports[_0xc520('0x5c')]=function(_0x3540d4,_0x45ccd6){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x3540d4[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x45ccd6,null))[_0xc520('0x14')](function(_0x307238){if(_0x307238){return _0x307238[_0xc520('0x5c')](_0x3540d4[_0xc520('0x37')][_0xc520('0x5d')]);}})[_0xc520('0x14')](respondWithStatusCode(_0x45ccd6,null))[_0xc520('0x1e')](handleError(_0x45ccd6,null));};exports[_0xc520('0x5e')]=function(_0x457521,_0x4e2604){if(_0x457521[_0xc520('0x55')]['id']){delete _0x457521[_0xc520('0x55')]['id'];}return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x457521[_0xc520('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4e2604,null))['then'](function(_0x558a06){if(_0x558a06){_0x457521[_0xc520('0x55')]['ChatWebsiteId']=_0x558a06['id'];return db[_0xc520('0x5f')][_0xc520('0x4f')](_0x457521['body']);}})[_0xc520('0x14')](respondWithResult(_0x4e2604,null))[_0xc520('0x1e')](handleError(_0x4e2604,null));};exports['getAnswers']=function(_0x435ccf,_0x3c136d){var _0x1d6aca={'raw':![],'where':{}};var _0x214a11={};var _0xf7d7a8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc520('0x5a')]({'where':{'id':_0x435ccf[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x3c136d,null))[_0xc520('0x14')](function(_0x58f71b){if(_0x58f71b){_0x214a11[_0xc520('0x3c')]=_['keys'](db['CannedAnswer'][_0xc520('0x34')]);_0x214a11[_0xc520('0x37')]=_[_0xc520('0x38')](_0x435ccf[_0xc520('0x37')]);_0x214a11[_0xc520('0x39')]=_['intersection'](_0x214a11['model'],_0x214a11[_0xc520('0x37')]);_0x1d6aca[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x214a11[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x435ccf[_0xc520('0x37')][_0xc520('0x3d')]));_0x1d6aca[_0xc520('0x3b')]=_0x1d6aca[_0xc520('0x3b')][_0xc520('0x3e')]?_0x1d6aca['attributes']:_0x214a11[_0xc520('0x3c')];if(!_0x435ccf[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0x1d6aca[_0xc520('0x23')]=qs['limit'](_0x435ccf['query'][_0xc520('0x23')]);_0x1d6aca['offset']=qs[_0xc520('0x21')](_0x435ccf[_0xc520('0x37')][_0xc520('0x21')]);}_0x1d6aca[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x435ccf['query']['sort']);_0x1d6aca[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x435ccf[_0xc520('0x37')],_0x214a11[_0xc520('0x39')]));_0x1d6aca[_0xc520('0x43')][_0xc520('0x57')]=_0x58f71b['id'];if(_0x435ccf[_0xc520('0x37')][_0xc520('0x44')]){_0x1d6aca[_0xc520('0x43')]=_['merge'](_0x1d6aca['where'],{'$or':_[_0xc520('0x32')](_0x1d6aca[_0xc520('0x3b')],function(_0x36e3a4){var _0x6558a3={};_0x6558a3[_0x36e3a4]={'$like':'%'+_0x435ccf['query'][_0xc520('0x44')]+'%'};return _0x6558a3;})});}_0x1d6aca=_[_0xc520('0x45')]({},_0x1d6aca,_0x435ccf['options']);return db[_0xc520('0x5f')][_0xc520('0x24')]({'where':_0x1d6aca[_0xc520('0x43')]})[_0xc520('0x14')](function(_0x1300f6){_0xf7d7a8[_0xc520('0x24')]=_0x1300f6;if(_0x435ccf[_0xc520('0x37')][_0xc520('0x4c')]){_0x1d6aca['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc520('0x48')](_0x1d6aca);})[_0xc520('0x14')](function(_0x30406c){_0xf7d7a8[_0xc520('0x49')]=_0x30406c;return _0xf7d7a8;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x3c136d,_0x1d6aca))[_0xc520('0x1e')](handleError(_0x3c136d,null));};exports['removeAnswers']=function(_0x260521,_0x4f604a){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x260521[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4f604a,null))[_0xc520('0x14')](function(_0x5949df){if(_0x5949df){return _0x5949df[_0xc520('0x60')](_0x260521['query'][_0xc520('0x5d')]);}})[_0xc520('0x14')](respondWithStatusCode(_0x4f604a,null))[_0xc520('0x1e')](handleError(_0x4f604a,null));};exports['addLogo']=function(_0x214217,_0x162bc9){_0x214217[_0xc520('0x55')][_0xc520('0x61')]=_0x214217[_0xc520('0x62')][_0xc520('0x63')];return db[_0xc520('0x33')]['find']({'where':{'id':_0x214217['params']['id']}})['then'](handleEntityNotFound(_0x162bc9,null))[_0xc520('0x14')](saveUpdates(_0x214217[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x162bc9,null))['catch'](handleError(_0x162bc9,null));};exports[_0xc520('0x64')]=function(_0x251cd1,_0x2c4bc8){_0x251cd1[_0xc520('0x55')][_0xc520('0x65')]=_0x251cd1[_0xc520('0x62')][_0xc520('0x63')];return db['ChatWebsite'][_0xc520('0x4e')]({'where':{'id':_0x251cd1['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x2c4bc8,null))[_0xc520('0x14')](saveUpdates(_0x251cd1[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x2c4bc8,null))[_0xc520('0x1e')](handleError(_0x2c4bc8,null));};exports[_0xc520('0x66')]=function(_0x160a23,_0x23ffb0){_0x160a23['body'][_0xc520('0x67')]=_0x160a23[_0xc520('0x62')][_0xc520('0x63')];return db['ChatWebsite'][_0xc520('0x4e')]({'where':{'id':_0x160a23[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x23ffb0,null))[_0xc520('0x14')](saveUpdates(_0x160a23[_0xc520('0x55')],null))[_0xc520('0x14')](respondWithResult(_0x23ffb0,null))[_0xc520('0x1e')](handleError(_0x23ffb0,null));};exports['addSystemAvatar']=function(_0x2e0db2,_0x5ca9b5){_0x2e0db2[_0xc520('0x55')][_0xc520('0x68')]=_0x2e0db2[_0xc520('0x62')][_0xc520('0x63')];return db[_0xc520('0x33')]['find']({'where':{'id':_0x2e0db2[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x5ca9b5,null))['then'](saveUpdates(_0x2e0db2['body'],null))['then'](respondWithResult(_0x5ca9b5,null))['catch'](handleError(_0x5ca9b5,null));};exports[_0xc520('0x69')]=function(_0x2578c2,_0xb3b1b1){var _0x50456d=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x6c'));var _0x1d86a5={'where':{'id':_0x2578c2['params']['id']},'attributes':['id',_0xc520('0x61')],'raw':!![]};var _0x40c65c=![];return require('../../config/license/util')[_0xc520('0x6d')]()[_0xc520('0x14')](function(_0x2151d0){if(_0x2151d0){_0x40c65c=_0x2151d0[_0xc520('0x6e')];}})['then'](function(){return db['ChatWebsite']['find'](_0x1d86a5);})[_0xc520('0x14')](handleEntityNotFound(_0xb3b1b1,null))[_0xc520('0x14')](function(_0x55fd2c){if(_0x55fd2c){if(!_['isNil'](_0x55fd2c[_0xc520('0x61')])){if(fs[_0xc520('0x6f')](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x70'),_0x55fd2c['sitepic']))&&_0x40c65c){_0x50456d=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x70'),_0x55fd2c[_0xc520('0x61')]);}}return _0xb3b1b1[_0xc520('0x71')](_0x50456d);}})[_0xc520('0x1e')](handleError(_0xb3b1b1,null));};exports[_0xc520('0x72')]=function(_0x5ce508,_0x2e4fed){var _0x4b9555=path['join'](config[_0xc520('0x6b')],_0xc520('0x73'));var _0x345b5c={'where':{'id':_0x5ce508[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x65')],'raw':!![]};return db[_0xc520('0x33')][_0xc520('0x4e')](_0x345b5c)['then'](handleEntityNotFound(_0x2e4fed,null))[_0xc520('0x14')](function(_0x176d0a){if(_0x176d0a){if(!_['isNil'](_0x176d0a[_0xc520('0x65')])){if(fs['existsSync'](path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x176d0a[_0xc520('0x65')]))){_0x4b9555=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x176d0a[_0xc520('0x65')]);}}return _0x2e4fed[_0xc520('0x71')](_0x4b9555);}})[_0xc520('0x1e')](handleError(_0x2e4fed,null));};exports[_0xc520('0x75')]=function(_0x3d4fe4,_0x12e2ee){var _0x69594c=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x76'));var _0x7ae5c5={'where':{'id':_0x3d4fe4[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x67'),_0xc520('0x77')],'raw':!![]};return db[_0xc520('0x33')]['find'](_0x7ae5c5)[_0xc520('0x14')](handleEntityNotFound(_0x12e2ee,null))['then'](function(_0x11b5e4){if(_0x11b5e4){if(!_[_0xc520('0x78')](_0x11b5e4[_0xc520('0x67')])){if(fs[_0xc520('0x6f')](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x11b5e4['customerAvatar']))&&_0x11b5e4[_0xc520('0x77')]){_0x69594c=path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x11b5e4[_0xc520('0x67')]);}}return _0x12e2ee[_0xc520('0x71')](_0x69594c);}})[_0xc520('0x1e')](handleError(_0x12e2ee,null));};exports['getSystemAvatar']=function(_0xc4a18,_0x1a377b){var _0x6b66a2=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x79'));var _0x297d6e={'where':{'id':_0xc4a18[_0xc520('0x4a')]['id']},'attributes':['id',_0xc520('0x68')],'raw':!![]};return db['ChatWebsite'][_0xc520('0x4e')](_0x297d6e)['then'](handleEntityNotFound(_0x1a377b,null))['then'](function(_0x234ebb){if(_0x234ebb){if(!_[_0xc520('0x78')](_0x234ebb[_0xc520('0x68')])){if(fs[_0xc520('0x6f')](path['join'](config[_0xc520('0x6b')],'server/files/images/avatars/',_0x234ebb[_0xc520('0x68')]))){_0x6b66a2=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x74'),_0x234ebb['systemAvatar']);}}return _0x1a377b['download'](_0x6b66a2);}})['catch'](handleError(_0x1a377b,null));};exports[_0xc520('0x7a')]=function(_0x1ae37b,_0x2e9035){var _0x368381=require('user-agent-parser');var _0x1dadec=new _0x368381();var _0x33367e=_0x1dadec['setUA'](_0x1ae37b['headers'][_0xc520('0x7b')])[_0xc520('0x7c')]();var _0x349e0b={'body':_0x1ae37b[_0xc520('0x55')],'channel':'chat'};var _0x425d1e=[];var _0x388bb2=[];var _0x2d529e={};var _0x1d91ab=![];return db[_0xc520('0x7d')][_0xc520('0x56')]()[_0xc520('0x14')](function(_0x5e38d3){if(!_0x5e38d3){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('no\x20available\x20attributes');}_0x425d1e=_[_0xc520('0x80')](_[_0xc520('0x38')](_0x5e38d3),[_0xc520('0x81'),'updatedAt']);_0x388bb2=_['difference'](_[_0xc520('0x38')](_0x5e38d3),[_0xc520('0x81'),_0xc520('0x82'),_0xc520('0x83'),_0xc520('0x84')]);if(_0x1ae37b[_0xc520('0x55')]['id']){delete _0x1ae37b[_0xc520('0x55')]['id'];}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')][_0xc520('0x85')])){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))](_0xc520('0x86'));}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')]['body'])||_0x1ae37b[_0xc520('0x55')][_0xc520('0x55')]===''){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc520('0x78')](_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')])){throw new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x388bb2);}if(!_[_0xc520('0x88')](_0x388bb2,_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')])){throw new db['Sequelize']['ValidationError'](_0xc520('0x89')+_0x388bb2);}_0x2d529e[_0x1ae37b[_0xc520('0x55')][_0xc520('0x87')]]=_0x1ae37b['body'][_0xc520('0x85')];})['then'](function(){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x1ae37b[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0x8a')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2d529e,'limit':0x1,'order':[[_0xc520('0x82'),_0xc520('0x8b')]]}]},{'model':db[_0xc520('0x8c')],'as':_0xc520('0x8d')}]});})[_0xc520('0x14')](handleEntityNotFound(_0x2e9035,null))['then'](function(_0x3fe751){if(_0x3fe751&&_0x3fe751[_0xc520('0x8e')]){_0x349e0b[_0xc520('0x8f')]=_0x3fe751;_0x349e0b[_0xc520('0x90')]=_0x3fe751[_0xc520('0x8d')];_0x349e0b[_0xc520('0x91')]=_0x3fe751['List'];_0x349e0b['applications']=_[_0xc520('0x92')](_0x349e0b[_0xc520('0x90')],[_0xc520('0x93')],[_0xc520('0x94')]);if(_0x349e0b[_0xc520('0x8f')][_0xc520('0x8d')]){delete _0x349e0b['account'][_0xc520('0x8d')];}if(_0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')]&&_0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')][_0xc520('0x95')][_0xc520('0x3e')]){return _0x349e0b[_0xc520('0x8f')][_0xc520('0x8e')][_0xc520('0x95')][0x0];}var _0x4d5c7a=_[_0xc520('0xb')](_0x1ae37b[_0xc520('0x55')],{'firstName':_0x1ae37b['body'][_0xc520('0x85')],'ListId':_0x3fe751['ListId']});_0x4d5c7a[_0x1ae37b['body'][_0xc520('0x87')]]=_0x1ae37b['body'][_0xc520('0x85')];return db[_0xc520('0x7d')]['create'](_0x4d5c7a,{'fields':_0x425d1e,'raw':!![]});}})[_0xc520('0x14')](handleEntityNotFound(_0x2e9035,null))[_0xc520('0x14')](function(_0x44d700){_0x349e0b[_0xc520('0x96')]=_0x44d700;var _0x39a637=_0x1ae37b['body']['customerIp'];if(_0x1ae37b[_0xc520('0x97')][_0xc520('0x98')]){_0x39a637=_0x1ae37b['headers']['cf-connecting-ip'];}else if(_0x1ae37b[_0xc520('0x97')][_0xc520('0x99')]){_0x39a637=_[_0xc520('0x9a')](_0x1ae37b[_0xc520('0x97')][_0xc520('0x99')][_0xc520('0x9b')](','));}if(_0x44d700){var _0x2217f1={'ContactId':_0x44d700['id'],'ChatWebsiteId':_0x1ae37b[_0xc520('0x4a')]['id'],'from':(_0x44d700[_0xc520('0x9c')]||'')+'\x20'+(_0x44d700[_0xc520('0x9d')]||''),'customerIp':_0x39a637,'customerPort':_0x1ae37b[_0xc520('0x97')][_0xc520('0x9e')]?_0x1ae37b[_0xc520('0x97')][_0xc520('0x9e')]:null,'referer':_0x1ae37b[_0xc520('0x55')]['referer'],'browserName':_0x33367e[_0xc520('0x9f')][_0xc520('0x2f')]&&_0x33367e[_0xc520('0x9f')]['version']?util[_0xc520('0xa0')](_0xc520('0xa1'),_0x33367e[_0xc520('0x9f')][_0xc520('0x2f')],_0x33367e['browser'][_0xc520('0xa2')]):_0xc520('0xa3'),'browserVersion':_0x33367e[_0xc520('0x9f')][_0xc520('0xa2')]||_0xc520('0xa3'),'osName':util['format'](_0xc520('0xa1'),_0x33367e['os'][_0xc520('0x2f')],_0x33367e['os'][_0xc520('0xa2')]),'osVersion':_0x33367e['os'][_0xc520('0xa2')],'deviceModel':_0x33367e['device'][_0xc520('0x3c')]&&_0x33367e[_0xc520('0xa4')]['vendor']?util[_0xc520('0xa0')](_0xc520('0xa5'),_0x33367e[_0xc520('0xa4')][_0xc520('0x3c')],_0x33367e[_0xc520('0xa4')][_0xc520('0xa6')],_0x33367e[_0xc520('0xa4')][_0xc520('0x36')]):null,'deviceVendor':_0x33367e[_0xc520('0xa4')]['vendor'],'deviceType':_0x33367e['device'][_0xc520('0x36')],'formData':JSON[_0xc520('0x19')](_0x1ae37b[_0xc520('0x55')])};var _0x53e2c0={'ChatWebsiteId':_0x1ae37b[_0xc520('0x4a')]['id'],'closed':![]};if(_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')]){_0x53e2c0[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')];return db[_0xc520('0xa8')][_0xc520('0x4e')]({'where':_0x53e2c0})[_0xc520('0x14')](function(_0x120cc0){if(_0x120cc0){return[_0x120cc0,![]];}_0x2217f1[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')];_0x2217f1['externalUrl']=_0x1ae37b[_0xc520('0x55')]['externalUrl'];return db['ChatInteraction'][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x5449a1){return[_0x5449a1,!![]];});});}_0x53e2c0[_0xc520('0xa9')]=_0x44d700['id'];if(_0x1ae37b[_0xc520('0x55')]['interaction']&&_0x1ae37b[_0xc520('0x55')]['interaction']['id']){_0x53e2c0['id']=_0x1ae37b[_0xc520('0x55')][_0xc520('0xaa')]['id'];return db['ChatInteraction'][_0xc520('0x4e')]({'where':_0x53e2c0})[_0xc520('0x14')](function(_0x17c5e6){if(_0x17c5e6){return[_0x17c5e6,![]];}return db[_0xc520('0xa8')][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x19684a){return[_0x19684a,!![]];});});}return db[_0xc520('0xa8')][_0xc520('0x4f')](_0x2217f1)[_0xc520('0x14')](function(_0x55dc92){return[_0x55dc92,!![]];});}})[_0xc520('0xab')](function(_0x27cda3,_0x25b04d){if(_0x27cda3){_0x1d91ab=_0x25b04d;if(!_0x25b04d){var _0x4c23ef={'from':(_0x349e0b['contact'][_0xc520('0x9c')]||'')+'\x20'+(_0x349e0b[_0xc520('0x96')][_0xc520('0x9d')]||'')};if(_0x1ae37b['body'][_0xc520('0xa7')]&&_0x1ae37b[_0xc520('0x55')]['messageId']&&_0x1ae37b[_0xc520('0x55')][_0xc520('0xa7')]!=_0x1ae37b[_0xc520('0x55')]['messageId']){_0x4c23ef[_0xc520('0xa7')]=_0x1ae37b[_0xc520('0x55')][_0xc520('0xac')];}return _0x27cda3[_0xc520('0x27')](_0x4c23ef);}else{return _0x27cda3;}}})[_0xc520('0x14')](function(_0x56328f){_0x349e0b[_0xc520('0xaa')]=_0x56328f[_0xc520('0x29')]({'plain':!![]});_0x349e0b[_0xc520('0xaa')]['created']=_0x1d91ab;if(_0x349e0b['interaction'][_0xc520('0xad')]){if(_0x349e0b[_0xc520('0x8f')][_0xc520('0xae')]){_0x349e0b['applications'][_0xc520('0xaf')]({'id':0x0,'priority':_0x349e0b[_0xc520('0x90')][_0xc520('0x3e')]+0x1,'app':'close','appdata':_0xc520('0xb0'),'interval':_0xc520('0xb1')});}}return db[_0xc520('0xb2')][_0xc520('0x4f')]({'body':_0x1ae37b['body'][_0xc520('0x55')],'ChatWebsiteId':_0x1ae37b['params']['id'],'ChatInteractionId':_0x56328f['id'],'direction':'in','ContactId':_0x349e0b[_0xc520('0x96')]['id'],'AttachmentId':_0x1ae37b['body'][_0xc520('0xb3')]});})['then'](function(_0x1c6f7d){_0x349e0b[_0xc520('0x1c')]=_0x1c6f7d;if(_0x349e0b[_0xc520('0xaa')][_0xc520('0xb4')]){return db['User'][_0xc520('0x4e')]({'attributes':['id',_0xc520('0x2f')],'where':{'id':_0x349e0b['interaction'][_0xc520('0xb4')]}})['then'](function(_0x3a45c6){if(_0x3a45c6){_0x349e0b[_0xc520('0x90')][_0xc520('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3a45c6['name']+','+(_0x349e0b['account'][_0xc520('0xb6')]||0xa),'interval':_0xc520('0xb1')});_0x349e0b[_0xc520('0xb7')]=!![];}return respondWithRpcPromise(_0xc520('0xb8'),_0xc520('0xb9'),_0x349e0b);});}return respondWithRpcPromise(_0xc520('0xb8'),_0xc520('0xb9'),_0x349e0b);})[_0xc520('0x14')](function(_0x54a842){respondWithRpcPromise(_0xc520('0xba'),_0xc520('0xba'),{'event':_0xc520('0x7a'),'message':_0x54a842},client9002);return _0x54a842;})[_0xc520('0x14')](respondWithResult(_0x2e9035,null))[_0xc520('0x1e')](handleError(_0x2e9035,null));};exports[_0xc520('0xbb')]=function(_0x182b97,_0x55c2f5){var _0x5058ce,_0x4e7192,_0x26e789;var _0x803626=[];var _0x293990={};var _0x596da4=_0x182b97['files']||[];var _0x2b39cf=[];var _0x5e887a;return db[_0xc520('0x7d')][_0xc520('0x56')]()[_0xc520('0x14')](function(_0x512c35){if(!_0x512c35){throw new db['Sequelize'][(_0xc520('0x7f'))](_0xc520('0xbc'));}_0x803626=_['difference'](_[_0xc520('0x38')](_0x512c35),['createdAt','updatedAt',_0xc520('0x83'),_0xc520('0x84')]);if(_0x182b97[_0xc520('0x55')]['id']){delete _0x182b97['body']['id'];}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0x85')])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db['Sequelize'][(_0xc520('0x7f'))]('from\x20is\x20mandatory'));}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0x55')])||_0x182b97[_0xc520('0x55')][_0xc520('0x55')]===''){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)['send'](new db[(_0xc520('0x7e'))][(_0xc520('0x7f'))](_0xc520('0xbe')));}if(_[_0xc520('0x78')](_0x182b97[_0xc520('0x55')][_0xc520('0xbf')])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db[(_0xc520('0x7e'))]['ValidationError'](_0xc520('0xc0')+_0x803626));}if(!_[_0xc520('0x88')](_0x803626,_0x182b97['body']['mapKeyOffline'])){throw _0x55c2f5[_0xc520('0x1f')](0x1f4)[_0xc520('0xbd')](new db[(_0xc520('0x7e'))]['ValidationError'](_0xc520('0xc1')+_0x803626));}_0x293990[_0x182b97[_0xc520('0x55')][_0xc520('0xbf')]]=_0x182b97[_0xc520('0x55')]['from'];})[_0xc520('0x14')](function(){return db[_0xc520('0x33')]['find']({'where':{'id':_0x182b97[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0x8a')],'as':_0xc520('0x8e')},{'model':db[_0xc520('0xc2')],'as':_0xc520('0xc2')}]});})[_0xc520('0x14')](handleEntityNotFound(_0x55c2f5,null))[_0xc520('0x14')](function(_0xa648d3){if(_0xa648d3&&_0xa648d3[_0xc520('0x8e')]){_0x4e7192=_0xa648d3;var _0x4003b6=_[_0xc520('0xb')](_0x182b97[_0xc520('0x55')],{'firstName':_0x182b97['body'][_0xc520('0x85')],'phone':_0x182b97[_0xc520('0x55')]['from'],'ListId':_0xa648d3[_0xc520('0x84')]});_0x4003b6[_0x182b97[_0xc520('0x55')][_0xc520('0xbf')]]=_0x182b97[_0xc520('0x55')][_0xc520('0x85')];return db[_0xc520('0x7d')][_0xc520('0xc3')]({'where':_0x293990,'defaults':_0x4003b6});}})['spread'](function(_0x272577){if(_0x272577){_0x26e789=_0x272577;var _0x2fdf84=fs['readFileSync'](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0xc4')),_0xc520('0xc5'));var _0x1c36d1=ejs[_0xc520('0xc6')](_0x2fdf84,{'body':_[_0xc520('0xc7')](_0x182b97[_0xc520('0x55')][_0xc520('0x55')]),'bodyTitle':_0x4e7192[_0xc520('0xc8')]});return db['ChatOfflineMessage'][_0xc520('0x4f')]({'body':_0x1c36d1,'plainBody':htmlToText[_0xc520('0xc9')](_0x1c36d1),'ContactId':_0x272577['id'],'ChatWebsiteId':_0x4e7192['id']});}})[_0xc520('0x14')](function(_0x37d030){_0x5e887a=_0x37d030;if(_0x596da4[_0xc520('0x3e')]){var _0x11849b=_0x596da4['map'](function(_0x1b4d00){return{'name':_0x1b4d00[_0xc520('0xca')],'basename':_0x1b4d00[_0xc520('0x63')],'type':_0x1b4d00[_0xc520('0xcb')],'ChatOfflineMessageId':_0x37d030['id']};});_0x2b39cf=_0x11849b[_0xc520('0x32')](_0x18beb3=>{var _0x37427f={'filename':_0x18beb3[_0xc520('0x2f')],'path':path[_0xc520('0x6a')](config['root'],'server',_0xc520('0xcc'),_0xc520('0xcd'),_0xc520('0xce'),_0x18beb3['basename'])};return _0x37427f;});if(!_0x4e7192[_0xc520('0xcf')]){return db[_0xc520('0xd0')][_0xc520('0xd1')](function(_0x1a6b03){return db[_0xc520('0xd2')][_0xc520('0xd3')](_0x11849b,{'transaction':_0x1a6b03});});}}})[_0xc520('0x14')](function(){if(_0x5e887a){_0x5058ce=_0x5e887a;return db[_0xc520('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc520('0xd4')],'as':_0xc520('0xd5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc520('0xd6'),'raw':!![]}]}]});}})[_0xc520('0x14')](function(_0x1e3508){if(_0x1e3508&&_0x1e3508[_0xc520('0xd5')]&&_0x4e7192['forwardOffline']&&_0x4e7192[_0xc520('0xd7')]){var _0x6ef7a0=_0x1e3508[_0xc520('0xd8')]();return respondWithRpcPromise(_0xc520('0xd9'),'sendMail',{'account':_0x6ef7a0,'message':{'from':util['format'](_0xc520('0xda'),_0x1e3508[_0xc520('0x2f')],_0x1e3508['email']||_0x1e3508['Smtp'][_0xc520('0xdb')]),'to':_0x4e7192['forwardOfflineAddress'],'subject':_0x4e7192[_0xc520('0xdc')],'html':_0x5058ce[_0xc520('0x55')],'attachments':_0x2b39cf}},client9003)[_0xc520('0x14')](function(){return _0x5058ce;})[_0xc520('0x1e')](function(_0x44017e){logger[_0xc520('0x1a')](_0x44017e);});}})[_0xc520('0x14')](function(){if(_0x4e7192&&_0x4e7192[_0xc520('0xcf')]&&_0x4e7192[_0xc520('0xdd')]){var _0x3cb514=[];if(_0x596da4['length']){_0x3cb514=_0x596da4['map'](function(_0x246258){return{'name':_0x246258[_0xc520('0xca')],'basename':_0x246258['filename'],'type':_0x246258[_0xc520('0xcb')],'ChatOfflineMessageId':_0x5e887a['id']};});}var _0x22fde1;if(!_['isNil'](_0x4e7192['subjectOffline'])){var _0x501fcd=_[_0xc520('0x32')](_0x182b97[_0xc520('0x55')],function(_0x513e41){return _0x513e41;});var _0x4cb8d1=_[_0xc520('0xde')](_0x501fcd)[0x0];var _0x363883=_[_0xc520('0xdf')](_0x4cb8d1,function(_0x5a22dd){return _0x5a22dd;});_0x22fde1=_0x363883[0x1][_0x4e7192[_0xc520('0xe0')]];}var _0x1008bc={'from':_0x26e789[_0xc520('0xe1')],'firstName':_0x26e789['firstName'],'lastName':_0x26e789[_0xc520('0x9d')],'mapKey':_0xc520('0xe1'),'message':{'from':_0x26e789[_0xc520('0xe1')],'to':_0x4e7192[_0xc520('0xc2')][_0xc520('0xe1')],'cc':'','subject':_[_0xc520('0x78')](_0x22fde1)?_0x4e7192['offlineMessageSubject']:_0x22fde1,'messageId':'','sentAt':new Date(),'attach':_0x3cb514[_0xc520('0x3e')],'attachments':_0x3cb514,'originChannel':'Chat','ChatWebsiteId':_0x4e7192['id'],'ChatOfflineMessageId':_0x5058ce['id'],'originTo':_0x4e7192['MailAccount'][_0xc520('0xe1')]},'body':_0x5058ce['body']};var _0x5b8696={'account':{'id':_0x4e7192[_0xc520('0xdd')]},'body':_0x1008bc,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xc520('0xe2'),'notifyMail',_0x5b8696,client9001)[_0xc520('0x14')](function(){return _0x5058ce;})[_0xc520('0x1e')](function(_0x31b968){logger['error'](_0x31b968);});}return;})[_0xc520('0x14')](function(){if(_0x5058ce){return _0x5058ce;}})[_0xc520('0x14')](respondWithResult(_0x55c2f5,null))[_0xc520('0x1e')](function(_0x4b8d0a){logger[_0xc520('0x1a')](_0xc520('0x1e'),_0x4b8d0a);for(var _0x2b1473 of _0x596da4){var _0x29ae12=path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0xe3'),_0xc520('0xcc'),_0xc520('0xcd'),_0xc520('0xce'),_0x2b1473[_0xc520('0x63')]);fs_extra[_0xc520('0xe4')](_0x29ae12)[_0xc520('0x1e')](function(_0xa1109f){logger[_0xc520('0x1a')](_0xc520('0xe5'),_0x29ae12,_0xa1109f);});}});};exports[_0xc520('0xe6')]=function(_0x3b4128,_0x115fef){return db[_0xc520('0xa8')][_0xc520('0x4e')]({'where':{'id':_0x3b4128[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x115fef,null))[_0xc520('0x14')](function(_0x29b021){if(_0x29b021){return _0x29b021[_0xc520('0xe6')](_0x3b4128['body'][_0xc520('0x5d')],_[_0xc520('0xe7')](_0x3b4128[_0xc520('0x55')],[_0xc520('0x5d'),'id'])||{});}})[_0xc520('0x14')](respondWithResult(_0x115fef,null))['catch'](handleError(_0x115fef,null));};exports['getInteractions']=function(_0x114bdf,_0x57c4fc){var _0x101a0e={'raw':![],'where':{}};var _0x17fe2c={};var _0x26a503={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x114bdf[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x57c4fc,null))[_0xc520('0x14')](function(_0x23e34a){if(_0x23e34a){_0x17fe2c[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0xa8')]['rawAttributes']);_0x17fe2c[_0xc520('0x37')]=_[_0xc520('0x38')](_0x114bdf[_0xc520('0x37')]);_0x17fe2c[_0xc520('0x39')]=_['intersection'](_0x17fe2c[_0xc520('0x3c')],_0x17fe2c[_0xc520('0x37')]);_0x101a0e[_0xc520('0x3b')]=_['intersection'](_0x17fe2c[_0xc520('0x3c')],qs['fields'](_0x114bdf[_0xc520('0x37')][_0xc520('0x3d')]));_0x101a0e[_0xc520('0x3b')]=_0x101a0e[_0xc520('0x3b')][_0xc520('0x3e')]?_0x101a0e['attributes']:_0x17fe2c[_0xc520('0x3c')];if(!_0x114bdf[_0xc520('0x37')]['hasOwnProperty'](_0xc520('0x40'))){_0x101a0e[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x114bdf[_0xc520('0x37')]['limit']);_0x101a0e[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x114bdf[_0xc520('0x37')][_0xc520('0x21')]);}_0x101a0e['order']=qs[_0xc520('0x42')](_0x114bdf[_0xc520('0x37')][_0xc520('0x42')]);_0x101a0e[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x114bdf[_0xc520('0x37')],_0x17fe2c[_0xc520('0x39')]));_0x101a0e[_0xc520('0x43')][_0xc520('0x57')]=_0x23e34a['id'];if(_0x114bdf[_0xc520('0x37')]['filter']){_0x101a0e[_0xc520('0x43')]=_[_0xc520('0x45')](_0x101a0e[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x101a0e[_0xc520('0x3b')],function(_0x5bf252){var _0x3d4f71={};_0x3d4f71[_0x5bf252]={'$like':'%'+_0x114bdf[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x3d4f71;})});}_0x101a0e=_[_0xc520('0x45')]({},_0x101a0e,_0x114bdf[_0xc520('0x4d')]);return db[_0xc520('0xa8')][_0xc520('0x24')]({'where':_0x101a0e[_0xc520('0x43')]})['then'](function(_0x3514f3){_0x26a503['count']=_0x3514f3;if(_0x114bdf[_0xc520('0x37')]['includeAll']){_0x101a0e[_0xc520('0x47')]=[{'model':db[_0xc520('0x7d')],'as':_0xc520('0xe8'),'required':![]},{'model':db[_0xc520('0xe9')],'as':'Owner','attributes':[_0xc520('0x2f'),_0xc520('0xea'),_0xc520('0xeb')],'required':![]},{'model':db[_0xc520('0xec')],'as':_0xc520('0xed'),'attributes':['id',_0xc520('0x2f'),_0xc520('0xee')],'where':_0x114bdf[_0xc520('0x37')][_0xc520('0xef')]?{'id':_0x114bdf[_0xc520('0x37')][_0xc520('0xef')]}:undefined,'required':_0x114bdf['query'][_0xc520('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0xc520('0x48')](_0x101a0e);})[_0xc520('0x14')](function(_0x13a5e7){_0x26a503[_0xc520('0x49')]=_0x13a5e7;return _0x26a503;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x57c4fc,_0x101a0e))[_0xc520('0x1e')](handleError(_0x57c4fc,null));};function iftimePromise(_0x26b596,_0x4a39d7){return respondWithRpcPromise(_0xc520('0xf0'),_0xc520('0xf1'),{'command':_0x4a39d7[_0xc520('0xf2')]?util[_0xc520('0xa0')](_0xc520('0xf3'),_0x26b596[_0xc520('0xf4')],_0x4a39d7['timezone']):util[_0xc520('0xa0')](_0xc520('0xf5'),_0x26b596[_0xc520('0xf4')])},client9002)[_0xc520('0x14')](function(_0x1abaa8){var _0x3a2682=_0x1abaa8&&_0x1abaa8['indexOf'](_0xc520('0xf6'))>=0x0?!![]:![];logger[_0xc520('0x15')](_0xc520('0xf7'),_0x4a39d7['id'],_0x26b596['id'],_0x26b596['interval'],_0x3a2682?'ONLINE':_0xc520('0xf8'),_0x4a39d7[_0xc520('0xf2')]?_0x4a39d7[_0xc520('0xf2')]:_0xc520('0xf9'));return _0x3a2682;})[_0xc520('0x1e')](function(_0x2eb31a){logger[_0xc520('0x1a')](_0xc520('0xf7'),_0x4a39d7['id'],_0x26b596['id'],_0x26b596['interval'],util[_0xc520('0xfa')](_0x2eb31a,{'showHidden':![],'depth':null}),_0x4a39d7[_0xc520('0xf2')]?_0x4a39d7[_0xc520('0xf2')]:_0xc520('0xf9'));return![];});}exports[_0xc520('0xf1')]=function(_0x1c6fb7,_0x3fc888){var _0x196cf4=0x0;var _0x4ef810=0x0;var _0x540280=![];var _0x4822eb;var _0x512761;return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x1c6fb7[_0xc520('0x4a')]['id']},'include':[{'model':db[_0xc520('0xfb')],'as':_0xc520('0xfb'),'include':[{'model':db['Interval'],'as':_0xc520('0xfc'),'attributes':['id',_0xc520('0xf4')],'raw':!![]}]}]})[_0xc520('0x14')](handleEntityNotFound(_0x3fc888,null))[_0xc520('0x14')](function(_0x69527b){if(_0x69527b){_0x4822eb=_0x69527b;return _0x69527b[_0xc520('0xfd')]({'raw':!![]});}})['then'](function(_0x5c53e0){if(_0x4822eb){if(_0x5c53e0){_0x512761=_0x5c53e0;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x3aa87f){if(_0x3aa87f){_0x4ef810=_0x3aa87f[_0xc520('0xfe')];_0x540280=_0x3aa87f[_0xc520('0x6e')];}})[_0xc520('0x14')](function(){return db[_0xc520('0xa8')]['count']({'where':{'closed':![]}});})[_0xc520('0x14')](function(_0x6b3dd8){_0x196cf4=_0x6b3dd8;if(_0x4ef810&&_0x6b3dd8>_0x4ef810){return db['License'][_0xc520('0x5a')]({'where':{'id':0x1}})['then'](function(_0x5a40f6){if(_0x5a40f6){_0x5a40f6[_0xc520('0xff')](_0xc520('0x100'));}});}})[_0xc520('0x14')](function(){if(_0x4822eb[_0xc520('0xfb')]&&_0x4822eb[_0xc520('0xfb')]['Intervals']){var _0x5f3b47=[];for(var _0x39a43=0x0;_0x39a43<_0x4822eb[_0xc520('0xfb')][_0xc520('0xfc')]['length'];_0x39a43++){var _0x3ec9c9=_0x4822eb[_0xc520('0xfb')][_0xc520('0xfc')][_0x39a43][_0xc520('0x29')]({'plain':!![]});_0x5f3b47['push'](iftimePromise(_0x3ec9c9,_0x4822eb));}return BPromise[_0xc520('0x101')](_0x5f3b47)[_0xc520('0x14')](function(_0x439db6){return _[_0xc520('0x102')](_0x439db6);});}else{return!![];}})[_0xc520('0x14')](function(_0x7cceef){var _0x23b391=fs['readFileSync'](path[_0xc520('0x6a')](config[_0xc520('0x6b')],_0xc520('0x103')),_0xc520('0xc5'));var _0x1237ce={'remote':_0x4822eb[_0xc520('0x104')],'query':querystring['stringify'](_[_0xc520('0x45')](_0x4822eb[_0xc520('0x29')]({'plain':!![]}),{'customerIp':_0x1c6fb7[_0xc520('0x97')][_0xc520('0x99')]||_0x1c6fb7[_0xc520('0x97')][_0xc520('0x105')]||_0x1c6fb7[_0xc520('0x106')]['remoteAddress']||_0x1c6fb7['ip'],'referer':_0x1c6fb7[_0xc520('0x97')][_0xc520('0x107')],'openedInteractions':_0x196cf4,'maxInteractions':_0x4ef810,'virtual':_0x540280[_0xc520('0xfe')],'online':_0x7cceef,'custom':_0x540280}))[_0xc520('0x108')](/'/g,'\x5c\x27')};_0x3fc888[_0xc520('0xbd')](ejs[_0xc520('0xc6')](Mustache[_0xc520('0xc6')](_0x23b391,_0x1237ce),{'proactiveActions':_0x512761,'alignment':_0x4822eb['alignment'],'verticalAlignment':_0x4822eb[_0xc520('0x109')],'div_color':_0x4822eb[_0xc520('0xee')],'labelText':_0x4822eb['labelText'],'text_color':_0x4822eb[_0xc520('0x10a')],'text_button_color':_0x4822eb[_0xc520('0x10b')],'button_color':_0x4822eb[_0xc520('0x10c')],'background_color':_0x4822eb[_0xc520('0x10d')],'hideWhenOffline':_0x4822eb['hideWhenOffline'],'interval':_0x4822eb['IntervalId']}));})[_0xc520('0x1e')](handleError(_0x3fc888,null));};exports[_0xc520('0x10e')]=function(_0x2901d1,_0x1ba733){var _0x493d7f=_0x2901d1['params']['id'];var _0x4050a9=_0x2901d1['body'];var _0x1dba38=0xc8;var _0x10ca3a=null;return db[_0xc520('0xd0')][_0xc520('0xd1')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xc520('0x10f')]},function(_0x289b12){return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x493d7f},'transaction':_0x289b12})[_0xc520('0x14')](function(_0x4f6312){if(_0x4f6312){return db['ChatApplication'][_0xc520('0x28')]({'where':{'ChatWebsiteId':_0x493d7f},'transaction':_0x289b12})[_0xc520('0x14')](function(){var _0x48157c=_[_0xc520('0x32')](_0x4050a9,function(_0x37ac2b){_0x37ac2b['ChatWebsiteId']=_0x493d7f;return _0x37ac2b;});return db[_0xc520('0x8c')][_0xc520('0xd3')](_0x48157c,{'transaction':_0x289b12});});}else{_0x1dba38=0x194;_0x10ca3a=[];}});})['then'](function(){if(_0x1dba38!==0x194){return db[_0xc520('0x8c')][_0xc520('0x110')]({'where':{'ChatWebsiteId':_0x493d7f},'order':'priority'})[_0xc520('0x14')](function(_0xedf5b4){_0x10ca3a=_0xedf5b4;});}})[_0xc520('0x1e')](function(_0x3cc9d1){_0x1dba38=0x1f4;logger[_0xc520('0x1a')](_0x3cc9d1[_0xc520('0x2e')]);if(_0x3cc9d1['name']){delete _0x3cc9d1['name'];}_0x10ca3a=_0x3cc9d1;})[_0xc520('0x111')](function(){if(_0x10ca3a===null){_0x1ba733['sendStatus'](_0x1dba38);}else{if(_0x1dba38===0x1f4){_0x1ba733['status'](_0x1dba38)[_0xc520('0xbd')](_0x10ca3a);}else{_0x1ba733[_0xc520('0x1f')](_0x1dba38)[_0xc520('0x20')](_0x10ca3a);}}});};exports[_0xc520('0x112')]=function(_0x7a77ba,_0x4c485b){var _0x392364={};var _0x26b3b4={};var _0x299ff5;var _0x307cfc;return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x7a77ba['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4c485b,null))[_0xc520('0x14')](function(_0x2dd848){if(_0x2dd848){_0x299ff5=_0x2dd848;_0x26b3b4[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0x8c')][_0xc520('0x34')]);_0x26b3b4[_0xc520('0x37')]=_[_0xc520('0x38')](_0x7a77ba[_0xc520('0x37')]);_0x26b3b4['filters']=_[_0xc520('0x3a')](_0x26b3b4[_0xc520('0x3c')],_0x26b3b4['query']);_0x392364[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x26b3b4[_0xc520('0x3c')],qs['fields'](_0x7a77ba[_0xc520('0x37')][_0xc520('0x3d')]));_0x392364['attributes']=_0x392364['attributes'][_0xc520('0x3e')]?_0x392364['attributes']:_0x26b3b4[_0xc520('0x3c')];_0x392364[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x7a77ba['query'][_0xc520('0x42')]);_0x392364[_0xc520('0x43')]=qs['filters'](_[_0xc520('0x5b')](_0x7a77ba['query'],_0x26b3b4['filters']));if(_0x7a77ba[_0xc520('0x37')][_0xc520('0x44')]){_0x392364[_0xc520('0x43')]=_[_0xc520('0x45')](_0x392364[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x392364['attributes'],function(_0x158119){var _0x5b2964={};_0x5b2964[_0x158119]={'$like':'%'+_0x7a77ba[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x5b2964;})});}_0x392364=_[_0xc520('0x45')]({},_0x392364,_0x7a77ba[_0xc520('0x4d')]);return _0x299ff5[_0xc520('0x112')](_0x392364);}})[_0xc520('0x14')](function(_0x3ebebf){if(_0x3ebebf){_0x307cfc=_0x3ebebf['length'];if(!_0x7a77ba[_0xc520('0x37')]['hasOwnProperty'](_0xc520('0x40'))){_0x392364[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x7a77ba[_0xc520('0x37')][_0xc520('0x23')]);_0x392364[_0xc520('0x21')]=qs['offset'](_0x7a77ba['query'][_0xc520('0x21')]);}return _0x299ff5['getApplications'](_0x392364);}})['then'](function(_0x18ce1a){if(_0x18ce1a){return _0x18ce1a?{'count':_0x307cfc,'rows':_0x18ce1a}:null;}})[_0xc520('0x14')](respondWithResult(_0x4c485b,null))[_0xc520('0x1e')](handleError(_0x4c485b,null));};exports[_0xc520('0x113')]=function(_0x4411a8,_0x14da9e){return db['chatProactiveAction'][_0xc520('0x4e')]({'where':{'id':_0x4411a8[_0xc520('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14da9e,null))[_0xc520('0x14')](function(_0xc485c6){if(_0xc485c6){return _0xc485c6[_0xc520('0x113')](_0x4411a8[_0xc520('0x55')]['ids'],_['omit'](_0x4411a8[_0xc520('0x55')],[_0xc520('0x5d'),'id'])||{});}})[_0xc520('0x14')](respondWithResult(_0x14da9e,null))[_0xc520('0x1e')](handleError(_0x14da9e,null));};exports['getProactiveActions']=function(_0x98de69,_0x49c713){var _0x3c64a2={};var _0x4a065d={};var _0x1d9635;var _0x395155;return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x98de69[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x49c713,null))[_0xc520('0x14')](function(_0x580d16){if(_0x580d16){_0x1d9635=_0x580d16;_0x4a065d[_0xc520('0x3c')]=_['keys'](db[_0xc520('0x114')][_0xc520('0x34')]);_0x4a065d[_0xc520('0x37')]=_['keys'](_0x98de69['query']);_0x4a065d[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x4a065d[_0xc520('0x3c')],_0x4a065d[_0xc520('0x37')]);_0x3c64a2[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x4a065d[_0xc520('0x3c')],qs['fields'](_0x98de69[_0xc520('0x37')][_0xc520('0x3d')]));_0x3c64a2[_0xc520('0x3b')]=_0x3c64a2[_0xc520('0x3b')]['length']?_0x3c64a2[_0xc520('0x3b')]:_0x4a065d[_0xc520('0x3c')];_0x3c64a2[_0xc520('0x41')]=qs[_0xc520('0x42')](_0x98de69['query'][_0xc520('0x42')]);_0x3c64a2[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x98de69[_0xc520('0x37')],_0x4a065d[_0xc520('0x39')]));if(_0x98de69[_0xc520('0x37')]['filter']){_0x3c64a2['where']=_[_0xc520('0x45')](_0x3c64a2[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x3c64a2[_0xc520('0x3b')],function(_0x139c99){var _0x5d3b32={};_0x5d3b32[_0x139c99]={'$like':'%'+_0x98de69['query'][_0xc520('0x44')]+'%'};return _0x5d3b32;})});}_0x3c64a2=_['merge']({},_0x3c64a2,_0x98de69['options']);return _0x1d9635['getProactiveActions'](_0x3c64a2);}})['then'](function(_0x4c53ad){if(_0x4c53ad){_0x395155=_0x4c53ad[_0xc520('0x3e')];if(!_0x98de69['query'][_0xc520('0x3f')](_0xc520('0x40'))){_0x3c64a2[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x98de69[_0xc520('0x37')][_0xc520('0x23')]);_0x3c64a2[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x98de69[_0xc520('0x37')]['offset']);}return _0x1d9635[_0xc520('0xfd')](_0x3c64a2);}})[_0xc520('0x14')](function(_0x12b566){if(_0x12b566){return _0x12b566?{'count':_0x395155,'rows':_0x12b566}:null;}})[_0xc520('0x14')](respondWithResult(_0x49c713,null))[_0xc520('0x1e')](handleError(_0x49c713,null));};exports[_0xc520('0x115')]=function(_0x30bc76,_0x43de39){var _0x1f47aa=_0x30bc76[_0xc520('0x37')]['online']===_0xc520('0x116')?'offlineForm':_0xc520('0x117');return db[_0xc520('0x33')][_0xc520('0x4e')]({'attributes':['id',_0x1f47aa],'where':{'id':_0x30bc76[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x43de39,null))[_0xc520('0x14')](function(_0x47f5a2){if(_0x47f5a2){var _0x286f61=_0x47f5a2[_0x1f47aa];var _0x4eaf62=_0x286f61&&_0x286f61['items']?_0x286f61[_0xc520('0x118')]:[];_0x43de39[_0xc520('0xbd')]({'fromKey':_[_0xc520('0x78')](_0x286f61[_0xc520('0x119')])?undefined:_0x286f61[_0xc520('0x119')],'count':_0x4eaf62[_0xc520('0x3e')],'rows':_0x4eaf62});}})[_0xc520('0x1e')](handleError(_0x43de39,null));};exports[_0xc520('0x11a')]=function(_0x3b3b80,_0x4f22b5){var _0x5c7bcf={'raw':![],'where':{}};var _0x2e45d9={};var _0x580013={'count':0x0,'rows':[]};return db[_0xc520('0x33')][_0xc520('0x5a')]({'where':{'id':_0x3b3b80[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x4f22b5,null))[_0xc520('0x14')](function(_0x1738a9){if(_0x1738a9){_0x2e45d9[_0xc520('0x3c')]=_[_0xc520('0x38')](db['ChatOfflineMessage']['rawAttributes']);_0x2e45d9['query']=_[_0xc520('0x38')](_0x3b3b80[_0xc520('0x37')]);_0x2e45d9[_0xc520('0x39')]=_[_0xc520('0x3a')](_0x2e45d9[_0xc520('0x3c')],_0x2e45d9['query']);_0x5c7bcf['attributes']=_['intersection'](_0x2e45d9[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x3b3b80[_0xc520('0x37')][_0xc520('0x3d')]));_0x5c7bcf[_0xc520('0x3b')]=_0x5c7bcf['attributes'][_0xc520('0x3e')]?_0x5c7bcf[_0xc520('0x3b')]:_0x2e45d9['model'];if(!_0x3b3b80['query']['hasOwnProperty'](_0xc520('0x40'))){_0x5c7bcf[_0xc520('0x23')]=qs[_0xc520('0x23')](_0x3b3b80['query'][_0xc520('0x23')]);_0x5c7bcf['offset']=qs[_0xc520('0x21')](_0x3b3b80[_0xc520('0x37')][_0xc520('0x21')]);}_0x5c7bcf[_0xc520('0x41')]=qs['sort'](_0x3b3b80['query'][_0xc520('0x42')]);_0x5c7bcf[_0xc520('0x43')]=qs[_0xc520('0x39')](_[_0xc520('0x5b')](_0x3b3b80[_0xc520('0x37')],_0x2e45d9['filters']));_0x5c7bcf[_0xc520('0x43')][_0xc520('0x57')]=_0x1738a9['id'];if(_0x3b3b80[_0xc520('0x37')][_0xc520('0x44')]){_0x5c7bcf[_0xc520('0x43')]=_[_0xc520('0x45')](_0x5c7bcf[_0xc520('0x43')],{'$or':_[_0xc520('0x32')](_0x5c7bcf[_0xc520('0x3b')],function(_0x33f8f6){var _0xec056c={};_0xec056c[_0x33f8f6]={'$like':'%'+_0x3b3b80[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0xec056c;})});}_0x5c7bcf=_['merge']({},_0x5c7bcf,_0x3b3b80[_0xc520('0x4d')]);return db['ChatOfflineMessage']['count']({'where':_0x5c7bcf[_0xc520('0x43')]})[_0xc520('0x14')](function(_0x36412d){_0x580013[_0xc520('0x24')]=_0x36412d;if(_0x3b3b80[_0xc520('0x37')][_0xc520('0x4c')]){_0x5c7bcf[_0xc520('0x47')]=[{'all':!![]}];}else{_0x5c7bcf[_0xc520('0x47')]=[{'model':db[_0xc520('0x7d')],'as':_0xc520('0xe8'),'required':![]},{'model':db[_0xc520('0xd2')],'as':_0xc520('0x11b'),'required':![]}];}return db[_0xc520('0x11c')][_0xc520('0x48')](_0x5c7bcf);})[_0xc520('0x14')](function(_0x1eafa){_0x580013[_0xc520('0x49')]=_0x1eafa;return _0x580013;});}})[_0xc520('0x14')](respondWithFilteredResult(_0x4f22b5,_0x5c7bcf))[_0xc520('0x1e')](handleError(_0x4f22b5,null));};exports['addAgents']=function(_0x21c00a,_0x6f65e){return db[_0xc520('0x33')][_0xc520('0x4e')]({'where':{'id':_0x21c00a[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x6f65e,null))[_0xc520('0x14')](function(_0x4edd4d){if(_0x4edd4d){return _0x4edd4d['addAgents'](_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')],_[_0xc520('0xe7')](_0x21c00a[_0xc520('0x55')],['ids','id'])||{})['spread'](function(_0x236b25){for(var _0x35016a=0x0;_0x35016a<_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')][_0xc520('0x3e')];_0x35016a+=0x1){socket[_0xc520('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x21c00a[_0xc520('0x55')][_0xc520('0x5d')][_0x35016a]),'ChatWebsiteId':Number(_0x21c00a['params']['id'])});}return _0x236b25;});}})[_0xc520('0x14')](respondWithResult(_0x6f65e,null))[_0xc520('0x1e')](handleError(_0x6f65e,null));};exports[_0xc520('0x11e')]=function(_0x287a61,_0x3752d1){return db[_0xc520('0x33')]['find']({'where':{'id':_0x287a61['params']['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x3752d1,null))[_0xc520('0x14')](function(_0x313183){if(_0x313183){return _0x313183[_0xc520('0x11e')](_0x287a61['query'][_0xc520('0x5d')])[_0xc520('0x14')](function(){if(_['isArray'](_0x287a61[_0xc520('0x37')][_0xc520('0x5d')])){for(var _0x4860c1=0x0;_0x4860c1<_0x287a61[_0xc520('0x37')][_0xc520('0x5d')][_0xc520('0x3e')];_0x4860c1+=0x1){socket[_0xc520('0x11d')](_0xc520('0x11f'),{'UserId':Number(_0x287a61[_0xc520('0x37')][_0xc520('0x5d')][_0x4860c1]),'ChatWebsiteId':Number(_0x287a61['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x287a61[_0xc520('0x37')][_0xc520('0x5d')]),'ChatWebsiteId':Number(_0x287a61[_0xc520('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3752d1,null))[_0xc520('0x1e')](handleError(_0x3752d1,null));};exports[_0xc520('0x120')]=function(_0x20b46f,_0x301124){var _0xc1e2b4={};var _0x34162b={};var _0x4a84cf;var _0x23f29a;return db['ChatWebsite'][_0xc520('0x5a')]({'where':{'id':_0x20b46f[_0xc520('0x4a')]['id']}})[_0xc520('0x14')](handleEntityNotFound(_0x301124,null))[_0xc520('0x14')](function(_0x1f5c3a){if(_0x1f5c3a){_0x4a84cf=_0x1f5c3a;_0x34162b[_0xc520('0x3c')]=_[_0xc520('0x38')](db[_0xc520('0xe9')]['rawAttributes']);_0x34162b[_0xc520('0x37')]=_[_0xc520('0x38')](_0x20b46f['query']);_0x34162b['filters']=_[_0xc520('0x3a')](_0x34162b['model'],_0x34162b[_0xc520('0x37')]);_0xc1e2b4[_0xc520('0x3b')]=_[_0xc520('0x3a')](_0x34162b[_0xc520('0x3c')],qs[_0xc520('0x3d')](_0x20b46f['query'][_0xc520('0x3d')]));_0xc1e2b4[_0xc520('0x3b')]=_0xc1e2b4[_0xc520('0x3b')][_0xc520('0x3e')]?_0xc1e2b4[_0xc520('0x3b')]:_0x34162b['model'];_0xc1e2b4[_0xc520('0x41')]=qs['sort'](_0x20b46f[_0xc520('0x37')]['sort']);_0xc1e2b4[_0xc520('0x43')]=qs[_0xc520('0x39')](_['pick'](_0x20b46f['query'],_0x34162b[_0xc520('0x39')]));if(_0x20b46f[_0xc520('0x37')]['filter']){_0xc1e2b4[_0xc520('0x43')]=_['merge'](_0xc1e2b4[_0xc520('0x43')],{'$or':_['map'](_0xc1e2b4[_0xc520('0x3b')],function(_0x5960ba){var _0x1dfe3c={};_0x1dfe3c[_0x5960ba]={'$like':'%'+_0x20b46f[_0xc520('0x37')][_0xc520('0x44')]+'%'};return _0x1dfe3c;})});}_0xc1e2b4=_['merge']({},_0xc1e2b4,_0x20b46f[_0xc520('0x4d')]);return _0x4a84cf[_0xc520('0x120')](_0xc1e2b4);}})[_0xc520('0x14')](function(_0xf3928b){if(_0xf3928b){_0x23f29a=_0xf3928b['length'];if(!_0x20b46f[_0xc520('0x37')][_0xc520('0x3f')](_0xc520('0x40'))){_0xc1e2b4[_0xc520('0x23')]=qs['limit'](_0x20b46f[_0xc520('0x37')][_0xc520('0x23')]);_0xc1e2b4[_0xc520('0x21')]=qs[_0xc520('0x21')](_0x20b46f[_0xc520('0x37')][_0xc520('0x21')]);}return _0x4a84cf[_0xc520('0x120')](_0xc1e2b4);}})['then'](function(_0x48847e){if(_0x48847e){return _0x48847e?{'count':_0x23f29a,'rows':_0x48847e}:null;}})[_0xc520('0x14')](respondWithResult(_0x301124,null))['catch'](handleError(_0x301124,null));}; \ No newline at end of file +var _0xf0e3=['server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','account','ListId','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','type','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','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','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','offlineMessageSubject','subjectOffline','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','chatLicenseExceeded','all','readFileSync','server/files/chat/iframe.ejs','remote','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','getApplications','addProactiveActions','omit','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','limit','count','set','Content-Range','update','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','length','includeAll','include','find','create','body','user','role','get','ChatWebsites','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','order','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','root','download','server/files/images/avatars/','getCustomerAvatar'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf0e3,0x1dc));var _0x3f0e=function(_0x44e83f,_0xb35413){_0x44e83f=_0x44e83f-0x0;var _0x585054=_0xf0e3[_0x44e83f];return _0x585054;};'use strict';var BPromise=require(_0x3f0e('0x0'));var Mustache=require(_0x3f0e('0x1'));var util=require(_0x3f0e('0x2'));var path=require(_0x3f0e('0x3'));var ejs=require(_0x3f0e('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f0e('0x5'));var querystring=require(_0x3f0e('0x6'));var Redis=require(_0x3f0e('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f0e('0x8'))(_0x3f0e('0x9'));var config=require(_0x3f0e('0xa'));var db=require(_0x3f0e('0xb'))['db'];config['redis']=_[_0x3f0e('0xc')](config[_0x3f0e('0xd')],{'host':_0x3f0e('0xe'),'port':0x18eb});var socket=require(_0x3f0e('0xf'))(new Redis(config[_0x3f0e('0xd')]));require(_0x3f0e('0x10'))[_0x3f0e('0x11')](socket);var htmlToText=require(_0x3f0e('0x12'));var jayson=require(_0x3f0e('0x13'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3f0e('0x14')]['http']({'port':0x232a});var client9003=jayson[_0x3f0e('0x14')][_0x3f0e('0x15')]({'port':0x232b});var client9001=jayson['client'][_0x3f0e('0x15')]({'port':0x2329});function respondWithRpcPromise(_0xa6b3d8,_0x16d6a5,_0x2d7f50,_0x3433d0){return new BPromise(function(_0x1d12bd,_0x30466e){var _0x4c399e=_0x3433d0||client;return _0x4c399e[_0x3f0e('0x16')](_0xa6b3d8,_0x2d7f50)[_0x3f0e('0x17')](function(_0x18ac45){logger[_0x3f0e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x16d6a5,'request\x20sent');logger[_0x3f0e('0x19')](_0x3f0e('0x1a'),_0x16d6a5,_0x3f0e('0x1b'),JSON[_0x3f0e('0x1c')](_0x18ac45));if(_0x18ac45[_0x3f0e('0x1d')]){if(_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x1e')]===0x1f4){logger[_0x3f0e('0x1d')](_0x3f0e('0x1f'),_0x16d6a5,_0x18ac45['error']['message']);return _0x30466e(_0x18ac45['error'][_0x3f0e('0x20')]);}logger['error'](_0x3f0e('0x1f'),_0x16d6a5,_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x20')]);return _0x1d12bd(_0x18ac45[_0x3f0e('0x1d')][_0x3f0e('0x20')]);}else{logger[_0x3f0e('0x18')](_0x3f0e('0x1f'),_0x16d6a5,'request\x20sent');_0x1d12bd(_0x18ac45['result'][_0x3f0e('0x20')]);}})[_0x3f0e('0x21')](function(_0x20038a){logger[_0x3f0e('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x16d6a5,_0x20038a);_0x30466e(_0x20038a);});});}function respondWithStatusCode(_0x1d0698,_0x24f0cc){_0x24f0cc=_0x24f0cc||0xcc;return function(_0x53ac92){if(_0x53ac92){return _0x1d0698[_0x3f0e('0x22')](_0x24f0cc);}return _0x1d0698[_0x3f0e('0x23')](_0x24f0cc)['end']();};}function respondWithResult(_0x2b57f2,_0x52262c){_0x52262c=_0x52262c||0xc8;return function(_0x47c5e2){if(_0x47c5e2){return _0x2b57f2[_0x3f0e('0x23')](_0x52262c)[_0x3f0e('0x24')](_0x47c5e2);}};}function respondWithFilteredResult(_0x41b30a,_0x4f3766){return function(_0x242b03){if(_0x242b03){var _0x3c04e4=typeof _0x4f3766['offset']===_0x3f0e('0x25')&&typeof _0x4f3766[_0x3f0e('0x26')]===_0x3f0e('0x25');var _0x25eabb=_0x242b03[_0x3f0e('0x27')];var _0x2cc1e6=_0x3c04e4?0x0:_0x4f3766['offset'];var _0x393dc9=_0x3c04e4?_0x242b03[_0x3f0e('0x27')]:_0x4f3766['offset']+_0x4f3766[_0x3f0e('0x26')];var _0x3daff4;if(_0x393dc9>=_0x25eabb){_0x393dc9=_0x25eabb;_0x3daff4=0xc8;}else{_0x3daff4=0xce;}_0x41b30a['status'](_0x3daff4);return _0x41b30a[_0x3f0e('0x28')](_0x3f0e('0x29'),_0x2cc1e6+'-'+_0x393dc9+'/'+_0x25eabb)['json'](_0x242b03);}return null;};}function saveUpdates(_0x46b354){return function(_0x294206){if(_0x294206){return _0x294206[_0x3f0e('0x2a')](_0x46b354)['then'](function(_0x2a0087){return _0x2a0087;});}return null;};}function removeEntity(_0x89c2a){return function(_0x3672c4){if(_0x3672c4){return _0x3672c4[_0x3f0e('0x2b')]()['then'](function(){var _0x20bf0d=_0x3672c4['get']({'plain':!![]});var _0xd5c850='ChatWebsites';return db['UserProfileResource'][_0x3f0e('0x2b')]({'where':{'type':_0xd5c850,'resourceId':_0x20bf0d['id']}})[_0x3f0e('0x17')](function(){return _0x3672c4;});})[_0x3f0e('0x17')](function(){_0x89c2a[_0x3f0e('0x23')](0xcc)[_0x3f0e('0x2c')]();});}};}function handleEntityNotFound(_0x4427dd){return function(_0x755bdc){if(!_0x755bdc){_0x4427dd[_0x3f0e('0x22')](0x194);}return _0x755bdc;};}function handleError(_0x1a376f,_0xca1521){_0xca1521=_0xca1521||0x1f4;return function(_0x3a30ea){logger[_0x3f0e('0x1d')](_0x3a30ea['stack']);if(_0x3a30ea[_0x3f0e('0x2d')]){delete _0x3a30ea['name'];}_0x1a376f[_0x3f0e('0x23')](_0xca1521)[_0x3f0e('0x2e')](_0x3a30ea);};}exports[_0x3f0e('0x2f')]=function(_0x3f2287,_0x59b093){var _0xa2fe01={'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]},_0x21f0a1={},_0x18d5eb={'count':0x0,'rows':[]};var _0x3e9951=_[_0x3f0e('0x32')](db[_0x3f0e('0x33')][_0x3f0e('0x34')],function(_0x1c1a24){return{'name':_0x1c1a24[_0x3f0e('0x35')],'type':_0x1c1a24['type'][_0x3f0e('0x36')]};});_0x21f0a1[_0x3f0e('0x37')]=_[_0x3f0e('0x32')](_0x3e9951,'name');_0x21f0a1[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x3f2287[_0x3f0e('0x38')]);_0x21f0a1['filters']=_[_0x3f0e('0x3a')](_0x21f0a1[_0x3f0e('0x37')],_0x21f0a1['query']);_0xa2fe01[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x21f0a1[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0xa2fe01[_0x3f0e('0x3b')]=_0xa2fe01[_0x3f0e('0x3b')]['length']?_0xa2fe01[_0x3f0e('0x3b')]:_0x21f0a1['model'];if(!_0x3f2287['query'][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0xa2fe01[_0x3f0e('0x26')]=qs['limit'](_0x3f2287['query'][_0x3f0e('0x26')]);_0xa2fe01[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0xa2fe01['order']=qs[_0x3f0e('0x40')](_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0xa2fe01[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x3f2287[_0x3f0e('0x38')],_0x21f0a1[_0x3f0e('0x42')]),_0x3e9951);if(_0x3f2287['query'][_0x3f0e('0x44')]){_0xa2fe01[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0xa2fe01[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x3e9951,function(_0x4384c0){if(_0x4384c0['type']!=='VIRTUAL'){var _0x5d78fa={};_0x5d78fa[_0x4384c0[_0x3f0e('0x2d')]]={'$like':'%'+_0x3f2287[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x5d78fa;}})});}_0xa2fe01=_[_0x3f0e('0x45')]({},_0xa2fe01,_0x3f2287[_0x3f0e('0x46')]);var _0x27cb5b={'where':_0xa2fe01[_0x3f0e('0x41')]};return db[_0x3f0e('0x33')][_0x3f0e('0x27')](_0x27cb5b)[_0x3f0e('0x17')](function(_0x4d859e){_0x18d5eb[_0x3f0e('0x27')]=_0x4d859e;if(_0x3f2287[_0x3f0e('0x38')]['includeAll']){_0xa2fe01['include']=[{'all':!![]}];}return db[_0x3f0e('0x33')][_0x3f0e('0x47')](_0xa2fe01);})[_0x3f0e('0x17')](function(_0x558d00){_0x18d5eb[_0x3f0e('0x48')]=_0x558d00;return _0x18d5eb;})[_0x3f0e('0x17')](respondWithFilteredResult(_0x59b093,_0xa2fe01))['catch'](handleError(_0x59b093,null));};exports[_0x3f0e('0x49')]=function(_0x5753c3,_0x14f9e2){var _0x372413={'raw':![],'where':{'id':_0x5753c3[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]},_0x24e029={};_0x24e029[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x33')][_0x3f0e('0x34')]);_0x24e029[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x5753c3[_0x3f0e('0x38')]);_0x24e029[_0x3f0e('0x42')]=_['intersection'](_0x24e029['model'],_0x24e029[_0x3f0e('0x38')]);_0x372413[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x24e029[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x5753c3['query'][_0x3f0e('0x3c')]));_0x372413[_0x3f0e('0x3b')]=_0x372413[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x372413[_0x3f0e('0x3b')]:_0x24e029[_0x3f0e('0x37')];if(_0x5753c3[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x372413[_0x3f0e('0x4d')]=[{'all':!![]}];}_0x372413=_[_0x3f0e('0x45')]({},_0x372413,_0x5753c3['options']);return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x372413)['then'](handleEntityNotFound(_0x14f9e2,null))[_0x3f0e('0x17')](respondWithResult(_0x14f9e2,null))[_0x3f0e('0x21')](handleError(_0x14f9e2,null));};exports[_0x3f0e('0x4f')]=function(_0x5bad02,_0x46113c){return db[_0x3f0e('0x33')][_0x3f0e('0x4f')](_0x5bad02[_0x3f0e('0x50')],{})[_0x3f0e('0x17')](function(_0x44d1f0){var _0x5c7b93=_0x5bad02[_0x3f0e('0x51')]['get']({'plain':!![]});if(!_0x5c7b93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c7b93[_0x3f0e('0x52')]==='user'){var _0x2433e6=_0x44d1f0[_0x3f0e('0x53')]({'plain':!![]});var _0x5b8cfd=_0x3f0e('0x54');return db[_0x3f0e('0x55')]['find']({'where':{'name':_0x5b8cfd,'userProfileId':_0x5c7b93[_0x3f0e('0x56')]},'raw':!![]})[_0x3f0e('0x17')](function(_0x4cd74b){if(_0x4cd74b&&_0x4cd74b['autoAssociation']===0x0){return db[_0x3f0e('0x57')][_0x3f0e('0x4f')]({'name':_0x2433e6['name'],'resourceId':_0x2433e6['id'],'type':_0x4cd74b[_0x3f0e('0x2d')],'sectionId':_0x4cd74b['id']},{})[_0x3f0e('0x17')](function(){return _0x44d1f0;});}else{return _0x44d1f0;}})['catch'](function(_0x270f29){logger[_0x3f0e('0x1d')](_0x3f0e('0x58'),_0x270f29);throw _0x270f29;});}return _0x44d1f0;})['then'](respondWithResult(_0x46113c,0xc9))[_0x3f0e('0x21')](handleError(_0x46113c,null));};exports[_0x3f0e('0x2a')]=function(_0x2cc374,_0x8aab85){if(_0x2cc374[_0x3f0e('0x50')]['id']){delete _0x2cc374[_0x3f0e('0x50')]['id'];}return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x2cc374['params']['id']},'include':[{'model':db[_0x3f0e('0x30')],'as':_0x3f0e('0x31')}]})[_0x3f0e('0x17')](handleEntityNotFound(_0x8aab85,null))[_0x3f0e('0x17')](saveUpdates(_0x2cc374[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x8aab85,null))['catch'](handleError(_0x8aab85,null));};exports['destroy']=function(_0x50c0cb,_0x56ccc2){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x50c0cb[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x56ccc2,null))[_0x3f0e('0x17')](removeEntity(_0x56ccc2,null))['catch'](handleError(_0x56ccc2,null));};exports['describe']=function(_0x1353e7,_0x52b3a0){return db[_0x3f0e('0x33')][_0x3f0e('0x59')]()[_0x3f0e('0x17')](respondWithResult(_0x52b3a0,null))[_0x3f0e('0x21')](handleError(_0x52b3a0,null));};exports[_0x3f0e('0x5a')]=function(_0x472c42,_0x39240d){if(_0x472c42[_0x3f0e('0x50')]['id']){delete _0x472c42['body']['id'];}return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x472c42[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x39240d,null))['then'](function(_0x35338c){if(_0x35338c){_0x472c42[_0x3f0e('0x50')]['ChatWebsiteId']=_0x35338c['id'];return db[_0x3f0e('0x5b')][_0x3f0e('0x4f')](_0x472c42[_0x3f0e('0x50')]);}})['then'](respondWithResult(_0x39240d,null))[_0x3f0e('0x21')](handleError(_0x39240d,null));};exports[_0x3f0e('0x5c')]=function(_0x399fef,_0x2d9a61){var _0x2e0425={'raw':![],'where':{}};var _0x2c1ebe={};var _0xfe9081={'count':0x0,'rows':[]};return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x399fef[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d9a61,null))['then'](function(_0x31d01a){if(_0x31d01a){_0x2c1ebe['model']=_[_0x3f0e('0x39')](db[_0x3f0e('0x5b')][_0x3f0e('0x34')]);_0x2c1ebe['query']=_[_0x3f0e('0x39')](_0x399fef[_0x3f0e('0x38')]);_0x2c1ebe[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x2c1ebe[_0x3f0e('0x37')],_0x2c1ebe[_0x3f0e('0x38')]);_0x2e0425[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x2c1ebe['model'],qs[_0x3f0e('0x3c')](_0x399fef['query']['fields']));_0x2e0425[_0x3f0e('0x3b')]=_0x2e0425[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x2e0425['attributes']:_0x2c1ebe[_0x3f0e('0x37')];if(!_0x399fef['query']['hasOwnProperty'](_0x3f0e('0x3e'))){_0x2e0425[_0x3f0e('0x26')]=qs[_0x3f0e('0x26')](_0x399fef['query'][_0x3f0e('0x26')]);_0x2e0425[_0x3f0e('0x3f')]=qs['offset'](_0x399fef[_0x3f0e('0x38')]['offset']);}_0x2e0425[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x2e0425[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x399fef[_0x3f0e('0x38')],_0x2c1ebe[_0x3f0e('0x42')]));_0x2e0425['where'][_0x3f0e('0x5f')]=_0x31d01a['id'];if(_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x2e0425[_0x3f0e('0x41')]=_['merge'](_0x2e0425['where'],{'$or':_[_0x3f0e('0x32')](_0x2e0425[_0x3f0e('0x3b')],function(_0x1ba7a4){var _0x48b8c0={};_0x48b8c0[_0x1ba7a4]={'$like':'%'+_0x399fef[_0x3f0e('0x38')]['filter']+'%'};return _0x48b8c0;})});}_0x2e0425=_[_0x3f0e('0x45')]({},_0x2e0425,_0x399fef['options']);return db[_0x3f0e('0x5b')][_0x3f0e('0x27')]({'where':_0x2e0425[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x5d0239){_0xfe9081[_0x3f0e('0x27')]=_0x5d0239;if(_0x399fef[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x2e0425[_0x3f0e('0x4d')]=[{'all':!![]}];}return db[_0x3f0e('0x5b')][_0x3f0e('0x47')](_0x2e0425);})[_0x3f0e('0x17')](function(_0x142000){_0xfe9081['rows']=_0x142000;return _0xfe9081;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x2d9a61,_0x2e0425))[_0x3f0e('0x21')](handleError(_0x2d9a61,null));};exports[_0x3f0e('0x60')]=function(_0x2c0e5b,_0x3feb0a){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x2c0e5b[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x3feb0a,null))['then'](function(_0x5c47cf){if(_0x5c47cf){return _0x5c47cf['removeDispositions'](_0x2c0e5b[_0x3f0e('0x38')][_0x3f0e('0x61')]);}})[_0x3f0e('0x17')](respondWithStatusCode(_0x3feb0a,null))[_0x3f0e('0x21')](handleError(_0x3feb0a,null));};exports[_0x3f0e('0x62')]=function(_0xa02c31,_0x21c798){if(_0xa02c31['body']['id']){delete _0xa02c31[_0x3f0e('0x50')]['id'];}return db['ChatWebsite'][_0x3f0e('0x4e')]({'where':{'id':_0xa02c31[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x21c798,null))[_0x3f0e('0x17')](function(_0x1bad21){if(_0x1bad21){_0xa02c31['body'][_0x3f0e('0x5f')]=_0x1bad21['id'];return db['CannedAnswer'][_0x3f0e('0x4f')](_0xa02c31[_0x3f0e('0x50')]);}})[_0x3f0e('0x17')](respondWithResult(_0x21c798,null))[_0x3f0e('0x21')](handleError(_0x21c798,null));};exports[_0x3f0e('0x63')]=function(_0x85409,_0x21931d){var _0xcb91ae={'raw':![],'where':{}};var _0x3f27e4={};var _0x54933a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x85409[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x21931d,null))[_0x3f0e('0x17')](function(_0x27a666){if(_0x27a666){_0x3f27e4[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x64')]['rawAttributes']);_0x3f27e4[_0x3f0e('0x38')]=_['keys'](_0x85409[_0x3f0e('0x38')]);_0x3f27e4[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x3f27e4[_0x3f0e('0x37')],_0x3f27e4['query']);_0xcb91ae[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x3f27e4[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x85409['query'][_0x3f0e('0x3c')]));_0xcb91ae['attributes']=_0xcb91ae[_0x3f0e('0x3b')]['length']?_0xcb91ae[_0x3f0e('0x3b')]:_0x3f27e4[_0x3f0e('0x37')];if(!_0x85409['query'][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0xcb91ae['limit']=qs[_0x3f0e('0x26')](_0x85409['query'][_0x3f0e('0x26')]);_0xcb91ae['offset']=qs[_0x3f0e('0x3f')](_0x85409[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0xcb91ae[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x85409[_0x3f0e('0x38')]['sort']);_0xcb91ae[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x85409['query'],_0x3f27e4[_0x3f0e('0x42')]));_0xcb91ae[_0x3f0e('0x41')][_0x3f0e('0x5f')]=_0x27a666['id'];if(_0x85409[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0xcb91ae[_0x3f0e('0x41')]=_['merge'](_0xcb91ae[_0x3f0e('0x41')],{'$or':_['map'](_0xcb91ae[_0x3f0e('0x3b')],function(_0x4ac143){var _0x4266a6={};_0x4266a6[_0x4ac143]={'$like':'%'+_0x85409[_0x3f0e('0x38')]['filter']+'%'};return _0x4266a6;})});}_0xcb91ae=_[_0x3f0e('0x45')]({},_0xcb91ae,_0x85409[_0x3f0e('0x46')]);return db[_0x3f0e('0x64')][_0x3f0e('0x27')]({'where':_0xcb91ae['where']})[_0x3f0e('0x17')](function(_0x2e9be5){_0x54933a[_0x3f0e('0x27')]=_0x2e9be5;if(_0x85409[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0xcb91ae['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3f0e('0x47')](_0xcb91ae);})['then'](function(_0x10176e){_0x54933a[_0x3f0e('0x48')]=_0x10176e;return _0x54933a;});}})['then'](respondWithFilteredResult(_0x21931d,_0xcb91ae))[_0x3f0e('0x21')](handleError(_0x21931d,null));};exports[_0x3f0e('0x65')]=function(_0x2ace77,_0x178feb){return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x2ace77[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x178feb,null))[_0x3f0e('0x17')](function(_0xfd0dbc){if(_0xfd0dbc){return _0xfd0dbc[_0x3f0e('0x65')](_0x2ace77[_0x3f0e('0x38')][_0x3f0e('0x61')]);}})['then'](respondWithStatusCode(_0x178feb,null))[_0x3f0e('0x21')](handleError(_0x178feb,null));};exports[_0x3f0e('0x66')]=function(_0x40830c,_0x1d5c47){_0x40830c[_0x3f0e('0x50')][_0x3f0e('0x67')]=_0x40830c[_0x3f0e('0x68')][_0x3f0e('0x69')];return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x40830c[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x1d5c47,null))['then'](saveUpdates(_0x40830c[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x1d5c47,null))[_0x3f0e('0x21')](handleError(_0x1d5c47,null));};exports[_0x3f0e('0x6a')]=function(_0x1292f5,_0x404f8b){_0x1292f5[_0x3f0e('0x50')][_0x3f0e('0x6b')]=_0x1292f5[_0x3f0e('0x68')][_0x3f0e('0x69')];return db['ChatWebsite'][_0x3f0e('0x4e')]({'where':{'id':_0x1292f5['params']['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x404f8b,null))[_0x3f0e('0x17')](saveUpdates(_0x1292f5['body'],null))['then'](respondWithResult(_0x404f8b,null))[_0x3f0e('0x21')](handleError(_0x404f8b,null));};exports[_0x3f0e('0x6c')]=function(_0x3deab0,_0x13ff84){_0x3deab0[_0x3f0e('0x50')][_0x3f0e('0x6d')]=_0x3deab0[_0x3f0e('0x68')][_0x3f0e('0x69')];return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x3deab0[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x13ff84,null))['then'](saveUpdates(_0x3deab0[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x13ff84,null))[_0x3f0e('0x21')](handleError(_0x13ff84,null));};exports[_0x3f0e('0x6e')]=function(_0x1cff93,_0x1cd663){_0x1cff93[_0x3f0e('0x50')][_0x3f0e('0x6f')]=_0x1cff93[_0x3f0e('0x68')]['filename'];return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x1cff93[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x1cd663,null))[_0x3f0e('0x17')](saveUpdates(_0x1cff93[_0x3f0e('0x50')],null))[_0x3f0e('0x17')](respondWithResult(_0x1cd663,null))[_0x3f0e('0x21')](handleError(_0x1cd663,null));};exports[_0x3f0e('0x70')]=function(_0x66029f,_0x50e2bd){var _0x1cb103=path[_0x3f0e('0x71')](config['root'],_0x3f0e('0x72'));var _0x16c33c={'where':{'id':_0x66029f['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33fd9a=![];return require(_0x3f0e('0x73'))['getLicense']()[_0x3f0e('0x17')](function(_0x1c970b){if(_0x1c970b){_0x33fd9a=_0x1c970b[_0x3f0e('0x74')];}})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0x33')]['find'](_0x16c33c);})['then'](handleEntityNotFound(_0x50e2bd,null))[_0x3f0e('0x17')](function(_0x2c78c6){if(_0x2c78c6){if(!_[_0x3f0e('0x75')](_0x2c78c6['sitepic'])){if(fs[_0x3f0e('0x76')](path[_0x3f0e('0x71')](config['root'],_0x3f0e('0x77'),_0x2c78c6['sitepic']))&&_0x33fd9a){_0x1cb103=path['join'](config[_0x3f0e('0x78')],_0x3f0e('0x77'),_0x2c78c6['sitepic']);}}return _0x50e2bd[_0x3f0e('0x79')](_0x1cb103);}})[_0x3f0e('0x21')](handleError(_0x50e2bd,null));};exports['getAvatar']=function(_0x39c4a6,_0x32e714){var _0x188cd9=path[_0x3f0e('0x71')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x5c3edf={'where':{'id':_0x39c4a6['params']['id']},'attributes':['id',_0x3f0e('0x6b')],'raw':!![]};return db['ChatWebsite'][_0x3f0e('0x4e')](_0x5c3edf)[_0x3f0e('0x17')](handleEntityNotFound(_0x32e714,null))[_0x3f0e('0x17')](function(_0x2b67de){if(_0x2b67de){if(!_[_0x3f0e('0x75')](_0x2b67de['agentAvatar'])){if(fs[_0x3f0e('0x76')](path['join'](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x2b67de[_0x3f0e('0x6b')]))){_0x188cd9=path[_0x3f0e('0x71')](config['root'],'server/files/images/avatars/',_0x2b67de['agentAvatar']);}}return _0x32e714['download'](_0x188cd9);}})['catch'](handleError(_0x32e714,null));};exports[_0x3f0e('0x7b')]=function(_0x540f5f,_0x379d84){var _0xd34f6=path['join'](config['root'],_0x3f0e('0x7c'));var _0x2f7e50={'where':{'id':_0x540f5f[_0x3f0e('0x4a')]['id']},'attributes':['id',_0x3f0e('0x6d'),_0x3f0e('0x7d')],'raw':!![]};return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x2f7e50)[_0x3f0e('0x17')](handleEntityNotFound(_0x379d84,null))[_0x3f0e('0x17')](function(_0x29e3f4){if(_0x29e3f4){if(!_[_0x3f0e('0x75')](_0x29e3f4[_0x3f0e('0x6d')])){if(fs['existsSync'](path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x29e3f4[_0x3f0e('0x6d')]))&&_0x29e3f4['showCustomerAvatar']){_0xd34f6=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],'server/files/images/avatars/',_0x29e3f4['customerAvatar']);}}return _0x379d84['download'](_0xd34f6);}})[_0x3f0e('0x21')](handleError(_0x379d84,null));};exports['getSystemAvatar']=function(_0x8420eb,_0x326acf){var _0x4bfcfc=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7e'));var _0x5cea6a={'where':{'id':_0x8420eb[_0x3f0e('0x4a')]['id']},'attributes':['id',_0x3f0e('0x6f')],'raw':!![]};return db[_0x3f0e('0x33')][_0x3f0e('0x4e')](_0x5cea6a)[_0x3f0e('0x17')](handleEntityNotFound(_0x326acf,null))[_0x3f0e('0x17')](function(_0x575a55){if(_0x575a55){if(!_['isNil'](_0x575a55[_0x3f0e('0x6f')])){if(fs[_0x3f0e('0x76')](path['join'](config['root'],_0x3f0e('0x7a'),_0x575a55[_0x3f0e('0x6f')]))){_0x4bfcfc=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x7a'),_0x575a55[_0x3f0e('0x6f')]);}}return _0x326acf[_0x3f0e('0x79')](_0x4bfcfc);}})[_0x3f0e('0x21')](handleError(_0x326acf,null));};exports[_0x3f0e('0x7f')]=function(_0x535b63,_0x3ab285){var _0x45fc31=require('user-agent-parser');var _0x418c1f=new _0x45fc31();var _0x28aa00=_0x418c1f[_0x3f0e('0x80')](_0x535b63[_0x3f0e('0x81')][_0x3f0e('0x82')])[_0x3f0e('0x83')]();var _0x3505cd={'body':_0x535b63['body'],'channel':_0x3f0e('0x84')};var _0x10d9cb=[];var _0x224a28=[];var _0x39d5f5={};var _0x124eca=![];return db[_0x3f0e('0x85')]['describe']()[_0x3f0e('0x17')](function(_0x563b19){if(!_0x563b19){throw new db[(_0x3f0e('0x86'))]['ValidationError'](_0x3f0e('0x87'));}_0x10d9cb=_[_0x3f0e('0x88')](_[_0x3f0e('0x39')](_0x563b19),[_0x3f0e('0x89'),_0x3f0e('0x8a')]);_0x224a28=_[_0x3f0e('0x88')](_[_0x3f0e('0x39')](_0x563b19),['createdAt',_0x3f0e('0x8a'),_0x3f0e('0x8b'),'ListId']);if(_0x535b63[_0x3f0e('0x50')]['id']){delete _0x535b63[_0x3f0e('0x50')]['id'];}if(_[_0x3f0e('0x75')](_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x8c')])){throw new db['Sequelize'][(_0x3f0e('0x8d'))](_0x3f0e('0x8e'));}if(_[_0x3f0e('0x75')](_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x50')])||_0x535b63[_0x3f0e('0x50')]['body']===''){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x535b63[_0x3f0e('0x50')]['mapKey'])){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0x8f')+_0x224a28);}if(!_[_0x3f0e('0x90')](_0x224a28,_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')])){throw new db[(_0x3f0e('0x86'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x224a28);}_0x39d5f5[_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')]]=_0x535b63[_0x3f0e('0x50')]['from'];})['then'](function(){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x535b63[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0x92')],'as':_0x3f0e('0x93'),'include':[{'model':db['CmContact'],'as':_0x3f0e('0x94'),'where':_0x39d5f5,'limit':0x1,'order':[[_0x3f0e('0x8a'),_0x3f0e('0x95')]]}]},{'model':db[_0x3f0e('0x96')],'as':'Applications'}]});})[_0x3f0e('0x17')](handleEntityNotFound(_0x3ab285,null))[_0x3f0e('0x17')](function(_0x107fe1){if(_0x107fe1&&_0x107fe1[_0x3f0e('0x93')]){_0x3505cd['account']=_0x107fe1;_0x3505cd['applications']=_0x107fe1[_0x3f0e('0x97')];_0x3505cd[_0x3f0e('0x98')]=_0x107fe1['List'];_0x3505cd[_0x3f0e('0x99')]=_[_0x3f0e('0x9a')](_0x3505cd[_0x3f0e('0x99')],['priority'],['asc']);if(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x97')]){delete _0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x97')];}if(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')]&&_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')][_0x3f0e('0x94')][_0x3f0e('0x4b')]){return _0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0x93')][_0x3f0e('0x94')][0x0];}var _0xee4ed6=_['defaults'](_0x535b63['body'],{'firstName':_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x8c')],'ListId':_0x107fe1[_0x3f0e('0x9c')]});_0xee4ed6[_0x535b63[_0x3f0e('0x50')][_0x3f0e('0x91')]]=_0x535b63[_0x3f0e('0x50')]['from'];return db[_0x3f0e('0x85')][_0x3f0e('0x4f')](_0xee4ed6,{'fields':_0x10d9cb,'raw':!![]});}})[_0x3f0e('0x17')](handleEntityNotFound(_0x3ab285,null))[_0x3f0e('0x17')](function(_0x3176c6){_0x3505cd[_0x3f0e('0x9d')]=_0x3176c6;var _0x25b031=_0x535b63[_0x3f0e('0x50')]['customerIp'];if(_0x535b63[_0x3f0e('0x81')]['cf-connecting-ip']){_0x25b031=_0x535b63['headers'][_0x3f0e('0x9e')];}else if(_0x535b63[_0x3f0e('0x81')][_0x3f0e('0x9f')]){_0x25b031=_[_0x3f0e('0xa0')](_0x535b63[_0x3f0e('0x81')]['x-forwarded-for']['split'](','));}if(_0x3176c6){var _0x27a111={'ContactId':_0x3176c6['id'],'ChatWebsiteId':_0x535b63[_0x3f0e('0x4a')]['id'],'from':(_0x3176c6[_0x3f0e('0xa1')]||'')+'\x20'+(_0x3176c6[_0x3f0e('0xa2')]||''),'customerIp':_0x25b031,'customerPort':_0x535b63[_0x3f0e('0x81')]['x-real-port']?_0x535b63[_0x3f0e('0x81')][_0x3f0e('0xa3')]:null,'referer':_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xa4')],'browserName':_0x28aa00[_0x3f0e('0xa5')]['name']&&_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0xa6')]?util[_0x3f0e('0xa7')](_0x3f0e('0xa8'),_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0x2d')],_0x28aa00[_0x3f0e('0xa5')][_0x3f0e('0xa6')]):_0x3f0e('0xa9'),'browserVersion':_0x28aa00['browser'][_0x3f0e('0xa6')]||_0x3f0e('0xa9'),'osName':util[_0x3f0e('0xa7')](_0x3f0e('0xa8'),_0x28aa00['os']['name'],_0x28aa00['os'][_0x3f0e('0xa6')]),'osVersion':_0x28aa00['os']['version'],'deviceModel':_0x28aa00['device'][_0x3f0e('0x37')]&&_0x28aa00[_0x3f0e('0xaa')]['vendor']?util[_0x3f0e('0xa7')](_0x3f0e('0xab'),_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0x37')],_0x28aa00['device'][_0x3f0e('0xac')],_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xad')]):null,'deviceVendor':_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xac')],'deviceType':_0x28aa00[_0x3f0e('0xaa')][_0x3f0e('0xad')],'formData':JSON[_0x3f0e('0x1c')](_0x535b63[_0x3f0e('0x50')])};var _0x508695={'ChatWebsiteId':_0x535b63[_0x3f0e('0x4a')]['id'],'closed':![]};if(_0x535b63['body'][_0x3f0e('0xae')]){_0x508695[_0x3f0e('0xae')]=_0x535b63['body'][_0x3f0e('0xae')];return db[_0x3f0e('0xaf')]['find']({'where':_0x508695})[_0x3f0e('0x17')](function(_0x54644e){if(_0x54644e){return[_0x54644e,![]];}_0x27a111[_0x3f0e('0xae')]=_0x535b63[_0x3f0e('0x50')]['threadId'];_0x27a111[_0x3f0e('0xb0')]=_0x535b63['body'][_0x3f0e('0xb0')];return db['ChatInteraction'][_0x3f0e('0x4f')](_0x27a111)[_0x3f0e('0x17')](function(_0x49b5b8){return[_0x49b5b8,!![]];});});}_0x508695['ContactId']=_0x3176c6['id'];if(_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb1')]&&_0x535b63['body'][_0x3f0e('0xb1')]['id']){_0x508695['id']=_0x535b63['body'][_0x3f0e('0xb1')]['id'];return db[_0x3f0e('0xaf')][_0x3f0e('0x4e')]({'where':_0x508695})['then'](function(_0x543565){if(_0x543565){return[_0x543565,![]];}return db[_0x3f0e('0xaf')]['create'](_0x27a111)[_0x3f0e('0x17')](function(_0x45b0c8){return[_0x45b0c8,!![]];});});}return db['ChatInteraction'][_0x3f0e('0x4f')](_0x27a111)['then'](function(_0x293aab){return[_0x293aab,!![]];});}})[_0x3f0e('0xb2')](function(_0x250db3,_0x7b5352){if(_0x250db3){_0x124eca=_0x7b5352;if(!_0x7b5352){var _0x406804={'from':(_0x3505cd[_0x3f0e('0x9d')][_0x3f0e('0xa1')]||'')+'\x20'+(_0x3505cd[_0x3f0e('0x9d')][_0x3f0e('0xa2')]||'')};if(_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xae')]&&_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb3')]&&_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xae')]!=_0x535b63['body'][_0x3f0e('0xb3')]){_0x406804[_0x3f0e('0xae')]=_0x535b63[_0x3f0e('0x50')][_0x3f0e('0xb3')];}return _0x250db3[_0x3f0e('0x2a')](_0x406804);}else{return _0x250db3;}}})['then'](function(_0x19e454){_0x3505cd['interaction']=_0x19e454[_0x3f0e('0x53')]({'plain':!![]});_0x3505cd[_0x3f0e('0xb1')]['created']=_0x124eca;if(_0x3505cd['interaction']['created']){if(_0x3505cd[_0x3f0e('0x9b')]['autoclose']){_0x3505cd[_0x3f0e('0x99')][_0x3f0e('0xb4')]({'id':0x0,'priority':_0x3505cd[_0x3f0e('0x99')][_0x3f0e('0x4b')]+0x1,'app':_0x3f0e('0xb5'),'appdata':_0x3f0e('0xb6'),'interval':_0x3f0e('0xb7')});}}return db[_0x3f0e('0xb8')][_0x3f0e('0x4f')]({'body':_0x535b63[_0x3f0e('0x50')]['body'],'ChatWebsiteId':_0x535b63['params']['id'],'ChatInteractionId':_0x19e454['id'],'direction':'in','ContactId':_0x3505cd[_0x3f0e('0x9d')]['id'],'AttachmentId':_0x535b63[_0x3f0e('0x50')]['AttachmentId']});})[_0x3f0e('0x17')](function(_0x3d21bf){_0x3505cd[_0x3f0e('0x20')]=_0x3d21bf;if(_0x3505cd[_0x3f0e('0xb1')][_0x3f0e('0xb9')]){return db['User'][_0x3f0e('0x4e')]({'attributes':['id',_0x3f0e('0x2d')],'where':{'id':_0x3505cd['interaction'][_0x3f0e('0xb9')]}})[_0x3f0e('0x17')](function(_0x121812){if(_0x121812){_0x3505cd['applications'][_0x3f0e('0xba')]({'id':0x0,'priority':0x0,'app':_0x3f0e('0xbb'),'appdata':_0x121812[_0x3f0e('0x2d')]+','+(_0x3505cd[_0x3f0e('0x9b')][_0x3f0e('0xbc')]||0xa),'interval':_0x3f0e('0xb7')});_0x3505cd[_0x3f0e('0xbd')]=!![];}return respondWithRpcPromise(_0x3f0e('0xbe'),'startRouting',_0x3505cd);});}return respondWithRpcPromise(_0x3f0e('0xbe'),_0x3f0e('0xbf'),_0x3505cd);})[_0x3f0e('0x17')](function(_0x4aac10){respondWithRpcPromise(_0x3f0e('0xc0'),_0x3f0e('0xc0'),{'event':_0x3f0e('0x7f'),'message':_0x4aac10},client9002);return _0x4aac10;})['then'](respondWithResult(_0x3ab285,null))[_0x3f0e('0x21')](handleError(_0x3ab285,null));};exports[_0x3f0e('0xc1')]=function(_0x293b3c,_0x57bd65){var _0x36615f,_0x86b336,_0x3337b3;var _0x1b0d4f=[];var _0x28f190={};var _0x872715=_0x293b3c[_0x3f0e('0xc2')]||[];var _0x27b1f6=[];var _0x16a005;return db[_0x3f0e('0x85')][_0x3f0e('0x59')]()['then'](function(_0x1c3f82){if(!_0x1c3f82){throw new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0x87'));}_0x1b0d4f=_[_0x3f0e('0x88')](_['keys'](_0x1c3f82),[_0x3f0e('0x89'),_0x3f0e('0x8a'),'CompanyId',_0x3f0e('0x9c')]);if(_0x293b3c[_0x3f0e('0x50')]['id']){delete _0x293b3c[_0x3f0e('0x50')]['id'];}if(_['isNil'](_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')])){throw _0x57bd65['status'](0x1f4)[_0x3f0e('0x2e')](new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x3f0e('0x75')](_0x293b3c[_0x3f0e('0x50')]['body'])||_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x50')]===''){throw _0x57bd65[_0x3f0e('0x23')](0x1f4)[_0x3f0e('0x2e')](new db['Sequelize'][(_0x3f0e('0x8d'))](_0x3f0e('0xc3')));}if(_[_0x3f0e('0x75')](_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0xc4')])){throw _0x57bd65[_0x3f0e('0x23')](0x1f4)['send'](new db[(_0x3f0e('0x86'))]['ValidationError'](_0x3f0e('0xc5')+_0x1b0d4f));}if(!_[_0x3f0e('0x90')](_0x1b0d4f,_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0xc4')])){throw _0x57bd65['status'](0x1f4)[_0x3f0e('0x2e')](new db[(_0x3f0e('0x86'))][(_0x3f0e('0x8d'))](_0x3f0e('0xc6')+_0x1b0d4f));}_0x28f190[_0x293b3c[_0x3f0e('0x50')]['mapKeyOffline']]=_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')];})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x293b3c['params']['id']},'include':[{'model':db[_0x3f0e('0x92')],'as':_0x3f0e('0x93')},{'model':db[_0x3f0e('0xc7')],'as':_0x3f0e('0xc7')}]});})['then'](handleEntityNotFound(_0x57bd65,null))[_0x3f0e('0x17')](function(_0x409904){if(_0x409904&&_0x409904['List']){_0x86b336=_0x409904;var _0x811365=_[_0x3f0e('0xc')](_0x293b3c['body'],{'firstName':_0x293b3c['body'][_0x3f0e('0x8c')],'phone':_0x293b3c[_0x3f0e('0x50')]['from'],'ListId':_0x409904[_0x3f0e('0x9c')]});_0x811365[_0x293b3c[_0x3f0e('0x50')]['mapKeyOffline']]=_0x293b3c[_0x3f0e('0x50')][_0x3f0e('0x8c')];return db[_0x3f0e('0x85')][_0x3f0e('0xc8')]({'where':_0x28f190,'defaults':_0x811365});}})[_0x3f0e('0xb2')](function(_0x19054a){if(_0x19054a){_0x3337b3=_0x19054a;var _0x57b432=fs['readFileSync'](path['join'](config[_0x3f0e('0x78')],_0x3f0e('0xc9')),_0x3f0e('0xca'));var _0x5693fa=ejs[_0x3f0e('0xcb')](_0x57b432,{'body':_[_0x3f0e('0xcc')](_0x293b3c[_0x3f0e('0x50')]['body']),'bodyTitle':_0x86b336['offlineMessageBody']});return db[_0x3f0e('0xcd')][_0x3f0e('0x4f')]({'body':_0x5693fa,'plainBody':htmlToText['fromString'](_0x5693fa),'ContactId':_0x19054a['id'],'ChatWebsiteId':_0x86b336['id']});}})[_0x3f0e('0x17')](function(_0x575261){_0x16a005=_0x575261;if(_0x872715[_0x3f0e('0x4b')]){var _0x10aa9d=_0x872715[_0x3f0e('0x32')](function(_0x160b02){return{'name':_0x160b02[_0x3f0e('0xce')],'basename':_0x160b02[_0x3f0e('0x69')],'type':_0x160b02[_0x3f0e('0xcf')],'ChatOfflineMessageId':_0x575261['id']};});_0x27b1f6=_0x10aa9d['map'](_0x558ccf=>{var _0x3757e8={'filename':_0x558ccf['name'],'path':path['join'](config[_0x3f0e('0x78')],_0x3f0e('0xd0'),_0x3f0e('0xc2'),'attachments',_0x3f0e('0xd1'),_0x558ccf[_0x3f0e('0xd2')])};return _0x3757e8;});if(!_0x86b336[_0x3f0e('0xd3')]){return db[_0x3f0e('0xd4')][_0x3f0e('0xd5')](function(_0x3874b5){return db[_0x3f0e('0xd6')][_0x3f0e('0xd7')](_0x10aa9d,{'transaction':_0x3874b5});});}}})[_0x3f0e('0x17')](function(){if(_0x16a005){_0x36615f=_0x16a005;return db[_0x3f0e('0xc7')][_0x3f0e('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0x3f0e('0xd8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x3f0e('0xd9')],'as':_0x3f0e('0xd9'),'raw':!![]}]}]});}})[_0x3f0e('0x17')](function(_0x23428c){if(_0x23428c&&_0x23428c['Smtp']&&_0x86b336[_0x3f0e('0xda')]&&_0x86b336[_0x3f0e('0xdb')]){var _0x4eed42=_0x23428c[_0x3f0e('0xdc')]();return respondWithRpcPromise(_0x3f0e('0xdd'),_0x3f0e('0xde'),{'account':_0x4eed42,'message':{'from':util[_0x3f0e('0xa7')](_0x3f0e('0xdf'),_0x23428c[_0x3f0e('0x2d')],_0x23428c[_0x3f0e('0xe0')]||_0x23428c[_0x3f0e('0xe1')][_0x3f0e('0x51')]),'to':_0x86b336['forwardOfflineAddress'],'subject':_0x86b336[_0x3f0e('0xe2')],'html':_0x36615f[_0x3f0e('0x50')],'attachments':_0x27b1f6}},client9003)[_0x3f0e('0x17')](function(){return _0x36615f;})[_0x3f0e('0x21')](function(_0x33da79){logger[_0x3f0e('0x1d')](_0x33da79);});}})[_0x3f0e('0x17')](function(){if(_0x86b336&&_0x86b336['openNewInteraction']&&_0x86b336['MailAccountId']){var _0x304cf6=[];if(_0x872715[_0x3f0e('0x4b')]){_0x304cf6=_0x872715[_0x3f0e('0x32')](function(_0x582a53){return{'name':_0x582a53[_0x3f0e('0xce')],'basename':_0x582a53['filename'],'type':_0x582a53[_0x3f0e('0xcf')],'ChatOfflineMessageId':_0x16a005['id']};});}var _0x191adb;if(!_[_0x3f0e('0x75')](_0x86b336[_0x3f0e('0xe3')])){var _0x5afd11=_[_0x3f0e('0x32')](_0x293b3c[_0x3f0e('0x50')],function(_0x47ec5e){return _0x47ec5e;});var _0x5386ce=_['toPairsIn'](_0x5afd11)[0x0];var _0x3c2c2d=_[_0x3f0e('0xe4')](_0x5386ce,function(_0x8b301c){return _0x8b301c;});_0x191adb=_0x3c2c2d[0x1][_0x86b336[_0x3f0e('0xe3')]];}var _0x495929={'from':_0x3337b3[_0x3f0e('0xe0')],'firstName':_0x3337b3['firstName'],'lastName':_0x3337b3['lastName'],'mapKey':_0x3f0e('0xe0'),'message':{'from':_0x3337b3[_0x3f0e('0xe0')],'to':_0x86b336[_0x3f0e('0xc7')][_0x3f0e('0xe0')],'cc':'','subject':_[_0x3f0e('0x75')](_0x191adb)?_0x86b336[_0x3f0e('0xe2')]:_0x191adb,'messageId':'','sentAt':new Date(),'attach':_0x304cf6[_0x3f0e('0x4b')],'attachments':_0x304cf6,'originChannel':_0x3f0e('0xe5'),'ChatWebsiteId':_0x86b336['id'],'ChatOfflineMessageId':_0x36615f['id'],'originTo':_0x86b336['MailAccount'][_0x3f0e('0xe0')]},'body':_0x36615f[_0x3f0e('0x50')]};var _0x14084d={'account':{'id':_0x86b336[_0x3f0e('0xe6')]},'body':_0x495929,'log':_0x3f0e('0xe7')};return respondWithRpcPromise(_0x3f0e('0xe7'),_0x3f0e('0xe8'),_0x14084d,client9001)[_0x3f0e('0x17')](function(){return _0x36615f;})[_0x3f0e('0x21')](function(_0x407c00){logger[_0x3f0e('0x1d')](_0x407c00);});}return;})[_0x3f0e('0x17')](function(){if(_0x36615f){return _0x36615f;}})['then'](respondWithResult(_0x57bd65,null))[_0x3f0e('0x21')](function(_0x5b2c34){logger[_0x3f0e('0x1d')](_0x3f0e('0x21'),_0x5b2c34);for(var _0x27e153 of _0x872715){var _0x63cf7d=path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0xd0'),_0x3f0e('0xc2'),_0x3f0e('0xe9'),_0x3f0e('0xd1'),_0x27e153[_0x3f0e('0x69')]);fs_extra[_0x3f0e('0xea')](_0x63cf7d)['catch'](function(_0x1dcf8d){logger['error'](_0x3f0e('0xeb'),_0x63cf7d,_0x1dcf8d);});}});};exports[_0x3f0e('0xec')]=function(_0x453683,_0x53a77f){return db[_0x3f0e('0xaf')][_0x3f0e('0x4e')]({'where':{'id':_0x453683[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x53a77f,null))[_0x3f0e('0x17')](function(_0x2645c8){if(_0x2645c8){return _0x2645c8[_0x3f0e('0xec')](_0x453683[_0x3f0e('0x50')][_0x3f0e('0x61')],_['omit'](_0x453683[_0x3f0e('0x50')],['ids','id'])||{});}})[_0x3f0e('0x17')](respondWithResult(_0x53a77f,null))['catch'](handleError(_0x53a77f,null));};exports[_0x3f0e('0xed')]=function(_0x27895e,_0x68dcec){var _0x5df10c={'raw':![],'where':{}};var _0x381894={};var _0x21fa19={'count':0x0,'rows':[]};return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x27895e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x68dcec,null))['then'](function(_0x383b42){if(_0x383b42){_0x381894[_0x3f0e('0x37')]=_['keys'](db['ChatInteraction'][_0x3f0e('0x34')]);_0x381894[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x27895e['query']);_0x381894['filters']=_['intersection'](_0x381894[_0x3f0e('0x37')],_0x381894['query']);_0x5df10c[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x381894[_0x3f0e('0x37')],qs['fields'](_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x5df10c[_0x3f0e('0x3b')]=_0x5df10c[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x5df10c['attributes']:_0x381894['model'];if(!_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3d')](_0x3f0e('0x3e'))){_0x5df10c[_0x3f0e('0x26')]=qs['limit'](_0x27895e['query'][_0x3f0e('0x26')]);_0x5df10c[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}_0x5df10c['order']=qs['sort'](_0x27895e['query']['sort']);_0x5df10c[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x27895e[_0x3f0e('0x38')],_0x381894[_0x3f0e('0x42')]));_0x5df10c['where'][_0x3f0e('0x5f')]=_0x383b42['id'];if(_0x27895e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x5df10c[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x5df10c[_0x3f0e('0x41')],{'$or':_['map'](_0x5df10c['attributes'],function(_0x2960a5){var _0x509ce4={};_0x509ce4[_0x2960a5]={'$like':'%'+_0x27895e[_0x3f0e('0x38')]['filter']+'%'};return _0x509ce4;})});}_0x5df10c=_['merge']({},_0x5df10c,_0x27895e[_0x3f0e('0x46')]);return db[_0x3f0e('0xaf')][_0x3f0e('0x27')]({'where':_0x5df10c[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x358375){_0x21fa19[_0x3f0e('0x27')]=_0x358375;if(_0x27895e['query'][_0x3f0e('0x4c')]){_0x5df10c[_0x3f0e('0x4d')]=[{'model':db[_0x3f0e('0x85')],'as':_0x3f0e('0xee'),'required':![]},{'model':db['User'],'as':_0x3f0e('0xef'),'attributes':['name',_0x3f0e('0xf0'),_0x3f0e('0xf1')],'required':![]},{'model':db[_0x3f0e('0xf2')],'as':_0x3f0e('0xf3'),'attributes':['id',_0x3f0e('0x2d'),_0x3f0e('0xf4')],'where':_0x27895e[_0x3f0e('0x38')]['tag']?{'id':_0x27895e[_0x3f0e('0x38')][_0x3f0e('0xf5')]}:undefined,'required':_0x27895e[_0x3f0e('0x38')][_0x3f0e('0xf5')]?!![]:![]}];}return db[_0x3f0e('0xaf')][_0x3f0e('0x47')](_0x5df10c);})['then'](function(_0x3042de){_0x21fa19[_0x3f0e('0x48')]=_0x3042de;return _0x21fa19;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x68dcec,_0x5df10c))[_0x3f0e('0x21')](handleError(_0x68dcec,null));};function iftimePromise(_0x1f0b1c,_0x4dae6e){return respondWithRpcPromise(_0x3f0e('0xf6'),_0x3f0e('0xf7'),{'command':_0x4dae6e[_0x3f0e('0xf8')]?util[_0x3f0e('0xa7')]('iftime\x20%s,%s',_0x1f0b1c[_0x3f0e('0xf9')],_0x4dae6e[_0x3f0e('0xf8')]):util[_0x3f0e('0xa7')]('iftime\x20%s',_0x1f0b1c[_0x3f0e('0xf9')])},client9002)[_0x3f0e('0x17')](function(_0x570b4b){var _0x105436=_0x570b4b&&_0x570b4b['indexOf']('true')>=0x0?!![]:![];logger[_0x3f0e('0x18')](_0x3f0e('0xfa'),_0x4dae6e['id'],_0x1f0b1c['id'],_0x1f0b1c[_0x3f0e('0xf9')],_0x105436?_0x3f0e('0xfb'):_0x3f0e('0xfc'),_0x4dae6e[_0x3f0e('0xf8')]?_0x4dae6e[_0x3f0e('0xf8')]:_0x3f0e('0xfd'));return _0x105436;})[_0x3f0e('0x21')](function(_0x2f972c){logger[_0x3f0e('0x1d')](_0x3f0e('0xfa'),_0x4dae6e['id'],_0x1f0b1c['id'],_0x1f0b1c[_0x3f0e('0xf9')],util[_0x3f0e('0xfe')](_0x2f972c,{'showHidden':![],'depth':null}),_0x4dae6e[_0x3f0e('0xf8')]?_0x4dae6e[_0x3f0e('0xf8')]:'No\x20timezone');return![];});}exports[_0x3f0e('0xf7')]=function(_0x39a475,_0x3d4968){var _0x53314b=0x0;var _0x3b44fc=0x0;var _0x4d776c=![];var _0x355c04;var _0x241dba;return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x39a475[_0x3f0e('0x4a')]['id']},'include':[{'model':db[_0x3f0e('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x3f0e('0x100'),'attributes':['id',_0x3f0e('0xf9')],'raw':!![]}]}]})[_0x3f0e('0x17')](handleEntityNotFound(_0x3d4968,null))['then'](function(_0x54e1f4){if(_0x54e1f4){_0x355c04=_0x54e1f4;return _0x54e1f4[_0x3f0e('0x101')]({'raw':!![]});}})[_0x3f0e('0x17')](function(_0xc3c904){if(_0x355c04){if(_0xc3c904){_0x241dba=_0xc3c904;}}return require(_0x3f0e('0x73'))[_0x3f0e('0x102')]();})['then'](function(_0x213cd1){if(_0x213cd1){_0x3b44fc=_0x213cd1['virtual'];_0x4d776c=_0x213cd1['custom'];}})[_0x3f0e('0x17')](function(){return db[_0x3f0e('0xaf')][_0x3f0e('0x27')]({'where':{'closed':![]}});})['then'](function(_0x4e8789){_0x53314b=_0x4e8789;if(_0x3b44fc&&_0x4e8789>_0x3b44fc){return db['License'][_0x3f0e('0x5d')]({'where':{'id':0x1}})[_0x3f0e('0x17')](function(_0xe3aef1){if(_0xe3aef1){_0xe3aef1['increment'](_0x3f0e('0x103'));}});}})['then'](function(){if(_0x355c04[_0x3f0e('0xff')]&&_0x355c04[_0x3f0e('0xff')]['Intervals']){var _0x142c1d=[];for(var _0x244c8d=0x0;_0x244c8d<_0x355c04[_0x3f0e('0xff')][_0x3f0e('0x100')][_0x3f0e('0x4b')];_0x244c8d++){var _0x2a88b3=_0x355c04[_0x3f0e('0xff')][_0x3f0e('0x100')][_0x244c8d]['get']({'plain':!![]});_0x142c1d[_0x3f0e('0xb4')](iftimePromise(_0x2a88b3,_0x355c04));}return BPromise[_0x3f0e('0x104')](_0x142c1d)[_0x3f0e('0x17')](function(_0x34e60c){return _['some'](_0x34e60c);});}else{return!![];}})[_0x3f0e('0x17')](function(_0xfe75ad){var _0x4d2d0b=fs[_0x3f0e('0x105')](path[_0x3f0e('0x71')](config[_0x3f0e('0x78')],_0x3f0e('0x106')),_0x3f0e('0xca'));var _0x48269a={'remote':_0x355c04[_0x3f0e('0x107')],'query':querystring[_0x3f0e('0x1c')](_[_0x3f0e('0x45')](_0x355c04[_0x3f0e('0x53')]({'plain':!![]}),{'customerIp':_0x39a475[_0x3f0e('0x81')][_0x3f0e('0x9f')]||_0x39a475[_0x3f0e('0x81')]['x-real-ip']||_0x39a475['connection'][_0x3f0e('0x108')]||_0x39a475['ip'],'referer':_0x39a475['headers'][_0x3f0e('0xa4')],'openedInteractions':_0x53314b,'maxInteractions':_0x3b44fc,'virtual':_0x4d776c[_0x3f0e('0x109')],'online':_0xfe75ad,'custom':_0x4d776c}))[_0x3f0e('0x10a')](/'/g,'\x5c\x27')};_0x3d4968[_0x3f0e('0x2e')](ejs[_0x3f0e('0xcb')](Mustache[_0x3f0e('0xcb')](_0x4d2d0b,_0x48269a),{'proactiveActions':_0x241dba,'alignment':_0x355c04[_0x3f0e('0x10b')],'verticalAlignment':_0x355c04[_0x3f0e('0x10c')],'div_color':_0x355c04[_0x3f0e('0xf4')],'labelText':_0x355c04[_0x3f0e('0x10d')],'text_color':_0x355c04[_0x3f0e('0x10e')],'text_button_color':_0x355c04[_0x3f0e('0x10f')],'button_color':_0x355c04[_0x3f0e('0x110')],'background_color':_0x355c04[_0x3f0e('0x111')],'hideWhenOffline':_0x355c04[_0x3f0e('0x112')],'interval':_0x355c04[_0x3f0e('0x113')]}));})['catch'](handleError(_0x3d4968,null));};exports[_0x3f0e('0x114')]=function(_0x3a7d13,_0x5b1c42){var _0x66bc46=_0x3a7d13[_0x3f0e('0x4a')]['id'];var _0x34d584=_0x3a7d13[_0x3f0e('0x50')];var _0x3d555f=0xc8;var _0x3827dd=null;return db[_0x3f0e('0xd4')][_0x3f0e('0xd5')]({'isolationLevel':db['sequelize']['Transaction'][_0x3f0e('0x115')][_0x3f0e('0x116')]},function(_0x4e29e7){return db[_0x3f0e('0x33')][_0x3f0e('0x5d')]({'where':{'id':_0x66bc46},'transaction':_0x4e29e7})[_0x3f0e('0x17')](function(_0x1a6dfa){if(_0x1a6dfa){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x66bc46},'transaction':_0x4e29e7})['then'](function(){var _0x2f5515=_['map'](_0x34d584,function(_0xe54bbe){_0xe54bbe[_0x3f0e('0x5f')]=_0x66bc46;return _0xe54bbe;});return db[_0x3f0e('0x96')]['bulkCreate'](_0x2f5515,{'transaction':_0x4e29e7});});}else{_0x3d555f=0x194;_0x3827dd=[];}});})['then'](function(){if(_0x3d555f!==0x194){return db[_0x3f0e('0x96')][_0x3f0e('0x117')]({'where':{'ChatWebsiteId':_0x66bc46},'order':_0x3f0e('0x118')})[_0x3f0e('0x17')](function(_0x5b1cec){_0x3827dd=_0x5b1cec;});}})[_0x3f0e('0x21')](function(_0x1964b4){_0x3d555f=0x1f4;logger['error'](_0x1964b4['stack']);if(_0x1964b4[_0x3f0e('0x2d')]){delete _0x1964b4[_0x3f0e('0x2d')];}_0x3827dd=_0x1964b4;})['finally'](function(){if(_0x3827dd===null){_0x5b1c42['sendStatus'](_0x3d555f);}else{if(_0x3d555f===0x1f4){_0x5b1c42['status'](_0x3d555f)[_0x3f0e('0x2e')](_0x3827dd);}else{_0x5b1c42[_0x3f0e('0x23')](_0x3d555f)[_0x3f0e('0x24')](_0x3827dd);}}});};exports[_0x3f0e('0x119')]=function(_0x49a055,_0x4a1b63){var _0x45e8ae={};var _0x3a8856={};var _0x26016c;var _0x2fd9a5;return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x49a055[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a1b63,null))['then'](function(_0x520ddd){if(_0x520ddd){_0x26016c=_0x520ddd;_0x3a8856['model']=_[_0x3f0e('0x39')](db[_0x3f0e('0x96')][_0x3f0e('0x34')]);_0x3a8856[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x49a055[_0x3f0e('0x38')]);_0x3a8856['filters']=_[_0x3f0e('0x3a')](_0x3a8856[_0x3f0e('0x37')],_0x3a8856[_0x3f0e('0x38')]);_0x45e8ae['attributes']=_[_0x3f0e('0x3a')](_0x3a8856[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x45e8ae[_0x3f0e('0x3b')]=_0x45e8ae[_0x3f0e('0x3b')]['length']?_0x45e8ae[_0x3f0e('0x3b')]:_0x3a8856[_0x3f0e('0x37')];_0x45e8ae['order']=qs[_0x3f0e('0x40')](_0x49a055['query'][_0x3f0e('0x40')]);_0x45e8ae[_0x3f0e('0x41')]=qs['filters'](_[_0x3f0e('0x43')](_0x49a055['query'],_0x3a8856[_0x3f0e('0x42')]));if(_0x49a055[_0x3f0e('0x38')]['filter']){_0x45e8ae[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x45e8ae[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x45e8ae[_0x3f0e('0x3b')],function(_0x222a35){var _0xcc69e2={};_0xcc69e2[_0x222a35]={'$like':'%'+_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0xcc69e2;})});}_0x45e8ae=_[_0x3f0e('0x45')]({},_0x45e8ae,_0x49a055[_0x3f0e('0x46')]);return _0x26016c[_0x3f0e('0x119')](_0x45e8ae);}})[_0x3f0e('0x17')](function(_0x2d842e){if(_0x2d842e){_0x2fd9a5=_0x2d842e['length'];if(!_0x49a055['query'][_0x3f0e('0x3d')]('nolimit')){_0x45e8ae['limit']=qs[_0x3f0e('0x26')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x45e8ae[_0x3f0e('0x3f')]=qs[_0x3f0e('0x3f')](_0x49a055[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}return _0x26016c[_0x3f0e('0x119')](_0x45e8ae);}})[_0x3f0e('0x17')](function(_0x4c563b){if(_0x4c563b){return _0x4c563b?{'count':_0x2fd9a5,'rows':_0x4c563b}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x4a1b63,null))['catch'](handleError(_0x4a1b63,null));};exports[_0x3f0e('0x11a')]=function(_0x3e4d5f,_0x316ccc){return db['chatProactiveAction'][_0x3f0e('0x4e')]({'where':{'id':_0x3e4d5f[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x316ccc,null))[_0x3f0e('0x17')](function(_0x5df4b2){if(_0x5df4b2){return _0x5df4b2[_0x3f0e('0x11a')](_0x3e4d5f[_0x3f0e('0x50')][_0x3f0e('0x61')],_[_0x3f0e('0x11b')](_0x3e4d5f[_0x3f0e('0x50')],[_0x3f0e('0x61'),'id'])||{});}})[_0x3f0e('0x17')](respondWithResult(_0x316ccc,null))[_0x3f0e('0x21')](handleError(_0x316ccc,null));};exports[_0x3f0e('0x101')]=function(_0x3e8b2e,_0x5079ba){var _0x286cc4={};var _0x316002={};var _0x487d4;var _0x46d49b;return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x3e8b2e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x5079ba,null))[_0x3f0e('0x17')](function(_0x35b652){if(_0x35b652){_0x487d4=_0x35b652;_0x316002[_0x3f0e('0x37')]=_[_0x3f0e('0x39')](db[_0x3f0e('0x11c')][_0x3f0e('0x34')]);_0x316002[_0x3f0e('0x38')]=_[_0x3f0e('0x39')](_0x3e8b2e['query']);_0x316002['filters']=_['intersection'](_0x316002[_0x3f0e('0x37')],_0x316002[_0x3f0e('0x38')]);_0x286cc4[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x316002[_0x3f0e('0x37')],qs['fields'](_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x286cc4['attributes']=_0x286cc4[_0x3f0e('0x3b')]['length']?_0x286cc4['attributes']:_0x316002[_0x3f0e('0x37')];_0x286cc4[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x286cc4[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x3e8b2e[_0x3f0e('0x38')],_0x316002[_0x3f0e('0x42')]));if(_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x286cc4[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x286cc4[_0x3f0e('0x41')],{'$or':_[_0x3f0e('0x32')](_0x286cc4[_0x3f0e('0x3b')],function(_0x991f61){var _0xde9d65={};_0xde9d65[_0x991f61]={'$like':'%'+_0x3e8b2e['query']['filter']+'%'};return _0xde9d65;})});}_0x286cc4=_[_0x3f0e('0x45')]({},_0x286cc4,_0x3e8b2e[_0x3f0e('0x46')]);return _0x487d4[_0x3f0e('0x101')](_0x286cc4);}})['then'](function(_0x121546){if(_0x121546){_0x46d49b=_0x121546[_0x3f0e('0x4b')];if(!_0x3e8b2e[_0x3f0e('0x38')][_0x3f0e('0x3d')]('nolimit')){_0x286cc4[_0x3f0e('0x26')]=qs[_0x3f0e('0x26')](_0x3e8b2e['query'][_0x3f0e('0x26')]);_0x286cc4['offset']=qs['offset'](_0x3e8b2e['query']['offset']);}return _0x487d4[_0x3f0e('0x101')](_0x286cc4);}})['then'](function(_0xf1d15){if(_0xf1d15){return _0xf1d15?{'count':_0x46d49b,'rows':_0xf1d15}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x5079ba,null))[_0x3f0e('0x21')](handleError(_0x5079ba,null));};exports['getFields']=function(_0x3dfd42,_0xda697){var _0x286a01=_0x3dfd42[_0x3f0e('0x38')][_0x3f0e('0x11d')]==='false'?_0x3f0e('0x11e'):_0x3f0e('0x11f');return db[_0x3f0e('0x33')]['find']({'attributes':['id',_0x286a01],'where':{'id':_0x3dfd42[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0xda697,null))[_0x3f0e('0x17')](function(_0x40875a){if(_0x40875a){var _0x21d264=_0x40875a[_0x286a01];var _0x1f1cd4=_0x21d264&&_0x21d264[_0x3f0e('0x120')]?_0x21d264[_0x3f0e('0x120')]:[];_0xda697[_0x3f0e('0x2e')]({'fromKey':_['isNil'](_0x21d264['fromKey'])?undefined:_0x21d264[_0x3f0e('0x121')],'count':_0x1f1cd4[_0x3f0e('0x4b')],'rows':_0x1f1cd4});}})[_0x3f0e('0x21')](handleError(_0xda697,null));};exports[_0x3f0e('0x122')]=function(_0x386cf9,_0x220f76){var _0x193e09={'raw':![],'where':{}};var _0x47fe46={};var _0x306d02={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3f0e('0x5d')]({'where':{'id':_0x386cf9[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x220f76,null))[_0x3f0e('0x17')](function(_0x1e57d5){if(_0x1e57d5){_0x47fe46['model']=_[_0x3f0e('0x39')](db['ChatOfflineMessage']['rawAttributes']);_0x47fe46['query']=_[_0x3f0e('0x39')](_0x386cf9[_0x3f0e('0x38')]);_0x47fe46[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x47fe46[_0x3f0e('0x37')],_0x47fe46[_0x3f0e('0x38')]);_0x193e09[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x47fe46[_0x3f0e('0x37')],qs[_0x3f0e('0x3c')](_0x386cf9['query']['fields']));_0x193e09[_0x3f0e('0x3b')]=_0x193e09[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x193e09['attributes']:_0x47fe46['model'];if(!_0x386cf9['query']['hasOwnProperty'](_0x3f0e('0x3e'))){_0x193e09[_0x3f0e('0x26')]=qs['limit'](_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x193e09[_0x3f0e('0x3f')]=qs['offset'](_0x386cf9[_0x3f0e('0x38')]['offset']);}_0x193e09[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x40')]);_0x193e09[_0x3f0e('0x41')]=qs[_0x3f0e('0x42')](_[_0x3f0e('0x43')](_0x386cf9[_0x3f0e('0x38')],_0x47fe46[_0x3f0e('0x42')]));_0x193e09['where'][_0x3f0e('0x5f')]=_0x1e57d5['id'];if(_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x193e09[_0x3f0e('0x41')]=_[_0x3f0e('0x45')](_0x193e09['where'],{'$or':_[_0x3f0e('0x32')](_0x193e09[_0x3f0e('0x3b')],function(_0x24a9cd){var _0x30cfa2={};_0x30cfa2[_0x24a9cd]={'$like':'%'+_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x30cfa2;})});}_0x193e09=_[_0x3f0e('0x45')]({},_0x193e09,_0x386cf9[_0x3f0e('0x46')]);return db[_0x3f0e('0xcd')][_0x3f0e('0x27')]({'where':_0x193e09[_0x3f0e('0x41')]})[_0x3f0e('0x17')](function(_0x4e424e){_0x306d02['count']=_0x4e424e;if(_0x386cf9[_0x3f0e('0x38')][_0x3f0e('0x4c')]){_0x193e09[_0x3f0e('0x4d')]=[{'all':!![]}];}else{_0x193e09['include']=[{'model':db[_0x3f0e('0x85')],'as':'Contact','required':![]},{'model':db[_0x3f0e('0xd6')],'as':_0x3f0e('0x123'),'required':![]}];}return db[_0x3f0e('0xcd')][_0x3f0e('0x47')](_0x193e09);})['then'](function(_0x5e3b02){_0x306d02['rows']=_0x5e3b02;return _0x306d02;});}})[_0x3f0e('0x17')](respondWithFilteredResult(_0x220f76,_0x193e09))[_0x3f0e('0x21')](handleError(_0x220f76,null));};exports['addAgents']=function(_0x20e42d,_0x537ece){return db[_0x3f0e('0x33')][_0x3f0e('0x4e')]({'where':{'id':_0x20e42d[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x537ece,null))[_0x3f0e('0x17')](function(_0x5d6479){if(_0x5d6479){return _0x5d6479[_0x3f0e('0x124')](_0x20e42d['body'][_0x3f0e('0x61')],_[_0x3f0e('0x11b')](_0x20e42d[_0x3f0e('0x50')],[_0x3f0e('0x61'),'id'])||{})[_0x3f0e('0xb2')](function(_0x96f5df){for(var _0x49171b=0x0;_0x49171b<_0x20e42d[_0x3f0e('0x50')][_0x3f0e('0x61')][_0x3f0e('0x4b')];_0x49171b+=0x1){socket[_0x3f0e('0x125')](_0x3f0e('0x126'),{'UserId':Number(_0x20e42d[_0x3f0e('0x50')][_0x3f0e('0x61')][_0x49171b]),'ChatWebsiteId':Number(_0x20e42d[_0x3f0e('0x4a')]['id'])});}return _0x96f5df;});}})[_0x3f0e('0x17')](respondWithResult(_0x537ece,null))[_0x3f0e('0x21')](handleError(_0x537ece,null));};exports[_0x3f0e('0x127')]=function(_0x12e715,_0x4b9bfe){return db[_0x3f0e('0x33')]['find']({'where':{'id':_0x12e715[_0x3f0e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b9bfe,null))[_0x3f0e('0x17')](function(_0x2a7c0d){if(_0x2a7c0d){return _0x2a7c0d[_0x3f0e('0x127')](_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')])['then'](function(){if(_[_0x3f0e('0x128')](_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')])){for(var _0x11de73=0x0;_0x11de73<_0x12e715['query'][_0x3f0e('0x61')]['length'];_0x11de73+=0x1){socket['emit'](_0x3f0e('0x129'),{'UserId':Number(_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')][_0x11de73]),'ChatWebsiteId':Number(_0x12e715[_0x3f0e('0x4a')]['id'])});}}else{socket[_0x3f0e('0x125')](_0x3f0e('0x129'),{'UserId':Number(_0x12e715[_0x3f0e('0x38')][_0x3f0e('0x61')]),'ChatWebsiteId':Number(_0x12e715[_0x3f0e('0x4a')]['id'])});}});}})[_0x3f0e('0x17')](respondWithStatusCode(_0x4b9bfe,null))[_0x3f0e('0x21')](handleError(_0x4b9bfe,null));};exports[_0x3f0e('0x12a')]=function(_0x2eb20e,_0x429564){var _0x4a5f2e={};var _0x340283={};var _0x3e9a3d;var _0x3c2d2e;return db[_0x3f0e('0x33')]['findOne']({'where':{'id':_0x2eb20e[_0x3f0e('0x4a')]['id']}})[_0x3f0e('0x17')](handleEntityNotFound(_0x429564,null))['then'](function(_0x522a76){if(_0x522a76){_0x3e9a3d=_0x522a76;_0x340283[_0x3f0e('0x37')]=_['keys'](db[_0x3f0e('0x12b')][_0x3f0e('0x34')]);_0x340283['query']=_[_0x3f0e('0x39')](_0x2eb20e['query']);_0x340283[_0x3f0e('0x42')]=_[_0x3f0e('0x3a')](_0x340283[_0x3f0e('0x37')],_0x340283[_0x3f0e('0x38')]);_0x4a5f2e[_0x3f0e('0x3b')]=_[_0x3f0e('0x3a')](_0x340283['model'],qs[_0x3f0e('0x3c')](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x3c')]));_0x4a5f2e[_0x3f0e('0x3b')]=_0x4a5f2e[_0x3f0e('0x3b')][_0x3f0e('0x4b')]?_0x4a5f2e['attributes']:_0x340283[_0x3f0e('0x37')];_0x4a5f2e[_0x3f0e('0x5e')]=qs[_0x3f0e('0x40')](_0x2eb20e['query'][_0x3f0e('0x40')]);_0x4a5f2e['where']=qs[_0x3f0e('0x42')](_['pick'](_0x2eb20e['query'],_0x340283[_0x3f0e('0x42')]));if(_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x44')]){_0x4a5f2e[_0x3f0e('0x41')]=_['merge'](_0x4a5f2e[_0x3f0e('0x41')],{'$or':_['map'](_0x4a5f2e[_0x3f0e('0x3b')],function(_0x2eba2f){var _0x83bec9={};_0x83bec9[_0x2eba2f]={'$like':'%'+_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x44')]+'%'};return _0x83bec9;})});}_0x4a5f2e=_['merge']({},_0x4a5f2e,_0x2eb20e['options']);return _0x3e9a3d['getAgents'](_0x4a5f2e);}})[_0x3f0e('0x17')](function(_0x1f86ca){if(_0x1f86ca){_0x3c2d2e=_0x1f86ca[_0x3f0e('0x4b')];if(!_0x2eb20e[_0x3f0e('0x38')]['hasOwnProperty'](_0x3f0e('0x3e'))){_0x4a5f2e['limit']=qs['limit'](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x26')]);_0x4a5f2e['offset']=qs[_0x3f0e('0x3f')](_0x2eb20e[_0x3f0e('0x38')][_0x3f0e('0x3f')]);}return _0x3e9a3d[_0x3f0e('0x12a')](_0x4a5f2e);}})[_0x3f0e('0x17')](function(_0x15088b){if(_0x15088b){return _0x15088b?{'count':_0x3c2d2e,'rows':_0x15088b}:null;}})[_0x3f0e('0x17')](respondWithResult(_0x429564,null))['catch'](handleError(_0x429564,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index be3fc28..91ae522 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 _0x8135=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x230c4d,_0x1d8484){var _0x160dc6=function(_0x26e91d){while(--_0x26e91d){_0x230c4d['push'](_0x230c4d['shift']());}};_0x160dc6(++_0x1d8484);}(_0x8135,0x99));var _0x5813=function(_0x1bbdd0,_0x398e88){_0x1bbdd0=_0x1bbdd0-0x0;var _0x499450=_0x8135[_0x1bbdd0];return _0x499450;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5813('0x0'))['db'][_0x5813('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5813('0x2')](0x0);var events={'afterCreate':_0x5813('0x3'),'afterUpdate':'update','afterDestroy':_0x5813('0x4')};function emitEvent(_0x196ea8){return function(_0xf23c29,_0x701689,_0x1c9b08){ChatWebsiteEvents['emit'](_0x196ea8+':'+_0xf23c29['id'],_0xf23c29);ChatWebsiteEvents['emit'](_0x196ea8,_0xf23c29);_0x1c9b08(null);};}for(var e in events){if(events[_0x5813('0x5')](e)){var event=events[e];ChatWebsite[_0x5813('0x6')](e,emitEvent(event));}}module[_0x5813('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x80ce=['save','remove','emit','hasOwnProperty','hook','exports','setMaxListeners'];(function(_0x5f60b3,_0x3895e0){var _0x4c7b1a=function(_0x43dd2c){while(--_0x43dd2c){_0x5f60b3['push'](_0x5f60b3['shift']());}};_0x4c7b1a(++_0x3895e0);}(_0x80ce,0xae));var _0xe80c=function(_0x3f03f2,_0x240034){_0x3f03f2=_0x3f03f2-0x0;var _0x522dfb=_0x80ce[_0x3f03f2];return _0x522dfb;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe80c('0x0')](0x0);var events={'afterCreate':_0xe80c('0x1'),'afterUpdate':'update','afterDestroy':_0xe80c('0x2')};function emitEvent(_0x3efe49){return function(_0x4372b2,_0x57043c,_0x4cb700){ChatWebsiteEvents['emit'](_0x3efe49+':'+_0x4372b2['id'],_0x4372b2);ChatWebsiteEvents[_0xe80c('0x3')](_0x3efe49,_0x4372b2);_0x4cb700(null);};}for(var e in events){if(events[_0xe80c('0x4')](e)){var event=events[e];ChatWebsite[_0xe80c('0x5')](e,emitEvent(event));}}module[_0xe80c('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 959dd86..2212d37 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 _0xdc2d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x1b159d,_0x12dc44){var _0x206b10=function(_0x2ae333){while(--_0x2ae333){_0x1b159d['push'](_0x1b159d['shift']());}};_0x206b10(++_0x12dc44);}(_0xdc2d,0x75));var _0xddc2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xdc2d[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xddc2('0x0'));var util=require(_0xddc2('0x1'));var logger=require(_0xddc2('0x2'))('api');var moment=require(_0xddc2('0x3'));var BPromise=require(_0xddc2('0x4'));var rp=require(_0xddc2('0x5'));var fs=require('fs');var path=require(_0xddc2('0x6'));var rimraf=require('rimraf');var config=require(_0xddc2('0x7'));var attributes=require(_0xddc2('0x8'));module[_0xddc2('0x9')]=function(_0x4612ea,_0x2675eb){return _0x4612ea[_0xddc2('0xa')](_0xddc2('0xb'),attributes,{'tableName':_0xddc2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ef2=['chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x425f3c,_0x300d00){var _0x4f6fd7=function(_0x38b9a2){while(--_0x38b9a2){_0x425f3c['push'](_0x425f3c['shift']());}};_0x4f6fd7(++_0x300d00);}(_0x1ef2,0x6d));var _0x21ef=function(_0x55dcf1,_0x309b92){_0x55dcf1=_0x55dcf1-0x0;var _0x1d58fd=_0x1ef2[_0x55dcf1];return _0x1d58fd;};'use strict';var _=require(_0x21ef('0x0'));var util=require('util');var logger=require(_0x21ef('0x1'))(_0x21ef('0x2'));var moment=require(_0x21ef('0x3'));var BPromise=require(_0x21ef('0x4'));var rp=require(_0x21ef('0x5'));var fs=require('fs');var path=require(_0x21ef('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x21ef('0x7'));module[_0x21ef('0x8')]=function(_0x5a7ba6,_0x14fc56){return _0x5a7ba6[_0x21ef('0x9')](_0x21ef('0xa'),attributes,{'tableName':_0x21ef('0xb'),'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 084bb6f..76e2915 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 _0x5788=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','info'];(function(_0x129a57,_0x330d03){var _0xa7147c=function(_0x4e6c1f){while(--_0x4e6c1f){_0x129a57['push'](_0x129a57['shift']());}};_0xa7147c(++_0x330d03);}(_0x5788,0x128));var _0x8578=function(_0x429d94,_0x1e6b49){_0x429d94=_0x429d94-0x0;var _0xda6583=_0x5788[_0x429d94];return _0xda6583;};'use strict';var _=require(_0x8578('0x0'));var util=require(_0x8578('0x1'));var moment=require(_0x8578('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8578('0x3'));var db=require(_0x8578('0x4'))['db'];var utils=require(_0x8578('0x5'));var logger=require(_0x8578('0x6'))('rpc');var config=require(_0x8578('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8578('0x8')][_0x8578('0x9')]({'port':0x232a});config[_0x8578('0xa')]=_[_0x8578('0xb')](config[_0x8578('0xa')],{'host':_0x8578('0xc'),'port':0x18eb});var socket=require(_0x8578('0xd'))(new Redis(config[_0x8578('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x250c43,_0x27a30d,_0x18502d){return new BPromise(function(_0x391f9c,_0x170cb6){return client[_0x8578('0xe')](_0x250c43,_0x18502d)['then'](function(_0x1ea54f){logger[_0x8578('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x27a30d,_0x8578('0x10'));logger[_0x8578('0x11')](_0x8578('0x12'),_0x27a30d,_0x8578('0x10'),JSON[_0x8578('0x13')](_0x1ea54f));if(_0x1ea54f['error']){if(_0x1ea54f[_0x8578('0x14')][_0x8578('0x15')]===0x1f4){logger['error'](_0x8578('0x16'),_0x27a30d,_0x1ea54f['error'][_0x8578('0x17')]);return _0x170cb6(_0x1ea54f['error'][_0x8578('0x17')]);}logger[_0x8578('0x14')](_0x8578('0x16'),_0x27a30d,_0x1ea54f['error'][_0x8578('0x17')]);return _0x391f9c(_0x1ea54f[_0x8578('0x14')]['message']);}else{logger['info'](_0x8578('0x16'),_0x27a30d,_0x8578('0x10'));_0x391f9c(_0x1ea54f[_0x8578('0x18')][_0x8578('0x17')]);}})[_0x8578('0x19')](function(_0x3e9d94){logger[_0x8578('0x14')](_0x8578('0x16'),_0x27a30d,_0x3e9d94);_0x170cb6(_0x3e9d94);});});} \ No newline at end of file +var _0x767a=['./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x3c305e,_0x2ac00c){var _0x2c0a93=function(_0x42ae52){while(--_0x42ae52){_0x3c305e['push'](_0x3c305e['shift']());}};_0x2c0a93(++_0x2ac00c);}(_0x767a,0xbb));var _0xa767=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x767a[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xa767('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa767('0x1'));var fs=require('fs');var Redis=require(_0xa767('0x2'));var db=require(_0xa767('0x3'))['db'];var utils=require(_0xa767('0x4'));var logger=require(_0xa767('0x5'))(_0xa767('0x6'));var config=require(_0xa767('0x7'));var jayson=require(_0xa767('0x8'));var client=jayson[_0xa767('0x9')]['http']({'port':0x232a});config[_0xa767('0xa')]=_[_0xa767('0xb')](config[_0xa767('0xa')],{'host':_0xa767('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa767('0xd'))[_0xa767('0xe')](socket);function respondWithRpcPromise(_0x1da083,_0x181151,_0x14def0){return new BPromise(function(_0x4f65ad,_0x7684c1){return client['request'](_0x1da083,_0x14def0)[_0xa767('0xf')](function(_0x457e97){logger[_0xa767('0x10')](_0xa767('0x11'),_0x181151,_0xa767('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x181151,_0xa767('0x12'),JSON[_0xa767('0x13')](_0x457e97));if(_0x457e97[_0xa767('0x14')]){if(_0x457e97[_0xa767('0x14')][_0xa767('0x15')]===0x1f4){logger['error'](_0xa767('0x11'),_0x181151,_0x457e97[_0xa767('0x14')]['message']);return _0x7684c1(_0x457e97['error']['message']);}logger[_0xa767('0x14')](_0xa767('0x11'),_0x181151,_0x457e97[_0xa767('0x14')][_0xa767('0x16')]);return _0x4f65ad(_0x457e97[_0xa767('0x14')][_0xa767('0x16')]);}else{logger[_0xa767('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x181151,_0xa767('0x12'));_0x4f65ad(_0x457e97[_0xa767('0x17')][_0xa767('0x16')]);}})[_0xa767('0x18')](function(_0x3954d8){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x181151,_0x3954d8);_0x7684c1(_0x3954d8);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 6cb28c2..e7aa73d 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 _0x7839=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','emit'];(function(_0x1778a1,_0x50cba4){var _0x1b9222=function(_0x1f49ad){while(--_0x1f49ad){_0x1778a1['push'](_0x1778a1['shift']());}};_0x1b9222(++_0x50cba4);}(_0x7839,0x10c));var _0x9783=function(_0x10ac35,_0x119ac4){_0x10ac35=_0x10ac35-0x0;var _0xeaf4c0=_0x7839[_0x10ac35];return _0xeaf4c0;};'use strict';var ChatWebsiteEvents=require(_0x9783('0x0'));var events=[_0x9783('0x1'),_0x9783('0x2'),'update'];function createListener(_0x281cdb,_0x5b726f){return function(_0x421131){_0x5b726f[_0x9783('0x3')](_0x281cdb,_0x421131);};}function removeListener(_0x147d1f,_0x5db539){return function(){ChatWebsiteEvents[_0x9783('0x4')](_0x147d1f,_0x5db539);};}exports[_0x9783('0x5')]=function(_0x3e0462){for(var _0x13a077=0x0,_0x5092ad=events[_0x9783('0x6')];_0x13a077<_0x5092ad;_0x13a077++){var _0xe3e641=events[_0x13a077];var _0x3526e3=createListener(_0x9783('0x7')+_0xe3e641,_0x3e0462);ChatWebsiteEvents['on'](_0xe3e641,_0x3526e3);}}; \ No newline at end of file +var _0x3ef3=['save','update','emit','length','chatWebsite:','./chatWebsite.events'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0x3ef3,0x14f));var _0x33ef=function(_0x3ceac4,_0xf57186){_0x3ceac4=_0x3ceac4-0x0;var _0x9e4fe8=_0x3ef3[_0x3ceac4];return _0x9e4fe8;};'use strict';var ChatWebsiteEvents=require(_0x33ef('0x0'));var events=[_0x33ef('0x1'),'remove',_0x33ef('0x2')];function createListener(_0x594fae,_0x4d63ab){return function(_0xe844fa){_0x4d63ab[_0x33ef('0x3')](_0x594fae,_0xe844fa);};}function removeListener(_0x4765d1,_0x47bdd2){return function(){ChatWebsiteEvents['removeListener'](_0x4765d1,_0x47bdd2);};}exports['register']=function(_0x3f3c8e){for(var _0x26b78d=0x0,_0x16c37b=events[_0x33ef('0x4')];_0x26b78d<_0x16c37b;_0x26b78d++){var _0x294676=events[_0x26b78d];var _0x242f49=createListener(_0x33ef('0x5')+_0x294676,_0x3f3c8e);ChatWebsiteEvents['on'](_0x294676,_0x242f49);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 3f4d1d7..bd7beb3 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 _0x6a66=['getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','root','server/files/images/logos/','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addAvatar','%s-%s','addCustomerAvatar','notify','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','removeAnswers','removeAgents','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a66,0x1bf));var _0x66a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a66[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x66a6('0x0'));var util=require(_0x66a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x66a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66a6('0x3'));var interaction=require(_0x66a6('0x4'));var config=require(_0x66a6('0x5'));var controller=require('./chatWebsite.controller');router[_0x66a6('0x6')]('/',auth[_0x66a6('0x7')](),controller['index']);router[_0x66a6('0x6')](_0x66a6('0x8'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x9')]);router[_0x66a6('0x6')](_0x66a6('0xa'),auth[_0x66a6('0x7')](),controller['show']);router[_0x66a6('0x6')](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller['getDispositions']);router[_0x66a6('0x6')](_0x66a6('0xc'),auth[_0x66a6('0x7')](),controller['getAnswers']);router['get'](_0x66a6('0xd'),controller[_0x66a6('0xe')]);router[_0x66a6('0x6')]('/:id/avatar',controller[_0x66a6('0xf')]);router[_0x66a6('0x6')](_0x66a6('0x10'),controller[_0x66a6('0x11')]);router[_0x66a6('0x6')](_0x66a6('0x12'),controller['getSystemAvatar']);router[_0x66a6('0x6')](_0x66a6('0x13'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x14')]);router[_0x66a6('0x6')](_0x66a6('0x15'),controller[_0x66a6('0x16')]);router[_0x66a6('0x6')](_0x66a6('0x17'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x18')]);router[_0x66a6('0x6')](_0x66a6('0x19'),auth['isAuthenticated'](),controller[_0x66a6('0x1a')]);router[_0x66a6('0x6')](_0x66a6('0x1b'),controller[_0x66a6('0x1c')]);router['get'](_0x66a6('0x1d'),auth['isAuthenticated'](),controller[_0x66a6('0x1e')]);router[_0x66a6('0x6')](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x20')]);router[_0x66a6('0x21')]('/',auth[_0x66a6('0x7')](),controller[_0x66a6('0x22')]);router['post'](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x23')]);router[_0x66a6('0x21')](_0x66a6('0xc'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30bba2,_0x2181ba,_0x20f4f0){_0x20f4f0(null,path[_0x66a6('0x24')](config[_0x66a6('0x25')],_0x66a6('0x26')));},'filename':function(_0x411fe5,_0x17896e,_0x2f26eb){_0x2f26eb(null,util['format']('%s-%s',Date[_0x66a6('0x27')](),_0x17896e[_0x66a6('0x28')]));}})});router['post'](_0x66a6('0xd'),upload[_0x66a6('0x29')](_0x66a6('0x2a')),controller[_0x66a6('0x2b')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x1df1c5,_0x4a9f0f,_0xc1c500){_0xc1c500(null,path['join'](config[_0x66a6('0x25')],_0x66a6('0x2d')));},'filename':function(_0x3492a4,_0x2eaef4,_0x3a496b){_0x3a496b(null,util[_0x66a6('0x2e')]('%s-%s',Date['now'](),_0x2eaef4[_0x66a6('0x28')]));}})});router['post']('/:id/avatar',upload[_0x66a6('0x29')](_0x66a6('0x2a')),controller[_0x66a6('0x2f')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x3db63c,_0x51deb2,_0x158ddb){_0x158ddb(null,path[_0x66a6('0x24')](config['root'],_0x66a6('0x2d')));},'filename':function(_0x296cdd,_0x54712a,_0x33cf15){_0x33cf15(null,util[_0x66a6('0x2e')](_0x66a6('0x30'),Date[_0x66a6('0x27')](),_0x54712a['originalname']));}})});router['post'](_0x66a6('0x10'),upload['single'](_0x66a6('0x2a')),controller[_0x66a6('0x31')]);var upload=multer({'storage':multer[_0x66a6('0x2c')]({'destination':function(_0x1b8a80,_0x22ee45,_0x316ce9){_0x316ce9(null,path[_0x66a6('0x24')](config[_0x66a6('0x25')],_0x66a6('0x2d')));},'filename':function(_0xb64e93,_0x51dbc2,_0x562ce9){_0x562ce9(null,util['format'](_0x66a6('0x30'),Date[_0x66a6('0x27')](),_0x51dbc2['originalname']));}})});router[_0x66a6('0x21')]('/:id/system_avatar',upload[_0x66a6('0x29')]('file'),controller['addSystemAvatar']);router[_0x66a6('0x21')]('/:id/notify',controller[_0x66a6('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x11badd,_0x40bc6e,_0x9feb3b){const _0x459fb7=path[_0x66a6('0x24')](config[_0x66a6('0x25')],'server/files','attachments',_0x66a6('0x33'));fs_extra[_0x66a6('0x34')](_0x459fb7,function(){_0x9feb3b(null,_0x459fb7);});},'filename':function(_0x3f8800,_0x15f8a9,_0x15d9dd){const _0x2fefa2=_0x15f8a9[_0x66a6('0x28')][_0x66a6('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1346e8=path[_0x66a6('0x36')](_0x2fefa2);const _0x1c07bb=Date[_0x66a6('0x27')]()+'-'+_0x2fefa2[_0x66a6('0x35')](_0x1346e8,'')+_0x1346e8;_0x15d9dd(null,_0x1c07bb);}})});router['post'](_0x66a6('0x37'),offlineUploadMulter[_0x66a6('0x38')](),controller[_0x66a6('0x39')]);router[_0x66a6('0x21')]('/:id/interactions',auth[_0x66a6('0x7')](),controller[_0x66a6('0x3a')]);router[_0x66a6('0x21')](_0x66a6('0x17'),auth['isAuthenticated'](),controller[_0x66a6('0x3b')]);router['post']('/:id/proactive_actions',auth[_0x66a6('0x7')](),controller['addProactiveActions']);router[_0x66a6('0x21')](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x3c')]);router[_0x66a6('0x3d')]('/:id',auth[_0x66a6('0x7')](),controller[_0x66a6('0x3e')]);router[_0x66a6('0x3f')](_0x66a6('0xa'),auth[_0x66a6('0x7')](),controller['destroy']);router[_0x66a6('0x3f')](_0x66a6('0xb'),auth[_0x66a6('0x7')](),controller['removeDispositions']);router[_0x66a6('0x3f')](_0x66a6('0xc'),auth['isAuthenticated'](),controller[_0x66a6('0x40')]);router['delete'](_0x66a6('0x1f'),auth[_0x66a6('0x7')](),controller[_0x66a6('0x41')]);module[_0x66a6('0x42')]=router; \ No newline at end of file +var _0x7ae5=['%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x7ae5,0x193));var _0x57ae=function(_0x24fb96,_0x4d1674){_0x24fb96=_0x24fb96-0x0;var _0x584c04=_0x7ae5[_0x24fb96];return _0x584c04;};'use strict';var multer=require(_0x57ae('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x57ae('0x1'));var router=express[_0x57ae('0x2')]();var fs_extra=require(_0x57ae('0x3'));var auth=require(_0x57ae('0x4'));var interaction=require(_0x57ae('0x5'));var config=require(_0x57ae('0x6'));var controller=require(_0x57ae('0x7'));router[_0x57ae('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x57ae('0x8')](_0x57ae('0x9'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xb')]);router[_0x57ae('0x8')]('/:id',auth[_0x57ae('0xa')](),controller['show']);router[_0x57ae('0x8')](_0x57ae('0xc'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xd')]);router[_0x57ae('0x8')](_0x57ae('0xe'),auth[_0x57ae('0xa')](),controller[_0x57ae('0xf')]);router[_0x57ae('0x8')](_0x57ae('0x10'),controller[_0x57ae('0x11')]);router['get'](_0x57ae('0x12'),controller[_0x57ae('0x13')]);router[_0x57ae('0x8')]('/:id/customer_avatar',controller[_0x57ae('0x14')]);router[_0x57ae('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x57ae('0x8')](_0x57ae('0x15'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x16')]);router[_0x57ae('0x8')](_0x57ae('0x17'),controller[_0x57ae('0x18')]);router[_0x57ae('0x8')](_0x57ae('0x19'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x1a')]);router['get'](_0x57ae('0x1b'),auth[_0x57ae('0xa')](),controller['getProactiveActions']);router[_0x57ae('0x8')](_0x57ae('0x1c'),controller['getFields']);router[_0x57ae('0x8')](_0x57ae('0x1d'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x1e')]);router['get'](_0x57ae('0x1f'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x20')]);router[_0x57ae('0x21')]('/',auth[_0x57ae('0xa')](),controller[_0x57ae('0x22')]);router[_0x57ae('0x21')](_0x57ae('0xc'),auth['isAuthenticated'](),controller[_0x57ae('0x23')]);router['post'](_0x57ae('0xe'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2de4b5,_0xb9e093,_0x561aff){_0x561aff(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x27')));},'filename':function(_0x242998,_0x58ae5f,_0x9a6eeb){_0x9a6eeb(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x58ae5f[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x10'),upload[_0x57ae('0x2c')](_0x57ae('0x2d')),controller[_0x57ae('0x2e')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x307517,_0x45bec6,_0x3ede19){_0x3ede19(null,path[_0x57ae('0x25')](config['root'],_0x57ae('0x30')));},'filename':function(_0x11ac60,_0x515c17,_0x30fdeb){_0x30fdeb(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x515c17[_0x57ae('0x2b')]));}})});router['post'](_0x57ae('0x12'),upload[_0x57ae('0x2c')]('file'),controller[_0x57ae('0x31')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x5a7921,_0x10e595,_0x4e2f60){_0x4e2f60(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x30')));},'filename':function(_0x1137fa,_0x10a643,_0x17eed2){_0x17eed2(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date['now'](),_0x10a643[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x32'),upload['single'](_0x57ae('0x2d')),controller[_0x57ae('0x33')]);var upload=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x559fe9,_0x293679,_0x2c8afa){_0x2c8afa(null,path[_0x57ae('0x25')](config[_0x57ae('0x26')],_0x57ae('0x30')));},'filename':function(_0x15f4aa,_0x227bc9,_0x149e28){_0x149e28(null,util[_0x57ae('0x28')](_0x57ae('0x29'),Date[_0x57ae('0x2a')](),_0x227bc9[_0x57ae('0x2b')]));}})});router[_0x57ae('0x21')](_0x57ae('0x34'),upload['single'](_0x57ae('0x2d')),controller[_0x57ae('0x35')]);router[_0x57ae('0x21')](_0x57ae('0x36'),controller[_0x57ae('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x57ae('0x2f')]({'destination':function(_0x350af0,_0x1b854a,_0xb9537a){const _0x52a3ff=path['join'](config['root'],_0x57ae('0x38'),_0x57ae('0x39'),'offline-chat');fs_extra[_0x57ae('0x3a')](_0x52a3ff,function(){_0xb9537a(null,_0x52a3ff);});},'filename':function(_0x5d1444,_0x53fa4e,_0x5e6dde){const _0x39ed84=_0x53fa4e['originalname'][_0x57ae('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x400e6d=path['extname'](_0x39ed84);const _0x18b24c=Date[_0x57ae('0x2a')]()+'-'+_0x39ed84[_0x57ae('0x3b')](_0x400e6d,'')+_0x400e6d;_0x5e6dde(null,_0x18b24c);}})});router[_0x57ae('0x21')](_0x57ae('0x3c'),offlineUploadMulter[_0x57ae('0x3d')](),controller[_0x57ae('0x3e')]);router[_0x57ae('0x21')](_0x57ae('0x15'),auth[_0x57ae('0xa')](),controller[_0x57ae('0x3f')]);router['post']('/:id/applications',auth[_0x57ae('0xa')](),controller[_0x57ae('0x40')]);router[_0x57ae('0x21')]('/:id/proactive_actions',auth[_0x57ae('0xa')](),controller[_0x57ae('0x41')]);router[_0x57ae('0x21')]('/:id/users',auth[_0x57ae('0xa')](),controller['addAgents']);router[_0x57ae('0x42')](_0x57ae('0x43'),auth[_0x57ae('0xa')](),controller['update']);router[_0x57ae('0x44')]('/:id',auth[_0x57ae('0xa')](),controller[_0x57ae('0x45')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x57ae('0x46')]);router['delete'](_0x57ae('0xe'),auth['isAuthenticated'](),controller[_0x57ae('0x47')]);router[_0x57ae('0x44')]('/:id/users',auth['isAuthenticated'](),controller[_0x57ae('0x48')]);module[_0x57ae('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index e66ab9d..1b5ccce 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4bf=['../components/auth/service','../config/environment','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express'];(function(_0x13193c,_0x3d5713){var _0x3d25ea=function(_0x25747d){while(--_0x25747d){_0x13193c['push'](_0x13193c['shift']());}};_0x3d25ea(++_0x3d5713);}(_0xa4bf,0xa7));var _0xfa4b=function(_0xff7c05,_0x2456ca){_0xff7c05=_0xff7c05-0x0;var _0x1c1ab9=_0xa4bf[_0xff7c05];return _0x1c1ab9;};var beaverLogger=require(_0xfa4b('0x0'));var express=require(_0xfa4b('0x1'));var auth=require(_0xfa4b('0x2'));var config=require(_0xfa4b('0x3'));var router=express[_0xfa4b('0x4')]();var isProduction=config[_0xfa4b('0x5')]==='production'||![];function clientSideLogs(_0x6f1e31,_0x2c7fd6,_0x154c9c){var _0xc962c5=_0x6f1e31['app'][_0xfa4b('0x6')](_0xfa4b('0x7'));if(!_0xc962c5){throw new Error(_0xfa4b('0x8'));}return beaverLogger[_0xfa4b('0x9')]({'uri':_0xfa4b('0xa'),'logger':_0xc962c5,'enableCors':!isProduction})(_0x6f1e31,_0x2c7fd6,_0x154c9c);}router[_0xfa4b('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0xfa4b('0xc')]=router; \ No newline at end of file +var _0x92bc=['Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../config/environment'];(function(_0x4d3ccc,_0x295480){var _0x5b65a3=function(_0x856637){while(--_0x856637){_0x4d3ccc['push'](_0x4d3ccc['shift']());}};_0x5b65a3(++_0x295480);}(_0x92bc,0x1a2));var _0xc92b=function(_0x5a348d,_0x2e7e92){_0x5a348d=_0x5a348d-0x0;var _0x1121be=_0x92bc[_0x5a348d];return _0x1121be;};var beaverLogger=require('beaver-logger/server');var express=require(_0xc92b('0x0'));var auth=require('../components/auth/service');var config=require(_0xc92b('0x1'));var router=express[_0xc92b('0x2')]();var isProduction=config[_0xc92b('0x3')]===_0xc92b('0x4')||![];function clientSideLogs(_0x5e3d14,_0x30793c,_0x337c84){var _0x12a76f=_0x5e3d14[_0xc92b('0x5')][_0xc92b('0x6')](_0xc92b('0x7'));if(!_0x12a76f){throw new Error(_0xc92b('0x8'));}return beaverLogger[_0xc92b('0x9')]({'uri':'/client-logs','logger':_0x12a76f,'enableCors':!isProduction})(_0x5e3d14,_0x30793c,_0x337c84);}router[_0xc92b('0xa')](auth[_0xc92b('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 8b09d05..86f3992 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 _0x3f0d=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x3a9ed8,_0x35eb1d){var _0x5390c9=function(_0x16e0ec){while(--_0x16e0ec){_0x3a9ed8['push'](_0x3a9ed8['shift']());}};_0x5390c9(++_0x35eb1d);}(_0x3f0d,0x1ab));var _0xd3f0=function(_0x5ea317,_0x22d2a8){_0x5ea317=_0x5ea317-0x0;var _0x53b81c=_0x3f0d[_0x5ea317];return _0x53b81c;};'use strict';var Sequelize=require(_0xd3f0('0x0'));module[_0xd3f0('0x1')]={'name':{'type':Sequelize[_0xd3f0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd3f0('0x3')](_0xd3f0('0x4'),'Google',_0xd3f0('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd3f0('0x3')](_0xd3f0('0x6'),_0xd3f0('0x7'))},'data1':{'type':Sequelize[_0xd3f0('0x2')],'comment':_0xd3f0('0x8')},'data2':{'type':Sequelize[_0xd3f0('0x2')],'comment':_0xd3f0('0x9')},'data3':{'type':Sequelize[_0xd3f0('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0xd3f0('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd3f0('0xb')},'data6':{'type':Sequelize[_0xd3f0('0xc')],'comment':_0xd3f0('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0xd3f0('0xe')}}; \ No newline at end of file +var _0x1a3d=['MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x2c8dde,_0x330674){var _0x3712a8=function(_0x9c781b){while(--_0x9c781b){_0x2c8dde['push'](_0x2c8dde['shift']());}};_0x3712a8(++_0x330674);}(_0x1a3d,0x1dc));var _0xd1a3=function(_0x27db8c,_0x21ff04){_0x27db8c=_0x27db8c-0x0;var _0x45f758=_0x1a3d[_0x27db8c];return _0x45f758;};'use strict';var Sequelize=require(_0xd1a3('0x0'));module[_0xd1a3('0x1')]={'name':{'type':Sequelize[_0xd1a3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd1a3('0x3')](_0xd1a3('0x4'),'Google',_0xd1a3('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xd1a3('0x6'))},'data1':{'type':Sequelize[_0xd1a3('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xd1a3('0x2')],'comment':_0xd1a3('0x7')},'data3':{'type':Sequelize[_0xd1a3('0x2')],'comment':_0xd1a3('0x8')},'data4':{'type':Sequelize[_0xd1a3('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xd1a3('0x9')],'comment':_0xd1a3('0xa')},'data6':{'type':Sequelize[_0xd1a3('0x9')],'comment':_0xd1a3('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xd1a3('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 0fcb692..6807a21 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 _0x5fb6=['Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','stack','send','padEnd','slice','index','CloudProvider','rawAttributes','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','length','includeAll','options','find','service','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','includes','join','encryptString','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:error','error'];(function(_0x14cdce,_0x3bd691){var _0x522ec6=function(_0x4c985e){while(--_0x4c985e){_0x14cdce['push'](_0x14cdce['shift']());}};_0x522ec6(++_0x3bd691);}(_0x5fb6,0x65));var _0x65fb=function(_0x4912b0,_0x3c99dc){_0x4912b0=_0x4912b0-0x0;var _0x487685=_0x5fb6[_0x4912b0];return _0x487685;};'use strict';var _=require(_0x65fb('0x0'));var Redis=require(_0x65fb('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x65fb('0x2'));var logger=require(_0x65fb('0x3'))(_0x65fb('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x65fb('0x5'));config['redis']=_['defaults'](config[_0x65fb('0x6')],{'host':_0x65fb('0x7'),'port':0x18eb});var socket=require(_0x65fb('0x8'))(new Redis(config[_0x65fb('0x6')]));var redis=new Redis(config[_0x65fb('0x6')]);function respondWithStatusCode(_0x2f2d96,_0x528e4c){_0x528e4c=_0x528e4c||0xcc;return function(_0x5c7d71){if(_0x5c7d71){return _0x2f2d96[_0x65fb('0x9')](_0x528e4c);}return _0x2f2d96[_0x65fb('0xa')](_0x528e4c)['end']();};}function respondWithResult(_0x61ef9b,_0x30222a){_0x30222a=_0x30222a||0xc8;return function(_0x4dd877){if(_0x4dd877){return _0x61ef9b[_0x65fb('0xa')](_0x30222a)[_0x65fb('0xb')](_0x4dd877);}};}function respondWithFilteredResult(_0x1b34f6,_0x1e4401){return function(_0x2507c4){if(_0x2507c4){var _0x11d5a5=typeof _0x1e4401['offset']===_0x65fb('0xc')&&typeof _0x1e4401[_0x65fb('0xd')]===_0x65fb('0xc');var _0x1b0294=_0x2507c4[_0x65fb('0xe')];var _0x532005=_0x11d5a5?0x0:_0x1e4401[_0x65fb('0xf')];var _0x1a0f2d=_0x11d5a5?_0x2507c4[_0x65fb('0xe')]:_0x1e4401[_0x65fb('0xf')]+_0x1e4401['limit'];var _0x155482;if(_0x1a0f2d>=_0x1b0294){_0x1a0f2d=_0x1b0294;_0x155482=0xc8;}else{_0x155482=0xce;}_0x1b34f6['status'](_0x155482);return _0x1b34f6[_0x65fb('0x10')](_0x65fb('0x11'),_0x532005+'-'+_0x1a0f2d+'/'+_0x1b0294)[_0x65fb('0xb')](_0x2507c4);}return null;};}function saveUpdates(_0x2fa044){return function(_0x1122ea){if(_0x1122ea){return _0x1122ea[_0x65fb('0x12')](_0x2fa044)[_0x65fb('0x13')](function(_0x5af2e0){return _0x5af2e0;});}return null;};}function removeEntity(_0x1d7b2b){return function(_0x31dc30){if(_0x31dc30){return _0x31dc30['destroy']()[_0x65fb('0x13')](function(){_0x1d7b2b[_0x65fb('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x845217){return function(_0x1f0165){if(!_0x1f0165){_0x845217[_0x65fb('0x9')](0x194);}return _0x1f0165;};}function handleError(_0x39eea7,_0x1a24fd){_0x1a24fd=_0x1a24fd||0x1f4;return function(_0xcdd71e){logger['error'](_0xcdd71e[_0x65fb('0x14')]);if(_0xcdd71e['name']){delete _0xcdd71e['name'];}_0x39eea7[_0x65fb('0xa')](_0x1a24fd)[_0x65fb('0x15')](_0xcdd71e);};}function maskClientSecret(_0x4152ee){return _[_0x65fb('0x16')](_0x4152ee[_0x65fb('0x17')](0x0,0x3),0x14,'*');}exports[_0x65fb('0x18')]=function(_0x2b27dd,_0x2774ff){var _0x878e7d={},_0x58d1ea={},_0x325035={'count':0x0,'rows':[]};var _0x40924d=_['map'](db[_0x65fb('0x19')][_0x65fb('0x1a')],function(_0x3d8e23){return{'name':_0x3d8e23['fieldName'],'type':_0x3d8e23[_0x65fb('0x1b')][_0x65fb('0x1c')]};});_0x58d1ea[_0x65fb('0x1d')]=_[_0x65fb('0x1e')](_0x40924d,_0x65fb('0x1f'));_0x58d1ea[_0x65fb('0x20')]=_[_0x65fb('0x21')](_0x2b27dd[_0x65fb('0x20')]);_0x58d1ea['filters']=_[_0x65fb('0x22')](_0x58d1ea[_0x65fb('0x1d')],_0x58d1ea[_0x65fb('0x20')]);_0x878e7d[_0x65fb('0x23')]=_['intersection'](_0x58d1ea['model'],qs[_0x65fb('0x24')](_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x24')]));_0x878e7d[_0x65fb('0x23')]=_0x878e7d[_0x65fb('0x23')]['length']?_0x878e7d[_0x65fb('0x23')]:_0x58d1ea[_0x65fb('0x1d')];if(!_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x25')](_0x65fb('0x26'))){_0x878e7d['limit']=qs[_0x65fb('0xd')](_0x2b27dd[_0x65fb('0x20')][_0x65fb('0xd')]);_0x878e7d[_0x65fb('0xf')]=qs[_0x65fb('0xf')](_0x2b27dd[_0x65fb('0x20')]['offset']);}_0x878e7d[_0x65fb('0x27')]=qs['sort'](_0x2b27dd['query'][_0x65fb('0x28')]);_0x878e7d[_0x65fb('0x29')]=qs[_0x65fb('0x2a')](_[_0x65fb('0x2b')](_0x2b27dd[_0x65fb('0x20')],_0x58d1ea[_0x65fb('0x2a')]),_0x40924d);if(_0x2b27dd[_0x65fb('0x20')]['filter']){_0x878e7d[_0x65fb('0x29')]=_[_0x65fb('0x2c')](_0x878e7d[_0x65fb('0x29')],{'$or':_['map'](_0x40924d,function(_0x2be80b){if(_0x2be80b[_0x65fb('0x1b')]!==_0x65fb('0x2d')){var _0x1f6344={};_0x1f6344[_0x2be80b['name']]={'$like':'%'+_0x2b27dd[_0x65fb('0x20')][_0x65fb('0x2e')]+'%'};return _0x1f6344;}})});}_0x878e7d=_['merge']({},_0x878e7d,_0x2b27dd['options']);var _0x3302ff={'where':_0x878e7d[_0x65fb('0x29')]};return db[_0x65fb('0x19')][_0x65fb('0xe')](_0x3302ff)['then'](function(_0x18b347){_0x325035[_0x65fb('0xe')]=_0x18b347;if(_0x2b27dd[_0x65fb('0x20')]['includeAll']){_0x878e7d[_0x65fb('0x2f')]=[{'all':!![]}];}return db[_0x65fb('0x19')][_0x65fb('0x30')](_0x878e7d);})[_0x65fb('0x13')](function(_0x106d04){_0x325035[_0x65fb('0x31')]=_[_0x65fb('0x1e')](_0x106d04,function(_0x4f7bce){if(_0x4f7bce['service']===_0x65fb('0x32')){var _0x5c9d63=encryptor[_0x65fb('0x33')](_0x4f7bce[_0x65fb('0x34')]);_0x4f7bce[_0x65fb('0x34')]=maskClientSecret(_0x5c9d63);}return _0x4f7bce;});return _0x325035;})['then'](respondWithFilteredResult(_0x2774ff,_0x878e7d))[_0x65fb('0x35')](handleError(_0x2774ff,null));};exports[_0x65fb('0x36')]=function(_0x36a295,_0x2f6d3a){var _0x288737={'raw':!![],'where':{'id':_0x36a295[_0x65fb('0x37')]['id']}},_0x50a3a2={};_0x50a3a2[_0x65fb('0x1d')]=_[_0x65fb('0x21')](db[_0x65fb('0x19')]['rawAttributes']);_0x50a3a2[_0x65fb('0x20')]=_['keys'](_0x36a295[_0x65fb('0x20')]);_0x50a3a2[_0x65fb('0x2a')]=_[_0x65fb('0x22')](_0x50a3a2[_0x65fb('0x1d')],_0x50a3a2[_0x65fb('0x20')]);_0x288737[_0x65fb('0x23')]=_['intersection'](_0x50a3a2['model'],qs[_0x65fb('0x24')](_0x36a295['query'][_0x65fb('0x24')]));_0x288737[_0x65fb('0x23')]=_0x288737[_0x65fb('0x23')][_0x65fb('0x38')]?_0x288737['attributes']:_0x50a3a2[_0x65fb('0x1d')];if(_0x36a295[_0x65fb('0x20')][_0x65fb('0x39')]){_0x288737[_0x65fb('0x2f')]=[{'all':!![]}];}_0x288737=_[_0x65fb('0x2c')]({},_0x288737,_0x36a295[_0x65fb('0x3a')]);return db[_0x65fb('0x19')][_0x65fb('0x3b')](_0x288737)['then'](handleEntityNotFound(_0x2f6d3a,null))[_0x65fb('0x13')](function(_0x19088f){if(_0x19088f[_0x65fb('0x3c')]==='MicrosoftAzure'){var _0x3e203e=encryptor[_0x65fb('0x33')](_0x19088f[_0x65fb('0x34')]);_0x19088f['data3']=maskClientSecret(_0x3e203e);}return _0x19088f;})['then'](respondWithResult(_0x2f6d3a,null))[_0x65fb('0x35')](handleError(_0x2f6d3a,null));};exports[_0x65fb('0x3d')]=function(_0x1d8271,_0x235735){if(!_0x1d8271['body'][_0x65fb('0x1f')])throw new Error(_0x65fb('0x3e'));if(!_0x1d8271[_0x65fb('0x3f')][_0x65fb('0x3c')])throw new Error(_0x65fb('0x40'));var _0x2ec3aa=db[_0x65fb('0x19')]['rawAttributes'][_0x65fb('0x3c')]['values'];if(!_0x2ec3aa[_0x65fb('0x41')](_0x1d8271['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2ec3aa[_0x65fb('0x42')](',\x20'));if(_0x1d8271['body'][_0x65fb('0x3c')]===_0x65fb('0x32')&&_0x1d8271[_0x65fb('0x3f')]['data3']){_0x1d8271[_0x65fb('0x3f')][_0x65fb('0x34')]=encryptor[_0x65fb('0x43')](_0x1d8271[_0x65fb('0x3f')]['data3']);}return db[_0x65fb('0x19')]['create'](_0x1d8271[_0x65fb('0x3f')],{})[_0x65fb('0x13')](respondWithResult(_0x235735,0xc9))[_0x65fb('0x35')](handleError(_0x235735,null));};exports['update']=function(_0x881787,_0x285b96){if(_0x881787['body']['id']){delete _0x881787[_0x65fb('0x3f')]['id'];}return db[_0x65fb('0x19')]['find']({'where':{'id':_0x881787[_0x65fb('0x37')]['id']}})['then'](handleEntityNotFound(_0x285b96,null))[_0x65fb('0x13')](function(_0x32384c){if(_0x32384c[_0x65fb('0x3c')]===_0x65fb('0x32')&&_0x881787[_0x65fb('0x3f')][_0x65fb('0x34')]){_0x881787['body']['data3']=encryptor[_0x65fb('0x43')](_0x881787[_0x65fb('0x3f')]['data3']);}return _0x32384c;})[_0x65fb('0x13')](saveUpdates(_0x881787['body'],null))['then'](respondWithResult(_0x285b96,null))['catch'](handleError(_0x285b96,null));};exports[_0x65fb('0x44')]=function(_0x31437e,_0x108191){return db[_0x65fb('0x19')][_0x65fb('0x3b')]({'where':{'id':_0x31437e[_0x65fb('0x37')]['id']}})[_0x65fb('0x13')](handleEntityNotFound(_0x108191,null))[_0x65fb('0x13')](removeEntity(_0x108191,null))['catch'](handleError(_0x108191,null));};exports[_0x65fb('0x45')]=function(_0x1f1620,_0x3cb165){return db['CloudProvider']['findOne']({'where':{'id':_0x1f1620['params']['id']},'raw':!![]})[_0x65fb('0x13')](function(_0x2c7727){if(!_0x2c7727)return _0x3cb165[_0x65fb('0x9')](0x194);return{'url':oauth[_0x65fb('0x46')](_0x2c7727,_0x1f1620[_0x65fb('0x47')]['id'])};})[_0x65fb('0x13')](respondWithResult(_0x3cb165,null))[_0x65fb('0x35')](handleError(_0x3cb165,null));};exports[_0x65fb('0x48')]=function(_0xbfffd3,_0x48b61f){var _0x321393=_0xbfffd3[_0x65fb('0x3f')];var _0x467b68;var _0x2d557c;if(_0x321393['error'])throw _0x321393;redis[_0x65fb('0x49')](_0x321393[_0x65fb('0x4a')])[_0x65fb('0x13')](function(_0x597e3d){if(!_0x597e3d)throw new Error(_0x65fb('0x4b'));_0x467b68=JSON[_0x65fb('0x4c')](_0x597e3d);var _0x2fc493=Buffer[_0x65fb('0x4d')](_0x321393[_0x65fb('0x4a')],_0x65fb('0x4e'))[_0x65fb('0x4f')]('ascii');_0x2d557c=JSON[_0x65fb('0x4c')](_0x2fc493);if(!oauth['isValidIdToken'](_0x321393['id_token'],_0x467b68[_0x65fb('0x50')]))throw new Error(_0x65fb('0x51'));redis[_0x65fb('0x52')](_0x321393[_0x65fb('0x4a')]);return oauth[_0x65fb('0x53')](_0x321393[_0x65fb('0x54')],_0x467b68);})[_0x65fb('0x13')](function(_0x519199){_0x467b68['data5']=_0x519199[_0x65fb('0x55')];_0x467b68[_0x65fb('0x56')]=_0x519199[_0x65fb('0x57')];return db['CloudProvider'][_0x65fb('0x12')]({'data5':_0x467b68[_0x65fb('0x58')],'data6':_0x467b68[_0x65fb('0x56')]},{'where':{'id':_0x467b68['id']}});})[_0x65fb('0x13')](function(){oauth[_0x65fb('0x59')](_0x467b68);socket[_0x65fb('0x5a')]('microsoftAuthorization:success',{'id':_0x2d557c['id']});return;})[_0x65fb('0x13')](respondWithStatusCode(_0x48b61f,null))[_0x65fb('0x35')](function(_0x2d5e4e){if(_0x2d557c){socket[_0x65fb('0x5a')](_0x65fb('0x5b'),{'id':_0x2d557c['id']});}if(!_0x467b68){logger[_0x65fb('0x5c')](_0x65fb('0x5d'),_0x2d5e4e);return _0x48b61f[_0x65fb('0xa')](0x1f4)[_0x65fb('0x15')](_0x2d5e4e[_0x65fb('0x5e')]);}logger['error'](_0x65fb('0x5f'),_0x467b68['id'],JSON[_0x65fb('0x60')](_0x2d5e4e));});}; \ No newline at end of file +var _0x610f=['limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','slice','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','params','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','create','destroy','oauth2MicrosoftAuthorize','findOne','user','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','send','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined'];(function(_0x39c2b1,_0x59decc){var _0x409fb7=function(_0x38d261){while(--_0x38d261){_0x39c2b1['push'](_0x39c2b1['shift']());}};_0x409fb7(++_0x59decc);}(_0x610f,0x168));var _0xf610=function(_0x20582f,_0x112fd2){_0x20582f=_0x20582f-0x0;var _0x1b64c1=_0x610f[_0x20582f];return _0x1b64c1;};'use strict';var _=require('lodash');var Redis=require(_0xf610('0x0'));var qs=require(_0xf610('0x1'));var encryptor=require(_0xf610('0x2'));var config=require(_0xf610('0x3'));var logger=require(_0xf610('0x4'))(_0xf610('0x5'));var db=require(_0xf610('0x6'))['db'];var oauth=require(_0xf610('0x7'));config[_0xf610('0x8')]=_[_0xf610('0x9')](config['redis'],{'host':_0xf610('0xa'),'port':0x18eb});var socket=require(_0xf610('0xb'))(new Redis(config[_0xf610('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3dd74e,_0x3062c1){_0x3062c1=_0x3062c1||0xcc;return function(_0x361baa){if(_0x361baa){return _0x3dd74e['sendStatus'](_0x3062c1);}return _0x3dd74e[_0xf610('0xc')](_0x3062c1)['end']();};}function respondWithResult(_0x1d1c51,_0x596040){_0x596040=_0x596040||0xc8;return function(_0x4d1b8a){if(_0x4d1b8a){return _0x1d1c51[_0xf610('0xc')](_0x596040)[_0xf610('0xd')](_0x4d1b8a);}};}function respondWithFilteredResult(_0xbfc539,_0x27a0c9){return function(_0x3c04ff){if(_0x3c04ff){var _0x4effbc=typeof _0x27a0c9[_0xf610('0xe')]===_0xf610('0xf')&&typeof _0x27a0c9[_0xf610('0x10')]===_0xf610('0xf');var _0x2d95b3=_0x3c04ff[_0xf610('0x11')];var _0x239c62=_0x4effbc?0x0:_0x27a0c9[_0xf610('0xe')];var _0x3bf63e=_0x4effbc?_0x3c04ff[_0xf610('0x11')]:_0x27a0c9[_0xf610('0xe')]+_0x27a0c9['limit'];var _0x1e3d4a;if(_0x3bf63e>=_0x2d95b3){_0x3bf63e=_0x2d95b3;_0x1e3d4a=0xc8;}else{_0x1e3d4a=0xce;}_0xbfc539['status'](_0x1e3d4a);return _0xbfc539[_0xf610('0x12')](_0xf610('0x13'),_0x239c62+'-'+_0x3bf63e+'/'+_0x2d95b3)[_0xf610('0xd')](_0x3c04ff);}return null;};}function saveUpdates(_0x21cb3c){return function(_0x242d76){if(_0x242d76){return _0x242d76[_0xf610('0x14')](_0x21cb3c)['then'](function(_0x5ea722){return _0x5ea722;});}return null;};}function removeEntity(_0x35a780){return function(_0x333abf){if(_0x333abf){return _0x333abf['destroy']()[_0xf610('0x15')](function(){_0x35a780['status'](0xcc)[_0xf610('0x16')]();});}};}function handleEntityNotFound(_0x44f29c){return function(_0x558be4){if(!_0x558be4){_0x44f29c[_0xf610('0x17')](0x194);}return _0x558be4;};}function handleError(_0x1fd5c4,_0x59f90f){_0x59f90f=_0x59f90f||0x1f4;return function(_0x491587){logger[_0xf610('0x18')](_0x491587[_0xf610('0x19')]);if(_0x491587[_0xf610('0x1a')]){delete _0x491587['name'];}_0x1fd5c4[_0xf610('0xc')](_0x59f90f)['send'](_0x491587);};}function maskClientSecret(_0x1a55df){return _['padEnd'](_0x1a55df[_0xf610('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3e49cf,_0x3a9f60){var _0x5280b5={},_0x983f0={},_0xdc9b0d={'count':0x0,'rows':[]};var _0x11d870=_[_0xf610('0x1c')](db[_0xf610('0x1d')][_0xf610('0x1e')],function(_0x4d617b){return{'name':_0x4d617b[_0xf610('0x1f')],'type':_0x4d617b[_0xf610('0x20')][_0xf610('0x21')]};});_0x983f0[_0xf610('0x22')]=_[_0xf610('0x1c')](_0x11d870,_0xf610('0x1a'));_0x983f0['query']=_[_0xf610('0x23')](_0x3e49cf[_0xf610('0x24')]);_0x983f0[_0xf610('0x25')]=_['intersection'](_0x983f0[_0xf610('0x22')],_0x983f0[_0xf610('0x24')]);_0x5280b5[_0xf610('0x26')]=_[_0xf610('0x27')](_0x983f0['model'],qs[_0xf610('0x28')](_0x3e49cf['query'][_0xf610('0x28')]));_0x5280b5[_0xf610('0x26')]=_0x5280b5['attributes'][_0xf610('0x29')]?_0x5280b5[_0xf610('0x26')]:_0x983f0[_0xf610('0x22')];if(!_0x3e49cf[_0xf610('0x24')]['hasOwnProperty'](_0xf610('0x2a'))){_0x5280b5['limit']=qs[_0xf610('0x10')](_0x3e49cf[_0xf610('0x24')][_0xf610('0x10')]);_0x5280b5[_0xf610('0xe')]=qs['offset'](_0x3e49cf[_0xf610('0x24')][_0xf610('0xe')]);}_0x5280b5[_0xf610('0x2b')]=qs[_0xf610('0x2c')](_0x3e49cf[_0xf610('0x24')][_0xf610('0x2c')]);_0x5280b5[_0xf610('0x2d')]=qs[_0xf610('0x25')](_['pick'](_0x3e49cf[_0xf610('0x24')],_0x983f0['filters']),_0x11d870);if(_0x3e49cf[_0xf610('0x24')][_0xf610('0x2e')]){_0x5280b5['where']=_[_0xf610('0x2f')](_0x5280b5[_0xf610('0x2d')],{'$or':_[_0xf610('0x1c')](_0x11d870,function(_0x480e3a){if(_0x480e3a['type']!==_0xf610('0x30')){var _0x3f60f7={};_0x3f60f7[_0x480e3a[_0xf610('0x1a')]]={'$like':'%'+_0x3e49cf[_0xf610('0x24')][_0xf610('0x2e')]+'%'};return _0x3f60f7;}})});}_0x5280b5=_['merge']({},_0x5280b5,_0x3e49cf[_0xf610('0x31')]);var _0x1f3ac1={'where':_0x5280b5[_0xf610('0x2d')]};return db[_0xf610('0x1d')]['count'](_0x1f3ac1)[_0xf610('0x15')](function(_0x3f6262){_0xdc9b0d[_0xf610('0x11')]=_0x3f6262;if(_0x3e49cf[_0xf610('0x24')][_0xf610('0x32')]){_0x5280b5[_0xf610('0x33')]=[{'all':!![]}];}return db[_0xf610('0x1d')][_0xf610('0x34')](_0x5280b5);})[_0xf610('0x15')](function(_0x24ec16){_0xdc9b0d[_0xf610('0x35')]=_[_0xf610('0x1c')](_0x24ec16,function(_0x3e5784){if(_0x3e5784[_0xf610('0x36')]===_0xf610('0x37')){var _0x34c19d=encryptor['decryptString'](_0x3e5784['data3']);_0x3e5784[_0xf610('0x38')]=maskClientSecret(_0x34c19d);}return _0x3e5784;});return _0xdc9b0d;})[_0xf610('0x15')](respondWithFilteredResult(_0x3a9f60,_0x5280b5))[_0xf610('0x39')](handleError(_0x3a9f60,null));};exports['show']=function(_0x2745c4,_0x3aa11d){var _0x5e847a={'raw':!![],'where':{'id':_0x2745c4[_0xf610('0x3a')]['id']}},_0x1672bf={};_0x1672bf[_0xf610('0x22')]=_[_0xf610('0x23')](db[_0xf610('0x1d')][_0xf610('0x1e')]);_0x1672bf[_0xf610('0x24')]=_[_0xf610('0x23')](_0x2745c4[_0xf610('0x24')]);_0x1672bf[_0xf610('0x25')]=_[_0xf610('0x27')](_0x1672bf[_0xf610('0x22')],_0x1672bf[_0xf610('0x24')]);_0x5e847a[_0xf610('0x26')]=_[_0xf610('0x27')](_0x1672bf[_0xf610('0x22')],qs[_0xf610('0x28')](_0x2745c4[_0xf610('0x24')]['fields']));_0x5e847a[_0xf610('0x26')]=_0x5e847a[_0xf610('0x26')][_0xf610('0x29')]?_0x5e847a['attributes']:_0x1672bf['model'];if(_0x2745c4['query'][_0xf610('0x32')]){_0x5e847a[_0xf610('0x33')]=[{'all':!![]}];}_0x5e847a=_[_0xf610('0x2f')]({},_0x5e847a,_0x2745c4[_0xf610('0x31')]);return db['CloudProvider'][_0xf610('0x3b')](_0x5e847a)[_0xf610('0x15')](handleEntityNotFound(_0x3aa11d,null))['then'](function(_0x560dfc){if(_0x560dfc[_0xf610('0x36')]===_0xf610('0x37')){var _0xa616f=encryptor[_0xf610('0x3c')](_0x560dfc[_0xf610('0x38')]);_0x560dfc[_0xf610('0x38')]=maskClientSecret(_0xa616f);}return _0x560dfc;})[_0xf610('0x15')](respondWithResult(_0x3aa11d,null))['catch'](handleError(_0x3aa11d,null));};exports['create']=function(_0x9bf421,_0x128e15){if(!_0x9bf421[_0xf610('0x3d')][_0xf610('0x1a')])throw new Error(_0xf610('0x3e'));if(!_0x9bf421['body'][_0xf610('0x36')])throw new Error(_0xf610('0x3f'));var _0x15b839=db[_0xf610('0x1d')]['rawAttributes']['service'][_0xf610('0x40')];if(!_0x15b839[_0xf610('0x41')](_0x9bf421[_0xf610('0x3d')][_0xf610('0x36')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x15b839[_0xf610('0x42')](',\x20'));if(_0x9bf421[_0xf610('0x3d')][_0xf610('0x36')]===_0xf610('0x37')&&_0x9bf421['body'][_0xf610('0x38')]){_0x9bf421['body'][_0xf610('0x38')]=encryptor[_0xf610('0x43')](_0x9bf421['body'][_0xf610('0x38')]);}return db[_0xf610('0x1d')][_0xf610('0x44')](_0x9bf421[_0xf610('0x3d')],{})[_0xf610('0x15')](respondWithResult(_0x128e15,0xc9))[_0xf610('0x39')](handleError(_0x128e15,null));};exports[_0xf610('0x14')]=function(_0x151cd7,_0x547564){if(_0x151cd7[_0xf610('0x3d')]['id']){delete _0x151cd7['body']['id'];}return db[_0xf610('0x1d')][_0xf610('0x3b')]({'where':{'id':_0x151cd7[_0xf610('0x3a')]['id']}})[_0xf610('0x15')](handleEntityNotFound(_0x547564,null))[_0xf610('0x15')](function(_0x53b8df){if(_0x53b8df[_0xf610('0x36')]==='MicrosoftAzure'&&_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]){_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]=encryptor[_0xf610('0x43')](_0x151cd7[_0xf610('0x3d')][_0xf610('0x38')]);}return _0x53b8df;})['then'](saveUpdates(_0x151cd7[_0xf610('0x3d')],null))[_0xf610('0x15')](respondWithResult(_0x547564,null))[_0xf610('0x39')](handleError(_0x547564,null));};exports[_0xf610('0x45')]=function(_0x1493fd,_0x155898){return db[_0xf610('0x1d')][_0xf610('0x3b')]({'where':{'id':_0x1493fd[_0xf610('0x3a')]['id']}})[_0xf610('0x15')](handleEntityNotFound(_0x155898,null))[_0xf610('0x15')](removeEntity(_0x155898,null))[_0xf610('0x39')](handleError(_0x155898,null));};exports[_0xf610('0x46')]=function(_0x246e29,_0x5b356b){return db['CloudProvider'][_0xf610('0x47')]({'where':{'id':_0x246e29['params']['id']},'raw':!![]})['then'](function(_0xf32c9f){if(!_0xf32c9f)return _0x5b356b['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xf32c9f,_0x246e29[_0xf610('0x48')]['id'])};})['then'](respondWithResult(_0x5b356b,null))[_0xf610('0x39')](handleError(_0x5b356b,null));};exports['oauth2MicrosoftCallback']=function(_0x550d12,_0x8489a0){var _0x584a0a=_0x550d12['body'];var _0x43c11b;var _0x5e0e67;if(_0x584a0a['error'])throw _0x584a0a;redis[_0xf610('0x49')](_0x584a0a['state'])[_0xf610('0x15')](function(_0x30e5fe){if(!_0x30e5fe)throw new Error(_0xf610('0x4a'));_0x43c11b=JSON[_0xf610('0x4b')](_0x30e5fe);var _0x3f823d=Buffer[_0xf610('0x4c')](_0x584a0a['state'],_0xf610('0x4d'))[_0xf610('0x4e')](_0xf610('0x4f'));_0x5e0e67=JSON[_0xf610('0x4b')](_0x3f823d);if(!oauth[_0xf610('0x50')](_0x584a0a[_0xf610('0x51')],_0x43c11b[_0xf610('0x52')]))throw new Error(_0xf610('0x53'));redis[_0xf610('0x54')](_0x584a0a[_0xf610('0x55')]);return oauth['getOauth2MicrosoftAccessToken'](_0x584a0a['code'],_0x43c11b);})[_0xf610('0x15')](function(_0x1cf7c1){_0x43c11b[_0xf610('0x56')]=_0x1cf7c1[_0xf610('0x57')];_0x43c11b[_0xf610('0x58')]=_0x1cf7c1[_0xf610('0x59')];return db[_0xf610('0x1d')]['update']({'data5':_0x43c11b[_0xf610('0x56')],'data6':_0x43c11b[_0xf610('0x58')]},{'where':{'id':_0x43c11b['id']}});})[_0xf610('0x15')](function(){oauth[_0xf610('0x5a')](_0x43c11b);socket[_0xf610('0x5b')](_0xf610('0x5c'),{'id':_0x5e0e67['id']});return;})['then'](respondWithStatusCode(_0x8489a0,null))[_0xf610('0x39')](function(_0xe4a3c8){if(_0x5e0e67){socket['emit']('microsoftAuthorization:error',{'id':_0x5e0e67['id']});}if(!_0x43c11b){logger[_0xf610('0x18')]('Invalid\x20authentication\x20state\x20parameter',_0xe4a3c8);return _0x8489a0['status'](0x1f4)[_0xf610('0x5d')](_0xe4a3c8['message']);}logger[_0xf610('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x43c11b['id'],JSON['stringify'](_0xe4a3c8));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f119ff9..3379855 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 _0x6cbc=['moment','bluebird','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x6cbc,0x128));var _0xc6cb=function(_0x421021,_0xf42b18){_0x421021=_0x421021-0x0;var _0x1b9d18=_0x6cbc[_0x421021];return _0x1b9d18;};'use strict';var _=require(_0xc6cb('0x0'));var util=require(_0xc6cb('0x1'));var logger=require(_0xc6cb('0x2'))(_0xc6cb('0x3'));var moment=require(_0xc6cb('0x4'));var BPromise=require(_0xc6cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6cb('0x6'));var rimraf=require('rimraf');var config=require(_0xc6cb('0x7'));var attributes=require(_0xc6cb('0x8'));module[_0xc6cb('0x9')]=function(_0x3cfc67,_0x3259cc){return _0x3cfc67[_0xc6cb('0xa')](_0xc6cb('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c38=['cloud_providers','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider'];(function(_0x448e8d,_0x43a056){var _0x46e774=function(_0x22f0be){while(--_0x22f0be){_0x448e8d['push'](_0x448e8d['shift']());}};_0x46e774(++_0x43a056);}(_0x6c38,0x65));var _0x86c3=function(_0xc26035,_0x9bdf57){_0xc26035=_0xc26035-0x0;var _0x2f6310=_0x6c38[_0xc26035];return _0x2f6310;};'use strict';var _=require('lodash');var util=require(_0x86c3('0x0'));var logger=require(_0x86c3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x86c3('0x2'));var rp=require(_0x86c3('0x3'));var fs=require('fs');var path=require(_0x86c3('0x4'));var rimraf=require('rimraf');var config=require(_0x86c3('0x5'));var attributes=require(_0x86c3('0x6'));module['exports']=function(_0x402b1d,_0x47d55c){return _0x402b1d[_0x86c3('0x7')](_0x86c3('0x8'),attributes,{'tableName':_0x86c3('0x9'),'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 627a23b..ff4061b 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 _0x0a03=['resolve','then','data3','CloudProvider','findOne','refresh_token','POST','data5','data6','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','toString','base64','client_id','data1','join','data4','response_mode','form_post','scope','prompt','key','value','oauth2Claims','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp'];(function(_0x1e31fa,_0x2dea6b){var _0x1b9c65=function(_0x3dbe83){while(--_0x3dbe83){_0x1e31fa['push'](_0x1e31fa['shift']());}};_0x1b9c65(++_0x2dea6b);}(_0x0a03,0x131));var _0x30a0=function(_0x3d3c73,_0x4306ef){_0x3d3c73=_0x3d3c73-0x0;var _0x45696f=_0x0a03[_0x3d3c73];return _0x45696f;};'use strict';var _=require(_0x30a0('0x0'));var crypto=require(_0x30a0('0x1'));var jwt=require(_0x30a0('0x2'));var moment=require(_0x30a0('0x3'));var Redis=require(_0x30a0('0x4'));var rp=require(_0x30a0('0x5'));var util=require('util');var encryptor=require(_0x30a0('0x6'));var config=require(_0x30a0('0x7'));var logger=require('../../config/logger')(_0x30a0('0x8'));var schedule=require(_0x30a0('0x9'));var db=require(_0x30a0('0xa'))['db'];config[_0x30a0('0xb')]=_[_0x30a0('0xc')](config[_0x30a0('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x30a0('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x30a0('0xd'),_0x30a0('0xe'),_0x30a0('0xf'),_0x30a0('0x10'),_0x30a0('0x11'),_0x30a0('0x12'),_0x30a0('0x13')],'Dynamics365':[_0x30a0('0xd'),_0x30a0('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x30a0('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5bcb8b){var _0x5c756c=_[_0x30a0('0x15')](AZURE_AUTH_SCOPES[_0x5bcb8b[_0x30a0('0x16')]]);if(_0x5bcb8b[_0x30a0('0x16')]===_0x30a0('0x17'))_0x5c756c['push'](_0x5bcb8b[_0x30a0('0x18')]+_0x30a0('0x19'));return _0x5c756c['join']('\x20');}function getAccessTokenScope(_0x1b12f1){if(_0x1b12f1[_0x30a0('0x16')]==='Outlook365')return _0x30a0('0x11');if(_0x1b12f1[_0x30a0('0x16')]===_0x30a0('0x17'))return _0x1b12f1[_0x30a0('0x18')]+_0x30a0('0x19');}function generateMicrosoftAuthorizationUrl(_0x1ba9ed,_0x3e1044){var _0x15122b=MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x1ba9ed[_0x30a0('0x1c')]);var _0x3ffe1f=[_0x30a0('0x1d'),_0x30a0('0x1e')];var _0x8c1e9e=Buffer['from'](JSON['stringify']({'id':_0x3e1044}))[_0x30a0('0x1f')](_0x30a0('0x20'));var _0xb0129e=crypto['randomBytes'](0x10)[_0x30a0('0x1f')]('hex');var _0x3a3d14=getAuthorizationScopes(_0x1ba9ed);var _0x2127dc=[{'key':_0x30a0('0x21'),'value':_0x1ba9ed[_0x30a0('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x3ffe1f[_0x30a0('0x23')]('\x20'))},{'key':'redirect_uri','value':_0x1ba9ed[_0x30a0('0x24')]},{'key':_0x30a0('0x25'),'value':_0x30a0('0x26')},{'key':_0x30a0('0x27'),'value':encodeURIComponent(_0x3a3d14)},{'key':'state','value':_0x8c1e9e},{'key':'nonce','value':_0xb0129e},{'key':_0x30a0('0x28'),'value':'login'}];var _0x4b8be2=_0x15122b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x30a0('0x15')](_0x2127dc,function(_0x31934c){return _0x31934c[_0x30a0('0x29')]+'='+_0x31934c[_0x30a0('0x2a')];})[_0x30a0('0x23')]('&');_0x1ba9ed[_0x30a0('0x2b')]={'issuer':_0x15122b[_0x30a0('0x1a')]('oauth2/',''),'audience':_0x1ba9ed[_0x30a0('0x22')],'state':_0x8c1e9e,'nonce':_0xb0129e};redis['set'](_0x8c1e9e,JSON[_0x30a0('0x2c')](_0x1ba9ed));return _0x4b8be2;}function isValidIdToken(_0xf09b25,_0x4b6675){try{var _0x12ecb9=jwt[_0x30a0('0x2d')](_0xf09b25,{'complete':!![]});var _0x574fc9=_0x12ecb9[_0x30a0('0x2e')];if(_0x574fc9[_0x30a0('0x2f')]!==_0x4b6675[_0x30a0('0x30')])return![];if(_0x574fc9[_0x30a0('0x31')]!==_0x4b6675[_0x30a0('0x32')])return![];if(_0x574fc9[_0x30a0('0x33')]!==_0x4b6675[_0x30a0('0x33')])return![];if(moment()[_0x30a0('0x34')](moment[_0x30a0('0x35')](_0x574fc9[_0x30a0('0x36')])))return![];return!![];}catch(_0x5ac1a1){throw _0x5ac1a1;}}function refreshOauth2MicrosoftAccessToken(_0x14f52c){return Promise[_0x30a0('0x37')]()[_0x30a0('0x38')](function(){if(_0x14f52c[_0x30a0('0x39')])return _0x14f52c;return db[_0x30a0('0x3a')][_0x30a0('0x3b')]({'where':{'id':_0x14f52c['id']},'raw':!![]});})['then'](function(_0x4de7fa){var _0x2cec2d={'grant_type':_0x30a0('0x3c'),'refresh_token':_0x4de7fa['data6'],'scope':getAccessTokenScope(_0x4de7fa),'redirect_uri':_0x4de7fa[_0x30a0('0x24')],'client_id':_0x4de7fa[_0x30a0('0x22')],'client_secret':encryptor['decryptString'](_0x4de7fa['data3'])};var _0x44266b={'method':_0x30a0('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x4de7fa['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cec2d,'json':!![]};return rp(_0x44266b);})['then'](function(_0x13cfa5){_0x14f52c[_0x30a0('0x3e')]=_0x13cfa5['access_token'];_0x14f52c[_0x30a0('0x3f')]=_0x13cfa5[_0x30a0('0x3c')];return db[_0x30a0('0x3a')][_0x30a0('0x40')]({'data5':_0x14f52c[_0x30a0('0x3e')],'data6':_0x14f52c[_0x30a0('0x3f')]},{'where':{'id':_0x14f52c['id']}});})[_0x30a0('0x38')](function(){return _0x14f52c;})[_0x30a0('0x41')](function(_0x5e251b){logger['error'](_0x30a0('0x42'),_0x14f52c['id'],_0x5e251b);});}function getOauth2MicrosoftAccessToken(_0x540586,_0x29f3a6){var _0x541061={'grant_type':_0x30a0('0x43'),'code':_0x540586,'scope':getAccessTokenScope(_0x29f3a6),'redirect_uri':_0x29f3a6[_0x30a0('0x24')],'client_id':_0x29f3a6['data1'],'client_secret':encryptor['decryptString'](_0x29f3a6['data3'])};var _0x1b0e5b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x30a0('0x1a')](_0x30a0('0x1b'),_0x29f3a6[_0x30a0('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x541061,'json':!![]};return rp(_0x1b0e5b);}function startRefreshInterval(_0x11284d){var _0x429ada=schedule[_0x30a0('0x44')];if(_0x429ada[_0x11284d['id']])clearInterval(_0x429ada[_0x11284d['id']]);_0x429ada[_0x11284d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x11284d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x30a0('0x44')]=_0x429ada;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x30a0('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x30a0('0x38')](function(_0x5bf361){var _0x262af3=_0x5bf361[_0x30a0('0x15')](function(_0x4b9656){return refreshOauth2MicrosoftAccessToken(_0x4b9656)['then'](function(_0x29700a){startRefreshInterval(_0x29700a);});});return Promise[_0x30a0('0x46')](_0x262af3);})[_0x30a0('0x41')](function(_0x53460a){var _0x29ee0b=_0x53460a?util[_0x30a0('0x47')](_0x53460a,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x29ee0b);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1f21=['decryptString','data2','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','code','id_token','stringify','toString','base64','randomBytes','client_id','data1','response_type','redirect_uri','data4','scope','state','nonce','login','value','oauth2Claims','oauth2/','set','decode','payload','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','replace','data5','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code'];(function(_0x321323,_0x4d62fa){var _0x102702=function(_0x71936f){while(--_0x71936f){_0x321323['push'](_0x321323['shift']());}};_0x102702(++_0x4d62fa);}(_0x1f21,0x179));var _0x11f2=function(_0xd09ff5,_0x1daae){_0xd09ff5=_0xd09ff5-0x0;var _0x6d7b8e=_0x1f21[_0xd09ff5];return _0x6d7b8e;};'use strict';var _=require(_0x11f2('0x0'));var crypto=require(_0x11f2('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x11f2('0x2'));var Redis=require(_0x11f2('0x3'));var rp=require(_0x11f2('0x4'));var util=require(_0x11f2('0x5'));var encryptor=require(_0x11f2('0x6'));var config=require(_0x11f2('0x7'));var logger=require(_0x11f2('0x8'))('api');var schedule=require(_0x11f2('0x9'));var db=require('../../mysqldb')['db'];config[_0x11f2('0xa')]=_['defaults'](config[_0x11f2('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x11f2('0xa')]);var MICROSOFT_AUTH_URL=_0x11f2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x11f2('0xc'),_0x11f2('0xd'),_0x11f2('0xe'),_0x11f2('0xf'),_0x11f2('0x10')],'Dynamics365':[_0x11f2('0x11'),_0x11f2('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x11f2('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x267a93){var _0x21a062=_[_0x11f2('0x13')](AZURE_AUTH_SCOPES[_0x267a93['type']]);if(_0x267a93[_0x11f2('0x14')]===_0x11f2('0x15'))_0x21a062[_0x11f2('0x16')](_0x267a93[_0x11f2('0x17')]+_0x11f2('0x18'));return _0x21a062[_0x11f2('0x19')]('\x20');}function getAccessTokenScope(_0x2caf16){if(_0x2caf16[_0x11f2('0x14')]===_0x11f2('0x1a'))return _0x11f2('0xe');if(_0x2caf16[_0x11f2('0x14')]===_0x11f2('0x15'))return _0x2caf16[_0x11f2('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x54b293,_0x19d934){var _0x2d70c0=MICROSOFT_AUTH_URL['replace'](_0x11f2('0x1b'),_0x54b293['data2']);var _0xc8f18c=[_0x11f2('0x1c'),_0x11f2('0x1d')];var _0x45983f=Buffer['from'](JSON[_0x11f2('0x1e')]({'id':_0x19d934}))[_0x11f2('0x1f')](_0x11f2('0x20'));var _0x195e5b=crypto[_0x11f2('0x21')](0x10)[_0x11f2('0x1f')]('hex');var _0x407d2e=getAuthorizationScopes(_0x54b293);var _0x3a6cc5=[{'key':_0x11f2('0x22'),'value':_0x54b293[_0x11f2('0x23')]},{'key':_0x11f2('0x24'),'value':encodeURIComponent(_0xc8f18c['join']('\x20'))},{'key':_0x11f2('0x25'),'value':_0x54b293[_0x11f2('0x26')]},{'key':'response_mode','value':'form_post'},{'key':_0x11f2('0x27'),'value':encodeURIComponent(_0x407d2e)},{'key':_0x11f2('0x28'),'value':_0x45983f},{'key':_0x11f2('0x29'),'value':_0x195e5b},{'key':'prompt','value':_0x11f2('0x2a')}];var _0xc0f81e=_0x2d70c0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3a6cc5,function(_0x35b7d8){return _0x35b7d8['key']+'='+_0x35b7d8[_0x11f2('0x2b')];})[_0x11f2('0x19')]('&');_0x54b293[_0x11f2('0x2c')]={'issuer':_0x2d70c0['replace'](_0x11f2('0x2d'),''),'audience':_0x54b293['data1'],'state':_0x45983f,'nonce':_0x195e5b};redis[_0x11f2('0x2e')](_0x45983f,JSON[_0x11f2('0x1e')](_0x54b293));return _0xc0f81e;}function isValidIdToken(_0x124ae7,_0xe55e2){try{var _0x348c83=jwt[_0x11f2('0x2f')](_0x124ae7,{'complete':!![]});var _0x47b085=_0x348c83[_0x11f2('0x30')];if(_0x47b085['iss']!==_0xe55e2['issuer'])return![];if(_0x47b085[_0x11f2('0x31')]!==_0xe55e2[_0x11f2('0x32')])return![];if(_0x47b085[_0x11f2('0x29')]!==_0xe55e2[_0x11f2('0x29')])return![];if(moment()[_0x11f2('0x33')](moment[_0x11f2('0x34')](_0x47b085[_0x11f2('0x35')])))return![];return!![];}catch(_0x33be51){throw _0x33be51;}}function refreshOauth2MicrosoftAccessToken(_0x17c4a4){return Promise['resolve']()[_0x11f2('0x36')](function(){if(_0x17c4a4[_0x11f2('0x37')])return _0x17c4a4;return db[_0x11f2('0x38')][_0x11f2('0x39')]({'where':{'id':_0x17c4a4['id']},'raw':!![]});})[_0x11f2('0x36')](function(_0x5c772e){var _0x4790e2={'grant_type':_0x11f2('0x3a'),'refresh_token':_0x5c772e[_0x11f2('0x3b')],'scope':getAccessTokenScope(_0x5c772e),'redirect_uri':_0x5c772e[_0x11f2('0x26')],'client_id':_0x5c772e[_0x11f2('0x23')],'client_secret':encryptor['decryptString'](_0x5c772e[_0x11f2('0x37')])};var _0x44b4ff={'method':_0x11f2('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x11f2('0x3d')](_0x11f2('0x1b'),_0x5c772e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4790e2,'json':!![]};return rp(_0x44b4ff);})[_0x11f2('0x36')](function(_0x50216c){_0x17c4a4[_0x11f2('0x3e')]=_0x50216c['access_token'];_0x17c4a4['data6']=_0x50216c[_0x11f2('0x3a')];return db[_0x11f2('0x38')][_0x11f2('0x3f')]({'data5':_0x17c4a4[_0x11f2('0x3e')],'data6':_0x17c4a4[_0x11f2('0x3b')]},{'where':{'id':_0x17c4a4['id']}});})['then'](function(){return _0x17c4a4;})['catch'](function(_0x5be7d4){logger[_0x11f2('0x40')](_0x11f2('0x41'),_0x17c4a4['id'],_0x5be7d4);});}function getOauth2MicrosoftAccessToken(_0x173a02,_0x145b5e){var _0x48497f={'grant_type':_0x11f2('0x42'),'code':_0x173a02,'scope':getAccessTokenScope(_0x145b5e),'redirect_uri':_0x145b5e[_0x11f2('0x26')],'client_id':_0x145b5e[_0x11f2('0x23')],'client_secret':encryptor[_0x11f2('0x43')](_0x145b5e['data3'])};var _0x5d0579={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x11f2('0x3d')]('{TENANT_ID}',_0x145b5e[_0x11f2('0x44')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x48497f,'json':!![]};return rp(_0x5d0579);}function startRefreshInterval(_0x443a0b){var _0x422b0c=schedule['intervals'];if(_0x422b0c[_0x443a0b['id']])clearInterval(_0x422b0c[_0x443a0b['id']]);_0x422b0c[_0x443a0b['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x443a0b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x11f2('0x45')]=_0x422b0c;}function startAllRefreshIntervals(){return db[_0x11f2('0x38')][_0x11f2('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x11f2('0x36')](function(_0x5b86a2){var _0x3c4e75=_0x5b86a2[_0x11f2('0x13')](function(_0x541a71){return refreshOauth2MicrosoftAccessToken(_0x541a71)['then'](function(_0x416c93){startRefreshInterval(_0x416c93);});});return Promise[_0x11f2('0x47')](_0x3c4e75);})['catch'](function(_0x538465){var _0x50fead=_0x538465?util['inspect'](_0x538465,{'showHidden':![],'depth':null}):'';logger[_0x11f2('0x40')](_0x11f2('0x48'),_0x50fead);});}module[_0x11f2('0x49')]={'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 6c88024..b344491 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 _0x79d7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79d7,0x9c));var _0x779d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x79d7[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x779d('0x0'));var util=require('util');var moment=require(_0x779d('0x1'));var BPromise=require(_0x779d('0x2'));var rs=require(_0x779d('0x3'));var fs=require('fs');var Redis=require(_0x779d('0x4'));var db=require(_0x779d('0x5'))['db'];var utils=require(_0x779d('0x6'));var logger=require('../../config/logger')(_0x779d('0x7'));var config=require(_0x779d('0x8'));var jayson=require(_0x779d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x227c87,_0x4c7fb4,_0xc067dd){return new BPromise(function(_0x2f83f6,_0x4c7c92){return client['request'](_0x227c87,_0xc067dd)['then'](function(_0x5b4ef2){logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,_0x779d('0xc'));logger['debug'](_0x779d('0xd'),_0x4c7fb4,'request\x20sent',JSON[_0x779d('0xe')](_0x5b4ef2));if(_0x5b4ef2['error']){if(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x10')]===0x1f4){logger[_0x779d('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4c7fb4,_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);return _0x4c7c92(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x5b4ef2['error'][_0x779d('0x11')]);return _0x2f83f6(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}else{logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,'request\x20sent');_0x2f83f6(_0x5b4ef2[_0x779d('0x12')][_0x779d('0x11')]);}})[_0x779d('0x13')](function(_0x4cc248){logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x4cc248);_0x4c7c92(_0x4cc248);});});} \ No newline at end of file +var _0x1189=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x51d2e0,_0x576a37){var _0x5359b5=function(_0xbb528a){while(--_0xbb528a){_0x51d2e0['push'](_0x51d2e0['shift']());}};_0x5359b5(++_0x576a37);}(_0x1189,0x17f));var _0x9118=function(_0x316e2b,_0x40efd7){_0x316e2b=_0x316e2b-0x0;var _0x2e4809=_0x1189[_0x316e2b];return _0x2e4809;};'use strict';var _=require(_0x9118('0x0'));var util=require(_0x9118('0x1'));var moment=require(_0x9118('0x2'));var BPromise=require(_0x9118('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9118('0x4'));var db=require(_0x9118('0x5'))['db'];var utils=require(_0x9118('0x6'));var logger=require(_0x9118('0x7'))(_0x9118('0x8'));var config=require(_0x9118('0x9'));var jayson=require(_0x9118('0xa'));var client=jayson['client'][_0x9118('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x370bec,_0x21251a,_0x3df1a3){return new BPromise(function(_0x37e930,_0xad3e6e){return client['request'](_0x370bec,_0x3df1a3)[_0x9118('0xc')](function(_0x227eea){logger[_0x9118('0xd')](_0x9118('0xe'),_0x21251a,_0x9118('0xf'));logger[_0x9118('0x10')](_0x9118('0x11'),_0x21251a,'request\x20sent',JSON[_0x9118('0x12')](_0x227eea));if(_0x227eea['error']){if(_0x227eea['error'][_0x9118('0x13')]===0x1f4){logger[_0x9118('0x14')]('CloudProvider,\x20%s,\x20%s',_0x21251a,_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);return _0xad3e6e(_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);}logger[_0x9118('0x14')](_0x9118('0xe'),_0x21251a,_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);return _0x37e930(_0x227eea[_0x9118('0x14')][_0x9118('0x15')]);}else{logger[_0x9118('0xd')]('CloudProvider,\x20%s,\x20%s',_0x21251a,'request\x20sent');_0x37e930(_0x227eea[_0x9118('0x16')]['message']);}})[_0x9118('0x17')](function(_0x1ff727){logger[_0x9118('0x14')](_0x9118('0xe'),_0x21251a,_0x1ff727);_0xad3e6e(_0x1ff727);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 0cdb3de..af48dc4 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x3cec2e,_0x39de83){_0x3cec2e=_0x3cec2e-0x0;var _0xc8294f=_0x7a54[_0x3cec2e];return _0xc8294f;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +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(_0x2ecf65,_0x3c293d){var _0x55cd74=function(_0x12085b){while(--_0x12085b){_0x2ecf65['push'](_0x2ecf65['shift']());}};_0x55cd74(++_0x3c293d);}(_0xdb28,0x106));var _0x8db2=function(_0x3ec49d,_0x534c18){_0x3ec49d=_0x3ec49d-0x0;var _0x428f66=_0xdb28[_0x3ec49d];return _0x428f66;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 8fd6b59..1ac6650 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 _0x2a5e=['sequelize','name','STRING'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x2a5e,0xf6));var _0xe2a5=function(_0x4127b0,_0x249d6c){_0x4127b0=_0x4127b0-0x0;var _0x4ae7f6=_0x2a5e[_0x4127b0];return _0x4ae7f6;};'use strict';var Sequelize=require(_0xe2a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe2a5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe2a5('0x2')]},'companyId':{'type':Sequelize[_0xe2a5('0x2')]},'website':{'type':Sequelize[_0xe2a5('0x2')]},'phone':{'type':Sequelize[_0xe2a5('0x2')]},'fax':{'type':Sequelize[_0xe2a5('0x2')]},'type':{'type':Sequelize[_0xe2a5('0x2')]},'street':{'type':Sequelize[_0xe2a5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe2a5('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe2a5('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe2a5('0x2')]},'sPostalCode':{'type':Sequelize[_0xe2a5('0x2')]},'sCity':{'type':Sequelize[_0xe2a5('0x2')]},'sCountry':{'type':Sequelize[_0xe2a5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3073=['name','STRING'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0x3073,0x17c));var _0x3307=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x3073[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3307('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3307('0x1')]},'companyId':{'type':Sequelize[_0x3307('0x1')]},'website':{'type':Sequelize[_0x3307('0x1')]},'phone':{'type':Sequelize[_0x3307('0x1')]},'fax':{'type':Sequelize[_0x3307('0x1')]},'type':{'type':Sequelize[_0x3307('0x1')]},'street':{'type':Sequelize[_0x3307('0x1')]},'postalCode':{'type':Sequelize[_0x3307('0x1')]},'city':{'type':Sequelize[_0x3307('0x1')]},'country':{'type':Sequelize[_0x3307('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3307('0x1')]},'sStreet':{'type':Sequelize[_0x3307('0x1')]},'sPostalCode':{'type':Sequelize[_0x3307('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3307('0x1')]},'description':{'type':Sequelize[_0x3307('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index c3a6d36..9c6353b 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 _0xbf26=['map','options','findAll','catch','show','params','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x374397,_0x14987c){var _0x57e020=function(_0xec7f31){while(--_0xec7f31){_0x374397['push'](_0x374397['shift']());}};_0x57e020(++_0x14987c);}(_0xbf26,0xb7));var _0x6bf2=function(_0x154285,_0x5a9804){_0x154285=_0x154285-0x0;var _0x21db10=_0xbf26[_0x154285];return _0x21db10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bf2('0x0'));var zipdir=require(_0x6bf2('0x1'));var jsonpatch=require(_0x6bf2('0x2'));var rp=require(_0x6bf2('0x3'));var moment=require(_0x6bf2('0x4'));var BPromise=require(_0x6bf2('0x5'));var Mustache=require('mustache');var util=require(_0x6bf2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6bf2('0x7'));var ejs=require(_0x6bf2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6bf2('0x9'));var crypto=require('crypto');var jsforce=require(_0x6bf2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6bf2('0x7'));var querystring=require(_0x6bf2('0xb'));var Papa=require(_0x6bf2('0xc'));var Redis=require('ioredis');var authService=require(_0x6bf2('0xd'));var qs=require(_0x6bf2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bf2('0xf'))(_0x6bf2('0x10'));var utils=require(_0x6bf2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6bf2('0x12'));var db=require(_0x6bf2('0x13'))['db'];function respondWithStatusCode(_0x57427d,_0x5d1f60){_0x5d1f60=_0x5d1f60||0xcc;return function(_0x3cb104){if(_0x3cb104){return _0x57427d[_0x6bf2('0x14')](_0x5d1f60);}return _0x57427d[_0x6bf2('0x15')](_0x5d1f60)[_0x6bf2('0x16')]();};}function respondWithResult(_0x42a236,_0x58fb37){_0x58fb37=_0x58fb37||0xc8;return function(_0x260c9c){if(_0x260c9c){return _0x42a236[_0x6bf2('0x15')](_0x58fb37)[_0x6bf2('0x17')](_0x260c9c);}};}function respondWithFilteredResult(_0x3c5e5d,_0xaec504){return function(_0x24b5b2){if(_0x24b5b2){var _0x59ffff=typeof _0xaec504[_0x6bf2('0x18')]===_0x6bf2('0x19')&&typeof _0xaec504[_0x6bf2('0x1a')]===_0x6bf2('0x19');var _0x5d0863=_0x24b5b2[_0x6bf2('0x1b')];var _0x4ae745=_0x59ffff?0x0:_0xaec504[_0x6bf2('0x18')];var _0xa369f9=_0x59ffff?_0x24b5b2[_0x6bf2('0x1b')]:_0xaec504[_0x6bf2('0x18')]+_0xaec504[_0x6bf2('0x1a')];var _0x1dd17c;if(_0xa369f9>=_0x5d0863){_0xa369f9=_0x5d0863;_0x1dd17c=0xc8;}else{_0x1dd17c=0xce;}_0x3c5e5d[_0x6bf2('0x15')](_0x1dd17c);return _0x3c5e5d[_0x6bf2('0x1c')]('Content-Range',_0x4ae745+'-'+_0xa369f9+'/'+_0x5d0863)[_0x6bf2('0x17')](_0x24b5b2);}return null;};}function patchUpdates(_0x51f2ff){return function(_0x5dfb67){try{jsonpatch[_0x6bf2('0x1d')](_0x5dfb67,_0x51f2ff,!![]);}catch(_0x5914f9){return BPromise['reject'](_0x5914f9);}return _0x5dfb67['save']();};}function saveUpdates(_0x31ca0d,_0x4426b8){return function(_0x10b384){if(_0x10b384){return _0x10b384[_0x6bf2('0x1e')](_0x31ca0d)['then'](function(_0x224764){return _0x224764;});}return null;};}function removeEntity(_0x1f62c,_0x540dd8){return function(_0x1b98c3){if(_0x1b98c3){return _0x1b98c3[_0x6bf2('0x1f')]()[_0x6bf2('0x20')](function(){var _0x4ea68e=_0x1b98c3[_0x6bf2('0x21')]({'plain':!![]});var _0x229b2d=_0x6bf2('0x22');return db[_0x6bf2('0x23')]['destroy']({'where':{'type':_0x229b2d,'resourceId':_0x4ea68e['id']}})[_0x6bf2('0x20')](function(){return _0x1b98c3;});})[_0x6bf2('0x20')](function(){_0x1f62c[_0x6bf2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0a6f,_0x235248){return function(_0x32b940){if(!_0x32b940){_0x2e0a6f[_0x6bf2('0x14')](0x194);}return _0x32b940;};}function handleError(_0xf65c82,_0x1d2e5b){_0x1d2e5b=_0x1d2e5b||0x1f4;return function(_0x8d4c6){logger[_0x6bf2('0x24')](_0x8d4c6[_0x6bf2('0x25')]);if(_0x8d4c6['name']){delete _0x8d4c6[_0x6bf2('0x26')];}_0xf65c82[_0x6bf2('0x15')](_0x1d2e5b)['send'](_0x8d4c6);};}exports[_0x6bf2('0x27')]=function(_0x32ffff,_0x4e1298){var _0x33b234={},_0x5a4487={},_0x58b9b8={'count':0x0,'rows':[]};return db[_0x6bf2('0x28')][_0x6bf2('0x29')]()[_0x6bf2('0x20')](function(_0x56ae19){_0x5a4487[_0x6bf2('0x2a')]=_[_0x6bf2('0x2b')](_0x56ae19);_0x5a4487[_0x6bf2('0x2c')]=_[_0x6bf2('0x2b')](_0x32ffff[_0x6bf2('0x2c')]);_0x5a4487[_0x6bf2('0x2d')]=_[_0x6bf2('0x2e')](_0x5a4487['model'],_0x5a4487['query']);_0x33b234[_0x6bf2('0x2f')]=_['intersection'](_0x5a4487[_0x6bf2('0x2a')],qs[_0x6bf2('0x30')](_0x32ffff['query'][_0x6bf2('0x30')]));_0x33b234[_0x6bf2('0x2f')]=_0x33b234['attributes'][_0x6bf2('0x31')]?_0x33b234[_0x6bf2('0x2f')]:_0x5a4487[_0x6bf2('0x2a')];if(!_0x32ffff['query'][_0x6bf2('0x32')]('nolimit')){_0x33b234[_0x6bf2('0x1a')]=qs[_0x6bf2('0x1a')](_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x1a')]);_0x33b234[_0x6bf2('0x18')]=qs[_0x6bf2('0x18')](_0x32ffff[_0x6bf2('0x2c')]['offset']);}_0x33b234[_0x6bf2('0x33')]=qs[_0x6bf2('0x34')](_0x32ffff['query'][_0x6bf2('0x34')]);_0x33b234[_0x6bf2('0x35')]=qs['filters'](_[_0x6bf2('0x36')](_0x32ffff['query'],_0x5a4487[_0x6bf2('0x2d')]),_0x56ae19);if(_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x37')]){_0x33b234[_0x6bf2('0x35')]=_[_0x6bf2('0x38')](_0x33b234[_0x6bf2('0x35')],{'$or':_[_0x6bf2('0x39')](_0x33b234[_0x6bf2('0x2f')],function(_0xd4a59e){var _0x3faa87={};_0x3faa87[_0xd4a59e]={'$like':'%'+_0x32ffff[_0x6bf2('0x2c')][_0x6bf2('0x37')]+'%'};return _0x3faa87;})});}_0x33b234=_[_0x6bf2('0x38')]({},_0x33b234,_0x32ffff[_0x6bf2('0x3a')]);var _0x302767={'where':_0x33b234[_0x6bf2('0x35')]};return db[_0x6bf2('0x28')][_0x6bf2('0x1b')](_0x302767)[_0x6bf2('0x20')](function(_0x38c14c){_0x58b9b8[_0x6bf2('0x1b')]=_0x38c14c;if(_0x32ffff[_0x6bf2('0x2c')]['includeAll']){_0x33b234['include']=[{'all':!![]}];}return db[_0x6bf2('0x28')][_0x6bf2('0x3b')](_0x33b234);})['then'](function(_0x1532b4){_0x58b9b8['rows']=_0x1532b4;return _0x58b9b8;})['then'](respondWithFilteredResult(_0x4e1298,_0x33b234))[_0x6bf2('0x3c')](handleError(_0x4e1298,null));})[_0x6bf2('0x3c')](handleError(_0x4e1298,null));};exports[_0x6bf2('0x3d')]=function(_0x5cbb09,_0x1577dd){var _0x149269={'raw':![],'where':{'id':_0x5cbb09[_0x6bf2('0x3e')]['id']}},_0x3fb9d5={};_0x3fb9d5[_0x6bf2('0x2a')]=_[_0x6bf2('0x2b')](db[_0x6bf2('0x28')][_0x6bf2('0x3f')]);_0x3fb9d5[_0x6bf2('0x2c')]=_['keys'](_0x5cbb09['query']);_0x3fb9d5[_0x6bf2('0x2d')]=_[_0x6bf2('0x2e')](_0x3fb9d5['model'],_0x3fb9d5['query']);_0x149269[_0x6bf2('0x2f')]=_[_0x6bf2('0x2e')](_0x3fb9d5[_0x6bf2('0x2a')],qs['fields'](_0x5cbb09[_0x6bf2('0x2c')][_0x6bf2('0x30')]));_0x149269['attributes']=_0x149269[_0x6bf2('0x2f')][_0x6bf2('0x31')]?_0x149269[_0x6bf2('0x2f')]:_0x3fb9d5[_0x6bf2('0x2a')];if(_0x5cbb09[_0x6bf2('0x2c')]['includeAll']){_0x149269[_0x6bf2('0x40')]=[{'all':!![]}];}_0x149269=_[_0x6bf2('0x38')]({},_0x149269,_0x5cbb09[_0x6bf2('0x3a')]);return db['CmCompany']['find'](_0x149269)['then'](handleEntityNotFound(_0x1577dd,null))[_0x6bf2('0x20')](respondWithResult(_0x1577dd,null))['catch'](handleError(_0x1577dd,null));};exports[_0x6bf2('0x41')]=function(_0xe83c23,_0x47b400){return db[_0x6bf2('0x28')][_0x6bf2('0x41')](_0xe83c23[_0x6bf2('0x42')],{})[_0x6bf2('0x20')](function(_0x476560){var _0x406d2d=_0xe83c23['user'][_0x6bf2('0x21')]({'plain':!![]});if(!_0x406d2d)throw new Error(_0x6bf2('0x43'));if(_0x406d2d['role']===_0x6bf2('0x44')){var _0x400deb=_0x476560['get']({'plain':!![]});var _0x5f213f=_0x6bf2('0x22');return db[_0x6bf2('0x45')][_0x6bf2('0x46')]({'where':{'name':_0x5f213f,'userProfileId':_0x406d2d['userProfileId']},'raw':!![]})[_0x6bf2('0x20')](function(_0x1521dc){if(_0x1521dc&&_0x1521dc[_0x6bf2('0x47')]===0x0){return db[_0x6bf2('0x23')][_0x6bf2('0x41')]({'name':_0x400deb[_0x6bf2('0x26')],'resourceId':_0x400deb['id'],'type':_0x1521dc[_0x6bf2('0x26')],'sectionId':_0x1521dc['id']},{})[_0x6bf2('0x20')](function(){return _0x476560;});}else{return _0x476560;}})['catch'](function(_0x2c8491){logger[_0x6bf2('0x24')](_0x6bf2('0x48'),_0x2c8491);throw _0x2c8491;});}return _0x476560;})[_0x6bf2('0x20')](respondWithResult(_0x47b400,0xc9))['catch'](handleError(_0x47b400,null));};exports[_0x6bf2('0x1e')]=function(_0x4a31b3,_0x40964b){if(_0x4a31b3[_0x6bf2('0x42')]['id']){delete _0x4a31b3[_0x6bf2('0x42')]['id'];}return db['CmCompany'][_0x6bf2('0x46')]({'where':{'id':_0x4a31b3[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0x40964b,null))[_0x6bf2('0x20')](saveUpdates(_0x4a31b3[_0x6bf2('0x42')],null))[_0x6bf2('0x20')](respondWithResult(_0x40964b,null))[_0x6bf2('0x3c')](handleError(_0x40964b,null));};exports[_0x6bf2('0x1f')]=function(_0x36503b,_0x188feb){return db[_0x6bf2('0x28')][_0x6bf2('0x46')]({'where':{'id':_0x36503b['params']['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0x188feb,null))[_0x6bf2('0x20')](removeEntity(_0x188feb,null))[_0x6bf2('0x3c')](handleError(_0x188feb,null));};exports[_0x6bf2('0x29')]=function(_0x3073dc,_0x15f65c){return db['CmCompany']['describe']()[_0x6bf2('0x20')](respondWithResult(_0x15f65c,null))['catch'](handleError(_0x15f65c,null));};exports[_0x6bf2('0x49')]=function(_0x6c10f,_0xa3f56e,_0x51d9cc){return db[_0x6bf2('0x4a')][_0x6bf2('0x46')]({'where':{'id':_0x6c10f[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0xa3f56e,null))[_0x6bf2('0x20')](function(_0x7d763e){if(_0x7d763e){return _0x7d763e[_0x6bf2('0x49')](_0x6c10f['body']['ids'],_[_0x6bf2('0x4b')](_0x6c10f[_0x6bf2('0x42')],[_0x6bf2('0x4c'),'id'])||{});}})[_0x6bf2('0x20')](respondWithResult(_0xa3f56e,null))[_0x6bf2('0x3c')](handleError(_0xa3f56e,null));};exports[_0x6bf2('0x4d')]=function(_0x1ae484,_0xbd935c,_0x42b966){var _0x249df1={};var _0x246de6={};var _0x41b2f7;var _0x511f91;return db['CmCompany'][_0x6bf2('0x4e')]({'where':{'id':_0x1ae484[_0x6bf2('0x3e')]['id']}})[_0x6bf2('0x20')](handleEntityNotFound(_0xbd935c,null))[_0x6bf2('0x20')](function(_0x40dd74){if(_0x40dd74){_0x41b2f7=_0x40dd74;_0x246de6['model']=_[_0x6bf2('0x2b')](db[_0x6bf2('0x4a')]['rawAttributes']);_0x246de6[_0x6bf2('0x2c')]=_[_0x6bf2('0x2b')](_0x1ae484[_0x6bf2('0x2c')]);_0x246de6[_0x6bf2('0x2d')]=_['intersection'](_0x246de6[_0x6bf2('0x2a')],_0x246de6['query']);_0x249df1['attributes']=_['intersection'](_0x246de6['model'],qs[_0x6bf2('0x30')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x30')]));_0x249df1[_0x6bf2('0x2f')]=_0x249df1[_0x6bf2('0x2f')][_0x6bf2('0x31')]?_0x249df1[_0x6bf2('0x2f')]:_0x246de6[_0x6bf2('0x2a')];_0x249df1['order']=qs[_0x6bf2('0x34')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x34')]);_0x249df1[_0x6bf2('0x35')]=qs[_0x6bf2('0x2d')](_[_0x6bf2('0x36')](_0x1ae484['query'],_0x246de6[_0x6bf2('0x2d')]));if(_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x37')]){_0x249df1[_0x6bf2('0x35')]=_[_0x6bf2('0x38')](_0x249df1[_0x6bf2('0x35')],{'$or':_['map'](_0x249df1[_0x6bf2('0x2f')],function(_0x1beadd){var _0x59ed51={};_0x59ed51[_0x1beadd]={'$like':'%'+_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x37')]+'%'};return _0x59ed51;})});}_0x249df1=_[_0x6bf2('0x38')]({},_0x249df1,_0x1ae484[_0x6bf2('0x3a')]);return _0x41b2f7[_0x6bf2('0x4d')](_0x249df1);}})[_0x6bf2('0x20')](function(_0xb169c4){if(_0xb169c4){_0x511f91=_0xb169c4[_0x6bf2('0x31')];if(!_0x1ae484[_0x6bf2('0x2c')]['hasOwnProperty'](_0x6bf2('0x4f'))){_0x249df1[_0x6bf2('0x1a')]=qs['limit'](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x1a')]);_0x249df1[_0x6bf2('0x18')]=qs[_0x6bf2('0x18')](_0x1ae484[_0x6bf2('0x2c')][_0x6bf2('0x18')]);}return _0x41b2f7[_0x6bf2('0x4d')](_0x249df1);}})['then'](function(_0x1271ed){if(_0x1271ed){return _0x1271ed?{'count':_0x511f91,'rows':_0x1271ed}:null;}})['then'](respondWithResult(_0xbd935c,null))[_0x6bf2('0x3c')](handleError(_0xbd935c,null));}; \ No newline at end of file +var _0x6e1a=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','describe','addContacts','CmContact','ids','findOne','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','rawAttributes'];(function(_0x1b58dd,_0x14bc5d){var _0x3511e9=function(_0x3aedd2){while(--_0x3aedd2){_0x1b58dd['push'](_0x1b58dd['shift']());}};_0x3511e9(++_0x14bc5d);}(_0x6e1a,0x64));var _0xa6e1=function(_0x3f44c0,_0xdc21d1){_0x3f44c0=_0x3f44c0-0x0;var _0x18fa0f=_0x6e1a[_0x3f44c0];return _0x18fa0f;};'use strict';var emlformat=require(_0xa6e1('0x0'));var rimraf=require(_0xa6e1('0x1'));var zipdir=require(_0xa6e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6e1('0x3'));var moment=require('moment');var BPromise=require(_0xa6e1('0x4'));var Mustache=require(_0xa6e1('0x5'));var util=require(_0xa6e1('0x6'));var path=require('path');var sox=require(_0xa6e1('0x7'));var csv=require(_0xa6e1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6e1('0x9'));var _=require(_0xa6e1('0xa'));var squel=require('squel');var crypto=require(_0xa6e1('0xb'));var jsforce=require(_0xa6e1('0xc'));var deskjs=require(_0xa6e1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6e1('0xe'));var Redis=require(_0xa6e1('0xf'));var authService=require(_0xa6e1('0x10'));var qs=require(_0xa6e1('0x11'));var as=require(_0xa6e1('0x12'));var hardwareService=require(_0xa6e1('0x13'));var logger=require(_0xa6e1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa6e1('0x15'));var licenseUtil=require(_0xa6e1('0x16'));var db=require(_0xa6e1('0x17'))['db'];function respondWithStatusCode(_0x636898,_0xf49172){_0xf49172=_0xf49172||0xcc;return function(_0x4aceb3){if(_0x4aceb3){return _0x636898['sendStatus'](_0xf49172);}return _0x636898[_0xa6e1('0x18')](_0xf49172)[_0xa6e1('0x19')]();};}function respondWithResult(_0x5535d0,_0x424abf){_0x424abf=_0x424abf||0xc8;return function(_0x33d60f){if(_0x33d60f){return _0x5535d0[_0xa6e1('0x18')](_0x424abf)[_0xa6e1('0x1a')](_0x33d60f);}};}function respondWithFilteredResult(_0x4d2af8,_0xbb54eb){return function(_0x90ae3){if(_0x90ae3){var _0x434b35=typeof _0xbb54eb[_0xa6e1('0x1b')]===_0xa6e1('0x1c')&&typeof _0xbb54eb[_0xa6e1('0x1d')]===_0xa6e1('0x1c');var _0xe73e6c=_0x90ae3[_0xa6e1('0x1e')];var _0x49811b=_0x434b35?0x0:_0xbb54eb[_0xa6e1('0x1b')];var _0x44cc17=_0x434b35?_0x90ae3['count']:_0xbb54eb[_0xa6e1('0x1b')]+_0xbb54eb[_0xa6e1('0x1d')];var _0x20771a;if(_0x44cc17>=_0xe73e6c){_0x44cc17=_0xe73e6c;_0x20771a=0xc8;}else{_0x20771a=0xce;}_0x4d2af8[_0xa6e1('0x18')](_0x20771a);return _0x4d2af8['set'](_0xa6e1('0x1f'),_0x49811b+'-'+_0x44cc17+'/'+_0xe73e6c)['json'](_0x90ae3);}return null;};}function patchUpdates(_0x39d9fa){return function(_0x23f693){try{jsonpatch[_0xa6e1('0x20')](_0x23f693,_0x39d9fa,!![]);}catch(_0x58028c){return BPromise[_0xa6e1('0x21')](_0x58028c);}return _0x23f693[_0xa6e1('0x22')]();};}function saveUpdates(_0x33824b,_0x455c00){return function(_0x12de3e){if(_0x12de3e){return _0x12de3e[_0xa6e1('0x23')](_0x33824b)['then'](function(_0x4b5f50){return _0x4b5f50;});}return null;};}function removeEntity(_0x1a8a0e,_0x191601){return function(_0x58e741){if(_0x58e741){return _0x58e741[_0xa6e1('0x24')]()[_0xa6e1('0x25')](function(){var _0x52e1e7=_0x58e741[_0xa6e1('0x26')]({'plain':!![]});var _0x488da5=_0xa6e1('0x27');return db[_0xa6e1('0x28')][_0xa6e1('0x24')]({'where':{'type':_0x488da5,'resourceId':_0x52e1e7['id']}})[_0xa6e1('0x25')](function(){return _0x58e741;});})['then'](function(){_0x1a8a0e['status'](0xcc)[_0xa6e1('0x19')]();});}};}function handleEntityNotFound(_0x2097b0,_0x1648d7){return function(_0x155aca){if(!_0x155aca){_0x2097b0['sendStatus'](0x194);}return _0x155aca;};}function handleError(_0x5a3954,_0x1a2f84){_0x1a2f84=_0x1a2f84||0x1f4;return function(_0x37e4bb){logger[_0xa6e1('0x29')](_0x37e4bb['stack']);if(_0x37e4bb[_0xa6e1('0x2a')]){delete _0x37e4bb[_0xa6e1('0x2a')];}_0x5a3954[_0xa6e1('0x18')](_0x1a2f84)[_0xa6e1('0x2b')](_0x37e4bb);};}exports[_0xa6e1('0x2c')]=function(_0x24950b,_0x192e16){var _0x4d157b={},_0x43cabe={},_0x151dfe={'count':0x0,'rows':[]};return db[_0xa6e1('0x2d')]['describe']()[_0xa6e1('0x25')](function(_0x5f4e40){_0x43cabe[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](_0x5f4e40);_0x43cabe[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x24950b[_0xa6e1('0x30')]);_0x43cabe[_0xa6e1('0x31')]=_['intersection'](_0x43cabe[_0xa6e1('0x2e')],_0x43cabe['query']);_0x4d157b[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0x43cabe[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x34')]));_0x4d157b[_0xa6e1('0x32')]=_0x4d157b[_0xa6e1('0x32')][_0xa6e1('0x35')]?_0x4d157b[_0xa6e1('0x32')]:_0x43cabe[_0xa6e1('0x2e')];if(!_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x36')](_0xa6e1('0x37'))){_0x4d157b['limit']=qs[_0xa6e1('0x1d')](_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x1d')]);_0x4d157b[_0xa6e1('0x1b')]=qs[_0xa6e1('0x1b')](_0x24950b['query'][_0xa6e1('0x1b')]);}_0x4d157b[_0xa6e1('0x38')]=qs[_0xa6e1('0x39')](_0x24950b[_0xa6e1('0x30')]['sort']);_0x4d157b[_0xa6e1('0x3a')]=qs[_0xa6e1('0x31')](_[_0xa6e1('0x3b')](_0x24950b[_0xa6e1('0x30')],_0x43cabe['filters']),_0x5f4e40);if(_0x24950b['query'][_0xa6e1('0x3c')]){_0x4d157b['where']=_[_0xa6e1('0x3d')](_0x4d157b['where'],{'$or':_[_0xa6e1('0x3e')](_0x4d157b[_0xa6e1('0x32')],function(_0x3c3c02){var _0x50d571={};_0x50d571[_0x3c3c02]={'$like':'%'+_0x24950b['query'][_0xa6e1('0x3c')]+'%'};return _0x50d571;})});}_0x4d157b=_['merge']({},_0x4d157b,_0x24950b[_0xa6e1('0x3f')]);var _0x1dbb8c={'where':_0x4d157b['where']};return db['CmCompany'][_0xa6e1('0x1e')](_0x1dbb8c)[_0xa6e1('0x25')](function(_0x399e8e){_0x151dfe[_0xa6e1('0x1e')]=_0x399e8e;if(_0x24950b[_0xa6e1('0x30')][_0xa6e1('0x40')]){_0x4d157b[_0xa6e1('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0xa6e1('0x42')](_0x4d157b);})[_0xa6e1('0x25')](function(_0x16c256){_0x151dfe['rows']=_0x16c256;return _0x151dfe;})[_0xa6e1('0x25')](respondWithFilteredResult(_0x192e16,_0x4d157b))[_0xa6e1('0x43')](handleError(_0x192e16,null));})[_0xa6e1('0x43')](handleError(_0x192e16,null));};exports[_0xa6e1('0x44')]=function(_0x597194,_0x2883d4){var _0x5f77cc={'raw':![],'where':{'id':_0x597194['params']['id']}},_0xe9e5b1={};_0xe9e5b1[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](db[_0xa6e1('0x2d')][_0xa6e1('0x45')]);_0xe9e5b1[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x597194[_0xa6e1('0x30')]);_0xe9e5b1['filters']=_[_0xa6e1('0x33')](_0xe9e5b1[_0xa6e1('0x2e')],_0xe9e5b1['query']);_0x5f77cc[_0xa6e1('0x32')]=_['intersection'](_0xe9e5b1[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x597194['query'][_0xa6e1('0x34')]));_0x5f77cc[_0xa6e1('0x32')]=_0x5f77cc[_0xa6e1('0x32')][_0xa6e1('0x35')]?_0x5f77cc[_0xa6e1('0x32')]:_0xe9e5b1[_0xa6e1('0x2e')];if(_0x597194[_0xa6e1('0x30')][_0xa6e1('0x40')]){_0x5f77cc[_0xa6e1('0x41')]=[{'all':!![]}];}_0x5f77cc=_[_0xa6e1('0x3d')]({},_0x5f77cc,_0x597194[_0xa6e1('0x3f')]);return db[_0xa6e1('0x2d')][_0xa6e1('0x46')](_0x5f77cc)[_0xa6e1('0x25')](handleEntityNotFound(_0x2883d4,null))[_0xa6e1('0x25')](respondWithResult(_0x2883d4,null))[_0xa6e1('0x43')](handleError(_0x2883d4,null));};exports[_0xa6e1('0x47')]=function(_0x367c5b,_0x3c8bc7){return db[_0xa6e1('0x2d')][_0xa6e1('0x47')](_0x367c5b[_0xa6e1('0x48')],{})[_0xa6e1('0x25')](function(_0x39bd1c){var _0x1d5240=_0x367c5b[_0xa6e1('0x49')][_0xa6e1('0x26')]({'plain':!![]});if(!_0x1d5240)throw new Error(_0xa6e1('0x4a'));if(_0x1d5240[_0xa6e1('0x4b')]===_0xa6e1('0x49')){var _0x22bfdf=_0x39bd1c[_0xa6e1('0x26')]({'plain':!![]});var _0x60c04d=_0xa6e1('0x27');return db[_0xa6e1('0x4c')][_0xa6e1('0x46')]({'where':{'name':_0x60c04d,'userProfileId':_0x1d5240['userProfileId']},'raw':!![]})[_0xa6e1('0x25')](function(_0xdff156){if(_0xdff156&&_0xdff156[_0xa6e1('0x4d')]===0x0){return db[_0xa6e1('0x28')][_0xa6e1('0x47')]({'name':_0x22bfdf['name'],'resourceId':_0x22bfdf['id'],'type':_0xdff156[_0xa6e1('0x2a')],'sectionId':_0xdff156['id']},{})['then'](function(){return _0x39bd1c;});}else{return _0x39bd1c;}})['catch'](function(_0x2d8345){logger[_0xa6e1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d8345);throw _0x2d8345;});}return _0x39bd1c;})[_0xa6e1('0x25')](respondWithResult(_0x3c8bc7,0xc9))[_0xa6e1('0x43')](handleError(_0x3c8bc7,null));};exports[_0xa6e1('0x23')]=function(_0x3771aa,_0x2954a4){if(_0x3771aa['body']['id']){delete _0x3771aa[_0xa6e1('0x48')]['id'];}return db[_0xa6e1('0x2d')][_0xa6e1('0x46')]({'where':{'id':_0x3771aa[_0xa6e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2954a4,null))[_0xa6e1('0x25')](saveUpdates(_0x3771aa[_0xa6e1('0x48')],null))[_0xa6e1('0x25')](respondWithResult(_0x2954a4,null))[_0xa6e1('0x43')](handleError(_0x2954a4,null));};exports[_0xa6e1('0x24')]=function(_0x572d80,_0x4e00fb){return db[_0xa6e1('0x2d')][_0xa6e1('0x46')]({'where':{'id':_0x572d80[_0xa6e1('0x4e')]['id']}})[_0xa6e1('0x25')](handleEntityNotFound(_0x4e00fb,null))['then'](removeEntity(_0x4e00fb,null))['catch'](handleError(_0x4e00fb,null));};exports[_0xa6e1('0x4f')]=function(_0x349e73,_0xf3f59a){return db[_0xa6e1('0x2d')][_0xa6e1('0x4f')]()[_0xa6e1('0x25')](respondWithResult(_0xf3f59a,null))[_0xa6e1('0x43')](handleError(_0xf3f59a,null));};exports[_0xa6e1('0x50')]=function(_0x668453,_0x4d0478,_0x326bf2){return db[_0xa6e1('0x51')][_0xa6e1('0x46')]({'where':{'id':_0x668453[_0xa6e1('0x4e')]['id']}})[_0xa6e1('0x25')](handleEntityNotFound(_0x4d0478,null))[_0xa6e1('0x25')](function(_0x32b1ea){if(_0x32b1ea){return _0x32b1ea['addContacts'](_0x668453['body'][_0xa6e1('0x52')],_['omit'](_0x668453[_0xa6e1('0x48')],['ids','id'])||{});}})[_0xa6e1('0x25')](respondWithResult(_0x4d0478,null))[_0xa6e1('0x43')](handleError(_0x4d0478,null));};exports['getContacts']=function(_0x56333e,_0x3a17ae,_0x294667){var _0x4b7f8f={};var _0x30860a={};var _0x51ae9b;var _0xaef465;return db[_0xa6e1('0x2d')][_0xa6e1('0x53')]({'where':{'id':_0x56333e[_0xa6e1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a17ae,null))[_0xa6e1('0x25')](function(_0x1a1b8b){if(_0x1a1b8b){_0x51ae9b=_0x1a1b8b;_0x30860a[_0xa6e1('0x2e')]=_[_0xa6e1('0x2f')](db[_0xa6e1('0x51')][_0xa6e1('0x45')]);_0x30860a[_0xa6e1('0x30')]=_[_0xa6e1('0x2f')](_0x56333e[_0xa6e1('0x30')]);_0x30860a[_0xa6e1('0x31')]=_[_0xa6e1('0x33')](_0x30860a[_0xa6e1('0x2e')],_0x30860a[_0xa6e1('0x30')]);_0x4b7f8f[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0x30860a[_0xa6e1('0x2e')],qs[_0xa6e1('0x34')](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x34')]));_0x4b7f8f['attributes']=_0x4b7f8f[_0xa6e1('0x32')]['length']?_0x4b7f8f['attributes']:_0x30860a[_0xa6e1('0x2e')];_0x4b7f8f[_0xa6e1('0x38')]=qs['sort'](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x39')]);_0x4b7f8f['where']=qs[_0xa6e1('0x31')](_[_0xa6e1('0x3b')](_0x56333e[_0xa6e1('0x30')],_0x30860a[_0xa6e1('0x31')]));if(_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x3c')]){_0x4b7f8f['where']=_[_0xa6e1('0x3d')](_0x4b7f8f['where'],{'$or':_[_0xa6e1('0x3e')](_0x4b7f8f[_0xa6e1('0x32')],function(_0x5c859d){var _0x2e4cd4={};_0x2e4cd4[_0x5c859d]={'$like':'%'+_0x56333e['query'][_0xa6e1('0x3c')]+'%'};return _0x2e4cd4;})});}_0x4b7f8f=_[_0xa6e1('0x3d')]({},_0x4b7f8f,_0x56333e[_0xa6e1('0x3f')]);return _0x51ae9b[_0xa6e1('0x54')](_0x4b7f8f);}})[_0xa6e1('0x25')](function(_0x4bc05c){if(_0x4bc05c){_0xaef465=_0x4bc05c['length'];if(!_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x36')](_0xa6e1('0x37'))){_0x4b7f8f[_0xa6e1('0x1d')]=qs[_0xa6e1('0x1d')](_0x56333e[_0xa6e1('0x30')][_0xa6e1('0x1d')]);_0x4b7f8f[_0xa6e1('0x1b')]=qs['offset'](_0x56333e['query'][_0xa6e1('0x1b')]);}return _0x51ae9b['getContacts'](_0x4b7f8f);}})['then'](function(_0x2089f5){if(_0x2089f5){return _0x2089f5?{'count':_0xaef465,'rows':_0x2089f5}:null;}})[_0xa6e1('0x25')](respondWithResult(_0x3a17ae,null))[_0xa6e1('0x43')](handleError(_0x3a17ae,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d1a5013..09d5912 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 _0xda16=['exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x3e69c7,_0x1b9730){var _0x5e5259=function(_0x2312bc){while(--_0x2312bc){_0x3e69c7['push'](_0x3e69c7['shift']());}};_0x5e5259(++_0x1b9730);}(_0xda16,0x65));var _0x6da1=function(_0x4283e1,_0x80344){_0x4283e1=_0x4283e1-0x0;var _0x201855=_0xda16[_0x4283e1];return _0x201855;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require(_0x6da1('0x4'));var BPromise=require(_0x6da1('0x5'));var rp=require(_0x6da1('0x6'));var fs=require('fs');var path=require(_0x6da1('0x7'));var rimraf=require(_0x6da1('0x8'));var config=require(_0x6da1('0x9'));var attributes=require(_0x6da1('0xa'));module[_0x6da1('0xb')]=function(_0x31f417,_0x4c9b05){return _0x31f417['define'](_0x6da1('0xc'),attributes,{'tableName':_0x6da1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2002=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','CmCompany'];(function(_0x2a9576,_0x2676e8){var _0x2f2342=function(_0x51f0a4){while(--_0x51f0a4){_0x2a9576['push'](_0x2a9576['shift']());}};_0x2f2342(++_0x2676e8);}(_0x2002,0x1b1));var _0x2200=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x2002[_0x44a3b0];return _0x39e6f6;};'use strict';var _=require(_0x2200('0x0'));var util=require(_0x2200('0x1'));var logger=require(_0x2200('0x2'))(_0x2200('0x3'));var moment=require(_0x2200('0x4'));var BPromise=require(_0x2200('0x5'));var rp=require(_0x2200('0x6'));var fs=require('fs');var path=require(_0x2200('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x2200('0x8')]=function(_0x37d836,_0x5b218d){return _0x37d836[_0x2200('0x9')](_0x2200('0xa'),attributes,{'tableName':_0x2200('0xb'),'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 d358261..c8c5b35 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 _0x7c73=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3051ce,_0x32bb38){var _0x4226e4=function(_0x24b6ca){while(--_0x24b6ca){_0x3051ce['push'](_0x3051ce['shift']());}};_0x4226e4(++_0x32bb38);}(_0x7c73,0xc1));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var util=require(_0x37c7('0x1'));var moment=require('moment');var BPromise=require(_0x37c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37c7('0x3'));var db=require(_0x37c7('0x4'))['db'];var utils=require(_0x37c7('0x5'));var logger=require(_0x37c7('0x6'))(_0x37c7('0x7'));var config=require(_0x37c7('0x8'));var jayson=require(_0x37c7('0x9'));var client=jayson[_0x37c7('0xa')][_0x37c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1491b5,_0x3d3fc0,_0x3506cf){return new BPromise(function(_0x146dd0,_0x198f97){return client[_0x37c7('0xc')](_0x1491b5,_0x3506cf)['then'](function(_0x290a3f){logger['info'](_0x37c7('0xd'),_0x3d3fc0,_0x37c7('0xe'));logger[_0x37c7('0xf')](_0x37c7('0x10'),_0x3d3fc0,'request\x20sent',JSON[_0x37c7('0x11')](_0x290a3f));if(_0x290a3f[_0x37c7('0x12')]){if(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x13')]===0x1f4){logger[_0x37c7('0x12')]('CmCompany,\x20%s,\x20%s',_0x3d3fc0,_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);return _0x198f97(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);}logger[_0x37c7('0x12')](_0x37c7('0xd'),_0x3d3fc0,_0x290a3f['error'][_0x37c7('0x14')]);return _0x146dd0(_0x290a3f[_0x37c7('0x12')][_0x37c7('0x14')]);}else{logger[_0x37c7('0x15')](_0x37c7('0xd'),_0x3d3fc0,_0x37c7('0xe'));_0x146dd0(_0x290a3f[_0x37c7('0x16')]['message']);}})[_0x37c7('0x17')](function(_0x330255){logger[_0x37c7('0x12')](_0x37c7('0xd'),_0x3d3fc0,_0x330255);_0x198f97(_0x330255);});});} \ No newline at end of file +var _0xdcab=['then','info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/logger','jayson/promise','client','http','request'];(function(_0x239622,_0x1f38db){var _0x46cd02=function(_0x228687){while(--_0x228687){_0x239622['push'](_0x239622['shift']());}};_0x46cd02(++_0x1f38db);}(_0xdcab,0x13b));var _0xbdca=function(_0x47b024,_0x43ec89){_0x47b024=_0x47b024-0x0;var _0x2a61f6=_0xdcab[_0x47b024];return _0x2a61f6;};'use strict';var _=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var moment=require('moment');var BPromise=require(_0xbdca('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(_0xbdca('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdca('0x4'));var client=jayson[_0xbdca('0x5')][_0xbdca('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33abdc,_0x413d9f,_0x2354bf){return new BPromise(function(_0xd282c1,_0x398645){return client[_0xbdca('0x7')](_0x33abdc,_0x2354bf)[_0xbdca('0x8')](function(_0x1ecfeb){logger[_0xbdca('0x9')]('CmCompany,\x20%s,\x20%s',_0x413d9f,'request\x20sent');logger[_0xbdca('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x413d9f,_0xbdca('0xb'),JSON[_0xbdca('0xc')](_0x1ecfeb));if(_0x1ecfeb[_0xbdca('0xd')]){if(_0x1ecfeb[_0xbdca('0xd')][_0xbdca('0xe')]===0x1f4){logger[_0xbdca('0xd')](_0xbdca('0xf'),_0x413d9f,_0x1ecfeb[_0xbdca('0xd')]['message']);return _0x398645(_0x1ecfeb[_0xbdca('0xd')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x413d9f,_0x1ecfeb[_0xbdca('0xd')]['message']);return _0xd282c1(_0x1ecfeb[_0xbdca('0xd')][_0xbdca('0x10')]);}else{logger[_0xbdca('0x9')]('CmCompany,\x20%s,\x20%s',_0x413d9f,_0xbdca('0xb'));_0xd282c1(_0x1ecfeb[_0xbdca('0x11')][_0xbdca('0x10')]);}})[_0xbdca('0x12')](function(_0x41eb99){logger[_0xbdca('0xd')]('CmCompany,\x20%s,\x20%s',_0x413d9f,_0x41eb99);_0x398645(_0x41eb99);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d24bf53..a584e4e 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 _0xfb52=['fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x7c13a0,_0x8c4473){var _0x29ab0c=function(_0x4ad5a5){while(--_0x4ad5a5){_0x7c13a0['push'](_0x7c13a0['shift']());}};_0x29ab0c(++_0x8c4473);}(_0xfb52,0x7e));var _0x2fb5=function(_0x33f3a5,_0x4bd444){_0x33f3a5=_0x33f3a5-0x0;var _0x504c18=_0xfb52[_0x33f3a5];return _0x504c18;};'use strict';var multer=require(_0x2fb5('0x0'));var util=require(_0x2fb5('0x1'));var path=require(_0x2fb5('0x2'));var timeout=require(_0x2fb5('0x3'));var express=require(_0x2fb5('0x4'));var router=express[_0x2fb5('0x5')]();var fs_extra=require(_0x2fb5('0x6'));var auth=require(_0x2fb5('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x2fb5('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fb5('0x9')]);router['get'](_0x2fb5('0xa'),auth[_0x2fb5('0xb')](),controller[_0x2fb5('0xc')]);router[_0x2fb5('0x8')](_0x2fb5('0xd'),auth[_0x2fb5('0xb')](),controller[_0x2fb5('0xe')]);router[_0x2fb5('0x8')](_0x2fb5('0xf'),auth[_0x2fb5('0xb')](),controller['getContacts']);router[_0x2fb5('0x10')]('/',auth[_0x2fb5('0xb')](),controller['create']);router[_0x2fb5('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x2fb5('0x11')]);router[_0x2fb5('0x12')](_0x2fb5('0xd'),auth[_0x2fb5('0xb')](),controller['update']);router[_0x2fb5('0x13')]('/:id',auth[_0x2fb5('0xb')](),controller[_0x2fb5('0x14')]);module[_0x2fb5('0x15')]=router; \ No newline at end of file +var _0x9a0f=['update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x9a0f,0x15b));var _0xf9a0=function(_0x18babc,_0x2e20c1){_0x18babc=_0x18babc-0x0;var _0x5cbfe3=_0x9a0f[_0x18babc];return _0x5cbfe3;};'use strict';var multer=require(_0xf9a0('0x0'));var util=require(_0xf9a0('0x1'));var path=require('path');var timeout=require(_0xf9a0('0x2'));var express=require(_0xf9a0('0x3'));var router=express[_0xf9a0('0x4')]();var fs_extra=require(_0xf9a0('0x5'));var auth=require(_0xf9a0('0x6'));var interaction=require(_0xf9a0('0x7'));var config=require(_0xf9a0('0x8'));var controller=require(_0xf9a0('0x9'));router[_0xf9a0('0xa')]('/',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0xc')]);router[_0xf9a0('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xf9a0('0xd')]);router[_0xf9a0('0xa')](_0xf9a0('0xe'),auth[_0xf9a0('0xb')](),controller[_0xf9a0('0xf')]);router[_0xf9a0('0xa')]('/:id/contacts',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x10')]);router[_0xf9a0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9a0('0x11')](_0xf9a0('0x12'),auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x13')]);router[_0xf9a0('0x14')]('/:id',auth[_0xf9a0('0xb')](),controller[_0xf9a0('0x15')]);router['delete'](_0xf9a0('0xe'),auth['isAuthenticated'](),controller[_0xf9a0('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 3e35343..34f7397 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 _0xe391=['sequelize','exports','STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x52de57,_0x1da7c2){var _0x1d9499=function(_0x1e60e4){while(--_0x1e60e4){_0x52de57['push'](_0x52de57['shift']());}};_0x1d9499(++_0x1da7c2);}(_0xe391,0x1cd));var _0x1e39=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xe391[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x1e39('0x0'));var Sequelize=require(_0x1e39('0x1'));module[_0x1e39('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1e39('0x3')]},'postalCode':{'type':Sequelize[_0x1e39('0x3')]},'city':{'type':Sequelize[_0x1e39('0x3')]},'country':{'type':Sequelize[_0x1e39('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1e39('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1e39('0x3')]},'email':{'type':Sequelize[_0x1e39('0x3')]},'url':{'type':Sequelize[_0x1e39('0x3')]},'facebook':{'type':Sequelize[_0x1e39('0x3')]},'fb_data':{'type':Sequelize[_0x1e39('0x3')]},'twitter':{'type':Sequelize[_0x1e39('0x3')]},'skype':{'type':Sequelize[_0x1e39('0x3')]},'teams':{'type':Sequelize[_0x1e39('0x3')]},'viber':{'type':Sequelize[_0x1e39('0x3')]},'line':{'type':Sequelize[_0x1e39('0x3')]},'wechat':{'type':Sequelize[_0x1e39('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1e39('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x1e39('0x3')]},'priority':{'type':Sequelize[_0x1e39('0x4')](0x2)[_0x1e39('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x1e39('0x6')]},'dialTimezone':{'type':Sequelize[_0x1e39('0x3')]},'utcOffset':{'type':Sequelize[_0x1e39('0x4')]}}; \ No newline at end of file +var _0x99e0=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5e4323,_0x34cb4c){var _0x2813cb=function(_0x43c023){while(--_0x43c023){_0x5e4323['push'](_0x5e4323['shift']());}};_0x2813cb(++_0x34cb4c);}(_0x99e0,0x12c));var _0x099e=function(_0x170cdd,_0x35d83b){_0x170cdd=_0x170cdd-0x0;var _0x5a41d9=_0x99e0[_0x170cdd];return _0x5a41d9;};'use strict';var _=require('lodash');var Sequelize=require(_0x099e('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x099e('0x1')]},'street':{'type':Sequelize[_0x099e('0x1')]},'postalCode':{'type':Sequelize[_0x099e('0x1')]},'city':{'type':Sequelize[_0x099e('0x1')]},'country':{'type':Sequelize[_0x099e('0x1')]},'dateOfBirth':{'type':Sequelize[_0x099e('0x1')]},'description':{'type':Sequelize[_0x099e('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x099e('0x1')]},'fax':{'type':Sequelize[_0x099e('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x099e('0x1')]},'fb_data':{'type':Sequelize[_0x099e('0x1')]},'twitter':{'type':Sequelize[_0x099e('0x1')]},'skype':{'type':Sequelize[_0x099e('0x1')]},'teams':{'type':Sequelize[_0x099e('0x1')]},'viber':{'type':Sequelize[_0x099e('0x1')]},'line':{'type':Sequelize[_0x099e('0x1')]},'wechat':{'type':Sequelize[_0x099e('0x1')]},'telegram':{'type':Sequelize[_0x099e('0x1')]},'UserId':{'type':Sequelize[_0x099e('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x099e('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x099e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x099e('0x5')]},'dialTimezone':{'type':Sequelize[_0x099e('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index fa80a67..b95be2d 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 _0xd6b4=['TagIds','Tags','rows','catch','describe','tags','columnName','displayName','analytics','findAll','custom','values','merge','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','findOrCreate','spread','contact','show','params','ItemType','omit','$and','pickBy','format','cf_%d','setFields','id\x20=\x20?','toParam','phone','pick','options','getTags','setTags','ids','ContactItemType','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','rawAttributes','getHopperHistories','includeAll','getHopperFinals','ContactId','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','CompanyId','upload','createReadStream','parse','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','voice','-createdAt','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','fullname','alias','startCase','Website','Account','closed','closedAt','thirdDisposition','UserId','key','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','sendStatus','name','send','index','CmContact','length','startsWith','cf_','push','CmCustomField','findOne','all','fieldType','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','select','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','isNil','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','forEach','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','user','getLists','isEmpty','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x45286e,_0x5cb2ef){var _0x100e4e=function(_0x22e554){while(--_0x22e554){_0x45286e['push'](_0x45286e['shift']());}};_0x100e4e(++_0x5cb2ef);}(_0xd6b4,0x1ea));var _0x4d6b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd6b4[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x4d6b('0x0'));var BPromise=require('bluebird');var util=require(_0x4d6b('0x1'));var path=require(_0x4d6b('0x2'));var fs=require('fs');var _=require(_0x4d6b('0x3'));var squel=require(_0x4d6b('0x4'));var Papa=require(_0x4d6b('0x5'));var Redis=require(_0x4d6b('0x6'));var qs=require(_0x4d6b('0x7'));var as=require(_0x4d6b('0x8'));var logger=require(_0x4d6b('0x9'))('api');var config=require(_0x4d6b('0xa'));var shared=require(_0x4d6b('0xb'));var db=require(_0x4d6b('0xc'))['db'];config[_0x4d6b('0xd')]=_['defaults'](config[_0x4d6b('0xd')],{'host':_0x4d6b('0xe'),'port':0x18eb});var socket=require(_0x4d6b('0xf'))(new Redis(config[_0x4d6b('0xd')]));require(_0x4d6b('0x10'))[_0x4d6b('0x11')](socket);function respondWithResult(_0x1fe78f,_0x495471){_0x495471=_0x495471||0xc8;return function(_0x1d9801){if(_0x1d9801){return _0x1fe78f[_0x4d6b('0x12')](_0x495471)['json'](_0x1d9801);}};}function respondWithFilteredResult(_0x5a9780,_0x3b36f5){return function(_0x379e18){if(_0x379e18){var _0x563888=typeof _0x3b36f5['offset']===_0x4d6b('0x13')&&typeof _0x3b36f5[_0x4d6b('0x14')]===_0x4d6b('0x13');var _0x121f23=_0x379e18[_0x4d6b('0x15')];var _0x36b13e=_0x563888?0x0:_0x3b36f5[_0x4d6b('0x16')];var _0x2459aa=_0x563888?_0x379e18[_0x4d6b('0x15')]:_0x3b36f5[_0x4d6b('0x16')]+_0x3b36f5[_0x4d6b('0x14')];var _0x3bcfeb;if(_0x2459aa>=_0x121f23){_0x2459aa=_0x121f23;_0x3bcfeb=0xc8;}else{_0x3bcfeb=0xce;}_0x5a9780[_0x4d6b('0x12')](_0x3bcfeb);return _0x5a9780[_0x4d6b('0x17')](_0x4d6b('0x18'),_0x36b13e+'-'+_0x2459aa+'/'+_0x121f23)[_0x4d6b('0x19')](_0x379e18);}return null;};}function saveUpdates(_0x1ee6f6){return function(_0x2c54c4){if(_0x2c54c4){return _0x2c54c4[_0x4d6b('0x1a')](_0x1ee6f6)[_0x4d6b('0x1b')](function(_0x26b6d8){return _0x26b6d8;});}return null;};}function removeEntity(_0x383a45){return function(_0x509507){if(_0x509507){return _0x509507[_0x4d6b('0x1c')]()[_0x4d6b('0x1b')](function(){_0x383a45[_0x4d6b('0x12')](0xcc)[_0x4d6b('0x1d')]();});}};}function handleEntityNotFound(_0x2596c0){return function(_0x1e57b2){if(!_0x1e57b2){_0x2596c0[_0x4d6b('0x1e')](0x194);}return _0x1e57b2;};}function handleError(_0x292e83,_0x4304a6){_0x4304a6=_0x4304a6||0x1f4;return function(_0x248e60){logger['error'](_0x248e60['stack']);if(_0x248e60[_0x4d6b('0x1f')]){delete _0x248e60[_0x4d6b('0x1f')];}_0x292e83[_0x4d6b('0x12')](_0x4304a6)[_0x4d6b('0x20')](_0x248e60);};}exports[_0x4d6b('0x21')]=function(_0x3f74b4,_0x5d5ca6){var _0x19c503={},_0x309f07={},_0x484fb4={'count':0x0,'rows':[]};return db[_0x4d6b('0x22')]['describe']()[_0x4d6b('0x1b')](function(_0x49e5ce){var _0x9826a5=[];for(var _0x388c47=0x0;_0x388c470x1){_0x5e9f2a['or'](_0x4d6b('0x62'),qs[_0x4d6b('0x63')](_0x81587e),null);}else{if(qs['isNumeric'](_0x81587e)){_0x5e9f2a['or'](_0x4d6b('0x64'),_0x81587e+'%');_0x5e9f2a['or']('c.phone\x20LIKE\x20?',_0x81587e+'%');_0x5e9f2a['or']('c.mobile\x20LIKE\x20?',_0x81587e+'%');_0x5e9f2a['or']('c.fax\x20LIKE\x20?',_0x81587e+'%');}else if(qs[_0x4d6b('0x65')](_0x81587e)){_0x5e9f2a['or'](_0x4d6b('0x66'),_0x81587e+'%');}else{_0x5e9f2a['or'](_0x4d6b('0x67'),'%'+_0x81587e+'%');_0x5e9f2a['or'](_0x4d6b('0x68'),'%'+_0x81587e+'%');_0x5e9f2a['or']('c.email\x20LIKE\x20?','%'+_0x81587e+'%');}}}}_0x220a76[_0x4d6b('0x37')](_0x5e9f2a);_0x220a76[_0x4d6b('0x69')]('c.id');var _0x483644={'type':db[_0x4d6b('0x6a')]['QueryTypes'][_0x4d6b('0x6b')],'raw':!![]};var _0x537b44=_0x220a76[_0x4d6b('0x6c')]()[_0x4d6b('0x38')]('c.id');if(_0x19c503[_0x4d6b('0x35')]){_0x19c503[_0x4d6b('0x35')][_0x4d6b('0x5f')](function(_0x13a71c){_0x220a76['order']('c.'+_0x13a71c[0x0],_0x13a71c[0x1]===_0x4d6b('0x6d')?![]:!![]);});}if(!_['isEmpty'](_0x283f57)){_0x220a76[_0x4d6b('0x6e')](_0x4bd360);_0x537b44[_0x4d6b('0x37')](_0x4d6b('0x6f'),_0x283f57);}BPromise[_0x4d6b('0x70')]()[_0x4d6b('0x1b')](function(){if(!_0xe749b7)return;if(_0x3f74b4['user'][_0x4d6b('0x71')]!==_0x4d6b('0x72'))return;if(!_['some'](_0xe749b7['conditions'],['field','User'])){return _0x3f74b4[_0x4d6b('0x73')][_0x4d6b('0x74')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6ca2c0){if(_[_0x4d6b('0x75')](_0x6ca2c0)){_0x537b44[_0x4d6b('0x37')](_0x4d6b('0x76'));_0x220a76[_0x4d6b('0x37')](_0x4d6b('0x76'));}else{_0x537b44['where']('c.ListId\x20IN\x20?',_[_0x4d6b('0x4a')](_0x6ca2c0,'id'));_0x220a76[_0x4d6b('0x37')]('c.ListId\x20IN\x20?',_[_0x4d6b('0x4a')](_0x6ca2c0,'id'));}});}})[_0x4d6b('0x1b')](function(){if(_0x3f74b4[_0x4d6b('0x73')]['role']===_0x4d6b('0x72')&&!_0xe749b7&&!_0x3f74b4['query'][_0x4d6b('0x59')])return[];return db[_0x4d6b('0x77')][_0x4d6b('0x2e')](_0x537b44[_0x4d6b('0x78')](),_0x483644);})['then'](function(_0x4867b0){_0x484fb4[_0x4d6b('0x15')]=_0x4867b0['length'];if(_0x484fb4[_0x4d6b('0x15')]===0x0)return[];return db[_0x4d6b('0x77')][_0x4d6b('0x2e')](_0x5ea0de['toString'](),_0x483644)['then'](function(_0x102193){_0x56cd2b=_[_0x4d6b('0x79')](_0x102193,'id');_0x483644=_['merge'](_0x483644,{'model':db[_0x4d6b('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f74b4[_0x4d6b('0x2e')]['fields']){_0x19c503['attributes'][_0x4d6b('0x5f')](function(_0x4fbf1d){_0x220a76[_0x4d6b('0x38')]('c.'+_0x4fbf1d);});}else{_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x7a'));_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x7b'));_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x7c'));_0x220a76['field'](_0x4d6b('0x7d'));_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x7e'));_0x220a76[_0x4d6b('0x38')]('c.fax');_0x220a76['field']('c.email');_0x220a76[_0x4d6b('0x38')]('c.ListId');_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x7f'));_0x220a76[_0x4d6b('0x38')]('c.deletedAt');_0x220a76[_0x4d6b('0x38')](_0x4d6b('0x80'));_0x220a76['field'](_0x4d6b('0x81'),_0x4d6b('0x82'));}if(_0x19c503['limit'])_0x220a76[_0x4d6b('0x14')](_0x19c503[_0x4d6b('0x14')]);if(_0x19c503[_0x4d6b('0x16')])_0x220a76[_0x4d6b('0x16')](_0x19c503['offset']);return db[_0x4d6b('0x77')][_0x4d6b('0x2e')](_0x220a76[_0x4d6b('0x78')](),_0x483644);});})['then'](function(_0x243c00){_0x243c00[_0x4d6b('0x5f')](function(_0x2915bb){if(_0x2915bb['TagIds']){_0x2915bb['Tags']=[];_0x2915bb[_0x4d6b('0x82')]['split'](',')[_0x4d6b('0x5f')](function(_0x27f086){_0x2915bb[_0x4d6b('0x83')][_0x4d6b('0x26')](_0x56cd2b[_0x27f086]);});}delete _0x2915bb[_0x4d6b('0x82')];});_0x484fb4[_0x4d6b('0x84')]=_0x243c00;return _0x484fb4;})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x5d5ca6,_0x19c503));})[_0x4d6b('0x85')](handleError(_0x5d5ca6,null));};exports[_0x4d6b('0x1c')]=function(_0x453275,_0x529aef){return db['CmContact'][_0x4d6b('0x46')]({'where':{'id':_0x453275['params']['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x529aef,null))[_0x4d6b('0x1b')](removeEntity(_0x529aef,null))[_0x4d6b('0x85')](handleError(_0x529aef,null));};exports[_0x4d6b('0x86')]=function(_0x55baf7,_0x279e67){return db[_0x4d6b('0x22')][_0x4d6b('0x86')]()['then'](function(_0x1006c2){delete _0x1006c2[_0x4d6b('0x87')];for(var _0x3e350f=0x0;_0x3e350f0x0){return new Promise(function(_0x5f4904,_0x26ead){var _0x27efaa=[];for(var _0x449562=0x0;_0x449562<_0x396af2[_0x4d6b('0x23')];_0x449562++){_0x27efaa[_0x4d6b('0x26')](insertAdditionalPhones(_0x396af2[_0x449562][_0x4d6b('0xb4')],_0x396af2[_0x449562]['additionalPhones']));}Promise['all'](_0x27efaa)[_0x4d6b('0x1b')](function(){_0x5f4904(0x1);});})[_0x4d6b('0x1b')](function(){return{'success':_0x8229ca,'failure':_0x326639,'duplicates':_0x4a2be0};});}else{return{'success':_0x8229ca,'failure':_0x326639,'duplicates':_0x4a2be0};}}})['then'](respondWithResult(_0x564ead,0xc9))[_0x4d6b('0x85')](handleError(_0x564ead,null));};exports[_0x4d6b('0xb5')]=function(_0x103608,_0x3d6a75){var _0x335967;return db['CmContact'][_0x4d6b('0x86')]()[_0x4d6b('0x1b')](function(_0x242777){return db['CmContact']['find']({'where':{'id':_0x103608[_0x4d6b('0xb6')]['id']},'include':[{'model':db[_0x4d6b('0x47')],'as':_0x4d6b('0x83'),'attributes':['id',_0x4d6b('0x1f'),'color'],'required':_0x103608[_0x4d6b('0x2e')]['tag']?!![]:![]},{'model':db[_0x4d6b('0xa2')],'as':'Phones','where':{'CmContactId':_0x103608[_0x4d6b('0xb6')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x4d6b('0xb7')}]}],'order':[db['sequelize']['literal']('Phones.OrderBy')],'attributes':_[_0x4d6b('0x2d')](_0x242777)});})[_0x4d6b('0x1b')](function(_0x120897){if(!_[_0x4d6b('0x57')](_0x120897)){_0x335967=_0x120897[_0x4d6b('0x90')]({'plain':!![]});var _0x27a6a7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x120897&&_0x120897[_0x4d6b('0x59')]){if(_0x120897[_0x4d6b('0x59')]){_0x27a6a7['where']['$and']['push']({'ListId':{'$ne':_0x120897[_0x4d6b('0x59')]}});}}return db[_0x4d6b('0x27')][_0x4d6b('0x8b')](_0x27a6a7);}})[_0x4d6b('0x1b')](function(_0x2b3f72){if(!_[_0x4d6b('0x57')](_0x2b3f72)){return _[_0x4d6b('0xb8')](_0x335967,_['map'](_0x2b3f72,function(_0x2ed70c){return util['format']('cf_%d',_0x2ed70c['id']);}));}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x3d6a75,null))[_0x4d6b('0x1b')](respondWithResult(_0x3d6a75,null))[_0x4d6b('0x85')](handleError(_0x3d6a75,null));};exports[_0x4d6b('0x1a')]=function(_0x4756ce,_0xc4aee0){var _0x2a1575;if(_0x4756ce[_0x4d6b('0x8f')]['id']){delete _0x4756ce[_0x4d6b('0x8f')]['id'];}if(!_[_0x4d6b('0x57')](_0x4756ce[_0x4d6b('0x8f')][_0x4d6b('0xab')])){var _0x49fc08=_0x4756ce[_0x4d6b('0x8f')][_0x4d6b('0xab')];if(!_['isNil'](shared[_0x4d6b('0xac')][_0x49fc08]))_0x4756ce[_0x4d6b('0x8f')][_0x4d6b('0xad')]=shared[_0x4d6b('0xac')][_0x49fc08][_0x4d6b('0xad')];}return db[_0x4d6b('0x22')][_0x4d6b('0x46')]({'where':{'id':_0x4756ce[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0xc4aee0,null))[_0x4d6b('0x1b')](saveUpdates(_0x4756ce['body'],null))['then'](function(_0x2b47fb){_0x2a1575=_0x2b47fb;var _0x539381={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2b47fb&&_0x2b47fb[_0x4d6b('0x59')]){if(_0x2b47fb[_0x4d6b('0x59')]){_0x539381[_0x4d6b('0x37')][_0x4d6b('0xb9')]['push']({'ListId':{'$ne':_0x2b47fb[_0x4d6b('0x59')]}});}}return db[_0x4d6b('0x27')]['findAll'](_0x539381);})[_0x4d6b('0x1b')](function(_0x13fd43){if(_0x13fd43){return _[_0x4d6b('0xb8')](_[_0x4d6b('0xba')](_0x4756ce[_0x4d6b('0x8f')],function(_0x21e2ff,_0x42ec9e){return _[_0x4d6b('0x24')](_0x42ec9e,_0x4d6b('0x25'));}),_[_0x4d6b('0x4a')](_0x13fd43,function(_0x24a3af){return util[_0x4d6b('0xbb')](_0x4d6b('0xbc'),_0x24a3af['id']);}));}})['then'](function(_0x383050){if(_0x383050&&!_[_0x4d6b('0x75')](_0x383050)){var _0x540d06=squel[_0x4d6b('0x1a')]()['table']('cm_contacts')[_0x4d6b('0xbd')](_0x383050)[_0x4d6b('0x37')](_0x4d6b('0xbe'),_0x4756ce['params']['id'])[_0x4d6b('0xbf')]();return db[_0x4d6b('0x77')][_0x4d6b('0x2e')](_0x540d06[_0x4d6b('0x55')],{'replacements':_0x540d06[_0x4d6b('0x8d')]});}})['then'](function(){if(_0x4756ce[_0x4d6b('0x8f')]['phone']&&_0x2a1575){return db[_0x4d6b('0x95')][_0x4d6b('0x1a')]({'phone':_0x4756ce[_0x4d6b('0x8f')][_0x4d6b('0xc0')],'OrderBy':0x0},{'where':{'ContactId':_0x2a1575['id']}});}})[_0x4d6b('0x1b')](function(){return _0x2a1575;})[_0x4d6b('0x1b')](respondWithResult(_0xc4aee0,null))[_0x4d6b('0x85')](handleError(_0xc4aee0,null));};exports['getTags']=function(_0x245d53,_0x4d6f69){var _0x263674={};var _0x29d63c={};var _0xcc4d50;var _0xc2f6f0;return db[_0x4d6b('0x22')][_0x4d6b('0x28')]({'where':{'id':_0x245d53[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x4d6f69,null))[_0x4d6b('0x1b')](function(_0x4585b6){if(_0x4585b6){_0xcc4d50=_0x4585b6;_0x29d63c['model']=_[_0x4d6b('0x2d')](db[_0x4d6b('0x47')]['rawAttributes']);_0x29d63c['query']=_[_0x4d6b('0x2d')](_0x245d53[_0x4d6b('0x2e')]);_0x29d63c['filters']=_[_0x4d6b('0x30')](_0x29d63c[_0x4d6b('0x2c')],_0x29d63c['query']);_0x263674[_0x4d6b('0x31')]=_[_0x4d6b('0x30')](_0x29d63c[_0x4d6b('0x2c')],qs[_0x4d6b('0x32')](_0x245d53[_0x4d6b('0x2e')][_0x4d6b('0x32')]));_0x263674['attributes']=_0x263674[_0x4d6b('0x31')]['length']?_0x263674['attributes']:_0x29d63c['model'];_0x263674['order']=qs[_0x4d6b('0x36')](_0x245d53[_0x4d6b('0x2e')]['sort']);_0x263674[_0x4d6b('0x37')]=qs[_0x4d6b('0x2f')](_[_0x4d6b('0xc1')](_0x245d53['query'],_0x29d63c['filters']));if(_0x245d53[_0x4d6b('0x2e')][_0x4d6b('0x60')]){_0x263674[_0x4d6b('0x37')]=_['merge'](_0x263674[_0x4d6b('0x37')],{'$or':_['map'](_0x263674[_0x4d6b('0x31')],function(_0x11c8d5){var _0x2482f9={};_0x2482f9[_0x11c8d5]={'$like':'%'+_0x245d53['query']['filter']+'%'};return _0x2482f9;})});}_0x263674=_[_0x4d6b('0x8e')]({},_0x263674,_0x245d53[_0x4d6b('0xc2')]);return _0xcc4d50[_0x4d6b('0xc3')](_0x263674);}})['then'](function(_0x16e9a6){if(_0x16e9a6){_0xc2f6f0=_0x16e9a6[_0x4d6b('0x23')];if(!_0x245d53[_0x4d6b('0x2e')][_0x4d6b('0x33')](_0x4d6b('0x34'))){_0x263674[_0x4d6b('0x14')]=qs['limit'](_0x245d53[_0x4d6b('0x2e')]['limit']);_0x263674[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x245d53['query'][_0x4d6b('0x16')]);}return _0xcc4d50[_0x4d6b('0xc3')](_0x263674);}})['then'](function(_0x5e825e){if(_0x5e825e){return _0x5e825e?{'count':_0xc2f6f0,'rows':_0x5e825e}:null;}})[_0x4d6b('0x1b')](respondWithResult(_0x4d6f69,null))[_0x4d6b('0x85')](handleError(_0x4d6f69,null));};exports['setTags']=function(_0x4a5508,_0xbfd0d6){if(_0x4a5508[_0x4d6b('0x8f')]['id']){delete _0x4a5508[_0x4d6b('0x8f')]['id'];}return db[_0x4d6b('0x22')][_0x4d6b('0x28')]({'where':{'id':_0x4a5508[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0xbfd0d6,null))[_0x4d6b('0x1b')](function(_0x3488d5){if(_0x3488d5){return _0x3488d5[_0x4d6b('0xc4')](_0x4a5508[_0x4d6b('0x8f')][_0x4d6b('0xc5')]||[]);}return null;})[_0x4d6b('0x1b')](respondWithResult(_0xbfd0d6,null))[_0x4d6b('0x85')](handleError(_0xbfd0d6,null));};exports['setAdditionalPhones']=function(_0x3dc21b,_0xdb45a8){var _0x5eff4c=[];_0x5eff4c['push'](addAdditionalPhones(_0x3dc21b['body']));Promise['all'](_0x5eff4c)['then'](function(){_0x5eff4c=[];_0x5eff4c['push'](deleteCmHopperPhones(_0x3dc21b['body']['id']));_0x5eff4c[_0x4d6b('0x26')](addCmHopperPhones(_0x3dc21b[_0x4d6b('0x8f')]['id']));Promise[_0x4d6b('0x29')](_0x5eff4c)[_0x4d6b('0x1b')](function(){return[0x1];})[_0x4d6b('0x1b')](respondWithResult(_0xdb45a8,null));});};function addAdditionalPhones(_0x33293f){var _0x1911e1;return new Promise(function(_0xe4511e,_0x900427){return db['CmContactHasItem'][_0x4d6b('0x1c')]({'where':{'CmContactId':_0x33293f['id']}})[_0x4d6b('0x1b')](function(){db[_0x4d6b('0xc6')][_0x4d6b('0x8b')]({'raw':!![],'attributes':['id',_0x4d6b('0xc7')]})[_0x4d6b('0x1b')](function(_0x17e3fb){var _0x5c4f9e=[];for(var _0x304216=0x0;_0x304216<_0x33293f['items'][_0x4d6b('0x23')];_0x304216++){var _0x127b7c=_0x33293f[_0x4d6b('0xc8')]?_[_0x4d6b('0x57')](_0x33293f[_0x4d6b('0xc8')][_0x304216])?'':_0x33293f[_0x4d6b('0xc8')][_0x304216]:_0x33293f[_0x4d6b('0xc9')][_0x304216][_0x4d6b('0xca')]?_0x33293f[_0x4d6b('0xc9')][_0x304216][_0x4d6b('0xca')]:'';var _0x10bd9e=_[_0x4d6b('0x57')](_0x33293f[_0x4d6b('0xc9')][_0x304216]['description'])?'':_0x33293f[_0x4d6b('0xc9')][_0x304216][_0x4d6b('0xcb')];var _0x20e802=_0x127b7c+':'+_0x33293f[_0x4d6b('0xc9')][_0x304216]['phone']+'§'+_0x10bd9e;if(_[_0x4d6b('0x57')](_0x1911e1))_0x1911e1=_0x20e802;else _0x1911e1+=';'+_0x20e802;var _0x10cd08=null;if(_0x33293f['item_types']){if(!_[_0x4d6b('0x57')](_0x33293f['item_types'][_0x304216])){var _0x32bbd3=_[_0x4d6b('0x46')](_0x17e3fb,function(_0x15d4eb){return _0x15d4eb['id']===_0x33293f[_0x4d6b('0xc8')][_0x304216];});if(!_[_0x4d6b('0x57')](_0x32bbd3)){_0x10cd08=_0x32bbd3[_0x4d6b('0xc7')];}}}else{if(!_['isNil'](_0x33293f[_0x4d6b('0xc9')][_0x304216])){var _0x32bbd3=_['find'](_0x17e3fb,function(_0x4b5f89){return _0x4b5f89['id']===_0x33293f[_0x4d6b('0xc9')][_0x304216]['ItemTypeId'];});if(!_['isNil'](_0x32bbd3)){_0x10cd08=_0x304216;}}}if(_[_0x4d6b('0x57')](_0x10cd08)){_0x10cd08=0x64;}_0x5c4f9e[_0x4d6b('0x26')](addAdditionalPhone(_0x33293f['id'],_0x33293f[_0x4d6b('0xc9')][_0x304216][_0x4d6b('0xc0')],_0x33293f['item_types']?_['isNil'](_0x33293f[_0x4d6b('0xc8')][_0x304216])?null:_0x33293f[_0x4d6b('0xc8')][_0x304216]:_0x33293f['items'][_0x304216][_0x4d6b('0xca')]?_0x33293f['items'][_0x304216][_0x4d6b('0xca')]:null,_0x10cd08,_0x10bd9e));}Promise[_0x4d6b('0x29')](_0x5c4f9e)[_0x4d6b('0x1b')](function(){db['CmContact'][_0x4d6b('0x1a')]({'AdditionalPhones':_0x1911e1},{'where':{'id':_0x33293f['id']}})[_0x4d6b('0x1b')](function(){_0xe4511e(0x1);});});});});});}function addAdditionalPhone(_0xa87c37,_0x2e0779,_0x215b6c,_0x2aa924,_0xe848ca){return db['CmContactHasItem'][_0x4d6b('0x46')]({'where':{'CmContactId':_0xa87c37,'item':_0x2e0779}})[_0x4d6b('0x1b')](function(_0x30c7f7){if(_0x30c7f7)logger[_0x4d6b('0x93')](_0x4d6b('0xcc'),_0x30c7f7);else{db[_0x4d6b('0xa2')]['create']({'CmContactId':_0xa87c37,'item':_0x2e0779,'ItemTypeId':_0x215b6c,'OrderBy':_0x2aa924,'ItemClass':_0x4d6b('0xcd'),'description':_0xe848ca});}});}function deletePhones(_0x50136e){return db[_0x4d6b('0xa2')][_0x4d6b('0x1c')]({'where':{'CmContactId':_0x50136e}});}function deleteCmHopperPhones(_0x210675){return new Promise(function(_0x245de7,_0x408734){return db[_0x4d6b('0x95')][_0x4d6b('0x8b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x210675}})[_0x4d6b('0x1b')](function(_0x534a95){db[_0x4d6b('0xce')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x534a95,'id')}}});})['then'](function(){_0x245de7(0x1);});});}function addCmHopperPhones(_0x4f0d1b){return new Promise(function(_0x453d37,_0x4d0825){return db[_0x4d6b('0x95')][_0x4d6b('0x8b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4f0d1b}})[_0x4d6b('0x1b')](function(_0x3a95a2){var _0x532afc=[];_[_0x4d6b('0x4a')](_0x3a95a2,function(_0x2a75a8){_0x532afc[_0x4d6b('0x26')](createCmHopperPhone(_0x4f0d1b,_0x2a75a8['id']));});Promise[_0x4d6b('0x29')](_0x532afc)['then'](function(){_0x453d37(0x1);});});});}function createCmHopperPhone(_0x31ba65,_0x372a51){return new Promise(function(_0x42513b,_0x4bc235){db[_0x4d6b('0xa2')][_0x4d6b('0x8b')]({'raw':!![],'attributes':[_0x4d6b('0xcf'),'OrderBy'],'where':{'CmContactId':_0x31ba65,'ItemClass':_0x4d6b('0xcd')},'include':[{'model':db[_0x4d6b('0xc6')],'attributes':[_0x4d6b('0xc7')],'as':_0x4d6b('0xb7')}],'order':[_0x4d6b('0xc7'),db['sequelize'][_0x4d6b('0xd0')](_0x4d6b('0xd1'))]})[_0x4d6b('0x1b')](function(_0x3113b5){var _0x51ca5f=0x1;var _0x5aea3e=_['map'](_0x3113b5,function(_0x498fa2){_0x498fa2[_0x4d6b('0xd2')]=_0x372a51;_0x498fa2['phone']=_0x498fa2['item'];_0x498fa2[_0x4d6b('0xc7')]=_0x51ca5f;delete _0x498fa2['ItemType.OrderBy'];_0x51ca5f=_0x51ca5f+0x1;return _0x498fa2;});return db[_0x4d6b('0xce')][_0x4d6b('0xaf')](_0x5aea3e,{});})[_0x4d6b('0x1b')](function(){_0x42513b(0x1);});});}function insertAdditionalPhones(_0x4c794a,_0x41d2ee){return new Promise(function(_0x26097a,_0x37cfc8){var _0x172ee4=[];for(var _0x1e6f76=0x0;_0x1e6f76<_0x41d2ee[_0x4d6b('0x23')];_0x1e6f76++){var _0xaf1187=_0x41d2ee[_0x1e6f76];_0x172ee4[_0x4d6b('0x26')](parseContactItemType(_0xaf1187));}Promise[_0x4d6b('0x29')](_0x172ee4)[_0x4d6b('0x1b')](function(){var _0x16d8b7={'id':_0x4c794a['id'],'items':_0x41d2ee};return addAdditionalPhones(_0x16d8b7)[_0x4d6b('0x1b')](function(_0x2b1964){return addCmHopperPhones(_0x4c794a['id']);});})['then'](function(){_0x26097a(_0x4c794a);});});}function parseContactItemType(_0x34dd29){return new Promise(function(_0x48f4d5,_0xdd1ba9){if(_0x34dd29['hasOwnProperty']('ItemTypeId')){_0x48f4d5(_0x34dd29);}else{return db[_0x4d6b('0xc6')]['find']({'where':{'name':_0x34dd29[_0x4d6b('0xb7')]}})['then'](function(_0x231bc0){if(_['isNil'](_0x231bc0))_0x34dd29[_0x4d6b('0xca')]=null;else _0x34dd29[_0x4d6b('0xca')]=_0x231bc0['id'];_0x48f4d5(_0x34dd29);});}});}exports[_0x4d6b('0xd3')]=function(_0x36b6e3,_0x103d1d){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x36b6e3[_0x4d6b('0xb6')]['id'],'ItemClass':_0x4d6b('0xcd')},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[['OrderBy'],[db[_0x4d6b('0x77')][_0x4d6b('0xd0')]('`ItemType`.OrderBy')]]})['then'](function(_0xdd7725){return _0xdd7725;})[_0x4d6b('0x1b')](respondWithResult(_0x103d1d,null))[_0x4d6b('0x85')](handleError(_0x103d1d,null));};exports[_0x4d6b('0xd4')]=function(_0x52e198,_0x24ec2a){return db[_0x4d6b('0xa2')]['findAll']({'raw':!![],'where':{'CmContactId':_0x52e198[_0x4d6b('0x8f')][_0x4d6b('0xd5')]}})['then'](function(_0x18fc61){var _0x16a507=_[_0x4d6b('0x4a')](_0x18fc61,function(_0x341448){_0x341448[_0x4d6b('0xd6')]=_0x52e198[_0x4d6b('0x8f')][_0x4d6b('0xd7')];return _0x341448;});return db[_0x4d6b('0xa2')]['bulkCreate'](_0x16a507,{});})[_0x4d6b('0x1b')](function(_0x59403c){return addCmHopperPhones(_0x52e198[_0x4d6b('0x8f')]['toContactId']);})['then'](function(_0x12dba1){return['ok'];})[_0x4d6b('0x1b')](respondWithResult(_0x24ec2a,null))[_0x4d6b('0x85')](handleError(_0x24ec2a,null));};exports[_0x4d6b('0xd8')]=function(_0x14ef5d,_0x13bd5c){var _0x3ca6d3=[];_0x3ca6d3['push'](createCmHopperPhone(_0x14ef5d[_0x4d6b('0x8f')]['id'],_0x14ef5d[_0x4d6b('0x8f')]['hopperId']));Promise[_0x4d6b('0x29')](_0x3ca6d3)[_0x4d6b('0x1b')](function(){return[0x1];})[_0x4d6b('0x1b')](respondWithResult(_0x13bd5c,null));};exports[_0x4d6b('0xd9')]=function(_0x4e8dd1,_0x220004){var _0x1a3982={'raw':![],'where':{}};var _0x354495={};var _0x4cef95={'count':0x0,'rows':[]};return db[_0x4d6b('0x22')][_0x4d6b('0x28')]({'where':{'id':_0x4e8dd1[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x220004,null))['then'](function(_0x1187d6){if(_0x1187d6){_0x354495['model']=_['keys'](db['CmHopper'][_0x4d6b('0xda')]);_0x354495[_0x4d6b('0x2e')]=_[_0x4d6b('0x2d')](_0x4e8dd1[_0x4d6b('0x2e')]);_0x354495[_0x4d6b('0x2f')]=_['intersection'](_0x354495['model'],_0x354495[_0x4d6b('0x2e')]);_0x1a3982['attributes']=_[_0x4d6b('0x30')](_0x354495[_0x4d6b('0x2c')],qs[_0x4d6b('0x32')](_0x4e8dd1[_0x4d6b('0x2e')][_0x4d6b('0x32')]));_0x1a3982['attributes']=_0x1a3982['attributes']['length']?_0x1a3982[_0x4d6b('0x31')]:_0x354495[_0x4d6b('0x2c')];if(!_0x4e8dd1[_0x4d6b('0x2e')][_0x4d6b('0x33')]('nolimit')){_0x1a3982[_0x4d6b('0x14')]=qs[_0x4d6b('0x14')](_0x4e8dd1[_0x4d6b('0x2e')][_0x4d6b('0x14')]);_0x1a3982[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x4e8dd1[_0x4d6b('0x2e')]['offset']);}_0x1a3982[_0x4d6b('0x35')]=qs[_0x4d6b('0x36')](_0x4e8dd1['query']['sort']);_0x1a3982[_0x4d6b('0x37')]=qs['filters'](_['pick'](_0x4e8dd1[_0x4d6b('0x2e')],_0x354495['filters']));_0x1a3982[_0x4d6b('0x37')]['ContactId']=_0x1187d6['id'];if(_0x4e8dd1[_0x4d6b('0x2e')][_0x4d6b('0x60')]){_0x1a3982[_0x4d6b('0x37')]=_[_0x4d6b('0x8e')](_0x1a3982[_0x4d6b('0x37')],{'$or':_[_0x4d6b('0x4a')](_0x1a3982[_0x4d6b('0x31')],function(_0x485782){var _0x5695bc={};_0x5695bc[_0x485782]={'$like':'%'+_0x4e8dd1[_0x4d6b('0x2e')][_0x4d6b('0x60')]+'%'};return _0x5695bc;})});}_0x1a3982=_[_0x4d6b('0x8e')]({},_0x1a3982,_0x4e8dd1[_0x4d6b('0xc2')]);return db[_0x4d6b('0x95')]['count']({'where':_0x1a3982[_0x4d6b('0x37')]})['then'](function(_0xbcc03b){_0x4cef95['count']=_0xbcc03b;if(_0x4e8dd1[_0x4d6b('0x2e')]['includeAll']){_0x1a3982['include']=[{'all':!![]}];}return db[_0x4d6b('0x95')]['findAll'](_0x1a3982);})[_0x4d6b('0x1b')](function(_0x661474){_0x4cef95[_0x4d6b('0x84')]=_0x661474;return _0x4cef95;});}})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x220004,_0x1a3982))[_0x4d6b('0x85')](handleError(_0x220004,null));};exports[_0x4d6b('0xdb')]=function(_0x1f1e82,_0x5bbdf1){var _0x2eec79={'raw':!![],'where':{}};var _0x38ecfd={};var _0xd20c8b={'count':0x0,'rows':[]};return db[_0x4d6b('0x22')][_0x4d6b('0x28')]({'where':{'id':_0x1f1e82[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x5bbdf1,null))[_0x4d6b('0x1b')](function(_0xd6566e){if(_0xd6566e){_0x38ecfd['model']=_[_0x4d6b('0x2d')](db[_0x4d6b('0xa4')]['rawAttributes']);_0x38ecfd[_0x4d6b('0x2e')]=_[_0x4d6b('0x2d')](_0x1f1e82[_0x4d6b('0x2e')]);_0x38ecfd[_0x4d6b('0x2f')]=_['intersection'](_0x38ecfd[_0x4d6b('0x2c')],_0x38ecfd[_0x4d6b('0x2e')]);_0x2eec79[_0x4d6b('0x31')]=_[_0x4d6b('0x30')](_0x38ecfd[_0x4d6b('0x2c')],qs[_0x4d6b('0x32')](_0x1f1e82[_0x4d6b('0x2e')][_0x4d6b('0x32')]));_0x2eec79[_0x4d6b('0x31')]=_0x2eec79['attributes']['length']?_0x2eec79[_0x4d6b('0x31')]:_0x38ecfd[_0x4d6b('0x2c')];if(!_0x1f1e82['query'][_0x4d6b('0x33')]('nolimit')){_0x2eec79['limit']=qs[_0x4d6b('0x14')](_0x1f1e82['query']['limit']);_0x2eec79[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x1f1e82[_0x4d6b('0x2e')][_0x4d6b('0x16')]);}_0x2eec79['order']=qs[_0x4d6b('0x36')](_0x1f1e82[_0x4d6b('0x2e')][_0x4d6b('0x36')]);_0x2eec79['where']=qs[_0x4d6b('0x2f')](_[_0x4d6b('0xc1')](_0x1f1e82['query'],_0x38ecfd[_0x4d6b('0x2f')]));_0x2eec79[_0x4d6b('0x37')]['ContactId']=_0xd6566e['id'];if(_0x1f1e82[_0x4d6b('0x2e')][_0x4d6b('0x60')]){_0x2eec79[_0x4d6b('0x37')]=_['merge'](_0x2eec79[_0x4d6b('0x37')],{'$or':_['map'](_0x2eec79[_0x4d6b('0x31')],function(_0x500f73){var _0x3cdfff={};_0x3cdfff[_0x500f73]={'$like':'%'+_0x1f1e82[_0x4d6b('0x2e')]['filter']+'%'};return _0x3cdfff;})});}_0x2eec79=_['merge']({},_0x2eec79,_0x1f1e82['options']);return db[_0x4d6b('0xa4')][_0x4d6b('0x15')]({'where':_0x2eec79[_0x4d6b('0x37')]})[_0x4d6b('0x1b')](function(_0x72107d){_0xd20c8b[_0x4d6b('0x15')]=_0x72107d;if(_0x1f1e82[_0x4d6b('0x2e')][_0x4d6b('0xdc')]){_0x2eec79['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x4d6b('0x8b')](_0x2eec79);})[_0x4d6b('0x1b')](function(_0x5149e2){_0xd20c8b[_0x4d6b('0x84')]=_0x5149e2;return _0xd20c8b;});}})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x5bbdf1,_0x2eec79))[_0x4d6b('0x85')](handleError(_0x5bbdf1,null));};exports[_0x4d6b('0xdd')]=function(_0x1d03b3,_0x8b92dc){var _0x4146a5={'raw':!![],'where':{}};var _0x433c81={};var _0x24b99c={'count':0x0,'rows':[]};return db[_0x4d6b('0x22')][_0x4d6b('0x28')]({'where':{'id':_0x1d03b3[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x8b92dc,null))['then'](function(_0x36a9c5){if(_0x36a9c5){_0x433c81[_0x4d6b('0x2c')]=_[_0x4d6b('0x2d')](db[_0x4d6b('0xa3')][_0x4d6b('0xda')]);_0x433c81[_0x4d6b('0x2e')]=_[_0x4d6b('0x2d')](_0x1d03b3['query']);_0x433c81[_0x4d6b('0x2f')]=_[_0x4d6b('0x30')](_0x433c81[_0x4d6b('0x2c')],_0x433c81[_0x4d6b('0x2e')]);_0x4146a5[_0x4d6b('0x31')]=_['intersection'](_0x433c81[_0x4d6b('0x2c')],qs[_0x4d6b('0x32')](_0x1d03b3[_0x4d6b('0x2e')]['fields']));_0x4146a5['attributes']=_0x4146a5[_0x4d6b('0x31')]['length']?_0x4146a5[_0x4d6b('0x31')]:_0x433c81[_0x4d6b('0x2c')];if(!_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0x33')](_0x4d6b('0x34'))){_0x4146a5['limit']=qs[_0x4d6b('0x14')](_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0x14')]);_0x4146a5[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0x16')]);}_0x4146a5['order']=qs['sort'](_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0x36')]);_0x4146a5[_0x4d6b('0x37')]=qs['filters'](_['pick'](_0x1d03b3[_0x4d6b('0x2e')],_0x433c81[_0x4d6b('0x2f')]));_0x4146a5['where'][_0x4d6b('0xde')]=_0x36a9c5['id'];if(_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0x60')]){_0x4146a5[_0x4d6b('0x37')]=_['merge'](_0x4146a5[_0x4d6b('0x37')],{'$or':_[_0x4d6b('0x4a')](_0x4146a5['attributes'],function(_0x1aecad){var _0x169220={};_0x169220[_0x1aecad]={'$like':'%'+_0x1d03b3[_0x4d6b('0x2e')]['filter']+'%'};return _0x169220;})});}_0x4146a5=_[_0x4d6b('0x8e')]({},_0x4146a5,_0x1d03b3[_0x4d6b('0xc2')]);return db[_0x4d6b('0xa3')]['count']({'where':_0x4146a5[_0x4d6b('0x37')]})['then'](function(_0x172ded){_0x24b99c[_0x4d6b('0x15')]=_0x172ded;if(_0x1d03b3[_0x4d6b('0x2e')][_0x4d6b('0xdc')]){_0x4146a5[_0x4d6b('0xdf')]=[{'all':!![]}];}return db[_0x4d6b('0xa3')][_0x4d6b('0x8b')](_0x4146a5);})[_0x4d6b('0x1b')](function(_0x22ae19){_0x24b99c[_0x4d6b('0x84')]=_0x22ae19;return _0x24b99c;});}})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x8b92dc,_0x4146a5))[_0x4d6b('0x85')](handleError(_0x8b92dc,null));};exports[_0x4d6b('0xe0')]=function(_0x1e98f6,_0x31133f){var _0x5e83c4={'raw':!![],'where':{}};var _0x592fad={};var _0x4e24dd={'count':0x0,'rows':[]};return db['CmContact'][_0x4d6b('0x28')]({'where':{'id':_0x1e98f6[_0x4d6b('0xb6')]['id']}})[_0x4d6b('0x1b')](handleEntityNotFound(_0x31133f,null))[_0x4d6b('0x1b')](function(_0x56cd11){if(_0x56cd11){_0x592fad[_0x4d6b('0x2c')]=_['keys'](db[_0x4d6b('0xa8')][_0x4d6b('0xda')]);_0x592fad['query']=_[_0x4d6b('0x2d')](_0x1e98f6['query']);_0x592fad[_0x4d6b('0x2f')]=_[_0x4d6b('0x30')](_0x592fad[_0x4d6b('0x2c')],_0x592fad[_0x4d6b('0x2e')]);_0x5e83c4[_0x4d6b('0x31')]=_[_0x4d6b('0x30')](_0x592fad['model'],qs[_0x4d6b('0x32')](_0x1e98f6[_0x4d6b('0x2e')][_0x4d6b('0x32')]));_0x5e83c4['attributes']=_0x5e83c4[_0x4d6b('0x31')][_0x4d6b('0x23')]?_0x5e83c4['attributes']:_0x592fad[_0x4d6b('0x2c')];if(!_0x1e98f6['query']['hasOwnProperty']('nolimit')){_0x5e83c4['limit']=qs[_0x4d6b('0x14')](_0x1e98f6['query']['limit']);_0x5e83c4[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x1e98f6[_0x4d6b('0x2e')][_0x4d6b('0x16')]);}_0x5e83c4[_0x4d6b('0x35')]=qs[_0x4d6b('0x36')](_0x1e98f6[_0x4d6b('0x2e')][_0x4d6b('0x36')]);_0x5e83c4['where']=qs['filters'](_[_0x4d6b('0xc1')](_0x1e98f6[_0x4d6b('0x2e')],_0x592fad[_0x4d6b('0x2f')]));_0x5e83c4[_0x4d6b('0x37')]['ContactId']=_0x56cd11['id'];if(_0x1e98f6[_0x4d6b('0x2e')]['filter']){_0x5e83c4[_0x4d6b('0x37')]=_[_0x4d6b('0x8e')](_0x5e83c4[_0x4d6b('0x37')],{'$or':_['map'](_0x5e83c4['attributes'],function(_0x486346){var _0x2d341c={};_0x2d341c[_0x486346]={'$like':'%'+_0x1e98f6[_0x4d6b('0x2e')][_0x4d6b('0x60')]+'%'};return _0x2d341c;})});}_0x5e83c4=_[_0x4d6b('0x8e')]({},_0x5e83c4,_0x1e98f6[_0x4d6b('0xc2')]);return db[_0x4d6b('0xa8')][_0x4d6b('0x15')]({'where':_0x5e83c4[_0x4d6b('0x37')]})[_0x4d6b('0x1b')](function(_0x3af5c0){_0x4e24dd['count']=_0x3af5c0;if(_0x1e98f6[_0x4d6b('0x2e')][_0x4d6b('0xdc')]){_0x5e83c4[_0x4d6b('0xdf')]=[{'all':!![]}];}return db[_0x4d6b('0xa8')][_0x4d6b('0x8b')](_0x5e83c4);})[_0x4d6b('0x1b')](function(_0x21cf02){_0x4e24dd[_0x4d6b('0x84')]=_0x21cf02;return _0x4e24dd;});}})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x31133f,_0x5e83c4))['catch'](handleError(_0x31133f,null));};exports[_0x4d6b('0xe1')]=function(_0x1948bd,_0x3e944a){try{if(!_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0x59')]){throw new Error(_0x4d6b('0xe2'));}if(!_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe3')]){throw new Error(_0x4d6b('0xe4'));}if(!_0x1948bd[_0x4d6b('0x8f')]['binding_values']){throw new Error(_0x4d6b('0xe5'));}if(!_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe6')]){throw new Error(_0x4d6b('0xe7'));}var _0x10d704=_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe3')][_0x4d6b('0x49')](',');var _0x5195e1=_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe8')][_0x4d6b('0x49')](',');if(!_0x10d704['length']||!_0x5195e1[_0x4d6b('0x23')]||_0x10d704[_0x4d6b('0x23')]!==_0x5195e1[_0x4d6b('0x23')]){throw new Error(_0x4d6b('0xe9'));}_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0x32')]=_[_0x4d6b('0xea')](_0x10d704,_0x5195e1);if(!_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0x32')][_0x4d6b('0xc0')]){throw new Error(_0x4d6b('0xeb'));}if(!_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0x32')][_0x4d6b('0xec')]){throw new Error(_0x4d6b('0xed'));}var _0x42a1f4=path[_0x4d6b('0x92')](config[_0x4d6b('0xee')],_0x4d6b('0xef'),_0x1948bd[_0x4d6b('0xf0')]['filename']);fs['chmodSync'](_0x42a1f4,parseInt(_0x4d6b('0xf1'),0x8));var _0x371740=require(_0x4d6b('0xf2'))[_0x4d6b('0xf3')](path[_0x4d6b('0x92')](__dirname,'../../components/import/cm/csv'),[_0x42a1f4,_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe3')],_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe8')],_0x1948bd['body']['ListId'],_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xf4')],_0x1948bd['body'][_0x4d6b('0xb1')],_0x1948bd[_0x4d6b('0x8f')][_0x4d6b('0xe6')]]);return _0x3e944a['status'](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x371740['pid']});}catch(_0x2a9e11){return _0x3e944a[_0x4d6b('0x12')](0x1f4)[_0x4d6b('0x20')](_0x2a9e11);}};exports[_0x4d6b('0xf5')]=function(_0x58617d,_0x53daff){var _0x3a5116=fs[_0x4d6b('0xf6')](_0x58617d['file'][_0x4d6b('0x2')]);Papa[_0x4d6b('0xf7')](_0x3a5116,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3ada7c){return _0x53daff[_0x4d6b('0x12')](0xc8)[_0x4d6b('0x19')]({'file':_0x58617d['file'],'fields':_0x3ada7c[_0x4d6b('0xf8')][_0x4d6b('0x32')]});}});};exports[_0x4d6b('0xf9')]=function(_0x537c5e,_0x52ae3f){return db[_0x4d6b('0x4d')][_0x4d6b('0x8b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x4d6b('0x72')}})['then'](function(_0x211166){var _0x3db1b1=![];if(!_0x537c5e[_0x4d6b('0x8f')][_0x4d6b('0x59')]){throw new Error(_0x4d6b('0xe2'));}if(!_0x537c5e['body'][_0x4d6b('0xfa')][_0x4d6b('0xc0')]){throw new Error(_0x4d6b('0xeb'));}if(!_0x537c5e[_0x4d6b('0x8f')][_0x4d6b('0xfa')]['firstName']){throw new Error(_0x4d6b('0xed'));}if(!_0x537c5e[_0x4d6b('0x8f')][_0x4d6b('0xe6')]){throw new Error(_0x4d6b('0xe7'));}var _0xe57a1d=require(_0x4d6b('0xf2'))[_0x4d6b('0xf3')](path[_0x4d6b('0x92')](__dirname,'../../components/import/cm/csv2'),[_0x537c5e[_0x4d6b('0xb6')]['id'],JSON[_0x4d6b('0xfb')](_0x537c5e[_0x4d6b('0x8f')]),JSON[_0x4d6b('0xfb')](_0x211166)]);_0xe57a1d['on']('message',function(){_0x3db1b1=!![];return _0x52ae3f['status'](0xc8)[_0x4d6b('0x19')]({'message':_0x4d6b('0xfc'),'pid':_0xe57a1d[_0x4d6b('0xfd')]});});_0xe57a1d['on'](_0x4d6b('0xfe'),function(_0x4059ad){if(_0x4059ad&&!_0x3db1b1){return _0x52ae3f[_0x4d6b('0x12')](0x1f4)[_0x4d6b('0x19')]({'message':_0x4d6b('0xff'),'pid':_0xe57a1d['pid']});}});})[_0x4d6b('0x85')](handleError(_0x52ae3f,null));};exports[_0x4d6b('0x100')]=function(_0x5caa94,_0x3d2b36,_0x4dabd5){return db[_0x4d6b('0x4d')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x4d6b('0x72')}})[_0x4d6b('0x1b')](function(_0x1ed7f0){var _0x1668d3=![];if(!_0x5caa94[_0x4d6b('0x8f')][_0x4d6b('0x59')]){throw new Error(_0x4d6b('0xe2'));}if(!_0x5caa94[_0x4d6b('0x8f')]['binding'][_0x4d6b('0xc0')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5caa94[_0x4d6b('0x8f')][_0x4d6b('0xfa')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x5caa94[_0x4d6b('0x8f')][_0x4d6b('0xe6')]){throw new Error(_0x4d6b('0xe7'));}var _0x87b9a5=require(_0x4d6b('0xf2'))[_0x4d6b('0xf3')](path[_0x4d6b('0x92')](__dirname,_0x4d6b('0x101')),[_0x5caa94[_0x4d6b('0xb6')]['id'],JSON[_0x4d6b('0xfb')](_0x5caa94['body']),JSON[_0x4d6b('0xfb')](_0x1ed7f0)]);_0x87b9a5['on']('message',function(_0xf14bea){_0x1668d3=!![];return _0x3d2b36['status'](0xc8)[_0x4d6b('0x19')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x87b9a5[_0x4d6b('0xfd')]});});_0x87b9a5['on'](_0x4d6b('0xfe'),function(_0xba604a){if(_0xba604a&&!_0x1668d3){return _0x3d2b36['status'](0x1f4)[_0x4d6b('0x19')]({'message':'error\x20child\x20process','pid':_0x87b9a5[_0x4d6b('0xfd')]});}});})[_0x4d6b('0x85')](handleError(_0x3d2b36,null));};exports[_0x4d6b('0x102')]=function(_0x8522,_0x65cd0){var _0x1eb47d=[_0x4d6b('0x103'),_0x4d6b('0x104'),_0x4d6b('0x105'),'openchannel',_0x4d6b('0x106'),'whatsapp',_0x4d6b('0x107')];var _0xb6a9c={'offset':0x0,'order':qs[_0x4d6b('0x36')](_0x4d6b('0x108'))},_0x2aee23={'count':0x0,'rows':[]};Promise[_0x4d6b('0x70')]()[_0x4d6b('0x1b')](function(){if(_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x109')]){if(!_['includes'](_0x1eb47d,_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x109')]['toLowerCase']())){throw new Error(_0x4d6b('0x10a'));}_0x1eb47d=[_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x109')][_0x4d6b('0x10b')]()];}if(_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x10c')]){try{var _0x32ea52=JSON[_0x4d6b('0xf7')](_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x10c')]);if(!moment(_0x32ea52['from'])[_0x4d6b('0x10d')]()){throw new Error(_0x4d6b('0x10e'));}if(!moment(_0x32ea52['to'])['isValid']()){throw new Error(_0x4d6b('0x10f'));}}catch(_0x5138f6){throw new Error(_0x4d6b('0x110'));}}if(!_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x33')]('nolimit')){_0xb6a9c['limit']=qs[_0x4d6b('0x14')](_0x8522[_0x4d6b('0x2e')]['limit']||0xa);_0xb6a9c[_0x4d6b('0x16')]=qs[_0x4d6b('0x16')](_0x8522['query']['offset']);}var _0x16cd12=_0x1eb47d[_0x4d6b('0x4a')](function(_0x4c193b){if(_0x4c193b===_0x4d6b('0x107')){var _0x94baae={'attributes':['id',_0x4d6b('0x111'),_0x4d6b('0x2b'),_0x4d6b('0x112'),_0x4d6b('0x113'),_0x4d6b('0x114'),_0x4d6b('0x115'),_0x4d6b('0x116'),'duration',_0x4d6b('0x117'),_0x4d6b('0x118'),_0x4d6b('0x119'),'userSecondDisposition',_0x4d6b('0x11a'),'UserId'],'where':{'ContactId':_0x8522['params']['id']},'include':[{'model':db['User'],'as':_0x4d6b('0x4d'),'attributes':['id',_0x4d6b('0x1f'),_0x4d6b('0x11b'),_0x4d6b('0x11c')]}],'order':[[_0x4d6b('0x118'),_0x4d6b('0x6d')]]};if(_0x8522[_0x4d6b('0x2e')][_0x4d6b('0x10c')]){_0x94baae[_0x4d6b('0x37')]['createdAt']={'$gte':_0x32ea52[_0x4d6b('0x3a')],'$lte':_0x32ea52['to']};}return db[_0x4d6b('0xa5')]['findAndCountAll'](_0x94baae)[_0x4d6b('0x1b')](function(_0x5db794){_0x2aee23[_0x4d6b('0x15')]+=_0x5db794['count'];return _[_0x4d6b('0x4a')](_0x5db794[_0x4d6b('0x84')],function(_0x413cfb){var _0x52a559=_0x413cfb['get']({'plain':!![]});_0x52a559[_0x4d6b('0x109')]=_0x4c193b;if(_0x52a559[_0x4d6b('0x4d')]){_0x52a559[_0x4d6b('0x4d')]={'id':_0x52a559['User']['id'],'name':_0x52a559[_0x4d6b('0x4d')]['name'],'fullname':_0x52a559[_0x4d6b('0x4d')]['fullname'],'alias':_0x52a559[_0x4d6b('0x4d')][_0x4d6b('0x11c')]};}return _0x52a559;});});}else{var _0x880f0b=_[_0x4d6b('0x11d')](_0x4c193b)+(_0x4c193b===_0x4d6b('0x104')?_0x4d6b('0x11e'):_0x4d6b('0x11f'));var _0x5935f2={'attributes':['id',_0x4d6b('0x120'),_0x4d6b('0x121'),_0x4d6b('0x118'),_0x4d6b('0x117'),'disposition','secondDisposition',_0x4d6b('0x122'),_0x4d6b('0x123'),_0x880f0b+'Id'],'where':{'ContactId':_0x8522['params']['id']},'include':[{'model':db[_0x880f0b],'as':_0x4d6b('0x11f'),'attributes':['id',_0x4d6b('0x1f'),_0x4d6b('0x124')]},{'model':db[_0x4d6b('0x4d')],'as':_0x4d6b('0x125'),'attributes':['id',_0x4d6b('0x1f'),_0x4d6b('0x11b')]},{'model':db[_0x4d6b('0x47')],'as':_0x4d6b('0x83'),'attributes':['id','name',_0x4d6b('0x39')],'through':{'attributes':[]}}],'order':[[_0x4d6b('0x118'),_0x4d6b('0x6d')]]};if(_0x8522['query'][_0x4d6b('0x10c')]){_0x5935f2[_0x4d6b('0x37')][_0x4d6b('0x118')]={'$gte':_0x32ea52[_0x4d6b('0x3a')],'$lte':_0x32ea52['to']};}switch(_0x4c193b){case _0x4d6b('0x104'):_0x5935f2[_0x4d6b('0x31')][_0x4d6b('0x26')](_0x4d6b('0x126'),_0x4d6b('0x127'),'customerPort','deviceModel',_0x4d6b('0x128'),_0x4d6b('0x129'),_0x4d6b('0x12a'),_0x4d6b('0x12b'),_0x4d6b('0x12c'));break;case _0x4d6b('0x103'):_0x5935f2[_0x4d6b('0x31')][_0x4d6b('0x26')](_0x4d6b('0x12d'),_0x4d6b('0x12e'));break;case _0x4d6b('0x12f'):_0x5935f2[_0x4d6b('0x31')][_0x4d6b('0x26')](_0x4d6b('0x130'),_0x4d6b('0x131'));break;}return db[_[_0x4d6b('0x11d')](_0x4c193b)+_0x4d6b('0x132')]['findAndCountAll'](_0x5935f2)[_0x4d6b('0x1b')](function(_0x3b96ab){_0x2aee23['count']+=_0x3b96ab[_0x4d6b('0x15')];return _['map'](_0x3b96ab[_0x4d6b('0x84')],function(_0x5607e4){var _0x53d109=_0x5607e4['get']({'plain':!![]});_0x53d109[_0x4d6b('0x109')]=_0x4c193b;if(_0x53d109[_0x4d6b('0x125')]){_0x53d109[_0x4d6b('0x125')]={'id':_0x53d109[_0x4d6b('0x125')]['id'],'name':_0x53d109['Owner'][_0x4d6b('0x1f')],'fullname':_0x53d109[_0x4d6b('0x125')][_0x4d6b('0x11b')]};}return _0x53d109;});});}});return Promise['all'](_0x16cd12);})['then'](function(_0x3ecb54){return _(_0x3ecb54)[_0x4d6b('0x133')]()['sortBy'](_0x4d6b('0x118'))[_0x4d6b('0x134')]()[_0x4d6b('0x48')]();})['then'](function(_0xa18a0d){_0x2aee23['rows']=_0xb6a9c[_0x4d6b('0x14')]?_0xa18a0d[_0x4d6b('0x135')](_0xb6a9c[_0x4d6b('0x16')],_0xb6a9c['offset']+_0xb6a9c[_0x4d6b('0x14')]):_0xa18a0d;return _0x2aee23;})[_0x4d6b('0x1b')](respondWithFilteredResult(_0x65cd0,_0xb6a9c))['catch'](handleError(_0x65cd0,null));}; \ No newline at end of file +var _0x849f=['user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','merge','c.id','c.firstName','c.lastName','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','params','describe','tags','columnName','displayName','analytics','findAll','custom','values','body','get','mergeWith','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','update','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','contact','show','Phones','ContactItemType','literal','Phones.OrderBy','ListId','$and','CmCustomField','format','timezones','omit','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','rawAttributes','pick','options','getTags','setTags','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','ContactId','includeAll','getHopperHistories','include','rows','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','zipObject','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','path','parse','meta','import','No\x20phone\x20column\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','User','firstName','../../components/import/cm/csvUpdates','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','Invalid\x20channel','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','createdAt','userDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','startCase','chat','Account','closed','note','disposition','thirdDisposition','key','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','threadId','Interaction','flatten','sortBy','reverse','slice','moment','bluebird','util','lodash','papaparse','ioredis','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','Content-Range','destroy','then','end','sendStatus','error','stack','name','index','CmContact','length','keys','startsWith','cf_','push','findOne','all','type','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','select','field','color','tools_tags','from','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','dateOfBirth','fieldType','datetime','castTo','text','start','hasOwnProperty','filter','isNil','Contact','isEmpty','forEach','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent'];(function(_0x590d15,_0x26d156){var _0x16377e=function(_0x281738){while(--_0x281738){_0x590d15['push'](_0x590d15['shift']());}};_0x16377e(++_0x26d156);}(_0x849f,0xcd));var _0xf849=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x849f[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xf849('0x0'));var BPromise=require(_0xf849('0x1'));var util=require(_0xf849('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xf849('0x3'));var squel=require('squel');var Papa=require(_0xf849('0x4'));var Redis=require(_0xf849('0x5'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xf849('0x6'))('api');var config=require(_0xf849('0x7'));var shared=require(_0xf849('0x8'));var db=require(_0xf849('0x9'))['db'];config['redis']=_['defaults'](config[_0xf849('0xa')],{'host':_0xf849('0xb'),'port':0x18eb});var socket=require(_0xf849('0xc'))(new Redis(config[_0xf849('0xa')]));require('./cmContact.socket')[_0xf849('0xd')](socket);function respondWithResult(_0x568ed4,_0x2d839a){_0x2d839a=_0x2d839a||0xc8;return function(_0x1998c7){if(_0x1998c7){return _0x568ed4[_0xf849('0xe')](_0x2d839a)[_0xf849('0xf')](_0x1998c7);}};}function respondWithFilteredResult(_0x31e787,_0x2690ad){return function(_0xe549f0){if(_0xe549f0){var _0x2e8e51=typeof _0x2690ad[_0xf849('0x10')]==='undefined'&&typeof _0x2690ad[_0xf849('0x11')]===_0xf849('0x12');var _0x45ff46=_0xe549f0['count'];var _0x5317a9=_0x2e8e51?0x0:_0x2690ad[_0xf849('0x10')];var _0x37fc21=_0x2e8e51?_0xe549f0[_0xf849('0x13')]:_0x2690ad[_0xf849('0x10')]+_0x2690ad[_0xf849('0x11')];var _0x4393f4;if(_0x37fc21>=_0x45ff46){_0x37fc21=_0x45ff46;_0x4393f4=0xc8;}else{_0x4393f4=0xce;}_0x31e787['status'](_0x4393f4);return _0x31e787['set'](_0xf849('0x14'),_0x5317a9+'-'+_0x37fc21+'/'+_0x45ff46)[_0xf849('0xf')](_0xe549f0);}return null;};}function saveUpdates(_0x3ec863){return function(_0x54ddf4){if(_0x54ddf4){return _0x54ddf4['update'](_0x3ec863)['then'](function(_0x567c9e){return _0x567c9e;});}return null;};}function removeEntity(_0x5b6d65){return function(_0x498e4c){if(_0x498e4c){return _0x498e4c[_0xf849('0x15')]()[_0xf849('0x16')](function(){_0x5b6d65[_0xf849('0xe')](0xcc)[_0xf849('0x17')]();});}};}function handleEntityNotFound(_0x298274){return function(_0x33f10a){if(!_0x33f10a){_0x298274[_0xf849('0x18')](0x194);}return _0x33f10a;};}function handleError(_0x123229,_0xfdd966){_0xfdd966=_0xfdd966||0x1f4;return function(_0x2e7714){logger[_0xf849('0x19')](_0x2e7714[_0xf849('0x1a')]);if(_0x2e7714[_0xf849('0x1b')]){delete _0x2e7714[_0xf849('0x1b')];}_0x123229[_0xf849('0xe')](_0xfdd966)['send'](_0x2e7714);};}exports[_0xf849('0x1c')]=function(_0x5c0136,_0x3ecedc){var _0x887cea={},_0x3598d3={},_0xd19a26={'count':0x0,'rows':[]};return db[_0xf849('0x1d')]['describe']()[_0xf849('0x16')](function(_0x1ddbc9){var _0x40e572=[];for(var _0x29cbd4=0x0;_0x29cbd40x1){_0x1929b7['or'](_0xf849('0x58'),qs[_0xf849('0x59')](_0x4ed005),null);}else{if(qs['isNumeric'](_0x4ed005)){_0x1929b7['or']('c.id\x20LIKE\x20?',_0x4ed005+'%');_0x1929b7['or'](_0xf849('0x5a'),_0x4ed005+'%');_0x1929b7['or'](_0xf849('0x5b'),_0x4ed005+'%');_0x1929b7['or'](_0xf849('0x5c'),_0x4ed005+'%');}else if(qs['isEmail'](_0x4ed005)){_0x1929b7['or'](_0xf849('0x5d'),_0x4ed005+'%');}else{_0x1929b7['or'](_0xf849('0x5e'),'%'+_0x4ed005+'%');_0x1929b7['or']('c.lastName\x20LIKE\x20?','%'+_0x4ed005+'%');_0x1929b7['or'](_0xf849('0x5d'),'%'+_0x4ed005+'%');}}}}_0x1ec669['where'](_0x1929b7);_0x1ec669[_0xf849('0x5f')]('c.id');var _0xb39745={'type':db[_0xf849('0x60')][_0xf849('0x61')][_0xf849('0x62')],'raw':!![]};var _0x4399aa=_0x1ec669[_0xf849('0x63')]()['field']('c.id');if(_0x887cea[_0xf849('0x2d')]){_0x887cea['order'][_0xf849('0x51')](function(_0xcef24c){_0x1ec669[_0xf849('0x2d')]('c.'+_0xcef24c[0x0],_0xcef24c[0x1]===_0xf849('0x64')?![]:!![]);});}if(!_[_0xf849('0x50')](_0x24f1a0)){_0x1ec669[_0xf849('0x65')](_0xef538e);_0x4399aa[_0xf849('0x2f')](_0xf849('0x66'),_0x24f1a0);}BPromise[_0xf849('0x67')]()[_0xf849('0x16')](function(){if(!_0x5e31d8)return;if(_0x5c0136['user'][_0xf849('0x68')]!==_0xf849('0x69'))return;if(!_['some'](_0x5e31d8[_0xf849('0x3d')],[_0xf849('0x31'),'User'])){return _0x5c0136[_0xf849('0x6a')][_0xf849('0x6b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x310b10){if(_[_0xf849('0x50')](_0x310b10)){_0x4399aa[_0xf849('0x2f')](_0xf849('0x6c'));_0x1ec669['where'](_0xf849('0x6c'));}else{_0x4399aa[_0xf849('0x2f')](_0xf849('0x6d'),_[_0xf849('0x42')](_0x310b10,'id'));_0x1ec669[_0xf849('0x2f')](_0xf849('0x6d'),_[_0xf849('0x42')](_0x310b10,'id'));}});}})[_0xf849('0x16')](function(){if(_0x5c0136[_0xf849('0x6a')]['role']===_0xf849('0x69')&&!_0x5e31d8&&!_0x5c0136[_0xf849('0x27')]['ListId'])return[];return db[_0xf849('0x6e')][_0xf849('0x27')](_0x4399aa[_0xf849('0x6f')](),_0xb39745);})[_0xf849('0x16')](function(_0x1cf5d3){_0xd19a26['count']=_0x1cf5d3[_0xf849('0x1e')];if(_0xd19a26[_0xf849('0x13')]===0x0)return[];return db[_0xf849('0x6e')][_0xf849('0x27')](_0x5c06ad['toString'](),_0xb39745)[_0xf849('0x16')](function(_0x50597e){_0xe3c6d8=_['keyBy'](_0x50597e,'id');_0xb39745=_[_0xf849('0x70')](_0xb39745,{'model':db[_0xf849('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5c0136['query'][_0xf849('0x2a')]){_0x887cea[_0xf849('0x2b')][_0xf849('0x51')](function(_0x2194fd){_0x1ec669[_0xf849('0x31')]('c.'+_0x2194fd);});}else{_0x1ec669[_0xf849('0x31')](_0xf849('0x71'));_0x1ec669['field'](_0xf849('0x72'));_0x1ec669['field'](_0xf849('0x73'));_0x1ec669[_0xf849('0x31')](_0xf849('0x74'));_0x1ec669[_0xf849('0x31')](_0xf849('0x75'));_0x1ec669['field']('c.fax');_0x1ec669[_0xf849('0x31')]('c.email');_0x1ec669['field'](_0xf849('0x76'));_0x1ec669[_0xf849('0x31')](_0xf849('0x77'));_0x1ec669['field'](_0xf849('0x78'));_0x1ec669[_0xf849('0x31')](_0xf849('0x79'));_0x1ec669[_0xf849('0x31')](_0xf849('0x7a'),_0xf849('0x7b'));}if(_0x887cea[_0xf849('0x11')])_0x1ec669[_0xf849('0x11')](_0x887cea['limit']);if(_0x887cea['offset'])_0x1ec669[_0xf849('0x10')](_0x887cea['offset']);return db[_0xf849('0x6e')]['query'](_0x1ec669['toString'](),_0xb39745);});})['then'](function(_0x1bc6d4){_0x1bc6d4[_0xf849('0x51')](function(_0x49180d){if(_0x49180d[_0xf849('0x7b')]){_0x49180d[_0xf849('0x7c')]=[];_0x49180d['TagIds'][_0xf849('0x41')](',')[_0xf849('0x51')](function(_0x2c132b){_0x49180d[_0xf849('0x7c')][_0xf849('0x22')](_0xe3c6d8[_0x2c132b]);});}delete _0x49180d[_0xf849('0x7b')];});_0xd19a26['rows']=_0x1bc6d4;return _0xd19a26;})[_0xf849('0x16')](respondWithFilteredResult(_0x3ecedc,_0x887cea));})[_0xf849('0x7d')](handleError(_0x3ecedc,null));};exports[_0xf849('0x15')]=function(_0x1c4a7b,_0x3f76cc){return db[_0xf849('0x1d')][_0xf849('0x3e')]({'where':{'id':_0x1c4a7b[_0xf849('0x7e')]['id']}})['then'](handleEntityNotFound(_0x3f76cc,null))['then'](removeEntity(_0x3f76cc,null))[_0xf849('0x7d')](handleError(_0x3f76cc,null));};exports[_0xf849('0x7f')]=function(_0x43578d,_0x1096b8){return db['CmContact'][_0xf849('0x7f')]()['then'](function(_0x10207c){delete _0x10207c[_0xf849('0x80')];for(var _0x148416=0x0;_0x1484160x0){return new Promise(function(_0x250bec,_0x1b8b4a){var _0x295caa=[];for(var _0x28e62a=0x0;_0x28e62a<_0x26a1b9[_0xf849('0x1e')];_0x28e62a++){_0x295caa['push'](insertAdditionalPhones(_0x26a1b9[_0x28e62a][_0xf849('0xae')],_0x26a1b9[_0x28e62a][_0xf849('0xa8')]));}Promise[_0xf849('0x24')](_0x295caa)['then'](function(){_0x250bec(0x1);});})['then'](function(){return{'success':_0x436419,'failure':_0x5bbe67,'duplicates':_0x149677};});}else{return{'success':_0x436419,'failure':_0x5bbe67,'duplicates':_0x149677};}}})[_0xf849('0x16')](respondWithResult(_0x2c977b,0xc9))[_0xf849('0x7d')](handleError(_0x2c977b,null));};exports[_0xf849('0xaf')]=function(_0x139cfe,_0x34e00c){var _0x4145fc;return db['CmContact'][_0xf849('0x7f')]()['then'](function(_0x4b9300){return db[_0xf849('0x1d')][_0xf849('0x3e')]({'where':{'id':_0x139cfe[_0xf849('0x7e')]['id']},'include':[{'model':db[_0xf849('0x3f')],'as':_0xf849('0x7c'),'attributes':['id',_0xf849('0x1b'),_0xf849('0x32')],'required':_0x139cfe['query'][_0xf849('0x55')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0xf849('0xb0'),'where':{'CmContactId':_0x139cfe['params']['id']},'required':![],'include':[{'model':db[_0xf849('0xb1')],'as':'ItemType'}]}],'order':[db[_0xf849('0x6e')][_0xf849('0xb2')](_0xf849('0xb3'))],'attributes':_['keys'](_0x4b9300)});})[_0xf849('0x16')](function(_0x26d6a5){if(!_[_0xf849('0x4e')](_0x26d6a5)){_0x4145fc=_0x26d6a5['get']({'plain':!![]});var _0x474ea0={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x26d6a5&&_0x26d6a5[_0xf849('0xb4')]){if(_0x26d6a5['ListId']){_0x474ea0[_0xf849('0x2f')][_0xf849('0xb5')][_0xf849('0x22')]({'ListId':{'$ne':_0x26d6a5[_0xf849('0xb4')]}});}}return db[_0xf849('0xb6')][_0xf849('0x84')](_0x474ea0);}})['then'](function(_0x282773){if(!_['isNil'](_0x282773)){return _['omit'](_0x4145fc,_[_0xf849('0x42')](_0x282773,function(_0xb1eac0){return util[_0xf849('0xb7')]('cf_%d',_0xb1eac0['id']);}));}})[_0xf849('0x16')](handleEntityNotFound(_0x34e00c,null))[_0xf849('0x16')](respondWithResult(_0x34e00c,null))[_0xf849('0x7d')](handleError(_0x34e00c,null));};exports[_0xf849('0x8f')]=function(_0x10af9b,_0x51e67d){var _0x26fe24;if(_0x10af9b[_0xf849('0x87')]['id']){delete _0x10af9b[_0xf849('0x87')]['id'];}if(!_['isNil'](_0x10af9b[_0xf849('0x87')]['dialTimezone'])){var _0x2a35fd=_0x10af9b[_0xf849('0x87')][_0xf849('0xa6')];if(!_[_0xf849('0x4e')](shared[_0xf849('0xb8')][_0x2a35fd]))_0x10af9b[_0xf849('0x87')][_0xf849('0xa7')]=shared[_0xf849('0xb8')][_0x2a35fd]['utcOffset'];}return db[_0xf849('0x1d')][_0xf849('0x3e')]({'where':{'id':_0x10af9b[_0xf849('0x7e')]['id']}})[_0xf849('0x16')](handleEntityNotFound(_0x51e67d,null))['then'](saveUpdates(_0x10af9b[_0xf849('0x87')],null))[_0xf849('0x16')](function(_0x2ab88f){_0x26fe24=_0x2ab88f;var _0x6e2832={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2ab88f&&_0x2ab88f[_0xf849('0xb4')]){if(_0x2ab88f[_0xf849('0xb4')]){_0x6e2832[_0xf849('0x2f')][_0xf849('0xb5')][_0xf849('0x22')]({'ListId':{'$ne':_0x2ab88f['ListId']}});}}return db[_0xf849('0xb6')][_0xf849('0x84')](_0x6e2832);})[_0xf849('0x16')](function(_0xc29a11){if(_0xc29a11){return _[_0xf849('0xb9')](_[_0xf849('0xba')](_0x10af9b[_0xf849('0x87')],function(_0x20498a,_0x311b71){return _[_0xf849('0x20')](_0x311b71,_0xf849('0x21'));}),_[_0xf849('0x42')](_0xc29a11,function(_0x1e332f){return util[_0xf849('0xb7')]('cf_%d',_0x1e332f['id']);}));}})[_0xf849('0x16')](function(_0x6ee29a){if(_0x6ee29a&&!_[_0xf849('0x50')](_0x6ee29a)){var _0x11e730=squel[_0xf849('0x8f')]()[_0xf849('0xbb')](_0xf849('0xbc'))[_0xf849('0xbd')](_0x6ee29a)['where'](_0xf849('0xbe'),_0x10af9b[_0xf849('0x7e')]['id'])[_0xf849('0xbf')]();return db[_0xf849('0x6e')][_0xf849('0x27')](_0x11e730[_0xf849('0x4a')],{'replacements':_0x11e730[_0xf849('0x86')]});}})[_0xf849('0x16')](function(){if(_0x10af9b[_0xf849('0x87')][_0xf849('0xc0')]&&_0x26fe24){return db[_0xf849('0x8b')][_0xf849('0x8f')]({'phone':_0x10af9b[_0xf849('0x87')][_0xf849('0xc0')],'OrderBy':0x0},{'where':{'ContactId':_0x26fe24['id']}});}})[_0xf849('0x16')](function(){return _0x26fe24;})['then'](respondWithResult(_0x51e67d,null))[_0xf849('0x7d')](handleError(_0x51e67d,null));};exports['getTags']=function(_0x1f0fcf,_0x1e4e0a){var _0xcc8ff={};var _0x3bf5a2={};var _0x4e9027;var _0x4e74de;return db['CmContact'][_0xf849('0x23')]({'where':{'id':_0x1f0fcf[_0xf849('0x7e')]['id']}})[_0xf849('0x16')](handleEntityNotFound(_0x1e4e0a,null))[_0xf849('0x16')](function(_0x4ce7fd){if(_0x4ce7fd){_0x4e9027=_0x4ce7fd;_0x3bf5a2['model']=_['keys'](db[_0xf849('0x3f')][_0xf849('0xc1')]);_0x3bf5a2['query']=_[_0xf849('0x1f')](_0x1f0fcf[_0xf849('0x27')]);_0x3bf5a2[_0xf849('0x28')]=_['intersection'](_0x3bf5a2['model'],_0x3bf5a2[_0xf849('0x27')]);_0xcc8ff[_0xf849('0x2b')]=_[_0xf849('0x29')](_0x3bf5a2[_0xf849('0x26')],qs['fields'](_0x1f0fcf['query'][_0xf849('0x2a')]));_0xcc8ff['attributes']=_0xcc8ff[_0xf849('0x2b')]['length']?_0xcc8ff[_0xf849('0x2b')]:_0x3bf5a2[_0xf849('0x26')];_0xcc8ff[_0xf849('0x2d')]=qs[_0xf849('0x2e')](_0x1f0fcf[_0xf849('0x27')]['sort']);_0xcc8ff[_0xf849('0x2f')]=qs['filters'](_[_0xf849('0xc2')](_0x1f0fcf[_0xf849('0x27')],_0x3bf5a2[_0xf849('0x28')]));if(_0x1f0fcf[_0xf849('0x27')][_0xf849('0x4d')]){_0xcc8ff[_0xf849('0x2f')]=_[_0xf849('0x70')](_0xcc8ff['where'],{'$or':_[_0xf849('0x42')](_0xcc8ff[_0xf849('0x2b')],function(_0x24520a){var _0x91aba8={};_0x91aba8[_0x24520a]={'$like':'%'+_0x1f0fcf[_0xf849('0x27')]['filter']+'%'};return _0x91aba8;})});}_0xcc8ff=_[_0xf849('0x70')]({},_0xcc8ff,_0x1f0fcf[_0xf849('0xc3')]);return _0x4e9027['getTags'](_0xcc8ff);}})['then'](function(_0x3cd78c){if(_0x3cd78c){_0x4e74de=_0x3cd78c[_0xf849('0x1e')];if(!_0x1f0fcf[_0xf849('0x27')][_0xf849('0x4c')]('nolimit')){_0xcc8ff['limit']=qs['limit'](_0x1f0fcf['query'][_0xf849('0x11')]);_0xcc8ff['offset']=qs['offset'](_0x1f0fcf[_0xf849('0x27')][_0xf849('0x10')]);}return _0x4e9027[_0xf849('0xc4')](_0xcc8ff);}})['then'](function(_0x24a5e9){if(_0x24a5e9){return _0x24a5e9?{'count':_0x4e74de,'rows':_0x24a5e9}:null;}})[_0xf849('0x16')](respondWithResult(_0x1e4e0a,null))['catch'](handleError(_0x1e4e0a,null));};exports[_0xf849('0xc5')]=function(_0x56c071,_0x5f4f5b){if(_0x56c071[_0xf849('0x87')]['id']){delete _0x56c071[_0xf849('0x87')]['id'];}return db['CmContact']['findOne']({'where':{'id':_0x56c071[_0xf849('0x7e')]['id']}})[_0xf849('0x16')](handleEntityNotFound(_0x5f4f5b,null))['then'](function(_0x5266aa){if(_0x5266aa){return _0x5266aa[_0xf849('0xc5')](_0x56c071['body']['ids']||[]);}return null;})[_0xf849('0x16')](respondWithResult(_0x5f4f5b,null))[_0xf849('0x7d')](handleError(_0x5f4f5b,null));};exports[_0xf849('0xc6')]=function(_0x35e936,_0x29423f){var _0x3b721a=[];_0x3b721a['push'](addAdditionalPhones(_0x35e936['body']));Promise[_0xf849('0x24')](_0x3b721a)['then'](function(){_0x3b721a=[];_0x3b721a[_0xf849('0x22')](deleteCmHopperPhones(_0x35e936[_0xf849('0x87')]['id']));_0x3b721a[_0xf849('0x22')](addCmHopperPhones(_0x35e936[_0xf849('0x87')]['id']));Promise[_0xf849('0x24')](_0x3b721a)[_0xf849('0x16')](function(){return[0x1];})[_0xf849('0x16')](respondWithResult(_0x29423f,null));});};function addAdditionalPhones(_0xd1c931){var _0x3a784b;return new Promise(function(_0x3a096c,_0x46e58c){return db[_0xf849('0x98')][_0xf849('0x15')]({'where':{'CmContactId':_0xd1c931['id']}})[_0xf849('0x16')](function(){db[_0xf849('0xb1')][_0xf849('0x84')]({'raw':!![],'attributes':['id',_0xf849('0xc7')]})['then'](function(_0x3a8fa7){var _0x116ed8=[];for(var _0x181098=0x0;_0x181098<_0xd1c931[_0xf849('0xc8')]['length'];_0x181098++){var _0x1ef350=_0xd1c931['item_types']?_[_0xf849('0x4e')](_0xd1c931[_0xf849('0xc9')][_0x181098])?'':_0xd1c931[_0xf849('0xc9')][_0x181098]:_0xd1c931['items'][_0x181098][_0xf849('0xca')]?_0xd1c931['items'][_0x181098][_0xf849('0xca')]:'';var _0x265958=_[_0xf849('0x4e')](_0xd1c931[_0xf849('0xc8')][_0x181098][_0xf849('0xcb')])?'':_0xd1c931[_0xf849('0xc8')][_0x181098]['description'];var _0x56e91f=_0x1ef350+':'+_0xd1c931[_0xf849('0xc8')][_0x181098]['phone']+'§'+_0x265958;if(_['isNil'](_0x3a784b))_0x3a784b=_0x56e91f;else _0x3a784b+=';'+_0x56e91f;var _0x2dc807=null;if(_0xd1c931[_0xf849('0xc9')]){if(!_[_0xf849('0x4e')](_0xd1c931['item_types'][_0x181098])){var _0x2788b7=_['find'](_0x3a8fa7,function(_0x3f8ec7){return _0x3f8ec7['id']===_0xd1c931['item_types'][_0x181098];});if(!_['isNil'](_0x2788b7)){_0x2dc807=_0x2788b7['OrderBy'];}}}else{if(!_[_0xf849('0x4e')](_0xd1c931[_0xf849('0xc8')][_0x181098])){var _0x2788b7=_[_0xf849('0x3e')](_0x3a8fa7,function(_0x52365c){return _0x52365c['id']===_0xd1c931[_0xf849('0xc8')][_0x181098][_0xf849('0xca')];});if(!_['isNil'](_0x2788b7)){_0x2dc807=_0x181098;}}}if(_[_0xf849('0x4e')](_0x2dc807)){_0x2dc807=0x64;}_0x116ed8[_0xf849('0x22')](addAdditionalPhone(_0xd1c931['id'],_0xd1c931[_0xf849('0xc8')][_0x181098][_0xf849('0xc0')],_0xd1c931['item_types']?_[_0xf849('0x4e')](_0xd1c931[_0xf849('0xc9')][_0x181098])?null:_0xd1c931[_0xf849('0xc9')][_0x181098]:_0xd1c931[_0xf849('0xc8')][_0x181098][_0xf849('0xca')]?_0xd1c931[_0xf849('0xc8')][_0x181098][_0xf849('0xca')]:null,_0x2dc807,_0x265958));}Promise[_0xf849('0x24')](_0x116ed8)[_0xf849('0x16')](function(){db['CmContact'][_0xf849('0x8f')]({'AdditionalPhones':_0x3a784b},{'where':{'id':_0xd1c931['id']}})[_0xf849('0x16')](function(){_0x3a096c(0x1);});});});});});}function addAdditionalPhone(_0x306380,_0x2a35c9,_0x40537c,_0x124322,_0x56ff9f){return db[_0xf849('0x98')][_0xf849('0x3e')]({'where':{'CmContactId':_0x306380,'item':_0x2a35c9}})[_0xf849('0x16')](function(_0x3cfea5){if(_0x3cfea5)logger[_0xf849('0x8a')](_0xf849('0xcc'),_0x3cfea5);else{db['CmContactHasItem'][_0xf849('0x8e')]({'CmContactId':_0x306380,'item':_0x2a35c9,'ItemTypeId':_0x40537c,'OrderBy':_0x124322,'ItemClass':_0xf849('0xcd'),'description':_0x56ff9f});}});}function deletePhones(_0x28132b){return db[_0xf849('0x98')][_0xf849('0x15')]({'where':{'CmContactId':_0x28132b}});}function deleteCmHopperPhones(_0x367f14){return new Promise(function(_0x26d49c,_0x3c0ba6){return db['CmHopper'][_0xf849('0x84')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x367f14}})[_0xf849('0x16')](function(_0x405676){db[_0xf849('0xce')][_0xf849('0x15')]({'where':{'CmHopperId':{'$in':_['map'](_0x405676,'id')}}});})[_0xf849('0x16')](function(){_0x26d49c(0x1);});});}function addCmHopperPhones(_0x69f2c4){return new Promise(function(_0x330ce4,_0x4cf13b){return db[_0xf849('0x8b')][_0xf849('0x84')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x69f2c4}})[_0xf849('0x16')](function(_0x5c939f){var _0x39d085=[];_[_0xf849('0x42')](_0x5c939f,function(_0x4d4fc9){_0x39d085[_0xf849('0x22')](createCmHopperPhone(_0x69f2c4,_0x4d4fc9['id']));});Promise[_0xf849('0x24')](_0x39d085)[_0xf849('0x16')](function(){_0x330ce4(0x1);});});});}function createCmHopperPhone(_0x3d7c11,_0x38e24f){return new Promise(function(_0x3af4e5,_0x3174b6){db[_0xf849('0x98')][_0xf849('0x84')]({'raw':!![],'attributes':[_0xf849('0xcf'),_0xf849('0xc7')],'where':{'CmContactId':_0x3d7c11,'ItemClass':_0xf849('0xcd')},'include':[{'model':db[_0xf849('0xb1')],'attributes':[_0xf849('0xc7')],'as':_0xf849('0xd0')}],'order':[_0xf849('0xc7'),db['sequelize']['literal'](_0xf849('0xd1'))]})[_0xf849('0x16')](function(_0x2a80ac){var _0xc51044=0x1;var _0x1e2da5=_['map'](_0x2a80ac,function(_0x2d086e){_0x2d086e['CmHopperId']=_0x38e24f;_0x2d086e['phone']=_0x2d086e[_0xf849('0xcf')];_0x2d086e[_0xf849('0xc7')]=_0xc51044;delete _0x2d086e[_0xf849('0xd2')];_0xc51044=_0xc51044+0x1;return _0x2d086e;});return db[_0xf849('0xce')][_0xf849('0xa9')](_0x1e2da5,{});})[_0xf849('0x16')](function(){_0x3af4e5(0x1);});});}function insertAdditionalPhones(_0x473b87,_0x390b17){return new Promise(function(_0x2635c3,_0x471504){var _0x3f1151=[];for(var _0x12e276=0x0;_0x12e276<_0x390b17[_0xf849('0x1e')];_0x12e276++){var _0xf466d=_0x390b17[_0x12e276];_0x3f1151[_0xf849('0x22')](parseContactItemType(_0xf466d));}Promise[_0xf849('0x24')](_0x3f1151)[_0xf849('0x16')](function(){var _0x17c659={'id':_0x473b87['id'],'items':_0x390b17};return addAdditionalPhones(_0x17c659)['then'](function(_0x2d131c){return addCmHopperPhones(_0x473b87['id']);});})[_0xf849('0x16')](function(){_0x2635c3(_0x473b87);});});}function parseContactItemType(_0x4133e8){return new Promise(function(_0x2934b0,_0x4d2b17){if(_0x4133e8['hasOwnProperty']('ItemTypeId')){_0x2934b0(_0x4133e8);}else{return db['ContactItemType'][_0xf849('0x3e')]({'where':{'name':_0x4133e8['ItemType']}})[_0xf849('0x16')](function(_0x1030d7){if(_[_0xf849('0x4e')](_0x1030d7))_0x4133e8[_0xf849('0xca')]=null;else _0x4133e8[_0xf849('0xca')]=_0x1030d7['id'];_0x2934b0(_0x4133e8);});}});}exports[_0xf849('0xd3')]=function(_0x4ffbeb,_0x501542){return db[_0xf849('0x98')][_0xf849('0x84')]({'raw':!![],'where':{'CmContactId':_0x4ffbeb[_0xf849('0x7e')]['id'],'ItemClass':_0xf849('0xcd')},'include':[{'model':db[_0xf849('0xb1')],'as':'ItemType'}],'order':[['OrderBy'],[db[_0xf849('0x6e')]['literal'](_0xf849('0xd1'))]]})[_0xf849('0x16')](function(_0x176882){return _0x176882;})[_0xf849('0x16')](respondWithResult(_0x501542,null))[_0xf849('0x7d')](handleError(_0x501542,null));};exports[_0xf849('0xd4')]=function(_0x12deb2,_0x3b9de8){return db[_0xf849('0x98')][_0xf849('0x84')]({'raw':!![],'where':{'CmContactId':_0x12deb2['body'][_0xf849('0xd5')]}})['then'](function(_0x5c4eb3){var _0x56ccfa=_['map'](_0x5c4eb3,function(_0x50b544){_0x50b544['CmContactId']=_0x12deb2['body'][_0xf849('0xd6')];return _0x50b544;});return db[_0xf849('0x98')]['bulkCreate'](_0x56ccfa,{});})['then'](function(_0x3baed7){return addCmHopperPhones(_0x12deb2[_0xf849('0x87')][_0xf849('0xd6')]);})[_0xf849('0x16')](function(_0x16ab47){return['ok'];})[_0xf849('0x16')](respondWithResult(_0x3b9de8,null))[_0xf849('0x7d')](handleError(_0x3b9de8,null));};exports[_0xf849('0xd7')]=function(_0x195679,_0x1dc0ba){var _0x103b9b=[];_0x103b9b[_0xf849('0x22')](createCmHopperPhone(_0x195679[_0xf849('0x87')]['id'],_0x195679[_0xf849('0x87')][_0xf849('0xd8')]));Promise[_0xf849('0x24')](_0x103b9b)[_0xf849('0x16')](function(){return[0x1];})[_0xf849('0x16')](respondWithResult(_0x1dc0ba,null));};exports['getHoppers']=function(_0x2d309f,_0x18b194){var _0x525405={'raw':![],'where':{}};var _0x5525cd={};var _0x5e2bd9={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x2d309f[_0xf849('0x7e')]['id']}})['then'](handleEntityNotFound(_0x18b194,null))[_0xf849('0x16')](function(_0xbd510e){if(_0xbd510e){_0x5525cd[_0xf849('0x26')]=_[_0xf849('0x1f')](db[_0xf849('0x8b')][_0xf849('0xc1')]);_0x5525cd[_0xf849('0x27')]=_[_0xf849('0x1f')](_0x2d309f[_0xf849('0x27')]);_0x5525cd[_0xf849('0x28')]=_['intersection'](_0x5525cd[_0xf849('0x26')],_0x5525cd['query']);_0x525405['attributes']=_['intersection'](_0x5525cd['model'],qs[_0xf849('0x2a')](_0x2d309f[_0xf849('0x27')][_0xf849('0x2a')]));_0x525405['attributes']=_0x525405[_0xf849('0x2b')][_0xf849('0x1e')]?_0x525405[_0xf849('0x2b')]:_0x5525cd[_0xf849('0x26')];if(!_0x2d309f[_0xf849('0x27')][_0xf849('0x4c')](_0xf849('0x2c'))){_0x525405[_0xf849('0x11')]=qs['limit'](_0x2d309f[_0xf849('0x27')][_0xf849('0x11')]);_0x525405[_0xf849('0x10')]=qs[_0xf849('0x10')](_0x2d309f[_0xf849('0x27')][_0xf849('0x10')]);}_0x525405['order']=qs['sort'](_0x2d309f[_0xf849('0x27')][_0xf849('0x2e')]);_0x525405[_0xf849('0x2f')]=qs[_0xf849('0x28')](_['pick'](_0x2d309f[_0xf849('0x27')],_0x5525cd['filters']));_0x525405['where'][_0xf849('0xd9')]=_0xbd510e['id'];if(_0x2d309f[_0xf849('0x27')]['filter']){_0x525405[_0xf849('0x2f')]=_['merge'](_0x525405[_0xf849('0x2f')],{'$or':_[_0xf849('0x42')](_0x525405['attributes'],function(_0x2201de){var _0x23909a={};_0x23909a[_0x2201de]={'$like':'%'+_0x2d309f[_0xf849('0x27')][_0xf849('0x4d')]+'%'};return _0x23909a;})});}_0x525405=_[_0xf849('0x70')]({},_0x525405,_0x2d309f[_0xf849('0xc3')]);return db[_0xf849('0x8b')][_0xf849('0x13')]({'where':_0x525405['where']})['then'](function(_0x31c3c7){_0x5e2bd9['count']=_0x31c3c7;if(_0x2d309f[_0xf849('0x27')][_0xf849('0xda')]){_0x525405['include']=[{'all':!![]}];}return db['CmHopper'][_0xf849('0x84')](_0x525405);})[_0xf849('0x16')](function(_0x1568e4){_0x5e2bd9['rows']=_0x1568e4;return _0x5e2bd9;});}})['then'](respondWithFilteredResult(_0x18b194,_0x525405))[_0xf849('0x7d')](handleError(_0x18b194,null));};exports[_0xf849('0xdb')]=function(_0x66b89e,_0x577dd8){var _0x407525={'raw':!![],'where':{}};var _0xfa4039={};var _0x42fba7={'count':0x0,'rows':[]};return db[_0xf849('0x1d')][_0xf849('0x23')]({'where':{'id':_0x66b89e[_0xf849('0x7e')]['id']}})[_0xf849('0x16')](handleEntityNotFound(_0x577dd8,null))['then'](function(_0x4954f2){if(_0x4954f2){_0xfa4039[_0xf849('0x26')]=_['keys'](db[_0xf849('0x9a')][_0xf849('0xc1')]);_0xfa4039[_0xf849('0x27')]=_[_0xf849('0x1f')](_0x66b89e[_0xf849('0x27')]);_0xfa4039[_0xf849('0x28')]=_[_0xf849('0x29')](_0xfa4039[_0xf849('0x26')],_0xfa4039[_0xf849('0x27')]);_0x407525[_0xf849('0x2b')]=_[_0xf849('0x29')](_0xfa4039[_0xf849('0x26')],qs[_0xf849('0x2a')](_0x66b89e[_0xf849('0x27')]['fields']));_0x407525[_0xf849('0x2b')]=_0x407525[_0xf849('0x2b')][_0xf849('0x1e')]?_0x407525[_0xf849('0x2b')]:_0xfa4039[_0xf849('0x26')];if(!_0x66b89e[_0xf849('0x27')]['hasOwnProperty'](_0xf849('0x2c'))){_0x407525[_0xf849('0x11')]=qs[_0xf849('0x11')](_0x66b89e[_0xf849('0x27')][_0xf849('0x11')]);_0x407525['offset']=qs['offset'](_0x66b89e[_0xf849('0x27')][_0xf849('0x10')]);}_0x407525[_0xf849('0x2d')]=qs[_0xf849('0x2e')](_0x66b89e['query'][_0xf849('0x2e')]);_0x407525[_0xf849('0x2f')]=qs[_0xf849('0x28')](_['pick'](_0x66b89e['query'],_0xfa4039['filters']));_0x407525[_0xf849('0x2f')][_0xf849('0xd9')]=_0x4954f2['id'];if(_0x66b89e['query']['filter']){_0x407525[_0xf849('0x2f')]=_[_0xf849('0x70')](_0x407525[_0xf849('0x2f')],{'$or':_[_0xf849('0x42')](_0x407525[_0xf849('0x2b')],function(_0x512f11){var _0x5a9085={};_0x5a9085[_0x512f11]={'$like':'%'+_0x66b89e[_0xf849('0x27')][_0xf849('0x4d')]+'%'};return _0x5a9085;})});}_0x407525=_[_0xf849('0x70')]({},_0x407525,_0x66b89e[_0xf849('0xc3')]);return db[_0xf849('0x9a')][_0xf849('0x13')]({'where':_0x407525[_0xf849('0x2f')]})[_0xf849('0x16')](function(_0x34697e){_0x42fba7[_0xf849('0x13')]=_0x34697e;if(_0x66b89e[_0xf849('0x27')][_0xf849('0xda')]){_0x407525[_0xf849('0xdc')]=[{'all':!![]}];}return db[_0xf849('0x9a')]['findAll'](_0x407525);})[_0xf849('0x16')](function(_0x511e89){_0x42fba7[_0xf849('0xdd')]=_0x511e89;return _0x42fba7;});}})[_0xf849('0x16')](respondWithFilteredResult(_0x577dd8,_0x407525))[_0xf849('0x7d')](handleError(_0x577dd8,null));};exports['getHopperFinals']=function(_0x238c74,_0x1716b9){var _0x2fc80d={'raw':!![],'where':{}};var _0x61a00b={};var _0x424697={'count':0x0,'rows':[]};return db[_0xf849('0x1d')][_0xf849('0x23')]({'where':{'id':_0x238c74[_0xf849('0x7e')]['id']}})[_0xf849('0x16')](handleEntityNotFound(_0x1716b9,null))[_0xf849('0x16')](function(_0x313ec5){if(_0x313ec5){_0x61a00b[_0xf849('0x26')]=_[_0xf849('0x1f')](db[_0xf849('0x99')][_0xf849('0xc1')]);_0x61a00b[_0xf849('0x27')]=_[_0xf849('0x1f')](_0x238c74[_0xf849('0x27')]);_0x61a00b[_0xf849('0x28')]=_[_0xf849('0x29')](_0x61a00b['model'],_0x61a00b[_0xf849('0x27')]);_0x2fc80d['attributes']=_[_0xf849('0x29')](_0x61a00b[_0xf849('0x26')],qs['fields'](_0x238c74[_0xf849('0x27')][_0xf849('0x2a')]));_0x2fc80d[_0xf849('0x2b')]=_0x2fc80d[_0xf849('0x2b')]['length']?_0x2fc80d[_0xf849('0x2b')]:_0x61a00b[_0xf849('0x26')];if(!_0x238c74[_0xf849('0x27')]['hasOwnProperty'](_0xf849('0x2c'))){_0x2fc80d['limit']=qs['limit'](_0x238c74[_0xf849('0x27')][_0xf849('0x11')]);_0x2fc80d[_0xf849('0x10')]=qs[_0xf849('0x10')](_0x238c74['query'][_0xf849('0x10')]);}_0x2fc80d[_0xf849('0x2d')]=qs[_0xf849('0x2e')](_0x238c74['query'][_0xf849('0x2e')]);_0x2fc80d['where']=qs[_0xf849('0x28')](_[_0xf849('0xc2')](_0x238c74[_0xf849('0x27')],_0x61a00b[_0xf849('0x28')]));_0x2fc80d[_0xf849('0x2f')][_0xf849('0xd9')]=_0x313ec5['id'];if(_0x238c74[_0xf849('0x27')][_0xf849('0x4d')]){_0x2fc80d[_0xf849('0x2f')]=_['merge'](_0x2fc80d[_0xf849('0x2f')],{'$or':_['map'](_0x2fc80d[_0xf849('0x2b')],function(_0x3a1d22){var _0x43492f={};_0x43492f[_0x3a1d22]={'$like':'%'+_0x238c74[_0xf849('0x27')][_0xf849('0x4d')]+'%'};return _0x43492f;})});}_0x2fc80d=_[_0xf849('0x70')]({},_0x2fc80d,_0x238c74[_0xf849('0xc3')]);return db[_0xf849('0x99')][_0xf849('0x13')]({'where':_0x2fc80d[_0xf849('0x2f')]})['then'](function(_0x1bb037){_0x424697[_0xf849('0x13')]=_0x1bb037;if(_0x238c74['query'][_0xf849('0xda')]){_0x2fc80d[_0xf849('0xdc')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2fc80d);})[_0xf849('0x16')](function(_0x1422e){_0x424697[_0xf849('0xdd')]=_0x1422e;return _0x424697;});}})[_0xf849('0x16')](respondWithFilteredResult(_0x1716b9,_0x2fc80d))[_0xf849('0x7d')](handleError(_0x1716b9,null));};exports['getJscriptySessions']=function(_0x4de89,_0x2d7d23){var _0x13fc59={'raw':!![],'where':{}};var _0x48ac98={};var _0x1046ee={'count':0x0,'rows':[]};return db[_0xf849('0x1d')]['findOne']({'where':{'id':_0x4de89['params']['id']}})['then'](handleEntityNotFound(_0x2d7d23,null))[_0xf849('0x16')](function(_0x3faf3e){if(_0x3faf3e){_0x48ac98[_0xf849('0x26')]=_[_0xf849('0x1f')](db[_0xf849('0xa1')][_0xf849('0xc1')]);_0x48ac98[_0xf849('0x27')]=_[_0xf849('0x1f')](_0x4de89[_0xf849('0x27')]);_0x48ac98[_0xf849('0x28')]=_[_0xf849('0x29')](_0x48ac98[_0xf849('0x26')],_0x48ac98[_0xf849('0x27')]);_0x13fc59['attributes']=_[_0xf849('0x29')](_0x48ac98['model'],qs['fields'](_0x4de89[_0xf849('0x27')][_0xf849('0x2a')]));_0x13fc59['attributes']=_0x13fc59['attributes'][_0xf849('0x1e')]?_0x13fc59[_0xf849('0x2b')]:_0x48ac98[_0xf849('0x26')];if(!_0x4de89[_0xf849('0x27')]['hasOwnProperty'](_0xf849('0x2c'))){_0x13fc59[_0xf849('0x11')]=qs['limit'](_0x4de89[_0xf849('0x27')][_0xf849('0x11')]);_0x13fc59['offset']=qs[_0xf849('0x10')](_0x4de89[_0xf849('0x27')][_0xf849('0x10')]);}_0x13fc59[_0xf849('0x2d')]=qs['sort'](_0x4de89[_0xf849('0x27')][_0xf849('0x2e')]);_0x13fc59[_0xf849('0x2f')]=qs['filters'](_[_0xf849('0xc2')](_0x4de89[_0xf849('0x27')],_0x48ac98[_0xf849('0x28')]));_0x13fc59['where'][_0xf849('0xd9')]=_0x3faf3e['id'];if(_0x4de89[_0xf849('0x27')][_0xf849('0x4d')]){_0x13fc59[_0xf849('0x2f')]=_[_0xf849('0x70')](_0x13fc59[_0xf849('0x2f')],{'$or':_['map'](_0x13fc59[_0xf849('0x2b')],function(_0xd423d7){var _0x13ae69={};_0x13ae69[_0xd423d7]={'$like':'%'+_0x4de89['query']['filter']+'%'};return _0x13ae69;})});}_0x13fc59=_[_0xf849('0x70')]({},_0x13fc59,_0x4de89[_0xf849('0xc3')]);return db[_0xf849('0xa1')][_0xf849('0x13')]({'where':_0x13fc59[_0xf849('0x2f')]})[_0xf849('0x16')](function(_0x1ca1e8){_0x1046ee[_0xf849('0x13')]=_0x1ca1e8;if(_0x4de89[_0xf849('0x27')][_0xf849('0xda')]){_0x13fc59['include']=[{'all':!![]}];}return db[_0xf849('0xa1')][_0xf849('0x84')](_0x13fc59);})[_0xf849('0x16')](function(_0x22b5fa){_0x1046ee[_0xf849('0xdd')]=_0x22b5fa;return _0x1046ee;});}})['then'](respondWithFilteredResult(_0x2d7d23,_0x13fc59))[_0xf849('0x7d')](handleError(_0x2d7d23,null));};exports[_0xf849('0xde')]=function(_0x5dbe8d,_0x2c51f2){try{if(!_0x5dbe8d[_0xf849('0x87')][_0xf849('0xb4')]){throw new Error(_0xf849('0xdf'));}if(!_0x5dbe8d['body'][_0xf849('0xe0')]){throw new Error(_0xf849('0xe1'));}if(!_0x5dbe8d[_0xf849('0x87')][_0xf849('0xe2')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x5dbe8d[_0xf849('0x87')][_0xf849('0xe3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3f624c=_0x5dbe8d['body']['binding_keys'][_0xf849('0x41')](',');var _0x27db14=_0x5dbe8d[_0xf849('0x87')][_0xf849('0xe2')]['split'](',');if(!_0x3f624c[_0xf849('0x1e')]||!_0x27db14[_0xf849('0x1e')]||_0x3f624c['length']!==_0x27db14[_0xf849('0x1e')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x5dbe8d[_0xf849('0x87')][_0xf849('0x2a')]=_[_0xf849('0xe4')](_0x3f624c,_0x27db14);if(!_0x5dbe8d['body'][_0xf849('0x2a')][_0xf849('0xc0')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5dbe8d[_0xf849('0x87')]['fields']['firstName']){throw new Error(_0xf849('0xe5'));}var _0xa9525c=path[_0xf849('0xa5')](config[_0xf849('0xe6')],_0xf849('0xe7'),_0x5dbe8d[_0xf849('0xe8')][_0xf849('0xe9')]);fs[_0xf849('0xea')](_0xa9525c,parseInt(_0xf849('0xeb'),0x8));var _0x32dd56=require('child_process')[_0xf849('0xec')](path[_0xf849('0xa5')](__dirname,'../../components/import/cm/csv'),[_0xa9525c,_0x5dbe8d[_0xf849('0x87')][_0xf849('0xe0')],_0x5dbe8d[_0xf849('0x87')]['binding_values'],_0x5dbe8d[_0xf849('0x87')][_0xf849('0xb4')],_0x5dbe8d[_0xf849('0x87')]['CompanyId'],_0x5dbe8d[_0xf849('0x87')]['duplicates'],_0x5dbe8d[_0xf849('0x87')][_0xf849('0xe3')]]);return _0x2c51f2[_0xf849('0xe')](0xc8)[_0xf849('0xf')]({'message':_0xf849('0xed'),'pid':_0x32dd56[_0xf849('0xee')]});}catch(_0x5f0fd2){return _0x2c51f2[_0xf849('0xe')](0x1f4)[_0xf849('0xef')](_0x5f0fd2);}};exports[_0xf849('0xf0')]=function(_0x2053db,_0x5ba62d){var _0x44ab3d=fs[_0xf849('0xf1')](_0x2053db[_0xf849('0xe8')][_0xf849('0xf2')]);Papa[_0xf849('0xf3')](_0x44ab3d,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x300f9a){return _0x5ba62d[_0xf849('0xe')](0xc8)[_0xf849('0xf')]({'file':_0x2053db[_0xf849('0xe8')],'fields':_0x300f9a[_0xf849('0xf4')][_0xf849('0x2a')]});}});};exports[_0xf849('0xf5')]=function(_0x301147,_0x403b33){return db['User'][_0xf849('0x84')]({'raw':!![],'attributes':['id'],'where':{'role':_0xf849('0x69')}})[_0xf849('0x16')](function(_0x1c4bb4){var _0x43378f=![];if(!_0x301147[_0xf849('0x87')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x301147['body']['binding'][_0xf849('0xc0')]){throw new Error(_0xf849('0xf6'));}if(!_0x301147[_0xf849('0x87')][_0xf849('0xf7')]['firstName']){throw new Error(_0xf849('0xe5'));}if(!_0x301147['body'][_0xf849('0xe3')]){throw new Error(_0xf849('0xf8'));}var _0x192351=require(_0xf849('0xf9'))['fork'](path[_0xf849('0xa5')](__dirname,_0xf849('0xfa')),[_0x301147[_0xf849('0x7e')]['id'],JSON[_0xf849('0xfb')](_0x301147[_0xf849('0x87')]),JSON[_0xf849('0xfb')](_0x1c4bb4)]);_0x192351['on'](_0xf849('0xfc'),function(){_0x43378f=!![];return _0x403b33[_0xf849('0xe')](0xc8)[_0xf849('0xf')]({'message':_0xf849('0xfd'),'pid':_0x192351[_0xf849('0xee')]});});_0x192351['on'](_0xf849('0xfe'),function(_0x662f8e){if(_0x662f8e&&!_0x43378f){return _0x403b33['status'](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x192351[_0xf849('0xee')]});}});})[_0xf849('0x7d')](handleError(_0x403b33,null));};exports[_0xf849('0xff')]=function(_0x11d72f,_0x1f1273,_0xe421a8){return db[_0xf849('0x100')][_0xf849('0x84')]({'raw':!![],'attributes':['id'],'where':{'role':_0xf849('0x69')}})[_0xf849('0x16')](function(_0x74bcbf){var _0x17c59e=![];if(!_0x11d72f['body']['ListId']){throw new Error(_0xf849('0xdf'));}if(!_0x11d72f['body'][_0xf849('0xf7')][_0xf849('0xc0')]){throw new Error(_0xf849('0xf6'));}if(!_0x11d72f[_0xf849('0x87')][_0xf849('0xf7')][_0xf849('0x101')]){throw new Error(_0xf849('0xe5'));}if(!_0x11d72f['body'][_0xf849('0xe3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1160be=require(_0xf849('0xf9'))[_0xf849('0xec')](path['join'](__dirname,_0xf849('0x102')),[_0x11d72f[_0xf849('0x7e')]['id'],JSON[_0xf849('0xfb')](_0x11d72f[_0xf849('0x87')]),JSON['stringify'](_0x74bcbf)]);_0x1160be['on']('message',function(_0x1c6b27){_0x17c59e=!![];return _0x1f1273['status'](0xc8)[_0xf849('0xf')]({'message':_0xf849('0xfd'),'pid':_0x1160be[_0xf849('0xee')]});});_0x1160be['on']('exit',function(_0x22be10){if(_0x22be10&&!_0x17c59e){return _0x1f1273[_0xf849('0xe')](0x1f4)[_0xf849('0xf')]({'message':'error\x20child\x20process','pid':_0x1160be[_0xf849('0xee')]});}});})[_0xf849('0x7d')](handleError(_0x1f1273,null));};exports[_0xf849('0x103')]=function(_0x44866a,_0x38f3f0){var _0x41abd9=[_0xf849('0x104'),'chat',_0xf849('0x105'),_0xf849('0x106'),_0xf849('0x107'),_0xf849('0x108'),_0xf849('0x109')];var _0x4246bc={'offset':0x0,'order':qs['sort'](_0xf849('0x10a'))},_0x4e63fb={'count':0x0,'rows':[]};Promise[_0xf849('0x67')]()[_0xf849('0x16')](function(){if(_0x44866a[_0xf849('0x27')]['channel']){if(!_[_0xf849('0x10b')](_0x41abd9,_0x44866a[_0xf849('0x27')]['channel']['toLowerCase']())){throw new Error(_0xf849('0x10c'));}_0x41abd9=[_0x44866a[_0xf849('0x27')][_0xf849('0x10d')][_0xf849('0x10e')]()];}if(_0x44866a[_0xf849('0x27')][_0xf849('0x10f')]){try{var _0x555ae8=JSON[_0xf849('0xf3')](_0x44866a['query']['range']);if(!moment(_0x555ae8[_0xf849('0x34')])[_0xf849('0x110')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x555ae8['to'])[_0xf849('0x110')]()){throw new Error(_0xf849('0x111'));}}catch(_0x577dc5){throw new Error(_0xf849('0x112'));}}if(!_0x44866a[_0xf849('0x27')][_0xf849('0x4c')](_0xf849('0x2c'))){_0x4246bc['limit']=qs[_0xf849('0x11')](_0x44866a[_0xf849('0x27')][_0xf849('0x11')]||0xa);_0x4246bc[_0xf849('0x10')]=qs[_0xf849('0x10')](_0x44866a[_0xf849('0x27')][_0xf849('0x10')]);}var _0x339586=_0x41abd9[_0xf849('0x42')](function(_0x1693a0){if(_0x1693a0===_0xf849('0x109')){var _0x21925c={'attributes':['id',_0xf849('0x113'),'type',_0xf849('0x114'),_0xf849('0x115'),'callerid',_0xf849('0x116'),_0xf849('0x117'),'duration','note',_0xf849('0x118'),_0xf849('0x119'),'userSecondDisposition',_0xf849('0x11a'),_0xf849('0x11b')],'where':{'ContactId':_0x44866a[_0xf849('0x7e')]['id']},'include':[{'model':db[_0xf849('0x100')],'as':'User','attributes':['id',_0xf849('0x1b'),_0xf849('0x11c'),_0xf849('0x11d')]}],'order':[['createdAt','DESC']]};if(_0x44866a['query'][_0xf849('0x10f')]){_0x21925c[_0xf849('0x2f')][_0xf849('0x118')]={'$gte':_0x555ae8[_0xf849('0x34')],'$lte':_0x555ae8['to']};}return db[_0xf849('0x9c')][_0xf849('0x11e')](_0x21925c)['then'](function(_0x3ae492){_0x4e63fb[_0xf849('0x13')]+=_0x3ae492[_0xf849('0x13')];return _[_0xf849('0x42')](_0x3ae492['rows'],function(_0x310e2a){var _0x2ea5f6=_0x310e2a[_0xf849('0x88')]({'plain':!![]});_0x2ea5f6['channel']=_0x1693a0;if(_0x2ea5f6['User']){_0x2ea5f6[_0xf849('0x100')]={'id':_0x2ea5f6[_0xf849('0x100')]['id'],'name':_0x2ea5f6['User'][_0xf849('0x1b')],'fullname':_0x2ea5f6['User'][_0xf849('0x11c')],'alias':_0x2ea5f6['User'][_0xf849('0x11d')]};}return _0x2ea5f6;});});}else{var _0x12d827=_[_0xf849('0x11f')](_0x1693a0)+(_0x1693a0===_0xf849('0x120')?'Website':_0xf849('0x121'));var _0x25a851={'attributes':['id',_0xf849('0x122'),'closedAt',_0xf849('0x118'),_0xf849('0x123'),_0xf849('0x124'),'secondDisposition',_0xf849('0x125'),_0xf849('0x11b'),_0x12d827+'Id'],'where':{'ContactId':_0x44866a['params']['id']},'include':[{'model':db[_0x12d827],'as':_0xf849('0x121'),'attributes':['id',_0xf849('0x1b'),_0xf849('0x126')]},{'model':db[_0xf849('0x100')],'as':_0xf849('0x127'),'attributes':['id',_0xf849('0x1b'),_0xf849('0x11c')]},{'model':db[_0xf849('0x3f')],'as':_0xf849('0x7c'),'attributes':['id','name',_0xf849('0x32')],'through':{'attributes':[]}}],'order':[[_0xf849('0x118'),_0xf849('0x64')]]};if(_0x44866a['query']['range']){_0x25a851[_0xf849('0x2f')][_0xf849('0x118')]={'$gte':_0x555ae8['from'],'$lte':_0x555ae8['to']};}switch(_0x1693a0){case _0xf849('0x120'):_0x25a851[_0xf849('0x2b')][_0xf849('0x22')](_0xf849('0x128'),'customerIp',_0xf849('0x129'),_0xf849('0x12a'),_0xf849('0x12b'),_0xf849('0x12c'),_0xf849('0x12d'),'ratingValue',_0xf849('0x12e'));break;case _0xf849('0x104'):_0x25a851['attributes']['push'](_0xf849('0x12f'),_0xf849('0x130'));break;case'openchannel':_0x25a851[_0xf849('0x2b')][_0xf849('0x22')]('externalUrl',_0xf849('0x131'));break;}return db[_[_0xf849('0x11f')](_0x1693a0)+_0xf849('0x132')][_0xf849('0x11e')](_0x25a851)['then'](function(_0x53dfa0){_0x4e63fb[_0xf849('0x13')]+=_0x53dfa0[_0xf849('0x13')];return _['map'](_0x53dfa0[_0xf849('0xdd')],function(_0x3de1bd){var _0x4887aa=_0x3de1bd[_0xf849('0x88')]({'plain':!![]});_0x4887aa[_0xf849('0x10d')]=_0x1693a0;if(_0x4887aa['Owner']){_0x4887aa[_0xf849('0x127')]={'id':_0x4887aa[_0xf849('0x127')]['id'],'name':_0x4887aa[_0xf849('0x127')]['name'],'fullname':_0x4887aa[_0xf849('0x127')][_0xf849('0x11c')]};}return _0x4887aa;});});}});return Promise[_0xf849('0x24')](_0x339586);})[_0xf849('0x16')](function(_0x5bf3b6){return _(_0x5bf3b6)[_0xf849('0x133')]()[_0xf849('0x134')](_0xf849('0x118'))[_0xf849('0x135')]()[_0xf849('0x40')]();})['then'](function(_0x1453f7){_0x4e63fb[_0xf849('0xdd')]=_0x4246bc['limit']?_0x1453f7[_0xf849('0x136')](_0x4246bc[_0xf849('0x10')],_0x4246bc[_0xf849('0x10')]+_0x4246bc['limit']):_0x1453f7;return _0x4e63fb;})[_0xf849('0x16')](respondWithFilteredResult(_0x38f3f0,_0x4246bc))[_0xf849('0x7d')](handleError(_0x38f3f0,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 4ee987c..51b9b95 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x290f=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x2de7dc,_0x13fe00){var _0x4bea65=function(_0x398d1f){while(--_0x398d1f){_0x2de7dc['push'](_0x2de7dc['shift']());}};_0x4bea65(++_0x13fe00);}(_0x290f,0x132));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf290('0x0'));var CmContact=require(_0xf290('0x1'))['db'][_0xf290('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf290('0x3')](0x0);var events={'afterCreate':_0xf290('0x4'),'afterUpdate':_0xf290('0x5'),'afterDestroy':'remove'};function emitEvent(_0x447877){return function(_0x3282a0,_0x193b8a,_0x5623a5){CmContactEvents['emit'](_0x447877+':'+_0x3282a0['id'],_0x3282a0);CmContactEvents[_0xf290('0x6')](_0x447877,_0x3282a0);_0x5623a5(null);};}for(var e in events){if(events[_0xf290('0x7')](e)){var event=events[e];CmContact[_0xf290('0x8')](e,emitEvent(event));}}module[_0xf290('0x9')]=CmContactEvents; \ No newline at end of file +var _0x6a24=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6a24,0x16d));var _0x46a2=function(_0x12cae3,_0x13f912){_0x12cae3=_0x12cae3-0x0;var _0x57a647=_0x6a24[_0x12cae3];return _0x57a647;};'use strict';var EventEmitter=require(_0x46a2('0x0'));var CmContact=require(_0x46a2('0x1'))['db'][_0x46a2('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x46a2('0x3')](0x0);var events={'afterCreate':_0x46a2('0x4'),'afterUpdate':'update','afterDestroy':_0x46a2('0x5')};function emitEvent(_0x1fa027){return function(_0x353225,_0x4bb191,_0x1b4f76){CmContactEvents[_0x46a2('0x6')](_0x1fa027+':'+_0x353225['id'],_0x353225);CmContactEvents['emit'](_0x1fa027,_0x353225);_0x1b4f76(null);};}for(var e in events){if(events[_0x46a2('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x46a2('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 384904a..5457efe 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd83b=['error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','format','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','timezones','ret','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','cmContact,\x20%s,\x20%s','message','BlackLists','models','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','../../config/logger','api','bluebird','request-promise','path','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd83b,0x7a));var _0xbd83=function(_0x4c10e1,_0x52c4a8){_0x4c10e1=_0x4c10e1-0x0;var _0x44fb67=_0xd83b[_0x4c10e1];return _0x44fb67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd83('0x0'))(_0xbd83('0x1'));var moment=require('moment');var BPromise=require(_0xbd83('0x2'));var rp=require(_0xbd83('0x3'));var fs=require('fs');var path=require(_0xbd83('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0xbd83('0x5'));var attributes=require(_0xbd83('0x6'));module[_0xbd83('0x7')]=function(_0x540929,_0x9725a1){return _0x540929[_0xbd83('0x8')](_0xbd83('0x9'),attributes,{'tableName':_0xbd83('0xa'),'paranoid':!![],'indexes':[{'name':_0xbd83('0xb'),'fields':['phone']},{'name':_0xbd83('0xc'),'fields':[_0xbd83('0xd'),'lastName',_0xbd83('0xb'),_0xbd83('0xe'),_0xbd83('0xf'),_0xbd83('0x10')],'type':_0xbd83('0x11')}],'timestamps':!![],'charset':_0xbd83('0x12'),'collate':_0xbd83('0x13'),'hooks':{'afterCreate':function(_0x88d060,_0x2a060c,_0x107154){var _0x271cb2=_0x540929['models'];var _0x4c037e=_0x88d060['get']({'plain':!![]});function _0x5e2488(){return function(_0x62c06f){logger[_0xbd83('0x14')]('cmContact',_0xbd83('0x15'),util[_0xbd83('0x16')](_0x62c06f,{'showHidden':![],'depth':null}));};}function _0x797aee(_0x3a97e8,_0x39854e){var _0x9b7cbd=_0x39854e[_0xbd83('0x17')]?_0x39854e[_0xbd83('0x17')]:moment()['format'](_0xbd83('0x18'));return new BPromise(function(_0x4493dc,_0xc06a4e){if(_[_0xbd83('0x19')](_0x39854e[_0xbd83('0x1a')])){_0x4493dc({'ret':_0x9b7cbd});}else{_0x271cb2[_0xbd83('0x1b')][_0xbd83('0x1c')]({'where':{'id':_0x3a97e8['id']}})[_0xbd83('0x1d')](function(_0x3d12a8){if(!_['isNil'](_0x3d12a8)){var _0x5d3db7=_0x3d12a8[_0xbd83('0x1a')];if(!_[_0xbd83('0x19')](_0x5d3db7)){var _0x147ae2=shared['timezones'];var _0x35cd09=_0x147ae2[_0x5d3db7];var _0x49da00=_0x147ae2[_0x39854e[_0xbd83('0x1a')]];if(!_[_0xbd83('0x19')](_0x35cd09)&&!_[_0xbd83('0x19')](_0x49da00)){var _0x832237=_0x35cd09[_0xbd83('0x1e')]-_0x49da00[_0xbd83('0x1e')];_0x9b7cbd=_0x39854e[_0xbd83('0x17')]?_0x39854e['scheduledat']:moment();var _0x31c9f4=moment(_0x9b7cbd)[_0xbd83('0x1f')](_0x832237,_0xbd83('0x20'));_0x4493dc({'ret':_0x31c9f4[_0xbd83('0x21')](_0xbd83('0x18'))});}else _0x4493dc({'ret':_0x9b7cbd});}else _0x4493dc({'ret':_0x9b7cbd});}else{_0x4493dc({'ret':_0x9b7cbd});}});}});return 0xa;}var _0x1eb7ed=function(_0x12629d){return new BPromise(function(_0x11ea37,_0x12cbb0){_0x797aee(_0x12629d,_0x4c037e)[_0xbd83('0x1d')](function(_0x1d78fa){_0x4c037e[_0xbd83('0x17')]=_0x1d78fa['ret'];_0x271cb2[_0xbd83('0x22')]['findOne']({'where':{'phone':_0x4c037e[_0xbd83('0xb')],'VoiceQueueId':_0x12629d['id']}})['then'](function(_0xfd58b4){if(!_[_0xbd83('0x19')](_0xfd58b4)){throw new Error(_0xbd83('0x23')+_0x4c037e['phone']+_0xbd83('0x24')+_0x12629d['id']);}return _0x271cb2[_0xbd83('0x22')][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'priority':_0x4c037e[_0xbd83('0x27')]?_0x4c037e[_0xbd83('0x27')]:0x2,'scheduledat':_0x4c037e[_0xbd83('0x17')]?_0x4c037e[_0xbd83('0x17')]:moment()['format'](_0xbd83('0x18')),'callback':_0x4c037e[_0xbd83('0x28')]?!![]:![],'callbackuniqueid':_0x4c037e['callbackUniqueid']?_0x4c037e['callbackUniqueid']:undefined,'callbackat':_0x4c037e[_0xbd83('0x28')]?moment()[_0xbd83('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x12629d['id']});})[_0xbd83('0x29')](function(_0x44be48){_0x12cbb0(_0x44be48);});});});};var _0x221675=function(_0x1f97a8){return new BPromise(function(_0x500d4a,_0x158e56){_0x797aee(_0x1f97a8,_0x4c037e)['then'](function(_0x1b84b1){_0x4c037e[_0xbd83('0x17')]=_0x1b84b1['ret'];_0x271cb2[_0xbd83('0x22')][_0xbd83('0x1c')]({'where':{'phone':_0x4c037e[_0xbd83('0xb')],'VoiceQueueId':_0x1f97a8['id']}})['then'](function(_0x58bc72){if(!_[_0xbd83('0x19')](_0x58bc72)){throw new Error(_0xbd83('0x23')+_0x4c037e[_0xbd83('0xb')]+_0xbd83('0x2a')+_0x1f97a8['id']);}return _0x271cb2[_0xbd83('0x2b')]['findOne']({'where':{'calleridnum':_0x4c037e[_0xbd83('0xb')],'VoiceQueueId':_0x1f97a8['id']}});})['then'](function(_0x3b5d26){if(!_['isNil'](_0x3b5d26)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4c037e[_0xbd83('0xb')]+_0xbd83('0x2c')+_0x1f97a8['id']);}return _0x271cb2[_0xbd83('0x22')][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'priority':_0x4c037e[_0xbd83('0x27')]?_0x4c037e[_0xbd83('0x27')]:0x2,'scheduledat':_0x4c037e[_0xbd83('0x17')]?_0x4c037e['scheduledat']:moment()[_0xbd83('0x21')](_0xbd83('0x18')),'callback':_0x4c037e[_0xbd83('0x28')]?!![]:![],'callbackuniqueid':_0x4c037e[_0xbd83('0x28')]?_0x4c037e[_0xbd83('0x28')]:undefined,'callbackat':_0x4c037e[_0xbd83('0x28')]?moment()['format'](_0xbd83('0x18')):undefined,'VoiceQueueId':_0x1f97a8['id']});})[_0xbd83('0x29')](function(_0x3f0129){_0x158e56(_0x3f0129);});});});};function _0x2060c9(){return function(_0x164d6a){logger[_0xbd83('0x14')](_0xbd83('0x2d'),'afterCreate',util[_0xbd83('0x16')](_0x164d6a,{'showHidden':![],'depth':null}));};}function _0x5645b0(_0x5d48fc,_0x401fff){var _0x376aad=_0x401fff[_0xbd83('0x17')]?_0x401fff[_0xbd83('0x17')]:moment()[_0xbd83('0x21')](_0xbd83('0x18'));return new BPromise(function(_0x571e85,_0x2e1c93){if(_['isNil'](_0x401fff[_0xbd83('0x1a')])){_0x571e85({'ret':_0x376aad});}else{_0x271cb2[_0xbd83('0x2e')][_0xbd83('0x1c')]({'where':{'id':_0x5d48fc['id']}})[_0xbd83('0x1d')](function(_0x1d2273){if(!_['isNil'](_0x1d2273)){var _0x12447a=_0x1d2273['dialTimezone'];if(!_['isNil'](_0x12447a)){var _0xd01047=shared[_0xbd83('0x2f')];var _0x1b07ba=_0xd01047[_0x12447a];var _0x1444a1=_0xd01047[_0x401fff[_0xbd83('0x1a')]];if(!_[_0xbd83('0x19')](_0x1b07ba)&&!_[_0xbd83('0x19')](_0x1444a1)){var _0x512a11=_0x1b07ba['utcOffset']-_0x1444a1['utcOffset'];_0x376aad=_0x401fff[_0xbd83('0x17')]?_0x401fff[_0xbd83('0x17')]:moment();var _0x491319=moment(_0x376aad)['add'](_0x512a11,_0xbd83('0x20'));_0x571e85({'ret':_0x491319[_0xbd83('0x21')](_0xbd83('0x18'))});}else _0x571e85({'ret':_0x376aad});}else _0x571e85({'ret':_0x376aad});}else{_0x571e85({'ret':_0x376aad});}});}});return 0xa;}var _0x5c9635=function(_0x1443c9){return new BPromise(function(_0x4fb49c,_0xd14186){_0x5645b0(_0x1443c9,_0x4c037e)[_0xbd83('0x1d')](function(_0x2699e8){_0x4c037e[_0xbd83('0x17')]=_0x2699e8[_0xbd83('0x30')];_0x271cb2[_0xbd83('0x22')][_0xbd83('0x1c')]({'where':{'phone':_0x4c037e[_0xbd83('0xb')],'CampaignId':_0x1443c9['id']}})[_0xbd83('0x1d')](function(_0x44951d){if(!_[_0xbd83('0x19')](_0x44951d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4c037e[_0xbd83('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1443c9['id']);}return _0x271cb2[_0xbd83('0x22')][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'priority':_0x4c037e['priority']?_0x4c037e[_0xbd83('0x27')]:0x2,'scheduledat':_0x4c037e['scheduledat']?_0x4c037e['scheduledat']:moment()['format'](_0xbd83('0x18')),'callback':_0x4c037e[_0xbd83('0x28')]?!![]:![],'callbackuniqueid':_0x4c037e[_0xbd83('0x28')]?_0x4c037e[_0xbd83('0x28')]:undefined,'callbackat':_0x4c037e[_0xbd83('0x28')]?moment()[_0xbd83('0x21')](_0xbd83('0x18')):undefined,'CampaignId':_0x1443c9['id']});})['catch'](function(_0x38e88c){_0xd14186(_0x38e88c);});});});};var _0x5c9b11=function(_0x2a124a){return new BPromise(function(_0x46380f,_0x56bcb5){_0x5645b0(_0x2a124a,_0x4c037e)[_0xbd83('0x1d')](function(_0x2361a1){_0x4c037e[_0xbd83('0x17')]=_0x2361a1[_0xbd83('0x30')];_0x271cb2['CmHopper'][_0xbd83('0x1c')]({'where':{'phone':_0x4c037e['phone'],'CampaignId':_0x2a124a['id']}})[_0xbd83('0x1d')](function(_0x50203a){if(!_[_0xbd83('0x19')](_0x50203a)){throw new Error(_0xbd83('0x23')+_0x4c037e[_0xbd83('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x2a124a['id']);}return _0x271cb2[_0xbd83('0x2b')][_0xbd83('0x1c')]({'where':{'calleridnum':_0x4c037e['phone'],'CampaignId':_0x2a124a['id']}});})['then'](function(_0x5b5df0){if(!_['isNil'](_0x5b5df0)){throw new Error(_0xbd83('0x31')+_0x4c037e[_0xbd83('0xb')]+_0xbd83('0x32')+_0x2a124a['id']);}return _0x271cb2[_0xbd83('0x22')][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'priority':_0x4c037e[_0xbd83('0x27')]?_0x4c037e[_0xbd83('0x27')]:0x2,'scheduledat':_0x4c037e['scheduledat']?_0x4c037e[_0xbd83('0x17')]:moment()[_0xbd83('0x21')](_0xbd83('0x18')),'callback':_0x4c037e[_0xbd83('0x28')]?!![]:![],'callbackuniqueid':_0x4c037e['callbackUniqueid']?_0x4c037e['callbackUniqueid']:undefined,'callbackat':_0x4c037e['callbackUniqueid']?moment()[_0xbd83('0x21')](_0xbd83('0x18')):undefined,'CampaignId':_0x2a124a['id']});})[_0xbd83('0x29')](function(_0x4b1d2b){_0x56bcb5(_0x4b1d2b);});});});};if(_0x4c037e['ListId']){_0x271cb2[_0xbd83('0x1b')][_0xbd83('0x33')]({'where':{'type':_0xbd83('0x34')},'attributes':['id',_0xbd83('0x35'),_0xbd83('0x1a')],'include':[{'model':_0x271cb2[_0xbd83('0x36')],'as':_0xbd83('0x37'),'where':{'id':_0x4c037e[_0xbd83('0x26')]}}]})['then'](function(_0x27cc54){if(_0x27cc54){var _0x3e99cc=[];for(var _0x120dd6=0x0,_0x33b6b8;_0x120dd6<_0x27cc54[_0xbd83('0x38')];_0x120dd6+=0x1){_0x33b6b8=_0x27cc54[_0x120dd6][_0xbd83('0x39')]({'plain':!![]});switch(_0x33b6b8[_0xbd83('0x35')]){case _0xbd83('0x3a'):_0x221675(_0x33b6b8)[_0xbd83('0x29')](_0x5e2488());break;case _0xbd83('0x3b'):_0x1eb7ed(_0x33b6b8)['catch'](_0x5e2488());break;default:_0x5645b0(_0x33b6b8,_0x4c037e)[_0xbd83('0x1d')](function(_0x1eb02f){_0x4c037e[_0xbd83('0x17')]=_0x1eb02f[_0xbd83('0x30')];_0x271cb2[_0xbd83('0x22')][_0xbd83('0x25')]({'phone':_0x4c037e['phone'],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'scheduledat':_0x4c037e[_0xbd83('0x17')]?_0x4c037e[_0xbd83('0x17')]:moment()[_0xbd83('0x21')](_0xbd83('0x18')),'priority':_0x4c037e[_0xbd83('0x27')]?_0x4c037e[_0xbd83('0x27')]:0x2,'callback':_0x4c037e[_0xbd83('0x28')]?!![]:![],'callbackuniqueid':_0x4c037e[_0xbd83('0x28')]?_0x4c037e[_0xbd83('0x28')]:undefined,'callbackat':_0x4c037e['callbackUniqueid']?moment()[_0xbd83('0x21')](_0xbd83('0x18')):undefined,'VoiceQueueId':_0x33b6b8['id']})[_0xbd83('0x29')](_0x5e2488());});}}}})[_0xbd83('0x1d')](function(){return _0x271cb2[_0xbd83('0x1b')][_0xbd83('0x33')]({'where':{'type':_0xbd83('0x34')},'attributes':['id'],'include':[{'model':_0x271cb2[_0xbd83('0x36')],'as':'BlackLists','where':{'id':_0x4c037e[_0xbd83('0x26')]}}]})[_0xbd83('0x1d')](function(_0x3d3909){if(_0x3d3909){var _0x1cc86e=[];for(var _0x5ef15d=0x0,_0x5753d1;_0x5ef15d<_0x3d3909[_0xbd83('0x38')];_0x5ef15d+=0x1){_0x5753d1=_0x3d3909[_0x5ef15d]['get']({'plain':!![]});_0x271cb2['CmHopperBlack'][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'VoiceQueueId':_0x5753d1['id']})['catch'](function(_0x447455){logger['error'](_0xbd83('0x3c'),'afterCreate',_0x447455[_0xbd83('0x3d')]);});}}});})[_0xbd83('0x1d')](function(){return _0x271cb2[_0xbd83('0x2e')][_0xbd83('0x33')]({'attributes':['id','dialCheckDuplicateType',_0xbd83('0x1a')],'include':[{'model':_0x271cb2[_0xbd83('0x36')],'as':_0xbd83('0x37'),'where':{'id':_0x4c037e['ListId']}}]})[_0xbd83('0x1d')](function(_0xbf1c0e){if(_0xbf1c0e){var _0x141c72=[];for(var _0x2d0c35=0x0,_0x4c45c6;_0x2d0c35<_0xbf1c0e[_0xbd83('0x38')];_0x2d0c35+=0x1){_0x4c45c6=_0xbf1c0e[_0x2d0c35]['get']({'plain':!![]});switch(_0x4c45c6['dialCheckDuplicateType']){case _0xbd83('0x3a'):_0x5c9b11(_0x4c45c6)[_0xbd83('0x29')](_0x2060c9());break;case _0xbd83('0x3b'):_0x5c9635(_0x4c45c6)[_0xbd83('0x29')](_0x2060c9());break;default:_0x271cb2['CmHopper'][_0xbd83('0x25')]({'phone':_0x4c037e['phone'],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e['ListId'],'scheduledat':_0x4c037e[_0xbd83('0x17')]?_0x4c037e[_0xbd83('0x17')]:moment()[_0xbd83('0x21')](_0xbd83('0x18')),'priority':_0x4c037e['priority']?_0x4c037e['priority']:0x2,'callback':_0x4c037e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4c037e[_0xbd83('0x28')]?_0x4c037e[_0xbd83('0x28')]:undefined,'callbackat':_0x4c037e[_0xbd83('0x28')]?moment()[_0xbd83('0x21')](_0xbd83('0x18')):undefined,'CampaignId':_0x4c45c6['id']})[_0xbd83('0x29')](_0x2060c9());}}}});})[_0xbd83('0x1d')](function(){return _0x271cb2[_0xbd83('0x2e')][_0xbd83('0x33')]({'attributes':['id'],'include':[{'model':_0x271cb2['CmList'],'as':_0xbd83('0x3e'),'where':{'id':_0x4c037e[_0xbd83('0x26')]}}]})[_0xbd83('0x1d')](function(_0x4cc5dc){if(_0x4cc5dc){var _0x222022=[];for(var _0x4bb2fa=0x0,_0x3f222b;_0x4bb2fa<_0x4cc5dc['length'];_0x4bb2fa+=0x1){_0x3f222b=_0x4cc5dc[_0x4bb2fa][_0xbd83('0x39')]({'plain':!![]});_0x271cb2['CmHopperBlack'][_0xbd83('0x25')]({'phone':_0x4c037e[_0xbd83('0xb')],'ContactId':_0x4c037e['id'],'ListId':_0x4c037e[_0xbd83('0x26')],'CampaignId':_0x3f222b['id']})[_0xbd83('0x29')](function(_0x248121){logger[_0xbd83('0x14')](_0xbd83('0x3c'),_0xbd83('0x15'),_0x248121[_0xbd83('0x3d')]);});}}});})[_0xbd83('0x1d')](function(){_0x107154();})['catch'](function(_0x973863){logger[_0xbd83('0x14')]('cmContact,\x20%s,\x20%s','afterCreate',_0x973863[_0xbd83('0x3d')]);_0x107154(_0x973863);});}else{_0x107154(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x149e8e,_0x27317f,_0xdefcd9){var _0x34d5fd=_0x540929[_0xbd83('0x3f')];var _0x5771af=_0x149e8e['get']({'plain':!![]});return _0x34d5fd[_0xbd83('0x22')][_0xbd83('0x33')]({'raw':!![],'where':{'ListId':_0x5771af[_0xbd83('0x26')],'ContactId':_0x5771af['id']}})[_0xbd83('0x1d')](function(_0x57ffb3){if(!_['isEmpty'](_0x57ffb3)){var _0x50dd19=[];for(var _0xa0434b=0x0;_0xa0434b<_0x57ffb3[_0xbd83('0x38')];_0xa0434b+=0x1){var _0x321c47=_0x34d5fd['CmHopper'][_0xbd83('0x40')]({'where':{'ListId':_0x57ffb3[_0xa0434b][_0xbd83('0x26')],'ContactId':_0x57ffb3[_0xa0434b][_0xbd83('0x41')],'VoiceQueueId':_0x57ffb3[_0xa0434b][_0xbd83('0x42')],'CampaignId':_0x57ffb3[_0xa0434b][_0xbd83('0x43')]}});_0x50dd19[_0xbd83('0x44')](_0x321c47);}return BPromise['all'](_0x50dd19);}})[_0xbd83('0x1d')](function(_0x5b35ff){logger[_0xbd83('0x45')](_0xbd83('0x46'),util[_0xbd83('0x16')](_0x5b35ff,{'showHidden':![],'depth':null}));_0xdefcd9();})[_0xbd83('0x29')](function(_0x4330f6){logger[_0xbd83('0x14')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x4330f6,{'showHidden':![],'depth':null}));_0xdefcd9(_0x4330f6);});}}});}; \ No newline at end of file +var _0xee10=['exports','define','CmContact','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','phone','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','message','BlackLists','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee10,0x11c));var _0x0ee1=function(_0x9afd39,_0x464761){_0x9afd39=_0x9afd39-0x0;var _0x3a7803=_0xee10[_0x9afd39];return _0x3a7803;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ee1('0x0'))(_0x0ee1('0x1'));var moment=require(_0x0ee1('0x2'));var BPromise=require(_0x0ee1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ee1('0x4'));var rimraf=require(_0x0ee1('0x5'));var config=require(_0x0ee1('0x6'));var shared=require(_0x0ee1('0x7'));var attributes=require('./cmContact.attributes');module[_0x0ee1('0x8')]=function(_0x5731a8,_0xd48798){return _0x5731a8[_0x0ee1('0x9')](_0x0ee1('0xa'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x0ee1('0xb'),'fields':[_0x0ee1('0xc'),_0x0ee1('0xd'),'phone','mobile',_0x0ee1('0xe'),_0x0ee1('0xf')],'type':_0x0ee1('0x10')}],'timestamps':!![],'charset':_0x0ee1('0x11'),'collate':_0x0ee1('0x12'),'hooks':{'afterCreate':function(_0x2e2dee,_0x33b7d6,_0x4c88eb){var _0x21218c=_0x5731a8[_0x0ee1('0x13')];var _0x1b51b5=_0x2e2dee[_0x0ee1('0x14')]({'plain':!![]});function _0x5e3ec0(){return function(_0x507ad5){logger[_0x0ee1('0x15')](_0x0ee1('0x16'),_0x0ee1('0x17'),util[_0x0ee1('0x18')](_0x507ad5,{'showHidden':![],'depth':null}));};}function _0x4836eb(_0x577d82,_0x522ac3){var _0x2637c6=_0x522ac3[_0x0ee1('0x19')]?_0x522ac3[_0x0ee1('0x19')]:moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b'));return new BPromise(function(_0x1c8384,_0x233d27){if(_[_0x0ee1('0x1c')](_0x522ac3[_0x0ee1('0x1d')])){_0x1c8384({'ret':_0x2637c6});}else{_0x21218c[_0x0ee1('0x1e')][_0x0ee1('0x1f')]({'where':{'id':_0x577d82['id']}})[_0x0ee1('0x20')](function(_0x1c554d){if(!_['isNil'](_0x1c554d)){var _0xcc1bde=_0x1c554d['dialTimezone'];if(!_[_0x0ee1('0x1c')](_0xcc1bde)){var _0x145115=shared[_0x0ee1('0x21')];var _0x24e13c=_0x145115[_0xcc1bde];var _0x294eb5=_0x145115[_0x522ac3[_0x0ee1('0x1d')]];if(!_['isNil'](_0x24e13c)&&!_[_0x0ee1('0x1c')](_0x294eb5)){var _0x4321e8=_0x24e13c['utcOffset']-_0x294eb5[_0x0ee1('0x22')];_0x2637c6=_0x522ac3[_0x0ee1('0x19')]?_0x522ac3[_0x0ee1('0x19')]:moment();var _0x423aab=moment(_0x2637c6)[_0x0ee1('0x23')](_0x4321e8,_0x0ee1('0x24'));_0x1c8384({'ret':_0x423aab[_0x0ee1('0x1a')](_0x0ee1('0x1b'))});}else _0x1c8384({'ret':_0x2637c6});}else _0x1c8384({'ret':_0x2637c6});}else{_0x1c8384({'ret':_0x2637c6});}});}});return 0xa;}var _0x5eee8e=function(_0x4e5ac4){return new BPromise(function(_0x428b07,_0x317d0b){_0x4836eb(_0x4e5ac4,_0x1b51b5)[_0x0ee1('0x20')](function(_0xf97d9f){_0x1b51b5[_0x0ee1('0x19')]=_0xf97d9f[_0x0ee1('0x25')];_0x21218c[_0x0ee1('0x26')][_0x0ee1('0x1f')]({'where':{'phone':_0x1b51b5['phone'],'VoiceQueueId':_0x4e5ac4['id']}})[_0x0ee1('0x20')](function(_0x48e331){if(!_[_0x0ee1('0x1c')](_0x48e331)){throw new Error(_0x0ee1('0x27')+_0x1b51b5[_0x0ee1('0x28')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4e5ac4['id']);}return _0x21218c['CmHopper'][_0x0ee1('0x29')]({'phone':_0x1b51b5['phone'],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'priority':_0x1b51b5[_0x0ee1('0x2b')]?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'scheduledat':_0x1b51b5['scheduledat']?_0x1b51b5['scheduledat']:moment()[_0x0ee1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1b51b5[_0x0ee1('0x2c')]?!![]:![],'callbackuniqueid':_0x1b51b5[_0x0ee1('0x2c')]?_0x1b51b5['callbackUniqueid']:undefined,'callbackat':_0x1b51b5[_0x0ee1('0x2c')]?moment()['format'](_0x0ee1('0x1b')):undefined,'VoiceQueueId':_0x4e5ac4['id']});})[_0x0ee1('0x2d')](function(_0x3cf45c){_0x317d0b(_0x3cf45c);});});});};var _0x538a80=function(_0x12c19d){return new BPromise(function(_0xac758d,_0x52f8c6){_0x4836eb(_0x12c19d,_0x1b51b5)['then'](function(_0x586b62){_0x1b51b5[_0x0ee1('0x19')]=_0x586b62[_0x0ee1('0x25')];_0x21218c[_0x0ee1('0x26')][_0x0ee1('0x1f')]({'where':{'phone':_0x1b51b5[_0x0ee1('0x28')],'VoiceQueueId':_0x12c19d['id']}})['then'](function(_0x3bb21e){if(!_[_0x0ee1('0x1c')](_0x3bb21e)){throw new Error(_0x0ee1('0x27')+_0x1b51b5[_0x0ee1('0x28')]+_0x0ee1('0x2e')+_0x12c19d['id']);}return _0x21218c[_0x0ee1('0x2f')]['findOne']({'where':{'calleridnum':_0x1b51b5[_0x0ee1('0x28')],'VoiceQueueId':_0x12c19d['id']}});})[_0x0ee1('0x20')](function(_0xf78776){if(!_['isNil'](_0xf78776)){throw new Error(_0x0ee1('0x30')+_0x1b51b5[_0x0ee1('0x28')]+_0x0ee1('0x31')+_0x12c19d['id']);}return _0x21218c[_0x0ee1('0x26')][_0x0ee1('0x29')]({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'priority':_0x1b51b5['priority']?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'scheduledat':_0x1b51b5['scheduledat']?_0x1b51b5[_0x0ee1('0x19')]:moment()['format'](_0x0ee1('0x1b')),'callback':_0x1b51b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1b51b5['callbackUniqueid']?_0x1b51b5['callbackUniqueid']:undefined,'callbackat':_0x1b51b5['callbackUniqueid']?moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b')):undefined,'VoiceQueueId':_0x12c19d['id']});})[_0x0ee1('0x2d')](function(_0x1ee297){_0x52f8c6(_0x1ee297);});});});};function _0x302167(){return function(_0x13b3e6){logger['error'](_0x0ee1('0x16'),_0x0ee1('0x17'),util[_0x0ee1('0x18')](_0x13b3e6,{'showHidden':![],'depth':null}));};}function _0x195592(_0x4065d7,_0xbef461){var _0xff441a=_0xbef461['scheduledat']?_0xbef461[_0x0ee1('0x19')]:moment()['format'](_0x0ee1('0x1b'));return new BPromise(function(_0x5b01f4,_0x186c89){if(_[_0x0ee1('0x1c')](_0xbef461[_0x0ee1('0x1d')])){_0x5b01f4({'ret':_0xff441a});}else{_0x21218c[_0x0ee1('0x32')][_0x0ee1('0x1f')]({'where':{'id':_0x4065d7['id']}})[_0x0ee1('0x20')](function(_0xeacf9f){if(!_[_0x0ee1('0x1c')](_0xeacf9f)){var _0x38fd67=_0xeacf9f[_0x0ee1('0x1d')];if(!_[_0x0ee1('0x1c')](_0x38fd67)){var _0x577edb=shared['timezones'];var _0x21e9d8=_0x577edb[_0x38fd67];var _0x1394b3=_0x577edb[_0xbef461[_0x0ee1('0x1d')]];if(!_['isNil'](_0x21e9d8)&&!_[_0x0ee1('0x1c')](_0x1394b3)){var _0x3a124f=_0x21e9d8['utcOffset']-_0x1394b3[_0x0ee1('0x22')];_0xff441a=_0xbef461[_0x0ee1('0x19')]?_0xbef461['scheduledat']:moment();var _0x2ad69c=moment(_0xff441a)[_0x0ee1('0x23')](_0x3a124f,_0x0ee1('0x24'));_0x5b01f4({'ret':_0x2ad69c[_0x0ee1('0x1a')](_0x0ee1('0x1b'))});}else _0x5b01f4({'ret':_0xff441a});}else _0x5b01f4({'ret':_0xff441a});}else{_0x5b01f4({'ret':_0xff441a});}});}});return 0xa;}var _0x15d2b1=function(_0x184845){return new BPromise(function(_0x52fd72,_0x13a0ea){_0x195592(_0x184845,_0x1b51b5)[_0x0ee1('0x20')](function(_0x13cc45){_0x1b51b5[_0x0ee1('0x19')]=_0x13cc45[_0x0ee1('0x25')];_0x21218c['CmHopper']['findOne']({'where':{'phone':_0x1b51b5['phone'],'CampaignId':_0x184845['id']}})[_0x0ee1('0x20')](function(_0x5fbc1d){if(!_[_0x0ee1('0x1c')](_0x5fbc1d)){throw new Error(_0x0ee1('0x27')+_0x1b51b5[_0x0ee1('0x28')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x184845['id']);}return _0x21218c['CmHopper']['create']({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5['ListId'],'priority':_0x1b51b5[_0x0ee1('0x2b')]?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'scheduledat':_0x1b51b5[_0x0ee1('0x19')]?_0x1b51b5[_0x0ee1('0x19')]:moment()[_0x0ee1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1b51b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1b51b5[_0x0ee1('0x2c')]?_0x1b51b5[_0x0ee1('0x2c')]:undefined,'callbackat':_0x1b51b5['callbackUniqueid']?moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b')):undefined,'CampaignId':_0x184845['id']});})['catch'](function(_0x3bc0bc){_0x13a0ea(_0x3bc0bc);});});});};var _0x382e47=function(_0x34a34c){return new BPromise(function(_0x51d3e3,_0x1a259f){_0x195592(_0x34a34c,_0x1b51b5)[_0x0ee1('0x20')](function(_0x1f939e){_0x1b51b5[_0x0ee1('0x19')]=_0x1f939e[_0x0ee1('0x25')];_0x21218c[_0x0ee1('0x26')][_0x0ee1('0x1f')]({'where':{'phone':_0x1b51b5[_0x0ee1('0x28')],'CampaignId':_0x34a34c['id']}})['then'](function(_0x1b544e){if(!_[_0x0ee1('0x1c')](_0x1b544e)){throw new Error(_0x0ee1('0x27')+_0x1b51b5[_0x0ee1('0x28')]+_0x0ee1('0x33')+_0x34a34c['id']);}return _0x21218c[_0x0ee1('0x2f')][_0x0ee1('0x1f')]({'where':{'calleridnum':_0x1b51b5[_0x0ee1('0x28')],'CampaignId':_0x34a34c['id']}});})['then'](function(_0x38242e){if(!_['isNil'](_0x38242e)){throw new Error(_0x0ee1('0x30')+_0x1b51b5[_0x0ee1('0x28')]+_0x0ee1('0x34')+_0x34a34c['id']);}return _0x21218c[_0x0ee1('0x26')][_0x0ee1('0x29')]({'phone':_0x1b51b5['phone'],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'priority':_0x1b51b5[_0x0ee1('0x2b')]?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'scheduledat':_0x1b51b5[_0x0ee1('0x19')]?_0x1b51b5[_0x0ee1('0x19')]:moment()['format'](_0x0ee1('0x1b')),'callback':_0x1b51b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1b51b5['callbackUniqueid']?_0x1b51b5[_0x0ee1('0x2c')]:undefined,'callbackat':_0x1b51b5[_0x0ee1('0x2c')]?moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b')):undefined,'CampaignId':_0x34a34c['id']});})[_0x0ee1('0x2d')](function(_0x16e2d9){_0x1a259f(_0x16e2d9);});});});};if(_0x1b51b5[_0x0ee1('0x2a')]){_0x21218c[_0x0ee1('0x1e')][_0x0ee1('0x35')]({'where':{'type':_0x0ee1('0x36')},'attributes':['id',_0x0ee1('0x37'),_0x0ee1('0x1d')],'include':[{'model':_0x21218c[_0x0ee1('0x38')],'as':_0x0ee1('0x39'),'where':{'id':_0x1b51b5[_0x0ee1('0x2a')]}}]})[_0x0ee1('0x20')](function(_0x2dcf9f){if(_0x2dcf9f){var _0x967e11=[];for(var _0x3f1d24=0x0,_0x1712e4;_0x3f1d24<_0x2dcf9f[_0x0ee1('0x3a')];_0x3f1d24+=0x1){_0x1712e4=_0x2dcf9f[_0x3f1d24][_0x0ee1('0x14')]({'plain':!![]});switch(_0x1712e4[_0x0ee1('0x37')]){case _0x0ee1('0x3b'):_0x538a80(_0x1712e4)[_0x0ee1('0x2d')](_0x5e3ec0());break;case _0x0ee1('0x3c'):_0x5eee8e(_0x1712e4)[_0x0ee1('0x2d')](_0x5e3ec0());break;default:_0x195592(_0x1712e4,_0x1b51b5)[_0x0ee1('0x20')](function(_0x41a713){_0x1b51b5[_0x0ee1('0x19')]=_0x41a713[_0x0ee1('0x25')];_0x21218c['CmHopper']['create']({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'scheduledat':_0x1b51b5[_0x0ee1('0x19')]?_0x1b51b5[_0x0ee1('0x19')]:moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b')),'priority':_0x1b51b5[_0x0ee1('0x2b')]?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'callback':_0x1b51b5[_0x0ee1('0x2c')]?!![]:![],'callbackuniqueid':_0x1b51b5[_0x0ee1('0x2c')]?_0x1b51b5[_0x0ee1('0x2c')]:undefined,'callbackat':_0x1b51b5['callbackUniqueid']?moment()[_0x0ee1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1712e4['id']})[_0x0ee1('0x2d')](_0x5e3ec0());});}}}})['then'](function(){return _0x21218c['VoiceQueue'][_0x0ee1('0x35')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x21218c[_0x0ee1('0x38')],'as':'BlackLists','where':{'id':_0x1b51b5[_0x0ee1('0x2a')]}}]})[_0x0ee1('0x20')](function(_0x428a2e){if(_0x428a2e){var _0x436d02=[];for(var _0x3e276c=0x0,_0x5019d0;_0x3e276c<_0x428a2e[_0x0ee1('0x3a')];_0x3e276c+=0x1){_0x5019d0=_0x428a2e[_0x3e276c][_0x0ee1('0x14')]({'plain':!![]});_0x21218c[_0x0ee1('0x3d')][_0x0ee1('0x29')]({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5['ListId'],'VoiceQueueId':_0x5019d0['id']})[_0x0ee1('0x2d')](function(_0xcaecce){logger['error'](_0x0ee1('0x3e'),_0x0ee1('0x17'),_0xcaecce[_0x0ee1('0x3f')]);});}}});})[_0x0ee1('0x20')](function(){return _0x21218c[_0x0ee1('0x32')][_0x0ee1('0x35')]({'attributes':['id',_0x0ee1('0x37'),_0x0ee1('0x1d')],'include':[{'model':_0x21218c['CmList'],'as':_0x0ee1('0x39'),'where':{'id':_0x1b51b5['ListId']}}]})[_0x0ee1('0x20')](function(_0x1cdccb){if(_0x1cdccb){var _0x45f2e9=[];for(var _0x44a3c3=0x0,_0x28492c;_0x44a3c3<_0x1cdccb[_0x0ee1('0x3a')];_0x44a3c3+=0x1){_0x28492c=_0x1cdccb[_0x44a3c3][_0x0ee1('0x14')]({'plain':!![]});switch(_0x28492c[_0x0ee1('0x37')]){case'always':_0x382e47(_0x28492c)[_0x0ee1('0x2d')](_0x302167());break;case _0x0ee1('0x3c'):_0x15d2b1(_0x28492c)[_0x0ee1('0x2d')](_0x302167());break;default:_0x21218c[_0x0ee1('0x26')]['create']({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'scheduledat':_0x1b51b5[_0x0ee1('0x19')]?_0x1b51b5[_0x0ee1('0x19')]:moment()[_0x0ee1('0x1a')](_0x0ee1('0x1b')),'priority':_0x1b51b5[_0x0ee1('0x2b')]?_0x1b51b5[_0x0ee1('0x2b')]:0x2,'callback':_0x1b51b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1b51b5[_0x0ee1('0x2c')]?_0x1b51b5[_0x0ee1('0x2c')]:undefined,'callbackat':_0x1b51b5[_0x0ee1('0x2c')]?moment()[_0x0ee1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x28492c['id']})[_0x0ee1('0x2d')](_0x302167());}}}});})[_0x0ee1('0x20')](function(){return _0x21218c['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x21218c[_0x0ee1('0x38')],'as':_0x0ee1('0x40'),'where':{'id':_0x1b51b5[_0x0ee1('0x2a')]}}]})['then'](function(_0xa177a7){if(_0xa177a7){var _0x41d969=[];for(var _0x2e10b0=0x0,_0x2b421d;_0x2e10b0<_0xa177a7[_0x0ee1('0x3a')];_0x2e10b0+=0x1){_0x2b421d=_0xa177a7[_0x2e10b0][_0x0ee1('0x14')]({'plain':!![]});_0x21218c['CmHopperBlack'][_0x0ee1('0x29')]({'phone':_0x1b51b5[_0x0ee1('0x28')],'ContactId':_0x1b51b5['id'],'ListId':_0x1b51b5[_0x0ee1('0x2a')],'CampaignId':_0x2b421d['id']})['catch'](function(_0xb9c244){logger[_0x0ee1('0x15')]('cmContact,\x20%s,\x20%s',_0x0ee1('0x17'),_0xb9c244[_0x0ee1('0x3f')]);});}}});})[_0x0ee1('0x20')](function(){_0x4c88eb();})['catch'](function(_0x784ae2){logger[_0x0ee1('0x15')]('cmContact,\x20%s,\x20%s',_0x0ee1('0x17'),_0x784ae2[_0x0ee1('0x3f')]);_0x4c88eb(_0x784ae2);});}else{_0x4c88eb(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4f0f26,_0x2000cc,_0x27e97c){var _0x14adcd=_0x5731a8[_0x0ee1('0x13')];var _0x112e8e=_0x4f0f26[_0x0ee1('0x14')]({'plain':!![]});return _0x14adcd[_0x0ee1('0x26')][_0x0ee1('0x35')]({'raw':!![],'where':{'ListId':_0x112e8e[_0x0ee1('0x2a')],'ContactId':_0x112e8e['id']}})[_0x0ee1('0x20')](function(_0x4d7d51){if(!_['isEmpty'](_0x4d7d51)){var _0x2565b2=[];for(var _0x1f6af5=0x0;_0x1f6af5<_0x4d7d51[_0x0ee1('0x3a')];_0x1f6af5+=0x1){var _0x109455=_0x14adcd[_0x0ee1('0x26')][_0x0ee1('0x41')]({'where':{'ListId':_0x4d7d51[_0x1f6af5][_0x0ee1('0x2a')],'ContactId':_0x4d7d51[_0x1f6af5]['ContactId'],'VoiceQueueId':_0x4d7d51[_0x1f6af5][_0x0ee1('0x42')],'CampaignId':_0x4d7d51[_0x1f6af5][_0x0ee1('0x43')]}});_0x2565b2[_0x0ee1('0x44')](_0x109455);}return BPromise[_0x0ee1('0x45')](_0x2565b2);}})[_0x0ee1('0x20')](function(_0x1899a6){logger[_0x0ee1('0x46')](_0x0ee1('0x47'),util[_0x0ee1('0x18')](_0x1899a6,{'showHidden':![],'depth':null}));_0x27e97c();})[_0x0ee1('0x2d')](function(_0x413ea9){logger[_0x0ee1('0x15')](_0x0ee1('0x48'),util[_0x0ee1('0x18')](_0x413ea9,{'showHidden':![],'depth':null}));_0x27e97c(_0x413ea9);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 117afa7..1105b96 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x3fd4c3,_0x469541){var _0x4eac00=function(_0x5db2b1){while(--_0x5db2b1){_0x3fd4c3['push'](_0x3fd4c3['shift']());}};_0x4eac00(++_0x469541);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 472215d..f82f86a 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['exports','INTEGER','PHONE','sequelize'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x43d106,_0x96a475){_0x43d106=_0x43d106-0x0;var _0x2160bc=_0xd0bb[_0x43d106];return _0x2160bc;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'CmContactId':{'type':Sequelize[_0xbd0b('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xbd0b('0x3')},'OrderBy':{'type':Sequelize[_0xbd0b('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x644a=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x48e6c1,_0x2c5211){var _0x1521e2=function(_0x27e789){while(--_0x27e789){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x1521e2(++_0x2c5211);}(_0x644a,0xfd));var _0xa644=function(_0xeee53b,_0x448722){_0xeee53b=_0xeee53b-0x0;var _0x1067c6=_0x644a[_0xeee53b];return _0x1067c6;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'CmContactId':{'type':Sequelize[_0xa644('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xa644('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa644('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xa644('0x4')},'OrderBy':{'type':Sequelize[_0xa644('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 05bdfc1..cdeff3c 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b69=['fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../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','apply','reject','save','destroy','then','get','CmContactHasItems','stack','name','send','index','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs'];(function(_0x4bef90,_0x59accf){var _0x4b46df=function(_0x268a1c){while(--_0x268a1c){_0x4bef90['push'](_0x4bef90['shift']());}};_0x4b46df(++_0x59accf);}(_0x7b69,0xe8));var _0x97b6=function(_0x54fa47,_0x7f515a){_0x54fa47=_0x54fa47-0x0;var _0x248135=_0x7b69[_0x54fa47];return _0x248135;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97b6('0x0'));var zipdir=require(_0x97b6('0x1'));var jsonpatch=require(_0x97b6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x97b6('0x3'));var Mustache=require(_0x97b6('0x4'));var util=require(_0x97b6('0x5'));var path=require(_0x97b6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x97b6('0x7'));var fs=require('fs');var fs_extra=require(_0x97b6('0x8'));var _=require(_0x97b6('0x9'));var squel=require('squel');var crypto=require(_0x97b6('0xa'));var jsforce=require(_0x97b6('0xb'));var deskjs=require(_0x97b6('0xc'));var toCsv=require(_0x97b6('0xd'));var querystring=require(_0x97b6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x97b6('0xf'));var as=require(_0x97b6('0x10'));var hardwareService=require(_0x97b6('0x11'));var logger=require(_0x97b6('0x12'))(_0x97b6('0x13'));var utils=require('../../config/utils');var config=require(_0x97b6('0x14'));var licenseUtil=require(_0x97b6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cb692,_0x3d7503){_0x3d7503=_0x3d7503||0xcc;return function(_0x1cf6bd){if(_0x1cf6bd){return _0x4cb692[_0x97b6('0x16')](_0x3d7503);}return _0x4cb692[_0x97b6('0x17')](_0x3d7503)[_0x97b6('0x18')]();};}function respondWithResult(_0x4b905a,_0x1545cf){_0x1545cf=_0x1545cf||0xc8;return function(_0x111786){if(_0x111786){return _0x4b905a[_0x97b6('0x17')](_0x1545cf)[_0x97b6('0x19')](_0x111786);}};}function respondWithFilteredResult(_0x44a090,_0x5930ec){return function(_0x53ca0a){if(_0x53ca0a){var _0x169640=typeof _0x5930ec[_0x97b6('0x1a')]==='undefined'&&typeof _0x5930ec['limit']===_0x97b6('0x1b');var _0x1595be=_0x53ca0a[_0x97b6('0x1c')];var _0x2b7b76=_0x169640?0x0:_0x5930ec['offset'];var _0x1fba8b=_0x169640?_0x53ca0a[_0x97b6('0x1c')]:_0x5930ec[_0x97b6('0x1a')]+_0x5930ec[_0x97b6('0x1d')];var _0x47c43a;if(_0x1fba8b>=_0x1595be){_0x1fba8b=_0x1595be;_0x47c43a=0xc8;}else{_0x47c43a=0xce;}_0x44a090[_0x97b6('0x17')](_0x47c43a);return _0x44a090[_0x97b6('0x1e')]('Content-Range',_0x2b7b76+'-'+_0x1fba8b+'/'+_0x1595be)[_0x97b6('0x19')](_0x53ca0a);}return null;};}function patchUpdates(_0x82303c){return function(_0x3f86ef){try{jsonpatch[_0x97b6('0x1f')](_0x3f86ef,_0x82303c,!![]);}catch(_0x32b3d4){return BPromise[_0x97b6('0x20')](_0x32b3d4);}return _0x3f86ef[_0x97b6('0x21')]();};}function saveUpdates(_0x48f9ed,_0x11ef37){return function(_0x35c85d){if(_0x35c85d){return _0x35c85d['update'](_0x48f9ed)['then'](function(_0x123257){return _0x123257;});}return null;};}function removeEntity(_0x50a28a,_0x5cbc35){return function(_0xf60868){if(_0xf60868){return _0xf60868[_0x97b6('0x22')]()[_0x97b6('0x23')](function(){var _0xf97346=_0xf60868[_0x97b6('0x24')]({'plain':!![]});var _0x1918c0=_0x97b6('0x25');return db['UserProfileResource'][_0x97b6('0x22')]({'where':{'type':_0x1918c0,'resourceId':_0xf97346['id']}})[_0x97b6('0x23')](function(){return _0xf60868;});})[_0x97b6('0x23')](function(){_0x50a28a[_0x97b6('0x17')](0xcc)[_0x97b6('0x18')]();});}};}function handleEntityNotFound(_0x4f1979,_0x17f7c4){return function(_0x29f74b){if(!_0x29f74b){_0x4f1979[_0x97b6('0x16')](0x194);}return _0x29f74b;};}function handleError(_0x53f6c4,_0x24f2ea){_0x24f2ea=_0x24f2ea||0x1f4;return function(_0x472c91){logger['error'](_0x472c91[_0x97b6('0x26')]);if(_0x472c91['name']){delete _0x472c91[_0x97b6('0x27')];}_0x53f6c4[_0x97b6('0x17')](_0x24f2ea)[_0x97b6('0x28')](_0x472c91);};}exports[_0x97b6('0x29')]=function(_0x374145,_0x5a61a7){var _0x425f17={},_0x63e348={},_0x282347={'count':0x0,'rows':[]};var _0x5d73a4=_[_0x97b6('0x2a')](db[_0x97b6('0x2b')][_0x97b6('0x2c')],function(_0x5bb277){return{'name':_0x5bb277['fieldName'],'type':_0x5bb277[_0x97b6('0x2d')][_0x97b6('0x2e')]};});_0x63e348[_0x97b6('0x2f')]=_[_0x97b6('0x2a')](_0x5d73a4,'name');_0x63e348[_0x97b6('0x30')]=_[_0x97b6('0x31')](_0x374145[_0x97b6('0x30')]);_0x63e348['filters']=_[_0x97b6('0x32')](_0x63e348[_0x97b6('0x2f')],_0x63e348[_0x97b6('0x30')]);_0x425f17[_0x97b6('0x33')]=_['intersection'](_0x63e348[_0x97b6('0x2f')],qs['fields'](_0x374145[_0x97b6('0x30')][_0x97b6('0x34')]));_0x425f17[_0x97b6('0x33')]=_0x425f17[_0x97b6('0x33')][_0x97b6('0x35')]?_0x425f17[_0x97b6('0x33')]:_0x63e348[_0x97b6('0x2f')];if(!_0x374145[_0x97b6('0x30')][_0x97b6('0x36')](_0x97b6('0x37'))){_0x425f17[_0x97b6('0x1d')]=qs['limit'](_0x374145[_0x97b6('0x30')]['limit']);_0x425f17[_0x97b6('0x1a')]=qs['offset'](_0x374145[_0x97b6('0x30')]['offset']);}_0x425f17[_0x97b6('0x38')]=qs[_0x97b6('0x39')](_0x374145['query'][_0x97b6('0x39')]);_0x425f17[_0x97b6('0x3a')]=qs[_0x97b6('0x3b')](_['pick'](_0x374145[_0x97b6('0x30')],_0x63e348['filters']),_0x5d73a4);if(_0x374145[_0x97b6('0x30')][_0x97b6('0x3c')]){_0x425f17[_0x97b6('0x3a')]=_[_0x97b6('0x3d')](_0x425f17[_0x97b6('0x3a')],{'$or':_[_0x97b6('0x2a')](_0x5d73a4,function(_0x3888be){if(_0x3888be['type']!==_0x97b6('0x3e')){var _0x4262bd={};_0x4262bd[_0x3888be[_0x97b6('0x27')]]={'$like':'%'+_0x374145[_0x97b6('0x30')][_0x97b6('0x3c')]+'%'};return _0x4262bd;}})});}_0x425f17=_[_0x97b6('0x3d')]({},_0x425f17,_0x374145[_0x97b6('0x3f')]);var _0x54bd0b={'where':_0x425f17['where']};return db[_0x97b6('0x2b')][_0x97b6('0x1c')](_0x54bd0b)[_0x97b6('0x23')](function(_0x23b06b){_0x282347[_0x97b6('0x1c')]=_0x23b06b;if(_0x374145[_0x97b6('0x30')][_0x97b6('0x40')]){_0x425f17[_0x97b6('0x41')]=[{'all':!![]}];}return db[_0x97b6('0x2b')][_0x97b6('0x42')](_0x425f17);})[_0x97b6('0x23')](function(_0x303851){_0x282347['rows']=_0x303851;return _0x282347;})[_0x97b6('0x23')](respondWithFilteredResult(_0x5a61a7,_0x425f17))[_0x97b6('0x43')](handleError(_0x5a61a7,null));};exports[_0x97b6('0x44')]=function(_0x2913d5,_0x1fb64d){var _0x2983b8={'raw':!![],'where':{'id':_0x2913d5[_0x97b6('0x45')]['id']}},_0x54efe9={};_0x54efe9['model']=_[_0x97b6('0x31')](db['CmContactHasItem'][_0x97b6('0x2c')]);_0x54efe9[_0x97b6('0x30')]=_[_0x97b6('0x31')](_0x2913d5[_0x97b6('0x30')]);_0x54efe9[_0x97b6('0x3b')]=_[_0x97b6('0x32')](_0x54efe9[_0x97b6('0x2f')],_0x54efe9[_0x97b6('0x30')]);_0x2983b8['attributes']=_[_0x97b6('0x32')](_0x54efe9[_0x97b6('0x2f')],qs[_0x97b6('0x34')](_0x2913d5[_0x97b6('0x30')]['fields']));_0x2983b8['attributes']=_0x2983b8[_0x97b6('0x33')][_0x97b6('0x35')]?_0x2983b8[_0x97b6('0x33')]:_0x54efe9['model'];if(_0x2913d5['query'][_0x97b6('0x40')]){_0x2983b8[_0x97b6('0x41')]=[{'all':!![]}];}_0x2983b8=_['merge']({},_0x2983b8,_0x2913d5['options']);return db[_0x97b6('0x2b')][_0x97b6('0x46')](_0x2983b8)[_0x97b6('0x23')](handleEntityNotFound(_0x1fb64d,null))[_0x97b6('0x23')](respondWithResult(_0x1fb64d,null))[_0x97b6('0x43')](handleError(_0x1fb64d,null));};exports[_0x97b6('0x47')]=function(_0x12d61c,_0x2975b2){return db[_0x97b6('0x2b')][_0x97b6('0x47')](_0x12d61c[_0x97b6('0x48')],{})[_0x97b6('0x23')](function(_0x5a970c){var _0x4446cf=_0x12d61c[_0x97b6('0x49')]['get']({'plain':!![]});if(!_0x4446cf)throw new Error(_0x97b6('0x4a'));if(_0x4446cf[_0x97b6('0x4b')]==='user'){var _0x55155b=_0x5a970c[_0x97b6('0x24')]({'plain':!![]});var _0x76a35c='CmContactHasItems';return db[_0x97b6('0x4c')]['find']({'where':{'name':_0x76a35c,'userProfileId':_0x4446cf[_0x97b6('0x4d')]},'raw':!![]})[_0x97b6('0x23')](function(_0x414761){if(_0x414761&&_0x414761[_0x97b6('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x55155b['name'],'resourceId':_0x55155b['id'],'type':_0x414761['name'],'sectionId':_0x414761['id']},{})[_0x97b6('0x23')](function(){return _0x5a970c;});}else{return _0x5a970c;}})[_0x97b6('0x43')](function(_0x1b2088){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2088);throw _0x1b2088;});}return _0x5a970c;})['then'](respondWithResult(_0x2975b2,0xc9))[_0x97b6('0x43')](handleError(_0x2975b2,null));};exports[_0x97b6('0x4f')]=function(_0x289014,_0x40b81e){if(_0x289014[_0x97b6('0x48')]['id']){delete _0x289014[_0x97b6('0x48')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x289014['params']['id']}})[_0x97b6('0x23')](handleEntityNotFound(_0x40b81e,null))[_0x97b6('0x23')](saveUpdates(_0x289014[_0x97b6('0x48')],null))[_0x97b6('0x23')](respondWithResult(_0x40b81e,null))[_0x97b6('0x43')](handleError(_0x40b81e,null));};exports[_0x97b6('0x22')]=function(_0xf979eb,_0x39935f){return db[_0x97b6('0x2b')][_0x97b6('0x46')]({'where':{'id':_0xf979eb[_0x97b6('0x45')]['id']}})[_0x97b6('0x23')](handleEntityNotFound(_0x39935f,null))['then'](removeEntity(_0x39935f,null))[_0x97b6('0x43')](handleError(_0x39935f,null));}; \ No newline at end of file +var _0x58de=['fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','CmContactHasItem','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes'];(function(_0x53bd4a,_0x42db91){var _0x1a5cb1=function(_0x46ee57){while(--_0x46ee57){_0x53bd4a['push'](_0x53bd4a['shift']());}};_0x1a5cb1(++_0x42db91);}(_0x58de,0xcb));var _0xe58d=function(_0x33a300,_0x3242bc){_0x33a300=_0x33a300-0x0;var _0x1cb052=_0x58de[_0x33a300];return _0x1cb052;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe58d('0x0'));var zipdir=require(_0xe58d('0x1'));var jsonpatch=require(_0xe58d('0x2'));var rp=require(_0xe58d('0x3'));var moment=require('moment');var BPromise=require(_0xe58d('0x4'));var Mustache=require(_0xe58d('0x5'));var util=require('util');var path=require(_0xe58d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe58d('0x7'));var fs=require('fs');var fs_extra=require(_0xe58d('0x8'));var _=require(_0xe58d('0x9'));var squel=require(_0xe58d('0xa'));var crypto=require(_0xe58d('0xb'));var jsforce=require(_0xe58d('0xc'));var deskjs=require(_0xe58d('0xd'));var toCsv=require(_0xe58d('0xe'));var querystring=require(_0xe58d('0xf'));var Papa=require(_0xe58d('0x10'));var Redis=require(_0xe58d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe58d('0x12'));var as=require(_0xe58d('0x13'));var hardwareService=require(_0xe58d('0x14'));var logger=require(_0xe58d('0x15'))(_0xe58d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe58d('0x17'));var db=require(_0xe58d('0x18'))['db'];function respondWithStatusCode(_0x71337,_0xa35b42){_0xa35b42=_0xa35b42||0xcc;return function(_0x5f3ac2){if(_0x5f3ac2){return _0x71337['sendStatus'](_0xa35b42);}return _0x71337['status'](_0xa35b42)[_0xe58d('0x19')]();};}function respondWithResult(_0x3d6aac,_0xea616c){_0xea616c=_0xea616c||0xc8;return function(_0x16506c){if(_0x16506c){return _0x3d6aac[_0xe58d('0x1a')](_0xea616c)['json'](_0x16506c);}};}function respondWithFilteredResult(_0x5373d0,_0x18cf33){return function(_0x3d4bc3){if(_0x3d4bc3){var _0x34530a=typeof _0x18cf33['offset']===_0xe58d('0x1b')&&typeof _0x18cf33[_0xe58d('0x1c')]===_0xe58d('0x1b');var _0x5c9afe=_0x3d4bc3[_0xe58d('0x1d')];var _0xa5ceb9=_0x34530a?0x0:_0x18cf33[_0xe58d('0x1e')];var _0x1bbadd=_0x34530a?_0x3d4bc3[_0xe58d('0x1d')]:_0x18cf33[_0xe58d('0x1e')]+_0x18cf33[_0xe58d('0x1c')];var _0x107503;if(_0x1bbadd>=_0x5c9afe){_0x1bbadd=_0x5c9afe;_0x107503=0xc8;}else{_0x107503=0xce;}_0x5373d0['status'](_0x107503);return _0x5373d0[_0xe58d('0x1f')](_0xe58d('0x20'),_0xa5ceb9+'-'+_0x1bbadd+'/'+_0x5c9afe)['json'](_0x3d4bc3);}return null;};}function patchUpdates(_0xd5ce1c){return function(_0x3ebbea){try{jsonpatch[_0xe58d('0x21')](_0x3ebbea,_0xd5ce1c,!![]);}catch(_0x288843){return BPromise[_0xe58d('0x22')](_0x288843);}return _0x3ebbea[_0xe58d('0x23')]();};}function saveUpdates(_0x429b39,_0x1485d8){return function(_0xb9cc61){if(_0xb9cc61){return _0xb9cc61[_0xe58d('0x24')](_0x429b39)[_0xe58d('0x25')](function(_0x12f429){return _0x12f429;});}return null;};}function removeEntity(_0x281ff8,_0x423147){return function(_0xf926b9){if(_0xf926b9){return _0xf926b9[_0xe58d('0x26')]()[_0xe58d('0x25')](function(){var _0x5bdc5d=_0xf926b9[_0xe58d('0x27')]({'plain':!![]});var _0x35765f='CmContactHasItems';return db[_0xe58d('0x28')][_0xe58d('0x26')]({'where':{'type':_0x35765f,'resourceId':_0x5bdc5d['id']}})[_0xe58d('0x25')](function(){return _0xf926b9;});})[_0xe58d('0x25')](function(){_0x281ff8[_0xe58d('0x1a')](0xcc)[_0xe58d('0x19')]();});}};}function handleEntityNotFound(_0x1c04e3,_0x4d79c8){return function(_0x5946fb){if(!_0x5946fb){_0x1c04e3[_0xe58d('0x29')](0x194);}return _0x5946fb;};}function handleError(_0xf2f92e,_0x176e9f){_0x176e9f=_0x176e9f||0x1f4;return function(_0x3b3f12){logger[_0xe58d('0x2a')](_0x3b3f12[_0xe58d('0x2b')]);if(_0x3b3f12[_0xe58d('0x2c')]){delete _0x3b3f12[_0xe58d('0x2c')];}_0xf2f92e[_0xe58d('0x1a')](_0x176e9f)[_0xe58d('0x2d')](_0x3b3f12);};}exports[_0xe58d('0x2e')]=function(_0x27cd20,_0x519a3c){var _0x4c4100={},_0x1f5e1f={},_0xc74be7={'count':0x0,'rows':[]};var _0x20c447=_[_0xe58d('0x2f')](db['CmContactHasItem'][_0xe58d('0x30')],function(_0x386cc6){return{'name':_0x386cc6[_0xe58d('0x31')],'type':_0x386cc6[_0xe58d('0x32')][_0xe58d('0x33')]};});_0x1f5e1f['model']=_[_0xe58d('0x2f')](_0x20c447,_0xe58d('0x2c'));_0x1f5e1f['query']=_[_0xe58d('0x34')](_0x27cd20[_0xe58d('0x35')]);_0x1f5e1f[_0xe58d('0x36')]=_[_0xe58d('0x37')](_0x1f5e1f[_0xe58d('0x38')],_0x1f5e1f[_0xe58d('0x35')]);_0x4c4100[_0xe58d('0x39')]=_['intersection'](_0x1f5e1f[_0xe58d('0x38')],qs[_0xe58d('0x3a')](_0x27cd20[_0xe58d('0x35')][_0xe58d('0x3a')]));_0x4c4100['attributes']=_0x4c4100[_0xe58d('0x39')][_0xe58d('0x3b')]?_0x4c4100[_0xe58d('0x39')]:_0x1f5e1f[_0xe58d('0x38')];if(!_0x27cd20['query'][_0xe58d('0x3c')](_0xe58d('0x3d'))){_0x4c4100[_0xe58d('0x1c')]=qs['limit'](_0x27cd20['query'][_0xe58d('0x1c')]);_0x4c4100[_0xe58d('0x1e')]=qs[_0xe58d('0x1e')](_0x27cd20[_0xe58d('0x35')][_0xe58d('0x1e')]);}_0x4c4100['order']=qs[_0xe58d('0x3e')](_0x27cd20[_0xe58d('0x35')][_0xe58d('0x3e')]);_0x4c4100[_0xe58d('0x3f')]=qs[_0xe58d('0x36')](_[_0xe58d('0x40')](_0x27cd20['query'],_0x1f5e1f[_0xe58d('0x36')]),_0x20c447);if(_0x27cd20[_0xe58d('0x35')]['filter']){_0x4c4100[_0xe58d('0x3f')]=_['merge'](_0x4c4100[_0xe58d('0x3f')],{'$or':_[_0xe58d('0x2f')](_0x20c447,function(_0x405ba7){if(_0x405ba7[_0xe58d('0x32')]!==_0xe58d('0x41')){var _0x50993e={};_0x50993e[_0x405ba7[_0xe58d('0x2c')]]={'$like':'%'+_0x27cd20[_0xe58d('0x35')]['filter']+'%'};return _0x50993e;}})});}_0x4c4100=_[_0xe58d('0x42')]({},_0x4c4100,_0x27cd20[_0xe58d('0x43')]);var _0x78afb0={'where':_0x4c4100['where']};return db[_0xe58d('0x44')]['count'](_0x78afb0)[_0xe58d('0x25')](function(_0x31c66a){_0xc74be7[_0xe58d('0x1d')]=_0x31c66a;if(_0x27cd20[_0xe58d('0x35')]['includeAll']){_0x4c4100[_0xe58d('0x45')]=[{'all':!![]}];}return db[_0xe58d('0x44')][_0xe58d('0x46')](_0x4c4100);})[_0xe58d('0x25')](function(_0x267968){_0xc74be7[_0xe58d('0x47')]=_0x267968;return _0xc74be7;})[_0xe58d('0x25')](respondWithFilteredResult(_0x519a3c,_0x4c4100))[_0xe58d('0x48')](handleError(_0x519a3c,null));};exports[_0xe58d('0x49')]=function(_0x523031,_0x1111ad){var _0xec098e={'raw':!![],'where':{'id':_0x523031[_0xe58d('0x4a')]['id']}},_0x1e69aa={};_0x1e69aa[_0xe58d('0x38')]=_[_0xe58d('0x34')](db[_0xe58d('0x44')][_0xe58d('0x30')]);_0x1e69aa[_0xe58d('0x35')]=_['keys'](_0x523031[_0xe58d('0x35')]);_0x1e69aa[_0xe58d('0x36')]=_[_0xe58d('0x37')](_0x1e69aa[_0xe58d('0x38')],_0x1e69aa['query']);_0xec098e[_0xe58d('0x39')]=_[_0xe58d('0x37')](_0x1e69aa[_0xe58d('0x38')],qs[_0xe58d('0x3a')](_0x523031[_0xe58d('0x35')][_0xe58d('0x3a')]));_0xec098e[_0xe58d('0x39')]=_0xec098e[_0xe58d('0x39')][_0xe58d('0x3b')]?_0xec098e[_0xe58d('0x39')]:_0x1e69aa['model'];if(_0x523031[_0xe58d('0x35')][_0xe58d('0x4b')]){_0xec098e[_0xe58d('0x45')]=[{'all':!![]}];}_0xec098e=_[_0xe58d('0x42')]({},_0xec098e,_0x523031[_0xe58d('0x43')]);return db[_0xe58d('0x44')]['find'](_0xec098e)['then'](handleEntityNotFound(_0x1111ad,null))[_0xe58d('0x25')](respondWithResult(_0x1111ad,null))[_0xe58d('0x48')](handleError(_0x1111ad,null));};exports[_0xe58d('0x4c')]=function(_0x257006,_0x424922){return db[_0xe58d('0x44')]['create'](_0x257006['body'],{})['then'](function(_0x461214){var _0x1d5d67=_0x257006[_0xe58d('0x4d')]['get']({'plain':!![]});if(!_0x1d5d67)throw new Error(_0xe58d('0x4e'));if(_0x1d5d67[_0xe58d('0x4f')]==='user'){var _0xece761=_0x461214[_0xe58d('0x27')]({'plain':!![]});var _0x15feec=_0xe58d('0x50');return db[_0xe58d('0x51')][_0xe58d('0x52')]({'where':{'name':_0x15feec,'userProfileId':_0x1d5d67[_0xe58d('0x53')]},'raw':!![]})[_0xe58d('0x25')](function(_0x5bb8d8){if(_0x5bb8d8&&_0x5bb8d8[_0xe58d('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0xece761[_0xe58d('0x2c')],'resourceId':_0xece761['id'],'type':_0x5bb8d8[_0xe58d('0x2c')],'sectionId':_0x5bb8d8['id']},{})[_0xe58d('0x25')](function(){return _0x461214;});}else{return _0x461214;}})[_0xe58d('0x48')](function(_0x2af7cd){logger[_0xe58d('0x2a')](_0xe58d('0x55'),_0x2af7cd);throw _0x2af7cd;});}return _0x461214;})[_0xe58d('0x25')](respondWithResult(_0x424922,0xc9))['catch'](handleError(_0x424922,null));};exports[_0xe58d('0x24')]=function(_0x21d3ab,_0x56425f){if(_0x21d3ab[_0xe58d('0x56')]['id']){delete _0x21d3ab[_0xe58d('0x56')]['id'];}return db['CmContactHasItem'][_0xe58d('0x52')]({'where':{'id':_0x21d3ab[_0xe58d('0x4a')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x56425f,null))['then'](saveUpdates(_0x21d3ab[_0xe58d('0x56')],null))[_0xe58d('0x25')](respondWithResult(_0x56425f,null))['catch'](handleError(_0x56425f,null));};exports[_0xe58d('0x26')]=function(_0x5cc300,_0x5df983){return db[_0xe58d('0x44')][_0xe58d('0x52')]({'where':{'id':_0x5cc300[_0xe58d('0x4a')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x5df983,null))[_0xe58d('0x25')](removeEntity(_0x5df983,null))['catch'](handleError(_0x5df983,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 814a1d6..c737a39 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7505=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','define'];(function(_0x4f6d9c,_0x572a9f){var _0x52fd20=function(_0x1986aa){while(--_0x1986aa){_0x4f6d9c['push'](_0x4f6d9c['shift']());}};_0x52fd20(++_0x572a9f);}(_0x7505,0x1cc));var _0x5750=function(_0x331fe5,_0x176f95){_0x331fe5=_0x331fe5-0x0;var _0x20aee3=_0x7505[_0x331fe5];return _0x20aee3;};'use strict';var _=require(_0x5750('0x0'));var util=require(_0x5750('0x1'));var logger=require(_0x5750('0x2'))('api');var moment=require(_0x5750('0x3'));var BPromise=require(_0x5750('0x4'));var rp=require(_0x5750('0x5'));var fs=require('fs');var path=require(_0x5750('0x6'));var rimraf=require(_0x5750('0x7'));var config=require('../../config/environment');var attributes=require(_0x5750('0x8'));module['exports']=function(_0x142c53,_0x4fa0d8){return _0x142c53[_0x5750('0x9')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73a9=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items'];(function(_0x44d3ad,_0x52f9cd){var _0x4f635c=function(_0x502aef){while(--_0x502aef){_0x44d3ad['push'](_0x44d3ad['shift']());}};_0x4f635c(++_0x52f9cd);}(_0x73a9,0x1b8));var _0x973a=function(_0x552f97,_0x27f63e){_0x552f97=_0x552f97-0x0;var _0x20cb50=_0x73a9[_0x552f97];return _0x20cb50;};'use strict';var _=require(_0x973a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x973a('0x1'));var moment=require(_0x973a('0x2'));var BPromise=require(_0x973a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x973a('0x4'));var rimraf=require(_0x973a('0x5'));var config=require(_0x973a('0x6'));var attributes=require(_0x973a('0x7'));module[_0x973a('0x8')]=function(_0x3ae4de,_0x2569a2){return _0x3ae4de[_0x973a('0x9')]('CmContactHasItem',attributes,{'tableName':_0x973a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index e97f036..40d1575 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ca=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird'];(function(_0xb0c82f,_0x56a810){var _0x41bc18=function(_0x53923e){while(--_0x53923e){_0xb0c82f['push'](_0xb0c82f['shift']());}};_0x41bc18(++_0x56a810);}(_0xb2ca,0x122));var _0xab2c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb2ca[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var moment=require(_0xab2c('0x2'));var BPromise=require(_0xab2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab2c('0x4'));var db=require(_0xab2c('0x5'))['db'];var utils=require(_0xab2c('0x6'));var logger=require(_0xab2c('0x7'))(_0xab2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xab2c('0x9'));var client=jayson['client'][_0xab2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5650b7,_0x128d4f,_0x33b185){return new BPromise(function(_0x27146d,_0x1a15bb){return client[_0xab2c('0xb')](_0x5650b7,_0x33b185)[_0xab2c('0xc')](function(_0x537feb){logger[_0xab2c('0xd')](_0xab2c('0xe'),_0x128d4f,_0xab2c('0xf'));logger[_0xab2c('0x10')](_0xab2c('0x11'),_0x128d4f,'request\x20sent',JSON[_0xab2c('0x12')](_0x537feb));if(_0x537feb[_0xab2c('0x13')]){if(_0x537feb[_0xab2c('0x13')]['code']===0x1f4){logger[_0xab2c('0x13')](_0xab2c('0xe'),_0x128d4f,_0x537feb[_0xab2c('0x13')][_0xab2c('0x14')]);return _0x1a15bb(_0x537feb[_0xab2c('0x13')][_0xab2c('0x14')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x128d4f,_0x537feb[_0xab2c('0x13')][_0xab2c('0x14')]);return _0x27146d(_0x537feb['error']['message']);}else{logger[_0xab2c('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x128d4f,_0xab2c('0xf'));_0x27146d(_0x537feb['result'][_0xab2c('0x14')]);}})['catch'](function(_0x5bdc7b){logger[_0xab2c('0x13')](_0xab2c('0xe'),_0x128d4f,_0x5bdc7b);_0x1a15bb(_0x5bdc7b);});});} \ No newline at end of file +var _0x2827=['http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1cdcd1,_0x2adc77){var _0x2ef14e=function(_0x366d86){while(--_0x366d86){_0x1cdcd1['push'](_0x1cdcd1['shift']());}};_0x2ef14e(++_0x2adc77);}(_0x2827,0x1d9));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7282('0x0'));var util=require(_0x7282('0x1'));var moment=require(_0x7282('0x2'));var BPromise=require(_0x7282('0x3'));var rs=require(_0x7282('0x4'));var fs=require('fs');var Redis=require(_0x7282('0x5'));var db=require(_0x7282('0x6'))['db'];var utils=require(_0x7282('0x7'));var logger=require(_0x7282('0x8'))(_0x7282('0x9'));var config=require(_0x7282('0xa'));var jayson=require(_0x7282('0xb'));var client=jayson[_0x7282('0xc')][_0x7282('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3e57c1,_0x51d9ac,_0x2e44b5){return new BPromise(function(_0x630bae,_0x54d601){return client[_0x7282('0xe')](_0x3e57c1,_0x2e44b5)[_0x7282('0xf')](function(_0x37c79b){logger['info'](_0x7282('0x10'),_0x51d9ac,_0x7282('0x11'));logger[_0x7282('0x12')](_0x7282('0x13'),_0x51d9ac,_0x7282('0x11'),JSON[_0x7282('0x14')](_0x37c79b));if(_0x37c79b['error']){if(_0x37c79b['error'][_0x7282('0x15')]===0x1f4){logger[_0x7282('0x16')](_0x7282('0x10'),_0x51d9ac,_0x37c79b[_0x7282('0x16')]['message']);return _0x54d601(_0x37c79b[_0x7282('0x16')]['message']);}logger[_0x7282('0x16')](_0x7282('0x10'),_0x51d9ac,_0x37c79b[_0x7282('0x16')][_0x7282('0x17')]);return _0x630bae(_0x37c79b[_0x7282('0x16')][_0x7282('0x17')]);}else{logger[_0x7282('0x18')]('CmContactHasItem,\x20%s,\x20%s',_0x51d9ac,'request\x20sent');_0x630bae(_0x37c79b[_0x7282('0x19')]['message']);}})[_0x7282('0x1a')](function(_0x5604ae){logger[_0x7282('0x16')](_0x7282('0x10'),_0x51d9ac,_0x5604ae);_0x54d601(_0x5604ae);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 9dc0767..ab1f3d1 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff0b=['../../config/environment','get','isAuthenticated','index','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e820f,_0x3bb064){var _0x4c9453=function(_0x52ecc0){while(--_0x52ecc0){_0x5e820f['push'](_0x5e820f['shift']());}};_0x4c9453(++_0x3bb064);}(_0xff0b,0xf3));var _0xbff0=function(_0x336850,_0x5f245e){_0x336850=_0x336850-0x0;var _0x46a6bb=_0xff0b[_0x336850];return _0x46a6bb;};'use strict';var multer=require(_0xbff0('0x0'));var util=require(_0xbff0('0x1'));var path=require(_0xbff0('0x2'));var timeout=require(_0xbff0('0x3'));var express=require(_0xbff0('0x4'));var router=express[_0xbff0('0x5')]();var fs_extra=require(_0xbff0('0x6'));var auth=require(_0xbff0('0x7'));var interaction=require(_0xbff0('0x8'));var config=require(_0xbff0('0x9'));var controller=require('./cmContactHasItem.controller');router[_0xbff0('0xa')]('/',auth[_0xbff0('0xb')](),controller[_0xbff0('0xc')]);router[_0xbff0('0xa')](_0xbff0('0xd'),auth[_0xbff0('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xbff0('0xb')](),controller[_0xbff0('0xe')]);router[_0xbff0('0xf')](_0xbff0('0xd'),auth[_0xbff0('0xb')](),controller[_0xbff0('0x10')]);module[_0xbff0('0x11')]=router; \ No newline at end of file +var _0x3a71=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2f15b4,_0xe52b00){var _0x5658ea=function(_0x21ff59){while(--_0x21ff59){_0x2f15b4['push'](_0x2f15b4['shift']());}};_0x5658ea(++_0xe52b00);}(_0x3a71,0x188));var _0x13a7=function(_0x466cb1,_0xe4241d){_0x466cb1=_0x466cb1-0x0;var _0x2d76ca=_0x3a71[_0x466cb1];return _0x2d76ca;};'use strict';var multer=require(_0x13a7('0x0'));var util=require(_0x13a7('0x1'));var path=require(_0x13a7('0x2'));var timeout=require(_0x13a7('0x3'));var express=require(_0x13a7('0x4'));var router=express[_0x13a7('0x5')]();var fs_extra=require(_0x13a7('0x6'));var auth=require(_0x13a7('0x7'));var interaction=require(_0x13a7('0x8'));var config=require(_0x13a7('0x9'));var controller=require(_0x13a7('0xa'));router[_0x13a7('0xb')]('/',auth[_0x13a7('0xc')](),controller[_0x13a7('0xd')]);router[_0x13a7('0xb')](_0x13a7('0xe'),auth['isAuthenticated'](),controller[_0x13a7('0xf')]);router[_0x13a7('0x10')]('/',auth['isAuthenticated'](),controller[_0x13a7('0x11')]);router[_0x13a7('0x12')](_0x13a7('0xe'),auth[_0x13a7('0xc')](),controller[_0x13a7('0x13')]);router['delete'](_0x13a7('0xe'),auth[_0x13a7('0xc')](),controller['destroy']);module[_0x13a7('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 5767490..3629fc1 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 _0x53f7=['TEXT','long','getDataValue','type','parse','values','setDataValue','BOOLEAN','ENUM','lodash','exports','VIRTUAL','STRING','alias','name'];(function(_0x5ca0e1,_0x423cca){var _0x1f62e0=function(_0x316f2b){while(--_0x316f2b){_0x5ca0e1['push'](_0x5ca0e1['shift']());}};_0x1f62e0(++_0x423cca);}(_0x53f7,0x126));var _0x753f=function(_0x4c4981,_0x178530){_0x4c4981=_0x4c4981-0x0;var _0x2dc9c1=_0x53f7[_0x4c4981];return _0x2dc9c1;};'use strict';var Sequelize=require('sequelize');var _=require(_0x753f('0x0'));module[_0x753f('0x1')]={'name':{'type':Sequelize[_0x753f('0x2')],'get':function(_0x238652){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x753f('0x3')],'allowNull':![],'set':function(_0x21b879){this['setDataValue'](_0x753f('0x4'),_0x21b879?_0x21b879:this['getDataValue'](_0x753f('0x5')));}},'type':{'type':Sequelize[_0x753f('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x753f('0x6')](_0x753f('0x7')),'get':function(){if(this[_0x753f('0x8')](_0x753f('0x9'))==='select'){return JSON[_0x753f('0xa')](this[_0x753f('0x8')](_0x753f('0xb')));}else{return this[_0x753f('0x8')](_0x753f('0xb'));}},'set':function(_0x61ecc){if(Array['isArray'](_0x61ecc)){this[_0x753f('0xc')](_0x753f('0xb'),JSON['stringify'](_0x61ecc));}else{this['setDataValue'](_0x753f('0xb'),_0x61ecc);}}},'required':{'type':Sequelize[_0x753f('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x753f('0xe')]('voice')}}; \ No newline at end of file +var _0xf375=['name','TEXT','type','select','parse','values','isArray','stringify','ENUM','voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue'];(function(_0x138e86,_0x11c1a6){var _0x51930a=function(_0x5d6661){while(--_0x5d6661){_0x138e86['push'](_0x138e86['shift']());}};_0x51930a(++_0x11c1a6);}(_0xf375,0x70));var _0x5f37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf375[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5f37('0x0'));var _=require(_0x5f37('0x1'));module[_0x5f37('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x271c8f){return this[_0x5f37('0x3')](_0x5f37('0x4'));}},'alias':{'type':Sequelize[_0x5f37('0x5')],'allowNull':![],'set':function(_0x4e6eb8){this[_0x5f37('0x6')](_0x5f37('0x4'),_0x4e6eb8?_0x4e6eb8:this[_0x5f37('0x3')](_0x5f37('0x7')));}},'type':{'type':Sequelize[_0x5f37('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x5f37('0x8')]('long'),'get':function(){if(this['getDataValue'](_0x5f37('0x9'))===_0x5f37('0xa')){return JSON[_0x5f37('0xb')](this['getDataValue']('values'));}else{return this[_0x5f37('0x3')](_0x5f37('0xc'));}},'set':function(_0x422a5f){if(Array[_0x5f37('0xd')](_0x422a5f)){this[_0x5f37('0x6')](_0x5f37('0xc'),JSON[_0x5f37('0xe')](_0x422a5f));}else{this['setDataValue'](_0x5f37('0xc'),_0x422a5f);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x5f37('0xf')](_0x5f37('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 9c1d288..ede580c 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 _0x698c=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','filter','options','includeAll','findAll','show','include','catch','body','find','params','transaction','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x59ad89,_0x41cdbd){var _0x463e97=function(_0x4bc593){while(--_0x4bc593){_0x59ad89['push'](_0x59ad89['shift']());}};_0x463e97(++_0x41cdbd);}(_0x698c,0x15b));var _0xc698=function(_0x1befb8,_0x220d82){_0x1befb8=_0x1befb8-0x0;var _0x4e87cc=_0x698c[_0x1befb8];return _0x4e87cc;};'use strict';var emlformat=require(_0xc698('0x0'));var rimraf=require(_0xc698('0x1'));var zipdir=require(_0xc698('0x2'));var jsonpatch=require(_0xc698('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc698('0x4'));var Mustache=require(_0xc698('0x5'));var util=require('util');var path=require(_0xc698('0x6'));var sox=require(_0xc698('0x7'));var csv=require(_0xc698('0x8'));var ejs=require(_0xc698('0x9'));var fs=require('fs');var fs_extra=require(_0xc698('0xa'));var _=require(_0xc698('0xb'));var squel=require(_0xc698('0xc'));var crypto=require('crypto');var jsforce=require(_0xc698('0xd'));var deskjs=require(_0xc698('0xe'));var toCsv=require(_0xc698('0x8'));var querystring=require(_0xc698('0xf'));var Papa=require(_0xc698('0x10'));var Redis=require(_0xc698('0x11'));var authService=require(_0xc698('0x12'));var qs=require(_0xc698('0x13'));var as=require(_0xc698('0x14'));var hardwareService=require(_0xc698('0x15'));var logger=require(_0xc698('0x16'))(_0xc698('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc698('0x18'))['db'];function respondWithStatusCode(_0x33ac15,_0x21ea27){_0x21ea27=_0x21ea27||0xcc;return function(_0x13e034){if(_0x13e034){return _0x33ac15[_0xc698('0x19')](_0x21ea27);}return _0x33ac15[_0xc698('0x1a')](_0x21ea27)[_0xc698('0x1b')]();};}function respondWithResult(_0xf88bf9,_0x4011c8){_0x4011c8=_0x4011c8||0xc8;return function(_0x5197a2){if(_0x5197a2){return _0xf88bf9[_0xc698('0x1a')](_0x4011c8)[_0xc698('0x1c')](_0x5197a2);}};}function respondWithFilteredResult(_0x492e02,_0x5ea15e){return function(_0x5909d6){if(_0x5909d6){var _0x2b949e=typeof _0x5ea15e['offset']===_0xc698('0x1d')&&typeof _0x5ea15e['limit']===_0xc698('0x1d');var _0x667894=_0x5909d6['count'];var _0x191c80=_0x2b949e?0x0:_0x5ea15e['offset'];var _0x454fa3=_0x2b949e?_0x5909d6[_0xc698('0x1e')]:_0x5ea15e[_0xc698('0x1f')]+_0x5ea15e['limit'];var _0x3830f1;if(_0x454fa3>=_0x667894){_0x454fa3=_0x667894;_0x3830f1=0xc8;}else{_0x3830f1=0xce;}_0x492e02[_0xc698('0x1a')](_0x3830f1);return _0x492e02[_0xc698('0x20')](_0xc698('0x21'),_0x191c80+'-'+_0x454fa3+'/'+_0x667894)['json'](_0x5909d6);}return null;};}function patchUpdates(_0x57573c){return function(_0x1c557d){try{jsonpatch['apply'](_0x1c557d,_0x57573c,!![]);}catch(_0x1548e1){return BPromise[_0xc698('0x22')](_0x1548e1);}return _0x1c557d[_0xc698('0x23')]();};}function saveUpdates(_0x32be9e,_0x9679bf){return function(_0x1c2a8f){if(_0x1c2a8f){return _0x1c2a8f[_0xc698('0x24')](_0x32be9e)[_0xc698('0x25')](function(_0xd0e3){return _0xd0e3;});}return null;};}function removeEntity(_0x3df891,_0x448849){return function(_0x60f787){if(_0x60f787){return _0x60f787[_0xc698('0x26')]()['then'](function(){_0x3df891[_0xc698('0x1a')](0xcc)[_0xc698('0x1b')]();});}};}function handleEntityNotFound(_0x1230fe,_0x3a6537){return function(_0x32dd60){if(!_0x32dd60){_0x1230fe[_0xc698('0x19')](0x194);}return _0x32dd60;};}function handleError(_0x5d0010,_0x5714e7){_0x5714e7=_0x5714e7||0x1f4;return function(_0x100896){logger['error'](_0x100896[_0xc698('0x27')]);if(_0x100896[_0xc698('0x28')]){delete _0x100896[_0xc698('0x28')];}_0x5d0010['status'](_0x5714e7)[_0xc698('0x29')](_0x100896);};}exports[_0xc698('0x2a')]=function(_0x350ca8,_0x1f78e6){var _0x2d79e1={},_0x1d6e2f={},_0x22295e={'count':0x0,'rows':[]};var _0x3d7a67=_[_0xc698('0x2b')](db[_0xc698('0x2c')][_0xc698('0x2d')],function(_0x3dedcf){return{'name':_0x3dedcf[_0xc698('0x2e')],'type':_0x3dedcf[_0xc698('0x2f')][_0xc698('0x30')]};});_0x1d6e2f['model']=_[_0xc698('0x31')](_[_0xc698('0x2b')](_0x3d7a67,_0xc698('0x28')),[_0xc698('0x28')]);_0x1d6e2f['query']=_[_0xc698('0x32')](_0x350ca8[_0xc698('0x33')]);_0x1d6e2f[_0xc698('0x34')]=_[_0xc698('0x35')](_0x1d6e2f[_0xc698('0x36')],_0x1d6e2f[_0xc698('0x33')]);_0x2d79e1[_0xc698('0x37')]=_['intersection'](_0x1d6e2f[_0xc698('0x36')],qs[_0xc698('0x38')](_0x350ca8[_0xc698('0x33')][_0xc698('0x38')]));_0x2d79e1[_0xc698('0x37')]=_0x2d79e1[_0xc698('0x37')][_0xc698('0x39')]?_0x2d79e1[_0xc698('0x37')]:_0x1d6e2f[_0xc698('0x36')];if(!_0x350ca8[_0xc698('0x33')][_0xc698('0x3a')](_0xc698('0x3b'))){_0x2d79e1[_0xc698('0x3c')]=qs['limit'](_0x350ca8[_0xc698('0x33')][_0xc698('0x3c')]);_0x2d79e1[_0xc698('0x1f')]=qs[_0xc698('0x1f')](_0x350ca8[_0xc698('0x33')]['offset']);}_0x2d79e1['order']=qs['sort'](_0x350ca8[_0xc698('0x33')][_0xc698('0x3d')]);_0x2d79e1[_0xc698('0x3e')]=qs[_0xc698('0x34')](_[_0xc698('0x3f')](_0x350ca8[_0xc698('0x33')],_0x1d6e2f[_0xc698('0x34')]),_0x3d7a67);if(_0x350ca8[_0xc698('0x33')]['filter']){_0x2d79e1[_0xc698('0x3e')]=_[_0xc698('0x40')](_0x2d79e1[_0xc698('0x3e')],{'$or':_[_0xc698('0x2b')](_0x3d7a67,function(_0x171c5b){if(_0x171c5b[_0xc698('0x2f')]!=='VIRTUAL'){var _0x2f19a6={};_0x2f19a6[_0x171c5b['name']]={'$like':'%'+_0x350ca8[_0xc698('0x33')][_0xc698('0x41')]+'%'};return _0x2f19a6;}})});}_0x2d79e1=_[_0xc698('0x40')]({},_0x2d79e1,_0x350ca8[_0xc698('0x42')]);var _0x5e1c6f={'where':_0x2d79e1['where']};return db[_0xc698('0x2c')][_0xc698('0x1e')](_0x5e1c6f)[_0xc698('0x25')](function(_0x5cfb81){_0x22295e['count']=_0x5cfb81;if(_0x350ca8[_0xc698('0x33')][_0xc698('0x43')]){_0x2d79e1['include']=[{'all':!![]}];}return db[_0xc698('0x2c')][_0xc698('0x44')](_0x2d79e1);})[_0xc698('0x25')](function(_0x2e2068){_0x22295e['rows']=_0x2e2068;return _0x22295e;})['then'](respondWithFilteredResult(_0x1f78e6,_0x2d79e1))['catch'](handleError(_0x1f78e6,null));};exports[_0xc698('0x45')]=function(_0xeb494f,_0xd9c6e5){var _0x17dc30={'raw':!![],'where':{'id':_0xeb494f['params']['id']}},_0x1bd538={};_0x1bd538[_0xc698('0x36')]=_[_0xc698('0x32')](db[_0xc698('0x2c')]['rawAttributes']);_0x1bd538[_0xc698('0x33')]=_[_0xc698('0x32')](_0xeb494f[_0xc698('0x33')]);_0x1bd538[_0xc698('0x34')]=_[_0xc698('0x35')](_0x1bd538[_0xc698('0x36')],_0x1bd538['query']);_0x17dc30[_0xc698('0x37')]=_[_0xc698('0x35')](_0x1bd538[_0xc698('0x36')],qs[_0xc698('0x38')](_0xeb494f[_0xc698('0x33')][_0xc698('0x38')]));_0x17dc30[_0xc698('0x37')]=_0x17dc30['attributes'][_0xc698('0x39')]?_0x17dc30[_0xc698('0x37')]:_0x1bd538['model'];if(_0xeb494f['query']['includeAll']){_0x17dc30[_0xc698('0x46')]=[{'all':!![]}];}_0x17dc30=_[_0xc698('0x40')]({},_0x17dc30,_0xeb494f[_0xc698('0x42')]);return db[_0xc698('0x2c')]['find'](_0x17dc30)[_0xc698('0x25')](handleEntityNotFound(_0xd9c6e5,null))['then'](respondWithResult(_0xd9c6e5,null))[_0xc698('0x47')](handleError(_0xd9c6e5,null));};exports[_0xc698('0x24')]=function(_0x551dc7,_0x4cd345){if(_0x551dc7[_0xc698('0x48')]['id']){delete _0x551dc7[_0xc698('0x48')]['id'];}return db[_0xc698('0x2c')][_0xc698('0x49')]({'where':{'id':_0x551dc7['params']['id']}})[_0xc698('0x25')](handleEntityNotFound(_0x4cd345,null))['then'](saveUpdates(_0x551dc7[_0xc698('0x48')],null))['then'](respondWithResult(_0x4cd345,null))['catch'](handleError(_0x4cd345,null));};exports[_0xc698('0x26')]=function(_0x27a84d,_0x42e900){return db['CmCustomField'][_0xc698('0x49')]({'where':{'id':_0x27a84d[_0xc698('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42e900,null))[_0xc698('0x25')](removeEntity(_0x42e900,null))['catch'](handleError(_0x42e900,null));};exports['create']=function(_0x1b5ac4,_0x369864){var _0x200ec2;return db['sequelize'][_0xc698('0x4b')](function(_0x237632){return db[_0xc698('0x2c')][_0xc698('0x4c')](_0x1b5ac4[_0xc698('0x48')],{'transaction':_0x237632})['then'](function(_0x708024){_0x200ec2=_0x708024;var _0x4151c0={'type':db[_0xc698('0x4d')][_0xc698('0x4e')],'transaction':_0x237632};switch(_0x1b5ac4[_0xc698('0x48')]['type']){case _0xc698('0x4f'):_0x4151c0['type']=db[_0xc698('0x4d')]['TEXT'];break;case _0xc698('0x50'):_0x4151c0[_0xc698('0x2f')]=db[_0xc698('0x4d')][_0xc698('0x51')];break;case _0xc698('0x52'):_0x4151c0['type']=db['Sequelize'][_0xc698('0x53')];_0x4151c0['defaultValue']=![];break;default:}return db[_0xc698('0x54')][_0xc698('0x55')][_0xc698('0x56')](_0xc698('0x57'),util[_0xc698('0x58')](_0xc698('0x59'),_0x200ec2['id']),_0x4151c0);})[_0xc698('0x25')](function(){return _0x200ec2;});})[_0xc698('0x25')](respondWithResult(_0x369864,0xc9))[_0xc698('0x47')](handleError(_0x369864,null));}; \ No newline at end of file +var _0x1494=['undefined','offset','count','limit','set','Content-Range','apply','reject','save','destroy','error','name','send','index','CmCustomField','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','then','show','params','options','catch','body','find','create','sequelize','transaction','Sequelize','TEXT','text','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4901c5,_0x9dfb8f){var _0x2269d2=function(_0x4ab876){while(--_0x4ab876){_0x4901c5['push'](_0x4901c5['shift']());}};_0x2269d2(++_0x9dfb8f);}(_0x1494,0x8e));var _0x4149=function(_0x476cdf,_0x5cf402){_0x476cdf=_0x476cdf-0x0;var _0x89eae2=_0x1494[_0x476cdf];return _0x89eae2;};'use strict';var emlformat=require(_0x4149('0x0'));var rimraf=require(_0x4149('0x1'));var zipdir=require(_0x4149('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4149('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4149('0x4'));var util=require(_0x4149('0x5'));var path=require(_0x4149('0x6'));var sox=require(_0x4149('0x7'));var csv=require('to-csv');var ejs=require(_0x4149('0x8'));var fs=require('fs');var fs_extra=require(_0x4149('0x9'));var _=require(_0x4149('0xa'));var squel=require(_0x4149('0xb'));var crypto=require(_0x4149('0xc'));var jsforce=require(_0x4149('0xd'));var deskjs=require(_0x4149('0xe'));var toCsv=require(_0x4149('0xf'));var querystring=require('querystring');var Papa=require(_0x4149('0x10'));var Redis=require('ioredis');var authService=require(_0x4149('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4149('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4149('0x13'));var licenseUtil=require(_0x4149('0x14'));var db=require(_0x4149('0x15'))['db'];function respondWithStatusCode(_0x4b8dbc,_0x5c582b){_0x5c582b=_0x5c582b||0xcc;return function(_0x63a43d){if(_0x63a43d){return _0x4b8dbc[_0x4149('0x16')](_0x5c582b);}return _0x4b8dbc[_0x4149('0x17')](_0x5c582b)[_0x4149('0x18')]();};}function respondWithResult(_0x2821ec,_0x31c5f3){_0x31c5f3=_0x31c5f3||0xc8;return function(_0x1d6d9e){if(_0x1d6d9e){return _0x2821ec['status'](_0x31c5f3)[_0x4149('0x19')](_0x1d6d9e);}};}function respondWithFilteredResult(_0xc448d6,_0x5716f9){return function(_0xb3593b){if(_0xb3593b){var _0x51a8da=typeof _0x5716f9['offset']===_0x4149('0x1a')&&typeof _0x5716f9['limit']===_0x4149('0x1a');var _0x1bfa95=_0xb3593b['count'];var _0x37ca78=_0x51a8da?0x0:_0x5716f9[_0x4149('0x1b')];var _0x1ce603=_0x51a8da?_0xb3593b[_0x4149('0x1c')]:_0x5716f9[_0x4149('0x1b')]+_0x5716f9[_0x4149('0x1d')];var _0x3079f1;if(_0x1ce603>=_0x1bfa95){_0x1ce603=_0x1bfa95;_0x3079f1=0xc8;}else{_0x3079f1=0xce;}_0xc448d6[_0x4149('0x17')](_0x3079f1);return _0xc448d6[_0x4149('0x1e')](_0x4149('0x1f'),_0x37ca78+'-'+_0x1ce603+'/'+_0x1bfa95)['json'](_0xb3593b);}return null;};}function patchUpdates(_0x3345a2){return function(_0x346d02){try{jsonpatch[_0x4149('0x20')](_0x346d02,_0x3345a2,!![]);}catch(_0x130756){return BPromise[_0x4149('0x21')](_0x130756);}return _0x346d02[_0x4149('0x22')]();};}function saveUpdates(_0x2041cc,_0x3d9655){return function(_0x350413){if(_0x350413){return _0x350413['update'](_0x2041cc)['then'](function(_0x5616d3){return _0x5616d3;});}return null;};}function removeEntity(_0x4228e5,_0x2d04fe){return function(_0xec7b40){if(_0xec7b40){return _0xec7b40[_0x4149('0x23')]()['then'](function(){_0x4228e5[_0x4149('0x17')](0xcc)[_0x4149('0x18')]();});}};}function handleEntityNotFound(_0x462302,_0x472776){return function(_0x3c4228){if(!_0x3c4228){_0x462302[_0x4149('0x16')](0x194);}return _0x3c4228;};}function handleError(_0x3dbe79,_0x324f5c){_0x324f5c=_0x324f5c||0x1f4;return function(_0xbed4a7){logger[_0x4149('0x24')](_0xbed4a7['stack']);if(_0xbed4a7[_0x4149('0x25')]){delete _0xbed4a7[_0x4149('0x25')];}_0x3dbe79[_0x4149('0x17')](_0x324f5c)[_0x4149('0x26')](_0xbed4a7);};}exports[_0x4149('0x27')]=function(_0x5145f8,_0x39a140){var _0x1053bc={},_0x4d34d3={},_0x5dcb2a={'count':0x0,'rows':[]};var _0xf2dfe=_['map'](db[_0x4149('0x28')][_0x4149('0x29')],function(_0x334281){return{'name':_0x334281['fieldName'],'type':_0x334281['type'][_0x4149('0x2a')]};});_0x4d34d3[_0x4149('0x2b')]=_['differenceBy'](_[_0x4149('0x2c')](_0xf2dfe,_0x4149('0x25')),[_0x4149('0x25')]);_0x4d34d3[_0x4149('0x2d')]=_[_0x4149('0x2e')](_0x5145f8['query']);_0x4d34d3[_0x4149('0x2f')]=_[_0x4149('0x30')](_0x4d34d3[_0x4149('0x2b')],_0x4d34d3['query']);_0x1053bc['attributes']=_[_0x4149('0x30')](_0x4d34d3[_0x4149('0x2b')],qs[_0x4149('0x31')](_0x5145f8[_0x4149('0x2d')][_0x4149('0x31')]));_0x1053bc[_0x4149('0x32')]=_0x1053bc[_0x4149('0x32')][_0x4149('0x33')]?_0x1053bc[_0x4149('0x32')]:_0x4d34d3['model'];if(!_0x5145f8[_0x4149('0x2d')]['hasOwnProperty'](_0x4149('0x34'))){_0x1053bc[_0x4149('0x1d')]=qs[_0x4149('0x1d')](_0x5145f8['query'][_0x4149('0x1d')]);_0x1053bc['offset']=qs[_0x4149('0x1b')](_0x5145f8[_0x4149('0x2d')][_0x4149('0x1b')]);}_0x1053bc['order']=qs[_0x4149('0x35')](_0x5145f8[_0x4149('0x2d')][_0x4149('0x35')]);_0x1053bc['where']=qs['filters'](_[_0x4149('0x36')](_0x5145f8[_0x4149('0x2d')],_0x4d34d3[_0x4149('0x2f')]),_0xf2dfe);if(_0x5145f8[_0x4149('0x2d')][_0x4149('0x37')]){_0x1053bc[_0x4149('0x38')]=_[_0x4149('0x39')](_0x1053bc[_0x4149('0x38')],{'$or':_[_0x4149('0x2c')](_0xf2dfe,function(_0x302743){if(_0x302743[_0x4149('0x3a')]!==_0x4149('0x3b')){var _0x2e5fb6={};_0x2e5fb6[_0x302743[_0x4149('0x25')]]={'$like':'%'+_0x5145f8[_0x4149('0x2d')][_0x4149('0x37')]+'%'};return _0x2e5fb6;}})});}_0x1053bc=_[_0x4149('0x39')]({},_0x1053bc,_0x5145f8['options']);var _0x5cc785={'where':_0x1053bc['where']};return db[_0x4149('0x28')][_0x4149('0x1c')](_0x5cc785)['then'](function(_0x57cd48){_0x5dcb2a[_0x4149('0x1c')]=_0x57cd48;if(_0x5145f8['query'][_0x4149('0x3c')]){_0x1053bc[_0x4149('0x3d')]=[{'all':!![]}];}return db[_0x4149('0x28')][_0x4149('0x3e')](_0x1053bc);})['then'](function(_0x4d9aab){_0x5dcb2a[_0x4149('0x3f')]=_0x4d9aab;return _0x5dcb2a;})[_0x4149('0x40')](respondWithFilteredResult(_0x39a140,_0x1053bc))['catch'](handleError(_0x39a140,null));};exports[_0x4149('0x41')]=function(_0x35baf7,_0x584638){var _0x120f34={'raw':!![],'where':{'id':_0x35baf7[_0x4149('0x42')]['id']}},_0x156d46={};_0x156d46[_0x4149('0x2b')]=_[_0x4149('0x2e')](db[_0x4149('0x28')]['rawAttributes']);_0x156d46[_0x4149('0x2d')]=_[_0x4149('0x2e')](_0x35baf7[_0x4149('0x2d')]);_0x156d46['filters']=_[_0x4149('0x30')](_0x156d46['model'],_0x156d46['query']);_0x120f34[_0x4149('0x32')]=_['intersection'](_0x156d46[_0x4149('0x2b')],qs[_0x4149('0x31')](_0x35baf7[_0x4149('0x2d')]['fields']));_0x120f34[_0x4149('0x32')]=_0x120f34[_0x4149('0x32')][_0x4149('0x33')]?_0x120f34[_0x4149('0x32')]:_0x156d46['model'];if(_0x35baf7[_0x4149('0x2d')][_0x4149('0x3c')]){_0x120f34['include']=[{'all':!![]}];}_0x120f34=_[_0x4149('0x39')]({},_0x120f34,_0x35baf7[_0x4149('0x43')]);return db['CmCustomField']['find'](_0x120f34)[_0x4149('0x40')](handleEntityNotFound(_0x584638,null))[_0x4149('0x40')](respondWithResult(_0x584638,null))[_0x4149('0x44')](handleError(_0x584638,null));};exports['update']=function(_0x498604,_0x411bf8){if(_0x498604[_0x4149('0x45')]['id']){delete _0x498604[_0x4149('0x45')]['id'];}return db[_0x4149('0x28')][_0x4149('0x46')]({'where':{'id':_0x498604[_0x4149('0x42')]['id']}})[_0x4149('0x40')](handleEntityNotFound(_0x411bf8,null))[_0x4149('0x40')](saveUpdates(_0x498604[_0x4149('0x45')],null))[_0x4149('0x40')](respondWithResult(_0x411bf8,null))[_0x4149('0x44')](handleError(_0x411bf8,null));};exports['destroy']=function(_0x10c3d5,_0x430410){return db[_0x4149('0x28')][_0x4149('0x46')]({'where':{'id':_0x10c3d5[_0x4149('0x42')]['id']}})['then'](handleEntityNotFound(_0x430410,null))['then'](removeEntity(_0x430410,null))[_0x4149('0x44')](handleError(_0x430410,null));};exports[_0x4149('0x47')]=function(_0xce0f96,_0x3934e1){var _0x4edf7b;return db[_0x4149('0x48')][_0x4149('0x49')](function(_0x561ca6){return db[_0x4149('0x28')][_0x4149('0x47')](_0xce0f96[_0x4149('0x45')],{'transaction':_0x561ca6})['then'](function(_0x1f1127){_0x4edf7b=_0x1f1127;var _0x48e1d8={'type':db[_0x4149('0x4a')][_0x4149('0x4b')],'transaction':_0x561ca6};switch(_0xce0f96[_0x4149('0x45')][_0x4149('0x3a')]){case _0x4149('0x4c'):_0x48e1d8[_0x4149('0x3a')]=db[_0x4149('0x4a')][_0x4149('0x4b')];break;case'number':_0x48e1d8['type']=db[_0x4149('0x4a')]['INTEGER'];break;case _0x4149('0x4d'):_0x48e1d8[_0x4149('0x3a')]=db['Sequelize'][_0x4149('0x4e')];_0x48e1d8[_0x4149('0x4f')]=![];break;default:}return db[_0x4149('0x48')]['queryInterface'][_0x4149('0x50')](_0x4149('0x51'),util[_0x4149('0x52')](_0x4149('0x53'),_0x4edf7b['id']),_0x48e1d8);})[_0x4149('0x40')](function(){return _0x4edf7b;});})[_0x4149('0x40')](respondWithResult(_0x3934e1,0xc9))[_0x4149('0x44')](handleError(_0x3934e1,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2df09fd..28b992e 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 _0xdc6c=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields'];(function(_0x112109,_0x4136e4){var _0x85327f=function(_0x18f214){while(--_0x18f214){_0x112109['push'](_0x112109['shift']());}};_0x85327f(++_0x4136e4);}(_0xdc6c,0x84));var _0xcdc6=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xdc6c[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xcdc6('0x0'));var util=require(_0xcdc6('0x1'));var logger=require('../../config/logger')(_0xcdc6('0x2'));var moment=require(_0xcdc6('0x3'));var BPromise=require(_0xcdc6('0x4'));var rp=require(_0xcdc6('0x5'));var fs=require('fs');var path=require(_0xcdc6('0x6'));var rimraf=require('rimraf');var config=require(_0xcdc6('0x7'));var attributes=require(_0xcdc6('0x8'));module['exports']=function(_0x521193,_0x593a0){return _0x521193['define'](_0xcdc6('0x9'),attributes,{'tableName':_0xcdc6('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3140=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x3140,0x14d));var _0x0314=function(_0x5c908c,_0x4bcfab){_0x5c908c=_0x5c908c-0x0;var _0x39325f=_0x3140[_0x5c908c];return _0x39325f;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var logger=require(_0x0314('0x2'))(_0x0314('0x3'));var moment=require(_0x0314('0x4'));var BPromise=require(_0x0314('0x5'));var rp=require(_0x0314('0x6'));var fs=require('fs');var path=require(_0x0314('0x7'));var rimraf=require(_0x0314('0x8'));var config=require(_0x0314('0x9'));var attributes=require('./cmCustomField.attributes');module[_0x0314('0xa')]=function(_0x101c79,_0x291f44){return _0x101c79[_0x0314('0xb')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index ebb8140..a2ad979 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 _0xa32a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x25f35c,_0x396bac){var _0x3aee83=function(_0x416285){while(--_0x416285){_0x25f35c['push'](_0x25f35c['shift']());}};_0x3aee83(++_0x396bac);}(_0xa32a,0xc9));var _0xaa32=function(_0x20afc3,_0x2f189a){_0x20afc3=_0x20afc3-0x0;var _0x4cbb43=_0xa32a[_0x20afc3];return _0x4cbb43;};'use strict';var _=require(_0xaa32('0x0'));var util=require(_0xaa32('0x1'));var moment=require('moment');var BPromise=require(_0xaa32('0x2'));var rs=require(_0xaa32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa32('0x4'))['db'];var utils=require(_0xaa32('0x5'));var logger=require(_0xaa32('0x6'))(_0xaa32('0x7'));var config=require(_0xaa32('0x8'));var jayson=require(_0xaa32('0x9'));var client=jayson[_0xaa32('0xa')][_0xaa32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a929d,_0xf17f66,_0x2e500e){return new BPromise(function(_0x50f3d4,_0x376153){return client['request'](_0x3a929d,_0x2e500e)[_0xaa32('0xc')](function(_0xda7137){logger['info']('CmCustomField,\x20%s,\x20%s',_0xf17f66,_0xaa32('0xd'));logger[_0xaa32('0xe')](_0xaa32('0xf'),_0xf17f66,_0xaa32('0xd'),JSON[_0xaa32('0x10')](_0xda7137));if(_0xda7137[_0xaa32('0x11')]){if(_0xda7137[_0xaa32('0x11')][_0xaa32('0x12')]===0x1f4){logger[_0xaa32('0x11')](_0xaa32('0x13'),_0xf17f66,_0xda7137[_0xaa32('0x11')][_0xaa32('0x14')]);return _0x376153(_0xda7137[_0xaa32('0x11')][_0xaa32('0x14')]);}logger[_0xaa32('0x11')](_0xaa32('0x13'),_0xf17f66,_0xda7137['error']['message']);return _0x50f3d4(_0xda7137['error'][_0xaa32('0x14')]);}else{logger[_0xaa32('0x15')]('CmCustomField,\x20%s,\x20%s',_0xf17f66,_0xaa32('0xd'));_0x50f3d4(_0xda7137['result'][_0xaa32('0x14')]);}})[_0xaa32('0x16')](function(_0x1a43a3){logger[_0xaa32('0x11')](_0xaa32('0x13'),_0xf17f66,_0x1a43a3);_0x376153(_0x1a43a3);});});} \ No newline at end of file +var _0x9a89=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321e39,_0x2f99c8){var _0x2e5be2=function(_0x14fa6a){while(--_0x14fa6a){_0x321e39['push'](_0x321e39['shift']());}};_0x2e5be2(++_0x2f99c8);}(_0x9a89,0x12f));var _0x99a8=function(_0x509ea2,_0x1c4e73){_0x509ea2=_0x509ea2-0x0;var _0x58e65f=_0x9a89[_0x509ea2];return _0x58e65f;};'use strict';var _=require('lodash');var util=require(_0x99a8('0x0'));var moment=require('moment');var BPromise=require(_0x99a8('0x1'));var rs=require(_0x99a8('0x2'));var fs=require('fs');var Redis=require(_0x99a8('0x3'));var db=require(_0x99a8('0x4'))['db'];var utils=require(_0x99a8('0x5'));var logger=require(_0x99a8('0x6'))('rpc');var config=require(_0x99a8('0x7'));var jayson=require(_0x99a8('0x8'));var client=jayson[_0x99a8('0x9')][_0x99a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x149609,_0x33dbec,_0x9bbf0a){return new BPromise(function(_0x43438e,_0x4ec114){return client[_0x99a8('0xb')](_0x149609,_0x9bbf0a)[_0x99a8('0xc')](function(_0x2a6288){logger[_0x99a8('0xd')]('CmCustomField,\x20%s,\x20%s',_0x33dbec,_0x99a8('0xe'));logger[_0x99a8('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x33dbec,_0x99a8('0xe'),JSON['stringify'](_0x2a6288));if(_0x2a6288['error']){if(_0x2a6288[_0x99a8('0x10')][_0x99a8('0x11')]===0x1f4){logger[_0x99a8('0x10')](_0x99a8('0x12'),_0x33dbec,_0x2a6288[_0x99a8('0x10')][_0x99a8('0x13')]);return _0x4ec114(_0x2a6288[_0x99a8('0x10')][_0x99a8('0x13')]);}logger[_0x99a8('0x10')](_0x99a8('0x12'),_0x33dbec,_0x2a6288[_0x99a8('0x10')][_0x99a8('0x13')]);return _0x43438e(_0x2a6288[_0x99a8('0x10')][_0x99a8('0x13')]);}else{logger[_0x99a8('0xd')](_0x99a8('0x12'),_0x33dbec,_0x99a8('0xe'));_0x43438e(_0x2a6288[_0x99a8('0x14')][_0x99a8('0x13')]);}})[_0x99a8('0x15')](function(_0x41eef5){logger[_0x99a8('0x10')](_0x99a8('0x12'),_0x33dbec,_0x41eef5);_0x4ec114(_0x41eef5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index bed3af8..107a508 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 _0x8cc2=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x5a81e1,_0x409c7e){var _0x579c74=function(_0x1f1579){while(--_0x1f1579){_0x5a81e1['push'](_0x5a81e1['shift']());}};_0x579c74(++_0x409c7e);}(_0x8cc2,0x1cb));var _0x28cc=function(_0x166ddd,_0x1345d1){_0x166ddd=_0x166ddd-0x0;var _0x3cff8e=_0x8cc2[_0x166ddd];return _0x3cff8e;};'use strict';var multer=require('multer');var util=require(_0x28cc('0x0'));var path=require('path');var timeout=require(_0x28cc('0x1'));var express=require(_0x28cc('0x2'));var router=express[_0x28cc('0x3')]();var fs_extra=require(_0x28cc('0x4'));var auth=require(_0x28cc('0x5'));var interaction=require(_0x28cc('0x6'));var config=require(_0x28cc('0x7'));var controller=require(_0x28cc('0x8'));router[_0x28cc('0x9')]('/',auth[_0x28cc('0xa')](),controller[_0x28cc('0xb')]);router['get'](_0x28cc('0xc'),auth[_0x28cc('0xa')](),controller[_0x28cc('0xd')]);router['post']('/',auth[_0x28cc('0xa')](),controller['create']);router[_0x28cc('0xe')]('/:id',auth[_0x28cc('0xa')](),controller[_0x28cc('0xf')]);router[_0x28cc('0x10')](_0x28cc('0xc'),auth[_0x28cc('0xa')](),controller[_0x28cc('0x11')]);module[_0x28cc('0x12')]=router; \ No newline at end of file +var _0x5a63=['put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','show','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a63,0xe3));var _0x35a6=function(_0x53d992,_0x593e80){_0x53d992=_0x53d992-0x0;var _0x2480dd=_0x5a63[_0x53d992];return _0x2480dd;};'use strict';var multer=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router[_0x35a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x35a6('0x8')]);router['get'](_0x35a6('0x9'),auth['isAuthenticated'](),controller[_0x35a6('0xa')]);router['post']('/',auth[_0x35a6('0xb')](),controller[_0x35a6('0xc')]);router[_0x35a6('0xd')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['update']);router[_0x35a6('0xe')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['destroy']);module[_0x35a6('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8a8d8fc..e7a6e7e 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 _0x41b9=['contactListQueue','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0xa5e676,_0x5e0722){var _0x5153e1=function(_0x3b0280){while(--_0x3b0280){_0xa5e676['push'](_0xa5e676['shift']());}};_0x5153e1(++_0x5e0722);}(_0x41b9,0x111));var _0x941b=function(_0x253593,_0x4ae4e9){_0x253593=_0x253593-0x0;var _0x2dbe28=_0x41b9[_0x253593];return _0x2dbe28;};'use strict';var moment=require('moment');var Sequelize=require(_0x941b('0x0'));module[_0x941b('0x1')]={'phone':{'type':Sequelize[_0x941b('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x941b('0x3')],'defaultValue':moment()['format'](_0x941b('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x941b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x941b('0x5')](0x2)[_0x941b('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x941b('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x941b('0x5')],'unique':_0x941b('0x7')},'UserId':{'type':Sequelize[_0x941b('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x941b('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x941b('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe380=['moment','sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x2b2637,_0x420881){var _0x347bc8=function(_0x532931){while(--_0x532931){_0x2b2637['push'](_0x2b2637['shift']());}};_0x347bc8(++_0x420881);}(_0xe380,0x136));var _0x0e38=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xe380[_0x5f1391];return _0x50ebe3;};'use strict';var moment=require(_0x0e38('0x0'));var Sequelize=require(_0x0e38('0x1'));module[_0x0e38('0x2')]={'phone':{'type':Sequelize[_0x0e38('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x0e38('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0e38('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0e38('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0e38('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0e38('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0e38('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0e38('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0e38('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0e38('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0e38('0x6')],'unique':_0x0e38('0x9')},'ListId':{'type':Sequelize[_0x0e38('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x0e38('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x0e38('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x0e38('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0e38('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0e38('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x0e38('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0e38('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x0e38('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index b9a803b..fe99b6b 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 _0x1dcc=['destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','direction','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','List','VoiceQueue','findOne','Company','CmList','Queue','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','offset','undefined','count','limit','status','set','Content-Range','then','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x4d0d17,_0x5ae705){_0x4d0d17=_0x4d0d17-0x0;var _0x4b6c2e=_0x1dcc[_0x4d0d17];return _0x4b6c2e;};'use strict';var moment=require(_0xc1dc('0x0'));var _=require(_0xc1dc('0x1'));var qs=require(_0xc1dc('0x2'));var logger=require(_0xc1dc('0x3'))('api');var shared=require(_0xc1dc('0x4'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x20abc9,_0x3eb139){_0x3eb139=_0x3eb139||0xc8;return function(_0x2a8ff9){if(_0x2a8ff9){return _0x20abc9['status'](_0x3eb139)['json'](_0x2a8ff9);}};}function respondWithFilteredResult(_0x1e57ba,_0x381ab6){return function(_0x41b667){if(_0x41b667){var _0x4dab41=typeof _0x381ab6[_0xc1dc('0x5')]===_0xc1dc('0x6')&&typeof _0x381ab6['limit']===_0xc1dc('0x6');var _0x51c02b=_0x41b667[_0xc1dc('0x7')];var _0x49ef48=_0x4dab41?0x0:_0x381ab6[_0xc1dc('0x5')];var _0x16520d=_0x4dab41?_0x41b667[_0xc1dc('0x7')]:_0x381ab6[_0xc1dc('0x5')]+_0x381ab6[_0xc1dc('0x8')];var _0x616175;if(_0x16520d>=_0x51c02b){_0x16520d=_0x51c02b;_0x616175=0xc8;}else{_0x616175=0xce;}_0x1e57ba[_0xc1dc('0x9')](_0x616175);return _0x1e57ba[_0xc1dc('0xa')](_0xc1dc('0xb'),_0x49ef48+'-'+_0x16520d+'/'+_0x51c02b)['json'](_0x41b667);}return null;};}function saveUpdates(_0x226ba3,_0x2c5f41){return function(_0xb7e667){if(_0xb7e667){return _0xb7e667['update'](_0x226ba3)[_0xc1dc('0xc')](function(_0x7d7257){return _0x7d7257;});}return null;};}function handleEntityNotFound(_0x299520,_0xd51b1e){return function(_0x145708){if(!_0x145708){_0x299520[_0xc1dc('0xd')](0x194);}return _0x145708;};}function handleError(_0x188182,_0x21aed1){_0x21aed1=_0x21aed1||0x1f4;return function(_0x265929){logger[_0xc1dc('0xe')](_0x265929[_0xc1dc('0xf')]);if(_0x265929['name']){delete _0x265929[_0xc1dc('0x10')];}_0x188182[_0xc1dc('0x9')](_0x21aed1)[_0xc1dc('0x11')](_0x265929);};}exports[_0xc1dc('0x12')]=function(_0x47c72e,_0x332400){var _0xc01137={},_0x499a42={},_0x484f6c={'count':0x0,'rows':[]};var _0x3f96d3=_[_0xc1dc('0x13')](db[_0xc1dc('0x14')][_0xc1dc('0x15')],function(_0x1707dc){return{'name':_0x1707dc[_0xc1dc('0x16')],'type':_0x1707dc[_0xc1dc('0x17')][_0xc1dc('0x18')]};});_0x499a42['model']=_['map'](_0x3f96d3,'name');_0x499a42[_0xc1dc('0x19')]=_[_0xc1dc('0x1a')](_0x47c72e['query']);_0x499a42[_0xc1dc('0x1b')]=_[_0xc1dc('0x1c')](_0x499a42[_0xc1dc('0x1d')],_0x499a42[_0xc1dc('0x19')]);_0x499a42[_0xc1dc('0x1b')]=_[_0xc1dc('0x1e')](_0x499a42[_0xc1dc('0x1b')],[_0xc1dc('0x1f'),_0xc1dc('0x20'),_0xc1dc('0x21'),'$gte',_0xc1dc('0x22'),_0xc1dc('0x23'),_0xc1dc('0x24'),_0xc1dc('0x25'),'$not',_0xc1dc('0x26'),_0xc1dc('0x27'),_0xc1dc('0x28'),_0xc1dc('0x29'),_0xc1dc('0x2a'),_0xc1dc('0x2b'),_0xc1dc('0x2c'),_0xc1dc('0x2d'),_0xc1dc('0x2a'),'$overlap',_0xc1dc('0x2e'),_0xc1dc('0x2f'),_0xc1dc('0x30')]);_0xc01137[_0xc1dc('0x31')]=_[_0xc1dc('0x1c')](_0x499a42[_0xc1dc('0x1d')],qs[_0xc1dc('0x32')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x32')]));_0xc01137[_0xc1dc('0x31')]=_0xc01137[_0xc1dc('0x31')]['length']?_0xc01137[_0xc1dc('0x31')]:_0x499a42[_0xc1dc('0x1d')];if(!_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x33')](_0xc1dc('0x34'))){_0xc01137[_0xc1dc('0x8')]=qs[_0xc1dc('0x8')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x8')]);_0xc01137['offset']=qs['offset'](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x5')]);}_0xc01137[_0xc1dc('0x35')]=qs[_0xc1dc('0x36')](_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x36')]);_0xc01137['where']=qs[_0xc1dc('0x1b')](_[_0xc1dc('0x37')](_0x47c72e['query'],_0x499a42[_0xc1dc('0x1b')]),_0x3f96d3);if(_0x47c72e[_0xc1dc('0x19')]['filter']){_0xc01137[_0xc1dc('0x38')]=_[_0xc1dc('0x39')](_0xc01137[_0xc1dc('0x38')],{'$or':_['map'](_0x3f96d3,function(_0x1ee0ba){if(_0x1ee0ba[_0xc1dc('0x17')]!==_0xc1dc('0x3a')){var _0x341bb3={};_0x341bb3[_0x1ee0ba[_0xc1dc('0x10')]]={'$like':'%'+_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x3b')]+'%'};return _0x341bb3;}})});}_0xc01137=_[_0xc1dc('0x39')]({},_0xc01137,_0x47c72e[_0xc1dc('0x3c')]);var _0x4e3051={'where':_0xc01137[_0xc1dc('0x38')]};return db[_0xc1dc('0x14')][_0xc1dc('0x7')](_0x4e3051)['then'](function(_0x19bde9){_0x484f6c[_0xc1dc('0x7')]=_0x19bde9;if(_0x47c72e[_0xc1dc('0x19')][_0xc1dc('0x3d')]){_0xc01137[_0xc1dc('0x3e')]=[{'all':!![]}];}return db[_0xc1dc('0x14')][_0xc1dc('0x3f')](_0xc01137);})[_0xc1dc('0xc')](function(_0x5967b2){_0x484f6c[_0xc1dc('0x40')]=_0x5967b2;return _0x484f6c;})[_0xc1dc('0xc')](respondWithFilteredResult(_0x332400,_0xc01137))[_0xc1dc('0x41')](handleError(_0x332400,null));};exports[_0xc1dc('0x42')]=function(_0x1d8107,_0x1fbdb8){var _0x503ec8={'raw':!![],'where':{'id':_0x1d8107[_0xc1dc('0x43')]['id']}},_0x12a92d={};_0x12a92d[_0xc1dc('0x1d')]=_[_0xc1dc('0x1a')](db[_0xc1dc('0x14')]['rawAttributes']);_0x12a92d['query']=_[_0xc1dc('0x1a')](_0x1d8107[_0xc1dc('0x19')]);_0x12a92d[_0xc1dc('0x1b')]=_[_0xc1dc('0x1c')](_0x12a92d[_0xc1dc('0x1d')],_0x12a92d[_0xc1dc('0x19')]);_0x503ec8[_0xc1dc('0x31')]=_['intersection'](_0x12a92d[_0xc1dc('0x1d')],qs[_0xc1dc('0x32')](_0x1d8107[_0xc1dc('0x19')]['fields']));_0x503ec8[_0xc1dc('0x31')]=_0x503ec8[_0xc1dc('0x31')][_0xc1dc('0x44')]?_0x503ec8[_0xc1dc('0x31')]:_0x12a92d['model'];if(_0x1d8107['query'][_0xc1dc('0x3d')]){_0x503ec8[_0xc1dc('0x3e')]=[{'all':!![]}];}_0x503ec8=_['merge']({},_0x503ec8,_0x1d8107[_0xc1dc('0x3c')]);return db[_0xc1dc('0x14')][_0xc1dc('0x45')](_0x503ec8)[_0xc1dc('0xc')](handleEntityNotFound(_0x1fbdb8,null))[_0xc1dc('0xc')](respondWithResult(_0x1fbdb8,null))[_0xc1dc('0x41')](handleError(_0x1fbdb8,null));};exports[_0xc1dc('0x46')]=function(_0x54bb1f,_0x5a74a0){return db[_0xc1dc('0x14')]['create'](_0x54bb1f[_0xc1dc('0x47')],{})[_0xc1dc('0xc')](respondWithResult(_0x5a74a0,0xc9))[_0xc1dc('0x41')](handleError(_0x5a74a0,null));};exports[_0xc1dc('0x48')]=function(_0x452303,_0x40eb12){if(_0x452303[_0xc1dc('0x47')]['id']){delete _0x452303[_0xc1dc('0x47')]['id'];}return db['CmHopper'][_0xc1dc('0x45')]({'where':{'id':_0x452303[_0xc1dc('0x43')]['id']}})[_0xc1dc('0xc')](handleEntityNotFound(_0x40eb12,null))[_0xc1dc('0xc')](saveUpdates(_0x452303[_0xc1dc('0x47')],null))[_0xc1dc('0xc')](respondWithResult(_0x40eb12,null))[_0xc1dc('0x41')](handleError(_0x40eb12,null));};exports[_0xc1dc('0x49')]=function(_0x2ca7f1,_0x29417d){return db['CmHopper']['describe']()['then'](respondWithResult(_0x29417d,null))[_0xc1dc('0x41')](handleError(_0x29417d,null));};exports[_0xc1dc('0x4a')]=function(_0x57b792,_0x129e23){var _0x6ab7fc;var _0x505272=_0x57b792[_0xc1dc('0x43')]['id'];return db['CmHopper'][_0xc1dc('0x45')]({'where':{'id':_0x57b792[_0xc1dc('0x43')]['id']}})[_0xc1dc('0xc')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0xc')](function(_0x331d24){if(_0x331d24){return _0x331d24[_0xc1dc('0x4a')]()[_0xc1dc('0xc')](function(_0x34667b){return _0x34667b;});}})['then'](function(_0x21b385){_0x6ab7fc=_0x21b385;if(_0x21b385){if(_0x21b385[_0xc1dc('0x4b')]||_0x21b385[_0xc1dc('0x4c')]){return db[_0x21b385[_0xc1dc('0x4b')]?'VoiceQueue':_0xc1dc('0x4d')][_0xc1dc('0x45')]({'where':{'id':_0x21b385[_0xc1dc('0x4b')]?_0x21b385[_0xc1dc('0x4b')]:_0x21b385[_0xc1dc('0x4c')]},'attributes':['id',_0xc1dc('0x10')],'raw':!![]});}}})[_0xc1dc('0xc')](function(_0x17d80f){var _0x512ec1={};if(_0x17d80f){_[_0xc1dc('0x39')](_0x512ec1,_[_0xc1dc('0x4e')](_0x6ab7fc[_0xc1dc('0x4f')],[_0xc1dc('0x50'),_0xc1dc('0x51'),'id']));_0x512ec1[_0xc1dc('0x52')]=0x15;_0x512ec1[_0xc1dc('0x53')]='deleted';_0x512ec1[_0xc1dc('0x54')]=_0x17d80f[_0xc1dc('0x10')];_0x512ec1[_0xc1dc('0x55')]=_0x57b792[_0xc1dc('0x56')][_0xc1dc('0x10')];_0x512ec1[_0xc1dc('0x57')]=_0x57b792[_0xc1dc('0x56')]['id'];_0x512ec1[_0xc1dc('0x58')]=!![];_0x512ec1[_0xc1dc('0x59')]=moment()['format'](_0xc1dc('0x5a'));_0x512ec1['calleridnum']=_0x6ab7fc[_0xc1dc('0x5b')];_0x512ec1[_0xc1dc('0x5c')]=_0x6ab7fc[_0xc1dc('0x4b')]?_0xc1dc('0x5d'):_0xc1dc('0x5e');return db[_0xc1dc('0x5f')][_0xc1dc('0x45')]({'where':{'id':_0x512ec1['ContactId']},'attributes':[_0xc1dc('0x60'),_0xc1dc('0x61')]})['then'](function(_0x5635a6){if(!_[_0xc1dc('0x62')](_0x129e23)&&!_[_0xc1dc('0x62')](_0x5635a6[_0xc1dc('0x60')])){_0x512ec1[_0xc1dc('0x63')]=_0x5635a6['firstName'];if(!_['isNil'](_0x5635a6[_0xc1dc('0x61')])){_0x512ec1[_0xc1dc('0x63')]+='\x20'+_0x5635a6[_0xc1dc('0x61')];}}})['finally'](function(){return db[_0xc1dc('0x64')][_0xc1dc('0x46')](_0x512ec1);});}})[_0xc1dc('0xc')](function(_0x4476eb){return db[_0xc1dc('0x65')]['destroy']({'where':{'CmHopperId':_0x505272}});})[_0xc1dc('0xc')](function(){return _0x129e23[_0xc1dc('0x9')](0xcc)[_0xc1dc('0x66')]();})[_0xc1dc('0x41')](handleError(_0x129e23,null));};exports[_0xc1dc('0x67')]=function(_0x2a1a44,_0x166d59){var _0x145b62=[];return db[_0xc1dc('0x5f')]['describe']()['then'](function(_0x3c1bf8){_0x145b62=_[_0xc1dc('0x1a')](_0x3c1bf8);return _0x2a1a44[_0xc1dc('0x56')][_0xc1dc('0x68')]({'where':{'type':_0xc1dc('0x69'),'dialActive':!![],'dialMethod':_0xc1dc('0x6a')},'attributes':['id',_0xc1dc('0x6b'),_0xc1dc('0x6c')],'raw':!![]});})[_0xc1dc('0xc')](function(_0x4de18d){if(_0x4de18d&&_0x4de18d[_0xc1dc('0x44')]){return db[_0xc1dc('0x6d')][_0xc1dc('0x6e')](function(_0x20a96b){var _0x45ff61={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc1dc('0x6f')](_0xc1dc('0x5a'))},'VoiceQueueId':{'$in':_[_0xc1dc('0x13')](_0x4de18d,'id')},'$or':[{'UserId':null},{'UserId':_0x2a1a44[_0xc1dc('0x56')]['id']}]};var _0x5c2942={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4de18d)[_0xc1dc('0x3b')]([_0xc1dc('0x6c'),0x0])[_0xc1dc('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2a1a44['user']['id']}]};var _0x32038f={'$or':[_0x45ff61,_0x5c2942]};var _0x5dd75b=[];if(_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x70')]&&_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x70')]==='prev'){if(!_['isEmpty'](_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')])){_0x32038f['id']={'$in':_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')]};}_0x5dd75b=[[_0xc1dc('0x72'),_0xc1dc('0x73')],[_0xc1dc('0x74'),_0x4de18d[0x0]['dialOrderByScheduledAt']===_0xc1dc('0x73')?'DESC':_0xc1dc('0x73')],db[_0xc1dc('0x6d')]['literal'](_0xc1dc('0x75')),['id',_0xc1dc('0x76')]];}else{if(!_['isEmpty'](_0x2a1a44[_0xc1dc('0x47')][_0xc1dc('0x71')])){_0x32038f['id']={'$notIn':_0x2a1a44['body'][_0xc1dc('0x71')]};}_0x5dd75b=[[_0xc1dc('0x72'),_0xc1dc('0x76')],[_0xc1dc('0x74'),_0x4de18d[0x0][_0xc1dc('0x6b')]],db[_0xc1dc('0x6d')][_0xc1dc('0x77')](_0xc1dc('0x78')),['id','ASC']];}return db[_0xc1dc('0x14')]['findOne']({'attributes':['id',_0xc1dc('0x79'),'phone',_0xc1dc('0x7a')],'where':_0x32038f,'order':_0x5dd75b,'transaction':_0x20a96b,'lock':_0x20a96b[_0xc1dc('0x7b')][_0xc1dc('0x7c')],'include':[{'model':db[_0xc1dc('0x5f')],'as':_0xc1dc('0x7d'),'attributes':_0x145b62,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xc1dc('0x10')]}]},{'model':db['CmList'],'as':_0xc1dc('0x7e'),'attributes':['id',_0xc1dc('0x10')]},{'model':db[_0xc1dc('0x7f')],'as':'Queue','attributes':['id',_0xc1dc('0x10'),'dialActive']}]})[_0xc1dc('0xc')](function(_0x320441){if(_0x320441){return _0x320441[_0xc1dc('0x48')]({'UserId':_0x2a1a44['user']['id']},{'transaction':_0x20a96b});}});});}})[_0xc1dc('0xc')](handleEntityNotFound(_0x166d59,null))[_0xc1dc('0xc')](respondWithResult(_0x166d59,null))[_0xc1dc('0x41')](handleError(_0x166d59,null));};exports['getPreviewRecall']=function(_0x51d4ce,_0x2c6f8b,_0x2ab121){var _0x5d07dc=[];var _0x3a3e3e=_0x51d4ce[_0xc1dc('0x43')]['id'];var _0x813307=_0x51d4ce[_0xc1dc('0x56')]['id'];return db['CmContact'][_0xc1dc('0x49')]()[_0xc1dc('0xc')](function(_0x12c155){_0x5d07dc=_[_0xc1dc('0x1a')](_0x12c155);return db[_0xc1dc('0x6d')][_0xc1dc('0x6e')](function(_0x33e810){const _0x42d1fb={'id':_0x3a3e3e};return db[_0xc1dc('0x14')][_0xc1dc('0x80')]({'attributes':['id',_0xc1dc('0x79'),_0xc1dc('0x7a')],'where':_0x42d1fb,'transaction':_0x33e810,'lock':_0x33e810['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x5d07dc,'include':[{'model':db['CmCompany'],'as':_0xc1dc('0x81'),'attributes':['id','name']}]},{'model':db[_0xc1dc('0x82')],'as':_0xc1dc('0x7e'),'attributes':['id',_0xc1dc('0x10')]},{'model':db[_0xc1dc('0x7f')],'as':_0xc1dc('0x83'),'attributes':['id','name','dialActive']}]})[_0xc1dc('0xc')](function(_0x264989){if(_0x264989){return _0x264989['update']({'UserId':_0x813307},{'transaction':_0x33e810});}});});})[_0xc1dc('0xc')](handleEntityNotFound(_0x2c6f8b,null))['then'](respondWithResult(_0x2c6f8b,null))['catch'](handleError(_0x2c6f8b,null));};exports['getOpenContacts']=function(_0x4e3bf2,_0x43634f){return _0x4e3bf2['user'][_0xc1dc('0x68')]({'where':{'type':_0xc1dc('0x69'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xc1dc('0xc')](function(_0x31f9bc){if(_0x31f9bc&&_0x31f9bc[_0xc1dc('0x44')]){return db[_0xc1dc('0x14')][_0xc1dc('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xc1dc('0x5a'))},'VoiceQueueId':{'$in':_['map'](_0x31f9bc,'id')},'$or':[{'UserId':null},{'UserId':_0x4e3bf2['user']['id']}]}});}return 0x0;})['then'](function(_0x2c22a7){if(!_[_0xc1dc('0x62')](_0x2c22a7)&&_[_0xc1dc('0x84')](_0x2c22a7)){return _0x43634f[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')]({'contacts':_0x2c22a7});}else{logger[_0xc1dc('0xe')](_0xc1dc('0x86'),'getOpenContacts',0x194,_0xc1dc('0x87'));_0x43634f[_0xc1dc('0xd')](0x194);}})[_0xc1dc('0x41')](handleError(_0x43634f,null));};exports[_0xc1dc('0x88')]=function(_0x413c40,_0x247cc1){var _0x4bca30=shared[_0xc1dc('0x89')];var _0x1d9dfb=[];_['map'](_0x4bca30,function(_0x5d3625){_0x1d9dfb[_0xc1dc('0x8a')]({'id':_0x5d3625[_0xc1dc('0x10')],'name':_0x5d3625[_0xc1dc('0x10')],'utcOffset':_0x5d3625[_0xc1dc('0x8b')]});});return _0x247cc1[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')]({'tz':_0x1d9dfb});};exports[_0xc1dc('0x8c')]=function(_0x48d6a7,_0x551195){var _0x3750d4=shared['timezones'];var _0x24efce={};if(!_[_0xc1dc('0x62')](_0x3750d4[_0x48d6a7[_0xc1dc('0x47')]['id']]))_0x24efce=_0x3750d4[_0x48d6a7['body']['id']];return _0x551195[_0xc1dc('0x9')](0xc8)[_0xc1dc('0x85')](_0x24efce);}; \ No newline at end of file +var _0x61a5=['$gte','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contained','$any','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','show','params','fields','include','options','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','hopperIds','ASC','DESC','isEmpty','priority','scheduledAt','literal','findOne','recallme','UPDATE','Contact','Company','List','Queue','getPreviewRecall','transaction','scheduledat','LOCK','CmCompany','CmList','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','limit','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','CmHopper','fieldName','type','model','map','query','keys','intersection','filters','$and','$or','$gt'];(function(_0x491d25,_0x29e3aa){var _0x1fc9db=function(_0x55ed69){while(--_0x55ed69){_0x491d25['push'](_0x491d25['shift']());}};_0x1fc9db(++_0x29e3aa);}(_0x61a5,0xf0));var _0x561a=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x61a5[_0x4f4c2a];return _0xd15be6;};'use strict';var moment=require(_0x561a('0x0'));var _=require('lodash');var qs=require(_0x561a('0x1'));var logger=require(_0x561a('0x2'))(_0x561a('0x3'));var shared=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];function respondWithResult(_0x58f636,_0xe92b4d){_0xe92b4d=_0xe92b4d||0xc8;return function(_0x33c0f5){if(_0x33c0f5){return _0x58f636['status'](_0xe92b4d)[_0x561a('0x6')](_0x33c0f5);}};}function respondWithFilteredResult(_0x31f762,_0x24c89a){return function(_0x2646bd){if(_0x2646bd){var _0x3d55f8=typeof _0x24c89a[_0x561a('0x7')]===_0x561a('0x8')&&typeof _0x24c89a['limit']===_0x561a('0x8');var _0x52563e=_0x2646bd[_0x561a('0x9')];var _0x5288b4=_0x3d55f8?0x0:_0x24c89a['offset'];var _0x34e464=_0x3d55f8?_0x2646bd[_0x561a('0x9')]:_0x24c89a['offset']+_0x24c89a[_0x561a('0xa')];var _0x5cc8ed;if(_0x34e464>=_0x52563e){_0x34e464=_0x52563e;_0x5cc8ed=0xc8;}else{_0x5cc8ed=0xce;}_0x31f762[_0x561a('0xb')](_0x5cc8ed);return _0x31f762[_0x561a('0xc')](_0x561a('0xd'),_0x5288b4+'-'+_0x34e464+'/'+_0x52563e)[_0x561a('0x6')](_0x2646bd);}return null;};}function saveUpdates(_0x2777c6,_0x3dfa9f){return function(_0x136465){if(_0x136465){return _0x136465[_0x561a('0xe')](_0x2777c6)[_0x561a('0xf')](function(_0x4f1e33){return _0x4f1e33;});}return null;};}function handleEntityNotFound(_0x2a332e,_0x28638b){return function(_0x5696b9){if(!_0x5696b9){_0x2a332e[_0x561a('0x10')](0x194);}return _0x5696b9;};}function handleError(_0x64498a,_0x1ab5ae){_0x1ab5ae=_0x1ab5ae||0x1f4;return function(_0xecbcc4){logger[_0x561a('0x11')](_0xecbcc4[_0x561a('0x12')]);if(_0xecbcc4[_0x561a('0x13')]){delete _0xecbcc4[_0x561a('0x13')];}_0x64498a[_0x561a('0xb')](_0x1ab5ae)[_0x561a('0x14')](_0xecbcc4);};}exports[_0x561a('0x15')]=function(_0x48df6a,_0x43c5aa){var _0x190057={},_0x533d95={},_0x11033f={'count':0x0,'rows':[]};var _0x785831=_['map'](db[_0x561a('0x16')]['rawAttributes'],function(_0x4d66b8){return{'name':_0x4d66b8[_0x561a('0x17')],'type':_0x4d66b8[_0x561a('0x18')]['key']};});_0x533d95[_0x561a('0x19')]=_[_0x561a('0x1a')](_0x785831,_0x561a('0x13'));_0x533d95[_0x561a('0x1b')]=_[_0x561a('0x1c')](_0x48df6a[_0x561a('0x1b')]);_0x533d95['filters']=_[_0x561a('0x1d')](_0x533d95[_0x561a('0x19')],_0x533d95[_0x561a('0x1b')]);_0x533d95['filters']=_['concat'](_0x533d95[_0x561a('0x1e')],[_0x561a('0x1f'),_0x561a('0x20'),_0x561a('0x21'),_0x561a('0x22'),_0x561a('0x23'),_0x561a('0x24'),_0x561a('0x25'),'$eq','$not',_0x561a('0x26'),_0x561a('0x27'),_0x561a('0x28'),_0x561a('0x29'),'$like',_0x561a('0x2a'),_0x561a('0x2b'),_0x561a('0x2c'),_0x561a('0x2d'),_0x561a('0x2e'),'$contains',_0x561a('0x2f'),_0x561a('0x30')]);_0x190057['attributes']=_[_0x561a('0x1d')](_0x533d95[_0x561a('0x19')],qs['fields'](_0x48df6a[_0x561a('0x1b')]['fields']));_0x190057['attributes']=_0x190057[_0x561a('0x31')][_0x561a('0x32')]?_0x190057['attributes']:_0x533d95[_0x561a('0x19')];if(!_0x48df6a[_0x561a('0x1b')][_0x561a('0x33')](_0x561a('0x34'))){_0x190057[_0x561a('0xa')]=qs[_0x561a('0xa')](_0x48df6a[_0x561a('0x1b')][_0x561a('0xa')]);_0x190057['offset']=qs[_0x561a('0x7')](_0x48df6a[_0x561a('0x1b')][_0x561a('0x7')]);}_0x190057[_0x561a('0x35')]=qs[_0x561a('0x36')](_0x48df6a['query'][_0x561a('0x36')]);_0x190057[_0x561a('0x37')]=qs[_0x561a('0x1e')](_[_0x561a('0x38')](_0x48df6a['query'],_0x533d95[_0x561a('0x1e')]),_0x785831);if(_0x48df6a[_0x561a('0x1b')][_0x561a('0x39')]){_0x190057['where']=_['merge'](_0x190057[_0x561a('0x37')],{'$or':_['map'](_0x785831,function(_0x5a45a4){if(_0x5a45a4['type']!==_0x561a('0x3a')){var _0x2a2479={};_0x2a2479[_0x5a45a4[_0x561a('0x13')]]={'$like':'%'+_0x48df6a[_0x561a('0x1b')][_0x561a('0x39')]+'%'};return _0x2a2479;}})});}_0x190057=_[_0x561a('0x3b')]({},_0x190057,_0x48df6a['options']);var _0x588a39={'where':_0x190057[_0x561a('0x37')]};return db[_0x561a('0x16')][_0x561a('0x9')](_0x588a39)[_0x561a('0xf')](function(_0x4d81f7){_0x11033f[_0x561a('0x9')]=_0x4d81f7;if(_0x48df6a[_0x561a('0x1b')][_0x561a('0x3c')]){_0x190057['include']=[{'all':!![]}];}return db[_0x561a('0x16')][_0x561a('0x3d')](_0x190057);})[_0x561a('0xf')](function(_0x330c8d){_0x11033f['rows']=_0x330c8d;return _0x11033f;})[_0x561a('0xf')](respondWithFilteredResult(_0x43c5aa,_0x190057))[_0x561a('0x3e')](handleError(_0x43c5aa,null));};exports[_0x561a('0x3f')]=function(_0x5c59dc,_0x3ebf2b){var _0x3ae2db={'raw':!![],'where':{'id':_0x5c59dc[_0x561a('0x40')]['id']}},_0x289c68={};_0x289c68[_0x561a('0x19')]=_[_0x561a('0x1c')](db[_0x561a('0x16')]['rawAttributes']);_0x289c68[_0x561a('0x1b')]=_[_0x561a('0x1c')](_0x5c59dc[_0x561a('0x1b')]);_0x289c68[_0x561a('0x1e')]=_[_0x561a('0x1d')](_0x289c68[_0x561a('0x19')],_0x289c68['query']);_0x3ae2db[_0x561a('0x31')]=_[_0x561a('0x1d')](_0x289c68[_0x561a('0x19')],qs[_0x561a('0x41')](_0x5c59dc[_0x561a('0x1b')][_0x561a('0x41')]));_0x3ae2db[_0x561a('0x31')]=_0x3ae2db[_0x561a('0x31')][_0x561a('0x32')]?_0x3ae2db['attributes']:_0x289c68[_0x561a('0x19')];if(_0x5c59dc[_0x561a('0x1b')]['includeAll']){_0x3ae2db[_0x561a('0x42')]=[{'all':!![]}];}_0x3ae2db=_['merge']({},_0x3ae2db,_0x5c59dc[_0x561a('0x43')]);return db[_0x561a('0x16')][_0x561a('0x44')](_0x3ae2db)[_0x561a('0xf')](handleEntityNotFound(_0x3ebf2b,null))[_0x561a('0xf')](respondWithResult(_0x3ebf2b,null))['catch'](handleError(_0x3ebf2b,null));};exports[_0x561a('0x45')]=function(_0x12e7c6,_0x30b94d){return db[_0x561a('0x16')][_0x561a('0x45')](_0x12e7c6[_0x561a('0x46')],{})['then'](respondWithResult(_0x30b94d,0xc9))['catch'](handleError(_0x30b94d,null));};exports[_0x561a('0xe')]=function(_0x5d6f3d,_0x4c4127){if(_0x5d6f3d['body']['id']){delete _0x5d6f3d['body']['id'];}return db['CmHopper'][_0x561a('0x44')]({'where':{'id':_0x5d6f3d[_0x561a('0x40')]['id']}})[_0x561a('0xf')](handleEntityNotFound(_0x4c4127,null))['then'](saveUpdates(_0x5d6f3d[_0x561a('0x46')],null))['then'](respondWithResult(_0x4c4127,null))['catch'](handleError(_0x4c4127,null));};exports[_0x561a('0x47')]=function(_0x13a2ad,_0x19d247){return db['CmHopper'][_0x561a('0x47')]()['then'](respondWithResult(_0x19d247,null))[_0x561a('0x3e')](handleError(_0x19d247,null));};exports['destroy']=function(_0x1bd3df,_0x43d557){var _0x68dc4a;var _0x14d82b=_0x1bd3df[_0x561a('0x40')]['id'];return db[_0x561a('0x16')][_0x561a('0x44')]({'where':{'id':_0x1bd3df[_0x561a('0x40')]['id']}})[_0x561a('0xf')](handleEntityNotFound(_0x43d557,null))['then'](function(_0x1cb7e4){if(_0x1cb7e4){return _0x1cb7e4[_0x561a('0x48')]()[_0x561a('0xf')](function(_0x48ed34){return _0x48ed34;});}})[_0x561a('0xf')](function(_0x4583b1){_0x68dc4a=_0x4583b1;if(_0x4583b1){if(_0x4583b1['VoiceQueueId']||_0x4583b1[_0x561a('0x49')]){return db[_0x4583b1[_0x561a('0x4a')]?_0x561a('0x4b'):'Campaign'][_0x561a('0x44')]({'where':{'id':_0x4583b1[_0x561a('0x4a')]?_0x4583b1[_0x561a('0x4a')]:_0x4583b1[_0x561a('0x49')]},'attributes':['id',_0x561a('0x13')],'raw':!![]});}}})[_0x561a('0xf')](function(_0x3d9b63){var _0x4ebb99={};if(_0x3d9b63){_[_0x561a('0x3b')](_0x4ebb99,_[_0x561a('0x4c')](_0x68dc4a[_0x561a('0x4d')],[_0x561a('0x4e'),_0x561a('0x4f'),'id']));_0x4ebb99[_0x561a('0x50')]=0x15;_0x4ebb99[_0x561a('0x51')]='deleted';_0x4ebb99[_0x561a('0x52')]=_0x3d9b63[_0x561a('0x13')];_0x4ebb99[_0x561a('0x53')]=_0x1bd3df['user'][_0x561a('0x13')];_0x4ebb99['UserId']=_0x1bd3df[_0x561a('0x54')]['id'];_0x4ebb99[_0x561a('0x55')]=!![];_0x4ebb99[_0x561a('0x56')]=moment()[_0x561a('0x57')](_0x561a('0x58'));_0x4ebb99[_0x561a('0x59')]=_0x68dc4a[_0x561a('0x5a')];_0x4ebb99['campaigntype']=_0x68dc4a['VoiceQueueId']?_0x561a('0x5b'):_0x561a('0x5c');return db[_0x561a('0x5d')][_0x561a('0x44')]({'where':{'id':_0x4ebb99[_0x561a('0x5e')]},'attributes':[_0x561a('0x5f'),'lastName']})[_0x561a('0xf')](function(_0x1b0ecf){if(!_['isNil'](_0x43d557)&&!_[_0x561a('0x60')](_0x1b0ecf['firstName'])){_0x4ebb99[_0x561a('0x61')]=_0x1b0ecf[_0x561a('0x5f')];if(!_[_0x561a('0x60')](_0x1b0ecf[_0x561a('0x62')])){_0x4ebb99[_0x561a('0x61')]+='\x20'+_0x1b0ecf['lastName'];}}})[_0x561a('0x63')](function(){return db['CmHopperFinal'][_0x561a('0x45')](_0x4ebb99);});}})[_0x561a('0xf')](function(_0x457d0e){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x14d82b}});})['then'](function(){return _0x43d557['status'](0xcc)[_0x561a('0x64')]();})[_0x561a('0x3e')](handleError(_0x43d557,null));};exports['getPreview']=function(_0xb0f744,_0xe76184){var _0x209f07=[];return db['CmContact'][_0x561a('0x47')]()[_0x561a('0xf')](function(_0x4341a4){_0x209f07=_[_0x561a('0x1c')](_0x4341a4);return _0xb0f744[_0x561a('0x54')][_0x561a('0x65')]({'where':{'type':_0x561a('0x66'),'dialActive':!![],'dialMethod':_0x561a('0x67')},'attributes':['id',_0x561a('0x68'),_0x561a('0x69')],'raw':!![]});})[_0x561a('0xf')](function(_0x5ac279){if(_0x5ac279&&_0x5ac279[_0x561a('0x32')]){return db[_0x561a('0x6a')]['transaction'](function(_0x54056b){var _0x33509a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x561a('0x57')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x561a('0x1a')](_0x5ac279,'id')},'$or':[{'UserId':null},{'UserId':_0xb0f744[_0x561a('0x54')]['id']}]};var _0x174483={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5ac279)[_0x561a('0x39')]([_0x561a('0x69'),0x0])[_0x561a('0x1a')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0xb0f744['user']['id']}]};var _0x518826={'$or':[_0x33509a,_0x174483]};var _0x21234d=[];if(_0xb0f744[_0x561a('0x46')][_0x561a('0x6b')]&&_0xb0f744[_0x561a('0x46')][_0x561a('0x6b')]==='prev'){if(!_['isEmpty'](_0xb0f744['body'][_0x561a('0x6c')])){_0x518826['id']={'$in':_0xb0f744[_0x561a('0x46')][_0x561a('0x6c')]};}_0x21234d=[['priority','ASC'],['scheduledAt',_0x5ac279[0x0]['dialOrderByScheduledAt']===_0x561a('0x6d')?_0x561a('0x6e'):'ASC'],db[_0x561a('0x6a')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x561a('0x6e')]];}else{if(!_[_0x561a('0x6f')](_0xb0f744['body'][_0x561a('0x6c')])){_0x518826['id']={'$notIn':_0xb0f744['body'][_0x561a('0x6c')]};}_0x21234d=[[_0x561a('0x70'),_0x561a('0x6e')],[_0x561a('0x71'),_0x5ac279[0x0][_0x561a('0x68')]],db[_0x561a('0x6a')][_0x561a('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x561a('0x16')][_0x561a('0x73')]({'attributes':['id','scheduledat',_0x561a('0x5a'),_0x561a('0x74')],'where':_0x518826,'order':_0x21234d,'transaction':_0x54056b,'lock':_0x54056b['LOCK'][_0x561a('0x75')],'include':[{'model':db[_0x561a('0x5d')],'as':_0x561a('0x76'),'attributes':_0x209f07,'include':[{'model':db['CmCompany'],'as':_0x561a('0x77'),'attributes':['id',_0x561a('0x13')]}]},{'model':db['CmList'],'as':_0x561a('0x78'),'attributes':['id','name']},{'model':db[_0x561a('0x4b')],'as':_0x561a('0x79'),'attributes':['id',_0x561a('0x13'),'dialActive']}]})[_0x561a('0xf')](function(_0x4e155f){if(_0x4e155f){return _0x4e155f[_0x561a('0xe')]({'UserId':_0xb0f744['user']['id']},{'transaction':_0x54056b});}});});}})[_0x561a('0xf')](handleEntityNotFound(_0xe76184,null))[_0x561a('0xf')](respondWithResult(_0xe76184,null))[_0x561a('0x3e')](handleError(_0xe76184,null));};exports[_0x561a('0x7a')]=function(_0x3e0b55,_0x127301,_0x4dcb3a){var _0x528846=[];var _0x43dd9b=_0x3e0b55[_0x561a('0x40')]['id'];var _0x5153f0=_0x3e0b55[_0x561a('0x54')]['id'];return db[_0x561a('0x5d')][_0x561a('0x47')]()[_0x561a('0xf')](function(_0x26699b){_0x528846=_[_0x561a('0x1c')](_0x26699b);return db[_0x561a('0x6a')][_0x561a('0x7b')](function(_0x127a29){const _0x45df37={'id':_0x43dd9b};return db[_0x561a('0x16')][_0x561a('0x73')]({'attributes':['id',_0x561a('0x7c'),'recallme'],'where':_0x45df37,'transaction':_0x127a29,'lock':_0x127a29[_0x561a('0x7d')][_0x561a('0x75')],'include':[{'model':db[_0x561a('0x5d')],'as':'Contact','attributes':_0x528846,'include':[{'model':db[_0x561a('0x7e')],'as':_0x561a('0x77'),'attributes':['id',_0x561a('0x13')]}]},{'model':db[_0x561a('0x7f')],'as':'List','attributes':['id',_0x561a('0x13')]},{'model':db[_0x561a('0x4b')],'as':_0x561a('0x79'),'attributes':['id',_0x561a('0x13'),_0x561a('0x80')]}]})[_0x561a('0xf')](function(_0x40d801){if(_0x40d801){return _0x40d801['update']({'UserId':_0x5153f0},{'transaction':_0x127a29});}});});})['then'](handleEntityNotFound(_0x127301,null))[_0x561a('0xf')](respondWithResult(_0x127301,null))[_0x561a('0x3e')](handleError(_0x127301,null));};exports['getOpenContacts']=function(_0x5a6e8a,_0x54f78e){return _0x5a6e8a[_0x561a('0x54')][_0x561a('0x65')]({'where':{'type':_0x561a('0x66'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x4ec14a){if(_0x4ec14a&&_0x4ec14a[_0x561a('0x32')]){return db[_0x561a('0x16')][_0x561a('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x561a('0x57')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x561a('0x1a')](_0x4ec14a,'id')},'$or':[{'UserId':null},{'UserId':_0x5a6e8a[_0x561a('0x54')]['id']}]}});}return 0x0;})[_0x561a('0xf')](function(_0x3698c2){if(!_[_0x561a('0x60')](_0x3698c2)&&_['isNumber'](_0x3698c2)){return _0x54f78e['status'](0xc8)[_0x561a('0x6')]({'contacts':_0x3698c2});}else{logger[_0x561a('0x11')](_0x561a('0x81'),_0x561a('0x82'),0x194,_0x561a('0x83'));_0x54f78e[_0x561a('0x10')](0x194);}})['catch'](handleError(_0x54f78e,null));};exports[_0x561a('0x84')]=function(_0x1d3771,_0x168fe8){var _0x443a4a=shared[_0x561a('0x85')];var _0x56ce02=[];_[_0x561a('0x1a')](_0x443a4a,function(_0x81c3e4){_0x56ce02[_0x561a('0x86')]({'id':_0x81c3e4[_0x561a('0x13')],'name':_0x81c3e4[_0x561a('0x13')],'utcOffset':_0x81c3e4[_0x561a('0x87')]});});return _0x168fe8[_0x561a('0xb')](0xc8)[_0x561a('0x6')]({'tz':_0x56ce02});};exports[_0x561a('0x88')]=function(_0x5bdb1c,_0x379e9e){var _0x2d3cb3=shared[_0x561a('0x85')];var _0x2874a0={};if(!_[_0x561a('0x60')](_0x2d3cb3[_0x5bdb1c[_0x561a('0x46')]['id']]))_0x2874a0=_0x2d3cb3[_0x5bdb1c[_0x561a('0x46')]['id']];return _0x379e9e['status'](0xc8)[_0x561a('0x6')](_0x2874a0);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d492eaf..77c82a0 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 _0xc4aa=['define','CmHopper','cm_hopper','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopper.attributes','exports'];(function(_0x43b79b,_0x5a0821){var _0x1637f4=function(_0x30c0d7){while(--_0x30c0d7){_0x43b79b['push'](_0x43b79b['shift']());}};_0x1637f4(++_0x5a0821);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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':'scheduledat','fields':['scheduledat']},{'name':_0xac4a('0xc'),'fields':[_0xac4a('0xc')]},{'name':_0xac4a('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4d818d,_0x18fe5c){var _0x4f0046=function(_0x4e847c){while(--_0x4e847c){_0x4d818d['push'](_0x4d818d['shift']());}};_0x4f0046(++_0x18fe5c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x38f57c,_0x200a08){_0x38f57c=_0x38f57c-0x0;var _0x20ac08=_0x3f8a[_0x38f57c];return _0x20ac08;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));module[_0xa3f8('0xa')]=function(_0x471464,_0x1f160a){return _0x471464[_0xa3f8('0xb')](_0xa3f8('0xc'),attributes,{'tableName':_0xa3f8('0xd'),'paranoid':![],'indexes':[{'name':_0xa3f8('0xe'),'fields':[_0xa3f8('0xe')]},{'name':_0xa3f8('0xf'),'fields':[_0xa3f8('0xf')]},{'name':_0xa3f8('0x10'),'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 42393ec..0e0e6ff 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 _0xa109=['code','message','result','catch','GetCmHopper','CmHopper','options','where','attributes','limit','include','map','model','then','ShowCmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper','update','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','UPDATE','keys','User','Agent','name','voicePause','length','UserId','push','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','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','findAll','order','LOCK','GetContactRecallMe','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','literal','NOW()','CmList','lodash','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x503699,_0x152145){var _0xd66c82=function(_0x48c6e7){while(--_0x48c6e7){_0x503699['push'](_0x503699['shift']());}};_0xd66c82(++_0x152145);}(_0xa109,0xf2));var _0x9a10=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa109[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9a10('0x0'));var util=require('util');var moment=require(_0x9a10('0x1'));var BPromise=require(_0x9a10('0x2'));var db=require(_0x9a10('0x3'))['db'];var logger=require('../../config/logger')(_0x9a10('0x4'));var jayson=require(_0x9a10('0x5'));var client=jayson[_0x9a10('0x6')][_0x9a10('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaff959,_0x127409,_0x3741e6){return new BPromise(function(_0x2e86bf,_0x19b3f5){return client[_0x9a10('0x8')](_0xaff959,_0x3741e6)['then'](function(_0xb16a3c){logger[_0x9a10('0x9')](_0x9a10('0xa'),_0x127409,_0x9a10('0xb'));logger[_0x9a10('0xc')](_0x9a10('0xd'),_0x127409,_0x9a10('0xb'),JSON[_0x9a10('0xe')](_0xb16a3c));if(_0xb16a3c[_0x9a10('0xf')]){if(_0xb16a3c['error'][_0x9a10('0x10')]===0x1f4){logger[_0x9a10('0xf')](_0x9a10('0xa'),_0x127409,_0xb16a3c[_0x9a10('0xf')][_0x9a10('0x11')]);return _0x19b3f5(_0xb16a3c['error'][_0x9a10('0x11')]);}logger[_0x9a10('0xf')]('CmHopper,\x20%s,\x20%s',_0x127409,_0xb16a3c['error']['message']);return _0x2e86bf(_0xb16a3c[_0x9a10('0xf')][_0x9a10('0x11')]);}else{logger[_0x9a10('0x9')](_0x9a10('0xa'),_0x127409,'request\x20sent');_0x2e86bf(_0xb16a3c[_0x9a10('0x12')][_0x9a10('0x11')]);}})[_0x9a10('0x13')](function(_0x19e9e0){logger[_0x9a10('0xf')](_0x9a10('0xa'),_0x127409,_0x19e9e0);_0x19b3f5(_0x19e9e0);});});}exports[_0x9a10('0x14')]=function(_0x5d0062){var _0x1fa925=this;return new Promise(function(_0x2ab215,_0x5e5838){return db[_0x9a10('0x15')]['findAll']({'raw':_0x5d0062[_0x9a10('0x16')]?_0x5d0062[_0x9a10('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5d0062[_0x9a10('0x16')]?_0x5d0062[_0x9a10('0x16')][_0x9a10('0x17')]||null:null,'attributes':_0x5d0062[_0x9a10('0x16')]?_0x5d0062[_0x9a10('0x16')][_0x9a10('0x18')]||null:null,'limit':_0x5d0062[_0x9a10('0x16')]?_0x5d0062[_0x9a10('0x16')][_0x9a10('0x19')]||null:null,'include':_0x5d0062[_0x9a10('0x16')]?_0x5d0062['options'][_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x5d0062[_0x9a10('0x16')][_0x9a10('0x1a')],function(_0x3eff7b){return{'model':db[_0x3eff7b[_0x9a10('0x1c')]],'as':_0x3eff7b['as'],'attributes':_0x3eff7b[_0x9a10('0x18')],'include':_0x3eff7b[_0x9a10('0x1a')]?_['map'](_0x3eff7b['include'],function(_0x3c4275){return{'model':db[_0x3c4275[_0x9a10('0x1c')]],'as':_0x3c4275['as'],'attributes':_0x3c4275[_0x9a10('0x18')],'include':_0x3c4275['include']?_[_0x9a10('0x1b')](_0x3c4275[_0x9a10('0x1a')],function(_0x43364e){return{'model':db[_0x43364e[_0x9a10('0x1c')]],'as':_0x43364e['as'],'attributes':_0x43364e[_0x9a10('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a10('0x1d')](function(_0x486b3c){logger[_0x9a10('0x9')](_0x9a10('0x14'),_0x5d0062);logger[_0x9a10('0xc')](_0x9a10('0x14'),_0x5d0062,JSON[_0x9a10('0xe')](_0x486b3c));_0x2ab215(_0x486b3c);})['catch'](function(_0x5d1a5c){logger[_0x9a10('0xf')](_0x9a10('0x14'),_0x5d1a5c[_0x9a10('0x11')],_0x5d0062);_0x5e5838(_0x1fa925[_0x9a10('0xf')](0x1f4,_0x5d1a5c[_0x9a10('0x11')]));});});};exports[_0x9a10('0x1e')]=function(_0x2c361f){var _0x2e1411=this;return new Promise(function(_0x111aca,_0xa40c64){return db[_0x9a10('0x15')][_0x9a10('0x1f')]({'raw':_0x2c361f[_0x9a10('0x16')]?_0x2c361f[_0x9a10('0x16')][_0x9a10('0x20')]===undefined?!![]:![]:!![],'where':_0x2c361f[_0x9a10('0x16')]?_0x2c361f[_0x9a10('0x16')][_0x9a10('0x17')]||null:null,'attributes':_0x2c361f[_0x9a10('0x16')]?_0x2c361f[_0x9a10('0x16')][_0x9a10('0x18')]||null:null,'include':_0x2c361f[_0x9a10('0x16')]?_0x2c361f[_0x9a10('0x16')][_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x2c361f[_0x9a10('0x16')]['include'],function(_0x57bc3e){return{'model':db[_0x57bc3e[_0x9a10('0x1c')]],'as':_0x57bc3e['as'],'attributes':_0x57bc3e[_0x9a10('0x18')],'include':_0x57bc3e[_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x57bc3e[_0x9a10('0x1a')],function(_0x5c7a15){return{'model':db[_0x5c7a15[_0x9a10('0x1c')]],'as':_0x5c7a15['as'],'attributes':_0x5c7a15[_0x9a10('0x18')],'include':_0x5c7a15[_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x5c7a15[_0x9a10('0x1a')],function(_0x24ae5a){return{'model':db[_0x24ae5a[_0x9a10('0x1c')]],'as':_0x24ae5a['as'],'attributes':_0x24ae5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a10('0x1d')](function(_0xc2f279){logger['info'](_0x9a10('0x1e'),_0x2c361f);logger['debug']('ShowCmHopper',_0x2c361f,JSON[_0x9a10('0xe')](_0xc2f279));_0x111aca(_0xc2f279);})[_0x9a10('0x13')](function(_0x382db9){logger[_0x9a10('0xf')](_0x9a10('0x1e'),_0x382db9['message'],_0x2c361f);_0xa40c64(_0x2e1411[_0x9a10('0xf')](0x1f4,_0x382db9['message']));});});};exports[_0x9a10('0x21')]=function(_0x5ab2bb){var _0x24ccda=this;return new Promise(function(_0x156587,_0x5391c0){return db[_0x9a10('0x15')][_0x9a10('0x22')](_0x5ab2bb[_0x9a10('0x23')],{'raw':_0x5ab2bb[_0x9a10('0x16')]?_0x5ab2bb['options'][_0x9a10('0x20')]===undefined?!![]:![]:!![]})[_0x9a10('0x1d')](function(_0x2caa8e){logger[_0x9a10('0x9')](_0x9a10('0x21'),_0x5ab2bb);logger[_0x9a10('0xc')](_0x9a10('0x21'),_0x5ab2bb,JSON[_0x9a10('0xe')](_0x2caa8e));_0x156587(_0x2caa8e);})[_0x9a10('0x13')](function(_0x14e704){logger['error'](_0x9a10('0x21'),_0x14e704[_0x9a10('0x11')],_0x5ab2bb);_0x5391c0(_0x24ccda[_0x9a10('0xf')](0x1f4,_0x14e704[_0x9a10('0x11')]));});});};exports[_0x9a10('0x24')]=function(_0x5e6d3a){var _0x45513d=this;return new Promise(function(_0xbd6b82,_0x2e8236){return db['CmHopper'][_0x9a10('0x25')](_0x5e6d3a['body'],{'raw':_0x5e6d3a[_0x9a10('0x16')]?_0x5e6d3a['options'][_0x9a10('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6d3a[_0x9a10('0x16')]?_0x5e6d3a[_0x9a10('0x16')][_0x9a10('0x17')]||null:null,'attributes':_0x5e6d3a[_0x9a10('0x16')]?_0x5e6d3a['options'][_0x9a10('0x18')]||null:null,'limit':_0x5e6d3a[_0x9a10('0x16')]?_0x5e6d3a[_0x9a10('0x16')][_0x9a10('0x19')]||null:null})[_0x9a10('0x1d')](function(_0x5a1939){logger[_0x9a10('0x9')]('UpdateCmHopper',_0x5e6d3a);logger[_0x9a10('0x9')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x9a10('0xe')](_0x5e6d3a['options']['where']),_0x5e6d3a[_0x9a10('0x23')][_0x9a10('0x26')]);logger[_0x9a10('0xc')](_0x9a10('0x24'),_0x5e6d3a,JSON[_0x9a10('0xe')](_0x5a1939));_0xbd6b82(_0x5a1939);})[_0x9a10('0x13')](function(_0x521f87){logger[_0x9a10('0xf')](_0x9a10('0x24'),_0x521f87[_0x9a10('0x11')],_0x5e6d3a);_0x2e8236(_0x45513d[_0x9a10('0xf')](0x1f4,_0x521f87[_0x9a10('0x11')]));});});};exports['DestroyCmHopper']=function(_0x447588){var _0x43dffb=this;return new Promise(function(_0x352525,_0x39567c){return db[_0x9a10('0x15')][_0x9a10('0x27')]({'where':_0x447588[_0x9a10('0x16')]?_0x447588[_0x9a10('0x16')][_0x9a10('0x17')]||null:null})[_0x9a10('0x1d')](function(_0x8fafb2){logger[_0x9a10('0x9')](_0x9a10('0x28'),_0x447588);logger[_0x9a10('0xc')](_0x9a10('0x28'),_0x447588,JSON['stringify'](_0x8fafb2));_0x352525(_0x8fafb2);})['catch'](function(_0x285ef2){logger['error'](_0x9a10('0x28'),_0x285ef2[_0x9a10('0x11')],_0x447588);_0x39567c(_0x43dffb['error'](0x1f4,_0x285ef2[_0x9a10('0x11')]));});});};exports[_0x9a10('0x29')]=function(_0x4ae94c){var _0x84c355=this;return new Promise(function(_0x39f488,_0x4b976b){return db[_0x9a10('0x2a')]['describe']()[_0x9a10('0x1d')](function(_0x4d6e7b){return db[_0x9a10('0x2b')][_0x9a10('0x2c')](function(_0xb4e4a2){return db['CmHopper']['findAll']({'where':_0x4ae94c[_0x9a10('0x16')]?_0x4ae94c[_0x9a10('0x16')][_0x9a10('0x17')]||null:null,'attributes':_0x4ae94c[_0x9a10('0x16')]?_0x4ae94c[_0x9a10('0x16')][_0x9a10('0x18')]||null:null,'limit':_0x4ae94c[_0x9a10('0x16')]?_0x4ae94c[_0x9a10('0x16')][_0x9a10('0x19')]||null:null,'order':_0x4ae94c[_0x9a10('0x16')]?_0x4ae94c[_0x9a10('0x16')]['order']||null:null,'transaction':_0xb4e4a2,'lock':_0xb4e4a2['LOCK'][_0x9a10('0x2d')],'include':[{'model':db[_0x9a10('0x2a')],'as':'Contact','attributes':_[_0x9a10('0x2e')](_0x4d6e7b)},{'model':db[_0x9a10('0x2f')],'as':_0x9a10('0x30'),'attributes':['id',_0x9a10('0x31'),_0x9a10('0x32')]}]})[_0x9a10('0x1d')](function(_0x1aa01f){var _0x39fdcc=[];var _0x53c15d=[];for(var _0x1f151b=0x0;_0x1f151b<_0x1aa01f[_0x9a10('0x33')];_0x1f151b+=0x1){var _0x31c30b=_0x1aa01f[_0x1f151b][_0x9a10('0x34')];if(_0x31c30b===null){_0x39fdcc[_0x9a10('0x35')](_0x1aa01f[_0x1f151b][_0x9a10('0x25')](_0x4ae94c['body'],{'transaction':_0xb4e4a2}));}else if(!_0x53c15d['includes'](_0x31c30b)){_0x53c15d[_0x9a10('0x35')](_0x31c30b);_0x39fdcc[_0x9a10('0x35')](_0x1aa01f[_0x1f151b][_0x9a10('0x25')](_0x4ae94c[_0x9a10('0x23')],{'transaction':_0xb4e4a2}));}}return BPromise[_0x9a10('0x36')](_0x39fdcc);});})[_0x9a10('0x1d')](function(_0x20908c){logger[_0x9a10('0x9')](_0x9a10('0x29'),_0x4ae94c);if(_0x20908c[_0x9a10('0x33')]>0x0){logger[_0x9a10('0x9')](_0x9a10('0x37'),_0x20908c[0x0][_0x9a10('0x38')]['id'],_0x20908c[0x0][_0x9a10('0x38')][_0x9a10('0x39')],_0x20908c[0x0][_0x9a10('0x38')][_0x9a10('0x26')]);}logger[_0x9a10('0xc')]('GetContactDialer',_0x4ae94c,JSON[_0x9a10('0xe')](_0x20908c));_0x39f488(_0x20908c);})['catch'](function(_0x3bcb91){logger[_0x9a10('0xf')]('GetContactDialer',_0x3bcb91[_0x9a10('0x11')],_0x4ae94c);_0x4b976b(_0x84c355[_0x9a10('0xf')](0x1f4,_0x3bcb91[_0x9a10('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x25dd07){var _0x1fb503=this;return new Promise(function(_0x2775a0,_0xcaa8e7){return db[_0x9a10('0x2b')]['transaction'](function(_0x20edb6){return db[_0x9a10('0x3a')][_0x9a10('0x22')](_0x25dd07[_0x9a10('0x23')],{'raw':_0x25dd07[_0x9a10('0x16')]?_0x25dd07[_0x9a10('0x16')][_0x9a10('0x20')]===undefined?!![]:![]:!![],'transaction':_0x20edb6})[_0x9a10('0x1d')](function(){logger[_0x9a10('0x9')](_0x9a10('0x3b'),JSON['stringify'](_0x25dd07[_0x9a10('0x16')][_0x9a10('0x17')]),_0x25dd07[_0x9a10('0x16')][_0x9a10('0x17')][_0x9a10('0x26')]);return db[_0x9a10('0x15')][_0x9a10('0x27')]({'where':_0x25dd07[_0x9a10('0x16')]?_0x25dd07[_0x9a10('0x16')][_0x9a10('0x17')]||null:null,'transaction':_0x20edb6});});})[_0x9a10('0x1d')](function(_0xf926e2){logger[_0x9a10('0x9')](_0x9a10('0x3c'),_0x25dd07);logger['debug']('MoveContactManagedDialer',_0x25dd07,JSON['stringify'](_0xf926e2));_0x2775a0(_0xf926e2);})['catch'](function(_0x7fc951){logger[_0x9a10('0xf')]('MoveContactManagedDialer',_0x7fc951[_0x9a10('0x11')],_0x25dd07);_0xcaa8e7(_0x1fb503[_0x9a10('0xf')](0x1f4,_0x7fc951[_0x9a10('0x11')]));});});};exports['CountReScheduled']=function(_0x11c367){var _0x202eda=this;return new Promise(function(_0x13a9b2,_0x33056a){return db['CmHopper']['findAll']({'raw':_0x11c367['options']?_0x11c367[_0x9a10('0x16')][_0x9a10('0x20')]===undefined?!![]:![]:!![],'where':_0x11c367[_0x9a10('0x16')]?_0x11c367['options']['where']||null:null,'attributes':[[db[_0x9a10('0x2b')]['fn']('COUNT',db[_0x9a10('0x2b')]['fn']('IF',db[_0x9a10('0x2b')]['literal'](_0x9a10('0x3d')+util[_0x9a10('0x3e')]('\x22%s\x22',moment()['format'](_0x9a10('0x3f')))+'\x20,\x201,\x20null'))),_0x9a10('0x40')]]})['then'](function(_0x2053ca){logger[_0x9a10('0x9')]('CountReScheduled',_0x11c367);logger[_0x9a10('0xc')](_0x9a10('0x41'),_0x11c367,JSON[_0x9a10('0xe')](_0x2053ca));_0x13a9b2(_0x2053ca);})['catch'](function(_0x1c512a){logger[_0x9a10('0xf')](_0x9a10('0x41'),_0x1c512a[_0x9a10('0x11')],_0x11c367);_0x33056a(_0x202eda['error'](0x1f4,_0x1c512a[_0x9a10('0x11')]));});});};exports['GetContactRecallMe']=function(_0x5c75a4){var _0x45205d=this;return new Promise(function(_0x550efc,_0x14bad8){return db[_0x9a10('0x2a')]['describe']()[_0x9a10('0x1d')](function(_0x57daf6){return db[_0x9a10('0x2b')][_0x9a10('0x2c')](function(_0x4dcaf4){return db[_0x9a10('0x15')][_0x9a10('0x42')]({'where':_0x5c75a4[_0x9a10('0x16')]?_0x5c75a4['options'][_0x9a10('0x17')]||null:null,'attributes':_0x5c75a4[_0x9a10('0x16')]?_0x5c75a4['options'][_0x9a10('0x18')]||null:null,'limit':0x1,'order':_0x5c75a4[_0x9a10('0x16')]?_0x5c75a4[_0x9a10('0x16')][_0x9a10('0x43')]||null:null,'group':db[_0x9a10('0x15')][_0x9a10('0x34')],'transaction':_0x4dcaf4,'lock':_0x4dcaf4[_0x9a10('0x44')]['UPDATE'],'include':_0x5c75a4['options']?_0x5c75a4['options'][_0x9a10('0x1a')]?_['map'](_0x5c75a4[_0x9a10('0x16')][_0x9a10('0x1a')],function(_0x46f039){return{'model':db[_0x46f039[_0x9a10('0x1c')]],'as':_0x46f039['as'],'attributes':_0x46f039[_0x9a10('0x18')],'include':_0x46f039[_0x9a10('0x1a')]?_['map'](_0x46f039[_0x9a10('0x1a')],function(_0x46c3e4){return{'model':db[_0x46c3e4[_0x9a10('0x1c')]],'as':_0x46c3e4['as'],'attributes':_0x46c3e4[_0x9a10('0x18')],'include':_0x46c3e4[_0x9a10('0x1a')]?_['map'](_0x46c3e4['include'],function(_0x128afe){return{'model':db[_0x128afe[_0x9a10('0x1c')]],'as':_0x128afe['as'],'attributes':_0x128afe[_0x9a10('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a10('0x1d')](function(_0x5ae6c5){var _0x5deaca=[];for(var _0x34da71=0x0;_0x34da71<_0x5ae6c5[_0x9a10('0x33')];_0x34da71+=0x1){_0x5deaca[_0x9a10('0x35')](_0x5ae6c5[_0x34da71][_0x9a10('0x25')](_0x5c75a4['body'],{'transaction':_0x4dcaf4}));}return BPromise[_0x9a10('0x36')](_0x5deaca);});})[_0x9a10('0x1d')](function(_0x1b5632){logger[_0x9a10('0x9')](_0x9a10('0x45'),_0x5c75a4);logger['debug']('GetContactRecallMe',_0x5c75a4,JSON['stringify'](_0x1b5632));_0x550efc(_0x1b5632);})[_0x9a10('0x13')](function(_0x5b2ba5){logger[_0x9a10('0xf')](_0x9a10('0x45'),_0x5b2ba5['message'],_0x5c75a4);_0x14bad8(_0x45205d[_0x9a10('0xf')](0x1f4,_0x5b2ba5['message']));});});});};exports['GetCmHopperPreview']=function(_0x5cf668){var _0x99d753=this;return new Promise(function(_0x3089f0,_0x328a28){db[_0x9a10('0x2a')]['describe']()[_0x9a10('0x1d')](function(_0xb8c1eb){return db[_0x9a10('0x15')][_0x9a10('0x42')]({'raw':_0x5cf668[_0x9a10('0x16')]?_0x5cf668[_0x9a10('0x16')][_0x9a10('0x20')]===undefined?!![]:![]:!![],'where':_0x5cf668[_0x9a10('0x16')]?_0x5cf668[_0x9a10('0x16')]['where']||null:null,'attributes':_0x5cf668['options']?_0x5cf668['options'][_0x9a10('0x18')]||null:null,'limit':_0x5cf668[_0x9a10('0x16')]?_0x5cf668[_0x9a10('0x16')][_0x9a10('0x19')]||null:null,'include':_0x5cf668[_0x9a10('0x16')]?_0x5cf668[_0x9a10('0x16')][_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x5cf668[_0x9a10('0x16')][_0x9a10('0x1a')],function(_0x1fd502){return{'model':db[_0x1fd502['model']],'as':_0x1fd502['as'],'attributes':_0x1fd502['as']===_0x9a10('0x46')?_['keys'](_0xb8c1eb):_0x1fd502[_0x9a10('0x18')],'include':_0x1fd502[_0x9a10('0x1a')]?_[_0x9a10('0x1b')](_0x1fd502[_0x9a10('0x1a')],function(_0x12ab36){return{'model':db[_0x12ab36[_0x9a10('0x1c')]],'as':_0x12ab36['as'],'attributes':_0x12ab36[_0x9a10('0x18')],'include':_0x12ab36['include']?_[_0x9a10('0x1b')](_0x12ab36[_0x9a10('0x1a')],function(_0x1f777){return{'model':db[_0x1f777[_0x9a10('0x1c')]],'as':_0x1f777['as'],'attributes':_0x1f777[_0x9a10('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9a10('0x1d')](function(_0x38a0ab){logger[_0x9a10('0x9')](_0x9a10('0x14'),_0x5cf668);logger['debug'](_0x9a10('0x14'),_0x5cf668,JSON[_0x9a10('0xe')](_0x38a0ab));_0x3089f0(_0x38a0ab);})['catch'](function(_0x43a964){logger[_0x9a10('0xf')](_0x9a10('0x14'),_0x43a964[_0x9a10('0x11')],_0x5cf668);_0x328a28(_0x99d753['error'](0x1f4,_0x43a964[_0x9a10('0x11')]));});});});};exports[_0x9a10('0x47')]=function(_0x227fd1){var _0x57ad87=this;return new Promise(function(_0x11786c,_0xbc2591){return db[_0x9a10('0x2a')][_0x9a10('0x48')]({'raw':!![],'where':{'phone':_0x227fd1[_0x9a10('0x16')][_0x9a10('0x17')][_0x9a10('0x49')]},'attributes':['id',_0x9a10('0x4a')],'order':[['id',_0x9a10('0x4b')]]})[_0x9a10('0x1d')](function(_0x27bded){logger[_0x9a10('0x9')]('getContactByPhone',_0x227fd1);logger['debug'](_0x9a10('0x4c'),_0x227fd1,JSON['stringify'](_0x27bded));_0x11786c(_0x27bded);})[_0x9a10('0x13')](function(_0x557604){logger['error'](_0x9a10('0x4c'),_0x557604['message'],_0x227fd1);_0xbc2591(_0x57ad87['error'](0x1f4,_0x557604[_0x9a10('0x11')]));});});};exports['ResetActiveCalls']=function(_0x468542){var _0x3e30ea=this;return new Promise(function(_0x3be30b,_0xa28fc2){return db[_0x9a10('0x2b')][_0x9a10('0x2c')](function(_0x1c62f2){return db[_0x9a10('0x15')][_0x9a10('0x25')]({'active':![]},{'where':{},'transaction':_0x1c62f2})['then'](function(_0x5b0bea){logger[_0x9a10('0x9')](_0x9a10('0x4d'),_0x468542);logger[_0x9a10('0xc')](_0x9a10('0x4d'),_0x468542,JSON[_0x9a10('0xe')](_0x5b0bea));_0x3be30b(_0x5b0bea);})['catch'](function(_0x547185){logger[_0x9a10('0xf')](_0x9a10('0x4d'),_0x547185[_0x9a10('0x11')],_0x468542);_0xa28fc2(_0x3e30ea[_0x9a10('0xf')](0x1f4,_0x547185['message']));});});});};exports[_0x9a10('0x4e')]=function(_0x1450d3){var _0x50f139=this;var _0x5731e6=_0x1450d3['body'][_0x9a10('0x17')][_0x9a10('0x4f')];var _0x11af96=_0x1450d3[_0x9a10('0x23')]['where'][_0x9a10('0x50')];var _0x40e6ff=_0x1450d3[_0x9a10('0x23')][_0x9a10('0x17')][_0x9a10('0x51')];return new Promise(function(_0x2719eb,_0x1654b7){return db[_0x9a10('0x15')][_0x9a10('0x42')]({'where':{'voiceQueueId':{'$in':_0x5731e6},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x11af96+_0x9a10('0x52')),'$gt':db[_0x9a10('0x2b')][_0x9a10('0x53')](_0x9a10('0x54'))}},'UserId':{'$in':_0x40e6ff}},'include':[{'model':db[_0x9a10('0x2a')],'as':_0x9a10('0x46')},{'model':db[_0x9a10('0x2f')],'as':_0x9a10('0x30'),'attributes':['id',_0x9a10('0x31'),_0x9a10('0x32')]},{'model':db[_0x9a10('0x55')],'as':'List'}]})[_0x9a10('0x1d')](function(_0x22f675){if(_0x22f675[_0x9a10('0x33')]>0x0){return db[_0x9a10('0x2b')][_0x9a10('0x2c')](function(_0x2b83e4){return db[_0x9a10('0x15')][_0x9a10('0x25')]({'recallmeNotifiedDate':db[_0x9a10('0x2b')][_0x9a10('0x53')](_0x9a10('0x54'))},{'where':{'id':{'$in':_[_0x9a10('0x1b')](_0x22f675,'id')}},'transaction':_0x2b83e4})[_0x9a10('0x1d')](function(){_0x2719eb(_0x22f675);})['catch'](function(_0x481dce){logger[_0x9a10('0xf')](_0x9a10('0x4e'),_0x481dce[_0x9a10('0x11')],_0x1450d3);_0x1654b7(_0x50f139[_0x9a10('0xf')](0x1f4,_0x481dce[_0x9a10('0x11')]));});})['catch'](function(_0x32f77b){logger['error'](_0x9a10('0x4e'),_0x32f77b[_0x9a10('0x11')],_0x1450d3);_0x1654b7(_0x50f139[_0x9a10('0xf')](0x1f4,_0x32f77b['message']));});}else{_0x2719eb(_0x22f675);}});});}; \ No newline at end of file +var _0x723c=['debug','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','where','limit','include','map','model','attributes','then','ShowCmHopper','find','raw','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','UserId','includes','push','all','GetContactDialer','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','util','moment','../../mysqldb','rpc','jayson/promise','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent'];(function(_0x1f1d2e,_0x114aa5){var _0x6c9215=function(_0x3761ee){while(--_0x3761ee){_0x1f1d2e['push'](_0x1f1d2e['shift']());}};_0x6c9215(++_0x114aa5);}(_0x723c,0x1ad));var _0xc723=function(_0x354e28,_0x437c03){_0x354e28=_0x354e28-0x0;var _0x325ead=_0x723c[_0x354e28];return _0x325ead;};'use strict';var _=require('lodash');var util=require(_0xc723('0x0'));var moment=require(_0xc723('0x1'));var BPromise=require('bluebird');var db=require(_0xc723('0x2'))['db'];var logger=require('../../config/logger')(_0xc723('0x3'));var jayson=require(_0xc723('0x4'));var client=jayson[_0xc723('0x5')][_0xc723('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x171018,_0x55907e,_0xa08b3){return new BPromise(function(_0x4eb5ff,_0x94e3de){return client[_0xc723('0x7')](_0x171018,_0xa08b3)['then'](function(_0x199e04){logger[_0xc723('0x8')](_0xc723('0x9'),_0x55907e,_0xc723('0xa'));logger[_0xc723('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x55907e,'request\x20sent',JSON[_0xc723('0xc')](_0x199e04));if(_0x199e04[_0xc723('0xd')]){if(_0x199e04[_0xc723('0xd')][_0xc723('0xe')]===0x1f4){logger['error'](_0xc723('0x9'),_0x55907e,_0x199e04[_0xc723('0xd')][_0xc723('0xf')]);return _0x94e3de(_0x199e04[_0xc723('0xd')][_0xc723('0xf')]);}logger['error'](_0xc723('0x9'),_0x55907e,_0x199e04[_0xc723('0xd')][_0xc723('0xf')]);return _0x4eb5ff(_0x199e04[_0xc723('0xd')][_0xc723('0xf')]);}else{logger['info'](_0xc723('0x9'),_0x55907e,'request\x20sent');_0x4eb5ff(_0x199e04['result'][_0xc723('0xf')]);}})[_0xc723('0x10')](function(_0x212a77){logger[_0xc723('0xd')](_0xc723('0x9'),_0x55907e,_0x212a77);_0x94e3de(_0x212a77);});});}exports[_0xc723('0x11')]=function(_0x7794ca){var _0x2b2f0e=this;return new Promise(function(_0x5345a4,_0x931da1){return db[_0xc723('0x12')][_0xc723('0x13')]({'raw':_0x7794ca[_0xc723('0x14')]?_0x7794ca['options']['raw']===undefined?!![]:![]:!![],'where':_0x7794ca[_0xc723('0x14')]?_0x7794ca[_0xc723('0x14')][_0xc723('0x15')]||null:null,'attributes':_0x7794ca[_0xc723('0x14')]?_0x7794ca[_0xc723('0x14')]['attributes']||null:null,'limit':_0x7794ca[_0xc723('0x14')]?_0x7794ca[_0xc723('0x14')][_0xc723('0x16')]||null:null,'include':_0x7794ca[_0xc723('0x14')]?_0x7794ca[_0xc723('0x14')][_0xc723('0x17')]?_[_0xc723('0x18')](_0x7794ca[_0xc723('0x14')][_0xc723('0x17')],function(_0x43265c){return{'model':db[_0x43265c[_0xc723('0x19')]],'as':_0x43265c['as'],'attributes':_0x43265c[_0xc723('0x1a')],'include':_0x43265c['include']?_[_0xc723('0x18')](_0x43265c['include'],function(_0x2728a5){return{'model':db[_0x2728a5[_0xc723('0x19')]],'as':_0x2728a5['as'],'attributes':_0x2728a5[_0xc723('0x1a')],'include':_0x2728a5['include']?_[_0xc723('0x18')](_0x2728a5[_0xc723('0x17')],function(_0x4ed3ca){return{'model':db[_0x4ed3ca['model']],'as':_0x4ed3ca['as'],'attributes':_0x4ed3ca[_0xc723('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc723('0x1b')](function(_0x128261){logger[_0xc723('0x8')](_0xc723('0x11'),_0x7794ca);logger[_0xc723('0xb')](_0xc723('0x11'),_0x7794ca,JSON[_0xc723('0xc')](_0x128261));_0x5345a4(_0x128261);})['catch'](function(_0x567895){logger[_0xc723('0xd')](_0xc723('0x11'),_0x567895[_0xc723('0xf')],_0x7794ca);_0x931da1(_0x2b2f0e['error'](0x1f4,_0x567895[_0xc723('0xf')]));});});};exports[_0xc723('0x1c')]=function(_0x1cbd49){var _0x5e1a1d=this;return new Promise(function(_0x4e874b,_0x14186d){return db[_0xc723('0x12')][_0xc723('0x1d')]({'raw':_0x1cbd49['options']?_0x1cbd49[_0xc723('0x14')][_0xc723('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cbd49[_0xc723('0x14')]?_0x1cbd49['options'][_0xc723('0x15')]||null:null,'attributes':_0x1cbd49['options']?_0x1cbd49['options']['attributes']||null:null,'include':_0x1cbd49[_0xc723('0x14')]?_0x1cbd49[_0xc723('0x14')]['include']?_[_0xc723('0x18')](_0x1cbd49[_0xc723('0x14')][_0xc723('0x17')],function(_0x2c66e3){return{'model':db[_0x2c66e3[_0xc723('0x19')]],'as':_0x2c66e3['as'],'attributes':_0x2c66e3[_0xc723('0x1a')],'include':_0x2c66e3[_0xc723('0x17')]?_[_0xc723('0x18')](_0x2c66e3[_0xc723('0x17')],function(_0x145da7){return{'model':db[_0x145da7[_0xc723('0x19')]],'as':_0x145da7['as'],'attributes':_0x145da7[_0xc723('0x1a')],'include':_0x145da7['include']?_[_0xc723('0x18')](_0x145da7['include'],function(_0x5afbd2){return{'model':db[_0x5afbd2[_0xc723('0x19')]],'as':_0x5afbd2['as'],'attributes':_0x5afbd2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12419d){logger[_0xc723('0x8')](_0xc723('0x1c'),_0x1cbd49);logger[_0xc723('0xb')]('ShowCmHopper',_0x1cbd49,JSON[_0xc723('0xc')](_0x12419d));_0x4e874b(_0x12419d);})[_0xc723('0x10')](function(_0x2a1bac){logger[_0xc723('0xd')](_0xc723('0x1c'),_0x2a1bac['message'],_0x1cbd49);_0x14186d(_0x5e1a1d[_0xc723('0xd')](0x1f4,_0x2a1bac[_0xc723('0xf')]));});});};exports[_0xc723('0x1f')]=function(_0x2b988f){var _0x44177d=this;return new Promise(function(_0x5b2234,_0x2bb0e4){return db['CmHopper'][_0xc723('0x20')](_0x2b988f[_0xc723('0x21')],{'raw':_0x2b988f[_0xc723('0x14')]?_0x2b988f[_0xc723('0x14')][_0xc723('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x41e738){logger[_0xc723('0x8')](_0xc723('0x1f'),_0x2b988f);logger[_0xc723('0xb')](_0xc723('0x1f'),_0x2b988f,JSON[_0xc723('0xc')](_0x41e738));_0x5b2234(_0x41e738);})['catch'](function(_0x5c6ee0){logger[_0xc723('0xd')](_0xc723('0x1f'),_0x5c6ee0[_0xc723('0xf')],_0x2b988f);_0x2bb0e4(_0x44177d[_0xc723('0xd')](0x1f4,_0x5c6ee0[_0xc723('0xf')]));});});};exports['UpdateCmHopper']=function(_0x435b3b){var _0x4a0f97=this;return new Promise(function(_0x12bed1,_0x140cfd){return db[_0xc723('0x12')][_0xc723('0x22')](_0x435b3b[_0xc723('0x21')],{'raw':_0x435b3b[_0xc723('0x14')]?_0x435b3b[_0xc723('0x14')][_0xc723('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x435b3b['options']?_0x435b3b['options']['where']||null:null,'attributes':_0x435b3b[_0xc723('0x14')]?_0x435b3b['options'][_0xc723('0x1a')]||null:null,'limit':_0x435b3b[_0xc723('0x14')]?_0x435b3b[_0xc723('0x14')]['limit']||null:null})['then'](function(_0x553ece){logger[_0xc723('0x8')](_0xc723('0x23'),_0x435b3b);logger[_0xc723('0x8')](_0xc723('0x24'),JSON['stringify'](_0x435b3b[_0xc723('0x14')][_0xc723('0x15')]),_0x435b3b[_0xc723('0x21')][_0xc723('0x25')]);logger[_0xc723('0xb')]('UpdateCmHopper',_0x435b3b,JSON[_0xc723('0xc')](_0x553ece));_0x12bed1(_0x553ece);})[_0xc723('0x10')](function(_0x11c4a0){logger[_0xc723('0xd')](_0xc723('0x23'),_0x11c4a0[_0xc723('0xf')],_0x435b3b);_0x140cfd(_0x4a0f97[_0xc723('0xd')](0x1f4,_0x11c4a0['message']));});});};exports[_0xc723('0x26')]=function(_0x1e351a){var _0x42e0d4=this;return new Promise(function(_0x5ead61,_0x2397e8){return db[_0xc723('0x12')][_0xc723('0x27')]({'where':_0x1e351a[_0xc723('0x14')]?_0x1e351a[_0xc723('0x14')][_0xc723('0x15')]||null:null})[_0xc723('0x1b')](function(_0x306b59){logger[_0xc723('0x8')](_0xc723('0x26'),_0x1e351a);logger[_0xc723('0xb')](_0xc723('0x26'),_0x1e351a,JSON['stringify'](_0x306b59));_0x5ead61(_0x306b59);})['catch'](function(_0xed589a){logger['error'](_0xc723('0x26'),_0xed589a[_0xc723('0xf')],_0x1e351a);_0x2397e8(_0x42e0d4[_0xc723('0xd')](0x1f4,_0xed589a[_0xc723('0xf')]));});});};exports['GetContactDialer']=function(_0x6e30de){var _0x1dbe41=this;return new Promise(function(_0x2ec251,_0x2c2278){return db[_0xc723('0x28')][_0xc723('0x29')]()[_0xc723('0x1b')](function(_0x5ad852){return db[_0xc723('0x2a')][_0xc723('0x2b')](function(_0xe865a4){return db[_0xc723('0x12')][_0xc723('0x13')]({'where':_0x6e30de[_0xc723('0x14')]?_0x6e30de['options'][_0xc723('0x15')]||null:null,'attributes':_0x6e30de[_0xc723('0x14')]?_0x6e30de[_0xc723('0x14')]['attributes']||null:null,'limit':_0x6e30de[_0xc723('0x14')]?_0x6e30de[_0xc723('0x14')][_0xc723('0x16')]||null:null,'order':_0x6e30de[_0xc723('0x14')]?_0x6e30de[_0xc723('0x14')][_0xc723('0x2c')]||null:null,'transaction':_0xe865a4,'lock':_0xe865a4[_0xc723('0x2d')][_0xc723('0x2e')],'include':[{'model':db['CmContact'],'as':_0xc723('0x2f'),'attributes':_[_0xc723('0x30')](_0x5ad852)},{'model':db['User'],'as':_0xc723('0x31'),'attributes':['id',_0xc723('0x32'),_0xc723('0x33')]}]})['then'](function(_0x59cdfb){var _0x1d0753=[];var _0x34274c=[];for(var _0x5314a5=0x0;_0x5314a5<_0x59cdfb['length'];_0x5314a5+=0x1){var _0x56abcf=_0x59cdfb[_0x5314a5][_0xc723('0x34')];if(_0x56abcf===null){_0x1d0753['push'](_0x59cdfb[_0x5314a5]['update'](_0x6e30de['body'],{'transaction':_0xe865a4}));}else if(!_0x34274c[_0xc723('0x35')](_0x56abcf)){_0x34274c[_0xc723('0x36')](_0x56abcf);_0x1d0753[_0xc723('0x36')](_0x59cdfb[_0x5314a5][_0xc723('0x22')](_0x6e30de['body'],{'transaction':_0xe865a4}));}}return BPromise[_0xc723('0x37')](_0x1d0753);});})[_0xc723('0x1b')](function(_0x55d5c7){logger['info'](_0xc723('0x38'),_0x6e30de);if(_0x55d5c7[_0xc723('0x39')]>0x0){logger[_0xc723('0x8')](_0xc723('0x3a'),_0x55d5c7[0x0][_0xc723('0x3b')]['id'],_0x55d5c7[0x0]['dataValues'][_0xc723('0x3c')],_0x55d5c7[0x0]['dataValues'][_0xc723('0x25')]);}logger[_0xc723('0xb')]('GetContactDialer',_0x6e30de,JSON['stringify'](_0x55d5c7));_0x2ec251(_0x55d5c7);})[_0xc723('0x10')](function(_0x3ca291){logger['error']('GetContactDialer',_0x3ca291[_0xc723('0xf')],_0x6e30de);_0x2c2278(_0x1dbe41['error'](0x1f4,_0x3ca291[_0xc723('0xf')]));});});});};exports[_0xc723('0x3d')]=function(_0x40dc70){var _0x2a1a1e=this;return new Promise(function(_0x1ea184,_0x42c410){return db[_0xc723('0x2a')][_0xc723('0x2b')](function(_0x2fd100){return db[_0xc723('0x3e')][_0xc723('0x20')](_0x40dc70['body'],{'raw':_0x40dc70[_0xc723('0x14')]?_0x40dc70['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x2fd100})[_0xc723('0x1b')](function(){logger[_0xc723('0x8')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x40dc70[_0xc723('0x14')][_0xc723('0x15')]),_0x40dc70[_0xc723('0x14')][_0xc723('0x15')]['active']);return db[_0xc723('0x12')][_0xc723('0x27')]({'where':_0x40dc70[_0xc723('0x14')]?_0x40dc70[_0xc723('0x14')][_0xc723('0x15')]||null:null,'transaction':_0x2fd100});});})[_0xc723('0x1b')](function(_0x3a5e42){logger[_0xc723('0x8')](_0xc723('0x3d'),_0x40dc70);logger['debug'](_0xc723('0x3d'),_0x40dc70,JSON[_0xc723('0xc')](_0x3a5e42));_0x1ea184(_0x3a5e42);})['catch'](function(_0x13071f){logger[_0xc723('0xd')](_0xc723('0x3d'),_0x13071f[_0xc723('0xf')],_0x40dc70);_0x42c410(_0x2a1a1e[_0xc723('0xd')](0x1f4,_0x13071f[_0xc723('0xf')]));});});};exports['CountReScheduled']=function(_0x4095d7){var _0x564da0=this;return new Promise(function(_0xdcae23,_0x4126e7){return db[_0xc723('0x12')][_0xc723('0x13')]({'raw':_0x4095d7[_0xc723('0x14')]?_0x4095d7[_0xc723('0x14')][_0xc723('0x1e')]===undefined?!![]:![]:!![],'where':_0x4095d7['options']?_0x4095d7[_0xc723('0x14')][_0xc723('0x15')]||null:null,'attributes':[[db[_0xc723('0x2a')]['fn'](_0xc723('0x3f'),db[_0xc723('0x2a')]['fn']('IF',db[_0xc723('0x2a')]['literal'](_0xc723('0x40')+util[_0xc723('0x41')](_0xc723('0x42'),moment()[_0xc723('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xc723('0x43')]]})[_0xc723('0x1b')](function(_0x4d771e){logger['info']('CountReScheduled',_0x4095d7);logger[_0xc723('0xb')](_0xc723('0x44'),_0x4095d7,JSON[_0xc723('0xc')](_0x4d771e));_0xdcae23(_0x4d771e);})[_0xc723('0x10')](function(_0x3cebf0){logger[_0xc723('0xd')]('CountReScheduled',_0x3cebf0[_0xc723('0xf')],_0x4095d7);_0x4126e7(_0x564da0['error'](0x1f4,_0x3cebf0[_0xc723('0xf')]));});});};exports[_0xc723('0x45')]=function(_0x1493a7){var _0x6f7aa8=this;return new Promise(function(_0x476c7b,_0x583d99){return db['CmContact'][_0xc723('0x29')]()[_0xc723('0x1b')](function(_0x1abde5){return db[_0xc723('0x2a')][_0xc723('0x2b')](function(_0x5b5509){return db['CmHopper'][_0xc723('0x13')]({'where':_0x1493a7[_0xc723('0x14')]?_0x1493a7[_0xc723('0x14')][_0xc723('0x15')]||null:null,'attributes':_0x1493a7[_0xc723('0x14')]?_0x1493a7[_0xc723('0x14')][_0xc723('0x1a')]||null:null,'limit':0x1,'order':_0x1493a7[_0xc723('0x14')]?_0x1493a7['options'][_0xc723('0x2c')]||null:null,'group':db[_0xc723('0x12')]['UserId'],'transaction':_0x5b5509,'lock':_0x5b5509['LOCK'][_0xc723('0x2e')],'include':_0x1493a7[_0xc723('0x14')]?_0x1493a7[_0xc723('0x14')][_0xc723('0x17')]?_[_0xc723('0x18')](_0x1493a7['options'][_0xc723('0x17')],function(_0x2609e2){return{'model':db[_0x2609e2[_0xc723('0x19')]],'as':_0x2609e2['as'],'attributes':_0x2609e2[_0xc723('0x1a')],'include':_0x2609e2[_0xc723('0x17')]?_[_0xc723('0x18')](_0x2609e2[_0xc723('0x17')],function(_0x3ddd22){return{'model':db[_0x3ddd22[_0xc723('0x19')]],'as':_0x3ddd22['as'],'attributes':_0x3ddd22['attributes'],'include':_0x3ddd22[_0xc723('0x17')]?_[_0xc723('0x18')](_0x3ddd22[_0xc723('0x17')],function(_0x344f32){return{'model':db[_0x344f32[_0xc723('0x19')]],'as':_0x344f32['as'],'attributes':_0x344f32[_0xc723('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc723('0x1b')](function(_0x27d8ee){var _0x2f315c=[];for(var _0x3e0006=0x0;_0x3e0006<_0x27d8ee[_0xc723('0x39')];_0x3e0006+=0x1){_0x2f315c[_0xc723('0x36')](_0x27d8ee[_0x3e0006][_0xc723('0x22')](_0x1493a7[_0xc723('0x21')],{'transaction':_0x5b5509}));}return BPromise['all'](_0x2f315c);});})[_0xc723('0x1b')](function(_0x253771){logger[_0xc723('0x8')]('GetContactRecallMe',_0x1493a7);logger[_0xc723('0xb')]('GetContactRecallMe',_0x1493a7,JSON['stringify'](_0x253771));_0x476c7b(_0x253771);})[_0xc723('0x10')](function(_0xa3c4ae){logger[_0xc723('0xd')]('GetContactRecallMe',_0xa3c4ae['message'],_0x1493a7);_0x583d99(_0x6f7aa8['error'](0x1f4,_0xa3c4ae[_0xc723('0xf')]));});});});};exports[_0xc723('0x46')]=function(_0x2c7a19){var _0x21dfed=this;return new Promise(function(_0x26a232,_0x9dc0fa){db[_0xc723('0x28')][_0xc723('0x29')]()['then'](function(_0x4b75f2){return db[_0xc723('0x12')][_0xc723('0x13')]({'raw':_0x2c7a19[_0xc723('0x14')]?_0x2c7a19[_0xc723('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2c7a19[_0xc723('0x14')]?_0x2c7a19[_0xc723('0x14')]['where']||null:null,'attributes':_0x2c7a19[_0xc723('0x14')]?_0x2c7a19[_0xc723('0x14')][_0xc723('0x1a')]||null:null,'limit':_0x2c7a19['options']?_0x2c7a19[_0xc723('0x14')][_0xc723('0x16')]||null:null,'include':_0x2c7a19['options']?_0x2c7a19[_0xc723('0x14')]['include']?_[_0xc723('0x18')](_0x2c7a19['options']['include'],function(_0x459cc0){return{'model':db[_0x459cc0['model']],'as':_0x459cc0['as'],'attributes':_0x459cc0['as']==='Contact'?_[_0xc723('0x30')](_0x4b75f2):_0x459cc0['attributes'],'include':_0x459cc0[_0xc723('0x17')]?_[_0xc723('0x18')](_0x459cc0[_0xc723('0x17')],function(_0x17a9a1){return{'model':db[_0x17a9a1['model']],'as':_0x17a9a1['as'],'attributes':_0x17a9a1[_0xc723('0x1a')],'include':_0x17a9a1[_0xc723('0x17')]?_[_0xc723('0x18')](_0x17a9a1['include'],function(_0x4d351b){return{'model':db[_0x4d351b['model']],'as':_0x4d351b['as'],'attributes':_0x4d351b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc723('0x1b')](function(_0x4a7e65){logger[_0xc723('0x8')]('GetCmHopper',_0x2c7a19);logger['debug'](_0xc723('0x11'),_0x2c7a19,JSON['stringify'](_0x4a7e65));_0x26a232(_0x4a7e65);})[_0xc723('0x10')](function(_0x5df523){logger[_0xc723('0xd')](_0xc723('0x11'),_0x5df523['message'],_0x2c7a19);_0x9dc0fa(_0x21dfed[_0xc723('0xd')](0x1f4,_0x5df523[_0xc723('0xf')]));});});});};exports[_0xc723('0x47')]=function(_0x5438cc){var _0x246a22=this;return new Promise(function(_0x29c6f1,_0x384778){return db[_0xc723('0x28')][_0xc723('0x48')]({'raw':!![],'where':{'phone':_0x5438cc[_0xc723('0x14')][_0xc723('0x15')][_0xc723('0x49')]},'attributes':['id',_0xc723('0x4a')],'order':[['id',_0xc723('0x4b')]]})[_0xc723('0x1b')](function(_0xdbe6c){logger['info']('getContactByPhone',_0x5438cc);logger['debug'](_0xc723('0x4c'),_0x5438cc,JSON[_0xc723('0xc')](_0xdbe6c));_0x29c6f1(_0xdbe6c);})[_0xc723('0x10')](function(_0x21b35d){logger[_0xc723('0xd')](_0xc723('0x4c'),_0x21b35d[_0xc723('0xf')],_0x5438cc);_0x384778(_0x246a22['error'](0x1f4,_0x21b35d[_0xc723('0xf')]));});});};exports[_0xc723('0x4d')]=function(_0x15d8f9){var _0x3552fe=this;return new Promise(function(_0x23f206,_0x24b6a2){return db[_0xc723('0x2a')][_0xc723('0x2b')](function(_0x45e413){return db[_0xc723('0x12')][_0xc723('0x22')]({'active':![]},{'where':{},'transaction':_0x45e413})[_0xc723('0x1b')](function(_0x27c0cb){logger['info']('ResetActiveCalls',_0x15d8f9);logger[_0xc723('0xb')]('ResetActiveCalls',_0x15d8f9,JSON[_0xc723('0xc')](_0x27c0cb));_0x23f206(_0x27c0cb);})['catch'](function(_0x50240e){logger[_0xc723('0xd')](_0xc723('0x4d'),_0x50240e['message'],_0x15d8f9);_0x24b6a2(_0x3552fe[_0xc723('0xd')](0x1f4,_0x50240e[_0xc723('0xf')]));});});});};exports[_0xc723('0x4e')]=function(_0x58247b){var _0x96a83b=this;var _0x3c07ff=_0x58247b[_0xc723('0x21')][_0xc723('0x15')][_0xc723('0x4f')];var _0x3cca88=_0x58247b[_0xc723('0x21')][_0xc723('0x15')][_0xc723('0x50')];var _0x2e04bf=_0x58247b[_0xc723('0x21')]['where'][_0xc723('0x51')];return new Promise(function(_0x9109d0,_0xb1c5b0){return db[_0xc723('0x12')][_0xc723('0x13')]({'where':{'voiceQueueId':{'$in':_0x3c07ff},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xc723('0x2a')][_0xc723('0x52')](_0xc723('0x53')+_0x3cca88+_0xc723('0x54')),'$gt':db[_0xc723('0x2a')][_0xc723('0x52')](_0xc723('0x55'))}},'UserId':{'$in':_0x2e04bf}},'include':[{'model':db['CmContact'],'as':_0xc723('0x2f')},{'model':db[_0xc723('0x56')],'as':_0xc723('0x31'),'attributes':['id',_0xc723('0x32'),_0xc723('0x33')]},{'model':db[_0xc723('0x57')],'as':'List'}]})['then'](function(_0x4b79e6){if(_0x4b79e6['length']>0x0){return db[_0xc723('0x2a')][_0xc723('0x2b')](function(_0x4c2d7a){return db[_0xc723('0x12')]['update']({'recallmeNotifiedDate':db[_0xc723('0x2a')][_0xc723('0x52')](_0xc723('0x55'))},{'where':{'id':{'$in':_[_0xc723('0x18')](_0x4b79e6,'id')}},'transaction':_0x4c2d7a})[_0xc723('0x1b')](function(){_0x9109d0(_0x4b79e6);})[_0xc723('0x10')](function(_0x104705){logger[_0xc723('0xd')](_0xc723('0x4e'),_0x104705[_0xc723('0xf')],_0x58247b);_0xb1c5b0(_0x96a83b[_0xc723('0xd')](0x1f4,_0x104705[_0xc723('0xf')]));});})[_0xc723('0x10')](function(_0x56e751){logger[_0xc723('0xd')]('CmHopperHandlePreviewRecallNotifications',_0x56e751['message'],_0x58247b);_0xb1c5b0(_0x96a83b[_0xc723('0xd')](0x1f4,_0x56e751['message']));});}else{_0x9109d0(_0x4b79e6);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3ecb99b..f350f60 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 _0x86eb=['get','isAuthenticated','index','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','post','create','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service'];(function(_0x65878,_0xf155c6){var _0x3b6dae=function(_0x140c56){while(--_0x140c56){_0x65878['push'](_0x65878['shift']());}};_0x3b6dae(++_0xf155c6);}(_0x86eb,0xa5));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0xb86e('0x0'));var router=express[_0xb86e('0x1')]();var auth=require(_0xb86e('0x2'));var controller=require('./cmHopper.controller');router[_0xb86e('0x3')]('/',auth[_0xb86e('0x4')](),controller[_0xb86e('0x5')]);router['get'](_0xb86e('0x6'),auth[_0xb86e('0x4')](),controller[_0xb86e('0x7')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0xb86e('0x8')]);router[_0xb86e('0x3')](_0xb86e('0x9'),auth[_0xb86e('0x4')](),controller[_0xb86e('0xa')]);router[_0xb86e('0x3')](_0xb86e('0xb'),auth[_0xb86e('0x4')](),controller[_0xb86e('0xc')]);router[_0xb86e('0x3')](_0xb86e('0xd'),auth[_0xb86e('0x4')](),controller['getPreviewRecall']);router[_0xb86e('0xe')]('/',auth['isAuthenticated'](),controller[_0xb86e('0xf')]);router[_0xb86e('0xe')](_0xb86e('0x10'),auth[_0xb86e('0x4')](),controller[_0xb86e('0x11')]);router['post'](_0xb86e('0x12'),auth[_0xb86e('0x4')](),controller[_0xb86e('0x13')]);router[_0xb86e('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb86e('0x15')](_0xb86e('0xb'),auth['isAuthenticated'](),controller[_0xb86e('0x16')]);module[_0xb86e('0x17')]=router; \ No newline at end of file +var _0x5616=['put','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5616,0x64));var _0x6561=function(_0x41c9d1,_0x6e896a){_0x41c9d1=_0x41c9d1-0x0;var _0x18f8fb=_0x5616[_0x41c9d1];return _0x18f8fb;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x6561('0x0'));var controller=require(_0x6561('0x1'));router[_0x6561('0x2')]('/',auth[_0x6561('0x3')](),controller[_0x6561('0x4')]);router[_0x6561('0x2')](_0x6561('0x5'),auth[_0x6561('0x3')](),controller[_0x6561('0x6')]);router['get'](_0x6561('0x7'),auth[_0x6561('0x3')](),controller[_0x6561('0x8')]);router[_0x6561('0x2')](_0x6561('0x9'),auth[_0x6561('0x3')](),controller['getTimezones']);router[_0x6561('0x2')](_0x6561('0xa'),auth['isAuthenticated'](),controller[_0x6561('0xb')]);router['get'](_0x6561('0xc'),auth['isAuthenticated'](),controller[_0x6561('0xd')]);router[_0x6561('0xe')]('/',auth[_0x6561('0x3')](),controller[_0x6561('0xf')]);router[_0x6561('0xe')](_0x6561('0x10'),auth['isAuthenticated'](),controller[_0x6561('0x11')]);router[_0x6561('0xe')](_0x6561('0x12'),auth[_0x6561('0x3')](),controller[_0x6561('0x13')]);router[_0x6561('0x14')](_0x6561('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6561('0x15')](_0x6561('0xa'),auth[_0x6561('0x3')](),controller[_0x6561('0x16')]);module[_0x6561('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index aa375a9..2d566e9 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4266=['YYYY-MM-DD\x20HH:mm:ss','exports','INTEGER','DATE'];(function(_0x40a8b2,_0xa2c988){var _0x272a5d=function(_0x31de50){while(--_0x31de50){_0x40a8b2['push'](_0x40a8b2['shift']());}};_0x272a5d(++_0xa2c988);}(_0x4266,0xb1));var _0x6426=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4266[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6426('0x0')]={'CmHopperId':{'type':Sequelize[_0x6426('0x1')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6426('0x2')],'defaultValue':moment()['format'](_0x6426('0x3'))},'countbusyretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6426('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcba9=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','STRING','INTEGER','format'];(function(_0x544e54,_0x32e4ae){var _0x397593=function(_0x25805b){while(--_0x25805b){_0x544e54['push'](_0x544e54['shift']());}};_0x397593(++_0x32e4ae);}(_0xcba9,0x175));var _0x9cba=function(_0x2e6e12,_0x238fc4){_0x2e6e12=_0x2e6e12-0x0;var _0x4bebf6=_0xcba9[_0x2e6e12];return _0x4bebf6;};'use strict';var moment=require(_0x9cba('0x0'));var Sequelize=require(_0x9cba('0x1'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9cba('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9cba('0x4')](_0x9cba('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9cba('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 9cdf9ce..e7c8d5f 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36da=['set','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','sendStatus','error','name','send','index','map','CmHopperAdditionalPhone','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','type','merge','options','include','rows','show','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x31f55c,_0xb08a31){var _0x2a7c5f=function(_0x21e555){while(--_0x21e555){_0x31f55c['push'](_0x31f55c['shift']());}};_0x2a7c5f(++_0xb08a31);}(_0x36da,0xd7));var _0xa36d=function(_0x91e5da,_0x25ce34){_0x91e5da=_0x91e5da-0x0;var _0x5533f3=_0x36da[_0x91e5da];return _0x5533f3;};'use strict';var emlformat=require(_0xa36d('0x0'));var rimraf=require(_0xa36d('0x1'));var zipdir=require(_0xa36d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa36d('0x3'));var moment=require('moment');var BPromise=require(_0xa36d('0x4'));var Mustache=require(_0xa36d('0x5'));var util=require(_0xa36d('0x6'));var path=require(_0xa36d('0x7'));var sox=require(_0xa36d('0x8'));var csv=require(_0xa36d('0x9'));var ejs=require(_0xa36d('0xa'));var fs=require('fs');var fs_extra=require(_0xa36d('0xb'));var _=require(_0xa36d('0xc'));var squel=require(_0xa36d('0xd'));var crypto=require(_0xa36d('0xe'));var jsforce=require(_0xa36d('0xf'));var deskjs=require(_0xa36d('0x10'));var toCsv=require(_0xa36d('0x9'));var querystring=require('querystring');var Papa=require(_0xa36d('0x11'));var Redis=require('ioredis');var authService=require(_0xa36d('0x12'));var qs=require(_0xa36d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa36d('0x14'));var utils=require('../../config/utils');var config=require(_0xa36d('0x15'));var licenseUtil=require(_0xa36d('0x16'));var db=require(_0xa36d('0x17'))['db'];function respondWithStatusCode(_0x1b8e50,_0x583350){_0x583350=_0x583350||0xcc;return function(_0x150c84){if(_0x150c84){return _0x1b8e50['sendStatus'](_0x583350);}return _0x1b8e50[_0xa36d('0x18')](_0x583350)[_0xa36d('0x19')]();};}function respondWithResult(_0x44d11e,_0xee0057){_0xee0057=_0xee0057||0xc8;return function(_0xc111ad){if(_0xc111ad){return _0x44d11e['status'](_0xee0057)[_0xa36d('0x1a')](_0xc111ad);}};}function respondWithFilteredResult(_0x302454,_0x1884e3){return function(_0x1ced84){if(_0x1ced84){var _0x333517=typeof _0x1884e3[_0xa36d('0x1b')]===_0xa36d('0x1c')&&typeof _0x1884e3[_0xa36d('0x1d')]===_0xa36d('0x1c');var _0x23ec3f=_0x1ced84['count'];var _0x1a37f6=_0x333517?0x0:_0x1884e3[_0xa36d('0x1b')];var _0x182109=_0x333517?_0x1ced84[_0xa36d('0x1e')]:_0x1884e3['offset']+_0x1884e3[_0xa36d('0x1d')];var _0x295bc8;if(_0x182109>=_0x23ec3f){_0x182109=_0x23ec3f;_0x295bc8=0xc8;}else{_0x295bc8=0xce;}_0x302454[_0xa36d('0x18')](_0x295bc8);return _0x302454[_0xa36d('0x1f')]('Content-Range',_0x1a37f6+'-'+_0x182109+'/'+_0x23ec3f)[_0xa36d('0x1a')](_0x1ced84);}return null;};}function patchUpdates(_0x5deee9){return function(_0x4c46bd){try{jsonpatch['apply'](_0x4c46bd,_0x5deee9,!![]);}catch(_0x36e43d){return BPromise[_0xa36d('0x20')](_0x36e43d);}return _0x4c46bd[_0xa36d('0x21')]();};}function saveUpdates(_0x3e3e9d,_0x247ed2){return function(_0x42f1d4){if(_0x42f1d4){return _0x42f1d4[_0xa36d('0x22')](_0x3e3e9d)[_0xa36d('0x23')](function(_0x5aef46){return _0x5aef46;});}return null;};}function removeEntity(_0x5adb2d,_0x5e9c79){return function(_0x419d5e){if(_0x419d5e){return _0x419d5e['destroy']()[_0xa36d('0x23')](function(){var _0x5a4151=_0x419d5e[_0xa36d('0x24')]({'plain':!![]});var _0x179078=_0xa36d('0x25');return db[_0xa36d('0x26')]['destroy']({'where':{'type':_0x179078,'resourceId':_0x5a4151['id']}})[_0xa36d('0x23')](function(){return _0x419d5e;});})[_0xa36d('0x23')](function(){_0x5adb2d[_0xa36d('0x18')](0xcc)[_0xa36d('0x19')]();});}};}function handleEntityNotFound(_0x680ca6,_0x3c66bd){return function(_0x16b327){if(!_0x16b327){_0x680ca6[_0xa36d('0x27')](0x194);}return _0x16b327;};}function handleError(_0x4a6187,_0x2dcc3a){_0x2dcc3a=_0x2dcc3a||0x1f4;return function(_0x3cec98){logger[_0xa36d('0x28')](_0x3cec98['stack']);if(_0x3cec98[_0xa36d('0x29')]){delete _0x3cec98[_0xa36d('0x29')];}_0x4a6187[_0xa36d('0x18')](_0x2dcc3a)[_0xa36d('0x2a')](_0x3cec98);};}exports[_0xa36d('0x2b')]=function(_0x309dca,_0x32e4eb){var _0x524cd9={},_0x407c37={},_0x3c05a4={'count':0x0,'rows':[]};var _0x124928=_[_0xa36d('0x2c')](db[_0xa36d('0x2d')]['rawAttributes'],function(_0x2924e6){return{'name':_0x2924e6[_0xa36d('0x2e')],'type':_0x2924e6['type'][_0xa36d('0x2f')]};});_0x407c37[_0xa36d('0x30')]=_['map'](_0x124928,_0xa36d('0x29'));_0x407c37['query']=_[_0xa36d('0x31')](_0x309dca[_0xa36d('0x32')]);_0x407c37[_0xa36d('0x33')]=_[_0xa36d('0x34')](_0x407c37['model'],_0x407c37[_0xa36d('0x32')]);_0x524cd9[_0xa36d('0x35')]=_['intersection'](_0x407c37[_0xa36d('0x30')],qs[_0xa36d('0x36')](_0x309dca['query'][_0xa36d('0x36')]));_0x524cd9[_0xa36d('0x35')]=_0x524cd9[_0xa36d('0x35')][_0xa36d('0x37')]?_0x524cd9[_0xa36d('0x35')]:_0x407c37[_0xa36d('0x30')];if(!_0x309dca['query'][_0xa36d('0x38')]('nolimit')){_0x524cd9[_0xa36d('0x1d')]=qs[_0xa36d('0x1d')](_0x309dca[_0xa36d('0x32')][_0xa36d('0x1d')]);_0x524cd9['offset']=qs[_0xa36d('0x1b')](_0x309dca[_0xa36d('0x32')][_0xa36d('0x1b')]);}_0x524cd9[_0xa36d('0x39')]=qs['sort'](_0x309dca['query']['sort']);_0x524cd9[_0xa36d('0x3a')]=qs[_0xa36d('0x33')](_[_0xa36d('0x3b')](_0x309dca[_0xa36d('0x32')],_0x407c37['filters']),_0x124928);if(_0x309dca[_0xa36d('0x32')][_0xa36d('0x3c')]){_0x524cd9[_0xa36d('0x3a')]=_['merge'](_0x524cd9[_0xa36d('0x3a')],{'$or':_[_0xa36d('0x2c')](_0x124928,function(_0x1ff306){if(_0x1ff306[_0xa36d('0x3d')]!=='VIRTUAL'){var _0x301a51={};_0x301a51[_0x1ff306['name']]={'$like':'%'+_0x309dca[_0xa36d('0x32')][_0xa36d('0x3c')]+'%'};return _0x301a51;}})});}_0x524cd9=_[_0xa36d('0x3e')]({},_0x524cd9,_0x309dca[_0xa36d('0x3f')]);var _0x1d3e22={'where':_0x524cd9[_0xa36d('0x3a')]};return db[_0xa36d('0x2d')][_0xa36d('0x1e')](_0x1d3e22)['then'](function(_0x1ace73){_0x3c05a4[_0xa36d('0x1e')]=_0x1ace73;if(_0x309dca[_0xa36d('0x32')]['includeAll']){_0x524cd9[_0xa36d('0x40')]=[{'all':!![]}];}return db[_0xa36d('0x2d')]['findAll'](_0x524cd9);})['then'](function(_0xa12f85){_0x3c05a4[_0xa36d('0x41')]=_0xa12f85;return _0x3c05a4;})[_0xa36d('0x23')](respondWithFilteredResult(_0x32e4eb,_0x524cd9))['catch'](handleError(_0x32e4eb,null));};exports[_0xa36d('0x42')]=function(_0x216a50,_0x5efa88){var _0x1de420={'raw':!![],'where':{'id':_0x216a50['params']['id']}},_0x1eea10={};_0x1eea10[_0xa36d('0x30')]=_[_0xa36d('0x31')](db[_0xa36d('0x2d')][_0xa36d('0x43')]);_0x1eea10[_0xa36d('0x32')]=_[_0xa36d('0x31')](_0x216a50[_0xa36d('0x32')]);_0x1eea10[_0xa36d('0x33')]=_['intersection'](_0x1eea10[_0xa36d('0x30')],_0x1eea10[_0xa36d('0x32')]);_0x1de420[_0xa36d('0x35')]=_['intersection'](_0x1eea10[_0xa36d('0x30')],qs[_0xa36d('0x36')](_0x216a50[_0xa36d('0x32')][_0xa36d('0x36')]));_0x1de420[_0xa36d('0x35')]=_0x1de420[_0xa36d('0x35')][_0xa36d('0x37')]?_0x1de420[_0xa36d('0x35')]:_0x1eea10[_0xa36d('0x30')];if(_0x216a50[_0xa36d('0x32')][_0xa36d('0x44')]){_0x1de420[_0xa36d('0x40')]=[{'all':!![]}];}_0x1de420=_[_0xa36d('0x3e')]({},_0x1de420,_0x216a50[_0xa36d('0x3f')]);return db['CmHopperAdditionalPhone'][_0xa36d('0x45')](_0x1de420)[_0xa36d('0x23')](handleEntityNotFound(_0x5efa88,null))[_0xa36d('0x23')](respondWithResult(_0x5efa88,null))[_0xa36d('0x46')](handleError(_0x5efa88,null));};exports[_0xa36d('0x47')]=function(_0x805b85,_0x16f4fb){return db[_0xa36d('0x2d')][_0xa36d('0x47')](_0x805b85[_0xa36d('0x48')],{})[_0xa36d('0x23')](function(_0x375548){var _0x37ab15=_0x805b85[_0xa36d('0x49')]['get']({'plain':!![]});if(!_0x37ab15)throw new Error(_0xa36d('0x4a'));if(_0x37ab15[_0xa36d('0x4b')]===_0xa36d('0x49')){var _0x1df883=_0x375548[_0xa36d('0x24')]({'plain':!![]});var _0x3c6503=_0xa36d('0x25');return db[_0xa36d('0x4c')][_0xa36d('0x45')]({'where':{'name':_0x3c6503,'userProfileId':_0x37ab15[_0xa36d('0x4d')]},'raw':!![]})[_0xa36d('0x23')](function(_0x54f47e){if(_0x54f47e&&_0x54f47e[_0xa36d('0x4e')]===0x0){return db[_0xa36d('0x26')]['create']({'name':_0x1df883[_0xa36d('0x29')],'resourceId':_0x1df883['id'],'type':_0x54f47e[_0xa36d('0x29')],'sectionId':_0x54f47e['id']},{})[_0xa36d('0x23')](function(){return _0x375548;});}else{return _0x375548;}})[_0xa36d('0x46')](function(_0x34f0de){logger[_0xa36d('0x28')](_0xa36d('0x4f'),_0x34f0de);throw _0x34f0de;});}return _0x375548;})[_0xa36d('0x23')](respondWithResult(_0x16f4fb,0xc9))[_0xa36d('0x46')](handleError(_0x16f4fb,null));};exports[_0xa36d('0x22')]=function(_0x49a338,_0x3dfd62){if(_0x49a338[_0xa36d('0x48')]['id']){delete _0x49a338[_0xa36d('0x48')]['id'];}return db[_0xa36d('0x2d')]['find']({'where':{'id':_0x49a338[_0xa36d('0x50')]['id']}})[_0xa36d('0x23')](handleEntityNotFound(_0x3dfd62,null))[_0xa36d('0x23')](saveUpdates(_0x49a338[_0xa36d('0x48')],null))[_0xa36d('0x23')](respondWithResult(_0x3dfd62,null))['catch'](handleError(_0x3dfd62,null));};exports[_0xa36d('0x51')]=function(_0x5b906d,_0x3df4be){return db[_0xa36d('0x2d')][_0xa36d('0x45')]({'where':{'id':_0x5b906d[_0xa36d('0x50')]['id']}})[_0xa36d('0x23')](handleEntityNotFound(_0x3df4be,null))[_0xa36d('0x23')](removeEntity(_0x3df4be,null))['catch'](handleError(_0x3df4be,null));}; \ No newline at end of file +var _0x12c1=['path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5dc0c5,_0x5a90bd){var _0x573bce=function(_0x538a59){while(--_0x538a59){_0x5dc0c5['push'](_0x5dc0c5['shift']());}};_0x573bce(++_0x5a90bd);}(_0x12c1,0xd8));var _0x112c=function(_0x1a3a8d,_0x4b3754){_0x1a3a8d=_0x1a3a8d-0x0;var _0x2d5e3f=_0x12c1[_0x1a3a8d];return _0x2d5e3f;};'use strict';var emlformat=require(_0x112c('0x0'));var rimraf=require(_0x112c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x112c('0x2'));var rp=require(_0x112c('0x3'));var moment=require(_0x112c('0x4'));var BPromise=require(_0x112c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x112c('0x6'));var sox=require(_0x112c('0x7'));var csv=require(_0x112c('0x8'));var ejs=require(_0x112c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x112c('0xa'));var squel=require(_0x112c('0xb'));var crypto=require(_0x112c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x112c('0x8'));var querystring=require(_0x112c('0xd'));var Papa=require(_0x112c('0xe'));var Redis=require('ioredis');var authService=require(_0x112c('0xf'));var qs=require(_0x112c('0x10'));var as=require(_0x112c('0x11'));var hardwareService=require(_0x112c('0x12'));var logger=require('../../config/logger')(_0x112c('0x13'));var utils=require('../../config/utils');var config=require(_0x112c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b78e,_0x3d83ce){_0x3d83ce=_0x3d83ce||0xcc;return function(_0x363659){if(_0x363659){return _0x49b78e['sendStatus'](_0x3d83ce);}return _0x49b78e[_0x112c('0x15')](_0x3d83ce)[_0x112c('0x16')]();};}function respondWithResult(_0x182dcb,_0x202a5e){_0x202a5e=_0x202a5e||0xc8;return function(_0x366310){if(_0x366310){return _0x182dcb[_0x112c('0x15')](_0x202a5e)[_0x112c('0x17')](_0x366310);}};}function respondWithFilteredResult(_0x22f94a,_0x563a25){return function(_0x4b8eb0){if(_0x4b8eb0){var _0x236154=typeof _0x563a25[_0x112c('0x18')]===_0x112c('0x19')&&typeof _0x563a25[_0x112c('0x1a')]===_0x112c('0x19');var _0xcd2d27=_0x4b8eb0[_0x112c('0x1b')];var _0x91d603=_0x236154?0x0:_0x563a25['offset'];var _0x2a23f1=_0x236154?_0x4b8eb0[_0x112c('0x1b')]:_0x563a25[_0x112c('0x18')]+_0x563a25[_0x112c('0x1a')];var _0x333cf2;if(_0x2a23f1>=_0xcd2d27){_0x2a23f1=_0xcd2d27;_0x333cf2=0xc8;}else{_0x333cf2=0xce;}_0x22f94a['status'](_0x333cf2);return _0x22f94a[_0x112c('0x1c')](_0x112c('0x1d'),_0x91d603+'-'+_0x2a23f1+'/'+_0xcd2d27)['json'](_0x4b8eb0);}return null;};}function patchUpdates(_0x55c50f){return function(_0x3d427f){try{jsonpatch[_0x112c('0x1e')](_0x3d427f,_0x55c50f,!![]);}catch(_0x6f3388){return BPromise['reject'](_0x6f3388);}return _0x3d427f[_0x112c('0x1f')]();};}function saveUpdates(_0x3e92b1,_0x155f26){return function(_0xb1b974){if(_0xb1b974){return _0xb1b974[_0x112c('0x20')](_0x3e92b1)[_0x112c('0x21')](function(_0x9c4f4e){return _0x9c4f4e;});}return null;};}function removeEntity(_0x1a15ea,_0x2375e9){return function(_0x2dd1fd){if(_0x2dd1fd){return _0x2dd1fd['destroy']()['then'](function(){var _0x674c70=_0x2dd1fd[_0x112c('0x22')]({'plain':!![]});var _0x4f11f3='CmHopperAdditionalPhones';return db[_0x112c('0x23')][_0x112c('0x24')]({'where':{'type':_0x4f11f3,'resourceId':_0x674c70['id']}})[_0x112c('0x21')](function(){return _0x2dd1fd;});})[_0x112c('0x21')](function(){_0x1a15ea[_0x112c('0x15')](0xcc)[_0x112c('0x16')]();});}};}function handleEntityNotFound(_0x23d881,_0x41a7dc){return function(_0x4dd46e){if(!_0x4dd46e){_0x23d881[_0x112c('0x25')](0x194);}return _0x4dd46e;};}function handleError(_0x232386,_0x2576df){_0x2576df=_0x2576df||0x1f4;return function(_0x38f66a){logger[_0x112c('0x26')](_0x38f66a[_0x112c('0x27')]);if(_0x38f66a['name']){delete _0x38f66a[_0x112c('0x28')];}_0x232386[_0x112c('0x15')](_0x2576df)['send'](_0x38f66a);};}exports[_0x112c('0x29')]=function(_0x388bad,_0x32922c){var _0x243e54={},_0x2e596c={},_0x3e3a63={'count':0x0,'rows':[]};var _0x3bdf0d=_[_0x112c('0x2a')](db[_0x112c('0x2b')][_0x112c('0x2c')],function(_0xe807){return{'name':_0xe807[_0x112c('0x2d')],'type':_0xe807[_0x112c('0x2e')]['key']};});_0x2e596c[_0x112c('0x2f')]=_[_0x112c('0x2a')](_0x3bdf0d,'name');_0x2e596c[_0x112c('0x30')]=_[_0x112c('0x31')](_0x388bad['query']);_0x2e596c[_0x112c('0x32')]=_['intersection'](_0x2e596c[_0x112c('0x2f')],_0x2e596c[_0x112c('0x30')]);_0x243e54[_0x112c('0x33')]=_[_0x112c('0x34')](_0x2e596c[_0x112c('0x2f')],qs['fields'](_0x388bad[_0x112c('0x30')][_0x112c('0x35')]));_0x243e54[_0x112c('0x33')]=_0x243e54[_0x112c('0x33')]['length']?_0x243e54[_0x112c('0x33')]:_0x2e596c[_0x112c('0x2f')];if(!_0x388bad[_0x112c('0x30')]['hasOwnProperty']('nolimit')){_0x243e54[_0x112c('0x1a')]=qs[_0x112c('0x1a')](_0x388bad[_0x112c('0x30')]['limit']);_0x243e54[_0x112c('0x18')]=qs[_0x112c('0x18')](_0x388bad['query'][_0x112c('0x18')]);}_0x243e54['order']=qs['sort'](_0x388bad['query']['sort']);_0x243e54[_0x112c('0x36')]=qs['filters'](_[_0x112c('0x37')](_0x388bad[_0x112c('0x30')],_0x2e596c['filters']),_0x3bdf0d);if(_0x388bad[_0x112c('0x30')][_0x112c('0x38')]){_0x243e54[_0x112c('0x36')]=_['merge'](_0x243e54[_0x112c('0x36')],{'$or':_[_0x112c('0x2a')](_0x3bdf0d,function(_0x19bbdf){if(_0x19bbdf[_0x112c('0x2e')]!==_0x112c('0x39')){var _0x4085b8={};_0x4085b8[_0x19bbdf[_0x112c('0x28')]]={'$like':'%'+_0x388bad[_0x112c('0x30')][_0x112c('0x38')]+'%'};return _0x4085b8;}})});}_0x243e54=_[_0x112c('0x3a')]({},_0x243e54,_0x388bad[_0x112c('0x3b')]);var _0x344a57={'where':_0x243e54[_0x112c('0x36')]};return db[_0x112c('0x2b')]['count'](_0x344a57)[_0x112c('0x21')](function(_0x2e1092){_0x3e3a63[_0x112c('0x1b')]=_0x2e1092;if(_0x388bad[_0x112c('0x30')][_0x112c('0x3c')]){_0x243e54['include']=[{'all':!![]}];}return db[_0x112c('0x2b')]['findAll'](_0x243e54);})[_0x112c('0x21')](function(_0x3f4cbf){_0x3e3a63[_0x112c('0x3d')]=_0x3f4cbf;return _0x3e3a63;})[_0x112c('0x21')](respondWithFilteredResult(_0x32922c,_0x243e54))[_0x112c('0x3e')](handleError(_0x32922c,null));};exports['show']=function(_0x3e1dc7,_0x5e3127){var _0x4d32b1={'raw':!![],'where':{'id':_0x3e1dc7[_0x112c('0x3f')]['id']}},_0x2f96e1={};_0x2f96e1[_0x112c('0x2f')]=_[_0x112c('0x31')](db[_0x112c('0x2b')][_0x112c('0x2c')]);_0x2f96e1[_0x112c('0x30')]=_['keys'](_0x3e1dc7[_0x112c('0x30')]);_0x2f96e1[_0x112c('0x32')]=_[_0x112c('0x34')](_0x2f96e1[_0x112c('0x2f')],_0x2f96e1['query']);_0x4d32b1[_0x112c('0x33')]=_[_0x112c('0x34')](_0x2f96e1[_0x112c('0x2f')],qs[_0x112c('0x35')](_0x3e1dc7[_0x112c('0x30')][_0x112c('0x35')]));_0x4d32b1['attributes']=_0x4d32b1[_0x112c('0x33')][_0x112c('0x40')]?_0x4d32b1[_0x112c('0x33')]:_0x2f96e1[_0x112c('0x2f')];if(_0x3e1dc7[_0x112c('0x30')][_0x112c('0x3c')]){_0x4d32b1[_0x112c('0x41')]=[{'all':!![]}];}_0x4d32b1=_[_0x112c('0x3a')]({},_0x4d32b1,_0x3e1dc7[_0x112c('0x3b')]);return db[_0x112c('0x2b')][_0x112c('0x42')](_0x4d32b1)['then'](handleEntityNotFound(_0x5e3127,null))['then'](respondWithResult(_0x5e3127,null))['catch'](handleError(_0x5e3127,null));};exports['create']=function(_0x5093cc,_0x336286){return db[_0x112c('0x2b')][_0x112c('0x43')](_0x5093cc[_0x112c('0x44')],{})[_0x112c('0x21')](function(_0xbdb0b2){var _0x2d9bad=_0x5093cc[_0x112c('0x45')][_0x112c('0x22')]({'plain':!![]});if(!_0x2d9bad)throw new Error(_0x112c('0x46'));if(_0x2d9bad[_0x112c('0x47')]===_0x112c('0x45')){var _0x28b605=_0xbdb0b2[_0x112c('0x22')]({'plain':!![]});var _0x34f603=_0x112c('0x48');return db['UserProfileSection'][_0x112c('0x42')]({'where':{'name':_0x34f603,'userProfileId':_0x2d9bad[_0x112c('0x49')]},'raw':!![]})[_0x112c('0x21')](function(_0x2235e0){if(_0x2235e0&&_0x2235e0['autoAssociation']===0x0){return db[_0x112c('0x23')][_0x112c('0x43')]({'name':_0x28b605['name'],'resourceId':_0x28b605['id'],'type':_0x2235e0[_0x112c('0x28')],'sectionId':_0x2235e0['id']},{})['then'](function(){return _0xbdb0b2;});}else{return _0xbdb0b2;}})[_0x112c('0x3e')](function(_0x23679b){logger[_0x112c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23679b);throw _0x23679b;});}return _0xbdb0b2;})['then'](respondWithResult(_0x336286,0xc9))[_0x112c('0x3e')](handleError(_0x336286,null));};exports[_0x112c('0x20')]=function(_0xce23c,_0x261546){if(_0xce23c[_0x112c('0x44')]['id']){delete _0xce23c['body']['id'];}return db[_0x112c('0x2b')][_0x112c('0x42')]({'where':{'id':_0xce23c['params']['id']}})[_0x112c('0x21')](handleEntityNotFound(_0x261546,null))[_0x112c('0x21')](saveUpdates(_0xce23c['body'],null))[_0x112c('0x21')](respondWithResult(_0x261546,null))[_0x112c('0x3e')](handleError(_0x261546,null));};exports['destroy']=function(_0x4a4ad9,_0x2c055a){return db[_0x112c('0x2b')][_0x112c('0x42')]({'where':{'id':_0x4a4ad9[_0x112c('0x3f')]['id']}})[_0x112c('0x21')](handleEntityNotFound(_0x2c055a,null))['then'](removeEntity(_0x2c055a,null))['catch'](handleError(_0x2c055a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index a4e45fa..44bce98 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc433=['cm_hopper_additional_phones','lodash','../../config/logger','api','request-promise','rimraf','./cmHopperAdditionalPhone.attributes','define'];(function(_0x5d8698,_0x4c4156){var _0x2e4c0b=function(_0x2ad47c){while(--_0x2ad47c){_0x5d8698['push'](_0x5d8698['shift']());}};_0x2e4c0b(++_0x4c4156);}(_0xc433,0x1b1));var _0x3c43=function(_0x3eb2ea,_0x401c21){_0x3eb2ea=_0x3eb2ea-0x0;var _0x516fe4=_0xc433[_0x3eb2ea];return _0x516fe4;};'use strict';var _=require(_0x3c43('0x0'));var util=require('util');var logger=require(_0x3c43('0x1'))(_0x3c43('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c43('0x4'));var config=require('../../config/environment');var attributes=require(_0x3c43('0x5'));module['exports']=function(_0xa78ceb,_0x3638cd){return _0xa78ceb[_0x3c43('0x6')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x3c43('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0174=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0174,0x12a));var _0x4017=function(_0x26d521,_0x3280c0){_0x26d521=_0x26d521-0x0;var _0x5cfce2=_0x0174[_0x26d521];return _0x5cfce2;};'use strict';var _=require(_0x4017('0x0'));var util=require(_0x4017('0x1'));var logger=require('../../config/logger')(_0x4017('0x2'));var moment=require(_0x4017('0x3'));var BPromise=require(_0x4017('0x4'));var rp=require(_0x4017('0x5'));var fs=require('fs');var path=require(_0x4017('0x6'));var rimraf=require(_0x4017('0x7'));var config=require(_0x4017('0x8'));var attributes=require(_0x4017('0x9'));module[_0x4017('0xa')]=function(_0x1270e5,_0x22edfc){return _0x1270e5[_0x4017('0xb')](_0x4017('0xc'),attributes,{'tableName':_0x4017('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 4442d73..7570800 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4876=['result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countcongestionretry','countdropretry','entity','dialGlobalMaxRetry','catch','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','phone','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4876,0x181));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6487('0x0'));var moment=require(_0x6487('0x1'));var BPromise=require('bluebird');var rs=require(_0x6487('0x2'));var fs=require('fs');var Redis=require(_0x6487('0x3'));var db=require(_0x6487('0x4'))['db'];var utils=require(_0x6487('0x5'));var logger=require(_0x6487('0x6'))('rpc');var config=require(_0x6487('0x7'));var jayson=require(_0x6487('0x8'));var client=jayson[_0x6487('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a53c,_0x491ae8,_0x531445){return new BPromise(function(_0x32ed7b,_0x2371ad){return client[_0x6487('0xa')](_0x57a53c,_0x531445)[_0x6487('0xb')](function(_0x2eaea5){logger[_0x6487('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x491ae8,_0x6487('0xd'));logger[_0x6487('0xe')](_0x6487('0xf'),_0x491ae8,_0x6487('0xd'),JSON[_0x6487('0x10')](_0x2eaea5));if(_0x2eaea5['error']){if(_0x2eaea5[_0x6487('0x11')][_0x6487('0x12')]===0x1f4){logger[_0x6487('0x11')](_0x6487('0x13'),_0x491ae8,_0x2eaea5['error'][_0x6487('0x14')]);return _0x2371ad(_0x2eaea5[_0x6487('0x11')]['message']);}logger[_0x6487('0x11')](_0x6487('0x13'),_0x491ae8,_0x2eaea5[_0x6487('0x11')]['message']);return _0x32ed7b(_0x2eaea5['error'][_0x6487('0x14')]);}else{logger[_0x6487('0xc')](_0x6487('0x13'),_0x491ae8,_0x6487('0xd'));_0x32ed7b(_0x2eaea5[_0x6487('0x15')][_0x6487('0x14')]);}})['catch'](function(_0x1e5667){logger[_0x6487('0x11')](_0x6487('0x13'),_0x491ae8,_0x1e5667);_0x2371ad(_0x1e5667);});});}exports[_0x6487('0x16')]=function(_0x674683){var _0x3d0ed5=this;return new Promise(function(_0x1b3ec8,_0x5bb553){return db[_0x6487('0x17')][_0x6487('0x18')]({'raw':!![],'where':{'ContactId':_0x674683[_0x6487('0x19')][_0x6487('0x1a')],'ListId':_0x674683[_0x6487('0x19')][_0x6487('0x1b')],'VoiceQueueId':_0x674683[_0x6487('0x19')][_0x6487('0x1c')]===undefined?null:_0x674683[_0x6487('0x19')][_0x6487('0x1c')],'CampaignId':_0x674683[_0x6487('0x19')][_0x6487('0x1d')]===undefined?null:_0x674683[_0x6487('0x19')][_0x6487('0x1d')]}})[_0x6487('0xb')](function(_0x4887b3){if(_0x4887b3!=null){return db[_0x6487('0x1e')][_0x6487('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4887b3['id'],'OrderBy':{'$gt':_0x4887b3[_0x6487('0x1f')]}},'order':[[_0x6487('0x1f'),_0x6487('0x20')]]})[_0x6487('0xb')](function(_0x8644d0){var _0x23cf6f=0x0;if(_0x8644d0){if(_0x8644d0[_0x6487('0x21')]+_0x8644d0['countcongestionretry']+_0x8644d0[_0x6487('0x22')]+_0x8644d0[_0x6487('0x23')]+_0x8644d0['countdropretry']+_0x8644d0[_0x6487('0x24')]+_0x8644d0[_0x6487('0x25')]+_0x8644d0[_0x6487('0x26')]<_0x674683['entity']['dialGlobalMaxRetry'])_0x23cf6f=0x1;_0x1b3ec8({'additional':_0x23cf6f});}else{return db[_0x6487('0x1e')][_0x6487('0x18')]({'raw':!![],'where':{'CmHopperId':_0x4887b3['id']},'order':[[_0x6487('0x1f'),'ASC']]})[_0x6487('0xb')](function(_0x18e16e){var _0x13f0c9=0x0;if(_0x18e16e){if(_0x18e16e[_0x6487('0x21')]+_0x18e16e[_0x6487('0x27')]+_0x18e16e[_0x6487('0x22')]+_0x18e16e['countnosuchnumberretry']+_0x18e16e[_0x6487('0x28')]+_0x18e16e['countabandonedretry']+_0x18e16e[_0x6487('0x25')]+_0x18e16e[_0x6487('0x26')]<_0x674683[_0x6487('0x29')][_0x6487('0x2a')])_0x13f0c9=0x1;_0x1b3ec8({'additional':_0x13f0c9});}else{_0x1b3ec8({'additional':0x0});}})[_0x6487('0x2b')](function(_0x242ffc){logger['error'](_0x6487('0x16'),_0x242ffc['message']);_0x5bb553(_0x3d0ed5[_0x6487('0x11')](0x1f4,_0x242ffc[_0x6487('0x14')]));});}})[_0x6487('0x2b')](function(_0x4baff2){logger['error']('VerifyAdditionalPhones',_0x4baff2['message']);_0x5bb553(_0x3d0ed5[_0x6487('0x11')](0x1f4,_0x4baff2[_0x6487('0x14')]));});}else _0x1b3ec8({'additional':0x0});});});};exports[_0x6487('0x2c')]=function(_0x48ad66){var _0x9939f7=this;return new Promise(function(_0x5cdd55,_0x2832c5){return db[_0x6487('0x17')][_0x6487('0x18')]({'raw':!![],'where':{'ContactId':_0x48ad66[_0x6487('0x19')][_0x6487('0x1a')],'ListId':_0x48ad66[_0x6487('0x19')]['ListId'],'VoiceQueueId':_0x48ad66[_0x6487('0x19')]['VoiceQueueId']===undefined?null:_0x48ad66[_0x6487('0x19')]['VoiceQueueId'],'CampaignId':_0x48ad66[_0x6487('0x19')][_0x6487('0x1d')]===undefined?null:_0x48ad66[_0x6487('0x19')][_0x6487('0x1d')]}})[_0x6487('0xb')](function(_0x50df50){if(_0x50df50!=null){return db[_0x6487('0x1e')][_0x6487('0x18')]({'raw':!![],'where':{'CmHopperId':_0x50df50['id'],'OrderBy':{'$gte':_0x50df50[_0x6487('0x1f')]}},'order':[[_0x6487('0x1f'),'ASC']]})[_0x6487('0xb')](function(_0x15dc1d){if(_0x15dc1d)return activateAdditionalPhone(_0x50df50,_0x48ad66[_0x6487('0x19')],_0x15dc1d,_0x48ad66[_0x6487('0x2d')],_0x48ad66[_0x6487('0x2e')])['then'](function(_0xcbc165){_0x5cdd55(_0xcbc165);});else{return db[_0x6487('0x1e')][_0x6487('0x18')]({'raw':!![],'where':{'CmHopperId':_0x50df50['id']},'order':[[_0x6487('0x1f'),_0x6487('0x20')]]})[_0x6487('0xb')](function(_0x477989){if(_0x477989)return activateAdditionalPhone(_0x50df50,_0x48ad66[_0x6487('0x19')],_0x477989,_0x48ad66[_0x6487('0x2d')],_0x48ad66[_0x6487('0x2e')])[_0x6487('0xb')](function(_0x1fd827){_0x5cdd55(_0x1fd827);});else{_0x5cdd55({'id':_0x50df50['id'],'phone':''});}})[_0x6487('0x2b')](function(_0x35c849){logger['error'](_0x6487('0x16'),_0x35c849[_0x6487('0x14')]);_0x2832c5(_0x9939f7['error'](0x1f4,_0x35c849[_0x6487('0x14')]));});}})['catch'](function(_0x3b0870){logger[_0x6487('0x11')](_0x6487('0x16'),_0x3b0870[_0x6487('0x14')]);_0x2832c5(_0x9939f7[_0x6487('0x11')](0x1f4,_0x3b0870[_0x6487('0x14')]));});}else _0x5cdd55(0x1);});});};function activateAdditionalPhone(_0x91c99f,_0x2ccb06,_0x645312,_0x58bdec,_0x144aff){return new Promise(function(_0x5711d7,_0x4e6d21){var _0xa2ed07;if(_[_0x6487('0x2f')](_0x645312['scheduledat'])){_0x645312[_0x6487('0x30')]=moment();}if(moment()>moment(_0x645312[_0x6487('0x30')])){_0xa2ed07=moment()['add'](_0x144aff||0x3,_0x6487('0x31'));}else{if(_0x645312[_0x6487('0x1f')]==0x0){_0xa2ed07=moment(_0x645312[_0x6487('0x30')]);}else{_0xa2ed07=moment()[_0x6487('0x32')](_0x144aff||0x3,'minutes');}}if(_[_0x6487('0x2f')](_0xa2ed07)){_0xa2ed07=moment()[_0x6487('0x32')](_0x144aff||0x3,_0x6487('0x31'));}var _0x10031c={'phone':_0x91c99f[_0x6487('0x33')],'active':0x0,'OrderBy':_[_0x6487('0x2f')](_0x91c99f['OrderBy'])?0x0:_0x91c99f[_0x6487('0x1f')],'scheduledat':moment()[_0x6487('0x32')](_0x58bdec||0x1,_0x6487('0x31')),'countbusyretry':_0x2ccb06[_0x6487('0x21')],'countcongestionretry':_0x2ccb06[_0x6487('0x27')],'countnoanswerretry':_0x2ccb06['countnoanswerretry'],'countnosuchnumberretry':_0x2ccb06['countnosuchnumberretry'],'countdropretry':_0x2ccb06[_0x6487('0x28')],'countabandonedretry':_0x2ccb06[_0x6487('0x24')],'countmachineretry':_0x2ccb06[_0x6487('0x25')],'countagentrejectretry':_0x2ccb06['countagentrejectretry'],'createdAt':_0x2ccb06['createdAt'],'updatedAt':_0x2ccb06[_0x6487('0x34')]};var _0x20b1a1={'CmHopperId':_0x91c99f['id'],'phone':_0x645312[_0x6487('0x33')],'active':0x0,'OrderBy':_[_0x6487('0x2f')](_0x645312[_0x6487('0x1f')])?0x0:_0x645312['OrderBy'],'scheduledat':_0xa2ed07,'countbusyretry':_0x645312['countbusyretry'],'countcongestionretry':_0x645312[_0x6487('0x27')],'countnoanswerretry':_0x645312[_0x6487('0x22')],'countnosuchnumberretry':_0x645312[_0x6487('0x23')],'countdropretry':_0x645312[_0x6487('0x28')],'countabandonedretry':_0x645312[_0x6487('0x24')],'countmachineretry':_0x645312[_0x6487('0x25')],'countagentrejectretry':_0x645312[_0x6487('0x26')],'createdAt':_0x645312['createdAt'],'updatedAt':_0x645312['updatedAt']};return db['sequelize'][_0x6487('0x35')](function(_0x3aeed7){return db[_0x6487('0x1e')][_0x6487('0x36')](_0x10031c,{'where':{'id':_0x645312['id']}},{'transaction':_0x3aeed7})[_0x6487('0xb')](function(){return db[_0x6487('0x17')][_0x6487('0x36')](_0x20b1a1,{'where':{'id':_0x91c99f['id']}},{'transaction':_0x3aeed7});});})[_0x6487('0xb')](function(_0x1d0351){_0x5711d7({'id':_0x91c99f['id'],'phone':_0x645312['phone']});})[_0x6487('0x2b')](function(_0x8e95b4){logger[_0x6487('0x11')](_0x6487('0x37'),_0x8e95b4[_0x6487('0x14')]);_0x4e6d21({'error':_0x8e95b4[_0x6487('0x14')]});});});}exports[_0x6487('0x38')]=function(_0x45af4b){var _0x55f199=this;return new Promise(function(_0x53a6dc,_0x19f449){return db[_0x6487('0x17')][_0x6487('0x36')](_0x45af4b['body'][_0x6487('0x39')],{'where':{'id':_0x45af4b[_0x6487('0x19')]['id']}})[_0x6487('0xb')](function(_0x190265){_0x53a6dc(_0x190265);})['catch'](function(_0x216671){logger[_0x6487('0x11')](_0x6487('0x38'),_0x216671['message']);_0x19f449(_0x55f199[_0x6487('0x11')](0x1f4,_0x216671[_0x6487('0x14')]));});});}; \ No newline at end of file +var _0x4249=['ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countcongestionretry','countnosuchnumberretry','dialGlobalMaxRetry','VerifyAdditionalPhones','CmHopper','ListId','duration','waitTime','isNil','scheduledat','minutes','add','phone','countdropretry','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findOne','body'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4249,0x100));var _0x9424=function(_0x28e0cb,_0x44b211){_0x28e0cb=_0x28e0cb-0x0;var _0x30382e=_0x4249[_0x28e0cb];return _0x30382e;};'use strict';var _=require(_0x9424('0x0'));var util=require('util');var moment=require(_0x9424('0x1'));var BPromise=require('bluebird');var rs=require(_0x9424('0x2'));var fs=require('fs');var Redis=require(_0x9424('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9424('0x4'));var logger=require(_0x9424('0x5'))(_0x9424('0x6'));var config=require('../../config/environment');var jayson=require(_0x9424('0x7'));var client=jayson['client'][_0x9424('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b46f7,_0x4d370c,_0x2899aa){return new BPromise(function(_0x6d286c,_0x40323e){return client[_0x9424('0x9')](_0x5b46f7,_0x2899aa)[_0x9424('0xa')](function(_0x2d4d05){logger[_0x9424('0xb')](_0x9424('0xc'),_0x4d370c,_0x9424('0xd'));logger[_0x9424('0xe')](_0x9424('0xf'),_0x4d370c,_0x9424('0xd'),JSON[_0x9424('0x10')](_0x2d4d05));if(_0x2d4d05[_0x9424('0x11')]){if(_0x2d4d05['error'][_0x9424('0x12')]===0x1f4){logger[_0x9424('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4d370c,_0x2d4d05[_0x9424('0x11')][_0x9424('0x13')]);return _0x40323e(_0x2d4d05[_0x9424('0x11')][_0x9424('0x13')]);}logger[_0x9424('0x11')](_0x9424('0xc'),_0x4d370c,_0x2d4d05[_0x9424('0x11')][_0x9424('0x13')]);return _0x6d286c(_0x2d4d05[_0x9424('0x11')][_0x9424('0x13')]);}else{logger[_0x9424('0xb')](_0x9424('0xc'),_0x4d370c,_0x9424('0xd'));_0x6d286c(_0x2d4d05[_0x9424('0x14')][_0x9424('0x13')]);}})[_0x9424('0x15')](function(_0x11c9af){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4d370c,_0x11c9af);_0x40323e(_0x11c9af);});});}exports['VerifyAdditionalPhones']=function(_0x2d42bb){var _0x50a96f=this;return new Promise(function(_0x23bf71,_0xb1d50d){return db['CmHopper'][_0x9424('0x16')]({'raw':!![],'where':{'ContactId':_0x2d42bb[_0x9424('0x17')][_0x9424('0x18')],'ListId':_0x2d42bb[_0x9424('0x17')]['ListId'],'VoiceQueueId':_0x2d42bb['body'][_0x9424('0x19')]===undefined?null:_0x2d42bb['body'][_0x9424('0x19')],'CampaignId':_0x2d42bb[_0x9424('0x17')][_0x9424('0x1a')]===undefined?null:_0x2d42bb[_0x9424('0x17')][_0x9424('0x1a')]}})[_0x9424('0xa')](function(_0x4e772d){if(_0x4e772d!=null){return db[_0x9424('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4e772d['id'],'OrderBy':{'$gt':_0x4e772d[_0x9424('0x1c')]}},'order':[[_0x9424('0x1c'),_0x9424('0x1d')]]})['then'](function(_0x4512ab){var _0x3b6e55=0x0;if(_0x4512ab){if(_0x4512ab[_0x9424('0x1e')]+_0x4512ab['countcongestionretry']+_0x4512ab[_0x9424('0x1f')]+_0x4512ab['countnosuchnumberretry']+_0x4512ab['countdropretry']+_0x4512ab[_0x9424('0x20')]+_0x4512ab[_0x9424('0x21')]+_0x4512ab[_0x9424('0x22')]<_0x2d42bb[_0x9424('0x23')]['dialGlobalMaxRetry'])_0x3b6e55=0x1;_0x23bf71({'additional':_0x3b6e55});}else{return db['CmHopperAdditionalPhone'][_0x9424('0x16')]({'raw':!![],'where':{'CmHopperId':_0x4e772d['id']},'order':[[_0x9424('0x1c'),_0x9424('0x1d')]]})['then'](function(_0x3fab4f){var _0x1b948c=0x0;if(_0x3fab4f){if(_0x3fab4f[_0x9424('0x1e')]+_0x3fab4f[_0x9424('0x24')]+_0x3fab4f[_0x9424('0x1f')]+_0x3fab4f[_0x9424('0x25')]+_0x3fab4f['countdropretry']+_0x3fab4f['countabandonedretry']+_0x3fab4f[_0x9424('0x21')]+_0x3fab4f['countagentrejectretry']<_0x2d42bb[_0x9424('0x23')][_0x9424('0x26')])_0x1b948c=0x1;_0x23bf71({'additional':_0x1b948c});}else{_0x23bf71({'additional':0x0});}})[_0x9424('0x15')](function(_0x35c072){logger[_0x9424('0x11')](_0x9424('0x27'),_0x35c072[_0x9424('0x13')]);_0xb1d50d(_0x50a96f[_0x9424('0x11')](0x1f4,_0x35c072['message']));});}})['catch'](function(_0x4faff7){logger[_0x9424('0x11')](_0x9424('0x27'),_0x4faff7[_0x9424('0x13')]);_0xb1d50d(_0x50a96f['error'](0x1f4,_0x4faff7['message']));});}else _0x23bf71({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x29b26f){var _0xff577e=this;return new Promise(function(_0x3a893a,_0x5bc2d5){return db[_0x9424('0x28')][_0x9424('0x16')]({'raw':!![],'where':{'ContactId':_0x29b26f[_0x9424('0x17')][_0x9424('0x18')],'ListId':_0x29b26f[_0x9424('0x17')][_0x9424('0x29')],'VoiceQueueId':_0x29b26f[_0x9424('0x17')][_0x9424('0x19')]===undefined?null:_0x29b26f[_0x9424('0x17')][_0x9424('0x19')],'CampaignId':_0x29b26f['body'][_0x9424('0x1a')]===undefined?null:_0x29b26f[_0x9424('0x17')][_0x9424('0x1a')]}})[_0x9424('0xa')](function(_0x3696b6){if(_0x3696b6!=null){return db['CmHopperAdditionalPhone'][_0x9424('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3696b6['id'],'OrderBy':{'$gte':_0x3696b6[_0x9424('0x1c')]}},'order':[[_0x9424('0x1c'),_0x9424('0x1d')]]})[_0x9424('0xa')](function(_0x84cba8){if(_0x84cba8)return activateAdditionalPhone(_0x3696b6,_0x29b26f[_0x9424('0x17')],_0x84cba8,_0x29b26f[_0x9424('0x2a')],_0x29b26f[_0x9424('0x2b')])[_0x9424('0xa')](function(_0x2523fd){_0x3a893a(_0x2523fd);});else{return db[_0x9424('0x1b')][_0x9424('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3696b6['id']},'order':[[_0x9424('0x1c'),_0x9424('0x1d')]]})['then'](function(_0x1ab823){if(_0x1ab823)return activateAdditionalPhone(_0x3696b6,_0x29b26f[_0x9424('0x17')],_0x1ab823,_0x29b26f[_0x9424('0x2a')],_0x29b26f['waitTime'])[_0x9424('0xa')](function(_0x356663){_0x3a893a(_0x356663);});else{_0x3a893a({'id':_0x3696b6['id'],'phone':''});}})['catch'](function(_0x1f7867){logger['error'](_0x9424('0x27'),_0x1f7867[_0x9424('0x13')]);_0x5bc2d5(_0xff577e[_0x9424('0x11')](0x1f4,_0x1f7867['message']));});}})[_0x9424('0x15')](function(_0x30c058){logger[_0x9424('0x11')](_0x9424('0x27'),_0x30c058[_0x9424('0x13')]);_0x5bc2d5(_0xff577e['error'](0x1f4,_0x30c058[_0x9424('0x13')]));});}else _0x3a893a(0x1);});});};function activateAdditionalPhone(_0x5eb611,_0x3da2d3,_0x15b613,_0x38c9b2,_0x1cae8e){return new Promise(function(_0x2551cd,_0x6a300b){var _0x1c71a9;if(_[_0x9424('0x2c')](_0x15b613['scheduledat'])){_0x15b613[_0x9424('0x2d')]=moment();}if(moment()>moment(_0x15b613[_0x9424('0x2d')])){_0x1c71a9=moment()['add'](_0x1cae8e||0x3,_0x9424('0x2e'));}else{if(_0x15b613['OrderBy']==0x0){_0x1c71a9=moment(_0x15b613[_0x9424('0x2d')]);}else{_0x1c71a9=moment()[_0x9424('0x2f')](_0x1cae8e||0x3,'minutes');}}if(_[_0x9424('0x2c')](_0x1c71a9)){_0x1c71a9=moment()[_0x9424('0x2f')](_0x1cae8e||0x3,_0x9424('0x2e'));}var _0x4b988a={'phone':_0x5eb611[_0x9424('0x30')],'active':0x0,'OrderBy':_[_0x9424('0x2c')](_0x5eb611[_0x9424('0x1c')])?0x0:_0x5eb611['OrderBy'],'scheduledat':moment()[_0x9424('0x2f')](_0x38c9b2||0x1,_0x9424('0x2e')),'countbusyretry':_0x3da2d3['countbusyretry'],'countcongestionretry':_0x3da2d3[_0x9424('0x24')],'countnoanswerretry':_0x3da2d3[_0x9424('0x1f')],'countnosuchnumberretry':_0x3da2d3[_0x9424('0x25')],'countdropretry':_0x3da2d3[_0x9424('0x31')],'countabandonedretry':_0x3da2d3[_0x9424('0x20')],'countmachineretry':_0x3da2d3['countmachineretry'],'countagentrejectretry':_0x3da2d3[_0x9424('0x22')],'createdAt':_0x3da2d3[_0x9424('0x32')],'updatedAt':_0x3da2d3[_0x9424('0x33')]};var _0x7ad0d8={'CmHopperId':_0x5eb611['id'],'phone':_0x15b613[_0x9424('0x30')],'active':0x0,'OrderBy':_[_0x9424('0x2c')](_0x15b613['OrderBy'])?0x0:_0x15b613[_0x9424('0x1c')],'scheduledat':_0x1c71a9,'countbusyretry':_0x15b613['countbusyretry'],'countcongestionretry':_0x15b613[_0x9424('0x24')],'countnoanswerretry':_0x15b613['countnoanswerretry'],'countnosuchnumberretry':_0x15b613[_0x9424('0x25')],'countdropretry':_0x15b613['countdropretry'],'countabandonedretry':_0x15b613[_0x9424('0x20')],'countmachineretry':_0x15b613[_0x9424('0x21')],'countagentrejectretry':_0x15b613[_0x9424('0x22')],'createdAt':_0x15b613[_0x9424('0x32')],'updatedAt':_0x15b613[_0x9424('0x33')]};return db[_0x9424('0x34')]['transaction'](function(_0x4ec8ba){return db['CmHopperAdditionalPhone'][_0x9424('0x35')](_0x4b988a,{'where':{'id':_0x15b613['id']}},{'transaction':_0x4ec8ba})[_0x9424('0xa')](function(){return db[_0x9424('0x28')]['update'](_0x7ad0d8,{'where':{'id':_0x5eb611['id']}},{'transaction':_0x4ec8ba});});})[_0x9424('0xa')](function(_0x2565bc){_0x2551cd({'id':_0x5eb611['id'],'phone':_0x15b613[_0x9424('0x30')]});})[_0x9424('0x15')](function(_0xdf27e7){logger[_0x9424('0x11')](_0x9424('0x36'),_0xdf27e7[_0x9424('0x13')]);_0x6a300b({'error':_0xdf27e7[_0x9424('0x13')]});});});}exports[_0x9424('0x37')]=function(_0x17e57c){var _0x1530d6=this;return new Promise(function(_0x3bbcff,_0x40f7e9){return db[_0x9424('0x28')]['update'](_0x17e57c[_0x9424('0x17')]['field'],{'where':{'id':_0x17e57c[_0x9424('0x17')]['id']}})[_0x9424('0xa')](function(_0x295fa6){_0x3bbcff(_0x295fa6);})[_0x9424('0x15')](function(_0x280b64){logger[_0x9424('0x11')](_0x9424('0x37'),_0x280b64[_0x9424('0x13')]);_0x40f7e9(_0x1530d6['error'](0x1f4,_0x280b64[_0x9424('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index dfe0ef4..48f4973 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0381=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x8a240f,_0x1f6bf9){var _0x16a92b=function(_0x5cda68){while(--_0x5cda68){_0x8a240f['push'](_0x8a240f['shift']());}};_0x16a92b(++_0x1f6bf9);}(_0x0381,0x13e));var _0x1038=function(_0x4f6ecd,_0x1600d2){_0x4f6ecd=_0x4f6ecd-0x0;var _0x1bbece=_0x0381[_0x4f6ecd];return _0x1bbece;};'use strict';var multer=require(_0x1038('0x0'));var util=require('util');var path=require(_0x1038('0x1'));var timeout=require(_0x1038('0x2'));var express=require(_0x1038('0x3'));var router=express[_0x1038('0x4')]();var fs_extra=require(_0x1038('0x5'));var auth=require(_0x1038('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1038('0x7'));var controller=require(_0x1038('0x8'));router['get']('/',auth[_0x1038('0x9')](),controller[_0x1038('0xa')]);router[_0x1038('0xb')](_0x1038('0xc'),auth[_0x1038('0x9')](),controller[_0x1038('0xd')]);router[_0x1038('0xe')]('/',auth['isAuthenticated'](),controller[_0x1038('0xf')]);router[_0x1038('0x10')](_0x1038('0xc'),auth[_0x1038('0x9')](),controller[_0x1038('0x11')]);router[_0x1038('0x12')](_0x1038('0xc'),auth[_0x1038('0x9')](),controller[_0x1038('0x13')]);module[_0x1038('0x14')]=router; \ No newline at end of file +var _0x02d9=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','get','/:id','post','update'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x02d9,0x1d7));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x902d('0x0'));var util=require(_0x902d('0x1'));var path=require(_0x902d('0x2'));var timeout=require('connect-timeout');var express=require(_0x902d('0x3'));var router=express[_0x902d('0x4')]();var fs_extra=require(_0x902d('0x5'));var auth=require(_0x902d('0x6'));var interaction=require(_0x902d('0x7'));var config=require(_0x902d('0x8'));var controller=require(_0x902d('0x9'));router['get']('/',auth[_0x902d('0xa')](),controller['index']);router[_0x902d('0xb')](_0x902d('0xc'),auth[_0x902d('0xa')](),controller['show']);router[_0x902d('0xd')]('/',auth[_0x902d('0xa')](),controller['create']);router['put'](_0x902d('0xc'),auth[_0x902d('0xa')](),controller[_0x902d('0xe')]);router[_0x902d('0xf')](_0x902d('0xc'),auth['isAuthenticated'](),controller[_0x902d('0x10')]);module[_0x902d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 09fc11b..3412ef9 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 _0x8147=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x24fb93,_0x12296c){var _0x22e0d5=function(_0x42dafb){while(--_0x42dafb){_0x24fb93['push'](_0x24fb93['shift']());}};_0x22e0d5(++_0x12296c);}(_0x8147,0x179));var _0x7814=function(_0x3529c4,_0x12ef8f){_0x3529c4=_0x3529c4-0x0;var _0x2443ea=_0x8147[_0x3529c4];return _0x2443ea;};'use strict';var moment=require(_0x7814('0x0'));var Sequelize=require(_0x7814('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7814('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7814('0x3')],'unique':_0x7814('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7814('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7814('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x9a96=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x9a96,0xd0));var _0x69a9=function(_0x3f45e9,_0x34966c){_0x3f45e9=_0x3f45e9-0x0;var _0x208d7b=_0x9a96[_0x3f45e9];return _0x208d7b;};'use strict';var moment=require(_0x69a9('0x0'));var Sequelize=require(_0x69a9('0x1'));module[_0x69a9('0x2')]={'phone':{'type':Sequelize[_0x69a9('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x69a9('0x4')],'unique':_0x69a9('0x5')},'ListId':{'type':Sequelize[_0x69a9('0x4')],'unique':_0x69a9('0x5')},'VoiceQueueId':{'type':Sequelize[_0x69a9('0x4')],'unique':_0x69a9('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c24f31a..436207b 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 _0x62bc=['length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','update','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62bc,0xf2));var _0xc62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc62b('0x0'));var zipdir=require(_0xc62b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc62b('0x2'));var moment=require(_0xc62b('0x3'));var BPromise=require(_0xc62b('0x4'));var Mustache=require('mustache');var util=require(_0xc62b('0x5'));var path=require('path');var sox=require(_0xc62b('0x6'));var csv=require(_0xc62b('0x7'));var ejs=require(_0xc62b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc62b('0x9'));var squel=require(_0xc62b('0xa'));var crypto=require(_0xc62b('0xb'));var jsforce=require(_0xc62b('0xc'));var deskjs=require(_0xc62b('0xd'));var toCsv=require(_0xc62b('0x7'));var querystring=require('querystring');var Papa=require(_0xc62b('0xe'));var Redis=require(_0xc62b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc62b('0x10'));var as=require(_0xc62b('0x11'));var hardwareService=require(_0xc62b('0x12'));var logger=require('../../config/logger')(_0xc62b('0x13'));var utils=require(_0xc62b('0x14'));var config=require(_0xc62b('0x15'));var licenseUtil=require(_0xc62b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d2e3f,_0x17da52){_0x17da52=_0x17da52||0xcc;return function(_0x1985cd){if(_0x1985cd){return _0x4d2e3f['sendStatus'](_0x17da52);}return _0x4d2e3f[_0xc62b('0x17')](_0x17da52)[_0xc62b('0x18')]();};}function respondWithResult(_0x3c5a59,_0xce785f){_0xce785f=_0xce785f||0xc8;return function(_0x27891b){if(_0x27891b){return _0x3c5a59[_0xc62b('0x17')](_0xce785f)[_0xc62b('0x19')](_0x27891b);}};}function respondWithFilteredResult(_0xc1f263,_0x388ca9){return function(_0x34799d){if(_0x34799d){var _0x493572=typeof _0x388ca9['offset']==='undefined'&&typeof _0x388ca9[_0xc62b('0x1a')]==='undefined';var _0x5d4340=_0x34799d[_0xc62b('0x1b')];var _0x1f1a42=_0x493572?0x0:_0x388ca9[_0xc62b('0x1c')];var _0x3e71e7=_0x493572?_0x34799d[_0xc62b('0x1b')]:_0x388ca9['offset']+_0x388ca9[_0xc62b('0x1a')];var _0xf01040;if(_0x3e71e7>=_0x5d4340){_0x3e71e7=_0x5d4340;_0xf01040=0xc8;}else{_0xf01040=0xce;}_0xc1f263['status'](_0xf01040);return _0xc1f263[_0xc62b('0x1d')](_0xc62b('0x1e'),_0x1f1a42+'-'+_0x3e71e7+'/'+_0x5d4340)[_0xc62b('0x19')](_0x34799d);}return null;};}function patchUpdates(_0x1ce1ab){return function(_0x40a4bc){try{jsonpatch[_0xc62b('0x1f')](_0x40a4bc,_0x1ce1ab,!![]);}catch(_0x2a87ca){return BPromise[_0xc62b('0x20')](_0x2a87ca);}return _0x40a4bc[_0xc62b('0x21')]();};}function saveUpdates(_0x1ddf9d,_0x5f4726){return function(_0x49a2dc){if(_0x49a2dc){return _0x49a2dc['update'](_0x1ddf9d)[_0xc62b('0x22')](function(_0x189e1c){return _0x189e1c;});}return null;};}function removeEntity(_0x415d8b,_0x601ded){return function(_0x251963){if(_0x251963){return _0x251963[_0xc62b('0x23')]()[_0xc62b('0x22')](function(){_0x415d8b['status'](0xcc)[_0xc62b('0x18')]();});}};}function handleEntityNotFound(_0x5f1294,_0x5e5235){return function(_0x7efb13){if(!_0x7efb13){_0x5f1294[_0xc62b('0x24')](0x194);}return _0x7efb13;};}function handleError(_0x6ebe9a,_0x3f3240){_0x3f3240=_0x3f3240||0x1f4;return function(_0x29bf18){logger['error'](_0x29bf18[_0xc62b('0x25')]);if(_0x29bf18[_0xc62b('0x26')]){delete _0x29bf18[_0xc62b('0x26')];}_0x6ebe9a[_0xc62b('0x17')](_0x3f3240)[_0xc62b('0x27')](_0x29bf18);};}exports[_0xc62b('0x28')]=function(_0x35a827,_0x4f231f){var _0x358a6d={},_0x59aa28={},_0x5031ff={'count':0x0,'rows':[]};var _0x3b0caa=_[_0xc62b('0x29')](db[_0xc62b('0x2a')][_0xc62b('0x2b')],function(_0x2e5bdf){return{'name':_0x2e5bdf[_0xc62b('0x2c')],'type':_0x2e5bdf[_0xc62b('0x2d')][_0xc62b('0x2e')]};});_0x59aa28[_0xc62b('0x2f')]=_[_0xc62b('0x29')](_0x3b0caa,'name');_0x59aa28[_0xc62b('0x30')]=_[_0xc62b('0x31')](_0x35a827[_0xc62b('0x30')]);_0x59aa28[_0xc62b('0x32')]=_[_0xc62b('0x33')](_0x59aa28['model'],_0x59aa28['query']);_0x358a6d['attributes']=_[_0xc62b('0x33')](_0x59aa28['model'],qs[_0xc62b('0x34')](_0x35a827['query']['fields']));_0x358a6d[_0xc62b('0x35')]=_0x358a6d[_0xc62b('0x35')][_0xc62b('0x36')]?_0x358a6d[_0xc62b('0x35')]:_0x59aa28[_0xc62b('0x2f')];if(!_0x35a827[_0xc62b('0x30')][_0xc62b('0x37')]('nolimit')){_0x358a6d[_0xc62b('0x1a')]=qs[_0xc62b('0x1a')](_0x35a827[_0xc62b('0x30')]['limit']);_0x358a6d[_0xc62b('0x1c')]=qs[_0xc62b('0x1c')](_0x35a827[_0xc62b('0x30')]['offset']);}_0x358a6d[_0xc62b('0x38')]=qs[_0xc62b('0x39')](_0x35a827['query'][_0xc62b('0x39')]);_0x358a6d['where']=qs['filters'](_['pick'](_0x35a827['query'],_0x59aa28[_0xc62b('0x32')]),_0x3b0caa);if(_0x35a827[_0xc62b('0x30')][_0xc62b('0x3a')]){_0x358a6d[_0xc62b('0x3b')]=_['merge'](_0x358a6d[_0xc62b('0x3b')],{'$or':_[_0xc62b('0x29')](_0x3b0caa,function(_0x388d7e){if(_0x388d7e[_0xc62b('0x2d')]!==_0xc62b('0x3c')){var _0x47c48c={};_0x47c48c[_0x388d7e[_0xc62b('0x26')]]={'$like':'%'+_0x35a827['query'][_0xc62b('0x3a')]+'%'};return _0x47c48c;}})});}_0x358a6d=_[_0xc62b('0x3d')]({},_0x358a6d,_0x35a827[_0xc62b('0x3e')]);var _0x19cfb2={'where':_0x358a6d[_0xc62b('0x3b')]};return db['CmHopperBlack']['count'](_0x19cfb2)[_0xc62b('0x22')](function(_0x48e824){_0x5031ff['count']=_0x48e824;if(_0x35a827[_0xc62b('0x30')][_0xc62b('0x3f')]){_0x358a6d['include']=[{'all':!![]}];}return db[_0xc62b('0x2a')][_0xc62b('0x40')](_0x358a6d);})[_0xc62b('0x22')](function(_0x29465c){_0x5031ff[_0xc62b('0x41')]=_0x29465c;return _0x5031ff;})[_0xc62b('0x22')](respondWithFilteredResult(_0x4f231f,_0x358a6d))[_0xc62b('0x42')](handleError(_0x4f231f,null));};exports[_0xc62b('0x43')]=function(_0x56bdd0,_0x581b60){var _0x5a7f3f={'raw':!![],'where':{'id':_0x56bdd0[_0xc62b('0x44')]['id']}},_0xc331a9={};_0xc331a9[_0xc62b('0x2f')]=_['keys'](db[_0xc62b('0x2a')][_0xc62b('0x2b')]);_0xc331a9[_0xc62b('0x30')]=_['keys'](_0x56bdd0[_0xc62b('0x30')]);_0xc331a9[_0xc62b('0x32')]=_['intersection'](_0xc331a9[_0xc62b('0x2f')],_0xc331a9[_0xc62b('0x30')]);_0x5a7f3f[_0xc62b('0x35')]=_[_0xc62b('0x33')](_0xc331a9['model'],qs[_0xc62b('0x34')](_0x56bdd0[_0xc62b('0x30')]['fields']));_0x5a7f3f[_0xc62b('0x35')]=_0x5a7f3f[_0xc62b('0x35')][_0xc62b('0x36')]?_0x5a7f3f['attributes']:_0xc331a9[_0xc62b('0x2f')];if(_0x56bdd0[_0xc62b('0x30')][_0xc62b('0x3f')]){_0x5a7f3f[_0xc62b('0x45')]=[{'all':!![]}];}_0x5a7f3f=_[_0xc62b('0x3d')]({},_0x5a7f3f,_0x56bdd0['options']);return db[_0xc62b('0x2a')][_0xc62b('0x46')](_0x5a7f3f)[_0xc62b('0x22')](handleEntityNotFound(_0x581b60,null))[_0xc62b('0x22')](respondWithResult(_0x581b60,null))[_0xc62b('0x42')](handleError(_0x581b60,null));};exports[_0xc62b('0x47')]=function(_0x4fb001,_0x4ae97d){if(_0x4fb001[_0xc62b('0x48')]['id']){delete _0x4fb001[_0xc62b('0x48')]['id'];}return db['CmHopperBlack'][_0xc62b('0x46')]({'where':{'id':_0x4fb001['params']['id']}})[_0xc62b('0x22')](handleEntityNotFound(_0x4ae97d,null))[_0xc62b('0x22')](saveUpdates(_0x4fb001['body'],null))[_0xc62b('0x22')](respondWithResult(_0x4ae97d,null))[_0xc62b('0x42')](handleError(_0x4ae97d,null));};exports['destroy']=function(_0x46b8b7,_0x16a87e){return db['CmHopperBlack'][_0xc62b('0x46')]({'where':{'id':_0x46b8b7[_0xc62b('0x44')]['id']}})[_0xc62b('0x22')](handleEntityNotFound(_0x16a87e,null))['then'](removeEntity(_0x16a87e,null))[_0xc62b('0x42')](handleError(_0x16a87e,null));};exports['describe']=function(_0x47c61c,_0x307bec){return db[_0xc62b('0x2a')][_0xc62b('0x49')]()['then'](respondWithResult(_0x307bec,null))[_0xc62b('0x42')](handleError(_0x307bec,null));}; \ No newline at end of file +var _0xa18d=['rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','update','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa18d,0x6c));var _0xda18=function(_0x1ef1d1,_0x27bdf7){_0x1ef1d1=_0x1ef1d1-0x0;var _0x37be48=_0xa18d[_0x1ef1d1];return _0x37be48;};'use strict';var emlformat=require(_0xda18('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda18('0x1'));var rp=require(_0xda18('0x2'));var moment=require(_0xda18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xda18('0x4'));var util=require(_0xda18('0x5'));var path=require(_0xda18('0x6'));var sox=require(_0xda18('0x7'));var csv=require(_0xda18('0x8'));var ejs=require(_0xda18('0x9'));var fs=require('fs');var fs_extra=require(_0xda18('0xa'));var _=require(_0xda18('0xb'));var squel=require(_0xda18('0xc'));var crypto=require(_0xda18('0xd'));var jsforce=require(_0xda18('0xe'));var deskjs=require(_0xda18('0xf'));var toCsv=require(_0xda18('0x8'));var querystring=require(_0xda18('0x10'));var Papa=require(_0xda18('0x11'));var Redis=require(_0xda18('0x12'));var authService=require(_0xda18('0x13'));var qs=require(_0xda18('0x14'));var as=require(_0xda18('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda18('0x16'))('api');var utils=require(_0xda18('0x17'));var config=require(_0xda18('0x18'));var licenseUtil=require(_0xda18('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x490767,_0x196b01){_0x196b01=_0x196b01||0xcc;return function(_0x50d028){if(_0x50d028){return _0x490767[_0xda18('0x1a')](_0x196b01);}return _0x490767[_0xda18('0x1b')](_0x196b01)['end']();};}function respondWithResult(_0x40574e,_0x45af0f){_0x45af0f=_0x45af0f||0xc8;return function(_0x2a8f92){if(_0x2a8f92){return _0x40574e[_0xda18('0x1b')](_0x45af0f)[_0xda18('0x1c')](_0x2a8f92);}};}function respondWithFilteredResult(_0x15bd00,_0x54c02e){return function(_0x5d3e54){if(_0x5d3e54){var _0x68a63=typeof _0x54c02e[_0xda18('0x1d')]==='undefined'&&typeof _0x54c02e[_0xda18('0x1e')]===_0xda18('0x1f');var _0x29e92d=_0x5d3e54[_0xda18('0x20')];var _0x4563e6=_0x68a63?0x0:_0x54c02e[_0xda18('0x1d')];var _0x4a2abf=_0x68a63?_0x5d3e54[_0xda18('0x20')]:_0x54c02e['offset']+_0x54c02e[_0xda18('0x1e')];var _0x1350c1;if(_0x4a2abf>=_0x29e92d){_0x4a2abf=_0x29e92d;_0x1350c1=0xc8;}else{_0x1350c1=0xce;}_0x15bd00[_0xda18('0x1b')](_0x1350c1);return _0x15bd00[_0xda18('0x21')]('Content-Range',_0x4563e6+'-'+_0x4a2abf+'/'+_0x29e92d)[_0xda18('0x1c')](_0x5d3e54);}return null;};}function patchUpdates(_0x5eb381){return function(_0x1f9339){try{jsonpatch[_0xda18('0x22')](_0x1f9339,_0x5eb381,!![]);}catch(_0x3941cc){return BPromise['reject'](_0x3941cc);}return _0x1f9339[_0xda18('0x23')]();};}function saveUpdates(_0xc45897,_0x1e0cf6){return function(_0x2cd161){if(_0x2cd161){return _0x2cd161['update'](_0xc45897)[_0xda18('0x24')](function(_0x49c714){return _0x49c714;});}return null;};}function removeEntity(_0x483971,_0x382af0){return function(_0x2e2f2d){if(_0x2e2f2d){return _0x2e2f2d[_0xda18('0x25')]()[_0xda18('0x24')](function(){_0x483971[_0xda18('0x1b')](0xcc)[_0xda18('0x26')]();});}};}function handleEntityNotFound(_0x5ddfb1,_0x478e15){return function(_0x594b7f){if(!_0x594b7f){_0x5ddfb1[_0xda18('0x1a')](0x194);}return _0x594b7f;};}function handleError(_0x2c4765,_0xec402c){_0xec402c=_0xec402c||0x1f4;return function(_0x88d009){logger[_0xda18('0x27')](_0x88d009[_0xda18('0x28')]);if(_0x88d009[_0xda18('0x29')]){delete _0x88d009[_0xda18('0x29')];}_0x2c4765[_0xda18('0x1b')](_0xec402c)[_0xda18('0x2a')](_0x88d009);};}exports[_0xda18('0x2b')]=function(_0x5201f9,_0x5a4640){var _0x19fd26={},_0x5858ed={},_0x94f821={'count':0x0,'rows':[]};var _0x3bad20=_[_0xda18('0x2c')](db[_0xda18('0x2d')][_0xda18('0x2e')],function(_0x2bda05){return{'name':_0x2bda05[_0xda18('0x2f')],'type':_0x2bda05[_0xda18('0x30')][_0xda18('0x31')]};});_0x5858ed[_0xda18('0x32')]=_[_0xda18('0x2c')](_0x3bad20,'name');_0x5858ed[_0xda18('0x33')]=_['keys'](_0x5201f9[_0xda18('0x33')]);_0x5858ed['filters']=_[_0xda18('0x34')](_0x5858ed[_0xda18('0x32')],_0x5858ed[_0xda18('0x33')]);_0x19fd26[_0xda18('0x35')]=_[_0xda18('0x34')](_0x5858ed['model'],qs[_0xda18('0x36')](_0x5201f9[_0xda18('0x33')][_0xda18('0x36')]));_0x19fd26[_0xda18('0x35')]=_0x19fd26[_0xda18('0x35')][_0xda18('0x37')]?_0x19fd26['attributes']:_0x5858ed['model'];if(!_0x5201f9[_0xda18('0x33')][_0xda18('0x38')]('nolimit')){_0x19fd26[_0xda18('0x1e')]=qs[_0xda18('0x1e')](_0x5201f9[_0xda18('0x33')][_0xda18('0x1e')]);_0x19fd26['offset']=qs[_0xda18('0x1d')](_0x5201f9[_0xda18('0x33')][_0xda18('0x1d')]);}_0x19fd26[_0xda18('0x39')]=qs[_0xda18('0x3a')](_0x5201f9[_0xda18('0x33')]['sort']);_0x19fd26[_0xda18('0x3b')]=qs[_0xda18('0x3c')](_[_0xda18('0x3d')](_0x5201f9[_0xda18('0x33')],_0x5858ed[_0xda18('0x3c')]),_0x3bad20);if(_0x5201f9[_0xda18('0x33')][_0xda18('0x3e')]){_0x19fd26[_0xda18('0x3b')]=_['merge'](_0x19fd26[_0xda18('0x3b')],{'$or':_[_0xda18('0x2c')](_0x3bad20,function(_0x33b9af){if(_0x33b9af['type']!==_0xda18('0x3f')){var _0x11f5d5={};_0x11f5d5[_0x33b9af[_0xda18('0x29')]]={'$like':'%'+_0x5201f9[_0xda18('0x33')][_0xda18('0x3e')]+'%'};return _0x11f5d5;}})});}_0x19fd26=_[_0xda18('0x40')]({},_0x19fd26,_0x5201f9[_0xda18('0x41')]);var _0x438a89={'where':_0x19fd26[_0xda18('0x3b')]};return db['CmHopperBlack']['count'](_0x438a89)[_0xda18('0x24')](function(_0xfa1302){_0x94f821[_0xda18('0x20')]=_0xfa1302;if(_0x5201f9[_0xda18('0x33')][_0xda18('0x42')]){_0x19fd26[_0xda18('0x43')]=[{'all':!![]}];}return db[_0xda18('0x2d')][_0xda18('0x44')](_0x19fd26);})[_0xda18('0x24')](function(_0x50ca18){_0x94f821[_0xda18('0x45')]=_0x50ca18;return _0x94f821;})[_0xda18('0x24')](respondWithFilteredResult(_0x5a4640,_0x19fd26))[_0xda18('0x46')](handleError(_0x5a4640,null));};exports['show']=function(_0x352d50,_0x312f01){var _0x463f40={'raw':!![],'where':{'id':_0x352d50[_0xda18('0x47')]['id']}},_0x4f238e={};_0x4f238e[_0xda18('0x32')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x4f238e['query']=_[_0xda18('0x48')](_0x352d50['query']);_0x4f238e[_0xda18('0x3c')]=_[_0xda18('0x34')](_0x4f238e[_0xda18('0x32')],_0x4f238e[_0xda18('0x33')]);_0x463f40[_0xda18('0x35')]=_['intersection'](_0x4f238e[_0xda18('0x32')],qs[_0xda18('0x36')](_0x352d50['query']['fields']));_0x463f40[_0xda18('0x35')]=_0x463f40['attributes'][_0xda18('0x37')]?_0x463f40['attributes']:_0x4f238e[_0xda18('0x32')];if(_0x352d50[_0xda18('0x33')][_0xda18('0x42')]){_0x463f40[_0xda18('0x43')]=[{'all':!![]}];}_0x463f40=_[_0xda18('0x40')]({},_0x463f40,_0x352d50[_0xda18('0x41')]);return db[_0xda18('0x2d')][_0xda18('0x49')](_0x463f40)[_0xda18('0x24')](handleEntityNotFound(_0x312f01,null))[_0xda18('0x24')](respondWithResult(_0x312f01,null))[_0xda18('0x46')](handleError(_0x312f01,null));};exports[_0xda18('0x4a')]=function(_0x54a71a,_0x587dbb){if(_0x54a71a[_0xda18('0x4b')]['id']){delete _0x54a71a[_0xda18('0x4b')]['id'];}return db[_0xda18('0x2d')][_0xda18('0x49')]({'where':{'id':_0x54a71a[_0xda18('0x47')]['id']}})[_0xda18('0x24')](handleEntityNotFound(_0x587dbb,null))[_0xda18('0x24')](saveUpdates(_0x54a71a[_0xda18('0x4b')],null))[_0xda18('0x24')](respondWithResult(_0x587dbb,null))[_0xda18('0x46')](handleError(_0x587dbb,null));};exports[_0xda18('0x25')]=function(_0x134a03,_0xd9a971){return db[_0xda18('0x2d')][_0xda18('0x49')]({'where':{'id':_0x134a03[_0xda18('0x47')]['id']}})[_0xda18('0x24')](handleEntityNotFound(_0xd9a971,null))[_0xda18('0x24')](removeEntity(_0xd9a971,null))['catch'](handleError(_0xd9a971,null));};exports['describe']=function(_0x19b071,_0x26175f){return db['CmHopperBlack'][_0xda18('0x4c')]()['then'](respondWithResult(_0x26175f,null))[_0xda18('0x46')](handleError(_0x26175f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4a6f758..7ca4d90 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 _0xabc3=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0xabc3,0x156));var _0x3abc=function(_0xf5f659,_0x58e70d){_0xf5f659=_0xf5f659-0x0;var _0x4fecb4=_0xabc3[_0xf5f659];return _0x4fecb4;};'use strict';var _=require(_0x3abc('0x0'));var util=require(_0x3abc('0x1'));var logger=require(_0x3abc('0x2'))(_0x3abc('0x3'));var moment=require(_0x3abc('0x4'));var BPromise=require(_0x3abc('0x5'));var rp=require(_0x3abc('0x6'));var fs=require('fs');var path=require(_0x3abc('0x7'));var rimraf=require(_0x3abc('0x8'));var config=require(_0x3abc('0x9'));var attributes=require(_0x3abc('0xa'));module[_0x3abc('0xb')]=function(_0x463b74,_0x124215){return _0x463b74['define'](_0x3abc('0xc'),attributes,{'tableName':_0x3abc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef3b=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api'];(function(_0x1bef12,_0x479fb7){var _0x21cab0=function(_0x3a904f){while(--_0x3a904f){_0x1bef12['push'](_0x1bef12['shift']());}};_0x21cab0(++_0x479fb7);}(_0xef3b,0x1e9));var _0xbef3=function(_0x51761b,_0x152518){_0x51761b=_0x51761b-0x0;var _0x380cfe=_0xef3b[_0x51761b];return _0x380cfe;};'use strict';var _=require('lodash');var util=require(_0xbef3('0x0'));var logger=require(_0xbef3('0x1'))(_0xbef3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbef3('0x3'));var fs=require('fs');var path=require(_0xbef3('0x4'));var rimraf=require(_0xbef3('0x5'));var config=require(_0xbef3('0x6'));var attributes=require(_0xbef3('0x7'));module[_0xbef3('0x8')]=function(_0x47be4c,_0xb12e7e){return _0x47be4c[_0xbef3('0x9')](_0xbef3('0xa'),attributes,{'tableName':_0xbef3('0xb'),'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 a03eef4..151f780 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 _0xc40b=['CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','result','catch'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0xc40b,0xfa));var _0xbc40=function(_0x1d2b4b,_0x1b8974){_0x1d2b4b=_0x1d2b4b-0x0;var _0x54d25f=_0xc40b[_0x1d2b4b];return _0x54d25f;};'use strict';var _=require(_0xbc40('0x0'));var util=require(_0xbc40('0x1'));var moment=require('moment');var BPromise=require(_0xbc40('0x2'));var rs=require(_0xbc40('0x3'));var fs=require('fs');var Redis=require(_0xbc40('0x4'));var db=require(_0xbc40('0x5'))['db'];var utils=require(_0xbc40('0x6'));var logger=require(_0xbc40('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbc40('0x8'));var client=jayson[_0xbc40('0x9')][_0xbc40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431aee,_0x335450,_0x439963){return new BPromise(function(_0x84d36e,_0xa30e84){return client['request'](_0x431aee,_0x439963)[_0xbc40('0xb')](function(_0x1b32ec){logger[_0xbc40('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x335450,'request\x20sent');logger[_0xbc40('0xd')](_0xbc40('0xe'),_0x335450,_0xbc40('0xf'),JSON[_0xbc40('0x10')](_0x1b32ec));if(_0x1b32ec[_0xbc40('0x11')]){if(_0x1b32ec[_0xbc40('0x11')][_0xbc40('0x12')]===0x1f4){logger[_0xbc40('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x335450,_0x1b32ec[_0xbc40('0x11')][_0xbc40('0x13')]);return _0xa30e84(_0x1b32ec[_0xbc40('0x11')]['message']);}logger[_0xbc40('0x11')](_0xbc40('0x14'),_0x335450,_0x1b32ec['error'][_0xbc40('0x13')]);return _0x84d36e(_0x1b32ec['error']['message']);}else{logger[_0xbc40('0xc')](_0xbc40('0x14'),_0x335450,_0xbc40('0xf'));_0x84d36e(_0x1b32ec[_0xbc40('0x15')][_0xbc40('0x13')]);}})[_0xbc40('0x16')](function(_0x4e3537){logger[_0xbc40('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x335450,_0x4e3537);_0xa30e84(_0x4e3537);});});}exports['GetCmHopperBlack']=function(_0x197dde){var _0x464084=this;return new Promise(function(_0x544f9f,_0x311278){return db[_0xbc40('0x17')][_0xbc40('0x18')]({'raw':_0x197dde[_0xbc40('0x19')]?_0x197dde[_0xbc40('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x197dde['options']?_0x197dde[_0xbc40('0x19')][_0xbc40('0x1a')]||null:null,'attributes':_0x197dde['options']?_0x197dde[_0xbc40('0x19')][_0xbc40('0x1b')]||null:null,'limit':_0x197dde[_0xbc40('0x19')]?_0x197dde[_0xbc40('0x19')][_0xbc40('0x1c')]||null:null,'include':_0x197dde[_0xbc40('0x19')]?_0x197dde[_0xbc40('0x19')][_0xbc40('0x1d')]?_[_0xbc40('0x1e')](_0x197dde['options'][_0xbc40('0x1d')],function(_0x3119b9){return{'model':db[_0x3119b9[_0xbc40('0x1f')]],'as':_0x3119b9['as'],'attributes':_0x3119b9[_0xbc40('0x1b')],'include':_0x3119b9['include']?_[_0xbc40('0x1e')](_0x3119b9[_0xbc40('0x1d')],function(_0x19929c){return{'model':db[_0x19929c['model']],'as':_0x19929c['as'],'attributes':_0x19929c[_0xbc40('0x1b')],'include':_0x19929c[_0xbc40('0x1d')]?_['map'](_0x19929c[_0xbc40('0x1d')],function(_0x560293){return{'model':db[_0x560293[_0xbc40('0x1f')]],'as':_0x560293['as'],'attributes':_0x560293['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc40('0xb')](function(_0x3f7ec1){logger[_0xbc40('0xc')](_0xbc40('0x20'),_0x197dde);logger['debug']('GetCmHopperBlack',_0x197dde,JSON[_0xbc40('0x10')](_0x3f7ec1));_0x544f9f(_0x3f7ec1);})[_0xbc40('0x16')](function(_0x3155f7){logger[_0xbc40('0x11')](_0xbc40('0x20'),_0x3155f7[_0xbc40('0x13')],_0x197dde);_0x311278(_0x464084['error'](0x1f4,_0x3155f7[_0xbc40('0x13')]));});});};exports[_0xbc40('0x21')]=function(_0x5c758e){var _0x425d82=this;return new Promise(function(_0x56dacd,_0x51ea07){return db[_0xbc40('0x17')][_0xbc40('0x22')](_0x5c758e[_0xbc40('0x23')],{'raw':_0x5c758e[_0xbc40('0x19')]?_0x5c758e[_0xbc40('0x19')][_0xbc40('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c758e[_0xbc40('0x19')]?_0x5c758e['options'][_0xbc40('0x1a')]||null:null,'attributes':_0x5c758e[_0xbc40('0x19')]?_0x5c758e[_0xbc40('0x19')][_0xbc40('0x1b')]||null:null,'limit':_0x5c758e['options']?_0x5c758e[_0xbc40('0x19')][_0xbc40('0x1c')]||null:null})['then'](function(_0xc588e6){logger['info'](_0xbc40('0x21'),_0x5c758e);logger[_0xbc40('0xd')](_0xbc40('0x21'),_0x5c758e,JSON[_0xbc40('0x10')](_0xc588e6));_0x56dacd(_0xc588e6);})[_0xbc40('0x16')](function(_0x227019){logger['error']('UpdateCmHopperBlack',_0x227019[_0xbc40('0x13')],_0x5c758e);_0x51ea07(_0x425d82[_0xbc40('0x11')](0x1f4,_0x227019[_0xbc40('0x13')]));});});};exports[_0xbc40('0x25')]=function(_0x582750){var _0x2dae23=this;return new Promise(function(_0x4ff17a,_0x21e78d){return db[_0xbc40('0x17')][_0xbc40('0x26')]({'where':_0x582750[_0xbc40('0x19')]?_0x582750[_0xbc40('0x19')][_0xbc40('0x1a')]||null:null})[_0xbc40('0xb')](function(_0x4abcb0){logger[_0xbc40('0xc')]('DestroyCmHopperBlack',_0x582750);logger[_0xbc40('0xd')](_0xbc40('0x25'),_0x582750,JSON[_0xbc40('0x10')](_0x4abcb0));_0x4ff17a(_0x4abcb0);})['catch'](function(_0x5922e6){logger[_0xbc40('0x11')]('DestroyCmHopperBlack',_0x5922e6[_0xbc40('0x13')],_0x582750);_0x21e78d(_0x2dae23['error'](0x1f4,_0x5922e6['message']));});});}; \ No newline at end of file +var _0xdc30=['limit','map','include','model','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','options','attributes'];(function(_0x255f64,_0x547201){var _0x59c4f2=function(_0x1f80e3){while(--_0x1f80e3){_0x255f64['push'](_0x255f64['shift']());}};_0x59c4f2(++_0x547201);}(_0xdc30,0x180));var _0x0dc3=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0xdc30[_0x48326a];return _0x466709;};'use strict';var _=require(_0x0dc3('0x0'));var util=require('util');var moment=require(_0x0dc3('0x1'));var BPromise=require(_0x0dc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dc3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0dc3('0x4'));var logger=require(_0x0dc3('0x5'))(_0x0dc3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0dc3('0x7')][_0x0dc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42ec56,_0x273389,_0x5b9f3e){return new BPromise(function(_0x22b7ee,_0xcee6f7){return client[_0x0dc3('0x9')](_0x42ec56,_0x5b9f3e)[_0x0dc3('0xa')](function(_0x2eeb74){logger[_0x0dc3('0xb')](_0x0dc3('0xc'),_0x273389,_0x0dc3('0xd'));logger[_0x0dc3('0xe')](_0x0dc3('0xf'),_0x273389,_0x0dc3('0xd'),JSON[_0x0dc3('0x10')](_0x2eeb74));if(_0x2eeb74[_0x0dc3('0x11')]){if(_0x2eeb74[_0x0dc3('0x11')]['code']===0x1f4){logger[_0x0dc3('0x11')](_0x0dc3('0xc'),_0x273389,_0x2eeb74[_0x0dc3('0x11')]['message']);return _0xcee6f7(_0x2eeb74[_0x0dc3('0x11')]['message']);}logger['error'](_0x0dc3('0xc'),_0x273389,_0x2eeb74[_0x0dc3('0x11')][_0x0dc3('0x12')]);return _0x22b7ee(_0x2eeb74[_0x0dc3('0x11')][_0x0dc3('0x12')]);}else{logger[_0x0dc3('0xb')](_0x0dc3('0xc'),_0x273389,_0x0dc3('0xd'));_0x22b7ee(_0x2eeb74['result'][_0x0dc3('0x12')]);}})[_0x0dc3('0x13')](function(_0x11cef7){logger['error'](_0x0dc3('0xc'),_0x273389,_0x11cef7);_0xcee6f7(_0x11cef7);});});}exports[_0x0dc3('0x14')]=function(_0x270623){var _0x239b69=this;return new Promise(function(_0x5cfc2e,_0x1f5633){return db[_0x0dc3('0x15')]['findAll']({'raw':_0x270623[_0x0dc3('0x16')]?_0x270623[_0x0dc3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x270623[_0x0dc3('0x16')]?_0x270623[_0x0dc3('0x16')]['where']||null:null,'attributes':_0x270623[_0x0dc3('0x16')]?_0x270623[_0x0dc3('0x16')][_0x0dc3('0x17')]||null:null,'limit':_0x270623[_0x0dc3('0x16')]?_0x270623['options'][_0x0dc3('0x18')]||null:null,'include':_0x270623['options']?_0x270623[_0x0dc3('0x16')]['include']?_[_0x0dc3('0x19')](_0x270623[_0x0dc3('0x16')][_0x0dc3('0x1a')],function(_0x112cef){return{'model':db[_0x112cef['model']],'as':_0x112cef['as'],'attributes':_0x112cef[_0x0dc3('0x17')],'include':_0x112cef['include']?_['map'](_0x112cef[_0x0dc3('0x1a')],function(_0x481c96){return{'model':db[_0x481c96[_0x0dc3('0x1b')]],'as':_0x481c96['as'],'attributes':_0x481c96['attributes'],'include':_0x481c96[_0x0dc3('0x1a')]?_[_0x0dc3('0x19')](_0x481c96['include'],function(_0x1e48f2){return{'model':db[_0x1e48f2['model']],'as':_0x1e48f2['as'],'attributes':_0x1e48f2[_0x0dc3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0dc3('0xa')](function(_0x9f2f6f){logger[_0x0dc3('0xb')](_0x0dc3('0x14'),_0x270623);logger[_0x0dc3('0xe')](_0x0dc3('0x14'),_0x270623,JSON[_0x0dc3('0x10')](_0x9f2f6f));_0x5cfc2e(_0x9f2f6f);})['catch'](function(_0x15d509){logger[_0x0dc3('0x11')](_0x0dc3('0x14'),_0x15d509[_0x0dc3('0x12')],_0x270623);_0x1f5633(_0x239b69[_0x0dc3('0x11')](0x1f4,_0x15d509[_0x0dc3('0x12')]));});});};exports[_0x0dc3('0x1c')]=function(_0x85a33c){var _0x851a63=this;return new Promise(function(_0x586c49,_0x1c2b7b){return db[_0x0dc3('0x15')][_0x0dc3('0x1d')](_0x85a33c[_0x0dc3('0x1e')],{'raw':_0x85a33c[_0x0dc3('0x16')]?_0x85a33c['options'][_0x0dc3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x85a33c[_0x0dc3('0x16')]?_0x85a33c[_0x0dc3('0x16')]['where']||null:null,'attributes':_0x85a33c['options']?_0x85a33c[_0x0dc3('0x16')][_0x0dc3('0x17')]||null:null,'limit':_0x85a33c[_0x0dc3('0x16')]?_0x85a33c['options'][_0x0dc3('0x18')]||null:null})[_0x0dc3('0xa')](function(_0x443c46){logger[_0x0dc3('0xb')](_0x0dc3('0x1c'),_0x85a33c);logger[_0x0dc3('0xe')](_0x0dc3('0x1c'),_0x85a33c,JSON[_0x0dc3('0x10')](_0x443c46));_0x586c49(_0x443c46);})[_0x0dc3('0x13')](function(_0xb30336){logger['error']('UpdateCmHopperBlack',_0xb30336[_0x0dc3('0x12')],_0x85a33c);_0x1c2b7b(_0x851a63[_0x0dc3('0x11')](0x1f4,_0xb30336[_0x0dc3('0x12')]));});});};exports[_0x0dc3('0x20')]=function(_0x1d490b){var _0x5e994b=this;return new Promise(function(_0x1ca244,_0x2138e4){return db[_0x0dc3('0x15')][_0x0dc3('0x21')]({'where':_0x1d490b[_0x0dc3('0x16')]?_0x1d490b[_0x0dc3('0x16')]['where']||null:null})[_0x0dc3('0xa')](function(_0x124dde){logger['info'](_0x0dc3('0x20'),_0x1d490b);logger['debug'](_0x0dc3('0x20'),_0x1d490b,JSON[_0x0dc3('0x10')](_0x124dde));_0x1ca244(_0x124dde);})['catch'](function(_0x262b14){logger[_0x0dc3('0x11')](_0x0dc3('0x20'),_0x262b14['message'],_0x1d490b);_0x2138e4(_0x5e994b[_0x0dc3('0x11')](0x1f4,_0x262b14['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 942c10b..d09d147 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 _0x7096=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update'];(function(_0x5a03dd,_0x44fb9a){var _0x517573=function(_0x4d1fc8){while(--_0x4d1fc8){_0x5a03dd['push'](_0x5a03dd['shift']());}};_0x517573(++_0x44fb9a);}(_0x7096,0x10c));var _0x6709=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7096[_0x47b58b];return _0x46bebe;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['get']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0xd')]);router[_0x6709('0xe')](_0x6709('0xf'),auth[_0x6709('0x9')](),controller[_0x6709('0x10')]);router['delete']('/:id',auth[_0x6709('0x9')](),controller[_0x6709('0x11')]);module[_0x6709('0x12')]=router; \ No newline at end of file +var _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x333e0b,_0x4eb09c){var _0x4b5115=function(_0x22d450){while(--_0x22d450){_0x333e0b['push'](_0x333e0b['shift']());}};_0x4b5115(++_0x4eb09c);}(_0x2a07,0x74));var _0x72a0=function(_0x3a0614,_0x4b6627){_0x3a0614=_0x3a0614-0x0;var _0x12bba7=_0x2a07[_0x3a0614];return _0x12bba7;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller['update']);router[_0x72a0('0x11')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);module[_0x72a0('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7ebf9d1..ac9e949 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 _0xaec8=['seconds','BOOLEAN','sequelize','exports','INTEGER','DATE','STRING','getDataValue','followuptime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaec8,0x12b));var _0x8aec=function(_0x55bf4a,_0x2ef352){_0x55bf4a=_0x55bf4a-0x0;var _0x2a428f=_0xaec8[_0x55bf4a];return _0x2a428f;};'use strict';var Sequelize=require(_0x8aec('0x0'));var moment=require('moment');module[_0x8aec('0x1')]={'state':{'type':Sequelize[_0x8aec('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x8aec('0x3')]},'countbusyretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8aec('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8aec('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8aec('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8aec('0x3')]},'answertime':{'type':Sequelize[_0x8aec('0x3')]},'droptime':{'type':Sequelize[_0x8aec('0x3')]},'endtime':{'type':Sequelize[_0x8aec('0x3')]},'ringtime':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8aec('0x4')]},'campaign':{'type':Sequelize[_0x8aec('0x4')]},'campaigntype':{'type':Sequelize[_0x8aec('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8aec('0x4')]},'disposition':{'type':Sequelize[_0x8aec('0x4')]},'secondDisposition':{'type':Sequelize[_0x8aec('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8aec('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2668dc){var _0x1f5cb5=this[_0x8aec('0x5')]('endtime');if(_0x1f5cb5&&_0x2668dc){this['setDataValue'](_0x8aec('0x6'),moment(_0x2668dc)['diff'](moment(_0x1f5cb5),_0x8aec('0x7')));}}},'amd':{'type':Sequelize[_0x8aec('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8aec('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8aec('0x3')]},'callback':{'type':Sequelize[_0x8aec('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8aec('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8aec('0x3')]},'deleted':{'type':Sequelize[_0x8aec('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8aec('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8aec('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8aec('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3cf3=['STRING','getDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','DATE'];(function(_0x2947dd,_0x1636bb){var _0xe8848b=function(_0x5363fc){while(--_0x5363fc){_0x2947dd['push'](_0x2947dd['shift']());}};_0xe8848b(++_0x1636bb);}(_0x3cf3,0x109));var _0x33cf=function(_0x58e84a,_0x57ed90){_0x58e84a=_0x58e84a-0x0;var _0x3b2e7f=_0x3cf3[_0x58e84a];return _0x3b2e7f;};'use strict';var Sequelize=require(_0x33cf('0x0'));var moment=require(_0x33cf('0x1'));module[_0x33cf('0x2')]={'state':{'type':Sequelize[_0x33cf('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x33cf('0x4')]},'countbusyretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x33cf('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x33cf('0x5')]},'originatecalleridname':{'type':Sequelize[_0x33cf('0x5')]},'calleridnum':{'type':Sequelize[_0x33cf('0x5')]},'calleridname':{'type':Sequelize[_0x33cf('0x5')]},'starttime':{'type':Sequelize[_0x33cf('0x4')]},'responsetime':{'type':Sequelize[_0x33cf('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x33cf('0x4')]},'ringtime':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x33cf('0x5')]},'campaign':{'type':Sequelize[_0x33cf('0x5')]},'campaigntype':{'type':Sequelize[_0x33cf('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x33cf('0x5')]},'disposition':{'type':Sequelize[_0x33cf('0x5')]},'secondDisposition':{'type':Sequelize[_0x33cf('0x5')]},'thirdDisposition':{'type':Sequelize[_0x33cf('0x5')]},'dispositionat':{'type':Sequelize[_0x33cf('0x4')],'set':function(_0x277257){var _0x383120=this[_0x33cf('0x6')]('endtime');if(_0x383120&&_0x277257){this['setDataValue'](_0x33cf('0x7'),moment(_0x277257)[_0x33cf('0x8')](moment(_0x383120),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x33cf('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x33cf('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x33cf('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x33cf('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x33cf('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x33cf('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x33cf('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 a7a90fe..b9f2627 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 _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x47b4d4,_0x4d4390){var _0x1c7822=function(_0x144a26){while(--_0x144a26){_0x47b4d4['push'](_0x47b4d4['shift']());}};_0x1c7822(++_0x4d4390);}(_0xc2c7,0x134));var _0x7c2c=function(_0x456495,_0x17ae31){_0x456495=_0x456495-0x0;var _0x501e29=_0xc2c7[_0x456495];return _0x501e29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file +var _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x687b,0x14a));var _0xb687=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0x687b[_0x8e7772];return _0x408200;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index eea874e..72ebbb0 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 _0x8b34=['request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api'];(function(_0x4b890f,_0x2a2d03){var _0x549270=function(_0x1fd86d){while(--_0x1fd86d){_0x4b890f['push'](_0x4b890f['shift']());}};_0x549270(++_0x2a2d03);}(_0x8b34,0x11b));var _0x48b3=function(_0x18170b,_0x34d663){_0x18170b=_0x18170b-0x0;var _0x2dc86a=_0x8b34[_0x18170b];return _0x2dc86a;};'use strict';var _=require('lodash');var util=require(_0x48b3('0x0'));var logger=require(_0x48b3('0x1'))(_0x48b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48b3('0x3'));var fs=require('fs');var path=require(_0x48b3('0x4'));var rimraf=require('rimraf');var config=require(_0x48b3('0x5'));var attributes=require(_0x48b3('0x6'));module[_0x48b3('0x7')]=function(_0x21dcc1,_0x23863b){return _0x21dcc1[_0x48b3('0x8')](_0x48b3('0x9'),attributes,{'tableName':_0x48b3('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x48b3('0xb')]},{'name':_0x48b3('0xc'),'fields':[_0x48b3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab08=['./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x45123b,_0xbfe845){var _0x2d7045=function(_0x2a1e92){while(--_0x2a1e92){_0x45123b['push'](_0x45123b['shift']());}};_0x2d7045(++_0xbfe845);}(_0xab08,0x1bd));var _0x8ab0=function(_0x235e66,_0x4bef96){_0x235e66=_0x235e66-0x0;var _0x36019b=_0xab08[_0x235e66];return _0x36019b;};'use strict';var _=require(_0x8ab0('0x0'));var util=require(_0x8ab0('0x1'));var logger=require('../../config/logger')(_0x8ab0('0x2'));var moment=require('moment');var BPromise=require(_0x8ab0('0x3'));var rp=require(_0x8ab0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ab0('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ab0('0x6'));module[_0x8ab0('0x7')]=function(_0x39558f,_0x102557){return _0x39558f['define']('CmHopperFinal',attributes,{'tableName':_0x8ab0('0x8'),'paranoid':![],'indexes':[{'name':_0x8ab0('0x9'),'fields':['calleridnum']},{'name':_0x8ab0('0xa'),'fields':[_0x8ab0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 5bc5d51..ff8f302 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(_0x339c9d,_0x378f66){var _0x20c873=function(_0x920b3a){while(--_0x920b3a){_0x339c9d['push'](_0x339c9d['shift']());}};_0x20c873(++_0x378f66);}(_0xb10b,0x12a));var _0xbb10=function(_0x10c2d3,_0x2f5914){_0x10c2d3=_0x10c2d3-0x0;var _0x5a0b13=_0xb10b[_0x10c2d3];return _0x5a0b13;};'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(_0x554332,_0x58def9){var _0x350d3a=function(_0x4a554f){while(--_0x4a554f){_0x554332['push'](_0x554332['shift']());}};_0x350d3a(++_0x58def9);}(_0xb10b,0x12a));var _0xbb10=function(_0x53a0ce,_0x5eaa86){_0x53a0ce=_0x53a0ce-0x0;var _0x491112=_0xb10b[_0x53a0ce];return _0x491112;};'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 f926b79..3298670 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 _0xb66a=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','put','update','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x60f5f6,_0x1ae9a7){var _0x213160=function(_0x8ffb9a){while(--_0x8ffb9a){_0x60f5f6['push'](_0x60f5f6['shift']());}};_0x213160(++_0x1ae9a7);}(_0xb66a,0x163));var _0xab66=function(_0x284c9e,_0x1c7715){_0x284c9e=_0x284c9e-0x0;var _0x4e0648=_0xb66a[_0x284c9e];return _0x4e0648;};'use strict';var multer=require(_0xab66('0x0'));var util=require(_0xab66('0x1'));var path=require(_0xab66('0x2'));var timeout=require('connect-timeout');var express=require(_0xab66('0x3'));var router=express['Router']();var fs_extra=require(_0xab66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab66('0x5'));var config=require(_0xab66('0x6'));var controller=require(_0xab66('0x7'));router['get']('/',auth[_0xab66('0x8')](),controller['index']);router[_0xab66('0x9')](_0xab66('0xa'),auth[_0xab66('0x8')](),controller[_0xab66('0xb')]);router['get'](_0xab66('0xc'),auth[_0xab66('0x8')](),controller['show']);router[_0xab66('0x9')](_0xab66('0xd'),auth[_0xab66('0x8')](),controller[_0xab66('0xe')]);router['get'](_0xab66('0xf'),auth[_0xab66('0x8')](),controller[_0xab66('0x10')]);router['post'](_0xab66('0x11'),auth[_0xab66('0x8')](),controller[_0xab66('0x12')]);router[_0xab66('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0xab66('0x14')]);router[_0xab66('0x13')]('/checkContactHopper',auth[_0xab66('0x8')](),controller['checkContactHopper']);router[_0xab66('0x15')](_0xab66('0xc'),auth[_0xab66('0x8')](),controller[_0xab66('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0758=['connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','/describe','isAuthenticated','describe','get','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','util','path'];(function(_0x43aba1,_0x36039a){var _0x19e62d=function(_0x337f06){while(--_0x337f06){_0x43aba1['push'](_0x43aba1['shift']());}};_0x19e62d(++_0x36039a);}(_0x0758,0x93));var _0x8075=function(_0x58b48b,_0x3a4db2){_0x58b48b=_0x58b48b-0x0;var _0x227f3c=_0x0758[_0x58b48b];return _0x227f3c;};'use strict';var multer=require(_0x8075('0x0'));var util=require(_0x8075('0x1'));var path=require(_0x8075('0x2'));var timeout=require(_0x8075('0x3'));var express=require(_0x8075('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8075('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8075('0x6'));var controller=require(_0x8075('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8075('0x8'),auth[_0x8075('0x9')](),controller[_0x8075('0xa')]);router[_0x8075('0xb')](_0x8075('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8075('0xd'),auth[_0x8075('0x9')](),controller[_0x8075('0xe')]);router['get'](_0x8075('0xf'),auth[_0x8075('0x9')](),controller[_0x8075('0x10')]);router['post'](_0x8075('0x11'),auth[_0x8075('0x9')](),controller[_0x8075('0x12')]);router[_0x8075('0x13')](_0x8075('0x14'),auth[_0x8075('0x9')](),controller[_0x8075('0x15')]);router[_0x8075('0x13')](_0x8075('0x16'),auth[_0x8075('0x9')](),controller[_0x8075('0x17')]);router['put'](_0x8075('0xc'),auth[_0x8075('0x9')](),controller['update']);module[_0x8075('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index e77ee0c..27b1c70 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 _0xa898=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xa898,0x17c));var _0x8a89=function(_0x36437e,_0x59afe5){_0x36437e=_0x36437e-0x0;var _0x1fd0cb=_0xa898[_0x36437e];return _0x1fd0cb;};'use strict';var Sequelize=require(_0x8a89('0x0'));module['exports']={'state':{'type':Sequelize[_0x8a89('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8a89('0x2')]},'scheduledat':{'type':Sequelize[_0x8a89('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x8a89('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8a89('0x2')]},'calleridname':{'type':Sequelize[_0x8a89('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8a89('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8a89('0x3')]},'endtime':{'type':Sequelize[_0x8a89('0x3')]},'ringtime':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8a89('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x8a89('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8a89('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8a89('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x8a89('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8a89('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8a89('0x2')]}}; \ No newline at end of file +var _0x2d97=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x57f776,_0x17a51f){var _0xd26537=function(_0x5cb2c8){while(--_0x5cb2c8){_0x57f776['push'](_0x57f776['shift']());}};_0xd26537(++_0x17a51f);}(_0x2d97,0x133));var _0x72d9=function(_0x2692c4,_0x437621){_0x2692c4=_0x2692c4-0x0;var _0x355005=_0x2d97[_0x2692c4];return _0x355005;};'use strict';var Sequelize=require(_0x72d9('0x0'));module[_0x72d9('0x1')]={'state':{'type':Sequelize[_0x72d9('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x72d9('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x72d9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x72d9('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x72d9('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x72d9('0x4')]},'originatecalleridname':{'type':Sequelize[_0x72d9('0x4')]},'calleridnum':{'type':Sequelize[_0x72d9('0x4')]},'calleridname':{'type':Sequelize[_0x72d9('0x4')]},'starttime':{'type':Sequelize[_0x72d9('0x3')]},'responsetime':{'type':Sequelize[_0x72d9('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x72d9('0x3')]},'endtime':{'type':Sequelize[_0x72d9('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x72d9('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x72d9('0x4')]},'campaigntype':{'type':Sequelize[_0x72d9('0x4')]},'membername':{'type':Sequelize[_0x72d9('0x4')]},'reason':{'type':Sequelize[_0x72d9('0x4')]},'amd':{'type':Sequelize[_0x72d9('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x72d9('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x72d9('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x72d9('0x3')]},'recallme':{'type':Sequelize[_0x72d9('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x72d9('0x3')]},'edited':{'type':Sequelize[_0x72d9('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x72d9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x72d9('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x72d9('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5762f75..67b547b 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 _0x71c6=['util','sox','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x1a48a0,_0x3c95f5){var _0x269714=function(_0x33d9e3){while(--_0x33d9e3){_0x1a48a0['push'](_0x1a48a0['shift']());}};_0x269714(++_0x3c95f5);}(_0x71c6,0x13e));var _0x671c=function(_0x3a9822,_0x5bdbf3){_0x3a9822=_0x3a9822-0x0;var _0x59ca0e=_0x71c6[_0x3a9822];return _0x59ca0e;};'use strict';var emlformat=require(_0x671c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x671c('0x1'));var jsonpatch=require(_0x671c('0x2'));var rp=require(_0x671c('0x3'));var moment=require('moment');var BPromise=require(_0x671c('0x4'));var Mustache=require(_0x671c('0x5'));var util=require(_0x671c('0x6'));var path=require('path');var sox=require(_0x671c('0x7'));var csv=require(_0x671c('0x8'));var ejs=require(_0x671c('0x9'));var fs=require('fs');var fs_extra=require(_0x671c('0xa'));var _=require(_0x671c('0xb'));var squel=require(_0x671c('0xc'));var crypto=require('crypto');var jsforce=require(_0x671c('0xd'));var deskjs=require(_0x671c('0xe'));var toCsv=require(_0x671c('0x8'));var querystring=require('querystring');var Papa=require(_0x671c('0xf'));var Redis=require(_0x671c('0x10'));var authService=require(_0x671c('0x11'));var qs=require(_0x671c('0x12'));var as=require(_0x671c('0x13'));var hardwareService=require(_0x671c('0x14'));var logger=require(_0x671c('0x15'))(_0x671c('0x16'));var utils=require(_0x671c('0x17'));var config=require(_0x671c('0x18'));var licenseUtil=require(_0x671c('0x19'));var db=require(_0x671c('0x1a'))['db'];function respondWithStatusCode(_0x2f3035,_0x56aa84){_0x56aa84=_0x56aa84||0xcc;return function(_0x5bdcb7){if(_0x5bdcb7){return _0x2f3035[_0x671c('0x1b')](_0x56aa84);}return _0x2f3035[_0x671c('0x1c')](_0x56aa84)[_0x671c('0x1d')]();};}function respondWithResult(_0x3ccc72,_0x123f4f){_0x123f4f=_0x123f4f||0xc8;return function(_0x1a0ae0){if(_0x1a0ae0){return _0x3ccc72['status'](_0x123f4f)[_0x671c('0x1e')](_0x1a0ae0);}};}function respondWithFilteredResult(_0x11e587,_0x4d4d4d){return function(_0x4e44d8){if(_0x4e44d8){var _0x4ad121=typeof _0x4d4d4d[_0x671c('0x1f')]===_0x671c('0x20')&&typeof _0x4d4d4d[_0x671c('0x21')]===_0x671c('0x20');var _0x4443f7=_0x4e44d8[_0x671c('0x22')];var _0x217f10=_0x4ad121?0x0:_0x4d4d4d[_0x671c('0x1f')];var _0x47701b=_0x4ad121?_0x4e44d8['count']:_0x4d4d4d['offset']+_0x4d4d4d[_0x671c('0x21')];var _0x3565a0;if(_0x47701b>=_0x4443f7){_0x47701b=_0x4443f7;_0x3565a0=0xc8;}else{_0x3565a0=0xce;}_0x11e587[_0x671c('0x1c')](_0x3565a0);return _0x11e587[_0x671c('0x23')](_0x671c('0x24'),_0x217f10+'-'+_0x47701b+'/'+_0x4443f7)[_0x671c('0x1e')](_0x4e44d8);}return null;};}function patchUpdates(_0x28074e){return function(_0xe85eae){try{jsonpatch[_0x671c('0x25')](_0xe85eae,_0x28074e,!![]);}catch(_0xb20454){return BPromise[_0x671c('0x26')](_0xb20454);}return _0xe85eae[_0x671c('0x27')]();};}function saveUpdates(_0x5dac34,_0x38c595){return function(_0x1d772e){if(_0x1d772e){return _0x1d772e[_0x671c('0x28')](_0x5dac34)[_0x671c('0x29')](function(_0x5a11f6){return _0x5a11f6;});}return null;};}function removeEntity(_0x2f21da,_0x5779e1){return function(_0x34addf){if(_0x34addf){return _0x34addf[_0x671c('0x2a')]()[_0x671c('0x29')](function(){_0x2f21da[_0x671c('0x1c')](0xcc)[_0x671c('0x1d')]();});}};}function handleEntityNotFound(_0x18c445,_0x30fb8a){return function(_0x456951){if(!_0x456951){_0x18c445[_0x671c('0x1b')](0x194);}return _0x456951;};}function handleError(_0x461657,_0x1800b8){_0x1800b8=_0x1800b8||0x1f4;return function(_0x1a9718){logger[_0x671c('0x2b')](_0x1a9718[_0x671c('0x2c')]);if(_0x1a9718[_0x671c('0x2d')]){delete _0x1a9718[_0x671c('0x2d')];}_0x461657[_0x671c('0x1c')](_0x1800b8)[_0x671c('0x2e')](_0x1a9718);};}exports['index']=function(_0x2294d2,_0x56ab2c){var _0x2005c5={},_0x302a59={},_0x542e27={'count':0x0,'rows':[]};var _0x1145c0=_[_0x671c('0x2f')](db[_0x671c('0x30')]['rawAttributes'],function(_0x2f9225){return{'name':_0x2f9225[_0x671c('0x31')],'type':_0x2f9225[_0x671c('0x32')][_0x671c('0x33')]};});_0x302a59[_0x671c('0x34')]=_[_0x671c('0x2f')](_0x1145c0,'name');_0x302a59[_0x671c('0x35')]=_[_0x671c('0x36')](_0x2294d2['query']);_0x302a59[_0x671c('0x37')]=_[_0x671c('0x38')](_0x302a59[_0x671c('0x34')],_0x302a59[_0x671c('0x35')]);_0x2005c5['attributes']=_['intersection'](_0x302a59[_0x671c('0x34')],qs[_0x671c('0x39')](_0x2294d2['query'][_0x671c('0x39')]));_0x2005c5[_0x671c('0x3a')]=_0x2005c5['attributes'][_0x671c('0x3b')]?_0x2005c5['attributes']:_0x302a59[_0x671c('0x34')];if(!_0x2294d2[_0x671c('0x35')][_0x671c('0x3c')](_0x671c('0x3d'))){_0x2005c5[_0x671c('0x21')]=qs[_0x671c('0x21')](_0x2294d2['query'][_0x671c('0x21')]);_0x2005c5[_0x671c('0x1f')]=qs[_0x671c('0x1f')](_0x2294d2[_0x671c('0x35')]['offset']);}_0x2005c5[_0x671c('0x3e')]=qs[_0x671c('0x3f')](_0x2294d2[_0x671c('0x35')][_0x671c('0x3f')]);_0x2005c5[_0x671c('0x40')]=qs[_0x671c('0x37')](_[_0x671c('0x41')](_0x2294d2[_0x671c('0x35')],_0x302a59['filters']),_0x1145c0);if(_0x2294d2[_0x671c('0x35')][_0x671c('0x42')]){_0x2005c5[_0x671c('0x40')]=_[_0x671c('0x43')](_0x2005c5[_0x671c('0x40')],{'$or':_['map'](_0x1145c0,function(_0x4c2ae5){if(_0x4c2ae5[_0x671c('0x32')]!==_0x671c('0x44')){var _0x5ef91b={};_0x5ef91b[_0x4c2ae5['name']]={'$like':'%'+_0x2294d2['query'][_0x671c('0x42')]+'%'};return _0x5ef91b;}})});}_0x2005c5=_['merge']({},_0x2005c5,_0x2294d2[_0x671c('0x45')]);var _0x55a37f={'where':_0x2005c5[_0x671c('0x40')]};return db[_0x671c('0x30')][_0x671c('0x22')](_0x55a37f)[_0x671c('0x29')](function(_0x4e20ca){_0x542e27[_0x671c('0x22')]=_0x4e20ca;if(_0x2294d2[_0x671c('0x35')][_0x671c('0x46')]){_0x2005c5[_0x671c('0x47')]=[{'all':!![]}];}return db[_0x671c('0x30')][_0x671c('0x48')](_0x2005c5);})[_0x671c('0x29')](function(_0x581ede){_0x542e27['rows']=_0x581ede;return _0x542e27;})[_0x671c('0x29')](respondWithFilteredResult(_0x56ab2c,_0x2005c5))[_0x671c('0x49')](handleError(_0x56ab2c,null));};exports[_0x671c('0x4a')]=function(_0x4287d9,_0x24e6ad){var _0x38867c={'raw':!![],'where':{'id':_0x4287d9[_0x671c('0x4b')]['id']}},_0x2cde66={};_0x2cde66['model']=_[_0x671c('0x36')](db[_0x671c('0x30')]['rawAttributes']);_0x2cde66[_0x671c('0x35')]=_[_0x671c('0x36')](_0x4287d9['query']);_0x2cde66['filters']=_['intersection'](_0x2cde66['model'],_0x2cde66[_0x671c('0x35')]);_0x38867c[_0x671c('0x3a')]=_[_0x671c('0x38')](_0x2cde66[_0x671c('0x34')],qs[_0x671c('0x39')](_0x4287d9[_0x671c('0x35')][_0x671c('0x39')]));_0x38867c[_0x671c('0x3a')]=_0x38867c[_0x671c('0x3a')][_0x671c('0x3b')]?_0x38867c[_0x671c('0x3a')]:_0x2cde66['model'];if(_0x4287d9['query'][_0x671c('0x46')]){_0x38867c[_0x671c('0x47')]=[{'all':!![]}];}_0x38867c=_[_0x671c('0x43')]({},_0x38867c,_0x4287d9[_0x671c('0x45')]);return db[_0x671c('0x30')][_0x671c('0x4c')](_0x38867c)[_0x671c('0x29')](handleEntityNotFound(_0x24e6ad,null))[_0x671c('0x29')](respondWithResult(_0x24e6ad,null))[_0x671c('0x49')](handleError(_0x24e6ad,null));};exports[_0x671c('0x4d')]=function(_0x2c31cc,_0x1d2caa){return db[_0x671c('0x30')][_0x671c('0x4d')](_0x2c31cc[_0x671c('0x4e')],{})[_0x671c('0x29')](respondWithResult(_0x1d2caa,0xc9))[_0x671c('0x49')](handleError(_0x1d2caa,null));};exports[_0x671c('0x4f')]=function(_0x285878,_0x2d5da7){return db[_0x671c('0x30')][_0x671c('0x4f')]()[_0x671c('0x29')](respondWithResult(_0x2d5da7,null))[_0x671c('0x49')](handleError(_0x2d5da7,null));};exports[_0x671c('0x28')]=function(_0x52c849,_0x118149){if(_0x52c849[_0x671c('0x4e')][_0x671c('0x50')]){delete _0x52c849['body'][_0x671c('0x50')];}return db[_0x671c('0x30')][_0x671c('0x4c')]({'where':{'uniqueid':_0x52c849[_0x671c('0x4b')]['id']}})[_0x671c('0x29')](handleEntityNotFound(_0x118149,null))[_0x671c('0x29')](saveUpdates(_0x52c849[_0x671c('0x4e')],null))[_0x671c('0x29')](respondWithResult(_0x118149,null))['catch'](handleError(_0x118149,null));}; \ No newline at end of file +var _0x08c5=['destroy','then','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','CmHopperHistory','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','update','uniqueid','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject'];(function(_0x8e52f8,_0x263800){var _0x207335=function(_0x482ba6){while(--_0x482ba6){_0x8e52f8['push'](_0x8e52f8['shift']());}};_0x207335(++_0x263800);}(_0x08c5,0x187));var _0x508c=function(_0x3aabbb,_0x2b1dc2){_0x3aabbb=_0x3aabbb-0x0;var _0x197ee1=_0x08c5[_0x3aabbb];return _0x197ee1;};'use strict';var emlformat=require(_0x508c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x508c('0x1'));var moment=require(_0x508c('0x2'));var BPromise=require(_0x508c('0x3'));var Mustache=require(_0x508c('0x4'));var util=require(_0x508c('0x5'));var path=require(_0x508c('0x6'));var sox=require('sox');var csv=require(_0x508c('0x7'));var ejs=require(_0x508c('0x8'));var fs=require('fs');var fs_extra=require(_0x508c('0x9'));var _=require(_0x508c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x508c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x508c('0x7'));var querystring=require(_0x508c('0xc'));var Papa=require('papaparse');var Redis=require(_0x508c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x508c('0xe'));var as=require(_0x508c('0xf'));var hardwareService=require(_0x508c('0x10'));var logger=require(_0x508c('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x508c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52f067,_0x1e1079){_0x1e1079=_0x1e1079||0xcc;return function(_0x511a96){if(_0x511a96){return _0x52f067[_0x508c('0x13')](_0x1e1079);}return _0x52f067[_0x508c('0x14')](_0x1e1079)[_0x508c('0x15')]();};}function respondWithResult(_0x1863f3,_0x4e331b){_0x4e331b=_0x4e331b||0xc8;return function(_0x56b197){if(_0x56b197){return _0x1863f3[_0x508c('0x14')](_0x4e331b)[_0x508c('0x16')](_0x56b197);}};}function respondWithFilteredResult(_0x36520c,_0xcddbaf){return function(_0x5cb87b){if(_0x5cb87b){var _0x18899c=typeof _0xcddbaf['offset']==='undefined'&&typeof _0xcddbaf['limit']==='undefined';var _0x27479d=_0x5cb87b[_0x508c('0x17')];var _0x2b8acf=_0x18899c?0x0:_0xcddbaf['offset'];var _0x2f2a5f=_0x18899c?_0x5cb87b[_0x508c('0x17')]:_0xcddbaf[_0x508c('0x18')]+_0xcddbaf['limit'];var _0x3d749c;if(_0x2f2a5f>=_0x27479d){_0x2f2a5f=_0x27479d;_0x3d749c=0xc8;}else{_0x3d749c=0xce;}_0x36520c[_0x508c('0x14')](_0x3d749c);return _0x36520c[_0x508c('0x19')](_0x508c('0x1a'),_0x2b8acf+'-'+_0x2f2a5f+'/'+_0x27479d)[_0x508c('0x16')](_0x5cb87b);}return null;};}function patchUpdates(_0x3de61a){return function(_0x240b80){try{jsonpatch[_0x508c('0x1b')](_0x240b80,_0x3de61a,!![]);}catch(_0x248ec2){return BPromise[_0x508c('0x1c')](_0x248ec2);}return _0x240b80['save']();};}function saveUpdates(_0x11db14,_0x4c519c){return function(_0x2a2281){if(_0x2a2281){return _0x2a2281['update'](_0x11db14)['then'](function(_0x1cb69d){return _0x1cb69d;});}return null;};}function removeEntity(_0x43ab73,_0x454ced){return function(_0x3c7f14){if(_0x3c7f14){return _0x3c7f14[_0x508c('0x1d')]()[_0x508c('0x1e')](function(){_0x43ab73[_0x508c('0x14')](0xcc)[_0x508c('0x15')]();});}};}function handleEntityNotFound(_0x22c2e7,_0x3cb2b7){return function(_0x414934){if(!_0x414934){_0x22c2e7[_0x508c('0x13')](0x194);}return _0x414934;};}function handleError(_0x5c7acc,_0x511c67){_0x511c67=_0x511c67||0x1f4;return function(_0xac6b1){logger[_0x508c('0x1f')](_0xac6b1[_0x508c('0x20')]);if(_0xac6b1[_0x508c('0x21')]){delete _0xac6b1['name'];}_0x5c7acc[_0x508c('0x14')](_0x511c67)[_0x508c('0x22')](_0xac6b1);};}exports['index']=function(_0x3ec1e5,_0x3eb63c){var _0x40072f={},_0x29870c={},_0x3e4a3d={'count':0x0,'rows':[]};var _0x1f5344=_['map'](db['CmHopperHistory'][_0x508c('0x23')],function(_0x17afa4){return{'name':_0x17afa4[_0x508c('0x24')],'type':_0x17afa4[_0x508c('0x25')]['key']};});_0x29870c[_0x508c('0x26')]=_[_0x508c('0x27')](_0x1f5344,_0x508c('0x21'));_0x29870c[_0x508c('0x28')]=_[_0x508c('0x29')](_0x3ec1e5[_0x508c('0x28')]);_0x29870c[_0x508c('0x2a')]=_[_0x508c('0x2b')](_0x29870c['model'],_0x29870c[_0x508c('0x28')]);_0x40072f[_0x508c('0x2c')]=_[_0x508c('0x2b')](_0x29870c[_0x508c('0x26')],qs[_0x508c('0x2d')](_0x3ec1e5['query'][_0x508c('0x2d')]));_0x40072f['attributes']=_0x40072f[_0x508c('0x2c')][_0x508c('0x2e')]?_0x40072f[_0x508c('0x2c')]:_0x29870c['model'];if(!_0x3ec1e5[_0x508c('0x28')][_0x508c('0x2f')](_0x508c('0x30'))){_0x40072f[_0x508c('0x31')]=qs['limit'](_0x3ec1e5[_0x508c('0x28')]['limit']);_0x40072f[_0x508c('0x18')]=qs[_0x508c('0x18')](_0x3ec1e5[_0x508c('0x28')][_0x508c('0x18')]);}_0x40072f[_0x508c('0x32')]=qs[_0x508c('0x33')](_0x3ec1e5[_0x508c('0x28')][_0x508c('0x33')]);_0x40072f['where']=qs[_0x508c('0x2a')](_['pick'](_0x3ec1e5[_0x508c('0x28')],_0x29870c[_0x508c('0x2a')]),_0x1f5344);if(_0x3ec1e5[_0x508c('0x28')][_0x508c('0x34')]){_0x40072f[_0x508c('0x35')]=_[_0x508c('0x36')](_0x40072f[_0x508c('0x35')],{'$or':_[_0x508c('0x27')](_0x1f5344,function(_0x1982c6){if(_0x1982c6[_0x508c('0x25')]!=='VIRTUAL'){var _0x100e0b={};_0x100e0b[_0x1982c6[_0x508c('0x21')]]={'$like':'%'+_0x3ec1e5[_0x508c('0x28')][_0x508c('0x34')]+'%'};return _0x100e0b;}})});}_0x40072f=_[_0x508c('0x36')]({},_0x40072f,_0x3ec1e5[_0x508c('0x37')]);var _0x2aa5f3={'where':_0x40072f[_0x508c('0x35')]};return db[_0x508c('0x38')][_0x508c('0x17')](_0x2aa5f3)['then'](function(_0x21ac5f){_0x3e4a3d[_0x508c('0x17')]=_0x21ac5f;if(_0x3ec1e5[_0x508c('0x28')][_0x508c('0x39')]){_0x40072f['include']=[{'all':!![]}];}return db[_0x508c('0x38')][_0x508c('0x3a')](_0x40072f);})[_0x508c('0x1e')](function(_0x3182e1){_0x3e4a3d[_0x508c('0x3b')]=_0x3182e1;return _0x3e4a3d;})[_0x508c('0x1e')](respondWithFilteredResult(_0x3eb63c,_0x40072f))[_0x508c('0x3c')](handleError(_0x3eb63c,null));};exports[_0x508c('0x3d')]=function(_0x1813f2,_0x5bcd30){var _0x3bb535={'raw':!![],'where':{'id':_0x1813f2[_0x508c('0x3e')]['id']}},_0x1ca0e7={};_0x1ca0e7[_0x508c('0x26')]=_[_0x508c('0x29')](db[_0x508c('0x38')][_0x508c('0x23')]);_0x1ca0e7[_0x508c('0x28')]=_[_0x508c('0x29')](_0x1813f2[_0x508c('0x28')]);_0x1ca0e7[_0x508c('0x2a')]=_['intersection'](_0x1ca0e7[_0x508c('0x26')],_0x1ca0e7['query']);_0x3bb535[_0x508c('0x2c')]=_[_0x508c('0x2b')](_0x1ca0e7[_0x508c('0x26')],qs[_0x508c('0x2d')](_0x1813f2[_0x508c('0x28')][_0x508c('0x2d')]));_0x3bb535[_0x508c('0x2c')]=_0x3bb535[_0x508c('0x2c')][_0x508c('0x2e')]?_0x3bb535[_0x508c('0x2c')]:_0x1ca0e7['model'];if(_0x1813f2[_0x508c('0x28')][_0x508c('0x39')]){_0x3bb535[_0x508c('0x3f')]=[{'all':!![]}];}_0x3bb535=_[_0x508c('0x36')]({},_0x3bb535,_0x1813f2[_0x508c('0x37')]);return db[_0x508c('0x38')][_0x508c('0x40')](_0x3bb535)[_0x508c('0x1e')](handleEntityNotFound(_0x5bcd30,null))['then'](respondWithResult(_0x5bcd30,null))[_0x508c('0x3c')](handleError(_0x5bcd30,null));};exports[_0x508c('0x41')]=function(_0x39a648,_0x402608){return db['CmHopperHistory']['create'](_0x39a648[_0x508c('0x42')],{})[_0x508c('0x1e')](respondWithResult(_0x402608,0xc9))['catch'](handleError(_0x402608,null));};exports['describe']=function(_0x46f206,_0x2c360a){return db[_0x508c('0x38')][_0x508c('0x43')]()['then'](respondWithResult(_0x2c360a,null))[_0x508c('0x3c')](handleError(_0x2c360a,null));};exports[_0x508c('0x44')]=function(_0x24f379,_0x15c5ee){if(_0x24f379[_0x508c('0x42')][_0x508c('0x45')]){delete _0x24f379[_0x508c('0x42')]['uniqueid'];}return db[_0x508c('0x38')][_0x508c('0x40')]({'where':{'uniqueid':_0x24f379['params']['id']}})[_0x508c('0x1e')](handleEntityNotFound(_0x15c5ee,null))[_0x508c('0x1e')](saveUpdates(_0x24f379[_0x508c('0x42')],null))[_0x508c('0x1e')](respondWithResult(_0x15c5ee,null))[_0x508c('0x3c')](handleError(_0x15c5ee,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3c4a922..dd8e57d 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 _0x82d8=['endtime','uniqueid','lodash','../../config/logger','bluebird','path','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x58e617,_0x328f2a){var _0x377914=function(_0x32b856){while(--_0x32b856){_0x58e617['push'](_0x58e617['shift']());}};_0x377914(++_0x328f2a);}(_0x82d8,0xff));var _0x882d=function(_0x4d741b,_0x3fb877){_0x4d741b=_0x4d741b-0x0;var _0x517781=_0x82d8[_0x4d741b];return _0x517781;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var logger=require(_0x882d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x882d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x882d('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x882d('0x4'));module[_0x882d('0x5')]=function(_0x19f644,_0xa928f7){return _0x19f644[_0x882d('0x6')](_0x882d('0x7'),attributes,{'tableName':_0x882d('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x882d('0x9')]},{'name':_0x882d('0xa'),'fields':[_0x882d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdfb1=['bluebird','request-promise','path','rimraf','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x142479,_0x347d51){_0x142479=_0x142479-0x0;var _0x360798=_0xdfb1[_0x142479];return _0x360798;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require('moment');var BPromise=require(_0x1dfb('0x4'));var rp=require(_0x1dfb('0x5'));var fs=require('fs');var path=require(_0x1dfb('0x6'));var rimraf=require(_0x1dfb('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x31f0ff,_0x36bf77){return _0x31f0ff[_0x1dfb('0x8')]('CmHopperHistory',attributes,{'tableName':_0x1dfb('0x9'),'paranoid':![],'indexes':[{'name':_0x1dfb('0xa'),'fields':[_0x1dfb('0xa')]},{'name':_0x1dfb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d23d363..e66c830 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 _0xc540=['catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','CmHopperHistory,\x20%s,\x20%s','message','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','AvgHandleTime','findAll','where','sequelize','COUNT','col','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','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x1c7ad6,_0x32ade6){var _0x4a7acc=function(_0x4817e6){while(--_0x4817e6){_0x1c7ad6['push'](_0x1c7ad6['shift']());}};_0x4a7acc(++_0x32ade6);}(_0xc540,0x184));var _0x0c54=function(_0x5e3578,_0x48ee2e){_0x5e3578=_0x5e3578-0x0;var _0x16efdb=_0xc540[_0x5e3578];return _0x16efdb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0c54('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c54('0x1'));var db=require(_0x0c54('0x2'))['db'];var utils=require(_0x0c54('0x3'));var logger=require(_0x0c54('0x4'))(_0x0c54('0x5'));var config=require('../../config/environment');var jayson=require(_0x0c54('0x6'));var client=jayson[_0x0c54('0x7')][_0x0c54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd1bfc5,_0x2eee8f,_0x90e1b0){return new BPromise(function(_0x4067ac,_0x32664a){return client[_0x0c54('0x9')](_0xd1bfc5,_0x90e1b0)[_0x0c54('0xa')](function(_0x10a76a){logger[_0x0c54('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x2eee8f,_0x0c54('0xc'));logger['debug'](_0x0c54('0xd'),_0x2eee8f,_0x0c54('0xc'),JSON[_0x0c54('0xe')](_0x10a76a));if(_0x10a76a['error']){if(_0x10a76a['error'][_0x0c54('0xf')]===0x1f4){logger[_0x0c54('0x10')](_0x0c54('0x11'),_0x2eee8f,_0x10a76a[_0x0c54('0x10')][_0x0c54('0x12')]);return _0x32664a(_0x10a76a[_0x0c54('0x10')]['message']);}logger['error'](_0x0c54('0x11'),_0x2eee8f,_0x10a76a[_0x0c54('0x10')]['message']);return _0x4067ac(_0x10a76a['error'][_0x0c54('0x12')]);}else{logger[_0x0c54('0xb')](_0x0c54('0x11'),_0x2eee8f,_0x0c54('0xc'));_0x4067ac(_0x10a76a['result'][_0x0c54('0x12')]);}})['catch'](function(_0x10425a){logger[_0x0c54('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x2eee8f,_0x10425a);_0x32664a(_0x10425a);});});}exports[_0x0c54('0x13')]=function(_0x2e44ed){var _0x3d18b9=this;return new Promise(function(_0x5c0446,_0x150a30){return db[_0x0c54('0x14')][_0x0c54('0x15')](_0x2e44ed[_0x0c54('0x16')],{'raw':_0x2e44ed[_0x0c54('0x17')]?_0x2e44ed[_0x0c54('0x17')][_0x0c54('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x505e19){logger[_0x0c54('0xb')](_0x0c54('0x13'),_0x2e44ed);logger[_0x0c54('0x19')]('CreateCmHopperHistory',_0x2e44ed,JSON['stringify'](_0x505e19));_0x5c0446(_0x505e19);})['catch'](function(_0x15afbf){logger[_0x0c54('0x10')](_0x0c54('0x13'),_0x15afbf[_0x0c54('0x12')],_0x2e44ed);_0x150a30(_0x3d18b9['error'](0x1f4,_0x15afbf[_0x0c54('0x12')]));});});};exports[_0x0c54('0x1a')]=function(_0x403631){var _0x4448f5=this;return new Promise(function(_0x4fb2e2,_0x271892){return db[_0x0c54('0x14')][_0x0c54('0x1b')]({'raw':_0x403631[_0x0c54('0x17')]?_0x403631[_0x0c54('0x17')][_0x0c54('0x18')]===undefined?!![]:![]:!![],'where':_0x403631[_0x0c54('0x17')]?_0x403631[_0x0c54('0x17')][_0x0c54('0x1c')]||null:null,'attributes':[[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')][_0x0c54('0x1f')]('id')),_0x0c54('0x20')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')](_0x0c54('0x22')))),_0x0c54('0x23')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')](_0x0c54('0x24')))),_0x0c54('0x25')],[db['sequelize']['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x26')))),_0x0c54('0x27')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x28'),db[_0x0c54('0x1d')]['fn']('IF',db['sequelize'][_0x0c54('0x21')](_0x0c54('0x29')))),_0x0c54('0x2a')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x28'),db[_0x0c54('0x1d')]['fn']('IF',db['sequelize'][_0x0c54('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x0c54('0x2b')]]})[_0x0c54('0xa')](function(_0x2b8632){logger[_0x0c54('0xb')]('AvgHandleTime',_0x403631);logger['debug'](_0x0c54('0x1a'),_0x403631,JSON['stringify'](_0x2b8632));_0x4fb2e2(_0x2b8632);})[_0x0c54('0x2c')](function(_0x50ad17){logger['error'](_0x0c54('0x1a'),_0x50ad17['message'],_0x403631);_0x271892(_0x4448f5[_0x0c54('0x10')](0x1f4,_0x50ad17[_0x0c54('0x12')]));});});};exports[_0x0c54('0x2d')]=function(_0x1c961f){var _0x7db799=this;return new Promise(function(_0x27ff7f,_0x3a1581){return db['CmHopperHistory'][_0x0c54('0x1b')]({'raw':_0x1c961f[_0x0c54('0x17')]?_0x1c961f[_0x0c54('0x17')][_0x0c54('0x18')]===undefined?!![]:![]:!![],'where':_0x1c961f[_0x0c54('0x17')]?_0x1c961f[_0x0c54('0x17')][_0x0c54('0x1c')]||null:null,'attributes':[[_0x0c54('0x2e'),_0x0c54('0x2f')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x30')))),_0x0c54('0x31')],[db['sequelize']['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db['sequelize'][_0x0c54('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x0c54('0x32')],[db[_0x0c54('0x1d')]['fn']('COUNT',db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x0c54('0x33')],[db['sequelize']['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db['sequelize'][_0x0c54('0x21')](_0x0c54('0x34')))),_0x0c54('0x35')],[db['sequelize']['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')](_0x0c54('0x36')))),_0x0c54('0x37')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db['sequelize']['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')](_0x0c54('0x38')))),_0x0c54('0x39')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db['sequelize']['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x3a')))),_0x0c54('0x3b')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db['sequelize'][_0x0c54('0x21')](_0x0c54('0x3c')))),_0x0c54('0x3d')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')](_0x0c54('0x3e')))),_0x0c54('0x3f')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x40')))),'outboundRejectCallsDay'],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db['sequelize']['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x41')))),'outboundAnswerAgiCallsDay'],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x0c54('0x21')](_0x0c54('0x42')))),_0x0c54('0x43')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')]['literal'](_0x0c54('0x44')))),_0x0c54('0x45')]],'group':[_0x0c54('0x2e')]})[_0x0c54('0xa')](function(_0x1c286a){logger['info'](_0x0c54('0x2d'),_0x1c961f);logger[_0x0c54('0x19')](_0x0c54('0x2d'),_0x1c961f,JSON[_0x0c54('0xe')](_0x1c286a));_0x27ff7f(_0x1c286a);})['catch'](function(_0x6e669b){logger['error'](_0x0c54('0x2d'),_0x6e669b[_0x0c54('0x12')],_0x1c961f);_0x3a1581(_0x7db799['error'](0x1f4,_0x6e669b[_0x0c54('0x12')]));});});};exports[_0x0c54('0x46')]=function(_0x2e1f2e){var _0x532f18=this;return new Promise(function(_0x3c42ed,_0x272bfb){return db[_0x0c54('0x14')][_0x0c54('0x1b')]({'raw':_0x2e1f2e[_0x0c54('0x17')]?_0x2e1f2e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e1f2e[_0x0c54('0x17')]?_0x2e1f2e[_0x0c54('0x17')][_0x0c54('0x1c')]||null:null,'attributes':[[_0x0c54('0x2e'),'name'],[db[_0x0c54('0x1d')]['fn']('COUNT',db[_0x0c54('0x1d')]['col']('id')),_0x0c54('0x47')],[db[_0x0c54('0x1d')]['fn'](_0x0c54('0x1e'),db[_0x0c54('0x1d')]['fn']('IF',db[_0x0c54('0x1d')][_0x0c54('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x0c54('0xa')](function(_0x2c5745){logger[_0x0c54('0xb')](_0x0c54('0x46'),_0x2e1f2e);logger['debug'](_0x0c54('0x46'),_0x2e1f2e,JSON['stringify'](_0x2c5745));_0x3c42ed(_0x2c5745);})['catch'](function(_0x363a09){logger[_0x0c54('0x10')](_0x0c54('0x46'),_0x363a09['message'],_0x2e1f2e);_0x272bfb(_0x532f18[_0x0c54('0x10')](0x1f4,_0x363a09[_0x0c54('0x12')]));});});}; \ No newline at end of file +var _0x7382=['predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null'];(function(_0x44d5bd,_0x2a17a1){var _0x1215b9=function(_0x589996){while(--_0x589996){_0x44d5bd['push'](_0x44d5bd['shift']());}};_0x1215b9(++_0x2a17a1);}(_0x7382,0x1f2));var _0x2738=function(_0x19099f,_0x3a5c9b){_0x19099f=_0x19099f-0x0;var _0x545099=_0x7382[_0x19099f];return _0x545099;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2738('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2738('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2738('0x3'))(_0x2738('0x4'));var config=require('../../config/environment');var jayson=require(_0x2738('0x5'));var client=jayson[_0x2738('0x6')][_0x2738('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1437b0,_0x4f0d91,_0x99e22e){return new BPromise(function(_0x20a64f,_0x351335){return client[_0x2738('0x8')](_0x1437b0,_0x99e22e)[_0x2738('0x9')](function(_0x4d8c36){logger[_0x2738('0xa')](_0x2738('0xb'),_0x4f0d91,_0x2738('0xc'));logger[_0x2738('0xd')](_0x2738('0xe'),_0x4f0d91,'request\x20sent',JSON['stringify'](_0x4d8c36));if(_0x4d8c36['error']){if(_0x4d8c36[_0x2738('0xf')][_0x2738('0x10')]===0x1f4){logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);return _0x351335(_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);}logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x4d8c36[_0x2738('0xf')][_0x2738('0x11')]);return _0x20a64f(_0x4d8c36['error'][_0x2738('0x11')]);}else{logger[_0x2738('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4f0d91,'request\x20sent');_0x20a64f(_0x4d8c36[_0x2738('0x12')][_0x2738('0x11')]);}})[_0x2738('0x13')](function(_0x588a68){logger[_0x2738('0xf')](_0x2738('0xb'),_0x4f0d91,_0x588a68);_0x351335(_0x588a68);});});}exports[_0x2738('0x14')]=function(_0x2ab61b){var _0x19d331=this;return new Promise(function(_0x4a0f1e,_0x43cab3){return db[_0x2738('0x15')][_0x2738('0x16')](_0x2ab61b[_0x2738('0x17')],{'raw':_0x2ab61b[_0x2738('0x18')]?_0x2ab61b[_0x2738('0x18')][_0x2738('0x19')]===undefined?!![]:![]:!![]})[_0x2738('0x9')](function(_0x2dcc5e){logger['info'](_0x2738('0x14'),_0x2ab61b);logger['debug'](_0x2738('0x14'),_0x2ab61b,JSON[_0x2738('0x1a')](_0x2dcc5e));_0x4a0f1e(_0x2dcc5e);})[_0x2738('0x13')](function(_0x36b4bb){logger['error']('CreateCmHopperHistory',_0x36b4bb[_0x2738('0x11')],_0x2ab61b);_0x43cab3(_0x19d331[_0x2738('0xf')](0x1f4,_0x36b4bb[_0x2738('0x11')]));});});};exports[_0x2738('0x1b')]=function(_0x509c92){var _0x26f554=this;return new Promise(function(_0x3d8274,_0x32574a){return db[_0x2738('0x15')]['findAll']({'raw':_0x509c92['options']?_0x509c92['options'][_0x2738('0x19')]===undefined?!![]:![]:!![],'where':_0x509c92[_0x2738('0x18')]?_0x509c92['options'][_0x2738('0x1c')]||null:null,'attributes':[[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db['sequelize'][_0x2738('0x1f')]('id')),_0x2738('0x20')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x22')))),_0x2738('0x23')],[db['sequelize']['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x2738('0x24')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x25')))),_0x2738('0x26')],[db[_0x2738('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x27')))),_0x2738('0x28')],[db[_0x2738('0x1d')]['fn']('AVG',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x29')))),_0x2738('0x2a')]]})[_0x2738('0x9')](function(_0x23ca9d){logger[_0x2738('0xa')](_0x2738('0x1b'),_0x509c92);logger[_0x2738('0xd')](_0x2738('0x1b'),_0x509c92,JSON[_0x2738('0x1a')](_0x23ca9d));_0x3d8274(_0x23ca9d);})[_0x2738('0x13')](function(_0x35f1fe){logger[_0x2738('0xf')](_0x2738('0x1b'),_0x35f1fe[_0x2738('0x11')],_0x509c92);_0x32574a(_0x26f554[_0x2738('0xf')](0x1f4,_0x35f1fe[_0x2738('0x11')]));});});};exports[_0x2738('0x2b')]=function(_0x247c37){var _0x205cf5=this;return new Promise(function(_0x39a7de,_0x53084c){return db[_0x2738('0x15')][_0x2738('0x2c')]({'raw':_0x247c37[_0x2738('0x18')]?_0x247c37[_0x2738('0x18')][_0x2738('0x19')]===undefined?!![]:![]:!![],'where':_0x247c37[_0x2738('0x18')]?_0x247c37[_0x2738('0x18')][_0x2738('0x1c')]||null:null,'attributes':[[_0x2738('0x2d'),_0x2738('0x2e')],[db['sequelize']['fn'](_0x2738('0x1e'),db['sequelize']['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x2f')))),_0x2738('0x30')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db['sequelize']['fn']('IF',db[_0x2738('0x1d')]['literal'](_0x2738('0x31')))),_0x2738('0x32')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db['sequelize'][_0x2738('0x21')](_0x2738('0x22')))),'outboundAnswerCallsDay'],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db['sequelize']['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x33')))),_0x2738('0x34')],[db[_0x2738('0x1d')]['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x35')))),_0x2738('0x36')],[db[_0x2738('0x1d')]['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x37')))),_0x2738('0x38')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x39')))),'outboundDropCallsDayCallersExit'],[db[_0x2738('0x1d')]['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')]['literal'](_0x2738('0x3a')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x2738('0x1d')]['fn']('COUNT',db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0x2738('0x3b')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0x2738('0x3c')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x3d')))),_0x2738('0x3e')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x2738('0x3c')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db['sequelize']['fn']('IF',db[_0x2738('0x1d')][_0x2738('0x21')](_0x2738('0x3f')))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x71063a){logger[_0x2738('0xa')](_0x2738('0x2b'),_0x247c37);logger[_0x2738('0xd')](_0x2738('0x2b'),_0x247c37,JSON[_0x2738('0x1a')](_0x71063a));_0x39a7de(_0x71063a);})[_0x2738('0x13')](function(_0x3f16b0){logger[_0x2738('0xf')]('GetVoiceQueueHopperHistory',_0x3f16b0[_0x2738('0x11')],_0x247c37);_0x53084c(_0x205cf5[_0x2738('0xf')](0x1f4,_0x3f16b0['message']));});});};exports[_0x2738('0x40')]=function(_0x447244){var _0x28a95b=this;return new Promise(function(_0x3343e9,_0x4cd2ac){return db[_0x2738('0x15')][_0x2738('0x2c')]({'raw':_0x447244['options']?_0x447244[_0x2738('0x18')][_0x2738('0x19')]===undefined?!![]:![]:!![],'where':_0x447244['options']?_0x447244[_0x2738('0x18')][_0x2738('0x1c')]||null:null,'attributes':[[_0x2738('0x2d'),_0x2738('0x2e')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['col']('id')),_0x2738('0x41')],[db[_0x2738('0x1d')]['fn'](_0x2738('0x1e'),db[_0x2738('0x1d')]['fn']('IF',db['sequelize'][_0x2738('0x21')](_0x2738('0x22')))),_0x2738('0x42')]],'group':[_0x2738('0x2d')]})[_0x2738('0x9')](function(_0x7234a8){logger[_0x2738('0xa')](_0x2738('0x40'),_0x447244);logger[_0x2738('0xd')](_0x2738('0x40'),_0x447244,JSON[_0x2738('0x1a')](_0x7234a8));_0x3343e9(_0x7234a8);})[_0x2738('0x13')](function(_0x41ef94){logger['error'](_0x2738('0x40'),_0x41ef94[_0x2738('0x11')],_0x447244);_0x4cd2ac(_0x28a95b['error'](0x1f4,_0x41ef94[_0x2738('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 966ba4b..e36af12 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 _0x6077=['isAuthenticated','index','get','/describe','describe','/:id','show','create','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x4b73ca,_0x24887b){var _0x1f15a6=function(_0x41ce72){while(--_0x41ce72){_0x4b73ca['push'](_0x4b73ca['shift']());}};_0x1f15a6(++_0x24887b);}(_0x6077,0x1de));var _0x7607=function(_0x80de21,_0xa4bcd7){_0x80de21=_0x80de21-0x0;var _0x116aae=_0x6077[_0x80de21];return _0x116aae;};'use strict';var multer=require(_0x7607('0x0'));var util=require(_0x7607('0x1'));var path=require(_0x7607('0x2'));var timeout=require(_0x7607('0x3'));var express=require(_0x7607('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7607('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7607('0x6'));var controller=require(_0x7607('0x7'));router['get']('/',auth[_0x7607('0x8')](),controller[_0x7607('0x9')]);router[_0x7607('0xa')](_0x7607('0xb'),auth['isAuthenticated'](),controller[_0x7607('0xc')]);router['get'](_0x7607('0xd'),auth[_0x7607('0x8')](),controller[_0x7607('0xe')]);router['post']('/',auth[_0x7607('0x8')](),controller[_0x7607('0xf')]);router['put'](_0x7607('0xd'),auth['isAuthenticated'](),controller[_0x7607('0x10')]);module[_0x7607('0x11')]=router; \ No newline at end of file +var _0x842c=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update'];(function(_0x39a04c,_0x2b4002){var _0x580cb0=function(_0x138902){while(--_0x138902){_0x39a04c['push'](_0x39a04c['shift']());}};_0x580cb0(++_0x2b4002);}(_0x842c,0x156));var _0xc842=function(_0x29a3c7,_0x35d50d){_0x29a3c7=_0x29a3c7-0x0;var _0x500f0f=_0x842c[_0x29a3c7];return _0x500f0f;};'use strict';var multer=require(_0xc842('0x0'));var util=require(_0xc842('0x1'));var path=require(_0xc842('0x2'));var timeout=require(_0xc842('0x3'));var express=require('express');var router=express[_0xc842('0x4')]();var fs_extra=require(_0xc842('0x5'));var auth=require(_0xc842('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc842('0x7'));var controller=require(_0xc842('0x8'));router[_0xc842('0x9')]('/',auth[_0xc842('0xa')](),controller[_0xc842('0xb')]);router[_0xc842('0x9')](_0xc842('0xc'),auth['isAuthenticated'](),controller[_0xc842('0xd')]);router[_0xc842('0x9')](_0xc842('0xe'),auth[_0xc842('0xa')](),controller['show']);router[_0xc842('0xf')]('/',auth[_0xc842('0xa')](),controller['create']);router[_0xc842('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc842('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ce3eb2b..71a23df 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 _0x81bd=['sequelize','exports','STRING','name'];(function(_0x50bf93,_0x15237c){var _0x1a0421=function(_0x59b393){while(--_0x59b393){_0x50bf93['push'](_0x50bf93['shift']());}};_0x1a0421(++_0x15237c);}(_0x81bd,0x7c));var _0xd81b=function(_0x12916b,_0x3ba82d){_0x12916b=_0x12916b-0x0;var _0x58d533=_0x81bd[_0x12916b];return _0x58d533;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'name':{'type':Sequelize[_0xd81b('0x2')],'unique':_0xd81b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd81b('0x2')]},'dialPrefix':{'type':Sequelize[_0xd81b('0x2')]}}; \ No newline at end of file +var _0x8a8b=['sequelize','name','STRING'];(function(_0x16c314,_0x4bcd8e){var _0x1b0580=function(_0x429c5d){while(--_0x429c5d){_0x16c314['push'](_0x16c314['shift']());}};_0x1b0580(++_0x4bcd8e);}(_0x8a8b,0xae));var _0xb8a8=function(_0x208911,_0x1a41c9){_0x208911=_0x208911-0x0;var _0x3c7361=_0x8a8b[_0x208911];return _0x3c7361;};'use strict';var Sequelize=require(_0xb8a8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb8a8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb8a8('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e8978e8..3e72033 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 _0xa23d=['query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','hasOwnProperty','order','removeDispositions','addContacts','CmContact','tags','isArray','join','each','omit','ids','dataValues','errors','push','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','cm_contact_has_items','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sendStatus','addCustomField','sequelize','transaction','CmCustomField','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','map'];(function(_0x143013,_0x1750de){var _0x269641=function(_0x2bd982){while(--_0x2bd982){_0x143013['push'](_0x143013['shift']());}};_0x269641(++_0x1750de);}(_0xa23d,0x6e));var _0xda23=function(_0xf4e4a6,_0x829cc){_0xf4e4a6=_0xf4e4a6-0x0;var _0x10d847=_0xa23d[_0xf4e4a6];return _0x10d847;};'use strict';var emlformat=require(_0xda23('0x0'));var rimraf=require(_0xda23('0x1'));var zipdir=require(_0xda23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda23('0x3'));var moment=require(_0xda23('0x4'));var BPromise=require(_0xda23('0x5'));var Mustache=require(_0xda23('0x6'));var util=require(_0xda23('0x7'));var path=require(_0xda23('0x8'));var sox=require(_0xda23('0x9'));var csv=require(_0xda23('0xa'));var ejs=require(_0xda23('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xda23('0xc'));var crypto=require(_0xda23('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda23('0xe'));var toCsv=require('to-csv');var querystring=require(_0xda23('0xf'));var Papa=require(_0xda23('0x10'));var Redis=require(_0xda23('0x11'));var authService=require(_0xda23('0x12'));var qs=require(_0xda23('0x13'));var as=require(_0xda23('0x14'));var hardwareService=require(_0xda23('0x15'));var logger=require(_0xda23('0x16'))(_0xda23('0x17'));var utils=require(_0xda23('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xda23('0x19'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xda23('0x1a')]=_[_0xda23('0x1b')](config[_0xda23('0x1a')],{'host':_0xda23('0x1c'),'port':0x18eb});var socket=require(_0xda23('0x1d'))(new Redis(config['redis']));require('./cmList.socket')[_0xda23('0x1e')](socket);function respondWithStatusCode(_0x38d858,_0x442bbd){_0x442bbd=_0x442bbd||0xcc;return function(_0xd067e2){if(_0xd067e2){return _0x38d858['sendStatus'](_0x442bbd);}return _0x38d858['status'](_0x442bbd)['end']();};}function respondWithResult(_0x274e2d,_0x4899f2){_0x4899f2=_0x4899f2||0xc8;return function(_0x52d700){if(_0x52d700){return _0x274e2d[_0xda23('0x1f')](_0x4899f2)[_0xda23('0x20')](_0x52d700);}};}function respondWithFilteredResult(_0x4f8166,_0x4cd26f){return function(_0x586bb8){if(_0x586bb8){var _0x3d833e=typeof _0x4cd26f[_0xda23('0x21')]===_0xda23('0x22')&&typeof _0x4cd26f[_0xda23('0x23')]===_0xda23('0x22');var _0x5217d6=_0x586bb8[_0xda23('0x24')];var _0x200573=_0x3d833e?0x0:_0x4cd26f[_0xda23('0x21')];var _0x1ee72b=_0x3d833e?_0x586bb8[_0xda23('0x24')]:_0x4cd26f[_0xda23('0x21')]+_0x4cd26f[_0xda23('0x23')];var _0x473320;if(_0x1ee72b>=_0x5217d6){_0x1ee72b=_0x5217d6;_0x473320=0xc8;}else{_0x473320=0xce;}_0x4f8166[_0xda23('0x1f')](_0x473320);return _0x4f8166[_0xda23('0x25')](_0xda23('0x26'),_0x200573+'-'+_0x1ee72b+'/'+_0x5217d6)[_0xda23('0x20')](_0x586bb8);}return null;};}function patchUpdates(_0x1e5fe4){return function(_0x6bd5d7){try{jsonpatch['apply'](_0x6bd5d7,_0x1e5fe4,!![]);}catch(_0x4c83e8){return BPromise[_0xda23('0x27')](_0x4c83e8);}return _0x6bd5d7[_0xda23('0x28')]();};}function saveUpdates(_0x36f148,_0x2e17a6){return function(_0x1aab88){if(_0x1aab88){return _0x1aab88[_0xda23('0x29')](_0x36f148)[_0xda23('0x2a')](function(_0x3306fe){return _0x3306fe;});}return null;};}function removeEntity(_0x5c9978,_0x2c8a66){return function(_0x4f30b2){if(_0x4f30b2){return _0x4f30b2[_0xda23('0x2b')]()['then'](function(){var _0x52abef=_0x4f30b2[_0xda23('0x2c')]({'plain':!![]});var _0x3f0e71=_0xda23('0x2d');return db[_0xda23('0x2e')]['destroy']({'where':{'type':_0x3f0e71,'resourceId':_0x52abef['id']}})[_0xda23('0x2a')](function(){return _0x4f30b2;});})[_0xda23('0x2a')](function(){_0x5c9978[_0xda23('0x1f')](0xcc)[_0xda23('0x2f')]();});}};}function handleEntityNotFound(_0x1ec2bb,_0x208169){return function(_0x5b9ab0){if(!_0x5b9ab0){_0x1ec2bb['sendStatus'](0x194);}return _0x5b9ab0;};}function handleError(_0x52b549,_0x5ad77b){_0x5ad77b=_0x5ad77b||0x1f4;return function(_0x1b00db){logger['error'](_0x1b00db[_0xda23('0x30')]);if(_0x1b00db[_0xda23('0x31')]){delete _0x1b00db[_0xda23('0x31')];}_0x52b549[_0xda23('0x1f')](_0x5ad77b)[_0xda23('0x32')](_0x1b00db);};}exports['index']=function(_0x30f132,_0x542e03){var _0xf7e09={},_0xbad0df={},_0x10cccf={'count':0x0,'rows':[]};var _0x2c0176=_['map'](db[_0xda23('0x33')][_0xda23('0x34')],function(_0x1dd535){return{'name':_0x1dd535[_0xda23('0x35')],'type':_0x1dd535[_0xda23('0x36')][_0xda23('0x37')]};});_0xbad0df[_0xda23('0x38')]=_[_0xda23('0x39')](_0x2c0176,_0xda23('0x31'));_0xbad0df[_0xda23('0x3a')]=_[_0xda23('0x3b')](_0x30f132['query']);_0xbad0df[_0xda23('0x3c')]=_[_0xda23('0x3d')](_0xbad0df[_0xda23('0x38')],_0xbad0df[_0xda23('0x3a')]);_0xf7e09[_0xda23('0x3e')]=_[_0xda23('0x3d')](_0xbad0df[_0xda23('0x38')],qs[_0xda23('0x3f')](_0x30f132['query'][_0xda23('0x3f')]));_0xf7e09[_0xda23('0x3e')]=_0xf7e09[_0xda23('0x3e')]['length']?_0xf7e09[_0xda23('0x3e')]:_0xbad0df[_0xda23('0x38')];if(!_0x30f132[_0xda23('0x3a')]['hasOwnProperty'](_0xda23('0x40'))){_0xf7e09[_0xda23('0x23')]=qs['limit'](_0x30f132[_0xda23('0x3a')][_0xda23('0x23')]);_0xf7e09[_0xda23('0x21')]=qs['offset'](_0x30f132[_0xda23('0x3a')][_0xda23('0x21')]);}_0xf7e09['order']=qs['sort'](_0x30f132['query'][_0xda23('0x41')]);_0xf7e09[_0xda23('0x42')]=qs[_0xda23('0x3c')](_[_0xda23('0x43')](_0x30f132[_0xda23('0x3a')],_0xbad0df[_0xda23('0x3c')]),_0x2c0176);if(_0x30f132[_0xda23('0x3a')][_0xda23('0x44')]){_0xf7e09['where']=_[_0xda23('0x45')](_0xf7e09[_0xda23('0x42')],{'$or':_[_0xda23('0x39')](_0x2c0176,function(_0x29a43a){if(_0x29a43a[_0xda23('0x36')]!=='VIRTUAL'){var _0x21755a={};_0x21755a[_0x29a43a[_0xda23('0x31')]]={'$like':'%'+_0x30f132[_0xda23('0x3a')]['filter']+'%'};return _0x21755a;}})});}_0xf7e09=_[_0xda23('0x45')]({},_0xf7e09,_0x30f132[_0xda23('0x46')]);var _0x47f118={'where':_0xf7e09['where']};return db[_0xda23('0x33')][_0xda23('0x24')](_0x47f118)[_0xda23('0x2a')](function(_0x2f86e4){_0x10cccf[_0xda23('0x24')]=_0x2f86e4;if(_0x30f132['query'][_0xda23('0x47')]){_0xf7e09['include']=[{'all':!![]}];}return db['CmList'][_0xda23('0x48')](_0xf7e09);})[_0xda23('0x2a')](function(_0x50394d){_0x10cccf[_0xda23('0x49')]=_0x50394d;return _0x10cccf;})[_0xda23('0x2a')](respondWithFilteredResult(_0x542e03,_0xf7e09))[_0xda23('0x4a')](handleError(_0x542e03,null));};exports[_0xda23('0x4b')]=function(_0x17c015,_0x5c8940){var _0x5aa376={'raw':![],'where':{'id':_0x17c015[_0xda23('0x4c')]['id']}},_0x443a4e={};_0x443a4e[_0xda23('0x38')]=_[_0xda23('0x3b')](db[_0xda23('0x33')][_0xda23('0x34')]);_0x443a4e[_0xda23('0x3a')]=_[_0xda23('0x3b')](_0x17c015[_0xda23('0x3a')]);_0x443a4e[_0xda23('0x3c')]=_[_0xda23('0x3d')](_0x443a4e[_0xda23('0x38')],_0x443a4e[_0xda23('0x3a')]);_0x5aa376['attributes']=_[_0xda23('0x3d')](_0x443a4e['model'],qs['fields'](_0x17c015[_0xda23('0x3a')][_0xda23('0x3f')]));_0x5aa376[_0xda23('0x3e')]=_0x5aa376[_0xda23('0x3e')][_0xda23('0x4d')]?_0x5aa376['attributes']:_0x443a4e['model'];if(_0x17c015[_0xda23('0x3a')][_0xda23('0x47')]){_0x5aa376[_0xda23('0x4e')]=[{'all':!![]}];}_0x5aa376=_[_0xda23('0x45')]({},_0x5aa376,_0x17c015[_0xda23('0x46')]);return db[_0xda23('0x33')][_0xda23('0x4f')](_0x5aa376)[_0xda23('0x2a')](handleEntityNotFound(_0x5c8940,null))['then'](respondWithResult(_0x5c8940,null))['catch'](handleError(_0x5c8940,null));};exports[_0xda23('0x50')]=function(_0x32f18b,_0xe94c2c){return db[_0xda23('0x33')][_0xda23('0x50')](_0x32f18b[_0xda23('0x51')],{})[_0xda23('0x2a')](function(_0xea260a){var _0x30da41=_0x32f18b[_0xda23('0x52')]['get']({'plain':!![]});if(!_0x30da41)throw new Error(_0xda23('0x53'));if(_0x30da41['role']===_0xda23('0x52')){var _0x5d7661=_0xea260a['get']({'plain':!![]});var _0xe47619=_0xda23('0x2d');return db[_0xda23('0x54')]['find']({'where':{'name':_0xe47619,'userProfileId':_0x30da41[_0xda23('0x55')]},'raw':!![]})[_0xda23('0x2a')](function(_0x3f3f20){if(_0x3f3f20&&_0x3f3f20[_0xda23('0x56')]===0x0){return db[_0xda23('0x2e')]['create']({'name':_0x5d7661[_0xda23('0x31')],'resourceId':_0x5d7661['id'],'type':_0x3f3f20[_0xda23('0x31')],'sectionId':_0x3f3f20['id']},{})['then'](function(){return _0xea260a;});}else{return _0xea260a;}})['catch'](function(_0x49b167){logger['error'](_0xda23('0x57'),_0x49b167);throw _0x49b167;});}return _0xea260a;})['then'](respondWithResult(_0xe94c2c,0xc9))[_0xda23('0x4a')](handleError(_0xe94c2c,null));};exports[_0xda23('0x29')]=function(_0x231d9b,_0x2af2bc){if(_0x231d9b[_0xda23('0x51')]['id']){delete _0x231d9b['body']['id'];}return db['CmList']['find']({'where':{'id':_0x231d9b['params']['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x2af2bc,null))[_0xda23('0x2a')](saveUpdates(_0x231d9b[_0xda23('0x51')],null))['then'](respondWithResult(_0x2af2bc,null))[_0xda23('0x4a')](handleError(_0x2af2bc,null));};exports[_0xda23('0x2b')]=function(_0x3dc0fa,_0x5a1e3f){return db[_0xda23('0x33')][_0xda23('0x4f')]({'where':{'id':_0x3dc0fa[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x5a1e3f,null))[_0xda23('0x2a')](removeEntity(_0x5a1e3f,null))[_0xda23('0x4a')](handleError(_0x5a1e3f,null));};exports[_0xda23('0x58')]=function(_0x1ef65d,_0x11c4ba){return db[_0xda23('0x33')]['describe']()[_0xda23('0x2a')](respondWithResult(_0x11c4ba,null))[_0xda23('0x4a')](handleError(_0x11c4ba,null));};exports[_0xda23('0x59')]=function(_0x2fb02d,_0x4c7e99,_0x45afa2){if(_0x2fb02d['body']['id']){delete _0x2fb02d['body']['id'];}return db[_0xda23('0x33')][_0xda23('0x4f')]({'where':{'id':_0x2fb02d[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x4c7e99,null))['then'](function(_0x47cdff){if(_0x47cdff){_0x2fb02d[_0xda23('0x51')][_0xda23('0x5a')]=_0x47cdff['id'];return db[_0xda23('0x5b')][_0xda23('0x50')](_0x2fb02d[_0xda23('0x51')]);}})[_0xda23('0x2a')](respondWithResult(_0x4c7e99,null))[_0xda23('0x4a')](handleError(_0x4c7e99,null));};exports['getDispositions']=function(_0x2aa46f,_0x14dbb7,_0x5b9049){var _0x289eaf={'raw':![],'where':{}};var _0xc03b67={};var _0x18dc92={'count':0x0,'rows':[]};return db[_0xda23('0x33')][_0xda23('0x5c')]({'where':{'id':_0x2aa46f['params']['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x14dbb7,null))[_0xda23('0x2a')](function(_0xf94380){if(_0xf94380){_0xc03b67[_0xda23('0x38')]=_['keys'](db[_0xda23('0x5b')][_0xda23('0x34')]);_0xc03b67[_0xda23('0x3a')]=_[_0xda23('0x3b')](_0x2aa46f[_0xda23('0x3a')]);_0xc03b67[_0xda23('0x3c')]=_[_0xda23('0x3d')](_0xc03b67['model'],_0xc03b67[_0xda23('0x3a')]);_0x289eaf[_0xda23('0x3e')]=_['intersection'](_0xc03b67[_0xda23('0x38')],qs['fields'](_0x2aa46f[_0xda23('0x3a')][_0xda23('0x3f')]));_0x289eaf['attributes']=_0x289eaf[_0xda23('0x3e')][_0xda23('0x4d')]?_0x289eaf[_0xda23('0x3e')]:_0xc03b67[_0xda23('0x38')];if(!_0x2aa46f[_0xda23('0x3a')][_0xda23('0x5d')](_0xda23('0x40'))){_0x289eaf[_0xda23('0x23')]=qs[_0xda23('0x23')](_0x2aa46f['query'][_0xda23('0x23')]);_0x289eaf[_0xda23('0x21')]=qs[_0xda23('0x21')](_0x2aa46f[_0xda23('0x3a')]['offset']);}_0x289eaf[_0xda23('0x5e')]=qs[_0xda23('0x41')](_0x2aa46f[_0xda23('0x3a')][_0xda23('0x41')]);_0x289eaf[_0xda23('0x42')]=qs[_0xda23('0x3c')](_[_0xda23('0x43')](_0x2aa46f[_0xda23('0x3a')],_0xc03b67[_0xda23('0x3c')]));_0x289eaf[_0xda23('0x42')][_0xda23('0x5a')]=_0xf94380['id'];if(_0x2aa46f[_0xda23('0x3a')][_0xda23('0x44')]){_0x289eaf[_0xda23('0x42')]=_[_0xda23('0x45')](_0x289eaf['where'],{'$or':_[_0xda23('0x39')](_0x289eaf['attributes'],function(_0x379c55){var _0x5d6b6a={};_0x5d6b6a[_0x379c55]={'$like':'%'+_0x2aa46f[_0xda23('0x3a')][_0xda23('0x44')]+'%'};return _0x5d6b6a;})});}_0x289eaf=_['merge']({},_0x289eaf,_0x2aa46f['options']);return db[_0xda23('0x5b')][_0xda23('0x24')]({'where':_0x289eaf['where']})[_0xda23('0x2a')](function(_0x39b5cc){_0x18dc92[_0xda23('0x24')]=_0x39b5cc;if(_0x2aa46f[_0xda23('0x3a')][_0xda23('0x47')]){_0x289eaf[_0xda23('0x4e')]=[{'all':!![]}];}return db[_0xda23('0x5b')][_0xda23('0x48')](_0x289eaf);})[_0xda23('0x2a')](function(_0x34a2b8){_0x18dc92[_0xda23('0x49')]=_0x34a2b8;return _0x18dc92;});}})[_0xda23('0x2a')](respondWithFilteredResult(_0x14dbb7,_0x289eaf))[_0xda23('0x4a')](handleError(_0x14dbb7,null));};exports[_0xda23('0x5f')]=function(_0x4da84a,_0x374412,_0x3bd075){return db[_0xda23('0x33')]['find']({'where':{'id':_0x4da84a[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x374412,null))[_0xda23('0x2a')](function(_0x3f393b){if(_0x3f393b){return _0x3f393b['removeDispositions'](_0x4da84a[_0xda23('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x374412,null))[_0xda23('0x4a')](handleError(_0x374412,null));};exports[_0xda23('0x60')]=function(_0x80a7be,_0x2ecbcd,_0x4f77f6){return db[_0xda23('0x33')]['find']({'where':{'id':_0x80a7be['params']['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x2ecbcd,null))[_0xda23('0x2a')](function(_0x39d435){if(_0x39d435){var _0x374ef6=[];var _0x384dbf={'success':[],'errors':[]};return db[_0xda23('0x61')][_0xda23('0x58')]()['then'](function(_0x2b76b8){if(_0x80a7be[_0xda23('0x51')][_0xda23('0x62')]&&_[_0xda23('0x63')](_0x80a7be[_0xda23('0x51')][_0xda23('0x62')])){if(_0x80a7be[_0xda23('0x51')][_0xda23('0x62')][_0xda23('0x4d')]){_0x80a7be['body']['tags']=_0x80a7be[_0xda23('0x51')][_0xda23('0x62')][_0xda23('0x64')](';')+';';}else{_0x80a7be[_0xda23('0x51')]['tags']=null;}}else{_0x80a7be[_0xda23('0x51')][_0xda23('0x62')]=null;}if(_0x80a7be[_0xda23('0x51')]&&_[_0xda23('0x63')](_0x80a7be[_0xda23('0x51')])){for(var _0x2af33d=0x0;_0x2af33d<_0x80a7be['body']['length'];_0x2af33d+=0x1){_0x80a7be[_0xda23('0x51')][_0x2af33d][_0xda23('0x5a')]=_0x80a7be['params']['id'];_0x374ef6['push'](_0x80a7be[_0xda23('0x51')][_0x2af33d]);}return BPromise[_0xda23('0x65')](_0x374ef6,function(_0x51188b){return db[_0xda23('0x61')][_0xda23('0x50')](_[_0xda23('0x66')](_0x51188b,[_0xda23('0x67'),'id'])||{},{'fields':_['keys'](_0x2b76b8),'raw':!![]})['then'](function(_0x53e5d9){_0x384dbf['success']['push'](_0x53e5d9[_0xda23('0x68')]);})[_0xda23('0x4a')](function(_0x3a3f0e){_0x384dbf[_0xda23('0x69')][_0xda23('0x6a')]({'data':_0x51188b,'error':_0x3a3f0e[_0xda23('0x6b')]});});})[_0xda23('0x2a')](function(_0x2fbada){return _0x384dbf;})[_0xda23('0x4a')](function(_0x6cf14a){return _0x6cf14a;});}else{_0x2ecbcd[_0xda23('0x1f')](0x190)[_0xda23('0x20')]({'message':_0xda23('0x6c')});}});}})[_0xda23('0x2a')](respondWithResult(_0x2ecbcd,null))[_0xda23('0x4a')](handleError(_0x2ecbcd,null));};exports[_0xda23('0x6d')]=function(_0xe2c4aa,_0x33e586,_0x3e6c53){var _0x24f9b0;return db['CmList'][_0xda23('0x4f')]({'where':{'id':_0xe2c4aa[_0xda23('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xda23('0x6e')}]})[_0xda23('0x2a')](handleEntityNotFound(_0x33e586,null))[_0xda23('0x2a')](function(_0x10a2f2){if(_0x10a2f2){_0x24f9b0=_0x10a2f2;return db[_0xda23('0x61')][_0xda23('0x34')];}})['then'](function(_0x50f83a){if(_0x50f83a){var _0x2416fb={};var _0x314b5a={};_0x314b5a['model']=_[_0xda23('0x6f')](_[_0xda23('0x3b')](_0x50f83a),_['map'](_0x24f9b0['CustomFields'],function(_0x160f06){return util[_0xda23('0x70')](_0xda23('0x71'),_0x160f06['id']);}));_0x314b5a['query']=_[_0xda23('0x3b')](_0xe2c4aa[_0xda23('0x3a')]);_0x314b5a[_0xda23('0x3c')]=_['intersection'](_0x314b5a['model'],_0x314b5a['query']);_0x2416fb[_0xda23('0x3e')]=_[_0xda23('0x3d')](_0x314b5a['model'],qs[_0xda23('0x3f')](_0xe2c4aa[_0xda23('0x3a')][_0xda23('0x3f')]));_0x2416fb[_0xda23('0x3e')]=_0x2416fb[_0xda23('0x3e')][_0xda23('0x4d')]?_0x2416fb[_0xda23('0x3e')]:_0x314b5a[_0xda23('0x38')];if(!_0xe2c4aa[_0xda23('0x3a')][_0xda23('0x5d')](_0xda23('0x40'))){_0x2416fb[_0xda23('0x23')]=qs[_0xda23('0x23')](_0xe2c4aa['query']['limit']);_0x2416fb['offset']=qs['offset'](_0xe2c4aa[_0xda23('0x3a')][_0xda23('0x21')]);}_0x2416fb[_0xda23('0x5e')]=qs[_0xda23('0x41')](_0xe2c4aa[_0xda23('0x3a')]['sort']);_0x2416fb[_0xda23('0x42')]=qs[_0xda23('0x3c')](_[_0xda23('0x43')](_0xe2c4aa['query'],_0x314b5a[_0xda23('0x3c')]));_0x2416fb[_0xda23('0x72')]=!![];if(_0xe2c4aa[_0xda23('0x3a')][_0xda23('0x44')]){_0x2416fb['where']=_[_0xda23('0x45')](_0x2416fb[_0xda23('0x42')],{'$or':_['map'](_0x2416fb[_0xda23('0x3e')],function(_0x1dae2f){var _0x45bbd3={};_0x45bbd3[_0x1dae2f]={'$like':'%'+_0xe2c4aa[_0xda23('0x3a')][_0xda23('0x44')]+'%'};return _0x45bbd3;})});}_0x2416fb=_['merge']({},_0x2416fb,_0xe2c4aa[_0xda23('0x46')]);return _0x24f9b0[_0xda23('0x6d')](_0x2416fb);}})[_0xda23('0x2a')](respondWithResult(_0x33e586,null))[_0xda23('0x4a')](handleError(_0x33e586,null));};exports[_0xda23('0x73')]=function(_0x35c7ca,_0x92cc2c,_0x3ba735){var _0xcf901c;var _0x1feab9;var _0x352f5d;var _0x1e84a1=_0x35c7ca[_0xda23('0x4c')]['id'];csv_results=[];return db[_0xda23('0x74')][_0xda23('0x48')]({'attributes':['id',_0xda23('0x31')],'raw':!![],'order':[_0xda23('0x75')]})['then'](function(_0x2b5a3d){_0xcf901c=_0x2b5a3d;var _0xd7ce85=_['keys'](db[_0xda23('0x61')]['rawAttributes']);return db['CmCustomField'][_0xda23('0x48')]({'raw':!![],'attributes':['id',_0xda23('0x76')]})['then'](function(_0x3fefb1){_0x1feab9=_0x3fefb1;var _0x3a519a=squel[_0xda23('0x77')]()[_0xda23('0x3f')](_0xd7ce85)['from'](_0xda23('0x78'),'c')[_0xda23('0x42')](_0xda23('0x79'),_0x1e84a1)['where'](_0xda23('0x7a'))[_0xda23('0x7b')]();for(var _0x4ad301=0x0;_0x4ad301<_0x1feab9['length'];_0x4ad301++){_0x3a519a['field'](_0xda23('0x7c')+_0x1feab9[_0x4ad301]['id'],_0xda23('0x7d')+_0x1feab9[_0x4ad301][_0xda23('0x76')]);}for(var _0x4ad301=0x0;_0x4ad301<_0xcf901c[_0xda23('0x4d')];_0x4ad301++){_0x3a519a[_0xda23('0x7e')](squel[_0xda23('0x77')]()[_0xda23('0x7e')]('item')[_0xda23('0x7f')]('cm_contact_has_items')['where'](_0xda23('0x80'),_0xcf901c[_0x4ad301]['id'])[_0xda23('0x42')](_0xda23('0x81')),_0xda23('0x82')+_0xcf901c[_0x4ad301][_0xda23('0x31')]);_0x3a519a[_0xda23('0x7e')](squel[_0xda23('0x77')]()[_0xda23('0x7e')]('description')[_0xda23('0x7f')](_0xda23('0x83'))[_0xda23('0x42')]('ItemTypeId\x20=\x20?',_0xcf901c[_0x4ad301]['id'])[_0xda23('0x42')](_0xda23('0x81')),'description_additionalPhone_'+_0xcf901c[_0x4ad301][_0xda23('0x31')]);}var _0x1f763c=[];_0x1f763c[_0xda23('0x6a')](_0x3a519a[_0xda23('0x84')]());BPromise[_0xda23('0x65')](_0x1f763c,handleQuery)[_0xda23('0x2a')](function(_0x106d5e){handleQuery(_0x3a519a[_0xda23('0x84')]());var _0x1088a9=csv_results[0x0];if(!_[_0xda23('0x85')](_0x1088a9)){var _0xe26b59=toCsv(_0x1088a9);var _0x29fcbb=Date[_0xda23('0x86')]();fs[_0xda23('0x87')](util[_0xda23('0x70')]('/tmp/list_%d_%s.csv',_0x1e84a1,_0x29fcbb),_0xe26b59);_0x92cc2c[_0xda23('0x88')](_0xda23('0x89'),_0xda23('0x8a')+util['format']('list_%d_%s.csv',_0x1e84a1,_0x29fcbb));_0x92cc2c['setHeader'](_0xda23('0x8b'),_0xda23('0x8c'));return _0x92cc2c[_0xda23('0x8d')](util['format'](_0xda23('0x8e'),_0x1e84a1,_0x29fcbb));}else{return _0x92cc2c[_0xda23('0x8f')](0xcc);}});});});};exports[_0xda23('0x90')]=function(_0x1740bf,_0x27e7d4,_0x18cd2a){var _0x413767;delete _0x1740bf[_0xda23('0x51')]['id'];return db[_0xda23('0x33')][_0xda23('0x5c')]({'where':{'id':_0x1740bf['params']['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x27e7d4,null))[_0xda23('0x2a')](function(_0x3bc427){if(_0x3bc427){return db[_0xda23('0x91')][_0xda23('0x92')](function(_0x64966e){return db[_0xda23('0x93')]['create'](_0x1740bf[_0xda23('0x51')],{'transaction':_0x64966e})[_0xda23('0x2a')](function(_0x27e422){_0x413767=_0x27e422;return _0x3bc427['addCustomFields'](_0x27e422,{'transaction':_0x64966e});})['then'](function(){var _0x5c6772={'type':db[_0xda23('0x94')][_0xda23('0x95')],'transaction':_0x64966e};switch(_0x1740bf[_0xda23('0x51')][_0xda23('0x36')]){case _0xda23('0x96'):_0x5c6772[_0xda23('0x36')]=db['Sequelize']['TEXT'];break;case _0xda23('0x97'):_0x5c6772[_0xda23('0x36')]=db['Sequelize'][_0xda23('0x98')];break;case _0xda23('0x99'):_0x5c6772[_0xda23('0x36')]=db['Sequelize'][_0xda23('0x9a')];_0x5c6772[_0xda23('0x9b')]=![];break;default:}return db[_0xda23('0x91')][_0xda23('0x9c')]['addColumn']('cm_contacts',util['format']('cf_%s',_0x413767['id']),_0x5c6772);})[_0xda23('0x2a')](function(){return _0x413767;});});}})[_0xda23('0x2a')](respondWithResult(_0x27e7d4,null))[_0xda23('0x4a')](handleError(_0x27e7d4,null));};exports['getCustomFields']=function(_0x15e327,_0x3a6ab5,_0x2c8564){var _0x1fb763={};var _0x5533b8={};var _0x42f6ed;var _0xd70348;return db[_0xda23('0x33')]['findOne']({'where':{'id':_0x15e327[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x3a6ab5,null))[_0xda23('0x2a')](function(_0x3e6040){if(_0x3e6040){_0x42f6ed=_0x3e6040;_0x5533b8[_0xda23('0x38')]=_[_0xda23('0x3b')](db['CmCustomField'][_0xda23('0x34')]);_0x5533b8[_0xda23('0x3a')]=_[_0xda23('0x3b')](_0x15e327[_0xda23('0x3a')]);_0x5533b8[_0xda23('0x3c')]=_['intersection'](_0x5533b8[_0xda23('0x38')],_0x5533b8[_0xda23('0x3a')]);_0x1fb763[_0xda23('0x3e')]=_[_0xda23('0x3d')](_0x5533b8[_0xda23('0x38')],qs['fields'](_0x15e327[_0xda23('0x3a')][_0xda23('0x3f')]));_0x1fb763[_0xda23('0x3e')]=_0x1fb763[_0xda23('0x3e')][_0xda23('0x4d')]?_0x1fb763[_0xda23('0x3e')]:_0x5533b8[_0xda23('0x38')];_0x1fb763[_0xda23('0x5e')]=qs[_0xda23('0x41')](_0x15e327[_0xda23('0x3a')][_0xda23('0x41')]);_0x1fb763[_0xda23('0x42')]=qs[_0xda23('0x3c')](_[_0xda23('0x43')](_0x15e327[_0xda23('0x3a')],_0x5533b8[_0xda23('0x3c')]));_0x1fb763['where']=_[_0xda23('0x45')](_0x1fb763[_0xda23('0x42')],{'$or':[{'ListId':_0x3e6040['id']},{'ListId':null}]});if(_0x15e327[_0xda23('0x3a')][_0xda23('0x44')]){_0x1fb763['where']=_[_0xda23('0x45')](_0x1fb763[_0xda23('0x42')],{'$or':_['map'](_0x1fb763['attributes'],function(_0x561793){var _0x43598f={};_0x43598f[_0x561793]={'$like':'%'+_0x15e327['query'][_0xda23('0x44')]+'%'};return _0x43598f;})});}_0x1fb763=_['merge']({},_0x1fb763,_0x15e327[_0xda23('0x46')]);return db[_0xda23('0x93')][_0xda23('0x9d')](_0x1fb763);}})[_0xda23('0x2a')](respondWithResult(_0x3a6ab5,null))['catch'](handleError(_0x3a6ab5,null));};exports[_0xda23('0x9e')]=function(_0x5144d8,_0x222b04){return db[_0xda23('0x93')][_0xda23('0x9d')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x222b04,null))[_0xda23('0x2a')](function(_0x1d1eae){return _0x1d1eae;})[_0xda23('0x2a')](respondWithResult(_0x222b04,null))[_0xda23('0x4a')](handleError(_0x222b04,null));};exports[_0xda23('0x9f')]=function(_0x3eb919,_0xca8230,_0x109c20){return db['CmList']['find']({'where':{'id':_0x3eb919[_0xda23('0x4c')]['id']}})['then'](handleEntityNotFound(_0xca8230,null))[_0xda23('0x2a')](function(_0x3afa49){if(_0x3afa49){return _0x3afa49['addAgents'](_0x3eb919[_0xda23('0x51')][_0xda23('0x67')],_[_0xda23('0x66')](_0x3eb919['body'],[_0xda23('0x67'),'id'])||{})[_0xda23('0xa0')](function(_0x2d1a21){for(var _0x3a5d29=0x0;_0x3a5d29<_0x3eb919[_0xda23('0x51')][_0xda23('0x67')][_0xda23('0x4d')];_0x3a5d29+=0x1){socket[_0xda23('0xa1')](_0xda23('0xa2'),{'UserId':Number(_0x3eb919['body'][_0xda23('0x67')][_0x3a5d29]),'CmListId':Number(_0x3eb919[_0xda23('0x4c')]['id'])});}return _0x2d1a21;});}})[_0xda23('0x2a')](respondWithResult(_0xca8230,null))[_0xda23('0x4a')](handleError(_0xca8230,null));};exports[_0xda23('0xa3')]=function(_0x104031,_0x9d62c5,_0x2a4120){return db[_0xda23('0x33')][_0xda23('0x4f')]({'where':{'id':_0x104031[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x9d62c5,null))[_0xda23('0x2a')](function(_0x18238d){if(_0x18238d){return _0x18238d[_0xda23('0xa3')](_0x104031[_0xda23('0x3a')]['ids'])[_0xda23('0x2a')](function(){if(_[_0xda23('0x63')](_0x104031[_0xda23('0x3a')]['ids'])){for(var _0x284569=0x0;_0x284569<_0x104031[_0xda23('0x3a')][_0xda23('0x67')]['length'];_0x284569+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x104031[_0xda23('0x3a')][_0xda23('0x67')][_0x284569]),'CmListId':Number(_0x104031['params']['id'])});}}else{socket[_0xda23('0xa1')](_0xda23('0xa4'),{'UserId':Number(_0x104031[_0xda23('0x3a')][_0xda23('0x67')]),'CmListId':Number(_0x104031[_0xda23('0x4c')]['id'])});}});}})[_0xda23('0x2a')](respondWithStatusCode(_0x9d62c5,null))[_0xda23('0x4a')](handleError(_0x9d62c5,null));};exports[_0xda23('0xa5')]=function(_0x4d2a2b,_0x1d8b97,_0x5e8303){var _0x137769={};var _0x59b2d7={};var _0x2dfae8;var _0x51bba1;return db[_0xda23('0x33')]['findOne']({'where':{'id':_0x4d2a2b[_0xda23('0x4c')]['id']}})[_0xda23('0x2a')](handleEntityNotFound(_0x1d8b97,null))[_0xda23('0x2a')](function(_0x30c544){if(_0x30c544){_0x2dfae8=_0x30c544;_0x59b2d7[_0xda23('0x38')]=_['keys'](db['User'][_0xda23('0x34')]);_0x59b2d7[_0xda23('0x3a')]=_[_0xda23('0x3b')](_0x4d2a2b[_0xda23('0x3a')]);_0x59b2d7['filters']=_['intersection'](_0x59b2d7[_0xda23('0x38')],_0x59b2d7[_0xda23('0x3a')]);_0x137769['attributes']=_[_0xda23('0x3d')](_0x59b2d7[_0xda23('0x38')],qs[_0xda23('0x3f')](_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x3f')]));_0x137769[_0xda23('0x3e')]=_0x137769[_0xda23('0x3e')][_0xda23('0x4d')]?_0x137769[_0xda23('0x3e')]:_0x59b2d7[_0xda23('0x38')];_0x137769[_0xda23('0x5e')]=qs[_0xda23('0x41')](_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x41')]);_0x137769[_0xda23('0x42')]=qs[_0xda23('0x3c')](_['pick'](_0x4d2a2b[_0xda23('0x3a')],_0x59b2d7[_0xda23('0x3c')]));if(_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x44')]){_0x137769['where']=_[_0xda23('0x45')](_0x137769[_0xda23('0x42')],{'$or':_[_0xda23('0x39')](_0x137769[_0xda23('0x3e')],function(_0x449eda){var _0x286540={};_0x286540[_0x449eda]={'$like':'%'+_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x44')]+'%'};return _0x286540;})});}_0x137769=_[_0xda23('0x45')]({},_0x137769,_0x4d2a2b[_0xda23('0x46')]);return _0x2dfae8[_0xda23('0xa5')](_0x137769);}})[_0xda23('0x2a')](function(_0x5252b0){if(_0x5252b0){_0x51bba1=_0x5252b0[_0xda23('0x4d')];if(!_0x4d2a2b['query'][_0xda23('0x5d')]('nolimit')){_0x137769[_0xda23('0x23')]=qs[_0xda23('0x23')](_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x23')]);_0x137769[_0xda23('0x21')]=qs[_0xda23('0x21')](_0x4d2a2b[_0xda23('0x3a')][_0xda23('0x21')]);}return _0x2dfae8['getAgents'](_0x137769);}})['then'](function(_0x5aeb37){if(_0x5aeb37){return _0x5aeb37?{'count':_0x51bba1,'rows':_0x5aeb37}:null;}})[_0xda23('0x2a')](respondWithResult(_0x1d8b97,null))[_0xda23('0x4a')](handleError(_0x1d8b97,null));};function handleQuery(_0x1474b5){logger[_0xda23('0xa6')](_0x1474b5);return db[_0xda23('0x91')][_0xda23('0x3a')](_0x1474b5)['spread'](function(_0x13acb6){csv_results['push'](_0x13acb6);})[_0xda23('0x4a')](function(_0x54fef0){logger[_0xda23('0xa7')](_0x54fef0[_0xda23('0x6b')]);});} \ No newline at end of file +var _0x68a6=['addColumn','cm_contacts','cf_%s','findAndCountAll','getGlobalCustomFields','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','message','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','Lists','UserProfileResource','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','CmList','count','includeAll','include','findAll','catch','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','Disposition','hasOwnProperty','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','dataValues','errors','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','ContactItemType','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','Sequelize','text','number','INTEGER','switch','BOOLEAN','queryInterface'];(function(_0x4e18a7,_0x4b74e3){var _0xd95f7e=function(_0x484ac7){while(--_0x484ac7){_0x4e18a7['push'](_0x4e18a7['shift']());}};_0xd95f7e(++_0x4b74e3);}(_0x68a6,0x151));var _0x668a=function(_0x4aa325,_0x579167){_0x4aa325=_0x4aa325-0x0;var _0x177fdc=_0x68a6[_0x4aa325];return _0x177fdc;};'use strict';var emlformat=require(_0x668a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x668a('0x1'));var jsonpatch=require(_0x668a('0x2'));var rp=require('request-promise');var moment=require(_0x668a('0x3'));var BPromise=require(_0x668a('0x4'));var Mustache=require('mustache');var util=require(_0x668a('0x5'));var path=require(_0x668a('0x6'));var sox=require(_0x668a('0x7'));var csv=require(_0x668a('0x8'));var ejs=require(_0x668a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x668a('0xa'));var crypto=require(_0x668a('0xb'));var jsforce=require(_0x668a('0xc'));var deskjs=require(_0x668a('0xd'));var toCsv=require(_0x668a('0x8'));var querystring=require(_0x668a('0xe'));var Papa=require(_0x668a('0xf'));var Redis=require('ioredis');var authService=require(_0x668a('0x10'));var qs=require(_0x668a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x668a('0x12'));var logger=require(_0x668a('0x13'))(_0x668a('0x14'));var utils=require(_0x668a('0x15'));var config=require(_0x668a('0x16'));var licenseUtil=require(_0x668a('0x17'));var db=require(_0x668a('0x18'))['db'];var csv_results;config['redis']=_['defaults'](config[_0x668a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x668a('0x1a'))(new Redis(config[_0x668a('0x19')]));require(_0x668a('0x1b'))[_0x668a('0x1c')](socket);function respondWithStatusCode(_0x596b68,_0x60865){_0x60865=_0x60865||0xcc;return function(_0x231c6d){if(_0x231c6d){return _0x596b68[_0x668a('0x1d')](_0x60865);}return _0x596b68[_0x668a('0x1e')](_0x60865)[_0x668a('0x1f')]();};}function respondWithResult(_0x1b1611,_0x447d13){_0x447d13=_0x447d13||0xc8;return function(_0xf37329){if(_0xf37329){return _0x1b1611['status'](_0x447d13)[_0x668a('0x20')](_0xf37329);}};}function respondWithFilteredResult(_0x5578d8,_0x53cb5a){return function(_0x388709){if(_0x388709){var _0x59eff6=typeof _0x53cb5a[_0x668a('0x21')]===_0x668a('0x22')&&typeof _0x53cb5a['limit']===_0x668a('0x22');var _0x543a88=_0x388709['count'];var _0xa8b43f=_0x59eff6?0x0:_0x53cb5a[_0x668a('0x21')];var _0x377bf7=_0x59eff6?_0x388709['count']:_0x53cb5a[_0x668a('0x21')]+_0x53cb5a[_0x668a('0x23')];var _0x2b4a7f;if(_0x377bf7>=_0x543a88){_0x377bf7=_0x543a88;_0x2b4a7f=0xc8;}else{_0x2b4a7f=0xce;}_0x5578d8[_0x668a('0x1e')](_0x2b4a7f);return _0x5578d8[_0x668a('0x24')](_0x668a('0x25'),_0xa8b43f+'-'+_0x377bf7+'/'+_0x543a88)[_0x668a('0x20')](_0x388709);}return null;};}function patchUpdates(_0x183ce8){return function(_0xed1539){try{jsonpatch[_0x668a('0x26')](_0xed1539,_0x183ce8,!![]);}catch(_0x425093){return BPromise[_0x668a('0x27')](_0x425093);}return _0xed1539[_0x668a('0x28')]();};}function saveUpdates(_0x368254,_0x2b0d27){return function(_0x54fb78){if(_0x54fb78){return _0x54fb78[_0x668a('0x29')](_0x368254)['then'](function(_0x370891){return _0x370891;});}return null;};}function removeEntity(_0x2a686b,_0x4b57f2){return function(_0x412ad1){if(_0x412ad1){return _0x412ad1['destroy']()[_0x668a('0x2a')](function(){var _0x476398=_0x412ad1['get']({'plain':!![]});var _0x153e48=_0x668a('0x2b');return db[_0x668a('0x2c')][_0x668a('0x2d')]({'where':{'type':_0x153e48,'resourceId':_0x476398['id']}})[_0x668a('0x2a')](function(){return _0x412ad1;});})['then'](function(){_0x2a686b[_0x668a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b810,_0x1bb4e9){return function(_0xaa59ae){if(!_0xaa59ae){_0x45b810[_0x668a('0x1d')](0x194);}return _0xaa59ae;};}function handleError(_0x1b9f7a,_0x353722){_0x353722=_0x353722||0x1f4;return function(_0x8c7b13){logger['error'](_0x8c7b13['stack']);if(_0x8c7b13[_0x668a('0x2e')]){delete _0x8c7b13[_0x668a('0x2e')];}_0x1b9f7a['status'](_0x353722)[_0x668a('0x2f')](_0x8c7b13);};}exports['index']=function(_0xb9610,_0x2fee6a){var _0x381ce7={},_0x2626ce={},_0x48c820={'count':0x0,'rows':[]};var _0x112b47=_[_0x668a('0x30')](db['CmList'][_0x668a('0x31')],function(_0x11938a){return{'name':_0x11938a[_0x668a('0x32')],'type':_0x11938a[_0x668a('0x33')][_0x668a('0x34')]};});_0x2626ce[_0x668a('0x35')]=_[_0x668a('0x30')](_0x112b47,'name');_0x2626ce[_0x668a('0x36')]=_[_0x668a('0x37')](_0xb9610['query']);_0x2626ce[_0x668a('0x38')]=_[_0x668a('0x39')](_0x2626ce[_0x668a('0x35')],_0x2626ce[_0x668a('0x36')]);_0x381ce7['attributes']=_[_0x668a('0x39')](_0x2626ce['model'],qs[_0x668a('0x3a')](_0xb9610[_0x668a('0x36')]['fields']));_0x381ce7[_0x668a('0x3b')]=_0x381ce7[_0x668a('0x3b')][_0x668a('0x3c')]?_0x381ce7[_0x668a('0x3b')]:_0x2626ce[_0x668a('0x35')];if(!_0xb9610[_0x668a('0x36')]['hasOwnProperty'](_0x668a('0x3d'))){_0x381ce7[_0x668a('0x23')]=qs[_0x668a('0x23')](_0xb9610[_0x668a('0x36')][_0x668a('0x23')]);_0x381ce7['offset']=qs[_0x668a('0x21')](_0xb9610[_0x668a('0x36')][_0x668a('0x21')]);}_0x381ce7[_0x668a('0x3e')]=qs[_0x668a('0x3f')](_0xb9610[_0x668a('0x36')][_0x668a('0x3f')]);_0x381ce7[_0x668a('0x40')]=qs[_0x668a('0x38')](_[_0x668a('0x41')](_0xb9610[_0x668a('0x36')],_0x2626ce[_0x668a('0x38')]),_0x112b47);if(_0xb9610[_0x668a('0x36')][_0x668a('0x42')]){_0x381ce7[_0x668a('0x40')]=_[_0x668a('0x43')](_0x381ce7['where'],{'$or':_['map'](_0x112b47,function(_0x2cca4a){if(_0x2cca4a[_0x668a('0x33')]!=='VIRTUAL'){var _0x431033={};_0x431033[_0x2cca4a[_0x668a('0x2e')]]={'$like':'%'+_0xb9610[_0x668a('0x36')][_0x668a('0x42')]+'%'};return _0x431033;}})});}_0x381ce7=_[_0x668a('0x43')]({},_0x381ce7,_0xb9610['options']);var _0x44a1ed={'where':_0x381ce7[_0x668a('0x40')]};return db[_0x668a('0x44')][_0x668a('0x45')](_0x44a1ed)[_0x668a('0x2a')](function(_0x41b6e9){_0x48c820['count']=_0x41b6e9;if(_0xb9610[_0x668a('0x36')][_0x668a('0x46')]){_0x381ce7[_0x668a('0x47')]=[{'all':!![]}];}return db[_0x668a('0x44')][_0x668a('0x48')](_0x381ce7);})[_0x668a('0x2a')](function(_0xc59388){_0x48c820['rows']=_0xc59388;return _0x48c820;})[_0x668a('0x2a')](respondWithFilteredResult(_0x2fee6a,_0x381ce7))[_0x668a('0x49')](handleError(_0x2fee6a,null));};exports['show']=function(_0x58089d,_0x573ca2){var _0x22bbb7={'raw':![],'where':{'id':_0x58089d[_0x668a('0x4a')]['id']}},_0x362123={};_0x362123[_0x668a('0x35')]=_['keys'](db['CmList']['rawAttributes']);_0x362123['query']=_[_0x668a('0x37')](_0x58089d['query']);_0x362123[_0x668a('0x38')]=_['intersection'](_0x362123[_0x668a('0x35')],_0x362123[_0x668a('0x36')]);_0x22bbb7[_0x668a('0x3b')]=_[_0x668a('0x39')](_0x362123[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x58089d[_0x668a('0x36')]['fields']));_0x22bbb7[_0x668a('0x3b')]=_0x22bbb7[_0x668a('0x3b')][_0x668a('0x3c')]?_0x22bbb7[_0x668a('0x3b')]:_0x362123[_0x668a('0x35')];if(_0x58089d[_0x668a('0x36')]['includeAll']){_0x22bbb7[_0x668a('0x47')]=[{'all':!![]}];}_0x22bbb7=_[_0x668a('0x43')]({},_0x22bbb7,_0x58089d[_0x668a('0x4b')]);return db[_0x668a('0x44')][_0x668a('0x4c')](_0x22bbb7)[_0x668a('0x2a')](handleEntityNotFound(_0x573ca2,null))[_0x668a('0x2a')](respondWithResult(_0x573ca2,null))[_0x668a('0x49')](handleError(_0x573ca2,null));};exports[_0x668a('0x4d')]=function(_0x1b250b,_0x28e7c6){return db['CmList'][_0x668a('0x4d')](_0x1b250b[_0x668a('0x4e')],{})['then'](function(_0x27863d){var _0x8e765b=_0x1b250b[_0x668a('0x4f')][_0x668a('0x50')]({'plain':!![]});if(!_0x8e765b)throw new Error(_0x668a('0x51'));if(_0x8e765b[_0x668a('0x52')]===_0x668a('0x4f')){var _0x224565=_0x27863d[_0x668a('0x50')]({'plain':!![]});var _0x2f1804=_0x668a('0x2b');return db[_0x668a('0x53')][_0x668a('0x4c')]({'where':{'name':_0x2f1804,'userProfileId':_0x8e765b['userProfileId']},'raw':!![]})[_0x668a('0x2a')](function(_0x250276){if(_0x250276&&_0x250276[_0x668a('0x54')]===0x0){return db[_0x668a('0x2c')][_0x668a('0x4d')]({'name':_0x224565[_0x668a('0x2e')],'resourceId':_0x224565['id'],'type':_0x250276[_0x668a('0x2e')],'sectionId':_0x250276['id']},{})[_0x668a('0x2a')](function(){return _0x27863d;});}else{return _0x27863d;}})['catch'](function(_0x424fdd){logger[_0x668a('0x55')](_0x668a('0x56'),_0x424fdd);throw _0x424fdd;});}return _0x27863d;})['then'](respondWithResult(_0x28e7c6,0xc9))[_0x668a('0x49')](handleError(_0x28e7c6,null));};exports[_0x668a('0x29')]=function(_0x4c2b83,_0x836e70){if(_0x4c2b83['body']['id']){delete _0x4c2b83[_0x668a('0x4e')]['id'];}return db['CmList'][_0x668a('0x4c')]({'where':{'id':_0x4c2b83[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x836e70,null))[_0x668a('0x2a')](saveUpdates(_0x4c2b83['body'],null))['then'](respondWithResult(_0x836e70,null))[_0x668a('0x49')](handleError(_0x836e70,null));};exports['destroy']=function(_0x40529d,_0x354a00){return db[_0x668a('0x44')][_0x668a('0x4c')]({'where':{'id':_0x40529d[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x354a00,null))[_0x668a('0x2a')](removeEntity(_0x354a00,null))[_0x668a('0x49')](handleError(_0x354a00,null));};exports[_0x668a('0x57')]=function(_0x27f094,_0x53fa70){return db[_0x668a('0x44')][_0x668a('0x57')]()[_0x668a('0x2a')](respondWithResult(_0x53fa70,null))[_0x668a('0x49')](handleError(_0x53fa70,null));};exports[_0x668a('0x58')]=function(_0x29bbea,_0x20cd98,_0x4026bd){if(_0x29bbea['body']['id']){delete _0x29bbea[_0x668a('0x4e')]['id'];}return db[_0x668a('0x44')][_0x668a('0x4c')]({'where':{'id':_0x29bbea['params']['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x20cd98,null))[_0x668a('0x2a')](function(_0x5cc537){if(_0x5cc537){_0x29bbea['body'][_0x668a('0x59')]=_0x5cc537['id'];return db['Disposition']['create'](_0x29bbea['body']);}})[_0x668a('0x2a')](respondWithResult(_0x20cd98,null))[_0x668a('0x49')](handleError(_0x20cd98,null));};exports[_0x668a('0x5a')]=function(_0x355dc5,_0x5a815b,_0x5c6f4e){var _0x3d4494={'raw':![],'where':{}};var _0x3e4ea6={};var _0x3df547={'count':0x0,'rows':[]};return db[_0x668a('0x44')]['findOne']({'where':{'id':_0x355dc5[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x5a815b,null))[_0x668a('0x2a')](function(_0x15b4f8){if(_0x15b4f8){_0x3e4ea6[_0x668a('0x35')]=_[_0x668a('0x37')](db[_0x668a('0x5b')][_0x668a('0x31')]);_0x3e4ea6['query']=_['keys'](_0x355dc5['query']);_0x3e4ea6[_0x668a('0x38')]=_[_0x668a('0x39')](_0x3e4ea6[_0x668a('0x35')],_0x3e4ea6['query']);_0x3d4494['attributes']=_['intersection'](_0x3e4ea6[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x355dc5[_0x668a('0x36')][_0x668a('0x3a')]));_0x3d4494[_0x668a('0x3b')]=_0x3d4494[_0x668a('0x3b')][_0x668a('0x3c')]?_0x3d4494[_0x668a('0x3b')]:_0x3e4ea6['model'];if(!_0x355dc5['query'][_0x668a('0x5c')](_0x668a('0x3d'))){_0x3d4494[_0x668a('0x23')]=qs[_0x668a('0x23')](_0x355dc5[_0x668a('0x36')]['limit']);_0x3d4494[_0x668a('0x21')]=qs[_0x668a('0x21')](_0x355dc5[_0x668a('0x36')][_0x668a('0x21')]);}_0x3d4494['order']=qs['sort'](_0x355dc5['query'][_0x668a('0x3f')]);_0x3d4494['where']=qs[_0x668a('0x38')](_[_0x668a('0x41')](_0x355dc5[_0x668a('0x36')],_0x3e4ea6[_0x668a('0x38')]));_0x3d4494[_0x668a('0x40')][_0x668a('0x59')]=_0x15b4f8['id'];if(_0x355dc5[_0x668a('0x36')][_0x668a('0x42')]){_0x3d4494['where']=_[_0x668a('0x43')](_0x3d4494[_0x668a('0x40')],{'$or':_[_0x668a('0x30')](_0x3d4494['attributes'],function(_0x34cccd){var _0x1c29f0={};_0x1c29f0[_0x34cccd]={'$like':'%'+_0x355dc5[_0x668a('0x36')][_0x668a('0x42')]+'%'};return _0x1c29f0;})});}_0x3d4494=_['merge']({},_0x3d4494,_0x355dc5['options']);return db[_0x668a('0x5b')][_0x668a('0x45')]({'where':_0x3d4494['where']})[_0x668a('0x2a')](function(_0x469a36){_0x3df547[_0x668a('0x45')]=_0x469a36;if(_0x355dc5['query'][_0x668a('0x46')]){_0x3d4494[_0x668a('0x47')]=[{'all':!![]}];}return db[_0x668a('0x5b')][_0x668a('0x48')](_0x3d4494);})['then'](function(_0x579676){_0x3df547[_0x668a('0x5d')]=_0x579676;return _0x3df547;});}})[_0x668a('0x2a')](respondWithFilteredResult(_0x5a815b,_0x3d4494))[_0x668a('0x49')](handleError(_0x5a815b,null));};exports[_0x668a('0x5e')]=function(_0x2e55bd,_0x36b1f0,_0x11d7a2){return db[_0x668a('0x44')][_0x668a('0x4c')]({'where':{'id':_0x2e55bd[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x36b1f0,null))[_0x668a('0x2a')](function(_0x229078){if(_0x229078){return _0x229078['removeDispositions'](_0x2e55bd['query'][_0x668a('0x5f')]);}})[_0x668a('0x2a')](respondWithStatusCode(_0x36b1f0,null))[_0x668a('0x49')](handleError(_0x36b1f0,null));};exports[_0x668a('0x60')]=function(_0x427a81,_0x1b5d8f,_0x261d52){return db['CmList'][_0x668a('0x4c')]({'where':{'id':_0x427a81['params']['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x1b5d8f,null))[_0x668a('0x2a')](function(_0x1e5f02){if(_0x1e5f02){var _0x14fd02=[];var _0x3d1135={'success':[],'errors':[]};return db[_0x668a('0x61')][_0x668a('0x57')]()[_0x668a('0x2a')](function(_0x5561e2){if(_0x427a81['body'][_0x668a('0x62')]&&_[_0x668a('0x63')](_0x427a81[_0x668a('0x4e')][_0x668a('0x62')])){if(_0x427a81[_0x668a('0x4e')][_0x668a('0x62')][_0x668a('0x3c')]){_0x427a81[_0x668a('0x4e')][_0x668a('0x62')]=_0x427a81[_0x668a('0x4e')][_0x668a('0x62')][_0x668a('0x64')](';')+';';}else{_0x427a81['body']['tags']=null;}}else{_0x427a81[_0x668a('0x4e')][_0x668a('0x62')]=null;}if(_0x427a81[_0x668a('0x4e')]&&_[_0x668a('0x63')](_0x427a81['body'])){for(var _0x20258f=0x0;_0x20258f<_0x427a81[_0x668a('0x4e')][_0x668a('0x3c')];_0x20258f+=0x1){_0x427a81[_0x668a('0x4e')][_0x20258f]['ListId']=_0x427a81[_0x668a('0x4a')]['id'];_0x14fd02[_0x668a('0x65')](_0x427a81[_0x668a('0x4e')][_0x20258f]);}return BPromise[_0x668a('0x66')](_0x14fd02,function(_0x2a3d8f){return db[_0x668a('0x61')][_0x668a('0x4d')](_['omit'](_0x2a3d8f,['ids','id'])||{},{'fields':_[_0x668a('0x37')](_0x5561e2),'raw':!![]})[_0x668a('0x2a')](function(_0x3ac642){_0x3d1135['success'][_0x668a('0x65')](_0x3ac642[_0x668a('0x67')]);})[_0x668a('0x49')](function(_0x481272){_0x3d1135[_0x668a('0x68')][_0x668a('0x65')]({'data':_0x2a3d8f,'error':_0x481272['message']});});})[_0x668a('0x2a')](function(_0x378ed1){return _0x3d1135;})[_0x668a('0x49')](function(_0x1a07a7){return _0x1a07a7;});}else{_0x1b5d8f[_0x668a('0x1e')](0x190)[_0x668a('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x668a('0x2a')](respondWithResult(_0x1b5d8f,null))[_0x668a('0x49')](handleError(_0x1b5d8f,null));};exports[_0x668a('0x69')]=function(_0x1e4bb3,_0x5d7c94,_0x2d9b18){var _0x116ec3;return db[_0x668a('0x44')]['find']({'where':{'id':_0x1e4bb3['params']['id']},'include':[{'model':db[_0x668a('0x6a')],'as':_0x668a('0x6b')}]})[_0x668a('0x2a')](handleEntityNotFound(_0x5d7c94,null))[_0x668a('0x2a')](function(_0x1257a1){if(_0x1257a1){_0x116ec3=_0x1257a1;return db[_0x668a('0x61')][_0x668a('0x31')];}})['then'](function(_0x5a51a6){if(_0x5a51a6){var _0x2042d3={};var _0x3feecd={};_0x3feecd[_0x668a('0x35')]=_[_0x668a('0x6c')](_['keys'](_0x5a51a6),_['map'](_0x116ec3[_0x668a('0x6b')],function(_0x2d0d5e){return util[_0x668a('0x6d')](_0x668a('0x6e'),_0x2d0d5e['id']);}));_0x3feecd[_0x668a('0x36')]=_[_0x668a('0x37')](_0x1e4bb3[_0x668a('0x36')]);_0x3feecd[_0x668a('0x38')]=_[_0x668a('0x39')](_0x3feecd['model'],_0x3feecd[_0x668a('0x36')]);_0x2042d3[_0x668a('0x3b')]=_['intersection'](_0x3feecd[_0x668a('0x35')],qs['fields'](_0x1e4bb3[_0x668a('0x36')][_0x668a('0x3a')]));_0x2042d3[_0x668a('0x3b')]=_0x2042d3[_0x668a('0x3b')][_0x668a('0x3c')]?_0x2042d3[_0x668a('0x3b')]:_0x3feecd[_0x668a('0x35')];if(!_0x1e4bb3['query']['hasOwnProperty'](_0x668a('0x3d'))){_0x2042d3[_0x668a('0x23')]=qs[_0x668a('0x23')](_0x1e4bb3['query'][_0x668a('0x23')]);_0x2042d3['offset']=qs['offset'](_0x1e4bb3[_0x668a('0x36')][_0x668a('0x21')]);}_0x2042d3[_0x668a('0x3e')]=qs[_0x668a('0x3f')](_0x1e4bb3[_0x668a('0x36')][_0x668a('0x3f')]);_0x2042d3[_0x668a('0x40')]=qs[_0x668a('0x38')](_[_0x668a('0x41')](_0x1e4bb3[_0x668a('0x36')],_0x3feecd[_0x668a('0x38')]));_0x2042d3[_0x668a('0x6f')]=!![];if(_0x1e4bb3[_0x668a('0x36')][_0x668a('0x42')]){_0x2042d3[_0x668a('0x40')]=_[_0x668a('0x43')](_0x2042d3['where'],{'$or':_[_0x668a('0x30')](_0x2042d3[_0x668a('0x3b')],function(_0x3ab1d9){var _0x412369={};_0x412369[_0x3ab1d9]={'$like':'%'+_0x1e4bb3[_0x668a('0x36')]['filter']+'%'};return _0x412369;})});}_0x2042d3=_['merge']({},_0x2042d3,_0x1e4bb3[_0x668a('0x4b')]);return _0x116ec3[_0x668a('0x69')](_0x2042d3);}})[_0x668a('0x2a')](respondWithResult(_0x5d7c94,null))['catch'](handleError(_0x5d7c94,null));};exports['getContactsCsv']=function(_0x1d2610,_0x4e0c3a,_0x3b0deb){var _0xac0679;var _0x50ba11;var _0x134dc9;var _0x84f0ea=_0x1d2610[_0x668a('0x4a')]['id'];csv_results=[];return db[_0x668a('0x70')]['findAll']({'attributes':['id',_0x668a('0x2e')],'raw':!![],'order':['OrderBy']})['then'](function(_0x4c1712){_0xac0679=_0x4c1712;var _0xdf7753=_[_0x668a('0x37')](db['CmContact'][_0x668a('0x31')]);return db['CmCustomField'][_0x668a('0x48')]({'raw':!![],'attributes':['id',_0x668a('0x71')]})[_0x668a('0x2a')](function(_0x25e87f){_0x50ba11=_0x25e87f;var _0x4783f6=squel[_0x668a('0x72')]()['fields'](_0xdf7753)[_0x668a('0x73')]('cm_contacts','c')[_0x668a('0x40')](_0x668a('0x74'),_0x84f0ea)[_0x668a('0x40')](_0x668a('0x75'))[_0x668a('0x76')]();for(var _0x292be9=0x0;_0x292be9<_0x50ba11[_0x668a('0x3c')];_0x292be9++){_0x4783f6[_0x668a('0x77')]('c.cf_'+_0x50ba11[_0x292be9]['id'],_0x668a('0x78')+_0x50ba11[_0x292be9][_0x668a('0x71')]);}for(var _0x292be9=0x0;_0x292be9<_0xac0679[_0x668a('0x3c')];_0x292be9++){_0x4783f6[_0x668a('0x77')](squel['select']()['field'](_0x668a('0x79'))[_0x668a('0x73')](_0x668a('0x7a'))[_0x668a('0x40')](_0x668a('0x7b'),_0xac0679[_0x292be9]['id'])['where'](_0x668a('0x7c')),_0x668a('0x7d')+_0xac0679[_0x292be9][_0x668a('0x2e')]);_0x4783f6[_0x668a('0x77')](squel[_0x668a('0x72')]()['field']('description')[_0x668a('0x73')](_0x668a('0x7a'))[_0x668a('0x40')](_0x668a('0x7b'),_0xac0679[_0x292be9]['id'])[_0x668a('0x40')](_0x668a('0x7c')),_0x668a('0x7e')+_0xac0679[_0x292be9][_0x668a('0x2e')]);}var _0x981508=[];_0x981508['push'](_0x4783f6[_0x668a('0x7f')]());BPromise[_0x668a('0x66')](_0x981508,handleQuery)[_0x668a('0x2a')](function(_0x4dccef){handleQuery(_0x4783f6[_0x668a('0x7f')]());var _0x4dcd9b=csv_results[0x0];if(!_[_0x668a('0x80')](_0x4dcd9b)){var _0x544aea=toCsv(_0x4dcd9b);var _0x4803be=Date[_0x668a('0x81')]();fs[_0x668a('0x82')](util[_0x668a('0x6d')](_0x668a('0x83'),_0x84f0ea,_0x4803be),_0x544aea);_0x4e0c3a[_0x668a('0x84')](_0x668a('0x85'),_0x668a('0x86')+util[_0x668a('0x6d')](_0x668a('0x87'),_0x84f0ea,_0x4803be));_0x4e0c3a[_0x668a('0x84')](_0x668a('0x88'),_0x668a('0x89'));return _0x4e0c3a['download'](util['format'](_0x668a('0x83'),_0x84f0ea,_0x4803be));}else{return _0x4e0c3a[_0x668a('0x1d')](0xcc);}});});});};exports[_0x668a('0x8a')]=function(_0x350ea9,_0x1ac382,_0x534ed4){var _0x379a61;delete _0x350ea9['body']['id'];return db[_0x668a('0x44')][_0x668a('0x8b')]({'where':{'id':_0x350ea9['params']['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x1ac382,null))[_0x668a('0x2a')](function(_0x1bb5d7){if(_0x1bb5d7){return db[_0x668a('0x8c')][_0x668a('0x8d')](function(_0x13b8a0){return db[_0x668a('0x6a')][_0x668a('0x4d')](_0x350ea9['body'],{'transaction':_0x13b8a0})[_0x668a('0x2a')](function(_0x523655){_0x379a61=_0x523655;return _0x1bb5d7['addCustomFields'](_0x523655,{'transaction':_0x13b8a0});})[_0x668a('0x2a')](function(){var _0x2952e5={'type':db[_0x668a('0x8e')]['TEXT'],'transaction':_0x13b8a0};switch(_0x350ea9[_0x668a('0x4e')][_0x668a('0x33')]){case _0x668a('0x8f'):_0x2952e5[_0x668a('0x33')]=db[_0x668a('0x8e')]['TEXT'];break;case _0x668a('0x90'):_0x2952e5[_0x668a('0x33')]=db[_0x668a('0x8e')][_0x668a('0x91')];break;case _0x668a('0x92'):_0x2952e5[_0x668a('0x33')]=db[_0x668a('0x8e')][_0x668a('0x93')];_0x2952e5['defaultValue']=![];break;default:}return db[_0x668a('0x8c')][_0x668a('0x94')][_0x668a('0x95')](_0x668a('0x96'),util[_0x668a('0x6d')](_0x668a('0x97'),_0x379a61['id']),_0x2952e5);})[_0x668a('0x2a')](function(){return _0x379a61;});});}})[_0x668a('0x2a')](respondWithResult(_0x1ac382,null))[_0x668a('0x49')](handleError(_0x1ac382,null));};exports['getCustomFields']=function(_0x22d715,_0x3884b0,_0x2bb3b8){var _0x24335c={};var _0x405d00={};var _0x4e938d;var _0x2c189b;return db[_0x668a('0x44')]['findOne']({'where':{'id':_0x22d715[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x3884b0,null))[_0x668a('0x2a')](function(_0x5c08a1){if(_0x5c08a1){_0x4e938d=_0x5c08a1;_0x405d00[_0x668a('0x35')]=_['keys'](db['CmCustomField'][_0x668a('0x31')]);_0x405d00[_0x668a('0x36')]=_[_0x668a('0x37')](_0x22d715['query']);_0x405d00[_0x668a('0x38')]=_['intersection'](_0x405d00[_0x668a('0x35')],_0x405d00[_0x668a('0x36')]);_0x24335c[_0x668a('0x3b')]=_[_0x668a('0x39')](_0x405d00['model'],qs[_0x668a('0x3a')](_0x22d715[_0x668a('0x36')][_0x668a('0x3a')]));_0x24335c[_0x668a('0x3b')]=_0x24335c[_0x668a('0x3b')][_0x668a('0x3c')]?_0x24335c[_0x668a('0x3b')]:_0x405d00[_0x668a('0x35')];_0x24335c['order']=qs['sort'](_0x22d715['query'][_0x668a('0x3f')]);_0x24335c['where']=qs[_0x668a('0x38')](_[_0x668a('0x41')](_0x22d715[_0x668a('0x36')],_0x405d00['filters']));_0x24335c[_0x668a('0x40')]=_[_0x668a('0x43')](_0x24335c[_0x668a('0x40')],{'$or':[{'ListId':_0x5c08a1['id']},{'ListId':null}]});if(_0x22d715['query'][_0x668a('0x42')]){_0x24335c[_0x668a('0x40')]=_[_0x668a('0x43')](_0x24335c[_0x668a('0x40')],{'$or':_[_0x668a('0x30')](_0x24335c[_0x668a('0x3b')],function(_0x3291bd){var _0x287d3d={};_0x287d3d[_0x3291bd]={'$like':'%'+_0x22d715['query'][_0x668a('0x42')]+'%'};return _0x287d3d;})});}_0x24335c=_[_0x668a('0x43')]({},_0x24335c,_0x22d715[_0x668a('0x4b')]);return db[_0x668a('0x6a')][_0x668a('0x98')](_0x24335c);}})[_0x668a('0x2a')](respondWithResult(_0x3884b0,null))[_0x668a('0x49')](handleError(_0x3884b0,null));};exports[_0x668a('0x99')]=function(_0x4df2fa,_0x415597){return db[_0x668a('0x6a')]['findAndCountAll']({'where':{'ListId':null}})[_0x668a('0x2a')](handleEntityNotFound(_0x415597,null))[_0x668a('0x2a')](function(_0x58a41c){return _0x58a41c;})[_0x668a('0x2a')](respondWithResult(_0x415597,null))['catch'](handleError(_0x415597,null));};exports['addAgents']=function(_0x278dbc,_0x235fec,_0x371776){return db[_0x668a('0x44')][_0x668a('0x4c')]({'where':{'id':_0x278dbc[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x235fec,null))[_0x668a('0x2a')](function(_0xd72db5){if(_0xd72db5){return _0xd72db5['addAgents'](_0x278dbc[_0x668a('0x4e')][_0x668a('0x5f')],_['omit'](_0x278dbc[_0x668a('0x4e')],[_0x668a('0x5f'),'id'])||{})[_0x668a('0x9a')](function(_0x19ffba){for(var _0xc931d4=0x0;_0xc931d4<_0x278dbc[_0x668a('0x4e')][_0x668a('0x5f')]['length'];_0xc931d4+=0x1){socket[_0x668a('0x9b')](_0x668a('0x9c'),{'UserId':Number(_0x278dbc[_0x668a('0x4e')][_0x668a('0x5f')][_0xc931d4]),'CmListId':Number(_0x278dbc['params']['id'])});}return _0x19ffba;});}})[_0x668a('0x2a')](respondWithResult(_0x235fec,null))[_0x668a('0x49')](handleError(_0x235fec,null));};exports['removeAgents']=function(_0x5ab3c8,_0x21ce7d,_0x2ed897){return db[_0x668a('0x44')][_0x668a('0x4c')]({'where':{'id':_0x5ab3c8['params']['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x21ce7d,null))[_0x668a('0x2a')](function(_0x581077){if(_0x581077){return _0x581077[_0x668a('0x9d')](_0x5ab3c8[_0x668a('0x36')]['ids'])[_0x668a('0x2a')](function(){if(_[_0x668a('0x63')](_0x5ab3c8[_0x668a('0x36')]['ids'])){for(var _0xb3a69c=0x0;_0xb3a69c<_0x5ab3c8['query'][_0x668a('0x5f')][_0x668a('0x3c')];_0xb3a69c+=0x1){socket[_0x668a('0x9b')]('userCmList:remove',{'UserId':Number(_0x5ab3c8[_0x668a('0x36')][_0x668a('0x5f')][_0xb3a69c]),'CmListId':Number(_0x5ab3c8[_0x668a('0x4a')]['id'])});}}else{socket[_0x668a('0x9b')](_0x668a('0x9e'),{'UserId':Number(_0x5ab3c8[_0x668a('0x36')][_0x668a('0x5f')]),'CmListId':Number(_0x5ab3c8[_0x668a('0x4a')]['id'])});}});}})[_0x668a('0x2a')](respondWithStatusCode(_0x21ce7d,null))['catch'](handleError(_0x21ce7d,null));};exports[_0x668a('0x9f')]=function(_0x3e8e25,_0x314b3c,_0x50aaac){var _0x204664={};var _0x57d975={};var _0x216606;var _0x1ad204;return db['CmList'][_0x668a('0x8b')]({'where':{'id':_0x3e8e25[_0x668a('0x4a')]['id']}})[_0x668a('0x2a')](handleEntityNotFound(_0x314b3c,null))[_0x668a('0x2a')](function(_0x4ac94b){if(_0x4ac94b){_0x216606=_0x4ac94b;_0x57d975[_0x668a('0x35')]=_[_0x668a('0x37')](db[_0x668a('0xa0')][_0x668a('0x31')]);_0x57d975[_0x668a('0x36')]=_[_0x668a('0x37')](_0x3e8e25[_0x668a('0x36')]);_0x57d975[_0x668a('0x38')]=_['intersection'](_0x57d975['model'],_0x57d975[_0x668a('0x36')]);_0x204664[_0x668a('0x3b')]=_[_0x668a('0x39')](_0x57d975[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x3e8e25[_0x668a('0x36')][_0x668a('0x3a')]));_0x204664['attributes']=_0x204664[_0x668a('0x3b')][_0x668a('0x3c')]?_0x204664[_0x668a('0x3b')]:_0x57d975['model'];_0x204664[_0x668a('0x3e')]=qs[_0x668a('0x3f')](_0x3e8e25['query'][_0x668a('0x3f')]);_0x204664[_0x668a('0x40')]=qs[_0x668a('0x38')](_[_0x668a('0x41')](_0x3e8e25[_0x668a('0x36')],_0x57d975[_0x668a('0x38')]));if(_0x3e8e25[_0x668a('0x36')]['filter']){_0x204664[_0x668a('0x40')]=_[_0x668a('0x43')](_0x204664[_0x668a('0x40')],{'$or':_[_0x668a('0x30')](_0x204664[_0x668a('0x3b')],function(_0x2a1a02){var _0x1c819e={};_0x1c819e[_0x2a1a02]={'$like':'%'+_0x3e8e25['query'][_0x668a('0x42')]+'%'};return _0x1c819e;})});}_0x204664=_[_0x668a('0x43')]({},_0x204664,_0x3e8e25[_0x668a('0x4b')]);return _0x216606['getAgents'](_0x204664);}})[_0x668a('0x2a')](function(_0x4c7cdf){if(_0x4c7cdf){_0x1ad204=_0x4c7cdf[_0x668a('0x3c')];if(!_0x3e8e25[_0x668a('0x36')][_0x668a('0x5c')](_0x668a('0x3d'))){_0x204664[_0x668a('0x23')]=qs['limit'](_0x3e8e25[_0x668a('0x36')][_0x668a('0x23')]);_0x204664[_0x668a('0x21')]=qs['offset'](_0x3e8e25[_0x668a('0x36')]['offset']);}return _0x216606[_0x668a('0x9f')](_0x204664);}})[_0x668a('0x2a')](function(_0x4dca58){if(_0x4dca58){return _0x4dca58?{'count':_0x1ad204,'rows':_0x4dca58}:null;}})['then'](respondWithResult(_0x314b3c,null))[_0x668a('0x49')](handleError(_0x314b3c,null));};function handleQuery(_0x134e38){logger['info'](_0x134e38);return db[_0x668a('0x8c')][_0x668a('0x36')](_0x134e38)[_0x668a('0x9a')](function(_0x1c4181){csv_results['push'](_0x1c4181);})[_0x668a('0x49')](function(_0x3070f9){logger[_0x668a('0x55')](_0x3070f9[_0x668a('0xa1')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e881b18..d0c3bf0 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x4493c9,_0x3bb7d0){_0x4493c9=_0x4493c9-0x0;var _0x554351=_0xe14b[_0x4493c9];return _0x554351;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x55ca,0x126));var _0xa55c=function(_0x4944f1,_0x482a52){_0x4944f1=_0x4944f1-0x0;var _0x433494=_0x55ca[_0x4944f1];return _0x433494;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4aa90fc..3f7541b 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 _0xb821=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','../../config/logger','bluebird'];(function(_0xb859c1,_0x11abf6){var _0x5d944e=function(_0xc8732f){while(--_0xc8732f){_0xb859c1['push'](_0xb859c1['shift']());}};_0x5d944e(++_0x11abf6);}(_0xb821,0xa7));var _0x1b82=function(_0x532248,_0x15b5c5){_0x532248=_0x532248-0x0;var _0x43354f=_0xb821[_0x532248];return _0x43354f;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8a8=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util'];(function(_0x583a4f,_0x2de52e){var _0x64c2bb=function(_0x42c0a2){while(--_0x42c0a2){_0x583a4f['push'](_0x583a4f['shift']());}};_0x64c2bb(++_0x2de52e);}(_0xa8a8,0xec));var _0x8a8a=function(_0x24c0e9,_0x421b12){_0x24c0e9=_0x24c0e9-0x0;var _0x27492b=_0xa8a8[_0x24c0e9];return _0x27492b;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'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 0da70b4..8c0aaee 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 _0x202a=['message','result','catch','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x18d2f3,_0x5317c8){var _0x2ff0d2=function(_0x5e274e){while(--_0x5e274e){_0x18d2f3['push'](_0x18d2f3['shift']());}};_0x2ff0d2(++_0x5317c8);}(_0x202a,0x173));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa202('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa202('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa202('0x2'));var logger=require(_0xa202('0x3'))(_0xa202('0x4'));var config=require('../../config/environment');var jayson=require(_0xa202('0x5'));var client=jayson[_0xa202('0x6')][_0xa202('0x7')]({'port':0x232a});config[_0xa202('0x8')]=_[_0xa202('0x9')](config[_0xa202('0x8')],{'host':_0xa202('0xa'),'port':0x18eb});var socket=require(_0xa202('0xb'))(new Redis(config[_0xa202('0x8')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x2bb7e7,_0x15224d,_0x215393){return new BPromise(function(_0x3a4dbb,_0x36f693){return client[_0xa202('0xc')](_0x2bb7e7,_0x215393)[_0xa202('0xd')](function(_0x5b7843){logger[_0xa202('0xe')](_0xa202('0xf'),_0x15224d,_0xa202('0x10'));logger['debug'](_0xa202('0x11'),_0x15224d,_0xa202('0x10'),JSON[_0xa202('0x12')](_0x5b7843));if(_0x5b7843['error']){if(_0x5b7843[_0xa202('0x13')]['code']===0x1f4){logger[_0xa202('0x13')]('CmList,\x20%s,\x20%s',_0x15224d,_0x5b7843[_0xa202('0x13')][_0xa202('0x14')]);return _0x36f693(_0x5b7843['error'][_0xa202('0x14')]);}logger['error'](_0xa202('0xf'),_0x15224d,_0x5b7843[_0xa202('0x13')]['message']);return _0x3a4dbb(_0x5b7843[_0xa202('0x13')][_0xa202('0x14')]);}else{logger[_0xa202('0xe')](_0xa202('0xf'),_0x15224d,_0xa202('0x10'));_0x3a4dbb(_0x5b7843[_0xa202('0x15')]['message']);}})[_0xa202('0x16')](function(_0x21c5c8){logger['error'](_0xa202('0xf'),_0x15224d,_0x21c5c8);_0x36f693(_0x21c5c8);});});} \ No newline at end of file +var _0xebe8=['lodash','util','moment','../../mysqldb','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5ae497,_0x49fe0e){var _0x2f7811=function(_0x224898){while(--_0x224898){_0x5ae497['push'](_0x5ae497['shift']());}};_0x2f7811(++_0x49fe0e);}(_0xebe8,0x142));var _0x8ebe=function(_0xb9a5ed,_0x209bfc){_0xb9a5ed=_0xb9a5ed-0x0;var _0x3a1d44=_0xebe8[_0xb9a5ed];return _0x3a1d44;};'use strict';var _=require(_0x8ebe('0x0'));var util=require(_0x8ebe('0x1'));var moment=require(_0x8ebe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ebe('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ebe('0x4'));var config=require('../../config/environment');var jayson=require(_0x8ebe('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8ebe('0x6')](config[_0x8ebe('0x7')],{'host':_0x8ebe('0x8'),'port':0x18eb});var socket=require(_0x8ebe('0x9'))(new Redis(config[_0x8ebe('0x7')]));require(_0x8ebe('0xa'))[_0x8ebe('0xb')](socket);function respondWithRpcPromise(_0x483d27,_0x2b3292,_0x3dd0cc){return new BPromise(function(_0x2c5fe0,_0x216363){return client['request'](_0x483d27,_0x3dd0cc)[_0x8ebe('0xc')](function(_0x22e7c1){logger[_0x8ebe('0xd')](_0x8ebe('0xe'),_0x2b3292,_0x8ebe('0xf'));logger[_0x8ebe('0x10')](_0x8ebe('0x11'),_0x2b3292,_0x8ebe('0xf'),JSON[_0x8ebe('0x12')](_0x22e7c1));if(_0x22e7c1[_0x8ebe('0x13')]){if(_0x22e7c1['error'][_0x8ebe('0x14')]===0x1f4){logger[_0x8ebe('0x13')](_0x8ebe('0xe'),_0x2b3292,_0x22e7c1['error'][_0x8ebe('0x15')]);return _0x216363(_0x22e7c1[_0x8ebe('0x13')]['message']);}logger[_0x8ebe('0x13')](_0x8ebe('0xe'),_0x2b3292,_0x22e7c1[_0x8ebe('0x13')][_0x8ebe('0x15')]);return _0x2c5fe0(_0x22e7c1[_0x8ebe('0x13')][_0x8ebe('0x15')]);}else{logger['info'](_0x8ebe('0xe'),_0x2b3292,_0x8ebe('0xf'));_0x2c5fe0(_0x22e7c1['result'][_0x8ebe('0x15')]);}})[_0x8ebe('0x16')](function(_0x5df466){logger[_0x8ebe('0x13')](_0x8ebe('0xe'),_0x2b3292,_0x5df466);_0x216363(_0x5df466);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 8b68ecf..6927750 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 _0xba38=['update','register','cmList:','./cmList.events','remove'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xba38,0x1ac));var _0x8ba3=function(_0x58487d,_0x1b1326){_0x58487d=_0x58487d-0x0;var _0x3a3ee9=_0xba38[_0x58487d];return _0x3a3ee9;};'use strict';var CmListEvents=require(_0x8ba3('0x0'));var events=['save',_0x8ba3('0x1'),_0x8ba3('0x2')];function createListener(_0x4ce217,_0x1de350){return function(_0x3c83a0){_0x1de350['emit'](_0x4ce217,_0x3c83a0);};}function removeListener(_0xe98eb5,_0x526b9c){return function(){CmListEvents['removeListener'](_0xe98eb5,_0x526b9c);};}exports[_0x8ba3('0x3')]=function(_0x3046d8){for(var _0x377a26=0x0,_0x5a5eaf=events['length'];_0x377a26<_0x5a5eaf;_0x377a26++){var _0x110c5c=events[_0x377a26];var _0x481b94=createListener(_0x8ba3('0x4')+_0x110c5c,_0x3046d8);CmListEvents['on'](_0x110c5c,_0x481b94);}}; \ No newline at end of file +var _0x43b8=['remove','update','emit','removeListener','register','length','./cmList.events','save'];(function(_0x578a4a,_0xf3eec0){var _0x36f276=function(_0x513dd4){while(--_0x513dd4){_0x578a4a['push'](_0x578a4a['shift']());}};_0x36f276(++_0xf3eec0);}(_0x43b8,0x166));var _0x843b=function(_0x713b45,_0x327471){_0x713b45=_0x713b45-0x0;var _0x5dd14d=_0x43b8[_0x713b45];return _0x5dd14d;};'use strict';var CmListEvents=require(_0x843b('0x0'));var events=[_0x843b('0x1'),_0x843b('0x2'),_0x843b('0x3')];function createListener(_0x44194e,_0x28a8ec){return function(_0x13caac){_0x28a8ec[_0x843b('0x4')](_0x44194e,_0x13caac);};}function removeListener(_0x3fcf5d,_0x3c892e){return function(){CmListEvents[_0x843b('0x5')](_0x3fcf5d,_0x3c892e);};}exports[_0x843b('0x6')]=function(_0x3436be){for(var _0x38863f=0x0,_0x51cffd=events[_0x843b('0x7')];_0x38863f<_0x51cffd;_0x38863f++){var _0x2902ba=events[_0x38863f];var _0x44fb18=createListener('cmList:'+_0x2902ba,_0x3436be);CmListEvents['on'](_0x2902ba,_0x44fb18);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index c924722..da72d78 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 _0x24ef=['removeAgents','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy','removeDispositions'];(function(_0x56625d,_0x12e6e9){var _0x3bf11b=function(_0x53294d){while(--_0x53294d){_0x56625d['push'](_0x56625d['shift']());}};_0x3bf11b(++_0x12e6e9);}(_0x24ef,0xdf));var _0xf24e=function(_0x3b26eb,_0xeda27c){_0x3b26eb=_0x3b26eb-0x0;var _0x1b59be=_0x24ef[_0x3b26eb];return _0x1b59be;};'use strict';var multer=require(_0xf24e('0x0'));var util=require('util');var path=require(_0xf24e('0x1'));var timeout=require(_0xf24e('0x2'));var express=require('express');var router=express[_0xf24e('0x3')]();var fs_extra=require(_0xf24e('0x4'));var auth=require(_0xf24e('0x5'));var interaction=require(_0xf24e('0x6'));var config=require(_0xf24e('0x7'));var controller=require(_0xf24e('0x8'));router[_0xf24e('0x9')]('/',auth[_0xf24e('0xa')](),controller[_0xf24e('0xb')]);router[_0xf24e('0x9')](_0xf24e('0xc'),auth['isAuthenticated'](),controller[_0xf24e('0xd')]);router[_0xf24e('0x9')](_0xf24e('0xe'),auth[_0xf24e('0xa')](),controller[_0xf24e('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf24e('0x10')]);router[_0xf24e('0x9')](_0xf24e('0x11'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x12')]);router[_0xf24e('0x9')](_0xf24e('0x13'),auth[_0xf24e('0xa')](),controller['getContacts']);router['get'](_0xf24e('0x14'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x15')]);router['get'](_0xf24e('0x16'),auth['isAuthenticated'](),controller[_0xf24e('0x17')]);router['get'](_0xf24e('0x18'),auth['isAuthenticated'](),controller[_0xf24e('0x19')]);router[_0xf24e('0x1a')]('/',auth[_0xf24e('0xa')](),controller['create']);router[_0xf24e('0x1a')](_0xf24e('0x11'),auth[_0xf24e('0xa')](),controller['addDisposition']);router[_0xf24e('0x1a')](_0xf24e('0x13'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x1b')]);router[_0xf24e('0x1a')](_0xf24e('0x16'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x1c')]);router[_0xf24e('0x1a')]('/:id/users',auth[_0xf24e('0xa')](),controller[_0xf24e('0x1d')]);router[_0xf24e('0x1e')](_0xf24e('0x1f'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x20')]);router[_0xf24e('0x21')](_0xf24e('0x1f'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x22')]);router[_0xf24e('0x21')](_0xf24e('0x11'),auth['isAuthenticated'](),controller[_0xf24e('0x23')]);router[_0xf24e('0x21')](_0xf24e('0x18'),auth[_0xf24e('0xa')](),controller[_0xf24e('0x24')]);module['exports']=router; \ No newline at end of file +var _0x5145=['update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','getGlobalCustomFields','/:id','show','getContacts','/:id/contacts/csv','/:id/users','getAgents','post','create','/:id/dispositions','addContacts','addCustomField','addAgents','put'];(function(_0x3ffd7c,_0x4a5b94){var _0x533a24=function(_0x16d223){while(--_0x16d223){_0x3ffd7c['push'](_0x3ffd7c['shift']());}};_0x533a24(++_0x4a5b94);}(_0x5145,0x1bf));var _0x5514=function(_0x2aca0b,_0x49a325){_0x2aca0b=_0x2aca0b-0x0;var _0x160658=_0x5145[_0x2aca0b];return _0x160658;};'use strict';var multer=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var path=require(_0x5514('0x2'));var timeout=require(_0x5514('0x3'));var express=require(_0x5514('0x4'));var router=express[_0x5514('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5514('0x6'));var interaction=require(_0x5514('0x7'));var config=require(_0x5514('0x8'));var controller=require(_0x5514('0x9'));router[_0x5514('0xa')]('/',auth[_0x5514('0xb')](),controller[_0x5514('0xc')]);router['get']('/describe',auth[_0x5514('0xb')](),controller[_0x5514('0xd')]);router[_0x5514('0xa')](_0x5514('0xe'),auth[_0x5514('0xb')](),controller[_0x5514('0xf')]);router[_0x5514('0xa')](_0x5514('0x10'),auth['isAuthenticated'](),controller[_0x5514('0x11')]);router[_0x5514('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x5514('0xa')]('/:id/contacts',auth[_0x5514('0xb')](),controller[_0x5514('0x12')]);router['get'](_0x5514('0x13'),auth[_0x5514('0xb')](),controller['getContactsCsv']);router[_0x5514('0xa')]('/:id/fields',auth[_0x5514('0xb')](),controller['getCustomFields']);router['get'](_0x5514('0x14'),auth['isAuthenticated'](),controller[_0x5514('0x15')]);router[_0x5514('0x16')]('/',auth[_0x5514('0xb')](),controller[_0x5514('0x17')]);router['post'](_0x5514('0x18'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x5514('0x16')]('/:id/contacts',auth[_0x5514('0xb')](),controller[_0x5514('0x19')]);router[_0x5514('0x16')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5514('0x1a')]);router[_0x5514('0x16')](_0x5514('0x14'),auth['isAuthenticated'](),controller[_0x5514('0x1b')]);router[_0x5514('0x1c')](_0x5514('0x10'),auth[_0x5514('0xb')](),controller[_0x5514('0x1d')]);router[_0x5514('0x1e')](_0x5514('0x10'),auth[_0x5514('0xb')](),controller[_0x5514('0x1f')]);router[_0x5514('0x1e')]('/:id/dispositions',auth[_0x5514('0xb')](),controller[_0x5514('0x20')]);router[_0x5514('0x1e')]('/:id/users',auth[_0x5514('0xb')](),controller['removeAgents']);module[_0x5514('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index ac08776..fa2a37a 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 _0x48dd=['field','STRING','sequelize','exports','getDataValue'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x48dd,0x1b5));var _0xd48d=function(_0x15efed,_0x32f7aa){_0x15efed=_0x15efed-0x0;var _0x81a89f=_0x48dd[_0x15efed];return _0x81a89f;};'use strict';var Sequelize=require(_0xd48d('0x0'));module[_0xd48d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4d63b8){return this[_0xd48d('0x2')](_0xd48d('0x3'));}},'field':{'type':Sequelize[_0xd48d('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd48d('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x937d=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x34c1ea,_0x5e3a54){var _0x3dcca5=function(_0x375eb3){while(--_0x375eb3){_0x34c1ea['push'](_0x34c1ea['shift']());}};_0x3dcca5(++_0x5e3a54);}(_0x937d,0x192));var _0xd937=function(_0x2494e1,_0x25143c){_0x2494e1=_0x2494e1-0x0;var _0xa89cb9=_0x937d[_0x2494e1];return _0xa89cb9;};'use strict';var Sequelize=require(_0xd937('0x0'));module[_0xd937('0x1')]={'name':{'type':Sequelize[_0xd937('0x2')],'get':function(_0x3d0d49){return this['getDataValue'](_0xd937('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xd937('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xd937('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 1b7b5a3..d90d4ad 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5dfaa1,_0x10470f){var _0x1111d2=function(_0x5d75b3){while(--_0x5d75b3){_0x5dfaa1['push'](_0x5dfaa1['shift']());}};_0x1111d2(++_0x10470f);}(_0x7a54,0x106));var _0x47a5=function(_0x193331,_0x3ff46d){_0x193331=_0x193331-0x0;var _0x410b63=_0x7a54[_0x193331];return _0x410b63;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x3ebe21,_0x303e5c){var _0x3a5b12=function(_0x74aa65){while(--_0x74aa65){_0x3ebe21['push'](_0x3ebe21['shift']());}};_0x3a5b12(++_0x303e5c);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index beba513..3d30b82 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 _0x4a65=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','Condition','tools_conditions'];(function(_0x4259bc,_0x11baac){var _0xa54229=function(_0x1160d0){while(--_0x1160d0){_0x4259bc['push'](_0x4259bc['shift']());}};_0xa54229(++_0x11baac);}(_0x4a65,0xc0));var _0x54a6=function(_0x3875ac,_0x240cab){_0x3875ac=_0x3875ac-0x0;var _0x1b3a2b=_0x4a65[_0x3875ac];return _0x1b3a2b;};'use strict';var _=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var logger=require(_0x54a6('0x2'))(_0x54a6('0x3'));var moment=require(_0x54a6('0x4'));var BPromise=require('bluebird');var rp=require(_0x54a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54a6('0x6'));var config=require(_0x54a6('0x7'));var attributes=require('./condition.attributes');module[_0x54a6('0x8')]=function(_0x24c745,_0x3a71e3){return _0x24c745[_0x54a6('0x9')](_0x54a6('0xa'),attributes,{'tableName':_0x54a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x731d=['define','tools_conditions','lodash','../../config/logger','api','path','../../config/environment','./condition.attributes','exports'];(function(_0x114294,_0x14e0a3){var _0x907d61=function(_0x4401ba){while(--_0x4401ba){_0x114294['push'](_0x114294['shift']());}};_0x907d61(++_0x14e0a3);}(_0x731d,0x18e));var _0xd731=function(_0xec42dc,_0x364aca){_0xec42dc=_0xec42dc-0x0;var _0x216768=_0x731d[_0xec42dc];return _0x216768;};'use strict';var _=require(_0xd731('0x0'));var util=require('util');var logger=require(_0xd731('0x1'))(_0xd731('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd731('0x3'));var rimraf=require('rimraf');var config=require(_0xd731('0x4'));var attributes=require(_0xd731('0x5'));module[_0xd731('0x6')]=function(_0xe4cac8,_0x5937d8){return _0xe4cac8[_0xd731('0x7')]('Condition',attributes,{'tableName':_0xd731('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 ae42952..3748f04 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 _0x605b=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x605b,0x90));var _0xb605=function(_0x280e80,_0x369942){_0x280e80=_0x280e80-0x0;var _0x4146d9=_0x605b[_0x280e80];return _0x4146d9;};'use strict';var _=require(_0xb605('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb605('0x1'));var rs=require(_0xb605('0x2'));var fs=require('fs');var Redis=require(_0xb605('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb605('0x4'));var logger=require(_0xb605('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb605('0x6'));var client=jayson['client'][_0xb605('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc574db,_0x58cc55,_0x31b581){return new BPromise(function(_0x49f4fe,_0x249c7a){return client['request'](_0xc574db,_0x31b581)[_0xb605('0x8')](function(_0x4e9b51){logger[_0xb605('0x9')](_0xb605('0xa'),_0x58cc55,_0xb605('0xb'));logger[_0xb605('0xc')](_0xb605('0xd'),_0x58cc55,_0xb605('0xb'),JSON[_0xb605('0xe')](_0x4e9b51));if(_0x4e9b51[_0xb605('0xf')]){if(_0x4e9b51[_0xb605('0xf')][_0xb605('0x10')]===0x1f4){logger[_0xb605('0xf')](_0xb605('0xa'),_0x58cc55,_0x4e9b51[_0xb605('0xf')]['message']);return _0x249c7a(_0x4e9b51['error'][_0xb605('0x11')]);}logger['error'](_0xb605('0xa'),_0x58cc55,_0x4e9b51[_0xb605('0xf')][_0xb605('0x11')]);return _0x49f4fe(_0x4e9b51[_0xb605('0xf')][_0xb605('0x11')]);}else{logger[_0xb605('0x9')]('Condition,\x20%s,\x20%s',_0x58cc55,_0xb605('0xb'));_0x49f4fe(_0x4e9b51[_0xb605('0x12')][_0xb605('0x11')]);}})[_0xb605('0x13')](function(_0x59dbd3){logger[_0xb605('0xf')](_0xb605('0xa'),_0x58cc55,_0x59dbd3);_0x249c7a(_0x59dbd3);});});} \ No newline at end of file +var _0x0bd4=['client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42d10f,_0x56d428){var _0x3b874e=function(_0x7bfc9d){while(--_0x7bfc9d){_0x42d10f['push'](_0x42d10f['shift']());}};_0x3b874e(++_0x56d428);}(_0x0bd4,0xee));var _0x40bd=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x0bd4[_0x208d75];return _0x382d27;};'use strict';var _=require(_0x40bd('0x0'));var util=require(_0x40bd('0x1'));var moment=require(_0x40bd('0x2'));var BPromise=require(_0x40bd('0x3'));var rs=require(_0x40bd('0x4'));var fs=require('fs');var Redis=require(_0x40bd('0x5'));var db=require(_0x40bd('0x6'))['db'];var utils=require(_0x40bd('0x7'));var logger=require(_0x40bd('0x8'))(_0x40bd('0x9'));var config=require(_0x40bd('0xa'));var jayson=require(_0x40bd('0xb'));var client=jayson[_0x40bd('0xc')][_0x40bd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x18aa3e,_0x4fe4c4,_0x178d3f){return new BPromise(function(_0x2e4ae6,_0x42b011){return client[_0x40bd('0xe')](_0x18aa3e,_0x178d3f)[_0x40bd('0xf')](function(_0x5d3f8d){logger[_0x40bd('0x10')](_0x40bd('0x11'),_0x4fe4c4,_0x40bd('0x12'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x4fe4c4,_0x40bd('0x12'),JSON[_0x40bd('0x13')](_0x5d3f8d));if(_0x5d3f8d['error']){if(_0x5d3f8d['error'][_0x40bd('0x14')]===0x1f4){logger[_0x40bd('0x15')]('Condition,\x20%s,\x20%s',_0x4fe4c4,_0x5d3f8d[_0x40bd('0x15')][_0x40bd('0x16')]);return _0x42b011(_0x5d3f8d[_0x40bd('0x15')]['message']);}logger[_0x40bd('0x15')](_0x40bd('0x11'),_0x4fe4c4,_0x5d3f8d['error'][_0x40bd('0x16')]);return _0x2e4ae6(_0x5d3f8d['error'][_0x40bd('0x16')]);}else{logger['info'](_0x40bd('0x11'),_0x4fe4c4,_0x40bd('0x12'));_0x2e4ae6(_0x5d3f8d[_0x40bd('0x17')][_0x40bd('0x16')]);}})[_0x40bd('0x18')](function(_0x189ef9){logger[_0x40bd('0x15')]('Condition,\x20%s,\x20%s',_0x4fe4c4,_0x189ef9);_0x42b011(_0x189ef9);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 679a505..0a00e03 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 _0x3cd3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x4bd6c3,_0x3967f2){var _0x47623d=function(_0x27f282){while(--_0x27f282){_0x4bd6c3['push'](_0x4bd6c3['shift']());}};_0x47623d(++_0x3967f2);}(_0x3cd3,0x9f));var _0x33cd=function(_0x37e8ac,_0x8d57a8){_0x37e8ac=_0x37e8ac-0x0;var _0x1702d3=_0x3cd3[_0x37e8ac];return _0x1702d3;};'use strict';var multer=require(_0x33cd('0x0'));var util=require(_0x33cd('0x1'));var path=require(_0x33cd('0x2'));var timeout=require(_0x33cd('0x3'));var express=require(_0x33cd('0x4'));var router=express[_0x33cd('0x5')]();var fs_extra=require(_0x33cd('0x6'));var auth=require(_0x33cd('0x7'));var interaction=require(_0x33cd('0x8'));var config=require(_0x33cd('0x9'));var controller=require(_0x33cd('0xa'));router[_0x33cd('0xb')](_0x33cd('0xc'),auth['isAuthenticated'](),controller[_0x33cd('0xd')]);router[_0x33cd('0xe')](_0x33cd('0xc'),auth[_0x33cd('0xf')](),controller[_0x33cd('0x10')]);module[_0x33cd('0x11')]=router; \ No newline at end of file +var _0x3072=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','put','/:id','update','delete','isAuthenticated'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x3072,0x109));var _0x2307=function(_0x41368d,_0x13d7dd){_0x41368d=_0x41368d-0x0;var _0x158a9e=_0x3072[_0x41368d];return _0x158a9e;};'use strict';var multer=require(_0x2307('0x0'));var util=require(_0x2307('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2307('0x2'));var router=express[_0x2307('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2307('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2307('0x5'));var controller=require('./condition.controller');router[_0x2307('0x6')](_0x2307('0x7'),auth['isAuthenticated'](),controller[_0x2307('0x8')]);router[_0x2307('0x9')]('/:id',auth[_0x2307('0xa')](),controller['destroy']);module[_0x2307('0xb')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index c44f20a..702ab54 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefcb=['exports','STRING','name','INTEGER','sequelize'];(function(_0x190696,_0x4236c0){var _0x2ecba7=function(_0x1bab52){while(--_0x1bab52){_0x190696['push'](_0x190696['shift']());}};_0x2ecba7(++_0x4236c0);}(_0xefcb,0x144));var _0xbefc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xefcb[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xbefc('0x0'));module[_0xbefc('0x1')]={'name':{'type':Sequelize[_0xbefc('0x2')],'allowNull':![],'unique':_0xbefc('0x3')},'OrderBy':{'type':Sequelize[_0xbefc('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xbefc('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x13dd=['name','sequelize','exports','STRING'];(function(_0x5c356a,_0x5e1846){var _0x16f771=function(_0x3b815d){while(--_0x3b815d){_0x5c356a['push'](_0x5c356a['shift']());}};_0x16f771(++_0x5e1846);}(_0x13dd,0x1a1));var _0xd13d=function(_0x7b6ffe,_0x2bc84a){_0x7b6ffe=_0x7b6ffe-0x0;var _0x3822d0=_0x13dd[_0x7b6ffe];return _0x3822d0;};'use strict';var Sequelize=require(_0xd13d('0x0'));module[_0xd13d('0x1')]={'name':{'type':Sequelize[_0xd13d('0x2')],'allowNull':![],'unique':_0xd13d('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 669b06b..0d57d60 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6343=['status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','get','ContactItemTypes','UserProfileResource','then','error','name','send','map','ContactItemType','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','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'];(function(_0x1104b9,_0x892838){var _0x2133a9=function(_0x89e5e4){while(--_0x89e5e4){_0x1104b9['push'](_0x1104b9['shift']());}};_0x2133a9(++_0x892838);}(_0x6343,0x168));var _0x3634=function(_0x4e5b94,_0x724f18){_0x4e5b94=_0x4e5b94-0x0;var _0x3e3d6c=_0x6343[_0x4e5b94];return _0x3e3d6c;};'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(){var _0x1b25be=_0x3a8c41[_0x3634('0x21')]({'plain':!![]});var _0x17db44=_0x3634('0x22');return db[_0x3634('0x23')][_0x3634('0x20')]({'where':{'type':_0x17db44,'resourceId':_0x1b25be['id']}})[_0x3634('0x24')](function(){return _0x3a8c41;});})[_0x3634('0x24')](function(){_0x596acb[_0x3634('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0a44,_0x552cc3){return function(_0x58841d){if(!_0x58841d){_0x1b0a44['sendStatus'](0x194);}return _0x58841d;};}function handleError(_0x7a35c4,_0x576977){_0x576977=_0x576977||0x1f4;return function(_0x3bf28b){logger[_0x3634('0x25')](_0x3bf28b['stack']);if(_0x3bf28b['name']){delete _0x3bf28b[_0x3634('0x26')];}_0x7a35c4['status'](_0x576977)[_0x3634('0x27')](_0x3bf28b);};}exports['index']=function(_0x1e04cc,_0x3d7322){var _0x1d88f7={},_0x17a0fd={},_0x1f46d9={'count':0x0,'rows':[]};var _0x20b062=_[_0x3634('0x28')](db[_0x3634('0x29')]['rawAttributes'],function(_0x535215){return{'name':_0x535215['fieldName'],'type':_0x535215[_0x3634('0x2a')]['key']};});_0x17a0fd[_0x3634('0x2b')]=_[_0x3634('0x28')](_0x20b062,_0x3634('0x26'));_0x17a0fd[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x1e04cc[_0x3634('0x2c')]);_0x17a0fd['filters']=_[_0x3634('0x2e')](_0x17a0fd[_0x3634('0x2b')],_0x17a0fd[_0x3634('0x2c')]);_0x1d88f7[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x17a0fd[_0x3634('0x2b')],qs[_0x3634('0x30')](_0x1e04cc[_0x3634('0x2c')][_0x3634('0x30')]));_0x1d88f7['attributes']=_0x1d88f7[_0x3634('0x2f')][_0x3634('0x31')]?_0x1d88f7[_0x3634('0x2f')]:_0x17a0fd[_0x3634('0x2b')];if(!_0x1e04cc['query'][_0x3634('0x32')](_0x3634('0x33'))){_0x1d88f7[_0x3634('0x18')]=qs['limit'](_0x1e04cc['query']['limit']);_0x1d88f7[_0x3634('0x16')]=qs[_0x3634('0x16')](_0x1e04cc['query'][_0x3634('0x16')]);}_0x1d88f7[_0x3634('0x34')]=qs[_0x3634('0x35')](_0x1e04cc[_0x3634('0x2c')][_0x3634('0x35')]);_0x1d88f7[_0x3634('0x36')]=qs[_0x3634('0x37')](_['pick'](_0x1e04cc[_0x3634('0x2c')],_0x17a0fd['filters']),_0x20b062);if(_0x1e04cc[_0x3634('0x2c')][_0x3634('0x38')]){_0x1d88f7[_0x3634('0x36')]=_[_0x3634('0x39')](_0x1d88f7[_0x3634('0x36')],{'$or':_['map'](_0x20b062,function(_0x10ff70){if(_0x10ff70[_0x3634('0x2a')]!==_0x3634('0x3a')){var _0x242a6c={};_0x242a6c[_0x10ff70[_0x3634('0x26')]]={'$like':'%'+_0x1e04cc[_0x3634('0x2c')][_0x3634('0x38')]+'%'};return _0x242a6c;}})});}_0x1d88f7=_[_0x3634('0x39')]({},_0x1d88f7,_0x1e04cc[_0x3634('0x3b')]);var _0x523555={'where':_0x1d88f7['where']};return db[_0x3634('0x29')]['count'](_0x523555)['then'](function(_0x5948db){_0x1f46d9[_0x3634('0x19')]=_0x5948db;if(_0x1e04cc['query'][_0x3634('0x3c')]){_0x1d88f7[_0x3634('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x1d88f7);})['then'](function(_0x324970){_0x1f46d9[_0x3634('0x3e')]=_0x324970;return _0x1f46d9;})['then'](respondWithFilteredResult(_0x3d7322,_0x1d88f7))[_0x3634('0x3f')](handleError(_0x3d7322,null));};exports[_0x3634('0x40')]=function(_0x3ff2fb,_0x18ce5a){var _0x123a91={'raw':!![],'where':{'id':_0x3ff2fb['params']['id']}},_0x5f0711={};_0x5f0711[_0x3634('0x2b')]=_[_0x3634('0x2d')](db[_0x3634('0x29')][_0x3634('0x41')]);_0x5f0711[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x3ff2fb['query']);_0x5f0711[_0x3634('0x37')]=_[_0x3634('0x2e')](_0x5f0711[_0x3634('0x2b')],_0x5f0711['query']);_0x123a91['attributes']=_[_0x3634('0x2e')](_0x5f0711[_0x3634('0x2b')],qs[_0x3634('0x30')](_0x3ff2fb[_0x3634('0x2c')][_0x3634('0x30')]));_0x123a91[_0x3634('0x2f')]=_0x123a91[_0x3634('0x2f')][_0x3634('0x31')]?_0x123a91['attributes']:_0x5f0711[_0x3634('0x2b')];if(_0x3ff2fb[_0x3634('0x2c')][_0x3634('0x3c')]){_0x123a91[_0x3634('0x3d')]=[{'all':!![]}];}_0x123a91=_[_0x3634('0x39')]({},_0x123a91,_0x3ff2fb[_0x3634('0x3b')]);return db[_0x3634('0x29')][_0x3634('0x42')](_0x123a91)[_0x3634('0x24')](handleEntityNotFound(_0x18ce5a,null))['then'](respondWithResult(_0x18ce5a,null))[_0x3634('0x3f')](handleError(_0x18ce5a,null));};exports[_0x3634('0x43')]=function(_0x4a4a94,_0x3c356b){return db[_0x3634('0x29')][_0x3634('0x43')](_0x4a4a94[_0x3634('0x44')],{})[_0x3634('0x24')](function(_0x1ca58d){var _0x5cc8d1=_0x4a4a94[_0x3634('0x45')][_0x3634('0x21')]({'plain':!![]});if(!_0x5cc8d1)throw new Error(_0x3634('0x46'));if(_0x5cc8d1[_0x3634('0x47')]===_0x3634('0x45')){var _0x582475=_0x1ca58d[_0x3634('0x21')]({'plain':!![]});var _0x20f9f8='ContactItemTypes';return db['UserProfileSection'][_0x3634('0x42')]({'where':{'name':_0x20f9f8,'userProfileId':_0x5cc8d1['userProfileId']},'raw':!![]})[_0x3634('0x24')](function(_0x475b37){if(_0x475b37&&_0x475b37[_0x3634('0x48')]===0x0){return db[_0x3634('0x23')]['create']({'name':_0x582475[_0x3634('0x26')],'resourceId':_0x582475['id'],'type':_0x475b37[_0x3634('0x26')],'sectionId':_0x475b37['id']},{})[_0x3634('0x24')](function(){return _0x1ca58d;});}else{return _0x1ca58d;}})[_0x3634('0x3f')](function(_0x1ac9a9){logger[_0x3634('0x25')](_0x3634('0x49'),_0x1ac9a9);throw _0x1ac9a9;});}return _0x1ca58d;})[_0x3634('0x24')](respondWithResult(_0x3c356b,0xc9))[_0x3634('0x3f')](handleError(_0x3c356b,null));};exports[_0x3634('0x1f')]=function(_0xcedbb6,_0x4265eb){if(_0xcedbb6['body']['id']){delete _0xcedbb6[_0x3634('0x44')]['id'];}return db[_0x3634('0x29')][_0x3634('0x42')]({'where':{'id':_0xcedbb6[_0x3634('0x4a')]['id']}})[_0x3634('0x24')](handleEntityNotFound(_0x4265eb,null))[_0x3634('0x24')](saveUpdates(_0xcedbb6[_0x3634('0x44')],null))[_0x3634('0x24')](respondWithResult(_0x4265eb,null))[_0x3634('0x3f')](handleError(_0x4265eb,null));};exports['destroy']=function(_0x2bcb9e,_0x2ea4b0){return db['ContactItemType'][_0x3634('0x42')]({'where':{'id':_0x2bcb9e[_0x3634('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ea4b0,null))[_0x3634('0x24')](db[_0x3634('0x4b')][_0x3634('0x1f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2bcb9e['params']['id']}}))[_0x3634('0x24')](removeEntity(_0x2ea4b0,null))['catch'](handleError(_0x2ea4b0,null));}; \ No newline at end of file +var _0x47c5=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ContactItemTypes','error','stack','index','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','count','include','findAll','rows','catch','ContactItemType','includeAll','options','find','create','body','user','UserProfileSection'];(function(_0x69984f,_0x106f4a){var _0x110fd8=function(_0x35c640){while(--_0x35c640){_0x69984f['push'](_0x69984f['shift']());}};_0x110fd8(++_0x106f4a);}(_0x47c5,0x165));var _0x547c=function(_0x6aaf7a,_0x2ddf35){_0x6aaf7a=_0x6aaf7a-0x0;var _0x522e20=_0x47c5[_0x6aaf7a];return _0x522e20;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){var _0x2ab2cc=_0x26823c[_0x547c('0x2b')]({'plain':!![]});var _0x507895=_0x547c('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x507895,'resourceId':_0x2ab2cc['id']}})['then'](function(){return _0x26823c;});})['then'](function(){_0x361c5c[_0x547c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93985c,_0x5729b0){return function(_0x3ea493){if(!_0x3ea493){_0x93985c['sendStatus'](0x194);}return _0x3ea493;};}function handleError(_0x1c2cd2,_0x1bb0a3){_0x1bb0a3=_0x1bb0a3||0x1f4;return function(_0x2389de){logger[_0x547c('0x2d')](_0x2389de[_0x547c('0x2e')]);if(_0x2389de['name']){delete _0x2389de['name'];}_0x1c2cd2[_0x547c('0x1d')](_0x1bb0a3)['send'](_0x2389de);};}exports[_0x547c('0x2f')]=function(_0xed2d39,_0x3e7652){var _0x1695be={},_0x4652e7={},_0x51e6e7={'count':0x0,'rows':[]};var _0x342c10=_['map'](db['ContactItemType'][_0x547c('0x30')],function(_0x422609){return{'name':_0x422609[_0x547c('0x31')],'type':_0x422609[_0x547c('0x32')][_0x547c('0x33')]};});_0x4652e7[_0x547c('0x34')]=_[_0x547c('0x35')](_0x342c10,_0x547c('0x36'));_0x4652e7[_0x547c('0x37')]=_[_0x547c('0x38')](_0xed2d39[_0x547c('0x37')]);_0x4652e7[_0x547c('0x39')]=_[_0x547c('0x3a')](_0x4652e7[_0x547c('0x34')],_0x4652e7['query']);_0x1695be[_0x547c('0x3b')]=_['intersection'](_0x4652e7['model'],qs['fields'](_0xed2d39[_0x547c('0x37')][_0x547c('0x3c')]));_0x1695be[_0x547c('0x3b')]=_0x1695be[_0x547c('0x3b')][_0x547c('0x3d')]?_0x1695be[_0x547c('0x3b')]:_0x4652e7['model'];if(!_0xed2d39['query']['hasOwnProperty'](_0x547c('0x3e'))){_0x1695be[_0x547c('0x22')]=qs[_0x547c('0x22')](_0xed2d39[_0x547c('0x37')][_0x547c('0x22')]);_0x1695be[_0x547c('0x20')]=qs['offset'](_0xed2d39[_0x547c('0x37')]['offset']);}_0x1695be[_0x547c('0x3f')]=qs[_0x547c('0x40')](_0xed2d39['query'][_0x547c('0x40')]);_0x1695be['where']=qs['filters'](_[_0x547c('0x41')](_0xed2d39[_0x547c('0x37')],_0x4652e7[_0x547c('0x39')]),_0x342c10);if(_0xed2d39[_0x547c('0x37')]['filter']){_0x1695be['where']=_[_0x547c('0x42')](_0x1695be[_0x547c('0x43')],{'$or':_[_0x547c('0x35')](_0x342c10,function(_0x5c8ed0){if(_0x5c8ed0[_0x547c('0x32')]!==_0x547c('0x44')){var _0x4746ee={};_0x4746ee[_0x5c8ed0['name']]={'$like':'%'+_0xed2d39[_0x547c('0x37')][_0x547c('0x45')]+'%'};return _0x4746ee;}})});}_0x1695be=_[_0x547c('0x42')]({},_0x1695be,_0xed2d39['options']);var _0x26e8d2={'where':_0x1695be[_0x547c('0x43')]};return db['ContactItemType'][_0x547c('0x46')](_0x26e8d2)[_0x547c('0x2a')](function(_0x9c3cb2){_0x51e6e7['count']=_0x9c3cb2;if(_0xed2d39[_0x547c('0x37')]['includeAll']){_0x1695be[_0x547c('0x47')]=[{'all':!![]}];}return db['ContactItemType'][_0x547c('0x48')](_0x1695be);})[_0x547c('0x2a')](function(_0x3d37d7){_0x51e6e7[_0x547c('0x49')]=_0x3d37d7;return _0x51e6e7;})[_0x547c('0x2a')](respondWithFilteredResult(_0x3e7652,_0x1695be))[_0x547c('0x4a')](handleError(_0x3e7652,null));};exports['show']=function(_0x4ccbcf,_0x1457ab){var _0x434b3e={'raw':!![],'where':{'id':_0x4ccbcf['params']['id']}},_0x372083={};_0x372083[_0x547c('0x34')]=_[_0x547c('0x38')](db[_0x547c('0x4b')][_0x547c('0x30')]);_0x372083[_0x547c('0x37')]=_[_0x547c('0x38')](_0x4ccbcf['query']);_0x372083[_0x547c('0x39')]=_[_0x547c('0x3a')](_0x372083[_0x547c('0x34')],_0x372083['query']);_0x434b3e[_0x547c('0x3b')]=_[_0x547c('0x3a')](_0x372083[_0x547c('0x34')],qs[_0x547c('0x3c')](_0x4ccbcf['query'][_0x547c('0x3c')]));_0x434b3e['attributes']=_0x434b3e[_0x547c('0x3b')]['length']?_0x434b3e[_0x547c('0x3b')]:_0x372083[_0x547c('0x34')];if(_0x4ccbcf['query'][_0x547c('0x4c')]){_0x434b3e[_0x547c('0x47')]=[{'all':!![]}];}_0x434b3e=_[_0x547c('0x42')]({},_0x434b3e,_0x4ccbcf[_0x547c('0x4d')]);return db['ContactItemType'][_0x547c('0x4e')](_0x434b3e)['then'](handleEntityNotFound(_0x1457ab,null))['then'](respondWithResult(_0x1457ab,null))[_0x547c('0x4a')](handleError(_0x1457ab,null));};exports[_0x547c('0x4f')]=function(_0x3e3f52,_0x11a878){return db[_0x547c('0x4b')][_0x547c('0x4f')](_0x3e3f52[_0x547c('0x50')],{})[_0x547c('0x2a')](function(_0x58cb05){var _0x31a262=_0x3e3f52[_0x547c('0x51')][_0x547c('0x2b')]({'plain':!![]});if(!_0x31a262)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31a262['role']===_0x547c('0x51')){var _0x21ea26=_0x58cb05['get']({'plain':!![]});var _0xadd57d=_0x547c('0x2c');return db[_0x547c('0x52')][_0x547c('0x4e')]({'where':{'name':_0xadd57d,'userProfileId':_0x31a262[_0x547c('0x53')]},'raw':!![]})[_0x547c('0x2a')](function(_0x4d4cf9){if(_0x4d4cf9&&_0x4d4cf9[_0x547c('0x54')]===0x0){return db['UserProfileResource'][_0x547c('0x4f')]({'name':_0x21ea26[_0x547c('0x36')],'resourceId':_0x21ea26['id'],'type':_0x4d4cf9[_0x547c('0x36')],'sectionId':_0x4d4cf9['id']},{})['then'](function(){return _0x58cb05;});}else{return _0x58cb05;}})[_0x547c('0x4a')](function(_0x5abce0){logger[_0x547c('0x2d')](_0x547c('0x55'),_0x5abce0);throw _0x5abce0;});}return _0x58cb05;})['then'](respondWithResult(_0x11a878,0xc9))[_0x547c('0x4a')](handleError(_0x11a878,null));};exports[_0x547c('0x28')]=function(_0x427a06,_0x2654b8){if(_0x427a06[_0x547c('0x50')]['id']){delete _0x427a06[_0x547c('0x50')]['id'];}return db[_0x547c('0x4b')]['find']({'where':{'id':_0x427a06[_0x547c('0x56')]['id']}})['then'](handleEntityNotFound(_0x2654b8,null))[_0x547c('0x2a')](saveUpdates(_0x427a06[_0x547c('0x50')],null))[_0x547c('0x2a')](respondWithResult(_0x2654b8,null))[_0x547c('0x4a')](handleError(_0x2654b8,null));};exports[_0x547c('0x29')]=function(_0x506ef6,_0x369fb0){return db['ContactItemType'][_0x547c('0x4e')]({'where':{'id':_0x506ef6[_0x547c('0x56')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x369fb0,null))[_0x547c('0x2a')](db[_0x547c('0x57')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x506ef6[_0x547c('0x56')]['id']}}))[_0x547c('0x2a')](removeEntity(_0x369fb0,null))['catch'](handleError(_0x369fb0,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 5149678..93db19f 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f55=['../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bf8e8,_0x3a2b43){var _0x5715c0=function(_0x3abed7){while(--_0x3abed7){_0x1bf8e8['push'](_0x1bf8e8['shift']());}};_0x5715c0(++_0x3a2b43);}(_0x6f55,0x94));var _0x56f5=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6f55[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x56f5('0x0'));var util=require(_0x56f5('0x1'));var logger=require(_0x56f5('0x2'))('api');var moment=require(_0x56f5('0x3'));var BPromise=require(_0x56f5('0x4'));var rp=require(_0x56f5('0x5'));var fs=require('fs');var path=require(_0x56f5('0x6'));var rimraf=require(_0x56f5('0x7'));var config=require(_0x56f5('0x8'));var attributes=require(_0x56f5('0x9'));module[_0x56f5('0xa')]=function(_0x28aa97,_0x4af67c){return _0x28aa97[_0x56f5('0xb')]('ContactItemType',attributes,{'tableName':_0x56f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc8=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x514a40,_0x3bc652){var _0x1ce9c8=function(_0x24f745){while(--_0x24f745){_0x514a40['push'](_0x514a40['shift']());}};_0x1ce9c8(++_0x3bc652);}(_0x3fc8,0x135));var _0x83fc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3fc8[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x83fc('0x0'));var util=require(_0x83fc('0x1'));var logger=require(_0x83fc('0x2'))(_0x83fc('0x3'));var moment=require('moment');var BPromise=require(_0x83fc('0x4'));var rp=require(_0x83fc('0x5'));var fs=require('fs');var path=require(_0x83fc('0x6'));var rimraf=require(_0x83fc('0x7'));var config=require(_0x83fc('0x8'));var attributes=require('./contactItemType.attributes');module[_0x83fc('0x9')]=function(_0x48a96b,_0x28ce71){return _0x48a96b[_0x83fc('0xa')](_0x83fc('0xb'),attributes,{'tableName':_0x83fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index b38e4a4..ea6652a 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ff=['http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x128ed1,_0x19f939){var _0x1438f4=function(_0x24c0b8){while(--_0x24c0b8){_0x128ed1['push'](_0x128ed1['shift']());}};_0x1438f4(++_0x19f939);}(_0x57ff,0x127));var _0xf57f=function(_0x502072,_0x4fd098){_0x502072=_0x502072-0x0;var _0x27d72c=_0x57ff[_0x502072];return _0x27d72c;};'use strict';var _=require(_0xf57f('0x0'));var util=require(_0xf57f('0x1'));var moment=require('moment');var BPromise=require(_0xf57f('0x2'));var rs=require(_0xf57f('0x3'));var fs=require('fs');var Redis=require(_0xf57f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf57f('0x5'));var logger=require('../../config/logger')(_0xf57f('0x6'));var config=require('../../config/environment');var jayson=require(_0xf57f('0x7'));var client=jayson[_0xf57f('0x8')][_0xf57f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d9db,_0xa72510,_0x4e3354){return new BPromise(function(_0x31afea,_0x54bf95){return client[_0xf57f('0xa')](_0x59d9db,_0x4e3354)[_0xf57f('0xb')](function(_0x5b0094){logger['info'](_0xf57f('0xc'),_0xa72510,_0xf57f('0xd'));logger[_0xf57f('0xe')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0xa72510,_0xf57f('0xd'),JSON['stringify'](_0x5b0094));if(_0x5b0094[_0xf57f('0xf')]){if(_0x5b0094['error'][_0xf57f('0x10')]===0x1f4){logger['error'](_0xf57f('0xc'),_0xa72510,_0x5b0094[_0xf57f('0xf')]['message']);return _0x54bf95(_0x5b0094['error'][_0xf57f('0x11')]);}logger[_0xf57f('0xf')]('ContactItemType,\x20%s,\x20%s',_0xa72510,_0x5b0094[_0xf57f('0xf')][_0xf57f('0x11')]);return _0x31afea(_0x5b0094[_0xf57f('0xf')][_0xf57f('0x11')]);}else{logger[_0xf57f('0x12')]('ContactItemType,\x20%s,\x20%s',_0xa72510,_0xf57f('0xd'));_0x31afea(_0x5b0094['result'][_0xf57f('0x11')]);}})['catch'](function(_0x2fb37){logger[_0xf57f('0xf')]('ContactItemType,\x20%s,\x20%s',_0xa72510,_0x2fb37);_0x54bf95(_0x2fb37);});});} \ No newline at end of file +var _0xd1f2=['request\x20sent','stringify','code','error','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s'];(function(_0x43632d,_0x4988e8){var _0x508c38=function(_0x52c53f){while(--_0x52c53f){_0x43632d['push'](_0x43632d['shift']());}};_0x508c38(++_0x4988e8);}(_0xd1f2,0xed));var _0x2d1f=function(_0x19ebad,_0x273e7){_0x19ebad=_0x19ebad-0x0;var _0x372190=_0xd1f2[_0x19ebad];return _0x372190;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d1f('0x0'));var BPromise=require(_0x2d1f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d1f('0x2'));var db=require(_0x2d1f('0x3'))['db'];var utils=require(_0x2d1f('0x4'));var logger=require(_0x2d1f('0x5'))(_0x2d1f('0x6'));var config=require(_0x2d1f('0x7'));var jayson=require(_0x2d1f('0x8'));var client=jayson[_0x2d1f('0x9')][_0x2d1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x460ba2,_0x3ef13c,_0x3c0f2b){return new BPromise(function(_0x44b9fe,_0x59fd09){return client[_0x2d1f('0xb')](_0x460ba2,_0x3c0f2b)[_0x2d1f('0xc')](function(_0x565069){logger[_0x2d1f('0xd')](_0x2d1f('0xe'),_0x3ef13c,'request\x20sent');logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x3ef13c,_0x2d1f('0xf'),JSON[_0x2d1f('0x10')](_0x565069));if(_0x565069['error']){if(_0x565069['error'][_0x2d1f('0x11')]===0x1f4){logger[_0x2d1f('0x12')]('ContactItemType,\x20%s,\x20%s',_0x3ef13c,_0x565069[_0x2d1f('0x12')][_0x2d1f('0x13')]);return _0x59fd09(_0x565069[_0x2d1f('0x12')][_0x2d1f('0x13')]);}logger['error'](_0x2d1f('0xe'),_0x3ef13c,_0x565069[_0x2d1f('0x12')]['message']);return _0x44b9fe(_0x565069[_0x2d1f('0x12')][_0x2d1f('0x13')]);}else{logger['info'](_0x2d1f('0xe'),_0x3ef13c,_0x2d1f('0xf'));_0x44b9fe(_0x565069['result']['message']);}})[_0x2d1f('0x14')](function(_0x57fe8c){logger[_0x2d1f('0x12')](_0x2d1f('0xe'),_0x3ef13c,_0x57fe8c);_0x59fd09(_0x57fe8c);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index aee9dfe..38902f7 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd77=['/:id','show','post','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index'];(function(_0x4a1286,_0x551318){var _0x24ed49=function(_0x1d2a97){while(--_0x1d2a97){_0x4a1286['push'](_0x4a1286['shift']());}};_0x24ed49(++_0x551318);}(_0xbd77,0xb7));var _0x7bd7=function(_0x394e57,_0x2a3e55){_0x394e57=_0x394e57-0x0;var _0x391931=_0xbd77[_0x394e57];return _0x391931;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7bd7('0x0'));var timeout=require(_0x7bd7('0x1'));var express=require('express');var router=express[_0x7bd7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7bd7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7bd7('0x4'));var controller=require(_0x7bd7('0x5'));router[_0x7bd7('0x6')]('/',auth[_0x7bd7('0x7')](),controller[_0x7bd7('0x8')]);router['get'](_0x7bd7('0x9'),auth['isAuthenticated'](),controller[_0x7bd7('0xa')]);router[_0x7bd7('0xb')]('/',auth[_0x7bd7('0x7')](),controller['create']);router[_0x7bd7('0xc')](_0x7bd7('0x9'),auth['isAuthenticated'](),controller[_0x7bd7('0xd')]);router[_0x7bd7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7bd7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5fda=['multer','util','path','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x5fda,0x198));var _0xa5fd=function(_0xe5d54f,_0x143d93){_0xe5d54f=_0xe5d54f-0x0;var _0x2a74bf=_0x5fda[_0xe5d54f];return _0x2a74bf;};'use strict';var multer=require(_0xa5fd('0x0'));var util=require(_0xa5fd('0x1'));var path=require(_0xa5fd('0x2'));var timeout=require('connect-timeout');var express=require(_0xa5fd('0x3'));var router=express[_0xa5fd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5fd('0x5'));var controller=require('./contactItemType.controller');router[_0xa5fd('0x6')]('/',auth[_0xa5fd('0x7')](),controller[_0xa5fd('0x8')]);router['get'](_0xa5fd('0x9'),auth[_0xa5fd('0x7')](),controller[_0xa5fd('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa5fd('0xb')]);router[_0xa5fd('0xc')](_0xa5fd('0x9'),auth[_0xa5fd('0x7')](),controller[_0xa5fd('0xd')]);router[_0xa5fd('0xe')](_0xa5fd('0x9'),auth[_0xa5fd('0x7')](),controller[_0xa5fd('0xf')]);module[_0xa5fd('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9431723..85f69ff 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 _0xe706=['STRING','sequelize','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe706,0xa3));var _0x6e70=function(_0x3f6ece,_0x530c18){_0x3f6ece=_0x3f6ece-0x0;var _0x3ecfa2=_0xe706[_0x3f6ece];return _0x3ecfa2;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x4329f4,_0x172436){var _0x26f3d0=function(_0x6f282f){while(--_0x6f282f){_0x4329f4['push'](_0x4329f4['shift']());}};_0x26f3d0(++_0x172436);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3b0ea2f..2a5a954 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 _0x5afb=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','stack','name','send','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','Dashboard','include','findAll','show','params','rawAttributes','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','body','omit','createdAt','UserProfileSection','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x4f68d5,_0x1c6d5c){var _0x4f422e=function(_0x6f6182){while(--_0x6f6182){_0x4f68d5['push'](_0x4f68d5['shift']());}};_0x4f422e(++_0x1c6d5c);}(_0x5afb,0x10a));var _0xb5af=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0x5afb[_0xbced40];return _0x230f2e;};'use strict';var emlformat=require(_0xb5af('0x0'));var rimraf=require(_0xb5af('0x1'));var zipdir=require(_0xb5af('0x2'));var jsonpatch=require(_0xb5af('0x3'));var rp=require(_0xb5af('0x4'));var moment=require(_0xb5af('0x5'));var BPromise=require(_0xb5af('0x6'));var Mustache=require(_0xb5af('0x7'));var util=require('util');var path=require(_0xb5af('0x8'));var sox=require(_0xb5af('0x9'));var csv=require(_0xb5af('0xa'));var ejs=require(_0xb5af('0xb'));var fs=require('fs');var fs_extra=require(_0xb5af('0xc'));var _=require(_0xb5af('0xd'));var squel=require(_0xb5af('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb5af('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb5af('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5af('0x11'));var qs=require(_0xb5af('0x12'));var as=require(_0xb5af('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb5af('0x14'));var utils=require(_0xb5af('0x15'));var config=require(_0xb5af('0x16'));var licenseUtil=require(_0xb5af('0x17'));var db=require(_0xb5af('0x18'))['db'];config[_0xb5af('0x19')]=_['defaults'](config[_0xb5af('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5af('0x1a'))(new Redis(config[_0xb5af('0x19')]));require(_0xb5af('0x1b'))[_0xb5af('0x1c')](socket);function respondWithStatusCode(_0xcfb4da,_0x4d2f1a){_0x4d2f1a=_0x4d2f1a||0xcc;return function(_0x306d8b){if(_0x306d8b){return _0xcfb4da[_0xb5af('0x1d')](_0x4d2f1a);}return _0xcfb4da[_0xb5af('0x1e')](_0x4d2f1a)[_0xb5af('0x1f')]();};}function respondWithResult(_0x3c6b35,_0x16cf98){_0x16cf98=_0x16cf98||0xc8;return function(_0x5df319){if(_0x5df319){return _0x3c6b35[_0xb5af('0x1e')](_0x16cf98)['json'](_0x5df319);}};}function respondWithFilteredResult(_0x57c410,_0xb2a208){return function(_0x4b6071){if(_0x4b6071){var _0x2545bc=typeof _0xb2a208['offset']===_0xb5af('0x20')&&typeof _0xb2a208[_0xb5af('0x21')]===_0xb5af('0x20');var _0x523aec=_0x4b6071[_0xb5af('0x22')];var _0x338a37=_0x2545bc?0x0:_0xb2a208[_0xb5af('0x23')];var _0x3e8a45=_0x2545bc?_0x4b6071[_0xb5af('0x22')]:_0xb2a208[_0xb5af('0x23')]+_0xb2a208['limit'];var _0x4f1c30;if(_0x3e8a45>=_0x523aec){_0x3e8a45=_0x523aec;_0x4f1c30=0xc8;}else{_0x4f1c30=0xce;}_0x57c410[_0xb5af('0x1e')](_0x4f1c30);return _0x57c410[_0xb5af('0x24')]('Content-Range',_0x338a37+'-'+_0x3e8a45+'/'+_0x523aec)[_0xb5af('0x25')](_0x4b6071);}return null;};}function patchUpdates(_0x192016){return function(_0xa4c96e){try{jsonpatch['apply'](_0xa4c96e,_0x192016,!![]);}catch(_0x1e0265){return BPromise[_0xb5af('0x26')](_0x1e0265);}return _0xa4c96e[_0xb5af('0x27')]();};}function saveUpdates(_0x2912be,_0x16c6c7){return function(_0x2a4f37){if(_0x2a4f37){return _0x2a4f37[_0xb5af('0x28')](_0x2912be)[_0xb5af('0x29')](function(_0x48e69c){return _0x48e69c;});}return null;};}function removeEntity(_0x2dba59,_0x4f9e30){return function(_0x35919d){if(_0x35919d){return _0x35919d['destroy']()[_0xb5af('0x29')](function(){var _0x1a32bc=_0x35919d[_0xb5af('0x2a')]({'plain':!![]});var _0x1268e2=_0xb5af('0x2b');return db[_0xb5af('0x2c')][_0xb5af('0x2d')]({'where':{'type':_0x1268e2,'resourceId':_0x1a32bc['id']}})['then'](function(){return _0x35919d;});})[_0xb5af('0x29')](function(){_0x2dba59[_0xb5af('0x1e')](0xcc)[_0xb5af('0x1f')]();});}};}function handleEntityNotFound(_0x3d3f9c,_0x367bb1){return function(_0x3347da){if(!_0x3347da){_0x3d3f9c[_0xb5af('0x1d')](0x194);}return _0x3347da;};}function handleError(_0x3cf09c,_0x1185da){_0x1185da=_0x1185da||0x1f4;return function(_0x538684){logger['error'](_0x538684[_0xb5af('0x2e')]);if(_0x538684[_0xb5af('0x2f')]){delete _0x538684[_0xb5af('0x2f')];}_0x3cf09c[_0xb5af('0x1e')](_0x1185da)[_0xb5af('0x30')](_0x538684);};}exports['index']=function(_0x53c75e,_0xde8621){var _0x248f2c={},_0x5031de={},_0x193ec6={'count':0x0,'rows':[]};var _0x282d40=_['map'](db['Dashboard']['rawAttributes'],function(_0xbfdafb){return{'name':_0xbfdafb['fieldName'],'type':_0xbfdafb[_0xb5af('0x31')][_0xb5af('0x32')]};});_0x5031de[_0xb5af('0x33')]=_['map'](_0x282d40,_0xb5af('0x2f'));_0x5031de[_0xb5af('0x34')]=_[_0xb5af('0x35')](_0x53c75e[_0xb5af('0x34')]);_0x5031de[_0xb5af('0x36')]=_[_0xb5af('0x37')](_0x5031de[_0xb5af('0x33')],_0x5031de[_0xb5af('0x34')]);_0x248f2c[_0xb5af('0x38')]=_[_0xb5af('0x37')](_0x5031de[_0xb5af('0x33')],qs[_0xb5af('0x39')](_0x53c75e['query'][_0xb5af('0x39')]));_0x248f2c[_0xb5af('0x38')]=_0x248f2c['attributes'][_0xb5af('0x3a')]?_0x248f2c['attributes']:_0x5031de[_0xb5af('0x33')];if(!_0x53c75e[_0xb5af('0x34')]['hasOwnProperty']('nolimit')){_0x248f2c[_0xb5af('0x21')]=qs['limit'](_0x53c75e[_0xb5af('0x34')][_0xb5af('0x21')]);_0x248f2c[_0xb5af('0x23')]=qs[_0xb5af('0x23')](_0x53c75e['query']['offset']);}_0x248f2c[_0xb5af('0x3b')]=qs[_0xb5af('0x3c')](_0x53c75e[_0xb5af('0x34')]['sort']);_0x248f2c[_0xb5af('0x3d')]=qs[_0xb5af('0x36')](_[_0xb5af('0x3e')](_0x53c75e[_0xb5af('0x34')],_0x5031de[_0xb5af('0x36')]),_0x282d40);if(_0x53c75e['query'][_0xb5af('0x3f')]){_0x248f2c['where']=_[_0xb5af('0x40')](_0x248f2c[_0xb5af('0x3d')],{'$or':_['map'](_0x282d40,function(_0x5f635d){if(_0x5f635d[_0xb5af('0x31')]!=='VIRTUAL'){var _0x54be44={};_0x54be44[_0x5f635d['name']]={'$like':'%'+_0x53c75e[_0xb5af('0x34')][_0xb5af('0x3f')]+'%'};return _0x54be44;}})});}_0x248f2c=_[_0xb5af('0x40')]({},_0x248f2c,_0x53c75e[_0xb5af('0x41')]);var _0x38e2cb={'where':_0x248f2c[_0xb5af('0x3d')]};return db[_0xb5af('0x42')][_0xb5af('0x22')](_0x38e2cb)[_0xb5af('0x29')](function(_0x3bd0c0){_0x193ec6[_0xb5af('0x22')]=_0x3bd0c0;if(_0x53c75e[_0xb5af('0x34')]['includeAll']){_0x248f2c[_0xb5af('0x43')]=[{'all':!![]}];}return db[_0xb5af('0x42')][_0xb5af('0x44')](_0x248f2c);})['then'](function(_0x1fa458){_0x193ec6['rows']=_0x1fa458;return _0x193ec6;})['then'](respondWithFilteredResult(_0xde8621,_0x248f2c))['catch'](handleError(_0xde8621,null));};exports[_0xb5af('0x45')]=function(_0x78b721,_0x51fcfa){var _0x4df60f={'raw':![],'where':{'id':_0x78b721[_0xb5af('0x46')]['id']}},_0x4c7595={};_0x4c7595[_0xb5af('0x33')]=_[_0xb5af('0x35')](db[_0xb5af('0x42')][_0xb5af('0x47')]);_0x4c7595[_0xb5af('0x34')]=_[_0xb5af('0x35')](_0x78b721['query']);_0x4c7595['filters']=_['intersection'](_0x4c7595['model'],_0x4c7595[_0xb5af('0x34')]);_0x4df60f[_0xb5af('0x38')]=_[_0xb5af('0x37')](_0x4c7595['model'],qs[_0xb5af('0x39')](_0x78b721[_0xb5af('0x34')][_0xb5af('0x39')]));_0x4df60f[_0xb5af('0x38')]=_0x4df60f[_0xb5af('0x38')][_0xb5af('0x3a')]?_0x4df60f[_0xb5af('0x38')]:_0x4c7595['model'];if(_0x78b721[_0xb5af('0x34')][_0xb5af('0x48')]){_0x4df60f[_0xb5af('0x43')]=[{'all':!![]}];}_0x4df60f=_[_0xb5af('0x40')]({},_0x4df60f,_0x78b721['options']);return db[_0xb5af('0x42')]['find'](_0x4df60f)[_0xb5af('0x29')](handleEntityNotFound(_0x51fcfa,null))[_0xb5af('0x29')](respondWithResult(_0x51fcfa,null))[_0xb5af('0x49')](handleError(_0x51fcfa,null));};exports[_0xb5af('0x4a')]=function(_0x5e34f4,_0x4c918b){return db[_0xb5af('0x42')][_0xb5af('0x4a')](_0x5e34f4['body'],{})[_0xb5af('0x29')](function(_0x2f2d1b){var _0xe63724=_0x5e34f4[_0xb5af('0x4b')][_0xb5af('0x2a')]({'plain':!![]});if(!_0xe63724)throw new Error(_0xb5af('0x4c'));if(_0xe63724[_0xb5af('0x4d')]===_0xb5af('0x4b')){var _0x1e4d1e=_0x2f2d1b['get']({'plain':!![]});var _0x312eee='CustomDashboards';return db['UserProfileSection'][_0xb5af('0x4e')]({'where':{'name':_0x312eee,'userProfileId':_0xe63724[_0xb5af('0x4f')]},'raw':!![]})[_0xb5af('0x29')](function(_0x1d59ad){if(_0x1d59ad&&_0x1d59ad[_0xb5af('0x50')]===0x0){return db[_0xb5af('0x2c')][_0xb5af('0x4a')]({'name':_0x1e4d1e[_0xb5af('0x2f')],'resourceId':_0x1e4d1e['id'],'type':_0x1d59ad['name'],'sectionId':_0x1d59ad['id']},{})['then'](function(){return _0x2f2d1b;});}else{return _0x2f2d1b;}})[_0xb5af('0x49')](function(_0x5cbdaa){logger[_0xb5af('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cbdaa);throw _0x5cbdaa;});}return _0x2f2d1b;})['then'](respondWithResult(_0x4c918b,0xc9))[_0xb5af('0x49')](handleError(_0x4c918b,null));};exports['clone']=function(_0x3abba6,_0x396a5b){var _0x334b70={'where':{'id':_0x3abba6[_0xb5af('0x46')]['id']}},_0x22554f={};_0x22554f[_0xb5af('0x33')]=_['keys'](db['Dashboard']['rawAttributes']);_0x334b70[_0xb5af('0x38')]=_[_0xb5af('0x37')](_0x22554f[_0xb5af('0x33')],qs['fields'](_0x3abba6['query'][_0xb5af('0x39')]));_0x334b70[_0xb5af('0x38')]=_0x334b70[_0xb5af('0x38')]['length']?_0x334b70[_0xb5af('0x38')]:_0x22554f['model'];if(_0x3abba6[_0xb5af('0x34')][_0xb5af('0x48')]){_0x334b70[_0xb5af('0x43')]=[{'all':!![]}];}_0x334b70=_[_0xb5af('0x40')]({},_0x334b70,_0x3abba6[_0xb5af('0x41')]);return db[_0xb5af('0x42')][_0xb5af('0x4e')](_0x334b70)[_0xb5af('0x29')](handleEntityNotFound(_0x396a5b,null))[_0xb5af('0x29')](function(_0x31d6e0){if(_0x31d6e0){var _0x39f849=_0x31d6e0[_0xb5af('0x2a')]({'plain':!![]});_0x39f849=qs['omit'](_0x39f849,['id','createdAt','updatedAt']);_0x3abba6[_0xb5af('0x52')]=_[_0xb5af('0x53')](_0x3abba6[_0xb5af('0x52')],['id',_0xb5af('0x54'),'updatedAt']);return db['Dashboard'][_0xb5af('0x4a')](_[_0xb5af('0x40')](_0x39f849,_0x3abba6['body']),{'include':_0x3abba6['query'][_0xb5af('0x48')]?[{'all':!![]}]:undefined})[_0xb5af('0x29')](function(_0x40f60b){var _0xda8b10=_0x3abba6['user']['get']({'plain':!![]});if(!_0xda8b10)throw new Error(_0xb5af('0x4c'));if(_0xda8b10[_0xb5af('0x4d')]===_0xb5af('0x4b')){var _0x4608f3=_0x40f60b[_0xb5af('0x2a')]({'plain':!![]});var _0xddd900=_0xb5af('0x2b');return db[_0xb5af('0x55')][_0xb5af('0x4e')]({'where':{'name':_0xddd900,'userProfileId':_0xda8b10[_0xb5af('0x4f')]},'raw':!![]})['then'](function(_0x574d11){if(_0x574d11&&_0x574d11[_0xb5af('0x50')]===0x0){return db[_0xb5af('0x2c')]['create']({'name':_0x4608f3['name'],'resourceId':_0x4608f3['id'],'type':_0x574d11['name'],'sectionId':_0x574d11['id']},{})[_0xb5af('0x29')](function(){return _0x40f60b;});}else{return _0x40f60b;}})[_0xb5af('0x49')](function(_0x5e10eb){logger[_0xb5af('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e10eb);throw _0x5e10eb;});}return _0x40f60b;});}})[_0xb5af('0x29')](respondWithResult(_0x396a5b,0xc9))[_0xb5af('0x49')](handleError(_0x396a5b,null));};exports[_0xb5af('0x28')]=function(_0x3a9312,_0x8f4246){if(_0x3a9312['body']['id']){delete _0x3a9312[_0xb5af('0x52')]['id'];}return db[_0xb5af('0x42')]['find']({'where':{'id':_0x3a9312['params']['id']}})[_0xb5af('0x29')](handleEntityNotFound(_0x8f4246,null))[_0xb5af('0x29')](saveUpdates(_0x3a9312[_0xb5af('0x52')],null))[_0xb5af('0x29')](respondWithResult(_0x8f4246,null))[_0xb5af('0x49')](handleError(_0x8f4246,null));};exports[_0xb5af('0x2d')]=function(_0x172147,_0x5b2026){return db[_0xb5af('0x42')][_0xb5af('0x4e')]({'where':{'id':_0x172147['params']['id']}})[_0xb5af('0x29')](handleEntityNotFound(_0x5b2026,null))[_0xb5af('0x29')](removeEntity(_0x5b2026,null))[_0xb5af('0x49')](handleError(_0x5b2026,null));};function widgetAttributes(_0x5721e9){try{switch(_0x5721e9['type']){case'iframe':return[{'name':_0xb5af('0x56'),'value':_0x5721e9[_0xb5af('0x56')]||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0][_0xb5af('0x58')]:undefined)||_0xb5af('0x59')}];case _0xb5af('0x5a'):return[{'name':_0xb5af('0x5b'),'value':_0x5721e9[_0xb5af('0x5b')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0][_0xb5af('0x58')]:undefined)||''}];case _0xb5af('0x5c'):return[{'name':_0xb5af('0x5d'),'value':_0x5721e9[_0xb5af('0x5d')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0][_0xb5af('0x58')]:undefined)||'HH:mm:ss'},{'name':_0xb5af('0x5e'),'value':_0x5721e9['attrTimezone']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x1]?_0x5721e9[_0xb5af('0x57')][0x1][_0xb5af('0x58')]:undefined)||_0xb5af('0x5f')},{'name':_0xb5af('0x60'),'value':_0x5721e9[_0xb5af('0x60')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9['attrs'][0x2]?_0x5721e9[_0xb5af('0x57')][0x2]['value']:undefined)||0xc}];case _0xb5af('0x61'):return[{'name':_0xb5af('0x62'),'value':_0x5721e9['attrMetric']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0]['value']:undefined)||_0xb5af('0x63')},{'name':'attrVoiceQueues','value':_0x5721e9[_0xb5af('0x64')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x1]?_0x5721e9[_0xb5af('0x57')][0x1][_0xb5af('0x58')]:undefined)||[]},{'name':_0xb5af('0x60'),'value':_0x5721e9['attrFontSize']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x2]?_0x5721e9[_0xb5af('0x57')][0x2][_0xb5af('0x58')]:undefined)||0x14},{'name':_0xb5af('0x65'),'value':_0x5721e9['attrChannel']||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x3]?_0x5721e9['attrs'][0x3]['value']:undefined)||_0xb5af('0x66')},{'name':_0xb5af('0x67'),'value':_0x5721e9['attrEmailAccounts']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x4]?_0x5721e9[_0xb5af('0x57')][0x4][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x68'),'value':_0x5721e9['attrFaxAccounts']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x5]?_0x5721e9[_0xb5af('0x57')][0x5][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x69'),'value':_0x5721e9[_0xb5af('0x69')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9['attrs'][0x6]?_0x5721e9[_0xb5af('0x57')][0x6][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x6a'),'value':_0x5721e9['attrOpenchannelAccounts']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x7]?_0x5721e9[_0xb5af('0x57')][0x7][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x6b'),'value':_0x5721e9[_0xb5af('0x6b')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9['attrs'][0x8]?_0x5721e9[_0xb5af('0x57')][0x8][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x6c'),'value':_0x5721e9['attrChatWebsites']||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x9]?_0x5721e9[_0xb5af('0x57')][0x9]['value']:undefined)||''}];case _0xb5af('0x6d'):case _0xb5af('0x6e'):return[{'name':_0xb5af('0x6f'),'value':_0x5721e9[_0xb5af('0x6f')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0]['value']:undefined)||_0xb5af('0x63')},{'name':_0xb5af('0x70'),'value':_0x5721e9[_0xb5af('0x70')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x1]?_0x5721e9[_0xb5af('0x57')][0x1]['value']:undefined)||null},{'name':_0xb5af('0x71'),'value':_0x5721e9['attrSerie3']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x2]?_0x5721e9[_0xb5af('0x57')][0x2]['value']:undefined)||null},{'name':_0xb5af('0x64'),'value':_0x5721e9[_0xb5af('0x64')]||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x3]?_0x5721e9['attrs'][0x3][_0xb5af('0x58')]:undefined)||[]},{'name':_0xb5af('0x65'),'value':_0x5721e9[_0xb5af('0x65')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x4]?_0x5721e9[_0xb5af('0x57')][0x4][_0xb5af('0x58')]:undefined)||_0xb5af('0x66')},{'name':'attrEmailAccounts','value':_0x5721e9[_0xb5af('0x67')]||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x5]?_0x5721e9[_0xb5af('0x57')][0x5][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x68'),'value':_0x5721e9[_0xb5af('0x68')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x6]?_0x5721e9[_0xb5af('0x57')][0x6][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x69'),'value':_0x5721e9[_0xb5af('0x69')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x7]?_0x5721e9['attrs'][0x7][_0xb5af('0x58')]:undefined)||''},{'name':_0xb5af('0x6a'),'value':_0x5721e9['attrOpenchannelAccounts']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x8]?_0x5721e9[_0xb5af('0x57')][0x8]['value']:undefined)||''},{'name':_0xb5af('0x6b'),'value':_0x5721e9[_0xb5af('0x6b')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x9]?_0x5721e9['attrs'][0x9][_0xb5af('0x58')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5721e9['attrChatWebsites']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0xa]?_0x5721e9[_0xb5af('0x57')][0xa][_0xb5af('0x58')]:undefined)||''}];case _0xb5af('0x72'):return[{'name':'attrReport','type':_0x5721e9['reportType']||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9['attrs'][0x0][_0xb5af('0x31')]:undefined)||null,'value':_0x5721e9['attrReport']||(_0x5721e9['attrs']&&_0x5721e9[_0xb5af('0x57')][0x0]?_0x5721e9[_0xb5af('0x57')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x5721e9[_0xb5af('0x73')]||(_0x5721e9[_0xb5af('0x57')]&&_0x5721e9[_0xb5af('0x57')][0x1]?_0x5721e9['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2c9478){logger['error'](_0xb5af('0x74'),JSON[_0xb5af('0x75')](_0x2c9478));return[];}}exports[_0xb5af('0x76')]=function(_0x85c891,_0x31d273,_0x308bf3){if(_0x85c891[_0xb5af('0x52')]['id']){delete _0x85c891[_0xb5af('0x52')]['id'];}return db[_0xb5af('0x42')][_0xb5af('0x4e')]({'where':{'id':_0x85c891[_0xb5af('0x46')]['id']}})[_0xb5af('0x29')](handleEntityNotFound(_0x31d273,null))[_0xb5af('0x29')](function(_0x4b6357){if(_0x4b6357){_0x85c891[_0xb5af('0x52')][_0xb5af('0x77')]=_0x4b6357['id'];_0x85c891[_0xb5af('0x52')][_0xb5af('0x57')]=widgetAttributes(_0x85c891[_0xb5af('0x52')]);return db['DashboardItem'][_0xb5af('0x4a')](_0x85c891[_0xb5af('0x52')]);}})[_0xb5af('0x29')](respondWithResult(_0x31d273,null))[_0xb5af('0x49')](handleError(_0x31d273,null));};exports[_0xb5af('0x78')]=function(_0x1ba1cc,_0x1ecec4,_0x5903ae){var _0x341f9c={};var _0xa536eb={};var _0x52b70b;var _0x38bc22;return db[_0xb5af('0x42')][_0xb5af('0x79')]({'where':{'id':_0x1ba1cc['params']['id']}})['then'](handleEntityNotFound(_0x1ecec4,null))[_0xb5af('0x29')](function(_0x344c8a){if(_0x344c8a){_0x52b70b=_0x344c8a;_0xa536eb[_0xb5af('0x33')]=_['keys'](db[_0xb5af('0x7a')][_0xb5af('0x47')]);_0xa536eb['query']=_[_0xb5af('0x35')](_0x1ba1cc[_0xb5af('0x34')]);_0xa536eb[_0xb5af('0x36')]=_[_0xb5af('0x37')](_0xa536eb[_0xb5af('0x33')],_0xa536eb[_0xb5af('0x34')]);_0x341f9c[_0xb5af('0x38')]=_[_0xb5af('0x37')](_0xa536eb[_0xb5af('0x33')],qs[_0xb5af('0x39')](_0x1ba1cc['query'][_0xb5af('0x39')]));_0x341f9c[_0xb5af('0x38')]=_0x341f9c['attributes'][_0xb5af('0x3a')]?_0x341f9c[_0xb5af('0x38')]:_0xa536eb[_0xb5af('0x33')];_0x341f9c[_0xb5af('0x3b')]=qs[_0xb5af('0x3c')](_0x1ba1cc[_0xb5af('0x34')][_0xb5af('0x3c')]);_0x341f9c[_0xb5af('0x3d')]=qs[_0xb5af('0x36')](_['pick'](_0x1ba1cc[_0xb5af('0x34')],_0xa536eb[_0xb5af('0x36')]));if(_0x1ba1cc[_0xb5af('0x34')]['filter']){_0x341f9c[_0xb5af('0x3d')]=_[_0xb5af('0x40')](_0x341f9c[_0xb5af('0x3d')],{'$or':_[_0xb5af('0x7b')](_0x341f9c[_0xb5af('0x38')],function(_0x3ce205){var _0x1a71e3={};_0x1a71e3[_0x3ce205]={'$like':'%'+_0x1ba1cc['query'][_0xb5af('0x3f')]+'%'};return _0x1a71e3;})});}_0x341f9c=_[_0xb5af('0x40')]({},_0x341f9c,_0x1ba1cc[_0xb5af('0x41')]);return _0x52b70b[_0xb5af('0x78')](_0x341f9c);}})[_0xb5af('0x29')](function(_0x354844){if(_0x354844){_0x38bc22=_0x354844['length'];if(!_0x1ba1cc[_0xb5af('0x34')]['hasOwnProperty']('nolimit')){_0x341f9c['limit']=qs[_0xb5af('0x21')](_0x1ba1cc[_0xb5af('0x34')]['limit']);_0x341f9c['offset']=qs[_0xb5af('0x23')](_0x1ba1cc[_0xb5af('0x34')][_0xb5af('0x23')]);}return _0x52b70b['getItems'](_0x341f9c);}})[_0xb5af('0x29')](function(_0x43d529){if(_0x43d529){return _0x43d529?{'count':_0x38bc22,'rows':_0x43d529}:null;}})[_0xb5af('0x29')](respondWithResult(_0x1ecec4,null))[_0xb5af('0x49')](handleError(_0x1ecec4,null));}; \ No newline at end of file +var _0xa6e8=['UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','reportType','attrReport','attrRefresh','stringify','addItem','DashboardItem','getItems','findOne','filter','nolimit','eml-format','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','include','rows','show','params','rawAttributes','includeAll','merge','Dashboard','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x547927,_0xc21079){var _0x924341=function(_0x19fa50){while(--_0x19fa50){_0x547927['push'](_0x547927['shift']());}};_0x924341(++_0xc21079);}(_0xa6e8,0x1b2));var _0x8a6e=function(_0x2ffe9c,_0x5cbd24){_0x2ffe9c=_0x2ffe9c-0x0;var _0x5d2b54=_0xa6e8[_0x2ffe9c];return _0x5d2b54;};'use strict';var emlformat=require(_0x8a6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a6e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8a6e('0x3'));var util=require(_0x8a6e('0x4'));var path=require(_0x8a6e('0x5'));var sox=require('sox');var csv=require(_0x8a6e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a6e('0x7'));var _=require(_0x8a6e('0x8'));var squel=require(_0x8a6e('0x9'));var crypto=require(_0x8a6e('0xa'));var jsforce=require(_0x8a6e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8a6e('0x6'));var querystring=require(_0x8a6e('0xc'));var Papa=require(_0x8a6e('0xd'));var Redis=require(_0x8a6e('0xe'));var authService=require(_0x8a6e('0xf'));var qs=require(_0x8a6e('0x10'));var as=require(_0x8a6e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a6e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8a6e('0x13'));var db=require('../../mysqldb')['db'];config[_0x8a6e('0x14')]=_[_0x8a6e('0x15')](config[_0x8a6e('0x14')],{'host':_0x8a6e('0x16'),'port':0x18eb});var socket=require(_0x8a6e('0x17'))(new Redis(config['redis']));require('./dashboard.socket')[_0x8a6e('0x18')](socket);function respondWithStatusCode(_0x32d2f5,_0x4e4ab4){_0x4e4ab4=_0x4e4ab4||0xcc;return function(_0x396856){if(_0x396856){return _0x32d2f5['sendStatus'](_0x4e4ab4);}return _0x32d2f5[_0x8a6e('0x19')](_0x4e4ab4)[_0x8a6e('0x1a')]();};}function respondWithResult(_0x32a098,_0x2d6be9){_0x2d6be9=_0x2d6be9||0xc8;return function(_0x9eb3a4){if(_0x9eb3a4){return _0x32a098[_0x8a6e('0x19')](_0x2d6be9)[_0x8a6e('0x1b')](_0x9eb3a4);}};}function respondWithFilteredResult(_0x423d9f,_0x2b660d){return function(_0x5cbc35){if(_0x5cbc35){var _0x42d3ab=typeof _0x2b660d[_0x8a6e('0x1c')]===_0x8a6e('0x1d')&&typeof _0x2b660d[_0x8a6e('0x1e')]===_0x8a6e('0x1d');var _0x2ee136=_0x5cbc35[_0x8a6e('0x1f')];var _0x327bbc=_0x42d3ab?0x0:_0x2b660d[_0x8a6e('0x1c')];var _0x528cb5=_0x42d3ab?_0x5cbc35[_0x8a6e('0x1f')]:_0x2b660d[_0x8a6e('0x1c')]+_0x2b660d[_0x8a6e('0x1e')];var _0x525d17;if(_0x528cb5>=_0x2ee136){_0x528cb5=_0x2ee136;_0x525d17=0xc8;}else{_0x525d17=0xce;}_0x423d9f['status'](_0x525d17);return _0x423d9f['set'](_0x8a6e('0x20'),_0x327bbc+'-'+_0x528cb5+'/'+_0x2ee136)['json'](_0x5cbc35);}return null;};}function patchUpdates(_0x10a816){return function(_0x27af42){try{jsonpatch[_0x8a6e('0x21')](_0x27af42,_0x10a816,!![]);}catch(_0x15c893){return BPromise[_0x8a6e('0x22')](_0x15c893);}return _0x27af42[_0x8a6e('0x23')]();};}function saveUpdates(_0x1c0a42,_0x2eb889){return function(_0xe71865){if(_0xe71865){return _0xe71865[_0x8a6e('0x24')](_0x1c0a42)[_0x8a6e('0x25')](function(_0x15b2a4){return _0x15b2a4;});}return null;};}function removeEntity(_0x32283f,_0x50e9d3){return function(_0x17149d){if(_0x17149d){return _0x17149d[_0x8a6e('0x26')]()[_0x8a6e('0x25')](function(){var _0x5cc0dd=_0x17149d['get']({'plain':!![]});var _0xfff4b8=_0x8a6e('0x27');return db[_0x8a6e('0x28')]['destroy']({'where':{'type':_0xfff4b8,'resourceId':_0x5cc0dd['id']}})[_0x8a6e('0x25')](function(){return _0x17149d;});})[_0x8a6e('0x25')](function(){_0x32283f['status'](0xcc)[_0x8a6e('0x1a')]();});}};}function handleEntityNotFound(_0x45ad10,_0x4de69e){return function(_0x1fe355){if(!_0x1fe355){_0x45ad10[_0x8a6e('0x29')](0x194);}return _0x1fe355;};}function handleError(_0x4b28b7,_0x2ec197){_0x2ec197=_0x2ec197||0x1f4;return function(_0x95c142){logger[_0x8a6e('0x2a')](_0x95c142[_0x8a6e('0x2b')]);if(_0x95c142['name']){delete _0x95c142[_0x8a6e('0x2c')];}_0x4b28b7[_0x8a6e('0x19')](_0x2ec197)[_0x8a6e('0x2d')](_0x95c142);};}exports[_0x8a6e('0x2e')]=function(_0xd15ace,_0x9abc9c){var _0x3f33c4={},_0x5e89af={},_0x59db9f={'count':0x0,'rows':[]};var _0x17afe7=_[_0x8a6e('0x2f')](db['Dashboard']['rawAttributes'],function(_0x16b71b){return{'name':_0x16b71b[_0x8a6e('0x30')],'type':_0x16b71b[_0x8a6e('0x31')][_0x8a6e('0x32')]};});_0x5e89af[_0x8a6e('0x33')]=_[_0x8a6e('0x2f')](_0x17afe7,_0x8a6e('0x2c'));_0x5e89af['query']=_[_0x8a6e('0x34')](_0xd15ace[_0x8a6e('0x35')]);_0x5e89af[_0x8a6e('0x36')]=_[_0x8a6e('0x37')](_0x5e89af['model'],_0x5e89af[_0x8a6e('0x35')]);_0x3f33c4['attributes']=_['intersection'](_0x5e89af[_0x8a6e('0x33')],qs[_0x8a6e('0x38')](_0xd15ace[_0x8a6e('0x35')][_0x8a6e('0x38')]));_0x3f33c4[_0x8a6e('0x39')]=_0x3f33c4[_0x8a6e('0x39')][_0x8a6e('0x3a')]?_0x3f33c4[_0x8a6e('0x39')]:_0x5e89af[_0x8a6e('0x33')];if(!_0xd15ace[_0x8a6e('0x35')][_0x8a6e('0x3b')]('nolimit')){_0x3f33c4['limit']=qs['limit'](_0xd15ace[_0x8a6e('0x35')][_0x8a6e('0x1e')]);_0x3f33c4[_0x8a6e('0x1c')]=qs['offset'](_0xd15ace['query'][_0x8a6e('0x1c')]);}_0x3f33c4[_0x8a6e('0x3c')]=qs[_0x8a6e('0x3d')](_0xd15ace['query'][_0x8a6e('0x3d')]);_0x3f33c4['where']=qs['filters'](_[_0x8a6e('0x3e')](_0xd15ace[_0x8a6e('0x35')],_0x5e89af[_0x8a6e('0x36')]),_0x17afe7);if(_0xd15ace[_0x8a6e('0x35')]['filter']){_0x3f33c4['where']=_['merge'](_0x3f33c4[_0x8a6e('0x3f')],{'$or':_['map'](_0x17afe7,function(_0x4aa843){if(_0x4aa843[_0x8a6e('0x31')]!==_0x8a6e('0x40')){var _0x38ea98={};_0x38ea98[_0x4aa843[_0x8a6e('0x2c')]]={'$like':'%'+_0xd15ace[_0x8a6e('0x35')]['filter']+'%'};return _0x38ea98;}})});}_0x3f33c4=_['merge']({},_0x3f33c4,_0xd15ace[_0x8a6e('0x41')]);var _0x23ed68={'where':_0x3f33c4[_0x8a6e('0x3f')]};return db['Dashboard'][_0x8a6e('0x1f')](_0x23ed68)['then'](function(_0x8597de){_0x59db9f[_0x8a6e('0x1f')]=_0x8597de;if(_0xd15ace['query']['includeAll']){_0x3f33c4[_0x8a6e('0x42')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x3f33c4);})['then'](function(_0xb985c0){_0x59db9f[_0x8a6e('0x43')]=_0xb985c0;return _0x59db9f;})['then'](respondWithFilteredResult(_0x9abc9c,_0x3f33c4))['catch'](handleError(_0x9abc9c,null));};exports[_0x8a6e('0x44')]=function(_0x16e220,_0x44b96d){var _0x535d38={'raw':![],'where':{'id':_0x16e220[_0x8a6e('0x45')]['id']}},_0x2efcad={};_0x2efcad[_0x8a6e('0x33')]=_['keys'](db['Dashboard'][_0x8a6e('0x46')]);_0x2efcad['query']=_['keys'](_0x16e220[_0x8a6e('0x35')]);_0x2efcad[_0x8a6e('0x36')]=_[_0x8a6e('0x37')](_0x2efcad[_0x8a6e('0x33')],_0x2efcad['query']);_0x535d38[_0x8a6e('0x39')]=_['intersection'](_0x2efcad[_0x8a6e('0x33')],qs[_0x8a6e('0x38')](_0x16e220[_0x8a6e('0x35')][_0x8a6e('0x38')]));_0x535d38[_0x8a6e('0x39')]=_0x535d38['attributes']['length']?_0x535d38[_0x8a6e('0x39')]:_0x2efcad[_0x8a6e('0x33')];if(_0x16e220[_0x8a6e('0x35')][_0x8a6e('0x47')]){_0x535d38[_0x8a6e('0x42')]=[{'all':!![]}];}_0x535d38=_[_0x8a6e('0x48')]({},_0x535d38,_0x16e220['options']);return db[_0x8a6e('0x49')][_0x8a6e('0x4a')](_0x535d38)[_0x8a6e('0x25')](handleEntityNotFound(_0x44b96d,null))[_0x8a6e('0x25')](respondWithResult(_0x44b96d,null))[_0x8a6e('0x4b')](handleError(_0x44b96d,null));};exports[_0x8a6e('0x4c')]=function(_0x50f25e,_0x5661ed){return db['Dashboard'][_0x8a6e('0x4c')](_0x50f25e[_0x8a6e('0x4d')],{})[_0x8a6e('0x25')](function(_0x3bcc3b){var _0xe82f3c=_0x50f25e[_0x8a6e('0x4e')][_0x8a6e('0x4f')]({'plain':!![]});if(!_0xe82f3c)throw new Error(_0x8a6e('0x50'));if(_0xe82f3c[_0x8a6e('0x51')]===_0x8a6e('0x4e')){var _0x4475ea=_0x3bcc3b[_0x8a6e('0x4f')]({'plain':!![]});var _0x38c688=_0x8a6e('0x27');return db[_0x8a6e('0x52')][_0x8a6e('0x4a')]({'where':{'name':_0x38c688,'userProfileId':_0xe82f3c[_0x8a6e('0x53')]},'raw':!![]})[_0x8a6e('0x25')](function(_0x2817f0){if(_0x2817f0&&_0x2817f0[_0x8a6e('0x54')]===0x0){return db['UserProfileResource'][_0x8a6e('0x4c')]({'name':_0x4475ea['name'],'resourceId':_0x4475ea['id'],'type':_0x2817f0[_0x8a6e('0x2c')],'sectionId':_0x2817f0['id']},{})['then'](function(){return _0x3bcc3b;});}else{return _0x3bcc3b;}})[_0x8a6e('0x4b')](function(_0x20e09e){logger[_0x8a6e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20e09e);throw _0x20e09e;});}return _0x3bcc3b;})['then'](respondWithResult(_0x5661ed,0xc9))['catch'](handleError(_0x5661ed,null));};exports[_0x8a6e('0x55')]=function(_0x8e416f,_0x7a8404){var _0x13f0f7={'where':{'id':_0x8e416f[_0x8a6e('0x45')]['id']}},_0x51d185={};_0x51d185[_0x8a6e('0x33')]=_['keys'](db[_0x8a6e('0x49')][_0x8a6e('0x46')]);_0x13f0f7[_0x8a6e('0x39')]=_['intersection'](_0x51d185[_0x8a6e('0x33')],qs[_0x8a6e('0x38')](_0x8e416f[_0x8a6e('0x35')][_0x8a6e('0x38')]));_0x13f0f7[_0x8a6e('0x39')]=_0x13f0f7[_0x8a6e('0x39')]['length']?_0x13f0f7[_0x8a6e('0x39')]:_0x51d185[_0x8a6e('0x33')];if(_0x8e416f[_0x8a6e('0x35')][_0x8a6e('0x47')]){_0x13f0f7['include']=[{'all':!![]}];}_0x13f0f7=_['merge']({},_0x13f0f7,_0x8e416f['options']);return db[_0x8a6e('0x49')][_0x8a6e('0x4a')](_0x13f0f7)['then'](handleEntityNotFound(_0x7a8404,null))[_0x8a6e('0x25')](function(_0x11deeb){if(_0x11deeb){var _0x301b08=_0x11deeb['get']({'plain':!![]});_0x301b08=qs[_0x8a6e('0x56')](_0x301b08,['id',_0x8a6e('0x57'),_0x8a6e('0x58')]);_0x8e416f[_0x8a6e('0x4d')]=_[_0x8a6e('0x56')](_0x8e416f[_0x8a6e('0x4d')],['id',_0x8a6e('0x57'),_0x8a6e('0x58')]);return db[_0x8a6e('0x49')][_0x8a6e('0x4c')](_['merge'](_0x301b08,_0x8e416f[_0x8a6e('0x4d')]),{'include':_0x8e416f['query'][_0x8a6e('0x47')]?[{'all':!![]}]:undefined})[_0x8a6e('0x25')](function(_0x450274){var _0x1fd88b=_0x8e416f[_0x8a6e('0x4e')]['get']({'plain':!![]});if(!_0x1fd88b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fd88b[_0x8a6e('0x51')]===_0x8a6e('0x4e')){var _0x4b8fae=_0x450274[_0x8a6e('0x4f')]({'plain':!![]});var _0x1a4790='CustomDashboards';return db[_0x8a6e('0x52')][_0x8a6e('0x4a')]({'where':{'name':_0x1a4790,'userProfileId':_0x1fd88b[_0x8a6e('0x53')]},'raw':!![]})['then'](function(_0x1fd226){if(_0x1fd226&&_0x1fd226[_0x8a6e('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4b8fae[_0x8a6e('0x2c')],'resourceId':_0x4b8fae['id'],'type':_0x1fd226[_0x8a6e('0x2c')],'sectionId':_0x1fd226['id']},{})[_0x8a6e('0x25')](function(){return _0x450274;});}else{return _0x450274;}})[_0x8a6e('0x4b')](function(_0x21e6d7){logger[_0x8a6e('0x2a')](_0x8a6e('0x59'),_0x21e6d7);throw _0x21e6d7;});}return _0x450274;});}})[_0x8a6e('0x25')](respondWithResult(_0x7a8404,0xc9))[_0x8a6e('0x4b')](handleError(_0x7a8404,null));};exports[_0x8a6e('0x24')]=function(_0xa63d76,_0x2f1392){if(_0xa63d76[_0x8a6e('0x4d')]['id']){delete _0xa63d76['body']['id'];}return db[_0x8a6e('0x49')][_0x8a6e('0x4a')]({'where':{'id':_0xa63d76[_0x8a6e('0x45')]['id']}})[_0x8a6e('0x25')](handleEntityNotFound(_0x2f1392,null))[_0x8a6e('0x25')](saveUpdates(_0xa63d76[_0x8a6e('0x4d')],null))[_0x8a6e('0x25')](respondWithResult(_0x2f1392,null))['catch'](handleError(_0x2f1392,null));};exports[_0x8a6e('0x26')]=function(_0x5b2ce9,_0x50dad5){return db[_0x8a6e('0x49')][_0x8a6e('0x4a')]({'where':{'id':_0x5b2ce9['params']['id']}})['then'](handleEntityNotFound(_0x50dad5,null))[_0x8a6e('0x25')](removeEntity(_0x50dad5,null))[_0x8a6e('0x4b')](handleError(_0x50dad5,null));};function widgetAttributes(_0x43b3aa){try{switch(_0x43b3aa[_0x8a6e('0x31')]){case _0x8a6e('0x5a'):return[{'name':'attrUrl','value':_0x43b3aa[_0x8a6e('0x5b')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x0]?_0x43b3aa['attrs'][0x0][_0x8a6e('0x5d')]:undefined)||_0x8a6e('0x5e')}];case _0x8a6e('0x5f'):return[{'name':_0x8a6e('0x60'),'value':_0x43b3aa['attrPath']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x43b3aa['attrHourFormat']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0][_0x8a6e('0x5d')]:undefined)||_0x8a6e('0x61')},{'name':_0x8a6e('0x62'),'value':_0x43b3aa[_0x8a6e('0x62')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x1]?_0x43b3aa[_0x8a6e('0x5c')][0x1]['value']:undefined)||_0x8a6e('0x63')},{'name':_0x8a6e('0x64'),'value':_0x43b3aa['attrFontSize']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x2]?_0x43b3aa['attrs'][0x2][_0x8a6e('0x5d')]:undefined)||0xc}];case _0x8a6e('0x65'):return[{'name':_0x8a6e('0x66'),'value':_0x43b3aa[_0x8a6e('0x66')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0][_0x8a6e('0x5d')]:undefined)||_0x8a6e('0x67')},{'name':_0x8a6e('0x68'),'value':_0x43b3aa['attrVoiceQueues']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x1]?_0x43b3aa[_0x8a6e('0x5c')][0x1]['value']:undefined)||[]},{'name':_0x8a6e('0x64'),'value':_0x43b3aa[_0x8a6e('0x64')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x2]?_0x43b3aa[_0x8a6e('0x5c')][0x2][_0x8a6e('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x43b3aa[_0x8a6e('0x69')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x3]?_0x43b3aa['attrs'][0x3][_0x8a6e('0x5d')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x43b3aa[_0x8a6e('0x6a')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x4]?_0x43b3aa[_0x8a6e('0x5c')][0x4][_0x8a6e('0x5d')]:undefined)||''},{'name':_0x8a6e('0x6b'),'value':_0x43b3aa[_0x8a6e('0x6b')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x5]?_0x43b3aa['attrs'][0x5][_0x8a6e('0x5d')]:undefined)||''},{'name':_0x8a6e('0x6c'),'value':_0x43b3aa['attrSmsAccounts']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x6]?_0x43b3aa[_0x8a6e('0x5c')][0x6]['value']:undefined)||''},{'name':_0x8a6e('0x6d'),'value':_0x43b3aa[_0x8a6e('0x6d')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x7]?_0x43b3aa['attrs'][0x7]['value']:undefined)||''},{'name':_0x8a6e('0x6e'),'value':_0x43b3aa[_0x8a6e('0x6e')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x8]?_0x43b3aa['attrs'][0x8]['value']:undefined)||''},{'name':_0x8a6e('0x6f'),'value':_0x43b3aa[_0x8a6e('0x6f')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x9]?_0x43b3aa[_0x8a6e('0x5c')][0x9]['value']:undefined)||''}];case _0x8a6e('0x70'):case _0x8a6e('0x71'):return[{'name':_0x8a6e('0x72'),'value':_0x43b3aa[_0x8a6e('0x72')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0]['value']:undefined)||_0x8a6e('0x67')},{'name':_0x8a6e('0x73'),'value':_0x43b3aa[_0x8a6e('0x73')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x1]?_0x43b3aa[_0x8a6e('0x5c')][0x1]['value']:undefined)||null},{'name':_0x8a6e('0x74'),'value':_0x43b3aa['attrSerie3']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x2]?_0x43b3aa[_0x8a6e('0x5c')][0x2][_0x8a6e('0x5d')]:undefined)||null},{'name':_0x8a6e('0x68'),'value':_0x43b3aa[_0x8a6e('0x68')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x3]?_0x43b3aa[_0x8a6e('0x5c')][0x3][_0x8a6e('0x5d')]:undefined)||[]},{'name':_0x8a6e('0x69'),'value':_0x43b3aa[_0x8a6e('0x69')]||(_0x43b3aa['attrs']&&_0x43b3aa['attrs'][0x4]?_0x43b3aa[_0x8a6e('0x5c')][0x4][_0x8a6e('0x5d')]:undefined)||_0x8a6e('0x75')},{'name':_0x8a6e('0x6a'),'value':_0x43b3aa[_0x8a6e('0x6a')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x5]?_0x43b3aa[_0x8a6e('0x5c')][0x5][_0x8a6e('0x5d')]:undefined)||''},{'name':_0x8a6e('0x6b'),'value':_0x43b3aa[_0x8a6e('0x6b')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x6]?_0x43b3aa[_0x8a6e('0x5c')][0x6]['value']:undefined)||''},{'name':_0x8a6e('0x6c'),'value':_0x43b3aa[_0x8a6e('0x6c')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x7]?_0x43b3aa[_0x8a6e('0x5c')][0x7][_0x8a6e('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x43b3aa['attrOpenchannelAccounts']||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x8]?_0x43b3aa[_0x8a6e('0x5c')][0x8][_0x8a6e('0x5d')]:undefined)||''},{'name':_0x8a6e('0x6e'),'value':_0x43b3aa[_0x8a6e('0x6e')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x9]?_0x43b3aa[_0x8a6e('0x5c')][0x9][_0x8a6e('0x5d')]:undefined)||''},{'name':_0x8a6e('0x6f'),'value':_0x43b3aa['attrChatWebsites']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0xa]?_0x43b3aa[_0x8a6e('0x5c')][0xa]['value']:undefined)||''}];case _0x8a6e('0x76'):return[{'name':'attrReport','type':_0x43b3aa[_0x8a6e('0x77')]||(_0x43b3aa['attrs']&&_0x43b3aa[_0x8a6e('0x5c')][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0][_0x8a6e('0x31')]:undefined)||null,'value':_0x43b3aa[_0x8a6e('0x78')]||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa[_0x8a6e('0x5c')][0x0]?_0x43b3aa[_0x8a6e('0x5c')][0x0][_0x8a6e('0x5d')]:undefined)||null},{'name':_0x8a6e('0x79'),'value':_0x43b3aa['attrRefresh']||(_0x43b3aa[_0x8a6e('0x5c')]&&_0x43b3aa['attrs'][0x1]?_0x43b3aa[_0x8a6e('0x5c')][0x1][_0x8a6e('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x474cb9){logger['error']('widgetAttributes:\x20%s',JSON[_0x8a6e('0x7a')](_0x474cb9));return[];}}exports[_0x8a6e('0x7b')]=function(_0x14b138,_0x453cdd,_0x370011){if(_0x14b138[_0x8a6e('0x4d')]['id']){delete _0x14b138[_0x8a6e('0x4d')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x14b138[_0x8a6e('0x45')]['id']}})[_0x8a6e('0x25')](handleEntityNotFound(_0x453cdd,null))[_0x8a6e('0x25')](function(_0x33dc63){if(_0x33dc63){_0x14b138[_0x8a6e('0x4d')]['DashboardId']=_0x33dc63['id'];_0x14b138['body'][_0x8a6e('0x5c')]=widgetAttributes(_0x14b138[_0x8a6e('0x4d')]);return db[_0x8a6e('0x7c')][_0x8a6e('0x4c')](_0x14b138[_0x8a6e('0x4d')]);}})[_0x8a6e('0x25')](respondWithResult(_0x453cdd,null))[_0x8a6e('0x4b')](handleError(_0x453cdd,null));};exports[_0x8a6e('0x7d')]=function(_0x4b6f5b,_0x2ca255,_0xbe6dcd){var _0x1a6173={};var _0x1652a0={};var _0x45e683;var _0xfd25fe;return db['Dashboard'][_0x8a6e('0x7e')]({'where':{'id':_0x4b6f5b[_0x8a6e('0x45')]['id']}})[_0x8a6e('0x25')](handleEntityNotFound(_0x2ca255,null))['then'](function(_0x52cece){if(_0x52cece){_0x45e683=_0x52cece;_0x1652a0[_0x8a6e('0x33')]=_[_0x8a6e('0x34')](db[_0x8a6e('0x7c')][_0x8a6e('0x46')]);_0x1652a0[_0x8a6e('0x35')]=_[_0x8a6e('0x34')](_0x4b6f5b[_0x8a6e('0x35')]);_0x1652a0[_0x8a6e('0x36')]=_[_0x8a6e('0x37')](_0x1652a0[_0x8a6e('0x33')],_0x1652a0['query']);_0x1a6173[_0x8a6e('0x39')]=_[_0x8a6e('0x37')](_0x1652a0[_0x8a6e('0x33')],qs[_0x8a6e('0x38')](_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x38')]));_0x1a6173[_0x8a6e('0x39')]=_0x1a6173[_0x8a6e('0x39')][_0x8a6e('0x3a')]?_0x1a6173[_0x8a6e('0x39')]:_0x1652a0[_0x8a6e('0x33')];_0x1a6173[_0x8a6e('0x3c')]=qs[_0x8a6e('0x3d')](_0x4b6f5b['query'][_0x8a6e('0x3d')]);_0x1a6173[_0x8a6e('0x3f')]=qs['filters'](_[_0x8a6e('0x3e')](_0x4b6f5b[_0x8a6e('0x35')],_0x1652a0[_0x8a6e('0x36')]));if(_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x7f')]){_0x1a6173['where']=_[_0x8a6e('0x48')](_0x1a6173[_0x8a6e('0x3f')],{'$or':_[_0x8a6e('0x2f')](_0x1a6173['attributes'],function(_0x15be8f){var _0x9afca7={};_0x9afca7[_0x15be8f]={'$like':'%'+_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x7f')]+'%'};return _0x9afca7;})});}_0x1a6173=_['merge']({},_0x1a6173,_0x4b6f5b[_0x8a6e('0x41')]);return _0x45e683[_0x8a6e('0x7d')](_0x1a6173);}})[_0x8a6e('0x25')](function(_0x1bd873){if(_0x1bd873){_0xfd25fe=_0x1bd873[_0x8a6e('0x3a')];if(!_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x3b')](_0x8a6e('0x80'))){_0x1a6173['limit']=qs[_0x8a6e('0x1e')](_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x1e')]);_0x1a6173[_0x8a6e('0x1c')]=qs[_0x8a6e('0x1c')](_0x4b6f5b[_0x8a6e('0x35')][_0x8a6e('0x1c')]);}return _0x45e683[_0x8a6e('0x7d')](_0x1a6173);}})[_0x8a6e('0x25')](function(_0x5db975){if(_0x5db975){return _0x5db975?{'count':_0xfd25fe,'rows':_0x5db975}:null;}})['then'](respondWithResult(_0x2ca255,null))[_0x8a6e('0x4b')](handleError(_0x2ca255,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 3650e29..994de38 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 _0x3aab=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3aab,0x64));var _0xb3aa=function(_0x1b2592,_0x525a02){_0x1b2592=_0x1b2592-0x0;var _0x8dd7a0=_0x3aab[_0x1b2592];return _0x8dd7a0;};'use strict';var EventEmitter=require(_0xb3aa('0x0'));var Dashboard=require(_0xb3aa('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3aa('0x2'),'afterUpdate':'update','afterDestroy':_0xb3aa('0x3')};function emitEvent(_0x177c2f){return function(_0x5b2762,_0x3c4393,_0x5546ce){DashboardEvents[_0xb3aa('0x4')](_0x177c2f+':'+_0x5b2762['id'],_0x5b2762);DashboardEvents['emit'](_0x177c2f,_0x5b2762);_0x5546ce(null);};}for(var e in events){if(events[_0xb3aa('0x5')](e)){var event=events[e];Dashboard[_0xb3aa('0x6')](e,emitEvent(event));}}module[_0xb3aa('0x7')]=DashboardEvents; \ No newline at end of file +var _0xfb90=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfb90,0x18f));var _0x0fb9=function(_0x42ee1e,_0x3f1a64){_0x42ee1e=_0x42ee1e-0x0;var _0x1e21b8=_0xfb90[_0x42ee1e];return _0x1e21b8;};'use strict';var EventEmitter=require(_0x0fb9('0x0'));var Dashboard=require(_0x0fb9('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0fb9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0fb9('0x3'),'afterDestroy':_0x0fb9('0x4')};function emitEvent(_0x1b79ee){return function(_0x23554a,_0x55928b,_0x2ec063){DashboardEvents[_0x0fb9('0x5')](_0x1b79ee+':'+_0x23554a['id'],_0x23554a);DashboardEvents[_0x0fb9('0x5')](_0x1b79ee,_0x23554a);_0x2ec063(null);};}for(var e in events){if(events[_0x0fb9('0x6')](e)){var event=events[e];Dashboard[_0x0fb9('0x7')](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 44ac12f..715b8ff 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 _0xf46d=['define','Dashboard','dashboards','util','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x2ffc6e,_0x4f84ec){var _0x4be90c=function(_0x163ad9){while(--_0x163ad9){_0x2ffc6e['push'](_0x2ffc6e['shift']());}};_0x4be90c(++_0x4f84ec);}(_0xf46d,0x125));var _0xdf46=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xf46d[_0x313c96];return _0x522f53;};'use strict';var _=require('lodash');var util=require(_0xdf46('0x0'));var logger=require(_0xdf46('0x1'))(_0xdf46('0x2'));var moment=require(_0xdf46('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf46('0x4'));var rimraf=require('rimraf');var config=require(_0xdf46('0x5'));var attributes=require('./dashboard.attributes');module[_0xdf46('0x6')]=function(_0x590988,_0x365cde){return _0x590988[_0xdf46('0x7')](_0xdf46('0x8'),attributes,{'tableName':_0xdf46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabae=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xabae,0x1a1));var _0xeaba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xabae[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeaba('0x0'))(_0xeaba('0x1'));var moment=require(_0xeaba('0x2'));var BPromise=require(_0xeaba('0x3'));var rp=require(_0xeaba('0x4'));var fs=require('fs');var path=require(_0xeaba('0x5'));var rimraf=require(_0xeaba('0x6'));var config=require(_0xeaba('0x7'));var attributes=require(_0xeaba('0x8'));module[_0xeaba('0x9')]=function(_0xe39f39,_0x37903a){return _0xe39f39['define'](_0xeaba('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 6c58a65..cac7a4d 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 _0x0cdf=['lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x13f373,_0x58251e){var _0x11c5cb=function(_0x47afab){while(--_0x47afab){_0x13f373['push'](_0x13f373['shift']());}};_0x11c5cb(++_0x58251e);}(_0x0cdf,0x113));var _0xf0cd=function(_0x298587,_0xee1d84){_0x298587=_0x298587-0x0;var _0x412f9a=_0x0cdf[_0x298587];return _0x412f9a;};'use strict';var _=require(_0xf0cd('0x0'));var util=require(_0xf0cd('0x1'));var moment=require(_0xf0cd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0cd('0x3'));var fs=require('fs');var Redis=require(_0xf0cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf0cd('0x5'));var config=require(_0xf0cd('0x6'));var jayson=require(_0xf0cd('0x7'));var client=jayson[_0xf0cd('0x8')]['http']({'port':0x232a});config[_0xf0cd('0x9')]=_[_0xf0cd('0xa')](config[_0xf0cd('0x9')],{'host':_0xf0cd('0xb'),'port':0x18eb});var socket=require(_0xf0cd('0xc'))(new Redis(config[_0xf0cd('0x9')]));require(_0xf0cd('0xd'))[_0xf0cd('0xe')](socket);function respondWithRpcPromise(_0x207340,_0x4cd61a,_0x5c14a1){return new BPromise(function(_0x5b17f4,_0xf53941){return client[_0xf0cd('0xf')](_0x207340,_0x5c14a1)['then'](function(_0x32a113){logger['info'](_0xf0cd('0x10'),_0x4cd61a,_0xf0cd('0x11'));logger[_0xf0cd('0x12')](_0xf0cd('0x13'),_0x4cd61a,_0xf0cd('0x11'),JSON['stringify'](_0x32a113));if(_0x32a113[_0xf0cd('0x14')]){if(_0x32a113['error']['code']===0x1f4){logger['error'](_0xf0cd('0x10'),_0x4cd61a,_0x32a113[_0xf0cd('0x14')][_0xf0cd('0x15')]);return _0xf53941(_0x32a113['error'][_0xf0cd('0x15')]);}logger[_0xf0cd('0x14')](_0xf0cd('0x10'),_0x4cd61a,_0x32a113[_0xf0cd('0x14')][_0xf0cd('0x15')]);return _0x5b17f4(_0x32a113['error'][_0xf0cd('0x15')]);}else{logger[_0xf0cd('0x16')]('Dashboard,\x20%s,\x20%s',_0x4cd61a,'request\x20sent');_0x5b17f4(_0x32a113[_0xf0cd('0x17')][_0xf0cd('0x15')]);}})[_0xf0cd('0x18')](function(_0x390938){logger[_0xf0cd('0x14')]('Dashboard,\x20%s,\x20%s',_0x4cd61a,_0x390938);_0xf53941(_0x390938);});});} \ No newline at end of file +var _0x8308=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0x8308,0x10f));var _0x8830=function(_0x52fa1e,_0x39a40f){_0x52fa1e=_0x52fa1e-0x0;var _0x26849d=_0x8308[_0x52fa1e];return _0x26849d;};'use strict';var _=require(_0x8830('0x0'));var util=require(_0x8830('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8830('0x2'));var fs=require('fs');var Redis=require(_0x8830('0x3'));var db=require(_0x8830('0x4'))['db'];var utils=require(_0x8830('0x5'));var logger=require(_0x8830('0x6'))(_0x8830('0x7'));var config=require(_0x8830('0x8'));var jayson=require(_0x8830('0x9'));var client=jayson[_0x8830('0xa')]['http']({'port':0x232a});config[_0x8830('0xb')]=_[_0x8830('0xc')](config[_0x8830('0xb')],{'host':_0x8830('0xd'),'port':0x18eb});var socket=require(_0x8830('0xe'))(new Redis(config[_0x8830('0xb')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x2b61b8,_0x3d88f7,_0xb39d1d){return new BPromise(function(_0x2cec6b,_0x5c51d3){return client[_0x8830('0xf')](_0x2b61b8,_0xb39d1d)['then'](function(_0x2e217f){logger['info'](_0x8830('0x10'),_0x3d88f7,_0x8830('0x11'));logger['debug'](_0x8830('0x12'),_0x3d88f7,_0x8830('0x11'),JSON[_0x8830('0x13')](_0x2e217f));if(_0x2e217f[_0x8830('0x14')]){if(_0x2e217f[_0x8830('0x14')]['code']===0x1f4){logger[_0x8830('0x14')](_0x8830('0x10'),_0x3d88f7,_0x2e217f[_0x8830('0x14')]['message']);return _0x5c51d3(_0x2e217f[_0x8830('0x14')]['message']);}logger[_0x8830('0x14')](_0x8830('0x10'),_0x3d88f7,_0x2e217f[_0x8830('0x14')][_0x8830('0x15')]);return _0x2cec6b(_0x2e217f[_0x8830('0x14')][_0x8830('0x15')]);}else{logger[_0x8830('0x16')](_0x8830('0x10'),_0x3d88f7,_0x8830('0x11'));_0x2cec6b(_0x2e217f[_0x8830('0x17')][_0x8830('0x15')]);}})[_0x8830('0x18')](function(_0x3b8ebf){logger[_0x8830('0x14')](_0x8830('0x10'),_0x3d88f7,_0x3b8ebf);_0x5c51d3(_0x3b8ebf);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9b968ae..5c086f1 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 _0xfb02=['dashboard:','save','remove','update','register','length'];(function(_0xc50503,_0x52bf14){var _0x5de5c5=function(_0x1c94a6){while(--_0x1c94a6){_0xc50503['push'](_0xc50503['shift']());}};_0x5de5c5(++_0x52bf14);}(_0xfb02,0x103));var _0x2fb0=function(_0x59cd25,_0x55b586){_0x59cd25=_0x59cd25-0x0;var _0x1efadf=_0xfb02[_0x59cd25];return _0x1efadf;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2fb0('0x0'),_0x2fb0('0x1'),_0x2fb0('0x2')];function createListener(_0x5bcde9,_0x5227dc){return function(_0x173104){_0x5227dc['emit'](_0x5bcde9,_0x173104);};}function removeListener(_0x3e8abf,_0x1ebdd7){return function(){DashboardEvents['removeListener'](_0x3e8abf,_0x1ebdd7);};}exports[_0x2fb0('0x3')]=function(_0x42770b){for(var _0x48c6ab=0x0,_0x54aff2=events[_0x2fb0('0x4')];_0x48c6ab<_0x54aff2;_0x48c6ab++){var _0x273769=events[_0x48c6ab];var _0x14086a=createListener(_0x2fb0('0x5')+_0x273769,_0x42770b);DashboardEvents['on'](_0x273769,_0x14086a);}}; \ No newline at end of file +var _0x5453=['removeListener','length','save','remove','emit'];(function(_0x1d06f5,_0x7c484){var _0x4d92d1=function(_0x19c39a){while(--_0x19c39a){_0x1d06f5['push'](_0x1d06f5['shift']());}};_0x4d92d1(++_0x7c484);}(_0x5453,0x115));var _0x3545=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5453[_0x3e5086];return _0xfeb102;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3545('0x0'),_0x3545('0x1'),'update'];function createListener(_0x359e53,_0x37f4d6){return function(_0x2589e9){_0x37f4d6[_0x3545('0x2')](_0x359e53,_0x2589e9);};}function removeListener(_0x1eb112,_0x22b84f){return function(){DashboardEvents[_0x3545('0x3')](_0x1eb112,_0x22b84f);};}exports['register']=function(_0x1a7a7b){for(var _0x477752=0x0,_0x3e9788=events[_0x3545('0x4')];_0x477752<_0x3e9788;_0x477752++){var _0x6fa15f=events[_0x477752];var _0xa2becd=createListener('dashboard:'+_0x6fa15f,_0x1a7a7b);DashboardEvents['on'](_0x6fa15f,_0xa2becd);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 30414db..8c0c6b0 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 _0xbd23=['getItems','create','post','/:id/clone','clone','/:id/items','addItem','put','update','delete','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd23,0x1c3));var _0x3bd2=function(_0x53a970,_0x1acd0e){_0x53a970=_0x53a970-0x0;var _0x3214f9=_0xbd23[_0x53a970];return _0x3214f9;};'use strict';var multer=require('multer');var util=require(_0x3bd2('0x0'));var path=require('path');var timeout=require(_0x3bd2('0x1'));var express=require(_0x3bd2('0x2'));var router=express[_0x3bd2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3bd2('0x4'));var config=require(_0x3bd2('0x5'));var controller=require('./dashboard.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3bd2('0x6')]);router[_0x3bd2('0x7')](_0x3bd2('0x8'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0xa')]);router['get']('/:id/items',auth['isAuthenticated'](),controller[_0x3bd2('0xb')]);router['post']('/',auth[_0x3bd2('0x9')](),controller[_0x3bd2('0xc')]);router[_0x3bd2('0xd')](_0x3bd2('0xe'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0xf')]);router[_0x3bd2('0xd')](_0x3bd2('0x10'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0x11')]);router[_0x3bd2('0x12')](_0x3bd2('0x8'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0x13')]);router[_0x3bd2('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcc21=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getItems','create','post','/:id/clone','clone','addItem','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x112638,_0x5e7b60){var _0x479b88=function(_0x61860){while(--_0x61860){_0x112638['push'](_0x112638['shift']());}};_0x479b88(++_0x5e7b60);}(_0xcc21,0x124));var _0x1cc2=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0xcc21[_0x4347ec];return _0x4c8314;};'use strict';var multer=require(_0x1cc2('0x0'));var util=require(_0x1cc2('0x1'));var path=require(_0x1cc2('0x2'));var timeout=require(_0x1cc2('0x3'));var express=require(_0x1cc2('0x4'));var router=express[_0x1cc2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1cc2('0x6'));var interaction=require(_0x1cc2('0x7'));var config=require(_0x1cc2('0x8'));var controller=require('./dashboard.controller');router[_0x1cc2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x1cc2('0xa')](),controller[_0x1cc2('0xb')]);router[_0x1cc2('0x9')]('/:id/items',auth[_0x1cc2('0xa')](),controller[_0x1cc2('0xc')]);router['post']('/',auth[_0x1cc2('0xa')](),controller[_0x1cc2('0xd')]);router[_0x1cc2('0xe')](_0x1cc2('0xf'),auth[_0x1cc2('0xa')](),controller[_0x1cc2('0x10')]);router[_0x1cc2('0xe')]('/:id/items',auth[_0x1cc2('0xa')](),controller[_0x1cc2('0x11')]);router[_0x1cc2('0x12')](_0x1cc2('0x13'),auth[_0x1cc2('0xa')](),controller['update']);router[_0x1cc2('0x14')](_0x1cc2('0x13'),auth[_0x1cc2('0xa')](),controller[_0x1cc2('0x15')]);module[_0x1cc2('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index acebf4e..02a1280 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 _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x19a4a7,_0xb76a5b){var _0x330bb9=function(_0x597af4){while(--_0x597af4){_0x19a4a7['push'](_0x19a4a7['shift']());}};_0x330bb9(++_0xb76a5b);}(_0x5d58,0x187));var _0x85d5=function(_0x3cc268,_0x1be968){_0x3cc268=_0x3cc268-0x0;var _0x3ccd7a=_0x5d58[_0x3cc268];return _0x3ccd7a;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x486394,_0x13bea7){var _0x1421fb=function(_0x7ddafa){while(--_0x7ddafa){_0x486394['push'](_0x486394['shift']());}};_0x1421fb(++_0x13bea7);}(_0x5d58,0x187));var _0x85d5=function(_0x500a96,_0x286945){_0x500a96=_0x500a96-0x0;var _0x463e96=_0x5d58[_0x500a96];return _0x463e96;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index b1d1629..9704e71 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 _0xdbb9=['rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','params','catch','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrWhatsappAccounts','web-report','reportType','type','attrReport','attrRefresh','error','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','show','model','DashboardItem'];(function(_0x5da059,_0x22a596){var _0x4f5e90=function(_0xb40d07){while(--_0xb40d07){_0x5da059['push'](_0x5da059['shift']());}};_0x4f5e90(++_0x22a596);}(_0xdbb9,0xf9));var _0x9dbb=function(_0xff99ea,_0x63915){_0xff99ea=_0xff99ea-0x0;var _0x47a615=_0xdbb9[_0xff99ea];return _0x47a615;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];config[_0x9dbb('0x18')]=_[_0x9dbb('0x19')](config[_0x9dbb('0x18')],{'host':_0x9dbb('0x1a'),'port':0x18eb});var socket=require(_0x9dbb('0x1b'))(new Redis(config[_0x9dbb('0x18')]));require(_0x9dbb('0x1c'))[_0x9dbb('0x1d')](socket);function respondWithStatusCode(_0x24b20b,_0x73add3){_0x73add3=_0x73add3||0xcc;return function(_0x45f944){if(_0x45f944){return _0x24b20b[_0x9dbb('0x1e')](_0x73add3);}return _0x24b20b['status'](_0x73add3)[_0x9dbb('0x1f')]();};}function respondWithResult(_0x30add1,_0x1acb08){_0x1acb08=_0x1acb08||0xc8;return function(_0x3677a6){if(_0x3677a6){return _0x30add1[_0x9dbb('0x20')](_0x1acb08)['json'](_0x3677a6);}};}function respondWithFilteredResult(_0x382d61,_0x21af5a){return function(_0x2383cf){if(_0x2383cf){var _0x20fb99=typeof _0x21af5a[_0x9dbb('0x21')]==='undefined'&&typeof _0x21af5a[_0x9dbb('0x22')]==='undefined';var _0x3de435=_0x2383cf['count'];var _0x5b0cde=_0x20fb99?0x0:_0x21af5a['offset'];var _0x259cb6=_0x20fb99?_0x2383cf[_0x9dbb('0x23')]:_0x21af5a[_0x9dbb('0x21')]+_0x21af5a['limit'];var _0x50e5e3;if(_0x259cb6>=_0x3de435){_0x259cb6=_0x3de435;_0x50e5e3=0xc8;}else{_0x50e5e3=0xce;}_0x382d61['status'](_0x50e5e3);return _0x382d61[_0x9dbb('0x24')](_0x9dbb('0x25'),_0x5b0cde+'-'+_0x259cb6+'/'+_0x3de435)['json'](_0x2383cf);}return null;};}function patchUpdates(_0x4a07ef){return function(_0x4cb10e){try{jsonpatch[_0x9dbb('0x26')](_0x4cb10e,_0x4a07ef,!![]);}catch(_0x245d12){return BPromise[_0x9dbb('0x27')](_0x245d12);}return _0x4cb10e['save']();};}function saveUpdates(_0x1f30ec,_0x130d84){return function(_0x22608d){if(_0x22608d){return _0x22608d[_0x9dbb('0x28')](_0x1f30ec)[_0x9dbb('0x29')](function(_0x3e51ca){return _0x3e51ca;});}return null;};}function removeEntity(_0x668f7b,_0x187486){return function(_0x11e8d9){if(_0x11e8d9){return _0x11e8d9[_0x9dbb('0x2a')]()[_0x9dbb('0x29')](function(){_0x668f7b[_0x9dbb('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7077,_0x5aead8){return function(_0x38c36d){if(!_0x38c36d){_0x1c7077[_0x9dbb('0x1e')](0x194);}return _0x38c36d;};}function handleError(_0x4fc354,_0xbcdade){_0xbcdade=_0xbcdade||0x1f4;return function(_0x4ebd57){logger['error'](_0x4ebd57['stack']);if(_0x4ebd57[_0x9dbb('0x2b')]){delete _0x4ebd57[_0x9dbb('0x2b')];}_0x4fc354['status'](_0xbcdade)[_0x9dbb('0x2c')](_0x4ebd57);};}exports[_0x9dbb('0x2d')]=function(_0x57e6e7,_0x71692a){var _0xd4d388={'raw':![],'where':{'id':_0x57e6e7['params']['id']}},_0x3a8f61={};_0x3a8f61[_0x9dbb('0x2e')]=_['keys'](db[_0x9dbb('0x2f')][_0x9dbb('0x30')]);_0x3a8f61[_0x9dbb('0x31')]=_[_0x9dbb('0x32')](_0x57e6e7[_0x9dbb('0x31')]);_0x3a8f61[_0x9dbb('0x33')]=_[_0x9dbb('0x34')](_0x3a8f61[_0x9dbb('0x2e')],_0x3a8f61[_0x9dbb('0x31')]);_0xd4d388[_0x9dbb('0x35')]=_[_0x9dbb('0x34')](_0x3a8f61['model'],qs[_0x9dbb('0x36')](_0x57e6e7[_0x9dbb('0x31')][_0x9dbb('0x36')]));_0xd4d388[_0x9dbb('0x35')]=_0xd4d388[_0x9dbb('0x35')][_0x9dbb('0x37')]?_0xd4d388[_0x9dbb('0x35')]:_0x3a8f61[_0x9dbb('0x2e')];if(_0x57e6e7[_0x9dbb('0x31')][_0x9dbb('0x38')]){_0xd4d388[_0x9dbb('0x39')]=[{'all':!![]}];}_0xd4d388=_[_0x9dbb('0x3a')]({},_0xd4d388,_0x57e6e7[_0x9dbb('0x3b')]);return db[_0x9dbb('0x2f')][_0x9dbb('0x3c')](_0xd4d388)[_0x9dbb('0x29')](handleEntityNotFound(_0x71692a,null))[_0x9dbb('0x29')](respondWithResult(_0x71692a,null))['catch'](handleError(_0x71692a,null));};exports[_0x9dbb('0x2a')]=function(_0x315755,_0xffdaaf){return db['DashboardItem'][_0x9dbb('0x3c')]({'where':{'id':_0x315755[_0x9dbb('0x3d')]['id']}})[_0x9dbb('0x29')](handleEntityNotFound(_0xffdaaf,null))[_0x9dbb('0x29')](removeEntity(_0xffdaaf,null))[_0x9dbb('0x3e')](handleError(_0xffdaaf,null));};function widgetAttributes(_0x3f9a15){try{switch(_0x3f9a15['type']){case _0x9dbb('0x3f'):return[{'name':'attrUrl','value':_0x3f9a15[_0x9dbb('0x40')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0]['value']:undefined)||_0x9dbb('0x42')}];case'custom':return[{'name':_0x9dbb('0x43'),'value':_0x3f9a15['attrPath']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0][_0x9dbb('0x44')]:undefined)||''}];case _0x9dbb('0x45'):return[{'name':'attrHourFormat','value':_0x3f9a15[_0x9dbb('0x46')]||(_0x3f9a15['attrs']&&_0x3f9a15[_0x9dbb('0x41')][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0][_0x9dbb('0x44')]:undefined)||_0x9dbb('0x47')},{'name':_0x9dbb('0x48'),'value':_0x3f9a15[_0x9dbb('0x48')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x1]?_0x3f9a15[_0x9dbb('0x41')][0x1]['value']:undefined)||_0x9dbb('0x49')},{'name':_0x9dbb('0x4a'),'value':_0x3f9a15[_0x9dbb('0x4a')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x2]?_0x3f9a15[_0x9dbb('0x41')][0x2]['value']:undefined)||0xc}];case _0x9dbb('0x4b'):return[{'name':'attrMetric','value':_0x3f9a15[_0x9dbb('0x4c')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x0]?_0x3f9a15['attrs'][0x0][_0x9dbb('0x44')]:undefined)||_0x9dbb('0x4d')},{'name':_0x9dbb('0x4e'),'value':_0x3f9a15[_0x9dbb('0x4e')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x1]?_0x3f9a15[_0x9dbb('0x41')][0x1][_0x9dbb('0x44')]:undefined)||[]},{'name':_0x9dbb('0x4a'),'value':_0x3f9a15['attrFontSize']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x2]?_0x3f9a15[_0x9dbb('0x41')][0x2][_0x9dbb('0x44')]:undefined)||0x14},{'name':_0x9dbb('0x4f'),'value':_0x3f9a15[_0x9dbb('0x4f')]||(_0x3f9a15['attrs']&&_0x3f9a15[_0x9dbb('0x41')][0x3]?_0x3f9a15['attrs'][0x3]['value']:undefined)||_0x9dbb('0x50')},{'name':_0x9dbb('0x51'),'value':_0x3f9a15[_0x9dbb('0x51')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x4]?_0x3f9a15[_0x9dbb('0x41')][0x4]['value']:undefined)||''},{'name':_0x9dbb('0x52'),'value':_0x3f9a15['attrFaxAccounts']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x5]?_0x3f9a15[_0x9dbb('0x41')][0x5][_0x9dbb('0x44')]:undefined)||''},{'name':_0x9dbb('0x53'),'value':_0x3f9a15[_0x9dbb('0x53')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x6]?_0x3f9a15['attrs'][0x6][_0x9dbb('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3f9a15[_0x9dbb('0x54')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x7]?_0x3f9a15[_0x9dbb('0x41')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3f9a15['attrWhatsappAccounts']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x8]?_0x3f9a15['attrs'][0x8][_0x9dbb('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3f9a15[_0x9dbb('0x55')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x9]?_0x3f9a15[_0x9dbb('0x41')][0x9][_0x9dbb('0x44')]:undefined)||''}];case _0x9dbb('0x56'):case'pie-chart':return[{'name':'attrSerie1','value':_0x3f9a15[_0x9dbb('0x57')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0][_0x9dbb('0x44')]:undefined)||_0x9dbb('0x4d')},{'name':_0x9dbb('0x58'),'value':_0x3f9a15['attrSerie2']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x1]?_0x3f9a15[_0x9dbb('0x41')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x3f9a15['attrSerie3']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x2]?_0x3f9a15[_0x9dbb('0x41')][0x2][_0x9dbb('0x44')]:undefined)||null},{'name':_0x9dbb('0x4e'),'value':_0x3f9a15[_0x9dbb('0x4e')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x3]?_0x3f9a15[_0x9dbb('0x41')][0x3][_0x9dbb('0x44')]:undefined)||[]},{'name':_0x9dbb('0x4f'),'value':_0x3f9a15[_0x9dbb('0x4f')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x4]?_0x3f9a15[_0x9dbb('0x41')][0x4][_0x9dbb('0x44')]:undefined)||_0x9dbb('0x50')},{'name':_0x9dbb('0x51'),'value':_0x3f9a15['attrEmailAccounts']||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x5]?_0x3f9a15[_0x9dbb('0x41')][0x5]['value']:undefined)||''},{'name':_0x9dbb('0x52'),'value':_0x3f9a15[_0x9dbb('0x52')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x6]?_0x3f9a15['attrs'][0x6][_0x9dbb('0x44')]:undefined)||''},{'name':_0x9dbb('0x53'),'value':_0x3f9a15[_0x9dbb('0x53')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x7]?_0x3f9a15['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3f9a15[_0x9dbb('0x54')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x8]?_0x3f9a15[_0x9dbb('0x41')][0x8]['value']:undefined)||''},{'name':_0x9dbb('0x59'),'value':_0x3f9a15[_0x9dbb('0x59')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x9]?_0x3f9a15['attrs'][0x9][_0x9dbb('0x44')]:undefined)||''},{'name':_0x9dbb('0x55'),'value':_0x3f9a15[_0x9dbb('0x55')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0xa]?_0x3f9a15[_0x9dbb('0x41')][0xa][_0x9dbb('0x44')]:undefined)||''}];case _0x9dbb('0x5a'):return[{'name':'attrReport','type':_0x3f9a15[_0x9dbb('0x5b')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15[_0x9dbb('0x41')][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0][_0x9dbb('0x5c')]:undefined)||null,'value':_0x3f9a15[_0x9dbb('0x5d')]||(_0x3f9a15['attrs']&&_0x3f9a15[_0x9dbb('0x41')][0x0]?_0x3f9a15[_0x9dbb('0x41')][0x0]['value']:undefined)||null},{'name':_0x9dbb('0x5e'),'value':_0x3f9a15[_0x9dbb('0x5e')]||(_0x3f9a15[_0x9dbb('0x41')]&&_0x3f9a15['attrs'][0x1]?_0x3f9a15[_0x9dbb('0x41')][0x1][_0x9dbb('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x8bf90d){logger[_0x9dbb('0x5f')]('widgetAttributes:\x20%s',JSON[_0x9dbb('0x60')](_0x8bf90d));return[];}}exports[_0x9dbb('0x61')]=function(_0x3b46b9,_0x2546f0){if(_0x3b46b9['body']){_0x3b46b9[_0x9dbb('0x62')][_0x9dbb('0x41')]=widgetAttributes(_0x3b46b9[_0x9dbb('0x62')]);}return db[_0x9dbb('0x2f')][_0x9dbb('0x61')](_0x3b46b9['body'],{})[_0x9dbb('0x29')](respondWithResult(_0x2546f0,0xc9))[_0x9dbb('0x3e')](handleError(_0x2546f0,null));};exports[_0x9dbb('0x28')]=function(_0x579aa5,_0x26f6c8){if(_0x579aa5[_0x9dbb('0x62')]['id']){delete _0x579aa5[_0x9dbb('0x62')]['id'];}_0x579aa5[_0x9dbb('0x62')][_0x9dbb('0x41')]=widgetAttributes(_0x579aa5['body']);return db[_0x9dbb('0x2f')][_0x9dbb('0x3c')]({'where':{'id':_0x579aa5['params']['id']}})[_0x9dbb('0x29')](handleEntityNotFound(_0x26f6c8,null))[_0x9dbb('0x29')](saveUpdates(_0x579aa5['body'],null))[_0x9dbb('0x29')](respondWithResult(_0x26f6c8,null))['catch'](handleError(_0x26f6c8,null));}; \ No newline at end of file +var _0x2a07=['attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','model','includeAll','include','merge','options','catch','find','type','iframe','attrUrl','attrs','value','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x66823a,_0x4133d0){var _0x2b39d4=function(_0x1c7baa){while(--_0x1c7baa){_0x66823a['push'](_0x66823a['shift']());}};_0x2b39d4(++_0x4133d0);}(_0x2a07,0x74));var _0x72a0=function(_0x6c225b,_0x4de56c){_0x6c225b=_0x6c225b-0x0;var _0x268839=_0x2a07[_0x6c225b];return _0x268839;};'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'];config[_0x72a0('0x1c')]=_[_0x72a0('0x1d')](config[_0x72a0('0x1c')],{'host':_0x72a0('0x1e'),'port':0x18eb});var socket=require(_0x72a0('0x1f'))(new Redis(config[_0x72a0('0x1c')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0xe103dc,_0x3cd89f){_0x3cd89f=_0x3cd89f||0xcc;return function(_0x19eaf9){if(_0x19eaf9){return _0xe103dc[_0x72a0('0x20')](_0x3cd89f);}return _0xe103dc[_0x72a0('0x21')](_0x3cd89f)[_0x72a0('0x22')]();};}function respondWithResult(_0x4ab55e,_0x30248e){_0x30248e=_0x30248e||0xc8;return function(_0x2e7552){if(_0x2e7552){return _0x4ab55e[_0x72a0('0x21')](_0x30248e)[_0x72a0('0x23')](_0x2e7552);}};}function respondWithFilteredResult(_0x2d1e95,_0x54495e){return function(_0x100d8f){if(_0x100d8f){var _0x42e9ec=typeof _0x54495e[_0x72a0('0x24')]==='undefined'&&typeof _0x54495e[_0x72a0('0x25')]===_0x72a0('0x26');var _0x30899b=_0x100d8f[_0x72a0('0x27')];var _0x5437df=_0x42e9ec?0x0:_0x54495e[_0x72a0('0x24')];var _0x5b8f2c=_0x42e9ec?_0x100d8f[_0x72a0('0x27')]:_0x54495e[_0x72a0('0x24')]+_0x54495e[_0x72a0('0x25')];var _0x5c7479;if(_0x5b8f2c>=_0x30899b){_0x5b8f2c=_0x30899b;_0x5c7479=0xc8;}else{_0x5c7479=0xce;}_0x2d1e95[_0x72a0('0x21')](_0x5c7479);return _0x2d1e95[_0x72a0('0x28')](_0x72a0('0x29'),_0x5437df+'-'+_0x5b8f2c+'/'+_0x30899b)[_0x72a0('0x23')](_0x100d8f);}return null;};}function patchUpdates(_0x5d6145){return function(_0x38a7ba){try{jsonpatch[_0x72a0('0x2a')](_0x38a7ba,_0x5d6145,!![]);}catch(_0x1ddd54){return BPromise[_0x72a0('0x2b')](_0x1ddd54);}return _0x38a7ba[_0x72a0('0x2c')]();};}function saveUpdates(_0x174b1b,_0x5c4daf){return function(_0x4dd1a6){if(_0x4dd1a6){return _0x4dd1a6[_0x72a0('0x2d')](_0x174b1b)[_0x72a0('0x2e')](function(_0x123df4){return _0x123df4;});}return null;};}function removeEntity(_0x1504ed,_0xf5cb49){return function(_0x27ca5a){if(_0x27ca5a){return _0x27ca5a[_0x72a0('0x2f')]()[_0x72a0('0x2e')](function(){_0x1504ed[_0x72a0('0x21')](0xcc)[_0x72a0('0x22')]();});}};}function handleEntityNotFound(_0x4f9718,_0x304b92){return function(_0x553641){if(!_0x553641){_0x4f9718[_0x72a0('0x20')](0x194);}return _0x553641;};}function handleError(_0x2928f6,_0x1773ea){_0x1773ea=_0x1773ea||0x1f4;return function(_0x177a3a){logger[_0x72a0('0x30')](_0x177a3a[_0x72a0('0x31')]);if(_0x177a3a[_0x72a0('0x32')]){delete _0x177a3a[_0x72a0('0x32')];}_0x2928f6['status'](_0x1773ea)[_0x72a0('0x33')](_0x177a3a);};}exports[_0x72a0('0x34')]=function(_0x39136d,_0xfbe9b3){var _0x13c04={'raw':![],'where':{'id':_0x39136d[_0x72a0('0x35')]['id']}},_0x19e783={};_0x19e783['model']=_[_0x72a0('0x36')](db[_0x72a0('0x37')][_0x72a0('0x38')]);_0x19e783[_0x72a0('0x39')]=_[_0x72a0('0x36')](_0x39136d[_0x72a0('0x39')]);_0x19e783[_0x72a0('0x3a')]=_[_0x72a0('0x3b')](_0x19e783['model'],_0x19e783[_0x72a0('0x39')]);_0x13c04[_0x72a0('0x3c')]=_[_0x72a0('0x3b')](_0x19e783['model'],qs[_0x72a0('0x3d')](_0x39136d['query'][_0x72a0('0x3d')]));_0x13c04[_0x72a0('0x3c')]=_0x13c04[_0x72a0('0x3c')][_0x72a0('0x3e')]?_0x13c04[_0x72a0('0x3c')]:_0x19e783[_0x72a0('0x3f')];if(_0x39136d[_0x72a0('0x39')][_0x72a0('0x40')]){_0x13c04[_0x72a0('0x41')]=[{'all':!![]}];}_0x13c04=_[_0x72a0('0x42')]({},_0x13c04,_0x39136d[_0x72a0('0x43')]);return db[_0x72a0('0x37')]['find'](_0x13c04)[_0x72a0('0x2e')](handleEntityNotFound(_0xfbe9b3,null))['then'](respondWithResult(_0xfbe9b3,null))[_0x72a0('0x44')](handleError(_0xfbe9b3,null));};exports[_0x72a0('0x2f')]=function(_0x446222,_0x1a9597){return db[_0x72a0('0x37')][_0x72a0('0x45')]({'where':{'id':_0x446222[_0x72a0('0x35')]['id']}})[_0x72a0('0x2e')](handleEntityNotFound(_0x1a9597,null))[_0x72a0('0x2e')](removeEntity(_0x1a9597,null))['catch'](handleError(_0x1a9597,null));};function widgetAttributes(_0x4a973a){try{switch(_0x4a973a[_0x72a0('0x46')]){case _0x72a0('0x47'):return[{'name':_0x72a0('0x48'),'value':_0x4a973a[_0x72a0('0x48')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x0]?_0x4a973a[_0x72a0('0x49')][0x0][_0x72a0('0x4a')]:undefined)||'https://'}];case _0x72a0('0x4b'):return[{'name':'attrPath','value':_0x4a973a['attrPath']||(_0x4a973a['attrs']&&_0x4a973a[_0x72a0('0x49')][0x0]?_0x4a973a['attrs'][0x0][_0x72a0('0x4a')]:undefined)||''}];case _0x72a0('0x4c'):return[{'name':_0x72a0('0x4d'),'value':_0x4a973a[_0x72a0('0x4d')]||(_0x4a973a['attrs']&&_0x4a973a['attrs'][0x0]?_0x4a973a['attrs'][0x0]['value']:undefined)||_0x72a0('0x4e')},{'name':_0x72a0('0x4f'),'value':_0x4a973a['attrTimezone']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x1]?_0x4a973a['attrs'][0x1][_0x72a0('0x4a')]:undefined)||_0x72a0('0x50')},{'name':_0x72a0('0x51'),'value':_0x4a973a[_0x72a0('0x51')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x2]?_0x4a973a['attrs'][0x2][_0x72a0('0x4a')]:undefined)||0xc}];case'counter':return[{'name':_0x72a0('0x52'),'value':_0x4a973a['attrMetric']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x0]?_0x4a973a['attrs'][0x0][_0x72a0('0x4a')]:undefined)||'total'},{'name':_0x72a0('0x53'),'value':_0x4a973a[_0x72a0('0x53')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x1]?_0x4a973a[_0x72a0('0x49')][0x1][_0x72a0('0x4a')]:undefined)||[]},{'name':_0x72a0('0x51'),'value':_0x4a973a['attrFontSize']||(_0x4a973a['attrs']&&_0x4a973a[_0x72a0('0x49')][0x2]?_0x4a973a['attrs'][0x2][_0x72a0('0x4a')]:undefined)||0x14},{'name':_0x72a0('0x54'),'value':_0x4a973a[_0x72a0('0x54')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x3]?_0x4a973a[_0x72a0('0x49')][0x3][_0x72a0('0x4a')]:undefined)||_0x72a0('0x55')},{'name':_0x72a0('0x56'),'value':_0x4a973a['attrEmailAccounts']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x4]?_0x4a973a[_0x72a0('0x49')][0x4][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x57'),'value':_0x4a973a[_0x72a0('0x57')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x5]?_0x4a973a['attrs'][0x5][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x58'),'value':_0x4a973a[_0x72a0('0x58')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x6]?_0x4a973a[_0x72a0('0x49')][0x6][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x59'),'value':_0x4a973a[_0x72a0('0x59')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x7]?_0x4a973a[_0x72a0('0x49')][0x7][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x5a'),'value':_0x4a973a[_0x72a0('0x5a')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x8]?_0x4a973a[_0x72a0('0x49')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x4a973a[_0x72a0('0x5b')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x9]?_0x4a973a[_0x72a0('0x49')][0x9][_0x72a0('0x4a')]:undefined)||''}];case'multibar-chart':case _0x72a0('0x5c'):return[{'name':_0x72a0('0x5d'),'value':_0x4a973a['attrSerie1']||(_0x4a973a['attrs']&&_0x4a973a[_0x72a0('0x49')][0x0]?_0x4a973a[_0x72a0('0x49')][0x0][_0x72a0('0x4a')]:undefined)||_0x72a0('0x5e')},{'name':_0x72a0('0x5f'),'value':_0x4a973a[_0x72a0('0x5f')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x1]?_0x4a973a['attrs'][0x1][_0x72a0('0x4a')]:undefined)||null},{'name':'attrSerie3','value':_0x4a973a['attrSerie3']||(_0x4a973a['attrs']&&_0x4a973a[_0x72a0('0x49')][0x2]?_0x4a973a[_0x72a0('0x49')][0x2]['value']:undefined)||null},{'name':_0x72a0('0x53'),'value':_0x4a973a['attrVoiceQueues']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x3]?_0x4a973a['attrs'][0x3][_0x72a0('0x4a')]:undefined)||[]},{'name':_0x72a0('0x54'),'value':_0x4a973a['attrChannel']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x4]?_0x4a973a[_0x72a0('0x49')][0x4]['value']:undefined)||'voice'},{'name':_0x72a0('0x56'),'value':_0x4a973a[_0x72a0('0x56')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x5]?_0x4a973a['attrs'][0x5][_0x72a0('0x4a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x4a973a[_0x72a0('0x57')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x6]?_0x4a973a[_0x72a0('0x49')][0x6][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x58'),'value':_0x4a973a[_0x72a0('0x58')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x7]?_0x4a973a[_0x72a0('0x49')][0x7][_0x72a0('0x4a')]:undefined)||''},{'name':_0x72a0('0x59'),'value':_0x4a973a['attrOpenchannelAccounts']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x8]?_0x4a973a['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4a973a[_0x72a0('0x5a')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a[_0x72a0('0x49')][0x9]?_0x4a973a['attrs'][0x9][_0x72a0('0x4a')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4a973a[_0x72a0('0x5b')]||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0xa]?_0x4a973a[_0x72a0('0x49')][0xa][_0x72a0('0x4a')]:undefined)||''}];case _0x72a0('0x60'):return[{'name':_0x72a0('0x61'),'type':_0x4a973a['reportType']||(_0x4a973a[_0x72a0('0x49')]&&_0x4a973a['attrs'][0x0]?_0x4a973a[_0x72a0('0x49')][0x0][_0x72a0('0x46')]:undefined)||null,'value':_0x4a973a[_0x72a0('0x61')]||(_0x4a973a['attrs']&&_0x4a973a[_0x72a0('0x49')][0x0]?_0x4a973a[_0x72a0('0x49')][0x0][_0x72a0('0x4a')]:undefined)||null},{'name':_0x72a0('0x62'),'value':_0x4a973a[_0x72a0('0x62')]||(_0x4a973a['attrs']&&_0x4a973a['attrs'][0x1]?_0x4a973a[_0x72a0('0x49')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x421c35){logger['error'](_0x72a0('0x63'),JSON[_0x72a0('0x64')](_0x421c35));return[];}}exports['create']=function(_0x1cfd1d,_0x1b960e){if(_0x1cfd1d[_0x72a0('0x65')]){_0x1cfd1d['body'][_0x72a0('0x49')]=widgetAttributes(_0x1cfd1d['body']);}return db[_0x72a0('0x37')][_0x72a0('0x66')](_0x1cfd1d['body'],{})[_0x72a0('0x2e')](respondWithResult(_0x1b960e,0xc9))['catch'](handleError(_0x1b960e,null));};exports['update']=function(_0x5142de,_0x28969a){if(_0x5142de['body']['id']){delete _0x5142de[_0x72a0('0x65')]['id'];}_0x5142de['body'][_0x72a0('0x49')]=widgetAttributes(_0x5142de[_0x72a0('0x65')]);return db[_0x72a0('0x37')]['find']({'where':{'id':_0x5142de[_0x72a0('0x35')]['id']}})[_0x72a0('0x2e')](handleEntityNotFound(_0x28969a,null))[_0x72a0('0x2e')](saveUpdates(_0x5142de[_0x72a0('0x65')],null))[_0x72a0('0x2e')](respondWithResult(_0x28969a,null))['catch'](handleError(_0x28969a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4271c9d..3509435 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 _0x5d5c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0xdba458,_0x31b620){var _0x34e47f=function(_0x4df344){while(--_0x4df344){_0xdba458['push'](_0xdba458['shift']());}};_0x34e47f(++_0x31b620);}(_0x5d5c,0xee));var _0xc5d5=function(_0x4e4436,_0x15df65){_0x4e4436=_0x4e4436-0x0;var _0x16ec51=_0x5d5c[_0x4e4436];return _0x16ec51;};'use strict';var EventEmitter=require(_0xc5d5('0x0'));var DashboardItem=require(_0xc5d5('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5d5('0x2'),'afterUpdate':_0xc5d5('0x3'),'afterDestroy':_0xc5d5('0x4')};function emitEvent(_0x399196){return function(_0x42ace6,_0x9cdd47,_0x476351){DashboardItemEvents[_0xc5d5('0x5')](_0x399196+':'+_0x42ace6['id'],_0x42ace6);DashboardItemEvents['emit'](_0x399196,_0x42ace6);_0x476351(null);};}for(var e in events){if(events[_0xc5d5('0x6')](e)){var event=events[e];DashboardItem[_0xc5d5('0x7')](e,emitEvent(event));}}module[_0xc5d5('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x79d6=['emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','update'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x79d6,0x82));var _0x679d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x79d6[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x679d('0x0'))['db'][_0x679d('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x679d('0x2')](0x0);var events={'afterCreate':_0x679d('0x3'),'afterUpdate':_0x679d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46f1a5){return function(_0x35ec48,_0x5adbda,_0x1d0edc){DashboardItemEvents['emit'](_0x46f1a5+':'+_0x35ec48['id'],_0x35ec48);DashboardItemEvents[_0x679d('0x5')](_0x46f1a5,_0x35ec48);_0x1d0edc(null);};}for(var e in events){if(events[_0x679d('0x6')](e)){var event=events[e];DashboardItem[_0x679d('0x7')](e,emitEvent(event));}}module[_0x679d('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 abde35d..e716b2a 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 _0xb3a1=['define','DashboardItem','dashboard_items','../../config/logger','moment','bluebird','request-promise','path','exports'];(function(_0x7c451a,_0x347809){var _0x298eed=function(_0x2edca8){while(--_0x2edca8){_0x7c451a['push'](_0x7c451a['shift']());}};_0x298eed(++_0x347809);}(_0xb3a1,0x1bc));var _0x1b3a=function(_0x330732,_0x232df6){_0x330732=_0x330732-0x0;var _0x2a7d3f=_0xb3a1[_0x330732];return _0x2a7d3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b3a('0x0'))('api');var moment=require(_0x1b3a('0x1'));var BPromise=require(_0x1b3a('0x2'));var rp=require(_0x1b3a('0x3'));var fs=require('fs');var path=require(_0x1b3a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x1b3a('0x5')]=function(_0x368430,_0x196f3c){return _0x368430[_0x1b3a('0x6')](_0x1b3a('0x7'),attributes,{'tableName':_0x1b3a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28c4=['util','../../config/logger','api','moment','path','./dashboardItem.attributes','define','DashboardItem','dashboard_items'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28c4,0x99));var _0x428c=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0x28c4[_0x170cbb];return _0x39fae4;};'use strict';var _=require('lodash');var util=require(_0x428c('0x0'));var logger=require(_0x428c('0x1'))(_0x428c('0x2'));var moment=require(_0x428c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x428c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x428c('0x5'));module['exports']=function(_0x3d09ce,_0x59eb90){return _0x3d09ce[_0x428c('0x6')](_0x428c('0x7'),attributes,{'tableName':_0x428c('0x8'),'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 73739f2..b17d213 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 _0xfdab=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0xfdab,0x82));var _0xbfda=function(_0x20ed7f,_0x49c3e3){_0x20ed7f=_0x20ed7f-0x0;var _0x12fa01=_0xfdab[_0x20ed7f];return _0x12fa01;};'use strict';var _=require(_0xbfda('0x0'));var util=require(_0xbfda('0x1'));var moment=require('moment');var BPromise=require(_0xbfda('0x2'));var rs=require(_0xbfda('0x3'));var fs=require('fs');var Redis=require(_0xbfda('0x4'));var db=require(_0xbfda('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfda('0x6'))(_0xbfda('0x7'));var config=require('../../config/environment');var jayson=require(_0xbfda('0x8'));var client=jayson[_0xbfda('0x9')][_0xbfda('0xa')]({'port':0x232a});config[_0xbfda('0xb')]=_['defaults'](config[_0xbfda('0xb')],{'host':_0xbfda('0xc'),'port':0x18eb});var socket=require(_0xbfda('0xd'))(new Redis(config[_0xbfda('0xb')]));require(_0xbfda('0xe'))[_0xbfda('0xf')](socket);function respondWithRpcPromise(_0x4a8281,_0x47aa78,_0x26b43d){return new BPromise(function(_0x3ffc88,_0x5aaf98){return client[_0xbfda('0x10')](_0x4a8281,_0x26b43d)['then'](function(_0x1b77f1){logger[_0xbfda('0x11')](_0xbfda('0x12'),_0x47aa78,_0xbfda('0x13'));logger[_0xbfda('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x47aa78,_0xbfda('0x13'),JSON[_0xbfda('0x15')](_0x1b77f1));if(_0x1b77f1['error']){if(_0x1b77f1[_0xbfda('0x16')]['code']===0x1f4){logger[_0xbfda('0x16')](_0xbfda('0x12'),_0x47aa78,_0x1b77f1['error'][_0xbfda('0x17')]);return _0x5aaf98(_0x1b77f1[_0xbfda('0x16')][_0xbfda('0x17')]);}logger[_0xbfda('0x16')](_0xbfda('0x12'),_0x47aa78,_0x1b77f1['error'][_0xbfda('0x17')]);return _0x3ffc88(_0x1b77f1[_0xbfda('0x16')]['message']);}else{logger[_0xbfda('0x11')](_0xbfda('0x12'),_0x47aa78,_0xbfda('0x13'));_0x3ffc88(_0x1b77f1[_0xbfda('0x18')][_0xbfda('0x17')]);}})[_0xbfda('0x19')](function(_0x2a4803){logger[_0xbfda('0x16')]('DashboardItem,\x20%s,\x20%s',_0x47aa78,_0x2a4803);_0x5aaf98(_0x2a4803);});});} \ No newline at end of file +var _0x9f6a=['catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dbe3d,_0x4b6223){var _0x2a4da5=function(_0x3b8795){while(--_0x3b8795){_0x2dbe3d['push'](_0x2dbe3d['shift']());}};_0x2a4da5(++_0x4b6223);}(_0x9f6a,0x1c3));var _0xa9f6=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x9f6a[_0x3c2166];return _0x30ccc3;};'use strict';var _=require(_0xa9f6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa9f6('0x1'));var rs=require(_0xa9f6('0x2'));var fs=require('fs');var Redis=require(_0xa9f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9f6('0x4'));var logger=require(_0xa9f6('0x5'))('rpc');var config=require(_0xa9f6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa9f6('0x7')][_0xa9f6('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa9f6('0x9')],{'host':_0xa9f6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9f6('0x9')]));require(_0xa9f6('0xb'))[_0xa9f6('0xc')](socket);function respondWithRpcPromise(_0x5438e1,_0x3bca22,_0x32628f){return new BPromise(function(_0x54723b,_0x5080e5){return client[_0xa9f6('0xd')](_0x5438e1,_0x32628f)[_0xa9f6('0xe')](function(_0x45dd11){logger[_0xa9f6('0xf')](_0xa9f6('0x10'),_0x3bca22,_0xa9f6('0x11'));logger[_0xa9f6('0x12')](_0xa9f6('0x13'),_0x3bca22,'request\x20sent',JSON[_0xa9f6('0x14')](_0x45dd11));if(_0x45dd11[_0xa9f6('0x15')]){if(_0x45dd11[_0xa9f6('0x15')][_0xa9f6('0x16')]===0x1f4){logger[_0xa9f6('0x15')](_0xa9f6('0x10'),_0x3bca22,_0x45dd11[_0xa9f6('0x15')][_0xa9f6('0x17')]);return _0x5080e5(_0x45dd11['error']['message']);}logger[_0xa9f6('0x15')](_0xa9f6('0x10'),_0x3bca22,_0x45dd11['error'][_0xa9f6('0x17')]);return _0x54723b(_0x45dd11[_0xa9f6('0x15')][_0xa9f6('0x17')]);}else{logger['info'](_0xa9f6('0x10'),_0x3bca22,_0xa9f6('0x11'));_0x54723b(_0x45dd11['result']['message']);}})[_0xa9f6('0x18')](function(_0x266cec){logger[_0xa9f6('0x15')](_0xa9f6('0x10'),_0x3bca22,_0x266cec);_0x5080e5(_0x266cec);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 61df9ee..3e6ca51 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 _0xe788=['emit','removeListener','register','length','dashboardItem:','remove','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe788,0x163));var _0x8e78=function(_0x303848,_0x19d01f){_0x303848=_0x303848-0x0;var _0x51c186=_0xe788[_0x303848];return _0x51c186;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x8e78('0x0'),_0x8e78('0x1')];function createListener(_0x42afa3,_0xb30e28){return function(_0x5519b4){_0xb30e28[_0x8e78('0x2')](_0x42afa3,_0x5519b4);};}function removeListener(_0x4a4a72,_0x185e44){return function(){DashboardItemEvents[_0x8e78('0x3')](_0x4a4a72,_0x185e44);};}exports[_0x8e78('0x4')]=function(_0x1262ae){for(var _0x461038=0x0,_0x35c870=events[_0x8e78('0x5')];_0x461038<_0x35c870;_0x461038++){var _0x401d2d=events[_0x461038];var _0x324f6e=createListener(_0x8e78('0x6')+_0x401d2d,_0x1262ae);DashboardItemEvents['on'](_0x401d2d,_0x324f6e);}}; \ No newline at end of file +var _0x6abc=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6abc,0x117));var _0xc6ab=function(_0x5d3fd6,_0x509022){_0x5d3fd6=_0x5d3fd6-0x0;var _0x7fc80=_0x6abc[_0x5d3fd6];return _0x7fc80;};'use strict';var DashboardItemEvents=require(_0xc6ab('0x0'));var events=[_0xc6ab('0x1'),_0xc6ab('0x2'),_0xc6ab('0x3')];function createListener(_0x54f918,_0x321e44){return function(_0x566534){_0x321e44[_0xc6ab('0x4')](_0x54f918,_0x566534);};}function removeListener(_0x2c50ad,_0x54efd7){return function(){DashboardItemEvents[_0xc6ab('0x5')](_0x2c50ad,_0x54efd7);};}exports[_0xc6ab('0x6')]=function(_0x45beee){for(var _0x413dba=0x0,_0x5e56b0=events[_0xc6ab('0x7')];_0x413dba<_0x5e56b0;_0x413dba++){var _0x51852d=events[_0x413dba];var _0x3d9726=createListener(_0xc6ab('0x8')+_0x51852d,_0x45beee);DashboardItemEvents['on'](_0x51852d,_0x3d9726);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index ea96fa7..ff5f6cf 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 _0x3b34=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','update','exports','multer'];(function(_0x1b91bf,_0x193aeb){var _0x117950=function(_0x4435a9){while(--_0x4435a9){_0x1b91bf['push'](_0x1b91bf['shift']());}};_0x117950(++_0x193aeb);}(_0x3b34,0x8f));var _0x43b3=function(_0x236024,_0xe2c533){_0x236024=_0x236024-0x0;var _0x5038bd=_0x3b34[_0x236024];return _0x5038bd;};'use strict';var multer=require(_0x43b3('0x0'));var util=require(_0x43b3('0x1'));var path=require(_0x43b3('0x2'));var timeout=require(_0x43b3('0x3'));var express=require(_0x43b3('0x4'));var router=express[_0x43b3('0x5')]();var fs_extra=require(_0x43b3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x43b3('0x7'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x43b3('0x8')](_0x43b3('0x9'),auth[_0x43b3('0xa')](),controller[_0x43b3('0xb')]);router[_0x43b3('0xc')]('/',auth[_0x43b3('0xa')](),controller[_0x43b3('0xd')]);router['put']('/:id',auth[_0x43b3('0xa')](),controller[_0x43b3('0xe')]);router['delete'](_0x43b3('0x9'),auth[_0x43b3('0xa')](),controller['destroy']);module[_0x43b3('0xf')]=router; \ No newline at end of file +var _0xa94d=['destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','create','put','update','delete'];(function(_0x36625f,_0x727bd6){var _0x135981=function(_0x1d8f24){while(--_0x1d8f24){_0x36625f['push'](_0x36625f['shift']());}};_0x135981(++_0x727bd6);}(_0xa94d,0x188));var _0xda94=function(_0x19fcda,_0x460406){_0x19fcda=_0x19fcda-0x0;var _0x2eee31=_0xa94d[_0x19fcda];return _0x2eee31;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xda94('0x0'));var express=require('express');var router=express[_0xda94('0x1')]();var fs_extra=require(_0xda94('0x2'));var auth=require(_0xda94('0x3'));var interaction=require(_0xda94('0x4'));var config=require(_0xda94('0x5'));var controller=require(_0xda94('0x6'));router[_0xda94('0x7')](_0xda94('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xda94('0x9')]);router[_0xda94('0xa')](_0xda94('0x8'),auth['isAuthenticated'](),controller[_0xda94('0xb')]);router[_0xda94('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xda94('0xd')]);module[_0xda94('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5ac5e78..d16c0e8 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 _0xaa88=['sequelize','STRING','ENUM','first','second'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xaa88,0x159));var _0x8aa8=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xaa88[_0x15af0f];return _0x2bd1cb;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module['exports']={'name':{'type':Sequelize[_0x8aa8('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x8aa8('0x2')](_0x8aa8('0x3'),_0x8aa8('0x4'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x8aa8('0x1')]}}; \ No newline at end of file +var _0xd1e8=['STRING','ENUM','first','third','sequelize','exports'];(function(_0x218dd2,_0x292bd8){var _0x4db59e=function(_0x1f625a){while(--_0x1f625a){_0x218dd2['push'](_0x218dd2['shift']());}};_0x4db59e(++_0x292bd8);}(_0xd1e8,0x118));var _0x8d1e=function(_0x55c965,_0x566c86){_0x55c965=_0x55c965-0x0;var _0x49f655=_0xd1e8[_0x55c965];return _0x49f655;};'use strict';var Sequelize=require(_0x8d1e('0x0'));module[_0x8d1e('0x1')]={'name':{'type':Sequelize[_0x8d1e('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x8d1e('0x3')](_0x8d1e('0x4'),'second',_0x8d1e('0x5')),'allowNull':![],'defaultValue':_0x8d1e('0x4')},'description':{'type':Sequelize[_0x8d1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 4f1c9bd..f6208f9 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 _0xdc59=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','map','Disposition','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x2320ce,_0x2a2236){var _0x40b34e=function(_0x2f5ca6){while(--_0x2f5ca6){_0x2320ce['push'](_0x2320ce['shift']());}};_0x40b34e(++_0x2a2236);}(_0xdc59,0x19c));var _0x9dc5=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xdc59[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require(_0x9dc5('0x0'));var rimraf=require(_0x9dc5('0x1'));var zipdir=require(_0x9dc5('0x2'));var jsonpatch=require(_0x9dc5('0x3'));var rp=require(_0x9dc5('0x4'));var moment=require(_0x9dc5('0x5'));var BPromise=require(_0x9dc5('0x6'));var Mustache=require(_0x9dc5('0x7'));var util=require(_0x9dc5('0x8'));var path=require(_0x9dc5('0x9'));var sox=require(_0x9dc5('0xa'));var csv=require('to-csv');var ejs=require(_0x9dc5('0xb'));var fs=require('fs');var fs_extra=require(_0x9dc5('0xc'));var _=require(_0x9dc5('0xd'));var squel=require(_0x9dc5('0xe'));var crypto=require(_0x9dc5('0xf'));var jsforce=require(_0x9dc5('0x10'));var deskjs=require(_0x9dc5('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9dc5('0x12'));var Papa=require(_0x9dc5('0x13'));var Redis=require(_0x9dc5('0x14'));var authService=require(_0x9dc5('0x15'));var qs=require(_0x9dc5('0x16'));var as=require(_0x9dc5('0x17'));var hardwareService=require(_0x9dc5('0x18'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9dc5('0x19'));var db=require(_0x9dc5('0x1a'))['db'];function respondWithStatusCode(_0x5c806b,_0x34108e){_0x34108e=_0x34108e||0xcc;return function(_0x43c351){if(_0x43c351){return _0x5c806b[_0x9dc5('0x1b')](_0x34108e);}return _0x5c806b[_0x9dc5('0x1c')](_0x34108e)[_0x9dc5('0x1d')]();};}function respondWithResult(_0x48b7fe,_0x26acbe){_0x26acbe=_0x26acbe||0xc8;return function(_0x253aaa){if(_0x253aaa){return _0x48b7fe['status'](_0x26acbe)[_0x9dc5('0x1e')](_0x253aaa);}};}function respondWithFilteredResult(_0x1aa47e,_0x5dbe7b){return function(_0x1f6892){if(_0x1f6892){var _0x52d328=typeof _0x5dbe7b['offset']===_0x9dc5('0x1f')&&typeof _0x5dbe7b[_0x9dc5('0x20')]==='undefined';var _0x218391=_0x1f6892[_0x9dc5('0x21')];var _0x5c149e=_0x52d328?0x0:_0x5dbe7b[_0x9dc5('0x22')];var _0x4e7eac=_0x52d328?_0x1f6892[_0x9dc5('0x21')]:_0x5dbe7b['offset']+_0x5dbe7b['limit'];var _0x308ff5;if(_0x4e7eac>=_0x218391){_0x4e7eac=_0x218391;_0x308ff5=0xc8;}else{_0x308ff5=0xce;}_0x1aa47e[_0x9dc5('0x1c')](_0x308ff5);return _0x1aa47e['set'](_0x9dc5('0x23'),_0x5c149e+'-'+_0x4e7eac+'/'+_0x218391)[_0x9dc5('0x1e')](_0x1f6892);}return null;};}function patchUpdates(_0x3963a0){return function(_0x1dd5f4){try{jsonpatch[_0x9dc5('0x24')](_0x1dd5f4,_0x3963a0,!![]);}catch(_0x1d7cac){return BPromise[_0x9dc5('0x25')](_0x1d7cac);}return _0x1dd5f4['save']();};}function saveUpdates(_0x387d82,_0x3ae6b5){return function(_0x5dfd11){if(_0x5dfd11){return _0x5dfd11['update'](_0x387d82)[_0x9dc5('0x26')](function(_0x219bc8){return _0x219bc8;});}return null;};}function removeEntity(_0x40c264,_0xad553f){return function(_0x59d6fa){if(_0x59d6fa){return _0x59d6fa[_0x9dc5('0x27')]()['then'](function(){var _0x2b7aab=_0x59d6fa[_0x9dc5('0x28')]({'plain':!![]});var _0x1cc355=_0x9dc5('0x29');return db[_0x9dc5('0x2a')][_0x9dc5('0x27')]({'where':{'type':_0x1cc355,'resourceId':_0x2b7aab['id']}})[_0x9dc5('0x26')](function(){return _0x59d6fa;});})[_0x9dc5('0x26')](function(){_0x40c264['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x403e66,_0x86763e){return function(_0x19a9ae){if(!_0x19a9ae){_0x403e66[_0x9dc5('0x1b')](0x194);}return _0x19a9ae;};}function handleError(_0xedda31,_0x3800){_0x3800=_0x3800||0x1f4;return function(_0x4fec29){logger['error'](_0x4fec29[_0x9dc5('0x2b')]);if(_0x4fec29[_0x9dc5('0x2c')]){delete _0x4fec29[_0x9dc5('0x2c')];}_0xedda31['status'](_0x3800)[_0x9dc5('0x2d')](_0x4fec29);};}exports['index']=function(_0x347a32,_0x2415bd){var _0xdff75f={},_0x4baa25={},_0x4d88b3={'count':0x0,'rows':[]};var _0x273f9b=_[_0x9dc5('0x2e')](db[_0x9dc5('0x2f')][_0x9dc5('0x30')],function(_0x377e24){return{'name':_0x377e24['fieldName'],'type':_0x377e24['type'][_0x9dc5('0x31')]};});_0x4baa25[_0x9dc5('0x32')]=_['map'](_0x273f9b,_0x9dc5('0x2c'));_0x4baa25['query']=_['keys'](_0x347a32[_0x9dc5('0x33')]);_0x4baa25[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x4baa25[_0x9dc5('0x32')],_0x4baa25[_0x9dc5('0x33')]);_0xdff75f[_0x9dc5('0x36')]=_[_0x9dc5('0x35')](_0x4baa25[_0x9dc5('0x32')],qs[_0x9dc5('0x37')](_0x347a32[_0x9dc5('0x33')][_0x9dc5('0x37')]));_0xdff75f[_0x9dc5('0x36')]=_0xdff75f[_0x9dc5('0x36')][_0x9dc5('0x38')]?_0xdff75f[_0x9dc5('0x36')]:_0x4baa25[_0x9dc5('0x32')];if(!_0x347a32[_0x9dc5('0x33')][_0x9dc5('0x39')](_0x9dc5('0x3a'))){_0xdff75f[_0x9dc5('0x20')]=qs[_0x9dc5('0x20')](_0x347a32[_0x9dc5('0x33')]['limit']);_0xdff75f['offset']=qs['offset'](_0x347a32['query']['offset']);}_0xdff75f['order']=qs['sort'](_0x347a32['query'][_0x9dc5('0x3b')]);_0xdff75f['where']=qs[_0x9dc5('0x34')](_[_0x9dc5('0x3c')](_0x347a32[_0x9dc5('0x33')],_0x4baa25[_0x9dc5('0x34')]),_0x273f9b);if(_0x347a32[_0x9dc5('0x33')][_0x9dc5('0x3d')]){_0xdff75f[_0x9dc5('0x3e')]=_[_0x9dc5('0x3f')](_0xdff75f['where'],{'$or':_[_0x9dc5('0x2e')](_0x273f9b,function(_0x438311){if(_0x438311['type']!==_0x9dc5('0x40')){var _0x28c9b5={};_0x28c9b5[_0x438311[_0x9dc5('0x2c')]]={'$like':'%'+_0x347a32[_0x9dc5('0x33')]['filter']+'%'};return _0x28c9b5;}})});}_0xdff75f=_[_0x9dc5('0x3f')]({},_0xdff75f,_0x347a32[_0x9dc5('0x41')]);var _0x26e4c0={'where':_0xdff75f[_0x9dc5('0x3e')]};return db['Disposition'][_0x9dc5('0x21')](_0x26e4c0)[_0x9dc5('0x26')](function(_0x503b03){_0x4d88b3[_0x9dc5('0x21')]=_0x503b03;if(_0x347a32[_0x9dc5('0x33')][_0x9dc5('0x42')]){_0xdff75f[_0x9dc5('0x43')]=[{'all':!![]}];}return db[_0x9dc5('0x2f')][_0x9dc5('0x44')](_0xdff75f);})[_0x9dc5('0x26')](function(_0x1ce3fd){_0x4d88b3[_0x9dc5('0x45')]=_0x1ce3fd;return _0x4d88b3;})[_0x9dc5('0x26')](respondWithFilteredResult(_0x2415bd,_0xdff75f))[_0x9dc5('0x46')](handleError(_0x2415bd,null));};exports[_0x9dc5('0x47')]=function(_0x55c73c,_0x3e5048){var _0x597077={'raw':!![],'where':{'id':_0x55c73c[_0x9dc5('0x48')]['id']}},_0x2fb1f7={};_0x2fb1f7['model']=_[_0x9dc5('0x49')](db[_0x9dc5('0x2f')][_0x9dc5('0x30')]);_0x2fb1f7['query']=_['keys'](_0x55c73c[_0x9dc5('0x33')]);_0x2fb1f7[_0x9dc5('0x34')]=_[_0x9dc5('0x35')](_0x2fb1f7[_0x9dc5('0x32')],_0x2fb1f7[_0x9dc5('0x33')]);_0x597077[_0x9dc5('0x36')]=_[_0x9dc5('0x35')](_0x2fb1f7[_0x9dc5('0x32')],qs['fields'](_0x55c73c[_0x9dc5('0x33')][_0x9dc5('0x37')]));_0x597077[_0x9dc5('0x36')]=_0x597077[_0x9dc5('0x36')]['length']?_0x597077[_0x9dc5('0x36')]:_0x2fb1f7[_0x9dc5('0x32')];if(_0x55c73c['query']['includeAll']){_0x597077[_0x9dc5('0x43')]=[{'all':!![]}];}_0x597077=_['merge']({},_0x597077,_0x55c73c[_0x9dc5('0x41')]);return db[_0x9dc5('0x2f')][_0x9dc5('0x4a')](_0x597077)[_0x9dc5('0x26')](handleEntityNotFound(_0x3e5048,null))['then'](respondWithResult(_0x3e5048,null))['catch'](handleError(_0x3e5048,null));};exports[_0x9dc5('0x4b')]=function(_0xd9460c,_0x365524){return db['Disposition'][_0x9dc5('0x4b')](_0xd9460c[_0x9dc5('0x4c')],{})[_0x9dc5('0x26')](function(_0x3997a8){var _0x21164d=_0xd9460c[_0x9dc5('0x4d')][_0x9dc5('0x28')]({'plain':!![]});if(!_0x21164d)throw new Error(_0x9dc5('0x4e'));if(_0x21164d['role']===_0x9dc5('0x4d')){var _0x244d1d=_0x3997a8[_0x9dc5('0x28')]({'plain':!![]});var _0x44b7fd=_0x9dc5('0x29');return db[_0x9dc5('0x4f')][_0x9dc5('0x4a')]({'where':{'name':_0x44b7fd,'userProfileId':_0x21164d[_0x9dc5('0x50')]},'raw':!![]})[_0x9dc5('0x26')](function(_0x5ae434){if(_0x5ae434&&_0x5ae434[_0x9dc5('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x244d1d[_0x9dc5('0x2c')],'resourceId':_0x244d1d['id'],'type':_0x5ae434[_0x9dc5('0x2c')],'sectionId':_0x5ae434['id']},{})[_0x9dc5('0x26')](function(){return _0x3997a8;});}else{return _0x3997a8;}})[_0x9dc5('0x46')](function(_0x1c24d8){logger[_0x9dc5('0x52')](_0x9dc5('0x53'),_0x1c24d8);throw _0x1c24d8;});}return _0x3997a8;})['then'](respondWithResult(_0x365524,0xc9))[_0x9dc5('0x46')](handleError(_0x365524,null));};exports[_0x9dc5('0x54')]=function(_0x2913ae,_0x9956fc){if(_0x2913ae[_0x9dc5('0x4c')]['id']){delete _0x2913ae['body']['id'];}return db[_0x9dc5('0x2f')][_0x9dc5('0x4a')]({'where':{'id':_0x2913ae[_0x9dc5('0x48')]['id']}})[_0x9dc5('0x26')](handleEntityNotFound(_0x9956fc,null))[_0x9dc5('0x26')](saveUpdates(_0x2913ae[_0x9dc5('0x4c')],null))[_0x9dc5('0x26')](respondWithResult(_0x9956fc,null))[_0x9dc5('0x46')](handleError(_0x9956fc,null));};exports[_0x9dc5('0x27')]=function(_0x41cead,_0x4d34c9){return db[_0x9dc5('0x2f')][_0x9dc5('0x4a')]({'where':{'id':_0x41cead['params']['id']}})[_0x9dc5('0x26')](handleEntityNotFound(_0x4d34c9,null))[_0x9dc5('0x26')](removeEntity(_0x4d34c9,null))[_0x9dc5('0x46')](handleError(_0x4d34c9,null));}; \ No newline at end of file +var _0xceb1=['keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','Disposition','findAll','rows','catch','show'];(function(_0x508d2a,_0x38b66c){var _0x37676c=function(_0x18f458){while(--_0x18f458){_0x508d2a['push'](_0x508d2a['shift']());}};_0x37676c(++_0x38b66c);}(_0xceb1,0x10a));var _0x1ceb=function(_0x4d026e,_0x486214){_0x4d026e=_0x4d026e-0x0;var _0x4a3099=_0xceb1[_0x4d026e];return _0x4a3099;};'use strict';var emlformat=require(_0x1ceb('0x0'));var rimraf=require(_0x1ceb('0x1'));var zipdir=require(_0x1ceb('0x2'));var jsonpatch=require(_0x1ceb('0x3'));var rp=require(_0x1ceb('0x4'));var moment=require(_0x1ceb('0x5'));var BPromise=require(_0x1ceb('0x6'));var Mustache=require(_0x1ceb('0x7'));var util=require(_0x1ceb('0x8'));var path=require(_0x1ceb('0x9'));var sox=require(_0x1ceb('0xa'));var csv=require(_0x1ceb('0xb'));var ejs=require(_0x1ceb('0xc'));var fs=require('fs');var fs_extra=require(_0x1ceb('0xd'));var _=require(_0x1ceb('0xe'));var squel=require(_0x1ceb('0xf'));var crypto=require(_0x1ceb('0x10'));var jsforce=require(_0x1ceb('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1ceb('0x12'));var Redis=require(_0x1ceb('0x13'));var authService=require(_0x1ceb('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ceb('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1ceb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1ceb('0x17'))['db'];function respondWithStatusCode(_0x1649c8,_0xc99497){_0xc99497=_0xc99497||0xcc;return function(_0x25949a){if(_0x25949a){return _0x1649c8[_0x1ceb('0x18')](_0xc99497);}return _0x1649c8[_0x1ceb('0x19')](_0xc99497)[_0x1ceb('0x1a')]();};}function respondWithResult(_0x47c411,_0x1f9e81){_0x1f9e81=_0x1f9e81||0xc8;return function(_0x1fdc63){if(_0x1fdc63){return _0x47c411[_0x1ceb('0x19')](_0x1f9e81)[_0x1ceb('0x1b')](_0x1fdc63);}};}function respondWithFilteredResult(_0x149f81,_0x5e733b){return function(_0x1b13f8){if(_0x1b13f8){var _0x31b224=typeof _0x5e733b['offset']===_0x1ceb('0x1c')&&typeof _0x5e733b[_0x1ceb('0x1d')]===_0x1ceb('0x1c');var _0x5d64cf=_0x1b13f8[_0x1ceb('0x1e')];var _0x55ea7c=_0x31b224?0x0:_0x5e733b[_0x1ceb('0x1f')];var _0x386ed8=_0x31b224?_0x1b13f8[_0x1ceb('0x1e')]:_0x5e733b[_0x1ceb('0x1f')]+_0x5e733b[_0x1ceb('0x1d')];var _0x5a2644;if(_0x386ed8>=_0x5d64cf){_0x386ed8=_0x5d64cf;_0x5a2644=0xc8;}else{_0x5a2644=0xce;}_0x149f81['status'](_0x5a2644);return _0x149f81[_0x1ceb('0x20')](_0x1ceb('0x21'),_0x55ea7c+'-'+_0x386ed8+'/'+_0x5d64cf)['json'](_0x1b13f8);}return null;};}function patchUpdates(_0x3ae37c){return function(_0x5760c5){try{jsonpatch[_0x1ceb('0x22')](_0x5760c5,_0x3ae37c,!![]);}catch(_0x2b5345){return BPromise[_0x1ceb('0x23')](_0x2b5345);}return _0x5760c5[_0x1ceb('0x24')]();};}function saveUpdates(_0x34c760,_0x2e4c4d){return function(_0x5e8a4b){if(_0x5e8a4b){return _0x5e8a4b[_0x1ceb('0x25')](_0x34c760)['then'](function(_0x18b7ce){return _0x18b7ce;});}return null;};}function removeEntity(_0x367e6a,_0x14337f){return function(_0x4cd0c5){if(_0x4cd0c5){return _0x4cd0c5['destroy']()[_0x1ceb('0x26')](function(){var _0x15c3b6=_0x4cd0c5[_0x1ceb('0x27')]({'plain':!![]});var _0x1bb059='Dispositions';return db[_0x1ceb('0x28')][_0x1ceb('0x29')]({'where':{'type':_0x1bb059,'resourceId':_0x15c3b6['id']}})[_0x1ceb('0x26')](function(){return _0x4cd0c5;});})[_0x1ceb('0x26')](function(){_0x367e6a[_0x1ceb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e99b,_0x4dab06){return function(_0x5775f5){if(!_0x5775f5){_0x17e99b[_0x1ceb('0x18')](0x194);}return _0x5775f5;};}function handleError(_0x4c6d38,_0x40ec05){_0x40ec05=_0x40ec05||0x1f4;return function(_0x283d22){logger[_0x1ceb('0x2a')](_0x283d22[_0x1ceb('0x2b')]);if(_0x283d22['name']){delete _0x283d22[_0x1ceb('0x2c')];}_0x4c6d38['status'](_0x40ec05)[_0x1ceb('0x2d')](_0x283d22);};}exports[_0x1ceb('0x2e')]=function(_0x2bf488,_0x260712){var _0x44af80={},_0x54ba18={},_0x4bdbf7={'count':0x0,'rows':[]};var _0x54a871=_['map'](db['Disposition'][_0x1ceb('0x2f')],function(_0xcbe89c){return{'name':_0xcbe89c[_0x1ceb('0x30')],'type':_0xcbe89c[_0x1ceb('0x31')]['key']};});_0x54ba18['model']=_['map'](_0x54a871,_0x1ceb('0x2c'));_0x54ba18['query']=_['keys'](_0x2bf488['query']);_0x54ba18[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x54ba18[_0x1ceb('0x34')],_0x54ba18[_0x1ceb('0x35')]);_0x44af80[_0x1ceb('0x36')]=_[_0x1ceb('0x33')](_0x54ba18[_0x1ceb('0x34')],qs[_0x1ceb('0x37')](_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x37')]));_0x44af80['attributes']=_0x44af80[_0x1ceb('0x36')][_0x1ceb('0x38')]?_0x44af80[_0x1ceb('0x36')]:_0x54ba18['model'];if(!_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x39')](_0x1ceb('0x3a'))){_0x44af80[_0x1ceb('0x1d')]=qs[_0x1ceb('0x1d')](_0x2bf488['query'][_0x1ceb('0x1d')]);_0x44af80['offset']=qs[_0x1ceb('0x1f')](_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x1f')]);}_0x44af80['order']=qs[_0x1ceb('0x3b')](_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x3b')]);_0x44af80[_0x1ceb('0x3c')]=qs[_0x1ceb('0x32')](_[_0x1ceb('0x3d')](_0x2bf488['query'],_0x54ba18[_0x1ceb('0x32')]),_0x54a871);if(_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x3e')]){_0x44af80[_0x1ceb('0x3c')]=_[_0x1ceb('0x3f')](_0x44af80[_0x1ceb('0x3c')],{'$or':_[_0x1ceb('0x40')](_0x54a871,function(_0xb5f997){if(_0xb5f997['type']!==_0x1ceb('0x41')){var _0x2854ae={};_0x2854ae[_0xb5f997[_0x1ceb('0x2c')]]={'$like':'%'+_0x2bf488['query']['filter']+'%'};return _0x2854ae;}})});}_0x44af80=_[_0x1ceb('0x3f')]({},_0x44af80,_0x2bf488[_0x1ceb('0x42')]);var _0x246201={'where':_0x44af80['where']};return db['Disposition'][_0x1ceb('0x1e')](_0x246201)['then'](function(_0x2e30e0){_0x4bdbf7[_0x1ceb('0x1e')]=_0x2e30e0;if(_0x2bf488[_0x1ceb('0x35')][_0x1ceb('0x43')]){_0x44af80[_0x1ceb('0x44')]=[{'all':!![]}];}return db[_0x1ceb('0x45')][_0x1ceb('0x46')](_0x44af80);})[_0x1ceb('0x26')](function(_0x52721e){_0x4bdbf7[_0x1ceb('0x47')]=_0x52721e;return _0x4bdbf7;})['then'](respondWithFilteredResult(_0x260712,_0x44af80))[_0x1ceb('0x48')](handleError(_0x260712,null));};exports[_0x1ceb('0x49')]=function(_0x123abc,_0x2114b5){var _0x1b4739={'raw':!![],'where':{'id':_0x123abc['params']['id']}},_0x45a226={};_0x45a226['model']=_[_0x1ceb('0x4a')](db[_0x1ceb('0x45')]['rawAttributes']);_0x45a226['query']=_[_0x1ceb('0x4a')](_0x123abc[_0x1ceb('0x35')]);_0x45a226[_0x1ceb('0x32')]=_[_0x1ceb('0x33')](_0x45a226[_0x1ceb('0x34')],_0x45a226[_0x1ceb('0x35')]);_0x1b4739['attributes']=_[_0x1ceb('0x33')](_0x45a226['model'],qs[_0x1ceb('0x37')](_0x123abc['query'][_0x1ceb('0x37')]));_0x1b4739[_0x1ceb('0x36')]=_0x1b4739['attributes'][_0x1ceb('0x38')]?_0x1b4739[_0x1ceb('0x36')]:_0x45a226['model'];if(_0x123abc['query']['includeAll']){_0x1b4739[_0x1ceb('0x44')]=[{'all':!![]}];}_0x1b4739=_[_0x1ceb('0x3f')]({},_0x1b4739,_0x123abc[_0x1ceb('0x42')]);return db[_0x1ceb('0x45')][_0x1ceb('0x4b')](_0x1b4739)['then'](handleEntityNotFound(_0x2114b5,null))[_0x1ceb('0x26')](respondWithResult(_0x2114b5,null))['catch'](handleError(_0x2114b5,null));};exports[_0x1ceb('0x4c')]=function(_0x4e1bdc,_0x580ade){return db['Disposition'][_0x1ceb('0x4c')](_0x4e1bdc['body'],{})[_0x1ceb('0x26')](function(_0x3ff8d1){var _0x717bd3=_0x4e1bdc[_0x1ceb('0x4d')]['get']({'plain':!![]});if(!_0x717bd3)throw new Error(_0x1ceb('0x4e'));if(_0x717bd3[_0x1ceb('0x4f')]==='user'){var _0x2d2712=_0x3ff8d1[_0x1ceb('0x27')]({'plain':!![]});var _0x33976f='Dispositions';return db['UserProfileSection'][_0x1ceb('0x4b')]({'where':{'name':_0x33976f,'userProfileId':_0x717bd3[_0x1ceb('0x50')]},'raw':!![]})[_0x1ceb('0x26')](function(_0x372d2c){if(_0x372d2c&&_0x372d2c[_0x1ceb('0x51')]===0x0){return db[_0x1ceb('0x28')][_0x1ceb('0x4c')]({'name':_0x2d2712[_0x1ceb('0x2c')],'resourceId':_0x2d2712['id'],'type':_0x372d2c[_0x1ceb('0x2c')],'sectionId':_0x372d2c['id']},{})[_0x1ceb('0x26')](function(){return _0x3ff8d1;});}else{return _0x3ff8d1;}})[_0x1ceb('0x48')](function(_0x3aec7e){logger[_0x1ceb('0x2a')](_0x1ceb('0x52'),_0x3aec7e);throw _0x3aec7e;});}return _0x3ff8d1;})[_0x1ceb('0x26')](respondWithResult(_0x580ade,0xc9))[_0x1ceb('0x48')](handleError(_0x580ade,null));};exports[_0x1ceb('0x25')]=function(_0x49e5df,_0x33cd25){if(_0x49e5df[_0x1ceb('0x53')]['id']){delete _0x49e5df[_0x1ceb('0x53')]['id'];}return db[_0x1ceb('0x45')][_0x1ceb('0x4b')]({'where':{'id':_0x49e5df[_0x1ceb('0x54')]['id']}})[_0x1ceb('0x26')](handleEntityNotFound(_0x33cd25,null))['then'](saveUpdates(_0x49e5df[_0x1ceb('0x53')],null))[_0x1ceb('0x26')](respondWithResult(_0x33cd25,null))['catch'](handleError(_0x33cd25,null));};exports[_0x1ceb('0x29')]=function(_0x53fa57,_0xa7fd24){return db[_0x1ceb('0x45')][_0x1ceb('0x4b')]({'where':{'id':_0x53fa57['params']['id']}})[_0x1ceb('0x26')](handleEntityNotFound(_0xa7fd24,null))[_0x1ceb('0x26')](removeEntity(_0xa7fd24,null))['catch'](handleError(_0xa7fd24,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8b4ad4d..ba98dd5 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 _0xb434=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util'];(function(_0x2ffa85,_0x233c08){var _0x137123=function(_0x3a86b1){while(--_0x3a86b1){_0x2ffa85['push'](_0x2ffa85['shift']());}};_0x137123(++_0x233c08);}(_0xb434,0xac));var _0x4b43=function(_0x13d71e,_0x1ab6a1){_0x13d71e=_0x13d71e-0x0;var _0x2dc8aa=_0xb434[_0x13d71e];return _0x2dc8aa;};'use strict';var _=require(_0x4b43('0x0'));var util=require(_0x4b43('0x1'));var logger=require(_0x4b43('0x2'))(_0x4b43('0x3'));var moment=require(_0x4b43('0x4'));var BPromise=require(_0x4b43('0x5'));var rp=require(_0x4b43('0x6'));var fs=require('fs');var path=require(_0x4b43('0x7'));var rimraf=require(_0x4b43('0x8'));var config=require(_0x4b43('0x9'));var attributes=require(_0x4b43('0xa'));module[_0x4b43('0xb')]=function(_0x125fb1,_0x41a2f1){return _0x125fb1[_0x4b43('0xc')](_0x4b43('0xd'),attributes,{'tableName':_0x4b43('0xe'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4b43('0xf'),'fields':[_0x4b43('0x10'),_0x4b43('0x11')]},{'unique':!![],'name':_0x4b43('0x12'),'fields':['name',_0x4b43('0x13')]},{'unique':!![],'name':_0x4b43('0x14'),'fields':[_0x4b43('0x10'),_0x4b43('0x15')]},{'unique':!![],'name':_0x4b43('0x16'),'fields':[_0x4b43('0x10'),_0x4b43('0x17')]},{'unique':!![],'name':_0x4b43('0x18'),'fields':['name',_0x4b43('0x19')]},{'unique':!![],'name':'name_openchannel','fields':[_0x4b43('0x10'),_0x4b43('0x1a')]},{'unique':!![],'name':_0x4b43('0x1b'),'fields':[_0x4b43('0x10'),_0x4b43('0x1c')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f6=['./disposition.attributes','exports','define','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x45f694,_0x47f8d5){var _0x50ae67=function(_0x8be2ba){while(--_0x8be2ba){_0x45f694['push'](_0x45f694['shift']());}};_0x50ae67(++_0x47f8d5);}(_0xc1f6,0x1a8));var _0x6c1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c1f('0x0'));var util=require(_0x6c1f('0x1'));var logger=require(_0x6c1f('0x2'))(_0x6c1f('0x3'));var moment=require(_0x6c1f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c1f('0x5'));var rimraf=require(_0x6c1f('0x6'));var config=require(_0x6c1f('0x7'));var attributes=require(_0x6c1f('0x8'));module[_0x6c1f('0x9')]=function(_0x5a6f29,_0x4d6902){return _0x5a6f29[_0x6c1f('0xa')](_0x6c1f('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x6c1f('0xc'),_0x6c1f('0xd')]},{'unique':!![],'name':_0x6c1f('0xe'),'fields':[_0x6c1f('0xc'),_0x6c1f('0xf')]},{'unique':!![],'name':_0x6c1f('0x10'),'fields':[_0x6c1f('0xc'),_0x6c1f('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x6c1f('0xc'),_0x6c1f('0x12')]},{'unique':!![],'name':_0x6c1f('0x13'),'fields':['name',_0x6c1f('0x14')]},{'unique':!![],'name':_0x6c1f('0x15'),'fields':[_0x6c1f('0xc'),_0x6c1f('0x16')]},{'unique':!![],'name':_0x6c1f('0x17'),'fields':[_0x6c1f('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 023515d..e8479ea 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(_0x4318db,_0x1ee095){var _0x352e36=function(_0x32dfe0){while(--_0x32dfe0){_0x4318db['push'](_0x4318db['shift']());}};_0x352e36(++_0x1ee095);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x13d2fd,_0x10a042){var _0x16204d=function(_0x2e84ec){while(--_0x2e84ec){_0x13d2fd['push'](_0x13d2fd['shift']());}};_0x16204d(++_0x10a042);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 4ba053e..d0a4118 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 _0x4b3b=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x229181,_0x3b9bd4){var _0x354b12=function(_0x206ede){while(--_0x206ede){_0x229181['push'](_0x229181['shift']());}};_0x354b12(++_0x3b9bd4);}(_0x4b3b,0x1e7));var _0xb4b3=function(_0x1a9d89,_0x2c1987){_0x1a9d89=_0x1a9d89-0x0;var _0x497d5c=_0x4b3b[_0x1a9d89];return _0x497d5c;};'use strict';var multer=require(_0xb4b3('0x0'));var util=require(_0xb4b3('0x1'));var path=require(_0xb4b3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4b3('0x3'));var router=express[_0xb4b3('0x4')]();var fs_extra=require(_0xb4b3('0x5'));var auth=require(_0xb4b3('0x6'));var interaction=require(_0xb4b3('0x7'));var config=require('../../config/environment');var controller=require(_0xb4b3('0x8'));router[_0xb4b3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb4b3('0x9')]('/:id',auth[_0xb4b3('0xa')](),controller[_0xb4b3('0xb')]);router[_0xb4b3('0xc')]('/',auth[_0xb4b3('0xa')](),controller[_0xb4b3('0xd')]);router[_0xb4b3('0xe')](_0xb4b3('0xf'),auth[_0xb4b3('0xa')](),controller['update']);router[_0xb4b3('0x10')](_0xb4b3('0xf'),auth[_0xb4b3('0xa')](),controller['destroy']);module[_0xb4b3('0x11')]=router; \ No newline at end of file +var _0xda3b=['../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','fs-extra'];(function(_0xe9de2,_0x5bffbb){var _0x35ab0e=function(_0x2bb5fd){while(--_0x2bb5fd){_0xe9de2['push'](_0xe9de2['shift']());}};_0x35ab0e(++_0x5bffbb);}(_0xda3b,0x18d));var _0xbda3=function(_0x4e8531,_0x1c33ed){_0x4e8531=_0x4e8531-0x0;var _0x2ff8e7=_0xda3b[_0x4e8531];return _0x2ff8e7;};'use strict';var multer=require(_0xbda3('0x0'));var util=require(_0xbda3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbda3('0x2'));var auth=require(_0xbda3('0x3'));var interaction=require(_0xbda3('0x4'));var config=require('../../config/environment');var controller=require(_0xbda3('0x5'));router[_0xbda3('0x6')]('/',auth[_0xbda3('0x7')](),controller['index']);router[_0xbda3('0x6')]('/:id',auth[_0xbda3('0x7')](),controller[_0xbda3('0x8')]);router['post']('/',auth[_0xbda3('0x7')](),controller[_0xbda3('0x9')]);router[_0xbda3('0xa')](_0xbda3('0xb'),auth[_0xbda3('0x7')](),controller[_0xbda3('0xc')]);router[_0xbda3('0xd')](_0xbda3('0xb'),auth[_0xbda3('0x7')](),controller[_0xbda3('0xe')]);module[_0xbda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1fbf74b..51309a9 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 _0x3870=['7200','9600','v17,v27,v29','INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','12000','14400','2400'];(function(_0x12e23b,_0x6609ef){var _0x26181c=function(_0x5af2b8){while(--_0x5af2b8){_0x12e23b['push'](_0x12e23b['shift']());}};_0x26181c(++_0x6609ef);}(_0x3870,0x7a));var _0x0387=function(_0x6177b7,_0x571c4d){_0x6177b7=_0x6177b7-0x0;var _0x20cdf8=_0x3870[_0x6177b7];return _0x20cdf8;};'use strict';var Sequelize=require('sequelize');module[_0x0387('0x0')]={'name':{'type':Sequelize[_0x0387('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0387('0x1')]},'ecm':{'type':Sequelize[_0x0387('0x2')](_0x0387('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0387('0x1')],'defaultValue':_0x0387('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x0387('0x5')},'minrate':{'type':Sequelize[_0x0387('0x2')]('2400',_0x0387('0x6'),'7200','9600',_0x0387('0x7'),_0x0387('0x8')),'defaultValue':_0x0387('0x6')},'maxrate':{'type':Sequelize[_0x0387('0x2')](_0x0387('0x9'),_0x0387('0x6'),_0x0387('0xa'),_0x0387('0xb'),_0x0387('0x7'),_0x0387('0x8')),'defaultValue':_0x0387('0x8')},'modem':{'type':Sequelize[_0x0387('0x1')],'defaultValue':_0x0387('0xc')},'gateway':{'type':Sequelize[_0x0387('0x1')],'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[_0x0387('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0387('0x2')](_0x0387('0xe'),_0x0387('0xf'),'DADHI','KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0387('0x10')],'defaultValue':function(){return _0x0387('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0387('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0387('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0387('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0387('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0387('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0387('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0387('0x12')],'defaultValue':![],'comment':_0x0387('0x13'),'set':function(_0x1e9205){if(!_0x1e9205)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x0387('0x14')](_0x0387('0x15'),_0x1e9205);}}}; \ No newline at end of file +var _0x6d10=['ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING'];(function(_0xa32c50,_0x1a9e3d){var _0x3a1a33=function(_0xc78022){while(--_0xc78022){_0xa32c50['push'](_0xa32c50['shift']());}};_0x3a1a33(++_0x1a9e3d);}(_0x6d10,0x15b));var _0x06d1=function(_0x106780,_0x12f0ed){_0x106780=_0x106780-0x0;var _0x320d24=_0x6d10[_0x106780];return _0x320d24;};'use strict';var Sequelize=require(_0x06d1('0x0'));module[_0x06d1('0x1')]={'name':{'type':Sequelize[_0x06d1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x06d1('0x2')]},'ecm':{'type':Sequelize[_0x06d1('0x3')]('yes','no'),'defaultValue':_0x06d1('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x06d1('0x2')],'unique':_0x06d1('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x06d1('0x6'),_0x06d1('0x7'),_0x06d1('0x8'),_0x06d1('0x9'),_0x06d1('0xa'),_0x06d1('0xb')),'defaultValue':_0x06d1('0x7')},'maxrate':{'type':Sequelize[_0x06d1('0x3')](_0x06d1('0x6'),'4800',_0x06d1('0x8'),_0x06d1('0x9'),'12000',_0x06d1('0xb')),'defaultValue':_0x06d1('0xb')},'modem':{'type':Sequelize[_0x06d1('0x2')],'defaultValue':_0x06d1('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x06d1('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x06d1('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x06d1('0x3')](_0x06d1('0xe'),_0x06d1('0xf'),'DADHI',_0x06d1('0x10')),'defaultValue':_0x06d1('0xe')},'key':{'type':Sequelize[_0x06d1('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x06d1('0x11')],'defaultValue':function(){return _0x06d1('0x12');}},'notificationSound':{'type':Sequelize[_0x06d1('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x06d1('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x06d1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x06d1('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x06d1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x06d1('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x06d1('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x06d1('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x06d1('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x06d1('0x15'),'set':function(_0x2d91a3){if(!_0x2d91a3)this['setDataValue'](_0x06d1('0x16'),null);this[_0x06d1('0x17')](_0x06d1('0x18'),_0x2d91a3);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9464dd0..2eb2ccd 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 _0x9f3c=['fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','include','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','ids','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','internal','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','priority','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','transaction','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','map','FaxAccount','fieldName','type','key','model','query','intersection','attributes'];(function(_0x1be05b,_0x2f99ab){var _0x38ddd2=function(_0x5749f2){while(--_0x5749f2){_0x1be05b['push'](_0x1be05b['shift']());}};_0x38ddd2(++_0x2f99ab);}(_0x9f3c,0x7d));var _0xc9f3=function(_0x37df4f,_0x10dc4a){_0x37df4f=_0x37df4f-0x0;var _0xf9173b=_0x9f3c[_0x37df4f];return _0xf9173b;};'use strict';var emlformat=require(_0xc9f3('0x0'));var rimraf=require(_0xc9f3('0x1'));var zipdir=require(_0xc9f3('0x2'));var jsonpatch=require(_0xc9f3('0x3'));var rp=require(_0xc9f3('0x4'));var moment=require(_0xc9f3('0x5'));var BPromise=require(_0xc9f3('0x6'));var Mustache=require('mustache');var util=require(_0xc9f3('0x7'));var path=require(_0xc9f3('0x8'));var sox=require(_0xc9f3('0x9'));var csv=require('to-csv');var ejs=require(_0xc9f3('0xa'));var fs=require('fs');var fs_extra=require(_0xc9f3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc9f3('0xc'));var deskjs=require(_0xc9f3('0xd'));var toCsv=require(_0xc9f3('0xe'));var querystring=require(_0xc9f3('0xf'));var Papa=require(_0xc9f3('0x10'));var Redis=require('ioredis');var authService=require(_0xc9f3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9f3('0x12'));var logger=require(_0xc9f3('0x13'))(_0xc9f3('0x14'));var utils=require('../../config/utils');var config=require(_0xc9f3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9f3('0x16'))['db'];config[_0xc9f3('0x17')]=_['defaults'](config[_0xc9f3('0x17')],{'host':_0xc9f3('0x18'),'port':0x18eb});var socket=require(_0xc9f3('0x19'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xc9f3('0x1a')](socket);var jayson=require(_0xc9f3('0x1b'));var client=jayson['client'][_0xc9f3('0x1c')]({'port':0x232c});var client9002=jayson[_0xc9f3('0x1d')][_0xc9f3('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x409672,_0xeed4dc,_0x15d0fe,_0x23467a){return new BPromise(function(_0x112eab,_0x509fba){var _0x119242=_0x23467a||client;return _0x119242[_0xc9f3('0x1e')](_0x409672,_0x15d0fe)['then'](function(_0x3d0939){logger[_0xc9f3('0x1f')](_0xc9f3('0x20'),_0xeed4dc,_0xc9f3('0x21'));logger[_0xc9f3('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xeed4dc,_0xc9f3('0x21'),JSON['stringify'](_0x3d0939));if(_0x3d0939[_0xc9f3('0x23')]){if(_0x3d0939[_0xc9f3('0x23')][_0xc9f3('0x24')]===0x1f4){logger[_0xc9f3('0x23')](_0xc9f3('0x20'),_0xeed4dc,_0x3d0939[_0xc9f3('0x23')][_0xc9f3('0x25')]);return _0x509fba(_0x3d0939[_0xc9f3('0x23')][_0xc9f3('0x25')]);}logger[_0xc9f3('0x23')](_0xc9f3('0x20'),_0xeed4dc,_0x3d0939['error']['message']);return _0x112eab(_0x3d0939['error'][_0xc9f3('0x25')]);}else{logger[_0xc9f3('0x1f')](_0xc9f3('0x20'),_0xeed4dc,_0xc9f3('0x21'));_0x112eab(_0x3d0939['result'][_0xc9f3('0x25')]);}})[_0xc9f3('0x26')](function(_0x4236ad){logger[_0xc9f3('0x23')](_0xc9f3('0x20'),_0xeed4dc,_0x4236ad);_0x509fba(_0x4236ad);});});}function respondWithStatusCode(_0x6b56a9,_0x2a56ac){_0x2a56ac=_0x2a56ac||0xcc;return function(_0x4aca23){if(_0x4aca23){return _0x6b56a9[_0xc9f3('0x27')](_0x2a56ac);}return _0x6b56a9[_0xc9f3('0x28')](_0x2a56ac)[_0xc9f3('0x29')]();};}function respondWithResult(_0x27dc00,_0x7a9ca9){_0x7a9ca9=_0x7a9ca9||0xc8;return function(_0x5e10bf){if(_0x5e10bf){return _0x27dc00[_0xc9f3('0x28')](_0x7a9ca9)['json'](_0x5e10bf);}};}function respondWithFilteredResult(_0x51aed8,_0x5771e6){return function(_0x10bd83){if(_0x10bd83){var _0x2764ab=typeof _0x5771e6['offset']==='undefined'&&typeof _0x5771e6[_0xc9f3('0x2a')]==='undefined';var _0x22f8e0=_0x10bd83[_0xc9f3('0x2b')];var _0x3efbf1=_0x2764ab?0x0:_0x5771e6[_0xc9f3('0x2c')];var _0x2537a6=_0x2764ab?_0x10bd83[_0xc9f3('0x2b')]:_0x5771e6['offset']+_0x5771e6[_0xc9f3('0x2a')];var _0xaf9f22;if(_0x2537a6>=_0x22f8e0){_0x2537a6=_0x22f8e0;_0xaf9f22=0xc8;}else{_0xaf9f22=0xce;}_0x51aed8['status'](_0xaf9f22);return _0x51aed8['set'](_0xc9f3('0x2d'),_0x3efbf1+'-'+_0x2537a6+'/'+_0x22f8e0)[_0xc9f3('0x2e')](_0x10bd83);}return null;};}function patchUpdates(_0x7c9f30){return function(_0x3a0638){try{jsonpatch[_0xc9f3('0x2f')](_0x3a0638,_0x7c9f30,!![]);}catch(_0x1717a2){return BPromise[_0xc9f3('0x30')](_0x1717a2);}return _0x3a0638[_0xc9f3('0x31')]();};}function saveUpdates(_0x1b8d83,_0x1d5642){return function(_0xaacc82){if(_0xaacc82){return _0xaacc82[_0xc9f3('0x32')](_0x1b8d83)[_0xc9f3('0x33')](function(_0x5cab74){return _0x5cab74;});}return null;};}function removeEntity(_0x528eca,_0x3af456){return function(_0x558bc0){if(_0x558bc0){return _0x558bc0['destroy']()[_0xc9f3('0x33')](function(){var _0x2cdb52=_0x558bc0[_0xc9f3('0x34')]({'plain':!![]});var _0x4a6afb=_0xc9f3('0x35');return db[_0xc9f3('0x36')][_0xc9f3('0x37')]({'where':{'type':_0x4a6afb,'resourceId':_0x2cdb52['id']}})['then'](function(){return _0x558bc0;});})[_0xc9f3('0x33')](function(){_0x528eca[_0xc9f3('0x28')](0xcc)[_0xc9f3('0x29')]();});}};}function handleEntityNotFound(_0x317bc5,_0x204d72){return function(_0x57fd76){if(!_0x57fd76){_0x317bc5[_0xc9f3('0x27')](0x194);}return _0x57fd76;};}function handleError(_0x6b24e3,_0x5ac7c2){_0x5ac7c2=_0x5ac7c2||0x1f4;return function(_0x51f330){logger[_0xc9f3('0x23')](_0x51f330[_0xc9f3('0x38')]);if(_0x51f330[_0xc9f3('0x39')]){delete _0x51f330[_0xc9f3('0x39')];}_0x6b24e3[_0xc9f3('0x28')](_0x5ac7c2)[_0xc9f3('0x3a')](_0x51f330);};}exports[_0xc9f3('0x3b')]=function(_0x9894bf,_0x421654){var _0x44a2d9={'include':[{'model':db[_0xc9f3('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3294fb={},_0xadb6a={'count':0x0,'rows':[]};var _0x20e479=_[_0xc9f3('0x3d')](db[_0xc9f3('0x3e')]['rawAttributes'],function(_0x554dd3){return{'name':_0x554dd3[_0xc9f3('0x3f')],'type':_0x554dd3[_0xc9f3('0x40')][_0xc9f3('0x41')]};});_0x3294fb[_0xc9f3('0x42')]=_[_0xc9f3('0x3d')](_0x20e479,'name');_0x3294fb[_0xc9f3('0x43')]=_['keys'](_0x9894bf[_0xc9f3('0x43')]);_0x3294fb['filters']=_[_0xc9f3('0x44')](_0x3294fb[_0xc9f3('0x42')],_0x3294fb[_0xc9f3('0x43')]);_0x44a2d9[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x3294fb[_0xc9f3('0x42')],qs[_0xc9f3('0x46')](_0x9894bf[_0xc9f3('0x43')][_0xc9f3('0x46')]));_0x44a2d9[_0xc9f3('0x45')]=_0x44a2d9[_0xc9f3('0x45')][_0xc9f3('0x47')]?_0x44a2d9['attributes']:_0x3294fb[_0xc9f3('0x42')];if(!_0x9894bf['query'][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x44a2d9[_0xc9f3('0x2a')]=qs[_0xc9f3('0x2a')](_0x9894bf['query'][_0xc9f3('0x2a')]);_0x44a2d9[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0x9894bf['query']['offset']);}_0x44a2d9['order']=qs[_0xc9f3('0x4a')](_0x9894bf[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x44a2d9[_0xc9f3('0x4b')]=qs[_0xc9f3('0x4c')](_[_0xc9f3('0x4d')](_0x9894bf[_0xc9f3('0x43')],_0x3294fb[_0xc9f3('0x4c')]),_0x20e479);if(_0x9894bf[_0xc9f3('0x43')]['filter']){_0x44a2d9[_0xc9f3('0x4b')]=_[_0xc9f3('0x4e')](_0x44a2d9[_0xc9f3('0x4b')],{'$or':_[_0xc9f3('0x3d')](_0x20e479,function(_0x5b17a8){if(_0x5b17a8[_0xc9f3('0x40')]!=='VIRTUAL'){var _0x1ab88e={};_0x1ab88e[_0x5b17a8[_0xc9f3('0x39')]]={'$like':'%'+_0x9894bf[_0xc9f3('0x43')][_0xc9f3('0x4f')]+'%'};return _0x1ab88e;}})});}_0x44a2d9=_[_0xc9f3('0x4e')]({},_0x44a2d9,_0x9894bf[_0xc9f3('0x50')]);var _0x243085={'where':_0x44a2d9['where']};return db['FaxAccount'][_0xc9f3('0x2b')](_0x243085)[_0xc9f3('0x33')](function(_0x4c80a5){_0xadb6a[_0xc9f3('0x2b')]=_0x4c80a5;if(_0x9894bf[_0xc9f3('0x43')]['includeAll']){_0x44a2d9[_0xc9f3('0x51')]=[{'all':!![]}];}return db[_0xc9f3('0x3e')]['findAll'](_0x44a2d9);})[_0xc9f3('0x33')](function(_0x1e5112){_0xadb6a[_0xc9f3('0x52')]=_0x1e5112;return _0xadb6a;})[_0xc9f3('0x33')](respondWithFilteredResult(_0x421654,_0x44a2d9))[_0xc9f3('0x26')](handleError(_0x421654,null));};exports[_0xc9f3('0x53')]=function(_0x336502,_0x51559f){var _0x3ef625={'raw':![],'where':{'id':_0x336502[_0xc9f3('0x54')]['id']},'include':[{'model':db[_0xc9f3('0x3c')],'as':_0xc9f3('0x55')}]},_0xf9cc06={};_0xf9cc06['model']=_[_0xc9f3('0x56')](db[_0xc9f3('0x3e')][_0xc9f3('0x57')]);_0xf9cc06['query']=_[_0xc9f3('0x56')](_0x336502[_0xc9f3('0x43')]);_0xf9cc06[_0xc9f3('0x4c')]=_[_0xc9f3('0x44')](_0xf9cc06['model'],_0xf9cc06[_0xc9f3('0x43')]);_0x3ef625[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0xf9cc06[_0xc9f3('0x42')],qs['fields'](_0x336502[_0xc9f3('0x43')][_0xc9f3('0x46')]));_0x3ef625['attributes']=_0x3ef625[_0xc9f3('0x45')][_0xc9f3('0x47')]?_0x3ef625[_0xc9f3('0x45')]:_0xf9cc06[_0xc9f3('0x42')];if(_0x336502[_0xc9f3('0x43')][_0xc9f3('0x58')]){_0x3ef625[_0xc9f3('0x51')]=[{'all':!![]}];}_0x3ef625=_[_0xc9f3('0x4e')]({},_0x3ef625,_0x336502[_0xc9f3('0x50')]);return db[_0xc9f3('0x3e')]['find'](_0x3ef625)[_0xc9f3('0x33')](handleEntityNotFound(_0x51559f,null))[_0xc9f3('0x33')](respondWithResult(_0x51559f,null))['catch'](handleError(_0x51559f,null));};exports[_0xc9f3('0x59')]=function(_0x29419a,_0x4b44ea){return db['FaxAccount'][_0xc9f3('0x59')](_0x29419a[_0xc9f3('0x5a')],{})[_0xc9f3('0x33')](function(_0xd776d6){var _0x1a5515=_0x29419a[_0xc9f3('0x5b')]['get']({'plain':!![]});if(!_0x1a5515)throw new Error(_0xc9f3('0x5c'));if(_0x1a5515['role']==='user'){var _0x4918be=_0xd776d6[_0xc9f3('0x34')]({'plain':!![]});var _0x43ba73=_0xc9f3('0x35');return db[_0xc9f3('0x5d')][_0xc9f3('0x5e')]({'where':{'name':_0x43ba73,'userProfileId':_0x1a5515[_0xc9f3('0x5f')]},'raw':!![]})[_0xc9f3('0x33')](function(_0x1e2019){if(_0x1e2019&&_0x1e2019[_0xc9f3('0x60')]===0x0){return db[_0xc9f3('0x36')][_0xc9f3('0x59')]({'name':_0x4918be[_0xc9f3('0x39')],'resourceId':_0x4918be['id'],'type':_0x1e2019['name'],'sectionId':_0x1e2019['id']},{})[_0xc9f3('0x33')](function(){return _0xd776d6;});}else{return _0xd776d6;}})['catch'](function(_0x96a648){logger['error'](_0xc9f3('0x61'),_0x96a648);throw _0x96a648;});}return _0xd776d6;})[_0xc9f3('0x33')](respondWithResult(_0x4b44ea,0xc9))[_0xc9f3('0x26')](handleError(_0x4b44ea,null));};exports[_0xc9f3('0x32')]=function(_0x2d6b79,_0x305c2a){if(_0x2d6b79['body']['id']){delete _0x2d6b79[_0xc9f3('0x5a')]['id'];}return db[_0xc9f3('0x3e')][_0xc9f3('0x5e')]({'where':{'id':_0x2d6b79[_0xc9f3('0x54')]['id']},'include':[{'model':db[_0xc9f3('0x3c')],'as':_0xc9f3('0x55')}]})[_0xc9f3('0x33')](handleEntityNotFound(_0x305c2a,null))[_0xc9f3('0x33')](saveUpdates(_0x2d6b79['body'],null))[_0xc9f3('0x33')](respondWithResult(_0x305c2a,null))[_0xc9f3('0x26')](handleError(_0x305c2a,null));};exports[_0xc9f3('0x37')]=function(_0x330b51,_0x49ce6c){return db[_0xc9f3('0x3e')][_0xc9f3('0x5e')]({'where':{'id':_0x330b51[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x49ce6c,null))['then'](removeEntity(_0x49ce6c,null))['catch'](handleError(_0x49ce6c,null));};exports[_0xc9f3('0x62')]=function(_0xfd33ee,_0x6964dd){return db[_0xc9f3('0x3e')]['describe']()[_0xc9f3('0x33')](respondWithResult(_0x6964dd,null))['catch'](handleError(_0x6964dd,null));};exports[_0xc9f3('0x63')]=function(_0x56689e,_0x443647,_0xecf5a2){if(_0x56689e['body']['id']){delete _0x56689e[_0xc9f3('0x5a')]['id'];}return db[_0xc9f3('0x3e')]['find']({'where':{'id':_0x56689e['params']['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x443647,null))[_0xc9f3('0x33')](function(_0x16c7b5){if(_0x16c7b5){_0x56689e[_0xc9f3('0x5a')][_0xc9f3('0x64')]=_0x16c7b5['id'];return db[_0xc9f3('0x65')][_0xc9f3('0x59')](_0x56689e[_0xc9f3('0x5a')]);}})[_0xc9f3('0x33')](respondWithResult(_0x443647,null))[_0xc9f3('0x26')](handleError(_0x443647,null));};exports[_0xc9f3('0x66')]=function(_0x568641,_0x3948dc,_0x4064f3){var _0x56fd97={'raw':![],'where':{}};var _0x310f21={};var _0x7a9c1f={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x568641[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x3948dc,null))[_0xc9f3('0x33')](function(_0x41066b){if(_0x41066b){_0x310f21[_0xc9f3('0x42')]=_[_0xc9f3('0x56')](db[_0xc9f3('0x65')][_0xc9f3('0x57')]);_0x310f21[_0xc9f3('0x43')]=_[_0xc9f3('0x56')](_0x568641[_0xc9f3('0x43')]);_0x310f21[_0xc9f3('0x4c')]=_['intersection'](_0x310f21['model'],_0x310f21[_0xc9f3('0x43')]);_0x56fd97[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x310f21[_0xc9f3('0x42')],qs['fields'](_0x568641['query'][_0xc9f3('0x46')]));_0x56fd97['attributes']=_0x56fd97[_0xc9f3('0x45')][_0xc9f3('0x47')]?_0x56fd97[_0xc9f3('0x45')]:_0x310f21[_0xc9f3('0x42')];if(!_0x568641[_0xc9f3('0x43')][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x56fd97[_0xc9f3('0x2a')]=qs[_0xc9f3('0x2a')](_0x568641[_0xc9f3('0x43')][_0xc9f3('0x2a')]);_0x56fd97[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0x568641[_0xc9f3('0x43')][_0xc9f3('0x2c')]);}_0x56fd97[_0xc9f3('0x67')]=qs[_0xc9f3('0x4a')](_0x568641[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x56fd97[_0xc9f3('0x4b')]=qs[_0xc9f3('0x4c')](_[_0xc9f3('0x4d')](_0x568641[_0xc9f3('0x43')],_0x310f21['filters']));_0x56fd97[_0xc9f3('0x4b')]['FaxAccountId']=_0x41066b['id'];if(_0x568641['query'][_0xc9f3('0x4f')]){_0x56fd97[_0xc9f3('0x4b')]=_[_0xc9f3('0x4e')](_0x56fd97[_0xc9f3('0x4b')],{'$or':_[_0xc9f3('0x3d')](_0x56fd97[_0xc9f3('0x45')],function(_0x5dd256){var _0x36e268={};_0x36e268[_0x5dd256]={'$like':'%'+_0x568641[_0xc9f3('0x43')][_0xc9f3('0x4f')]+'%'};return _0x36e268;})});}_0x56fd97=_[_0xc9f3('0x4e')]({},_0x56fd97,_0x568641[_0xc9f3('0x50')]);return db[_0xc9f3('0x65')][_0xc9f3('0x2b')]({'where':_0x56fd97['where']})[_0xc9f3('0x33')](function(_0x5166d3){_0x7a9c1f[_0xc9f3('0x2b')]=_0x5166d3;if(_0x568641[_0xc9f3('0x43')][_0xc9f3('0x58')]){_0x56fd97[_0xc9f3('0x51')]=[{'all':!![]}];}return db[_0xc9f3('0x65')][_0xc9f3('0x68')](_0x56fd97);})[_0xc9f3('0x33')](function(_0x4019fe){_0x7a9c1f['rows']=_0x4019fe;return _0x7a9c1f;});}})['then'](respondWithFilteredResult(_0x3948dc,_0x56fd97))[_0xc9f3('0x26')](handleError(_0x3948dc,null));};exports[_0xc9f3('0x69')]=function(_0x554e80,_0x15b226,_0x5e792e){return db['FaxAccount']['find']({'where':{'id':_0x554e80[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x15b226,null))['then'](function(_0x144bc8){if(_0x144bc8){return _0x144bc8[_0xc9f3('0x69')](_0x554e80[_0xc9f3('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x15b226,null))['catch'](handleError(_0x15b226,null));};exports[_0xc9f3('0x6a')]=function(_0x156dbc,_0x47ed29,_0x515f96){if(_0x156dbc['body']['id']){delete _0x156dbc[_0xc9f3('0x5a')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x156dbc[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x47ed29,null))[_0xc9f3('0x33')](function(_0x3b0a9c){if(_0x3b0a9c){_0x156dbc[_0xc9f3('0x5a')][_0xc9f3('0x64')]=_0x3b0a9c['id'];return db['CannedAnswer'][_0xc9f3('0x59')](_0x156dbc[_0xc9f3('0x5a')]);}})[_0xc9f3('0x33')](respondWithResult(_0x47ed29,null))['catch'](handleError(_0x47ed29,null));};exports[_0xc9f3('0x6b')]=function(_0x2437e3,_0xf64ede,_0xdeee46){var _0x36ccc9={'raw':![],'where':{}};var _0x4b9ef5={};var _0x55ab52={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2437e3[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0xf64ede,null))[_0xc9f3('0x33')](function(_0x26e60c){if(_0x26e60c){_0x4b9ef5[_0xc9f3('0x42')]=_[_0xc9f3('0x56')](db[_0xc9f3('0x6c')][_0xc9f3('0x57')]);_0x4b9ef5['query']=_[_0xc9f3('0x56')](_0x2437e3[_0xc9f3('0x43')]);_0x4b9ef5[_0xc9f3('0x4c')]=_['intersection'](_0x4b9ef5[_0xc9f3('0x42')],_0x4b9ef5['query']);_0x36ccc9[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x4b9ef5[_0xc9f3('0x42')],qs[_0xc9f3('0x46')](_0x2437e3[_0xc9f3('0x43')][_0xc9f3('0x46')]));_0x36ccc9['attributes']=_0x36ccc9['attributes'][_0xc9f3('0x47')]?_0x36ccc9[_0xc9f3('0x45')]:_0x4b9ef5[_0xc9f3('0x42')];if(!_0x2437e3[_0xc9f3('0x43')][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x36ccc9[_0xc9f3('0x2a')]=qs['limit'](_0x2437e3[_0xc9f3('0x43')][_0xc9f3('0x2a')]);_0x36ccc9[_0xc9f3('0x2c')]=qs['offset'](_0x2437e3['query'][_0xc9f3('0x2c')]);}_0x36ccc9['order']=qs['sort'](_0x2437e3[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x36ccc9['where']=qs[_0xc9f3('0x4c')](_[_0xc9f3('0x4d')](_0x2437e3[_0xc9f3('0x43')],_0x4b9ef5[_0xc9f3('0x4c')]));_0x36ccc9[_0xc9f3('0x4b')][_0xc9f3('0x64')]=_0x26e60c['id'];if(_0x2437e3[_0xc9f3('0x43')][_0xc9f3('0x4f')]){_0x36ccc9[_0xc9f3('0x4b')]=_[_0xc9f3('0x4e')](_0x36ccc9['where'],{'$or':_['map'](_0x36ccc9[_0xc9f3('0x45')],function(_0x51ddde){var _0x1dd452={};_0x1dd452[_0x51ddde]={'$like':'%'+_0x2437e3[_0xc9f3('0x43')]['filter']+'%'};return _0x1dd452;})});}_0x36ccc9=_[_0xc9f3('0x4e')]({},_0x36ccc9,_0x2437e3[_0xc9f3('0x50')]);return db[_0xc9f3('0x6c')][_0xc9f3('0x2b')]({'where':_0x36ccc9[_0xc9f3('0x4b')]})['then'](function(_0x1f8275){_0x55ab52[_0xc9f3('0x2b')]=_0x1f8275;if(_0x2437e3[_0xc9f3('0x43')]['includeAll']){_0x36ccc9[_0xc9f3('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc9f3('0x68')](_0x36ccc9);})[_0xc9f3('0x33')](function(_0x261d0c){_0x55ab52[_0xc9f3('0x52')]=_0x261d0c;return _0x55ab52;});}})[_0xc9f3('0x33')](respondWithFilteredResult(_0xf64ede,_0x36ccc9))[_0xc9f3('0x26')](handleError(_0xf64ede,null));};exports['removeAnswers']=function(_0x596d81,_0x3ff9db,_0x19e92a){return db['FaxAccount'][_0xc9f3('0x5e')]({'where':{'id':_0x596d81['params']['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x3ff9db,null))[_0xc9f3('0x33')](function(_0x2556c8){if(_0x2556c8){return _0x2556c8['removeAnswers'](_0x596d81[_0xc9f3('0x43')][_0xc9f3('0x6d')]);}})[_0xc9f3('0x33')](respondWithStatusCode(_0x3ff9db,null))[_0xc9f3('0x26')](handleError(_0x3ff9db,null));};exports['addInteraction']=function(_0x4994dd,_0x40e0b2,_0x14eb40){return db[_0xc9f3('0x6e')]['find']({'where':{'id':_0x4994dd[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x40e0b2,null))[_0xc9f3('0x33')](function(_0x3e2540){if(_0x3e2540){return _0x3e2540[_0xc9f3('0x6f')](_0x4994dd[_0xc9f3('0x5a')][_0xc9f3('0x6d')],_[_0xc9f3('0x70')](_0x4994dd['body'],[_0xc9f3('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x40e0b2,null))[_0xc9f3('0x26')](handleError(_0x40e0b2,null));};exports[_0xc9f3('0x71')]=function(_0xca7259,_0x4f4db5,_0x291926){var _0x1b2712={'raw':![],'where':{}};var _0x12d721={};var _0x181d99={'count':0x0,'rows':[]};return db[_0xc9f3('0x3e')][_0xc9f3('0x72')]({'where':{'id':_0xca7259[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x4f4db5,null))[_0xc9f3('0x33')](function(_0x2fce07){if(_0x2fce07){_0x12d721[_0xc9f3('0x42')]=_[_0xc9f3('0x56')](db[_0xc9f3('0x6e')][_0xc9f3('0x57')]);_0x12d721['query']=_[_0xc9f3('0x56')](_0xca7259['query']);_0x12d721[_0xc9f3('0x4c')]=_['intersection'](_0x12d721[_0xc9f3('0x42')],_0x12d721[_0xc9f3('0x43')]);_0x1b2712[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x12d721[_0xc9f3('0x42')],qs[_0xc9f3('0x46')](_0xca7259['query'][_0xc9f3('0x46')]));_0x1b2712[_0xc9f3('0x45')]=_0x1b2712['attributes'][_0xc9f3('0x47')]?_0x1b2712[_0xc9f3('0x45')]:_0x12d721['model'];if(!_0xca7259['query'][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x1b2712[_0xc9f3('0x2a')]=qs['limit'](_0xca7259[_0xc9f3('0x43')][_0xc9f3('0x2a')]);_0x1b2712[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0xca7259['query'][_0xc9f3('0x2c')]);}_0x1b2712[_0xc9f3('0x67')]=qs['sort'](_0xca7259[_0xc9f3('0x43')]['sort']);_0x1b2712[_0xc9f3('0x4b')]=qs[_0xc9f3('0x4c')](_['pick'](_0xca7259[_0xc9f3('0x43')],_0x12d721['filters']));_0x1b2712[_0xc9f3('0x4b')][_0xc9f3('0x64')]=_0x2fce07['id'];if(_0xca7259[_0xc9f3('0x43')]['filter']){_0x1b2712[_0xc9f3('0x4b')]=_[_0xc9f3('0x4e')](_0x1b2712[_0xc9f3('0x4b')],{'$or':_[_0xc9f3('0x3d')](_0x1b2712['attributes'],function(_0x69341f){var _0x1c39f9={};_0x1c39f9[_0x69341f]={'$like':'%'+_0xca7259['query']['filter']+'%'};return _0x1c39f9;})});}_0x1b2712=_[_0xc9f3('0x4e')]({},_0x1b2712,_0xca7259['options']);return db['FaxInteraction'][_0xc9f3('0x2b')]({'where':_0x1b2712['where']})['then'](function(_0x3ea396){_0x181d99[_0xc9f3('0x2b')]=_0x3ea396;if(_0xca7259[_0xc9f3('0x43')][_0xc9f3('0x58')]){_0x1b2712[_0xc9f3('0x51')]=[{'model':db[_0xc9f3('0x73')],'as':_0xc9f3('0x74'),'required':![]},{'model':db[_0xc9f3('0x75')],'as':_0xc9f3('0x76'),'attributes':[_0xc9f3('0x39'),'fullname',_0xc9f3('0x77')],'required':![]},{'model':db['Tag'],'as':_0xc9f3('0x78'),'attributes':['id','name',_0xc9f3('0x79')],'where':_0xca7259['query'][_0xc9f3('0x7a')]?{'id':_0xca7259[_0xc9f3('0x43')][_0xc9f3('0x7a')]}:undefined,'required':_0xca7259['query'][_0xc9f3('0x7a')]?!![]:![]}];}return db[_0xc9f3('0x6e')][_0xc9f3('0x68')](_0x1b2712);})['then'](function(_0x238504){_0x181d99[_0xc9f3('0x52')]=_0x238504;return _0x181d99;});}})['then'](respondWithFilteredResult(_0x4f4db5,_0x1b2712))[_0xc9f3('0x26')](handleError(_0x4f4db5,null));};exports['addApplications']=function(_0x3e11fd,_0x33a8f2){var _0x6292ad=_0x3e11fd[_0xc9f3('0x54')]['id'];var _0x509f3a=_0x3e11fd[_0xc9f3('0x5a')];var _0x3326f2=0xc8;var _0x4e1145=null;return db[_0xc9f3('0x7b')]['transaction']({'isolationLevel':db['sequelize'][_0xc9f3('0x7c')][_0xc9f3('0x7d')]['READ_COMMITTED']},function(_0x39fcd4){return db[_0xc9f3('0x3e')]['findOne']({'where':{'id':_0x6292ad},'transaction':_0x39fcd4})[_0xc9f3('0x33')](function(_0x12b422){if(_0x12b422){return db[_0xc9f3('0x7e')][_0xc9f3('0x37')]({'where':{'FaxAccountId':_0x6292ad},'transaction':_0x39fcd4})[_0xc9f3('0x33')](function(){var _0x53ecba=_[_0xc9f3('0x3d')](_0x509f3a,function(_0x423d74){_0x423d74[_0xc9f3('0x64')]=_0x6292ad;return _0x423d74;});return db[_0xc9f3('0x7e')]['bulkCreate'](_0x53ecba,{'transaction':_0x39fcd4});});}else{_0x3326f2=0x194;_0x4e1145=[];}});})['then'](function(){if(_0x3326f2!==0x194){return db[_0xc9f3('0x7e')][_0xc9f3('0x7f')]({'where':{'FaxAccountId':_0x6292ad},'order':'priority'})[_0xc9f3('0x33')](function(_0x107265){_0x4e1145=_0x107265;});}})[_0xc9f3('0x26')](function(_0x498e66){_0x3326f2=0x1f4;logger['error'](_0x498e66[_0xc9f3('0x38')]);if(_0x498e66['name']){delete _0x498e66['name'];}_0x4e1145=_0x498e66;})[_0xc9f3('0x80')](function(){if(_0x4e1145===null){_0x33a8f2[_0xc9f3('0x27')](_0x3326f2);}else{if(_0x3326f2===0x1f4){_0x33a8f2[_0xc9f3('0x28')](_0x3326f2)['send'](_0x4e1145);}else{_0x33a8f2[_0xc9f3('0x28')](_0x3326f2)['json'](_0x4e1145);}}});};exports[_0xc9f3('0x81')]=function(_0x4dda9a,_0x42c5cd,_0x59ea24){var _0x3dc454={};var _0x31798d={};var _0xaff500;var _0x2515dc;return db[_0xc9f3('0x3e')][_0xc9f3('0x72')]({'where':{'id':_0x4dda9a['params']['id']}})['then'](handleEntityNotFound(_0x42c5cd,null))[_0xc9f3('0x33')](function(_0x2e581f){if(_0x2e581f){_0xaff500=_0x2e581f;_0x31798d[_0xc9f3('0x42')]=_[_0xc9f3('0x56')](db[_0xc9f3('0x7e')][_0xc9f3('0x57')]);_0x31798d[_0xc9f3('0x43')]=_['keys'](_0x4dda9a[_0xc9f3('0x43')]);_0x31798d[_0xc9f3('0x4c')]=_[_0xc9f3('0x44')](_0x31798d[_0xc9f3('0x42')],_0x31798d[_0xc9f3('0x43')]);_0x3dc454[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x31798d['model'],qs[_0xc9f3('0x46')](_0x4dda9a['query'][_0xc9f3('0x46')]));_0x3dc454[_0xc9f3('0x45')]=_0x3dc454['attributes'][_0xc9f3('0x47')]?_0x3dc454[_0xc9f3('0x45')]:_0x31798d[_0xc9f3('0x42')];_0x3dc454[_0xc9f3('0x67')]=qs['sort'](_0x4dda9a[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x3dc454[_0xc9f3('0x4b')]=qs[_0xc9f3('0x4c')](_['pick'](_0x4dda9a[_0xc9f3('0x43')],_0x31798d[_0xc9f3('0x4c')]));if(_0x4dda9a[_0xc9f3('0x43')][_0xc9f3('0x4f')]){_0x3dc454['where']=_['merge'](_0x3dc454[_0xc9f3('0x4b')],{'$or':_[_0xc9f3('0x3d')](_0x3dc454[_0xc9f3('0x45')],function(_0x4e00a7){var _0x42b31c={};_0x42b31c[_0x4e00a7]={'$like':'%'+_0x4dda9a[_0xc9f3('0x43')]['filter']+'%'};return _0x42b31c;})});}_0x3dc454=_[_0xc9f3('0x4e')]({},_0x3dc454,_0x4dda9a[_0xc9f3('0x50')]);return _0xaff500[_0xc9f3('0x81')](_0x3dc454);}})['then'](function(_0x3c5280){if(_0x3c5280){_0x2515dc=_0x3c5280[_0xc9f3('0x47')];if(!_0x4dda9a[_0xc9f3('0x43')][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x3dc454[_0xc9f3('0x2a')]=qs[_0xc9f3('0x2a')](_0x4dda9a[_0xc9f3('0x43')][_0xc9f3('0x2a')]);_0x3dc454[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0x4dda9a[_0xc9f3('0x43')][_0xc9f3('0x2c')]);}return _0xaff500['getApplications'](_0x3dc454);}})[_0xc9f3('0x33')](function(_0x31a393){if(_0x31a393){return _0x31a393?{'count':_0x2515dc,'rows':_0x31a393}:null;}})[_0xc9f3('0x33')](respondWithResult(_0x42c5cd,null))['catch'](handleError(_0x42c5cd,null));};function Extension(_0x129ff7,_0x13c3d1,_0x2ca1f3,_0x581569){this[_0xc9f3('0x82')]=_0xc9f3('0x83');this[_0xc9f3('0x84')]=_0x129ff7[_0xc9f3('0x85')];this[_0xc9f3('0x86')]=_0x581569;this[_0xc9f3('0x40')]=_0xc9f3('0x87');this[_0xc9f3('0x88')]='Fax\x20Extension';this[_0xc9f3('0x64')]=_0x129ff7['id'];this[_0xc9f3('0x89')]=_0x13c3d1;this['appdata']=_0x2ca1f3;}function createExtensionsReciveFax(_0x2b06f9){var _0x59b960=0x1;var _0x55f30d=[];_0x55f30d[_0xc9f3('0x8a')](new Extension(_0x2b06f9,_0x59b960,'',_0xc9f3('0x8b')));_0x59b960+=0x1;_0x55f30d[_0xc9f3('0x8a')](new Extension(_0x2b06f9,_0x59b960,_0xc9f3('0x8c'),_0xc9f3('0x8d')));_0x59b960+=0x1;for(var _0x37b1c7 in _0x2b06f9){if(_0x2b06f9[_0xc9f3('0x48')](_0x37b1c7)&&(_0x37b1c7===_0xc9f3('0x8e')||_0x37b1c7===_0xc9f3('0x85')||_0x37b1c7===_0xc9f3('0x8f')||_0x37b1c7===_0xc9f3('0x90')||_0x37b1c7===_0xc9f3('0x91')||_0x37b1c7===_0xc9f3('0x92')||_0x37b1c7===_0xc9f3('0x93')||_0x37b1c7==='modem'||_0x37b1c7===_0xc9f3('0x94'))){_0x55f30d[_0xc9f3('0x8a')](new Extension(_0x2b06f9,_0x59b960,_0xc9f3('0x95')+_0x37b1c7+')='+_0x2b06f9[_0x37b1c7],'Set'));_0x59b960+=0x1;}}_0x55f30d[_0xc9f3('0x8a')](new Extension(_0x2b06f9,_0x59b960,'6',_0xc9f3('0x96')));_0x59b960+=0x1;_0x55f30d[_0xc9f3('0x8a')](new Extension(_0x2b06f9,_0x59b960,'/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',_0xc9f3('0x97')));_0x59b960=0x0;return _0x55f30d;}exports['addAccountApplications']=function(_0x3ae0bc,_0x24f38a,_0x31a42e){var _0xc05232;return db[_0xc9f3('0x7b')][_0xc9f3('0x98')](function(_0x1ac675){return db[_0xc9f3('0x3e')][_0xc9f3('0x59')](_0x3ae0bc['body'],{'transaction':_0x1ac675})['then'](function(_0x16cb49){_0xc05232=_0x16cb49['get']({'plain':!![]});return db[_0xc9f3('0x99')][_0xc9f3('0x9a')](createExtensionsReciveFax(_0xc05232),{'transaction':_0x1ac675});});})[_0xc9f3('0x33')](function(){return _0xc05232;})[_0xc9f3('0x33')](respondWithResult(_0x24f38a,null))['catch'](handleError(_0x24f38a,null));};exports[_0xc9f3('0x9b')]=function(_0x3f6b88,_0x443e70,_0x2d4dc0){var _0x26a1d4;return db[_0xc9f3('0x7b')][_0xc9f3('0x98')](function(_0x34dba9){return db[_0xc9f3('0x3e')][_0xc9f3('0x32')](_0x3f6b88['body'],{'where':{'id':_0x3f6b88['body']['id']},'transaction':_0x34dba9})['then'](function(_0x372b87){return db[_0xc9f3('0x99')]['destroy']({'where':{'FaxAccountId':_0x3f6b88['body']['id']},'transaction':_0x34dba9})[_0xc9f3('0x33')](function(_0x19986d){return db[_0xc9f3('0x99')][_0xc9f3('0x9a')](createExtensionsReciveFax(_[_0xc9f3('0x70')](_0x3f6b88[_0xc9f3('0x5a')],[_0xc9f3('0x9c'),_0xc9f3('0x41'),_0xc9f3('0x9d'),_0xc9f3('0x9e'),_0xc9f3('0x9f'),'ListId'])),{'transaction':_0x34dba9});});});})['then'](function(){return db['FaxAccount']['findById'](_0x3f6b88['body']['id']);})[_0xc9f3('0x33')](respondWithResult(_0x443e70,null))['catch'](handleError(_0x443e70,null));};exports[_0xc9f3('0xa0')]=function(_0x3c1a2c,_0x410fac,_0x64a214){var _0x11284c={'raw':!![],'where':{}};var _0x388bfe={};var _0x192638={'count':0x0,'rows':[]};return db[_0xc9f3('0x3e')][_0xc9f3('0x72')]({'where':{'id':_0x3c1a2c['params']['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x410fac,null))[_0xc9f3('0x33')](function(_0x3b99e1){if(_0x3b99e1){_0x388bfe[_0xc9f3('0x42')]=_[_0xc9f3('0x56')](db[_0xc9f3('0xa1')]['rawAttributes']);_0x388bfe[_0xc9f3('0x43')]=_[_0xc9f3('0x56')](_0x3c1a2c['query']);_0x388bfe[_0xc9f3('0x4c')]=_[_0xc9f3('0x44')](_0x388bfe[_0xc9f3('0x42')],_0x388bfe['query']);_0x11284c['attributes']=_[_0xc9f3('0x44')](_0x388bfe[_0xc9f3('0x42')],qs[_0xc9f3('0x46')](_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x46')]));_0x11284c[_0xc9f3('0x45')]=_0x11284c[_0xc9f3('0x45')]['length']?_0x11284c[_0xc9f3('0x45')]:_0x388bfe[_0xc9f3('0x42')];if(!_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x48')](_0xc9f3('0x49'))){_0x11284c[_0xc9f3('0x2a')]=qs['limit'](_0x3c1a2c['query'][_0xc9f3('0x2a')]);_0x11284c[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x2c')]);}_0x11284c[_0xc9f3('0x67')]=qs[_0xc9f3('0x4a')](_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x11284c[_0xc9f3('0x4b')]=qs[_0xc9f3('0x4c')](_['pick'](_0x3c1a2c[_0xc9f3('0x43')],_0x388bfe[_0xc9f3('0x4c')]));_0x11284c[_0xc9f3('0x4b')][_0xc9f3('0x64')]=_0x3b99e1['id'];if(_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x4f')]){_0x11284c[_0xc9f3('0x4b')]=_[_0xc9f3('0x4e')](_0x11284c['where'],{'$or':_['map'](_0x11284c[_0xc9f3('0x45')],function(_0x3ea613){var _0x2d0199={};_0x2d0199[_0x3ea613]={'$like':'%'+_0x3c1a2c['query']['filter']+'%'};return _0x2d0199;})});}if(_0x3c1a2c[_0xc9f3('0x43')]['$gte']){var _0x33aadc=_0x3c1a2c['query'][_0xc9f3('0xa2')]['split'](',');var _0x270741={};_0x270741[_0x33aadc[0x0]]={'$gte':moment(_0x33aadc[0x1])[_0xc9f3('0xa3')](_0xc9f3('0xa4'))};_0x11284c['where']=_['merge'](_0x11284c[_0xc9f3('0x4b')],_0x270741);}_0x11284c=_['merge']({},_0x11284c,_0x3c1a2c[_0xc9f3('0x50')]);return db[_0xc9f3('0xa1')]['count']({'where':_0x11284c[_0xc9f3('0x4b')]})[_0xc9f3('0x33')](function(_0x49cf75){_0x192638[_0xc9f3('0x2b')]=_0x49cf75;if(_0x3c1a2c[_0xc9f3('0x43')][_0xc9f3('0x58')]){_0x11284c[_0xc9f3('0x51')]=[{'all':!![]}];}return db[_0xc9f3('0xa1')]['findAll'](_0x11284c);})[_0xc9f3('0x33')](function(_0x13e64d){_0x192638[_0xc9f3('0x52')]=_0x13e64d;return _0x192638;});}})['then'](respondWithFilteredResult(_0x410fac,_0x11284c))[_0xc9f3('0x26')](handleError(_0x410fac,null));};exports['send']=function(_0x47f0a3,_0x4ef0ab,_0x2563d3){var _0x24debb,_0x5e565f={},_0x1b5e8b;if(_0x47f0a3[_0xc9f3('0x5a')]['to']){_0x1b5e8b=_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0];}return db['FaxAccount'][_0xc9f3('0x5e')]({'where':{'id':_0x47f0a3[_0xc9f3('0x54')]['id']},'include':[{'model':db[_0xc9f3('0xa5')],'as':_0xc9f3('0xa6'),'include':[{'model':db[_0xc9f3('0x73')],'as':_0xc9f3('0xa7'),'where':{'fax':_0x1b5e8b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xc9f3('0x33')](handleEntityNotFound(_0x4ef0ab,null))[_0xc9f3('0x33')](function(_0x43d04f){_0x24debb=_0x43d04f;if(_0x47f0a3['body']['attachments']&&_0x47f0a3['body'][_0xc9f3('0xa8')]['length']){for(var _0x411795=0x0;_0x411795<_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][_0xc9f3('0x47')];_0x411795+=0x1){_0x47f0a3['body'][_0xc9f3('0xa8')][_0x411795]={'filename':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][_0x411795][_0xc9f3('0x39')],'id':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][_0x411795]['id'],'path':path[_0xc9f3('0xa9')](config[_0xc9f3('0xaa')],'server/files/attachments',_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][_0x411795][_0xc9f3('0xab')])};}}return respondWithRpcPromise(_0xc9f3('0xac'),_0xc9f3('0xac'),{'FaxAccountId':_[_0xc9f3('0xad')](_0x47f0a3['params']['id'])?undefined:_0x47f0a3['params']['id'],'path':_[_0xc9f3('0xad')](_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0][_0xc9f3('0x8')])?undefined:_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0][_0xc9f3('0x8')],'fax':_[_0xc9f3('0xad')](_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0])?undefined:_0x47f0a3['body']['to'][0x0]},client9002);})[_0xc9f3('0x33')](function(){if(_0x24debb){if(_[_0xc9f3('0xad')](_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xae')])){_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xae')]=util[_0xc9f3('0xa3')](_0xc9f3('0xaf'),_0x24debb['name'],_0x24debb['fax']);}if(_0x24debb[_0xc9f3('0xa6')]){if(_0x24debb[_0xc9f3('0xa6')][_0xc9f3('0xa7')]['length']){return _0x24debb[_0xc9f3('0xa6')][_0xc9f3('0xa7')][0x0];}else{return db['CmContact'][_0xc9f3('0x59')](_[_0xc9f3('0xb0')](_0x47f0a3[_0xc9f3('0x5a')],{'firstName':_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0],'phone':_0x47f0a3['body']['to'][0x0],'fax':_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0],'ListId':_0x24debb[_0xc9f3('0xb1')]}));}}else{throw new Error(_0xc9f3('0xb2'));}}else{throw new Error(_0xc9f3('0xb3'));}})[_0xc9f3('0x33')](function(_0x12c291){if(_0x12c291){return db[_0xc9f3('0x6e')][_0xc9f3('0x5e')]({'where':{'ContactId':_0x12c291['id'],'closed':![],'FaxAccountId':_0x24debb['id']}})['then'](function(_0x4a7d82){if(_0x4a7d82){return[_0x4a7d82,![]];}return db[_0xc9f3('0x6e')][_0xc9f3('0x59')]({'UserId':_0x47f0a3[_0xc9f3('0x5b')]['id'],'ContactId':_0x12c291['id'],'FaxAccountId':_0x24debb['id'],'fax':_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0],'firstMsgDirection':_0xc9f3('0xb4'),'Messages':[_['merge'](_0x47f0a3[_0xc9f3('0x5a')],{'read':![],'body':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0]['filename'],'FaxAccountId':_0x24debb['id'],'UserId':_0x47f0a3[_0xc9f3('0x5b')]['id'],'ContactId':_0x12c291['id'],'AttachmentId':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xc9f3('0xb5')}]})[_0xc9f3('0x33')](function(_0x355cfa){return[_0x355cfa,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc9f3('0xb6')](function(_0x3b409d,_0x45a1a6){if(_0x45a1a6){return _0x3b409d;}return db[_0xc9f3('0xa1')]['create']({'direction':_0xc9f3('0xb4'),'read':![],'body':_0x47f0a3['body']['attachments'][0x0][_0xc9f3('0xb7')],'FaxAccountId':_0x24debb['id'],'FaxInteractionId':_0x3b409d['id'],'UserId':_0x47f0a3[_0xc9f3('0x5b')]['id'],'ContactId':_0x3b409d[_0xc9f3('0xb8')],'AttachmentId':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0]['id']})[_0xc9f3('0x33')](function(_0x626c0e){_0x3b409d[_0xc9f3('0xb9')][_0xc9f3('0xb5')]=[];_0x3b409d['dataValues'][_0xc9f3('0xb5')]['push'](_0x626c0e[_0xc9f3('0xb9')]);return _0x3b409d;});})[_0xc9f3('0x33')](function(_0x10b0c0){respondWithRpcPromise(_0xc9f3('0xba'),_0xc9f3('0xba'),{'FaxAccountId':_[_0xc9f3('0xad')](_0x47f0a3[_0xc9f3('0x54')]['id'])?undefined:_0x47f0a3[_0xc9f3('0x54')]['id'],'path':_[_0xc9f3('0xad')](_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0][_0xc9f3('0x8')])?undefined:_0x47f0a3['body'][_0xc9f3('0xa8')][0x0]['path'],'fax':_['isNil'](_0x47f0a3['body']['to'][0x0])?undefined:_0x47f0a3[_0xc9f3('0x5a')]['to'][0x0],'AttachmentId':_0x47f0a3[_0xc9f3('0x5a')][_0xc9f3('0xa8')][0x0]['id']},client9002)['then'](function(_0x1903a3){logger['info'](_0xc9f3('0xbb'),_0x1903a3);})['catch'](function(_0x5106da){logger[_0xc9f3('0x1f')](_0xc9f3('0xbb'),_0x5106da);});return _0x10b0c0;})['then'](respondWithResult(_0x4ef0ab,null))[_0xc9f3('0x26')](handleError(_0x4ef0ab,null));};exports[_0xc9f3('0xbc')]=function(_0x43da5f,_0x26bd04,_0x50fa7e){return db[_0xc9f3('0x3e')]['find']({'where':{'id':_0x43da5f[_0xc9f3('0x54')]['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x26bd04,null))[_0xc9f3('0x33')](function(_0x3e0c9f){if(_0x3e0c9f){return _0x3e0c9f[_0xc9f3('0xbc')](_0x43da5f['body'][_0xc9f3('0x6d')],_['omit'](_0x43da5f[_0xc9f3('0x5a')],['ids','id'])||{})[_0xc9f3('0xb6')](function(_0x596f7c){for(var _0x289194=0x0;_0x289194<_0x43da5f[_0xc9f3('0x5a')][_0xc9f3('0x6d')][_0xc9f3('0x47')];_0x289194+=0x1){socket[_0xc9f3('0xbd')](_0xc9f3('0xbe'),{'UserId':Number(_0x43da5f[_0xc9f3('0x5a')]['ids'][_0x289194]),'FaxAccountId':Number(_0x43da5f[_0xc9f3('0x54')]['id'])});}return _0x596f7c;});}})[_0xc9f3('0x33')](respondWithResult(_0x26bd04,null))['catch'](handleError(_0x26bd04,null));};exports[_0xc9f3('0xbf')]=function(_0x48fd49,_0x2df396,_0x22d6d1){return db['FaxAccount'][_0xc9f3('0x5e')]({'where':{'id':_0x48fd49[_0xc9f3('0x54')]['id']}})['then'](handleEntityNotFound(_0x2df396,null))[_0xc9f3('0x33')](function(_0x249074){if(_0x249074){return _0x249074[_0xc9f3('0xbf')](_0x48fd49[_0xc9f3('0x43')][_0xc9f3('0x6d')])[_0xc9f3('0x33')](function(){if(_[_0xc9f3('0xc0')](_0x48fd49[_0xc9f3('0x43')][_0xc9f3('0x6d')])){for(var _0x954b48=0x0;_0x954b48<_0x48fd49[_0xc9f3('0x43')]['ids'][_0xc9f3('0x47')];_0x954b48+=0x1){socket[_0xc9f3('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x48fd49[_0xc9f3('0x43')][_0xc9f3('0x6d')][_0x954b48]),'FaxAccountId':Number(_0x48fd49[_0xc9f3('0x54')]['id'])});}}else{socket['emit'](_0xc9f3('0xc1'),{'UserId':Number(_0x48fd49['query'][_0xc9f3('0x6d')]),'FaxAccountId':Number(_0x48fd49[_0xc9f3('0x54')]['id'])});}});}})[_0xc9f3('0x33')](respondWithStatusCode(_0x2df396,null))[_0xc9f3('0x26')](handleError(_0x2df396,null));};exports['getAgents']=function(_0x17fcbe,_0x5db979,_0x4f2b00){var _0x54c828={};var _0x2373d3={};var _0x1eb5b3;var _0x10269f;return db[_0xc9f3('0x3e')][_0xc9f3('0x72')]({'where':{'id':_0x17fcbe['params']['id']}})[_0xc9f3('0x33')](handleEntityNotFound(_0x5db979,null))[_0xc9f3('0x33')](function(_0x45162a){if(_0x45162a){_0x1eb5b3=_0x45162a;_0x2373d3[_0xc9f3('0x42')]=_['keys'](db[_0xc9f3('0x75')][_0xc9f3('0x57')]);_0x2373d3[_0xc9f3('0x43')]=_[_0xc9f3('0x56')](_0x17fcbe[_0xc9f3('0x43')]);_0x2373d3[_0xc9f3('0x4c')]=_[_0xc9f3('0x44')](_0x2373d3['model'],_0x2373d3[_0xc9f3('0x43')]);_0x54c828[_0xc9f3('0x45')]=_[_0xc9f3('0x44')](_0x2373d3[_0xc9f3('0x42')],qs[_0xc9f3('0x46')](_0x17fcbe[_0xc9f3('0x43')][_0xc9f3('0x46')]));_0x54c828[_0xc9f3('0x45')]=_0x54c828[_0xc9f3('0x45')]['length']?_0x54c828[_0xc9f3('0x45')]:_0x2373d3['model'];_0x54c828[_0xc9f3('0x67')]=qs[_0xc9f3('0x4a')](_0x17fcbe[_0xc9f3('0x43')][_0xc9f3('0x4a')]);_0x54c828[_0xc9f3('0x4b')]=qs['filters'](_[_0xc9f3('0x4d')](_0x17fcbe[_0xc9f3('0x43')],_0x2373d3[_0xc9f3('0x4c')]));if(_0x17fcbe[_0xc9f3('0x43')][_0xc9f3('0x4f')]){_0x54c828[_0xc9f3('0x4b')]=_['merge'](_0x54c828[_0xc9f3('0x4b')],{'$or':_[_0xc9f3('0x3d')](_0x54c828[_0xc9f3('0x45')],function(_0x5aca19){var _0x55d0ab={};_0x55d0ab[_0x5aca19]={'$like':'%'+_0x17fcbe['query'][_0xc9f3('0x4f')]+'%'};return _0x55d0ab;})});}_0x54c828=_[_0xc9f3('0x4e')]({},_0x54c828,_0x17fcbe[_0xc9f3('0x50')]);return _0x1eb5b3[_0xc9f3('0xc2')](_0x54c828);}})['then'](function(_0x229347){if(_0x229347){_0x10269f=_0x229347[_0xc9f3('0x47')];if(!_0x17fcbe['query']['hasOwnProperty']('nolimit')){_0x54c828['limit']=qs['limit'](_0x17fcbe[_0xc9f3('0x43')]['limit']);_0x54c828[_0xc9f3('0x2c')]=qs[_0xc9f3('0x2c')](_0x17fcbe[_0xc9f3('0x43')]['offset']);}return _0x1eb5b3['getAgents'](_0x54c828);}})[_0xc9f3('0x33')](function(_0x22ddfc){if(_0x22ddfc){return _0x22ddfc?{'count':_0x10269f,'rows':_0x22ddfc}:null;}})[_0xc9f3('0x33')](respondWithResult(_0x5db979,null))[_0xc9f3('0x26')](handleError(_0x5db979,null));}; \ No newline at end of file +var _0xa92f=['defaults','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','FaxAccount','findAll','rows','show','params','Pause','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','order','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','finally','send','getApplications','context','from-voip-provider','exten','app','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','minrate','modem','FAXOPT(','Set','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','get','VoiceExtension','bulkCreate','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts'];(function(_0x5a7a17,_0x15a007){var _0x3dd9a5=function(_0x126a05){while(--_0x126a05){_0x5a7a17['push'](_0x5a7a17['shift']());}};_0x3dd9a5(++_0x15a007);}(_0xa92f,0xda));var _0xfa92=function(_0x5858ed,_0x17b101){_0x5858ed=_0x5858ed-0x0;var _0x219695=_0xa92f[_0x5858ed];return _0x219695;};'use strict';var emlformat=require(_0xfa92('0x0'));var rimraf=require(_0xfa92('0x1'));var zipdir=require(_0xfa92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa92('0x3'));var moment=require('moment');var BPromise=require(_0xfa92('0x4'));var Mustache=require('mustache');var util=require(_0xfa92('0x5'));var path=require(_0xfa92('0x6'));var sox=require('sox');var csv=require(_0xfa92('0x7'));var ejs=require(_0xfa92('0x8'));var fs=require('fs');var fs_extra=require(_0xfa92('0x9'));var _=require(_0xfa92('0xa'));var squel=require(_0xfa92('0xb'));var crypto=require(_0xfa92('0xc'));var jsforce=require(_0xfa92('0xd'));var deskjs=require(_0xfa92('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfa92('0xf'));var Redis=require(_0xfa92('0x10'));var authService=require(_0xfa92('0x11'));var qs=require(_0xfa92('0x12'));var as=require(_0xfa92('0x13'));var hardwareService=require(_0xfa92('0x14'));var logger=require('../../config/logger')(_0xfa92('0x15'));var utils=require('../../config/utils');var config=require(_0xfa92('0x16'));var licenseUtil=require(_0xfa92('0x17'));var db=require('../../mysqldb')['db'];config[_0xfa92('0x18')]=_['defaults'](config[_0xfa92('0x18')],{'host':_0xfa92('0x19'),'port':0x18eb});var socket=require(_0xfa92('0x1a'))(new Redis(config[_0xfa92('0x18')]));require(_0xfa92('0x1b'))['register'](socket);var jayson=require(_0xfa92('0x1c'));var client=jayson['client'][_0xfa92('0x1d')]({'port':0x232c});var client9002=jayson[_0xfa92('0x1e')][_0xfa92('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x442d8c,_0x81d224,_0xdc422a,_0x1efc03){return new BPromise(function(_0x4c2f0c,_0x473e7f){var _0x4fd997=_0x1efc03||client;return _0x4fd997[_0xfa92('0x1f')](_0x442d8c,_0xdc422a)[_0xfa92('0x20')](function(_0x3d1a84){logger[_0xfa92('0x21')](_0xfa92('0x22'),_0x81d224,'request\x20sent');logger[_0xfa92('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x81d224,_0xfa92('0x24'),JSON[_0xfa92('0x25')](_0x3d1a84));if(_0x3d1a84[_0xfa92('0x26')]){if(_0x3d1a84['error']['code']===0x1f4){logger[_0xfa92('0x26')]('FaxAccount,\x20%s,\x20%s',_0x81d224,_0x3d1a84['error']['message']);return _0x473e7f(_0x3d1a84[_0xfa92('0x26')][_0xfa92('0x27')]);}logger[_0xfa92('0x26')](_0xfa92('0x22'),_0x81d224,_0x3d1a84[_0xfa92('0x26')]['message']);return _0x4c2f0c(_0x3d1a84[_0xfa92('0x26')][_0xfa92('0x27')]);}else{logger[_0xfa92('0x21')]('FaxAccount,\x20%s,\x20%s',_0x81d224,_0xfa92('0x24'));_0x4c2f0c(_0x3d1a84[_0xfa92('0x28')][_0xfa92('0x27')]);}})[_0xfa92('0x29')](function(_0x5a54a8){logger['error'](_0xfa92('0x22'),_0x81d224,_0x5a54a8);_0x473e7f(_0x5a54a8);});});}function respondWithStatusCode(_0x48f0be,_0x9e5dda){_0x9e5dda=_0x9e5dda||0xcc;return function(_0x403e69){if(_0x403e69){return _0x48f0be[_0xfa92('0x2a')](_0x9e5dda);}return _0x48f0be[_0xfa92('0x2b')](_0x9e5dda)[_0xfa92('0x2c')]();};}function respondWithResult(_0x40c89c,_0x1ff7a3){_0x1ff7a3=_0x1ff7a3||0xc8;return function(_0xf25079){if(_0xf25079){return _0x40c89c['status'](_0x1ff7a3)[_0xfa92('0x2d')](_0xf25079);}};}function respondWithFilteredResult(_0xc81f41,_0x4ee054){return function(_0x443022){if(_0x443022){var _0x265a39=typeof _0x4ee054[_0xfa92('0x2e')]==='undefined'&&typeof _0x4ee054[_0xfa92('0x2f')]==='undefined';var _0x491062=_0x443022[_0xfa92('0x30')];var _0x3a8f71=_0x265a39?0x0:_0x4ee054[_0xfa92('0x2e')];var _0xdd8655=_0x265a39?_0x443022[_0xfa92('0x30')]:_0x4ee054[_0xfa92('0x2e')]+_0x4ee054[_0xfa92('0x2f')];var _0x21aa37;if(_0xdd8655>=_0x491062){_0xdd8655=_0x491062;_0x21aa37=0xc8;}else{_0x21aa37=0xce;}_0xc81f41['status'](_0x21aa37);return _0xc81f41[_0xfa92('0x31')](_0xfa92('0x32'),_0x3a8f71+'-'+_0xdd8655+'/'+_0x491062)[_0xfa92('0x2d')](_0x443022);}return null;};}function patchUpdates(_0x5a5c5a){return function(_0x5c4c12){try{jsonpatch[_0xfa92('0x33')](_0x5c4c12,_0x5a5c5a,!![]);}catch(_0x3fbdf9){return BPromise['reject'](_0x3fbdf9);}return _0x5c4c12[_0xfa92('0x34')]();};}function saveUpdates(_0x3b173c,_0x10a70d){return function(_0x30bc20){if(_0x30bc20){return _0x30bc20[_0xfa92('0x35')](_0x3b173c)['then'](function(_0x5489c4){return _0x5489c4;});}return null;};}function removeEntity(_0x221c66,_0x1d9109){return function(_0x327f8f){if(_0x327f8f){return _0x327f8f[_0xfa92('0x36')]()[_0xfa92('0x20')](function(){var _0x4a903b=_0x327f8f['get']({'plain':!![]});var _0x5a7ab5=_0xfa92('0x37');return db[_0xfa92('0x38')][_0xfa92('0x36')]({'where':{'type':_0x5a7ab5,'resourceId':_0x4a903b['id']}})[_0xfa92('0x20')](function(){return _0x327f8f;});})['then'](function(){_0x221c66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f590,_0x166084){return function(_0x918ddd){if(!_0x918ddd){_0x58f590[_0xfa92('0x2a')](0x194);}return _0x918ddd;};}function handleError(_0x3b8954,_0xab5d7e){_0xab5d7e=_0xab5d7e||0x1f4;return function(_0x23908c){logger[_0xfa92('0x26')](_0x23908c[_0xfa92('0x39')]);if(_0x23908c[_0xfa92('0x3a')]){delete _0x23908c[_0xfa92('0x3a')];}_0x3b8954['status'](_0xab5d7e)['send'](_0x23908c);};}exports[_0xfa92('0x3b')]=function(_0xc347cb,_0x432a28){var _0x153995={'include':[{'model':db['Pause'],'as':_0xfa92('0x3c')}]},_0x5c932c={},_0x4f0158={'count':0x0,'rows':[]};var _0x551d20=_[_0xfa92('0x3d')](db['FaxAccount'][_0xfa92('0x3e')],function(_0x5ca9f9){return{'name':_0x5ca9f9[_0xfa92('0x3f')],'type':_0x5ca9f9[_0xfa92('0x40')][_0xfa92('0x41')]};});_0x5c932c['model']=_['map'](_0x551d20,_0xfa92('0x3a'));_0x5c932c['query']=_['keys'](_0xc347cb[_0xfa92('0x42')]);_0x5c932c[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x5c932c[_0xfa92('0x45')],_0x5c932c['query']);_0x153995[_0xfa92('0x46')]=_['intersection'](_0x5c932c['model'],qs['fields'](_0xc347cb[_0xfa92('0x42')][_0xfa92('0x47')]));_0x153995[_0xfa92('0x46')]=_0x153995[_0xfa92('0x46')][_0xfa92('0x48')]?_0x153995[_0xfa92('0x46')]:_0x5c932c[_0xfa92('0x45')];if(!_0xc347cb[_0xfa92('0x42')][_0xfa92('0x49')]('nolimit')){_0x153995[_0xfa92('0x2f')]=qs['limit'](_0xc347cb[_0xfa92('0x42')][_0xfa92('0x2f')]);_0x153995[_0xfa92('0x2e')]=qs[_0xfa92('0x2e')](_0xc347cb['query']['offset']);}_0x153995['order']=qs[_0xfa92('0x4a')](_0xc347cb[_0xfa92('0x42')][_0xfa92('0x4a')]);_0x153995['where']=qs[_0xfa92('0x43')](_[_0xfa92('0x4b')](_0xc347cb[_0xfa92('0x42')],_0x5c932c[_0xfa92('0x43')]),_0x551d20);if(_0xc347cb['query'][_0xfa92('0x4c')]){_0x153995[_0xfa92('0x4d')]=_[_0xfa92('0x4e')](_0x153995[_0xfa92('0x4d')],{'$or':_[_0xfa92('0x3d')](_0x551d20,function(_0x5cd407){if(_0x5cd407[_0xfa92('0x40')]!==_0xfa92('0x4f')){var _0xc95688={};_0xc95688[_0x5cd407[_0xfa92('0x3a')]]={'$like':'%'+_0xc347cb[_0xfa92('0x42')]['filter']+'%'};return _0xc95688;}})});}_0x153995=_[_0xfa92('0x4e')]({},_0x153995,_0xc347cb[_0xfa92('0x50')]);var _0x5cbf95={'where':_0x153995[_0xfa92('0x4d')]};return db['FaxAccount'][_0xfa92('0x30')](_0x5cbf95)[_0xfa92('0x20')](function(_0x4c6678){_0x4f0158[_0xfa92('0x30')]=_0x4c6678;if(_0xc347cb[_0xfa92('0x42')][_0xfa92('0x51')]){_0x153995[_0xfa92('0x52')]=[{'all':!![]}];}return db[_0xfa92('0x53')][_0xfa92('0x54')](_0x153995);})[_0xfa92('0x20')](function(_0x2f1a7b){_0x4f0158[_0xfa92('0x55')]=_0x2f1a7b;return _0x4f0158;})[_0xfa92('0x20')](respondWithFilteredResult(_0x432a28,_0x153995))[_0xfa92('0x29')](handleError(_0x432a28,null));};exports[_0xfa92('0x56')]=function(_0x59b02b,_0x12b785){var _0x51ee39={'raw':![],'where':{'id':_0x59b02b[_0xfa92('0x57')]['id']},'include':[{'model':db[_0xfa92('0x58')],'as':_0xfa92('0x3c')}]},_0x248a1d={};_0x248a1d[_0xfa92('0x45')]=_['keys'](db[_0xfa92('0x53')][_0xfa92('0x3e')]);_0x248a1d[_0xfa92('0x42')]=_[_0xfa92('0x59')](_0x59b02b[_0xfa92('0x42')]);_0x248a1d[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x248a1d['model'],_0x248a1d[_0xfa92('0x42')]);_0x51ee39[_0xfa92('0x46')]=_[_0xfa92('0x44')](_0x248a1d['model'],qs[_0xfa92('0x47')](_0x59b02b[_0xfa92('0x42')][_0xfa92('0x47')]));_0x51ee39[_0xfa92('0x46')]=_0x51ee39[_0xfa92('0x46')]['length']?_0x51ee39[_0xfa92('0x46')]:_0x248a1d[_0xfa92('0x45')];if(_0x59b02b[_0xfa92('0x42')][_0xfa92('0x51')]){_0x51ee39['include']=[{'all':!![]}];}_0x51ee39=_[_0xfa92('0x4e')]({},_0x51ee39,_0x59b02b[_0xfa92('0x50')]);return db['FaxAccount'][_0xfa92('0x5a')](_0x51ee39)[_0xfa92('0x20')](handleEntityNotFound(_0x12b785,null))['then'](respondWithResult(_0x12b785,null))[_0xfa92('0x29')](handleError(_0x12b785,null));};exports['create']=function(_0x10a50c,_0x198365){return db[_0xfa92('0x53')][_0xfa92('0x5b')](_0x10a50c['body'],{})[_0xfa92('0x20')](function(_0x2449a3){var _0x1571e8=_0x10a50c[_0xfa92('0x5c')]['get']({'plain':!![]});if(!_0x1571e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1571e8[_0xfa92('0x5d')]===_0xfa92('0x5c')){var _0x477adc=_0x2449a3['get']({'plain':!![]});var _0x334c4b=_0xfa92('0x37');return db[_0xfa92('0x5e')][_0xfa92('0x5a')]({'where':{'name':_0x334c4b,'userProfileId':_0x1571e8[_0xfa92('0x5f')]},'raw':!![]})['then'](function(_0x1bcdb6){if(_0x1bcdb6&&_0x1bcdb6[_0xfa92('0x60')]===0x0){return db[_0xfa92('0x38')][_0xfa92('0x5b')]({'name':_0x477adc[_0xfa92('0x3a')],'resourceId':_0x477adc['id'],'type':_0x1bcdb6[_0xfa92('0x3a')],'sectionId':_0x1bcdb6['id']},{})[_0xfa92('0x20')](function(){return _0x2449a3;});}else{return _0x2449a3;}})[_0xfa92('0x29')](function(_0x47228e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47228e);throw _0x47228e;});}return _0x2449a3;})['then'](respondWithResult(_0x198365,0xc9))[_0xfa92('0x29')](handleError(_0x198365,null));};exports['update']=function(_0x404378,_0x414913){if(_0x404378[_0xfa92('0x61')]['id']){delete _0x404378[_0xfa92('0x61')]['id'];}return db[_0xfa92('0x53')][_0xfa92('0x5a')]({'where':{'id':_0x404378['params']['id']},'include':[{'model':db[_0xfa92('0x58')],'as':_0xfa92('0x3c')}]})[_0xfa92('0x20')](handleEntityNotFound(_0x414913,null))[_0xfa92('0x20')](saveUpdates(_0x404378['body'],null))[_0xfa92('0x20')](respondWithResult(_0x414913,null))['catch'](handleError(_0x414913,null));};exports[_0xfa92('0x36')]=function(_0x41144c,_0x38502a){return db['FaxAccount'][_0xfa92('0x5a')]({'where':{'id':_0x41144c['params']['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x38502a,null))[_0xfa92('0x20')](removeEntity(_0x38502a,null))[_0xfa92('0x29')](handleError(_0x38502a,null));};exports[_0xfa92('0x62')]=function(_0x4e54b4,_0x4140d7){return db[_0xfa92('0x53')][_0xfa92('0x62')]()[_0xfa92('0x20')](respondWithResult(_0x4140d7,null))['catch'](handleError(_0x4140d7,null));};exports[_0xfa92('0x63')]=function(_0x4e9d71,_0x331bdc,_0x5a4b18){if(_0x4e9d71['body']['id']){delete _0x4e9d71[_0xfa92('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4e9d71[_0xfa92('0x57')]['id']}})['then'](handleEntityNotFound(_0x331bdc,null))['then'](function(_0x3b146f){if(_0x3b146f){_0x4e9d71['body']['FaxAccountId']=_0x3b146f['id'];return db[_0xfa92('0x64')][_0xfa92('0x5b')](_0x4e9d71[_0xfa92('0x61')]);}})['then'](respondWithResult(_0x331bdc,null))[_0xfa92('0x29')](handleError(_0x331bdc,null));};exports[_0xfa92('0x65')]=function(_0x303d40,_0x3fa3ea,_0x3e4560){var _0x2e2206={'raw':![],'where':{}};var _0x4172a0={};var _0x391562={'count':0x0,'rows':[]};return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x303d40[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x3fa3ea,null))['then'](function(_0xa281fc){if(_0xa281fc){_0x4172a0[_0xfa92('0x45')]=_['keys'](db['Disposition']['rawAttributes']);_0x4172a0['query']=_[_0xfa92('0x59')](_0x303d40[_0xfa92('0x42')]);_0x4172a0[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x4172a0['model'],_0x4172a0[_0xfa92('0x42')]);_0x2e2206[_0xfa92('0x46')]=_['intersection'](_0x4172a0[_0xfa92('0x45')],qs[_0xfa92('0x47')](_0x303d40[_0xfa92('0x42')][_0xfa92('0x47')]));_0x2e2206[_0xfa92('0x46')]=_0x2e2206[_0xfa92('0x46')]['length']?_0x2e2206['attributes']:_0x4172a0[_0xfa92('0x45')];if(!_0x303d40[_0xfa92('0x42')][_0xfa92('0x49')](_0xfa92('0x67'))){_0x2e2206[_0xfa92('0x2f')]=qs[_0xfa92('0x2f')](_0x303d40['query'][_0xfa92('0x2f')]);_0x2e2206[_0xfa92('0x2e')]=qs[_0xfa92('0x2e')](_0x303d40[_0xfa92('0x42')][_0xfa92('0x2e')]);}_0x2e2206[_0xfa92('0x68')]=qs[_0xfa92('0x4a')](_0x303d40[_0xfa92('0x42')][_0xfa92('0x4a')]);_0x2e2206[_0xfa92('0x4d')]=qs[_0xfa92('0x43')](_['pick'](_0x303d40[_0xfa92('0x42')],_0x4172a0[_0xfa92('0x43')]));_0x2e2206[_0xfa92('0x4d')][_0xfa92('0x69')]=_0xa281fc['id'];if(_0x303d40[_0xfa92('0x42')][_0xfa92('0x4c')]){_0x2e2206[_0xfa92('0x4d')]=_[_0xfa92('0x4e')](_0x2e2206[_0xfa92('0x4d')],{'$or':_[_0xfa92('0x3d')](_0x2e2206[_0xfa92('0x46')],function(_0x594d16){var _0x2782c3={};_0x2782c3[_0x594d16]={'$like':'%'+_0x303d40[_0xfa92('0x42')][_0xfa92('0x4c')]+'%'};return _0x2782c3;})});}_0x2e2206=_[_0xfa92('0x4e')]({},_0x2e2206,_0x303d40['options']);return db[_0xfa92('0x64')][_0xfa92('0x30')]({'where':_0x2e2206[_0xfa92('0x4d')]})[_0xfa92('0x20')](function(_0xc425a1){_0x391562['count']=_0xc425a1;if(_0x303d40[_0xfa92('0x42')][_0xfa92('0x51')]){_0x2e2206[_0xfa92('0x52')]=[{'all':!![]}];}return db[_0xfa92('0x64')][_0xfa92('0x54')](_0x2e2206);})[_0xfa92('0x20')](function(_0x28983d){_0x391562[_0xfa92('0x55')]=_0x28983d;return _0x391562;});}})['then'](respondWithFilteredResult(_0x3fa3ea,_0x2e2206))[_0xfa92('0x29')](handleError(_0x3fa3ea,null));};exports[_0xfa92('0x6a')]=function(_0x5124c9,_0x38205e,_0x46c0bf){return db[_0xfa92('0x53')][_0xfa92('0x5a')]({'where':{'id':_0x5124c9[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x38205e,null))[_0xfa92('0x20')](function(_0x319932){if(_0x319932){return _0x319932[_0xfa92('0x6a')](_0x5124c9[_0xfa92('0x42')][_0xfa92('0x6b')]);}})[_0xfa92('0x20')](respondWithStatusCode(_0x38205e,null))[_0xfa92('0x29')](handleError(_0x38205e,null));};exports[_0xfa92('0x6c')]=function(_0x4076eb,_0x17adf1,_0x28dfa8){if(_0x4076eb[_0xfa92('0x61')]['id']){delete _0x4076eb[_0xfa92('0x61')]['id'];}return db['FaxAccount'][_0xfa92('0x5a')]({'where':{'id':_0x4076eb[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x17adf1,null))[_0xfa92('0x20')](function(_0x1e5650){if(_0x1e5650){_0x4076eb[_0xfa92('0x61')][_0xfa92('0x69')]=_0x1e5650['id'];return db[_0xfa92('0x6d')]['create'](_0x4076eb[_0xfa92('0x61')]);}})['then'](respondWithResult(_0x17adf1,null))[_0xfa92('0x29')](handleError(_0x17adf1,null));};exports[_0xfa92('0x6e')]=function(_0x2edd32,_0x19fd3d,_0x408aa8){var _0xde9143={'raw':![],'where':{}};var _0x809b3f={};var _0x5c67cf={'count':0x0,'rows':[]};return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x2edd32[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x19fd3d,null))[_0xfa92('0x20')](function(_0x575d99){if(_0x575d99){_0x809b3f[_0xfa92('0x45')]=_['keys'](db[_0xfa92('0x6d')]['rawAttributes']);_0x809b3f[_0xfa92('0x42')]=_[_0xfa92('0x59')](_0x2edd32[_0xfa92('0x42')]);_0x809b3f[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x809b3f[_0xfa92('0x45')],_0x809b3f[_0xfa92('0x42')]);_0xde9143['attributes']=_[_0xfa92('0x44')](_0x809b3f[_0xfa92('0x45')],qs['fields'](_0x2edd32[_0xfa92('0x42')]['fields']));_0xde9143['attributes']=_0xde9143['attributes'][_0xfa92('0x48')]?_0xde9143[_0xfa92('0x46')]:_0x809b3f[_0xfa92('0x45')];if(!_0x2edd32[_0xfa92('0x42')]['hasOwnProperty'](_0xfa92('0x67'))){_0xde9143['limit']=qs[_0xfa92('0x2f')](_0x2edd32['query'][_0xfa92('0x2f')]);_0xde9143[_0xfa92('0x2e')]=qs[_0xfa92('0x2e')](_0x2edd32[_0xfa92('0x42')][_0xfa92('0x2e')]);}_0xde9143[_0xfa92('0x68')]=qs[_0xfa92('0x4a')](_0x2edd32[_0xfa92('0x42')][_0xfa92('0x4a')]);_0xde9143[_0xfa92('0x4d')]=qs[_0xfa92('0x43')](_[_0xfa92('0x4b')](_0x2edd32['query'],_0x809b3f[_0xfa92('0x43')]));_0xde9143[_0xfa92('0x4d')][_0xfa92('0x69')]=_0x575d99['id'];if(_0x2edd32[_0xfa92('0x42')]['filter']){_0xde9143['where']=_[_0xfa92('0x4e')](_0xde9143['where'],{'$or':_[_0xfa92('0x3d')](_0xde9143[_0xfa92('0x46')],function(_0x1e3235){var _0x124448={};_0x124448[_0x1e3235]={'$like':'%'+_0x2edd32[_0xfa92('0x42')][_0xfa92('0x4c')]+'%'};return _0x124448;})});}_0xde9143=_['merge']({},_0xde9143,_0x2edd32[_0xfa92('0x50')]);return db[_0xfa92('0x6d')][_0xfa92('0x30')]({'where':_0xde9143['where']})['then'](function(_0xca29eb){_0x5c67cf['count']=_0xca29eb;if(_0x2edd32['query'][_0xfa92('0x51')]){_0xde9143[_0xfa92('0x52')]=[{'all':!![]}];}return db[_0xfa92('0x6d')][_0xfa92('0x54')](_0xde9143);})[_0xfa92('0x20')](function(_0x240217){_0x5c67cf['rows']=_0x240217;return _0x5c67cf;});}})[_0xfa92('0x20')](respondWithFilteredResult(_0x19fd3d,_0xde9143))[_0xfa92('0x29')](handleError(_0x19fd3d,null));};exports[_0xfa92('0x6f')]=function(_0x4d628b,_0x12f5e4,_0x3fd7cb){return db[_0xfa92('0x53')][_0xfa92('0x5a')]({'where':{'id':_0x4d628b['params']['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x12f5e4,null))['then'](function(_0x363664){if(_0x363664){return _0x363664[_0xfa92('0x6f')](_0x4d628b['query'][_0xfa92('0x6b')]);}})['then'](respondWithStatusCode(_0x12f5e4,null))[_0xfa92('0x29')](handleError(_0x12f5e4,null));};exports[_0xfa92('0x70')]=function(_0xbb7866,_0x241f91,_0x558475){return db[_0xfa92('0x71')][_0xfa92('0x5a')]({'where':{'id':_0xbb7866['params']['id']}})['then'](handleEntityNotFound(_0x241f91,null))[_0xfa92('0x20')](function(_0x9c8fd3){if(_0x9c8fd3){return _0x9c8fd3['addInteraction'](_0xbb7866[_0xfa92('0x61')]['ids'],_[_0xfa92('0x72')](_0xbb7866[_0xfa92('0x61')],[_0xfa92('0x6b'),'id'])||{});}})[_0xfa92('0x20')](respondWithResult(_0x241f91,null))[_0xfa92('0x29')](handleError(_0x241f91,null));};exports[_0xfa92('0x73')]=function(_0x4108df,_0x2662e5,_0x4155e5){var _0x2f2df2={'raw':![],'where':{}};var _0x97bfd3={};var _0x5cdd93={'count':0x0,'rows':[]};return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x4108df[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x2662e5,null))[_0xfa92('0x20')](function(_0x5eace9){if(_0x5eace9){_0x97bfd3[_0xfa92('0x45')]=_[_0xfa92('0x59')](db[_0xfa92('0x71')][_0xfa92('0x3e')]);_0x97bfd3[_0xfa92('0x42')]=_[_0xfa92('0x59')](_0x4108df['query']);_0x97bfd3[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x97bfd3[_0xfa92('0x45')],_0x97bfd3[_0xfa92('0x42')]);_0x2f2df2[_0xfa92('0x46')]=_['intersection'](_0x97bfd3[_0xfa92('0x45')],qs[_0xfa92('0x47')](_0x4108df[_0xfa92('0x42')][_0xfa92('0x47')]));_0x2f2df2[_0xfa92('0x46')]=_0x2f2df2[_0xfa92('0x46')][_0xfa92('0x48')]?_0x2f2df2['attributes']:_0x97bfd3[_0xfa92('0x45')];if(!_0x4108df[_0xfa92('0x42')][_0xfa92('0x49')](_0xfa92('0x67'))){_0x2f2df2['limit']=qs['limit'](_0x4108df[_0xfa92('0x42')][_0xfa92('0x2f')]);_0x2f2df2[_0xfa92('0x2e')]=qs['offset'](_0x4108df[_0xfa92('0x42')]['offset']);}_0x2f2df2['order']=qs[_0xfa92('0x4a')](_0x4108df[_0xfa92('0x42')][_0xfa92('0x4a')]);_0x2f2df2[_0xfa92('0x4d')]=qs['filters'](_[_0xfa92('0x4b')](_0x4108df[_0xfa92('0x42')],_0x97bfd3[_0xfa92('0x43')]));_0x2f2df2['where']['FaxAccountId']=_0x5eace9['id'];if(_0x4108df['query'][_0xfa92('0x4c')]){_0x2f2df2['where']=_[_0xfa92('0x4e')](_0x2f2df2[_0xfa92('0x4d')],{'$or':_['map'](_0x2f2df2[_0xfa92('0x46')],function(_0x2771cb){var _0x159b85={};_0x159b85[_0x2771cb]={'$like':'%'+_0x4108df[_0xfa92('0x42')][_0xfa92('0x4c')]+'%'};return _0x159b85;})});}_0x2f2df2=_['merge']({},_0x2f2df2,_0x4108df[_0xfa92('0x50')]);return db[_0xfa92('0x71')][_0xfa92('0x30')]({'where':_0x2f2df2['where']})[_0xfa92('0x20')](function(_0x2bd4eb){_0x5cdd93[_0xfa92('0x30')]=_0x2bd4eb;if(_0x4108df[_0xfa92('0x42')][_0xfa92('0x51')]){_0x2f2df2[_0xfa92('0x52')]=[{'model':db[_0xfa92('0x74')],'as':_0xfa92('0x75'),'required':![]},{'model':db[_0xfa92('0x76')],'as':'Owner','attributes':['name',_0xfa92('0x77'),_0xfa92('0x78')],'required':![]},{'model':db[_0xfa92('0x79')],'as':'Tags','attributes':['id',_0xfa92('0x3a'),_0xfa92('0x7a')],'where':_0x4108df[_0xfa92('0x42')][_0xfa92('0x7b')]?{'id':_0x4108df[_0xfa92('0x42')][_0xfa92('0x7b')]}:undefined,'required':_0x4108df[_0xfa92('0x42')][_0xfa92('0x7b')]?!![]:![]}];}return db[_0xfa92('0x71')]['findAll'](_0x2f2df2);})[_0xfa92('0x20')](function(_0x1ed0b0){_0x5cdd93['rows']=_0x1ed0b0;return _0x5cdd93;});}})[_0xfa92('0x20')](respondWithFilteredResult(_0x2662e5,_0x2f2df2))[_0xfa92('0x29')](handleError(_0x2662e5,null));};exports['addApplications']=function(_0x410417,_0x1c0af3){var _0x334e4c=_0x410417['params']['id'];var _0xb37ca4=_0x410417['body'];var _0x164db6=0xc8;var _0x3b88f7=null;return db[_0xfa92('0x7c')][_0xfa92('0x7d')]({'isolationLevel':db[_0xfa92('0x7c')][_0xfa92('0x7e')][_0xfa92('0x7f')][_0xfa92('0x80')]},function(_0x1704eb){return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x334e4c},'transaction':_0x1704eb})[_0xfa92('0x20')](function(_0x37e621){if(_0x37e621){return db[_0xfa92('0x81')][_0xfa92('0x36')]({'where':{'FaxAccountId':_0x334e4c},'transaction':_0x1704eb})[_0xfa92('0x20')](function(){var _0x2c648d=_[_0xfa92('0x3d')](_0xb37ca4,function(_0x438912){_0x438912['FaxAccountId']=_0x334e4c;return _0x438912;});return db[_0xfa92('0x81')]['bulkCreate'](_0x2c648d,{'transaction':_0x1704eb});});}else{_0x164db6=0x194;_0x3b88f7=[];}});})[_0xfa92('0x20')](function(){if(_0x164db6!==0x194){return db[_0xfa92('0x81')][_0xfa92('0x82')]({'where':{'FaxAccountId':_0x334e4c},'order':'priority'})['then'](function(_0xedcd4a){_0x3b88f7=_0xedcd4a;});}})[_0xfa92('0x29')](function(_0x9d1773){_0x164db6=0x1f4;logger[_0xfa92('0x26')](_0x9d1773[_0xfa92('0x39')]);if(_0x9d1773[_0xfa92('0x3a')]){delete _0x9d1773[_0xfa92('0x3a')];}_0x3b88f7=_0x9d1773;})[_0xfa92('0x83')](function(){if(_0x3b88f7===null){_0x1c0af3[_0xfa92('0x2a')](_0x164db6);}else{if(_0x164db6===0x1f4){_0x1c0af3['status'](_0x164db6)[_0xfa92('0x84')](_0x3b88f7);}else{_0x1c0af3['status'](_0x164db6)['json'](_0x3b88f7);}}});};exports[_0xfa92('0x85')]=function(_0x3e5178,_0x287273,_0xad084b){var _0x315dd3={};var _0x2e310e={};var _0x104ff3;var _0xac3677;return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x3e5178[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x287273,null))[_0xfa92('0x20')](function(_0x4cd80e){if(_0x4cd80e){_0x104ff3=_0x4cd80e;_0x2e310e[_0xfa92('0x45')]=_[_0xfa92('0x59')](db[_0xfa92('0x81')]['rawAttributes']);_0x2e310e[_0xfa92('0x42')]=_[_0xfa92('0x59')](_0x3e5178[_0xfa92('0x42')]);_0x2e310e['filters']=_[_0xfa92('0x44')](_0x2e310e['model'],_0x2e310e['query']);_0x315dd3[_0xfa92('0x46')]=_[_0xfa92('0x44')](_0x2e310e[_0xfa92('0x45')],qs['fields'](_0x3e5178[_0xfa92('0x42')][_0xfa92('0x47')]));_0x315dd3['attributes']=_0x315dd3['attributes'][_0xfa92('0x48')]?_0x315dd3[_0xfa92('0x46')]:_0x2e310e[_0xfa92('0x45')];_0x315dd3['order']=qs[_0xfa92('0x4a')](_0x3e5178[_0xfa92('0x42')][_0xfa92('0x4a')]);_0x315dd3[_0xfa92('0x4d')]=qs['filters'](_[_0xfa92('0x4b')](_0x3e5178[_0xfa92('0x42')],_0x2e310e['filters']));if(_0x3e5178[_0xfa92('0x42')]['filter']){_0x315dd3[_0xfa92('0x4d')]=_[_0xfa92('0x4e')](_0x315dd3[_0xfa92('0x4d')],{'$or':_['map'](_0x315dd3['attributes'],function(_0x1ee361){var _0x569034={};_0x569034[_0x1ee361]={'$like':'%'+_0x3e5178[_0xfa92('0x42')][_0xfa92('0x4c')]+'%'};return _0x569034;})});}_0x315dd3=_[_0xfa92('0x4e')]({},_0x315dd3,_0x3e5178[_0xfa92('0x50')]);return _0x104ff3[_0xfa92('0x85')](_0x315dd3);}})[_0xfa92('0x20')](function(_0x2ac10a){if(_0x2ac10a){_0xac3677=_0x2ac10a[_0xfa92('0x48')];if(!_0x3e5178[_0xfa92('0x42')]['hasOwnProperty'](_0xfa92('0x67'))){_0x315dd3[_0xfa92('0x2f')]=qs[_0xfa92('0x2f')](_0x3e5178[_0xfa92('0x42')][_0xfa92('0x2f')]);_0x315dd3[_0xfa92('0x2e')]=qs['offset'](_0x3e5178[_0xfa92('0x42')][_0xfa92('0x2e')]);}return _0x104ff3[_0xfa92('0x85')](_0x315dd3);}})[_0xfa92('0x20')](function(_0xc0d9c2){if(_0xc0d9c2){return _0xc0d9c2?{'count':_0xac3677,'rows':_0xc0d9c2}:null;}})[_0xfa92('0x20')](respondWithResult(_0x287273,null))[_0xfa92('0x29')](handleError(_0x287273,null));};function Extension(_0x518922,_0x282f8d,_0x1abd54,_0x5ec2c5){this[_0xfa92('0x86')]=_0xfa92('0x87');this[_0xfa92('0x88')]=_0x518922['localstationid'];this[_0xfa92('0x89')]=_0x5ec2c5;this[_0xfa92('0x40')]='system';this[_0xfa92('0x8a')]='Fax\x20Extension';this[_0xfa92('0x69')]=_0x518922['id'];this[_0xfa92('0x8b')]=_0x282f8d;this[_0xfa92('0x8c')]=_0x1abd54;}function createExtensionsReciveFax(_0x204459){var _0x177c99=0x1;var _0x4fc235=[];_0x4fc235[_0xfa92('0x8d')](new Extension(_0x204459,_0x177c99,'',_0xfa92('0x8e')));_0x177c99+=0x1;_0x4fc235[_0xfa92('0x8d')](new Extension(_0x204459,_0x177c99,_0xfa92('0x8f'),'Set'));_0x177c99+=0x1;for(var _0x12fd2b in _0x204459){if(_0x204459[_0xfa92('0x49')](_0x12fd2b)&&(_0x12fd2b===_0xfa92('0x90')||_0x12fd2b==='localstationid'||_0x12fd2b==='gateway'||_0x12fd2b===_0xfa92('0x91')||_0x12fd2b===_0xfa92('0x92')||_0x12fd2b==='maxrate'||_0x12fd2b===_0xfa92('0x93')||_0x12fd2b===_0xfa92('0x94')||_0x12fd2b==='t38timeout')){_0x4fc235[_0xfa92('0x8d')](new Extension(_0x204459,_0x177c99,_0xfa92('0x95')+_0x12fd2b+')='+_0x204459[_0x12fd2b],_0xfa92('0x96')));_0x177c99+=0x1;}}_0x4fc235['push'](new Extension(_0x204459,_0x177c99,'6',_0xfa92('0x97')));_0x177c99+=0x1;_0x4fc235[_0xfa92('0x8d')](new Extension(_0x204459,_0x177c99,_0xfa92('0x98'),_0xfa92('0x99')));_0x177c99=0x0;return _0x4fc235;}exports[_0xfa92('0x9a')]=function(_0xe565a8,_0x27499a,_0x374605){var _0x53ad5d;return db[_0xfa92('0x7c')][_0xfa92('0x7d')](function(_0x2f65cd){return db[_0xfa92('0x53')][_0xfa92('0x5b')](_0xe565a8['body'],{'transaction':_0x2f65cd})[_0xfa92('0x20')](function(_0x55b4c5){_0x53ad5d=_0x55b4c5[_0xfa92('0x9b')]({'plain':!![]});return db[_0xfa92('0x9c')][_0xfa92('0x9d')](createExtensionsReciveFax(_0x53ad5d),{'transaction':_0x2f65cd});});})[_0xfa92('0x20')](function(){return _0x53ad5d;})[_0xfa92('0x20')](respondWithResult(_0x27499a,null))[_0xfa92('0x29')](handleError(_0x27499a,null));};exports['updateAccountApplications']=function(_0x3f9205,_0x39d734,_0x5db329){var _0x1d8fbc;return db[_0xfa92('0x7c')][_0xfa92('0x7d')](function(_0x2e8033){return db[_0xfa92('0x53')][_0xfa92('0x35')](_0x3f9205[_0xfa92('0x61')],{'where':{'id':_0x3f9205[_0xfa92('0x61')]['id']},'transaction':_0x2e8033})[_0xfa92('0x20')](function(_0x12741a){return db[_0xfa92('0x9c')]['destroy']({'where':{'FaxAccountId':_0x3f9205[_0xfa92('0x61')]['id']},'transaction':_0x2e8033})[_0xfa92('0x20')](function(_0x273045){return db[_0xfa92('0x9c')][_0xfa92('0x9d')](createExtensionsReciveFax(_['omit'](_0x3f9205['body'],['tech',_0xfa92('0x41'),_0xfa92('0x9e'),_0xfa92('0x9f'),'TrunkId','ListId'])),{'transaction':_0x2e8033});});});})[_0xfa92('0x20')](function(){return db[_0xfa92('0x53')][_0xfa92('0xa0')](_0x3f9205[_0xfa92('0x61')]['id']);})[_0xfa92('0x20')](respondWithResult(_0x39d734,null))[_0xfa92('0x29')](handleError(_0x39d734,null));};exports[_0xfa92('0xa1')]=function(_0x383c1d,_0x67f5ce,_0x3d2d39){var _0x4bcb7d={'raw':!![],'where':{}};var _0x5c2c31={};var _0x568289={'count':0x0,'rows':[]};return db[_0xfa92('0x53')]['findOne']({'where':{'id':_0x383c1d[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x67f5ce,null))[_0xfa92('0x20')](function(_0x303c83){if(_0x303c83){_0x5c2c31[_0xfa92('0x45')]=_[_0xfa92('0x59')](db[_0xfa92('0xa2')]['rawAttributes']);_0x5c2c31['query']=_['keys'](_0x383c1d[_0xfa92('0x42')]);_0x5c2c31[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x5c2c31[_0xfa92('0x45')],_0x5c2c31['query']);_0x4bcb7d[_0xfa92('0x46')]=_[_0xfa92('0x44')](_0x5c2c31[_0xfa92('0x45')],qs['fields'](_0x383c1d[_0xfa92('0x42')][_0xfa92('0x47')]));_0x4bcb7d['attributes']=_0x4bcb7d[_0xfa92('0x46')][_0xfa92('0x48')]?_0x4bcb7d[_0xfa92('0x46')]:_0x5c2c31[_0xfa92('0x45')];if(!_0x383c1d[_0xfa92('0x42')]['hasOwnProperty'](_0xfa92('0x67'))){_0x4bcb7d[_0xfa92('0x2f')]=qs[_0xfa92('0x2f')](_0x383c1d[_0xfa92('0x42')][_0xfa92('0x2f')]);_0x4bcb7d[_0xfa92('0x2e')]=qs[_0xfa92('0x2e')](_0x383c1d[_0xfa92('0x42')][_0xfa92('0x2e')]);}_0x4bcb7d[_0xfa92('0x68')]=qs['sort'](_0x383c1d[_0xfa92('0x42')][_0xfa92('0x4a')]);_0x4bcb7d[_0xfa92('0x4d')]=qs['filters'](_['pick'](_0x383c1d[_0xfa92('0x42')],_0x5c2c31[_0xfa92('0x43')]));_0x4bcb7d[_0xfa92('0x4d')][_0xfa92('0x69')]=_0x303c83['id'];if(_0x383c1d[_0xfa92('0x42')]['filter']){_0x4bcb7d[_0xfa92('0x4d')]=_[_0xfa92('0x4e')](_0x4bcb7d[_0xfa92('0x4d')],{'$or':_[_0xfa92('0x3d')](_0x4bcb7d[_0xfa92('0x46')],function(_0x2b8935){var _0x1c8200={};_0x1c8200[_0x2b8935]={'$like':'%'+_0x383c1d['query']['filter']+'%'};return _0x1c8200;})});}if(_0x383c1d[_0xfa92('0x42')][_0xfa92('0xa3')]){var _0x40cbd3=_0x383c1d[_0xfa92('0x42')][_0xfa92('0xa3')][_0xfa92('0xa4')](',');var _0x231cab={};_0x231cab[_0x40cbd3[0x0]]={'$gte':moment(_0x40cbd3[0x1])[_0xfa92('0xa5')](_0xfa92('0xa6'))};_0x4bcb7d['where']=_[_0xfa92('0x4e')](_0x4bcb7d['where'],_0x231cab);}_0x4bcb7d=_['merge']({},_0x4bcb7d,_0x383c1d['options']);return db['FaxMessage'][_0xfa92('0x30')]({'where':_0x4bcb7d[_0xfa92('0x4d')]})[_0xfa92('0x20')](function(_0x102f53){_0x568289[_0xfa92('0x30')]=_0x102f53;if(_0x383c1d['query'][_0xfa92('0x51')]){_0x4bcb7d[_0xfa92('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x4bcb7d);})[_0xfa92('0x20')](function(_0xdd6a7e){_0x568289[_0xfa92('0x55')]=_0xdd6a7e;return _0x568289;});}})[_0xfa92('0x20')](respondWithFilteredResult(_0x67f5ce,_0x4bcb7d))[_0xfa92('0x29')](handleError(_0x67f5ce,null));};exports[_0xfa92('0x84')]=function(_0x127ff6,_0x2a0863,_0x4217b5){var _0x15d18f,_0x54e12d={},_0x3c9c11;if(_0x127ff6[_0xfa92('0x61')]['to']){_0x3c9c11=_0x127ff6['body']['to'][0x0];}return db[_0xfa92('0x53')]['find']({'where':{'id':_0x127ff6[_0xfa92('0x57')]['id']},'include':[{'model':db[_0xfa92('0xa7')],'as':_0xfa92('0xa8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x3c9c11},'limit':0x1,'order':[[_0xfa92('0x9f'),_0xfa92('0xa9')]]}]}]})[_0xfa92('0x20')](handleEntityNotFound(_0x2a0863,null))[_0xfa92('0x20')](function(_0x27f8c3){_0x15d18f=_0x27f8c3;if(_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')]&&_0x127ff6[_0xfa92('0x61')]['attachments']['length']){for(var _0xc6642f=0x0;_0xc6642f<_0x127ff6[_0xfa92('0x61')]['attachments'][_0xfa92('0x48')];_0xc6642f+=0x1){_0x127ff6['body'][_0xfa92('0xaa')][_0xc6642f]={'filename':_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][_0xc6642f]['name'],'id':_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][_0xc6642f]['id'],'path':path[_0xfa92('0xab')](config[_0xfa92('0xac')],_0xfa92('0xad'),_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][_0xc6642f][_0xfa92('0xae')])};}}return respondWithRpcPromise(_0xfa92('0xaf'),_0xfa92('0xaf'),{'FaxAccountId':_['isNil'](_0x127ff6['params']['id'])?undefined:_0x127ff6['params']['id'],'path':_[_0xfa92('0xb0')](_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][0x0]['path'])?undefined:_0x127ff6[_0xfa92('0x61')]['attachments'][0x0]['path'],'fax':_[_0xfa92('0xb0')](_0x127ff6[_0xfa92('0x61')]['to'][0x0])?undefined:_0x127ff6['body']['to'][0x0]},client9002);})[_0xfa92('0x20')](function(){if(_0x15d18f){if(_['isNil'](_0x127ff6[_0xfa92('0x61')][_0xfa92('0xb1')])){_0x127ff6[_0xfa92('0x61')][_0xfa92('0xb1')]=util['format']('\x22%s\x22\x20<%s>',_0x15d18f['name'],_0x15d18f[_0xfa92('0xb2')]);}if(_0x15d18f['List']){if(_0x15d18f['List']['Contacts'][_0xfa92('0x48')]){return _0x15d18f[_0xfa92('0xa8')][_0xfa92('0xb3')][0x0];}else{return db[_0xfa92('0x74')][_0xfa92('0x5b')](_[_0xfa92('0xb4')](_0x127ff6[_0xfa92('0x61')],{'firstName':_0x127ff6[_0xfa92('0x61')]['to'][0x0],'phone':_0x127ff6[_0xfa92('0x61')]['to'][0x0],'fax':_0x127ff6[_0xfa92('0x61')]['to'][0x0],'ListId':_0x15d18f[_0xfa92('0xb5')]}));}}else{throw new Error(_0xfa92('0xb6'));}}else{throw new Error(_0xfa92('0xb7'));}})[_0xfa92('0x20')](function(_0x2d9eea){if(_0x2d9eea){return db[_0xfa92('0x71')][_0xfa92('0x5a')]({'where':{'ContactId':_0x2d9eea['id'],'closed':![],'FaxAccountId':_0x15d18f['id']}})[_0xfa92('0x20')](function(_0x19e69b){if(_0x19e69b){return[_0x19e69b,![]];}return db['FaxInteraction'][_0xfa92('0x5b')]({'UserId':_0x127ff6[_0xfa92('0x5c')]['id'],'ContactId':_0x2d9eea['id'],'FaxAccountId':_0x15d18f['id'],'fax':_0x127ff6[_0xfa92('0x61')]['to'][0x0],'firstMsgDirection':_0xfa92('0xb8'),'Messages':[_[_0xfa92('0x4e')](_0x127ff6['body'],{'read':![],'body':_0x127ff6['body'][_0xfa92('0xaa')][0x0][_0xfa92('0xb9')],'FaxAccountId':_0x15d18f['id'],'UserId':_0x127ff6['user']['id'],'ContactId':_0x2d9eea['id'],'AttachmentId':_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xfa92('0xa2')],'as':_0xfa92('0xba')}]})[_0xfa92('0x20')](function(_0x10f38d){return[_0x10f38d,!![]];});});}else{throw new Error(_0xfa92('0xbb'));}})[_0xfa92('0xbc')](function(_0x4a1b68,_0x72a39d){if(_0x72a39d){return _0x4a1b68;}return db[_0xfa92('0xa2')][_0xfa92('0x5b')]({'direction':_0xfa92('0xb8'),'read':![],'body':_0x127ff6[_0xfa92('0x61')]['attachments'][0x0][_0xfa92('0xb9')],'FaxAccountId':_0x15d18f['id'],'FaxInteractionId':_0x4a1b68['id'],'UserId':_0x127ff6[_0xfa92('0x5c')]['id'],'ContactId':_0x4a1b68[_0xfa92('0xbd')],'AttachmentId':_0x127ff6['body'][_0xfa92('0xaa')][0x0]['id']})[_0xfa92('0x20')](function(_0x5652e7){_0x4a1b68[_0xfa92('0xbe')][_0xfa92('0xba')]=[];_0x4a1b68[_0xfa92('0xbe')]['Messages'][_0xfa92('0x8d')](_0x5652e7['dataValues']);return _0x4a1b68;});})[_0xfa92('0x20')](function(_0x1ffcb5){respondWithRpcPromise(_0xfa92('0xbf'),_0xfa92('0xbf'),{'FaxAccountId':_[_0xfa92('0xb0')](_0x127ff6['params']['id'])?undefined:_0x127ff6[_0xfa92('0x57')]['id'],'path':_[_0xfa92('0xb0')](_0x127ff6[_0xfa92('0x61')][_0xfa92('0xaa')][0x0][_0xfa92('0x6')])?undefined:_0x127ff6[_0xfa92('0x61')]['attachments'][0x0][_0xfa92('0x6')],'fax':_[_0xfa92('0xb0')](_0x127ff6[_0xfa92('0x61')]['to'][0x0])?undefined:_0x127ff6[_0xfa92('0x61')]['to'][0x0],'AttachmentId':_0x127ff6[_0xfa92('0x61')]['attachments'][0x0]['id']},client9002)[_0xfa92('0x20')](function(_0x18834e){logger[_0xfa92('0x21')]('SendFaxRpc,\x20%s',_0x18834e);})[_0xfa92('0x29')](function(_0x3ee408){logger['info'](_0xfa92('0xc0'),_0x3ee408);});return _0x1ffcb5;})[_0xfa92('0x20')](respondWithResult(_0x2a0863,null))[_0xfa92('0x29')](handleError(_0x2a0863,null));};exports[_0xfa92('0xc1')]=function(_0x299c02,_0x33f1e1,_0x36023e){return db['FaxAccount'][_0xfa92('0x5a')]({'where':{'id':_0x299c02['params']['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x33f1e1,null))[_0xfa92('0x20')](function(_0x359aa3){if(_0x359aa3){return _0x359aa3[_0xfa92('0xc1')](_0x299c02[_0xfa92('0x61')][_0xfa92('0x6b')],_[_0xfa92('0x72')](_0x299c02['body'],[_0xfa92('0x6b'),'id'])||{})[_0xfa92('0xbc')](function(_0x508210){for(var _0x220619=0x0;_0x220619<_0x299c02[_0xfa92('0x61')][_0xfa92('0x6b')]['length'];_0x220619+=0x1){socket[_0xfa92('0xc2')](_0xfa92('0xc3'),{'UserId':Number(_0x299c02[_0xfa92('0x61')][_0xfa92('0x6b')][_0x220619]),'FaxAccountId':Number(_0x299c02[_0xfa92('0x57')]['id'])});}return _0x508210;});}})['then'](respondWithResult(_0x33f1e1,null))[_0xfa92('0x29')](handleError(_0x33f1e1,null));};exports['removeAgents']=function(_0x5f2260,_0x264f8e,_0x5c83a3){return db[_0xfa92('0x53')][_0xfa92('0x5a')]({'where':{'id':_0x5f2260[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x264f8e,null))[_0xfa92('0x20')](function(_0xb73967){if(_0xb73967){return _0xb73967[_0xfa92('0xc4')](_0x5f2260[_0xfa92('0x42')][_0xfa92('0x6b')])[_0xfa92('0x20')](function(){if(_['isArray'](_0x5f2260[_0xfa92('0x42')][_0xfa92('0x6b')])){for(var _0x570373=0x0;_0x570373<_0x5f2260[_0xfa92('0x42')]['ids']['length'];_0x570373+=0x1){socket[_0xfa92('0xc2')](_0xfa92('0xc5'),{'UserId':Number(_0x5f2260[_0xfa92('0x42')][_0xfa92('0x6b')][_0x570373]),'FaxAccountId':Number(_0x5f2260[_0xfa92('0x57')]['id'])});}}else{socket[_0xfa92('0xc2')](_0xfa92('0xc5'),{'UserId':Number(_0x5f2260['query'][_0xfa92('0x6b')]),'FaxAccountId':Number(_0x5f2260[_0xfa92('0x57')]['id'])});}});}})[_0xfa92('0x20')](respondWithStatusCode(_0x264f8e,null))['catch'](handleError(_0x264f8e,null));};exports[_0xfa92('0xc6')]=function(_0x482775,_0x1b8e15,_0x48d9ad){var _0xaf27b2={};var _0x179047={};var _0x1aca02;var _0x1cc786;return db[_0xfa92('0x53')][_0xfa92('0x66')]({'where':{'id':_0x482775[_0xfa92('0x57')]['id']}})[_0xfa92('0x20')](handleEntityNotFound(_0x1b8e15,null))['then'](function(_0x3db6e5){if(_0x3db6e5){_0x1aca02=_0x3db6e5;_0x179047[_0xfa92('0x45')]=_['keys'](db[_0xfa92('0x76')][_0xfa92('0x3e')]);_0x179047[_0xfa92('0x42')]=_[_0xfa92('0x59')](_0x482775[_0xfa92('0x42')]);_0x179047[_0xfa92('0x43')]=_[_0xfa92('0x44')](_0x179047[_0xfa92('0x45')],_0x179047[_0xfa92('0x42')]);_0xaf27b2['attributes']=_[_0xfa92('0x44')](_0x179047[_0xfa92('0x45')],qs[_0xfa92('0x47')](_0x482775[_0xfa92('0x42')][_0xfa92('0x47')]));_0xaf27b2['attributes']=_0xaf27b2[_0xfa92('0x46')][_0xfa92('0x48')]?_0xaf27b2[_0xfa92('0x46')]:_0x179047[_0xfa92('0x45')];_0xaf27b2[_0xfa92('0x68')]=qs[_0xfa92('0x4a')](_0x482775[_0xfa92('0x42')][_0xfa92('0x4a')]);_0xaf27b2[_0xfa92('0x4d')]=qs[_0xfa92('0x43')](_['pick'](_0x482775[_0xfa92('0x42')],_0x179047['filters']));if(_0x482775[_0xfa92('0x42')]['filter']){_0xaf27b2[_0xfa92('0x4d')]=_['merge'](_0xaf27b2[_0xfa92('0x4d')],{'$or':_['map'](_0xaf27b2['attributes'],function(_0x5d88d2){var _0x2dad0c={};_0x2dad0c[_0x5d88d2]={'$like':'%'+_0x482775['query'][_0xfa92('0x4c')]+'%'};return _0x2dad0c;})});}_0xaf27b2=_[_0xfa92('0x4e')]({},_0xaf27b2,_0x482775[_0xfa92('0x50')]);return _0x1aca02[_0xfa92('0xc6')](_0xaf27b2);}})['then'](function(_0x241777){if(_0x241777){_0x1cc786=_0x241777[_0xfa92('0x48')];if(!_0x482775[_0xfa92('0x42')][_0xfa92('0x49')](_0xfa92('0x67'))){_0xaf27b2[_0xfa92('0x2f')]=qs[_0xfa92('0x2f')](_0x482775['query'][_0xfa92('0x2f')]);_0xaf27b2['offset']=qs[_0xfa92('0x2e')](_0x482775[_0xfa92('0x42')][_0xfa92('0x2e')]);}return _0x1aca02[_0xfa92('0xc6')](_0xaf27b2);}})['then'](function(_0x33a221){if(_0x33a221){return _0x33a221?{'count':_0x1cc786,'rows':_0x33a221}:null;}})[_0xfa92('0x20')](respondWithResult(_0x1b8e15,null))[_0xfa92('0x29')](handleError(_0x1b8e15,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c037e27..d6a3926 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 _0xd8fe=['hasOwnProperty','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x4a89f0,_0x17aea9){var _0x516540=function(_0x4d7a48){while(--_0x4d7a48){_0x4a89f0['push'](_0x4a89f0['shift']());}};_0x516540(++_0x17aea9);}(_0xd8fe,0xfa));var _0xed8f=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xd8fe[_0x412e27];return _0x53da42;};'use strict';var EventEmitter=require(_0xed8f('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xed8f('0x1')](0x0);var events={'afterCreate':_0xed8f('0x2'),'afterUpdate':_0xed8f('0x3'),'afterDestroy':_0xed8f('0x4')};function emitEvent(_0x25fa7b){return function(_0x12a592,_0x58f24f,_0x1c030a){FaxAccountEvents['emit'](_0x25fa7b+':'+_0x12a592['id'],_0x12a592);FaxAccountEvents[_0xed8f('0x5')](_0x25fa7b,_0x12a592);_0x1c030a(null);};}for(var e in events){if(events[_0xed8f('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xed8f('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x2e7d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x2e7d,0x103));var _0xd2e7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2e7d[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xd2e7('0x0'))['db'][_0xd2e7('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd2e7('0x2')](0x0);var events={'afterCreate':_0xd2e7('0x3'),'afterUpdate':'update','afterDestroy':_0xd2e7('0x4')};function emitEvent(_0x2fc4f5){return function(_0x44e2a1,_0x1d2dc7,_0x500052){FaxAccountEvents[_0xd2e7('0x5')](_0x2fc4f5+':'+_0x44e2a1['id'],_0x44e2a1);FaxAccountEvents['emit'](_0x2fc4f5,_0x44e2a1);_0x500052(null);};}for(var e in events){if(events[_0xd2e7('0x6')](e)){var event=events[e];FaxAccount[_0xd2e7('0x7')](e,emitEvent(event));}}module[_0xd2e7('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 07155e8..708d199 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 _0xe559=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x57e759,_0x347f69){var _0x4ecfa2=function(_0x524af0){while(--_0x524af0){_0x57e759['push'](_0x57e759['shift']());}};_0x4ecfa2(++_0x347f69);}(_0xe559,0x152));var _0x9e55=function(_0x154621,_0x4b326a){_0x154621=_0x154621-0x0;var _0x441c8d=_0xe559[_0x154621];return _0x441c8d;};'use strict';var _=require(_0x9e55('0x0'));var util=require(_0x9e55('0x1'));var logger=require(_0x9e55('0x2'))(_0x9e55('0x3'));var moment=require(_0x9e55('0x4'));var BPromise=require('bluebird');var rp=require(_0x9e55('0x5'));var fs=require('fs');var path=require(_0x9e55('0x6'));var rimraf=require(_0x9e55('0x7'));var config=require(_0x9e55('0x8'));var attributes=require(_0x9e55('0x9'));module[_0x9e55('0xa')]=function(_0x3c9c66,_0x218f1f){return _0x3c9c66[_0x9e55('0xb')](_0x9e55('0xc'),attributes,{'tableName':_0x9e55('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf980=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x1609bf,_0x19b0ed){var _0x53acfe=function(_0x360ae8){while(--_0x360ae8){_0x1609bf['push'](_0x1609bf['shift']());}};_0x53acfe(++_0x19b0ed);}(_0xf980,0xc4));var _0x0f98=function(_0x3a7155,_0x3683f5){_0x3a7155=_0x3a7155-0x0;var _0x24b0e1=_0xf980[_0x3a7155];return _0x24b0e1;};'use strict';var _=require(_0x0f98('0x0'));var util=require(_0x0f98('0x1'));var logger=require(_0x0f98('0x2'))(_0x0f98('0x3'));var moment=require(_0x0f98('0x4'));var BPromise=require(_0x0f98('0x5'));var rp=require(_0x0f98('0x6'));var fs=require('fs');var path=require(_0x0f98('0x7'));var rimraf=require(_0x0f98('0x8'));var config=require(_0x0f98('0x9'));var attributes=require(_0x0f98('0xa'));module[_0x0f98('0xb')]=function(_0x405f29,_0x5824a2){return _0x405f29[_0x0f98('0xc')](_0x0f98('0xd'),attributes,{'tableName':_0x0f98('0xe'),'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 86dd491..cb8940c 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 _0x14e4=['rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','limit','include','map','model','attributes','debug','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','account','Applications','List','applications','orderBy','length','defaults','create','contact','FaxInteraction','find','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','User','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x312bac,_0x1266a2){var _0xed225c=function(_0x3b985c){while(--_0x3b985c){_0x312bac['push'](_0x312bac['shift']());}};_0xed225c(++_0x1266a2);}(_0x14e4,0x100));var _0x414e=function(_0x3e6821,_0x38f855){_0x3e6821=_0x3e6821-0x0;var _0x20d3db=_0x14e4[_0x3e6821];return _0x20d3db;};'use strict';var _=require(_0x414e('0x0'));var util=require(_0x414e('0x1'));var moment=require(_0x414e('0x2'));var BPromise=require(_0x414e('0x3'));var rs=require(_0x414e('0x4'));var fs=require('fs');var Redis=require(_0x414e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x414e('0x6'));var logger=require(_0x414e('0x7'))(_0x414e('0x8'));var config=require(_0x414e('0x9'));var jayson=require(_0x414e('0xa'));var client=jayson[_0x414e('0xb')][_0x414e('0xc')]({'port':0x232c});config[_0x414e('0xd')]=_['defaults'](config[_0x414e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x414e('0xe'))(new Redis(config[_0x414e('0xd')]));require(_0x414e('0xf'))[_0x414e('0x10')](socket);function respondWithRpcPromise(_0x216f11,_0x5d1a9c,_0x314a1c){return new BPromise(function(_0x445edc,_0x398d13){return client[_0x414e('0x11')](_0x216f11,_0x314a1c)[_0x414e('0x12')](function(_0x1848eb){logger[_0x414e('0x13')](_0x414e('0x14'),_0x5d1a9c,'request\x20sent');logger['debug'](_0x414e('0x15'),_0x5d1a9c,_0x414e('0x16'),JSON[_0x414e('0x17')](_0x1848eb));if(_0x1848eb[_0x414e('0x18')]){if(_0x1848eb[_0x414e('0x18')]['code']===0x1f4){logger[_0x414e('0x18')](_0x414e('0x14'),_0x5d1a9c,_0x1848eb[_0x414e('0x18')]['message']);return _0x398d13(_0x1848eb['error'][_0x414e('0x19')]);}logger['error'](_0x414e('0x14'),_0x5d1a9c,_0x1848eb['error'][_0x414e('0x19')]);return _0x445edc(_0x1848eb[_0x414e('0x18')][_0x414e('0x19')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x5d1a9c,_0x414e('0x16'));_0x445edc(_0x1848eb[_0x414e('0x1a')][_0x414e('0x19')]);}})['catch'](function(_0xebd528){logger[_0x414e('0x18')]('FaxAccount,\x20%s,\x20%s',_0x5d1a9c,_0xebd528);_0x398d13(_0xebd528);});});}exports[_0x414e('0x1b')]=function(_0x2ef5f5){var _0x15400b=this;return new Promise(function(_0x357487,_0x3b1ca5){return db[_0x414e('0x1c')][_0x414e('0x1d')]({'raw':_0x2ef5f5[_0x414e('0x1e')]?_0x2ef5f5[_0x414e('0x1e')][_0x414e('0x1f')]===undefined?!![]:![]:!![],'where':_0x2ef5f5[_0x414e('0x1e')]?_0x2ef5f5['options']['where']||null:null,'attributes':_0x2ef5f5[_0x414e('0x1e')]?_0x2ef5f5['options']['attributes']||null:null,'limit':_0x2ef5f5[_0x414e('0x1e')]?_0x2ef5f5[_0x414e('0x1e')][_0x414e('0x20')]||null:null,'include':_0x2ef5f5[_0x414e('0x1e')]?_0x2ef5f5[_0x414e('0x1e')][_0x414e('0x21')]?_[_0x414e('0x22')](_0x2ef5f5[_0x414e('0x1e')][_0x414e('0x21')],function(_0x2e26c0){return{'model':db[_0x2e26c0['model']],'as':_0x2e26c0['as'],'attributes':_0x2e26c0['attributes'],'include':_0x2e26c0[_0x414e('0x21')]?_['map'](_0x2e26c0[_0x414e('0x21')],function(_0x54ae38){return{'model':db[_0x54ae38[_0x414e('0x23')]],'as':_0x54ae38['as'],'attributes':_0x54ae38[_0x414e('0x24')],'include':_0x54ae38[_0x414e('0x21')]?_['map'](_0x54ae38[_0x414e('0x21')],function(_0x152b0d){return{'model':db[_0x152b0d['model']],'as':_0x152b0d['as'],'attributes':_0x152b0d[_0x414e('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x567d38){logger['info'](_0x414e('0x1b'),_0x2ef5f5);logger[_0x414e('0x25')](_0x414e('0x1b'),_0x2ef5f5,JSON[_0x414e('0x17')](_0x567d38));_0x357487(_0x567d38);})[_0x414e('0x26')](function(_0x13cdfa){logger['error']('GetFaxAccount',_0x13cdfa['message'],_0x2ef5f5);_0x3b1ca5(_0x15400b[_0x414e('0x18')](0x1f4,_0x13cdfa[_0x414e('0x19')]));});});};exports[_0x414e('0x27')]=function(_0x12520a,_0x464969,_0x30288d){var _0x2ced49=this;return new Promise(function(_0x1bc1b4,_0x4c8c13){var _0x25fdd2={'body':_0x12520a[_0x414e('0x28')],'channel':_0x414e('0x29')};var _0x35e363=[];var _0x1a3353=[];var _0x44aec0={};return db[_0x414e('0x2a')][_0x414e('0x2b')]()['then'](function(_0x2ef43b){if(!_0x2ef43b){throw new db[(_0x414e('0x2c'))][(_0x414e('0x2d'))](_0x414e('0x2e'));}_0x35e363=_[_0x414e('0x2f')](_[_0x414e('0x30')](_0x2ef43b),['createdAt',_0x414e('0x31')]);_0x1a3353=_[_0x414e('0x2f')](_['keys'](_0x2ef43b),[_0x414e('0x32'),_0x414e('0x31'),_0x414e('0x33'),_0x414e('0x34')]);if(_0x12520a[_0x414e('0x28')]['id']){delete _0x12520a[_0x414e('0x28')]['id'];}if(_['isNil'](_0x12520a[_0x414e('0x28')]['from'])){throw new db[(_0x414e('0x2c'))][(_0x414e('0x2d'))](_0x414e('0x35'));}if(_[_0x414e('0x36')](_0x12520a[_0x414e('0x28')][_0x414e('0x28')])||_0x12520a[_0x414e('0x28')]['body']===''){throw new db['Sequelize'][(_0x414e('0x2d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x414e('0x36')](_0x12520a[_0x414e('0x28')][_0x414e('0x37')])){throw new db[(_0x414e('0x2c'))][(_0x414e('0x2d'))](_0x414e('0x38')+_0x1a3353);}if(!_['includes'](_0x1a3353,_0x12520a[_0x414e('0x28')][_0x414e('0x37')])){throw new db['Sequelize'][(_0x414e('0x2d'))](_0x414e('0x39')+_0x1a3353);}_0x44aec0[_0x12520a[_0x414e('0x28')][_0x414e('0x37')]]=_0x12520a[_0x414e('0x28')][_0x414e('0x3a')];})['then'](function(){return db[_0x414e('0x1c')]['find']({'where':{'id':_0x12520a['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x414e('0x2a')],'as':_0x414e('0x3b'),'where':_0x44aec0,'limit':0x1,'order':[[_0x414e('0x31'),_0x414e('0x3c')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x414e('0x12')](function(_0xe9d109){if(_0xe9d109&&_0xe9d109['List']){var _0x348661=_0xe9d109['get']({'plain':!![]});_0x25fdd2[_0x414e('0x3d')]=_0x348661;_0x25fdd2['applications']=_0x348661[_0x414e('0x3e')];_0x25fdd2['list']=_0x348661[_0x414e('0x3f')];_0x25fdd2[_0x414e('0x40')]=_[_0x414e('0x41')](_0x25fdd2[_0x414e('0x40')],['priority'],['asc']);if(_0x25fdd2[_0x414e('0x3d')]['Applications']){delete _0x25fdd2[_0x414e('0x3d')]['Applications'];}if(_0x25fdd2[_0x414e('0x3d')]['List']&&_0x25fdd2[_0x414e('0x3d')]['List']['Contacts'][_0x414e('0x42')]){return _0x25fdd2[_0x414e('0x3d')][_0x414e('0x3f')][_0x414e('0x3b')][0x0];}var _0x23a563=_[_0x414e('0x43')](_0x12520a[_0x414e('0x28')],{'firstName':_0x12520a[_0x414e('0x28')][_0x414e('0x3a')],'ListId':_0x348661['ListId']});_0x23a563[_0x12520a[_0x414e('0x28')][_0x414e('0x37')]]=_0x12520a['body'][_0x414e('0x3a')];return db[_0x414e('0x2a')][_0x414e('0x44')](_0x23a563,{'fields':_0x35e363,'raw':!![]});}})['then'](function(_0x14cebe){_0x25fdd2[_0x414e('0x45')]=_0x14cebe;if(_0x14cebe){var _0x4ed015={'ContactId':_0x14cebe['id'],'FaxAccountId':_0x12520a[_0x414e('0x3d')]['id'],'fax':_0x14cebe[_0x414e('0x29')]};return db[_0x414e('0x46')][_0x414e('0x47')]({'where':{'ContactId':_0x14cebe['id'],'closed':![],'FaxAccountId':_0x12520a['account']['id']}})[_0x414e('0x12')](function(_0x10ef42){if(_0x10ef42){return[_0x10ef42,![]];}return db[_0x414e('0x46')][_0x414e('0x44')](_0x4ed015)[_0x414e('0x12')](function(_0xbf96c7){return[_0xbf96c7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x414e('0x48')](function(_0x17b946,_0x9a65ad){var _0x9a9216=_0x17b946['get']({'plain':!![]});if(_0x9a65ad){if(_0x25fdd2[_0x414e('0x3d')][_0x414e('0x49')]){_0x25fdd2[_0x414e('0x40')]['push']({'id':0x0,'priority':_0x25fdd2[_0x414e('0x40')]['length']+0x1,'app':_0x414e('0x4a'),'appdata':_0x414e('0x4b'),'interval':_0x414e('0x4c')});}_0x9a9216['created']=!![];}else{_0x9a9216[_0x414e('0x4d')]=![];}_0x25fdd2[_0x414e('0x4e')]=_0x9a9216;return db['FaxMessage'][_0x414e('0x44')]({'body':_0x12520a[_0x414e('0x28')][_0x414e('0x28')],'FaxAccountId':_0x12520a[_0x414e('0x3d')]['id'],'FaxInteractionId':_0x17b946['id'],'direction':'in','ContactId':_0x17b946[_0x414e('0x4f')],'AttachmentId':_0x12520a[_0x414e('0x28')][_0x414e('0x50')]});})[_0x414e('0x12')](function(_0x460739){_0x25fdd2[_0x414e('0x19')]=_0x460739;if(_0x25fdd2['interaction']['UserId']){return db[_0x414e('0x51')][_0x414e('0x47')]({'attributes':['id',_0x414e('0x52')],'where':{'id':_0x25fdd2['interaction'][_0x414e('0x53')]}})[_0x414e('0x12')](function(_0x572537){if(_0x572537){_0x25fdd2[_0x414e('0x40')][_0x414e('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x572537['name']+','+(_0x25fdd2[_0x414e('0x3d')][_0x414e('0x55')]||0xa),'interval':_0x414e('0x4c')});}return respondWithRpcPromise(_0x414e('0x56'),_0x414e('0x57'),_0x25fdd2);});}return respondWithRpcPromise('Start',_0x414e('0x57'),_0x25fdd2);})['then'](function(_0xb69be2){_0x1bc1b4(_0xb69be2);})['catch'](function(_0x1112b9){_0x4c8c13(_0x2ced49['error'](0x1f4,_0x1112b9[_0x414e('0x19')]));});});}; \ No newline at end of file +var _0xaf12=['CmList','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','push','length','close','*,*,*,*','created','interaction','FaxMessage','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','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','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaf12,0x73));var _0x2af1=function(_0x5058e4,_0x42f6ae){_0x5058e4=_0x5058e4-0x0;var _0x5b1da6=_0xaf12[_0x5058e4];return _0x5b1da6;};'use strict';var _=require(_0x2af1('0x0'));var util=require('util');var moment=require(_0x2af1('0x1'));var BPromise=require(_0x2af1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2af1('0x3'))['db'];var utils=require(_0x2af1('0x4'));var logger=require('../../config/logger')(_0x2af1('0x5'));var config=require('../../config/environment');var jayson=require(_0x2af1('0x6'));var client=jayson[_0x2af1('0x7')][_0x2af1('0x8')]({'port':0x232c});config[_0x2af1('0x9')]=_['defaults'](config[_0x2af1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2af1('0xa'))(new Redis(config[_0x2af1('0x9')]));require(_0x2af1('0xb'))[_0x2af1('0xc')](socket);function respondWithRpcPromise(_0x3a21de,_0x24ec05,_0x43007f){return new BPromise(function(_0x4c16d8,_0x4d23de){return client['request'](_0x3a21de,_0x43007f)[_0x2af1('0xd')](function(_0x3a9667){logger['info'](_0x2af1('0xe'),_0x24ec05,_0x2af1('0xf'));logger[_0x2af1('0x10')](_0x2af1('0x11'),_0x24ec05,'request\x20sent',JSON[_0x2af1('0x12')](_0x3a9667));if(_0x3a9667[_0x2af1('0x13')]){if(_0x3a9667['error']['code']===0x1f4){logger[_0x2af1('0x13')]('FaxAccount,\x20%s,\x20%s',_0x24ec05,_0x3a9667[_0x2af1('0x13')][_0x2af1('0x14')]);return _0x4d23de(_0x3a9667['error'][_0x2af1('0x14')]);}logger[_0x2af1('0x13')](_0x2af1('0xe'),_0x24ec05,_0x3a9667[_0x2af1('0x13')][_0x2af1('0x14')]);return _0x4c16d8(_0x3a9667[_0x2af1('0x13')][_0x2af1('0x14')]);}else{logger[_0x2af1('0x15')](_0x2af1('0xe'),_0x24ec05,_0x2af1('0xf'));_0x4c16d8(_0x3a9667[_0x2af1('0x16')][_0x2af1('0x14')]);}})[_0x2af1('0x17')](function(_0x27b66b){logger[_0x2af1('0x13')](_0x2af1('0xe'),_0x24ec05,_0x27b66b);_0x4d23de(_0x27b66b);});});}exports[_0x2af1('0x18')]=function(_0x4751ed){var _0x1e77a3=this;return new Promise(function(_0x4342f4,_0x4ebafe){return db[_0x2af1('0x19')][_0x2af1('0x1a')]({'raw':_0x4751ed[_0x2af1('0x1b')]?_0x4751ed[_0x2af1('0x1b')][_0x2af1('0x1c')]===undefined?!![]:![]:!![],'where':_0x4751ed[_0x2af1('0x1b')]?_0x4751ed[_0x2af1('0x1b')][_0x2af1('0x1d')]||null:null,'attributes':_0x4751ed[_0x2af1('0x1b')]?_0x4751ed[_0x2af1('0x1b')][_0x2af1('0x1e')]||null:null,'limit':_0x4751ed[_0x2af1('0x1b')]?_0x4751ed[_0x2af1('0x1b')]['limit']||null:null,'include':_0x4751ed[_0x2af1('0x1b')]?_0x4751ed['options'][_0x2af1('0x1f')]?_[_0x2af1('0x20')](_0x4751ed[_0x2af1('0x1b')][_0x2af1('0x1f')],function(_0x15e9dc){return{'model':db[_0x15e9dc[_0x2af1('0x21')]],'as':_0x15e9dc['as'],'attributes':_0x15e9dc[_0x2af1('0x1e')],'include':_0x15e9dc[_0x2af1('0x1f')]?_[_0x2af1('0x20')](_0x15e9dc[_0x2af1('0x1f')],function(_0x208385){return{'model':db[_0x208385['model']],'as':_0x208385['as'],'attributes':_0x208385[_0x2af1('0x1e')],'include':_0x208385[_0x2af1('0x1f')]?_[_0x2af1('0x20')](_0x208385[_0x2af1('0x1f')],function(_0x818e75){return{'model':db[_0x818e75[_0x2af1('0x21')]],'as':_0x818e75['as'],'attributes':_0x818e75[_0x2af1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2af1('0xd')](function(_0x19da08){logger['info'](_0x2af1('0x18'),_0x4751ed);logger[_0x2af1('0x10')](_0x2af1('0x18'),_0x4751ed,JSON[_0x2af1('0x12')](_0x19da08));_0x4342f4(_0x19da08);})['catch'](function(_0x566a48){logger[_0x2af1('0x13')]('GetFaxAccount',_0x566a48['message'],_0x4751ed);_0x4ebafe(_0x1e77a3[_0x2af1('0x13')](0x1f4,_0x566a48['message']));});});};exports[_0x2af1('0x22')]=function(_0x596af3,_0x76ebb7,_0xc84663){var _0x183634=this;return new Promise(function(_0x152748,_0xa6df03){var _0x205901={'body':_0x596af3[_0x2af1('0x23')],'channel':'fax'};var _0x2e73e=[];var _0x264f80=[];var _0x389ddd={};return db[_0x2af1('0x24')][_0x2af1('0x25')]()['then'](function(_0x534e98){if(!_0x534e98){throw new db[(_0x2af1('0x26'))][(_0x2af1('0x27'))](_0x2af1('0x28'));}_0x2e73e=_['difference'](_[_0x2af1('0x29')](_0x534e98),[_0x2af1('0x2a'),_0x2af1('0x2b')]);_0x264f80=_['difference'](_[_0x2af1('0x29')](_0x534e98),[_0x2af1('0x2a'),_0x2af1('0x2b'),_0x2af1('0x2c'),_0x2af1('0x2d')]);if(_0x596af3['body']['id']){delete _0x596af3[_0x2af1('0x23')]['id'];}if(_[_0x2af1('0x2e')](_0x596af3['body'][_0x2af1('0x2f')])){throw new db[(_0x2af1('0x26'))][(_0x2af1('0x27'))](_0x2af1('0x30'));}if(_[_0x2af1('0x2e')](_0x596af3[_0x2af1('0x23')]['body'])||_0x596af3[_0x2af1('0x23')][_0x2af1('0x23')]===''){throw new db[(_0x2af1('0x26'))][(_0x2af1('0x27'))](_0x2af1('0x31'));}if(_[_0x2af1('0x2e')](_0x596af3[_0x2af1('0x23')][_0x2af1('0x32')])){throw new db['Sequelize'][(_0x2af1('0x27'))](_0x2af1('0x33')+_0x264f80);}if(!_['includes'](_0x264f80,_0x596af3['body'][_0x2af1('0x32')])){throw new db[(_0x2af1('0x26'))][(_0x2af1('0x27'))](_0x2af1('0x34')+_0x264f80);}_0x389ddd[_0x596af3[_0x2af1('0x23')][_0x2af1('0x32')]]=_0x596af3[_0x2af1('0x23')][_0x2af1('0x2f')];})['then'](function(){return db[_0x2af1('0x19')][_0x2af1('0x35')]({'where':{'id':_0x596af3[_0x2af1('0x36')]['id']},'include':[{'model':db[_0x2af1('0x37')],'as':_0x2af1('0x38'),'include':[{'model':db['CmContact'],'as':_0x2af1('0x39'),'where':_0x389ddd,'limit':0x1,'order':[['updatedAt',_0x2af1('0x3a')]]}]},{'model':db[_0x2af1('0x3b')],'as':'Applications'}]});})[_0x2af1('0xd')](function(_0x216d48){if(_0x216d48&&_0x216d48['List']){var _0x2b5474=_0x216d48[_0x2af1('0x3c')]({'plain':!![]});_0x205901[_0x2af1('0x36')]=_0x2b5474;_0x205901[_0x2af1('0x3d')]=_0x2b5474[_0x2af1('0x3e')];_0x205901[_0x2af1('0x3f')]=_0x2b5474[_0x2af1('0x38')];_0x205901[_0x2af1('0x3d')]=_[_0x2af1('0x40')](_0x205901[_0x2af1('0x3d')],[_0x2af1('0x41')],[_0x2af1('0x42')]);if(_0x205901['account'][_0x2af1('0x3e')]){delete _0x205901[_0x2af1('0x36')][_0x2af1('0x3e')];}if(_0x205901[_0x2af1('0x36')][_0x2af1('0x38')]&&_0x205901[_0x2af1('0x36')]['List'][_0x2af1('0x39')]['length']){return _0x205901['account'][_0x2af1('0x38')][_0x2af1('0x39')][0x0];}var _0x5bfa98=_['defaults'](_0x596af3[_0x2af1('0x23')],{'firstName':_0x596af3['body'][_0x2af1('0x2f')],'ListId':_0x2b5474[_0x2af1('0x2d')]});_0x5bfa98[_0x596af3[_0x2af1('0x23')][_0x2af1('0x32')]]=_0x596af3[_0x2af1('0x23')][_0x2af1('0x2f')];return db[_0x2af1('0x24')][_0x2af1('0x43')](_0x5bfa98,{'fields':_0x2e73e,'raw':!![]});}})[_0x2af1('0xd')](function(_0x230e56){_0x205901[_0x2af1('0x44')]=_0x230e56;if(_0x230e56){var _0x2b7204={'ContactId':_0x230e56['id'],'FaxAccountId':_0x596af3[_0x2af1('0x36')]['id'],'fax':_0x230e56['fax']};return db[_0x2af1('0x45')]['find']({'where':{'ContactId':_0x230e56['id'],'closed':![],'FaxAccountId':_0x596af3[_0x2af1('0x36')]['id']}})['then'](function(_0x4df88f){if(_0x4df88f){return[_0x4df88f,![]];}return db[_0x2af1('0x45')][_0x2af1('0x43')](_0x2b7204)[_0x2af1('0xd')](function(_0x377c35){return[_0x377c35,!![]];});});}else{throw new Error(_0x2af1('0x46'));}})['spread'](function(_0x5c191d,_0x5b49fe){var _0x58ced9=_0x5c191d[_0x2af1('0x3c')]({'plain':!![]});if(_0x5b49fe){if(_0x205901[_0x2af1('0x36')]['autoclose']){_0x205901[_0x2af1('0x3d')][_0x2af1('0x47')]({'id':0x0,'priority':_0x205901[_0x2af1('0x3d')][_0x2af1('0x48')]+0x1,'app':_0x2af1('0x49'),'appdata':'unmanaged','interval':_0x2af1('0x4a')});}_0x58ced9[_0x2af1('0x4b')]=!![];}else{_0x58ced9[_0x2af1('0x4b')]=![];}_0x205901[_0x2af1('0x4c')]=_0x58ced9;return db[_0x2af1('0x4d')]['create']({'body':_0x596af3[_0x2af1('0x23')][_0x2af1('0x23')],'FaxAccountId':_0x596af3[_0x2af1('0x36')]['id'],'FaxInteractionId':_0x5c191d['id'],'direction':'in','ContactId':_0x5c191d['ContactId'],'AttachmentId':_0x596af3[_0x2af1('0x23')]['AttachmentId']});})[_0x2af1('0xd')](function(_0x184fbe){_0x205901[_0x2af1('0x14')]=_0x184fbe;if(_0x205901['interaction'][_0x2af1('0x4e')]){return db[_0x2af1('0x4f')][_0x2af1('0x35')]({'attributes':['id',_0x2af1('0x50')],'where':{'id':_0x205901[_0x2af1('0x4c')][_0x2af1('0x4e')]}})[_0x2af1('0xd')](function(_0x54a802){if(_0x54a802){_0x205901[_0x2af1('0x3d')][_0x2af1('0x51')]({'id':0x0,'priority':0x0,'app':_0x2af1('0x52'),'appdata':_0x54a802[_0x2af1('0x50')]+','+(_0x205901['account']['waitForTheAssignedAgent']||0xa),'interval':_0x2af1('0x4a')});}return respondWithRpcPromise(_0x2af1('0x53'),_0x2af1('0x54'),_0x205901);});}return respondWithRpcPromise(_0x2af1('0x53'),'startRouting',_0x205901);})[_0x2af1('0xd')](function(_0xf78cfc){_0x152748(_0xf78cfc);})[_0x2af1('0x17')](function(_0x5bf19a){_0xa6df03(_0x183634[_0x2af1('0x13')](0x1f4,_0x5bf19a[_0x2af1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e7843c5..0cc1040 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 _0xc74c=['save','update','emit','removeListener','length','./faxAccount.events'];(function(_0x18b6c7,_0x2461f4){var _0xf566f2=function(_0x5e8aff){while(--_0x5e8aff){_0x18b6c7['push'](_0x18b6c7['shift']());}};_0xf566f2(++_0x2461f4);}(_0xc74c,0x101));var _0xcc74=function(_0x51e0d1,_0x575525){_0x51e0d1=_0x51e0d1-0x0;var _0xa0860c=_0xc74c[_0x51e0d1];return _0xa0860c;};'use strict';var FaxAccountEvents=require(_0xcc74('0x0'));var events=[_0xcc74('0x1'),'remove',_0xcc74('0x2')];function createListener(_0x2f3369,_0x2a214e){return function(_0x470099){_0x2a214e[_0xcc74('0x3')](_0x2f3369,_0x470099);};}function removeListener(_0x532eb1,_0x1a79ef){return function(){FaxAccountEvents[_0xcc74('0x4')](_0x532eb1,_0x1a79ef);};}exports['register']=function(_0x48b335){for(var _0x5e4412=0x0,_0x5e233d=events[_0xcc74('0x5')];_0x5e4412<_0x5e233d;_0x5e4412++){var _0x38521f=events[_0x5e4412];var _0x3316f5=createListener('faxAccount:'+_0x38521f,_0x48b335);FaxAccountEvents['on'](_0x38521f,_0x3316f5);}}; \ No newline at end of file +var _0xce59=['update','removeListener','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0xce59,0xc2));var _0x9ce5=function(_0x48431f,_0x23a62d){_0x48431f=_0x48431f-0x0;var _0x49c558=_0xce59[_0x48431f];return _0x49c558;};'use strict';var FaxAccountEvents=require(_0x9ce5('0x0'));var events=[_0x9ce5('0x1'),'remove',_0x9ce5('0x2')];function createListener(_0x21b052,_0x43d1ee){return function(_0xc1a93c){_0x43d1ee['emit'](_0x21b052,_0xc1a93c);};}function removeListener(_0x4c5b46,_0x49b61a){return function(){FaxAccountEvents[_0x9ce5('0x3')](_0x4c5b46,_0x49b61a);};}exports[_0x9ce5('0x4')]=function(_0x4f0068){for(var _0x6b7612=0x0,_0x590294=events[_0x9ce5('0x5')];_0x6b7612<_0x590294;_0x6b7612++){var _0x3f7fdf=events[_0x6b7612];var _0x36e687=createListener(_0x9ce5('0x6')+_0x3f7fdf,_0x4f0068);FaxAccountEvents['on'](_0x3f7fdf,_0x36e687);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 353a166..db8b6ac 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(_0x167d6c,_0x5a7809){var _0x246993=function(_0x71f067){while(--_0x71f067){_0x167d6c['push'](_0x167d6c['shift']());}};_0x246993(++_0x5a7809);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x43bac1,_0x1bff73){var _0x14aac9=function(_0x3a2731){while(--_0x3a2731){_0x43bac1['push'](_0x43bac1['shift']());}};_0x14aac9(++_0x1bff73);}(_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['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 2631d3e..df6450a 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 _0xb7ff=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3bfe34,_0x7681ed){var _0x1a988c=function(_0x375c60){while(--_0x375c60){_0x3bfe34['push'](_0x3bfe34['shift']());}};_0x1a988c(++_0x7681ed);}(_0xb7ff,0xa5));var _0xfb7f=function(_0x48dc3e,_0x4ca1f4){_0x48dc3e=_0x48dc3e-0x0;var _0x5d1995=_0xb7ff[_0x48dc3e];return _0x5d1995;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module[_0xfb7f('0x1')]={'priority':{'type':Sequelize[_0xfb7f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfb7f('0x3')],'allowNull':![],'defaultValue':_0xfb7f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfb7f('0x5')}}; \ No newline at end of file +var _0x91c4=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x2c522d,_0x5f37a3){var _0x104fda=function(_0x2192bc){while(--_0x2192bc){_0x2c522d['push'](_0x2c522d['shift']());}};_0x104fda(++_0x5f37a3);}(_0x91c4,0x99));var _0x491c=function(_0x17ee0d,_0x28a38e){_0x17ee0d=_0x17ee0d-0x0;var _0x22fd4b=_0x91c4[_0x17ee0d];return _0x22fd4b;};'use strict';var Sequelize=require(_0x491c('0x0'));module[_0x491c('0x1')]={'priority':{'type':Sequelize[_0x491c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x491c('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x491c('0x3')]},'interval':{'type':Sequelize[_0x491c('0x3')],'defaultValue':_0x491c('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 43f8473..734ee43 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 _0xff7b=['includeAll','include','findAll','rows','params','filters','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x5d465d,_0x21b8ef){var _0x272927=function(_0x3edc57){while(--_0x3edc57){_0x5d465d['push'](_0x5d465d['shift']());}};_0x272927(++_0x21b8ef);}(_0xff7b,0xf4));var _0xbff7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff7b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbff7('0x0'));var rimraf=require(_0xbff7('0x1'));var zipdir=require(_0xbff7('0x2'));var jsonpatch=require(_0xbff7('0x3'));var rp=require(_0xbff7('0x4'));var moment=require(_0xbff7('0x5'));var BPromise=require(_0xbff7('0x6'));var Mustache=require(_0xbff7('0x7'));var util=require(_0xbff7('0x8'));var path=require('path');var sox=require(_0xbff7('0x9'));var csv=require('to-csv');var ejs=require(_0xbff7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbff7('0xb'));var crypto=require(_0xbff7('0xc'));var jsforce=require(_0xbff7('0xd'));var deskjs=require(_0xbff7('0xe'));var toCsv=require(_0xbff7('0xf'));var querystring=require('querystring');var Papa=require(_0xbff7('0x10'));var Redis=require(_0xbff7('0x11'));var authService=require(_0xbff7('0x12'));var qs=require(_0xbff7('0x13'));var as=require(_0xbff7('0x14'));var hardwareService=require(_0xbff7('0x15'));var logger=require(_0xbff7('0x16'))(_0xbff7('0x17'));var utils=require(_0xbff7('0x18'));var config=require(_0xbff7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbff7('0x1a'))['db'];function respondWithStatusCode(_0x1b1e4e,_0x438dde){_0x438dde=_0x438dde||0xcc;return function(_0x7d3b72){if(_0x7d3b72){return _0x1b1e4e['sendStatus'](_0x438dde);}return _0x1b1e4e[_0xbff7('0x1b')](_0x438dde)[_0xbff7('0x1c')]();};}function respondWithResult(_0x21b026,_0x1e8e4c){_0x1e8e4c=_0x1e8e4c||0xc8;return function(_0x1dbad0){if(_0x1dbad0){return _0x21b026[_0xbff7('0x1b')](_0x1e8e4c)[_0xbff7('0x1d')](_0x1dbad0);}};}function respondWithFilteredResult(_0x6311ad,_0x4c72b1){return function(_0x2d1028){if(_0x2d1028){var _0x3949a1=typeof _0x4c72b1[_0xbff7('0x1e')]===_0xbff7('0x1f')&&typeof _0x4c72b1['limit']===_0xbff7('0x1f');var _0x133c28=_0x2d1028[_0xbff7('0x20')];var _0x47ef0f=_0x3949a1?0x0:_0x4c72b1[_0xbff7('0x1e')];var _0x3d45cc=_0x3949a1?_0x2d1028[_0xbff7('0x20')]:_0x4c72b1[_0xbff7('0x1e')]+_0x4c72b1[_0xbff7('0x21')];var _0x1b63d0;if(_0x3d45cc>=_0x133c28){_0x3d45cc=_0x133c28;_0x1b63d0=0xc8;}else{_0x1b63d0=0xce;}_0x6311ad[_0xbff7('0x1b')](_0x1b63d0);return _0x6311ad[_0xbff7('0x22')](_0xbff7('0x23'),_0x47ef0f+'-'+_0x3d45cc+'/'+_0x133c28)[_0xbff7('0x1d')](_0x2d1028);}return null;};}function patchUpdates(_0x4d5250){return function(_0x573b21){try{jsonpatch[_0xbff7('0x24')](_0x573b21,_0x4d5250,!![]);}catch(_0x57ab82){return BPromise[_0xbff7('0x25')](_0x57ab82);}return _0x573b21[_0xbff7('0x26')]();};}function saveUpdates(_0x108091,_0x2164f6){return function(_0xcf121b){if(_0xcf121b){return _0xcf121b[_0xbff7('0x27')](_0x108091)[_0xbff7('0x28')](function(_0x152531){return _0x152531;});}return null;};}function removeEntity(_0x10d670,_0x37d2d9){return function(_0x5e4b62){if(_0x5e4b62){return _0x5e4b62[_0xbff7('0x29')]()[_0xbff7('0x28')](function(){_0x10d670[_0xbff7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44402e,_0x255547){return function(_0x3b61e6){if(!_0x3b61e6){_0x44402e['sendStatus'](0x194);}return _0x3b61e6;};}function handleError(_0xbcb9cc,_0xd17a53){_0xd17a53=_0xd17a53||0x1f4;return function(_0x39aeb8){logger[_0xbff7('0x2a')](_0x39aeb8[_0xbff7('0x2b')]);if(_0x39aeb8[_0xbff7('0x2c')]){delete _0x39aeb8['name'];}_0xbcb9cc[_0xbff7('0x1b')](_0xd17a53)[_0xbff7('0x2d')](_0x39aeb8);};}exports['index']=function(_0x1dae91,_0x3ed648){var _0x1a326a={},_0x3a213e={},_0x38d9bb={'count':0x0,'rows':[]};var _0x598b6c=_[_0xbff7('0x2e')](db[_0xbff7('0x2f')][_0xbff7('0x30')],function(_0x5ce6fb){return{'name':_0x5ce6fb[_0xbff7('0x31')],'type':_0x5ce6fb[_0xbff7('0x32')][_0xbff7('0x33')]};});_0x3a213e[_0xbff7('0x34')]=_[_0xbff7('0x2e')](_0x598b6c,'name');_0x3a213e[_0xbff7('0x35')]=_[_0xbff7('0x36')](_0x1dae91[_0xbff7('0x35')]);_0x3a213e['filters']=_['intersection'](_0x3a213e[_0xbff7('0x34')],_0x3a213e[_0xbff7('0x35')]);_0x1a326a[_0xbff7('0x37')]=_[_0xbff7('0x38')](_0x3a213e['model'],qs[_0xbff7('0x39')](_0x1dae91['query'][_0xbff7('0x39')]));_0x1a326a[_0xbff7('0x37')]=_0x1a326a[_0xbff7('0x37')][_0xbff7('0x3a')]?_0x1a326a['attributes']:_0x3a213e['model'];if(!_0x1dae91[_0xbff7('0x35')][_0xbff7('0x3b')](_0xbff7('0x3c'))){_0x1a326a['limit']=qs[_0xbff7('0x21')](_0x1dae91[_0xbff7('0x35')][_0xbff7('0x21')]);_0x1a326a[_0xbff7('0x1e')]=qs[_0xbff7('0x1e')](_0x1dae91['query'][_0xbff7('0x1e')]);}_0x1a326a['order']=qs['sort'](_0x1dae91[_0xbff7('0x35')][_0xbff7('0x3d')]);_0x1a326a[_0xbff7('0x3e')]=qs['filters'](_[_0xbff7('0x3f')](_0x1dae91[_0xbff7('0x35')],_0x3a213e['filters']),_0x598b6c);if(_0x1dae91[_0xbff7('0x35')]['filter']){_0x1a326a[_0xbff7('0x3e')]=_[_0xbff7('0x40')](_0x1a326a[_0xbff7('0x3e')],{'$or':_[_0xbff7('0x2e')](_0x598b6c,function(_0x219d93){if(_0x219d93[_0xbff7('0x32')]!==_0xbff7('0x41')){var _0x588cfa={};_0x588cfa[_0x219d93[_0xbff7('0x2c')]]={'$like':'%'+_0x1dae91[_0xbff7('0x35')][_0xbff7('0x42')]+'%'};return _0x588cfa;}})});}_0x1a326a=_['merge']({},_0x1a326a,_0x1dae91[_0xbff7('0x43')]);var _0x3dc8c4={'where':_0x1a326a[_0xbff7('0x3e')]};return db['FaxApplication'][_0xbff7('0x20')](_0x3dc8c4)[_0xbff7('0x28')](function(_0x1fc90c){_0x38d9bb[_0xbff7('0x20')]=_0x1fc90c;if(_0x1dae91['query'][_0xbff7('0x44')]){_0x1a326a[_0xbff7('0x45')]=[{'all':!![]}];}return db[_0xbff7('0x2f')][_0xbff7('0x46')](_0x1a326a);})[_0xbff7('0x28')](function(_0x49b18f){_0x38d9bb[_0xbff7('0x47')]=_0x49b18f;return _0x38d9bb;})[_0xbff7('0x28')](respondWithFilteredResult(_0x3ed648,_0x1a326a))['catch'](handleError(_0x3ed648,null));};exports['show']=function(_0x1b2b64,_0x540fd2){var _0x353339={'raw':!![],'where':{'id':_0x1b2b64[_0xbff7('0x48')]['id']}},_0x162036={};_0x162036[_0xbff7('0x34')]=_[_0xbff7('0x36')](db['FaxApplication']['rawAttributes']);_0x162036['query']=_[_0xbff7('0x36')](_0x1b2b64[_0xbff7('0x35')]);_0x162036[_0xbff7('0x49')]=_[_0xbff7('0x38')](_0x162036[_0xbff7('0x34')],_0x162036[_0xbff7('0x35')]);_0x353339['attributes']=_['intersection'](_0x162036['model'],qs['fields'](_0x1b2b64['query']['fields']));_0x353339[_0xbff7('0x37')]=_0x353339[_0xbff7('0x37')]['length']?_0x353339[_0xbff7('0x37')]:_0x162036[_0xbff7('0x34')];if(_0x1b2b64['query'][_0xbff7('0x44')]){_0x353339[_0xbff7('0x45')]=[{'all':!![]}];}_0x353339=_['merge']({},_0x353339,_0x1b2b64[_0xbff7('0x43')]);return db[_0xbff7('0x2f')][_0xbff7('0x4a')](_0x353339)[_0xbff7('0x28')](handleEntityNotFound(_0x540fd2,null))[_0xbff7('0x28')](respondWithResult(_0x540fd2,null))[_0xbff7('0x4b')](handleError(_0x540fd2,null));};exports[_0xbff7('0x4c')]=function(_0xd60bbc,_0xd7c2aa){return db[_0xbff7('0x2f')][_0xbff7('0x4c')](_0xd60bbc[_0xbff7('0x4d')],{})[_0xbff7('0x28')](respondWithResult(_0xd7c2aa,0xc9))[_0xbff7('0x4b')](handleError(_0xd7c2aa,null));};exports[_0xbff7('0x27')]=function(_0x40c788,_0x16b726){if(_0x40c788[_0xbff7('0x4d')]['id']){delete _0x40c788['body']['id'];}return db['FaxApplication'][_0xbff7('0x4a')]({'where':{'id':_0x40c788[_0xbff7('0x48')]['id']}})['then'](handleEntityNotFound(_0x16b726,null))['then'](saveUpdates(_0x40c788[_0xbff7('0x4d')],null))[_0xbff7('0x28')](respondWithResult(_0x16b726,null))['catch'](handleError(_0x16b726,null));};exports[_0xbff7('0x29')]=function(_0x98c390,_0x29c6f8){return db[_0xbff7('0x2f')][_0xbff7('0x4a')]({'where':{'id':_0x98c390[_0xbff7('0x48')]['id']}})[_0xbff7('0x28')](handleEntityNotFound(_0x29c6f8,null))['then'](removeEntity(_0x29c6f8,null))['catch'](handleError(_0x29c6f8,null));}; \ No newline at end of file +var _0x1fe4=['then','error','stack','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy'];(function(_0xc94351,_0x39c616){var _0x487c44=function(_0x54ecea){while(--_0x54ecea){_0xc94351['push'](_0xc94351['shift']());}};_0x487c44(++_0x39c616);}(_0x1fe4,0xc1));var _0x41fe=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x1fe4[_0x18fb16];return _0x147b0d;};'use strict';var emlformat=require(_0x41fe('0x0'));var rimraf=require(_0x41fe('0x1'));var zipdir=require(_0x41fe('0x2'));var jsonpatch=require(_0x41fe('0x3'));var rp=require(_0x41fe('0x4'));var moment=require(_0x41fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x41fe('0x6'));var util=require(_0x41fe('0x7'));var path=require(_0x41fe('0x8'));var sox=require(_0x41fe('0x9'));var csv=require(_0x41fe('0xa'));var ejs=require(_0x41fe('0xb'));var fs=require('fs');var fs_extra=require(_0x41fe('0xc'));var _=require(_0x41fe('0xd'));var squel=require(_0x41fe('0xe'));var crypto=require('crypto');var jsforce=require(_0x41fe('0xf'));var deskjs=require(_0x41fe('0x10'));var toCsv=require(_0x41fe('0xa'));var querystring=require(_0x41fe('0x11'));var Papa=require(_0x41fe('0x12'));var Redis=require(_0x41fe('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x41fe('0x14'));var as=require(_0x41fe('0x15'));var hardwareService=require(_0x41fe('0x16'));var logger=require(_0x41fe('0x17'))('api');var utils=require(_0x41fe('0x18'));var config=require(_0x41fe('0x19'));var licenseUtil=require(_0x41fe('0x1a'));var db=require(_0x41fe('0x1b'))['db'];function respondWithStatusCode(_0x37ddc6,_0x4133d9){_0x4133d9=_0x4133d9||0xcc;return function(_0x38f81e){if(_0x38f81e){return _0x37ddc6[_0x41fe('0x1c')](_0x4133d9);}return _0x37ddc6[_0x41fe('0x1d')](_0x4133d9)['end']();};}function respondWithResult(_0x1af9d4,_0x53e9d3){_0x53e9d3=_0x53e9d3||0xc8;return function(_0x144350){if(_0x144350){return _0x1af9d4[_0x41fe('0x1d')](_0x53e9d3)[_0x41fe('0x1e')](_0x144350);}};}function respondWithFilteredResult(_0x5b3ddc,_0x57d64a){return function(_0x5b38b1){if(_0x5b38b1){var _0x299d06=typeof _0x57d64a[_0x41fe('0x1f')]===_0x41fe('0x20')&&typeof _0x57d64a[_0x41fe('0x21')]==='undefined';var _0x2cea49=_0x5b38b1[_0x41fe('0x22')];var _0x10f56b=_0x299d06?0x0:_0x57d64a[_0x41fe('0x1f')];var _0x517fd4=_0x299d06?_0x5b38b1[_0x41fe('0x22')]:_0x57d64a[_0x41fe('0x1f')]+_0x57d64a[_0x41fe('0x21')];var _0x5c29dc;if(_0x517fd4>=_0x2cea49){_0x517fd4=_0x2cea49;_0x5c29dc=0xc8;}else{_0x5c29dc=0xce;}_0x5b3ddc[_0x41fe('0x1d')](_0x5c29dc);return _0x5b3ddc[_0x41fe('0x23')]('Content-Range',_0x10f56b+'-'+_0x517fd4+'/'+_0x2cea49)[_0x41fe('0x1e')](_0x5b38b1);}return null;};}function patchUpdates(_0x5bf6e0){return function(_0x231fb6){try{jsonpatch[_0x41fe('0x24')](_0x231fb6,_0x5bf6e0,!![]);}catch(_0x4e8ff6){return BPromise[_0x41fe('0x25')](_0x4e8ff6);}return _0x231fb6[_0x41fe('0x26')]();};}function saveUpdates(_0x206336,_0x4599af){return function(_0x568fbd){if(_0x568fbd){return _0x568fbd[_0x41fe('0x27')](_0x206336)['then'](function(_0x442326){return _0x442326;});}return null;};}function removeEntity(_0x59c556,_0x4eac9d){return function(_0x4fe72a){if(_0x4fe72a){return _0x4fe72a[_0x41fe('0x28')]()[_0x41fe('0x29')](function(){_0x59c556[_0x41fe('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa70b78,_0x4263de){return function(_0x3a2cd7){if(!_0x3a2cd7){_0xa70b78[_0x41fe('0x1c')](0x194);}return _0x3a2cd7;};}function handleError(_0x138fe9,_0x1b18e6){_0x1b18e6=_0x1b18e6||0x1f4;return function(_0x1baabd){logger[_0x41fe('0x2a')](_0x1baabd[_0x41fe('0x2b')]);if(_0x1baabd['name']){delete _0x1baabd['name'];}_0x138fe9['status'](_0x1b18e6)['send'](_0x1baabd);};}exports[_0x41fe('0x2c')]=function(_0x5de4c2,_0x403bbb){var _0x38d997={},_0x5ae1e4={},_0x2a9fb3={'count':0x0,'rows':[]};var _0x3412a4=_['map'](db[_0x41fe('0x2d')][_0x41fe('0x2e')],function(_0x962a1e){return{'name':_0x962a1e[_0x41fe('0x2f')],'type':_0x962a1e[_0x41fe('0x30')][_0x41fe('0x31')]};});_0x5ae1e4[_0x41fe('0x32')]=_[_0x41fe('0x33')](_0x3412a4,_0x41fe('0x34'));_0x5ae1e4[_0x41fe('0x35')]=_[_0x41fe('0x36')](_0x5de4c2[_0x41fe('0x35')]);_0x5ae1e4[_0x41fe('0x37')]=_['intersection'](_0x5ae1e4[_0x41fe('0x32')],_0x5ae1e4[_0x41fe('0x35')]);_0x38d997['attributes']=_[_0x41fe('0x38')](_0x5ae1e4[_0x41fe('0x32')],qs[_0x41fe('0x39')](_0x5de4c2[_0x41fe('0x35')][_0x41fe('0x39')]));_0x38d997[_0x41fe('0x3a')]=_0x38d997[_0x41fe('0x3a')][_0x41fe('0x3b')]?_0x38d997[_0x41fe('0x3a')]:_0x5ae1e4['model'];if(!_0x5de4c2['query'][_0x41fe('0x3c')](_0x41fe('0x3d'))){_0x38d997[_0x41fe('0x21')]=qs['limit'](_0x5de4c2[_0x41fe('0x35')][_0x41fe('0x21')]);_0x38d997[_0x41fe('0x1f')]=qs['offset'](_0x5de4c2[_0x41fe('0x35')][_0x41fe('0x1f')]);}_0x38d997[_0x41fe('0x3e')]=qs[_0x41fe('0x3f')](_0x5de4c2['query'][_0x41fe('0x3f')]);_0x38d997[_0x41fe('0x40')]=qs[_0x41fe('0x37')](_['pick'](_0x5de4c2[_0x41fe('0x35')],_0x5ae1e4[_0x41fe('0x37')]),_0x3412a4);if(_0x5de4c2[_0x41fe('0x35')]['filter']){_0x38d997[_0x41fe('0x40')]=_['merge'](_0x38d997[_0x41fe('0x40')],{'$or':_['map'](_0x3412a4,function(_0x534599){if(_0x534599['type']!=='VIRTUAL'){var _0xecc54f={};_0xecc54f[_0x534599[_0x41fe('0x34')]]={'$like':'%'+_0x5de4c2[_0x41fe('0x35')][_0x41fe('0x41')]+'%'};return _0xecc54f;}})});}_0x38d997=_[_0x41fe('0x42')]({},_0x38d997,_0x5de4c2[_0x41fe('0x43')]);var _0x50a5cf={'where':_0x38d997[_0x41fe('0x40')]};return db[_0x41fe('0x2d')][_0x41fe('0x22')](_0x50a5cf)[_0x41fe('0x29')](function(_0x368e98){_0x2a9fb3[_0x41fe('0x22')]=_0x368e98;if(_0x5de4c2[_0x41fe('0x35')][_0x41fe('0x44')]){_0x38d997[_0x41fe('0x45')]=[{'all':!![]}];}return db[_0x41fe('0x2d')][_0x41fe('0x46')](_0x38d997);})[_0x41fe('0x29')](function(_0xd6f014){_0x2a9fb3[_0x41fe('0x47')]=_0xd6f014;return _0x2a9fb3;})[_0x41fe('0x29')](respondWithFilteredResult(_0x403bbb,_0x38d997))[_0x41fe('0x48')](handleError(_0x403bbb,null));};exports[_0x41fe('0x49')]=function(_0x253adb,_0x4104ab){var _0x3432d3={'raw':!![],'where':{'id':_0x253adb[_0x41fe('0x4a')]['id']}},_0x3152a2={};_0x3152a2['model']=_[_0x41fe('0x36')](db[_0x41fe('0x2d')]['rawAttributes']);_0x3152a2[_0x41fe('0x35')]=_['keys'](_0x253adb[_0x41fe('0x35')]);_0x3152a2[_0x41fe('0x37')]=_[_0x41fe('0x38')](_0x3152a2[_0x41fe('0x32')],_0x3152a2['query']);_0x3432d3[_0x41fe('0x3a')]=_['intersection'](_0x3152a2['model'],qs[_0x41fe('0x39')](_0x253adb['query']['fields']));_0x3432d3[_0x41fe('0x3a')]=_0x3432d3[_0x41fe('0x3a')][_0x41fe('0x3b')]?_0x3432d3[_0x41fe('0x3a')]:_0x3152a2[_0x41fe('0x32')];if(_0x253adb[_0x41fe('0x35')]['includeAll']){_0x3432d3['include']=[{'all':!![]}];}_0x3432d3=_['merge']({},_0x3432d3,_0x253adb[_0x41fe('0x43')]);return db[_0x41fe('0x2d')][_0x41fe('0x4b')](_0x3432d3)[_0x41fe('0x29')](handleEntityNotFound(_0x4104ab,null))[_0x41fe('0x29')](respondWithResult(_0x4104ab,null))['catch'](handleError(_0x4104ab,null));};exports[_0x41fe('0x4c')]=function(_0x5752e4,_0x1d001e){return db[_0x41fe('0x2d')]['create'](_0x5752e4[_0x41fe('0x4d')],{})[_0x41fe('0x29')](respondWithResult(_0x1d001e,0xc9))[_0x41fe('0x48')](handleError(_0x1d001e,null));};exports[_0x41fe('0x27')]=function(_0x4cffaf,_0x2718cb){if(_0x4cffaf[_0x41fe('0x4d')]['id']){delete _0x4cffaf[_0x41fe('0x4d')]['id'];}return db[_0x41fe('0x2d')]['find']({'where':{'id':_0x4cffaf['params']['id']}})[_0x41fe('0x29')](handleEntityNotFound(_0x2718cb,null))[_0x41fe('0x29')](saveUpdates(_0x4cffaf[_0x41fe('0x4d')],null))[_0x41fe('0x29')](respondWithResult(_0x2718cb,null))['catch'](handleError(_0x2718cb,null));};exports[_0x41fe('0x28')]=function(_0x585857,_0x5c08eb){return db[_0x41fe('0x2d')]['find']({'where':{'id':_0x585857[_0x41fe('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c08eb,null))[_0x41fe('0x29')](removeEntity(_0x5c08eb,null))[_0x41fe('0x48')](handleError(_0x5c08eb,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 0f054cf..20698df 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 _0x7c05=['request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x460ac2,_0x42e7a1){var _0x578d74=function(_0x2977da){while(--_0x2977da){_0x460ac2['push'](_0x460ac2['shift']());}};_0x578d74(++_0x42e7a1);}(_0x7c05,0x6a));var _0x57c0=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x7c05[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x57c0('0x0'));var util=require(_0x57c0('0x1'));var logger=require(_0x57c0('0x2'))(_0x57c0('0x3'));var moment=require(_0x57c0('0x4'));var BPromise=require(_0x57c0('0x5'));var rp=require(_0x57c0('0x6'));var fs=require('fs');var path=require(_0x57c0('0x7'));var rimraf=require('rimraf');var config=require(_0x57c0('0x8'));var attributes=require(_0x57c0('0x9'));module['exports']=function(_0x4c9821,_0x46deea){return _0x4c9821[_0x57c0('0xa')](_0x57c0('0xb'),attributes,{'tableName':_0x57c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x57c0('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x141a=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x141a,0x9b));var _0xa141=function(_0x41fa70,_0x21af4e){_0x41fa70=_0x41fa70-0x0;var _0x5364ee=_0x141a[_0x41fa70];return _0x5364ee;};'use strict';var _=require(_0xa141('0x0'));var util=require(_0xa141('0x1'));var logger=require(_0xa141('0x2'))(_0xa141('0x3'));var moment=require(_0xa141('0x4'));var BPromise=require(_0xa141('0x5'));var rp=require(_0xa141('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa141('0x7'));var attributes=require(_0xa141('0x8'));module[_0xa141('0x9')]=function(_0x364ee0,_0x473c56){return _0x364ee0[_0xa141('0xa')](_0xa141('0xb'),attributes,{'tableName':_0xa141('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa141('0xd'),'collate':_0xa141('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e85a77a..3b3fffd 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 _0x99bc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x99bc,0x1c1));var _0xc99b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x99bc[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0xc99b('0x0'));var moment=require(_0xc99b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc99b('0x2'));var db=require(_0xc99b('0x3'))['db'];var utils=require(_0xc99b('0x4'));var logger=require(_0xc99b('0x5'))(_0xc99b('0x6'));var config=require('../../config/environment');var jayson=require(_0xc99b('0x7'));var client=jayson[_0xc99b('0x8')][_0xc99b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b1a9b,_0x5a1a13,_0x2c8b37){return new BPromise(function(_0x2d151a,_0x40b1d8){return client[_0xc99b('0xa')](_0x2b1a9b,_0x2c8b37)['then'](function(_0x32ba05){logger[_0xc99b('0xb')]('FaxApplication,\x20%s,\x20%s',_0x5a1a13,'request\x20sent');logger[_0xc99b('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5a1a13,_0xc99b('0xd'),JSON[_0xc99b('0xe')](_0x32ba05));if(_0x32ba05[_0xc99b('0xf')]){if(_0x32ba05[_0xc99b('0xf')]['code']===0x1f4){logger[_0xc99b('0xf')](_0xc99b('0x10'),_0x5a1a13,_0x32ba05[_0xc99b('0xf')][_0xc99b('0x11')]);return _0x40b1d8(_0x32ba05[_0xc99b('0xf')]['message']);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x5a1a13,_0x32ba05[_0xc99b('0xf')][_0xc99b('0x11')]);return _0x2d151a(_0x32ba05[_0xc99b('0xf')][_0xc99b('0x11')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x5a1a13,'request\x20sent');_0x2d151a(_0x32ba05[_0xc99b('0x12')][_0xc99b('0x11')]);}})[_0xc99b('0x13')](function(_0x316672){logger[_0xc99b('0xf')](_0xc99b('0x10'),_0x5a1a13,_0x316672);_0x40b1d8(_0x316672);});});}exports['UpdateFaxApplication']=function(_0x50f8f8){var _0x59733a=this;return new Promise(function(_0x9e78dc,_0x136dd9){return db[_0xc99b('0x14')][_0xc99b('0x15')](_0x50f8f8[_0xc99b('0x16')],{'raw':_0x50f8f8[_0xc99b('0x17')]?_0x50f8f8[_0xc99b('0x17')][_0xc99b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50f8f8[_0xc99b('0x17')]?_0x50f8f8[_0xc99b('0x17')][_0xc99b('0x19')]||null:null,'attributes':_0x50f8f8['options']?_0x50f8f8['options'][_0xc99b('0x1a')]||null:null,'limit':_0x50f8f8[_0xc99b('0x17')]?_0x50f8f8['options'][_0xc99b('0x1b')]||null:null})[_0xc99b('0x1c')](function(_0x180b83){logger[_0xc99b('0xb')](_0xc99b('0x1d'),_0x50f8f8);logger[_0xc99b('0xc')](_0xc99b('0x1d'),_0x50f8f8,JSON[_0xc99b('0xe')](_0x180b83));_0x9e78dc(_0x180b83);})['catch'](function(_0x595804){logger[_0xc99b('0xf')]('UpdateFaxApplication',_0x595804[_0xc99b('0x11')],_0x50f8f8);_0x136dd9(_0x59733a[_0xc99b('0xf')](0x1f4,_0x595804[_0xc99b('0x11')]));});});}; \ No newline at end of file +var _0x34e4=['result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','limit','debug','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e4,0x87));var _0x434e=function(_0x540995,_0x3b1dba){_0x540995=_0x540995-0x0;var _0x2f89ba=_0x34e4[_0x540995];return _0x2f89ba;};'use strict';var _=require('lodash');var util=require(_0x434e('0x0'));var moment=require(_0x434e('0x1'));var BPromise=require('bluebird');var rs=require(_0x434e('0x2'));var fs=require('fs');var Redis=require(_0x434e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x434e('0x4'));var logger=require(_0x434e('0x5'))(_0x434e('0x6'));var config=require(_0x434e('0x7'));var jayson=require(_0x434e('0x8'));var client=jayson[_0x434e('0x9')][_0x434e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36065e,_0x2e8415,_0x3d253c){return new BPromise(function(_0x40b752,_0x341b99){return client[_0x434e('0xb')](_0x36065e,_0x3d253c)[_0x434e('0xc')](function(_0x12c4de){logger[_0x434e('0xd')](_0x434e('0xe'),_0x2e8415,'request\x20sent');logger['debug'](_0x434e('0xf'),_0x2e8415,_0x434e('0x10'),JSON['stringify'](_0x12c4de));if(_0x12c4de['error']){if(_0x12c4de[_0x434e('0x11')][_0x434e('0x12')]===0x1f4){logger[_0x434e('0x11')](_0x434e('0xe'),_0x2e8415,_0x12c4de[_0x434e('0x11')][_0x434e('0x13')]);return _0x341b99(_0x12c4de[_0x434e('0x11')][_0x434e('0x13')]);}logger[_0x434e('0x11')](_0x434e('0xe'),_0x2e8415,_0x12c4de[_0x434e('0x11')][_0x434e('0x13')]);return _0x40b752(_0x12c4de['error']['message']);}else{logger['info'](_0x434e('0xe'),_0x2e8415,_0x434e('0x10'));_0x40b752(_0x12c4de[_0x434e('0x14')][_0x434e('0x13')]);}})[_0x434e('0x15')](function(_0x14af97){logger[_0x434e('0x11')](_0x434e('0xe'),_0x2e8415,_0x14af97);_0x341b99(_0x14af97);});});}exports[_0x434e('0x16')]=function(_0x4fc983){var _0xfa23f7=this;return new Promise(function(_0x30fac6,_0x506b15){return db[_0x434e('0x17')]['update'](_0x4fc983['body'],{'raw':_0x4fc983[_0x434e('0x18')]?_0x4fc983[_0x434e('0x18')][_0x434e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fc983['options']?_0x4fc983[_0x434e('0x18')][_0x434e('0x1a')]||null:null,'attributes':_0x4fc983['options']?_0x4fc983[_0x434e('0x18')][_0x434e('0x1b')]||null:null,'limit':_0x4fc983[_0x434e('0x18')]?_0x4fc983[_0x434e('0x18')][_0x434e('0x1c')]||null:null})[_0x434e('0xc')](function(_0x33051d){logger['info'](_0x434e('0x16'),_0x4fc983);logger[_0x434e('0x1d')](_0x434e('0x16'),_0x4fc983,JSON[_0x434e('0x1e')](_0x33051d));_0x30fac6(_0x33051d);})[_0x434e('0x15')](function(_0x521cb6){logger['error'](_0x434e('0x16'),_0x521cb6['message'],_0x4fc983);_0x506b15(_0xfa23f7['error'](0x1f4,_0x521cb6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9cc9b1f..a40a942 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 _0x0abf=['isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0xb')]('/',auth[_0xf0ab('0x8')](),controller['create']);router[_0xf0ab('0xc')](_0xf0ab('0xd'),auth[_0xf0ab('0x8')](),controller['update']);router['delete'](_0xf0ab('0xd'),auth['isAuthenticated'](),controller[_0xf0ab('0xe')]);module[_0xf0ab('0xf')]=router; \ No newline at end of file +var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x3646f9,_0x106737){var _0x16488c=function(_0x244e98){while(--_0x244e98){_0x3646f9['push'](_0x3646f9['shift']());}};_0x16488c(++_0x106737);}(_0xd4a2,0x173));var _0x2d4a=function(_0x12f5ef,_0x3b5f0b){_0x12f5ef=_0x12f5ef-0x0;var _0x4ceddf=_0xd4a2[_0x12f5ef];return _0x4ceddf;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1356bf6..597cfd0 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 _0xcff5=['exports','BOOLEAN','STRING','ENUM','out','DATE','sequelize'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xcff5,0xa0));var _0x5cff=function(_0x49f30d,_0x50300a){_0x49f30d=_0x49f30d-0x0;var _0x2c75fa=_0xcff5[_0x49f30d];return _0x2c75fa;};'use strict';var Sequelize=require(_0x5cff('0x0'));module[_0x5cff('0x1')]={'closed':{'type':Sequelize[_0x5cff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5cff('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5cff('0x3')]},'note':{'type':Sequelize[_0x5cff('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x5cff('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5cff('0x4')]('in',_0x5cff('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5cff('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x5cff('0x4')]('in',_0x5cff('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xa928=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x5238fd,_0x46f20f){var _0x10d2e8=function(_0x2740ff){while(--_0x2740ff){_0x5238fd['push'](_0x5238fd['shift']());}};_0x10d2e8(++_0x46f20f);}(_0xa928,0xe3));var _0x8a92=function(_0x3546e5,_0x38a813){_0x3546e5=_0x3546e5-0x0;var _0x5bfe78=_0xa928[_0x3546e5];return _0x5bfe78;};'use strict';var Sequelize=require(_0x8a92('0x0'));module[_0x8a92('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a92('0x2')]},'disposition':{'type':Sequelize[_0x8a92('0x3')]},'secondDisposition':{'type':Sequelize[_0x8a92('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8a92('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8a92('0x2')]},'fax':{'type':Sequelize[_0x8a92('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8a92('0x4')]('in',_0x8a92('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a92('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8a92('0x4')]('in',_0x8a92('0x5')),'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 f4259aa..a2d7f88 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 _0x8de5=['total','closed','UserId','talking','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','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?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','FaxInteraction','includeAll','include','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','push','catch','waiting','answered','unmanaged'];(function(_0x7144dc,_0x5480a1){var _0x1c242e=function(_0x41dcfc){while(--_0x41dcfc){_0x7144dc['push'](_0x7144dc['shift']());}};_0x1c242e(++_0x5480a1);}(_0x8de5,0x179));var _0x58de=function(_0x481274,_0x60b442){_0x481274=_0x481274-0x0;var _0x3c1e42=_0x8de5[_0x481274];return _0x3c1e42;};'use strict';var emlformat=require(_0x58de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58de('0x1'));var jsonpatch=require(_0x58de('0x2'));var rp=require('request-promise');var moment=require(_0x58de('0x3'));var BPromise=require(_0x58de('0x4'));var Mustache=require(_0x58de('0x5'));var util=require(_0x58de('0x6'));var path=require(_0x58de('0x7'));var sox=require(_0x58de('0x8'));var csv=require('to-csv');var ejs=require(_0x58de('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58de('0xa'));var squel=require(_0x58de('0xb'));var crypto=require(_0x58de('0xc'));var jsforce=require(_0x58de('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x58de('0xe'));var Papa=require(_0x58de('0xf'));var Redis=require('ioredis');var authService=require(_0x58de('0x10'));var qs=require(_0x58de('0x11'));var as=require(_0x58de('0x12'));var hardwareService=require(_0x58de('0x13'));var logger=require('../../config/logger')(_0x58de('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x58de('0x15'));var db=require(_0x58de('0x16'))['db'];config[_0x58de('0x17')]=_[_0x58de('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58de('0x19'))(new Redis(config[_0x58de('0x17')]));require('./faxInteraction.socket')[_0x58de('0x1a')](socket);function respondWithStatusCode(_0x5db5d8,_0x11d542){_0x11d542=_0x11d542||0xcc;return function(_0x392e9b){if(_0x392e9b){return _0x5db5d8[_0x58de('0x1b')](_0x11d542);}return _0x5db5d8[_0x58de('0x1c')](_0x11d542)[_0x58de('0x1d')]();};}function respondWithResult(_0x2fe0a3,_0xb3bc23){_0xb3bc23=_0xb3bc23||0xc8;return function(_0x4d3867){if(_0x4d3867){return _0x2fe0a3['status'](_0xb3bc23)[_0x58de('0x1e')](_0x4d3867);}};}function respondWithFilteredResult(_0x481280,_0x3378df){return function(_0x3c35e5){if(_0x3c35e5){var _0x27e3b1=typeof _0x3378df[_0x58de('0x1f')]===_0x58de('0x20')&&typeof _0x3378df[_0x58de('0x21')]===_0x58de('0x20');var _0x15791f=_0x3c35e5[_0x58de('0x22')];var _0x3f184c=_0x27e3b1?0x0:_0x3378df[_0x58de('0x1f')];var _0x2d2bdc=_0x27e3b1?_0x3c35e5[_0x58de('0x22')]:_0x3378df[_0x58de('0x1f')]+_0x3378df[_0x58de('0x21')];var _0x11b53b;if(_0x2d2bdc>=_0x15791f){_0x2d2bdc=_0x15791f;_0x11b53b=0xc8;}else{_0x11b53b=0xce;}_0x481280[_0x58de('0x1c')](_0x11b53b);return _0x481280[_0x58de('0x23')](_0x58de('0x24'),_0x3f184c+'-'+_0x2d2bdc+'/'+_0x15791f)['json'](_0x3c35e5);}return null;};}function patchUpdates(_0x2e0bda){return function(_0x2d13e2){try{jsonpatch['apply'](_0x2d13e2,_0x2e0bda,!![]);}catch(_0x182fa6){return BPromise['reject'](_0x182fa6);}return _0x2d13e2[_0x58de('0x25')]();};}function saveUpdates(_0x3aea4c,_0x452bf9){return function(_0x492d74){if(_0x492d74){return _0x492d74[_0x58de('0x26')](_0x3aea4c)['then'](function(_0x11f7ab){return _0x11f7ab;});}return null;};}function removeEntity(_0x1fb417,_0x19c515){return function(_0x449aed){if(_0x449aed){return _0x449aed[_0x58de('0x27')]()[_0x58de('0x28')](function(){_0x1fb417[_0x58de('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec2de,_0x5964aa){return function(_0x667c9){if(!_0x667c9){_0x5ec2de[_0x58de('0x1b')](0x194);}return _0x667c9;};}function handleError(_0x1fa800,_0x31f5d0){_0x31f5d0=_0x31f5d0||0x1f4;return function(_0x211dca){logger[_0x58de('0x29')](_0x211dca[_0x58de('0x2a')]);if(_0x211dca[_0x58de('0x2b')]){delete _0x211dca[_0x58de('0x2b')];}_0x1fa800[_0x58de('0x1c')](_0x31f5d0)['send'](_0x211dca);};}function getInteractionUsers(_0x3203c7,_0x34a995){return new BPromise(function(_0x27bd1f,_0x2c47ef){try{if(_0x34a995[_0x3203c7['id']]){_0x3203c7[_0x58de('0x2c')]=_[_0x58de('0x2d')](_0x34a995[_0x3203c7['id']],function(_0x463ae1){return{'id':_0x463ae1['id'],'fullname':_0x463ae1[_0x58de('0x2e')]};});}}catch(_0x40c9c5){_0x2c47ef(_0x40c9c5);}_0x27bd1f(_0x3203c7);});}function getInteractionTags(_0x5868db,_0x1d9fe6){return new BPromise(function(_0x17aa7d,_0x221138){try{if(_0x5868db[_0x58de('0x2f')]){_0x5868db[_0x58de('0x30')]=[];_0x5868db[_0x58de('0x2f')][_0x58de('0x31')](',')['forEach'](function(_0x38fe49){_0x5868db['Tags'][_0x58de('0x32')](_0x1d9fe6[_0x38fe49]);});}delete _0x5868db[_0x58de('0x2f')];}catch(_0x3a95d4){_0x221138(_0x3a95d4);}_0x17aa7d(_0x5868db);});}function updateFaxInteraction(_0x1b340b,_0x444b2b,_0x13cbb8){return new BPromise(function(_0x442caa,_0x50d132){return getInteractionUsers(_0x1b340b,_0x13cbb8)[_0x58de('0x28')](function(_0x510ac7){return getInteractionTags(_0x510ac7,_0x444b2b);})['then'](function(_0x491d26){return getStateInteraction(_0x491d26);})[_0x58de('0x28')](function(_0x4354fc){_0x442caa(_0x4354fc);})[_0x58de('0x33')](function(_0x392433){_0x50d132(_0x392433);});});}function getStateInteraction(_0x290d71){return new BPromise(function(_0x22fbe0){_0x290d71[_0x58de('0x34')]=0x0;_0x290d71['talking']=0x0;_0x290d71[_0x58de('0x35')]=0x0;_0x290d71[_0x58de('0x36')]=0x0;_0x290d71[_0x58de('0x37')]=0x0;if(!_0x290d71[_0x58de('0x38')]&&!_0x290d71[_0x58de('0x39')]){_0x290d71[_0x58de('0x34')]+=0x1;}if(!_0x290d71['closed']&&_0x290d71[_0x58de('0x39')]){_0x290d71[_0x58de('0x3a')]+=0x1;if(_0x290d71[_0x58de('0x34')]){_0x290d71['waiting']-=0x1;}}if(_0x290d71[_0x58de('0x38')]&&_0x290d71['UserId']){_0x290d71[_0x58de('0x35')]+=0x1;if(_0x290d71[_0x58de('0x3a')]){_0x290d71['talking']-=0x1;}}if(_0x290d71[_0x58de('0x38')]&&!_0x290d71[_0x58de('0x39')]){_0x290d71[_0x58de('0x36')]+=0x1;if(_0x290d71['waiting']){_0x290d71[_0x58de('0x34')]-=0x1;}}_0x290d71[_0x58de('0x37')]+=0x1;_0x22fbe0(_0x290d71);});}exports['index']=function(_0x33db34,_0x347bc5){var _0x61da81={},_0x827a5a={},_0x52e1fb={'count':0x0,'rows':[]};var _0x49115d=_[_0x58de('0x2d')](db['FaxInteraction'][_0x58de('0x3b')],function(_0x3a1f02){return{'name':_0x3a1f02['fieldName'],'type':_0x3a1f02[_0x58de('0x3c')][_0x58de('0x3d')]};});_0x827a5a[_0x58de('0x3e')]=_[_0x58de('0x2d')](_0x49115d,_0x58de('0x2b'));_0x827a5a[_0x58de('0x3f')]=_[_0x58de('0x40')](_0x33db34[_0x58de('0x3f')]);_0x827a5a[_0x58de('0x41')]=_[_0x58de('0x42')](_0x827a5a[_0x58de('0x3e')],_0x827a5a[_0x58de('0x3f')]);_0x61da81[_0x58de('0x43')]=_[_0x58de('0x42')](_0x827a5a[_0x58de('0x3e')],qs[_0x58de('0x44')](_0x33db34[_0x58de('0x3f')][_0x58de('0x44')]));_0x61da81[_0x58de('0x43')]=_0x61da81[_0x58de('0x43')][_0x58de('0x45')]?_0x61da81[_0x58de('0x43')]:_0x827a5a[_0x58de('0x3e')];if(!_0x33db34[_0x58de('0x3f')][_0x58de('0x46')](_0x58de('0x47'))){_0x61da81['limit']=qs[_0x58de('0x21')](_0x33db34['query'][_0x58de('0x21')]);_0x61da81[_0x58de('0x1f')]=qs[_0x58de('0x1f')](_0x33db34[_0x58de('0x3f')][_0x58de('0x1f')]);}_0x61da81[_0x58de('0x48')]=qs['sort'](_0x33db34[_0x58de('0x3f')][_0x58de('0x49')]);_0x61da81[_0x58de('0x4a')]=qs[_0x58de('0x41')](_[_0x58de('0x4b')](_0x33db34['query'],_0x827a5a[_0x58de('0x41')]),_0x49115d);var _0x5e167c=[];var _0x148df0=squel[_0x58de('0x4c')]()[_0x58de('0x4d')]('id')[_0x58de('0x4d')](_0x58de('0x2b'))[_0x58de('0x4d')](_0x58de('0x4e'))[_0x58de('0x4f')](_0x58de('0x50'));var _0x42693c=squel[_0x58de('0x4c')]()[_0x58de('0x4d')](_0x58de('0x51'))[_0x58de('0x4d')](_0x58de('0x52'))[_0x58de('0x4d')](_0x58de('0x53'))[_0x58de('0x4f')](_0x58de('0x54'),'ui')[_0x58de('0x55')](_0x58de('0x56'),'u',_0x58de('0x57'));var _0x1075ff=squel[_0x58de('0x4c')]()[_0x58de('0x4f')](_0x58de('0x58'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x58de('0x55')](_0x58de('0x56'),'o',_0x58de('0x59'))[_0x58de('0x55')](_0x58de('0x5a'),'a','a.id\x20=\x20i.FaxAccountId')[_0x58de('0x55')](_0x58de('0x5b'),'me',_0x58de('0x5c'))[_0x58de('0x55')](_0x58de('0x5d'),'it',_0x58de('0x5e'))['left_join'](_0x58de('0x50'),'t',_0x58de('0x5f'));var _0x48a9f=squel['expr']();var _0x4b7696=[];var _0x5c1141=squel[_0x58de('0x60')]();var _0x5d1c19;if(_0x33db34[_0x58de('0x3f')]['search']){_0x5d1c19=as[_0x58de('0x61')](_0x33db34[_0x58de('0x3f')][_0x58de('0x62')]);var _0x27cb2e=_0x5d1c19[_0x58de('0x63')];for(var _0x19f3ad=0x0;_0x19f3ad<_0x5d1c19[_0x58de('0x64')][_0x58de('0x45')];_0x19f3ad++){var _0x6e33c6=_0x5d1c19[_0x58de('0x64')][_0x19f3ad];var _0x32d83e='i';var _0x3aa6ab=_[_0x58de('0x65')](_0x49115d,[_0x58de('0x2b'),_0x6e33c6[_0x58de('0x4d')]]);if(!_0x3aa6ab){switch(_0x6e33c6[_0x58de('0x4d')]){case _0x58de('0x66'):if(_0x6e33c6[_0x58de('0x67')]==0x1){_0x1075ff['having']('`'+_0x6e33c6[_0x58de('0x4d')]+_0x58de('0x68'));}else{_0x1075ff[_0x58de('0x69')]('`'+_0x6e33c6['field']+_0x58de('0x6a'));}break;case'Contact':if(_0x6e33c6['operator']===_0x58de('0x6b')){if(_0x6e33c6['value'][_0x58de('0x31')]('\x20')[_0x58de('0x45')]>0x1){_0x48a9f[_0x27cb2e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6e33c6[_0x58de('0x67')]),null);}else{var _0x4b99e1='%'+_0x6e33c6['value']+'%';_0x48a9f[_0x27cb2e](_0x58de('0x6c'),_0x4b99e1,_0x4b99e1,_0x4b99e1);}}else{_0x3aa6ab=_[_0x58de('0x65')](_0x49115d,['name',_0x58de('0x6d')]);_0x6e33c6[_0x58de('0x4d')]='ContactId';_0x52e6d7=as[_0x58de('0x6e')](_0x32d83e,_0x3aa6ab[_0x58de('0x3c')],_0x6e33c6);_0x48a9f[_0x27cb2e](_0x52e6d7[_0x58de('0x6f')],_0x52e6d7[_0x58de('0x67')][_0x58de('0x70')],_0x52e6d7[_0x58de('0x67')][_0x58de('0x1d')]);}break;case _0x58de('0x71'):var _0x4ad62d=_0x6e33c6[_0x58de('0x67')]['split'](',')[_0x58de('0x2d')](function(_0x137cdd){return Number(_0x137cdd);});_0x4ad62d[_0x58de('0x72')](function(_0x196105){_0x5c1141['or'](_0x58de('0x73'),'%,'+_0x196105+',%');});_0x4b7696=_[_0x58de('0x74')](_0x4b7696,_0x4ad62d);break;case _0x58de('0x75'):if(_0x6e33c6['operator']===_0x58de('0x6b')){_0x48a9f[_0x27cb2e](_0x58de('0x76'),'%'+_0x6e33c6[_0x58de('0x67')]+'%',null);}else{_0x3aa6ab=_[_0x58de('0x65')](_0x49115d,[_0x58de('0x2b'),'UserId']);_0x6e33c6['field']='UserId';_0x52e6d7=as[_0x58de('0x6e')](_0x32d83e,_0x3aa6ab[_0x58de('0x3c')],_0x6e33c6);_0x48a9f[_0x27cb2e](_0x52e6d7[_0x58de('0x6f')],_0x52e6d7[_0x58de('0x67')]['start'],_0x52e6d7[_0x58de('0x67')][_0x58de('0x1d')]);}break;case _0x58de('0x77'):_0x52e6d7=as[_0x58de('0x6e')]('me',null,_0x6e33c6);_0x48a9f[_0x27cb2e](_0x52e6d7['text'],_0x52e6d7[_0x58de('0x67')][_0x58de('0x70')],_0x52e6d7[_0x58de('0x67')]['end']);break;}}else{var _0x52e6d7=as[_0x58de('0x6e')](_0x32d83e,_0x3aa6ab['type'],_0x6e33c6);_0x48a9f[_0x27cb2e](_0x52e6d7[_0x58de('0x6f')],_0x52e6d7[_0x58de('0x67')][_0x58de('0x70')],_0x52e6d7[_0x58de('0x67')]['end']);}}}else{var _0x102696=_(_0x33db34['query'])[_0x58de('0x40')]()['map'](function(_0x1e9e88){return _[_0x58de('0x78')](_0x49115d,['name',_0x1e9e88])?_0x1e9e88:undefined;})[_0x58de('0x79')]()['value']();if(!_['isEmpty'](_0x102696)){_0x102696[_0x58de('0x72')](function(_0x401f33){if(_0x401f33==='FaxAccountId'){_0x1075ff[_0x58de('0x4a')](_0x58de('0x7a'),[][_0x58de('0x7b')](_0x33db34['query'][_0x401f33]));}else if(_0x401f33===_0x58de('0x7c')){var _0x58c172=JSON[_0x58de('0x7d')](_0x33db34[_0x58de('0x3f')][_0x401f33])[_0x58de('0x7e')];var _0xd441a9=JSON[_0x58de('0x7d')](_0x33db34[_0x58de('0x3f')][_0x401f33])[_0x58de('0x7f')];_0x1075ff[_0x58de('0x4a')](_0x58de('0x80'),_0x58c172,_0xd441a9);}else{if(_0x33db34[_0x58de('0x3f')][_0x401f33]===_0x58de('0x81')){_0x1075ff['where']('i.'+_0x401f33+_0x58de('0x82'));}else{_0x1075ff[_0x58de('0x4a')]('i.'+_0x401f33+_0x58de('0x83'),_0x33db34['query'][_0x401f33]);}}});}if(_0x33db34[_0x58de('0x3f')][_0x58de('0x84')]){if(_0x33db34[_0x58de('0x3f')][_0x58de('0x84')]==0x1){_0x1075ff['having'](_0x58de('0x85'));}else{_0x1075ff[_0x58de('0x69')]('`unreadMessages`\x20>\x200');}}if(_0x33db34['query'][_0x58de('0x86')]){_0x4b7696=_[_0x58de('0x87')](_0x33db34[_0x58de('0x3f')][_0x58de('0x86')])?_0x33db34[_0x58de('0x3f')][_0x58de('0x86')]:new Array(_0x33db34[_0x58de('0x3f')]['tag']);_0x4b7696['forEach'](function(_0x5ef403){_0x5c1141['or'](_0x58de('0x73'),'%,'+_0x5ef403+',%');});}if(_0x33db34[_0x58de('0x3f')]['filter']){var _0x3e16ab=_0x33db34[_0x58de('0x3f')][_0x58de('0x88')][_0x58de('0x89')]('\x5c','\x5c\x5c')[_0x58de('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3e16ab)){_0x48a9f['or'](_0x58de('0x8a'),_0x3e16ab+'%')['or'](_0x58de('0x8b'),_0x3e16ab+'%');}_0x48a9f['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e16ab+'%');}}_0x1075ff[_0x58de('0x4a')](_0x48a9f);_0x1075ff[_0x58de('0x8c')]('i.id');var _0x29af98={'type':db[_0x58de('0x8d')][_0x58de('0x8e')][_0x58de('0x8f')],'raw':!![]};var _0x3e78da=_0x1075ff['clone']();_0x3e78da[_0x58de('0x4d')]('i.id');_0x3e78da[_0x58de('0x4d')](_0x58de('0x90'),_0x58de('0x66'));if(_0x61da81[_0x58de('0x48')]){_0x61da81[_0x58de('0x48')]['forEach'](function(_0x4412ff){var _0x3df38b=_0x4412ff[0x0]==='contactName'?_0x4412ff[0x0]:'i.'+_0x4412ff[0x0];_0x1075ff[_0x58de('0x48')](_0x3df38b,_0x4412ff[0x1]===_0x58de('0x91')?![]:!![]);});}if(!_[_0x58de('0x92')](_0x4b7696)){_0x1075ff[_0x58de('0x69')](_0x5c1141);_0x3e78da[_0x58de('0x4a')]('t.id\x20IN\x20?',_0x4b7696);}BPromise[_0x58de('0x93')]()[_0x58de('0x28')](function(){if(!_0x5d1c19){if(_0x33db34['query'][_0x58de('0x94')])return;_0x3e78da['where'](_0x58de('0x95'));_0x1075ff[_0x58de('0x4a')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x33db34[_0x58de('0x96')][_0x58de('0x97')]!==_0x58de('0x98'))return;return _0x33db34[_0x58de('0x96')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x58de('0x28')](function(_0x39ca04){if(_['isEmpty'](_0x39ca04)){_0x3e78da[_0x58de('0x4a')](_0x58de('0x99'));_0x1075ff[_0x58de('0x4a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x3e78da[_0x58de('0x4a')](_0x58de('0x7a'),_[_0x58de('0x2d')](_0x39ca04,'id'));_0x1075ff[_0x58de('0x4a')](_0x58de('0x7a'),_[_0x58de('0x2d')](_0x39ca04,'id'));}});})[_0x58de('0x28')](function(){if(_0x33db34[_0x58de('0x96')]['role']==='agent'&&!_0x5d1c19&&!_0x33db34[_0x58de('0x3f')][_0x58de('0x94')])return[];return db['sequelize']['query'](_0x3e78da[_0x58de('0x9a')](),_0x29af98);})[_0x58de('0x28')](function(_0x29bfc9){_0x52e1fb[_0x58de('0x22')]=_0x29bfc9['length'];if(_0x52e1fb['count']===0x0)return[];return db[_0x58de('0x9b')][_0x58de('0x3f')](_0x148df0[_0x58de('0x9a')](),_0x29af98)[_0x58de('0x28')](function(_0x188b37){_0x5e167c=_[_0x58de('0x9c')](_0x188b37,'id');_0x29af98=_[_0x58de('0x9d')](_0x29af98,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x33db34[_0x58de('0x3f')][_0x58de('0x44')]){_0x61da81[_0x58de('0x43')]['forEach'](function(_0x4f0e44){_0x1075ff['field']('i.'+_0x4f0e44);});}else{_0x1075ff[_0x58de('0x4d')](_0x58de('0x90'),'unreadMessages');_0x1075ff[_0x58de('0x4d')](_0x58de('0x9e'),_0x58de('0x9f'));_0x1075ff['field']('a.mandatoryDisposition',_0x58de('0xa0'));_0x1075ff[_0x58de('0x4d')]('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');_0x1075ff[_0x58de('0x4d')](_0x58de('0xa1'));_0x1075ff['field']('c.firstName',_0x58de('0xa2'));_0x1075ff[_0x58de('0x4d')](_0x58de('0xa3'),_0x58de('0xa4'));_0x1075ff[_0x58de('0x4d')]('c.email',_0x58de('0xa5'));_0x1075ff[_0x58de('0x4d')](_0x58de('0xa6'),_0x58de('0xa7'));_0x1075ff[_0x58de('0x4d')](_0x58de('0xa8'),_0x58de('0xa9'));_0x1075ff[_0x58de('0x4d')](_0x58de('0xaa'),_0x58de('0xab'));_0x1075ff[_0x58de('0x4d')](_0x58de('0xac'),'Owner.fullname');_0x1075ff['field']('o.internal','Owner.internal');_0x1075ff[_0x58de('0x4d')](_0x58de('0xad'),'TagIds');}if(_0x61da81['limit'])_0x1075ff[_0x58de('0x21')](_0x61da81[_0x58de('0x21')]);if(_0x61da81[_0x58de('0x1f')])_0x1075ff['offset'](_0x61da81[_0x58de('0x1f')]);return db['sequelize']['query'](_0x1075ff[_0x58de('0x9a')](),_0x29af98);})['then'](function(_0x8ad673){if(_0x8ad673['length']>0x0)_0x42693c[_0x58de('0x4a')](_0x58de('0xae'),_[_0x58de('0x2d')](_0x8ad673,'id'));return db[_0x58de('0x9b')][_0x58de('0x3f')](_0x42693c[_0x58de('0x9a')](),_0x29af98)['then'](function(_0x2d17a8){var _0x5f0a34=_[_0x58de('0xaf')](_0x2d17a8,_0x58de('0xb0'));var _0x241cbc=[];_0x8ad673[_0x58de('0x72')](function(_0xcb5f67){_0x241cbc['push'](updateFaxInteraction(_0xcb5f67,_0x5e167c,_0x5f0a34));});return BPromise[_0x58de('0xb1')](_0x241cbc);});});})['then'](function(_0x4eb7db){_0x52e1fb[_0x58de('0xb2')]=_0x4eb7db;return _0x52e1fb;})[_0x58de('0x28')](respondWithFilteredResult(_0x347bc5,_0x61da81))['catch'](handleError(_0x347bc5,null));};exports[_0x58de('0xb3')]=function(_0x43b3c6,_0x55f717){var _0x4ff2d={'raw':![],'where':{'id':_0x43b3c6[_0x58de('0xb4')]['id']}},_0x251d89={};_0x251d89[_0x58de('0x3e')]=_['keys'](db[_0x58de('0xb5')]['rawAttributes']);_0x251d89[_0x58de('0x3f')]=_[_0x58de('0x40')](_0x43b3c6[_0x58de('0x3f')]);_0x251d89[_0x58de('0x41')]=_[_0x58de('0x42')](_0x251d89[_0x58de('0x3e')],_0x251d89['query']);_0x4ff2d['attributes']=_[_0x58de('0x42')](_0x251d89[_0x58de('0x3e')],qs[_0x58de('0x44')](_0x43b3c6[_0x58de('0x3f')][_0x58de('0x44')]));_0x4ff2d[_0x58de('0x43')]=_0x4ff2d[_0x58de('0x43')][_0x58de('0x45')]?_0x4ff2d['attributes']:_0x251d89['model'];if(_0x43b3c6[_0x58de('0x3f')][_0x58de('0xb6')]){_0x4ff2d[_0x58de('0xb7')]=[{'all':!![]}];}_0x4ff2d=_['merge']({},_0x4ff2d,_0x43b3c6['options']);return db[_0x58de('0xb5')][_0x58de('0x65')](_0x4ff2d)[_0x58de('0x28')](handleEntityNotFound(_0x55f717,null))[_0x58de('0x28')](respondWithResult(_0x55f717,null))[_0x58de('0x33')](handleError(_0x55f717,null));};exports[_0x58de('0xb8')]=function(_0x535421,_0x4454ae){return db[_0x58de('0xb5')][_0x58de('0xb8')](_0x535421[_0x58de('0x77')],{})[_0x58de('0x28')](respondWithResult(_0x4454ae,0xc9))['catch'](handleError(_0x4454ae,null));};exports[_0x58de('0x26')]=function(_0x1d5462,_0x296949){if(_0x1d5462[_0x58de('0x77')]['id']){delete _0x1d5462[_0x58de('0x77')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x1d5462[_0x58de('0xb4')]['id']}})[_0x58de('0x28')](handleEntityNotFound(_0x296949,null))[_0x58de('0x28')](saveUpdates(_0x1d5462[_0x58de('0x77')],null))[_0x58de('0x28')](respondWithResult(_0x296949,null))['catch'](handleError(_0x296949,null));};exports[_0x58de('0x27')]=function(_0x37fd1,_0x1ff990){return db['FaxInteraction'][_0x58de('0x65')]({'where':{'id':_0x37fd1[_0x58de('0xb4')]['id']}})[_0x58de('0x28')](handleEntityNotFound(_0x1ff990,null))[_0x58de('0x28')](removeEntity(_0x1ff990,null))[_0x58de('0x33')](handleError(_0x1ff990,null));};exports['describe']=function(_0x1cf798,_0xc64639){return db[_0x58de('0xb5')][_0x58de('0xb9')]()[_0x58de('0x28')](respondWithResult(_0xc64639,null))[_0x58de('0x33')](handleError(_0xc64639,null));};exports[_0x58de('0xba')]=function(_0x2feb15,_0x266dcc,_0x11449a){return db[_0x58de('0xbb')][_0x58de('0x65')]({'where':{'id':_0x2feb15[_0x58de('0xb4')]['id']}})[_0x58de('0x28')](handleEntityNotFound(_0x266dcc,null))[_0x58de('0x28')](function(_0x2a89e4){if(_0x2a89e4){return _0x2a89e4[_0x58de('0xba')](_0x2feb15[_0x58de('0x77')][_0x58de('0xbc')],_[_0x58de('0xbd')](_0x2feb15[_0x58de('0x77')],[_0x58de('0xbc'),'id'])||{});}})[_0x58de('0x28')](respondWithResult(_0x266dcc,null))['catch'](handleError(_0x266dcc,null));};exports[_0x58de('0xbe')]=function(_0xa96cf3,_0x166629,_0x227ff5){var _0x125fe3={'raw':![],'where':{}};var _0x34c3bc={};var _0x391ec1={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x58de('0xbf')]({'where':{'id':_0xa96cf3[_0x58de('0xb4')]['id']}})[_0x58de('0x28')](handleEntityNotFound(_0x166629,null))[_0x58de('0x28')](function(_0x118dbb){if(_0x118dbb){_0x34c3bc['model']=_[_0x58de('0x40')](db[_0x58de('0xbb')][_0x58de('0x3b')]);_0x34c3bc[_0x58de('0x3f')]=_[_0x58de('0x40')](_0xa96cf3[_0x58de('0x3f')]);_0x34c3bc[_0x58de('0x41')]=_[_0x58de('0x42')](_0x34c3bc[_0x58de('0x3e')],_0x34c3bc[_0x58de('0x3f')]);_0x125fe3[_0x58de('0x43')]=_[_0x58de('0x42')](_0x34c3bc[_0x58de('0x3e')],qs[_0x58de('0x44')](_0xa96cf3[_0x58de('0x3f')]['fields']));_0x125fe3[_0x58de('0x43')]=_0x125fe3[_0x58de('0x43')][_0x58de('0x45')]?_0x125fe3[_0x58de('0x43')]:_0x34c3bc['model'];if(!_0xa96cf3['query']['hasOwnProperty']('nolimit')){_0x125fe3[_0x58de('0x21')]=qs['limit'](_0xa96cf3['query'][_0x58de('0x21')]);_0x125fe3[_0x58de('0x1f')]=qs[_0x58de('0x1f')](_0xa96cf3[_0x58de('0x3f')]['offset']);}_0x125fe3[_0x58de('0x48')]=qs[_0x58de('0x49')](_0xa96cf3['query']['sort']);_0x125fe3[_0x58de('0x4a')]=qs[_0x58de('0x41')](_[_0x58de('0x4b')](_0xa96cf3[_0x58de('0x3f')],_0x34c3bc['filters']));_0x125fe3[_0x58de('0x4a')][_0x58de('0xb0')]=_0x118dbb['id'];if(_0xa96cf3['query']['filter']){_0x125fe3[_0x58de('0x4a')]=_['merge'](_0x125fe3[_0x58de('0x4a')],{'$or':_['map'](_0x125fe3[_0x58de('0x43')],function(_0x4215ff){var _0xb580={};_0xb580[_0x4215ff]={'$like':'%'+_0xa96cf3[_0x58de('0x3f')]['filter']+'%'};return _0xb580;})});}if(_0xa96cf3[_0x58de('0x3f')][_0x58de('0x7e')]){var _0x123e09=_0xa96cf3[_0x58de('0x3f')]['$gte'][_0x58de('0x31')](',');var _0x4f8861={};_0x4f8861[_0x123e09[0x0]]={'$gte':moment(_0x123e09[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x125fe3[_0x58de('0x4a')]=_['merge'](_0x125fe3[_0x58de('0x4a')],_0x4f8861);}_0x125fe3=_['merge']({},_0x125fe3,_0xa96cf3['options']);return db[_0x58de('0xbb')][_0x58de('0x22')]({'where':_0x125fe3[_0x58de('0x4a')]})[_0x58de('0x28')](function(_0xca8cd7){_0x391ec1[_0x58de('0x22')]=_0xca8cd7;if(_0xa96cf3[_0x58de('0x3f')][_0x58de('0xb6')]){_0x125fe3[_0x58de('0xb7')]=[{'all':!![]}];}return db[_0x58de('0xbb')]['findAll'](_0x125fe3);})[_0x58de('0x28')](function(_0x41987){_0x391ec1['rows']=_0x41987;return _0x391ec1;});}})[_0x58de('0x28')](respondWithFilteredResult(_0x166629,_0x125fe3))[_0x58de('0x33')](handleError(_0x166629,null));};exports['addTags']=function(_0x98787a,_0x24edaa,_0x54da7c){return db[_0x58de('0xb5')][_0x58de('0x65')]({'where':{'id':_0x98787a[_0x58de('0xb4')]['id']}})[_0x58de('0x28')](handleEntityNotFound(_0x24edaa,null))[_0x58de('0x28')](function(_0x204d72){if(_0x204d72){return _0x204d72['setTags'](_0x98787a['body'][_0x58de('0xbc')],_['omit'](_0x98787a[_0x58de('0x77')],[_0x58de('0xbc'),'id'])||{})[_0x58de('0xc0')](function(){return db[_0x58de('0x71')]['findAll']({'attributes':['id',_0x58de('0x2b'),_0x58de('0x4e')],'where':{'id':_0x98787a['body'][_0x58de('0xbc')]}});})[_0x58de('0x28')](function(_0x2d0067){socket[_0x58de('0xc1')](_0x58de('0xc2'),{'id':Number(_0x98787a[_0x58de('0xb4')]['id']),'tags':_0x2d0067||[]});return{'id':Number(_0x98787a[_0x58de('0xb4')]['id']),'tags':_0x2d0067||[]};});}})[_0x58de('0x28')](respondWithResult(_0x24edaa,null))[_0x58de('0x33')](handleError(_0x24edaa,null));};exports[_0x58de('0xc3')]=function(_0x5e7ff1,_0x10ba55,_0x5049ad){return db[_0x58de('0xb5')][_0x58de('0x65')]({'where':{'id':_0x5e7ff1['params']['id']}})['then'](handleEntityNotFound(_0x10ba55,null))[_0x58de('0x28')](function(_0x135d29){if(_0x135d29){return _0x135d29[_0x58de('0xc3')](_0x5e7ff1[_0x58de('0x3f')][_0x58de('0xbc')]);}})[_0x58de('0x28')](respondWithStatusCode(_0x10ba55,null))[_0x58de('0x33')](handleError(_0x10ba55,null));};exports[_0x58de('0xc4')]=function(_0x3d2479,_0x4592d3){var _0x3d78fc=moment()['unix']()[_0x58de('0x9a')]();var _0x5439a9=path[_0x58de('0xc5')](config[_0x58de('0xc6')],_0x58de('0xc7'),'files',_0x58de('0xc8'));var _0x580d68=path['join'](config[_0x58de('0xc6')],'server',_0x58de('0xc9'),_0x58de('0xca'));var _0x4708de=path['join'](_0x5439a9,_0x3d78fc);var _0x519c28=util['format'](_0x58de('0xcb'),_0x3d2479['params']['id'],_0x3d78fc);var _0xf68ca1=path['join'](_0x5439a9,_0x519c28);var _0x2f19c7=[];_0x2f19c7['push']({'model':db[_0x58de('0xcc')],'as':_0x58de('0xcc'),'raw':!![]});var _0x1dddb5=[{'model':db[_0x58de('0xbb')],'as':_0x58de('0xcd'),'attributes':['id','body',_0x58de('0x7c')],'include':_0x2f19c7}];return db[_0x58de('0xb5')]['find']({'where':{'id':_0x3d2479[_0x58de('0xb4')]['id']},'include':_0x1dddb5})[_0x58de('0x28')](handleEntityNotFound(_0x4592d3,null))['then'](function(_0x883ef6){if(_0x883ef6&&_0x883ef6[_0x58de('0xcd')]){var _0x26cea=_0x883ef6[_0x58de('0xce')]({'plain':!![]});fs[_0x58de('0xcf')](_0x4708de);for(var _0x5d3613=0x0;_0x5d3613<_0x26cea['Messages'][_0x58de('0x45')];_0x5d3613++){var _0x441b90=_0x26cea[_0x58de('0xcd')][_0x5d3613][_0x58de('0xcc')];if(_0x441b90){var _0x287d48=path[_0x58de('0xc5')](_0x580d68,_0x441b90['basename']);if(fs[_0x58de('0xd0')](_0x287d48)){fs[_0x58de('0xd1')](_0x287d48)[_0x58de('0xd2')](fs[_0x58de('0xd3')](path[_0x58de('0xc5')](_0x4708de,_0x441b90[_0x58de('0xd4')])));}}}return BPromise[_0x58de('0x93')]()[_0x58de('0x28')](function(){return new BPromise(function(_0x4297d0,_0x57b2d0){zipdir(_0x4708de,{'saveTo':_0xf68ca1},function(_0x476ee0,_0xf68a87){if(_0x476ee0)return _0x57b2d0(_0x476ee0);return _0x4297d0(_0xf68a87);});})['then'](function(){return new BPromise(function(_0x160f19,_0x4a2fc8){rimraf(_0x4708de,function(_0x1cc908){if(_0x1cc908)_0x4a2fc8(_0x1cc908);return _0x160f19();});});})[_0x58de('0x28')](function(){return _0x4592d3['download'](_0xf68ca1,_0x519c28,function(_0x54e073){if(_0x54e073){console[_0x58de('0xd5')](_0x58de('0xd6'),_0x54e073);}else{fs[_0x58de('0xd7')](_0xf68ca1);}});});});}else{return _0x4592d3[_0x58de('0x1b')](0xc8);}})[_0x58de('0x33')](handleError(_0x4592d3,null));}; \ No newline at end of file +var _0xcc89=['send','map','fullname','TagIds','Tags','split','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','select','field','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','show','create','params','describe','addMessage','FaxMessage','ids','omit','getMessages','merge','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','findAll','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','Attachment','Messages','get','mkdirSync','basename','existsSync','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name'];(function(_0x5685ea,_0x159f11){var _0x1f7d47=function(_0x5037ed){while(--_0x5037ed){_0x5685ea['push'](_0x5685ea['shift']());}};_0x1f7d47(++_0x159f11);}(_0xcc89,0x195));var _0x9cc8=function(_0x1faa8f,_0x30b5e1){_0x1faa8f=_0x1faa8f-0x0;var _0x2209da=_0xcc89[_0x1faa8f];return _0x2209da;};'use strict';var emlformat=require(_0x9cc8('0x0'));var rimraf=require(_0x9cc8('0x1'));var zipdir=require(_0x9cc8('0x2'));var jsonpatch=require(_0x9cc8('0x3'));var rp=require(_0x9cc8('0x4'));var moment=require(_0x9cc8('0x5'));var BPromise=require(_0x9cc8('0x6'));var Mustache=require(_0x9cc8('0x7'));var util=require(_0x9cc8('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9cc8('0x9'));var fs=require('fs');var fs_extra=require(_0x9cc8('0xa'));var _=require(_0x9cc8('0xb'));var squel=require(_0x9cc8('0xc'));var crypto=require(_0x9cc8('0xd'));var jsforce=require(_0x9cc8('0xe'));var deskjs=require(_0x9cc8('0xf'));var toCsv=require(_0x9cc8('0x10'));var querystring=require('querystring');var Papa=require(_0x9cc8('0x11'));var Redis=require('ioredis');var authService=require(_0x9cc8('0x12'));var qs=require(_0x9cc8('0x13'));var as=require(_0x9cc8('0x14'));var hardwareService=require(_0x9cc8('0x15'));var logger=require(_0x9cc8('0x16'))(_0x9cc8('0x17'));var utils=require(_0x9cc8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9cc8('0x19'));var db=require(_0x9cc8('0x1a'))['db'];config[_0x9cc8('0x1b')]=_[_0x9cc8('0x1c')](config[_0x9cc8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9cc8('0x1d'))(new Redis(config[_0x9cc8('0x1b')]));require('./faxInteraction.socket')[_0x9cc8('0x1e')](socket);function respondWithStatusCode(_0x28a311,_0x93756a){_0x93756a=_0x93756a||0xcc;return function(_0x56d7e6){if(_0x56d7e6){return _0x28a311['sendStatus'](_0x93756a);}return _0x28a311['status'](_0x93756a)[_0x9cc8('0x1f')]();};}function respondWithResult(_0x40fdc4,_0x485339){_0x485339=_0x485339||0xc8;return function(_0x11a931){if(_0x11a931){return _0x40fdc4[_0x9cc8('0x20')](_0x485339)[_0x9cc8('0x21')](_0x11a931);}};}function respondWithFilteredResult(_0x3491f8,_0x18c4cf){return function(_0x3e34d9){if(_0x3e34d9){var _0x386fad=typeof _0x18c4cf[_0x9cc8('0x22')]===_0x9cc8('0x23')&&typeof _0x18c4cf['limit']===_0x9cc8('0x23');var _0x47b1dc=_0x3e34d9[_0x9cc8('0x24')];var _0x5bf2e5=_0x386fad?0x0:_0x18c4cf[_0x9cc8('0x22')];var _0x41b633=_0x386fad?_0x3e34d9['count']:_0x18c4cf[_0x9cc8('0x22')]+_0x18c4cf[_0x9cc8('0x25')];var _0x291772;if(_0x41b633>=_0x47b1dc){_0x41b633=_0x47b1dc;_0x291772=0xc8;}else{_0x291772=0xce;}_0x3491f8['status'](_0x291772);return _0x3491f8['set'](_0x9cc8('0x26'),_0x5bf2e5+'-'+_0x41b633+'/'+_0x47b1dc)[_0x9cc8('0x21')](_0x3e34d9);}return null;};}function patchUpdates(_0x3ff2c0){return function(_0x27d606){try{jsonpatch['apply'](_0x27d606,_0x3ff2c0,!![]);}catch(_0x2bd9ae){return BPromise[_0x9cc8('0x27')](_0x2bd9ae);}return _0x27d606[_0x9cc8('0x28')]();};}function saveUpdates(_0x11aa73,_0xb363d9){return function(_0x2380de){if(_0x2380de){return _0x2380de[_0x9cc8('0x29')](_0x11aa73)[_0x9cc8('0x2a')](function(_0x428682){return _0x428682;});}return null;};}function removeEntity(_0x591b54,_0x27fb4f){return function(_0x2bfbb6){if(_0x2bfbb6){return _0x2bfbb6[_0x9cc8('0x2b')]()[_0x9cc8('0x2a')](function(){_0x591b54[_0x9cc8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5d68,_0x5092bf){return function(_0x4d8862){if(!_0x4d8862){_0x2c5d68[_0x9cc8('0x2c')](0x194);}return _0x4d8862;};}function handleError(_0xac74d9,_0x51eb6f){_0x51eb6f=_0x51eb6f||0x1f4;return function(_0x1e8163){logger['error'](_0x1e8163[_0x9cc8('0x2d')]);if(_0x1e8163['name']){delete _0x1e8163[_0x9cc8('0x2e')];}_0xac74d9[_0x9cc8('0x20')](_0x51eb6f)[_0x9cc8('0x2f')](_0x1e8163);};}function getInteractionUsers(_0x23394e,_0x26bb05){return new BPromise(function(_0x146c5d,_0x590962){try{if(_0x26bb05[_0x23394e['id']]){_0x23394e['Users']=_[_0x9cc8('0x30')](_0x26bb05[_0x23394e['id']],function(_0x5bba86){return{'id':_0x5bba86['id'],'fullname':_0x5bba86[_0x9cc8('0x31')]};});}}catch(_0x399f94){_0x590962(_0x399f94);}_0x146c5d(_0x23394e);});}function getInteractionTags(_0x220005,_0x3197de){return new BPromise(function(_0x480d4e,_0x2302d6){try{if(_0x220005[_0x9cc8('0x32')]){_0x220005[_0x9cc8('0x33')]=[];_0x220005[_0x9cc8('0x32')][_0x9cc8('0x34')](',')['forEach'](function(_0x4c68ad){_0x220005[_0x9cc8('0x33')][_0x9cc8('0x35')](_0x3197de[_0x4c68ad]);});}delete _0x220005['TagIds'];}catch(_0x6f6259){_0x2302d6(_0x6f6259);}_0x480d4e(_0x220005);});}function updateFaxInteraction(_0x1fc564,_0x329792,_0x15e232){return new BPromise(function(_0x397870,_0x1022d5){return getInteractionUsers(_0x1fc564,_0x15e232)[_0x9cc8('0x2a')](function(_0x5b3425){return getInteractionTags(_0x5b3425,_0x329792);})[_0x9cc8('0x2a')](function(_0x57f06c){return getStateInteraction(_0x57f06c);})[_0x9cc8('0x2a')](function(_0x55949f){_0x397870(_0x55949f);})[_0x9cc8('0x36')](function(_0x348be5){_0x1022d5(_0x348be5);});});}function getStateInteraction(_0x1dbd6d){return new BPromise(function(_0x815914){_0x1dbd6d[_0x9cc8('0x37')]=0x0;_0x1dbd6d[_0x9cc8('0x38')]=0x0;_0x1dbd6d[_0x9cc8('0x39')]=0x0;_0x1dbd6d[_0x9cc8('0x3a')]=0x0;_0x1dbd6d[_0x9cc8('0x3b')]=0x0;if(!_0x1dbd6d[_0x9cc8('0x3c')]&&!_0x1dbd6d['UserId']){_0x1dbd6d[_0x9cc8('0x37')]+=0x1;}if(!_0x1dbd6d[_0x9cc8('0x3c')]&&_0x1dbd6d['UserId']){_0x1dbd6d['talking']+=0x1;if(_0x1dbd6d[_0x9cc8('0x37')]){_0x1dbd6d[_0x9cc8('0x37')]-=0x1;}}if(_0x1dbd6d[_0x9cc8('0x3c')]&&_0x1dbd6d[_0x9cc8('0x3d')]){_0x1dbd6d[_0x9cc8('0x39')]+=0x1;if(_0x1dbd6d['talking']){_0x1dbd6d['talking']-=0x1;}}if(_0x1dbd6d[_0x9cc8('0x3c')]&&!_0x1dbd6d[_0x9cc8('0x3d')]){_0x1dbd6d[_0x9cc8('0x3a')]+=0x1;if(_0x1dbd6d[_0x9cc8('0x37')]){_0x1dbd6d['waiting']-=0x1;}}_0x1dbd6d[_0x9cc8('0x3b')]+=0x1;_0x815914(_0x1dbd6d);});}exports[_0x9cc8('0x3e')]=function(_0x5129c9,_0x3a6217){var _0x477c89={},_0x5ce92c={},_0x53dfe4={'count':0x0,'rows':[]};var _0x3c331c=_[_0x9cc8('0x30')](db[_0x9cc8('0x3f')][_0x9cc8('0x40')],function(_0x2e4995){return{'name':_0x2e4995[_0x9cc8('0x41')],'type':_0x2e4995[_0x9cc8('0x42')][_0x9cc8('0x43')]};});_0x5ce92c[_0x9cc8('0x44')]=_[_0x9cc8('0x30')](_0x3c331c,_0x9cc8('0x2e'));_0x5ce92c[_0x9cc8('0x45')]=_[_0x9cc8('0x46')](_0x5129c9['query']);_0x5ce92c[_0x9cc8('0x47')]=_['intersection'](_0x5ce92c[_0x9cc8('0x44')],_0x5ce92c[_0x9cc8('0x45')]);_0x477c89[_0x9cc8('0x48')]=_[_0x9cc8('0x49')](_0x5ce92c['model'],qs[_0x9cc8('0x4a')](_0x5129c9['query'][_0x9cc8('0x4a')]));_0x477c89[_0x9cc8('0x48')]=_0x477c89[_0x9cc8('0x48')][_0x9cc8('0x4b')]?_0x477c89[_0x9cc8('0x48')]:_0x5ce92c[_0x9cc8('0x44')];if(!_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x4c')](_0x9cc8('0x4d'))){_0x477c89['limit']=qs[_0x9cc8('0x25')](_0x5129c9['query']['limit']);_0x477c89['offset']=qs[_0x9cc8('0x22')](_0x5129c9['query'][_0x9cc8('0x22')]);}_0x477c89['order']=qs[_0x9cc8('0x4e')](_0x5129c9['query'][_0x9cc8('0x4e')]);_0x477c89['where']=qs[_0x9cc8('0x47')](_[_0x9cc8('0x4f')](_0x5129c9[_0x9cc8('0x45')],_0x5ce92c[_0x9cc8('0x47')]),_0x3c331c);var _0xefd4b1=[];var _0x16b0c3=squel[_0x9cc8('0x50')]()[_0x9cc8('0x51')]('id')[_0x9cc8('0x51')]('name')[_0x9cc8('0x51')]('color')['from'](_0x9cc8('0x52'));var _0x51b07e=squel[_0x9cc8('0x50')]()[_0x9cc8('0x51')](_0x9cc8('0x53'))[_0x9cc8('0x51')](_0x9cc8('0x54'))[_0x9cc8('0x51')](_0x9cc8('0x55'))[_0x9cc8('0x56')]('user_has_fax_interactions','ui')[_0x9cc8('0x57')]('users','u',_0x9cc8('0x58'));var _0x537551=squel[_0x9cc8('0x50')]()[_0x9cc8('0x56')](_0x9cc8('0x59'),'i')['left_join'](_0x9cc8('0x5a'),'c',_0x9cc8('0x5b'))[_0x9cc8('0x57')](_0x9cc8('0x5c'),'o',_0x9cc8('0x5d'))[_0x9cc8('0x57')](_0x9cc8('0x5e'),'a',_0x9cc8('0x5f'))[_0x9cc8('0x57')](_0x9cc8('0x60'),'me',_0x9cc8('0x61'))[_0x9cc8('0x57')](_0x9cc8('0x62'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x9cc8('0x57')]('tools_tags','t',_0x9cc8('0x63'));var _0x2d0356=squel[_0x9cc8('0x64')]();var _0x5defa1=[];var _0x261552=squel[_0x9cc8('0x64')]();var _0xf30414;if(_0x5129c9['query'][_0x9cc8('0x65')]){_0xf30414=as[_0x9cc8('0x66')](_0x5129c9[_0x9cc8('0x45')]['search']);var _0x58612a=_0xf30414[_0x9cc8('0x67')];for(var _0x4cb559=0x0;_0x4cb559<_0xf30414[_0x9cc8('0x68')][_0x9cc8('0x4b')];_0x4cb559++){var _0x18a81b=_0xf30414['conditions'][_0x4cb559];var _0x36cfab='i';var _0x2b6bf8=_[_0x9cc8('0x69')](_0x3c331c,['name',_0x18a81b[_0x9cc8('0x51')]]);if(!_0x2b6bf8){switch(_0x18a81b[_0x9cc8('0x51')]){case _0x9cc8('0x6a'):if(_0x18a81b[_0x9cc8('0x6b')]==0x1){_0x537551[_0x9cc8('0x6c')]('`'+_0x18a81b[_0x9cc8('0x51')]+_0x9cc8('0x6d'));}else{_0x537551['having']('`'+_0x18a81b[_0x9cc8('0x51')]+_0x9cc8('0x6e'));}break;case _0x9cc8('0x6f'):if(_0x18a81b[_0x9cc8('0x70')]==='$substring'){if(_0x18a81b['value']['split']('\x20')[_0x9cc8('0x4b')]>0x1){_0x2d0356[_0x58612a](_0x9cc8('0x71'),qs[_0x9cc8('0x72')](_0x18a81b[_0x9cc8('0x6b')]),null);}else{var _0x390cd0='%'+_0x18a81b['value']+'%';_0x2d0356[_0x58612a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x390cd0,_0x390cd0,_0x390cd0);}}else{_0x2b6bf8=_[_0x9cc8('0x69')](_0x3c331c,[_0x9cc8('0x2e'),_0x9cc8('0x73')]);_0x18a81b[_0x9cc8('0x51')]='ContactId';_0x458852=as[_0x9cc8('0x74')](_0x36cfab,_0x2b6bf8[_0x9cc8('0x42')],_0x18a81b);_0x2d0356[_0x58612a](_0x458852[_0x9cc8('0x75')],_0x458852['value']['start'],_0x458852[_0x9cc8('0x6b')]['end']);}break;case _0x9cc8('0x76'):var _0x38f589=_0x18a81b[_0x9cc8('0x6b')]['split'](',')[_0x9cc8('0x30')](function(_0x57f5d4){return Number(_0x57f5d4);});_0x38f589[_0x9cc8('0x77')](function(_0x3a6ee8){_0x261552['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a6ee8+',%');});_0x5defa1=_[_0x9cc8('0x78')](_0x5defa1,_0x38f589);break;case _0x9cc8('0x79'):if(_0x18a81b['operator']===_0x9cc8('0x7a')){_0x2d0356[_0x58612a](_0x9cc8('0x7b'),'%'+_0x18a81b[_0x9cc8('0x6b')]+'%',null);}else{_0x2b6bf8=_[_0x9cc8('0x69')](_0x3c331c,[_0x9cc8('0x2e'),'UserId']);_0x18a81b['field']=_0x9cc8('0x3d');_0x458852=as[_0x9cc8('0x74')](_0x36cfab,_0x2b6bf8[_0x9cc8('0x42')],_0x18a81b);_0x2d0356[_0x58612a](_0x458852['text'],_0x458852['value'][_0x9cc8('0x7c')],_0x458852[_0x9cc8('0x6b')][_0x9cc8('0x1f')]);}break;case _0x9cc8('0x7d'):_0x458852=as[_0x9cc8('0x74')]('me',null,_0x18a81b);_0x2d0356[_0x58612a](_0x458852[_0x9cc8('0x75')],_0x458852['value']['start'],_0x458852[_0x9cc8('0x6b')][_0x9cc8('0x1f')]);break;}}else{var _0x458852=as[_0x9cc8('0x74')](_0x36cfab,_0x2b6bf8[_0x9cc8('0x42')],_0x18a81b);_0x2d0356[_0x58612a](_0x458852['text'],_0x458852[_0x9cc8('0x6b')][_0x9cc8('0x7c')],_0x458852[_0x9cc8('0x6b')][_0x9cc8('0x1f')]);}}}else{var _0x3b515a=_(_0x5129c9[_0x9cc8('0x45')])[_0x9cc8('0x46')]()['map'](function(_0x4a6c11){return _[_0x9cc8('0x7e')](_0x3c331c,[_0x9cc8('0x2e'),_0x4a6c11])?_0x4a6c11:undefined;})[_0x9cc8('0x7f')]()[_0x9cc8('0x6b')]();if(!_['isEmpty'](_0x3b515a)){_0x3b515a[_0x9cc8('0x77')](function(_0xabe0ed){if(_0xabe0ed===_0x9cc8('0x80')){_0x537551[_0x9cc8('0x81')](_0x9cc8('0x82'),[][_0x9cc8('0x83')](_0x5129c9[_0x9cc8('0x45')][_0xabe0ed]));}else if(_0xabe0ed===_0x9cc8('0x84')){var _0x289e9f=JSON[_0x9cc8('0x85')](_0x5129c9['query'][_0xabe0ed])[_0x9cc8('0x86')];var _0xa32a53=JSON[_0x9cc8('0x85')](_0x5129c9[_0x9cc8('0x45')][_0xabe0ed])['$lte'];_0x537551[_0x9cc8('0x81')](_0x9cc8('0x87'),_0x289e9f,_0xa32a53);}else{if(_0x5129c9[_0x9cc8('0x45')][_0xabe0ed]===_0x9cc8('0x88')){_0x537551['where']('i.'+_0xabe0ed+_0x9cc8('0x89'));}else{_0x537551[_0x9cc8('0x81')]('i.'+_0xabe0ed+_0x9cc8('0x8a'),_0x5129c9[_0x9cc8('0x45')][_0xabe0ed]);}}});}if(_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x8b')]){if(_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x8b')]==0x1){_0x537551[_0x9cc8('0x6c')]('`unreadMessages`\x20=\x200');}else{_0x537551[_0x9cc8('0x6c')](_0x9cc8('0x8c'));}}if(_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x8d')]){_0x5defa1=_['isArray'](_0x5129c9[_0x9cc8('0x45')]['tag'])?_0x5129c9[_0x9cc8('0x45')]['tag']:new Array(_0x5129c9['query'][_0x9cc8('0x8d')]);_0x5defa1[_0x9cc8('0x77')](function(_0x58af59){_0x261552['or'](_0x9cc8('0x8e'),'%,'+_0x58af59+',%');});}if(_0x5129c9['query'][_0x9cc8('0x8f')]){var _0x2abde9=_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x9cc8('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2abde9)){_0x2d0356['or'](_0x9cc8('0x91'),_0x2abde9+'%')['or']('i.fax\x20LIKE\x20?',_0x2abde9+'%');}_0x2d0356['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2abde9+'%');}}_0x537551[_0x9cc8('0x81')](_0x2d0356);_0x537551[_0x9cc8('0x92')](_0x9cc8('0x93'));var _0x37764d={'type':db['Sequelize'][_0x9cc8('0x94')][_0x9cc8('0x95')],'raw':!![]};var _0x5830a8=_0x537551[_0x9cc8('0x96')]();_0x5830a8[_0x9cc8('0x51')](_0x9cc8('0x93'));_0x5830a8['field'](_0x9cc8('0x97'),_0x9cc8('0x6a'));if(_0x477c89[_0x9cc8('0x98')]){_0x477c89[_0x9cc8('0x98')][_0x9cc8('0x77')](function(_0x10e94c){var _0x3de0a0=_0x10e94c[0x0]===_0x9cc8('0x99')?_0x10e94c[0x0]:'i.'+_0x10e94c[0x0];_0x537551[_0x9cc8('0x98')](_0x3de0a0,_0x10e94c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9cc8('0x9a')](_0x5defa1)){_0x537551[_0x9cc8('0x6c')](_0x261552);_0x5830a8['where'](_0x9cc8('0x9b'),_0x5defa1);}BPromise[_0x9cc8('0x9c')]()[_0x9cc8('0x2a')](function(){if(!_0xf30414){if(_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x80')])return;_0x5830a8[_0x9cc8('0x81')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x537551[_0x9cc8('0x81')](_0x9cc8('0x9d'));return;}if(_0x5129c9[_0x9cc8('0x9e')][_0x9cc8('0x9f')]!=='agent')return;return _0x5129c9['user'][_0x9cc8('0xa0')]({'attributes':['id'],'raw':!![]})[_0x9cc8('0x2a')](function(_0x587212){if(_['isEmpty'](_0x587212)){_0x5830a8[_0x9cc8('0x81')](_0x9cc8('0xa1'));_0x537551['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x5830a8[_0x9cc8('0x81')](_0x9cc8('0x82'),_[_0x9cc8('0x30')](_0x587212,'id'));_0x537551[_0x9cc8('0x81')](_0x9cc8('0x82'),_['map'](_0x587212,'id'));}});})[_0x9cc8('0x2a')](function(){if(_0x5129c9[_0x9cc8('0x9e')][_0x9cc8('0x9f')]===_0x9cc8('0xa2')&&!_0xf30414&&!_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x80')])return[];return db[_0x9cc8('0xa3')][_0x9cc8('0x45')](_0x5830a8[_0x9cc8('0xa4')](),_0x37764d);})[_0x9cc8('0x2a')](function(_0x4a761c){_0x53dfe4['count']=_0x4a761c[_0x9cc8('0x4b')];if(_0x53dfe4['count']===0x0)return[];return db['sequelize'][_0x9cc8('0x45')](_0x16b0c3['toString'](),_0x37764d)['then'](function(_0x57843f){_0xefd4b1=_[_0x9cc8('0xa5')](_0x57843f,'id');_0x37764d=_['merge'](_0x37764d,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5129c9[_0x9cc8('0x45')][_0x9cc8('0x4a')]){_0x477c89[_0x9cc8('0x48')]['forEach'](function(_0x56b173){_0x537551[_0x9cc8('0x51')]('i.'+_0x56b173);});}else{_0x537551[_0x9cc8('0x51')](_0x9cc8('0x97'),_0x9cc8('0x6a'));_0x537551[_0x9cc8('0x51')]('a.key',_0x9cc8('0xa6'));_0x537551[_0x9cc8('0x51')](_0x9cc8('0xa7'),_0x9cc8('0xa8'));_0x537551['field'](_0x9cc8('0xa9'),'contactName');_0x537551['field'](_0x9cc8('0xaa'));_0x537551['field'](_0x9cc8('0xab'),'Contact.firstName');_0x537551['field'](_0x9cc8('0xac'),'Contact.lastName');_0x537551['field'](_0x9cc8('0xad'),_0x9cc8('0xae'));_0x537551[_0x9cc8('0x51')](_0x9cc8('0xaf'),_0x9cc8('0xb0'));_0x537551[_0x9cc8('0x51')](_0x9cc8('0xb1'),_0x9cc8('0xb2'));_0x537551[_0x9cc8('0x51')](_0x9cc8('0xb3'),'Contact.fax');_0x537551[_0x9cc8('0x51')](_0x9cc8('0xb4'),_0x9cc8('0xb5'));_0x537551['field'](_0x9cc8('0xb6'),_0x9cc8('0xb7'));_0x537551[_0x9cc8('0x51')](_0x9cc8('0xb8'),_0x9cc8('0x32'));}if(_0x477c89[_0x9cc8('0x25')])_0x537551[_0x9cc8('0x25')](_0x477c89[_0x9cc8('0x25')]);if(_0x477c89[_0x9cc8('0x22')])_0x537551[_0x9cc8('0x22')](_0x477c89[_0x9cc8('0x22')]);return db[_0x9cc8('0xa3')]['query'](_0x537551['toString'](),_0x37764d);})[_0x9cc8('0x2a')](function(_0x95e17c){if(_0x95e17c[_0x9cc8('0x4b')]>0x0)_0x51b07e['where'](_0x9cc8('0xb9'),_['map'](_0x95e17c,'id'));return db[_0x9cc8('0xa3')][_0x9cc8('0x45')](_0x51b07e[_0x9cc8('0xa4')](),_0x37764d)['then'](function(_0x216032){var _0x431c76=_['groupBy'](_0x216032,_0x9cc8('0xba'));var _0x560382=[];_0x95e17c[_0x9cc8('0x77')](function(_0x4e8a37){_0x560382[_0x9cc8('0x35')](updateFaxInteraction(_0x4e8a37,_0xefd4b1,_0x431c76));});return BPromise[_0x9cc8('0xbb')](_0x560382);});});})[_0x9cc8('0x2a')](function(_0x2703de){_0x53dfe4['rows']=_0x2703de;return _0x53dfe4;})['then'](respondWithFilteredResult(_0x3a6217,_0x477c89))[_0x9cc8('0x36')](handleError(_0x3a6217,null));};exports[_0x9cc8('0xbc')]=function(_0x89baea,_0x42d297){var _0xb9378d={'raw':![],'where':{'id':_0x89baea['params']['id']}},_0x4134ca={};_0x4134ca[_0x9cc8('0x44')]=_['keys'](db[_0x9cc8('0x3f')][_0x9cc8('0x40')]);_0x4134ca[_0x9cc8('0x45')]=_[_0x9cc8('0x46')](_0x89baea[_0x9cc8('0x45')]);_0x4134ca[_0x9cc8('0x47')]=_[_0x9cc8('0x49')](_0x4134ca['model'],_0x4134ca[_0x9cc8('0x45')]);_0xb9378d[_0x9cc8('0x48')]=_['intersection'](_0x4134ca['model'],qs['fields'](_0x89baea[_0x9cc8('0x45')][_0x9cc8('0x4a')]));_0xb9378d[_0x9cc8('0x48')]=_0xb9378d[_0x9cc8('0x48')][_0x9cc8('0x4b')]?_0xb9378d[_0x9cc8('0x48')]:_0x4134ca[_0x9cc8('0x44')];if(_0x89baea[_0x9cc8('0x45')]['includeAll']){_0xb9378d['include']=[{'all':!![]}];}_0xb9378d=_['merge']({},_0xb9378d,_0x89baea['options']);return db['FaxInteraction'][_0x9cc8('0x69')](_0xb9378d)[_0x9cc8('0x2a')](handleEntityNotFound(_0x42d297,null))['then'](respondWithResult(_0x42d297,null))[_0x9cc8('0x36')](handleError(_0x42d297,null));};exports[_0x9cc8('0xbd')]=function(_0x1533e8,_0x279f9b){return db[_0x9cc8('0x3f')][_0x9cc8('0xbd')](_0x1533e8['body'],{})[_0x9cc8('0x2a')](respondWithResult(_0x279f9b,0xc9))[_0x9cc8('0x36')](handleError(_0x279f9b,null));};exports[_0x9cc8('0x29')]=function(_0x1d24e3,_0x256860){if(_0x1d24e3[_0x9cc8('0x7d')]['id']){delete _0x1d24e3[_0x9cc8('0x7d')]['id'];}return db[_0x9cc8('0x3f')][_0x9cc8('0x69')]({'where':{'id':_0x1d24e3['params']['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x256860,null))[_0x9cc8('0x2a')](saveUpdates(_0x1d24e3['body'],null))[_0x9cc8('0x2a')](respondWithResult(_0x256860,null))[_0x9cc8('0x36')](handleError(_0x256860,null));};exports[_0x9cc8('0x2b')]=function(_0x18ab92,_0x2ea1f8){return db[_0x9cc8('0x3f')][_0x9cc8('0x69')]({'where':{'id':_0x18ab92[_0x9cc8('0xbe')]['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x2ea1f8,null))[_0x9cc8('0x2a')](removeEntity(_0x2ea1f8,null))[_0x9cc8('0x36')](handleError(_0x2ea1f8,null));};exports[_0x9cc8('0xbf')]=function(_0x51d9d7,_0x2ada2f){return db[_0x9cc8('0x3f')][_0x9cc8('0xbf')]()[_0x9cc8('0x2a')](respondWithResult(_0x2ada2f,null))['catch'](handleError(_0x2ada2f,null));};exports[_0x9cc8('0xc0')]=function(_0x3d8ade,_0x5f23a2,_0x3a9060){return db[_0x9cc8('0xc1')][_0x9cc8('0x69')]({'where':{'id':_0x3d8ade['params']['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x5f23a2,null))[_0x9cc8('0x2a')](function(_0x531aea){if(_0x531aea){return _0x531aea[_0x9cc8('0xc0')](_0x3d8ade[_0x9cc8('0x7d')][_0x9cc8('0xc2')],_[_0x9cc8('0xc3')](_0x3d8ade[_0x9cc8('0x7d')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f23a2,null))['catch'](handleError(_0x5f23a2,null));};exports[_0x9cc8('0xc4')]=function(_0x30abd4,_0x41a1f0,_0x1bfe8e){var _0x4cf8a4={'raw':![],'where':{}};var _0x1996a8={};var _0x36aad9={'count':0x0,'rows':[]};return db[_0x9cc8('0x3f')]['findOne']({'where':{'id':_0x30abd4[_0x9cc8('0xbe')]['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x41a1f0,null))[_0x9cc8('0x2a')](function(_0x2243d4){if(_0x2243d4){_0x1996a8[_0x9cc8('0x44')]=_[_0x9cc8('0x46')](db[_0x9cc8('0xc1')][_0x9cc8('0x40')]);_0x1996a8[_0x9cc8('0x45')]=_[_0x9cc8('0x46')](_0x30abd4[_0x9cc8('0x45')]);_0x1996a8['filters']=_[_0x9cc8('0x49')](_0x1996a8['model'],_0x1996a8['query']);_0x4cf8a4['attributes']=_[_0x9cc8('0x49')](_0x1996a8['model'],qs['fields'](_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0x4a')]));_0x4cf8a4[_0x9cc8('0x48')]=_0x4cf8a4[_0x9cc8('0x48')][_0x9cc8('0x4b')]?_0x4cf8a4[_0x9cc8('0x48')]:_0x1996a8['model'];if(!_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0x4c')](_0x9cc8('0x4d'))){_0x4cf8a4[_0x9cc8('0x25')]=qs[_0x9cc8('0x25')](_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0x25')]);_0x4cf8a4[_0x9cc8('0x22')]=qs['offset'](_0x30abd4['query'][_0x9cc8('0x22')]);}_0x4cf8a4[_0x9cc8('0x98')]=qs[_0x9cc8('0x4e')](_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0x4e')]);_0x4cf8a4['where']=qs[_0x9cc8('0x47')](_[_0x9cc8('0x4f')](_0x30abd4[_0x9cc8('0x45')],_0x1996a8[_0x9cc8('0x47')]));_0x4cf8a4[_0x9cc8('0x81')][_0x9cc8('0xba')]=_0x2243d4['id'];if(_0x30abd4['query'][_0x9cc8('0x8f')]){_0x4cf8a4['where']=_[_0x9cc8('0xc5')](_0x4cf8a4[_0x9cc8('0x81')],{'$or':_[_0x9cc8('0x30')](_0x4cf8a4[_0x9cc8('0x48')],function(_0x2f7a1e){var _0x18df23={};_0x18df23[_0x2f7a1e]={'$like':'%'+_0x30abd4['query'][_0x9cc8('0x8f')]+'%'};return _0x18df23;})});}if(_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0x86')]){var _0x2565f8=_0x30abd4['query'][_0x9cc8('0x86')][_0x9cc8('0x34')](',');var _0x50bdb3={};_0x50bdb3[_0x2565f8[0x0]]={'$gte':moment(_0x2565f8[0x1])[_0x9cc8('0xc6')](_0x9cc8('0xc7'))};_0x4cf8a4[_0x9cc8('0x81')]=_[_0x9cc8('0xc5')](_0x4cf8a4[_0x9cc8('0x81')],_0x50bdb3);}_0x4cf8a4=_[_0x9cc8('0xc5')]({},_0x4cf8a4,_0x30abd4[_0x9cc8('0xc8')]);return db[_0x9cc8('0xc1')]['count']({'where':_0x4cf8a4[_0x9cc8('0x81')]})[_0x9cc8('0x2a')](function(_0x3cfb45){_0x36aad9[_0x9cc8('0x24')]=_0x3cfb45;if(_0x30abd4[_0x9cc8('0x45')][_0x9cc8('0xc9')]){_0x4cf8a4[_0x9cc8('0xca')]=[{'all':!![]}];}return db[_0x9cc8('0xc1')][_0x9cc8('0xcb')](_0x4cf8a4);})[_0x9cc8('0x2a')](function(_0x4dd7a6){_0x36aad9[_0x9cc8('0xcc')]=_0x4dd7a6;return _0x36aad9;});}})['then'](respondWithFilteredResult(_0x41a1f0,_0x4cf8a4))[_0x9cc8('0x36')](handleError(_0x41a1f0,null));};exports[_0x9cc8('0xcd')]=function(_0x1bc391,_0x445281,_0x484014){return db[_0x9cc8('0x3f')][_0x9cc8('0x69')]({'where':{'id':_0x1bc391[_0x9cc8('0xbe')]['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x445281,null))[_0x9cc8('0x2a')](function(_0x384f48){if(_0x384f48){return _0x384f48[_0x9cc8('0xce')](_0x1bc391['body']['ids'],_['omit'](_0x1bc391[_0x9cc8('0x7d')],[_0x9cc8('0xc2'),'id'])||{})[_0x9cc8('0xcf')](function(){return db['Tag'][_0x9cc8('0xcb')]({'attributes':['id','name',_0x9cc8('0xd0')],'where':{'id':_0x1bc391[_0x9cc8('0x7d')][_0x9cc8('0xc2')]}});})[_0x9cc8('0x2a')](function(_0x4d355e){socket[_0x9cc8('0xd1')](_0x9cc8('0xd2'),{'id':Number(_0x1bc391[_0x9cc8('0xbe')]['id']),'tags':_0x4d355e||[]});return{'id':Number(_0x1bc391[_0x9cc8('0xbe')]['id']),'tags':_0x4d355e||[]};});}})[_0x9cc8('0x2a')](respondWithResult(_0x445281,null))[_0x9cc8('0x36')](handleError(_0x445281,null));};exports[_0x9cc8('0xd3')]=function(_0x14a96c,_0x559141,_0x4aa583){return db[_0x9cc8('0x3f')]['find']({'where':{'id':_0x14a96c[_0x9cc8('0xbe')]['id']}})[_0x9cc8('0x2a')](handleEntityNotFound(_0x559141,null))[_0x9cc8('0x2a')](function(_0x26359f){if(_0x26359f){return _0x26359f[_0x9cc8('0xd3')](_0x14a96c['query'][_0x9cc8('0xc2')]);}})[_0x9cc8('0x2a')](respondWithStatusCode(_0x559141,null))[_0x9cc8('0x36')](handleError(_0x559141,null));};exports[_0x9cc8('0xd4')]=function(_0x9da2d0,_0x5a79f9){var _0xd0039b=moment()[_0x9cc8('0xd5')]()[_0x9cc8('0xa4')]();var _0x24311a=path[_0x9cc8('0xd6')](config['root'],_0x9cc8('0xd7'),'files',_0x9cc8('0xd8'));var _0x549e19=path[_0x9cc8('0xd6')](config[_0x9cc8('0xd9')],_0x9cc8('0xd7'),_0x9cc8('0xda'),'attachments');var _0x20f3ff=path[_0x9cc8('0xd6')](_0x24311a,_0xd0039b);var _0x5c6acc=util[_0x9cc8('0xc6')]('transcript-%d-%s.zip',_0x9da2d0[_0x9cc8('0xbe')]['id'],_0xd0039b);var _0x2f75ab=path[_0x9cc8('0xd6')](_0x24311a,_0x5c6acc);var _0x2c5db3=[];_0x2c5db3[_0x9cc8('0x35')]({'model':db['Attachment'],'as':_0x9cc8('0xdb'),'raw':!![]});var _0x5b96ee=[{'model':db[_0x9cc8('0xc1')],'as':_0x9cc8('0xdc'),'attributes':['id',_0x9cc8('0x7d'),_0x9cc8('0x84')],'include':_0x2c5db3}];return db[_0x9cc8('0x3f')][_0x9cc8('0x69')]({'where':{'id':_0x9da2d0['params']['id']},'include':_0x5b96ee})[_0x9cc8('0x2a')](handleEntityNotFound(_0x5a79f9,null))[_0x9cc8('0x2a')](function(_0x21ed90){if(_0x21ed90&&_0x21ed90[_0x9cc8('0xdc')]){var _0x15f54f=_0x21ed90[_0x9cc8('0xdd')]({'plain':!![]});fs[_0x9cc8('0xde')](_0x20f3ff);for(var _0x47dc44=0x0;_0x47dc44<_0x15f54f[_0x9cc8('0xdc')]['length'];_0x47dc44++){var _0x5634bb=_0x15f54f[_0x9cc8('0xdc')][_0x47dc44][_0x9cc8('0xdb')];if(_0x5634bb){var _0x53e98d=path[_0x9cc8('0xd6')](_0x549e19,_0x5634bb[_0x9cc8('0xdf')]);if(fs[_0x9cc8('0xe0')](_0x53e98d)){fs['createReadStream'](_0x53e98d)['pipe'](fs['createWriteStream'](path[_0x9cc8('0xd6')](_0x20f3ff,_0x5634bb[_0x9cc8('0xdf')])));}}}return BPromise[_0x9cc8('0x9c')]()[_0x9cc8('0x2a')](function(){return new BPromise(function(_0x33c35e,_0x3e0d81){zipdir(_0x20f3ff,{'saveTo':_0x2f75ab},function(_0x12dd9c,_0x4d73c0){if(_0x12dd9c)return _0x3e0d81(_0x12dd9c);return _0x33c35e(_0x4d73c0);});})[_0x9cc8('0x2a')](function(){return new BPromise(function(_0x61bd6a,_0x3df00d){rimraf(_0x20f3ff,function(_0x3e0ba4){if(_0x3e0ba4)_0x3df00d(_0x3e0ba4);return _0x61bd6a();});});})[_0x9cc8('0x2a')](function(){return _0x5a79f9['download'](_0x2f75ab,_0x5c6acc,function(_0x54d671){if(_0x54d671){console['log']('err',_0x54d671);}else{fs[_0x9cc8('0xe1')](_0x2f75ab);}});});});}else{return _0x5a79f9[_0x9cc8('0x2c')](0xc8);}})[_0x9cc8('0x36')](handleError(_0x5a79f9,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d5e4229..ad32232 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 _0xe011=['FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20971b,_0x536da2){var _0x4d7d38=function(_0x10c808){while(--_0x10c808){_0x20971b['push'](_0x20971b['shift']());}};_0x4d7d38(++_0x536da2);}(_0xe011,0xb2));var _0x1e01=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xe011[_0x571c1d];return _0x33c609;};'use strict';var EventEmitter=require(_0x1e01('0x0'));var FaxInteraction=require(_0x1e01('0x1'))['db'][_0x1e01('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x1e01('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1e01('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e01('0x5'),'afterDestroy':_0x1e01('0x6')};function emitEvent(_0x305037){return function(_0x3e3dcb,_0x2de5ca,_0x7f0896){_0x3e3dcb[_0x1e01('0x7')]({'attributes':['id'],'raw':!![]})[_0x1e01('0x8')](function(_0x1421d0){_0x3e3dcb['setDataValue'](_0x1e01('0x9'),_0x1421d0[_0x1e01('0xa')](function(_0x1cdd03){return{'id':_0x1cdd03['id']};}));return FaxMessage[_0x1e01('0xb')]({'where':{'FaxInteractionId':_0x3e3dcb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1e01('0x8')](function(_0x56f11e){_0x3e3dcb['setDataValue'](_0x1e01('0xc'),_0x56f11e[_0x1e01('0xd')]);FaxInteractionEvents[_0x1e01('0xe')](_0x305037+':'+_0x3e3dcb['id'],_0x3e3dcb);FaxInteractionEvents['emit'](_0x305037,_0x3e3dcb);_0x7f0896(null);})[_0x1e01('0xf')](_0x7f0896(null));};}for(var e in events){if(events[_0x1e01('0x10')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1e01('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x2922=['hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','then','length','emit','catch'];(function(_0x148531,_0x50890a){var _0x1650d1=function(_0x1be3f9){while(--_0x1be3f9){_0x148531['push'](_0x148531['shift']());}};_0x1650d1(++_0x50890a);}(_0x2922,0x1ce));var _0x2292=function(_0x1b2baf,_0x5e2a94){_0x1b2baf=_0x1b2baf-0x0;var _0x3d25a4=_0x2922[_0x1b2baf];return _0x3d25a4;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x2292('0x0'))['db'][_0x2292('0x1')];var FaxMessage=require(_0x2292('0x0'))['db'][_0x2292('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2292('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2292('0x4'),'afterDestroy':_0x2292('0x5')};function emitEvent(_0x2468b9){return function(_0x505d95,_0x7be530,_0x3d7ea8){_0x505d95[_0x2292('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x43261d){_0x505d95[_0x2292('0x7')](_0x2292('0x8'),_0x43261d[_0x2292('0x9')](function(_0x1e60dc){return{'id':_0x1e60dc['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x505d95['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2292('0xa')](function(_0x5bc576){_0x505d95[_0x2292('0x7')]('unreadMessages',_0x5bc576[_0x2292('0xb')]);FaxInteractionEvents[_0x2292('0xc')](_0x2468b9+':'+_0x505d95['id'],_0x505d95);FaxInteractionEvents['emit'](_0x2468b9,_0x505d95);_0x3d7ea8(null);})[_0x2292('0xd')](_0x3d7ea8(null));};}for(var e in events){if(events[_0x2292('0xe')](e)){var event=events[e];FaxInteraction[_0x2292('0xf')](e,emitEvent(event));}}module[_0x2292('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 ea41dc2..abe7c73 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 _0xfd53=['../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x8cfd08,_0x656b39){var _0x1c6452=function(_0x34a7cc){while(--_0x34a7cc){_0x8cfd08['push'](_0x8cfd08['shift']());}};_0x1c6452(++_0x656b39);}(_0xfd53,0x1d9));var _0x3fd5=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xfd53[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x3fd5('0x0'));var util=require(_0x3fd5('0x1'));var logger=require(_0x3fd5('0x2'))(_0x3fd5('0x3'));var moment=require('moment');var BPromise=require(_0x3fd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fd5('0x5'));var rimraf=require(_0x3fd5('0x6'));var config=require(_0x3fd5('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x3fd5('0x8')]=function(_0x3016b6,_0x5d00de){return _0x3016b6[_0x3fd5('0x9')](_0x3fd5('0xa'),attributes,{'tableName':_0x3fd5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c985c,_0x47edf,_0xf8cc00){if(_0x1c985c[_0x3fd5('0xc')](_0x3fd5('0xd'))){_0x1c985c['closedAt']=moment()[_0x3fd5('0xe')](_0x3fd5('0xf'));}_0xf8cc00(null,_0x1c985c);}}});}; \ No newline at end of file +var _0xa5fd=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x296ab3,_0x97374){var _0x19bde7=function(_0x3bf8b9){while(--_0x3bf8b9){_0x296ab3['push'](_0x296ab3['shift']());}};_0x19bde7(++_0x97374);}(_0xa5fd,0x173));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xda5f('0x0'))(_0xda5f('0x1'));var moment=require(_0xda5f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xda5f('0x3'));var config=require(_0xda5f('0x4'));var attributes=require(_0xda5f('0x5'));module[_0xda5f('0x6')]=function(_0x5eea48,_0x1bca8a){return _0x5eea48['define'](_0xda5f('0x7'),attributes,{'tableName':_0xda5f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b0ead,_0x585e03,_0x3be4b7){if(_0x3b0ead[_0xda5f('0x9')](_0xda5f('0xa'))){_0x3b0ead[_0xda5f('0xb')]=moment()[_0xda5f('0xc')](_0xda5f('0xd'));}_0x3be4b7(null,_0x3b0ead);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index e82e44c..b067b7f 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 _0x18f1=['ids','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','find','addTags'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x18f1,0xda));var _0x118f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x18f1[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x118f('0x0'));var util=require(_0x118f('0x1'));var moment=require(_0x118f('0x2'));var BPromise=require(_0x118f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x118f('0x4'))['db'];var utils=require(_0x118f('0x5'));var logger=require(_0x118f('0x6'))(_0x118f('0x7'));var config=require(_0x118f('0x8'));var jayson=require(_0x118f('0x9'));var client=jayson['client'][_0x118f('0xa')]({'port':0x232a});config['redis']=_[_0x118f('0xb')](config[_0x118f('0xc')],{'host':_0x118f('0xd'),'port':0x18eb});var socket=require(_0x118f('0xe'))(new Redis(config[_0x118f('0xc')]));require('./faxInteraction.socket')[_0x118f('0xf')](socket);function respondWithRpcPromise(_0x5583f4,_0x1816f3,_0x3a7996){return new BPromise(function(_0x389f17,_0x51607f){return client[_0x118f('0x10')](_0x5583f4,_0x3a7996)[_0x118f('0x11')](function(_0x1668f4){logger[_0x118f('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x1816f3,_0x118f('0x13'));logger[_0x118f('0x14')](_0x118f('0x15'),_0x1816f3,_0x118f('0x13'),JSON[_0x118f('0x16')](_0x1668f4));if(_0x1668f4[_0x118f('0x17')]){if(_0x1668f4[_0x118f('0x17')][_0x118f('0x18')]===0x1f4){logger[_0x118f('0x17')](_0x118f('0x19'),_0x1816f3,_0x1668f4[_0x118f('0x17')][_0x118f('0x1a')]);return _0x51607f(_0x1668f4['error'][_0x118f('0x1a')]);}logger[_0x118f('0x17')](_0x118f('0x19'),_0x1816f3,_0x1668f4['error'][_0x118f('0x1a')]);return _0x389f17(_0x1668f4[_0x118f('0x17')][_0x118f('0x1a')]);}else{logger['info'](_0x118f('0x19'),_0x1816f3,_0x118f('0x13'));_0x389f17(_0x1668f4[_0x118f('0x1b')]['message']);}})[_0x118f('0x1c')](function(_0x5eb1dc){logger[_0x118f('0x17')](_0x118f('0x19'),_0x1816f3,_0x5eb1dc);_0x51607f(_0x5eb1dc);});});}exports[_0x118f('0x1d')]=function(_0x4e13cb){var _0x276941=this;return new Promise(function(_0x6b1a02,_0x5e6107){return db[_0x118f('0x1e')][_0x118f('0x1f')](_0x4e13cb[_0x118f('0x20')],{'raw':_0x4e13cb[_0x118f('0x21')]?_0x4e13cb[_0x118f('0x21')][_0x118f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e13cb[_0x118f('0x21')]?_0x4e13cb[_0x118f('0x21')][_0x118f('0x23')]||null:null,'attributes':_0x4e13cb[_0x118f('0x21')]?_0x4e13cb['options']['attributes']||null:null,'limit':_0x4e13cb[_0x118f('0x21')]?_0x4e13cb[_0x118f('0x21')][_0x118f('0x24')]||null:null})[_0x118f('0x11')](function(_0x6b3a3e){logger[_0x118f('0x12')](_0x118f('0x1d'),_0x4e13cb);logger[_0x118f('0x14')](_0x118f('0x1d'),_0x4e13cb,JSON[_0x118f('0x16')](_0x6b3a3e));_0x6b1a02(_0x6b3a3e);})[_0x118f('0x1c')](function(_0x28574f){logger[_0x118f('0x17')](_0x118f('0x1d'),_0x28574f[_0x118f('0x1a')],_0x4e13cb);_0x5e6107(_0x276941[_0x118f('0x17')](0x1f4,_0x28574f['message']));});});};exports[_0x118f('0x25')]=function(_0x44ff41){return new Promise(function(_0x46b19c,_0x58fe85){return db[_0x118f('0x1e')][_0x118f('0x26')]({'where':_0x44ff41[_0x118f('0x21')]?_0x44ff41['options']['where']||null:null})[_0x118f('0x11')](function(_0x2b9222){if(_0x2b9222){return _0x2b9222[_0x118f('0x27')](_0x44ff41[_0x118f('0x20')][_0x118f('0x28')],_[_0x118f('0x29')](_0x44ff41[_0x118f('0x20')],[_0x118f('0x28'),'id'])||{});}})['spread'](function(_0x24b988){logger['info'](_0x118f('0x2a'),_0x44ff41);logger['debug'](_0x118f('0x2a'),_0x44ff41,JSON[_0x118f('0x16')](_0x24b988));_0x46b19c(_0x24b988);})[_0x118f('0x1c')](function(_0x28ee33){logger[_0x118f('0x17')](_0x118f('0x2a'),_0x28ee33[_0x118f('0x1a')],_0x44ff41);_0x58fe85(_this['error'](0x1f4,_0x28ee33[_0x118f('0x1a')]));});});}; \ No newline at end of file +var _0xd888=['ioredis','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','request\x20sent','stringify','error','code','message','result','catch','FaxInteraction,\x20%s,\x20%s','UpdateFaxInteraction','update','body','options','raw','attributes','AddTagsToFaxInteraction','FaxInteraction','where','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring'];(function(_0xeaa284,_0x6edae4){var _0xb6abba=function(_0x4e342d){while(--_0x4e342d){_0xeaa284['push'](_0xeaa284['shift']());}};_0xb6abba(++_0x6edae4);}(_0xd888,0x1c4));var _0x8d88=function(_0xe779,_0x1a1b29){_0xe779=_0xe779-0x0;var _0x5201de=_0xd888[_0xe779];return _0x5201de;};'use strict';var _=require(_0x8d88('0x0'));var util=require('util');var moment=require(_0x8d88('0x1'));var BPromise=require(_0x8d88('0x2'));var rs=require(_0x8d88('0x3'));var fs=require('fs');var Redis=require(_0x8d88('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8d88('0x5'))(_0x8d88('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d88('0x7')][_0x8d88('0x8')]({'port':0x232a});config[_0x8d88('0x9')]=_[_0x8d88('0xa')](config[_0x8d88('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d88('0xb'))(new Redis(config[_0x8d88('0x9')]));require('./faxInteraction.socket')[_0x8d88('0xc')](socket);function respondWithRpcPromise(_0x977c94,_0x4e6623,_0x76a5b7){return new BPromise(function(_0x16f635,_0x1617a3){return client[_0x8d88('0xd')](_0x977c94,_0x76a5b7)[_0x8d88('0xe')](function(_0x274216){logger[_0x8d88('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x4e6623,'request\x20sent');logger[_0x8d88('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4e6623,_0x8d88('0x11'),JSON[_0x8d88('0x12')](_0x274216));if(_0x274216[_0x8d88('0x13')]){if(_0x274216[_0x8d88('0x13')][_0x8d88('0x14')]===0x1f4){logger[_0x8d88('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x4e6623,_0x274216['error'][_0x8d88('0x15')]);return _0x1617a3(_0x274216['error'][_0x8d88('0x15')]);}logger[_0x8d88('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x4e6623,_0x274216['error'][_0x8d88('0x15')]);return _0x16f635(_0x274216['error'][_0x8d88('0x15')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4e6623,'request\x20sent');_0x16f635(_0x274216[_0x8d88('0x16')][_0x8d88('0x15')]);}})[_0x8d88('0x17')](function(_0x286297){logger['error'](_0x8d88('0x18'),_0x4e6623,_0x286297);_0x1617a3(_0x286297);});});}exports[_0x8d88('0x19')]=function(_0x2c5b01){var _0x363362=this;return new Promise(function(_0x362773,_0x31cfb0){return db['FaxInteraction'][_0x8d88('0x1a')](_0x2c5b01[_0x8d88('0x1b')],{'raw':_0x2c5b01[_0x8d88('0x1c')]?_0x2c5b01[_0x8d88('0x1c')][_0x8d88('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5b01[_0x8d88('0x1c')]?_0x2c5b01[_0x8d88('0x1c')]['where']||null:null,'attributes':_0x2c5b01['options']?_0x2c5b01[_0x8d88('0x1c')][_0x8d88('0x1e')]||null:null,'limit':_0x2c5b01['options']?_0x2c5b01['options']['limit']||null:null})[_0x8d88('0xe')](function(_0x6131){logger['info'](_0x8d88('0x19'),_0x2c5b01);logger[_0x8d88('0x10')](_0x8d88('0x19'),_0x2c5b01,JSON[_0x8d88('0x12')](_0x6131));_0x362773(_0x6131);})[_0x8d88('0x17')](function(_0x3d5a7c){logger[_0x8d88('0x13')](_0x8d88('0x19'),_0x3d5a7c[_0x8d88('0x15')],_0x2c5b01);_0x31cfb0(_0x363362[_0x8d88('0x13')](0x1f4,_0x3d5a7c[_0x8d88('0x15')]));});});};exports[_0x8d88('0x1f')]=function(_0x547885){return new Promise(function(_0x523952,_0x14791d){return db[_0x8d88('0x20')]['find']({'where':_0x547885[_0x8d88('0x1c')]?_0x547885[_0x8d88('0x1c')][_0x8d88('0x21')]||null:null})['then'](function(_0x4902de){if(_0x4902de){return _0x4902de[_0x8d88('0x22')](_0x547885[_0x8d88('0x1b')][_0x8d88('0x23')],_[_0x8d88('0x24')](_0x547885[_0x8d88('0x1b')],[_0x8d88('0x23'),'id'])||{});}})['spread'](function(_0x322b7c){logger[_0x8d88('0xf')]('AddTags',_0x547885);logger['debug'](_0x8d88('0x25'),_0x547885,JSON['stringify'](_0x322b7c));_0x523952(_0x322b7c);})['catch'](function(_0x3d63c9){logger[_0x8d88('0x13')](_0x8d88('0x25'),_0x3d63c9[_0x8d88('0x15')],_0x547885);_0x14791d(_this[_0x8d88('0x13')](0x1f4,_0x3d63c9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f1e9643..f41e601 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 _0xf320=['remove','update','emit','faxInteraction:','save'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xf320,0x121));var _0x0f32=function(_0x4b584a,_0x537262){_0x4b584a=_0x4b584a-0x0;var _0x17c84e=_0xf320[_0x4b584a];return _0x17c84e;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0f32('0x0'),_0x0f32('0x1'),_0x0f32('0x2')];function createListener(_0x59fca4,_0x146f1b){return function(_0x5d9d89){_0x146f1b[_0x0f32('0x3')](_0x59fca4,_0x5d9d89);};}function removeListener(_0x58d203,_0x25741c){return function(){FaxInteractionEvents['removeListener'](_0x58d203,_0x25741c);};}exports['register']=function(_0x380692){for(var _0x1eb8c2=0x0,_0x1b9838=events['length'];_0x1eb8c2<_0x1b9838;_0x1eb8c2++){var _0x165726=events[_0x1eb8c2];var _0x18b73a=createListener(_0x0f32('0x4')+_0x165726,_0x380692);FaxInteractionEvents['on'](_0x165726,_0x18b73a);}}; \ No newline at end of file +var _0x8d27=['removeListener','register','length','./faxInteraction.events','emit'];(function(_0x36981f,_0x35de12){var _0x4c1845=function(_0xe1ff6b){while(--_0xe1ff6b){_0x36981f['push'](_0x36981f['shift']());}};_0x4c1845(++_0x35de12);}(_0x8d27,0xda));var _0x78d2=function(_0xf3fc23,_0x5813ea){_0xf3fc23=_0xf3fc23-0x0;var _0x215684=_0x8d27[_0xf3fc23];return _0x215684;};'use strict';var FaxInteractionEvents=require(_0x78d2('0x0'));var events=['save','remove','update'];function createListener(_0x2f9eec,_0x287f5d){return function(_0x1150fc){_0x287f5d[_0x78d2('0x1')](_0x2f9eec,_0x1150fc);};}function removeListener(_0x2991e6,_0x45b9d7){return function(){FaxInteractionEvents[_0x78d2('0x2')](_0x2991e6,_0x45b9d7);};}exports[_0x78d2('0x3')]=function(_0x2593c9){for(var _0x58e4bb=0x0,_0x9d6da4=events[_0x78d2('0x4')];_0x58e4bb<_0x9d6da4;_0x58e4bb++){var _0x566789=events[_0x58e4bb];var _0x5d6b23=createListener('faxInteraction:'+_0x566789,_0x2593c9);FaxInteractionEvents['on'](_0x566789,_0x5d6b23);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 1cfb139..800f53d 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 _0x27b5=['download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/messages','/:id/download'];(function(_0x3ab1d9,_0x861715){var _0x171cb5=function(_0x1930e5){while(--_0x1930e5){_0x3ab1d9['push'](_0x3ab1d9['shift']());}};_0x171cb5(++_0x861715);}(_0x27b5,0x1a3));var _0x527b=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x27b5[_0x1305e3];return _0x1068e9;};'use strict';var multer=require('multer');var util=require(_0x527b('0x0'));var path=require(_0x527b('0x1'));var timeout=require(_0x527b('0x2'));var express=require('express');var router=express[_0x527b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x527b('0x4'));var interaction=require(_0x527b('0x5'));var config=require(_0x527b('0x6'));var controller=require(_0x527b('0x7'));router['get']('/',auth[_0x527b('0x8')](),controller['index']);router[_0x527b('0x9')](_0x527b('0xa'),auth[_0x527b('0x8')](),controller[_0x527b('0xb')]);router[_0x527b('0x9')](_0x527b('0xc'),auth[_0x527b('0x8')](),controller['show']);router[_0x527b('0x9')](_0x527b('0xd'),auth[_0x527b('0x8')](),controller['getMessages']);router['get'](_0x527b('0xe'),auth[_0x527b('0x8')](),controller[_0x527b('0xf')]);router[_0x527b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x527b('0xd'),auth['isAuthenticated'](),controller[_0x527b('0x11')]);router['post'](_0x527b('0x12'),auth[_0x527b('0x8')](),interaction[_0x527b('0x13')](_0x527b('0x14'),_0x527b('0x15')),controller[_0x527b('0x16')]);router[_0x527b('0x17')](_0x527b('0xc'),auth[_0x527b('0x8')](),interaction[_0x527b('0x13')]('fax',_0x527b('0x18')),controller[_0x527b('0x19')]);router[_0x527b('0x1a')](_0x527b('0xc'),auth[_0x527b('0x8')](),interaction[_0x527b('0x13')](_0x527b('0x14'),_0x527b('0x1b')),controller[_0x527b('0x1c')]);router[_0x527b('0x1a')](_0x527b('0x12'),auth[_0x527b('0x8')](),controller[_0x527b('0x1d')]);module[_0x527b('0x1e')]=router; \ No newline at end of file +var _0x70af=['addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x34e193,_0x2f6edc){var _0x545fe6=function(_0x3e5488){while(--_0x3e5488){_0x34e193['push'](_0x34e193['shift']());}};_0x545fe6(++_0x2f6edc);}(_0x70af,0x88));var _0xf70a=function(_0x5afefb,_0x135e89){_0x5afefb=_0x5afefb-0x0;var _0x141c45=_0x70af[_0x5afefb];return _0x141c45;};'use strict';var multer=require('multer');var util=require(_0xf70a('0x0'));var path=require(_0xf70a('0x1'));var timeout=require(_0xf70a('0x2'));var express=require(_0xf70a('0x3'));var router=express['Router']();var fs_extra=require(_0xf70a('0x4'));var auth=require(_0xf70a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf70a('0x6'));var controller=require(_0xf70a('0x7'));router['get']('/',auth[_0xf70a('0x8')](),controller[_0xf70a('0x9')]);router[_0xf70a('0xa')](_0xf70a('0xb'),auth[_0xf70a('0x8')](),controller['describe']);router[_0xf70a('0xa')](_0xf70a('0xc'),auth[_0xf70a('0x8')](),controller[_0xf70a('0xd')]);router[_0xf70a('0xa')](_0xf70a('0xe'),auth['isAuthenticated'](),controller[_0xf70a('0xf')]);router[_0xf70a('0xa')](_0xf70a('0x10'),auth[_0xf70a('0x8')](),controller[_0xf70a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf70a('0x12')](_0xf70a('0xe'),auth['isAuthenticated'](),controller[_0xf70a('0x13')]);router[_0xf70a('0x12')](_0xf70a('0x14'),auth[_0xf70a('0x8')](),interaction[_0xf70a('0x15')](_0xf70a('0x16'),_0xf70a('0x17')),controller['addTags']);router['put'](_0xf70a('0xc'),auth[_0xf70a('0x8')](),interaction[_0xf70a('0x15')](_0xf70a('0x16'),_0xf70a('0x18')),controller[_0xf70a('0x19')]);router[_0xf70a('0x1a')](_0xf70a('0xc'),auth[_0xf70a('0x8')](),interaction[_0xf70a('0x15')](_0xf70a('0x16'),_0xf70a('0x1b')),controller[_0xf70a('0x1c')]);router[_0xf70a('0x1a')](_0xf70a('0x14'),auth[_0xf70a('0x8')](),controller[_0xf70a('0x1d')]);module[_0xf70a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 878fdb4..acfb08a 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 _0x46fc=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x51ade2,_0x369879){var _0x1abf3e=function(_0x42900b){while(--_0x42900b){_0x51ade2['push'](_0x51ade2['shift']());}};_0x1abf3e(++_0x369879);}(_0x46fc,0x103));var _0xc46f=function(_0x1e3f0a,_0xe6f64c){_0x1e3f0a=_0x1e3f0a-0x0;var _0x4b4663=_0x46fc[_0x1e3f0a];return _0x4b4663;};'use strict';var Sequelize=require(_0xc46f('0x0'));module[_0xc46f('0x1')]={'body':{'type':Sequelize[_0xc46f('0x2')](_0xc46f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc46f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc46f('0x5')]('in',_0xc46f('0x6')),'defaultValue':_0xc46f('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xc46f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd737=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0xd737,0x85));var _0x7d73=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xd737[_0x3f59b1];return _0x11d2e8;};'use strict';var Sequelize=require(_0x7d73('0x0'));module['exports']={'body':{'type':Sequelize[_0x7d73('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7d73('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7d73('0x3')]('in',_0x7d73('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7d73('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index babbf94..d2f3bda 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 _0xa02e=['key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','params','includeAll','find','body','describe','fax-interactions','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','format','interaction','role','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','agent','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','type'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa02e,0x1e6));var _0xea02=function(_0x1fc3c4,_0x1a2143){_0x1fc3c4=_0x1fc3c4-0x0;var _0xf5ff77=_0xa02e[_0x1fc3c4];return _0xf5ff77;};'use strict';var emlformat=require(_0xea02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea02('0x1'));var jsonpatch=require(_0xea02('0x2'));var rp=require('request-promise');var moment=require(_0xea02('0x3'));var BPromise=require(_0xea02('0x4'));var Mustache=require(_0xea02('0x5'));var util=require(_0xea02('0x6'));var path=require(_0xea02('0x7'));var sox=require(_0xea02('0x8'));var csv=require('to-csv');var ejs=require(_0xea02('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea02('0xa'));var squel=require(_0xea02('0xb'));var crypto=require(_0xea02('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea02('0xd'));var toCsv=require(_0xea02('0xe'));var querystring=require(_0xea02('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea02('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea02('0x11'))(_0xea02('0x12'));var utils=require(_0xea02('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea02('0x14'));var db=require(_0xea02('0x15'))['db'];config[_0xea02('0x16')]=_[_0xea02('0x17')](config[_0xea02('0x16')],{'host':_0xea02('0x18'),'port':0x18eb});var socket=require(_0xea02('0x19'))(new Redis(config[_0xea02('0x16')]));require(_0xea02('0x1a'))['register'](socket);var jayson=require(_0xea02('0x1b'));var client=jayson[_0xea02('0x1c')][_0xea02('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xea02('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x156eef,_0x30ba50,_0x1c07b3,_0x474020){return new BPromise(function(_0x36098d,_0x43a7ef){var _0x396844=_0x474020||client;return _0x396844['request'](_0x156eef,_0x1c07b3)[_0xea02('0x1e')](function(_0x3aa311){logger[_0xea02('0x1f')](_0xea02('0x20'),_0x30ba50,_0xea02('0x21'));logger['debug'](_0xea02('0x22'),_0x30ba50,_0xea02('0x21'),JSON[_0xea02('0x23')](_0x3aa311));if(_0x3aa311[_0xea02('0x24')]){if(_0x3aa311[_0xea02('0x24')][_0xea02('0x25')]===0x1f4){logger[_0xea02('0x24')](_0xea02('0x20'),_0x30ba50,_0x3aa311[_0xea02('0x24')][_0xea02('0x26')]);return _0x43a7ef(_0x3aa311[_0xea02('0x24')]['message']);}logger[_0xea02('0x24')](_0xea02('0x20'),_0x30ba50,_0x3aa311[_0xea02('0x24')]['message']);return _0x36098d(_0x3aa311['error'][_0xea02('0x26')]);}else{logger[_0xea02('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x30ba50,_0xea02('0x21'));_0x36098d(_0x3aa311[_0xea02('0x27')][_0xea02('0x26')]);}})[_0xea02('0x28')](function(_0x319469){logger[_0xea02('0x24')](_0xea02('0x20'),_0x30ba50,_0x319469);_0x43a7ef(_0x319469);});});}function respondWithStatusCode(_0x352f4f,_0x50f75e){_0x50f75e=_0x50f75e||0xcc;return function(_0x295fb9){if(_0x295fb9){return _0x352f4f[_0xea02('0x29')](_0x50f75e);}return _0x352f4f[_0xea02('0x2a')](_0x50f75e)[_0xea02('0x2b')]();};}function respondWithResult(_0x8733b5,_0x5e217a){_0x5e217a=_0x5e217a||0xc8;return function(_0xe334ae){if(_0xe334ae){return _0x8733b5['status'](_0x5e217a)[_0xea02('0x2c')](_0xe334ae);}};}function respondWithFilteredResult(_0x2fe2cf,_0x25f8d0){return function(_0x1d0da2){if(_0x1d0da2){var _0x34e4b9=typeof _0x25f8d0[_0xea02('0x2d')]==='undefined'&&typeof _0x25f8d0['limit']===_0xea02('0x2e');var _0x588f1a=_0x1d0da2['count'];var _0x1031bf=_0x34e4b9?0x0:_0x25f8d0['offset'];var _0x3e164e=_0x34e4b9?_0x1d0da2[_0xea02('0x2f')]:_0x25f8d0[_0xea02('0x2d')]+_0x25f8d0['limit'];var _0x47b669;if(_0x3e164e>=_0x588f1a){_0x3e164e=_0x588f1a;_0x47b669=0xc8;}else{_0x47b669=0xce;}_0x2fe2cf[_0xea02('0x2a')](_0x47b669);return _0x2fe2cf['set'](_0xea02('0x30'),_0x1031bf+'-'+_0x3e164e+'/'+_0x588f1a)[_0xea02('0x2c')](_0x1d0da2);}return null;};}function patchUpdates(_0x4e3862){return function(_0x5e1c2c){try{jsonpatch[_0xea02('0x31')](_0x5e1c2c,_0x4e3862,!![]);}catch(_0x221a47){return BPromise[_0xea02('0x32')](_0x221a47);}return _0x5e1c2c[_0xea02('0x33')]();};}function saveUpdates(_0x1778c4,_0x214343){return function(_0x44702e){if(_0x44702e){return _0x44702e[_0xea02('0x34')](_0x1778c4)[_0xea02('0x1e')](function(_0x4a8744){return _0x4a8744;});}return null;};}function removeEntity(_0x3cbbd3,_0x3116b4){return function(_0x94a664){if(_0x94a664){return _0x94a664[_0xea02('0x35')]()[_0xea02('0x1e')](function(){_0x3cbbd3[_0xea02('0x2a')](0xcc)[_0xea02('0x2b')]();});}};}function handleEntityNotFound(_0x3eca6c,_0x426346){return function(_0x2ac5c8){if(!_0x2ac5c8){_0x3eca6c[_0xea02('0x29')](0x194);}return _0x2ac5c8;};}function handleError(_0xcb8470,_0x190d37){_0x190d37=_0x190d37||0x1f4;return function(_0x219d0f){logger[_0xea02('0x24')](_0x219d0f[_0xea02('0x36')]);if(_0x219d0f[_0xea02('0x37')]){delete _0x219d0f[_0xea02('0x37')];}_0xcb8470[_0xea02('0x2a')](_0x190d37)[_0xea02('0x38')](_0x219d0f);};}exports[_0xea02('0x39')]=function(_0x4d88f9,_0x1d1bb0){var _0x279318={},_0x519e30={},_0x42d229={'count':0x0,'rows':[]};var _0x37d4a7=_[_0xea02('0x3a')](db[_0xea02('0x3b')][_0xea02('0x3c')],function(_0x23fb91){return{'name':_0x23fb91['fieldName'],'type':_0x23fb91[_0xea02('0x3d')][_0xea02('0x3e')]};});_0x519e30['model']=_[_0xea02('0x3a')](_0x37d4a7,'name');_0x519e30[_0xea02('0x3f')]=_[_0xea02('0x40')](_0x4d88f9['query']);_0x519e30[_0xea02('0x41')]=_[_0xea02('0x42')](_0x519e30[_0xea02('0x43')],_0x519e30[_0xea02('0x3f')]);_0x279318[_0xea02('0x44')]=_['intersection'](_0x519e30['model'],qs[_0xea02('0x45')](_0x4d88f9['query']['fields']));_0x279318['attributes']=_0x279318['attributes'][_0xea02('0x46')]?_0x279318[_0xea02('0x44')]:_0x519e30[_0xea02('0x43')];if(!_0x4d88f9[_0xea02('0x3f')][_0xea02('0x47')](_0xea02('0x48'))){_0x279318['limit']=qs[_0xea02('0x49')](_0x4d88f9['query'][_0xea02('0x49')]);_0x279318[_0xea02('0x2d')]=qs[_0xea02('0x2d')](_0x4d88f9[_0xea02('0x3f')]['offset']);}_0x279318['order']=qs[_0xea02('0x4a')](_0x4d88f9[_0xea02('0x3f')][_0xea02('0x4a')]);_0x279318[_0xea02('0x4b')]=qs['filters'](_['pick'](_0x4d88f9[_0xea02('0x3f')],_0x519e30[_0xea02('0x41')]),_0x37d4a7);if(_0x4d88f9[_0xea02('0x3f')][_0xea02('0x4c')]){_0x279318[_0xea02('0x4b')]=_[_0xea02('0x4d')](_0x279318[_0xea02('0x4b')],{'$or':_['map'](_0x37d4a7,function(_0x236341){if(_0x236341[_0xea02('0x3d')]!==_0xea02('0x4e')){var _0x4f2618={};_0x4f2618[_0x236341['name']]={'$like':'%'+_0x4d88f9[_0xea02('0x3f')]['filter']+'%'};return _0x4f2618;}})});}_0x279318=_[_0xea02('0x4d')]({},_0x279318,_0x4d88f9[_0xea02('0x4f')]);var _0x5283d9={'where':_0x279318[_0xea02('0x4b')]};return db[_0xea02('0x3b')]['count'](_0x5283d9)[_0xea02('0x1e')](function(_0x3b32eb){_0x42d229[_0xea02('0x2f')]=_0x3b32eb;if(_0x4d88f9[_0xea02('0x3f')]['includeAll']){_0x279318[_0xea02('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xea02('0x51')](_0x279318);})[_0xea02('0x1e')](function(_0x3118f2){_0x42d229['rows']=_0x3118f2;return _0x42d229;})['then'](respondWithFilteredResult(_0x1d1bb0,_0x279318))[_0xea02('0x28')](handleError(_0x1d1bb0,null));};exports['show']=function(_0x4cb79b,_0x424f02){var _0x2e37e2={'raw':!![],'where':{'id':_0x4cb79b[_0xea02('0x52')]['id']}},_0x21e7c2={};_0x21e7c2['model']=_[_0xea02('0x40')](db[_0xea02('0x3b')]['rawAttributes']);_0x21e7c2[_0xea02('0x3f')]=_[_0xea02('0x40')](_0x4cb79b[_0xea02('0x3f')]);_0x21e7c2['filters']=_[_0xea02('0x42')](_0x21e7c2[_0xea02('0x43')],_0x21e7c2[_0xea02('0x3f')]);_0x2e37e2['attributes']=_[_0xea02('0x42')](_0x21e7c2[_0xea02('0x43')],qs[_0xea02('0x45')](_0x4cb79b[_0xea02('0x3f')]['fields']));_0x2e37e2[_0xea02('0x44')]=_0x2e37e2[_0xea02('0x44')][_0xea02('0x46')]?_0x2e37e2[_0xea02('0x44')]:_0x21e7c2['model'];if(_0x4cb79b[_0xea02('0x3f')][_0xea02('0x53')]){_0x2e37e2[_0xea02('0x50')]=[{'all':!![]}];}_0x2e37e2=_['merge']({},_0x2e37e2,_0x4cb79b[_0xea02('0x4f')]);return db['FaxMessage'][_0xea02('0x54')](_0x2e37e2)[_0xea02('0x1e')](handleEntityNotFound(_0x424f02,null))[_0xea02('0x1e')](respondWithResult(_0x424f02,null))[_0xea02('0x28')](handleError(_0x424f02,null));};exports[_0xea02('0x34')]=function(_0x24185a,_0x5ec50f){if(_0x24185a[_0xea02('0x55')]['id']){delete _0x24185a['body']['id'];}return db['FaxMessage'][_0xea02('0x54')]({'where':{'id':_0x24185a[_0xea02('0x52')]['id']}})[_0xea02('0x1e')](handleEntityNotFound(_0x5ec50f,null))[_0xea02('0x1e')](saveUpdates(_0x24185a[_0xea02('0x55')],null))[_0xea02('0x1e')](respondWithResult(_0x5ec50f,null))['catch'](handleError(_0x5ec50f,null));};exports[_0xea02('0x35')]=function(_0x453c6c,_0x918789){return db['FaxMessage'][_0xea02('0x54')]({'where':{'id':_0x453c6c[_0xea02('0x52')]['id']}})[_0xea02('0x1e')](handleEntityNotFound(_0x918789,null))[_0xea02('0x1e')](removeEntity(_0x918789,null))['catch'](handleError(_0x918789,null));};exports[_0xea02('0x56')]=function(_0x3f9397,_0x430fe7){return db[_0xea02('0x3b')]['describe']()[_0xea02('0x1e')](respondWithResult(_0x430fe7,null))[_0xea02('0x28')](handleError(_0x430fe7,null));};var interaction_log=require('../../config/logger')(_0xea02('0x57'));exports['accept']=function(_0x35c40e,_0x548a98,_0x4386b8){var _0x5d47d2={'agent':{},'channel':_0xea02('0x58')};if(_0x35c40e[_0xea02('0x55')]['id']){delete _0x35c40e[_0xea02('0x55')]['id'];}_0x35c40e[_0xea02('0x55')]['read']=!![];_0x35c40e[_0xea02('0x55')][_0xea02('0x59')]=moment()['format'](_0xea02('0x5a'));_0x35c40e[_0xea02('0x55')][_0xea02('0x5b')]=_0x35c40e[_0xea02('0x55')][_0xea02('0x5b')]||_0x35c40e[_0xea02('0x5c')]['id'];_0x5d47d2['agent']['id']=_0x35c40e[_0xea02('0x55')]['UserId'];return db['FaxMessage'][_0xea02('0x54')]({'where':{'id':_0x35c40e['params']['id'],'UserId':null}})[_0xea02('0x1e')](handleEntityNotFound(_0x548a98,null))['then'](saveUpdates(_0x35c40e[_0xea02('0x55')],null))[_0xea02('0x1e')](function(_0x29d2cb){if(_0x29d2cb){_0x5d47d2[_0xea02('0x26')]=_0x29d2cb[_0xea02('0x5d')]({'plain':!![]});return db[_0xea02('0x5e')][_0xea02('0x54')]({'where':{'id':_0x29d2cb[_0xea02('0x5f')]}});}return null;})[_0xea02('0x1e')](handleEntityNotFound(_0x548a98,null))['then'](function(_0x35d17f){if(_0x35d17f){return _0x35d17f['update']({'UserId':_0x35c40e[_0xea02('0x55')][_0xea02('0x5b')],'read1stAt':_[_0xea02('0x60')](_0x35d17f['read1stAt'])?moment()[_0xea02('0x61')](_0xea02('0x5a')):undefined});}return null;})[_0xea02('0x1e')](function(_0x53194f){if(_0x53194f){_0x5d47d2[_0xea02('0x62')]=_0x53194f[_0xea02('0x5d')]({'plain':!![]});interaction_log[_0xea02('0x1f')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35c40e[_0xea02('0x5c')]['id'],_0x35c40e[_0xea02('0x5c')]['name'],_0x35c40e['user'][_0xea02('0x63')],_0x5d47d2[_0xea02('0x62')]['id'],_0x35c40e[_0xea02('0x55')]?JSON[_0xea02('0x23')](_0x35c40e[_0xea02('0x55')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5d47d2);}return null;})[_0xea02('0x1e')](function(_0x15000b){var _0x497e7d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15000b['message'][_0xea02('0x64')];return db[_0xea02('0x65')]['query'](_0x497e7d,{'type':db[_0xea02('0x66')][_0xea02('0x67')][_0xea02('0x68')],'raw':!![]})[_0xea02('0x1e')](function(_0x130d96){return _0x130d96;});})[_0xea02('0x1e')](function(_0x1d986f){if(_0x1d986f){_0x5d47d2[_0xea02('0x26')][_0xea02('0x69')]=_0x1d986f[0x0];if(!_0x35c40e['body']['UserId'])return;return db['User'][_0xea02('0x54')]({'where':{'id':_0x35c40e[_0xea02('0x55')][_0xea02('0x5b')],'role':'agent'},'attributes':['id','name',_0xea02('0x6a'),_0xea02('0x6b'),_0xea02('0x6c')],'raw':!![]});}return null;})[_0xea02('0x1e')](function(_0x319c81){if(!_0x319c81)return null;_0x5d47d2[_0xea02('0x26')]['agent']=_0x319c81;return _0x5d47d2;})[_0xea02('0x1e')](function(_0x2b38a8){if(_0x2b38a8){if(_0x35c40e[_0xea02('0x55')][_0xea02('0x6d')]){_0x5d47d2['message'][_0xea02('0x6e')]=util['format'](_0xea02('0x6f'),_0x35c40e[_0xea02('0x5c')][_0xea02('0x37')]);_0x5d47d2[_0xea02('0x26')][_0xea02('0x70')]=_0x5d47d2[_0xea02('0x70')];_0x5d47d2['message'][_0xea02('0x71')]=_0x5d47d2[_0xea02('0x70')];_0x5d47d2[_0xea02('0x26')][_0xea02('0x72')]=_0xea02('0x73');return respondWithRpcPromise(_0xea02('0x74'),_0xea02('0x74'),{'event':'acceptmessage','message':_0x5d47d2[_0xea02('0x26')]},client9002)[_0xea02('0x1e')](function(){return _0x5d47d2;});}return _0x5d47d2;}return null;})[_0xea02('0x1e')](respondWithResult(_0x548a98,null))['catch'](handleError(_0x548a98,null));};var interaction_log=require(_0xea02('0x11'))(_0xea02('0x57'));exports['reject']=function(_0x443c92,_0x4e1f59,_0x10e97c){var _0x519bf5={'agent':{},'channel':_0xea02('0x58')};if(_0x443c92[_0xea02('0x55')]['id']){delete _0x443c92[_0xea02('0x55')]['id'];}_0x443c92[_0xea02('0x55')]['UserId']=_0x443c92[_0xea02('0x55')]['UserId']||_0x443c92[_0xea02('0x5c')]['id'];_0x519bf5[_0xea02('0x75')]['id']=_0x443c92[_0xea02('0x55')][_0xea02('0x5b')];return db['FaxMessage'][_0xea02('0x54')]({'where':{'id':_0x443c92[_0xea02('0x52')]['id'],'UserId':null}})[_0xea02('0x1e')](handleEntityNotFound(_0x4e1f59,null))[_0xea02('0x1e')](function(_0x925f50){if(_0x925f50){_0x519bf5['message']=_0x925f50['get']({'plain':!![]});return db[_0xea02('0x5e')][_0xea02('0x54')]({'where':{'id':_0x925f50['FaxInteractionId']}});}return null;})[_0xea02('0x1e')](handleEntityNotFound(_0x4e1f59,null))[_0xea02('0x1e')](function(_0x3da733){if(_0x3da733){_0x519bf5[_0xea02('0x62')]=_0x3da733[_0xea02('0x5d')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x443c92[_0xea02('0x5c')]['id'],_0x443c92[_0xea02('0x5c')]['name'],_0x443c92[_0xea02('0x5c')][_0xea02('0x63')],_0x519bf5[_0xea02('0x62')]['id'],_0x443c92[_0xea02('0x55')]?JSON[_0xea02('0x23')](_0x443c92[_0xea02('0x55')]):'null');return respondWithRpcPromise(_0xea02('0x76'),_0xea02('0x77'),_0x519bf5);}return null;})['then'](function(_0x3e8e66){var _0x11f088=_0xea02('0x78')+_0x3e8e66[_0xea02('0x26')]['ContactId'];return db[_0xea02('0x65')]['query'](_0x11f088,{'type':db['Sequelize']['QueryTypes'][_0xea02('0x68')],'raw':!![]})[_0xea02('0x1e')](function(_0x3f5b41){return _0x3f5b41;});})['then'](function(_0x4de95e){if(_0x4de95e){_0x519bf5[_0xea02('0x26')][_0xea02('0x69')]=_0x4de95e[0x0];if(!_0x443c92[_0xea02('0x55')][_0xea02('0x5b')])return;return db[_0xea02('0x79')][_0xea02('0x54')]({'where':{'id':_0x443c92[_0xea02('0x55')][_0xea02('0x5b')],'role':_0xea02('0x75')},'attributes':['id',_0xea02('0x37'),'fullname',_0xea02('0x6b'),_0xea02('0x6c')],'raw':!![]});}return null;})[_0xea02('0x1e')](function(_0x14fc51){if(!_0x14fc51)return null;_0x519bf5[_0xea02('0x26')][_0xea02('0x75')]=_0x14fc51;return _0x519bf5;})[_0xea02('0x1e')](function(_0x4373fe){if(_0x4373fe){_0x4373fe[_0xea02('0x26')][_0xea02('0x6e')]=util[_0xea02('0x61')](_0xea02('0x6f'),_0x443c92[_0xea02('0x5c')][_0xea02('0x37')]);_0x4373fe[_0xea02('0x26')]['channel']=_0x519bf5[_0xea02('0x70')];_0x4373fe[_0xea02('0x26')][_0xea02('0x71')]=_0x519bf5[_0xea02('0x70')];_0x4373fe[_0xea02('0x26')][_0xea02('0x72')]=_0xea02('0x32');respondWithRpcPromise('EventManager',_0xea02('0x74'),{'event':_0xea02('0x7a'),'message':_0x4373fe[_0xea02('0x26')]},client9002);return _0x519bf5;}return null;})[_0xea02('0x1e')](respondWithResult(_0x4e1f59,null))['catch'](handleError(_0x4e1f59,null));};exports['create']=function(_0xb1ba20,_0x27b0eb){var _0x201dff;return db[_0xea02('0x3b')][_0xea02('0x7b')](_0xb1ba20['body'],{})[_0xea02('0x1e')](function(_0x484f83){_0x201dff=_0x484f83;return db[_0xea02('0x7c')][_0xea02('0x7d')]({'where':{'id':_0x201dff[_0xea02('0x64')]}});})[_0xea02('0x1e')](function(_0x258aa5){if(_['isNil'](_0x258aa5)){return;}else{_0x201dff[_0xea02('0x58')]=_0x258aa5[_0xea02('0x58')];return db[_0xea02('0x7e')]['findOne']({'where':{'id':_0x201dff[_0xea02('0x7f')]}});}})[_0xea02('0x1e')](function(_0x3a95d8){return respondWithRpcPromise('SendFax',_0xea02('0x80'),{'FaxAccountId':_[_0xea02('0x60')](_0xb1ba20[_0xea02('0x55')])?undefined:_0xb1ba20[_0xea02('0x55')][_0xea02('0x81')],'path':_['isNil'](_0x3a95d8)?undefined:util['format'](_0xea02('0x82'),_0x3a95d8[_0xea02('0x83')]),'fax':_['isNil'](_0x201dff[_0xea02('0x58')])?undefined:_0x201dff[_0xea02('0x58')],'AttachmentId':_0x201dff['AttachmentId']},client9002);})['then'](respondWithResult(_0x27b0eb,0xc9))[_0xea02('0x28')](handleError(_0x27b0eb,null));};exports[_0xea02('0x84')]=function(_0x49bbc1,_0x4eba20){var _0x3aa659=path[_0xea02('0x85')](config['root'],_0xea02('0x86'),_0xea02('0x87'),_0xea02('0x88'));return db['FaxMessage'][_0xea02('0x54')]({'where':{'id':_0x49bbc1['params']['id']},'include':[{'model':db[_0xea02('0x7e')],'as':'Attachment'}]})[_0xea02('0x1e')](handleEntityNotFound(_0x4eba20,null))[_0xea02('0x1e')](function(_0x47db9d){if(_0x47db9d){return _0x4eba20['download'](path['join'](_0x3aa659,_0x47db9d[_0xea02('0x7e')][_0xea02('0x83')]));}})[_0xea02('0x28')](handleError(_0x4eba20,null));}; \ No newline at end of file +var _0x6018=['contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','moment','bluebird','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','status','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FaxMessage','includeAll','include','findAll','show','options','find','body','destroy','params','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize'];(function(_0x1b3b8f,_0x3bf6d1){var _0x2b0bef=function(_0x490eb0){while(--_0x490eb0){_0x1b3b8f['push'](_0x1b3b8f['shift']());}};_0x2b0bef(++_0x3bf6d1);}(_0x6018,0x1df));var _0x8601=function(_0x1612fe,_0x4683e9){_0x1612fe=_0x1612fe-0x0;var _0x14a141=_0x6018[_0x1612fe];return _0x14a141;};'use strict';var emlformat=require(_0x8601('0x0'));var rimraf=require(_0x8601('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8601('0x2'));var BPromise=require(_0x8601('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8601('0x4'));var sox=require('sox');var csv=require(_0x8601('0x5'));var ejs=require(_0x8601('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8601('0x7'));var squel=require(_0x8601('0x8'));var crypto=require('crypto');var jsforce=require(_0x8601('0x9'));var deskjs=require(_0x8601('0xa'));var toCsv=require(_0x8601('0x5'));var querystring=require(_0x8601('0xb'));var Papa=require('papaparse');var Redis=require(_0x8601('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8601('0xd'));var as=require(_0x8601('0xe'));var hardwareService=require(_0x8601('0xf'));var logger=require(_0x8601('0x10'))('api');var utils=require(_0x8601('0x11'));var config=require(_0x8601('0x12'));var licenseUtil=require(_0x8601('0x13'));var db=require(_0x8601('0x14'))['db'];config['redis']=_['defaults'](config[_0x8601('0x15')],{'host':_0x8601('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8601('0x15')]));require(_0x8601('0x17'))[_0x8601('0x18')](socket);var jayson=require(_0x8601('0x19'));var client=jayson[_0x8601('0x1a')][_0x8601('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44880b,_0x29d351,_0x581645,_0x4f1900){return new BPromise(function(_0x2782e2,_0x233479){var _0x48c0cb=_0x4f1900||client;return _0x48c0cb[_0x8601('0x1c')](_0x44880b,_0x581645)['then'](function(_0x4d0edb){logger[_0x8601('0x1d')](_0x8601('0x1e'),_0x29d351,'request\x20sent');logger[_0x8601('0x1f')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x29d351,_0x8601('0x20'),JSON['stringify'](_0x4d0edb));if(_0x4d0edb[_0x8601('0x21')]){if(_0x4d0edb[_0x8601('0x21')][_0x8601('0x22')]===0x1f4){logger[_0x8601('0x21')](_0x8601('0x1e'),_0x29d351,_0x4d0edb[_0x8601('0x21')][_0x8601('0x23')]);return _0x233479(_0x4d0edb[_0x8601('0x21')][_0x8601('0x23')]);}logger[_0x8601('0x21')](_0x8601('0x1e'),_0x29d351,_0x4d0edb[_0x8601('0x21')]['message']);return _0x2782e2(_0x4d0edb[_0x8601('0x21')][_0x8601('0x23')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x29d351,_0x8601('0x20'));_0x2782e2(_0x4d0edb[_0x8601('0x24')][_0x8601('0x23')]);}})[_0x8601('0x25')](function(_0x266141){logger[_0x8601('0x21')](_0x8601('0x1e'),_0x29d351,_0x266141);_0x233479(_0x266141);});});}function respondWithStatusCode(_0x463859,_0x304b43){_0x304b43=_0x304b43||0xcc;return function(_0x322098){if(_0x322098){return _0x463859[_0x8601('0x26')](_0x304b43);}return _0x463859['status'](_0x304b43)[_0x8601('0x27')]();};}function respondWithResult(_0x3adf6b,_0x377e4f){_0x377e4f=_0x377e4f||0xc8;return function(_0x3f026b){if(_0x3f026b){return _0x3adf6b['status'](_0x377e4f)[_0x8601('0x28')](_0x3f026b);}};}function respondWithFilteredResult(_0x3399df,_0x1fdec9){return function(_0x440f53){if(_0x440f53){var _0x47e40f=typeof _0x1fdec9['offset']===_0x8601('0x29')&&typeof _0x1fdec9['limit']===_0x8601('0x29');var _0x418217=_0x440f53[_0x8601('0x2a')];var _0x193081=_0x47e40f?0x0:_0x1fdec9['offset'];var _0x3cfa21=_0x47e40f?_0x440f53[_0x8601('0x2a')]:_0x1fdec9[_0x8601('0x2b')]+_0x1fdec9[_0x8601('0x2c')];var _0x43717b;if(_0x3cfa21>=_0x418217){_0x3cfa21=_0x418217;_0x43717b=0xc8;}else{_0x43717b=0xce;}_0x3399df['status'](_0x43717b);return _0x3399df[_0x8601('0x2d')](_0x8601('0x2e'),_0x193081+'-'+_0x3cfa21+'/'+_0x418217)[_0x8601('0x28')](_0x440f53);}return null;};}function patchUpdates(_0x1c0557){return function(_0x1c6442){try{jsonpatch[_0x8601('0x2f')](_0x1c6442,_0x1c0557,!![]);}catch(_0x1271e2){return BPromise[_0x8601('0x30')](_0x1271e2);}return _0x1c6442[_0x8601('0x31')]();};}function saveUpdates(_0x391b27,_0x2e4972){return function(_0xc4eff9){if(_0xc4eff9){return _0xc4eff9[_0x8601('0x32')](_0x391b27)[_0x8601('0x33')](function(_0x363394){return _0x363394;});}return null;};}function removeEntity(_0x510edf,_0x53ca01){return function(_0x4f7050){if(_0x4f7050){return _0x4f7050['destroy']()['then'](function(){_0x510edf[_0x8601('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x905b1,_0xd2e2e7){return function(_0x12c55f){if(!_0x12c55f){_0x905b1['sendStatus'](0x194);}return _0x12c55f;};}function handleError(_0xb067c3,_0x378c67){_0x378c67=_0x378c67||0x1f4;return function(_0x21172f){logger[_0x8601('0x21')](_0x21172f[_0x8601('0x35')]);if(_0x21172f[_0x8601('0x36')]){delete _0x21172f[_0x8601('0x36')];}_0xb067c3[_0x8601('0x34')](_0x378c67)[_0x8601('0x37')](_0x21172f);};}exports['index']=function(_0x32b44e,_0x1ae9c2){var _0x1017d0={},_0x3a8a7d={},_0x399785={'count':0x0,'rows':[]};var _0x2cb041=_['map'](db['FaxMessage'][_0x8601('0x38')],function(_0x11308f){return{'name':_0x11308f[_0x8601('0x39')],'type':_0x11308f[_0x8601('0x3a')][_0x8601('0x3b')]};});_0x3a8a7d[_0x8601('0x3c')]=_[_0x8601('0x3d')](_0x2cb041,_0x8601('0x36'));_0x3a8a7d['query']=_[_0x8601('0x3e')](_0x32b44e['query']);_0x3a8a7d[_0x8601('0x3f')]=_[_0x8601('0x40')](_0x3a8a7d[_0x8601('0x3c')],_0x3a8a7d[_0x8601('0x41')]);_0x1017d0[_0x8601('0x42')]=_[_0x8601('0x40')](_0x3a8a7d['model'],qs[_0x8601('0x43')](_0x32b44e[_0x8601('0x41')][_0x8601('0x43')]));_0x1017d0[_0x8601('0x42')]=_0x1017d0['attributes'][_0x8601('0x44')]?_0x1017d0[_0x8601('0x42')]:_0x3a8a7d[_0x8601('0x3c')];if(!_0x32b44e[_0x8601('0x41')][_0x8601('0x45')](_0x8601('0x46'))){_0x1017d0['limit']=qs[_0x8601('0x2c')](_0x32b44e[_0x8601('0x41')]['limit']);_0x1017d0['offset']=qs[_0x8601('0x2b')](_0x32b44e[_0x8601('0x41')][_0x8601('0x2b')]);}_0x1017d0[_0x8601('0x47')]=qs[_0x8601('0x48')](_0x32b44e[_0x8601('0x41')][_0x8601('0x48')]);_0x1017d0[_0x8601('0x49')]=qs[_0x8601('0x3f')](_[_0x8601('0x4a')](_0x32b44e[_0x8601('0x41')],_0x3a8a7d[_0x8601('0x3f')]),_0x2cb041);if(_0x32b44e[_0x8601('0x41')][_0x8601('0x4b')]){_0x1017d0['where']=_['merge'](_0x1017d0[_0x8601('0x49')],{'$or':_[_0x8601('0x3d')](_0x2cb041,function(_0x26df15){if(_0x26df15[_0x8601('0x3a')]!==_0x8601('0x4c')){var _0xe3d5cb={};_0xe3d5cb[_0x26df15[_0x8601('0x36')]]={'$like':'%'+_0x32b44e['query'][_0x8601('0x4b')]+'%'};return _0xe3d5cb;}})});}_0x1017d0=_[_0x8601('0x4d')]({},_0x1017d0,_0x32b44e['options']);var _0x2d4981={'where':_0x1017d0['where']};return db[_0x8601('0x4e')][_0x8601('0x2a')](_0x2d4981)[_0x8601('0x33')](function(_0x210de4){_0x399785[_0x8601('0x2a')]=_0x210de4;if(_0x32b44e[_0x8601('0x41')][_0x8601('0x4f')]){_0x1017d0[_0x8601('0x50')]=[{'all':!![]}];}return db[_0x8601('0x4e')][_0x8601('0x51')](_0x1017d0);})[_0x8601('0x33')](function(_0x2be83f){_0x399785['rows']=_0x2be83f;return _0x399785;})[_0x8601('0x33')](respondWithFilteredResult(_0x1ae9c2,_0x1017d0))[_0x8601('0x25')](handleError(_0x1ae9c2,null));};exports[_0x8601('0x52')]=function(_0x37a465,_0x8ca46b){var _0x5d5621={'raw':!![],'where':{'id':_0x37a465['params']['id']}},_0x173192={};_0x173192['model']=_[_0x8601('0x3e')](db[_0x8601('0x4e')][_0x8601('0x38')]);_0x173192['query']=_['keys'](_0x37a465[_0x8601('0x41')]);_0x173192[_0x8601('0x3f')]=_[_0x8601('0x40')](_0x173192['model'],_0x173192[_0x8601('0x41')]);_0x5d5621['attributes']=_[_0x8601('0x40')](_0x173192[_0x8601('0x3c')],qs[_0x8601('0x43')](_0x37a465[_0x8601('0x41')][_0x8601('0x43')]));_0x5d5621[_0x8601('0x42')]=_0x5d5621[_0x8601('0x42')][_0x8601('0x44')]?_0x5d5621[_0x8601('0x42')]:_0x173192[_0x8601('0x3c')];if(_0x37a465[_0x8601('0x41')][_0x8601('0x4f')]){_0x5d5621['include']=[{'all':!![]}];}_0x5d5621=_['merge']({},_0x5d5621,_0x37a465[_0x8601('0x53')]);return db[_0x8601('0x4e')][_0x8601('0x54')](_0x5d5621)[_0x8601('0x33')](handleEntityNotFound(_0x8ca46b,null))[_0x8601('0x33')](respondWithResult(_0x8ca46b,null))[_0x8601('0x25')](handleError(_0x8ca46b,null));};exports[_0x8601('0x32')]=function(_0x275df1,_0x777412){if(_0x275df1['body']['id']){delete _0x275df1[_0x8601('0x55')]['id'];}return db[_0x8601('0x4e')][_0x8601('0x54')]({'where':{'id':_0x275df1['params']['id']}})[_0x8601('0x33')](handleEntityNotFound(_0x777412,null))[_0x8601('0x33')](saveUpdates(_0x275df1[_0x8601('0x55')],null))[_0x8601('0x33')](respondWithResult(_0x777412,null))[_0x8601('0x25')](handleError(_0x777412,null));};exports[_0x8601('0x56')]=function(_0x39e7a3,_0x125f26){return db['FaxMessage'][_0x8601('0x54')]({'where':{'id':_0x39e7a3[_0x8601('0x57')]['id']}})['then'](handleEntityNotFound(_0x125f26,null))[_0x8601('0x33')](removeEntity(_0x125f26,null))['catch'](handleError(_0x125f26,null));};exports[_0x8601('0x58')]=function(_0xa6691f,_0x100a7c){return db['FaxMessage'][_0x8601('0x58')]()['then'](respondWithResult(_0x100a7c,null))[_0x8601('0x25')](handleError(_0x100a7c,null));};var interaction_log=require('../../config/logger')(_0x8601('0x59'));exports[_0x8601('0x5a')]=function(_0x500b83,_0x3890c1,_0x1ee20a){var _0x41d110={'agent':{},'channel':_0x8601('0x5b')};if(_0x500b83[_0x8601('0x55')]['id']){delete _0x500b83['body']['id'];}_0x500b83['body'][_0x8601('0x5c')]=!![];_0x500b83[_0x8601('0x55')][_0x8601('0x5d')]=moment()[_0x8601('0x5e')](_0x8601('0x5f'));_0x500b83[_0x8601('0x55')][_0x8601('0x60')]=_0x500b83['body'][_0x8601('0x60')]||_0x500b83[_0x8601('0x61')]['id'];_0x41d110['agent']['id']=_0x500b83[_0x8601('0x55')]['UserId'];return db[_0x8601('0x4e')][_0x8601('0x54')]({'where':{'id':_0x500b83[_0x8601('0x57')]['id'],'UserId':null}})[_0x8601('0x33')](handleEntityNotFound(_0x3890c1,null))[_0x8601('0x33')](saveUpdates(_0x500b83[_0x8601('0x55')],null))[_0x8601('0x33')](function(_0x5e91f4){if(_0x5e91f4){_0x41d110['message']=_0x5e91f4['get']({'plain':!![]});return db[_0x8601('0x62')][_0x8601('0x54')]({'where':{'id':_0x5e91f4[_0x8601('0x63')]}});}return null;})[_0x8601('0x33')](handleEntityNotFound(_0x3890c1,null))[_0x8601('0x33')](function(_0x4647d1){if(_0x4647d1){return _0x4647d1[_0x8601('0x32')]({'UserId':_0x500b83[_0x8601('0x55')][_0x8601('0x60')],'read1stAt':_[_0x8601('0x64')](_0x4647d1[_0x8601('0x65')])?moment()['format'](_0x8601('0x5f')):undefined});}return null;})[_0x8601('0x33')](function(_0x33f554){if(_0x33f554){_0x41d110['interaction']=_0x33f554[_0x8601('0x66')]({'plain':!![]});interaction_log['info'](_0x8601('0x67'),_0x500b83['user']['id'],_0x500b83['user']['name'],_0x500b83['user'][_0x8601('0x68')],_0x41d110[_0x8601('0x69')]['id'],_0x500b83[_0x8601('0x55')]?JSON[_0x8601('0x6a')](_0x500b83[_0x8601('0x55')]):_0x8601('0x6b'));return respondWithRpcPromise(_0x8601('0x6c'),'acceptMessage',_0x41d110);}return null;})[_0x8601('0x33')](function(_0x646ae5){var _0x5230fe=_0x8601('0x6d')+_0x646ae5[_0x8601('0x23')][_0x8601('0x6e')];return db[_0x8601('0x6f')]['query'](_0x5230fe,{'type':db[_0x8601('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8601('0x33')](function(_0xddbfd0){return _0xddbfd0;});})[_0x8601('0x33')](function(_0x153837){if(_0x153837){_0x41d110[_0x8601('0x23')][_0x8601('0x71')]=_0x153837[0x0];if(!_0x500b83[_0x8601('0x55')]['UserId'])return;return db[_0x8601('0x72')]['find']({'where':{'id':_0x500b83['body'][_0x8601('0x60')],'role':_0x8601('0x73')},'attributes':['id',_0x8601('0x36'),_0x8601('0x74'),_0x8601('0x75'),_0x8601('0x76')],'raw':!![]});}return null;})[_0x8601('0x33')](function(_0x561ce2){if(!_0x561ce2)return null;_0x41d110[_0x8601('0x23')][_0x8601('0x73')]=_0x561ce2;return _0x41d110;})[_0x8601('0x33')](function(_0x3b948a){if(_0x3b948a){if(_0x500b83['body'][_0x8601('0x77')]){_0x41d110[_0x8601('0x23')][_0x8601('0x78')]=util[_0x8601('0x5e')](_0x8601('0x79'),_0x500b83[_0x8601('0x61')]['name']);_0x41d110[_0x8601('0x23')][_0x8601('0x7a')]=_0x41d110['channel'];_0x41d110['message'][_0x8601('0x7b')]=_0x41d110['channel'];_0x41d110['message'][_0x8601('0x7c')]=_0x8601('0x5a');return respondWithRpcPromise(_0x8601('0x7d'),_0x8601('0x7d'),{'event':_0x8601('0x7e'),'message':_0x41d110[_0x8601('0x23')]},client9002)[_0x8601('0x33')](function(){return _0x41d110;});}return _0x41d110;}return null;})[_0x8601('0x33')](respondWithResult(_0x3890c1,null))[_0x8601('0x25')](handleError(_0x3890c1,null));};var interaction_log=require(_0x8601('0x10'))('fax-interactions');exports[_0x8601('0x30')]=function(_0x477e22,_0x360ae9,_0x59e343){var _0x19c54e={'agent':{},'channel':_0x8601('0x5b')};if(_0x477e22[_0x8601('0x55')]['id']){delete _0x477e22['body']['id'];}_0x477e22['body'][_0x8601('0x60')]=_0x477e22[_0x8601('0x55')][_0x8601('0x60')]||_0x477e22['user']['id'];_0x19c54e[_0x8601('0x73')]['id']=_0x477e22[_0x8601('0x55')][_0x8601('0x60')];return db[_0x8601('0x4e')][_0x8601('0x54')]({'where':{'id':_0x477e22[_0x8601('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x360ae9,null))['then'](function(_0x1daa85){if(_0x1daa85){_0x19c54e['message']=_0x1daa85[_0x8601('0x66')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1daa85[_0x8601('0x63')]}});}return null;})[_0x8601('0x33')](handleEntityNotFound(_0x360ae9,null))[_0x8601('0x33')](function(_0x1775d0){if(_0x1775d0){_0x19c54e[_0x8601('0x69')]=_0x1775d0[_0x8601('0x66')]({'plain':!![]});interaction_log[_0x8601('0x1d')](_0x8601('0x7f'),_0x477e22[_0x8601('0x61')]['id'],_0x477e22[_0x8601('0x61')][_0x8601('0x36')],_0x477e22[_0x8601('0x61')]['role'],_0x19c54e[_0x8601('0x69')]['id'],_0x477e22['body']?JSON[_0x8601('0x6a')](_0x477e22[_0x8601('0x55')]):_0x8601('0x6b'));return respondWithRpcPromise(_0x8601('0x80'),_0x8601('0x81'),_0x19c54e);}return null;})[_0x8601('0x33')](function(_0x4a61b4){var _0x317afc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a61b4[_0x8601('0x23')]['ContactId'];return db[_0x8601('0x6f')][_0x8601('0x41')](_0x317afc,{'type':db[_0x8601('0x70')][_0x8601('0x82')][_0x8601('0x83')],'raw':!![]})['then'](function(_0x3c4586){return _0x3c4586;});})['then'](function(_0x4eb4f7){if(_0x4eb4f7){_0x19c54e['message']['contact']=_0x4eb4f7[0x0];if(!_0x477e22['body'][_0x8601('0x60')])return;return db[_0x8601('0x72')]['find']({'where':{'id':_0x477e22['body'][_0x8601('0x60')],'role':_0x8601('0x73')},'attributes':['id',_0x8601('0x36'),_0x8601('0x74'),'email',_0x8601('0x76')],'raw':!![]});}return null;})[_0x8601('0x33')](function(_0x37b172){if(!_0x37b172)return null;_0x19c54e['message'][_0x8601('0x73')]=_0x37b172;return _0x19c54e;})['then'](function(_0x13752b){if(_0x13752b){_0x13752b[_0x8601('0x23')]['interface']=util[_0x8601('0x5e')]('SIP/%s',_0x477e22['user']['name']);_0x13752b[_0x8601('0x23')][_0x8601('0x7a')]=_0x19c54e['channel'];_0x13752b[_0x8601('0x23')][_0x8601('0x7b')]=_0x19c54e[_0x8601('0x7a')];_0x13752b[_0x8601('0x23')][_0x8601('0x7c')]=_0x8601('0x30');respondWithRpcPromise('EventManager',_0x8601('0x7d'),{'event':_0x8601('0x84'),'message':_0x13752b[_0x8601('0x23')]},client9002);return _0x19c54e;}return null;})[_0x8601('0x33')](respondWithResult(_0x360ae9,null))[_0x8601('0x25')](handleError(_0x360ae9,null));};exports[_0x8601('0x85')]=function(_0x465688,_0x5beac2){var _0x12ae7d;return db[_0x8601('0x4e')][_0x8601('0x85')](_0x465688[_0x8601('0x55')],{})[_0x8601('0x33')](function(_0x5b67a6){_0x12ae7d=_0x5b67a6;return db[_0x8601('0x86')]['findOne']({'where':{'id':_0x12ae7d[_0x8601('0x6e')]}});})['then'](function(_0x57cdc6){if(_[_0x8601('0x64')](_0x57cdc6)){return;}else{_0x12ae7d['fax']=_0x57cdc6['fax'];return db[_0x8601('0x87')][_0x8601('0x88')]({'where':{'id':_0x12ae7d[_0x8601('0x89')]}});}})[_0x8601('0x33')](function(_0x43e38a){return respondWithRpcPromise(_0x8601('0x8a'),'SendFax',{'FaxAccountId':_['isNil'](_0x465688[_0x8601('0x55')])?undefined:_0x465688[_0x8601('0x55')][_0x8601('0x8b')],'path':_[_0x8601('0x64')](_0x43e38a)?undefined:util[_0x8601('0x5e')](_0x8601('0x8c'),_0x43e38a['basename']),'fax':_[_0x8601('0x64')](_0x12ae7d[_0x8601('0x5b')])?undefined:_0x12ae7d[_0x8601('0x5b')],'AttachmentId':_0x12ae7d[_0x8601('0x89')]},client9002);})[_0x8601('0x33')](respondWithResult(_0x5beac2,0xc9))['catch'](handleError(_0x5beac2,null));};exports[_0x8601('0x8d')]=function(_0x3609f0,_0x186272){var _0x39d629=path[_0x8601('0x8e')](config[_0x8601('0x8f')],_0x8601('0x90'),_0x8601('0x91'),_0x8601('0x92'));return db['FaxMessage']['find']({'where':{'id':_0x3609f0[_0x8601('0x57')]['id']},'include':[{'model':db[_0x8601('0x87')],'as':_0x8601('0x87')}]})[_0x8601('0x33')](handleEntityNotFound(_0x186272,null))[_0x8601('0x33')](function(_0x15b6aa){if(_0x15b6aa){return _0x186272['download'](path[_0x8601('0x8e')](_0x39d629,_0x15b6aa[_0x8601('0x87')][_0x8601('0x93')]));}})[_0x8601('0x25')](handleError(_0x186272,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 08cfe4f..e1d56eb 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 _0x2c8f=['../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x49a4b5,_0x420d0c){var _0x343547=function(_0xdd6b78){while(--_0xdd6b78){_0x49a4b5['push'](_0x49a4b5['shift']());}};_0x343547(++_0x420d0c);}(_0x2c8f,0x192));var _0xf2c8=function(_0x15eb28,_0x28248f){_0x15eb28=_0x15eb28-0x0;var _0x46076e=_0x2c8f[_0x15eb28];return _0x46076e;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf2c8('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2c8('0x1'),'afterDestroy':_0xf2c8('0x2')};function emitEvent(_0x3eb15b){return function(_0x56296e,_0x5e4234,_0x2581a1){FaxMessageEvents[_0xf2c8('0x3')](_0x3eb15b+':'+_0x56296e['id'],_0x56296e);FaxMessageEvents[_0xf2c8('0x3')](_0x3eb15b,_0x56296e);_0x2581a1(null);};}for(var e in events){if(events[_0xf2c8('0x4')](e)){var event=events[e];FaxMessage[_0xf2c8('0x5')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x1967=['exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5a669d,_0x5eb784){var _0x4af8a8=function(_0x310c99){while(--_0x310c99){_0x5a669d['push'](_0x5a669d['shift']());}};_0x4af8a8(++_0x5eb784);}(_0x1967,0x173));var _0x7196=function(_0x108bf5,_0x5d2e03){_0x108bf5=_0x108bf5-0x0;var _0x4c7418=_0x1967[_0x108bf5];return _0x4c7418;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7196('0x0'))['db'][_0x7196('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7196('0x2')](0x0);var events={'afterCreate':_0x7196('0x3'),'afterUpdate':_0x7196('0x4'),'afterDestroy':_0x7196('0x5')};function emitEvent(_0x302f34){return function(_0x1aaddd,_0x458ae8,_0x3ae43f){FaxMessageEvents['emit'](_0x302f34+':'+_0x1aaddd['id'],_0x1aaddd);FaxMessageEvents[_0x7196('0x6')](_0x302f34,_0x1aaddd);_0x3ae43f(null);};}for(var e in events){if(events[_0x7196('0x7')](e)){var event=events[e];FaxMessage[_0x7196('0x8')](e,emitEvent(event));}}module[_0x7196('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index bb2fc08..70c1069 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 _0x31c2=['path','rimraf','../../config/environment','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','direction','out','isNil','UserId','FaxInteractionId','update','createdAt','toLowerCase','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x31c2,0xa2));var _0x231c=function(_0x3cce0c,_0xa5044f){_0x3cce0c=_0x3cce0c-0x0;var _0x10e5cc=_0x31c2[_0x3cce0c];return _0x10e5cc;};'use strict';var _=require(_0x231c('0x0'));var util=require('util');var logger=require(_0x231c('0x1'))(_0x231c('0x2'));var moment=require(_0x231c('0x3'));var BPromise=require(_0x231c('0x4'));var rp=require(_0x231c('0x5'));var fs=require('fs');var path=require(_0x231c('0x6'));var rimraf=require(_0x231c('0x7'));var config=require(_0x231c('0x8'));var attributes=require('./faxMessage.attributes');module[_0x231c('0x9')]=function(_0x364e24,_0x20cae7){return _0x364e24['define'](_0x231c('0xa'),attributes,{'tableName':_0x231c('0xb'),'paranoid':![],'indexes':[{'name':_0x231c('0xc'),'fields':[_0x231c('0xd')],'type':_0x231c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe9f624,_0x4cfc7f,_0x3773ef){var _0x3f24c1=_0x364e24['models'];var _0x2a164d=_0xe9f624['get']({'plain':!![]});if(_0x2a164d[_0x231c('0xf')]['toLowerCase']()==='in'||_0x2a164d[_0x231c('0xf')]['toLowerCase']()===_0x231c('0x10')&&!_0x2a164d['secret']&&!_[_0x231c('0x11')](_0x2a164d[_0x231c('0x12')])){_0x3f24c1['FaxInteraction']['findOne']({'where':{'id':_0x2a164d[_0x231c('0x13')]}})['then'](function(_0x22ab7d){if(_0x22ab7d){_0x22ab7d[_0x231c('0x14')]({'lastMsgAt':_0x2a164d[_0x231c('0x15')],'lastMsgDirection':_0x2a164d['direction'][_0x231c('0x16')]()});}})['catch'](function(_0x509632){console['error'](_0x509632);});}_0x3773ef();}},'charset':'utf8mb4','collate':_0x231c('0x17')});}; \ No newline at end of file +var _0xe1e8=['createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','../../config/environment','exports','define','FaxMessage','fax_messages','body','models','get','toLowerCase','out','secret','isNil','UserId','FaxInteraction','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1e8,0xe7));var _0x8e1e=function(_0x52a7c1,_0x5a8e1b){_0x52a7c1=_0x52a7c1-0x0;var _0x2aa022=_0xe1e8[_0x52a7c1];return _0x2aa022;};'use strict';var _=require(_0x8e1e('0x0'));var util=require(_0x8e1e('0x1'));var logger=require(_0x8e1e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e1e('0x4'));var attributes=require('./faxMessage.attributes');module[_0x8e1e('0x5')]=function(_0x4c2863,_0x3d65bb){return _0x4c2863[_0x8e1e('0x6')](_0x8e1e('0x7'),attributes,{'tableName':_0x8e1e('0x8'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x8e1e('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a59ad,_0x2d02e4,_0x3a22f4){var _0x5a0ad2=_0x4c2863[_0x8e1e('0xa')];var _0x5707ee=_0x5a59ad[_0x8e1e('0xb')]({'plain':!![]});if(_0x5707ee['direction'][_0x8e1e('0xc')]()==='in'||_0x5707ee['direction'][_0x8e1e('0xc')]()===_0x8e1e('0xd')&&!_0x5707ee[_0x8e1e('0xe')]&&!_[_0x8e1e('0xf')](_0x5707ee[_0x8e1e('0x10')])){_0x5a0ad2[_0x8e1e('0x11')]['findOne']({'where':{'id':_0x5707ee['FaxInteractionId']}})['then'](function(_0x70ab47){if(_0x70ab47){_0x70ab47[_0x8e1e('0x12')]({'lastMsgAt':_0x5707ee[_0x8e1e('0x13')],'lastMsgDirection':_0x5707ee[_0x8e1e('0x14')][_0x8e1e('0xc')]()});}})[_0x8e1e('0x15')](function(_0x1b2885){console[_0x8e1e('0x16')](_0x1b2885);});}_0x3a22f4();}},'charset':_0x8e1e('0x17'),'collate':_0x8e1e('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 8a9179d..bfc95a2 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x1303fd,_0xaf6226){var _0x2c90fe=function(_0x408065){while(--_0x408065){_0x1303fd['push'](_0x1303fd['shift']());}};_0x2c90fe(++_0xaf6226);}(_0x668b,0x140));var _0xb668=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0x668b[_0x39ea42];return _0x33f5b7;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});}; \ No newline at end of file +var _0x0e85=['catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result'];(function(_0xcacba6,_0x1aa886){var _0x30c8fb=function(_0x3d92cd){while(--_0x3d92cd){_0xcacba6['push'](_0xcacba6['shift']());}};_0x30c8fb(++_0x1aa886);}(_0x0e85,0x7c));var _0x50e8=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x0e85[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});config['redis']=_[_0x50e8('0x9')](config[_0x50e8('0xa')],{'host':_0x50e8('0xb'),'port':0x18eb});var socket=require(_0x50e8('0xc'))(new Redis(config[_0x50e8('0xa')]));require(_0x50e8('0xd'))['register'](socket);function respondWithRpcPromise(_0x11717c,_0x228ed1,_0x19d1bc){return new BPromise(function(_0x2d4750,_0x154b9e){return client[_0x50e8('0xe')](_0x11717c,_0x19d1bc)[_0x50e8('0xf')](function(_0x3d25ea){logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));logger[_0x50e8('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x228ed1,'request\x20sent',JSON[_0x50e8('0x12')](_0x3d25ea));if(_0x3d25ea[_0x50e8('0x13')]){if(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x14')]===0x1f4){logger['error'](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x154b9e(_0x3d25ea['error']['message']);}logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);return _0x2d4750(_0x3d25ea[_0x50e8('0x13')][_0x50e8('0x16')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x228ed1,_0x50e8('0x10'));_0x2d4750(_0x3d25ea[_0x50e8('0x17')][_0x50e8('0x16')]);}})[_0x50e8('0x18')](function(_0x5dae4e){logger[_0x50e8('0x13')](_0x50e8('0x15'),_0x228ed1,_0x5dae4e);_0x154b9e(_0x5dae4e);});});}exports['CreateFaxMessage']=function(_0x415596){var _0x55997c=this;return new Promise(function(_0x4d2318,_0xe04a5c){return db[_0x50e8('0x19')][_0x50e8('0x1a')](_0x415596[_0x50e8('0x1b')],{'raw':_0x415596['options']?_0x415596[_0x50e8('0x1c')][_0x50e8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x31d23c){logger[_0x50e8('0x1e')]('CreateFaxMessage',_0x415596);logger[_0x50e8('0x11')](_0x50e8('0x1f'),_0x415596,JSON['stringify'](_0x31d23c));_0x4d2318(_0x31d23c);})['catch'](function(_0x59582d){logger[_0x50e8('0x13')](_0x50e8('0x1f'),_0x59582d[_0x50e8('0x16')],_0x415596);_0xe04a5c(_0x55997c[_0x50e8('0x13')](0x1f4,_0x59582d[_0x50e8('0x16')]));});});};exports[_0x50e8('0x20')]=function(_0x53d848){var _0x3a6442=this;return new Promise(function(_0x396611,_0x4b3a09){return db[_0x50e8('0x19')][_0x50e8('0x21')](_0x53d848[_0x50e8('0x1b')],{'raw':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53d848['options']?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x22')]||null:null,'attributes':_0x53d848[_0x50e8('0x1c')]?_0x53d848['options'][_0x50e8('0x23')]||null:null,'limit':_0x53d848[_0x50e8('0x1c')]?_0x53d848[_0x50e8('0x1c')][_0x50e8('0x24')]||null:null})[_0x50e8('0xf')](function(_0x18aa31){logger[_0x50e8('0x1e')]('UpdateFaxMessage',_0x53d848);logger[_0x50e8('0x11')](_0x50e8('0x20'),_0x53d848,JSON['stringify'](_0x18aa31));_0x396611(_0x18aa31);})['catch'](function(_0x329b9c){logger[_0x50e8('0x13')](_0x50e8('0x20'),_0x329b9c['message'],_0x53d848);_0x4b3a09(_0x3a6442['error'](0x1f4,_0x329b9c[_0x50e8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 4567933..e81e4dc 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 _0x51dc=['update','length','faxMessage:','./faxMessage.events','remove'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x51dc,0x12a));var _0xc51d=function(_0x3fb40e,_0x1a6bf7){_0x3fb40e=_0x3fb40e-0x0;var _0x56c5c8=_0x51dc[_0x3fb40e];return _0x56c5c8;};'use strict';var FaxMessageEvents=require(_0xc51d('0x0'));var events=['save',_0xc51d('0x1'),_0xc51d('0x2')];function createListener(_0x126185,_0x453a89){return function(_0x300a78){_0x453a89['emit'](_0x126185,_0x300a78);};}function removeListener(_0x56e0da,_0x4ba01a){return function(){FaxMessageEvents['removeListener'](_0x56e0da,_0x4ba01a);};}exports['register']=function(_0x3cbeb1){for(var _0x108928=0x0,_0x402e59=events[_0xc51d('0x3')];_0x108928<_0x402e59;_0x108928++){var _0x56a5cf=events[_0x108928];var _0x5ecf5f=createListener(_0xc51d('0x4')+_0x56a5cf,_0x3cbeb1);FaxMessageEvents['on'](_0x56a5cf,_0x5ecf5f);}}; \ No newline at end of file +var _0xb3aa=['remove','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb3aa,0x71));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var FaxMessageEvents=require(_0xab3a('0x0'));var events=['save',_0xab3a('0x1'),'update'];function createListener(_0x299c28,_0x2e9d61){return function(_0x49c40f){_0x2e9d61[_0xab3a('0x2')](_0x299c28,_0x49c40f);};}function removeListener(_0x5db2ff,_0x2467e3){return function(){FaxMessageEvents[_0xab3a('0x3')](_0x5db2ff,_0x2467e3);};}exports[_0xab3a('0x4')]=function(_0x5602fb){for(var _0x4e90f0=0x0,_0x256634=events['length'];_0x4e90f0<_0x256634;_0x4e90f0++){var _0x10fb07=events[_0x4e90f0];var _0x17856e=createListener(_0xab3a('0x5')+_0x10fb07,_0x5602fb);FaxMessageEvents['on'](_0x10fb07,_0x17856e);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a4ba888..14f0244 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 _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x3a8735,_0x30687c){var _0xecd0c3=function(_0x269028){while(--_0x269028){_0x3a8735['push'](_0x3a8735['shift']());}};_0xecd0c3(++_0x30687c);}(_0xca66,0x8b));var _0x6ca6=function(_0x3b41f2,_0x4b1c71){_0x3b41f2=_0x3b41f2-0x0;var _0x39ba6c=_0xca66[_0x3b41f2];return _0x39ba6c;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file +var _0xf4eb=['/:id/accept','accept','/:id/reject','delete','exports','multer','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','tracked','faxmessage:create','create','put'];(function(_0xd6667d,_0x406fd3){var _0x247e8f=function(_0x23dad4){while(--_0x23dad4){_0xd6667d['push'](_0xd6667d['shift']());}};_0x247e8f(++_0x406fd3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x250862,_0x4c5318){_0x250862=_0x250862-0x0;var _0x1c8341=_0xf4eb[_0x250862];return _0x1c8341;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xbf4e('0xc')]('fax',_0xbf4e('0xd')),controller[_0xbf4e('0xe')]);router['put'](_0xbf4e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);router[_0xbf4e('0xf')](_0xbf4e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xbf4e('0x13')](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1e7c646..990a780 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 _0xe353=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe353,0xdc));var _0x3e35=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe353[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require('sequelize');module[_0x3e35('0x0')]={'name':{'type':Sequelize[_0x3e35('0x1')],'unique':_0x3e35('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e35('0x1')]},'timeout':{'type':Sequelize[_0x3e35('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e35('0x4')](_0x3e35('0x5'),_0x3e35('0x6'),_0x3e35('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3e35('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe75e=['INTEGER','sequelize','exports','STRING','name','rrmemory','beepall'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0xe75e,0x15f));var _0xee75=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xe75e[_0x416cdc];return _0x1931ce;};'use strict';var Sequelize=require(_0xee75('0x0'));module[_0xee75('0x1')]={'name':{'type':Sequelize[_0xee75('0x2')],'unique':_0xee75('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xee75('0x4'),_0xee75('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xee75('0x6')],'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 215c4df..bee5ca8 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 _0xdec8=['model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','describe','findOne','UserFaxQueue','FaxQueueId','filter','options','User','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','SELECT','TeamId','includes','all','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','FaxQueue','rawAttributes','fieldName','type'];(function(_0x451b89,_0x58233d){var _0x18bd30=function(_0x221d16){while(--_0x221d16){_0x451b89['push'](_0x451b89['shift']());}};_0x18bd30(++_0x58233d);}(_0xdec8,0x15e));var _0x8dec=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xdec8[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0x8dec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dec('0x2'));var moment=require(_0x8dec('0x3'));var BPromise=require(_0x8dec('0x4'));var Mustache=require(_0x8dec('0x5'));var util=require(_0x8dec('0x6'));var path=require(_0x8dec('0x7'));var sox=require(_0x8dec('0x8'));var csv=require(_0x8dec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dec('0xa'));var _=require(_0x8dec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8dec('0x9'));var querystring=require(_0x8dec('0xc'));var Papa=require(_0x8dec('0xd'));var Redis=require(_0x8dec('0xe'));var authService=require(_0x8dec('0xf'));var qs=require(_0x8dec('0x10'));var as=require(_0x8dec('0x11'));var hardwareService=require(_0x8dec('0x12'));var logger=require(_0x8dec('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8dec('0x14'));var licenseUtil=require(_0x8dec('0x15'));var db=require(_0x8dec('0x16'))['db'];config['redis']=_['defaults'](config[_0x8dec('0x17')],{'host':_0x8dec('0x18'),'port':0x18eb});var socket=require(_0x8dec('0x19'))(new Redis(config[_0x8dec('0x17')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x19c7f9,_0x105cb9){_0x105cb9=_0x105cb9||0xcc;return function(_0x4cb795){if(_0x4cb795){return _0x19c7f9[_0x8dec('0x1a')](_0x105cb9);}return _0x19c7f9[_0x8dec('0x1b')](_0x105cb9)[_0x8dec('0x1c')]();};}function respondWithResult(_0x8512fe,_0x1930f9){_0x1930f9=_0x1930f9||0xc8;return function(_0x1fbc31){if(_0x1fbc31){return _0x8512fe[_0x8dec('0x1b')](_0x1930f9)[_0x8dec('0x1d')](_0x1fbc31);}};}function respondWithFilteredResult(_0x5e4823,_0x145ce4){return function(_0x2a2c9f){if(_0x2a2c9f){var _0x378bcb=typeof _0x145ce4[_0x8dec('0x1e')]===_0x8dec('0x1f')&&typeof _0x145ce4['limit']==='undefined';var _0x34e543=_0x2a2c9f[_0x8dec('0x20')];var _0x3234cb=_0x378bcb?0x0:_0x145ce4[_0x8dec('0x1e')];var _0x5bd2e6=_0x378bcb?_0x2a2c9f[_0x8dec('0x20')]:_0x145ce4[_0x8dec('0x1e')]+_0x145ce4[_0x8dec('0x21')];var _0x5215f8;if(_0x5bd2e6>=_0x34e543){_0x5bd2e6=_0x34e543;_0x5215f8=0xc8;}else{_0x5215f8=0xce;}_0x5e4823[_0x8dec('0x1b')](_0x5215f8);return _0x5e4823[_0x8dec('0x22')](_0x8dec('0x23'),_0x3234cb+'-'+_0x5bd2e6+'/'+_0x34e543)[_0x8dec('0x1d')](_0x2a2c9f);}return null;};}function patchUpdates(_0x375948){return function(_0x449ca8){try{jsonpatch[_0x8dec('0x24')](_0x449ca8,_0x375948,!![]);}catch(_0x742c82){return BPromise['reject'](_0x742c82);}return _0x449ca8[_0x8dec('0x25')]();};}function saveUpdates(_0x43a70f,_0x4149b2){return function(_0x1650b0){if(_0x1650b0){return _0x1650b0[_0x8dec('0x26')](_0x43a70f)['then'](function(_0x136abd){return _0x136abd;});}return null;};}function removeEntity(_0x2709d5,_0x177661){return function(_0x365c79){if(_0x365c79){return _0x365c79['destroy']()[_0x8dec('0x27')](function(){var _0x338dd6=_0x365c79[_0x8dec('0x28')]({'plain':!![]});var _0x486755=_0x8dec('0x29');return db[_0x8dec('0x2a')][_0x8dec('0x2b')]({'where':{'type':_0x486755,'resourceId':_0x338dd6['id']}})[_0x8dec('0x27')](function(){return _0x365c79;});})[_0x8dec('0x27')](function(){_0x2709d5[_0x8dec('0x1b')](0xcc)[_0x8dec('0x1c')]();});}};}function handleEntityNotFound(_0x47680e,_0x3f68e8){return function(_0x5eb940){if(!_0x5eb940){_0x47680e[_0x8dec('0x1a')](0x194);}return _0x5eb940;};}function handleError(_0x44f40d,_0x2a67ee){_0x2a67ee=_0x2a67ee||0x1f4;return function(_0x58cbfd){logger[_0x8dec('0x2c')](_0x58cbfd[_0x8dec('0x2d')]);if(_0x58cbfd[_0x8dec('0x2e')]){delete _0x58cbfd[_0x8dec('0x2e')];}_0x44f40d[_0x8dec('0x1b')](_0x2a67ee)[_0x8dec('0x2f')](_0x58cbfd);};}exports['index']=function(_0x41d34b,_0x2b7f80){var _0x579a49={},_0x33f74b={},_0x20f391={'count':0x0,'rows':[]};var _0x3b5e4f=_['map'](db[_0x8dec('0x30')][_0x8dec('0x31')],function(_0x5b1406){return{'name':_0x5b1406[_0x8dec('0x32')],'type':_0x5b1406[_0x8dec('0x33')]['key']};});_0x33f74b[_0x8dec('0x34')]=_[_0x8dec('0x35')](_0x3b5e4f,_0x8dec('0x2e'));_0x33f74b['query']=_[_0x8dec('0x36')](_0x41d34b[_0x8dec('0x37')]);_0x33f74b['filters']=_[_0x8dec('0x38')](_0x33f74b['model'],_0x33f74b[_0x8dec('0x37')]);_0x579a49['attributes']=_['intersection'](_0x33f74b[_0x8dec('0x34')],qs[_0x8dec('0x39')](_0x41d34b['query'][_0x8dec('0x39')]));_0x579a49[_0x8dec('0x3a')]=_0x579a49[_0x8dec('0x3a')][_0x8dec('0x3b')]?_0x579a49[_0x8dec('0x3a')]:_0x33f74b[_0x8dec('0x34')];if(!_0x41d34b[_0x8dec('0x37')][_0x8dec('0x3c')](_0x8dec('0x3d'))){_0x579a49[_0x8dec('0x21')]=qs[_0x8dec('0x21')](_0x41d34b[_0x8dec('0x37')]['limit']);_0x579a49[_0x8dec('0x1e')]=qs[_0x8dec('0x1e')](_0x41d34b[_0x8dec('0x37')][_0x8dec('0x1e')]);}_0x579a49[_0x8dec('0x3e')]=qs['sort'](_0x41d34b['query'][_0x8dec('0x3f')]);_0x579a49[_0x8dec('0x40')]=qs[_0x8dec('0x41')](_[_0x8dec('0x42')](_0x41d34b[_0x8dec('0x37')],_0x33f74b[_0x8dec('0x41')]),_0x3b5e4f);if(_0x41d34b[_0x8dec('0x37')]['filter']){_0x579a49[_0x8dec('0x40')]=_[_0x8dec('0x43')](_0x579a49[_0x8dec('0x40')],{'$or':_[_0x8dec('0x35')](_0x3b5e4f,function(_0x446b1d){if(_0x446b1d[_0x8dec('0x33')]!=='VIRTUAL'){var _0xe7d531={};_0xe7d531[_0x446b1d['name']]={'$like':'%'+_0x41d34b[_0x8dec('0x37')]['filter']+'%'};return _0xe7d531;}})});}_0x579a49=_[_0x8dec('0x43')]({},_0x579a49,_0x41d34b['options']);var _0x147c21={'where':_0x579a49['where']};return db[_0x8dec('0x30')][_0x8dec('0x20')](_0x147c21)[_0x8dec('0x27')](function(_0x29eb5d){_0x20f391[_0x8dec('0x20')]=_0x29eb5d;if(_0x41d34b[_0x8dec('0x37')][_0x8dec('0x44')]){_0x579a49[_0x8dec('0x45')]=[{'all':!![]}];}return db[_0x8dec('0x30')][_0x8dec('0x46')](_0x579a49);})['then'](function(_0x3b8225){_0x20f391['rows']=_0x3b8225;return _0x20f391;})['then'](respondWithFilteredResult(_0x2b7f80,_0x579a49))[_0x8dec('0x47')](handleError(_0x2b7f80,null));};exports[_0x8dec('0x48')]=function(_0xa9c6c9,_0x39c7fd){var _0x5a1861={'raw':!![],'where':{'id':_0xa9c6c9['params']['id']}},_0xdb3468={};_0xdb3468[_0x8dec('0x34')]=_[_0x8dec('0x36')](db['FaxQueue'][_0x8dec('0x31')]);_0xdb3468[_0x8dec('0x37')]=_[_0x8dec('0x36')](_0xa9c6c9[_0x8dec('0x37')]);_0xdb3468[_0x8dec('0x41')]=_['intersection'](_0xdb3468[_0x8dec('0x34')],_0xdb3468[_0x8dec('0x37')]);_0x5a1861[_0x8dec('0x3a')]=_[_0x8dec('0x38')](_0xdb3468['model'],qs[_0x8dec('0x39')](_0xa9c6c9['query'][_0x8dec('0x39')]));_0x5a1861[_0x8dec('0x3a')]=_0x5a1861[_0x8dec('0x3a')][_0x8dec('0x3b')]?_0x5a1861[_0x8dec('0x3a')]:_0xdb3468[_0x8dec('0x34')];if(_0xa9c6c9[_0x8dec('0x37')]['includeAll']){_0x5a1861[_0x8dec('0x45')]=[{'all':!![]}];}_0x5a1861=_[_0x8dec('0x43')]({},_0x5a1861,_0xa9c6c9['options']);return db['FaxQueue'][_0x8dec('0x49')](_0x5a1861)[_0x8dec('0x27')](handleEntityNotFound(_0x39c7fd,null))[_0x8dec('0x27')](respondWithResult(_0x39c7fd,null))[_0x8dec('0x47')](handleError(_0x39c7fd,null));};exports[_0x8dec('0x4a')]=function(_0x58e6d3,_0x4379a7){return db[_0x8dec('0x30')][_0x8dec('0x4a')](_0x58e6d3[_0x8dec('0x4b')],{})[_0x8dec('0x27')](function(_0x582c83){var _0x1dc240=_0x58e6d3[_0x8dec('0x4c')][_0x8dec('0x28')]({'plain':!![]});if(!_0x1dc240)throw new Error(_0x8dec('0x4d'));if(_0x1dc240[_0x8dec('0x4e')]==='user'){var _0x1f942c=_0x582c83[_0x8dec('0x28')]({'plain':!![]});var _0x1dba0f='FaxQueues';return db[_0x8dec('0x4f')][_0x8dec('0x49')]({'where':{'name':_0x1dba0f,'userProfileId':_0x1dc240['userProfileId']},'raw':!![]})[_0x8dec('0x27')](function(_0xc37698){if(_0xc37698&&_0xc37698[_0x8dec('0x50')]===0x0){return db[_0x8dec('0x2a')][_0x8dec('0x4a')]({'name':_0x1f942c[_0x8dec('0x2e')],'resourceId':_0x1f942c['id'],'type':_0xc37698[_0x8dec('0x2e')],'sectionId':_0xc37698['id']},{})['then'](function(){return _0x582c83;});}else{return _0x582c83;}})[_0x8dec('0x47')](function(_0x51a32f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51a32f);throw _0x51a32f;});}return _0x582c83;})['then'](respondWithResult(_0x4379a7,0xc9))['catch'](handleError(_0x4379a7,null));};exports[_0x8dec('0x26')]=function(_0x2e2580,_0x591d04){if(_0x2e2580[_0x8dec('0x4b')]['id']){delete _0x2e2580['body']['id'];}return db[_0x8dec('0x30')]['find']({'where':{'id':_0x2e2580[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x591d04,null))[_0x8dec('0x27')](saveUpdates(_0x2e2580[_0x8dec('0x4b')],null))[_0x8dec('0x27')](respondWithResult(_0x591d04,null))['catch'](handleError(_0x591d04,null));};exports[_0x8dec('0x2b')]=function(_0x25032f,_0x2a3208){return db[_0x8dec('0x30')][_0x8dec('0x49')]({'where':{'id':_0x25032f[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x2a3208,null))[_0x8dec('0x27')](removeEntity(_0x2a3208,null))[_0x8dec('0x47')](handleError(_0x2a3208,null));};exports[_0x8dec('0x52')]=function(_0x39b27a,_0x58a787){return db[_0x8dec('0x30')][_0x8dec('0x52')]()[_0x8dec('0x27')](respondWithResult(_0x58a787,null))[_0x8dec('0x47')](handleError(_0x58a787,null));};exports['getMembers']=function(_0x53543f,_0x305c82,_0x568547){var _0x171038={'raw':!![],'where':{}},_0x3b7163={},_0x3bf302;return db[_0x8dec('0x30')][_0x8dec('0x53')]({'where':{'id':_0x53543f[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x305c82,null))[_0x8dec('0x27')](function(_0xac6f72){if(_0xac6f72){_0x3bf302=_0xac6f72[_0x8dec('0x28')]({'plain':!![]});_0x3b7163['model']=_['keys'](db[_0x8dec('0x54')][_0x8dec('0x31')]);_0x3b7163[_0x8dec('0x37')]=_[_0x8dec('0x36')](_0x53543f[_0x8dec('0x37')]);_0x3b7163['filters']=_[_0x8dec('0x38')](_0x3b7163[_0x8dec('0x34')],_0x3b7163[_0x8dec('0x37')]);_0x171038[_0x8dec('0x3a')]=_[_0x8dec('0x38')](_0x3b7163[_0x8dec('0x34')],qs[_0x8dec('0x39')](_0x53543f['query'][_0x8dec('0x39')]));_0x171038[_0x8dec('0x3a')]=_0x171038[_0x8dec('0x3a')][_0x8dec('0x3b')]?_0x171038['attributes']:_0x3b7163['model'];if(!_0x53543f[_0x8dec('0x37')][_0x8dec('0x3c')](_0x8dec('0x3d'))){_0x171038[_0x8dec('0x21')]=qs[_0x8dec('0x21')](_0x53543f[_0x8dec('0x37')][_0x8dec('0x21')]);_0x171038[_0x8dec('0x1e')]=qs[_0x8dec('0x1e')](_0x53543f[_0x8dec('0x37')][_0x8dec('0x1e')]);}_0x171038['order']=qs[_0x8dec('0x3f')](_0x53543f['query'][_0x8dec('0x3f')]);_0x171038['where']=qs[_0x8dec('0x41')](_[_0x8dec('0x42')](_0x53543f[_0x8dec('0x37')],_0x3b7163[_0x8dec('0x41')]));_0x171038['where'][_0x8dec('0x55')]=_0xac6f72['id'];if(_0x53543f[_0x8dec('0x37')][_0x8dec('0x56')]){_0x171038[_0x8dec('0x40')]=_[_0x8dec('0x43')](_0x171038[_0x8dec('0x40')],{'$or':_['map'](_0x171038['attributes'],function(_0x2f06cd){var _0x271f8a={};_0x271f8a[_0x2f06cd]={'$like':'%'+_0x53543f['query'][_0x8dec('0x56')]+'%'};return _0x271f8a;})});}_0x171038=_['merge']({},_0x171038,_0x53543f[_0x8dec('0x57')]);return db[_0x8dec('0x54')][_0x8dec('0x46')](_0x171038);}})[_0x8dec('0x27')](function(_0x5ef57b){if(_0x5ef57b){return db[_0x8dec('0x58')][_0x8dec('0x59')]({'where':{'id':_[_0x8dec('0x35')](_0x5ef57b,_0x8dec('0x5a')),'role':_0x8dec('0x5b')},'attributes':['id',_0x8dec('0x2e'),_0x8dec('0x5c'),_0x8dec('0x5d'),'createdAt']});}})[_0x8dec('0x27')](function(_0x4eb792){if(_0x4eb792){return{'count':_0x4eb792[_0x8dec('0x20')],'rows':_[_0x8dec('0x35')](_0x4eb792[_0x8dec('0x5e')],function(_0x5b99d2){return{'membername':_0x5b99d2[_0x8dec('0x2e')],'UserId':_0x5b99d2['id'],'queue_name':_0x3bf302[_0x8dec('0x2e')],'FaxQueueId':_0x3bf302['id'],'interface':util[_0x8dec('0x5f')](_0x8dec('0x60'),'SIP',_0x5b99d2[_0x8dec('0x2e')]),'penalty':0x0,'paused':_0x5b99d2[_0x8dec('0x5c')],'createdAt':_0x5b99d2['createdAt'],'updatedAt':_0x5b99d2[_0x8dec('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8dec('0x27')](respondWithFilteredResult(_0x305c82,_0x171038))[_0x8dec('0x47')](handleError(_0x305c82,null));};exports[_0x8dec('0x61')]=function(_0x2e918d,_0x56c307,_0x3bc73d){var _0x2d4896={};var _0x3a3f7c={};var _0x144d51;var _0x4e7ca6;return db[_0x8dec('0x30')][_0x8dec('0x53')]({'where':{'id':_0x2e918d[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x56c307,null))[_0x8dec('0x27')](function(_0x39b7e){if(_0x39b7e){_0x144d51=_0x39b7e;_0x3a3f7c[_0x8dec('0x34')]=_[_0x8dec('0x36')](db[_0x8dec('0x62')][_0x8dec('0x31')]);_0x3a3f7c[_0x8dec('0x37')]=_[_0x8dec('0x36')](_0x2e918d[_0x8dec('0x37')]);_0x3a3f7c[_0x8dec('0x41')]=_[_0x8dec('0x38')](_0x3a3f7c[_0x8dec('0x34')],_0x3a3f7c[_0x8dec('0x37')]);_0x2d4896['attributes']=_[_0x8dec('0x38')](_0x3a3f7c['model'],qs['fields'](_0x2e918d['query'][_0x8dec('0x39')]));_0x2d4896['attributes']=_0x2d4896[_0x8dec('0x3a')][_0x8dec('0x3b')]?_0x2d4896['attributes']:_0x3a3f7c[_0x8dec('0x34')];_0x2d4896[_0x8dec('0x3e')]=qs[_0x8dec('0x3f')](_0x2e918d['query']['sort']);_0x2d4896[_0x8dec('0x40')]=qs['filters'](_[_0x8dec('0x42')](_0x2e918d[_0x8dec('0x37')],_0x3a3f7c['filters']));if(_0x2e918d['query'][_0x8dec('0x56')]){_0x2d4896[_0x8dec('0x40')]=_[_0x8dec('0x43')](_0x2d4896[_0x8dec('0x40')],{'$or':_[_0x8dec('0x35')](_0x2d4896[_0x8dec('0x3a')],function(_0x11783a){var _0x160bf0={};_0x160bf0[_0x11783a]={'$like':'%'+_0x2e918d[_0x8dec('0x37')][_0x8dec('0x56')]+'%'};return _0x160bf0;})});}_0x2d4896=_[_0x8dec('0x43')]({},_0x2d4896,_0x2e918d['options']);return _0x144d51['getTeams'](_0x2d4896);}})['then'](function(_0x341ae5){if(_0x341ae5){_0x4e7ca6=_0x341ae5['length'];if(!_0x2e918d['query'][_0x8dec('0x3c')]('nolimit')){_0x2d4896[_0x8dec('0x21')]=qs[_0x8dec('0x21')](_0x2e918d[_0x8dec('0x37')][_0x8dec('0x21')]);_0x2d4896['offset']=qs[_0x8dec('0x1e')](_0x2e918d[_0x8dec('0x37')][_0x8dec('0x1e')]);}return _0x144d51[_0x8dec('0x61')](_0x2d4896);}})['then'](function(_0x3bc990){if(_0x3bc990){return _0x3bc990?{'count':_0x4e7ca6,'rows':_0x3bc990}:null;}})[_0x8dec('0x27')](respondWithResult(_0x56c307,null))['catch'](handleError(_0x56c307,null));};exports[_0x8dec('0x63')]=function(_0x29defc,_0x1dd9f9,_0x4530a1){var _0x4be4c7=_0x29defc['body'][_0x8dec('0x64')];return db[_0x8dec('0x62')][_0x8dec('0x46')]({'where':{'id':_0x4be4c7},'attributes':['id'],'include':[{'model':db[_0x8dec('0x58')],'as':_0x8dec('0x65'),'attributes':['id',_0x8dec('0x2e'),_0x8dec('0x66'),'voicePause',_0x8dec('0x67')],'raw':!![]}]})[_0x8dec('0x27')](function(_0x2ca5b5){if(_0x2ca5b5){var _0x51fddf=_[_0x8dec('0x68')](_0x2ca5b5,function(_0x538fbc){var _0x327388=_0x538fbc[_0x8dec('0x28')]({'plain':!![]});return _0x327388['Agents'];});return db['FaxQueue'][_0x8dec('0x49')]({'where':{'id':_0x29defc[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](function(_0x41f6e8){return db[_0x8dec('0x69')][_0x8dec('0x6a')](function(_0x39bcad){return _0x41f6e8[_0x8dec('0x63')](_0x4be4c7,{'transaction':_0x39bcad})[_0x8dec('0x27')](function(){return BPromise[_0x8dec('0x6b')](_0x51fddf,function(_0x22a5ee){return db['UserFaxQueue'][_0x8dec('0x6c')]({'where':{'UserId':_0x22a5ee['id'],'FaxQueueId':_0x29defc[_0x8dec('0x51')]['id']},'transaction':_0x39bcad});});})['then'](function(){_0x51fddf[_0x8dec('0x6d')](function(_0x55d0e7){socket[_0x8dec('0x6e')]('userFaxQueue:save',{'UserId':_0x55d0e7['id'],'FaxQueueId':_0x41f6e8['id']});});});});});}})[_0x8dec('0x27')](respondWithStatusCode(_0x1dd9f9,null))['catch'](handleError(_0x1dd9f9,null));};exports['removeTeams']=function(_0x4365e7,_0x108355,_0x175294){return db[_0x8dec('0x62')]['findAll']({'where':{'id':_0x4365e7['query'][_0x8dec('0x64')]},'attributes':['id'],'include':[{'model':db[_0x8dec('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8dec('0x27')](handleEntityNotFound(_0x108355,null))[_0x8dec('0x27')](function(_0x232f8e){var _0xd37506=_[_0x8dec('0x35')](_0x232f8e,'id');var _0x518238=[];var _0x29db55=[];var _0x2ec163=squel[_0x8dec('0x6f')]();_0x2ec163[_0x8dec('0x70')](_0x8dec('0x71'))['from'](_0x8dec('0x72'),'tq')[_0x8dec('0x73')](_0x8dec('0x74'),'ut',_0x8dec('0x75'))[_0x8dec('0x40')]('FaxQueueId\x20=\x20?',_0x4365e7[_0x8dec('0x51')]['id']);for(var _0x6f8dcc=0x0;_0x6f8dcc<_0x232f8e[_0x8dec('0x3b')];_0x6f8dcc+=0x1){let _0x26fbad=_0x232f8e[_0x6f8dcc];for(var _0x5e13a3=0x0;_0x5e13a3<_0x26fbad[_0x8dec('0x65')][_0x8dec('0x3b')];_0x5e13a3+=0x1){let _0x4fd750=_0x26fbad[_0x8dec('0x65')][_0x5e13a3];var _0x3932e6=_0x2ec163[_0x8dec('0x76')]();_0x3932e6[_0x8dec('0x40')]('ut.UserId\x20=\x20?',_0x4fd750['id']);_0x29db55[_0x8dec('0x77')](db[_0x8dec('0x69')][_0x8dec('0x37')](_0x3932e6['toString'](),{'type':db['sequelize']['QueryTypes'][_0x8dec('0x78')]})[_0x8dec('0x27')](function(_0x223224){if(_0x223224[_0x8dec('0x3b')]===0x1){return _0x4fd750['id'];}else{var _0x367895=_['every'](_[_0x8dec('0x35')](_0x223224,_0x8dec('0x79')),function(_0x2f2967){return _[_0x8dec('0x7a')](_0xd37506,_0x2f2967);});if(_0x367895){return _0x4fd750['id'];}}}));}}return BPromise[_0x8dec('0x7b')](_0x29db55)[_0x8dec('0x27')](function(_0x38f094){_0x518238=_(_0x518238)[_0x8dec('0x7c')](_0x38f094)['compact']()[_0x8dec('0x7d')]();return db[_0x8dec('0x30')]['find']({'where':{'id':_0x4365e7['params']['id']}})[_0x8dec('0x27')](function(_0x4b1fbc){return db['sequelize'][_0x8dec('0x6a')](function(_0x59ee86){return _0x4b1fbc['removeTeams'](_0x4365e7[_0x8dec('0x37')][_0x8dec('0x64')],{'transaction':_0x59ee86})[_0x8dec('0x27')](function(){if(!_[_0x8dec('0x7e')](_0x518238)){return _0x4b1fbc[_0x8dec('0x7f')](_0x518238,{'transaction':_0x59ee86});}})[_0x8dec('0x27')](function(){_0x518238[_0x8dec('0x6d')](function(_0xf772b6){socket['emit'](_0x8dec('0x80'),{'UserId':_0xf772b6,'FaxQueueId':_0x4b1fbc['id']});});});});});});})[_0x8dec('0x27')](respondWithStatusCode(_0x108355,null))[_0x8dec('0x47')](handleError(_0x108355,null));};exports['addAgents']=function(_0x4f216c,_0x47de5b,_0x3073c9){return db[_0x8dec('0x30')][_0x8dec('0x49')]({'where':{'id':_0x4f216c[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x47de5b,null))[_0x8dec('0x27')](function(_0x2ea9ce){if(_0x2ea9ce){return _0x2ea9ce[_0x8dec('0x81')](_0x4f216c[_0x8dec('0x4b')][_0x8dec('0x64')],_[_0x8dec('0x82')](_0x4f216c[_0x8dec('0x4b')],[_0x8dec('0x64'),'id'])||{})[_0x8dec('0x83')](function(_0xeaae45){for(var _0x1f3ff8=0x0;_0x1f3ff8<_0x4f216c[_0x8dec('0x4b')][_0x8dec('0x64')][_0x8dec('0x3b')];_0x1f3ff8+=0x1){socket['emit'](_0x8dec('0x84'),{'UserId':Number(_0x4f216c[_0x8dec('0x4b')][_0x8dec('0x64')][_0x1f3ff8]),'FaxQueueId':Number(_0x4f216c['params']['id'])});}return _0xeaae45;});}})[_0x8dec('0x27')](respondWithResult(_0x47de5b,null))[_0x8dec('0x47')](handleError(_0x47de5b,null));};exports[_0x8dec('0x7f')]=function(_0x651ca4,_0xdcc4f4,_0x5c6bee){return db[_0x8dec('0x30')][_0x8dec('0x49')]({'where':{'id':_0x651ca4[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0xdcc4f4,null))[_0x8dec('0x27')](function(_0x3b4437){if(_0x3b4437){return _0x3b4437['removeAgents'](_0x651ca4['query']['ids'])[_0x8dec('0x27')](function(){if(_['isArray'](_0x651ca4['query'][_0x8dec('0x64')])){for(var _0xefaffb=0x0;_0xefaffb<_0x651ca4[_0x8dec('0x37')]['ids'][_0x8dec('0x3b')];_0xefaffb+=0x1){socket[_0x8dec('0x6e')](_0x8dec('0x80'),{'UserId':Number(_0x651ca4['query'][_0x8dec('0x64')][_0xefaffb]),'FaxQueueId':Number(_0x651ca4[_0x8dec('0x51')]['id'])});}}else{socket[_0x8dec('0x6e')](_0x8dec('0x80'),{'UserId':Number(_0x651ca4[_0x8dec('0x37')][_0x8dec('0x64')]),'FaxQueueId':Number(_0x651ca4[_0x8dec('0x51')]['id'])});}});}})[_0x8dec('0x27')](respondWithStatusCode(_0xdcc4f4,null))[_0x8dec('0x47')](handleError(_0xdcc4f4,null));};exports[_0x8dec('0x85')]=function(_0x1e8845,_0x277d1c,_0x160b67){var _0x47bb41={};var _0x5224db={};var _0x148576;var _0x532223;return db[_0x8dec('0x30')]['findOne']({'where':{'id':_0x1e8845[_0x8dec('0x51')]['id']}})[_0x8dec('0x27')](handleEntityNotFound(_0x277d1c,null))['then'](function(_0x205564){if(_0x205564){_0x148576=_0x205564;_0x5224db[_0x8dec('0x34')]=_['keys'](db['User'][_0x8dec('0x31')]);_0x5224db[_0x8dec('0x37')]=_['keys'](_0x1e8845[_0x8dec('0x37')]);_0x5224db[_0x8dec('0x41')]=_[_0x8dec('0x38')](_0x5224db[_0x8dec('0x34')],_0x5224db['query']);_0x47bb41[_0x8dec('0x3a')]=_[_0x8dec('0x38')](_0x5224db[_0x8dec('0x34')],qs['fields'](_0x1e8845['query'][_0x8dec('0x39')]));_0x47bb41['attributes']=_0x47bb41[_0x8dec('0x3a')][_0x8dec('0x3b')]?_0x47bb41[_0x8dec('0x3a')]:_0x5224db['model'];_0x47bb41[_0x8dec('0x3e')]=qs[_0x8dec('0x3f')](_0x1e8845[_0x8dec('0x37')][_0x8dec('0x3f')]);_0x47bb41['where']=qs['filters'](_['pick'](_0x1e8845['query'],_0x5224db[_0x8dec('0x41')]));if(_0x1e8845['query'][_0x8dec('0x56')]){_0x47bb41[_0x8dec('0x40')]=_[_0x8dec('0x43')](_0x47bb41['where'],{'$or':_['map'](_0x47bb41[_0x8dec('0x3a')],function(_0x415616){var _0x6adbae={};_0x6adbae[_0x415616]={'$like':'%'+_0x1e8845['query'][_0x8dec('0x56')]+'%'};return _0x6adbae;})});}_0x47bb41=_['merge']({},_0x47bb41,_0x1e8845['options']);return _0x148576[_0x8dec('0x85')](_0x47bb41);}})['then'](function(_0x4409f3){if(_0x4409f3){_0x532223=_0x4409f3[_0x8dec('0x3b')];if(!_0x1e8845[_0x8dec('0x37')]['hasOwnProperty'](_0x8dec('0x3d'))){_0x47bb41[_0x8dec('0x21')]=qs[_0x8dec('0x21')](_0x1e8845[_0x8dec('0x37')][_0x8dec('0x21')]);_0x47bb41[_0x8dec('0x1e')]=qs[_0x8dec('0x1e')](_0x1e8845[_0x8dec('0x37')][_0x8dec('0x1e')]);}return _0x148576['getAgents'](_0x47bb41);}})['then'](function(_0x7b82d4){if(_0x7b82d4){return _0x7b82d4?{'count':_0x532223,'rows':_0x7b82d4}:null;}})['then'](respondWithResult(_0x277d1c,null))[_0x8dec('0x47')](handleError(_0x277d1c,null));}; \ No newline at end of file +var _0xf022=['createdAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','map','FaxQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','%s/%s'];(function(_0x21c32d,_0x34bdbd){var _0x1b657e=function(_0xa7b042){while(--_0xa7b042){_0x21c32d['push'](_0x21c32d['shift']());}};_0x1b657e(++_0x34bdbd);}(_0xf022,0x12b));var _0x2f02=function(_0x51380e,_0x55b897){_0x51380e=_0x51380e-0x0;var _0x2ed390=_0xf022[_0x51380e];return _0x2ed390;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f02('0x0'));var zipdir=require(_0x2f02('0x1'));var jsonpatch=require(_0x2f02('0x2'));var rp=require(_0x2f02('0x3'));var moment=require('moment');var BPromise=require(_0x2f02('0x4'));var Mustache=require(_0x2f02('0x5'));var util=require(_0x2f02('0x6'));var path=require(_0x2f02('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f02('0x8'));var _=require('lodash');var squel=require(_0x2f02('0x9'));var crypto=require(_0x2f02('0xa'));var jsforce=require(_0x2f02('0xb'));var deskjs=require(_0x2f02('0xc'));var toCsv=require(_0x2f02('0xd'));var querystring=require(_0x2f02('0xe'));var Papa=require(_0x2f02('0xf'));var Redis=require(_0x2f02('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2f02('0x11'));var as=require(_0x2f02('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f02('0x13'))(_0x2f02('0x14'));var utils=require('../../config/utils');var config=require(_0x2f02('0x15'));var licenseUtil=require(_0x2f02('0x16'));var db=require('../../mysqldb')['db'];config[_0x2f02('0x17')]=_['defaults'](config['redis'],{'host':_0x2f02('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f02('0x17')]));require(_0x2f02('0x19'))['register'](socket);function respondWithStatusCode(_0x565982,_0x22528a){_0x22528a=_0x22528a||0xcc;return function(_0x2d4492){if(_0x2d4492){return _0x565982[_0x2f02('0x1a')](_0x22528a);}return _0x565982[_0x2f02('0x1b')](_0x22528a)[_0x2f02('0x1c')]();};}function respondWithResult(_0x36c518,_0x1bf89f){_0x1bf89f=_0x1bf89f||0xc8;return function(_0x471ce8){if(_0x471ce8){return _0x36c518[_0x2f02('0x1b')](_0x1bf89f)[_0x2f02('0x1d')](_0x471ce8);}};}function respondWithFilteredResult(_0x1e3f4d,_0x1cbb6d){return function(_0x1fdf06){if(_0x1fdf06){var _0x2880a9=typeof _0x1cbb6d[_0x2f02('0x1e')]===_0x2f02('0x1f')&&typeof _0x1cbb6d[_0x2f02('0x20')]===_0x2f02('0x1f');var _0x378c9d=_0x1fdf06[_0x2f02('0x21')];var _0x1e1bd7=_0x2880a9?0x0:_0x1cbb6d['offset'];var _0xb0a043=_0x2880a9?_0x1fdf06[_0x2f02('0x21')]:_0x1cbb6d['offset']+_0x1cbb6d['limit'];var _0x4a56c8;if(_0xb0a043>=_0x378c9d){_0xb0a043=_0x378c9d;_0x4a56c8=0xc8;}else{_0x4a56c8=0xce;}_0x1e3f4d['status'](_0x4a56c8);return _0x1e3f4d[_0x2f02('0x22')]('Content-Range',_0x1e1bd7+'-'+_0xb0a043+'/'+_0x378c9d)[_0x2f02('0x1d')](_0x1fdf06);}return null;};}function patchUpdates(_0x39a7f8){return function(_0x45a4e2){try{jsonpatch[_0x2f02('0x23')](_0x45a4e2,_0x39a7f8,!![]);}catch(_0x223796){return BPromise[_0x2f02('0x24')](_0x223796);}return _0x45a4e2[_0x2f02('0x25')]();};}function saveUpdates(_0x4b979c,_0x38a319){return function(_0xaa43a8){if(_0xaa43a8){return _0xaa43a8[_0x2f02('0x26')](_0x4b979c)['then'](function(_0x141fb0){return _0x141fb0;});}return null;};}function removeEntity(_0x40503c,_0x5901ed){return function(_0x2ea5ef){if(_0x2ea5ef){return _0x2ea5ef['destroy']()[_0x2f02('0x27')](function(){var _0x54745=_0x2ea5ef[_0x2f02('0x28')]({'plain':!![]});var _0x2a611c=_0x2f02('0x29');return db[_0x2f02('0x2a')][_0x2f02('0x2b')]({'where':{'type':_0x2a611c,'resourceId':_0x54745['id']}})['then'](function(){return _0x2ea5ef;});})['then'](function(){_0x40503c[_0x2f02('0x1b')](0xcc)[_0x2f02('0x1c')]();});}};}function handleEntityNotFound(_0x33addf,_0x18d32a){return function(_0x28d5a2){if(!_0x28d5a2){_0x33addf[_0x2f02('0x1a')](0x194);}return _0x28d5a2;};}function handleError(_0x17c128,_0x4ee4c3){_0x4ee4c3=_0x4ee4c3||0x1f4;return function(_0x1fd659){logger[_0x2f02('0x2c')](_0x1fd659[_0x2f02('0x2d')]);if(_0x1fd659[_0x2f02('0x2e')]){delete _0x1fd659[_0x2f02('0x2e')];}_0x17c128['status'](_0x4ee4c3)['send'](_0x1fd659);};}exports['index']=function(_0x2ca160,_0x5354f7){var _0x3c6692={},_0x438b4b={},_0x24dd90={'count':0x0,'rows':[]};var _0x456074=_[_0x2f02('0x2f')](db[_0x2f02('0x30')]['rawAttributes'],function(_0x243cc1){return{'name':_0x243cc1[_0x2f02('0x31')],'type':_0x243cc1[_0x2f02('0x32')][_0x2f02('0x33')]};});_0x438b4b[_0x2f02('0x34')]=_[_0x2f02('0x2f')](_0x456074,_0x2f02('0x2e'));_0x438b4b[_0x2f02('0x35')]=_[_0x2f02('0x36')](_0x2ca160['query']);_0x438b4b['filters']=_[_0x2f02('0x37')](_0x438b4b[_0x2f02('0x34')],_0x438b4b[_0x2f02('0x35')]);_0x3c6692[_0x2f02('0x38')]=_[_0x2f02('0x37')](_0x438b4b[_0x2f02('0x34')],qs[_0x2f02('0x39')](_0x2ca160[_0x2f02('0x35')][_0x2f02('0x39')]));_0x3c6692[_0x2f02('0x38')]=_0x3c6692['attributes'][_0x2f02('0x3a')]?_0x3c6692[_0x2f02('0x38')]:_0x438b4b[_0x2f02('0x34')];if(!_0x2ca160[_0x2f02('0x35')][_0x2f02('0x3b')]('nolimit')){_0x3c6692[_0x2f02('0x20')]=qs[_0x2f02('0x20')](_0x2ca160[_0x2f02('0x35')][_0x2f02('0x20')]);_0x3c6692[_0x2f02('0x1e')]=qs[_0x2f02('0x1e')](_0x2ca160[_0x2f02('0x35')][_0x2f02('0x1e')]);}_0x3c6692[_0x2f02('0x3c')]=qs[_0x2f02('0x3d')](_0x2ca160['query'][_0x2f02('0x3d')]);_0x3c6692['where']=qs[_0x2f02('0x3e')](_[_0x2f02('0x3f')](_0x2ca160[_0x2f02('0x35')],_0x438b4b[_0x2f02('0x3e')]),_0x456074);if(_0x2ca160[_0x2f02('0x35')]['filter']){_0x3c6692[_0x2f02('0x40')]=_[_0x2f02('0x41')](_0x3c6692[_0x2f02('0x40')],{'$or':_[_0x2f02('0x2f')](_0x456074,function(_0x2bf397){if(_0x2bf397['type']!==_0x2f02('0x42')){var _0x3901ae={};_0x3901ae[_0x2bf397['name']]={'$like':'%'+_0x2ca160[_0x2f02('0x35')][_0x2f02('0x43')]+'%'};return _0x3901ae;}})});}_0x3c6692=_[_0x2f02('0x41')]({},_0x3c6692,_0x2ca160['options']);var _0x4dcbb6={'where':_0x3c6692[_0x2f02('0x40')]};return db[_0x2f02('0x30')][_0x2f02('0x21')](_0x4dcbb6)[_0x2f02('0x27')](function(_0x574c90){_0x24dd90[_0x2f02('0x21')]=_0x574c90;if(_0x2ca160[_0x2f02('0x35')][_0x2f02('0x44')]){_0x3c6692[_0x2f02('0x45')]=[{'all':!![]}];}return db['FaxQueue'][_0x2f02('0x46')](_0x3c6692);})[_0x2f02('0x27')](function(_0x41a037){_0x24dd90[_0x2f02('0x47')]=_0x41a037;return _0x24dd90;})[_0x2f02('0x27')](respondWithFilteredResult(_0x5354f7,_0x3c6692))[_0x2f02('0x48')](handleError(_0x5354f7,null));};exports[_0x2f02('0x49')]=function(_0x50b826,_0x57b7e3){var _0x2983df={'raw':!![],'where':{'id':_0x50b826['params']['id']}},_0x2b9f14={};_0x2b9f14[_0x2f02('0x34')]=_['keys'](db['FaxQueue'][_0x2f02('0x4a')]);_0x2b9f14[_0x2f02('0x35')]=_[_0x2f02('0x36')](_0x50b826[_0x2f02('0x35')]);_0x2b9f14[_0x2f02('0x3e')]=_[_0x2f02('0x37')](_0x2b9f14[_0x2f02('0x34')],_0x2b9f14['query']);_0x2983df[_0x2f02('0x38')]=_[_0x2f02('0x37')](_0x2b9f14[_0x2f02('0x34')],qs['fields'](_0x50b826[_0x2f02('0x35')]['fields']));_0x2983df[_0x2f02('0x38')]=_0x2983df[_0x2f02('0x38')][_0x2f02('0x3a')]?_0x2983df[_0x2f02('0x38')]:_0x2b9f14[_0x2f02('0x34')];if(_0x50b826[_0x2f02('0x35')][_0x2f02('0x44')]){_0x2983df[_0x2f02('0x45')]=[{'all':!![]}];}_0x2983df=_['merge']({},_0x2983df,_0x50b826[_0x2f02('0x4b')]);return db['FaxQueue'][_0x2f02('0x4c')](_0x2983df)[_0x2f02('0x27')](handleEntityNotFound(_0x57b7e3,null))[_0x2f02('0x27')](respondWithResult(_0x57b7e3,null))[_0x2f02('0x48')](handleError(_0x57b7e3,null));};exports[_0x2f02('0x4d')]=function(_0x58c8e2,_0x4a522d){return db[_0x2f02('0x30')]['create'](_0x58c8e2[_0x2f02('0x4e')],{})[_0x2f02('0x27')](function(_0x5497b0){var _0x4244ec=_0x58c8e2['user']['get']({'plain':!![]});if(!_0x4244ec)throw new Error(_0x2f02('0x4f'));if(_0x4244ec[_0x2f02('0x50')]===_0x2f02('0x51')){var _0x5b9fa5=_0x5497b0[_0x2f02('0x28')]({'plain':!![]});var _0x56b800=_0x2f02('0x29');return db[_0x2f02('0x52')]['find']({'where':{'name':_0x56b800,'userProfileId':_0x4244ec[_0x2f02('0x53')]},'raw':!![]})['then'](function(_0x1f9107){if(_0x1f9107&&_0x1f9107[_0x2f02('0x54')]===0x0){return db[_0x2f02('0x2a')][_0x2f02('0x4d')]({'name':_0x5b9fa5[_0x2f02('0x2e')],'resourceId':_0x5b9fa5['id'],'type':_0x1f9107[_0x2f02('0x2e')],'sectionId':_0x1f9107['id']},{})[_0x2f02('0x27')](function(){return _0x5497b0;});}else{return _0x5497b0;}})[_0x2f02('0x48')](function(_0xe3abce){logger[_0x2f02('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe3abce);throw _0xe3abce;});}return _0x5497b0;})['then'](respondWithResult(_0x4a522d,0xc9))[_0x2f02('0x48')](handleError(_0x4a522d,null));};exports['update']=function(_0xb1663d,_0x45e985){if(_0xb1663d[_0x2f02('0x4e')]['id']){delete _0xb1663d[_0x2f02('0x4e')]['id'];}return db[_0x2f02('0x30')][_0x2f02('0x4c')]({'where':{'id':_0xb1663d[_0x2f02('0x55')]['id']}})['then'](handleEntityNotFound(_0x45e985,null))[_0x2f02('0x27')](saveUpdates(_0xb1663d[_0x2f02('0x4e')],null))[_0x2f02('0x27')](respondWithResult(_0x45e985,null))['catch'](handleError(_0x45e985,null));};exports[_0x2f02('0x2b')]=function(_0x39ad89,_0x5e9fb2){return db[_0x2f02('0x30')][_0x2f02('0x4c')]({'where':{'id':_0x39ad89[_0x2f02('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e9fb2,null))[_0x2f02('0x27')](removeEntity(_0x5e9fb2,null))[_0x2f02('0x48')](handleError(_0x5e9fb2,null));};exports[_0x2f02('0x56')]=function(_0x2e2e54,_0x3449f7){return db['FaxQueue'][_0x2f02('0x56')]()[_0x2f02('0x27')](respondWithResult(_0x3449f7,null))[_0x2f02('0x48')](handleError(_0x3449f7,null));};exports[_0x2f02('0x57')]=function(_0x23e486,_0x39ca8e,_0x280d10){var _0x371f4f={'raw':!![],'where':{}},_0xcbafd3={},_0x362070;return db['FaxQueue'][_0x2f02('0x58')]({'where':{'id':_0x23e486[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](handleEntityNotFound(_0x39ca8e,null))[_0x2f02('0x27')](function(_0x29b5ff){if(_0x29b5ff){_0x362070=_0x29b5ff[_0x2f02('0x28')]({'plain':!![]});_0xcbafd3[_0x2f02('0x34')]=_[_0x2f02('0x36')](db['UserFaxQueue'][_0x2f02('0x4a')]);_0xcbafd3[_0x2f02('0x35')]=_['keys'](_0x23e486[_0x2f02('0x35')]);_0xcbafd3[_0x2f02('0x3e')]=_[_0x2f02('0x37')](_0xcbafd3['model'],_0xcbafd3[_0x2f02('0x35')]);_0x371f4f[_0x2f02('0x38')]=_[_0x2f02('0x37')](_0xcbafd3[_0x2f02('0x34')],qs['fields'](_0x23e486[_0x2f02('0x35')]['fields']));_0x371f4f[_0x2f02('0x38')]=_0x371f4f[_0x2f02('0x38')][_0x2f02('0x3a')]?_0x371f4f[_0x2f02('0x38')]:_0xcbafd3[_0x2f02('0x34')];if(!_0x23e486[_0x2f02('0x35')][_0x2f02('0x3b')]('nolimit')){_0x371f4f[_0x2f02('0x20')]=qs[_0x2f02('0x20')](_0x23e486[_0x2f02('0x35')][_0x2f02('0x20')]);_0x371f4f[_0x2f02('0x1e')]=qs[_0x2f02('0x1e')](_0x23e486['query'][_0x2f02('0x1e')]);}_0x371f4f[_0x2f02('0x3c')]=qs[_0x2f02('0x3d')](_0x23e486[_0x2f02('0x35')]['sort']);_0x371f4f[_0x2f02('0x40')]=qs[_0x2f02('0x3e')](_[_0x2f02('0x3f')](_0x23e486['query'],_0xcbafd3['filters']));_0x371f4f[_0x2f02('0x40')]['FaxQueueId']=_0x29b5ff['id'];if(_0x23e486[_0x2f02('0x35')][_0x2f02('0x43')]){_0x371f4f['where']=_[_0x2f02('0x41')](_0x371f4f[_0x2f02('0x40')],{'$or':_[_0x2f02('0x2f')](_0x371f4f[_0x2f02('0x38')],function(_0x16f09a){var _0x1cd632={};_0x1cd632[_0x16f09a]={'$like':'%'+_0x23e486[_0x2f02('0x35')]['filter']+'%'};return _0x1cd632;})});}_0x371f4f=_[_0x2f02('0x41')]({},_0x371f4f,_0x23e486['options']);return db[_0x2f02('0x59')][_0x2f02('0x46')](_0x371f4f);}})['then'](function(_0x4b0d57){if(_0x4b0d57){return db[_0x2f02('0x5a')][_0x2f02('0x5b')]({'where':{'id':_[_0x2f02('0x2f')](_0x4b0d57,_0x2f02('0x5c')),'role':_0x2f02('0x5d')},'attributes':['id','name',_0x2f02('0x5e'),_0x2f02('0x5f'),'createdAt']});}})[_0x2f02('0x27')](function(_0x243929){if(_0x243929){return{'count':_0x243929[_0x2f02('0x21')],'rows':_[_0x2f02('0x2f')](_0x243929['rows'],function(_0x2fb7a9){return{'membername':_0x2fb7a9[_0x2f02('0x2e')],'UserId':_0x2fb7a9['id'],'queue_name':_0x362070[_0x2f02('0x2e')],'FaxQueueId':_0x362070['id'],'interface':util['format'](_0x2f02('0x60'),'SIP',_0x2fb7a9['name']),'penalty':0x0,'paused':_0x2fb7a9['faxPause'],'createdAt':_0x2fb7a9[_0x2f02('0x61')],'updatedAt':_0x2fb7a9[_0x2f02('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x39ca8e,_0x371f4f))[_0x2f02('0x48')](handleError(_0x39ca8e,null));};exports[_0x2f02('0x62')]=function(_0x517c55,_0x2ab9ca,_0x5699e2){var _0x3aa297={};var _0x102fa9={};var _0x1633e5;var _0x322de6;return db[_0x2f02('0x30')]['findOne']({'where':{'id':_0x517c55[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](handleEntityNotFound(_0x2ab9ca,null))[_0x2f02('0x27')](function(_0x928fec){if(_0x928fec){_0x1633e5=_0x928fec;_0x102fa9['model']=_[_0x2f02('0x36')](db[_0x2f02('0x63')][_0x2f02('0x4a')]);_0x102fa9[_0x2f02('0x35')]=_[_0x2f02('0x36')](_0x517c55[_0x2f02('0x35')]);_0x102fa9[_0x2f02('0x3e')]=_['intersection'](_0x102fa9[_0x2f02('0x34')],_0x102fa9[_0x2f02('0x35')]);_0x3aa297[_0x2f02('0x38')]=_[_0x2f02('0x37')](_0x102fa9[_0x2f02('0x34')],qs[_0x2f02('0x39')](_0x517c55[_0x2f02('0x35')][_0x2f02('0x39')]));_0x3aa297['attributes']=_0x3aa297[_0x2f02('0x38')]['length']?_0x3aa297['attributes']:_0x102fa9[_0x2f02('0x34')];_0x3aa297[_0x2f02('0x3c')]=qs['sort'](_0x517c55[_0x2f02('0x35')][_0x2f02('0x3d')]);_0x3aa297[_0x2f02('0x40')]=qs[_0x2f02('0x3e')](_['pick'](_0x517c55[_0x2f02('0x35')],_0x102fa9[_0x2f02('0x3e')]));if(_0x517c55[_0x2f02('0x35')][_0x2f02('0x43')]){_0x3aa297[_0x2f02('0x40')]=_[_0x2f02('0x41')](_0x3aa297[_0x2f02('0x40')],{'$or':_['map'](_0x3aa297[_0x2f02('0x38')],function(_0x27dae9){var _0x37ef81={};_0x37ef81[_0x27dae9]={'$like':'%'+_0x517c55[_0x2f02('0x35')][_0x2f02('0x43')]+'%'};return _0x37ef81;})});}_0x3aa297=_[_0x2f02('0x41')]({},_0x3aa297,_0x517c55['options']);return _0x1633e5[_0x2f02('0x62')](_0x3aa297);}})[_0x2f02('0x27')](function(_0x23cd83){if(_0x23cd83){_0x322de6=_0x23cd83[_0x2f02('0x3a')];if(!_0x517c55['query'][_0x2f02('0x3b')]('nolimit')){_0x3aa297['limit']=qs['limit'](_0x517c55[_0x2f02('0x35')][_0x2f02('0x20')]);_0x3aa297['offset']=qs['offset'](_0x517c55[_0x2f02('0x35')][_0x2f02('0x1e')]);}return _0x1633e5[_0x2f02('0x62')](_0x3aa297);}})['then'](function(_0x45d649){if(_0x45d649){return _0x45d649?{'count':_0x322de6,'rows':_0x45d649}:null;}})[_0x2f02('0x27')](respondWithResult(_0x2ab9ca,null))[_0x2f02('0x48')](handleError(_0x2ab9ca,null));};exports[_0x2f02('0x64')]=function(_0x3e6b6e,_0x16000d,_0x41064a){var _0x4aa92a=_0x3e6b6e['body'][_0x2f02('0x65')];return db[_0x2f02('0x63')]['findAll']({'where':{'id':_0x4aa92a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2f02('0x66'),'attributes':['id',_0x2f02('0x2e'),'online',_0x2f02('0x67'),_0x2f02('0x68')],'raw':!![]}]})['then'](function(_0xb2678c){if(_0xb2678c){var _0x253108=_['flatMap'](_0xb2678c,function(_0xb75569){var _0x548a51=_0xb75569[_0x2f02('0x28')]({'plain':!![]});return _0x548a51['Agents'];});return db[_0x2f02('0x30')][_0x2f02('0x4c')]({'where':{'id':_0x3e6b6e[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](function(_0x496dca){return db[_0x2f02('0x69')][_0x2f02('0x6a')](function(_0x1737e2){return _0x496dca[_0x2f02('0x64')](_0x4aa92a,{'transaction':_0x1737e2})[_0x2f02('0x27')](function(){return BPromise[_0x2f02('0x6b')](_0x253108,function(_0x3a3002){return db[_0x2f02('0x59')][_0x2f02('0x6c')]({'where':{'UserId':_0x3a3002['id'],'FaxQueueId':_0x3e6b6e[_0x2f02('0x55')]['id']},'transaction':_0x1737e2});});})[_0x2f02('0x27')](function(){_0x253108[_0x2f02('0x6d')](function(_0x43acff){socket[_0x2f02('0x6e')](_0x2f02('0x6f'),{'UserId':_0x43acff['id'],'FaxQueueId':_0x496dca['id']});});});});});}})[_0x2f02('0x27')](respondWithStatusCode(_0x16000d,null))[_0x2f02('0x48')](handleError(_0x16000d,null));};exports[_0x2f02('0x70')]=function(_0x538173,_0x4b12f4,_0x25e16a){return db[_0x2f02('0x63')]['findAll']({'where':{'id':_0x538173['query'][_0x2f02('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2f02('0x27')](handleEntityNotFound(_0x4b12f4,null))['then'](function(_0x18fe3b){var _0x2355b8=_[_0x2f02('0x2f')](_0x18fe3b,'id');var _0x446050=[];var _0xb5bf5f=[];var _0x1a885b=squel[_0x2f02('0x71')]();_0x1a885b[_0x2f02('0x72')]('tq.TeamId')[_0x2f02('0x73')](_0x2f02('0x74'),'tq')['join'](_0x2f02('0x75'),'ut',_0x2f02('0x76'))[_0x2f02('0x40')]('FaxQueueId\x20=\x20?',_0x538173[_0x2f02('0x55')]['id']);for(var _0x3db51e=0x0;_0x3db51e<_0x18fe3b[_0x2f02('0x3a')];_0x3db51e+=0x1){let _0x36505f=_0x18fe3b[_0x3db51e];for(var _0x16d360=0x0;_0x16d360<_0x36505f['Agents'][_0x2f02('0x3a')];_0x16d360+=0x1){let _0x54752a=_0x36505f[_0x2f02('0x66')][_0x16d360];var _0x111121=_0x1a885b['clone']();_0x111121[_0x2f02('0x40')]('ut.UserId\x20=\x20?',_0x54752a['id']);_0xb5bf5f['push'](db[_0x2f02('0x69')][_0x2f02('0x35')](_0x111121[_0x2f02('0x77')](),{'type':db['sequelize']['QueryTypes'][_0x2f02('0x78')]})[_0x2f02('0x27')](function(_0x1be3ec){if(_0x1be3ec[_0x2f02('0x3a')]===0x1){return _0x54752a['id'];}else{var _0x3c355b=_[_0x2f02('0x79')](_[_0x2f02('0x2f')](_0x1be3ec,_0x2f02('0x7a')),function(_0x413d00){return _['includes'](_0x2355b8,_0x413d00);});if(_0x3c355b){return _0x54752a['id'];}}}));}}return BPromise[_0x2f02('0x7b')](_0xb5bf5f)[_0x2f02('0x27')](function(_0x5b74a4){_0x446050=_(_0x446050)[_0x2f02('0x7c')](_0x5b74a4)['compact']()['value']();return db[_0x2f02('0x30')][_0x2f02('0x4c')]({'where':{'id':_0x538173[_0x2f02('0x55')]['id']}})['then'](function(_0x36daa0){return db[_0x2f02('0x69')][_0x2f02('0x6a')](function(_0x5f544f){return _0x36daa0[_0x2f02('0x70')](_0x538173[_0x2f02('0x35')][_0x2f02('0x65')],{'transaction':_0x5f544f})[_0x2f02('0x27')](function(){if(!_[_0x2f02('0x7d')](_0x446050)){return _0x36daa0[_0x2f02('0x7e')](_0x446050,{'transaction':_0x5f544f});}})[_0x2f02('0x27')](function(){_0x446050[_0x2f02('0x6d')](function(_0x44ce77){socket[_0x2f02('0x6e')](_0x2f02('0x7f'),{'UserId':_0x44ce77,'FaxQueueId':_0x36daa0['id']});});});});});});})['then'](respondWithStatusCode(_0x4b12f4,null))[_0x2f02('0x48')](handleError(_0x4b12f4,null));};exports[_0x2f02('0x80')]=function(_0x4d3a76,_0x15e86b,_0x4ab7cd){return db['FaxQueue'][_0x2f02('0x4c')]({'where':{'id':_0x4d3a76[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](handleEntityNotFound(_0x15e86b,null))[_0x2f02('0x27')](function(_0x183448){if(_0x183448){return _0x183448[_0x2f02('0x80')](_0x4d3a76['body'][_0x2f02('0x65')],_['omit'](_0x4d3a76[_0x2f02('0x4e')],[_0x2f02('0x65'),'id'])||{})[_0x2f02('0x81')](function(_0x18a484){for(var _0x21a52a=0x0;_0x21a52a<_0x4d3a76['body']['ids'][_0x2f02('0x3a')];_0x21a52a+=0x1){socket[_0x2f02('0x6e')](_0x2f02('0x6f'),{'UserId':Number(_0x4d3a76[_0x2f02('0x4e')][_0x2f02('0x65')][_0x21a52a]),'FaxQueueId':Number(_0x4d3a76['params']['id'])});}return _0x18a484;});}})['then'](respondWithResult(_0x15e86b,null))['catch'](handleError(_0x15e86b,null));};exports[_0x2f02('0x7e')]=function(_0x5909ce,_0x59638d,_0x361e79){return db[_0x2f02('0x30')][_0x2f02('0x4c')]({'where':{'id':_0x5909ce[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](handleEntityNotFound(_0x59638d,null))['then'](function(_0x4f86f0){if(_0x4f86f0){return _0x4f86f0[_0x2f02('0x7e')](_0x5909ce[_0x2f02('0x35')][_0x2f02('0x65')])[_0x2f02('0x27')](function(){if(_[_0x2f02('0x82')](_0x5909ce[_0x2f02('0x35')][_0x2f02('0x65')])){for(var _0x7e189a=0x0;_0x7e189a<_0x5909ce[_0x2f02('0x35')]['ids']['length'];_0x7e189a+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5909ce['query']['ids'][_0x7e189a]),'FaxQueueId':Number(_0x5909ce[_0x2f02('0x55')]['id'])});}}else{socket[_0x2f02('0x6e')](_0x2f02('0x7f'),{'UserId':Number(_0x5909ce[_0x2f02('0x35')][_0x2f02('0x65')]),'FaxQueueId':Number(_0x5909ce[_0x2f02('0x55')]['id'])});}});}})[_0x2f02('0x27')](respondWithStatusCode(_0x59638d,null))[_0x2f02('0x48')](handleError(_0x59638d,null));};exports['getAgents']=function(_0x1694f2,_0x2d6d34,_0x9ca1ed){var _0x2a2c78={};var _0x4622e6={};var _0x239a45;var _0x73d4b4;return db['FaxQueue'][_0x2f02('0x58')]({'where':{'id':_0x1694f2[_0x2f02('0x55')]['id']}})[_0x2f02('0x27')](handleEntityNotFound(_0x2d6d34,null))[_0x2f02('0x27')](function(_0x1c9a45){if(_0x1c9a45){_0x239a45=_0x1c9a45;_0x4622e6['model']=_[_0x2f02('0x36')](db['User']['rawAttributes']);_0x4622e6[_0x2f02('0x35')]=_[_0x2f02('0x36')](_0x1694f2[_0x2f02('0x35')]);_0x4622e6[_0x2f02('0x3e')]=_[_0x2f02('0x37')](_0x4622e6[_0x2f02('0x34')],_0x4622e6[_0x2f02('0x35')]);_0x2a2c78[_0x2f02('0x38')]=_[_0x2f02('0x37')](_0x4622e6[_0x2f02('0x34')],qs[_0x2f02('0x39')](_0x1694f2['query'][_0x2f02('0x39')]));_0x2a2c78['attributes']=_0x2a2c78['attributes'][_0x2f02('0x3a')]?_0x2a2c78['attributes']:_0x4622e6[_0x2f02('0x34')];_0x2a2c78[_0x2f02('0x3c')]=qs[_0x2f02('0x3d')](_0x1694f2[_0x2f02('0x35')][_0x2f02('0x3d')]);_0x2a2c78[_0x2f02('0x40')]=qs[_0x2f02('0x3e')](_[_0x2f02('0x3f')](_0x1694f2['query'],_0x4622e6[_0x2f02('0x3e')]));if(_0x1694f2[_0x2f02('0x35')][_0x2f02('0x43')]){_0x2a2c78[_0x2f02('0x40')]=_[_0x2f02('0x41')](_0x2a2c78[_0x2f02('0x40')],{'$or':_[_0x2f02('0x2f')](_0x2a2c78[_0x2f02('0x38')],function(_0x2fe6ab){var _0x20b2ad={};_0x20b2ad[_0x2fe6ab]={'$like':'%'+_0x1694f2[_0x2f02('0x35')][_0x2f02('0x43')]+'%'};return _0x20b2ad;})});}_0x2a2c78=_[_0x2f02('0x41')]({},_0x2a2c78,_0x1694f2[_0x2f02('0x4b')]);return _0x239a45[_0x2f02('0x83')](_0x2a2c78);}})['then'](function(_0x4d5020){if(_0x4d5020){_0x73d4b4=_0x4d5020[_0x2f02('0x3a')];if(!_0x1694f2[_0x2f02('0x35')]['hasOwnProperty']('nolimit')){_0x2a2c78[_0x2f02('0x20')]=qs['limit'](_0x1694f2[_0x2f02('0x35')][_0x2f02('0x20')]);_0x2a2c78[_0x2f02('0x1e')]=qs[_0x2f02('0x1e')](_0x1694f2['query']['offset']);}return _0x239a45[_0x2f02('0x83')](_0x2a2c78);}})[_0x2f02('0x27')](function(_0x453aa7){if(_0x453aa7){return _0x453aa7?{'count':_0x73d4b4,'rows':_0x453aa7}:null;}})[_0x2f02('0x27')](respondWithResult(_0x2d6d34,null))[_0x2f02('0x48')](handleError(_0x2d6d34,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4180b66..3b7a8d8 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 _0xd15c=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xd15c,0x7f));var _0xcd15=function(_0x7ea72d,_0x5e78a7){_0x7ea72d=_0x7ea72d-0x0;var _0x8a4e62=_0xd15c[_0x7ea72d];return _0x8a4e62;};'use strict';var EventEmitter=require(_0xcd15('0x0'));var FaxQueue=require(_0xcd15('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd15('0x2'),'afterUpdate':_0xcd15('0x3'),'afterDestroy':_0xcd15('0x4')};function emitEvent(_0x39cb5f){return function(_0x8ee5b,_0x128abf,_0x159ff7){FaxQueueEvents[_0xcd15('0x5')](_0x39cb5f+':'+_0x8ee5b['id'],_0x8ee5b);FaxQueueEvents['emit'](_0x39cb5f,_0x8ee5b);_0x159ff7(null);};}for(var e in events){if(events[_0xcd15('0x6')](e)){var event=events[e];FaxQueue[_0xcd15('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x3f1e=['events','../../mysqldb','FaxQueue','update','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f1e,0x85));var _0xe3f1=function(_0x29caf3,_0x88a317){_0x29caf3=_0x29caf3-0x0;var _0x3dc931=_0x3f1e[_0x29caf3];return _0x3dc931;};'use strict';var EventEmitter=require(_0xe3f1('0x0'));var FaxQueue=require(_0xe3f1('0x1'))['db'][_0xe3f1('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe3f1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2de137){return function(_0x3cad1a,_0x19457c,_0x22d446){FaxQueueEvents[_0xe3f1('0x4')](_0x2de137+':'+_0x3cad1a['id'],_0x3cad1a);FaxQueueEvents[_0xe3f1('0x4')](_0x2de137,_0x3cad1a);_0x22d446(null);};}for(var e in events){if(events[_0xe3f1('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xe3f1('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index eabbb2d..b315f25 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 _0x1fb6=['./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x23e0a0,_0x1ef4ad){var _0x54ee1a=function(_0x551ac0){while(--_0x551ac0){_0x23e0a0['push'](_0x23e0a0['shift']());}};_0x54ee1a(++_0x1ef4ad);}(_0x1fb6,0x9a));var _0x61fb=function(_0x4fdc02,_0x351a26){_0x4fdc02=_0x4fdc02-0x0;var _0xf2ca13=_0x1fb6[_0x4fdc02];return _0xf2ca13;};'use strict';var _=require(_0x61fb('0x0'));var util=require(_0x61fb('0x1'));var logger=require(_0x61fb('0x2'))('api');var moment=require(_0x61fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x61fb('0x4'));var fs=require('fs');var path=require(_0x61fb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61fb('0x6'));module[_0x61fb('0x7')]=function(_0x5d8c9f,_0x357b1b){return _0x5d8c9f[_0x61fb('0x8')](_0x61fb('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab7c=['util','../../config/logger','moment','bluebird','rimraf','./faxQueue.attributes','exports','define'];(function(_0x6cca0d,_0x52800e){var _0x1e47bd=function(_0x1e4e6c){while(--_0x1e4e6c){_0x6cca0d['push'](_0x6cca0d['shift']());}};_0x1e47bd(++_0x52800e);}(_0xab7c,0x168));var _0xcab7=function(_0x24683f,_0x4595c1){_0x24683f=_0x24683f-0x0;var _0x25a78e=_0xab7c[_0x24683f];return _0x25a78e;};'use strict';var _=require('lodash');var util=require(_0xcab7('0x0'));var logger=require(_0xcab7('0x1'))('api');var moment=require(_0xcab7('0x2'));var BPromise=require(_0xcab7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcab7('0x4'));var config=require('../../config/environment');var attributes=require(_0xcab7('0x5'));module[_0xcab7('0x6')]=function(_0x45771f,_0x521037){return _0x45771f[_0xcab7('0x7')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 3d8fb1d..8077cd7 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 _0xf8d0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','GetFaxQueue','ShowFaxQueue'];(function(_0x2c60e0,_0x102832){var _0x58dd93=function(_0x12562b){while(--_0x12562b){_0x2c60e0['push'](_0x2c60e0['shift']());}};_0x58dd93(++_0x102832);}(_0xf8d0,0x134));var _0x0f8d=function(_0x350c1b,_0x4586df){_0x350c1b=_0x350c1b-0x0;var _0x5e3782=_0xf8d0[_0x350c1b];return _0x5e3782;};'use strict';var _=require(_0x0f8d('0x0'));var util=require(_0x0f8d('0x1'));var moment=require(_0x0f8d('0x2'));var BPromise=require(_0x0f8d('0x3'));var rs=require(_0x0f8d('0x4'));var fs=require('fs');var Redis=require(_0x0f8d('0x5'));var db=require(_0x0f8d('0x6'))['db'];var utils=require(_0x0f8d('0x7'));var logger=require(_0x0f8d('0x8'))(_0x0f8d('0x9'));var config=require('../../config/environment');var jayson=require(_0x0f8d('0xa'));var client=jayson[_0x0f8d('0xb')][_0x0f8d('0xc')]({'port':0x232a});config[_0x0f8d('0xd')]=_[_0x0f8d('0xe')](config[_0x0f8d('0xd')],{'host':_0x0f8d('0xf'),'port':0x18eb});var socket=require(_0x0f8d('0x10'))(new Redis(config['redis']));require(_0x0f8d('0x11'))[_0x0f8d('0x12')](socket);function respondWithRpcPromise(_0x5098e0,_0x8cfe98,_0x4a3017){return new BPromise(function(_0x441c89,_0x4749b0){return client[_0x0f8d('0x13')](_0x5098e0,_0x4a3017)[_0x0f8d('0x14')](function(_0x408beb){logger['info'](_0x0f8d('0x15'),_0x8cfe98,_0x0f8d('0x16'));logger['debug'](_0x0f8d('0x17'),_0x8cfe98,'request\x20sent',JSON[_0x0f8d('0x18')](_0x408beb));if(_0x408beb['error']){if(_0x408beb[_0x0f8d('0x19')][_0x0f8d('0x1a')]===0x1f4){logger[_0x0f8d('0x19')](_0x0f8d('0x15'),_0x8cfe98,_0x408beb[_0x0f8d('0x19')][_0x0f8d('0x1b')]);return _0x4749b0(_0x408beb['error'][_0x0f8d('0x1b')]);}logger[_0x0f8d('0x19')](_0x0f8d('0x15'),_0x8cfe98,_0x408beb[_0x0f8d('0x19')][_0x0f8d('0x1b')]);return _0x441c89(_0x408beb[_0x0f8d('0x19')][_0x0f8d('0x1b')]);}else{logger['info'](_0x0f8d('0x15'),_0x8cfe98,_0x0f8d('0x16'));_0x441c89(_0x408beb[_0x0f8d('0x1c')]['message']);}})[_0x0f8d('0x1d')](function(_0x367840){logger['error']('FaxQueue,\x20%s,\x20%s',_0x8cfe98,_0x367840);_0x4749b0(_0x367840);});});}exports['GetFaxQueue']=function(_0x44abb9){var _0x5a6d43=this;return new Promise(function(_0x62788f,_0x163fbe){return db[_0x0f8d('0x1e')][_0x0f8d('0x1f')]({'raw':_0x44abb9[_0x0f8d('0x20')]?_0x44abb9[_0x0f8d('0x20')][_0x0f8d('0x21')]===undefined?!![]:![]:!![],'where':_0x44abb9[_0x0f8d('0x20')]?_0x44abb9[_0x0f8d('0x20')][_0x0f8d('0x22')]||null:null,'attributes':_0x44abb9[_0x0f8d('0x20')]?_0x44abb9[_0x0f8d('0x20')][_0x0f8d('0x23')]||null:null,'limit':_0x44abb9[_0x0f8d('0x20')]?_0x44abb9[_0x0f8d('0x20')][_0x0f8d('0x24')]||null:null,'include':_0x44abb9['options']?_0x44abb9['options']['include']?_['map'](_0x44abb9[_0x0f8d('0x20')][_0x0f8d('0x25')],function(_0x1819f9){return{'model':db[_0x1819f9[_0x0f8d('0x26')]],'as':_0x1819f9['as'],'attributes':_0x1819f9[_0x0f8d('0x23')],'include':_0x1819f9[_0x0f8d('0x25')]?_[_0x0f8d('0x27')](_0x1819f9[_0x0f8d('0x25')],function(_0x1612cf){return{'model':db[_0x1612cf['model']],'as':_0x1612cf['as'],'attributes':_0x1612cf[_0x0f8d('0x23')],'include':_0x1612cf[_0x0f8d('0x25')]?_[_0x0f8d('0x27')](_0x1612cf[_0x0f8d('0x25')],function(_0x214bda){return{'model':db[_0x214bda[_0x0f8d('0x26')]],'as':_0x214bda['as'],'attributes':_0x214bda['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f8d('0x14')](function(_0x1ef183){logger[_0x0f8d('0x28')]('GetFaxQueue',_0x44abb9);logger[_0x0f8d('0x29')]('GetFaxQueue',_0x44abb9,JSON['stringify'](_0x1ef183));_0x62788f(_0x1ef183);})[_0x0f8d('0x1d')](function(_0x58588f){logger[_0x0f8d('0x19')](_0x0f8d('0x2a'),_0x58588f['message'],_0x44abb9);_0x163fbe(_0x5a6d43[_0x0f8d('0x19')](0x1f4,_0x58588f[_0x0f8d('0x1b')]));});});};exports['ShowFaxQueue']=function(_0x564985){var _0x995e30=this;return new Promise(function(_0xcb1816,_0x5de32b){return db[_0x0f8d('0x1e')]['find']({'raw':_0x564985[_0x0f8d('0x20')]?_0x564985['options'][_0x0f8d('0x21')]===undefined?!![]:![]:!![],'where':_0x564985[_0x0f8d('0x20')]?_0x564985['options'][_0x0f8d('0x22')]||null:null,'attributes':_0x564985[_0x0f8d('0x20')]?_0x564985[_0x0f8d('0x20')][_0x0f8d('0x23')]||null:null,'include':_0x564985[_0x0f8d('0x20')]?_0x564985['options']['include']?_[_0x0f8d('0x27')](_0x564985[_0x0f8d('0x20')][_0x0f8d('0x25')],function(_0x1a69e9){return{'model':db[_0x1a69e9[_0x0f8d('0x26')]],'as':_0x1a69e9['as'],'attributes':_0x1a69e9[_0x0f8d('0x23')],'include':_0x1a69e9[_0x0f8d('0x25')]?_[_0x0f8d('0x27')](_0x1a69e9[_0x0f8d('0x25')],function(_0x1423d3){return{'model':db[_0x1423d3[_0x0f8d('0x26')]],'as':_0x1423d3['as'],'attributes':_0x1423d3['attributes'],'include':_0x1423d3['include']?_[_0x0f8d('0x27')](_0x1423d3[_0x0f8d('0x25')],function(_0x13fff1){return{'model':db[_0x13fff1['model']],'as':_0x13fff1['as'],'attributes':_0x13fff1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x349bb9){logger[_0x0f8d('0x28')]('ShowFaxQueue',_0x564985);logger[_0x0f8d('0x29')]('ShowFaxQueue',_0x564985,JSON[_0x0f8d('0x18')](_0x349bb9));_0xcb1816(_0x349bb9);})[_0x0f8d('0x1d')](function(_0x547780){logger[_0x0f8d('0x19')](_0x0f8d('0x2b'),_0x547780[_0x0f8d('0x1b')],_0x564985);_0x5de32b(_0x995e30[_0x0f8d('0x19')](0x1f4,_0x547780[_0x0f8d('0x1b')]));});});}; \ No newline at end of file +var _0xd724=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxQueue','findAll','options','where','attributes','map','include','model','GetFaxQueue','ShowFaxQueue','raw','lodash','util','moment','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xd724,0x18c));var _0x4d72=function(_0x3e78ba,_0x14e764){_0x3e78ba=_0x3e78ba-0x0;var _0x2ade89=_0xd724[_0x3e78ba];return _0x2ade89;};'use strict';var _=require(_0x4d72('0x0'));var util=require(_0x4d72('0x1'));var moment=require(_0x4d72('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d72('0x3'));var fs=require('fs');var Redis=require(_0x4d72('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d72('0x5'));var logger=require(_0x4d72('0x6'))(_0x4d72('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d72('0x8'));var client=jayson[_0x4d72('0x9')][_0x4d72('0xa')]({'port':0x232a});config[_0x4d72('0xb')]=_['defaults'](config['redis'],{'host':_0x4d72('0xc'),'port':0x18eb});var socket=require(_0x4d72('0xd'))(new Redis(config[_0x4d72('0xb')]));require(_0x4d72('0xe'))[_0x4d72('0xf')](socket);function respondWithRpcPromise(_0x3a26aa,_0x433d58,_0x4b9b00){return new BPromise(function(_0x44e0f2,_0x370059){return client[_0x4d72('0x10')](_0x3a26aa,_0x4b9b00)[_0x4d72('0x11')](function(_0x5458f8){logger['info'](_0x4d72('0x12'),_0x433d58,_0x4d72('0x13'));logger[_0x4d72('0x14')](_0x4d72('0x15'),_0x433d58,_0x4d72('0x13'),JSON[_0x4d72('0x16')](_0x5458f8));if(_0x5458f8['error']){if(_0x5458f8[_0x4d72('0x17')][_0x4d72('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x433d58,_0x5458f8[_0x4d72('0x17')]['message']);return _0x370059(_0x5458f8[_0x4d72('0x17')][_0x4d72('0x19')]);}logger[_0x4d72('0x17')](_0x4d72('0x12'),_0x433d58,_0x5458f8[_0x4d72('0x17')][_0x4d72('0x19')]);return _0x44e0f2(_0x5458f8['error'][_0x4d72('0x19')]);}else{logger[_0x4d72('0x1a')](_0x4d72('0x12'),_0x433d58,_0x4d72('0x13'));_0x44e0f2(_0x5458f8[_0x4d72('0x1b')]['message']);}})[_0x4d72('0x1c')](function(_0x2ff42d){logger[_0x4d72('0x17')](_0x4d72('0x12'),_0x433d58,_0x2ff42d);_0x370059(_0x2ff42d);});});}exports['GetFaxQueue']=function(_0x394492){var _0xf3aa0d=this;return new Promise(function(_0x3cb01e,_0x51533a){return db[_0x4d72('0x1d')][_0x4d72('0x1e')]({'raw':_0x394492['options']?_0x394492[_0x4d72('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x394492[_0x4d72('0x1f')]?_0x394492['options'][_0x4d72('0x20')]||null:null,'attributes':_0x394492['options']?_0x394492[_0x4d72('0x1f')][_0x4d72('0x21')]||null:null,'limit':_0x394492[_0x4d72('0x1f')]?_0x394492[_0x4d72('0x1f')]['limit']||null:null,'include':_0x394492[_0x4d72('0x1f')]?_0x394492[_0x4d72('0x1f')]['include']?_[_0x4d72('0x22')](_0x394492[_0x4d72('0x1f')][_0x4d72('0x23')],function(_0x54a35a){return{'model':db[_0x54a35a[_0x4d72('0x24')]],'as':_0x54a35a['as'],'attributes':_0x54a35a['attributes'],'include':_0x54a35a[_0x4d72('0x23')]?_['map'](_0x54a35a[_0x4d72('0x23')],function(_0x5f1d59){return{'model':db[_0x5f1d59[_0x4d72('0x24')]],'as':_0x5f1d59['as'],'attributes':_0x5f1d59[_0x4d72('0x21')],'include':_0x5f1d59['include']?_[_0x4d72('0x22')](_0x5f1d59[_0x4d72('0x23')],function(_0x4ed6ee){return{'model':db[_0x4ed6ee[_0x4d72('0x24')]],'as':_0x4ed6ee['as'],'attributes':_0x4ed6ee[_0x4d72('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4d72('0x11')](function(_0x1de6e5){logger[_0x4d72('0x1a')](_0x4d72('0x25'),_0x394492);logger[_0x4d72('0x14')](_0x4d72('0x25'),_0x394492,JSON[_0x4d72('0x16')](_0x1de6e5));_0x3cb01e(_0x1de6e5);})[_0x4d72('0x1c')](function(_0x5aa7e4){logger['error'](_0x4d72('0x25'),_0x5aa7e4[_0x4d72('0x19')],_0x394492);_0x51533a(_0xf3aa0d['error'](0x1f4,_0x5aa7e4[_0x4d72('0x19')]));});});};exports[_0x4d72('0x26')]=function(_0x6ceec0){var _0x51ab2c=this;return new Promise(function(_0x1195f,_0x22fa7a){return db[_0x4d72('0x1d')]['find']({'raw':_0x6ceec0[_0x4d72('0x1f')]?_0x6ceec0[_0x4d72('0x1f')][_0x4d72('0x27')]===undefined?!![]:![]:!![],'where':_0x6ceec0[_0x4d72('0x1f')]?_0x6ceec0[_0x4d72('0x1f')][_0x4d72('0x20')]||null:null,'attributes':_0x6ceec0[_0x4d72('0x1f')]?_0x6ceec0[_0x4d72('0x1f')][_0x4d72('0x21')]||null:null,'include':_0x6ceec0['options']?_0x6ceec0[_0x4d72('0x1f')][_0x4d72('0x23')]?_[_0x4d72('0x22')](_0x6ceec0[_0x4d72('0x1f')][_0x4d72('0x23')],function(_0x594c2f){return{'model':db[_0x594c2f['model']],'as':_0x594c2f['as'],'attributes':_0x594c2f[_0x4d72('0x21')],'include':_0x594c2f[_0x4d72('0x23')]?_['map'](_0x594c2f[_0x4d72('0x23')],function(_0x45a901){return{'model':db[_0x45a901[_0x4d72('0x24')]],'as':_0x45a901['as'],'attributes':_0x45a901['attributes'],'include':_0x45a901['include']?_[_0x4d72('0x22')](_0x45a901['include'],function(_0x5d4ef5){return{'model':db[_0x5d4ef5[_0x4d72('0x24')]],'as':_0x5d4ef5['as'],'attributes':_0x5d4ef5[_0x4d72('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a5c30){logger['info'](_0x4d72('0x26'),_0x6ceec0);logger[_0x4d72('0x14')](_0x4d72('0x26'),_0x6ceec0,JSON[_0x4d72('0x16')](_0x3a5c30));_0x1195f(_0x3a5c30);})[_0x4d72('0x1c')](function(_0x28ac6c){logger[_0x4d72('0x17')](_0x4d72('0x26'),_0x28ac6c[_0x4d72('0x19')],_0x6ceec0);_0x22fa7a(_0x51ab2c[_0x4d72('0x17')](0x1f4,_0x28ac6c[_0x4d72('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 55807a0..2f1faaa 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 _0x65a6=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x3a9939,_0x4b90ba){var _0x532d00=function(_0x2f6255){while(--_0x2f6255){_0x3a9939['push'](_0x3a9939['shift']());}};_0x532d00(++_0x4b90ba);}(_0x65a6,0x19e));var _0x665a=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x65a6[_0x4bd06e];return _0x85ebb;};'use strict';var FaxQueueEvents=require(_0x665a('0x0'));var events=[_0x665a('0x1'),'remove',_0x665a('0x2')];function createListener(_0x4bee7d,_0x1e847a){return function(_0x1853f1){_0x1e847a[_0x665a('0x3')](_0x4bee7d,_0x1853f1);};}function removeListener(_0xa150c7,_0x27e12c){return function(){FaxQueueEvents[_0x665a('0x4')](_0xa150c7,_0x27e12c);};}exports[_0x665a('0x5')]=function(_0x274b8e){for(var _0x2b49b0=0x0,_0x261543=events[_0x665a('0x6')];_0x2b49b0<_0x261543;_0x2b49b0++){var _0x29862f=events[_0x2b49b0];var _0x2d495f=createListener(_0x665a('0x7')+_0x29862f,_0x274b8e);FaxQueueEvents['on'](_0x29862f,_0x2d495f);}}; \ No newline at end of file +var _0xa1b4=['emit','register','length','./faxQueue.events','save','remove','update'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xa1b4,0xff));var _0x4a1b=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa1b4[_0x2cfb58];return _0xd99951;};'use strict';var FaxQueueEvents=require(_0x4a1b('0x0'));var events=[_0x4a1b('0x1'),_0x4a1b('0x2'),_0x4a1b('0x3')];function createListener(_0x544d8c,_0x5e84d7){return function(_0x3dbc99){_0x5e84d7[_0x4a1b('0x4')](_0x544d8c,_0x3dbc99);};}function removeListener(_0x531de4,_0x45da07){return function(){FaxQueueEvents['removeListener'](_0x531de4,_0x45da07);};}exports[_0x4a1b('0x5')]=function(_0x3fff4a){for(var _0x3788cd=0x0,_0x5532c6=events[_0x4a1b('0x6')];_0x3788cd<_0x5532c6;_0x3788cd++){var _0x30c54c=events[_0x3788cd];var _0x2ac768=createListener('faxQueue:'+_0x30c54c,_0x3fff4a);FaxQueueEvents['on'](_0x30c54c,_0x2ac768);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3a079da..dab4caf 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 _0x66fa=['delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','/:id'];(function(_0x3f9d01,_0x566401){var _0x3e6b3b=function(_0x30e492){while(--_0x30e492){_0x3f9d01['push'](_0x3f9d01['shift']());}};_0x3e6b3b(++_0x566401);}(_0x66fa,0x117));var _0xa66f=function(_0x2da0f9,_0x1b5b8d){_0x2da0f9=_0x2da0f9-0x0;var _0x29a0f9=_0x66fa[_0x2da0f9];return _0x29a0f9;};'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('./faxQueue.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/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0x11')]('/',auth[_0xa66f('0x9')](),controller['create']);router['post'](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x12')]);router[_0xa66f('0x13')](_0xa66f('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xa66f('0x15')](_0xa66f('0x14'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x16')]);router['delete'](_0xa66f('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xa66f('0x15')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x17')]);module[_0xa66f('0x18')]=router; \ No newline at end of file +var _0xcde7=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','connect-timeout','express'];(function(_0xf193f7,_0x3cb181){var _0x2d539a=function(_0x264524){while(--_0x264524){_0xf193f7['push'](_0xf193f7['shift']());}};_0x2d539a(++_0x3cb181);}(_0xcde7,0x65));var _0x7cde=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcde7[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cde('0x0'));var timeout=require(_0x7cde('0x1'));var express=require(_0x7cde('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cde('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7cde('0x4'));var controller=require(_0x7cde('0x5'));router[_0x7cde('0x6')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0x8')]);router[_0x7cde('0x6')]('/describe',auth[_0x7cde('0x7')](),controller['describe']);router[_0x7cde('0x6')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xa')]);router['get'](_0x7cde('0xb'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xc')]);router[_0x7cde('0x6')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0xe')]);router[_0x7cde('0x6')](_0x7cde('0xf'),auth[_0x7cde('0x7')](),controller['getAgents']);router[_0x7cde('0x10')]('/',auth[_0x7cde('0x7')](),controller[_0x7cde('0x11')]);router[_0x7cde('0x10')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x12')]);router[_0x7cde('0x10')](_0x7cde('0xf'),auth['isAuthenticated'](),controller[_0x7cde('0x13')]);router[_0x7cde('0x14')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x15')]);router[_0x7cde('0x16')](_0x7cde('0x9'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x17')]);router[_0x7cde('0x16')](_0x7cde('0xd'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x18')]);router['delete'](_0x7cde('0xf'),auth[_0x7cde('0x7')](),controller[_0x7cde('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6c02aa4..8bfc029 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 _0xb5a3=['exports','STRING','DATE','moment'];(function(_0x508c1b,_0x23c1d8){var _0x506713=function(_0x1bea70){while(--_0x1bea70){_0x508c1b['push'](_0x508c1b['shift']());}};_0x506713(++_0x23c1d8);}(_0xb5a3,0x93));var _0x3b5a=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0xb5a3[_0x3a94e1];return _0x6a09d5;};'use strict';var moment=require(_0x3b5a('0x0'));var Sequelize=require('sequelize');module[_0x3b5a('0x1')]={'uniqueid':{'type':Sequelize[_0x3b5a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3b5a('0x2')]},'joinAt':{'type':Sequelize[_0x3b5a('0x3')]},'leaveAt':{'type':Sequelize[_0x3b5a('0x3')]},'acceptAt':{'type':Sequelize[_0x3b5a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3b5a('0x2')]}}; \ No newline at end of file +var _0xcebf=['sequelize','exports','STRING','DATE','moment'];(function(_0x8a2379,_0x5de96d){var _0x50d452=function(_0x36654d){while(--_0x36654d){_0x8a2379['push'](_0x8a2379['shift']());}};_0x50d452(++_0x5de96d);}(_0xcebf,0xd6));var _0xfceb=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0xcebf[_0x7a35b1];return _0x3c4535;};'use strict';var moment=require(_0xfceb('0x0'));var Sequelize=require(_0xfceb('0x1'));module[_0xfceb('0x2')]={'uniqueid':{'type':Sequelize[_0xfceb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfceb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfceb('0x4')]},'reason':{'type':Sequelize[_0xfceb('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0e9cffb..799d98f 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 _0xb6b1=['then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x4d5cfd,_0x5b5c6c){var _0x442f17=function(_0x32a375){while(--_0x32a375){_0x4d5cfd['push'](_0x4d5cfd['shift']());}};_0x442f17(++_0x5b5c6c);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0xb6b1[_0x5976f8];return _0x179715;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FaxQueueReport']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));};exports[_0x1b6b('0x44')]=function(_0x587c88,_0x1d59fd){return db['FaxQueueReport'][_0x1b6b('0x44')]()[_0x1b6b('0x23')](respondWithResult(_0x1d59fd,null))[_0x1b6b('0x3d')](handleError(_0x1d59fd,null));}; \ No newline at end of file +var _0x0c5d=['FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','filters','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map'];(function(_0x1757f8,_0x39f814){var _0x2642f5=function(_0x4b115d){while(--_0x4b115d){_0x1757f8['push'](_0x1757f8['shift']());}};_0x2642f5(++_0x39f814);}(_0x0c5d,0x6c));var _0xd0c5=function(_0xd94a74,_0x5a65ce){_0xd94a74=_0xd94a74-0x0;var _0x260951=_0x0c5d[_0xd94a74];return _0x260951;};'use strict';var emlformat=require(_0xd0c5('0x0'));var rimraf=require(_0xd0c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0c5('0x2'));var rp=require('request-promise');var moment=require(_0xd0c5('0x3'));var BPromise=require(_0xd0c5('0x4'));var Mustache=require(_0xd0c5('0x5'));var util=require(_0xd0c5('0x6'));var path=require(_0xd0c5('0x7'));var sox=require(_0xd0c5('0x8'));var csv=require(_0xd0c5('0x9'));var ejs=require(_0xd0c5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0c5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd0c5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd0c5('0xd'));var Papa=require(_0xd0c5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0c5('0xf'));var qs=require(_0xd0c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0c5('0x11'));var logger=require(_0xd0c5('0x12'))(_0xd0c5('0x13'));var utils=require(_0xd0c5('0x14'));var config=require(_0xd0c5('0x15'));var licenseUtil=require(_0xd0c5('0x16'));var db=require(_0xd0c5('0x17'))['db'];function respondWithStatusCode(_0x46db00,_0x1e5ac4){_0x1e5ac4=_0x1e5ac4||0xcc;return function(_0x125470){if(_0x125470){return _0x46db00[_0xd0c5('0x18')](_0x1e5ac4);}return _0x46db00[_0xd0c5('0x19')](_0x1e5ac4)['end']();};}function respondWithResult(_0x11511d,_0x1c1cc8){_0x1c1cc8=_0x1c1cc8||0xc8;return function(_0x1fc98d){if(_0x1fc98d){return _0x11511d[_0xd0c5('0x19')](_0x1c1cc8)['json'](_0x1fc98d);}};}function respondWithFilteredResult(_0x280e22,_0x23d941){return function(_0x242615){if(_0x242615){var _0x639e72=typeof _0x23d941['offset']===_0xd0c5('0x1a')&&typeof _0x23d941['limit']===_0xd0c5('0x1a');var _0x57c76a=_0x242615[_0xd0c5('0x1b')];var _0x692aeb=_0x639e72?0x0:_0x23d941[_0xd0c5('0x1c')];var _0x1cfe05=_0x639e72?_0x242615[_0xd0c5('0x1b')]:_0x23d941[_0xd0c5('0x1c')]+_0x23d941[_0xd0c5('0x1d')];var _0x287961;if(_0x1cfe05>=_0x57c76a){_0x1cfe05=_0x57c76a;_0x287961=0xc8;}else{_0x287961=0xce;}_0x280e22['status'](_0x287961);return _0x280e22[_0xd0c5('0x1e')](_0xd0c5('0x1f'),_0x692aeb+'-'+_0x1cfe05+'/'+_0x57c76a)['json'](_0x242615);}return null;};}function patchUpdates(_0x835e8d){return function(_0x30f548){try{jsonpatch[_0xd0c5('0x20')](_0x30f548,_0x835e8d,!![]);}catch(_0x6febb1){return BPromise[_0xd0c5('0x21')](_0x6febb1);}return _0x30f548[_0xd0c5('0x22')]();};}function saveUpdates(_0x331849,_0x49db81){return function(_0x4ac41c){if(_0x4ac41c){return _0x4ac41c[_0xd0c5('0x23')](_0x331849)[_0xd0c5('0x24')](function(_0x439dd5){return _0x439dd5;});}return null;};}function removeEntity(_0x6ce082,_0x5eb093){return function(_0x185e33){if(_0x185e33){return _0x185e33['destroy']()['then'](function(){_0x6ce082[_0xd0c5('0x19')](0xcc)[_0xd0c5('0x25')]();});}};}function handleEntityNotFound(_0x364963,_0x73f292){return function(_0x3a5edf){if(!_0x3a5edf){_0x364963[_0xd0c5('0x18')](0x194);}return _0x3a5edf;};}function handleError(_0xbcef61,_0x17443b){_0x17443b=_0x17443b||0x1f4;return function(_0x19b9ec){logger[_0xd0c5('0x26')](_0x19b9ec[_0xd0c5('0x27')]);if(_0x19b9ec[_0xd0c5('0x28')]){delete _0x19b9ec[_0xd0c5('0x28')];}_0xbcef61[_0xd0c5('0x19')](_0x17443b)[_0xd0c5('0x29')](_0x19b9ec);};}exports[_0xd0c5('0x2a')]=function(_0x24d35f,_0x572e66){var _0x39284e={},_0x36415f={},_0x16298d={'count':0x0,'rows':[]};var _0x21ed42=_[_0xd0c5('0x2b')](db[_0xd0c5('0x2c')][_0xd0c5('0x2d')],function(_0x571410){return{'name':_0x571410[_0xd0c5('0x2e')],'type':_0x571410['type'][_0xd0c5('0x2f')]};});_0x36415f[_0xd0c5('0x30')]=_[_0xd0c5('0x2b')](_0x21ed42,_0xd0c5('0x28'));_0x36415f[_0xd0c5('0x31')]=_[_0xd0c5('0x32')](_0x24d35f[_0xd0c5('0x31')]);_0x36415f['filters']=_['intersection'](_0x36415f[_0xd0c5('0x30')],_0x36415f['query']);_0x39284e[_0xd0c5('0x33')]=_[_0xd0c5('0x34')](_0x36415f[_0xd0c5('0x30')],qs[_0xd0c5('0x35')](_0x24d35f['query'][_0xd0c5('0x35')]));_0x39284e[_0xd0c5('0x33')]=_0x39284e['attributes'][_0xd0c5('0x36')]?_0x39284e['attributes']:_0x36415f[_0xd0c5('0x30')];if(!_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x37')]('nolimit')){_0x39284e[_0xd0c5('0x1d')]=qs[_0xd0c5('0x1d')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x1d')]);_0x39284e[_0xd0c5('0x1c')]=qs[_0xd0c5('0x1c')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x1c')]);}_0x39284e[_0xd0c5('0x38')]=qs[_0xd0c5('0x39')](_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x39')]);_0x39284e[_0xd0c5('0x3a')]=qs['filters'](_['pick'](_0x24d35f[_0xd0c5('0x31')],_0x36415f['filters']),_0x21ed42);if(_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x3b')]){_0x39284e['where']=_[_0xd0c5('0x3c')](_0x39284e[_0xd0c5('0x3a')],{'$or':_['map'](_0x21ed42,function(_0x2cc844){if(_0x2cc844[_0xd0c5('0x3d')]!==_0xd0c5('0x3e')){var _0x444a21={};_0x444a21[_0x2cc844[_0xd0c5('0x28')]]={'$like':'%'+_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x3b')]+'%'};return _0x444a21;}})});}_0x39284e=_[_0xd0c5('0x3c')]({},_0x39284e,_0x24d35f[_0xd0c5('0x3f')]);var _0x12b1f1={'where':_0x39284e[_0xd0c5('0x3a')]};return db[_0xd0c5('0x2c')][_0xd0c5('0x1b')](_0x12b1f1)['then'](function(_0x1df4be){_0x16298d[_0xd0c5('0x1b')]=_0x1df4be;if(_0x24d35f[_0xd0c5('0x31')][_0xd0c5('0x40')]){_0x39284e[_0xd0c5('0x41')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x39284e);})[_0xd0c5('0x24')](function(_0x2c51c1){_0x16298d[_0xd0c5('0x42')]=_0x2c51c1;return _0x16298d;})[_0xd0c5('0x24')](respondWithFilteredResult(_0x572e66,_0x39284e))['catch'](handleError(_0x572e66,null));};exports[_0xd0c5('0x43')]=function(_0x3aaa50,_0x1d5b9d){var _0x3ca2a3={'raw':!![],'where':{'id':_0x3aaa50[_0xd0c5('0x44')]['id']}},_0x25a2d2={};_0x25a2d2[_0xd0c5('0x30')]=_['keys'](db[_0xd0c5('0x2c')][_0xd0c5('0x2d')]);_0x25a2d2['query']=_[_0xd0c5('0x32')](_0x3aaa50[_0xd0c5('0x31')]);_0x25a2d2[_0xd0c5('0x45')]=_['intersection'](_0x25a2d2['model'],_0x25a2d2['query']);_0x3ca2a3['attributes']=_[_0xd0c5('0x34')](_0x25a2d2['model'],qs[_0xd0c5('0x35')](_0x3aaa50['query'][_0xd0c5('0x35')]));_0x3ca2a3['attributes']=_0x3ca2a3[_0xd0c5('0x33')][_0xd0c5('0x36')]?_0x3ca2a3[_0xd0c5('0x33')]:_0x25a2d2[_0xd0c5('0x30')];if(_0x3aaa50[_0xd0c5('0x31')]['includeAll']){_0x3ca2a3[_0xd0c5('0x41')]=[{'all':!![]}];}_0x3ca2a3=_[_0xd0c5('0x3c')]({},_0x3ca2a3,_0x3aaa50[_0xd0c5('0x3f')]);return db[_0xd0c5('0x2c')][_0xd0c5('0x46')](_0x3ca2a3)[_0xd0c5('0x24')](handleEntityNotFound(_0x1d5b9d,null))['then'](respondWithResult(_0x1d5b9d,null))[_0xd0c5('0x47')](handleError(_0x1d5b9d,null));};exports[_0xd0c5('0x48')]=function(_0xca2e1f,_0x38324c){return db['FaxQueueReport'][_0xd0c5('0x48')](_0xca2e1f[_0xd0c5('0x49')],{})[_0xd0c5('0x24')](respondWithResult(_0x38324c,0xc9))[_0xd0c5('0x47')](handleError(_0x38324c,null));};exports[_0xd0c5('0x23')]=function(_0x43d0ad,_0x17d71c){if(_0x43d0ad[_0xd0c5('0x49')]['id']){delete _0x43d0ad[_0xd0c5('0x49')]['id'];}return db[_0xd0c5('0x2c')][_0xd0c5('0x46')]({'where':{'id':_0x43d0ad[_0xd0c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x17d71c,null))['then'](saveUpdates(_0x43d0ad[_0xd0c5('0x49')],null))[_0xd0c5('0x24')](respondWithResult(_0x17d71c,null))[_0xd0c5('0x47')](handleError(_0x17d71c,null));};exports[_0xd0c5('0x4a')]=function(_0x46134,_0x24588){return db['FaxQueueReport'][_0xd0c5('0x46')]({'where':{'id':_0x46134[_0xd0c5('0x44')]['id']}})[_0xd0c5('0x24')](handleEntityNotFound(_0x24588,null))[_0xd0c5('0x24')](removeEntity(_0x24588,null))[_0xd0c5('0x47')](handleError(_0x24588,null));};exports[_0xd0c5('0x4b')]=function(_0x3441eb,_0x2d6f7a){return db[_0xd0c5('0x2c')][_0xd0c5('0x4b')]()[_0xd0c5('0x24')](respondWithResult(_0x2d6f7a,null))[_0xd0c5('0x47')](handleError(_0x2d6f7a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index bf2e7f0..7b9f95a 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x204628,_0x128a53){var _0x38cedd=function(_0x29e181){while(--_0x29e181){_0x204628['push'](_0x204628['shift']());}};_0x38cedd(++_0x128a53);}(_0xe14b,0x93));var _0xbe14=function(_0x34b6ae,_0x3c6076){_0x34b6ae=_0x34b6ae-0x0;var _0x1213bf=_0xe14b[_0x34b6ae];return _0x1213bf;};'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','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x395842,_0x563c1e){var _0x259089=function(_0x28615b){while(--_0x28615b){_0x395842['push'](_0x395842['shift']());}};_0x259089(++_0x563c1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e9714a4..ada0f82 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 _0x5971=['message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','UpdateFaxQueueReport','update','options','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x4b6731,_0x52af53){var _0x19a3a9=function(_0x53480a){while(--_0x53480a){_0x4b6731['push'](_0x4b6731['shift']());}};_0x19a3a9(++_0x52af53);}(_0x5971,0x18e));var _0x1597=function(_0x20bf19,_0x20d00b){_0x20bf19=_0x20bf19-0x0;var _0x45ba88=_0x5971[_0x20bf19];return _0x45ba88;};'use strict';var _=require('lodash');var util=require(_0x1597('0x0'));var moment=require(_0x1597('0x1'));var BPromise=require(_0x1597('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1597('0x3'));var db=require(_0x1597('0x4'))['db'];var utils=require(_0x1597('0x5'));var logger=require(_0x1597('0x6'))(_0x1597('0x7'));var config=require(_0x1597('0x8'));var jayson=require(_0x1597('0x9'));var client=jayson[_0x1597('0xa')][_0x1597('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x493384,_0x748dc4,_0x2c6b04){return new BPromise(function(_0xf2b85d,_0x177574){return client[_0x1597('0xc')](_0x493384,_0x2c6b04)[_0x1597('0xd')](function(_0x5eb720){logger[_0x1597('0xe')](_0x1597('0xf'),_0x748dc4,_0x1597('0x10'));logger[_0x1597('0x11')](_0x1597('0x12'),_0x748dc4,'request\x20sent',JSON[_0x1597('0x13')](_0x5eb720));if(_0x5eb720['error']){if(_0x5eb720['error'][_0x1597('0x14')]===0x1f4){logger[_0x1597('0x15')]('FaxQueueReport,\x20%s,\x20%s',_0x748dc4,_0x5eb720[_0x1597('0x15')][_0x1597('0x16')]);return _0x177574(_0x5eb720[_0x1597('0x15')][_0x1597('0x16')]);}logger['error'](_0x1597('0xf'),_0x748dc4,_0x5eb720['error'][_0x1597('0x16')]);return _0xf2b85d(_0x5eb720[_0x1597('0x15')][_0x1597('0x16')]);}else{logger[_0x1597('0xe')](_0x1597('0xf'),_0x748dc4,'request\x20sent');_0xf2b85d(_0x5eb720['result'][_0x1597('0x16')]);}})[_0x1597('0x17')](function(_0x4f8416){logger[_0x1597('0x15')](_0x1597('0xf'),_0x748dc4,_0x4f8416);_0x177574(_0x4f8416);});});}exports[_0x1597('0x18')]=function(_0x1da5d5){var _0x3ce14d=this;return new Promise(function(_0x34c382,_0x49ac72){return db[_0x1597('0x19')][_0x1597('0x1a')](_0x1da5d5[_0x1597('0x1b')],{'raw':_0x1da5d5['options']?_0x1da5d5['options']['raw']===undefined?!![]:![]:!![]})[_0x1597('0xd')](function(_0x4af15e){logger['info'](_0x1597('0x18'),_0x1da5d5);logger['debug']('CreateFaxQueueReport',_0x1da5d5,JSON['stringify'](_0x4af15e));_0x34c382(_0x4af15e);})['catch'](function(_0x2925f7){logger[_0x1597('0x15')](_0x1597('0x18'),_0x2925f7[_0x1597('0x16')],_0x1da5d5);_0x49ac72(_0x3ce14d[_0x1597('0x15')](0x1f4,_0x2925f7[_0x1597('0x16')]));});});};exports[_0x1597('0x1c')]=function(_0x2c5a01){var _0x4ec403=this;return new Promise(function(_0x3209bb,_0x567a59){return db[_0x1597('0x19')][_0x1597('0x1d')](_0x2c5a01[_0x1597('0x1b')],{'raw':_0x2c5a01[_0x1597('0x1e')]?_0x2c5a01['options'][_0x1597('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5a01['options']?_0x2c5a01[_0x1597('0x1e')][_0x1597('0x20')]||null:null,'attributes':_0x2c5a01[_0x1597('0x1e')]?_0x2c5a01[_0x1597('0x1e')][_0x1597('0x21')]||null:null,'limit':_0x2c5a01[_0x1597('0x1e')]?_0x2c5a01[_0x1597('0x1e')][_0x1597('0x22')]||null:null})[_0x1597('0xd')](function(_0x3462db){logger['info'](_0x1597('0x1c'),_0x2c5a01);logger[_0x1597('0x11')](_0x1597('0x1c'),_0x2c5a01,JSON['stringify'](_0x3462db));_0x3209bb(_0x3462db);})[_0x1597('0x17')](function(_0x49fe95){logger[_0x1597('0x15')]('UpdateFaxQueueReport',_0x49fe95['message'],_0x2c5a01);_0x567a59(_0x4ec403[_0x1597('0x15')](0x1f4,_0x49fe95['message']));});});}; \ No newline at end of file +var _0xae92=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify','catch','UpdateFaxQueueReport','update','body','where'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xae92,0x19a));var _0x2ae9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae92[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ae9('0x0'));var util=require(_0x2ae9('0x1'));var moment=require(_0x2ae9('0x2'));var BPromise=require(_0x2ae9('0x3'));var rs=require(_0x2ae9('0x4'));var fs=require('fs');var Redis=require(_0x2ae9('0x5'));var db=require(_0x2ae9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ae9('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ae9('0x8'));var client=jayson[_0x2ae9('0x9')][_0x2ae9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x174c4a,_0x39d38f,_0x56575d){return new BPromise(function(_0x5e2bd4,_0x400975){return client[_0x2ae9('0xb')](_0x174c4a,_0x56575d)[_0x2ae9('0xc')](function(_0x5a976e){logger['info'](_0x2ae9('0xd'),_0x39d38f,_0x2ae9('0xe'));logger[_0x2ae9('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x39d38f,_0x2ae9('0xe'),JSON['stringify'](_0x5a976e));if(_0x5a976e[_0x2ae9('0x10')]){if(_0x5a976e[_0x2ae9('0x10')][_0x2ae9('0x11')]===0x1f4){logger['error'](_0x2ae9('0xd'),_0x39d38f,_0x5a976e['error'][_0x2ae9('0x12')]);return _0x400975(_0x5a976e[_0x2ae9('0x10')][_0x2ae9('0x12')]);}logger[_0x2ae9('0x10')](_0x2ae9('0xd'),_0x39d38f,_0x5a976e['error'][_0x2ae9('0x12')]);return _0x5e2bd4(_0x5a976e['error'][_0x2ae9('0x12')]);}else{logger[_0x2ae9('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x39d38f,_0x2ae9('0xe'));_0x5e2bd4(_0x5a976e[_0x2ae9('0x14')][_0x2ae9('0x12')]);}})['catch'](function(_0x4920ce){logger[_0x2ae9('0x10')](_0x2ae9('0xd'),_0x39d38f,_0x4920ce);_0x400975(_0x4920ce);});});}exports[_0x2ae9('0x15')]=function(_0x5edd5b){var _0xa322cd=this;return new Promise(function(_0xa34f82,_0x2cf2fd){return db[_0x2ae9('0x16')][_0x2ae9('0x17')](_0x5edd5b['body'],{'raw':_0x5edd5b[_0x2ae9('0x18')]?_0x5edd5b[_0x2ae9('0x18')][_0x2ae9('0x19')]===undefined?!![]:![]:!![]})[_0x2ae9('0xc')](function(_0x56c2e2){logger[_0x2ae9('0x13')]('CreateFaxQueueReport',_0x5edd5b);logger[_0x2ae9('0xf')](_0x2ae9('0x15'),_0x5edd5b,JSON[_0x2ae9('0x1a')](_0x56c2e2));_0xa34f82(_0x56c2e2);})[_0x2ae9('0x1b')](function(_0x569a8b){logger[_0x2ae9('0x10')](_0x2ae9('0x15'),_0x569a8b[_0x2ae9('0x12')],_0x5edd5b);_0x2cf2fd(_0xa322cd[_0x2ae9('0x10')](0x1f4,_0x569a8b[_0x2ae9('0x12')]));});});};exports[_0x2ae9('0x1c')]=function(_0x5aa62f){var _0x475ef4=this;return new Promise(function(_0x5996bb,_0x1290a0){return db[_0x2ae9('0x16')][_0x2ae9('0x1d')](_0x5aa62f[_0x2ae9('0x1e')],{'raw':_0x5aa62f[_0x2ae9('0x18')]?_0x5aa62f[_0x2ae9('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa62f[_0x2ae9('0x18')]?_0x5aa62f[_0x2ae9('0x18')][_0x2ae9('0x1f')]||null:null,'attributes':_0x5aa62f[_0x2ae9('0x18')]?_0x5aa62f[_0x2ae9('0x18')][_0x2ae9('0x20')]||null:null,'limit':_0x5aa62f[_0x2ae9('0x18')]?_0x5aa62f[_0x2ae9('0x18')][_0x2ae9('0x21')]||null:null})['then'](function(_0x20b25e){logger['info'](_0x2ae9('0x1c'),_0x5aa62f);logger[_0x2ae9('0xf')](_0x2ae9('0x1c'),_0x5aa62f,JSON['stringify'](_0x20b25e));_0x5996bb(_0x20b25e);})['catch'](function(_0x220212){logger[_0x2ae9('0x10')]('UpdateFaxQueueReport',_0x220212['message'],_0x5aa62f);_0x1290a0(_0x475ef4[_0x2ae9('0x10')](0x1f4,_0x220212[_0x2ae9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e85ab0b..67755f4 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 _0xde92=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','update','delete'];(function(_0x1df7cc,_0x4ddbcf){var _0x46a842=function(_0x3028ed){while(--_0x3028ed){_0x1df7cc['push'](_0x1df7cc['shift']());}};_0x46a842(++_0x4ddbcf);}(_0xde92,0xac));var _0x2de9=function(_0x597bf3,_0x3a2bd8){_0x597bf3=_0x597bf3-0x0;var _0x4db0db=_0xde92[_0x597bf3];return _0x4db0db;};'use strict';var multer=require(_0x2de9('0x0'));var util=require('util');var path=require(_0x2de9('0x1'));var timeout=require('connect-timeout');var express=require(_0x2de9('0x2'));var router=express[_0x2de9('0x3')]();var fs_extra=require(_0x2de9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2de9('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x2de9('0x6')](),controller[_0x2de9('0x7')]);router[_0x2de9('0x8')](_0x2de9('0x9'),auth[_0x2de9('0x6')](),controller[_0x2de9('0xa')]);router[_0x2de9('0x8')](_0x2de9('0xb'),auth[_0x2de9('0x6')](),controller[_0x2de9('0xc')]);router['post']('/',auth[_0x2de9('0x6')](),controller['create']);router['put'](_0x2de9('0xb'),auth[_0x2de9('0x6')](),controller[_0x2de9('0xd')]);router[_0x2de9('0xe')](_0x2de9('0xb'),auth[_0x2de9('0x6')](),controller[_0x2de9('0xf')]);module[_0x2de9('0x10')]=router; \ No newline at end of file +var _0x11f2=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','index','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1134a1,_0x1deef4){var _0x1bd554=function(_0x3491e8){while(--_0x3491e8){_0x1134a1['push'](_0x1134a1['shift']());}};_0x1bd554(++_0x1deef4);}(_0x11f2,0x1e5));var _0x211f=function(_0x5502a6,_0x56c24a){_0x5502a6=_0x5502a6-0x0;var _0x575438=_0x11f2[_0x5502a6];return _0x575438;};'use strict';var multer=require(_0x211f('0x0'));var util=require(_0x211f('0x1'));var path=require(_0x211f('0x2'));var timeout=require(_0x211f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x211f('0x4'));var interaction=require(_0x211f('0x5'));var config=require('../../config/environment');var controller=require(_0x211f('0x6'));router[_0x211f('0x7')]('/',auth['isAuthenticated'](),controller[_0x211f('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x211f('0x7')]('/:id',auth[_0x211f('0x9')](),controller[_0x211f('0xa')]);router[_0x211f('0xb')]('/',auth[_0x211f('0x9')](),controller['create']);router[_0x211f('0xc')](_0x211f('0xd'),auth[_0x211f('0x9')](),controller[_0x211f('0xe')]);router[_0x211f('0xf')]('/:id',auth[_0x211f('0x9')](),controller[_0x211f('0x10')]);module[_0x211f('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3b7b2cd..8d73f64 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x597780,_0x23aaec){var _0x44d250=function(_0x2ef302){while(--_0x2ef302){_0x597780['push'](_0x597780['shift']());}};_0x44d250(++_0x23aaec);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x00bb[_0x4709c0];return _0x13348b;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x116aae,_0x4641ed){var _0x528e61=function(_0x33193a){while(--_0x33193a){_0x116aae['push'](_0x116aae['shift']());}};_0x528e61(++_0x4641ed);}(_0xf4eb,0xec));var _0xbf4e=function(_0x18823a,_0x5a8ff4){_0x18823a=_0x18823a-0x0;var _0x563863=_0xf4eb[_0x18823a];return _0x563863;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 629e1a5..36f37c2 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 _0xcbb5=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcbb5,0x1d9));var _0x5cbb=function(_0x821df1,_0x484336){_0x821df1=_0x821df1-0x0;var _0x3355a9=_0xcbb5[_0x821df1];return _0x3355a9;};'use strict';var emlformat=require(_0x5cbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cbb('0x1'));var jsonpatch=require(_0x5cbb('0x2'));var rp=require(_0x5cbb('0x3'));var moment=require(_0x5cbb('0x4'));var BPromise=require(_0x5cbb('0x5'));var Mustache=require(_0x5cbb('0x6'));var util=require(_0x5cbb('0x7'));var path=require(_0x5cbb('0x8'));var sox=require(_0x5cbb('0x9'));var csv=require(_0x5cbb('0xa'));var ejs=require(_0x5cbb('0xb'));var fs=require('fs');var fs_extra=require(_0x5cbb('0xc'));var _=require(_0x5cbb('0xd'));var squel=require(_0x5cbb('0xe'));var crypto=require(_0x5cbb('0xf'));var jsforce=require(_0x5cbb('0x10'));var deskjs=require(_0x5cbb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5cbb('0x12'));var Papa=require(_0x5cbb('0x13'));var Redis=require(_0x5cbb('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5cbb('0x15'));var as=require(_0x5cbb('0x16'));var hardwareService=require(_0x5cbb('0x17'));var logger=require(_0x5cbb('0x18'))(_0x5cbb('0x19'));var utils=require(_0x5cbb('0x1a'));var config=require(_0x5cbb('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cbb('0x1c'))['db'];function respondWithStatusCode(_0x4a41a5,_0x587b0b){_0x587b0b=_0x587b0b||0xcc;return function(_0x37a613){if(_0x37a613){return _0x4a41a5[_0x5cbb('0x1d')](_0x587b0b);}return _0x4a41a5[_0x5cbb('0x1e')](_0x587b0b)['end']();};}function respondWithResult(_0x3e4d52,_0x4b7943){_0x4b7943=_0x4b7943||0xc8;return function(_0xcc89b7){if(_0xcc89b7){return _0x3e4d52[_0x5cbb('0x1e')](_0x4b7943)[_0x5cbb('0x1f')](_0xcc89b7);}};}function respondWithFilteredResult(_0x271929,_0x43d9c4){return function(_0x451256){if(_0x451256){var _0x48fb19=typeof _0x43d9c4[_0x5cbb('0x20')]===_0x5cbb('0x21')&&typeof _0x43d9c4[_0x5cbb('0x22')]===_0x5cbb('0x21');var _0x14657c=_0x451256['count'];var _0x32e4c5=_0x48fb19?0x0:_0x43d9c4['offset'];var _0x39e961=_0x48fb19?_0x451256[_0x5cbb('0x23')]:_0x43d9c4[_0x5cbb('0x20')]+_0x43d9c4[_0x5cbb('0x22')];var _0x4aa3a2;if(_0x39e961>=_0x14657c){_0x39e961=_0x14657c;_0x4aa3a2=0xc8;}else{_0x4aa3a2=0xce;}_0x271929[_0x5cbb('0x1e')](_0x4aa3a2);return _0x271929[_0x5cbb('0x24')](_0x5cbb('0x25'),_0x32e4c5+'-'+_0x39e961+'/'+_0x14657c)[_0x5cbb('0x1f')](_0x451256);}return null;};}function patchUpdates(_0x43e17c){return function(_0x5770ed){try{jsonpatch[_0x5cbb('0x26')](_0x5770ed,_0x43e17c,!![]);}catch(_0x45a898){return BPromise['reject'](_0x45a898);}return _0x5770ed[_0x5cbb('0x27')]();};}function saveUpdates(_0x1b63b0,_0x59bc45){return function(_0x155889){if(_0x155889){return _0x155889[_0x5cbb('0x28')](_0x1b63b0)['then'](function(_0x8c5eae){return _0x8c5eae;});}return null;};}function removeEntity(_0x36377c,_0x2b236e){return function(_0x231508){if(_0x231508){return _0x231508[_0x5cbb('0x29')]()[_0x5cbb('0x2a')](function(){_0x36377c[_0x5cbb('0x1e')](0xcc)[_0x5cbb('0x2b')]();});}};}function handleEntityNotFound(_0x3200df,_0x4319ae){return function(_0x5f17b7){if(!_0x5f17b7){_0x3200df[_0x5cbb('0x1d')](0x194);}return _0x5f17b7;};}function handleError(_0x26cc3a,_0x566943){_0x566943=_0x566943||0x1f4;return function(_0x152d18){logger[_0x5cbb('0x2c')](_0x152d18[_0x5cbb('0x2d')]);if(_0x152d18['name']){delete _0x152d18[_0x5cbb('0x2e')];}_0x26cc3a[_0x5cbb('0x1e')](_0x566943)[_0x5cbb('0x2f')](_0x152d18);};}exports['index']=function(_0x855d15,_0x428af0){var _0x31838a={},_0x15d9a6={},_0x584d94={'count':0x0,'rows':[]};var _0x2857d6=_[_0x5cbb('0x30')](db[_0x5cbb('0x31')]['rawAttributes'],function(_0x418758){return{'name':_0x418758[_0x5cbb('0x32')],'type':_0x418758[_0x5cbb('0x33')][_0x5cbb('0x34')]};});_0x15d9a6[_0x5cbb('0x35')]=_[_0x5cbb('0x30')](_0x2857d6,_0x5cbb('0x2e'));_0x15d9a6[_0x5cbb('0x36')]=_[_0x5cbb('0x37')](_0x855d15[_0x5cbb('0x36')]);_0x15d9a6[_0x5cbb('0x38')]=_['intersection'](_0x15d9a6['model'],_0x15d9a6[_0x5cbb('0x36')]);_0x31838a[_0x5cbb('0x39')]=_[_0x5cbb('0x3a')](_0x15d9a6[_0x5cbb('0x35')],qs[_0x5cbb('0x3b')](_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x3b')]));_0x31838a[_0x5cbb('0x39')]=_0x31838a[_0x5cbb('0x39')][_0x5cbb('0x3c')]?_0x31838a[_0x5cbb('0x39')]:_0x15d9a6[_0x5cbb('0x35')];if(!_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x3d')](_0x5cbb('0x3e'))){_0x31838a['limit']=qs[_0x5cbb('0x22')](_0x855d15[_0x5cbb('0x36')]['limit']);_0x31838a[_0x5cbb('0x20')]=qs[_0x5cbb('0x20')](_0x855d15['query'][_0x5cbb('0x20')]);}_0x31838a[_0x5cbb('0x3f')]=qs[_0x5cbb('0x40')](_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x40')]);_0x31838a[_0x5cbb('0x41')]=qs['filters'](_[_0x5cbb('0x42')](_0x855d15[_0x5cbb('0x36')],_0x15d9a6[_0x5cbb('0x38')]),_0x2857d6);if(_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x43')]){_0x31838a['where']=_[_0x5cbb('0x44')](_0x31838a[_0x5cbb('0x41')],{'$or':_[_0x5cbb('0x30')](_0x2857d6,function(_0x453391){if(_0x453391['type']!=='VIRTUAL'){var _0x5b2860={};_0x5b2860[_0x453391[_0x5cbb('0x2e')]]={'$like':'%'+_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x43')]+'%'};return _0x5b2860;}})});}_0x31838a=_['merge']({},_0x31838a,_0x855d15[_0x5cbb('0x45')]);var _0x42876a={'where':_0x31838a[_0x5cbb('0x41')]};return db['FaxTransferReport'][_0x5cbb('0x23')](_0x42876a)[_0x5cbb('0x2a')](function(_0x19ba2e){_0x584d94['count']=_0x19ba2e;if(_0x855d15[_0x5cbb('0x36')][_0x5cbb('0x46')]){_0x31838a[_0x5cbb('0x47')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x5cbb('0x48')](_0x31838a);})[_0x5cbb('0x2a')](function(_0x13fee4){_0x584d94[_0x5cbb('0x49')]=_0x13fee4;return _0x584d94;})[_0x5cbb('0x2a')](respondWithFilteredResult(_0x428af0,_0x31838a))[_0x5cbb('0x4a')](handleError(_0x428af0,null));};exports[_0x5cbb('0x4b')]=function(_0x19b277,_0x39e5de){var _0x30d9a0={'raw':!![],'where':{'id':_0x19b277[_0x5cbb('0x4c')]['id']}},_0x37726d={};_0x37726d[_0x5cbb('0x35')]=_[_0x5cbb('0x37')](db[_0x5cbb('0x31')][_0x5cbb('0x4d')]);_0x37726d[_0x5cbb('0x36')]=_[_0x5cbb('0x37')](_0x19b277['query']);_0x37726d[_0x5cbb('0x38')]=_[_0x5cbb('0x3a')](_0x37726d['model'],_0x37726d['query']);_0x30d9a0['attributes']=_[_0x5cbb('0x3a')](_0x37726d[_0x5cbb('0x35')],qs[_0x5cbb('0x3b')](_0x19b277[_0x5cbb('0x36')]['fields']));_0x30d9a0[_0x5cbb('0x39')]=_0x30d9a0[_0x5cbb('0x39')][_0x5cbb('0x3c')]?_0x30d9a0['attributes']:_0x37726d[_0x5cbb('0x35')];if(_0x19b277[_0x5cbb('0x36')][_0x5cbb('0x46')]){_0x30d9a0[_0x5cbb('0x47')]=[{'all':!![]}];}_0x30d9a0=_['merge']({},_0x30d9a0,_0x19b277[_0x5cbb('0x45')]);return db['FaxTransferReport'][_0x5cbb('0x4e')](_0x30d9a0)['then'](handleEntityNotFound(_0x39e5de,null))[_0x5cbb('0x2a')](respondWithResult(_0x39e5de,null))[_0x5cbb('0x4a')](handleError(_0x39e5de,null));};exports[_0x5cbb('0x4f')]=function(_0x4ae8fa,_0xd7a2be){return db[_0x5cbb('0x31')][_0x5cbb('0x4f')](_0x4ae8fa[_0x5cbb('0x50')],{})[_0x5cbb('0x2a')](respondWithResult(_0xd7a2be,0xc9))[_0x5cbb('0x4a')](handleError(_0xd7a2be,null));};exports[_0x5cbb('0x28')]=function(_0x5a8290,_0x272322){if(_0x5a8290[_0x5cbb('0x50')]['id']){delete _0x5a8290[_0x5cbb('0x50')]['id'];}return db[_0x5cbb('0x31')]['find']({'where':{'id':_0x5a8290[_0x5cbb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x272322,null))[_0x5cbb('0x2a')](saveUpdates(_0x5a8290[_0x5cbb('0x50')],null))[_0x5cbb('0x2a')](respondWithResult(_0x272322,null))[_0x5cbb('0x4a')](handleError(_0x272322,null));};exports[_0x5cbb('0x29')]=function(_0x28bcde,_0x480bab){return db[_0x5cbb('0x31')][_0x5cbb('0x4e')]({'where':{'id':_0x28bcde[_0x5cbb('0x4c')]['id']}})[_0x5cbb('0x2a')](handleEntityNotFound(_0x480bab,null))[_0x5cbb('0x2a')](removeEntity(_0x480bab,null))[_0x5cbb('0x4a')](handleError(_0x480bab,null));};exports[_0x5cbb('0x51')]=function(_0x59269e,_0x3d3d0b){return db[_0x5cbb('0x31')]['describe']()[_0x5cbb('0x2a')](respondWithResult(_0x3d3d0b,null))['catch'](handleError(_0x3d3d0b,null));}; \ No newline at end of file +var _0x6392=['type','key','map','query','keys','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','intersection','find','catch','create','body','describe','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','error','name','index','FaxTransferReport','rawAttributes','fieldName'];(function(_0x112bc0,_0x1dc182){var _0x580244=function(_0x93c9d2){while(--_0x93c9d2){_0x112bc0['push'](_0x112bc0['shift']());}};_0x580244(++_0x1dc182);}(_0x6392,0x67));var _0x2639=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x6392[_0x15fa77];return _0x1385ff;};'use strict';var emlformat=require(_0x2639('0x0'));var rimraf=require(_0x2639('0x1'));var zipdir=require(_0x2639('0x2'));var jsonpatch=require(_0x2639('0x3'));var rp=require(_0x2639('0x4'));var moment=require(_0x2639('0x5'));var BPromise=require(_0x2639('0x6'));var Mustache=require(_0x2639('0x7'));var util=require(_0x2639('0x8'));var path=require(_0x2639('0x9'));var sox=require('sox');var csv=require(_0x2639('0xa'));var ejs=require(_0x2639('0xb'));var fs=require('fs');var fs_extra=require(_0x2639('0xc'));var _=require(_0x2639('0xd'));var squel=require(_0x2639('0xe'));var crypto=require('crypto');var jsforce=require(_0x2639('0xf'));var deskjs=require(_0x2639('0x10'));var toCsv=require(_0x2639('0xa'));var querystring=require(_0x2639('0x11'));var Papa=require(_0x2639('0x12'));var Redis=require(_0x2639('0x13'));var authService=require(_0x2639('0x14'));var qs=require(_0x2639('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2639('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2639('0x17'));var licenseUtil=require(_0x2639('0x18'));var db=require(_0x2639('0x19'))['db'];function respondWithStatusCode(_0x217c2d,_0x3d9d1e){_0x3d9d1e=_0x3d9d1e||0xcc;return function(_0x29d9c2){if(_0x29d9c2){return _0x217c2d[_0x2639('0x1a')](_0x3d9d1e);}return _0x217c2d[_0x2639('0x1b')](_0x3d9d1e)[_0x2639('0x1c')]();};}function respondWithResult(_0x24493e,_0x1096fa){_0x1096fa=_0x1096fa||0xc8;return function(_0x1d6aaa){if(_0x1d6aaa){return _0x24493e[_0x2639('0x1b')](_0x1096fa)[_0x2639('0x1d')](_0x1d6aaa);}};}function respondWithFilteredResult(_0x57803f,_0x39f794){return function(_0xe365ce){if(_0xe365ce){var _0xbbb2ac=typeof _0x39f794['offset']==='undefined'&&typeof _0x39f794[_0x2639('0x1e')]===_0x2639('0x1f');var _0x437767=_0xe365ce[_0x2639('0x20')];var _0x45174f=_0xbbb2ac?0x0:_0x39f794[_0x2639('0x21')];var _0x50ed27=_0xbbb2ac?_0xe365ce[_0x2639('0x20')]:_0x39f794[_0x2639('0x21')]+_0x39f794[_0x2639('0x1e')];var _0x48e4e1;if(_0x50ed27>=_0x437767){_0x50ed27=_0x437767;_0x48e4e1=0xc8;}else{_0x48e4e1=0xce;}_0x57803f[_0x2639('0x1b')](_0x48e4e1);return _0x57803f[_0x2639('0x22')](_0x2639('0x23'),_0x45174f+'-'+_0x50ed27+'/'+_0x437767)[_0x2639('0x1d')](_0xe365ce);}return null;};}function patchUpdates(_0x4216b8){return function(_0x1c0f37){try{jsonpatch[_0x2639('0x24')](_0x1c0f37,_0x4216b8,!![]);}catch(_0x3a03f6){return BPromise['reject'](_0x3a03f6);}return _0x1c0f37['save']();};}function saveUpdates(_0x3be1ac,_0x5c3a1a){return function(_0x123672){if(_0x123672){return _0x123672[_0x2639('0x25')](_0x3be1ac)[_0x2639('0x26')](function(_0x47b631){return _0x47b631;});}return null;};}function removeEntity(_0x3b0857,_0x330743){return function(_0x1fadad){if(_0x1fadad){return _0x1fadad['destroy']()[_0x2639('0x26')](function(){_0x3b0857[_0x2639('0x1b')](0xcc)[_0x2639('0x1c')]();});}};}function handleEntityNotFound(_0x14ae6f,_0x208659){return function(_0x109d4c){if(!_0x109d4c){_0x14ae6f[_0x2639('0x1a')](0x194);}return _0x109d4c;};}function handleError(_0xfdb434,_0xd84496){_0xd84496=_0xd84496||0x1f4;return function(_0x2f1311){logger[_0x2639('0x27')](_0x2f1311['stack']);if(_0x2f1311[_0x2639('0x28')]){delete _0x2f1311[_0x2639('0x28')];}_0xfdb434[_0x2639('0x1b')](_0xd84496)['send'](_0x2f1311);};}exports[_0x2639('0x29')]=function(_0x4e99c9,_0x4a1f94){var _0x37f1ea={},_0x952b5f={},_0x562a72={'count':0x0,'rows':[]};var _0x32ea7c=_['map'](db[_0x2639('0x2a')][_0x2639('0x2b')],function(_0xf596ac){return{'name':_0xf596ac[_0x2639('0x2c')],'type':_0xf596ac[_0x2639('0x2d')][_0x2639('0x2e')]};});_0x952b5f['model']=_[_0x2639('0x2f')](_0x32ea7c,_0x2639('0x28'));_0x952b5f[_0x2639('0x30')]=_[_0x2639('0x31')](_0x4e99c9[_0x2639('0x30')]);_0x952b5f['filters']=_['intersection'](_0x952b5f['model'],_0x952b5f['query']);_0x37f1ea[_0x2639('0x32')]=_['intersection'](_0x952b5f[_0x2639('0x33')],qs[_0x2639('0x34')](_0x4e99c9['query'][_0x2639('0x34')]));_0x37f1ea['attributes']=_0x37f1ea[_0x2639('0x32')][_0x2639('0x35')]?_0x37f1ea[_0x2639('0x32')]:_0x952b5f[_0x2639('0x33')];if(!_0x4e99c9['query'][_0x2639('0x36')](_0x2639('0x37'))){_0x37f1ea[_0x2639('0x1e')]=qs[_0x2639('0x1e')](_0x4e99c9[_0x2639('0x30')]['limit']);_0x37f1ea['offset']=qs[_0x2639('0x21')](_0x4e99c9[_0x2639('0x30')][_0x2639('0x21')]);}_0x37f1ea['order']=qs[_0x2639('0x38')](_0x4e99c9[_0x2639('0x30')][_0x2639('0x38')]);_0x37f1ea[_0x2639('0x39')]=qs[_0x2639('0x3a')](_[_0x2639('0x3b')](_0x4e99c9[_0x2639('0x30')],_0x952b5f['filters']),_0x32ea7c);if(_0x4e99c9[_0x2639('0x30')][_0x2639('0x3c')]){_0x37f1ea[_0x2639('0x39')]=_[_0x2639('0x3d')](_0x37f1ea[_0x2639('0x39')],{'$or':_[_0x2639('0x2f')](_0x32ea7c,function(_0x52674f){if(_0x52674f['type']!==_0x2639('0x3e')){var _0x3228ee={};_0x3228ee[_0x52674f[_0x2639('0x28')]]={'$like':'%'+_0x4e99c9['query'][_0x2639('0x3c')]+'%'};return _0x3228ee;}})});}_0x37f1ea=_[_0x2639('0x3d')]({},_0x37f1ea,_0x4e99c9[_0x2639('0x3f')]);var _0x20bc56={'where':_0x37f1ea[_0x2639('0x39')]};return db['FaxTransferReport'][_0x2639('0x20')](_0x20bc56)[_0x2639('0x26')](function(_0x32c246){_0x562a72[_0x2639('0x20')]=_0x32c246;if(_0x4e99c9['query'][_0x2639('0x40')]){_0x37f1ea['include']=[{'all':!![]}];}return db[_0x2639('0x2a')]['findAll'](_0x37f1ea);})[_0x2639('0x26')](function(_0x264fb9){_0x562a72[_0x2639('0x41')]=_0x264fb9;return _0x562a72;})[_0x2639('0x26')](respondWithFilteredResult(_0x4a1f94,_0x37f1ea))['catch'](handleError(_0x4a1f94,null));};exports[_0x2639('0x42')]=function(_0x36c41b,_0x521168){var _0x4e37ea={'raw':!![],'where':{'id':_0x36c41b[_0x2639('0x43')]['id']}},_0x171409={};_0x171409[_0x2639('0x33')]=_['keys'](db[_0x2639('0x2a')][_0x2639('0x2b')]);_0x171409[_0x2639('0x30')]=_['keys'](_0x36c41b[_0x2639('0x30')]);_0x171409[_0x2639('0x3a')]=_[_0x2639('0x44')](_0x171409[_0x2639('0x33')],_0x171409[_0x2639('0x30')]);_0x4e37ea['attributes']=_['intersection'](_0x171409[_0x2639('0x33')],qs[_0x2639('0x34')](_0x36c41b[_0x2639('0x30')][_0x2639('0x34')]));_0x4e37ea[_0x2639('0x32')]=_0x4e37ea['attributes'][_0x2639('0x35')]?_0x4e37ea[_0x2639('0x32')]:_0x171409['model'];if(_0x36c41b['query'][_0x2639('0x40')]){_0x4e37ea['include']=[{'all':!![]}];}_0x4e37ea=_['merge']({},_0x4e37ea,_0x36c41b[_0x2639('0x3f')]);return db[_0x2639('0x2a')][_0x2639('0x45')](_0x4e37ea)['then'](handleEntityNotFound(_0x521168,null))[_0x2639('0x26')](respondWithResult(_0x521168,null))[_0x2639('0x46')](handleError(_0x521168,null));};exports[_0x2639('0x47')]=function(_0x2f3f87,_0x15801e){return db['FaxTransferReport'][_0x2639('0x47')](_0x2f3f87[_0x2639('0x48')],{})[_0x2639('0x26')](respondWithResult(_0x15801e,0xc9))[_0x2639('0x46')](handleError(_0x15801e,null));};exports[_0x2639('0x25')]=function(_0x50fc51,_0x1add77){if(_0x50fc51['body']['id']){delete _0x50fc51[_0x2639('0x48')]['id'];}return db[_0x2639('0x2a')][_0x2639('0x45')]({'where':{'id':_0x50fc51['params']['id']}})[_0x2639('0x26')](handleEntityNotFound(_0x1add77,null))['then'](saveUpdates(_0x50fc51[_0x2639('0x48')],null))['then'](respondWithResult(_0x1add77,null))[_0x2639('0x46')](handleError(_0x1add77,null));};exports['destroy']=function(_0x139161,_0x15575d){return db[_0x2639('0x2a')][_0x2639('0x45')]({'where':{'id':_0x139161['params']['id']}})[_0x2639('0x26')](handleEntityNotFound(_0x15575d,null))[_0x2639('0x26')](removeEntity(_0x15575d,null))['catch'](handleError(_0x15575d,null));};exports[_0x2639('0x49')]=function(_0x1cf9a5,_0x38478f){return db[_0x2639('0x2a')]['describe']()[_0x2639('0x26')](respondWithResult(_0x38478f,null))['catch'](handleError(_0x38478f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d3477c2..dbd245d 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 _0x184c=['lodash','util','../../config/logger','api','moment','bluebird','path','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid'];(function(_0x30e87f,_0x31a189){var _0x24f29c=function(_0x43b5b7){while(--_0x43b5b7){_0x30e87f['push'](_0x30e87f['shift']());}};_0x24f29c(++_0x31a189);}(_0x184c,0x1c3));var _0xc184=function(_0x40a6f8,_0x352a00){_0x40a6f8=_0x40a6f8-0x0;var _0x270eb3=_0x184c[_0x40a6f8];return _0x270eb3;};'use strict';var _=require(_0xc184('0x0'));var util=require(_0xc184('0x1'));var logger=require(_0xc184('0x2'))(_0xc184('0x3'));var moment=require(_0xc184('0x4'));var BPromise=require(_0xc184('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc184('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc184('0x7'));module['exports']=function(_0xb3c6d1,_0x2b880d){return _0xb3c6d1[_0xc184('0x8')]('FaxTransferReport',attributes,{'tableName':_0xc184('0x9'),'paranoid':![],'indexes':[{'name':_0xc184('0xa'),'fields':[_0xc184('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad3e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xad3e,0xa9));var _0xead3=function(_0x1589f8,_0x4810cd){_0x1589f8=_0x1589f8-0x0;var _0x1c58ee=_0xad3e[_0x1589f8];return _0x1c58ee;};'use strict';var _=require(_0xead3('0x0'));var util=require(_0xead3('0x1'));var logger=require(_0xead3('0x2'))(_0xead3('0x3'));var moment=require(_0xead3('0x4'));var BPromise=require(_0xead3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xead3('0x6'));var rimraf=require(_0xead3('0x7'));var config=require(_0xead3('0x8'));var attributes=require(_0xead3('0x9'));module[_0xead3('0xa')]=function(_0x1d09c1,_0x27fe31){return _0x1d09c1['define']('FaxTransferReport',attributes,{'tableName':_0xead3('0xb'),'paranoid':![],'indexes':[{'name':_0xead3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 9643169..e1c23dc 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 _0xbcc8=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s'];(function(_0x38cfe3,_0x2fa402){var _0x495931=function(_0xa8ed78){while(--_0xa8ed78){_0x38cfe3['push'](_0x38cfe3['shift']());}};_0x495931(++_0x2fa402);}(_0xbcc8,0xf9));var _0x8bcc=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xbcc8[_0x3ec333];return _0x15ccb8;};'use strict';var _=require('lodash');var util=require(_0x8bcc('0x0'));var moment=require(_0x8bcc('0x1'));var BPromise=require(_0x8bcc('0x2'));var rs=require(_0x8bcc('0x3'));var fs=require('fs');var Redis=require(_0x8bcc('0x4'));var db=require(_0x8bcc('0x5'))['db'];var utils=require(_0x8bcc('0x6'));var logger=require(_0x8bcc('0x7'))(_0x8bcc('0x8'));var config=require(_0x8bcc('0x9'));var jayson=require(_0x8bcc('0xa'));var client=jayson[_0x8bcc('0xb')][_0x8bcc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25db2f,_0x5bf173,_0x6ee31f){return new BPromise(function(_0x5f3766,_0x4f2cb0){return client[_0x8bcc('0xd')](_0x25db2f,_0x6ee31f)['then'](function(_0x40f946){logger['info'](_0x8bcc('0xe'),_0x5bf173,'request\x20sent');logger[_0x8bcc('0xf')](_0x8bcc('0x10'),_0x5bf173,_0x8bcc('0x11'),JSON[_0x8bcc('0x12')](_0x40f946));if(_0x40f946[_0x8bcc('0x13')]){if(_0x40f946[_0x8bcc('0x13')][_0x8bcc('0x14')]===0x1f4){logger[_0x8bcc('0x13')](_0x8bcc('0xe'),_0x5bf173,_0x40f946[_0x8bcc('0x13')][_0x8bcc('0x15')]);return _0x4f2cb0(_0x40f946['error'][_0x8bcc('0x15')]);}logger[_0x8bcc('0x13')](_0x8bcc('0xe'),_0x5bf173,_0x40f946['error'][_0x8bcc('0x15')]);return _0x5f3766(_0x40f946[_0x8bcc('0x13')][_0x8bcc('0x15')]);}else{logger[_0x8bcc('0x16')]('FaxTransferReport,\x20%s,\x20%s',_0x5bf173,_0x8bcc('0x11'));_0x5f3766(_0x40f946['result']['message']);}})[_0x8bcc('0x17')](function(_0x52835c){logger['error'](_0x8bcc('0xe'),_0x5bf173,_0x52835c);_0x4f2cb0(_0x52835c);});});} \ No newline at end of file +var _0xef99=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util'];(function(_0x5328d6,_0x18da5b){var _0x5b509d=function(_0x580a79){while(--_0x580a79){_0x5328d6['push'](_0x5328d6['shift']());}};_0x5b509d(++_0x18da5b);}(_0xef99,0x155));var _0x9ef9=function(_0x475b29,_0x48857c){_0x475b29=_0x475b29-0x0;var _0x12c247=_0xef99[_0x475b29];return _0x12c247;};'use strict';var _=require('lodash');var util=require(_0x9ef9('0x0'));var moment=require('moment');var BPromise=require(_0x9ef9('0x1'));var rs=require(_0x9ef9('0x2'));var fs=require('fs');var Redis=require(_0x9ef9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ef9('0x4'));var logger=require(_0x9ef9('0x5'))('rpc');var config=require(_0x9ef9('0x6'));var jayson=require(_0x9ef9('0x7'));var client=jayson[_0x9ef9('0x8')][_0x9ef9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30021e,_0x325f15,_0x525271){return new BPromise(function(_0x11de80,_0x42d5d4){return client[_0x9ef9('0xa')](_0x30021e,_0x525271)['then'](function(_0x548035){logger[_0x9ef9('0xb')](_0x9ef9('0xc'),_0x325f15,_0x9ef9('0xd'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x325f15,'request\x20sent',JSON[_0x9ef9('0xe')](_0x548035));if(_0x548035[_0x9ef9('0xf')]){if(_0x548035['error'][_0x9ef9('0x10')]===0x1f4){logger[_0x9ef9('0xf')](_0x9ef9('0xc'),_0x325f15,_0x548035[_0x9ef9('0xf')][_0x9ef9('0x11')]);return _0x42d5d4(_0x548035[_0x9ef9('0xf')][_0x9ef9('0x11')]);}logger[_0x9ef9('0xf')](_0x9ef9('0xc'),_0x325f15,_0x548035[_0x9ef9('0xf')][_0x9ef9('0x11')]);return _0x11de80(_0x548035[_0x9ef9('0xf')][_0x9ef9('0x11')]);}else{logger[_0x9ef9('0xb')](_0x9ef9('0xc'),_0x325f15,_0x9ef9('0xd'));_0x11de80(_0x548035['result']['message']);}})[_0x9ef9('0x12')](function(_0x369517){logger['error'](_0x9ef9('0xc'),_0x325f15,_0x369517);_0x42d5d4(_0x369517);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index de97df9..157916b 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 _0x7ed3=['/describe','describe','get','/:id','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7ed3,0x82));var _0x37ed=function(_0x23cb11,_0x238827){_0x23cb11=_0x23cb11-0x0;var _0x7a0e1=_0x7ed3[_0x23cb11];return _0x7a0e1;};'use strict';var multer=require(_0x37ed('0x0'));var util=require(_0x37ed('0x1'));var path=require(_0x37ed('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x37ed('0x3')]();var fs_extra=require(_0x37ed('0x4'));var auth=require(_0x37ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x37ed('0x6'));var controller=require(_0x37ed('0x7'));router['get']('/',auth[_0x37ed('0x8')](),controller[_0x37ed('0x9')]);router['get'](_0x37ed('0xa'),auth[_0x37ed('0x8')](),controller[_0x37ed('0xb')]);router[_0x37ed('0xc')](_0x37ed('0xd'),auth[_0x37ed('0x8')](),controller['show']);router[_0x37ed('0xe')]('/',auth['isAuthenticated'](),controller[_0x37ed('0xf')]);router[_0x37ed('0x10')](_0x37ed('0xd'),auth[_0x37ed('0x8')](),controller['update']);router[_0x37ed('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x37ed('0x12')]);module[_0x37ed('0x13')]=router; \ No newline at end of file +var _0xa6fb=['/describe','describe','/:id','post','create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated','index'];(function(_0x289dd4,_0x467823){var _0x5ac194=function(_0x4305e2){while(--_0x4305e2){_0x289dd4['push'](_0x289dd4['shift']());}};_0x5ac194(++_0x467823);}(_0xa6fb,0x14d));var _0xba6f=function(_0x24bce5,_0x2b85be){_0x24bce5=_0x24bce5-0x0;var _0x48fa6f=_0xa6fb[_0x24bce5];return _0x48fa6f;};'use strict';var multer=require('multer');var util=require(_0xba6f('0x0'));var path=require(_0xba6f('0x1'));var timeout=require(_0xba6f('0x2'));var express=require('express');var router=express[_0xba6f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xba6f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xba6f('0x5'));router[_0xba6f('0x6')]('/',auth[_0xba6f('0x7')](),controller[_0xba6f('0x8')]);router[_0xba6f('0x6')](_0xba6f('0x9'),auth['isAuthenticated'](),controller[_0xba6f('0xa')]);router[_0xba6f('0x6')](_0xba6f('0xb'),auth[_0xba6f('0x7')](),controller['show']);router[_0xba6f('0xc')]('/',auth[_0xba6f('0x7')](),controller[_0xba6f('0xd')]);router[_0xba6f('0xe')](_0xba6f('0xb'),auth[_0xba6f('0x7')](),controller[_0xba6f('0xf')]);router[_0xba6f('0x10')](_0xba6f('0xb'),auth[_0xba6f('0x7')](),controller['destroy']);module[_0xba6f('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 54c7434..9b02af3 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 _0x3d6e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','update','delete','destroy','exports','multer','path'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x3d6e,0xe5));var _0xe3d6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3d6e[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xe3d6('0x0'));var util=require('util');var path=require(_0xe3d6('0x1'));var timeout=require('connect-timeout');var express=require(_0xe3d6('0x2'));var router=express[_0xe3d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe3d6('0x4'));var interaction=require(_0xe3d6('0x5'));var config=require(_0xe3d6('0x6'));var controller=require(_0xe3d6('0x7'));router[_0xe3d6('0x8')]('/',auth[_0xe3d6('0x9')](),controller['index']);router[_0xe3d6('0x8')](_0xe3d6('0xa'),auth[_0xe3d6('0x9')](),controller[_0xe3d6('0xb')]);router[_0xe3d6('0x8')]('/:id/configurations',auth[_0xe3d6('0x9')](),controller[_0xe3d6('0xc')]);router[_0xe3d6('0x8')](_0xe3d6('0xd'),auth[_0xe3d6('0x9')](),controller[_0xe3d6('0xe')]);router['post']('/',auth[_0xe3d6('0x9')](),controller[_0xe3d6('0xf')]);router['post'](_0xe3d6('0x10'),auth[_0xe3d6('0x9')](),controller['addConfiguration']);router['put'](_0xe3d6('0xa'),auth[_0xe3d6('0x9')](),controller[_0xe3d6('0x11')]);router[_0xe3d6('0x12')](_0xe3d6('0xa'),auth[_0xe3d6('0x9')](),controller[_0xe3d6('0x13')]);module[_0xe3d6('0x14')]=router; \ No newline at end of file +var _0xd991=['get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller'];(function(_0x5eba27,_0xf0140d){var _0x250fb5=function(_0x1df729){while(--_0x1df729){_0x5eba27['push'](_0x5eba27['shift']());}};_0x250fb5(++_0xf0140d);}(_0xd991,0x100));var _0x1d99=function(_0x2098f2,_0x47fb83){_0x2098f2=_0x2098f2-0x0;var _0xbd6395=_0xd991[_0x2098f2];return _0xbd6395;};'use strict';var multer=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var path=require(_0x1d99('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d99('0x3'));var router=express[_0x1d99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d99('0x5'));var interaction=require(_0x1d99('0x6'));var config=require('../../config/environment');var controller=require(_0x1d99('0x7'));router[_0x1d99('0x8')]('/',auth[_0x1d99('0x9')](),controller[_0x1d99('0xa')]);router['get'](_0x1d99('0xb'),auth[_0x1d99('0x9')](),controller[_0x1d99('0xc')]);router['get']('/:id/configurations',auth[_0x1d99('0x9')](),controller[_0x1d99('0xd')]);router['get'](_0x1d99('0xe'),auth[_0x1d99('0x9')](),controller[_0x1d99('0xf')]);router[_0x1d99('0x10')]('/',auth[_0x1d99('0x9')](),controller[_0x1d99('0x11')]);router['post'](_0x1d99('0x12'),auth['isAuthenticated'](),controller[_0x1d99('0x13')]);router[_0x1d99('0x14')](_0x1d99('0xb'),auth[_0x1d99('0x9')](),controller[_0x1d99('0x15')]);router[_0x1d99('0x16')](_0x1d99('0xb'),auth[_0x1d99('0x9')](),controller[_0x1d99('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 297c361..64f0d8a 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 _0x2d0d=['basic','newTab','integrationTab','sequelize','STRING','ENUM'];(function(_0x1f288b,_0x1d6ce2){var _0x31e0db=function(_0x54033e){while(--_0x54033e){_0x1f288b['push'](_0x1f288b['shift']());}};_0x31e0db(++_0x1d6ce2);}(_0x2d0d,0x6f));var _0xd2d0=function(_0x179fd7,_0x298f8a){_0x179fd7=_0x179fd7-0x0;var _0x5a13bd=_0x2d0d[_0x179fd7];return _0x5a13bd;};'use strict';var Sequelize=require(_0xd2d0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd2d0('0x1')]},'username':{'type':Sequelize[_0xd2d0('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xd2d0('0x2')](_0xd2d0('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd2d0('0x1')]},'consumerKey':{'type':Sequelize[_0xd2d0('0x1')]},'consumerSecret':{'type':Sequelize[_0xd2d0('0x1')]},'token':{'type':Sequelize[_0xd2d0('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd2d0('0x2')]('integrationTab',_0xd2d0('0x4')),'defaultValue':_0xd2d0('0x5')}}; \ No newline at end of file +var _0xe7ff=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x3aaebf,_0x1c6a98){var _0x101620=function(_0x3538ca){while(--_0x3538ca){_0x3aaebf['push'](_0x3aaebf['shift']());}};_0x101620(++_0x1c6a98);}(_0xe7ff,0x16f));var _0xfe7f=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xe7ff[_0x25a42a];return _0x1129b1;};'use strict';var Sequelize=require(_0xfe7f('0x0'));module[_0xfe7f('0x1')]={'name':{'type':Sequelize[_0xfe7f('0x2')]},'description':{'type':Sequelize[_0xfe7f('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfe7f('0x2')]},'authType':{'type':Sequelize[_0xfe7f('0x3')](_0xfe7f('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xfe7f('0x2')]},'consumerKey':{'type':Sequelize[_0xfe7f('0x2')]},'consumerSecret':{'type':Sequelize[_0xfe7f('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfe7f('0x3')](_0xfe7f('0x5'),_0xfe7f('0x6')),'defaultValue':_0xfe7f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 4470af0..b04e54b 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 _0xf719=['../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','then','end','stack','name','send','index','DeskAccount','rawAttributes','type','key','query','keys','filters','attributes','intersection','fields','model','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','getConfigurations','findOne','DeskConfiguration','length','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','priority','authType','consumerKey','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','username','toString','_embedded','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','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'];(function(_0x5d8778,_0x3c2f0e){var _0x133e42=function(_0x2c23aa){while(--_0x2c23aa){_0x5d8778['push'](_0x5d8778['shift']());}};_0x133e42(++_0x3c2f0e);}(_0xf719,0xca));var _0x9f71=function(_0x5b6064,_0x376df5){_0x5b6064=_0x5b6064-0x0;var _0x1f5b14=_0xf719[_0x5b6064];return _0x1f5b14;};'use strict';var emlformat=require(_0x9f71('0x0'));var rimraf=require(_0x9f71('0x1'));var zipdir=require(_0x9f71('0x2'));var jsonpatch=require(_0x9f71('0x3'));var rp=require('request-promise');var moment=require(_0x9f71('0x4'));var BPromise=require(_0x9f71('0x5'));var Mustache=require(_0x9f71('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9f71('0x7'));var csv=require(_0x9f71('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f71('0x9'));var _=require('lodash');var squel=require(_0x9f71('0xa'));var crypto=require(_0x9f71('0xb'));var jsforce=require(_0x9f71('0xc'));var deskjs=require(_0x9f71('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f71('0xe'));var Papa=require(_0x9f71('0xf'));var Redis=require(_0x9f71('0x10'));var authService=require(_0x9f71('0x11'));var qs=require(_0x9f71('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f71('0x13'));var logger=require(_0x9f71('0x14'))('api');var utils=require(_0x9f71('0x15'));var config=require(_0x9f71('0x16'));var licenseUtil=require(_0x9f71('0x17'));var db=require(_0x9f71('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x233e50,_0xa158b3){_0xa158b3=_0xa158b3||0xcc;return function(_0x447055){if(_0x447055){return _0x233e50[_0x9f71('0x19')](_0xa158b3);}return _0x233e50['status'](_0xa158b3)['end']();};}function respondWithResult(_0xb44b39,_0x47d51a){_0x47d51a=_0x47d51a||0xc8;return function(_0x329fde){if(_0x329fde){return _0xb44b39[_0x9f71('0x1a')](_0x47d51a)['json'](_0x329fde);}};}function respondWithFilteredResult(_0x25c51f,_0x2fd8e1){return function(_0xfa4f32){if(_0xfa4f32){var _0x3169cc=typeof _0x2fd8e1['offset']===_0x9f71('0x1b')&&typeof _0x2fd8e1[_0x9f71('0x1c')]===_0x9f71('0x1b');var _0x14f921=_0xfa4f32[_0x9f71('0x1d')];var _0x409149=_0x3169cc?0x0:_0x2fd8e1[_0x9f71('0x1e')];var _0x244793=_0x3169cc?_0xfa4f32[_0x9f71('0x1d')]:_0x2fd8e1[_0x9f71('0x1e')]+_0x2fd8e1[_0x9f71('0x1c')];var _0x13553e;if(_0x244793>=_0x14f921){_0x244793=_0x14f921;_0x13553e=0xc8;}else{_0x13553e=0xce;}_0x25c51f[_0x9f71('0x1a')](_0x13553e);return _0x25c51f['set'](_0x9f71('0x1f'),_0x409149+'-'+_0x244793+'/'+_0x14f921)[_0x9f71('0x20')](_0xfa4f32);}return null;};}function patchUpdates(_0x5c1719){return function(_0x48260c){try{jsonpatch[_0x9f71('0x21')](_0x48260c,_0x5c1719,!![]);}catch(_0x4cd9b0){return BPromise[_0x9f71('0x22')](_0x4cd9b0);}return _0x48260c['save']();};}function saveUpdates(_0x331b2e,_0x400e95){return function(_0x3a075a){if(_0x3a075a){return _0x3a075a[_0x9f71('0x23')](_0x331b2e)['then'](function(_0x32ce01){return _0x32ce01;});}return null;};}function removeEntity(_0x370988,_0x36010b){return function(_0x40236b){if(_0x40236b){return _0x40236b[_0x9f71('0x24')]()[_0x9f71('0x25')](function(){_0x370988[_0x9f71('0x1a')](0xcc)[_0x9f71('0x26')]();});}};}function handleEntityNotFound(_0x37a584,_0x3984c0){return function(_0x7d9216){if(!_0x7d9216){_0x37a584['sendStatus'](0x194);}return _0x7d9216;};}function handleError(_0x5ac62a,_0x1895ae){_0x1895ae=_0x1895ae||0x1f4;return function(_0xba18dc){logger['error'](_0xba18dc[_0x9f71('0x27')]);if(_0xba18dc[_0x9f71('0x28')]){delete _0xba18dc[_0x9f71('0x28')];}_0x5ac62a[_0x9f71('0x1a')](_0x1895ae)[_0x9f71('0x29')](_0xba18dc);};}exports[_0x9f71('0x2a')]=function(_0x3c02ae,_0x3b35aa){var _0x1ed361={},_0x402d3a={},_0x5fde34={'count':0x0,'rows':[]};var _0x24c97c=_['map'](db[_0x9f71('0x2b')][_0x9f71('0x2c')],function(_0x158ff5){return{'name':_0x158ff5['fieldName'],'type':_0x158ff5[_0x9f71('0x2d')][_0x9f71('0x2e')]};});_0x402d3a['model']=_['map'](_0x24c97c,_0x9f71('0x28'));_0x402d3a[_0x9f71('0x2f')]=_[_0x9f71('0x30')](_0x3c02ae[_0x9f71('0x2f')]);_0x402d3a[_0x9f71('0x31')]=_['intersection'](_0x402d3a['model'],_0x402d3a['query']);_0x1ed361[_0x9f71('0x32')]=_[_0x9f71('0x33')](_0x402d3a['model'],qs[_0x9f71('0x34')](_0x3c02ae[_0x9f71('0x2f')][_0x9f71('0x34')]));_0x1ed361[_0x9f71('0x32')]=_0x1ed361[_0x9f71('0x32')]['length']?_0x1ed361[_0x9f71('0x32')]:_0x402d3a[_0x9f71('0x35')];if(!_0x3c02ae[_0x9f71('0x2f')]['hasOwnProperty']('nolimit')){_0x1ed361[_0x9f71('0x1c')]=qs[_0x9f71('0x1c')](_0x3c02ae[_0x9f71('0x2f')]['limit']);_0x1ed361['offset']=qs[_0x9f71('0x1e')](_0x3c02ae[_0x9f71('0x2f')][_0x9f71('0x1e')]);}_0x1ed361[_0x9f71('0x36')]=qs[_0x9f71('0x37')](_0x3c02ae['query']['sort']);_0x1ed361[_0x9f71('0x38')]=qs[_0x9f71('0x31')](_[_0x9f71('0x39')](_0x3c02ae[_0x9f71('0x2f')],_0x402d3a['filters']),_0x24c97c);if(_0x3c02ae[_0x9f71('0x2f')][_0x9f71('0x3a')]){_0x1ed361['where']=_['merge'](_0x1ed361['where'],{'$or':_[_0x9f71('0x3b')](_0x24c97c,function(_0x648d5){if(_0x648d5['type']!==_0x9f71('0x3c')){var _0x3627e8={};_0x3627e8[_0x648d5[_0x9f71('0x28')]]={'$like':'%'+_0x3c02ae[_0x9f71('0x2f')][_0x9f71('0x3a')]+'%'};return _0x3627e8;}})});}_0x1ed361=_[_0x9f71('0x3d')]({},_0x1ed361,_0x3c02ae[_0x9f71('0x3e')]);var _0x50b09d={'where':_0x1ed361[_0x9f71('0x38')]};return db[_0x9f71('0x2b')][_0x9f71('0x1d')](_0x50b09d)[_0x9f71('0x25')](function(_0x3dec04){_0x5fde34['count']=_0x3dec04;if(_0x3c02ae[_0x9f71('0x2f')][_0x9f71('0x3f')]){_0x1ed361[_0x9f71('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0x9f71('0x41')](_0x1ed361);})['then'](function(_0xf4d2f1){_0x5fde34[_0x9f71('0x42')]=_0xf4d2f1;return _0x5fde34;})[_0x9f71('0x25')](respondWithFilteredResult(_0x3b35aa,_0x1ed361))['catch'](handleError(_0x3b35aa,null));};exports[_0x9f71('0x43')]=function(_0x3ccf17,_0x127ef1){var _0x47059b={'raw':![],'where':{'id':_0x3ccf17[_0x9f71('0x44')]['id']}},_0x2c3f42={};_0x2c3f42[_0x9f71('0x35')]=_[_0x9f71('0x30')](db[_0x9f71('0x2b')][_0x9f71('0x2c')]);_0x2c3f42[_0x9f71('0x2f')]=_[_0x9f71('0x30')](_0x3ccf17[_0x9f71('0x2f')]);_0x2c3f42[_0x9f71('0x31')]=_[_0x9f71('0x33')](_0x2c3f42[_0x9f71('0x35')],_0x2c3f42[_0x9f71('0x2f')]);_0x47059b[_0x9f71('0x32')]=_[_0x9f71('0x33')](_0x2c3f42['model'],qs['fields'](_0x3ccf17['query'][_0x9f71('0x34')]));_0x47059b[_0x9f71('0x32')]=_0x47059b[_0x9f71('0x32')]['length']?_0x47059b[_0x9f71('0x32')]:_0x2c3f42[_0x9f71('0x35')];if(_0x3ccf17[_0x9f71('0x2f')][_0x9f71('0x3f')]){_0x47059b[_0x9f71('0x40')]=[{'all':!![]}];}_0x47059b=_[_0x9f71('0x3d')]({},_0x47059b,_0x3ccf17[_0x9f71('0x3e')]);return db[_0x9f71('0x2b')][_0x9f71('0x45')](_0x47059b)[_0x9f71('0x25')](handleEntityNotFound(_0x127ef1,null))[_0x9f71('0x25')](respondWithResult(_0x127ef1,null))['catch'](handleError(_0x127ef1,null));};exports[_0x9f71('0x46')]=function(_0x364571,_0x4ae92e){return db[_0x9f71('0x2b')][_0x9f71('0x46')](_0x364571[_0x9f71('0x47')],{})[_0x9f71('0x25')](respondWithResult(_0x4ae92e,0xc9))[_0x9f71('0x48')](handleError(_0x4ae92e,null));};exports[_0x9f71('0x23')]=function(_0x30bf91,_0x253ced){if(_0x30bf91[_0x9f71('0x47')]['id']){delete _0x30bf91['body']['id'];}return db[_0x9f71('0x2b')][_0x9f71('0x45')]({'where':{'id':_0x30bf91[_0x9f71('0x44')]['id']}})['then'](handleEntityNotFound(_0x253ced,null))['then'](saveUpdates(_0x30bf91[_0x9f71('0x47')],null))[_0x9f71('0x25')](respondWithResult(_0x253ced,null))['catch'](handleError(_0x253ced,null));};exports['destroy']=function(_0x138cb5,_0x3c733c){return db[_0x9f71('0x2b')][_0x9f71('0x45')]({'where':{'id':_0x138cb5[_0x9f71('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c733c,null))[_0x9f71('0x25')](removeEntity(_0x3c733c,null))[_0x9f71('0x48')](handleError(_0x3c733c,null));};exports[_0x9f71('0x49')]=function(_0x38fc41,_0x3fb3cb,_0x53d30b){var _0x3293e6={};var _0x39eadb={};var _0x1cbe71;var _0x567f10;return db[_0x9f71('0x2b')][_0x9f71('0x4a')]({'where':{'id':_0x38fc41[_0x9f71('0x44')]['id']}})['then'](handleEntityNotFound(_0x3fb3cb,null))[_0x9f71('0x25')](function(_0x5ebed9){if(_0x5ebed9){_0x1cbe71=_0x5ebed9;_0x39eadb[_0x9f71('0x35')]=_['keys'](db[_0x9f71('0x4b')][_0x9f71('0x2c')]);_0x39eadb[_0x9f71('0x2f')]=_[_0x9f71('0x30')](_0x38fc41[_0x9f71('0x2f')]);_0x39eadb[_0x9f71('0x31')]=_[_0x9f71('0x33')](_0x39eadb['model'],_0x39eadb[_0x9f71('0x2f')]);_0x3293e6['attributes']=_[_0x9f71('0x33')](_0x39eadb['model'],qs['fields'](_0x38fc41[_0x9f71('0x2f')][_0x9f71('0x34')]));_0x3293e6['attributes']=_0x3293e6[_0x9f71('0x32')][_0x9f71('0x4c')]?_0x3293e6[_0x9f71('0x32')]:_0x39eadb[_0x9f71('0x35')];_0x3293e6[_0x9f71('0x36')]=qs[_0x9f71('0x37')](_0x38fc41[_0x9f71('0x2f')][_0x9f71('0x37')]);_0x3293e6[_0x9f71('0x38')]=qs[_0x9f71('0x31')](_[_0x9f71('0x39')](_0x38fc41['query'],_0x39eadb[_0x9f71('0x31')]));if(_0x38fc41[_0x9f71('0x2f')][_0x9f71('0x3a')]){_0x3293e6[_0x9f71('0x38')]=_[_0x9f71('0x3d')](_0x3293e6[_0x9f71('0x38')],{'$or':_[_0x9f71('0x3b')](_0x3293e6['attributes'],function(_0x4a0a9c){var _0x3224e2={};_0x3224e2[_0x4a0a9c]={'$like':'%'+_0x38fc41[_0x9f71('0x2f')]['filter']+'%'};return _0x3224e2;})});}_0x3293e6=_[_0x9f71('0x3d')]({},_0x3293e6,_0x38fc41[_0x9f71('0x3e')]);return _0x1cbe71[_0x9f71('0x49')](_0x3293e6);}})['then'](function(_0x50ba11){if(_0x50ba11){_0x567f10=_0x50ba11[_0x9f71('0x4c')];if(!_0x38fc41['query'][_0x9f71('0x4d')](_0x9f71('0x4e'))){_0x3293e6[_0x9f71('0x1c')]=qs['limit'](_0x38fc41[_0x9f71('0x2f')][_0x9f71('0x1c')]);_0x3293e6[_0x9f71('0x1e')]=qs[_0x9f71('0x1e')](_0x38fc41[_0x9f71('0x2f')][_0x9f71('0x1e')]);}return _0x1cbe71['getConfigurations'](_0x3293e6);}})[_0x9f71('0x25')](function(_0x503a68){if(_0x503a68){return _0x503a68?{'count':_0x567f10,'rows':_0x503a68}:null;}})[_0x9f71('0x25')](respondWithResult(_0x3fb3cb,null))[_0x9f71('0x48')](handleError(_0x3fb3cb,null));};exports[_0x9f71('0x4f')]=function(_0x43114d,_0x17f102,_0x290016){if(_0x43114d['body']['id']){delete _0x43114d['body']['id'];}return db[_0x9f71('0x2b')][_0x9f71('0x4a')]({'where':{'id':_0x43114d[_0x9f71('0x44')]['id']}})[_0x9f71('0x25')](handleEntityNotFound(_0x17f102,null))[_0x9f71('0x25')](function(_0x126ffd){if(_0x126ffd){_0x43114d['body'][_0x9f71('0x50')]=_0x126ffd['id'];_0x43114d[_0x9f71('0x47')][_0x9f71('0x51')]=integrations['getSubjects'](_0x43114d[_0x9f71('0x47')][_0x9f71('0x52')],_0x43114d[_0x9f71('0x47')][_0x9f71('0x2d')]);_0x43114d[_0x9f71('0x47')][_0x9f71('0x53')]=integrations[_0x9f71('0x54')](_0x43114d['body'][_0x9f71('0x52')],_0x43114d['body'][_0x9f71('0x2d')]);return db['DeskConfiguration'][_0x9f71('0x46')](_0x43114d['body'],{'include':[{'model':db['DeskField'],'as':_0x9f71('0x51')},{'model':db[_0x9f71('0x55')],'as':_0x9f71('0x53')}]});}return null;})[_0x9f71('0x25')](respondWithResult(_0x17f102,null))[_0x9f71('0x48')](handleError(_0x17f102,null));};exports['getFields']=function(_0x227dba,_0xc8e4ba,_0xe5c7bd){var _0x7e008f=[{'name':_0x9f71('0x56'),'label':_0x9f71('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 _0x50edfd='';return db[_0x9f71('0x2b')][_0x9f71('0x4a')]({'where':{'id':_0x227dba[_0x9f71('0x44')]['id']},'attributes':['id','remoteUri',_0x9f71('0x57'),'username','password',_0x9f71('0x58'),'consumerSecret','token',_0x9f71('0x59')]})['then'](handleEntityNotFound(_0xc8e4ba,null))[_0x9f71('0x25')](function(_0x9dadc9){if(_0x9dadc9){_0x50edfd=_0x9dadc9[_0x9f71('0x5a')];var _0x29f3c1=_0x50edfd[_0x9f71('0x5b')](-0x1);if(_0x29f3c1==='/'){_0x50edfd=_0x50edfd[_0x9f71('0x5c')](0x0,_0x50edfd[_0x9f71('0x5d')](_0x29f3c1));}var _0x406e64={'method':_0x9f71('0x5e'),'uri':util[_0x9f71('0x5f')](_0x9f71('0x60'),_0x50edfd),'headers':{'Content-Type':_0x9f71('0x61'),'Accept':_0x9f71('0x61')},'json':!![]};if(_0x9dadc9[_0x9f71('0x57')]===_0x9f71('0x62')){_0x406e64[_0x9f71('0x63')][_0x9f71('0x64')]=util[_0x9f71('0x5f')]('Basic\x20%s',new Buffer(util[_0x9f71('0x5f')](_0x9f71('0x65'),_0x9dadc9[_0x9f71('0x66')],_0x9dadc9['password']))[_0x9f71('0x67')]('base64'));}return rp(_0x406e64)[_0x9f71('0x25')](function(_0x308eac){return _0x7e008f['concat'](_['map'](_0x308eac[_0x9f71('0x68')]['entries'],function(_0x5e2093){return{'id':_0x5e2093['name'],'name':_0x5e2093['name'],'type':_0x5e2093[_0x9f71('0x2d')],'active':_0x5e2093[_0x9f71('0x69')],'label':_0x5e2093['label'],'custom':!![]};}));});}})[_0x9f71('0x25')](function(_0x397680){return{'count':_0x397680[_0x9f71('0x4c')],'rows':_0x397680};})['then'](respondWithResult(_0xc8e4ba,null))[_0x9f71('0x48')](function(_0x13016b){var _0x47b70b=_0x227dba['query'][_0x9f71('0x6a')]?0x1f4:_0x13016b[_0x9f71('0x6b')]||0x1f4;logger[_0x9f71('0x6c')](_0x9f71('0x6d'),_0x9f71('0x6e'),_0x47b70b,JSON[_0x9f71('0x6f')](_0x13016b));delete _0x13016b[_0x9f71('0x28')];if(_0x47b70b===0x191){_0x47b70b=0x190;}_0xc8e4ba[_0x9f71('0x1a')](_0x47b70b)[_0x9f71('0x29')](_0x227dba[_0x9f71('0x2f')][_0x9f71('0x6a')]?{'message':_0x9f71('0x70'),'statusCode':_0x13016b[_0x9f71('0x6b')]}:_0x13016b);});}; \ No newline at end of file +var _0x1032=['where','merge','VIRTUAL','options','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter'];(function(_0x45d0c6,_0x13f497){var _0x1be8e7=function(_0x4a2b05){while(--_0x4a2b05){_0x45d0c6['push'](_0x45d0c6['shift']());}};_0x1be8e7(++_0x13f497);}(_0x1032,0xaa));var _0x2103=function(_0x4da9e9,_0x167f41){_0x4da9e9=_0x4da9e9-0x0;var _0x475849=_0x1032[_0x4da9e9];return _0x475849;};'use strict';var emlformat=require(_0x2103('0x0'));var rimraf=require(_0x2103('0x1'));var zipdir=require(_0x2103('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2103('0x3'));var moment=require(_0x2103('0x4'));var BPromise=require(_0x2103('0x5'));var Mustache=require(_0x2103('0x6'));var util=require(_0x2103('0x7'));var path=require(_0x2103('0x8'));var sox=require('sox');var csv=require(_0x2103('0x9'));var ejs=require(_0x2103('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2103('0xb'));var squel=require(_0x2103('0xc'));var crypto=require(_0x2103('0xd'));var jsforce=require(_0x2103('0xe'));var deskjs=require(_0x2103('0xf'));var toCsv=require(_0x2103('0x9'));var querystring=require(_0x2103('0x10'));var Papa=require(_0x2103('0x11'));var Redis=require(_0x2103('0x12'));var authService=require(_0x2103('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2103('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2103('0x15'));var utils=require(_0x2103('0x16'));var config=require(_0x2103('0x17'));var licenseUtil=require(_0x2103('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2103('0x19'));function respondWithStatusCode(_0x548df3,_0x154516){_0x154516=_0x154516||0xcc;return function(_0x1ae2f5){if(_0x1ae2f5){return _0x548df3['sendStatus'](_0x154516);}return _0x548df3[_0x2103('0x1a')](_0x154516)[_0x2103('0x1b')]();};}function respondWithResult(_0x262a87,_0x317065){_0x317065=_0x317065||0xc8;return function(_0x7d2744){if(_0x7d2744){return _0x262a87[_0x2103('0x1a')](_0x317065)[_0x2103('0x1c')](_0x7d2744);}};}function respondWithFilteredResult(_0x37f05,_0x769a55){return function(_0x86777d){if(_0x86777d){var _0x56d675=typeof _0x769a55[_0x2103('0x1d')]===_0x2103('0x1e')&&typeof _0x769a55[_0x2103('0x1f')]===_0x2103('0x1e');var _0x3409e8=_0x86777d[_0x2103('0x20')];var _0x42885b=_0x56d675?0x0:_0x769a55[_0x2103('0x1d')];var _0x47ec9c=_0x56d675?_0x86777d['count']:_0x769a55['offset']+_0x769a55['limit'];var _0x2ffd23;if(_0x47ec9c>=_0x3409e8){_0x47ec9c=_0x3409e8;_0x2ffd23=0xc8;}else{_0x2ffd23=0xce;}_0x37f05[_0x2103('0x1a')](_0x2ffd23);return _0x37f05[_0x2103('0x21')](_0x2103('0x22'),_0x42885b+'-'+_0x47ec9c+'/'+_0x3409e8)[_0x2103('0x1c')](_0x86777d);}return null;};}function patchUpdates(_0x44f16d){return function(_0x4722b1){try{jsonpatch[_0x2103('0x23')](_0x4722b1,_0x44f16d,!![]);}catch(_0x3ed69a){return BPromise['reject'](_0x3ed69a);}return _0x4722b1[_0x2103('0x24')]();};}function saveUpdates(_0x26564e,_0x5d48c6){return function(_0x55959e){if(_0x55959e){return _0x55959e[_0x2103('0x25')](_0x26564e)[_0x2103('0x26')](function(_0x3266c9){return _0x3266c9;});}return null;};}function removeEntity(_0x38c077,_0x2f792b){return function(_0x53dc68){if(_0x53dc68){return _0x53dc68[_0x2103('0x27')]()[_0x2103('0x26')](function(){_0x38c077[_0x2103('0x1a')](0xcc)[_0x2103('0x1b')]();});}};}function handleEntityNotFound(_0x44fc77,_0x1ed2b9){return function(_0x29ad17){if(!_0x29ad17){_0x44fc77[_0x2103('0x28')](0x194);}return _0x29ad17;};}function handleError(_0x250862,_0x3fd22e){_0x3fd22e=_0x3fd22e||0x1f4;return function(_0x4106ab){logger[_0x2103('0x29')](_0x4106ab[_0x2103('0x2a')]);if(_0x4106ab[_0x2103('0x2b')]){delete _0x4106ab[_0x2103('0x2b')];}_0x250862[_0x2103('0x1a')](_0x3fd22e)[_0x2103('0x2c')](_0x4106ab);};}exports[_0x2103('0x2d')]=function(_0x321e7a,_0x207b8f){var _0x7842ed={},_0x48ead4={},_0x878fae={'count':0x0,'rows':[]};var _0x260323=_['map'](db[_0x2103('0x2e')][_0x2103('0x2f')],function(_0x2e8b3d){return{'name':_0x2e8b3d[_0x2103('0x30')],'type':_0x2e8b3d['type'][_0x2103('0x31')]};});_0x48ead4[_0x2103('0x32')]=_[_0x2103('0x33')](_0x260323,_0x2103('0x2b'));_0x48ead4[_0x2103('0x34')]=_[_0x2103('0x35')](_0x321e7a['query']);_0x48ead4['filters']=_[_0x2103('0x36')](_0x48ead4[_0x2103('0x32')],_0x48ead4['query']);_0x7842ed[_0x2103('0x37')]=_[_0x2103('0x36')](_0x48ead4['model'],qs[_0x2103('0x38')](_0x321e7a['query']['fields']));_0x7842ed[_0x2103('0x37')]=_0x7842ed[_0x2103('0x37')]['length']?_0x7842ed['attributes']:_0x48ead4[_0x2103('0x32')];if(!_0x321e7a[_0x2103('0x34')][_0x2103('0x39')](_0x2103('0x3a'))){_0x7842ed[_0x2103('0x1f')]=qs[_0x2103('0x1f')](_0x321e7a[_0x2103('0x34')][_0x2103('0x1f')]);_0x7842ed['offset']=qs[_0x2103('0x1d')](_0x321e7a[_0x2103('0x34')]['offset']);}_0x7842ed[_0x2103('0x3b')]=qs[_0x2103('0x3c')](_0x321e7a[_0x2103('0x34')][_0x2103('0x3c')]);_0x7842ed['where']=qs[_0x2103('0x3d')](_[_0x2103('0x3e')](_0x321e7a[_0x2103('0x34')],_0x48ead4[_0x2103('0x3d')]),_0x260323);if(_0x321e7a[_0x2103('0x34')][_0x2103('0x3f')]){_0x7842ed[_0x2103('0x40')]=_[_0x2103('0x41')](_0x7842ed[_0x2103('0x40')],{'$or':_['map'](_0x260323,function(_0x210176){if(_0x210176['type']!==_0x2103('0x42')){var _0x294de0={};_0x294de0[_0x210176[_0x2103('0x2b')]]={'$like':'%'+_0x321e7a['query'][_0x2103('0x3f')]+'%'};return _0x294de0;}})});}_0x7842ed=_[_0x2103('0x41')]({},_0x7842ed,_0x321e7a[_0x2103('0x43')]);var _0x466d6d={'where':_0x7842ed['where']};return db[_0x2103('0x2e')]['count'](_0x466d6d)['then'](function(_0x3952ab){_0x878fae['count']=_0x3952ab;if(_0x321e7a[_0x2103('0x34')]['includeAll']){_0x7842ed[_0x2103('0x44')]=[{'all':!![]}];}return db[_0x2103('0x2e')][_0x2103('0x45')](_0x7842ed);})[_0x2103('0x26')](function(_0x1ef5ef){_0x878fae[_0x2103('0x46')]=_0x1ef5ef;return _0x878fae;})[_0x2103('0x26')](respondWithFilteredResult(_0x207b8f,_0x7842ed))[_0x2103('0x47')](handleError(_0x207b8f,null));};exports['show']=function(_0x15c592,_0x4ffcc5){var _0x1b9459={'raw':![],'where':{'id':_0x15c592[_0x2103('0x48')]['id']}},_0x2718ef={};_0x2718ef[_0x2103('0x32')]=_[_0x2103('0x35')](db['DeskAccount'][_0x2103('0x2f')]);_0x2718ef[_0x2103('0x34')]=_['keys'](_0x15c592[_0x2103('0x34')]);_0x2718ef[_0x2103('0x3d')]=_['intersection'](_0x2718ef['model'],_0x2718ef[_0x2103('0x34')]);_0x1b9459['attributes']=_[_0x2103('0x36')](_0x2718ef[_0x2103('0x32')],qs[_0x2103('0x38')](_0x15c592[_0x2103('0x34')][_0x2103('0x38')]));_0x1b9459[_0x2103('0x37')]=_0x1b9459[_0x2103('0x37')][_0x2103('0x49')]?_0x1b9459[_0x2103('0x37')]:_0x2718ef[_0x2103('0x32')];if(_0x15c592[_0x2103('0x34')]['includeAll']){_0x1b9459[_0x2103('0x44')]=[{'all':!![]}];}_0x1b9459=_[_0x2103('0x41')]({},_0x1b9459,_0x15c592[_0x2103('0x43')]);return db['DeskAccount'][_0x2103('0x4a')](_0x1b9459)[_0x2103('0x26')](handleEntityNotFound(_0x4ffcc5,null))[_0x2103('0x26')](respondWithResult(_0x4ffcc5,null))['catch'](handleError(_0x4ffcc5,null));};exports[_0x2103('0x4b')]=function(_0x5ad98f,_0x2e5321){return db[_0x2103('0x2e')][_0x2103('0x4b')](_0x5ad98f[_0x2103('0x4c')],{})[_0x2103('0x26')](respondWithResult(_0x2e5321,0xc9))[_0x2103('0x47')](handleError(_0x2e5321,null));};exports[_0x2103('0x25')]=function(_0x366f2d,_0x3f9b8b){if(_0x366f2d[_0x2103('0x4c')]['id']){delete _0x366f2d[_0x2103('0x4c')]['id'];}return db[_0x2103('0x2e')][_0x2103('0x4a')]({'where':{'id':_0x366f2d['params']['id']}})[_0x2103('0x26')](handleEntityNotFound(_0x3f9b8b,null))[_0x2103('0x26')](saveUpdates(_0x366f2d[_0x2103('0x4c')],null))['then'](respondWithResult(_0x3f9b8b,null))[_0x2103('0x47')](handleError(_0x3f9b8b,null));};exports[_0x2103('0x27')]=function(_0x1f6f05,_0x20a145){return db[_0x2103('0x2e')][_0x2103('0x4a')]({'where':{'id':_0x1f6f05['params']['id']}})[_0x2103('0x26')](handleEntityNotFound(_0x20a145,null))['then'](removeEntity(_0x20a145,null))[_0x2103('0x47')](handleError(_0x20a145,null));};exports[_0x2103('0x4d')]=function(_0xeccb14,_0x1d8ea8,_0x3c1647){var _0x244f01={};var _0x657fda={};var _0xf5abb8;var _0x3e582c;return db[_0x2103('0x2e')]['findOne']({'where':{'id':_0xeccb14[_0x2103('0x48')]['id']}})[_0x2103('0x26')](handleEntityNotFound(_0x1d8ea8,null))[_0x2103('0x26')](function(_0x2bcb3b){if(_0x2bcb3b){_0xf5abb8=_0x2bcb3b;_0x657fda[_0x2103('0x32')]=_[_0x2103('0x35')](db['DeskConfiguration']['rawAttributes']);_0x657fda[_0x2103('0x34')]=_[_0x2103('0x35')](_0xeccb14[_0x2103('0x34')]);_0x657fda[_0x2103('0x3d')]=_[_0x2103('0x36')](_0x657fda[_0x2103('0x32')],_0x657fda['query']);_0x244f01['attributes']=_[_0x2103('0x36')](_0x657fda[_0x2103('0x32')],qs[_0x2103('0x38')](_0xeccb14['query'][_0x2103('0x38')]));_0x244f01[_0x2103('0x37')]=_0x244f01[_0x2103('0x37')]['length']?_0x244f01[_0x2103('0x37')]:_0x657fda[_0x2103('0x32')];_0x244f01[_0x2103('0x3b')]=qs[_0x2103('0x3c')](_0xeccb14['query'][_0x2103('0x3c')]);_0x244f01[_0x2103('0x40')]=qs[_0x2103('0x3d')](_['pick'](_0xeccb14[_0x2103('0x34')],_0x657fda['filters']));if(_0xeccb14['query']['filter']){_0x244f01[_0x2103('0x40')]=_[_0x2103('0x41')](_0x244f01[_0x2103('0x40')],{'$or':_[_0x2103('0x33')](_0x244f01[_0x2103('0x37')],function(_0xdb38d9){var _0x3924aa={};_0x3924aa[_0xdb38d9]={'$like':'%'+_0xeccb14[_0x2103('0x34')][_0x2103('0x3f')]+'%'};return _0x3924aa;})});}_0x244f01=_[_0x2103('0x41')]({},_0x244f01,_0xeccb14[_0x2103('0x43')]);return _0xf5abb8[_0x2103('0x4d')](_0x244f01);}})[_0x2103('0x26')](function(_0x232529){if(_0x232529){_0x3e582c=_0x232529['length'];if(!_0xeccb14['query'][_0x2103('0x39')](_0x2103('0x3a'))){_0x244f01['limit']=qs[_0x2103('0x1f')](_0xeccb14['query'][_0x2103('0x1f')]);_0x244f01[_0x2103('0x1d')]=qs[_0x2103('0x1d')](_0xeccb14[_0x2103('0x34')][_0x2103('0x1d')]);}return _0xf5abb8[_0x2103('0x4d')](_0x244f01);}})[_0x2103('0x26')](function(_0x275030){if(_0x275030){return _0x275030?{'count':_0x3e582c,'rows':_0x275030}:null;}})['then'](respondWithResult(_0x1d8ea8,null))[_0x2103('0x47')](handleError(_0x1d8ea8,null));};exports[_0x2103('0x4e')]=function(_0x2af8df,_0x547bf0,_0x24c22b){if(_0x2af8df['body']['id']){delete _0x2af8df[_0x2103('0x4c')]['id'];}return db['DeskAccount'][_0x2103('0x4f')]({'where':{'id':_0x2af8df[_0x2103('0x48')]['id']}})[_0x2103('0x26')](handleEntityNotFound(_0x547bf0,null))[_0x2103('0x26')](function(_0x12d445){if(_0x12d445){_0x2af8df[_0x2103('0x4c')][_0x2103('0x50')]=_0x12d445['id'];_0x2af8df['body'][_0x2103('0x51')]=integrations[_0x2103('0x52')](_0x2af8df[_0x2103('0x4c')][_0x2103('0x53')],_0x2af8df[_0x2103('0x4c')][_0x2103('0x54')]);_0x2af8df['body'][_0x2103('0x55')]=integrations[_0x2103('0x56')](_0x2af8df[_0x2103('0x4c')][_0x2103('0x53')],_0x2af8df[_0x2103('0x4c')]['type']);return db['DeskConfiguration'][_0x2103('0x4b')](_0x2af8df['body'],{'include':[{'model':db[_0x2103('0x57')],'as':'Subjects'},{'model':db[_0x2103('0x57')],'as':_0x2103('0x55')}]});}return null;})['then'](respondWithResult(_0x547bf0,null))[_0x2103('0x47')](handleError(_0x547bf0,null));};exports[_0x2103('0x58')]=function(_0x1b8332,_0x3b8102,_0x5a1aba){var _0x4bb526=[{'name':_0x2103('0x59'),'label':_0x2103('0x59'),'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 _0xecad2='';return db[_0x2103('0x2e')][_0x2103('0x4f')]({'where':{'id':_0x1b8332[_0x2103('0x48')]['id']},'attributes':['id',_0x2103('0x5a'),_0x2103('0x5b'),_0x2103('0x5c'),_0x2103('0x5d'),'consumerKey',_0x2103('0x5e'),_0x2103('0x5f'),_0x2103('0x60')]})[_0x2103('0x26')](handleEntityNotFound(_0x3b8102,null))[_0x2103('0x26')](function(_0x1eec9c){if(_0x1eec9c){_0xecad2=_0x1eec9c[_0x2103('0x5a')];var _0x4429d8=_0xecad2[_0x2103('0x61')](-0x1);if(_0x4429d8==='/'){_0xecad2=_0xecad2['substring'](0x0,_0xecad2[_0x2103('0x62')](_0x4429d8));}var _0x122427={'method':'GET','uri':util[_0x2103('0x63')](_0x2103('0x64'),_0xecad2),'headers':{'Content-Type':_0x2103('0x65'),'Accept':_0x2103('0x65')},'json':!![]};if(_0x1eec9c[_0x2103('0x5b')]===_0x2103('0x66')){_0x122427[_0x2103('0x67')][_0x2103('0x68')]=util[_0x2103('0x63')]('Basic\x20%s',new Buffer(util[_0x2103('0x63')](_0x2103('0x69'),_0x1eec9c[_0x2103('0x5c')],_0x1eec9c[_0x2103('0x5d')]))[_0x2103('0x6a')](_0x2103('0x6b')));}return rp(_0x122427)[_0x2103('0x26')](function(_0x1c51ee){return _0x4bb526[_0x2103('0x6c')](_[_0x2103('0x33')](_0x1c51ee[_0x2103('0x6d')][_0x2103('0x6e')],function(_0x221178){return{'id':_0x221178[_0x2103('0x2b')],'name':_0x221178[_0x2103('0x2b')],'type':_0x221178['type'],'active':_0x221178[_0x2103('0x6f')],'label':_0x221178[_0x2103('0x70')],'custom':!![]};}));});}})[_0x2103('0x26')](function(_0x50e309){return{'count':_0x50e309['length'],'rows':_0x50e309};})['then'](respondWithResult(_0x3b8102,null))[_0x2103('0x47')](function(_0x2600ae){var _0x523d9f=_0x1b8332[_0x2103('0x34')][_0x2103('0x71')]?0x1f4:_0x2600ae[_0x2103('0x72')]||0x1f4;logger[_0x2103('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x2103('0x58'),_0x523d9f,JSON[_0x2103('0x73')](_0x2600ae));delete _0x2600ae[_0x2103('0x2b')];if(_0x523d9f===0x191){_0x523d9f=0x190;}_0x3b8102[_0x2103('0x1a')](_0x523d9f)[_0x2103('0x2c')](_0x1b8332['query']['test']?{'message':_0x2103('0x74'),'statusCode':_0x2600ae[_0x2103('0x72')]}:_0x2600ae);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 579ff65..12bc87a 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 _0x5468=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts'];(function(_0x4f197f,_0x33bb07){var _0x243a03=function(_0x4f6304){while(--_0x4f6304){_0x4f197f['push'](_0x4f197f['shift']());}};_0x243a03(++_0x33bb07);}(_0x5468,0x179));var _0x8546=function(_0x2af5fc,_0xe0d802){_0x2af5fc=_0x2af5fc-0x0;var _0x32c2a0=_0x5468[_0x2af5fc];return _0x32c2a0;};'use strict';var _=require(_0x8546('0x0'));var util=require(_0x8546('0x1'));var logger=require(_0x8546('0x2'))(_0x8546('0x3'));var moment=require('moment');var BPromise=require(_0x8546('0x4'));var rp=require(_0x8546('0x5'));var fs=require('fs');var path=require(_0x8546('0x6'));var rimraf=require(_0x8546('0x7'));var config=require('../../config/environment');var attributes=require(_0x8546('0x8'));var integrations=require(_0x8546('0x9'));module[_0x8546('0xa')]=function(_0x3fa5c2,_0x5952a1){return _0x3fa5c2[_0x8546('0xb')]('DeskAccount',attributes,{'tableName':_0x8546('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9344=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x42708a,_0x2ab106){var _0x4bbc70=function(_0x450af6){while(--_0x450af6){_0x42708a['push'](_0x42708a['shift']());}};_0x4bbc70(++_0x2ab106);}(_0x9344,0xf6));var _0x4934=function(_0x2f9aee,_0x29b9d4){_0x2f9aee=_0x2f9aee-0x0;var _0x39581e=_0x9344[_0x2f9aee];return _0x39581e;};'use strict';var _=require(_0x4934('0x0'));var util=require('util');var logger=require(_0x4934('0x1'))(_0x4934('0x2'));var moment=require(_0x4934('0x3'));var BPromise=require('bluebird');var rp=require(_0x4934('0x4'));var fs=require('fs');var path=require(_0x4934('0x5'));var rimraf=require(_0x4934('0x6'));var config=require(_0x4934('0x7'));var attributes=require(_0x4934('0x8'));var integrations=require(_0x4934('0x9'));module['exports']=function(_0x5dcd68,_0x7cd4ed){return _0x5dcd68[_0x4934('0xa')](_0x4934('0xb'),attributes,{'tableName':_0x4934('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 6493854..c007660 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 _0x5655=['stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','ShowDeskAccount','find','util','moment','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x11117f,_0x11cf54){var _0x5dd7d8=function(_0x2ce2c8){while(--_0x2ce2c8){_0x11117f['push'](_0x11117f['shift']());}};_0x5dd7d8(++_0x11cf54);}(_0x5655,0x113));var _0x5565=function(_0x34af09,_0x52689d){_0x34af09=_0x34af09-0x0;var _0x1525b4=_0x5655[_0x34af09];return _0x1525b4;};'use strict';var _=require('lodash');var util=require(_0x5565('0x0'));var moment=require(_0x5565('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5565('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5565('0x3'));var jayson=require(_0x5565('0x4'));var client=jayson[_0x5565('0x5')][_0x5565('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4f1d7d,_0x4558bc,_0x155315){return new BPromise(function(_0x12b543,_0x1f28f2){return client[_0x5565('0x7')](_0x4f1d7d,_0x155315)[_0x5565('0x8')](function(_0x2aefe0){logger[_0x5565('0x9')]('DeskAccount,\x20%s,\x20%s',_0x4558bc,_0x5565('0xa'));logger[_0x5565('0xb')](_0x5565('0xc'),_0x4558bc,_0x5565('0xa'),JSON[_0x5565('0xd')](_0x2aefe0));if(_0x2aefe0[_0x5565('0xe')]){if(_0x2aefe0[_0x5565('0xe')][_0x5565('0xf')]===0x1f4){logger['error'](_0x5565('0x10'),_0x4558bc,_0x2aefe0[_0x5565('0xe')][_0x5565('0x11')]);return _0x1f28f2(_0x2aefe0[_0x5565('0xe')][_0x5565('0x11')]);}logger[_0x5565('0xe')](_0x5565('0x10'),_0x4558bc,_0x2aefe0[_0x5565('0xe')]['message']);return _0x12b543(_0x2aefe0[_0x5565('0xe')][_0x5565('0x11')]);}else{logger[_0x5565('0x9')](_0x5565('0x10'),_0x4558bc,'request\x20sent');_0x12b543(_0x2aefe0[_0x5565('0x12')][_0x5565('0x11')]);}})[_0x5565('0x13')](function(_0x929341){logger['error'](_0x5565('0x10'),_0x4558bc,_0x929341);_0x1f28f2(_0x929341);});});}exports[_0x5565('0x14')]=function(_0x4f502d){var _0x58d5bd=this;return new Promise(function(_0x483906,_0x273711){return db['DeskAccount'][_0x5565('0x15')]({'raw':_0x4f502d['options']?_0x4f502d['options'][_0x5565('0x16')]===undefined?!![]:![]:!![],'where':_0x4f502d[_0x5565('0x17')]?_0x4f502d[_0x5565('0x17')][_0x5565('0x18')]||null:null,'attributes':_0x4f502d[_0x5565('0x17')]?_0x4f502d[_0x5565('0x17')][_0x5565('0x19')]||null:null,'limit':_0x4f502d['options']?_0x4f502d['options'][_0x5565('0x1a')]||null:null,'include':_0x4f502d['options']?_0x4f502d[_0x5565('0x17')][_0x5565('0x1b')]?_[_0x5565('0x1c')](_0x4f502d[_0x5565('0x17')][_0x5565('0x1b')],function(_0x484bc6){return{'model':db[_0x484bc6[_0x5565('0x1d')]],'as':_0x484bc6['as'],'attributes':_0x484bc6['attributes'],'include':_0x484bc6['include']?_['map'](_0x484bc6['include'],function(_0x1707ac){return{'model':db[_0x1707ac[_0x5565('0x1d')]],'as':_0x1707ac['as'],'attributes':_0x1707ac[_0x5565('0x19')],'include':_0x1707ac[_0x5565('0x1b')]?_['map'](_0x1707ac[_0x5565('0x1b')],function(_0x7832fa){return{'model':db[_0x7832fa[_0x5565('0x1d')]],'as':_0x7832fa['as'],'attributes':_0x7832fa[_0x5565('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5565('0x8')](function(_0x33416b){logger[_0x5565('0x9')](_0x5565('0x14'),_0x4f502d);logger[_0x5565('0xb')]('GetDeskAccount',_0x4f502d,JSON['stringify'](_0x33416b));_0x483906(_0x33416b);})[_0x5565('0x13')](function(_0x25b0f0){logger[_0x5565('0xe')]('GetDeskAccount',_0x25b0f0['message'],_0x4f502d);_0x273711(_0x58d5bd[_0x5565('0xe')](0x1f4,_0x25b0f0['message']));});});};exports[_0x5565('0x1e')]=function(_0x4fb41d){var _0xfb08f1=this;return new Promise(function(_0x5e88b4,_0x1504aa){return db['DeskAccount'][_0x5565('0x1f')]({'raw':_0x4fb41d[_0x5565('0x17')]?_0x4fb41d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fb41d['options']?_0x4fb41d[_0x5565('0x17')][_0x5565('0x18')]||null:null,'attributes':_0x4fb41d[_0x5565('0x17')]?_0x4fb41d[_0x5565('0x17')][_0x5565('0x19')]||null:null,'include':_0x4fb41d[_0x5565('0x17')]?_0x4fb41d[_0x5565('0x17')][_0x5565('0x1b')]?_[_0x5565('0x1c')](_0x4fb41d[_0x5565('0x17')][_0x5565('0x1b')],function(_0x5e6990){return{'model':db[_0x5e6990[_0x5565('0x1d')]],'as':_0x5e6990['as'],'attributes':_0x5e6990[_0x5565('0x19')],'include':_0x5e6990[_0x5565('0x1b')]?_[_0x5565('0x1c')](_0x5e6990[_0x5565('0x1b')],function(_0x3a6165){return{'model':db[_0x3a6165[_0x5565('0x1d')]],'as':_0x3a6165['as'],'attributes':_0x3a6165[_0x5565('0x19')],'include':_0x3a6165['include']?_[_0x5565('0x1c')](_0x3a6165['include'],function(_0x47cf95){return{'model':db[_0x47cf95[_0x5565('0x1d')]],'as':_0x47cf95['as'],'attributes':_0x47cf95[_0x5565('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5565('0x8')](function(_0xaa51bb){logger['info'](_0x5565('0x1e'),_0x4fb41d);logger[_0x5565('0xb')](_0x5565('0x1e'),_0x4fb41d,JSON[_0x5565('0xd')](_0xaa51bb));_0x5e88b4(_0xaa51bb);})[_0x5565('0x13')](function(_0x58579c){logger[_0x5565('0xe')]('ShowDeskAccount',_0x58579c[_0x5565('0x11')],_0x4fb41d);_0x1504aa(_0xfb08f1[_0x5565('0xe')](0x1f4,_0x58579c[_0x5565('0x11')]));});});}; \ No newline at end of file +var _0x2c01=['map','attributes','debug','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','raw','options','limit','include','model'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x2c01,0x178));var _0x12c0=function(_0xb3ccd7,_0x54423a){_0xb3ccd7=_0xb3ccd7-0x0;var _0x596d5a=_0x2c01[_0xb3ccd7];return _0x596d5a;};'use strict';var _=require(_0x12c0('0x0'));var util=require(_0x12c0('0x1'));var moment=require(_0x12c0('0x2'));var BPromise=require(_0x12c0('0x3'));var rs=require(_0x12c0('0x4'));var fs=require('fs');var Redis=require(_0x12c0('0x5'));var db=require(_0x12c0('0x6'))['db'];var utils=require(_0x12c0('0x7'));var logger=require('../../config/logger')(_0x12c0('0x8'));var config=require('../../config/environment');var jayson=require(_0x12c0('0x9'));var client=jayson[_0x12c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7ff4,_0x574186,_0x3eeebf){return new BPromise(function(_0x5b9a95,_0x503999){return client[_0x12c0('0xb')](_0x2e7ff4,_0x3eeebf)[_0x12c0('0xc')](function(_0x16b31e){logger[_0x12c0('0xd')](_0x12c0('0xe'),_0x574186,_0x12c0('0xf'));logger['debug'](_0x12c0('0x10'),_0x574186,_0x12c0('0xf'),JSON[_0x12c0('0x11')](_0x16b31e));if(_0x16b31e[_0x12c0('0x12')]){if(_0x16b31e[_0x12c0('0x12')][_0x12c0('0x13')]===0x1f4){logger[_0x12c0('0x12')]('DeskAccount,\x20%s,\x20%s',_0x574186,_0x16b31e[_0x12c0('0x12')][_0x12c0('0x14')]);return _0x503999(_0x16b31e[_0x12c0('0x12')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x574186,_0x16b31e[_0x12c0('0x12')][_0x12c0('0x14')]);return _0x5b9a95(_0x16b31e[_0x12c0('0x12')]['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x574186,_0x12c0('0xf'));_0x5b9a95(_0x16b31e[_0x12c0('0x15')][_0x12c0('0x14')]);}})[_0x12c0('0x16')](function(_0x45a41d){logger[_0x12c0('0x12')](_0x12c0('0xe'),_0x574186,_0x45a41d);_0x503999(_0x45a41d);});});}exports[_0x12c0('0x17')]=function(_0xce949e){var _0x584c9d=this;return new Promise(function(_0x1099e6,_0x178e79){return db[_0x12c0('0x18')][_0x12c0('0x19')]({'raw':_0xce949e['options']?_0xce949e['options'][_0x12c0('0x1a')]===undefined?!![]:![]:!![],'where':_0xce949e[_0x12c0('0x1b')]?_0xce949e['options']['where']||null:null,'attributes':_0xce949e[_0x12c0('0x1b')]?_0xce949e[_0x12c0('0x1b')]['attributes']||null:null,'limit':_0xce949e[_0x12c0('0x1b')]?_0xce949e[_0x12c0('0x1b')][_0x12c0('0x1c')]||null:null,'include':_0xce949e[_0x12c0('0x1b')]?_0xce949e[_0x12c0('0x1b')][_0x12c0('0x1d')]?_['map'](_0xce949e[_0x12c0('0x1b')]['include'],function(_0x563451){return{'model':db[_0x563451[_0x12c0('0x1e')]],'as':_0x563451['as'],'attributes':_0x563451['attributes'],'include':_0x563451[_0x12c0('0x1d')]?_[_0x12c0('0x1f')](_0x563451['include'],function(_0x362103){return{'model':db[_0x362103['model']],'as':_0x362103['as'],'attributes':_0x362103[_0x12c0('0x20')],'include':_0x362103[_0x12c0('0x1d')]?_['map'](_0x362103['include'],function(_0x19e8c7){return{'model':db[_0x19e8c7[_0x12c0('0x1e')]],'as':_0x19e8c7['as'],'attributes':_0x19e8c7[_0x12c0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x12c0('0xc')](function(_0x42e22f){logger[_0x12c0('0xd')](_0x12c0('0x17'),_0xce949e);logger[_0x12c0('0x21')](_0x12c0('0x17'),_0xce949e,JSON['stringify'](_0x42e22f));_0x1099e6(_0x42e22f);})[_0x12c0('0x16')](function(_0x472220){logger['error']('GetDeskAccount',_0x472220[_0x12c0('0x14')],_0xce949e);_0x178e79(_0x584c9d[_0x12c0('0x12')](0x1f4,_0x472220[_0x12c0('0x14')]));});});};exports[_0x12c0('0x22')]=function(_0x14bd57){var _0x50c3f3=this;return new Promise(function(_0x50cdc0,_0xc2bce7){return db[_0x12c0('0x18')][_0x12c0('0x23')]({'raw':_0x14bd57['options']?_0x14bd57[_0x12c0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x14bd57['options']?_0x14bd57[_0x12c0('0x1b')][_0x12c0('0x24')]||null:null,'attributes':_0x14bd57[_0x12c0('0x1b')]?_0x14bd57['options'][_0x12c0('0x20')]||null:null,'include':_0x14bd57[_0x12c0('0x1b')]?_0x14bd57[_0x12c0('0x1b')][_0x12c0('0x1d')]?_[_0x12c0('0x1f')](_0x14bd57[_0x12c0('0x1b')][_0x12c0('0x1d')],function(_0x1d515d){return{'model':db[_0x1d515d[_0x12c0('0x1e')]],'as':_0x1d515d['as'],'attributes':_0x1d515d[_0x12c0('0x20')],'include':_0x1d515d['include']?_['map'](_0x1d515d[_0x12c0('0x1d')],function(_0x3fbbc5){return{'model':db[_0x3fbbc5[_0x12c0('0x1e')]],'as':_0x3fbbc5['as'],'attributes':_0x3fbbc5[_0x12c0('0x20')],'include':_0x3fbbc5[_0x12c0('0x1d')]?_['map'](_0x3fbbc5[_0x12c0('0x1d')],function(_0xaa7828){return{'model':db[_0xaa7828[_0x12c0('0x1e')]],'as':_0xaa7828['as'],'attributes':_0xaa7828[_0x12c0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x12c0('0xc')](function(_0x4b3c1d){logger[_0x12c0('0xd')](_0x12c0('0x22'),_0x14bd57);logger[_0x12c0('0x21')](_0x12c0('0x22'),_0x14bd57,JSON['stringify'](_0x4b3c1d));_0x50cdc0(_0x4b3c1d);})[_0x12c0('0x16')](function(_0x303b1d){logger[_0x12c0('0x12')](_0x12c0('0x22'),_0x303b1d[_0x12c0('0x14')],_0x14bd57);_0xc2bce7(_0x50c3f3[_0x12c0('0x12')](0x1f4,_0x303b1d[_0x12c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 2e8a6fa..93486a4 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 _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(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x55ca,0x126));var _0xa55c=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x55ca[_0x1347f8];return _0x218368;};'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 +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(_0x54a8bc,_0x199365){var _0x43389c=function(_0xe925e4){while(--_0xe925e4){_0x54a8bc['push'](_0x54a8bc['shift']());}};_0x43389c(++_0x199365);}(_0x34e8,0x12c));var _0x834e=function(_0x2db9c5,_0x19ba4f){_0x2db9c5=_0x2db9c5-0x0;var _0x48d14e=_0x34e8[_0x2db9c5];return _0x48d14e;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index e3dd367..6108293 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 _0x8b1b=['STRING','exports'];(function(_0x33f83a,_0x331ebf){var _0x3e504f=function(_0x5d744e){while(--_0x5d744e){_0x33f83a['push'](_0x33f83a['shift']());}};_0x3e504f(++_0x331ebf);}(_0x8b1b,0x18d));var _0xb8b1=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x8b1b[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require('sequelize');module[_0xb8b1('0x0')]={'name':{'type':Sequelize[_0xb8b1('0x1')]},'description':{'type':Sequelize[_0xb8b1('0x1')]}}; \ No newline at end of file +var _0x1f4f=['STRING','sequelize','exports'];(function(_0x1d90cd,_0x1d2745){var _0x81bbac=function(_0x4f91cd){while(--_0x4f91cd){_0x1d90cd['push'](_0x1d90cd['shift']());}};_0x81bbac(++_0x1d2745);}(_0x1f4f,0x88));var _0xf1f4=function(_0x581741,_0x444ab4){_0x581741=_0x581741-0x0;var _0xce05df=_0x1f4f[_0x581741];return _0xce05df;};'use strict';var Sequelize=require(_0xf1f4('0x0'));module[_0xf1f4('0x1')]={'name':{'type':Sequelize[_0xf1f4('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index f3f4937..da51fc8 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 _0x3ca8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv'];(function(_0x3f966b,_0x2d5878){var _0x132db6=function(_0x2f8a11){while(--_0x2f8a11){_0x3f966b['push'](_0x3f966b['shift']());}};_0x132db6(++_0x2d5878);}(_0x3ca8,0x9b));var _0x83ca=function(_0x394f03,_0x2016d1){_0x394f03=_0x394f03-0x0;var _0x4db2a0=_0x3ca8[_0x394f03];return _0x4db2a0;};'use strict';var emlformat=require(_0x83ca('0x0'));var rimraf=require(_0x83ca('0x1'));var zipdir=require(_0x83ca('0x2'));var jsonpatch=require(_0x83ca('0x3'));var rp=require(_0x83ca('0x4'));var moment=require(_0x83ca('0x5'));var BPromise=require(_0x83ca('0x6'));var Mustache=require(_0x83ca('0x7'));var util=require(_0x83ca('0x8'));var path=require(_0x83ca('0x9'));var sox=require(_0x83ca('0xa'));var csv=require('to-csv');var ejs=require(_0x83ca('0xb'));var fs=require('fs');var fs_extra=require(_0x83ca('0xc'));var _=require(_0x83ca('0xd'));var squel=require(_0x83ca('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x83ca('0xf'));var toCsv=require(_0x83ca('0x10'));var querystring=require(_0x83ca('0x11'));var Papa=require(_0x83ca('0x12'));var Redis=require(_0x83ca('0x13'));var authService=require(_0x83ca('0x14'));var qs=require(_0x83ca('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83ca('0x16'));var logger=require('../../config/logger')(_0x83ca('0x17'));var utils=require('../../config/utils');var config=require(_0x83ca('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e738,_0x128fc1){_0x128fc1=_0x128fc1||0xcc;return function(_0x2df27a){if(_0x2df27a){return _0x41e738[_0x83ca('0x19')](_0x128fc1);}return _0x41e738[_0x83ca('0x1a')](_0x128fc1)[_0x83ca('0x1b')]();};}function respondWithResult(_0x4526b0,_0x3ac900){_0x3ac900=_0x3ac900||0xc8;return function(_0x5bb0a3){if(_0x5bb0a3){return _0x4526b0[_0x83ca('0x1a')](_0x3ac900)['json'](_0x5bb0a3);}};}function respondWithFilteredResult(_0x1584c3,_0x430746){return function(_0x8171de){if(_0x8171de){var _0x3091d3=typeof _0x430746[_0x83ca('0x1c')]===_0x83ca('0x1d')&&typeof _0x430746[_0x83ca('0x1e')]===_0x83ca('0x1d');var _0x16753d=_0x8171de[_0x83ca('0x1f')];var _0x5cc577=_0x3091d3?0x0:_0x430746[_0x83ca('0x1c')];var _0x4d295b=_0x3091d3?_0x8171de['count']:_0x430746[_0x83ca('0x1c')]+_0x430746[_0x83ca('0x1e')];var _0x5e0105;if(_0x4d295b>=_0x16753d){_0x4d295b=_0x16753d;_0x5e0105=0xc8;}else{_0x5e0105=0xce;}_0x1584c3['status'](_0x5e0105);return _0x1584c3[_0x83ca('0x20')]('Content-Range',_0x5cc577+'-'+_0x4d295b+'/'+_0x16753d)[_0x83ca('0x21')](_0x8171de);}return null;};}function patchUpdates(_0x5a987f){return function(_0x14baf7){try{jsonpatch[_0x83ca('0x22')](_0x14baf7,_0x5a987f,!![]);}catch(_0x246587){return BPromise[_0x83ca('0x23')](_0x246587);}return _0x14baf7[_0x83ca('0x24')]();};}function saveUpdates(_0x48f2fe,_0x4cb24e){return function(_0x16adbf){if(_0x16adbf){return _0x16adbf[_0x83ca('0x25')](_0x48f2fe)[_0x83ca('0x26')](function(_0x15c7ae){return _0x15c7ae;});}return null;};}function removeEntity(_0x18d8f0,_0x457669){return function(_0x1a569f){if(_0x1a569f){return _0x1a569f[_0x83ca('0x27')]()[_0x83ca('0x26')](function(){_0x18d8f0[_0x83ca('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161439,_0x29f1ab){return function(_0x2f0791){if(!_0x2f0791){_0x161439['sendStatus'](0x194);}return _0x2f0791;};}function handleError(_0x519c8d,_0x617049){_0x617049=_0x617049||0x1f4;return function(_0x53bd1a){logger[_0x83ca('0x28')](_0x53bd1a['stack']);if(_0x53bd1a['name']){delete _0x53bd1a['name'];}_0x519c8d[_0x83ca('0x1a')](_0x617049)[_0x83ca('0x29')](_0x53bd1a);};}exports['index']=function(_0xfb01e4,_0x1faa45){var _0x273b3c={},_0xb69e1d={},_0x36137e={'count':0x0,'rows':[]};var _0x16e14d=_[_0x83ca('0x2a')](db[_0x83ca('0x2b')][_0x83ca('0x2c')],function(_0x395892){return{'name':_0x395892[_0x83ca('0x2d')],'type':_0x395892[_0x83ca('0x2e')][_0x83ca('0x2f')]};});_0xb69e1d[_0x83ca('0x30')]=_[_0x83ca('0x2a')](_0x16e14d,_0x83ca('0x31'));_0xb69e1d[_0x83ca('0x32')]=_[_0x83ca('0x33')](_0xfb01e4[_0x83ca('0x32')]);_0xb69e1d[_0x83ca('0x34')]=_[_0x83ca('0x35')](_0xb69e1d['model'],_0xb69e1d[_0x83ca('0x32')]);_0x273b3c[_0x83ca('0x36')]=_[_0x83ca('0x35')](_0xb69e1d[_0x83ca('0x30')],qs[_0x83ca('0x37')](_0xfb01e4[_0x83ca('0x32')]['fields']));_0x273b3c[_0x83ca('0x36')]=_0x273b3c['attributes'][_0x83ca('0x38')]?_0x273b3c[_0x83ca('0x36')]:_0xb69e1d[_0x83ca('0x30')];if(!_0xfb01e4[_0x83ca('0x32')][_0x83ca('0x39')](_0x83ca('0x3a'))){_0x273b3c[_0x83ca('0x1e')]=qs[_0x83ca('0x1e')](_0xfb01e4[_0x83ca('0x32')][_0x83ca('0x1e')]);_0x273b3c['offset']=qs[_0x83ca('0x1c')](_0xfb01e4[_0x83ca('0x32')]['offset']);}_0x273b3c[_0x83ca('0x3b')]=qs[_0x83ca('0x3c')](_0xfb01e4[_0x83ca('0x32')][_0x83ca('0x3c')]);_0x273b3c[_0x83ca('0x3d')]=qs[_0x83ca('0x34')](_[_0x83ca('0x3e')](_0xfb01e4[_0x83ca('0x32')],_0xb69e1d[_0x83ca('0x34')]),_0x16e14d);if(_0xfb01e4[_0x83ca('0x32')][_0x83ca('0x3f')]){_0x273b3c[_0x83ca('0x3d')]=_[_0x83ca('0x40')](_0x273b3c[_0x83ca('0x3d')],{'$or':_[_0x83ca('0x2a')](_0x16e14d,function(_0x577e9e){if(_0x577e9e[_0x83ca('0x2e')]!==_0x83ca('0x41')){var _0x5588de={};_0x5588de[_0x577e9e[_0x83ca('0x31')]]={'$like':'%'+_0xfb01e4[_0x83ca('0x32')]['filter']+'%'};return _0x5588de;}})});}_0x273b3c=_[_0x83ca('0x40')]({},_0x273b3c,_0xfb01e4[_0x83ca('0x42')]);var _0x37fd40={'where':_0x273b3c[_0x83ca('0x3d')]};return db[_0x83ca('0x2b')][_0x83ca('0x1f')](_0x37fd40)[_0x83ca('0x26')](function(_0x498a61){_0x36137e[_0x83ca('0x1f')]=_0x498a61;if(_0xfb01e4['query'][_0x83ca('0x43')]){_0x273b3c['include']=[{'all':!![]}];}return db[_0x83ca('0x2b')][_0x83ca('0x44')](_0x273b3c);})[_0x83ca('0x26')](function(_0x10f54c){_0x36137e[_0x83ca('0x45')]=_0x10f54c;return _0x36137e;})[_0x83ca('0x26')](respondWithFilteredResult(_0x1faa45,_0x273b3c))[_0x83ca('0x46')](handleError(_0x1faa45,null));};exports[_0x83ca('0x47')]=function(_0x182821,_0x35ccc3){var _0x255fd3={'raw':![],'where':{'id':_0x182821['params']['id']}},_0x1de9c9={};_0x1de9c9[_0x83ca('0x30')]=_[_0x83ca('0x33')](db[_0x83ca('0x2b')][_0x83ca('0x2c')]);_0x1de9c9[_0x83ca('0x32')]=_[_0x83ca('0x33')](_0x182821['query']);_0x1de9c9[_0x83ca('0x34')]=_[_0x83ca('0x35')](_0x1de9c9[_0x83ca('0x30')],_0x1de9c9[_0x83ca('0x32')]);_0x255fd3['attributes']=_['intersection'](_0x1de9c9[_0x83ca('0x30')],qs['fields'](_0x182821['query'][_0x83ca('0x37')]));_0x255fd3[_0x83ca('0x36')]=_0x255fd3[_0x83ca('0x36')][_0x83ca('0x38')]?_0x255fd3[_0x83ca('0x36')]:_0x1de9c9[_0x83ca('0x30')];if(_0x182821[_0x83ca('0x32')][_0x83ca('0x43')]){_0x255fd3[_0x83ca('0x48')]=[{'all':!![]}];}_0x255fd3=_[_0x83ca('0x40')]({},_0x255fd3,_0x182821[_0x83ca('0x42')]);return db['DeskConfiguration'][_0x83ca('0x49')](_0x255fd3)[_0x83ca('0x26')](handleEntityNotFound(_0x35ccc3,null))[_0x83ca('0x26')](respondWithResult(_0x35ccc3,null))[_0x83ca('0x46')](handleError(_0x35ccc3,null));};exports[_0x83ca('0x4a')]=function(_0x2cfd07,_0x49814a){return db['DeskConfiguration'][_0x83ca('0x4a')](_0x2cfd07[_0x83ca('0x4b')],{})[_0x83ca('0x26')](respondWithResult(_0x49814a,0xc9))[_0x83ca('0x46')](handleError(_0x49814a,null));};exports[_0x83ca('0x25')]=function(_0x3c1030,_0x5405bd){if(_0x3c1030[_0x83ca('0x4b')]['id']){delete _0x3c1030[_0x83ca('0x4b')]['id'];}return db['DeskConfiguration'][_0x83ca('0x49')]({'where':{'id':_0x3c1030['params']['id']}})[_0x83ca('0x26')](handleEntityNotFound(_0x5405bd,null))[_0x83ca('0x26')](saveUpdates(_0x3c1030[_0x83ca('0x4b')],null))[_0x83ca('0x26')](respondWithResult(_0x5405bd,null))[_0x83ca('0x46')](handleError(_0x5405bd,null));};exports[_0x83ca('0x27')]=function(_0x2c8dac,_0x30a263){return db[_0x83ca('0x2b')][_0x83ca('0x49')]({'where':{'id':_0x2c8dac[_0x83ca('0x4c')]['id']}})[_0x83ca('0x26')](handleEntityNotFound(_0x30a263,null))[_0x83ca('0x26')](removeEntity(_0x30a263,null))['catch'](handleError(_0x30a263,null));};exports[_0x83ca('0x4d')]=function(_0x32823a,_0x14581e,_0x5ad8da){var _0x537bb1={};var _0xee6146={};var _0x436b36;var _0x3eeabe;return db[_0x83ca('0x2b')][_0x83ca('0x4e')]({'where':{'id':_0x32823a['params']['id']}})[_0x83ca('0x26')](handleEntityNotFound(_0x14581e,null))[_0x83ca('0x26')](function(_0x1600f0){if(_0x1600f0){_0x436b36=_0x1600f0;_0xee6146[_0x83ca('0x30')]=_[_0x83ca('0x33')](db['DeskField'][_0x83ca('0x2c')]);_0xee6146['query']=_[_0x83ca('0x33')](_0x32823a[_0x83ca('0x32')]);_0xee6146['filters']=_['intersection'](_0xee6146[_0x83ca('0x30')],_0xee6146[_0x83ca('0x32')]);_0x537bb1['attributes']=_[_0x83ca('0x35')](_0xee6146[_0x83ca('0x30')],qs[_0x83ca('0x37')](_0x32823a[_0x83ca('0x32')]['fields']));_0x537bb1[_0x83ca('0x36')]=_0x537bb1[_0x83ca('0x36')][_0x83ca('0x38')]?_0x537bb1[_0x83ca('0x36')]:_0xee6146[_0x83ca('0x30')];_0x537bb1[_0x83ca('0x3b')]=qs[_0x83ca('0x3c')](_0x32823a[_0x83ca('0x32')][_0x83ca('0x3c')]);_0x537bb1[_0x83ca('0x3d')]=qs[_0x83ca('0x34')](_[_0x83ca('0x3e')](_0x32823a[_0x83ca('0x32')],_0xee6146[_0x83ca('0x34')]));if(_0x32823a[_0x83ca('0x32')][_0x83ca('0x3f')]){_0x537bb1[_0x83ca('0x3d')]=_[_0x83ca('0x40')](_0x537bb1[_0x83ca('0x3d')],{'$or':_[_0x83ca('0x2a')](_0x537bb1[_0x83ca('0x36')],function(_0x136efe){var _0x181cdd={};_0x181cdd[_0x136efe]={'$like':'%'+_0x32823a['query'][_0x83ca('0x3f')]+'%'};return _0x181cdd;})});}_0x537bb1=_[_0x83ca('0x40')]({},_0x537bb1,_0x32823a[_0x83ca('0x42')]);return _0x436b36[_0x83ca('0x4d')](_0x537bb1);}})[_0x83ca('0x26')](function(_0x12b2d2){if(_0x12b2d2){_0x3eeabe=_0x12b2d2[_0x83ca('0x38')];if(!_0x32823a[_0x83ca('0x32')]['hasOwnProperty'](_0x83ca('0x3a'))){_0x537bb1[_0x83ca('0x1e')]=qs['limit'](_0x32823a['query'][_0x83ca('0x1e')]);_0x537bb1[_0x83ca('0x1c')]=qs['offset'](_0x32823a[_0x83ca('0x32')][_0x83ca('0x1c')]);}return _0x436b36[_0x83ca('0x4d')](_0x537bb1);}})[_0x83ca('0x26')](function(_0x3a32ac){if(_0x3a32ac){return _0x3a32ac?{'count':_0x3eeabe,'rows':_0x3a32ac}:null;}})[_0x83ca('0x26')](respondWithResult(_0x14581e,null))[_0x83ca('0x46')](handleError(_0x14581e,null));};exports['getSubjects']=function(_0x8a5594,_0x4dfe5a,_0x517662){var _0x2c4be9={};var _0x5ea68f={};var _0x34f1bd;var _0x17fc62;return db[_0x83ca('0x2b')]['findOne']({'where':{'id':_0x8a5594[_0x83ca('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4dfe5a,null))[_0x83ca('0x26')](function(_0x90f717){if(_0x90f717){_0x34f1bd=_0x90f717;_0x5ea68f['model']=_[_0x83ca('0x33')](db[_0x83ca('0x4f')][_0x83ca('0x2c')]);_0x5ea68f[_0x83ca('0x32')]=_['keys'](_0x8a5594[_0x83ca('0x32')]);_0x5ea68f['filters']=_[_0x83ca('0x35')](_0x5ea68f['model'],_0x5ea68f['query']);_0x2c4be9[_0x83ca('0x36')]=_['intersection'](_0x5ea68f[_0x83ca('0x30')],qs[_0x83ca('0x37')](_0x8a5594[_0x83ca('0x32')][_0x83ca('0x37')]));_0x2c4be9[_0x83ca('0x36')]=_0x2c4be9['attributes'][_0x83ca('0x38')]?_0x2c4be9[_0x83ca('0x36')]:_0x5ea68f['model'];_0x2c4be9[_0x83ca('0x3b')]=qs[_0x83ca('0x3c')](_0x8a5594[_0x83ca('0x32')][_0x83ca('0x3c')]);_0x2c4be9[_0x83ca('0x3d')]=qs[_0x83ca('0x34')](_[_0x83ca('0x3e')](_0x8a5594[_0x83ca('0x32')],_0x5ea68f[_0x83ca('0x34')]));if(_0x8a5594['query'][_0x83ca('0x3f')]){_0x2c4be9[_0x83ca('0x3d')]=_[_0x83ca('0x40')](_0x2c4be9[_0x83ca('0x3d')],{'$or':_[_0x83ca('0x2a')](_0x2c4be9['attributes'],function(_0xb72710){var _0x36f838={};_0x36f838[_0xb72710]={'$like':'%'+_0x8a5594[_0x83ca('0x32')][_0x83ca('0x3f')]+'%'};return _0x36f838;})});}_0x2c4be9=_['merge']({},_0x2c4be9,_0x8a5594['options']);return _0x34f1bd[_0x83ca('0x50')](_0x2c4be9);}})[_0x83ca('0x26')](function(_0x1c02ab){if(_0x1c02ab){_0x17fc62=_0x1c02ab[_0x83ca('0x38')];if(!_0x8a5594[_0x83ca('0x32')][_0x83ca('0x39')](_0x83ca('0x3a'))){_0x2c4be9[_0x83ca('0x1e')]=qs['limit'](_0x8a5594['query'][_0x83ca('0x1e')]);_0x2c4be9[_0x83ca('0x1c')]=qs[_0x83ca('0x1c')](_0x8a5594[_0x83ca('0x32')][_0x83ca('0x1c')]);}return _0x34f1bd[_0x83ca('0x50')](_0x2c4be9);}})[_0x83ca('0x26')](function(_0x5149b6){if(_0x5149b6){return _0x5149b6?{'count':_0x17fc62,'rows':_0x5149b6}:null;}})[_0x83ca('0x26')](respondWithResult(_0x4dfe5a,null))['catch'](handleError(_0x4dfe5a,null));};exports[_0x83ca('0x51')]=function(_0x12d4c9,_0x121d9f,_0x525add){var _0x10fc4f={};var _0x5a40b4={};var _0x798e40;var _0x324255;return db[_0x83ca('0x2b')][_0x83ca('0x4e')]({'where':{'id':_0x12d4c9['params']['id']}})['then'](handleEntityNotFound(_0x121d9f,null))[_0x83ca('0x26')](function(_0xee2c4c){if(_0xee2c4c){_0x798e40=_0xee2c4c;_0x5a40b4[_0x83ca('0x30')]=_[_0x83ca('0x33')](db['DeskField']['rawAttributes']);_0x5a40b4[_0x83ca('0x32')]=_[_0x83ca('0x33')](_0x12d4c9[_0x83ca('0x32')]);_0x5a40b4[_0x83ca('0x34')]=_[_0x83ca('0x35')](_0x5a40b4['model'],_0x5a40b4[_0x83ca('0x32')]);_0x10fc4f['attributes']=_[_0x83ca('0x35')](_0x5a40b4[_0x83ca('0x30')],qs[_0x83ca('0x37')](_0x12d4c9[_0x83ca('0x32')][_0x83ca('0x37')]));_0x10fc4f[_0x83ca('0x36')]=_0x10fc4f['attributes'][_0x83ca('0x38')]?_0x10fc4f[_0x83ca('0x36')]:_0x5a40b4[_0x83ca('0x30')];_0x10fc4f[_0x83ca('0x3b')]=qs['sort'](_0x12d4c9[_0x83ca('0x32')][_0x83ca('0x3c')]);_0x10fc4f['where']=qs[_0x83ca('0x34')](_['pick'](_0x12d4c9[_0x83ca('0x32')],_0x5a40b4[_0x83ca('0x34')]));if(_0x12d4c9[_0x83ca('0x32')][_0x83ca('0x3f')]){_0x10fc4f['where']=_[_0x83ca('0x40')](_0x10fc4f[_0x83ca('0x3d')],{'$or':_[_0x83ca('0x2a')](_0x10fc4f[_0x83ca('0x36')],function(_0x2fe66c){var _0x18c62b={};_0x18c62b[_0x2fe66c]={'$like':'%'+_0x12d4c9[_0x83ca('0x32')][_0x83ca('0x3f')]+'%'};return _0x18c62b;})});}_0x10fc4f=_[_0x83ca('0x40')]({},_0x10fc4f,_0x12d4c9[_0x83ca('0x42')]);return _0x798e40[_0x83ca('0x51')](_0x10fc4f);}})[_0x83ca('0x26')](function(_0x5a44d1){if(_0x5a44d1){_0x324255=_0x5a44d1[_0x83ca('0x38')];if(!_0x12d4c9['query'][_0x83ca('0x39')](_0x83ca('0x3a'))){_0x10fc4f[_0x83ca('0x1e')]=qs['limit'](_0x12d4c9['query'][_0x83ca('0x1e')]);_0x10fc4f[_0x83ca('0x1c')]=qs[_0x83ca('0x1c')](_0x12d4c9[_0x83ca('0x32')][_0x83ca('0x1c')]);}return _0x798e40[_0x83ca('0x51')](_0x10fc4f);}})[_0x83ca('0x26')](function(_0x32cd18){if(_0x32cd18){return _0x32cd18?{'count':_0x324255,'rows':_0x32cd18}:null;}})[_0x83ca('0x26')](respondWithResult(_0x121d9f,null))['catch'](handleError(_0x121d9f,null));};exports[_0x83ca('0x52')]=function(_0x5abd85,_0xbb84c9,_0x3638b4){var _0x234c1e={};var _0x431e32={};var _0x568dc0;var _0x1cbf56;return db[_0x83ca('0x2b')][_0x83ca('0x4e')]({'where':{'id':_0x5abd85[_0x83ca('0x4c')]['id']}})[_0x83ca('0x26')](handleEntityNotFound(_0xbb84c9,null))[_0x83ca('0x26')](function(_0x1de12c){if(_0x1de12c){_0x568dc0=_0x1de12c;_0x431e32[_0x83ca('0x30')]=_[_0x83ca('0x33')](db[_0x83ca('0x53')]['rawAttributes']);_0x431e32[_0x83ca('0x32')]=_[_0x83ca('0x33')](_0x5abd85[_0x83ca('0x32')]);_0x431e32[_0x83ca('0x34')]=_['intersection'](_0x431e32['model'],_0x431e32['query']);_0x234c1e[_0x83ca('0x36')]=_[_0x83ca('0x35')](_0x431e32['model'],qs['fields'](_0x5abd85[_0x83ca('0x32')][_0x83ca('0x37')]));_0x234c1e[_0x83ca('0x36')]=_0x234c1e[_0x83ca('0x36')]['length']?_0x234c1e['attributes']:_0x431e32[_0x83ca('0x30')];_0x234c1e[_0x83ca('0x3b')]=qs[_0x83ca('0x3c')](_0x5abd85[_0x83ca('0x32')][_0x83ca('0x3c')]);_0x234c1e[_0x83ca('0x3d')]=qs[_0x83ca('0x34')](_['pick'](_0x5abd85[_0x83ca('0x32')],_0x431e32[_0x83ca('0x34')]));if(_0x5abd85[_0x83ca('0x32')][_0x83ca('0x3f')]){_0x234c1e['where']=_[_0x83ca('0x40')](_0x234c1e['where'],{'$or':_['map'](_0x234c1e[_0x83ca('0x36')],function(_0x1550de){var _0x444821={};_0x444821[_0x1550de]={'$like':'%'+_0x5abd85[_0x83ca('0x32')][_0x83ca('0x3f')]+'%'};return _0x444821;})});}_0x234c1e=_[_0x83ca('0x40')]({},_0x234c1e,_0x5abd85[_0x83ca('0x42')]);return _0x568dc0[_0x83ca('0x52')](_0x234c1e);}})[_0x83ca('0x26')](function(_0x3cecae){if(_0x3cecae){_0x1cbf56=_0x3cecae[_0x83ca('0x38')];if(!_0x5abd85[_0x83ca('0x32')][_0x83ca('0x39')]('nolimit')){_0x234c1e['limit']=qs['limit'](_0x5abd85[_0x83ca('0x32')][_0x83ca('0x1e')]);_0x234c1e['offset']=qs[_0x83ca('0x1c')](_0x5abd85[_0x83ca('0x32')][_0x83ca('0x1c')]);}return _0x568dc0['getTags'](_0x234c1e);}})[_0x83ca('0x26')](function(_0x44ce65){if(_0x44ce65){return _0x44ce65?{'count':_0x1cbf56,'rows':_0x44ce65}:null;}})['then'](respondWithResult(_0xbb84c9,null))[_0x83ca('0x46')](handleError(_0xbb84c9,null));};exports['setTags']=function(_0x17492c,_0x3b72bb,_0x6eb20e){if(_0x17492c[_0x83ca('0x4b')]['id']){delete _0x17492c[_0x83ca('0x4b')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x17492c['params']['id']}})[_0x83ca('0x26')](handleEntityNotFound(_0x3b72bb,null))[_0x83ca('0x26')](function(_0x901082){if(_0x901082){return _0x901082[_0x83ca('0x54')](_0x17492c[_0x83ca('0x4b')][_0x83ca('0x55')]||[]);}return null;})[_0x83ca('0x26')](respondWithResult(_0x3b72bb,null))[_0x83ca('0x46')](handleError(_0x3b72bb,null));}; \ No newline at end of file +var _0x125a=['mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','destroy','then','error','stack','send','DeskConfiguration','rawAttributes','type','model','map','name','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','keys','length','includeAll','find','create','body','update','params','getFields','findOne','DeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','moment'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x125a,0x187));var _0xa125=function(_0x3c2a87,_0x301e33){_0x3c2a87=_0x3c2a87-0x0;var _0x3a4efd=_0x125a[_0x3c2a87];return _0x3a4efd;};'use strict';var emlformat=require(_0xa125('0x0'));var rimraf=require(_0xa125('0x1'));var zipdir=require(_0xa125('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa125('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa125('0x4'));var util=require('util');var path=require(_0xa125('0x5'));var sox=require('sox');var csv=require(_0xa125('0x6'));var ejs=require(_0xa125('0x7'));var fs=require('fs');var fs_extra=require(_0xa125('0x8'));var _=require('lodash');var squel=require(_0xa125('0x9'));var crypto=require('crypto');var jsforce=require(_0xa125('0xa'));var deskjs=require(_0xa125('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa125('0xc'));var Papa=require(_0xa125('0xd'));var Redis=require(_0xa125('0xe'));var authService=require(_0xa125('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa125('0x10'));var hardwareService=require(_0xa125('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa125('0x12'));var config=require(_0xa125('0x13'));var licenseUtil=require(_0xa125('0x14'));var db=require(_0xa125('0x15'))['db'];function respondWithStatusCode(_0x2dfc69,_0x5d73da){_0x5d73da=_0x5d73da||0xcc;return function(_0x4f6890){if(_0x4f6890){return _0x2dfc69[_0xa125('0x16')](_0x5d73da);}return _0x2dfc69[_0xa125('0x17')](_0x5d73da)[_0xa125('0x18')]();};}function respondWithResult(_0x4ebea2,_0x316352){_0x316352=_0x316352||0xc8;return function(_0x3cb24f){if(_0x3cb24f){return _0x4ebea2[_0xa125('0x17')](_0x316352)['json'](_0x3cb24f);}};}function respondWithFilteredResult(_0x52680d,_0x5d42ad){return function(_0x387d12){if(_0x387d12){var _0x50e052=typeof _0x5d42ad['offset']===_0xa125('0x19')&&typeof _0x5d42ad['limit']===_0xa125('0x19');var _0x2933c9=_0x387d12[_0xa125('0x1a')];var _0x15cb66=_0x50e052?0x0:_0x5d42ad[_0xa125('0x1b')];var _0x1ce6b7=_0x50e052?_0x387d12['count']:_0x5d42ad['offset']+_0x5d42ad[_0xa125('0x1c')];var _0x5aa02b;if(_0x1ce6b7>=_0x2933c9){_0x1ce6b7=_0x2933c9;_0x5aa02b=0xc8;}else{_0x5aa02b=0xce;}_0x52680d[_0xa125('0x17')](_0x5aa02b);return _0x52680d[_0xa125('0x1d')]('Content-Range',_0x15cb66+'-'+_0x1ce6b7+'/'+_0x2933c9)['json'](_0x387d12);}return null;};}function patchUpdates(_0x16d332){return function(_0x49b628){try{jsonpatch[_0xa125('0x1e')](_0x49b628,_0x16d332,!![]);}catch(_0xeeb165){return BPromise[_0xa125('0x1f')](_0xeeb165);}return _0x49b628[_0xa125('0x20')]();};}function saveUpdates(_0x2dfa74,_0x56acbb){return function(_0x24f996){if(_0x24f996){return _0x24f996['update'](_0x2dfa74)['then'](function(_0x232123){return _0x232123;});}return null;};}function removeEntity(_0x1ae0b2,_0x4c8b47){return function(_0x457d11){if(_0x457d11){return _0x457d11[_0xa125('0x21')]()[_0xa125('0x22')](function(){_0x1ae0b2[_0xa125('0x17')](0xcc)[_0xa125('0x18')]();});}};}function handleEntityNotFound(_0x2b5204,_0x1dd313){return function(_0x1ce316){if(!_0x1ce316){_0x2b5204[_0xa125('0x16')](0x194);}return _0x1ce316;};}function handleError(_0x283ab7,_0x1b9f6b){_0x1b9f6b=_0x1b9f6b||0x1f4;return function(_0x4121bf){logger[_0xa125('0x23')](_0x4121bf[_0xa125('0x24')]);if(_0x4121bf['name']){delete _0x4121bf['name'];}_0x283ab7[_0xa125('0x17')](_0x1b9f6b)[_0xa125('0x25')](_0x4121bf);};}exports['index']=function(_0x3d7b6b,_0x2042a9){var _0x49770e={},_0x1e8c43={},_0x4a677a={'count':0x0,'rows':[]};var _0x13da83=_['map'](db[_0xa125('0x26')][_0xa125('0x27')],function(_0x546f37){return{'name':_0x546f37['fieldName'],'type':_0x546f37[_0xa125('0x28')]['key']};});_0x1e8c43[_0xa125('0x29')]=_[_0xa125('0x2a')](_0x13da83,_0xa125('0x2b'));_0x1e8c43[_0xa125('0x2c')]=_['keys'](_0x3d7b6b[_0xa125('0x2c')]);_0x1e8c43['filters']=_['intersection'](_0x1e8c43[_0xa125('0x29')],_0x1e8c43[_0xa125('0x2c')]);_0x49770e[_0xa125('0x2d')]=_[_0xa125('0x2e')](_0x1e8c43[_0xa125('0x29')],qs[_0xa125('0x2f')](_0x3d7b6b[_0xa125('0x2c')][_0xa125('0x2f')]));_0x49770e[_0xa125('0x2d')]=_0x49770e[_0xa125('0x2d')]['length']?_0x49770e['attributes']:_0x1e8c43['model'];if(!_0x3d7b6b[_0xa125('0x2c')][_0xa125('0x30')](_0xa125('0x31'))){_0x49770e[_0xa125('0x1c')]=qs[_0xa125('0x1c')](_0x3d7b6b[_0xa125('0x2c')]['limit']);_0x49770e[_0xa125('0x1b')]=qs[_0xa125('0x1b')](_0x3d7b6b[_0xa125('0x2c')][_0xa125('0x1b')]);}_0x49770e[_0xa125('0x32')]=qs[_0xa125('0x33')](_0x3d7b6b['query'][_0xa125('0x33')]);_0x49770e['where']=qs[_0xa125('0x34')](_[_0xa125('0x35')](_0x3d7b6b[_0xa125('0x2c')],_0x1e8c43[_0xa125('0x34')]),_0x13da83);if(_0x3d7b6b[_0xa125('0x2c')][_0xa125('0x36')]){_0x49770e[_0xa125('0x37')]=_['merge'](_0x49770e[_0xa125('0x37')],{'$or':_['map'](_0x13da83,function(_0x54f082){if(_0x54f082[_0xa125('0x28')]!=='VIRTUAL'){var _0xd44c70={};_0xd44c70[_0x54f082[_0xa125('0x2b')]]={'$like':'%'+_0x3d7b6b['query'][_0xa125('0x36')]+'%'};return _0xd44c70;}})});}_0x49770e=_[_0xa125('0x38')]({},_0x49770e,_0x3d7b6b[_0xa125('0x39')]);var _0x57263a={'where':_0x49770e[_0xa125('0x37')]};return db[_0xa125('0x26')][_0xa125('0x1a')](_0x57263a)[_0xa125('0x22')](function(_0x471571){_0x4a677a['count']=_0x471571;if(_0x3d7b6b['query']['includeAll']){_0x49770e[_0xa125('0x3a')]=[{'all':!![]}];}return db[_0xa125('0x26')][_0xa125('0x3b')](_0x49770e);})['then'](function(_0x198bff){_0x4a677a[_0xa125('0x3c')]=_0x198bff;return _0x4a677a;})[_0xa125('0x22')](respondWithFilteredResult(_0x2042a9,_0x49770e))[_0xa125('0x3d')](handleError(_0x2042a9,null));};exports['show']=function(_0x57c369,_0x5ea102){var _0x178c88={'raw':![],'where':{'id':_0x57c369['params']['id']}},_0x5ac4ac={};_0x5ac4ac['model']=_[_0xa125('0x3e')](db[_0xa125('0x26')][_0xa125('0x27')]);_0x5ac4ac[_0xa125('0x2c')]=_['keys'](_0x57c369[_0xa125('0x2c')]);_0x5ac4ac['filters']=_[_0xa125('0x2e')](_0x5ac4ac['model'],_0x5ac4ac[_0xa125('0x2c')]);_0x178c88['attributes']=_['intersection'](_0x5ac4ac['model'],qs[_0xa125('0x2f')](_0x57c369[_0xa125('0x2c')][_0xa125('0x2f')]));_0x178c88[_0xa125('0x2d')]=_0x178c88['attributes'][_0xa125('0x3f')]?_0x178c88['attributes']:_0x5ac4ac[_0xa125('0x29')];if(_0x57c369[_0xa125('0x2c')][_0xa125('0x40')]){_0x178c88['include']=[{'all':!![]}];}_0x178c88=_['merge']({},_0x178c88,_0x57c369[_0xa125('0x39')]);return db[_0xa125('0x26')][_0xa125('0x41')](_0x178c88)[_0xa125('0x22')](handleEntityNotFound(_0x5ea102,null))[_0xa125('0x22')](respondWithResult(_0x5ea102,null))[_0xa125('0x3d')](handleError(_0x5ea102,null));};exports[_0xa125('0x42')]=function(_0x2f729b,_0x21d900){return db[_0xa125('0x26')][_0xa125('0x42')](_0x2f729b[_0xa125('0x43')],{})['then'](respondWithResult(_0x21d900,0xc9))['catch'](handleError(_0x21d900,null));};exports[_0xa125('0x44')]=function(_0x57e5d1,_0x1d53a0){if(_0x57e5d1['body']['id']){delete _0x57e5d1[_0xa125('0x43')]['id'];}return db[_0xa125('0x26')][_0xa125('0x41')]({'where':{'id':_0x57e5d1[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x1d53a0,null))[_0xa125('0x22')](saveUpdates(_0x57e5d1[_0xa125('0x43')],null))[_0xa125('0x22')](respondWithResult(_0x1d53a0,null))[_0xa125('0x3d')](handleError(_0x1d53a0,null));};exports['destroy']=function(_0x28844e,_0x1bde59){return db['DeskConfiguration']['find']({'where':{'id':_0x28844e[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x1bde59,null))[_0xa125('0x22')](removeEntity(_0x1bde59,null))[_0xa125('0x3d')](handleError(_0x1bde59,null));};exports[_0xa125('0x46')]=function(_0x323e2e,_0x80e6e8,_0x138d9e){var _0x197e6a={};var _0x1a21d6={};var _0x2d0167;var _0x22f6bf;return db[_0xa125('0x26')][_0xa125('0x47')]({'where':{'id':_0x323e2e[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x80e6e8,null))[_0xa125('0x22')](function(_0x143720){if(_0x143720){_0x2d0167=_0x143720;_0x1a21d6['model']=_['keys'](db[_0xa125('0x48')][_0xa125('0x27')]);_0x1a21d6['query']=_['keys'](_0x323e2e[_0xa125('0x2c')]);_0x1a21d6[_0xa125('0x34')]=_['intersection'](_0x1a21d6[_0xa125('0x29')],_0x1a21d6[_0xa125('0x2c')]);_0x197e6a['attributes']=_[_0xa125('0x2e')](_0x1a21d6[_0xa125('0x29')],qs[_0xa125('0x2f')](_0x323e2e['query'][_0xa125('0x2f')]));_0x197e6a[_0xa125('0x2d')]=_0x197e6a[_0xa125('0x2d')][_0xa125('0x3f')]?_0x197e6a[_0xa125('0x2d')]:_0x1a21d6[_0xa125('0x29')];_0x197e6a[_0xa125('0x32')]=qs['sort'](_0x323e2e[_0xa125('0x2c')]['sort']);_0x197e6a[_0xa125('0x37')]=qs[_0xa125('0x34')](_[_0xa125('0x35')](_0x323e2e['query'],_0x1a21d6['filters']));if(_0x323e2e[_0xa125('0x2c')][_0xa125('0x36')]){_0x197e6a[_0xa125('0x37')]=_[_0xa125('0x38')](_0x197e6a[_0xa125('0x37')],{'$or':_[_0xa125('0x2a')](_0x197e6a[_0xa125('0x2d')],function(_0x5d225d){var _0x34649e={};_0x34649e[_0x5d225d]={'$like':'%'+_0x323e2e[_0xa125('0x2c')][_0xa125('0x36')]+'%'};return _0x34649e;})});}_0x197e6a=_[_0xa125('0x38')]({},_0x197e6a,_0x323e2e[_0xa125('0x39')]);return _0x2d0167[_0xa125('0x46')](_0x197e6a);}})[_0xa125('0x22')](function(_0x44460f){if(_0x44460f){_0x22f6bf=_0x44460f[_0xa125('0x3f')];if(!_0x323e2e[_0xa125('0x2c')][_0xa125('0x30')](_0xa125('0x31'))){_0x197e6a[_0xa125('0x1c')]=qs['limit'](_0x323e2e[_0xa125('0x2c')]['limit']);_0x197e6a[_0xa125('0x1b')]=qs[_0xa125('0x1b')](_0x323e2e[_0xa125('0x2c')][_0xa125('0x1b')]);}return _0x2d0167[_0xa125('0x46')](_0x197e6a);}})[_0xa125('0x22')](function(_0x4175ce){if(_0x4175ce){return _0x4175ce?{'count':_0x22f6bf,'rows':_0x4175ce}:null;}})[_0xa125('0x22')](respondWithResult(_0x80e6e8,null))['catch'](handleError(_0x80e6e8,null));};exports['getSubjects']=function(_0x2b6288,_0x2d6d9f,_0x215fb6){var _0x4ec079={};var _0x5afa9b={};var _0x5938b7;var _0x529ab0;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2b6288['params']['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x2d6d9f,null))[_0xa125('0x22')](function(_0x329c14){if(_0x329c14){_0x5938b7=_0x329c14;_0x5afa9b[_0xa125('0x29')]=_[_0xa125('0x3e')](db[_0xa125('0x48')][_0xa125('0x27')]);_0x5afa9b['query']=_[_0xa125('0x3e')](_0x2b6288['query']);_0x5afa9b[_0xa125('0x34')]=_[_0xa125('0x2e')](_0x5afa9b[_0xa125('0x29')],_0x5afa9b[_0xa125('0x2c')]);_0x4ec079[_0xa125('0x2d')]=_[_0xa125('0x2e')](_0x5afa9b[_0xa125('0x29')],qs['fields'](_0x2b6288[_0xa125('0x2c')]['fields']));_0x4ec079[_0xa125('0x2d')]=_0x4ec079['attributes'][_0xa125('0x3f')]?_0x4ec079[_0xa125('0x2d')]:_0x5afa9b[_0xa125('0x29')];_0x4ec079['order']=qs[_0xa125('0x33')](_0x2b6288[_0xa125('0x2c')][_0xa125('0x33')]);_0x4ec079['where']=qs[_0xa125('0x34')](_[_0xa125('0x35')](_0x2b6288[_0xa125('0x2c')],_0x5afa9b[_0xa125('0x34')]));if(_0x2b6288['query'][_0xa125('0x36')]){_0x4ec079[_0xa125('0x37')]=_[_0xa125('0x38')](_0x4ec079[_0xa125('0x37')],{'$or':_[_0xa125('0x2a')](_0x4ec079[_0xa125('0x2d')],function(_0x20602e){var _0x40d1d8={};_0x40d1d8[_0x20602e]={'$like':'%'+_0x2b6288[_0xa125('0x2c')]['filter']+'%'};return _0x40d1d8;})});}_0x4ec079=_[_0xa125('0x38')]({},_0x4ec079,_0x2b6288[_0xa125('0x39')]);return _0x5938b7[_0xa125('0x49')](_0x4ec079);}})[_0xa125('0x22')](function(_0x495fed){if(_0x495fed){_0x529ab0=_0x495fed[_0xa125('0x3f')];if(!_0x2b6288[_0xa125('0x2c')][_0xa125('0x30')]('nolimit')){_0x4ec079['limit']=qs['limit'](_0x2b6288[_0xa125('0x2c')]['limit']);_0x4ec079[_0xa125('0x1b')]=qs[_0xa125('0x1b')](_0x2b6288[_0xa125('0x2c')]['offset']);}return _0x5938b7[_0xa125('0x49')](_0x4ec079);}})[_0xa125('0x22')](function(_0x32a076){if(_0x32a076){return _0x32a076?{'count':_0x529ab0,'rows':_0x32a076}:null;}})[_0xa125('0x22')](respondWithResult(_0x2d6d9f,null))[_0xa125('0x3d')](handleError(_0x2d6d9f,null));};exports[_0xa125('0x4a')]=function(_0x5b033e,_0x42e9ed,_0xd30ad5){var _0xfad9da={};var _0x207fd8={};var _0x3eb55d;var _0x1b0567;return db[_0xa125('0x26')][_0xa125('0x47')]({'where':{'id':_0x5b033e[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x42e9ed,null))[_0xa125('0x22')](function(_0xf09dae){if(_0xf09dae){_0x3eb55d=_0xf09dae;_0x207fd8[_0xa125('0x29')]=_['keys'](db[_0xa125('0x48')][_0xa125('0x27')]);_0x207fd8[_0xa125('0x2c')]=_['keys'](_0x5b033e[_0xa125('0x2c')]);_0x207fd8['filters']=_[_0xa125('0x2e')](_0x207fd8[_0xa125('0x29')],_0x207fd8[_0xa125('0x2c')]);_0xfad9da[_0xa125('0x2d')]=_[_0xa125('0x2e')](_0x207fd8['model'],qs['fields'](_0x5b033e['query'][_0xa125('0x2f')]));_0xfad9da['attributes']=_0xfad9da[_0xa125('0x2d')][_0xa125('0x3f')]?_0xfad9da[_0xa125('0x2d')]:_0x207fd8[_0xa125('0x29')];_0xfad9da[_0xa125('0x32')]=qs[_0xa125('0x33')](_0x5b033e['query'][_0xa125('0x33')]);_0xfad9da[_0xa125('0x37')]=qs[_0xa125('0x34')](_[_0xa125('0x35')](_0x5b033e['query'],_0x207fd8[_0xa125('0x34')]));if(_0x5b033e[_0xa125('0x2c')]['filter']){_0xfad9da[_0xa125('0x37')]=_['merge'](_0xfad9da[_0xa125('0x37')],{'$or':_['map'](_0xfad9da[_0xa125('0x2d')],function(_0x17b80c){var _0x2b2966={};_0x2b2966[_0x17b80c]={'$like':'%'+_0x5b033e[_0xa125('0x2c')][_0xa125('0x36')]+'%'};return _0x2b2966;})});}_0xfad9da=_[_0xa125('0x38')]({},_0xfad9da,_0x5b033e[_0xa125('0x39')]);return _0x3eb55d[_0xa125('0x4a')](_0xfad9da);}})[_0xa125('0x22')](function(_0x293ff5){if(_0x293ff5){_0x1b0567=_0x293ff5[_0xa125('0x3f')];if(!_0x5b033e['query'][_0xa125('0x30')](_0xa125('0x31'))){_0xfad9da['limit']=qs['limit'](_0x5b033e['query']['limit']);_0xfad9da['offset']=qs[_0xa125('0x1b')](_0x5b033e[_0xa125('0x2c')]['offset']);}return _0x3eb55d[_0xa125('0x4a')](_0xfad9da);}})[_0xa125('0x22')](function(_0x2aee00){if(_0x2aee00){return _0x2aee00?{'count':_0x1b0567,'rows':_0x2aee00}:null;}})[_0xa125('0x22')](respondWithResult(_0x42e9ed,null))[_0xa125('0x3d')](handleError(_0x42e9ed,null));};exports['getTags']=function(_0x933862,_0x545304,_0x20c22a){var _0x3879dd={};var _0x30d493={};var _0x43916e;var _0x55be91;return db[_0xa125('0x26')][_0xa125('0x47')]({'where':{'id':_0x933862[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x545304,null))[_0xa125('0x22')](function(_0x4c79bf){if(_0x4c79bf){_0x43916e=_0x4c79bf;_0x30d493[_0xa125('0x29')]=_[_0xa125('0x3e')](db[_0xa125('0x4b')][_0xa125('0x27')]);_0x30d493[_0xa125('0x2c')]=_[_0xa125('0x3e')](_0x933862['query']);_0x30d493[_0xa125('0x34')]=_[_0xa125('0x2e')](_0x30d493[_0xa125('0x29')],_0x30d493[_0xa125('0x2c')]);_0x3879dd[_0xa125('0x2d')]=_[_0xa125('0x2e')](_0x30d493[_0xa125('0x29')],qs[_0xa125('0x2f')](_0x933862[_0xa125('0x2c')][_0xa125('0x2f')]));_0x3879dd[_0xa125('0x2d')]=_0x3879dd[_0xa125('0x2d')]['length']?_0x3879dd[_0xa125('0x2d')]:_0x30d493[_0xa125('0x29')];_0x3879dd[_0xa125('0x32')]=qs[_0xa125('0x33')](_0x933862[_0xa125('0x2c')][_0xa125('0x33')]);_0x3879dd[_0xa125('0x37')]=qs[_0xa125('0x34')](_[_0xa125('0x35')](_0x933862[_0xa125('0x2c')],_0x30d493[_0xa125('0x34')]));if(_0x933862['query'][_0xa125('0x36')]){_0x3879dd[_0xa125('0x37')]=_[_0xa125('0x38')](_0x3879dd[_0xa125('0x37')],{'$or':_['map'](_0x3879dd['attributes'],function(_0x41f050){var _0x56d5f0={};_0x56d5f0[_0x41f050]={'$like':'%'+_0x933862[_0xa125('0x2c')][_0xa125('0x36')]+'%'};return _0x56d5f0;})});}_0x3879dd=_[_0xa125('0x38')]({},_0x3879dd,_0x933862['options']);return _0x43916e['getTags'](_0x3879dd);}})[_0xa125('0x22')](function(_0x267a80){if(_0x267a80){_0x55be91=_0x267a80[_0xa125('0x3f')];if(!_0x933862[_0xa125('0x2c')][_0xa125('0x30')]('nolimit')){_0x3879dd[_0xa125('0x1c')]=qs[_0xa125('0x1c')](_0x933862[_0xa125('0x2c')][_0xa125('0x1c')]);_0x3879dd[_0xa125('0x1b')]=qs[_0xa125('0x1b')](_0x933862[_0xa125('0x2c')][_0xa125('0x1b')]);}return _0x43916e[_0xa125('0x4c')](_0x3879dd);}})[_0xa125('0x22')](function(_0x5f290f){if(_0x5f290f){return _0x5f290f?{'count':_0x55be91,'rows':_0x5f290f}:null;}})[_0xa125('0x22')](respondWithResult(_0x545304,null))[_0xa125('0x3d')](handleError(_0x545304,null));};exports[_0xa125('0x4d')]=function(_0x5aac0d,_0x53eb4b,_0x1891c8){if(_0x5aac0d['body']['id']){delete _0x5aac0d['body']['id'];}return db['DeskConfiguration'][_0xa125('0x47')]({'where':{'id':_0x5aac0d[_0xa125('0x45')]['id']}})[_0xa125('0x22')](handleEntityNotFound(_0x53eb4b,null))[_0xa125('0x22')](function(_0x2ed2eb){if(_0x2ed2eb){return _0x2ed2eb[_0xa125('0x4d')](_0x5aac0d[_0xa125('0x43')][_0xa125('0x4e')]||[]);}return null;})[_0xa125('0x22')](respondWithResult(_0x53eb4b,null))[_0xa125('0x3d')](handleError(_0x53eb4b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6bad00d..e2689e9 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 _0x2289=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration'];(function(_0x2912b9,_0x55e6e1){var _0x154da8=function(_0x503667){while(--_0x503667){_0x2912b9['push'](_0x2912b9['shift']());}};_0x154da8(++_0x55e6e1);}(_0x2289,0xc6));var _0x9228=function(_0x2f1651,_0x10b559){_0x2f1651=_0x2f1651-0x0;var _0xedeb1=_0x2289[_0x2f1651];return _0xedeb1;};'use strict';var _=require(_0x9228('0x0'));var util=require(_0x9228('0x1'));var logger=require(_0x9228('0x2'))('api');var moment=require(_0x9228('0x3'));var BPromise=require(_0x9228('0x4'));var rp=require(_0x9228('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9228('0x6'));var config=require(_0x9228('0x7'));var attributes=require(_0x9228('0x8'));module[_0x9228('0x9')]=function(_0x1456ac,_0x22c518){return _0x1456ac['define'](_0x9228('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7837=['../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','../../config/logger','api','moment','path'];(function(_0x1e06a2,_0x57089f){var _0x5d7a7c=function(_0x58d318){while(--_0x58d318){_0x1e06a2['push'](_0x1e06a2['shift']());}};_0x5d7a7c(++_0x57089f);}(_0x7837,0x13f));var _0x7783=function(_0x4aa9da,_0x5d7920){_0x4aa9da=_0x4aa9da-0x0;var _0x408e93=_0x7837[_0x4aa9da];return _0x408e93;};'use strict';var _=require(_0x7783('0x0'));var util=require('util');var logger=require(_0x7783('0x1'))(_0x7783('0x2'));var moment=require(_0x7783('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7783('0x4'));var rimraf=require('rimraf');var config=require(_0x7783('0x5'));var attributes=require(_0x7783('0x6'));module['exports']=function(_0xb3c66b,_0x5084f2){return _0xb3c66b[_0x7783('0x7')]('DeskConfiguration',attributes,{'tableName':_0x7783('0x8'),'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 1e6fa2a..fc161ec 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 _0x3014=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s'];(function(_0x19b695,_0x35be9e){var _0x5937d0=function(_0x16ac94){while(--_0x16ac94){_0x19b695['push'](_0x19b695['shift']());}};_0x5937d0(++_0x35be9e);}(_0x3014,0x1d7));var _0x4301=function(_0x229159,_0x162314){_0x229159=_0x229159-0x0;var _0x4a91a2=_0x3014[_0x229159];return _0x4a91a2;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});} \ No newline at end of file +var _0x7c71=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xbf28f2,_0xf5721c){var _0x153e54=function(_0x51e89c){while(--_0x51e89c){_0xbf28f2['push'](_0xbf28f2['shift']());}};_0x153e54(++_0xf5721c);}(_0x7c71,0x177));var _0x17c7=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0x7c71[_0x4d67b8];return _0x55af3b;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var moment=require(_0x17c7('0x2'));var BPromise=require(_0x17c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require(_0x17c7('0x5'))['db'];var utils=require(_0x17c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17c7('0x7'));var jayson=require(_0x17c7('0x8'));var client=jayson[_0x17c7('0x9')][_0x17c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c061b,_0xf284a2,_0x1ff4ec){return new BPromise(function(_0x50feb0,_0x13fdad){return client[_0x17c7('0xb')](_0x3c061b,_0x1ff4ec)[_0x17c7('0xc')](function(_0xdb3575){logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));logger[_0x17c7('0x10')](_0x17c7('0x11'),_0xf284a2,_0x17c7('0xf'),JSON['stringify'](_0xdb3575));if(_0xdb3575['error']){if(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x13')]===0x1f4){logger['error'](_0x17c7('0xe'),_0xf284a2,_0xdb3575[_0x17c7('0x12')]['message']);return _0x13fdad(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xf284a2,_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);return _0x50feb0(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}else{logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));_0x50feb0(_0xdb3575[_0x17c7('0x15')][_0x17c7('0x14')]);}})[_0x17c7('0x16')](function(_0x296f9c){logger[_0x17c7('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0xf284a2,_0x296f9c);_0x13fdad(_0x296f9c);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e77aed2..e846d03 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 _0x0f32=['isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','path','fs-extra','../../components/interaction/service','./intDeskField.controller'];(function(_0x1063f0,_0x53980d){var _0x4698ce=function(_0x21d966){while(--_0x21d966){_0x1063f0['push'](_0x1063f0['shift']());}};_0x4698ce(++_0x53980d);}(_0x0f32,0x73));var _0x20f3=function(_0x8676e2,_0x332b7e){_0x8676e2=_0x8676e2-0x0;var _0x39e201=_0x0f32[_0x8676e2];return _0x39e201;};'use strict';var multer=require(_0x20f3('0x0'));var util=require('util');var path=require(_0x20f3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x20f3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x20f3('0x3'));var config=require('../../config/environment');var controller=require(_0x20f3('0x4'));router['get']('/',auth[_0x20f3('0x5')](),controller['index']);router[_0x20f3('0x6')](_0x20f3('0x7'),auth[_0x20f3('0x5')](),controller[_0x20f3('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x20f3('0x9')]);router[_0x20f3('0xa')](_0x20f3('0x7'),auth['isAuthenticated'](),controller[_0x20f3('0xb')]);router[_0x20f3('0xc')](_0x20f3('0x7'),auth[_0x20f3('0x5')](),controller[_0x20f3('0xd')]);module[_0x20f3('0xe')]=router; \ No newline at end of file +var _0xd950=['../../config/environment','get','isAuthenticated','index','show','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x35bcac,_0x232e0b){var _0x1cc747=function(_0x453fd6){while(--_0x453fd6){_0x35bcac['push'](_0x35bcac['shift']());}};_0x1cc747(++_0x232e0b);}(_0xd950,0x17f));var _0x0d95=function(_0x58d75b,_0x44039f){_0x58d75b=_0x58d75b-0x0;var _0x37879f=_0xd950[_0x58d75b];return _0x37879f;};'use strict';var multer=require(_0x0d95('0x0'));var util=require(_0x0d95('0x1'));var path=require('path');var timeout=require(_0x0d95('0x2'));var express=require(_0x0d95('0x3'));var router=express[_0x0d95('0x4')]();var fs_extra=require(_0x0d95('0x5'));var auth=require(_0x0d95('0x6'));var interaction=require(_0x0d95('0x7'));var config=require(_0x0d95('0x8'));var controller=require('./intDeskField.controller');router[_0x0d95('0x9')]('/',auth[_0x0d95('0xa')](),controller[_0x0d95('0xb')]);router[_0x0d95('0x9')]('/:id',auth[_0x0d95('0xa')](),controller[_0x0d95('0xc')]);router['post']('/',auth[_0x0d95('0xa')](),controller['create']);router[_0x0d95('0xd')](_0x0d95('0xe'),auth[_0x0d95('0xa')](),controller[_0x0d95('0xf')]);router['delete'](_0x0d95('0xe'),auth[_0x0d95('0xa')](),controller[_0x0d95('0x10')]);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 670d847..34021d3 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 _0xc763=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x3acd5a,_0x18bb90){var _0x46f2a2=function(_0x2924dd){while(--_0x2924dd){_0x3acd5a['push'](_0x3acd5a['shift']());}};_0x46f2a2(++_0x18bb90);}(_0xc763,0x1e4));var _0x3c76=function(_0x53f68f,_0x59d454){_0x53f68f=_0x53f68f-0x0;var _0x1f3118=_0xc763[_0x53f68f];return _0x1f3118;};'use strict';var Sequelize=require(_0x3c76('0x0'));module[_0x3c76('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3c76('0x2'),_0x3c76('0x3'),_0x3c76('0x4'),_0x3c76('0x5'),_0x3c76('0x6')),'defaultValue':_0x3c76('0x2')},'content':{'type':Sequelize[_0x3c76('0x7')]},'key':{'type':Sequelize[_0x3c76('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3c76('0x2'),_0x3c76('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3c76('0x7')]},'idField':{'type':Sequelize[_0x3c76('0x7')]},'nameField':{'type':Sequelize[_0x3c76('0x7')]},'customField':{'type':Sequelize[_0x3c76('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c76('0x7')]}}; \ No newline at end of file +var _0xb6ef=['ENUM','BOOLEAN','sequelize','exports','string','customVariable','picklist','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb6ef,0x15a));var _0xfb6e=function(_0x4376d0,_0x487b12){_0x4376d0=_0x4376d0-0x0;var _0x4e9e31=_0xb6ef[_0x4376d0];return _0x4e9e31;};'use strict';var Sequelize=require(_0xfb6e('0x0'));module[_0xfb6e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfb6e('0x2'),'variable',_0xfb6e('0x3'),'keyValue',_0xfb6e('0x4')),'defaultValue':_0xfb6e('0x2')},'content':{'type':Sequelize[_0xfb6e('0x5')]},'key':{'type':Sequelize[_0xfb6e('0x5')]},'keyType':{'type':Sequelize[_0xfb6e('0x6')](_0xfb6e('0x2'),'variable',_0xfb6e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfb6e('0x5')]},'nameField':{'type':Sequelize[_0xfb6e('0x5')]},'customField':{'type':Sequelize[_0xfb6e('0x7')],'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 5bc46ca..b5036fa 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 _0x8506=['key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','options','find','create','body','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','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','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','DeskField','rawAttributes','fieldName','type'];(function(_0x53fdc6,_0x593c9b){var _0x5eda3c=function(_0x4b4fdf){while(--_0x4b4fdf){_0x53fdc6['push'](_0x53fdc6['shift']());}};_0x5eda3c(++_0x593c9b);}(_0x8506,0xe8));var _0x6850=function(_0x20bce4,_0xce5b5a){_0x20bce4=_0x20bce4-0x0;var _0x595f5a=_0x8506[_0x20bce4];return _0x595f5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6850('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6850('0x1'));var rp=require('request-promise');var moment=require(_0x6850('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6850('0x3'));var util=require(_0x6850('0x4'));var path=require(_0x6850('0x5'));var sox=require('sox');var csv=require(_0x6850('0x6'));var ejs=require(_0x6850('0x7'));var fs=require('fs');var fs_extra=require(_0x6850('0x8'));var _=require(_0x6850('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6850('0xa'));var toCsv=require(_0x6850('0x6'));var querystring=require(_0x6850('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6850('0xc'));var qs=require(_0x6850('0xd'));var as=require(_0x6850('0xe'));var hardwareService=require(_0x6850('0xf'));var logger=require(_0x6850('0x10'))('api');var utils=require(_0x6850('0x11'));var config=require(_0x6850('0x12'));var licenseUtil=require(_0x6850('0x13'));var db=require(_0x6850('0x14'))['db'];function respondWithStatusCode(_0x1387b8,_0x7f7b63){_0x7f7b63=_0x7f7b63||0xcc;return function(_0x4e63c4){if(_0x4e63c4){return _0x1387b8[_0x6850('0x15')](_0x7f7b63);}return _0x1387b8[_0x6850('0x16')](_0x7f7b63)[_0x6850('0x17')]();};}function respondWithResult(_0x774bc5,_0x14c027){_0x14c027=_0x14c027||0xc8;return function(_0x32e451){if(_0x32e451){return _0x774bc5['status'](_0x14c027)[_0x6850('0x18')](_0x32e451);}};}function respondWithFilteredResult(_0x4a115a,_0x9bca4b){return function(_0x1d66d3){if(_0x1d66d3){var _0xbb82eb=typeof _0x9bca4b[_0x6850('0x19')]===_0x6850('0x1a')&&typeof _0x9bca4b[_0x6850('0x1b')]===_0x6850('0x1a');var _0x36c63c=_0x1d66d3[_0x6850('0x1c')];var _0x441f79=_0xbb82eb?0x0:_0x9bca4b[_0x6850('0x19')];var _0x145dbb=_0xbb82eb?_0x1d66d3[_0x6850('0x1c')]:_0x9bca4b[_0x6850('0x19')]+_0x9bca4b['limit'];var _0x4885f6;if(_0x145dbb>=_0x36c63c){_0x145dbb=_0x36c63c;_0x4885f6=0xc8;}else{_0x4885f6=0xce;}_0x4a115a[_0x6850('0x16')](_0x4885f6);return _0x4a115a[_0x6850('0x1d')](_0x6850('0x1e'),_0x441f79+'-'+_0x145dbb+'/'+_0x36c63c)[_0x6850('0x18')](_0x1d66d3);}return null;};}function patchUpdates(_0x12a15d){return function(_0x35f5ad){try{jsonpatch['apply'](_0x35f5ad,_0x12a15d,!![]);}catch(_0x1e6e90){return BPromise[_0x6850('0x1f')](_0x1e6e90);}return _0x35f5ad[_0x6850('0x20')]();};}function saveUpdates(_0x40f659,_0x2978a1){return function(_0x173537){if(_0x173537){return _0x173537[_0x6850('0x21')](_0x40f659)[_0x6850('0x22')](function(_0x34c5f6){return _0x34c5f6;});}return null;};}function removeEntity(_0x33d2e9,_0x1b4fbb){return function(_0x15ab81){if(_0x15ab81){return _0x15ab81[_0x6850('0x23')]()[_0x6850('0x22')](function(){_0x33d2e9[_0x6850('0x16')](0xcc)[_0x6850('0x17')]();});}};}function handleEntityNotFound(_0x574bdd,_0xaa3dba){return function(_0x5734ea){if(!_0x5734ea){_0x574bdd['sendStatus'](0x194);}return _0x5734ea;};}function handleError(_0x14b91b,_0xf7ce3d){_0xf7ce3d=_0xf7ce3d||0x1f4;return function(_0x423799){logger[_0x6850('0x24')](_0x423799['stack']);if(_0x423799[_0x6850('0x25')]){delete _0x423799[_0x6850('0x25')];}_0x14b91b['status'](_0xf7ce3d)[_0x6850('0x26')](_0x423799);};}exports[_0x6850('0x27')]=function(_0xb87a68,_0x97f08f){var _0x5428d1={},_0x2230ca={},_0x90b5c6={'count':0x0,'rows':[]};var _0x51cd4c=_['map'](db[_0x6850('0x28')][_0x6850('0x29')],function(_0x5d25a5){return{'name':_0x5d25a5[_0x6850('0x2a')],'type':_0x5d25a5[_0x6850('0x2b')][_0x6850('0x2c')]};});_0x2230ca[_0x6850('0x2d')]=_[_0x6850('0x2e')](_0x51cd4c,_0x6850('0x25'));_0x2230ca[_0x6850('0x2f')]=_[_0x6850('0x30')](_0xb87a68['query']);_0x2230ca['filters']=_[_0x6850('0x31')](_0x2230ca[_0x6850('0x2d')],_0x2230ca[_0x6850('0x2f')]);_0x5428d1[_0x6850('0x32')]=_[_0x6850('0x31')](_0x2230ca[_0x6850('0x2d')],qs[_0x6850('0x33')](_0xb87a68['query'][_0x6850('0x33')]));_0x5428d1[_0x6850('0x32')]=_0x5428d1[_0x6850('0x32')][_0x6850('0x34')]?_0x5428d1[_0x6850('0x32')]:_0x2230ca[_0x6850('0x2d')];if(!_0xb87a68[_0x6850('0x2f')][_0x6850('0x35')]('nolimit')){_0x5428d1[_0x6850('0x1b')]=qs[_0x6850('0x1b')](_0xb87a68[_0x6850('0x2f')]['limit']);_0x5428d1[_0x6850('0x19')]=qs['offset'](_0xb87a68[_0x6850('0x2f')][_0x6850('0x19')]);}_0x5428d1['order']=qs[_0x6850('0x36')](_0xb87a68[_0x6850('0x2f')][_0x6850('0x36')]);_0x5428d1['where']=qs['filters'](_[_0x6850('0x37')](_0xb87a68[_0x6850('0x2f')],_0x2230ca[_0x6850('0x38')]),_0x51cd4c);if(_0xb87a68['query'][_0x6850('0x39')]){_0x5428d1['where']=_[_0x6850('0x3a')](_0x5428d1['where'],{'$or':_[_0x6850('0x2e')](_0x51cd4c,function(_0x1726eb){if(_0x1726eb[_0x6850('0x2b')]!==_0x6850('0x3b')){var _0x2ab4c9={};_0x2ab4c9[_0x1726eb['name']]={'$like':'%'+_0xb87a68[_0x6850('0x2f')][_0x6850('0x39')]+'%'};return _0x2ab4c9;}})});}_0x5428d1=_['merge']({},_0x5428d1,_0xb87a68['options']);var _0x52b89f={'where':_0x5428d1['where']};return db[_0x6850('0x28')]['count'](_0x52b89f)[_0x6850('0x22')](function(_0x5eea15){_0x90b5c6[_0x6850('0x1c')]=_0x5eea15;if(_0xb87a68[_0x6850('0x2f')][_0x6850('0x3c')]){_0x5428d1['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x5428d1);})[_0x6850('0x22')](function(_0x1cdc6b){_0x90b5c6[_0x6850('0x3d')]=_0x1cdc6b;return _0x90b5c6;})[_0x6850('0x22')](respondWithFilteredResult(_0x97f08f,_0x5428d1))[_0x6850('0x3e')](handleError(_0x97f08f,null));};exports[_0x6850('0x3f')]=function(_0x1884fc,_0x37898a){var _0x560c56={'raw':!![],'where':{'id':_0x1884fc[_0x6850('0x40')]['id']}},_0x275332={};_0x275332[_0x6850('0x2d')]=_[_0x6850('0x30')](db[_0x6850('0x28')][_0x6850('0x29')]);_0x275332[_0x6850('0x2f')]=_[_0x6850('0x30')](_0x1884fc[_0x6850('0x2f')]);_0x275332['filters']=_[_0x6850('0x31')](_0x275332['model'],_0x275332[_0x6850('0x2f')]);_0x560c56[_0x6850('0x32')]=_[_0x6850('0x31')](_0x275332[_0x6850('0x2d')],qs[_0x6850('0x33')](_0x1884fc[_0x6850('0x2f')][_0x6850('0x33')]));_0x560c56['attributes']=_0x560c56[_0x6850('0x32')][_0x6850('0x34')]?_0x560c56[_0x6850('0x32')]:_0x275332['model'];if(_0x1884fc[_0x6850('0x2f')][_0x6850('0x3c')]){_0x560c56['include']=[{'all':!![]}];}_0x560c56=_['merge']({},_0x560c56,_0x1884fc[_0x6850('0x41')]);return db[_0x6850('0x28')][_0x6850('0x42')](_0x560c56)[_0x6850('0x22')](handleEntityNotFound(_0x37898a,null))['then'](respondWithResult(_0x37898a,null))[_0x6850('0x3e')](handleError(_0x37898a,null));};exports[_0x6850('0x43')]=function(_0x30d44b,_0x496b32){return db[_0x6850('0x28')][_0x6850('0x43')](_0x30d44b[_0x6850('0x44')],{})[_0x6850('0x22')](respondWithResult(_0x496b32,0xc9))['catch'](handleError(_0x496b32,null));};exports[_0x6850('0x21')]=function(_0x731f68,_0x4a3073){if(_0x731f68['body']['id']){delete _0x731f68[_0x6850('0x44')]['id'];}return db['DeskField'][_0x6850('0x42')]({'where':{'id':_0x731f68['params']['id']}})[_0x6850('0x22')](handleEntityNotFound(_0x4a3073,null))[_0x6850('0x22')](saveUpdates(_0x731f68[_0x6850('0x44')],null))[_0x6850('0x22')](respondWithResult(_0x4a3073,null))['catch'](handleError(_0x4a3073,null));};exports[_0x6850('0x23')]=function(_0x2506b0,_0x3533b8){return db[_0x6850('0x28')][_0x6850('0x42')]({'where':{'id':_0x2506b0[_0x6850('0x40')]['id']}})[_0x6850('0x22')](handleEntityNotFound(_0x3533b8,null))['then'](removeEntity(_0x3533b8,null))[_0x6850('0x3e')](handleError(_0x3533b8,null));}; \ No newline at end of file +var _0xd76a=['rawAttributes','fieldName','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','DeskField'];(function(_0x11c773,_0x1d54f8){var _0x43b443=function(_0x50df4b){while(--_0x50df4b){_0x11c773['push'](_0x11c773['shift']());}};_0x43b443(++_0x1d54f8);}(_0xd76a,0x105));var _0xad76=function(_0x4af6e0,_0xa98768){_0x4af6e0=_0x4af6e0-0x0;var _0x58d88f=_0xd76a[_0x4af6e0];return _0x58d88f;};'use strict';var emlformat=require(_0xad76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad76('0x1'));var jsonpatch=require(_0xad76('0x2'));var rp=require(_0xad76('0x3'));var moment=require(_0xad76('0x4'));var BPromise=require(_0xad76('0x5'));var Mustache=require('mustache');var util=require(_0xad76('0x6'));var path=require(_0xad76('0x7'));var sox=require(_0xad76('0x8'));var csv=require(_0xad76('0x9'));var ejs=require(_0xad76('0xa'));var fs=require('fs');var fs_extra=require(_0xad76('0xb'));var _=require(_0xad76('0xc'));var squel=require(_0xad76('0xd'));var crypto=require(_0xad76('0xe'));var jsforce=require(_0xad76('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xad76('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad76('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xad76('0x12'));var hardwareService=require(_0xad76('0x13'));var logger=require('../../config/logger')(_0xad76('0x14'));var utils=require('../../config/utils');var config=require(_0xad76('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad76('0x16'))['db'];function respondWithStatusCode(_0x5179b5,_0x28b200){_0x28b200=_0x28b200||0xcc;return function(_0x1e699){if(_0x1e699){return _0x5179b5['sendStatus'](_0x28b200);}return _0x5179b5[_0xad76('0x17')](_0x28b200)[_0xad76('0x18')]();};}function respondWithResult(_0x5a7b73,_0x12b9c8){_0x12b9c8=_0x12b9c8||0xc8;return function(_0x3b9f5a){if(_0x3b9f5a){return _0x5a7b73['status'](_0x12b9c8)[_0xad76('0x19')](_0x3b9f5a);}};}function respondWithFilteredResult(_0x57f213,_0x3f6795){return function(_0x451ceb){if(_0x451ceb){var _0x201acb=typeof _0x3f6795['offset']===_0xad76('0x1a')&&typeof _0x3f6795['limit']==='undefined';var _0x4fe63c=_0x451ceb[_0xad76('0x1b')];var _0x1368aa=_0x201acb?0x0:_0x3f6795[_0xad76('0x1c')];var _0x41ffa8=_0x201acb?_0x451ceb['count']:_0x3f6795[_0xad76('0x1c')]+_0x3f6795['limit'];var _0x120ca8;if(_0x41ffa8>=_0x4fe63c){_0x41ffa8=_0x4fe63c;_0x120ca8=0xc8;}else{_0x120ca8=0xce;}_0x57f213[_0xad76('0x17')](_0x120ca8);return _0x57f213[_0xad76('0x1d')](_0xad76('0x1e'),_0x1368aa+'-'+_0x41ffa8+'/'+_0x4fe63c)[_0xad76('0x19')](_0x451ceb);}return null;};}function patchUpdates(_0x3e5c80){return function(_0x5ac0d7){try{jsonpatch[_0xad76('0x1f')](_0x5ac0d7,_0x3e5c80,!![]);}catch(_0x5b4b6f){return BPromise['reject'](_0x5b4b6f);}return _0x5ac0d7[_0xad76('0x20')]();};}function saveUpdates(_0x4b9c75,_0x1f3a9d){return function(_0x1b1de8){if(_0x1b1de8){return _0x1b1de8[_0xad76('0x21')](_0x4b9c75)[_0xad76('0x22')](function(_0x14bf5c){return _0x14bf5c;});}return null;};}function removeEntity(_0x4e8b5c,_0x3696cf){return function(_0x17acf3){if(_0x17acf3){return _0x17acf3[_0xad76('0x23')]()[_0xad76('0x22')](function(){_0x4e8b5c[_0xad76('0x17')](0xcc)[_0xad76('0x18')]();});}};}function handleEntityNotFound(_0x3af2cd,_0x58bda1){return function(_0x1afead){if(!_0x1afead){_0x3af2cd['sendStatus'](0x194);}return _0x1afead;};}function handleError(_0x422eec,_0x2eaea3){_0x2eaea3=_0x2eaea3||0x1f4;return function(_0x4dbc52){logger[_0xad76('0x24')](_0x4dbc52[_0xad76('0x25')]);if(_0x4dbc52[_0xad76('0x26')]){delete _0x4dbc52[_0xad76('0x26')];}_0x422eec['status'](_0x2eaea3)[_0xad76('0x27')](_0x4dbc52);};}exports[_0xad76('0x28')]=function(_0xf61132,_0x49c564){var _0x5de1ae={},_0x4188f8={},_0x5977da={'count':0x0,'rows':[]};var _0x2cc7bc=_[_0xad76('0x29')](db[_0xad76('0x2a')][_0xad76('0x2b')],function(_0x459af3){return{'name':_0x459af3[_0xad76('0x2c')],'type':_0x459af3['type'][_0xad76('0x2d')]};});_0x4188f8[_0xad76('0x2e')]=_[_0xad76('0x29')](_0x2cc7bc,'name');_0x4188f8['query']=_['keys'](_0xf61132['query']);_0x4188f8['filters']=_[_0xad76('0x2f')](_0x4188f8[_0xad76('0x2e')],_0x4188f8[_0xad76('0x30')]);_0x5de1ae[_0xad76('0x31')]=_[_0xad76('0x2f')](_0x4188f8['model'],qs[_0xad76('0x32')](_0xf61132['query']['fields']));_0x5de1ae['attributes']=_0x5de1ae[_0xad76('0x31')][_0xad76('0x33')]?_0x5de1ae[_0xad76('0x31')]:_0x4188f8['model'];if(!_0xf61132[_0xad76('0x30')][_0xad76('0x34')](_0xad76('0x35'))){_0x5de1ae[_0xad76('0x36')]=qs[_0xad76('0x36')](_0xf61132[_0xad76('0x30')][_0xad76('0x36')]);_0x5de1ae['offset']=qs[_0xad76('0x1c')](_0xf61132[_0xad76('0x30')]['offset']);}_0x5de1ae[_0xad76('0x37')]=qs[_0xad76('0x38')](_0xf61132['query'][_0xad76('0x38')]);_0x5de1ae[_0xad76('0x39')]=qs['filters'](_[_0xad76('0x3a')](_0xf61132[_0xad76('0x30')],_0x4188f8[_0xad76('0x3b')]),_0x2cc7bc);if(_0xf61132[_0xad76('0x30')][_0xad76('0x3c')]){_0x5de1ae[_0xad76('0x39')]=_[_0xad76('0x3d')](_0x5de1ae[_0xad76('0x39')],{'$or':_['map'](_0x2cc7bc,function(_0x4a9521){if(_0x4a9521[_0xad76('0x3e')]!==_0xad76('0x3f')){var _0x5c86d={};_0x5c86d[_0x4a9521[_0xad76('0x26')]]={'$like':'%'+_0xf61132['query'][_0xad76('0x3c')]+'%'};return _0x5c86d;}})});}_0x5de1ae=_[_0xad76('0x3d')]({},_0x5de1ae,_0xf61132[_0xad76('0x40')]);var _0x20579f={'where':_0x5de1ae[_0xad76('0x39')]};return db['DeskField']['count'](_0x20579f)[_0xad76('0x22')](function(_0x4c8f45){_0x5977da[_0xad76('0x1b')]=_0x4c8f45;if(_0xf61132[_0xad76('0x30')][_0xad76('0x41')]){_0x5de1ae[_0xad76('0x42')]=[{'all':!![]}];}return db[_0xad76('0x2a')][_0xad76('0x43')](_0x5de1ae);})[_0xad76('0x22')](function(_0x5aff44){_0x5977da[_0xad76('0x44')]=_0x5aff44;return _0x5977da;})[_0xad76('0x22')](respondWithFilteredResult(_0x49c564,_0x5de1ae))[_0xad76('0x45')](handleError(_0x49c564,null));};exports[_0xad76('0x46')]=function(_0x54d773,_0x2bfc6d){var _0x2b791a={'raw':!![],'where':{'id':_0x54d773[_0xad76('0x47')]['id']}},_0x46a664={};_0x46a664[_0xad76('0x2e')]=_[_0xad76('0x48')](db[_0xad76('0x2a')][_0xad76('0x2b')]);_0x46a664[_0xad76('0x30')]=_['keys'](_0x54d773[_0xad76('0x30')]);_0x46a664['filters']=_[_0xad76('0x2f')](_0x46a664[_0xad76('0x2e')],_0x46a664[_0xad76('0x30')]);_0x2b791a[_0xad76('0x31')]=_[_0xad76('0x2f')](_0x46a664['model'],qs['fields'](_0x54d773[_0xad76('0x30')]['fields']));_0x2b791a['attributes']=_0x2b791a[_0xad76('0x31')][_0xad76('0x33')]?_0x2b791a['attributes']:_0x46a664[_0xad76('0x2e')];if(_0x54d773['query'][_0xad76('0x41')]){_0x2b791a[_0xad76('0x42')]=[{'all':!![]}];}_0x2b791a=_['merge']({},_0x2b791a,_0x54d773[_0xad76('0x40')]);return db[_0xad76('0x2a')][_0xad76('0x49')](_0x2b791a)['then'](handleEntityNotFound(_0x2bfc6d,null))[_0xad76('0x22')](respondWithResult(_0x2bfc6d,null))[_0xad76('0x45')](handleError(_0x2bfc6d,null));};exports['create']=function(_0x29bfbb,_0x3b6b2c){return db[_0xad76('0x2a')][_0xad76('0x4a')](_0x29bfbb[_0xad76('0x4b')],{})['then'](respondWithResult(_0x3b6b2c,0xc9))['catch'](handleError(_0x3b6b2c,null));};exports[_0xad76('0x21')]=function(_0x265764,_0x519836){if(_0x265764['body']['id']){delete _0x265764[_0xad76('0x4b')]['id'];}return db[_0xad76('0x2a')][_0xad76('0x49')]({'where':{'id':_0x265764[_0xad76('0x47')]['id']}})['then'](handleEntityNotFound(_0x519836,null))['then'](saveUpdates(_0x265764['body'],null))[_0xad76('0x22')](respondWithResult(_0x519836,null))['catch'](handleError(_0x519836,null));};exports[_0xad76('0x23')]=function(_0x543f00,_0x11f5fc){return db[_0xad76('0x2a')]['find']({'where':{'id':_0x543f00[_0xad76('0x47')]['id']}})[_0xad76('0x22')](handleEntityNotFound(_0x11f5fc,null))['then'](removeEntity(_0x11f5fc,null))[_0xad76('0x45')](handleError(_0x11f5fc,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 741ef32..9f3867f 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 _0x4b09=['moment','bluebird','path','rimraf','../../config/environment','define','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0xc3322,_0x357cf0){var _0x2657ee=function(_0x4a3a28){while(--_0x4a3a28){_0xc3322['push'](_0xc3322['shift']());}};_0x2657ee(++_0x357cf0);}(_0x4b09,0x19d));var _0x94b0=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x4b09[_0x369151];return _0x4292d5;};'use strict';var _=require('lodash');var util=require(_0x94b0('0x0'));var logger=require(_0x94b0('0x1'))(_0x94b0('0x2'));var moment=require(_0x94b0('0x3'));var BPromise=require(_0x94b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94b0('0x5'));var rimraf=require(_0x94b0('0x6'));var config=require(_0x94b0('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x4a1071,_0x377128){return _0x4a1071[_0x94b0('0x8')]('DeskField',attributes,{'tableName':_0x94b0('0x9'),'paranoid':![],'indexes':[{'name':_0x94b0('0xa'),'fields':[_0x94b0('0xb'),_0x94b0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91c5=['../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x25a52e,_0x260b10){var _0x2ea938=function(_0x55a253){while(--_0x55a253){_0x25a52e['push'](_0x25a52e['shift']());}};_0x2ea938(++_0x260b10);}(_0x91c5,0xa9));var _0x591c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x91c5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x591c('0x0'));var logger=require(_0x591c('0x1'))('api');var moment=require(_0x591c('0x2'));var BPromise=require(_0x591c('0x3'));var rp=require(_0x591c('0x4'));var fs=require('fs');var path=require(_0x591c('0x5'));var rimraf=require(_0x591c('0x6'));var config=require(_0x591c('0x7'));var attributes=require(_0x591c('0x8'));module[_0x591c('0x9')]=function(_0x32d784,_0x55c045){return _0x32d784[_0x591c('0xa')](_0x591c('0xb'),attributes,{'tableName':_0x591c('0xc'),'paranoid':![],'indexes':[{'name':_0x591c('0xd'),'fields':[_0x591c('0xe'),_0x591c('0xf')],'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 4c94866..c84dea1 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 _0x4b0e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x5b335c,_0x2b966a){var _0xd51b20=function(_0x3a29b5){while(--_0x3a29b5){_0x5b335c['push'](_0x5b335c['shift']());}};_0xd51b20(++_0x2b966a);}(_0x4b0e,0x75));var _0xe4b0=function(_0x559d3b,_0x2121c6){_0x559d3b=_0x559d3b-0x0;var _0x494fd6=_0x4b0e[_0x559d3b];return _0x494fd6;};'use strict';var _=require(_0xe4b0('0x0'));var util=require(_0xe4b0('0x1'));var moment=require(_0xe4b0('0x2'));var BPromise=require(_0xe4b0('0x3'));var rs=require(_0xe4b0('0x4'));var fs=require('fs');var Redis=require(_0xe4b0('0x5'));var db=require(_0xe4b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4b0('0x7'))('rpc');var config=require(_0xe4b0('0x8'));var jayson=require(_0xe4b0('0x9'));var client=jayson[_0xe4b0('0xa')][_0xe4b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6778e2,_0x51b7ec,_0xdc5e51){return new BPromise(function(_0x2e1290,_0x29f623){return client[_0xe4b0('0xc')](_0x6778e2,_0xdc5e51)['then'](function(_0x587545){logger[_0xe4b0('0xd')]('DeskField,\x20%s,\x20%s',_0x51b7ec,_0xe4b0('0xe'));logger[_0xe4b0('0xf')](_0xe4b0('0x10'),_0x51b7ec,_0xe4b0('0xe'),JSON[_0xe4b0('0x11')](_0x587545));if(_0x587545[_0xe4b0('0x12')]){if(_0x587545['error'][_0xe4b0('0x13')]===0x1f4){logger[_0xe4b0('0x12')](_0xe4b0('0x14'),_0x51b7ec,_0x587545[_0xe4b0('0x12')]['message']);return _0x29f623(_0x587545[_0xe4b0('0x12')][_0xe4b0('0x15')]);}logger[_0xe4b0('0x12')](_0xe4b0('0x14'),_0x51b7ec,_0x587545['error']['message']);return _0x2e1290(_0x587545[_0xe4b0('0x12')][_0xe4b0('0x15')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x51b7ec,_0xe4b0('0xe'));_0x2e1290(_0x587545[_0xe4b0('0x16')][_0xe4b0('0x15')]);}})[_0xe4b0('0x17')](function(_0x217cc0){logger[_0xe4b0('0x12')]('DeskField,\x20%s,\x20%s',_0x51b7ec,_0x217cc0);_0x29f623(_0x217cc0);});});} \ No newline at end of file +var _0xb1db=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb1db,0x137));var _0xbb1d=function(_0x9acc89,_0x183869){_0x9acc89=_0x9acc89-0x0;var _0x245dfc=_0xb1db[_0x9acc89];return _0x245dfc;};'use strict';var _=require(_0xbb1d('0x0'));var util=require(_0xbb1d('0x1'));var moment=require(_0xbb1d('0x2'));var BPromise=require(_0xbb1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb1d('0x4'));var logger=require(_0xbb1d('0x5'))(_0xbb1d('0x6'));var config=require(_0xbb1d('0x7'));var jayson=require(_0xbb1d('0x8'));var client=jayson[_0xbb1d('0x9')][_0xbb1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xef8b3a,_0x456779,_0x226a9f){return new BPromise(function(_0x4d668f,_0x1f0172){return client[_0xbb1d('0xb')](_0xef8b3a,_0x226a9f)[_0xbb1d('0xc')](function(_0x32ecd1){logger[_0xbb1d('0xd')](_0xbb1d('0xe'),_0x456779,_0xbb1d('0xf'));logger[_0xbb1d('0x10')](_0xbb1d('0x11'),_0x456779,'request\x20sent',JSON[_0xbb1d('0x12')](_0x32ecd1));if(_0x32ecd1[_0xbb1d('0x13')]){if(_0x32ecd1['error'][_0xbb1d('0x14')]===0x1f4){logger['error'](_0xbb1d('0xe'),_0x456779,_0x32ecd1['error'][_0xbb1d('0x15')]);return _0x1f0172(_0x32ecd1[_0xbb1d('0x13')][_0xbb1d('0x15')]);}logger['error'](_0xbb1d('0xe'),_0x456779,_0x32ecd1['error'][_0xbb1d('0x15')]);return _0x4d668f(_0x32ecd1[_0xbb1d('0x13')][_0xbb1d('0x15')]);}else{logger[_0xbb1d('0xd')](_0xbb1d('0xe'),_0x456779,_0xbb1d('0xf'));_0x4d668f(_0x32ecd1[_0xbb1d('0x16')][_0xbb1d('0x15')]);}})['catch'](function(_0x55356e){logger[_0xbb1d('0x13')](_0xbb1d('0xe'),_0x456779,_0x55356e);_0x1f0172(_0x55356e);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 39f9069..b053a8c 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 _0x7e4a=['create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x1f063a,_0x461a79){var _0xa16be9=function(_0x1f3a27){while(--_0x1f3a27){_0x1f063a['push'](_0x1f063a['shift']());}};_0xa16be9(++_0x461a79);}(_0x7e4a,0x119));var _0xa7e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e4a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa7e4('0x0'));var util=require(_0xa7e4('0x1'));var path=require(_0xa7e4('0x2'));var timeout=require(_0xa7e4('0x3'));var express=require(_0xa7e4('0x4'));var router=express[_0xa7e4('0x5')]();var fs_extra=require(_0xa7e4('0x6'));var auth=require(_0xa7e4('0x7'));var interaction=require(_0xa7e4('0x8'));var config=require('../../config/environment');var controller=require(_0xa7e4('0x9'));router[_0xa7e4('0xa')]('/',auth[_0xa7e4('0xb')](),controller[_0xa7e4('0xc')]);router['get'](_0xa7e4('0xd'),auth[_0xa7e4('0xb')](),controller[_0xa7e4('0xe')]);router[_0xa7e4('0xa')](_0xa7e4('0xf'),auth[_0xa7e4('0xb')](),controller[_0xa7e4('0x10')]);router[_0xa7e4('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa7e4('0x11')]);router[_0xa7e4('0x12')]('/',auth['isAuthenticated'](),controller[_0xa7e4('0x13')]);router[_0xa7e4('0x12')](_0xa7e4('0xf'),auth['isAuthenticated'](),controller[_0xa7e4('0x14')]);router['put'](_0xa7e4('0xd'),auth['isAuthenticated'](),controller[_0xa7e4('0x15')]);router[_0xa7e4('0x16')](_0xa7e4('0xd'),auth[_0xa7e4('0xb')](),controller[_0xa7e4('0x17')]);module[_0xa7e4('0x18')]=router; \ No newline at end of file +var _0xe7f0=['/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe7f0,0x1c0));var _0x0e7f=function(_0x3ced90,_0xf1aad1){_0x3ced90=_0x3ced90-0x0;var _0x5b9d75=_0xe7f0[_0x3ced90];return _0x5b9d75;};'use strict';var multer=require('multer');var util=require(_0x0e7f('0x0'));var path=require(_0x0e7f('0x1'));var timeout=require(_0x0e7f('0x2'));var express=require('express');var router=express[_0x0e7f('0x3')]();var fs_extra=require(_0x0e7f('0x4'));var auth=require(_0x0e7f('0x5'));var interaction=require(_0x0e7f('0x6'));var config=require(_0x0e7f('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x0e7f('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e7f('0x9')]);router[_0x0e7f('0x8')](_0x0e7f('0xa'),auth[_0x0e7f('0xb')](),controller[_0x0e7f('0xc')]);router[_0x0e7f('0x8')](_0x0e7f('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x0e7f('0x8')](_0x0e7f('0xe'),auth[_0x0e7f('0xb')](),controller[_0x0e7f('0xf')]);router[_0x0e7f('0x10')]('/',auth[_0x0e7f('0xb')](),controller[_0x0e7f('0x11')]);router[_0x0e7f('0x10')](_0x0e7f('0xd'),auth[_0x0e7f('0xb')](),controller[_0x0e7f('0x12')]);router[_0x0e7f('0x13')](_0x0e7f('0xa'),auth[_0x0e7f('0xb')](),controller['update']);router[_0x0e7f('0x14')](_0x0e7f('0xa'),auth['isAuthenticated'](),controller[_0x0e7f('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 870f9c4..db2785d 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 _0x7cab=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5025fa,_0x585cb9){var _0x2ed447=function(_0x561306){while(--_0x561306){_0x5025fa['push'](_0x5025fa['shift']());}};_0x2ed447(++_0x585cb9);}(_0x7cab,0x91));var _0xb7ca=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7cab[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb7ca('0x0'));module[_0xb7ca('0x1')]={'name':{'type':Sequelize[_0xb7ca('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb7ca('0x2')]},'remoteUri':{'type':Sequelize[_0xb7ca('0x2')]},'tenantId':{'type':Sequelize[_0xb7ca('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xb7ca('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb7ca('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x746f=['sequelize','exports','STRING','BOOLEAN'];(function(_0x59e4e3,_0x430f6c){var _0x54be45=function(_0x3a7bcd){while(--_0x3a7bcd){_0x59e4e3['push'](_0x59e4e3['shift']());}};_0x54be45(++_0x430f6c);}(_0x746f,0x9c));var _0xf746=function(_0x3a2155,_0x18f931){_0x3a2155=_0x3a2155-0x0;var _0x1953fd=_0x746f[_0x3a2155];return _0x1953fd;};'use strict';var Sequelize=require(_0xf746('0x0'));module[_0xf746('0x1')]={'name':{'type':Sequelize[_0xf746('0x2')]},'username':{'type':Sequelize[_0xf746('0x2')]},'password':{'type':Sequelize[_0xf746('0x2')]},'remoteUri':{'type':Sequelize[_0xf746('0x2')]},'tenantId':{'type':Sequelize[_0xf746('0x2')]},'clientId':{'type':Sequelize[_0xf746('0x2')]},'clientSecret':{'type':Sequelize[_0xf746('0x2')]},'serverUrl':{'type':Sequelize[_0xf746('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf746('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf746('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5c8add3..77007f1 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 _0x69a2=['transactioncurrencyidname','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','LogicalName','forEach','lastIndexOf','all','isNil','@odata.type','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','concat','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','set','update','destroy','then','end','stack','name','send','index','map','Dynamics365Account','fieldName','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridyominame','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','slainvokedidname','ticketnumber'];(function(_0x5464ab,_0x329d11){var _0x15432c=function(_0x451994){while(--_0x451994){_0x5464ab['push'](_0x5464ab['shift']());}};_0x15432c(++_0x329d11);}(_0x69a2,0x1a1));var _0x269a=function(_0x32fd83,_0xfb9f50){_0x32fd83=_0x32fd83-0x0;var _0x3437b9=_0x69a2[_0x32fd83];return _0x3437b9;};'use strict';var rp=require(_0x269a('0x0'));var util=require('util');var _=require(_0x269a('0x1'));var qs=require(_0x269a('0x2'));var logger=require(_0x269a('0x3'))(_0x269a('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x269a('0x5'));function respondWithResult(_0x4729eb,_0x2a1630){_0x2a1630=_0x2a1630||0xc8;return function(_0x197550){if(_0x197550){return _0x4729eb[_0x269a('0x6')](_0x2a1630)[_0x269a('0x7')](_0x197550);}};}function respondWithFilteredResult(_0x592a71,_0x26392f){return function(_0x18e871){if(_0x18e871){var _0x3d2d60=typeof _0x26392f[_0x269a('0x8')]===_0x269a('0x9')&&typeof _0x26392f[_0x269a('0xa')]===_0x269a('0x9');var _0x59a5ea=_0x18e871['count'];var _0x5d77af=_0x3d2d60?0x0:_0x26392f['offset'];var _0x530135=_0x3d2d60?_0x18e871['count']:_0x26392f[_0x269a('0x8')]+_0x26392f[_0x269a('0xa')];var _0x49ea26;if(_0x530135>=_0x59a5ea){_0x530135=_0x59a5ea;_0x49ea26=0xc8;}else{_0x49ea26=0xce;}_0x592a71[_0x269a('0x6')](_0x49ea26);return _0x592a71[_0x269a('0xb')]('Content-Range',_0x5d77af+'-'+_0x530135+'/'+_0x59a5ea)[_0x269a('0x7')](_0x18e871);}return null;};}function saveUpdates(_0x2fe4d4){return function(_0x468437){if(_0x468437){return _0x468437[_0x269a('0xc')](_0x2fe4d4)['then'](function(_0x42317b){return _0x42317b;});}return null;};}function removeEntity(_0xe44ffe){return function(_0x3e479e){if(_0x3e479e){return _0x3e479e[_0x269a('0xd')]()[_0x269a('0xe')](function(){_0xe44ffe[_0x269a('0x6')](0xcc)[_0x269a('0xf')]();});}};}function handleEntityNotFound(_0x96c5b2){return function(_0x15e17d){if(!_0x15e17d){_0x96c5b2['sendStatus'](0x194);}return _0x15e17d;};}function handleError(_0x41715d,_0x15804f){_0x15804f=_0x15804f||0x1f4;return function(_0x4f19e3){logger['error'](_0x4f19e3[_0x269a('0x10')]);if(_0x4f19e3[_0x269a('0x11')]){delete _0x4f19e3['name'];}_0x41715d['status'](_0x15804f)[_0x269a('0x12')](_0x4f19e3);};}exports[_0x269a('0x13')]=function(_0x14e7ae,_0x5e9440){var _0x35a598={},_0x4723b0={},_0x59e8e4={'count':0x0,'rows':[]};var _0x5cc0f5=_[_0x269a('0x14')](db[_0x269a('0x15')]['rawAttributes'],function(_0x24ba05){return{'name':_0x24ba05[_0x269a('0x16')],'type':_0x24ba05['type'][_0x269a('0x17')]};});_0x4723b0['model']=_[_0x269a('0x14')](_0x5cc0f5,_0x269a('0x11'));_0x4723b0[_0x269a('0x18')]=_[_0x269a('0x19')](_0x14e7ae['query']);_0x4723b0[_0x269a('0x1a')]=_[_0x269a('0x1b')](_0x4723b0['model'],_0x4723b0['query']);_0x35a598['attributes']=_[_0x269a('0x1b')](_0x4723b0[_0x269a('0x1c')],qs[_0x269a('0x1d')](_0x14e7ae[_0x269a('0x18')]['fields']));_0x35a598['attributes']=_0x35a598['attributes'][_0x269a('0x1e')]?_0x35a598[_0x269a('0x1f')]:_0x4723b0[_0x269a('0x1c')];if(!_0x14e7ae[_0x269a('0x18')][_0x269a('0x20')]('nolimit')){_0x35a598['limit']=qs['limit'](_0x14e7ae[_0x269a('0x18')][_0x269a('0xa')]);_0x35a598[_0x269a('0x8')]=qs[_0x269a('0x8')](_0x14e7ae[_0x269a('0x18')][_0x269a('0x8')]);}_0x35a598[_0x269a('0x21')]=qs['sort'](_0x14e7ae[_0x269a('0x18')][_0x269a('0x22')]);_0x35a598[_0x269a('0x23')]=qs['filters'](_[_0x269a('0x24')](_0x14e7ae['query'],_0x4723b0[_0x269a('0x1a')]),_0x5cc0f5);if(_0x14e7ae[_0x269a('0x18')][_0x269a('0x25')]){_0x35a598[_0x269a('0x23')]=_[_0x269a('0x26')](_0x35a598[_0x269a('0x23')],{'$or':_['map'](_0x5cc0f5,function(_0x41e742){if(_0x41e742[_0x269a('0x27')]!==_0x269a('0x28')){var _0x1bff43={};_0x1bff43[_0x41e742[_0x269a('0x11')]]={'$like':'%'+_0x14e7ae['query'][_0x269a('0x25')]+'%'};return _0x1bff43;}})});}_0x35a598=_[_0x269a('0x26')]({},_0x35a598,_0x14e7ae['options']);var _0x17f215={'where':_0x35a598[_0x269a('0x23')]};return db[_0x269a('0x15')][_0x269a('0x29')](_0x17f215)[_0x269a('0xe')](function(_0x3285a6){_0x59e8e4[_0x269a('0x29')]=_0x3285a6;if(_0x14e7ae[_0x269a('0x18')][_0x269a('0x2a')]){_0x35a598[_0x269a('0x2b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x269a('0x2c')](_0x35a598);})[_0x269a('0xe')](function(_0x3dc914){_0x59e8e4[_0x269a('0x2d')]=_0x3dc914;return _0x59e8e4;})['then'](respondWithFilteredResult(_0x5e9440,_0x35a598))[_0x269a('0x2e')](handleError(_0x5e9440,null));};exports['show']=function(_0x1deb91,_0x2e6781){var _0x3a6c77={'raw':![],'where':{'id':_0x1deb91[_0x269a('0x2f')]['id']}},_0x285742={};_0x285742[_0x269a('0x1c')]=_[_0x269a('0x19')](db[_0x269a('0x15')][_0x269a('0x30')]);_0x285742[_0x269a('0x18')]=_[_0x269a('0x19')](_0x1deb91['query']);_0x285742[_0x269a('0x1a')]=_['intersection'](_0x285742[_0x269a('0x1c')],_0x285742[_0x269a('0x18')]);_0x3a6c77[_0x269a('0x1f')]=_['intersection'](_0x285742[_0x269a('0x1c')],qs[_0x269a('0x1d')](_0x1deb91['query'][_0x269a('0x1d')]));_0x3a6c77['attributes']=_0x3a6c77[_0x269a('0x1f')][_0x269a('0x1e')]?_0x3a6c77['attributes']:_0x285742[_0x269a('0x1c')];if(_0x1deb91['query'][_0x269a('0x2a')]){_0x3a6c77['include']=[{'all':!![]}];}_0x3a6c77=_[_0x269a('0x26')]({},_0x3a6c77,_0x1deb91[_0x269a('0x31')]);return db['Dynamics365Account'][_0x269a('0x32')](_0x3a6c77)[_0x269a('0xe')](handleEntityNotFound(_0x2e6781,null))[_0x269a('0xe')](respondWithResult(_0x2e6781,null))[_0x269a('0x2e')](handleError(_0x2e6781,null));};exports[_0x269a('0x33')]=function(_0x578f90,_0x58b1e9){return db[_0x269a('0x15')][_0x269a('0x33')](_0x578f90[_0x269a('0x34')],{})[_0x269a('0xe')](respondWithResult(_0x58b1e9,0xc9))[_0x269a('0x2e')](handleError(_0x58b1e9,null));};exports[_0x269a('0xc')]=function(_0x21f6a3,_0x2a2a59){if(_0x21f6a3[_0x269a('0x34')]['id']){delete _0x21f6a3['body']['id'];}return db[_0x269a('0x15')]['find']({'where':{'id':_0x21f6a3['params']['id']}})[_0x269a('0xe')](handleEntityNotFound(_0x2a2a59,null))[_0x269a('0xe')](saveUpdates(_0x21f6a3[_0x269a('0x34')],null))['then'](respondWithResult(_0x2a2a59,null))[_0x269a('0x2e')](handleError(_0x2a2a59,null));};exports[_0x269a('0xd')]=function(_0x1ebd4f,_0x4d2d4f){return db['Dynamics365Account']['find']({'where':{'id':_0x1ebd4f[_0x269a('0x2f')]['id']}})[_0x269a('0xe')](handleEntityNotFound(_0x4d2d4f,null))[_0x269a('0xe')](removeEntity(_0x4d2d4f,null))[_0x269a('0x2e')](handleError(_0x4d2d4f,null));};exports[_0x269a('0x35')]=function(_0x3392ab,_0x58545c){var _0x1c0227={};var _0x29beb7={};var _0x2eb9f0;var _0x30f77a;return db[_0x269a('0x15')][_0x269a('0x36')]({'where':{'id':_0x3392ab[_0x269a('0x2f')]['id']}})['then'](handleEntityNotFound(_0x58545c,null))[_0x269a('0xe')](function(_0x724545){if(_0x724545){_0x2eb9f0=_0x724545;_0x29beb7[_0x269a('0x1c')]=_[_0x269a('0x19')](db[_0x269a('0x37')][_0x269a('0x30')]);_0x29beb7[_0x269a('0x18')]=_[_0x269a('0x19')](_0x3392ab[_0x269a('0x18')]);_0x29beb7['filters']=_[_0x269a('0x1b')](_0x29beb7['model'],_0x29beb7[_0x269a('0x18')]);_0x1c0227[_0x269a('0x1f')]=_['intersection'](_0x29beb7['model'],qs['fields'](_0x3392ab[_0x269a('0x18')]['fields']));_0x1c0227['attributes']=_0x1c0227['attributes'][_0x269a('0x1e')]?_0x1c0227[_0x269a('0x1f')]:_0x29beb7[_0x269a('0x1c')];_0x1c0227[_0x269a('0x21')]=qs['sort'](_0x3392ab[_0x269a('0x18')]['sort']);_0x1c0227['where']=qs[_0x269a('0x1a')](_[_0x269a('0x24')](_0x3392ab['query'],_0x29beb7[_0x269a('0x1a')]));if(_0x3392ab['query'][_0x269a('0x25')]){_0x1c0227['where']=_[_0x269a('0x26')](_0x1c0227[_0x269a('0x23')],{'$or':_[_0x269a('0x14')](_0x1c0227['attributes'],function(_0x28c8e8){var _0x5e89f7={};_0x5e89f7[_0x28c8e8]={'$like':'%'+_0x3392ab[_0x269a('0x18')][_0x269a('0x25')]+'%'};return _0x5e89f7;})});}_0x1c0227=_[_0x269a('0x26')]({},_0x1c0227,_0x3392ab[_0x269a('0x31')]);return _0x2eb9f0[_0x269a('0x35')](_0x1c0227);}})[_0x269a('0xe')](function(_0x30dc5b){if(_0x30dc5b){_0x30f77a=_0x30dc5b[_0x269a('0x1e')];if(!_0x3392ab[_0x269a('0x18')]['hasOwnProperty'](_0x269a('0x38'))){_0x1c0227[_0x269a('0xa')]=qs[_0x269a('0xa')](_0x3392ab[_0x269a('0x18')][_0x269a('0xa')]);_0x1c0227['offset']=qs[_0x269a('0x8')](_0x3392ab[_0x269a('0x18')][_0x269a('0x8')]);}return _0x2eb9f0[_0x269a('0x35')](_0x1c0227);}})['then'](function(_0x1c82e7){if(_0x1c82e7){return _0x1c82e7?{'count':_0x30f77a,'rows':_0x1c82e7}:null;}})['then'](respondWithResult(_0x58545c,null))[_0x269a('0x2e')](handleError(_0x58545c,null));};exports['addConfiguration']=function(_0x2ae6fc,_0x567001){if(_0x2ae6fc['body']['id']){delete _0x2ae6fc['body']['id'];}return db[_0x269a('0x15')][_0x269a('0x36')]({'where':{'id':_0x2ae6fc[_0x269a('0x2f')]['id']}})[_0x269a('0xe')](handleEntityNotFound(_0x567001,null))['then'](function(_0x2d2082){if(_0x2d2082){_0x2ae6fc[_0x269a('0x34')][_0x269a('0x39')]=_0x2d2082['id'];_0x2ae6fc[_0x269a('0x34')][_0x269a('0x3a')]=integrations[_0x269a('0x3b')](_0x2ae6fc[_0x269a('0x34')][_0x269a('0x3c')],_0x2ae6fc[_0x269a('0x34')][_0x269a('0x27')]);_0x2ae6fc[_0x269a('0x34')][_0x269a('0x3d')]=integrations['getDescriptions'](_0x2ae6fc[_0x269a('0x34')][_0x269a('0x3c')],_0x2ae6fc[_0x269a('0x34')][_0x269a('0x27')]);return db[_0x269a('0x37')][_0x269a('0x33')](_0x2ae6fc[_0x269a('0x34')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0x269a('0x3e')],'as':_0x269a('0x3d')}]});}return null;})[_0x269a('0xe')](respondWithResult(_0x567001,null))[_0x269a('0x2e')](handleError(_0x567001,null));};function sanitizeRemoteUri(_0x4c2f3d){var _0x4c32fc=_0x4c2f3d[_0x269a('0x3f')](-0x1);if(_0x4c32fc==='/')return _0x4c2f3d[_0x269a('0x40')](0x0,_0x4c2f3d['lastIndexOf'](_0x4c32fc));return _0x4c2f3d;}function getWebApiUrl(_0xf264b6){return util[_0x269a('0x41')](_0x269a('0x42'),_0xf264b6);}exports[_0x269a('0x43')]=function(_0x28f589,_0x584514){var _0x4d6e36=_0x28f589[_0x269a('0x18')][_0x269a('0x44')];var _0xb09b4d=_0x4d6e36===_0x269a('0x45')?_0x269a('0x46'):_0x269a('0x47');var _0x50cf9a='';var _0x5f3a9c='';var _0x1286ef='';var _0x5118ac='';var _0x25a251='';var _0x1ef1ff='';var _0x3ae656='';var _0x881313='';var _0x51f6b1=[_0x269a('0x48'),_0x269a('0x49'),_0x269a('0x4a'),_0x269a('0x4b'),_0x269a('0x4c'),_0x269a('0x4d'),_0x269a('0x4e'),_0x269a('0x4f'),_0x269a('0x50'),'phonecall_activity_parties'];var _0x2da1e2=[_0x269a('0x51'),_0x269a('0x52'),_0x269a('0x53'),_0x269a('0x54'),'contactidname','contactidyominame',_0x269a('0x55'),_0x269a('0x56'),_0x269a('0x57'),_0x269a('0x58'),_0x269a('0x59'),_0x269a('0x5a'),'createdon','createdonbehalfbyname',_0x269a('0x5b'),'customeridname','customeridtype',_0x269a('0x5c'),'emailaddress','entitlementidname',_0x269a('0x5d'),'entityimage_url',_0x269a('0x5e'),_0x269a('0x5f'),_0x269a('0x60'),_0x269a('0x61'),_0x269a('0x62'),_0x269a('0x63'),'kbarticleidname',_0x269a('0x64'),_0x269a('0x65'),_0x269a('0x66'),_0x269a('0x67'),_0x269a('0x68'),'modifiedbyyominame',_0x269a('0x69'),_0x269a('0x6a'),_0x269a('0x6b'),'msdyn_incidenttypename',_0x269a('0x6c'),_0x269a('0x6d'),_0x269a('0x6e'),_0x269a('0x6f'),_0x269a('0x70'),_0x269a('0x71'),_0x269a('0x72'),'parentcaseidname',_0x269a('0x73'),_0x269a('0x74'),'prioritycodename',_0x269a('0x75'),_0x269a('0x76'),_0x269a('0x77'),_0x269a('0x78'),'responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x269a('0x79'),'slaname','socialprofileidname','statecode','statuscode','subjectidname',_0x269a('0x7a'),'timezoneruleversionnumber',_0x269a('0x7b'),'traversedpath',_0x269a('0x7c'),_0x269a('0x7d')];var _0x36c77f=_0x51f6b1['concat'](_0x2da1e2);return db[_0x269a('0x15')][_0x269a('0x36')]({'where':{'id':_0x28f589[_0x269a('0x2f')]['id']},'attributes':['id',_0x269a('0x7e'),'password',_0x269a('0x7f'),_0x269a('0x80'),_0x269a('0x81'),_0x269a('0x82'),_0x269a('0x83')],'include':[{'model':db['CloudProvider'],'as':_0x269a('0x84'),'attributes':['id','data5',_0x269a('0x85')]}]})[_0x269a('0xe')](handleEntityNotFound(_0x584514,null))[_0x269a('0xe')](function(_0x44722f){if(_0x44722f){if(_0x44722f[_0x269a('0x83')]){_0x44722f[_0x269a('0x86')]=_0x44722f[_0x269a('0x84')][_0x269a('0x87')];_0x881313=sanitizeRemoteUri(_0x44722f['CloudProvider'][_0x269a('0x85')]);_0x3ae656=getWebApiUrl(_0x881313);return _0x44722f;}_0x881313=sanitizeRemoteUri(_0x44722f['remoteUri']);_0x3ae656=getWebApiUrl(_0x881313);var _0x383474={'method':_0x269a('0x88'),'uri':_0x269a('0x89')+_0x44722f[_0x269a('0x80')]+_0x269a('0x8a'),'form':{'client_id':_0x44722f[_0x269a('0x81')],'resource':_0x881313,'username':_0x44722f[_0x269a('0x7e')],'password':_0x44722f['password'],'grant_type':_0x269a('0x8b'),'client_secret':_0x44722f[_0x269a('0x82')]},'json':!![]};return rp(_0x383474);}})[_0x269a('0xe')](function(_0x3910c8){_0x1ef1ff=_0x3910c8[_0x269a('0x86')];var _0x320dd0={'method':_0x269a('0x8c'),'uri':encodeURI(_0x3ae656+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0xb09b4d+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x1ef1ff,'If-None-Match':null,'OData-Version':_0x269a('0x8d')},'json':!![]};return rp(_0x320dd0);})['then'](function(_0x3ac517){var _0x222adc=_0x3ac517[_0x269a('0x8e')][0x0];var _0x28b183=_0x222adc[_0x269a('0x8f')];var _0x1a4bf9={'method':_0x269a('0x8c'),'uri':_0x3ae656+'EntityDefinitions('+_0x28b183+_0x269a('0x90'),'headers':{'Authorization':_0x269a('0x91')+_0x1ef1ff,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a4bf9);})[_0x269a('0xe')](function(_0x4cc95a){_0x50cf9a=_0x4cc95a;_0x5f3a9c=_0x50cf9a[_0x269a('0x92')];_0x5f3a9c=_['remove'](_0x5f3a9c,function(_0x4c55cd){return!_0x36c77f['includes'](_0x4c55cd[_0x269a('0x93')]);});var _0x141e0d=[];var _0x5c9a98=[];_0x5f3a9c[_0x269a('0x94')](function(_0x4a9d18){if(_0x4a9d18['@odata.type']){var _0x4e381b=_0x4a9d18['@odata.type']['substring'](_0x4a9d18['@odata.type'][_0x269a('0x95')]('.')+0x1);if(_0x4e381b==='PicklistAttributeMetadata'){_0x141e0d['push'](getSelectList(_0x3ae656,_0x4d6e36,_0x5c9a98,_0x50cf9a[_0x269a('0x8f')],_0x4a9d18[_0x269a('0x8f')],_0x1ef1ff));}}});return Promise[_0x269a('0x96')](_0x141e0d);})[_0x269a('0xe')](function(_0xc99464){_0x1286ef=_0xc99464[0x0];var _0xa5432=[];var _0x1d3926=[];_0x5f3a9c['forEach'](function(_0x46dfbb){if(!_[_0x269a('0x97')](_0x46dfbb[_0x269a('0x98')])){var _0x5e8d8e=_0x46dfbb[_0x269a('0x98')][_0x269a('0x40')](_0x46dfbb[_0x269a('0x98')][_0x269a('0x95')]('.')+0x1);if(_0x5e8d8e===_0x269a('0x99')){_0xa5432[_0x269a('0x9a')](getBooleanList(_0x3ae656,_0x4d6e36,_0x1d3926,_0x50cf9a[_0x269a('0x8f')],_0x46dfbb['MetadataId'],_0x1ef1ff));}}});return Promise['all'](_0xa5432);})[_0x269a('0xe')](function(_0x6544bf){_0x5118ac=_0x6544bf[0x0];var _0x587aa1=[];var _0x4f9aec=[];_0x5f3a9c[_0x269a('0x94')](function(_0x57d906){if(_0x57d906[_0x269a('0x98')]){var _0x21dbdc=_0x57d906[_0x269a('0x98')][_0x269a('0x40')](_0x57d906[_0x269a('0x98')][_0x269a('0x95')]('.')+0x1);if(_0x21dbdc===_0x269a('0x9b')||_0x21dbdc===_0x269a('0x9c')||_0x21dbdc===_0x269a('0x9d')||_0x21dbdc===_0x269a('0x9e')||_0x21dbdc==='MemoAttributeMetadata'||_0x21dbdc===_0x269a('0x9f')||_0x21dbdc===_0x269a('0xa0')||_0x21dbdc==='EntityNameAttributeMetadata'||_0x21dbdc==='StateAttributeMetadata'||_0x21dbdc==='DecimalAttributeMetadata'){_0x587aa1[_0x269a('0x9a')](getInputList(_0x3ae656,_0x4d6e36,_0x21dbdc,_0x4f9aec,_0x50cf9a[_0x269a('0x8f')],_0x57d906['MetadataId'],_0x1ef1ff));}}});return Promise[_0x269a('0x96')](_0x587aa1);})[_0x269a('0xe')](function(_0x114d4c){_0x25a251=_0x114d4c[0x0];var _0x36ecb9=_0x1286ef[_0x269a('0xa1')](_0x5118ac)['concat'](_0x25a251);var _0xcff33c={'count':_0x36ecb9[_0x269a('0x1e')],'rows':_0x36ecb9};return _0xcff33c;})[_0x269a('0xe')](respondWithResult(_0x584514,null))['catch'](function(_0x49ded4){var _0x3954e0=_0x28f589[_0x269a('0x18')][_0x269a('0xa2')]?0x1f4:_0x49ded4[_0x269a('0xa3')]||0x1f4;logger[_0x269a('0xa4')](_0x49ded4[_0x269a('0x10')]);delete _0x49ded4[_0x269a('0x11')];if(_0x3954e0===0x191){_0x3954e0=0x190;}_0x584514[_0x269a('0x6')](_0x3954e0)[_0x269a('0x12')](_0x28f589['query'][_0x269a('0xa2')]?{'message':_0x269a('0xa5'),'statusCode':_0x49ded4[_0x269a('0xa3')]}:_0x49ded4);});};function getSelectList(_0x260776,_0xba2ec2,_0x3f39f8,_0x565866,_0x5a88d9,_0x381da0){var _0x5191a2={'method':_0x269a('0x8c'),'uri':_0x260776+_0x269a('0xa6')+_0x565866+_0x269a('0xa7')+_0x5a88d9+_0x269a('0xa8')+_0x269a('0xa9'),'headers':{'Authorization':_0x269a('0x91')+_0x381da0,'If-None-Match':null,'OData-Version':_0x269a('0x8d')},'json':!![]};return rp(_0x5191a2)[_0x269a('0xe')](function(_0x14ca70){var _0x33cd0f=[];var _0x3768c2=_0x14ca70[_0x269a('0xaa')][_0x269a('0xab')];_0x3768c2[_0x269a('0x94')](function(_0x2aa26e){_0x33cd0f[_0x269a('0x9a')]({'name':_0x2aa26e[_0x269a('0xac')][_0x269a('0xad')][_0x269a('0xac')],'value':String(_0x2aa26e[_0x269a('0xae')])});});var _0x2e8614={'id':_0xba2ec2+'_'+_0x14ca70[_0x269a('0x93')],'name':_0x14ca70[_0x269a('0xaf')][_0x269a('0xad')][_0x269a('0xac')],'custom':![],'options':_0x33cd0f};_0x3f39f8[_0x269a('0x9a')](_0x2e8614);return _0x3f39f8;});}function getBooleanList(_0x4c9d01,_0x137fe3,_0xc85c7e,_0x560584,_0x271936,_0x4363b7){var _0x2992b4={'method':_0x269a('0x8c'),'uri':_0x4c9d01+_0x269a('0xa6')+_0x560584+_0x269a('0xa7')+_0x271936+_0x269a('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x4363b7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2992b4)['then'](function(_0x35e66a){var _0xa6f464=[];_0xa6f464[_0x269a('0x9a')]({'name':_0x35e66a['OptionSet']['TrueOption'][_0x269a('0xac')][_0x269a('0xad')][_0x269a('0xac')],'value':_0x269a('0xb1')},{'name':_0x35e66a[_0x269a('0xaa')][_0x269a('0xb2')][_0x269a('0xac')]['UserLocalizedLabel'][_0x269a('0xac')],'value':'false'});var _0x192722={'id':_0x137fe3+'_'+_0x35e66a[_0x269a('0x93')],'name':_0x35e66a[_0x269a('0xaf')][_0x269a('0xad')][_0x269a('0xac')],'custom':![],'options':_0xa6f464};_0xc85c7e[_0x269a('0x9a')](_0x192722);return _0xc85c7e;});}function getInputList(_0xee4929,_0x33d3e0,_0x500c53,_0x389a09,_0x2001ee,_0x113594,_0x43d30e){var _0x291bfb={'method':_0x269a('0x8c'),'uri':_0xee4929+_0x269a('0xa6')+_0x2001ee+_0x269a('0xa7')+_0x113594+')/Microsoft.Dynamics.CRM.'+_0x500c53+_0x269a('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x43d30e,'If-None-Match':null,'OData-Version':_0x269a('0x8d')},'json':!![]};return rp(_0x291bfb)['then'](function(_0xd988e6){var _0x146553={'id':_0x33d3e0+'_'+_0xd988e6['LogicalName'],'name':_0xd988e6[_0x269a('0xaf')]['UserLocalizedLabel']?_0xd988e6[_0x269a('0xaf')][_0x269a('0xad')][_0x269a('0xac')]:_0xd988e6[_0x269a('0x93')],'custom':![],'options':[]};_0x389a09[_0x269a('0x9a')](_0x146553);return _0x389a09;});} \ No newline at end of file +var _0x6080=['masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','sentimentvalue','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','remoteUri','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','error','Wrong\x20credentials',')/Attributes(','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','json','count','offset','status','update','then','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','params','length','includeAll','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname'];(function(_0x3ff6cd,_0x52189a){var _0x45f9dd=function(_0x449850){while(--_0x449850){_0x3ff6cd['push'](_0x3ff6cd['shift']());}};_0x45f9dd(++_0x52189a);}(_0x6080,0x110));var _0x0608=function(_0x3f569e,_0x1bf307){_0x3f569e=_0x3f569e-0x0;var _0x2b438b=_0x6080[_0x3f569e];return _0x2b438b;};'use strict';var rp=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var _=require(_0x0608('0x2'));var qs=require(_0x0608('0x3'));var logger=require('../../config/logger')(_0x0608('0x4'));var db=require(_0x0608('0x5'))['db'];var integrations=require(_0x0608('0x6'));function respondWithResult(_0x5b128e,_0x186dbc){_0x186dbc=_0x186dbc||0xc8;return function(_0x2052f6){if(_0x2052f6){return _0x5b128e['status'](_0x186dbc)[_0x0608('0x7')](_0x2052f6);}};}function respondWithFilteredResult(_0x27d70d,_0x4f2d66){return function(_0x2c594b){if(_0x2c594b){var _0x1f4bab=typeof _0x4f2d66['offset']==='undefined'&&typeof _0x4f2d66['limit']==='undefined';var _0x535cae=_0x2c594b[_0x0608('0x8')];var _0x560888=_0x1f4bab?0x0:_0x4f2d66['offset'];var _0x240ad0=_0x1f4bab?_0x2c594b[_0x0608('0x8')]:_0x4f2d66[_0x0608('0x9')]+_0x4f2d66['limit'];var _0x2efdb6;if(_0x240ad0>=_0x535cae){_0x240ad0=_0x535cae;_0x2efdb6=0xc8;}else{_0x2efdb6=0xce;}_0x27d70d[_0x0608('0xa')](_0x2efdb6);return _0x27d70d['set']('Content-Range',_0x560888+'-'+_0x240ad0+'/'+_0x535cae)['json'](_0x2c594b);}return null;};}function saveUpdates(_0x26cf8d){return function(_0x5a1683){if(_0x5a1683){return _0x5a1683[_0x0608('0xb')](_0x26cf8d)[_0x0608('0xc')](function(_0x39c4f7){return _0x39c4f7;});}return null;};}function removeEntity(_0x483052){return function(_0x4592e8){if(_0x4592e8){return _0x4592e8['destroy']()[_0x0608('0xc')](function(){_0x483052[_0x0608('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4a6c){return function(_0x2af157){if(!_0x2af157){_0x4d4a6c[_0x0608('0xd')](0x194);}return _0x2af157;};}function handleError(_0x45d402,_0x42d8ae){_0x42d8ae=_0x42d8ae||0x1f4;return function(_0x4e2b85){logger['error'](_0x4e2b85[_0x0608('0xe')]);if(_0x4e2b85['name']){delete _0x4e2b85[_0x0608('0xf')];}_0x45d402[_0x0608('0xa')](_0x42d8ae)[_0x0608('0x10')](_0x4e2b85);};}exports[_0x0608('0x11')]=function(_0x328a9a,_0x3c2118){var _0x23d813={},_0x2de369={},_0x4642ad={'count':0x0,'rows':[]};var _0x373f25=_[_0x0608('0x12')](db[_0x0608('0x13')][_0x0608('0x14')],function(_0x4222e5){return{'name':_0x4222e5[_0x0608('0x15')],'type':_0x4222e5[_0x0608('0x16')][_0x0608('0x17')]};});_0x2de369[_0x0608('0x18')]=_[_0x0608('0x12')](_0x373f25,_0x0608('0xf'));_0x2de369[_0x0608('0x19')]=_[_0x0608('0x1a')](_0x328a9a[_0x0608('0x19')]);_0x2de369[_0x0608('0x1b')]=_['intersection'](_0x2de369[_0x0608('0x18')],_0x2de369[_0x0608('0x19')]);_0x23d813[_0x0608('0x1c')]=_[_0x0608('0x1d')](_0x2de369[_0x0608('0x18')],qs[_0x0608('0x1e')](_0x328a9a['query'][_0x0608('0x1e')]));_0x23d813[_0x0608('0x1c')]=_0x23d813['attributes']['length']?_0x23d813[_0x0608('0x1c')]:_0x2de369[_0x0608('0x18')];if(!_0x328a9a['query'][_0x0608('0x1f')](_0x0608('0x20'))){_0x23d813[_0x0608('0x21')]=qs[_0x0608('0x21')](_0x328a9a[_0x0608('0x19')]['limit']);_0x23d813['offset']=qs[_0x0608('0x9')](_0x328a9a['query'][_0x0608('0x9')]);}_0x23d813[_0x0608('0x22')]=qs[_0x0608('0x23')](_0x328a9a['query'][_0x0608('0x23')]);_0x23d813[_0x0608('0x24')]=qs[_0x0608('0x1b')](_[_0x0608('0x25')](_0x328a9a[_0x0608('0x19')],_0x2de369[_0x0608('0x1b')]),_0x373f25);if(_0x328a9a[_0x0608('0x19')][_0x0608('0x26')]){_0x23d813[_0x0608('0x24')]=_[_0x0608('0x27')](_0x23d813['where'],{'$or':_[_0x0608('0x12')](_0x373f25,function(_0x42be6c){if(_0x42be6c[_0x0608('0x16')]!==_0x0608('0x28')){var _0x2a81a6={};_0x2a81a6[_0x42be6c[_0x0608('0xf')]]={'$like':'%'+_0x328a9a[_0x0608('0x19')][_0x0608('0x26')]+'%'};return _0x2a81a6;}})});}_0x23d813=_['merge']({},_0x23d813,_0x328a9a['options']);var _0x523e0c={'where':_0x23d813[_0x0608('0x24')]};return db['Dynamics365Account'][_0x0608('0x8')](_0x523e0c)[_0x0608('0xc')](function(_0x272596){_0x4642ad[_0x0608('0x8')]=_0x272596;if(_0x328a9a[_0x0608('0x19')]['includeAll']){_0x23d813['include']=[{'all':!![]}];}return db[_0x0608('0x13')][_0x0608('0x29')](_0x23d813);})[_0x0608('0xc')](function(_0x39c711){_0x4642ad[_0x0608('0x2a')]=_0x39c711;return _0x4642ad;})['then'](respondWithFilteredResult(_0x3c2118,_0x23d813))[_0x0608('0x2b')](handleError(_0x3c2118,null));};exports['show']=function(_0x34e514,_0x379f13){var _0xe70023={'raw':![],'where':{'id':_0x34e514[_0x0608('0x2c')]['id']}},_0x543cc1={};_0x543cc1['model']=_[_0x0608('0x1a')](db[_0x0608('0x13')][_0x0608('0x14')]);_0x543cc1['query']=_['keys'](_0x34e514[_0x0608('0x19')]);_0x543cc1[_0x0608('0x1b')]=_[_0x0608('0x1d')](_0x543cc1[_0x0608('0x18')],_0x543cc1[_0x0608('0x19')]);_0xe70023[_0x0608('0x1c')]=_[_0x0608('0x1d')](_0x543cc1[_0x0608('0x18')],qs[_0x0608('0x1e')](_0x34e514[_0x0608('0x19')][_0x0608('0x1e')]));_0xe70023[_0x0608('0x1c')]=_0xe70023[_0x0608('0x1c')][_0x0608('0x2d')]?_0xe70023[_0x0608('0x1c')]:_0x543cc1[_0x0608('0x18')];if(_0x34e514['query'][_0x0608('0x2e')]){_0xe70023['include']=[{'all':!![]}];}_0xe70023=_[_0x0608('0x27')]({},_0xe70023,_0x34e514[_0x0608('0x2f')]);return db[_0x0608('0x13')][_0x0608('0x30')](_0xe70023)['then'](handleEntityNotFound(_0x379f13,null))[_0x0608('0xc')](respondWithResult(_0x379f13,null))[_0x0608('0x2b')](handleError(_0x379f13,null));};exports[_0x0608('0x31')]=function(_0x5b6214,_0x180f97){return db[_0x0608('0x13')]['create'](_0x5b6214[_0x0608('0x32')],{})[_0x0608('0xc')](respondWithResult(_0x180f97,0xc9))['catch'](handleError(_0x180f97,null));};exports[_0x0608('0xb')]=function(_0x139c4f,_0x1ca653){if(_0x139c4f[_0x0608('0x32')]['id']){delete _0x139c4f[_0x0608('0x32')]['id'];}return db['Dynamics365Account'][_0x0608('0x30')]({'where':{'id':_0x139c4f[_0x0608('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1ca653,null))[_0x0608('0xc')](saveUpdates(_0x139c4f['body'],null))[_0x0608('0xc')](respondWithResult(_0x1ca653,null))['catch'](handleError(_0x1ca653,null));};exports['destroy']=function(_0x3167f4,_0x1d7729){return db[_0x0608('0x13')][_0x0608('0x30')]({'where':{'id':_0x3167f4['params']['id']}})[_0x0608('0xc')](handleEntityNotFound(_0x1d7729,null))['then'](removeEntity(_0x1d7729,null))[_0x0608('0x2b')](handleError(_0x1d7729,null));};exports[_0x0608('0x33')]=function(_0x2f0847,_0x5c4c5f){var _0x254cce={};var _0x23c612={};var _0x34d5ef;var _0xd4fcb0;return db[_0x0608('0x13')][_0x0608('0x34')]({'where':{'id':_0x2f0847[_0x0608('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5c4c5f,null))[_0x0608('0xc')](function(_0xceb809){if(_0xceb809){_0x34d5ef=_0xceb809;_0x23c612[_0x0608('0x18')]=_[_0x0608('0x1a')](db[_0x0608('0x35')][_0x0608('0x14')]);_0x23c612[_0x0608('0x19')]=_[_0x0608('0x1a')](_0x2f0847[_0x0608('0x19')]);_0x23c612[_0x0608('0x1b')]=_[_0x0608('0x1d')](_0x23c612[_0x0608('0x18')],_0x23c612['query']);_0x254cce['attributes']=_['intersection'](_0x23c612[_0x0608('0x18')],qs[_0x0608('0x1e')](_0x2f0847['query']['fields']));_0x254cce['attributes']=_0x254cce[_0x0608('0x1c')]['length']?_0x254cce[_0x0608('0x1c')]:_0x23c612[_0x0608('0x18')];_0x254cce[_0x0608('0x22')]=qs['sort'](_0x2f0847[_0x0608('0x19')][_0x0608('0x23')]);_0x254cce[_0x0608('0x24')]=qs[_0x0608('0x1b')](_[_0x0608('0x25')](_0x2f0847[_0x0608('0x19')],_0x23c612[_0x0608('0x1b')]));if(_0x2f0847['query']['filter']){_0x254cce[_0x0608('0x24')]=_[_0x0608('0x27')](_0x254cce['where'],{'$or':_[_0x0608('0x12')](_0x254cce[_0x0608('0x1c')],function(_0x4e282d){var _0xa4d067={};_0xa4d067[_0x4e282d]={'$like':'%'+_0x2f0847['query'][_0x0608('0x26')]+'%'};return _0xa4d067;})});}_0x254cce=_[_0x0608('0x27')]({},_0x254cce,_0x2f0847[_0x0608('0x2f')]);return _0x34d5ef[_0x0608('0x33')](_0x254cce);}})[_0x0608('0xc')](function(_0x16bc79){if(_0x16bc79){_0xd4fcb0=_0x16bc79[_0x0608('0x2d')];if(!_0x2f0847[_0x0608('0x19')][_0x0608('0x1f')](_0x0608('0x20'))){_0x254cce['limit']=qs[_0x0608('0x21')](_0x2f0847[_0x0608('0x19')][_0x0608('0x21')]);_0x254cce[_0x0608('0x9')]=qs[_0x0608('0x9')](_0x2f0847[_0x0608('0x19')]['offset']);}return _0x34d5ef[_0x0608('0x33')](_0x254cce);}})['then'](function(_0x4315ca){if(_0x4315ca){return _0x4315ca?{'count':_0xd4fcb0,'rows':_0x4315ca}:null;}})['then'](respondWithResult(_0x5c4c5f,null))[_0x0608('0x2b')](handleError(_0x5c4c5f,null));};exports[_0x0608('0x36')]=function(_0x534baa,_0x429426){if(_0x534baa[_0x0608('0x32')]['id']){delete _0x534baa[_0x0608('0x32')]['id'];}return db['Dynamics365Account'][_0x0608('0x34')]({'where':{'id':_0x534baa[_0x0608('0x2c')]['id']}})[_0x0608('0xc')](handleEntityNotFound(_0x429426,null))[_0x0608('0xc')](function(_0x1e5dd9){if(_0x1e5dd9){_0x534baa[_0x0608('0x32')][_0x0608('0x37')]=_0x1e5dd9['id'];_0x534baa[_0x0608('0x32')][_0x0608('0x38')]=integrations['getSubjects'](_0x534baa[_0x0608('0x32')]['channel'],_0x534baa[_0x0608('0x32')][_0x0608('0x16')]);_0x534baa[_0x0608('0x32')][_0x0608('0x39')]=integrations[_0x0608('0x3a')](_0x534baa[_0x0608('0x32')]['channel'],_0x534baa[_0x0608('0x32')][_0x0608('0x16')]);return db[_0x0608('0x35')][_0x0608('0x31')](_0x534baa[_0x0608('0x32')],{'include':[{'model':db[_0x0608('0x3b')],'as':'Subjects'},{'model':db[_0x0608('0x3b')],'as':_0x0608('0x39')}]});}return null;})[_0x0608('0xc')](respondWithResult(_0x429426,null))[_0x0608('0x2b')](handleError(_0x429426,null));};function sanitizeRemoteUri(_0x246dc4){var _0x1987ae=_0x246dc4[_0x0608('0x3c')](-0x1);if(_0x1987ae==='/')return _0x246dc4[_0x0608('0x3d')](0x0,_0x246dc4[_0x0608('0x3e')](_0x1987ae));return _0x246dc4;}function getWebApiUrl(_0x5e952e){return util[_0x0608('0x3f')](_0x0608('0x40'),_0x5e952e);}exports[_0x0608('0x41')]=function(_0x1013bb,_0x1acd4d){var _0x220cf1=_0x1013bb[_0x0608('0x19')][_0x0608('0x42')];var _0x26986d=_0x220cf1===_0x0608('0x43')?_0x0608('0x44'):'PhoneCall';var _0x50183d='';var _0x2946d2='';var _0x404443='';var _0x202fb6='';var _0x2a8e7f='';var _0x303e7b='';var _0x2f25cf='';var _0x1af7a2='';var _0x4bb7bc=[_0x0608('0x45'),_0x0608('0x46'),_0x0608('0x47'),_0x0608('0x48'),_0x0608('0x49'),_0x0608('0x4a'),_0x0608('0x4b'),_0x0608('0x4c'),_0x0608('0x4d'),_0x0608('0x4e')];var _0x313682=[_0x0608('0x4f'),_0x0608('0x50'),'actualserviceunits',_0x0608('0x51'),_0x0608('0x52'),_0x0608('0x53'),_0x0608('0x54'),_0x0608('0x55'),'createdbyexternalpartyname',_0x0608('0x56'),_0x0608('0x57'),_0x0608('0x58'),_0x0608('0x59'),_0x0608('0x5a'),_0x0608('0x5b'),_0x0608('0x5c'),'customeridtype','customeridyominame',_0x0608('0x5d'),_0x0608('0x5e'),'entityimage_timestamp','entityimage_url',_0x0608('0x5f'),_0x0608('0x60'),_0x0608('0x61'),_0x0608('0x62'),_0x0608('0x63'),_0x0608('0x64'),_0x0608('0x65'),'lastonholdtime',_0x0608('0x66'),_0x0608('0x67'),_0x0608('0x68'),_0x0608('0x69'),_0x0608('0x6a'),_0x0608('0x6b'),_0x0608('0x6c'),_0x0608('0x6d'),_0x0608('0x6e'),_0x0608('0x6f'),_0x0608('0x70'),_0x0608('0x71'),'overriddencreatedon',_0x0608('0x72'),_0x0608('0x73'),'owneridyominame',_0x0608('0x74'),_0x0608('0x75'),_0x0608('0x76'),_0x0608('0x77'),_0x0608('0x78'),_0x0608('0x79'),_0x0608('0x7a'),'resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame',_0x0608('0x7b'),'slainvokedidname',_0x0608('0x7c'),_0x0608('0x7d'),_0x0608('0x7e'),'statuscode',_0x0608('0x7f'),'ticketnumber',_0x0608('0x80'),_0x0608('0x81'),_0x0608('0x82'),_0x0608('0x83'),_0x0608('0x84')];var _0x55bf49=_0x4bb7bc['concat'](_0x313682);return db[_0x0608('0x13')][_0x0608('0x34')]({'where':{'id':_0x1013bb[_0x0608('0x2c')]['id']},'attributes':['id',_0x0608('0x85'),_0x0608('0x86'),'remoteUri',_0x0608('0x87'),_0x0608('0x88'),_0x0608('0x89'),'modernAuthentication'],'include':[{'model':db[_0x0608('0x8a')],'as':'CloudProvider','attributes':['id',_0x0608('0x8b'),_0x0608('0x8c')]}]})[_0x0608('0xc')](handleEntityNotFound(_0x1acd4d,null))[_0x0608('0xc')](function(_0x4f6242){if(_0x4f6242){if(_0x4f6242[_0x0608('0x8d')]){_0x4f6242[_0x0608('0x8e')]=_0x4f6242[_0x0608('0x8a')][_0x0608('0x8b')];_0x1af7a2=sanitizeRemoteUri(_0x4f6242[_0x0608('0x8a')]['data7']);_0x2f25cf=getWebApiUrl(_0x1af7a2);return _0x4f6242;}_0x1af7a2=sanitizeRemoteUri(_0x4f6242[_0x0608('0x8f')]);_0x2f25cf=getWebApiUrl(_0x1af7a2);var _0x41b11b={'method':_0x0608('0x90'),'uri':_0x0608('0x91')+_0x4f6242[_0x0608('0x87')]+'/oauth2/token','form':{'client_id':_0x4f6242[_0x0608('0x88')],'resource':_0x1af7a2,'username':_0x4f6242['username'],'password':_0x4f6242[_0x0608('0x86')],'grant_type':'password','client_secret':_0x4f6242[_0x0608('0x89')]},'json':!![]};return rp(_0x41b11b);}})[_0x0608('0xc')](function(_0x57ebda){_0x303e7b=_0x57ebda[_0x0608('0x8e')];var _0x31851b={'method':_0x0608('0x92'),'uri':encodeURI(_0x2f25cf+_0x0608('0x93')+_0x26986d+'\x27'),'headers':{'Authorization':_0x0608('0x94')+_0x303e7b,'If-None-Match':null,'OData-Version':_0x0608('0x95')},'json':!![]};return rp(_0x31851b);})['then'](function(_0x5c573b){var _0x4baa8f=_0x5c573b[_0x0608('0x96')][0x0];var _0x50f4a9=_0x4baa8f[_0x0608('0x97')];var _0x5043e8={'method':'GET','uri':_0x2f25cf+_0x0608('0x98')+_0x50f4a9+_0x0608('0x99'),'headers':{'Authorization':_0x0608('0x94')+_0x303e7b,'If-None-Match':null,'OData-Version':_0x0608('0x95')},'json':!![]};return rp(_0x5043e8);})[_0x0608('0xc')](function(_0x4460fa){_0x50183d=_0x4460fa;_0x2946d2=_0x50183d[_0x0608('0x9a')];_0x2946d2=_[_0x0608('0x9b')](_0x2946d2,function(_0x3d4466){return!_0x55bf49['includes'](_0x3d4466[_0x0608('0x9c')]);});var _0xb7bc02=[];var _0x1e1f55=[];_0x2946d2[_0x0608('0x9d')](function(_0x4f96b2){if(_0x4f96b2[_0x0608('0x9e')]){var _0x136e77=_0x4f96b2[_0x0608('0x9e')][_0x0608('0x3d')](_0x4f96b2[_0x0608('0x9e')][_0x0608('0x3e')]('.')+0x1);if(_0x136e77===_0x0608('0x9f')){_0xb7bc02['push'](getSelectList(_0x2f25cf,_0x220cf1,_0x1e1f55,_0x50183d[_0x0608('0x97')],_0x4f96b2[_0x0608('0x97')],_0x303e7b));}}});return Promise[_0x0608('0xa0')](_0xb7bc02);})['then'](function(_0x5289cf){_0x404443=_0x5289cf[0x0];var _0x13ffd3=[];var _0x4b6d93=[];_0x2946d2[_0x0608('0x9d')](function(_0x42865c){if(!_[_0x0608('0xa1')](_0x42865c[_0x0608('0x9e')])){var _0x1de287=_0x42865c[_0x0608('0x9e')][_0x0608('0x3d')](_0x42865c[_0x0608('0x9e')][_0x0608('0x3e')]('.')+0x1);if(_0x1de287==='BooleanAttributeMetadata'){_0x13ffd3[_0x0608('0xa2')](getBooleanList(_0x2f25cf,_0x220cf1,_0x4b6d93,_0x50183d[_0x0608('0x97')],_0x42865c[_0x0608('0x97')],_0x303e7b));}}});return Promise[_0x0608('0xa0')](_0x13ffd3);})[_0x0608('0xc')](function(_0x46c693){_0x202fb6=_0x46c693[0x0];var _0x407604=[];var _0x164f67=[];_0x2946d2[_0x0608('0x9d')](function(_0x3c3523){if(_0x3c3523['@odata.type']){var _0x41ee06=_0x3c3523[_0x0608('0x9e')]['substring'](_0x3c3523[_0x0608('0x9e')][_0x0608('0x3e')]('.')+0x1);if(_0x41ee06===_0x0608('0xa3')||_0x41ee06===_0x0608('0xa4')||_0x41ee06===_0x0608('0xa5')||_0x41ee06===_0x0608('0xa6')||_0x41ee06===_0x0608('0xa7')||_0x41ee06==='DateTimeAttributeMetadata'||_0x41ee06===_0x0608('0xa8')||_0x41ee06==='EntityNameAttributeMetadata'||_0x41ee06==='StateAttributeMetadata'||_0x41ee06===_0x0608('0xa9')){_0x407604[_0x0608('0xa2')](getInputList(_0x2f25cf,_0x220cf1,_0x41ee06,_0x164f67,_0x50183d[_0x0608('0x97')],_0x3c3523[_0x0608('0x97')],_0x303e7b));}}});return Promise['all'](_0x407604);})[_0x0608('0xc')](function(_0x4696f9){_0x2a8e7f=_0x4696f9[0x0];var _0x395e37=_0x404443['concat'](_0x202fb6)[_0x0608('0xaa')](_0x2a8e7f);var _0x29a03c={'count':_0x395e37[_0x0608('0x2d')],'rows':_0x395e37};return _0x29a03c;})['then'](respondWithResult(_0x1acd4d,null))[_0x0608('0x2b')](function(_0x5c4ffe){var _0xc5af28=_0x1013bb[_0x0608('0x19')][_0x0608('0xab')]?0x1f4:_0x5c4ffe[_0x0608('0xac')]||0x1f4;logger[_0x0608('0xad')](_0x5c4ffe[_0x0608('0xe')]);delete _0x5c4ffe['name'];if(_0xc5af28===0x191){_0xc5af28=0x190;}_0x1acd4d[_0x0608('0xa')](_0xc5af28)[_0x0608('0x10')](_0x1013bb['query'][_0x0608('0xab')]?{'message':_0x0608('0xae'),'statusCode':_0x5c4ffe['statusCode']}:_0x5c4ffe);});};function getSelectList(_0x429416,_0x266af1,_0x259fde,_0x3bf746,_0x14cd60,_0x93eecb){var _0x5c6acf={'method':'GET','uri':_0x429416+_0x0608('0x98')+_0x3bf746+_0x0608('0xaf')+_0x14cd60+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x0608('0x94')+_0x93eecb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c6acf)[_0x0608('0xc')](function(_0x4420f7){var _0x5e566a=[];var _0x59f1ce=_0x4420f7[_0x0608('0xb0')][_0x0608('0xb1')];_0x59f1ce[_0x0608('0x9d')](function(_0xa6e181){_0x5e566a[_0x0608('0xa2')]({'name':_0xa6e181[_0x0608('0xb2')][_0x0608('0xb3')][_0x0608('0xb2')],'value':String(_0xa6e181['Value'])});});var _0x26f43f={'id':_0x266af1+'_'+_0x4420f7[_0x0608('0x9c')],'name':_0x4420f7[_0x0608('0xb4')][_0x0608('0xb3')][_0x0608('0xb2')],'custom':![],'options':_0x5e566a};_0x259fde[_0x0608('0xa2')](_0x26f43f);return _0x259fde;});}function getBooleanList(_0x1c8f99,_0x126ff5,_0x39973e,_0x59ec88,_0x574a60,_0x1ecada){var _0x2d4145={'method':'GET','uri':_0x1c8f99+_0x0608('0x98')+_0x59ec88+_0x0608('0xaf')+_0x574a60+_0x0608('0xb5'),'headers':{'Authorization':_0x0608('0x94')+_0x1ecada,'If-None-Match':null,'OData-Version':_0x0608('0x95')},'json':!![]};return rp(_0x2d4145)[_0x0608('0xc')](function(_0x174e0d){var _0x389392=[];_0x389392[_0x0608('0xa2')]({'name':_0x174e0d[_0x0608('0xb0')][_0x0608('0xb6')][_0x0608('0xb2')][_0x0608('0xb3')][_0x0608('0xb2')],'value':_0x0608('0xb7')},{'name':_0x174e0d[_0x0608('0xb0')][_0x0608('0xb8')]['Label'][_0x0608('0xb3')]['Label'],'value':_0x0608('0xb9')});var _0x354ca5={'id':_0x126ff5+'_'+_0x174e0d['LogicalName'],'name':_0x174e0d[_0x0608('0xb4')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x389392};_0x39973e[_0x0608('0xa2')](_0x354ca5);return _0x39973e;});}function getInputList(_0x515f64,_0x2c0123,_0x20967d,_0x489d99,_0x3590b2,_0x40fe49,_0x4a435b){var _0xfa8fb0={'method':_0x0608('0x92'),'uri':_0x515f64+'EntityDefinitions('+_0x3590b2+')/Attributes('+_0x40fe49+_0x0608('0xba')+_0x20967d+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x4a435b,'If-None-Match':null,'OData-Version':_0x0608('0x95')},'json':!![]};return rp(_0xfa8fb0)[_0x0608('0xc')](function(_0x41c889){var _0xd21fba={'id':_0x2c0123+'_'+_0x41c889['LogicalName'],'name':_0x41c889['DisplayName'][_0x0608('0xb3')]?_0x41c889['DisplayName'][_0x0608('0xb3')]['Label']:_0x41c889['LogicalName'],'custom':![],'options':[]};_0x489d99['push'](_0xd21fba);return _0x489d99;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 5e125c2..fa3e0a8 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x1653ac,_0x56746b){var _0x23e8e3=function(_0x3e31b8){while(--_0x3e31b8){_0x1653ac['push'](_0x1653ac['shift']());}};_0x23e8e3(++_0x56746b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xcb91[_0x5d9867];return _0x7d2118;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x471847,_0x6baf9b){var _0x324136=function(_0x61982b){while(--_0x61982b){_0x471847['push'](_0x471847['shift']());}};_0x324136(++_0x6baf9b);}(_0x757a,0xde));var _0xa757=function(_0xc4cfbf,_0x1b0a95){_0xc4cfbf=_0xc4cfbf-0x0;var _0x5b9c21=_0x757a[_0xc4cfbf];return _0x5b9c21;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e2b6c4b..1747b34 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 _0xfb3e=['limit','include','map','model','attributes','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where'];(function(_0x31f248,_0x106057){var _0x6eb532=function(_0x400ab){while(--_0x400ab){_0x31f248['push'](_0x31f248['shift']());}};_0x6eb532(++_0x106057);}(_0xfb3e,0x1f2));var _0xefb3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfb3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xefb3('0x0'));var util=require(_0xefb3('0x1'));var moment=require(_0xefb3('0x2'));var BPromise=require(_0xefb3('0x3'));var rs=require(_0xefb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefb3('0x5'))(_0xefb3('0x6'));var config=require(_0xefb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xefb3('0x8')][_0xefb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5478c5,_0x34a50e,_0x1db331){return new BPromise(function(_0x178780,_0x204737){return client[_0xefb3('0xa')](_0x5478c5,_0x1db331)[_0xefb3('0xb')](function(_0x212026){logger[_0xefb3('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x34a50e,'request\x20sent');logger[_0xefb3('0xd')](_0xefb3('0xe'),_0x34a50e,_0xefb3('0xf'),JSON['stringify'](_0x212026));if(_0x212026[_0xefb3('0x10')]){if(_0x212026[_0xefb3('0x10')][_0xefb3('0x11')]===0x1f4){logger['error'](_0xefb3('0x12'),_0x34a50e,_0x212026[_0xefb3('0x10')][_0xefb3('0x13')]);return _0x204737(_0x212026[_0xefb3('0x10')][_0xefb3('0x13')]);}logger[_0xefb3('0x10')](_0xefb3('0x12'),_0x34a50e,_0x212026[_0xefb3('0x10')][_0xefb3('0x13')]);return _0x178780(_0x212026['error'][_0xefb3('0x13')]);}else{logger[_0xefb3('0xc')](_0xefb3('0x12'),_0x34a50e,_0xefb3('0xf'));_0x178780(_0x212026[_0xefb3('0x14')]['message']);}})[_0xefb3('0x15')](function(_0xb62101){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x34a50e,_0xb62101);_0x204737(_0xb62101);});});}exports[_0xefb3('0x16')]=function(_0x489f6b){var _0x2d8e51=this;return new Promise(function(_0x33fefe,_0x54e8d7){return db[_0xefb3('0x17')][_0xefb3('0x18')]({'raw':_0x489f6b[_0xefb3('0x19')]?_0x489f6b['options']['raw']===undefined?!![]:![]:!![],'where':_0x489f6b[_0xefb3('0x19')]?_0x489f6b[_0xefb3('0x19')][_0xefb3('0x1a')]||null:null,'attributes':_0x489f6b[_0xefb3('0x19')]?_0x489f6b[_0xefb3('0x19')]['attributes']||null:null,'limit':_0x489f6b['options']?_0x489f6b['options'][_0xefb3('0x1b')]||null:null,'include':_0x489f6b[_0xefb3('0x19')]?_0x489f6b[_0xefb3('0x19')][_0xefb3('0x1c')]?_[_0xefb3('0x1d')](_0x489f6b[_0xefb3('0x19')]['include'],function(_0x286b80){return{'model':db[_0x286b80[_0xefb3('0x1e')]],'as':_0x286b80['as'],'attributes':_0x286b80[_0xefb3('0x1f')],'include':_0x286b80[_0xefb3('0x1c')]?_['map'](_0x286b80['include'],function(_0x533109){return{'model':db[_0x533109['model']],'as':_0x533109['as'],'attributes':_0x533109[_0xefb3('0x1f')],'include':_0x533109[_0xefb3('0x1c')]?_['map'](_0x533109[_0xefb3('0x1c')],function(_0x3354ef){return{'model':db[_0x3354ef[_0xefb3('0x1e')]],'as':_0x3354ef['as'],'attributes':_0x3354ef[_0xefb3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xefb3('0xb')](function(_0x28b5cc){logger[_0xefb3('0xc')]('GetDynamics365Account',_0x489f6b);logger['debug']('GetDynamics365Account',_0x489f6b,JSON[_0xefb3('0x20')](_0x28b5cc));_0x33fefe(_0x28b5cc);})['catch'](function(_0x2b82af){logger[_0xefb3('0x10')](_0xefb3('0x16'),_0x2b82af[_0xefb3('0x13')],_0x489f6b);_0x54e8d7(_0x2d8e51[_0xefb3('0x10')](0x1f4,_0x2b82af[_0xefb3('0x13')]));});});};exports[_0xefb3('0x21')]=function(_0x5d2500){var _0xe5e765=this;return new Promise(function(_0x2a488a,_0x4a9bea){return db[_0xefb3('0x17')][_0xefb3('0x22')]({'raw':_0x5d2500[_0xefb3('0x19')]?_0x5d2500[_0xefb3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5d2500[_0xefb3('0x19')]?_0x5d2500[_0xefb3('0x19')][_0xefb3('0x1a')]||null:null,'attributes':_0x5d2500['options']?_0x5d2500[_0xefb3('0x19')][_0xefb3('0x1f')]||null:null,'include':_0x5d2500[_0xefb3('0x19')]?_0x5d2500[_0xefb3('0x19')][_0xefb3('0x1c')]?_[_0xefb3('0x1d')](_0x5d2500[_0xefb3('0x19')][_0xefb3('0x1c')],function(_0x224db6){return{'model':db[_0x224db6['model']],'as':_0x224db6['as'],'attributes':_0x224db6[_0xefb3('0x1f')],'include':_0x224db6[_0xefb3('0x1c')]?_[_0xefb3('0x1d')](_0x224db6[_0xefb3('0x1c')],function(_0x5f21ff){return{'model':db[_0x5f21ff[_0xefb3('0x1e')]],'as':_0x5f21ff['as'],'attributes':_0x5f21ff[_0xefb3('0x1f')],'include':_0x5f21ff[_0xefb3('0x1c')]?_[_0xefb3('0x1d')](_0x5f21ff[_0xefb3('0x1c')],function(_0x28e208){return{'model':db[_0x28e208[_0xefb3('0x1e')]],'as':_0x28e208['as'],'attributes':_0x28e208[_0xefb3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xefb3('0xb')](function(_0x1a1ec6){logger[_0xefb3('0xc')](_0xefb3('0x21'),_0x5d2500);logger[_0xefb3('0xd')](_0xefb3('0x21'),_0x5d2500,JSON[_0xefb3('0x20')](_0x1a1ec6));_0x2a488a(_0x1a1ec6);})[_0xefb3('0x15')](function(_0x4f7bee){logger['error']('ShowDynamics365Account',_0x4f7bee[_0xefb3('0x13')],_0x5d2500);_0x4a9bea(_0xe5e765[_0xefb3('0x10')](0x1f4,_0x4f7bee[_0xefb3('0x13')]));});});}; \ No newline at end of file +var _0x35e0=['limit','map','include','attributes','model','then','ShowDynamics365Account','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw'];(function(_0x4b50de,_0x37fdb8){var _0x59e078=function(_0x1346f1){while(--_0x1346f1){_0x4b50de['push'](_0x4b50de['shift']());}};_0x59e078(++_0x37fdb8);}(_0x35e0,0xf0));var _0x035e=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x35e0[_0x870b62];return _0x2dcb39;};'use strict';var _=require('lodash');var util=require(_0x035e('0x0'));var moment=require(_0x035e('0x1'));var BPromise=require(_0x035e('0x2'));var rs=require(_0x035e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x035e('0x4'))['db'];var utils=require(_0x035e('0x5'));var logger=require(_0x035e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x035e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30a408,_0x19aef5,_0x5a3d6c){return new BPromise(function(_0x419704,_0x281dc8){return client[_0x035e('0x8')](_0x30a408,_0x5a3d6c)['then'](function(_0x1aa078){logger['info'](_0x035e('0x9'),_0x19aef5,_0x035e('0xa'));logger[_0x035e('0xb')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x19aef5,'request\x20sent',JSON[_0x035e('0xc')](_0x1aa078));if(_0x1aa078[_0x035e('0xd')]){if(_0x1aa078[_0x035e('0xd')][_0x035e('0xe')]===0x1f4){logger[_0x035e('0xd')](_0x035e('0x9'),_0x19aef5,_0x1aa078[_0x035e('0xd')][_0x035e('0xf')]);return _0x281dc8(_0x1aa078[_0x035e('0xd')][_0x035e('0xf')]);}logger[_0x035e('0xd')](_0x035e('0x9'),_0x19aef5,_0x1aa078[_0x035e('0xd')][_0x035e('0xf')]);return _0x419704(_0x1aa078[_0x035e('0xd')][_0x035e('0xf')]);}else{logger[_0x035e('0x10')](_0x035e('0x9'),_0x19aef5,_0x035e('0xa'));_0x419704(_0x1aa078[_0x035e('0x11')][_0x035e('0xf')]);}})[_0x035e('0x12')](function(_0xb60f9e){logger[_0x035e('0xd')](_0x035e('0x9'),_0x19aef5,_0xb60f9e);_0x281dc8(_0xb60f9e);});});}exports[_0x035e('0x13')]=function(_0xb0b23f){var _0x56eebe=this;return new Promise(function(_0x895ec6,_0x3f3c9b){return db[_0x035e('0x14')][_0x035e('0x15')]({'raw':_0xb0b23f[_0x035e('0x16')]?_0xb0b23f[_0x035e('0x16')][_0x035e('0x17')]===undefined?!![]:![]:!![],'where':_0xb0b23f[_0x035e('0x16')]?_0xb0b23f[_0x035e('0x16')]['where']||null:null,'attributes':_0xb0b23f[_0x035e('0x16')]?_0xb0b23f[_0x035e('0x16')]['attributes']||null:null,'limit':_0xb0b23f[_0x035e('0x16')]?_0xb0b23f[_0x035e('0x16')][_0x035e('0x18')]||null:null,'include':_0xb0b23f[_0x035e('0x16')]?_0xb0b23f[_0x035e('0x16')]['include']?_[_0x035e('0x19')](_0xb0b23f['options'][_0x035e('0x1a')],function(_0x5558ce){return{'model':db[_0x5558ce['model']],'as':_0x5558ce['as'],'attributes':_0x5558ce[_0x035e('0x1b')],'include':_0x5558ce['include']?_[_0x035e('0x19')](_0x5558ce['include'],function(_0x11aabb){return{'model':db[_0x11aabb[_0x035e('0x1c')]],'as':_0x11aabb['as'],'attributes':_0x11aabb['attributes'],'include':_0x11aabb[_0x035e('0x1a')]?_['map'](_0x11aabb['include'],function(_0x3414f6){return{'model':db[_0x3414f6['model']],'as':_0x3414f6['as'],'attributes':_0x3414f6[_0x035e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x035e('0x1d')](function(_0x56ea7f){logger[_0x035e('0x10')](_0x035e('0x13'),_0xb0b23f);logger[_0x035e('0xb')](_0x035e('0x13'),_0xb0b23f,JSON[_0x035e('0xc')](_0x56ea7f));_0x895ec6(_0x56ea7f);})[_0x035e('0x12')](function(_0x324b52){logger[_0x035e('0xd')]('GetDynamics365Account',_0x324b52[_0x035e('0xf')],_0xb0b23f);_0x3f3c9b(_0x56eebe['error'](0x1f4,_0x324b52[_0x035e('0xf')]));});});};exports[_0x035e('0x1e')]=function(_0x15ad4e){var _0x5cb2e7=this;return new Promise(function(_0x577d66,_0x7624c0){return db[_0x035e('0x14')][_0x035e('0x1f')]({'raw':_0x15ad4e[_0x035e('0x16')]?_0x15ad4e[_0x035e('0x16')][_0x035e('0x17')]===undefined?!![]:![]:!![],'where':_0x15ad4e[_0x035e('0x16')]?_0x15ad4e[_0x035e('0x16')][_0x035e('0x20')]||null:null,'attributes':_0x15ad4e['options']?_0x15ad4e[_0x035e('0x16')][_0x035e('0x1b')]||null:null,'include':_0x15ad4e[_0x035e('0x16')]?_0x15ad4e[_0x035e('0x16')][_0x035e('0x1a')]?_[_0x035e('0x19')](_0x15ad4e['options'][_0x035e('0x1a')],function(_0x5391a8){return{'model':db[_0x5391a8[_0x035e('0x1c')]],'as':_0x5391a8['as'],'attributes':_0x5391a8[_0x035e('0x1b')],'include':_0x5391a8[_0x035e('0x1a')]?_['map'](_0x5391a8[_0x035e('0x1a')],function(_0xcc7095){return{'model':db[_0xcc7095[_0x035e('0x1c')]],'as':_0xcc7095['as'],'attributes':_0xcc7095[_0x035e('0x1b')],'include':_0xcc7095[_0x035e('0x1a')]?_[_0x035e('0x19')](_0xcc7095[_0x035e('0x1a')],function(_0x2c4679){return{'model':db[_0x2c4679[_0x035e('0x1c')]],'as':_0x2c4679['as'],'attributes':_0x2c4679[_0x035e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x035e('0x1d')](function(_0x38e445){logger[_0x035e('0x10')](_0x035e('0x1e'),_0x15ad4e);logger[_0x035e('0xb')](_0x035e('0x1e'),_0x15ad4e,JSON[_0x035e('0xc')](_0x38e445));_0x577d66(_0x38e445);})[_0x035e('0x12')](function(_0x531b39){logger[_0x035e('0xd')](_0x035e('0x1e'),_0x531b39['message'],_0x15ad4e);_0x7624c0(_0x5cb2e7[_0x035e('0xd')](0x1f4,_0x531b39['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 87e3574..d627e65 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 _0xd89b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0xebf561,_0x5b3617){var _0x22f82e=function(_0x7d04b8){while(--_0x7d04b8){_0xebf561['push'](_0xebf561['shift']());}};_0x22f82e(++_0x5b3617);}(_0xd89b,0xca));var _0xbd89=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xd89b[_0x556bb1];return _0x45455f;};'use strict';var multer=require('multer');var util=require(_0xbd89('0x0'));var path=require(_0xbd89('0x1'));var timeout=require(_0xbd89('0x2'));var express=require(_0xbd89('0x3'));var router=express[_0xbd89('0x4')]();var fs_extra=require(_0xbd89('0x5'));var auth=require(_0xbd89('0x6'));var interaction=require(_0xbd89('0x7'));var config=require(_0xbd89('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0xbd89('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbd89('0xa'),auth[_0xbd89('0xb')](),controller[_0xbd89('0xc')]);router[_0xbd89('0x9')](_0xbd89('0xd'),auth[_0xbd89('0xb')](),controller[_0xbd89('0xe')]);router[_0xbd89('0x9')]('/:id/subjects',auth[_0xbd89('0xb')](),controller[_0xbd89('0xf')]);router[_0xbd89('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xbd89('0x10')]);router[_0xbd89('0x11')]('/',auth[_0xbd89('0xb')](),controller[_0xbd89('0x12')]);router[_0xbd89('0x13')]('/:id',auth[_0xbd89('0xb')](),controller[_0xbd89('0x14')]);router[_0xbd89('0x15')](_0xbd89('0xa'),auth[_0xbd89('0xb')](),controller['destroy']);module[_0xbd89('0x16')]=router; \ No newline at end of file +var _0x7292=['getDescriptions','post','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','getSubjects','/:id/descriptions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7292,0x6d));var _0x2729=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x7292[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var path=require(_0x2729('0x2'));var timeout=require(_0x2729('0x3'));var express=require(_0x2729('0x4'));var router=express[_0x2729('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2729('0x6'));var interaction=require(_0x2729('0x7'));var config=require(_0x2729('0x8'));var controller=require(_0x2729('0x9'));router[_0x2729('0xa')]('/',auth['isAuthenticated'](),controller[_0x2729('0xb')]);router[_0x2729('0xa')](_0x2729('0xc'),auth[_0x2729('0xd')](),controller[_0x2729('0xe')]);router[_0x2729('0xa')]('/:id/fields',auth[_0x2729('0xd')](),controller['getFields']);router[_0x2729('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2729('0xf')]);router[_0x2729('0xa')](_0x2729('0x10'),auth[_0x2729('0xd')](),controller[_0x2729('0x11')]);router[_0x2729('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2729('0x13')](_0x2729('0xc'),auth[_0x2729('0xd')](),controller['update']);router['delete'](_0x2729('0xc'),auth[_0x2729('0xd')](),controller[_0x2729('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 975b83b..e862f91 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 _0x4368=['nothing','BOOLEAN','exports','STRING','ENUM','incident','phonecall'];(function(_0x50445d,_0x4e568c){var _0x1bfa93=function(_0x549aff){while(--_0x549aff){_0x50445d['push'](_0x50445d['shift']());}};_0x1bfa93(++_0x4e568c);}(_0x4368,0x6b));var _0x8436=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x4368[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require('sequelize');module[_0x8436('0x0')]={'name':{'type':Sequelize[_0x8436('0x1')]},'description':{'type':Sequelize[_0x8436('0x1')]},'ticketType':{'type':Sequelize[_0x8436('0x2')](_0x8436('0x3'),_0x8436('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x8436('0x2')]('contact',_0x8436('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x8436('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc076=['phonecall','nothing','contact','BOOLEAN','exports','STRING','ENUM','incident'];(function(_0x40292e,_0x2b88ba){var _0x5e2ab3=function(_0x48b29b){while(--_0x48b29b){_0x40292e['push'](_0x40292e['shift']());}};_0x5e2ab3(++_0x2b88ba);}(_0xc076,0x13c));var _0x6c07=function(_0x2a9ff1,_0x21b24a){_0x2a9ff1=_0x2a9ff1-0x0;var _0x318d27=_0xc076[_0x2a9ff1];return _0x318d27;};'use strict';var Sequelize=require('sequelize');module[_0x6c07('0x0')]={'name':{'type':Sequelize[_0x6c07('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6c07('0x2')](_0x6c07('0x3'),_0x6c07('0x4')),'defaultValue':_0x6c07('0x3')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x6c07('0x5')),'defaultValue':_0x6c07('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x6c07('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6c07('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 958d5a1..52b6755 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 _0xfd8e=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','update','body','findOne','getFields','nolimit','getSubjects','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd8e,0x127));var _0xefd8=function(_0x1d1aa8,_0x51f2f9){_0x1d1aa8=_0x1d1aa8-0x0;var _0x1468b5=_0xfd8e[_0x1d1aa8];return _0x1468b5;};'use strict';var emlformat=require(_0xefd8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xefd8('0x1'));var rp=require('request-promise');var moment=require(_0xefd8('0x2'));var BPromise=require(_0xefd8('0x3'));var Mustache=require(_0xefd8('0x4'));var util=require(_0xefd8('0x5'));var path=require('path');var sox=require(_0xefd8('0x6'));var csv=require(_0xefd8('0x7'));var ejs=require(_0xefd8('0x8'));var fs=require('fs');var fs_extra=require(_0xefd8('0x9'));var _=require(_0xefd8('0xa'));var squel=require(_0xefd8('0xb'));var crypto=require('crypto');var jsforce=require(_0xefd8('0xc'));var deskjs=require(_0xefd8('0xd'));var toCsv=require(_0xefd8('0x7'));var querystring=require(_0xefd8('0xe'));var Papa=require('papaparse');var Redis=require(_0xefd8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xefd8('0x10'));var as=require(_0xefd8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefd8('0x12'))('api');var utils=require(_0xefd8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xefd8('0x14'));var db=require(_0xefd8('0x15'))['db'];function respondWithStatusCode(_0x5f1eaa,_0x31f0ba){_0x31f0ba=_0x31f0ba||0xcc;return function(_0x364b97){if(_0x364b97){return _0x5f1eaa['sendStatus'](_0x31f0ba);}return _0x5f1eaa['status'](_0x31f0ba)[_0xefd8('0x16')]();};}function respondWithResult(_0x1834fc,_0x24c091){_0x24c091=_0x24c091||0xc8;return function(_0x2c0350){if(_0x2c0350){return _0x1834fc['status'](_0x24c091)[_0xefd8('0x17')](_0x2c0350);}};}function respondWithFilteredResult(_0x14010b,_0x39eb61){return function(_0xa06894){if(_0xa06894){var _0x4be6e4=typeof _0x39eb61[_0xefd8('0x18')]===_0xefd8('0x19')&&typeof _0x39eb61[_0xefd8('0x1a')]===_0xefd8('0x19');var _0x30180a=_0xa06894[_0xefd8('0x1b')];var _0x1bf84c=_0x4be6e4?0x0:_0x39eb61[_0xefd8('0x18')];var _0x27ae30=_0x4be6e4?_0xa06894[_0xefd8('0x1b')]:_0x39eb61['offset']+_0x39eb61[_0xefd8('0x1a')];var _0x3cc8fd;if(_0x27ae30>=_0x30180a){_0x27ae30=_0x30180a;_0x3cc8fd=0xc8;}else{_0x3cc8fd=0xce;}_0x14010b[_0xefd8('0x1c')](_0x3cc8fd);return _0x14010b['set'](_0xefd8('0x1d'),_0x1bf84c+'-'+_0x27ae30+'/'+_0x30180a)[_0xefd8('0x17')](_0xa06894);}return null;};}function patchUpdates(_0xa6d4ee){return function(_0x41ff59){try{jsonpatch[_0xefd8('0x1e')](_0x41ff59,_0xa6d4ee,!![]);}catch(_0x2d93b5){return BPromise[_0xefd8('0x1f')](_0x2d93b5);}return _0x41ff59[_0xefd8('0x20')]();};}function saveUpdates(_0x554caf,_0x21113d){return function(_0x7b6a5b){if(_0x7b6a5b){return _0x7b6a5b['update'](_0x554caf)[_0xefd8('0x21')](function(_0x52adb2){return _0x52adb2;});}return null;};}function removeEntity(_0x2e093c,_0x521b2d){return function(_0x5931bb){if(_0x5931bb){return _0x5931bb[_0xefd8('0x22')]()['then'](function(){_0x2e093c['status'](0xcc)[_0xefd8('0x16')]();});}};}function handleEntityNotFound(_0xac75a1,_0x2579c6){return function(_0x11282e){if(!_0x11282e){_0xac75a1[_0xefd8('0x23')](0x194);}return _0x11282e;};}function handleError(_0x567291,_0x57674a){_0x57674a=_0x57674a||0x1f4;return function(_0xfec176){logger[_0xefd8('0x24')](_0xfec176[_0xefd8('0x25')]);if(_0xfec176['name']){delete _0xfec176[_0xefd8('0x26')];}_0x567291[_0xefd8('0x1c')](_0x57674a)[_0xefd8('0x27')](_0xfec176);};}exports[_0xefd8('0x28')]=function(_0x337cb6,_0x1f77e6){var _0x894435={},_0x306cc9={},_0x30ac11={'count':0x0,'rows':[]};var _0x2d5b1a=_['map'](db[_0xefd8('0x29')][_0xefd8('0x2a')],function(_0x5a6a95){return{'name':_0x5a6a95[_0xefd8('0x2b')],'type':_0x5a6a95[_0xefd8('0x2c')][_0xefd8('0x2d')]};});_0x306cc9[_0xefd8('0x2e')]=_[_0xefd8('0x2f')](_0x2d5b1a,'name');_0x306cc9[_0xefd8('0x30')]=_[_0xefd8('0x31')](_0x337cb6[_0xefd8('0x30')]);_0x306cc9[_0xefd8('0x32')]=_[_0xefd8('0x33')](_0x306cc9[_0xefd8('0x2e')],_0x306cc9[_0xefd8('0x30')]);_0x894435[_0xefd8('0x34')]=_[_0xefd8('0x33')](_0x306cc9['model'],qs['fields'](_0x337cb6['query'][_0xefd8('0x35')]));_0x894435['attributes']=_0x894435[_0xefd8('0x34')][_0xefd8('0x36')]?_0x894435[_0xefd8('0x34')]:_0x306cc9[_0xefd8('0x2e')];if(!_0x337cb6[_0xefd8('0x30')][_0xefd8('0x37')]('nolimit')){_0x894435[_0xefd8('0x1a')]=qs[_0xefd8('0x1a')](_0x337cb6[_0xefd8('0x30')][_0xefd8('0x1a')]);_0x894435['offset']=qs['offset'](_0x337cb6[_0xefd8('0x30')][_0xefd8('0x18')]);}_0x894435[_0xefd8('0x38')]=qs[_0xefd8('0x39')](_0x337cb6[_0xefd8('0x30')]['sort']);_0x894435['where']=qs['filters'](_[_0xefd8('0x3a')](_0x337cb6['query'],_0x306cc9[_0xefd8('0x32')]),_0x2d5b1a);if(_0x337cb6[_0xefd8('0x30')][_0xefd8('0x3b')]){_0x894435[_0xefd8('0x3c')]=_[_0xefd8('0x3d')](_0x894435['where'],{'$or':_[_0xefd8('0x2f')](_0x2d5b1a,function(_0x200913){if(_0x200913[_0xefd8('0x2c')]!==_0xefd8('0x3e')){var _0x275691={};_0x275691[_0x200913[_0xefd8('0x26')]]={'$like':'%'+_0x337cb6[_0xefd8('0x30')][_0xefd8('0x3b')]+'%'};return _0x275691;}})});}_0x894435=_[_0xefd8('0x3d')]({},_0x894435,_0x337cb6[_0xefd8('0x3f')]);var _0x32e68b={'where':_0x894435['where']};return db[_0xefd8('0x29')][_0xefd8('0x1b')](_0x32e68b)[_0xefd8('0x21')](function(_0x36109b){_0x30ac11['count']=_0x36109b;if(_0x337cb6[_0xefd8('0x30')][_0xefd8('0x40')]){_0x894435[_0xefd8('0x41')]=[{'all':!![]}];}return db[_0xefd8('0x29')][_0xefd8('0x42')](_0x894435);})['then'](function(_0x1e6fac){_0x30ac11['rows']=_0x1e6fac;return _0x30ac11;})[_0xefd8('0x21')](respondWithFilteredResult(_0x1f77e6,_0x894435))[_0xefd8('0x43')](handleError(_0x1f77e6,null));};exports['show']=function(_0x330f9d,_0xa136a8){var _0x276821={'raw':![],'where':{'id':_0x330f9d[_0xefd8('0x44')]['id']}},_0x25b9b8={};_0x25b9b8[_0xefd8('0x2e')]=_[_0xefd8('0x31')](db[_0xefd8('0x29')][_0xefd8('0x2a')]);_0x25b9b8[_0xefd8('0x30')]=_['keys'](_0x330f9d[_0xefd8('0x30')]);_0x25b9b8[_0xefd8('0x32')]=_['intersection'](_0x25b9b8['model'],_0x25b9b8[_0xefd8('0x30')]);_0x276821[_0xefd8('0x34')]=_['intersection'](_0x25b9b8[_0xefd8('0x2e')],qs[_0xefd8('0x35')](_0x330f9d[_0xefd8('0x30')][_0xefd8('0x35')]));_0x276821['attributes']=_0x276821[_0xefd8('0x34')][_0xefd8('0x36')]?_0x276821[_0xefd8('0x34')]:_0x25b9b8[_0xefd8('0x2e')];if(_0x330f9d[_0xefd8('0x30')][_0xefd8('0x40')]){_0x276821['include']=[{'all':!![]}];}_0x276821=_[_0xefd8('0x3d')]({},_0x276821,_0x330f9d[_0xefd8('0x3f')]);return db[_0xefd8('0x29')][_0xefd8('0x45')](_0x276821)[_0xefd8('0x21')](handleEntityNotFound(_0xa136a8,null))[_0xefd8('0x21')](respondWithResult(_0xa136a8,null))[_0xefd8('0x43')](handleError(_0xa136a8,null));};exports['create']=function(_0x4ab3b4,_0x51b766){return db[_0xefd8('0x29')][_0xefd8('0x46')](_0x4ab3b4['body'],{})[_0xefd8('0x21')](respondWithResult(_0x51b766,0xc9))[_0xefd8('0x43')](handleError(_0x51b766,null));};exports[_0xefd8('0x47')]=function(_0x5adb29,_0x2b123c){if(_0x5adb29[_0xefd8('0x48')]['id']){delete _0x5adb29[_0xefd8('0x48')]['id'];}return db[_0xefd8('0x29')][_0xefd8('0x45')]({'where':{'id':_0x5adb29['params']['id']}})[_0xefd8('0x21')](handleEntityNotFound(_0x2b123c,null))['then'](saveUpdates(_0x5adb29[_0xefd8('0x48')],null))[_0xefd8('0x21')](respondWithResult(_0x2b123c,null))[_0xefd8('0x43')](handleError(_0x2b123c,null));};exports[_0xefd8('0x22')]=function(_0x2d2f3c,_0x20c3df){return db[_0xefd8('0x29')][_0xefd8('0x45')]({'where':{'id':_0x2d2f3c[_0xefd8('0x44')]['id']}})['then'](handleEntityNotFound(_0x20c3df,null))[_0xefd8('0x21')](removeEntity(_0x20c3df,null))[_0xefd8('0x43')](handleError(_0x20c3df,null));};exports['getFields']=function(_0x311311,_0x40991a,_0x1a8394){var _0x6ea6e0={};var _0x153d31={};var _0x5d8c94;var _0xf1464b;return db[_0xefd8('0x29')][_0xefd8('0x49')]({'where':{'id':_0x311311[_0xefd8('0x44')]['id']}})['then'](handleEntityNotFound(_0x40991a,null))['then'](function(_0x3bebec){if(_0x3bebec){_0x5d8c94=_0x3bebec;_0x153d31[_0xefd8('0x2e')]=_[_0xefd8('0x31')](db['Dynamics365Field'][_0xefd8('0x2a')]);_0x153d31[_0xefd8('0x30')]=_[_0xefd8('0x31')](_0x311311[_0xefd8('0x30')]);_0x153d31[_0xefd8('0x32')]=_['intersection'](_0x153d31[_0xefd8('0x2e')],_0x153d31[_0xefd8('0x30')]);_0x6ea6e0[_0xefd8('0x34')]=_['intersection'](_0x153d31[_0xefd8('0x2e')],qs[_0xefd8('0x35')](_0x311311[_0xefd8('0x30')][_0xefd8('0x35')]));_0x6ea6e0[_0xefd8('0x34')]=_0x6ea6e0['attributes'][_0xefd8('0x36')]?_0x6ea6e0['attributes']:_0x153d31[_0xefd8('0x2e')];_0x6ea6e0[_0xefd8('0x38')]=qs[_0xefd8('0x39')](_0x311311[_0xefd8('0x30')][_0xefd8('0x39')]);_0x6ea6e0[_0xefd8('0x3c')]=qs[_0xefd8('0x32')](_[_0xefd8('0x3a')](_0x311311['query'],_0x153d31['filters']));if(_0x311311[_0xefd8('0x30')][_0xefd8('0x3b')]){_0x6ea6e0[_0xefd8('0x3c')]=_[_0xefd8('0x3d')](_0x6ea6e0[_0xefd8('0x3c')],{'$or':_[_0xefd8('0x2f')](_0x6ea6e0[_0xefd8('0x34')],function(_0x451189){var _0x3ed8d9={};_0x3ed8d9[_0x451189]={'$like':'%'+_0x311311['query']['filter']+'%'};return _0x3ed8d9;})});}_0x6ea6e0=_[_0xefd8('0x3d')]({},_0x6ea6e0,_0x311311[_0xefd8('0x3f')]);return _0x5d8c94[_0xefd8('0x4a')](_0x6ea6e0);}})[_0xefd8('0x21')](function(_0x36b192){if(_0x36b192){_0xf1464b=_0x36b192[_0xefd8('0x36')];if(!_0x311311[_0xefd8('0x30')][_0xefd8('0x37')](_0xefd8('0x4b'))){_0x6ea6e0['limit']=qs[_0xefd8('0x1a')](_0x311311[_0xefd8('0x30')][_0xefd8('0x1a')]);_0x6ea6e0[_0xefd8('0x18')]=qs[_0xefd8('0x18')](_0x311311[_0xefd8('0x30')][_0xefd8('0x18')]);}return _0x5d8c94[_0xefd8('0x4a')](_0x6ea6e0);}})[_0xefd8('0x21')](function(_0x59d15f){if(_0x59d15f){return _0x59d15f?{'count':_0xf1464b,'rows':_0x59d15f}:null;}})['then'](respondWithResult(_0x40991a,null))[_0xefd8('0x43')](handleError(_0x40991a,null));};exports[_0xefd8('0x4c')]=function(_0x5eb1c9,_0x56698e,_0x3f3da0){var _0x3fa489={};var _0x1f063e={};var _0x5267e1;var _0x30a1ae;return db['Dynamics365Configuration'][_0xefd8('0x49')]({'where':{'id':_0x5eb1c9[_0xefd8('0x44')]['id']}})[_0xefd8('0x21')](handleEntityNotFound(_0x56698e,null))[_0xefd8('0x21')](function(_0x19f235){if(_0x19f235){_0x5267e1=_0x19f235;_0x1f063e[_0xefd8('0x2e')]=_['keys'](db['Dynamics365Field'][_0xefd8('0x2a')]);_0x1f063e[_0xefd8('0x30')]=_[_0xefd8('0x31')](_0x5eb1c9[_0xefd8('0x30')]);_0x1f063e[_0xefd8('0x32')]=_[_0xefd8('0x33')](_0x1f063e[_0xefd8('0x2e')],_0x1f063e[_0xefd8('0x30')]);_0x3fa489[_0xefd8('0x34')]=_[_0xefd8('0x33')](_0x1f063e[_0xefd8('0x2e')],qs[_0xefd8('0x35')](_0x5eb1c9[_0xefd8('0x30')][_0xefd8('0x35')]));_0x3fa489[_0xefd8('0x34')]=_0x3fa489[_0xefd8('0x34')][_0xefd8('0x36')]?_0x3fa489[_0xefd8('0x34')]:_0x1f063e[_0xefd8('0x2e')];_0x3fa489['order']=qs[_0xefd8('0x39')](_0x5eb1c9[_0xefd8('0x30')][_0xefd8('0x39')]);_0x3fa489['where']=qs[_0xefd8('0x32')](_[_0xefd8('0x3a')](_0x5eb1c9[_0xefd8('0x30')],_0x1f063e['filters']));if(_0x5eb1c9['query'][_0xefd8('0x3b')]){_0x3fa489['where']=_[_0xefd8('0x3d')](_0x3fa489[_0xefd8('0x3c')],{'$or':_[_0xefd8('0x2f')](_0x3fa489[_0xefd8('0x34')],function(_0x13d5ff){var _0x26c1b5={};_0x26c1b5[_0x13d5ff]={'$like':'%'+_0x5eb1c9[_0xefd8('0x30')]['filter']+'%'};return _0x26c1b5;})});}_0x3fa489=_[_0xefd8('0x3d')]({},_0x3fa489,_0x5eb1c9[_0xefd8('0x3f')]);return _0x5267e1[_0xefd8('0x4c')](_0x3fa489);}})['then'](function(_0x4c20f7){if(_0x4c20f7){_0x30a1ae=_0x4c20f7[_0xefd8('0x36')];if(!_0x5eb1c9[_0xefd8('0x30')]['hasOwnProperty'](_0xefd8('0x4b'))){_0x3fa489['limit']=qs[_0xefd8('0x1a')](_0x5eb1c9[_0xefd8('0x30')][_0xefd8('0x1a')]);_0x3fa489[_0xefd8('0x18')]=qs[_0xefd8('0x18')](_0x5eb1c9[_0xefd8('0x30')][_0xefd8('0x18')]);}return _0x5267e1[_0xefd8('0x4c')](_0x3fa489);}})['then'](function(_0x5d38f2){if(_0x5d38f2){return _0x5d38f2?{'count':_0x30a1ae,'rows':_0x5d38f2}:null;}})[_0xefd8('0x21')](respondWithResult(_0x56698e,null))[_0xefd8('0x43')](handleError(_0x56698e,null));};exports['getDescriptions']=function(_0x149110,_0x18d9c8,_0x50755a){var _0x11f034={};var _0x3f22bb={};var _0x55069d;var _0x587373;return db[_0xefd8('0x29')][_0xefd8('0x49')]({'where':{'id':_0x149110['params']['id']}})[_0xefd8('0x21')](handleEntityNotFound(_0x18d9c8,null))[_0xefd8('0x21')](function(_0x1bb111){if(_0x1bb111){_0x55069d=_0x1bb111;_0x3f22bb[_0xefd8('0x2e')]=_[_0xefd8('0x31')](db['Dynamics365Field'][_0xefd8('0x2a')]);_0x3f22bb['query']=_[_0xefd8('0x31')](_0x149110[_0xefd8('0x30')]);_0x3f22bb[_0xefd8('0x32')]=_['intersection'](_0x3f22bb[_0xefd8('0x2e')],_0x3f22bb[_0xefd8('0x30')]);_0x11f034[_0xefd8('0x34')]=_[_0xefd8('0x33')](_0x3f22bb[_0xefd8('0x2e')],qs[_0xefd8('0x35')](_0x149110[_0xefd8('0x30')][_0xefd8('0x35')]));_0x11f034['attributes']=_0x11f034[_0xefd8('0x34')][_0xefd8('0x36')]?_0x11f034[_0xefd8('0x34')]:_0x3f22bb['model'];_0x11f034[_0xefd8('0x38')]=qs['sort'](_0x149110['query'][_0xefd8('0x39')]);_0x11f034[_0xefd8('0x3c')]=qs[_0xefd8('0x32')](_[_0xefd8('0x3a')](_0x149110[_0xefd8('0x30')],_0x3f22bb[_0xefd8('0x32')]));if(_0x149110[_0xefd8('0x30')][_0xefd8('0x3b')]){_0x11f034['where']=_[_0xefd8('0x3d')](_0x11f034[_0xefd8('0x3c')],{'$or':_[_0xefd8('0x2f')](_0x11f034[_0xefd8('0x34')],function(_0xc18b89){var _0x4be7ec={};_0x4be7ec[_0xc18b89]={'$like':'%'+_0x149110[_0xefd8('0x30')][_0xefd8('0x3b')]+'%'};return _0x4be7ec;})});}_0x11f034=_[_0xefd8('0x3d')]({},_0x11f034,_0x149110[_0xefd8('0x3f')]);return _0x55069d['getDescriptions'](_0x11f034);}})[_0xefd8('0x21')](function(_0x517851){if(_0x517851){_0x587373=_0x517851[_0xefd8('0x36')];if(!_0x149110[_0xefd8('0x30')][_0xefd8('0x37')](_0xefd8('0x4b'))){_0x11f034[_0xefd8('0x1a')]=qs[_0xefd8('0x1a')](_0x149110[_0xefd8('0x30')]['limit']);_0x11f034['offset']=qs[_0xefd8('0x18')](_0x149110['query'][_0xefd8('0x18')]);}return _0x55069d['getDescriptions'](_0x11f034);}})['then'](function(_0x4e8646){if(_0x4e8646){return _0x4e8646?{'count':_0x587373,'rows':_0x4e8646}:null;}})['then'](respondWithResult(_0x18d9c8,null))['catch'](handleError(_0x18d9c8,null));}; \ No newline at end of file +var _0xc24c=['include','findAll','rows','show','params','find','catch','create','body','destroy','getFields','length','pick','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','set','apply','reject','save','update','then','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xc24c,0x1a0));var _0xcc24=function(_0x5202a9,_0x50409d){_0x5202a9=_0x5202a9-0x0;var _0x3ae62e=_0xc24c[_0x5202a9];return _0x3ae62e;};'use strict';var emlformat=require(_0xcc24('0x0'));var rimraf=require(_0xcc24('0x1'));var zipdir=require(_0xcc24('0x2'));var jsonpatch=require(_0xcc24('0x3'));var rp=require('request-promise');var moment=require(_0xcc24('0x4'));var BPromise=require(_0xcc24('0x5'));var Mustache=require(_0xcc24('0x6'));var util=require('util');var path=require(_0xcc24('0x7'));var sox=require(_0xcc24('0x8'));var csv=require(_0xcc24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc24('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc24('0xb'));var deskjs=require(_0xcc24('0xc'));var toCsv=require(_0xcc24('0x9'));var querystring=require(_0xcc24('0xd'));var Papa=require(_0xcc24('0xe'));var Redis=require(_0xcc24('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcc24('0x10'));var as=require(_0xcc24('0x11'));var hardwareService=require(_0xcc24('0x12'));var logger=require(_0xcc24('0x13'))(_0xcc24('0x14'));var utils=require('../../config/utils');var config=require(_0xcc24('0x15'));var licenseUtil=require(_0xcc24('0x16'));var db=require(_0xcc24('0x17'))['db'];function respondWithStatusCode(_0x574533,_0x208399){_0x208399=_0x208399||0xcc;return function(_0x14d41e){if(_0x14d41e){return _0x574533[_0xcc24('0x18')](_0x208399);}return _0x574533['status'](_0x208399)[_0xcc24('0x19')]();};}function respondWithResult(_0x398355,_0x1132ba){_0x1132ba=_0x1132ba||0xc8;return function(_0x3e5e54){if(_0x3e5e54){return _0x398355[_0xcc24('0x1a')](_0x1132ba)[_0xcc24('0x1b')](_0x3e5e54);}};}function respondWithFilteredResult(_0x2d4536,_0x1c201f){return function(_0x362771){if(_0x362771){var _0x1b5187=typeof _0x1c201f[_0xcc24('0x1c')]==='undefined'&&typeof _0x1c201f[_0xcc24('0x1d')]===_0xcc24('0x1e');var _0x4f9b3f=_0x362771['count'];var _0x1ae4de=_0x1b5187?0x0:_0x1c201f[_0xcc24('0x1c')];var _0x2e598c=_0x1b5187?_0x362771['count']:_0x1c201f[_0xcc24('0x1c')]+_0x1c201f['limit'];var _0x31dd0d;if(_0x2e598c>=_0x4f9b3f){_0x2e598c=_0x4f9b3f;_0x31dd0d=0xc8;}else{_0x31dd0d=0xce;}_0x2d4536[_0xcc24('0x1a')](_0x31dd0d);return _0x2d4536[_0xcc24('0x1f')]('Content-Range',_0x1ae4de+'-'+_0x2e598c+'/'+_0x4f9b3f)[_0xcc24('0x1b')](_0x362771);}return null;};}function patchUpdates(_0x5207a4){return function(_0x493fb1){try{jsonpatch[_0xcc24('0x20')](_0x493fb1,_0x5207a4,!![]);}catch(_0x477ee0){return BPromise[_0xcc24('0x21')](_0x477ee0);}return _0x493fb1[_0xcc24('0x22')]();};}function saveUpdates(_0x4f2936,_0x5334fa){return function(_0x499ac1){if(_0x499ac1){return _0x499ac1[_0xcc24('0x23')](_0x4f2936)[_0xcc24('0x24')](function(_0x39f98a){return _0x39f98a;});}return null;};}function removeEntity(_0x352957,_0x4e4934){return function(_0x36234c){if(_0x36234c){return _0x36234c['destroy']()[_0xcc24('0x24')](function(){_0x352957[_0xcc24('0x1a')](0xcc)[_0xcc24('0x19')]();});}};}function handleEntityNotFound(_0x98ac29,_0xed3915){return function(_0x4f83ba){if(!_0x4f83ba){_0x98ac29[_0xcc24('0x18')](0x194);}return _0x4f83ba;};}function handleError(_0x2b0e61,_0x189d26){_0x189d26=_0x189d26||0x1f4;return function(_0x1a6eea){logger[_0xcc24('0x25')](_0x1a6eea[_0xcc24('0x26')]);if(_0x1a6eea[_0xcc24('0x27')]){delete _0x1a6eea['name'];}_0x2b0e61[_0xcc24('0x1a')](_0x189d26)[_0xcc24('0x28')](_0x1a6eea);};}exports['index']=function(_0x42db85,_0x502c2d){var _0x280160={},_0x4dcff8={},_0x5cb6a2={'count':0x0,'rows':[]};var _0x4bd366=_[_0xcc24('0x29')](db[_0xcc24('0x2a')][_0xcc24('0x2b')],function(_0x5b6db3){return{'name':_0x5b6db3[_0xcc24('0x2c')],'type':_0x5b6db3[_0xcc24('0x2d')]['key']};});_0x4dcff8[_0xcc24('0x2e')]=_[_0xcc24('0x29')](_0x4bd366,_0xcc24('0x27'));_0x4dcff8[_0xcc24('0x2f')]=_[_0xcc24('0x30')](_0x42db85[_0xcc24('0x2f')]);_0x4dcff8[_0xcc24('0x31')]=_['intersection'](_0x4dcff8[_0xcc24('0x2e')],_0x4dcff8[_0xcc24('0x2f')]);_0x280160[_0xcc24('0x32')]=_[_0xcc24('0x33')](_0x4dcff8[_0xcc24('0x2e')],qs[_0xcc24('0x34')](_0x42db85['query']['fields']));_0x280160[_0xcc24('0x32')]=_0x280160[_0xcc24('0x32')]['length']?_0x280160[_0xcc24('0x32')]:_0x4dcff8[_0xcc24('0x2e')];if(!_0x42db85[_0xcc24('0x2f')][_0xcc24('0x35')](_0xcc24('0x36'))){_0x280160[_0xcc24('0x1d')]=qs['limit'](_0x42db85[_0xcc24('0x2f')][_0xcc24('0x1d')]);_0x280160['offset']=qs[_0xcc24('0x1c')](_0x42db85[_0xcc24('0x2f')][_0xcc24('0x1c')]);}_0x280160[_0xcc24('0x37')]=qs[_0xcc24('0x38')](_0x42db85[_0xcc24('0x2f')][_0xcc24('0x38')]);_0x280160[_0xcc24('0x39')]=qs[_0xcc24('0x31')](_['pick'](_0x42db85[_0xcc24('0x2f')],_0x4dcff8['filters']),_0x4bd366);if(_0x42db85[_0xcc24('0x2f')][_0xcc24('0x3a')]){_0x280160[_0xcc24('0x39')]=_[_0xcc24('0x3b')](_0x280160[_0xcc24('0x39')],{'$or':_[_0xcc24('0x29')](_0x4bd366,function(_0x37ba0e){if(_0x37ba0e[_0xcc24('0x2d')]!==_0xcc24('0x3c')){var _0x467812={};_0x467812[_0x37ba0e[_0xcc24('0x27')]]={'$like':'%'+_0x42db85['query'][_0xcc24('0x3a')]+'%'};return _0x467812;}})});}_0x280160=_[_0xcc24('0x3b')]({},_0x280160,_0x42db85[_0xcc24('0x3d')]);var _0x3792fc={'where':_0x280160[_0xcc24('0x39')]};return db[_0xcc24('0x2a')]['count'](_0x3792fc)[_0xcc24('0x24')](function(_0x3a3eef){_0x5cb6a2[_0xcc24('0x3e')]=_0x3a3eef;if(_0x42db85[_0xcc24('0x2f')][_0xcc24('0x3f')]){_0x280160[_0xcc24('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xcc24('0x41')](_0x280160);})[_0xcc24('0x24')](function(_0x4569b2){_0x5cb6a2[_0xcc24('0x42')]=_0x4569b2;return _0x5cb6a2;})['then'](respondWithFilteredResult(_0x502c2d,_0x280160))['catch'](handleError(_0x502c2d,null));};exports[_0xcc24('0x43')]=function(_0x616666,_0x5bfc77){var _0x40ed56={'raw':![],'where':{'id':_0x616666[_0xcc24('0x44')]['id']}},_0x59b8c4={};_0x59b8c4[_0xcc24('0x2e')]=_['keys'](db[_0xcc24('0x2a')][_0xcc24('0x2b')]);_0x59b8c4[_0xcc24('0x2f')]=_[_0xcc24('0x30')](_0x616666[_0xcc24('0x2f')]);_0x59b8c4[_0xcc24('0x31')]=_['intersection'](_0x59b8c4['model'],_0x59b8c4[_0xcc24('0x2f')]);_0x40ed56[_0xcc24('0x32')]=_[_0xcc24('0x33')](_0x59b8c4[_0xcc24('0x2e')],qs[_0xcc24('0x34')](_0x616666[_0xcc24('0x2f')][_0xcc24('0x34')]));_0x40ed56[_0xcc24('0x32')]=_0x40ed56['attributes']['length']?_0x40ed56['attributes']:_0x59b8c4[_0xcc24('0x2e')];if(_0x616666['query']['includeAll']){_0x40ed56[_0xcc24('0x40')]=[{'all':!![]}];}_0x40ed56=_['merge']({},_0x40ed56,_0x616666['options']);return db[_0xcc24('0x2a')][_0xcc24('0x45')](_0x40ed56)['then'](handleEntityNotFound(_0x5bfc77,null))['then'](respondWithResult(_0x5bfc77,null))[_0xcc24('0x46')](handleError(_0x5bfc77,null));};exports[_0xcc24('0x47')]=function(_0x5bde66,_0x5ac620){return db['Dynamics365Configuration']['create'](_0x5bde66['body'],{})[_0xcc24('0x24')](respondWithResult(_0x5ac620,0xc9))[_0xcc24('0x46')](handleError(_0x5ac620,null));};exports[_0xcc24('0x23')]=function(_0x51bf4b,_0x11573b){if(_0x51bf4b['body']['id']){delete _0x51bf4b[_0xcc24('0x48')]['id'];}return db[_0xcc24('0x2a')][_0xcc24('0x45')]({'where':{'id':_0x51bf4b[_0xcc24('0x44')]['id']}})['then'](handleEntityNotFound(_0x11573b,null))['then'](saveUpdates(_0x51bf4b[_0xcc24('0x48')],null))['then'](respondWithResult(_0x11573b,null))[_0xcc24('0x46')](handleError(_0x11573b,null));};exports[_0xcc24('0x49')]=function(_0x4e219e,_0x72aa44){return db['Dynamics365Configuration'][_0xcc24('0x45')]({'where':{'id':_0x4e219e[_0xcc24('0x44')]['id']}})[_0xcc24('0x24')](handleEntityNotFound(_0x72aa44,null))[_0xcc24('0x24')](removeEntity(_0x72aa44,null))[_0xcc24('0x46')](handleError(_0x72aa44,null));};exports[_0xcc24('0x4a')]=function(_0x283266,_0x4e2a87,_0x385021){var _0x4b95b5={};var _0x29ca0c={};var _0x17a30f;var _0x169862;return db[_0xcc24('0x2a')]['findOne']({'where':{'id':_0x283266['params']['id']}})[_0xcc24('0x24')](handleEntityNotFound(_0x4e2a87,null))[_0xcc24('0x24')](function(_0x3d1a1d){if(_0x3d1a1d){_0x17a30f=_0x3d1a1d;_0x29ca0c[_0xcc24('0x2e')]=_[_0xcc24('0x30')](db['Dynamics365Field'][_0xcc24('0x2b')]);_0x29ca0c[_0xcc24('0x2f')]=_[_0xcc24('0x30')](_0x283266[_0xcc24('0x2f')]);_0x29ca0c[_0xcc24('0x31')]=_[_0xcc24('0x33')](_0x29ca0c[_0xcc24('0x2e')],_0x29ca0c[_0xcc24('0x2f')]);_0x4b95b5[_0xcc24('0x32')]=_['intersection'](_0x29ca0c[_0xcc24('0x2e')],qs[_0xcc24('0x34')](_0x283266[_0xcc24('0x2f')][_0xcc24('0x34')]));_0x4b95b5[_0xcc24('0x32')]=_0x4b95b5['attributes'][_0xcc24('0x4b')]?_0x4b95b5[_0xcc24('0x32')]:_0x29ca0c[_0xcc24('0x2e')];_0x4b95b5[_0xcc24('0x37')]=qs[_0xcc24('0x38')](_0x283266['query'][_0xcc24('0x38')]);_0x4b95b5[_0xcc24('0x39')]=qs[_0xcc24('0x31')](_[_0xcc24('0x4c')](_0x283266[_0xcc24('0x2f')],_0x29ca0c[_0xcc24('0x31')]));if(_0x283266['query'][_0xcc24('0x3a')]){_0x4b95b5[_0xcc24('0x39')]=_[_0xcc24('0x3b')](_0x4b95b5['where'],{'$or':_[_0xcc24('0x29')](_0x4b95b5[_0xcc24('0x32')],function(_0x230b92){var _0x756b68={};_0x756b68[_0x230b92]={'$like':'%'+_0x283266['query'][_0xcc24('0x3a')]+'%'};return _0x756b68;})});}_0x4b95b5=_[_0xcc24('0x3b')]({},_0x4b95b5,_0x283266[_0xcc24('0x3d')]);return _0x17a30f[_0xcc24('0x4a')](_0x4b95b5);}})[_0xcc24('0x24')](function(_0x171150){if(_0x171150){_0x169862=_0x171150[_0xcc24('0x4b')];if(!_0x283266[_0xcc24('0x2f')]['hasOwnProperty'](_0xcc24('0x36'))){_0x4b95b5[_0xcc24('0x1d')]=qs[_0xcc24('0x1d')](_0x283266[_0xcc24('0x2f')][_0xcc24('0x1d')]);_0x4b95b5[_0xcc24('0x1c')]=qs[_0xcc24('0x1c')](_0x283266[_0xcc24('0x2f')][_0xcc24('0x1c')]);}return _0x17a30f['getFields'](_0x4b95b5);}})[_0xcc24('0x24')](function(_0x1cf349){if(_0x1cf349){return _0x1cf349?{'count':_0x169862,'rows':_0x1cf349}:null;}})[_0xcc24('0x24')](respondWithResult(_0x4e2a87,null))['catch'](handleError(_0x4e2a87,null));};exports['getSubjects']=function(_0x43d4aa,_0x6387d0,_0x32d415){var _0x19b26f={};var _0x42c687={};var _0x147aef;var _0x5b07a6;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x43d4aa['params']['id']}})[_0xcc24('0x24')](handleEntityNotFound(_0x6387d0,null))['then'](function(_0x4dd2d0){if(_0x4dd2d0){_0x147aef=_0x4dd2d0;_0x42c687[_0xcc24('0x2e')]=_[_0xcc24('0x30')](db[_0xcc24('0x4d')][_0xcc24('0x2b')]);_0x42c687[_0xcc24('0x2f')]=_[_0xcc24('0x30')](_0x43d4aa['query']);_0x42c687[_0xcc24('0x31')]=_['intersection'](_0x42c687[_0xcc24('0x2e')],_0x42c687[_0xcc24('0x2f')]);_0x19b26f['attributes']=_[_0xcc24('0x33')](_0x42c687['model'],qs[_0xcc24('0x34')](_0x43d4aa[_0xcc24('0x2f')][_0xcc24('0x34')]));_0x19b26f[_0xcc24('0x32')]=_0x19b26f['attributes'][_0xcc24('0x4b')]?_0x19b26f[_0xcc24('0x32')]:_0x42c687[_0xcc24('0x2e')];_0x19b26f[_0xcc24('0x37')]=qs['sort'](_0x43d4aa['query']['sort']);_0x19b26f[_0xcc24('0x39')]=qs[_0xcc24('0x31')](_['pick'](_0x43d4aa['query'],_0x42c687['filters']));if(_0x43d4aa[_0xcc24('0x2f')][_0xcc24('0x3a')]){_0x19b26f['where']=_[_0xcc24('0x3b')](_0x19b26f[_0xcc24('0x39')],{'$or':_[_0xcc24('0x29')](_0x19b26f[_0xcc24('0x32')],function(_0x2fefc9){var _0x4c1074={};_0x4c1074[_0x2fefc9]={'$like':'%'+_0x43d4aa[_0xcc24('0x2f')][_0xcc24('0x3a')]+'%'};return _0x4c1074;})});}_0x19b26f=_[_0xcc24('0x3b')]({},_0x19b26f,_0x43d4aa[_0xcc24('0x3d')]);return _0x147aef['getSubjects'](_0x19b26f);}})[_0xcc24('0x24')](function(_0x438992){if(_0x438992){_0x5b07a6=_0x438992[_0xcc24('0x4b')];if(!_0x43d4aa[_0xcc24('0x2f')][_0xcc24('0x35')](_0xcc24('0x36'))){_0x19b26f['limit']=qs[_0xcc24('0x1d')](_0x43d4aa[_0xcc24('0x2f')][_0xcc24('0x1d')]);_0x19b26f[_0xcc24('0x1c')]=qs[_0xcc24('0x1c')](_0x43d4aa[_0xcc24('0x2f')]['offset']);}return _0x147aef[_0xcc24('0x4e')](_0x19b26f);}})[_0xcc24('0x24')](function(_0xd016b0){if(_0xd016b0){return _0xd016b0?{'count':_0x5b07a6,'rows':_0xd016b0}:null;}})[_0xcc24('0x24')](respondWithResult(_0x6387d0,null))[_0xcc24('0x46')](handleError(_0x6387d0,null));};exports[_0xcc24('0x4f')]=function(_0x227fe7,_0x23d14f,_0x368c79){var _0x5447dc={};var _0x2bece1={};var _0x2d3e8e;var _0x178dfb;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x227fe7['params']['id']}})[_0xcc24('0x24')](handleEntityNotFound(_0x23d14f,null))['then'](function(_0x5578ea){if(_0x5578ea){_0x2d3e8e=_0x5578ea;_0x2bece1[_0xcc24('0x2e')]=_[_0xcc24('0x30')](db[_0xcc24('0x4d')][_0xcc24('0x2b')]);_0x2bece1[_0xcc24('0x2f')]=_[_0xcc24('0x30')](_0x227fe7['query']);_0x2bece1[_0xcc24('0x31')]=_[_0xcc24('0x33')](_0x2bece1[_0xcc24('0x2e')],_0x2bece1['query']);_0x5447dc[_0xcc24('0x32')]=_[_0xcc24('0x33')](_0x2bece1[_0xcc24('0x2e')],qs[_0xcc24('0x34')](_0x227fe7[_0xcc24('0x2f')]['fields']));_0x5447dc[_0xcc24('0x32')]=_0x5447dc['attributes'][_0xcc24('0x4b')]?_0x5447dc['attributes']:_0x2bece1[_0xcc24('0x2e')];_0x5447dc['order']=qs[_0xcc24('0x38')](_0x227fe7[_0xcc24('0x2f')][_0xcc24('0x38')]);_0x5447dc[_0xcc24('0x39')]=qs[_0xcc24('0x31')](_[_0xcc24('0x4c')](_0x227fe7[_0xcc24('0x2f')],_0x2bece1[_0xcc24('0x31')]));if(_0x227fe7[_0xcc24('0x2f')]['filter']){_0x5447dc['where']=_[_0xcc24('0x3b')](_0x5447dc[_0xcc24('0x39')],{'$or':_[_0xcc24('0x29')](_0x5447dc[_0xcc24('0x32')],function(_0x287b3e){var _0x2ec257={};_0x2ec257[_0x287b3e]={'$like':'%'+_0x227fe7[_0xcc24('0x2f')][_0xcc24('0x3a')]+'%'};return _0x2ec257;})});}_0x5447dc=_[_0xcc24('0x3b')]({},_0x5447dc,_0x227fe7[_0xcc24('0x3d')]);return _0x2d3e8e[_0xcc24('0x4f')](_0x5447dc);}})[_0xcc24('0x24')](function(_0x4a8ca0){if(_0x4a8ca0){_0x178dfb=_0x4a8ca0[_0xcc24('0x4b')];if(!_0x227fe7[_0xcc24('0x2f')]['hasOwnProperty'](_0xcc24('0x36'))){_0x5447dc['limit']=qs[_0xcc24('0x1d')](_0x227fe7[_0xcc24('0x2f')][_0xcc24('0x1d')]);_0x5447dc[_0xcc24('0x1c')]=qs['offset'](_0x227fe7['query'][_0xcc24('0x1c')]);}return _0x2d3e8e[_0xcc24('0x4f')](_0x5447dc);}})[_0xcc24('0x24')](function(_0x5409c5){if(_0x5409c5){return _0x5409c5?{'count':_0x178dfb,'rows':_0x5409c5}:null;}})[_0xcc24('0x24')](respondWithResult(_0x23d14f,null))[_0xcc24('0x46')](handleError(_0x23d14f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index bede328..d272bc6 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0xe5b3,0x133));var _0x3e5b=function(_0x15ba70,_0x23aa1d){_0x15ba70=_0x15ba70-0x0;var _0x116605=_0xe5b3[_0x15ba70];return _0x116605;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x2b2a49,_0x1681d7){var _0x323911=function(_0x3f8538){while(--_0x3f8538){_0x2b2a49['push'](_0x2b2a49['shift']());}};_0x323911(++_0x1681d7);}(_0xedd9,0xfc));var _0x9edd=function(_0x52a742,_0x402e3d){_0x52a742=_0x52a742-0x0;var _0x47d29c=_0xedd9[_0x52a742];return _0x47d29c;};'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':'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 8bbd047..3ed96d5 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 _0xb878=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','http','request','then','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb878,0x105));var _0x8b87=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb878[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x8b87('0x0'));var moment=require('moment');var BPromise=require(_0x8b87('0x1'));var rs=require(_0x8b87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b87('0x3'));var logger=require(_0x8b87('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8b87('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4dcf55,_0x5598a6,_0x3c96dc){return new BPromise(function(_0x15f913,_0x305995){return client[_0x8b87('0x6')](_0x4dcf55,_0x3c96dc)[_0x8b87('0x7')](function(_0x3272da){logger['info'](_0x8b87('0x8'),_0x5598a6,'request\x20sent');logger[_0x8b87('0x9')](_0x8b87('0xa'),_0x5598a6,_0x8b87('0xb'),JSON[_0x8b87('0xc')](_0x3272da));if(_0x3272da['error']){if(_0x3272da[_0x8b87('0xd')]['code']===0x1f4){logger[_0x8b87('0xd')](_0x8b87('0x8'),_0x5598a6,_0x3272da[_0x8b87('0xd')]['message']);return _0x305995(_0x3272da['error'][_0x8b87('0xe')]);}logger[_0x8b87('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5598a6,_0x3272da['error'][_0x8b87('0xe')]);return _0x15f913(_0x3272da[_0x8b87('0xd')][_0x8b87('0xe')]);}else{logger[_0x8b87('0xf')](_0x8b87('0x8'),_0x5598a6,_0x8b87('0xb'));_0x15f913(_0x3272da[_0x8b87('0x10')][_0x8b87('0xe')]);}})[_0x8b87('0x11')](function(_0x12731c){logger[_0x8b87('0xd')](_0x8b87('0x8'),_0x5598a6,_0x12731c);_0x305995(_0x12731c);});});} \ No newline at end of file +var _0x47a2=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x47a2,0x65));var _0x247a=function(_0x377b59,_0x1f167d){_0x377b59=_0x377b59-0x0;var _0x2cae54=_0x47a2[_0x377b59];return _0x2cae54;};'use strict';var _=require(_0x247a('0x0'));var util=require(_0x247a('0x1'));var moment=require('moment');var BPromise=require(_0x247a('0x2'));var rs=require(_0x247a('0x3'));var fs=require('fs');var Redis=require(_0x247a('0x4'));var db=require(_0x247a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x247a('0x6'))(_0x247a('0x7'));var config=require('../../config/environment');var jayson=require(_0x247a('0x8'));var client=jayson[_0x247a('0x9')][_0x247a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29a6b9,_0x1c0251,_0x7746a5){return new BPromise(function(_0x417c24,_0x11369d){return client[_0x247a('0xb')](_0x29a6b9,_0x7746a5)[_0x247a('0xc')](function(_0x105ca8){logger[_0x247a('0xd')](_0x247a('0xe'),_0x1c0251,_0x247a('0xf'));logger[_0x247a('0x10')](_0x247a('0x11'),_0x1c0251,'request\x20sent',JSON['stringify'](_0x105ca8));if(_0x105ca8[_0x247a('0x12')]){if(_0x105ca8[_0x247a('0x12')][_0x247a('0x13')]===0x1f4){logger['error'](_0x247a('0xe'),_0x1c0251,_0x105ca8['error']['message']);return _0x11369d(_0x105ca8['error']['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1c0251,_0x105ca8['error'][_0x247a('0x14')]);return _0x417c24(_0x105ca8[_0x247a('0x12')][_0x247a('0x14')]);}else{logger['info'](_0x247a('0xe'),_0x1c0251,_0x247a('0xf'));_0x417c24(_0x105ca8[_0x247a('0x15')][_0x247a('0x14')]);}})[_0x247a('0x16')](function(_0x1b8584){logger[_0x247a('0x12')](_0x247a('0xe'),_0x1c0251,_0x1b8584);_0x11369d(_0x1b8584);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5224356..ac88df1 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 _0xbc6f=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0xbc6f,0x148));var _0xfbc6=function(_0xe323e3,_0x110473){_0xe323e3=_0xe323e3-0x0;var _0x208a43=_0xbc6f[_0xe323e3];return _0x208a43;};'use strict';var multer=require('multer');var util=require(_0xfbc6('0x0'));var path=require(_0xfbc6('0x1'));var timeout=require(_0xfbc6('0x2'));var express=require('express');var router=express[_0xfbc6('0x3')]();var fs_extra=require(_0xfbc6('0x4'));var auth=require(_0xfbc6('0x5'));var interaction=require(_0xfbc6('0x6'));var config=require(_0xfbc6('0x7'));var controller=require(_0xfbc6('0x8'));router[_0xfbc6('0x9')]('/',auth[_0xfbc6('0xa')](),controller[_0xfbc6('0xb')]);router[_0xfbc6('0x9')](_0xfbc6('0xc'),auth[_0xfbc6('0xa')](),controller[_0xfbc6('0xd')]);router[_0xfbc6('0xe')]('/',auth['isAuthenticated'](),controller[_0xfbc6('0xf')]);router[_0xfbc6('0x10')](_0xfbc6('0xc'),auth[_0xfbc6('0xa')](),controller[_0xfbc6('0x11')]);router[_0xfbc6('0x12')](_0xfbc6('0xc'),auth['isAuthenticated'](),controller[_0xfbc6('0x13')]);module[_0xfbc6('0x14')]=router; \ No newline at end of file +var _0xa908=['/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xa908,0x197));var _0x8a90=function(_0x563614,_0x12187a){_0x563614=_0x563614-0x0;var _0x3f9c3a=_0xa908[_0x563614];return _0x3f9c3a;};'use strict';var multer=require(_0x8a90('0x0'));var util=require(_0x8a90('0x1'));var path=require(_0x8a90('0x2'));var timeout=require(_0x8a90('0x3'));var express=require('express');var router=express[_0x8a90('0x4')]();var fs_extra=require(_0x8a90('0x5'));var auth=require(_0x8a90('0x6'));var interaction=require(_0x8a90('0x7'));var config=require(_0x8a90('0x8'));var controller=require(_0x8a90('0x9'));router[_0x8a90('0xa')]('/',auth[_0x8a90('0xb')](),controller[_0x8a90('0xc')]);router[_0x8a90('0xa')](_0x8a90('0xd'),auth[_0x8a90('0xb')](),controller[_0x8a90('0xe')]);router[_0x8a90('0xf')]('/',auth[_0x8a90('0xb')](),controller[_0x8a90('0x10')]);router[_0x8a90('0x11')](_0x8a90('0xd'),auth[_0x8a90('0xb')](),controller['update']);router[_0x8a90('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8a90('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index aca7ffa..f29099e 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 _0xe805=['exports','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x40e100,_0xe409a0){var _0x10fb20=function(_0x4c54dd){while(--_0x4c54dd){_0x40e100['push'](_0x40e100['shift']());}};_0x10fb20(++_0xe409a0);}(_0xe805,0xfc));var _0x5e80=function(_0x49f1cc,_0x2ef787){_0x49f1cc=_0x49f1cc-0x0;var _0x474a2c=_0xe805[_0x49f1cc];return _0x474a2c;};'use strict';var Sequelize=require('sequelize');module[_0x5e80('0x0')]={'type':{'type':Sequelize['ENUM'](_0x5e80('0x1'),_0x5e80('0x2'),_0x5e80('0x3'),_0x5e80('0x4'),'picklist'),'defaultValue':_0x5e80('0x1')},'content':{'type':Sequelize[_0x5e80('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5e80('0x1'),_0x5e80('0x2'),_0x5e80('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5e80('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5e80('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e80('0x5')]}}; \ No newline at end of file +var _0xc21f=['STRING','BOOLEAN','ENUM','string','variable','customVariable','picklist'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0xc21f,0xcd));var _0xfc21=function(_0x289d7a,_0x1d4e8f){_0x289d7a=_0x289d7a-0x0;var _0x4e8e02=_0xc21f[_0x289d7a];return _0x4e8e02;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfc21('0x0')](_0xfc21('0x1'),_0xfc21('0x2'),_0xfc21('0x3'),'keyValue',_0xfc21('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xfc21('0x5')]},'keyType':{'type':Sequelize[_0xfc21('0x0')](_0xfc21('0x1'),_0xfc21('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xfc21('0x5')]},'idField':{'type':Sequelize[_0xfc21('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfc21('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 75fb5d2..e08ec60 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 _0x7130=['destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then'];(function(_0x4772bd,_0x255ff6){var _0x386a8e=function(_0x5034ce){while(--_0x5034ce){_0x4772bd['push'](_0x4772bd['shift']());}};_0x386a8e(++_0x255ff6);}(_0x7130,0xfc));var _0x0713=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x7130[_0x616290];return _0x453879;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0713('0x0'));var zipdir=require(_0x0713('0x1'));var jsonpatch=require(_0x0713('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0713('0x3'));var Mustache=require(_0x0713('0x4'));var util=require(_0x0713('0x5'));var path=require(_0x0713('0x6'));var sox=require(_0x0713('0x7'));var csv=require(_0x0713('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0713('0x9'));var _=require(_0x0713('0xa'));var squel=require(_0x0713('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0713('0x8'));var querystring=require(_0x0713('0xc'));var Papa=require(_0x0713('0xd'));var Redis=require('ioredis');var authService=require(_0x0713('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0713('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0713('0x10'));var utils=require(_0x0713('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0713('0x12'))['db'];function respondWithStatusCode(_0x13eb53,_0x517e22){_0x517e22=_0x517e22||0xcc;return function(_0x4f128f){if(_0x4f128f){return _0x13eb53[_0x0713('0x13')](_0x517e22);}return _0x13eb53[_0x0713('0x14')](_0x517e22)[_0x0713('0x15')]();};}function respondWithResult(_0x6cf1c4,_0x2017d1){_0x2017d1=_0x2017d1||0xc8;return function(_0x375f8d){if(_0x375f8d){return _0x6cf1c4[_0x0713('0x14')](_0x2017d1)[_0x0713('0x16')](_0x375f8d);}};}function respondWithFilteredResult(_0x43097d,_0x1bd1f1){return function(_0x3358b8){if(_0x3358b8){var _0x2254a6=typeof _0x1bd1f1[_0x0713('0x17')]===_0x0713('0x18')&&typeof _0x1bd1f1[_0x0713('0x19')]==='undefined';var _0x2133a7=_0x3358b8[_0x0713('0x1a')];var _0x5f57c1=_0x2254a6?0x0:_0x1bd1f1[_0x0713('0x17')];var _0x40767e=_0x2254a6?_0x3358b8[_0x0713('0x1a')]:_0x1bd1f1['offset']+_0x1bd1f1['limit'];var _0x34beeb;if(_0x40767e>=_0x2133a7){_0x40767e=_0x2133a7;_0x34beeb=0xc8;}else{_0x34beeb=0xce;}_0x43097d['status'](_0x34beeb);return _0x43097d[_0x0713('0x1b')](_0x0713('0x1c'),_0x5f57c1+'-'+_0x40767e+'/'+_0x2133a7)[_0x0713('0x16')](_0x3358b8);}return null;};}function patchUpdates(_0x1adb8f){return function(_0x2a601f){try{jsonpatch['apply'](_0x2a601f,_0x1adb8f,!![]);}catch(_0x1514d3){return BPromise[_0x0713('0x1d')](_0x1514d3);}return _0x2a601f['save']();};}function saveUpdates(_0x578cfd,_0x48cdf9){return function(_0x22ddbc){if(_0x22ddbc){return _0x22ddbc[_0x0713('0x1e')](_0x578cfd)[_0x0713('0x1f')](function(_0x1d346c){return _0x1d346c;});}return null;};}function removeEntity(_0x17f9c3,_0x4108a1){return function(_0x105fb0){if(_0x105fb0){return _0x105fb0[_0x0713('0x20')]()['then'](function(){_0x17f9c3[_0x0713('0x14')](0xcc)[_0x0713('0x15')]();});}};}function handleEntityNotFound(_0x15f276,_0x4bbebf){return function(_0x18c167){if(!_0x18c167){_0x15f276[_0x0713('0x13')](0x194);}return _0x18c167;};}function handleError(_0x102f45,_0x639920){_0x639920=_0x639920||0x1f4;return function(_0x23fcc2){logger[_0x0713('0x21')](_0x23fcc2[_0x0713('0x22')]);if(_0x23fcc2[_0x0713('0x23')]){delete _0x23fcc2[_0x0713('0x23')];}_0x102f45[_0x0713('0x14')](_0x639920)[_0x0713('0x24')](_0x23fcc2);};}exports[_0x0713('0x25')]=function(_0x408737,_0xb2d461){var _0x3e3044={},_0x3037a5={},_0x24f31d={'count':0x0,'rows':[]};var _0x57b669=_[_0x0713('0x26')](db[_0x0713('0x27')][_0x0713('0x28')],function(_0x5bcfe3){return{'name':_0x5bcfe3[_0x0713('0x29')],'type':_0x5bcfe3[_0x0713('0x2a')][_0x0713('0x2b')]};});_0x3037a5[_0x0713('0x2c')]=_[_0x0713('0x26')](_0x57b669,_0x0713('0x23'));_0x3037a5[_0x0713('0x2d')]=_[_0x0713('0x2e')](_0x408737[_0x0713('0x2d')]);_0x3037a5[_0x0713('0x2f')]=_[_0x0713('0x30')](_0x3037a5[_0x0713('0x2c')],_0x3037a5[_0x0713('0x2d')]);_0x3e3044[_0x0713('0x31')]=_[_0x0713('0x30')](_0x3037a5[_0x0713('0x2c')],qs[_0x0713('0x32')](_0x408737['query'][_0x0713('0x32')]));_0x3e3044[_0x0713('0x31')]=_0x3e3044[_0x0713('0x31')][_0x0713('0x33')]?_0x3e3044[_0x0713('0x31')]:_0x3037a5[_0x0713('0x2c')];if(!_0x408737[_0x0713('0x2d')]['hasOwnProperty'](_0x0713('0x34'))){_0x3e3044[_0x0713('0x19')]=qs[_0x0713('0x19')](_0x408737[_0x0713('0x2d')]['limit']);_0x3e3044[_0x0713('0x17')]=qs[_0x0713('0x17')](_0x408737[_0x0713('0x2d')][_0x0713('0x17')]);}_0x3e3044[_0x0713('0x35')]=qs[_0x0713('0x36')](_0x408737['query'][_0x0713('0x36')]);_0x3e3044[_0x0713('0x37')]=qs[_0x0713('0x2f')](_[_0x0713('0x38')](_0x408737['query'],_0x3037a5['filters']),_0x57b669);if(_0x408737['query'][_0x0713('0x39')]){_0x3e3044['where']=_[_0x0713('0x3a')](_0x3e3044[_0x0713('0x37')],{'$or':_[_0x0713('0x26')](_0x57b669,function(_0x348984){if(_0x348984[_0x0713('0x2a')]!==_0x0713('0x3b')){var _0x4370ba={};_0x4370ba[_0x348984[_0x0713('0x23')]]={'$like':'%'+_0x408737[_0x0713('0x2d')][_0x0713('0x39')]+'%'};return _0x4370ba;}})});}_0x3e3044=_['merge']({},_0x3e3044,_0x408737[_0x0713('0x3c')]);var _0x2ec645={'where':_0x3e3044[_0x0713('0x37')]};return db['Dynamics365Field'][_0x0713('0x1a')](_0x2ec645)[_0x0713('0x1f')](function(_0x27ca97){_0x24f31d[_0x0713('0x1a')]=_0x27ca97;if(_0x408737['query'][_0x0713('0x3d')]){_0x3e3044[_0x0713('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x0713('0x3f')](_0x3e3044);})[_0x0713('0x1f')](function(_0xe008e2){_0x24f31d[_0x0713('0x40')]=_0xe008e2;return _0x24f31d;})['then'](respondWithFilteredResult(_0xb2d461,_0x3e3044))[_0x0713('0x41')](handleError(_0xb2d461,null));};exports[_0x0713('0x42')]=function(_0x199bac,_0x40776b){var _0x35cc10={'raw':!![],'where':{'id':_0x199bac[_0x0713('0x43')]['id']}},_0x379d3d={};_0x379d3d['model']=_[_0x0713('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x379d3d[_0x0713('0x2d')]=_[_0x0713('0x2e')](_0x199bac[_0x0713('0x2d')]);_0x379d3d[_0x0713('0x2f')]=_[_0x0713('0x30')](_0x379d3d[_0x0713('0x2c')],_0x379d3d['query']);_0x35cc10['attributes']=_[_0x0713('0x30')](_0x379d3d[_0x0713('0x2c')],qs['fields'](_0x199bac[_0x0713('0x2d')]['fields']));_0x35cc10['attributes']=_0x35cc10[_0x0713('0x31')][_0x0713('0x33')]?_0x35cc10[_0x0713('0x31')]:_0x379d3d[_0x0713('0x2c')];if(_0x199bac[_0x0713('0x2d')][_0x0713('0x3d')]){_0x35cc10[_0x0713('0x3e')]=[{'all':!![]}];}_0x35cc10=_[_0x0713('0x3a')]({},_0x35cc10,_0x199bac[_0x0713('0x3c')]);return db[_0x0713('0x27')][_0x0713('0x44')](_0x35cc10)['then'](handleEntityNotFound(_0x40776b,null))['then'](respondWithResult(_0x40776b,null))[_0x0713('0x41')](handleError(_0x40776b,null));};exports[_0x0713('0x45')]=function(_0x2b08b3,_0x2fd6ca){return db[_0x0713('0x27')][_0x0713('0x45')](_0x2b08b3[_0x0713('0x46')],{})[_0x0713('0x1f')](respondWithResult(_0x2fd6ca,0xc9))['catch'](handleError(_0x2fd6ca,null));};exports[_0x0713('0x1e')]=function(_0x408e26,_0x141e9b){if(_0x408e26[_0x0713('0x46')]['id']){delete _0x408e26[_0x0713('0x46')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x408e26[_0x0713('0x43')]['id']}})[_0x0713('0x1f')](handleEntityNotFound(_0x141e9b,null))[_0x0713('0x1f')](saveUpdates(_0x408e26[_0x0713('0x46')],null))[_0x0713('0x1f')](respondWithResult(_0x141e9b,null))[_0x0713('0x41')](handleError(_0x141e9b,null));};exports['destroy']=function(_0x3cb510,_0x40c6c2){return db[_0x0713('0x27')][_0x0713('0x44')]({'where':{'id':_0x3cb510[_0x0713('0x43')]['id']}})[_0x0713('0x1f')](handleEntityNotFound(_0x40c6c2,null))['then'](removeEntity(_0x40c6c2,null))[_0x0713('0x41')](handleError(_0x40c6c2,null));}; \ No newline at end of file +var _0xc387=['key','model','name','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','intersection','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','send','index','map','Dynamics365Field','rawAttributes','fieldName','type'];(function(_0x507bd5,_0x3e84e7){var _0xfe68fc=function(_0xff3175){while(--_0xff3175){_0x507bd5['push'](_0x507bd5['shift']());}};_0xfe68fc(++_0x3e84e7);}(_0xc387,0x65));var _0x7c38=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc387[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7c38('0x0'));var rimraf=require(_0x7c38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c38('0x2'));var rp=require(_0x7c38('0x3'));var moment=require(_0x7c38('0x4'));var BPromise=require(_0x7c38('0x5'));var Mustache=require(_0x7c38('0x6'));var util=require(_0x7c38('0x7'));var path=require(_0x7c38('0x8'));var sox=require('sox');var csv=require(_0x7c38('0x9'));var ejs=require(_0x7c38('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c38('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7c38('0xc'));var Papa=require(_0x7c38('0xd'));var Redis=require(_0x7c38('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c38('0xf'));var as=require(_0x7c38('0x10'));var hardwareService=require(_0x7c38('0x11'));var logger=require('../../config/logger')(_0x7c38('0x12'));var utils=require(_0x7c38('0x13'));var config=require(_0x7c38('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c38('0x15'))['db'];function respondWithStatusCode(_0xdcad19,_0x323ae1){_0x323ae1=_0x323ae1||0xcc;return function(_0x48d90e){if(_0x48d90e){return _0xdcad19[_0x7c38('0x16')](_0x323ae1);}return _0xdcad19[_0x7c38('0x17')](_0x323ae1)[_0x7c38('0x18')]();};}function respondWithResult(_0x3de60b,_0x222131){_0x222131=_0x222131||0xc8;return function(_0xa19f8a){if(_0xa19f8a){return _0x3de60b['status'](_0x222131)[_0x7c38('0x19')](_0xa19f8a);}};}function respondWithFilteredResult(_0x1de91d,_0x358bac){return function(_0x233d24){if(_0x233d24){var _0x1c3c94=typeof _0x358bac[_0x7c38('0x1a')]===_0x7c38('0x1b')&&typeof _0x358bac[_0x7c38('0x1c')]===_0x7c38('0x1b');var _0x1529cd=_0x233d24[_0x7c38('0x1d')];var _0x4bd88d=_0x1c3c94?0x0:_0x358bac[_0x7c38('0x1a')];var _0x1dea58=_0x1c3c94?_0x233d24[_0x7c38('0x1d')]:_0x358bac[_0x7c38('0x1a')]+_0x358bac[_0x7c38('0x1c')];var _0x4c9bf9;if(_0x1dea58>=_0x1529cd){_0x1dea58=_0x1529cd;_0x4c9bf9=0xc8;}else{_0x4c9bf9=0xce;}_0x1de91d[_0x7c38('0x17')](_0x4c9bf9);return _0x1de91d[_0x7c38('0x1e')]('Content-Range',_0x4bd88d+'-'+_0x1dea58+'/'+_0x1529cd)[_0x7c38('0x19')](_0x233d24);}return null;};}function patchUpdates(_0x3e986d){return function(_0xb37f64){try{jsonpatch['apply'](_0xb37f64,_0x3e986d,!![]);}catch(_0x1df32b){return BPromise['reject'](_0x1df32b);}return _0xb37f64['save']();};}function saveUpdates(_0x4bfb26,_0x4c3880){return function(_0x224500){if(_0x224500){return _0x224500[_0x7c38('0x1f')](_0x4bfb26)[_0x7c38('0x20')](function(_0xea7bde){return _0xea7bde;});}return null;};}function removeEntity(_0x10cb58,_0x5bbb86){return function(_0x22510f){if(_0x22510f){return _0x22510f[_0x7c38('0x21')]()[_0x7c38('0x20')](function(){_0x10cb58[_0x7c38('0x17')](0xcc)[_0x7c38('0x18')]();});}};}function handleEntityNotFound(_0xa14047,_0x148266){return function(_0x1889f0){if(!_0x1889f0){_0xa14047[_0x7c38('0x16')](0x194);}return _0x1889f0;};}function handleError(_0x5cea7f,_0x7499d4){_0x7499d4=_0x7499d4||0x1f4;return function(_0x65ee31){logger[_0x7c38('0x22')](_0x65ee31[_0x7c38('0x23')]);if(_0x65ee31['name']){delete _0x65ee31['name'];}_0x5cea7f[_0x7c38('0x17')](_0x7499d4)[_0x7c38('0x24')](_0x65ee31);};}exports[_0x7c38('0x25')]=function(_0x348c99,_0x174216){var _0x49bc46={},_0x5b80e1={},_0xa13b20={'count':0x0,'rows':[]};var _0x212a4f=_[_0x7c38('0x26')](db[_0x7c38('0x27')][_0x7c38('0x28')],function(_0x5668d7){return{'name':_0x5668d7[_0x7c38('0x29')],'type':_0x5668d7[_0x7c38('0x2a')][_0x7c38('0x2b')]};});_0x5b80e1[_0x7c38('0x2c')]=_[_0x7c38('0x26')](_0x212a4f,_0x7c38('0x2d'));_0x5b80e1['query']=_['keys'](_0x348c99[_0x7c38('0x2e')]);_0x5b80e1['filters']=_['intersection'](_0x5b80e1[_0x7c38('0x2c')],_0x5b80e1[_0x7c38('0x2e')]);_0x49bc46[_0x7c38('0x2f')]=_['intersection'](_0x5b80e1[_0x7c38('0x2c')],qs[_0x7c38('0x30')](_0x348c99['query'][_0x7c38('0x30')]));_0x49bc46[_0x7c38('0x2f')]=_0x49bc46['attributes'][_0x7c38('0x31')]?_0x49bc46[_0x7c38('0x2f')]:_0x5b80e1[_0x7c38('0x2c')];if(!_0x348c99['query'][_0x7c38('0x32')](_0x7c38('0x33'))){_0x49bc46[_0x7c38('0x1c')]=qs[_0x7c38('0x1c')](_0x348c99[_0x7c38('0x2e')][_0x7c38('0x1c')]);_0x49bc46[_0x7c38('0x1a')]=qs['offset'](_0x348c99[_0x7c38('0x2e')][_0x7c38('0x1a')]);}_0x49bc46[_0x7c38('0x34')]=qs[_0x7c38('0x35')](_0x348c99[_0x7c38('0x2e')][_0x7c38('0x35')]);_0x49bc46[_0x7c38('0x36')]=qs['filters'](_['pick'](_0x348c99[_0x7c38('0x2e')],_0x5b80e1['filters']),_0x212a4f);if(_0x348c99['query']['filter']){_0x49bc46[_0x7c38('0x36')]=_[_0x7c38('0x37')](_0x49bc46[_0x7c38('0x36')],{'$or':_[_0x7c38('0x26')](_0x212a4f,function(_0x29898a){if(_0x29898a[_0x7c38('0x2a')]!==_0x7c38('0x38')){var _0x498276={};_0x498276[_0x29898a[_0x7c38('0x2d')]]={'$like':'%'+_0x348c99[_0x7c38('0x2e')][_0x7c38('0x39')]+'%'};return _0x498276;}})});}_0x49bc46=_[_0x7c38('0x37')]({},_0x49bc46,_0x348c99[_0x7c38('0x3a')]);var _0x2b2f18={'where':_0x49bc46[_0x7c38('0x36')]};return db[_0x7c38('0x27')][_0x7c38('0x1d')](_0x2b2f18)[_0x7c38('0x20')](function(_0x584e7c){_0xa13b20[_0x7c38('0x1d')]=_0x584e7c;if(_0x348c99[_0x7c38('0x2e')][_0x7c38('0x3b')]){_0x49bc46[_0x7c38('0x3c')]=[{'all':!![]}];}return db[_0x7c38('0x27')][_0x7c38('0x3d')](_0x49bc46);})[_0x7c38('0x20')](function(_0x410282){_0xa13b20[_0x7c38('0x3e')]=_0x410282;return _0xa13b20;})[_0x7c38('0x20')](respondWithFilteredResult(_0x174216,_0x49bc46))[_0x7c38('0x3f')](handleError(_0x174216,null));};exports[_0x7c38('0x40')]=function(_0x3aa095,_0x3a89b8){var _0x28dedd={'raw':!![],'where':{'id':_0x3aa095[_0x7c38('0x41')]['id']}},_0x4e43f0={};_0x4e43f0[_0x7c38('0x2c')]=_[_0x7c38('0x42')](db[_0x7c38('0x27')][_0x7c38('0x28')]);_0x4e43f0[_0x7c38('0x2e')]=_[_0x7c38('0x42')](_0x3aa095['query']);_0x4e43f0[_0x7c38('0x43')]=_['intersection'](_0x4e43f0[_0x7c38('0x2c')],_0x4e43f0[_0x7c38('0x2e')]);_0x28dedd['attributes']=_[_0x7c38('0x44')](_0x4e43f0[_0x7c38('0x2c')],qs[_0x7c38('0x30')](_0x3aa095[_0x7c38('0x2e')][_0x7c38('0x30')]));_0x28dedd[_0x7c38('0x2f')]=_0x28dedd[_0x7c38('0x2f')][_0x7c38('0x31')]?_0x28dedd[_0x7c38('0x2f')]:_0x4e43f0['model'];if(_0x3aa095[_0x7c38('0x2e')]['includeAll']){_0x28dedd['include']=[{'all':!![]}];}_0x28dedd=_[_0x7c38('0x37')]({},_0x28dedd,_0x3aa095['options']);return db['Dynamics365Field'][_0x7c38('0x45')](_0x28dedd)[_0x7c38('0x20')](handleEntityNotFound(_0x3a89b8,null))[_0x7c38('0x20')](respondWithResult(_0x3a89b8,null))[_0x7c38('0x3f')](handleError(_0x3a89b8,null));};exports[_0x7c38('0x46')]=function(_0xa48ffe,_0x248986){return db[_0x7c38('0x27')][_0x7c38('0x46')](_0xa48ffe[_0x7c38('0x47')],{})[_0x7c38('0x20')](respondWithResult(_0x248986,0xc9))[_0x7c38('0x3f')](handleError(_0x248986,null));};exports[_0x7c38('0x1f')]=function(_0x2bc4b7,_0x37f881){if(_0x2bc4b7[_0x7c38('0x47')]['id']){delete _0x2bc4b7[_0x7c38('0x47')]['id'];}return db[_0x7c38('0x27')][_0x7c38('0x45')]({'where':{'id':_0x2bc4b7[_0x7c38('0x41')]['id']}})['then'](handleEntityNotFound(_0x37f881,null))['then'](saveUpdates(_0x2bc4b7[_0x7c38('0x47')],null))['then'](respondWithResult(_0x37f881,null))['catch'](handleError(_0x37f881,null));};exports[_0x7c38('0x21')]=function(_0x298b76,_0x55a93f){return db['Dynamics365Field']['find']({'where':{'id':_0x298b76[_0x7c38('0x41')]['id']}})[_0x7c38('0x20')](handleEntityNotFound(_0x55a93f,null))[_0x7c38('0x20')](removeEntity(_0x55a93f,null))[_0x7c38('0x3f')](handleError(_0x55a93f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index cefbdf8..4136511 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 _0xe26f=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f617a,_0x398aef){var _0x223c0c=function(_0x2d4a05){while(--_0x2d4a05){_0x1f617a['push'](_0x1f617a['shift']());}};_0x223c0c(++_0x398aef);}(_0xe26f,0xf7));var _0xfe26=function(_0x17b113,_0x357554){_0x17b113=_0x17b113-0x0;var _0x746117=_0xe26f[_0x17b113];return _0x746117;};'use strict';var _=require(_0xfe26('0x0'));var util=require(_0xfe26('0x1'));var logger=require('../../config/logger')(_0xfe26('0x2'));var moment=require(_0xfe26('0x3'));var BPromise=require(_0xfe26('0x4'));var rp=require(_0xfe26('0x5'));var fs=require('fs');var path=require(_0xfe26('0x6'));var rimraf=require(_0xfe26('0x7'));var config=require(_0xfe26('0x8'));var attributes=require(_0xfe26('0x9'));module[_0xfe26('0xa')]=function(_0x39bd9e,_0x5035c3){return _0x39bd9e[_0xfe26('0xb')](_0xfe26('0xc'),attributes,{'tableName':_0xfe26('0xd'),'paranoid':![],'indexes':[{'name':_0xfe26('0xe'),'fields':[_0xfe26('0xf'),_0xfe26('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7707=['path','exports','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2ff9a6,_0x29726c){var _0x3d3b99=function(_0x1ea933){while(--_0x1ea933){_0x2ff9a6['push'](_0x2ff9a6['shift']());}};_0x3d3b99(++_0x29726c);}(_0x7707,0x1e9));var _0x7770=function(_0x354f8,_0x544091){_0x354f8=_0x354f8-0x0;var _0x45a159=_0x7707[_0x354f8];return _0x45a159;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var logger=require(_0x7770('0x2'))('api');var moment=require(_0x7770('0x3'));var BPromise=require(_0x7770('0x4'));var rp=require(_0x7770('0x5'));var fs=require('fs');var path=require(_0x7770('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0x7770('0x7')]=function(_0x1eb5d9,_0xe6c7c5){return _0x1eb5d9['define']('Dynamics365Field',attributes,{'tableName':_0x7770('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7770('0x9'),_0x7770('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 663fea0..d0a4902 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 _0x7314=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis'];(function(_0x2350dd,_0x53e293){var _0x5ca2db=function(_0x5dacc7){while(--_0x5dacc7){_0x2350dd['push'](_0x2350dd['shift']());}};_0x5ca2db(++_0x53e293);}(_0x7314,0x176));var _0x4731=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var moment=require('moment');var BPromise=require(_0x4731('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4731('0x3'));var db=require(_0x4731('0x4'))['db'];var utils=require(_0x4731('0x5'));var logger=require(_0x4731('0x6'))('rpc');var config=require(_0x4731('0x7'));var jayson=require(_0x4731('0x8'));var client=jayson[_0x4731('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34bc9a,_0x531866,_0x2c03ac){return new BPromise(function(_0x5dbe32,_0x5d09c9){return client[_0x4731('0xa')](_0x34bc9a,_0x2c03ac)[_0x4731('0xb')](function(_0x4437a9){logger[_0x4731('0xc')](_0x4731('0xd'),_0x531866,_0x4731('0xe'));logger[_0x4731('0xf')](_0x4731('0x10'),_0x531866,_0x4731('0xe'),JSON[_0x4731('0x11')](_0x4437a9));if(_0x4437a9[_0x4731('0x12')]){if(_0x4437a9['error'][_0x4731('0x13')]===0x1f4){logger[_0x4731('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x531866,_0x4437a9[_0x4731('0x12')][_0x4731('0x14')]);return _0x5d09c9(_0x4437a9['error'][_0x4731('0x14')]);}logger[_0x4731('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x531866,_0x4437a9[_0x4731('0x12')][_0x4731('0x14')]);return _0x5dbe32(_0x4437a9[_0x4731('0x12')][_0x4731('0x14')]);}else{logger[_0x4731('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x531866,'request\x20sent');_0x5dbe32(_0x4437a9['result']['message']);}})['catch'](function(_0x1d5511){logger[_0x4731('0x12')](_0x4731('0xd'),_0x531866,_0x1d5511);_0x5d09c9(_0x1d5511);});});} \ No newline at end of file +var _0xee75=['client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xee75,0x10f));var _0x5ee7=function(_0x2f8c4a,_0x1b2121){_0x2f8c4a=_0x2f8c4a-0x0;var _0x7f7d5c=_0xee75[_0x2f8c4a];return _0x7f7d5c;};'use strict';var _=require(_0x5ee7('0x0'));var util=require(_0x5ee7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ee7('0x2'));var fs=require('fs');var Redis=require(_0x5ee7('0x3'));var db=require(_0x5ee7('0x4'))['db'];var utils=require(_0x5ee7('0x5'));var logger=require(_0x5ee7('0x6'))(_0x5ee7('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ee7('0x8'));var client=jayson[_0x5ee7('0x9')][_0x5ee7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28253f,_0x548b9f,_0x2f8850){return new BPromise(function(_0x2869e9,_0x4dbd25){return client['request'](_0x28253f,_0x2f8850)[_0x5ee7('0xb')](function(_0x35be91){logger[_0x5ee7('0xc')](_0x5ee7('0xd'),_0x548b9f,_0x5ee7('0xe'));logger[_0x5ee7('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x548b9f,_0x5ee7('0xe'),JSON[_0x5ee7('0x10')](_0x35be91));if(_0x35be91[_0x5ee7('0x11')]){if(_0x35be91[_0x5ee7('0x11')]['code']===0x1f4){logger[_0x5ee7('0x11')](_0x5ee7('0xd'),_0x548b9f,_0x35be91['error'][_0x5ee7('0x12')]);return _0x4dbd25(_0x35be91[_0x5ee7('0x11')][_0x5ee7('0x12')]);}logger[_0x5ee7('0x11')](_0x5ee7('0xd'),_0x548b9f,_0x35be91[_0x5ee7('0x11')]['message']);return _0x2869e9(_0x35be91['error'][_0x5ee7('0x12')]);}else{logger[_0x5ee7('0xc')](_0x5ee7('0xd'),_0x548b9f,'request\x20sent');_0x2869e9(_0x35be91[_0x5ee7('0x13')]['message']);}})['catch'](function(_0x566af9){logger[_0x5ee7('0x11')](_0x5ee7('0xd'),_0x548b9f,_0x566af9);_0x4dbd25(_0x566af9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 051cae6..18c8f19 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 _0xf2b2=['/:id/configurations','/:id/fields','post','addConfiguration','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x3ab2af,_0x36b7be){var _0x480ebf=function(_0x100b79){while(--_0x100b79){_0x3ab2af['push'](_0x3ab2af['shift']());}};_0x480ebf(++_0x36b7be);}(_0xf2b2,0x15e));var _0x2f2b=function(_0xe57cba,_0x39349d){_0xe57cba=_0xe57cba-0x0;var _0x51b1fb=_0xf2b2[_0xe57cba];return _0x51b1fb;};'use strict';var multer=require(_0x2f2b('0x0'));var util=require(_0x2f2b('0x1'));var path=require(_0x2f2b('0x2'));var timeout=require(_0x2f2b('0x3'));var express=require(_0x2f2b('0x4'));var router=express[_0x2f2b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2f2b('0x6'));var config=require(_0x2f2b('0x7'));var controller=require(_0x2f2b('0x8'));router[_0x2f2b('0x9')]('/',auth[_0x2f2b('0xa')](),controller['index']);router[_0x2f2b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2f2b('0x9')](_0x2f2b('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x2f2b('0x9')](_0x2f2b('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x2f2b('0xd')]('/',auth[_0x2f2b('0xa')](),controller['create']);router['post'](_0x2f2b('0xb'),auth['isAuthenticated'](),controller[_0x2f2b('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2f2b('0xf')]);router['delete'](_0x2f2b('0x10'),auth[_0x2f2b('0xa')](),controller[_0x2f2b('0x11')]);module[_0x2f2b('0x12')]=router; \ No newline at end of file +var _0x5d1e=['/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x5d1e,0x152));var _0xe5d1=function(_0x1dc172,_0x1b133e){_0x1dc172=_0x1dc172-0x0;var _0x11e70c=_0x5d1e[_0x1dc172];return _0x11e70c;};'use strict';var multer=require(_0xe5d1('0x0'));var util=require(_0xe5d1('0x1'));var path=require('path');var timeout=require(_0xe5d1('0x2'));var express=require(_0xe5d1('0x3'));var router=express[_0xe5d1('0x4')]();var fs_extra=require(_0xe5d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe5d1('0x6'));var config=require(_0xe5d1('0x7'));var controller=require(_0xe5d1('0x8'));router['get']('/',auth[_0xe5d1('0x9')](),controller[_0xe5d1('0xa')]);router[_0xe5d1('0xb')](_0xe5d1('0xc'),auth[_0xe5d1('0x9')](),controller[_0xe5d1('0xd')]);router[_0xe5d1('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe5d1('0xe')]);router[_0xe5d1('0xb')](_0xe5d1('0xf'),auth[_0xe5d1('0x9')](),controller[_0xe5d1('0x10')]);router[_0xe5d1('0x11')]('/',auth[_0xe5d1('0x9')](),controller[_0xe5d1('0x12')]);router[_0xe5d1('0x11')](_0xe5d1('0x13'),auth[_0xe5d1('0x9')](),controller[_0xe5d1('0x14')]);router['put'](_0xe5d1('0xc'),auth['isAuthenticated'](),controller[_0xe5d1('0x15')]);router[_0xe5d1('0x16')](_0xe5d1('0xc'),auth[_0xe5d1('0x9')](),controller[_0xe5d1('0x17')]);module[_0xe5d1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f5e536f..b30692d 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 _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x414d86,_0x32abf3){var _0x4170d6=function(_0x5abcb2){while(--_0x5abcb2){_0x414d86['push'](_0x414d86['shift']());}};_0x4170d6(++_0x32abf3);}(_0x781d,0x14a));var _0xd781=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x781d[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6a55=['STRING','sequelize'];(function(_0xe7eb9,_0x256394){var _0xd7e40d=function(_0x46f3d8){while(--_0x46f3d8){_0xe7eb9['push'](_0xe7eb9['shift']());}};_0xd7e40d(++_0x256394);}(_0x6a55,0xdb));var _0x56a5=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x6a55[_0x4a8bad];return _0x30cf32;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 82aff48..d566b1f 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 _0x5d31=['apiKey','toString','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','custom_text','custom_dropdown','default','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','fields','find','create','body','params','FreshdeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','findOne','remoteUri','slice','substring','lastIndexOf','format','%s/%s','Basic\x20%s'];(function(_0x479e32,_0x36eb4f){var _0x3d1847=function(_0x465ede){while(--_0x465ede){_0x479e32['push'](_0x479e32['shift']());}};_0x3d1847(++_0x36eb4f);}(_0x5d31,0xf7));var _0x15d3=function(_0x4694a0,_0x35b97f){_0x4694a0=_0x4694a0-0x0;var _0x38a2dc=_0x5d31[_0x4694a0];return _0x38a2dc;};'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'];var integrations=require(_0x15d3('0x15'));function respondWithStatusCode(_0x1397d8,_0x2811b5){_0x2811b5=_0x2811b5||0xcc;return function(_0x209104){if(_0x209104){return _0x1397d8[_0x15d3('0x16')](_0x2811b5);}return _0x1397d8[_0x15d3('0x17')](_0x2811b5)[_0x15d3('0x18')]();};}function respondWithResult(_0x1658cf,_0x44b5a4){_0x44b5a4=_0x44b5a4||0xc8;return function(_0x316945){if(_0x316945){return _0x1658cf[_0x15d3('0x17')](_0x44b5a4)['json'](_0x316945);}};}function respondWithFilteredResult(_0x304a13,_0x17401b){return function(_0x5bbfef){if(_0x5bbfef){var _0xf93348=typeof _0x17401b[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x17401b[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x2c25ba=_0x5bbfef[_0x15d3('0x1c')];var _0x31b43d=_0xf93348?0x0:_0x17401b[_0x15d3('0x19')];var _0x15fe0a=_0xf93348?_0x5bbfef[_0x15d3('0x1c')]:_0x17401b['offset']+_0x17401b[_0x15d3('0x1b')];var _0x3dc5be;if(_0x15fe0a>=_0x2c25ba){_0x15fe0a=_0x2c25ba;_0x3dc5be=0xc8;}else{_0x3dc5be=0xce;}_0x304a13['status'](_0x3dc5be);return _0x304a13['set']('Content-Range',_0x31b43d+'-'+_0x15fe0a+'/'+_0x2c25ba)['json'](_0x5bbfef);}return null;};}function patchUpdates(_0x39bb05){return function(_0x154eda){try{jsonpatch[_0x15d3('0x1d')](_0x154eda,_0x39bb05,!![]);}catch(_0x183ec7){return BPromise[_0x15d3('0x1e')](_0x183ec7);}return _0x154eda[_0x15d3('0x1f')]();};}function saveUpdates(_0x4da198,_0x49eb89){return function(_0x32f1c6){if(_0x32f1c6){return _0x32f1c6[_0x15d3('0x20')](_0x4da198)[_0x15d3('0x21')](function(_0x72852f){return _0x72852f;});}return null;};}function removeEntity(_0x5b06cc,_0x232078){return function(_0x2dea07){if(_0x2dea07){return _0x2dea07[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){_0x5b06cc[_0x15d3('0x17')](0xcc)[_0x15d3('0x18')]();});}};}function handleEntityNotFound(_0x4a499a,_0x514380){return function(_0x50f171){if(!_0x50f171){_0x4a499a[_0x15d3('0x16')](0x194);}return _0x50f171;};}function handleError(_0x1cd5bc,_0x23e1f8){_0x23e1f8=_0x23e1f8||0x1f4;return function(_0x374fa4){logger[_0x15d3('0x23')](_0x374fa4[_0x15d3('0x24')]);if(_0x374fa4[_0x15d3('0x25')]){delete _0x374fa4[_0x15d3('0x25')];}_0x1cd5bc[_0x15d3('0x17')](_0x23e1f8)['send'](_0x374fa4);};}exports['index']=function(_0x164aa1,_0x4e5840){var _0x6a9c0c={},_0x5a2ccf={},_0x314c27={'count':0x0,'rows':[]};var _0x1ad737=_['map'](db[_0x15d3('0x26')][_0x15d3('0x27')],function(_0x477624){return{'name':_0x477624[_0x15d3('0x28')],'type':_0x477624[_0x15d3('0x29')][_0x15d3('0x2a')]};});_0x5a2ccf[_0x15d3('0x2b')]=_[_0x15d3('0x2c')](_0x1ad737,_0x15d3('0x25'));_0x5a2ccf[_0x15d3('0x2d')]=_['keys'](_0x164aa1[_0x15d3('0x2d')]);_0x5a2ccf[_0x15d3('0x2e')]=_[_0x15d3('0x2f')](_0x5a2ccf[_0x15d3('0x2b')],_0x5a2ccf[_0x15d3('0x2d')]);_0x6a9c0c[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x5a2ccf[_0x15d3('0x2b')],qs['fields'](_0x164aa1[_0x15d3('0x2d')]['fields']));_0x6a9c0c[_0x15d3('0x30')]=_0x6a9c0c[_0x15d3('0x30')][_0x15d3('0x31')]?_0x6a9c0c[_0x15d3('0x30')]:_0x5a2ccf[_0x15d3('0x2b')];if(!_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x32')](_0x15d3('0x33'))){_0x6a9c0c[_0x15d3('0x1b')]=qs[_0x15d3('0x1b')](_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x1b')]);_0x6a9c0c[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x164aa1[_0x15d3('0x2d')]['offset']);}_0x6a9c0c[_0x15d3('0x34')]=qs[_0x15d3('0x35')](_0x164aa1['query'][_0x15d3('0x35')]);_0x6a9c0c[_0x15d3('0x36')]=qs[_0x15d3('0x2e')](_['pick'](_0x164aa1[_0x15d3('0x2d')],_0x5a2ccf['filters']),_0x1ad737);if(_0x164aa1[_0x15d3('0x2d')][_0x15d3('0x37')]){_0x6a9c0c['where']=_[_0x15d3('0x38')](_0x6a9c0c[_0x15d3('0x36')],{'$or':_[_0x15d3('0x2c')](_0x1ad737,function(_0x114546){if(_0x114546[_0x15d3('0x29')]!==_0x15d3('0x39')){var _0x4aef99={};_0x4aef99[_0x114546[_0x15d3('0x25')]]={'$like':'%'+_0x164aa1['query'][_0x15d3('0x37')]+'%'};return _0x4aef99;}})});}_0x6a9c0c=_[_0x15d3('0x38')]({},_0x6a9c0c,_0x164aa1[_0x15d3('0x3a')]);var _0x289399={'where':_0x6a9c0c[_0x15d3('0x36')]};return db[_0x15d3('0x26')][_0x15d3('0x1c')](_0x289399)[_0x15d3('0x21')](function(_0x1d5dc4){_0x314c27[_0x15d3('0x1c')]=_0x1d5dc4;if(_0x164aa1['query'][_0x15d3('0x3b')]){_0x6a9c0c[_0x15d3('0x3c')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x6a9c0c);})[_0x15d3('0x21')](function(_0x1df387){_0x314c27[_0x15d3('0x3d')]=_0x1df387;return _0x314c27;})[_0x15d3('0x21')](respondWithFilteredResult(_0x4e5840,_0x6a9c0c))[_0x15d3('0x3e')](handleError(_0x4e5840,null));};exports[_0x15d3('0x3f')]=function(_0x1240e5,_0x442faf){var _0x25fa1d={'raw':![],'where':{'id':_0x1240e5['params']['id']}},_0x26ba7d={};_0x26ba7d[_0x15d3('0x2b')]=_[_0x15d3('0x40')](db['FreshdeskAccount'][_0x15d3('0x27')]);_0x26ba7d['query']=_['keys'](_0x1240e5[_0x15d3('0x2d')]);_0x26ba7d[_0x15d3('0x2e')]=_[_0x15d3('0x2f')](_0x26ba7d['model'],_0x26ba7d[_0x15d3('0x2d')]);_0x25fa1d['attributes']=_[_0x15d3('0x2f')](_0x26ba7d[_0x15d3('0x2b')],qs[_0x15d3('0x41')](_0x1240e5[_0x15d3('0x2d')][_0x15d3('0x41')]));_0x25fa1d['attributes']=_0x25fa1d['attributes']['length']?_0x25fa1d[_0x15d3('0x30')]:_0x26ba7d['model'];if(_0x1240e5[_0x15d3('0x2d')][_0x15d3('0x3b')]){_0x25fa1d[_0x15d3('0x3c')]=[{'all':!![]}];}_0x25fa1d=_['merge']({},_0x25fa1d,_0x1240e5[_0x15d3('0x3a')]);return db[_0x15d3('0x26')][_0x15d3('0x42')](_0x25fa1d)[_0x15d3('0x21')](handleEntityNotFound(_0x442faf,null))[_0x15d3('0x21')](respondWithResult(_0x442faf,null))[_0x15d3('0x3e')](handleError(_0x442faf,null));};exports[_0x15d3('0x43')]=function(_0x46a39a,_0x2ab032){return db[_0x15d3('0x26')][_0x15d3('0x43')](_0x46a39a[_0x15d3('0x44')],{})['then'](respondWithResult(_0x2ab032,0xc9))['catch'](handleError(_0x2ab032,null));};exports[_0x15d3('0x20')]=function(_0x446929,_0x13faa2){if(_0x446929['body']['id']){delete _0x446929['body']['id'];}return db[_0x15d3('0x26')]['find']({'where':{'id':_0x446929[_0x15d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x13faa2,null))[_0x15d3('0x21')](saveUpdates(_0x446929[_0x15d3('0x44')],null))['then'](respondWithResult(_0x13faa2,null))['catch'](handleError(_0x13faa2,null));};exports['destroy']=function(_0x5222bf,_0x5547ab){return db[_0x15d3('0x26')][_0x15d3('0x42')]({'where':{'id':_0x5222bf['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x5547ab,null))[_0x15d3('0x21')](removeEntity(_0x5547ab,null))[_0x15d3('0x3e')](handleError(_0x5547ab,null));};exports['getConfigurations']=function(_0x19d713,_0x42092c,_0x284de9){var _0xaf3949={};var _0x3bc48f={};var _0x22a32b;var _0x5f0a42;return db[_0x15d3('0x26')]['findOne']({'where':{'id':_0x19d713['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x42092c,null))['then'](function(_0x16e6bc){if(_0x16e6bc){_0x22a32b=_0x16e6bc;_0x3bc48f['model']=_[_0x15d3('0x40')](db[_0x15d3('0x46')][_0x15d3('0x27')]);_0x3bc48f[_0x15d3('0x2d')]=_[_0x15d3('0x40')](_0x19d713['query']);_0x3bc48f['filters']=_[_0x15d3('0x2f')](_0x3bc48f['model'],_0x3bc48f[_0x15d3('0x2d')]);_0xaf3949[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x3bc48f[_0x15d3('0x2b')],qs[_0x15d3('0x41')](_0x19d713[_0x15d3('0x2d')][_0x15d3('0x41')]));_0xaf3949['attributes']=_0xaf3949[_0x15d3('0x30')][_0x15d3('0x31')]?_0xaf3949[_0x15d3('0x30')]:_0x3bc48f[_0x15d3('0x2b')];_0xaf3949[_0x15d3('0x34')]=qs['sort'](_0x19d713[_0x15d3('0x2d')]['sort']);_0xaf3949['where']=qs[_0x15d3('0x2e')](_[_0x15d3('0x47')](_0x19d713[_0x15d3('0x2d')],_0x3bc48f[_0x15d3('0x2e')]));if(_0x19d713[_0x15d3('0x2d')]['filter']){_0xaf3949[_0x15d3('0x36')]=_[_0x15d3('0x38')](_0xaf3949[_0x15d3('0x36')],{'$or':_[_0x15d3('0x2c')](_0xaf3949['attributes'],function(_0x4242d4){var _0xdfbb70={};_0xdfbb70[_0x4242d4]={'$like':'%'+_0x19d713[_0x15d3('0x2d')][_0x15d3('0x37')]+'%'};return _0xdfbb70;})});}_0xaf3949=_[_0x15d3('0x38')]({},_0xaf3949,_0x19d713[_0x15d3('0x3a')]);return _0x22a32b[_0x15d3('0x48')](_0xaf3949);}})['then'](function(_0x3311ba){if(_0x3311ba){_0x5f0a42=_0x3311ba['length'];if(!_0x19d713[_0x15d3('0x2d')][_0x15d3('0x32')](_0x15d3('0x33'))){_0xaf3949['limit']=qs[_0x15d3('0x1b')](_0x19d713['query'][_0x15d3('0x1b')]);_0xaf3949[_0x15d3('0x19')]=qs['offset'](_0x19d713[_0x15d3('0x2d')]['offset']);}return _0x22a32b['getConfigurations'](_0xaf3949);}})['then'](function(_0x497811){if(_0x497811){return _0x497811?{'count':_0x5f0a42,'rows':_0x497811}:null;}})[_0x15d3('0x21')](respondWithResult(_0x42092c,null))[_0x15d3('0x3e')](handleError(_0x42092c,null));};exports[_0x15d3('0x49')]=function(_0x3b8ae4,_0x5b6d14,_0x289418){if(_0x3b8ae4[_0x15d3('0x44')]['id']){delete _0x3b8ae4[_0x15d3('0x44')]['id'];}return db[_0x15d3('0x26')]['findOne']({'where':{'id':_0x3b8ae4['params']['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x5b6d14,null))['then'](function(_0xb35426){if(_0xb35426){_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x4a')]=_0xb35426['id'];_0x3b8ae4[_0x15d3('0x44')]['Subjects']=integrations[_0x15d3('0x4b')](_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x4c')],_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x29')]);_0x3b8ae4[_0x15d3('0x44')]['Descriptions']=integrations[_0x15d3('0x4d')](_0x3b8ae4['body'][_0x15d3('0x4c')],_0x3b8ae4[_0x15d3('0x44')][_0x15d3('0x29')]);return db['FreshdeskConfiguration'][_0x15d3('0x43')](_0x3b8ae4[_0x15d3('0x44')],{'include':[{'model':db[_0x15d3('0x4e')],'as':_0x15d3('0x4f')},{'model':db['FreshdeskField'],'as':_0x15d3('0x50')}]});}return null;})[_0x15d3('0x21')](respondWithResult(_0x5b6d14,null))['catch'](handleError(_0x5b6d14,null));};exports['getFields']=function(_0x2ce2e4,_0x4495e7,_0x1af2a5){var _0x1f53a1='';return db['FreshdeskAccount'][_0x15d3('0x51')]({'where':{'id':_0x2ce2e4[_0x15d3('0x45')]['id']},'attributes':['id',_0x15d3('0x52'),'apiKey']})[_0x15d3('0x21')](handleEntityNotFound(_0x4495e7,null))[_0x15d3('0x21')](function(_0x25ce07){if(_0x25ce07){_0x1f53a1=_0x25ce07[_0x15d3('0x52')];var _0x4f67c6=_0x1f53a1[_0x15d3('0x53')](-0x1);if(_0x4f67c6==='/'){_0x1f53a1=_0x1f53a1[_0x15d3('0x54')](0x0,_0x1f53a1[_0x15d3('0x55')](_0x4f67c6));}return rp({'method':'GET','uri':util[_0x15d3('0x56')](_0x15d3('0x57'),_0x1f53a1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x15d3('0x56')](_0x15d3('0x58'),new Buffer(util[_0x15d3('0x56')]('%s:X',_0x25ce07[_0x15d3('0x59')]))[_0x15d3('0x5a')]('base64'))},'json':!![]});}})[_0x15d3('0x21')](function(_0x1bc347){if(_0x1bc347){var _0x1b3ef0=[_0x15d3('0x5b'),_0x15d3('0x5c'),_0x15d3('0x5d'),_0x15d3('0x5e'),_0x15d3('0x17'),_0x15d3('0x5f'),_0x15d3('0x60'),'source',_0x15d3('0x61'),_0x15d3('0x60'),_0x15d3('0x62')];_[_0x15d3('0x63')](_0x1bc347,function(_0x1e18fa){return _0x1b3ef0[_0x15d3('0x64')](_0x1e18fa['name'])||!_0x1e18fa['default']&&_0x1e18fa['type']!==_0x15d3('0x65')&&_0x1e18fa[_0x15d3('0x29')]!==_0x15d3('0x66');});return{'count':_0x1bc347[_0x15d3('0x31')],'rows':_['map'](_0x1bc347,function(_0x1eb63f){return{'id':_0x1eb63f[_0x15d3('0x25')],'name':_0x1eb63f['label'],'custom':!_0x1eb63f[_0x15d3('0x67')],'options':_0x1eb63f[_0x15d3('0x68')]?_[_0x15d3('0x2c')](_0x1eb63f[_0x15d3('0x68')],function(_0x473456){return{'name':_['capitalize'](_0x473456),'value':_0x473456};}):[]};})};}})[_0x15d3('0x21')](respondWithResult(_0x4495e7,null))['catch'](function(_0x1a233c){var _0x484b01=_0x2ce2e4['query'][_0x15d3('0x69')]?0x1f4:_0x1a233c[_0x15d3('0x6a')]||0x1f4;logger[_0x15d3('0x23')](_0x15d3('0x6b'),_0x15d3('0x6c'),_0x484b01,JSON[_0x15d3('0x6d')](_0x1a233c));delete _0x1a233c[_0x15d3('0x25')];if(_0x484b01===0x191){_0x484b01=0x190;}_0x4495e7[_0x15d3('0x17')](_0x484b01)[_0x15d3('0x6e')](_0x2ce2e4['query'][_0x15d3('0x69')]?{'message':_0x15d3('0x6f'),'statusCode':_0x1a233c[_0x15d3('0x6a')]}:_0x1a233c);});}; \ No newline at end of file +var _0x3715=['destroy','sendStatus','error','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','requester','subject','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then'];(function(_0x248188,_0x4daba3){var _0x42e755=function(_0x4b8b64){while(--_0x4b8b64){_0x248188['push'](_0x248188['shift']());}};_0x42e755(++_0x4daba3);}(_0x3715,0xc3));var _0x5371=function(_0x279b20,_0x42649d){_0x279b20=_0x279b20-0x0;var _0x1dae8b=_0x3715[_0x279b20];return _0x1dae8b;};'use strict';var emlformat=require(_0x5371('0x0'));var rimraf=require(_0x5371('0x1'));var zipdir=require(_0x5371('0x2'));var jsonpatch=require(_0x5371('0x3'));var rp=require(_0x5371('0x4'));var moment=require(_0x5371('0x5'));var BPromise=require(_0x5371('0x6'));var Mustache=require(_0x5371('0x7'));var util=require(_0x5371('0x8'));var path=require(_0x5371('0x9'));var sox=require(_0x5371('0xa'));var csv=require(_0x5371('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5371('0xc'));var _=require(_0x5371('0xd'));var squel=require('squel');var crypto=require(_0x5371('0xe'));var jsforce=require(_0x5371('0xf'));var deskjs=require(_0x5371('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5371('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5371('0x12'));var qs=require(_0x5371('0x13'));var as=require(_0x5371('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5371('0x15'))(_0x5371('0x16'));var utils=require(_0x5371('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5371('0x18'));var db=require(_0x5371('0x19'))['db'];var integrations=require(_0x5371('0x1a'));function respondWithStatusCode(_0x1b0a8a,_0x5b4adf){_0x5b4adf=_0x5b4adf||0xcc;return function(_0x445408){if(_0x445408){return _0x1b0a8a['sendStatus'](_0x5b4adf);}return _0x1b0a8a[_0x5371('0x1b')](_0x5b4adf)[_0x5371('0x1c')]();};}function respondWithResult(_0x4c8eb8,_0x4611dd){_0x4611dd=_0x4611dd||0xc8;return function(_0x149994){if(_0x149994){return _0x4c8eb8[_0x5371('0x1b')](_0x4611dd)[_0x5371('0x1d')](_0x149994);}};}function respondWithFilteredResult(_0x178130,_0x41d0c2){return function(_0x33b592){if(_0x33b592){var _0x50bc44=typeof _0x41d0c2[_0x5371('0x1e')]===_0x5371('0x1f')&&typeof _0x41d0c2[_0x5371('0x20')]===_0x5371('0x1f');var _0x426b3c=_0x33b592[_0x5371('0x21')];var _0x21af6c=_0x50bc44?0x0:_0x41d0c2['offset'];var _0x4db4e7=_0x50bc44?_0x33b592[_0x5371('0x21')]:_0x41d0c2['offset']+_0x41d0c2[_0x5371('0x20')];var _0x53e64b;if(_0x4db4e7>=_0x426b3c){_0x4db4e7=_0x426b3c;_0x53e64b=0xc8;}else{_0x53e64b=0xce;}_0x178130[_0x5371('0x1b')](_0x53e64b);return _0x178130[_0x5371('0x22')]('Content-Range',_0x21af6c+'-'+_0x4db4e7+'/'+_0x426b3c)[_0x5371('0x1d')](_0x33b592);}return null;};}function patchUpdates(_0x2c989c){return function(_0x54eae7){try{jsonpatch[_0x5371('0x23')](_0x54eae7,_0x2c989c,!![]);}catch(_0x304bf2){return BPromise[_0x5371('0x24')](_0x304bf2);}return _0x54eae7['save']();};}function saveUpdates(_0x4add7e,_0x4d7dad){return function(_0x3e1137){if(_0x3e1137){return _0x3e1137[_0x5371('0x25')](_0x4add7e)[_0x5371('0x26')](function(_0x2bae28){return _0x2bae28;});}return null;};}function removeEntity(_0x1f0998,_0xabe2a6){return function(_0x5d0298){if(_0x5d0298){return _0x5d0298[_0x5371('0x27')]()['then'](function(){_0x1f0998[_0x5371('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc02f21,_0x427f20){return function(_0x58b0e5){if(!_0x58b0e5){_0xc02f21[_0x5371('0x28')](0x194);}return _0x58b0e5;};}function handleError(_0x2a7a93,_0x30d3c2){_0x30d3c2=_0x30d3c2||0x1f4;return function(_0x1cb98d){logger[_0x5371('0x29')](_0x1cb98d['stack']);if(_0x1cb98d['name']){delete _0x1cb98d[_0x5371('0x2a')];}_0x2a7a93['status'](_0x30d3c2)['send'](_0x1cb98d);};}exports[_0x5371('0x2b')]=function(_0x167280,_0x5a84c1){var _0x311021={},_0x32554f={},_0x1ea613={'count':0x0,'rows':[]};var _0x420bcc=_[_0x5371('0x2c')](db[_0x5371('0x2d')][_0x5371('0x2e')],function(_0x40fd97){return{'name':_0x40fd97[_0x5371('0x2f')],'type':_0x40fd97[_0x5371('0x30')]['key']};});_0x32554f[_0x5371('0x31')]=_['map'](_0x420bcc,_0x5371('0x2a'));_0x32554f['query']=_['keys'](_0x167280[_0x5371('0x32')]);_0x32554f[_0x5371('0x33')]=_[_0x5371('0x34')](_0x32554f[_0x5371('0x31')],_0x32554f[_0x5371('0x32')]);_0x311021[_0x5371('0x35')]=_['intersection'](_0x32554f[_0x5371('0x31')],qs['fields'](_0x167280[_0x5371('0x32')][_0x5371('0x36')]));_0x311021[_0x5371('0x35')]=_0x311021[_0x5371('0x35')][_0x5371('0x37')]?_0x311021[_0x5371('0x35')]:_0x32554f[_0x5371('0x31')];if(!_0x167280['query'][_0x5371('0x38')](_0x5371('0x39'))){_0x311021[_0x5371('0x20')]=qs[_0x5371('0x20')](_0x167280[_0x5371('0x32')][_0x5371('0x20')]);_0x311021[_0x5371('0x1e')]=qs['offset'](_0x167280[_0x5371('0x32')][_0x5371('0x1e')]);}_0x311021['order']=qs[_0x5371('0x3a')](_0x167280[_0x5371('0x32')][_0x5371('0x3a')]);_0x311021[_0x5371('0x3b')]=qs['filters'](_[_0x5371('0x3c')](_0x167280[_0x5371('0x32')],_0x32554f['filters']),_0x420bcc);if(_0x167280[_0x5371('0x32')][_0x5371('0x3d')]){_0x311021[_0x5371('0x3b')]=_[_0x5371('0x3e')](_0x311021[_0x5371('0x3b')],{'$or':_[_0x5371('0x2c')](_0x420bcc,function(_0x46671a){if(_0x46671a[_0x5371('0x30')]!=='VIRTUAL'){var _0x277080={};_0x277080[_0x46671a[_0x5371('0x2a')]]={'$like':'%'+_0x167280[_0x5371('0x32')][_0x5371('0x3d')]+'%'};return _0x277080;}})});}_0x311021=_['merge']({},_0x311021,_0x167280[_0x5371('0x3f')]);var _0x20c54a={'where':_0x311021[_0x5371('0x3b')]};return db[_0x5371('0x2d')][_0x5371('0x21')](_0x20c54a)[_0x5371('0x26')](function(_0x47e390){_0x1ea613[_0x5371('0x21')]=_0x47e390;if(_0x167280[_0x5371('0x32')][_0x5371('0x40')]){_0x311021[_0x5371('0x41')]=[{'all':!![]}];}return db[_0x5371('0x2d')][_0x5371('0x42')](_0x311021);})['then'](function(_0x2cadb7){_0x1ea613[_0x5371('0x43')]=_0x2cadb7;return _0x1ea613;})[_0x5371('0x26')](respondWithFilteredResult(_0x5a84c1,_0x311021))[_0x5371('0x44')](handleError(_0x5a84c1,null));};exports[_0x5371('0x45')]=function(_0x331087,_0x4db26a){var _0x29d7ac={'raw':![],'where':{'id':_0x331087['params']['id']}},_0x480887={};_0x480887[_0x5371('0x31')]=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0x480887[_0x5371('0x32')]=_[_0x5371('0x46')](_0x331087[_0x5371('0x32')]);_0x480887['filters']=_[_0x5371('0x34')](_0x480887[_0x5371('0x31')],_0x480887['query']);_0x29d7ac['attributes']=_[_0x5371('0x34')](_0x480887[_0x5371('0x31')],qs[_0x5371('0x36')](_0x331087[_0x5371('0x32')]['fields']));_0x29d7ac['attributes']=_0x29d7ac['attributes']['length']?_0x29d7ac['attributes']:_0x480887[_0x5371('0x31')];if(_0x331087['query'][_0x5371('0x40')]){_0x29d7ac['include']=[{'all':!![]}];}_0x29d7ac=_[_0x5371('0x3e')]({},_0x29d7ac,_0x331087[_0x5371('0x3f')]);return db[_0x5371('0x2d')][_0x5371('0x47')](_0x29d7ac)['then'](handleEntityNotFound(_0x4db26a,null))[_0x5371('0x26')](respondWithResult(_0x4db26a,null))[_0x5371('0x44')](handleError(_0x4db26a,null));};exports['create']=function(_0x389bb8,_0x3305ba){return db['FreshdeskAccount'][_0x5371('0x48')](_0x389bb8['body'],{})['then'](respondWithResult(_0x3305ba,0xc9))[_0x5371('0x44')](handleError(_0x3305ba,null));};exports[_0x5371('0x25')]=function(_0x2daa6e,_0x1463c6){if(_0x2daa6e[_0x5371('0x49')]['id']){delete _0x2daa6e[_0x5371('0x49')]['id'];}return db[_0x5371('0x2d')]['find']({'where':{'id':_0x2daa6e[_0x5371('0x4a')]['id']}})[_0x5371('0x26')](handleEntityNotFound(_0x1463c6,null))[_0x5371('0x26')](saveUpdates(_0x2daa6e['body'],null))['then'](respondWithResult(_0x1463c6,null))[_0x5371('0x44')](handleError(_0x1463c6,null));};exports[_0x5371('0x27')]=function(_0x5e39d2,_0x2839f9){return db['FreshdeskAccount'][_0x5371('0x47')]({'where':{'id':_0x5e39d2[_0x5371('0x4a')]['id']}})[_0x5371('0x26')](handleEntityNotFound(_0x2839f9,null))[_0x5371('0x26')](removeEntity(_0x2839f9,null))['catch'](handleError(_0x2839f9,null));};exports[_0x5371('0x4b')]=function(_0x4f9227,_0x53b1a2,_0x3a6b7c){var _0x442f4d={};var _0x148945={};var _0x491189;var _0x1a2512;return db['FreshdeskAccount'][_0x5371('0x4c')]({'where':{'id':_0x4f9227[_0x5371('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53b1a2,null))[_0x5371('0x26')](function(_0x21df3f){if(_0x21df3f){_0x491189=_0x21df3f;_0x148945['model']=_['keys'](db[_0x5371('0x4d')][_0x5371('0x2e')]);_0x148945[_0x5371('0x32')]=_['keys'](_0x4f9227['query']);_0x148945['filters']=_[_0x5371('0x34')](_0x148945[_0x5371('0x31')],_0x148945[_0x5371('0x32')]);_0x442f4d[_0x5371('0x35')]=_[_0x5371('0x34')](_0x148945[_0x5371('0x31')],qs['fields'](_0x4f9227[_0x5371('0x32')]['fields']));_0x442f4d['attributes']=_0x442f4d['attributes'][_0x5371('0x37')]?_0x442f4d['attributes']:_0x148945[_0x5371('0x31')];_0x442f4d[_0x5371('0x4e')]=qs[_0x5371('0x3a')](_0x4f9227[_0x5371('0x32')][_0x5371('0x3a')]);_0x442f4d[_0x5371('0x3b')]=qs['filters'](_[_0x5371('0x3c')](_0x4f9227[_0x5371('0x32')],_0x148945['filters']));if(_0x4f9227['query']['filter']){_0x442f4d[_0x5371('0x3b')]=_[_0x5371('0x3e')](_0x442f4d['where'],{'$or':_['map'](_0x442f4d[_0x5371('0x35')],function(_0x5dbcf3){var _0x333546={};_0x333546[_0x5dbcf3]={'$like':'%'+_0x4f9227['query'][_0x5371('0x3d')]+'%'};return _0x333546;})});}_0x442f4d=_[_0x5371('0x3e')]({},_0x442f4d,_0x4f9227[_0x5371('0x3f')]);return _0x491189[_0x5371('0x4b')](_0x442f4d);}})[_0x5371('0x26')](function(_0x332ce4){if(_0x332ce4){_0x1a2512=_0x332ce4[_0x5371('0x37')];if(!_0x4f9227[_0x5371('0x32')][_0x5371('0x38')]('nolimit')){_0x442f4d[_0x5371('0x20')]=qs[_0x5371('0x20')](_0x4f9227['query'][_0x5371('0x20')]);_0x442f4d['offset']=qs[_0x5371('0x1e')](_0x4f9227[_0x5371('0x32')]['offset']);}return _0x491189[_0x5371('0x4b')](_0x442f4d);}})[_0x5371('0x26')](function(_0x2e907d){if(_0x2e907d){return _0x2e907d?{'count':_0x1a2512,'rows':_0x2e907d}:null;}})[_0x5371('0x26')](respondWithResult(_0x53b1a2,null))['catch'](handleError(_0x53b1a2,null));};exports[_0x5371('0x4f')]=function(_0x203f0b,_0x1d4de3,_0x211ba1){if(_0x203f0b[_0x5371('0x49')]['id']){delete _0x203f0b[_0x5371('0x49')]['id'];}return db[_0x5371('0x2d')][_0x5371('0x4c')]({'where':{'id':_0x203f0b[_0x5371('0x4a')]['id']}})[_0x5371('0x26')](handleEntityNotFound(_0x1d4de3,null))[_0x5371('0x26')](function(_0x2cf085){if(_0x2cf085){_0x203f0b['body'][_0x5371('0x50')]=_0x2cf085['id'];_0x203f0b['body'][_0x5371('0x51')]=integrations[_0x5371('0x52')](_0x203f0b[_0x5371('0x49')][_0x5371('0x53')],_0x203f0b[_0x5371('0x49')][_0x5371('0x30')]);_0x203f0b[_0x5371('0x49')]['Descriptions']=integrations['getDescriptions'](_0x203f0b[_0x5371('0x49')][_0x5371('0x53')],_0x203f0b[_0x5371('0x49')]['type']);return db['FreshdeskConfiguration'][_0x5371('0x48')](_0x203f0b['body'],{'include':[{'model':db[_0x5371('0x54')],'as':'Subjects'},{'model':db[_0x5371('0x54')],'as':_0x5371('0x55')}]});}return null;})['then'](respondWithResult(_0x1d4de3,null))[_0x5371('0x44')](handleError(_0x1d4de3,null));};exports[_0x5371('0x56')]=function(_0xb8ac67,_0x43e5aa,_0x11d4a3){var _0x387368='';return db[_0x5371('0x2d')][_0x5371('0x4c')]({'where':{'id':_0xb8ac67['params']['id']},'attributes':['id',_0x5371('0x57'),_0x5371('0x58')]})[_0x5371('0x26')](handleEntityNotFound(_0x43e5aa,null))[_0x5371('0x26')](function(_0x21db17){if(_0x21db17){_0x387368=_0x21db17[_0x5371('0x57')];var _0x5b3ab4=_0x387368[_0x5371('0x59')](-0x1);if(_0x5b3ab4==='/'){_0x387368=_0x387368['substring'](0x0,_0x387368[_0x5371('0x5a')](_0x5b3ab4));}return rp({'method':_0x5371('0x5b'),'uri':util['format'](_0x5371('0x5c'),_0x387368,_0x5371('0x5d')),'headers':{'Authorization':util[_0x5371('0x5e')](_0x5371('0x5f'),new Buffer(util[_0x5371('0x5e')](_0x5371('0x60'),_0x21db17['apiKey']))['toString'](_0x5371('0x61')))},'json':!![]});}})[_0x5371('0x26')](function(_0x50508d){if(_0x50508d){var _0x1decb8=[_0x5371('0x62'),_0x5371('0x63'),'agent',_0x5371('0x64'),_0x5371('0x1b'),_0x5371('0x65'),_0x5371('0x66'),_0x5371('0x67'),_0x5371('0x68'),'group',_0x5371('0x69')];_['remove'](_0x50508d,function(_0x3c7642){return _0x1decb8[_0x5371('0x6a')](_0x3c7642['name'])||!_0x3c7642[_0x5371('0x6b')]&&_0x3c7642['type']!==_0x5371('0x6c')&&_0x3c7642[_0x5371('0x30')]!==_0x5371('0x6d');});return{'count':_0x50508d['length'],'rows':_['map'](_0x50508d,function(_0x3c8cf9){return{'id':_0x3c8cf9[_0x5371('0x2a')],'name':_0x3c8cf9[_0x5371('0x6e')],'custom':!_0x3c8cf9[_0x5371('0x6b')],'options':_0x3c8cf9[_0x5371('0x6f')]?_['map'](_0x3c8cf9[_0x5371('0x6f')],function(_0x12164c){return{'name':_[_0x5371('0x70')](_0x12164c),'value':_0x12164c};}):[]};})};}})[_0x5371('0x26')](respondWithResult(_0x43e5aa,null))['catch'](function(_0x379232){var _0x3ed2e1=_0xb8ac67[_0x5371('0x32')][_0x5371('0x71')]?0x1f4:_0x379232['statusCode']||0x1f4;logger[_0x5371('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x5371('0x56'),_0x3ed2e1,JSON[_0x5371('0x72')](_0x379232));delete _0x379232['name'];if(_0x3ed2e1===0x191){_0x3ed2e1=0x190;}_0x43e5aa[_0x5371('0x1b')](_0x3ed2e1)['send'](_0xb8ac67[_0x5371('0x32')]['test']?{'message':_0x5371('0x73'),'statusCode':_0x379232[_0x5371('0x74')]}:_0x379232);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e46b46b..ac098c5 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 _0x3a39=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','bluebird','path'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x3a39,0x187));var _0x93a3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3a39[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x93a3('0x0'));var util=require(_0x93a3('0x1'));var logger=require('../../config/logger')(_0x93a3('0x2'));var moment=require('moment');var BPromise=require(_0x93a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93a3('0x4'));var rimraf=require(_0x93a3('0x5'));var config=require(_0x93a3('0x6'));var attributes=require(_0x93a3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x93a3('0x8')]=function(_0x11ce0f,_0x148bfb){return _0x11ce0f[_0x93a3('0x9')](_0x93a3('0xa'),attributes,{'tableName':_0x93a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1637=['moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x2aacd9,_0x5d455d){var _0x37bdd6=function(_0x5479e2){while(--_0x5479e2){_0x2aacd9['push'](_0x2aacd9['shift']());}};_0x37bdd6(++_0x5d455d);}(_0x1637,0x1e6));var _0x7163=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x1637[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x7163('0x0'));var util=require(_0x7163('0x1'));var logger=require(_0x7163('0x2'))(_0x7163('0x3'));var moment=require(_0x7163('0x4'));var BPromise=require(_0x7163('0x5'));var rp=require(_0x7163('0x6'));var fs=require('fs');var path=require(_0x7163('0x7'));var rimraf=require('rimraf');var config=require(_0x7163('0x8'));var attributes=require(_0x7163('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x7163('0xa')]=function(_0x1611ea,_0x2a4823){return _0x1611ea[_0x7163('0xb')](_0x7163('0xc'),attributes,{'tableName':_0x7163('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 8f297d3..0da67a1 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 _0xf430=['GetFreshdeskAccount','FreshdeskAccount','options','raw','limit','map','model','attributes','include','then','ShowFreshdeskAccount','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf430,0x102));var _0x0f43=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xf430[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f43('0x0'));var BPromise=require(_0x0f43('0x1'));var rs=require(_0x0f43('0x2'));var fs=require('fs');var Redis=require(_0x0f43('0x3'));var db=require(_0x0f43('0x4'))['db'];var utils=require(_0x0f43('0x5'));var logger=require(_0x0f43('0x6'))(_0x0f43('0x7'));var config=require(_0x0f43('0x8'));var jayson=require(_0x0f43('0x9'));var client=jayson[_0x0f43('0xa')][_0x0f43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d9aa8,_0x3187dc,_0x54eb20){return new BPromise(function(_0x314c47,_0x24909d){return client['request'](_0x3d9aa8,_0x54eb20)['then'](function(_0x47c50d){logger[_0x0f43('0xc')](_0x0f43('0xd'),_0x3187dc,'request\x20sent');logger[_0x0f43('0xe')](_0x0f43('0xf'),_0x3187dc,_0x0f43('0x10'),JSON[_0x0f43('0x11')](_0x47c50d));if(_0x47c50d[_0x0f43('0x12')]){if(_0x47c50d[_0x0f43('0x12')]['code']===0x1f4){logger[_0x0f43('0x12')](_0x0f43('0xd'),_0x3187dc,_0x47c50d[_0x0f43('0x12')][_0x0f43('0x13')]);return _0x24909d(_0x47c50d[_0x0f43('0x12')][_0x0f43('0x13')]);}logger[_0x0f43('0x12')](_0x0f43('0xd'),_0x3187dc,_0x47c50d[_0x0f43('0x12')][_0x0f43('0x13')]);return _0x314c47(_0x47c50d['error'][_0x0f43('0x13')]);}else{logger['info'](_0x0f43('0xd'),_0x3187dc,_0x0f43('0x10'));_0x314c47(_0x47c50d[_0x0f43('0x14')]['message']);}})[_0x0f43('0x15')](function(_0x1c1cc0){logger[_0x0f43('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x3187dc,_0x1c1cc0);_0x24909d(_0x1c1cc0);});});}exports[_0x0f43('0x16')]=function(_0x3dbf13){var _0x36b751=this;return new Promise(function(_0x19ffec,_0x3ae967){return db[_0x0f43('0x17')]['findAll']({'raw':_0x3dbf13[_0x0f43('0x18')]?_0x3dbf13[_0x0f43('0x18')][_0x0f43('0x19')]===undefined?!![]:![]:!![],'where':_0x3dbf13[_0x0f43('0x18')]?_0x3dbf13[_0x0f43('0x18')]['where']||null:null,'attributes':_0x3dbf13['options']?_0x3dbf13[_0x0f43('0x18')]['attributes']||null:null,'limit':_0x3dbf13[_0x0f43('0x18')]?_0x3dbf13['options'][_0x0f43('0x1a')]||null:null,'include':_0x3dbf13[_0x0f43('0x18')]?_0x3dbf13[_0x0f43('0x18')]['include']?_[_0x0f43('0x1b')](_0x3dbf13['options']['include'],function(_0x1662ba){return{'model':db[_0x1662ba['model']],'as':_0x1662ba['as'],'attributes':_0x1662ba['attributes'],'include':_0x1662ba['include']?_[_0x0f43('0x1b')](_0x1662ba['include'],function(_0x5dd9da){return{'model':db[_0x5dd9da[_0x0f43('0x1c')]],'as':_0x5dd9da['as'],'attributes':_0x5dd9da[_0x0f43('0x1d')],'include':_0x5dd9da[_0x0f43('0x1e')]?_[_0x0f43('0x1b')](_0x5dd9da[_0x0f43('0x1e')],function(_0xa03854){return{'model':db[_0xa03854['model']],'as':_0xa03854['as'],'attributes':_0xa03854[_0x0f43('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f43('0x1f')](function(_0x9c23c3){logger[_0x0f43('0xc')](_0x0f43('0x16'),_0x3dbf13);logger['debug'](_0x0f43('0x16'),_0x3dbf13,JSON[_0x0f43('0x11')](_0x9c23c3));_0x19ffec(_0x9c23c3);})[_0x0f43('0x15')](function(_0x2e15f9){logger[_0x0f43('0x12')](_0x0f43('0x16'),_0x2e15f9[_0x0f43('0x13')],_0x3dbf13);_0x3ae967(_0x36b751[_0x0f43('0x12')](0x1f4,_0x2e15f9[_0x0f43('0x13')]));});});};exports[_0x0f43('0x20')]=function(_0x327712){var _0x5b578b=this;return new Promise(function(_0x560184,_0xacc522){return db[_0x0f43('0x17')][_0x0f43('0x21')]({'raw':_0x327712[_0x0f43('0x18')]?_0x327712[_0x0f43('0x18')][_0x0f43('0x19')]===undefined?!![]:![]:!![],'where':_0x327712['options']?_0x327712[_0x0f43('0x18')][_0x0f43('0x22')]||null:null,'attributes':_0x327712[_0x0f43('0x18')]?_0x327712[_0x0f43('0x18')][_0x0f43('0x1d')]||null:null,'include':_0x327712[_0x0f43('0x18')]?_0x327712[_0x0f43('0x18')]['include']?_[_0x0f43('0x1b')](_0x327712['options'][_0x0f43('0x1e')],function(_0x4d76df){return{'model':db[_0x4d76df[_0x0f43('0x1c')]],'as':_0x4d76df['as'],'attributes':_0x4d76df[_0x0f43('0x1d')],'include':_0x4d76df[_0x0f43('0x1e')]?_[_0x0f43('0x1b')](_0x4d76df[_0x0f43('0x1e')],function(_0x2eb19b){return{'model':db[_0x2eb19b[_0x0f43('0x1c')]],'as':_0x2eb19b['as'],'attributes':_0x2eb19b[_0x0f43('0x1d')],'include':_0x2eb19b[_0x0f43('0x1e')]?_[_0x0f43('0x1b')](_0x2eb19b[_0x0f43('0x1e')],function(_0x579b71){return{'model':db[_0x579b71['model']],'as':_0x579b71['as'],'attributes':_0x579b71[_0x0f43('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f43('0x1f')](function(_0x4162eb){logger[_0x0f43('0xc')](_0x0f43('0x20'),_0x327712);logger[_0x0f43('0xe')](_0x0f43('0x20'),_0x327712,JSON[_0x0f43('0x11')](_0x4162eb));_0x560184(_0x4162eb);})['catch'](function(_0xc614c){logger[_0x0f43('0x12')](_0x0f43('0x20'),_0xc614c[_0x0f43('0x13')],_0x327712);_0xacc522(_0x5b578b[_0x0f43('0x12')](0x1f4,_0xc614c[_0x0f43('0x13')]));});});}; \ No newline at end of file +var _0x8508=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','options','raw','where','attributes','map','include','model','catch','ShowFreshdeskAccount','FreshdeskAccount','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x500d35,_0x3f5d69){var _0x383af4=function(_0x22c7e9){while(--_0x22c7e9){_0x500d35['push'](_0x500d35['shift']());}};_0x383af4(++_0x3f5d69);}(_0x8508,0x166));var _0x8850=function(_0x4b762e,_0x578af0){_0x4b762e=_0x4b762e-0x0;var _0x50ac2d=_0x8508[_0x4b762e];return _0x50ac2d;};'use strict';var _=require(_0x8850('0x0'));var util=require(_0x8850('0x1'));var moment=require(_0x8850('0x2'));var BPromise=require(_0x8850('0x3'));var rs=require(_0x8850('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8850('0x5'))['db'];var utils=require(_0x8850('0x6'));var logger=require(_0x8850('0x7'))(_0x8850('0x8'));var config=require(_0x8850('0x9'));var jayson=require(_0x8850('0xa'));var client=jayson[_0x8850('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa4c7cb,_0x1d1c05,_0x4f5da6){return new BPromise(function(_0x150ccb,_0x5af074){return client[_0x8850('0xc')](_0xa4c7cb,_0x4f5da6)['then'](function(_0x164af0){logger[_0x8850('0xd')](_0x8850('0xe'),_0x1d1c05,_0x8850('0xf'));logger[_0x8850('0x10')](_0x8850('0x11'),_0x1d1c05,_0x8850('0xf'),JSON[_0x8850('0x12')](_0x164af0));if(_0x164af0['error']){if(_0x164af0['error']['code']===0x1f4){logger[_0x8850('0x13')](_0x8850('0xe'),_0x1d1c05,_0x164af0[_0x8850('0x13')][_0x8850('0x14')]);return _0x5af074(_0x164af0[_0x8850('0x13')][_0x8850('0x14')]);}logger['error'](_0x8850('0xe'),_0x1d1c05,_0x164af0['error'][_0x8850('0x14')]);return _0x150ccb(_0x164af0[_0x8850('0x13')][_0x8850('0x14')]);}else{logger[_0x8850('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x1d1c05,_0x8850('0xf'));_0x150ccb(_0x164af0[_0x8850('0x15')][_0x8850('0x14')]);}})['catch'](function(_0x4c4914){logger[_0x8850('0x13')](_0x8850('0xe'),_0x1d1c05,_0x4c4914);_0x5af074(_0x4c4914);});});}exports[_0x8850('0x16')]=function(_0x108a6a){var _0x4c255c=this;return new Promise(function(_0x155d7f,_0xcda8b4){return db['FreshdeskAccount']['findAll']({'raw':_0x108a6a[_0x8850('0x17')]?_0x108a6a[_0x8850('0x17')][_0x8850('0x18')]===undefined?!![]:![]:!![],'where':_0x108a6a[_0x8850('0x17')]?_0x108a6a[_0x8850('0x17')][_0x8850('0x19')]||null:null,'attributes':_0x108a6a[_0x8850('0x17')]?_0x108a6a[_0x8850('0x17')][_0x8850('0x1a')]||null:null,'limit':_0x108a6a[_0x8850('0x17')]?_0x108a6a[_0x8850('0x17')]['limit']||null:null,'include':_0x108a6a[_0x8850('0x17')]?_0x108a6a[_0x8850('0x17')]['include']?_[_0x8850('0x1b')](_0x108a6a[_0x8850('0x17')][_0x8850('0x1c')],function(_0xb1c408){return{'model':db[_0xb1c408[_0x8850('0x1d')]],'as':_0xb1c408['as'],'attributes':_0xb1c408[_0x8850('0x1a')],'include':_0xb1c408[_0x8850('0x1c')]?_[_0x8850('0x1b')](_0xb1c408['include'],function(_0x13240f){return{'model':db[_0x13240f[_0x8850('0x1d')]],'as':_0x13240f['as'],'attributes':_0x13240f['attributes'],'include':_0x13240f[_0x8850('0x1c')]?_[_0x8850('0x1b')](_0x13240f['include'],function(_0x55852e){return{'model':db[_0x55852e['model']],'as':_0x55852e['as'],'attributes':_0x55852e[_0x8850('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f2cdd){logger[_0x8850('0xd')](_0x8850('0x16'),_0x108a6a);logger[_0x8850('0x10')](_0x8850('0x16'),_0x108a6a,JSON['stringify'](_0x2f2cdd));_0x155d7f(_0x2f2cdd);})[_0x8850('0x1e')](function(_0x5e3bc1){logger[_0x8850('0x13')](_0x8850('0x16'),_0x5e3bc1['message'],_0x108a6a);_0xcda8b4(_0x4c255c[_0x8850('0x13')](0x1f4,_0x5e3bc1[_0x8850('0x14')]));});});};exports[_0x8850('0x1f')]=function(_0x18aa93){var _0x48ab55=this;return new Promise(function(_0x1d9c3e,_0x1427cb){return db[_0x8850('0x20')]['find']({'raw':_0x18aa93[_0x8850('0x17')]?_0x18aa93['options'][_0x8850('0x18')]===undefined?!![]:![]:!![],'where':_0x18aa93[_0x8850('0x17')]?_0x18aa93['options'][_0x8850('0x19')]||null:null,'attributes':_0x18aa93['options']?_0x18aa93[_0x8850('0x17')][_0x8850('0x1a')]||null:null,'include':_0x18aa93[_0x8850('0x17')]?_0x18aa93[_0x8850('0x17')]['include']?_[_0x8850('0x1b')](_0x18aa93[_0x8850('0x17')][_0x8850('0x1c')],function(_0x4d1462){return{'model':db[_0x4d1462[_0x8850('0x1d')]],'as':_0x4d1462['as'],'attributes':_0x4d1462[_0x8850('0x1a')],'include':_0x4d1462[_0x8850('0x1c')]?_[_0x8850('0x1b')](_0x4d1462[_0x8850('0x1c')],function(_0x1a3616){return{'model':db[_0x1a3616[_0x8850('0x1d')]],'as':_0x1a3616['as'],'attributes':_0x1a3616['attributes'],'include':_0x1a3616['include']?_['map'](_0x1a3616['include'],function(_0x3ab575){return{'model':db[_0x3ab575['model']],'as':_0x3ab575['as'],'attributes':_0x3ab575[_0x8850('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8850('0x21')](function(_0x395faa){logger['info'](_0x8850('0x1f'),_0x18aa93);logger[_0x8850('0x10')](_0x8850('0x1f'),_0x18aa93,JSON[_0x8850('0x12')](_0x395faa));_0x1d9c3e(_0x395faa);})[_0x8850('0x1e')](function(_0x3218ef){logger[_0x8850('0x13')](_0x8850('0x1f'),_0x3218ef[_0x8850('0x14')],_0x18aa93);_0x1427cb(_0x48ab55['error'](0x1f4,_0x3218ef[_0x8850('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 93bd78a..d9e3da9 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 _0x24d1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xe83ac5,_0x279b67){var _0x3df16e=function(_0x5a1577){while(--_0x5a1577){_0xe83ac5['push'](_0xe83ac5['shift']());}};_0x3df16e(++_0x279b67);}(_0x24d1,0x113));var _0x124d=function(_0x41896b,_0x17bb83){_0x41896b=_0x41896b-0x0;var _0xad6a93=_0x24d1[_0x41896b];return _0xad6a93;};'use strict';var multer=require(_0x124d('0x0'));var util=require(_0x124d('0x1'));var path=require(_0x124d('0x2'));var timeout=require(_0x124d('0x3'));var express=require(_0x124d('0x4'));var router=express[_0x124d('0x5')]();var fs_extra=require(_0x124d('0x6'));var auth=require(_0x124d('0x7'));var interaction=require(_0x124d('0x8'));var config=require(_0x124d('0x9'));var controller=require(_0x124d('0xa'));router[_0x124d('0xb')]('/',auth['isAuthenticated'](),controller[_0x124d('0xc')]);router[_0x124d('0xb')](_0x124d('0xd'),auth[_0x124d('0xe')](),controller[_0x124d('0xf')]);router['get'](_0x124d('0x10'),auth['isAuthenticated'](),controller[_0x124d('0x11')]);router[_0x124d('0xb')](_0x124d('0x12'),auth[_0x124d('0xe')](),controller[_0x124d('0x13')]);router[_0x124d('0xb')](_0x124d('0x14'),auth[_0x124d('0xe')](),controller[_0x124d('0x15')]);router[_0x124d('0xb')](_0x124d('0x16'),auth[_0x124d('0xe')](),controller[_0x124d('0x17')]);router[_0x124d('0x18')]('/',auth[_0x124d('0xe')](),controller[_0x124d('0x19')]);router[_0x124d('0x18')](_0x124d('0x16'),auth['isAuthenticated'](),controller['setTags']);router[_0x124d('0x1a')](_0x124d('0xd'),auth[_0x124d('0xe')](),controller[_0x124d('0x1b')]);router[_0x124d('0x1c')](_0x124d('0xd'),auth[_0x124d('0xe')](),controller[_0x124d('0x1d')]);module[_0x124d('0x1e')]=router; \ No newline at end of file +var _0xf06e=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create'];(function(_0x5f591f,_0x4d296c){var _0x126a13=function(_0x5e8169){while(--_0x5e8169){_0x5f591f['push'](_0x5f591f['shift']());}};_0x126a13(++_0x4d296c);}(_0xf06e,0xe9));var _0xef06=function(_0x329cf6,_0x59174b){_0x329cf6=_0x329cf6-0x0;var _0xd4bf90=_0xf06e[_0x329cf6];return _0xd4bf90;};'use strict';var multer=require('multer');var util=require(_0xef06('0x0'));var path=require('path');var timeout=require(_0xef06('0x1'));var express=require(_0xef06('0x2'));var router=express[_0xef06('0x3')]();var fs_extra=require(_0xef06('0x4'));var auth=require(_0xef06('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef06('0x6'));router[_0xef06('0x7')]('/',auth[_0xef06('0x8')](),controller[_0xef06('0x9')]);router[_0xef06('0x7')](_0xef06('0xa'),auth[_0xef06('0x8')](),controller[_0xef06('0xb')]);router[_0xef06('0x7')](_0xef06('0xc'),auth[_0xef06('0x8')](),controller[_0xef06('0xd')]);router[_0xef06('0x7')](_0xef06('0xe'),auth[_0xef06('0x8')](),controller['getSubjects']);router[_0xef06('0x7')]('/:id/descriptions',auth[_0xef06('0x8')](),controller[_0xef06('0xf')]);router[_0xef06('0x7')](_0xef06('0x10'),auth[_0xef06('0x8')](),controller[_0xef06('0x11')]);router[_0xef06('0x12')]('/',auth['isAuthenticated'](),controller[_0xef06('0x13')]);router['post'](_0xef06('0x10'),auth[_0xef06('0x8')](),controller['setTags']);router['put'](_0xef06('0xa'),auth[_0xef06('0x8')](),controller[_0xef06('0x14')]);router['delete'](_0xef06('0xa'),auth[_0xef06('0x8')](),controller[_0xef06('0x15')]);module[_0xef06('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0c5b91b..f5bd085 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 _0xcbcc=['sequelize','STRING'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xcbcc,0x128));var _0xccbc=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xcbcc[_0x4b7895];return _0x264180;};'use strict';var Sequelize=require(_0xccbc('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xccbc('0x1')]}}; \ No newline at end of file +var _0xc95d=['exports','STRING','sequelize'];(function(_0x20255f,_0x40ced2){var _0x4f4712=function(_0x173f70){while(--_0x173f70){_0x20255f['push'](_0x20255f['shift']());}};_0x4f4712(++_0x40ced2);}(_0xc95d,0x6b));var _0xdc95=function(_0x7a8f99,_0x2d74ea){_0x7a8f99=_0x7a8f99-0x0;var _0x112209=_0xc95d[_0x7a8f99];return _0x112209;};'use strict';var Sequelize=require(_0xdc95('0x0'));module[_0xdc95('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdc95('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 3f19276..9ecca88 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 _0x016b=['merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x40561c,_0x88888f){var _0x10151f=function(_0x5b7e21){while(--_0x5b7e21){_0x40561c['push'](_0x40561c['shift']());}};_0x10151f(++_0x88888f);}(_0x016b,0xbc));var _0xb016=function(_0x4c05fd,_0x42151a){_0x4c05fd=_0x4c05fd-0x0;var _0x59b2d0=_0x016b[_0x4c05fd];return _0x59b2d0;};'use strict';var emlformat=require(_0xb016('0x0'));var rimraf=require(_0xb016('0x1'));var zipdir=require(_0xb016('0x2'));var jsonpatch=require(_0xb016('0x3'));var rp=require(_0xb016('0x4'));var moment=require(_0xb016('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb016('0x6'));var path=require(_0xb016('0x7'));var sox=require(_0xb016('0x8'));var csv=require(_0xb016('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb016('0xa'));var _=require(_0xb016('0xb'));var squel=require(_0xb016('0xc'));var crypto=require(_0xb016('0xd'));var jsforce=require(_0xb016('0xe'));var deskjs=require(_0xb016('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb016('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb016('0x11'));var qs=require(_0xb016('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb016('0x13'));var logger=require('../../config/logger')(_0xb016('0x14'));var utils=require(_0xb016('0x15'));var config=require(_0xb016('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb016('0x17'))['db'];function respondWithStatusCode(_0x169a55,_0x461ae6){_0x461ae6=_0x461ae6||0xcc;return function(_0x2d11dc){if(_0x2d11dc){return _0x169a55[_0xb016('0x18')](_0x461ae6);}return _0x169a55[_0xb016('0x19')](_0x461ae6)[_0xb016('0x1a')]();};}function respondWithResult(_0x35a351,_0xd1cb60){_0xd1cb60=_0xd1cb60||0xc8;return function(_0x280c26){if(_0x280c26){return _0x35a351['status'](_0xd1cb60)[_0xb016('0x1b')](_0x280c26);}};}function respondWithFilteredResult(_0x5a0775,_0x57afe4){return function(_0x5b259f){if(_0x5b259f){var _0x147fe4=typeof _0x57afe4[_0xb016('0x1c')]===_0xb016('0x1d')&&typeof _0x57afe4[_0xb016('0x1e')]===_0xb016('0x1d');var _0x6acbff=_0x5b259f[_0xb016('0x1f')];var _0x96f839=_0x147fe4?0x0:_0x57afe4[_0xb016('0x1c')];var _0x299a21=_0x147fe4?_0x5b259f[_0xb016('0x1f')]:_0x57afe4[_0xb016('0x1c')]+_0x57afe4[_0xb016('0x1e')];var _0x9b147d;if(_0x299a21>=_0x6acbff){_0x299a21=_0x6acbff;_0x9b147d=0xc8;}else{_0x9b147d=0xce;}_0x5a0775['status'](_0x9b147d);return _0x5a0775[_0xb016('0x20')]('Content-Range',_0x96f839+'-'+_0x299a21+'/'+_0x6acbff)['json'](_0x5b259f);}return null;};}function patchUpdates(_0x4ee72b){return function(_0x36228e){try{jsonpatch[_0xb016('0x21')](_0x36228e,_0x4ee72b,!![]);}catch(_0x3a1ef6){return BPromise[_0xb016('0x22')](_0x3a1ef6);}return _0x36228e['save']();};}function saveUpdates(_0x56f431,_0x24d113){return function(_0x3bd4cb){if(_0x3bd4cb){return _0x3bd4cb[_0xb016('0x23')](_0x56f431)[_0xb016('0x24')](function(_0x2c5239){return _0x2c5239;});}return null;};}function removeEntity(_0x58c09b,_0x206f49){return function(_0x35e573){if(_0x35e573){return _0x35e573['destroy']()[_0xb016('0x24')](function(){_0x58c09b[_0xb016('0x19')](0xcc)[_0xb016('0x1a')]();});}};}function handleEntityNotFound(_0x34e80a,_0x47ecd9){return function(_0x30cb0a){if(!_0x30cb0a){_0x34e80a[_0xb016('0x18')](0x194);}return _0x30cb0a;};}function handleError(_0xec4e69,_0x21afb0){_0x21afb0=_0x21afb0||0x1f4;return function(_0x687f23){logger['error'](_0x687f23[_0xb016('0x25')]);if(_0x687f23[_0xb016('0x26')]){delete _0x687f23[_0xb016('0x26')];}_0xec4e69[_0xb016('0x19')](_0x21afb0)[_0xb016('0x27')](_0x687f23);};}exports[_0xb016('0x28')]=function(_0x4273ea,_0x4f77f3){var _0x46313b={},_0xe92935={},_0x5d7149={'count':0x0,'rows':[]};var _0x56273c=_[_0xb016('0x29')](db[_0xb016('0x2a')][_0xb016('0x2b')],function(_0x3cb549){return{'name':_0x3cb549[_0xb016('0x2c')],'type':_0x3cb549[_0xb016('0x2d')][_0xb016('0x2e')]};});_0xe92935[_0xb016('0x2f')]=_[_0xb016('0x29')](_0x56273c,_0xb016('0x26'));_0xe92935[_0xb016('0x30')]=_[_0xb016('0x31')](_0x4273ea[_0xb016('0x30')]);_0xe92935[_0xb016('0x32')]=_[_0xb016('0x33')](_0xe92935[_0xb016('0x2f')],_0xe92935[_0xb016('0x30')]);_0x46313b[_0xb016('0x34')]=_[_0xb016('0x33')](_0xe92935[_0xb016('0x2f')],qs[_0xb016('0x35')](_0x4273ea[_0xb016('0x30')][_0xb016('0x35')]));_0x46313b[_0xb016('0x34')]=_0x46313b[_0xb016('0x34')][_0xb016('0x36')]?_0x46313b['attributes']:_0xe92935[_0xb016('0x2f')];if(!_0x4273ea[_0xb016('0x30')]['hasOwnProperty'](_0xb016('0x37'))){_0x46313b['limit']=qs[_0xb016('0x1e')](_0x4273ea[_0xb016('0x30')]['limit']);_0x46313b[_0xb016('0x1c')]=qs[_0xb016('0x1c')](_0x4273ea[_0xb016('0x30')]['offset']);}_0x46313b[_0xb016('0x38')]=qs[_0xb016('0x39')](_0x4273ea[_0xb016('0x30')][_0xb016('0x39')]);_0x46313b[_0xb016('0x3a')]=qs[_0xb016('0x32')](_[_0xb016('0x3b')](_0x4273ea[_0xb016('0x30')],_0xe92935[_0xb016('0x32')]),_0x56273c);if(_0x4273ea[_0xb016('0x30')][_0xb016('0x3c')]){_0x46313b[_0xb016('0x3a')]=_[_0xb016('0x3d')](_0x46313b[_0xb016('0x3a')],{'$or':_[_0xb016('0x29')](_0x56273c,function(_0x5cff12){if(_0x5cff12['type']!==_0xb016('0x3e')){var _0x5e0614={};_0x5e0614[_0x5cff12['name']]={'$like':'%'+_0x4273ea['query'][_0xb016('0x3c')]+'%'};return _0x5e0614;}})});}_0x46313b=_['merge']({},_0x46313b,_0x4273ea['options']);var _0x27ed3d={'where':_0x46313b[_0xb016('0x3a')]};return db['FreshdeskConfiguration'][_0xb016('0x1f')](_0x27ed3d)[_0xb016('0x24')](function(_0x2a827c){_0x5d7149['count']=_0x2a827c;if(_0x4273ea[_0xb016('0x30')][_0xb016('0x3f')]){_0x46313b[_0xb016('0x40')]=[{'all':!![]}];}return db[_0xb016('0x2a')][_0xb016('0x41')](_0x46313b);})[_0xb016('0x24')](function(_0x3e2d52){_0x5d7149['rows']=_0x3e2d52;return _0x5d7149;})[_0xb016('0x24')](respondWithFilteredResult(_0x4f77f3,_0x46313b))[_0xb016('0x42')](handleError(_0x4f77f3,null));};exports['show']=function(_0x44eee9,_0x4ad42f){var _0x95f32d={'raw':![],'where':{'id':_0x44eee9[_0xb016('0x43')]['id']}},_0x4ee1dc={};_0x4ee1dc['model']=_[_0xb016('0x31')](db[_0xb016('0x2a')][_0xb016('0x2b')]);_0x4ee1dc[_0xb016('0x30')]=_['keys'](_0x44eee9[_0xb016('0x30')]);_0x4ee1dc['filters']=_[_0xb016('0x33')](_0x4ee1dc[_0xb016('0x2f')],_0x4ee1dc['query']);_0x95f32d[_0xb016('0x34')]=_[_0xb016('0x33')](_0x4ee1dc[_0xb016('0x2f')],qs[_0xb016('0x35')](_0x44eee9[_0xb016('0x30')][_0xb016('0x35')]));_0x95f32d[_0xb016('0x34')]=_0x95f32d['attributes'][_0xb016('0x36')]?_0x95f32d[_0xb016('0x34')]:_0x4ee1dc['model'];if(_0x44eee9[_0xb016('0x30')][_0xb016('0x3f')]){_0x95f32d[_0xb016('0x40')]=[{'all':!![]}];}_0x95f32d=_[_0xb016('0x3d')]({},_0x95f32d,_0x44eee9[_0xb016('0x44')]);return db['FreshdeskConfiguration'][_0xb016('0x45')](_0x95f32d)[_0xb016('0x24')](handleEntityNotFound(_0x4ad42f,null))[_0xb016('0x24')](respondWithResult(_0x4ad42f,null))[_0xb016('0x42')](handleError(_0x4ad42f,null));};exports[_0xb016('0x46')]=function(_0x176294,_0x292d78){return db[_0xb016('0x2a')]['create'](_0x176294['body'],{})[_0xb016('0x24')](respondWithResult(_0x292d78,0xc9))[_0xb016('0x42')](handleError(_0x292d78,null));};exports[_0xb016('0x23')]=function(_0xd7befb,_0x575a0f){if(_0xd7befb[_0xb016('0x47')]['id']){delete _0xd7befb[_0xb016('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xb016('0x45')]({'where':{'id':_0xd7befb[_0xb016('0x43')]['id']}})[_0xb016('0x24')](handleEntityNotFound(_0x575a0f,null))['then'](saveUpdates(_0xd7befb[_0xb016('0x47')],null))[_0xb016('0x24')](respondWithResult(_0x575a0f,null))[_0xb016('0x42')](handleError(_0x575a0f,null));};exports[_0xb016('0x48')]=function(_0x67267,_0x2bfc45){return db['FreshdeskConfiguration'][_0xb016('0x45')]({'where':{'id':_0x67267[_0xb016('0x43')]['id']}})[_0xb016('0x24')](handleEntityNotFound(_0x2bfc45,null))['then'](removeEntity(_0x2bfc45,null))['catch'](handleError(_0x2bfc45,null));};exports[_0xb016('0x49')]=function(_0xe3742c,_0x97a50d,_0x51a025){var _0x5d421d={};var _0x3e257b={};var _0x4d8e29;var _0x39a6a2;return db[_0xb016('0x2a')][_0xb016('0x4a')]({'where':{'id':_0xe3742c[_0xb016('0x43')]['id']}})[_0xb016('0x24')](handleEntityNotFound(_0x97a50d,null))[_0xb016('0x24')](function(_0x2ea4eb){if(_0x2ea4eb){_0x4d8e29=_0x2ea4eb;_0x3e257b[_0xb016('0x2f')]=_[_0xb016('0x31')](db[_0xb016('0x4b')]['rawAttributes']);_0x3e257b[_0xb016('0x30')]=_[_0xb016('0x31')](_0xe3742c['query']);_0x3e257b[_0xb016('0x32')]=_[_0xb016('0x33')](_0x3e257b[_0xb016('0x2f')],_0x3e257b['query']);_0x5d421d['attributes']=_['intersection'](_0x3e257b[_0xb016('0x2f')],qs['fields'](_0xe3742c[_0xb016('0x30')][_0xb016('0x35')]));_0x5d421d['attributes']=_0x5d421d[_0xb016('0x34')][_0xb016('0x36')]?_0x5d421d[_0xb016('0x34')]:_0x3e257b['model'];_0x5d421d['order']=qs[_0xb016('0x39')](_0xe3742c[_0xb016('0x30')][_0xb016('0x39')]);_0x5d421d[_0xb016('0x3a')]=qs[_0xb016('0x32')](_[_0xb016('0x3b')](_0xe3742c['query'],_0x3e257b['filters']));if(_0xe3742c[_0xb016('0x30')][_0xb016('0x3c')]){_0x5d421d[_0xb016('0x3a')]=_[_0xb016('0x3d')](_0x5d421d[_0xb016('0x3a')],{'$or':_[_0xb016('0x29')](_0x5d421d[_0xb016('0x34')],function(_0x11e3ea){var _0x236b49={};_0x236b49[_0x11e3ea]={'$like':'%'+_0xe3742c[_0xb016('0x30')][_0xb016('0x3c')]+'%'};return _0x236b49;})});}_0x5d421d=_[_0xb016('0x3d')]({},_0x5d421d,_0xe3742c['options']);return _0x4d8e29[_0xb016('0x49')](_0x5d421d);}})[_0xb016('0x24')](function(_0x474df9){if(_0x474df9){_0x39a6a2=_0x474df9[_0xb016('0x36')];if(!_0xe3742c[_0xb016('0x30')][_0xb016('0x4c')]('nolimit')){_0x5d421d['limit']=qs[_0xb016('0x1e')](_0xe3742c[_0xb016('0x30')][_0xb016('0x1e')]);_0x5d421d['offset']=qs[_0xb016('0x1c')](_0xe3742c[_0xb016('0x30')][_0xb016('0x1c')]);}return _0x4d8e29[_0xb016('0x49')](_0x5d421d);}})['then'](function(_0x713e42){if(_0x713e42){return _0x713e42?{'count':_0x39a6a2,'rows':_0x713e42}:null;}})[_0xb016('0x24')](respondWithResult(_0x97a50d,null))[_0xb016('0x42')](handleError(_0x97a50d,null));};exports['getSubjects']=function(_0x2bf03a,_0x46ecc1,_0x275990){var _0x211802={};var _0x4c4301={};var _0x430d79;var _0x3130ac;return db[_0xb016('0x2a')][_0xb016('0x4a')]({'where':{'id':_0x2bf03a[_0xb016('0x43')]['id']}})[_0xb016('0x24')](handleEntityNotFound(_0x46ecc1,null))[_0xb016('0x24')](function(_0x12719e){if(_0x12719e){_0x430d79=_0x12719e;_0x4c4301[_0xb016('0x2f')]=_[_0xb016('0x31')](db[_0xb016('0x4b')][_0xb016('0x2b')]);_0x4c4301[_0xb016('0x30')]=_[_0xb016('0x31')](_0x2bf03a['query']);_0x4c4301[_0xb016('0x32')]=_[_0xb016('0x33')](_0x4c4301[_0xb016('0x2f')],_0x4c4301['query']);_0x211802[_0xb016('0x34')]=_[_0xb016('0x33')](_0x4c4301[_0xb016('0x2f')],qs[_0xb016('0x35')](_0x2bf03a[_0xb016('0x30')]['fields']));_0x211802[_0xb016('0x34')]=_0x211802[_0xb016('0x34')]['length']?_0x211802[_0xb016('0x34')]:_0x4c4301[_0xb016('0x2f')];_0x211802[_0xb016('0x38')]=qs['sort'](_0x2bf03a['query'][_0xb016('0x39')]);_0x211802['where']=qs[_0xb016('0x32')](_[_0xb016('0x3b')](_0x2bf03a['query'],_0x4c4301[_0xb016('0x32')]));if(_0x2bf03a[_0xb016('0x30')][_0xb016('0x3c')]){_0x211802[_0xb016('0x3a')]=_[_0xb016('0x3d')](_0x211802[_0xb016('0x3a')],{'$or':_['map'](_0x211802[_0xb016('0x34')],function(_0x1bd259){var _0x5498d2={};_0x5498d2[_0x1bd259]={'$like':'%'+_0x2bf03a['query'][_0xb016('0x3c')]+'%'};return _0x5498d2;})});}_0x211802=_['merge']({},_0x211802,_0x2bf03a[_0xb016('0x44')]);return _0x430d79[_0xb016('0x4d')](_0x211802);}})[_0xb016('0x24')](function(_0x53e83f){if(_0x53e83f){_0x3130ac=_0x53e83f[_0xb016('0x36')];if(!_0x2bf03a[_0xb016('0x30')][_0xb016('0x4c')](_0xb016('0x37'))){_0x211802[_0xb016('0x1e')]=qs['limit'](_0x2bf03a[_0xb016('0x30')][_0xb016('0x1e')]);_0x211802['offset']=qs[_0xb016('0x1c')](_0x2bf03a['query'][_0xb016('0x1c')]);}return _0x430d79[_0xb016('0x4d')](_0x211802);}})[_0xb016('0x24')](function(_0x58589d){if(_0x58589d){return _0x58589d?{'count':_0x3130ac,'rows':_0x58589d}:null;}})[_0xb016('0x24')](respondWithResult(_0x46ecc1,null))['catch'](handleError(_0x46ecc1,null));};exports['getDescriptions']=function(_0x3c24ac,_0x400fe7,_0x5cf1da){var _0xd3ecf1={};var _0x39b6c1={};var _0x323b01;var _0x8e2a41;return db['FreshdeskConfiguration'][_0xb016('0x4a')]({'where':{'id':_0x3c24ac[_0xb016('0x43')]['id']}})['then'](handleEntityNotFound(_0x400fe7,null))[_0xb016('0x24')](function(_0xedc626){if(_0xedc626){_0x323b01=_0xedc626;_0x39b6c1[_0xb016('0x2f')]=_[_0xb016('0x31')](db[_0xb016('0x4b')]['rawAttributes']);_0x39b6c1[_0xb016('0x30')]=_[_0xb016('0x31')](_0x3c24ac['query']);_0x39b6c1['filters']=_['intersection'](_0x39b6c1[_0xb016('0x2f')],_0x39b6c1[_0xb016('0x30')]);_0xd3ecf1[_0xb016('0x34')]=_[_0xb016('0x33')](_0x39b6c1['model'],qs[_0xb016('0x35')](_0x3c24ac[_0xb016('0x30')][_0xb016('0x35')]));_0xd3ecf1[_0xb016('0x34')]=_0xd3ecf1[_0xb016('0x34')][_0xb016('0x36')]?_0xd3ecf1[_0xb016('0x34')]:_0x39b6c1[_0xb016('0x2f')];_0xd3ecf1[_0xb016('0x38')]=qs[_0xb016('0x39')](_0x3c24ac[_0xb016('0x30')][_0xb016('0x39')]);_0xd3ecf1[_0xb016('0x3a')]=qs[_0xb016('0x32')](_[_0xb016('0x3b')](_0x3c24ac[_0xb016('0x30')],_0x39b6c1[_0xb016('0x32')]));if(_0x3c24ac['query'][_0xb016('0x3c')]){_0xd3ecf1['where']=_['merge'](_0xd3ecf1['where'],{'$or':_[_0xb016('0x29')](_0xd3ecf1[_0xb016('0x34')],function(_0x3ac537){var _0xe32c29={};_0xe32c29[_0x3ac537]={'$like':'%'+_0x3c24ac[_0xb016('0x30')][_0xb016('0x3c')]+'%'};return _0xe32c29;})});}_0xd3ecf1=_[_0xb016('0x3d')]({},_0xd3ecf1,_0x3c24ac[_0xb016('0x44')]);return _0x323b01[_0xb016('0x4e')](_0xd3ecf1);}})['then'](function(_0x4e1fc4){if(_0x4e1fc4){_0x8e2a41=_0x4e1fc4[_0xb016('0x36')];if(!_0x3c24ac[_0xb016('0x30')][_0xb016('0x4c')](_0xb016('0x37'))){_0xd3ecf1[_0xb016('0x1e')]=qs[_0xb016('0x1e')](_0x3c24ac[_0xb016('0x30')]['limit']);_0xd3ecf1['offset']=qs[_0xb016('0x1c')](_0x3c24ac[_0xb016('0x30')][_0xb016('0x1c')]);}return _0x323b01[_0xb016('0x4e')](_0xd3ecf1);}})['then'](function(_0x1be2b1){if(_0x1be2b1){return _0x1be2b1?{'count':_0x8e2a41,'rows':_0x1be2b1}:null;}})[_0xb016('0x24')](respondWithResult(_0x400fe7,null))[_0xb016('0x42')](handleError(_0x400fe7,null));};exports[_0xb016('0x4f')]=function(_0x33e033,_0x52b397,_0x661035){var _0x119716={};var _0x4b1127={};var _0x410210;var _0x121fd8;return db[_0xb016('0x2a')][_0xb016('0x4a')]({'where':{'id':_0x33e033[_0xb016('0x43')]['id']}})[_0xb016('0x24')](handleEntityNotFound(_0x52b397,null))[_0xb016('0x24')](function(_0x1ffca7){if(_0x1ffca7){_0x410210=_0x1ffca7;_0x4b1127[_0xb016('0x2f')]=_['keys'](db[_0xb016('0x50')][_0xb016('0x2b')]);_0x4b1127[_0xb016('0x30')]=_[_0xb016('0x31')](_0x33e033[_0xb016('0x30')]);_0x4b1127[_0xb016('0x32')]=_[_0xb016('0x33')](_0x4b1127[_0xb016('0x2f')],_0x4b1127[_0xb016('0x30')]);_0x119716[_0xb016('0x34')]=_[_0xb016('0x33')](_0x4b1127[_0xb016('0x2f')],qs[_0xb016('0x35')](_0x33e033['query']['fields']));_0x119716[_0xb016('0x34')]=_0x119716[_0xb016('0x34')][_0xb016('0x36')]?_0x119716[_0xb016('0x34')]:_0x4b1127[_0xb016('0x2f')];_0x119716[_0xb016('0x38')]=qs[_0xb016('0x39')](_0x33e033[_0xb016('0x30')][_0xb016('0x39')]);_0x119716[_0xb016('0x3a')]=qs[_0xb016('0x32')](_[_0xb016('0x3b')](_0x33e033[_0xb016('0x30')],_0x4b1127[_0xb016('0x32')]));if(_0x33e033[_0xb016('0x30')]['filter']){_0x119716[_0xb016('0x3a')]=_[_0xb016('0x3d')](_0x119716[_0xb016('0x3a')],{'$or':_[_0xb016('0x29')](_0x119716[_0xb016('0x34')],function(_0x44f9e8){var _0x115899={};_0x115899[_0x44f9e8]={'$like':'%'+_0x33e033[_0xb016('0x30')][_0xb016('0x3c')]+'%'};return _0x115899;})});}_0x119716=_[_0xb016('0x3d')]({},_0x119716,_0x33e033[_0xb016('0x44')]);return _0x410210[_0xb016('0x4f')](_0x119716);}})['then'](function(_0xd4c2c2){if(_0xd4c2c2){_0x121fd8=_0xd4c2c2[_0xb016('0x36')];if(!_0x33e033[_0xb016('0x30')][_0xb016('0x4c')](_0xb016('0x37'))){_0x119716['limit']=qs[_0xb016('0x1e')](_0x33e033[_0xb016('0x30')][_0xb016('0x1e')]);_0x119716[_0xb016('0x1c')]=qs[_0xb016('0x1c')](_0x33e033[_0xb016('0x30')]['offset']);}return _0x410210[_0xb016('0x4f')](_0x119716);}})[_0xb016('0x24')](function(_0x2c000b){if(_0x2c000b){return _0x2c000b?{'count':_0x121fd8,'rows':_0x2c000b}:null;}})[_0xb016('0x24')](respondWithResult(_0x52b397,null))[_0xb016('0x42')](handleError(_0x52b397,null));};exports[_0xb016('0x51')]=function(_0x1078cb,_0x4be0ae,_0x2b9ba1){if(_0x1078cb['body']['id']){delete _0x1078cb[_0xb016('0x47')]['id'];}return db[_0xb016('0x2a')][_0xb016('0x4a')]({'where':{'id':_0x1078cb[_0xb016('0x43')]['id']}})['then'](handleEntityNotFound(_0x4be0ae,null))[_0xb016('0x24')](function(_0x3773f1){if(_0x3773f1){return _0x3773f1[_0xb016('0x51')](_0x1078cb['body'][_0xb016('0x52')]||[]);}return null;})['then'](respondWithResult(_0x4be0ae,null))[_0xb016('0x42')](handleError(_0x4be0ae,null));}; \ No newline at end of file +var _0xd777=['length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','FreshdeskConfiguration','includeAll','findAll','rows','catch','options','find','create','body','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xd777,0xc6));var _0x7d77=function(_0x4b5c23,_0x101faa){_0x4b5c23=_0x4b5c23-0x0;var _0x262cfd=_0xd777[_0x4b5c23];return _0x262cfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d77('0x0'));var zipdir=require(_0x7d77('0x1'));var jsonpatch=require(_0x7d77('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d77('0x3'));var Mustache=require(_0x7d77('0x4'));var util=require(_0x7d77('0x5'));var path=require(_0x7d77('0x6'));var sox=require(_0x7d77('0x7'));var csv=require(_0x7d77('0x8'));var ejs=require(_0x7d77('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d77('0xa'));var squel=require(_0x7d77('0xb'));var crypto=require(_0x7d77('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d77('0x8'));var querystring=require(_0x7d77('0xd'));var Papa=require(_0x7d77('0xe'));var Redis=require(_0x7d77('0xf'));var authService=require(_0x7d77('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d77('0x11'));var logger=require('../../config/logger')(_0x7d77('0x12'));var utils=require(_0x7d77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7d77('0x14'));var db=require(_0x7d77('0x15'))['db'];function respondWithStatusCode(_0x2253b1,_0x505173){_0x505173=_0x505173||0xcc;return function(_0x137d6c){if(_0x137d6c){return _0x2253b1[_0x7d77('0x16')](_0x505173);}return _0x2253b1['status'](_0x505173)['end']();};}function respondWithResult(_0x3d2eed,_0x11a731){_0x11a731=_0x11a731||0xc8;return function(_0x52dce3){if(_0x52dce3){return _0x3d2eed[_0x7d77('0x17')](_0x11a731)[_0x7d77('0x18')](_0x52dce3);}};}function respondWithFilteredResult(_0x5efd1d,_0x3dfe09){return function(_0xe1b518){if(_0xe1b518){var _0x31d6d9=typeof _0x3dfe09[_0x7d77('0x19')]==='undefined'&&typeof _0x3dfe09[_0x7d77('0x1a')]===_0x7d77('0x1b');var _0x4db7e9=_0xe1b518[_0x7d77('0x1c')];var _0x5c0240=_0x31d6d9?0x0:_0x3dfe09['offset'];var _0x4aa6f4=_0x31d6d9?_0xe1b518[_0x7d77('0x1c')]:_0x3dfe09[_0x7d77('0x19')]+_0x3dfe09['limit'];var _0x1e9ab5;if(_0x4aa6f4>=_0x4db7e9){_0x4aa6f4=_0x4db7e9;_0x1e9ab5=0xc8;}else{_0x1e9ab5=0xce;}_0x5efd1d['status'](_0x1e9ab5);return _0x5efd1d[_0x7d77('0x1d')](_0x7d77('0x1e'),_0x5c0240+'-'+_0x4aa6f4+'/'+_0x4db7e9)[_0x7d77('0x18')](_0xe1b518);}return null;};}function patchUpdates(_0x54af5d){return function(_0x57e8c7){try{jsonpatch[_0x7d77('0x1f')](_0x57e8c7,_0x54af5d,!![]);}catch(_0x1edbe7){return BPromise['reject'](_0x1edbe7);}return _0x57e8c7[_0x7d77('0x20')]();};}function saveUpdates(_0x3b1876,_0x16a17d){return function(_0x379f02){if(_0x379f02){return _0x379f02[_0x7d77('0x21')](_0x3b1876)[_0x7d77('0x22')](function(_0xe14c0e){return _0xe14c0e;});}return null;};}function removeEntity(_0x181bb8,_0x2d1df6){return function(_0x36f11e){if(_0x36f11e){return _0x36f11e[_0x7d77('0x23')]()[_0x7d77('0x22')](function(){_0x181bb8[_0x7d77('0x17')](0xcc)[_0x7d77('0x24')]();});}};}function handleEntityNotFound(_0xaeecf0,_0x7ecda){return function(_0x2a911e){if(!_0x2a911e){_0xaeecf0['sendStatus'](0x194);}return _0x2a911e;};}function handleError(_0x46924e,_0x4616f5){_0x4616f5=_0x4616f5||0x1f4;return function(_0x4a4ab2){logger[_0x7d77('0x25')](_0x4a4ab2[_0x7d77('0x26')]);if(_0x4a4ab2[_0x7d77('0x27')]){delete _0x4a4ab2[_0x7d77('0x27')];}_0x46924e['status'](_0x4616f5)[_0x7d77('0x28')](_0x4a4ab2);};}exports[_0x7d77('0x29')]=function(_0xad4a5c,_0x4eb49c){var _0x352ef7={},_0x43f63f={},_0x4c5ddc={'count':0x0,'rows':[]};var _0x2c067e=_['map'](db['FreshdeskConfiguration'][_0x7d77('0x2a')],function(_0x8a8b03){return{'name':_0x8a8b03[_0x7d77('0x2b')],'type':_0x8a8b03['type'][_0x7d77('0x2c')]};});_0x43f63f[_0x7d77('0x2d')]=_['map'](_0x2c067e,'name');_0x43f63f['query']=_[_0x7d77('0x2e')](_0xad4a5c[_0x7d77('0x2f')]);_0x43f63f['filters']=_[_0x7d77('0x30')](_0x43f63f[_0x7d77('0x2d')],_0x43f63f[_0x7d77('0x2f')]);_0x352ef7[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x43f63f[_0x7d77('0x2d')],qs['fields'](_0xad4a5c[_0x7d77('0x2f')][_0x7d77('0x32')]));_0x352ef7['attributes']=_0x352ef7['attributes'][_0x7d77('0x33')]?_0x352ef7['attributes']:_0x43f63f[_0x7d77('0x2d')];if(!_0xad4a5c[_0x7d77('0x2f')][_0x7d77('0x34')](_0x7d77('0x35'))){_0x352ef7['limit']=qs[_0x7d77('0x1a')](_0xad4a5c[_0x7d77('0x2f')][_0x7d77('0x1a')]);_0x352ef7[_0x7d77('0x19')]=qs[_0x7d77('0x19')](_0xad4a5c[_0x7d77('0x2f')]['offset']);}_0x352ef7[_0x7d77('0x36')]=qs[_0x7d77('0x37')](_0xad4a5c[_0x7d77('0x2f')]['sort']);_0x352ef7['where']=qs[_0x7d77('0x38')](_[_0x7d77('0x39')](_0xad4a5c[_0x7d77('0x2f')],_0x43f63f[_0x7d77('0x38')]),_0x2c067e);if(_0xad4a5c[_0x7d77('0x2f')][_0x7d77('0x3a')]){_0x352ef7[_0x7d77('0x3b')]=_[_0x7d77('0x3c')](_0x352ef7['where'],{'$or':_[_0x7d77('0x3d')](_0x2c067e,function(_0x64588){if(_0x64588[_0x7d77('0x3e')]!==_0x7d77('0x3f')){var _0x3b4e84={};_0x3b4e84[_0x64588[_0x7d77('0x27')]]={'$like':'%'+_0xad4a5c['query'][_0x7d77('0x3a')]+'%'};return _0x3b4e84;}})});}_0x352ef7=_[_0x7d77('0x3c')]({},_0x352ef7,_0xad4a5c['options']);var _0x2f7191={'where':_0x352ef7[_0x7d77('0x3b')]};return db[_0x7d77('0x40')][_0x7d77('0x1c')](_0x2f7191)[_0x7d77('0x22')](function(_0x5da01f){_0x4c5ddc[_0x7d77('0x1c')]=_0x5da01f;if(_0xad4a5c[_0x7d77('0x2f')][_0x7d77('0x41')]){_0x352ef7['include']=[{'all':!![]}];}return db[_0x7d77('0x40')][_0x7d77('0x42')](_0x352ef7);})[_0x7d77('0x22')](function(_0x41be56){_0x4c5ddc[_0x7d77('0x43')]=_0x41be56;return _0x4c5ddc;})['then'](respondWithFilteredResult(_0x4eb49c,_0x352ef7))[_0x7d77('0x44')](handleError(_0x4eb49c,null));};exports['show']=function(_0x181e1a,_0x5ae43f){var _0x368f89={'raw':![],'where':{'id':_0x181e1a['params']['id']}},_0x3201a0={};_0x3201a0[_0x7d77('0x2d')]=_[_0x7d77('0x2e')](db['FreshdeskConfiguration']['rawAttributes']);_0x3201a0[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x181e1a[_0x7d77('0x2f')]);_0x3201a0['filters']=_['intersection'](_0x3201a0['model'],_0x3201a0[_0x7d77('0x2f')]);_0x368f89[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x3201a0[_0x7d77('0x2d')],qs[_0x7d77('0x32')](_0x181e1a[_0x7d77('0x2f')][_0x7d77('0x32')]));_0x368f89[_0x7d77('0x31')]=_0x368f89['attributes'][_0x7d77('0x33')]?_0x368f89[_0x7d77('0x31')]:_0x3201a0[_0x7d77('0x2d')];if(_0x181e1a['query']['includeAll']){_0x368f89['include']=[{'all':!![]}];}_0x368f89=_[_0x7d77('0x3c')]({},_0x368f89,_0x181e1a[_0x7d77('0x45')]);return db['FreshdeskConfiguration'][_0x7d77('0x46')](_0x368f89)[_0x7d77('0x22')](handleEntityNotFound(_0x5ae43f,null))[_0x7d77('0x22')](respondWithResult(_0x5ae43f,null))[_0x7d77('0x44')](handleError(_0x5ae43f,null));};exports[_0x7d77('0x47')]=function(_0x326015,_0x4e8da6){return db[_0x7d77('0x40')][_0x7d77('0x47')](_0x326015[_0x7d77('0x48')],{})[_0x7d77('0x22')](respondWithResult(_0x4e8da6,0xc9))[_0x7d77('0x44')](handleError(_0x4e8da6,null));};exports[_0x7d77('0x21')]=function(_0x12c590,_0x2bae79){if(_0x12c590[_0x7d77('0x48')]['id']){delete _0x12c590[_0x7d77('0x48')]['id'];}return db[_0x7d77('0x40')]['find']({'where':{'id':_0x12c590[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x2bae79,null))[_0x7d77('0x22')](saveUpdates(_0x12c590['body'],null))['then'](respondWithResult(_0x2bae79,null))['catch'](handleError(_0x2bae79,null));};exports[_0x7d77('0x23')]=function(_0x2c3781,_0x4de3e1){return db[_0x7d77('0x40')][_0x7d77('0x46')]({'where':{'id':_0x2c3781[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x4de3e1,null))[_0x7d77('0x22')](removeEntity(_0x4de3e1,null))[_0x7d77('0x44')](handleError(_0x4de3e1,null));};exports[_0x7d77('0x4a')]=function(_0x12be27,_0x1b1f42,_0x15e711){var _0x42c9dc={};var _0x2a7a08={};var _0x5b55eb;var _0x978f7d;return db[_0x7d77('0x40')][_0x7d77('0x4b')]({'where':{'id':_0x12be27[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x1b1f42,null))[_0x7d77('0x22')](function(_0x5b1c89){if(_0x5b1c89){_0x5b55eb=_0x5b1c89;_0x2a7a08[_0x7d77('0x2d')]=_[_0x7d77('0x2e')](db[_0x7d77('0x4c')][_0x7d77('0x2a')]);_0x2a7a08[_0x7d77('0x2f')]=_['keys'](_0x12be27[_0x7d77('0x2f')]);_0x2a7a08[_0x7d77('0x38')]=_[_0x7d77('0x30')](_0x2a7a08[_0x7d77('0x2d')],_0x2a7a08['query']);_0x42c9dc[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x2a7a08[_0x7d77('0x2d')],qs['fields'](_0x12be27[_0x7d77('0x2f')][_0x7d77('0x32')]));_0x42c9dc[_0x7d77('0x31')]=_0x42c9dc[_0x7d77('0x31')]['length']?_0x42c9dc[_0x7d77('0x31')]:_0x2a7a08[_0x7d77('0x2d')];_0x42c9dc['order']=qs[_0x7d77('0x37')](_0x12be27[_0x7d77('0x2f')][_0x7d77('0x37')]);_0x42c9dc[_0x7d77('0x3b')]=qs[_0x7d77('0x38')](_[_0x7d77('0x39')](_0x12be27[_0x7d77('0x2f')],_0x2a7a08[_0x7d77('0x38')]));if(_0x12be27[_0x7d77('0x2f')]['filter']){_0x42c9dc[_0x7d77('0x3b')]=_[_0x7d77('0x3c')](_0x42c9dc[_0x7d77('0x3b')],{'$or':_[_0x7d77('0x3d')](_0x42c9dc[_0x7d77('0x31')],function(_0x292eaf){var _0x854ad0={};_0x854ad0[_0x292eaf]={'$like':'%'+_0x12be27[_0x7d77('0x2f')]['filter']+'%'};return _0x854ad0;})});}_0x42c9dc=_[_0x7d77('0x3c')]({},_0x42c9dc,_0x12be27[_0x7d77('0x45')]);return _0x5b55eb[_0x7d77('0x4a')](_0x42c9dc);}})[_0x7d77('0x22')](function(_0x2647a3){if(_0x2647a3){_0x978f7d=_0x2647a3[_0x7d77('0x33')];if(!_0x12be27[_0x7d77('0x2f')][_0x7d77('0x34')](_0x7d77('0x35'))){_0x42c9dc[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0x12be27[_0x7d77('0x2f')][_0x7d77('0x1a')]);_0x42c9dc['offset']=qs[_0x7d77('0x19')](_0x12be27[_0x7d77('0x2f')]['offset']);}return _0x5b55eb[_0x7d77('0x4a')](_0x42c9dc);}})[_0x7d77('0x22')](function(_0x12baef){if(_0x12baef){return _0x12baef?{'count':_0x978f7d,'rows':_0x12baef}:null;}})[_0x7d77('0x22')](respondWithResult(_0x1b1f42,null))['catch'](handleError(_0x1b1f42,null));};exports[_0x7d77('0x4d')]=function(_0x34d892,_0x419e03,_0x17186b){var _0x208eb3={};var _0x53e8e1={};var _0x153be3;var _0x12f18a;return db[_0x7d77('0x40')][_0x7d77('0x4b')]({'where':{'id':_0x34d892[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x419e03,null))[_0x7d77('0x22')](function(_0x25f29e){if(_0x25f29e){_0x153be3=_0x25f29e;_0x53e8e1[_0x7d77('0x2d')]=_[_0x7d77('0x2e')](db[_0x7d77('0x4c')]['rawAttributes']);_0x53e8e1[_0x7d77('0x2f')]=_['keys'](_0x34d892[_0x7d77('0x2f')]);_0x53e8e1[_0x7d77('0x38')]=_[_0x7d77('0x30')](_0x53e8e1[_0x7d77('0x2d')],_0x53e8e1[_0x7d77('0x2f')]);_0x208eb3[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x53e8e1[_0x7d77('0x2d')],qs[_0x7d77('0x32')](_0x34d892[_0x7d77('0x2f')]['fields']));_0x208eb3['attributes']=_0x208eb3['attributes'][_0x7d77('0x33')]?_0x208eb3[_0x7d77('0x31')]:_0x53e8e1[_0x7d77('0x2d')];_0x208eb3[_0x7d77('0x36')]=qs['sort'](_0x34d892[_0x7d77('0x2f')][_0x7d77('0x37')]);_0x208eb3[_0x7d77('0x3b')]=qs[_0x7d77('0x38')](_['pick'](_0x34d892[_0x7d77('0x2f')],_0x53e8e1[_0x7d77('0x38')]));if(_0x34d892[_0x7d77('0x2f')][_0x7d77('0x3a')]){_0x208eb3[_0x7d77('0x3b')]=_[_0x7d77('0x3c')](_0x208eb3[_0x7d77('0x3b')],{'$or':_[_0x7d77('0x3d')](_0x208eb3[_0x7d77('0x31')],function(_0x3025da){var _0x259b36={};_0x259b36[_0x3025da]={'$like':'%'+_0x34d892['query'][_0x7d77('0x3a')]+'%'};return _0x259b36;})});}_0x208eb3=_[_0x7d77('0x3c')]({},_0x208eb3,_0x34d892[_0x7d77('0x45')]);return _0x153be3[_0x7d77('0x4d')](_0x208eb3);}})['then'](function(_0x2b3f6d){if(_0x2b3f6d){_0x12f18a=_0x2b3f6d[_0x7d77('0x33')];if(!_0x34d892[_0x7d77('0x2f')][_0x7d77('0x34')](_0x7d77('0x35'))){_0x208eb3[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0x34d892[_0x7d77('0x2f')][_0x7d77('0x1a')]);_0x208eb3['offset']=qs[_0x7d77('0x19')](_0x34d892['query'][_0x7d77('0x19')]);}return _0x153be3[_0x7d77('0x4d')](_0x208eb3);}})[_0x7d77('0x22')](function(_0x85721b){if(_0x85721b){return _0x85721b?{'count':_0x12f18a,'rows':_0x85721b}:null;}})['then'](respondWithResult(_0x419e03,null))[_0x7d77('0x44')](handleError(_0x419e03,null));};exports['getDescriptions']=function(_0xfd7a57,_0x4f8630,_0x1ce81e){var _0x4473df={};var _0x24d2c0={};var _0x48fb37;var _0x383620;return db[_0x7d77('0x40')]['findOne']({'where':{'id':_0xfd7a57[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x4f8630,null))[_0x7d77('0x22')](function(_0x40a98e){if(_0x40a98e){_0x48fb37=_0x40a98e;_0x24d2c0['model']=_[_0x7d77('0x2e')](db[_0x7d77('0x4c')][_0x7d77('0x2a')]);_0x24d2c0['query']=_['keys'](_0xfd7a57[_0x7d77('0x2f')]);_0x24d2c0['filters']=_[_0x7d77('0x30')](_0x24d2c0[_0x7d77('0x2d')],_0x24d2c0[_0x7d77('0x2f')]);_0x4473df[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x24d2c0[_0x7d77('0x2d')],qs[_0x7d77('0x32')](_0xfd7a57[_0x7d77('0x2f')][_0x7d77('0x32')]));_0x4473df[_0x7d77('0x31')]=_0x4473df[_0x7d77('0x31')][_0x7d77('0x33')]?_0x4473df[_0x7d77('0x31')]:_0x24d2c0[_0x7d77('0x2d')];_0x4473df[_0x7d77('0x36')]=qs['sort'](_0xfd7a57['query'][_0x7d77('0x37')]);_0x4473df['where']=qs[_0x7d77('0x38')](_[_0x7d77('0x39')](_0xfd7a57[_0x7d77('0x2f')],_0x24d2c0['filters']));if(_0xfd7a57[_0x7d77('0x2f')][_0x7d77('0x3a')]){_0x4473df['where']=_[_0x7d77('0x3c')](_0x4473df[_0x7d77('0x3b')],{'$or':_['map'](_0x4473df[_0x7d77('0x31')],function(_0x1da7d){var _0x49cea9={};_0x49cea9[_0x1da7d]={'$like':'%'+_0xfd7a57['query'][_0x7d77('0x3a')]+'%'};return _0x49cea9;})});}_0x4473df=_[_0x7d77('0x3c')]({},_0x4473df,_0xfd7a57[_0x7d77('0x45')]);return _0x48fb37[_0x7d77('0x4e')](_0x4473df);}})[_0x7d77('0x22')](function(_0xd9fb0){if(_0xd9fb0){_0x383620=_0xd9fb0[_0x7d77('0x33')];if(!_0xfd7a57[_0x7d77('0x2f')]['hasOwnProperty']('nolimit')){_0x4473df[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0xfd7a57[_0x7d77('0x2f')][_0x7d77('0x1a')]);_0x4473df[_0x7d77('0x19')]=qs[_0x7d77('0x19')](_0xfd7a57[_0x7d77('0x2f')]['offset']);}return _0x48fb37[_0x7d77('0x4e')](_0x4473df);}})[_0x7d77('0x22')](function(_0x1319b0){if(_0x1319b0){return _0x1319b0?{'count':_0x383620,'rows':_0x1319b0}:null;}})[_0x7d77('0x22')](respondWithResult(_0x4f8630,null))[_0x7d77('0x44')](handleError(_0x4f8630,null));};exports['getTags']=function(_0x57cb95,_0x118e78,_0x53b25f){var _0x44fdf9={};var _0x1ef5d4={};var _0x5593cf;var _0x193e94;return db['FreshdeskConfiguration'][_0x7d77('0x4b')]({'where':{'id':_0x57cb95[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0x118e78,null))[_0x7d77('0x22')](function(_0x59d631){if(_0x59d631){_0x5593cf=_0x59d631;_0x1ef5d4[_0x7d77('0x2d')]=_[_0x7d77('0x2e')](db[_0x7d77('0x4f')][_0x7d77('0x2a')]);_0x1ef5d4[_0x7d77('0x2f')]=_[_0x7d77('0x2e')](_0x57cb95[_0x7d77('0x2f')]);_0x1ef5d4['filters']=_[_0x7d77('0x30')](_0x1ef5d4[_0x7d77('0x2d')],_0x1ef5d4['query']);_0x44fdf9[_0x7d77('0x31')]=_[_0x7d77('0x30')](_0x1ef5d4['model'],qs[_0x7d77('0x32')](_0x57cb95[_0x7d77('0x2f')][_0x7d77('0x32')]));_0x44fdf9[_0x7d77('0x31')]=_0x44fdf9[_0x7d77('0x31')][_0x7d77('0x33')]?_0x44fdf9['attributes']:_0x1ef5d4['model'];_0x44fdf9[_0x7d77('0x36')]=qs[_0x7d77('0x37')](_0x57cb95['query']['sort']);_0x44fdf9['where']=qs[_0x7d77('0x38')](_[_0x7d77('0x39')](_0x57cb95[_0x7d77('0x2f')],_0x1ef5d4['filters']));if(_0x57cb95[_0x7d77('0x2f')][_0x7d77('0x3a')]){_0x44fdf9[_0x7d77('0x3b')]=_['merge'](_0x44fdf9[_0x7d77('0x3b')],{'$or':_[_0x7d77('0x3d')](_0x44fdf9['attributes'],function(_0x5b1c83){var _0x51806e={};_0x51806e[_0x5b1c83]={'$like':'%'+_0x57cb95[_0x7d77('0x2f')][_0x7d77('0x3a')]+'%'};return _0x51806e;})});}_0x44fdf9=_[_0x7d77('0x3c')]({},_0x44fdf9,_0x57cb95[_0x7d77('0x45')]);return _0x5593cf['getTags'](_0x44fdf9);}})[_0x7d77('0x22')](function(_0x5879eb){if(_0x5879eb){_0x193e94=_0x5879eb['length'];if(!_0x57cb95['query'][_0x7d77('0x34')](_0x7d77('0x35'))){_0x44fdf9[_0x7d77('0x1a')]=qs[_0x7d77('0x1a')](_0x57cb95['query'][_0x7d77('0x1a')]);_0x44fdf9['offset']=qs[_0x7d77('0x19')](_0x57cb95[_0x7d77('0x2f')][_0x7d77('0x19')]);}return _0x5593cf[_0x7d77('0x50')](_0x44fdf9);}})[_0x7d77('0x22')](function(_0x58c616){if(_0x58c616){return _0x58c616?{'count':_0x193e94,'rows':_0x58c616}:null;}})[_0x7d77('0x22')](respondWithResult(_0x118e78,null))['catch'](handleError(_0x118e78,null));};exports[_0x7d77('0x51')]=function(_0x3059f4,_0xabcb5e,_0x11f239){if(_0x3059f4[_0x7d77('0x48')]['id']){delete _0x3059f4['body']['id'];}return db['FreshdeskConfiguration'][_0x7d77('0x4b')]({'where':{'id':_0x3059f4[_0x7d77('0x49')]['id']}})[_0x7d77('0x22')](handleEntityNotFound(_0xabcb5e,null))[_0x7d77('0x22')](function(_0x10e343){if(_0x10e343){return _0x10e343['setTags'](_0x3059f4[_0x7d77('0x48')][_0x7d77('0x52')]||[]);}return null;})[_0x7d77('0x22')](respondWithResult(_0xabcb5e,null))[_0x7d77('0x44')](handleError(_0xabcb5e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5884f7e..9c137f9 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 _0x4927=['./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','../../config/logger','moment','path'];(function(_0xd8a8af,_0x1e93f0){var _0x5b7278=function(_0x458800){while(--_0x458800){_0xd8a8af['push'](_0xd8a8af['shift']());}};_0x5b7278(++_0x1e93f0);}(_0x4927,0xfb));var _0x7492=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4927[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7492('0x0'));var util=require(_0x7492('0x1'));var logger=require(_0x7492('0x2'))('api');var moment=require(_0x7492('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7492('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7492('0x5'));module['exports']=function(_0x4f6f04,_0x5176ca){return _0x4f6f04[_0x7492('0x6')]('FreshdeskConfiguration',attributes,{'tableName':_0x7492('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c65=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x1c65,0x198));var _0x51c6=function(_0x1fa00e,_0x59f236){_0x1fa00e=_0x1fa00e-0x0;var _0x282287=_0x1c65[_0x1fa00e];return _0x282287;};'use strict';var _=require('lodash');var util=require(_0x51c6('0x0'));var logger=require(_0x51c6('0x1'))(_0x51c6('0x2'));var moment=require(_0x51c6('0x3'));var BPromise=require(_0x51c6('0x4'));var rp=require(_0x51c6('0x5'));var fs=require('fs');var path=require(_0x51c6('0x6'));var rimraf=require(_0x51c6('0x7'));var config=require(_0x51c6('0x8'));var attributes=require(_0x51c6('0x9'));module[_0x51c6('0xa')]=function(_0x225dd7,_0x41acee){return _0x225dd7[_0x51c6('0xb')](_0x51c6('0xc'),attributes,{'tableName':'int_freshdesk_configurations','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 ab43f82..200774a 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 _0xd021=['stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0xd021,0x1a4));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1d02('0x0'));var util=require(_0x1d02('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d02('0x2'));var fs=require('fs');var Redis=require(_0x1d02('0x3'));var db=require(_0x1d02('0x4'))['db'];var utils=require(_0x1d02('0x5'));var logger=require(_0x1d02('0x6'))(_0x1d02('0x7'));var config=require(_0x1d02('0x8'));var jayson=require(_0x1d02('0x9'));var client=jayson[_0x1d02('0xa')][_0x1d02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x534e9c,_0x2cf5b6,_0x405d06){return new BPromise(function(_0x419291,_0x532190){return client['request'](_0x534e9c,_0x405d06)[_0x1d02('0xc')](function(_0x40a398){logger[_0x1d02('0xd')](_0x1d02('0xe'),_0x2cf5b6,_0x1d02('0xf'));logger[_0x1d02('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2cf5b6,_0x1d02('0xf'),JSON[_0x1d02('0x11')](_0x40a398));if(_0x40a398[_0x1d02('0x12')]){if(_0x40a398[_0x1d02('0x12')][_0x1d02('0x13')]===0x1f4){logger[_0x1d02('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2cf5b6,_0x40a398[_0x1d02('0x12')]['message']);return _0x532190(_0x40a398['error']['message']);}logger[_0x1d02('0x12')](_0x1d02('0xe'),_0x2cf5b6,_0x40a398[_0x1d02('0x12')][_0x1d02('0x14')]);return _0x419291(_0x40a398[_0x1d02('0x12')][_0x1d02('0x14')]);}else{logger[_0x1d02('0xd')](_0x1d02('0xe'),_0x2cf5b6,_0x1d02('0xf'));_0x419291(_0x40a398[_0x1d02('0x15')][_0x1d02('0x14')]);}})[_0x1d02('0x16')](function(_0x127247){logger[_0x1d02('0x12')](_0x1d02('0xe'),_0x2cf5b6,_0x127247);_0x532190(_0x127247);});});} \ No newline at end of file +var _0x6bf3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x6fda56,_0x523bb1){var _0xa356f8=function(_0x4f637a){while(--_0x4f637a){_0x6fda56['push'](_0x6fda56['shift']());}};_0xa356f8(++_0x523bb1);}(_0x6bf3,0x178));var _0x36bf=function(_0x36650e,_0x1432f1){_0x36650e=_0x36650e-0x0;var _0x366353=_0x6bf3[_0x36650e];return _0x366353;};'use strict';var _=require(_0x36bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x36bf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36bf('0x2'));var db=require(_0x36bf('0x3'))['db'];var utils=require(_0x36bf('0x4'));var logger=require(_0x36bf('0x5'))('rpc');var config=require(_0x36bf('0x6'));var jayson=require(_0x36bf('0x7'));var client=jayson[_0x36bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2b9f,_0x1a0cf2,_0x573e02){return new BPromise(function(_0x587328,_0x5ba69e){return client[_0x36bf('0x9')](_0x2a2b9f,_0x573e02)[_0x36bf('0xa')](function(_0x57ed74){logger['info'](_0x36bf('0xb'),_0x1a0cf2,_0x36bf('0xc'));logger[_0x36bf('0xd')](_0x36bf('0xe'),_0x1a0cf2,'request\x20sent',JSON[_0x36bf('0xf')](_0x57ed74));if(_0x57ed74[_0x36bf('0x10')]){if(_0x57ed74[_0x36bf('0x10')][_0x36bf('0x11')]===0x1f4){logger[_0x36bf('0x10')](_0x36bf('0xb'),_0x1a0cf2,_0x57ed74[_0x36bf('0x10')][_0x36bf('0x12')]);return _0x5ba69e(_0x57ed74[_0x36bf('0x10')]['message']);}logger[_0x36bf('0x10')](_0x36bf('0xb'),_0x1a0cf2,_0x57ed74['error'][_0x36bf('0x12')]);return _0x587328(_0x57ed74['error'][_0x36bf('0x12')]);}else{logger[_0x36bf('0x13')](_0x36bf('0xb'),_0x1a0cf2,_0x36bf('0xc'));_0x587328(_0x57ed74['result'][_0x36bf('0x12')]);}})['catch'](function(_0x2fa894){logger['error'](_0x36bf('0xb'),_0x1a0cf2,_0x2fa894);_0x5ba69e(_0x2fa894);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index a376c94..b8c7e9e 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 _0x3ebb=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated'];(function(_0x5eefe6,_0xfa1b94){var _0x4b0da2=function(_0xfe7441){while(--_0xfe7441){_0x5eefe6['push'](_0x5eefe6['shift']());}};_0x4b0da2(++_0xfa1b94);}(_0x3ebb,0x1ad));var _0xb3eb=function(_0x449664,_0x30075b){_0x449664=_0x449664-0x0;var _0xa83623=_0x3ebb[_0x449664];return _0xa83623;};'use strict';var multer=require(_0xb3eb('0x0'));var util=require(_0xb3eb('0x1'));var path=require(_0xb3eb('0x2'));var timeout=require(_0xb3eb('0x3'));var express=require(_0xb3eb('0x4'));var router=express[_0xb3eb('0x5')]();var fs_extra=require(_0xb3eb('0x6'));var auth=require(_0xb3eb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb3eb('0x8'));var controller=require(_0xb3eb('0x9'));router[_0xb3eb('0xa')]('/',auth[_0xb3eb('0xb')](),controller[_0xb3eb('0xc')]);router[_0xb3eb('0xa')](_0xb3eb('0xd'),auth[_0xb3eb('0xb')](),controller[_0xb3eb('0xe')]);router[_0xb3eb('0xf')]('/',auth[_0xb3eb('0xb')](),controller[_0xb3eb('0x10')]);router[_0xb3eb('0x11')](_0xb3eb('0xd'),auth[_0xb3eb('0xb')](),controller[_0xb3eb('0x12')]);router[_0xb3eb('0x13')](_0xb3eb('0xd'),auth[_0xb3eb('0xb')](),controller[_0xb3eb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6a90=['update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x3a3a4b,_0x290d97){var _0x367b71=function(_0x2d378f){while(--_0x2d378f){_0x3a3a4b['push'](_0x3a3a4b['shift']());}};_0x367b71(++_0x290d97);}(_0x6a90,0x123));var _0x06a9=function(_0x9366b5,_0x2f67c4){_0x9366b5=_0x9366b5-0x0;var _0x34334b=_0x6a90[_0x9366b5];return _0x34334b;};'use strict';var multer=require('multer');var util=require(_0x06a9('0x0'));var path=require('path');var timeout=require(_0x06a9('0x1'));var express=require(_0x06a9('0x2'));var router=express[_0x06a9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x06a9('0x4'));var config=require(_0x06a9('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x06a9('0x6')]('/',auth[_0x06a9('0x7')](),controller[_0x06a9('0x8')]);router[_0x06a9('0x6')](_0x06a9('0x9'),auth['isAuthenticated'](),controller[_0x06a9('0xa')]);router[_0x06a9('0xb')]('/',auth[_0x06a9('0x7')](),controller['create']);router[_0x06a9('0xc')](_0x06a9('0x9'),auth['isAuthenticated'](),controller[_0x06a9('0xd')]);router[_0x06a9('0xe')](_0x06a9('0x9'),auth[_0x06a9('0x7')](),controller['destroy']);module[_0x06a9('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 89cb75f..ddf7376 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 _0x8f62=['ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x5e265e,_0x58b246){var _0x55a032=function(_0x55af38){while(--_0x55af38){_0x5e265e['push'](_0x5e265e['shift']());}};_0x55a032(++_0x58b246);}(_0x8f62,0x18f));var _0x28f6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f62[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x28f6('0x0')]={'type':{'type':Sequelize[_0x28f6('0x1')](_0x28f6('0x2'),_0x28f6('0x3'),'customVariable',_0x28f6('0x4'),_0x28f6('0x5')),'defaultValue':_0x28f6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x28f6('0x6')]},'keyType':{'type':Sequelize[_0x28f6('0x1')]('string',_0x28f6('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x28f6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x28f6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf2a5=['exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x57bd96,_0x2684b9){var _0x2729c1=function(_0x4cdb4c){while(--_0x4cdb4c){_0x57bd96['push'](_0x57bd96['shift']());}};_0x2729c1(++_0x2684b9);}(_0xf2a5,0xbc));var _0x5f2a=function(_0x568542,_0x2afc6e){_0x568542=_0x568542-0x0;var _0x2135e2=_0xf2a5[_0x568542];return _0x2135e2;};'use strict';var Sequelize=require(_0x5f2a('0x0'));module[_0x5f2a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5f2a('0x2'),_0x5f2a('0x3'),_0x5f2a('0x4'),'keyValue',_0x5f2a('0x5')),'defaultValue':_0x5f2a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5f2a('0x6')]},'keyType':{'type':Sequelize[_0x5f2a('0x7')](_0x5f2a('0x2'),'variable',_0x5f2a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5f2a('0x6')]},'nameField':{'type':Sequelize[_0x5f2a('0x6')]},'customField':{'type':Sequelize[_0x5f2a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f2a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 0a649e0..e510c92 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 _0x684c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x14d5a9,_0xd60435){var _0x6b991e=function(_0x138700){while(--_0x138700){_0x14d5a9['push'](_0x14d5a9['shift']());}};_0x6b991e(++_0xd60435);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){_0x41162b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c7cc,_0x321a88){return function(_0x236f02){if(!_0x236f02){_0x27c7cc['sendStatus'](0x194);}return _0x236f02;};}function handleError(_0x32cc56,_0x4dbf22){_0x4dbf22=_0x4dbf22||0x1f4;return function(_0x125d55){logger[_0xc684('0x27')](_0x125d55[_0xc684('0x28')]);if(_0x125d55['name']){delete _0x125d55[_0xc684('0x29')];}_0x32cc56['status'](_0x4dbf22)[_0xc684('0x2a')](_0x125d55);};}exports[_0xc684('0x2b')]=function(_0x210dcd,_0x9fdc2c){var _0x5df482={},_0xc0f77b={},_0x2710c1={'count':0x0,'rows':[]};var _0x28a48a=_[_0xc684('0x2c')](db[_0xc684('0x2d')][_0xc684('0x2e')],function(_0x10db0d){return{'name':_0x10db0d[_0xc684('0x2f')],'type':_0x10db0d['type']['key']};});_0xc0f77b['model']=_[_0xc684('0x2c')](_0x28a48a,_0xc684('0x29'));_0xc0f77b['query']=_['keys'](_0x210dcd[_0xc684('0x30')]);_0xc0f77b['filters']=_[_0xc684('0x31')](_0xc0f77b[_0xc684('0x32')],_0xc0f77b[_0xc684('0x30')]);_0x5df482['attributes']=_['intersection'](_0xc0f77b[_0xc684('0x32')],qs[_0xc684('0x33')](_0x210dcd['query']['fields']));_0x5df482[_0xc684('0x34')]=_0x5df482[_0xc684('0x34')][_0xc684('0x35')]?_0x5df482[_0xc684('0x34')]:_0xc0f77b[_0xc684('0x32')];if(!_0x210dcd[_0xc684('0x30')]['hasOwnProperty'](_0xc684('0x36'))){_0x5df482['limit']=qs['limit'](_0x210dcd[_0xc684('0x30')][_0xc684('0x22')]);_0x5df482['offset']=qs['offset'](_0x210dcd[_0xc684('0x30')][_0xc684('0x21')]);}_0x5df482[_0xc684('0x37')]=qs[_0xc684('0x38')](_0x210dcd[_0xc684('0x30')]['sort']);_0x5df482[_0xc684('0x39')]=qs[_0xc684('0x3a')](_['pick'](_0x210dcd['query'],_0xc0f77b[_0xc684('0x3a')]),_0x28a48a);if(_0x210dcd[_0xc684('0x30')][_0xc684('0x3b')]){_0x5df482[_0xc684('0x39')]=_[_0xc684('0x3c')](_0x5df482[_0xc684('0x39')],{'$or':_[_0xc684('0x2c')](_0x28a48a,function(_0x4889ad){if(_0x4889ad['type']!==_0xc684('0x3d')){var _0x1a863f={};_0x1a863f[_0x4889ad['name']]={'$like':'%'+_0x210dcd['query']['filter']+'%'};return _0x1a863f;}})});}_0x5df482=_[_0xc684('0x3c')]({},_0x5df482,_0x210dcd[_0xc684('0x3e')]);var _0xb1be5c={'where':_0x5df482[_0xc684('0x39')]};return db[_0xc684('0x2d')]['count'](_0xb1be5c)[_0xc684('0x3f')](function(_0x5b44eb){_0x2710c1[_0xc684('0x20')]=_0x5b44eb;if(_0x210dcd[_0xc684('0x30')][_0xc684('0x40')]){_0x5df482[_0xc684('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc684('0x42')](_0x5df482);})[_0xc684('0x3f')](function(_0xd9eae7){_0x2710c1[_0xc684('0x43')]=_0xd9eae7;return _0x2710c1;})[_0xc684('0x3f')](respondWithFilteredResult(_0x9fdc2c,_0x5df482))[_0xc684('0x44')](handleError(_0x9fdc2c,null));};exports['show']=function(_0x2b3aa7,_0x5aa42f){var _0x566c61={'raw':!![],'where':{'id':_0x2b3aa7[_0xc684('0x45')]['id']}},_0x46c6ad={};_0x46c6ad[_0xc684('0x32')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x46c6ad['query']=_['keys'](_0x2b3aa7[_0xc684('0x30')]);_0x46c6ad[_0xc684('0x3a')]=_[_0xc684('0x31')](_0x46c6ad['model'],_0x46c6ad[_0xc684('0x30')]);_0x566c61['attributes']=_[_0xc684('0x31')](_0x46c6ad['model'],qs[_0xc684('0x33')](_0x2b3aa7[_0xc684('0x30')][_0xc684('0x33')]));_0x566c61[_0xc684('0x34')]=_0x566c61[_0xc684('0x34')]['length']?_0x566c61[_0xc684('0x34')]:_0x46c6ad[_0xc684('0x32')];if(_0x2b3aa7[_0xc684('0x30')][_0xc684('0x40')]){_0x566c61[_0xc684('0x41')]=[{'all':!![]}];}_0x566c61=_[_0xc684('0x3c')]({},_0x566c61,_0x2b3aa7[_0xc684('0x3e')]);return db[_0xc684('0x2d')][_0xc684('0x46')](_0x566c61)['then'](handleEntityNotFound(_0x5aa42f,null))[_0xc684('0x3f')](respondWithResult(_0x5aa42f,null))[_0xc684('0x44')](handleError(_0x5aa42f,null));};exports['create']=function(_0x30abd0,_0x4fb1d5){return db[_0xc684('0x2d')]['create'](_0x30abd0[_0xc684('0x47')],{})[_0xc684('0x3f')](respondWithResult(_0x4fb1d5,0xc9))[_0xc684('0x44')](handleError(_0x4fb1d5,null));};exports[_0xc684('0x48')]=function(_0x1bfd8d,_0x1fde57){if(_0x1bfd8d[_0xc684('0x47')]['id']){delete _0x1bfd8d[_0xc684('0x47')]['id'];}return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1bfd8d['params']['id']}})[_0xc684('0x3f')](handleEntityNotFound(_0x1fde57,null))[_0xc684('0x3f')](saveUpdates(_0x1bfd8d['body'],null))['then'](respondWithResult(_0x1fde57,null))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x49')]=function(_0x1304a2,_0x5439ae){return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1304a2[_0xc684('0x45')]['id']}})['then'](handleEntityNotFound(_0x5439ae,null))[_0xc684('0x3f')](removeEntity(_0x5439ae,null))[_0xc684('0x44')](handleError(_0x5439ae,null));}; \ No newline at end of file +var _0x3eec=['include','findAll','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x1cf891,_0x50c9ba){_0x1cf891=_0x1cf891-0x0;var _0x5d4622=_0x3eec[_0x1cf891];return _0x5d4622;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require(_0xc3ee('0x3'));var rp=require('request-promise');var moment=require(_0xc3ee('0x4'));var BPromise=require(_0xc3ee('0x5'));var Mustache=require(_0xc3ee('0x6'));var util=require(_0xc3ee('0x7'));var path=require(_0xc3ee('0x8'));var sox=require(_0xc3ee('0x9'));var csv=require('to-csv');var ejs=require(_0xc3ee('0xa'));var fs=require('fs');var fs_extra=require(_0xc3ee('0xb'));var _=require(_0xc3ee('0xc'));var squel=require(_0xc3ee('0xd'));var crypto=require(_0xc3ee('0xe'));var jsforce=require(_0xc3ee('0xf'));var deskjs=require(_0xc3ee('0x10'));var toCsv=require(_0xc3ee('0x11'));var querystring=require(_0xc3ee('0x12'));var Papa=require(_0xc3ee('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3ee('0x14'));var as=require(_0xc3ee('0x15'));var hardwareService=require(_0xc3ee('0x16'));var logger=require(_0xc3ee('0x17'))('api');var utils=require(_0xc3ee('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc3ee('0x19'));var db=require(_0xc3ee('0x1a'))['db'];function respondWithStatusCode(_0x4beb01,_0x5f2c3a){_0x5f2c3a=_0x5f2c3a||0xcc;return function(_0x2eb82e){if(_0x2eb82e){return _0x4beb01['sendStatus'](_0x5f2c3a);}return _0x4beb01[_0xc3ee('0x1b')](_0x5f2c3a)['end']();};}function respondWithResult(_0x19feb3,_0x58ebe7){_0x58ebe7=_0x58ebe7||0xc8;return function(_0x3d669d){if(_0x3d669d){return _0x19feb3[_0xc3ee('0x1b')](_0x58ebe7)[_0xc3ee('0x1c')](_0x3d669d);}};}function respondWithFilteredResult(_0x664bad,_0x476f8f){return function(_0xf63359){if(_0xf63359){var _0x277e11=typeof _0x476f8f['offset']===_0xc3ee('0x1d')&&typeof _0x476f8f['limit']===_0xc3ee('0x1d');var _0x1bf49a=_0xf63359[_0xc3ee('0x1e')];var _0x219db0=_0x277e11?0x0:_0x476f8f[_0xc3ee('0x1f')];var _0x3acb0c=_0x277e11?_0xf63359[_0xc3ee('0x1e')]:_0x476f8f[_0xc3ee('0x1f')]+_0x476f8f[_0xc3ee('0x20')];var _0x202a9a;if(_0x3acb0c>=_0x1bf49a){_0x3acb0c=_0x1bf49a;_0x202a9a=0xc8;}else{_0x202a9a=0xce;}_0x664bad[_0xc3ee('0x1b')](_0x202a9a);return _0x664bad[_0xc3ee('0x21')](_0xc3ee('0x22'),_0x219db0+'-'+_0x3acb0c+'/'+_0x1bf49a)[_0xc3ee('0x1c')](_0xf63359);}return null;};}function patchUpdates(_0x3e7224){return function(_0x46a8c9){try{jsonpatch[_0xc3ee('0x23')](_0x46a8c9,_0x3e7224,!![]);}catch(_0x30df3a){return BPromise[_0xc3ee('0x24')](_0x30df3a);}return _0x46a8c9[_0xc3ee('0x25')]();};}function saveUpdates(_0x11778f,_0x493fea){return function(_0x4d672e){if(_0x4d672e){return _0x4d672e[_0xc3ee('0x26')](_0x11778f)[_0xc3ee('0x27')](function(_0x3b8f75){return _0x3b8f75;});}return null;};}function removeEntity(_0x464ffc,_0x28bfeb){return function(_0x238df7){if(_0x238df7){return _0x238df7['destroy']()[_0xc3ee('0x27')](function(){_0x464ffc[_0xc3ee('0x1b')](0xcc)[_0xc3ee('0x28')]();});}};}function handleEntityNotFound(_0xfd03bd,_0x5c366e){return function(_0x525ae5){if(!_0x525ae5){_0xfd03bd['sendStatus'](0x194);}return _0x525ae5;};}function handleError(_0x383bd9,_0x28522d){_0x28522d=_0x28522d||0x1f4;return function(_0x3d8c79){logger[_0xc3ee('0x29')](_0x3d8c79[_0xc3ee('0x2a')]);if(_0x3d8c79['name']){delete _0x3d8c79['name'];}_0x383bd9['status'](_0x28522d)[_0xc3ee('0x2b')](_0x3d8c79);};}exports[_0xc3ee('0x2c')]=function(_0x44678b,_0x2fba96){var _0x2cdd85={},_0x50ffaa={},_0x13f30d={'count':0x0,'rows':[]};var _0xfa3111=_[_0xc3ee('0x2d')](db[_0xc3ee('0x2e')][_0xc3ee('0x2f')],function(_0x8bbe1e){return{'name':_0x8bbe1e[_0xc3ee('0x30')],'type':_0x8bbe1e['type'][_0xc3ee('0x31')]};});_0x50ffaa[_0xc3ee('0x32')]=_[_0xc3ee('0x2d')](_0xfa3111,'name');_0x50ffaa[_0xc3ee('0x33')]=_[_0xc3ee('0x34')](_0x44678b[_0xc3ee('0x33')]);_0x50ffaa[_0xc3ee('0x35')]=_[_0xc3ee('0x36')](_0x50ffaa[_0xc3ee('0x32')],_0x50ffaa[_0xc3ee('0x33')]);_0x2cdd85['attributes']=_[_0xc3ee('0x36')](_0x50ffaa['model'],qs[_0xc3ee('0x37')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x37')]));_0x2cdd85[_0xc3ee('0x38')]=_0x2cdd85[_0xc3ee('0x38')][_0xc3ee('0x39')]?_0x2cdd85['attributes']:_0x50ffaa[_0xc3ee('0x32')];if(!_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x3a')](_0xc3ee('0x3b'))){_0x2cdd85[_0xc3ee('0x20')]=qs[_0xc3ee('0x20')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x20')]);_0x2cdd85[_0xc3ee('0x1f')]=qs[_0xc3ee('0x1f')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x1f')]);}_0x2cdd85[_0xc3ee('0x3c')]=qs[_0xc3ee('0x3d')](_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x3d')]);_0x2cdd85[_0xc3ee('0x3e')]=qs[_0xc3ee('0x35')](_[_0xc3ee('0x3f')](_0x44678b[_0xc3ee('0x33')],_0x50ffaa[_0xc3ee('0x35')]),_0xfa3111);if(_0x44678b['query'][_0xc3ee('0x40')]){_0x2cdd85['where']=_[_0xc3ee('0x41')](_0x2cdd85[_0xc3ee('0x3e')],{'$or':_[_0xc3ee('0x2d')](_0xfa3111,function(_0x1544f3){if(_0x1544f3[_0xc3ee('0x42')]!==_0xc3ee('0x43')){var _0x5e7dcd={};_0x5e7dcd[_0x1544f3[_0xc3ee('0x44')]]={'$like':'%'+_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x40')]+'%'};return _0x5e7dcd;}})});}_0x2cdd85=_['merge']({},_0x2cdd85,_0x44678b[_0xc3ee('0x45')]);var _0x105ecc={'where':_0x2cdd85[_0xc3ee('0x3e')]};return db[_0xc3ee('0x2e')][_0xc3ee('0x1e')](_0x105ecc)[_0xc3ee('0x27')](function(_0x381e68){_0x13f30d[_0xc3ee('0x1e')]=_0x381e68;if(_0x44678b[_0xc3ee('0x33')][_0xc3ee('0x46')]){_0x2cdd85[_0xc3ee('0x47')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc3ee('0x48')](_0x2cdd85);})[_0xc3ee('0x27')](function(_0x4a89b7){_0x13f30d['rows']=_0x4a89b7;return _0x13f30d;})[_0xc3ee('0x27')](respondWithFilteredResult(_0x2fba96,_0x2cdd85))[_0xc3ee('0x49')](handleError(_0x2fba96,null));};exports[_0xc3ee('0x4a')]=function(_0x51c70e,_0x28b167){var _0x92a306={'raw':!![],'where':{'id':_0x51c70e[_0xc3ee('0x4b')]['id']}},_0x112e77={};_0x112e77[_0xc3ee('0x32')]=_[_0xc3ee('0x34')](db[_0xc3ee('0x2e')][_0xc3ee('0x2f')]);_0x112e77[_0xc3ee('0x33')]=_[_0xc3ee('0x34')](_0x51c70e[_0xc3ee('0x33')]);_0x112e77[_0xc3ee('0x35')]=_[_0xc3ee('0x36')](_0x112e77[_0xc3ee('0x32')],_0x112e77['query']);_0x92a306[_0xc3ee('0x38')]=_['intersection'](_0x112e77['model'],qs[_0xc3ee('0x37')](_0x51c70e[_0xc3ee('0x33')]['fields']));_0x92a306[_0xc3ee('0x38')]=_0x92a306[_0xc3ee('0x38')]['length']?_0x92a306[_0xc3ee('0x38')]:_0x112e77['model'];if(_0x51c70e[_0xc3ee('0x33')]['includeAll']){_0x92a306[_0xc3ee('0x47')]=[{'all':!![]}];}_0x92a306=_[_0xc3ee('0x41')]({},_0x92a306,_0x51c70e['options']);return db['FreshdeskField']['find'](_0x92a306)[_0xc3ee('0x27')](handleEntityNotFound(_0x28b167,null))[_0xc3ee('0x27')](respondWithResult(_0x28b167,null))[_0xc3ee('0x49')](handleError(_0x28b167,null));};exports[_0xc3ee('0x4c')]=function(_0x972860,_0x5b5f5c){return db['FreshdeskField'][_0xc3ee('0x4c')](_0x972860[_0xc3ee('0x4d')],{})['then'](respondWithResult(_0x5b5f5c,0xc9))[_0xc3ee('0x49')](handleError(_0x5b5f5c,null));};exports['update']=function(_0x60e36a,_0x5d0017){if(_0x60e36a[_0xc3ee('0x4d')]['id']){delete _0x60e36a[_0xc3ee('0x4d')]['id'];}return db[_0xc3ee('0x2e')][_0xc3ee('0x4e')]({'where':{'id':_0x60e36a[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x5d0017,null))[_0xc3ee('0x27')](saveUpdates(_0x60e36a['body'],null))[_0xc3ee('0x27')](respondWithResult(_0x5d0017,null))[_0xc3ee('0x49')](handleError(_0x5d0017,null));};exports[_0xc3ee('0x4f')]=function(_0x237aa8,_0x47d12c){return db[_0xc3ee('0x2e')][_0xc3ee('0x4e')]({'where':{'id':_0x237aa8[_0xc3ee('0x4b')]['id']}})[_0xc3ee('0x27')](handleEntityNotFound(_0x47d12c,null))[_0xc3ee('0x27')](removeEntity(_0x47d12c,null))[_0xc3ee('0x49')](handleError(_0x47d12c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ce95be5..e79f17c 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 _0x4706=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField'];(function(_0x540d72,_0x5e2efb){var _0x425180=function(_0x3a040b){while(--_0x3a040b){_0x540d72['push'](_0x540d72['shift']());}};_0x425180(++_0x5e2efb);}(_0x4706,0xf1));var _0x6470=function(_0x2f1c23,_0x4ada81){_0x2f1c23=_0x2f1c23-0x0;var _0x2f2e30=_0x4706[_0x2f1c23];return _0x2f2e30;};'use strict';var _=require('lodash');var util=require(_0x6470('0x0'));var logger=require(_0x6470('0x1'))(_0x6470('0x2'));var moment=require(_0x6470('0x3'));var BPromise=require(_0x6470('0x4'));var rp=require(_0x6470('0x5'));var fs=require('fs');var path=require(_0x6470('0x6'));var rimraf=require(_0x6470('0x7'));var config=require(_0x6470('0x8'));var attributes=require(_0x6470('0x9'));module[_0x6470('0xa')]=function(_0x4174f3,_0x329ea0){return _0x4174f3['define'](_0x6470('0xb'),attributes,{'tableName':_0x6470('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x6470('0xd'),_0x6470('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6d8=['../../config/logger','moment','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x5b9822,_0x3c1505){var _0x263fc0=function(_0x5eaa06){while(--_0x5eaa06){_0x5b9822['push'](_0x5b9822['shift']());}};_0x263fc0(++_0x3c1505);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x380d16,_0xdf0d31){_0x380d16=_0x380d16-0x0;var _0x5d5253=_0xc6d8[_0x380d16];return _0x5d5253;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var logger=require(_0x8c6d('0x1'))('api');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c6d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c6d('0x4'));var attributes=require(_0x8c6d('0x5'));module[_0x8c6d('0x6')]=function(_0x4f5e8f,_0x3c265c){return _0x4f5e8f[_0x8c6d('0x7')](_0x8c6d('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x8c6d('0x9'),'fields':[_0x8c6d('0xa'),_0x8c6d('0xb')],'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 f7fe0c6..abae683 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 _0x22f9=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x1c1a2c,_0x12cf5a){var _0x16c655=function(_0x33e73c){while(--_0x33e73c){_0x1c1a2c['push'](_0x1c1a2c['shift']());}};_0x16c655(++_0x12cf5a);}(_0x22f9,0x6f));var _0x922f=function(_0x1fa83d,_0x1b8f12){_0x1fa83d=_0x1fa83d-0x0;var _0x57eda5=_0x22f9[_0x1fa83d];return _0x57eda5;};'use strict';var _=require(_0x922f('0x0'));var util=require('util');var moment=require(_0x922f('0x1'));var BPromise=require(_0x922f('0x2'));var rs=require(_0x922f('0x3'));var fs=require('fs');var Redis=require(_0x922f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x922f('0x5'))('rpc');var config=require(_0x922f('0x6'));var jayson=require(_0x922f('0x7'));var client=jayson[_0x922f('0x8')][_0x922f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dde37,_0x1b57c7,_0x3a2cbd){return new BPromise(function(_0x5885a8,_0x518377){return client['request'](_0x2dde37,_0x3a2cbd)[_0x922f('0xa')](function(_0x8407a6){logger[_0x922f('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x1b57c7,_0x922f('0xc'));logger['debug'](_0x922f('0xd'),_0x1b57c7,_0x922f('0xc'),JSON['stringify'](_0x8407a6));if(_0x8407a6[_0x922f('0xe')]){if(_0x8407a6[_0x922f('0xe')]['code']===0x1f4){logger[_0x922f('0xe')](_0x922f('0xf'),_0x1b57c7,_0x8407a6['error'][_0x922f('0x10')]);return _0x518377(_0x8407a6[_0x922f('0xe')][_0x922f('0x10')]);}logger['error'](_0x922f('0xf'),_0x1b57c7,_0x8407a6[_0x922f('0xe')][_0x922f('0x10')]);return _0x5885a8(_0x8407a6[_0x922f('0xe')][_0x922f('0x10')]);}else{logger[_0x922f('0xb')](_0x922f('0xf'),_0x1b57c7,'request\x20sent');_0x5885a8(_0x8407a6[_0x922f('0x11')][_0x922f('0x10')]);}})[_0x922f('0x12')](function(_0x20b48c){logger[_0x922f('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x1b57c7,_0x20b48c);_0x518377(_0x20b48c);});});} \ No newline at end of file +var _0x383b=['stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x4b5a9f,_0x3bbdf0){var _0x53163a=function(_0x521abc){while(--_0x521abc){_0x4b5a9f['push'](_0x4b5a9f['shift']());}};_0x53163a(++_0x3bbdf0);}(_0x383b,0x1d4));var _0xb383=function(_0x2639cd,_0x23538c){_0x2639cd=_0x2639cd-0x0;var _0x4f58c9=_0x383b[_0x2639cd];return _0x4f58c9;};'use strict';var _=require(_0xb383('0x0'));var util=require(_0xb383('0x1'));var moment=require(_0xb383('0x2'));var BPromise=require(_0xb383('0x3'));var rs=require(_0xb383('0x4'));var fs=require('fs');var Redis=require(_0xb383('0x5'));var db=require(_0xb383('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb383('0x7'));var config=require(_0xb383('0x8'));var jayson=require(_0xb383('0x9'));var client=jayson['client'][_0xb383('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ff1dd,_0xcb3ed7,_0x33723b){return new BPromise(function(_0x104a05,_0x2b3aeb){return client[_0xb383('0xb')](_0x2ff1dd,_0x33723b)['then'](function(_0x3f89e0){logger['info']('FreshdeskField,\x20%s,\x20%s',_0xcb3ed7,_0xb383('0xc'));logger[_0xb383('0xd')](_0xb383('0xe'),_0xcb3ed7,_0xb383('0xc'),JSON[_0xb383('0xf')](_0x3f89e0));if(_0x3f89e0[_0xb383('0x10')]){if(_0x3f89e0[_0xb383('0x10')][_0xb383('0x11')]===0x1f4){logger[_0xb383('0x10')](_0xb383('0x12'),_0xcb3ed7,_0x3f89e0[_0xb383('0x10')][_0xb383('0x13')]);return _0x2b3aeb(_0x3f89e0[_0xb383('0x10')][_0xb383('0x13')]);}logger[_0xb383('0x10')]('FreshdeskField,\x20%s,\x20%s',_0xcb3ed7,_0x3f89e0[_0xb383('0x10')][_0xb383('0x13')]);return _0x104a05(_0x3f89e0[_0xb383('0x10')][_0xb383('0x13')]);}else{logger[_0xb383('0x14')]('FreshdeskField,\x20%s,\x20%s',_0xcb3ed7,_0xb383('0xc'));_0x104a05(_0x3f89e0[_0xb383('0x15')][_0xb383('0x13')]);}})[_0xb383('0x16')](function(_0x53dcc4){logger[_0xb383('0x10')]('FreshdeskField,\x20%s,\x20%s',_0xcb3ed7,_0x53dcc4);_0x2b3aeb(_0x53dcc4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 294701a..d7011a7 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 _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x29e3ec,_0x138a18){var _0x25727e=function(_0x2bea0d){while(--_0x2bea0d){_0x29e3ec['push'](_0x29e3ec['shift']());}};_0x25727e(++_0x138a18);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x494e7e,_0x2c500e){_0x494e7e=_0x494e7e-0x0;var _0x4ffd2b=_0x9ffd[_0x494e7e];return _0x4ffd2b;};'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['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file +var _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x6992b4,_0x1fba6c){_0x6992b4=_0x6992b4-0x0;var _0x54ccbf=_0x9ffd[_0x6992b4];return _0x54ccbf;};'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['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index fe18ee6..d48b49c 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 _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9536,0x179));var _0x6953=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x9536[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xfef3,0x118));var _0x3fef=function(_0x1db803,_0x582d17){_0x1db803=_0x1db803-0x0;var _0x50aae9=_0xfef3[_0x1db803];return _0x50aae9;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 22ec076..f79cbef 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 _0x2dd3=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','FreshsalesAccount','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf'];(function(_0x46ae87,_0x4bd053){var _0x303fcc=function(_0xf522b9){while(--_0xf522b9){_0x46ae87['push'](_0x46ae87['shift']());}};_0x303fcc(++_0x4bd053);}(_0x2dd3,0x69));var _0x32dd=function(_0x5d161d,_0x2786a3){_0x5d161d=_0x5d161d-0x0;var _0x40cf1c=_0x2dd3[_0x5d161d];return _0x40cf1c;};'use strict';var emlformat=require(_0x32dd('0x0'));var rimraf=require(_0x32dd('0x1'));var zipdir=require(_0x32dd('0x2'));var jsonpatch=require(_0x32dd('0x3'));var rp=require(_0x32dd('0x4'));var moment=require('moment');var BPromise=require(_0x32dd('0x5'));var Mustache=require(_0x32dd('0x6'));var util=require('util');var path=require(_0x32dd('0x7'));var sox=require(_0x32dd('0x8'));var csv=require(_0x32dd('0x9'));var ejs=require(_0x32dd('0xa'));var fs=require('fs');var fs_extra=require(_0x32dd('0xb'));var _=require(_0x32dd('0xc'));var squel=require(_0x32dd('0xd'));var crypto=require('crypto');var jsforce=require(_0x32dd('0xe'));var deskjs=require(_0x32dd('0xf'));var toCsv=require(_0x32dd('0x9'));var querystring=require('querystring');var Papa=require(_0x32dd('0x10'));var Redis=require('ioredis');var authService=require(_0x32dd('0x11'));var qs=require(_0x32dd('0x12'));var as=require(_0x32dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32dd('0x14'))(_0x32dd('0x15'));var utils=require(_0x32dd('0x16'));var config=require(_0x32dd('0x17'));var licenseUtil=require(_0x32dd('0x18'));var db=require(_0x32dd('0x19'))['db'];var integrations=require(_0x32dd('0x1a'));function respondWithStatusCode(_0x5d71ea,_0x139095){_0x139095=_0x139095||0xcc;return function(_0x419309){if(_0x419309){return _0x5d71ea[_0x32dd('0x1b')](_0x139095);}return _0x5d71ea[_0x32dd('0x1c')](_0x139095)['end']();};}function respondWithResult(_0x4acd31,_0x140ac7){_0x140ac7=_0x140ac7||0xc8;return function(_0xad78b9){if(_0xad78b9){return _0x4acd31[_0x32dd('0x1c')](_0x140ac7)[_0x32dd('0x1d')](_0xad78b9);}};}function respondWithFilteredResult(_0x384882,_0x59489d){return function(_0x11c26b){if(_0x11c26b){var _0x272ae0=typeof _0x59489d[_0x32dd('0x1e')]===_0x32dd('0x1f')&&typeof _0x59489d['limit']===_0x32dd('0x1f');var _0x52c444=_0x11c26b[_0x32dd('0x20')];var _0x496472=_0x272ae0?0x0:_0x59489d[_0x32dd('0x1e')];var _0x76b70d=_0x272ae0?_0x11c26b['count']:_0x59489d[_0x32dd('0x1e')]+_0x59489d['limit'];var _0x4a9aa3;if(_0x76b70d>=_0x52c444){_0x76b70d=_0x52c444;_0x4a9aa3=0xc8;}else{_0x4a9aa3=0xce;}_0x384882[_0x32dd('0x1c')](_0x4a9aa3);return _0x384882[_0x32dd('0x21')](_0x32dd('0x22'),_0x496472+'-'+_0x76b70d+'/'+_0x52c444)[_0x32dd('0x1d')](_0x11c26b);}return null;};}function patchUpdates(_0x53a3c4){return function(_0x532ce7){try{jsonpatch[_0x32dd('0x23')](_0x532ce7,_0x53a3c4,!![]);}catch(_0x203805){return BPromise['reject'](_0x203805);}return _0x532ce7[_0x32dd('0x24')]();};}function saveUpdates(_0xe2ba4d,_0x4b4dbb){return function(_0x32ffde){if(_0x32ffde){return _0x32ffde[_0x32dd('0x25')](_0xe2ba4d)[_0x32dd('0x26')](function(_0x588f29){return _0x588f29;});}return null;};}function removeEntity(_0x1d9531,_0x3808fe){return function(_0x1a3bca){if(_0x1a3bca){return _0x1a3bca[_0x32dd('0x27')]()['then'](function(){_0x1d9531[_0x32dd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x328f42,_0x4b32ae){return function(_0x1a491f){if(!_0x1a491f){_0x328f42[_0x32dd('0x1b')](0x194);}return _0x1a491f;};}function handleError(_0x26cbc1,_0x115c3e){_0x115c3e=_0x115c3e||0x1f4;return function(_0x252987){logger['error'](_0x252987[_0x32dd('0x28')]);if(_0x252987[_0x32dd('0x29')]){delete _0x252987[_0x32dd('0x29')];}_0x26cbc1['status'](_0x115c3e)[_0x32dd('0x2a')](_0x252987);};}exports[_0x32dd('0x2b')]=function(_0x5f356c,_0x485805){var _0x17014e={},_0x4cc0a7={},_0x13c6a0={'count':0x0,'rows':[]};var _0x5ca97c=_['map'](db[_0x32dd('0x2c')]['rawAttributes'],function(_0x5e5e82){return{'name':_0x5e5e82[_0x32dd('0x2d')],'type':_0x5e5e82[_0x32dd('0x2e')]['key']};});_0x4cc0a7['model']=_[_0x32dd('0x2f')](_0x5ca97c,_0x32dd('0x29'));_0x4cc0a7[_0x32dd('0x30')]=_[_0x32dd('0x31')](_0x5f356c['query']);_0x4cc0a7[_0x32dd('0x32')]=_[_0x32dd('0x33')](_0x4cc0a7[_0x32dd('0x34')],_0x4cc0a7[_0x32dd('0x30')]);_0x17014e[_0x32dd('0x35')]=_['intersection'](_0x4cc0a7[_0x32dd('0x34')],qs[_0x32dd('0x36')](_0x5f356c['query'][_0x32dd('0x36')]));_0x17014e[_0x32dd('0x35')]=_0x17014e['attributes']['length']?_0x17014e[_0x32dd('0x35')]:_0x4cc0a7[_0x32dd('0x34')];if(!_0x5f356c[_0x32dd('0x30')][_0x32dd('0x37')](_0x32dd('0x38'))){_0x17014e['limit']=qs[_0x32dd('0x39')](_0x5f356c[_0x32dd('0x30')][_0x32dd('0x39')]);_0x17014e[_0x32dd('0x1e')]=qs[_0x32dd('0x1e')](_0x5f356c[_0x32dd('0x30')][_0x32dd('0x1e')]);}_0x17014e[_0x32dd('0x3a')]=qs[_0x32dd('0x3b')](_0x5f356c[_0x32dd('0x30')][_0x32dd('0x3b')]);_0x17014e[_0x32dd('0x3c')]=qs[_0x32dd('0x32')](_[_0x32dd('0x3d')](_0x5f356c['query'],_0x4cc0a7[_0x32dd('0x32')]),_0x5ca97c);if(_0x5f356c['query'][_0x32dd('0x3e')]){_0x17014e['where']=_['merge'](_0x17014e[_0x32dd('0x3c')],{'$or':_['map'](_0x5ca97c,function(_0x31a138){if(_0x31a138[_0x32dd('0x2e')]!==_0x32dd('0x3f')){var _0x331abb={};_0x331abb[_0x31a138[_0x32dd('0x29')]]={'$like':'%'+_0x5f356c[_0x32dd('0x30')]['filter']+'%'};return _0x331abb;}})});}_0x17014e=_[_0x32dd('0x40')]({},_0x17014e,_0x5f356c[_0x32dd('0x41')]);var _0x1216b6={'where':_0x17014e[_0x32dd('0x3c')]};return db['FreshsalesAccount']['count'](_0x1216b6)[_0x32dd('0x26')](function(_0x40eb9e){_0x13c6a0[_0x32dd('0x20')]=_0x40eb9e;if(_0x5f356c[_0x32dd('0x30')][_0x32dd('0x42')]){_0x17014e[_0x32dd('0x43')]=[{'all':!![]}];}return db[_0x32dd('0x2c')][_0x32dd('0x44')](_0x17014e);})[_0x32dd('0x26')](function(_0x4b2106){_0x13c6a0[_0x32dd('0x45')]=_0x4b2106;return _0x13c6a0;})[_0x32dd('0x26')](respondWithFilteredResult(_0x485805,_0x17014e))[_0x32dd('0x46')](handleError(_0x485805,null));};exports[_0x32dd('0x47')]=function(_0x8e3299,_0x22f025){var _0x2220a5={'raw':![],'where':{'id':_0x8e3299[_0x32dd('0x48')]['id']}},_0x642fd8={};_0x642fd8[_0x32dd('0x34')]=_['keys'](db[_0x32dd('0x2c')][_0x32dd('0x49')]);_0x642fd8[_0x32dd('0x30')]=_[_0x32dd('0x31')](_0x8e3299[_0x32dd('0x30')]);_0x642fd8['filters']=_['intersection'](_0x642fd8[_0x32dd('0x34')],_0x642fd8['query']);_0x2220a5[_0x32dd('0x35')]=_['intersection'](_0x642fd8['model'],qs[_0x32dd('0x36')](_0x8e3299[_0x32dd('0x30')][_0x32dd('0x36')]));_0x2220a5[_0x32dd('0x35')]=_0x2220a5[_0x32dd('0x35')][_0x32dd('0x4a')]?_0x2220a5[_0x32dd('0x35')]:_0x642fd8['model'];if(_0x8e3299[_0x32dd('0x30')]['includeAll']){_0x2220a5[_0x32dd('0x43')]=[{'all':!![]}];}_0x2220a5=_[_0x32dd('0x40')]({},_0x2220a5,_0x8e3299[_0x32dd('0x41')]);return db[_0x32dd('0x2c')][_0x32dd('0x4b')](_0x2220a5)[_0x32dd('0x26')](handleEntityNotFound(_0x22f025,null))[_0x32dd('0x26')](respondWithResult(_0x22f025,null))['catch'](handleError(_0x22f025,null));};exports[_0x32dd('0x4c')]=function(_0x1edadc,_0x4be239){return db['FreshsalesAccount']['create'](_0x1edadc[_0x32dd('0x4d')],{})[_0x32dd('0x26')](respondWithResult(_0x4be239,0xc9))['catch'](handleError(_0x4be239,null));};exports[_0x32dd('0x25')]=function(_0x2a1fde,_0x2fe276){if(_0x2a1fde[_0x32dd('0x4d')]['id']){delete _0x2a1fde[_0x32dd('0x4d')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x2a1fde['params']['id']}})[_0x32dd('0x26')](handleEntityNotFound(_0x2fe276,null))[_0x32dd('0x26')](saveUpdates(_0x2a1fde[_0x32dd('0x4d')],null))[_0x32dd('0x26')](respondWithResult(_0x2fe276,null))[_0x32dd('0x46')](handleError(_0x2fe276,null));};exports[_0x32dd('0x27')]=function(_0x5648a3,_0x525b6e){return db[_0x32dd('0x2c')][_0x32dd('0x4b')]({'where':{'id':_0x5648a3[_0x32dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x525b6e,null))['then'](removeEntity(_0x525b6e,null))['catch'](handleError(_0x525b6e,null));};exports[_0x32dd('0x4e')]=function(_0x4d412a,_0x2ff7ec,_0x1bff46){var _0x56ec65={};var _0x296a95={};var _0x543c64;var _0x54698d;return db[_0x32dd('0x2c')][_0x32dd('0x4f')]({'where':{'id':_0x4d412a[_0x32dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2ff7ec,null))[_0x32dd('0x26')](function(_0x48eb5a){if(_0x48eb5a){_0x543c64=_0x48eb5a;_0x296a95[_0x32dd('0x34')]=_[_0x32dd('0x31')](db[_0x32dd('0x50')][_0x32dd('0x49')]);_0x296a95[_0x32dd('0x30')]=_['keys'](_0x4d412a[_0x32dd('0x30')]);_0x296a95[_0x32dd('0x32')]=_['intersection'](_0x296a95['model'],_0x296a95[_0x32dd('0x30')]);_0x56ec65[_0x32dd('0x35')]=_[_0x32dd('0x33')](_0x296a95[_0x32dd('0x34')],qs['fields'](_0x4d412a[_0x32dd('0x30')][_0x32dd('0x36')]));_0x56ec65[_0x32dd('0x35')]=_0x56ec65[_0x32dd('0x35')][_0x32dd('0x4a')]?_0x56ec65['attributes']:_0x296a95['model'];_0x56ec65[_0x32dd('0x3a')]=qs[_0x32dd('0x3b')](_0x4d412a[_0x32dd('0x30')][_0x32dd('0x3b')]);_0x56ec65[_0x32dd('0x3c')]=qs[_0x32dd('0x32')](_[_0x32dd('0x3d')](_0x4d412a[_0x32dd('0x30')],_0x296a95[_0x32dd('0x32')]));if(_0x4d412a[_0x32dd('0x30')]['filter']){_0x56ec65[_0x32dd('0x3c')]=_['merge'](_0x56ec65[_0x32dd('0x3c')],{'$or':_['map'](_0x56ec65[_0x32dd('0x35')],function(_0x4a74f9){var _0x2490f0={};_0x2490f0[_0x4a74f9]={'$like':'%'+_0x4d412a[_0x32dd('0x30')]['filter']+'%'};return _0x2490f0;})});}_0x56ec65=_['merge']({},_0x56ec65,_0x4d412a[_0x32dd('0x41')]);return _0x543c64[_0x32dd('0x4e')](_0x56ec65);}})[_0x32dd('0x26')](function(_0x595714){if(_0x595714){_0x54698d=_0x595714[_0x32dd('0x4a')];if(!_0x4d412a[_0x32dd('0x30')][_0x32dd('0x37')]('nolimit')){_0x56ec65[_0x32dd('0x39')]=qs[_0x32dd('0x39')](_0x4d412a['query'][_0x32dd('0x39')]);_0x56ec65[_0x32dd('0x1e')]=qs['offset'](_0x4d412a[_0x32dd('0x30')][_0x32dd('0x1e')]);}return _0x543c64['getConfigurations'](_0x56ec65);}})['then'](function(_0x395f71){if(_0x395f71){return _0x395f71?{'count':_0x54698d,'rows':_0x395f71}:null;}})[_0x32dd('0x26')](respondWithResult(_0x2ff7ec,null))['catch'](handleError(_0x2ff7ec,null));};exports[_0x32dd('0x51')]=function(_0x5a536a,_0x558fe5,_0x4a3cf4){if(_0x5a536a[_0x32dd('0x4d')]['id']){delete _0x5a536a[_0x32dd('0x4d')]['id'];}return db['FreshsalesAccount'][_0x32dd('0x4f')]({'where':{'id':_0x5a536a[_0x32dd('0x48')]['id']}})[_0x32dd('0x26')](handleEntityNotFound(_0x558fe5,null))[_0x32dd('0x26')](function(_0x5b66ab){if(_0x5b66ab){_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x52')]=_0x5b66ab['id'];_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x53')]=integrations[_0x32dd('0x54')](_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x55')],_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x2e')]);_0x5a536a['body'][_0x32dd('0x56')]=integrations[_0x32dd('0x57')](_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x55')],_0x5a536a[_0x32dd('0x4d')][_0x32dd('0x2e')]);return db[_0x32dd('0x50')][_0x32dd('0x4c')](_0x5a536a[_0x32dd('0x4d')],{'include':[{'model':db[_0x32dd('0x58')],'as':_0x32dd('0x53')},{'model':db['FreshsalesField'],'as':_0x32dd('0x56')}]});}return null;})[_0x32dd('0x26')](respondWithResult(_0x558fe5,null))[_0x32dd('0x46')](handleError(_0x558fe5,null));};exports[_0x32dd('0x59')]=function(_0x29e045,_0x587fdb,_0x4389cb){var _0x484ccd='';var _0x5867b4='';return db[_0x32dd('0x2c')]['findOne']({'where':{'id':_0x29e045['params']['id']},'attributes':['id',_0x32dd('0x5a'),_0x32dd('0x5b'),_0x32dd('0x5c')]})['then'](handleEntityNotFound(_0x587fdb,null))['then'](function(_0x54e452){if(_0x54e452){_0x5867b4=_0x54e452[_0x32dd('0x5a')];_0x484ccd=_0x54e452['remoteUri'];var _0x1fb7b8=_0x54e452['remoteUri'][_0x32dd('0x5d')](-0x1);if(_0x1fb7b8==='/'){_0x484ccd=_0x484ccd[_0x32dd('0x5e')](0x0,_0x484ccd[_0x32dd('0x5f')](_0x1fb7b8));}return rp({'method':_0x32dd('0x60'),'uri':util['format'](_0x32dd('0x61'),_0x484ccd,'/api/selector/owners'),'headers':{'Authorization':_0x32dd('0x62')+_0x54e452[_0x32dd('0x5c')]},'json':!![]});}})[_0x32dd('0x26')](function(_0x3b2f4f){if(_0x3b2f4f){var _0x591687=_0x3b2f4f[_0x32dd('0x63')];var _0x317202=![];var _0x1193fe=null;for(_0x1193fe=0x0;_0x1193fe<_0x591687[_0x32dd('0x4a')];_0x1193fe++){if(_0x591687[_0x1193fe][_0x32dd('0x64')]===_0x5867b4){_0x317202=!![];}}if(_0x317202){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x32dd('0x65')});}}})[_0x32dd('0x26')](respondWithResult(_0x587fdb,null))[_0x32dd('0x46')](function(_0x3ca538){var _0x3ed410=_0x29e045[_0x32dd('0x30')][_0x32dd('0x66')]?0x1f4:_0x3ca538[_0x32dd('0x67')]||0x1f4;logger[_0x32dd('0x68')]('getFields,\x20%s,\x20%s,\x20%s',_0x32dd('0x59'),_0x3ed410,JSON[_0x32dd('0x69')](_0x3ca538));delete _0x3ca538['name'];if(_0x3ed410===0x191){_0x3ed410=0x190;}_0x587fdb[_0x32dd('0x1c')](_0x3ed410)[_0x32dd('0x2a')](_0x29e045[_0x32dd('0x30')][_0x32dd('0x66')]?{'message':_0x32dd('0x6a'),'statusCode':_0x3ca538[_0x32dd('0x67')]}:_0x3ca538);});}; \ No newline at end of file +var _0x5134=['filters','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','catch','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','order','AccountId','Descriptions','getDescriptions','channel','FreshsalesField','getFields','remoteUri','username','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','apiKey','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x172808,_0x365f44){var _0x4069f4=function(_0xf2320c){while(--_0xf2320c){_0x172808['push'](_0x172808['shift']());}};_0x4069f4(++_0x365f44);}(_0x5134,0x15d));var _0x4513=function(_0x487f15,_0x1cf5fb){_0x487f15=_0x487f15-0x0;var _0x32c8a1=_0x5134[_0x487f15];return _0x32c8a1;};'use strict';var emlformat=require(_0x4513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4513('0x1'));var jsonpatch=require(_0x4513('0x2'));var rp=require('request-promise');var moment=require(_0x4513('0x3'));var BPromise=require(_0x4513('0x4'));var Mustache=require(_0x4513('0x5'));var util=require('util');var path=require(_0x4513('0x6'));var sox=require(_0x4513('0x7'));var csv=require(_0x4513('0x8'));var ejs=require(_0x4513('0x9'));var fs=require('fs');var fs_extra=require(_0x4513('0xa'));var _=require(_0x4513('0xb'));var squel=require(_0x4513('0xc'));var crypto=require(_0x4513('0xd'));var jsforce=require(_0x4513('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4513('0x8'));var querystring=require(_0x4513('0xf'));var Papa=require(_0x4513('0x10'));var Redis=require(_0x4513('0x11'));var authService=require(_0x4513('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4513('0x13'));var logger=require(_0x4513('0x14'))(_0x4513('0x15'));var utils=require(_0x4513('0x16'));var config=require(_0x4513('0x17'));var licenseUtil=require(_0x4513('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4513('0x19'));function respondWithStatusCode(_0x4bf8d2,_0xa0714d){_0xa0714d=_0xa0714d||0xcc;return function(_0x595d00){if(_0x595d00){return _0x4bf8d2['sendStatus'](_0xa0714d);}return _0x4bf8d2[_0x4513('0x1a')](_0xa0714d)[_0x4513('0x1b')]();};}function respondWithResult(_0x5d2084,_0x40ab05){_0x40ab05=_0x40ab05||0xc8;return function(_0x179ea9){if(_0x179ea9){return _0x5d2084['status'](_0x40ab05)[_0x4513('0x1c')](_0x179ea9);}};}function respondWithFilteredResult(_0x2386bf,_0x4150f1){return function(_0x17a5ae){if(_0x17a5ae){var _0x3ea855=typeof _0x4150f1[_0x4513('0x1d')]===_0x4513('0x1e')&&typeof _0x4150f1[_0x4513('0x1f')]===_0x4513('0x1e');var _0x5b67ec=_0x17a5ae['count'];var _0x37a0d1=_0x3ea855?0x0:_0x4150f1[_0x4513('0x1d')];var _0xef6e65=_0x3ea855?_0x17a5ae[_0x4513('0x20')]:_0x4150f1['offset']+_0x4150f1[_0x4513('0x1f')];var _0x5c37fa;if(_0xef6e65>=_0x5b67ec){_0xef6e65=_0x5b67ec;_0x5c37fa=0xc8;}else{_0x5c37fa=0xce;}_0x2386bf['status'](_0x5c37fa);return _0x2386bf[_0x4513('0x21')](_0x4513('0x22'),_0x37a0d1+'-'+_0xef6e65+'/'+_0x5b67ec)[_0x4513('0x1c')](_0x17a5ae);}return null;};}function patchUpdates(_0x20ed28){return function(_0x529c65){try{jsonpatch[_0x4513('0x23')](_0x529c65,_0x20ed28,!![]);}catch(_0x5e549a){return BPromise[_0x4513('0x24')](_0x5e549a);}return _0x529c65['save']();};}function saveUpdates(_0x3af1ff,_0x336223){return function(_0x294a68){if(_0x294a68){return _0x294a68[_0x4513('0x25')](_0x3af1ff)[_0x4513('0x26')](function(_0x1c9648){return _0x1c9648;});}return null;};}function removeEntity(_0x43cbef,_0x2cb1a3){return function(_0x4fd07e){if(_0x4fd07e){return _0x4fd07e[_0x4513('0x27')]()[_0x4513('0x26')](function(){_0x43cbef[_0x4513('0x1a')](0xcc)[_0x4513('0x1b')]();});}};}function handleEntityNotFound(_0x6a4d8c,_0x4d1685){return function(_0x7449c1){if(!_0x7449c1){_0x6a4d8c[_0x4513('0x28')](0x194);}return _0x7449c1;};}function handleError(_0x1cd4a5,_0x7c4859){_0x7c4859=_0x7c4859||0x1f4;return function(_0x5d5f){logger[_0x4513('0x29')](_0x5d5f[_0x4513('0x2a')]);if(_0x5d5f[_0x4513('0x2b')]){delete _0x5d5f['name'];}_0x1cd4a5[_0x4513('0x1a')](_0x7c4859)[_0x4513('0x2c')](_0x5d5f);};}exports[_0x4513('0x2d')]=function(_0xfa9dda,_0x5c046a){var _0x51e63d={},_0x985bc8={},_0x1822ad={'count':0x0,'rows':[]};var _0x554e04=_[_0x4513('0x2e')](db[_0x4513('0x2f')][_0x4513('0x30')],function(_0x54e9bc){return{'name':_0x54e9bc[_0x4513('0x31')],'type':_0x54e9bc[_0x4513('0x32')][_0x4513('0x33')]};});_0x985bc8[_0x4513('0x34')]=_[_0x4513('0x2e')](_0x554e04,_0x4513('0x2b'));_0x985bc8[_0x4513('0x35')]=_[_0x4513('0x36')](_0xfa9dda[_0x4513('0x35')]);_0x985bc8[_0x4513('0x37')]=_['intersection'](_0x985bc8[_0x4513('0x34')],_0x985bc8['query']);_0x51e63d[_0x4513('0x38')]=_['intersection'](_0x985bc8[_0x4513('0x34')],qs[_0x4513('0x39')](_0xfa9dda['query']['fields']));_0x51e63d[_0x4513('0x38')]=_0x51e63d[_0x4513('0x38')][_0x4513('0x3a')]?_0x51e63d[_0x4513('0x38')]:_0x985bc8[_0x4513('0x34')];if(!_0xfa9dda[_0x4513('0x35')]['hasOwnProperty'](_0x4513('0x3b'))){_0x51e63d['limit']=qs[_0x4513('0x1f')](_0xfa9dda[_0x4513('0x35')]['limit']);_0x51e63d['offset']=qs[_0x4513('0x1d')](_0xfa9dda[_0x4513('0x35')][_0x4513('0x1d')]);}_0x51e63d['order']=qs[_0x4513('0x3c')](_0xfa9dda[_0x4513('0x35')][_0x4513('0x3c')]);_0x51e63d['where']=qs[_0x4513('0x37')](_[_0x4513('0x3d')](_0xfa9dda['query'],_0x985bc8['filters']),_0x554e04);if(_0xfa9dda['query'][_0x4513('0x3e')]){_0x51e63d['where']=_[_0x4513('0x3f')](_0x51e63d[_0x4513('0x40')],{'$or':_[_0x4513('0x2e')](_0x554e04,function(_0x54ddc4){if(_0x54ddc4[_0x4513('0x32')]!==_0x4513('0x41')){var _0x3217e0={};_0x3217e0[_0x54ddc4[_0x4513('0x2b')]]={'$like':'%'+_0xfa9dda[_0x4513('0x35')][_0x4513('0x3e')]+'%'};return _0x3217e0;}})});}_0x51e63d=_[_0x4513('0x3f')]({},_0x51e63d,_0xfa9dda[_0x4513('0x42')]);var _0x408b63={'where':_0x51e63d[_0x4513('0x40')]};return db[_0x4513('0x2f')][_0x4513('0x20')](_0x408b63)['then'](function(_0x43f3b7){_0x1822ad[_0x4513('0x20')]=_0x43f3b7;if(_0xfa9dda[_0x4513('0x35')][_0x4513('0x43')]){_0x51e63d[_0x4513('0x44')]=[{'all':!![]}];}return db[_0x4513('0x2f')][_0x4513('0x45')](_0x51e63d);})[_0x4513('0x26')](function(_0x1a8a27){_0x1822ad[_0x4513('0x46')]=_0x1a8a27;return _0x1822ad;})['then'](respondWithFilteredResult(_0x5c046a,_0x51e63d))['catch'](handleError(_0x5c046a,null));};exports[_0x4513('0x47')]=function(_0x2cec40,_0x410312){var _0x20c04f={'raw':![],'where':{'id':_0x2cec40['params']['id']}},_0x3e41ce={};_0x3e41ce['model']=_[_0x4513('0x36')](db[_0x4513('0x2f')][_0x4513('0x30')]);_0x3e41ce[_0x4513('0x35')]=_[_0x4513('0x36')](_0x2cec40[_0x4513('0x35')]);_0x3e41ce[_0x4513('0x37')]=_[_0x4513('0x48')](_0x3e41ce[_0x4513('0x34')],_0x3e41ce['query']);_0x20c04f[_0x4513('0x38')]=_[_0x4513('0x48')](_0x3e41ce[_0x4513('0x34')],qs[_0x4513('0x39')](_0x2cec40[_0x4513('0x35')][_0x4513('0x39')]));_0x20c04f[_0x4513('0x38')]=_0x20c04f[_0x4513('0x38')][_0x4513('0x3a')]?_0x20c04f[_0x4513('0x38')]:_0x3e41ce[_0x4513('0x34')];if(_0x2cec40['query'][_0x4513('0x43')]){_0x20c04f[_0x4513('0x44')]=[{'all':!![]}];}_0x20c04f=_[_0x4513('0x3f')]({},_0x20c04f,_0x2cec40[_0x4513('0x42')]);return db[_0x4513('0x2f')]['find'](_0x20c04f)[_0x4513('0x26')](handleEntityNotFound(_0x410312,null))[_0x4513('0x26')](respondWithResult(_0x410312,null))[_0x4513('0x49')](handleError(_0x410312,null));};exports['create']=function(_0x35ce1e,_0x59e14d){return db[_0x4513('0x2f')][_0x4513('0x4a')](_0x35ce1e[_0x4513('0x4b')],{})[_0x4513('0x26')](respondWithResult(_0x59e14d,0xc9))[_0x4513('0x49')](handleError(_0x59e14d,null));};exports['update']=function(_0x400ccf,_0x43e0c1){if(_0x400ccf[_0x4513('0x4b')]['id']){delete _0x400ccf[_0x4513('0x4b')]['id'];}return db[_0x4513('0x2f')]['find']({'where':{'id':_0x400ccf[_0x4513('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43e0c1,null))['then'](saveUpdates(_0x400ccf[_0x4513('0x4b')],null))[_0x4513('0x26')](respondWithResult(_0x43e0c1,null))[_0x4513('0x49')](handleError(_0x43e0c1,null));};exports[_0x4513('0x27')]=function(_0x5e2b71,_0x4ebe94){return db[_0x4513('0x2f')]['find']({'where':{'id':_0x5e2b71[_0x4513('0x4c')]['id']}})[_0x4513('0x26')](handleEntityNotFound(_0x4ebe94,null))[_0x4513('0x26')](removeEntity(_0x4ebe94,null))[_0x4513('0x49')](handleError(_0x4ebe94,null));};exports[_0x4513('0x4d')]=function(_0x3cf3f7,_0x12890e,_0x16c441){var _0x389882={};var _0xf6aa26={};var _0x405feb;var _0x104276;return db[_0x4513('0x2f')][_0x4513('0x4e')]({'where':{'id':_0x3cf3f7['params']['id']}})[_0x4513('0x26')](handleEntityNotFound(_0x12890e,null))[_0x4513('0x26')](function(_0x2d949b){if(_0x2d949b){_0x405feb=_0x2d949b;_0xf6aa26[_0x4513('0x34')]=_[_0x4513('0x36')](db[_0x4513('0x4f')][_0x4513('0x30')]);_0xf6aa26['query']=_[_0x4513('0x36')](_0x3cf3f7[_0x4513('0x35')]);_0xf6aa26['filters']=_[_0x4513('0x48')](_0xf6aa26['model'],_0xf6aa26[_0x4513('0x35')]);_0x389882[_0x4513('0x38')]=_[_0x4513('0x48')](_0xf6aa26[_0x4513('0x34')],qs['fields'](_0x3cf3f7[_0x4513('0x35')]['fields']));_0x389882[_0x4513('0x38')]=_0x389882['attributes'][_0x4513('0x3a')]?_0x389882[_0x4513('0x38')]:_0xf6aa26[_0x4513('0x34')];_0x389882[_0x4513('0x50')]=qs[_0x4513('0x3c')](_0x3cf3f7[_0x4513('0x35')]['sort']);_0x389882['where']=qs[_0x4513('0x37')](_[_0x4513('0x3d')](_0x3cf3f7['query'],_0xf6aa26['filters']));if(_0x3cf3f7['query'][_0x4513('0x3e')]){_0x389882[_0x4513('0x40')]=_[_0x4513('0x3f')](_0x389882[_0x4513('0x40')],{'$or':_['map'](_0x389882['attributes'],function(_0x404ff0){var _0x2959d8={};_0x2959d8[_0x404ff0]={'$like':'%'+_0x3cf3f7[_0x4513('0x35')][_0x4513('0x3e')]+'%'};return _0x2959d8;})});}_0x389882=_[_0x4513('0x3f')]({},_0x389882,_0x3cf3f7['options']);return _0x405feb[_0x4513('0x4d')](_0x389882);}})[_0x4513('0x26')](function(_0x27b5e3){if(_0x27b5e3){_0x104276=_0x27b5e3[_0x4513('0x3a')];if(!_0x3cf3f7[_0x4513('0x35')]['hasOwnProperty'](_0x4513('0x3b'))){_0x389882[_0x4513('0x1f')]=qs[_0x4513('0x1f')](_0x3cf3f7[_0x4513('0x35')][_0x4513('0x1f')]);_0x389882[_0x4513('0x1d')]=qs[_0x4513('0x1d')](_0x3cf3f7['query'][_0x4513('0x1d')]);}return _0x405feb[_0x4513('0x4d')](_0x389882);}})[_0x4513('0x26')](function(_0x822577){if(_0x822577){return _0x822577?{'count':_0x104276,'rows':_0x822577}:null;}})[_0x4513('0x26')](respondWithResult(_0x12890e,null))[_0x4513('0x49')](handleError(_0x12890e,null));};exports['addConfiguration']=function(_0x4517ba,_0x1991e1,_0x409762){if(_0x4517ba[_0x4513('0x4b')]['id']){delete _0x4517ba[_0x4513('0x4b')]['id'];}return db[_0x4513('0x2f')][_0x4513('0x4e')]({'where':{'id':_0x4517ba[_0x4513('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1991e1,null))['then'](function(_0x1d6467){if(_0x1d6467){_0x4517ba[_0x4513('0x4b')][_0x4513('0x51')]=_0x1d6467['id'];_0x4517ba['body']['Subjects']=integrations['getSubjects'](_0x4517ba[_0x4513('0x4b')]['channel'],_0x4517ba[_0x4513('0x4b')][_0x4513('0x32')]);_0x4517ba['body'][_0x4513('0x52')]=integrations[_0x4513('0x53')](_0x4517ba[_0x4513('0x4b')][_0x4513('0x54')],_0x4517ba[_0x4513('0x4b')][_0x4513('0x32')]);return db[_0x4513('0x4f')][_0x4513('0x4a')](_0x4517ba['body'],{'include':[{'model':db[_0x4513('0x55')],'as':'Subjects'},{'model':db[_0x4513('0x55')],'as':_0x4513('0x52')}]});}return null;})['then'](respondWithResult(_0x1991e1,null))[_0x4513('0x49')](handleError(_0x1991e1,null));};exports[_0x4513('0x56')]=function(_0x29644f,_0x937d4,_0x17ef28){var _0x48e1d5='';var _0x4060cb='';return db[_0x4513('0x2f')][_0x4513('0x4e')]({'where':{'id':_0x29644f[_0x4513('0x4c')]['id']},'attributes':['id','username',_0x4513('0x57'),'apiKey']})[_0x4513('0x26')](handleEntityNotFound(_0x937d4,null))[_0x4513('0x26')](function(_0x1419b0){if(_0x1419b0){_0x4060cb=_0x1419b0[_0x4513('0x58')];_0x48e1d5=_0x1419b0[_0x4513('0x57')];var _0x4ceee5=_0x1419b0[_0x4513('0x57')]['slice'](-0x1);if(_0x4ceee5==='/'){_0x48e1d5=_0x48e1d5[_0x4513('0x59')](0x0,_0x48e1d5[_0x4513('0x5a')](_0x4ceee5));}return rp({'method':_0x4513('0x5b'),'uri':util[_0x4513('0x5c')](_0x4513('0x5d'),_0x48e1d5,'/api/selector/owners'),'headers':{'Authorization':_0x4513('0x5e')+_0x1419b0[_0x4513('0x5f')]},'json':!![]});}})[_0x4513('0x26')](function(_0x58d196){if(_0x58d196){var _0x430ac0=_0x58d196['users'];var _0x2fbab0=![];var _0xca6baf=null;for(_0xca6baf=0x0;_0xca6baf<_0x430ac0[_0x4513('0x3a')];_0xca6baf++){if(_0x430ac0[_0xca6baf]['email']===_0x4060cb){_0x2fbab0=!![];}}if(_0x2fbab0){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4513('0x60')});}}})[_0x4513('0x26')](respondWithResult(_0x937d4,null))[_0x4513('0x49')](function(_0x156066){var _0x57aff4=_0x29644f[_0x4513('0x35')][_0x4513('0x61')]?0x1f4:_0x156066[_0x4513('0x62')]||0x1f4;logger['error'](_0x4513('0x63'),'getFields',_0x57aff4,JSON[_0x4513('0x64')](_0x156066));delete _0x156066[_0x4513('0x2b')];if(_0x57aff4===0x191){_0x57aff4=0x190;}_0x937d4[_0x4513('0x1a')](_0x57aff4)[_0x4513('0x2c')](_0x29644f[_0x4513('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x156066['statusCode']}:_0x156066);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b7901dc..ad5fdce 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 _0x47c5=['rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x96f08c,_0x114f46){var _0x47afb5=function(_0x32f67a){while(--_0x32f67a){_0x96f08c['push'](_0x96f08c['shift']());}};_0x47afb5(++_0x114f46);}(_0x47c5,0x165));var _0x547c=function(_0x2e5988,_0x482943){_0x2e5988=_0x2e5988-0x0;var _0x35080f=_0x47c5[_0x2e5988];return _0x35080f;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));var integrations=require(_0x547c('0x9'));module['exports']=function(_0x2e5b57,_0x439f25){return _0x2e5b57[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment'];(function(_0x5eae93,_0x1be815){var _0x58c6cc=function(_0x3e0d15){while(--_0x3e0d15){_0x5eae93['push'](_0x5eae93['shift']());}};_0x58c6cc(++_0x1be815);}(_0x7880,0x1f4));var _0x0788=function(_0x5a57a3,_0x2a7018){_0x5a57a3=_0x5a57a3-0x0;var _0x2ef960=_0x7880[_0x5a57a3];return _0x2ef960;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));var integrations=require(_0x0788('0x9'));module[_0x0788('0xa')]=function(_0x775629,_0x3f9cb8){return _0x775629[_0x0788('0xb')](_0x0788('0xc'),attributes,{'tableName':_0x0788('0xd'),'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 fc63132..8a56150 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 _0x33af=['include','map','model','ShowFreshsalesAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x33af,0xec));var _0xf33a=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x33af[_0x43d11d];return _0x38cd08;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['findAll']({'raw':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x18')]===undefined?!![]:![]:!![],'where':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'limit':_0x524109[_0xf33a('0x17')]?_0x524109['options'][_0xf33a('0x1b')]||null:null,'include':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x524109['options'][_0xf33a('0x1c')],function(_0x5882ba){return{'model':db[_0x5882ba[_0xf33a('0x1e')]],'as':_0x5882ba['as'],'attributes':_0x5882ba[_0xf33a('0x1a')],'include':_0x5882ba[_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x5882ba[_0xf33a('0x1c')],function(_0x4b9801){return{'model':db[_0x4b9801[_0xf33a('0x1e')]],'as':_0x4b9801['as'],'attributes':_0x4b9801[_0xf33a('0x1a')],'include':_0x4b9801['include']?_['map'](_0x4b9801[_0xf33a('0x1c')],function(_0x5f0a53){return{'model':db[_0x5f0a53['model']],'as':_0x5f0a53['as'],'attributes':_0x5f0a53[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x79d653){logger['info'](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON[_0xf33a('0xf')](_0x79d653));_0x23d9e2(_0x79d653);})[_0xf33a('0x14')](function(_0x3068a9){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x3068a9[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x3068a9[_0xf33a('0x12')]));});});};exports[_0xf33a('0x1f')]=function(_0x22c9f2){var _0x3f714e=this;return new Promise(function(_0x2fd098,_0x5eb14a){return db[_0xf33a('0x16')][_0xf33a('0x20')]({'raw':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'include':_0x22c9f2['options']?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')],function(_0x57e7be){return{'model':db[_0x57e7be['model']],'as':_0x57e7be['as'],'attributes':_0x57e7be[_0xf33a('0x1a')],'include':_0x57e7be['include']?_['map'](_0x57e7be['include'],function(_0x2c4840){return{'model':db[_0x2c4840[_0xf33a('0x1e')]],'as':_0x2c4840['as'],'attributes':_0x2c4840['attributes'],'include':_0x2c4840[_0xf33a('0x1c')]?_['map'](_0x2c4840[_0xf33a('0x1c')],function(_0x1f11b3){return{'model':db[_0x1f11b3[_0xf33a('0x1e')]],'as':_0x1f11b3['as'],'attributes':_0x1f11b3[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf33a('0xa')](function(_0x23c92b){logger['info'](_0xf33a('0x1f'),_0x22c9f2);logger[_0xf33a('0xe')]('ShowFreshsalesAccount',_0x22c9f2,JSON[_0xf33a('0xf')](_0x23c92b));_0x2fd098(_0x23c92b);})[_0xf33a('0x14')](function(_0x3e0a98){logger['error'](_0xf33a('0x1f'),_0x3e0a98[_0xf33a('0x12')],_0x22c9f2);_0x5eb14a(_0x3f714e[_0xf33a('0x10')](0x1f4,_0x3e0a98[_0xf33a('0x12')]));});});}; \ No newline at end of file +var _0x5430=['map','model','find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include'];(function(_0x3f8e41,_0xa7a286){var _0x1bf3d6=function(_0x37a91b){while(--_0x37a91b){_0x3f8e41['push'](_0x3f8e41['shift']());}};_0x1bf3d6(++_0xa7a286);}(_0x5430,0x10c));var _0x0543=function(_0x5afd3e,_0x4321c7){_0x5afd3e=_0x5afd3e-0x0;var _0x59ee91=_0x5430[_0x5afd3e];return _0x59ee91;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}exports[_0x0543('0x15')]=function(_0x20b396){var _0x285080=this;return new Promise(function(_0x577cf0,_0x5eb03e){return db[_0x0543('0x16')]['findAll']({'raw':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x20b396[_0x0543('0x17')]?_0x20b396['options'][_0x0543('0x19')]||null:null,'attributes':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'limit':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1b')]||null:null,'include':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x20b396['options']['include'],function(_0x59f1b2){return{'model':db[_0x59f1b2[_0x0543('0x1e')]],'as':_0x59f1b2['as'],'attributes':_0x59f1b2[_0x0543('0x1a')],'include':_0x59f1b2[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x59f1b2[_0x0543('0x1c')],function(_0x26e500){return{'model':db[_0x26e500[_0x0543('0x1e')]],'as':_0x26e500['as'],'attributes':_0x26e500[_0x0543('0x1a')],'include':_0x26e500[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x26e500[_0x0543('0x1c')],function(_0x21fc63){return{'model':db[_0x21fc63['model']],'as':_0x21fc63['as'],'attributes':_0x21fc63[_0x0543('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x30ad9e){logger['info'](_0x0543('0x15'),_0x20b396);logger[_0x0543('0xe')](_0x0543('0x15'),_0x20b396,JSON[_0x0543('0xf')](_0x30ad9e));_0x577cf0(_0x30ad9e);})['catch'](function(_0x1732be){logger[_0x0543('0x10')]('GetFreshsalesAccount',_0x1732be['message'],_0x20b396);_0x5eb03e(_0x285080[_0x0543('0x10')](0x1f4,_0x1732be[_0x0543('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x3b879b){var _0x2e03d1=this;return new Promise(function(_0x931ccc,_0x2bd6ce){return db[_0x0543('0x16')][_0x0543('0x1f')]({'raw':_0x3b879b[_0x0543('0x17')]?_0x3b879b['options'][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')][_0x0543('0x19')]||null:null,'attributes':_0x3b879b[_0x0543('0x17')]?_0x3b879b[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'include':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')]['include']?_[_0x0543('0x1d')](_0x3b879b[_0x0543('0x17')][_0x0543('0x1c')],function(_0x327027){return{'model':db[_0x327027['model']],'as':_0x327027['as'],'attributes':_0x327027[_0x0543('0x1a')],'include':_0x327027['include']?_[_0x0543('0x1d')](_0x327027[_0x0543('0x1c')],function(_0x3fbf5f){return{'model':db[_0x3fbf5f[_0x0543('0x1e')]],'as':_0x3fbf5f['as'],'attributes':_0x3fbf5f[_0x0543('0x1a')],'include':_0x3fbf5f[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x3fbf5f[_0x0543('0x1c')],function(_0x8ef4d4){return{'model':db[_0x8ef4d4[_0x0543('0x1e')]],'as':_0x8ef4d4['as'],'attributes':_0x8ef4d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x2d76d6){logger['info'](_0x0543('0x20'),_0x3b879b);logger['debug'](_0x0543('0x20'),_0x3b879b,JSON[_0x0543('0xf')](_0x2d76d6));_0x931ccc(_0x2d76d6);})['catch'](function(_0x5e8800){logger[_0x0543('0x10')](_0x0543('0x20'),_0x5e8800['message'],_0x3b879b);_0x2bd6ce(_0x2e03d1[_0x0543('0x10')](0x1f4,_0x5e8800[_0x0543('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index eb17948..6c434e8 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 _0x8f72=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/fields','getFields','post','create','put','delete','destroy','exports'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x8f72,0x170));var _0x28f7=function(_0x177f96,_0x415c3f){_0x177f96=_0x177f96-0x0;var _0x280eb5=_0x8f72[_0x177f96];return _0x280eb5;};'use strict';var multer=require(_0x28f7('0x0'));var util=require(_0x28f7('0x1'));var path=require(_0x28f7('0x2'));var timeout=require(_0x28f7('0x3'));var express=require(_0x28f7('0x4'));var router=express[_0x28f7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x28f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x28f7('0x7'));var controller=require(_0x28f7('0x8'));router[_0x28f7('0x9')]('/',auth[_0x28f7('0xa')](),controller[_0x28f7('0xb')]);router[_0x28f7('0x9')](_0x28f7('0xc'),auth[_0x28f7('0xa')](),controller[_0x28f7('0xd')]);router[_0x28f7('0x9')](_0x28f7('0xe'),auth[_0x28f7('0xa')](),controller['getSubjects']);router[_0x28f7('0x9')]('/:id/descriptions',auth[_0x28f7('0xa')](),controller['getDescriptions']);router[_0x28f7('0x9')](_0x28f7('0xf'),auth[_0x28f7('0xa')](),controller[_0x28f7('0x10')]);router[_0x28f7('0x11')]('/',auth[_0x28f7('0xa')](),controller[_0x28f7('0x12')]);router[_0x28f7('0x13')]('/:id',auth[_0x28f7('0xa')](),controller['update']);router[_0x28f7('0x14')](_0x28f7('0xc'),auth[_0x28f7('0xa')](),controller[_0x28f7('0x15')]);module[_0x28f7('0x16')]=router; \ No newline at end of file +var _0x3973=['./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','getDescriptions','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x55c938,_0x573265){var _0x42dc66=function(_0x1080c7){while(--_0x1080c7){_0x55c938['push'](_0x55c938['shift']());}};_0x42dc66(++_0x573265);}(_0x3973,0xe7));var _0x3397=function(_0x47af18,_0x3e1b03){_0x47af18=_0x47af18-0x0;var _0x580e66=_0x3973[_0x47af18];return _0x580e66;};'use strict';var multer=require(_0x3397('0x0'));var util=require(_0x3397('0x1'));var path=require(_0x3397('0x2'));var timeout=require(_0x3397('0x3'));var express=require(_0x3397('0x4'));var router=express[_0x3397('0x5')]();var fs_extra=require(_0x3397('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3397('0x7'));var config=require(_0x3397('0x8'));var controller=require(_0x3397('0x9'));router[_0x3397('0xa')]('/',auth[_0x3397('0xb')](),controller[_0x3397('0xc')]);router[_0x3397('0xa')](_0x3397('0xd'),auth[_0x3397('0xb')](),controller['show']);router[_0x3397('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3397('0xe')]);router[_0x3397('0xa')]('/:id/descriptions',auth[_0x3397('0xb')](),controller[_0x3397('0xf')]);router['get'](_0x3397('0x10'),auth[_0x3397('0xb')](),controller[_0x3397('0x11')]);router[_0x3397('0x12')]('/',auth[_0x3397('0xb')](),controller[_0x3397('0x13')]);router['put']('/:id',auth[_0x3397('0xb')](),controller[_0x3397('0x14')]);router[_0x3397('0x15')](_0x3397('0xd'),auth[_0x3397('0xb')](),controller[_0x3397('0x16')]);module[_0x3397('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b8f8eac..bc2e956 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 _0x0be6=['exports','STRING','sequelize'];(function(_0x2a5246,_0x4e1024){var _0x4c6c3a=function(_0x2f1b89){while(--_0x2f1b89){_0x2a5246['push'](_0x2a5246['shift']());}};_0x4c6c3a(++_0x4e1024);}(_0x0be6,0x10a));var _0x60be=function(_0x52509b,_0x30227c){_0x52509b=_0x52509b-0x0;var _0x1fb0b8=_0x0be6[_0x52509b];return _0x1fb0b8;};'use strict';var Sequelize=require(_0x60be('0x0'));module[_0x60be('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x60be('0x2')]}}; \ No newline at end of file +var _0xc7ff=['STRING'];(function(_0x332235,_0x37bdc8){var _0x31cfa3=function(_0x1b4c82){while(--_0x1b4c82){_0x332235['push'](_0x332235['shift']());}};_0x31cfa3(++_0x37bdc8);}(_0xc7ff,0xe5));var _0xfc7f=function(_0x24bbc9,_0x49c2c2){_0x24bbc9=_0x24bbc9-0x0;var _0x176a0b=_0xc7ff[_0x24bbc9];return _0x176a0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfc7f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 7d5c1f5..fa14331 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 _0x4489=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','sendStatus','error','name','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x38c5a8,_0x1a3e19){var _0xacef4a=function(_0x3513ad){while(--_0x3513ad){_0x38c5a8['push'](_0x38c5a8['shift']());}};_0xacef4a(++_0x1a3e19);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9448('0x0'));var rimraf=require(_0x9448('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9448('0x2'));var rp=require(_0x9448('0x3'));var moment=require(_0x9448('0x4'));var BPromise=require(_0x9448('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9448('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9448('0x7'));var squel=require('squel');var crypto=require(_0x9448('0x8'));var jsforce=require(_0x9448('0x9'));var deskjs=require(_0x9448('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9448('0xb'));var authService=require(_0x9448('0xc'));var qs=require(_0x9448('0xd'));var as=require(_0x9448('0xe'));var hardwareService=require(_0x9448('0xf'));var logger=require('../../config/logger')(_0x9448('0x10'));var utils=require(_0x9448('0x11'));var config=require(_0x9448('0x12'));var licenseUtil=require(_0x9448('0x13'));var db=require(_0x9448('0x14'))['db'];function respondWithStatusCode(_0x3a9c09,_0x3fa594){_0x3fa594=_0x3fa594||0xcc;return function(_0x1aa59f){if(_0x1aa59f){return _0x3a9c09['sendStatus'](_0x3fa594);}return _0x3a9c09[_0x9448('0x15')](_0x3fa594)['end']();};}function respondWithResult(_0x323fd2,_0x9b1347){_0x9b1347=_0x9b1347||0xc8;return function(_0x50f986){if(_0x50f986){return _0x323fd2[_0x9448('0x15')](_0x9b1347)[_0x9448('0x16')](_0x50f986);}};}function respondWithFilteredResult(_0x555a76,_0x8a6745){return function(_0x9bda4){if(_0x9bda4){var _0x3564c0=typeof _0x8a6745[_0x9448('0x17')]===_0x9448('0x18')&&typeof _0x8a6745['limit']===_0x9448('0x18');var _0x5da6d7=_0x9bda4[_0x9448('0x19')];var _0xc448c6=_0x3564c0?0x0:_0x8a6745[_0x9448('0x17')];var _0x24fdf5=_0x3564c0?_0x9bda4[_0x9448('0x19')]:_0x8a6745[_0x9448('0x17')]+_0x8a6745[_0x9448('0x1a')];var _0x2156ca;if(_0x24fdf5>=_0x5da6d7){_0x24fdf5=_0x5da6d7;_0x2156ca=0xc8;}else{_0x2156ca=0xce;}_0x555a76[_0x9448('0x15')](_0x2156ca);return _0x555a76[_0x9448('0x1b')]('Content-Range',_0xc448c6+'-'+_0x24fdf5+'/'+_0x5da6d7)[_0x9448('0x16')](_0x9bda4);}return null;};}function patchUpdates(_0x4fd323){return function(_0x5eef92){try{jsonpatch[_0x9448('0x1c')](_0x5eef92,_0x4fd323,!![]);}catch(_0x5cc7da){return BPromise['reject'](_0x5cc7da);}return _0x5eef92['save']();};}function saveUpdates(_0x9d711a,_0x5befa0){return function(_0x39948a){if(_0x39948a){return _0x39948a[_0x9448('0x1d')](_0x9d711a)[_0x9448('0x1e')](function(_0x512536){return _0x512536;});}return null;};}function removeEntity(_0x3c7c2d,_0x42858f){return function(_0x2a0319){if(_0x2a0319){return _0x2a0319[_0x9448('0x1f')]()[_0x9448('0x1e')](function(){_0x3c7c2d[_0x9448('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56676e,_0x7cfc8e){return function(_0x124892){if(!_0x124892){_0x56676e[_0x9448('0x20')](0x194);}return _0x124892;};}function handleError(_0x161b1d,_0x3eabc1){_0x3eabc1=_0x3eabc1||0x1f4;return function(_0x5ded37){logger[_0x9448('0x21')](_0x5ded37['stack']);if(_0x5ded37[_0x9448('0x22')]){delete _0x5ded37[_0x9448('0x22')];}_0x161b1d[_0x9448('0x15')](_0x3eabc1)['send'](_0x5ded37);};}exports[_0x9448('0x23')]=function(_0x3bf608,_0x25669c){var _0x89bc24={},_0x14009a={},_0x442a15={'count':0x0,'rows':[]};var _0x56d621=_[_0x9448('0x24')](db[_0x9448('0x25')]['rawAttributes'],function(_0x57ac6){return{'name':_0x57ac6[_0x9448('0x26')],'type':_0x57ac6[_0x9448('0x27')][_0x9448('0x28')]};});_0x14009a[_0x9448('0x29')]=_[_0x9448('0x24')](_0x56d621,'name');_0x14009a[_0x9448('0x2a')]=_['keys'](_0x3bf608[_0x9448('0x2a')]);_0x14009a[_0x9448('0x2b')]=_[_0x9448('0x2c')](_0x14009a[_0x9448('0x29')],_0x14009a[_0x9448('0x2a')]);_0x89bc24[_0x9448('0x2d')]=_[_0x9448('0x2c')](_0x14009a[_0x9448('0x29')],qs['fields'](_0x3bf608[_0x9448('0x2a')][_0x9448('0x2e')]));_0x89bc24['attributes']=_0x89bc24['attributes'][_0x9448('0x2f')]?_0x89bc24[_0x9448('0x2d')]:_0x14009a['model'];if(!_0x3bf608[_0x9448('0x2a')][_0x9448('0x30')](_0x9448('0x31'))){_0x89bc24[_0x9448('0x1a')]=qs[_0x9448('0x1a')](_0x3bf608[_0x9448('0x2a')][_0x9448('0x1a')]);_0x89bc24['offset']=qs[_0x9448('0x17')](_0x3bf608[_0x9448('0x2a')][_0x9448('0x17')]);}_0x89bc24[_0x9448('0x32')]=qs[_0x9448('0x33')](_0x3bf608[_0x9448('0x2a')][_0x9448('0x33')]);_0x89bc24[_0x9448('0x34')]=qs[_0x9448('0x2b')](_[_0x9448('0x35')](_0x3bf608[_0x9448('0x2a')],_0x14009a['filters']),_0x56d621);if(_0x3bf608[_0x9448('0x2a')][_0x9448('0x36')]){_0x89bc24[_0x9448('0x34')]=_[_0x9448('0x37')](_0x89bc24['where'],{'$or':_[_0x9448('0x24')](_0x56d621,function(_0x4556ff){if(_0x4556ff['type']!==_0x9448('0x38')){var _0x3d0985={};_0x3d0985[_0x4556ff[_0x9448('0x22')]]={'$like':'%'+_0x3bf608[_0x9448('0x2a')]['filter']+'%'};return _0x3d0985;}})});}_0x89bc24=_[_0x9448('0x37')]({},_0x89bc24,_0x3bf608[_0x9448('0x39')]);var _0x46da1d={'where':_0x89bc24[_0x9448('0x34')]};return db[_0x9448('0x25')]['count'](_0x46da1d)[_0x9448('0x1e')](function(_0x26a60a){_0x442a15[_0x9448('0x19')]=_0x26a60a;if(_0x3bf608['query'][_0x9448('0x3a')]){_0x89bc24[_0x9448('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x89bc24);})[_0x9448('0x1e')](function(_0x3e6448){_0x442a15[_0x9448('0x3c')]=_0x3e6448;return _0x442a15;})[_0x9448('0x1e')](respondWithFilteredResult(_0x25669c,_0x89bc24))['catch'](handleError(_0x25669c,null));};exports[_0x9448('0x3d')]=function(_0x1abef6,_0x19fd7d){var _0x28f2fe={'raw':![],'where':{'id':_0x1abef6[_0x9448('0x3e')]['id']}},_0x8ffab4={};_0x8ffab4[_0x9448('0x29')]=_[_0x9448('0x3f')](db[_0x9448('0x25')][_0x9448('0x40')]);_0x8ffab4['query']=_['keys'](_0x1abef6[_0x9448('0x2a')]);_0x8ffab4[_0x9448('0x2b')]=_[_0x9448('0x2c')](_0x8ffab4[_0x9448('0x29')],_0x8ffab4[_0x9448('0x2a')]);_0x28f2fe[_0x9448('0x2d')]=_[_0x9448('0x2c')](_0x8ffab4[_0x9448('0x29')],qs['fields'](_0x1abef6['query'][_0x9448('0x2e')]));_0x28f2fe[_0x9448('0x2d')]=_0x28f2fe[_0x9448('0x2d')][_0x9448('0x2f')]?_0x28f2fe[_0x9448('0x2d')]:_0x8ffab4[_0x9448('0x29')];if(_0x1abef6[_0x9448('0x2a')]['includeAll']){_0x28f2fe['include']=[{'all':!![]}];}_0x28f2fe=_[_0x9448('0x37')]({},_0x28f2fe,_0x1abef6[_0x9448('0x39')]);return db[_0x9448('0x25')][_0x9448('0x41')](_0x28f2fe)[_0x9448('0x1e')](handleEntityNotFound(_0x19fd7d,null))['then'](respondWithResult(_0x19fd7d,null))[_0x9448('0x42')](handleError(_0x19fd7d,null));};exports[_0x9448('0x43')]=function(_0x7651a3,_0x479b60){return db[_0x9448('0x25')][_0x9448('0x43')](_0x7651a3[_0x9448('0x44')],{})[_0x9448('0x1e')](respondWithResult(_0x479b60,0xc9))[_0x9448('0x42')](handleError(_0x479b60,null));};exports[_0x9448('0x1d')]=function(_0x2886fb,_0xd911a3){if(_0x2886fb[_0x9448('0x44')]['id']){delete _0x2886fb[_0x9448('0x44')]['id'];}return db[_0x9448('0x25')][_0x9448('0x41')]({'where':{'id':_0x2886fb[_0x9448('0x3e')]['id']}})[_0x9448('0x1e')](handleEntityNotFound(_0xd911a3,null))['then'](saveUpdates(_0x2886fb['body'],null))[_0x9448('0x1e')](respondWithResult(_0xd911a3,null))['catch'](handleError(_0xd911a3,null));};exports[_0x9448('0x1f')]=function(_0x2f051a,_0x2220e9){return db[_0x9448('0x25')][_0x9448('0x41')]({'where':{'id':_0x2f051a[_0x9448('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2220e9,null))[_0x9448('0x1e')](removeEntity(_0x2220e9,null))['catch'](handleError(_0x2220e9,null));};exports[_0x9448('0x45')]=function(_0x2de8ff,_0x4d8d1e,_0x1d6287){var _0x45be0f={};var _0xb55b3b={};var _0x59449f;var _0x2e5b03;return db[_0x9448('0x25')][_0x9448('0x46')]({'where':{'id':_0x2de8ff[_0x9448('0x3e')]['id']}})[_0x9448('0x1e')](handleEntityNotFound(_0x4d8d1e,null))[_0x9448('0x1e')](function(_0x3498b1){if(_0x3498b1){_0x59449f=_0x3498b1;_0xb55b3b[_0x9448('0x29')]=_[_0x9448('0x3f')](db[_0x9448('0x47')][_0x9448('0x40')]);_0xb55b3b['query']=_[_0x9448('0x3f')](_0x2de8ff[_0x9448('0x2a')]);_0xb55b3b[_0x9448('0x2b')]=_[_0x9448('0x2c')](_0xb55b3b['model'],_0xb55b3b[_0x9448('0x2a')]);_0x45be0f[_0x9448('0x2d')]=_[_0x9448('0x2c')](_0xb55b3b['model'],qs[_0x9448('0x2e')](_0x2de8ff[_0x9448('0x2a')]['fields']));_0x45be0f[_0x9448('0x2d')]=_0x45be0f[_0x9448('0x2d')]['length']?_0x45be0f[_0x9448('0x2d')]:_0xb55b3b[_0x9448('0x29')];_0x45be0f[_0x9448('0x32')]=qs[_0x9448('0x33')](_0x2de8ff[_0x9448('0x2a')][_0x9448('0x33')]);_0x45be0f[_0x9448('0x34')]=qs[_0x9448('0x2b')](_[_0x9448('0x35')](_0x2de8ff[_0x9448('0x2a')],_0xb55b3b[_0x9448('0x2b')]));if(_0x2de8ff[_0x9448('0x2a')][_0x9448('0x36')]){_0x45be0f[_0x9448('0x34')]=_[_0x9448('0x37')](_0x45be0f[_0x9448('0x34')],{'$or':_[_0x9448('0x24')](_0x45be0f[_0x9448('0x2d')],function(_0x3ad0f6){var _0x16ca08={};_0x16ca08[_0x3ad0f6]={'$like':'%'+_0x2de8ff[_0x9448('0x2a')][_0x9448('0x36')]+'%'};return _0x16ca08;})});}_0x45be0f=_['merge']({},_0x45be0f,_0x2de8ff['options']);return _0x59449f[_0x9448('0x45')](_0x45be0f);}})['then'](function(_0x3c1f8a){if(_0x3c1f8a){_0x2e5b03=_0x3c1f8a[_0x9448('0x2f')];if(!_0x2de8ff['query'][_0x9448('0x30')]('nolimit')){_0x45be0f[_0x9448('0x1a')]=qs[_0x9448('0x1a')](_0x2de8ff['query'][_0x9448('0x1a')]);_0x45be0f['offset']=qs['offset'](_0x2de8ff[_0x9448('0x2a')][_0x9448('0x17')]);}return _0x59449f[_0x9448('0x45')](_0x45be0f);}})[_0x9448('0x1e')](function(_0x54dc59){if(_0x54dc59){return _0x54dc59?{'count':_0x2e5b03,'rows':_0x54dc59}:null;}})[_0x9448('0x1e')](respondWithResult(_0x4d8d1e,null))[_0x9448('0x42')](handleError(_0x4d8d1e,null));};exports[_0x9448('0x48')]=function(_0x103a34,_0x303e93,_0xb3a81e){var _0x27555e={};var _0x552606={};var _0x45b229;var _0xa6d3f0;return db['FreshsalesConfiguration'][_0x9448('0x46')]({'where':{'id':_0x103a34['params']['id']}})['then'](handleEntityNotFound(_0x303e93,null))['then'](function(_0x3f6b6c){if(_0x3f6b6c){_0x45b229=_0x3f6b6c;_0x552606[_0x9448('0x29')]=_[_0x9448('0x3f')](db['FreshsalesField']['rawAttributes']);_0x552606['query']=_[_0x9448('0x3f')](_0x103a34[_0x9448('0x2a')]);_0x552606['filters']=_['intersection'](_0x552606[_0x9448('0x29')],_0x552606['query']);_0x27555e[_0x9448('0x2d')]=_[_0x9448('0x2c')](_0x552606[_0x9448('0x29')],qs[_0x9448('0x2e')](_0x103a34[_0x9448('0x2a')]['fields']));_0x27555e['attributes']=_0x27555e['attributes']['length']?_0x27555e['attributes']:_0x552606[_0x9448('0x29')];_0x27555e[_0x9448('0x32')]=qs['sort'](_0x103a34[_0x9448('0x2a')][_0x9448('0x33')]);_0x27555e['where']=qs[_0x9448('0x2b')](_[_0x9448('0x35')](_0x103a34[_0x9448('0x2a')],_0x552606[_0x9448('0x2b')]));if(_0x103a34[_0x9448('0x2a')][_0x9448('0x36')]){_0x27555e['where']=_['merge'](_0x27555e[_0x9448('0x34')],{'$or':_['map'](_0x27555e['attributes'],function(_0x531204){var _0x24e192={};_0x24e192[_0x531204]={'$like':'%'+_0x103a34[_0x9448('0x2a')][_0x9448('0x36')]+'%'};return _0x24e192;})});}_0x27555e=_[_0x9448('0x37')]({},_0x27555e,_0x103a34[_0x9448('0x39')]);return _0x45b229[_0x9448('0x48')](_0x27555e);}})[_0x9448('0x1e')](function(_0x22f732){if(_0x22f732){_0xa6d3f0=_0x22f732[_0x9448('0x2f')];if(!_0x103a34[_0x9448('0x2a')][_0x9448('0x30')](_0x9448('0x31'))){_0x27555e['limit']=qs[_0x9448('0x1a')](_0x103a34[_0x9448('0x2a')][_0x9448('0x1a')]);_0x27555e[_0x9448('0x17')]=qs['offset'](_0x103a34['query'][_0x9448('0x17')]);}return _0x45b229[_0x9448('0x48')](_0x27555e);}})[_0x9448('0x1e')](function(_0x36f97c){if(_0x36f97c){return _0x36f97c?{'count':_0xa6d3f0,'rows':_0x36f97c}:null;}})[_0x9448('0x1e')](respondWithResult(_0x303e93,null))[_0x9448('0x42')](handleError(_0x303e93,null));};exports[_0x9448('0x49')]=function(_0x7530f3,_0x501008,_0x30ee4a){var _0x1cf42a={};var _0x385335={};var _0x27a926;var _0x55cd2f;return db[_0x9448('0x25')][_0x9448('0x46')]({'where':{'id':_0x7530f3['params']['id']}})[_0x9448('0x1e')](handleEntityNotFound(_0x501008,null))['then'](function(_0x3deab8){if(_0x3deab8){_0x27a926=_0x3deab8;_0x385335[_0x9448('0x29')]=_['keys'](db[_0x9448('0x47')][_0x9448('0x40')]);_0x385335[_0x9448('0x2a')]=_[_0x9448('0x3f')](_0x7530f3[_0x9448('0x2a')]);_0x385335['filters']=_[_0x9448('0x2c')](_0x385335[_0x9448('0x29')],_0x385335[_0x9448('0x2a')]);_0x1cf42a[_0x9448('0x2d')]=_[_0x9448('0x2c')](_0x385335[_0x9448('0x29')],qs[_0x9448('0x2e')](_0x7530f3[_0x9448('0x2a')][_0x9448('0x2e')]));_0x1cf42a['attributes']=_0x1cf42a[_0x9448('0x2d')]['length']?_0x1cf42a[_0x9448('0x2d')]:_0x385335[_0x9448('0x29')];_0x1cf42a[_0x9448('0x32')]=qs[_0x9448('0x33')](_0x7530f3['query']['sort']);_0x1cf42a[_0x9448('0x34')]=qs[_0x9448('0x2b')](_[_0x9448('0x35')](_0x7530f3[_0x9448('0x2a')],_0x385335[_0x9448('0x2b')]));if(_0x7530f3[_0x9448('0x2a')][_0x9448('0x36')]){_0x1cf42a[_0x9448('0x34')]=_['merge'](_0x1cf42a[_0x9448('0x34')],{'$or':_[_0x9448('0x24')](_0x1cf42a[_0x9448('0x2d')],function(_0x5331e3){var _0x2e9f73={};_0x2e9f73[_0x5331e3]={'$like':'%'+_0x7530f3[_0x9448('0x2a')][_0x9448('0x36')]+'%'};return _0x2e9f73;})});}_0x1cf42a=_[_0x9448('0x37')]({},_0x1cf42a,_0x7530f3['options']);return _0x27a926[_0x9448('0x49')](_0x1cf42a);}})[_0x9448('0x1e')](function(_0x388f9c){if(_0x388f9c){_0x55cd2f=_0x388f9c['length'];if(!_0x7530f3['query'][_0x9448('0x30')](_0x9448('0x31'))){_0x1cf42a[_0x9448('0x1a')]=qs['limit'](_0x7530f3[_0x9448('0x2a')]['limit']);_0x1cf42a['offset']=qs[_0x9448('0x17')](_0x7530f3[_0x9448('0x2a')]['offset']);}return _0x27a926[_0x9448('0x49')](_0x1cf42a);}})[_0x9448('0x1e')](function(_0x2e146d){if(_0x2e146d){return _0x2e146d?{'count':_0x55cd2f,'rows':_0x2e146d}:null;}})[_0x9448('0x1e')](respondWithResult(_0x501008,null))['catch'](handleError(_0x501008,null));}; \ No newline at end of file +var _0xff01=['fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','status','stack','name','send','FreshsalesConfiguration','rawAttributes','model','map','keys','query','intersection','attributes'];(function(_0x36154a,_0x2cf98c){var _0x61104e=function(_0x1e23ed){while(--_0x1e23ed){_0x36154a['push'](_0x36154a['shift']());}};_0x61104e(++_0x2cf98c);}(_0xff01,0xb7));var _0x1ff0=function(_0x4b3e51,_0x10e9e5){_0x4b3e51=_0x4b3e51-0x0;var _0x2ea977=_0xff01[_0x4b3e51];return _0x2ea977;};'use strict';var emlformat=require(_0x1ff0('0x0'));var rimraf=require(_0x1ff0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ff0('0x2'));var rp=require('request-promise');var moment=require(_0x1ff0('0x3'));var BPromise=require(_0x1ff0('0x4'));var Mustache=require(_0x1ff0('0x5'));var util=require('util');var path=require(_0x1ff0('0x6'));var sox=require('sox');var csv=require(_0x1ff0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ff0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ff0('0x9'));var jsforce=require(_0x1ff0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1ff0('0x7'));var querystring=require(_0x1ff0('0xb'));var Papa=require(_0x1ff0('0xc'));var Redis=require(_0x1ff0('0xd'));var authService=require(_0x1ff0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1ff0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ff0('0x10'))(_0x1ff0('0x11'));var utils=require(_0x1ff0('0x12'));var config=require(_0x1ff0('0x13'));var licenseUtil=require(_0x1ff0('0x14'));var db=require(_0x1ff0('0x15'))['db'];function respondWithStatusCode(_0x313caf,_0x1137e0){_0x1137e0=_0x1137e0||0xcc;return function(_0xdd0f19){if(_0xdd0f19){return _0x313caf[_0x1ff0('0x16')](_0x1137e0);}return _0x313caf['status'](_0x1137e0)[_0x1ff0('0x17')]();};}function respondWithResult(_0x15ebf4,_0xe352f1){_0xe352f1=_0xe352f1||0xc8;return function(_0xd9ca3e){if(_0xd9ca3e){return _0x15ebf4['status'](_0xe352f1)[_0x1ff0('0x18')](_0xd9ca3e);}};}function respondWithFilteredResult(_0x1475c0,_0x4ca7db){return function(_0x9b0565){if(_0x9b0565){var _0xc53d05=typeof _0x4ca7db[_0x1ff0('0x19')]==='undefined'&&typeof _0x4ca7db['limit']===_0x1ff0('0x1a');var _0x402adc=_0x9b0565['count'];var _0x1efb08=_0xc53d05?0x0:_0x4ca7db[_0x1ff0('0x19')];var _0x2b3199=_0xc53d05?_0x9b0565[_0x1ff0('0x1b')]:_0x4ca7db['offset']+_0x4ca7db['limit'];var _0x4e0c9c;if(_0x2b3199>=_0x402adc){_0x2b3199=_0x402adc;_0x4e0c9c=0xc8;}else{_0x4e0c9c=0xce;}_0x1475c0['status'](_0x4e0c9c);return _0x1475c0[_0x1ff0('0x1c')](_0x1ff0('0x1d'),_0x1efb08+'-'+_0x2b3199+'/'+_0x402adc)[_0x1ff0('0x18')](_0x9b0565);}return null;};}function patchUpdates(_0x5e98d5){return function(_0x34cc1d){try{jsonpatch[_0x1ff0('0x1e')](_0x34cc1d,_0x5e98d5,!![]);}catch(_0x42c737){return BPromise[_0x1ff0('0x1f')](_0x42c737);}return _0x34cc1d[_0x1ff0('0x20')]();};}function saveUpdates(_0x366c23,_0x165f6f){return function(_0xe3045c){if(_0xe3045c){return _0xe3045c[_0x1ff0('0x21')](_0x366c23)[_0x1ff0('0x22')](function(_0x3dd8f2){return _0x3dd8f2;});}return null;};}function removeEntity(_0x4dcd52,_0x45391b){return function(_0x525579){if(_0x525579){return _0x525579[_0x1ff0('0x23')]()['then'](function(){_0x4dcd52[_0x1ff0('0x24')](0xcc)[_0x1ff0('0x17')]();});}};}function handleEntityNotFound(_0x3c9e6e,_0x96a4ab){return function(_0x47034c){if(!_0x47034c){_0x3c9e6e['sendStatus'](0x194);}return _0x47034c;};}function handleError(_0x2c711a,_0x4635ca){_0x4635ca=_0x4635ca||0x1f4;return function(_0x38a2e2){logger['error'](_0x38a2e2[_0x1ff0('0x25')]);if(_0x38a2e2[_0x1ff0('0x26')]){delete _0x38a2e2[_0x1ff0('0x26')];}_0x2c711a[_0x1ff0('0x24')](_0x4635ca)[_0x1ff0('0x27')](_0x38a2e2);};}exports['index']=function(_0xbd4cdd,_0x16cd1a){var _0x37c24={},_0x16a084={},_0x5dab5b={'count':0x0,'rows':[]};var _0x97acd8=_['map'](db[_0x1ff0('0x28')][_0x1ff0('0x29')],function(_0x4a67dd){return{'name':_0x4a67dd['fieldName'],'type':_0x4a67dd['type']['key']};});_0x16a084[_0x1ff0('0x2a')]=_[_0x1ff0('0x2b')](_0x97acd8,_0x1ff0('0x26'));_0x16a084['query']=_[_0x1ff0('0x2c')](_0xbd4cdd[_0x1ff0('0x2d')]);_0x16a084['filters']=_[_0x1ff0('0x2e')](_0x16a084[_0x1ff0('0x2a')],_0x16a084[_0x1ff0('0x2d')]);_0x37c24[_0x1ff0('0x2f')]=_['intersection'](_0x16a084[_0x1ff0('0x2a')],qs['fields'](_0xbd4cdd[_0x1ff0('0x2d')][_0x1ff0('0x30')]));_0x37c24[_0x1ff0('0x2f')]=_0x37c24[_0x1ff0('0x2f')][_0x1ff0('0x31')]?_0x37c24[_0x1ff0('0x2f')]:_0x16a084[_0x1ff0('0x2a')];if(!_0xbd4cdd[_0x1ff0('0x2d')]['hasOwnProperty'](_0x1ff0('0x32'))){_0x37c24['limit']=qs[_0x1ff0('0x33')](_0xbd4cdd[_0x1ff0('0x2d')][_0x1ff0('0x33')]);_0x37c24['offset']=qs['offset'](_0xbd4cdd[_0x1ff0('0x2d')]['offset']);}_0x37c24[_0x1ff0('0x34')]=qs[_0x1ff0('0x35')](_0xbd4cdd['query'][_0x1ff0('0x35')]);_0x37c24[_0x1ff0('0x36')]=qs[_0x1ff0('0x37')](_[_0x1ff0('0x38')](_0xbd4cdd[_0x1ff0('0x2d')],_0x16a084[_0x1ff0('0x37')]),_0x97acd8);if(_0xbd4cdd['query'][_0x1ff0('0x39')]){_0x37c24[_0x1ff0('0x36')]=_[_0x1ff0('0x3a')](_0x37c24['where'],{'$or':_['map'](_0x97acd8,function(_0x442852){if(_0x442852['type']!==_0x1ff0('0x3b')){var _0x2152ab={};_0x2152ab[_0x442852['name']]={'$like':'%'+_0xbd4cdd['query'][_0x1ff0('0x39')]+'%'};return _0x2152ab;}})});}_0x37c24=_[_0x1ff0('0x3a')]({},_0x37c24,_0xbd4cdd['options']);var _0x16e910={'where':_0x37c24['where']};return db[_0x1ff0('0x28')]['count'](_0x16e910)['then'](function(_0x5241d8){_0x5dab5b[_0x1ff0('0x1b')]=_0x5241d8;if(_0xbd4cdd['query'][_0x1ff0('0x3c')]){_0x37c24[_0x1ff0('0x3d')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x1ff0('0x3e')](_0x37c24);})[_0x1ff0('0x22')](function(_0xc8fbba){_0x5dab5b[_0x1ff0('0x3f')]=_0xc8fbba;return _0x5dab5b;})['then'](respondWithFilteredResult(_0x16cd1a,_0x37c24))[_0x1ff0('0x40')](handleError(_0x16cd1a,null));};exports[_0x1ff0('0x41')]=function(_0x403a62,_0x36ba09){var _0x2f94bb={'raw':![],'where':{'id':_0x403a62[_0x1ff0('0x42')]['id']}},_0x3596ad={};_0x3596ad['model']=_[_0x1ff0('0x2c')](db['FreshsalesConfiguration']['rawAttributes']);_0x3596ad[_0x1ff0('0x2d')]=_[_0x1ff0('0x2c')](_0x403a62[_0x1ff0('0x2d')]);_0x3596ad['filters']=_[_0x1ff0('0x2e')](_0x3596ad[_0x1ff0('0x2a')],_0x3596ad[_0x1ff0('0x2d')]);_0x2f94bb[_0x1ff0('0x2f')]=_[_0x1ff0('0x2e')](_0x3596ad[_0x1ff0('0x2a')],qs['fields'](_0x403a62['query'][_0x1ff0('0x30')]));_0x2f94bb[_0x1ff0('0x2f')]=_0x2f94bb[_0x1ff0('0x2f')]['length']?_0x2f94bb[_0x1ff0('0x2f')]:_0x3596ad[_0x1ff0('0x2a')];if(_0x403a62[_0x1ff0('0x2d')][_0x1ff0('0x3c')]){_0x2f94bb[_0x1ff0('0x3d')]=[{'all':!![]}];}_0x2f94bb=_['merge']({},_0x2f94bb,_0x403a62[_0x1ff0('0x43')]);return db[_0x1ff0('0x28')]['find'](_0x2f94bb)['then'](handleEntityNotFound(_0x36ba09,null))['then'](respondWithResult(_0x36ba09,null))[_0x1ff0('0x40')](handleError(_0x36ba09,null));};exports[_0x1ff0('0x44')]=function(_0x34cea6,_0x23eadb){return db[_0x1ff0('0x28')]['create'](_0x34cea6['body'],{})[_0x1ff0('0x22')](respondWithResult(_0x23eadb,0xc9))[_0x1ff0('0x40')](handleError(_0x23eadb,null));};exports[_0x1ff0('0x21')]=function(_0x4a381e,_0x3844ce){if(_0x4a381e[_0x1ff0('0x45')]['id']){delete _0x4a381e[_0x1ff0('0x45')]['id'];}return db[_0x1ff0('0x28')][_0x1ff0('0x46')]({'where':{'id':_0x4a381e['params']['id']}})[_0x1ff0('0x22')](handleEntityNotFound(_0x3844ce,null))[_0x1ff0('0x22')](saveUpdates(_0x4a381e[_0x1ff0('0x45')],null))[_0x1ff0('0x22')](respondWithResult(_0x3844ce,null))[_0x1ff0('0x40')](handleError(_0x3844ce,null));};exports['destroy']=function(_0x44774f,_0xf9a7de){return db[_0x1ff0('0x28')][_0x1ff0('0x46')]({'where':{'id':_0x44774f[_0x1ff0('0x42')]['id']}})[_0x1ff0('0x22')](handleEntityNotFound(_0xf9a7de,null))[_0x1ff0('0x22')](removeEntity(_0xf9a7de,null))['catch'](handleError(_0xf9a7de,null));};exports[_0x1ff0('0x47')]=function(_0x268c2d,_0x265290,_0x11dc1b){var _0x41b7f9={};var _0x2c76ac={};var _0x3370ac;var _0x2e33a7;return db[_0x1ff0('0x28')][_0x1ff0('0x48')]({'where':{'id':_0x268c2d[_0x1ff0('0x42')]['id']}})[_0x1ff0('0x22')](handleEntityNotFound(_0x265290,null))[_0x1ff0('0x22')](function(_0x5595f9){if(_0x5595f9){_0x3370ac=_0x5595f9;_0x2c76ac[_0x1ff0('0x2a')]=_['keys'](db[_0x1ff0('0x49')][_0x1ff0('0x29')]);_0x2c76ac[_0x1ff0('0x2d')]=_[_0x1ff0('0x2c')](_0x268c2d[_0x1ff0('0x2d')]);_0x2c76ac[_0x1ff0('0x37')]=_[_0x1ff0('0x2e')](_0x2c76ac[_0x1ff0('0x2a')],_0x2c76ac[_0x1ff0('0x2d')]);_0x41b7f9[_0x1ff0('0x2f')]=_[_0x1ff0('0x2e')](_0x2c76ac[_0x1ff0('0x2a')],qs['fields'](_0x268c2d[_0x1ff0('0x2d')][_0x1ff0('0x30')]));_0x41b7f9[_0x1ff0('0x2f')]=_0x41b7f9[_0x1ff0('0x2f')][_0x1ff0('0x31')]?_0x41b7f9[_0x1ff0('0x2f')]:_0x2c76ac[_0x1ff0('0x2a')];_0x41b7f9[_0x1ff0('0x34')]=qs[_0x1ff0('0x35')](_0x268c2d['query'][_0x1ff0('0x35')]);_0x41b7f9[_0x1ff0('0x36')]=qs[_0x1ff0('0x37')](_[_0x1ff0('0x38')](_0x268c2d[_0x1ff0('0x2d')],_0x2c76ac[_0x1ff0('0x37')]));if(_0x268c2d[_0x1ff0('0x2d')][_0x1ff0('0x39')]){_0x41b7f9[_0x1ff0('0x36')]=_[_0x1ff0('0x3a')](_0x41b7f9[_0x1ff0('0x36')],{'$or':_[_0x1ff0('0x2b')](_0x41b7f9[_0x1ff0('0x2f')],function(_0x53d68c){var _0x2e0abe={};_0x2e0abe[_0x53d68c]={'$like':'%'+_0x268c2d[_0x1ff0('0x2d')][_0x1ff0('0x39')]+'%'};return _0x2e0abe;})});}_0x41b7f9=_['merge']({},_0x41b7f9,_0x268c2d['options']);return _0x3370ac[_0x1ff0('0x47')](_0x41b7f9);}})[_0x1ff0('0x22')](function(_0x9da059){if(_0x9da059){_0x2e33a7=_0x9da059['length'];if(!_0x268c2d['query'][_0x1ff0('0x4a')](_0x1ff0('0x32'))){_0x41b7f9[_0x1ff0('0x33')]=qs[_0x1ff0('0x33')](_0x268c2d['query']['limit']);_0x41b7f9[_0x1ff0('0x19')]=qs[_0x1ff0('0x19')](_0x268c2d[_0x1ff0('0x2d')][_0x1ff0('0x19')]);}return _0x3370ac[_0x1ff0('0x47')](_0x41b7f9);}})[_0x1ff0('0x22')](function(_0x1ad41e){if(_0x1ad41e){return _0x1ad41e?{'count':_0x2e33a7,'rows':_0x1ad41e}:null;}})[_0x1ff0('0x22')](respondWithResult(_0x265290,null))[_0x1ff0('0x40')](handleError(_0x265290,null));};exports[_0x1ff0('0x4b')]=function(_0x551fd4,_0x1f7860,_0x1d491b){var _0x1851a1={};var _0xc516f3={};var _0x214e1e;var _0x2bff64;return db[_0x1ff0('0x28')][_0x1ff0('0x48')]({'where':{'id':_0x551fd4[_0x1ff0('0x42')]['id']}})[_0x1ff0('0x22')](handleEntityNotFound(_0x1f7860,null))[_0x1ff0('0x22')](function(_0xad53e1){if(_0xad53e1){_0x214e1e=_0xad53e1;_0xc516f3['model']=_[_0x1ff0('0x2c')](db[_0x1ff0('0x49')][_0x1ff0('0x29')]);_0xc516f3[_0x1ff0('0x2d')]=_[_0x1ff0('0x2c')](_0x551fd4[_0x1ff0('0x2d')]);_0xc516f3[_0x1ff0('0x37')]=_[_0x1ff0('0x2e')](_0xc516f3[_0x1ff0('0x2a')],_0xc516f3['query']);_0x1851a1[_0x1ff0('0x2f')]=_[_0x1ff0('0x2e')](_0xc516f3[_0x1ff0('0x2a')],qs[_0x1ff0('0x30')](_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x30')]));_0x1851a1['attributes']=_0x1851a1[_0x1ff0('0x2f')][_0x1ff0('0x31')]?_0x1851a1[_0x1ff0('0x2f')]:_0xc516f3[_0x1ff0('0x2a')];_0x1851a1[_0x1ff0('0x34')]=qs[_0x1ff0('0x35')](_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x35')]);_0x1851a1['where']=qs[_0x1ff0('0x37')](_[_0x1ff0('0x38')](_0x551fd4[_0x1ff0('0x2d')],_0xc516f3[_0x1ff0('0x37')]));if(_0x551fd4[_0x1ff0('0x2d')]['filter']){_0x1851a1['where']=_[_0x1ff0('0x3a')](_0x1851a1['where'],{'$or':_['map'](_0x1851a1[_0x1ff0('0x2f')],function(_0x19e7ac){var _0x13e092={};_0x13e092[_0x19e7ac]={'$like':'%'+_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x39')]+'%'};return _0x13e092;})});}_0x1851a1=_[_0x1ff0('0x3a')]({},_0x1851a1,_0x551fd4[_0x1ff0('0x43')]);return _0x214e1e[_0x1ff0('0x4b')](_0x1851a1);}})[_0x1ff0('0x22')](function(_0x274ed5){if(_0x274ed5){_0x2bff64=_0x274ed5['length'];if(!_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x4a')](_0x1ff0('0x32'))){_0x1851a1[_0x1ff0('0x33')]=qs[_0x1ff0('0x33')](_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x33')]);_0x1851a1[_0x1ff0('0x19')]=qs['offset'](_0x551fd4[_0x1ff0('0x2d')][_0x1ff0('0x19')]);}return _0x214e1e[_0x1ff0('0x4b')](_0x1851a1);}})['then'](function(_0x56585a){if(_0x56585a){return _0x56585a?{'count':_0x2bff64,'rows':_0x56585a}:null;}})[_0x1ff0('0x22')](respondWithResult(_0x1f7860,null))[_0x1ff0('0x40')](handleError(_0x1f7860,null));};exports['getFields']=function(_0x853eb2,_0x2e9b21,_0x101f44){var _0x4bdff8={};var _0x27174b={};var _0x97d3ff;var _0x26faa7;return db[_0x1ff0('0x28')][_0x1ff0('0x48')]({'where':{'id':_0x853eb2['params']['id']}})['then'](handleEntityNotFound(_0x2e9b21,null))['then'](function(_0x1cf021){if(_0x1cf021){_0x97d3ff=_0x1cf021;_0x27174b[_0x1ff0('0x2a')]=_[_0x1ff0('0x2c')](db[_0x1ff0('0x49')][_0x1ff0('0x29')]);_0x27174b[_0x1ff0('0x2d')]=_[_0x1ff0('0x2c')](_0x853eb2[_0x1ff0('0x2d')]);_0x27174b[_0x1ff0('0x37')]=_[_0x1ff0('0x2e')](_0x27174b[_0x1ff0('0x2a')],_0x27174b[_0x1ff0('0x2d')]);_0x4bdff8[_0x1ff0('0x2f')]=_[_0x1ff0('0x2e')](_0x27174b[_0x1ff0('0x2a')],qs['fields'](_0x853eb2[_0x1ff0('0x2d')]['fields']));_0x4bdff8[_0x1ff0('0x2f')]=_0x4bdff8['attributes'][_0x1ff0('0x31')]?_0x4bdff8[_0x1ff0('0x2f')]:_0x27174b[_0x1ff0('0x2a')];_0x4bdff8['order']=qs[_0x1ff0('0x35')](_0x853eb2[_0x1ff0('0x2d')][_0x1ff0('0x35')]);_0x4bdff8[_0x1ff0('0x36')]=qs[_0x1ff0('0x37')](_[_0x1ff0('0x38')](_0x853eb2[_0x1ff0('0x2d')],_0x27174b[_0x1ff0('0x37')]));if(_0x853eb2[_0x1ff0('0x2d')][_0x1ff0('0x39')]){_0x4bdff8['where']=_[_0x1ff0('0x3a')](_0x4bdff8[_0x1ff0('0x36')],{'$or':_[_0x1ff0('0x2b')](_0x4bdff8[_0x1ff0('0x2f')],function(_0x4a0502){var _0x2b12cb={};_0x2b12cb[_0x4a0502]={'$like':'%'+_0x853eb2[_0x1ff0('0x2d')]['filter']+'%'};return _0x2b12cb;})});}_0x4bdff8=_['merge']({},_0x4bdff8,_0x853eb2['options']);return _0x97d3ff['getFields'](_0x4bdff8);}})[_0x1ff0('0x22')](function(_0x3be1db){if(_0x3be1db){_0x26faa7=_0x3be1db['length'];if(!_0x853eb2[_0x1ff0('0x2d')]['hasOwnProperty']('nolimit')){_0x4bdff8[_0x1ff0('0x33')]=qs[_0x1ff0('0x33')](_0x853eb2[_0x1ff0('0x2d')][_0x1ff0('0x33')]);_0x4bdff8[_0x1ff0('0x19')]=qs[_0x1ff0('0x19')](_0x853eb2['query']['offset']);}return _0x97d3ff[_0x1ff0('0x4c')](_0x4bdff8);}})[_0x1ff0('0x22')](function(_0x3f6c79){if(_0x3f6c79){return _0x3f6c79?{'count':_0x26faa7,'rows':_0x3f6c79}:null;}})['then'](respondWithResult(_0x2e9b21,null))[_0x1ff0('0x40')](handleError(_0x2e9b21,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 5bbf404..24795f4 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 _0x9a16=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x4e14e7,_0x3f79ea){var _0x554994=function(_0x595048){while(--_0x595048){_0x4e14e7['push'](_0x4e14e7['shift']());}};_0x554994(++_0x3f79ea);}(_0x9a16,0xa1));var _0x69a1=function(_0x25b4e1,_0xc329fb){_0x25b4e1=_0x25b4e1-0x0;var _0x276236=_0x9a16[_0x25b4e1];return _0x276236;};'use strict';var _=require('lodash');var util=require(_0x69a1('0x0'));var logger=require(_0x69a1('0x1'))(_0x69a1('0x2'));var moment=require('moment');var BPromise=require(_0x69a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69a1('0x4'));var rimraf=require(_0x69a1('0x5'));var config=require(_0x69a1('0x6'));var attributes=require(_0x69a1('0x7'));module[_0x69a1('0x8')]=function(_0x3560e0,_0xc4df42){return _0x3560e0[_0x69a1('0x9')](_0x69a1('0xa'),attributes,{'tableName':_0x69a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x554c=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x373a4f,_0x5ec7c3){var _0x220be4=function(_0x30dc65){while(--_0x30dc65){_0x373a4f['push'](_0x373a4f['shift']());}};_0x220be4(++_0x5ec7c3);}(_0x554c,0x67));var _0xc554=function(_0x2713e2,_0xc3514a){_0x2713e2=_0x2713e2-0x0;var _0x3b804a=_0x554c[_0x2713e2];return _0x3b804a;};'use strict';var _=require('lodash');var util=require(_0xc554('0x0'));var logger=require(_0xc554('0x1'))(_0xc554('0x2'));var moment=require(_0xc554('0x3'));var BPromise=require(_0xc554('0x4'));var rp=require(_0xc554('0x5'));var fs=require('fs');var path=require(_0xc554('0x6'));var rimraf=require(_0xc554('0x7'));var config=require(_0xc554('0x8'));var attributes=require(_0xc554('0x9'));module[_0xc554('0xa')]=function(_0x2b8c7c,_0x45b870){return _0x2b8c7c[_0xc554('0xb')](_0xc554('0xc'),attributes,{'tableName':_0xc554('0xd'),'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 1b93fa5..4d628d7 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 _0xf5eb=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3a2a32,_0x15a9ae){var _0x358502=function(_0x53a15c){while(--_0x53a15c){_0x3a2a32['push'](_0x3a2a32['shift']());}};_0x358502(++_0x15a9ae);}(_0xf5eb,0xb1));var _0xbf5e=function(_0x301486,_0x27b799){_0x301486=_0x301486-0x0;var _0x418d16=_0xf5eb[_0x301486];return _0x418d16;};'use strict';var _=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf5e('0x2'));var fs=require('fs');var Redis=require(_0xbf5e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf5e('0x4'));var logger=require(_0xbf5e('0x5'))(_0xbf5e('0x6'));var config=require('../../config/environment');var jayson=require(_0xbf5e('0x7'));var client=jayson[_0xbf5e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3f12,_0x16113e,_0x2e0b69){return new BPromise(function(_0x25693b,_0x1bfd2e){return client[_0xbf5e('0x9')](_0x2e3f12,_0x2e0b69)[_0xbf5e('0xa')](function(_0x588f91){logger[_0xbf5e('0xb')](_0xbf5e('0xc'),_0x16113e,_0xbf5e('0xd'));logger[_0xbf5e('0xe')](_0xbf5e('0xf'),_0x16113e,_0xbf5e('0xd'),JSON[_0xbf5e('0x10')](_0x588f91));if(_0x588f91['error']){if(_0x588f91['error'][_0xbf5e('0x11')]===0x1f4){logger['error'](_0xbf5e('0xc'),_0x16113e,_0x588f91[_0xbf5e('0x12')]['message']);return _0x1bfd2e(_0x588f91[_0xbf5e('0x12')][_0xbf5e('0x13')]);}logger[_0xbf5e('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16113e,_0x588f91[_0xbf5e('0x12')][_0xbf5e('0x13')]);return _0x25693b(_0x588f91['error'][_0xbf5e('0x13')]);}else{logger[_0xbf5e('0xb')](_0xbf5e('0xc'),_0x16113e,'request\x20sent');_0x25693b(_0x588f91['result'][_0xbf5e('0x13')]);}})[_0xbf5e('0x14')](function(_0x26ab7a){logger[_0xbf5e('0x12')](_0xbf5e('0xc'),_0x16113e,_0x26ab7a);_0x1bfd2e(_0x26ab7a);});});} \ No newline at end of file +var _0xa852=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x12d86d,_0xded6db){var _0x53b559=function(_0x42e996){while(--_0x42e996){_0x12d86d['push'](_0x12d86d['shift']());}};_0x53b559(++_0xded6db);}(_0xa852,0x137));var _0x2a85=function(_0x1abaf5,_0x379703){_0x1abaf5=_0x1abaf5-0x0;var _0x44bd03=_0xa852[_0x1abaf5];return _0x44bd03;};'use strict';var _=require('lodash');var util=require(_0x2a85('0x0'));var moment=require(_0x2a85('0x1'));var BPromise=require('bluebird');var rs=require(_0x2a85('0x2'));var fs=require('fs');var Redis=require(_0x2a85('0x3'));var db=require(_0x2a85('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a85('0x5'))(_0x2a85('0x6'));var config=require('../../config/environment');var jayson=require(_0x2a85('0x7'));var client=jayson[_0x2a85('0x8')][_0x2a85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54f048,_0x179aff,_0x27779b){return new BPromise(function(_0x2802fd,_0x31fa97){return client[_0x2a85('0xa')](_0x54f048,_0x27779b)[_0x2a85('0xb')](function(_0x1e1698){logger[_0x2a85('0xc')](_0x2a85('0xd'),_0x179aff,_0x2a85('0xe'));logger[_0x2a85('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x179aff,'request\x20sent',JSON[_0x2a85('0x10')](_0x1e1698));if(_0x1e1698[_0x2a85('0x11')]){if(_0x1e1698[_0x2a85('0x11')][_0x2a85('0x12')]===0x1f4){logger[_0x2a85('0x11')](_0x2a85('0xd'),_0x179aff,_0x1e1698[_0x2a85('0x11')]['message']);return _0x31fa97(_0x1e1698[_0x2a85('0x11')][_0x2a85('0x13')]);}logger[_0x2a85('0x11')](_0x2a85('0xd'),_0x179aff,_0x1e1698['error'][_0x2a85('0x13')]);return _0x2802fd(_0x1e1698[_0x2a85('0x11')][_0x2a85('0x13')]);}else{logger[_0x2a85('0xc')](_0x2a85('0xd'),_0x179aff,_0x2a85('0xe'));_0x2802fd(_0x1e1698['result']['message']);}})[_0x2a85('0x14')](function(_0xd4761b){logger[_0x2a85('0x11')](_0x2a85('0xd'),_0x179aff,_0xd4761b);_0x31fa97(_0xd4761b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 01a01f5..1fa5a77 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 _0x524a=['create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','show'];(function(_0x53ee6,_0x38d280){var _0x5b0580=function(_0x3a603d){while(--_0x3a603d){_0x53ee6['push'](_0x53ee6['shift']());}};_0x5b0580(++_0x38d280);}(_0x524a,0xf5));var _0xa524=function(_0x46f321,_0x584fa1){_0x46f321=_0x46f321-0x0;var _0x1b0e0c=_0x524a[_0x46f321];return _0x1b0e0c;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['post']('/',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0xc')](_0xa524('0xd'),auth[_0xa524('0x9')](),controller['update']);router[_0xa524('0xe')](_0xa524('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa524('0xf')]=router; \ No newline at end of file +var _0xab3a=['put','update','delete','destroy','exports','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'];(function(_0x21ebdf,_0x2c1a0f){var _0x465a61=function(_0x1c3177){while(--_0x1c3177){_0x21ebdf['push'](_0x21ebdf['shift']());}};_0x465a61(++_0x2c1a0f);}(_0xab3a,0x1d3));var _0xaab3=function(_0x46a085,_0x33fa72){_0x46a085=_0x46a085-0x0;var _0x57d64f=_0xab3a[_0x46a085];return _0x57d64f;};'use strict';var multer=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var path=require(_0xaab3('0x2'));var timeout=require(_0xaab3('0x3'));var express=require(_0xaab3('0x4'));var router=express[_0xaab3('0x5')]();var fs_extra=require(_0xaab3('0x6'));var auth=require(_0xaab3('0x7'));var interaction=require(_0xaab3('0x8'));var config=require(_0xaab3('0x9'));var controller=require(_0xaab3('0xa'));router[_0xaab3('0xb')]('/',auth[_0xaab3('0xc')](),controller['index']);router['get'](_0xaab3('0xd'),auth[_0xaab3('0xc')](),controller[_0xaab3('0xe')]);router[_0xaab3('0xf')]('/',auth[_0xaab3('0xc')](),controller[_0xaab3('0x10')]);router[_0xaab3('0x11')](_0xaab3('0xd'),auth[_0xaab3('0xc')](),controller[_0xaab3('0x12')]);router[_0xaab3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xaab3('0x14')]);module[_0xaab3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5b28504..be238f0 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 _0xaf04=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xaf04,0x108));var _0x4af0=function(_0x375340,_0x26dd9f){_0x375340=_0x375340-0x0;var _0x54be3c=_0xaf04[_0x375340];return _0x54be3c;};'use strict';var Sequelize=require('sequelize');module[_0x4af0('0x0')]={'type':{'type':Sequelize[_0x4af0('0x1')](_0x4af0('0x2'),_0x4af0('0x3'),_0x4af0('0x4'),_0x4af0('0x5'),_0x4af0('0x6')),'defaultValue':_0x4af0('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4af0('0x7')]},'keyType':{'type':Sequelize[_0x4af0('0x1')]('string','variable',_0x4af0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4af0('0x7')]},'nameField':{'type':Sequelize[_0x4af0('0x7')]},'customField':{'type':Sequelize[_0x4af0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa9ba=['string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3a5086,_0x294cde){var _0x38a7cf=function(_0xfcb0b3){while(--_0xfcb0b3){_0x3a5086['push'](_0x3a5086['shift']());}};_0x38a7cf(++_0x294cde);}(_0xa9ba,0x84));var _0xaa9b=function(_0x37ccff,_0x581fa2){_0x37ccff=_0x37ccff-0x0;var _0x20eca7=_0xa9ba[_0x37ccff];return _0x20eca7;};'use strict';var Sequelize=require(_0xaa9b('0x0'));module[_0xaa9b('0x1')]={'type':{'type':Sequelize[_0xaa9b('0x2')]('string',_0xaa9b('0x3'),_0xaa9b('0x4'),_0xaa9b('0x5'),_0xaa9b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa9b('0x7')]},'keyType':{'type':Sequelize[_0xaa9b('0x2')](_0xaa9b('0x8'),_0xaa9b('0x3'),_0xaa9b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaa9b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xaa9b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaa9b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1789e4a..8670750 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 _0x0393=['includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesField','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0393,0xa7));var _0x3039=function(_0x32f1a7,_0x4b2b4f){_0x32f1a7=_0x32f1a7-0x0;var _0x5723c1=_0x0393[_0x32f1a7];return _0x5723c1;};'use strict';var emlformat=require(_0x3039('0x0'));var rimraf=require(_0x3039('0x1'));var zipdir=require(_0x3039('0x2'));var jsonpatch=require(_0x3039('0x3'));var rp=require(_0x3039('0x4'));var moment=require('moment');var BPromise=require(_0x3039('0x5'));var Mustache=require(_0x3039('0x6'));var util=require(_0x3039('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3039('0x8'));var ejs=require(_0x3039('0x9'));var fs=require('fs');var fs_extra=require(_0x3039('0xa'));var _=require(_0x3039('0xb'));var squel=require(_0x3039('0xc'));var crypto=require(_0x3039('0xd'));var jsforce=require(_0x3039('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3039('0x8'));var querystring=require(_0x3039('0xf'));var Papa=require(_0x3039('0x10'));var Redis=require(_0x3039('0x11'));var authService=require(_0x3039('0x12'));var qs=require(_0x3039('0x13'));var as=require(_0x3039('0x14'));var hardwareService=require(_0x3039('0x15'));var logger=require(_0x3039('0x16'))(_0x3039('0x17'));var utils=require(_0x3039('0x18'));var config=require(_0x3039('0x19'));var licenseUtil=require(_0x3039('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9f58,_0x2461cc){_0x2461cc=_0x2461cc||0xcc;return function(_0x9b5aa5){if(_0x9b5aa5){return _0x5d9f58[_0x3039('0x1b')](_0x2461cc);}return _0x5d9f58[_0x3039('0x1c')](_0x2461cc)[_0x3039('0x1d')]();};}function respondWithResult(_0x3c2c0d,_0xf8959b){_0xf8959b=_0xf8959b||0xc8;return function(_0x6aea2b){if(_0x6aea2b){return _0x3c2c0d['status'](_0xf8959b)[_0x3039('0x1e')](_0x6aea2b);}};}function respondWithFilteredResult(_0x3c211c,_0x2a0899){return function(_0x176ad7){if(_0x176ad7){var _0x40d6a5=typeof _0x2a0899[_0x3039('0x1f')]===_0x3039('0x20')&&typeof _0x2a0899[_0x3039('0x21')]===_0x3039('0x20');var _0x487890=_0x176ad7['count'];var _0x340797=_0x40d6a5?0x0:_0x2a0899[_0x3039('0x1f')];var _0x1fc89d=_0x40d6a5?_0x176ad7[_0x3039('0x22')]:_0x2a0899['offset']+_0x2a0899[_0x3039('0x21')];var _0x5bef01;if(_0x1fc89d>=_0x487890){_0x1fc89d=_0x487890;_0x5bef01=0xc8;}else{_0x5bef01=0xce;}_0x3c211c[_0x3039('0x1c')](_0x5bef01);return _0x3c211c[_0x3039('0x23')](_0x3039('0x24'),_0x340797+'-'+_0x1fc89d+'/'+_0x487890)['json'](_0x176ad7);}return null;};}function patchUpdates(_0x3ef966){return function(_0x47eed0){try{jsonpatch[_0x3039('0x25')](_0x47eed0,_0x3ef966,!![]);}catch(_0x3f9d76){return BPromise[_0x3039('0x26')](_0x3f9d76);}return _0x47eed0[_0x3039('0x27')]();};}function saveUpdates(_0x1e7e27,_0x9fff44){return function(_0x3a985a){if(_0x3a985a){return _0x3a985a[_0x3039('0x28')](_0x1e7e27)[_0x3039('0x29')](function(_0xe0f01f){return _0xe0f01f;});}return null;};}function removeEntity(_0x2453fb,_0x315635){return function(_0x4b7779){if(_0x4b7779){return _0x4b7779[_0x3039('0x2a')]()[_0x3039('0x29')](function(){_0x2453fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2630f1,_0xe49d){return function(_0x194a74){if(!_0x194a74){_0x2630f1[_0x3039('0x1b')](0x194);}return _0x194a74;};}function handleError(_0x15effc,_0x34c134){_0x34c134=_0x34c134||0x1f4;return function(_0x11ffdf){logger[_0x3039('0x2b')](_0x11ffdf[_0x3039('0x2c')]);if(_0x11ffdf[_0x3039('0x2d')]){delete _0x11ffdf['name'];}_0x15effc['status'](_0x34c134)[_0x3039('0x2e')](_0x11ffdf);};}exports[_0x3039('0x2f')]=function(_0x425ba8,_0x1d2545){var _0x208bc0={},_0x31a95c={},_0x7702b9={'count':0x0,'rows':[]};var _0x48bcd5=_['map'](db[_0x3039('0x30')][_0x3039('0x31')],function(_0x4b781a){return{'name':_0x4b781a['fieldName'],'type':_0x4b781a[_0x3039('0x32')][_0x3039('0x33')]};});_0x31a95c[_0x3039('0x34')]=_[_0x3039('0x35')](_0x48bcd5,_0x3039('0x2d'));_0x31a95c[_0x3039('0x36')]=_[_0x3039('0x37')](_0x425ba8[_0x3039('0x36')]);_0x31a95c[_0x3039('0x38')]=_[_0x3039('0x39')](_0x31a95c[_0x3039('0x34')],_0x31a95c[_0x3039('0x36')]);_0x208bc0['attributes']=_[_0x3039('0x39')](_0x31a95c[_0x3039('0x34')],qs[_0x3039('0x3a')](_0x425ba8['query'][_0x3039('0x3a')]));_0x208bc0[_0x3039('0x3b')]=_0x208bc0['attributes'][_0x3039('0x3c')]?_0x208bc0['attributes']:_0x31a95c[_0x3039('0x34')];if(!_0x425ba8[_0x3039('0x36')][_0x3039('0x3d')](_0x3039('0x3e'))){_0x208bc0[_0x3039('0x21')]=qs[_0x3039('0x21')](_0x425ba8[_0x3039('0x36')][_0x3039('0x21')]);_0x208bc0['offset']=qs['offset'](_0x425ba8['query'][_0x3039('0x1f')]);}_0x208bc0[_0x3039('0x3f')]=qs['sort'](_0x425ba8[_0x3039('0x36')]['sort']);_0x208bc0[_0x3039('0x40')]=qs[_0x3039('0x38')](_[_0x3039('0x41')](_0x425ba8[_0x3039('0x36')],_0x31a95c[_0x3039('0x38')]),_0x48bcd5);if(_0x425ba8[_0x3039('0x36')][_0x3039('0x42')]){_0x208bc0[_0x3039('0x40')]=_[_0x3039('0x43')](_0x208bc0['where'],{'$or':_['map'](_0x48bcd5,function(_0x1f6943){if(_0x1f6943[_0x3039('0x32')]!==_0x3039('0x44')){var _0x5c0dcc={};_0x5c0dcc[_0x1f6943[_0x3039('0x2d')]]={'$like':'%'+_0x425ba8[_0x3039('0x36')]['filter']+'%'};return _0x5c0dcc;}})});}_0x208bc0=_[_0x3039('0x43')]({},_0x208bc0,_0x425ba8[_0x3039('0x45')]);var _0x52b093={'where':_0x208bc0[_0x3039('0x40')]};return db[_0x3039('0x30')][_0x3039('0x22')](_0x52b093)[_0x3039('0x29')](function(_0x28b963){_0x7702b9['count']=_0x28b963;if(_0x425ba8[_0x3039('0x36')][_0x3039('0x46')]){_0x208bc0[_0x3039('0x47')]=[{'all':!![]}];}return db['FreshsalesField'][_0x3039('0x48')](_0x208bc0);})[_0x3039('0x29')](function(_0x377c7a){_0x7702b9[_0x3039('0x49')]=_0x377c7a;return _0x7702b9;})[_0x3039('0x29')](respondWithFilteredResult(_0x1d2545,_0x208bc0))[_0x3039('0x4a')](handleError(_0x1d2545,null));};exports['show']=function(_0x431e5f,_0x38bd1e){var _0x348ace={'raw':!![],'where':{'id':_0x431e5f[_0x3039('0x4b')]['id']}},_0x4e8581={};_0x4e8581[_0x3039('0x34')]=_['keys'](db[_0x3039('0x30')][_0x3039('0x31')]);_0x4e8581[_0x3039('0x36')]=_['keys'](_0x431e5f['query']);_0x4e8581[_0x3039('0x38')]=_[_0x3039('0x39')](_0x4e8581[_0x3039('0x34')],_0x4e8581['query']);_0x348ace[_0x3039('0x3b')]=_[_0x3039('0x39')](_0x4e8581[_0x3039('0x34')],qs[_0x3039('0x3a')](_0x431e5f[_0x3039('0x36')][_0x3039('0x3a')]));_0x348ace[_0x3039('0x3b')]=_0x348ace[_0x3039('0x3b')]['length']?_0x348ace['attributes']:_0x4e8581[_0x3039('0x34')];if(_0x431e5f['query'][_0x3039('0x46')]){_0x348ace[_0x3039('0x47')]=[{'all':!![]}];}_0x348ace=_[_0x3039('0x43')]({},_0x348ace,_0x431e5f['options']);return db[_0x3039('0x30')][_0x3039('0x4c')](_0x348ace)[_0x3039('0x29')](handleEntityNotFound(_0x38bd1e,null))[_0x3039('0x29')](respondWithResult(_0x38bd1e,null))['catch'](handleError(_0x38bd1e,null));};exports[_0x3039('0x4d')]=function(_0x3719a9,_0x5012f1){return db['FreshsalesField'][_0x3039('0x4d')](_0x3719a9[_0x3039('0x4e')],{})[_0x3039('0x29')](respondWithResult(_0x5012f1,0xc9))[_0x3039('0x4a')](handleError(_0x5012f1,null));};exports[_0x3039('0x28')]=function(_0x351564,_0x43bb6f){if(_0x351564[_0x3039('0x4e')]['id']){delete _0x351564[_0x3039('0x4e')]['id'];}return db[_0x3039('0x30')][_0x3039('0x4c')]({'where':{'id':_0x351564[_0x3039('0x4b')]['id']}})[_0x3039('0x29')](handleEntityNotFound(_0x43bb6f,null))[_0x3039('0x29')](saveUpdates(_0x351564[_0x3039('0x4e')],null))['then'](respondWithResult(_0x43bb6f,null))[_0x3039('0x4a')](handleError(_0x43bb6f,null));};exports[_0x3039('0x2a')]=function(_0x56d393,_0x134d44){return db[_0x3039('0x30')][_0x3039('0x4c')]({'where':{'id':_0x56d393['params']['id']}})[_0x3039('0x29')](handleEntityNotFound(_0x134d44,null))[_0x3039('0x29')](removeEntity(_0x134d44,null))[_0x3039('0x4a')](handleError(_0x134d44,null));}; \ No newline at end of file +var _0x6213=['attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','length','include','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x363887,_0x4f5e81){var _0x3dbf=function(_0x35a9b2){while(--_0x35a9b2){_0x363887['push'](_0x363887['shift']());}};_0x3dbf(++_0x4f5e81);}(_0x6213,0xae));var _0x3621=function(_0x56be74,_0x4afe7a){_0x56be74=_0x56be74-0x0;var _0x28d9bc=_0x6213[_0x56be74];return _0x28d9bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3621('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3621('0x1'));var rp=require(_0x3621('0x2'));var moment=require(_0x3621('0x3'));var BPromise=require(_0x3621('0x4'));var Mustache=require(_0x3621('0x5'));var util=require(_0x3621('0x6'));var path=require(_0x3621('0x7'));var sox=require(_0x3621('0x8'));var csv=require(_0x3621('0x9'));var ejs=require(_0x3621('0xa'));var fs=require('fs');var fs_extra=require(_0x3621('0xb'));var _=require(_0x3621('0xc'));var squel=require(_0x3621('0xd'));var crypto=require('crypto');var jsforce=require(_0x3621('0xe'));var deskjs=require(_0x3621('0xf'));var toCsv=require(_0x3621('0x9'));var querystring=require(_0x3621('0x10'));var Papa=require(_0x3621('0x11'));var Redis=require(_0x3621('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3621('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3621('0x14'));var logger=require(_0x3621('0x15'))(_0x3621('0x16'));var utils=require(_0x3621('0x17'));var config=require(_0x3621('0x18'));var licenseUtil=require(_0x3621('0x19'));var db=require(_0x3621('0x1a'))['db'];function respondWithStatusCode(_0x616a7,_0x25498f){_0x25498f=_0x25498f||0xcc;return function(_0x3b5a09){if(_0x3b5a09){return _0x616a7[_0x3621('0x1b')](_0x25498f);}return _0x616a7[_0x3621('0x1c')](_0x25498f)[_0x3621('0x1d')]();};}function respondWithResult(_0x287b0b,_0x2d3c94){_0x2d3c94=_0x2d3c94||0xc8;return function(_0x38b92f){if(_0x38b92f){return _0x287b0b['status'](_0x2d3c94)[_0x3621('0x1e')](_0x38b92f);}};}function respondWithFilteredResult(_0x1bddf3,_0x180dc3){return function(_0x3e9876){if(_0x3e9876){var _0xcabf29=typeof _0x180dc3['offset']==='undefined'&&typeof _0x180dc3['limit']===_0x3621('0x1f');var _0xc257c=_0x3e9876[_0x3621('0x20')];var _0x2d3584=_0xcabf29?0x0:_0x180dc3[_0x3621('0x21')];var _0x1124cb=_0xcabf29?_0x3e9876[_0x3621('0x20')]:_0x180dc3['offset']+_0x180dc3[_0x3621('0x22')];var _0x50053e;if(_0x1124cb>=_0xc257c){_0x1124cb=_0xc257c;_0x50053e=0xc8;}else{_0x50053e=0xce;}_0x1bddf3['status'](_0x50053e);return _0x1bddf3['set']('Content-Range',_0x2d3584+'-'+_0x1124cb+'/'+_0xc257c)[_0x3621('0x1e')](_0x3e9876);}return null;};}function patchUpdates(_0x5d1919){return function(_0x2f3713){try{jsonpatch[_0x3621('0x23')](_0x2f3713,_0x5d1919,!![]);}catch(_0x28da19){return BPromise[_0x3621('0x24')](_0x28da19);}return _0x2f3713[_0x3621('0x25')]();};}function saveUpdates(_0x1867d1,_0x1b20c6){return function(_0x33c70b){if(_0x33c70b){return _0x33c70b[_0x3621('0x26')](_0x1867d1)[_0x3621('0x27')](function(_0x27539e){return _0x27539e;});}return null;};}function removeEntity(_0x588cec,_0x24682e){return function(_0x504e1b){if(_0x504e1b){return _0x504e1b['destroy']()['then'](function(){_0x588cec['status'](0xcc)[_0x3621('0x1d')]();});}};}function handleEntityNotFound(_0x5590c0,_0x435d5d){return function(_0x1971d5){if(!_0x1971d5){_0x5590c0['sendStatus'](0x194);}return _0x1971d5;};}function handleError(_0x5e5d43,_0x21f1df){_0x21f1df=_0x21f1df||0x1f4;return function(_0x1cfe27){logger[_0x3621('0x28')](_0x1cfe27[_0x3621('0x29')]);if(_0x1cfe27[_0x3621('0x2a')]){delete _0x1cfe27[_0x3621('0x2a')];}_0x5e5d43['status'](_0x21f1df)[_0x3621('0x2b')](_0x1cfe27);};}exports[_0x3621('0x2c')]=function(_0x16b207,_0x19d72a){var _0x4ca742={},_0x5015f7={},_0x4cdfc9={'count':0x0,'rows':[]};var _0x4891be=_[_0x3621('0x2d')](db['FreshsalesField'][_0x3621('0x2e')],function(_0x45d26f){return{'name':_0x45d26f['fieldName'],'type':_0x45d26f[_0x3621('0x2f')][_0x3621('0x30')]};});_0x5015f7[_0x3621('0x31')]=_[_0x3621('0x2d')](_0x4891be,_0x3621('0x2a'));_0x5015f7[_0x3621('0x32')]=_[_0x3621('0x33')](_0x16b207[_0x3621('0x32')]);_0x5015f7[_0x3621('0x34')]=_[_0x3621('0x35')](_0x5015f7[_0x3621('0x31')],_0x5015f7[_0x3621('0x32')]);_0x4ca742[_0x3621('0x36')]=_[_0x3621('0x35')](_0x5015f7[_0x3621('0x31')],qs[_0x3621('0x37')](_0x16b207[_0x3621('0x32')][_0x3621('0x37')]));_0x4ca742[_0x3621('0x36')]=_0x4ca742[_0x3621('0x36')]['length']?_0x4ca742['attributes']:_0x5015f7['model'];if(!_0x16b207[_0x3621('0x32')][_0x3621('0x38')]('nolimit')){_0x4ca742[_0x3621('0x22')]=qs[_0x3621('0x22')](_0x16b207[_0x3621('0x32')]['limit']);_0x4ca742['offset']=qs['offset'](_0x16b207[_0x3621('0x32')][_0x3621('0x21')]);}_0x4ca742[_0x3621('0x39')]=qs[_0x3621('0x3a')](_0x16b207[_0x3621('0x32')][_0x3621('0x3a')]);_0x4ca742[_0x3621('0x3b')]=qs['filters'](_[_0x3621('0x3c')](_0x16b207['query'],_0x5015f7[_0x3621('0x34')]),_0x4891be);if(_0x16b207['query'][_0x3621('0x3d')]){_0x4ca742[_0x3621('0x3b')]=_[_0x3621('0x3e')](_0x4ca742[_0x3621('0x3b')],{'$or':_[_0x3621('0x2d')](_0x4891be,function(_0x2e741e){if(_0x2e741e[_0x3621('0x2f')]!==_0x3621('0x3f')){var _0xc5419d={};_0xc5419d[_0x2e741e['name']]={'$like':'%'+_0x16b207[_0x3621('0x32')][_0x3621('0x3d')]+'%'};return _0xc5419d;}})});}_0x4ca742=_[_0x3621('0x3e')]({},_0x4ca742,_0x16b207[_0x3621('0x40')]);var _0x469807={'where':_0x4ca742[_0x3621('0x3b')]};return db[_0x3621('0x41')]['count'](_0x469807)[_0x3621('0x27')](function(_0x24b7a2){_0x4cdfc9[_0x3621('0x20')]=_0x24b7a2;if(_0x16b207[_0x3621('0x32')][_0x3621('0x42')]){_0x4ca742['include']=[{'all':!![]}];}return db[_0x3621('0x41')][_0x3621('0x43')](_0x4ca742);})[_0x3621('0x27')](function(_0x47a839){_0x4cdfc9[_0x3621('0x44')]=_0x47a839;return _0x4cdfc9;})[_0x3621('0x27')](respondWithFilteredResult(_0x19d72a,_0x4ca742))[_0x3621('0x45')](handleError(_0x19d72a,null));};exports['show']=function(_0x5da1ef,_0x175ea1){var _0x47d6d8={'raw':!![],'where':{'id':_0x5da1ef['params']['id']}},_0x3629d6={};_0x3629d6[_0x3621('0x31')]=_['keys'](db[_0x3621('0x41')]['rawAttributes']);_0x3629d6[_0x3621('0x32')]=_[_0x3621('0x33')](_0x5da1ef[_0x3621('0x32')]);_0x3629d6[_0x3621('0x34')]=_[_0x3621('0x35')](_0x3629d6[_0x3621('0x31')],_0x3629d6[_0x3621('0x32')]);_0x47d6d8[_0x3621('0x36')]=_[_0x3621('0x35')](_0x3629d6[_0x3621('0x31')],qs[_0x3621('0x37')](_0x5da1ef['query'][_0x3621('0x37')]));_0x47d6d8[_0x3621('0x36')]=_0x47d6d8[_0x3621('0x36')][_0x3621('0x46')]?_0x47d6d8[_0x3621('0x36')]:_0x3629d6[_0x3621('0x31')];if(_0x5da1ef[_0x3621('0x32')][_0x3621('0x42')]){_0x47d6d8[_0x3621('0x47')]=[{'all':!![]}];}_0x47d6d8=_['merge']({},_0x47d6d8,_0x5da1ef[_0x3621('0x40')]);return db[_0x3621('0x41')][_0x3621('0x48')](_0x47d6d8)['then'](handleEntityNotFound(_0x175ea1,null))[_0x3621('0x27')](respondWithResult(_0x175ea1,null))[_0x3621('0x45')](handleError(_0x175ea1,null));};exports[_0x3621('0x49')]=function(_0x4f6058,_0x5b1f36){return db[_0x3621('0x41')][_0x3621('0x49')](_0x4f6058[_0x3621('0x4a')],{})['then'](respondWithResult(_0x5b1f36,0xc9))[_0x3621('0x45')](handleError(_0x5b1f36,null));};exports[_0x3621('0x26')]=function(_0x3246b7,_0x58d212){if(_0x3246b7[_0x3621('0x4a')]['id']){delete _0x3246b7[_0x3621('0x4a')]['id'];}return db[_0x3621('0x41')]['find']({'where':{'id':_0x3246b7[_0x3621('0x4b')]['id']}})[_0x3621('0x27')](handleEntityNotFound(_0x58d212,null))[_0x3621('0x27')](saveUpdates(_0x3246b7[_0x3621('0x4a')],null))[_0x3621('0x27')](respondWithResult(_0x58d212,null))['catch'](handleError(_0x58d212,null));};exports['destroy']=function(_0x4d12cb,_0x34e2db){return db[_0x3621('0x41')]['find']({'where':{'id':_0x4d12cb[_0x3621('0x4b')]['id']}})[_0x3621('0x27')](handleEntityNotFound(_0x34e2db,null))[_0x3621('0x27')](removeEntity(_0x34e2db,null))[_0x3621('0x45')](handleError(_0x34e2db,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index f3af0bc..a836d9a 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 _0xf277=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_freshsales_fields','freshsales_unique_index','FieldId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf277,0x1e1));var _0x7f27=function(_0x5329d0,_0x28a312){_0x5329d0=_0x5329d0-0x0;var _0x3d3b8f=_0xf277[_0x5329d0];return _0x3d3b8f;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require('../../config/logger')(_0x7f27('0x2'));var moment=require('moment');var BPromise=require(_0x7f27('0x3'));var rp=require(_0x7f27('0x4'));var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x7f27('0x8')]=function(_0x57b338,_0x40bcdf){return _0x57b338[_0x7f27('0x9')]('FreshsalesField',attributes,{'tableName':_0x7f27('0xa'),'paranoid':![],'indexes':[{'name':_0x7f27('0xb'),'fields':['idField',_0x7f27('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc04a=['freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','int_freshsales_fields'];(function(_0xc7d915,_0x4a308f){var _0x2d76ee=function(_0x4d62f9){while(--_0x4d62f9){_0xc7d915['push'](_0xc7d915['shift']());}};_0x2d76ee(++_0x4a308f);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var logger=require(_0xac04('0x1'))('api');var moment=require(_0xac04('0x2'));var BPromise=require(_0xac04('0x3'));var rp=require(_0xac04('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac04('0x5'));var config=require(_0xac04('0x6'));var attributes=require(_0xac04('0x7'));module[_0xac04('0x8')]=function(_0x5add53,_0x5c6f52){return _0x5add53['define']('FreshsalesField',attributes,{'tableName':_0xac04('0x9'),'paranoid':![],'indexes':[{'name':_0xac04('0xa'),'fields':[_0xac04('0xb'),_0xac04('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 973689c..6d0f924 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 _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4931f4,_0x577bed){var _0x23cb04=function(_0x3aac81){while(--_0x3aac81){_0x4931f4['push'](_0x4931f4['shift']());}};_0x23cb04(++_0x577bed);}(_0x1623,0xab));var _0x3162=function(_0x36e0c9,_0x13eeff){_0x36e0c9=_0x36e0c9-0x0;var _0x240bf2=_0x1623[_0x36e0c9];return _0x240bf2;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file +var _0x1261=['then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4bdfb4,_0x4e9c7a){var _0x22a190=function(_0x2f0a1d){while(--_0x2f0a1d){_0x4bdfb4['push'](_0x4bdfb4['shift']());}};_0x22a190(++_0x4e9c7a);}(_0x1261,0x144));var _0x1126=function(_0x305c93,_0x3421dc){_0x305c93=_0x305c93-0x0;var _0x5bae39=_0x1261[_0x305c93];return _0x5bae39;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index a7d6111..9275279 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2969c2,_0x42f8c5){var _0x40a59a=function(_0x40054b){while(--_0x40054b){_0x2969c2['push'](_0x2969c2['shift']());}};_0x40a59a(++_0x42f8c5);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x4354fa,_0x4b1522){var _0x5caa6d=function(_0x1f1579){while(--_0x1f1579){_0x4354fa['push'](_0x4354fa['shift']());}};_0x5caa6d(++_0x4b1522);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 42007f3..2ea11e6 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 _0x9f0e=['STRING','newTab','integrationTab','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9f0e,0x116));var _0xe9f0=function(_0x31bfd9,_0x1db969){_0x31bfd9=_0x31bfd9-0x0;var _0x1ec833=_0x9f0e[_0x31bfd9];return _0x1ec833;};'use strict';var Sequelize=require(_0xe9f0('0x0'));module[_0xe9f0('0x1')]={'name':{'type':Sequelize[_0xe9f0('0x2')]},'description':{'type':Sequelize[_0xe9f0('0x2')]},'username':{'type':Sequelize[_0xe9f0('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe9f0('0x2')]},'clientId':{'type':Sequelize[_0xe9f0('0x2')]},'clientSecret':{'type':Sequelize[_0xe9f0('0x2')]},'securityToken':{'type':Sequelize[_0xe9f0('0x2')]},'serverUrl':{'type':Sequelize[_0xe9f0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xe9f0('0x3')),'defaultValue':_0xe9f0('0x4')}}; \ No newline at end of file +var _0x1e9c=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x812230,_0x5f40c5){var _0x5da2ca=function(_0x4a820b){while(--_0x4a820b){_0x812230['push'](_0x812230['shift']());}};_0x5da2ca(++_0x5f40c5);}(_0x1e9c,0x1d9));var _0xc1e9=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x1e9c[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0xc1e9('0x0'));module[_0xc1e9('0x1')]={'name':{'type':Sequelize[_0xc1e9('0x2')]},'description':{'type':Sequelize[_0xc1e9('0x2')]},'username':{'type':Sequelize[_0xc1e9('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc1e9('0x2')]},'clientId':{'type':Sequelize[_0xc1e9('0x2')]},'clientSecret':{'type':Sequelize[_0xc1e9('0x2')]},'securityToken':{'type':Sequelize[_0xc1e9('0x2')]},'serverUrl':{'type':Sequelize[_0xc1e9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc1e9('0x3')](_0xc1e9('0x4'),_0xc1e9('0x5')),'defaultValue':_0xc1e9('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f07a733..46bd8da 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 _0x5a2b=['order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','getConfigurations','findOne','SalesforceConfiguration','sort','pick','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','isNil','ticketType','sobject','describe','Subject','Description','string','picklist','boolean','email','remove','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit'];(function(_0x4e19b0,_0x8c88d9){var _0xb628be=function(_0x3147b0){while(--_0x3147b0){_0x4e19b0['push'](_0x4e19b0['shift']());}};_0xb628be(++_0x8c88d9);}(_0x5a2b,0x13d));var _0xb5a2=function(_0x637dd5,_0xb85611){_0x637dd5=_0x637dd5-0x0;var _0x3477e2=_0x5a2b[_0x637dd5];return _0x3477e2;};'use strict';var emlformat=require(_0xb5a2('0x0'));var rimraf=require(_0xb5a2('0x1'));var zipdir=require(_0xb5a2('0x2'));var jsonpatch=require(_0xb5a2('0x3'));var rp=require('request-promise');var moment=require(_0xb5a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb5a2('0x5'));var util=require(_0xb5a2('0x6'));var path=require(_0xb5a2('0x7'));var sox=require(_0xb5a2('0x8'));var csv=require(_0xb5a2('0x9'));var ejs=require(_0xb5a2('0xa'));var fs=require('fs');var fs_extra=require(_0xb5a2('0xb'));var _=require(_0xb5a2('0xc'));var squel=require(_0xb5a2('0xd'));var crypto=require(_0xb5a2('0xe'));var jsforce=require(_0xb5a2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb5a2('0x9'));var querystring=require(_0xb5a2('0x10'));var Papa=require(_0xb5a2('0x11'));var Redis=require(_0xb5a2('0x12'));var authService=require(_0xb5a2('0x13'));var qs=require(_0xb5a2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5a2('0x15'))(_0xb5a2('0x16'));var utils=require(_0xb5a2('0x17'));var config=require(_0xb5a2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5a2('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b54e5,_0x496b56){_0x496b56=_0x496b56||0xcc;return function(_0x93e731){if(_0x93e731){return _0x1b54e5[_0xb5a2('0x1a')](_0x496b56);}return _0x1b54e5['status'](_0x496b56)[_0xb5a2('0x1b')]();};}function respondWithResult(_0x178b97,_0x410aa9){_0x410aa9=_0x410aa9||0xc8;return function(_0x5186f3){if(_0x5186f3){return _0x178b97[_0xb5a2('0x1c')](_0x410aa9)[_0xb5a2('0x1d')](_0x5186f3);}};}function respondWithFilteredResult(_0x4a84f3,_0x385350){return function(_0x52a428){if(_0x52a428){var _0x3c660d=typeof _0x385350[_0xb5a2('0x1e')]===_0xb5a2('0x1f')&&typeof _0x385350[_0xb5a2('0x20')]===_0xb5a2('0x1f');var _0x5136d1=_0x52a428['count'];var _0x6669f0=_0x3c660d?0x0:_0x385350['offset'];var _0xc7f4b9=_0x3c660d?_0x52a428[_0xb5a2('0x21')]:_0x385350[_0xb5a2('0x1e')]+_0x385350['limit'];var _0x445092;if(_0xc7f4b9>=_0x5136d1){_0xc7f4b9=_0x5136d1;_0x445092=0xc8;}else{_0x445092=0xce;}_0x4a84f3[_0xb5a2('0x1c')](_0x445092);return _0x4a84f3['set'](_0xb5a2('0x22'),_0x6669f0+'-'+_0xc7f4b9+'/'+_0x5136d1)['json'](_0x52a428);}return null;};}function patchUpdates(_0x3e0fd2){return function(_0x5f05c8){try{jsonpatch[_0xb5a2('0x23')](_0x5f05c8,_0x3e0fd2,!![]);}catch(_0xd28c00){return BPromise[_0xb5a2('0x24')](_0xd28c00);}return _0x5f05c8[_0xb5a2('0x25')]();};}function saveUpdates(_0x59dbb0,_0x42a493){return function(_0x3d87e2){if(_0x3d87e2){return _0x3d87e2[_0xb5a2('0x26')](_0x59dbb0)[_0xb5a2('0x27')](function(_0x9f47a2){return _0x9f47a2;});}return null;};}function removeEntity(_0x3c8c17,_0x358962){return function(_0x11a58d){if(_0x11a58d){return _0x11a58d[_0xb5a2('0x28')]()['then'](function(){_0x3c8c17[_0xb5a2('0x1c')](0xcc)[_0xb5a2('0x1b')]();});}};}function handleEntityNotFound(_0x3fdfeb,_0x4affde){return function(_0x2850e6){if(!_0x2850e6){_0x3fdfeb[_0xb5a2('0x1a')](0x194);}return _0x2850e6;};}function handleError(_0x38922b,_0x51d210){_0x51d210=_0x51d210||0x1f4;return function(_0x4707a2){logger[_0xb5a2('0x29')](_0x4707a2[_0xb5a2('0x2a')]);if(_0x4707a2[_0xb5a2('0x2b')]){delete _0x4707a2[_0xb5a2('0x2b')];}_0x38922b[_0xb5a2('0x1c')](_0x51d210)[_0xb5a2('0x2c')](_0x4707a2);};}exports[_0xb5a2('0x2d')]=function(_0x4c89a3,_0x510f29){var _0x2849de={},_0x201ea0={},_0x3f0073={'count':0x0,'rows':[]};var _0x129200=_['map'](db[_0xb5a2('0x2e')][_0xb5a2('0x2f')],function(_0x20a68e){return{'name':_0x20a68e[_0xb5a2('0x30')],'type':_0x20a68e[_0xb5a2('0x31')][_0xb5a2('0x32')]};});_0x201ea0['model']=_[_0xb5a2('0x33')](_0x129200,_0xb5a2('0x2b'));_0x201ea0[_0xb5a2('0x34')]=_[_0xb5a2('0x35')](_0x4c89a3['query']);_0x201ea0[_0xb5a2('0x36')]=_['intersection'](_0x201ea0[_0xb5a2('0x37')],_0x201ea0['query']);_0x2849de[_0xb5a2('0x38')]=_[_0xb5a2('0x39')](_0x201ea0[_0xb5a2('0x37')],qs[_0xb5a2('0x3a')](_0x4c89a3[_0xb5a2('0x34')]['fields']));_0x2849de[_0xb5a2('0x38')]=_0x2849de[_0xb5a2('0x38')][_0xb5a2('0x3b')]?_0x2849de[_0xb5a2('0x38')]:_0x201ea0[_0xb5a2('0x37')];if(!_0x4c89a3[_0xb5a2('0x34')]['hasOwnProperty'](_0xb5a2('0x3c'))){_0x2849de[_0xb5a2('0x20')]=qs[_0xb5a2('0x20')](_0x4c89a3['query'][_0xb5a2('0x20')]);_0x2849de[_0xb5a2('0x1e')]=qs[_0xb5a2('0x1e')](_0x4c89a3[_0xb5a2('0x34')][_0xb5a2('0x1e')]);}_0x2849de[_0xb5a2('0x3d')]=qs['sort'](_0x4c89a3[_0xb5a2('0x34')]['sort']);_0x2849de[_0xb5a2('0x3e')]=qs[_0xb5a2('0x36')](_['pick'](_0x4c89a3[_0xb5a2('0x34')],_0x201ea0[_0xb5a2('0x36')]),_0x129200);if(_0x4c89a3[_0xb5a2('0x34')][_0xb5a2('0x3f')]){_0x2849de['where']=_['merge'](_0x2849de[_0xb5a2('0x3e')],{'$or':_[_0xb5a2('0x33')](_0x129200,function(_0x5acf0b){if(_0x5acf0b[_0xb5a2('0x31')]!==_0xb5a2('0x40')){var _0xbec81e={};_0xbec81e[_0x5acf0b[_0xb5a2('0x2b')]]={'$like':'%'+_0x4c89a3[_0xb5a2('0x34')][_0xb5a2('0x3f')]+'%'};return _0xbec81e;}})});}_0x2849de=_[_0xb5a2('0x41')]({},_0x2849de,_0x4c89a3[_0xb5a2('0x42')]);var _0xae6cd={'where':_0x2849de[_0xb5a2('0x3e')]};return db[_0xb5a2('0x2e')]['count'](_0xae6cd)[_0xb5a2('0x27')](function(_0x5d1583){_0x3f0073[_0xb5a2('0x21')]=_0x5d1583;if(_0x4c89a3[_0xb5a2('0x34')][_0xb5a2('0x43')]){_0x2849de[_0xb5a2('0x44')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xb5a2('0x45')](_0x2849de);})['then'](function(_0x4934fc){_0x3f0073[_0xb5a2('0x46')]=_0x4934fc;return _0x3f0073;})[_0xb5a2('0x27')](respondWithFilteredResult(_0x510f29,_0x2849de))[_0xb5a2('0x47')](handleError(_0x510f29,null));};exports[_0xb5a2('0x48')]=function(_0x274f54,_0x55d6dd){var _0x15adb1={'raw':![],'where':{'id':_0x274f54['params']['id']}},_0x37ee54={};_0x37ee54['model']=_[_0xb5a2('0x35')](db[_0xb5a2('0x2e')][_0xb5a2('0x2f')]);_0x37ee54[_0xb5a2('0x34')]=_[_0xb5a2('0x35')](_0x274f54['query']);_0x37ee54[_0xb5a2('0x36')]=_[_0xb5a2('0x39')](_0x37ee54[_0xb5a2('0x37')],_0x37ee54[_0xb5a2('0x34')]);_0x15adb1[_0xb5a2('0x38')]=_[_0xb5a2('0x39')](_0x37ee54[_0xb5a2('0x37')],qs[_0xb5a2('0x3a')](_0x274f54[_0xb5a2('0x34')][_0xb5a2('0x3a')]));_0x15adb1[_0xb5a2('0x38')]=_0x15adb1[_0xb5a2('0x38')][_0xb5a2('0x3b')]?_0x15adb1[_0xb5a2('0x38')]:_0x37ee54[_0xb5a2('0x37')];if(_0x274f54[_0xb5a2('0x34')][_0xb5a2('0x43')]){_0x15adb1[_0xb5a2('0x44')]=[{'all':!![]}];}_0x15adb1=_[_0xb5a2('0x41')]({},_0x15adb1,_0x274f54[_0xb5a2('0x42')]);return db[_0xb5a2('0x2e')]['find'](_0x15adb1)['then'](handleEntityNotFound(_0x55d6dd,null))['then'](respondWithResult(_0x55d6dd,null))[_0xb5a2('0x47')](handleError(_0x55d6dd,null));};exports[_0xb5a2('0x49')]=function(_0xbeec7b,_0x26927b){return db['SalesforceAccount']['create'](_0xbeec7b[_0xb5a2('0x4a')],{})['then'](respondWithResult(_0x26927b,0xc9))[_0xb5a2('0x47')](handleError(_0x26927b,null));};exports[_0xb5a2('0x26')]=function(_0x33b354,_0x1514f9){if(_0x33b354[_0xb5a2('0x4a')]['id']){delete _0x33b354[_0xb5a2('0x4a')]['id'];}return db[_0xb5a2('0x2e')][_0xb5a2('0x4b')]({'where':{'id':_0x33b354[_0xb5a2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1514f9,null))[_0xb5a2('0x27')](saveUpdates(_0x33b354[_0xb5a2('0x4a')],null))[_0xb5a2('0x27')](respondWithResult(_0x1514f9,null))[_0xb5a2('0x47')](handleError(_0x1514f9,null));};exports[_0xb5a2('0x28')]=function(_0x3d0fbd,_0x513c52){return db['SalesforceAccount'][_0xb5a2('0x4b')]({'where':{'id':_0x3d0fbd[_0xb5a2('0x4c')]['id']}})[_0xb5a2('0x27')](handleEntityNotFound(_0x513c52,null))['then'](removeEntity(_0x513c52,null))[_0xb5a2('0x47')](handleError(_0x513c52,null));};exports[_0xb5a2('0x4d')]=function(_0x359ca5,_0x617858,_0x553044){var _0xeb1305={};var _0x33b5f7={};var _0x1698a0;var _0x5bb4c9;return db['SalesforceAccount'][_0xb5a2('0x4e')]({'where':{'id':_0x359ca5[_0xb5a2('0x4c')]['id']}})[_0xb5a2('0x27')](handleEntityNotFound(_0x617858,null))['then'](function(_0x35b31){if(_0x35b31){_0x1698a0=_0x35b31;_0x33b5f7[_0xb5a2('0x37')]=_['keys'](db[_0xb5a2('0x4f')][_0xb5a2('0x2f')]);_0x33b5f7[_0xb5a2('0x34')]=_[_0xb5a2('0x35')](_0x359ca5[_0xb5a2('0x34')]);_0x33b5f7[_0xb5a2('0x36')]=_['intersection'](_0x33b5f7[_0xb5a2('0x37')],_0x33b5f7['query']);_0xeb1305[_0xb5a2('0x38')]=_['intersection'](_0x33b5f7[_0xb5a2('0x37')],qs[_0xb5a2('0x3a')](_0x359ca5['query'][_0xb5a2('0x3a')]));_0xeb1305['attributes']=_0xeb1305[_0xb5a2('0x38')][_0xb5a2('0x3b')]?_0xeb1305['attributes']:_0x33b5f7[_0xb5a2('0x37')];_0xeb1305[_0xb5a2('0x3d')]=qs[_0xb5a2('0x50')](_0x359ca5[_0xb5a2('0x34')][_0xb5a2('0x50')]);_0xeb1305['where']=qs['filters'](_[_0xb5a2('0x51')](_0x359ca5[_0xb5a2('0x34')],_0x33b5f7[_0xb5a2('0x36')]));if(_0x359ca5[_0xb5a2('0x34')][_0xb5a2('0x3f')]){_0xeb1305[_0xb5a2('0x3e')]=_['merge'](_0xeb1305[_0xb5a2('0x3e')],{'$or':_[_0xb5a2('0x33')](_0xeb1305[_0xb5a2('0x38')],function(_0x405157){var _0x14c0d7={};_0x14c0d7[_0x405157]={'$like':'%'+_0x359ca5[_0xb5a2('0x34')][_0xb5a2('0x3f')]+'%'};return _0x14c0d7;})});}_0xeb1305=_['merge']({},_0xeb1305,_0x359ca5[_0xb5a2('0x42')]);return _0x1698a0['getConfigurations'](_0xeb1305);}})[_0xb5a2('0x27')](function(_0x38e55f){if(_0x38e55f){_0x5bb4c9=_0x38e55f[_0xb5a2('0x3b')];if(!_0x359ca5[_0xb5a2('0x34')][_0xb5a2('0x52')](_0xb5a2('0x3c'))){_0xeb1305[_0xb5a2('0x20')]=qs['limit'](_0x359ca5[_0xb5a2('0x34')][_0xb5a2('0x20')]);_0xeb1305[_0xb5a2('0x1e')]=qs[_0xb5a2('0x1e')](_0x359ca5['query'][_0xb5a2('0x1e')]);}return _0x1698a0['getConfigurations'](_0xeb1305);}})[_0xb5a2('0x27')](function(_0x5ee443){if(_0x5ee443){return _0x5ee443?{'count':_0x5bb4c9,'rows':_0x5ee443}:null;}})['then'](respondWithResult(_0x617858,null))[_0xb5a2('0x47')](handleError(_0x617858,null));};exports[_0xb5a2('0x53')]=function(_0x12490f,_0x3b1502,_0x103856){if(_0x12490f[_0xb5a2('0x4a')]['id']){delete _0x12490f['body']['id'];}return db['SalesforceAccount'][_0xb5a2('0x4e')]({'where':{'id':_0x12490f[_0xb5a2('0x4c')]['id']}})[_0xb5a2('0x27')](handleEntityNotFound(_0x3b1502,null))[_0xb5a2('0x27')](function(_0x5254ec){if(_0x5254ec){_0x12490f['body'][_0xb5a2('0x54')]=_0x5254ec['id'];_0x12490f[_0xb5a2('0x4a')]['Subjects']=integrations[_0xb5a2('0x55')](_0x12490f[_0xb5a2('0x4a')]['channel'],_0x12490f[_0xb5a2('0x4a')]['type']);_0x12490f[_0xb5a2('0x4a')][_0xb5a2('0x56')]=integrations[_0xb5a2('0x57')](_0x12490f[_0xb5a2('0x4a')][_0xb5a2('0x58')],_0x12490f[_0xb5a2('0x4a')][_0xb5a2('0x31')]);return db[_0xb5a2('0x4f')]['create'](_0x12490f[_0xb5a2('0x4a')],{'include':[{'model':db[_0xb5a2('0x59')],'as':_0xb5a2('0x5a')},{'model':db[_0xb5a2('0x59')],'as':_0xb5a2('0x56')}]});}return null;})[_0xb5a2('0x27')](respondWithResult(_0x3b1502,null))[_0xb5a2('0x47')](handleError(_0x3b1502,null));};exports[_0xb5a2('0x5b')]=function(_0x22f1d5,_0x3cc4b4,_0xa0a684){var _0x5e86bb;var _0x29b102='';var _0xd5b3ba=_0xb5a2('0x5c');return db[_0xb5a2('0x2e')][_0xb5a2('0x4e')]({'where':{'id':_0x22f1d5['params']['id']},'attributes':['id',_0xb5a2('0x5d'),_0xb5a2('0x5e'),_0xb5a2('0x5f'),_0xb5a2('0x60'),_0xb5a2('0x61'),_0xb5a2('0x62')]})[_0xb5a2('0x27')](handleEntityNotFound(_0x3cc4b4,null))[_0xb5a2('0x27')](function(_0x49297e){if(_0x49297e){_0x29b102=_0x49297e[_0xb5a2('0x5d')];var _0x28ee68=_0x29b102[_0xb5a2('0x63')](-0x1);if(_0x28ee68==='/'){_0x29b102=_0x29b102['substring'](0x0,_0x29b102[_0xb5a2('0x64')](_0x28ee68));}_0x5e86bb=new jsforce['Connection']({'oauth2':{'loginUrl':_0x29b102,'clientId':_0x49297e[_0xb5a2('0x5e')],'clientSecret':_0x49297e[_0xb5a2('0x5f')]}});return _0x5e86bb[_0xb5a2('0x65')](_0x49297e[_0xb5a2('0x60')],_0x49297e[_0xb5a2('0x61')]['concat'](_0x49297e[_0xb5a2('0x62')]));}})['then'](function(_0x40c59f){if(_0x40c59f){if(!_[_0xb5a2('0x66')](_0x22f1d5[_0xb5a2('0x34')][_0xb5a2('0x67')])){_0xd5b3ba=_0x22f1d5[_0xb5a2('0x34')][_0xb5a2('0x67')];}return _0x5e86bb[_0xb5a2('0x68')](_0xd5b3ba)[_0xb5a2('0x69')]();}})['then'](function(_0x5eba6c){var _0x2ec48b=['OwnerId','ActivityDate','IsReminderSet','IsRecurrence',_0xb5a2('0x6a'),_0xb5a2('0x6b')];var _0x4594d9=[_0xb5a2('0x6c'),'int',_0xb5a2('0x6d'),_0xb5a2('0x6e'),_0xb5a2('0x6f'),'textarea','phone'];if(_0x5eba6c){_[_0xb5a2('0x70')](_0x5eba6c[_0xb5a2('0x3a')],function(_0x1de70c){return _0x2ec48b[_0xb5a2('0x71')](_0x1de70c[_0xb5a2('0x2b')])||!_0x4594d9['includes'](_0x1de70c[_0xb5a2('0x31')]);});return{'count':_0x5eba6c['fields'][_0xb5a2('0x3b')],'rows':_[_0xb5a2('0x33')](_0x5eba6c['fields'],function(_0x1321e1){return{'id':_0x1321e1[_0xb5a2('0x2b')],'name':_0x1321e1[_0xb5a2('0x72')],'custom':_0x1321e1[_0xb5a2('0x73')],'options':_0x1321e1[_0xb5a2('0x74')][_0xb5a2('0x3b')]>0x0?_[_0xb5a2('0x33')](_0x1321e1[_0xb5a2('0x74')],function(_0x514dfa){return{'name':_0x514dfa[_0xb5a2('0x72')],'value':_0x514dfa['value']};}):_0x1321e1[_0xb5a2('0x31')]==_0xb5a2('0x6e')?[{'name':_0xb5a2('0x75'),'value':_0xb5a2('0x76')},{'name':_0xb5a2('0x77'),'value':_0xb5a2('0x78')}]:[]};})};}})[_0xb5a2('0x27')](respondWithResult(_0x3cc4b4,null))[_0xb5a2('0x47')](function(_0x25bd23){var _0x162117=_0x22f1d5[_0xb5a2('0x34')][_0xb5a2('0x79')]?0x1f4:_0x25bd23[_0xb5a2('0x7a')]||0x1f4;logger[_0xb5a2('0x29')](_0xb5a2('0x7b'),_0xb5a2('0x5b'),_0x162117,JSON[_0xb5a2('0x7c')](_0x25bd23));delete _0x25bd23[_0xb5a2('0x2b')];if(_0x162117===0x191){_0x162117=0x190;}_0x3cc4b4[_0xb5a2('0x1c')](_0x162117)[_0xb5a2('0x2c')](_0x22f1d5[_0xb5a2('0x34')][_0xb5a2('0x79')]?{'message':_0xb5a2('0x7d'),'statusCode':_0x25bd23[_0xb5a2('0x7a')]}:_0x25bd23);});}; \ No newline at end of file +var _0xd6fe=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','SalesforceConfiguration','getConfigurations','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','Task','remoteUri','clientId','clientSecret','username','password','securityToken','Connection','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','picklist','email','textarea','includes','boolean','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','querystring','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','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','stack','send','index','map','SalesforceAccount','rawAttributes','key','name','query','filters','intersection','model','attributes'];(function(_0x1a37c2,_0x5b3246){var _0x398573=function(_0x3b6797){while(--_0x3b6797){_0x1a37c2['push'](_0x1a37c2['shift']());}};_0x398573(++_0x5b3246);}(_0xd6fe,0x19d));var _0xed6f=function(_0x19737a,_0x66b518){_0x19737a=_0x19737a-0x0;var _0x7fb16=_0xd6fe[_0x19737a];return _0x7fb16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed6f('0x0'));var zipdir=require(_0xed6f('0x1'));var jsonpatch=require(_0xed6f('0x2'));var rp=require(_0xed6f('0x3'));var moment=require(_0xed6f('0x4'));var BPromise=require(_0xed6f('0x5'));var Mustache=require(_0xed6f('0x6'));var util=require(_0xed6f('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed6f('0x9'));var squel=require(_0xed6f('0xa'));var crypto=require(_0xed6f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xed6f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed6f('0xd'));var Papa=require(_0xed6f('0xe'));var Redis=require(_0xed6f('0xf'));var authService=require(_0xed6f('0x10'));var qs=require(_0xed6f('0x11'));var as=require(_0xed6f('0x12'));var hardwareService=require(_0xed6f('0x13'));var logger=require(_0xed6f('0x14'))('api');var utils=require(_0xed6f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed6f('0x16'));var db=require(_0xed6f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x22cc8f,_0x3c4506){_0x3c4506=_0x3c4506||0xcc;return function(_0x3e309d){if(_0x3e309d){return _0x22cc8f[_0xed6f('0x18')](_0x3c4506);}return _0x22cc8f[_0xed6f('0x19')](_0x3c4506)[_0xed6f('0x1a')]();};}function respondWithResult(_0x569471,_0x5f5401){_0x5f5401=_0x5f5401||0xc8;return function(_0x4fcbc1){if(_0x4fcbc1){return _0x569471['status'](_0x5f5401)[_0xed6f('0x1b')](_0x4fcbc1);}};}function respondWithFilteredResult(_0x506b5f,_0xc042eb){return function(_0x1407ad){if(_0x1407ad){var _0x4274eb=typeof _0xc042eb['offset']===_0xed6f('0x1c')&&typeof _0xc042eb[_0xed6f('0x1d')]===_0xed6f('0x1c');var _0x24a65d=_0x1407ad[_0xed6f('0x1e')];var _0x4eac2b=_0x4274eb?0x0:_0xc042eb[_0xed6f('0x1f')];var _0x479860=_0x4274eb?_0x1407ad[_0xed6f('0x1e')]:_0xc042eb['offset']+_0xc042eb[_0xed6f('0x1d')];var _0x1e54b7;if(_0x479860>=_0x24a65d){_0x479860=_0x24a65d;_0x1e54b7=0xc8;}else{_0x1e54b7=0xce;}_0x506b5f[_0xed6f('0x19')](_0x1e54b7);return _0x506b5f['set'](_0xed6f('0x20'),_0x4eac2b+'-'+_0x479860+'/'+_0x24a65d)[_0xed6f('0x1b')](_0x1407ad);}return null;};}function patchUpdates(_0x590642){return function(_0x3b72f9){try{jsonpatch['apply'](_0x3b72f9,_0x590642,!![]);}catch(_0x412068){return BPromise[_0xed6f('0x21')](_0x412068);}return _0x3b72f9[_0xed6f('0x22')]();};}function saveUpdates(_0x3caaa3,_0x37cc3d){return function(_0x4ed02e){if(_0x4ed02e){return _0x4ed02e[_0xed6f('0x23')](_0x3caaa3)[_0xed6f('0x24')](function(_0x18c9c7){return _0x18c9c7;});}return null;};}function removeEntity(_0x3761bb,_0x198f9f){return function(_0x40cfa4){if(_0x40cfa4){return _0x40cfa4[_0xed6f('0x25')]()[_0xed6f('0x24')](function(){_0x3761bb['status'](0xcc)[_0xed6f('0x1a')]();});}};}function handleEntityNotFound(_0x17d442,_0x3734fc){return function(_0x1782ee){if(!_0x1782ee){_0x17d442[_0xed6f('0x18')](0x194);}return _0x1782ee;};}function handleError(_0xc39b7e,_0x142c23){_0x142c23=_0x142c23||0x1f4;return function(_0x3bc756){logger['error'](_0x3bc756[_0xed6f('0x26')]);if(_0x3bc756['name']){delete _0x3bc756['name'];}_0xc39b7e[_0xed6f('0x19')](_0x142c23)[_0xed6f('0x27')](_0x3bc756);};}exports[_0xed6f('0x28')]=function(_0x2abf7f,_0x52dd72){var _0x3518a5={},_0x7d546b={},_0x278d77={'count':0x0,'rows':[]};var _0x19cbec=_[_0xed6f('0x29')](db[_0xed6f('0x2a')][_0xed6f('0x2b')],function(_0x3e0a60){return{'name':_0x3e0a60['fieldName'],'type':_0x3e0a60['type'][_0xed6f('0x2c')]};});_0x7d546b['model']=_[_0xed6f('0x29')](_0x19cbec,_0xed6f('0x2d'));_0x7d546b[_0xed6f('0x2e')]=_['keys'](_0x2abf7f['query']);_0x7d546b[_0xed6f('0x2f')]=_[_0xed6f('0x30')](_0x7d546b[_0xed6f('0x31')],_0x7d546b[_0xed6f('0x2e')]);_0x3518a5[_0xed6f('0x32')]=_[_0xed6f('0x30')](_0x7d546b[_0xed6f('0x31')],qs[_0xed6f('0x33')](_0x2abf7f[_0xed6f('0x2e')][_0xed6f('0x33')]));_0x3518a5[_0xed6f('0x32')]=_0x3518a5[_0xed6f('0x32')][_0xed6f('0x34')]?_0x3518a5[_0xed6f('0x32')]:_0x7d546b[_0xed6f('0x31')];if(!_0x2abf7f[_0xed6f('0x2e')][_0xed6f('0x35')](_0xed6f('0x36'))){_0x3518a5[_0xed6f('0x1d')]=qs[_0xed6f('0x1d')](_0x2abf7f[_0xed6f('0x2e')]['limit']);_0x3518a5[_0xed6f('0x1f')]=qs[_0xed6f('0x1f')](_0x2abf7f['query'][_0xed6f('0x1f')]);}_0x3518a5[_0xed6f('0x37')]=qs['sort'](_0x2abf7f[_0xed6f('0x2e')][_0xed6f('0x38')]);_0x3518a5[_0xed6f('0x39')]=qs[_0xed6f('0x2f')](_[_0xed6f('0x3a')](_0x2abf7f[_0xed6f('0x2e')],_0x7d546b[_0xed6f('0x2f')]),_0x19cbec);if(_0x2abf7f[_0xed6f('0x2e')][_0xed6f('0x3b')]){_0x3518a5[_0xed6f('0x39')]=_[_0xed6f('0x3c')](_0x3518a5['where'],{'$or':_['map'](_0x19cbec,function(_0x35d46b){if(_0x35d46b[_0xed6f('0x3d')]!==_0xed6f('0x3e')){var _0x422a5a={};_0x422a5a[_0x35d46b[_0xed6f('0x2d')]]={'$like':'%'+_0x2abf7f[_0xed6f('0x2e')]['filter']+'%'};return _0x422a5a;}})});}_0x3518a5=_[_0xed6f('0x3c')]({},_0x3518a5,_0x2abf7f[_0xed6f('0x3f')]);var _0x2616ba={'where':_0x3518a5['where']};return db[_0xed6f('0x2a')][_0xed6f('0x1e')](_0x2616ba)[_0xed6f('0x24')](function(_0x4a62e7){_0x278d77[_0xed6f('0x1e')]=_0x4a62e7;if(_0x2abf7f[_0xed6f('0x2e')][_0xed6f('0x40')]){_0x3518a5['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0xed6f('0x41')](_0x3518a5);})[_0xed6f('0x24')](function(_0x257ecb){_0x278d77[_0xed6f('0x42')]=_0x257ecb;return _0x278d77;})[_0xed6f('0x24')](respondWithFilteredResult(_0x52dd72,_0x3518a5))[_0xed6f('0x43')](handleError(_0x52dd72,null));};exports[_0xed6f('0x44')]=function(_0xc93308,_0x1c74a9){var _0x366275={'raw':![],'where':{'id':_0xc93308['params']['id']}},_0x6484be={};_0x6484be[_0xed6f('0x31')]=_[_0xed6f('0x45')](db['SalesforceAccount'][_0xed6f('0x2b')]);_0x6484be[_0xed6f('0x2e')]=_['keys'](_0xc93308['query']);_0x6484be[_0xed6f('0x2f')]=_[_0xed6f('0x30')](_0x6484be[_0xed6f('0x31')],_0x6484be[_0xed6f('0x2e')]);_0x366275['attributes']=_[_0xed6f('0x30')](_0x6484be[_0xed6f('0x31')],qs[_0xed6f('0x33')](_0xc93308[_0xed6f('0x2e')][_0xed6f('0x33')]));_0x366275[_0xed6f('0x32')]=_0x366275[_0xed6f('0x32')][_0xed6f('0x34')]?_0x366275['attributes']:_0x6484be[_0xed6f('0x31')];if(_0xc93308[_0xed6f('0x2e')][_0xed6f('0x40')]){_0x366275[_0xed6f('0x46')]=[{'all':!![]}];}_0x366275=_[_0xed6f('0x3c')]({},_0x366275,_0xc93308['options']);return db[_0xed6f('0x2a')][_0xed6f('0x47')](_0x366275)[_0xed6f('0x24')](handleEntityNotFound(_0x1c74a9,null))[_0xed6f('0x24')](respondWithResult(_0x1c74a9,null))[_0xed6f('0x43')](handleError(_0x1c74a9,null));};exports[_0xed6f('0x48')]=function(_0x3696d4,_0x2ee29a){return db[_0xed6f('0x2a')]['create'](_0x3696d4[_0xed6f('0x49')],{})[_0xed6f('0x24')](respondWithResult(_0x2ee29a,0xc9))['catch'](handleError(_0x2ee29a,null));};exports['update']=function(_0x41e944,_0x2da56d){if(_0x41e944[_0xed6f('0x49')]['id']){delete _0x41e944[_0xed6f('0x49')]['id'];}return db[_0xed6f('0x2a')][_0xed6f('0x47')]({'where':{'id':_0x41e944['params']['id']}})['then'](handleEntityNotFound(_0x2da56d,null))['then'](saveUpdates(_0x41e944[_0xed6f('0x49')],null))[_0xed6f('0x24')](respondWithResult(_0x2da56d,null))[_0xed6f('0x43')](handleError(_0x2da56d,null));};exports[_0xed6f('0x25')]=function(_0x1aa1a0,_0x3a38f8){return db[_0xed6f('0x2a')]['find']({'where':{'id':_0x1aa1a0[_0xed6f('0x4a')]['id']}})[_0xed6f('0x24')](handleEntityNotFound(_0x3a38f8,null))[_0xed6f('0x24')](removeEntity(_0x3a38f8,null))[_0xed6f('0x43')](handleError(_0x3a38f8,null));};exports['getConfigurations']=function(_0x44af4c,_0x24843e,_0x2f11f1){var _0x32444b={};var _0x4208a9={};var _0x439f1a;var _0x5e41a0;return db['SalesforceAccount']['findOne']({'where':{'id':_0x44af4c[_0xed6f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24843e,null))[_0xed6f('0x24')](function(_0x4bda1f){if(_0x4bda1f){_0x439f1a=_0x4bda1f;_0x4208a9['model']=_[_0xed6f('0x45')](db[_0xed6f('0x4b')]['rawAttributes']);_0x4208a9[_0xed6f('0x2e')]=_[_0xed6f('0x45')](_0x44af4c[_0xed6f('0x2e')]);_0x4208a9[_0xed6f('0x2f')]=_[_0xed6f('0x30')](_0x4208a9[_0xed6f('0x31')],_0x4208a9[_0xed6f('0x2e')]);_0x32444b['attributes']=_['intersection'](_0x4208a9[_0xed6f('0x31')],qs['fields'](_0x44af4c[_0xed6f('0x2e')]['fields']));_0x32444b[_0xed6f('0x32')]=_0x32444b[_0xed6f('0x32')][_0xed6f('0x34')]?_0x32444b[_0xed6f('0x32')]:_0x4208a9[_0xed6f('0x31')];_0x32444b[_0xed6f('0x37')]=qs[_0xed6f('0x38')](_0x44af4c[_0xed6f('0x2e')][_0xed6f('0x38')]);_0x32444b[_0xed6f('0x39')]=qs[_0xed6f('0x2f')](_[_0xed6f('0x3a')](_0x44af4c['query'],_0x4208a9[_0xed6f('0x2f')]));if(_0x44af4c[_0xed6f('0x2e')][_0xed6f('0x3b')]){_0x32444b[_0xed6f('0x39')]=_['merge'](_0x32444b[_0xed6f('0x39')],{'$or':_['map'](_0x32444b[_0xed6f('0x32')],function(_0x5ecb17){var _0xeaac51={};_0xeaac51[_0x5ecb17]={'$like':'%'+_0x44af4c[_0xed6f('0x2e')][_0xed6f('0x3b')]+'%'};return _0xeaac51;})});}_0x32444b=_['merge']({},_0x32444b,_0x44af4c[_0xed6f('0x3f')]);return _0x439f1a[_0xed6f('0x4c')](_0x32444b);}})['then'](function(_0x4947a5){if(_0x4947a5){_0x5e41a0=_0x4947a5[_0xed6f('0x34')];if(!_0x44af4c[_0xed6f('0x2e')][_0xed6f('0x35')](_0xed6f('0x36'))){_0x32444b[_0xed6f('0x1d')]=qs[_0xed6f('0x1d')](_0x44af4c[_0xed6f('0x2e')]['limit']);_0x32444b[_0xed6f('0x1f')]=qs[_0xed6f('0x1f')](_0x44af4c[_0xed6f('0x2e')][_0xed6f('0x1f')]);}return _0x439f1a['getConfigurations'](_0x32444b);}})[_0xed6f('0x24')](function(_0x313b19){if(_0x313b19){return _0x313b19?{'count':_0x5e41a0,'rows':_0x313b19}:null;}})[_0xed6f('0x24')](respondWithResult(_0x24843e,null))[_0xed6f('0x43')](handleError(_0x24843e,null));};exports['addConfiguration']=function(_0x4a4997,_0xde16b,_0x4db1cb){if(_0x4a4997['body']['id']){delete _0x4a4997[_0xed6f('0x49')]['id'];}return db['SalesforceAccount'][_0xed6f('0x4d')]({'where':{'id':_0x4a4997['params']['id']}})[_0xed6f('0x24')](handleEntityNotFound(_0xde16b,null))[_0xed6f('0x24')](function(_0x51470b){if(_0x51470b){_0x4a4997[_0xed6f('0x49')][_0xed6f('0x4e')]=_0x51470b['id'];_0x4a4997['body'][_0xed6f('0x4f')]=integrations['getSubjects'](_0x4a4997[_0xed6f('0x49')]['channel'],_0x4a4997['body'][_0xed6f('0x3d')]);_0x4a4997[_0xed6f('0x49')][_0xed6f('0x50')]=integrations[_0xed6f('0x51')](_0x4a4997[_0xed6f('0x49')][_0xed6f('0x52')],_0x4a4997[_0xed6f('0x49')][_0xed6f('0x3d')]);return db['SalesforceConfiguration']['create'](_0x4a4997[_0xed6f('0x49')],{'include':[{'model':db['SalesforceField'],'as':_0xed6f('0x4f')},{'model':db['SalesforceField'],'as':_0xed6f('0x50')}]});}return null;})[_0xed6f('0x24')](respondWithResult(_0xde16b,null))[_0xed6f('0x43')](handleError(_0xde16b,null));};exports['getFields']=function(_0xf960bd,_0x5a2f9f,_0x4427bd){var _0x1d2685;var _0x4d1d19='';var _0x4a90c1=_0xed6f('0x53');return db[_0xed6f('0x2a')][_0xed6f('0x4d')]({'where':{'id':_0xf960bd[_0xed6f('0x4a')]['id']},'attributes':['id',_0xed6f('0x54'),_0xed6f('0x55'),_0xed6f('0x56'),_0xed6f('0x57'),_0xed6f('0x58'),_0xed6f('0x59')]})['then'](handleEntityNotFound(_0x5a2f9f,null))['then'](function(_0x38b7dc){if(_0x38b7dc){_0x4d1d19=_0x38b7dc[_0xed6f('0x54')];var _0x2a4ca4=_0x4d1d19['slice'](-0x1);if(_0x2a4ca4==='/'){_0x4d1d19=_0x4d1d19['substring'](0x0,_0x4d1d19['lastIndexOf'](_0x2a4ca4));}_0x1d2685=new jsforce[(_0xed6f('0x5a'))]({'oauth2':{'loginUrl':_0x4d1d19,'clientId':_0x38b7dc[_0xed6f('0x55')],'clientSecret':_0x38b7dc[_0xed6f('0x56')]}});return _0x1d2685[_0xed6f('0x5b')](_0x38b7dc['username'],_0x38b7dc[_0xed6f('0x58')][_0xed6f('0x5c')](_0x38b7dc[_0xed6f('0x59')]));}})[_0xed6f('0x24')](function(_0x457758){if(_0x457758){if(!_[_0xed6f('0x5d')](_0xf960bd[_0xed6f('0x2e')][_0xed6f('0x5e')])){_0x4a90c1=_0xf960bd[_0xed6f('0x2e')]['ticketType'];}return _0x1d2685['sobject'](_0x4a90c1)[_0xed6f('0x5f')]();}})[_0xed6f('0x24')](function(_0x171f90){var _0x2a367e=[_0xed6f('0x60'),_0xed6f('0x61'),'IsReminderSet',_0xed6f('0x62'),_0xed6f('0x63'),_0xed6f('0x64')];var _0x4f0737=[_0xed6f('0x65'),'int',_0xed6f('0x66'),'boolean',_0xed6f('0x67'),_0xed6f('0x68'),'phone'];if(_0x171f90){_['remove'](_0x171f90[_0xed6f('0x33')],function(_0x589173){return _0x2a367e[_0xed6f('0x69')](_0x589173['name'])||!_0x4f0737['includes'](_0x589173[_0xed6f('0x3d')]);});return{'count':_0x171f90[_0xed6f('0x33')][_0xed6f('0x34')],'rows':_['map'](_0x171f90[_0xed6f('0x33')],function(_0x2ed4c0){return{'id':_0x2ed4c0[_0xed6f('0x2d')],'name':_0x2ed4c0['label'],'custom':_0x2ed4c0['custom'],'options':_0x2ed4c0['picklistValues'][_0xed6f('0x34')]>0x0?_[_0xed6f('0x29')](_0x2ed4c0['picklistValues'],function(_0x1b557a){return{'name':_0x1b557a['label'],'value':_0x1b557a['value']};}):_0x2ed4c0[_0xed6f('0x3d')]==_0xed6f('0x6a')?[{'name':'True','value':_0xed6f('0x6b')},{'name':_0xed6f('0x6c'),'value':_0xed6f('0x6d')}]:[]};})};}})[_0xed6f('0x24')](respondWithResult(_0x5a2f9f,null))[_0xed6f('0x43')](function(_0x323bec){var _0x2ae28b=_0xf960bd[_0xed6f('0x2e')][_0xed6f('0x6e')]?0x1f4:_0x323bec[_0xed6f('0x6f')]||0x1f4;logger[_0xed6f('0x70')](_0xed6f('0x71'),'getFields',_0x2ae28b,JSON[_0xed6f('0x72')](_0x323bec));delete _0x323bec['name'];if(_0x2ae28b===0x191){_0x2ae28b=0x190;}_0x5a2f9f[_0xed6f('0x19')](_0x2ae28b)['send'](_0xf960bd[_0xed6f('0x2e')]['test']?{'message':_0xed6f('0x73'),'statusCode':_0x323bec[_0xed6f('0x6f')]}:_0x323bec);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 4c11be5..43c9a18 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 _0xf7cb=['../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf7cb,0x1a9));var _0xbf7c=function(_0x5c0c44,_0x120504){_0x5c0c44=_0x5c0c44-0x0;var _0x205dcf=_0xf7cb[_0x5c0c44];return _0x205dcf;};'use strict';var _=require('lodash');var util=require(_0xbf7c('0x0'));var logger=require(_0xbf7c('0x1'))(_0xbf7c('0x2'));var moment=require(_0xbf7c('0x3'));var BPromise=require(_0xbf7c('0x4'));var rp=require(_0xbf7c('0x5'));var fs=require('fs');var path=require(_0xbf7c('0x6'));var rimraf=require('rimraf');var config=require(_0xbf7c('0x7'));var attributes=require(_0xbf7c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xbf7c('0x9')]=function(_0x1a1c21,_0x23ed74){return _0x1a1c21['define'](_0xbf7c('0xa'),attributes,{'tableName':_0xbf7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe868=['api','moment','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x227978,_0x2a50dc){var _0x3735fb=function(_0x3b671a){while(--_0x3b671a){_0x227978['push'](_0x227978['shift']());}};_0x3735fb(++_0x2a50dc);}(_0xe868,0x75));var _0x8e86=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe868[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8e86('0x0'));var util=require(_0x8e86('0x1'));var logger=require(_0x8e86('0x2'))(_0x8e86('0x3'));var moment=require(_0x8e86('0x4'));var BPromise=require('bluebird');var rp=require(_0x8e86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e86('0x6'));var attributes=require(_0x8e86('0x7'));var integrations=require(_0x8e86('0x8'));module[_0x8e86('0x9')]=function(_0x2e9669,_0x248bb8){return _0x2e9669['define'](_0x8e86('0xa'),attributes,{'tableName':_0x8e86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 95d2f53..f53a3be 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 _0x3144=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','request\x20sent','result','GetSalesforceAccount','SalesforceAccount','options','where','attributes','limit','include','model','map','info','catch','ShowSalesforceAccount','find','raw','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x419bb9,_0x247ffa){var _0x594006=function(_0x795a74){while(--_0x795a74){_0x419bb9['push'](_0x419bb9['shift']());}};_0x594006(++_0x247ffa);}(_0x3144,0x17c));var _0x4314=function(_0x13d0fd,_0x3f49fd){_0x13d0fd=_0x13d0fd-0x0;var _0x591da2=_0x3144[_0x13d0fd];return _0x591da2;};'use strict';var _=require('lodash');var util=require(_0x4314('0x0'));var moment=require(_0x4314('0x1'));var BPromise=require(_0x4314('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4314('0x3'));var db=require(_0x4314('0x4'))['db'];var utils=require(_0x4314('0x5'));var logger=require(_0x4314('0x6'))('rpc');var config=require(_0x4314('0x7'));var jayson=require(_0x4314('0x8'));var client=jayson[_0x4314('0x9')][_0x4314('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f31d,_0x4903a1,_0x5ccc2b){return new BPromise(function(_0x3b21e5,_0x96ab52){return client[_0x4314('0xb')](_0x51f31d,_0x5ccc2b)[_0x4314('0xc')](function(_0x2e756b){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4903a1,'request\x20sent');logger[_0x4314('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4903a1,'request\x20sent',JSON[_0x4314('0xe')](_0x2e756b));if(_0x2e756b[_0x4314('0xf')]){if(_0x2e756b[_0x4314('0xf')][_0x4314('0x10')]===0x1f4){logger['error'](_0x4314('0x11'),_0x4903a1,_0x2e756b[_0x4314('0xf')][_0x4314('0x12')]);return _0x96ab52(_0x2e756b['error'][_0x4314('0x12')]);}logger[_0x4314('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x4903a1,_0x2e756b[_0x4314('0xf')][_0x4314('0x12')]);return _0x3b21e5(_0x2e756b['error'][_0x4314('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4903a1,_0x4314('0x13'));_0x3b21e5(_0x2e756b[_0x4314('0x14')][_0x4314('0x12')]);}})['catch'](function(_0x1fdc84){logger[_0x4314('0xf')](_0x4314('0x11'),_0x4903a1,_0x1fdc84);_0x96ab52(_0x1fdc84);});});}exports[_0x4314('0x15')]=function(_0x5b5898){var _0x5d6b01=this;return new Promise(function(_0x444e8a,_0x32acb5){return db[_0x4314('0x16')]['findAll']({'raw':_0x5b5898['options']?_0x5b5898['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b5898[_0x4314('0x17')]?_0x5b5898[_0x4314('0x17')][_0x4314('0x18')]||null:null,'attributes':_0x5b5898[_0x4314('0x17')]?_0x5b5898[_0x4314('0x17')][_0x4314('0x19')]||null:null,'limit':_0x5b5898[_0x4314('0x17')]?_0x5b5898['options'][_0x4314('0x1a')]||null:null,'include':_0x5b5898[_0x4314('0x17')]?_0x5b5898[_0x4314('0x17')][_0x4314('0x1b')]?_['map'](_0x5b5898[_0x4314('0x17')][_0x4314('0x1b')],function(_0x296ffa){return{'model':db[_0x296ffa[_0x4314('0x1c')]],'as':_0x296ffa['as'],'attributes':_0x296ffa[_0x4314('0x19')],'include':_0x296ffa[_0x4314('0x1b')]?_[_0x4314('0x1d')](_0x296ffa['include'],function(_0x38908a){return{'model':db[_0x38908a['model']],'as':_0x38908a['as'],'attributes':_0x38908a[_0x4314('0x19')],'include':_0x38908a[_0x4314('0x1b')]?_[_0x4314('0x1d')](_0x38908a[_0x4314('0x1b')],function(_0x289ec2){return{'model':db[_0x289ec2['model']],'as':_0x289ec2['as'],'attributes':_0x289ec2[_0x4314('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52c992){logger[_0x4314('0x1e')](_0x4314('0x15'),_0x5b5898);logger[_0x4314('0xd')](_0x4314('0x15'),_0x5b5898,JSON['stringify'](_0x52c992));_0x444e8a(_0x52c992);})[_0x4314('0x1f')](function(_0x3beb5a){logger[_0x4314('0xf')]('GetSalesforceAccount',_0x3beb5a['message'],_0x5b5898);_0x32acb5(_0x5d6b01['error'](0x1f4,_0x3beb5a[_0x4314('0x12')]));});});};exports[_0x4314('0x20')]=function(_0x493d02){var _0x1c7950=this;return new Promise(function(_0x55534d,_0x2695f3){return db[_0x4314('0x16')][_0x4314('0x21')]({'raw':_0x493d02[_0x4314('0x17')]?_0x493d02[_0x4314('0x17')][_0x4314('0x22')]===undefined?!![]:![]:!![],'where':_0x493d02['options']?_0x493d02[_0x4314('0x17')][_0x4314('0x18')]||null:null,'attributes':_0x493d02['options']?_0x493d02['options']['attributes']||null:null,'include':_0x493d02[_0x4314('0x17')]?_0x493d02[_0x4314('0x17')][_0x4314('0x1b')]?_[_0x4314('0x1d')](_0x493d02[_0x4314('0x17')][_0x4314('0x1b')],function(_0x330a98){return{'model':db[_0x330a98[_0x4314('0x1c')]],'as':_0x330a98['as'],'attributes':_0x330a98[_0x4314('0x19')],'include':_0x330a98[_0x4314('0x1b')]?_[_0x4314('0x1d')](_0x330a98[_0x4314('0x1b')],function(_0x253e89){return{'model':db[_0x253e89[_0x4314('0x1c')]],'as':_0x253e89['as'],'attributes':_0x253e89['attributes'],'include':_0x253e89[_0x4314('0x1b')]?_[_0x4314('0x1d')](_0x253e89['include'],function(_0x48a1e4){return{'model':db[_0x48a1e4[_0x4314('0x1c')]],'as':_0x48a1e4['as'],'attributes':_0x48a1e4[_0x4314('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4314('0xc')](function(_0x30cee6){logger[_0x4314('0x1e')](_0x4314('0x20'),_0x493d02);logger[_0x4314('0xd')](_0x4314('0x20'),_0x493d02,JSON[_0x4314('0xe')](_0x30cee6));_0x55534d(_0x30cee6);})['catch'](function(_0x4cdfba){logger[_0x4314('0xf')]('ShowSalesforceAccount',_0x4cdfba[_0x4314('0x12')],_0x493d02);_0x2695f3(_0x1c7950[_0x4314('0xf')](0x1f4,_0x4cdfba[_0x4314('0x12')]));});});}; \ No newline at end of file +var _0x2db9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSalesforceAccount','findAll','options','attributes','map','model','include','ShowSalesforceAccount','SalesforceAccount','find','lodash','randomstring','ioredis'];(function(_0x5496fd,_0x51eadd){var _0x44507a=function(_0xc94d77){while(--_0xc94d77){_0x5496fd['push'](_0x5496fd['shift']());}};_0x44507a(++_0x51eadd);}(_0x2db9,0x171));var _0x92db=function(_0x17c61a,_0x462460){_0x17c61a=_0x17c61a-0x0;var _0x18426c=_0x2db9[_0x17c61a];return _0x18426c;};'use strict';var _=require(_0x92db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92db('0x1'));var fs=require('fs');var Redis=require(_0x92db('0x2'));var db=require(_0x92db('0x3'))['db'];var utils=require(_0x92db('0x4'));var logger=require('../../config/logger')(_0x92db('0x5'));var config=require(_0x92db('0x6'));var jayson=require(_0x92db('0x7'));var client=jayson[_0x92db('0x8')][_0x92db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cd6e9,_0xb66c69,_0x5e5bc1){return new BPromise(function(_0x1e3c1b,_0x43ef7e){return client[_0x92db('0xa')](_0x2cd6e9,_0x5e5bc1)[_0x92db('0xb')](function(_0x574e09){logger[_0x92db('0xc')](_0x92db('0xd'),_0xb66c69,_0x92db('0xe'));logger[_0x92db('0xf')](_0x92db('0x10'),_0xb66c69,'request\x20sent',JSON[_0x92db('0x11')](_0x574e09));if(_0x574e09[_0x92db('0x12')]){if(_0x574e09[_0x92db('0x12')]['code']===0x1f4){logger[_0x92db('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0xb66c69,_0x574e09[_0x92db('0x12')]['message']);return _0x43ef7e(_0x574e09[_0x92db('0x12')][_0x92db('0x13')]);}logger[_0x92db('0x12')](_0x92db('0xd'),_0xb66c69,_0x574e09[_0x92db('0x12')]['message']);return _0x1e3c1b(_0x574e09['error'][_0x92db('0x13')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xb66c69,_0x92db('0xe'));_0x1e3c1b(_0x574e09['result'][_0x92db('0x13')]);}})[_0x92db('0x14')](function(_0x1cd924){logger['error'](_0x92db('0xd'),_0xb66c69,_0x1cd924);_0x43ef7e(_0x1cd924);});});}exports[_0x92db('0x15')]=function(_0x1d00ed){var _0x38c1d1=this;return new Promise(function(_0x53054f,_0x59856c){return db['SalesforceAccount'][_0x92db('0x16')]({'raw':_0x1d00ed['options']?_0x1d00ed['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d00ed[_0x92db('0x17')]?_0x1d00ed[_0x92db('0x17')]['where']||null:null,'attributes':_0x1d00ed[_0x92db('0x17')]?_0x1d00ed['options'][_0x92db('0x18')]||null:null,'limit':_0x1d00ed[_0x92db('0x17')]?_0x1d00ed[_0x92db('0x17')]['limit']||null:null,'include':_0x1d00ed[_0x92db('0x17')]?_0x1d00ed[_0x92db('0x17')]['include']?_[_0x92db('0x19')](_0x1d00ed[_0x92db('0x17')]['include'],function(_0x5a971c){return{'model':db[_0x5a971c[_0x92db('0x1a')]],'as':_0x5a971c['as'],'attributes':_0x5a971c[_0x92db('0x18')],'include':_0x5a971c['include']?_[_0x92db('0x19')](_0x5a971c[_0x92db('0x1b')],function(_0xb9fffa){return{'model':db[_0xb9fffa['model']],'as':_0xb9fffa['as'],'attributes':_0xb9fffa[_0x92db('0x18')],'include':_0xb9fffa[_0x92db('0x1b')]?_[_0x92db('0x19')](_0xb9fffa['include'],function(_0x461621){return{'model':db[_0x461621[_0x92db('0x1a')]],'as':_0x461621['as'],'attributes':_0x461621[_0x92db('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2125e9){logger[_0x92db('0xc')]('GetSalesforceAccount',_0x1d00ed);logger[_0x92db('0xf')](_0x92db('0x15'),_0x1d00ed,JSON[_0x92db('0x11')](_0x2125e9));_0x53054f(_0x2125e9);})['catch'](function(_0x9942a3){logger[_0x92db('0x12')]('GetSalesforceAccount',_0x9942a3[_0x92db('0x13')],_0x1d00ed);_0x59856c(_0x38c1d1[_0x92db('0x12')](0x1f4,_0x9942a3['message']));});});};exports[_0x92db('0x1c')]=function(_0x5a7d6d){var _0x401da1=this;return new Promise(function(_0x44dde6,_0x2228dc){return db[_0x92db('0x1d')][_0x92db('0x1e')]({'raw':_0x5a7d6d[_0x92db('0x17')]?_0x5a7d6d[_0x92db('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5a7d6d[_0x92db('0x17')]?_0x5a7d6d[_0x92db('0x17')]['where']||null:null,'attributes':_0x5a7d6d[_0x92db('0x17')]?_0x5a7d6d[_0x92db('0x17')][_0x92db('0x18')]||null:null,'include':_0x5a7d6d['options']?_0x5a7d6d[_0x92db('0x17')]['include']?_[_0x92db('0x19')](_0x5a7d6d['options']['include'],function(_0x4588b2){return{'model':db[_0x4588b2[_0x92db('0x1a')]],'as':_0x4588b2['as'],'attributes':_0x4588b2[_0x92db('0x18')],'include':_0x4588b2[_0x92db('0x1b')]?_[_0x92db('0x19')](_0x4588b2['include'],function(_0x390a44){return{'model':db[_0x390a44[_0x92db('0x1a')]],'as':_0x390a44['as'],'attributes':_0x390a44[_0x92db('0x18')],'include':_0x390a44[_0x92db('0x1b')]?_[_0x92db('0x19')](_0x390a44[_0x92db('0x1b')],function(_0xf6a05f){return{'model':db[_0xf6a05f[_0x92db('0x1a')]],'as':_0xf6a05f['as'],'attributes':_0xf6a05f[_0x92db('0x18')]};}):[]};}):[]};}):[]:[]})[_0x92db('0xb')](function(_0x5b8449){logger[_0x92db('0xc')](_0x92db('0x1c'),_0x5a7d6d);logger['debug'](_0x92db('0x1c'),_0x5a7d6d,JSON[_0x92db('0x11')](_0x5b8449));_0x44dde6(_0x5b8449);})[_0x92db('0x14')](function(_0x3a4351){logger['error'](_0x92db('0x1c'),_0x3a4351[_0x92db('0x13')],_0x5a7d6d);_0x2228dc(_0x401da1[_0x92db('0x12')](0x1f4,_0x3a4351['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 747525e..98a6010 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 _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x9cb6b2,_0x34d335){_0x9cb6b2=_0x9cb6b2-0x0;var _0x54030d=_0x2032[_0x9cb6b2];return _0x54030d;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file +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(_0x175407,_0x4e9322){var _0x348b8d=function(_0x1b3fb1){while(--_0x1b3fb1){_0x175407['push'](_0x175407['shift']());}};_0x348b8d(++_0x4e9322);}(_0xadb5,0xad));var _0x5adb=function(_0x3ef468,_0x4cc401){_0x3ef468=_0x3ef468-0x0;var _0x120acd=_0xadb5[_0x3ef468];return _0x120acd;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index b04b2a1..b4ab0ec 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 _0x7cbe=['account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x9217a2,_0x515934){var _0xbbecf8=function(_0x4b6c42){while(--_0x4b6c42){_0x9217a2['push'](_0x9217a2['shift']());}};_0xbbecf8(++_0x515934);}(_0x7cbe,0x19a));var _0xe7cb=function(_0x37a713,_0x59d661){_0x37a713=_0x37a713-0x0;var _0x4ee6b3=_0x7cbe[_0x37a713];return _0x4ee6b3;};'use strict';var Sequelize=require(_0xe7cb('0x0'));module[_0xe7cb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7cb('0x2')]},'ticketType':{'type':Sequelize[_0xe7cb('0x3')](_0xe7cb('0x4'),_0xe7cb('0x5')),'defaultValue':_0xe7cb('0x4')},'moduleSearch':{'type':Sequelize[_0xe7cb('0x3')](_0xe7cb('0x6'),_0xe7cb('0x7'),_0xe7cb('0x8'),_0xe7cb('0x9'),_0xe7cb('0xa')),'defaultValue':_0xe7cb('0x6')},'moduleCreate':{'type':Sequelize[_0xe7cb('0x3')](_0xe7cb('0xb'),_0xe7cb('0x7'),_0xe7cb('0x8'),_0xe7cb('0xa')),'defaultValue':_0xe7cb('0x8')},'leadId':{'type':Sequelize[_0xe7cb('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xe7cb('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xe7cb('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xea0a=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize'];(function(_0x428c99,_0x3f22c3){var _0x51c90f=function(_0x21a28e){while(--_0x21a28e){_0x428c99['push'](_0x428c99['shift']());}};_0x51c90f(++_0x3f22c3);}(_0xea0a,0x99));var _0xaea0=function(_0x4b9781,_0x713b9f){_0x4b9781=_0x4b9781-0x0;var _0x1070f4=_0xea0a[_0x4b9781];return _0x1070f4;};'use strict';var Sequelize=require(_0xaea0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaea0('0x1')]},'ticketType':{'type':Sequelize[_0xaea0('0x2')](_0xaea0('0x3'),_0xaea0('0x4')),'defaultValue':_0xaea0('0x3')},'moduleSearch':{'type':Sequelize[_0xaea0('0x2')](_0xaea0('0x5'),_0xaea0('0x6'),_0xaea0('0x7'),_0xaea0('0x8'),_0xaea0('0x9')),'defaultValue':_0xaea0('0x5')},'moduleCreate':{'type':Sequelize[_0xaea0('0x2')](_0xaea0('0xa'),'contact',_0xaea0('0x7'),_0xaea0('0x9')),'defaultValue':_0xaea0('0x7')},'leadId':{'type':Sequelize[_0xaea0('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xaea0('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xaea0('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xaea0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 74285ec..ed2895d 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 _0xafb4=['error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','findAll','rows','catch','show','params','includeAll','include','create','body','find','getFields','getSubjects','findOne','SalesforceField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xafb4,0x78));var _0x4afb=function(_0x1f8f4e,_0xa56726){_0x1f8f4e=_0x1f8f4e-0x0;var _0x44e3ed=_0xafb4[_0x1f8f4e];return _0x44e3ed;};'use strict';var emlformat=require(_0x4afb('0x0'));var rimraf=require(_0x4afb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4afb('0x2'));var rp=require(_0x4afb('0x3'));var moment=require(_0x4afb('0x4'));var BPromise=require(_0x4afb('0x5'));var Mustache=require(_0x4afb('0x6'));var util=require('util');var path=require(_0x4afb('0x7'));var sox=require(_0x4afb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4afb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4afb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4afb('0xb'));var toCsv=require(_0x4afb('0xc'));var querystring=require('querystring');var Papa=require(_0x4afb('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4afb('0xe'));var as=require(_0x4afb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4afb('0x10'))(_0x4afb('0x11'));var utils=require('../../config/utils');var config=require(_0x4afb('0x12'));var licenseUtil=require(_0x4afb('0x13'));var db=require(_0x4afb('0x14'))['db'];function respondWithStatusCode(_0x31c4c5,_0x545530){_0x545530=_0x545530||0xcc;return function(_0x38f27f){if(_0x38f27f){return _0x31c4c5['sendStatus'](_0x545530);}return _0x31c4c5[_0x4afb('0x15')](_0x545530)[_0x4afb('0x16')]();};}function respondWithResult(_0x4e7995,_0x1e2b6b){_0x1e2b6b=_0x1e2b6b||0xc8;return function(_0x2f038e){if(_0x2f038e){return _0x4e7995[_0x4afb('0x15')](_0x1e2b6b)['json'](_0x2f038e);}};}function respondWithFilteredResult(_0x1a5053,_0x858ed6){return function(_0x46283c){if(_0x46283c){var _0x4b41a0=typeof _0x858ed6['offset']===_0x4afb('0x17')&&typeof _0x858ed6[_0x4afb('0x18')]===_0x4afb('0x17');var _0x28ab94=_0x46283c[_0x4afb('0x19')];var _0x154f83=_0x4b41a0?0x0:_0x858ed6[_0x4afb('0x1a')];var _0x391d01=_0x4b41a0?_0x46283c['count']:_0x858ed6[_0x4afb('0x1a')]+_0x858ed6[_0x4afb('0x18')];var _0x3453a1;if(_0x391d01>=_0x28ab94){_0x391d01=_0x28ab94;_0x3453a1=0xc8;}else{_0x3453a1=0xce;}_0x1a5053['status'](_0x3453a1);return _0x1a5053[_0x4afb('0x1b')](_0x4afb('0x1c'),_0x154f83+'-'+_0x391d01+'/'+_0x28ab94)[_0x4afb('0x1d')](_0x46283c);}return null;};}function patchUpdates(_0x4e7d29){return function(_0x5596ff){try{jsonpatch[_0x4afb('0x1e')](_0x5596ff,_0x4e7d29,!![]);}catch(_0x5a803c){return BPromise[_0x4afb('0x1f')](_0x5a803c);}return _0x5596ff['save']();};}function saveUpdates(_0x2389e5,_0x176577){return function(_0xbd7b64){if(_0xbd7b64){return _0xbd7b64[_0x4afb('0x20')](_0x2389e5)['then'](function(_0x50d977){return _0x50d977;});}return null;};}function removeEntity(_0x359b76,_0x3bbba8){return function(_0x2b3fcc){if(_0x2b3fcc){return _0x2b3fcc[_0x4afb('0x21')]()['then'](function(){_0x359b76[_0x4afb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9064,_0x126467){return function(_0x344613){if(!_0x344613){_0x4d9064['sendStatus'](0x194);}return _0x344613;};}function handleError(_0x386514,_0x194e38){_0x194e38=_0x194e38||0x1f4;return function(_0x40fd1f){logger[_0x4afb('0x22')](_0x40fd1f[_0x4afb('0x23')]);if(_0x40fd1f[_0x4afb('0x24')]){delete _0x40fd1f['name'];}_0x386514[_0x4afb('0x15')](_0x194e38)['send'](_0x40fd1f);};}exports[_0x4afb('0x25')]=function(_0x67dc23,_0x4b6026){var _0x301afe={},_0x589403={},_0xd75238={'count':0x0,'rows':[]};var _0x457e44=_[_0x4afb('0x26')](db[_0x4afb('0x27')][_0x4afb('0x28')],function(_0x5c6570){return{'name':_0x5c6570[_0x4afb('0x29')],'type':_0x5c6570[_0x4afb('0x2a')][_0x4afb('0x2b')]};});_0x589403[_0x4afb('0x2c')]=_[_0x4afb('0x26')](_0x457e44,_0x4afb('0x24'));_0x589403[_0x4afb('0x2d')]=_[_0x4afb('0x2e')](_0x67dc23[_0x4afb('0x2d')]);_0x589403[_0x4afb('0x2f')]=_[_0x4afb('0x30')](_0x589403[_0x4afb('0x2c')],_0x589403['query']);_0x301afe[_0x4afb('0x31')]=_[_0x4afb('0x30')](_0x589403[_0x4afb('0x2c')],qs[_0x4afb('0x32')](_0x67dc23['query']['fields']));_0x301afe[_0x4afb('0x31')]=_0x301afe[_0x4afb('0x31')][_0x4afb('0x33')]?_0x301afe[_0x4afb('0x31')]:_0x589403[_0x4afb('0x2c')];if(!_0x67dc23[_0x4afb('0x2d')][_0x4afb('0x34')](_0x4afb('0x35'))){_0x301afe[_0x4afb('0x18')]=qs['limit'](_0x67dc23[_0x4afb('0x2d')]['limit']);_0x301afe['offset']=qs[_0x4afb('0x1a')](_0x67dc23[_0x4afb('0x2d')][_0x4afb('0x1a')]);}_0x301afe[_0x4afb('0x36')]=qs[_0x4afb('0x37')](_0x67dc23[_0x4afb('0x2d')][_0x4afb('0x37')]);_0x301afe[_0x4afb('0x38')]=qs['filters'](_[_0x4afb('0x39')](_0x67dc23[_0x4afb('0x2d')],_0x589403[_0x4afb('0x2f')]),_0x457e44);if(_0x67dc23[_0x4afb('0x2d')][_0x4afb('0x3a')]){_0x301afe[_0x4afb('0x38')]=_[_0x4afb('0x3b')](_0x301afe[_0x4afb('0x38')],{'$or':_[_0x4afb('0x26')](_0x457e44,function(_0x2c0ec3){if(_0x2c0ec3[_0x4afb('0x2a')]!=='VIRTUAL'){var _0x314123={};_0x314123[_0x2c0ec3['name']]={'$like':'%'+_0x67dc23[_0x4afb('0x2d')][_0x4afb('0x3a')]+'%'};return _0x314123;}})});}_0x301afe=_[_0x4afb('0x3b')]({},_0x301afe,_0x67dc23[_0x4afb('0x3c')]);var _0x53243d={'where':_0x301afe['where']};return db['SalesforceConfiguration'][_0x4afb('0x19')](_0x53243d)[_0x4afb('0x3d')](function(_0x113ed2){_0xd75238[_0x4afb('0x19')]=_0x113ed2;if(_0x67dc23[_0x4afb('0x2d')]['includeAll']){_0x301afe['include']=[{'all':!![]}];}return db[_0x4afb('0x27')][_0x4afb('0x3e')](_0x301afe);})['then'](function(_0x33bbf0){_0xd75238[_0x4afb('0x3f')]=_0x33bbf0;return _0xd75238;})[_0x4afb('0x3d')](respondWithFilteredResult(_0x4b6026,_0x301afe))[_0x4afb('0x40')](handleError(_0x4b6026,null));};exports[_0x4afb('0x41')]=function(_0x143ec2,_0xf89fb3){var _0x38d906={'raw':![],'where':{'id':_0x143ec2[_0x4afb('0x42')]['id']}},_0x34b703={};_0x34b703[_0x4afb('0x2c')]=_['keys'](db[_0x4afb('0x27')][_0x4afb('0x28')]);_0x34b703['query']=_['keys'](_0x143ec2[_0x4afb('0x2d')]);_0x34b703[_0x4afb('0x2f')]=_[_0x4afb('0x30')](_0x34b703[_0x4afb('0x2c')],_0x34b703[_0x4afb('0x2d')]);_0x38d906[_0x4afb('0x31')]=_[_0x4afb('0x30')](_0x34b703['model'],qs[_0x4afb('0x32')](_0x143ec2[_0x4afb('0x2d')]['fields']));_0x38d906['attributes']=_0x38d906[_0x4afb('0x31')][_0x4afb('0x33')]?_0x38d906[_0x4afb('0x31')]:_0x34b703[_0x4afb('0x2c')];if(_0x143ec2[_0x4afb('0x2d')][_0x4afb('0x43')]){_0x38d906[_0x4afb('0x44')]=[{'all':!![]}];}_0x38d906=_[_0x4afb('0x3b')]({},_0x38d906,_0x143ec2[_0x4afb('0x3c')]);return db[_0x4afb('0x27')]['find'](_0x38d906)['then'](handleEntityNotFound(_0xf89fb3,null))[_0x4afb('0x3d')](respondWithResult(_0xf89fb3,null))['catch'](handleError(_0xf89fb3,null));};exports['create']=function(_0x7a6192,_0x252f44){return db['SalesforceConfiguration'][_0x4afb('0x45')](_0x7a6192[_0x4afb('0x46')],{})[_0x4afb('0x3d')](respondWithResult(_0x252f44,0xc9))[_0x4afb('0x40')](handleError(_0x252f44,null));};exports[_0x4afb('0x20')]=function(_0x51d8c3,_0x2c4fc6){if(_0x51d8c3[_0x4afb('0x46')]['id']){delete _0x51d8c3['body']['id'];}return db[_0x4afb('0x27')][_0x4afb('0x47')]({'where':{'id':_0x51d8c3['params']['id']}})[_0x4afb('0x3d')](handleEntityNotFound(_0x2c4fc6,null))[_0x4afb('0x3d')](saveUpdates(_0x51d8c3['body'],null))['then'](respondWithResult(_0x2c4fc6,null))[_0x4afb('0x40')](handleError(_0x2c4fc6,null));};exports[_0x4afb('0x21')]=function(_0x58fe04,_0x79b7ee){return db[_0x4afb('0x27')][_0x4afb('0x47')]({'where':{'id':_0x58fe04['params']['id']}})[_0x4afb('0x3d')](handleEntityNotFound(_0x79b7ee,null))[_0x4afb('0x3d')](removeEntity(_0x79b7ee,null))['catch'](handleError(_0x79b7ee,null));};exports[_0x4afb('0x48')]=function(_0x5d6032,_0xf760e1,_0x44b8e2){var _0x4c7128={};var _0xa7c750={};var _0x23dde6;var _0x5b96e7;return db[_0x4afb('0x27')]['findOne']({'where':{'id':_0x5d6032['params']['id']}})[_0x4afb('0x3d')](handleEntityNotFound(_0xf760e1,null))[_0x4afb('0x3d')](function(_0x37229f){if(_0x37229f){_0x23dde6=_0x37229f;_0xa7c750[_0x4afb('0x2c')]=_[_0x4afb('0x2e')](db['SalesforceField']['rawAttributes']);_0xa7c750[_0x4afb('0x2d')]=_[_0x4afb('0x2e')](_0x5d6032[_0x4afb('0x2d')]);_0xa7c750[_0x4afb('0x2f')]=_[_0x4afb('0x30')](_0xa7c750[_0x4afb('0x2c')],_0xa7c750[_0x4afb('0x2d')]);_0x4c7128[_0x4afb('0x31')]=_[_0x4afb('0x30')](_0xa7c750[_0x4afb('0x2c')],qs[_0x4afb('0x32')](_0x5d6032['query']['fields']));_0x4c7128['attributes']=_0x4c7128[_0x4afb('0x31')][_0x4afb('0x33')]?_0x4c7128[_0x4afb('0x31')]:_0xa7c750[_0x4afb('0x2c')];_0x4c7128[_0x4afb('0x36')]=qs['sort'](_0x5d6032[_0x4afb('0x2d')][_0x4afb('0x37')]);_0x4c7128[_0x4afb('0x38')]=qs[_0x4afb('0x2f')](_['pick'](_0x5d6032[_0x4afb('0x2d')],_0xa7c750['filters']));if(_0x5d6032[_0x4afb('0x2d')]['filter']){_0x4c7128[_0x4afb('0x38')]=_['merge'](_0x4c7128[_0x4afb('0x38')],{'$or':_[_0x4afb('0x26')](_0x4c7128[_0x4afb('0x31')],function(_0x510565){var _0x283ee7={};_0x283ee7[_0x510565]={'$like':'%'+_0x5d6032[_0x4afb('0x2d')][_0x4afb('0x3a')]+'%'};return _0x283ee7;})});}_0x4c7128=_['merge']({},_0x4c7128,_0x5d6032[_0x4afb('0x3c')]);return _0x23dde6[_0x4afb('0x48')](_0x4c7128);}})[_0x4afb('0x3d')](function(_0x333df9){if(_0x333df9){_0x5b96e7=_0x333df9[_0x4afb('0x33')];if(!_0x5d6032[_0x4afb('0x2d')]['hasOwnProperty'](_0x4afb('0x35'))){_0x4c7128[_0x4afb('0x18')]=qs['limit'](_0x5d6032[_0x4afb('0x2d')][_0x4afb('0x18')]);_0x4c7128[_0x4afb('0x1a')]=qs[_0x4afb('0x1a')](_0x5d6032[_0x4afb('0x2d')][_0x4afb('0x1a')]);}return _0x23dde6['getFields'](_0x4c7128);}})[_0x4afb('0x3d')](function(_0x48ba39){if(_0x48ba39){return _0x48ba39?{'count':_0x5b96e7,'rows':_0x48ba39}:null;}})[_0x4afb('0x3d')](respondWithResult(_0xf760e1,null))['catch'](handleError(_0xf760e1,null));};exports[_0x4afb('0x49')]=function(_0x5f0c41,_0x55e0fa,_0x483843){var _0x2949e9={};var _0x40b528={};var _0x25cd21;var _0x4df36a;return db[_0x4afb('0x27')][_0x4afb('0x4a')]({'where':{'id':_0x5f0c41['params']['id']}})['then'](handleEntityNotFound(_0x55e0fa,null))[_0x4afb('0x3d')](function(_0x2e2bfd){if(_0x2e2bfd){_0x25cd21=_0x2e2bfd;_0x40b528[_0x4afb('0x2c')]=_[_0x4afb('0x2e')](db[_0x4afb('0x4b')][_0x4afb('0x28')]);_0x40b528[_0x4afb('0x2d')]=_[_0x4afb('0x2e')](_0x5f0c41[_0x4afb('0x2d')]);_0x40b528[_0x4afb('0x2f')]=_[_0x4afb('0x30')](_0x40b528[_0x4afb('0x2c')],_0x40b528['query']);_0x2949e9[_0x4afb('0x31')]=_[_0x4afb('0x30')](_0x40b528[_0x4afb('0x2c')],qs[_0x4afb('0x32')](_0x5f0c41['query'][_0x4afb('0x32')]));_0x2949e9[_0x4afb('0x31')]=_0x2949e9[_0x4afb('0x31')]['length']?_0x2949e9[_0x4afb('0x31')]:_0x40b528[_0x4afb('0x2c')];_0x2949e9['order']=qs[_0x4afb('0x37')](_0x5f0c41[_0x4afb('0x2d')][_0x4afb('0x37')]);_0x2949e9[_0x4afb('0x38')]=qs['filters'](_[_0x4afb('0x39')](_0x5f0c41[_0x4afb('0x2d')],_0x40b528['filters']));if(_0x5f0c41['query']['filter']){_0x2949e9[_0x4afb('0x38')]=_['merge'](_0x2949e9[_0x4afb('0x38')],{'$or':_[_0x4afb('0x26')](_0x2949e9[_0x4afb('0x31')],function(_0x2c7252){var _0x44e556={};_0x44e556[_0x2c7252]={'$like':'%'+_0x5f0c41[_0x4afb('0x2d')][_0x4afb('0x3a')]+'%'};return _0x44e556;})});}_0x2949e9=_[_0x4afb('0x3b')]({},_0x2949e9,_0x5f0c41['options']);return _0x25cd21[_0x4afb('0x49')](_0x2949e9);}})[_0x4afb('0x3d')](function(_0x119f05){if(_0x119f05){_0x4df36a=_0x119f05[_0x4afb('0x33')];if(!_0x5f0c41[_0x4afb('0x2d')][_0x4afb('0x34')](_0x4afb('0x35'))){_0x2949e9[_0x4afb('0x18')]=qs['limit'](_0x5f0c41['query'][_0x4afb('0x18')]);_0x2949e9[_0x4afb('0x1a')]=qs[_0x4afb('0x1a')](_0x5f0c41[_0x4afb('0x2d')][_0x4afb('0x1a')]);}return _0x25cd21[_0x4afb('0x49')](_0x2949e9);}})[_0x4afb('0x3d')](function(_0x276ad4){if(_0x276ad4){return _0x276ad4?{'count':_0x4df36a,'rows':_0x276ad4}:null;}})[_0x4afb('0x3d')](respondWithResult(_0x55e0fa,null))[_0x4afb('0x40')](handleError(_0x55e0fa,null));};exports['getDescriptions']=function(_0x127227,_0x3324e3,_0x1aff98){var _0x37c3d9={};var _0xbec766={};var _0x59f51b;var _0x27c330;return db['SalesforceConfiguration'][_0x4afb('0x4a')]({'where':{'id':_0x127227[_0x4afb('0x42')]['id']}})[_0x4afb('0x3d')](handleEntityNotFound(_0x3324e3,null))['then'](function(_0x4f9d23){if(_0x4f9d23){_0x59f51b=_0x4f9d23;_0xbec766['model']=_[_0x4afb('0x2e')](db[_0x4afb('0x4b')]['rawAttributes']);_0xbec766[_0x4afb('0x2d')]=_[_0x4afb('0x2e')](_0x127227[_0x4afb('0x2d')]);_0xbec766[_0x4afb('0x2f')]=_[_0x4afb('0x30')](_0xbec766['model'],_0xbec766[_0x4afb('0x2d')]);_0x37c3d9['attributes']=_[_0x4afb('0x30')](_0xbec766['model'],qs['fields'](_0x127227['query'][_0x4afb('0x32')]));_0x37c3d9[_0x4afb('0x31')]=_0x37c3d9[_0x4afb('0x31')]['length']?_0x37c3d9[_0x4afb('0x31')]:_0xbec766[_0x4afb('0x2c')];_0x37c3d9[_0x4afb('0x36')]=qs['sort'](_0x127227['query']['sort']);_0x37c3d9[_0x4afb('0x38')]=qs[_0x4afb('0x2f')](_[_0x4afb('0x39')](_0x127227['query'],_0xbec766[_0x4afb('0x2f')]));if(_0x127227['query'][_0x4afb('0x3a')]){_0x37c3d9[_0x4afb('0x38')]=_[_0x4afb('0x3b')](_0x37c3d9[_0x4afb('0x38')],{'$or':_['map'](_0x37c3d9[_0x4afb('0x31')],function(_0x2511df){var _0x2b6412={};_0x2b6412[_0x2511df]={'$like':'%'+_0x127227['query']['filter']+'%'};return _0x2b6412;})});}_0x37c3d9=_[_0x4afb('0x3b')]({},_0x37c3d9,_0x127227[_0x4afb('0x3c')]);return _0x59f51b[_0x4afb('0x4c')](_0x37c3d9);}})[_0x4afb('0x3d')](function(_0x5c489f){if(_0x5c489f){_0x27c330=_0x5c489f[_0x4afb('0x33')];if(!_0x127227[_0x4afb('0x2d')][_0x4afb('0x34')](_0x4afb('0x35'))){_0x37c3d9['limit']=qs[_0x4afb('0x18')](_0x127227['query'][_0x4afb('0x18')]);_0x37c3d9[_0x4afb('0x1a')]=qs['offset'](_0x127227[_0x4afb('0x2d')][_0x4afb('0x1a')]);}return _0x59f51b[_0x4afb('0x4c')](_0x37c3d9);}})['then'](function(_0x29256c){if(_0x29256c){return _0x29256c?{'count':_0x27c330,'rows':_0x29256c}:null;}})[_0x4afb('0x3d')](respondWithResult(_0x3324e3,null))[_0x4afb('0x40')](handleError(_0x3324e3,null));}; \ No newline at end of file +var _0x72a2=['rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x72a2,0x161));var _0x272a=function(_0x3c602f,_0x2d4e94){_0x3c602f=_0x3c602f-0x0;var _0x1abec3=_0x72a2[_0x3c602f];return _0x1abec3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x272a('0x0'));var zipdir=require(_0x272a('0x1'));var jsonpatch=require(_0x272a('0x2'));var rp=require(_0x272a('0x3'));var moment=require(_0x272a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x272a('0x5'));var util=require('util');var path=require(_0x272a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x272a('0x7'));var _=require(_0x272a('0x8'));var squel=require(_0x272a('0x9'));var crypto=require(_0x272a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x272a('0xb'));var querystring=require('querystring');var Papa=require(_0x272a('0xc'));var Redis=require('ioredis');var authService=require(_0x272a('0xd'));var qs=require(_0x272a('0xe'));var as=require(_0x272a('0xf'));var hardwareService=require(_0x272a('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x272a('0x11'));var config=require(_0x272a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x272a('0x13'))['db'];function respondWithStatusCode(_0x7cb1fe,_0x37ee7e){_0x37ee7e=_0x37ee7e||0xcc;return function(_0xa82788){if(_0xa82788){return _0x7cb1fe[_0x272a('0x14')](_0x37ee7e);}return _0x7cb1fe['status'](_0x37ee7e)[_0x272a('0x15')]();};}function respondWithResult(_0x2143a4,_0x43fce6){_0x43fce6=_0x43fce6||0xc8;return function(_0x167a72){if(_0x167a72){return _0x2143a4['status'](_0x43fce6)[_0x272a('0x16')](_0x167a72);}};}function respondWithFilteredResult(_0x9414d6,_0x5b615a){return function(_0x4e3661){if(_0x4e3661){var _0x4cfb67=typeof _0x5b615a['offset']==='undefined'&&typeof _0x5b615a['limit']===_0x272a('0x17');var _0x48bf3d=_0x4e3661[_0x272a('0x18')];var _0x327f68=_0x4cfb67?0x0:_0x5b615a[_0x272a('0x19')];var _0x3325b2=_0x4cfb67?_0x4e3661['count']:_0x5b615a[_0x272a('0x19')]+_0x5b615a[_0x272a('0x1a')];var _0x2675be;if(_0x3325b2>=_0x48bf3d){_0x3325b2=_0x48bf3d;_0x2675be=0xc8;}else{_0x2675be=0xce;}_0x9414d6[_0x272a('0x1b')](_0x2675be);return _0x9414d6[_0x272a('0x1c')](_0x272a('0x1d'),_0x327f68+'-'+_0x3325b2+'/'+_0x48bf3d)[_0x272a('0x16')](_0x4e3661);}return null;};}function patchUpdates(_0x5cc0d6){return function(_0x393e68){try{jsonpatch[_0x272a('0x1e')](_0x393e68,_0x5cc0d6,!![]);}catch(_0x12c1c3){return BPromise[_0x272a('0x1f')](_0x12c1c3);}return _0x393e68[_0x272a('0x20')]();};}function saveUpdates(_0x297562,_0x4ac0bb){return function(_0x1bfe85){if(_0x1bfe85){return _0x1bfe85['update'](_0x297562)[_0x272a('0x21')](function(_0x504868){return _0x504868;});}return null;};}function removeEntity(_0x3ec1c3,_0x5a7003){return function(_0x13081e){if(_0x13081e){return _0x13081e[_0x272a('0x22')]()[_0x272a('0x21')](function(){_0x3ec1c3[_0x272a('0x1b')](0xcc)[_0x272a('0x15')]();});}};}function handleEntityNotFound(_0x4554b1,_0x15d35c){return function(_0x8138e2){if(!_0x8138e2){_0x4554b1[_0x272a('0x14')](0x194);}return _0x8138e2;};}function handleError(_0x4d1293,_0xc743bc){_0xc743bc=_0xc743bc||0x1f4;return function(_0x6312d4){logger[_0x272a('0x23')](_0x6312d4[_0x272a('0x24')]);if(_0x6312d4[_0x272a('0x25')]){delete _0x6312d4['name'];}_0x4d1293['status'](_0xc743bc)[_0x272a('0x26')](_0x6312d4);};}exports[_0x272a('0x27')]=function(_0x654dc6,_0x1bce15){var _0x62a99c={},_0x73707b={},_0x10d03c={'count':0x0,'rows':[]};var _0x142f1=_[_0x272a('0x28')](db[_0x272a('0x29')][_0x272a('0x2a')],function(_0x5104f3){return{'name':_0x5104f3['fieldName'],'type':_0x5104f3['type'][_0x272a('0x2b')]};});_0x73707b['model']=_[_0x272a('0x28')](_0x142f1,_0x272a('0x25'));_0x73707b['query']=_[_0x272a('0x2c')](_0x654dc6[_0x272a('0x2d')]);_0x73707b[_0x272a('0x2e')]=_[_0x272a('0x2f')](_0x73707b[_0x272a('0x30')],_0x73707b[_0x272a('0x2d')]);_0x62a99c[_0x272a('0x31')]=_[_0x272a('0x2f')](_0x73707b['model'],qs[_0x272a('0x32')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x32')]));_0x62a99c['attributes']=_0x62a99c[_0x272a('0x31')]['length']?_0x62a99c['attributes']:_0x73707b[_0x272a('0x30')];if(!_0x654dc6['query'][_0x272a('0x33')](_0x272a('0x34'))){_0x62a99c[_0x272a('0x1a')]=qs[_0x272a('0x1a')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x1a')]);_0x62a99c['offset']=qs[_0x272a('0x19')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x19')]);}_0x62a99c[_0x272a('0x35')]=qs[_0x272a('0x36')](_0x654dc6[_0x272a('0x2d')][_0x272a('0x36')]);_0x62a99c['where']=qs[_0x272a('0x2e')](_[_0x272a('0x37')](_0x654dc6[_0x272a('0x2d')],_0x73707b[_0x272a('0x2e')]),_0x142f1);if(_0x654dc6[_0x272a('0x2d')][_0x272a('0x38')]){_0x62a99c['where']=_['merge'](_0x62a99c[_0x272a('0x39')],{'$or':_[_0x272a('0x28')](_0x142f1,function(_0x20e5b6){if(_0x20e5b6[_0x272a('0x3a')]!==_0x272a('0x3b')){var _0xf9b46={};_0xf9b46[_0x20e5b6[_0x272a('0x25')]]={'$like':'%'+_0x654dc6[_0x272a('0x2d')][_0x272a('0x38')]+'%'};return _0xf9b46;}})});}_0x62a99c=_[_0x272a('0x3c')]({},_0x62a99c,_0x654dc6[_0x272a('0x3d')]);var _0x46227e={'where':_0x62a99c[_0x272a('0x39')]};return db[_0x272a('0x29')][_0x272a('0x18')](_0x46227e)['then'](function(_0x33abdd){_0x10d03c[_0x272a('0x18')]=_0x33abdd;if(_0x654dc6['query'][_0x272a('0x3e')]){_0x62a99c[_0x272a('0x3f')]=[{'all':!![]}];}return db[_0x272a('0x29')][_0x272a('0x40')](_0x62a99c);})[_0x272a('0x21')](function(_0x357712){_0x10d03c[_0x272a('0x41')]=_0x357712;return _0x10d03c;})['then'](respondWithFilteredResult(_0x1bce15,_0x62a99c))[_0x272a('0x42')](handleError(_0x1bce15,null));};exports[_0x272a('0x43')]=function(_0x5a7a12,_0x48c7b0){var _0x35be0e={'raw':![],'where':{'id':_0x5a7a12[_0x272a('0x44')]['id']}},_0x47fcbd={};_0x47fcbd[_0x272a('0x30')]=_[_0x272a('0x2c')](db[_0x272a('0x29')][_0x272a('0x2a')]);_0x47fcbd[_0x272a('0x2d')]=_['keys'](_0x5a7a12[_0x272a('0x2d')]);_0x47fcbd[_0x272a('0x2e')]=_['intersection'](_0x47fcbd[_0x272a('0x30')],_0x47fcbd[_0x272a('0x2d')]);_0x35be0e['attributes']=_[_0x272a('0x2f')](_0x47fcbd[_0x272a('0x30')],qs[_0x272a('0x32')](_0x5a7a12[_0x272a('0x2d')][_0x272a('0x32')]));_0x35be0e[_0x272a('0x31')]=_0x35be0e['attributes'][_0x272a('0x45')]?_0x35be0e[_0x272a('0x31')]:_0x47fcbd[_0x272a('0x30')];if(_0x5a7a12['query'][_0x272a('0x3e')]){_0x35be0e[_0x272a('0x3f')]=[{'all':!![]}];}_0x35be0e=_['merge']({},_0x35be0e,_0x5a7a12[_0x272a('0x3d')]);return db[_0x272a('0x29')][_0x272a('0x46')](_0x35be0e)[_0x272a('0x21')](handleEntityNotFound(_0x48c7b0,null))[_0x272a('0x21')](respondWithResult(_0x48c7b0,null))[_0x272a('0x42')](handleError(_0x48c7b0,null));};exports[_0x272a('0x47')]=function(_0x4d2f43,_0x53a627){return db['SalesforceConfiguration']['create'](_0x4d2f43[_0x272a('0x48')],{})[_0x272a('0x21')](respondWithResult(_0x53a627,0xc9))[_0x272a('0x42')](handleError(_0x53a627,null));};exports[_0x272a('0x49')]=function(_0x4bb335,_0x96d803){if(_0x4bb335[_0x272a('0x48')]['id']){delete _0x4bb335['body']['id'];}return db[_0x272a('0x29')][_0x272a('0x46')]({'where':{'id':_0x4bb335[_0x272a('0x44')]['id']}})[_0x272a('0x21')](handleEntityNotFound(_0x96d803,null))[_0x272a('0x21')](saveUpdates(_0x4bb335[_0x272a('0x48')],null))[_0x272a('0x21')](respondWithResult(_0x96d803,null))[_0x272a('0x42')](handleError(_0x96d803,null));};exports[_0x272a('0x22')]=function(_0x961994,_0x313723){return db['SalesforceConfiguration']['find']({'where':{'id':_0x961994[_0x272a('0x44')]['id']}})['then'](handleEntityNotFound(_0x313723,null))[_0x272a('0x21')](removeEntity(_0x313723,null))[_0x272a('0x42')](handleError(_0x313723,null));};exports[_0x272a('0x4a')]=function(_0xc9e362,_0x40c86c,_0x54c30d){var _0x490427={};var _0x429a5a={};var _0x5822cb;var _0x36e154;return db[_0x272a('0x29')][_0x272a('0x4b')]({'where':{'id':_0xc9e362[_0x272a('0x44')]['id']}})[_0x272a('0x21')](handleEntityNotFound(_0x40c86c,null))[_0x272a('0x21')](function(_0x58c838){if(_0x58c838){_0x5822cb=_0x58c838;_0x429a5a[_0x272a('0x30')]=_['keys'](db['SalesforceField'][_0x272a('0x2a')]);_0x429a5a['query']=_['keys'](_0xc9e362[_0x272a('0x2d')]);_0x429a5a[_0x272a('0x2e')]=_[_0x272a('0x2f')](_0x429a5a['model'],_0x429a5a[_0x272a('0x2d')]);_0x490427[_0x272a('0x31')]=_[_0x272a('0x2f')](_0x429a5a['model'],qs[_0x272a('0x32')](_0xc9e362[_0x272a('0x2d')][_0x272a('0x32')]));_0x490427[_0x272a('0x31')]=_0x490427['attributes'][_0x272a('0x45')]?_0x490427[_0x272a('0x31')]:_0x429a5a[_0x272a('0x30')];_0x490427[_0x272a('0x35')]=qs['sort'](_0xc9e362[_0x272a('0x2d')][_0x272a('0x36')]);_0x490427[_0x272a('0x39')]=qs[_0x272a('0x2e')](_[_0x272a('0x37')](_0xc9e362[_0x272a('0x2d')],_0x429a5a[_0x272a('0x2e')]));if(_0xc9e362[_0x272a('0x2d')][_0x272a('0x38')]){_0x490427[_0x272a('0x39')]=_[_0x272a('0x3c')](_0x490427['where'],{'$or':_[_0x272a('0x28')](_0x490427[_0x272a('0x31')],function(_0x321592){var _0x2d09c9={};_0x2d09c9[_0x321592]={'$like':'%'+_0xc9e362[_0x272a('0x2d')]['filter']+'%'};return _0x2d09c9;})});}_0x490427=_[_0x272a('0x3c')]({},_0x490427,_0xc9e362[_0x272a('0x3d')]);return _0x5822cb[_0x272a('0x4a')](_0x490427);}})[_0x272a('0x21')](function(_0x3add61){if(_0x3add61){_0x36e154=_0x3add61[_0x272a('0x45')];if(!_0xc9e362[_0x272a('0x2d')][_0x272a('0x33')](_0x272a('0x34'))){_0x490427[_0x272a('0x1a')]=qs[_0x272a('0x1a')](_0xc9e362['query']['limit']);_0x490427[_0x272a('0x19')]=qs['offset'](_0xc9e362['query'][_0x272a('0x19')]);}return _0x5822cb[_0x272a('0x4a')](_0x490427);}})[_0x272a('0x21')](function(_0x19140b){if(_0x19140b){return _0x19140b?{'count':_0x36e154,'rows':_0x19140b}:null;}})[_0x272a('0x21')](respondWithResult(_0x40c86c,null))[_0x272a('0x42')](handleError(_0x40c86c,null));};exports['getSubjects']=function(_0x323dd5,_0x2b9c28,_0x37225e){var _0x3cf994={};var _0xf3b68a={};var _0x296ca1;var _0x1917cf;return db[_0x272a('0x29')][_0x272a('0x4b')]({'where':{'id':_0x323dd5[_0x272a('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b9c28,null))['then'](function(_0x3e24e6){if(_0x3e24e6){_0x296ca1=_0x3e24e6;_0xf3b68a[_0x272a('0x30')]=_['keys'](db[_0x272a('0x4c')][_0x272a('0x2a')]);_0xf3b68a[_0x272a('0x2d')]=_[_0x272a('0x2c')](_0x323dd5[_0x272a('0x2d')]);_0xf3b68a[_0x272a('0x2e')]=_[_0x272a('0x2f')](_0xf3b68a['model'],_0xf3b68a[_0x272a('0x2d')]);_0x3cf994['attributes']=_[_0x272a('0x2f')](_0xf3b68a['model'],qs[_0x272a('0x32')](_0x323dd5[_0x272a('0x2d')][_0x272a('0x32')]));_0x3cf994['attributes']=_0x3cf994[_0x272a('0x31')][_0x272a('0x45')]?_0x3cf994[_0x272a('0x31')]:_0xf3b68a[_0x272a('0x30')];_0x3cf994[_0x272a('0x35')]=qs[_0x272a('0x36')](_0x323dd5[_0x272a('0x2d')][_0x272a('0x36')]);_0x3cf994['where']=qs[_0x272a('0x2e')](_[_0x272a('0x37')](_0x323dd5[_0x272a('0x2d')],_0xf3b68a['filters']));if(_0x323dd5[_0x272a('0x2d')][_0x272a('0x38')]){_0x3cf994[_0x272a('0x39')]=_[_0x272a('0x3c')](_0x3cf994[_0x272a('0x39')],{'$or':_[_0x272a('0x28')](_0x3cf994['attributes'],function(_0x17a93e){var _0x573bc8={};_0x573bc8[_0x17a93e]={'$like':'%'+_0x323dd5[_0x272a('0x2d')][_0x272a('0x38')]+'%'};return _0x573bc8;})});}_0x3cf994=_[_0x272a('0x3c')]({},_0x3cf994,_0x323dd5[_0x272a('0x3d')]);return _0x296ca1[_0x272a('0x4d')](_0x3cf994);}})[_0x272a('0x21')](function(_0x582bb2){if(_0x582bb2){_0x1917cf=_0x582bb2['length'];if(!_0x323dd5[_0x272a('0x2d')][_0x272a('0x33')]('nolimit')){_0x3cf994[_0x272a('0x1a')]=qs[_0x272a('0x1a')](_0x323dd5[_0x272a('0x2d')]['limit']);_0x3cf994[_0x272a('0x19')]=qs[_0x272a('0x19')](_0x323dd5[_0x272a('0x2d')]['offset']);}return _0x296ca1[_0x272a('0x4d')](_0x3cf994);}})[_0x272a('0x21')](function(_0x32529d){if(_0x32529d){return _0x32529d?{'count':_0x1917cf,'rows':_0x32529d}:null;}})[_0x272a('0x21')](respondWithResult(_0x2b9c28,null))[_0x272a('0x42')](handleError(_0x2b9c28,null));};exports[_0x272a('0x4e')]=function(_0x3efdee,_0x421111,_0x54e8d5){var _0x3b3bcf={};var _0x5cbdee={};var _0x998a32;var _0x4db506;return db['SalesforceConfiguration'][_0x272a('0x4b')]({'where':{'id':_0x3efdee[_0x272a('0x44')]['id']}})[_0x272a('0x21')](handleEntityNotFound(_0x421111,null))[_0x272a('0x21')](function(_0x7f5ac4){if(_0x7f5ac4){_0x998a32=_0x7f5ac4;_0x5cbdee[_0x272a('0x30')]=_['keys'](db[_0x272a('0x4c')][_0x272a('0x2a')]);_0x5cbdee[_0x272a('0x2d')]=_[_0x272a('0x2c')](_0x3efdee[_0x272a('0x2d')]);_0x5cbdee[_0x272a('0x2e')]=_[_0x272a('0x2f')](_0x5cbdee[_0x272a('0x30')],_0x5cbdee[_0x272a('0x2d')]);_0x3b3bcf[_0x272a('0x31')]=_[_0x272a('0x2f')](_0x5cbdee[_0x272a('0x30')],qs[_0x272a('0x32')](_0x3efdee[_0x272a('0x2d')][_0x272a('0x32')]));_0x3b3bcf[_0x272a('0x31')]=_0x3b3bcf['attributes']['length']?_0x3b3bcf[_0x272a('0x31')]:_0x5cbdee[_0x272a('0x30')];_0x3b3bcf[_0x272a('0x35')]=qs['sort'](_0x3efdee[_0x272a('0x2d')][_0x272a('0x36')]);_0x3b3bcf[_0x272a('0x39')]=qs['filters'](_[_0x272a('0x37')](_0x3efdee[_0x272a('0x2d')],_0x5cbdee[_0x272a('0x2e')]));if(_0x3efdee[_0x272a('0x2d')][_0x272a('0x38')]){_0x3b3bcf['where']=_[_0x272a('0x3c')](_0x3b3bcf[_0x272a('0x39')],{'$or':_[_0x272a('0x28')](_0x3b3bcf[_0x272a('0x31')],function(_0x381e31){var _0x73493e={};_0x73493e[_0x381e31]={'$like':'%'+_0x3efdee[_0x272a('0x2d')][_0x272a('0x38')]+'%'};return _0x73493e;})});}_0x3b3bcf=_[_0x272a('0x3c')]({},_0x3b3bcf,_0x3efdee['options']);return _0x998a32[_0x272a('0x4e')](_0x3b3bcf);}})[_0x272a('0x21')](function(_0x3d89b7){if(_0x3d89b7){_0x4db506=_0x3d89b7[_0x272a('0x45')];if(!_0x3efdee[_0x272a('0x2d')][_0x272a('0x33')](_0x272a('0x34'))){_0x3b3bcf[_0x272a('0x1a')]=qs[_0x272a('0x1a')](_0x3efdee[_0x272a('0x2d')][_0x272a('0x1a')]);_0x3b3bcf[_0x272a('0x19')]=qs[_0x272a('0x19')](_0x3efdee[_0x272a('0x2d')]['offset']);}return _0x998a32[_0x272a('0x4e')](_0x3b3bcf);}})[_0x272a('0x21')](function(_0x170dca){if(_0x170dca){return _0x170dca?{'count':_0x4db506,'rows':_0x170dca}:null;}})['then'](respondWithResult(_0x421111,null))['catch'](handleError(_0x421111,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 84a0f35..8bb914c 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 _0xa162=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x5a234d,_0x1b43f3){var _0x4e1d82=function(_0x35522b){while(--_0x35522b){_0x5a234d['push'](_0x5a234d['shift']());}};_0x4e1d82(++_0x1b43f3);}(_0xa162,0xd6));var _0x2a16=function(_0x404bd4,_0x22559a){_0x404bd4=_0x404bd4-0x0;var _0x299de5=_0xa162[_0x404bd4];return _0x299de5;};'use strict';var _=require(_0x2a16('0x0'));var util=require(_0x2a16('0x1'));var logger=require(_0x2a16('0x2'))('api');var moment=require(_0x2a16('0x3'));var BPromise=require(_0x2a16('0x4'));var rp=require(_0x2a16('0x5'));var fs=require('fs');var path=require(_0x2a16('0x6'));var rimraf=require(_0x2a16('0x7'));var config=require(_0x2a16('0x8'));var attributes=require(_0x2a16('0x9'));module[_0x2a16('0xa')]=function(_0x40fa0e,_0x12596c){return _0x40fa0e[_0x2a16('0xb')](_0x2a16('0xc'),attributes,{'tableName':_0x2a16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78b6=['moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api'];(function(_0x25dc63,_0x2d45e8){var _0x7857c8=function(_0x2f9a5){while(--_0x2f9a5){_0x25dc63['push'](_0x25dc63['shift']());}};_0x7857c8(++_0x2d45e8);}(_0x78b6,0xf8));var _0x678b=function(_0x36fe1e,_0x175199){_0x36fe1e=_0x36fe1e-0x0;var _0x3368ef=_0x78b6[_0x36fe1e];return _0x3368ef;};'use strict';var _=require(_0x678b('0x0'));var util=require(_0x678b('0x1'));var logger=require(_0x678b('0x2'))(_0x678b('0x3'));var moment=require(_0x678b('0x4'));var BPromise=require(_0x678b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x678b('0x6'));var rimraf=require(_0x678b('0x7'));var config=require(_0x678b('0x8'));var attributes=require(_0x678b('0x9'));module[_0x678b('0xa')]=function(_0xcc3ec,_0x9fa567){return _0xcc3ec[_0x678b('0xb')](_0x678b('0xc'),attributes,{'tableName':_0x678b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index d1a1b0a..9bd2229 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 _0x8690=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8690,0x163));var _0x0869=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x8690[_0x1793de];return _0x4f0309;};'use strict';var _=require('lodash');var util=require(_0x0869('0x0'));var moment=require(_0x0869('0x1'));var BPromise=require(_0x0869('0x2'));var rs=require(_0x0869('0x3'));var fs=require('fs');var Redis=require(_0x0869('0x4'));var db=require(_0x0869('0x5'))['db'];var utils=require(_0x0869('0x6'));var logger=require(_0x0869('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0869('0x8'));var client=jayson[_0x0869('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3458af,_0x2ce63c,_0x57cfe5){return new BPromise(function(_0x2856da,_0xad1dc1){return client['request'](_0x3458af,_0x57cfe5)[_0x0869('0xa')](function(_0x3bcc34){logger[_0x0869('0xb')](_0x0869('0xc'),_0x2ce63c,'request\x20sent');logger[_0x0869('0xd')](_0x0869('0xe'),_0x2ce63c,'request\x20sent',JSON[_0x0869('0xf')](_0x3bcc34));if(_0x3bcc34[_0x0869('0x10')]){if(_0x3bcc34[_0x0869('0x10')]['code']===0x1f4){logger['error'](_0x0869('0xc'),_0x2ce63c,_0x3bcc34[_0x0869('0x10')][_0x0869('0x11')]);return _0xad1dc1(_0x3bcc34['error']['message']);}logger[_0x0869('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2ce63c,_0x3bcc34[_0x0869('0x10')][_0x0869('0x11')]);return _0x2856da(_0x3bcc34[_0x0869('0x10')][_0x0869('0x11')]);}else{logger['info'](_0x0869('0xc'),_0x2ce63c,_0x0869('0x12'));_0x2856da(_0x3bcc34[_0x0869('0x13')][_0x0869('0x11')]);}})[_0x0869('0x14')](function(_0x7c8a60){logger['error'](_0x0869('0xc'),_0x2ce63c,_0x7c8a60);_0xad1dc1(_0x7c8a60);});});} \ No newline at end of file +var _0x31fe=['../../config/environment','jayson/promise','client','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x31fe,0x8c));var _0xe31f=function(_0x4d9dd1,_0x79bc55){_0x4d9dd1=_0x4d9dd1-0x0;var _0x31b458=_0x31fe[_0x4d9dd1];return _0x31b458;};'use strict';var _=require('lodash');var util=require(_0xe31f('0x0'));var moment=require(_0xe31f('0x1'));var BPromise=require(_0xe31f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31f('0x3'))['db'];var utils=require(_0xe31f('0x4'));var logger=require(_0xe31f('0x5'))(_0xe31f('0x6'));var config=require(_0xe31f('0x7'));var jayson=require(_0xe31f('0x8'));var client=jayson[_0xe31f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d55b3,_0x268467,_0x56e23b){return new BPromise(function(_0x141e59,_0x48a309){return client[_0xe31f('0xa')](_0x2d55b3,_0x56e23b)['then'](function(_0x21881f){logger[_0xe31f('0xb')](_0xe31f('0xc'),_0x268467,_0xe31f('0xd'));logger[_0xe31f('0xe')](_0xe31f('0xf'),_0x268467,_0xe31f('0xd'),JSON['stringify'](_0x21881f));if(_0x21881f[_0xe31f('0x10')]){if(_0x21881f['error'][_0xe31f('0x11')]===0x1f4){logger[_0xe31f('0x10')](_0xe31f('0xc'),_0x268467,_0x21881f['error'][_0xe31f('0x12')]);return _0x48a309(_0x21881f[_0xe31f('0x10')]['message']);}logger[_0xe31f('0x10')](_0xe31f('0xc'),_0x268467,_0x21881f[_0xe31f('0x10')][_0xe31f('0x12')]);return _0x141e59(_0x21881f[_0xe31f('0x10')][_0xe31f('0x12')]);}else{logger[_0xe31f('0xb')](_0xe31f('0xc'),_0x268467,_0xe31f('0xd'));_0x141e59(_0x21881f[_0xe31f('0x13')][_0xe31f('0x12')]);}})[_0xe31f('0x14')](function(_0x52a74a){logger[_0xe31f('0x10')](_0xe31f('0xc'),_0x268467,_0x52a74a);_0x48a309(_0x52a74a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index ecef71c..cbed7a7 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 _0x3d6d=['put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show'];(function(_0x589181,_0xc9d8fe){var _0x5109a2=function(_0x869f08){while(--_0x869f08){_0x589181['push'](_0x589181['shift']());}};_0x5109a2(++_0xc9d8fe);}(_0x3d6d,0xf2));var _0xd3d6=function(_0x29c2f7,_0x1ffb8b){_0x29c2f7=_0x29c2f7-0x0;var _0x3582e6=_0x3d6d[_0x29c2f7];return _0x3582e6;};'use strict';var multer=require(_0xd3d6('0x0'));var util=require('util');var path=require(_0xd3d6('0x1'));var timeout=require(_0xd3d6('0x2'));var express=require('express');var router=express[_0xd3d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd3d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd3d6('0x5'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xd3d6('0x6')](),controller['index']);router[_0xd3d6('0x7')](_0xd3d6('0x8'),auth[_0xd3d6('0x6')](),controller[_0xd3d6('0x9')]);router['post']('/',auth[_0xd3d6('0x6')](),controller['create']);router[_0xd3d6('0xa')](_0xd3d6('0x8'),auth[_0xd3d6('0x6')](),controller[_0xd3d6('0xb')]);router['delete']('/:id',auth[_0xd3d6('0x6')](),controller[_0xd3d6('0xc')]);module[_0xd3d6('0xd')]=router; \ No newline at end of file +var _0x9dcc=['isAuthenticated','update','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','show','post','create','put'];(function(_0xd51d23,_0x34a38f){var _0x37c619=function(_0x55e445){while(--_0x55e445){_0xd51d23['push'](_0xd51d23['shift']());}};_0x37c619(++_0x34a38f);}(_0x9dcc,0xb8));var _0xc9dc=function(_0x1c7b94,_0x435c82){_0x1c7b94=_0x1c7b94-0x0;var _0xcd23c5=_0x9dcc[_0x1c7b94];return _0xcd23c5;};'use strict';var multer=require(_0xc9dc('0x0'));var util=require('util');var path=require(_0xc9dc('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9dc('0x2'));var router=express['Router']();var fs_extra=require(_0xc9dc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc9dc('0x4'));var config=require(_0xc9dc('0x5'));var controller=require(_0xc9dc('0x6'));router[_0xc9dc('0x7')]('/',auth['isAuthenticated'](),controller[_0xc9dc('0x8')]);router[_0xc9dc('0x7')](_0xc9dc('0x9'),auth['isAuthenticated'](),controller[_0xc9dc('0xa')]);router[_0xc9dc('0xb')]('/',auth['isAuthenticated'](),controller[_0xc9dc('0xc')]);router[_0xc9dc('0xd')]('/:id',auth[_0xc9dc('0xe')](),controller[_0xc9dc('0xf')]);router[_0xc9dc('0x10')](_0xc9dc('0x9'),auth[_0xc9dc('0xe')](),controller['destroy']);module[_0xc9dc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8981155..68a6e03 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 _0xca7b=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x28787a,_0x319ce7){var _0x161705=function(_0x3781e7){while(--_0x3781e7){_0x28787a['push'](_0x28787a['shift']());}};_0x161705(++_0x319ce7);}(_0xca7b,0xc0));var _0xbca7=function(_0x1cc6fb,_0x52ab9a){_0x1cc6fb=_0x1cc6fb-0x0;var _0x46c6a7=_0xca7b[_0x1cc6fb];return _0x46c6a7;};'use strict';var Sequelize=require(_0xbca7('0x0'));module[_0xbca7('0x1')]={'type':{'type':Sequelize[_0xbca7('0x2')](_0xbca7('0x3'),_0xbca7('0x4'),_0xbca7('0x5'),_0xbca7('0x6'),_0xbca7('0x7')),'defaultValue':_0xbca7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbca7('0x8')]},'keyType':{'type':Sequelize[_0xbca7('0x2')]('string','variable',_0xbca7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x44d1=['customVariable','ENUM','variable','keyValue','picklist','STRING','string'];(function(_0x556b1d,_0xa0f67e){var _0x346381=function(_0x31a455){while(--_0x31a455){_0x556b1d['push'](_0x556b1d['shift']());}};_0x346381(++_0xa0f67e);}(_0x44d1,0x1dd));var _0x144d=function(_0x3557ab,_0x20e487){_0x3557ab=_0x3557ab-0x0;var _0xcf7cfa=_0x44d1[_0x3557ab];return _0xcf7cfa;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x144d('0x0')]('string',_0x144d('0x1'),'customVariable',_0x144d('0x2'),_0x144d('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x144d('0x4')]},'key':{'type':Sequelize[_0x144d('0x4')]},'keyType':{'type':Sequelize[_0x144d('0x0')](_0x144d('0x5'),_0x144d('0x1'),_0x144d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x144d('0x4')]},'variableName':{'type':Sequelize[_0x144d('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f10aaf1..6df2328 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 _0x27b9=['findAll','rows','params','create','body','catch','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','apply','save','update','then','error','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceField','includeAll','include'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x27b9,0xe9));var _0x927b=function(_0x366b18,_0x258a8b){_0x366b18=_0x366b18-0x0;var _0x5c0bb6=_0x27b9[_0x366b18];return _0x5c0bb6;};'use strict';var emlformat=require(_0x927b('0x0'));var rimraf=require(_0x927b('0x1'));var zipdir=require(_0x927b('0x2'));var jsonpatch=require(_0x927b('0x3'));var rp=require(_0x927b('0x4'));var moment=require(_0x927b('0x5'));var BPromise=require(_0x927b('0x6'));var Mustache=require(_0x927b('0x7'));var util=require(_0x927b('0x8'));var path=require('path');var sox=require(_0x927b('0x9'));var csv=require('to-csv');var ejs=require(_0x927b('0xa'));var fs=require('fs');var fs_extra=require(_0x927b('0xb'));var _=require(_0x927b('0xc'));var squel=require(_0x927b('0xd'));var crypto=require(_0x927b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x927b('0xf'));var toCsv=require(_0x927b('0x10'));var querystring=require('querystring');var Papa=require(_0x927b('0x11'));var Redis=require(_0x927b('0x12'));var authService=require(_0x927b('0x13'));var qs=require(_0x927b('0x14'));var as=require(_0x927b('0x15'));var hardwareService=require(_0x927b('0x16'));var logger=require(_0x927b('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x927b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x927b('0x19'))['db'];function respondWithStatusCode(_0x3e5fa3,_0x51b607){_0x51b607=_0x51b607||0xcc;return function(_0x48805f){if(_0x48805f){return _0x3e5fa3[_0x927b('0x1a')](_0x51b607);}return _0x3e5fa3[_0x927b('0x1b')](_0x51b607)[_0x927b('0x1c')]();};}function respondWithResult(_0x344b3f,_0x21a7bf){_0x21a7bf=_0x21a7bf||0xc8;return function(_0x551923){if(_0x551923){return _0x344b3f[_0x927b('0x1b')](_0x21a7bf)['json'](_0x551923);}};}function respondWithFilteredResult(_0x39916e,_0x37a3f5){return function(_0x146382){if(_0x146382){var _0xe5c9e7=typeof _0x37a3f5['offset']===_0x927b('0x1d')&&typeof _0x37a3f5[_0x927b('0x1e')]===_0x927b('0x1d');var _0xc39f07=_0x146382['count'];var _0x44cecf=_0xe5c9e7?0x0:_0x37a3f5[_0x927b('0x1f')];var _0x29e5ac=_0xe5c9e7?_0x146382[_0x927b('0x20')]:_0x37a3f5[_0x927b('0x1f')]+_0x37a3f5[_0x927b('0x1e')];var _0x15f33e;if(_0x29e5ac>=_0xc39f07){_0x29e5ac=_0xc39f07;_0x15f33e=0xc8;}else{_0x15f33e=0xce;}_0x39916e[_0x927b('0x1b')](_0x15f33e);return _0x39916e[_0x927b('0x21')]('Content-Range',_0x44cecf+'-'+_0x29e5ac+'/'+_0xc39f07)['json'](_0x146382);}return null;};}function patchUpdates(_0x3b1458){return function(_0x3b2e50){try{jsonpatch[_0x927b('0x22')](_0x3b2e50,_0x3b1458,!![]);}catch(_0x42077c){return BPromise['reject'](_0x42077c);}return _0x3b2e50[_0x927b('0x23')]();};}function saveUpdates(_0x31ae6f,_0x3f306f){return function(_0xa1adec){if(_0xa1adec){return _0xa1adec[_0x927b('0x24')](_0x31ae6f)['then'](function(_0x30ac47){return _0x30ac47;});}return null;};}function removeEntity(_0x321edd,_0xe09d36){return function(_0x2c5d9f){if(_0x2c5d9f){return _0x2c5d9f['destroy']()[_0x927b('0x25')](function(){_0x321edd[_0x927b('0x1b')](0xcc)[_0x927b('0x1c')]();});}};}function handleEntityNotFound(_0x4bdfde,_0x1e8209){return function(_0x2724c0){if(!_0x2724c0){_0x4bdfde['sendStatus'](0x194);}return _0x2724c0;};}function handleError(_0x1bffca,_0x3c46d6){_0x3c46d6=_0x3c46d6||0x1f4;return function(_0x30e200){logger[_0x927b('0x26')](_0x30e200['stack']);if(_0x30e200['name']){delete _0x30e200['name'];}_0x1bffca[_0x927b('0x1b')](_0x3c46d6)[_0x927b('0x27')](_0x30e200);};}exports[_0x927b('0x28')]=function(_0x7db913,_0x12d31a){var _0x394213={},_0x380fc0={},_0xe4aa2d={'count':0x0,'rows':[]};var _0x58c950=_[_0x927b('0x29')](db['SalesforceField'][_0x927b('0x2a')],function(_0x13211d){return{'name':_0x13211d[_0x927b('0x2b')],'type':_0x13211d[_0x927b('0x2c')]['key']};});_0x380fc0[_0x927b('0x2d')]=_['map'](_0x58c950,_0x927b('0x2e'));_0x380fc0[_0x927b('0x2f')]=_[_0x927b('0x30')](_0x7db913[_0x927b('0x2f')]);_0x380fc0[_0x927b('0x31')]=_[_0x927b('0x32')](_0x380fc0['model'],_0x380fc0[_0x927b('0x2f')]);_0x394213[_0x927b('0x33')]=_[_0x927b('0x32')](_0x380fc0[_0x927b('0x2d')],qs['fields'](_0x7db913[_0x927b('0x2f')][_0x927b('0x34')]));_0x394213[_0x927b('0x33')]=_0x394213[_0x927b('0x33')][_0x927b('0x35')]?_0x394213[_0x927b('0x33')]:_0x380fc0[_0x927b('0x2d')];if(!_0x7db913[_0x927b('0x2f')][_0x927b('0x36')](_0x927b('0x37'))){_0x394213[_0x927b('0x1e')]=qs[_0x927b('0x1e')](_0x7db913['query']['limit']);_0x394213[_0x927b('0x1f')]=qs[_0x927b('0x1f')](_0x7db913['query']['offset']);}_0x394213[_0x927b('0x38')]=qs[_0x927b('0x39')](_0x7db913['query'][_0x927b('0x39')]);_0x394213[_0x927b('0x3a')]=qs[_0x927b('0x31')](_[_0x927b('0x3b')](_0x7db913['query'],_0x380fc0[_0x927b('0x31')]),_0x58c950);if(_0x7db913[_0x927b('0x2f')][_0x927b('0x3c')]){_0x394213[_0x927b('0x3a')]=_['merge'](_0x394213[_0x927b('0x3a')],{'$or':_[_0x927b('0x29')](_0x58c950,function(_0x476c5d){if(_0x476c5d[_0x927b('0x2c')]!==_0x927b('0x3d')){var _0x539be1={};_0x539be1[_0x476c5d[_0x927b('0x2e')]]={'$like':'%'+_0x7db913[_0x927b('0x2f')]['filter']+'%'};return _0x539be1;}})});}_0x394213=_[_0x927b('0x3e')]({},_0x394213,_0x7db913[_0x927b('0x3f')]);var _0x4e1a23={'where':_0x394213[_0x927b('0x3a')]};return db[_0x927b('0x40')][_0x927b('0x20')](_0x4e1a23)[_0x927b('0x25')](function(_0x57da8f){_0xe4aa2d['count']=_0x57da8f;if(_0x7db913[_0x927b('0x2f')][_0x927b('0x41')]){_0x394213[_0x927b('0x42')]=[{'all':!![]}];}return db[_0x927b('0x40')][_0x927b('0x43')](_0x394213);})[_0x927b('0x25')](function(_0x8e8547){_0xe4aa2d[_0x927b('0x44')]=_0x8e8547;return _0xe4aa2d;})[_0x927b('0x25')](respondWithFilteredResult(_0x12d31a,_0x394213))['catch'](handleError(_0x12d31a,null));};exports['show']=function(_0x5c398f,_0x2b74d6){var _0x2b7823={'raw':!![],'where':{'id':_0x5c398f[_0x927b('0x45')]['id']}},_0x4428b2={};_0x4428b2['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x4428b2[_0x927b('0x2f')]=_[_0x927b('0x30')](_0x5c398f[_0x927b('0x2f')]);_0x4428b2[_0x927b('0x31')]=_[_0x927b('0x32')](_0x4428b2['model'],_0x4428b2['query']);_0x2b7823[_0x927b('0x33')]=_[_0x927b('0x32')](_0x4428b2[_0x927b('0x2d')],qs[_0x927b('0x34')](_0x5c398f[_0x927b('0x2f')][_0x927b('0x34')]));_0x2b7823[_0x927b('0x33')]=_0x2b7823['attributes'][_0x927b('0x35')]?_0x2b7823[_0x927b('0x33')]:_0x4428b2['model'];if(_0x5c398f[_0x927b('0x2f')][_0x927b('0x41')]){_0x2b7823[_0x927b('0x42')]=[{'all':!![]}];}_0x2b7823=_[_0x927b('0x3e')]({},_0x2b7823,_0x5c398f[_0x927b('0x3f')]);return db[_0x927b('0x40')]['find'](_0x2b7823)[_0x927b('0x25')](handleEntityNotFound(_0x2b74d6,null))[_0x927b('0x25')](respondWithResult(_0x2b74d6,null))['catch'](handleError(_0x2b74d6,null));};exports['create']=function(_0x123aaf,_0xec6163){return db[_0x927b('0x40')][_0x927b('0x46')](_0x123aaf[_0x927b('0x47')],{})[_0x927b('0x25')](respondWithResult(_0xec6163,0xc9))[_0x927b('0x48')](handleError(_0xec6163,null));};exports[_0x927b('0x24')]=function(_0x428c09,_0x1222ef){if(_0x428c09[_0x927b('0x47')]['id']){delete _0x428c09[_0x927b('0x47')]['id'];}return db[_0x927b('0x40')][_0x927b('0x49')]({'where':{'id':_0x428c09[_0x927b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1222ef,null))[_0x927b('0x25')](saveUpdates(_0x428c09['body'],null))[_0x927b('0x25')](respondWithResult(_0x1222ef,null))['catch'](handleError(_0x1222ef,null));};exports[_0x927b('0x4a')]=function(_0x3066a6,_0x4279c5){return db[_0x927b('0x40')]['find']({'where':{'id':_0x3066a6[_0x927b('0x45')]['id']}})[_0x927b('0x25')](handleEntityNotFound(_0x4279c5,null))[_0x927b('0x25')](removeEntity(_0x4279c5,null))['catch'](handleError(_0x4279c5,null));}; \ No newline at end of file +var _0xd228=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xd228,0x1c2));var _0x8d22=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xd228[_0x2cde0a];return _0x260610;};'use strict';var emlformat=require(_0x8d22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d22('0x1'));var jsonpatch=require(_0x8d22('0x2'));var rp=require(_0x8d22('0x3'));var moment=require(_0x8d22('0x4'));var BPromise=require(_0x8d22('0x5'));var Mustache=require('mustache');var util=require(_0x8d22('0x6'));var path=require(_0x8d22('0x7'));var sox=require('sox');var csv=require(_0x8d22('0x8'));var ejs=require(_0x8d22('0x9'));var fs=require('fs');var fs_extra=require(_0x8d22('0xa'));var _=require(_0x8d22('0xb'));var squel=require(_0x8d22('0xc'));var crypto=require(_0x8d22('0xd'));var jsforce=require(_0x8d22('0xe'));var deskjs=require(_0x8d22('0xf'));var toCsv=require(_0x8d22('0x8'));var querystring=require(_0x8d22('0x10'));var Papa=require(_0x8d22('0x11'));var Redis=require(_0x8d22('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8d22('0x13'));var as=require(_0x8d22('0x14'));var hardwareService=require(_0x8d22('0x15'));var logger=require('../../config/logger')(_0x8d22('0x16'));var utils=require('../../config/utils');var config=require(_0x8d22('0x17'));var licenseUtil=require(_0x8d22('0x18'));var db=require(_0x8d22('0x19'))['db'];function respondWithStatusCode(_0x15d01d,_0x1882ff){_0x1882ff=_0x1882ff||0xcc;return function(_0x950c00){if(_0x950c00){return _0x15d01d[_0x8d22('0x1a')](_0x1882ff);}return _0x15d01d[_0x8d22('0x1b')](_0x1882ff)[_0x8d22('0x1c')]();};}function respondWithResult(_0x15622b,_0x1ddbbe){_0x1ddbbe=_0x1ddbbe||0xc8;return function(_0x328585){if(_0x328585){return _0x15622b[_0x8d22('0x1b')](_0x1ddbbe)[_0x8d22('0x1d')](_0x328585);}};}function respondWithFilteredResult(_0x245a7c,_0x2c8b6a){return function(_0x35cccd){if(_0x35cccd){var _0x2ce412=typeof _0x2c8b6a[_0x8d22('0x1e')]===_0x8d22('0x1f')&&typeof _0x2c8b6a[_0x8d22('0x20')]===_0x8d22('0x1f');var _0x308851=_0x35cccd[_0x8d22('0x21')];var _0x21db1a=_0x2ce412?0x0:_0x2c8b6a[_0x8d22('0x1e')];var _0x2e0a13=_0x2ce412?_0x35cccd[_0x8d22('0x21')]:_0x2c8b6a['offset']+_0x2c8b6a[_0x8d22('0x20')];var _0x5b13bd;if(_0x2e0a13>=_0x308851){_0x2e0a13=_0x308851;_0x5b13bd=0xc8;}else{_0x5b13bd=0xce;}_0x245a7c[_0x8d22('0x1b')](_0x5b13bd);return _0x245a7c[_0x8d22('0x22')]('Content-Range',_0x21db1a+'-'+_0x2e0a13+'/'+_0x308851)[_0x8d22('0x1d')](_0x35cccd);}return null;};}function patchUpdates(_0x3c8c1c){return function(_0xa1c73f){try{jsonpatch['apply'](_0xa1c73f,_0x3c8c1c,!![]);}catch(_0x3e92b4){return BPromise[_0x8d22('0x23')](_0x3e92b4);}return _0xa1c73f[_0x8d22('0x24')]();};}function saveUpdates(_0x132296,_0x544171){return function(_0x555186){if(_0x555186){return _0x555186[_0x8d22('0x25')](_0x132296)[_0x8d22('0x26')](function(_0x4bfe90){return _0x4bfe90;});}return null;};}function removeEntity(_0x4c9910,_0x1ed30c){return function(_0x5703ed){if(_0x5703ed){return _0x5703ed[_0x8d22('0x27')]()[_0x8d22('0x26')](function(){_0x4c9910['status'](0xcc)[_0x8d22('0x1c')]();});}};}function handleEntityNotFound(_0xb1dbae,_0x4b8262){return function(_0x2a327c){if(!_0x2a327c){_0xb1dbae[_0x8d22('0x1a')](0x194);}return _0x2a327c;};}function handleError(_0x259aa2,_0xa8de46){_0xa8de46=_0xa8de46||0x1f4;return function(_0xa660f6){logger[_0x8d22('0x28')](_0xa660f6[_0x8d22('0x29')]);if(_0xa660f6[_0x8d22('0x2a')]){delete _0xa660f6[_0x8d22('0x2a')];}_0x259aa2[_0x8d22('0x1b')](_0xa8de46)[_0x8d22('0x2b')](_0xa660f6);};}exports[_0x8d22('0x2c')]=function(_0xe4888,_0x2e2250){var _0x2233a3={},_0x4f0b41={},_0x4d2537={'count':0x0,'rows':[]};var _0x2d123f=_[_0x8d22('0x2d')](db[_0x8d22('0x2e')][_0x8d22('0x2f')],function(_0x3e9546){return{'name':_0x3e9546[_0x8d22('0x30')],'type':_0x3e9546[_0x8d22('0x31')][_0x8d22('0x32')]};});_0x4f0b41[_0x8d22('0x33')]=_[_0x8d22('0x2d')](_0x2d123f,_0x8d22('0x2a'));_0x4f0b41[_0x8d22('0x34')]=_[_0x8d22('0x35')](_0xe4888['query']);_0x4f0b41[_0x8d22('0x36')]=_[_0x8d22('0x37')](_0x4f0b41[_0x8d22('0x33')],_0x4f0b41[_0x8d22('0x34')]);_0x2233a3[_0x8d22('0x38')]=_[_0x8d22('0x37')](_0x4f0b41[_0x8d22('0x33')],qs[_0x8d22('0x39')](_0xe4888[_0x8d22('0x34')][_0x8d22('0x39')]));_0x2233a3['attributes']=_0x2233a3[_0x8d22('0x38')][_0x8d22('0x3a')]?_0x2233a3[_0x8d22('0x38')]:_0x4f0b41[_0x8d22('0x33')];if(!_0xe4888[_0x8d22('0x34')]['hasOwnProperty'](_0x8d22('0x3b'))){_0x2233a3['limit']=qs[_0x8d22('0x20')](_0xe4888[_0x8d22('0x34')]['limit']);_0x2233a3[_0x8d22('0x1e')]=qs[_0x8d22('0x1e')](_0xe4888[_0x8d22('0x34')][_0x8d22('0x1e')]);}_0x2233a3[_0x8d22('0x3c')]=qs['sort'](_0xe4888[_0x8d22('0x34')][_0x8d22('0x3d')]);_0x2233a3[_0x8d22('0x3e')]=qs[_0x8d22('0x36')](_['pick'](_0xe4888[_0x8d22('0x34')],_0x4f0b41[_0x8d22('0x36')]),_0x2d123f);if(_0xe4888['query'][_0x8d22('0x3f')]){_0x2233a3[_0x8d22('0x3e')]=_[_0x8d22('0x40')](_0x2233a3[_0x8d22('0x3e')],{'$or':_[_0x8d22('0x2d')](_0x2d123f,function(_0x4e371a){if(_0x4e371a[_0x8d22('0x31')]!=='VIRTUAL'){var _0x285ebe={};_0x285ebe[_0x4e371a[_0x8d22('0x2a')]]={'$like':'%'+_0xe4888[_0x8d22('0x34')][_0x8d22('0x3f')]+'%'};return _0x285ebe;}})});}_0x2233a3=_[_0x8d22('0x40')]({},_0x2233a3,_0xe4888[_0x8d22('0x41')]);var _0x455929={'where':_0x2233a3['where']};return db['SalesforceField'][_0x8d22('0x21')](_0x455929)[_0x8d22('0x26')](function(_0x58033c){_0x4d2537[_0x8d22('0x21')]=_0x58033c;if(_0xe4888[_0x8d22('0x34')][_0x8d22('0x42')]){_0x2233a3[_0x8d22('0x43')]=[{'all':!![]}];}return db[_0x8d22('0x2e')][_0x8d22('0x44')](_0x2233a3);})[_0x8d22('0x26')](function(_0x1ee757){_0x4d2537[_0x8d22('0x45')]=_0x1ee757;return _0x4d2537;})[_0x8d22('0x26')](respondWithFilteredResult(_0x2e2250,_0x2233a3))[_0x8d22('0x46')](handleError(_0x2e2250,null));};exports['show']=function(_0x380209,_0x9fee67){var _0x4f7a11={'raw':!![],'where':{'id':_0x380209[_0x8d22('0x47')]['id']}},_0x5261ca={};_0x5261ca[_0x8d22('0x33')]=_[_0x8d22('0x35')](db[_0x8d22('0x2e')][_0x8d22('0x2f')]);_0x5261ca[_0x8d22('0x34')]=_[_0x8d22('0x35')](_0x380209['query']);_0x5261ca[_0x8d22('0x36')]=_['intersection'](_0x5261ca[_0x8d22('0x33')],_0x5261ca['query']);_0x4f7a11['attributes']=_[_0x8d22('0x37')](_0x5261ca[_0x8d22('0x33')],qs['fields'](_0x380209[_0x8d22('0x34')][_0x8d22('0x39')]));_0x4f7a11[_0x8d22('0x38')]=_0x4f7a11['attributes'][_0x8d22('0x3a')]?_0x4f7a11[_0x8d22('0x38')]:_0x5261ca[_0x8d22('0x33')];if(_0x380209[_0x8d22('0x34')]['includeAll']){_0x4f7a11[_0x8d22('0x43')]=[{'all':!![]}];}_0x4f7a11=_['merge']({},_0x4f7a11,_0x380209[_0x8d22('0x41')]);return db[_0x8d22('0x2e')][_0x8d22('0x48')](_0x4f7a11)['then'](handleEntityNotFound(_0x9fee67,null))['then'](respondWithResult(_0x9fee67,null))[_0x8d22('0x46')](handleError(_0x9fee67,null));};exports[_0x8d22('0x49')]=function(_0x1d7cc8,_0x2f1a58){return db[_0x8d22('0x2e')][_0x8d22('0x49')](_0x1d7cc8['body'],{})[_0x8d22('0x26')](respondWithResult(_0x2f1a58,0xc9))[_0x8d22('0x46')](handleError(_0x2f1a58,null));};exports[_0x8d22('0x25')]=function(_0xe89be2,_0x517422){if(_0xe89be2[_0x8d22('0x4a')]['id']){delete _0xe89be2[_0x8d22('0x4a')]['id'];}return db[_0x8d22('0x2e')]['find']({'where':{'id':_0xe89be2['params']['id']}})[_0x8d22('0x26')](handleEntityNotFound(_0x517422,null))[_0x8d22('0x26')](saveUpdates(_0xe89be2[_0x8d22('0x4a')],null))[_0x8d22('0x26')](respondWithResult(_0x517422,null))[_0x8d22('0x46')](handleError(_0x517422,null));};exports[_0x8d22('0x27')]=function(_0xec5931,_0x29f66d){return db[_0x8d22('0x2e')]['find']({'where':{'id':_0xec5931[_0x8d22('0x47')]['id']}})['then'](handleEntityNotFound(_0x29f66d,null))[_0x8d22('0x26')](removeEntity(_0x29f66d,null))[_0x8d22('0x46')](handleError(_0x29f66d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1372afe..cd75857 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 _0x784b=['path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x784b,0x72));var _0xb784=function(_0x24b78f,_0x54f900){_0x24b78f=_0x24b78f-0x0;var _0x44f631=_0x784b[_0x24b78f];return _0x44f631;};'use strict';var _=require('lodash');var util=require(_0xb784('0x0'));var logger=require(_0xb784('0x1'))(_0xb784('0x2'));var moment=require(_0xb784('0x3'));var BPromise=require(_0xb784('0x4'));var rp=require(_0xb784('0x5'));var fs=require('fs');var path=require(_0xb784('0x6'));var rimraf=require(_0xb784('0x7'));var config=require('../../config/environment');var attributes=require(_0xb784('0x8'));module[_0xb784('0x9')]=function(_0x2fb10d,_0x246d74){return _0x2fb10d[_0xb784('0xa')](_0xb784('0xb'),attributes,{'tableName':_0xb784('0xc'),'paranoid':![],'indexes':[{'name':_0xb784('0xd'),'fields':[_0xb784('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8b3d=['idField','FieldId','util','../../config/logger','api','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index'];(function(_0x1857ec,_0x5d560e){var _0x278624=function(_0x4f92c6){while(--_0x4f92c6){_0x1857ec['push'](_0x1857ec['shift']());}};_0x278624(++_0x5d560e);}(_0x8b3d,0x1b2));var _0xd8b3=function(_0x11af5d,_0x565c5a){_0x11af5d=_0x11af5d-0x0;var _0x56a580=_0x8b3d[_0x11af5d];return _0x56a580;};'use strict';var _=require('lodash');var util=require(_0xd8b3('0x0'));var logger=require(_0xd8b3('0x1'))(_0xd8b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8b3('0x3'));var fs=require('fs');var path=require(_0xd8b3('0x4'));var rimraf=require('rimraf');var config=require(_0xd8b3('0x5'));var attributes=require(_0xd8b3('0x6'));module[_0xd8b3('0x7')]=function(_0x47376f,_0x27c240){return _0x47376f['define'](_0xd8b3('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xd8b3('0x9'),'fields':[_0xd8b3('0xa'),_0xd8b3('0xb')],'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 697e912..09f716c 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 _0x6be8=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x564336,_0x30e3aa){var _0x45d7bb=function(_0x41602b){while(--_0x41602b){_0x564336['push'](_0x564336['shift']());}};_0x45d7bb(++_0x30e3aa);}(_0x6be8,0x111));var _0x86be=function(_0xdc1af4,_0x4ed6f1){_0xdc1af4=_0xdc1af4-0x0;var _0x231abb=_0x6be8[_0xdc1af4];return _0x231abb;};'use strict';var _=require(_0x86be('0x0'));var util=require(_0x86be('0x1'));var moment=require(_0x86be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86be('0x3'));var db=require(_0x86be('0x4'))['db'];var utils=require(_0x86be('0x5'));var logger=require(_0x86be('0x6'))(_0x86be('0x7'));var config=require(_0x86be('0x8'));var jayson=require(_0x86be('0x9'));var client=jayson[_0x86be('0xa')][_0x86be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a8c0f,_0x22cfca,_0x22730e){return new BPromise(function(_0x5f0005,_0x37dbac){return client[_0x86be('0xc')](_0x2a8c0f,_0x22730e)[_0x86be('0xd')](function(_0x5d13eb){logger[_0x86be('0xe')](_0x86be('0xf'),_0x22cfca,'request\x20sent');logger[_0x86be('0x10')](_0x86be('0x11'),_0x22cfca,_0x86be('0x12'),JSON[_0x86be('0x13')](_0x5d13eb));if(_0x5d13eb[_0x86be('0x14')]){if(_0x5d13eb['error'][_0x86be('0x15')]===0x1f4){logger[_0x86be('0x14')]('SalesforceField,\x20%s,\x20%s',_0x22cfca,_0x5d13eb['error'][_0x86be('0x16')]);return _0x37dbac(_0x5d13eb[_0x86be('0x14')][_0x86be('0x16')]);}logger[_0x86be('0x14')](_0x86be('0xf'),_0x22cfca,_0x5d13eb[_0x86be('0x14')][_0x86be('0x16')]);return _0x5f0005(_0x5d13eb[_0x86be('0x14')]['message']);}else{logger[_0x86be('0xe')]('SalesforceField,\x20%s,\x20%s',_0x22cfca,_0x86be('0x12'));_0x5f0005(_0x5d13eb[_0x86be('0x17')]['message']);}})[_0x86be('0x18')](function(_0xb478db){logger[_0x86be('0x14')]('SalesforceField,\x20%s,\x20%s',_0x22cfca,_0xb478db);_0x37dbac(_0xb478db);});});} \ No newline at end of file +var _0xca8e=['info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','code','error','SalesforceField,\x20%s,\x20%s','message'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xca8e,0x18a));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xeca8('0x0'));var moment=require(_0xeca8('0x1'));var BPromise=require('bluebird');var rs=require(_0xeca8('0x2'));var fs=require('fs');var Redis=require(_0xeca8('0x3'));var db=require(_0xeca8('0x4'))['db'];var utils=require(_0xeca8('0x5'));var logger=require(_0xeca8('0x6'))(_0xeca8('0x7'));var config=require(_0xeca8('0x8'));var jayson=require(_0xeca8('0x9'));var client=jayson[_0xeca8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x181ff8,_0x181342,_0x5446a6){return new BPromise(function(_0x10f4ae,_0x5519f9){return client[_0xeca8('0xb')](_0x181ff8,_0x5446a6)[_0xeca8('0xc')](function(_0x40c80b){logger['info']('SalesforceField,\x20%s,\x20%s',_0x181342,_0xeca8('0xd'));logger[_0xeca8('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x181342,_0xeca8('0xd'),JSON[_0xeca8('0xf')](_0x40c80b));if(_0x40c80b['error']){if(_0x40c80b['error'][_0xeca8('0x10')]===0x1f4){logger[_0xeca8('0x11')](_0xeca8('0x12'),_0x181342,_0x40c80b['error']['message']);return _0x5519f9(_0x40c80b[_0xeca8('0x11')]['message']);}logger[_0xeca8('0x11')]('SalesforceField,\x20%s,\x20%s',_0x181342,_0x40c80b['error'][_0xeca8('0x13')]);return _0x10f4ae(_0x40c80b['error'][_0xeca8('0x13')]);}else{logger[_0xeca8('0x14')](_0xeca8('0x12'),_0x181342,_0xeca8('0xd'));_0x10f4ae(_0x40c80b[_0xeca8('0x15')][_0xeca8('0x13')]);}})[_0xeca8('0x16')](function(_0x48acbd){logger[_0xeca8('0x11')](_0xeca8('0x12'),_0x181342,_0x48acbd);_0x5519f9(_0x48acbd);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0448f3e..2bf8512 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 _0x9189=['path','connect-timeout','express','Router','../../components/auth/service','./intServicenowAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getFields','post','create','addConfiguration','put','update','destroy'];(function(_0x177a01,_0x525be9){var _0x2f5f3b=function(_0x25a342){while(--_0x25a342){_0x177a01['push'](_0x177a01['shift']());}};_0x2f5f3b(++_0x525be9);}(_0x9189,0x1b0));var _0x9918=function(_0x37ff1d,_0x455c85){_0x37ff1d=_0x37ff1d-0x0;var _0x5f41bd=_0x9189[_0x37ff1d];return _0x5f41bd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9918('0x0'));var timeout=require(_0x9918('0x1'));var express=require(_0x9918('0x2'));var router=express[_0x9918('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9918('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9918('0x5'));router[_0x9918('0x6')]('/',auth['isAuthenticated'](),controller[_0x9918('0x7')]);router[_0x9918('0x6')](_0x9918('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9918('0x9'),auth[_0x9918('0xa')](),controller['getConfigurations']);router[_0x9918('0x6')]('/:id/fields',auth[_0x9918('0xa')](),controller[_0x9918('0xb')]);router[_0x9918('0xc')]('/',auth[_0x9918('0xa')](),controller[_0x9918('0xd')]);router[_0x9918('0xc')](_0x9918('0x9'),auth['isAuthenticated'](),controller[_0x9918('0xe')]);router[_0x9918('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9918('0x10')]);router['delete']('/:id',auth[_0x9918('0xa')](),controller[_0x9918('0x11')]);module['exports']=router; \ No newline at end of file +var _0x89e3=['getFields','post','create','/:id/configurations','addConfiguration','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields'];(function(_0x44709b,_0x1cfbf1){var _0x47cd92=function(_0x492705){while(--_0x492705){_0x44709b['push'](_0x44709b['shift']());}};_0x47cd92(++_0x1cfbf1);}(_0x89e3,0x66));var _0x389e=function(_0x197e75,_0x531849){_0x197e75=_0x197e75-0x0;var _0x6ecdc8=_0x89e3[_0x197e75];return _0x6ecdc8;};'use strict';var multer=require('multer');var util=require(_0x389e('0x0'));var path=require(_0x389e('0x1'));var timeout=require(_0x389e('0x2'));var express=require(_0x389e('0x3'));var router=express['Router']();var fs_extra=require(_0x389e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x389e('0x5'));var controller=require(_0x389e('0x6'));router[_0x389e('0x7')]('/',auth[_0x389e('0x8')](),controller[_0x389e('0x9')]);router[_0x389e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x389e('0xa')]);router[_0x389e('0x7')]('/:id/configurations',auth[_0x389e('0x8')](),controller[_0x389e('0xb')]);router[_0x389e('0x7')](_0x389e('0xc'),auth[_0x389e('0x8')](),controller[_0x389e('0xd')]);router[_0x389e('0xe')]('/',auth[_0x389e('0x8')](),controller[_0x389e('0xf')]);router[_0x389e('0xe')](_0x389e('0x10'),auth['isAuthenticated'](),controller[_0x389e('0x11')]);router['put']('/:id',auth[_0x389e('0x8')](),controller[_0x389e('0x12')]);router[_0x389e('0x13')](_0x389e('0x14'),auth[_0x389e('0x8')](),controller[_0x389e('0x15')]);module[_0x389e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 3a879ee..5188e85 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 _0x38b3=['exports','username','STRING','remoteUri'];(function(_0x90f0c5,_0x29bdea){var _0x3da034=function(_0x3d62df){while(--_0x3d62df){_0x90f0c5['push'](_0x90f0c5['shift']());}};_0x3da034(++_0x29bdea);}(_0x38b3,0x15c));var _0x338b=function(_0x3544fd,_0x7c6e0){_0x3544fd=_0x3544fd-0x0;var _0x56e748=_0x38b3[_0x3544fd];return _0x56e748;};'use strict';var Sequelize=require('sequelize');module[_0x338b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x338b('0x1')},'password':{'type':Sequelize[_0x338b('0x2')]},'email':{'type':Sequelize[_0x338b('0x2')]},'remoteUri':{'type':Sequelize[_0x338b('0x2')],'unique':_0x338b('0x3')},'serverUrl':{'type':Sequelize[_0x338b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0030=['exports','STRING'];(function(_0x1b2ab9,_0x5587b5){var _0x52e753=function(_0x47be7a){while(--_0x47be7a){_0x1b2ab9['push'](_0x1b2ab9['shift']());}};_0x52e753(++_0x5587b5);}(_0x0030,0x118));var _0x0003=function(_0x4999c9,_0x331bed){_0x4999c9=_0x4999c9-0x0;var _0x5428a9=_0x0030[_0x4999c9];return _0x5428a9;};'use strict';var Sequelize=require('sequelize');module[_0x0003('0x0')]={'name':{'type':Sequelize[_0x0003('0x1')]},'description':{'type':Sequelize[_0x0003('0x1')]},'username':{'type':Sequelize[_0x0003('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0003('0x1')]},'email':{'type':Sequelize[_0x0003('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0003('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 b3f2b35..ae16c0d 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 _0xa52c=['Subjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','follow_up','parent_incident','sys_id','reopened_by','problem_id','reassignment_count','activity_due','comments','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','boolean','True','true','false','inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','fs-extra','lodash','squel','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','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','ServicenowAccount','include','findAll','rows','catch','show','keys','options','find','create','body','update','destroy','getConfigurations','findOne','params','addConfiguration','AccountId'];(function(_0x1f1353,_0x105629){var _0x19041e=function(_0x22a3b7){while(--_0x22a3b7){_0x1f1353['push'](_0x1f1353['shift']());}};_0x19041e(++_0x105629);}(_0xa52c,0x67));var _0xca52=function(_0x2b4e26,_0x23ca91){_0x2b4e26=_0x2b4e26-0x0;var _0x5a50f0=_0xa52c[_0x2b4e26];return _0x5a50f0;};'use strict';var emlformat=require(_0xca52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca52('0x1'));var jsonpatch=require(_0xca52('0x2'));var rp=require('request-promise');var moment=require(_0xca52('0x3'));var BPromise=require(_0xca52('0x4'));var Mustache=require(_0xca52('0x5'));var util=require('util');var path=require(_0xca52('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca52('0x7'));var _=require(_0xca52('0x8'));var squel=require(_0xca52('0x9'));var crypto=require('crypto');var jsforce=require(_0xca52('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xca52('0xb'));var querystring=require(_0xca52('0xc'));var Papa=require(_0xca52('0xd'));var Redis=require(_0xca52('0xe'));var authService=require(_0xca52('0xf'));var qs=require(_0xca52('0x10'));var as=require(_0xca52('0x11'));var hardwareService=require(_0xca52('0x12'));var logger=require(_0xca52('0x13'))(_0xca52('0x14'));var utils=require(_0xca52('0x15'));var config=require(_0xca52('0x16'));var licenseUtil=require(_0xca52('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xca52('0x18'));function respondWithStatusCode(_0x40699f,_0x5a148f){_0x5a148f=_0x5a148f||0xcc;return function(_0x58278e){if(_0x58278e){return _0x40699f[_0xca52('0x19')](_0x5a148f);}return _0x40699f['status'](_0x5a148f)[_0xca52('0x1a')]();};}function respondWithResult(_0x5148c1,_0x24e8e0){_0x24e8e0=_0x24e8e0||0xc8;return function(_0x2557d0){if(_0x2557d0){return _0x5148c1[_0xca52('0x1b')](_0x24e8e0)['json'](_0x2557d0);}};}function respondWithFilteredResult(_0x1e1e36,_0x1bc245){return function(_0x344078){if(_0x344078){var _0x4a151b=typeof _0x1bc245[_0xca52('0x1c')]===_0xca52('0x1d')&&typeof _0x1bc245[_0xca52('0x1e')]==='undefined';var _0x158ea8=_0x344078[_0xca52('0x1f')];var _0x5d0c9d=_0x4a151b?0x0:_0x1bc245['offset'];var _0x199ef2=_0x4a151b?_0x344078[_0xca52('0x1f')]:_0x1bc245[_0xca52('0x1c')]+_0x1bc245[_0xca52('0x1e')];var _0x382e4e;if(_0x199ef2>=_0x158ea8){_0x199ef2=_0x158ea8;_0x382e4e=0xc8;}else{_0x382e4e=0xce;}_0x1e1e36['status'](_0x382e4e);return _0x1e1e36['set'](_0xca52('0x20'),_0x5d0c9d+'-'+_0x199ef2+'/'+_0x158ea8)[_0xca52('0x21')](_0x344078);}return null;};}function patchUpdates(_0x419bbb){return function(_0x5a9a9a){try{jsonpatch[_0xca52('0x22')](_0x5a9a9a,_0x419bbb,!![]);}catch(_0x56f0a5){return BPromise[_0xca52('0x23')](_0x56f0a5);}return _0x5a9a9a['save']();};}function saveUpdates(_0x2c9267,_0x46830c){return function(_0x5d01f3){if(_0x5d01f3){return _0x5d01f3['update'](_0x2c9267)[_0xca52('0x24')](function(_0x1a7d2f){return _0x1a7d2f;});}return null;};}function removeEntity(_0x2912f0,_0x223026){return function(_0x15081f){if(_0x15081f){return _0x15081f['destroy']()[_0xca52('0x24')](function(){_0x2912f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aa5d1,_0x152ece){return function(_0x11d0ef){if(!_0x11d0ef){_0x2aa5d1[_0xca52('0x19')](0x194);}return _0x11d0ef;};}function handleError(_0x733910,_0x168006){_0x168006=_0x168006||0x1f4;return function(_0x3a0de0){logger[_0xca52('0x25')](_0x3a0de0[_0xca52('0x26')]);if(_0x3a0de0[_0xca52('0x27')]){delete _0x3a0de0[_0xca52('0x27')];}_0x733910['status'](_0x168006)[_0xca52('0x28')](_0x3a0de0);};}exports[_0xca52('0x29')]=function(_0x1a0bbf,_0x768c63){var _0x503dd3={},_0x4d4e43={},_0x1f3b95={'count':0x0,'rows':[]};var _0x3a2e85=_['map'](db['ServicenowAccount'][_0xca52('0x2a')],function(_0x35c770){return{'name':_0x35c770[_0xca52('0x2b')],'type':_0x35c770[_0xca52('0x2c')][_0xca52('0x2d')]};});_0x4d4e43[_0xca52('0x2e')]=_[_0xca52('0x2f')](_0x3a2e85,_0xca52('0x27'));_0x4d4e43[_0xca52('0x30')]=_['keys'](_0x1a0bbf[_0xca52('0x30')]);_0x4d4e43[_0xca52('0x31')]=_[_0xca52('0x32')](_0x4d4e43[_0xca52('0x2e')],_0x4d4e43[_0xca52('0x30')]);_0x503dd3[_0xca52('0x33')]=_['intersection'](_0x4d4e43['model'],qs[_0xca52('0x34')](_0x1a0bbf[_0xca52('0x30')][_0xca52('0x34')]));_0x503dd3[_0xca52('0x33')]=_0x503dd3[_0xca52('0x33')][_0xca52('0x35')]?_0x503dd3[_0xca52('0x33')]:_0x4d4e43[_0xca52('0x2e')];if(!_0x1a0bbf[_0xca52('0x30')]['hasOwnProperty'](_0xca52('0x36'))){_0x503dd3['limit']=qs[_0xca52('0x1e')](_0x1a0bbf['query'][_0xca52('0x1e')]);_0x503dd3[_0xca52('0x1c')]=qs[_0xca52('0x1c')](_0x1a0bbf['query'][_0xca52('0x1c')]);}_0x503dd3[_0xca52('0x37')]=qs[_0xca52('0x38')](_0x1a0bbf['query']['sort']);_0x503dd3['where']=qs[_0xca52('0x31')](_[_0xca52('0x39')](_0x1a0bbf[_0xca52('0x30')],_0x4d4e43[_0xca52('0x31')]),_0x3a2e85);if(_0x1a0bbf['query'][_0xca52('0x3a')]){_0x503dd3[_0xca52('0x3b')]=_[_0xca52('0x3c')](_0x503dd3[_0xca52('0x3b')],{'$or':_['map'](_0x3a2e85,function(_0xe7670){if(_0xe7670['type']!=='VIRTUAL'){var _0x5bbe4d={};_0x5bbe4d[_0xe7670['name']]={'$like':'%'+_0x1a0bbf[_0xca52('0x30')][_0xca52('0x3a')]+'%'};return _0x5bbe4d;}})});}_0x503dd3=_[_0xca52('0x3c')]({},_0x503dd3,_0x1a0bbf['options']);var _0x323c87={'where':_0x503dd3['where']};return db[_0xca52('0x3d')]['count'](_0x323c87)[_0xca52('0x24')](function(_0x15d643){_0x1f3b95['count']=_0x15d643;if(_0x1a0bbf['query']['includeAll']){_0x503dd3[_0xca52('0x3e')]=[{'all':!![]}];}return db[_0xca52('0x3d')][_0xca52('0x3f')](_0x503dd3);})[_0xca52('0x24')](function(_0x49a09e){_0x1f3b95[_0xca52('0x40')]=_0x49a09e;return _0x1f3b95;})[_0xca52('0x24')](respondWithFilteredResult(_0x768c63,_0x503dd3))[_0xca52('0x41')](handleError(_0x768c63,null));};exports[_0xca52('0x42')]=function(_0x2ea49d,_0x313fe0){var _0x5f0303={'raw':![],'where':{'id':_0x2ea49d['params']['id']}},_0x2ae9bc={};_0x2ae9bc[_0xca52('0x2e')]=_[_0xca52('0x43')](db[_0xca52('0x3d')][_0xca52('0x2a')]);_0x2ae9bc[_0xca52('0x30')]=_[_0xca52('0x43')](_0x2ea49d['query']);_0x2ae9bc[_0xca52('0x31')]=_[_0xca52('0x32')](_0x2ae9bc[_0xca52('0x2e')],_0x2ae9bc['query']);_0x5f0303[_0xca52('0x33')]=_[_0xca52('0x32')](_0x2ae9bc['model'],qs[_0xca52('0x34')](_0x2ea49d['query'][_0xca52('0x34')]));_0x5f0303[_0xca52('0x33')]=_0x5f0303[_0xca52('0x33')][_0xca52('0x35')]?_0x5f0303[_0xca52('0x33')]:_0x2ae9bc[_0xca52('0x2e')];if(_0x2ea49d[_0xca52('0x30')]['includeAll']){_0x5f0303[_0xca52('0x3e')]=[{'all':!![]}];}_0x5f0303=_[_0xca52('0x3c')]({},_0x5f0303,_0x2ea49d[_0xca52('0x44')]);return db['ServicenowAccount'][_0xca52('0x45')](_0x5f0303)[_0xca52('0x24')](handleEntityNotFound(_0x313fe0,null))['then'](respondWithResult(_0x313fe0,null))[_0xca52('0x41')](handleError(_0x313fe0,null));};exports[_0xca52('0x46')]=function(_0x31caf4,_0x241cdf){return db[_0xca52('0x3d')][_0xca52('0x46')](_0x31caf4[_0xca52('0x47')],{})['then'](respondWithResult(_0x241cdf,0xc9))['catch'](handleError(_0x241cdf,null));};exports[_0xca52('0x48')]=function(_0x28ed0e,_0x2caf5b){if(_0x28ed0e[_0xca52('0x47')]['id']){delete _0x28ed0e['body']['id'];}return db[_0xca52('0x3d')][_0xca52('0x45')]({'where':{'id':_0x28ed0e['params']['id']}})[_0xca52('0x24')](handleEntityNotFound(_0x2caf5b,null))[_0xca52('0x24')](saveUpdates(_0x28ed0e['body'],null))[_0xca52('0x24')](respondWithResult(_0x2caf5b,null))[_0xca52('0x41')](handleError(_0x2caf5b,null));};exports[_0xca52('0x49')]=function(_0x48f49f,_0x363354){return db[_0xca52('0x3d')]['find']({'where':{'id':_0x48f49f['params']['id']}})[_0xca52('0x24')](handleEntityNotFound(_0x363354,null))[_0xca52('0x24')](removeEntity(_0x363354,null))[_0xca52('0x41')](handleError(_0x363354,null));};exports[_0xca52('0x4a')]=function(_0x67c736,_0x23f084,_0x4138fe){var _0xc73b44={};var _0x212cef={};var _0x3ed971;var _0x2f665d;return db[_0xca52('0x3d')][_0xca52('0x4b')]({'where':{'id':_0x67c736[_0xca52('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23f084,null))['then'](function(_0x35a093){if(_0x35a093){_0x3ed971=_0x35a093;_0x212cef[_0xca52('0x2e')]=_[_0xca52('0x43')](db['ServicenowConfiguration'][_0xca52('0x2a')]);_0x212cef['query']=_[_0xca52('0x43')](_0x67c736['query']);_0x212cef[_0xca52('0x31')]=_[_0xca52('0x32')](_0x212cef[_0xca52('0x2e')],_0x212cef[_0xca52('0x30')]);_0xc73b44[_0xca52('0x33')]=_[_0xca52('0x32')](_0x212cef[_0xca52('0x2e')],qs[_0xca52('0x34')](_0x67c736[_0xca52('0x30')][_0xca52('0x34')]));_0xc73b44[_0xca52('0x33')]=_0xc73b44['attributes'][_0xca52('0x35')]?_0xc73b44['attributes']:_0x212cef[_0xca52('0x2e')];_0xc73b44[_0xca52('0x37')]=qs['sort'](_0x67c736[_0xca52('0x30')][_0xca52('0x38')]);_0xc73b44['where']=qs[_0xca52('0x31')](_[_0xca52('0x39')](_0x67c736[_0xca52('0x30')],_0x212cef[_0xca52('0x31')]));if(_0x67c736[_0xca52('0x30')]['filter']){_0xc73b44['where']=_[_0xca52('0x3c')](_0xc73b44[_0xca52('0x3b')],{'$or':_[_0xca52('0x2f')](_0xc73b44[_0xca52('0x33')],function(_0x3bf196){var _0x4b2eb1={};_0x4b2eb1[_0x3bf196]={'$like':'%'+_0x67c736[_0xca52('0x30')][_0xca52('0x3a')]+'%'};return _0x4b2eb1;})});}_0xc73b44=_[_0xca52('0x3c')]({},_0xc73b44,_0x67c736[_0xca52('0x44')]);return _0x3ed971['getConfigurations'](_0xc73b44);}})[_0xca52('0x24')](function(_0xfc7e81){if(_0xfc7e81){_0x2f665d=_0xfc7e81[_0xca52('0x35')];if(!_0x67c736[_0xca52('0x30')]['hasOwnProperty'](_0xca52('0x36'))){_0xc73b44[_0xca52('0x1e')]=qs[_0xca52('0x1e')](_0x67c736[_0xca52('0x30')][_0xca52('0x1e')]);_0xc73b44[_0xca52('0x1c')]=qs[_0xca52('0x1c')](_0x67c736[_0xca52('0x30')][_0xca52('0x1c')]);}return _0x3ed971[_0xca52('0x4a')](_0xc73b44);}})[_0xca52('0x24')](function(_0x55f214){if(_0x55f214){return _0x55f214?{'count':_0x2f665d,'rows':_0x55f214}:null;}})[_0xca52('0x24')](respondWithResult(_0x23f084,null))[_0xca52('0x41')](handleError(_0x23f084,null));};exports[_0xca52('0x4d')]=function(_0xfe5791,_0x458371,_0x4ecf77){if(_0xfe5791[_0xca52('0x47')]['id']){delete _0xfe5791['body']['id'];}return db[_0xca52('0x3d')][_0xca52('0x4b')]({'where':{'id':_0xfe5791[_0xca52('0x4c')]['id']}})[_0xca52('0x24')](handleEntityNotFound(_0x458371,null))[_0xca52('0x24')](function(_0x17ba42){if(_0x17ba42){_0xfe5791[_0xca52('0x47')][_0xca52('0x4e')]=_0x17ba42['id'];_0xfe5791[_0xca52('0x47')][_0xca52('0x4f')]=integrations['getSubjects'](_0xfe5791[_0xca52('0x47')][_0xca52('0x50')],_0xfe5791[_0xca52('0x47')][_0xca52('0x2c')]);_0xfe5791[_0xca52('0x47')][_0xca52('0x51')]=integrations['getDescriptions'](_0xfe5791[_0xca52('0x47')]['channel'],_0xfe5791[_0xca52('0x47')][_0xca52('0x2c')]);return db[_0xca52('0x52')][_0xca52('0x46')](_0xfe5791[_0xca52('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0xca52('0x4f')},{'model':db[_0xca52('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x458371,null))[_0xca52('0x41')](handleError(_0x458371,null));};exports['getFields']=function(_0x119d46,_0x18973b,_0xe91370){var _0x216920=[_0xca52('0x54'),_0xca52('0x55'),_0xca52('0x56'),_0xca52('0x57'),'close_code',_0xca52('0x58'),_0xca52('0x59'),_0xca52('0x5a'),'category'];var _0x1e33cc=[_0xca52('0x5b'),_0xca52('0x54'),_0xca52('0x5c'),_0xca52('0x5d'),_0xca52('0x5e'),_0xca52('0x5f'),_0xca52('0x60'),_0xca52('0x55'),_0xca52('0x61'),'number',_0xca52('0x62'),_0xca52('0x63'),'opened_by',_0xca52('0x64'),_0xca52('0x65'),_0xca52('0x66'),_0xca52('0x67'),_0xca52('0x68'),_0xca52('0x56'),'order',_0xca52('0x69'),_0xca52('0x6a'),_0xca52('0x6b'),_0xca52('0x6c'),_0xca52('0x6d'),_0xca52('0x6e'),_0xca52('0x6f'),_0xca52('0x70'),_0xca52('0x71'),'sys_domain_path',_0xca52('0x72'),_0xca52('0x73'),_0xca52('0x74'),_0xca52('0x75'),'business_duration',_0xca52('0x76'),_0xca52('0x77'),_0xca52('0x78'),_0xca52('0x79'),_0xca52('0x7a'),_0xca52('0x7b'),_0xca52('0x57'),_0xca52('0x7c'),_0xca52('0x7d'),_0xca52('0x7e'),_0xca52('0x7f'),_0xca52('0x80'),'work_start',_0xca52('0x81'),_0xca52('0x82'),_0xca52('0x83'),_0xca52('0x84'),'calendar_duration',_0xca52('0x58'),_0xca52('0x85'),'close_notes','closed_by',_0xca52('0x86'),_0xca52('0x87'),_0xca52('0x88'),'contact_type',_0xca52('0x89'),_0xca52('0x59'),'urgency',_0xca52('0x8a'),'company',_0xca52('0x8b'),_0xca52('0x8c'),'assigned_to',_0xca52('0x5a'),_0xca52('0x8d'),_0xca52('0x8e'),'approval','comments_and_work_notes',_0xca52('0x8f'),_0xca52('0x90'),_0xca52('0x91'),_0xca52('0x92'),'escalation',_0xca52('0x93'),_0xca52('0x94'),_0xca52('0x95'),'category'];var _0xb2ade9='';var _0x481526='';var _0x1efaec=[];var _0x25e987='';var _0x197ca2='';var _0x75d60b=[];var _0x701501='';var _0x2d08d9='';var _0x1fa791={};var _0x1655a4='';return db[_0xca52('0x3d')][_0xca52('0x4b')]({'where':{'id':_0x119d46['params']['id']},'attributes':['id',_0xca52('0x96'),_0xca52('0x97'),_0xca52('0x98'),_0xca52('0x99'),'serverUrl']})[_0xca52('0x24')](handleEntityNotFound(_0x18973b,null))['then'](function(_0x261422){if(_0x261422){_0x1655a4=_0x261422[_0xca52('0x99')];var _0x2a42c0=_0x1655a4['slice'](-0x1);if(_0x2a42c0==='/'){_0x1655a4=_0x1655a4['substring'](0x0,_0x1655a4[_0xca52('0x9a')](_0x2a42c0));}_0x2d08d9=util[_0xca52('0x9b')](_0xca52('0x9c'),_0x1655a4);_0x701501=util[_0xca52('0x9b')](_0xca52('0x9d'),_0x1655a4);_0x1fa791={'user':_0x261422[_0xca52('0x96')],'pass':_0x261422[_0xca52('0x97')]};var _0x1a3d1f={'method':_0xca52('0x9e'),'uri':_0x2d08d9+_0xca52('0x9f'),'auth':_0x1fa791,'json':!![]};return rp(_0x1a3d1f);}})['then'](function(_0x4a6073){if(_0x4a6073[_0xca52('0xa0')][_0xca52('0x35')]>0x0){_0xb2ade9=_0x4a6073[_0xca52('0xa0')];}console['log'](_0xca52('0xa1'),_0xb2ade9);_0x75d60b=[];_0x481526=Object[_0xca52('0xa2')]([],_0xb2ade9);_[_0xca52('0xa3')](_0x481526,function(_0x6be93d){return!_0x216920[_0xca52('0xa4')](_0x6be93d['name']);});_0x481526[_0xca52('0xa5')](function(_0x124c9e){var _0x144927=createFieldObject(_0x701501,_0x1fa791,_0x124c9e[_0xca52('0xa6')],_0x124c9e[_0xca52('0x27')],_0x124c9e['label'],![]);_0x75d60b[_0xca52('0xa7')](_0x144927);});return Promise[_0xca52('0xa8')](_0x75d60b);})[_0xca52('0x24')](function(_0x3e9397){_0x1efaec=_0x3e9397;_0x25e987=Object[_0xca52('0xa2')]([],_0xb2ade9);console['log'](_0xca52('0xa9'),_0xb2ade9);_['remove'](_0x25e987,function(_0x505b41){return _0x1e33cc[_0xca52('0xa4')](_0x505b41[_0xca52('0x27')]);});console[_0xca52('0xaa')](_0xca52('0xab'),_0x25e987);_0x75d60b=[];_0x25e987['forEach'](function(_0x22fcbe){var _0x2f0e9e=createFieldObject(_0x701501,_0x1fa791,_0x22fcbe[_0xca52('0xa6')],_0x22fcbe[_0xca52('0x27')],_0x22fcbe[_0xca52('0xac')],!![]);_0x75d60b[_0xca52('0xa7')](_0x2f0e9e);});return Promise[_0xca52('0xa8')](_0x75d60b);})[_0xca52('0x24')](function(_0x2da08b){_0x197ca2=_0x2da08b;var _0x5b646c=_0x1efaec[_0xca52('0xad')](_0x197ca2);return{'count':_0x5b646c[_0xca52('0x35')],'rows':_0x5b646c};})['then'](respondWithResult(_0x18973b,null))[_0xca52('0x41')](function(_0x316ea2){console['log'](_0xca52('0xae')+_0x316ea2);var _0x32ac41=_0x119d46[_0xca52('0x30')]['test']?0x1f4:_0x316ea2['statusCode']||0x1f4;logger['error'](_0x316ea2['stack']);delete _0x316ea2[_0xca52('0x27')];if(_0x32ac41===0x191){_0x32ac41=0x190;}_0x18973b['status'](_0x32ac41)[_0xca52('0x28')](_0x119d46[_0xca52('0x30')][_0xca52('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x316ea2['statusCode']}:_0x316ea2);});};function createFieldObject(_0x13b014,_0x400475,_0x2e397b,_0x3e497e,_0x115a2a,_0x3350a5){return new Promise(function(_0x3a5db7,_0x2da2f5){var _0x39ec80={'id':_0x3e497e,'name':_0x115a2a,'custom':_0x3350a5};if(_0x2e397b===_0xca52('0xb0')){_0x39ec80[_0xca52('0x44')]=[{'name':_0xca52('0xb1'),'value':_0xca52('0xb2')},{'name':'False','value':_0xca52('0xb3')}];_0x3a5db7(_0x39ec80);}else{var _0x180c95={'method':_0xca52('0x9e'),'uri':_0x13b014+'sys_choice?sysparm_query=name=incident^element='+_0x3e497e,'auth':_0x400475,'json':!![]};return rp(_0x180c95)[_0xca52('0x24')](function(_0x7482bd){var _0x4cb648=[];if(_0x7482bd[_0xca52('0xa0')][_0xca52('0x35')]>0x0){_0x7482bd[_0xca52('0xa0')]['forEach'](function(_0x519d19){if(_0x519d19[_0xca52('0xb4')]===_0xca52('0xb3')){var _0x4c5971={'name':_0x519d19['label'],'value':_0x519d19[_0xca52('0xb5')]};_0x4cb648['push'](_0x4c5971);}});}_0x39ec80[_0xca52('0x44')]=_0x4cb648;if(_0x39ec80[_0xca52('0x44')][_0xca52('0x35')]>0x0){_0x3a5db7(_0x39ec80);}else{if(_0x3350a5==![]){_0x3a5db7();}else{_0x3a5db7(_0x39ec80);}}});}});} \ No newline at end of file +var _0x01a8=['set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','getConfigurations','findOne','ServicenowConfiguration','order','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','comments','approval','due_date','sys_mod_count','reopen_count','upon_approval','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','label','push','all','assign','TCL:\x20_object','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x2e42b6,_0x2e3d4a){var _0x446fd7=function(_0x13a353){while(--_0x13a353){_0x2e42b6['push'](_0x2e42b6['shift']());}};_0x446fd7(++_0x2e3d4a);}(_0x01a8,0x14e));var _0x801a=function(_0x14efd7,_0x507916){_0x14efd7=_0x14efd7-0x0;var _0x134669=_0x01a8[_0x14efd7];return _0x134669;};'use strict';var emlformat=require(_0x801a('0x0'));var rimraf=require(_0x801a('0x1'));var zipdir=require(_0x801a('0x2'));var jsonpatch=require(_0x801a('0x3'));var rp=require(_0x801a('0x4'));var moment=require(_0x801a('0x5'));var BPromise=require(_0x801a('0x6'));var Mustache=require(_0x801a('0x7'));var util=require(_0x801a('0x8'));var path=require('path');var sox=require(_0x801a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x801a('0xa'));var _=require(_0x801a('0xb'));var squel=require('squel');var crypto=require(_0x801a('0xc'));var jsforce=require(_0x801a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x801a('0xe'));var querystring=require(_0x801a('0xf'));var Papa=require('papaparse');var Redis=require(_0x801a('0x10'));var authService=require(_0x801a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x801a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x801a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x801a('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x801a('0x15'));function respondWithStatusCode(_0x202b6a,_0x1b5091){_0x1b5091=_0x1b5091||0xcc;return function(_0x14fab2){if(_0x14fab2){return _0x202b6a[_0x801a('0x16')](_0x1b5091);}return _0x202b6a[_0x801a('0x17')](_0x1b5091)[_0x801a('0x18')]();};}function respondWithResult(_0x2e6f8b,_0x528ada){_0x528ada=_0x528ada||0xc8;return function(_0x4c8713){if(_0x4c8713){return _0x2e6f8b[_0x801a('0x17')](_0x528ada)[_0x801a('0x19')](_0x4c8713);}};}function respondWithFilteredResult(_0x76e409,_0x199ad3){return function(_0x85956a){if(_0x85956a){var _0x95791a=typeof _0x199ad3[_0x801a('0x1a')]===_0x801a('0x1b')&&typeof _0x199ad3['limit']===_0x801a('0x1b');var _0x289e6b=_0x85956a['count'];var _0x7f5714=_0x95791a?0x0:_0x199ad3[_0x801a('0x1a')];var _0x3aa719=_0x95791a?_0x85956a[_0x801a('0x1c')]:_0x199ad3[_0x801a('0x1a')]+_0x199ad3[_0x801a('0x1d')];var _0x2b5049;if(_0x3aa719>=_0x289e6b){_0x3aa719=_0x289e6b;_0x2b5049=0xc8;}else{_0x2b5049=0xce;}_0x76e409['status'](_0x2b5049);return _0x76e409[_0x801a('0x1e')]('Content-Range',_0x7f5714+'-'+_0x3aa719+'/'+_0x289e6b)['json'](_0x85956a);}return null;};}function patchUpdates(_0x174125){return function(_0x366264){try{jsonpatch[_0x801a('0x1f')](_0x366264,_0x174125,!![]);}catch(_0xe73977){return BPromise[_0x801a('0x20')](_0xe73977);}return _0x366264[_0x801a('0x21')]();};}function saveUpdates(_0x21355b,_0x4771aa){return function(_0x52e912){if(_0x52e912){return _0x52e912[_0x801a('0x22')](_0x21355b)[_0x801a('0x23')](function(_0x3d8243){return _0x3d8243;});}return null;};}function removeEntity(_0x4c4d52,_0xce8d59){return function(_0x1f59b8){if(_0x1f59b8){return _0x1f59b8[_0x801a('0x24')]()[_0x801a('0x23')](function(){_0x4c4d52['status'](0xcc)[_0x801a('0x18')]();});}};}function handleEntityNotFound(_0x278611,_0x4a9b7c){return function(_0xa32394){if(!_0xa32394){_0x278611[_0x801a('0x16')](0x194);}return _0xa32394;};}function handleError(_0x3d8e61,_0x1949ce){_0x1949ce=_0x1949ce||0x1f4;return function(_0x1cc431){logger[_0x801a('0x25')](_0x1cc431[_0x801a('0x26')]);if(_0x1cc431[_0x801a('0x27')]){delete _0x1cc431[_0x801a('0x27')];}_0x3d8e61[_0x801a('0x17')](_0x1949ce)[_0x801a('0x28')](_0x1cc431);};}exports[_0x801a('0x29')]=function(_0xaae45a,_0x12a107){var _0x5619cb={},_0x16d14b={},_0x42d8be={'count':0x0,'rows':[]};var _0x227a31=_[_0x801a('0x2a')](db['ServicenowAccount'][_0x801a('0x2b')],function(_0x46e243){return{'name':_0x46e243['fieldName'],'type':_0x46e243[_0x801a('0x2c')][_0x801a('0x2d')]};});_0x16d14b[_0x801a('0x2e')]=_['map'](_0x227a31,_0x801a('0x27'));_0x16d14b[_0x801a('0x2f')]=_['keys'](_0xaae45a[_0x801a('0x2f')]);_0x16d14b[_0x801a('0x30')]=_[_0x801a('0x31')](_0x16d14b[_0x801a('0x2e')],_0x16d14b['query']);_0x5619cb[_0x801a('0x32')]=_['intersection'](_0x16d14b[_0x801a('0x2e')],qs['fields'](_0xaae45a[_0x801a('0x2f')][_0x801a('0x33')]));_0x5619cb['attributes']=_0x5619cb['attributes'][_0x801a('0x34')]?_0x5619cb[_0x801a('0x32')]:_0x16d14b[_0x801a('0x2e')];if(!_0xaae45a['query']['hasOwnProperty'](_0x801a('0x35'))){_0x5619cb[_0x801a('0x1d')]=qs['limit'](_0xaae45a[_0x801a('0x2f')][_0x801a('0x1d')]);_0x5619cb[_0x801a('0x1a')]=qs[_0x801a('0x1a')](_0xaae45a[_0x801a('0x2f')][_0x801a('0x1a')]);}_0x5619cb['order']=qs[_0x801a('0x36')](_0xaae45a[_0x801a('0x2f')][_0x801a('0x36')]);_0x5619cb[_0x801a('0x37')]=qs[_0x801a('0x30')](_['pick'](_0xaae45a[_0x801a('0x2f')],_0x16d14b[_0x801a('0x30')]),_0x227a31);if(_0xaae45a[_0x801a('0x2f')][_0x801a('0x38')]){_0x5619cb['where']=_[_0x801a('0x39')](_0x5619cb[_0x801a('0x37')],{'$or':_['map'](_0x227a31,function(_0x1f2213){if(_0x1f2213[_0x801a('0x2c')]!==_0x801a('0x3a')){var _0x43e370={};_0x43e370[_0x1f2213[_0x801a('0x27')]]={'$like':'%'+_0xaae45a[_0x801a('0x2f')][_0x801a('0x38')]+'%'};return _0x43e370;}})});}_0x5619cb=_[_0x801a('0x39')]({},_0x5619cb,_0xaae45a[_0x801a('0x3b')]);var _0x1ebf71={'where':_0x5619cb[_0x801a('0x37')]};return db[_0x801a('0x3c')][_0x801a('0x1c')](_0x1ebf71)['then'](function(_0x3f3567){_0x42d8be['count']=_0x3f3567;if(_0xaae45a['query']['includeAll']){_0x5619cb[_0x801a('0x3d')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x801a('0x3e')](_0x5619cb);})[_0x801a('0x23')](function(_0x7e4bb7){_0x42d8be[_0x801a('0x3f')]=_0x7e4bb7;return _0x42d8be;})[_0x801a('0x23')](respondWithFilteredResult(_0x12a107,_0x5619cb))[_0x801a('0x40')](handleError(_0x12a107,null));};exports[_0x801a('0x41')]=function(_0xd1b45,_0x48fc5e){var _0x4d413f={'raw':![],'where':{'id':_0xd1b45[_0x801a('0x42')]['id']}},_0x152b84={};_0x152b84[_0x801a('0x2e')]=_[_0x801a('0x43')](db[_0x801a('0x3c')][_0x801a('0x2b')]);_0x152b84[_0x801a('0x2f')]=_['keys'](_0xd1b45[_0x801a('0x2f')]);_0x152b84['filters']=_[_0x801a('0x31')](_0x152b84[_0x801a('0x2e')],_0x152b84[_0x801a('0x2f')]);_0x4d413f['attributes']=_[_0x801a('0x31')](_0x152b84['model'],qs[_0x801a('0x33')](_0xd1b45['query']['fields']));_0x4d413f[_0x801a('0x32')]=_0x4d413f[_0x801a('0x32')][_0x801a('0x34')]?_0x4d413f[_0x801a('0x32')]:_0x152b84[_0x801a('0x2e')];if(_0xd1b45[_0x801a('0x2f')][_0x801a('0x44')]){_0x4d413f[_0x801a('0x3d')]=[{'all':!![]}];}_0x4d413f=_['merge']({},_0x4d413f,_0xd1b45[_0x801a('0x3b')]);return db[_0x801a('0x3c')]['find'](_0x4d413f)[_0x801a('0x23')](handleEntityNotFound(_0x48fc5e,null))[_0x801a('0x23')](respondWithResult(_0x48fc5e,null))[_0x801a('0x40')](handleError(_0x48fc5e,null));};exports[_0x801a('0x45')]=function(_0x215925,_0x5ec563){return db[_0x801a('0x3c')]['create'](_0x215925['body'],{})[_0x801a('0x23')](respondWithResult(_0x5ec563,0xc9))[_0x801a('0x40')](handleError(_0x5ec563,null));};exports[_0x801a('0x22')]=function(_0x532041,_0x276b48){if(_0x532041['body']['id']){delete _0x532041[_0x801a('0x46')]['id'];}return db['ServicenowAccount'][_0x801a('0x47')]({'where':{'id':_0x532041[_0x801a('0x42')]['id']}})[_0x801a('0x23')](handleEntityNotFound(_0x276b48,null))[_0x801a('0x23')](saveUpdates(_0x532041[_0x801a('0x46')],null))[_0x801a('0x23')](respondWithResult(_0x276b48,null))[_0x801a('0x40')](handleError(_0x276b48,null));};exports['destroy']=function(_0x1efe12,_0x303584){return db[_0x801a('0x3c')][_0x801a('0x47')]({'where':{'id':_0x1efe12[_0x801a('0x42')]['id']}})[_0x801a('0x23')](handleEntityNotFound(_0x303584,null))['then'](removeEntity(_0x303584,null))[_0x801a('0x40')](handleError(_0x303584,null));};exports[_0x801a('0x48')]=function(_0x3ee6c0,_0x115080,_0xd3dfc3){var _0x3ffc5a={};var _0x2afcaf={};var _0x5beb72;var _0x16405d;return db[_0x801a('0x3c')][_0x801a('0x49')]({'where':{'id':_0x3ee6c0['params']['id']}})['then'](handleEntityNotFound(_0x115080,null))[_0x801a('0x23')](function(_0x3cc2d8){if(_0x3cc2d8){_0x5beb72=_0x3cc2d8;_0x2afcaf[_0x801a('0x2e')]=_[_0x801a('0x43')](db[_0x801a('0x4a')][_0x801a('0x2b')]);_0x2afcaf[_0x801a('0x2f')]=_[_0x801a('0x43')](_0x3ee6c0['query']);_0x2afcaf['filters']=_[_0x801a('0x31')](_0x2afcaf[_0x801a('0x2e')],_0x2afcaf[_0x801a('0x2f')]);_0x3ffc5a[_0x801a('0x32')]=_[_0x801a('0x31')](_0x2afcaf[_0x801a('0x2e')],qs[_0x801a('0x33')](_0x3ee6c0[_0x801a('0x2f')][_0x801a('0x33')]));_0x3ffc5a[_0x801a('0x32')]=_0x3ffc5a[_0x801a('0x32')]['length']?_0x3ffc5a[_0x801a('0x32')]:_0x2afcaf[_0x801a('0x2e')];_0x3ffc5a[_0x801a('0x4b')]=qs[_0x801a('0x36')](_0x3ee6c0[_0x801a('0x2f')]['sort']);_0x3ffc5a[_0x801a('0x37')]=qs['filters'](_[_0x801a('0x4c')](_0x3ee6c0['query'],_0x2afcaf[_0x801a('0x30')]));if(_0x3ee6c0['query']['filter']){_0x3ffc5a['where']=_['merge'](_0x3ffc5a['where'],{'$or':_['map'](_0x3ffc5a[_0x801a('0x32')],function(_0x35e336){var _0x408563={};_0x408563[_0x35e336]={'$like':'%'+_0x3ee6c0[_0x801a('0x2f')][_0x801a('0x38')]+'%'};return _0x408563;})});}_0x3ffc5a=_[_0x801a('0x39')]({},_0x3ffc5a,_0x3ee6c0['options']);return _0x5beb72['getConfigurations'](_0x3ffc5a);}})[_0x801a('0x23')](function(_0x396656){if(_0x396656){_0x16405d=_0x396656[_0x801a('0x34')];if(!_0x3ee6c0[_0x801a('0x2f')][_0x801a('0x4d')](_0x801a('0x35'))){_0x3ffc5a[_0x801a('0x1d')]=qs['limit'](_0x3ee6c0[_0x801a('0x2f')][_0x801a('0x1d')]);_0x3ffc5a[_0x801a('0x1a')]=qs[_0x801a('0x1a')](_0x3ee6c0['query'][_0x801a('0x1a')]);}return _0x5beb72[_0x801a('0x48')](_0x3ffc5a);}})[_0x801a('0x23')](function(_0x4bbbc4){if(_0x4bbbc4){return _0x4bbbc4?{'count':_0x16405d,'rows':_0x4bbbc4}:null;}})[_0x801a('0x23')](respondWithResult(_0x115080,null))[_0x801a('0x40')](handleError(_0x115080,null));};exports[_0x801a('0x4e')]=function(_0xc6d182,_0x6894e,_0x306ca5){if(_0xc6d182[_0x801a('0x46')]['id']){delete _0xc6d182[_0x801a('0x46')]['id'];}return db[_0x801a('0x3c')][_0x801a('0x49')]({'where':{'id':_0xc6d182['params']['id']}})[_0x801a('0x23')](handleEntityNotFound(_0x6894e,null))[_0x801a('0x23')](function(_0x38f90b){if(_0x38f90b){_0xc6d182['body'][_0x801a('0x4f')]=_0x38f90b['id'];_0xc6d182[_0x801a('0x46')][_0x801a('0x50')]=integrations[_0x801a('0x51')](_0xc6d182[_0x801a('0x46')][_0x801a('0x52')],_0xc6d182[_0x801a('0x46')][_0x801a('0x2c')]);_0xc6d182[_0x801a('0x46')][_0x801a('0x53')]=integrations[_0x801a('0x54')](_0xc6d182[_0x801a('0x46')][_0x801a('0x52')],_0xc6d182[_0x801a('0x46')][_0x801a('0x2c')]);return db[_0x801a('0x4a')][_0x801a('0x45')](_0xc6d182[_0x801a('0x46')],{'include':[{'model':db[_0x801a('0x55')],'as':_0x801a('0x50')},{'model':db[_0x801a('0x55')],'as':_0x801a('0x53')}]});}return null;})[_0x801a('0x23')](respondWithResult(_0x6894e,null))[_0x801a('0x40')](handleError(_0x6894e,null));};exports[_0x801a('0x56')]=function(_0x288395,_0x4a9c2c,_0x41638c){var _0x22e69a=[_0x801a('0x57'),_0x801a('0x58'),_0x801a('0x59'),'subcategory',_0x801a('0x5a'),_0x801a('0x5b'),_0x801a('0x5c'),_0x801a('0x5d'),_0x801a('0x5e')];var _0x402c3b=[_0x801a('0x5f'),_0x801a('0x57'),_0x801a('0x60'),_0x801a('0x61'),'upon_reject','sys_updated_on',_0x801a('0x62'),'hold_reason',_0x801a('0x63'),_0x801a('0x64'),_0x801a('0x65'),_0x801a('0x66'),_0x801a('0x67'),'user_input',_0x801a('0x68'),_0x801a('0x69'),_0x801a('0x6a'),'sys_created_by','knowledge',_0x801a('0x4b'),'calendar_stc',_0x801a('0x6b'),_0x801a('0x6c'),_0x801a('0x6d'),_0x801a('0x6e'),_0x801a('0x6f'),'work_notes_list','business_service',_0x801a('0x70'),_0x801a('0x71'),_0x801a('0x72'),'time_worked',_0x801a('0x73'),'opened_at',_0x801a('0x74'),_0x801a('0x75'),'work_end',_0x801a('0x76'),_0x801a('0x77'),_0x801a('0x78'),_0x801a('0x79'),'subcategory','work_notes',_0x801a('0x7a'),_0x801a('0x5a'),_0x801a('0x7b'),_0x801a('0x7c'),_0x801a('0x7d'),_0x801a('0x7e'),_0x801a('0x7f'),_0x801a('0x80'),_0x801a('0x81'),_0x801a('0x82'),'notify',_0x801a('0x83'),_0x801a('0x84'),_0x801a('0x85'),_0x801a('0x86'),'parent_incident',_0x801a('0x87'),_0x801a('0x88'),_0x801a('0x89'),_0x801a('0x5c'),_0x801a('0x8a'),_0x801a('0x8b'),_0x801a('0x8c'),'reassignment_count',_0x801a('0x8d'),'assigned_to',_0x801a('0x5d'),_0x801a('0x8e'),'sla_due',_0x801a('0x8f'),'comments_and_work_notes',_0x801a('0x90'),_0x801a('0x91'),_0x801a('0x92'),'sys_tags','escalation',_0x801a('0x93'),'correlation_id',_0x801a('0x94'),_0x801a('0x5e')];var _0x5d1d9f='';var _0x53ec15='';var _0x52a6bb=[];var _0x9f4334='';var _0x129e38='';var _0x184a4e=[];var _0x3c3177='';var _0x41420f='';var _0x37ef3c={};var _0x669a37='';return db[_0x801a('0x3c')]['findOne']({'where':{'id':_0x288395[_0x801a('0x42')]['id']},'attributes':['id',_0x801a('0x95'),_0x801a('0x96'),'email',_0x801a('0x97'),_0x801a('0x98')]})[_0x801a('0x23')](handleEntityNotFound(_0x4a9c2c,null))['then'](function(_0x5b4ab0){if(_0x5b4ab0){_0x669a37=_0x5b4ab0[_0x801a('0x97')];var _0x54e4e2=_0x669a37[_0x801a('0x99')](-0x1);if(_0x54e4e2==='/'){_0x669a37=_0x669a37['substring'](0x0,_0x669a37[_0x801a('0x9a')](_0x54e4e2));}_0x41420f=util[_0x801a('0x9b')](_0x801a('0x9c'),_0x669a37);_0x3c3177=util[_0x801a('0x9b')](_0x801a('0x9d'),_0x669a37);_0x37ef3c={'user':_0x5b4ab0['username'],'pass':_0x5b4ab0[_0x801a('0x96')]};var _0xdd3c67={'method':_0x801a('0x9e'),'uri':_0x41420f+_0x801a('0x9f'),'auth':_0x37ef3c,'json':!![]};return rp(_0xdd3c67);}})[_0x801a('0x23')](function(_0xdad0a6){if(_0xdad0a6['result']['length']>0x0){_0x5d1d9f=_0xdad0a6[_0x801a('0xa0')];}console[_0x801a('0xa1')](_0x801a('0xa2'),_0x5d1d9f);_0x184a4e=[];_0x53ec15=Object['assign']([],_0x5d1d9f);_[_0x801a('0xa3')](_0x53ec15,function(_0x3c1068){return!_0x22e69a[_0x801a('0xa4')](_0x3c1068[_0x801a('0x27')]);});_0x53ec15[_0x801a('0xa5')](function(_0x229a33){var _0x5ed6c1=createFieldObject(_0x3c3177,_0x37ef3c,_0x229a33['internalType'],_0x229a33[_0x801a('0x27')],_0x229a33[_0x801a('0xa6')],![]);_0x184a4e[_0x801a('0xa7')](_0x5ed6c1);});return Promise[_0x801a('0xa8')](_0x184a4e);})[_0x801a('0x23')](function(_0x468fab){_0x52a6bb=_0x468fab;_0x9f4334=Object[_0x801a('0xa9')]([],_0x5d1d9f);console[_0x801a('0xa1')](_0x801a('0xaa'),_0x5d1d9f);_[_0x801a('0xa3')](_0x9f4334,function(_0x4ed7fc){return _0x402c3b[_0x801a('0xa4')](_0x4ed7fc[_0x801a('0x27')]);});console[_0x801a('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x9f4334);_0x184a4e=[];_0x9f4334['forEach'](function(_0x12bbb1){var _0x3effd3=createFieldObject(_0x3c3177,_0x37ef3c,_0x12bbb1[_0x801a('0xab')],_0x12bbb1[_0x801a('0x27')],_0x12bbb1['label'],!![]);_0x184a4e[_0x801a('0xa7')](_0x3effd3);});return Promise[_0x801a('0xa8')](_0x184a4e);})[_0x801a('0x23')](function(_0x5a790e){_0x129e38=_0x5a790e;var _0x2d0b0c=_0x52a6bb[_0x801a('0xac')](_0x129e38);return{'count':_0x2d0b0c[_0x801a('0x34')],'rows':_0x2d0b0c};})[_0x801a('0x23')](respondWithResult(_0x4a9c2c,null))['catch'](function(_0x44886a){console['log'](_0x801a('0xad')+_0x44886a);var _0x32515a=_0x288395['query'][_0x801a('0xae')]?0x1f4:_0x44886a[_0x801a('0xaf')]||0x1f4;logger[_0x801a('0x25')](_0x44886a[_0x801a('0x26')]);delete _0x44886a[_0x801a('0x27')];if(_0x32515a===0x191){_0x32515a=0x190;}_0x4a9c2c[_0x801a('0x17')](_0x32515a)['send'](_0x288395[_0x801a('0x2f')][_0x801a('0xae')]?{'message':_0x801a('0xb0'),'statusCode':_0x44886a['statusCode']}:_0x44886a);});};function createFieldObject(_0x1a0b55,_0x42a22e,_0x4e72d7,_0xe4334,_0x9fdc6a,_0x10079e){return new Promise(function(_0x4a2081,_0x17d1a0){var _0x28b5aa={'id':_0xe4334,'name':_0x9fdc6a,'custom':_0x10079e};if(_0x4e72d7===_0x801a('0xb1')){_0x28b5aa[_0x801a('0x3b')]=[{'name':_0x801a('0xb2'),'value':'true'},{'name':'False','value':_0x801a('0xb3')}];_0x4a2081(_0x28b5aa);}else{var _0x24744f={'method':'GET','uri':_0x1a0b55+'sys_choice?sysparm_query=name=incident^element='+_0xe4334,'auth':_0x42a22e,'json':!![]};return rp(_0x24744f)[_0x801a('0x23')](function(_0x2eb4dd){var _0x7019de=[];if(_0x2eb4dd[_0x801a('0xa0')][_0x801a('0x34')]>0x0){_0x2eb4dd[_0x801a('0xa0')][_0x801a('0xa5')](function(_0x291bbd){if(_0x291bbd[_0x801a('0xb4')]===_0x801a('0xb3')){var _0x3f0842={'name':_0x291bbd[_0x801a('0xa6')],'value':_0x291bbd[_0x801a('0xb5')]};_0x7019de[_0x801a('0xa7')](_0x3f0842);}});}_0x28b5aa[_0x801a('0x3b')]=_0x7019de;if(_0x28b5aa['options']['length']>0x0){_0x4a2081(_0x28b5aa);}else{if(_0x10079e==![]){_0x4a2081();}else{_0x4a2081(_0x28b5aa);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 2bcd9a5..25204a3 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 _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x2a57b4,_0x53a174){var _0x36f280=function(_0x39742e){while(--_0x39742e){_0x2a57b4['push'](_0x2a57b4['shift']());}};_0x36f280(++_0x53a174);}(_0xb138,0x1dd));var _0x8b13=function(_0xf89227,_0x312ef8){_0xf89227=_0xf89227-0x0;var _0x4fb82f=_0xb138[_0xf89227];return _0x4fb82f;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','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 30940ec..2844cbc 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 _0xceea=['../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','findAll','options','where','attributes','limit','map','model','include','then','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xceea,0x186));var _0xacee=function(_0xf56470,_0x346cb2){_0xf56470=_0xf56470-0x0;var _0x19ee62=_0xceea[_0xf56470];return _0x19ee62;};'use strict';var _=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var moment=require(_0xacee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacee('0x3'));var db=require(_0xacee('0x4'))['db'];var utils=require(_0xacee('0x5'));var logger=require(_0xacee('0x6'))(_0xacee('0x7'));var config=require(_0xacee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xacee('0x9')][_0xacee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18dc27,_0x4e6be1,_0x21b31d){return new BPromise(function(_0x2af43c,_0x458d72){return client[_0xacee('0xb')](_0x18dc27,_0x21b31d)['then'](function(_0x2ad7cf){logger[_0xacee('0xc')](_0xacee('0xd'),_0x4e6be1,_0xacee('0xe'));logger[_0xacee('0xf')](_0xacee('0x10'),_0x4e6be1,_0xacee('0xe'),JSON[_0xacee('0x11')](_0x2ad7cf));if(_0x2ad7cf[_0xacee('0x12')]){if(_0x2ad7cf['error']['code']===0x1f4){logger['error'](_0xacee('0xd'),_0x4e6be1,_0x2ad7cf['error'][_0xacee('0x13')]);return _0x458d72(_0x2ad7cf[_0xacee('0x12')][_0xacee('0x13')]);}logger[_0xacee('0x12')](_0xacee('0xd'),_0x4e6be1,_0x2ad7cf[_0xacee('0x12')][_0xacee('0x13')]);return _0x2af43c(_0x2ad7cf['error']['message']);}else{logger[_0xacee('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x4e6be1,_0xacee('0xe'));_0x2af43c(_0x2ad7cf[_0xacee('0x14')]['message']);}})[_0xacee('0x15')](function(_0x32a294){logger['error'](_0xacee('0xd'),_0x4e6be1,_0x32a294);_0x458d72(_0x32a294);});});}exports[_0xacee('0x16')]=function(_0x33b712){var _0x5686b5=this;return new Promise(function(_0x2d26ad,_0x452cfc){return db['ServicenowAccount'][_0xacee('0x17')]({'raw':_0x33b712[_0xacee('0x18')]?_0x33b712[_0xacee('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x33b712['options']?_0x33b712['options'][_0xacee('0x19')]||null:null,'attributes':_0x33b712[_0xacee('0x18')]?_0x33b712['options'][_0xacee('0x1a')]||null:null,'limit':_0x33b712[_0xacee('0x18')]?_0x33b712[_0xacee('0x18')][_0xacee('0x1b')]||null:null,'include':_0x33b712[_0xacee('0x18')]?_0x33b712[_0xacee('0x18')]['include']?_[_0xacee('0x1c')](_0x33b712[_0xacee('0x18')]['include'],function(_0x4c0006){return{'model':db[_0x4c0006[_0xacee('0x1d')]],'as':_0x4c0006['as'],'attributes':_0x4c0006[_0xacee('0x1a')],'include':_0x4c0006[_0xacee('0x1e')]?_[_0xacee('0x1c')](_0x4c0006[_0xacee('0x1e')],function(_0x5ed6c4){return{'model':db[_0x5ed6c4[_0xacee('0x1d')]],'as':_0x5ed6c4['as'],'attributes':_0x5ed6c4[_0xacee('0x1a')],'include':_0x5ed6c4[_0xacee('0x1e')]?_[_0xacee('0x1c')](_0x5ed6c4['include'],function(_0x506d45){return{'model':db[_0x506d45['model']],'as':_0x506d45['as'],'attributes':_0x506d45[_0xacee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xacee('0x1f')](function(_0x250673){logger['info'](_0xacee('0x16'),_0x33b712);logger[_0xacee('0xf')]('GetServicenowAccount',_0x33b712,JSON[_0xacee('0x11')](_0x250673));_0x2d26ad(_0x250673);})['catch'](function(_0x594ac6){logger[_0xacee('0x12')]('GetServicenowAccount',_0x594ac6[_0xacee('0x13')],_0x33b712);_0x452cfc(_0x5686b5[_0xacee('0x12')](0x1f4,_0x594ac6[_0xacee('0x13')]));});});};exports[_0xacee('0x20')]=function(_0x456731){var _0x2005cf=this;return new Promise(function(_0x4f382e,_0x33b324){return db[_0xacee('0x21')][_0xacee('0x22')]({'raw':_0x456731['options']?_0x456731[_0xacee('0x18')][_0xacee('0x23')]===undefined?!![]:![]:!![],'where':_0x456731[_0xacee('0x18')]?_0x456731[_0xacee('0x18')][_0xacee('0x19')]||null:null,'attributes':_0x456731[_0xacee('0x18')]?_0x456731[_0xacee('0x18')][_0xacee('0x1a')]||null:null,'include':_0x456731[_0xacee('0x18')]?_0x456731['options'][_0xacee('0x1e')]?_[_0xacee('0x1c')](_0x456731['options'][_0xacee('0x1e')],function(_0x1d91ea){return{'model':db[_0x1d91ea[_0xacee('0x1d')]],'as':_0x1d91ea['as'],'attributes':_0x1d91ea[_0xacee('0x1a')],'include':_0x1d91ea[_0xacee('0x1e')]?_[_0xacee('0x1c')](_0x1d91ea[_0xacee('0x1e')],function(_0x2eb7a3){return{'model':db[_0x2eb7a3[_0xacee('0x1d')]],'as':_0x2eb7a3['as'],'attributes':_0x2eb7a3[_0xacee('0x1a')],'include':_0x2eb7a3[_0xacee('0x1e')]?_[_0xacee('0x1c')](_0x2eb7a3[_0xacee('0x1e')],function(_0x488236){return{'model':db[_0x488236['model']],'as':_0x488236['as'],'attributes':_0x488236[_0xacee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xacee('0x1f')](function(_0x2d8bbf){logger[_0xacee('0xc')]('ShowServicenowAccount',_0x456731);logger[_0xacee('0xf')](_0xacee('0x20'),_0x456731,JSON['stringify'](_0x2d8bbf));_0x4f382e(_0x2d8bbf);})[_0xacee('0x15')](function(_0x33f709){logger[_0xacee('0x12')](_0xacee('0x20'),_0x33f709[_0xacee('0x13')],_0x456731);_0x33b324(_0x2005cf[_0xacee('0x12')](0x1f4,_0x33f709['message']));});});}; \ No newline at end of file +var _0x5573=['limit','include','map','model','stringify','catch','ShowServicenowAccount','find','where','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetServicenowAccount','findAll','options','raw','attributes'];(function(_0x362788,_0x582445){var _0x22d06b=function(_0x289b36){while(--_0x289b36){_0x362788['push'](_0x362788['shift']());}};_0x22d06b(++_0x582445);}(_0x5573,0x9e));var _0x3557=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x5573[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0x3557('0x0'));var util=require('util');var moment=require(_0x3557('0x1'));var BPromise=require(_0x3557('0x2'));var rs=require(_0x3557('0x3'));var fs=require('fs');var Redis=require(_0x3557('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3557('0x5'));var logger=require(_0x3557('0x6'))(_0x3557('0x7'));var config=require(_0x3557('0x8'));var jayson=require(_0x3557('0x9'));var client=jayson[_0x3557('0xa')][_0x3557('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dc072,_0x49aa2f,_0x293f10){return new BPromise(function(_0x44a6f8,_0x59d53c){return client[_0x3557('0xc')](_0x1dc072,_0x293f10)['then'](function(_0x968a0d){logger[_0x3557('0xd')](_0x3557('0xe'),_0x49aa2f,'request\x20sent');logger[_0x3557('0xf')](_0x3557('0x10'),_0x49aa2f,_0x3557('0x11'),JSON['stringify'](_0x968a0d));if(_0x968a0d['error']){if(_0x968a0d[_0x3557('0x12')][_0x3557('0x13')]===0x1f4){logger[_0x3557('0x12')](_0x3557('0xe'),_0x49aa2f,_0x968a0d[_0x3557('0x12')][_0x3557('0x14')]);return _0x59d53c(_0x968a0d[_0x3557('0x12')][_0x3557('0x14')]);}logger[_0x3557('0x12')](_0x3557('0xe'),_0x49aa2f,_0x968a0d[_0x3557('0x12')]['message']);return _0x44a6f8(_0x968a0d[_0x3557('0x12')][_0x3557('0x14')]);}else{logger[_0x3557('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x49aa2f,'request\x20sent');_0x44a6f8(_0x968a0d[_0x3557('0x15')]['message']);}})['catch'](function(_0x2bcd49){logger[_0x3557('0x12')](_0x3557('0xe'),_0x49aa2f,_0x2bcd49);_0x59d53c(_0x2bcd49);});});}exports[_0x3557('0x16')]=function(_0x41a061){var _0x318b0e=this;return new Promise(function(_0x5c2421,_0x40a3fe){return db['ServicenowAccount'][_0x3557('0x17')]({'raw':_0x41a061[_0x3557('0x18')]?_0x41a061[_0x3557('0x18')][_0x3557('0x19')]===undefined?!![]:![]:!![],'where':_0x41a061[_0x3557('0x18')]?_0x41a061[_0x3557('0x18')]['where']||null:null,'attributes':_0x41a061[_0x3557('0x18')]?_0x41a061[_0x3557('0x18')][_0x3557('0x1a')]||null:null,'limit':_0x41a061[_0x3557('0x18')]?_0x41a061[_0x3557('0x18')][_0x3557('0x1b')]||null:null,'include':_0x41a061[_0x3557('0x18')]?_0x41a061[_0x3557('0x18')][_0x3557('0x1c')]?_[_0x3557('0x1d')](_0x41a061[_0x3557('0x18')][_0x3557('0x1c')],function(_0x55b3b6){return{'model':db[_0x55b3b6[_0x3557('0x1e')]],'as':_0x55b3b6['as'],'attributes':_0x55b3b6[_0x3557('0x1a')],'include':_0x55b3b6[_0x3557('0x1c')]?_[_0x3557('0x1d')](_0x55b3b6[_0x3557('0x1c')],function(_0x4f77ae){return{'model':db[_0x4f77ae['model']],'as':_0x4f77ae['as'],'attributes':_0x4f77ae[_0x3557('0x1a')],'include':_0x4f77ae[_0x3557('0x1c')]?_[_0x3557('0x1d')](_0x4f77ae[_0x3557('0x1c')],function(_0xf81cee){return{'model':db[_0xf81cee[_0x3557('0x1e')]],'as':_0xf81cee['as'],'attributes':_0xf81cee[_0x3557('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe13ab7){logger['info'](_0x3557('0x16'),_0x41a061);logger[_0x3557('0xf')](_0x3557('0x16'),_0x41a061,JSON[_0x3557('0x1f')](_0xe13ab7));_0x5c2421(_0xe13ab7);})[_0x3557('0x20')](function(_0x356fda){logger[_0x3557('0x12')](_0x3557('0x16'),_0x356fda['message'],_0x41a061);_0x40a3fe(_0x318b0e['error'](0x1f4,_0x356fda[_0x3557('0x14')]));});});};exports[_0x3557('0x21')]=function(_0x4b4093){var _0x20a8fb=this;return new Promise(function(_0x529816,_0x281c0f){return db['ServicenowAccount'][_0x3557('0x22')]({'raw':_0x4b4093['options']?_0x4b4093[_0x3557('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4b4093[_0x3557('0x18')]?_0x4b4093[_0x3557('0x18')][_0x3557('0x23')]||null:null,'attributes':_0x4b4093[_0x3557('0x18')]?_0x4b4093[_0x3557('0x18')][_0x3557('0x1a')]||null:null,'include':_0x4b4093[_0x3557('0x18')]?_0x4b4093['options'][_0x3557('0x1c')]?_[_0x3557('0x1d')](_0x4b4093['options'][_0x3557('0x1c')],function(_0x2ca20f){return{'model':db[_0x2ca20f[_0x3557('0x1e')]],'as':_0x2ca20f['as'],'attributes':_0x2ca20f['attributes'],'include':_0x2ca20f['include']?_[_0x3557('0x1d')](_0x2ca20f[_0x3557('0x1c')],function(_0x4e93ed){return{'model':db[_0x4e93ed[_0x3557('0x1e')]],'as':_0x4e93ed['as'],'attributes':_0x4e93ed[_0x3557('0x1a')],'include':_0x4e93ed['include']?_[_0x3557('0x1d')](_0x4e93ed[_0x3557('0x1c')],function(_0x29c71c){return{'model':db[_0x29c71c[_0x3557('0x1e')]],'as':_0x29c71c['as'],'attributes':_0x29c71c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3557('0x24')](function(_0x4c33f2){logger[_0x3557('0xd')](_0x3557('0x21'),_0x4b4093);logger[_0x3557('0xf')](_0x3557('0x21'),_0x4b4093,JSON[_0x3557('0x1f')](_0x4c33f2));_0x529816(_0x4c33f2);})[_0x3557('0x20')](function(_0x500b43){logger['error'](_0x3557('0x21'),_0x500b43['message'],_0x4b4093);_0x281c0f(_0x20a8fb[_0x3557('0x12')](0x1f4,_0x500b43[_0x3557('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 420b684..487a86d 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 _0x287c=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x191fb6,_0x5612de){var _0x57458f=function(_0x35679d){while(--_0x35679d){_0x191fb6['push'](_0x191fb6['shift']());}};_0x57458f(++_0x5612de);}(_0x287c,0x8c));var _0xc287=function(_0x1b4d17,_0xbd4d2d){_0x1b4d17=_0x1b4d17-0x0;var _0x185be8=_0x287c[_0x1b4d17];return _0x185be8;};'use strict';var multer=require(_0xc287('0x0'));var util=require(_0xc287('0x1'));var path=require('path');var timeout=require(_0xc287('0x2'));var express=require(_0xc287('0x3'));var router=express[_0xc287('0x4')]();var fs_extra=require(_0xc287('0x5'));var auth=require(_0xc287('0x6'));var interaction=require(_0xc287('0x7'));var config=require(_0xc287('0x8'));var controller=require(_0xc287('0x9'));router[_0xc287('0xa')]('/',auth['isAuthenticated'](),controller[_0xc287('0xb')]);router[_0xc287('0xa')]('/:id',auth[_0xc287('0xc')](),controller['show']);router[_0xc287('0xa')]('/:id/fields',auth[_0xc287('0xc')](),controller[_0xc287('0xd')]);router[_0xc287('0xa')](_0xc287('0xe'),auth[_0xc287('0xc')](),controller['getSubjects']);router[_0xc287('0xa')](_0xc287('0xf'),auth[_0xc287('0xc')](),controller[_0xc287('0x10')]);router[_0xc287('0x11')]('/',auth[_0xc287('0xc')](),controller[_0xc287('0x12')]);router[_0xc287('0x13')](_0xc287('0x14'),auth[_0xc287('0xc')](),controller['update']);router[_0xc287('0x15')](_0xc287('0x14'),auth[_0xc287('0xc')](),controller[_0xc287('0x16')]);module['exports']=router; \ No newline at end of file +var _0xbb0a=['/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0x22629a,_0x8582fa){var _0x857d52=function(_0x48d02c){while(--_0x48d02c){_0x22629a['push'](_0x22629a['shift']());}};_0x857d52(++_0x8582fa);}(_0xbb0a,0x71));var _0xabb0=function(_0x32a21c,_0x5e0cc9){_0x32a21c=_0x32a21c-0x0;var _0x39b108=_0xbb0a[_0x32a21c];return _0x39b108;};'use strict';var multer=require(_0xabb0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xabb0('0x1'));var express=require(_0xabb0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xabb0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xabb0('0x4'));var controller=require(_0xabb0('0x5'));router[_0xabb0('0x6')]('/',auth['isAuthenticated'](),controller[_0xabb0('0x7')]);router[_0xabb0('0x6')](_0xabb0('0x8'),auth[_0xabb0('0x9')](),controller[_0xabb0('0xa')]);router[_0xabb0('0x6')](_0xabb0('0xb'),auth[_0xabb0('0x9')](),controller[_0xabb0('0xc')]);router[_0xabb0('0x6')](_0xabb0('0xd'),auth[_0xabb0('0x9')](),controller['getSubjects']);router[_0xabb0('0x6')](_0xabb0('0xe'),auth[_0xabb0('0x9')](),controller[_0xabb0('0xf')]);router['post']('/',auth[_0xabb0('0x9')](),controller[_0xabb0('0x10')]);router[_0xabb0('0x11')](_0xabb0('0x8'),auth[_0xabb0('0x9')](),controller[_0xabb0('0x12')]);router[_0xabb0('0x13')](_0xabb0('0x8'),auth[_0xabb0('0x9')](),controller[_0xabb0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index e54745b..a688135 100644 --- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js +++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f8d=['exports','sequelize'];(function(_0x105ab4,_0x1b07a5){var _0x5d07ce=function(_0x3a2365){while(--_0x3a2365){_0x105ab4['push'](_0x105ab4['shift']());}};_0x5d07ce(++_0x1b07a5);}(_0x1f8d,0xb3));var _0xd1f8=function(_0x37e93b,_0x44ef1e){_0x37e93b=_0x37e93b-0x0;var _0x5c63da=_0x1f8d[_0x37e93b];return _0x5c63da;};'use strict';var Sequelize=require(_0xd1f8('0x0'));module[_0xd1f8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6df3264..0fd6c83 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 _0xc541=['../../config/license/util','status','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','ServicenowConfiguration','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0xc541,0x166));var _0x1c54=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xc541[_0x16e57d];return _0x40239c;};'use strict';var emlformat=require(_0x1c54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c54('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c54('0x2'));var moment=require(_0x1c54('0x3'));var BPromise=require(_0x1c54('0x4'));var Mustache=require(_0x1c54('0x5'));var util=require('util');var path=require(_0x1c54('0x6'));var sox=require('sox');var csv=require(_0x1c54('0x7'));var ejs=require(_0x1c54('0x8'));var fs=require('fs');var fs_extra=require(_0x1c54('0x9'));var _=require(_0x1c54('0xa'));var squel=require('squel');var crypto=require(_0x1c54('0xb'));var jsforce=require(_0x1c54('0xc'));var deskjs=require(_0x1c54('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1c54('0xe'));var Papa=require(_0x1c54('0xf'));var Redis=require('ioredis');var authService=require(_0x1c54('0x10'));var qs=require(_0x1c54('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c54('0x12'))(_0x1c54('0x13'));var utils=require(_0x1c54('0x14'));var config=require(_0x1c54('0x15'));var licenseUtil=require(_0x1c54('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c75d,_0x4e114a){_0x4e114a=_0x4e114a||0xcc;return function(_0x2d1966){if(_0x2d1966){return _0x35c75d['sendStatus'](_0x4e114a);}return _0x35c75d[_0x1c54('0x17')](_0x4e114a)['end']();};}function respondWithResult(_0x47bf17,_0x6b4e98){_0x6b4e98=_0x6b4e98||0xc8;return function(_0x13d930){if(_0x13d930){return _0x47bf17[_0x1c54('0x17')](_0x6b4e98)['json'](_0x13d930);}};}function respondWithFilteredResult(_0x56cae8,_0x50efa3){return function(_0x207622){if(_0x207622){var _0x54bf87=typeof _0x50efa3['offset']===_0x1c54('0x18')&&typeof _0x50efa3[_0x1c54('0x19')]===_0x1c54('0x18');var _0x3f3ad7=_0x207622[_0x1c54('0x1a')];var _0x4d83da=_0x54bf87?0x0:_0x50efa3['offset'];var _0x3e4320=_0x54bf87?_0x207622[_0x1c54('0x1a')]:_0x50efa3['offset']+_0x50efa3['limit'];var _0x7a1320;if(_0x3e4320>=_0x3f3ad7){_0x3e4320=_0x3f3ad7;_0x7a1320=0xc8;}else{_0x7a1320=0xce;}_0x56cae8['status'](_0x7a1320);return _0x56cae8[_0x1c54('0x1b')](_0x1c54('0x1c'),_0x4d83da+'-'+_0x3e4320+'/'+_0x3f3ad7)[_0x1c54('0x1d')](_0x207622);}return null;};}function patchUpdates(_0x3946eb){return function(_0x443a60){try{jsonpatch['apply'](_0x443a60,_0x3946eb,!![]);}catch(_0x568f9a){return BPromise[_0x1c54('0x1e')](_0x568f9a);}return _0x443a60[_0x1c54('0x1f')]();};}function saveUpdates(_0x22530c,_0x30a869){return function(_0x5cbff9){if(_0x5cbff9){return _0x5cbff9[_0x1c54('0x20')](_0x22530c)['then'](function(_0x2192bd){return _0x2192bd;});}return null;};}function removeEntity(_0x46d2ac,_0x18e7cf){return function(_0xb90e1d){if(_0xb90e1d){return _0xb90e1d[_0x1c54('0x21')]()[_0x1c54('0x22')](function(){_0x46d2ac[_0x1c54('0x17')](0xcc)[_0x1c54('0x23')]();});}};}function handleEntityNotFound(_0x2feb43,_0x4eefba){return function(_0x30e571){if(!_0x30e571){_0x2feb43[_0x1c54('0x24')](0x194);}return _0x30e571;};}function handleError(_0x30347c,_0x51e980){_0x51e980=_0x51e980||0x1f4;return function(_0x22dea5){logger[_0x1c54('0x25')](_0x22dea5[_0x1c54('0x26')]);if(_0x22dea5[_0x1c54('0x27')]){delete _0x22dea5[_0x1c54('0x27')];}_0x30347c['status'](_0x51e980)['send'](_0x22dea5);};}exports[_0x1c54('0x28')]=function(_0x4e8621,_0xba8c34){var _0x421306={},_0x532a76={},_0xa3549e={'count':0x0,'rows':[]};var _0x368cff=_['map'](db[_0x1c54('0x29')]['rawAttributes'],function(_0x2480d0){return{'name':_0x2480d0['fieldName'],'type':_0x2480d0['type']['key']};});_0x532a76[_0x1c54('0x2a')]=_[_0x1c54('0x2b')](_0x368cff,_0x1c54('0x27'));_0x532a76[_0x1c54('0x2c')]=_['keys'](_0x4e8621[_0x1c54('0x2c')]);_0x532a76[_0x1c54('0x2d')]=_[_0x1c54('0x2e')](_0x532a76['model'],_0x532a76[_0x1c54('0x2c')]);_0x421306['attributes']=_[_0x1c54('0x2e')](_0x532a76[_0x1c54('0x2a')],qs[_0x1c54('0x2f')](_0x4e8621['query']['fields']));_0x421306[_0x1c54('0x30')]=_0x421306[_0x1c54('0x30')][_0x1c54('0x31')]?_0x421306[_0x1c54('0x30')]:_0x532a76[_0x1c54('0x2a')];if(!_0x4e8621[_0x1c54('0x2c')][_0x1c54('0x32')](_0x1c54('0x33'))){_0x421306[_0x1c54('0x19')]=qs[_0x1c54('0x19')](_0x4e8621[_0x1c54('0x2c')][_0x1c54('0x19')]);_0x421306['offset']=qs[_0x1c54('0x34')](_0x4e8621[_0x1c54('0x2c')][_0x1c54('0x34')]);}_0x421306[_0x1c54('0x35')]=qs['sort'](_0x4e8621['query'][_0x1c54('0x36')]);_0x421306[_0x1c54('0x37')]=qs[_0x1c54('0x2d')](_['pick'](_0x4e8621[_0x1c54('0x2c')],_0x532a76[_0x1c54('0x2d')]),_0x368cff);if(_0x4e8621['query'][_0x1c54('0x38')]){_0x421306[_0x1c54('0x37')]=_[_0x1c54('0x39')](_0x421306[_0x1c54('0x37')],{'$or':_[_0x1c54('0x2b')](_0x368cff,function(_0x22ac43){if(_0x22ac43['type']!==_0x1c54('0x3a')){var _0x5833b0={};_0x5833b0[_0x22ac43[_0x1c54('0x27')]]={'$like':'%'+_0x4e8621[_0x1c54('0x2c')][_0x1c54('0x38')]+'%'};return _0x5833b0;}})});}_0x421306=_['merge']({},_0x421306,_0x4e8621[_0x1c54('0x3b')]);var _0x5ee98d={'where':_0x421306[_0x1c54('0x37')]};return db[_0x1c54('0x29')][_0x1c54('0x1a')](_0x5ee98d)[_0x1c54('0x22')](function(_0x5ebb89){_0xa3549e[_0x1c54('0x1a')]=_0x5ebb89;if(_0x4e8621[_0x1c54('0x2c')][_0x1c54('0x3c')]){_0x421306[_0x1c54('0x3d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x1c54('0x3e')](_0x421306);})['then'](function(_0x3a94e2){_0xa3549e['rows']=_0x3a94e2;return _0xa3549e;})[_0x1c54('0x22')](respondWithFilteredResult(_0xba8c34,_0x421306))['catch'](handleError(_0xba8c34,null));};exports[_0x1c54('0x3f')]=function(_0x4dcaa3,_0x1a0a3d){var _0x4622ad={'raw':![],'where':{'id':_0x4dcaa3[_0x1c54('0x40')]['id']}},_0x1ba994={};_0x1ba994[_0x1c54('0x2a')]=_[_0x1c54('0x41')](db[_0x1c54('0x29')][_0x1c54('0x42')]);_0x1ba994['query']=_[_0x1c54('0x41')](_0x4dcaa3[_0x1c54('0x2c')]);_0x1ba994[_0x1c54('0x2d')]=_[_0x1c54('0x2e')](_0x1ba994[_0x1c54('0x2a')],_0x1ba994[_0x1c54('0x2c')]);_0x4622ad[_0x1c54('0x30')]=_[_0x1c54('0x2e')](_0x1ba994[_0x1c54('0x2a')],qs[_0x1c54('0x2f')](_0x4dcaa3[_0x1c54('0x2c')][_0x1c54('0x2f')]));_0x4622ad[_0x1c54('0x30')]=_0x4622ad['attributes']['length']?_0x4622ad['attributes']:_0x1ba994[_0x1c54('0x2a')];if(_0x4dcaa3[_0x1c54('0x2c')][_0x1c54('0x3c')]){_0x4622ad[_0x1c54('0x3d')]=[{'all':!![]}];}_0x4622ad=_[_0x1c54('0x39')]({},_0x4622ad,_0x4dcaa3[_0x1c54('0x3b')]);return db['ServicenowConfiguration'][_0x1c54('0x43')](_0x4622ad)[_0x1c54('0x22')](handleEntityNotFound(_0x1a0a3d,null))[_0x1c54('0x22')](respondWithResult(_0x1a0a3d,null))['catch'](handleError(_0x1a0a3d,null));};exports['create']=function(_0x29ab4b,_0x38b9b4){return db[_0x1c54('0x29')]['create'](_0x29ab4b['body'],{})[_0x1c54('0x22')](respondWithResult(_0x38b9b4,0xc9))[_0x1c54('0x44')](handleError(_0x38b9b4,null));};exports[_0x1c54('0x20')]=function(_0x4abb68,_0x4a763a){if(_0x4abb68[_0x1c54('0x45')]['id']){delete _0x4abb68[_0x1c54('0x45')]['id'];}return db[_0x1c54('0x29')][_0x1c54('0x43')]({'where':{'id':_0x4abb68[_0x1c54('0x40')]['id']}})[_0x1c54('0x22')](handleEntityNotFound(_0x4a763a,null))[_0x1c54('0x22')](saveUpdates(_0x4abb68[_0x1c54('0x45')],null))[_0x1c54('0x22')](respondWithResult(_0x4a763a,null))[_0x1c54('0x44')](handleError(_0x4a763a,null));};exports[_0x1c54('0x21')]=function(_0x4d7ae3,_0x59f3b3){return db[_0x1c54('0x29')][_0x1c54('0x43')]({'where':{'id':_0x4d7ae3['params']['id']}})[_0x1c54('0x22')](handleEntityNotFound(_0x59f3b3,null))['then'](removeEntity(_0x59f3b3,null))[_0x1c54('0x44')](handleError(_0x59f3b3,null));};exports['getFields']=function(_0x37da09,_0x5606b2,_0x3049bb){var _0x699058={};var _0x2aa957={};var _0x4ad60c;var _0x3ceb70;return db[_0x1c54('0x29')][_0x1c54('0x46')]({'where':{'id':_0x37da09[_0x1c54('0x40')]['id']}})[_0x1c54('0x22')](handleEntityNotFound(_0x5606b2,null))[_0x1c54('0x22')](function(_0x542cbf){if(_0x542cbf){_0x4ad60c=_0x542cbf;_0x2aa957[_0x1c54('0x2a')]=_['keys'](db[_0x1c54('0x47')][_0x1c54('0x42')]);_0x2aa957['query']=_[_0x1c54('0x41')](_0x37da09[_0x1c54('0x2c')]);_0x2aa957[_0x1c54('0x2d')]=_[_0x1c54('0x2e')](_0x2aa957[_0x1c54('0x2a')],_0x2aa957[_0x1c54('0x2c')]);_0x699058['attributes']=_[_0x1c54('0x2e')](_0x2aa957[_0x1c54('0x2a')],qs['fields'](_0x37da09[_0x1c54('0x2c')][_0x1c54('0x2f')]));_0x699058[_0x1c54('0x30')]=_0x699058[_0x1c54('0x30')][_0x1c54('0x31')]?_0x699058[_0x1c54('0x30')]:_0x2aa957[_0x1c54('0x2a')];_0x699058['order']=qs[_0x1c54('0x36')](_0x37da09[_0x1c54('0x2c')][_0x1c54('0x36')]);_0x699058[_0x1c54('0x37')]=qs[_0x1c54('0x2d')](_[_0x1c54('0x48')](_0x37da09[_0x1c54('0x2c')],_0x2aa957[_0x1c54('0x2d')]));if(_0x37da09[_0x1c54('0x2c')][_0x1c54('0x38')]){_0x699058[_0x1c54('0x37')]=_[_0x1c54('0x39')](_0x699058[_0x1c54('0x37')],{'$or':_[_0x1c54('0x2b')](_0x699058[_0x1c54('0x30')],function(_0x223a3f){var _0x1a7fa7={};_0x1a7fa7[_0x223a3f]={'$like':'%'+_0x37da09[_0x1c54('0x2c')][_0x1c54('0x38')]+'%'};return _0x1a7fa7;})});}_0x699058=_['merge']({},_0x699058,_0x37da09[_0x1c54('0x3b')]);return _0x4ad60c['getFields'](_0x699058);}})[_0x1c54('0x22')](function(_0x14de5d){if(_0x14de5d){_0x3ceb70=_0x14de5d[_0x1c54('0x31')];if(!_0x37da09[_0x1c54('0x2c')]['hasOwnProperty']('nolimit')){_0x699058[_0x1c54('0x19')]=qs[_0x1c54('0x19')](_0x37da09[_0x1c54('0x2c')]['limit']);_0x699058[_0x1c54('0x34')]=qs[_0x1c54('0x34')](_0x37da09[_0x1c54('0x2c')][_0x1c54('0x34')]);}return _0x4ad60c[_0x1c54('0x49')](_0x699058);}})[_0x1c54('0x22')](function(_0x5938a3){if(_0x5938a3){return _0x5938a3?{'count':_0x3ceb70,'rows':_0x5938a3}:null;}})[_0x1c54('0x22')](respondWithResult(_0x5606b2,null))[_0x1c54('0x44')](handleError(_0x5606b2,null));};exports[_0x1c54('0x4a')]=function(_0x2b28e1,_0x5e290c,_0x220356){var _0x5f13da={};var _0x439e66={};var _0x3d6e0e;var _0x1a28dc;return db['ServicenowConfiguration'][_0x1c54('0x46')]({'where':{'id':_0x2b28e1[_0x1c54('0x40')]['id']}})[_0x1c54('0x22')](handleEntityNotFound(_0x5e290c,null))[_0x1c54('0x22')](function(_0x58b2f5){if(_0x58b2f5){_0x3d6e0e=_0x58b2f5;_0x439e66[_0x1c54('0x2a')]=_[_0x1c54('0x41')](db['ServicenowField'][_0x1c54('0x42')]);_0x439e66[_0x1c54('0x2c')]=_[_0x1c54('0x41')](_0x2b28e1[_0x1c54('0x2c')]);_0x439e66[_0x1c54('0x2d')]=_[_0x1c54('0x2e')](_0x439e66[_0x1c54('0x2a')],_0x439e66[_0x1c54('0x2c')]);_0x5f13da[_0x1c54('0x30')]=_['intersection'](_0x439e66[_0x1c54('0x2a')],qs[_0x1c54('0x2f')](_0x2b28e1['query'][_0x1c54('0x2f')]));_0x5f13da[_0x1c54('0x30')]=_0x5f13da[_0x1c54('0x30')]['length']?_0x5f13da[_0x1c54('0x30')]:_0x439e66[_0x1c54('0x2a')];_0x5f13da['order']=qs[_0x1c54('0x36')](_0x2b28e1[_0x1c54('0x2c')]['sort']);_0x5f13da[_0x1c54('0x37')]=qs[_0x1c54('0x2d')](_[_0x1c54('0x48')](_0x2b28e1[_0x1c54('0x2c')],_0x439e66[_0x1c54('0x2d')]));if(_0x2b28e1['query'][_0x1c54('0x38')]){_0x5f13da['where']=_[_0x1c54('0x39')](_0x5f13da[_0x1c54('0x37')],{'$or':_[_0x1c54('0x2b')](_0x5f13da[_0x1c54('0x30')],function(_0x50ad29){var _0x568da9={};_0x568da9[_0x50ad29]={'$like':'%'+_0x2b28e1[_0x1c54('0x2c')][_0x1c54('0x38')]+'%'};return _0x568da9;})});}_0x5f13da=_['merge']({},_0x5f13da,_0x2b28e1['options']);return _0x3d6e0e[_0x1c54('0x4a')](_0x5f13da);}})[_0x1c54('0x22')](function(_0x4120ca){if(_0x4120ca){_0x1a28dc=_0x4120ca[_0x1c54('0x31')];if(!_0x2b28e1[_0x1c54('0x2c')][_0x1c54('0x32')](_0x1c54('0x33'))){_0x5f13da[_0x1c54('0x19')]=qs[_0x1c54('0x19')](_0x2b28e1[_0x1c54('0x2c')]['limit']);_0x5f13da[_0x1c54('0x34')]=qs[_0x1c54('0x34')](_0x2b28e1['query']['offset']);}return _0x3d6e0e[_0x1c54('0x4a')](_0x5f13da);}})['then'](function(_0x533c1c){if(_0x533c1c){return _0x533c1c?{'count':_0x1a28dc,'rows':_0x533c1c}:null;}})[_0x1c54('0x22')](respondWithResult(_0x5e290c,null))[_0x1c54('0x44')](handleError(_0x5e290c,null));};exports['getDescriptions']=function(_0x4e9bc5,_0x28eba8,_0x300526){var _0x286f93={};var _0x5ca5cd={};var _0x3e7058;var _0x52f866;return db[_0x1c54('0x29')]['findOne']({'where':{'id':_0x4e9bc5[_0x1c54('0x40')]['id']}})[_0x1c54('0x22')](handleEntityNotFound(_0x28eba8,null))[_0x1c54('0x22')](function(_0x23219d){if(_0x23219d){_0x3e7058=_0x23219d;_0x5ca5cd[_0x1c54('0x2a')]=_[_0x1c54('0x41')](db[_0x1c54('0x47')][_0x1c54('0x42')]);_0x5ca5cd[_0x1c54('0x2c')]=_[_0x1c54('0x41')](_0x4e9bc5[_0x1c54('0x2c')]);_0x5ca5cd[_0x1c54('0x2d')]=_[_0x1c54('0x2e')](_0x5ca5cd[_0x1c54('0x2a')],_0x5ca5cd[_0x1c54('0x2c')]);_0x286f93[_0x1c54('0x30')]=_[_0x1c54('0x2e')](_0x5ca5cd[_0x1c54('0x2a')],qs[_0x1c54('0x2f')](_0x4e9bc5[_0x1c54('0x2c')][_0x1c54('0x2f')]));_0x286f93[_0x1c54('0x30')]=_0x286f93[_0x1c54('0x30')][_0x1c54('0x31')]?_0x286f93['attributes']:_0x5ca5cd[_0x1c54('0x2a')];_0x286f93[_0x1c54('0x35')]=qs[_0x1c54('0x36')](_0x4e9bc5[_0x1c54('0x2c')][_0x1c54('0x36')]);_0x286f93[_0x1c54('0x37')]=qs[_0x1c54('0x2d')](_[_0x1c54('0x48')](_0x4e9bc5[_0x1c54('0x2c')],_0x5ca5cd[_0x1c54('0x2d')]));if(_0x4e9bc5['query']['filter']){_0x286f93[_0x1c54('0x37')]=_[_0x1c54('0x39')](_0x286f93[_0x1c54('0x37')],{'$or':_[_0x1c54('0x2b')](_0x286f93[_0x1c54('0x30')],function(_0x2661bf){var _0x2d5e0d={};_0x2d5e0d[_0x2661bf]={'$like':'%'+_0x4e9bc5[_0x1c54('0x2c')]['filter']+'%'};return _0x2d5e0d;})});}_0x286f93=_[_0x1c54('0x39')]({},_0x286f93,_0x4e9bc5[_0x1c54('0x3b')]);return _0x3e7058[_0x1c54('0x4b')](_0x286f93);}})[_0x1c54('0x22')](function(_0x486acf){if(_0x486acf){_0x52f866=_0x486acf[_0x1c54('0x31')];if(!_0x4e9bc5['query'][_0x1c54('0x32')](_0x1c54('0x33'))){_0x286f93[_0x1c54('0x19')]=qs['limit'](_0x4e9bc5[_0x1c54('0x2c')]['limit']);_0x286f93['offset']=qs[_0x1c54('0x34')](_0x4e9bc5[_0x1c54('0x2c')]['offset']);}return _0x3e7058[_0x1c54('0x4b')](_0x286f93);}})['then'](function(_0x9e1150){if(_0x9e1150){return _0x9e1150?{'count':_0x52f866,'rows':_0x9e1150}:null;}})[_0x1c54('0x22')](respondWithResult(_0x28eba8,null))['catch'](handleError(_0x28eba8,null));}; \ No newline at end of file +var _0xa67c=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x1612d6,_0x5577bf){var _0x27a583=function(_0x3dc4a2){while(--_0x3dc4a2){_0x1612d6['push'](_0x1612d6['shift']());}};_0x27a583(++_0x5577bf);}(_0xa67c,0x178));var _0xca67=function(_0x506f19,_0x1af786){_0x506f19=_0x506f19-0x0;var _0x2f5ea0=_0xa67c[_0x506f19];return _0x2f5ea0;};'use strict';var emlformat=require(_0xca67('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xca67('0x1'));var rp=require(_0xca67('0x2'));var moment=require(_0xca67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xca67('0x4'));var util=require(_0xca67('0x5'));var path=require(_0xca67('0x6'));var sox=require(_0xca67('0x7'));var csv=require('to-csv');var ejs=require(_0xca67('0x8'));var fs=require('fs');var fs_extra=require(_0xca67('0x9'));var _=require(_0xca67('0xa'));var squel=require('squel');var crypto=require(_0xca67('0xb'));var jsforce=require(_0xca67('0xc'));var deskjs=require(_0xca67('0xd'));var toCsv=require('to-csv');var querystring=require(_0xca67('0xe'));var Papa=require(_0xca67('0xf'));var Redis=require('ioredis');var authService=require(_0xca67('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xca67('0x11'));var config=require(_0xca67('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xca67('0x13'))['db'];function respondWithStatusCode(_0x2c816a,_0x41d022){_0x41d022=_0x41d022||0xcc;return function(_0x31945d){if(_0x31945d){return _0x2c816a['sendStatus'](_0x41d022);}return _0x2c816a['status'](_0x41d022)['end']();};}function respondWithResult(_0x24d1fb,_0x32c224){_0x32c224=_0x32c224||0xc8;return function(_0x3fe76b){if(_0x3fe76b){return _0x24d1fb['status'](_0x32c224)[_0xca67('0x14')](_0x3fe76b);}};}function respondWithFilteredResult(_0x5eaa74,_0xfa2365){return function(_0x5a871d){if(_0x5a871d){var _0x59e935=typeof _0xfa2365[_0xca67('0x15')]===_0xca67('0x16')&&typeof _0xfa2365['limit']==='undefined';var _0x3fb0e7=_0x5a871d[_0xca67('0x17')];var _0x1e390e=_0x59e935?0x0:_0xfa2365[_0xca67('0x15')];var _0x66c2a6=_0x59e935?_0x5a871d['count']:_0xfa2365[_0xca67('0x15')]+_0xfa2365['limit'];var _0x3e41b2;if(_0x66c2a6>=_0x3fb0e7){_0x66c2a6=_0x3fb0e7;_0x3e41b2=0xc8;}else{_0x3e41b2=0xce;}_0x5eaa74[_0xca67('0x18')](_0x3e41b2);return _0x5eaa74[_0xca67('0x19')](_0xca67('0x1a'),_0x1e390e+'-'+_0x66c2a6+'/'+_0x3fb0e7)[_0xca67('0x14')](_0x5a871d);}return null;};}function patchUpdates(_0x518fa2){return function(_0x5eaa5b){try{jsonpatch[_0xca67('0x1b')](_0x5eaa5b,_0x518fa2,!![]);}catch(_0x45a436){return BPromise[_0xca67('0x1c')](_0x45a436);}return _0x5eaa5b[_0xca67('0x1d')]();};}function saveUpdates(_0x1ea242,_0x5b7b58){return function(_0x38192f){if(_0x38192f){return _0x38192f['update'](_0x1ea242)['then'](function(_0x53790f){return _0x53790f;});}return null;};}function removeEntity(_0x3b1b04,_0x3324ea){return function(_0x152fc7){if(_0x152fc7){return _0x152fc7[_0xca67('0x1e')]()[_0xca67('0x1f')](function(){_0x3b1b04[_0xca67('0x18')](0xcc)[_0xca67('0x20')]();});}};}function handleEntityNotFound(_0x475796,_0x1ae7cc){return function(_0x434f9d){if(!_0x434f9d){_0x475796[_0xca67('0x21')](0x194);}return _0x434f9d;};}function handleError(_0x484ca5,_0x193017){_0x193017=_0x193017||0x1f4;return function(_0x22b8e9){logger[_0xca67('0x22')](_0x22b8e9[_0xca67('0x23')]);if(_0x22b8e9[_0xca67('0x24')]){delete _0x22b8e9[_0xca67('0x24')];}_0x484ca5['status'](_0x193017)['send'](_0x22b8e9);};}exports['index']=function(_0x232774,_0x2b59d8){var _0x28761c={},_0x5d20fe={},_0x683e8c={'count':0x0,'rows':[]};var _0x2f882e=_[_0xca67('0x25')](db[_0xca67('0x26')][_0xca67('0x27')],function(_0x214b6c){return{'name':_0x214b6c[_0xca67('0x28')],'type':_0x214b6c[_0xca67('0x29')][_0xca67('0x2a')]};});_0x5d20fe[_0xca67('0x2b')]=_[_0xca67('0x25')](_0x2f882e,'name');_0x5d20fe[_0xca67('0x2c')]=_[_0xca67('0x2d')](_0x232774['query']);_0x5d20fe['filters']=_[_0xca67('0x2e')](_0x5d20fe[_0xca67('0x2b')],_0x5d20fe[_0xca67('0x2c')]);_0x28761c[_0xca67('0x2f')]=_['intersection'](_0x5d20fe[_0xca67('0x2b')],qs['fields'](_0x232774[_0xca67('0x2c')][_0xca67('0x30')]));_0x28761c[_0xca67('0x2f')]=_0x28761c[_0xca67('0x2f')][_0xca67('0x31')]?_0x28761c[_0xca67('0x2f')]:_0x5d20fe[_0xca67('0x2b')];if(!_0x232774['query'][_0xca67('0x32')](_0xca67('0x33'))){_0x28761c[_0xca67('0x34')]=qs[_0xca67('0x34')](_0x232774['query'][_0xca67('0x34')]);_0x28761c[_0xca67('0x15')]=qs[_0xca67('0x15')](_0x232774[_0xca67('0x2c')][_0xca67('0x15')]);}_0x28761c[_0xca67('0x35')]=qs[_0xca67('0x36')](_0x232774[_0xca67('0x2c')][_0xca67('0x36')]);_0x28761c[_0xca67('0x37')]=qs[_0xca67('0x38')](_[_0xca67('0x39')](_0x232774[_0xca67('0x2c')],_0x5d20fe[_0xca67('0x38')]),_0x2f882e);if(_0x232774[_0xca67('0x2c')][_0xca67('0x3a')]){_0x28761c[_0xca67('0x37')]=_['merge'](_0x28761c['where'],{'$or':_[_0xca67('0x25')](_0x2f882e,function(_0x1b67a6){if(_0x1b67a6[_0xca67('0x29')]!==_0xca67('0x3b')){var _0x35e0ca={};_0x35e0ca[_0x1b67a6[_0xca67('0x24')]]={'$like':'%'+_0x232774[_0xca67('0x2c')]['filter']+'%'};return _0x35e0ca;}})});}_0x28761c=_[_0xca67('0x3c')]({},_0x28761c,_0x232774['options']);var _0x268e21={'where':_0x28761c[_0xca67('0x37')]};return db[_0xca67('0x26')][_0xca67('0x17')](_0x268e21)['then'](function(_0x2b9c07){_0x683e8c[_0xca67('0x17')]=_0x2b9c07;if(_0x232774['query'][_0xca67('0x3d')]){_0x28761c[_0xca67('0x3e')]=[{'all':!![]}];}return db[_0xca67('0x26')][_0xca67('0x3f')](_0x28761c);})[_0xca67('0x1f')](function(_0x5dc2ad){_0x683e8c[_0xca67('0x40')]=_0x5dc2ad;return _0x683e8c;})[_0xca67('0x1f')](respondWithFilteredResult(_0x2b59d8,_0x28761c))[_0xca67('0x41')](handleError(_0x2b59d8,null));};exports[_0xca67('0x42')]=function(_0x2e518e,_0x4bb117){var _0x42e729={'raw':![],'where':{'id':_0x2e518e[_0xca67('0x43')]['id']}},_0x183275={};_0x183275['model']=_[_0xca67('0x2d')](db[_0xca67('0x26')][_0xca67('0x27')]);_0x183275[_0xca67('0x2c')]=_[_0xca67('0x2d')](_0x2e518e[_0xca67('0x2c')]);_0x183275[_0xca67('0x38')]=_[_0xca67('0x2e')](_0x183275['model'],_0x183275[_0xca67('0x2c')]);_0x42e729[_0xca67('0x2f')]=_['intersection'](_0x183275[_0xca67('0x2b')],qs['fields'](_0x2e518e['query'][_0xca67('0x30')]));_0x42e729[_0xca67('0x2f')]=_0x42e729[_0xca67('0x2f')]['length']?_0x42e729[_0xca67('0x2f')]:_0x183275[_0xca67('0x2b')];if(_0x2e518e[_0xca67('0x2c')][_0xca67('0x3d')]){_0x42e729[_0xca67('0x3e')]=[{'all':!![]}];}_0x42e729=_['merge']({},_0x42e729,_0x2e518e[_0xca67('0x44')]);return db[_0xca67('0x26')]['find'](_0x42e729)['then'](handleEntityNotFound(_0x4bb117,null))[_0xca67('0x1f')](respondWithResult(_0x4bb117,null))[_0xca67('0x41')](handleError(_0x4bb117,null));};exports[_0xca67('0x45')]=function(_0x425158,_0x1fa582){return db[_0xca67('0x26')][_0xca67('0x45')](_0x425158[_0xca67('0x46')],{})['then'](respondWithResult(_0x1fa582,0xc9))[_0xca67('0x41')](handleError(_0x1fa582,null));};exports['update']=function(_0x1cf987,_0x364bcf){if(_0x1cf987[_0xca67('0x46')]['id']){delete _0x1cf987[_0xca67('0x46')]['id'];}return db['ServicenowConfiguration'][_0xca67('0x47')]({'where':{'id':_0x1cf987[_0xca67('0x43')]['id']}})[_0xca67('0x1f')](handleEntityNotFound(_0x364bcf,null))[_0xca67('0x1f')](saveUpdates(_0x1cf987['body'],null))[_0xca67('0x1f')](respondWithResult(_0x364bcf,null))['catch'](handleError(_0x364bcf,null));};exports[_0xca67('0x1e')]=function(_0x4b9318,_0x245fff){return db[_0xca67('0x26')][_0xca67('0x47')]({'where':{'id':_0x4b9318[_0xca67('0x43')]['id']}})['then'](handleEntityNotFound(_0x245fff,null))['then'](removeEntity(_0x245fff,null))[_0xca67('0x41')](handleError(_0x245fff,null));};exports[_0xca67('0x48')]=function(_0x5a13c9,_0x952fb4,_0x1bc453){var _0x1a0ffa={};var _0x20158e={};var _0x2cd01f;var _0x2ee8fd;return db[_0xca67('0x26')][_0xca67('0x49')]({'where':{'id':_0x5a13c9[_0xca67('0x43')]['id']}})['then'](handleEntityNotFound(_0x952fb4,null))['then'](function(_0x48b6b0){if(_0x48b6b0){_0x2cd01f=_0x48b6b0;_0x20158e[_0xca67('0x2b')]=_[_0xca67('0x2d')](db[_0xca67('0x4a')][_0xca67('0x27')]);_0x20158e[_0xca67('0x2c')]=_[_0xca67('0x2d')](_0x5a13c9[_0xca67('0x2c')]);_0x20158e[_0xca67('0x38')]=_[_0xca67('0x2e')](_0x20158e[_0xca67('0x2b')],_0x20158e[_0xca67('0x2c')]);_0x1a0ffa['attributes']=_[_0xca67('0x2e')](_0x20158e['model'],qs[_0xca67('0x30')](_0x5a13c9[_0xca67('0x2c')][_0xca67('0x30')]));_0x1a0ffa[_0xca67('0x2f')]=_0x1a0ffa[_0xca67('0x2f')][_0xca67('0x31')]?_0x1a0ffa[_0xca67('0x2f')]:_0x20158e[_0xca67('0x2b')];_0x1a0ffa['order']=qs[_0xca67('0x36')](_0x5a13c9[_0xca67('0x2c')][_0xca67('0x36')]);_0x1a0ffa['where']=qs[_0xca67('0x38')](_['pick'](_0x5a13c9['query'],_0x20158e[_0xca67('0x38')]));if(_0x5a13c9[_0xca67('0x2c')][_0xca67('0x3a')]){_0x1a0ffa[_0xca67('0x37')]=_[_0xca67('0x3c')](_0x1a0ffa[_0xca67('0x37')],{'$or':_['map'](_0x1a0ffa[_0xca67('0x2f')],function(_0x27ced6){var _0x3bc4b1={};_0x3bc4b1[_0x27ced6]={'$like':'%'+_0x5a13c9[_0xca67('0x2c')]['filter']+'%'};return _0x3bc4b1;})});}_0x1a0ffa=_[_0xca67('0x3c')]({},_0x1a0ffa,_0x5a13c9[_0xca67('0x44')]);return _0x2cd01f['getFields'](_0x1a0ffa);}})['then'](function(_0x51f070){if(_0x51f070){_0x2ee8fd=_0x51f070[_0xca67('0x31')];if(!_0x5a13c9['query'][_0xca67('0x32')](_0xca67('0x33'))){_0x1a0ffa['limit']=qs[_0xca67('0x34')](_0x5a13c9[_0xca67('0x2c')][_0xca67('0x34')]);_0x1a0ffa[_0xca67('0x15')]=qs[_0xca67('0x15')](_0x5a13c9[_0xca67('0x2c')][_0xca67('0x15')]);}return _0x2cd01f[_0xca67('0x48')](_0x1a0ffa);}})[_0xca67('0x1f')](function(_0x244e74){if(_0x244e74){return _0x244e74?{'count':_0x2ee8fd,'rows':_0x244e74}:null;}})['then'](respondWithResult(_0x952fb4,null))[_0xca67('0x41')](handleError(_0x952fb4,null));};exports['getSubjects']=function(_0x3ffeac,_0x2c0540,_0x1a4f9f){var _0x317563={};var _0x3850e7={};var _0x758302;var _0x56804d;return db[_0xca67('0x26')][_0xca67('0x49')]({'where':{'id':_0x3ffeac[_0xca67('0x43')]['id']}})[_0xca67('0x1f')](handleEntityNotFound(_0x2c0540,null))[_0xca67('0x1f')](function(_0x5be4a2){if(_0x5be4a2){_0x758302=_0x5be4a2;_0x3850e7[_0xca67('0x2b')]=_[_0xca67('0x2d')](db[_0xca67('0x4a')][_0xca67('0x27')]);_0x3850e7[_0xca67('0x2c')]=_[_0xca67('0x2d')](_0x3ffeac['query']);_0x3850e7['filters']=_[_0xca67('0x2e')](_0x3850e7[_0xca67('0x2b')],_0x3850e7[_0xca67('0x2c')]);_0x317563['attributes']=_[_0xca67('0x2e')](_0x3850e7['model'],qs[_0xca67('0x30')](_0x3ffeac[_0xca67('0x2c')][_0xca67('0x30')]));_0x317563[_0xca67('0x2f')]=_0x317563[_0xca67('0x2f')][_0xca67('0x31')]?_0x317563[_0xca67('0x2f')]:_0x3850e7[_0xca67('0x2b')];_0x317563[_0xca67('0x35')]=qs['sort'](_0x3ffeac[_0xca67('0x2c')][_0xca67('0x36')]);_0x317563[_0xca67('0x37')]=qs[_0xca67('0x38')](_[_0xca67('0x39')](_0x3ffeac['query'],_0x3850e7[_0xca67('0x38')]));if(_0x3ffeac[_0xca67('0x2c')]['filter']){_0x317563[_0xca67('0x37')]=_[_0xca67('0x3c')](_0x317563[_0xca67('0x37')],{'$or':_[_0xca67('0x25')](_0x317563[_0xca67('0x2f')],function(_0x19fa4d){var _0x399bf0={};_0x399bf0[_0x19fa4d]={'$like':'%'+_0x3ffeac[_0xca67('0x2c')][_0xca67('0x3a')]+'%'};return _0x399bf0;})});}_0x317563=_[_0xca67('0x3c')]({},_0x317563,_0x3ffeac[_0xca67('0x44')]);return _0x758302[_0xca67('0x4b')](_0x317563);}})[_0xca67('0x1f')](function(_0x5b617d){if(_0x5b617d){_0x56804d=_0x5b617d[_0xca67('0x31')];if(!_0x3ffeac['query'][_0xca67('0x32')](_0xca67('0x33'))){_0x317563[_0xca67('0x34')]=qs[_0xca67('0x34')](_0x3ffeac[_0xca67('0x2c')][_0xca67('0x34')]);_0x317563[_0xca67('0x15')]=qs[_0xca67('0x15')](_0x3ffeac[_0xca67('0x2c')][_0xca67('0x15')]);}return _0x758302[_0xca67('0x4b')](_0x317563);}})[_0xca67('0x1f')](function(_0xce1968){if(_0xce1968){return _0xce1968?{'count':_0x56804d,'rows':_0xce1968}:null;}})[_0xca67('0x1f')](respondWithResult(_0x2c0540,null))[_0xca67('0x41')](handleError(_0x2c0540,null));};exports[_0xca67('0x4c')]=function(_0x88190,_0x2d73b3,_0x5992cf){var _0x2781d9={};var _0x467193={};var _0x36f9b3;var _0x1a5e20;return db['ServicenowConfiguration'][_0xca67('0x49')]({'where':{'id':_0x88190['params']['id']}})['then'](handleEntityNotFound(_0x2d73b3,null))[_0xca67('0x1f')](function(_0x5e96ab){if(_0x5e96ab){_0x36f9b3=_0x5e96ab;_0x467193[_0xca67('0x2b')]=_[_0xca67('0x2d')](db['ServicenowField']['rawAttributes']);_0x467193[_0xca67('0x2c')]=_[_0xca67('0x2d')](_0x88190[_0xca67('0x2c')]);_0x467193[_0xca67('0x38')]=_[_0xca67('0x2e')](_0x467193['model'],_0x467193['query']);_0x2781d9[_0xca67('0x2f')]=_[_0xca67('0x2e')](_0x467193[_0xca67('0x2b')],qs[_0xca67('0x30')](_0x88190[_0xca67('0x2c')][_0xca67('0x30')]));_0x2781d9['attributes']=_0x2781d9[_0xca67('0x2f')][_0xca67('0x31')]?_0x2781d9[_0xca67('0x2f')]:_0x467193[_0xca67('0x2b')];_0x2781d9['order']=qs[_0xca67('0x36')](_0x88190['query']['sort']);_0x2781d9[_0xca67('0x37')]=qs[_0xca67('0x38')](_['pick'](_0x88190[_0xca67('0x2c')],_0x467193[_0xca67('0x38')]));if(_0x88190[_0xca67('0x2c')]['filter']){_0x2781d9['where']=_[_0xca67('0x3c')](_0x2781d9['where'],{'$or':_['map'](_0x2781d9[_0xca67('0x2f')],function(_0x679002){var _0x26d8b7={};_0x26d8b7[_0x679002]={'$like':'%'+_0x88190['query'][_0xca67('0x3a')]+'%'};return _0x26d8b7;})});}_0x2781d9=_[_0xca67('0x3c')]({},_0x2781d9,_0x88190[_0xca67('0x44')]);return _0x36f9b3[_0xca67('0x4c')](_0x2781d9);}})[_0xca67('0x1f')](function(_0x2a431f){if(_0x2a431f){_0x1a5e20=_0x2a431f[_0xca67('0x31')];if(!_0x88190[_0xca67('0x2c')][_0xca67('0x32')](_0xca67('0x33'))){_0x2781d9[_0xca67('0x34')]=qs['limit'](_0x88190[_0xca67('0x2c')]['limit']);_0x2781d9[_0xca67('0x15')]=qs['offset'](_0x88190[_0xca67('0x2c')][_0xca67('0x15')]);}return _0x36f9b3['getDescriptions'](_0x2781d9);}})['then'](function(_0x20b4ef){if(_0x20b4ef){return _0x20b4ef?{'count':_0x1a5e20,'rows':_0x20b4ef}:null;}})[_0xca67('0x1f')](respondWithResult(_0x2d73b3,null))[_0xca67('0x41')](handleError(_0x2d73b3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b7c17ff..558d927 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 _0xa5dd=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xf0855a,_0x5d9f32){var _0xd29e07=function(_0x2f24d6){while(--_0x2f24d6){_0xf0855a['push'](_0xf0855a['shift']());}};_0xd29e07(++_0x5d9f32);}(_0xa5dd,0x101));var _0xda5d=function(_0x46c632,_0x1d7b55){_0x46c632=_0x46c632-0x0;var _0x817732=_0xa5dd[_0x46c632];return _0x817732;};'use strict';var _=require(_0xda5d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda5d('0x1'));var moment=require(_0xda5d('0x2'));var BPromise=require(_0xda5d('0x3'));var rp=require(_0xda5d('0x4'));var fs=require('fs');var path=require(_0xda5d('0x5'));var rimraf=require('rimraf');var config=require(_0xda5d('0x6'));var attributes=require(_0xda5d('0x7'));module[_0xda5d('0x8')]=function(_0x5a437a,_0x555107){return _0x5a437a[_0xda5d('0x9')](_0xda5d('0xa'),attributes,{'tableName':_0xda5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment'];(function(_0x161174,_0x476178){var _0xed5776=function(_0x131d3b){while(--_0x131d3b){_0x161174['push'](_0x161174['shift']());}};_0xed5776(++_0x476178);}(_0x0c2b,0x194));var _0xb0c2=function(_0x3096a9,_0x30dbea){_0x3096a9=_0x3096a9-0x0;var _0x156795=_0x0c2b[_0x3096a9];return _0x156795;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('0xb'),'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 aa83d45..007c1b2 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 _0xb01a=['stringify','error','message','lodash','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x170b30,_0xfbeb58){var _0x49f408=function(_0x40d018){while(--_0x40d018){_0x170b30['push'](_0x170b30['shift']());}};_0x49f408(++_0xfbeb58);}(_0xb01a,0x124));var _0xab01=function(_0x18ca32,_0x136bd4){_0x18ca32=_0x18ca32-0x0;var _0x23761a=_0xb01a[_0x18ca32];return _0x23761a;};'use strict';var _=require(_0xab01('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab01('0x1'));var rs=require(_0xab01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab01('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xab01('0x4'));var config=require('../../config/environment');var jayson=require(_0xab01('0x5'));var client=jayson[_0xab01('0x6')][_0xab01('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ec418,_0x346a3b,_0x315377){return new BPromise(function(_0x25d78d,_0x4431b9){return client['request'](_0x1ec418,_0x315377)[_0xab01('0x8')](function(_0x10ea1d){logger[_0xab01('0x9')](_0xab01('0xa'),_0x346a3b,_0xab01('0xb'));logger[_0xab01('0xc')](_0xab01('0xd'),_0x346a3b,_0xab01('0xb'),JSON[_0xab01('0xe')](_0x10ea1d));if(_0x10ea1d[_0xab01('0xf')]){if(_0x10ea1d[_0xab01('0xf')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x346a3b,_0x10ea1d[_0xab01('0xf')][_0xab01('0x10')]);return _0x4431b9(_0x10ea1d['error']['message']);}logger[_0xab01('0xf')](_0xab01('0xa'),_0x346a3b,_0x10ea1d[_0xab01('0xf')][_0xab01('0x10')]);return _0x25d78d(_0x10ea1d[_0xab01('0xf')]['message']);}else{logger[_0xab01('0x9')](_0xab01('0xa'),_0x346a3b,_0xab01('0xb'));_0x25d78d(_0x10ea1d['result'][_0xab01('0x10')]);}})['catch'](function(_0x15df20){logger[_0xab01('0xf')](_0xab01('0xa'),_0x346a3b,_0x15df20);_0x4431b9(_0x15df20);});});} \ No newline at end of file +var _0x745c=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x745c,0x1c0));var _0xc745=function(_0x34947e,_0x45c404){_0x34947e=_0x34947e-0x0;var _0x87404f=_0x745c[_0x34947e];return _0x87404f;};'use strict';var _=require(_0xc745('0x0'));var util=require(_0xc745('0x1'));var moment=require(_0xc745('0x2'));var BPromise=require('bluebird');var rs=require(_0xc745('0x3'));var fs=require('fs');var Redis=require(_0xc745('0x4'));var db=require(_0xc745('0x5'))['db'];var utils=require(_0xc745('0x6'));var logger=require(_0xc745('0x7'))(_0xc745('0x8'));var config=require(_0xc745('0x9'));var jayson=require(_0xc745('0xa'));var client=jayson[_0xc745('0xb')][_0xc745('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20767a,_0x198272,_0x1c6a3){return new BPromise(function(_0x36ee5c,_0x445da3){return client[_0xc745('0xd')](_0x20767a,_0x1c6a3)['then'](function(_0x1aa7e6){logger[_0xc745('0xe')](_0xc745('0xf'),_0x198272,'request\x20sent');logger[_0xc745('0x10')](_0xc745('0x11'),_0x198272,_0xc745('0x12'),JSON[_0xc745('0x13')](_0x1aa7e6));if(_0x1aa7e6[_0xc745('0x14')]){if(_0x1aa7e6[_0xc745('0x14')][_0xc745('0x15')]===0x1f4){logger['error'](_0xc745('0xf'),_0x198272,_0x1aa7e6[_0xc745('0x14')][_0xc745('0x16')]);return _0x445da3(_0x1aa7e6['error'][_0xc745('0x16')]);}logger[_0xc745('0x14')](_0xc745('0xf'),_0x198272,_0x1aa7e6[_0xc745('0x14')]['message']);return _0x36ee5c(_0x1aa7e6[_0xc745('0x14')][_0xc745('0x16')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x198272,'request\x20sent');_0x36ee5c(_0x1aa7e6[_0xc745('0x17')][_0xc745('0x16')]);}})[_0xc745('0x18')](function(_0x10490b){logger[_0xc745('0x14')](_0xc745('0xf'),_0x198272,_0x10490b);_0x445da3(_0x10490b);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 78e19fc..b4d2dd9 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 _0xb03b=['isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x37fb54,_0x2797e4){var _0x5e9820=function(_0x4693eb){while(--_0x4693eb){_0x37fb54['push'](_0x37fb54['shift']());}};_0x5e9820(++_0x2797e4);}(_0xb03b,0x107));var _0xbb03=function(_0x1cad18,_0x5c31e8){_0x1cad18=_0x1cad18-0x0;var _0x5f1609=_0xb03b[_0x1cad18];return _0x5f1609;};'use strict';var multer=require(_0xbb03('0x0'));var util=require(_0xbb03('0x1'));var path=require(_0xbb03('0x2'));var timeout=require(_0xbb03('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbb03('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb03('0x5'));var config=require(_0xbb03('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xbb03('0x7')](),controller[_0xbb03('0x8')]);router[_0xbb03('0x9')](_0xbb03('0xa'),auth[_0xbb03('0x7')](),controller['show']);router[_0xbb03('0xb')]('/',auth[_0xbb03('0x7')](),controller[_0xbb03('0xc')]);router[_0xbb03('0xd')](_0xbb03('0xa'),auth['isAuthenticated'](),controller[_0xbb03('0xe')]);router[_0xbb03('0xf')](_0xbb03('0xa'),auth[_0xbb03('0x7')](),controller[_0xbb03('0x10')]);module[_0xbb03('0x11')]=router; \ No newline at end of file +var _0xff48=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','util','path'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0xff48,0x1ae));var _0x8ff4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xff48[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x8ff4('0x0'));var path=require(_0x8ff4('0x1'));var timeout=require(_0x8ff4('0x2'));var express=require(_0x8ff4('0x3'));var router=express[_0x8ff4('0x4')]();var fs_extra=require(_0x8ff4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ff4('0x6'));var config=require('../../config/environment');var controller=require(_0x8ff4('0x7'));router['get']('/',auth[_0x8ff4('0x8')](),controller[_0x8ff4('0x9')]);router[_0x8ff4('0xa')](_0x8ff4('0xb'),auth[_0x8ff4('0x8')](),controller[_0x8ff4('0xc')]);router[_0x8ff4('0xd')]('/',auth[_0x8ff4('0x8')](),controller[_0x8ff4('0xe')]);router['put'](_0x8ff4('0xb'),auth['isAuthenticated'](),controller[_0x8ff4('0xf')]);router[_0x8ff4('0x10')](_0x8ff4('0xb'),auth[_0x8ff4('0x8')](),controller[_0x8ff4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index cdfa18b..09b6694 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 _0x94b8=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0x94b8,0x16d));var _0x894b=function(_0x5cd50c,_0x35f357){_0x5cd50c=_0x5cd50c-0x0;var _0x2dfd8b=_0x94b8[_0x5cd50c];return _0x2dfd8b;};'use strict';var Sequelize=require(_0x894b('0x0'));module[_0x894b('0x1')]={'type':{'type':Sequelize[_0x894b('0x2')](_0x894b('0x3'),_0x894b('0x4'),_0x894b('0x5'),_0x894b('0x6'),'picklist'),'defaultValue':_0x894b('0x3')},'content':{'type':Sequelize[_0x894b('0x7')]},'key':{'type':Sequelize[_0x894b('0x7')]},'keyType':{'type':Sequelize[_0x894b('0x2')](_0x894b('0x3'),_0x894b('0x4'),_0x894b('0x5'))},'keyContent':{'type':Sequelize[_0x894b('0x7')]},'idField':{'type':Sequelize[_0x894b('0x7')]},'nameField':{'type':Sequelize[_0x894b('0x7')]},'customField':{'type':Sequelize[_0x894b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x894b('0x7')]}}; \ No newline at end of file +var _0x420c=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x420c,0x192));var _0xc420=function(_0x2b41ec,_0x2fe9fc){_0x2b41ec=_0x2b41ec-0x0;var _0x3db8f4=_0x420c[_0x2b41ec];return _0x3db8f4;};'use strict';var Sequelize=require(_0xc420('0x0'));module[_0xc420('0x1')]={'type':{'type':Sequelize[_0xc420('0x2')](_0xc420('0x3'),'variable','customVariable',_0xc420('0x4'),_0xc420('0x5')),'defaultValue':_0xc420('0x3')},'content':{'type':Sequelize[_0xc420('0x6')]},'key':{'type':Sequelize[_0xc420('0x6')]},'keyType':{'type':Sequelize[_0xc420('0x2')]('string',_0xc420('0x7'),_0xc420('0x8'))},'keyContent':{'type':Sequelize[_0xc420('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc420('0x6')]},'customField':{'type':Sequelize[_0xc420('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc420('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 68eda2e..4fd0bd0 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 _0x4aac=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','apply','save','destroy','then','end','stack','name','send','index','map','ServicenowField','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','update','body','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto'];(function(_0x2ba94a,_0x20634f){var _0x55f423=function(_0x3174a0){while(--_0x3174a0){_0x2ba94a['push'](_0x2ba94a['shift']());}};_0x55f423(++_0x20634f);}(_0x4aac,0x154));var _0xc4aa=function(_0x525b76,_0x3b08a4){_0x525b76=_0x525b76-0x0;var _0x2ac8dc=_0x4aac[_0x525b76];return _0x2ac8dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4aa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4aa('0x1'));var moment=require('moment');var BPromise=require(_0xc4aa('0x2'));var Mustache=require(_0xc4aa('0x3'));var util=require(_0xc4aa('0x4'));var path=require(_0xc4aa('0x5'));var sox=require(_0xc4aa('0x6'));var csv=require(_0xc4aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc4aa('0x8'));var crypto=require(_0xc4aa('0x9'));var jsforce=require(_0xc4aa('0xa'));var deskjs=require(_0xc4aa('0xb'));var toCsv=require(_0xc4aa('0x7'));var querystring=require('querystring');var Papa=require(_0xc4aa('0xc'));var Redis=require(_0xc4aa('0xd'));var authService=require(_0xc4aa('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4aa('0xf'));var logger=require('../../config/logger')(_0xc4aa('0x10'));var utils=require(_0xc4aa('0x11'));var config=require(_0xc4aa('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4aa('0x13'))['db'];function respondWithStatusCode(_0x391a13,_0x242a84){_0x242a84=_0x242a84||0xcc;return function(_0x3a0fd8){if(_0x3a0fd8){return _0x391a13[_0xc4aa('0x14')](_0x242a84);}return _0x391a13[_0xc4aa('0x15')](_0x242a84)['end']();};}function respondWithResult(_0x469fb7,_0x3458df){_0x3458df=_0x3458df||0xc8;return function(_0x4da586){if(_0x4da586){return _0x469fb7[_0xc4aa('0x15')](_0x3458df)['json'](_0x4da586);}};}function respondWithFilteredResult(_0x1699dd,_0x23b8bb){return function(_0x54009a){if(_0x54009a){var _0x5c2bf4=typeof _0x23b8bb[_0xc4aa('0x16')]===_0xc4aa('0x17')&&typeof _0x23b8bb['limit']===_0xc4aa('0x17');var _0x4640af=_0x54009a['count'];var _0x33e767=_0x5c2bf4?0x0:_0x23b8bb[_0xc4aa('0x16')];var _0x3ad138=_0x5c2bf4?_0x54009a[_0xc4aa('0x18')]:_0x23b8bb[_0xc4aa('0x16')]+_0x23b8bb['limit'];var _0x1f4fa8;if(_0x3ad138>=_0x4640af){_0x3ad138=_0x4640af;_0x1f4fa8=0xc8;}else{_0x1f4fa8=0xce;}_0x1699dd[_0xc4aa('0x15')](_0x1f4fa8);return _0x1699dd[_0xc4aa('0x19')](_0xc4aa('0x1a'),_0x33e767+'-'+_0x3ad138+'/'+_0x4640af)['json'](_0x54009a);}return null;};}function patchUpdates(_0x48817e){return function(_0xb6ee9f){try{jsonpatch[_0xc4aa('0x1b')](_0xb6ee9f,_0x48817e,!![]);}catch(_0x37270b){return BPromise['reject'](_0x37270b);}return _0xb6ee9f[_0xc4aa('0x1c')]();};}function saveUpdates(_0x45397e,_0x3adf7f){return function(_0x1bee6c){if(_0x1bee6c){return _0x1bee6c['update'](_0x45397e)['then'](function(_0x276ad6){return _0x276ad6;});}return null;};}function removeEntity(_0x26a464,_0x22342c){return function(_0x11fa43){if(_0x11fa43){return _0x11fa43[_0xc4aa('0x1d')]()[_0xc4aa('0x1e')](function(){_0x26a464[_0xc4aa('0x15')](0xcc)[_0xc4aa('0x1f')]();});}};}function handleEntityNotFound(_0x283065,_0x1e5351){return function(_0x8bc942){if(!_0x8bc942){_0x283065['sendStatus'](0x194);}return _0x8bc942;};}function handleError(_0xc98725,_0x55c52c){_0x55c52c=_0x55c52c||0x1f4;return function(_0x594aa7){logger['error'](_0x594aa7[_0xc4aa('0x20')]);if(_0x594aa7[_0xc4aa('0x21')]){delete _0x594aa7[_0xc4aa('0x21')];}_0xc98725['status'](_0x55c52c)[_0xc4aa('0x22')](_0x594aa7);};}exports[_0xc4aa('0x23')]=function(_0x2e646f,_0x5178c5){var _0x114fdf={},_0x31079b={},_0x3b9036={'count':0x0,'rows':[]};var _0x41e9e6=_[_0xc4aa('0x24')](db[_0xc4aa('0x25')]['rawAttributes'],function(_0x24d1f5){return{'name':_0x24d1f5['fieldName'],'type':_0x24d1f5[_0xc4aa('0x26')][_0xc4aa('0x27')]};});_0x31079b[_0xc4aa('0x28')]=_['map'](_0x41e9e6,'name');_0x31079b[_0xc4aa('0x29')]=_[_0xc4aa('0x2a')](_0x2e646f[_0xc4aa('0x29')]);_0x31079b['filters']=_['intersection'](_0x31079b['model'],_0x31079b[_0xc4aa('0x29')]);_0x114fdf[_0xc4aa('0x2b')]=_[_0xc4aa('0x2c')](_0x31079b[_0xc4aa('0x28')],qs[_0xc4aa('0x2d')](_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x2d')]));_0x114fdf[_0xc4aa('0x2b')]=_0x114fdf[_0xc4aa('0x2b')]['length']?_0x114fdf['attributes']:_0x31079b[_0xc4aa('0x28')];if(!_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x2e')](_0xc4aa('0x2f'))){_0x114fdf[_0xc4aa('0x30')]=qs[_0xc4aa('0x30')](_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x30')]);_0x114fdf[_0xc4aa('0x16')]=qs['offset'](_0x2e646f['query'][_0xc4aa('0x16')]);}_0x114fdf[_0xc4aa('0x31')]=qs[_0xc4aa('0x32')](_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x32')]);_0x114fdf[_0xc4aa('0x33')]=qs['filters'](_[_0xc4aa('0x34')](_0x2e646f[_0xc4aa('0x29')],_0x31079b[_0xc4aa('0x35')]),_0x41e9e6);if(_0x2e646f['query'][_0xc4aa('0x36')]){_0x114fdf['where']=_[_0xc4aa('0x37')](_0x114fdf[_0xc4aa('0x33')],{'$or':_['map'](_0x41e9e6,function(_0x25b4d0){if(_0x25b4d0[_0xc4aa('0x26')]!==_0xc4aa('0x38')){var _0x55ac68={};_0x55ac68[_0x25b4d0[_0xc4aa('0x21')]]={'$like':'%'+_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x36')]+'%'};return _0x55ac68;}})});}_0x114fdf=_['merge']({},_0x114fdf,_0x2e646f[_0xc4aa('0x39')]);var _0x104606={'where':_0x114fdf[_0xc4aa('0x33')]};return db[_0xc4aa('0x25')][_0xc4aa('0x18')](_0x104606)['then'](function(_0x34e13b){_0x3b9036[_0xc4aa('0x18')]=_0x34e13b;if(_0x2e646f[_0xc4aa('0x29')][_0xc4aa('0x3a')]){_0x114fdf[_0xc4aa('0x3b')]=[{'all':!![]}];}return db[_0xc4aa('0x25')][_0xc4aa('0x3c')](_0x114fdf);})[_0xc4aa('0x1e')](function(_0x30f1e7){_0x3b9036[_0xc4aa('0x3d')]=_0x30f1e7;return _0x3b9036;})[_0xc4aa('0x1e')](respondWithFilteredResult(_0x5178c5,_0x114fdf))['catch'](handleError(_0x5178c5,null));};exports[_0xc4aa('0x3e')]=function(_0x2da0b6,_0x11de82){var _0x3cebda={'raw':!![],'where':{'id':_0x2da0b6[_0xc4aa('0x3f')]['id']}},_0x3fe672={};_0x3fe672['model']=_[_0xc4aa('0x2a')](db[_0xc4aa('0x25')][_0xc4aa('0x40')]);_0x3fe672[_0xc4aa('0x29')]=_[_0xc4aa('0x2a')](_0x2da0b6[_0xc4aa('0x29')]);_0x3fe672[_0xc4aa('0x35')]=_[_0xc4aa('0x2c')](_0x3fe672[_0xc4aa('0x28')],_0x3fe672['query']);_0x3cebda['attributes']=_['intersection'](_0x3fe672[_0xc4aa('0x28')],qs[_0xc4aa('0x2d')](_0x2da0b6[_0xc4aa('0x29')]['fields']));_0x3cebda['attributes']=_0x3cebda[_0xc4aa('0x2b')]['length']?_0x3cebda[_0xc4aa('0x2b')]:_0x3fe672[_0xc4aa('0x28')];if(_0x2da0b6['query'][_0xc4aa('0x3a')]){_0x3cebda[_0xc4aa('0x3b')]=[{'all':!![]}];}_0x3cebda=_[_0xc4aa('0x37')]({},_0x3cebda,_0x2da0b6[_0xc4aa('0x39')]);return db['ServicenowField'][_0xc4aa('0x41')](_0x3cebda)[_0xc4aa('0x1e')](handleEntityNotFound(_0x11de82,null))[_0xc4aa('0x1e')](respondWithResult(_0x11de82,null))[_0xc4aa('0x42')](handleError(_0x11de82,null));};exports[_0xc4aa('0x43')]=function(_0x58dadf,_0x3333b9){return db[_0xc4aa('0x25')][_0xc4aa('0x43')](_0x58dadf['body'],{})[_0xc4aa('0x1e')](respondWithResult(_0x3333b9,0xc9))[_0xc4aa('0x42')](handleError(_0x3333b9,null));};exports[_0xc4aa('0x44')]=function(_0x37c534,_0x9addac){if(_0x37c534['body']['id']){delete _0x37c534[_0xc4aa('0x45')]['id'];}return db[_0xc4aa('0x25')]['find']({'where':{'id':_0x37c534[_0xc4aa('0x3f')]['id']}})[_0xc4aa('0x1e')](handleEntityNotFound(_0x9addac,null))[_0xc4aa('0x1e')](saveUpdates(_0x37c534[_0xc4aa('0x45')],null))[_0xc4aa('0x1e')](respondWithResult(_0x9addac,null))['catch'](handleError(_0x9addac,null));};exports[_0xc4aa('0x1d')]=function(_0x288cdd,_0xc0b511){return db['ServicenowField'][_0xc4aa('0x41')]({'where':{'id':_0x288cdd[_0xc4aa('0x3f')]['id']}})[_0xc4aa('0x1e')](handleEntityNotFound(_0xc0b511,null))[_0xc4aa('0x1e')](removeEntity(_0xc0b511,null))[_0xc4aa('0x42')](handleError(_0xc0b511,null));}; \ No newline at end of file +var _0xb3cc=['pick','filter','merge','type','VIRTUAL','options','include','ServicenowField','findAll','rows','show','params','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x284419,_0x4af55d){var _0x2d191e=function(_0x3eb44d){while(--_0x3eb44d){_0x284419['push'](_0x284419['shift']());}};_0x2d191e(++_0x4af55d);}(_0xb3cc,0xa7));var _0xcb3c=function(_0x3f3a92,_0xb232c){_0x3f3a92=_0x3f3a92-0x0;var _0x52727a=_0xb3cc[_0x3f3a92];return _0x52727a;};'use strict';var emlformat=require(_0xcb3c('0x0'));var rimraf=require(_0xcb3c('0x1'));var zipdir=require(_0xcb3c('0x2'));var jsonpatch=require(_0xcb3c('0x3'));var rp=require(_0xcb3c('0x4'));var moment=require(_0xcb3c('0x5'));var BPromise=require(_0xcb3c('0x6'));var Mustache=require(_0xcb3c('0x7'));var util=require('util');var path=require(_0xcb3c('0x8'));var sox=require(_0xcb3c('0x9'));var csv=require(_0xcb3c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb3c('0xb'));var _=require(_0xcb3c('0xc'));var squel=require(_0xcb3c('0xd'));var crypto=require(_0xcb3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcb3c('0xf'));var toCsv=require(_0xcb3c('0xa'));var querystring=require(_0xcb3c('0x10'));var Papa=require(_0xcb3c('0x11'));var Redis=require(_0xcb3c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcb3c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb3c('0x14'));var logger=require(_0xcb3c('0x15'))(_0xcb3c('0x16'));var utils=require('../../config/utils');var config=require(_0xcb3c('0x17'));var licenseUtil=require(_0xcb3c('0x18'));var db=require(_0xcb3c('0x19'))['db'];function respondWithStatusCode(_0x9cfcf4,_0x556ff5){_0x556ff5=_0x556ff5||0xcc;return function(_0x180c84){if(_0x180c84){return _0x9cfcf4[_0xcb3c('0x1a')](_0x556ff5);}return _0x9cfcf4[_0xcb3c('0x1b')](_0x556ff5)[_0xcb3c('0x1c')]();};}function respondWithResult(_0x55d1ee,_0x3dfd37){_0x3dfd37=_0x3dfd37||0xc8;return function(_0x52501a){if(_0x52501a){return _0x55d1ee[_0xcb3c('0x1b')](_0x3dfd37)[_0xcb3c('0x1d')](_0x52501a);}};}function respondWithFilteredResult(_0x38148b,_0x4c5cac){return function(_0x282497){if(_0x282497){var _0xf06fd1=typeof _0x4c5cac['offset']===_0xcb3c('0x1e')&&typeof _0x4c5cac['limit']==='undefined';var _0x56aba6=_0x282497['count'];var _0x3b1ae3=_0xf06fd1?0x0:_0x4c5cac[_0xcb3c('0x1f')];var _0x2d0647=_0xf06fd1?_0x282497[_0xcb3c('0x20')]:_0x4c5cac['offset']+_0x4c5cac[_0xcb3c('0x21')];var _0xd1550a;if(_0x2d0647>=_0x56aba6){_0x2d0647=_0x56aba6;_0xd1550a=0xc8;}else{_0xd1550a=0xce;}_0x38148b['status'](_0xd1550a);return _0x38148b[_0xcb3c('0x22')]('Content-Range',_0x3b1ae3+'-'+_0x2d0647+'/'+_0x56aba6)[_0xcb3c('0x1d')](_0x282497);}return null;};}function patchUpdates(_0x1e9f6f){return function(_0x2ca9f3){try{jsonpatch['apply'](_0x2ca9f3,_0x1e9f6f,!![]);}catch(_0x203101){return BPromise[_0xcb3c('0x23')](_0x203101);}return _0x2ca9f3[_0xcb3c('0x24')]();};}function saveUpdates(_0x313e15,_0x3b1935){return function(_0x143ed1){if(_0x143ed1){return _0x143ed1[_0xcb3c('0x25')](_0x313e15)[_0xcb3c('0x26')](function(_0x4c76dc){return _0x4c76dc;});}return null;};}function removeEntity(_0x2620cb,_0x179912){return function(_0x4f082e){if(_0x4f082e){return _0x4f082e['destroy']()['then'](function(){_0x2620cb[_0xcb3c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3132b6,_0x516458){return function(_0x59d0f2){if(!_0x59d0f2){_0x3132b6[_0xcb3c('0x1a')](0x194);}return _0x59d0f2;};}function handleError(_0x269876,_0x3746e3){_0x3746e3=_0x3746e3||0x1f4;return function(_0x232b6b){logger[_0xcb3c('0x27')](_0x232b6b[_0xcb3c('0x28')]);if(_0x232b6b[_0xcb3c('0x29')]){delete _0x232b6b[_0xcb3c('0x29')];}_0x269876[_0xcb3c('0x1b')](_0x3746e3)[_0xcb3c('0x2a')](_0x232b6b);};}exports['index']=function(_0x30e8c7,_0x226e5a){var _0x488ae6={},_0xfa9ba={},_0x8e4ee4={'count':0x0,'rows':[]};var _0x34908a=_['map'](db['ServicenowField'][_0xcb3c('0x2b')],function(_0x3ad912){return{'name':_0x3ad912[_0xcb3c('0x2c')],'type':_0x3ad912['type'][_0xcb3c('0x2d')]};});_0xfa9ba[_0xcb3c('0x2e')]=_[_0xcb3c('0x2f')](_0x34908a,_0xcb3c('0x29'));_0xfa9ba[_0xcb3c('0x30')]=_[_0xcb3c('0x31')](_0x30e8c7[_0xcb3c('0x30')]);_0xfa9ba[_0xcb3c('0x32')]=_['intersection'](_0xfa9ba[_0xcb3c('0x2e')],_0xfa9ba['query']);_0x488ae6[_0xcb3c('0x33')]=_['intersection'](_0xfa9ba[_0xcb3c('0x2e')],qs[_0xcb3c('0x34')](_0x30e8c7['query']['fields']));_0x488ae6[_0xcb3c('0x33')]=_0x488ae6[_0xcb3c('0x33')][_0xcb3c('0x35')]?_0x488ae6['attributes']:_0xfa9ba['model'];if(!_0x30e8c7[_0xcb3c('0x30')][_0xcb3c('0x36')](_0xcb3c('0x37'))){_0x488ae6[_0xcb3c('0x21')]=qs['limit'](_0x30e8c7['query'][_0xcb3c('0x21')]);_0x488ae6['offset']=qs['offset'](_0x30e8c7[_0xcb3c('0x30')]['offset']);}_0x488ae6['order']=qs[_0xcb3c('0x38')](_0x30e8c7[_0xcb3c('0x30')][_0xcb3c('0x38')]);_0x488ae6[_0xcb3c('0x39')]=qs[_0xcb3c('0x32')](_[_0xcb3c('0x3a')](_0x30e8c7['query'],_0xfa9ba[_0xcb3c('0x32')]),_0x34908a);if(_0x30e8c7['query'][_0xcb3c('0x3b')]){_0x488ae6[_0xcb3c('0x39')]=_[_0xcb3c('0x3c')](_0x488ae6[_0xcb3c('0x39')],{'$or':_[_0xcb3c('0x2f')](_0x34908a,function(_0x4f6e07){if(_0x4f6e07[_0xcb3c('0x3d')]!==_0xcb3c('0x3e')){var _0x273eae={};_0x273eae[_0x4f6e07[_0xcb3c('0x29')]]={'$like':'%'+_0x30e8c7[_0xcb3c('0x30')][_0xcb3c('0x3b')]+'%'};return _0x273eae;}})});}_0x488ae6=_[_0xcb3c('0x3c')]({},_0x488ae6,_0x30e8c7[_0xcb3c('0x3f')]);var _0x5d684f={'where':_0x488ae6[_0xcb3c('0x39')]};return db['ServicenowField'][_0xcb3c('0x20')](_0x5d684f)[_0xcb3c('0x26')](function(_0x448d9d){_0x8e4ee4[_0xcb3c('0x20')]=_0x448d9d;if(_0x30e8c7['query']['includeAll']){_0x488ae6[_0xcb3c('0x40')]=[{'all':!![]}];}return db[_0xcb3c('0x41')][_0xcb3c('0x42')](_0x488ae6);})['then'](function(_0x1c5b6f){_0x8e4ee4[_0xcb3c('0x43')]=_0x1c5b6f;return _0x8e4ee4;})[_0xcb3c('0x26')](respondWithFilteredResult(_0x226e5a,_0x488ae6))['catch'](handleError(_0x226e5a,null));};exports[_0xcb3c('0x44')]=function(_0x140b25,_0x514668){var _0x5311={'raw':!![],'where':{'id':_0x140b25[_0xcb3c('0x45')]['id']}},_0x53898c={};_0x53898c[_0xcb3c('0x2e')]=_['keys'](db[_0xcb3c('0x41')][_0xcb3c('0x2b')]);_0x53898c[_0xcb3c('0x30')]=_[_0xcb3c('0x31')](_0x140b25['query']);_0x53898c[_0xcb3c('0x32')]=_[_0xcb3c('0x46')](_0x53898c['model'],_0x53898c[_0xcb3c('0x30')]);_0x5311[_0xcb3c('0x33')]=_[_0xcb3c('0x46')](_0x53898c[_0xcb3c('0x2e')],qs[_0xcb3c('0x34')](_0x140b25[_0xcb3c('0x30')][_0xcb3c('0x34')]));_0x5311[_0xcb3c('0x33')]=_0x5311[_0xcb3c('0x33')]['length']?_0x5311[_0xcb3c('0x33')]:_0x53898c[_0xcb3c('0x2e')];if(_0x140b25[_0xcb3c('0x30')]['includeAll']){_0x5311[_0xcb3c('0x40')]=[{'all':!![]}];}_0x5311=_[_0xcb3c('0x3c')]({},_0x5311,_0x140b25[_0xcb3c('0x3f')]);return db[_0xcb3c('0x41')][_0xcb3c('0x47')](_0x5311)[_0xcb3c('0x26')](handleEntityNotFound(_0x514668,null))['then'](respondWithResult(_0x514668,null))[_0xcb3c('0x48')](handleError(_0x514668,null));};exports[_0xcb3c('0x49')]=function(_0x3914ab,_0x41ff03){return db[_0xcb3c('0x41')][_0xcb3c('0x49')](_0x3914ab[_0xcb3c('0x4a')],{})[_0xcb3c('0x26')](respondWithResult(_0x41ff03,0xc9))['catch'](handleError(_0x41ff03,null));};exports['update']=function(_0x51ad99,_0x48f562){if(_0x51ad99['body']['id']){delete _0x51ad99['body']['id'];}return db[_0xcb3c('0x41')]['find']({'where':{'id':_0x51ad99[_0xcb3c('0x45')]['id']}})['then'](handleEntityNotFound(_0x48f562,null))['then'](saveUpdates(_0x51ad99[_0xcb3c('0x4a')],null))[_0xcb3c('0x26')](respondWithResult(_0x48f562,null))['catch'](handleError(_0x48f562,null));};exports['destroy']=function(_0xf128de,_0x21336c){return db[_0xcb3c('0x41')][_0xcb3c('0x47')]({'where':{'id':_0xf128de['params']['id']}})[_0xcb3c('0x26')](handleEntityNotFound(_0x21336c,null))['then'](removeEntity(_0x21336c,null))['catch'](handleError(_0x21336c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index caa2c80..565ec45 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 _0x8cf2=['api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x196f40,_0x2a28fa){var _0x4464f8=function(_0x34ffa5){while(--_0x34ffa5){_0x196f40['push'](_0x196f40['shift']());}};_0x4464f8(++_0x2a28fa);}(_0x8cf2,0x108));var _0x28cf=function(_0x43bec4,_0x3048dc){_0x43bec4=_0x43bec4-0x0;var _0x34aaa0=_0x8cf2[_0x43bec4];return _0x34aaa0;};'use strict';var _=require('lodash');var util=require(_0x28cf('0x0'));var logger=require(_0x28cf('0x1'))(_0x28cf('0x2'));var moment=require(_0x28cf('0x3'));var BPromise=require('bluebird');var rp=require(_0x28cf('0x4'));var fs=require('fs');var path=require(_0x28cf('0x5'));var rimraf=require(_0x28cf('0x6'));var config=require(_0x28cf('0x7'));var attributes=require(_0x28cf('0x8'));module[_0x28cf('0x9')]=function(_0xe26259,_0x3d32fe){return _0xe26259[_0x28cf('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x28cf('0xb'),'fields':[_0x28cf('0xc'),_0x28cf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1bb=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x3db049,_0x241ddf){var _0x5055f3=function(_0x318f28){while(--_0x318f28){_0x3db049['push'](_0x3db049['shift']());}};_0x5055f3(++_0x241ddf);}(_0xf1bb,0x1be));var _0xbf1b=function(_0x5d2d77,_0x4f14ea){_0x5d2d77=_0x5d2d77-0x0;var _0x1f5994=_0xf1bb[_0x5d2d77];return _0x1f5994;};'use strict';var _=require(_0xbf1b('0x0'));var util=require(_0xbf1b('0x1'));var logger=require(_0xbf1b('0x2'))(_0xbf1b('0x3'));var moment=require(_0xbf1b('0x4'));var BPromise=require(_0xbf1b('0x5'));var rp=require(_0xbf1b('0x6'));var fs=require('fs');var path=require(_0xbf1b('0x7'));var rimraf=require('rimraf');var config=require(_0xbf1b('0x8'));var attributes=require(_0xbf1b('0x9'));module[_0xbf1b('0xa')]=function(_0x67ba76,_0x4ced2f){return _0x67ba76[_0xbf1b('0xb')](_0xbf1b('0xc'),attributes,{'tableName':_0xbf1b('0xd'),'paranoid':![],'indexes':[{'name':_0xbf1b('0xe'),'fields':[_0xbf1b('0xf'),_0xbf1b('0x10')],'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 4273b3c..88c4b03 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ea918,_0x242e7f){var _0x544831=function(_0x45cfc5){while(--_0x45cfc5){_0x5ea918['push'](_0x5ea918['shift']());}};_0x544831(++_0x242e7f);}(_0xe706,0xa3));var _0x6e70=function(_0x3f2f19,_0x2ea0c4){_0x3f2f19=_0x3f2f19-0x0;var _0x18f929=_0xe706[_0x3f2f19];return _0x18f929;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x37b6ce,_0x50bc58){var _0xc0a0e=function(_0x3a25cb){while(--_0x3a25cb){_0x37b6ce['push'](_0x37b6ce['shift']());}};_0xc0a0e(++_0x50bc58);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index a59b892..e09da12 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(_0xa65c5a,_0x1b146d){var _0x2dfe3e=function(_0x252259){while(--_0x252259){_0xa65c5a['push'](_0xa65c5a['shift']());}};_0x2dfe3e(++_0x1b146d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x251d29,_0x1aadc9){var _0x1e4d10=function(_0x87e5aa){while(--_0x87e5aa){_0x251d29['push'](_0x251d29['shift']());}};_0x1e4d10(++_0x1aadc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index faad397..dcda917 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(_0x20a220,_0x52df05){var _0x3f7a88=function(_0x2d53d8){while(--_0x2d53d8){_0x20a220['push'](_0x20a220['shift']());}};_0x3f7a88(++_0x52df05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x589ea1,_0x56a018){var _0x2ae6f2=function(_0x36e783){while(--_0x36e783){_0x589ea1['push'](_0x589ea1['shift']());}};_0x2ae6f2(++_0x56a018);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 b36a92f..283252d 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 _0xc7e0=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','sendStatus','stack','send','index','SugarcrmAccount','fieldName','key','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','options','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','parent_id','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','label','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra'];(function(_0x4e90ff,_0x7485a7){var _0x53a1b4=function(_0x546c5b){while(--_0x546c5b){_0x4e90ff['push'](_0x4e90ff['shift']());}};_0x53a1b4(++_0x7485a7);}(_0xc7e0,0x159));var _0x0c7e=function(_0x27692a,_0x4ab150){_0x27692a=_0x27692a-0x0;var _0x17058e=_0xc7e0[_0x27692a];return _0x17058e;};'use strict';var emlformat=require(_0x0c7e('0x0'));var rimraf=require(_0x0c7e('0x1'));var zipdir=require(_0x0c7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c7e('0x3'));var moment=require('moment');var BPromise=require(_0x0c7e('0x4'));var Mustache=require(_0x0c7e('0x5'));var util=require(_0x0c7e('0x6'));var path=require('path');var sox=require(_0x0c7e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c7e('0x8'));var _=require('lodash');var squel=require(_0x0c7e('0x9'));var crypto=require(_0x0c7e('0xa'));var jsforce=require(_0x0c7e('0xb'));var deskjs=require(_0x0c7e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0c7e('0xd'));var Papa=require(_0x0c7e('0xe'));var Redis=require('ioredis');var authService=require(_0x0c7e('0xf'));var qs=require(_0x0c7e('0x10'));var as=require(_0x0c7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c7e('0x12'))(_0x0c7e('0x13'));var utils=require(_0x0c7e('0x14'));var config=require(_0x0c7e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c7e('0x16'))['db'];var integrations=require(_0x0c7e('0x17'));function respondWithStatusCode(_0x11ccfa,_0x1154e8){_0x1154e8=_0x1154e8||0xcc;return function(_0x4d1952){if(_0x4d1952){return _0x11ccfa['sendStatus'](_0x1154e8);}return _0x11ccfa[_0x0c7e('0x18')](_0x1154e8)[_0x0c7e('0x19')]();};}function respondWithResult(_0x5a36e5,_0x5f2816){_0x5f2816=_0x5f2816||0xc8;return function(_0x579935){if(_0x579935){return _0x5a36e5[_0x0c7e('0x18')](_0x5f2816)[_0x0c7e('0x1a')](_0x579935);}};}function respondWithFilteredResult(_0x8529b0,_0x3df479){return function(_0x3b9745){if(_0x3b9745){var _0x511778=typeof _0x3df479[_0x0c7e('0x1b')]===_0x0c7e('0x1c')&&typeof _0x3df479[_0x0c7e('0x1d')]==='undefined';var _0x31fa40=_0x3b9745[_0x0c7e('0x1e')];var _0x4c8a5d=_0x511778?0x0:_0x3df479[_0x0c7e('0x1b')];var _0x9761aa=_0x511778?_0x3b9745[_0x0c7e('0x1e')]:_0x3df479[_0x0c7e('0x1b')]+_0x3df479[_0x0c7e('0x1d')];var _0x2f27c6;if(_0x9761aa>=_0x31fa40){_0x9761aa=_0x31fa40;_0x2f27c6=0xc8;}else{_0x2f27c6=0xce;}_0x8529b0[_0x0c7e('0x18')](_0x2f27c6);return _0x8529b0['set']('Content-Range',_0x4c8a5d+'-'+_0x9761aa+'/'+_0x31fa40)[_0x0c7e('0x1a')](_0x3b9745);}return null;};}function patchUpdates(_0x1db9f4){return function(_0x6c317e){try{jsonpatch['apply'](_0x6c317e,_0x1db9f4,!![]);}catch(_0xb56428){return BPromise[_0x0c7e('0x1f')](_0xb56428);}return _0x6c317e[_0x0c7e('0x20')]();};}function saveUpdates(_0x573a76,_0x33ad06){return function(_0xde65b2){if(_0xde65b2){return _0xde65b2[_0x0c7e('0x21')](_0x573a76)[_0x0c7e('0x22')](function(_0x4707b4){return _0x4707b4;});}return null;};}function removeEntity(_0x11abf6,_0x47b576){return function(_0x1d2d6a){if(_0x1d2d6a){return _0x1d2d6a[_0x0c7e('0x23')]()[_0x0c7e('0x22')](function(){_0x11abf6[_0x0c7e('0x18')](0xcc)[_0x0c7e('0x19')]();});}};}function handleEntityNotFound(_0x1e1818,_0x52ebcd){return function(_0x403e5d){if(!_0x403e5d){_0x1e1818[_0x0c7e('0x24')](0x194);}return _0x403e5d;};}function handleError(_0xf15af2,_0x5042de){_0x5042de=_0x5042de||0x1f4;return function(_0x8bbd5c){logger['error'](_0x8bbd5c[_0x0c7e('0x25')]);if(_0x8bbd5c['name']){delete _0x8bbd5c['name'];}_0xf15af2[_0x0c7e('0x18')](_0x5042de)[_0x0c7e('0x26')](_0x8bbd5c);};}exports[_0x0c7e('0x27')]=function(_0x13e180,_0x5bdd21){var _0x433b29={},_0x196dc7={},_0x11e15c={'count':0x0,'rows':[]};var _0x45ca14=_['map'](db[_0x0c7e('0x28')]['rawAttributes'],function(_0x1779ad){return{'name':_0x1779ad[_0x0c7e('0x29')],'type':_0x1779ad['type'][_0x0c7e('0x2a')]};});_0x196dc7[_0x0c7e('0x2b')]=_[_0x0c7e('0x2c')](_0x45ca14,_0x0c7e('0x2d'));_0x196dc7[_0x0c7e('0x2e')]=_['keys'](_0x13e180[_0x0c7e('0x2e')]);_0x196dc7[_0x0c7e('0x2f')]=_[_0x0c7e('0x30')](_0x196dc7['model'],_0x196dc7[_0x0c7e('0x2e')]);_0x433b29[_0x0c7e('0x31')]=_[_0x0c7e('0x30')](_0x196dc7[_0x0c7e('0x2b')],qs[_0x0c7e('0x32')](_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x32')]));_0x433b29['attributes']=_0x433b29[_0x0c7e('0x31')]['length']?_0x433b29[_0x0c7e('0x31')]:_0x196dc7[_0x0c7e('0x2b')];if(!_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x33')](_0x0c7e('0x34'))){_0x433b29[_0x0c7e('0x1d')]=qs['limit'](_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x1d')]);_0x433b29[_0x0c7e('0x1b')]=qs[_0x0c7e('0x1b')](_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x1b')]);}_0x433b29[_0x0c7e('0x35')]=qs[_0x0c7e('0x36')](_0x13e180['query'][_0x0c7e('0x36')]);_0x433b29[_0x0c7e('0x37')]=qs[_0x0c7e('0x2f')](_[_0x0c7e('0x38')](_0x13e180[_0x0c7e('0x2e')],_0x196dc7['filters']),_0x45ca14);if(_0x13e180['query'][_0x0c7e('0x39')]){_0x433b29['where']=_[_0x0c7e('0x3a')](_0x433b29[_0x0c7e('0x37')],{'$or':_[_0x0c7e('0x2c')](_0x45ca14,function(_0x7851af){if(_0x7851af['type']!=='VIRTUAL'){var _0x494d9d={};_0x494d9d[_0x7851af[_0x0c7e('0x2d')]]={'$like':'%'+_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x39')]+'%'};return _0x494d9d;}})});}_0x433b29=_[_0x0c7e('0x3a')]({},_0x433b29,_0x13e180['options']);var _0x498c7e={'where':_0x433b29[_0x0c7e('0x37')]};return db[_0x0c7e('0x28')][_0x0c7e('0x1e')](_0x498c7e)['then'](function(_0x22abc1){_0x11e15c[_0x0c7e('0x1e')]=_0x22abc1;if(_0x13e180[_0x0c7e('0x2e')][_0x0c7e('0x3b')]){_0x433b29[_0x0c7e('0x3c')]=[{'all':!![]}];}return db[_0x0c7e('0x28')][_0x0c7e('0x3d')](_0x433b29);})['then'](function(_0x238025){_0x11e15c[_0x0c7e('0x3e')]=_0x238025;return _0x11e15c;})[_0x0c7e('0x22')](respondWithFilteredResult(_0x5bdd21,_0x433b29))[_0x0c7e('0x3f')](handleError(_0x5bdd21,null));};exports[_0x0c7e('0x40')]=function(_0x30545b,_0x37fdeb){var _0x487497={'raw':![],'where':{'id':_0x30545b['params']['id']}},_0x35d566={};_0x35d566[_0x0c7e('0x2b')]=_[_0x0c7e('0x41')](db[_0x0c7e('0x28')][_0x0c7e('0x42')]);_0x35d566[_0x0c7e('0x2e')]=_[_0x0c7e('0x41')](_0x30545b[_0x0c7e('0x2e')]);_0x35d566['filters']=_['intersection'](_0x35d566[_0x0c7e('0x2b')],_0x35d566[_0x0c7e('0x2e')]);_0x487497[_0x0c7e('0x31')]=_[_0x0c7e('0x30')](_0x35d566[_0x0c7e('0x2b')],qs[_0x0c7e('0x32')](_0x30545b[_0x0c7e('0x2e')][_0x0c7e('0x32')]));_0x487497[_0x0c7e('0x31')]=_0x487497['attributes'][_0x0c7e('0x43')]?_0x487497[_0x0c7e('0x31')]:_0x35d566['model'];if(_0x30545b[_0x0c7e('0x2e')][_0x0c7e('0x3b')]){_0x487497[_0x0c7e('0x3c')]=[{'all':!![]}];}_0x487497=_[_0x0c7e('0x3a')]({},_0x487497,_0x30545b[_0x0c7e('0x44')]);return db['SugarcrmAccount'][_0x0c7e('0x45')](_0x487497)['then'](handleEntityNotFound(_0x37fdeb,null))['then'](respondWithResult(_0x37fdeb,null))[_0x0c7e('0x3f')](handleError(_0x37fdeb,null));};exports['create']=function(_0x545feb,_0x3c6baf){return db[_0x0c7e('0x28')][_0x0c7e('0x46')](_0x545feb[_0x0c7e('0x47')],{})[_0x0c7e('0x22')](respondWithResult(_0x3c6baf,0xc9))[_0x0c7e('0x3f')](handleError(_0x3c6baf,null));};exports['update']=function(_0x269196,_0x3a7646){if(_0x269196[_0x0c7e('0x47')]['id']){delete _0x269196[_0x0c7e('0x47')]['id'];}return db[_0x0c7e('0x28')][_0x0c7e('0x45')]({'where':{'id':_0x269196['params']['id']}})['then'](handleEntityNotFound(_0x3a7646,null))[_0x0c7e('0x22')](saveUpdates(_0x269196[_0x0c7e('0x47')],null))[_0x0c7e('0x22')](respondWithResult(_0x3a7646,null))[_0x0c7e('0x3f')](handleError(_0x3a7646,null));};exports['destroy']=function(_0x1dcc77,_0x52133b){return db['SugarcrmAccount'][_0x0c7e('0x45')]({'where':{'id':_0x1dcc77[_0x0c7e('0x48')]['id']}})['then'](handleEntityNotFound(_0x52133b,null))['then'](removeEntity(_0x52133b,null))['catch'](handleError(_0x52133b,null));};exports[_0x0c7e('0x49')]=function(_0xb8673a,_0x18e4f0,_0x51576f){var _0x3a5044={};var _0x330d01={};var _0x3cf8af;var _0x59dd5a;return db[_0x0c7e('0x28')][_0x0c7e('0x4a')]({'where':{'id':_0xb8673a[_0x0c7e('0x48')]['id']}})[_0x0c7e('0x22')](handleEntityNotFound(_0x18e4f0,null))[_0x0c7e('0x22')](function(_0x4f0473){if(_0x4f0473){_0x3cf8af=_0x4f0473;_0x330d01[_0x0c7e('0x2b')]=_['keys'](db[_0x0c7e('0x4b')][_0x0c7e('0x42')]);_0x330d01['query']=_[_0x0c7e('0x41')](_0xb8673a['query']);_0x330d01['filters']=_['intersection'](_0x330d01[_0x0c7e('0x2b')],_0x330d01['query']);_0x3a5044[_0x0c7e('0x31')]=_[_0x0c7e('0x30')](_0x330d01[_0x0c7e('0x2b')],qs[_0x0c7e('0x32')](_0xb8673a[_0x0c7e('0x2e')]['fields']));_0x3a5044[_0x0c7e('0x31')]=_0x3a5044[_0x0c7e('0x31')][_0x0c7e('0x43')]?_0x3a5044[_0x0c7e('0x31')]:_0x330d01[_0x0c7e('0x2b')];_0x3a5044[_0x0c7e('0x35')]=qs[_0x0c7e('0x36')](_0xb8673a['query']['sort']);_0x3a5044['where']=qs[_0x0c7e('0x2f')](_[_0x0c7e('0x38')](_0xb8673a[_0x0c7e('0x2e')],_0x330d01[_0x0c7e('0x2f')]));if(_0xb8673a[_0x0c7e('0x2e')][_0x0c7e('0x39')]){_0x3a5044['where']=_['merge'](_0x3a5044[_0x0c7e('0x37')],{'$or':_[_0x0c7e('0x2c')](_0x3a5044['attributes'],function(_0x5355ae){var _0x4fb49d={};_0x4fb49d[_0x5355ae]={'$like':'%'+_0xb8673a[_0x0c7e('0x2e')][_0x0c7e('0x39')]+'%'};return _0x4fb49d;})});}_0x3a5044=_[_0x0c7e('0x3a')]({},_0x3a5044,_0xb8673a[_0x0c7e('0x44')]);return _0x3cf8af['getConfigurations'](_0x3a5044);}})[_0x0c7e('0x22')](function(_0x3544a0){if(_0x3544a0){_0x59dd5a=_0x3544a0[_0x0c7e('0x43')];if(!_0xb8673a['query'][_0x0c7e('0x33')](_0x0c7e('0x34'))){_0x3a5044[_0x0c7e('0x1d')]=qs[_0x0c7e('0x1d')](_0xb8673a['query']['limit']);_0x3a5044[_0x0c7e('0x1b')]=qs['offset'](_0xb8673a[_0x0c7e('0x2e')]['offset']);}return _0x3cf8af[_0x0c7e('0x49')](_0x3a5044);}})[_0x0c7e('0x22')](function(_0x1bfa21){if(_0x1bfa21){return _0x1bfa21?{'count':_0x59dd5a,'rows':_0x1bfa21}:null;}})[_0x0c7e('0x22')](respondWithResult(_0x18e4f0,null))[_0x0c7e('0x3f')](handleError(_0x18e4f0,null));};exports['addConfiguration']=function(_0x432ea1,_0x1a9676,_0x47f024){if(_0x432ea1['body']['id']){delete _0x432ea1[_0x0c7e('0x47')]['id'];}return db[_0x0c7e('0x28')][_0x0c7e('0x4a')]({'where':{'id':_0x432ea1['params']['id']}})[_0x0c7e('0x22')](handleEntityNotFound(_0x1a9676,null))['then'](function(_0x44ac42){if(_0x44ac42){_0x432ea1[_0x0c7e('0x47')][_0x0c7e('0x4c')]=_0x44ac42['id'];_0x432ea1[_0x0c7e('0x47')][_0x0c7e('0x4d')]=integrations[_0x0c7e('0x4e')](_0x432ea1[_0x0c7e('0x47')][_0x0c7e('0x4f')],_0x432ea1[_0x0c7e('0x47')][_0x0c7e('0x50')]);_0x432ea1[_0x0c7e('0x47')][_0x0c7e('0x51')]=integrations[_0x0c7e('0x52')](_0x432ea1['body'][_0x0c7e('0x4f')],_0x432ea1['body']['type']);return db[_0x0c7e('0x4b')][_0x0c7e('0x46')](_0x432ea1[_0x0c7e('0x47')],{'include':[{'model':db[_0x0c7e('0x53')],'as':_0x0c7e('0x4d')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x0c7e('0x22')](respondWithResult(_0x1a9676,null))['catch'](handleError(_0x1a9676,null));};exports[_0x0c7e('0x54')]=function(_0x5c03af,_0x142160,_0x5f25aa){var _0x4fd19e='';var _0x538102=['id',_0x0c7e('0x2d'),_0x0c7e('0x55'),'created_by','description',_0x0c7e('0x56'),_0x0c7e('0x57'),'duration_minutes',_0x0c7e('0x58'),'parent_type',_0x0c7e('0x59'),_0x0c7e('0x5a')];return db[_0x0c7e('0x28')][_0x0c7e('0x4a')]({'where':{'id':_0x5c03af['params']['id']},'attributes':['id','username',_0x0c7e('0x5b'),_0x0c7e('0x5c')]})['then'](handleEntityNotFound(_0x142160,null))[_0x0c7e('0x22')](function(_0x328caf){if(_0x328caf){_0x4fd19e=_0x328caf[_0x0c7e('0x5c')];var _0x2cef2a=_0x4fd19e[_0x0c7e('0x5d')](-0x1);if(_0x2cef2a==='/'){_0x4fd19e=_0x4fd19e[_0x0c7e('0x5e')](0x0,_0x4fd19e[_0x0c7e('0x5f')](_0x2cef2a));}return rp({'method':_0x0c7e('0x60'),'uri':util[_0x0c7e('0x61')](_0x0c7e('0x62'),_0x4fd19e,_0x0c7e('0x63')),'json':!![],'form':{'method':_0x0c7e('0x64'),'input_type':_0x0c7e('0x65'),'response_type':_0x0c7e('0x65'),'rest_data':JSON[_0x0c7e('0x66')]({'user_auth':{'user_name':_0x328caf['username'],'password':_0x328caf[_0x0c7e('0x5b')],'encryption':_0x0c7e('0x67')},'application':_0x0c7e('0x68')})}});}})[_0x0c7e('0x22')](function(_0xb5db60){if(_0xb5db60&&_0xb5db60['name']!=='Invalid\x20Login'&&_0xb5db60[_0x0c7e('0x2d')]!==_0x0c7e('0x69')){return rp({'method':'POST','uri':util[_0x0c7e('0x61')](_0x0c7e('0x62'),_0x4fd19e,_0x0c7e('0x63')),'json':!![],'form':{'method':_0x0c7e('0x6a'),'input_type':'JSON','response_type':_0x0c7e('0x65'),'rest_data':JSON[_0x0c7e('0x66')]({'session':_0xb5db60['id'],'module_name':_0x0c7e('0x6b')})}})[_0x0c7e('0x22')](function(_0x55d081){if(_0x55d081){var _0x4ecf2a=_[_0x0c7e('0x6c')](_0x55d081[_0x0c7e('0x6d')]);_['remove'](_0x4ecf2a,function(_0x56c61a){return _0x538102['includes'](_0x56c61a[_0x0c7e('0x2d')]);});return{'count':_0x4ecf2a['length'],'rows':_[_0x0c7e('0x2c')](_0x4ecf2a,function(_0x1474dc){return{'id':_0x1474dc[_0x0c7e('0x2d')],'name':_0x1474dc[_0x0c7e('0x6e')],'custom':_[_0x0c7e('0x6f')](_0x1474dc[_0x0c7e('0x2d')],'_c')?!![]:![],'options':_0x1474dc[_0x0c7e('0x44')]?_[_0x0c7e('0x2c')](_[_0x0c7e('0x6c')](_0x1474dc[_0x0c7e('0x44')]),function(_0x2f5411){return{'name':_0x2f5411[_0x0c7e('0x70')],'value':_0x2f5411['name']};}):[]};})};}})[_0x0c7e('0x22')](respondWithResult(_0x142160,null))[_0x0c7e('0x3f')](function(_0x46b6c2){var _0x3138e0=_0x5c03af[_0x0c7e('0x2e')]['test']?0x1f4:_0x46b6c2[_0x0c7e('0x71')]||0x1f4;logger[_0x0c7e('0x72')](_0x0c7e('0x73'),_0x0c7e('0x54'),_0x3138e0,JSON[_0x0c7e('0x66')](_0x46b6c2));delete _0x46b6c2[_0x0c7e('0x2d')];if(_0x3138e0===0x191){_0x3138e0=0x190;}_0x142160['status'](_0x3138e0)[_0x0c7e('0x26')](_0x5c03af[_0x0c7e('0x2e')][_0x0c7e('0x74')]?{'message':_0x0c7e('0x75'),'statusCode':_0x46b6c2[_0x0c7e('0x71')]}:_0x46b6c2);});}else{var _0x374f89=0x1f4;_0x142160[_0x0c7e('0x18')](_0x374f89)[_0x0c7e('0x26')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xe589=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service'];(function(_0x58d7d8,_0x69b1af){var _0xe6529c=function(_0x107c58){while(--_0x107c58){_0x58d7d8['push'](_0x58d7d8['shift']());}};_0xe6529c(++_0x69b1af);}(_0xe589,0x14e));var _0x9e58=function(_0x1d4a48,_0xe286a2){_0x1d4a48=_0x1d4a48-0x0;var _0x3a73fb=_0xe589[_0x1d4a48];return _0x3a73fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9e58('0x0'));var jsonpatch=require(_0x9e58('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e58('0x2'));var Mustache=require(_0x9e58('0x3'));var util=require(_0x9e58('0x4'));var path=require(_0x9e58('0x5'));var sox=require('sox');var csv=require(_0x9e58('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e58('0x7'));var _=require(_0x9e58('0x8'));var squel=require(_0x9e58('0x9'));var crypto=require(_0x9e58('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9e58('0xb'));var toCsv=require(_0x9e58('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9e58('0xc'));var authService=require(_0x9e58('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9e58('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e58('0xf'))('api');var utils=require(_0x9e58('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x9e58('0x11'));var db=require(_0x9e58('0x12'))['db'];var integrations=require(_0x9e58('0x13'));function respondWithStatusCode(_0x392136,_0x33b0ca){_0x33b0ca=_0x33b0ca||0xcc;return function(_0xf32f67){if(_0xf32f67){return _0x392136[_0x9e58('0x14')](_0x33b0ca);}return _0x392136[_0x9e58('0x15')](_0x33b0ca)['end']();};}function respondWithResult(_0x381e94,_0x45402c){_0x45402c=_0x45402c||0xc8;return function(_0x7286e8){if(_0x7286e8){return _0x381e94['status'](_0x45402c)[_0x9e58('0x16')](_0x7286e8);}};}function respondWithFilteredResult(_0x27e77e,_0x3994e5){return function(_0x3ae618){if(_0x3ae618){var _0x53f2a8=typeof _0x3994e5[_0x9e58('0x17')]==='undefined'&&typeof _0x3994e5[_0x9e58('0x18')]===_0x9e58('0x19');var _0x4839c1=_0x3ae618[_0x9e58('0x1a')];var _0x5e48b1=_0x53f2a8?0x0:_0x3994e5[_0x9e58('0x17')];var _0x138791=_0x53f2a8?_0x3ae618[_0x9e58('0x1a')]:_0x3994e5[_0x9e58('0x17')]+_0x3994e5[_0x9e58('0x18')];var _0x4b9017;if(_0x138791>=_0x4839c1){_0x138791=_0x4839c1;_0x4b9017=0xc8;}else{_0x4b9017=0xce;}_0x27e77e['status'](_0x4b9017);return _0x27e77e[_0x9e58('0x1b')](_0x9e58('0x1c'),_0x5e48b1+'-'+_0x138791+'/'+_0x4839c1)['json'](_0x3ae618);}return null;};}function patchUpdates(_0x41cdd2){return function(_0xc1d41){try{jsonpatch[_0x9e58('0x1d')](_0xc1d41,_0x41cdd2,!![]);}catch(_0x4e071a){return BPromise[_0x9e58('0x1e')](_0x4e071a);}return _0xc1d41[_0x9e58('0x1f')]();};}function saveUpdates(_0x4f4b0b,_0x3c06db){return function(_0xaa24b0){if(_0xaa24b0){return _0xaa24b0[_0x9e58('0x20')](_0x4f4b0b)['then'](function(_0x26cfec){return _0x26cfec;});}return null;};}function removeEntity(_0x59981a,_0x2aa4b3){return function(_0x1eadb6){if(_0x1eadb6){return _0x1eadb6[_0x9e58('0x21')]()[_0x9e58('0x22')](function(){_0x59981a[_0x9e58('0x15')](0xcc)[_0x9e58('0x23')]();});}};}function handleEntityNotFound(_0x38569e,_0xa94b16){return function(_0x101382){if(!_0x101382){_0x38569e[_0x9e58('0x14')](0x194);}return _0x101382;};}function handleError(_0x36ac6b,_0xc5676){_0xc5676=_0xc5676||0x1f4;return function(_0x3f188e){logger[_0x9e58('0x24')](_0x3f188e['stack']);if(_0x3f188e[_0x9e58('0x25')]){delete _0x3f188e[_0x9e58('0x25')];}_0x36ac6b[_0x9e58('0x15')](_0xc5676)[_0x9e58('0x26')](_0x3f188e);};}exports[_0x9e58('0x27')]=function(_0xbf4078,_0x35cbdc){var _0x3baae3={},_0x468d6d={},_0x27d3c0={'count':0x0,'rows':[]};var _0x3c95c5=_['map'](db[_0x9e58('0x28')][_0x9e58('0x29')],function(_0x222e35){return{'name':_0x222e35[_0x9e58('0x2a')],'type':_0x222e35[_0x9e58('0x2b')][_0x9e58('0x2c')]};});_0x468d6d[_0x9e58('0x2d')]=_[_0x9e58('0x2e')](_0x3c95c5,_0x9e58('0x25'));_0x468d6d[_0x9e58('0x2f')]=_[_0x9e58('0x30')](_0xbf4078['query']);_0x468d6d[_0x9e58('0x31')]=_[_0x9e58('0x32')](_0x468d6d['model'],_0x468d6d['query']);_0x3baae3['attributes']=_['intersection'](_0x468d6d[_0x9e58('0x2d')],qs[_0x9e58('0x33')](_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x33')]));_0x3baae3[_0x9e58('0x34')]=_0x3baae3[_0x9e58('0x34')][_0x9e58('0x35')]?_0x3baae3[_0x9e58('0x34')]:_0x468d6d[_0x9e58('0x2d')];if(!_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x36')](_0x9e58('0x37'))){_0x3baae3[_0x9e58('0x18')]=qs[_0x9e58('0x18')](_0xbf4078[_0x9e58('0x2f')]['limit']);_0x3baae3[_0x9e58('0x17')]=qs['offset'](_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x17')]);}_0x3baae3[_0x9e58('0x38')]=qs[_0x9e58('0x39')](_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x39')]);_0x3baae3[_0x9e58('0x3a')]=qs[_0x9e58('0x31')](_['pick'](_0xbf4078[_0x9e58('0x2f')],_0x468d6d[_0x9e58('0x31')]),_0x3c95c5);if(_0xbf4078['query'][_0x9e58('0x3b')]){_0x3baae3[_0x9e58('0x3a')]=_[_0x9e58('0x3c')](_0x3baae3[_0x9e58('0x3a')],{'$or':_[_0x9e58('0x2e')](_0x3c95c5,function(_0x4a82a1){if(_0x4a82a1[_0x9e58('0x2b')]!==_0x9e58('0x3d')){var _0x450118={};_0x450118[_0x4a82a1['name']]={'$like':'%'+_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x3b')]+'%'};return _0x450118;}})});}_0x3baae3=_[_0x9e58('0x3c')]({},_0x3baae3,_0xbf4078[_0x9e58('0x3e')]);var _0x5b7de0={'where':_0x3baae3['where']};return db[_0x9e58('0x28')][_0x9e58('0x1a')](_0x5b7de0)[_0x9e58('0x22')](function(_0x2960a3){_0x27d3c0[_0x9e58('0x1a')]=_0x2960a3;if(_0xbf4078[_0x9e58('0x2f')][_0x9e58('0x3f')]){_0x3baae3['include']=[{'all':!![]}];}return db[_0x9e58('0x28')][_0x9e58('0x40')](_0x3baae3);})['then'](function(_0x16db12){_0x27d3c0[_0x9e58('0x41')]=_0x16db12;return _0x27d3c0;})[_0x9e58('0x22')](respondWithFilteredResult(_0x35cbdc,_0x3baae3))[_0x9e58('0x42')](handleError(_0x35cbdc,null));};exports['show']=function(_0x37ed46,_0x5ec489){var _0x120a68={'raw':![],'where':{'id':_0x37ed46[_0x9e58('0x43')]['id']}},_0x39ab73={};_0x39ab73[_0x9e58('0x2d')]=_['keys'](db[_0x9e58('0x28')]['rawAttributes']);_0x39ab73[_0x9e58('0x2f')]=_[_0x9e58('0x30')](_0x37ed46['query']);_0x39ab73['filters']=_['intersection'](_0x39ab73[_0x9e58('0x2d')],_0x39ab73[_0x9e58('0x2f')]);_0x120a68[_0x9e58('0x34')]=_[_0x9e58('0x32')](_0x39ab73['model'],qs[_0x9e58('0x33')](_0x37ed46[_0x9e58('0x2f')]['fields']));_0x120a68['attributes']=_0x120a68[_0x9e58('0x34')]['length']?_0x120a68[_0x9e58('0x34')]:_0x39ab73[_0x9e58('0x2d')];if(_0x37ed46[_0x9e58('0x2f')][_0x9e58('0x3f')]){_0x120a68[_0x9e58('0x44')]=[{'all':!![]}];}_0x120a68=_[_0x9e58('0x3c')]({},_0x120a68,_0x37ed46[_0x9e58('0x3e')]);return db['SugarcrmAccount'][_0x9e58('0x45')](_0x120a68)[_0x9e58('0x22')](handleEntityNotFound(_0x5ec489,null))['then'](respondWithResult(_0x5ec489,null))[_0x9e58('0x42')](handleError(_0x5ec489,null));};exports[_0x9e58('0x46')]=function(_0x562eb6,_0x8e8a3f){return db[_0x9e58('0x28')][_0x9e58('0x46')](_0x562eb6[_0x9e58('0x47')],{})['then'](respondWithResult(_0x8e8a3f,0xc9))[_0x9e58('0x42')](handleError(_0x8e8a3f,null));};exports[_0x9e58('0x20')]=function(_0x484a15,_0x9ed88b){if(_0x484a15[_0x9e58('0x47')]['id']){delete _0x484a15[_0x9e58('0x47')]['id'];}return db[_0x9e58('0x28')][_0x9e58('0x45')]({'where':{'id':_0x484a15[_0x9e58('0x43')]['id']}})[_0x9e58('0x22')](handleEntityNotFound(_0x9ed88b,null))[_0x9e58('0x22')](saveUpdates(_0x484a15['body'],null))[_0x9e58('0x22')](respondWithResult(_0x9ed88b,null))[_0x9e58('0x42')](handleError(_0x9ed88b,null));};exports[_0x9e58('0x21')]=function(_0x142f42,_0x18f894){return db[_0x9e58('0x28')]['find']({'where':{'id':_0x142f42[_0x9e58('0x43')]['id']}})[_0x9e58('0x22')](handleEntityNotFound(_0x18f894,null))[_0x9e58('0x22')](removeEntity(_0x18f894,null))[_0x9e58('0x42')](handleError(_0x18f894,null));};exports[_0x9e58('0x48')]=function(_0x55f4b2,_0x138f27,_0x29efa7){var _0x509014={};var _0x1bc070={};var _0x593d33;var _0x468dee;return db[_0x9e58('0x28')][_0x9e58('0x49')]({'where':{'id':_0x55f4b2[_0x9e58('0x43')]['id']}})[_0x9e58('0x22')](handleEntityNotFound(_0x138f27,null))[_0x9e58('0x22')](function(_0x12a1e9){if(_0x12a1e9){_0x593d33=_0x12a1e9;_0x1bc070[_0x9e58('0x2d')]=_['keys'](db[_0x9e58('0x4a')][_0x9e58('0x29')]);_0x1bc070[_0x9e58('0x2f')]=_[_0x9e58('0x30')](_0x55f4b2[_0x9e58('0x2f')]);_0x1bc070['filters']=_[_0x9e58('0x32')](_0x1bc070[_0x9e58('0x2d')],_0x1bc070[_0x9e58('0x2f')]);_0x509014[_0x9e58('0x34')]=_[_0x9e58('0x32')](_0x1bc070[_0x9e58('0x2d')],qs[_0x9e58('0x33')](_0x55f4b2[_0x9e58('0x2f')]['fields']));_0x509014[_0x9e58('0x34')]=_0x509014[_0x9e58('0x34')][_0x9e58('0x35')]?_0x509014[_0x9e58('0x34')]:_0x1bc070[_0x9e58('0x2d')];_0x509014[_0x9e58('0x38')]=qs[_0x9e58('0x39')](_0x55f4b2[_0x9e58('0x2f')][_0x9e58('0x39')]);_0x509014['where']=qs['filters'](_[_0x9e58('0x4b')](_0x55f4b2[_0x9e58('0x2f')],_0x1bc070['filters']));if(_0x55f4b2['query'][_0x9e58('0x3b')]){_0x509014[_0x9e58('0x3a')]=_[_0x9e58('0x3c')](_0x509014[_0x9e58('0x3a')],{'$or':_[_0x9e58('0x2e')](_0x509014[_0x9e58('0x34')],function(_0x2c3530){var _0x211283={};_0x211283[_0x2c3530]={'$like':'%'+_0x55f4b2[_0x9e58('0x2f')][_0x9e58('0x3b')]+'%'};return _0x211283;})});}_0x509014=_[_0x9e58('0x3c')]({},_0x509014,_0x55f4b2[_0x9e58('0x3e')]);return _0x593d33[_0x9e58('0x48')](_0x509014);}})[_0x9e58('0x22')](function(_0x51030e){if(_0x51030e){_0x468dee=_0x51030e[_0x9e58('0x35')];if(!_0x55f4b2[_0x9e58('0x2f')]['hasOwnProperty']('nolimit')){_0x509014[_0x9e58('0x18')]=qs[_0x9e58('0x18')](_0x55f4b2[_0x9e58('0x2f')][_0x9e58('0x18')]);_0x509014[_0x9e58('0x17')]=qs['offset'](_0x55f4b2['query']['offset']);}return _0x593d33[_0x9e58('0x48')](_0x509014);}})[_0x9e58('0x22')](function(_0x2b788a){if(_0x2b788a){return _0x2b788a?{'count':_0x468dee,'rows':_0x2b788a}:null;}})[_0x9e58('0x22')](respondWithResult(_0x138f27,null))[_0x9e58('0x42')](handleError(_0x138f27,null));};exports['addConfiguration']=function(_0x3bf351,_0x1a2f16,_0x370a97){if(_0x3bf351[_0x9e58('0x47')]['id']){delete _0x3bf351[_0x9e58('0x47')]['id'];}return db['SugarcrmAccount'][_0x9e58('0x49')]({'where':{'id':_0x3bf351['params']['id']}})['then'](handleEntityNotFound(_0x1a2f16,null))[_0x9e58('0x22')](function(_0x3c29a0){if(_0x3c29a0){_0x3bf351['body']['AccountId']=_0x3c29a0['id'];_0x3bf351[_0x9e58('0x47')][_0x9e58('0x4c')]=integrations['getSubjects'](_0x3bf351['body'][_0x9e58('0x4d')],_0x3bf351[_0x9e58('0x47')][_0x9e58('0x2b')]);_0x3bf351[_0x9e58('0x47')][_0x9e58('0x4e')]=integrations[_0x9e58('0x4f')](_0x3bf351[_0x9e58('0x47')]['channel'],_0x3bf351[_0x9e58('0x47')][_0x9e58('0x2b')]);return db[_0x9e58('0x4a')][_0x9e58('0x46')](_0x3bf351['body'],{'include':[{'model':db[_0x9e58('0x50')],'as':_0x9e58('0x4c')},{'model':db['SugarcrmField'],'as':_0x9e58('0x4e')}]});}return null;})[_0x9e58('0x22')](respondWithResult(_0x1a2f16,null))[_0x9e58('0x42')](handleError(_0x1a2f16,null));};exports[_0x9e58('0x51')]=function(_0x335fd8,_0x376baa,_0x53b526){var _0x53c953='';var _0x2715ab=['id','name',_0x9e58('0x52'),_0x9e58('0x53'),_0x9e58('0x54'),_0x9e58('0x55'),_0x9e58('0x56'),_0x9e58('0x57'),_0x9e58('0x58'),_0x9e58('0x59'),_0x9e58('0x5a'),_0x9e58('0x5b')];return db[_0x9e58('0x28')][_0x9e58('0x49')]({'where':{'id':_0x335fd8['params']['id']},'attributes':['id',_0x9e58('0x5c'),_0x9e58('0x5d'),_0x9e58('0x5e')]})[_0x9e58('0x22')](handleEntityNotFound(_0x376baa,null))['then'](function(_0x21e3c4){if(_0x21e3c4){_0x53c953=_0x21e3c4[_0x9e58('0x5e')];var _0x4ba603=_0x53c953['slice'](-0x1);if(_0x4ba603==='/'){_0x53c953=_0x53c953['substring'](0x0,_0x53c953['lastIndexOf'](_0x4ba603));}return rp({'method':_0x9e58('0x5f'),'uri':util[_0x9e58('0x60')](_0x9e58('0x61'),_0x53c953,_0x9e58('0x62')),'json':!![],'form':{'method':'login','input_type':_0x9e58('0x63'),'response_type':_0x9e58('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x21e3c4[_0x9e58('0x5c')],'password':_0x21e3c4[_0x9e58('0x5d')],'encryption':_0x9e58('0x64')},'application':_0x9e58('0x65')})}});}})[_0x9e58('0x22')](function(_0x594eaa){if(_0x594eaa&&_0x594eaa[_0x9e58('0x25')]!==_0x9e58('0x66')&&_0x594eaa[_0x9e58('0x25')]!=='Password\x20Expired'){return rp({'method':_0x9e58('0x5f'),'uri':util['format'](_0x9e58('0x61'),_0x53c953,_0x9e58('0x62')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x9e58('0x63'),'response_type':_0x9e58('0x63'),'rest_data':JSON['stringify']({'session':_0x594eaa['id'],'module_name':_0x9e58('0x67')})}})[_0x9e58('0x22')](function(_0x5534fe){if(_0x5534fe){var _0x23e5e8=_[_0x9e58('0x68')](_0x5534fe[_0x9e58('0x69')]);_[_0x9e58('0x6a')](_0x23e5e8,function(_0xb2212e){return _0x2715ab[_0x9e58('0x6b')](_0xb2212e[_0x9e58('0x25')]);});return{'count':_0x23e5e8[_0x9e58('0x35')],'rows':_['map'](_0x23e5e8,function(_0x2ed616){return{'id':_0x2ed616[_0x9e58('0x25')],'name':_0x2ed616[_0x9e58('0x6c')],'custom':_[_0x9e58('0x6d')](_0x2ed616[_0x9e58('0x25')],'_c')?!![]:![],'options':_0x2ed616[_0x9e58('0x3e')]?_[_0x9e58('0x2e')](_[_0x9e58('0x68')](_0x2ed616[_0x9e58('0x3e')]),function(_0x44a28e){return{'name':_0x44a28e[_0x9e58('0x6e')],'value':_0x44a28e[_0x9e58('0x25')]};}):[]};})};}})['then'](respondWithResult(_0x376baa,null))[_0x9e58('0x42')](function(_0x535d22){var _0xe0521b=_0x335fd8[_0x9e58('0x2f')]['test']?0x1f4:_0x535d22[_0x9e58('0x6f')]||0x1f4;logger[_0x9e58('0x24')](_0x9e58('0x70'),_0x9e58('0x51'),_0xe0521b,JSON[_0x9e58('0x71')](_0x535d22));delete _0x535d22[_0x9e58('0x25')];if(_0xe0521b===0x191){_0xe0521b=0x190;}_0x376baa[_0x9e58('0x15')](_0xe0521b)['send'](_0x335fd8[_0x9e58('0x2f')][_0x9e58('0x72')]?{'message':_0x9e58('0x73'),'statusCode':_0x535d22[_0x9e58('0x6f')]}:_0x535d22);});}else{var _0x1edb5b=0x1f4;_0x376baa[_0x9e58('0x15')](_0x1edb5b)[_0x9e58('0x26')]({'message':_0x9e58('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 66ab031..19614f8 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 _0x383b=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x21542d,_0x409866){var _0x51644f=function(_0x48ed18){while(--_0x48ed18){_0x21542d['push'](_0x21542d['shift']());}};_0x51644f(++_0x409866);}(_0x383b,0x89));var _0xb383=function(_0x162ac5,_0x5c08d3){_0x162ac5=_0x162ac5-0x0;var _0x532671=_0x383b[_0x162ac5];return _0x532671;};'use strict';var _=require(_0xb383('0x0'));var util=require('util');var logger=require(_0xb383('0x1'))(_0xb383('0x2'));var moment=require(_0xb383('0x3'));var BPromise=require('bluebird');var rp=require(_0xb383('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb383('0x5'));var config=require(_0xb383('0x6'));var attributes=require(_0xb383('0x7'));var integrations=require(_0xb383('0x8'));module[_0xb383('0x9')]=function(_0x2aefe4,_0x5ee0de){return _0x2aefe4[_0xb383('0xa')](_0xb383('0xb'),attributes,{'tableName':_0xb383('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28b0=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cafdf,_0x19e228){var _0x5d4d7a=function(_0x12a0d9){while(--_0x12a0d9){_0x3cafdf['push'](_0x3cafdf['shift']());}};_0x5d4d7a(++_0x19e228);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x028b('0x0'));var logger=require(_0x028b('0x1'))(_0x028b('0x2'));var moment=require(_0x028b('0x3'));var BPromise=require(_0x028b('0x4'));var rp=require(_0x028b('0x5'));var fs=require('fs');var path=require(_0x028b('0x6'));var rimraf=require(_0x028b('0x7'));var config=require(_0x028b('0x8'));var attributes=require(_0x028b('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x028b('0xa')]=function(_0x5bbe03,_0xe6ffb9){return _0x5bbe03[_0x028b('0xb')](_0x028b('0xc'),attributes,{'tableName':_0x028b('0xd'),'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 22c2add..73e884b 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 _0x2aa6=['GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x5c2b16,_0x28d06e){var _0x37bf4d=function(_0x1f9b8f){while(--_0x1f9b8f){_0x5c2b16['push'](_0x5c2b16['shift']());}};_0x37bf4d(++_0x28d06e);}(_0x2aa6,0x79));var _0x62aa=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x2aa6[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x62aa('0x0'));var util=require(_0x62aa('0x1'));var moment=require(_0x62aa('0x2'));var BPromise=require(_0x62aa('0x3'));var rs=require(_0x62aa('0x4'));var fs=require('fs');var Redis=require(_0x62aa('0x5'));var db=require(_0x62aa('0x6'))['db'];var utils=require(_0x62aa('0x7'));var logger=require('../../config/logger')(_0x62aa('0x8'));var config=require(_0x62aa('0x9'));var jayson=require(_0x62aa('0xa'));var client=jayson[_0x62aa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26a266,_0x29d301,_0x2384cd){return new BPromise(function(_0x320587,_0x59cd67){return client['request'](_0x26a266,_0x2384cd)[_0x62aa('0xc')](function(_0x252be1){logger[_0x62aa('0xd')](_0x62aa('0xe'),_0x29d301,_0x62aa('0xf'));logger[_0x62aa('0x10')](_0x62aa('0x11'),_0x29d301,_0x62aa('0xf'),JSON['stringify'](_0x252be1));if(_0x252be1[_0x62aa('0x12')]){if(_0x252be1[_0x62aa('0x12')][_0x62aa('0x13')]===0x1f4){logger[_0x62aa('0x12')](_0x62aa('0xe'),_0x29d301,_0x252be1[_0x62aa('0x12')][_0x62aa('0x14')]);return _0x59cd67(_0x252be1[_0x62aa('0x12')][_0x62aa('0x14')]);}logger['error'](_0x62aa('0xe'),_0x29d301,_0x252be1[_0x62aa('0x12')][_0x62aa('0x14')]);return _0x320587(_0x252be1[_0x62aa('0x12')][_0x62aa('0x14')]);}else{logger[_0x62aa('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x29d301,'request\x20sent');_0x320587(_0x252be1[_0x62aa('0x15')]['message']);}})[_0x62aa('0x16')](function(_0x461e16){logger[_0x62aa('0x12')](_0x62aa('0xe'),_0x29d301,_0x461e16);_0x59cd67(_0x461e16);});});}exports[_0x62aa('0x17')]=function(_0x111a13){var _0x56fec6=this;return new Promise(function(_0x16c164,_0x78aa8c){return db[_0x62aa('0x18')]['findAll']({'raw':_0x111a13[_0x62aa('0x19')]?_0x111a13[_0x62aa('0x19')][_0x62aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x111a13['options']?_0x111a13[_0x62aa('0x19')][_0x62aa('0x1b')]||null:null,'attributes':_0x111a13[_0x62aa('0x19')]?_0x111a13[_0x62aa('0x19')][_0x62aa('0x1c')]||null:null,'limit':_0x111a13[_0x62aa('0x19')]?_0x111a13[_0x62aa('0x19')][_0x62aa('0x1d')]||null:null,'include':_0x111a13['options']?_0x111a13['options'][_0x62aa('0x1e')]?_['map'](_0x111a13[_0x62aa('0x19')][_0x62aa('0x1e')],function(_0x114416){return{'model':db[_0x114416['model']],'as':_0x114416['as'],'attributes':_0x114416[_0x62aa('0x1c')],'include':_0x114416[_0x62aa('0x1e')]?_[_0x62aa('0x1f')](_0x114416['include'],function(_0x21e4ad){return{'model':db[_0x21e4ad['model']],'as':_0x21e4ad['as'],'attributes':_0x21e4ad[_0x62aa('0x1c')],'include':_0x21e4ad[_0x62aa('0x1e')]?_[_0x62aa('0x1f')](_0x21e4ad[_0x62aa('0x1e')],function(_0x3446fc){return{'model':db[_0x3446fc[_0x62aa('0x20')]],'as':_0x3446fc['as'],'attributes':_0x3446fc[_0x62aa('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xca0285){logger['info'](_0x62aa('0x17'),_0x111a13);logger[_0x62aa('0x10')](_0x62aa('0x17'),_0x111a13,JSON['stringify'](_0xca0285));_0x16c164(_0xca0285);})[_0x62aa('0x16')](function(_0x233b79){logger[_0x62aa('0x12')](_0x62aa('0x17'),_0x233b79[_0x62aa('0x14')],_0x111a13);_0x78aa8c(_0x56fec6[_0x62aa('0x12')](0x1f4,_0x233b79[_0x62aa('0x14')]));});});};exports[_0x62aa('0x21')]=function(_0x3ec8ce){var _0x151d5d=this;return new Promise(function(_0x36f83b,_0x505a76){return db[_0x62aa('0x18')][_0x62aa('0x22')]({'raw':_0x3ec8ce[_0x62aa('0x19')]?_0x3ec8ce['options'][_0x62aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ec8ce[_0x62aa('0x19')]?_0x3ec8ce[_0x62aa('0x19')]['where']||null:null,'attributes':_0x3ec8ce[_0x62aa('0x19')]?_0x3ec8ce['options'][_0x62aa('0x1c')]||null:null,'include':_0x3ec8ce['options']?_0x3ec8ce[_0x62aa('0x19')][_0x62aa('0x1e')]?_[_0x62aa('0x1f')](_0x3ec8ce['options']['include'],function(_0x4e1e2f){return{'model':db[_0x4e1e2f[_0x62aa('0x20')]],'as':_0x4e1e2f['as'],'attributes':_0x4e1e2f[_0x62aa('0x1c')],'include':_0x4e1e2f[_0x62aa('0x1e')]?_[_0x62aa('0x1f')](_0x4e1e2f[_0x62aa('0x1e')],function(_0x4f7c13){return{'model':db[_0x4f7c13[_0x62aa('0x20')]],'as':_0x4f7c13['as'],'attributes':_0x4f7c13[_0x62aa('0x1c')],'include':_0x4f7c13[_0x62aa('0x1e')]?_[_0x62aa('0x1f')](_0x4f7c13[_0x62aa('0x1e')],function(_0x1a0929){return{'model':db[_0x1a0929[_0x62aa('0x20')]],'as':_0x1a0929['as'],'attributes':_0x1a0929['attributes']};}):[]};}):[]};}):[]:[]})[_0x62aa('0xc')](function(_0x146be6){logger['info'](_0x62aa('0x21'),_0x3ec8ce);logger[_0x62aa('0x10')](_0x62aa('0x21'),_0x3ec8ce,JSON[_0x62aa('0x23')](_0x146be6));_0x36f83b(_0x146be6);})[_0x62aa('0x16')](function(_0x1e606c){logger[_0x62aa('0x12')]('ShowSugarcrmAccount',_0x1e606c[_0x62aa('0x14')],_0x3ec8ce);_0x505a76(_0x151d5d[_0x62aa('0x12')](0x1f4,_0x1e606c['message']));});});}; \ No newline at end of file +var _0xe39b=['limit','include','map','model','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes'];(function(_0x41c300,_0x43a3ae){var _0x349680=function(_0x47d3c5){while(--_0x47d3c5){_0x41c300['push'](_0x41c300['shift']());}};_0x349680(++_0x43a3ae);}(_0xe39b,0x1bf));var _0xbe39=function(_0x5688f5,_0x1da8d6){_0x5688f5=_0x5688f5-0x0;var _0x440df7=_0xe39b[_0x5688f5];return _0x440df7;};'use strict';var _=require(_0xbe39('0x0'));var util=require('util');var moment=require(_0xbe39('0x1'));var BPromise=require(_0xbe39('0x2'));var rs=require(_0xbe39('0x3'));var fs=require('fs');var Redis=require(_0xbe39('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe39('0x5'))(_0xbe39('0x6'));var config=require(_0xbe39('0x7'));var jayson=require(_0xbe39('0x8'));var client=jayson[_0xbe39('0x9')][_0xbe39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3241c2,_0xcae54a,_0x2de84d){return new BPromise(function(_0x2a54fe,_0x493a1c){return client[_0xbe39('0xb')](_0x3241c2,_0x2de84d)[_0xbe39('0xc')](function(_0x50199c){logger[_0xbe39('0xd')](_0xbe39('0xe'),_0xcae54a,_0xbe39('0xf'));logger[_0xbe39('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0xcae54a,_0xbe39('0xf'),JSON[_0xbe39('0x11')](_0x50199c));if(_0x50199c[_0xbe39('0x12')]){if(_0x50199c[_0xbe39('0x12')][_0xbe39('0x13')]===0x1f4){logger['error'](_0xbe39('0xe'),_0xcae54a,_0x50199c[_0xbe39('0x12')][_0xbe39('0x14')]);return _0x493a1c(_0x50199c[_0xbe39('0x12')]['message']);}logger[_0xbe39('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0xcae54a,_0x50199c['error'][_0xbe39('0x14')]);return _0x2a54fe(_0x50199c[_0xbe39('0x12')][_0xbe39('0x14')]);}else{logger[_0xbe39('0xd')](_0xbe39('0xe'),_0xcae54a,_0xbe39('0xf'));_0x2a54fe(_0x50199c['result']['message']);}})[_0xbe39('0x15')](function(_0x4848cc){logger[_0xbe39('0x12')](_0xbe39('0xe'),_0xcae54a,_0x4848cc);_0x493a1c(_0x4848cc);});});}exports[_0xbe39('0x16')]=function(_0x1103b0){var _0x592e79=this;return new Promise(function(_0xad59f4,_0x3122fe){return db[_0xbe39('0x17')][_0xbe39('0x18')]({'raw':_0x1103b0[_0xbe39('0x19')]?_0x1103b0[_0xbe39('0x19')][_0xbe39('0x1a')]===undefined?!![]:![]:!![],'where':_0x1103b0['options']?_0x1103b0['options'][_0xbe39('0x1b')]||null:null,'attributes':_0x1103b0[_0xbe39('0x19')]?_0x1103b0[_0xbe39('0x19')][_0xbe39('0x1c')]||null:null,'limit':_0x1103b0[_0xbe39('0x19')]?_0x1103b0[_0xbe39('0x19')][_0xbe39('0x1d')]||null:null,'include':_0x1103b0[_0xbe39('0x19')]?_0x1103b0[_0xbe39('0x19')][_0xbe39('0x1e')]?_[_0xbe39('0x1f')](_0x1103b0[_0xbe39('0x19')]['include'],function(_0x4737f0){return{'model':db[_0x4737f0[_0xbe39('0x20')]],'as':_0x4737f0['as'],'attributes':_0x4737f0[_0xbe39('0x1c')],'include':_0x4737f0[_0xbe39('0x1e')]?_['map'](_0x4737f0['include'],function(_0x5c58ba){return{'model':db[_0x5c58ba[_0xbe39('0x20')]],'as':_0x5c58ba['as'],'attributes':_0x5c58ba['attributes'],'include':_0x5c58ba[_0xbe39('0x1e')]?_['map'](_0x5c58ba[_0xbe39('0x1e')],function(_0x4caad7){return{'model':db[_0x4caad7[_0xbe39('0x20')]],'as':_0x4caad7['as'],'attributes':_0x4caad7[_0xbe39('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbe39('0xc')](function(_0x2a8893){logger['info']('GetSugarcrmAccount',_0x1103b0);logger['debug'](_0xbe39('0x16'),_0x1103b0,JSON[_0xbe39('0x11')](_0x2a8893));_0xad59f4(_0x2a8893);})[_0xbe39('0x15')](function(_0x1606e8){logger[_0xbe39('0x12')]('GetSugarcrmAccount',_0x1606e8[_0xbe39('0x14')],_0x1103b0);_0x3122fe(_0x592e79[_0xbe39('0x12')](0x1f4,_0x1606e8[_0xbe39('0x14')]));});});};exports[_0xbe39('0x21')]=function(_0x24eade){var _0x5160b2=this;return new Promise(function(_0x1a398b,_0x134557){return db[_0xbe39('0x17')]['find']({'raw':_0x24eade[_0xbe39('0x19')]?_0x24eade[_0xbe39('0x19')][_0xbe39('0x1a')]===undefined?!![]:![]:!![],'where':_0x24eade[_0xbe39('0x19')]?_0x24eade['options'][_0xbe39('0x1b')]||null:null,'attributes':_0x24eade[_0xbe39('0x19')]?_0x24eade[_0xbe39('0x19')][_0xbe39('0x1c')]||null:null,'include':_0x24eade['options']?_0x24eade['options'][_0xbe39('0x1e')]?_[_0xbe39('0x1f')](_0x24eade['options'][_0xbe39('0x1e')],function(_0x4563db){return{'model':db[_0x4563db['model']],'as':_0x4563db['as'],'attributes':_0x4563db[_0xbe39('0x1c')],'include':_0x4563db[_0xbe39('0x1e')]?_[_0xbe39('0x1f')](_0x4563db['include'],function(_0x9925f9){return{'model':db[_0x9925f9[_0xbe39('0x20')]],'as':_0x9925f9['as'],'attributes':_0x9925f9[_0xbe39('0x1c')],'include':_0x9925f9[_0xbe39('0x1e')]?_[_0xbe39('0x1f')](_0x9925f9['include'],function(_0x554902){return{'model':db[_0x554902[_0xbe39('0x20')]],'as':_0x554902['as'],'attributes':_0x554902[_0xbe39('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbe39('0xc')](function(_0x4127b4){logger[_0xbe39('0xd')](_0xbe39('0x21'),_0x24eade);logger[_0xbe39('0x10')](_0xbe39('0x21'),_0x24eade,JSON[_0xbe39('0x11')](_0x4127b4));_0x1a398b(_0x4127b4);})[_0xbe39('0x15')](function(_0x5df16c){logger[_0xbe39('0x12')](_0xbe39('0x21'),_0x5df16c[_0xbe39('0x14')],_0x24eade);_0x134557(_0x5160b2[_0xbe39('0x12')](0x1f4,_0x5df16c[_0xbe39('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index b756a6f..760d943 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 _0x3868=['create','put','update','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x3868,0xb4));var _0x8386=function(_0x3f1d8b,_0x178f48){_0x3f1d8b=_0x3f1d8b-0x0;var _0x557214=_0x3868[_0x3f1d8b];return _0x557214;};'use strict';var multer=require(_0x8386('0x0'));var util=require(_0x8386('0x1'));var path=require(_0x8386('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8386('0x3')]();var fs_extra=require(_0x8386('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8386('0x5'));var config=require(_0x8386('0x6'));var controller=require(_0x8386('0x7'));router[_0x8386('0x8')]('/',auth[_0x8386('0x9')](),controller[_0x8386('0xa')]);router[_0x8386('0x8')](_0x8386('0xb'),auth[_0x8386('0x9')](),controller[_0x8386('0xc')]);router[_0x8386('0x8')](_0x8386('0xd'),auth[_0x8386('0x9')](),controller[_0x8386('0xe')]);router['get'](_0x8386('0xf'),auth[_0x8386('0x9')](),controller['getSubjects']);router[_0x8386('0x8')]('/:id/descriptions',auth[_0x8386('0x9')](),controller[_0x8386('0x10')]);router[_0x8386('0x11')]('/',auth['isAuthenticated'](),controller[_0x8386('0x12')]);router[_0x8386('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8386('0x14')]);router['delete'](_0x8386('0xb'),auth[_0x8386('0x9')](),controller['destroy']);module[_0x8386('0x15')]=router; \ No newline at end of file +var _0xfc5d=['update','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index','/:id','/:id/fields','getFields','getSubjects','isAuthenticated','post','create','put'];(function(_0x106c9e,_0xaf4e76){var _0x32835c=function(_0x744c88){while(--_0x744c88){_0x106c9e['push'](_0x106c9e['shift']());}};_0x32835c(++_0xaf4e76);}(_0xfc5d,0x87));var _0xdfc5=function(_0x5cd172,_0x322e0c){_0x5cd172=_0x5cd172-0x0;var _0x255d7b=_0xfc5d[_0x5cd172];return _0x255d7b;};'use strict';var multer=require('multer');var util=require(_0xdfc5('0x0'));var path=require(_0xdfc5('0x1'));var timeout=require(_0xdfc5('0x2'));var express=require('express');var router=express[_0xdfc5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdfc5('0x4'));var interaction=require(_0xdfc5('0x5'));var config=require('../../config/environment');var controller=require(_0xdfc5('0x6'));router[_0xdfc5('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfc5('0x8')]);router[_0xdfc5('0x7')](_0xdfc5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xdfc5('0x7')](_0xdfc5('0xa'),auth['isAuthenticated'](),controller[_0xdfc5('0xb')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xdfc5('0xc')]);router[_0xdfc5('0x7')]('/:id/descriptions',auth[_0xdfc5('0xd')](),controller['getDescriptions']);router[_0xdfc5('0xe')]('/',auth[_0xdfc5('0xd')](),controller[_0xdfc5('0xf')]);router[_0xdfc5('0x10')](_0xdfc5('0x9'),auth['isAuthenticated'](),controller[_0xdfc5('0x11')]);router['delete']('/:id',auth[_0xdfc5('0xd')](),controller[_0xdfc5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 56581e5..dd46689 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 _0x2e9d=['STRING','sequelize'];(function(_0x35b4d3,_0x1c1efd){var _0x55001f=function(_0x2a9469){while(--_0x2a9469){_0x35b4d3['push'](_0x35b4d3['shift']());}};_0x55001f(++_0x1c1efd);}(_0x2e9d,0xf1));var _0xd2e9=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x2e9d[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0xd2e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2e9('0x1')]},'description':{'type':Sequelize[_0xd2e9('0x1')]}}; \ No newline at end of file +var _0x8273=['STRING'];(function(_0x3a6409,_0x3183c8){var _0x2d6231=function(_0xb371da){while(--_0xb371da){_0x3a6409['push'](_0x3a6409['shift']());}};_0x2d6231(++_0x3183c8);}(_0x8273,0x160));var _0x3827=function(_0x435007,_0x110b52){_0x435007=_0x435007-0x0;var _0x226278=_0x8273[_0x435007];return _0x226278;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3827('0x0')]},'description':{'type':Sequelize[_0x3827('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2b07711..ac26a1d 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 _0x8dc5=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','findOne','SugarcrmField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','end','json','offset','undefined','limit','count','status','set','reject','save','then','destroy','sendStatus','stack','name','send','index','map','SugarcrmConfiguration'];(function(_0x3d4f05,_0x411cb0){var _0x333adc=function(_0x3e12c5){while(--_0x3e12c5){_0x3d4f05['push'](_0x3d4f05['shift']());}};_0x333adc(++_0x411cb0);}(_0x8dc5,0x11f));var _0x58dc=function(_0x4de2e3,_0x7c3e2a){_0x4de2e3=_0x4de2e3-0x0;var _0x5df1c7=_0x8dc5[_0x4de2e3];return _0x5df1c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58dc('0x0'));var zipdir=require(_0x58dc('0x1'));var jsonpatch=require(_0x58dc('0x2'));var rp=require('request-promise');var moment=require(_0x58dc('0x3'));var BPromise=require(_0x58dc('0x4'));var Mustache=require(_0x58dc('0x5'));var util=require(_0x58dc('0x6'));var path=require(_0x58dc('0x7'));var sox=require(_0x58dc('0x8'));var csv=require('to-csv');var ejs=require(_0x58dc('0x9'));var fs=require('fs');var fs_extra=require(_0x58dc('0xa'));var _=require(_0x58dc('0xb'));var squel=require(_0x58dc('0xc'));var crypto=require('crypto');var jsforce=require(_0x58dc('0xd'));var deskjs=require(_0x58dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x58dc('0xf'));var Papa=require(_0x58dc('0x10'));var Redis=require('ioredis');var authService=require(_0x58dc('0x11'));var qs=require(_0x58dc('0x12'));var as=require(_0x58dc('0x13'));var hardwareService=require(_0x58dc('0x14'));var logger=require(_0x58dc('0x15'))(_0x58dc('0x16'));var utils=require(_0x58dc('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x58dc('0x18'));var db=require(_0x58dc('0x19'))['db'];function respondWithStatusCode(_0x5aba08,_0x4f968e){_0x4f968e=_0x4f968e||0xcc;return function(_0x2c1742){if(_0x2c1742){return _0x5aba08['sendStatus'](_0x4f968e);}return _0x5aba08['status'](_0x4f968e)[_0x58dc('0x1a')]();};}function respondWithResult(_0x4ec942,_0x112ca1){_0x112ca1=_0x112ca1||0xc8;return function(_0x5b43bc){if(_0x5b43bc){return _0x4ec942['status'](_0x112ca1)[_0x58dc('0x1b')](_0x5b43bc);}};}function respondWithFilteredResult(_0x5dac8c,_0x22fd37){return function(_0xcbb042){if(_0xcbb042){var _0x12ae0d=typeof _0x22fd37[_0x58dc('0x1c')]===_0x58dc('0x1d')&&typeof _0x22fd37[_0x58dc('0x1e')]===_0x58dc('0x1d');var _0x3c3288=_0xcbb042[_0x58dc('0x1f')];var _0x591319=_0x12ae0d?0x0:_0x22fd37[_0x58dc('0x1c')];var _0x316c6d=_0x12ae0d?_0xcbb042[_0x58dc('0x1f')]:_0x22fd37['offset']+_0x22fd37[_0x58dc('0x1e')];var _0x44bcd8;if(_0x316c6d>=_0x3c3288){_0x316c6d=_0x3c3288;_0x44bcd8=0xc8;}else{_0x44bcd8=0xce;}_0x5dac8c[_0x58dc('0x20')](_0x44bcd8);return _0x5dac8c[_0x58dc('0x21')]('Content-Range',_0x591319+'-'+_0x316c6d+'/'+_0x3c3288)[_0x58dc('0x1b')](_0xcbb042);}return null;};}function patchUpdates(_0x4e44cf){return function(_0x14a1e1){try{jsonpatch['apply'](_0x14a1e1,_0x4e44cf,!![]);}catch(_0x232df3){return BPromise[_0x58dc('0x22')](_0x232df3);}return _0x14a1e1[_0x58dc('0x23')]();};}function saveUpdates(_0x43a942,_0xba4257){return function(_0x311ad6){if(_0x311ad6){return _0x311ad6['update'](_0x43a942)[_0x58dc('0x24')](function(_0x13d63a){return _0x13d63a;});}return null;};}function removeEntity(_0x1dc4d0,_0x292f5b){return function(_0x2226d4){if(_0x2226d4){return _0x2226d4[_0x58dc('0x25')]()[_0x58dc('0x24')](function(){_0x1dc4d0['status'](0xcc)[_0x58dc('0x1a')]();});}};}function handleEntityNotFound(_0x13aa3a,_0x51cdf6){return function(_0x5a3f49){if(!_0x5a3f49){_0x13aa3a[_0x58dc('0x26')](0x194);}return _0x5a3f49;};}function handleError(_0x2bc192,_0x1ad7d6){_0x1ad7d6=_0x1ad7d6||0x1f4;return function(_0x11a814){logger['error'](_0x11a814[_0x58dc('0x27')]);if(_0x11a814[_0x58dc('0x28')]){delete _0x11a814[_0x58dc('0x28')];}_0x2bc192['status'](_0x1ad7d6)[_0x58dc('0x29')](_0x11a814);};}exports[_0x58dc('0x2a')]=function(_0x595003,_0x4c54da){var _0x435054={},_0x5244d2={},_0x51c279={'count':0x0,'rows':[]};var _0x3de61b=_[_0x58dc('0x2b')](db[_0x58dc('0x2c')][_0x58dc('0x2d')],function(_0x18b31b){return{'name':_0x18b31b[_0x58dc('0x2e')],'type':_0x18b31b[_0x58dc('0x2f')][_0x58dc('0x30')]};});_0x5244d2[_0x58dc('0x31')]=_[_0x58dc('0x2b')](_0x3de61b,_0x58dc('0x28'));_0x5244d2['query']=_['keys'](_0x595003[_0x58dc('0x32')]);_0x5244d2[_0x58dc('0x33')]=_[_0x58dc('0x34')](_0x5244d2[_0x58dc('0x31')],_0x5244d2[_0x58dc('0x32')]);_0x435054[_0x58dc('0x35')]=_['intersection'](_0x5244d2[_0x58dc('0x31')],qs[_0x58dc('0x36')](_0x595003[_0x58dc('0x32')][_0x58dc('0x36')]));_0x435054[_0x58dc('0x35')]=_0x435054[_0x58dc('0x35')][_0x58dc('0x37')]?_0x435054[_0x58dc('0x35')]:_0x5244d2[_0x58dc('0x31')];if(!_0x595003[_0x58dc('0x32')]['hasOwnProperty'](_0x58dc('0x38'))){_0x435054[_0x58dc('0x1e')]=qs[_0x58dc('0x1e')](_0x595003[_0x58dc('0x32')][_0x58dc('0x1e')]);_0x435054[_0x58dc('0x1c')]=qs[_0x58dc('0x1c')](_0x595003['query'][_0x58dc('0x1c')]);}_0x435054[_0x58dc('0x39')]=qs[_0x58dc('0x3a')](_0x595003[_0x58dc('0x32')][_0x58dc('0x3a')]);_0x435054['where']=qs['filters'](_['pick'](_0x595003['query'],_0x5244d2[_0x58dc('0x33')]),_0x3de61b);if(_0x595003['query'][_0x58dc('0x3b')]){_0x435054['where']=_[_0x58dc('0x3c')](_0x435054[_0x58dc('0x3d')],{'$or':_[_0x58dc('0x2b')](_0x3de61b,function(_0x1a7b86){if(_0x1a7b86[_0x58dc('0x2f')]!==_0x58dc('0x3e')){var _0x3691f3={};_0x3691f3[_0x1a7b86[_0x58dc('0x28')]]={'$like':'%'+_0x595003['query']['filter']+'%'};return _0x3691f3;}})});}_0x435054=_[_0x58dc('0x3c')]({},_0x435054,_0x595003[_0x58dc('0x3f')]);var _0xb60253={'where':_0x435054[_0x58dc('0x3d')]};return db[_0x58dc('0x2c')][_0x58dc('0x1f')](_0xb60253)['then'](function(_0x2feeeb){_0x51c279[_0x58dc('0x1f')]=_0x2feeeb;if(_0x595003[_0x58dc('0x32')][_0x58dc('0x40')]){_0x435054[_0x58dc('0x41')]=[{'all':!![]}];}return db[_0x58dc('0x2c')][_0x58dc('0x42')](_0x435054);})[_0x58dc('0x24')](function(_0x526b78){_0x51c279[_0x58dc('0x43')]=_0x526b78;return _0x51c279;})[_0x58dc('0x24')](respondWithFilteredResult(_0x4c54da,_0x435054))[_0x58dc('0x44')](handleError(_0x4c54da,null));};exports[_0x58dc('0x45')]=function(_0x179b6e,_0x1a552c){var _0x1e664d={'raw':![],'where':{'id':_0x179b6e[_0x58dc('0x46')]['id']}},_0xfb8fb7={};_0xfb8fb7['model']=_[_0x58dc('0x47')](db[_0x58dc('0x2c')][_0x58dc('0x2d')]);_0xfb8fb7[_0x58dc('0x32')]=_[_0x58dc('0x47')](_0x179b6e['query']);_0xfb8fb7['filters']=_['intersection'](_0xfb8fb7[_0x58dc('0x31')],_0xfb8fb7[_0x58dc('0x32')]);_0x1e664d[_0x58dc('0x35')]=_[_0x58dc('0x34')](_0xfb8fb7[_0x58dc('0x31')],qs[_0x58dc('0x36')](_0x179b6e[_0x58dc('0x32')][_0x58dc('0x36')]));_0x1e664d['attributes']=_0x1e664d[_0x58dc('0x35')][_0x58dc('0x37')]?_0x1e664d[_0x58dc('0x35')]:_0xfb8fb7[_0x58dc('0x31')];if(_0x179b6e[_0x58dc('0x32')]['includeAll']){_0x1e664d[_0x58dc('0x41')]=[{'all':!![]}];}_0x1e664d=_['merge']({},_0x1e664d,_0x179b6e[_0x58dc('0x3f')]);return db[_0x58dc('0x2c')][_0x58dc('0x48')](_0x1e664d)[_0x58dc('0x24')](handleEntityNotFound(_0x1a552c,null))[_0x58dc('0x24')](respondWithResult(_0x1a552c,null))[_0x58dc('0x44')](handleError(_0x1a552c,null));};exports['create']=function(_0x4b26e3,_0x37f34f){return db[_0x58dc('0x2c')][_0x58dc('0x49')](_0x4b26e3[_0x58dc('0x4a')],{})[_0x58dc('0x24')](respondWithResult(_0x37f34f,0xc9))[_0x58dc('0x44')](handleError(_0x37f34f,null));};exports[_0x58dc('0x4b')]=function(_0x1dbea7,_0x2e1ee6){if(_0x1dbea7[_0x58dc('0x4a')]['id']){delete _0x1dbea7[_0x58dc('0x4a')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x1dbea7[_0x58dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e1ee6,null))[_0x58dc('0x24')](saveUpdates(_0x1dbea7['body'],null))[_0x58dc('0x24')](respondWithResult(_0x2e1ee6,null))[_0x58dc('0x44')](handleError(_0x2e1ee6,null));};exports[_0x58dc('0x25')]=function(_0x402ecf,_0x3c5166){return db[_0x58dc('0x2c')]['find']({'where':{'id':_0x402ecf['params']['id']}})[_0x58dc('0x24')](handleEntityNotFound(_0x3c5166,null))[_0x58dc('0x24')](removeEntity(_0x3c5166,null))[_0x58dc('0x44')](handleError(_0x3c5166,null));};exports['getFields']=function(_0x2dfd6b,_0x3ef88a,_0x2de7a9){var _0x34d18a={};var _0x4c6b39={};var _0x2df5aa;var _0x517c6d;return db[_0x58dc('0x2c')][_0x58dc('0x4c')]({'where':{'id':_0x2dfd6b['params']['id']}})[_0x58dc('0x24')](handleEntityNotFound(_0x3ef88a,null))[_0x58dc('0x24')](function(_0x435da5){if(_0x435da5){_0x2df5aa=_0x435da5;_0x4c6b39['model']=_[_0x58dc('0x47')](db[_0x58dc('0x4d')][_0x58dc('0x2d')]);_0x4c6b39['query']=_['keys'](_0x2dfd6b[_0x58dc('0x32')]);_0x4c6b39[_0x58dc('0x33')]=_[_0x58dc('0x34')](_0x4c6b39[_0x58dc('0x31')],_0x4c6b39['query']);_0x34d18a[_0x58dc('0x35')]=_[_0x58dc('0x34')](_0x4c6b39[_0x58dc('0x31')],qs[_0x58dc('0x36')](_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x36')]));_0x34d18a[_0x58dc('0x35')]=_0x34d18a[_0x58dc('0x35')][_0x58dc('0x37')]?_0x34d18a[_0x58dc('0x35')]:_0x4c6b39[_0x58dc('0x31')];_0x34d18a[_0x58dc('0x39')]=qs['sort'](_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x3a')]);_0x34d18a[_0x58dc('0x3d')]=qs[_0x58dc('0x33')](_[_0x58dc('0x4e')](_0x2dfd6b[_0x58dc('0x32')],_0x4c6b39[_0x58dc('0x33')]));if(_0x2dfd6b['query'][_0x58dc('0x3b')]){_0x34d18a[_0x58dc('0x3d')]=_[_0x58dc('0x3c')](_0x34d18a[_0x58dc('0x3d')],{'$or':_[_0x58dc('0x2b')](_0x34d18a[_0x58dc('0x35')],function(_0x27b7a9){var _0x132e8b={};_0x132e8b[_0x27b7a9]={'$like':'%'+_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x3b')]+'%'};return _0x132e8b;})});}_0x34d18a=_[_0x58dc('0x3c')]({},_0x34d18a,_0x2dfd6b[_0x58dc('0x3f')]);return _0x2df5aa[_0x58dc('0x4f')](_0x34d18a);}})[_0x58dc('0x24')](function(_0x4364e0){if(_0x4364e0){_0x517c6d=_0x4364e0[_0x58dc('0x37')];if(!_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x50')](_0x58dc('0x38'))){_0x34d18a[_0x58dc('0x1e')]=qs[_0x58dc('0x1e')](_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x1e')]);_0x34d18a[_0x58dc('0x1c')]=qs['offset'](_0x2dfd6b[_0x58dc('0x32')][_0x58dc('0x1c')]);}return _0x2df5aa[_0x58dc('0x4f')](_0x34d18a);}})[_0x58dc('0x24')](function(_0x4e3159){if(_0x4e3159){return _0x4e3159?{'count':_0x517c6d,'rows':_0x4e3159}:null;}})['then'](respondWithResult(_0x3ef88a,null))[_0x58dc('0x44')](handleError(_0x3ef88a,null));};exports[_0x58dc('0x51')]=function(_0x243705,_0x23723d,_0x48e763){var _0x173aac={};var _0x5db258={};var _0x5a5df7;var _0x376a49;return db[_0x58dc('0x2c')][_0x58dc('0x4c')]({'where':{'id':_0x243705[_0x58dc('0x46')]['id']}})[_0x58dc('0x24')](handleEntityNotFound(_0x23723d,null))['then'](function(_0x584b01){if(_0x584b01){_0x5a5df7=_0x584b01;_0x5db258[_0x58dc('0x31')]=_[_0x58dc('0x47')](db[_0x58dc('0x4d')][_0x58dc('0x2d')]);_0x5db258[_0x58dc('0x32')]=_['keys'](_0x243705[_0x58dc('0x32')]);_0x5db258[_0x58dc('0x33')]=_[_0x58dc('0x34')](_0x5db258[_0x58dc('0x31')],_0x5db258[_0x58dc('0x32')]);_0x173aac['attributes']=_[_0x58dc('0x34')](_0x5db258[_0x58dc('0x31')],qs[_0x58dc('0x36')](_0x243705['query'][_0x58dc('0x36')]));_0x173aac['attributes']=_0x173aac[_0x58dc('0x35')][_0x58dc('0x37')]?_0x173aac[_0x58dc('0x35')]:_0x5db258[_0x58dc('0x31')];_0x173aac[_0x58dc('0x39')]=qs[_0x58dc('0x3a')](_0x243705[_0x58dc('0x32')][_0x58dc('0x3a')]);_0x173aac['where']=qs['filters'](_[_0x58dc('0x4e')](_0x243705[_0x58dc('0x32')],_0x5db258[_0x58dc('0x33')]));if(_0x243705[_0x58dc('0x32')][_0x58dc('0x3b')]){_0x173aac[_0x58dc('0x3d')]=_[_0x58dc('0x3c')](_0x173aac[_0x58dc('0x3d')],{'$or':_[_0x58dc('0x2b')](_0x173aac['attributes'],function(_0x29c4bf){var _0x32c5fb={};_0x32c5fb[_0x29c4bf]={'$like':'%'+_0x243705[_0x58dc('0x32')][_0x58dc('0x3b')]+'%'};return _0x32c5fb;})});}_0x173aac=_[_0x58dc('0x3c')]({},_0x173aac,_0x243705[_0x58dc('0x3f')]);return _0x5a5df7[_0x58dc('0x51')](_0x173aac);}})[_0x58dc('0x24')](function(_0x1d338b){if(_0x1d338b){_0x376a49=_0x1d338b[_0x58dc('0x37')];if(!_0x243705[_0x58dc('0x32')]['hasOwnProperty'](_0x58dc('0x38'))){_0x173aac[_0x58dc('0x1e')]=qs[_0x58dc('0x1e')](_0x243705[_0x58dc('0x32')][_0x58dc('0x1e')]);_0x173aac['offset']=qs[_0x58dc('0x1c')](_0x243705['query'][_0x58dc('0x1c')]);}return _0x5a5df7[_0x58dc('0x51')](_0x173aac);}})[_0x58dc('0x24')](function(_0x2161ff){if(_0x2161ff){return _0x2161ff?{'count':_0x376a49,'rows':_0x2161ff}:null;}})[_0x58dc('0x24')](respondWithResult(_0x23723d,null))[_0x58dc('0x44')](handleError(_0x23723d,null));};exports[_0x58dc('0x52')]=function(_0x5b4da9,_0x25bc52,_0x412122){var _0x2f8eb2={};var _0x51da20={};var _0x4b7ba7;var _0xa1ae3d;return db[_0x58dc('0x2c')]['findOne']({'where':{'id':_0x5b4da9[_0x58dc('0x46')]['id']}})[_0x58dc('0x24')](handleEntityNotFound(_0x25bc52,null))[_0x58dc('0x24')](function(_0x41d312){if(_0x41d312){_0x4b7ba7=_0x41d312;_0x51da20['model']=_[_0x58dc('0x47')](db[_0x58dc('0x4d')]['rawAttributes']);_0x51da20[_0x58dc('0x32')]=_['keys'](_0x5b4da9[_0x58dc('0x32')]);_0x51da20[_0x58dc('0x33')]=_['intersection'](_0x51da20[_0x58dc('0x31')],_0x51da20[_0x58dc('0x32')]);_0x2f8eb2[_0x58dc('0x35')]=_[_0x58dc('0x34')](_0x51da20[_0x58dc('0x31')],qs[_0x58dc('0x36')](_0x5b4da9[_0x58dc('0x32')][_0x58dc('0x36')]));_0x2f8eb2[_0x58dc('0x35')]=_0x2f8eb2[_0x58dc('0x35')][_0x58dc('0x37')]?_0x2f8eb2[_0x58dc('0x35')]:_0x51da20['model'];_0x2f8eb2[_0x58dc('0x39')]=qs[_0x58dc('0x3a')](_0x5b4da9['query']['sort']);_0x2f8eb2[_0x58dc('0x3d')]=qs[_0x58dc('0x33')](_['pick'](_0x5b4da9[_0x58dc('0x32')],_0x51da20['filters']));if(_0x5b4da9['query'][_0x58dc('0x3b')]){_0x2f8eb2[_0x58dc('0x3d')]=_[_0x58dc('0x3c')](_0x2f8eb2[_0x58dc('0x3d')],{'$or':_[_0x58dc('0x2b')](_0x2f8eb2[_0x58dc('0x35')],function(_0x190e7b){var _0x4c4418={};_0x4c4418[_0x190e7b]={'$like':'%'+_0x5b4da9['query'][_0x58dc('0x3b')]+'%'};return _0x4c4418;})});}_0x2f8eb2=_['merge']({},_0x2f8eb2,_0x5b4da9[_0x58dc('0x3f')]);return _0x4b7ba7[_0x58dc('0x52')](_0x2f8eb2);}})[_0x58dc('0x24')](function(_0x4fb5dc){if(_0x4fb5dc){_0xa1ae3d=_0x4fb5dc[_0x58dc('0x37')];if(!_0x5b4da9[_0x58dc('0x32')][_0x58dc('0x50')](_0x58dc('0x38'))){_0x2f8eb2[_0x58dc('0x1e')]=qs[_0x58dc('0x1e')](_0x5b4da9[_0x58dc('0x32')][_0x58dc('0x1e')]);_0x2f8eb2['offset']=qs[_0x58dc('0x1c')](_0x5b4da9[_0x58dc('0x32')]['offset']);}return _0x4b7ba7[_0x58dc('0x52')](_0x2f8eb2);}})[_0x58dc('0x24')](function(_0x5cab93){if(_0x5cab93){return _0x5cab93?{'count':_0xa1ae3d,'rows':_0x5cab93}:null;}})[_0x58dc('0x24')](respondWithResult(_0x25bc52,null))['catch'](handleError(_0x25bc52,null));}; \ No newline at end of file +var _0xa088=['getFields','SugarcrmField','pick','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','status','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x5f25fc,_0x50eaf8){var _0x28a0a7=function(_0x2a1e26){while(--_0x2a1e26){_0x5f25fc['push'](_0x5f25fc['shift']());}};_0x28a0a7(++_0x50eaf8);}(_0xa088,0x152));var _0x8a08=function(_0x1dbda3,_0x37d6f2){_0x1dbda3=_0x1dbda3-0x0;var _0x3c72a9=_0xa088[_0x1dbda3];return _0x3c72a9;};'use strict';var emlformat=require(_0x8a08('0x0'));var rimraf=require(_0x8a08('0x1'));var zipdir=require(_0x8a08('0x2'));var jsonpatch=require(_0x8a08('0x3'));var rp=require('request-promise');var moment=require(_0x8a08('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a08('0x5'));var path=require(_0x8a08('0x6'));var sox=require(_0x8a08('0x7'));var csv=require(_0x8a08('0x8'));var ejs=require(_0x8a08('0x9'));var fs=require('fs');var fs_extra=require(_0x8a08('0xa'));var _=require(_0x8a08('0xb'));var squel=require(_0x8a08('0xc'));var crypto=require(_0x8a08('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a08('0xe'));var toCsv=require(_0x8a08('0x8'));var querystring=require(_0x8a08('0xf'));var Papa=require(_0x8a08('0x10'));var Redis=require(_0x8a08('0x11'));var authService=require(_0x8a08('0x12'));var qs=require(_0x8a08('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a08('0x14'));var logger=require(_0x8a08('0x15'))('api');var utils=require(_0x8a08('0x16'));var config=require(_0x8a08('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a08('0x18'))['db'];function respondWithStatusCode(_0x395dbe,_0xa151ad){_0xa151ad=_0xa151ad||0xcc;return function(_0x429650){if(_0x429650){return _0x395dbe[_0x8a08('0x19')](_0xa151ad);}return _0x395dbe['status'](_0xa151ad)[_0x8a08('0x1a')]();};}function respondWithResult(_0x4bf4b9,_0x480d57){_0x480d57=_0x480d57||0xc8;return function(_0x387048){if(_0x387048){return _0x4bf4b9['status'](_0x480d57)['json'](_0x387048);}};}function respondWithFilteredResult(_0x5f20bb,_0x270b17){return function(_0x387ee){if(_0x387ee){var _0xc09d69=typeof _0x270b17[_0x8a08('0x1b')]===_0x8a08('0x1c')&&typeof _0x270b17['limit']===_0x8a08('0x1c');var _0x50a61c=_0x387ee['count'];var _0x530d2b=_0xc09d69?0x0:_0x270b17[_0x8a08('0x1b')];var _0x53d214=_0xc09d69?_0x387ee[_0x8a08('0x1d')]:_0x270b17[_0x8a08('0x1b')]+_0x270b17['limit'];var _0x49a4e6;if(_0x53d214>=_0x50a61c){_0x53d214=_0x50a61c;_0x49a4e6=0xc8;}else{_0x49a4e6=0xce;}_0x5f20bb[_0x8a08('0x1e')](_0x49a4e6);return _0x5f20bb[_0x8a08('0x1f')](_0x8a08('0x20'),_0x530d2b+'-'+_0x53d214+'/'+_0x50a61c)[_0x8a08('0x21')](_0x387ee);}return null;};}function patchUpdates(_0x546f81){return function(_0xc7b504){try{jsonpatch[_0x8a08('0x22')](_0xc7b504,_0x546f81,!![]);}catch(_0x2e75d6){return BPromise[_0x8a08('0x23')](_0x2e75d6);}return _0xc7b504[_0x8a08('0x24')]();};}function saveUpdates(_0x36c802,_0x55f715){return function(_0x1acb0d){if(_0x1acb0d){return _0x1acb0d['update'](_0x36c802)[_0x8a08('0x25')](function(_0x15203c){return _0x15203c;});}return null;};}function removeEntity(_0x3ee9c4,_0x4e100e){return function(_0xd372b2){if(_0xd372b2){return _0xd372b2[_0x8a08('0x26')]()[_0x8a08('0x25')](function(){_0x3ee9c4[_0x8a08('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4138bd,_0x313574){return function(_0x6d4c49){if(!_0x6d4c49){_0x4138bd[_0x8a08('0x19')](0x194);}return _0x6d4c49;};}function handleError(_0xd858f,_0xbfa4fc){_0xbfa4fc=_0xbfa4fc||0x1f4;return function(_0x4f907d){logger[_0x8a08('0x27')](_0x4f907d[_0x8a08('0x28')]);if(_0x4f907d['name']){delete _0x4f907d[_0x8a08('0x29')];}_0xd858f['status'](_0xbfa4fc)[_0x8a08('0x2a')](_0x4f907d);};}exports[_0x8a08('0x2b')]=function(_0x4813d8,_0x5dccc2){var _0x3c6bf5={},_0x5ae4a3={},_0xb3e681={'count':0x0,'rows':[]};var _0x1189d9=_[_0x8a08('0x2c')](db[_0x8a08('0x2d')][_0x8a08('0x2e')],function(_0x486cba){return{'name':_0x486cba['fieldName'],'type':_0x486cba[_0x8a08('0x2f')][_0x8a08('0x30')]};});_0x5ae4a3[_0x8a08('0x31')]=_['map'](_0x1189d9,_0x8a08('0x29'));_0x5ae4a3[_0x8a08('0x32')]=_[_0x8a08('0x33')](_0x4813d8['query']);_0x5ae4a3[_0x8a08('0x34')]=_['intersection'](_0x5ae4a3['model'],_0x5ae4a3[_0x8a08('0x32')]);_0x3c6bf5['attributes']=_[_0x8a08('0x35')](_0x5ae4a3[_0x8a08('0x31')],qs[_0x8a08('0x36')](_0x4813d8[_0x8a08('0x32')][_0x8a08('0x36')]));_0x3c6bf5[_0x8a08('0x37')]=_0x3c6bf5[_0x8a08('0x37')][_0x8a08('0x38')]?_0x3c6bf5['attributes']:_0x5ae4a3[_0x8a08('0x31')];if(!_0x4813d8[_0x8a08('0x32')][_0x8a08('0x39')](_0x8a08('0x3a'))){_0x3c6bf5[_0x8a08('0x3b')]=qs[_0x8a08('0x3b')](_0x4813d8[_0x8a08('0x32')][_0x8a08('0x3b')]);_0x3c6bf5[_0x8a08('0x1b')]=qs[_0x8a08('0x1b')](_0x4813d8[_0x8a08('0x32')][_0x8a08('0x1b')]);}_0x3c6bf5[_0x8a08('0x3c')]=qs[_0x8a08('0x3d')](_0x4813d8['query']['sort']);_0x3c6bf5[_0x8a08('0x3e')]=qs[_0x8a08('0x34')](_['pick'](_0x4813d8[_0x8a08('0x32')],_0x5ae4a3[_0x8a08('0x34')]),_0x1189d9);if(_0x4813d8[_0x8a08('0x32')]['filter']){_0x3c6bf5[_0x8a08('0x3e')]=_[_0x8a08('0x3f')](_0x3c6bf5[_0x8a08('0x3e')],{'$or':_[_0x8a08('0x2c')](_0x1189d9,function(_0x3f7c27){if(_0x3f7c27['type']!==_0x8a08('0x40')){var _0x321e0d={};_0x321e0d[_0x3f7c27['name']]={'$like':'%'+_0x4813d8[_0x8a08('0x32')][_0x8a08('0x41')]+'%'};return _0x321e0d;}})});}_0x3c6bf5=_[_0x8a08('0x3f')]({},_0x3c6bf5,_0x4813d8[_0x8a08('0x42')]);var _0x15318c={'where':_0x3c6bf5['where']};return db[_0x8a08('0x2d')][_0x8a08('0x1d')](_0x15318c)[_0x8a08('0x25')](function(_0x1a1719){_0xb3e681[_0x8a08('0x1d')]=_0x1a1719;if(_0x4813d8[_0x8a08('0x32')]['includeAll']){_0x3c6bf5['include']=[{'all':!![]}];}return db[_0x8a08('0x2d')][_0x8a08('0x43')](_0x3c6bf5);})[_0x8a08('0x25')](function(_0x17dbf5){_0xb3e681[_0x8a08('0x44')]=_0x17dbf5;return _0xb3e681;})[_0x8a08('0x25')](respondWithFilteredResult(_0x5dccc2,_0x3c6bf5))[_0x8a08('0x45')](handleError(_0x5dccc2,null));};exports[_0x8a08('0x46')]=function(_0x4d97e0,_0x5ea64b){var _0x2dde5e={'raw':![],'where':{'id':_0x4d97e0[_0x8a08('0x47')]['id']}},_0x5ce5ea={};_0x5ce5ea[_0x8a08('0x31')]=_[_0x8a08('0x33')](db['SugarcrmConfiguration'][_0x8a08('0x2e')]);_0x5ce5ea['query']=_[_0x8a08('0x33')](_0x4d97e0['query']);_0x5ce5ea[_0x8a08('0x34')]=_[_0x8a08('0x35')](_0x5ce5ea['model'],_0x5ce5ea['query']);_0x2dde5e[_0x8a08('0x37')]=_['intersection'](_0x5ce5ea['model'],qs[_0x8a08('0x36')](_0x4d97e0[_0x8a08('0x32')][_0x8a08('0x36')]));_0x2dde5e[_0x8a08('0x37')]=_0x2dde5e['attributes'][_0x8a08('0x38')]?_0x2dde5e[_0x8a08('0x37')]:_0x5ce5ea['model'];if(_0x4d97e0[_0x8a08('0x32')][_0x8a08('0x48')]){_0x2dde5e[_0x8a08('0x49')]=[{'all':!![]}];}_0x2dde5e=_['merge']({},_0x2dde5e,_0x4d97e0[_0x8a08('0x42')]);return db[_0x8a08('0x2d')][_0x8a08('0x4a')](_0x2dde5e)[_0x8a08('0x25')](handleEntityNotFound(_0x5ea64b,null))[_0x8a08('0x25')](respondWithResult(_0x5ea64b,null))['catch'](handleError(_0x5ea64b,null));};exports[_0x8a08('0x4b')]=function(_0xc224d1,_0x3f4cf6){return db[_0x8a08('0x2d')][_0x8a08('0x4b')](_0xc224d1[_0x8a08('0x4c')],{})['then'](respondWithResult(_0x3f4cf6,0xc9))[_0x8a08('0x45')](handleError(_0x3f4cf6,null));};exports['update']=function(_0x498572,_0x344074){if(_0x498572[_0x8a08('0x4c')]['id']){delete _0x498572[_0x8a08('0x4c')]['id'];}return db[_0x8a08('0x2d')][_0x8a08('0x4a')]({'where':{'id':_0x498572[_0x8a08('0x47')]['id']}})[_0x8a08('0x25')](handleEntityNotFound(_0x344074,null))[_0x8a08('0x25')](saveUpdates(_0x498572[_0x8a08('0x4c')],null))[_0x8a08('0x25')](respondWithResult(_0x344074,null))['catch'](handleError(_0x344074,null));};exports[_0x8a08('0x26')]=function(_0x30da7c,_0x1f5f0c){return db['SugarcrmConfiguration'][_0x8a08('0x4a')]({'where':{'id':_0x30da7c['params']['id']}})[_0x8a08('0x25')](handleEntityNotFound(_0x1f5f0c,null))['then'](removeEntity(_0x1f5f0c,null))[_0x8a08('0x45')](handleError(_0x1f5f0c,null));};exports[_0x8a08('0x4d')]=function(_0xcf90ba,_0x3d89b8,_0x50df7c){var _0x14283e={};var _0x18f279={};var _0x537aab;var _0x5f17d3;return db[_0x8a08('0x2d')]['findOne']({'where':{'id':_0xcf90ba['params']['id']}})[_0x8a08('0x25')](handleEntityNotFound(_0x3d89b8,null))['then'](function(_0x32495f){if(_0x32495f){_0x537aab=_0x32495f;_0x18f279['model']=_[_0x8a08('0x33')](db['SugarcrmField']['rawAttributes']);_0x18f279[_0x8a08('0x32')]=_[_0x8a08('0x33')](_0xcf90ba['query']);_0x18f279[_0x8a08('0x34')]=_['intersection'](_0x18f279[_0x8a08('0x31')],_0x18f279[_0x8a08('0x32')]);_0x14283e[_0x8a08('0x37')]=_[_0x8a08('0x35')](_0x18f279[_0x8a08('0x31')],qs[_0x8a08('0x36')](_0xcf90ba[_0x8a08('0x32')][_0x8a08('0x36')]));_0x14283e[_0x8a08('0x37')]=_0x14283e['attributes'][_0x8a08('0x38')]?_0x14283e[_0x8a08('0x37')]:_0x18f279[_0x8a08('0x31')];_0x14283e['order']=qs[_0x8a08('0x3d')](_0xcf90ba[_0x8a08('0x32')]['sort']);_0x14283e['where']=qs[_0x8a08('0x34')](_['pick'](_0xcf90ba[_0x8a08('0x32')],_0x18f279[_0x8a08('0x34')]));if(_0xcf90ba['query'][_0x8a08('0x41')]){_0x14283e['where']=_['merge'](_0x14283e[_0x8a08('0x3e')],{'$or':_[_0x8a08('0x2c')](_0x14283e[_0x8a08('0x37')],function(_0x10de54){var _0x38cd78={};_0x38cd78[_0x10de54]={'$like':'%'+_0xcf90ba['query'][_0x8a08('0x41')]+'%'};return _0x38cd78;})});}_0x14283e=_['merge']({},_0x14283e,_0xcf90ba[_0x8a08('0x42')]);return _0x537aab[_0x8a08('0x4d')](_0x14283e);}})[_0x8a08('0x25')](function(_0x557dcd){if(_0x557dcd){_0x5f17d3=_0x557dcd[_0x8a08('0x38')];if(!_0xcf90ba['query'][_0x8a08('0x39')](_0x8a08('0x3a'))){_0x14283e['limit']=qs['limit'](_0xcf90ba[_0x8a08('0x32')]['limit']);_0x14283e[_0x8a08('0x1b')]=qs[_0x8a08('0x1b')](_0xcf90ba[_0x8a08('0x32')]['offset']);}return _0x537aab[_0x8a08('0x4d')](_0x14283e);}})['then'](function(_0x570dc5){if(_0x570dc5){return _0x570dc5?{'count':_0x5f17d3,'rows':_0x570dc5}:null;}})[_0x8a08('0x25')](respondWithResult(_0x3d89b8,null))['catch'](handleError(_0x3d89b8,null));};exports['getSubjects']=function(_0x18493f,_0x45d808,_0x1c3267){var _0x234b3a={};var _0x47b184={};var _0xc161c9;var _0x1616aa;return db[_0x8a08('0x2d')]['findOne']({'where':{'id':_0x18493f[_0x8a08('0x47')]['id']}})[_0x8a08('0x25')](handleEntityNotFound(_0x45d808,null))[_0x8a08('0x25')](function(_0x158b00){if(_0x158b00){_0xc161c9=_0x158b00;_0x47b184['model']=_['keys'](db[_0x8a08('0x4e')]['rawAttributes']);_0x47b184['query']=_[_0x8a08('0x33')](_0x18493f[_0x8a08('0x32')]);_0x47b184[_0x8a08('0x34')]=_[_0x8a08('0x35')](_0x47b184[_0x8a08('0x31')],_0x47b184[_0x8a08('0x32')]);_0x234b3a[_0x8a08('0x37')]=_['intersection'](_0x47b184[_0x8a08('0x31')],qs['fields'](_0x18493f[_0x8a08('0x32')][_0x8a08('0x36')]));_0x234b3a['attributes']=_0x234b3a['attributes'][_0x8a08('0x38')]?_0x234b3a[_0x8a08('0x37')]:_0x47b184[_0x8a08('0x31')];_0x234b3a[_0x8a08('0x3c')]=qs['sort'](_0x18493f[_0x8a08('0x32')]['sort']);_0x234b3a[_0x8a08('0x3e')]=qs[_0x8a08('0x34')](_[_0x8a08('0x4f')](_0x18493f['query'],_0x47b184[_0x8a08('0x34')]));if(_0x18493f[_0x8a08('0x32')]['filter']){_0x234b3a[_0x8a08('0x3e')]=_['merge'](_0x234b3a[_0x8a08('0x3e')],{'$or':_['map'](_0x234b3a['attributes'],function(_0xf8382){var _0x153df9={};_0x153df9[_0xf8382]={'$like':'%'+_0x18493f[_0x8a08('0x32')][_0x8a08('0x41')]+'%'};return _0x153df9;})});}_0x234b3a=_['merge']({},_0x234b3a,_0x18493f['options']);return _0xc161c9[_0x8a08('0x50')](_0x234b3a);}})[_0x8a08('0x25')](function(_0x44781b){if(_0x44781b){_0x1616aa=_0x44781b[_0x8a08('0x38')];if(!_0x18493f[_0x8a08('0x32')][_0x8a08('0x39')](_0x8a08('0x3a'))){_0x234b3a[_0x8a08('0x3b')]=qs['limit'](_0x18493f[_0x8a08('0x32')]['limit']);_0x234b3a[_0x8a08('0x1b')]=qs[_0x8a08('0x1b')](_0x18493f[_0x8a08('0x32')][_0x8a08('0x1b')]);}return _0xc161c9[_0x8a08('0x50')](_0x234b3a);}})[_0x8a08('0x25')](function(_0x4fe4b6){if(_0x4fe4b6){return _0x4fe4b6?{'count':_0x1616aa,'rows':_0x4fe4b6}:null;}})[_0x8a08('0x25')](respondWithResult(_0x45d808,null))[_0x8a08('0x45')](handleError(_0x45d808,null));};exports[_0x8a08('0x51')]=function(_0x2a7e18,_0xcfb2ed,_0xaa0f99){var _0x16b71f={};var _0x1e29e8={};var _0x47411c;var _0xa7fda2;return db[_0x8a08('0x2d')][_0x8a08('0x52')]({'where':{'id':_0x2a7e18[_0x8a08('0x47')]['id']}})[_0x8a08('0x25')](handleEntityNotFound(_0xcfb2ed,null))[_0x8a08('0x25')](function(_0x956c6c){if(_0x956c6c){_0x47411c=_0x956c6c;_0x1e29e8[_0x8a08('0x31')]=_[_0x8a08('0x33')](db[_0x8a08('0x4e')][_0x8a08('0x2e')]);_0x1e29e8[_0x8a08('0x32')]=_[_0x8a08('0x33')](_0x2a7e18[_0x8a08('0x32')]);_0x1e29e8['filters']=_['intersection'](_0x1e29e8[_0x8a08('0x31')],_0x1e29e8['query']);_0x16b71f['attributes']=_[_0x8a08('0x35')](_0x1e29e8[_0x8a08('0x31')],qs[_0x8a08('0x36')](_0x2a7e18[_0x8a08('0x32')][_0x8a08('0x36')]));_0x16b71f[_0x8a08('0x37')]=_0x16b71f[_0x8a08('0x37')][_0x8a08('0x38')]?_0x16b71f[_0x8a08('0x37')]:_0x1e29e8['model'];_0x16b71f[_0x8a08('0x3c')]=qs[_0x8a08('0x3d')](_0x2a7e18['query']['sort']);_0x16b71f[_0x8a08('0x3e')]=qs[_0x8a08('0x34')](_['pick'](_0x2a7e18[_0x8a08('0x32')],_0x1e29e8[_0x8a08('0x34')]));if(_0x2a7e18[_0x8a08('0x32')][_0x8a08('0x41')]){_0x16b71f[_0x8a08('0x3e')]=_[_0x8a08('0x3f')](_0x16b71f[_0x8a08('0x3e')],{'$or':_['map'](_0x16b71f[_0x8a08('0x37')],function(_0x3dc669){var _0x180671={};_0x180671[_0x3dc669]={'$like':'%'+_0x2a7e18[_0x8a08('0x32')]['filter']+'%'};return _0x180671;})});}_0x16b71f=_[_0x8a08('0x3f')]({},_0x16b71f,_0x2a7e18[_0x8a08('0x42')]);return _0x47411c[_0x8a08('0x51')](_0x16b71f);}})[_0x8a08('0x25')](function(_0x5d600a){if(_0x5d600a){_0xa7fda2=_0x5d600a['length'];if(!_0x2a7e18[_0x8a08('0x32')][_0x8a08('0x39')](_0x8a08('0x3a'))){_0x16b71f[_0x8a08('0x3b')]=qs[_0x8a08('0x3b')](_0x2a7e18[_0x8a08('0x32')][_0x8a08('0x3b')]);_0x16b71f[_0x8a08('0x1b')]=qs[_0x8a08('0x1b')](_0x2a7e18['query'][_0x8a08('0x1b')]);}return _0x47411c[_0x8a08('0x51')](_0x16b71f);}})[_0x8a08('0x25')](function(_0x480066){if(_0x480066){return _0x480066?{'count':_0xa7fda2,'rows':_0x480066}:null;}})[_0x8a08('0x25')](respondWithResult(_0xcfb2ed,null))[_0x8a08('0x45')](handleError(_0xcfb2ed,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 2a16c40..8399dfe 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 _0x0f14=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x3c0161,_0x4e69cf){var _0x475234=function(_0xaf19ab){while(--_0xaf19ab){_0x3c0161['push'](_0x3c0161['shift']());}};_0x475234(++_0x4e69cf);}(_0x0f14,0x7e));var _0x40f1=function(_0xa71fbe,_0x3e3ccf){_0xa71fbe=_0xa71fbe-0x0;var _0x5959f9=_0x0f14[_0xa71fbe];return _0x5959f9;};'use strict';var _=require(_0x40f1('0x0'));var util=require(_0x40f1('0x1'));var logger=require(_0x40f1('0x2'))('api');var moment=require(_0x40f1('0x3'));var BPromise=require(_0x40f1('0x4'));var rp=require(_0x40f1('0x5'));var fs=require('fs');var path=require(_0x40f1('0x6'));var rimraf=require(_0x40f1('0x7'));var config=require(_0x40f1('0x8'));var attributes=require(_0x40f1('0x9'));module[_0x40f1('0xa')]=function(_0x341563,_0x270130){return _0x341563[_0x40f1('0xb')](_0x40f1('0xc'),attributes,{'tableName':_0x40f1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ce6=['bluebird','request-promise','path','rimraf','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ce6,0x134));var _0x63ce=function(_0x404272,_0x2f9f8e){_0x404272=_0x404272-0x0;var _0x343f28=_0x3ce6[_0x404272];return _0x343f28;};'use strict';var _=require(_0x63ce('0x0'));var util=require(_0x63ce('0x1'));var logger=require('../../config/logger')(_0x63ce('0x2'));var moment=require(_0x63ce('0x3'));var BPromise=require(_0x63ce('0x4'));var rp=require(_0x63ce('0x5'));var fs=require('fs');var path=require(_0x63ce('0x6'));var rimraf=require(_0x63ce('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x63ce('0x8')]=function(_0x2c77a7,_0x2c1add){return _0x2c77a7[_0x63ce('0x9')](_0x63ce('0xa'),attributes,{'tableName':_0x63ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 3cbf1a9..eddf3c1 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 _0x9fd1=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1f1e7b,_0x2573fd){var _0x3a8bd4=function(_0x3a579c){while(--_0x3a579c){_0x1f1e7b['push'](_0x1f1e7b['shift']());}};_0x3a8bd4(++_0x2573fd);}(_0x9fd1,0x1e3));var _0x19fd=function(_0x1ca703,_0x40c27f){_0x1ca703=_0x1ca703-0x0;var _0x4a3d04=_0x9fd1[_0x1ca703];return _0x4a3d04;};'use strict';var _=require('lodash');var util=require(_0x19fd('0x0'));var moment=require('moment');var BPromise=require(_0x19fd('0x1'));var rs=require(_0x19fd('0x2'));var fs=require('fs');var Redis=require(_0x19fd('0x3'));var db=require(_0x19fd('0x4'))['db'];var utils=require(_0x19fd('0x5'));var logger=require(_0x19fd('0x6'))(_0x19fd('0x7'));var config=require(_0x19fd('0x8'));var jayson=require(_0x19fd('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37fd3e,_0x4bdfbc,_0x1c237a){return new BPromise(function(_0xe9b9dd,_0x3ca097){return client[_0x19fd('0xa')](_0x37fd3e,_0x1c237a)[_0x19fd('0xb')](function(_0x5a0871){logger[_0x19fd('0xc')](_0x19fd('0xd'),_0x4bdfbc,_0x19fd('0xe'));logger[_0x19fd('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4bdfbc,_0x19fd('0xe'),JSON['stringify'](_0x5a0871));if(_0x5a0871[_0x19fd('0x10')]){if(_0x5a0871[_0x19fd('0x10')]['code']===0x1f4){logger[_0x19fd('0x10')](_0x19fd('0xd'),_0x4bdfbc,_0x5a0871[_0x19fd('0x10')]['message']);return _0x3ca097(_0x5a0871[_0x19fd('0x10')][_0x19fd('0x11')]);}logger[_0x19fd('0x10')](_0x19fd('0xd'),_0x4bdfbc,_0x5a0871['error'][_0x19fd('0x11')]);return _0xe9b9dd(_0x5a0871[_0x19fd('0x10')]['message']);}else{logger[_0x19fd('0xc')](_0x19fd('0xd'),_0x4bdfbc,_0x19fd('0xe'));_0xe9b9dd(_0x5a0871[_0x19fd('0x12')][_0x19fd('0x11')]);}})[_0x19fd('0x13')](function(_0xce9386){logger[_0x19fd('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bdfbc,_0xce9386);_0x3ca097(_0xce9386);});});} \ No newline at end of file +var _0x491f=['debug','error','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0x491f,0x16a));var _0xf491=function(_0x39c545,_0x4a7b5c){_0x39c545=_0x39c545-0x0;var _0x2ceed9=_0x491f[_0x39c545];return _0x2ceed9;};'use strict';var _=require(_0xf491('0x0'));var util=require(_0xf491('0x1'));var moment=require(_0xf491('0x2'));var BPromise=require(_0xf491('0x3'));var rs=require(_0xf491('0x4'));var fs=require('fs');var Redis=require(_0xf491('0x5'));var db=require(_0xf491('0x6'))['db'];var utils=require(_0xf491('0x7'));var logger=require('../../config/logger')(_0xf491('0x8'));var config=require(_0xf491('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf491('0xa')][_0xf491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34c12a,_0x24a0a8,_0x5d581b){return new BPromise(function(_0x52af9b,_0x1dd002){return client[_0xf491('0xc')](_0x34c12a,_0x5d581b)[_0xf491('0xd')](function(_0x1211bc){logger[_0xf491('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24a0a8,_0xf491('0xf'));logger[_0xf491('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x24a0a8,'request\x20sent',JSON['stringify'](_0x1211bc));if(_0x1211bc[_0xf491('0x11')]){if(_0x1211bc[_0xf491('0x11')]['code']===0x1f4){logger[_0xf491('0x11')](_0xf491('0x12'),_0x24a0a8,_0x1211bc['error'][_0xf491('0x13')]);return _0x1dd002(_0x1211bc[_0xf491('0x11')]['message']);}logger[_0xf491('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24a0a8,_0x1211bc[_0xf491('0x11')]['message']);return _0x52af9b(_0x1211bc['error'][_0xf491('0x13')]);}else{logger[_0xf491('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x24a0a8,'request\x20sent');_0x52af9b(_0x1211bc['result'][_0xf491('0x13')]);}})[_0xf491('0x14')](function(_0x597739){logger[_0xf491('0x11')](_0xf491('0x12'),_0x24a0a8,_0x597739);_0x1dd002(_0x597739);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 644dfc3..5a96c9c 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 _0xd78c=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x582974,_0x4d34af){var _0x4c6ad6=function(_0x2dea81){while(--_0x2dea81){_0x582974['push'](_0x582974['shift']());}};_0x4c6ad6(++_0x4d34af);}(_0xd78c,0x67));var _0xcd78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd78c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcd78('0x0'));var path=require(_0xcd78('0x1'));var timeout=require('connect-timeout');var express=require(_0xcd78('0x2'));var router=express[_0xcd78('0x3')]();var fs_extra=require(_0xcd78('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd78('0x5'));var config=require(_0xcd78('0x6'));var controller=require(_0xcd78('0x7'));router[_0xcd78('0x8')]('/',auth['isAuthenticated'](),controller[_0xcd78('0x9')]);router[_0xcd78('0x8')](_0xcd78('0xa'),auth[_0xcd78('0xb')](),controller['show']);router[_0xcd78('0xc')]('/',auth['isAuthenticated'](),controller[_0xcd78('0xd')]);router[_0xcd78('0xe')](_0xcd78('0xa'),auth[_0xcd78('0xb')](),controller['update']);router[_0xcd78('0xf')](_0xcd78('0xa'),auth[_0xcd78('0xb')](),controller[_0xcd78('0x10')]);module[_0xcd78('0x11')]=router; \ No newline at end of file +var _0x23af=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x23af,0x1bc));var _0xf23a=function(_0x5c2137,_0x7e5913){_0x5c2137=_0x5c2137-0x0;var _0x40e360=_0x23af[_0x5c2137];return _0x40e360;};'use strict';var multer=require(_0xf23a('0x0'));var util=require('util');var path=require(_0xf23a('0x1'));var timeout=require(_0xf23a('0x2'));var express=require(_0xf23a('0x3'));var router=express[_0xf23a('0x4')]();var fs_extra=require(_0xf23a('0x5'));var auth=require(_0xf23a('0x6'));var interaction=require(_0xf23a('0x7'));var config=require(_0xf23a('0x8'));var controller=require(_0xf23a('0x9'));router['get']('/',auth[_0xf23a('0xa')](),controller[_0xf23a('0xb')]);router[_0xf23a('0xc')](_0xf23a('0xd'),auth['isAuthenticated'](),controller[_0xf23a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf23a('0xf')]);router[_0xf23a('0x10')](_0xf23a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf23a('0x11')](_0xf23a('0xd'),auth['isAuthenticated'](),controller[_0xf23a('0x12')]);module[_0xf23a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 774e13e..6ba7b97 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 _0x93fe=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x5c3f8c,_0x5b315b){var _0x22c996=function(_0x335fdc){while(--_0x335fdc){_0x5c3f8c['push'](_0x5c3f8c['shift']());}};_0x22c996(++_0x5b315b);}(_0x93fe,0x155));var _0xe93f=function(_0x77572a,_0x2a9288){_0x77572a=_0x77572a-0x0;var _0x5ea763=_0x93fe[_0x77572a];return _0x5ea763;};'use strict';var Sequelize=require(_0xe93f('0x0'));module[_0xe93f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe93f('0x2'),_0xe93f('0x3'),'customVariable',_0xe93f('0x4'),_0xe93f('0x5')),'defaultValue':_0xe93f('0x2')},'content':{'type':Sequelize[_0xe93f('0x6')]},'key':{'type':Sequelize[_0xe93f('0x6')]},'keyType':{'type':Sequelize[_0xe93f('0x7')](_0xe93f('0x2'),_0xe93f('0x3'),_0xe93f('0x8'))},'keyContent':{'type':Sequelize[_0xe93f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe93f('0x6')]},'customField':{'type':Sequelize[_0xe93f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe93f('0x6')]}}; \ No newline at end of file +var _0xd772=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd772,0x9c));var _0x2d77=function(_0x18c57c,_0x2bda62){_0x18c57c=_0x18c57c-0x0;var _0x53a102=_0xd772[_0x18c57c];return _0x53a102;};'use strict';var Sequelize=require('sequelize');module[_0x2d77('0x0')]={'type':{'type':Sequelize[_0x2d77('0x1')](_0x2d77('0x2'),'variable',_0x2d77('0x3'),_0x2d77('0x4'),_0x2d77('0x5')),'defaultValue':_0x2d77('0x2')},'content':{'type':Sequelize[_0x2d77('0x6')]},'key':{'type':Sequelize[_0x2d77('0x6')]},'keyType':{'type':Sequelize[_0x2d77('0x1')]('string',_0x2d77('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x2d77('0x6')]},'idField':{'type':Sequelize[_0x2d77('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2d77('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d77('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 48629b3..7925e7f 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 _0xe66e=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','map','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','create','body','find','params','rimraf'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe66e,0x133));var _0xee66=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xe66e[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee66('0x0'));var zipdir=require(_0xee66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee66('0x2'));var moment=require(_0xee66('0x3'));var BPromise=require(_0xee66('0x4'));var Mustache=require(_0xee66('0x5'));var util=require(_0xee66('0x6'));var path=require(_0xee66('0x7'));var sox=require(_0xee66('0x8'));var csv=require(_0xee66('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee66('0xa'));var _=require(_0xee66('0xb'));var squel=require(_0xee66('0xc'));var crypto=require('crypto');var jsforce=require(_0xee66('0xd'));var deskjs=require(_0xee66('0xe'));var toCsv=require('to-csv');var querystring=require(_0xee66('0xf'));var Papa=require('papaparse');var Redis=require(_0xee66('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xee66('0x11'));var as=require(_0xee66('0x12'));var hardwareService=require(_0xee66('0x13'));var logger=require(_0xee66('0x14'))(_0xee66('0x15'));var utils=require(_0xee66('0x16'));var config=require(_0xee66('0x17'));var licenseUtil=require(_0xee66('0x18'));var db=require(_0xee66('0x19'))['db'];function respondWithStatusCode(_0x36ed00,_0x57eb09){_0x57eb09=_0x57eb09||0xcc;return function(_0x20f518){if(_0x20f518){return _0x36ed00[_0xee66('0x1a')](_0x57eb09);}return _0x36ed00[_0xee66('0x1b')](_0x57eb09)[_0xee66('0x1c')]();};}function respondWithResult(_0x1ffd00,_0x3cee19){_0x3cee19=_0x3cee19||0xc8;return function(_0x16a6bc){if(_0x16a6bc){return _0x1ffd00[_0xee66('0x1b')](_0x3cee19)[_0xee66('0x1d')](_0x16a6bc);}};}function respondWithFilteredResult(_0x292f2a,_0x35ca81){return function(_0x18e4fb){if(_0x18e4fb){var _0x565671=typeof _0x35ca81['offset']==='undefined'&&typeof _0x35ca81[_0xee66('0x1e')]===_0xee66('0x1f');var _0x4bf66a=_0x18e4fb['count'];var _0x37bae9=_0x565671?0x0:_0x35ca81[_0xee66('0x20')];var _0x73ef81=_0x565671?_0x18e4fb[_0xee66('0x21')]:_0x35ca81['offset']+_0x35ca81[_0xee66('0x1e')];var _0xea075a;if(_0x73ef81>=_0x4bf66a){_0x73ef81=_0x4bf66a;_0xea075a=0xc8;}else{_0xea075a=0xce;}_0x292f2a[_0xee66('0x1b')](_0xea075a);return _0x292f2a['set'](_0xee66('0x22'),_0x37bae9+'-'+_0x73ef81+'/'+_0x4bf66a)[_0xee66('0x1d')](_0x18e4fb);}return null;};}function patchUpdates(_0x3f8e80){return function(_0x47ee0d){try{jsonpatch[_0xee66('0x23')](_0x47ee0d,_0x3f8e80,!![]);}catch(_0x3d2fbf){return BPromise[_0xee66('0x24')](_0x3d2fbf);}return _0x47ee0d['save']();};}function saveUpdates(_0x102952,_0x484e48){return function(_0x4ba9b3){if(_0x4ba9b3){return _0x4ba9b3['update'](_0x102952)[_0xee66('0x25')](function(_0x52f734){return _0x52f734;});}return null;};}function removeEntity(_0x2ca792,_0x8af0d5){return function(_0x53927a){if(_0x53927a){return _0x53927a[_0xee66('0x26')]()[_0xee66('0x25')](function(){_0x2ca792['status'](0xcc)[_0xee66('0x1c')]();});}};}function handleEntityNotFound(_0x32a565,_0x1e603c){return function(_0x33b613){if(!_0x33b613){_0x32a565[_0xee66('0x1a')](0x194);}return _0x33b613;};}function handleError(_0x542e77,_0x15b4d0){_0x15b4d0=_0x15b4d0||0x1f4;return function(_0x2d36eb){logger[_0xee66('0x27')](_0x2d36eb[_0xee66('0x28')]);if(_0x2d36eb['name']){delete _0x2d36eb[_0xee66('0x29')];}_0x542e77[_0xee66('0x1b')](_0x15b4d0)[_0xee66('0x2a')](_0x2d36eb);};}exports[_0xee66('0x2b')]=function(_0x2f9c78,_0x1dfdfb){var _0x27225c={},_0x2f5b27={},_0x5aa65f={'count':0x0,'rows':[]};var _0x22c536=_['map'](db[_0xee66('0x2c')][_0xee66('0x2d')],function(_0x201201){return{'name':_0x201201[_0xee66('0x2e')],'type':_0x201201[_0xee66('0x2f')][_0xee66('0x30')]};});_0x2f5b27['model']=_[_0xee66('0x31')](_0x22c536,'name');_0x2f5b27['query']=_['keys'](_0x2f9c78['query']);_0x2f5b27['filters']=_[_0xee66('0x32')](_0x2f5b27[_0xee66('0x33')],_0x2f5b27[_0xee66('0x34')]);_0x27225c[_0xee66('0x35')]=_[_0xee66('0x32')](_0x2f5b27['model'],qs[_0xee66('0x36')](_0x2f9c78[_0xee66('0x34')][_0xee66('0x36')]));_0x27225c[_0xee66('0x35')]=_0x27225c[_0xee66('0x35')][_0xee66('0x37')]?_0x27225c[_0xee66('0x35')]:_0x2f5b27[_0xee66('0x33')];if(!_0x2f9c78[_0xee66('0x34')][_0xee66('0x38')](_0xee66('0x39'))){_0x27225c[_0xee66('0x1e')]=qs[_0xee66('0x1e')](_0x2f9c78['query'][_0xee66('0x1e')]);_0x27225c[_0xee66('0x20')]=qs['offset'](_0x2f9c78[_0xee66('0x34')][_0xee66('0x20')]);}_0x27225c[_0xee66('0x3a')]=qs[_0xee66('0x3b')](_0x2f9c78[_0xee66('0x34')][_0xee66('0x3b')]);_0x27225c['where']=qs[_0xee66('0x3c')](_[_0xee66('0x3d')](_0x2f9c78[_0xee66('0x34')],_0x2f5b27[_0xee66('0x3c')]),_0x22c536);if(_0x2f9c78[_0xee66('0x34')][_0xee66('0x3e')]){_0x27225c[_0xee66('0x3f')]=_['merge'](_0x27225c[_0xee66('0x3f')],{'$or':_[_0xee66('0x31')](_0x22c536,function(_0x279f3f){if(_0x279f3f[_0xee66('0x2f')]!==_0xee66('0x40')){var _0x477f5a={};_0x477f5a[_0x279f3f['name']]={'$like':'%'+_0x2f9c78[_0xee66('0x34')][_0xee66('0x3e')]+'%'};return _0x477f5a;}})});}_0x27225c=_[_0xee66('0x41')]({},_0x27225c,_0x2f9c78[_0xee66('0x42')]);var _0x45a7a9={'where':_0x27225c[_0xee66('0x3f')]};return db['SugarcrmField'][_0xee66('0x21')](_0x45a7a9)['then'](function(_0x1dc590){_0x5aa65f[_0xee66('0x21')]=_0x1dc590;if(_0x2f9c78['query'][_0xee66('0x43')]){_0x27225c[_0xee66('0x44')]=[{'all':!![]}];}return db['SugarcrmField'][_0xee66('0x45')](_0x27225c);})[_0xee66('0x25')](function(_0x24d13c){_0x5aa65f['rows']=_0x24d13c;return _0x5aa65f;})[_0xee66('0x25')](respondWithFilteredResult(_0x1dfdfb,_0x27225c))[_0xee66('0x46')](handleError(_0x1dfdfb,null));};exports[_0xee66('0x47')]=function(_0xaa7c6a,_0x1d01a1){var _0x47234b={'raw':!![],'where':{'id':_0xaa7c6a['params']['id']}},_0x40672d={};_0x40672d['model']=_[_0xee66('0x48')](db['SugarcrmField'][_0xee66('0x2d')]);_0x40672d[_0xee66('0x34')]=_[_0xee66('0x48')](_0xaa7c6a['query']);_0x40672d['filters']=_[_0xee66('0x32')](_0x40672d[_0xee66('0x33')],_0x40672d[_0xee66('0x34')]);_0x47234b[_0xee66('0x35')]=_[_0xee66('0x32')](_0x40672d['model'],qs[_0xee66('0x36')](_0xaa7c6a[_0xee66('0x34')]['fields']));_0x47234b[_0xee66('0x35')]=_0x47234b[_0xee66('0x35')][_0xee66('0x37')]?_0x47234b[_0xee66('0x35')]:_0x40672d['model'];if(_0xaa7c6a[_0xee66('0x34')][_0xee66('0x43')]){_0x47234b['include']=[{'all':!![]}];}_0x47234b=_[_0xee66('0x41')]({},_0x47234b,_0xaa7c6a['options']);return db[_0xee66('0x2c')]['find'](_0x47234b)[_0xee66('0x25')](handleEntityNotFound(_0x1d01a1,null))['then'](respondWithResult(_0x1d01a1,null))[_0xee66('0x46')](handleError(_0x1d01a1,null));};exports[_0xee66('0x49')]=function(_0x4b0b52,_0x2e68b7){return db[_0xee66('0x2c')][_0xee66('0x49')](_0x4b0b52[_0xee66('0x4a')],{})['then'](respondWithResult(_0x2e68b7,0xc9))[_0xee66('0x46')](handleError(_0x2e68b7,null));};exports['update']=function(_0x59dcb8,_0x4d9284){if(_0x59dcb8[_0xee66('0x4a')]['id']){delete _0x59dcb8[_0xee66('0x4a')]['id'];}return db[_0xee66('0x2c')][_0xee66('0x4b')]({'where':{'id':_0x59dcb8[_0xee66('0x4c')]['id']}})[_0xee66('0x25')](handleEntityNotFound(_0x4d9284,null))[_0xee66('0x25')](saveUpdates(_0x59dcb8[_0xee66('0x4a')],null))[_0xee66('0x25')](respondWithResult(_0x4d9284,null))['catch'](handleError(_0x4d9284,null));};exports[_0xee66('0x26')]=function(_0x452958,_0x2ce69a){return db['SugarcrmField'][_0xee66('0x4b')]({'where':{'id':_0x452958['params']['id']}})[_0xee66('0x25')](handleEntityNotFound(_0x2ce69a,null))['then'](removeEntity(_0x2ce69a,null))[_0xee66('0x46')](handleError(_0x2ce69a,null));}; \ No newline at end of file +var _0x1466=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','SugarcrmField','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','map','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','then','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x455ed0,_0x1513b4){var _0x312e14=function(_0xaa3f86){while(--_0xaa3f86){_0x455ed0['push'](_0x455ed0['shift']());}};_0x312e14(++_0x1513b4);}(_0x1466,0x1ad));var _0x6146=function(_0x35a87a,_0x41c95e){_0x35a87a=_0x35a87a-0x0;var _0x4ee09c=_0x1466[_0x35a87a];return _0x4ee09c;};'use strict';var emlformat=require(_0x6146('0x0'));var rimraf=require(_0x6146('0x1'));var zipdir=require(_0x6146('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6146('0x3'));var moment=require(_0x6146('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6146('0x5'));var util=require(_0x6146('0x6'));var path=require(_0x6146('0x7'));var sox=require(_0x6146('0x8'));var csv=require(_0x6146('0x9'));var ejs=require(_0x6146('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6146('0xb'));var squel=require('squel');var crypto=require(_0x6146('0xc'));var jsforce=require(_0x6146('0xd'));var deskjs=require(_0x6146('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6146('0xf'));var Papa=require(_0x6146('0x10'));var Redis=require(_0x6146('0x11'));var authService=require(_0x6146('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6146('0x13'));var hardwareService=require(_0x6146('0x14'));var logger=require(_0x6146('0x15'))(_0x6146('0x16'));var utils=require(_0x6146('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6146('0x18'));var db=require(_0x6146('0x19'))['db'];function respondWithStatusCode(_0x5d1ff5,_0x18c4a0){_0x18c4a0=_0x18c4a0||0xcc;return function(_0x129906){if(_0x129906){return _0x5d1ff5[_0x6146('0x1a')](_0x18c4a0);}return _0x5d1ff5[_0x6146('0x1b')](_0x18c4a0)[_0x6146('0x1c')]();};}function respondWithResult(_0x38e54c,_0x191740){_0x191740=_0x191740||0xc8;return function(_0x333d33){if(_0x333d33){return _0x38e54c[_0x6146('0x1b')](_0x191740)[_0x6146('0x1d')](_0x333d33);}};}function respondWithFilteredResult(_0x65a606,_0x12303f){return function(_0x1896e6){if(_0x1896e6){var _0x5290bf=typeof _0x12303f[_0x6146('0x1e')]===_0x6146('0x1f')&&typeof _0x12303f[_0x6146('0x20')]===_0x6146('0x1f');var _0x34a179=_0x1896e6['count'];var _0xfa311d=_0x5290bf?0x0:_0x12303f[_0x6146('0x1e')];var _0x5cc1f9=_0x5290bf?_0x1896e6[_0x6146('0x21')]:_0x12303f['offset']+_0x12303f[_0x6146('0x20')];var _0x4a1f16;if(_0x5cc1f9>=_0x34a179){_0x5cc1f9=_0x34a179;_0x4a1f16=0xc8;}else{_0x4a1f16=0xce;}_0x65a606['status'](_0x4a1f16);return _0x65a606[_0x6146('0x22')](_0x6146('0x23'),_0xfa311d+'-'+_0x5cc1f9+'/'+_0x34a179)[_0x6146('0x1d')](_0x1896e6);}return null;};}function patchUpdates(_0x3953ce){return function(_0x301e9c){try{jsonpatch[_0x6146('0x24')](_0x301e9c,_0x3953ce,!![]);}catch(_0x88bad8){return BPromise[_0x6146('0x25')](_0x88bad8);}return _0x301e9c['save']();};}function saveUpdates(_0x4d47f6,_0x4de986){return function(_0x182360){if(_0x182360){return _0x182360[_0x6146('0x26')](_0x4d47f6)['then'](function(_0xd1e5d9){return _0xd1e5d9;});}return null;};}function removeEntity(_0x39d522,_0x53933d){return function(_0x2b61d9){if(_0x2b61d9){return _0x2b61d9[_0x6146('0x27')]()['then'](function(){_0x39d522['status'](0xcc)[_0x6146('0x1c')]();});}};}function handleEntityNotFound(_0x58473a,_0x354d0e){return function(_0x1486b1){if(!_0x1486b1){_0x58473a['sendStatus'](0x194);}return _0x1486b1;};}function handleError(_0x98e4f4,_0x57a657){_0x57a657=_0x57a657||0x1f4;return function(_0x1b1781){logger['error'](_0x1b1781[_0x6146('0x28')]);if(_0x1b1781[_0x6146('0x29')]){delete _0x1b1781[_0x6146('0x29')];}_0x98e4f4[_0x6146('0x1b')](_0x57a657)[_0x6146('0x2a')](_0x1b1781);};}exports[_0x6146('0x2b')]=function(_0xb35071,_0x13bc1c){var _0x4c7f1b={},_0x332150={},_0x35a309={'count':0x0,'rows':[]};var _0x1c762e=_['map'](db[_0x6146('0x2c')][_0x6146('0x2d')],function(_0x7e5ae3){return{'name':_0x7e5ae3['fieldName'],'type':_0x7e5ae3[_0x6146('0x2e')]['key']};});_0x332150[_0x6146('0x2f')]=_['map'](_0x1c762e,_0x6146('0x29'));_0x332150[_0x6146('0x30')]=_[_0x6146('0x31')](_0xb35071[_0x6146('0x30')]);_0x332150[_0x6146('0x32')]=_[_0x6146('0x33')](_0x332150[_0x6146('0x2f')],_0x332150[_0x6146('0x30')]);_0x4c7f1b['attributes']=_[_0x6146('0x33')](_0x332150['model'],qs[_0x6146('0x34')](_0xb35071[_0x6146('0x30')]['fields']));_0x4c7f1b[_0x6146('0x35')]=_0x4c7f1b[_0x6146('0x35')]['length']?_0x4c7f1b[_0x6146('0x35')]:_0x332150['model'];if(!_0xb35071[_0x6146('0x30')][_0x6146('0x36')](_0x6146('0x37'))){_0x4c7f1b['limit']=qs[_0x6146('0x20')](_0xb35071[_0x6146('0x30')]['limit']);_0x4c7f1b['offset']=qs[_0x6146('0x1e')](_0xb35071['query']['offset']);}_0x4c7f1b['order']=qs[_0x6146('0x38')](_0xb35071[_0x6146('0x30')][_0x6146('0x38')]);_0x4c7f1b[_0x6146('0x39')]=qs['filters'](_['pick'](_0xb35071[_0x6146('0x30')],_0x332150[_0x6146('0x32')]),_0x1c762e);if(_0xb35071[_0x6146('0x30')]['filter']){_0x4c7f1b[_0x6146('0x39')]=_['merge'](_0x4c7f1b[_0x6146('0x39')],{'$or':_[_0x6146('0x3a')](_0x1c762e,function(_0x18ef0c){if(_0x18ef0c['type']!=='VIRTUAL'){var _0x100977={};_0x100977[_0x18ef0c[_0x6146('0x29')]]={'$like':'%'+_0xb35071[_0x6146('0x30')][_0x6146('0x3b')]+'%'};return _0x100977;}})});}_0x4c7f1b=_['merge']({},_0x4c7f1b,_0xb35071[_0x6146('0x3c')]);var _0x1ef0b3={'where':_0x4c7f1b[_0x6146('0x39')]};return db['SugarcrmField']['count'](_0x1ef0b3)['then'](function(_0x56ea83){_0x35a309[_0x6146('0x21')]=_0x56ea83;if(_0xb35071[_0x6146('0x30')][_0x6146('0x3d')]){_0x4c7f1b[_0x6146('0x3e')]=[{'all':!![]}];}return db[_0x6146('0x2c')][_0x6146('0x3f')](_0x4c7f1b);})['then'](function(_0x29e583){_0x35a309[_0x6146('0x40')]=_0x29e583;return _0x35a309;})['then'](respondWithFilteredResult(_0x13bc1c,_0x4c7f1b))[_0x6146('0x41')](handleError(_0x13bc1c,null));};exports[_0x6146('0x42')]=function(_0x5d6f0d,_0x1f8cb4){var _0x29364f={'raw':!![],'where':{'id':_0x5d6f0d[_0x6146('0x43')]['id']}},_0x151e49={};_0x151e49[_0x6146('0x2f')]=_[_0x6146('0x31')](db[_0x6146('0x2c')][_0x6146('0x2d')]);_0x151e49[_0x6146('0x30')]=_['keys'](_0x5d6f0d[_0x6146('0x30')]);_0x151e49[_0x6146('0x32')]=_[_0x6146('0x33')](_0x151e49[_0x6146('0x2f')],_0x151e49[_0x6146('0x30')]);_0x29364f[_0x6146('0x35')]=_[_0x6146('0x33')](_0x151e49['model'],qs[_0x6146('0x34')](_0x5d6f0d[_0x6146('0x30')]['fields']));_0x29364f[_0x6146('0x35')]=_0x29364f[_0x6146('0x35')]['length']?_0x29364f[_0x6146('0x35')]:_0x151e49['model'];if(_0x5d6f0d['query'][_0x6146('0x3d')]){_0x29364f[_0x6146('0x3e')]=[{'all':!![]}];}_0x29364f=_[_0x6146('0x44')]({},_0x29364f,_0x5d6f0d[_0x6146('0x3c')]);return db[_0x6146('0x2c')][_0x6146('0x45')](_0x29364f)['then'](handleEntityNotFound(_0x1f8cb4,null))[_0x6146('0x46')](respondWithResult(_0x1f8cb4,null))[_0x6146('0x41')](handleError(_0x1f8cb4,null));};exports[_0x6146('0x47')]=function(_0x2dd55f,_0x49d5ca){return db[_0x6146('0x2c')][_0x6146('0x47')](_0x2dd55f[_0x6146('0x48')],{})[_0x6146('0x46')](respondWithResult(_0x49d5ca,0xc9))[_0x6146('0x41')](handleError(_0x49d5ca,null));};exports[_0x6146('0x26')]=function(_0x323bad,_0x5aa4e0){if(_0x323bad[_0x6146('0x48')]['id']){delete _0x323bad[_0x6146('0x48')]['id'];}return db[_0x6146('0x2c')][_0x6146('0x45')]({'where':{'id':_0x323bad[_0x6146('0x43')]['id']}})['then'](handleEntityNotFound(_0x5aa4e0,null))[_0x6146('0x46')](saveUpdates(_0x323bad[_0x6146('0x48')],null))[_0x6146('0x46')](respondWithResult(_0x5aa4e0,null))[_0x6146('0x41')](handleError(_0x5aa4e0,null));};exports['destroy']=function(_0x18668b,_0x1ecd06){return db[_0x6146('0x2c')]['find']({'where':{'id':_0x18668b[_0x6146('0x43')]['id']}})[_0x6146('0x46')](handleEntityNotFound(_0x1ecd06,null))[_0x6146('0x46')](removeEntity(_0x1ecd06,null))[_0x6146('0x41')](handleError(_0x1ecd06,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 6038735..6f8d31d 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 _0xd5e7=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger'];(function(_0x3f3b61,_0x9cd5c4){var _0x510861=function(_0xd968c3){while(--_0xd968c3){_0x3f3b61['push'](_0x3f3b61['shift']());}};_0x510861(++_0x9cd5c4);}(_0xd5e7,0x148));var _0x7d5e=function(_0x2d3dbe,_0x26c848){_0x2d3dbe=_0x2d3dbe-0x0;var _0x570804=_0xd5e7[_0x2d3dbe];return _0x570804;};'use strict';var _=require('lodash');var util=require(_0x7d5e('0x0'));var logger=require(_0x7d5e('0x1'))(_0x7d5e('0x2'));var moment=require(_0x7d5e('0x3'));var BPromise=require(_0x7d5e('0x4'));var rp=require(_0x7d5e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d5e('0x6'));var config=require(_0x7d5e('0x7'));var attributes=require(_0x7d5e('0x8'));module[_0x7d5e('0x9')]=function(_0x128709,_0x60a1e5){return _0x128709[_0x7d5e('0xa')](_0x7d5e('0xb'),attributes,{'tableName':_0x7d5e('0xc'),'paranoid':![],'indexes':[{'name':_0x7d5e('0xd'),'fields':[_0x7d5e('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa18e=['define','SugarcrmField','int_sugarcrm_fields','FieldId','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intSugarcrmField.attributes'];(function(_0x15f7f8,_0x5136c9){var _0x40efef=function(_0x441d66){while(--_0x441d66){_0x15f7f8['push'](_0x15f7f8['shift']());}};_0x40efef(++_0x5136c9);}(_0xa18e,0x1f0));var _0xea18=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa18e[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0xea18('0x0'));var util=require(_0xea18('0x1'));var logger=require(_0xea18('0x2'))(_0xea18('0x3'));var moment=require('moment');var BPromise=require(_0xea18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea18('0x5'));var rimraf=require('rimraf');var config=require(_0xea18('0x6'));var attributes=require(_0xea18('0x7'));module['exports']=function(_0xf922e2,_0x4c6568){return _0xf922e2[_0xea18('0x8')](_0xea18('0x9'),attributes,{'tableName':_0xea18('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xea18('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index b579b09..722f885 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 _0x08d8=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','info'];(function(_0x3a6194,_0x4574e2){var _0x298116=function(_0x27297c){while(--_0x27297c){_0x3a6194['push'](_0x3a6194['shift']());}};_0x298116(++_0x4574e2);}(_0x08d8,0x195));var _0x808d=function(_0x4eb269,_0x3cd1b6){_0x4eb269=_0x4eb269-0x0;var _0x1597b8=_0x08d8[_0x4eb269];return _0x1597b8;};'use strict';var _=require(_0x808d('0x0'));var util=require('util');var moment=require(_0x808d('0x1'));var BPromise=require(_0x808d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x808d('0x3'))['db'];var utils=require(_0x808d('0x4'));var logger=require(_0x808d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x808d('0x6'));var client=jayson[_0x808d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39faef,_0x527caf,_0x37fc73){return new BPromise(function(_0x38d3a5,_0x4c0519){return client['request'](_0x39faef,_0x37fc73)['then'](function(_0x543a91){logger[_0x808d('0x8')](_0x808d('0x9'),_0x527caf,_0x808d('0xa'));logger[_0x808d('0xb')](_0x808d('0xc'),_0x527caf,_0x808d('0xa'),JSON[_0x808d('0xd')](_0x543a91));if(_0x543a91[_0x808d('0xe')]){if(_0x543a91['error'][_0x808d('0xf')]===0x1f4){logger[_0x808d('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x527caf,_0x543a91[_0x808d('0xe')][_0x808d('0x10')]);return _0x4c0519(_0x543a91[_0x808d('0xe')][_0x808d('0x10')]);}logger[_0x808d('0xe')](_0x808d('0x9'),_0x527caf,_0x543a91['error']['message']);return _0x38d3a5(_0x543a91[_0x808d('0xe')][_0x808d('0x10')]);}else{logger[_0x808d('0x8')]('SugarcrmField,\x20%s,\x20%s',_0x527caf,_0x808d('0xa'));_0x38d3a5(_0x543a91[_0x808d('0x11')]['message']);}})['catch'](function(_0x3834cd){logger[_0x808d('0xe')](_0x808d('0x9'),_0x527caf,_0x3834cd);_0x4c0519(_0x3834cd);});});} \ No newline at end of file +var _0x5988=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x250539,_0x274f76){var _0x318551=function(_0x208e5f){while(--_0x208e5f){_0x250539['push'](_0x250539['shift']());}};_0x318551(++_0x274f76);}(_0x5988,0x166));var _0x8598=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x5988[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x8598('0x0'));var util=require(_0x8598('0x1'));var moment=require(_0x8598('0x2'));var BPromise=require('bluebird');var rs=require(_0x8598('0x3'));var fs=require('fs');var Redis=require(_0x8598('0x4'));var db=require(_0x8598('0x5'))['db'];var utils=require(_0x8598('0x6'));var logger=require('../../config/logger')(_0x8598('0x7'));var config=require('../../config/environment');var jayson=require(_0x8598('0x8'));var client=jayson['client'][_0x8598('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1df51c,_0x39085b,_0x51fec5){return new BPromise(function(_0x3e59c2,_0x4b2c87){return client[_0x8598('0xa')](_0x1df51c,_0x51fec5)[_0x8598('0xb')](function(_0x53f663){logger[_0x8598('0xc')](_0x8598('0xd'),_0x39085b,'request\x20sent');logger['debug'](_0x8598('0xe'),_0x39085b,_0x8598('0xf'),JSON['stringify'](_0x53f663));if(_0x53f663['error']){if(_0x53f663[_0x8598('0x10')][_0x8598('0x11')]===0x1f4){logger['error'](_0x8598('0xd'),_0x39085b,_0x53f663['error'][_0x8598('0x12')]);return _0x4b2c87(_0x53f663[_0x8598('0x10')][_0x8598('0x12')]);}logger[_0x8598('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x39085b,_0x53f663[_0x8598('0x10')]['message']);return _0x3e59c2(_0x53f663['error']['message']);}else{logger[_0x8598('0xc')](_0x8598('0xd'),_0x39085b,_0x8598('0xf'));_0x3e59c2(_0x53f663[_0x8598('0x13')][_0x8598('0x12')]);}})[_0x8598('0x14')](function(_0x34576a){logger[_0x8598('0x10')](_0x8598('0xd'),_0x39085b,_0x34576a);_0x4b2c87(_0x34576a);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 7d12547..575e3fe 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 _0x6732=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x5a6744,_0x144876){var _0xff7177=function(_0x4b3e10){while(--_0x4b3e10){_0x5a6744['push'](_0x5a6744['shift']());}};_0xff7177(++_0x144876);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var path=require(_0x2673('0x2'));var timeout=require(_0x2673('0x3'));var express=require('express');var router=express[_0x2673('0x4')]();var fs_extra=require(_0x2673('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2673('0x6'));var config=require(_0x2673('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x2673('0x8')](),controller[_0x2673('0x9')]);router[_0x2673('0xa')](_0x2673('0xb'),auth[_0x2673('0x8')](),controller[_0x2673('0xc')]);router[_0x2673('0xa')](_0x2673('0xd'),auth[_0x2673('0x8')](),controller[_0x2673('0xe')]);router[_0x2673('0xa')](_0x2673('0xf'),auth[_0x2673('0x8')](),controller[_0x2673('0x10')]);router[_0x2673('0x11')]('/',auth[_0x2673('0x8')](),controller[_0x2673('0x12')]);router[_0x2673('0x11')](_0x2673('0xd'),auth['isAuthenticated'](),controller[_0x2673('0x13')]);router['put'](_0x2673('0xb'),auth[_0x2673('0x8')](),controller[_0x2673('0x14')]);router[_0x2673('0x15')](_0x2673('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2673('0x16')]=router; \ No newline at end of file +var _0xd33b=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd33b,0x1af));var _0xbd33=function(_0x905122,_0x5e9e15){_0x905122=_0x905122-0x0;var _0x23f3f9=_0xd33b[_0x905122];return _0x23f3f9;};'use strict';var multer=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var path=require('path');var timeout=require(_0xbd33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd33('0x3'));var interaction=require(_0xbd33('0x4'));var config=require('../../config/environment');var controller=require(_0xbd33('0x5'));router[_0xbd33('0x6')]('/',auth[_0xbd33('0x7')](),controller[_0xbd33('0x8')]);router['get'](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0xa')]);router[_0xbd33('0x6')](_0xbd33('0xb'),auth[_0xbd33('0x7')](),controller[_0xbd33('0xc')]);router[_0xbd33('0x6')](_0xbd33('0xd'),auth['isAuthenticated'](),controller[_0xbd33('0xe')]);router[_0xbd33('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd33('0x10')]);router[_0xbd33('0xf')](_0xbd33('0xb'),auth['isAuthenticated'](),controller[_0xbd33('0x11')]);router[_0xbd33('0x12')](_0xbd33('0x9'),auth[_0xbd33('0x7')](),controller[_0xbd33('0x13')]);router[_0xbd33('0x14')](_0xbd33('0x9'),auth['isAuthenticated'](),controller[_0xbd33('0x15')]);module[_0xbd33('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 5077caa..e3d1e43 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 _0x59ee=['HelpDesk','sequelize','exports','STRING'];(function(_0x3253f3,_0x1c57d8){var _0x598c26=function(_0x4c1251){while(--_0x4c1251){_0x3253f3['push'](_0x3253f3['shift']());}};_0x598c26(++_0x1c57d8);}(_0x59ee,0xe9));var _0xe59e=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0x59ee[_0x568ec8];return _0x52b2be;};'use strict';var Sequelize=require(_0xe59e('0x0'));module[_0xe59e('0x1')]={'name':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe59e('0x2')]},'username':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![],'defaultValue':_0xe59e('0x3')},'remoteUri':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe59e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4351=['sequelize','STRING'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x4351,0xdc));var _0x1435=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4351[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x1435('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1435('0x1')]},'username':{'type':Sequelize[_0x1435('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1435('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1435('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 60bb1e1..4432d55 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 _0xae2e=['picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','key','model','keys','filters','intersection','attributes','query','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','VtigerAccount','findAll','show','params','length','catch','create','body','getConfigurations','VtigerConfiguration','filter','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','%s/webservice.php','success','POST','token','describe','result','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','startsWith','cf_'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xae2e,0x16b));var _0xeae2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xae2e[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xeae2('0x0'));var rimraf=require(_0xeae2('0x1'));var zipdir=require(_0xeae2('0x2'));var jsonpatch=require(_0xeae2('0x3'));var rp=require(_0xeae2('0x4'));var moment=require(_0xeae2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeae2('0x6'));var util=require(_0xeae2('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeae2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeae2('0x9'));var squel=require(_0xeae2('0xa'));var crypto=require(_0xeae2('0xb'));var jsforce=require(_0xeae2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeae2('0xd'));var querystring=require('querystring');var Papa=require(_0xeae2('0xe'));var Redis=require(_0xeae2('0xf'));var authService=require(_0xeae2('0x10'));var qs=require(_0xeae2('0x11'));var as=require(_0xeae2('0x12'));var hardwareService=require(_0xeae2('0x13'));var logger=require(_0xeae2('0x14'))(_0xeae2('0x15'));var utils=require(_0xeae2('0x16'));var config=require(_0xeae2('0x17'));var licenseUtil=require(_0xeae2('0x18'));var db=require(_0xeae2('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3379ab,_0x4413f){_0x4413f=_0x4413f||0xcc;return function(_0x20c35e){if(_0x20c35e){return _0x3379ab[_0xeae2('0x1a')](_0x4413f);}return _0x3379ab[_0xeae2('0x1b')](_0x4413f)[_0xeae2('0x1c')]();};}function respondWithResult(_0x1f3197,_0x2b6706){_0x2b6706=_0x2b6706||0xc8;return function(_0x18a177){if(_0x18a177){return _0x1f3197[_0xeae2('0x1b')](_0x2b6706)[_0xeae2('0x1d')](_0x18a177);}};}function respondWithFilteredResult(_0x3fd38f,_0x2fcfcd){return function(_0x128924){if(_0x128924){var _0x526be0=typeof _0x2fcfcd[_0xeae2('0x1e')]===_0xeae2('0x1f')&&typeof _0x2fcfcd[_0xeae2('0x20')]===_0xeae2('0x1f');var _0x3071f0=_0x128924[_0xeae2('0x21')];var _0x54d1a4=_0x526be0?0x0:_0x2fcfcd[_0xeae2('0x1e')];var _0x28bb18=_0x526be0?_0x128924[_0xeae2('0x21')]:_0x2fcfcd[_0xeae2('0x1e')]+_0x2fcfcd['limit'];var _0x5e249f;if(_0x28bb18>=_0x3071f0){_0x28bb18=_0x3071f0;_0x5e249f=0xc8;}else{_0x5e249f=0xce;}_0x3fd38f[_0xeae2('0x1b')](_0x5e249f);return _0x3fd38f[_0xeae2('0x22')](_0xeae2('0x23'),_0x54d1a4+'-'+_0x28bb18+'/'+_0x3071f0)['json'](_0x128924);}return null;};}function patchUpdates(_0x493869){return function(_0x4a68f6){try{jsonpatch[_0xeae2('0x24')](_0x4a68f6,_0x493869,!![]);}catch(_0x51d39e){return BPromise[_0xeae2('0x25')](_0x51d39e);}return _0x4a68f6[_0xeae2('0x26')]();};}function saveUpdates(_0x37c880,_0x504bfd){return function(_0x3baa4d){if(_0x3baa4d){return _0x3baa4d[_0xeae2('0x27')](_0x37c880)[_0xeae2('0x28')](function(_0x3e0092){return _0x3e0092;});}return null;};}function removeEntity(_0x48e8b7,_0x4ce19b){return function(_0x35f579){if(_0x35f579){return _0x35f579[_0xeae2('0x29')]()[_0xeae2('0x28')](function(){_0x48e8b7[_0xeae2('0x1b')](0xcc)[_0xeae2('0x1c')]();});}};}function handleEntityNotFound(_0x16c4b1,_0x35b2ee){return function(_0xe8caa0){if(!_0xe8caa0){_0x16c4b1[_0xeae2('0x1a')](0x194);}return _0xe8caa0;};}function handleError(_0x474c07,_0x47fb73){_0x47fb73=_0x47fb73||0x1f4;return function(_0x2158c1){logger[_0xeae2('0x2a')](_0x2158c1[_0xeae2('0x2b')]);if(_0x2158c1['name']){delete _0x2158c1[_0xeae2('0x2c')];}_0x474c07[_0xeae2('0x1b')](_0x47fb73)[_0xeae2('0x2d')](_0x2158c1);};}exports['index']=function(_0x1d5ec6,_0x13a07a){var _0x12603b={},_0x529020={},_0x311980={'count':0x0,'rows':[]};var _0xb7fdf4=_[_0xeae2('0x2e')](db['VtigerAccount'][_0xeae2('0x2f')],function(_0x486f6c){return{'name':_0x486f6c['fieldName'],'type':_0x486f6c['type'][_0xeae2('0x30')]};});_0x529020[_0xeae2('0x31')]=_[_0xeae2('0x2e')](_0xb7fdf4,_0xeae2('0x2c'));_0x529020['query']=_[_0xeae2('0x32')](_0x1d5ec6['query']);_0x529020[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x529020[_0xeae2('0x31')],_0x529020['query']);_0x12603b[_0xeae2('0x35')]=_[_0xeae2('0x34')](_0x529020[_0xeae2('0x31')],qs['fields'](_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x37')]));_0x12603b[_0xeae2('0x35')]=_0x12603b[_0xeae2('0x35')]['length']?_0x12603b[_0xeae2('0x35')]:_0x529020['model'];if(!_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x38')](_0xeae2('0x39'))){_0x12603b[_0xeae2('0x20')]=qs[_0xeae2('0x20')](_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x20')]);_0x12603b[_0xeae2('0x1e')]=qs[_0xeae2('0x1e')](_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x1e')]);}_0x12603b['order']=qs['sort'](_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x3a')]);_0x12603b[_0xeae2('0x3b')]=qs[_0xeae2('0x33')](_[_0xeae2('0x3c')](_0x1d5ec6[_0xeae2('0x36')],_0x529020[_0xeae2('0x33')]),_0xb7fdf4);if(_0x1d5ec6[_0xeae2('0x36')]['filter']){_0x12603b[_0xeae2('0x3b')]=_['merge'](_0x12603b[_0xeae2('0x3b')],{'$or':_['map'](_0xb7fdf4,function(_0x51b7ea){if(_0x51b7ea[_0xeae2('0x3d')]!==_0xeae2('0x3e')){var _0x3b446c={};_0x3b446c[_0x51b7ea[_0xeae2('0x2c')]]={'$like':'%'+_0x1d5ec6[_0xeae2('0x36')]['filter']+'%'};return _0x3b446c;}})});}_0x12603b=_[_0xeae2('0x3f')]({},_0x12603b,_0x1d5ec6[_0xeae2('0x40')]);var _0x30ced4={'where':_0x12603b[_0xeae2('0x3b')]};return db['VtigerAccount'][_0xeae2('0x21')](_0x30ced4)[_0xeae2('0x28')](function(_0x5bf5d){_0x311980['count']=_0x5bf5d;if(_0x1d5ec6[_0xeae2('0x36')][_0xeae2('0x41')]){_0x12603b[_0xeae2('0x42')]=[{'all':!![]}];}return db[_0xeae2('0x43')][_0xeae2('0x44')](_0x12603b);})['then'](function(_0x453aba){_0x311980['rows']=_0x453aba;return _0x311980;})[_0xeae2('0x28')](respondWithFilteredResult(_0x13a07a,_0x12603b))['catch'](handleError(_0x13a07a,null));};exports[_0xeae2('0x45')]=function(_0x5256ed,_0x58dc61){var _0x506119={'raw':![],'where':{'id':_0x5256ed[_0xeae2('0x46')]['id']}},_0x1ca868={};_0x1ca868[_0xeae2('0x31')]=_[_0xeae2('0x32')](db[_0xeae2('0x43')]['rawAttributes']);_0x1ca868[_0xeae2('0x36')]=_[_0xeae2('0x32')](_0x5256ed['query']);_0x1ca868['filters']=_[_0xeae2('0x34')](_0x1ca868[_0xeae2('0x31')],_0x1ca868['query']);_0x506119[_0xeae2('0x35')]=_['intersection'](_0x1ca868[_0xeae2('0x31')],qs[_0xeae2('0x37')](_0x5256ed[_0xeae2('0x36')][_0xeae2('0x37')]));_0x506119[_0xeae2('0x35')]=_0x506119[_0xeae2('0x35')][_0xeae2('0x47')]?_0x506119['attributes']:_0x1ca868[_0xeae2('0x31')];if(_0x5256ed[_0xeae2('0x36')][_0xeae2('0x41')]){_0x506119['include']=[{'all':!![]}];}_0x506119=_[_0xeae2('0x3f')]({},_0x506119,_0x5256ed[_0xeae2('0x40')]);return db[_0xeae2('0x43')]['find'](_0x506119)[_0xeae2('0x28')](handleEntityNotFound(_0x58dc61,null))[_0xeae2('0x28')](respondWithResult(_0x58dc61,null))[_0xeae2('0x48')](handleError(_0x58dc61,null));};exports[_0xeae2('0x49')]=function(_0x2375d9,_0x4da414){return db[_0xeae2('0x43')][_0xeae2('0x49')](_0x2375d9[_0xeae2('0x4a')],{})['then'](respondWithResult(_0x4da414,0xc9))['catch'](handleError(_0x4da414,null));};exports['update']=function(_0x5c2e49,_0xdec882){if(_0x5c2e49[_0xeae2('0x4a')]['id']){delete _0x5c2e49[_0xeae2('0x4a')]['id'];}return db[_0xeae2('0x43')]['find']({'where':{'id':_0x5c2e49[_0xeae2('0x46')]['id']}})['then'](handleEntityNotFound(_0xdec882,null))[_0xeae2('0x28')](saveUpdates(_0x5c2e49[_0xeae2('0x4a')],null))[_0xeae2('0x28')](respondWithResult(_0xdec882,null))[_0xeae2('0x48')](handleError(_0xdec882,null));};exports['destroy']=function(_0x6d83a,_0x2638ca){return db[_0xeae2('0x43')]['find']({'where':{'id':_0x6d83a[_0xeae2('0x46')]['id']}})['then'](handleEntityNotFound(_0x2638ca,null))[_0xeae2('0x28')](removeEntity(_0x2638ca,null))[_0xeae2('0x48')](handleError(_0x2638ca,null));};exports[_0xeae2('0x4b')]=function(_0x13b1e2,_0xba942c,_0x104115){var _0xc3a72a={};var _0x2326f2={};var _0x2a470d;var _0x102f57;return db[_0xeae2('0x43')]['findOne']({'where':{'id':_0x13b1e2[_0xeae2('0x46')]['id']}})[_0xeae2('0x28')](handleEntityNotFound(_0xba942c,null))['then'](function(_0x3f7c35){if(_0x3f7c35){_0x2a470d=_0x3f7c35;_0x2326f2[_0xeae2('0x31')]=_[_0xeae2('0x32')](db[_0xeae2('0x4c')][_0xeae2('0x2f')]);_0x2326f2[_0xeae2('0x36')]=_[_0xeae2('0x32')](_0x13b1e2[_0xeae2('0x36')]);_0x2326f2[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x2326f2['model'],_0x2326f2[_0xeae2('0x36')]);_0xc3a72a[_0xeae2('0x35')]=_[_0xeae2('0x34')](_0x2326f2[_0xeae2('0x31')],qs[_0xeae2('0x37')](_0x13b1e2['query'][_0xeae2('0x37')]));_0xc3a72a[_0xeae2('0x35')]=_0xc3a72a[_0xeae2('0x35')][_0xeae2('0x47')]?_0xc3a72a[_0xeae2('0x35')]:_0x2326f2[_0xeae2('0x31')];_0xc3a72a['order']=qs[_0xeae2('0x3a')](_0x13b1e2[_0xeae2('0x36')][_0xeae2('0x3a')]);_0xc3a72a['where']=qs[_0xeae2('0x33')](_[_0xeae2('0x3c')](_0x13b1e2['query'],_0x2326f2[_0xeae2('0x33')]));if(_0x13b1e2[_0xeae2('0x36')][_0xeae2('0x4d')]){_0xc3a72a[_0xeae2('0x3b')]=_[_0xeae2('0x3f')](_0xc3a72a[_0xeae2('0x3b')],{'$or':_[_0xeae2('0x2e')](_0xc3a72a['attributes'],function(_0x7245e9){var _0x187ba2={};_0x187ba2[_0x7245e9]={'$like':'%'+_0x13b1e2[_0xeae2('0x36')][_0xeae2('0x4d')]+'%'};return _0x187ba2;})});}_0xc3a72a=_[_0xeae2('0x3f')]({},_0xc3a72a,_0x13b1e2[_0xeae2('0x40')]);return _0x2a470d[_0xeae2('0x4b')](_0xc3a72a);}})['then'](function(_0x373b20){if(_0x373b20){_0x102f57=_0x373b20[_0xeae2('0x47')];if(!_0x13b1e2[_0xeae2('0x36')][_0xeae2('0x38')](_0xeae2('0x39'))){_0xc3a72a[_0xeae2('0x20')]=qs[_0xeae2('0x20')](_0x13b1e2[_0xeae2('0x36')][_0xeae2('0x20')]);_0xc3a72a[_0xeae2('0x1e')]=qs[_0xeae2('0x1e')](_0x13b1e2[_0xeae2('0x36')]['offset']);}return _0x2a470d[_0xeae2('0x4b')](_0xc3a72a);}})[_0xeae2('0x28')](function(_0xd1e88e){if(_0xd1e88e){return _0xd1e88e?{'count':_0x102f57,'rows':_0xd1e88e}:null;}})[_0xeae2('0x28')](respondWithResult(_0xba942c,null))[_0xeae2('0x48')](handleError(_0xba942c,null));};exports[_0xeae2('0x4e')]=function(_0x39cb23,_0x1884dd,_0x2999ef){if(_0x39cb23[_0xeae2('0x4a')]['id']){delete _0x39cb23[_0xeae2('0x4a')]['id'];}return db['VtigerAccount'][_0xeae2('0x4f')]({'where':{'id':_0x39cb23[_0xeae2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1884dd,null))[_0xeae2('0x28')](function(_0x5f1224){if(_0x5f1224){_0x39cb23[_0xeae2('0x4a')][_0xeae2('0x50')]=_0x5f1224['id'];_0x39cb23['body']['Subjects']=integrations[_0xeae2('0x51')](_0x39cb23[_0xeae2('0x4a')]['channel'],_0x39cb23[_0xeae2('0x4a')]['type']);_0x39cb23[_0xeae2('0x4a')][_0xeae2('0x52')]=integrations[_0xeae2('0x53')](_0x39cb23['body'][_0xeae2('0x54')],_0x39cb23['body'][_0xeae2('0x3d')]);return db[_0xeae2('0x4c')]['create'](_0x39cb23[_0xeae2('0x4a')],{'include':[{'model':db[_0xeae2('0x55')],'as':'Subjects'},{'model':db[_0xeae2('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1884dd,null))[_0xeae2('0x48')](handleError(_0x1884dd,null));};var md5=require(_0xeae2('0x56'));exports[_0xeae2('0x57')]=function(_0x118728,_0x28ddd1,_0x412e63){var _0x57b942=null;var _0x126fdc=null;var _0x225170=null;var _0x2dcb63=null;var _0x13f796='';return db[_0xeae2('0x43')]['findOne']({'where':{'id':_0x118728['params']['id']},'attributes':['id',_0xeae2('0x2c'),_0xeae2('0x58'),_0xeae2('0x59'),_0xeae2('0x5a'),_0xeae2('0x5b'),_0xeae2('0x5c'),_0xeae2('0x5d')]})[_0xeae2('0x28')](handleEntityNotFound(_0x28ddd1,null))[_0xeae2('0x28')](function(_0x292aa6){if(_0x292aa6){_0x57b942=_0x292aa6[_0xeae2('0x58')];_0x126fdc=_0x292aa6[_0xeae2('0x5d')];_0x225170=_0x292aa6[_0xeae2('0x5a')];_0x13f796=_0x292aa6[_0xeae2('0x5b')];var _0x558115=_0x13f796[_0xeae2('0x5e')](-0x1);if(_0x558115==='/'){_0x13f796=_0x13f796[_0xeae2('0x5f')](0x0,_0x13f796['lastIndexOf'](_0x558115));}_0x2dcb63=util['format'](_0xeae2('0x60'),_0x13f796);var _0x4bf839={'method':'GET','uri':_0x2dcb63,'qs':{'operation':'getchallenge','username':_0x292aa6[_0xeae2('0x58')]},'json':!![]};return rp(_0x4bf839);}})[_0xeae2('0x28')](function(_0x114f21){if(_0x114f21[_0xeae2('0x61')]){var _0x59e05d={'method':_0xeae2('0x62'),'uri':_0x2dcb63,'form':{'operation':'login','username':_0x57b942,'accessKey':md5(_0x114f21['result'][_0xeae2('0x63')]+_0x126fdc)},'json':!![]};return rp(_0x59e05d);}})['then'](function(_0x4f97fd){if(_0x4f97fd[_0xeae2('0x61')]){var _0x480e65={'method':'GET','uri':_0x2dcb63,'qs':{'operation':_0xeae2('0x64'),'username':_0x57b942,'sessionName':_0x4f97fd[_0xeae2('0x65')][_0xeae2('0x66')],'elementType':_0x225170},'json':!![]};return rp(_0x480e65);}})[_0xeae2('0x28')](function(_0x4ab9d1){if(_0x4ab9d1[_0xeae2('0x61')]){var _0x297518=[_0xeae2('0x67'),_0xeae2('0x68'),_0xeae2('0x69')];_['remove'](_0x4ab9d1[_0xeae2('0x65')]['fields'],function(_0x2bb841){return _0x297518[_0xeae2('0x6a')](_0x2bb841['type']['name']);});_[_0xeae2('0x6b')](_0x4ab9d1['result'][_0xeae2('0x37')],function(_0x3ebd1d){return _0x3ebd1d[_0xeae2('0x6c')]===_0xeae2('0x6d');});return{'count':_0x4ab9d1['result']['fields']['length'],'rows':_[_0xeae2('0x2e')](_0x4ab9d1[_0xeae2('0x65')][_0xeae2('0x37')],function(_0x391f76){return{'id':_0x391f76[_0xeae2('0x2c')],'name':_0x391f76[_0xeae2('0x6e')],'custom':_[_0xeae2('0x6f')](_0x391f76[_0xeae2('0x2c')],_0xeae2('0x70'))?!![]:![],'options':_0x391f76[_0xeae2('0x3d')][_0xeae2('0x2c')]==='picklist'&&_0x391f76[_0xeae2('0x3d')][_0xeae2('0x71')][_0xeae2('0x47')]>0x0?_['map'](_0x391f76['type'][_0xeae2('0x71')],function(_0x164ec0){return{'name':_0x164ec0[_0xeae2('0x6e')],'value':_0x164ec0[_0xeae2('0x72')]};}):[]};})};}})[_0xeae2('0x28')](respondWithResult(_0x28ddd1,null))[_0xeae2('0x48')](function(_0x19e93c){console[_0xeae2('0x73')](_0xeae2('0x74')+_0x19e93c);var _0x411542=_0x118728['query'][_0xeae2('0x75')]?0x1f4:_0x19e93c['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xeae2('0x57'),_0x411542,JSON['stringify'](_0x19e93c));delete _0x19e93c[_0xeae2('0x2c')];if(_0x411542===0x191){_0x411542=0x190;}_0x28ddd1[_0xeae2('0x1b')](_0x411542)[_0xeae2('0x2d')](_0x118728[_0xeae2('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x19e93c[_0xeae2('0x76')]}:_0x19e93c);});}; \ No newline at end of file +var _0xb5ca=['VtigerConfiguration','sort','AccountId','getSubjects','channel','Descriptions','Subjects','md5','getFields','username','description','moduleName','accessKey','slice','format','GET','getchallenge','success','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','false','label','startsWith','cf_','picklistValues','value','log','statusCode','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','params','length','include','options','find','create','body','getConfigurations','findOne'];(function(_0x47fab5,_0x1a77b1){var _0x366362=function(_0x55044f){while(--_0x55044f){_0x47fab5['push'](_0x47fab5['shift']());}};_0x366362(++_0x1a77b1);}(_0xb5ca,0x10a));var _0xab5c=function(_0x296286,_0x18a9ee){_0x296286=_0x296286-0x0;var _0x117f8f=_0xb5ca[_0x296286];return _0x117f8f;};'use strict';var emlformat=require(_0xab5c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab5c('0x1'));var rp=require(_0xab5c('0x2'));var moment=require('moment');var BPromise=require(_0xab5c('0x3'));var Mustache=require(_0xab5c('0x4'));var util=require(_0xab5c('0x5'));var path=require(_0xab5c('0x6'));var sox=require(_0xab5c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab5c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xab5c('0x9'));var jsforce=require(_0xab5c('0xa'));var deskjs=require(_0xab5c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xab5c('0xc'));var Papa=require('papaparse');var Redis=require(_0xab5c('0xd'));var authService=require(_0xab5c('0xe'));var qs=require(_0xab5c('0xf'));var as=require(_0xab5c('0x10'));var hardwareService=require(_0xab5c('0x11'));var logger=require(_0xab5c('0x12'))(_0xab5c('0x13'));var utils=require(_0xab5c('0x14'));var config=require(_0xab5c('0x15'));var licenseUtil=require(_0xab5c('0x16'));var db=require(_0xab5c('0x17'))['db'];var integrations=require(_0xab5c('0x18'));function respondWithStatusCode(_0x2dd6c0,_0xa0e2a1){_0xa0e2a1=_0xa0e2a1||0xcc;return function(_0x2dc0d5){if(_0x2dc0d5){return _0x2dd6c0[_0xab5c('0x19')](_0xa0e2a1);}return _0x2dd6c0['status'](_0xa0e2a1)[_0xab5c('0x1a')]();};}function respondWithResult(_0x34fbc0,_0x5e78b){_0x5e78b=_0x5e78b||0xc8;return function(_0x48973c){if(_0x48973c){return _0x34fbc0['status'](_0x5e78b)[_0xab5c('0x1b')](_0x48973c);}};}function respondWithFilteredResult(_0x1702aa,_0x304365){return function(_0x3b278c){if(_0x3b278c){var _0x2f34ab=typeof _0x304365[_0xab5c('0x1c')]===_0xab5c('0x1d')&&typeof _0x304365[_0xab5c('0x1e')]===_0xab5c('0x1d');var _0x518539=_0x3b278c[_0xab5c('0x1f')];var _0x5dd092=_0x2f34ab?0x0:_0x304365[_0xab5c('0x1c')];var _0x3e3702=_0x2f34ab?_0x3b278c[_0xab5c('0x1f')]:_0x304365[_0xab5c('0x1c')]+_0x304365[_0xab5c('0x1e')];var _0x19cd7e;if(_0x3e3702>=_0x518539){_0x3e3702=_0x518539;_0x19cd7e=0xc8;}else{_0x19cd7e=0xce;}_0x1702aa[_0xab5c('0x20')](_0x19cd7e);return _0x1702aa['set']('Content-Range',_0x5dd092+'-'+_0x3e3702+'/'+_0x518539)[_0xab5c('0x1b')](_0x3b278c);}return null;};}function patchUpdates(_0x4a246d){return function(_0x1dfbc1){try{jsonpatch['apply'](_0x1dfbc1,_0x4a246d,!![]);}catch(_0x41ee6f){return BPromise[_0xab5c('0x21')](_0x41ee6f);}return _0x1dfbc1[_0xab5c('0x22')]();};}function saveUpdates(_0x13efaa,_0x2183b4){return function(_0x41393d){if(_0x41393d){return _0x41393d[_0xab5c('0x23')](_0x13efaa)[_0xab5c('0x24')](function(_0x881160){return _0x881160;});}return null;};}function removeEntity(_0x8cad63,_0x5d021b){return function(_0x572824){if(_0x572824){return _0x572824[_0xab5c('0x25')]()[_0xab5c('0x24')](function(){_0x8cad63[_0xab5c('0x20')](0xcc)[_0xab5c('0x1a')]();});}};}function handleEntityNotFound(_0x2d9a13,_0x57451a){return function(_0x41f135){if(!_0x41f135){_0x2d9a13['sendStatus'](0x194);}return _0x41f135;};}function handleError(_0x255fe0,_0x4d09e1){_0x4d09e1=_0x4d09e1||0x1f4;return function(_0x239613){logger[_0xab5c('0x26')](_0x239613[_0xab5c('0x27')]);if(_0x239613[_0xab5c('0x28')]){delete _0x239613[_0xab5c('0x28')];}_0x255fe0['status'](_0x4d09e1)[_0xab5c('0x29')](_0x239613);};}exports[_0xab5c('0x2a')]=function(_0x4f19d0,_0x25bbc7){var _0x23c354={},_0x3b5a6a={},_0x438690={'count':0x0,'rows':[]};var _0x55e16b=_[_0xab5c('0x2b')](db[_0xab5c('0x2c')][_0xab5c('0x2d')],function(_0x496844){return{'name':_0x496844[_0xab5c('0x2e')],'type':_0x496844[_0xab5c('0x2f')][_0xab5c('0x30')]};});_0x3b5a6a['model']=_[_0xab5c('0x2b')](_0x55e16b,_0xab5c('0x28'));_0x3b5a6a['query']=_[_0xab5c('0x31')](_0x4f19d0['query']);_0x3b5a6a[_0xab5c('0x32')]=_[_0xab5c('0x33')](_0x3b5a6a[_0xab5c('0x34')],_0x3b5a6a[_0xab5c('0x35')]);_0x23c354[_0xab5c('0x36')]=_[_0xab5c('0x33')](_0x3b5a6a['model'],qs['fields'](_0x4f19d0['query'][_0xab5c('0x37')]));_0x23c354[_0xab5c('0x36')]=_0x23c354['attributes']['length']?_0x23c354[_0xab5c('0x36')]:_0x3b5a6a['model'];if(!_0x4f19d0[_0xab5c('0x35')][_0xab5c('0x38')](_0xab5c('0x39'))){_0x23c354['limit']=qs[_0xab5c('0x1e')](_0x4f19d0[_0xab5c('0x35')]['limit']);_0x23c354[_0xab5c('0x1c')]=qs['offset'](_0x4f19d0['query']['offset']);}_0x23c354[_0xab5c('0x3a')]=qs['sort'](_0x4f19d0[_0xab5c('0x35')]['sort']);_0x23c354[_0xab5c('0x3b')]=qs[_0xab5c('0x32')](_[_0xab5c('0x3c')](_0x4f19d0['query'],_0x3b5a6a[_0xab5c('0x32')]),_0x55e16b);if(_0x4f19d0[_0xab5c('0x35')][_0xab5c('0x3d')]){_0x23c354['where']=_[_0xab5c('0x3e')](_0x23c354[_0xab5c('0x3b')],{'$or':_[_0xab5c('0x2b')](_0x55e16b,function(_0x27c159){if(_0x27c159[_0xab5c('0x2f')]!==_0xab5c('0x3f')){var _0x3b96cd={};_0x3b96cd[_0x27c159[_0xab5c('0x28')]]={'$like':'%'+_0x4f19d0[_0xab5c('0x35')][_0xab5c('0x3d')]+'%'};return _0x3b96cd;}})});}_0x23c354=_['merge']({},_0x23c354,_0x4f19d0['options']);var _0x5190a2={'where':_0x23c354[_0xab5c('0x3b')]};return db['VtigerAccount'][_0xab5c('0x1f')](_0x5190a2)[_0xab5c('0x24')](function(_0x41fa90){_0x438690[_0xab5c('0x1f')]=_0x41fa90;if(_0x4f19d0[_0xab5c('0x35')][_0xab5c('0x40')]){_0x23c354['include']=[{'all':!![]}];}return db[_0xab5c('0x2c')][_0xab5c('0x41')](_0x23c354);})['then'](function(_0x52cb4f){_0x438690['rows']=_0x52cb4f;return _0x438690;})[_0xab5c('0x24')](respondWithFilteredResult(_0x25bbc7,_0x23c354))[_0xab5c('0x42')](handleError(_0x25bbc7,null));};exports['show']=function(_0x3078aa,_0x26924f){var _0x272ba5={'raw':![],'where':{'id':_0x3078aa[_0xab5c('0x43')]['id']}},_0x4a99d7={};_0x4a99d7[_0xab5c('0x34')]=_[_0xab5c('0x31')](db[_0xab5c('0x2c')][_0xab5c('0x2d')]);_0x4a99d7[_0xab5c('0x35')]=_[_0xab5c('0x31')](_0x3078aa[_0xab5c('0x35')]);_0x4a99d7[_0xab5c('0x32')]=_[_0xab5c('0x33')](_0x4a99d7[_0xab5c('0x34')],_0x4a99d7[_0xab5c('0x35')]);_0x272ba5[_0xab5c('0x36')]=_[_0xab5c('0x33')](_0x4a99d7[_0xab5c('0x34')],qs[_0xab5c('0x37')](_0x3078aa[_0xab5c('0x35')][_0xab5c('0x37')]));_0x272ba5[_0xab5c('0x36')]=_0x272ba5[_0xab5c('0x36')][_0xab5c('0x44')]?_0x272ba5['attributes']:_0x4a99d7[_0xab5c('0x34')];if(_0x3078aa[_0xab5c('0x35')]['includeAll']){_0x272ba5[_0xab5c('0x45')]=[{'all':!![]}];}_0x272ba5=_[_0xab5c('0x3e')]({},_0x272ba5,_0x3078aa[_0xab5c('0x46')]);return db[_0xab5c('0x2c')][_0xab5c('0x47')](_0x272ba5)[_0xab5c('0x24')](handleEntityNotFound(_0x26924f,null))[_0xab5c('0x24')](respondWithResult(_0x26924f,null))['catch'](handleError(_0x26924f,null));};exports[_0xab5c('0x48')]=function(_0x595331,_0x56774b){return db[_0xab5c('0x2c')][_0xab5c('0x48')](_0x595331['body'],{})[_0xab5c('0x24')](respondWithResult(_0x56774b,0xc9))[_0xab5c('0x42')](handleError(_0x56774b,null));};exports[_0xab5c('0x23')]=function(_0x730b97,_0x3791a0){if(_0x730b97[_0xab5c('0x49')]['id']){delete _0x730b97[_0xab5c('0x49')]['id'];}return db[_0xab5c('0x2c')][_0xab5c('0x47')]({'where':{'id':_0x730b97['params']['id']}})[_0xab5c('0x24')](handleEntityNotFound(_0x3791a0,null))[_0xab5c('0x24')](saveUpdates(_0x730b97[_0xab5c('0x49')],null))[_0xab5c('0x24')](respondWithResult(_0x3791a0,null))[_0xab5c('0x42')](handleError(_0x3791a0,null));};exports[_0xab5c('0x25')]=function(_0x264f10,_0x4121b5){return db[_0xab5c('0x2c')][_0xab5c('0x47')]({'where':{'id':_0x264f10['params']['id']}})[_0xab5c('0x24')](handleEntityNotFound(_0x4121b5,null))[_0xab5c('0x24')](removeEntity(_0x4121b5,null))[_0xab5c('0x42')](handleError(_0x4121b5,null));};exports[_0xab5c('0x4a')]=function(_0x774c13,_0x11a1d9,_0x20d38d){var _0x56ca27={};var _0x58cc33={};var _0x4bfa2f;var _0x545a7c;return db[_0xab5c('0x2c')][_0xab5c('0x4b')]({'where':{'id':_0x774c13[_0xab5c('0x43')]['id']}})['then'](handleEntityNotFound(_0x11a1d9,null))[_0xab5c('0x24')](function(_0x12f751){if(_0x12f751){_0x4bfa2f=_0x12f751;_0x58cc33[_0xab5c('0x34')]=_[_0xab5c('0x31')](db[_0xab5c('0x4c')][_0xab5c('0x2d')]);_0x58cc33['query']=_['keys'](_0x774c13[_0xab5c('0x35')]);_0x58cc33[_0xab5c('0x32')]=_['intersection'](_0x58cc33[_0xab5c('0x34')],_0x58cc33['query']);_0x56ca27[_0xab5c('0x36')]=_[_0xab5c('0x33')](_0x58cc33[_0xab5c('0x34')],qs[_0xab5c('0x37')](_0x774c13[_0xab5c('0x35')][_0xab5c('0x37')]));_0x56ca27[_0xab5c('0x36')]=_0x56ca27[_0xab5c('0x36')][_0xab5c('0x44')]?_0x56ca27[_0xab5c('0x36')]:_0x58cc33[_0xab5c('0x34')];_0x56ca27[_0xab5c('0x3a')]=qs[_0xab5c('0x4d')](_0x774c13[_0xab5c('0x35')][_0xab5c('0x4d')]);_0x56ca27[_0xab5c('0x3b')]=qs['filters'](_[_0xab5c('0x3c')](_0x774c13[_0xab5c('0x35')],_0x58cc33[_0xab5c('0x32')]));if(_0x774c13[_0xab5c('0x35')][_0xab5c('0x3d')]){_0x56ca27['where']=_['merge'](_0x56ca27[_0xab5c('0x3b')],{'$or':_['map'](_0x56ca27[_0xab5c('0x36')],function(_0x21301c){var _0x30390f={};_0x30390f[_0x21301c]={'$like':'%'+_0x774c13['query'][_0xab5c('0x3d')]+'%'};return _0x30390f;})});}_0x56ca27=_[_0xab5c('0x3e')]({},_0x56ca27,_0x774c13[_0xab5c('0x46')]);return _0x4bfa2f['getConfigurations'](_0x56ca27);}})['then'](function(_0x4c6809){if(_0x4c6809){_0x545a7c=_0x4c6809[_0xab5c('0x44')];if(!_0x774c13[_0xab5c('0x35')][_0xab5c('0x38')](_0xab5c('0x39'))){_0x56ca27[_0xab5c('0x1e')]=qs[_0xab5c('0x1e')](_0x774c13[_0xab5c('0x35')][_0xab5c('0x1e')]);_0x56ca27[_0xab5c('0x1c')]=qs[_0xab5c('0x1c')](_0x774c13['query'][_0xab5c('0x1c')]);}return _0x4bfa2f['getConfigurations'](_0x56ca27);}})['then'](function(_0x1b4bcc){if(_0x1b4bcc){return _0x1b4bcc?{'count':_0x545a7c,'rows':_0x1b4bcc}:null;}})['then'](respondWithResult(_0x11a1d9,null))['catch'](handleError(_0x11a1d9,null));};exports['addConfiguration']=function(_0x4159bd,_0x443ca1,_0xec5ca6){if(_0x4159bd[_0xab5c('0x49')]['id']){delete _0x4159bd[_0xab5c('0x49')]['id'];}return db[_0xab5c('0x2c')][_0xab5c('0x4b')]({'where':{'id':_0x4159bd['params']['id']}})['then'](handleEntityNotFound(_0x443ca1,null))[_0xab5c('0x24')](function(_0x120119){if(_0x120119){_0x4159bd[_0xab5c('0x49')][_0xab5c('0x4e')]=_0x120119['id'];_0x4159bd['body']['Subjects']=integrations[_0xab5c('0x4f')](_0x4159bd[_0xab5c('0x49')][_0xab5c('0x50')],_0x4159bd[_0xab5c('0x49')]['type']);_0x4159bd[_0xab5c('0x49')][_0xab5c('0x51')]=integrations['getDescriptions'](_0x4159bd['body'][_0xab5c('0x50')],_0x4159bd[_0xab5c('0x49')]['type']);return db[_0xab5c('0x4c')][_0xab5c('0x48')](_0x4159bd[_0xab5c('0x49')],{'include':[{'model':db['VtigerField'],'as':_0xab5c('0x52')},{'model':db['VtigerField'],'as':_0xab5c('0x51')}]});}return null;})['then'](respondWithResult(_0x443ca1,null))['catch'](handleError(_0x443ca1,null));};var md5=require(_0xab5c('0x53'));exports[_0xab5c('0x54')]=function(_0x48ff2b,_0x4f539e,_0x3dba03){var _0x4c54a8=null;var _0x45c476=null;var _0x4073e5=null;var _0x4f5080=null;var _0x538827='';return db[_0xab5c('0x2c')][_0xab5c('0x4b')]({'where':{'id':_0x48ff2b[_0xab5c('0x43')]['id']},'attributes':['id',_0xab5c('0x28'),_0xab5c('0x55'),_0xab5c('0x56'),_0xab5c('0x57'),'remoteUri','serverUrl',_0xab5c('0x58')]})[_0xab5c('0x24')](handleEntityNotFound(_0x4f539e,null))['then'](function(_0x20b965){if(_0x20b965){_0x4c54a8=_0x20b965['username'];_0x45c476=_0x20b965[_0xab5c('0x58')];_0x4073e5=_0x20b965[_0xab5c('0x57')];_0x538827=_0x20b965['remoteUri'];var _0x5ed1a2=_0x538827[_0xab5c('0x59')](-0x1);if(_0x5ed1a2==='/'){_0x538827=_0x538827['substring'](0x0,_0x538827['lastIndexOf'](_0x5ed1a2));}_0x4f5080=util[_0xab5c('0x5a')]('%s/webservice.php',_0x538827);var _0x54ff2b={'method':_0xab5c('0x5b'),'uri':_0x4f5080,'qs':{'operation':_0xab5c('0x5c'),'username':_0x20b965[_0xab5c('0x55')]},'json':!![]};return rp(_0x54ff2b);}})[_0xab5c('0x24')](function(_0x11dffa){if(_0x11dffa[_0xab5c('0x5d')]){var _0x2e2a8d={'method':'POST','uri':_0x4f5080,'form':{'operation':_0xab5c('0x5e'),'username':_0x4c54a8,'accessKey':md5(_0x11dffa[_0xab5c('0x5f')][_0xab5c('0x60')]+_0x45c476)},'json':!![]};return rp(_0x2e2a8d);}})['then'](function(_0x5b3f15){if(_0x5b3f15['success']){var _0x17f05a={'method':'GET','uri':_0x4f5080,'qs':{'operation':_0xab5c('0x61'),'username':_0x4c54a8,'sessionName':_0x5b3f15[_0xab5c('0x5f')][_0xab5c('0x62')],'elementType':_0x4073e5},'json':!![]};return rp(_0x17f05a);}})[_0xab5c('0x24')](function(_0x2a3293){if(_0x2a3293['success']){var _0x431637=[_0xab5c('0x63'),_0xab5c('0x64'),_0xab5c('0x65')];_[_0xab5c('0x66')](_0x2a3293[_0xab5c('0x5f')][_0xab5c('0x37')],function(_0x5668e7){return _0x431637['includes'](_0x5668e7['type']['name']);});_[_0xab5c('0x66')](_0x2a3293[_0xab5c('0x5f')][_0xab5c('0x37')],function(_0x3daf58){return _0x3daf58[_0xab5c('0x67')]===_0xab5c('0x68');});return{'count':_0x2a3293[_0xab5c('0x5f')][_0xab5c('0x37')]['length'],'rows':_[_0xab5c('0x2b')](_0x2a3293[_0xab5c('0x5f')]['fields'],function(_0x48c483){return{'id':_0x48c483[_0xab5c('0x28')],'name':_0x48c483[_0xab5c('0x69')],'custom':_[_0xab5c('0x6a')](_0x48c483[_0xab5c('0x28')],_0xab5c('0x6b'))?!![]:![],'options':_0x48c483[_0xab5c('0x2f')][_0xab5c('0x28')]==='picklist'&&_0x48c483['type'][_0xab5c('0x6c')][_0xab5c('0x44')]>0x0?_[_0xab5c('0x2b')](_0x48c483['type']['picklistValues'],function(_0xa29c66){return{'name':_0xa29c66[_0xab5c('0x69')],'value':_0xa29c66[_0xab5c('0x6d')]};}):[]};})};}})[_0xab5c('0x24')](respondWithResult(_0x4f539e,null))[_0xab5c('0x42')](function(_0x5b9d64){console[_0xab5c('0x6e')]('vTiger\x20error:\x20'+_0x5b9d64);var _0x1b04ab=_0x48ff2b[_0xab5c('0x35')]['test']?0x1f4:_0x5b9d64[_0xab5c('0x6f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1b04ab,JSON[_0xab5c('0x70')](_0x5b9d64));delete _0x5b9d64[_0xab5c('0x28')];if(_0x1b04ab===0x191){_0x1b04ab=0x190;}_0x4f539e['status'](_0x1b04ab)['send'](_0x48ff2b[_0xab5c('0x35')]['test']?{'message':_0xab5c('0x71'),'statusCode':_0x5b9d64['statusCode']}:_0x5b9d64);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e58d59c..8804aa1 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 _0x98f4=['lodash','util','api','request-promise','path','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0xebbfc,_0x5b177d){var _0x32452a=function(_0x43313d){while(--_0x43313d){_0xebbfc['push'](_0xebbfc['shift']());}};_0x32452a(++_0x5b177d);}(_0x98f4,0x1a4));var _0x498f=function(_0x4b4865,_0xb43449){_0x4b4865=_0x4b4865-0x0;var _0x190dc2=_0x98f4[_0x4b4865];return _0x190dc2;};'use strict';var _=require(_0x498f('0x0'));var util=require(_0x498f('0x1'));var logger=require('../../config/logger')(_0x498f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x498f('0x3'));var fs=require('fs');var path=require(_0x498f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x498f('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x498f('0x6')]=function(_0x1c3f29,_0x3b170e){return _0x1c3f29[_0x498f('0x7')](_0x498f('0x8'),attributes,{'tableName':_0x498f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcff=['api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger'];(function(_0x34cbbf,_0x540ce2){var _0x3ec76e=function(_0x4e77e1){while(--_0x4e77e1){_0x34cbbf['push'](_0x34cbbf['shift']());}};_0x3ec76e(++_0x540ce2);}(_0xbcff,0x108));var _0xfbcf=function(_0x3ba213,_0x3c624f){_0x3ba213=_0x3ba213-0x0;var _0x4ae040=_0xbcff[_0x3ba213];return _0x4ae040;};'use strict';var _=require(_0xfbcf('0x0'));var util=require('util');var logger=require(_0xfbcf('0x1'))(_0xfbcf('0x2'));var moment=require(_0xfbcf('0x3'));var BPromise=require(_0xfbcf('0x4'));var rp=require(_0xfbcf('0x5'));var fs=require('fs');var path=require(_0xfbcf('0x6'));var rimraf=require('rimraf');var config=require(_0xfbcf('0x7'));var attributes=require(_0xfbcf('0x8'));var integrations=require(_0xfbcf('0x9'));module[_0xfbcf('0xa')]=function(_0x1df59b,_0x57d1de){return _0x1df59b[_0xfbcf('0xb')](_0xfbcf('0xc'),attributes,{'tableName':_0xfbcf('0xd'),'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 2bd11e0..7fb7653 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 _0xd4f4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x5eb1a6,_0x23863b){var _0x16171b=function(_0x41e775){while(--_0x41e775){_0x5eb1a6['push'](_0x5eb1a6['shift']());}};_0x16171b(++_0x23863b);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x73b4e7,_0x1bf863){_0x73b4e7=_0x73b4e7-0x0;var _0xd83ac7=_0xd4f4[_0x73b4e7];return _0xd83ac7;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['VtigerAccount'][_0x4d4f('0x18')]({'raw':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1b')]||null:null,'attributes':_0x51dcf1['options']?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1c')]||null:null,'limit':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1d')]||null:null,'include':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1e')]?_['map'](_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1e')],function(_0x2d2fb3){return{'model':db[_0x2d2fb3[_0x4d4f('0x1f')]],'as':_0x2d2fb3['as'],'attributes':_0x2d2fb3[_0x4d4f('0x1c')],'include':_0x2d2fb3['include']?_[_0x4d4f('0x20')](_0x2d2fb3[_0x4d4f('0x1e')],function(_0x1cf365){return{'model':db[_0x1cf365[_0x4d4f('0x1f')]],'as':_0x1cf365['as'],'attributes':_0x1cf365['attributes'],'include':_0x1cf365['include']?_[_0x4d4f('0x20')](_0x1cf365[_0x4d4f('0x1e')],function(_0xa2492c){return{'model':db[_0xa2492c[_0x4d4f('0x1f')]],'as':_0xa2492c['as'],'attributes':_0xa2492c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x380ebf){logger[_0x4d4f('0xd')](_0x4d4f('0x17'),_0x51dcf1);logger['debug'](_0x4d4f('0x17'),_0x51dcf1,JSON['stringify'](_0x380ebf));_0x519501(_0x380ebf);})[_0x4d4f('0x16')](function(_0x333a40){logger['error'](_0x4d4f('0x17'),_0x333a40[_0x4d4f('0x15')],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x333a40[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x21')]=function(_0x43a704){var _0x4c69cb=this;return new Promise(function(_0x36eede,_0x4578b6){return db[_0x4d4f('0x22')][_0x4d4f('0x23')]({'raw':_0x43a704[_0x4d4f('0x19')]?_0x43a704['options'][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')]['where']||null:null,'attributes':_0x43a704['options']?_0x43a704['options'][_0x4d4f('0x1c')]||null:null,'include':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')][_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x43a704['options'][_0x4d4f('0x1e')],function(_0x1ab7c4){return{'model':db[_0x1ab7c4[_0x4d4f('0x1f')]],'as':_0x1ab7c4['as'],'attributes':_0x1ab7c4['attributes'],'include':_0x1ab7c4[_0x4d4f('0x1e')]?_['map'](_0x1ab7c4[_0x4d4f('0x1e')],function(_0x2f18df){return{'model':db[_0x2f18df[_0x4d4f('0x1f')]],'as':_0x2f18df['as'],'attributes':_0x2f18df[_0x4d4f('0x1c')],'include':_0x2f18df[_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x2f18df[_0x4d4f('0x1e')],function(_0x461900){return{'model':db[_0x461900['model']],'as':_0x461900['as'],'attributes':_0x461900['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x559441){logger['info'](_0x4d4f('0x21'),_0x43a704);logger[_0x4d4f('0x10')](_0x4d4f('0x21'),_0x43a704,JSON[_0x4d4f('0x12')](_0x559441));_0x36eede(_0x559441);})[_0x4d4f('0x16')](function(_0x56eed8){logger[_0x4d4f('0x13')](_0x4d4f('0x21'),_0x56eed8['message'],_0x43a704);_0x4578b6(_0x4c69cb[_0x4d4f('0x13')](0x1f4,_0x56eed8[_0x4d4f('0x15')]));});});}; \ No newline at end of file +var _0xae60=['result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','include','map','model','raw','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x20d5c1,_0x41a170){var _0x3ff4db=function(_0x1ee660){while(--_0x1ee660){_0x20d5c1['push'](_0x20d5c1['shift']());}};_0x3ff4db(++_0x41a170);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xae60[_0x4e9d3c];return _0x2d0825;};'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')]('VtigerAccount,\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')]({'raw':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'limit':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['limit']||null:null,'include':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0xda4f01[_0x0ae6('0x1a')]['include'],function(_0x296a9d){return{'model':db[_0x296a9d[_0x0ae6('0x1f')]],'as':_0x296a9d['as'],'attributes':_0x296a9d[_0x0ae6('0x1c')],'include':_0x296a9d[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x296a9d[_0x0ae6('0x1d')],function(_0x5b86fe){return{'model':db[_0x5b86fe[_0x0ae6('0x1f')]],'as':_0x5b86fe['as'],'attributes':_0x5b86fe[_0x0ae6('0x1c')],'include':_0x5b86fe['include']?_['map'](_0x5b86fe[_0x0ae6('0x1d')],function(_0x3255a7){return{'model':db[_0x3255a7[_0x0ae6('0x1f')]],'as':_0x3255a7['as'],'attributes':_0x3255a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ae6('0xb')](function(_0xb68cbe){logger[_0x0ae6('0xc')]('GetVtigerAccount',_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0xb68cbe));_0x2fdf25(_0xb68cbe);})[_0x0ae6('0x16')](function(_0x14eed5){logger[_0x0ae6('0x12')]('GetVtigerAccount',_0x14eed5['message'],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x14eed5[_0x0ae6('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4a06f1){var _0x1ca059=this;return new Promise(function(_0x278577,_0x714c6d){return db[_0x0ae6('0x18')]['find']({'raw':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x20')]===undefined?!![]:![]:!![],'where':_0x4a06f1['options']?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'include':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x4a06f1[_0x0ae6('0x1a')]['include'],function(_0x2410bd){return{'model':db[_0x2410bd[_0x0ae6('0x1f')]],'as':_0x2410bd['as'],'attributes':_0x2410bd['attributes'],'include':_0x2410bd[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x2410bd[_0x0ae6('0x1d')],function(_0x5b9662){return{'model':db[_0x5b9662[_0x0ae6('0x1f')]],'as':_0x5b9662['as'],'attributes':_0x5b9662['attributes'],'include':_0x5b9662['include']?_[_0x0ae6('0x1e')](_0x5b9662[_0x0ae6('0x1d')],function(_0x18fc19){return{'model':db[_0x18fc19[_0x0ae6('0x1f')]],'as':_0x18fc19['as'],'attributes':_0x18fc19[_0x0ae6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x584dc8){logger[_0x0ae6('0xc')]('ShowVtigerAccount',_0x4a06f1);logger[_0x0ae6('0xe')]('ShowVtigerAccount',_0x4a06f1,JSON[_0x0ae6('0x11')](_0x584dc8));_0x278577(_0x584dc8);})['catch'](function(_0x7998e3){logger[_0x0ae6('0x12')](_0x0ae6('0x21'),_0x7998e3[_0x0ae6('0x14')],_0x4a06f1);_0x714c6d(_0x1ca059['error'](0x1f4,_0x7998e3['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ff46be6..f57871c 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 _0xb018=['get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index'];(function(_0x281080,_0x5df4f6){var _0x1caa19=function(_0x5f1e79){while(--_0x5f1e79){_0x281080['push'](_0x281080['shift']());}};_0x1caa19(++_0x5df4f6);}(_0xb018,0x182));var _0x8b01=function(_0x1ff12a,_0x1304d5){_0x1ff12a=_0x1ff12a-0x0;var _0x1b1c53=_0xb018[_0x1ff12a];return _0x1b1c53;};'use strict';var multer=require(_0x8b01('0x0'));var util=require(_0x8b01('0x1'));var path=require('path');var timeout=require(_0x8b01('0x2'));var express=require(_0x8b01('0x3'));var router=express['Router']();var fs_extra=require(_0x8b01('0x4'));var auth=require(_0x8b01('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b01('0x6'));var controller=require(_0x8b01('0x7'));router['get']('/',auth[_0x8b01('0x8')](),controller[_0x8b01('0x9')]);router[_0x8b01('0xa')](_0x8b01('0xb'),auth[_0x8b01('0x8')](),controller[_0x8b01('0xc')]);router[_0x8b01('0xa')](_0x8b01('0xd'),auth[_0x8b01('0x8')](),controller['getFields']);router[_0x8b01('0xa')]('/:id/subjects',auth[_0x8b01('0x8')](),controller[_0x8b01('0xe')]);router[_0x8b01('0xa')](_0x8b01('0xf'),auth['isAuthenticated'](),controller[_0x8b01('0x10')]);router[_0x8b01('0x11')]('/',auth[_0x8b01('0x8')](),controller[_0x8b01('0x12')]);router['put'](_0x8b01('0xb'),auth[_0x8b01('0x8')](),controller[_0x8b01('0x13')]);router[_0x8b01('0x14')](_0x8b01('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b01('0x15')]=router; \ No newline at end of file +var _0xc4cf=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x2f269b,_0x288d54){var _0x9096fd=function(_0x360682){while(--_0x360682){_0x2f269b['push'](_0x2f269b['shift']());}};_0x9096fd(++_0x288d54);}(_0xc4cf,0x120));var _0xfc4c=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xc4cf[_0x368fb9];return _0x4892fb;};'use strict';var multer=require('multer');var util=require(_0xfc4c('0x0'));var path=require(_0xfc4c('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc4c('0x2'));var router=express[_0xfc4c('0x3')]();var fs_extra=require(_0xfc4c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfc4c('0x5'));var config=require(_0xfc4c('0x6'));var controller=require(_0xfc4c('0x7'));router['get']('/',auth[_0xfc4c('0x8')](),controller[_0xfc4c('0x9')]);router[_0xfc4c('0xa')](_0xfc4c('0xb'),auth[_0xfc4c('0x8')](),controller[_0xfc4c('0xc')]);router['get'](_0xfc4c('0xd'),auth['isAuthenticated'](),controller[_0xfc4c('0xe')]);router[_0xfc4c('0xa')](_0xfc4c('0xf'),auth[_0xfc4c('0x8')](),controller[_0xfc4c('0x10')]);router[_0xfc4c('0xa')](_0xfc4c('0x11'),auth['isAuthenticated'](),controller[_0xfc4c('0x12')]);router[_0xfc4c('0x13')]('/',auth[_0xfc4c('0x8')](),controller[_0xfc4c('0x14')]);router[_0xfc4c('0x15')](_0xfc4c('0xb'),auth[_0xfc4c('0x8')](),controller[_0xfc4c('0x16')]);router[_0xfc4c('0x17')](_0xfc4c('0xb'),auth['isAuthenticated'](),controller[_0xfc4c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 0690289..68b5b06 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 _0xad43=['sequelize','exports','STRING'];(function(_0xbaafd,_0x2c89e4){var _0x17cb9c=function(_0x5d23b2){while(--_0x5d23b2){_0xbaafd['push'](_0xbaafd['shift']());}};_0x17cb9c(++_0x2c89e4);}(_0xad43,0x13b));var _0x3ad4=function(_0x19a24d,_0x344381){_0x19a24d=_0x19a24d-0x0;var _0xb506e2=_0xad43[_0x19a24d];return _0xb506e2;};'use strict';var Sequelize=require(_0x3ad4('0x0'));module[_0x3ad4('0x1')]={'name':{'type':Sequelize[_0x3ad4('0x2')]},'description':{'type':Sequelize[_0x3ad4('0x2')]}}; \ No newline at end of file +var _0xa87d=['sequelize','exports','STRING'];(function(_0x3abedc,_0x3786c3){var _0x109066=function(_0x5d26f0){while(--_0x5d26f0){_0x3abedc['push'](_0x3abedc['shift']());}};_0x109066(++_0x3786c3);}(_0xa87d,0x11d));var _0xda87=function(_0x4f4568,_0x14c711){_0x4f4568=_0x4f4568-0x0;var _0x2354f1=_0xa87d[_0x4f4568];return _0x2354f1;};'use strict';var Sequelize=require(_0xda87('0x0'));module[_0xda87('0x1')]={'name':{'type':Sequelize[_0xda87('0x2')]},'description':{'type':Sequelize[_0xda87('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 5825622..5e64387 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 _0xac7a=['error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0xac7a,0x128));var _0xaac7=function(_0x1900f3,_0x18adad){_0x1900f3=_0x1900f3-0x0;var _0x5d841b=_0xac7a[_0x1900f3];return _0x5d841b;};'use strict';var emlformat=require(_0xaac7('0x0'));var rimraf=require(_0xaac7('0x1'));var zipdir=require(_0xaac7('0x2'));var jsonpatch=require(_0xaac7('0x3'));var rp=require(_0xaac7('0x4'));var moment=require(_0xaac7('0x5'));var BPromise=require(_0xaac7('0x6'));var Mustache=require('mustache');var util=require(_0xaac7('0x7'));var path=require('path');var sox=require(_0xaac7('0x8'));var csv=require(_0xaac7('0x9'));var ejs=require(_0xaac7('0xa'));var fs=require('fs');var fs_extra=require(_0xaac7('0xb'));var _=require(_0xaac7('0xc'));var squel=require(_0xaac7('0xd'));var crypto=require(_0xaac7('0xe'));var jsforce=require(_0xaac7('0xf'));var deskjs=require(_0xaac7('0x10'));var toCsv=require(_0xaac7('0x9'));var querystring=require(_0xaac7('0x11'));var Papa=require(_0xaac7('0x12'));var Redis=require(_0xaac7('0x13'));var authService=require(_0xaac7('0x14'));var qs=require(_0xaac7('0x15'));var as=require(_0xaac7('0x16'));var hardwareService=require(_0xaac7('0x17'));var logger=require(_0xaac7('0x18'))(_0xaac7('0x19'));var utils=require(_0xaac7('0x1a'));var config=require(_0xaac7('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xaac7('0x1c'))['db'];function respondWithStatusCode(_0x45a24e,_0x3cca9b){_0x3cca9b=_0x3cca9b||0xcc;return function(_0xe50e0){if(_0xe50e0){return _0x45a24e['sendStatus'](_0x3cca9b);}return _0x45a24e['status'](_0x3cca9b)[_0xaac7('0x1d')]();};}function respondWithResult(_0x101f2f,_0x3ce2b5){_0x3ce2b5=_0x3ce2b5||0xc8;return function(_0x1f6e62){if(_0x1f6e62){return _0x101f2f[_0xaac7('0x1e')](_0x3ce2b5)[_0xaac7('0x1f')](_0x1f6e62);}};}function respondWithFilteredResult(_0xece0dc,_0x4eec65){return function(_0x5d4833){if(_0x5d4833){var _0x1ae66a=typeof _0x4eec65['offset']===_0xaac7('0x20')&&typeof _0x4eec65['limit']===_0xaac7('0x20');var _0x122c2f=_0x5d4833[_0xaac7('0x21')];var _0x1b7569=_0x1ae66a?0x0:_0x4eec65['offset'];var _0x323bc5=_0x1ae66a?_0x5d4833[_0xaac7('0x21')]:_0x4eec65[_0xaac7('0x22')]+_0x4eec65[_0xaac7('0x23')];var _0x5cd742;if(_0x323bc5>=_0x122c2f){_0x323bc5=_0x122c2f;_0x5cd742=0xc8;}else{_0x5cd742=0xce;}_0xece0dc[_0xaac7('0x1e')](_0x5cd742);return _0xece0dc[_0xaac7('0x24')](_0xaac7('0x25'),_0x1b7569+'-'+_0x323bc5+'/'+_0x122c2f)[_0xaac7('0x1f')](_0x5d4833);}return null;};}function patchUpdates(_0x22cc57){return function(_0x205ded){try{jsonpatch[_0xaac7('0x26')](_0x205ded,_0x22cc57,!![]);}catch(_0x5f1e98){return BPromise[_0xaac7('0x27')](_0x5f1e98);}return _0x205ded[_0xaac7('0x28')]();};}function saveUpdates(_0x48572a,_0x102329){return function(_0x1e36de){if(_0x1e36de){return _0x1e36de[_0xaac7('0x29')](_0x48572a)['then'](function(_0x99121b){return _0x99121b;});}return null;};}function removeEntity(_0x27c70d,_0x4b3dff){return function(_0x1e2a4e){if(_0x1e2a4e){return _0x1e2a4e['destroy']()[_0xaac7('0x2a')](function(){_0x27c70d[_0xaac7('0x1e')](0xcc)[_0xaac7('0x1d')]();});}};}function handleEntityNotFound(_0x33d2a1,_0x29c048){return function(_0x538379){if(!_0x538379){_0x33d2a1[_0xaac7('0x2b')](0x194);}return _0x538379;};}function handleError(_0x5bfb21,_0x1c5599){_0x1c5599=_0x1c5599||0x1f4;return function(_0x1f2529){logger[_0xaac7('0x2c')](_0x1f2529[_0xaac7('0x2d')]);if(_0x1f2529['name']){delete _0x1f2529[_0xaac7('0x2e')];}_0x5bfb21['status'](_0x1c5599)[_0xaac7('0x2f')](_0x1f2529);};}exports[_0xaac7('0x30')]=function(_0x568847,_0x461604){var _0x397c65={},_0x5e28f0={},_0x4bd3e6={'count':0x0,'rows':[]};var _0x3bae2b=_[_0xaac7('0x31')](db[_0xaac7('0x32')][_0xaac7('0x33')],function(_0x39ed49){return{'name':_0x39ed49['fieldName'],'type':_0x39ed49[_0xaac7('0x34')][_0xaac7('0x35')]};});_0x5e28f0[_0xaac7('0x36')]=_[_0xaac7('0x31')](_0x3bae2b,'name');_0x5e28f0[_0xaac7('0x37')]=_[_0xaac7('0x38')](_0x568847['query']);_0x5e28f0[_0xaac7('0x39')]=_[_0xaac7('0x3a')](_0x5e28f0[_0xaac7('0x36')],_0x5e28f0['query']);_0x397c65[_0xaac7('0x3b')]=_['intersection'](_0x5e28f0[_0xaac7('0x36')],qs[_0xaac7('0x3c')](_0x568847['query'][_0xaac7('0x3c')]));_0x397c65[_0xaac7('0x3b')]=_0x397c65[_0xaac7('0x3b')][_0xaac7('0x3d')]?_0x397c65['attributes']:_0x5e28f0['model'];if(!_0x568847[_0xaac7('0x37')][_0xaac7('0x3e')](_0xaac7('0x3f'))){_0x397c65['limit']=qs[_0xaac7('0x23')](_0x568847[_0xaac7('0x37')][_0xaac7('0x23')]);_0x397c65[_0xaac7('0x22')]=qs[_0xaac7('0x22')](_0x568847[_0xaac7('0x37')][_0xaac7('0x22')]);}_0x397c65[_0xaac7('0x40')]=qs[_0xaac7('0x41')](_0x568847[_0xaac7('0x37')][_0xaac7('0x41')]);_0x397c65[_0xaac7('0x42')]=qs['filters'](_['pick'](_0x568847[_0xaac7('0x37')],_0x5e28f0[_0xaac7('0x39')]),_0x3bae2b);if(_0x568847[_0xaac7('0x37')]['filter']){_0x397c65[_0xaac7('0x42')]=_[_0xaac7('0x43')](_0x397c65[_0xaac7('0x42')],{'$or':_['map'](_0x3bae2b,function(_0x118c63){if(_0x118c63[_0xaac7('0x34')]!==_0xaac7('0x44')){var _0x3bd26e={};_0x3bd26e[_0x118c63[_0xaac7('0x2e')]]={'$like':'%'+_0x568847['query'][_0xaac7('0x45')]+'%'};return _0x3bd26e;}})});}_0x397c65=_[_0xaac7('0x43')]({},_0x397c65,_0x568847[_0xaac7('0x46')]);var _0xbae651={'where':_0x397c65[_0xaac7('0x42')]};return db[_0xaac7('0x32')][_0xaac7('0x21')](_0xbae651)[_0xaac7('0x2a')](function(_0x3d646e){_0x4bd3e6[_0xaac7('0x21')]=_0x3d646e;if(_0x568847['query'][_0xaac7('0x47')]){_0x397c65['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xaac7('0x48')](_0x397c65);})[_0xaac7('0x2a')](function(_0x5c5c3b){_0x4bd3e6[_0xaac7('0x49')]=_0x5c5c3b;return _0x4bd3e6;})['then'](respondWithFilteredResult(_0x461604,_0x397c65))[_0xaac7('0x4a')](handleError(_0x461604,null));};exports['show']=function(_0x4a807b,_0x14a08f){var _0x899781={'raw':![],'where':{'id':_0x4a807b[_0xaac7('0x4b')]['id']}},_0x420eba={};_0x420eba[_0xaac7('0x36')]=_[_0xaac7('0x38')](db[_0xaac7('0x32')][_0xaac7('0x33')]);_0x420eba['query']=_[_0xaac7('0x38')](_0x4a807b['query']);_0x420eba[_0xaac7('0x39')]=_[_0xaac7('0x3a')](_0x420eba[_0xaac7('0x36')],_0x420eba[_0xaac7('0x37')]);_0x899781[_0xaac7('0x3b')]=_[_0xaac7('0x3a')](_0x420eba[_0xaac7('0x36')],qs[_0xaac7('0x3c')](_0x4a807b[_0xaac7('0x37')]['fields']));_0x899781[_0xaac7('0x3b')]=_0x899781['attributes'][_0xaac7('0x3d')]?_0x899781[_0xaac7('0x3b')]:_0x420eba[_0xaac7('0x36')];if(_0x4a807b[_0xaac7('0x37')][_0xaac7('0x47')]){_0x899781['include']=[{'all':!![]}];}_0x899781=_[_0xaac7('0x43')]({},_0x899781,_0x4a807b[_0xaac7('0x46')]);return db['VtigerConfiguration'][_0xaac7('0x4c')](_0x899781)['then'](handleEntityNotFound(_0x14a08f,null))[_0xaac7('0x2a')](respondWithResult(_0x14a08f,null))[_0xaac7('0x4a')](handleError(_0x14a08f,null));};exports[_0xaac7('0x4d')]=function(_0x5ab742,_0x4edb9f){return db[_0xaac7('0x32')]['create'](_0x5ab742[_0xaac7('0x4e')],{})[_0xaac7('0x2a')](respondWithResult(_0x4edb9f,0xc9))[_0xaac7('0x4a')](handleError(_0x4edb9f,null));};exports[_0xaac7('0x29')]=function(_0x3508e5,_0x3d1622){if(_0x3508e5[_0xaac7('0x4e')]['id']){delete _0x3508e5[_0xaac7('0x4e')]['id'];}return db[_0xaac7('0x32')][_0xaac7('0x4c')]({'where':{'id':_0x3508e5[_0xaac7('0x4b')]['id']}})[_0xaac7('0x2a')](handleEntityNotFound(_0x3d1622,null))[_0xaac7('0x2a')](saveUpdates(_0x3508e5[_0xaac7('0x4e')],null))[_0xaac7('0x2a')](respondWithResult(_0x3d1622,null))[_0xaac7('0x4a')](handleError(_0x3d1622,null));};exports['destroy']=function(_0x426420,_0x1578da){return db[_0xaac7('0x32')][_0xaac7('0x4c')]({'where':{'id':_0x426420[_0xaac7('0x4b')]['id']}})[_0xaac7('0x2a')](handleEntityNotFound(_0x1578da,null))['then'](removeEntity(_0x1578da,null))[_0xaac7('0x4a')](handleError(_0x1578da,null));};exports[_0xaac7('0x4f')]=function(_0x4748b3,_0x2136c3,_0x2ae72a){var _0x5ae7ce={};var _0xc550c2={};var _0x5ae685;var _0x540076;return db[_0xaac7('0x32')][_0xaac7('0x50')]({'where':{'id':_0x4748b3[_0xaac7('0x4b')]['id']}})[_0xaac7('0x2a')](handleEntityNotFound(_0x2136c3,null))['then'](function(_0x20c803){if(_0x20c803){_0x5ae685=_0x20c803;_0xc550c2[_0xaac7('0x36')]=_['keys'](db[_0xaac7('0x51')][_0xaac7('0x33')]);_0xc550c2[_0xaac7('0x37')]=_[_0xaac7('0x38')](_0x4748b3['query']);_0xc550c2[_0xaac7('0x39')]=_[_0xaac7('0x3a')](_0xc550c2[_0xaac7('0x36')],_0xc550c2[_0xaac7('0x37')]);_0x5ae7ce[_0xaac7('0x3b')]=_[_0xaac7('0x3a')](_0xc550c2[_0xaac7('0x36')],qs['fields'](_0x4748b3['query'][_0xaac7('0x3c')]));_0x5ae7ce['attributes']=_0x5ae7ce[_0xaac7('0x3b')][_0xaac7('0x3d')]?_0x5ae7ce[_0xaac7('0x3b')]:_0xc550c2['model'];_0x5ae7ce[_0xaac7('0x40')]=qs[_0xaac7('0x41')](_0x4748b3['query'][_0xaac7('0x41')]);_0x5ae7ce[_0xaac7('0x42')]=qs['filters'](_[_0xaac7('0x52')](_0x4748b3['query'],_0xc550c2['filters']));if(_0x4748b3[_0xaac7('0x37')][_0xaac7('0x45')]){_0x5ae7ce[_0xaac7('0x42')]=_[_0xaac7('0x43')](_0x5ae7ce[_0xaac7('0x42')],{'$or':_[_0xaac7('0x31')](_0x5ae7ce[_0xaac7('0x3b')],function(_0x4d93d5){var _0xc2b99b={};_0xc2b99b[_0x4d93d5]={'$like':'%'+_0x4748b3[_0xaac7('0x37')][_0xaac7('0x45')]+'%'};return _0xc2b99b;})});}_0x5ae7ce=_[_0xaac7('0x43')]({},_0x5ae7ce,_0x4748b3[_0xaac7('0x46')]);return _0x5ae685[_0xaac7('0x4f')](_0x5ae7ce);}})[_0xaac7('0x2a')](function(_0x3e7dc5){if(_0x3e7dc5){_0x540076=_0x3e7dc5[_0xaac7('0x3d')];if(!_0x4748b3[_0xaac7('0x37')][_0xaac7('0x3e')]('nolimit')){_0x5ae7ce[_0xaac7('0x23')]=qs[_0xaac7('0x23')](_0x4748b3[_0xaac7('0x37')][_0xaac7('0x23')]);_0x5ae7ce[_0xaac7('0x22')]=qs[_0xaac7('0x22')](_0x4748b3[_0xaac7('0x37')]['offset']);}return _0x5ae685[_0xaac7('0x4f')](_0x5ae7ce);}})[_0xaac7('0x2a')](function(_0x4094b9){if(_0x4094b9){return _0x4094b9?{'count':_0x540076,'rows':_0x4094b9}:null;}})['then'](respondWithResult(_0x2136c3,null))['catch'](handleError(_0x2136c3,null));};exports[_0xaac7('0x53')]=function(_0x284526,_0x5a10ea,_0x1f8a4f){var _0x2d266c={};var _0x308f30={};var _0x1f028f;var _0x5d4339;return db[_0xaac7('0x32')][_0xaac7('0x50')]({'where':{'id':_0x284526['params']['id']}})[_0xaac7('0x2a')](handleEntityNotFound(_0x5a10ea,null))[_0xaac7('0x2a')](function(_0x379702){if(_0x379702){_0x1f028f=_0x379702;_0x308f30[_0xaac7('0x36')]=_[_0xaac7('0x38')](db[_0xaac7('0x51')]['rawAttributes']);_0x308f30[_0xaac7('0x37')]=_[_0xaac7('0x38')](_0x284526['query']);_0x308f30[_0xaac7('0x39')]=_[_0xaac7('0x3a')](_0x308f30[_0xaac7('0x36')],_0x308f30['query']);_0x2d266c[_0xaac7('0x3b')]=_['intersection'](_0x308f30[_0xaac7('0x36')],qs[_0xaac7('0x3c')](_0x284526[_0xaac7('0x37')][_0xaac7('0x3c')]));_0x2d266c[_0xaac7('0x3b')]=_0x2d266c['attributes'][_0xaac7('0x3d')]?_0x2d266c[_0xaac7('0x3b')]:_0x308f30[_0xaac7('0x36')];_0x2d266c[_0xaac7('0x40')]=qs['sort'](_0x284526[_0xaac7('0x37')]['sort']);_0x2d266c['where']=qs['filters'](_[_0xaac7('0x52')](_0x284526['query'],_0x308f30[_0xaac7('0x39')]));if(_0x284526[_0xaac7('0x37')][_0xaac7('0x45')]){_0x2d266c['where']=_[_0xaac7('0x43')](_0x2d266c[_0xaac7('0x42')],{'$or':_['map'](_0x2d266c[_0xaac7('0x3b')],function(_0x581ba8){var _0x43b202={};_0x43b202[_0x581ba8]={'$like':'%'+_0x284526[_0xaac7('0x37')][_0xaac7('0x45')]+'%'};return _0x43b202;})});}_0x2d266c=_['merge']({},_0x2d266c,_0x284526['options']);return _0x1f028f[_0xaac7('0x53')](_0x2d266c);}})[_0xaac7('0x2a')](function(_0x466cba){if(_0x466cba){_0x5d4339=_0x466cba[_0xaac7('0x3d')];if(!_0x284526[_0xaac7('0x37')][_0xaac7('0x3e')](_0xaac7('0x3f'))){_0x2d266c[_0xaac7('0x23')]=qs[_0xaac7('0x23')](_0x284526['query'][_0xaac7('0x23')]);_0x2d266c[_0xaac7('0x22')]=qs[_0xaac7('0x22')](_0x284526[_0xaac7('0x37')][_0xaac7('0x22')]);}return _0x1f028f[_0xaac7('0x53')](_0x2d266c);}})['then'](function(_0x2f7aec){if(_0x2f7aec){return _0x2f7aec?{'count':_0x5d4339,'rows':_0x2f7aec}:null;}})[_0xaac7('0x2a')](respondWithResult(_0x5a10ea,null))['catch'](handleError(_0x5a10ea,null));};exports[_0xaac7('0x54')]=function(_0xc2b7f1,_0x58621d,_0x234019){var _0x5aee28={};var _0x26ebe7={};var _0x1fafff;var _0x4470c1;return db[_0xaac7('0x32')][_0xaac7('0x50')]({'where':{'id':_0xc2b7f1['params']['id']}})['then'](handleEntityNotFound(_0x58621d,null))[_0xaac7('0x2a')](function(_0xf762fe){if(_0xf762fe){_0x1fafff=_0xf762fe;_0x26ebe7[_0xaac7('0x36')]=_[_0xaac7('0x38')](db[_0xaac7('0x51')][_0xaac7('0x33')]);_0x26ebe7['query']=_['keys'](_0xc2b7f1['query']);_0x26ebe7[_0xaac7('0x39')]=_[_0xaac7('0x3a')](_0x26ebe7['model'],_0x26ebe7['query']);_0x5aee28[_0xaac7('0x3b')]=_[_0xaac7('0x3a')](_0x26ebe7['model'],qs[_0xaac7('0x3c')](_0xc2b7f1[_0xaac7('0x37')][_0xaac7('0x3c')]));_0x5aee28[_0xaac7('0x3b')]=_0x5aee28['attributes']['length']?_0x5aee28[_0xaac7('0x3b')]:_0x26ebe7[_0xaac7('0x36')];_0x5aee28[_0xaac7('0x40')]=qs[_0xaac7('0x41')](_0xc2b7f1['query'][_0xaac7('0x41')]);_0x5aee28['where']=qs[_0xaac7('0x39')](_['pick'](_0xc2b7f1[_0xaac7('0x37')],_0x26ebe7[_0xaac7('0x39')]));if(_0xc2b7f1[_0xaac7('0x37')][_0xaac7('0x45')]){_0x5aee28['where']=_[_0xaac7('0x43')](_0x5aee28[_0xaac7('0x42')],{'$or':_[_0xaac7('0x31')](_0x5aee28['attributes'],function(_0x23cd5d){var _0x5c7629={};_0x5c7629[_0x23cd5d]={'$like':'%'+_0xc2b7f1[_0xaac7('0x37')]['filter']+'%'};return _0x5c7629;})});}_0x5aee28=_[_0xaac7('0x43')]({},_0x5aee28,_0xc2b7f1[_0xaac7('0x46')]);return _0x1fafff[_0xaac7('0x54')](_0x5aee28);}})[_0xaac7('0x2a')](function(_0xfade1d){if(_0xfade1d){_0x4470c1=_0xfade1d[_0xaac7('0x3d')];if(!_0xc2b7f1[_0xaac7('0x37')][_0xaac7('0x3e')](_0xaac7('0x3f'))){_0x5aee28[_0xaac7('0x23')]=qs[_0xaac7('0x23')](_0xc2b7f1[_0xaac7('0x37')][_0xaac7('0x23')]);_0x5aee28[_0xaac7('0x22')]=qs[_0xaac7('0x22')](_0xc2b7f1['query']['offset']);}return _0x1fafff[_0xaac7('0x54')](_0x5aee28);}})['then'](function(_0x4c7d72){if(_0x4c7d72){return _0x4c7d72?{'count':_0x4470c1,'rows':_0x4c7d72}:null;}})[_0xaac7('0x2a')](respondWithResult(_0x58621d,null))[_0xaac7('0x4a')](handleError(_0x58621d,null));}; \ No newline at end of file +var _0x0be1=['getFields','findOne','VtigerField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','stack','name','send','index','VtigerConfiguration','rawAttributes','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy'];(function(_0x561cda,_0x20e240){var _0x47f093=function(_0x7d3e16){while(--_0x7d3e16){_0x561cda['push'](_0x561cda['shift']());}};_0x47f093(++_0x20e240);}(_0x0be1,0x1b0));var _0x10be=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x0be1[_0x45c48f];return _0xaf5037;};'use strict';var emlformat=require(_0x10be('0x0'));var rimraf=require(_0x10be('0x1'));var zipdir=require(_0x10be('0x2'));var jsonpatch=require(_0x10be('0x3'));var rp=require(_0x10be('0x4'));var moment=require(_0x10be('0x5'));var BPromise=require(_0x10be('0x6'));var Mustache=require(_0x10be('0x7'));var util=require(_0x10be('0x8'));var path=require(_0x10be('0x9'));var sox=require(_0x10be('0xa'));var csv=require(_0x10be('0xb'));var ejs=require(_0x10be('0xc'));var fs=require('fs');var fs_extra=require(_0x10be('0xd'));var _=require(_0x10be('0xe'));var squel=require(_0x10be('0xf'));var crypto=require(_0x10be('0x10'));var jsforce=require(_0x10be('0x11'));var deskjs=require(_0x10be('0x12'));var toCsv=require('to-csv');var querystring=require(_0x10be('0x13'));var Papa=require(_0x10be('0x14'));var Redis=require('ioredis');var authService=require(_0x10be('0x15'));var qs=require(_0x10be('0x16'));var as=require(_0x10be('0x17'));var hardwareService=require(_0x10be('0x18'));var logger=require(_0x10be('0x19'))(_0x10be('0x1a'));var utils=require('../../config/utils');var config=require(_0x10be('0x1b'));var licenseUtil=require(_0x10be('0x1c'));var db=require(_0x10be('0x1d'))['db'];function respondWithStatusCode(_0x3f1d90,_0x35edae){_0x35edae=_0x35edae||0xcc;return function(_0xf44d45){if(_0xf44d45){return _0x3f1d90[_0x10be('0x1e')](_0x35edae);}return _0x3f1d90[_0x10be('0x1f')](_0x35edae)[_0x10be('0x20')]();};}function respondWithResult(_0x20e337,_0x5723af){_0x5723af=_0x5723af||0xc8;return function(_0x7f59a3){if(_0x7f59a3){return _0x20e337[_0x10be('0x1f')](_0x5723af)[_0x10be('0x21')](_0x7f59a3);}};}function respondWithFilteredResult(_0x4aeb05,_0x49beb7){return function(_0x1c4b5e){if(_0x1c4b5e){var _0x5cf533=typeof _0x49beb7[_0x10be('0x22')]===_0x10be('0x23')&&typeof _0x49beb7['limit']===_0x10be('0x23');var _0xa54ac3=_0x1c4b5e['count'];var _0x958501=_0x5cf533?0x0:_0x49beb7[_0x10be('0x22')];var _0x46c312=_0x5cf533?_0x1c4b5e[_0x10be('0x24')]:_0x49beb7[_0x10be('0x22')]+_0x49beb7['limit'];var _0x4fc8ca;if(_0x46c312>=_0xa54ac3){_0x46c312=_0xa54ac3;_0x4fc8ca=0xc8;}else{_0x4fc8ca=0xce;}_0x4aeb05[_0x10be('0x1f')](_0x4fc8ca);return _0x4aeb05['set']('Content-Range',_0x958501+'-'+_0x46c312+'/'+_0xa54ac3)['json'](_0x1c4b5e);}return null;};}function patchUpdates(_0x17c99){return function(_0x47be97){try{jsonpatch[_0x10be('0x25')](_0x47be97,_0x17c99,!![]);}catch(_0x37f3d7){return BPromise[_0x10be('0x26')](_0x37f3d7);}return _0x47be97[_0x10be('0x27')]();};}function saveUpdates(_0x4f5b62,_0x5b48a8){return function(_0x124937){if(_0x124937){return _0x124937[_0x10be('0x28')](_0x4f5b62)[_0x10be('0x29')](function(_0x37f613){return _0x37f613;});}return null;};}function removeEntity(_0x41fbd9,_0x5f57a8){return function(_0x41447f){if(_0x41447f){return _0x41447f['destroy']()[_0x10be('0x29')](function(){_0x41fbd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4634a8,_0x1ec551){return function(_0x3911cb){if(!_0x3911cb){_0x4634a8['sendStatus'](0x194);}return _0x3911cb;};}function handleError(_0x138080,_0x3239d5){_0x3239d5=_0x3239d5||0x1f4;return function(_0x880483){logger['error'](_0x880483[_0x10be('0x2a')]);if(_0x880483['name']){delete _0x880483[_0x10be('0x2b')];}_0x138080[_0x10be('0x1f')](_0x3239d5)[_0x10be('0x2c')](_0x880483);};}exports[_0x10be('0x2d')]=function(_0x484cd9,_0x1a954b){var _0x23108f={},_0x2fcbce={},_0x480f78={'count':0x0,'rows':[]};var _0x5a0f1f=_['map'](db[_0x10be('0x2e')][_0x10be('0x2f')],function(_0x12aa7a){return{'name':_0x12aa7a['fieldName'],'type':_0x12aa7a['type'][_0x10be('0x30')]};});_0x2fcbce['model']=_[_0x10be('0x31')](_0x5a0f1f,'name');_0x2fcbce[_0x10be('0x32')]=_[_0x10be('0x33')](_0x484cd9[_0x10be('0x32')]);_0x2fcbce[_0x10be('0x34')]=_['intersection'](_0x2fcbce[_0x10be('0x35')],_0x2fcbce[_0x10be('0x32')]);_0x23108f[_0x10be('0x36')]=_[_0x10be('0x37')](_0x2fcbce[_0x10be('0x35')],qs[_0x10be('0x38')](_0x484cd9['query']['fields']));_0x23108f[_0x10be('0x36')]=_0x23108f[_0x10be('0x36')][_0x10be('0x39')]?_0x23108f[_0x10be('0x36')]:_0x2fcbce[_0x10be('0x35')];if(!_0x484cd9[_0x10be('0x32')]['hasOwnProperty'](_0x10be('0x3a'))){_0x23108f[_0x10be('0x3b')]=qs[_0x10be('0x3b')](_0x484cd9[_0x10be('0x32')][_0x10be('0x3b')]);_0x23108f[_0x10be('0x22')]=qs[_0x10be('0x22')](_0x484cd9[_0x10be('0x32')]['offset']);}_0x23108f['order']=qs[_0x10be('0x3c')](_0x484cd9['query'][_0x10be('0x3c')]);_0x23108f[_0x10be('0x3d')]=qs[_0x10be('0x34')](_[_0x10be('0x3e')](_0x484cd9[_0x10be('0x32')],_0x2fcbce[_0x10be('0x34')]),_0x5a0f1f);if(_0x484cd9[_0x10be('0x32')][_0x10be('0x3f')]){_0x23108f['where']=_[_0x10be('0x40')](_0x23108f[_0x10be('0x3d')],{'$or':_[_0x10be('0x31')](_0x5a0f1f,function(_0x118eac){if(_0x118eac[_0x10be('0x41')]!==_0x10be('0x42')){var _0x8be7b2={};_0x8be7b2[_0x118eac['name']]={'$like':'%'+_0x484cd9['query'][_0x10be('0x3f')]+'%'};return _0x8be7b2;}})});}_0x23108f=_[_0x10be('0x40')]({},_0x23108f,_0x484cd9[_0x10be('0x43')]);var _0x45e8e3={'where':_0x23108f[_0x10be('0x3d')]};return db[_0x10be('0x2e')][_0x10be('0x24')](_0x45e8e3)[_0x10be('0x29')](function(_0x41ee47){_0x480f78[_0x10be('0x24')]=_0x41ee47;if(_0x484cd9[_0x10be('0x32')][_0x10be('0x44')]){_0x23108f[_0x10be('0x45')]=[{'all':!![]}];}return db[_0x10be('0x2e')][_0x10be('0x46')](_0x23108f);})[_0x10be('0x29')](function(_0x5d64d9){_0x480f78[_0x10be('0x47')]=_0x5d64d9;return _0x480f78;})[_0x10be('0x29')](respondWithFilteredResult(_0x1a954b,_0x23108f))[_0x10be('0x48')](handleError(_0x1a954b,null));};exports['show']=function(_0x2c2990,_0x37f50e){var _0x12b542={'raw':![],'where':{'id':_0x2c2990[_0x10be('0x49')]['id']}},_0x1d88f6={};_0x1d88f6[_0x10be('0x35')]=_[_0x10be('0x33')](db[_0x10be('0x2e')][_0x10be('0x2f')]);_0x1d88f6[_0x10be('0x32')]=_[_0x10be('0x33')](_0x2c2990[_0x10be('0x32')]);_0x1d88f6[_0x10be('0x34')]=_[_0x10be('0x37')](_0x1d88f6[_0x10be('0x35')],_0x1d88f6[_0x10be('0x32')]);_0x12b542[_0x10be('0x36')]=_['intersection'](_0x1d88f6[_0x10be('0x35')],qs[_0x10be('0x38')](_0x2c2990[_0x10be('0x32')][_0x10be('0x38')]));_0x12b542[_0x10be('0x36')]=_0x12b542[_0x10be('0x36')]['length']?_0x12b542[_0x10be('0x36')]:_0x1d88f6[_0x10be('0x35')];if(_0x2c2990[_0x10be('0x32')]['includeAll']){_0x12b542['include']=[{'all':!![]}];}_0x12b542=_['merge']({},_0x12b542,_0x2c2990[_0x10be('0x43')]);return db['VtigerConfiguration'][_0x10be('0x4a')](_0x12b542)['then'](handleEntityNotFound(_0x37f50e,null))['then'](respondWithResult(_0x37f50e,null))[_0x10be('0x48')](handleError(_0x37f50e,null));};exports[_0x10be('0x4b')]=function(_0x114a4f,_0x33b7c4){return db[_0x10be('0x2e')][_0x10be('0x4b')](_0x114a4f[_0x10be('0x4c')],{})[_0x10be('0x29')](respondWithResult(_0x33b7c4,0xc9))[_0x10be('0x48')](handleError(_0x33b7c4,null));};exports[_0x10be('0x28')]=function(_0x58789a,_0x178632){if(_0x58789a['body']['id']){delete _0x58789a[_0x10be('0x4c')]['id'];}return db['VtigerConfiguration'][_0x10be('0x4a')]({'where':{'id':_0x58789a['params']['id']}})[_0x10be('0x29')](handleEntityNotFound(_0x178632,null))[_0x10be('0x29')](saveUpdates(_0x58789a[_0x10be('0x4c')],null))[_0x10be('0x29')](respondWithResult(_0x178632,null))['catch'](handleError(_0x178632,null));};exports[_0x10be('0x4d')]=function(_0x1a22e8,_0x5466d9){return db['VtigerConfiguration']['find']({'where':{'id':_0x1a22e8[_0x10be('0x49')]['id']}})[_0x10be('0x29')](handleEntityNotFound(_0x5466d9,null))[_0x10be('0x29')](removeEntity(_0x5466d9,null))[_0x10be('0x48')](handleError(_0x5466d9,null));};exports[_0x10be('0x4e')]=function(_0x45fd33,_0x183220,_0x149379){var _0x231a87={};var _0x5acfbb={};var _0x499afb;var _0x21808e;return db['VtigerConfiguration'][_0x10be('0x4f')]({'where':{'id':_0x45fd33[_0x10be('0x49')]['id']}})[_0x10be('0x29')](handleEntityNotFound(_0x183220,null))['then'](function(_0x3f0d1b){if(_0x3f0d1b){_0x499afb=_0x3f0d1b;_0x5acfbb[_0x10be('0x35')]=_[_0x10be('0x33')](db[_0x10be('0x50')][_0x10be('0x2f')]);_0x5acfbb[_0x10be('0x32')]=_[_0x10be('0x33')](_0x45fd33['query']);_0x5acfbb[_0x10be('0x34')]=_[_0x10be('0x37')](_0x5acfbb['model'],_0x5acfbb['query']);_0x231a87[_0x10be('0x36')]=_[_0x10be('0x37')](_0x5acfbb[_0x10be('0x35')],qs[_0x10be('0x38')](_0x45fd33['query']['fields']));_0x231a87[_0x10be('0x36')]=_0x231a87[_0x10be('0x36')]['length']?_0x231a87['attributes']:_0x5acfbb[_0x10be('0x35')];_0x231a87[_0x10be('0x51')]=qs['sort'](_0x45fd33[_0x10be('0x32')][_0x10be('0x3c')]);_0x231a87[_0x10be('0x3d')]=qs[_0x10be('0x34')](_['pick'](_0x45fd33['query'],_0x5acfbb['filters']));if(_0x45fd33[_0x10be('0x32')][_0x10be('0x3f')]){_0x231a87[_0x10be('0x3d')]=_[_0x10be('0x40')](_0x231a87[_0x10be('0x3d')],{'$or':_[_0x10be('0x31')](_0x231a87[_0x10be('0x36')],function(_0x85756f){var _0xec8ec2={};_0xec8ec2[_0x85756f]={'$like':'%'+_0x45fd33['query']['filter']+'%'};return _0xec8ec2;})});}_0x231a87=_[_0x10be('0x40')]({},_0x231a87,_0x45fd33[_0x10be('0x43')]);return _0x499afb['getFields'](_0x231a87);}})[_0x10be('0x29')](function(_0x4db6ad){if(_0x4db6ad){_0x21808e=_0x4db6ad[_0x10be('0x39')];if(!_0x45fd33[_0x10be('0x32')][_0x10be('0x52')](_0x10be('0x3a'))){_0x231a87['limit']=qs[_0x10be('0x3b')](_0x45fd33[_0x10be('0x32')][_0x10be('0x3b')]);_0x231a87['offset']=qs[_0x10be('0x22')](_0x45fd33[_0x10be('0x32')][_0x10be('0x22')]);}return _0x499afb['getFields'](_0x231a87);}})[_0x10be('0x29')](function(_0x40b2f){if(_0x40b2f){return _0x40b2f?{'count':_0x21808e,'rows':_0x40b2f}:null;}})[_0x10be('0x29')](respondWithResult(_0x183220,null))[_0x10be('0x48')](handleError(_0x183220,null));};exports[_0x10be('0x53')]=function(_0xc30584,_0x44d4f7,_0x463cdd){var _0x1f9209={};var _0x216785={};var _0x5839c5;var _0x46870c;return db[_0x10be('0x2e')][_0x10be('0x4f')]({'where':{'id':_0xc30584[_0x10be('0x49')]['id']}})[_0x10be('0x29')](handleEntityNotFound(_0x44d4f7,null))[_0x10be('0x29')](function(_0x2275f5){if(_0x2275f5){_0x5839c5=_0x2275f5;_0x216785['model']=_[_0x10be('0x33')](db['VtigerField']['rawAttributes']);_0x216785[_0x10be('0x32')]=_[_0x10be('0x33')](_0xc30584[_0x10be('0x32')]);_0x216785['filters']=_[_0x10be('0x37')](_0x216785[_0x10be('0x35')],_0x216785[_0x10be('0x32')]);_0x1f9209['attributes']=_[_0x10be('0x37')](_0x216785[_0x10be('0x35')],qs[_0x10be('0x38')](_0xc30584[_0x10be('0x32')][_0x10be('0x38')]));_0x1f9209[_0x10be('0x36')]=_0x1f9209[_0x10be('0x36')]['length']?_0x1f9209[_0x10be('0x36')]:_0x216785[_0x10be('0x35')];_0x1f9209[_0x10be('0x51')]=qs[_0x10be('0x3c')](_0xc30584['query']['sort']);_0x1f9209[_0x10be('0x3d')]=qs[_0x10be('0x34')](_['pick'](_0xc30584[_0x10be('0x32')],_0x216785[_0x10be('0x34')]));if(_0xc30584[_0x10be('0x32')][_0x10be('0x3f')]){_0x1f9209['where']=_['merge'](_0x1f9209[_0x10be('0x3d')],{'$or':_['map'](_0x1f9209['attributes'],function(_0x2a5c12){var _0x395fad={};_0x395fad[_0x2a5c12]={'$like':'%'+_0xc30584[_0x10be('0x32')][_0x10be('0x3f')]+'%'};return _0x395fad;})});}_0x1f9209=_[_0x10be('0x40')]({},_0x1f9209,_0xc30584['options']);return _0x5839c5[_0x10be('0x53')](_0x1f9209);}})[_0x10be('0x29')](function(_0x3d0e48){if(_0x3d0e48){_0x46870c=_0x3d0e48[_0x10be('0x39')];if(!_0xc30584[_0x10be('0x32')][_0x10be('0x52')](_0x10be('0x3a'))){_0x1f9209['limit']=qs[_0x10be('0x3b')](_0xc30584[_0x10be('0x32')][_0x10be('0x3b')]);_0x1f9209[_0x10be('0x22')]=qs['offset'](_0xc30584[_0x10be('0x32')][_0x10be('0x22')]);}return _0x5839c5[_0x10be('0x53')](_0x1f9209);}})['then'](function(_0x41309a){if(_0x41309a){return _0x41309a?{'count':_0x46870c,'rows':_0x41309a}:null;}})[_0x10be('0x29')](respondWithResult(_0x44d4f7,null))[_0x10be('0x48')](handleError(_0x44d4f7,null));};exports['getDescriptions']=function(_0x46d064,_0xadc10f,_0x360213){var _0x3f35f9={};var _0x1be334={};var _0x5ee5fa;var _0x3a45d6;return db['VtigerConfiguration'][_0x10be('0x4f')]({'where':{'id':_0x46d064[_0x10be('0x49')]['id']}})['then'](handleEntityNotFound(_0xadc10f,null))[_0x10be('0x29')](function(_0x377f4a){if(_0x377f4a){_0x5ee5fa=_0x377f4a;_0x1be334[_0x10be('0x35')]=_[_0x10be('0x33')](db[_0x10be('0x50')][_0x10be('0x2f')]);_0x1be334[_0x10be('0x32')]=_[_0x10be('0x33')](_0x46d064['query']);_0x1be334[_0x10be('0x34')]=_['intersection'](_0x1be334['model'],_0x1be334[_0x10be('0x32')]);_0x3f35f9[_0x10be('0x36')]=_[_0x10be('0x37')](_0x1be334[_0x10be('0x35')],qs[_0x10be('0x38')](_0x46d064[_0x10be('0x32')]['fields']));_0x3f35f9[_0x10be('0x36')]=_0x3f35f9['attributes']['length']?_0x3f35f9[_0x10be('0x36')]:_0x1be334[_0x10be('0x35')];_0x3f35f9[_0x10be('0x51')]=qs[_0x10be('0x3c')](_0x46d064[_0x10be('0x32')][_0x10be('0x3c')]);_0x3f35f9['where']=qs[_0x10be('0x34')](_[_0x10be('0x3e')](_0x46d064[_0x10be('0x32')],_0x1be334['filters']));if(_0x46d064[_0x10be('0x32')]['filter']){_0x3f35f9[_0x10be('0x3d')]=_['merge'](_0x3f35f9[_0x10be('0x3d')],{'$or':_[_0x10be('0x31')](_0x3f35f9[_0x10be('0x36')],function(_0x319297){var _0x48326e={};_0x48326e[_0x319297]={'$like':'%'+_0x46d064[_0x10be('0x32')]['filter']+'%'};return _0x48326e;})});}_0x3f35f9=_[_0x10be('0x40')]({},_0x3f35f9,_0x46d064[_0x10be('0x43')]);return _0x5ee5fa[_0x10be('0x54')](_0x3f35f9);}})[_0x10be('0x29')](function(_0x39c795){if(_0x39c795){_0x3a45d6=_0x39c795[_0x10be('0x39')];if(!_0x46d064[_0x10be('0x32')][_0x10be('0x52')](_0x10be('0x3a'))){_0x3f35f9[_0x10be('0x3b')]=qs[_0x10be('0x3b')](_0x46d064['query'][_0x10be('0x3b')]);_0x3f35f9[_0x10be('0x22')]=qs['offset'](_0x46d064['query']['offset']);}return _0x5ee5fa['getDescriptions'](_0x3f35f9);}})[_0x10be('0x29')](function(_0x58513b){if(_0x58513b){return _0x58513b?{'count':_0x3a45d6,'rows':_0x58513b}:null;}})[_0x10be('0x29')](respondWithResult(_0xadc10f,null))[_0x10be('0x48')](handleError(_0xadc10f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b5e113b..e67e844 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 _0x81d8=['../../config/logger','api','moment','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util'];(function(_0x309abe,_0x2dcfe2){var _0x100529=function(_0x21e501){while(--_0x21e501){_0x309abe['push'](_0x309abe['shift']());}};_0x100529(++_0x2dcfe2);}(_0x81d8,0x76));var _0x881d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x81d8[_0x432682];return _0x463d05;};'use strict';var _=require(_0x881d('0x0'));var util=require(_0x881d('0x1'));var logger=require(_0x881d('0x2'))(_0x881d('0x3'));var moment=require(_0x881d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x881d('0x5'));var config=require('../../config/environment');var attributes=require(_0x881d('0x6'));module[_0x881d('0x7')]=function(_0x186a06,_0x5e0653){return _0x186a06[_0x881d('0x8')](_0x881d('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x252a=['define','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x5f3875,_0x4a9e82){var _0xe45d00=function(_0x2c2948){while(--_0x2c2948){_0x5f3875['push'](_0x5f3875['shift']());}};_0xe45d00(++_0x4a9e82);}(_0x252a,0x156));var _0xa252=function(_0x415867,_0x82ca71){_0x415867=_0x415867-0x0;var _0x385bba=_0x252a[_0x415867];return _0x385bba;};'use strict';var _=require(_0xa252('0x0'));var util=require('util');var logger=require(_0xa252('0x1'))(_0xa252('0x2'));var moment=require(_0xa252('0x3'));var BPromise=require(_0xa252('0x4'));var rp=require(_0xa252('0x5'));var fs=require('fs');var path=require(_0xa252('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0xa252('0x7')]=function(_0x15242a,_0x5d644c){return _0x15242a[_0xa252('0x8')]('VtigerConfiguration',attributes,{'tableName':_0xa252('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index eed3329..ddd44a9 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 _0x03ab=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4ed5b0,_0x11d280){var _0x126535=function(_0x29384a){while(--_0x29384a){_0x4ed5b0['push'](_0x4ed5b0['shift']());}};_0x126535(++_0x11d280);}(_0x03ab,0x95));var _0xb03a=function(_0xbdc240,_0x314b7c){_0xbdc240=_0xbdc240-0x0;var _0x976e4=_0x03ab[_0xbdc240];return _0x976e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb03a('0x0'));var rs=require(_0xb03a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb03a('0x2'))['db'];var utils=require(_0xb03a('0x3'));var logger=require(_0xb03a('0x4'))(_0xb03a('0x5'));var config=require(_0xb03a('0x6'));var jayson=require(_0xb03a('0x7'));var client=jayson[_0xb03a('0x8')][_0xb03a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c3a74,_0x5d7338,_0x57db29){return new BPromise(function(_0x50bdd8,_0xb1516b){return client[_0xb03a('0xa')](_0x2c3a74,_0x57db29)['then'](function(_0x3fe31e){logger['info'](_0xb03a('0xb'),_0x5d7338,_0xb03a('0xc'));logger[_0xb03a('0xd')](_0xb03a('0xe'),_0x5d7338,_0xb03a('0xc'),JSON[_0xb03a('0xf')](_0x3fe31e));if(_0x3fe31e[_0xb03a('0x10')]){if(_0x3fe31e[_0xb03a('0x10')][_0xb03a('0x11')]===0x1f4){logger[_0xb03a('0x10')](_0xb03a('0xb'),_0x5d7338,_0x3fe31e[_0xb03a('0x10')][_0xb03a('0x12')]);return _0xb1516b(_0x3fe31e[_0xb03a('0x10')]['message']);}logger[_0xb03a('0x10')](_0xb03a('0xb'),_0x5d7338,_0x3fe31e[_0xb03a('0x10')][_0xb03a('0x12')]);return _0x50bdd8(_0x3fe31e[_0xb03a('0x10')][_0xb03a('0x12')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5d7338,_0xb03a('0xc'));_0x50bdd8(_0x3fe31e[_0xb03a('0x13')][_0xb03a('0x12')]);}})['catch'](function(_0x394574){logger['error'](_0xb03a('0xb'),_0x5d7338,_0x394574);_0xb1516b(_0x394574);});});} \ No newline at end of file +var _0x9ce9=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2ad4fe,_0x159fce){var _0x5ac8b4=function(_0x3606ef){while(--_0x3606ef){_0x2ad4fe['push'](_0x2ad4fe['shift']());}};_0x5ac8b4(++_0x159fce);}(_0x9ce9,0x8a));var _0x99ce=function(_0x56536c,_0x31cde7){_0x56536c=_0x56536c-0x0;var _0x33ab3b=_0x9ce9[_0x56536c];return _0x33ab3b;};'use strict';var _=require('lodash');var util=require(_0x99ce('0x0'));var moment=require(_0x99ce('0x1'));var BPromise=require(_0x99ce('0x2'));var rs=require(_0x99ce('0x3'));var fs=require('fs');var Redis=require(_0x99ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99ce('0x5'));var logger=require('../../config/logger')(_0x99ce('0x6'));var config=require(_0x99ce('0x7'));var jayson=require(_0x99ce('0x8'));var client=jayson['client'][_0x99ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4dc0d8,_0xe0a254,_0x43883f){return new BPromise(function(_0x201b77,_0x3b3ccc){return client[_0x99ce('0xa')](_0x4dc0d8,_0x43883f)[_0x99ce('0xb')](function(_0x376027){logger[_0x99ce('0xc')](_0x99ce('0xd'),_0xe0a254,_0x99ce('0xe'));logger[_0x99ce('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xe0a254,_0x99ce('0xe'),JSON['stringify'](_0x376027));if(_0x376027[_0x99ce('0x10')]){if(_0x376027[_0x99ce('0x10')][_0x99ce('0x11')]===0x1f4){logger[_0x99ce('0x10')](_0x99ce('0xd'),_0xe0a254,_0x376027['error']['message']);return _0x3b3ccc(_0x376027[_0x99ce('0x10')]['message']);}logger['error'](_0x99ce('0xd'),_0xe0a254,_0x376027[_0x99ce('0x10')][_0x99ce('0x12')]);return _0x201b77(_0x376027['error']['message']);}else{logger[_0x99ce('0xc')](_0x99ce('0xd'),_0xe0a254,'request\x20sent');_0x201b77(_0x376027[_0x99ce('0x13')][_0x99ce('0x12')]);}})[_0x99ce('0x14')](function(_0x1b13c9){logger['error'](_0x99ce('0xd'),_0xe0a254,_0x1b13c9);_0x3b3ccc(_0x1b13c9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index c74af82..a573457 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 _0x681d=['index','/:id','show','post','create','put','update','exports','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x33012e,_0xe1c4e3){var _0x3563ff=function(_0x433e4f){while(--_0x433e4f){_0x33012e['push'](_0x33012e['shift']());}};_0x3563ff(++_0xe1c4e3);}(_0x681d,0x1b8));var _0xd681=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x681d[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd681('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd681('0x1'));var auth=require(_0xd681('0x2'));var interaction=require(_0xd681('0x3'));var config=require(_0xd681('0x4'));var controller=require(_0xd681('0x5'));router[_0xd681('0x6')]('/',auth[_0xd681('0x7')](),controller[_0xd681('0x8')]);router[_0xd681('0x6')](_0xd681('0x9'),auth[_0xd681('0x7')](),controller[_0xd681('0xa')]);router[_0xd681('0xb')]('/',auth[_0xd681('0x7')](),controller[_0xd681('0xc')]);router[_0xd681('0xd')](_0xd681('0x9'),auth['isAuthenticated'](),controller[_0xd681('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd681('0xf')]=router; \ No newline at end of file +var _0x14fa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c3e95,_0x4f0d5c){var _0x14c5f1=function(_0x5d50bb){while(--_0x5d50bb){_0x4c3e95['push'](_0x4c3e95['shift']());}};_0x14c5f1(++_0x4f0d5c);}(_0x14fa,0x6c));var _0xa14f=function(_0x39f777,_0x2df0ad){_0x39f777=_0x39f777-0x0;var _0x2877e5=_0x14fa[_0x39f777];return _0x2877e5;};'use strict';var multer=require('multer');var util=require(_0xa14f('0x0'));var path=require(_0xa14f('0x1'));var timeout=require(_0xa14f('0x2'));var express=require(_0xa14f('0x3'));var router=express[_0xa14f('0x4')]();var fs_extra=require(_0xa14f('0x5'));var auth=require(_0xa14f('0x6'));var interaction=require(_0xa14f('0x7'));var config=require(_0xa14f('0x8'));var controller=require(_0xa14f('0x9'));router['get']('/',auth[_0xa14f('0xa')](),controller['index']);router['get'](_0xa14f('0xb'),auth[_0xa14f('0xa')](),controller[_0xa14f('0xc')]);router[_0xa14f('0xd')]('/',auth['isAuthenticated'](),controller[_0xa14f('0xe')]);router['put']('/:id',auth[_0xa14f('0xa')](),controller[_0xa14f('0xf')]);router[_0xa14f('0x10')](_0xa14f('0xb'),auth['isAuthenticated'](),controller[_0xa14f('0x11')]);module[_0xa14f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index fc51d10..6d4b9d4 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 _0x39d8=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x42e683,_0x546601){var _0x1ce805=function(_0x285d87){while(--_0x285d87){_0x42e683['push'](_0x42e683['shift']());}};_0x1ce805(++_0x546601);}(_0x39d8,0xb9));var _0x839d=function(_0x48788c,_0x22c6cf){_0x48788c=_0x48788c-0x0;var _0x111b0f=_0x39d8[_0x48788c];return _0x111b0f;};'use strict';var Sequelize=require(_0x839d('0x0'));module[_0x839d('0x1')]={'type':{'type':Sequelize[_0x839d('0x2')](_0x839d('0x3'),'variable','customVariable',_0x839d('0x4'),_0x839d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x839d('0x6')]},'key':{'type':Sequelize[_0x839d('0x6')]},'keyType':{'type':Sequelize[_0x839d('0x2')](_0x839d('0x3'),'variable',_0x839d('0x7'))},'keyContent':{'type':Sequelize[_0x839d('0x6')]},'idField':{'type':Sequelize[_0x839d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x839d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x839d('0x6')]}}; \ No newline at end of file +var _0x115c=['variable','BOOLEAN','exports','customVariable','keyValue','STRING','ENUM','string'];(function(_0x234265,_0x1fdcd1){var _0x412cdb=function(_0x4f5507){while(--_0x4f5507){_0x234265['push'](_0x234265['shift']());}};_0x412cdb(++_0x1fdcd1);}(_0x115c,0x18a));var _0xc115=function(_0x87cbb2,_0x458796){_0x87cbb2=_0x87cbb2-0x0;var _0x3af82c=_0x115c[_0x87cbb2];return _0x3af82c;};'use strict';var Sequelize=require('sequelize');module[_0xc115('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xc115('0x1'),_0xc115('0x2'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc115('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc115('0x4')](_0xc115('0x5'),_0xc115('0x6'),_0xc115('0x1'))},'keyContent':{'type':Sequelize[_0xc115('0x3')]},'idField':{'type':Sequelize[_0xc115('0x3')]},'nameField':{'type':Sequelize[_0xc115('0x3')]},'customField':{'type':Sequelize[_0xc115('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc115('0x3')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 6440561..cfec58f 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 _0x1058=['squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','reject','save','update','then','destroy','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x257c32,_0x5d9bd3){var _0x430a7b=function(_0x10df79){while(--_0x10df79){_0x257c32['push'](_0x257c32['shift']());}};_0x430a7b(++_0x5d9bd3);}(_0x1058,0x1e9));var _0x8105=function(_0x2f8493,_0x4a0d31){_0x2f8493=_0x2f8493-0x0;var _0x2c022b=_0x1058[_0x2f8493];return _0x2c022b;};'use strict';var emlformat=require(_0x8105('0x0'));var rimraf=require(_0x8105('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8105('0x2'));var rp=require(_0x8105('0x3'));var moment=require(_0x8105('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8105('0x5'));var util=require('util');var path=require(_0x8105('0x6'));var sox=require(_0x8105('0x7'));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(_0x8105('0x8'));var crypto=require(_0x8105('0x9'));var jsforce=require(_0x8105('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8105('0xb'));var querystring=require('querystring');var Papa=require(_0x8105('0xc'));var Redis=require(_0x8105('0xd'));var authService=require(_0x8105('0xe'));var qs=require(_0x8105('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8105('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x8105('0x11'));var config=require(_0x8105('0x12'));var licenseUtil=require(_0x8105('0x13'));var db=require(_0x8105('0x14'))['db'];function respondWithStatusCode(_0x34968a,_0x143321){_0x143321=_0x143321||0xcc;return function(_0x131a86){if(_0x131a86){return _0x34968a['sendStatus'](_0x143321);}return _0x34968a[_0x8105('0x15')](_0x143321)[_0x8105('0x16')]();};}function respondWithResult(_0x5b123d,_0xd8ae95){_0xd8ae95=_0xd8ae95||0xc8;return function(_0x4c8de2){if(_0x4c8de2){return _0x5b123d[_0x8105('0x15')](_0xd8ae95)[_0x8105('0x17')](_0x4c8de2);}};}function respondWithFilteredResult(_0x31c7d9,_0x25530e){return function(_0x4412dc){if(_0x4412dc){var _0x199827=typeof _0x25530e[_0x8105('0x18')]===_0x8105('0x19')&&typeof _0x25530e[_0x8105('0x1a')]===_0x8105('0x19');var _0x171941=_0x4412dc['count'];var _0x3292d8=_0x199827?0x0:_0x25530e[_0x8105('0x18')];var _0xc2d8e3=_0x199827?_0x4412dc['count']:_0x25530e[_0x8105('0x18')]+_0x25530e['limit'];var _0x1c3bbf;if(_0xc2d8e3>=_0x171941){_0xc2d8e3=_0x171941;_0x1c3bbf=0xc8;}else{_0x1c3bbf=0xce;}_0x31c7d9[_0x8105('0x15')](_0x1c3bbf);return _0x31c7d9[_0x8105('0x1b')]('Content-Range',_0x3292d8+'-'+_0xc2d8e3+'/'+_0x171941)[_0x8105('0x17')](_0x4412dc);}return null;};}function patchUpdates(_0x3cb903){return function(_0x4bdd65){try{jsonpatch['apply'](_0x4bdd65,_0x3cb903,!![]);}catch(_0x401eba){return BPromise[_0x8105('0x1c')](_0x401eba);}return _0x4bdd65[_0x8105('0x1d')]();};}function saveUpdates(_0x33e1c0,_0x40fcdc){return function(_0xb5b68c){if(_0xb5b68c){return _0xb5b68c[_0x8105('0x1e')](_0x33e1c0)[_0x8105('0x1f')](function(_0x264462){return _0x264462;});}return null;};}function removeEntity(_0x1dde35,_0x36add4){return function(_0x219253){if(_0x219253){return _0x219253[_0x8105('0x20')]()[_0x8105('0x1f')](function(){_0x1dde35[_0x8105('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2407e8,_0x2709b8){return function(_0x5256d4){if(!_0x5256d4){_0x2407e8['sendStatus'](0x194);}return _0x5256d4;};}function handleError(_0x326356,_0x4363a8){_0x4363a8=_0x4363a8||0x1f4;return function(_0x303e84){logger['error'](_0x303e84[_0x8105('0x21')]);if(_0x303e84[_0x8105('0x22')]){delete _0x303e84['name'];}_0x326356[_0x8105('0x15')](_0x4363a8)[_0x8105('0x23')](_0x303e84);};}exports['index']=function(_0x5a162d,_0x5bf40e){var _0x3b729d={},_0x542f8d={},_0x53a9ac={'count':0x0,'rows':[]};var _0x3bac5e=_['map'](db[_0x8105('0x24')][_0x8105('0x25')],function(_0x23a169){return{'name':_0x23a169[_0x8105('0x26')],'type':_0x23a169[_0x8105('0x27')][_0x8105('0x28')]};});_0x542f8d[_0x8105('0x29')]=_[_0x8105('0x2a')](_0x3bac5e,_0x8105('0x22'));_0x542f8d[_0x8105('0x2b')]=_['keys'](_0x5a162d[_0x8105('0x2b')]);_0x542f8d[_0x8105('0x2c')]=_[_0x8105('0x2d')](_0x542f8d[_0x8105('0x29')],_0x542f8d['query']);_0x3b729d[_0x8105('0x2e')]=_[_0x8105('0x2d')](_0x542f8d[_0x8105('0x29')],qs[_0x8105('0x2f')](_0x5a162d[_0x8105('0x2b')]['fields']));_0x3b729d[_0x8105('0x2e')]=_0x3b729d[_0x8105('0x2e')][_0x8105('0x30')]?_0x3b729d[_0x8105('0x2e')]:_0x542f8d[_0x8105('0x29')];if(!_0x5a162d[_0x8105('0x2b')][_0x8105('0x31')](_0x8105('0x32'))){_0x3b729d[_0x8105('0x1a')]=qs[_0x8105('0x1a')](_0x5a162d[_0x8105('0x2b')]['limit']);_0x3b729d['offset']=qs['offset'](_0x5a162d[_0x8105('0x2b')][_0x8105('0x18')]);}_0x3b729d[_0x8105('0x33')]=qs[_0x8105('0x34')](_0x5a162d['query'][_0x8105('0x34')]);_0x3b729d[_0x8105('0x35')]=qs[_0x8105('0x2c')](_[_0x8105('0x36')](_0x5a162d[_0x8105('0x2b')],_0x542f8d['filters']),_0x3bac5e);if(_0x5a162d[_0x8105('0x2b')]['filter']){_0x3b729d[_0x8105('0x35')]=_['merge'](_0x3b729d['where'],{'$or':_[_0x8105('0x2a')](_0x3bac5e,function(_0x1e42aa){if(_0x1e42aa[_0x8105('0x27')]!==_0x8105('0x37')){var _0x1168ce={};_0x1168ce[_0x1e42aa[_0x8105('0x22')]]={'$like':'%'+_0x5a162d['query'][_0x8105('0x38')]+'%'};return _0x1168ce;}})});}_0x3b729d=_[_0x8105('0x39')]({},_0x3b729d,_0x5a162d[_0x8105('0x3a')]);var _0xb6d85f={'where':_0x3b729d[_0x8105('0x35')]};return db[_0x8105('0x24')][_0x8105('0x3b')](_0xb6d85f)['then'](function(_0x416d9b){_0x53a9ac['count']=_0x416d9b;if(_0x5a162d[_0x8105('0x2b')]['includeAll']){_0x3b729d[_0x8105('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0x8105('0x3d')](_0x3b729d);})[_0x8105('0x1f')](function(_0x48426c){_0x53a9ac[_0x8105('0x3e')]=_0x48426c;return _0x53a9ac;})[_0x8105('0x1f')](respondWithFilteredResult(_0x5bf40e,_0x3b729d))[_0x8105('0x3f')](handleError(_0x5bf40e,null));};exports[_0x8105('0x40')]=function(_0x407449,_0x89b5ae){var _0x389cee={'raw':!![],'where':{'id':_0x407449['params']['id']}},_0x3d9f42={};_0x3d9f42[_0x8105('0x29')]=_[_0x8105('0x41')](db[_0x8105('0x24')][_0x8105('0x25')]);_0x3d9f42[_0x8105('0x2b')]=_[_0x8105('0x41')](_0x407449[_0x8105('0x2b')]);_0x3d9f42[_0x8105('0x2c')]=_[_0x8105('0x2d')](_0x3d9f42[_0x8105('0x29')],_0x3d9f42[_0x8105('0x2b')]);_0x389cee['attributes']=_[_0x8105('0x2d')](_0x3d9f42['model'],qs[_0x8105('0x2f')](_0x407449['query'][_0x8105('0x2f')]));_0x389cee[_0x8105('0x2e')]=_0x389cee[_0x8105('0x2e')][_0x8105('0x30')]?_0x389cee[_0x8105('0x2e')]:_0x3d9f42[_0x8105('0x29')];if(_0x407449[_0x8105('0x2b')][_0x8105('0x42')]){_0x389cee[_0x8105('0x3c')]=[{'all':!![]}];}_0x389cee=_['merge']({},_0x389cee,_0x407449[_0x8105('0x3a')]);return db['VtigerField'][_0x8105('0x43')](_0x389cee)[_0x8105('0x1f')](handleEntityNotFound(_0x89b5ae,null))[_0x8105('0x1f')](respondWithResult(_0x89b5ae,null))[_0x8105('0x3f')](handleError(_0x89b5ae,null));};exports['create']=function(_0x14416d,_0x5ea2f4){return db[_0x8105('0x24')][_0x8105('0x44')](_0x14416d[_0x8105('0x45')],{})[_0x8105('0x1f')](respondWithResult(_0x5ea2f4,0xc9))[_0x8105('0x3f')](handleError(_0x5ea2f4,null));};exports[_0x8105('0x1e')]=function(_0x494236,_0x1e937a){if(_0x494236['body']['id']){delete _0x494236['body']['id'];}return db['VtigerField'][_0x8105('0x43')]({'where':{'id':_0x494236[_0x8105('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e937a,null))['then'](saveUpdates(_0x494236['body'],null))[_0x8105('0x1f')](respondWithResult(_0x1e937a,null))['catch'](handleError(_0x1e937a,null));};exports[_0x8105('0x20')]=function(_0xe06255,_0x4c41f2){return db[_0x8105('0x24')][_0x8105('0x43')]({'where':{'id':_0xe06255[_0x8105('0x46')]['id']}})[_0x8105('0x1f')](handleEntityNotFound(_0x4c41f2,null))[_0x8105('0x1f')](removeEntity(_0x4c41f2,null))[_0x8105('0x3f')](handleError(_0x4c41f2,null));}; \ No newline at end of file +var _0x769e=['stack','name','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x769e,0xf0));var _0xe769=function(_0x2e1f6b,_0x27c83b){_0x2e1f6b=_0x2e1f6b-0x0;var _0xc7b98c=_0x769e[_0x2e1f6b];return _0xc7b98c;};'use strict';var emlformat=require(_0xe769('0x0'));var rimraf=require(_0xe769('0x1'));var zipdir=require(_0xe769('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe769('0x3'));var moment=require(_0xe769('0x4'));var BPromise=require(_0xe769('0x5'));var Mustache=require(_0xe769('0x6'));var util=require('util');var path=require(_0xe769('0x7'));var sox=require(_0xe769('0x8'));var csv=require('to-csv');var ejs=require(_0xe769('0x9'));var fs=require('fs');var fs_extra=require(_0xe769('0xa'));var _=require('lodash');var squel=require(_0xe769('0xb'));var crypto=require(_0xe769('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe769('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe769('0xe'));var Papa=require('papaparse');var Redis=require(_0xe769('0xf'));var authService=require(_0xe769('0x10'));var qs=require(_0xe769('0x11'));var as=require(_0xe769('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe769('0x13'));var utils=require(_0xe769('0x14'));var config=require(_0xe769('0x15'));var licenseUtil=require(_0xe769('0x16'));var db=require(_0xe769('0x17'))['db'];function respondWithStatusCode(_0x4e1686,_0x1db853){_0x1db853=_0x1db853||0xcc;return function(_0x53d73e){if(_0x53d73e){return _0x4e1686[_0xe769('0x18')](_0x1db853);}return _0x4e1686[_0xe769('0x19')](_0x1db853)[_0xe769('0x1a')]();};}function respondWithResult(_0x3b85fb,_0x35e17a){_0x35e17a=_0x35e17a||0xc8;return function(_0x1449cd){if(_0x1449cd){return _0x3b85fb[_0xe769('0x19')](_0x35e17a)['json'](_0x1449cd);}};}function respondWithFilteredResult(_0x5ae40f,_0x1d6a85){return function(_0x4ae431){if(_0x4ae431){var _0x51b088=typeof _0x1d6a85[_0xe769('0x1b')]===_0xe769('0x1c')&&typeof _0x1d6a85[_0xe769('0x1d')]===_0xe769('0x1c');var _0x4b81f7=_0x4ae431[_0xe769('0x1e')];var _0x43a661=_0x51b088?0x0:_0x1d6a85[_0xe769('0x1b')];var _0x3b885a=_0x51b088?_0x4ae431[_0xe769('0x1e')]:_0x1d6a85[_0xe769('0x1b')]+_0x1d6a85[_0xe769('0x1d')];var _0x164b0b;if(_0x3b885a>=_0x4b81f7){_0x3b885a=_0x4b81f7;_0x164b0b=0xc8;}else{_0x164b0b=0xce;}_0x5ae40f['status'](_0x164b0b);return _0x5ae40f[_0xe769('0x1f')]('Content-Range',_0x43a661+'-'+_0x3b885a+'/'+_0x4b81f7)['json'](_0x4ae431);}return null;};}function patchUpdates(_0x2b6f8c){return function(_0x335edf){try{jsonpatch[_0xe769('0x20')](_0x335edf,_0x2b6f8c,!![]);}catch(_0x3df75a){return BPromise[_0xe769('0x21')](_0x3df75a);}return _0x335edf['save']();};}function saveUpdates(_0x57bb8c,_0x56dff2){return function(_0x1ab304){if(_0x1ab304){return _0x1ab304['update'](_0x57bb8c)[_0xe769('0x22')](function(_0x57fbbf){return _0x57fbbf;});}return null;};}function removeEntity(_0x55dcdd,_0x5c070c){return function(_0xfd3e57){if(_0xfd3e57){return _0xfd3e57['destroy']()['then'](function(){_0x55dcdd[_0xe769('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8f9e,_0x38b9b7){return function(_0x41a034){if(!_0x41a034){_0x1c8f9e[_0xe769('0x18')](0x194);}return _0x41a034;};}function handleError(_0x2966c0,_0x4aad8f){_0x4aad8f=_0x4aad8f||0x1f4;return function(_0x432ea5){logger[_0xe769('0x23')](_0x432ea5[_0xe769('0x24')]);if(_0x432ea5[_0xe769('0x25')]){delete _0x432ea5[_0xe769('0x25')];}_0x2966c0[_0xe769('0x19')](_0x4aad8f)['send'](_0x432ea5);};}exports['index']=function(_0x391460,_0x4e1e6b){var _0x4d26ed={},_0x58403e={},_0x128f53={'count':0x0,'rows':[]};var _0x1ad319=_[_0xe769('0x26')](db[_0xe769('0x27')][_0xe769('0x28')],function(_0x26d716){return{'name':_0x26d716[_0xe769('0x29')],'type':_0x26d716[_0xe769('0x2a')][_0xe769('0x2b')]};});_0x58403e[_0xe769('0x2c')]=_[_0xe769('0x26')](_0x1ad319,_0xe769('0x25'));_0x58403e[_0xe769('0x2d')]=_[_0xe769('0x2e')](_0x391460[_0xe769('0x2d')]);_0x58403e['filters']=_[_0xe769('0x2f')](_0x58403e[_0xe769('0x2c')],_0x58403e[_0xe769('0x2d')]);_0x4d26ed[_0xe769('0x30')]=_[_0xe769('0x2f')](_0x58403e[_0xe769('0x2c')],qs['fields'](_0x391460[_0xe769('0x2d')]['fields']));_0x4d26ed[_0xe769('0x30')]=_0x4d26ed[_0xe769('0x30')][_0xe769('0x31')]?_0x4d26ed[_0xe769('0x30')]:_0x58403e[_0xe769('0x2c')];if(!_0x391460[_0xe769('0x2d')]['hasOwnProperty'](_0xe769('0x32'))){_0x4d26ed[_0xe769('0x1d')]=qs['limit'](_0x391460[_0xe769('0x2d')]['limit']);_0x4d26ed[_0xe769('0x1b')]=qs[_0xe769('0x1b')](_0x391460[_0xe769('0x2d')][_0xe769('0x1b')]);}_0x4d26ed[_0xe769('0x33')]=qs['sort'](_0x391460[_0xe769('0x2d')][_0xe769('0x34')]);_0x4d26ed[_0xe769('0x35')]=qs[_0xe769('0x36')](_['pick'](_0x391460[_0xe769('0x2d')],_0x58403e[_0xe769('0x36')]),_0x1ad319);if(_0x391460['query'][_0xe769('0x37')]){_0x4d26ed[_0xe769('0x35')]=_[_0xe769('0x38')](_0x4d26ed[_0xe769('0x35')],{'$or':_[_0xe769('0x26')](_0x1ad319,function(_0x34221f){if(_0x34221f[_0xe769('0x2a')]!==_0xe769('0x39')){var _0x2a8da2={};_0x2a8da2[_0x34221f[_0xe769('0x25')]]={'$like':'%'+_0x391460[_0xe769('0x2d')]['filter']+'%'};return _0x2a8da2;}})});}_0x4d26ed=_[_0xe769('0x38')]({},_0x4d26ed,_0x391460['options']);var _0x4ad5a4={'where':_0x4d26ed[_0xe769('0x35')]};return db[_0xe769('0x27')]['count'](_0x4ad5a4)[_0xe769('0x22')](function(_0xabaf37){_0x128f53[_0xe769('0x1e')]=_0xabaf37;if(_0x391460[_0xe769('0x2d')][_0xe769('0x3a')]){_0x4d26ed[_0xe769('0x3b')]=[{'all':!![]}];}return db['VtigerField'][_0xe769('0x3c')](_0x4d26ed);})['then'](function(_0x3cf24c){_0x128f53[_0xe769('0x3d')]=_0x3cf24c;return _0x128f53;})[_0xe769('0x22')](respondWithFilteredResult(_0x4e1e6b,_0x4d26ed))[_0xe769('0x3e')](handleError(_0x4e1e6b,null));};exports[_0xe769('0x3f')]=function(_0x454626,_0x3807fa){var _0x99d22a={'raw':!![],'where':{'id':_0x454626[_0xe769('0x40')]['id']}},_0x41044d={};_0x41044d[_0xe769('0x2c')]=_[_0xe769('0x2e')](db['VtigerField'][_0xe769('0x28')]);_0x41044d[_0xe769('0x2d')]=_['keys'](_0x454626[_0xe769('0x2d')]);_0x41044d['filters']=_[_0xe769('0x2f')](_0x41044d[_0xe769('0x2c')],_0x41044d[_0xe769('0x2d')]);_0x99d22a[_0xe769('0x30')]=_[_0xe769('0x2f')](_0x41044d[_0xe769('0x2c')],qs[_0xe769('0x41')](_0x454626['query'][_0xe769('0x41')]));_0x99d22a['attributes']=_0x99d22a[_0xe769('0x30')][_0xe769('0x31')]?_0x99d22a['attributes']:_0x41044d['model'];if(_0x454626['query'][_0xe769('0x3a')]){_0x99d22a[_0xe769('0x3b')]=[{'all':!![]}];}_0x99d22a=_[_0xe769('0x38')]({},_0x99d22a,_0x454626[_0xe769('0x42')]);return db[_0xe769('0x27')][_0xe769('0x43')](_0x99d22a)[_0xe769('0x22')](handleEntityNotFound(_0x3807fa,null))[_0xe769('0x22')](respondWithResult(_0x3807fa,null))[_0xe769('0x3e')](handleError(_0x3807fa,null));};exports['create']=function(_0x1c916b,_0x4f3a2b){return db[_0xe769('0x27')]['create'](_0x1c916b[_0xe769('0x44')],{})[_0xe769('0x22')](respondWithResult(_0x4f3a2b,0xc9))[_0xe769('0x3e')](handleError(_0x4f3a2b,null));};exports['update']=function(_0x11ef56,_0x1be83c){if(_0x11ef56[_0xe769('0x44')]['id']){delete _0x11ef56[_0xe769('0x44')]['id'];}return db[_0xe769('0x27')][_0xe769('0x43')]({'where':{'id':_0x11ef56[_0xe769('0x40')]['id']}})[_0xe769('0x22')](handleEntityNotFound(_0x1be83c,null))[_0xe769('0x22')](saveUpdates(_0x11ef56[_0xe769('0x44')],null))[_0xe769('0x22')](respondWithResult(_0x1be83c,null))['catch'](handleError(_0x1be83c,null));};exports['destroy']=function(_0x5a7747,_0x226b32){return db['VtigerField'][_0xe769('0x43')]({'where':{'id':_0x5a7747['params']['id']}})[_0xe769('0x22')](handleEntityNotFound(_0x226b32,null))[_0xe769('0x22')](removeEntity(_0x226b32,null))[_0xe769('0x3e')](handleError(_0x226b32,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3e505bf..f76d00e 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 _0x9b09=['../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x22ef2d,_0x41e9b4){var _0x3f81f5=function(_0x4c6702){while(--_0x4c6702){_0x22ef2d['push'](_0x22ef2d['shift']());}};_0x3f81f5(++_0x41e9b4);}(_0x9b09,0x81));var _0x99b0=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0x9b09[_0x30780e];return _0x5b9129;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var logger=require(_0x99b0('0x2'))(_0x99b0('0x3'));var moment=require('moment');var BPromise=require(_0x99b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b0('0x5'));var rimraf=require('rimraf');var config=require(_0x99b0('0x6'));var attributes=require(_0x99b0('0x7'));module[_0x99b0('0x8')]=function(_0x1e70e9,_0x460f38){return _0x1e70e9[_0x99b0('0x9')](_0x99b0('0xa'),attributes,{'tableName':_0x99b0('0xb'),'paranoid':![],'indexes':[{'name':_0x99b0('0xc'),'fields':[_0x99b0('0xd'),_0x99b0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf21f=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','VtigerField','vtiger_unique_index','lodash'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0xf21f,0x197));var _0xff21=function(_0x396dc6,_0x529342){_0x396dc6=_0x396dc6-0x0;var _0x285078=_0xf21f[_0x396dc6];return _0x285078;};'use strict';var _=require(_0xff21('0x0'));var util=require(_0xff21('0x1'));var logger=require(_0xff21('0x2'))(_0xff21('0x3'));var moment=require('moment');var BPromise=require(_0xff21('0x4'));var rp=require(_0xff21('0x5'));var fs=require('fs');var path=require(_0xff21('0x6'));var rimraf=require(_0xff21('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xff21('0x8')]=function(_0x538921,_0x62090a){return _0x538921[_0xff21('0x9')](_0xff21('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xff21('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 51246c7..93381ce 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 _0x992f=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x992f,0x1b7));var _0xf992=function(_0x7bbe1,_0xc05c4b){_0x7bbe1=_0x7bbe1-0x0;var _0x40051c=_0x992f[_0x7bbe1];return _0x40051c;};'use strict';var _=require(_0xf992('0x0'));var util=require(_0xf992('0x1'));var moment=require('moment');var BPromise=require(_0xf992('0x2'));var rs=require(_0xf992('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf992('0x4'))['db'];var utils=require(_0xf992('0x5'));var logger=require('../../config/logger')(_0xf992('0x6'));var config=require('../../config/environment');var jayson=require(_0xf992('0x7'));var client=jayson[_0xf992('0x8')][_0xf992('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc39da0,_0x5da4a7,_0x38628f){return new BPromise(function(_0x24d196,_0x1327f0){return client['request'](_0xc39da0,_0x38628f)[_0xf992('0xa')](function(_0x5c7751){logger['info'](_0xf992('0xb'),_0x5da4a7,_0xf992('0xc'));logger[_0xf992('0xd')](_0xf992('0xe'),_0x5da4a7,_0xf992('0xc'),JSON[_0xf992('0xf')](_0x5c7751));if(_0x5c7751['error']){if(_0x5c7751[_0xf992('0x10')][_0xf992('0x11')]===0x1f4){logger[_0xf992('0x10')](_0xf992('0xb'),_0x5da4a7,_0x5c7751[_0xf992('0x10')][_0xf992('0x12')]);return _0x1327f0(_0x5c7751[_0xf992('0x10')][_0xf992('0x12')]);}logger[_0xf992('0x10')](_0xf992('0xb'),_0x5da4a7,_0x5c7751['error'][_0xf992('0x12')]);return _0x24d196(_0x5c7751[_0xf992('0x10')]['message']);}else{logger['info'](_0xf992('0xb'),_0x5da4a7,_0xf992('0xc'));_0x24d196(_0x5c7751[_0xf992('0x13')]['message']);}})[_0xf992('0x14')](function(_0x3aae3e){logger[_0xf992('0x10')]('VtigerField,\x20%s,\x20%s',_0x5da4a7,_0x3aae3e);_0x1327f0(_0x3aae3e);});});} \ No newline at end of file +var _0x4af2=['client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3404f1,_0x24ec24){var _0x427bf4=function(_0x3094c2){while(--_0x3094c2){_0x3404f1['push'](_0x3404f1['shift']());}};_0x427bf4(++_0x24ec24);}(_0x4af2,0xa8));var _0x24af=function(_0x809c6e,_0x3265ce){_0x809c6e=_0x809c6e-0x0;var _0x350d9f=_0x4af2[_0x809c6e];return _0x350d9f;};'use strict';var _=require('lodash');var util=require(_0x24af('0x0'));var moment=require(_0x24af('0x1'));var BPromise=require(_0x24af('0x2'));var rs=require(_0x24af('0x3'));var fs=require('fs');var Redis=require(_0x24af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x24af('0x5'));var logger=require(_0x24af('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x24af('0x7'));var client=jayson[_0x24af('0x8')][_0x24af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x147dd2,_0x37eee8,_0x3e248b){return new BPromise(function(_0x7b63eb,_0x28ba5f){return client[_0x24af('0xa')](_0x147dd2,_0x3e248b)[_0x24af('0xb')](function(_0x443513){logger[_0x24af('0xc')]('VtigerField,\x20%s,\x20%s',_0x37eee8,_0x24af('0xd'));logger[_0x24af('0xe')](_0x24af('0xf'),_0x37eee8,'request\x20sent',JSON[_0x24af('0x10')](_0x443513));if(_0x443513[_0x24af('0x11')]){if(_0x443513[_0x24af('0x11')][_0x24af('0x12')]===0x1f4){logger[_0x24af('0x11')](_0x24af('0x13'),_0x37eee8,_0x443513[_0x24af('0x11')][_0x24af('0x14')]);return _0x28ba5f(_0x443513[_0x24af('0x11')][_0x24af('0x14')]);}logger[_0x24af('0x11')](_0x24af('0x13'),_0x37eee8,_0x443513[_0x24af('0x11')][_0x24af('0x14')]);return _0x7b63eb(_0x443513[_0x24af('0x11')]['message']);}else{logger['info'](_0x24af('0x13'),_0x37eee8,_0x24af('0xd'));_0x7b63eb(_0x443513[_0x24af('0x15')][_0x24af('0x14')]);}})['catch'](function(_0x4a9572){logger[_0x24af('0x11')](_0x24af('0x13'),_0x37eee8,_0x4a9572);_0x28ba5f(_0x4a9572);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3985c52..66bab4b 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 _0x5699=['create','/:id/configurations','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x3c02b5,_0x3cbafe){var _0x15d9db=function(_0x25f924){while(--_0x25f924){_0x3c02b5['push'](_0x3c02b5['shift']());}};_0x15d9db(++_0x3cbafe);}(_0x5699,0x148));var _0x9569=function(_0x357529,_0x3d8d99){_0x357529=_0x357529-0x0;var _0x504e8b=_0x5699[_0x357529];return _0x504e8b;};'use strict';var multer=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var path=require(_0x9569('0x2'));var timeout=require('connect-timeout');var express=require(_0x9569('0x3'));var router=express[_0x9569('0x4')]();var fs_extra=require(_0x9569('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9569('0x6'));var controller=require(_0x9569('0x7'));router['get']('/',auth[_0x9569('0x8')](),controller[_0x9569('0x9')]);router[_0x9569('0xa')](_0x9569('0xb'),auth[_0x9569('0x8')](),controller[_0x9569('0xc')]);router[_0x9569('0xa')]('/:id/configurations',auth[_0x9569('0x8')](),controller[_0x9569('0xd')]);router[_0x9569('0xa')](_0x9569('0xe'),auth[_0x9569('0x8')](),controller[_0x9569('0xf')]);router[_0x9569('0x10')]('/',auth['isAuthenticated'](),controller[_0x9569('0x11')]);router[_0x9569('0x10')](_0x9569('0x12'),auth[_0x9569('0x8')](),controller['addConfiguration']);router[_0x9569('0x13')](_0x9569('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9569('0x14')]('/:id',auth[_0x9569('0x8')](),controller[_0x9569('0x15')]);module[_0x9569('0x16')]=router; \ No newline at end of file +var _0x1d65=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x5eb477,_0x368386){var _0x8f821=function(_0x424e5e){while(--_0x424e5e){_0x5eb477['push'](_0x5eb477['shift']());}};_0x8f821(++_0x368386);}(_0x1d65,0x1d7));var _0x51d6=function(_0xa98385,_0x377f5b){_0xa98385=_0xa98385-0x0;var _0x171fbf=_0x1d65[_0xa98385];return _0x171fbf;};'use strict';var multer=require('multer');var util=require(_0x51d6('0x0'));var path=require(_0x51d6('0x1'));var timeout=require('connect-timeout');var express=require(_0x51d6('0x2'));var router=express[_0x51d6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x51d6('0x4'));var config=require('../../config/environment');var controller=require(_0x51d6('0x5'));router['get']('/',auth[_0x51d6('0x6')](),controller[_0x51d6('0x7')]);router[_0x51d6('0x8')](_0x51d6('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x51d6('0x8')](_0x51d6('0xa'),auth[_0x51d6('0x6')](),controller[_0x51d6('0xb')]);router[_0x51d6('0x8')](_0x51d6('0xc'),auth[_0x51d6('0x6')](),controller[_0x51d6('0xd')]);router[_0x51d6('0xe')]('/',auth[_0x51d6('0x6')](),controller[_0x51d6('0xf')]);router[_0x51d6('0xe')](_0x51d6('0xa'),auth['isAuthenticated'](),controller[_0x51d6('0x10')]);router[_0x51d6('0x11')](_0x51d6('0x9'),auth[_0x51d6('0x6')](),controller[_0x51d6('0x12')]);router[_0x51d6('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x51d6('0x14')]);module[_0x51d6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 79b0e54..0f7ab63 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 _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x41ec,0x143));var _0xc41e=function(_0x20e115,_0x5772f4){_0x20e115=_0x20e115-0x0;var _0x2fe18e=_0x41ec[_0x20e115];return _0x2fe18e;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}}; \ No newline at end of file +var _0xd117=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x30b743,_0x17f18a){var _0x25c137=function(_0x3cba97){while(--_0x3cba97){_0x30b743['push'](_0x30b743['shift']());}};_0x25c137(++_0x17f18a);}(_0xd117,0x182));var _0x7d11=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0xd117[_0x57fa33];return _0x12e724;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'password':{'type':Sequelize[_0x7d11('0x2')]},'token':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'authType':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6'),_0x7d11('0x7')),'defaultValue':_0x7d11('0x6')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x5')]('integrationTab',_0x7d11('0x8')),'defaultValue':_0x7d11('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index abb9f70..5be1337 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 _0xd914=['channel','ZendeskField','username','token','authType','remoteUri','substring','lastIndexOf','format','%s/%s','ticket_fields','password','headers','%s:%s','Basic\x20%s','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','group','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','pick','map','options','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd914,0x17f));var _0x4d91=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xd914[_0x296897];return _0x2b44ab;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];var integrations=require(_0x4d91('0x1b'));function respondWithStatusCode(_0x318e0c,_0x4ea591){_0x4ea591=_0x4ea591||0xcc;return function(_0x577a69){if(_0x577a69){return _0x318e0c[_0x4d91('0x1c')](_0x4ea591);}return _0x318e0c[_0x4d91('0x1d')](_0x4ea591)[_0x4d91('0x1e')]();};}function respondWithResult(_0x3c9fd6,_0x33fbd4){_0x33fbd4=_0x33fbd4||0xc8;return function(_0x25bafc){if(_0x25bafc){return _0x3c9fd6[_0x4d91('0x1d')](_0x33fbd4)['json'](_0x25bafc);}};}function respondWithFilteredResult(_0x3a8ec9,_0x42631a){return function(_0x1e2ef7){if(_0x1e2ef7){var _0xb92681=typeof _0x42631a[_0x4d91('0x1f')]==='undefined'&&typeof _0x42631a[_0x4d91('0x20')]===_0x4d91('0x21');var _0x241564=_0x1e2ef7[_0x4d91('0x22')];var _0x4cfa40=_0xb92681?0x0:_0x42631a[_0x4d91('0x1f')];var _0x3b579b=_0xb92681?_0x1e2ef7[_0x4d91('0x22')]:_0x42631a['offset']+_0x42631a[_0x4d91('0x20')];var _0x127911;if(_0x3b579b>=_0x241564){_0x3b579b=_0x241564;_0x127911=0xc8;}else{_0x127911=0xce;}_0x3a8ec9[_0x4d91('0x1d')](_0x127911);return _0x3a8ec9[_0x4d91('0x23')](_0x4d91('0x24'),_0x4cfa40+'-'+_0x3b579b+'/'+_0x241564)[_0x4d91('0x25')](_0x1e2ef7);}return null;};}function patchUpdates(_0xc1d44f){return function(_0x193ca9){try{jsonpatch[_0x4d91('0x26')](_0x193ca9,_0xc1d44f,!![]);}catch(_0x226d85){return BPromise['reject'](_0x226d85);}return _0x193ca9[_0x4d91('0x27')]();};}function saveUpdates(_0x5f5236,_0x57913e){return function(_0x74a697){if(_0x74a697){return _0x74a697[_0x4d91('0x28')](_0x5f5236)[_0x4d91('0x29')](function(_0x9cb864){return _0x9cb864;});}return null;};}function removeEntity(_0x7d8cbf,_0x12b722){return function(_0x100cd4){if(_0x100cd4){return _0x100cd4[_0x4d91('0x2a')]()['then'](function(){_0x7d8cbf['status'](0xcc)[_0x4d91('0x1e')]();});}};}function handleEntityNotFound(_0x112923,_0x3bed98){return function(_0x45fc91){if(!_0x45fc91){_0x112923[_0x4d91('0x1c')](0x194);}return _0x45fc91;};}function handleError(_0x2c7d7a,_0x14bdb4){_0x14bdb4=_0x14bdb4||0x1f4;return function(_0x560966){logger[_0x4d91('0x2b')](_0x560966[_0x4d91('0x2c')]);if(_0x560966[_0x4d91('0x2d')]){delete _0x560966['name'];}_0x2c7d7a['status'](_0x14bdb4)[_0x4d91('0x2e')](_0x560966);};}exports[_0x4d91('0x2f')]=function(_0x5ed948,_0x50fe76){var _0x42d5a0={},_0x2d6981={},_0x43371e={'count':0x0,'rows':[]};var _0x17c7bc=_['map'](db[_0x4d91('0x30')][_0x4d91('0x31')],function(_0x468e95){return{'name':_0x468e95[_0x4d91('0x32')],'type':_0x468e95[_0x4d91('0x33')][_0x4d91('0x34')]};});_0x2d6981[_0x4d91('0x35')]=_['map'](_0x17c7bc,_0x4d91('0x2d'));_0x2d6981['query']=_['keys'](_0x5ed948[_0x4d91('0x36')]);_0x2d6981[_0x4d91('0x37')]=_['intersection'](_0x2d6981[_0x4d91('0x35')],_0x2d6981[_0x4d91('0x36')]);_0x42d5a0[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x2d6981[_0x4d91('0x35')],qs['fields'](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x42d5a0[_0x4d91('0x38')]=_0x42d5a0[_0x4d91('0x38')][_0x4d91('0x3b')]?_0x42d5a0[_0x4d91('0x38')]:_0x2d6981['model'];if(!_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3c')]('nolimit')){_0x42d5a0[_0x4d91('0x20')]=qs[_0x4d91('0x20')](_0x5ed948[_0x4d91('0x36')]['limit']);_0x42d5a0[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x1f')]);}_0x42d5a0['order']=qs[_0x4d91('0x3d')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x42d5a0[_0x4d91('0x3e')]=qs['filters'](_['pick'](_0x5ed948[_0x4d91('0x36')],_0x2d6981[_0x4d91('0x37')]),_0x17c7bc);if(_0x5ed948['query'][_0x4d91('0x3f')]){_0x42d5a0[_0x4d91('0x3e')]=_[_0x4d91('0x40')](_0x42d5a0[_0x4d91('0x3e')],{'$or':_['map'](_0x17c7bc,function(_0x2eb7c7){if(_0x2eb7c7[_0x4d91('0x33')]!=='VIRTUAL'){var _0x1ba6cd={};_0x1ba6cd[_0x2eb7c7['name']]={'$like':'%'+_0x5ed948[_0x4d91('0x36')]['filter']+'%'};return _0x1ba6cd;}})});}_0x42d5a0=_[_0x4d91('0x40')]({},_0x42d5a0,_0x5ed948['options']);var _0x24fc69={'where':_0x42d5a0[_0x4d91('0x3e')]};return db[_0x4d91('0x30')][_0x4d91('0x22')](_0x24fc69)['then'](function(_0x5bcc9b){_0x43371e[_0x4d91('0x22')]=_0x5bcc9b;if(_0x5ed948['query'][_0x4d91('0x41')]){_0x42d5a0[_0x4d91('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4d91('0x43')](_0x42d5a0);})[_0x4d91('0x29')](function(_0x14db37){_0x43371e[_0x4d91('0x44')]=_0x14db37;return _0x43371e;})[_0x4d91('0x29')](respondWithFilteredResult(_0x50fe76,_0x42d5a0))[_0x4d91('0x45')](handleError(_0x50fe76,null));};exports[_0x4d91('0x46')]=function(_0x4f6254,_0x1e4c6d){var _0x4c70af={'raw':![],'where':{'id':_0x4f6254[_0x4d91('0x47')]['id']}},_0x41c06a={};_0x41c06a[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x30')][_0x4d91('0x31')]);_0x41c06a['query']=_['keys'](_0x4f6254[_0x4d91('0x36')]);_0x41c06a[_0x4d91('0x37')]=_['intersection'](_0x41c06a[_0x4d91('0x35')],_0x41c06a[_0x4d91('0x36')]);_0x4c70af[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x41c06a[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x4f6254[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x4c70af[_0x4d91('0x38')]=_0x4c70af['attributes']['length']?_0x4c70af[_0x4d91('0x38')]:_0x41c06a['model'];if(_0x4f6254[_0x4d91('0x36')][_0x4d91('0x41')]){_0x4c70af[_0x4d91('0x42')]=[{'all':!![]}];}_0x4c70af=_[_0x4d91('0x40')]({},_0x4c70af,_0x4f6254['options']);return db[_0x4d91('0x30')]['find'](_0x4c70af)['then'](handleEntityNotFound(_0x1e4c6d,null))[_0x4d91('0x29')](respondWithResult(_0x1e4c6d,null))[_0x4d91('0x45')](handleError(_0x1e4c6d,null));};exports[_0x4d91('0x49')]=function(_0xa03d75,_0x1f91ec){return db[_0x4d91('0x30')]['create'](_0xa03d75[_0x4d91('0x4a')],{})[_0x4d91('0x29')](respondWithResult(_0x1f91ec,0xc9))[_0x4d91('0x45')](handleError(_0x1f91ec,null));};exports[_0x4d91('0x28')]=function(_0x106e5b,_0x44e9ec){if(_0x106e5b[_0x4d91('0x4a')]['id']){delete _0x106e5b[_0x4d91('0x4a')]['id'];}return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x106e5b[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x44e9ec,null))[_0x4d91('0x29')](saveUpdates(_0x106e5b['body'],null))[_0x4d91('0x29')](respondWithResult(_0x44e9ec,null))[_0x4d91('0x45')](handleError(_0x44e9ec,null));};exports[_0x4d91('0x2a')]=function(_0x386935,_0x436a3d){return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x386935[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x436a3d,null))[_0x4d91('0x29')](removeEntity(_0x436a3d,null))[_0x4d91('0x45')](handleError(_0x436a3d,null));};exports[_0x4d91('0x4c')]=function(_0x2bba43,_0x26ecd7,_0x19e57e){var _0x5765ce={};var _0x4aae23={};var _0x392cc3;var _0x2159e4;return db[_0x4d91('0x30')][_0x4d91('0x4d')]({'where':{'id':_0x2bba43[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x26ecd7,null))[_0x4d91('0x29')](function(_0x4138c5){if(_0x4138c5){_0x392cc3=_0x4138c5;_0x4aae23[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x4e')][_0x4d91('0x31')]);_0x4aae23[_0x4d91('0x36')]=_[_0x4d91('0x48')](_0x2bba43[_0x4d91('0x36')]);_0x4aae23[_0x4d91('0x37')]=_[_0x4d91('0x39')](_0x4aae23['model'],_0x4aae23['query']);_0x5765ce['attributes']=_[_0x4d91('0x39')](_0x4aae23[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x2bba43['query'][_0x4d91('0x3a')]));_0x5765ce[_0x4d91('0x38')]=_0x5765ce[_0x4d91('0x38')]['length']?_0x5765ce['attributes']:_0x4aae23['model'];_0x5765ce[_0x4d91('0x4f')]=qs[_0x4d91('0x3d')](_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x5765ce[_0x4d91('0x3e')]=qs['filters'](_[_0x4d91('0x50')](_0x2bba43[_0x4d91('0x36')],_0x4aae23['filters']));if(_0x2bba43['query'][_0x4d91('0x3f')]){_0x5765ce['where']=_[_0x4d91('0x40')](_0x5765ce[_0x4d91('0x3e')],{'$or':_[_0x4d91('0x51')](_0x5765ce['attributes'],function(_0x2e0bff){var _0x3d6c26={};_0x3d6c26[_0x2e0bff]={'$like':'%'+_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3f')]+'%'};return _0x3d6c26;})});}_0x5765ce=_[_0x4d91('0x40')]({},_0x5765ce,_0x2bba43[_0x4d91('0x52')]);return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})['then'](function(_0x533572){if(_0x533572){_0x2159e4=_0x533572['length'];if(!_0x2bba43['query'][_0x4d91('0x3c')](_0x4d91('0x53'))){_0x5765ce[_0x4d91('0x20')]=qs['limit'](_0x2bba43[_0x4d91('0x36')]['limit']);_0x5765ce[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x2bba43['query']['offset']);}return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})[_0x4d91('0x29')](function(_0x31150f){if(_0x31150f){return _0x31150f?{'count':_0x2159e4,'rows':_0x31150f}:null;}})[_0x4d91('0x29')](respondWithResult(_0x26ecd7,null))[_0x4d91('0x45')](handleError(_0x26ecd7,null));};exports[_0x4d91('0x54')]=function(_0x7a94e2,_0x42e550,_0xd384a9){if(_0x7a94e2[_0x4d91('0x4a')]['id']){delete _0x7a94e2['body']['id'];}return db['ZendeskAccount'][_0x4d91('0x4d')]({'where':{'id':_0x7a94e2[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x42e550,null))[_0x4d91('0x29')](function(_0x16ba26){if(_0x16ba26){_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x55')]=_0x16ba26['id'];_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x56')]=integrations['getSubjects'](_0x7a94e2['body']['channel'],_0x7a94e2['body'][_0x4d91('0x33')]);_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x57')]=integrations[_0x4d91('0x58')](_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x59')],_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x33')]);return db[_0x4d91('0x4e')][_0x4d91('0x49')](_0x7a94e2[_0x4d91('0x4a')],{'include':[{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x56')},{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x57')}]});}return null;})[_0x4d91('0x29')](respondWithResult(_0x42e550,null))[_0x4d91('0x45')](handleError(_0x42e550,null));};exports['getFields']=function(_0x4062c6,_0x1be4b1,_0xc4ef10){var _0x2e2105='';return db[_0x4d91('0x30')]['findOne']({'where':{'id':_0x4062c6[_0x4d91('0x47')]['id']},'attributes':['id',_0x4d91('0x5b'),'password',_0x4d91('0x5c'),_0x4d91('0x5d'),_0x4d91('0x5e')]})[_0x4d91('0x29')](handleEntityNotFound(_0x1be4b1,null))[_0x4d91('0x29')](function(_0x4bc5a0){if(_0x4bc5a0){_0x2e2105=_0x4bc5a0[_0x4d91('0x5e')];var _0x2a5bc0=_0x2e2105['slice'](-0x1);if(_0x2a5bc0==='/'){_0x2e2105=_0x2e2105[_0x4d91('0x5f')](0x0,_0x2e2105[_0x4d91('0x60')](_0x2a5bc0));}var _0xd94b29={'method':'GET','uri':util[_0x4d91('0x61')](_0x4d91('0x62'),_0x2e2105,_0x4d91('0x63')),'json':!![]};switch(_0x4bc5a0[_0x4d91('0x5d')]){case _0x4d91('0x64'):_0xd94b29[_0x4d91('0x65')]={'Authorization':util[_0x4d91('0x61')]('Basic\x20%s',new Buffer(util[_0x4d91('0x61')](_0x4d91('0x66'),_0x4bc5a0['username'],_0x4bc5a0[_0x4d91('0x64')]))['toString']('base64'))};break;case _0x4d91('0x5c'):_0xd94b29['headers']={'Authorization':util[_0x4d91('0x61')](_0x4d91('0x67'),new Buffer(util[_0x4d91('0x61')](_0x4d91('0x68'),_0x4bc5a0[_0x4d91('0x5b')],_0x4bc5a0[_0x4d91('0x5c')]))[_0x4d91('0x69')]('base64'))};break;default:throw new db['Sequelize'][(_0x4d91('0x6a'))](_0x4d91('0x6b'));}return rp(_0xd94b29);}})[_0x4d91('0x29')](function(_0x42164f){if(_0x42164f){var _0x1e3838=['subject','description',_0x4d91('0x6c'),'assignee'];_['remove'](_0x42164f[_0x4d91('0x63')],function(_0x54fea8){return _0x1e3838['includes'](_0x54fea8[_0x4d91('0x33')]);});return{'count':_0x42164f[_0x4d91('0x63')][_0x4d91('0x3b')],'rows':_['map'](_0x42164f['ticket_fields'],function(_0x52604d){return{'id':_0x52604d['id'],'name':_0x52604d[_0x4d91('0x6d')]>0x7?_0x52604d[_0x4d91('0x6e')]:_0x52604d[_0x4d91('0x33')],'custom':_0x52604d[_0x4d91('0x6d')]>0x7?!![]:![],'options':_0x52604d[_0x4d91('0x6f')]?_0x52604d[_0x4d91('0x6f')]:_0x52604d[_0x4d91('0x70')]?_0x52604d[_0x4d91('0x70')]:[]};})};}})[_0x4d91('0x29')](respondWithResult(_0x1be4b1,null))['catch'](function(_0xb9d1ff){var _0x579a9e=_0x4062c6['query'][_0x4d91('0x71')]?0x1f4:_0xb9d1ff[_0x4d91('0x72')]||0x1f4;logger[_0x4d91('0x2b')](_0x4d91('0x73'),'getFields',_0x579a9e,JSON[_0x4d91('0x74')](_0xb9d1ff));delete _0xb9d1ff[_0x4d91('0x2d')];if(_0x579a9e===0x191){_0x579a9e=0x190;}_0x1be4b1[_0x4d91('0x1d')](_0x579a9e)[_0x4d91('0x2e')](_0x4062c6[_0x4d91('0x36')][_0x4d91('0x71')]?{'message':_0x4d91('0x75'),'statusCode':_0xb9d1ff['statusCode']}:_0xb9d1ff);});}; \ No newline at end of file +var _0xc788=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','title','position','system_field_options','custom_field_options','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','keys'];(function(_0x3c8138,_0x397b7d){var _0x3c8d87=function(_0xd021a8){while(--_0xd021a8){_0x3c8138['push'](_0x3c8138['shift']());}};_0x3c8d87(++_0x397b7d);}(_0xc788,0xc4));var _0x8c78=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xc788[_0x176d14];return _0x89522c;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a802,_0x349dfa){_0x349dfa=_0x349dfa||0xcc;return function(_0x1b1d0e){if(_0x1b1d0e){return _0x56a802[_0x8c78('0x18')](_0x349dfa);}return _0x56a802[_0x8c78('0x19')](_0x349dfa)[_0x8c78('0x1a')]();};}function respondWithResult(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xc8;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x19')](_0xe5f8ae)[_0x8c78('0x1b')](_0x930233);}};}function respondWithFilteredResult(_0x4ff4b0,_0x1fa78e){return function(_0x293cfe){if(_0x293cfe){var _0x57ad11=typeof _0x1fa78e[_0x8c78('0x1c')]===_0x8c78('0x1d')&&typeof _0x1fa78e[_0x8c78('0x1e')]===_0x8c78('0x1d');var _0x2a982c=_0x293cfe[_0x8c78('0x1f')];var _0x54eafa=_0x57ad11?0x0:_0x1fa78e['offset'];var _0x339d04=_0x57ad11?_0x293cfe['count']:_0x1fa78e['offset']+_0x1fa78e[_0x8c78('0x1e')];var _0x56c191;if(_0x339d04>=_0x2a982c){_0x339d04=_0x2a982c;_0x56c191=0xc8;}else{_0x56c191=0xce;}_0x4ff4b0[_0x8c78('0x19')](_0x56c191);return _0x4ff4b0[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x339d04+'/'+_0x2a982c)[_0x8c78('0x1b')](_0x293cfe);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){_0x20f483[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x1d1cef,_0x49cccb){return function(_0x331bfe){if(!_0x331bfe){_0x1d1cef['sendStatus'](0x194);}return _0x331bfe;};}function handleError(_0xe85d05,_0x24f9a7){_0x24f9a7=_0x24f9a7||0x1f4;return function(_0x8d9ff9){logger['error'](_0x8d9ff9[_0x8c78('0x27')]);if(_0x8d9ff9[_0x8c78('0x28')]){delete _0x8d9ff9['name'];}_0xe85d05[_0x8c78('0x19')](_0x24f9a7)[_0x8c78('0x29')](_0x8d9ff9);};}exports[_0x8c78('0x2a')]=function(_0x36e8e5,_0x253776){var _0x2ab5cc={},_0x5ba7d4={},_0x1c3039={'count':0x0,'rows':[]};var _0x51add6=_[_0x8c78('0x2b')](db[_0x8c78('0x2c')][_0x8c78('0x2d')],function(_0x4e764f){return{'name':_0x4e764f[_0x8c78('0x2e')],'type':_0x4e764f[_0x8c78('0x2f')]['key']};});_0x5ba7d4[_0x8c78('0x30')]=_[_0x8c78('0x2b')](_0x51add6,_0x8c78('0x28'));_0x5ba7d4['query']=_[_0x8c78('0x31')](_0x36e8e5[_0x8c78('0x32')]);_0x5ba7d4[_0x8c78('0x33')]=_['intersection'](_0x5ba7d4[_0x8c78('0x30')],_0x5ba7d4[_0x8c78('0x32')]);_0x2ab5cc['attributes']=_[_0x8c78('0x34')](_0x5ba7d4[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x35')]));_0x2ab5cc[_0x8c78('0x36')]=_0x2ab5cc[_0x8c78('0x36')][_0x8c78('0x37')]?_0x2ab5cc[_0x8c78('0x36')]:_0x5ba7d4[_0x8c78('0x30')];if(!_0x36e8e5['query'][_0x8c78('0x38')](_0x8c78('0x39'))){_0x2ab5cc[_0x8c78('0x1e')]=qs[_0x8c78('0x1e')](_0x36e8e5[_0x8c78('0x32')]['limit']);_0x2ab5cc[_0x8c78('0x1c')]=qs[_0x8c78('0x1c')](_0x36e8e5[_0x8c78('0x32')]['offset']);}_0x2ab5cc[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x36e8e5['query'][_0x8c78('0x3b')]);_0x2ab5cc['where']=qs[_0x8c78('0x33')](_[_0x8c78('0x3c')](_0x36e8e5[_0x8c78('0x32')],_0x5ba7d4[_0x8c78('0x33')]),_0x51add6);if(_0x36e8e5['query'][_0x8c78('0x3d')]){_0x2ab5cc['where']=_[_0x8c78('0x3e')](_0x2ab5cc[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x51add6,function(_0x5ae2aa){if(_0x5ae2aa['type']!==_0x8c78('0x40')){var _0x25d143={};_0x25d143[_0x5ae2aa[_0x8c78('0x28')]]={'$like':'%'+_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x25d143;}})});}_0x2ab5cc=_[_0x8c78('0x3e')]({},_0x2ab5cc,_0x36e8e5[_0x8c78('0x41')]);var _0x314679={'where':_0x2ab5cc[_0x8c78('0x3f')]};return db[_0x8c78('0x2c')][_0x8c78('0x1f')](_0x314679)[_0x8c78('0x25')](function(_0x234d0e){_0x1c3039['count']=_0x234d0e;if(_0x36e8e5[_0x8c78('0x32')][_0x8c78('0x42')]){_0x2ab5cc['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8c78('0x43')](_0x2ab5cc);})[_0x8c78('0x25')](function(_0x5c9af3){_0x1c3039[_0x8c78('0x44')]=_0x5c9af3;return _0x1c3039;})[_0x8c78('0x25')](respondWithFilteredResult(_0x253776,_0x2ab5cc))['catch'](handleError(_0x253776,null));};exports[_0x8c78('0x45')]=function(_0x27603f,_0x57e2c7){var _0x10d521={'raw':![],'where':{'id':_0x27603f[_0x8c78('0x46')]['id']}},_0x24a8ea={};_0x24a8ea[_0x8c78('0x30')]=_[_0x8c78('0x31')](db['ZendeskAccount']['rawAttributes']);_0x24a8ea[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x27603f[_0x8c78('0x32')]);_0x24a8ea[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],_0x24a8ea[_0x8c78('0x32')]);_0x10d521[_0x8c78('0x36')]=_[_0x8c78('0x34')](_0x24a8ea[_0x8c78('0x30')],qs[_0x8c78('0x35')](_0x27603f['query'][_0x8c78('0x35')]));_0x10d521[_0x8c78('0x36')]=_0x10d521[_0x8c78('0x36')][_0x8c78('0x37')]?_0x10d521[_0x8c78('0x36')]:_0x24a8ea['model'];if(_0x27603f[_0x8c78('0x32')][_0x8c78('0x42')]){_0x10d521[_0x8c78('0x47')]=[{'all':!![]}];}_0x10d521=_[_0x8c78('0x3e')]({},_0x10d521,_0x27603f[_0x8c78('0x41')]);return db['ZendeskAccount'][_0x8c78('0x48')](_0x10d521)['then'](handleEntityNotFound(_0x57e2c7,null))['then'](respondWithResult(_0x57e2c7,null))[_0x8c78('0x49')](handleError(_0x57e2c7,null));};exports[_0x8c78('0x4a')]=function(_0x61e20,_0x5a5f3b){return db[_0x8c78('0x2c')][_0x8c78('0x4a')](_0x61e20[_0x8c78('0x4b')],{})[_0x8c78('0x25')](respondWithResult(_0x5a5f3b,0xc9))[_0x8c78('0x49')](handleError(_0x5a5f3b,null));};exports[_0x8c78('0x24')]=function(_0x26103c,_0x1f5cdb){if(_0x26103c[_0x8c78('0x4b')]['id']){delete _0x26103c['body']['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x26103c[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x1f5cdb,null))['then'](saveUpdates(_0x26103c[_0x8c78('0x4b')],null))[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,null))[_0x8c78('0x49')](handleError(_0x1f5cdb,null));};exports[_0x8c78('0x26')]=function(_0x53e75c,_0x336b95){return db[_0x8c78('0x2c')][_0x8c78('0x48')]({'where':{'id':_0x53e75c['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x336b95,null))['then'](removeEntity(_0x336b95,null))[_0x8c78('0x49')](handleError(_0x336b95,null));};exports[_0x8c78('0x4c')]=function(_0x402faa,_0xa87aba,_0x349b87){var _0x462b89={};var _0xf68e0={};var _0x38fec1;var _0x19d807;return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x402faa[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0xa87aba,null))[_0x8c78('0x25')](function(_0x54b40d){if(_0x54b40d){_0x38fec1=_0x54b40d;_0xf68e0[_0x8c78('0x30')]=_[_0x8c78('0x31')](db[_0x8c78('0x4e')][_0x8c78('0x2d')]);_0xf68e0['query']=_[_0x8c78('0x31')](_0x402faa[_0x8c78('0x32')]);_0xf68e0[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],_0xf68e0[_0x8c78('0x32')]);_0x462b89['attributes']=_[_0x8c78('0x34')](_0xf68e0[_0x8c78('0x30')],qs['fields'](_0x402faa[_0x8c78('0x32')]['fields']));_0x462b89[_0x8c78('0x36')]=_0x462b89[_0x8c78('0x36')][_0x8c78('0x37')]?_0x462b89[_0x8c78('0x36')]:_0xf68e0[_0x8c78('0x30')];_0x462b89[_0x8c78('0x3a')]=qs[_0x8c78('0x3b')](_0x402faa['query'][_0x8c78('0x3b')]);_0x462b89[_0x8c78('0x3f')]=qs['filters'](_[_0x8c78('0x3c')](_0x402faa[_0x8c78('0x32')],_0xf68e0['filters']));if(_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]){_0x462b89[_0x8c78('0x3f')]=_[_0x8c78('0x3e')](_0x462b89[_0x8c78('0x3f')],{'$or':_[_0x8c78('0x2b')](_0x462b89[_0x8c78('0x36')],function(_0x445630){var _0x20a0d9={};_0x20a0d9[_0x445630]={'$like':'%'+_0x402faa[_0x8c78('0x32')][_0x8c78('0x3d')]+'%'};return _0x20a0d9;})});}_0x462b89=_[_0x8c78('0x3e')]({},_0x462b89,_0x402faa[_0x8c78('0x41')]);return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x3897ea){if(_0x3897ea){_0x19d807=_0x3897ea['length'];if(!_0x402faa[_0x8c78('0x32')]['hasOwnProperty']('nolimit')){_0x462b89['limit']=qs[_0x8c78('0x1e')](_0x402faa['query']['limit']);_0x462b89['offset']=qs[_0x8c78('0x1c')](_0x402faa[_0x8c78('0x32')][_0x8c78('0x1c')]);}return _0x38fec1[_0x8c78('0x4c')](_0x462b89);}})['then'](function(_0x333272){if(_0x333272){return _0x333272?{'count':_0x19d807,'rows':_0x333272}:null;}})[_0x8c78('0x25')](respondWithResult(_0xa87aba,null))[_0x8c78('0x49')](handleError(_0xa87aba,null));};exports[_0x8c78('0x4f')]=function(_0x334d0a,_0x3c3332,_0x3990c2){if(_0x334d0a[_0x8c78('0x4b')]['id']){delete _0x334d0a[_0x8c78('0x4b')]['id'];}return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x334d0a[_0x8c78('0x46')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3c3332,null))[_0x8c78('0x25')](function(_0x4bdb7e){if(_0x4bdb7e){_0x334d0a[_0x8c78('0x4b')]['AccountId']=_0x4bdb7e['id'];_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x50')]=integrations[_0x8c78('0x51')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);_0x334d0a['body'][_0x8c78('0x53')]=integrations[_0x8c78('0x54')](_0x334d0a['body'][_0x8c78('0x52')],_0x334d0a[_0x8c78('0x4b')][_0x8c78('0x2f')]);return db['ZendeskConfiguration'][_0x8c78('0x4a')](_0x334d0a[_0x8c78('0x4b')],{'include':[{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x50')},{'model':db[_0x8c78('0x55')],'as':_0x8c78('0x53')}]});}return null;})[_0x8c78('0x25')](respondWithResult(_0x3c3332,null))[_0x8c78('0x49')](handleError(_0x3c3332,null));};exports[_0x8c78('0x56')]=function(_0x5646ff,_0x1f2b8f,_0x21b400){var _0x3c6886='';return db[_0x8c78('0x2c')][_0x8c78('0x4d')]({'where':{'id':_0x5646ff[_0x8c78('0x46')]['id']},'attributes':['id',_0x8c78('0x57'),_0x8c78('0x58'),_0x8c78('0x59'),'authType',_0x8c78('0x5a')]})[_0x8c78('0x25')](handleEntityNotFound(_0x1f2b8f,null))['then'](function(_0x5e6a23){if(_0x5e6a23){_0x3c6886=_0x5e6a23[_0x8c78('0x5a')];var _0x4dbb47=_0x3c6886[_0x8c78('0x5b')](-0x1);if(_0x4dbb47==='/'){_0x3c6886=_0x3c6886[_0x8c78('0x5c')](0x0,_0x3c6886[_0x8c78('0x5d')](_0x4dbb47));}var _0x476835={'method':_0x8c78('0x5e'),'uri':util[_0x8c78('0x5f')]('%s/%s',_0x3c6886,'ticket_fields'),'json':!![]};switch(_0x5e6a23[_0x8c78('0x60')]){case _0x8c78('0x58'):_0x476835[_0x8c78('0x61')]={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x63'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x58')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;case _0x8c78('0x59'):_0x476835['headers']={'Authorization':util[_0x8c78('0x5f')](_0x8c78('0x62'),new Buffer(util['format'](_0x8c78('0x66'),_0x5e6a23[_0x8c78('0x57')],_0x5e6a23[_0x8c78('0x59')]))[_0x8c78('0x64')](_0x8c78('0x65')))};break;default:throw new db[(_0x8c78('0x67'))][(_0x8c78('0x68'))](_0x8c78('0x69'));}return rp(_0x476835);}})[_0x8c78('0x25')](function(_0x402cff){if(_0x402cff){var _0x280a8b=[_0x8c78('0x6a'),_0x8c78('0x6b'),_0x8c78('0x6c'),_0x8c78('0x6d')];_[_0x8c78('0x6e')](_0x402cff[_0x8c78('0x6f')],function(_0x4c6cc5){return _0x280a8b[_0x8c78('0x70')](_0x4c6cc5['type']);});return{'count':_0x402cff['ticket_fields'][_0x8c78('0x37')],'rows':_[_0x8c78('0x2b')](_0x402cff[_0x8c78('0x6f')],function(_0x3b3c51){return{'id':_0x3b3c51['id'],'name':_0x3b3c51['position']>0x7?_0x3b3c51[_0x8c78('0x71')]:_0x3b3c51[_0x8c78('0x2f')],'custom':_0x3b3c51[_0x8c78('0x72')]>0x7?!![]:![],'options':_0x3b3c51['system_field_options']?_0x3b3c51[_0x8c78('0x73')]:_0x3b3c51[_0x8c78('0x74')]?_0x3b3c51[_0x8c78('0x74')]:[]};})};}})[_0x8c78('0x25')](respondWithResult(_0x1f2b8f,null))['catch'](function(_0xfff9a5){var _0x837c68=_0x5646ff['query']['test']?0x1f4:_0xfff9a5['statusCode']||0x1f4;logger[_0x8c78('0x75')](_0x8c78('0x76'),_0x8c78('0x56'),_0x837c68,JSON[_0x8c78('0x77')](_0xfff9a5));delete _0xfff9a5['name'];if(_0x837c68===0x191){_0x837c68=0x190;}_0x1f2b8f[_0x8c78('0x19')](_0x837c68)['send'](_0x5646ff[_0x8c78('0x32')][_0x8c78('0x78')]?{'message':_0x8c78('0x79'),'statusCode':_0xfff9a5[_0x8c78('0x7a')]}:_0xfff9a5);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index fa679ef..1ab6547 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 _0x4af9=['define','ZendeskAccount','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x390e87,_0x193d7a){var _0x2f14ee=function(_0x1b0b72){while(--_0x1b0b72){_0x390e87['push'](_0x390e87['shift']());}};_0x2f14ee(++_0x193d7a);}(_0x4af9,0x188));var _0x94af=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4af9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x94af('0x0'));var util=require(_0x94af('0x1'));var logger=require(_0x94af('0x2'))(_0x94af('0x3'));var moment=require(_0x94af('0x4'));var BPromise=require(_0x94af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94af('0x6'));var rimraf=require('rimraf');var config=require(_0x94af('0x7'));var attributes=require(_0x94af('0x8'));var integrations=require(_0x94af('0x9'));module[_0x94af('0xa')]=function(_0x10e81e,_0x4463cf){return _0x10e81e[_0x94af('0xb')](_0x94af('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ac0=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x5a51c1,_0x394c67){var _0x38f5fb=function(_0xa5d3d0){while(--_0xa5d3d0){_0x5a51c1['push'](_0x5a51c1['shift']());}};_0x38f5fb(++_0x394c67);}(_0x2ac0,0xcc));var _0x02ac=function(_0x5087d1,_0x51b4af){_0x5087d1=_0x5087d1-0x0;var _0x224afb=_0x2ac0[_0x5087d1];return _0x224afb;};'use strict';var _=require(_0x02ac('0x0'));var util=require(_0x02ac('0x1'));var logger=require(_0x02ac('0x2'))(_0x02ac('0x3'));var moment=require(_0x02ac('0x4'));var BPromise=require(_0x02ac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02ac('0x6'));var rimraf=require('rimraf');var config=require(_0x02ac('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x02ac('0x8'));module[_0x02ac('0x9')]=function(_0x1ffdd4,_0x4d3d24){return _0x1ffdd4[_0x02ac('0xa')](_0x02ac('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 9ef61fe..f49f0a9 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 _0xbeb1=['limit','include','model','ShowZendeskAccount','ZendeskAccount','find','map','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xbeb1,0x9b));var _0x1beb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbeb1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1beb('0x0'));var util=require(_0x1beb('0x1'));var moment=require(_0x1beb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1beb('0x3'));var db=require(_0x1beb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1beb('0x5'))(_0x1beb('0x6'));var config=require(_0x1beb('0x7'));var jayson=require(_0x1beb('0x8'));var client=jayson[_0x1beb('0x9')][_0x1beb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1149d7,_0x3c0db7,_0x25aa9d){return new BPromise(function(_0xffab57,_0x5ece76){return client[_0x1beb('0xb')](_0x1149d7,_0x25aa9d)[_0x1beb('0xc')](function(_0x11af3c){logger[_0x1beb('0xd')](_0x1beb('0xe'),_0x3c0db7,_0x1beb('0xf'));logger[_0x1beb('0x10')](_0x1beb('0x11'),_0x3c0db7,_0x1beb('0xf'),JSON[_0x1beb('0x12')](_0x11af3c));if(_0x11af3c[_0x1beb('0x13')]){if(_0x11af3c[_0x1beb('0x13')][_0x1beb('0x14')]===0x1f4){logger[_0x1beb('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x3c0db7,_0x11af3c[_0x1beb('0x13')]['message']);return _0x5ece76(_0x11af3c['error'][_0x1beb('0x15')]);}logger[_0x1beb('0x13')](_0x1beb('0xe'),_0x3c0db7,_0x11af3c[_0x1beb('0x13')]['message']);return _0xffab57(_0x11af3c[_0x1beb('0x13')][_0x1beb('0x15')]);}else{logger[_0x1beb('0xd')](_0x1beb('0xe'),_0x3c0db7,_0x1beb('0xf'));_0xffab57(_0x11af3c[_0x1beb('0x16')][_0x1beb('0x15')]);}})[_0x1beb('0x17')](function(_0x48c464){logger[_0x1beb('0x13')](_0x1beb('0xe'),_0x3c0db7,_0x48c464);_0x5ece76(_0x48c464);});});}exports[_0x1beb('0x18')]=function(_0x4fa492){var _0x45dfad=this;return new Promise(function(_0x1e249c,_0x144797){return db['ZendeskAccount'][_0x1beb('0x19')]({'raw':_0x4fa492[_0x1beb('0x1a')]?_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fa492['options']?_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1c')]||null:null,'attributes':_0x4fa492[_0x1beb('0x1a')]?_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1d')]||null:null,'limit':_0x4fa492[_0x1beb('0x1a')]?_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1e')]||null:null,'include':_0x4fa492[_0x1beb('0x1a')]?_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1f')]?_['map'](_0x4fa492[_0x1beb('0x1a')][_0x1beb('0x1f')],function(_0x195289){return{'model':db[_0x195289['model']],'as':_0x195289['as'],'attributes':_0x195289[_0x1beb('0x1d')],'include':_0x195289[_0x1beb('0x1f')]?_['map'](_0x195289[_0x1beb('0x1f')],function(_0x171875){return{'model':db[_0x171875[_0x1beb('0x20')]],'as':_0x171875['as'],'attributes':_0x171875['attributes'],'include':_0x171875[_0x1beb('0x1f')]?_['map'](_0x171875[_0x1beb('0x1f')],function(_0x48ec76){return{'model':db[_0x48ec76[_0x1beb('0x20')]],'as':_0x48ec76['as'],'attributes':_0x48ec76[_0x1beb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1beb('0xc')](function(_0x160283){logger[_0x1beb('0xd')](_0x1beb('0x18'),_0x4fa492);logger[_0x1beb('0x10')](_0x1beb('0x18'),_0x4fa492,JSON[_0x1beb('0x12')](_0x160283));_0x1e249c(_0x160283);})[_0x1beb('0x17')](function(_0x38cf4a){logger[_0x1beb('0x13')](_0x1beb('0x18'),_0x38cf4a[_0x1beb('0x15')],_0x4fa492);_0x144797(_0x45dfad[_0x1beb('0x13')](0x1f4,_0x38cf4a[_0x1beb('0x15')]));});});};exports[_0x1beb('0x21')]=function(_0x41975a){var _0x47ad58=this;return new Promise(function(_0x4b54bd,_0x201ee4){return db[_0x1beb('0x22')][_0x1beb('0x23')]({'raw':_0x41975a[_0x1beb('0x1a')]?_0x41975a['options'][_0x1beb('0x1b')]===undefined?!![]:![]:!![],'where':_0x41975a[_0x1beb('0x1a')]?_0x41975a['options'][_0x1beb('0x1c')]||null:null,'attributes':_0x41975a['options']?_0x41975a[_0x1beb('0x1a')][_0x1beb('0x1d')]||null:null,'include':_0x41975a[_0x1beb('0x1a')]?_0x41975a[_0x1beb('0x1a')][_0x1beb('0x1f')]?_['map'](_0x41975a[_0x1beb('0x1a')][_0x1beb('0x1f')],function(_0xf0fdaa){return{'model':db[_0xf0fdaa[_0x1beb('0x20')]],'as':_0xf0fdaa['as'],'attributes':_0xf0fdaa[_0x1beb('0x1d')],'include':_0xf0fdaa[_0x1beb('0x1f')]?_[_0x1beb('0x24')](_0xf0fdaa[_0x1beb('0x1f')],function(_0x31361e){return{'model':db[_0x31361e[_0x1beb('0x20')]],'as':_0x31361e['as'],'attributes':_0x31361e[_0x1beb('0x1d')],'include':_0x31361e[_0x1beb('0x1f')]?_[_0x1beb('0x24')](_0x31361e[_0x1beb('0x1f')],function(_0x8e167b){return{'model':db[_0x8e167b[_0x1beb('0x20')]],'as':_0x8e167b['as'],'attributes':_0x8e167b[_0x1beb('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7a4f55){logger[_0x1beb('0xd')]('ShowZendeskAccount',_0x41975a);logger[_0x1beb('0x10')](_0x1beb('0x21'),_0x41975a,JSON['stringify'](_0x7a4f55));_0x4b54bd(_0x7a4f55);})['catch'](function(_0x511821){logger[_0x1beb('0x13')]('ShowZendeskAccount',_0x511821[_0x1beb('0x15')],_0x41975a);_0x201ee4(_0x47ad58[_0x1beb('0x13')](0x1f4,_0x511821['message']));});});}; \ No newline at end of file +var _0xa3d8=['message','request\x20sent','result','GetZendeskAccount','ZendeskAccount','options','attributes','limit','include','model','ShowZendeskAccount','find','raw','where','map','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x225d03,_0x167de5){var _0x10dc42=function(_0x4a9d30){while(--_0x4a9d30){_0x225d03['push'](_0x225d03['shift']());}};_0x10dc42(++_0x167de5);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x483f18,_0x8c648c){_0x483f18=_0x483f18-0x0;var _0x1920ca=_0xa3d8[_0x483f18];return _0x1920ca;};'use strict';var _=require(_0x8a3d('0x0'));var util=require('util');var moment=require(_0x8a3d('0x1'));var BPromise=require(_0x8a3d('0x2'));var rs=require(_0x8a3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a3d('0x4'))['db'];var utils=require(_0x8a3d('0x5'));var logger=require(_0x8a3d('0x6'))(_0x8a3d('0x7'));var config=require(_0x8a3d('0x8'));var jayson=require(_0x8a3d('0x9'));var client=jayson[_0x8a3d('0xa')][_0x8a3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc7a9,_0x43510b,_0x5b473d){return new BPromise(function(_0x3dbdfc,_0x444047){return client[_0x8a3d('0xc')](_0x3bc7a9,_0x5b473d)[_0x8a3d('0xd')](function(_0x1e968f){logger[_0x8a3d('0xe')](_0x8a3d('0xf'),_0x43510b,'request\x20sent');logger[_0x8a3d('0x10')](_0x8a3d('0x11'),_0x43510b,'request\x20sent',JSON[_0x8a3d('0x12')](_0x1e968f));if(_0x1e968f[_0x8a3d('0x13')]){if(_0x1e968f[_0x8a3d('0x13')][_0x8a3d('0x14')]===0x1f4){logger[_0x8a3d('0x13')](_0x8a3d('0xf'),_0x43510b,_0x1e968f['error'][_0x8a3d('0x15')]);return _0x444047(_0x1e968f[_0x8a3d('0x13')][_0x8a3d('0x15')]);}logger[_0x8a3d('0x13')](_0x8a3d('0xf'),_0x43510b,_0x1e968f[_0x8a3d('0x13')][_0x8a3d('0x15')]);return _0x3dbdfc(_0x1e968f[_0x8a3d('0x13')][_0x8a3d('0x15')]);}else{logger[_0x8a3d('0xe')](_0x8a3d('0xf'),_0x43510b,_0x8a3d('0x16'));_0x3dbdfc(_0x1e968f[_0x8a3d('0x17')][_0x8a3d('0x15')]);}})['catch'](function(_0x41a17d){logger[_0x8a3d('0x13')](_0x8a3d('0xf'),_0x43510b,_0x41a17d);_0x444047(_0x41a17d);});});}exports[_0x8a3d('0x18')]=function(_0x533b6e){var _0x1dee8a=this;return new Promise(function(_0x5e7737,_0x3651d6){return db[_0x8a3d('0x19')]['findAll']({'raw':_0x533b6e[_0x8a3d('0x1a')]?_0x533b6e['options']['raw']===undefined?!![]:![]:!![],'where':_0x533b6e[_0x8a3d('0x1a')]?_0x533b6e['options']['where']||null:null,'attributes':_0x533b6e[_0x8a3d('0x1a')]?_0x533b6e[_0x8a3d('0x1a')][_0x8a3d('0x1b')]||null:null,'limit':_0x533b6e['options']?_0x533b6e[_0x8a3d('0x1a')][_0x8a3d('0x1c')]||null:null,'include':_0x533b6e['options']?_0x533b6e[_0x8a3d('0x1a')]['include']?_['map'](_0x533b6e['options'][_0x8a3d('0x1d')],function(_0x4687d3){return{'model':db[_0x4687d3[_0x8a3d('0x1e')]],'as':_0x4687d3['as'],'attributes':_0x4687d3[_0x8a3d('0x1b')],'include':_0x4687d3[_0x8a3d('0x1d')]?_['map'](_0x4687d3[_0x8a3d('0x1d')],function(_0x57b9be){return{'model':db[_0x57b9be[_0x8a3d('0x1e')]],'as':_0x57b9be['as'],'attributes':_0x57b9be[_0x8a3d('0x1b')],'include':_0x57b9be['include']?_['map'](_0x57b9be[_0x8a3d('0x1d')],function(_0x3662a0){return{'model':db[_0x3662a0[_0x8a3d('0x1e')]],'as':_0x3662a0['as'],'attributes':_0x3662a0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10d30f){logger['info']('GetZendeskAccount',_0x533b6e);logger['debug'](_0x8a3d('0x18'),_0x533b6e,JSON[_0x8a3d('0x12')](_0x10d30f));_0x5e7737(_0x10d30f);})['catch'](function(_0x14ebf0){logger[_0x8a3d('0x13')](_0x8a3d('0x18'),_0x14ebf0[_0x8a3d('0x15')],_0x533b6e);_0x3651d6(_0x1dee8a[_0x8a3d('0x13')](0x1f4,_0x14ebf0[_0x8a3d('0x15')]));});});};exports[_0x8a3d('0x1f')]=function(_0x547f23){var _0x30d809=this;return new Promise(function(_0x2ae04f,_0x6e358e){return db[_0x8a3d('0x19')][_0x8a3d('0x20')]({'raw':_0x547f23[_0x8a3d('0x1a')]?_0x547f23[_0x8a3d('0x1a')][_0x8a3d('0x21')]===undefined?!![]:![]:!![],'where':_0x547f23[_0x8a3d('0x1a')]?_0x547f23[_0x8a3d('0x1a')][_0x8a3d('0x22')]||null:null,'attributes':_0x547f23[_0x8a3d('0x1a')]?_0x547f23[_0x8a3d('0x1a')][_0x8a3d('0x1b')]||null:null,'include':_0x547f23[_0x8a3d('0x1a')]?_0x547f23[_0x8a3d('0x1a')][_0x8a3d('0x1d')]?_[_0x8a3d('0x23')](_0x547f23[_0x8a3d('0x1a')][_0x8a3d('0x1d')],function(_0x1886d5){return{'model':db[_0x1886d5[_0x8a3d('0x1e')]],'as':_0x1886d5['as'],'attributes':_0x1886d5[_0x8a3d('0x1b')],'include':_0x1886d5[_0x8a3d('0x1d')]?_[_0x8a3d('0x23')](_0x1886d5['include'],function(_0x3fb9cb){return{'model':db[_0x3fb9cb[_0x8a3d('0x1e')]],'as':_0x3fb9cb['as'],'attributes':_0x3fb9cb[_0x8a3d('0x1b')],'include':_0x3fb9cb[_0x8a3d('0x1d')]?_[_0x8a3d('0x23')](_0x3fb9cb[_0x8a3d('0x1d')],function(_0x2c09ac){return{'model':db[_0x2c09ac[_0x8a3d('0x1e')]],'as':_0x2c09ac['as'],'attributes':_0x2c09ac[_0x8a3d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8a3d('0xd')](function(_0x58a3de){logger[_0x8a3d('0xe')]('ShowZendeskAccount',_0x547f23);logger[_0x8a3d('0x10')](_0x8a3d('0x1f'),_0x547f23,JSON[_0x8a3d('0x12')](_0x58a3de));_0x2ae04f(_0x58a3de);})[_0x8a3d('0x24')](function(_0x3c371f){logger[_0x8a3d('0x13')]('ShowZendeskAccount',_0x3c371f[_0x8a3d('0x15')],_0x547f23);_0x6e358e(_0x30d809[_0x8a3d('0x13')](0x1f4,_0x3c371f[_0x8a3d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index cc5f534..2fd30b9 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x478597,_0x9327f1){var _0x4f5e6c=function(_0x26d95f){while(--_0x26d95f){_0x478597['push'](_0x478597['shift']());}};_0x4f5e6c(++_0x9327f1);}(_0xe706,0xa3));var _0x6e70=function(_0x182094,_0x269200){_0x182094=_0x182094-0x0;var _0x2e74ff=_0xe706[_0x182094];return _0x2e74ff;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6d25cdf..ccde37f 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 _0x3547=['STRING','sequelize'];(function(_0x31a153,_0x138418){var _0x5b5171=function(_0x183cd7){while(--_0x183cd7){_0x31a153['push'](_0x31a153['shift']());}};_0x5b5171(++_0x138418);}(_0x3547,0xa3));var _0x7354=function(_0x100a56,_0x5b4d26){_0x100a56=_0x100a56-0x0;var _0x3beb37=_0x3547[_0x100a56];return _0x3beb37;};'use strict';var Sequelize=require(_0x7354('0x0'));module['exports']={'name':{'type':Sequelize[_0x7354('0x1')]},'description':{'type':Sequelize[_0x7354('0x1')]}}; \ No newline at end of file +var _0x8b0b=['exports','STRING'];(function(_0xee27cf,_0x3f97a7){var _0x4c0e9d=function(_0x461da0){while(--_0x461da0){_0xee27cf['push'](_0xee27cf['shift']());}};_0x4c0e9d(++_0x3f97a7);}(_0x8b0b,0x1c0));var _0xb8b0=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x8b0b[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require('sequelize');module[_0xb8b0('0x0')]={'name':{'type':Sequelize[_0xb8b0('0x1')]},'description':{'type':Sequelize[_0xb8b0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 5b79dad..d3d25b0 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 _0x978d=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','fields','find','create','body','params','findOne','ZendeskField','getFields','length','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x49f9c5,_0x3c549e){var _0x43b265=function(_0x425ac7){while(--_0x425ac7){_0x49f9c5['push'](_0x49f9c5['shift']());}};_0x43b265(++_0x3c549e);}(_0x978d,0xe7));var _0xd978=function(_0x4b5ead,_0x2757b9){_0x4b5ead=_0x4b5ead-0x0;var _0x1ec0d2=_0x978d[_0x4b5ead];return _0x1ec0d2;};'use strict';var emlformat=require(_0xd978('0x0'));var rimraf=require(_0xd978('0x1'));var zipdir=require(_0xd978('0x2'));var jsonpatch=require(_0xd978('0x3'));var rp=require(_0xd978('0x4'));var moment=require('moment');var BPromise=require(_0xd978('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd978('0x6'));var sox=require(_0xd978('0x7'));var csv=require(_0xd978('0x8'));var ejs=require(_0xd978('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd978('0xa'));var squel=require(_0xd978('0xb'));var crypto=require(_0xd978('0xc'));var jsforce=require(_0xd978('0xd'));var deskjs=require(_0xd978('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd978('0xf'));var Papa=require(_0xd978('0x10'));var Redis=require(_0xd978('0x11'));var authService=require(_0xd978('0x12'));var qs=require(_0xd978('0x13'));var as=require(_0xd978('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd978('0x15'))(_0xd978('0x16'));var utils=require(_0xd978('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd978('0x18'));var db=require(_0xd978('0x19'))['db'];function respondWithStatusCode(_0xcaa459,_0x321168){_0x321168=_0x321168||0xcc;return function(_0x586883){if(_0x586883){return _0xcaa459[_0xd978('0x1a')](_0x321168);}return _0xcaa459['status'](_0x321168)[_0xd978('0x1b')]();};}function respondWithResult(_0x1900cb,_0x4467eb){_0x4467eb=_0x4467eb||0xc8;return function(_0x28f36c){if(_0x28f36c){return _0x1900cb[_0xd978('0x1c')](_0x4467eb)[_0xd978('0x1d')](_0x28f36c);}};}function respondWithFilteredResult(_0x3dcaac,_0x59fef4){return function(_0x469109){if(_0x469109){var _0x34a4f0=typeof _0x59fef4[_0xd978('0x1e')]===_0xd978('0x1f')&&typeof _0x59fef4[_0xd978('0x20')]===_0xd978('0x1f');var _0x1559be=_0x469109['count'];var _0x5c94d3=_0x34a4f0?0x0:_0x59fef4[_0xd978('0x1e')];var _0x2c644e=_0x34a4f0?_0x469109[_0xd978('0x21')]:_0x59fef4['offset']+_0x59fef4[_0xd978('0x20')];var _0x29c652;if(_0x2c644e>=_0x1559be){_0x2c644e=_0x1559be;_0x29c652=0xc8;}else{_0x29c652=0xce;}_0x3dcaac[_0xd978('0x1c')](_0x29c652);return _0x3dcaac[_0xd978('0x22')](_0xd978('0x23'),_0x5c94d3+'-'+_0x2c644e+'/'+_0x1559be)[_0xd978('0x1d')](_0x469109);}return null;};}function patchUpdates(_0x2a8aec){return function(_0x2368d1){try{jsonpatch[_0xd978('0x24')](_0x2368d1,_0x2a8aec,!![]);}catch(_0x32c32a){return BPromise[_0xd978('0x25')](_0x32c32a);}return _0x2368d1[_0xd978('0x26')]();};}function saveUpdates(_0x1af343,_0x5c10da){return function(_0x144f73){if(_0x144f73){return _0x144f73['update'](_0x1af343)[_0xd978('0x27')](function(_0x258a40){return _0x258a40;});}return null;};}function removeEntity(_0x5db226,_0xfba652){return function(_0x477506){if(_0x477506){return _0x477506[_0xd978('0x28')]()[_0xd978('0x27')](function(){_0x5db226[_0xd978('0x1c')](0xcc)[_0xd978('0x1b')]();});}};}function handleEntityNotFound(_0x5b35b8,_0xa5b1d2){return function(_0x2e356a){if(!_0x2e356a){_0x5b35b8[_0xd978('0x1a')](0x194);}return _0x2e356a;};}function handleError(_0x3aff08,_0x4146c6){_0x4146c6=_0x4146c6||0x1f4;return function(_0x58f545){logger[_0xd978('0x29')](_0x58f545[_0xd978('0x2a')]);if(_0x58f545[_0xd978('0x2b')]){delete _0x58f545['name'];}_0x3aff08[_0xd978('0x1c')](_0x4146c6)[_0xd978('0x2c')](_0x58f545);};}exports[_0xd978('0x2d')]=function(_0x15f599,_0x572540){var _0x35ae77={},_0x5120b={},_0x2dc1be={'count':0x0,'rows':[]};var _0x36493e=_[_0xd978('0x2e')](db[_0xd978('0x2f')][_0xd978('0x30')],function(_0x530ea9){return{'name':_0x530ea9[_0xd978('0x31')],'type':_0x530ea9['type'][_0xd978('0x32')]};});_0x5120b[_0xd978('0x33')]=_[_0xd978('0x2e')](_0x36493e,'name');_0x5120b[_0xd978('0x34')]=_[_0xd978('0x35')](_0x15f599[_0xd978('0x34')]);_0x5120b[_0xd978('0x36')]=_[_0xd978('0x37')](_0x5120b[_0xd978('0x33')],_0x5120b['query']);_0x35ae77['attributes']=_[_0xd978('0x37')](_0x5120b['model'],qs['fields'](_0x15f599[_0xd978('0x34')]['fields']));_0x35ae77[_0xd978('0x38')]=_0x35ae77[_0xd978('0x38')]['length']?_0x35ae77['attributes']:_0x5120b[_0xd978('0x33')];if(!_0x15f599['query']['hasOwnProperty'](_0xd978('0x39'))){_0x35ae77['limit']=qs[_0xd978('0x20')](_0x15f599['query'][_0xd978('0x20')]);_0x35ae77[_0xd978('0x1e')]=qs['offset'](_0x15f599[_0xd978('0x34')][_0xd978('0x1e')]);}_0x35ae77[_0xd978('0x3a')]=qs[_0xd978('0x3b')](_0x15f599[_0xd978('0x34')][_0xd978('0x3b')]);_0x35ae77[_0xd978('0x3c')]=qs[_0xd978('0x36')](_[_0xd978('0x3d')](_0x15f599[_0xd978('0x34')],_0x5120b['filters']),_0x36493e);if(_0x15f599[_0xd978('0x34')][_0xd978('0x3e')]){_0x35ae77['where']=_[_0xd978('0x3f')](_0x35ae77['where'],{'$or':_['map'](_0x36493e,function(_0x1432dd){if(_0x1432dd[_0xd978('0x40')]!=='VIRTUAL'){var _0x51dd4b={};_0x51dd4b[_0x1432dd[_0xd978('0x2b')]]={'$like':'%'+_0x15f599[_0xd978('0x34')][_0xd978('0x3e')]+'%'};return _0x51dd4b;}})});}_0x35ae77=_['merge']({},_0x35ae77,_0x15f599[_0xd978('0x41')]);var _0x49c41e={'where':_0x35ae77[_0xd978('0x3c')]};return db[_0xd978('0x2f')][_0xd978('0x21')](_0x49c41e)['then'](function(_0x475db2){_0x2dc1be[_0xd978('0x21')]=_0x475db2;if(_0x15f599[_0xd978('0x34')][_0xd978('0x42')]){_0x35ae77[_0xd978('0x43')]=[{'all':!![]}];}return db[_0xd978('0x2f')][_0xd978('0x44')](_0x35ae77);})['then'](function(_0x1a59d5){_0x2dc1be[_0xd978('0x45')]=_0x1a59d5;return _0x2dc1be;})['then'](respondWithFilteredResult(_0x572540,_0x35ae77))[_0xd978('0x46')](handleError(_0x572540,null));};exports['show']=function(_0x4ae9a0,_0x3976e1){var _0x3e923a={'raw':![],'where':{'id':_0x4ae9a0['params']['id']}},_0x5f2b8c={};_0x5f2b8c[_0xd978('0x33')]=_[_0xd978('0x35')](db['ZendeskConfiguration'][_0xd978('0x30')]);_0x5f2b8c[_0xd978('0x34')]=_['keys'](_0x4ae9a0[_0xd978('0x34')]);_0x5f2b8c['filters']=_[_0xd978('0x37')](_0x5f2b8c[_0xd978('0x33')],_0x5f2b8c['query']);_0x3e923a['attributes']=_[_0xd978('0x37')](_0x5f2b8c['model'],qs['fields'](_0x4ae9a0[_0xd978('0x34')][_0xd978('0x47')]));_0x3e923a[_0xd978('0x38')]=_0x3e923a[_0xd978('0x38')]['length']?_0x3e923a['attributes']:_0x5f2b8c[_0xd978('0x33')];if(_0x4ae9a0['query']['includeAll']){_0x3e923a[_0xd978('0x43')]=[{'all':!![]}];}_0x3e923a=_[_0xd978('0x3f')]({},_0x3e923a,_0x4ae9a0[_0xd978('0x41')]);return db['ZendeskConfiguration'][_0xd978('0x48')](_0x3e923a)[_0xd978('0x27')](handleEntityNotFound(_0x3976e1,null))[_0xd978('0x27')](respondWithResult(_0x3976e1,null))['catch'](handleError(_0x3976e1,null));};exports[_0xd978('0x49')]=function(_0x58b1bf,_0x285a3c){return db[_0xd978('0x2f')][_0xd978('0x49')](_0x58b1bf['body'],{})[_0xd978('0x27')](respondWithResult(_0x285a3c,0xc9))[_0xd978('0x46')](handleError(_0x285a3c,null));};exports['update']=function(_0x6f1b49,_0x26eb92){if(_0x6f1b49['body']['id']){delete _0x6f1b49[_0xd978('0x4a')]['id'];}return db[_0xd978('0x2f')][_0xd978('0x48')]({'where':{'id':_0x6f1b49[_0xd978('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26eb92,null))[_0xd978('0x27')](saveUpdates(_0x6f1b49[_0xd978('0x4a')],null))[_0xd978('0x27')](respondWithResult(_0x26eb92,null))['catch'](handleError(_0x26eb92,null));};exports['destroy']=function(_0x53a5fb,_0x50ba99){return db[_0xd978('0x2f')]['find']({'where':{'id':_0x53a5fb[_0xd978('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50ba99,null))[_0xd978('0x27')](removeEntity(_0x50ba99,null))[_0xd978('0x46')](handleError(_0x50ba99,null));};exports['getFields']=function(_0x45bd89,_0x14ea1c,_0x718b4){var _0x2075b7={};var _0x2a590b={};var _0x408f61;var _0x207b85;return db[_0xd978('0x2f')][_0xd978('0x4c')]({'where':{'id':_0x45bd89['params']['id']}})[_0xd978('0x27')](handleEntityNotFound(_0x14ea1c,null))[_0xd978('0x27')](function(_0x263fc0){if(_0x263fc0){_0x408f61=_0x263fc0;_0x2a590b[_0xd978('0x33')]=_['keys'](db[_0xd978('0x4d')][_0xd978('0x30')]);_0x2a590b['query']=_[_0xd978('0x35')](_0x45bd89[_0xd978('0x34')]);_0x2a590b['filters']=_[_0xd978('0x37')](_0x2a590b[_0xd978('0x33')],_0x2a590b[_0xd978('0x34')]);_0x2075b7[_0xd978('0x38')]=_[_0xd978('0x37')](_0x2a590b[_0xd978('0x33')],qs[_0xd978('0x47')](_0x45bd89[_0xd978('0x34')][_0xd978('0x47')]));_0x2075b7['attributes']=_0x2075b7['attributes']['length']?_0x2075b7[_0xd978('0x38')]:_0x2a590b['model'];_0x2075b7[_0xd978('0x3a')]=qs[_0xd978('0x3b')](_0x45bd89[_0xd978('0x34')][_0xd978('0x3b')]);_0x2075b7[_0xd978('0x3c')]=qs['filters'](_[_0xd978('0x3d')](_0x45bd89[_0xd978('0x34')],_0x2a590b[_0xd978('0x36')]));if(_0x45bd89[_0xd978('0x34')][_0xd978('0x3e')]){_0x2075b7[_0xd978('0x3c')]=_[_0xd978('0x3f')](_0x2075b7['where'],{'$or':_['map'](_0x2075b7[_0xd978('0x38')],function(_0x2475ed){var _0x5bb9bd={};_0x5bb9bd[_0x2475ed]={'$like':'%'+_0x45bd89[_0xd978('0x34')]['filter']+'%'};return _0x5bb9bd;})});}_0x2075b7=_['merge']({},_0x2075b7,_0x45bd89[_0xd978('0x41')]);return _0x408f61[_0xd978('0x4e')](_0x2075b7);}})['then'](function(_0x40ae54){if(_0x40ae54){_0x207b85=_0x40ae54[_0xd978('0x4f')];if(!_0x45bd89[_0xd978('0x34')]['hasOwnProperty'](_0xd978('0x39'))){_0x2075b7['limit']=qs[_0xd978('0x20')](_0x45bd89[_0xd978('0x34')][_0xd978('0x20')]);_0x2075b7[_0xd978('0x1e')]=qs['offset'](_0x45bd89[_0xd978('0x34')][_0xd978('0x1e')]);}return _0x408f61[_0xd978('0x4e')](_0x2075b7);}})[_0xd978('0x27')](function(_0x162739){if(_0x162739){return _0x162739?{'count':_0x207b85,'rows':_0x162739}:null;}})[_0xd978('0x27')](respondWithResult(_0x14ea1c,null))[_0xd978('0x46')](handleError(_0x14ea1c,null));};exports[_0xd978('0x50')]=function(_0x2eea55,_0x1406dd,_0x5eccf4){var _0xaaa54b={};var _0x46b9e2={};var _0x3b23ad;var _0x588166;return db[_0xd978('0x2f')]['findOne']({'where':{'id':_0x2eea55[_0xd978('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1406dd,null))['then'](function(_0x5458c3){if(_0x5458c3){_0x3b23ad=_0x5458c3;_0x46b9e2['model']=_[_0xd978('0x35')](db[_0xd978('0x4d')][_0xd978('0x30')]);_0x46b9e2[_0xd978('0x34')]=_[_0xd978('0x35')](_0x2eea55[_0xd978('0x34')]);_0x46b9e2[_0xd978('0x36')]=_[_0xd978('0x37')](_0x46b9e2[_0xd978('0x33')],_0x46b9e2[_0xd978('0x34')]);_0xaaa54b[_0xd978('0x38')]=_[_0xd978('0x37')](_0x46b9e2[_0xd978('0x33')],qs[_0xd978('0x47')](_0x2eea55['query'][_0xd978('0x47')]));_0xaaa54b[_0xd978('0x38')]=_0xaaa54b[_0xd978('0x38')]['length']?_0xaaa54b['attributes']:_0x46b9e2[_0xd978('0x33')];_0xaaa54b['order']=qs[_0xd978('0x3b')](_0x2eea55[_0xd978('0x34')][_0xd978('0x3b')]);_0xaaa54b[_0xd978('0x3c')]=qs[_0xd978('0x36')](_[_0xd978('0x3d')](_0x2eea55[_0xd978('0x34')],_0x46b9e2[_0xd978('0x36')]));if(_0x2eea55[_0xd978('0x34')]['filter']){_0xaaa54b['where']=_[_0xd978('0x3f')](_0xaaa54b[_0xd978('0x3c')],{'$or':_[_0xd978('0x2e')](_0xaaa54b[_0xd978('0x38')],function(_0x23c2fd){var _0x30943e={};_0x30943e[_0x23c2fd]={'$like':'%'+_0x2eea55['query'][_0xd978('0x3e')]+'%'};return _0x30943e;})});}_0xaaa54b=_[_0xd978('0x3f')]({},_0xaaa54b,_0x2eea55[_0xd978('0x41')]);return _0x3b23ad[_0xd978('0x50')](_0xaaa54b);}})[_0xd978('0x27')](function(_0xf041e5){if(_0xf041e5){_0x588166=_0xf041e5[_0xd978('0x4f')];if(!_0x2eea55[_0xd978('0x34')][_0xd978('0x51')](_0xd978('0x39'))){_0xaaa54b[_0xd978('0x20')]=qs['limit'](_0x2eea55[_0xd978('0x34')][_0xd978('0x20')]);_0xaaa54b[_0xd978('0x1e')]=qs['offset'](_0x2eea55[_0xd978('0x34')][_0xd978('0x1e')]);}return _0x3b23ad[_0xd978('0x50')](_0xaaa54b);}})[_0xd978('0x27')](function(_0x2b8934){if(_0x2b8934){return _0x2b8934?{'count':_0x588166,'rows':_0x2b8934}:null;}})['then'](respondWithResult(_0x1406dd,null))[_0xd978('0x46')](handleError(_0x1406dd,null));};exports[_0xd978('0x52')]=function(_0x5d5a09,_0x48c070,_0x35f44f){var _0x3dde12={};var _0x4cc68f={};var _0x5970c5;var _0x42db78;return db[_0xd978('0x2f')][_0xd978('0x4c')]({'where':{'id':_0x5d5a09[_0xd978('0x4b')]['id']}})[_0xd978('0x27')](handleEntityNotFound(_0x48c070,null))[_0xd978('0x27')](function(_0x276f0d){if(_0x276f0d){_0x5970c5=_0x276f0d;_0x4cc68f[_0xd978('0x33')]=_['keys'](db['ZendeskField'][_0xd978('0x30')]);_0x4cc68f[_0xd978('0x34')]=_[_0xd978('0x35')](_0x5d5a09[_0xd978('0x34')]);_0x4cc68f[_0xd978('0x36')]=_['intersection'](_0x4cc68f[_0xd978('0x33')],_0x4cc68f[_0xd978('0x34')]);_0x3dde12[_0xd978('0x38')]=_[_0xd978('0x37')](_0x4cc68f[_0xd978('0x33')],qs['fields'](_0x5d5a09[_0xd978('0x34')][_0xd978('0x47')]));_0x3dde12[_0xd978('0x38')]=_0x3dde12[_0xd978('0x38')]['length']?_0x3dde12['attributes']:_0x4cc68f[_0xd978('0x33')];_0x3dde12[_0xd978('0x3a')]=qs['sort'](_0x5d5a09[_0xd978('0x34')][_0xd978('0x3b')]);_0x3dde12['where']=qs[_0xd978('0x36')](_[_0xd978('0x3d')](_0x5d5a09[_0xd978('0x34')],_0x4cc68f[_0xd978('0x36')]));if(_0x5d5a09['query'][_0xd978('0x3e')]){_0x3dde12[_0xd978('0x3c')]=_[_0xd978('0x3f')](_0x3dde12[_0xd978('0x3c')],{'$or':_['map'](_0x3dde12['attributes'],function(_0x739e78){var _0x38d5ee={};_0x38d5ee[_0x739e78]={'$like':'%'+_0x5d5a09[_0xd978('0x34')][_0xd978('0x3e')]+'%'};return _0x38d5ee;})});}_0x3dde12=_['merge']({},_0x3dde12,_0x5d5a09[_0xd978('0x41')]);return _0x5970c5['getDescriptions'](_0x3dde12);}})[_0xd978('0x27')](function(_0x71740){if(_0x71740){_0x42db78=_0x71740['length'];if(!_0x5d5a09[_0xd978('0x34')][_0xd978('0x51')](_0xd978('0x39'))){_0x3dde12[_0xd978('0x20')]=qs[_0xd978('0x20')](_0x5d5a09[_0xd978('0x34')][_0xd978('0x20')]);_0x3dde12[_0xd978('0x1e')]=qs[_0xd978('0x1e')](_0x5d5a09['query'][_0xd978('0x1e')]);}return _0x5970c5[_0xd978('0x52')](_0x3dde12);}})[_0xd978('0x27')](function(_0x31a5ea){if(_0x31a5ea){return _0x31a5ea?{'count':_0x42db78,'rows':_0x31a5ea}:null;}})['then'](respondWithResult(_0x48c070,null))[_0xd978('0x46')](handleError(_0x48c070,null));};exports[_0xd978('0x53')]=function(_0x2ab5c7,_0x5f3fdd,_0x21173b){var _0x2b9f0c={};var _0x439814={};var _0x3d95df;var _0x54823d;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2ab5c7['params']['id']}})[_0xd978('0x27')](handleEntityNotFound(_0x5f3fdd,null))[_0xd978('0x27')](function(_0x24e6a6){if(_0x24e6a6){_0x3d95df=_0x24e6a6;_0x439814['model']=_['keys'](db[_0xd978('0x54')]['rawAttributes']);_0x439814[_0xd978('0x34')]=_['keys'](_0x2ab5c7['query']);_0x439814[_0xd978('0x36')]=_['intersection'](_0x439814[_0xd978('0x33')],_0x439814[_0xd978('0x34')]);_0x2b9f0c[_0xd978('0x38')]=_[_0xd978('0x37')](_0x439814[_0xd978('0x33')],qs['fields'](_0x2ab5c7[_0xd978('0x34')][_0xd978('0x47')]));_0x2b9f0c[_0xd978('0x38')]=_0x2b9f0c[_0xd978('0x38')][_0xd978('0x4f')]?_0x2b9f0c[_0xd978('0x38')]:_0x439814[_0xd978('0x33')];_0x2b9f0c['order']=qs[_0xd978('0x3b')](_0x2ab5c7[_0xd978('0x34')][_0xd978('0x3b')]);_0x2b9f0c[_0xd978('0x3c')]=qs[_0xd978('0x36')](_[_0xd978('0x3d')](_0x2ab5c7[_0xd978('0x34')],_0x439814[_0xd978('0x36')]));if(_0x2ab5c7[_0xd978('0x34')][_0xd978('0x3e')]){_0x2b9f0c[_0xd978('0x3c')]=_[_0xd978('0x3f')](_0x2b9f0c[_0xd978('0x3c')],{'$or':_[_0xd978('0x2e')](_0x2b9f0c[_0xd978('0x38')],function(_0x288034){var _0x13d743={};_0x13d743[_0x288034]={'$like':'%'+_0x2ab5c7[_0xd978('0x34')][_0xd978('0x3e')]+'%'};return _0x13d743;})});}_0x2b9f0c=_[_0xd978('0x3f')]({},_0x2b9f0c,_0x2ab5c7[_0xd978('0x41')]);return _0x3d95df['getTags'](_0x2b9f0c);}})['then'](function(_0x21affa){if(_0x21affa){_0x54823d=_0x21affa[_0xd978('0x4f')];if(!_0x2ab5c7[_0xd978('0x34')][_0xd978('0x51')](_0xd978('0x39'))){_0x2b9f0c[_0xd978('0x20')]=qs[_0xd978('0x20')](_0x2ab5c7['query']['limit']);_0x2b9f0c[_0xd978('0x1e')]=qs[_0xd978('0x1e')](_0x2ab5c7[_0xd978('0x34')][_0xd978('0x1e')]);}return _0x3d95df[_0xd978('0x53')](_0x2b9f0c);}})['then'](function(_0x2e60c0){if(_0x2e60c0){return _0x2e60c0?{'count':_0x54823d,'rows':_0x2e60c0}:null;}})[_0xd978('0x27')](respondWithResult(_0x5f3fdd,null))[_0xd978('0x46')](handleError(_0x5f3fdd,null));};exports['setTags']=function(_0x444b22,_0x315482,_0x31704a){if(_0x444b22['body']['id']){delete _0x444b22[_0xd978('0x4a')]['id'];}return db[_0xd978('0x2f')]['findOne']({'where':{'id':_0x444b22[_0xd978('0x4b')]['id']}})['then'](handleEntityNotFound(_0x315482,null))['then'](function(_0x5a04fb){if(_0x5a04fb){return _0x5a04fb[_0xd978('0x55')](_0x444b22[_0xd978('0x4a')][_0xd978('0x56')]||[]);}return null;})['then'](respondWithResult(_0x315482,null))[_0xd978('0x46')](handleError(_0x315482,null));}; \ No newline at end of file +var _0x10db=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','error','stack','name','send','map','ZendeskConfiguration','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x45038f,_0x510b9a){var _0x138286=function(_0x279509){while(--_0x279509){_0x45038f['push'](_0x45038f['shift']());}};_0x138286(++_0x510b9a);}(_0x10db,0x1e6));var _0xb10d=function(_0x5c30c4,_0x472b42){_0x5c30c4=_0x5c30c4-0x0;var _0x11b348=_0x10db[_0x5c30c4];return _0x11b348;};'use strict';var emlformat=require(_0xb10d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb10d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb10d('0x2'));var BPromise=require(_0xb10d('0x3'));var Mustache=require('mustache');var util=require(_0xb10d('0x4'));var path=require(_0xb10d('0x5'));var sox=require(_0xb10d('0x6'));var csv=require(_0xb10d('0x7'));var ejs=require(_0xb10d('0x8'));var fs=require('fs');var fs_extra=require(_0xb10d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb10d('0xa'));var jsforce=require(_0xb10d('0xb'));var deskjs=require(_0xb10d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb10d('0xd'));var Redis=require(_0xb10d('0xe'));var authService=require(_0xb10d('0xf'));var qs=require(_0xb10d('0x10'));var as=require(_0xb10d('0x11'));var hardwareService=require(_0xb10d('0x12'));var logger=require(_0xb10d('0x13'))(_0xb10d('0x14'));var utils=require('../../config/utils');var config=require(_0xb10d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb10d('0x16'))['db'];function respondWithStatusCode(_0x44d390,_0x1087d8){_0x1087d8=_0x1087d8||0xcc;return function(_0x3a6398){if(_0x3a6398){return _0x44d390[_0xb10d('0x17')](_0x1087d8);}return _0x44d390[_0xb10d('0x18')](_0x1087d8)[_0xb10d('0x19')]();};}function respondWithResult(_0x4ac2c8,_0x310b7d){_0x310b7d=_0x310b7d||0xc8;return function(_0x2239f6){if(_0x2239f6){return _0x4ac2c8[_0xb10d('0x18')](_0x310b7d)[_0xb10d('0x1a')](_0x2239f6);}};}function respondWithFilteredResult(_0x1edc62,_0x4ed1af){return function(_0x2ca5b3){if(_0x2ca5b3){var _0x5a40b0=typeof _0x4ed1af['offset']===_0xb10d('0x1b')&&typeof _0x4ed1af[_0xb10d('0x1c')]==='undefined';var _0x21b99d=_0x2ca5b3[_0xb10d('0x1d')];var _0x534bc5=_0x5a40b0?0x0:_0x4ed1af[_0xb10d('0x1e')];var _0x3cd82e=_0x5a40b0?_0x2ca5b3[_0xb10d('0x1d')]:_0x4ed1af[_0xb10d('0x1e')]+_0x4ed1af[_0xb10d('0x1c')];var _0x352c05;if(_0x3cd82e>=_0x21b99d){_0x3cd82e=_0x21b99d;_0x352c05=0xc8;}else{_0x352c05=0xce;}_0x1edc62[_0xb10d('0x18')](_0x352c05);return _0x1edc62[_0xb10d('0x1f')]('Content-Range',_0x534bc5+'-'+_0x3cd82e+'/'+_0x21b99d)['json'](_0x2ca5b3);}return null;};}function patchUpdates(_0x2d6a49){return function(_0x4e2956){try{jsonpatch[_0xb10d('0x20')](_0x4e2956,_0x2d6a49,!![]);}catch(_0x4419df){return BPromise['reject'](_0x4419df);}return _0x4e2956[_0xb10d('0x21')]();};}function saveUpdates(_0x13def8,_0x215e9e){return function(_0x56b8aa){if(_0x56b8aa){return _0x56b8aa[_0xb10d('0x22')](_0x13def8)[_0xb10d('0x23')](function(_0x465d4e){return _0x465d4e;});}return null;};}function removeEntity(_0x5e76e8,_0x158ab9){return function(_0x5be133){if(_0x5be133){return _0x5be133['destroy']()[_0xb10d('0x23')](function(){_0x5e76e8['status'](0xcc)[_0xb10d('0x19')]();});}};}function handleEntityNotFound(_0x572e3a,_0x448463){return function(_0x308f54){if(!_0x308f54){_0x572e3a[_0xb10d('0x17')](0x194);}return _0x308f54;};}function handleError(_0x36ebcb,_0x23039e){_0x23039e=_0x23039e||0x1f4;return function(_0x453f9b){logger[_0xb10d('0x24')](_0x453f9b[_0xb10d('0x25')]);if(_0x453f9b['name']){delete _0x453f9b[_0xb10d('0x26')];}_0x36ebcb[_0xb10d('0x18')](_0x23039e)[_0xb10d('0x27')](_0x453f9b);};}exports['index']=function(_0x1203f9,_0x105bd2){var _0x5bc277={},_0x31451e={},_0x4188af={'count':0x0,'rows':[]};var _0x48e7cf=_[_0xb10d('0x28')](db[_0xb10d('0x29')]['rawAttributes'],function(_0x58f025){return{'name':_0x58f025[_0xb10d('0x2a')],'type':_0x58f025['type'][_0xb10d('0x2b')]};});_0x31451e['model']=_[_0xb10d('0x28')](_0x48e7cf,_0xb10d('0x26'));_0x31451e[_0xb10d('0x2c')]=_[_0xb10d('0x2d')](_0x1203f9[_0xb10d('0x2c')]);_0x31451e['filters']=_[_0xb10d('0x2e')](_0x31451e[_0xb10d('0x2f')],_0x31451e[_0xb10d('0x2c')]);_0x5bc277['attributes']=_['intersection'](_0x31451e[_0xb10d('0x2f')],qs[_0xb10d('0x30')](_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x30')]));_0x5bc277[_0xb10d('0x31')]=_0x5bc277[_0xb10d('0x31')]['length']?_0x5bc277[_0xb10d('0x31')]:_0x31451e[_0xb10d('0x2f')];if(!_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x32')](_0xb10d('0x33'))){_0x5bc277[_0xb10d('0x1c')]=qs[_0xb10d('0x1c')](_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x1c')]);_0x5bc277[_0xb10d('0x1e')]=qs[_0xb10d('0x1e')](_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x1e')]);}_0x5bc277[_0xb10d('0x34')]=qs[_0xb10d('0x35')](_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x35')]);_0x5bc277[_0xb10d('0x36')]=qs[_0xb10d('0x37')](_[_0xb10d('0x38')](_0x1203f9['query'],_0x31451e[_0xb10d('0x37')]),_0x48e7cf);if(_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x39')]){_0x5bc277[_0xb10d('0x36')]=_[_0xb10d('0x3a')](_0x5bc277[_0xb10d('0x36')],{'$or':_['map'](_0x48e7cf,function(_0x1481af){if(_0x1481af[_0xb10d('0x3b')]!==_0xb10d('0x3c')){var _0x278e17={};_0x278e17[_0x1481af['name']]={'$like':'%'+_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x39')]+'%'};return _0x278e17;}})});}_0x5bc277=_[_0xb10d('0x3a')]({},_0x5bc277,_0x1203f9[_0xb10d('0x3d')]);var _0x1a8192={'where':_0x5bc277[_0xb10d('0x36')]};return db['ZendeskConfiguration'][_0xb10d('0x1d')](_0x1a8192)['then'](function(_0x451426){_0x4188af[_0xb10d('0x1d')]=_0x451426;if(_0x1203f9[_0xb10d('0x2c')][_0xb10d('0x3e')]){_0x5bc277[_0xb10d('0x3f')]=[{'all':!![]}];}return db[_0xb10d('0x29')][_0xb10d('0x40')](_0x5bc277);})[_0xb10d('0x23')](function(_0x640256){_0x4188af[_0xb10d('0x41')]=_0x640256;return _0x4188af;})['then'](respondWithFilteredResult(_0x105bd2,_0x5bc277))['catch'](handleError(_0x105bd2,null));};exports[_0xb10d('0x42')]=function(_0x2136f4,_0x10cbc1){var _0x35faf3={'raw':![],'where':{'id':_0x2136f4[_0xb10d('0x43')]['id']}},_0x2b22d5={};_0x2b22d5[_0xb10d('0x2f')]=_[_0xb10d('0x2d')](db[_0xb10d('0x29')][_0xb10d('0x44')]);_0x2b22d5[_0xb10d('0x2c')]=_[_0xb10d('0x2d')](_0x2136f4[_0xb10d('0x2c')]);_0x2b22d5['filters']=_[_0xb10d('0x2e')](_0x2b22d5['model'],_0x2b22d5['query']);_0x35faf3[_0xb10d('0x31')]=_[_0xb10d('0x2e')](_0x2b22d5[_0xb10d('0x2f')],qs['fields'](_0x2136f4['query'][_0xb10d('0x30')]));_0x35faf3[_0xb10d('0x31')]=_0x35faf3[_0xb10d('0x31')][_0xb10d('0x45')]?_0x35faf3[_0xb10d('0x31')]:_0x2b22d5[_0xb10d('0x2f')];if(_0x2136f4[_0xb10d('0x2c')][_0xb10d('0x3e')]){_0x35faf3[_0xb10d('0x3f')]=[{'all':!![]}];}_0x35faf3=_['merge']({},_0x35faf3,_0x2136f4[_0xb10d('0x3d')]);return db[_0xb10d('0x29')][_0xb10d('0x46')](_0x35faf3)[_0xb10d('0x23')](handleEntityNotFound(_0x10cbc1,null))['then'](respondWithResult(_0x10cbc1,null))[_0xb10d('0x47')](handleError(_0x10cbc1,null));};exports[_0xb10d('0x48')]=function(_0x47ebef,_0x141a48){return db[_0xb10d('0x29')][_0xb10d('0x48')](_0x47ebef['body'],{})['then'](respondWithResult(_0x141a48,0xc9))['catch'](handleError(_0x141a48,null));};exports[_0xb10d('0x22')]=function(_0x5d491a,_0x534d5c){if(_0x5d491a[_0xb10d('0x49')]['id']){delete _0x5d491a['body']['id'];}return db[_0xb10d('0x29')][_0xb10d('0x46')]({'where':{'id':_0x5d491a[_0xb10d('0x43')]['id']}})[_0xb10d('0x23')](handleEntityNotFound(_0x534d5c,null))['then'](saveUpdates(_0x5d491a[_0xb10d('0x49')],null))[_0xb10d('0x23')](respondWithResult(_0x534d5c,null))[_0xb10d('0x47')](handleError(_0x534d5c,null));};exports[_0xb10d('0x4a')]=function(_0x422a70,_0x483e32){return db[_0xb10d('0x29')][_0xb10d('0x46')]({'where':{'id':_0x422a70[_0xb10d('0x43')]['id']}})[_0xb10d('0x23')](handleEntityNotFound(_0x483e32,null))[_0xb10d('0x23')](removeEntity(_0x483e32,null))[_0xb10d('0x47')](handleError(_0x483e32,null));};exports[_0xb10d('0x4b')]=function(_0xd30abf,_0x40bd62,_0x2f3dbd){var _0x400b35={};var _0x1b2b37={};var _0x2e1a41;var _0x583c0f;return db[_0xb10d('0x29')][_0xb10d('0x4c')]({'where':{'id':_0xd30abf[_0xb10d('0x43')]['id']}})['then'](handleEntityNotFound(_0x40bd62,null))[_0xb10d('0x23')](function(_0x2120db){if(_0x2120db){_0x2e1a41=_0x2120db;_0x1b2b37[_0xb10d('0x2f')]=_[_0xb10d('0x2d')](db[_0xb10d('0x4d')][_0xb10d('0x44')]);_0x1b2b37[_0xb10d('0x2c')]=_[_0xb10d('0x2d')](_0xd30abf[_0xb10d('0x2c')]);_0x1b2b37['filters']=_[_0xb10d('0x2e')](_0x1b2b37[_0xb10d('0x2f')],_0x1b2b37['query']);_0x400b35[_0xb10d('0x31')]=_[_0xb10d('0x2e')](_0x1b2b37[_0xb10d('0x2f')],qs[_0xb10d('0x30')](_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x30')]));_0x400b35['attributes']=_0x400b35[_0xb10d('0x31')][_0xb10d('0x45')]?_0x400b35['attributes']:_0x1b2b37[_0xb10d('0x2f')];_0x400b35['order']=qs['sort'](_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x35')]);_0x400b35[_0xb10d('0x36')]=qs[_0xb10d('0x37')](_[_0xb10d('0x38')](_0xd30abf[_0xb10d('0x2c')],_0x1b2b37[_0xb10d('0x37')]));if(_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x39')]){_0x400b35['where']=_['merge'](_0x400b35['where'],{'$or':_[_0xb10d('0x28')](_0x400b35['attributes'],function(_0x2fa574){var _0x3ae351={};_0x3ae351[_0x2fa574]={'$like':'%'+_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x39')]+'%'};return _0x3ae351;})});}_0x400b35=_['merge']({},_0x400b35,_0xd30abf[_0xb10d('0x3d')]);return _0x2e1a41[_0xb10d('0x4b')](_0x400b35);}})[_0xb10d('0x23')](function(_0x339d43){if(_0x339d43){_0x583c0f=_0x339d43[_0xb10d('0x45')];if(!_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x32')](_0xb10d('0x33'))){_0x400b35['limit']=qs[_0xb10d('0x1c')](_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x1c')]);_0x400b35[_0xb10d('0x1e')]=qs[_0xb10d('0x1e')](_0xd30abf[_0xb10d('0x2c')][_0xb10d('0x1e')]);}return _0x2e1a41['getFields'](_0x400b35);}})['then'](function(_0x386f70){if(_0x386f70){return _0x386f70?{'count':_0x583c0f,'rows':_0x386f70}:null;}})[_0xb10d('0x23')](respondWithResult(_0x40bd62,null))[_0xb10d('0x47')](handleError(_0x40bd62,null));};exports[_0xb10d('0x4e')]=function(_0xd6645b,_0x1467e8,_0x1be7ea){var _0x49377c={};var _0x7c4e67={};var _0x7c68ee;var _0x369ba0;return db[_0xb10d('0x29')]['findOne']({'where':{'id':_0xd6645b[_0xb10d('0x43')]['id']}})[_0xb10d('0x23')](handleEntityNotFound(_0x1467e8,null))[_0xb10d('0x23')](function(_0x11de15){if(_0x11de15){_0x7c68ee=_0x11de15;_0x7c4e67[_0xb10d('0x2f')]=_[_0xb10d('0x2d')](db[_0xb10d('0x4d')][_0xb10d('0x44')]);_0x7c4e67['query']=_[_0xb10d('0x2d')](_0xd6645b[_0xb10d('0x2c')]);_0x7c4e67[_0xb10d('0x37')]=_[_0xb10d('0x2e')](_0x7c4e67['model'],_0x7c4e67['query']);_0x49377c[_0xb10d('0x31')]=_['intersection'](_0x7c4e67[_0xb10d('0x2f')],qs['fields'](_0xd6645b[_0xb10d('0x2c')][_0xb10d('0x30')]));_0x49377c[_0xb10d('0x31')]=_0x49377c[_0xb10d('0x31')]['length']?_0x49377c[_0xb10d('0x31')]:_0x7c4e67[_0xb10d('0x2f')];_0x49377c[_0xb10d('0x34')]=qs['sort'](_0xd6645b['query']['sort']);_0x49377c[_0xb10d('0x36')]=qs[_0xb10d('0x37')](_[_0xb10d('0x38')](_0xd6645b['query'],_0x7c4e67[_0xb10d('0x37')]));if(_0xd6645b['query'][_0xb10d('0x39')]){_0x49377c['where']=_[_0xb10d('0x3a')](_0x49377c['where'],{'$or':_[_0xb10d('0x28')](_0x49377c[_0xb10d('0x31')],function(_0x2da853){var _0x2efb7d={};_0x2efb7d[_0x2da853]={'$like':'%'+_0xd6645b[_0xb10d('0x2c')][_0xb10d('0x39')]+'%'};return _0x2efb7d;})});}_0x49377c=_[_0xb10d('0x3a')]({},_0x49377c,_0xd6645b[_0xb10d('0x3d')]);return _0x7c68ee[_0xb10d('0x4e')](_0x49377c);}})[_0xb10d('0x23')](function(_0x466861){if(_0x466861){_0x369ba0=_0x466861[_0xb10d('0x45')];if(!_0xd6645b[_0xb10d('0x2c')][_0xb10d('0x32')](_0xb10d('0x33'))){_0x49377c[_0xb10d('0x1c')]=qs[_0xb10d('0x1c')](_0xd6645b[_0xb10d('0x2c')]['limit']);_0x49377c[_0xb10d('0x1e')]=qs[_0xb10d('0x1e')](_0xd6645b['query'][_0xb10d('0x1e')]);}return _0x7c68ee[_0xb10d('0x4e')](_0x49377c);}})[_0xb10d('0x23')](function(_0x69e3f0){if(_0x69e3f0){return _0x69e3f0?{'count':_0x369ba0,'rows':_0x69e3f0}:null;}})[_0xb10d('0x23')](respondWithResult(_0x1467e8,null))[_0xb10d('0x47')](handleError(_0x1467e8,null));};exports['getDescriptions']=function(_0x4a94f9,_0x27af6b,_0x31cc4c){var _0x54febc={};var _0x17a83b={};var _0x503a3d;var _0x19ac23;return db[_0xb10d('0x29')][_0xb10d('0x4c')]({'where':{'id':_0x4a94f9[_0xb10d('0x43')]['id']}})['then'](handleEntityNotFound(_0x27af6b,null))[_0xb10d('0x23')](function(_0x368d32){if(_0x368d32){_0x503a3d=_0x368d32;_0x17a83b['model']=_[_0xb10d('0x2d')](db[_0xb10d('0x4d')][_0xb10d('0x44')]);_0x17a83b[_0xb10d('0x2c')]=_[_0xb10d('0x2d')](_0x4a94f9[_0xb10d('0x2c')]);_0x17a83b[_0xb10d('0x37')]=_['intersection'](_0x17a83b[_0xb10d('0x2f')],_0x17a83b[_0xb10d('0x2c')]);_0x54febc[_0xb10d('0x31')]=_[_0xb10d('0x2e')](_0x17a83b[_0xb10d('0x2f')],qs['fields'](_0x4a94f9['query'][_0xb10d('0x30')]));_0x54febc[_0xb10d('0x31')]=_0x54febc[_0xb10d('0x31')][_0xb10d('0x45')]?_0x54febc['attributes']:_0x17a83b[_0xb10d('0x2f')];_0x54febc[_0xb10d('0x34')]=qs[_0xb10d('0x35')](_0x4a94f9[_0xb10d('0x2c')][_0xb10d('0x35')]);_0x54febc[_0xb10d('0x36')]=qs[_0xb10d('0x37')](_[_0xb10d('0x38')](_0x4a94f9[_0xb10d('0x2c')],_0x17a83b[_0xb10d('0x37')]));if(_0x4a94f9[_0xb10d('0x2c')]['filter']){_0x54febc['where']=_[_0xb10d('0x3a')](_0x54febc[_0xb10d('0x36')],{'$or':_[_0xb10d('0x28')](_0x54febc['attributes'],function(_0x279b78){var _0x103ee3={};_0x103ee3[_0x279b78]={'$like':'%'+_0x4a94f9['query'][_0xb10d('0x39')]+'%'};return _0x103ee3;})});}_0x54febc=_[_0xb10d('0x3a')]({},_0x54febc,_0x4a94f9[_0xb10d('0x3d')]);return _0x503a3d['getDescriptions'](_0x54febc);}})[_0xb10d('0x23')](function(_0x2bd4be){if(_0x2bd4be){_0x19ac23=_0x2bd4be[_0xb10d('0x45')];if(!_0x4a94f9[_0xb10d('0x2c')]['hasOwnProperty']('nolimit')){_0x54febc[_0xb10d('0x1c')]=qs[_0xb10d('0x1c')](_0x4a94f9[_0xb10d('0x2c')][_0xb10d('0x1c')]);_0x54febc[_0xb10d('0x1e')]=qs['offset'](_0x4a94f9[_0xb10d('0x2c')][_0xb10d('0x1e')]);}return _0x503a3d[_0xb10d('0x4f')](_0x54febc);}})[_0xb10d('0x23')](function(_0x4b0370){if(_0x4b0370){return _0x4b0370?{'count':_0x19ac23,'rows':_0x4b0370}:null;}})[_0xb10d('0x23')](respondWithResult(_0x27af6b,null))[_0xb10d('0x47')](handleError(_0x27af6b,null));};exports[_0xb10d('0x50')]=function(_0x199b73,_0x4f3746,_0x20ced9){var _0x293e70={};var _0xeee094={};var _0x69045;var _0x12d544;return db[_0xb10d('0x29')][_0xb10d('0x4c')]({'where':{'id':_0x199b73[_0xb10d('0x43')]['id']}})[_0xb10d('0x23')](handleEntityNotFound(_0x4f3746,null))[_0xb10d('0x23')](function(_0x37a73e){if(_0x37a73e){_0x69045=_0x37a73e;_0xeee094[_0xb10d('0x2f')]=_[_0xb10d('0x2d')](db[_0xb10d('0x51')]['rawAttributes']);_0xeee094['query']=_['keys'](_0x199b73[_0xb10d('0x2c')]);_0xeee094['filters']=_[_0xb10d('0x2e')](_0xeee094[_0xb10d('0x2f')],_0xeee094['query']);_0x293e70[_0xb10d('0x31')]=_[_0xb10d('0x2e')](_0xeee094['model'],qs[_0xb10d('0x30')](_0x199b73[_0xb10d('0x2c')]['fields']));_0x293e70[_0xb10d('0x31')]=_0x293e70['attributes'][_0xb10d('0x45')]?_0x293e70[_0xb10d('0x31')]:_0xeee094[_0xb10d('0x2f')];_0x293e70[_0xb10d('0x34')]=qs[_0xb10d('0x35')](_0x199b73[_0xb10d('0x2c')][_0xb10d('0x35')]);_0x293e70[_0xb10d('0x36')]=qs[_0xb10d('0x37')](_[_0xb10d('0x38')](_0x199b73['query'],_0xeee094[_0xb10d('0x37')]));if(_0x199b73[_0xb10d('0x2c')][_0xb10d('0x39')]){_0x293e70[_0xb10d('0x36')]=_[_0xb10d('0x3a')](_0x293e70[_0xb10d('0x36')],{'$or':_[_0xb10d('0x28')](_0x293e70[_0xb10d('0x31')],function(_0xc261f4){var _0x233da7={};_0x233da7[_0xc261f4]={'$like':'%'+_0x199b73[_0xb10d('0x2c')][_0xb10d('0x39')]+'%'};return _0x233da7;})});}_0x293e70=_[_0xb10d('0x3a')]({},_0x293e70,_0x199b73[_0xb10d('0x3d')]);return _0x69045[_0xb10d('0x50')](_0x293e70);}})[_0xb10d('0x23')](function(_0x462311){if(_0x462311){_0x12d544=_0x462311[_0xb10d('0x45')];if(!_0x199b73[_0xb10d('0x2c')][_0xb10d('0x32')]('nolimit')){_0x293e70['limit']=qs['limit'](_0x199b73[_0xb10d('0x2c')][_0xb10d('0x1c')]);_0x293e70['offset']=qs[_0xb10d('0x1e')](_0x199b73[_0xb10d('0x2c')][_0xb10d('0x1e')]);}return _0x69045[_0xb10d('0x50')](_0x293e70);}})[_0xb10d('0x23')](function(_0x2463a7){if(_0x2463a7){return _0x2463a7?{'count':_0x12d544,'rows':_0x2463a7}:null;}})[_0xb10d('0x23')](respondWithResult(_0x4f3746,null))[_0xb10d('0x47')](handleError(_0x4f3746,null));};exports['setTags']=function(_0x50fed6,_0x47a741,_0x140997){if(_0x50fed6[_0xb10d('0x49')]['id']){delete _0x50fed6[_0xb10d('0x49')]['id'];}return db['ZendeskConfiguration'][_0xb10d('0x4c')]({'where':{'id':_0x50fed6[_0xb10d('0x43')]['id']}})['then'](handleEntityNotFound(_0x47a741,null))[_0xb10d('0x23')](function(_0x1e4f38){if(_0x1e4f38){return _0x1e4f38[_0xb10d('0x52')](_0x50fed6[_0xb10d('0x49')]['ids']||[]);}return null;})[_0xb10d('0x23')](respondWithResult(_0x47a741,null))[_0xb10d('0x47')](handleError(_0x47a741,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3b0b85f..a84aa88 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 _0x4024=['define','int_zendesk_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x4f705f,_0x1e48d3){var _0x5a05aa=function(_0x2a29ab){while(--_0x2a29ab){_0x4f705f['push'](_0x4f705f['shift']());}};_0x5a05aa(++_0x1e48d3);}(_0x4024,0x89));var _0x4402=function(_0x234919,_0x3248c4){_0x234919=_0x234919-0x0;var _0xbef90a=_0x4024[_0x234919];return _0xbef90a;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('ZendeskConfiguration',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['../../config/logger','moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x25e09e,_0x3a666f){var _0x4be7bc=function(_0x505445){while(--_0x505445){_0x25e09e['push'](_0x25e09e['shift']());}};_0x4be7bc(++_0x3a666f);}(_0xb44a,0x1c2));var _0xab44=function(_0x46ef1d,_0x24926){_0x46ef1d=_0x46ef1d-0x0;var _0x49ce69=_0xb44a[_0x46ef1d];return _0x49ce69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 9ce4d78..e14081f 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 _0x9f56=['http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9f56,0xbb));var _0x69f5=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x9f56[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x69f5('0x0'));var util=require(_0x69f5('0x1'));var moment=require(_0x69f5('0x2'));var BPromise=require(_0x69f5('0x3'));var rs=require(_0x69f5('0x4'));var fs=require('fs');var Redis=require(_0x69f5('0x5'));var db=require(_0x69f5('0x6'))['db'];var utils=require(_0x69f5('0x7'));var logger=require('../../config/logger')(_0x69f5('0x8'));var config=require(_0x69f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x69f5('0xa')][_0x69f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4634c7,_0x48d1ed,_0x3e67ef){return new BPromise(function(_0x4b0b69,_0x4281e9){return client[_0x69f5('0xc')](_0x4634c7,_0x3e67ef)[_0x69f5('0xd')](function(_0x2fc8c8){logger[_0x69f5('0xe')](_0x69f5('0xf'),_0x48d1ed,_0x69f5('0x10'));logger['debug'](_0x69f5('0x11'),_0x48d1ed,_0x69f5('0x10'),JSON['stringify'](_0x2fc8c8));if(_0x2fc8c8[_0x69f5('0x12')]){if(_0x2fc8c8[_0x69f5('0x12')][_0x69f5('0x13')]===0x1f4){logger[_0x69f5('0x12')](_0x69f5('0xf'),_0x48d1ed,_0x2fc8c8[_0x69f5('0x12')]['message']);return _0x4281e9(_0x2fc8c8[_0x69f5('0x12')][_0x69f5('0x14')]);}logger[_0x69f5('0x12')](_0x69f5('0xf'),_0x48d1ed,_0x2fc8c8['error'][_0x69f5('0x14')]);return _0x4b0b69(_0x2fc8c8[_0x69f5('0x12')][_0x69f5('0x14')]);}else{logger[_0x69f5('0xe')](_0x69f5('0xf'),_0x48d1ed,_0x69f5('0x10'));_0x4b0b69(_0x2fc8c8[_0x69f5('0x15')][_0x69f5('0x14')]);}})['catch'](function(_0x46406c){logger['error'](_0x69f5('0xf'),_0x48d1ed,_0x46406c);_0x4281e9(_0x46406c);});});} \ No newline at end of file +var _0x573e=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0x573e,0x192));var _0xe573=function(_0x3582dc,_0x55ccba){_0x3582dc=_0x3582dc-0x0;var _0x40be61=_0x573e[_0x3582dc];return _0x40be61;};'use strict';var _=require(_0xe573('0x0'));var util=require('util');var moment=require(_0xe573('0x1'));var BPromise=require(_0xe573('0x2'));var rs=require(_0xe573('0x3'));var fs=require('fs');var Redis=require(_0xe573('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe573('0x5'));var logger=require(_0xe573('0x6'))(_0xe573('0x7'));var config=require(_0xe573('0x8'));var jayson=require(_0xe573('0x9'));var client=jayson[_0xe573('0xa')][_0xe573('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23f4f9,_0x46d18f,_0x4806f7){return new BPromise(function(_0x371934,_0x2e9b62){return client['request'](_0x23f4f9,_0x4806f7)[_0xe573('0xc')](function(_0x100dc8){logger[_0xe573('0xd')](_0xe573('0xe'),_0x46d18f,_0xe573('0xf'));logger[_0xe573('0x10')](_0xe573('0x11'),_0x46d18f,_0xe573('0xf'),JSON[_0xe573('0x12')](_0x100dc8));if(_0x100dc8[_0xe573('0x13')]){if(_0x100dc8['error']['code']===0x1f4){logger[_0xe573('0x13')](_0xe573('0xe'),_0x46d18f,_0x100dc8[_0xe573('0x13')][_0xe573('0x14')]);return _0x2e9b62(_0x100dc8[_0xe573('0x13')]['message']);}logger[_0xe573('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x46d18f,_0x100dc8[_0xe573('0x13')][_0xe573('0x14')]);return _0x371934(_0x100dc8['error']['message']);}else{logger[_0xe573('0xd')](_0xe573('0xe'),_0x46d18f,_0xe573('0xf'));_0x371934(_0x100dc8[_0xe573('0x15')]['message']);}})[_0xe573('0x16')](function(_0x374f68){logger[_0xe573('0x13')](_0xe573('0xe'),_0x46d18f,_0x374f68);_0x2e9b62(_0x374f68);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 720116c..f8f808d 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 _0xaf8f=['./intZendeskField.controller','get','isAuthenticated','show','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xaf8f,0xee));var _0xfaf8=function(_0x1c288b,_0x377b72){_0x1c288b=_0x1c288b-0x0;var _0x5d9225=_0xaf8f[_0x1c288b];return _0x5d9225;};'use strict';var multer=require(_0xfaf8('0x0'));var util=require(_0xfaf8('0x1'));var path=require(_0xfaf8('0x2'));var timeout=require(_0xfaf8('0x3'));var express=require('express');var router=express[_0xfaf8('0x4')]();var fs_extra=require(_0xfaf8('0x5'));var auth=require(_0xfaf8('0x6'));var interaction=require(_0xfaf8('0x7'));var config=require(_0xfaf8('0x8'));var controller=require(_0xfaf8('0x9'));router[_0xfaf8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfaf8('0xa')]('/:id',auth[_0xfaf8('0xb')](),controller[_0xfaf8('0xc')]);router[_0xfaf8('0xd')]('/',auth['isAuthenticated'](),controller[_0xfaf8('0xe')]);router['put'](_0xfaf8('0xf'),auth[_0xfaf8('0xb')](),controller[_0xfaf8('0x10')]);router['delete'](_0xfaf8('0xf'),auth['isAuthenticated'](),controller[_0xfaf8('0x11')]);module[_0xfaf8('0x12')]=router; \ No newline at end of file +var _0x3ae2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x2d08d0,_0x5d74c8){var _0x16931d=function(_0x3ed32f){while(--_0x3ed32f){_0x2d08d0['push'](_0x2d08d0['shift']());}};_0x16931d(++_0x5d74c8);}(_0x3ae2,0xee));var _0x23ae=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0x3ae2[_0x134d5e];return _0x1e166a;};'use strict';var multer=require(_0x23ae('0x0'));var util=require('util');var path=require(_0x23ae('0x1'));var timeout=require(_0x23ae('0x2'));var express=require(_0x23ae('0x3'));var router=express[_0x23ae('0x4')]();var fs_extra=require(_0x23ae('0x5'));var auth=require(_0x23ae('0x6'));var interaction=require(_0x23ae('0x7'));var config=require('../../config/environment');var controller=require(_0x23ae('0x8'));router['get']('/',auth[_0x23ae('0x9')](),controller[_0x23ae('0xa')]);router['get'](_0x23ae('0xb'),auth['isAuthenticated'](),controller[_0x23ae('0xc')]);router[_0x23ae('0xd')]('/',auth[_0x23ae('0x9')](),controller[_0x23ae('0xe')]);router[_0x23ae('0xf')](_0x23ae('0xb'),auth[_0x23ae('0x9')](),controller[_0x23ae('0x10')]);router[_0x23ae('0x11')](_0x23ae('0xb'),auth['isAuthenticated'](),controller[_0x23ae('0x12')]);module[_0x23ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 6045b0a..8c6f80d 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 _0x44ab=['string','variable','keyValue','STRING','customVariable','exports','ENUM'];(function(_0x2a49cb,_0x3b2303){var _0x4aa626=function(_0x251e6e){while(--_0x251e6e){_0x2a49cb['push'](_0x2a49cb['shift']());}};_0x4aa626(++_0x3b2303);}(_0x44ab,0x1be));var _0xb44a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x44ab[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module[_0xb44a('0x0')]={'type':{'type':Sequelize[_0xb44a('0x1')](_0xb44a('0x2'),_0xb44a('0x3'),'customVariable',_0xb44a('0x4'),'picklist'),'defaultValue':_0xb44a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb44a('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb44a('0x2'),_0xb44a('0x3'),_0xb44a('0x6'))},'keyContent':{'type':Sequelize[_0xb44a('0x5')]},'idField':{'type':Sequelize[_0xb44a('0x5')]},'nameField':{'type':Sequelize[_0xb44a('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb44a('0x5')]}}; \ No newline at end of file +var _0x629c=['variable','customVariable','keyValue','picklist','STRING','ENUM','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x629c,0x179));var _0xc629=function(_0x48fccd,_0x4dac6e){_0x48fccd=_0x48fccd-0x0;var _0x1934bf=_0x629c[_0x48fccd];return _0x1934bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xc629('0x0'),_0xc629('0x1'),_0xc629('0x2'),_0xc629('0x3'),_0xc629('0x4')),'defaultValue':_0xc629('0x0')},'content':{'type':Sequelize[_0xc629('0x5')]},'key':{'type':Sequelize[_0xc629('0x5')]},'keyType':{'type':Sequelize[_0xc629('0x6')]('string',_0xc629('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc629('0x5')]},'nameField':{'type':Sequelize[_0xc629('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc629('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 32c1ab6..03bfb7c 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 _0x6221=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x35212e,_0x2b1823){var _0x3291cd=function(_0x4569a0){while(--_0x4569a0){_0x35212e['push'](_0x35212e['shift']());}};_0x3291cd(++_0x2b1823);}(_0x6221,0xdf));var _0x1622=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x6221[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require(_0x1622('0x0'));var rimraf=require(_0x1622('0x1'));var zipdir=require(_0x1622('0x2'));var jsonpatch=require(_0x1622('0x3'));var rp=require(_0x1622('0x4'));var moment=require(_0x1622('0x5'));var BPromise=require(_0x1622('0x6'));var Mustache=require(_0x1622('0x7'));var util=require(_0x1622('0x8'));var path=require(_0x1622('0x9'));var sox=require(_0x1622('0xa'));var csv=require(_0x1622('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1622('0xc'));var _=require('lodash');var squel=require(_0x1622('0xd'));var crypto=require(_0x1622('0xe'));var jsforce=require(_0x1622('0xf'));var deskjs=require(_0x1622('0x10'));var toCsv=require(_0x1622('0xb'));var querystring=require(_0x1622('0x11'));var Papa=require(_0x1622('0x12'));var Redis=require(_0x1622('0x13'));var authService=require(_0x1622('0x14'));var qs=require(_0x1622('0x15'));var as=require(_0x1622('0x16'));var hardwareService=require(_0x1622('0x17'));var logger=require(_0x1622('0x18'))(_0x1622('0x19'));var utils=require(_0x1622('0x1a'));var config=require(_0x1622('0x1b'));var licenseUtil=require(_0x1622('0x1c'));var db=require(_0x1622('0x1d'))['db'];function respondWithStatusCode(_0x3bbdde,_0x22fb15){_0x22fb15=_0x22fb15||0xcc;return function(_0x2ec278){if(_0x2ec278){return _0x3bbdde['sendStatus'](_0x22fb15);}return _0x3bbdde[_0x1622('0x1e')](_0x22fb15)[_0x1622('0x1f')]();};}function respondWithResult(_0x2714d7,_0x464138){_0x464138=_0x464138||0xc8;return function(_0x665878){if(_0x665878){return _0x2714d7[_0x1622('0x1e')](_0x464138)[_0x1622('0x20')](_0x665878);}};}function respondWithFilteredResult(_0x3ea2ce,_0x2d30e4){return function(_0x26c35f){if(_0x26c35f){var _0x1a2852=typeof _0x2d30e4[_0x1622('0x21')]===_0x1622('0x22')&&typeof _0x2d30e4[_0x1622('0x23')]===_0x1622('0x22');var _0x37109d=_0x26c35f['count'];var _0x3b0aee=_0x1a2852?0x0:_0x2d30e4[_0x1622('0x21')];var _0x27d25a=_0x1a2852?_0x26c35f['count']:_0x2d30e4[_0x1622('0x21')]+_0x2d30e4['limit'];var _0xf24364;if(_0x27d25a>=_0x37109d){_0x27d25a=_0x37109d;_0xf24364=0xc8;}else{_0xf24364=0xce;}_0x3ea2ce[_0x1622('0x1e')](_0xf24364);return _0x3ea2ce[_0x1622('0x24')]('Content-Range',_0x3b0aee+'-'+_0x27d25a+'/'+_0x37109d)['json'](_0x26c35f);}return null;};}function patchUpdates(_0x24885d){return function(_0x21327e){try{jsonpatch[_0x1622('0x25')](_0x21327e,_0x24885d,!![]);}catch(_0x291aa8){return BPromise[_0x1622('0x26')](_0x291aa8);}return _0x21327e[_0x1622('0x27')]();};}function saveUpdates(_0x406e46,_0x568e48){return function(_0x96eadc){if(_0x96eadc){return _0x96eadc[_0x1622('0x28')](_0x406e46)[_0x1622('0x29')](function(_0x25ebaa){return _0x25ebaa;});}return null;};}function removeEntity(_0x15df38,_0x524258){return function(_0x510370){if(_0x510370){return _0x510370[_0x1622('0x2a')]()[_0x1622('0x29')](function(){_0x15df38[_0x1622('0x1e')](0xcc)[_0x1622('0x1f')]();});}};}function handleEntityNotFound(_0x36f9b7,_0x434914){return function(_0x1c1e67){if(!_0x1c1e67){_0x36f9b7['sendStatus'](0x194);}return _0x1c1e67;};}function handleError(_0x15deb7,_0x3f3087){_0x3f3087=_0x3f3087||0x1f4;return function(_0x4bd265){logger[_0x1622('0x2b')](_0x4bd265[_0x1622('0x2c')]);if(_0x4bd265[_0x1622('0x2d')]){delete _0x4bd265['name'];}_0x15deb7[_0x1622('0x1e')](_0x3f3087)['send'](_0x4bd265);};}exports[_0x1622('0x2e')]=function(_0x41a25a,_0x10664c){var _0x2294ef={},_0x1f5ea0={},_0xeede8e={'count':0x0,'rows':[]};var _0x23cb5f=_[_0x1622('0x2f')](db[_0x1622('0x30')][_0x1622('0x31')],function(_0x45db6c){return{'name':_0x45db6c[_0x1622('0x32')],'type':_0x45db6c['type']['key']};});_0x1f5ea0[_0x1622('0x33')]=_[_0x1622('0x2f')](_0x23cb5f,_0x1622('0x2d'));_0x1f5ea0[_0x1622('0x34')]=_[_0x1622('0x35')](_0x41a25a[_0x1622('0x34')]);_0x1f5ea0['filters']=_[_0x1622('0x36')](_0x1f5ea0[_0x1622('0x33')],_0x1f5ea0['query']);_0x2294ef[_0x1622('0x37')]=_[_0x1622('0x36')](_0x1f5ea0['model'],qs['fields'](_0x41a25a['query'][_0x1622('0x38')]));_0x2294ef[_0x1622('0x37')]=_0x2294ef['attributes'][_0x1622('0x39')]?_0x2294ef[_0x1622('0x37')]:_0x1f5ea0[_0x1622('0x33')];if(!_0x41a25a[_0x1622('0x34')][_0x1622('0x3a')](_0x1622('0x3b'))){_0x2294ef[_0x1622('0x23')]=qs['limit'](_0x41a25a['query'][_0x1622('0x23')]);_0x2294ef['offset']=qs[_0x1622('0x21')](_0x41a25a[_0x1622('0x34')]['offset']);}_0x2294ef[_0x1622('0x3c')]=qs[_0x1622('0x3d')](_0x41a25a['query'][_0x1622('0x3d')]);_0x2294ef[_0x1622('0x3e')]=qs[_0x1622('0x3f')](_[_0x1622('0x40')](_0x41a25a['query'],_0x1f5ea0[_0x1622('0x3f')]),_0x23cb5f);if(_0x41a25a[_0x1622('0x34')][_0x1622('0x41')]){_0x2294ef[_0x1622('0x3e')]=_[_0x1622('0x42')](_0x2294ef[_0x1622('0x3e')],{'$or':_[_0x1622('0x2f')](_0x23cb5f,function(_0x5678c1){if(_0x5678c1[_0x1622('0x43')]!==_0x1622('0x44')){var _0x435495={};_0x435495[_0x5678c1[_0x1622('0x2d')]]={'$like':'%'+_0x41a25a[_0x1622('0x34')]['filter']+'%'};return _0x435495;}})});}_0x2294ef=_[_0x1622('0x42')]({},_0x2294ef,_0x41a25a[_0x1622('0x45')]);var _0x367c42={'where':_0x2294ef[_0x1622('0x3e')]};return db[_0x1622('0x30')]['count'](_0x367c42)[_0x1622('0x29')](function(_0x3403f3){_0xeede8e[_0x1622('0x46')]=_0x3403f3;if(_0x41a25a[_0x1622('0x34')][_0x1622('0x47')]){_0x2294ef[_0x1622('0x48')]=[{'all':!![]}];}return db[_0x1622('0x30')]['findAll'](_0x2294ef);})[_0x1622('0x29')](function(_0x501967){_0xeede8e[_0x1622('0x49')]=_0x501967;return _0xeede8e;})[_0x1622('0x29')](respondWithFilteredResult(_0x10664c,_0x2294ef))[_0x1622('0x4a')](handleError(_0x10664c,null));};exports[_0x1622('0x4b')]=function(_0x2c2fbc,_0x109432){var _0xfb3fc4={'raw':!![],'where':{'id':_0x2c2fbc[_0x1622('0x4c')]['id']}},_0x171c3e={};_0x171c3e[_0x1622('0x33')]=_['keys'](db[_0x1622('0x30')]['rawAttributes']);_0x171c3e['query']=_[_0x1622('0x35')](_0x2c2fbc['query']);_0x171c3e['filters']=_[_0x1622('0x36')](_0x171c3e['model'],_0x171c3e[_0x1622('0x34')]);_0xfb3fc4[_0x1622('0x37')]=_[_0x1622('0x36')](_0x171c3e['model'],qs['fields'](_0x2c2fbc[_0x1622('0x34')][_0x1622('0x38')]));_0xfb3fc4[_0x1622('0x37')]=_0xfb3fc4[_0x1622('0x37')][_0x1622('0x39')]?_0xfb3fc4[_0x1622('0x37')]:_0x171c3e['model'];if(_0x2c2fbc[_0x1622('0x34')][_0x1622('0x47')]){_0xfb3fc4[_0x1622('0x48')]=[{'all':!![]}];}_0xfb3fc4=_[_0x1622('0x42')]({},_0xfb3fc4,_0x2c2fbc['options']);return db[_0x1622('0x30')][_0x1622('0x4d')](_0xfb3fc4)['then'](handleEntityNotFound(_0x109432,null))['then'](respondWithResult(_0x109432,null))[_0x1622('0x4a')](handleError(_0x109432,null));};exports[_0x1622('0x4e')]=function(_0x4cc346,_0x23f0fc){return db[_0x1622('0x30')][_0x1622('0x4e')](_0x4cc346[_0x1622('0x4f')],{})[_0x1622('0x29')](respondWithResult(_0x23f0fc,0xc9))[_0x1622('0x4a')](handleError(_0x23f0fc,null));};exports['update']=function(_0x57c36c,_0xb47717){if(_0x57c36c[_0x1622('0x4f')]['id']){delete _0x57c36c[_0x1622('0x4f')]['id'];}return db['ZendeskField'][_0x1622('0x4d')]({'where':{'id':_0x57c36c['params']['id']}})[_0x1622('0x29')](handleEntityNotFound(_0xb47717,null))[_0x1622('0x29')](saveUpdates(_0x57c36c[_0x1622('0x4f')],null))[_0x1622('0x29')](respondWithResult(_0xb47717,null))[_0x1622('0x4a')](handleError(_0xb47717,null));};exports[_0x1622('0x2a')]=function(_0x183137,_0x2cbc4e){return db['ZendeskField'][_0x1622('0x4d')]({'where':{'id':_0x183137[_0x1622('0x4c')]['id']}})[_0x1622('0x29')](handleEntityNotFound(_0x2cbc4e,null))[_0x1622('0x29')](removeEntity(_0x2cbc4e,null))[_0x1622('0x4a')](handleError(_0x2cbc4e,null));}; \ No newline at end of file +var _0x2141=['includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','update','then','end','error','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ZendeskField','include','catch','show','params','length'];(function(_0x34cbbf,_0x540ce2){var _0x3ec76e=function(_0x4e77e1){while(--_0x4e77e1){_0x34cbbf['push'](_0x34cbbf['shift']());}};_0x3ec76e(++_0x540ce2);}(_0x2141,0x1ba));var _0x1214=function(_0x11221a,_0xe4a636){_0x11221a=_0x11221a-0x0;var _0x2e6a09=_0x2141[_0x11221a];return _0x2e6a09;};'use strict';var emlformat=require(_0x1214('0x0'));var rimraf=require(_0x1214('0x1'));var zipdir=require(_0x1214('0x2'));var jsonpatch=require(_0x1214('0x3'));var rp=require(_0x1214('0x4'));var moment=require(_0x1214('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1214('0x6'));var path=require(_0x1214('0x7'));var sox=require(_0x1214('0x8'));var csv=require(_0x1214('0x9'));var ejs=require(_0x1214('0xa'));var fs=require('fs');var fs_extra=require(_0x1214('0xb'));var _=require(_0x1214('0xc'));var squel=require(_0x1214('0xd'));var crypto=require(_0x1214('0xe'));var jsforce=require(_0x1214('0xf'));var deskjs=require(_0x1214('0x10'));var toCsv=require(_0x1214('0x9'));var querystring=require(_0x1214('0x11'));var Papa=require(_0x1214('0x12'));var Redis=require(_0x1214('0x13'));var authService=require(_0x1214('0x14'));var qs=require(_0x1214('0x15'));var as=require(_0x1214('0x16'));var hardwareService=require(_0x1214('0x17'));var logger=require('../../config/logger')(_0x1214('0x18'));var utils=require(_0x1214('0x19'));var config=require(_0x1214('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x1214('0x1b'))['db'];function respondWithStatusCode(_0x5e8a48,_0xc193b5){_0xc193b5=_0xc193b5||0xcc;return function(_0x5119d4){if(_0x5119d4){return _0x5e8a48[_0x1214('0x1c')](_0xc193b5);}return _0x5e8a48['status'](_0xc193b5)['end']();};}function respondWithResult(_0x4a382a,_0xf35f7a){_0xf35f7a=_0xf35f7a||0xc8;return function(_0x41678b){if(_0x41678b){return _0x4a382a['status'](_0xf35f7a)[_0x1214('0x1d')](_0x41678b);}};}function respondWithFilteredResult(_0x40b443,_0x4060fe){return function(_0x56b2fb){if(_0x56b2fb){var _0x4a2811=typeof _0x4060fe[_0x1214('0x1e')]===_0x1214('0x1f')&&typeof _0x4060fe[_0x1214('0x20')]===_0x1214('0x1f');var _0x1caf77=_0x56b2fb[_0x1214('0x21')];var _0x2b5c40=_0x4a2811?0x0:_0x4060fe['offset'];var _0xacd32a=_0x4a2811?_0x56b2fb[_0x1214('0x21')]:_0x4060fe[_0x1214('0x1e')]+_0x4060fe['limit'];var _0x2dc2a9;if(_0xacd32a>=_0x1caf77){_0xacd32a=_0x1caf77;_0x2dc2a9=0xc8;}else{_0x2dc2a9=0xce;}_0x40b443[_0x1214('0x22')](_0x2dc2a9);return _0x40b443['set'](_0x1214('0x23'),_0x2b5c40+'-'+_0xacd32a+'/'+_0x1caf77)[_0x1214('0x1d')](_0x56b2fb);}return null;};}function patchUpdates(_0x39e52f){return function(_0xda87b3){try{jsonpatch['apply'](_0xda87b3,_0x39e52f,!![]);}catch(_0x1427dc){return BPromise['reject'](_0x1427dc);}return _0xda87b3['save']();};}function saveUpdates(_0x35ee48,_0x2ad704){return function(_0x52479e){if(_0x52479e){return _0x52479e[_0x1214('0x24')](_0x35ee48)[_0x1214('0x25')](function(_0x370433){return _0x370433;});}return null;};}function removeEntity(_0x5e403d,_0x222b15){return function(_0x31626f){if(_0x31626f){return _0x31626f['destroy']()['then'](function(){_0x5e403d[_0x1214('0x22')](0xcc)[_0x1214('0x26')]();});}};}function handleEntityNotFound(_0x4afb3b,_0x3450cc){return function(_0x5add8c){if(!_0x5add8c){_0x4afb3b['sendStatus'](0x194);}return _0x5add8c;};}function handleError(_0x502aa7,_0x2429ac){_0x2429ac=_0x2429ac||0x1f4;return function(_0x1b5074){logger[_0x1214('0x27')](_0x1b5074['stack']);if(_0x1b5074[_0x1214('0x28')]){delete _0x1b5074[_0x1214('0x28')];}_0x502aa7[_0x1214('0x22')](_0x2429ac)[_0x1214('0x29')](_0x1b5074);};}exports[_0x1214('0x2a')]=function(_0x2d1dc1,_0x4f745b){var _0x133a44={},_0x3b48d9={},_0x471326={'count':0x0,'rows':[]};var _0x479304=_[_0x1214('0x2b')](db['ZendeskField'][_0x1214('0x2c')],function(_0x519287){return{'name':_0x519287['fieldName'],'type':_0x519287[_0x1214('0x2d')][_0x1214('0x2e')]};});_0x3b48d9[_0x1214('0x2f')]=_[_0x1214('0x2b')](_0x479304,_0x1214('0x28'));_0x3b48d9['query']=_[_0x1214('0x30')](_0x2d1dc1[_0x1214('0x31')]);_0x3b48d9[_0x1214('0x32')]=_['intersection'](_0x3b48d9[_0x1214('0x2f')],_0x3b48d9['query']);_0x133a44[_0x1214('0x33')]=_[_0x1214('0x34')](_0x3b48d9[_0x1214('0x2f')],qs['fields'](_0x2d1dc1[_0x1214('0x31')][_0x1214('0x35')]));_0x133a44['attributes']=_0x133a44[_0x1214('0x33')]['length']?_0x133a44[_0x1214('0x33')]:_0x3b48d9[_0x1214('0x2f')];if(!_0x2d1dc1[_0x1214('0x31')][_0x1214('0x36')](_0x1214('0x37'))){_0x133a44[_0x1214('0x20')]=qs['limit'](_0x2d1dc1[_0x1214('0x31')][_0x1214('0x20')]);_0x133a44[_0x1214('0x1e')]=qs['offset'](_0x2d1dc1[_0x1214('0x31')][_0x1214('0x1e')]);}_0x133a44['order']=qs[_0x1214('0x38')](_0x2d1dc1[_0x1214('0x31')][_0x1214('0x38')]);_0x133a44[_0x1214('0x39')]=qs['filters'](_[_0x1214('0x3a')](_0x2d1dc1['query'],_0x3b48d9[_0x1214('0x32')]),_0x479304);if(_0x2d1dc1[_0x1214('0x31')][_0x1214('0x3b')]){_0x133a44[_0x1214('0x39')]=_['merge'](_0x133a44['where'],{'$or':_['map'](_0x479304,function(_0x597ad8){if(_0x597ad8[_0x1214('0x2d')]!==_0x1214('0x3c')){var _0x33cee2={};_0x33cee2[_0x597ad8[_0x1214('0x28')]]={'$like':'%'+_0x2d1dc1[_0x1214('0x31')][_0x1214('0x3b')]+'%'};return _0x33cee2;}})});}_0x133a44=_[_0x1214('0x3d')]({},_0x133a44,_0x2d1dc1[_0x1214('0x3e')]);var _0x12774a={'where':_0x133a44[_0x1214('0x39')]};return db[_0x1214('0x3f')][_0x1214('0x21')](_0x12774a)[_0x1214('0x25')](function(_0x4638a6){_0x471326[_0x1214('0x21')]=_0x4638a6;if(_0x2d1dc1['query']['includeAll']){_0x133a44[_0x1214('0x40')]=[{'all':!![]}];}return db[_0x1214('0x3f')]['findAll'](_0x133a44);})[_0x1214('0x25')](function(_0x2c9f9b){_0x471326['rows']=_0x2c9f9b;return _0x471326;})['then'](respondWithFilteredResult(_0x4f745b,_0x133a44))[_0x1214('0x41')](handleError(_0x4f745b,null));};exports[_0x1214('0x42')]=function(_0x51e3b4,_0x4b529c){var _0x3acbb3={'raw':!![],'where':{'id':_0x51e3b4[_0x1214('0x43')]['id']}},_0x22fc28={};_0x22fc28[_0x1214('0x2f')]=_[_0x1214('0x30')](db[_0x1214('0x3f')][_0x1214('0x2c')]);_0x22fc28[_0x1214('0x31')]=_[_0x1214('0x30')](_0x51e3b4['query']);_0x22fc28[_0x1214('0x32')]=_[_0x1214('0x34')](_0x22fc28['model'],_0x22fc28['query']);_0x3acbb3[_0x1214('0x33')]=_[_0x1214('0x34')](_0x22fc28['model'],qs[_0x1214('0x35')](_0x51e3b4[_0x1214('0x31')][_0x1214('0x35')]));_0x3acbb3[_0x1214('0x33')]=_0x3acbb3['attributes'][_0x1214('0x44')]?_0x3acbb3[_0x1214('0x33')]:_0x22fc28['model'];if(_0x51e3b4[_0x1214('0x31')][_0x1214('0x45')]){_0x3acbb3[_0x1214('0x40')]=[{'all':!![]}];}_0x3acbb3=_[_0x1214('0x3d')]({},_0x3acbb3,_0x51e3b4[_0x1214('0x3e')]);return db[_0x1214('0x3f')]['find'](_0x3acbb3)[_0x1214('0x25')](handleEntityNotFound(_0x4b529c,null))['then'](respondWithResult(_0x4b529c,null))['catch'](handleError(_0x4b529c,null));};exports[_0x1214('0x46')]=function(_0x548951,_0x338284){return db[_0x1214('0x3f')][_0x1214('0x46')](_0x548951[_0x1214('0x47')],{})[_0x1214('0x25')](respondWithResult(_0x338284,0xc9))[_0x1214('0x41')](handleError(_0x338284,null));};exports[_0x1214('0x24')]=function(_0x441157,_0x39657c){if(_0x441157[_0x1214('0x47')]['id']){delete _0x441157[_0x1214('0x47')]['id'];}return db[_0x1214('0x3f')][_0x1214('0x48')]({'where':{'id':_0x441157[_0x1214('0x43')]['id']}})[_0x1214('0x25')](handleEntityNotFound(_0x39657c,null))[_0x1214('0x25')](saveUpdates(_0x441157[_0x1214('0x47')],null))[_0x1214('0x25')](respondWithResult(_0x39657c,null))[_0x1214('0x41')](handleError(_0x39657c,null));};exports['destroy']=function(_0x2d6af2,_0x223d29){return db[_0x1214('0x3f')][_0x1214('0x48')]({'where':{'id':_0x2d6af2[_0x1214('0x43')]['id']}})['then'](handleEntityNotFound(_0x223d29,null))[_0x1214('0x25')](removeEntity(_0x223d29,null))['catch'](handleError(_0x223d29,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1b9f0a9..22e608e 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 _0xe456=['api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x168d12,_0x1ce797){var _0x453344=function(_0x5603be){while(--_0x5603be){_0x168d12['push'](_0x168d12['shift']());}};_0x453344(++_0x1ce797);}(_0xe456,0xd5));var _0x6e45=function(_0x5e227c,_0x2c423a){_0x5e227c=_0x5e227c-0x0;var _0x3ec12f=_0xe456[_0x5e227c];return _0x3ec12f;};'use strict';var _=require(_0x6e45('0x0'));var util=require(_0x6e45('0x1'));var logger=require(_0x6e45('0x2'))(_0x6e45('0x3'));var moment=require('moment');var BPromise=require(_0x6e45('0x4'));var rp=require(_0x6e45('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e45('0x6'));var config=require(_0x6e45('0x7'));var attributes=require(_0x6e45('0x8'));module['exports']=function(_0x3412a6,_0x32b77d){return _0x3412a6['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x6e45('0x9'),'fields':[_0x6e45('0xa'),_0x6e45('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x330c=['bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','idField','util','../../config/logger','api','moment'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x330c,0x7e));var _0xc330=function(_0x213090,_0x27d4dc){_0x213090=_0x213090-0x0;var _0x328b4b=_0x330c[_0x213090];return _0x328b4b;};'use strict';var _=require('lodash');var util=require(_0xc330('0x0'));var logger=require(_0xc330('0x1'))(_0xc330('0x2'));var moment=require(_0xc330('0x3'));var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require('rimraf');var config=require(_0xc330('0x7'));var attributes=require(_0xc330('0x8'));module['exports']=function(_0x27cd9e,_0x510bfa){return _0x27cd9e[_0xc330('0x9')](_0xc330('0xa'),attributes,{'tableName':_0xc330('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc330('0xc'),'FieldId'],'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 49c2c1e..e1a8582 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 _0xa427=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xa427,0x1d6));var _0x7a42=function(_0x1da903,_0x24e111){_0x1da903=_0x1da903-0x0;var _0x35012f=_0xa427[_0x1da903];return _0x35012f;};'use strict';var _=require(_0x7a42('0x0'));var util=require(_0x7a42('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a42('0x2'))['db'];var utils=require(_0x7a42('0x3'));var logger=require(_0x7a42('0x4'))(_0x7a42('0x5'));var config=require(_0x7a42('0x6'));var jayson=require(_0x7a42('0x7'));var client=jayson[_0x7a42('0x8')][_0x7a42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4e8c,_0x52aa83,_0x2a73ca){return new BPromise(function(_0x3fbab9,_0x19b0ed){return client['request'](_0x3d4e8c,_0x2a73ca)[_0x7a42('0xa')](function(_0x35aa14){logger[_0x7a42('0xb')](_0x7a42('0xc'),_0x52aa83,_0x7a42('0xd'));logger[_0x7a42('0xe')](_0x7a42('0xf'),_0x52aa83,_0x7a42('0xd'),JSON[_0x7a42('0x10')](_0x35aa14));if(_0x35aa14[_0x7a42('0x11')]){if(_0x35aa14[_0x7a42('0x11')][_0x7a42('0x12')]===0x1f4){logger[_0x7a42('0x11')]('ZendeskField,\x20%s,\x20%s',_0x52aa83,_0x35aa14['error']['message']);return _0x19b0ed(_0x35aa14[_0x7a42('0x11')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x52aa83,_0x35aa14[_0x7a42('0x11')][_0x7a42('0x13')]);return _0x3fbab9(_0x35aa14[_0x7a42('0x11')]['message']);}else{logger['info'](_0x7a42('0xc'),_0x52aa83,'request\x20sent');_0x3fbab9(_0x35aa14[_0x7a42('0x14')][_0x7a42('0x13')]);}})[_0x7a42('0x15')](function(_0x14dffb){logger[_0x7a42('0x11')](_0x7a42('0xc'),_0x52aa83,_0x14dffb);_0x19b0ed(_0x14dffb);});});} \ No newline at end of file +var _0x15c4=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','then','info'];(function(_0x2c1425,_0x113b86){var _0x527a64=function(_0x2c08e5){while(--_0x2c08e5){_0x2c1425['push'](_0x2c1425['shift']());}};_0x527a64(++_0x113b86);}(_0x15c4,0x1ca));var _0x415c=function(_0x18f40f,_0x43bb01){_0x18f40f=_0x18f40f-0x0;var _0x3183b1=_0x15c4[_0x18f40f];return _0x3183b1;};'use strict';var _=require(_0x415c('0x0'));var util=require('util');var moment=require(_0x415c('0x1'));var BPromise=require(_0x415c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x415c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x415c('0x4'))('rpc');var config=require(_0x415c('0x5'));var jayson=require(_0x415c('0x6'));var client=jayson[_0x415c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319afa,_0x308df1,_0x4bcafb){return new BPromise(function(_0x444880,_0x2d385f){return client['request'](_0x319afa,_0x4bcafb)[_0x415c('0x8')](function(_0x1e1509){logger[_0x415c('0x9')](_0x415c('0xa'),_0x308df1,_0x415c('0xb'));logger[_0x415c('0xc')](_0x415c('0xd'),_0x308df1,'request\x20sent',JSON[_0x415c('0xe')](_0x1e1509));if(_0x1e1509[_0x415c('0xf')]){if(_0x1e1509['error']['code']===0x1f4){logger[_0x415c('0xf')]('ZendeskField,\x20%s,\x20%s',_0x308df1,_0x1e1509[_0x415c('0xf')][_0x415c('0x10')]);return _0x2d385f(_0x1e1509[_0x415c('0xf')]['message']);}logger['error'](_0x415c('0xa'),_0x308df1,_0x1e1509[_0x415c('0xf')][_0x415c('0x10')]);return _0x444880(_0x1e1509[_0x415c('0xf')][_0x415c('0x10')]);}else{logger[_0x415c('0x9')](_0x415c('0xa'),_0x308df1,_0x415c('0xb'));_0x444880(_0x1e1509[_0x415c('0x11')]['message']);}})['catch'](function(_0x5e955b){logger[_0x415c('0xf')]('ZendeskField,\x20%s,\x20%s',_0x308df1,_0x5e955b);_0x2d385f(_0x5e955b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 27abb54..8733d94 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 _0x56b5=['/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','getConfigurations'];(function(_0x4f80cf,_0xecdf13){var _0x471101=function(_0x385b8a){while(--_0x385b8a){_0x4f80cf['push'](_0x4f80cf['shift']());}};_0x471101(++_0xecdf13);}(_0x56b5,0x131));var _0x556b=function(_0x495a07,_0x460cf6){_0x495a07=_0x495a07-0x0;var _0x5514c3=_0x56b5[_0x495a07];return _0x5514c3;};'use strict';var multer=require(_0x556b('0x0'));var util=require('util');var path=require(_0x556b('0x1'));var timeout=require(_0x556b('0x2'));var express=require('express');var router=express[_0x556b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x556b('0x4'));var interaction=require(_0x556b('0x5'));var config=require('../../config/environment');var controller=require(_0x556b('0x6'));router[_0x556b('0x7')]('/',auth[_0x556b('0x8')](),controller['index']);router['get']('/:id',auth[_0x556b('0x8')](),controller['show']);router[_0x556b('0x7')]('/:id/configurations',auth[_0x556b('0x8')](),controller[_0x556b('0x9')]);router[_0x556b('0x7')](_0x556b('0xa'),auth['isAuthenticated'](),controller[_0x556b('0xb')]);router['post']('/',auth[_0x556b('0x8')](),controller['create']);router[_0x556b('0xc')](_0x556b('0xd'),auth[_0x556b('0x8')](),controller[_0x556b('0xe')]);router[_0x556b('0xf')](_0x556b('0x10'),auth['isAuthenticated'](),controller[_0x556b('0x11')]);router[_0x556b('0x12')](_0x556b('0x10'),auth[_0x556b('0x8')](),controller[_0x556b('0x13')]);module[_0x556b('0x14')]=router; \ No newline at end of file +var _0xe3c9=['../../config/environment','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','isAuthenticated','create','addConfiguration','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51c659,_0x4e9322){var _0x1706a1=function(_0x241cf7){while(--_0x241cf7){_0x51c659['push'](_0x51c659['shift']());}};_0x1706a1(++_0x4e9322);}(_0xe3c9,0xa9));var _0x9e3c=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xe3c9[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x9e3c('0x0'));var util=require(_0x9e3c('0x1'));var path=require('path');var timeout=require(_0x9e3c('0x2'));var express=require(_0x9e3c('0x3'));var router=express[_0x9e3c('0x4')]();var fs_extra=require(_0x9e3c('0x5'));var auth=require(_0x9e3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e3c('0x7'));var controller=require('./intZohoAccount.controller');router[_0x9e3c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9e3c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9e3c('0x9')]);router[_0x9e3c('0x8')](_0x9e3c('0xa'),auth['isAuthenticated'](),controller[_0x9e3c('0xb')]);router['get'](_0x9e3c('0xc'),auth['isAuthenticated'](),controller[_0x9e3c('0xd')]);router[_0x9e3c('0xe')]('/',auth[_0x9e3c('0xf')](),controller[_0x9e3c('0x10')]);router['post'](_0x9e3c('0xa'),auth[_0x9e3c('0xf')](),controller[_0x9e3c('0x11')]);router['put'](_0x9e3c('0x12'),auth[_0x9e3c('0xf')](),controller[_0x9e3c('0x13')]);router[_0x9e3c('0x14')](_0x9e3c('0x12'),auth[_0x9e3c('0xf')](),controller['destroy']);module[_0x9e3c('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 b3242eb..f12b5d5 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 _0x9f62=['exports','STRING'];(function(_0x3095e2,_0x4aa4b4){var _0x4792e7=function(_0x2ad939){while(--_0x2ad939){_0x3095e2['push'](_0x3095e2['shift']());}};_0x4792e7(++_0x4aa4b4);}(_0x9f62,0x154));var _0x29f6=function(_0x4b8f5d,_0x189510){_0x4b8f5d=_0x4b8f5d-0x0;var _0x1f31b1=_0x9f62[_0x4b8f5d];return _0x1f31b1;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29f6('0x1')]},'host':{'type':Sequelize[_0x29f6('0x1')]},'zone':{'type':Sequelize[_0x29f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x29f6('0x1')]},'refreshToken':{'type':Sequelize[_0x29f6('0x1')]}}; \ No newline at end of file +var _0x750a=['exports','STRING'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x750a,0x140));var _0xa750=function(_0x2a214b,_0x53faeb){_0x2a214b=_0x2a214b-0x0;var _0x359f25=_0x750a[_0x2a214b];return _0x359f25;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa750('0x1')]},'zone':{'type':Sequelize[_0xa750('0x1')]},'clientId':{'type':Sequelize[_0xa750('0x1')]},'clientSecret':{'type':Sequelize[_0xa750('0x1')]},'serverUrl':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa750('0x1')]},'refreshToken':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b3dab0d..03a696f 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 _0x4cbd=['/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','push','display_label','custom_field','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','length','find','catch','create','body','params','destroy','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST'];(function(_0x357624,_0x2d7a14){var _0x5dc7cc=function(_0x5864fb){while(--_0x5864fb){_0x357624['push'](_0x357624['shift']());}};_0x5dc7cc(++_0x2d7a14);}(_0x4cbd,0x124));var _0xd4cb=function(_0x17e08c,_0x1d7d07){_0x17e08c=_0x17e08c-0x0;var _0x33a755=_0x4cbd[_0x17e08c];return _0x33a755;};'use strict';var emlformat=require(_0xd4cb('0x0'));var rimraf=require(_0xd4cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cb('0x2'));var rp=require(_0xd4cb('0x3'));var moment=require('moment');var BPromise=require(_0xd4cb('0x4'));var Mustache=require(_0xd4cb('0x5'));var util=require('util');var path=require(_0xd4cb('0x6'));var sox=require(_0xd4cb('0x7'));var csv=require('to-csv');var ejs=require(_0xd4cb('0x8'));var fs=require('fs');var fs_extra=require(_0xd4cb('0x9'));var _=require(_0xd4cb('0xa'));var squel=require(_0xd4cb('0xb'));var crypto=require(_0xd4cb('0xc'));var jsforce=require(_0xd4cb('0xd'));var deskjs=require(_0xd4cb('0xe'));var toCsv=require(_0xd4cb('0xf'));var querystring=require(_0xd4cb('0x10'));var Papa=require(_0xd4cb('0x11'));var Redis=require(_0xd4cb('0x12'));var authService=require(_0xd4cb('0x13'));var qs=require(_0xd4cb('0x14'));var as=require(_0xd4cb('0x15'));var hardwareService=require(_0xd4cb('0x16'));var logger=require(_0xd4cb('0x17'))(_0xd4cb('0x18'));var utils=require(_0xd4cb('0x19'));var config=require(_0xd4cb('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e51f2,_0x40bba6){_0x40bba6=_0x40bba6||0xcc;return function(_0x24c8c7){if(_0x24c8c7){return _0x3e51f2[_0xd4cb('0x1b')](_0x40bba6);}return _0x3e51f2[_0xd4cb('0x1c')](_0x40bba6)[_0xd4cb('0x1d')]();};}function respondWithResult(_0x221cf6,_0x3a3498){_0x3a3498=_0x3a3498||0xc8;return function(_0x4d6778){if(_0x4d6778){return _0x221cf6[_0xd4cb('0x1c')](_0x3a3498)[_0xd4cb('0x1e')](_0x4d6778);}};}function respondWithFilteredResult(_0x37b122,_0x5a96aa){return function(_0x159189){if(_0x159189){var _0x453d6e=typeof _0x5a96aa[_0xd4cb('0x1f')]===_0xd4cb('0x20')&&typeof _0x5a96aa[_0xd4cb('0x21')]===_0xd4cb('0x20');var _0x3506c5=_0x159189[_0xd4cb('0x22')];var _0x444f4e=_0x453d6e?0x0:_0x5a96aa[_0xd4cb('0x1f')];var _0x4d6e24=_0x453d6e?_0x159189[_0xd4cb('0x22')]:_0x5a96aa['offset']+_0x5a96aa[_0xd4cb('0x21')];var _0x2fd60d;if(_0x4d6e24>=_0x3506c5){_0x4d6e24=_0x3506c5;_0x2fd60d=0xc8;}else{_0x2fd60d=0xce;}_0x37b122['status'](_0x2fd60d);return _0x37b122[_0xd4cb('0x23')]('Content-Range',_0x444f4e+'-'+_0x4d6e24+'/'+_0x3506c5)['json'](_0x159189);}return null;};}function patchUpdates(_0x3fa59d){return function(_0x264ea5){try{jsonpatch[_0xd4cb('0x24')](_0x264ea5,_0x3fa59d,!![]);}catch(_0x196fc5){return BPromise['reject'](_0x196fc5);}return _0x264ea5['save']();};}function saveUpdates(_0x35f33e,_0x32f7da){return function(_0x4b5f93){if(_0x4b5f93){return _0x4b5f93[_0xd4cb('0x25')](_0x35f33e)[_0xd4cb('0x26')](function(_0x4bff02){return _0x4bff02;});}return null;};}function removeEntity(_0x3a29a0,_0x3d3c8c){return function(_0xad0583){if(_0xad0583){return _0xad0583['destroy']()[_0xd4cb('0x26')](function(){_0x3a29a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17d74f,_0x202875){return function(_0x5e10a3){if(!_0x5e10a3){_0x17d74f['sendStatus'](0x194);}return _0x5e10a3;};}function handleError(_0x1ae007,_0x543433){_0x543433=_0x543433||0x1f4;return function(_0x35b7c6){logger[_0xd4cb('0x27')](_0x35b7c6[_0xd4cb('0x28')]);if(_0x35b7c6[_0xd4cb('0x29')]){delete _0x35b7c6[_0xd4cb('0x29')];}_0x1ae007[_0xd4cb('0x1c')](_0x543433)['send'](_0x35b7c6);};}exports['index']=function(_0x583f1b,_0x348863){var _0x464a6a={},_0x224cad={},_0x3e2a05={'count':0x0,'rows':[]};var _0x1a400f=_[_0xd4cb('0x2a')](db[_0xd4cb('0x2b')][_0xd4cb('0x2c')],function(_0x386469){return{'name':_0x386469[_0xd4cb('0x2d')],'type':_0x386469[_0xd4cb('0x2e')][_0xd4cb('0x2f')]};});_0x224cad[_0xd4cb('0x30')]=_[_0xd4cb('0x2a')](_0x1a400f,_0xd4cb('0x29'));_0x224cad[_0xd4cb('0x31')]=_[_0xd4cb('0x32')](_0x583f1b['query']);_0x224cad[_0xd4cb('0x33')]=_['intersection'](_0x224cad[_0xd4cb('0x30')],_0x224cad[_0xd4cb('0x31')]);_0x464a6a[_0xd4cb('0x34')]=_['intersection'](_0x224cad['model'],qs[_0xd4cb('0x35')](_0x583f1b[_0xd4cb('0x31')][_0xd4cb('0x35')]));_0x464a6a[_0xd4cb('0x34')]=_0x464a6a[_0xd4cb('0x34')]['length']?_0x464a6a[_0xd4cb('0x34')]:_0x224cad[_0xd4cb('0x30')];if(!_0x583f1b[_0xd4cb('0x31')][_0xd4cb('0x36')]('nolimit')){_0x464a6a[_0xd4cb('0x21')]=qs[_0xd4cb('0x21')](_0x583f1b[_0xd4cb('0x31')][_0xd4cb('0x21')]);_0x464a6a[_0xd4cb('0x1f')]=qs[_0xd4cb('0x1f')](_0x583f1b[_0xd4cb('0x31')][_0xd4cb('0x1f')]);}_0x464a6a['order']=qs[_0xd4cb('0x37')](_0x583f1b['query'][_0xd4cb('0x37')]);_0x464a6a[_0xd4cb('0x38')]=qs[_0xd4cb('0x33')](_[_0xd4cb('0x39')](_0x583f1b[_0xd4cb('0x31')],_0x224cad[_0xd4cb('0x33')]),_0x1a400f);if(_0x583f1b['query'][_0xd4cb('0x3a')]){_0x464a6a[_0xd4cb('0x38')]=_[_0xd4cb('0x3b')](_0x464a6a['where'],{'$or':_[_0xd4cb('0x2a')](_0x1a400f,function(_0x586a2a){if(_0x586a2a[_0xd4cb('0x2e')]!==_0xd4cb('0x3c')){var _0x244f1e={};_0x244f1e[_0x586a2a[_0xd4cb('0x29')]]={'$like':'%'+_0x583f1b['query'][_0xd4cb('0x3a')]+'%'};return _0x244f1e;}})});}_0x464a6a=_['merge']({},_0x464a6a,_0x583f1b[_0xd4cb('0x3d')]);var _0x74ce04={'where':_0x464a6a[_0xd4cb('0x38')]};return db[_0xd4cb('0x2b')][_0xd4cb('0x22')](_0x74ce04)['then'](function(_0x2d745d){_0x3e2a05[_0xd4cb('0x22')]=_0x2d745d;if(_0x583f1b[_0xd4cb('0x31')][_0xd4cb('0x3e')]){_0x464a6a[_0xd4cb('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0xd4cb('0x40')](_0x464a6a);})[_0xd4cb('0x26')](function(_0x143371){_0x3e2a05[_0xd4cb('0x41')]=_0x143371;return _0x3e2a05;})[_0xd4cb('0x26')](respondWithFilteredResult(_0x348863,_0x464a6a))['catch'](handleError(_0x348863,null));};exports['show']=function(_0x2a38fe,_0x4a02aa){var _0xdd1c33={'raw':![],'where':{'id':_0x2a38fe['params']['id']}},_0x351b98={};_0x351b98[_0xd4cb('0x30')]=_['keys'](db[_0xd4cb('0x2b')]['rawAttributes']);_0x351b98[_0xd4cb('0x31')]=_[_0xd4cb('0x32')](_0x2a38fe[_0xd4cb('0x31')]);_0x351b98[_0xd4cb('0x33')]=_[_0xd4cb('0x42')](_0x351b98[_0xd4cb('0x30')],_0x351b98[_0xd4cb('0x31')]);_0xdd1c33[_0xd4cb('0x34')]=_[_0xd4cb('0x42')](_0x351b98[_0xd4cb('0x30')],qs[_0xd4cb('0x35')](_0x2a38fe[_0xd4cb('0x31')][_0xd4cb('0x35')]));_0xdd1c33['attributes']=_0xdd1c33['attributes'][_0xd4cb('0x43')]?_0xdd1c33['attributes']:_0x351b98['model'];if(_0x2a38fe[_0xd4cb('0x31')][_0xd4cb('0x3e')]){_0xdd1c33[_0xd4cb('0x3f')]=[{'all':!![]}];}_0xdd1c33=_[_0xd4cb('0x3b')]({},_0xdd1c33,_0x2a38fe[_0xd4cb('0x3d')]);return db[_0xd4cb('0x2b')][_0xd4cb('0x44')](_0xdd1c33)['then'](handleEntityNotFound(_0x4a02aa,null))[_0xd4cb('0x26')](respondWithResult(_0x4a02aa,null))[_0xd4cb('0x45')](handleError(_0x4a02aa,null));};exports['create']=function(_0x25f7d9,_0x348246){return db[_0xd4cb('0x2b')][_0xd4cb('0x46')](_0x25f7d9['body'],{})[_0xd4cb('0x26')](respondWithResult(_0x348246,0xc9))['catch'](handleError(_0x348246,null));};exports[_0xd4cb('0x25')]=function(_0x426518,_0x31fd48){if(_0x426518[_0xd4cb('0x47')]['id']){delete _0x426518['body']['id'];}return db[_0xd4cb('0x2b')][_0xd4cb('0x44')]({'where':{'id':_0x426518[_0xd4cb('0x48')]['id']}})[_0xd4cb('0x26')](handleEntityNotFound(_0x31fd48,null))[_0xd4cb('0x26')](saveUpdates(_0x426518[_0xd4cb('0x47')],null))[_0xd4cb('0x26')](respondWithResult(_0x31fd48,null))[_0xd4cb('0x45')](handleError(_0x31fd48,null));};exports[_0xd4cb('0x49')]=function(_0x310a48,_0x46a8fa){return db['ZohoAccount']['find']({'where':{'id':_0x310a48[_0xd4cb('0x48')]['id']}})[_0xd4cb('0x26')](handleEntityNotFound(_0x46a8fa,null))['then'](removeEntity(_0x46a8fa,null))[_0xd4cb('0x45')](handleError(_0x46a8fa,null));};exports[_0xd4cb('0x4a')]=function(_0x42e2cc,_0x484dbc,_0x420712){var _0xd4963b={};var _0x1139d7={};var _0x2dceac;var _0x378115;return db[_0xd4cb('0x2b')][_0xd4cb('0x4b')]({'where':{'id':_0x42e2cc[_0xd4cb('0x48')]['id']}})['then'](handleEntityNotFound(_0x484dbc,null))[_0xd4cb('0x26')](function(_0x14e394){if(_0x14e394){_0x2dceac=_0x14e394;_0x1139d7[_0xd4cb('0x30')]=_[_0xd4cb('0x32')](db['ZohoConfiguration'][_0xd4cb('0x2c')]);_0x1139d7[_0xd4cb('0x31')]=_['keys'](_0x42e2cc[_0xd4cb('0x31')]);_0x1139d7[_0xd4cb('0x33')]=_['intersection'](_0x1139d7[_0xd4cb('0x30')],_0x1139d7[_0xd4cb('0x31')]);_0xd4963b[_0xd4cb('0x34')]=_[_0xd4cb('0x42')](_0x1139d7[_0xd4cb('0x30')],qs[_0xd4cb('0x35')](_0x42e2cc['query']['fields']));_0xd4963b[_0xd4cb('0x34')]=_0xd4963b['attributes'][_0xd4cb('0x43')]?_0xd4963b[_0xd4cb('0x34')]:_0x1139d7['model'];_0xd4963b[_0xd4cb('0x4c')]=qs[_0xd4cb('0x37')](_0x42e2cc[_0xd4cb('0x31')][_0xd4cb('0x37')]);_0xd4963b['where']=qs[_0xd4cb('0x33')](_[_0xd4cb('0x39')](_0x42e2cc[_0xd4cb('0x31')],_0x1139d7[_0xd4cb('0x33')]));if(_0x42e2cc[_0xd4cb('0x31')]['filter']){_0xd4963b['where']=_[_0xd4cb('0x3b')](_0xd4963b[_0xd4cb('0x38')],{'$or':_[_0xd4cb('0x2a')](_0xd4963b[_0xd4cb('0x34')],function(_0x5b4987){var _0x44aac6={};_0x44aac6[_0x5b4987]={'$like':'%'+_0x42e2cc[_0xd4cb('0x31')]['filter']+'%'};return _0x44aac6;})});}_0xd4963b=_[_0xd4cb('0x3b')]({},_0xd4963b,_0x42e2cc[_0xd4cb('0x3d')]);return _0x2dceac[_0xd4cb('0x4a')](_0xd4963b);}})['then'](function(_0x996b69){if(_0x996b69){_0x378115=_0x996b69['length'];if(!_0x42e2cc[_0xd4cb('0x31')][_0xd4cb('0x36')]('nolimit')){_0xd4963b[_0xd4cb('0x21')]=qs[_0xd4cb('0x21')](_0x42e2cc[_0xd4cb('0x31')][_0xd4cb('0x21')]);_0xd4963b[_0xd4cb('0x1f')]=qs['offset'](_0x42e2cc[_0xd4cb('0x31')][_0xd4cb('0x1f')]);}return _0x2dceac[_0xd4cb('0x4a')](_0xd4963b);}})[_0xd4cb('0x26')](function(_0x46c1f2){if(_0x46c1f2){return _0x46c1f2?{'count':_0x378115,'rows':_0x46c1f2}:null;}})['then'](respondWithResult(_0x484dbc,null))[_0xd4cb('0x45')](handleError(_0x484dbc,null));};exports[_0xd4cb('0x4d')]=function(_0x47627c,_0x256a72,_0x4469d3){if(_0x47627c[_0xd4cb('0x47')]['id']){delete _0x47627c[_0xd4cb('0x47')]['id'];}return db[_0xd4cb('0x2b')][_0xd4cb('0x4b')]({'where':{'id':_0x47627c[_0xd4cb('0x48')]['id']}})[_0xd4cb('0x26')](handleEntityNotFound(_0x256a72,null))[_0xd4cb('0x26')](function(_0x2dd542){if(_0x2dd542){_0x47627c[_0xd4cb('0x47')]['AccountId']=_0x2dd542['id'];_0x47627c['body'][_0xd4cb('0x4e')]=integrations[_0xd4cb('0x4f')](_0x47627c[_0xd4cb('0x47')][_0xd4cb('0x50')],_0x47627c['body'][_0xd4cb('0x2e')]);_0x47627c['body'][_0xd4cb('0x51')]=integrations[_0xd4cb('0x52')](_0x47627c[_0xd4cb('0x47')][_0xd4cb('0x50')],_0x47627c[_0xd4cb('0x47')][_0xd4cb('0x2e')]);return db[_0xd4cb('0x53')][_0xd4cb('0x46')](_0x47627c['body'],{'include':[{'model':db['ZohoField'],'as':_0xd4cb('0x4e')},{'model':db[_0xd4cb('0x54')],'as':_0xd4cb('0x51')}]});}return null;})[_0xd4cb('0x26')](respondWithResult(_0x256a72,null))[_0xd4cb('0x45')](handleError(_0x256a72,null));};function getAccessToken(_0x58fed2){return new Promise(function(_0x1b5839,_0x51d0c1){var _0xf30bdf;switch(_0x58fed2['zone']){case'US':_0xf30bdf='https://accounts.zoho.com';break;case'AU':_0xf30bdf=_0xd4cb('0x55');break;case'EU':_0xf30bdf='https://accounts.zoho.eu';break;case'IN':_0xf30bdf='https://accounts.zoho.in';break;case'CN':_0xf30bdf=_0xd4cb('0x56');break;default:_0xf30bdf=_0xd4cb('0x57');break;}var _0x97a51a={'method':_0xd4cb('0x58'),'uri':_0xf30bdf+_0xd4cb('0x59'),'qs':{'refresh_token':_0x58fed2['refreshToken'],'client_id':_0x58fed2[_0xd4cb('0x5a')],'client_secret':_0x58fed2[_0xd4cb('0x5b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x97a51a)[_0xd4cb('0x26')](function(_0xc90089){if(_0xc90089[_0xd4cb('0x5c')]){_0x1b5839(_0xc90089[_0xd4cb('0x5c')]);}else{_0x51d0c1(_0xd4cb('0x5d'));}})[_0xd4cb('0x45')](function(_0xc1228a){_0x51d0c1(_0xc1228a);});});}exports[_0xd4cb('0x5e')]=function(_0x126a37,_0x17ad2b,_0x118352){var _0x4f80b4,_0x44d3bb,_0x172308,_0x168320,_0x3b2423;return db[_0xd4cb('0x2b')][_0xd4cb('0x4b')]({'where':{'id':_0x126a37[_0xd4cb('0x48')]['id']},'attributes':['id',_0xd4cb('0x5f'),_0xd4cb('0x60'),_0xd4cb('0x5a'),_0xd4cb('0x5b'),_0xd4cb('0x61'),_0xd4cb('0x62'),'refreshToken']})[_0xd4cb('0x26')](handleEntityNotFound(_0x17ad2b,null))['then'](function(_0x13492b){_0x3b2423=_0x13492b;_0x4f80b4=_0x3b2423[_0xd4cb('0x5f')];_0x44d3bb=_0x4f80b4==='zoho.eu'?'eu':_0xd4cb('0x63');_0x172308=_0x3b2423[_0xd4cb('0x61')];var _0x51ddde=_0x172308[_0xd4cb('0x64')](-0x1);if(_0x51ddde==='/'||_0x51ddde==='\x5c'||_0x51ddde===':'){_0x172308=_0x172308[_0xd4cb('0x65')](0x0,_0x172308['lastIndexOf'](_0x51ddde));}if(!_0x3b2423[_0xd4cb('0x66')]){throw new Error(_0xd4cb('0x67'));}return getAccessToken(_0x3b2423);})['then'](function(_0x576a09){if(_0x576a09){return rp({'method':'GET','uri':util['format'](_0xd4cb('0x68'),_0x44d3bb),'qs':{'module':_0xd4cb('0x69')},'headers':{'Authorization':_0xd4cb('0x6a')+_0x576a09},'json':!![]});}})[_0xd4cb('0x26')](function(_0x2a3054){if(_0x2a3054){if(_0x2a3054[_0xd4cb('0x6b')]&&_0x2a3054[_0xd4cb('0x6b')][_0xd4cb('0x27')]){throw new Error(_0x2a3054[_0xd4cb('0x6b')]['error']['message']);}var _0x56758a=[];var _0x2e02f9=[];var _0x7eae9f=[_0xd4cb('0x6c'),_0xd4cb('0x6d'),_0xd4cb('0x6e'),_0xd4cb('0x6f'),_0xd4cb('0x70'),_0xd4cb('0x71'),_0xd4cb('0x72'),'Call_Type'];_0x2e02f9=_[_0xd4cb('0x73')](_0x2a3054[_0xd4cb('0x35')],function(_0x13a165){return _0x7eae9f[_0xd4cb('0x74')](_0x13a165[_0xd4cb('0x75')]);});for(var _0x4947d4=0x0;_0x4947d4<_0x2e02f9['length'];_0x4947d4++){if(_0x2e02f9[_0x4947d4]['system_mandatory']===![]){_0x56758a[_0xd4cb('0x76')]({'id':_0x2e02f9[_0x4947d4]['id'],'name':_0x2e02f9[_0x4947d4][_0xd4cb('0x77')],'custom':_0x2e02f9[_0x4947d4][_0xd4cb('0x78')],'options':_0x2e02f9[_0x4947d4]['data_type']==='picklist'&&_0x2e02f9[_0x4947d4][_0xd4cb('0x79')]['length']>-0x1?_[_0xd4cb('0x2a')](_0x2e02f9[_0x4947d4][_0xd4cb('0x79')],function(_0x19b2bf){return{'name':_0x19b2bf,'value':_0x19b2bf};}):[]});}}return{'count':_0x56758a[_0xd4cb('0x43')],'rows':_0x56758a};}else{return{'count':0x0,'rows':[]};}})[_0xd4cb('0x26')](respondWithResult(_0x17ad2b,null))[_0xd4cb('0x45')](function(_0x107589){var _0x51398c=_0x126a37[_0xd4cb('0x31')][_0xd4cb('0x7a')]?0x1f4:_0x107589['statusCode']||0x1f4;logger[_0xd4cb('0x27')](_0xd4cb('0x7b'),_0xd4cb('0x5e'),_0x51398c,JSON[_0xd4cb('0x7c')](_0x107589));delete _0x107589[_0xd4cb('0x29')];if(_0x51398c===0x191){_0x51398c=0x190;}_0x17ad2b[_0xd4cb('0x1c')](_0x51398c)[_0xd4cb('0x7d')](_0x126a37[_0xd4cb('0x31')]['test']?{'message':_0xd4cb('0x7e'),'statusCode':_0x107589['statusCode']}:_0x107589);});}; \ No newline at end of file +var _0x4f79=['Content-Range','apply','save','update','destroy','then','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','catch','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x508571,_0x4cc101){var _0x4b54a5=function(_0xf0d084){while(--_0xf0d084){_0x508571['push'](_0x508571['shift']());}};_0x4b54a5(++_0x4cc101);}(_0x4f79,0x1f3));var _0x94f7=function(_0x57fff9,_0xecd348){_0x57fff9=_0x57fff9-0x0;var _0x580fd4=_0x4f79[_0x57fff9];return _0x580fd4;};'use strict';var emlformat=require(_0x94f7('0x0'));var rimraf=require(_0x94f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x94f7('0x2'));var moment=require(_0x94f7('0x3'));var BPromise=require(_0x94f7('0x4'));var Mustache=require(_0x94f7('0x5'));var util=require('util');var path=require(_0x94f7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94f7('0x7'));var fs=require('fs');var fs_extra=require(_0x94f7('0x8'));var _=require(_0x94f7('0x9'));var squel=require(_0x94f7('0xa'));var crypto=require('crypto');var jsforce=require(_0x94f7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x94f7('0xc'));var Redis=require('ioredis');var authService=require(_0x94f7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x94f7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94f7('0xf'))('api');var utils=require(_0x94f7('0x10'));var config=require(_0x94f7('0x11'));var licenseUtil=require(_0x94f7('0x12'));var db=require(_0x94f7('0x13'))['db'];var integrations=require(_0x94f7('0x14'));function respondWithStatusCode(_0x4b7fda,_0xe9d73b){_0xe9d73b=_0xe9d73b||0xcc;return function(_0x547d08){if(_0x547d08){return _0x4b7fda[_0x94f7('0x15')](_0xe9d73b);}return _0x4b7fda[_0x94f7('0x16')](_0xe9d73b)[_0x94f7('0x17')]();};}function respondWithResult(_0x49c28f,_0x2ae15d){_0x2ae15d=_0x2ae15d||0xc8;return function(_0x195064){if(_0x195064){return _0x49c28f['status'](_0x2ae15d)[_0x94f7('0x18')](_0x195064);}};}function respondWithFilteredResult(_0x384ae2,_0x999e57){return function(_0x5540c0){if(_0x5540c0){var _0x1fb6d9=typeof _0x999e57[_0x94f7('0x19')]===_0x94f7('0x1a')&&typeof _0x999e57[_0x94f7('0x1b')]===_0x94f7('0x1a');var _0x144691=_0x5540c0[_0x94f7('0x1c')];var _0x832988=_0x1fb6d9?0x0:_0x999e57[_0x94f7('0x19')];var _0x32ad01=_0x1fb6d9?_0x5540c0[_0x94f7('0x1c')]:_0x999e57[_0x94f7('0x19')]+_0x999e57[_0x94f7('0x1b')];var _0x2cd92d;if(_0x32ad01>=_0x144691){_0x32ad01=_0x144691;_0x2cd92d=0xc8;}else{_0x2cd92d=0xce;}_0x384ae2[_0x94f7('0x16')](_0x2cd92d);return _0x384ae2['set'](_0x94f7('0x1d'),_0x832988+'-'+_0x32ad01+'/'+_0x144691)[_0x94f7('0x18')](_0x5540c0);}return null;};}function patchUpdates(_0x2ee697){return function(_0x25e7bc){try{jsonpatch[_0x94f7('0x1e')](_0x25e7bc,_0x2ee697,!![]);}catch(_0x220a92){return BPromise['reject'](_0x220a92);}return _0x25e7bc[_0x94f7('0x1f')]();};}function saveUpdates(_0x400b9b,_0x589b80){return function(_0x3d2242){if(_0x3d2242){return _0x3d2242[_0x94f7('0x20')](_0x400b9b)['then'](function(_0x367d69){return _0x367d69;});}return null;};}function removeEntity(_0xa8ed93,_0x553052){return function(_0x1c05b9){if(_0x1c05b9){return _0x1c05b9[_0x94f7('0x21')]()[_0x94f7('0x22')](function(){_0xa8ed93[_0x94f7('0x16')](0xcc)[_0x94f7('0x17')]();});}};}function handleEntityNotFound(_0x181cbd,_0x5222d9){return function(_0x13c937){if(!_0x13c937){_0x181cbd[_0x94f7('0x15')](0x194);}return _0x13c937;};}function handleError(_0x574445,_0x4fe292){_0x4fe292=_0x4fe292||0x1f4;return function(_0x2e711e){logger['error'](_0x2e711e[_0x94f7('0x23')]);if(_0x2e711e['name']){delete _0x2e711e['name'];}_0x574445['status'](_0x4fe292)['send'](_0x2e711e);};}exports[_0x94f7('0x24')]=function(_0x4ac5ce,_0x474488){var _0x2005e8={},_0x57528a={},_0x27b314={'count':0x0,'rows':[]};var _0x22f646=_[_0x94f7('0x25')](db['ZohoAccount'][_0x94f7('0x26')],function(_0x3a3aed){return{'name':_0x3a3aed[_0x94f7('0x27')],'type':_0x3a3aed[_0x94f7('0x28')][_0x94f7('0x29')]};});_0x57528a[_0x94f7('0x2a')]=_[_0x94f7('0x25')](_0x22f646,_0x94f7('0x2b'));_0x57528a[_0x94f7('0x2c')]=_[_0x94f7('0x2d')](_0x4ac5ce[_0x94f7('0x2c')]);_0x57528a[_0x94f7('0x2e')]=_[_0x94f7('0x2f')](_0x57528a[_0x94f7('0x2a')],_0x57528a[_0x94f7('0x2c')]);_0x2005e8[_0x94f7('0x30')]=_[_0x94f7('0x2f')](_0x57528a['model'],qs[_0x94f7('0x31')](_0x4ac5ce[_0x94f7('0x2c')][_0x94f7('0x31')]));_0x2005e8[_0x94f7('0x30')]=_0x2005e8[_0x94f7('0x30')][_0x94f7('0x32')]?_0x2005e8['attributes']:_0x57528a[_0x94f7('0x2a')];if(!_0x4ac5ce['query'][_0x94f7('0x33')](_0x94f7('0x34'))){_0x2005e8[_0x94f7('0x1b')]=qs['limit'](_0x4ac5ce[_0x94f7('0x2c')][_0x94f7('0x1b')]);_0x2005e8[_0x94f7('0x19')]=qs[_0x94f7('0x19')](_0x4ac5ce[_0x94f7('0x2c')][_0x94f7('0x19')]);}_0x2005e8[_0x94f7('0x35')]=qs[_0x94f7('0x36')](_0x4ac5ce[_0x94f7('0x2c')][_0x94f7('0x36')]);_0x2005e8[_0x94f7('0x37')]=qs[_0x94f7('0x2e')](_[_0x94f7('0x38')](_0x4ac5ce[_0x94f7('0x2c')],_0x57528a['filters']),_0x22f646);if(_0x4ac5ce['query'][_0x94f7('0x39')]){_0x2005e8['where']=_[_0x94f7('0x3a')](_0x2005e8[_0x94f7('0x37')],{'$or':_[_0x94f7('0x25')](_0x22f646,function(_0x8e0c17){if(_0x8e0c17['type']!==_0x94f7('0x3b')){var _0x412e34={};_0x412e34[_0x8e0c17[_0x94f7('0x2b')]]={'$like':'%'+_0x4ac5ce['query'][_0x94f7('0x39')]+'%'};return _0x412e34;}})});}_0x2005e8=_[_0x94f7('0x3a')]({},_0x2005e8,_0x4ac5ce[_0x94f7('0x3c')]);var _0x44a13f={'where':_0x2005e8[_0x94f7('0x37')]};return db[_0x94f7('0x3d')][_0x94f7('0x1c')](_0x44a13f)[_0x94f7('0x22')](function(_0x55b459){_0x27b314[_0x94f7('0x1c')]=_0x55b459;if(_0x4ac5ce[_0x94f7('0x2c')][_0x94f7('0x3e')]){_0x2005e8['include']=[{'all':!![]}];}return db[_0x94f7('0x3d')]['findAll'](_0x2005e8);})['then'](function(_0x1e6548){_0x27b314['rows']=_0x1e6548;return _0x27b314;})[_0x94f7('0x22')](respondWithFilteredResult(_0x474488,_0x2005e8))[_0x94f7('0x3f')](handleError(_0x474488,null));};exports[_0x94f7('0x40')]=function(_0x2e9ca4,_0x114bec){var _0x4e2735={'raw':![],'where':{'id':_0x2e9ca4[_0x94f7('0x41')]['id']}},_0x3eaf22={};_0x3eaf22[_0x94f7('0x2a')]=_['keys'](db[_0x94f7('0x3d')]['rawAttributes']);_0x3eaf22[_0x94f7('0x2c')]=_[_0x94f7('0x2d')](_0x2e9ca4[_0x94f7('0x2c')]);_0x3eaf22['filters']=_[_0x94f7('0x2f')](_0x3eaf22['model'],_0x3eaf22[_0x94f7('0x2c')]);_0x4e2735[_0x94f7('0x30')]=_[_0x94f7('0x2f')](_0x3eaf22[_0x94f7('0x2a')],qs[_0x94f7('0x31')](_0x2e9ca4[_0x94f7('0x2c')][_0x94f7('0x31')]));_0x4e2735[_0x94f7('0x30')]=_0x4e2735['attributes']['length']?_0x4e2735[_0x94f7('0x30')]:_0x3eaf22['model'];if(_0x2e9ca4[_0x94f7('0x2c')][_0x94f7('0x3e')]){_0x4e2735[_0x94f7('0x42')]=[{'all':!![]}];}_0x4e2735=_[_0x94f7('0x3a')]({},_0x4e2735,_0x2e9ca4[_0x94f7('0x3c')]);return db[_0x94f7('0x3d')][_0x94f7('0x43')](_0x4e2735)[_0x94f7('0x22')](handleEntityNotFound(_0x114bec,null))[_0x94f7('0x22')](respondWithResult(_0x114bec,null))[_0x94f7('0x3f')](handleError(_0x114bec,null));};exports[_0x94f7('0x44')]=function(_0x5bfed1,_0x51352a){return db[_0x94f7('0x3d')]['create'](_0x5bfed1[_0x94f7('0x45')],{})[_0x94f7('0x22')](respondWithResult(_0x51352a,0xc9))[_0x94f7('0x3f')](handleError(_0x51352a,null));};exports[_0x94f7('0x20')]=function(_0x1458aa,_0x771d19){if(_0x1458aa[_0x94f7('0x45')]['id']){delete _0x1458aa[_0x94f7('0x45')]['id'];}return db['ZohoAccount'][_0x94f7('0x43')]({'where':{'id':_0x1458aa['params']['id']}})[_0x94f7('0x22')](handleEntityNotFound(_0x771d19,null))[_0x94f7('0x22')](saveUpdates(_0x1458aa['body'],null))[_0x94f7('0x22')](respondWithResult(_0x771d19,null))['catch'](handleError(_0x771d19,null));};exports[_0x94f7('0x21')]=function(_0x5a434b,_0x1fc7cd){return db[_0x94f7('0x3d')]['find']({'where':{'id':_0x5a434b[_0x94f7('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fc7cd,null))[_0x94f7('0x22')](removeEntity(_0x1fc7cd,null))['catch'](handleError(_0x1fc7cd,null));};exports[_0x94f7('0x46')]=function(_0x10a0c1,_0x10900d,_0x3b0ecd){var _0x3ced35={};var _0x1a7589={};var _0x36e9be;var _0xbdf8e8;return db[_0x94f7('0x3d')][_0x94f7('0x47')]({'where':{'id':_0x10a0c1[_0x94f7('0x41')]['id']}})[_0x94f7('0x22')](handleEntityNotFound(_0x10900d,null))['then'](function(_0x160220){if(_0x160220){_0x36e9be=_0x160220;_0x1a7589[_0x94f7('0x2a')]=_[_0x94f7('0x2d')](db['ZohoConfiguration']['rawAttributes']);_0x1a7589[_0x94f7('0x2c')]=_[_0x94f7('0x2d')](_0x10a0c1[_0x94f7('0x2c')]);_0x1a7589[_0x94f7('0x2e')]=_[_0x94f7('0x2f')](_0x1a7589[_0x94f7('0x2a')],_0x1a7589['query']);_0x3ced35['attributes']=_[_0x94f7('0x2f')](_0x1a7589[_0x94f7('0x2a')],qs[_0x94f7('0x31')](_0x10a0c1[_0x94f7('0x2c')]['fields']));_0x3ced35[_0x94f7('0x30')]=_0x3ced35['attributes']['length']?_0x3ced35[_0x94f7('0x30')]:_0x1a7589[_0x94f7('0x2a')];_0x3ced35[_0x94f7('0x35')]=qs[_0x94f7('0x36')](_0x10a0c1[_0x94f7('0x2c')][_0x94f7('0x36')]);_0x3ced35[_0x94f7('0x37')]=qs[_0x94f7('0x2e')](_['pick'](_0x10a0c1['query'],_0x1a7589['filters']));if(_0x10a0c1[_0x94f7('0x2c')][_0x94f7('0x39')]){_0x3ced35['where']=_[_0x94f7('0x3a')](_0x3ced35[_0x94f7('0x37')],{'$or':_[_0x94f7('0x25')](_0x3ced35['attributes'],function(_0x3554b7){var _0x39fbcb={};_0x39fbcb[_0x3554b7]={'$like':'%'+_0x10a0c1[_0x94f7('0x2c')]['filter']+'%'};return _0x39fbcb;})});}_0x3ced35=_[_0x94f7('0x3a')]({},_0x3ced35,_0x10a0c1[_0x94f7('0x3c')]);return _0x36e9be[_0x94f7('0x46')](_0x3ced35);}})[_0x94f7('0x22')](function(_0x300774){if(_0x300774){_0xbdf8e8=_0x300774['length'];if(!_0x10a0c1[_0x94f7('0x2c')][_0x94f7('0x33')](_0x94f7('0x34'))){_0x3ced35[_0x94f7('0x1b')]=qs['limit'](_0x10a0c1[_0x94f7('0x2c')][_0x94f7('0x1b')]);_0x3ced35[_0x94f7('0x19')]=qs[_0x94f7('0x19')](_0x10a0c1['query'][_0x94f7('0x19')]);}return _0x36e9be[_0x94f7('0x46')](_0x3ced35);}})['then'](function(_0x2db2e9){if(_0x2db2e9){return _0x2db2e9?{'count':_0xbdf8e8,'rows':_0x2db2e9}:null;}})[_0x94f7('0x22')](respondWithResult(_0x10900d,null))['catch'](handleError(_0x10900d,null));};exports[_0x94f7('0x48')]=function(_0x4913b0,_0x3e2a1c,_0x2dcea9){if(_0x4913b0[_0x94f7('0x45')]['id']){delete _0x4913b0[_0x94f7('0x45')]['id'];}return db[_0x94f7('0x3d')][_0x94f7('0x47')]({'where':{'id':_0x4913b0['params']['id']}})[_0x94f7('0x22')](handleEntityNotFound(_0x3e2a1c,null))['then'](function(_0x9d7d5f){if(_0x9d7d5f){_0x4913b0[_0x94f7('0x45')][_0x94f7('0x49')]=_0x9d7d5f['id'];_0x4913b0[_0x94f7('0x45')][_0x94f7('0x4a')]=integrations[_0x94f7('0x4b')](_0x4913b0[_0x94f7('0x45')][_0x94f7('0x4c')],_0x4913b0['body'][_0x94f7('0x28')]);_0x4913b0['body']['Descriptions']=integrations[_0x94f7('0x4d')](_0x4913b0['body']['channel'],_0x4913b0[_0x94f7('0x45')][_0x94f7('0x28')]);return db[_0x94f7('0x4e')]['create'](_0x4913b0[_0x94f7('0x45')],{'include':[{'model':db[_0x94f7('0x4f')],'as':'Subjects'},{'model':db[_0x94f7('0x4f')],'as':_0x94f7('0x50')}]});}return null;})[_0x94f7('0x22')](respondWithResult(_0x3e2a1c,null))['catch'](handleError(_0x3e2a1c,null));};function getAccessToken(_0x33b668){return new Promise(function(_0x3c53de,_0xdb12ae){var _0x20acf3;switch(_0x33b668[_0x94f7('0x51')]){case'US':_0x20acf3=_0x94f7('0x52');break;case'AU':_0x20acf3=_0x94f7('0x53');break;case'EU':_0x20acf3='https://accounts.zoho.eu';break;case'IN':_0x20acf3=_0x94f7('0x54');break;case'CN':_0x20acf3=_0x94f7('0x55');break;default:_0x20acf3=_0x94f7('0x56');break;}var _0xa43b52={'method':_0x94f7('0x57'),'uri':_0x20acf3+_0x94f7('0x58'),'qs':{'refresh_token':_0x33b668[_0x94f7('0x59')],'client_id':_0x33b668[_0x94f7('0x5a')],'client_secret':_0x33b668[_0x94f7('0x5b')],'grant_type':_0x94f7('0x5c')},'json':!![]};return rp(_0xa43b52)[_0x94f7('0x22')](function(_0x5d0f61){if(_0x5d0f61['access_token']){_0x3c53de(_0x5d0f61['access_token']);}else{_0xdb12ae(_0x94f7('0x5d'));}})[_0x94f7('0x3f')](function(_0x44d43c){_0xdb12ae(_0x44d43c);});});}exports['getFields']=function(_0x47b51a,_0x565365,_0x1bebbf){var _0x1d6393,_0x27a9be,_0x40299b,_0x272c72,_0x1feffc;return db[_0x94f7('0x3d')][_0x94f7('0x47')]({'where':{'id':_0x47b51a[_0x94f7('0x41')]['id']},'attributes':['id',_0x94f7('0x5e'),_0x94f7('0x51'),'clientId',_0x94f7('0x5b'),'serverUrl',_0x94f7('0x5f'),_0x94f7('0x59')]})[_0x94f7('0x22')](handleEntityNotFound(_0x565365,null))['then'](function(_0x2cd1f4){_0x1feffc=_0x2cd1f4;_0x1d6393=_0x1feffc[_0x94f7('0x5e')];_0x27a9be=_0x1d6393===_0x94f7('0x60')?'eu':_0x94f7('0x61');_0x40299b=_0x1feffc[_0x94f7('0x62')];var _0x1bccef=_0x40299b[_0x94f7('0x63')](-0x1);if(_0x1bccef==='/'||_0x1bccef==='\x5c'||_0x1bccef===':'){_0x40299b=_0x40299b[_0x94f7('0x64')](0x0,_0x40299b[_0x94f7('0x65')](_0x1bccef));}if(!_0x1feffc[_0x94f7('0x59')]){throw new Error(_0x94f7('0x66'));}return getAccessToken(_0x1feffc);})[_0x94f7('0x22')](function(_0x2cab22){if(_0x2cab22){return rp({'method':'GET','uri':util[_0x94f7('0x67')](_0x94f7('0x68'),_0x27a9be),'qs':{'module':_0x94f7('0x69')},'headers':{'Authorization':_0x94f7('0x6a')+_0x2cab22},'json':!![]});}})[_0x94f7('0x22')](function(_0x4ddaff){if(_0x4ddaff){if(_0x4ddaff[_0x94f7('0x6b')]&&_0x4ddaff[_0x94f7('0x6b')][_0x94f7('0x6c')]){throw new Error(_0x4ddaff[_0x94f7('0x6b')]['error']['message']);}var _0x48b9a3=[];var _0x6ee06b=[];var _0x19b1d4=[_0x94f7('0x6d'),_0x94f7('0x6e'),_0x94f7('0x6f'),_0x94f7('0x70'),_0x94f7('0x71'),_0x94f7('0x72'),_0x94f7('0x73'),_0x94f7('0x74')];_0x6ee06b=_[_0x94f7('0x75')](_0x4ddaff[_0x94f7('0x31')],function(_0x17d3c9){return _0x19b1d4[_0x94f7('0x76')](_0x17d3c9[_0x94f7('0x77')]);});for(var _0x5aae38=0x0;_0x5aae38<_0x6ee06b[_0x94f7('0x32')];_0x5aae38++){if(_0x6ee06b[_0x5aae38][_0x94f7('0x78')]===![]){_0x48b9a3[_0x94f7('0x79')]({'id':_0x6ee06b[_0x5aae38]['id'],'name':_0x6ee06b[_0x5aae38][_0x94f7('0x7a')],'custom':_0x6ee06b[_0x5aae38]['custom_field'],'options':_0x6ee06b[_0x5aae38][_0x94f7('0x7b')]===_0x94f7('0x7c')&&_0x6ee06b[_0x5aae38]['pick_list_values']['length']>-0x1?_[_0x94f7('0x25')](_0x6ee06b[_0x5aae38][_0x94f7('0x7d')],function(_0x55ab57){return{'name':_0x55ab57,'value':_0x55ab57};}):[]});}}return{'count':_0x48b9a3[_0x94f7('0x32')],'rows':_0x48b9a3};}else{return{'count':0x0,'rows':[]};}})[_0x94f7('0x22')](respondWithResult(_0x565365,null))[_0x94f7('0x3f')](function(_0x31a593){var _0x42ab5c=_0x47b51a[_0x94f7('0x2c')][_0x94f7('0x7e')]?0x1f4:_0x31a593[_0x94f7('0x7f')]||0x1f4;logger[_0x94f7('0x6c')](_0x94f7('0x80'),'getFields',_0x42ab5c,JSON[_0x94f7('0x81')](_0x31a593));delete _0x31a593[_0x94f7('0x2b')];if(_0x42ab5c===0x191){_0x42ab5c=0x190;}_0x565365[_0x94f7('0x16')](_0x42ab5c)[_0x94f7('0x82')](_0x47b51a[_0x94f7('0x2c')][_0x94f7('0x7e')]?{'message':_0x94f7('0x83'),'statusCode':_0x31a593[_0x94f7('0x7f')]}:_0x31a593);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 06f81c9..48a1c5a 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 _0x3258=['authorization_code','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com','POST','application/x-www-form-urlencoded','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token'];(function(_0x590341,_0x3d392f){var _0x612b04=function(_0x2c33b7){while(--_0x2c33b7){_0x590341['push'](_0x590341['shift']());}};_0x612b04(++_0x3d392f);}(_0x3258,0x135));var _0x8325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3258[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var logger=require(_0x8325('0x2'))(_0x8325('0x3'));var moment=require(_0x8325('0x4'));var BPromise=require(_0x8325('0x5'));var rp=require(_0x8325('0x6'));var fs=require('fs');var path=require(_0x8325('0x7'));var rimraf=require(_0x8325('0x8'));var config=require(_0x8325('0x9'));var attributes=require(_0x8325('0xa'));var integrations=require(_0x8325('0xb'));module['exports']=function(_0x1a35a5,_0x5c0677){return _0x1a35a5['define'](_0x8325('0xc'),attributes,{'tableName':_0x8325('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa3eb3a,_0x2f3e17,_0x5a37ed){if(_0xa3eb3a['changed'](_0x8325('0xe'))||_0xa3eb3a[_0x8325('0xf')](_0x8325('0x10'))||_0xa3eb3a[_0x8325('0xf')](_0x8325('0x11'))||_0xa3eb3a[_0x8325('0xf')](_0x8325('0x12'))||_0xa3eb3a[_0x8325('0xf')](_0x8325('0x13'))||_0xa3eb3a['changed']('host')){var _0x5261c6,_0x367070;_0x5261c6=_0xa3eb3a[_0x8325('0x10')];var _0x307e17=_0x5261c6['slice'](-0x1);if(_0x307e17==='/'||_0x307e17==='\x5c'||_0x307e17===':'){_0x5261c6=_0x5261c6[_0x8325('0x14')](0x0,_0x5261c6[_0x8325('0x15')](_0x307e17));}switch(_0xa3eb3a[_0x8325('0xe')]){case'US':_0x367070='https://accounts.zoho.com';break;case'AU':_0x367070=_0x8325('0x16');break;case'IN':_0x367070=_0x8325('0x17');break;case'CN':_0x367070=_0x8325('0x18');break;default:_0x367070=_0x8325('0x19');break;}var _0x48eae8={'method':'POST','uri':_0x367070+_0x8325('0x1a'),'form':{'grant_type':_0x8325('0x1b'),'client_id':_0xa3eb3a[_0x8325('0x11')],'client_secret':_0xa3eb3a['clientSecret'],'redirect_uri':_0xa3eb3a[_0x8325('0x10')],'code':_0xa3eb3a[_0x8325('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x48eae8)['then'](function(_0x347ae0){var _0x4bce46=JSON[_0x8325('0x1c')](_0x347ae0);if(_0x4bce46[_0x8325('0x1d')]){_0xa3eb3a[_0x8325('0x1e')]=_0x4bce46[_0x8325('0x1d')];logger[_0x8325('0x1f')](util['format'](_0x8325('0x20'),_0xa3eb3a[_0x8325('0x21')],_0xa3eb3a['id']));}else{logger[_0x8325('0x22')](util[_0x8325('0x23')](_0x8325('0x24'),_0xa3eb3a[_0x8325('0x21')],_0xa3eb3a['id']),util[_0x8325('0x25')](_0x4bce46,{'showHidden':![],'depth':null}));}return _0x5a37ed(null,_0x2f3e17);})['catch'](function(_0x2468e6){logger[_0x8325('0x22')](util[_0x8325('0x23')](_0x8325('0x24'),_0xa3eb3a[_0x8325('0x21')],_0xa3eb3a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5a37ed(_0x2468e6);});}else{return _0x5a37ed(null,_0x2f3e17);}},'beforeUpdate':function(_0xbd24c9,_0x162941,_0x30f058){if(_0xbd24c9[_0x8325('0xf')](_0x8325('0xe'))||_0xbd24c9[_0x8325('0xf')]('serverUrl')||_0xbd24c9[_0x8325('0xf')](_0x8325('0x11'))||_0xbd24c9[_0x8325('0xf')](_0x8325('0x12'))||_0xbd24c9['changed']('code')||_0xbd24c9[_0x8325('0xf')]('host')){var _0xe93356,_0x3a75d3;_0xe93356=_0xbd24c9['serverUrl'];var _0x570154=_0xe93356['slice'](-0x1);if(_0x570154==='/'||_0x570154==='\x5c'||_0x570154===':'){_0xe93356=_0xe93356[_0x8325('0x14')](0x0,_0xe93356['lastIndexOf'](_0x570154));}switch(_0xbd24c9['zone']){case'US':_0x3a75d3=_0x8325('0x26');break;case'AU':_0x3a75d3=_0x8325('0x16');break;case'IN':_0x3a75d3='https://accounts.zoho.in';break;case'CN':_0x3a75d3='https://accounts.zoho.com.cn';break;default:_0x3a75d3=_0x8325('0x19');break;}var _0x2e6764={'method':_0x8325('0x27'),'uri':_0x3a75d3+_0x8325('0x1a'),'form':{'grant_type':_0x8325('0x1b'),'client_id':_0xbd24c9['clientId'],'client_secret':_0xbd24c9['clientSecret'],'redirect_uri':_0xbd24c9[_0x8325('0x10')],'code':_0xbd24c9['code']},'headers':{'Content-Type':_0x8325('0x28')}};return rp(_0x2e6764)[_0x8325('0x29')](function(_0x549c59){var _0x2196c4=JSON[_0x8325('0x1c')](_0x549c59);if(_0x2196c4['refresh_token']){_0xbd24c9[_0x8325('0x1e')]=_0x2196c4[_0x8325('0x1d')];logger[_0x8325('0x1f')](util[_0x8325('0x23')](_0x8325('0x20'),_0xbd24c9[_0x8325('0x21')],_0xbd24c9['id']));}else{logger[_0x8325('0x22')](util['format'](_0x8325('0x24'),_0xbd24c9['name'],_0xbd24c9['id']),util[_0x8325('0x25')](_0x2196c4,{'showHidden':![],'depth':null}));}return _0x30f058(null,_0x162941);})['catch'](function(_0x41cb8b){logger[_0x8325('0x22')](util[_0x8325('0x23')](_0x8325('0x24'),_0xbd24c9['name'],_0xbd24c9['id']),util[_0x8325('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x30f058(_0x41cb8b);});}else{return _0x30f058(null,_0x162941);}}}});}; \ No newline at end of file +var _0xce52=['ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','slice','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','parse','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','host','refresh_token','refreshToken','catch','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x41bdb6,_0x5d56e4){var _0x57beff=function(_0x1f342a){while(--_0x1f342a){_0x41bdb6['push'](_0x41bdb6['shift']());}};_0x57beff(++_0x5d56e4);}(_0xce52,0x75));var _0x2ce5=function(_0x3d319f,_0x518937){_0x3d319f=_0x3d319f-0x0;var _0x25749d=_0xce52[_0x3d319f];return _0x25749d;};'use strict';var _=require('lodash');var util=require(_0x2ce5('0x0'));var logger=require(_0x2ce5('0x1'))('api');var moment=require(_0x2ce5('0x2'));var BPromise=require(_0x2ce5('0x3'));var rp=require(_0x2ce5('0x4'));var fs=require('fs');var path=require(_0x2ce5('0x5'));var rimraf=require(_0x2ce5('0x6'));var config=require(_0x2ce5('0x7'));var attributes=require(_0x2ce5('0x8'));var integrations=require(_0x2ce5('0x9'));module[_0x2ce5('0xa')]=function(_0x67e8f,_0x3d058e){return _0x67e8f[_0x2ce5('0xb')](_0x2ce5('0xc'),attributes,{'tableName':_0x2ce5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5922eb,_0x239ae5,_0x317bd0){if(_0x5922eb['changed']('zone')||_0x5922eb[_0x2ce5('0xe')](_0x2ce5('0xf'))||_0x5922eb['changed'](_0x2ce5('0x10'))||_0x5922eb['changed'](_0x2ce5('0x11'))||_0x5922eb[_0x2ce5('0xe')]('code')||_0x5922eb['changed']('host')){var _0x103458,_0x304c09;_0x103458=_0x5922eb['serverUrl'];var _0x15b182=_0x103458[_0x2ce5('0x12')](-0x1);if(_0x15b182==='/'||_0x15b182==='\x5c'||_0x15b182===':'){_0x103458=_0x103458['substring'](0x0,_0x103458[_0x2ce5('0x13')](_0x15b182));}switch(_0x5922eb[_0x2ce5('0x14')]){case'US':_0x304c09=_0x2ce5('0x15');break;case'AU':_0x304c09=_0x2ce5('0x16');break;case'IN':_0x304c09=_0x2ce5('0x17');break;case'CN':_0x304c09=_0x2ce5('0x18');break;default:_0x304c09=_0x2ce5('0x19');break;}var _0x20f5eb={'method':_0x2ce5('0x1a'),'uri':_0x304c09+_0x2ce5('0x1b'),'form':{'grant_type':_0x2ce5('0x1c'),'client_id':_0x5922eb[_0x2ce5('0x10')],'client_secret':_0x5922eb[_0x2ce5('0x11')],'redirect_uri':_0x5922eb[_0x2ce5('0xf')],'code':_0x5922eb[_0x2ce5('0x1d')]},'headers':{'Content-Type':_0x2ce5('0x1e')}};return rp(_0x20f5eb)['then'](function(_0x20e662){var _0x10848e=JSON[_0x2ce5('0x1f')](_0x20e662);if(_0x10848e['refresh_token']){_0x5922eb['refreshToken']=_0x10848e['refresh_token'];logger[_0x2ce5('0x20')](util['format'](_0x2ce5('0x21'),_0x5922eb[_0x2ce5('0x22')],_0x5922eb['id']));}else{logger[_0x2ce5('0x23')](util[_0x2ce5('0x24')](_0x2ce5('0x25'),_0x5922eb[_0x2ce5('0x22')],_0x5922eb['id']),util[_0x2ce5('0x26')](_0x10848e,{'showHidden':![],'depth':null}));}return _0x317bd0(null,_0x239ae5);})['catch'](function(_0x5a7bd4){logger[_0x2ce5('0x23')](util[_0x2ce5('0x24')](_0x2ce5('0x25'),_0x5922eb[_0x2ce5('0x22')],_0x5922eb['id']),util[_0x2ce5('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x317bd0(_0x5a7bd4);});}else{return _0x317bd0(null,_0x239ae5);}},'beforeUpdate':function(_0x18f00a,_0x5f1a59,_0x5c850f){if(_0x18f00a['changed'](_0x2ce5('0x14'))||_0x18f00a['changed']('serverUrl')||_0x18f00a[_0x2ce5('0xe')](_0x2ce5('0x10'))||_0x18f00a[_0x2ce5('0xe')](_0x2ce5('0x11'))||_0x18f00a[_0x2ce5('0xe')](_0x2ce5('0x1d'))||_0x18f00a['changed'](_0x2ce5('0x27'))){var _0x57f026,_0x4528e9;_0x57f026=_0x18f00a[_0x2ce5('0xf')];var _0x2c2397=_0x57f026[_0x2ce5('0x12')](-0x1);if(_0x2c2397==='/'||_0x2c2397==='\x5c'||_0x2c2397===':'){_0x57f026=_0x57f026['substring'](0x0,_0x57f026[_0x2ce5('0x13')](_0x2c2397));}switch(_0x18f00a[_0x2ce5('0x14')]){case'US':_0x4528e9=_0x2ce5('0x15');break;case'AU':_0x4528e9=_0x2ce5('0x16');break;case'IN':_0x4528e9=_0x2ce5('0x17');break;case'CN':_0x4528e9=_0x2ce5('0x18');break;default:_0x4528e9=_0x2ce5('0x19');break;}var _0x3edb76={'method':'POST','uri':_0x4528e9+_0x2ce5('0x1b'),'form':{'grant_type':_0x2ce5('0x1c'),'client_id':_0x18f00a[_0x2ce5('0x10')],'client_secret':_0x18f00a[_0x2ce5('0x11')],'redirect_uri':_0x18f00a[_0x2ce5('0xf')],'code':_0x18f00a[_0x2ce5('0x1d')]},'headers':{'Content-Type':_0x2ce5('0x1e')}};return rp(_0x3edb76)['then'](function(_0x55593e){var _0x140604=JSON[_0x2ce5('0x1f')](_0x55593e);if(_0x140604[_0x2ce5('0x28')]){_0x18f00a[_0x2ce5('0x29')]=_0x140604[_0x2ce5('0x28')];logger[_0x2ce5('0x20')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x18f00a[_0x2ce5('0x22')],_0x18f00a['id']));}else{logger[_0x2ce5('0x23')](util['format'](_0x2ce5('0x25'),_0x18f00a['name'],_0x18f00a['id']),util[_0x2ce5('0x26')](_0x140604,{'showHidden':![],'depth':null}));}return _0x5c850f(null,_0x5f1a59);})[_0x2ce5('0x2a')](function(_0x4c081a){logger[_0x2ce5('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x18f00a['name'],_0x18f00a['id']),util[_0x2ce5('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x5c850f(_0x4c081a);});}else{return _0x5c850f(null,_0x5f1a59);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index d9d360c..4738f14 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 _0xc224=['request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc224,0x1af));var _0x4c22=function(_0x525e8d,_0x2cdfec){_0x525e8d=_0x525e8d-0x0;var _0x16f1b0=_0xc224[_0x525e8d];return _0x16f1b0;};'use strict';var _=require(_0x4c22('0x0'));var util=require(_0x4c22('0x1'));var moment=require(_0x4c22('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c22('0x3'));var fs=require('fs');var Redis=require(_0x4c22('0x4'));var db=require(_0x4c22('0x5'))['db'];var utils=require(_0x4c22('0x6'));var logger=require(_0x4c22('0x7'))(_0x4c22('0x8'));var config=require(_0x4c22('0x9'));var jayson=require(_0x4c22('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49f782,_0x4195b6,_0x3a6191){return new BPromise(function(_0x45397c,_0x309dad){return client[_0x4c22('0xb')](_0x49f782,_0x3a6191)[_0x4c22('0xc')](function(_0x44ec98){logger['info'](_0x4c22('0xd'),_0x4195b6,_0x4c22('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4195b6,_0x4c22('0xe'),JSON[_0x4c22('0xf')](_0x44ec98));if(_0x44ec98[_0x4c22('0x10')]){if(_0x44ec98['error'][_0x4c22('0x11')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4195b6,_0x44ec98['error'][_0x4c22('0x12')]);return _0x309dad(_0x44ec98[_0x4c22('0x10')][_0x4c22('0x12')]);}logger[_0x4c22('0x10')](_0x4c22('0xd'),_0x4195b6,_0x44ec98['error'][_0x4c22('0x12')]);return _0x45397c(_0x44ec98[_0x4c22('0x10')][_0x4c22('0x12')]);}else{logger[_0x4c22('0x13')](_0x4c22('0xd'),_0x4195b6,'request\x20sent');_0x45397c(_0x44ec98['result'][_0x4c22('0x12')]);}})[_0x4c22('0x14')](function(_0x46aaaa){logger[_0x4c22('0x10')](_0x4c22('0xd'),_0x4195b6,_0x46aaaa);_0x309dad(_0x46aaaa);});});}exports[_0x4c22('0x15')]=function(_0x408f6f){var _0x1577c6=this;return new Promise(function(_0x629d81,_0x59f120){return db[_0x4c22('0x16')]['findAll']({'raw':_0x408f6f['options']?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x18')]===undefined?!![]:![]:!![],'where':_0x408f6f[_0x4c22('0x17')]?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x19')]||null:null,'attributes':_0x408f6f[_0x4c22('0x17')]?_0x408f6f['options'][_0x4c22('0x1a')]||null:null,'limit':_0x408f6f['options']?_0x408f6f['options'][_0x4c22('0x1b')]||null:null,'include':_0x408f6f[_0x4c22('0x17')]?_0x408f6f[_0x4c22('0x17')][_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x408f6f[_0x4c22('0x17')][_0x4c22('0x1c')],function(_0x38e6d5){return{'model':db[_0x38e6d5[_0x4c22('0x1e')]],'as':_0x38e6d5['as'],'attributes':_0x38e6d5[_0x4c22('0x1a')],'include':_0x38e6d5[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x38e6d5[_0x4c22('0x1c')],function(_0x2fa3d8){return{'model':db[_0x2fa3d8[_0x4c22('0x1e')]],'as':_0x2fa3d8['as'],'attributes':_0x2fa3d8['attributes'],'include':_0x2fa3d8[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x2fa3d8['include'],function(_0x3d15b9){return{'model':db[_0x3d15b9[_0x4c22('0x1e')]],'as':_0x3d15b9['as'],'attributes':_0x3d15b9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c22('0xc')](function(_0x2d5d49){logger[_0x4c22('0x13')](_0x4c22('0x15'),_0x408f6f);logger['debug'](_0x4c22('0x15'),_0x408f6f,JSON[_0x4c22('0xf')](_0x2d5d49));_0x629d81(_0x2d5d49);})[_0x4c22('0x14')](function(_0x55ca00){logger[_0x4c22('0x10')](_0x4c22('0x15'),_0x55ca00[_0x4c22('0x12')],_0x408f6f);_0x59f120(_0x1577c6[_0x4c22('0x10')](0x1f4,_0x55ca00[_0x4c22('0x12')]));});});};exports[_0x4c22('0x1f')]=function(_0x47fa82){var _0x1ad5e8=this;return new Promise(function(_0x4d10bd,_0x4f4d67){return db['ZohoAccount'][_0x4c22('0x20')]({'raw':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x18')]===undefined?!![]:![]:!![],'where':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x19')]||null:null,'attributes':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')][_0x4c22('0x1a')]||null:null,'include':_0x47fa82[_0x4c22('0x17')]?_0x47fa82[_0x4c22('0x17')]['include']?_['map'](_0x47fa82[_0x4c22('0x17')][_0x4c22('0x1c')],function(_0x139726){return{'model':db[_0x139726[_0x4c22('0x1e')]],'as':_0x139726['as'],'attributes':_0x139726[_0x4c22('0x1a')],'include':_0x139726[_0x4c22('0x1c')]?_[_0x4c22('0x1d')](_0x139726[_0x4c22('0x1c')],function(_0x4ad211){return{'model':db[_0x4ad211['model']],'as':_0x4ad211['as'],'attributes':_0x4ad211['attributes'],'include':_0x4ad211['include']?_[_0x4c22('0x1d')](_0x4ad211[_0x4c22('0x1c')],function(_0x17f237){return{'model':db[_0x17f237[_0x4c22('0x1e')]],'as':_0x17f237['as'],'attributes':_0x17f237[_0x4c22('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e1837){logger['info'](_0x4c22('0x1f'),_0x47fa82);logger[_0x4c22('0x21')](_0x4c22('0x1f'),_0x47fa82,JSON[_0x4c22('0xf')](_0x1e1837));_0x4d10bd(_0x1e1837);})[_0x4c22('0x14')](function(_0xf29ec9){logger[_0x4c22('0x10')](_0x4c22('0x1f'),_0xf29ec9[_0x4c22('0x12')],_0x47fa82);_0x4f4d67(_0x1ad5e8[_0x4c22('0x10')](0x1f4,_0xf29ec9['message']));});});}; \ No newline at end of file +var _0x07fa=['then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw','where','include','map','model','attributes','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07fa,0x177));var _0xa07f=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x07fa[_0x556bb1];return _0x45455f;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));var BPromise=require(_0xa07f('0x2'));var rs=require(_0xa07f('0x3'));var fs=require('fs');var Redis=require(_0xa07f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa07f('0x5'));var logger=require(_0xa07f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa07f('0x7')][_0xa07f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x509d7a,_0x2ad2ff,_0x575be1){return new BPromise(function(_0x4eea76,_0x5d82e9){return client['request'](_0x509d7a,_0x575be1)[_0xa07f('0x9')](function(_0x288476){logger['info'](_0xa07f('0xa'),_0x2ad2ff,_0xa07f('0xb'));logger[_0xa07f('0xc')](_0xa07f('0xd'),_0x2ad2ff,_0xa07f('0xb'),JSON[_0xa07f('0xe')](_0x288476));if(_0x288476[_0xa07f('0xf')]){if(_0x288476[_0xa07f('0xf')]['code']===0x1f4){logger[_0xa07f('0xf')](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x5d82e9(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x288476['error'][_0xa07f('0x10')]);return _0x4eea76(_0x288476[_0xa07f('0xf')][_0xa07f('0x10')]);}else{logger[_0xa07f('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x2ad2ff,_0xa07f('0xb'));_0x4eea76(_0x288476[_0xa07f('0x12')][_0xa07f('0x10')]);}})[_0xa07f('0x13')](function(_0x4090a1){logger['error'](_0xa07f('0xa'),_0x2ad2ff,_0x4090a1);_0x5d82e9(_0x4090a1);});});}exports['GetZohoAccount']=function(_0x5450a9){var _0x59b465=this;return new Promise(function(_0x5bf23b,_0x4c2d2b){return db['ZohoAccount'][_0xa07f('0x14')]({'raw':_0x5450a9[_0xa07f('0x15')]?_0x5450a9[_0xa07f('0x15')][_0xa07f('0x16')]===undefined?!![]:![]:!![],'where':_0x5450a9[_0xa07f('0x15')]?_0x5450a9[_0xa07f('0x15')][_0xa07f('0x17')]||null:null,'attributes':_0x5450a9['options']?_0x5450a9[_0xa07f('0x15')]['attributes']||null:null,'limit':_0x5450a9[_0xa07f('0x15')]?_0x5450a9['options']['limit']||null:null,'include':_0x5450a9[_0xa07f('0x15')]?_0x5450a9[_0xa07f('0x15')][_0xa07f('0x18')]?_[_0xa07f('0x19')](_0x5450a9['options'][_0xa07f('0x18')],function(_0x4322fe){return{'model':db[_0x4322fe[_0xa07f('0x1a')]],'as':_0x4322fe['as'],'attributes':_0x4322fe[_0xa07f('0x1b')],'include':_0x4322fe[_0xa07f('0x18')]?_[_0xa07f('0x19')](_0x4322fe['include'],function(_0xc2d9fe){return{'model':db[_0xc2d9fe[_0xa07f('0x1a')]],'as':_0xc2d9fe['as'],'attributes':_0xc2d9fe[_0xa07f('0x1b')],'include':_0xc2d9fe[_0xa07f('0x18')]?_[_0xa07f('0x19')](_0xc2d9fe['include'],function(_0x48f809){return{'model':db[_0x48f809[_0xa07f('0x1a')]],'as':_0x48f809['as'],'attributes':_0x48f809[_0xa07f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x331b49){logger[_0xa07f('0x11')](_0xa07f('0x1c'),_0x5450a9);logger['debug'](_0xa07f('0x1c'),_0x5450a9,JSON[_0xa07f('0xe')](_0x331b49));_0x5bf23b(_0x331b49);})['catch'](function(_0x52892e){logger[_0xa07f('0xf')](_0xa07f('0x1c'),_0x52892e[_0xa07f('0x10')],_0x5450a9);_0x4c2d2b(_0x59b465['error'](0x1f4,_0x52892e[_0xa07f('0x10')]));});});};exports[_0xa07f('0x1d')]=function(_0x4853b6){var _0x59aee4=this;return new Promise(function(_0x8016d,_0x57c19c){return db[_0xa07f('0x1e')][_0xa07f('0x1f')]({'raw':_0x4853b6['options']?_0x4853b6[_0xa07f('0x15')][_0xa07f('0x16')]===undefined?!![]:![]:!![],'where':_0x4853b6[_0xa07f('0x15')]?_0x4853b6['options'][_0xa07f('0x17')]||null:null,'attributes':_0x4853b6[_0xa07f('0x15')]?_0x4853b6[_0xa07f('0x15')][_0xa07f('0x1b')]||null:null,'include':_0x4853b6['options']?_0x4853b6[_0xa07f('0x15')]['include']?_['map'](_0x4853b6[_0xa07f('0x15')][_0xa07f('0x18')],function(_0xb7c138){return{'model':db[_0xb7c138['model']],'as':_0xb7c138['as'],'attributes':_0xb7c138['attributes'],'include':_0xb7c138[_0xa07f('0x18')]?_[_0xa07f('0x19')](_0xb7c138[_0xa07f('0x18')],function(_0x36d2a3){return{'model':db[_0x36d2a3[_0xa07f('0x1a')]],'as':_0x36d2a3['as'],'attributes':_0x36d2a3[_0xa07f('0x1b')],'include':_0x36d2a3[_0xa07f('0x18')]?_['map'](_0x36d2a3[_0xa07f('0x18')],function(_0x10d7d7){return{'model':db[_0x10d7d7[_0xa07f('0x1a')]],'as':_0x10d7d7['as'],'attributes':_0x10d7d7[_0xa07f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5262ea){logger[_0xa07f('0x11')]('ShowZohoAccount',_0x4853b6);logger['debug'](_0xa07f('0x1d'),_0x4853b6,JSON[_0xa07f('0xe')](_0x5262ea));_0x8016d(_0x5262ea);})['catch'](function(_0x42f2d7){logger['error'](_0xa07f('0x1d'),_0x42f2d7[_0xa07f('0x10')],_0x4853b6);_0x57c19c(_0x59aee4[_0xa07f('0xf')](0x1f4,_0x42f2d7[_0xa07f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0c4dce7..43f6a24 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 _0x352b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','put','/:id','update'];(function(_0x2804b7,_0xcf1410){var _0x4809be=function(_0x1953d4){while(--_0x1953d4){_0x2804b7['push'](_0x2804b7['shift']());}};_0x4809be(++_0xcf1410);}(_0x352b,0x145));var _0xb352=function(_0x34a91e,_0xd7caba){_0x34a91e=_0x34a91e-0x0;var _0x57e3b8=_0x352b[_0x34a91e];return _0x57e3b8;};'use strict';var multer=require(_0xb352('0x0'));var util=require(_0xb352('0x1'));var path=require(_0xb352('0x2'));var timeout=require(_0xb352('0x3'));var express=require(_0xb352('0x4'));var router=express[_0xb352('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb352('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb352('0x7'));var controller=require(_0xb352('0x8'));router['get']('/',auth[_0xb352('0x9')](),controller[_0xb352('0xa')]);router[_0xb352('0xb')]('/:id',auth[_0xb352('0x9')](),controller[_0xb352('0xc')]);router['get'](_0xb352('0xd'),auth[_0xb352('0x9')](),controller['getFields']);router['get'](_0xb352('0xe'),auth['isAuthenticated'](),controller[_0xb352('0xf')]);router[_0xb352('0xb')](_0xb352('0x10'),auth[_0xb352('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xb352('0x9')](),controller['create']);router[_0xb352('0x11')](_0xb352('0x12'),auth[_0xb352('0x9')](),controller[_0xb352('0x13')]);router[_0xb352('0x14')](_0xb352('0x12'),auth['isAuthenticated'](),controller[_0xb352('0x15')]);module[_0xb352('0x16')]=router; \ No newline at end of file +var _0xd796=['create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getDescriptions','post'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xd796,0x82));var _0x6d79=function(_0x138340,_0x534200){_0x138340=_0x138340-0x0;var _0x597c7b=_0xd796[_0x138340];return _0x597c7b;};'use strict';var multer=require(_0x6d79('0x0'));var util=require(_0x6d79('0x1'));var path=require(_0x6d79('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d79('0x3'));var router=express[_0x6d79('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d79('0x5'));var interaction=require(_0x6d79('0x6'));var config=require(_0x6d79('0x7'));var controller=require(_0x6d79('0x8'));router[_0x6d79('0x9')]('/',auth[_0x6d79('0xa')](),controller[_0x6d79('0xb')]);router[_0x6d79('0x9')](_0x6d79('0xc'),auth[_0x6d79('0xa')](),controller[_0x6d79('0xd')]);router[_0x6d79('0x9')]('/:id/fields',auth[_0x6d79('0xa')](),controller[_0x6d79('0xe')]);router[_0x6d79('0x9')]('/:id/subjects',auth[_0x6d79('0xa')](),controller['getSubjects']);router[_0x6d79('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6d79('0xf')]);router[_0x6d79('0x10')]('/',auth['isAuthenticated'](),controller[_0x6d79('0x11')]);router[_0x6d79('0x12')](_0x6d79('0xc'),auth[_0x6d79('0xa')](),controller['update']);router['delete'](_0x6d79('0xc'),auth[_0x6d79('0xa')](),controller[_0x6d79('0x13')]);module[_0x6d79('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index de5eef9..6c7fb7f 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 _0xa6a9=['STRING','ENUM','contact','nothing','lead','contact_lead','sequelize','exports'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xa6a9,0x166));var _0x9a6a=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xa6a9[_0x4afac5];return _0x2404b3;};'use strict';var Sequelize=require(_0x9a6a('0x0'));module[_0x9a6a('0x1')]={'name':{'type':Sequelize[_0x9a6a('0x2')]},'moduleCreate':{'type':Sequelize[_0x9a6a('0x3')]('lead',_0x9a6a('0x4'),_0x9a6a('0x5')),'defaultValue':_0x9a6a('0x6')},'moduleSearch':{'type':Sequelize[_0x9a6a('0x3')]('contact_lead',_0x9a6a('0x4'),_0x9a6a('0x6')),'defaultValue':_0x9a6a('0x7')},'description':{'type':Sequelize[_0x9a6a('0x2')]}}; \ No newline at end of file +var _0x5145=['ENUM','contact_lead','contact','sequelize','exports','STRING','lead','nothing'];(function(_0x5208a2,_0x1d24ea){var _0x6a489c=function(_0xe19265){while(--_0xe19265){_0x5208a2['push'](_0x5208a2['shift']());}};_0x6a489c(++_0x1d24ea);}(_0x5145,0x93));var _0x5514=function(_0x1d4773,_0x254b17){_0x1d4773=_0x1d4773-0x0;var _0x3d044e=_0x5145[_0x1d4773];return _0x3d044e;};'use strict';var Sequelize=require(_0x5514('0x0'));module[_0x5514('0x1')]={'name':{'type':Sequelize[_0x5514('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x5514('0x3'),'contact',_0x5514('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x5514('0x5')](_0x5514('0x6'),_0x5514('0x7'),_0x5514('0x3')),'defaultValue':_0x5514('0x6')},'description':{'type':Sequelize[_0x5514('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index bf0cb26..76723fc 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 _0x47ea=['catch','params','intersection','options','create','body','find','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','update','then','destroy','error','name','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','rows'];(function(_0x5aa98d,_0x11b492){var _0x21a741=function(_0x1c0ed7){while(--_0x1c0ed7){_0x5aa98d['push'](_0x5aa98d['shift']());}};_0x21a741(++_0x11b492);}(_0x47ea,0x144));var _0xa47e=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0x47ea[_0x3da612];return _0x1a9d1d;};'use strict';var emlformat=require(_0xa47e('0x0'));var rimraf=require(_0xa47e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa47e('0x2'));var rp=require(_0xa47e('0x3'));var moment=require('moment');var BPromise=require(_0xa47e('0x4'));var Mustache=require('mustache');var util=require(_0xa47e('0x5'));var path=require(_0xa47e('0x6'));var sox=require(_0xa47e('0x7'));var csv=require('to-csv');var ejs=require(_0xa47e('0x8'));var fs=require('fs');var fs_extra=require(_0xa47e('0x9'));var _=require('lodash');var squel=require(_0xa47e('0xa'));var crypto=require('crypto');var jsforce=require(_0xa47e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa47e('0xc'));var querystring=require(_0xa47e('0xd'));var Papa=require(_0xa47e('0xe'));var Redis=require(_0xa47e('0xf'));var authService=require(_0xa47e('0x10'));var qs=require(_0xa47e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa47e('0x12'))(_0xa47e('0x13'));var utils=require(_0xa47e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa47e('0x15'));var db=require(_0xa47e('0x16'))['db'];function respondWithStatusCode(_0x2bd97b,_0x36def3){_0x36def3=_0x36def3||0xcc;return function(_0x53e5c6){if(_0x53e5c6){return _0x2bd97b[_0xa47e('0x17')](_0x36def3);}return _0x2bd97b['status'](_0x36def3)[_0xa47e('0x18')]();};}function respondWithResult(_0x9e25f0,_0x716fe1){_0x716fe1=_0x716fe1||0xc8;return function(_0x1fbe47){if(_0x1fbe47){return _0x9e25f0['status'](_0x716fe1)[_0xa47e('0x19')](_0x1fbe47);}};}function respondWithFilteredResult(_0x35604f,_0x471c64){return function(_0x51a5fe){if(_0x51a5fe){var _0x1bf2a3=typeof _0x471c64['offset']==='undefined'&&typeof _0x471c64[_0xa47e('0x1a')]===_0xa47e('0x1b');var _0x59b4d1=_0x51a5fe[_0xa47e('0x1c')];var _0x352684=_0x1bf2a3?0x0:_0x471c64[_0xa47e('0x1d')];var _0x3fe3c8=_0x1bf2a3?_0x51a5fe[_0xa47e('0x1c')]:_0x471c64[_0xa47e('0x1d')]+_0x471c64[_0xa47e('0x1a')];var _0x18ba6d;if(_0x3fe3c8>=_0x59b4d1){_0x3fe3c8=_0x59b4d1;_0x18ba6d=0xc8;}else{_0x18ba6d=0xce;}_0x35604f[_0xa47e('0x1e')](_0x18ba6d);return _0x35604f[_0xa47e('0x1f')](_0xa47e('0x20'),_0x352684+'-'+_0x3fe3c8+'/'+_0x59b4d1)[_0xa47e('0x19')](_0x51a5fe);}return null;};}function patchUpdates(_0x1112ef){return function(_0x3da150){try{jsonpatch[_0xa47e('0x21')](_0x3da150,_0x1112ef,!![]);}catch(_0x281662){return BPromise[_0xa47e('0x22')](_0x281662);}return _0x3da150['save']();};}function saveUpdates(_0x5f4d4,_0x248c6d){return function(_0x30334f){if(_0x30334f){return _0x30334f[_0xa47e('0x23')](_0x5f4d4)[_0xa47e('0x24')](function(_0x58d3ce){return _0x58d3ce;});}return null;};}function removeEntity(_0xb7789d,_0x59ae80){return function(_0x1d18e2){if(_0x1d18e2){return _0x1d18e2[_0xa47e('0x25')]()[_0xa47e('0x24')](function(){_0xb7789d[_0xa47e('0x1e')](0xcc)[_0xa47e('0x18')]();});}};}function handleEntityNotFound(_0xd4f534,_0x588802){return function(_0x5bd28d){if(!_0x5bd28d){_0xd4f534[_0xa47e('0x17')](0x194);}return _0x5bd28d;};}function handleError(_0x26751b,_0x162e6b){_0x162e6b=_0x162e6b||0x1f4;return function(_0x41afa4){logger[_0xa47e('0x26')](_0x41afa4['stack']);if(_0x41afa4[_0xa47e('0x27')]){delete _0x41afa4[_0xa47e('0x27')];}_0x26751b[_0xa47e('0x1e')](_0x162e6b)['send'](_0x41afa4);};}exports[_0xa47e('0x28')]=function(_0xe7cd93,_0x5e00f1){var _0x56f1e9={},_0x3e0b2d={},_0x9975aa={'count':0x0,'rows':[]};var _0xb189b1=_['map'](db[_0xa47e('0x29')][_0xa47e('0x2a')],function(_0x53fcad){return{'name':_0x53fcad[_0xa47e('0x2b')],'type':_0x53fcad[_0xa47e('0x2c')][_0xa47e('0x2d')]};});_0x3e0b2d[_0xa47e('0x2e')]=_['map'](_0xb189b1,_0xa47e('0x27'));_0x3e0b2d[_0xa47e('0x2f')]=_[_0xa47e('0x30')](_0xe7cd93['query']);_0x3e0b2d[_0xa47e('0x31')]=_['intersection'](_0x3e0b2d['model'],_0x3e0b2d[_0xa47e('0x2f')]);_0x56f1e9['attributes']=_['intersection'](_0x3e0b2d[_0xa47e('0x2e')],qs[_0xa47e('0x32')](_0xe7cd93['query'][_0xa47e('0x32')]));_0x56f1e9[_0xa47e('0x33')]=_0x56f1e9[_0xa47e('0x33')][_0xa47e('0x34')]?_0x56f1e9[_0xa47e('0x33')]:_0x3e0b2d[_0xa47e('0x2e')];if(!_0xe7cd93['query'][_0xa47e('0x35')](_0xa47e('0x36'))){_0x56f1e9[_0xa47e('0x1a')]=qs[_0xa47e('0x1a')](_0xe7cd93[_0xa47e('0x2f')][_0xa47e('0x1a')]);_0x56f1e9[_0xa47e('0x1d')]=qs['offset'](_0xe7cd93[_0xa47e('0x2f')][_0xa47e('0x1d')]);}_0x56f1e9[_0xa47e('0x37')]=qs[_0xa47e('0x38')](_0xe7cd93['query']['sort']);_0x56f1e9[_0xa47e('0x39')]=qs[_0xa47e('0x31')](_[_0xa47e('0x3a')](_0xe7cd93['query'],_0x3e0b2d[_0xa47e('0x31')]),_0xb189b1);if(_0xe7cd93[_0xa47e('0x2f')][_0xa47e('0x3b')]){_0x56f1e9[_0xa47e('0x39')]=_[_0xa47e('0x3c')](_0x56f1e9[_0xa47e('0x39')],{'$or':_[_0xa47e('0x3d')](_0xb189b1,function(_0x22f2bf){if(_0x22f2bf[_0xa47e('0x2c')]!==_0xa47e('0x3e')){var _0x2bf78a={};_0x2bf78a[_0x22f2bf[_0xa47e('0x27')]]={'$like':'%'+_0xe7cd93[_0xa47e('0x2f')][_0xa47e('0x3b')]+'%'};return _0x2bf78a;}})});}_0x56f1e9=_['merge']({},_0x56f1e9,_0xe7cd93['options']);var _0x130508={'where':_0x56f1e9[_0xa47e('0x39')]};return db[_0xa47e('0x29')][_0xa47e('0x1c')](_0x130508)[_0xa47e('0x24')](function(_0x8f39a4){_0x9975aa[_0xa47e('0x1c')]=_0x8f39a4;if(_0xe7cd93[_0xa47e('0x2f')][_0xa47e('0x3f')]){_0x56f1e9[_0xa47e('0x40')]=[{'all':!![]}];}return db[_0xa47e('0x29')]['findAll'](_0x56f1e9);})['then'](function(_0x248b0d){_0x9975aa[_0xa47e('0x41')]=_0x248b0d;return _0x9975aa;})[_0xa47e('0x24')](respondWithFilteredResult(_0x5e00f1,_0x56f1e9))[_0xa47e('0x42')](handleError(_0x5e00f1,null));};exports['show']=function(_0x6b4486,_0x2f4683){var _0x50a527={'raw':![],'where':{'id':_0x6b4486[_0xa47e('0x43')]['id']}},_0x25fc17={};_0x25fc17[_0xa47e('0x2e')]=_['keys'](db[_0xa47e('0x29')][_0xa47e('0x2a')]);_0x25fc17[_0xa47e('0x2f')]=_[_0xa47e('0x30')](_0x6b4486[_0xa47e('0x2f')]);_0x25fc17['filters']=_[_0xa47e('0x44')](_0x25fc17[_0xa47e('0x2e')],_0x25fc17['query']);_0x50a527[_0xa47e('0x33')]=_[_0xa47e('0x44')](_0x25fc17['model'],qs['fields'](_0x6b4486['query']['fields']));_0x50a527['attributes']=_0x50a527['attributes'][_0xa47e('0x34')]?_0x50a527[_0xa47e('0x33')]:_0x25fc17['model'];if(_0x6b4486[_0xa47e('0x2f')][_0xa47e('0x3f')]){_0x50a527['include']=[{'all':!![]}];}_0x50a527=_['merge']({},_0x50a527,_0x6b4486[_0xa47e('0x45')]);return db[_0xa47e('0x29')]['find'](_0x50a527)[_0xa47e('0x24')](handleEntityNotFound(_0x2f4683,null))[_0xa47e('0x24')](respondWithResult(_0x2f4683,null))[_0xa47e('0x42')](handleError(_0x2f4683,null));};exports[_0xa47e('0x46')]=function(_0x1202f4,_0x13342a){return db[_0xa47e('0x29')][_0xa47e('0x46')](_0x1202f4[_0xa47e('0x47')],{})[_0xa47e('0x24')](respondWithResult(_0x13342a,0xc9))[_0xa47e('0x42')](handleError(_0x13342a,null));};exports[_0xa47e('0x23')]=function(_0x6008d2,_0x35d827){if(_0x6008d2[_0xa47e('0x47')]['id']){delete _0x6008d2[_0xa47e('0x47')]['id'];}return db['ZohoConfiguration'][_0xa47e('0x48')]({'where':{'id':_0x6008d2[_0xa47e('0x43')]['id']}})[_0xa47e('0x24')](handleEntityNotFound(_0x35d827,null))[_0xa47e('0x24')](saveUpdates(_0x6008d2[_0xa47e('0x47')],null))[_0xa47e('0x24')](respondWithResult(_0x35d827,null))[_0xa47e('0x42')](handleError(_0x35d827,null));};exports[_0xa47e('0x25')]=function(_0x48f175,_0x7cbe40){return db['ZohoConfiguration'][_0xa47e('0x48')]({'where':{'id':_0x48f175['params']['id']}})[_0xa47e('0x24')](handleEntityNotFound(_0x7cbe40,null))[_0xa47e('0x24')](removeEntity(_0x7cbe40,null))[_0xa47e('0x42')](handleError(_0x7cbe40,null));};exports[_0xa47e('0x49')]=function(_0x35c82d,_0x1ccb23,_0x4770fa){var _0x44194b={};var _0x5525a4={};var _0x232898;var _0x2f5f51;return db[_0xa47e('0x29')][_0xa47e('0x4a')]({'where':{'id':_0x35c82d[_0xa47e('0x43')]['id']}})[_0xa47e('0x24')](handleEntityNotFound(_0x1ccb23,null))[_0xa47e('0x24')](function(_0x4a9b18){if(_0x4a9b18){_0x232898=_0x4a9b18;_0x5525a4[_0xa47e('0x2e')]=_[_0xa47e('0x30')](db[_0xa47e('0x4b')]['rawAttributes']);_0x5525a4[_0xa47e('0x2f')]=_[_0xa47e('0x30')](_0x35c82d[_0xa47e('0x2f')]);_0x5525a4[_0xa47e('0x31')]=_[_0xa47e('0x44')](_0x5525a4['model'],_0x5525a4[_0xa47e('0x2f')]);_0x44194b[_0xa47e('0x33')]=_[_0xa47e('0x44')](_0x5525a4[_0xa47e('0x2e')],qs['fields'](_0x35c82d['query']['fields']));_0x44194b[_0xa47e('0x33')]=_0x44194b[_0xa47e('0x33')][_0xa47e('0x34')]?_0x44194b[_0xa47e('0x33')]:_0x5525a4['model'];_0x44194b[_0xa47e('0x37')]=qs['sort'](_0x35c82d[_0xa47e('0x2f')]['sort']);_0x44194b[_0xa47e('0x39')]=qs[_0xa47e('0x31')](_[_0xa47e('0x3a')](_0x35c82d[_0xa47e('0x2f')],_0x5525a4['filters']));if(_0x35c82d[_0xa47e('0x2f')][_0xa47e('0x3b')]){_0x44194b['where']=_['merge'](_0x44194b[_0xa47e('0x39')],{'$or':_['map'](_0x44194b['attributes'],function(_0x5639bf){var _0x287679={};_0x287679[_0x5639bf]={'$like':'%'+_0x35c82d[_0xa47e('0x2f')][_0xa47e('0x3b')]+'%'};return _0x287679;})});}_0x44194b=_[_0xa47e('0x3c')]({},_0x44194b,_0x35c82d['options']);return _0x232898[_0xa47e('0x49')](_0x44194b);}})[_0xa47e('0x24')](function(_0x4ab1d7){if(_0x4ab1d7){_0x2f5f51=_0x4ab1d7[_0xa47e('0x34')];if(!_0x35c82d[_0xa47e('0x2f')][_0xa47e('0x35')]('nolimit')){_0x44194b[_0xa47e('0x1a')]=qs[_0xa47e('0x1a')](_0x35c82d[_0xa47e('0x2f')]['limit']);_0x44194b[_0xa47e('0x1d')]=qs[_0xa47e('0x1d')](_0x35c82d[_0xa47e('0x2f')]['offset']);}return _0x232898['getFields'](_0x44194b);}})['then'](function(_0x1c281e){if(_0x1c281e){return _0x1c281e?{'count':_0x2f5f51,'rows':_0x1c281e}:null;}})[_0xa47e('0x24')](respondWithResult(_0x1ccb23,null))[_0xa47e('0x42')](handleError(_0x1ccb23,null));};exports[_0xa47e('0x4c')]=function(_0x464aba,_0x41a2e1,_0x2a4f87){var _0x57efc8={};var _0x213b26={};var _0x4d94fc;var _0xbcaeb0;return db['ZohoConfiguration'][_0xa47e('0x4a')]({'where':{'id':_0x464aba[_0xa47e('0x43')]['id']}})[_0xa47e('0x24')](handleEntityNotFound(_0x41a2e1,null))[_0xa47e('0x24')](function(_0x327b05){if(_0x327b05){_0x4d94fc=_0x327b05;_0x213b26[_0xa47e('0x2e')]=_['keys'](db[_0xa47e('0x4b')][_0xa47e('0x2a')]);_0x213b26[_0xa47e('0x2f')]=_['keys'](_0x464aba[_0xa47e('0x2f')]);_0x213b26['filters']=_[_0xa47e('0x44')](_0x213b26[_0xa47e('0x2e')],_0x213b26[_0xa47e('0x2f')]);_0x57efc8[_0xa47e('0x33')]=_[_0xa47e('0x44')](_0x213b26[_0xa47e('0x2e')],qs[_0xa47e('0x32')](_0x464aba['query'][_0xa47e('0x32')]));_0x57efc8[_0xa47e('0x33')]=_0x57efc8[_0xa47e('0x33')][_0xa47e('0x34')]?_0x57efc8[_0xa47e('0x33')]:_0x213b26[_0xa47e('0x2e')];_0x57efc8[_0xa47e('0x37')]=qs[_0xa47e('0x38')](_0x464aba['query'][_0xa47e('0x38')]);_0x57efc8[_0xa47e('0x39')]=qs[_0xa47e('0x31')](_['pick'](_0x464aba[_0xa47e('0x2f')],_0x213b26['filters']));if(_0x464aba[_0xa47e('0x2f')][_0xa47e('0x3b')]){_0x57efc8[_0xa47e('0x39')]=_[_0xa47e('0x3c')](_0x57efc8['where'],{'$or':_[_0xa47e('0x3d')](_0x57efc8[_0xa47e('0x33')],function(_0x584489){var _0x460f9c={};_0x460f9c[_0x584489]={'$like':'%'+_0x464aba[_0xa47e('0x2f')]['filter']+'%'};return _0x460f9c;})});}_0x57efc8=_[_0xa47e('0x3c')]({},_0x57efc8,_0x464aba[_0xa47e('0x45')]);return _0x4d94fc['getSubjects'](_0x57efc8);}})[_0xa47e('0x24')](function(_0x9f027){if(_0x9f027){_0xbcaeb0=_0x9f027['length'];if(!_0x464aba['query']['hasOwnProperty'](_0xa47e('0x36'))){_0x57efc8[_0xa47e('0x1a')]=qs['limit'](_0x464aba['query'][_0xa47e('0x1a')]);_0x57efc8[_0xa47e('0x1d')]=qs[_0xa47e('0x1d')](_0x464aba[_0xa47e('0x2f')]['offset']);}return _0x4d94fc[_0xa47e('0x4c')](_0x57efc8);}})['then'](function(_0x357b2e){if(_0x357b2e){return _0x357b2e?{'count':_0xbcaeb0,'rows':_0x357b2e}:null;}})[_0xa47e('0x24')](respondWithResult(_0x41a2e1,null))['catch'](handleError(_0x41a2e1,null));};exports[_0xa47e('0x4d')]=function(_0x504c11,_0x5f2723,_0x12ae39){var _0x1f0442={};var _0x18705b={};var _0x5ddd83;var _0x3eadde;return db[_0xa47e('0x29')][_0xa47e('0x4a')]({'where':{'id':_0x504c11[_0xa47e('0x43')]['id']}})[_0xa47e('0x24')](handleEntityNotFound(_0x5f2723,null))[_0xa47e('0x24')](function(_0x33d935){if(_0x33d935){_0x5ddd83=_0x33d935;_0x18705b[_0xa47e('0x2e')]=_['keys'](db[_0xa47e('0x4b')][_0xa47e('0x2a')]);_0x18705b[_0xa47e('0x2f')]=_[_0xa47e('0x30')](_0x504c11[_0xa47e('0x2f')]);_0x18705b[_0xa47e('0x31')]=_['intersection'](_0x18705b[_0xa47e('0x2e')],_0x18705b[_0xa47e('0x2f')]);_0x1f0442[_0xa47e('0x33')]=_[_0xa47e('0x44')](_0x18705b['model'],qs[_0xa47e('0x32')](_0x504c11[_0xa47e('0x2f')][_0xa47e('0x32')]));_0x1f0442[_0xa47e('0x33')]=_0x1f0442[_0xa47e('0x33')][_0xa47e('0x34')]?_0x1f0442[_0xa47e('0x33')]:_0x18705b['model'];_0x1f0442['order']=qs[_0xa47e('0x38')](_0x504c11[_0xa47e('0x2f')][_0xa47e('0x38')]);_0x1f0442[_0xa47e('0x39')]=qs['filters'](_[_0xa47e('0x3a')](_0x504c11['query'],_0x18705b['filters']));if(_0x504c11[_0xa47e('0x2f')][_0xa47e('0x3b')]){_0x1f0442[_0xa47e('0x39')]=_['merge'](_0x1f0442['where'],{'$or':_[_0xa47e('0x3d')](_0x1f0442[_0xa47e('0x33')],function(_0x4f9823){var _0x515d63={};_0x515d63[_0x4f9823]={'$like':'%'+_0x504c11[_0xa47e('0x2f')]['filter']+'%'};return _0x515d63;})});}_0x1f0442=_[_0xa47e('0x3c')]({},_0x1f0442,_0x504c11['options']);return _0x5ddd83[_0xa47e('0x4d')](_0x1f0442);}})[_0xa47e('0x24')](function(_0x4cdcf8){if(_0x4cdcf8){_0x3eadde=_0x4cdcf8[_0xa47e('0x34')];if(!_0x504c11[_0xa47e('0x2f')]['hasOwnProperty'](_0xa47e('0x36'))){_0x1f0442['limit']=qs[_0xa47e('0x1a')](_0x504c11[_0xa47e('0x2f')][_0xa47e('0x1a')]);_0x1f0442[_0xa47e('0x1d')]=qs[_0xa47e('0x1d')](_0x504c11[_0xa47e('0x2f')][_0xa47e('0x1d')]);}return _0x5ddd83['getDescriptions'](_0x1f0442);}})[_0xa47e('0x24')](function(_0x28d9bf){if(_0x28d9bf){return _0x28d9bf?{'count':_0x3eadde,'rows':_0x28d9bf}:null;}})[_0xa47e('0x24')](respondWithResult(_0x5f2723,null))[_0xa47e('0x42')](handleError(_0x5f2723,null));}; \ No newline at end of file +var _0x15bb=['path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','rows','catch','show','params','create','update','body','find','getFields','findOne','order','getSubjects','ZohoField','pick','filter','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0xf29686,_0x1e73df){var _0x288c09=function(_0x40eff2){while(--_0x40eff2){_0xf29686['push'](_0xf29686['shift']());}};_0x288c09(++_0x1e73df);}(_0x15bb,0x129));var _0xb15b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15bb[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xb15b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb15b('0x1'));var jsonpatch=require(_0xb15b('0x2'));var rp=require('request-promise');var moment=require(_0xb15b('0x3'));var BPromise=require(_0xb15b('0x4'));var Mustache=require(_0xb15b('0x5'));var util=require(_0xb15b('0x6'));var path=require(_0xb15b('0x7'));var sox=require(_0xb15b('0x8'));var csv=require('to-csv');var ejs=require(_0xb15b('0x9'));var fs=require('fs');var fs_extra=require(_0xb15b('0xa'));var _=require(_0xb15b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb15b('0xc'));var deskjs=require(_0xb15b('0xd'));var toCsv=require(_0xb15b('0xe'));var querystring=require(_0xb15b('0xf'));var Papa=require(_0xb15b('0x10'));var Redis=require('ioredis');var authService=require(_0xb15b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb15b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb15b('0x13'))('api');var utils=require(_0xb15b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb15b('0x15'))['db'];function respondWithStatusCode(_0x1be6b7,_0xf5f1f0){_0xf5f1f0=_0xf5f1f0||0xcc;return function(_0x10e0f2){if(_0x10e0f2){return _0x1be6b7[_0xb15b('0x16')](_0xf5f1f0);}return _0x1be6b7['status'](_0xf5f1f0)[_0xb15b('0x17')]();};}function respondWithResult(_0x8d4e05,_0x1302ab){_0x1302ab=_0x1302ab||0xc8;return function(_0x5cf523){if(_0x5cf523){return _0x8d4e05[_0xb15b('0x18')](_0x1302ab)[_0xb15b('0x19')](_0x5cf523);}};}function respondWithFilteredResult(_0x1ebd41,_0x4674b7){return function(_0x28f3b0){if(_0x28f3b0){var _0x11635f=typeof _0x4674b7[_0xb15b('0x1a')]==='undefined'&&typeof _0x4674b7[_0xb15b('0x1b')]==='undefined';var _0x59cf2a=_0x28f3b0[_0xb15b('0x1c')];var _0x30c60f=_0x11635f?0x0:_0x4674b7[_0xb15b('0x1a')];var _0x10ceae=_0x11635f?_0x28f3b0[_0xb15b('0x1c')]:_0x4674b7['offset']+_0x4674b7[_0xb15b('0x1b')];var _0xcdc8b2;if(_0x10ceae>=_0x59cf2a){_0x10ceae=_0x59cf2a;_0xcdc8b2=0xc8;}else{_0xcdc8b2=0xce;}_0x1ebd41['status'](_0xcdc8b2);return _0x1ebd41[_0xb15b('0x1d')](_0xb15b('0x1e'),_0x30c60f+'-'+_0x10ceae+'/'+_0x59cf2a)[_0xb15b('0x19')](_0x28f3b0);}return null;};}function patchUpdates(_0x5932f0){return function(_0x26033b){try{jsonpatch[_0xb15b('0x1f')](_0x26033b,_0x5932f0,!![]);}catch(_0x5b5f6f){return BPromise[_0xb15b('0x20')](_0x5b5f6f);}return _0x26033b[_0xb15b('0x21')]();};}function saveUpdates(_0x14a8b4,_0x575912){return function(_0xe21d28){if(_0xe21d28){return _0xe21d28['update'](_0x14a8b4)['then'](function(_0x4e117f){return _0x4e117f;});}return null;};}function removeEntity(_0x21f59d,_0x231380){return function(_0x2182e2){if(_0x2182e2){return _0x2182e2[_0xb15b('0x22')]()[_0xb15b('0x23')](function(){_0x21f59d[_0xb15b('0x18')](0xcc)[_0xb15b('0x17')]();});}};}function handleEntityNotFound(_0x22e7b9,_0xdad751){return function(_0x202e54){if(!_0x202e54){_0x22e7b9['sendStatus'](0x194);}return _0x202e54;};}function handleError(_0x4c8a03,_0x4bff2c){_0x4bff2c=_0x4bff2c||0x1f4;return function(_0x5d06e8){logger['error'](_0x5d06e8[_0xb15b('0x24')]);if(_0x5d06e8[_0xb15b('0x25')]){delete _0x5d06e8[_0xb15b('0x25')];}_0x4c8a03[_0xb15b('0x18')](_0x4bff2c)['send'](_0x5d06e8);};}exports['index']=function(_0x524c4d,_0x5589b4){var _0x41edab={},_0x5a5bd4={},_0x25c439={'count':0x0,'rows':[]};var _0x1392be=_['map'](db['ZohoConfiguration'][_0xb15b('0x26')],function(_0x595048){return{'name':_0x595048[_0xb15b('0x27')],'type':_0x595048[_0xb15b('0x28')]['key']};});_0x5a5bd4[_0xb15b('0x29')]=_[_0xb15b('0x2a')](_0x1392be,'name');_0x5a5bd4[_0xb15b('0x2b')]=_[_0xb15b('0x2c')](_0x524c4d[_0xb15b('0x2b')]);_0x5a5bd4[_0xb15b('0x2d')]=_['intersection'](_0x5a5bd4[_0xb15b('0x29')],_0x5a5bd4[_0xb15b('0x2b')]);_0x41edab['attributes']=_[_0xb15b('0x2e')](_0x5a5bd4['model'],qs['fields'](_0x524c4d['query'][_0xb15b('0x2f')]));_0x41edab['attributes']=_0x41edab[_0xb15b('0x30')][_0xb15b('0x31')]?_0x41edab['attributes']:_0x5a5bd4[_0xb15b('0x29')];if(!_0x524c4d['query']['hasOwnProperty'](_0xb15b('0x32'))){_0x41edab[_0xb15b('0x1b')]=qs[_0xb15b('0x1b')](_0x524c4d[_0xb15b('0x2b')][_0xb15b('0x1b')]);_0x41edab['offset']=qs['offset'](_0x524c4d[_0xb15b('0x2b')]['offset']);}_0x41edab['order']=qs[_0xb15b('0x33')](_0x524c4d[_0xb15b('0x2b')][_0xb15b('0x33')]);_0x41edab[_0xb15b('0x34')]=qs[_0xb15b('0x2d')](_['pick'](_0x524c4d['query'],_0x5a5bd4[_0xb15b('0x2d')]),_0x1392be);if(_0x524c4d[_0xb15b('0x2b')]['filter']){_0x41edab[_0xb15b('0x34')]=_[_0xb15b('0x35')](_0x41edab[_0xb15b('0x34')],{'$or':_['map'](_0x1392be,function(_0x142bd0){if(_0x142bd0[_0xb15b('0x28')]!==_0xb15b('0x36')){var _0x4d1e49={};_0x4d1e49[_0x142bd0[_0xb15b('0x25')]]={'$like':'%'+_0x524c4d[_0xb15b('0x2b')]['filter']+'%'};return _0x4d1e49;}})});}_0x41edab=_['merge']({},_0x41edab,_0x524c4d[_0xb15b('0x37')]);var _0x5e8597={'where':_0x41edab[_0xb15b('0x34')]};return db[_0xb15b('0x38')][_0xb15b('0x1c')](_0x5e8597)['then'](function(_0x33bd48){_0x25c439['count']=_0x33bd48;if(_0x524c4d[_0xb15b('0x2b')][_0xb15b('0x39')]){_0x41edab[_0xb15b('0x3a')]=[{'all':!![]}];}return db[_0xb15b('0x38')]['findAll'](_0x41edab);})['then'](function(_0x506c70){_0x25c439[_0xb15b('0x3b')]=_0x506c70;return _0x25c439;})[_0xb15b('0x23')](respondWithFilteredResult(_0x5589b4,_0x41edab))[_0xb15b('0x3c')](handleError(_0x5589b4,null));};exports[_0xb15b('0x3d')]=function(_0x436cd3,_0x465143){var _0x11a74d={'raw':![],'where':{'id':_0x436cd3[_0xb15b('0x3e')]['id']}},_0x46fef6={};_0x46fef6[_0xb15b('0x29')]=_['keys'](db[_0xb15b('0x38')][_0xb15b('0x26')]);_0x46fef6[_0xb15b('0x2b')]=_[_0xb15b('0x2c')](_0x436cd3['query']);_0x46fef6[_0xb15b('0x2d')]=_[_0xb15b('0x2e')](_0x46fef6[_0xb15b('0x29')],_0x46fef6[_0xb15b('0x2b')]);_0x11a74d[_0xb15b('0x30')]=_['intersection'](_0x46fef6[_0xb15b('0x29')],qs[_0xb15b('0x2f')](_0x436cd3[_0xb15b('0x2b')]['fields']));_0x11a74d['attributes']=_0x11a74d[_0xb15b('0x30')]['length']?_0x11a74d['attributes']:_0x46fef6[_0xb15b('0x29')];if(_0x436cd3['query'][_0xb15b('0x39')]){_0x11a74d[_0xb15b('0x3a')]=[{'all':!![]}];}_0x11a74d=_[_0xb15b('0x35')]({},_0x11a74d,_0x436cd3[_0xb15b('0x37')]);return db[_0xb15b('0x38')]['find'](_0x11a74d)[_0xb15b('0x23')](handleEntityNotFound(_0x465143,null))['then'](respondWithResult(_0x465143,null))['catch'](handleError(_0x465143,null));};exports[_0xb15b('0x3f')]=function(_0x244eac,_0x3fd840){return db[_0xb15b('0x38')][_0xb15b('0x3f')](_0x244eac['body'],{})['then'](respondWithResult(_0x3fd840,0xc9))[_0xb15b('0x3c')](handleError(_0x3fd840,null));};exports[_0xb15b('0x40')]=function(_0x1e2e07,_0x168872){if(_0x1e2e07['body']['id']){delete _0x1e2e07[_0xb15b('0x41')]['id'];}return db[_0xb15b('0x38')][_0xb15b('0x42')]({'where':{'id':_0x1e2e07[_0xb15b('0x3e')]['id']}})[_0xb15b('0x23')](handleEntityNotFound(_0x168872,null))[_0xb15b('0x23')](saveUpdates(_0x1e2e07['body'],null))['then'](respondWithResult(_0x168872,null))[_0xb15b('0x3c')](handleError(_0x168872,null));};exports[_0xb15b('0x22')]=function(_0x27a539,_0xaa04b0){return db[_0xb15b('0x38')][_0xb15b('0x42')]({'where':{'id':_0x27a539[_0xb15b('0x3e')]['id']}})[_0xb15b('0x23')](handleEntityNotFound(_0xaa04b0,null))[_0xb15b('0x23')](removeEntity(_0xaa04b0,null))['catch'](handleError(_0xaa04b0,null));};exports[_0xb15b('0x43')]=function(_0x4fb6a5,_0x39b5db,_0x5f2d1b){var _0xf9f4c5={};var _0x4b1ac6={};var _0x2b5baa;var _0x34050b;return db[_0xb15b('0x38')][_0xb15b('0x44')]({'where':{'id':_0x4fb6a5['params']['id']}})[_0xb15b('0x23')](handleEntityNotFound(_0x39b5db,null))['then'](function(_0x455178){if(_0x455178){_0x2b5baa=_0x455178;_0x4b1ac6[_0xb15b('0x29')]=_['keys'](db['ZohoField'][_0xb15b('0x26')]);_0x4b1ac6['query']=_['keys'](_0x4fb6a5[_0xb15b('0x2b')]);_0x4b1ac6[_0xb15b('0x2d')]=_['intersection'](_0x4b1ac6['model'],_0x4b1ac6['query']);_0xf9f4c5[_0xb15b('0x30')]=_['intersection'](_0x4b1ac6[_0xb15b('0x29')],qs['fields'](_0x4fb6a5[_0xb15b('0x2b')]['fields']));_0xf9f4c5[_0xb15b('0x30')]=_0xf9f4c5[_0xb15b('0x30')][_0xb15b('0x31')]?_0xf9f4c5[_0xb15b('0x30')]:_0x4b1ac6[_0xb15b('0x29')];_0xf9f4c5[_0xb15b('0x45')]=qs[_0xb15b('0x33')](_0x4fb6a5[_0xb15b('0x2b')]['sort']);_0xf9f4c5[_0xb15b('0x34')]=qs['filters'](_['pick'](_0x4fb6a5[_0xb15b('0x2b')],_0x4b1ac6['filters']));if(_0x4fb6a5[_0xb15b('0x2b')]['filter']){_0xf9f4c5['where']=_[_0xb15b('0x35')](_0xf9f4c5[_0xb15b('0x34')],{'$or':_['map'](_0xf9f4c5[_0xb15b('0x30')],function(_0xfdbbd4){var _0xd06f63={};_0xd06f63[_0xfdbbd4]={'$like':'%'+_0x4fb6a5['query']['filter']+'%'};return _0xd06f63;})});}_0xf9f4c5=_['merge']({},_0xf9f4c5,_0x4fb6a5[_0xb15b('0x37')]);return _0x2b5baa[_0xb15b('0x43')](_0xf9f4c5);}})[_0xb15b('0x23')](function(_0x5ca5d8){if(_0x5ca5d8){_0x34050b=_0x5ca5d8[_0xb15b('0x31')];if(!_0x4fb6a5['query']['hasOwnProperty']('nolimit')){_0xf9f4c5[_0xb15b('0x1b')]=qs[_0xb15b('0x1b')](_0x4fb6a5[_0xb15b('0x2b')][_0xb15b('0x1b')]);_0xf9f4c5[_0xb15b('0x1a')]=qs[_0xb15b('0x1a')](_0x4fb6a5[_0xb15b('0x2b')][_0xb15b('0x1a')]);}return _0x2b5baa[_0xb15b('0x43')](_0xf9f4c5);}})[_0xb15b('0x23')](function(_0xaafed8){if(_0xaafed8){return _0xaafed8?{'count':_0x34050b,'rows':_0xaafed8}:null;}})[_0xb15b('0x23')](respondWithResult(_0x39b5db,null))['catch'](handleError(_0x39b5db,null));};exports[_0xb15b('0x46')]=function(_0x2f3941,_0x634926,_0x22930f){var _0x493239={};var _0x51c39b={};var _0x5ded27;var _0x470bf0;return db[_0xb15b('0x38')][_0xb15b('0x44')]({'where':{'id':_0x2f3941[_0xb15b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x634926,null))[_0xb15b('0x23')](function(_0x13615a){if(_0x13615a){_0x5ded27=_0x13615a;_0x51c39b[_0xb15b('0x29')]=_[_0xb15b('0x2c')](db[_0xb15b('0x47')][_0xb15b('0x26')]);_0x51c39b['query']=_[_0xb15b('0x2c')](_0x2f3941['query']);_0x51c39b[_0xb15b('0x2d')]=_['intersection'](_0x51c39b['model'],_0x51c39b[_0xb15b('0x2b')]);_0x493239['attributes']=_[_0xb15b('0x2e')](_0x51c39b[_0xb15b('0x29')],qs[_0xb15b('0x2f')](_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x2f')]));_0x493239[_0xb15b('0x30')]=_0x493239[_0xb15b('0x30')][_0xb15b('0x31')]?_0x493239[_0xb15b('0x30')]:_0x51c39b[_0xb15b('0x29')];_0x493239[_0xb15b('0x45')]=qs[_0xb15b('0x33')](_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x33')]);_0x493239[_0xb15b('0x34')]=qs[_0xb15b('0x2d')](_[_0xb15b('0x48')](_0x2f3941[_0xb15b('0x2b')],_0x51c39b[_0xb15b('0x2d')]));if(_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x49')]){_0x493239[_0xb15b('0x34')]=_[_0xb15b('0x35')](_0x493239['where'],{'$or':_[_0xb15b('0x2a')](_0x493239[_0xb15b('0x30')],function(_0x2d0b99){var _0x43cb6f={};_0x43cb6f[_0x2d0b99]={'$like':'%'+_0x2f3941['query']['filter']+'%'};return _0x43cb6f;})});}_0x493239=_['merge']({},_0x493239,_0x2f3941['options']);return _0x5ded27['getSubjects'](_0x493239);}})['then'](function(_0x5a1593){if(_0x5a1593){_0x470bf0=_0x5a1593[_0xb15b('0x31')];if(!_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x4a')]('nolimit')){_0x493239[_0xb15b('0x1b')]=qs['limit'](_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x1b')]);_0x493239[_0xb15b('0x1a')]=qs[_0xb15b('0x1a')](_0x2f3941[_0xb15b('0x2b')][_0xb15b('0x1a')]);}return _0x5ded27[_0xb15b('0x46')](_0x493239);}})[_0xb15b('0x23')](function(_0xa877ac){if(_0xa877ac){return _0xa877ac?{'count':_0x470bf0,'rows':_0xa877ac}:null;}})[_0xb15b('0x23')](respondWithResult(_0x634926,null))[_0xb15b('0x3c')](handleError(_0x634926,null));};exports[_0xb15b('0x4b')]=function(_0x4e4479,_0x2cec,_0x5cd496){var _0x49fb3d={};var _0x34dedb={};var _0x3e8c61;var _0xa3ee23;return db[_0xb15b('0x38')][_0xb15b('0x44')]({'where':{'id':_0x4e4479['params']['id']}})[_0xb15b('0x23')](handleEntityNotFound(_0x2cec,null))[_0xb15b('0x23')](function(_0x39a4b7){if(_0x39a4b7){_0x3e8c61=_0x39a4b7;_0x34dedb[_0xb15b('0x29')]=_[_0xb15b('0x2c')](db[_0xb15b('0x47')]['rawAttributes']);_0x34dedb[_0xb15b('0x2b')]=_[_0xb15b('0x2c')](_0x4e4479['query']);_0x34dedb[_0xb15b('0x2d')]=_['intersection'](_0x34dedb[_0xb15b('0x29')],_0x34dedb[_0xb15b('0x2b')]);_0x49fb3d['attributes']=_[_0xb15b('0x2e')](_0x34dedb['model'],qs[_0xb15b('0x2f')](_0x4e4479[_0xb15b('0x2b')]['fields']));_0x49fb3d[_0xb15b('0x30')]=_0x49fb3d[_0xb15b('0x30')]['length']?_0x49fb3d[_0xb15b('0x30')]:_0x34dedb[_0xb15b('0x29')];_0x49fb3d[_0xb15b('0x45')]=qs[_0xb15b('0x33')](_0x4e4479[_0xb15b('0x2b')]['sort']);_0x49fb3d[_0xb15b('0x34')]=qs['filters'](_[_0xb15b('0x48')](_0x4e4479[_0xb15b('0x2b')],_0x34dedb[_0xb15b('0x2d')]));if(_0x4e4479[_0xb15b('0x2b')][_0xb15b('0x49')]){_0x49fb3d[_0xb15b('0x34')]=_[_0xb15b('0x35')](_0x49fb3d[_0xb15b('0x34')],{'$or':_[_0xb15b('0x2a')](_0x49fb3d['attributes'],function(_0x5a9910){var _0x3a8e2f={};_0x3a8e2f[_0x5a9910]={'$like':'%'+_0x4e4479[_0xb15b('0x2b')][_0xb15b('0x49')]+'%'};return _0x3a8e2f;})});}_0x49fb3d=_[_0xb15b('0x35')]({},_0x49fb3d,_0x4e4479[_0xb15b('0x37')]);return _0x3e8c61[_0xb15b('0x4b')](_0x49fb3d);}})[_0xb15b('0x23')](function(_0x22c655){if(_0x22c655){_0xa3ee23=_0x22c655[_0xb15b('0x31')];if(!_0x4e4479['query'][_0xb15b('0x4a')](_0xb15b('0x32'))){_0x49fb3d[_0xb15b('0x1b')]=qs[_0xb15b('0x1b')](_0x4e4479[_0xb15b('0x2b')][_0xb15b('0x1b')]);_0x49fb3d[_0xb15b('0x1a')]=qs['offset'](_0x4e4479[_0xb15b('0x2b')]['offset']);}return _0x3e8c61[_0xb15b('0x4b')](_0x49fb3d);}})[_0xb15b('0x23')](function(_0x50d795){if(_0x50d795){return _0x50d795?{'count':_0xa3ee23,'rows':_0x50d795}:null;}})['then'](respondWithResult(_0x2cec,null))['catch'](handleError(_0x2cec,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b71756b..f8799cf 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 _0xe674=['request-promise','path','rimraf','../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','bluebird'];(function(_0x216a3f,_0x58a88e){var _0x308a5c=function(_0x48edc5){while(--_0x48edc5){_0x216a3f['push'](_0x216a3f['shift']());}};_0x308a5c(++_0x58a88e);}(_0xe674,0x1a9));var _0x4e67=function(_0x4f0846,_0x4fc2f0){_0x4f0846=_0x4f0846-0x0;var _0x2ab157=_0xe674[_0x4f0846];return _0x2ab157;};'use strict';var _=require('lodash');var util=require(_0x4e67('0x0'));var logger=require(_0x4e67('0x1'))(_0x4e67('0x2'));var moment=require('moment');var BPromise=require(_0x4e67('0x3'));var rp=require(_0x4e67('0x4'));var fs=require('fs');var path=require(_0x4e67('0x5'));var rimraf=require(_0x4e67('0x6'));var config=require(_0x4e67('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x4e67('0x8')]=function(_0x5d0cc7,_0x59555f){return _0x5d0cc7['define'](_0x4e67('0x9'),attributes,{'tableName':_0x4e67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73c9=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_zoho_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73c9,0xbb));var _0x973c=function(_0x3b2e13,_0x14e1dd){_0x3b2e13=_0x3b2e13-0x0;var _0x5573dd=_0x73c9[_0x3b2e13];return _0x5573dd;};'use strict';var _=require(_0x973c('0x0'));var util=require('util');var logger=require(_0x973c('0x1'))(_0x973c('0x2'));var moment=require(_0x973c('0x3'));var BPromise=require(_0x973c('0x4'));var rp=require(_0x973c('0x5'));var fs=require('fs');var path=require(_0x973c('0x6'));var rimraf=require(_0x973c('0x7'));var config=require(_0x973c('0x8'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x30f4c8,_0x67de27){return _0x30f4c8[_0x973c('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x973c('0xa'),'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 fdad5a3..6a6151a 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 _0xba8d=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xba8d,0xdf));var _0xdba8=function(_0x22825e,_0x483058){_0x22825e=_0x22825e-0x0;var _0x2346ef=_0xba8d[_0x22825e];return _0x2346ef;};'use strict';var _=require(_0xdba8('0x0'));var util=require(_0xdba8('0x1'));var moment=require(_0xdba8('0x2'));var BPromise=require(_0xdba8('0x3'));var rs=require(_0xdba8('0x4'));var fs=require('fs');var Redis=require(_0xdba8('0x5'));var db=require(_0xdba8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdba8('0x7'))('rpc');var config=require(_0xdba8('0x8'));var jayson=require(_0xdba8('0x9'));var client=jayson[_0xdba8('0xa')][_0xdba8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da40f,_0x1f9051,_0x3dc63a){return new BPromise(function(_0x3491c7,_0x239ee9){return client['request'](_0x5da40f,_0x3dc63a)[_0xdba8('0xc')](function(_0x53549f){logger[_0xdba8('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f9051,_0xdba8('0xe'));logger['debug'](_0xdba8('0xf'),_0x1f9051,'request\x20sent',JSON['stringify'](_0x53549f));if(_0x53549f[_0xdba8('0x10')]){if(_0x53549f[_0xdba8('0x10')][_0xdba8('0x11')]===0x1f4){logger['error'](_0xdba8('0x12'),_0x1f9051,_0x53549f[_0xdba8('0x10')][_0xdba8('0x13')]);return _0x239ee9(_0x53549f[_0xdba8('0x10')]['message']);}logger['error'](_0xdba8('0x12'),_0x1f9051,_0x53549f['error'][_0xdba8('0x13')]);return _0x3491c7(_0x53549f[_0xdba8('0x10')][_0xdba8('0x13')]);}else{logger[_0xdba8('0xd')](_0xdba8('0x12'),_0x1f9051,_0xdba8('0xe'));_0x3491c7(_0x53549f[_0xdba8('0x14')][_0xdba8('0x13')]);}})['catch'](function(_0x30701f){logger['error'](_0xdba8('0x12'),_0x1f9051,_0x30701f);_0x239ee9(_0x30701f);});});} \ No newline at end of file +var _0xaea3=['result','catch','ZohoConfiguration,\x20%s,\x20%s','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5c1ddc,_0x587040){var _0x542a11=function(_0x532a5d){while(--_0x532a5d){_0x5c1ddc['push'](_0x5c1ddc['shift']());}};_0x542a11(++_0x587040);}(_0xaea3,0x183));var _0x3aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea3[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3aea('0x0'));var moment=require(_0x3aea('0x1'));var BPromise=require(_0x3aea('0x2'));var rs=require(_0x3aea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aea('0x4'))['db'];var utils=require(_0x3aea('0x5'));var logger=require(_0x3aea('0x6'))('rpc');var config=require(_0x3aea('0x7'));var jayson=require(_0x3aea('0x8'));var client=jayson[_0x3aea('0x9')][_0x3aea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24953d,_0x35d94e,_0xe0d708){return new BPromise(function(_0x41f2fe,_0x3ffbab){return client[_0x3aea('0xb')](_0x24953d,_0xe0d708)[_0x3aea('0xc')](function(_0x57a494){logger[_0x3aea('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x35d94e,_0x3aea('0xe'));logger[_0x3aea('0xf')](_0x3aea('0x10'),_0x35d94e,_0x3aea('0xe'),JSON[_0x3aea('0x11')](_0x57a494));if(_0x57a494[_0x3aea('0x12')]){if(_0x57a494[_0x3aea('0x12')][_0x3aea('0x13')]===0x1f4){logger[_0x3aea('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x35d94e,_0x57a494[_0x3aea('0x12')]['message']);return _0x3ffbab(_0x57a494[_0x3aea('0x12')][_0x3aea('0x14')]);}logger[_0x3aea('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x35d94e,_0x57a494[_0x3aea('0x12')]['message']);return _0x41f2fe(_0x57a494[_0x3aea('0x12')][_0x3aea('0x14')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x35d94e,'request\x20sent');_0x41f2fe(_0x57a494[_0x3aea('0x15')][_0x3aea('0x14')]);}})[_0x3aea('0x16')](function(_0x56a17e){logger[_0x3aea('0x12')](_0x3aea('0x17'),_0x35d94e,_0x56a17e);_0x3ffbab(_0x56a17e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 25d6238..30c77d1 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 _0x1b72=['../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b49d1,_0x59aa7f){var _0x22eb64=function(_0x550c64){while(--_0x550c64){_0x2b49d1['push'](_0x2b49d1['shift']());}};_0x22eb64(++_0x59aa7f);}(_0x1b72,0xc0));var _0x21b7=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1b72[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0x21b7('0x0'));var util=require(_0x21b7('0x1'));var path=require(_0x21b7('0x2'));var timeout=require(_0x21b7('0x3'));var express=require(_0x21b7('0x4'));var router=express[_0x21b7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x21b7('0x6'));var config=require(_0x21b7('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x21b7('0x8')](),controller[_0x21b7('0x9')]);router['get']('/:id',auth[_0x21b7('0x8')](),controller[_0x21b7('0xa')]);router[_0x21b7('0xb')]('/',auth['isAuthenticated'](),controller[_0x21b7('0xc')]);router['put'](_0x21b7('0xd'),auth[_0x21b7('0x8')](),controller[_0x21b7('0xe')]);router[_0x21b7('0xf')](_0x21b7('0xd'),auth[_0x21b7('0x8')](),controller[_0x21b7('0x10')]);module[_0x21b7('0x11')]=router; \ No newline at end of file +var _0x90bb=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x587943,_0x4a0f95){var _0x13b4e4=function(_0x952300){while(--_0x952300){_0x587943['push'](_0x587943['shift']());}};_0x13b4e4(++_0x4a0f95);}(_0x90bb,0x7b));var _0xb90b=function(_0x5b72c4,_0x1a41ab){_0x5b72c4=_0x5b72c4-0x0;var _0x28a6b8=_0x90bb[_0x5b72c4];return _0x28a6b8;};'use strict';var multer=require(_0xb90b('0x0'));var util=require('util');var path=require(_0xb90b('0x1'));var timeout=require(_0xb90b('0x2'));var express=require(_0xb90b('0x3'));var router=express['Router']();var fs_extra=require(_0xb90b('0x4'));var auth=require(_0xb90b('0x5'));var interaction=require(_0xb90b('0x6'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xb90b('0x7')]('/',auth[_0xb90b('0x8')](),controller[_0xb90b('0x9')]);router[_0xb90b('0x7')](_0xb90b('0xa'),auth[_0xb90b('0x8')](),controller[_0xb90b('0xb')]);router[_0xb90b('0xc')]('/',auth[_0xb90b('0x8')](),controller[_0xb90b('0xd')]);router['put'](_0xb90b('0xa'),auth[_0xb90b('0x8')](),controller[_0xb90b('0xe')]);router['delete'](_0xb90b('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb90b('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6e60afc..e9bae72 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 _0x8b9a=['customVariable','keyValue','STRING','variable','exports','ENUM','string'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8b9a,0xa5));var _0xa8b9=function(_0xe70ed5,_0x404aab){_0xe70ed5=_0xe70ed5-0x0;var _0x515cd9=_0x8b9a[_0xe70ed5];return _0x515cd9;};'use strict';var Sequelize=require('sequelize');module[_0xa8b9('0x0')]={'type':{'type':Sequelize[_0xa8b9('0x1')](_0xa8b9('0x2'),'variable',_0xa8b9('0x3'),_0xa8b9('0x4'),'picklist'),'defaultValue':_0xa8b9('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa8b9('0x5')]},'keyType':{'type':Sequelize[_0xa8b9('0x1')](_0xa8b9('0x2'),_0xa8b9('0x6'),_0xa8b9('0x3'))},'keyContent':{'type':Sequelize[_0xa8b9('0x5')]},'idField':{'type':Sequelize[_0xa8b9('0x5')]},'nameField':{'type':Sequelize[_0xa8b9('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa8b9('0x5')]}}; \ No newline at end of file +var _0x976b=['variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x58a7bc,_0x1bceef){var _0x59e9ec=function(_0x49bde9){while(--_0x49bde9){_0x58a7bc['push'](_0x58a7bc['shift']());}};_0x59e9ec(++_0x1bceef);}(_0x976b,0x1e3));var _0xb976=function(_0x56679e,_0x948815){_0x56679e=_0x56679e-0x0;var _0x555d05=_0x976b[_0x56679e];return _0x555d05;};'use strict';var Sequelize=require(_0xb976('0x0'));module[_0xb976('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb976('0x2'),_0xb976('0x3'),_0xb976('0x4'),'keyValue',_0xb976('0x5')),'defaultValue':_0xb976('0x2')},'content':{'type':Sequelize[_0xb976('0x6')]},'key':{'type':Sequelize[_0xb976('0x6')]},'keyType':{'type':Sequelize[_0xb976('0x7')](_0xb976('0x2'),'variable',_0xb976('0x4'))},'keyContent':{'type':Sequelize[_0xb976('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb976('0x6')]},'customField':{'type':Sequelize[_0xb976('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb976('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c09e69e..d752a97 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 _0x933c=['ZohoField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x32d9cd,_0x5996b7){var _0x27e826=function(_0x373594){while(--_0x373594){_0x32d9cd['push'](_0x32d9cd['shift']());}};_0x27e826(++_0x5996b7);}(_0x933c,0x69));var _0xc933=function(_0x3021cd,_0x163ac1){_0x3021cd=_0x3021cd-0x0;var _0x163396=_0x933c[_0x3021cd];return _0x163396;};'use strict';var emlformat=require(_0xc933('0x0'));var rimraf=require(_0xc933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc933('0x2'));var moment=require('moment');var BPromise=require(_0xc933('0x3'));var Mustache=require(_0xc933('0x4'));var util=require(_0xc933('0x5'));var path=require(_0xc933('0x6'));var sox=require(_0xc933('0x7'));var csv=require(_0xc933('0x8'));var ejs=require(_0xc933('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc933('0xa'));var crypto=require(_0xc933('0xb'));var jsforce=require(_0xc933('0xc'));var deskjs=require(_0xc933('0xd'));var toCsv=require(_0xc933('0x8'));var querystring=require(_0xc933('0xe'));var Papa=require(_0xc933('0xf'));var Redis=require('ioredis');var authService=require(_0xc933('0x10'));var qs=require(_0xc933('0x11'));var as=require(_0xc933('0x12'));var hardwareService=require(_0xc933('0x13'));var logger=require(_0xc933('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc933('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34bf1f,_0x36850f){_0x36850f=_0x36850f||0xcc;return function(_0xea70fb){if(_0xea70fb){return _0x34bf1f[_0xc933('0x16')](_0x36850f);}return _0x34bf1f[_0xc933('0x17')](_0x36850f)[_0xc933('0x18')]();};}function respondWithResult(_0x183662,_0x4961d2){_0x4961d2=_0x4961d2||0xc8;return function(_0x5437f5){if(_0x5437f5){return _0x183662[_0xc933('0x17')](_0x4961d2)[_0xc933('0x19')](_0x5437f5);}};}function respondWithFilteredResult(_0x3734b2,_0x36f42a){return function(_0x27c27e){if(_0x27c27e){var _0x281266=typeof _0x36f42a[_0xc933('0x1a')]===_0xc933('0x1b')&&typeof _0x36f42a['limit']===_0xc933('0x1b');var _0x312725=_0x27c27e[_0xc933('0x1c')];var _0x21290e=_0x281266?0x0:_0x36f42a[_0xc933('0x1a')];var _0x1e441c=_0x281266?_0x27c27e[_0xc933('0x1c')]:_0x36f42a[_0xc933('0x1a')]+_0x36f42a[_0xc933('0x1d')];var _0x39e1fe;if(_0x1e441c>=_0x312725){_0x1e441c=_0x312725;_0x39e1fe=0xc8;}else{_0x39e1fe=0xce;}_0x3734b2[_0xc933('0x17')](_0x39e1fe);return _0x3734b2[_0xc933('0x1e')](_0xc933('0x1f'),_0x21290e+'-'+_0x1e441c+'/'+_0x312725)[_0xc933('0x19')](_0x27c27e);}return null;};}function patchUpdates(_0x5f0d2f){return function(_0xf7a65b){try{jsonpatch['apply'](_0xf7a65b,_0x5f0d2f,!![]);}catch(_0xfd9d73){return BPromise[_0xc933('0x20')](_0xfd9d73);}return _0xf7a65b[_0xc933('0x21')]();};}function saveUpdates(_0xa0315a,_0x2f0ae4){return function(_0x1479e){if(_0x1479e){return _0x1479e[_0xc933('0x22')](_0xa0315a)[_0xc933('0x23')](function(_0x4045b3){return _0x4045b3;});}return null;};}function removeEntity(_0x25752a,_0x4b3cd6){return function(_0x34074f){if(_0x34074f){return _0x34074f[_0xc933('0x24')]()['then'](function(){_0x25752a[_0xc933('0x17')](0xcc)[_0xc933('0x18')]();});}};}function handleEntityNotFound(_0x33658c,_0x2fd302){return function(_0x3e6660){if(!_0x3e6660){_0x33658c[_0xc933('0x16')](0x194);}return _0x3e6660;};}function handleError(_0xeb60d7,_0x3a3a13){_0x3a3a13=_0x3a3a13||0x1f4;return function(_0x20eac1){logger[_0xc933('0x25')](_0x20eac1[_0xc933('0x26')]);if(_0x20eac1[_0xc933('0x27')]){delete _0x20eac1[_0xc933('0x27')];}_0xeb60d7[_0xc933('0x17')](_0x3a3a13)[_0xc933('0x28')](_0x20eac1);};}exports[_0xc933('0x29')]=function(_0x1f373d,_0x23b687){var _0xa77afa={},_0x52b0e5={},_0x1d9fd2={'count':0x0,'rows':[]};var _0x40efc6=_[_0xc933('0x2a')](db[_0xc933('0x2b')][_0xc933('0x2c')],function(_0x21d65a){return{'name':_0x21d65a['fieldName'],'type':_0x21d65a[_0xc933('0x2d')][_0xc933('0x2e')]};});_0x52b0e5[_0xc933('0x2f')]=_[_0xc933('0x2a')](_0x40efc6,_0xc933('0x27'));_0x52b0e5[_0xc933('0x30')]=_[_0xc933('0x31')](_0x1f373d[_0xc933('0x30')]);_0x52b0e5[_0xc933('0x32')]=_[_0xc933('0x33')](_0x52b0e5[_0xc933('0x2f')],_0x52b0e5[_0xc933('0x30')]);_0xa77afa[_0xc933('0x34')]=_[_0xc933('0x33')](_0x52b0e5[_0xc933('0x2f')],qs[_0xc933('0x35')](_0x1f373d[_0xc933('0x30')]['fields']));_0xa77afa[_0xc933('0x34')]=_0xa77afa[_0xc933('0x34')][_0xc933('0x36')]?_0xa77afa['attributes']:_0x52b0e5[_0xc933('0x2f')];if(!_0x1f373d[_0xc933('0x30')][_0xc933('0x37')](_0xc933('0x38'))){_0xa77afa[_0xc933('0x1d')]=qs[_0xc933('0x1d')](_0x1f373d[_0xc933('0x30')][_0xc933('0x1d')]);_0xa77afa['offset']=qs['offset'](_0x1f373d[_0xc933('0x30')]['offset']);}_0xa77afa['order']=qs[_0xc933('0x39')](_0x1f373d['query'][_0xc933('0x39')]);_0xa77afa[_0xc933('0x3a')]=qs[_0xc933('0x32')](_[_0xc933('0x3b')](_0x1f373d[_0xc933('0x30')],_0x52b0e5['filters']),_0x40efc6);if(_0x1f373d['query'][_0xc933('0x3c')]){_0xa77afa[_0xc933('0x3a')]=_['merge'](_0xa77afa['where'],{'$or':_[_0xc933('0x2a')](_0x40efc6,function(_0xcbe0e2){if(_0xcbe0e2['type']!==_0xc933('0x3d')){var _0x133144={};_0x133144[_0xcbe0e2['name']]={'$like':'%'+_0x1f373d['query'][_0xc933('0x3c')]+'%'};return _0x133144;}})});}_0xa77afa=_['merge']({},_0xa77afa,_0x1f373d[_0xc933('0x3e')]);var _0x55691a={'where':_0xa77afa[_0xc933('0x3a')]};return db[_0xc933('0x2b')]['count'](_0x55691a)[_0xc933('0x23')](function(_0x5ba5a2){_0x1d9fd2[_0xc933('0x1c')]=_0x5ba5a2;if(_0x1f373d['query'][_0xc933('0x3f')]){_0xa77afa[_0xc933('0x40')]=[{'all':!![]}];}return db[_0xc933('0x2b')][_0xc933('0x41')](_0xa77afa);})[_0xc933('0x23')](function(_0xaf41b9){_0x1d9fd2[_0xc933('0x42')]=_0xaf41b9;return _0x1d9fd2;})[_0xc933('0x23')](respondWithFilteredResult(_0x23b687,_0xa77afa))[_0xc933('0x43')](handleError(_0x23b687,null));};exports[_0xc933('0x44')]=function(_0x373725,_0x68fc0d){var _0x28b3cd={'raw':!![],'where':{'id':_0x373725[_0xc933('0x45')]['id']}},_0x1b4330={};_0x1b4330[_0xc933('0x2f')]=_['keys'](db[_0xc933('0x2b')]['rawAttributes']);_0x1b4330['query']=_[_0xc933('0x31')](_0x373725[_0xc933('0x30')]);_0x1b4330[_0xc933('0x32')]=_[_0xc933('0x33')](_0x1b4330['model'],_0x1b4330[_0xc933('0x30')]);_0x28b3cd[_0xc933('0x34')]=_[_0xc933('0x33')](_0x1b4330[_0xc933('0x2f')],qs['fields'](_0x373725[_0xc933('0x30')][_0xc933('0x35')]));_0x28b3cd[_0xc933('0x34')]=_0x28b3cd['attributes'][_0xc933('0x36')]?_0x28b3cd[_0xc933('0x34')]:_0x1b4330[_0xc933('0x2f')];if(_0x373725[_0xc933('0x30')][_0xc933('0x3f')]){_0x28b3cd[_0xc933('0x40')]=[{'all':!![]}];}_0x28b3cd=_[_0xc933('0x46')]({},_0x28b3cd,_0x373725[_0xc933('0x3e')]);return db[_0xc933('0x2b')][_0xc933('0x47')](_0x28b3cd)[_0xc933('0x23')](handleEntityNotFound(_0x68fc0d,null))[_0xc933('0x23')](respondWithResult(_0x68fc0d,null))['catch'](handleError(_0x68fc0d,null));};exports[_0xc933('0x48')]=function(_0xfb1bb8,_0x4d52dd){return db[_0xc933('0x2b')][_0xc933('0x48')](_0xfb1bb8[_0xc933('0x49')],{})['then'](respondWithResult(_0x4d52dd,0xc9))['catch'](handleError(_0x4d52dd,null));};exports[_0xc933('0x22')]=function(_0x33b97a,_0x42ee50){if(_0x33b97a[_0xc933('0x49')]['id']){delete _0x33b97a['body']['id'];}return db[_0xc933('0x2b')][_0xc933('0x47')]({'where':{'id':_0x33b97a[_0xc933('0x45')]['id']}})[_0xc933('0x23')](handleEntityNotFound(_0x42ee50,null))['then'](saveUpdates(_0x33b97a['body'],null))[_0xc933('0x23')](respondWithResult(_0x42ee50,null))['catch'](handleError(_0x42ee50,null));};exports['destroy']=function(_0x2ffa53,_0x39a5ee){return db[_0xc933('0x2b')]['find']({'where':{'id':_0x2ffa53[_0xc933('0x45')]['id']}})[_0xc933('0x23')](handleEntityNotFound(_0x39a5ee,null))[_0xc933('0x23')](removeEntity(_0x39a5ee,null))['catch'](handleError(_0x39a5ee,null));}; \ No newline at end of file +var _0x4a4b=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','then','intersection','find','catch','create','body','params','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','save','update','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x202031,_0x1cf608){var _0x23d1a6=function(_0x11fd4d){while(--_0x11fd4d){_0x202031['push'](_0x202031['shift']());}};_0x23d1a6(++_0x1cf608);}(_0x4a4b,0x9c));var _0xb4a4=function(_0xcf237c,_0x6a804a){_0xcf237c=_0xcf237c-0x0;var _0x5b6df6=_0x4a4b[_0xcf237c];return _0x5b6df6;};'use strict';var emlformat=require(_0xb4a4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb4a4('0x1'));var rp=require('request-promise');var moment=require(_0xb4a4('0x2'));var BPromise=require(_0xb4a4('0x3'));var Mustache=require(_0xb4a4('0x4'));var util=require(_0xb4a4('0x5'));var path=require(_0xb4a4('0x6'));var sox=require('sox');var csv=require(_0xb4a4('0x7'));var ejs=require(_0xb4a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4a4('0x9'));var squel=require('squel');var crypto=require(_0xb4a4('0xa'));var jsforce=require(_0xb4a4('0xb'));var deskjs=require(_0xb4a4('0xc'));var toCsv=require(_0xb4a4('0x7'));var querystring=require(_0xb4a4('0xd'));var Papa=require(_0xb4a4('0xe'));var Redis=require(_0xb4a4('0xf'));var authService=require(_0xb4a4('0x10'));var qs=require(_0xb4a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4a4('0x12'));var logger=require('../../config/logger')(_0xb4a4('0x13'));var utils=require(_0xb4a4('0x14'));var config=require(_0xb4a4('0x15'));var licenseUtil=require(_0xb4a4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4105a8,_0x1c5cd6){_0x1c5cd6=_0x1c5cd6||0xcc;return function(_0x5bc9ee){if(_0x5bc9ee){return _0x4105a8['sendStatus'](_0x1c5cd6);}return _0x4105a8[_0xb4a4('0x17')](_0x1c5cd6)[_0xb4a4('0x18')]();};}function respondWithResult(_0x3db427,_0x21577a){_0x21577a=_0x21577a||0xc8;return function(_0x4732dc){if(_0x4732dc){return _0x3db427['status'](_0x21577a)['json'](_0x4732dc);}};}function respondWithFilteredResult(_0x475549,_0x404bf5){return function(_0x186921){if(_0x186921){var _0x561be6=typeof _0x404bf5[_0xb4a4('0x19')]==='undefined'&&typeof _0x404bf5['limit']===_0xb4a4('0x1a');var _0x1e30fc=_0x186921['count'];var _0x1aebbf=_0x561be6?0x0:_0x404bf5['offset'];var _0x212d2b=_0x561be6?_0x186921[_0xb4a4('0x1b')]:_0x404bf5[_0xb4a4('0x19')]+_0x404bf5['limit'];var _0x47abdb;if(_0x212d2b>=_0x1e30fc){_0x212d2b=_0x1e30fc;_0x47abdb=0xc8;}else{_0x47abdb=0xce;}_0x475549[_0xb4a4('0x17')](_0x47abdb);return _0x475549[_0xb4a4('0x1c')]('Content-Range',_0x1aebbf+'-'+_0x212d2b+'/'+_0x1e30fc)['json'](_0x186921);}return null;};}function patchUpdates(_0x5d3ae1){return function(_0x4d8939){try{jsonpatch['apply'](_0x4d8939,_0x5d3ae1,!![]);}catch(_0x6c7d96){return BPromise['reject'](_0x6c7d96);}return _0x4d8939[_0xb4a4('0x1d')]();};}function saveUpdates(_0x5ab223,_0x286e1d){return function(_0x1ce0de){if(_0x1ce0de){return _0x1ce0de[_0xb4a4('0x1e')](_0x5ab223)['then'](function(_0xb3660){return _0xb3660;});}return null;};}function removeEntity(_0x4ea409,_0x35bc5f){return function(_0x5e0294){if(_0x5e0294){return _0x5e0294['destroy']()['then'](function(){_0x4ea409[_0xb4a4('0x17')](0xcc)[_0xb4a4('0x18')]();});}};}function handleEntityNotFound(_0x2cc92f,_0x31c454){return function(_0x2602ce){if(!_0x2602ce){_0x2cc92f['sendStatus'](0x194);}return _0x2602ce;};}function handleError(_0x33ba95,_0x3eb2cd){_0x3eb2cd=_0x3eb2cd||0x1f4;return function(_0x4c8335){logger[_0xb4a4('0x1f')](_0x4c8335[_0xb4a4('0x20')]);if(_0x4c8335[_0xb4a4('0x21')]){delete _0x4c8335[_0xb4a4('0x21')];}_0x33ba95['status'](_0x3eb2cd)[_0xb4a4('0x22')](_0x4c8335);};}exports[_0xb4a4('0x23')]=function(_0x3f0ace,_0x3a8a74){var _0x1af580={},_0x2c57d3={},_0x394883={'count':0x0,'rows':[]};var _0x66ef3b=_['map'](db[_0xb4a4('0x24')][_0xb4a4('0x25')],function(_0x3b71fe){return{'name':_0x3b71fe[_0xb4a4('0x26')],'type':_0x3b71fe[_0xb4a4('0x27')][_0xb4a4('0x28')]};});_0x2c57d3[_0xb4a4('0x29')]=_['map'](_0x66ef3b,_0xb4a4('0x21'));_0x2c57d3[_0xb4a4('0x2a')]=_[_0xb4a4('0x2b')](_0x3f0ace[_0xb4a4('0x2a')]);_0x2c57d3['filters']=_['intersection'](_0x2c57d3['model'],_0x2c57d3[_0xb4a4('0x2a')]);_0x1af580['attributes']=_['intersection'](_0x2c57d3[_0xb4a4('0x29')],qs[_0xb4a4('0x2c')](_0x3f0ace[_0xb4a4('0x2a')][_0xb4a4('0x2c')]));_0x1af580[_0xb4a4('0x2d')]=_0x1af580['attributes'][_0xb4a4('0x2e')]?_0x1af580[_0xb4a4('0x2d')]:_0x2c57d3[_0xb4a4('0x29')];if(!_0x3f0ace['query'][_0xb4a4('0x2f')](_0xb4a4('0x30'))){_0x1af580[_0xb4a4('0x31')]=qs[_0xb4a4('0x31')](_0x3f0ace['query'][_0xb4a4('0x31')]);_0x1af580[_0xb4a4('0x19')]=qs[_0xb4a4('0x19')](_0x3f0ace['query'][_0xb4a4('0x19')]);}_0x1af580[_0xb4a4('0x32')]=qs['sort'](_0x3f0ace[_0xb4a4('0x2a')]['sort']);_0x1af580[_0xb4a4('0x33')]=qs[_0xb4a4('0x34')](_[_0xb4a4('0x35')](_0x3f0ace[_0xb4a4('0x2a')],_0x2c57d3['filters']),_0x66ef3b);if(_0x3f0ace[_0xb4a4('0x2a')][_0xb4a4('0x36')]){_0x1af580[_0xb4a4('0x33')]=_[_0xb4a4('0x37')](_0x1af580['where'],{'$or':_['map'](_0x66ef3b,function(_0x35d015){if(_0x35d015['type']!==_0xb4a4('0x38')){var _0x635166={};_0x635166[_0x35d015[_0xb4a4('0x21')]]={'$like':'%'+_0x3f0ace[_0xb4a4('0x2a')][_0xb4a4('0x36')]+'%'};return _0x635166;}})});}_0x1af580=_[_0xb4a4('0x37')]({},_0x1af580,_0x3f0ace[_0xb4a4('0x39')]);var _0x483333={'where':_0x1af580[_0xb4a4('0x33')]};return db[_0xb4a4('0x24')][_0xb4a4('0x1b')](_0x483333)['then'](function(_0x41fead){_0x394883[_0xb4a4('0x1b')]=_0x41fead;if(_0x3f0ace[_0xb4a4('0x2a')][_0xb4a4('0x3a')]){_0x1af580[_0xb4a4('0x3b')]=[{'all':!![]}];}return db[_0xb4a4('0x24')]['findAll'](_0x1af580);})['then'](function(_0x4cfdc2){_0x394883[_0xb4a4('0x3c')]=_0x4cfdc2;return _0x394883;})[_0xb4a4('0x3d')](respondWithFilteredResult(_0x3a8a74,_0x1af580))['catch'](handleError(_0x3a8a74,null));};exports['show']=function(_0x5b30a6,_0x374802){var _0x516670={'raw':!![],'where':{'id':_0x5b30a6['params']['id']}},_0x5a1107={};_0x5a1107[_0xb4a4('0x29')]=_[_0xb4a4('0x2b')](db[_0xb4a4('0x24')]['rawAttributes']);_0x5a1107[_0xb4a4('0x2a')]=_[_0xb4a4('0x2b')](_0x5b30a6['query']);_0x5a1107[_0xb4a4('0x34')]=_[_0xb4a4('0x3e')](_0x5a1107['model'],_0x5a1107[_0xb4a4('0x2a')]);_0x516670[_0xb4a4('0x2d')]=_[_0xb4a4('0x3e')](_0x5a1107['model'],qs['fields'](_0x5b30a6[_0xb4a4('0x2a')][_0xb4a4('0x2c')]));_0x516670[_0xb4a4('0x2d')]=_0x516670[_0xb4a4('0x2d')][_0xb4a4('0x2e')]?_0x516670[_0xb4a4('0x2d')]:_0x5a1107[_0xb4a4('0x29')];if(_0x5b30a6['query'][_0xb4a4('0x3a')]){_0x516670[_0xb4a4('0x3b')]=[{'all':!![]}];}_0x516670=_[_0xb4a4('0x37')]({},_0x516670,_0x5b30a6[_0xb4a4('0x39')]);return db[_0xb4a4('0x24')][_0xb4a4('0x3f')](_0x516670)[_0xb4a4('0x3d')](handleEntityNotFound(_0x374802,null))['then'](respondWithResult(_0x374802,null))[_0xb4a4('0x40')](handleError(_0x374802,null));};exports['create']=function(_0x56f6af,_0xe86481){return db['ZohoField'][_0xb4a4('0x41')](_0x56f6af['body'],{})['then'](respondWithResult(_0xe86481,0xc9))[_0xb4a4('0x40')](handleError(_0xe86481,null));};exports['update']=function(_0x333752,_0x501305){if(_0x333752[_0xb4a4('0x42')]['id']){delete _0x333752[_0xb4a4('0x42')]['id'];}return db[_0xb4a4('0x24')][_0xb4a4('0x3f')]({'where':{'id':_0x333752[_0xb4a4('0x43')]['id']}})[_0xb4a4('0x3d')](handleEntityNotFound(_0x501305,null))[_0xb4a4('0x3d')](saveUpdates(_0x333752[_0xb4a4('0x42')],null))['then'](respondWithResult(_0x501305,null))['catch'](handleError(_0x501305,null));};exports[_0xb4a4('0x44')]=function(_0x3d3add,_0x46b4e9){return db[_0xb4a4('0x24')][_0xb4a4('0x3f')]({'where':{'id':_0x3d3add['params']['id']}})[_0xb4a4('0x3d')](handleEntityNotFound(_0x46b4e9,null))[_0xb4a4('0x3d')](removeEntity(_0x46b4e9,null))[_0xb4a4('0x40')](handleError(_0x46b4e9,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b5dadf2..37ba9c2 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 _0x66fa=['rimraf','../../config/environment','define','ZohoField','int_zoho_fields','idField','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x66fa,0x117));var _0xa66f=function(_0x5641b3,_0x154f88){_0x5641b3=_0x5641b3-0x0;var _0x14c644=_0x66fa[_0x5641b3];return _0x14c644;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xa66f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x567ac9,_0x43b49e){var _0x101959=function(_0x543727){while(--_0x543727){_0x567ac9['push'](_0x567ac9['shift']());}};_0x101959(++_0x43b49e);}(_0x5496,0x175));var _0x6549=function(_0x3b0dc9,_0x3a885f){_0x3b0dc9=_0x3b0dc9-0x0;var _0x532080=_0x5496[_0x3b0dc9];return _0x532080;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('ZohoField',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xc'),'FieldId'],'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 d4ccbd0..dc1a158 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 _0xc7cc=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc7cc,0x164));var _0xcc7c=function(_0x50b4c2,_0x440c0c){_0x50b4c2=_0x50b4c2-0x0;var _0xe45250=_0xc7cc[_0x50b4c2];return _0xe45250;};'use strict';var _=require(_0xcc7c('0x0'));var util=require(_0xcc7c('0x1'));var moment=require(_0xcc7c('0x2'));var BPromise=require(_0xcc7c('0x3'));var rs=require(_0xcc7c('0x4'));var fs=require('fs');var Redis=require(_0xcc7c('0x5'));var db=require(_0xcc7c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc7c('0x7'))(_0xcc7c('0x8'));var config=require(_0xcc7c('0x9'));var jayson=require(_0xcc7c('0xa'));var client=jayson[_0xcc7c('0xb')][_0xcc7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4aeacd,_0x89414a,_0x353b7d){return new BPromise(function(_0x28579f,_0x84a068){return client[_0xcc7c('0xd')](_0x4aeacd,_0x353b7d)[_0xcc7c('0xe')](function(_0x14fa2f){logger[_0xcc7c('0xf')](_0xcc7c('0x10'),_0x89414a,_0xcc7c('0x11'));logger[_0xcc7c('0x12')](_0xcc7c('0x13'),_0x89414a,_0xcc7c('0x11'),JSON[_0xcc7c('0x14')](_0x14fa2f));if(_0x14fa2f[_0xcc7c('0x15')]){if(_0x14fa2f[_0xcc7c('0x15')]['code']===0x1f4){logger[_0xcc7c('0x15')](_0xcc7c('0x10'),_0x89414a,_0x14fa2f[_0xcc7c('0x15')]['message']);return _0x84a068(_0x14fa2f[_0xcc7c('0x15')][_0xcc7c('0x16')]);}logger[_0xcc7c('0x15')](_0xcc7c('0x10'),_0x89414a,_0x14fa2f['error']['message']);return _0x28579f(_0x14fa2f[_0xcc7c('0x15')][_0xcc7c('0x16')]);}else{logger[_0xcc7c('0xf')]('ZohoField,\x20%s,\x20%s',_0x89414a,'request\x20sent');_0x28579f(_0x14fa2f[_0xcc7c('0x17')][_0xcc7c('0x16')]);}})['catch'](function(_0x5ccf4c){logger[_0xcc7c('0x15')]('ZohoField,\x20%s,\x20%s',_0x89414a,_0x5ccf4c);_0x84a068(_0x5ccf4c);});});} \ No newline at end of file +var _0xd9e2=['code','message','ZohoField,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xd9e2,0x78));var _0x2d9e=function(_0x5b4b5e,_0x1d9a9a){_0x5b4b5e=_0x5b4b5e-0x0;var _0xc28e56=_0xd9e2[_0x5b4b5e];return _0xc28e56;};'use strict';var _=require('lodash');var util=require(_0x2d9e('0x0'));var moment=require(_0x2d9e('0x1'));var BPromise=require(_0x2d9e('0x2'));var rs=require(_0x2d9e('0x3'));var fs=require('fs');var Redis=require(_0x2d9e('0x4'));var db=require(_0x2d9e('0x5'))['db'];var utils=require(_0x2d9e('0x6'));var logger=require(_0x2d9e('0x7'))(_0x2d9e('0x8'));var config=require(_0x2d9e('0x9'));var jayson=require(_0x2d9e('0xa'));var client=jayson['client'][_0x2d9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x281398,_0x2c138f,_0x1cf960){return new BPromise(function(_0x4cf6a1,_0x415611){return client[_0x2d9e('0xc')](_0x281398,_0x1cf960)[_0x2d9e('0xd')](function(_0x145c1e){logger[_0x2d9e('0xe')]('ZohoField,\x20%s,\x20%s',_0x2c138f,_0x2d9e('0xf'));logger['debug'](_0x2d9e('0x10'),_0x2c138f,_0x2d9e('0xf'),JSON['stringify'](_0x145c1e));if(_0x145c1e['error']){if(_0x145c1e[_0x2d9e('0x11')][_0x2d9e('0x12')]===0x1f4){logger[_0x2d9e('0x11')]('ZohoField,\x20%s,\x20%s',_0x2c138f,_0x145c1e[_0x2d9e('0x11')][_0x2d9e('0x13')]);return _0x415611(_0x145c1e[_0x2d9e('0x11')][_0x2d9e('0x13')]);}logger['error'](_0x2d9e('0x14'),_0x2c138f,_0x145c1e[_0x2d9e('0x11')][_0x2d9e('0x13')]);return _0x4cf6a1(_0x145c1e[_0x2d9e('0x11')][_0x2d9e('0x13')]);}else{logger['info'](_0x2d9e('0x14'),_0x2c138f,_0x2d9e('0xf'));_0x4cf6a1(_0x145c1e[_0x2d9e('0x15')][_0x2d9e('0x13')]);}})[_0x2d9e('0x16')](function(_0xb70f0c){logger[_0x2d9e('0x11')](_0x2d9e('0x14'),_0x2c138f,_0xb70f0c);_0x415611(_0xb70f0c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dd7394a..a8931c5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x499a3c,_0x2e5e53){var _0x4e1218=function(_0x321cc7){while(--_0x321cc7){_0x499a3c['push'](_0x499a3c['shift']());}};_0x4e1218(++_0x2e5e53);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xb770f5,_0x2d2f4d){var _0x6693b9=function(_0x59559c){while(--_0x59559c){_0xb770f5['push'](_0xb770f5['shift']());}};_0x6693b9(++_0x2d2f4d);}(_0xedd9,0xfc));var _0x9edd=function(_0x5e7ab9,_0x147229){_0x5e7ab9=_0x5e7ab9-0x0;var _0x26dade=_0xedd9[_0x5e7ab9];return _0x26dade;};'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 diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4a1276a..7ed17e7 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 _0xa7b5=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x1c2340,_0x3f1595){var _0xbb6b5c=function(_0x3854de){while(--_0x3854de){_0x1c2340['push'](_0x1c2340['shift']());}};_0xbb6b5c(++_0x3f1595);}(_0xa7b5,0x162));var _0x5a7b=function(_0x1f4077,_0x42dab7){_0x1f4077=_0x1f4077-0x0;var _0x404928=_0xa7b5[_0x1f4077];return _0x404928;};'use strict';var Sequelize=require(_0x5a7b('0x0'));module[_0x5a7b('0x1')]={'name':{'type':Sequelize[_0x5a7b('0x2')],'allowNull':![],'unique':_0x5a7b('0x3')},'version':{'type':Sequelize[_0x5a7b('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x5a7b('0x2')],'defaultValue':_0x5a7b('0x4')},'filename':{'type':Sequelize[_0x5a7b('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x5a7b('0x5')]},'active':{'type':Sequelize[_0x5a7b('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x5a7b('0x2')]},'state':{'type':Sequelize[_0x5a7b('0x2')],'unique':_0x5a7b('0x7')},'description':{'type':Sequelize[_0x5a7b('0x2')]},'title':{'type':Sequelize[_0x5a7b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5a7b('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0255=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0xcc23ba,_0x23cdb){var _0x553dfe=function(_0x5184dd){while(--_0x5184dd){_0xcc23ba['push'](_0xcc23ba['shift']());}};_0x553dfe(++_0x23cdb);}(_0x0255,0x110));var _0x5025=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0255[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x5025('0x0'));module[_0x5025('0x1')]={'name':{'type':Sequelize[_0x5025('0x2')],'allowNull':![],'unique':_0x5025('0x3')},'version':{'type':Sequelize[_0x5025('0x2')],'allowNull':![],'unique':_0x5025('0x3')},'main':{'type':Sequelize[_0x5025('0x2')],'defaultValue':_0x5025('0x4')},'filename':{'type':Sequelize[_0x5025('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5025('0x2')]},'size':{'type':Sequelize[_0x5025('0x5')]},'active':{'type':Sequelize[_0x5025('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x5025('0x2')]},'logo':{'type':Sequelize[_0x5025('0x2')]},'state':{'type':Sequelize[_0x5025('0x2')],'unique':_0x5025('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x5025('0x2')]},'remoteUri':{'type':Sequelize[_0x5025('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 cf8e31e..39c780c 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 _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x1bdc42,_0x1b02b6){var _0x31aabc=function(_0x4b33dc){while(--_0x4b33dc){_0x1bdc42['push'](_0x1bdc42['shift']());}};_0x31aabc(++_0x1b02b6);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x47a8c0,_0x4d5931){_0x47a8c0=_0x47a8c0-0x0;var _0x551fa1=_0xfdbd[_0x47a8c0];return _0x551fa1;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));}; \ No newline at end of file +var _0xe2fe=['include','catch','show','find','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','Integration','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['Integration']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['Integration']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5203ce1..2115b8d 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 _0x7b95=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./integration.attributes','exports','define'];(function(_0x38ba48,_0x271563){var _0x5e6d5c=function(_0x736996){while(--_0x736996){_0x38ba48['push'](_0x38ba48['shift']());}};_0x5e6d5c(++_0x271563);}(_0x7b95,0x1a2));var _0x57b9=function(_0x2c8e32,_0x2e8af4){_0x2c8e32=_0x2c8e32-0x0;var _0x2fea44=_0x7b95[_0x2c8e32];return _0x2fea44;};'use strict';var _=require(_0x57b9('0x0'));var util=require(_0x57b9('0x1'));var logger=require(_0x57b9('0x2'))(_0x57b9('0x3'));var moment=require(_0x57b9('0x4'));var BPromise=require(_0x57b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57b9('0x6'));var rimraf=require('rimraf');var config=require(_0x57b9('0x7'));var attributes=require(_0x57b9('0x8'));module[_0x57b9('0x9')]=function(_0x520d45,_0x1b0b1a){return _0x520d45[_0x57b9('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc99=['rimraf','../../config/environment','./integration.attributes','Integration','util'];(function(_0x55bfc3,_0x48fe85){var _0x924549=function(_0x48ca62){while(--_0x48ca62){_0x55bfc3['push'](_0x55bfc3['shift']());}};_0x924549(++_0x48fe85);}(_0xfc99,0xb3));var _0x9fc9=function(_0x5c89e8,_0x20d7d0){_0x5c89e8=_0x5c89e8-0x0;var _0x37d735=_0xfc99[_0x5c89e8];return _0x37d735;};'use strict';var _=require('lodash');var util=require(_0x9fc9('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(_0x9fc9('0x1'));var config=require(_0x9fc9('0x2'));var attributes=require(_0x9fc9('0x3'));module['exports']=function(_0x432e2d,_0x32ee9e){return _0x432e2d['define'](_0x9fc9('0x4'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index b36a12e..5d22ec3 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 _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x1c7cd1,_0x539a09){var _0x2eeb8e=function(_0x3082d2){while(--_0x3082d2){_0x1c7cd1['push'](_0x1c7cd1['shift']());}};_0x2eeb8e(++_0x539a09);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30c1cc,_0x53469a){var _0x3ecd6f=function(_0x39ef2b){while(--_0x39ef2b){_0x30c1cc['push'](_0x30c1cc['shift']());}};_0x3ecd6f(++_0x53469a);}(_0x7880,0x1f4));var _0x0788=function(_0x3d61fe,_0x3d2c36){_0x3d61fe=_0x3d61fe-0x0;var _0x457e37=_0x7880[_0x3d61fe];return _0x457e37;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6282b64..3d04435 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 _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','/:id','create','update','destroy','exports','util'];(function(_0xc67c2b,_0x2f11b5){var _0x35cdd9=function(_0x3854e2){while(--_0x3854e2){_0xc67c2b['push'](_0xc67c2b['shift']());}};_0x35cdd9(++_0x2f11b5);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['show']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xb'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x515d30,_0x40103e){var _0xa0f4e=function(_0x5534df){while(--_0x5534df){_0x515d30['push'](_0x515d30['shift']());}};_0xa0f4e(++_0x40103e);}(_0x7a54,0x106));var _0x47a5=function(_0x334cf4,_0x645b33){_0x334cf4=_0x334cf4-0x0;var _0x1e0553=_0x7a54[_0x334cf4];return _0x1e0553;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9ff4c09..18e777b 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 _0x0d36=['SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x0d36,0x6f));var _0x60d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0d36[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x60d3('0x0'));module[_0x60d3('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x60d3('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x60d3('0x3')]},'contacts':{'type':Sequelize[_0x60d3('0x2')]},'uniqueid':{'type':Sequelize[_0x60d3('0x2')]},'calleridnum':{'type':Sequelize[_0x60d3('0x2')]},'calleridname':{'type':Sequelize[_0x60d3('0x2')]},'queue':{'type':Sequelize[_0x60d3('0x2')]},'interface':{'type':Sequelize[_0x60d3('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x60d3('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x60d3('0x3')]},'agentcomplete':{'type':Sequelize[_0x60d3('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x60d3('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x60d3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x60d3('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x60d3('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x60d3('0x4')]},'agentdump':{'type':Sequelize[_0x60d3('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x60d3('0x4')]},'lastevent':{'type':Sequelize[_0x60d3('0x2')]},'channel':{'type':Sequelize[_0x60d3('0x2')]},'channelstate':{'type':Sequelize[_0x60d3('0x3')]},'channelstatedesc':{'type':Sequelize[_0x60d3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x60d3('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x60d3('0x2')]},'accountcode':{'type':Sequelize[_0x60d3('0x2')]},'context':{'type':Sequelize[_0x60d3('0x2')]},'exten':{'type':Sequelize[_0x60d3('0x2')]},'priority':{'type':Sequelize[_0x60d3('0x2')]},'destchannel':{'type':Sequelize[_0x60d3('0x2')]},'destchannelstate':{'type':Sequelize[_0x60d3('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x60d3('0x2')]},'destcalleridname':{'type':Sequelize[_0x60d3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x60d3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x60d3('0x2')]},'destlanguage':{'type':Sequelize[_0x60d3('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x60d3('0x2')]},'destexten':{'type':Sequelize[_0x60d3('0x2')]},'destpriority':{'type':Sequelize[_0x60d3('0x2')]},'destuniqueid':{'type':Sequelize[_0x60d3('0x2')]},'messageId':{'type':Sequelize[_0x60d3('0x2')]},'inReplyTo':{'type':Sequelize[_0x60d3('0x2')]},'subject':{'type':Sequelize[_0x60d3('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x60d3('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x60d3('0x6')]},'status':{'type':Sequelize[_0x60d3('0x7')](_0x60d3('0x8'),_0x60d3('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x60d3('0x2')]},'app':{'type':Sequelize[_0x60d3('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3568=['DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','STRING','INTEGER'];(function(_0x4c7c5b,_0x4a9df3){var _0x49bf52=function(_0x2e25f3){while(--_0x2e25f3){_0x4c7c5b['push'](_0x4c7c5b['shift']());}};_0x49bf52(++_0x4a9df3);}(_0x3568,0x130));var _0x8356=function(_0x1129a5,_0x46f457){_0x1129a5=_0x1129a5-0x0;var _0x36d20b=_0x3568[_0x1129a5];return _0x36d20b;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x8356('0x0')]},'eventChannel':{'type':Sequelize[_0x8356('0x0')]},'exitStatus':{'type':Sequelize[_0x8356('0x0')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8356('0x1')]},'contacts':{'type':Sequelize[_0x8356('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8356('0x0')]},'calleridname':{'type':Sequelize[_0x8356('0x0')]},'queue':{'type':Sequelize[_0x8356('0x0')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8356('0x0')]},'agentcalledAt':{'type':Sequelize[_0x8356('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x8356('0x1')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8356('0x2')]},'talktime':{'type':Sequelize[_0x8356('0x1')]},'agentacw':{'type':Sequelize[_0x8356('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8356('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x8356('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8356('0x2')]},'agentdump':{'type':Sequelize[_0x8356('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8356('0x2')]},'lastevent':{'type':Sequelize[_0x8356('0x0')]},'channel':{'type':Sequelize[_0x8356('0x0')]},'channelstate':{'type':Sequelize[_0x8356('0x1')]},'channelstatedesc':{'type':Sequelize[_0x8356('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8356('0x0')]},'context':{'type':Sequelize[_0x8356('0x0')]},'exten':{'type':Sequelize[_0x8356('0x0')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8356('0x0')]},'destchannelstate':{'type':Sequelize[_0x8356('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x8356('0x0')]},'destcalleridnum':{'type':Sequelize[_0x8356('0x0')]},'destcalleridname':{'type':Sequelize[_0x8356('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x8356('0x0')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8356('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8356('0x0')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x8356('0x0')]},'to':{'type':Sequelize[_0x8356('0x0')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x8356('0x4')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x8356('0x4')]},'status':{'type':Sequelize['ENUM'](_0x8356('0x5'),_0x8356('0x6'),_0x8356('0x7'),_0x8356('0x8'))},'url':{'type':Sequelize[_0x8356('0x0')]},'app':{'type':Sequelize[_0x8356('0x0')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 69a8c26..6b92982 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 _0x376a=['model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','options','includeAll','include','catch','show','params','keys','find','create','body','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x376a,0x145));var _0xa376=function(_0x27b671,_0x1b91e2){_0x27b671=_0x27b671-0x0;var _0x865f50=_0x376a[_0x27b671];return _0x865f50;};'use strict';var emlformat=require(_0xa376('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa376('0x1'));var rp=require(_0xa376('0x2'));var moment=require('moment');var BPromise=require(_0xa376('0x3'));var Mustache=require(_0xa376('0x4'));var util=require(_0xa376('0x5'));var path=require(_0xa376('0x6'));var sox=require(_0xa376('0x7'));var csv=require('to-csv');var ejs=require(_0xa376('0x8'));var fs=require('fs');var fs_extra=require(_0xa376('0x9'));var _=require(_0xa376('0xa'));var squel=require(_0xa376('0xb'));var crypto=require(_0xa376('0xc'));var jsforce=require(_0xa376('0xd'));var deskjs=require(_0xa376('0xe'));var toCsv=require(_0xa376('0xf'));var querystring=require('querystring');var Papa=require(_0xa376('0x10'));var Redis=require(_0xa376('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa376('0x12'));var as=require(_0xa376('0x13'));var hardwareService=require(_0xa376('0x14'));var logger=require('../../config/logger')(_0xa376('0x15'));var utils=require(_0xa376('0x16'));var config=require(_0xa376('0x17'));var licenseUtil=require(_0xa376('0x18'));var db=require(_0xa376('0x19'))['db'];function respondWithStatusCode(_0x260806,_0x5a5c3c){_0x5a5c3c=_0x5a5c3c||0xcc;return function(_0x569b61){if(_0x569b61){return _0x260806[_0xa376('0x1a')](_0x5a5c3c);}return _0x260806[_0xa376('0x1b')](_0x5a5c3c)[_0xa376('0x1c')]();};}function respondWithResult(_0x3597eb,_0x1c8428){_0x1c8428=_0x1c8428||0xc8;return function(_0x240805){if(_0x240805){return _0x3597eb[_0xa376('0x1b')](_0x1c8428)['json'](_0x240805);}};}function respondWithFilteredResult(_0x4e2a70,_0x5e6a68){return function(_0x4daee2){if(_0x4daee2){var _0x308375=typeof _0x5e6a68['offset']==='undefined'&&typeof _0x5e6a68[_0xa376('0x1d')]===_0xa376('0x1e');var _0x22f799=_0x4daee2[_0xa376('0x1f')];var _0x5128f1=_0x308375?0x0:_0x5e6a68[_0xa376('0x20')];var _0x4bf755=_0x308375?_0x4daee2[_0xa376('0x1f')]:_0x5e6a68['offset']+_0x5e6a68[_0xa376('0x1d')];var _0x55d79a;if(_0x4bf755>=_0x22f799){_0x4bf755=_0x22f799;_0x55d79a=0xc8;}else{_0x55d79a=0xce;}_0x4e2a70[_0xa376('0x1b')](_0x55d79a);return _0x4e2a70[_0xa376('0x21')](_0xa376('0x22'),_0x5128f1+'-'+_0x4bf755+'/'+_0x22f799)[_0xa376('0x23')](_0x4daee2);}return null;};}function patchUpdates(_0x4d1646){return function(_0x2b941e){try{jsonpatch[_0xa376('0x24')](_0x2b941e,_0x4d1646,!![]);}catch(_0xf3fc90){return BPromise[_0xa376('0x25')](_0xf3fc90);}return _0x2b941e[_0xa376('0x26')]();};}function saveUpdates(_0x146d6c,_0x413a7a){return function(_0x3d27a3){if(_0x3d27a3){return _0x3d27a3[_0xa376('0x27')](_0x146d6c)[_0xa376('0x28')](function(_0x4f145e){return _0x4f145e;});}return null;};}function removeEntity(_0x456548,_0x15bf2c){return function(_0x5be5b2){if(_0x5be5b2){return _0x5be5b2[_0xa376('0x29')]()[_0xa376('0x28')](function(){_0x456548['status'](0xcc)[_0xa376('0x1c')]();});}};}function handleEntityNotFound(_0x34cc42,_0x30083c){return function(_0xf3fb0c){if(!_0xf3fb0c){_0x34cc42['sendStatus'](0x194);}return _0xf3fb0c;};}function handleError(_0x2ba347,_0x41b4f1){_0x41b4f1=_0x41b4f1||0x1f4;return function(_0x412b30){logger[_0xa376('0x2a')](_0x412b30[_0xa376('0x2b')]);if(_0x412b30['name']){delete _0x412b30[_0xa376('0x2c')];}_0x2ba347[_0xa376('0x1b')](_0x41b4f1)['send'](_0x412b30);};}exports[_0xa376('0x2d')]=function(_0xefac62,_0x1365f8){var _0x357878={},_0x491e8b={},_0x5e13b3={'count':0x0,'rows':[]};var _0x4a21b3=_[_0xa376('0x2e')](db[_0xa376('0x2f')][_0xa376('0x30')],function(_0x4e6cec){return{'name':_0x4e6cec[_0xa376('0x31')],'type':_0x4e6cec['type']['key']};});_0x491e8b[_0xa376('0x32')]=_[_0xa376('0x2e')](_0x4a21b3,_0xa376('0x2c'));_0x491e8b[_0xa376('0x33')]=_['keys'](_0xefac62[_0xa376('0x33')]);_0x491e8b['filters']=_[_0xa376('0x34')](_0x491e8b[_0xa376('0x32')],_0x491e8b[_0xa376('0x33')]);_0x357878['attributes']=_[_0xa376('0x34')](_0x491e8b[_0xa376('0x32')],qs[_0xa376('0x35')](_0xefac62['query'][_0xa376('0x35')]));_0x357878['attributes']=_0x357878[_0xa376('0x36')][_0xa376('0x37')]?_0x357878[_0xa376('0x36')]:_0x491e8b['model'];if(!_0xefac62[_0xa376('0x33')][_0xa376('0x38')](_0xa376('0x39'))){_0x357878[_0xa376('0x1d')]=qs['limit'](_0xefac62[_0xa376('0x33')][_0xa376('0x1d')]);_0x357878['offset']=qs[_0xa376('0x20')](_0xefac62[_0xa376('0x33')][_0xa376('0x20')]);}_0x357878['order']=qs[_0xa376('0x3a')](_0xefac62[_0xa376('0x33')][_0xa376('0x3a')]);_0x357878[_0xa376('0x3b')]=qs[_0xa376('0x3c')](_['pick'](_0xefac62['query'],_0x491e8b[_0xa376('0x3c')]),_0x4a21b3);if(_0xefac62[_0xa376('0x33')][_0xa376('0x3d')]){_0x357878[_0xa376('0x3b')]=_[_0xa376('0x3e')](_0x357878[_0xa376('0x3b')],{'$or':_[_0xa376('0x2e')](_0x4a21b3,function(_0x56797b){if(_0x56797b[_0xa376('0x3f')]!=='VIRTUAL'){var _0x7abda3={};_0x7abda3[_0x56797b[_0xa376('0x2c')]]={'$like':'%'+_0xefac62[_0xa376('0x33')][_0xa376('0x3d')]+'%'};return _0x7abda3;}})});}_0x357878=_['merge']({},_0x357878,_0xefac62[_0xa376('0x40')]);var _0x691aae={'where':_0x357878['where']};return db['IntegrationReport'][_0xa376('0x1f')](_0x691aae)[_0xa376('0x28')](function(_0x12455b){_0x5e13b3['count']=_0x12455b;if(_0xefac62[_0xa376('0x33')][_0xa376('0x41')]){_0x357878[_0xa376('0x42')]=[{'all':!![]}];}return db[_0xa376('0x2f')]['findAll'](_0x357878);})['then'](function(_0x3846de){_0x5e13b3['rows']=_0x3846de;return _0x5e13b3;})[_0xa376('0x28')](respondWithFilteredResult(_0x1365f8,_0x357878))[_0xa376('0x43')](handleError(_0x1365f8,null));};exports[_0xa376('0x44')]=function(_0x544384,_0x2f2966){var _0x18b59e={'raw':![],'where':{'id':_0x544384[_0xa376('0x45')]['id']}},_0x49fd8e={};_0x49fd8e[_0xa376('0x32')]=_[_0xa376('0x46')](db[_0xa376('0x2f')][_0xa376('0x30')]);_0x49fd8e[_0xa376('0x33')]=_['keys'](_0x544384[_0xa376('0x33')]);_0x49fd8e[_0xa376('0x3c')]=_[_0xa376('0x34')](_0x49fd8e[_0xa376('0x32')],_0x49fd8e[_0xa376('0x33')]);_0x18b59e['attributes']=_[_0xa376('0x34')](_0x49fd8e[_0xa376('0x32')],qs[_0xa376('0x35')](_0x544384['query'][_0xa376('0x35')]));_0x18b59e['attributes']=_0x18b59e[_0xa376('0x36')][_0xa376('0x37')]?_0x18b59e['attributes']:_0x49fd8e[_0xa376('0x32')];if(_0x544384[_0xa376('0x33')][_0xa376('0x41')]){_0x18b59e[_0xa376('0x42')]=[{'all':!![]}];}_0x18b59e=_[_0xa376('0x3e')]({},_0x18b59e,_0x544384[_0xa376('0x40')]);return db[_0xa376('0x2f')][_0xa376('0x47')](_0x18b59e)['then'](handleEntityNotFound(_0x2f2966,null))[_0xa376('0x28')](respondWithResult(_0x2f2966,null))[_0xa376('0x43')](handleError(_0x2f2966,null));};exports[_0xa376('0x48')]=function(_0x4bab58,_0x16808e){return db[_0xa376('0x2f')][_0xa376('0x48')](_0x4bab58[_0xa376('0x49')],{})['then'](respondWithResult(_0x16808e,0xc9))['catch'](handleError(_0x16808e,null));};exports['update']=function(_0x9852b6,_0x15bbde){if(_0x9852b6[_0xa376('0x49')]['id']){delete _0x9852b6[_0xa376('0x49')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x9852b6['params']['id']}})[_0xa376('0x28')](handleEntityNotFound(_0x15bbde,null))[_0xa376('0x28')](saveUpdates(_0x9852b6['body'],null))[_0xa376('0x28')](respondWithResult(_0x15bbde,null))[_0xa376('0x43')](handleError(_0x15bbde,null));};exports['destroy']=function(_0x2d75bf,_0x3e5899){return db[_0xa376('0x2f')][_0xa376('0x47')]({'where':{'id':_0x2d75bf[_0xa376('0x45')]['id']}})[_0xa376('0x28')](handleEntityNotFound(_0x3e5899,null))[_0xa376('0x28')](removeEntity(_0x3e5899,null))[_0xa376('0x43')](handleError(_0x3e5899,null));};exports[_0xa376('0x4a')]=function(_0xe8821,_0xd9fe66){return db['IntegrationReport']['describe']()[_0xa376('0x28')](respondWithResult(_0xd9fe66,null))[_0xa376('0x43')](handleError(_0xd9fe66,null));}; \ No newline at end of file +var _0x03e5=['send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','stack','name'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x03e5,0x143));var _0x503e=function(_0x18dec5,_0x2c8cc8){_0x18dec5=_0x18dec5-0x0;var _0x311d30=_0x03e5[_0x18dec5];return _0x311d30;};'use strict';var emlformat=require(_0x503e('0x0'));var rimraf=require(_0x503e('0x1'));var zipdir=require(_0x503e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x503e('0x3'));var moment=require(_0x503e('0x4'));var BPromise=require(_0x503e('0x5'));var Mustache=require('mustache');var util=require(_0x503e('0x6'));var path=require('path');var sox=require(_0x503e('0x7'));var csv=require(_0x503e('0x8'));var ejs=require(_0x503e('0x9'));var fs=require('fs');var fs_extra=require(_0x503e('0xa'));var _=require(_0x503e('0xb'));var squel=require(_0x503e('0xc'));var crypto=require('crypto');var jsforce=require(_0x503e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x503e('0x8'));var querystring=require('querystring');var Papa=require(_0x503e('0xe'));var Redis=require('ioredis');var authService=require(_0x503e('0xf'));var qs=require(_0x503e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x503e('0x11'));var logger=require('../../config/logger')(_0x503e('0x12'));var utils=require('../../config/utils');var config=require(_0x503e('0x13'));var licenseUtil=require(_0x503e('0x14'));var db=require(_0x503e('0x15'))['db'];function respondWithStatusCode(_0x4ad664,_0x309eb6){_0x309eb6=_0x309eb6||0xcc;return function(_0x27ef2f){if(_0x27ef2f){return _0x4ad664[_0x503e('0x16')](_0x309eb6);}return _0x4ad664['status'](_0x309eb6)[_0x503e('0x17')]();};}function respondWithResult(_0x17570b,_0x54cda1){_0x54cda1=_0x54cda1||0xc8;return function(_0x57ced7){if(_0x57ced7){return _0x17570b[_0x503e('0x18')](_0x54cda1)[_0x503e('0x19')](_0x57ced7);}};}function respondWithFilteredResult(_0xc06cb4,_0x1f1f40){return function(_0x42e747){if(_0x42e747){var _0x200340=typeof _0x1f1f40[_0x503e('0x1a')]===_0x503e('0x1b')&&typeof _0x1f1f40[_0x503e('0x1c')]===_0x503e('0x1b');var _0xc7d7ef=_0x42e747[_0x503e('0x1d')];var _0x59cfcd=_0x200340?0x0:_0x1f1f40['offset'];var _0x32d6f=_0x200340?_0x42e747[_0x503e('0x1d')]:_0x1f1f40[_0x503e('0x1a')]+_0x1f1f40[_0x503e('0x1c')];var _0x5954c7;if(_0x32d6f>=_0xc7d7ef){_0x32d6f=_0xc7d7ef;_0x5954c7=0xc8;}else{_0x5954c7=0xce;}_0xc06cb4['status'](_0x5954c7);return _0xc06cb4[_0x503e('0x1e')](_0x503e('0x1f'),_0x59cfcd+'-'+_0x32d6f+'/'+_0xc7d7ef)[_0x503e('0x19')](_0x42e747);}return null;};}function patchUpdates(_0x20eef4){return function(_0x4626a0){try{jsonpatch[_0x503e('0x20')](_0x4626a0,_0x20eef4,!![]);}catch(_0x482252){return BPromise['reject'](_0x482252);}return _0x4626a0['save']();};}function saveUpdates(_0x999bd8,_0x53a35a){return function(_0x482dfc){if(_0x482dfc){return _0x482dfc['update'](_0x999bd8)['then'](function(_0x5e9668){return _0x5e9668;});}return null;};}function removeEntity(_0x3e394a,_0x4ec2c8){return function(_0x3d1aef){if(_0x3d1aef){return _0x3d1aef[_0x503e('0x21')]()[_0x503e('0x22')](function(){_0x3e394a[_0x503e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d06b2,_0x5064b9){return function(_0x419b0a){if(!_0x419b0a){_0x3d06b2[_0x503e('0x16')](0x194);}return _0x419b0a;};}function handleError(_0x5af3ed,_0xe9fac5){_0xe9fac5=_0xe9fac5||0x1f4;return function(_0x5c943f){logger['error'](_0x5c943f[_0x503e('0x23')]);if(_0x5c943f[_0x503e('0x24')]){delete _0x5c943f['name'];}_0x5af3ed['status'](_0xe9fac5)[_0x503e('0x25')](_0x5c943f);};}exports[_0x503e('0x26')]=function(_0x33e8e6,_0x4af162){var _0xdb967a={},_0x267d25={},_0x91f389={'count':0x0,'rows':[]};var _0x4fd9e1=_['map'](db[_0x503e('0x27')][_0x503e('0x28')],function(_0x1c35db){return{'name':_0x1c35db[_0x503e('0x29')],'type':_0x1c35db[_0x503e('0x2a')][_0x503e('0x2b')]};});_0x267d25[_0x503e('0x2c')]=_[_0x503e('0x2d')](_0x4fd9e1,_0x503e('0x24'));_0x267d25['query']=_[_0x503e('0x2e')](_0x33e8e6[_0x503e('0x2f')]);_0x267d25[_0x503e('0x30')]=_[_0x503e('0x31')](_0x267d25[_0x503e('0x2c')],_0x267d25[_0x503e('0x2f')]);_0xdb967a[_0x503e('0x32')]=_[_0x503e('0x31')](_0x267d25[_0x503e('0x2c')],qs[_0x503e('0x33')](_0x33e8e6[_0x503e('0x2f')]['fields']));_0xdb967a[_0x503e('0x32')]=_0xdb967a[_0x503e('0x32')][_0x503e('0x34')]?_0xdb967a[_0x503e('0x32')]:_0x267d25[_0x503e('0x2c')];if(!_0x33e8e6[_0x503e('0x2f')][_0x503e('0x35')](_0x503e('0x36'))){_0xdb967a['limit']=qs['limit'](_0x33e8e6[_0x503e('0x2f')][_0x503e('0x1c')]);_0xdb967a[_0x503e('0x1a')]=qs['offset'](_0x33e8e6[_0x503e('0x2f')]['offset']);}_0xdb967a['order']=qs[_0x503e('0x37')](_0x33e8e6[_0x503e('0x2f')][_0x503e('0x37')]);_0xdb967a[_0x503e('0x38')]=qs[_0x503e('0x30')](_['pick'](_0x33e8e6[_0x503e('0x2f')],_0x267d25['filters']),_0x4fd9e1);if(_0x33e8e6[_0x503e('0x2f')][_0x503e('0x39')]){_0xdb967a[_0x503e('0x38')]=_[_0x503e('0x3a')](_0xdb967a[_0x503e('0x38')],{'$or':_['map'](_0x4fd9e1,function(_0x44d036){if(_0x44d036[_0x503e('0x2a')]!==_0x503e('0x3b')){var _0x48a247={};_0x48a247[_0x44d036[_0x503e('0x24')]]={'$like':'%'+_0x33e8e6[_0x503e('0x2f')][_0x503e('0x39')]+'%'};return _0x48a247;}})});}_0xdb967a=_[_0x503e('0x3a')]({},_0xdb967a,_0x33e8e6['options']);var _0x8cb2cf={'where':_0xdb967a[_0x503e('0x38')]};return db[_0x503e('0x27')][_0x503e('0x1d')](_0x8cb2cf)['then'](function(_0x44a3ae){_0x91f389[_0x503e('0x1d')]=_0x44a3ae;if(_0x33e8e6[_0x503e('0x2f')]['includeAll']){_0xdb967a[_0x503e('0x3c')]=[{'all':!![]}];}return db[_0x503e('0x27')][_0x503e('0x3d')](_0xdb967a);})[_0x503e('0x22')](function(_0x116a82){_0x91f389[_0x503e('0x3e')]=_0x116a82;return _0x91f389;})[_0x503e('0x22')](respondWithFilteredResult(_0x4af162,_0xdb967a))['catch'](handleError(_0x4af162,null));};exports[_0x503e('0x3f')]=function(_0x2fc098,_0x474fb0){var _0x1c5fa7={'raw':![],'where':{'id':_0x2fc098[_0x503e('0x40')]['id']}},_0x1000db={};_0x1000db[_0x503e('0x2c')]=_[_0x503e('0x2e')](db[_0x503e('0x27')][_0x503e('0x28')]);_0x1000db[_0x503e('0x2f')]=_['keys'](_0x2fc098['query']);_0x1000db[_0x503e('0x30')]=_['intersection'](_0x1000db[_0x503e('0x2c')],_0x1000db[_0x503e('0x2f')]);_0x1c5fa7['attributes']=_[_0x503e('0x31')](_0x1000db[_0x503e('0x2c')],qs[_0x503e('0x33')](_0x2fc098[_0x503e('0x2f')]['fields']));_0x1c5fa7['attributes']=_0x1c5fa7[_0x503e('0x32')]['length']?_0x1c5fa7[_0x503e('0x32')]:_0x1000db[_0x503e('0x2c')];if(_0x2fc098['query'][_0x503e('0x41')]){_0x1c5fa7[_0x503e('0x3c')]=[{'all':!![]}];}_0x1c5fa7=_[_0x503e('0x3a')]({},_0x1c5fa7,_0x2fc098['options']);return db[_0x503e('0x27')][_0x503e('0x42')](_0x1c5fa7)[_0x503e('0x22')](handleEntityNotFound(_0x474fb0,null))['then'](respondWithResult(_0x474fb0,null))[_0x503e('0x43')](handleError(_0x474fb0,null));};exports['create']=function(_0x310cc0,_0x157ad6){return db['IntegrationReport'][_0x503e('0x44')](_0x310cc0['body'],{})['then'](respondWithResult(_0x157ad6,0xc9))[_0x503e('0x43')](handleError(_0x157ad6,null));};exports[_0x503e('0x45')]=function(_0x3109ea,_0x5466b2){if(_0x3109ea[_0x503e('0x46')]['id']){delete _0x3109ea[_0x503e('0x46')]['id'];}return db[_0x503e('0x27')]['find']({'where':{'id':_0x3109ea[_0x503e('0x40')]['id']}})['then'](handleEntityNotFound(_0x5466b2,null))[_0x503e('0x22')](saveUpdates(_0x3109ea[_0x503e('0x46')],null))[_0x503e('0x22')](respondWithResult(_0x5466b2,null))['catch'](handleError(_0x5466b2,null));};exports[_0x503e('0x21')]=function(_0x330b5e,_0x320446){return db['IntegrationReport'][_0x503e('0x42')]({'where':{'id':_0x330b5e[_0x503e('0x40')]['id']}})[_0x503e('0x22')](handleEntityNotFound(_0x320446,null))['then'](removeEntity(_0x320446,null))[_0x503e('0x43')](handleError(_0x320446,null));};exports[_0x503e('0x47')]=function(_0x331ea8,_0x4babd3){return db[_0x503e('0x27')]['describe']()[_0x503e('0x22')](respondWithResult(_0x4babd3,null))[_0x503e('0x43')](handleError(_0x4babd3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 80e3a51..bcd07f8 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 _0x2bb8=['rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util','moment','bluebird','request-promise','path'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x2bb8,0x74));var _0x82bb=function(_0x43ff77,_0x13f967){_0x43ff77=_0x43ff77-0x0;var _0x28b924=_0x2bb8[_0x43ff77];return _0x28b924;};'use strict';var _=require('lodash');var util=require(_0x82bb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x82bb('0x1'));var BPromise=require(_0x82bb('0x2'));var rp=require(_0x82bb('0x3'));var fs=require('fs');var path=require(_0x82bb('0x4'));var rimraf=require(_0x82bb('0x5'));var config=require(_0x82bb('0x6'));var attributes=require(_0x82bb('0x7'));module[_0x82bb('0x8')]=function(_0x1348c7,_0x3f7bf7){return _0x1348c7['define'](_0x82bb('0x9'),attributes,{'tableName':_0x82bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedaa=['path','rimraf','../../config/environment','exports','define','report_integration','lodash','../../config/logger','api','bluebird'];(function(_0x2b384d,_0x322d86){var _0x44f682=function(_0x5f2507){while(--_0x5f2507){_0x2b384d['push'](_0x2b384d['shift']());}};_0x44f682(++_0x322d86);}(_0xedaa,0x92));var _0xaeda=function(_0x372b66,_0x5718b7){_0x372b66=_0x372b66-0x0;var _0x4ce5e2=_0xedaa[_0x372b66];return _0x4ce5e2;};'use strict';var _=require(_0xaeda('0x0'));var util=require('util');var logger=require(_0xaeda('0x1'))(_0xaeda('0x2'));var moment=require('moment');var BPromise=require(_0xaeda('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaeda('0x4'));var rimraf=require(_0xaeda('0x5'));var config=require(_0xaeda('0x6'));var attributes=require('./integrationReport.attributes');module[_0xaeda('0x7')]=function(_0xe56ed4,_0x3f7987){return _0xe56ed4[_0xaeda('0x8')]('IntegrationReport',attributes,{'tableName':_0xaeda('0x9'),'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 72a6158..71891b2 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc2c7,0x134));var _0x7c2c=function(_0x33698a,_0x5ae038){_0x33698a=_0x33698a-0x0;var _0x1512ff=_0xc2c7[_0x33698a];return _0x1512ff;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','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','randomstring','../../config/logger','rpc'];(function(_0x1e5b74,_0x243fc2){var _0x4f9f2f=function(_0x16f407){while(--_0x16f407){_0x1e5b74['push'](_0x1e5b74['shift']());}};_0x4f9f2f(++_0x243fc2);}(_0xba34,0x119));var _0x4ba3=function(_0x11dcbe,_0x5da6df){_0x11dcbe=_0x11dcbe-0x0;var _0xe7aa46=_0xba34[_0x11dcbe];return _0xe7aa46;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0631153..a0a781a 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 _0x88c6=['../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','multer','util','path','connect-timeout','fs-extra'];(function(_0x5c9db1,_0x434d22){var _0x466487=function(_0x5212ad){while(--_0x5212ad){_0x5c9db1['push'](_0x5c9db1['shift']());}};_0x466487(++_0x434d22);}(_0x88c6,0x163));var _0x688c=function(_0x32060c,_0x391258){_0x32060c=_0x32060c-0x0;var _0x360b95=_0x88c6[_0x32060c];return _0x360b95;};'use strict';var multer=require(_0x688c('0x0'));var util=require(_0x688c('0x1'));var path=require(_0x688c('0x2'));var timeout=require(_0x688c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x688c('0x4'));var auth=require(_0x688c('0x5'));var interaction=require(_0x688c('0x6'));var config=require('../../config/environment');var controller=require(_0x688c('0x7'));router[_0x688c('0x8')]('/',auth[_0x688c('0x9')](),controller[_0x688c('0xa')]);router[_0x688c('0x8')](_0x688c('0xb'),auth['isAuthenticated'](),controller[_0x688c('0xc')]);router[_0x688c('0x8')](_0x688c('0xd'),auth['isAuthenticated'](),controller[_0x688c('0xe')]);router[_0x688c('0xf')]('/',auth[_0x688c('0x9')](),controller['create']);router[_0x688c('0xf')](_0x688c('0xd'),auth['isAuthenticated'](),controller[_0x688c('0x10')]);router[_0x688c('0xf')]('/:id/sub_intervals/create_many',auth[_0x688c('0x9')](),controller[_0x688c('0x11')]);router[_0x688c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x688c('0x13')]);router['delete']('/:id',auth[_0x688c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3471=['isAuthenticated','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','/:id'];(function(_0x5b8d1f,_0xd391d4){var _0x25e6be=function(_0x1f9ba5){while(--_0x1f9ba5){_0x5b8d1f['push'](_0x5b8d1f['shift']());}};_0x25e6be(++_0xd391d4);}(_0x3471,0x106));var _0x1347=function(_0x12dcc2,_0x5ad97a){_0x12dcc2=_0x12dcc2-0x0;var _0x114c83=_0x3471[_0x12dcc2];return _0x114c83;};'use strict';var multer=require(_0x1347('0x0'));var util=require('util');var path=require(_0x1347('0x1'));var timeout=require(_0x1347('0x2'));var express=require(_0x1347('0x3'));var router=express[_0x1347('0x4')]();var fs_extra=require(_0x1347('0x5'));var auth=require(_0x1347('0x6'));var interaction=require(_0x1347('0x7'));var config=require('../../config/environment');var controller=require(_0x1347('0x8'));router[_0x1347('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1347('0x9')](_0x1347('0xa'),auth[_0x1347('0xb')](),controller[_0x1347('0xc')]);router[_0x1347('0x9')](_0x1347('0xd'),auth[_0x1347('0xb')](),controller[_0x1347('0xe')]);router['post']('/',auth[_0x1347('0xb')](),controller[_0x1347('0xf')]);router[_0x1347('0x10')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1347('0x11')]);router[_0x1347('0x10')](_0x1347('0x12'),auth[_0x1347('0xb')](),controller[_0x1347('0x13')]);router['put'](_0x1347('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1347('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9075d39..42ece89 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 _0xace0=['sequelize','STRING'];(function(_0x9fb1b,_0x360b47){var _0x1a62fc=function(_0x58d16d){while(--_0x58d16d){_0x9fb1b['push'](_0x9fb1b['shift']());}};_0x1a62fc(++_0x360b47);}(_0xace0,0x7e));var _0x0ace=function(_0x389213,_0x14a50d){_0x389213=_0x389213-0x0;var _0x4ad6ca=_0xace0[_0x389213];return _0x4ad6ca;};'use strict';var Sequelize=require(_0x0ace('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ace('0x1')]},'description':{'type':Sequelize[_0x0ace('0x1')]},'interval':{'type':Sequelize[_0x0ace('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x5ed2=['exports','STRING','sequelize'];(function(_0x52a5dc,_0x5532f9){var _0x22418a=function(_0x5e9f37){while(--_0x5e9f37){_0x52a5dc['push'](_0x52a5dc['shift']());}};_0x22418a(++_0x5532f9);}(_0x5ed2,0x6e));var _0x25ed=function(_0x4fadb8,_0x11b539){_0x4fadb8=_0x4fadb8-0x0;var _0x3c9e20=_0x5ed2[_0x4fadb8];return _0x3c9e20;};'use strict';var Sequelize=require(_0x25ed('0x0'));module[_0x25ed('0x1')]={'name':{'type':Sequelize[_0x25ed('0x2')]},'description':{'type':Sequelize[_0x25ed('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4bd0ed4..e73cc62 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 _0x7e5e=['type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','pick','filter','options','nolimit','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','then','get','Intervals','destroy','end','error','stack','name','send','index','map','Interval','rawAttributes','fieldName'];(function(_0x3a9e56,_0x364c34){var _0x187523=function(_0x480862){while(--_0x480862){_0x3a9e56['push'](_0x3a9e56['shift']());}};_0x187523(++_0x364c34);}(_0x7e5e,0xe0));var _0xe7e5=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x7e5e[_0x3eb630];return _0x1b840d;};'use strict';var emlformat=require(_0xe7e5('0x0'));var rimraf=require(_0xe7e5('0x1'));var zipdir=require(_0xe7e5('0x2'));var jsonpatch=require(_0xe7e5('0x3'));var rp=require(_0xe7e5('0x4'));var moment=require(_0xe7e5('0x5'));var BPromise=require(_0xe7e5('0x6'));var Mustache=require(_0xe7e5('0x7'));var util=require(_0xe7e5('0x8'));var path=require('path');var sox=require(_0xe7e5('0x9'));var csv=require('to-csv');var ejs=require(_0xe7e5('0xa'));var fs=require('fs');var fs_extra=require(_0xe7e5('0xb'));var _=require(_0xe7e5('0xc'));var squel=require(_0xe7e5('0xd'));var crypto=require(_0xe7e5('0xe'));var jsforce=require(_0xe7e5('0xf'));var deskjs=require(_0xe7e5('0x10'));var toCsv=require(_0xe7e5('0x11'));var querystring=require(_0xe7e5('0x12'));var Papa=require(_0xe7e5('0x13'));var Redis=require(_0xe7e5('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe7e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7e5('0x16'));var logger=require(_0xe7e5('0x17'))(_0xe7e5('0x18'));var utils=require(_0xe7e5('0x19'));var config=require(_0xe7e5('0x1a'));var licenseUtil=require(_0xe7e5('0x1b'));var db=require('../../mysqldb')['db'];var extensions=require(_0xe7e5('0x1c'));function respondWithStatusCode(_0x54a7df,_0x45e068){_0x45e068=_0x45e068||0xcc;return function(_0x5d927c){if(_0x5d927c){return _0x54a7df[_0xe7e5('0x1d')](_0x45e068);}return _0x54a7df[_0xe7e5('0x1e')](_0x45e068)['end']();};}function respondWithResult(_0x3ba5c0,_0x254814){_0x254814=_0x254814||0xc8;return function(_0x187546){if(_0x187546){return _0x3ba5c0[_0xe7e5('0x1e')](_0x254814)['json'](_0x187546);}};}function respondWithFilteredResult(_0x37a798,_0x411636){return function(_0x283bcf){if(_0x283bcf){var _0x5d98a1=typeof _0x411636[_0xe7e5('0x1f')]===_0xe7e5('0x20')&&typeof _0x411636[_0xe7e5('0x21')]===_0xe7e5('0x20');var _0x48345a=_0x283bcf[_0xe7e5('0x22')];var _0x193d1e=_0x5d98a1?0x0:_0x411636['offset'];var _0x225bc0=_0x5d98a1?_0x283bcf[_0xe7e5('0x22')]:_0x411636['offset']+_0x411636['limit'];var _0x54674c;if(_0x225bc0>=_0x48345a){_0x225bc0=_0x48345a;_0x54674c=0xc8;}else{_0x54674c=0xce;}_0x37a798['status'](_0x54674c);return _0x37a798[_0xe7e5('0x23')](_0xe7e5('0x24'),_0x193d1e+'-'+_0x225bc0+'/'+_0x48345a)['json'](_0x283bcf);}return null;};}function patchUpdates(_0x1baeba){return function(_0x3d2da0){try{jsonpatch['apply'](_0x3d2da0,_0x1baeba,!![]);}catch(_0x20a08b){return BPromise['reject'](_0x20a08b);}return _0x3d2da0[_0xe7e5('0x25')]();};}function saveUpdates(_0x497a37,_0x5160ad){return function(_0x3eab7a){if(_0x3eab7a){return _0x3eab7a['update'](_0x497a37)[_0xe7e5('0x26')](function(_0x860e62){return _0x860e62;});}return null;};}function removeEntity(_0x1535a3,_0x431cd5){return function(_0x2a78a6){if(_0x2a78a6){return _0x2a78a6['destroy']()[_0xe7e5('0x26')](function(){var _0x59fd70=_0x2a78a6[_0xe7e5('0x27')]({'plain':!![]});var _0x10d5b4=_0xe7e5('0x28');return db['UserProfileResource'][_0xe7e5('0x29')]({'where':{'type':_0x10d5b4,'resourceId':_0x59fd70['id']}})['then'](function(){return _0x2a78a6;});})['then'](function(){_0x1535a3[_0xe7e5('0x1e')](0xcc)[_0xe7e5('0x2a')]();});}};}function handleEntityNotFound(_0x35bccb,_0x3e1bba){return function(_0x136be3){if(!_0x136be3){_0x35bccb['sendStatus'](0x194);}return _0x136be3;};}function handleError(_0x5b025e,_0xdd0ad1){_0xdd0ad1=_0xdd0ad1||0x1f4;return function(_0x1bb9dc){logger[_0xe7e5('0x2b')](_0x1bb9dc[_0xe7e5('0x2c')]);if(_0x1bb9dc[_0xe7e5('0x2d')]){delete _0x1bb9dc['name'];}_0x5b025e['status'](_0xdd0ad1)[_0xe7e5('0x2e')](_0x1bb9dc);};}exports[_0xe7e5('0x2f')]=function(_0x515136,_0x5b9dd2){var _0x26bd7b={},_0x211e5f={},_0x4d985c={'count':0x0,'rows':[]};var _0x1dca0b=_[_0xe7e5('0x30')](db[_0xe7e5('0x31')][_0xe7e5('0x32')],function(_0x5d869f){return{'name':_0x5d869f[_0xe7e5('0x33')],'type':_0x5d869f[_0xe7e5('0x34')][_0xe7e5('0x35')]};});_0x211e5f[_0xe7e5('0x36')]=_[_0xe7e5('0x30')](_0x1dca0b,_0xe7e5('0x2d'));_0x211e5f[_0xe7e5('0x37')]=_[_0xe7e5('0x38')](_0x515136[_0xe7e5('0x37')]);_0x211e5f[_0xe7e5('0x39')]=_[_0xe7e5('0x3a')](_0x211e5f[_0xe7e5('0x36')],_0x211e5f[_0xe7e5('0x37')]);_0x26bd7b['attributes']=_['intersection'](_0x211e5f[_0xe7e5('0x36')],qs[_0xe7e5('0x3b')](_0x515136[_0xe7e5('0x37')][_0xe7e5('0x3b')]));_0x26bd7b[_0xe7e5('0x3c')]=_0x26bd7b[_0xe7e5('0x3c')][_0xe7e5('0x3d')]?_0x26bd7b[_0xe7e5('0x3c')]:_0x211e5f[_0xe7e5('0x36')];if(!_0x515136[_0xe7e5('0x37')]['hasOwnProperty']('nolimit')){_0x26bd7b[_0xe7e5('0x21')]=qs[_0xe7e5('0x21')](_0x515136['query'][_0xe7e5('0x21')]);_0x26bd7b[_0xe7e5('0x1f')]=qs[_0xe7e5('0x1f')](_0x515136[_0xe7e5('0x37')][_0xe7e5('0x1f')]);}_0x26bd7b[_0xe7e5('0x3e')]=qs[_0xe7e5('0x3f')](_0x515136[_0xe7e5('0x37')][_0xe7e5('0x3f')]);_0x26bd7b[_0xe7e5('0x40')]=qs[_0xe7e5('0x39')](_['pick'](_0x515136['query'],_0x211e5f['filters']),_0x1dca0b);if(_0x515136['query']['filter']){_0x26bd7b['where']=_['merge'](_0x26bd7b['where'],{'$or':_[_0xe7e5('0x30')](_0x1dca0b,function(_0x2f583e){if(_0x2f583e[_0xe7e5('0x34')]!==_0xe7e5('0x41')){var _0x33caf1={};_0x33caf1[_0x2f583e[_0xe7e5('0x2d')]]={'$like':'%'+_0x515136[_0xe7e5('0x37')]['filter']+'%'};return _0x33caf1;}})});}_0x26bd7b=_[_0xe7e5('0x42')]({},_0x26bd7b,_0x515136['options']);var _0x2f3a0d={'where':_0x26bd7b[_0xe7e5('0x40')]};return db[_0xe7e5('0x31')][_0xe7e5('0x22')](_0x2f3a0d)[_0xe7e5('0x26')](function(_0x25d81d){_0x4d985c[_0xe7e5('0x22')]=_0x25d81d;if(_0x515136['query'][_0xe7e5('0x43')]){_0x26bd7b[_0xe7e5('0x44')]=[{'all':!![]}];}return db[_0xe7e5('0x31')][_0xe7e5('0x45')](_0x26bd7b);})[_0xe7e5('0x26')](function(_0x56972f){_0x4d985c['rows']=_0x56972f;return _0x4d985c;})[_0xe7e5('0x26')](respondWithFilteredResult(_0x5b9dd2,_0x26bd7b))[_0xe7e5('0x46')](handleError(_0x5b9dd2,null));};exports['show']=function(_0x5e424d,_0x5e2f70){var _0x317823={'raw':!![],'where':{'id':_0x5e424d[_0xe7e5('0x47')]['id']}},_0x1815e9={};_0x1815e9[_0xe7e5('0x36')]=_[_0xe7e5('0x38')](db[_0xe7e5('0x31')]['rawAttributes']);_0x1815e9[_0xe7e5('0x37')]=_[_0xe7e5('0x38')](_0x5e424d[_0xe7e5('0x37')]);_0x1815e9[_0xe7e5('0x39')]=_[_0xe7e5('0x3a')](_0x1815e9['model'],_0x1815e9[_0xe7e5('0x37')]);_0x317823[_0xe7e5('0x3c')]=_[_0xe7e5('0x3a')](_0x1815e9['model'],qs[_0xe7e5('0x3b')](_0x5e424d['query'][_0xe7e5('0x3b')]));_0x317823[_0xe7e5('0x3c')]=_0x317823[_0xe7e5('0x3c')][_0xe7e5('0x3d')]?_0x317823[_0xe7e5('0x3c')]:_0x1815e9[_0xe7e5('0x36')];if(_0x5e424d[_0xe7e5('0x37')][_0xe7e5('0x43')]){_0x317823[_0xe7e5('0x44')]=[{'all':!![]}];}_0x317823=_['merge']({},_0x317823,_0x5e424d['options']);return db[_0xe7e5('0x31')][_0xe7e5('0x48')](_0x317823)[_0xe7e5('0x26')](handleEntityNotFound(_0x5e2f70,null))[_0xe7e5('0x26')](respondWithResult(_0x5e2f70,null))['catch'](handleError(_0x5e2f70,null));};exports[_0xe7e5('0x49')]=function(_0x21535a,_0x8859b0){return db[_0xe7e5('0x31')][_0xe7e5('0x49')](_0x21535a[_0xe7e5('0x4a')],{})[_0xe7e5('0x26')](function(_0xba197e){var _0x21c681=_0x21535a[_0xe7e5('0x4b')][_0xe7e5('0x27')]({'plain':!![]});if(!_0x21c681)throw new Error(_0xe7e5('0x4c'));if(_0x21c681[_0xe7e5('0x4d')]===_0xe7e5('0x4b')){var _0x36cd68=_0xba197e[_0xe7e5('0x27')]({'plain':!![]});var _0x1f3082=_0xe7e5('0x28');return db[_0xe7e5('0x4e')]['find']({'where':{'name':_0x1f3082,'userProfileId':_0x21c681['userProfileId']},'raw':!![]})['then'](function(_0x325763){if(_0x325763&&_0x325763['autoAssociation']===0x0){return db[_0xe7e5('0x4f')][_0xe7e5('0x49')]({'name':_0x36cd68[_0xe7e5('0x2d')],'resourceId':_0x36cd68['id'],'type':_0x325763[_0xe7e5('0x2d')],'sectionId':_0x325763['id']},{})['then'](function(){return _0xba197e;});}else{return _0xba197e;}})['catch'](function(_0x627fe6){logger['error'](_0xe7e5('0x50'),_0x627fe6);throw _0x627fe6;});}return _0xba197e;})[_0xe7e5('0x26')](respondWithResult(_0x8859b0,0xc9))[_0xe7e5('0x46')](handleError(_0x8859b0,null));};exports[_0xe7e5('0x51')]=function(_0x1c98ac,_0x7ffd83){if(_0x1c98ac[_0xe7e5('0x4a')]['id']){delete _0x1c98ac[_0xe7e5('0x4a')]['id'];}return db['Interval']['find']({'where':{'id':_0x1c98ac[_0xe7e5('0x47')]['id']}})[_0xe7e5('0x26')](handleEntityNotFound(_0x7ffd83,null))['then'](saveUpdates(_0x1c98ac[_0xe7e5('0x4a')],null))[_0xe7e5('0x26')](respondWithResult(_0x7ffd83,null))[_0xe7e5('0x46')](handleError(_0x7ffd83,null));};exports[_0xe7e5('0x29')]=function(_0x288869,_0x37bdfe){return db['Interval']['find']({'where':{'id':_0x288869['params']['id']}})[_0xe7e5('0x26')](handleEntityNotFound(_0x37bdfe,null))[_0xe7e5('0x26')](removeEntity(_0x37bdfe,null))[_0xe7e5('0x46')](handleError(_0x37bdfe,null));};exports[_0xe7e5('0x52')]=function(_0x1d1852,_0x5f0a10,_0x3fdab1){if(_0x1d1852[_0xe7e5('0x4a')]['id']){delete _0x1d1852[_0xe7e5('0x4a')]['id'];}return db['Interval'][_0xe7e5('0x48')]({'where':{'id':_0x1d1852[_0xe7e5('0x47')]['id']}})[_0xe7e5('0x26')](handleEntityNotFound(_0x5f0a10,null))[_0xe7e5('0x26')](function(_0x24d85a){if(_0x24d85a){_0x1d1852[_0xe7e5('0x4a')][_0xe7e5('0x53')]=_0x24d85a['id'];return db['Interval'][_0xe7e5('0x49')](_0x1d1852[_0xe7e5('0x4a')]);}})[_0xe7e5('0x26')](respondWithResult(_0x5f0a10,null))[_0xe7e5('0x46')](handleError(_0x5f0a10,null));};exports[_0xe7e5('0x54')]=function(_0x3eaab0,_0x3ccfb4,_0x36542f){var _0x108ce1={};var _0x497d8c={};var _0x43ce43;var _0x4a6231;return db['Interval']['findOne']({'where':{'id':_0x3eaab0[_0xe7e5('0x47')]['id']}})[_0xe7e5('0x26')](handleEntityNotFound(_0x3ccfb4,null))[_0xe7e5('0x26')](function(_0x47ba4d){if(_0x47ba4d){_0x43ce43=_0x47ba4d;_0x497d8c[_0xe7e5('0x36')]=_['keys'](db['Interval'][_0xe7e5('0x32')]);_0x497d8c['query']=_[_0xe7e5('0x38')](_0x3eaab0['query']);_0x497d8c[_0xe7e5('0x39')]=_['intersection'](_0x497d8c[_0xe7e5('0x36')],_0x497d8c['query']);_0x108ce1[_0xe7e5('0x3c')]=_[_0xe7e5('0x3a')](_0x497d8c[_0xe7e5('0x36')],qs[_0xe7e5('0x3b')](_0x3eaab0['query']['fields']));_0x108ce1[_0xe7e5('0x3c')]=_0x108ce1[_0xe7e5('0x3c')][_0xe7e5('0x3d')]?_0x108ce1[_0xe7e5('0x3c')]:_0x497d8c[_0xe7e5('0x36')];_0x108ce1[_0xe7e5('0x3e')]=qs[_0xe7e5('0x3f')](_0x3eaab0['query'][_0xe7e5('0x3f')]);_0x108ce1[_0xe7e5('0x40')]=qs[_0xe7e5('0x39')](_[_0xe7e5('0x55')](_0x3eaab0['query'],_0x497d8c[_0xe7e5('0x39')]));if(_0x3eaab0[_0xe7e5('0x37')]['filter']){_0x108ce1[_0xe7e5('0x40')]=_[_0xe7e5('0x42')](_0x108ce1['where'],{'$or':_[_0xe7e5('0x30')](_0x108ce1[_0xe7e5('0x3c')],function(_0x36924f){var _0x595bd5={};_0x595bd5[_0x36924f]={'$like':'%'+_0x3eaab0['query'][_0xe7e5('0x56')]+'%'};return _0x595bd5;})});}_0x108ce1=_[_0xe7e5('0x42')]({},_0x108ce1,_0x3eaab0[_0xe7e5('0x57')]);return _0x43ce43[_0xe7e5('0x54')](_0x108ce1);}})[_0xe7e5('0x26')](function(_0x166a66){if(_0x166a66){_0x4a6231=_0x166a66[_0xe7e5('0x3d')];if(!_0x3eaab0[_0xe7e5('0x37')]['hasOwnProperty'](_0xe7e5('0x58'))){_0x108ce1[_0xe7e5('0x21')]=qs[_0xe7e5('0x21')](_0x3eaab0[_0xe7e5('0x37')][_0xe7e5('0x21')]);_0x108ce1[_0xe7e5('0x1f')]=qs[_0xe7e5('0x1f')](_0x3eaab0[_0xe7e5('0x37')][_0xe7e5('0x1f')]);}return _0x43ce43[_0xe7e5('0x54')](_0x108ce1);}})[_0xe7e5('0x26')](function(_0x27362b){if(_0x27362b){return _0x27362b?{'count':_0x4a6231,'rows':_0x27362b}:null;}})[_0xe7e5('0x26')](respondWithResult(_0x3ccfb4,null))['catch'](handleError(_0x3ccfb4,null));};exports['addIntervals']=function(_0x4a4dcd,_0x2f3eda,_0x1e06eb){return db[_0xe7e5('0x31')]['findOne']({'where':{'id':_0x4a4dcd['params']['id']}})['then'](handleEntityNotFound(_0x2f3eda,null))[_0xe7e5('0x26')](function(_0x3d8f06){if(_0x3d8f06){return db[_0xe7e5('0x59')][_0xe7e5('0x5a')](function(_0x21d058){return db[_0xe7e5('0x31')][_0xe7e5('0x29')]({'where':{'IntervalId':_0x4a4dcd[_0xe7e5('0x47')]['id']},'transaction':_0x21d058})[_0xe7e5('0x26')](function(_0x4e9c97){var _0x279e64=_[_0xe7e5('0x30')](_0x4a4dcd['body'],function(_0x255aea){delete _0x255aea['id'];_0x255aea[_0xe7e5('0x53')]=_0x4a4dcd[_0xe7e5('0x47')]['id'];return _0x255aea;});return db[_0xe7e5('0x31')][_0xe7e5('0x5b')](_0x279e64,{'transaction':_0x21d058});});})[_0xe7e5('0x26')](function(){return db[_0xe7e5('0x31')][_0xe7e5('0x45')]({'where':{'IntervalId':_0x4a4dcd[_0xe7e5('0x47')]['id']}});});}})[_0xe7e5('0x26')](respondWithResult(_0x2f3eda,null))[_0xe7e5('0x46')](handleError(_0x2f3eda,null));}; \ No newline at end of file +var _0xd229=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','Interval','rawAttributes','fieldName','key','map','query','keys','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create'];(function(_0x1ad788,_0x153377){var _0x137bcc=function(_0x5d33d6){while(--_0x5d33d6){_0x1ad788['push'](_0x1ad788['shift']());}};_0x137bcc(++_0x153377);}(_0xd229,0x11e));var _0x9d22=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xd229[_0x2b0bc2];return _0x56e5b9;};'use strict';var emlformat=require(_0x9d22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d22('0x1'));var jsonpatch=require(_0x9d22('0x2'));var rp=require(_0x9d22('0x3'));var moment=require(_0x9d22('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9d22('0x5'));var sox=require(_0x9d22('0x6'));var csv=require('to-csv');var ejs=require(_0x9d22('0x7'));var fs=require('fs');var fs_extra=require(_0x9d22('0x8'));var _=require(_0x9d22('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d22('0xa'));var deskjs=require(_0x9d22('0xb'));var toCsv=require(_0x9d22('0xc'));var querystring=require(_0x9d22('0xd'));var Papa=require(_0x9d22('0xe'));var Redis=require('ioredis');var authService=require(_0x9d22('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9d22('0x10'));var hardwareService=require(_0x9d22('0x11'));var logger=require('../../config/logger')(_0x9d22('0x12'));var utils=require(_0x9d22('0x13'));var config=require(_0x9d22('0x14'));var licenseUtil=require(_0x9d22('0x15'));var db=require(_0x9d22('0x16'))['db'];var extensions=require(_0x9d22('0x17'));function respondWithStatusCode(_0x187299,_0x3980a7){_0x3980a7=_0x3980a7||0xcc;return function(_0x33ba4c){if(_0x33ba4c){return _0x187299[_0x9d22('0x18')](_0x3980a7);}return _0x187299['status'](_0x3980a7)[_0x9d22('0x19')]();};}function respondWithResult(_0x4ef0ee,_0x5f027e){_0x5f027e=_0x5f027e||0xc8;return function(_0x1cfbd3){if(_0x1cfbd3){return _0x4ef0ee[_0x9d22('0x1a')](_0x5f027e)[_0x9d22('0x1b')](_0x1cfbd3);}};}function respondWithFilteredResult(_0x23d308,_0x1abf6d){return function(_0x4d8201){if(_0x4d8201){var _0x409a60=typeof _0x1abf6d[_0x9d22('0x1c')]==='undefined'&&typeof _0x1abf6d['limit']===_0x9d22('0x1d');var _0x3d5488=_0x4d8201['count'];var _0x1b57b6=_0x409a60?0x0:_0x1abf6d[_0x9d22('0x1c')];var _0x2f6d3d=_0x409a60?_0x4d8201[_0x9d22('0x1e')]:_0x1abf6d[_0x9d22('0x1c')]+_0x1abf6d[_0x9d22('0x1f')];var _0x52378d;if(_0x2f6d3d>=_0x3d5488){_0x2f6d3d=_0x3d5488;_0x52378d=0xc8;}else{_0x52378d=0xce;}_0x23d308[_0x9d22('0x1a')](_0x52378d);return _0x23d308[_0x9d22('0x20')](_0x9d22('0x21'),_0x1b57b6+'-'+_0x2f6d3d+'/'+_0x3d5488)[_0x9d22('0x1b')](_0x4d8201);}return null;};}function patchUpdates(_0x8625a0){return function(_0x26eb9c){try{jsonpatch[_0x9d22('0x22')](_0x26eb9c,_0x8625a0,!![]);}catch(_0x21f6c1){return BPromise[_0x9d22('0x23')](_0x21f6c1);}return _0x26eb9c[_0x9d22('0x24')]();};}function saveUpdates(_0xb19ea1,_0x343d5a){return function(_0x16065e){if(_0x16065e){return _0x16065e[_0x9d22('0x25')](_0xb19ea1)['then'](function(_0x1ff14a){return _0x1ff14a;});}return null;};}function removeEntity(_0x631573,_0x566d55){return function(_0x5be853){if(_0x5be853){return _0x5be853[_0x9d22('0x26')]()[_0x9d22('0x27')](function(){var _0xffb76c=_0x5be853[_0x9d22('0x28')]({'plain':!![]});var _0x2fdb7c='Intervals';return db[_0x9d22('0x29')][_0x9d22('0x26')]({'where':{'type':_0x2fdb7c,'resourceId':_0xffb76c['id']}})[_0x9d22('0x27')](function(){return _0x5be853;});})[_0x9d22('0x27')](function(){_0x631573[_0x9d22('0x1a')](0xcc)[_0x9d22('0x19')]();});}};}function handleEntityNotFound(_0xb737a2,_0x1a5761){return function(_0x5d1ee3){if(!_0x5d1ee3){_0xb737a2[_0x9d22('0x18')](0x194);}return _0x5d1ee3;};}function handleError(_0x33bac6,_0x2509b5){_0x2509b5=_0x2509b5||0x1f4;return function(_0x21ee30){logger[_0x9d22('0x2a')](_0x21ee30[_0x9d22('0x2b')]);if(_0x21ee30['name']){delete _0x21ee30[_0x9d22('0x2c')];}_0x33bac6[_0x9d22('0x1a')](_0x2509b5)['send'](_0x21ee30);};}exports[_0x9d22('0x2d')]=function(_0x17c66f,_0x1408f2){var _0x3e52ec={},_0x4fd230={},_0x1d5106={'count':0x0,'rows':[]};var _0x462a14=_['map'](db[_0x9d22('0x2e')][_0x9d22('0x2f')],function(_0x49c20d){return{'name':_0x49c20d[_0x9d22('0x30')],'type':_0x49c20d['type'][_0x9d22('0x31')]};});_0x4fd230['model']=_[_0x9d22('0x32')](_0x462a14,_0x9d22('0x2c'));_0x4fd230[_0x9d22('0x33')]=_[_0x9d22('0x34')](_0x17c66f[_0x9d22('0x33')]);_0x4fd230['filters']=_['intersection'](_0x4fd230[_0x9d22('0x35')],_0x4fd230[_0x9d22('0x33')]);_0x3e52ec['attributes']=_[_0x9d22('0x36')](_0x4fd230['model'],qs[_0x9d22('0x37')](_0x17c66f[_0x9d22('0x33')][_0x9d22('0x37')]));_0x3e52ec['attributes']=_0x3e52ec[_0x9d22('0x38')][_0x9d22('0x39')]?_0x3e52ec[_0x9d22('0x38')]:_0x4fd230[_0x9d22('0x35')];if(!_0x17c66f[_0x9d22('0x33')]['hasOwnProperty'](_0x9d22('0x3a'))){_0x3e52ec['limit']=qs[_0x9d22('0x1f')](_0x17c66f[_0x9d22('0x33')][_0x9d22('0x1f')]);_0x3e52ec[_0x9d22('0x1c')]=qs[_0x9d22('0x1c')](_0x17c66f[_0x9d22('0x33')][_0x9d22('0x1c')]);}_0x3e52ec[_0x9d22('0x3b')]=qs['sort'](_0x17c66f[_0x9d22('0x33')][_0x9d22('0x3c')]);_0x3e52ec[_0x9d22('0x3d')]=qs['filters'](_[_0x9d22('0x3e')](_0x17c66f[_0x9d22('0x33')],_0x4fd230[_0x9d22('0x3f')]),_0x462a14);if(_0x17c66f[_0x9d22('0x33')][_0x9d22('0x40')]){_0x3e52ec[_0x9d22('0x3d')]=_[_0x9d22('0x41')](_0x3e52ec[_0x9d22('0x3d')],{'$or':_[_0x9d22('0x32')](_0x462a14,function(_0x1a6088){if(_0x1a6088[_0x9d22('0x42')]!==_0x9d22('0x43')){var _0x2a8940={};_0x2a8940[_0x1a6088[_0x9d22('0x2c')]]={'$like':'%'+_0x17c66f['query'][_0x9d22('0x40')]+'%'};return _0x2a8940;}})});}_0x3e52ec=_[_0x9d22('0x41')]({},_0x3e52ec,_0x17c66f['options']);var _0x1e48f1={'where':_0x3e52ec[_0x9d22('0x3d')]};return db['Interval'][_0x9d22('0x1e')](_0x1e48f1)['then'](function(_0x36b9d8){_0x1d5106[_0x9d22('0x1e')]=_0x36b9d8;if(_0x17c66f[_0x9d22('0x33')][_0x9d22('0x44')]){_0x3e52ec['include']=[{'all':!![]}];}return db['Interval'][_0x9d22('0x45')](_0x3e52ec);})[_0x9d22('0x27')](function(_0x84bd71){_0x1d5106[_0x9d22('0x46')]=_0x84bd71;return _0x1d5106;})['then'](respondWithFilteredResult(_0x1408f2,_0x3e52ec))[_0x9d22('0x47')](handleError(_0x1408f2,null));};exports[_0x9d22('0x48')]=function(_0x3f8d06,_0x3b43b0){var _0x2c4d9c={'raw':!![],'where':{'id':_0x3f8d06[_0x9d22('0x49')]['id']}},_0x3d798b={};_0x3d798b[_0x9d22('0x35')]=_['keys'](db[_0x9d22('0x2e')][_0x9d22('0x2f')]);_0x3d798b['query']=_[_0x9d22('0x34')](_0x3f8d06[_0x9d22('0x33')]);_0x3d798b[_0x9d22('0x3f')]=_['intersection'](_0x3d798b[_0x9d22('0x35')],_0x3d798b[_0x9d22('0x33')]);_0x2c4d9c[_0x9d22('0x38')]=_[_0x9d22('0x36')](_0x3d798b[_0x9d22('0x35')],qs[_0x9d22('0x37')](_0x3f8d06[_0x9d22('0x33')][_0x9d22('0x37')]));_0x2c4d9c[_0x9d22('0x38')]=_0x2c4d9c[_0x9d22('0x38')][_0x9d22('0x39')]?_0x2c4d9c['attributes']:_0x3d798b['model'];if(_0x3f8d06[_0x9d22('0x33')]['includeAll']){_0x2c4d9c[_0x9d22('0x4a')]=[{'all':!![]}];}_0x2c4d9c=_[_0x9d22('0x41')]({},_0x2c4d9c,_0x3f8d06[_0x9d22('0x4b')]);return db['Interval'][_0x9d22('0x4c')](_0x2c4d9c)[_0x9d22('0x27')](handleEntityNotFound(_0x3b43b0,null))[_0x9d22('0x27')](respondWithResult(_0x3b43b0,null))[_0x9d22('0x47')](handleError(_0x3b43b0,null));};exports[_0x9d22('0x4d')]=function(_0x55f96f,_0x161e23){return db['Interval'][_0x9d22('0x4d')](_0x55f96f[_0x9d22('0x4e')],{})['then'](function(_0x5c2762){var _0x1bfe66=_0x55f96f[_0x9d22('0x4f')][_0x9d22('0x28')]({'plain':!![]});if(!_0x1bfe66)throw new Error(_0x9d22('0x50'));if(_0x1bfe66['role']==='user'){var _0x23ed9e=_0x5c2762[_0x9d22('0x28')]({'plain':!![]});var _0xa8c3d=_0x9d22('0x51');return db[_0x9d22('0x52')][_0x9d22('0x4c')]({'where':{'name':_0xa8c3d,'userProfileId':_0x1bfe66[_0x9d22('0x53')]},'raw':!![]})[_0x9d22('0x27')](function(_0x559445){if(_0x559445&&_0x559445[_0x9d22('0x54')]===0x0){return db[_0x9d22('0x29')][_0x9d22('0x4d')]({'name':_0x23ed9e[_0x9d22('0x2c')],'resourceId':_0x23ed9e['id'],'type':_0x559445[_0x9d22('0x2c')],'sectionId':_0x559445['id']},{})[_0x9d22('0x27')](function(){return _0x5c2762;});}else{return _0x5c2762;}})[_0x9d22('0x47')](function(_0x766d4d){logger[_0x9d22('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x766d4d);throw _0x766d4d;});}return _0x5c2762;})['then'](respondWithResult(_0x161e23,0xc9))[_0x9d22('0x47')](handleError(_0x161e23,null));};exports[_0x9d22('0x25')]=function(_0x311b04,_0xb6551c){if(_0x311b04[_0x9d22('0x4e')]['id']){delete _0x311b04['body']['id'];}return db[_0x9d22('0x2e')]['find']({'where':{'id':_0x311b04[_0x9d22('0x49')]['id']}})[_0x9d22('0x27')](handleEntityNotFound(_0xb6551c,null))[_0x9d22('0x27')](saveUpdates(_0x311b04[_0x9d22('0x4e')],null))[_0x9d22('0x27')](respondWithResult(_0xb6551c,null))['catch'](handleError(_0xb6551c,null));};exports[_0x9d22('0x26')]=function(_0x4c524f,_0x51e195){return db[_0x9d22('0x2e')]['find']({'where':{'id':_0x4c524f[_0x9d22('0x49')]['id']}})['then'](handleEntityNotFound(_0x51e195,null))[_0x9d22('0x27')](removeEntity(_0x51e195,null))['catch'](handleError(_0x51e195,null));};exports['addInterval']=function(_0x5dbeb3,_0x2b4bf2,_0x24ef05){if(_0x5dbeb3[_0x9d22('0x4e')]['id']){delete _0x5dbeb3[_0x9d22('0x4e')]['id'];}return db['Interval'][_0x9d22('0x4c')]({'where':{'id':_0x5dbeb3[_0x9d22('0x49')]['id']}})[_0x9d22('0x27')](handleEntityNotFound(_0x2b4bf2,null))[_0x9d22('0x27')](function(_0x5883b6){if(_0x5883b6){_0x5dbeb3[_0x9d22('0x4e')]['IntervalId']=_0x5883b6['id'];return db[_0x9d22('0x2e')][_0x9d22('0x4d')](_0x5dbeb3[_0x9d22('0x4e')]);}})[_0x9d22('0x27')](respondWithResult(_0x2b4bf2,null))['catch'](handleError(_0x2b4bf2,null));};exports['getIntervals']=function(_0x32baf0,_0x143c7d,_0x1b09dc){var _0x5e1414={};var _0xa6bc6a={};var _0x45aca1;var _0x5d422f;return db[_0x9d22('0x2e')][_0x9d22('0x55')]({'where':{'id':_0x32baf0[_0x9d22('0x49')]['id']}})['then'](handleEntityNotFound(_0x143c7d,null))['then'](function(_0x4111b3){if(_0x4111b3){_0x45aca1=_0x4111b3;_0xa6bc6a[_0x9d22('0x35')]=_[_0x9d22('0x34')](db[_0x9d22('0x2e')][_0x9d22('0x2f')]);_0xa6bc6a[_0x9d22('0x33')]=_[_0x9d22('0x34')](_0x32baf0['query']);_0xa6bc6a[_0x9d22('0x3f')]=_[_0x9d22('0x36')](_0xa6bc6a['model'],_0xa6bc6a[_0x9d22('0x33')]);_0x5e1414[_0x9d22('0x38')]=_[_0x9d22('0x36')](_0xa6bc6a['model'],qs[_0x9d22('0x37')](_0x32baf0['query'][_0x9d22('0x37')]));_0x5e1414['attributes']=_0x5e1414['attributes'][_0x9d22('0x39')]?_0x5e1414['attributes']:_0xa6bc6a[_0x9d22('0x35')];_0x5e1414[_0x9d22('0x3b')]=qs[_0x9d22('0x3c')](_0x32baf0[_0x9d22('0x33')][_0x9d22('0x3c')]);_0x5e1414[_0x9d22('0x3d')]=qs[_0x9d22('0x3f')](_[_0x9d22('0x3e')](_0x32baf0['query'],_0xa6bc6a[_0x9d22('0x3f')]));if(_0x32baf0[_0x9d22('0x33')]['filter']){_0x5e1414[_0x9d22('0x3d')]=_[_0x9d22('0x41')](_0x5e1414['where'],{'$or':_[_0x9d22('0x32')](_0x5e1414[_0x9d22('0x38')],function(_0x2bd656){var _0x458467={};_0x458467[_0x2bd656]={'$like':'%'+_0x32baf0[_0x9d22('0x33')]['filter']+'%'};return _0x458467;})});}_0x5e1414=_['merge']({},_0x5e1414,_0x32baf0[_0x9d22('0x4b')]);return _0x45aca1['getIntervals'](_0x5e1414);}})['then'](function(_0x1d5283){if(_0x1d5283){_0x5d422f=_0x1d5283[_0x9d22('0x39')];if(!_0x32baf0[_0x9d22('0x33')][_0x9d22('0x56')]('nolimit')){_0x5e1414[_0x9d22('0x1f')]=qs[_0x9d22('0x1f')](_0x32baf0['query'][_0x9d22('0x1f')]);_0x5e1414[_0x9d22('0x1c')]=qs[_0x9d22('0x1c')](_0x32baf0[_0x9d22('0x33')][_0x9d22('0x1c')]);}return _0x45aca1['getIntervals'](_0x5e1414);}})[_0x9d22('0x27')](function(_0x4a5efe){if(_0x4a5efe){return _0x4a5efe?{'count':_0x5d422f,'rows':_0x4a5efe}:null;}})['then'](respondWithResult(_0x143c7d,null))['catch'](handleError(_0x143c7d,null));};exports[_0x9d22('0x57')]=function(_0x21b7e4,_0x427d38,_0x3988db){return db[_0x9d22('0x2e')][_0x9d22('0x55')]({'where':{'id':_0x21b7e4[_0x9d22('0x49')]['id']}})[_0x9d22('0x27')](handleEntityNotFound(_0x427d38,null))['then'](function(_0x269be9){if(_0x269be9){return db[_0x9d22('0x58')][_0x9d22('0x59')](function(_0x114370){return db[_0x9d22('0x2e')][_0x9d22('0x26')]({'where':{'IntervalId':_0x21b7e4[_0x9d22('0x49')]['id']},'transaction':_0x114370})['then'](function(_0x2921cb){var _0x4fc91b=_[_0x9d22('0x32')](_0x21b7e4[_0x9d22('0x4e')],function(_0x4a31b6){delete _0x4a31b6['id'];_0x4a31b6['IntervalId']=_0x21b7e4[_0x9d22('0x49')]['id'];return _0x4a31b6;});return db[_0x9d22('0x2e')][_0x9d22('0x5a')](_0x4fc91b,{'transaction':_0x114370});});})[_0x9d22('0x27')](function(){return db[_0x9d22('0x2e')][_0x9d22('0x45')]({'where':{'IntervalId':_0x21b7e4[_0x9d22('0x49')]['id']}});});}})[_0x9d22('0x27')](respondWithResult(_0x427d38,null))[_0x9d22('0x47')](handleError(_0x427d38,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7bcd416..e290dd1 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 _0x0380=['bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x35a393,_0x4e2072){var _0x22cea8=function(_0x4f4357){while(--_0x4f4357){_0x35a393['push'](_0x35a393['shift']());}};_0x22cea8(++_0x4e2072);}(_0x0380,0x113));var _0x0038=function(_0x4974e4,_0xb65336){_0x4974e4=_0x4974e4-0x0;var _0x38a8e1=_0x0380[_0x4974e4];return _0x38a8e1;};'use strict';var _=require(_0x0038('0x0'));var util=require(_0x0038('0x1'));var logger=require(_0x0038('0x2'))(_0x0038('0x3'));var moment=require(_0x0038('0x4'));var BPromise=require(_0x0038('0x5'));var rp=require(_0x0038('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0038('0x7'));var config=require(_0x0038('0x8'));var attributes=require(_0x0038('0x9'));var extensions=require(_0x0038('0xa'));module['exports']=function(_0x413a15,_0x541f75){return _0x413a15[_0x0038('0xb')](_0x0038('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x23146d,_0x2cb22a){extensions[_0x0038('0xd')](_0x413a15,_0x23146d);},'afterBulkCreate':function(_0x2fe965,_0x4b6381,_0x9eee9c){_0x9eee9c();extensions[_0x0038('0xd')](_0x413a15,_0x2fe965[0x0]);},'afterUpdate':function(_0x21ae37,_0x1c0aee){extensions[_0x0038('0xd')](_0x413a15,_0x21ae37);},'afterDestroy':function(_0x2947ac,_0x17e94b){extensions[_0x0038('0xd')](_0x413a15,_0x2947ac);}}});}; \ No newline at end of file +var _0xac4b=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/extensions/rewrite','exports'];(function(_0x49d69d,_0x5816c3){var _0x579563=function(_0x37de44){while(--_0x37de44){_0x49d69d['push'](_0x49d69d['shift']());}};_0x579563(++_0x5816c3);}(_0xac4b,0x145));var _0xbac4=function(_0x4bb361,_0x56fa3c){_0x4bb361=_0x4bb361-0x0;var _0x2229e7=_0xac4b[_0x4bb361];return _0x2229e7;};'use strict';var _=require(_0xbac4('0x0'));var util=require(_0xbac4('0x1'));var logger=require(_0xbac4('0x2'))(_0xbac4('0x3'));var moment=require(_0xbac4('0x4'));var BPromise=require(_0xbac4('0x5'));var rp=require(_0xbac4('0x6'));var fs=require('fs');var path=require(_0xbac4('0x7'));var rimraf=require(_0xbac4('0x8'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xbac4('0x9'));module[_0xbac4('0xa')]=function(_0xba4dae,_0x3ce65a){return _0xba4dae['define'](_0xbac4('0xb'),attributes,{'tableName':_0xbac4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ebfde,_0x127824){extensions[_0xbac4('0xd')](_0xba4dae,_0x2ebfde);},'afterBulkCreate':function(_0xd9d62d,_0x363987,_0x55d6d3){_0x55d6d3();extensions[_0xbac4('0xd')](_0xba4dae,_0xd9d62d[0x0]);},'afterUpdate':function(_0x436d7c,_0x666de7){extensions[_0xbac4('0xd')](_0xba4dae,_0x436d7c);},'afterDestroy':function(_0x401211,_0x4b7a15){extensions[_0xbac4('0xd')](_0xba4dae,_0x401211);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9b6e387..7e9c0b6 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(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 9eb0c27..591fdcf 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x332e8a,_0x189cd1){var _0xd4b128=function(_0x1f4d0f){while(--_0x1f4d0f){_0x332e8a['push'](_0x332e8a['shift']());}};_0xd4b128(++_0x189cd1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b005f,_0x406c5f){_0x1b005f=_0x1b005f-0x0;var _0x26cce1=_0x5f2f[_0x1b005f];return _0x26cce1;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x5c2290,_0x555e7e){var _0xfd3ab6=function(_0x249ae6){while(--_0x249ae6){_0x5c2290['push'](_0x5c2290['shift']());}};_0xfd3ab6(++_0x555e7e);}(_0xdb28,0x106));var _0x8db2=function(_0x32109f,_0x202d54){_0x32109f=_0x32109f-0x0;var _0x4f7487=_0xdb28[_0x32109f];return _0x4f7487;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index de13247..8b888be 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 _0x8dc6=['stringify','issuetype','Bug','fields','customfield_11500','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','3eAmWpBVP0','key','Report','\x20from\x20'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x8dc6,0x77));var _0x68dc=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x8dc6[_0x20589d];return _0x422de9;};'use strict';var BPromise=require(_0x68dc('0x0'));var https=require('https');var logger=require(_0x68dc('0x1'))('api');var USERNAME=_0x68dc('0x2');var PASSWORD=_0x68dc('0x3');function openIssue(_0xd591ec,_0x55c0de){var _0x42bb73={'fields':{'project':{'key':_0xd591ec[_0x68dc('0x4')]||'MOTGUI'},'summary':(_0xd591ec['summary']||_0x68dc('0x5'))+_0x68dc('0x6')+_0xd591ec['ip'],'description':_0xd591ec['description']||JSON[_0x68dc('0x7')](_0xd591ec),'issuetype':{'name':_0xd591ec[_0x68dc('0x8')]||_0x68dc('0x9')}}};_0x42bb73[_0x68dc('0xa')][_0x68dc('0xb')]=_0xd591ec['email'];_0x42bb73[_0x68dc('0xa')]['customfield_11501']=_0xd591ec['oldToken'];_0x42bb73[_0x68dc('0xa')][_0x68dc('0xc')]=_0xd591ec[_0x68dc('0xd')];_0x42bb73[_0x68dc('0xa')]['customfield_11503']=_0xd591ec['name'];_0x42bb73[_0x68dc('0xa')][_0x68dc('0xe')]=_0xd591ec[_0x68dc('0xf')];_0x42bb73[_0x68dc('0xa')][_0x68dc('0x10')]=_0xd591ec['ip'];var _0x400cb7={'host':_0x68dc('0x11'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x68dc('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x68dc('0x13'),'Authorization':_0x68dc('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x68dc('0x15')](_0x68dc('0x16'))}};var _0x18ae8b=JSON[_0x68dc('0x7')](_0x42bb73);var _0x4dc046=https[_0x68dc('0x17')](_0x400cb7,function(_0x595938){_0x595938[_0x68dc('0x18')](_0x68dc('0x19'));var _0x67383a='';_0x595938['on'](_0x68dc('0x1a'),function(_0x493e0b){_0x67383a+=_0x493e0b;});_0x595938['on']('end',function(){if(_0x55c0de){return _0x55c0de[_0x68dc('0x1b')](_0x595938['statusCode'])['json'](JSON[_0x68dc('0x1c')](_0x67383a));}});});_0x4dc046['on'](_0x68dc('0x1d'),function(_0x119bbf){if(_0x55c0de){return _0x55c0de[_0x68dc('0x1b')](0x1f4)[_0x68dc('0x1e')]({'errors':[{'message':_0x68dc('0x1f'),'type':_0x68dc('0x20')}]});}});_0x4dc046['write'](_0x18ae8b);_0x4dc046[_0x68dc('0x21')]();}exports[_0x68dc('0x22')]=openIssue;exports[_0x68dc('0x23')]=function(_0x402a28,_0x293e55){_0x402a28[_0x68dc('0x24')]['ip']=_0x402a28[_0x68dc('0x25')][_0x68dc('0x26')]||_0x402a28[_0x68dc('0x27')][_0x68dc('0x28')]||_0x402a28[_0x68dc('0x29')][_0x68dc('0x28')]||_0x402a28['connection']['socket'][_0x68dc('0x28')];return openIssue(_0x402a28[_0x68dc('0x24')],_0x293e55);}; \ No newline at end of file +var _0x4856=['connection','remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send'];(function(_0x146fe5,_0x52153a){var _0x35795c=function(_0xcaa5e3){while(--_0xcaa5e3){_0x146fe5['push'](_0x146fe5['shift']());}};_0x35795c(++_0x52153a);}(_0x4856,0x137));var _0x6485=function(_0xa8d84f,_0x512e08){_0xa8d84f=_0xa8d84f-0x0;var _0x220939=_0x4856[_0xa8d84f];return _0x220939;};'use strict';var BPromise=require('bluebird');var https=require(_0x6485('0x0'));var logger=require(_0x6485('0x1'))(_0x6485('0x2'));var USERNAME='support';var PASSWORD=_0x6485('0x3');function openIssue(_0x3d50e6,_0x3b5365){var _0x4d90bb={'fields':{'project':{'key':_0x3d50e6['key']||_0x6485('0x4')},'summary':(_0x3d50e6[_0x6485('0x5')]||'Report')+_0x6485('0x6')+_0x3d50e6['ip'],'description':_0x3d50e6[_0x6485('0x7')]||JSON[_0x6485('0x8')](_0x3d50e6),'issuetype':{'name':_0x3d50e6[_0x6485('0x9')]||_0x6485('0xa')}}};_0x4d90bb[_0x6485('0xb')][_0x6485('0xc')]=_0x3d50e6[_0x6485('0xd')];_0x4d90bb[_0x6485('0xb')][_0x6485('0xe')]=_0x3d50e6['oldToken'];_0x4d90bb[_0x6485('0xb')][_0x6485('0xf')]=_0x3d50e6[_0x6485('0x10')];_0x4d90bb[_0x6485('0xb')]['customfield_11503']=_0x3d50e6[_0x6485('0x11')];_0x4d90bb[_0x6485('0xb')][_0x6485('0x12')]=_0x3d50e6[_0x6485('0x13')];_0x4d90bb[_0x6485('0xb')][_0x6485('0x14')]=_0x3d50e6['ip'];var _0xb408c2={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x6485('0x15'),'method':_0x6485('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x6485('0x17'),'Authorization':_0x6485('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x6485('0x19')](_0x6485('0x1a'))}};var _0x4b1aae=JSON[_0x6485('0x8')](_0x4d90bb);var _0x19144f=https[_0x6485('0x1b')](_0xb408c2,function(_0x122b9f){_0x122b9f[_0x6485('0x1c')](_0x6485('0x1d'));var _0x1b1993='';_0x122b9f['on'](_0x6485('0x1e'),function(_0xd377c2){_0x1b1993+=_0xd377c2;});_0x122b9f['on'](_0x6485('0x1f'),function(){if(_0x3b5365){return _0x3b5365[_0x6485('0x20')](_0x122b9f['statusCode'])[_0x6485('0x21')](JSON[_0x6485('0x22')](_0x1b1993));}});});_0x19144f['on'](_0x6485('0x23'),function(_0x5114f1){if(_0x3b5365){return _0x3b5365[_0x6485('0x20')](0x1f4)[_0x6485('0x21')]({'errors':[{'message':_0x6485('0x24'),'type':_0x6485('0x25')}]});}});_0x19144f[_0x6485('0x26')](_0x4b1aae);_0x19144f['end']();}exports[_0x6485('0x27')]=openIssue;exports[_0x6485('0x28')]=function(_0xfc6a10,_0x22398f){_0xfc6a10['body']['ip']=_0xfc6a10['headers']['x-forwarded-for']||_0xfc6a10[_0x6485('0x29')][_0x6485('0x2a')]||_0xfc6a10[_0x6485('0x2b')][_0x6485('0x2a')]||_0xfc6a10[_0x6485('0x29')]['socket']['remoteAddress'];return openIssue(_0xfc6a10['body'],_0x22398f);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 0b29799..851faf8 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 _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x29cb4f,_0x26a21d){var _0x51e06d=function(_0x3ce158){while(--_0x3ce158){_0x29cb4f['push'](_0x29cb4f['shift']());}};_0x51e06d(++_0x26a21d);}(_0xa74f,0x9a));var _0xfa74=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xa74f[_0x50d84b];return _0x6d4270;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router; \ No newline at end of file +var _0xa75b=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x4b16fd,_0x1da11f){var _0x1e3b08=function(_0xb6f0fc){while(--_0xb6f0fc){_0x4b16fd['push'](_0x4b16fd['shift']());}};_0x1e3b08(++_0x1da11f);}(_0xa75b,0x170));var _0xba75=function(_0x3a7fdb,_0x13493d){_0x3a7fdb=_0x3a7fdb-0x0;var _0x3f1197=_0xa75b[_0x3a7fdb];return _0x3f1197;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['post']('/',auth[_0xba75('0xa')](),controller[_0xba75('0xe')]);router[_0xba75('0xf')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x12')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);module[_0xba75('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 958c53a..07dba51 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x5a26da,_0x442ab6){_0x5a26da=_0x5a26da-0x0;var _0x2da56d=_0x7a54[_0x5a26da];return _0x2da56d;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x42caef,_0x4c62d6){_0x42caef=_0x42caef-0x0;var _0xfcd226=_0x7a54[_0x42caef];return _0xfcd226;};'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 a70c665..8188a54 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 _0x3595=['map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','update','then','destroy','error','stack','name','index'];(function(_0x4e92da,_0x4f85b5){var _0x3525f0=function(_0x338f63){while(--_0x338f63){_0x4e92da['push'](_0x4e92da['shift']());}};_0x3525f0(++_0x4f85b5);}(_0x3595,0x147));var _0x5359=function(_0x353044,_0x1a55c4){_0x353044=_0x353044-0x0;var _0x2c8a19=_0x3595[_0x353044];return _0x2c8a19;};'use strict';var emlformat=require(_0x5359('0x0'));var rimraf=require(_0x5359('0x1'));var zipdir=require(_0x5359('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5359('0x3'));var moment=require(_0x5359('0x4'));var BPromise=require(_0x5359('0x5'));var Mustache=require(_0x5359('0x6'));var util=require(_0x5359('0x7'));var path=require(_0x5359('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5359('0x9'));var fs=require('fs');var fs_extra=require(_0x5359('0xa'));var _=require(_0x5359('0xb'));var squel=require(_0x5359('0xc'));var crypto=require(_0x5359('0xd'));var jsforce=require(_0x5359('0xe'));var deskjs=require(_0x5359('0xf'));var toCsv=require(_0x5359('0x10'));var querystring=require(_0x5359('0x11'));var Papa=require(_0x5359('0x12'));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(_0x5359('0x13'));var logger=require(_0x5359('0x14'))(_0x5359('0x15'));var utils=require(_0x5359('0x16'));var config=require(_0x5359('0x17'));var licenseUtil=require(_0x5359('0x18'));var db=require(_0x5359('0x19'))['db'];function respondWithStatusCode(_0x343282,_0xcf081){_0xcf081=_0xcf081||0xcc;return function(_0x2a42b1){if(_0x2a42b1){return _0x343282[_0x5359('0x1a')](_0xcf081);}return _0x343282[_0x5359('0x1b')](_0xcf081)[_0x5359('0x1c')]();};}function respondWithResult(_0xb1a895,_0x48099c){_0x48099c=_0x48099c||0xc8;return function(_0x51b3b7){if(_0x51b3b7){return _0xb1a895[_0x5359('0x1b')](_0x48099c)[_0x5359('0x1d')](_0x51b3b7);}};}function respondWithFilteredResult(_0x11d494,_0xa146f5){return function(_0xcdc03e){if(_0xcdc03e){var _0x44c489=typeof _0xa146f5['offset']==='undefined'&&typeof _0xa146f5[_0x5359('0x1e')]===_0x5359('0x1f');var _0x4de994=_0xcdc03e[_0x5359('0x20')];var _0x21184f=_0x44c489?0x0:_0xa146f5[_0x5359('0x21')];var _0x2d0962=_0x44c489?_0xcdc03e['count']:_0xa146f5['offset']+_0xa146f5['limit'];var _0x3f9d7b;if(_0x2d0962>=_0x4de994){_0x2d0962=_0x4de994;_0x3f9d7b=0xc8;}else{_0x3f9d7b=0xce;}_0x11d494[_0x5359('0x1b')](_0x3f9d7b);return _0x11d494['set'](_0x5359('0x22'),_0x21184f+'-'+_0x2d0962+'/'+_0x4de994)[_0x5359('0x1d')](_0xcdc03e);}return null;};}function patchUpdates(_0x45bf1c){return function(_0x41ab92){try{jsonpatch['apply'](_0x41ab92,_0x45bf1c,!![]);}catch(_0x5ad9fc){return BPromise[_0x5359('0x23')](_0x5ad9fc);}return _0x41ab92['save']();};}function saveUpdates(_0x21abeb,_0x27749e){return function(_0x3d3c0c){if(_0x3d3c0c){return _0x3d3c0c[_0x5359('0x24')](_0x21abeb)[_0x5359('0x25')](function(_0x51fc69){return _0x51fc69;});}return null;};}function removeEntity(_0x4a4667,_0x280392){return function(_0xc2eb10){if(_0xc2eb10){return _0xc2eb10[_0x5359('0x26')]()[_0x5359('0x25')](function(){_0x4a4667[_0x5359('0x1b')](0xcc)[_0x5359('0x1c')]();});}};}function handleEntityNotFound(_0x3b0d2f,_0x2771ea){return function(_0x3fea11){if(!_0x3fea11){_0x3b0d2f['sendStatus'](0x194);}return _0x3fea11;};}function handleError(_0x12052a,_0xbb59f4){_0xbb59f4=_0xbb59f4||0x1f4;return function(_0x23f192){logger[_0x5359('0x27')](_0x23f192[_0x5359('0x28')]);if(_0x23f192[_0x5359('0x29')]){delete _0x23f192['name'];}_0x12052a[_0x5359('0x1b')](_0xbb59f4)['send'](_0x23f192);};}exports[_0x5359('0x2a')]=function(_0x4b130a,_0x1d6810){var _0xdc839b={},_0x47cac5={},_0x9fc4a={'count':0x0,'rows':[]};var _0x5766e3=_[_0x5359('0x2b')](db[_0x5359('0x2c')][_0x5359('0x2d')],function(_0x10ae78){return{'name':_0x10ae78[_0x5359('0x2e')],'type':_0x10ae78[_0x5359('0x2f')][_0x5359('0x30')]};});_0x47cac5[_0x5359('0x31')]=_[_0x5359('0x2b')](_0x5766e3,_0x5359('0x29'));_0x47cac5[_0x5359('0x32')]=_[_0x5359('0x33')](_0x4b130a[_0x5359('0x32')]);_0x47cac5[_0x5359('0x34')]=_[_0x5359('0x35')](_0x47cac5[_0x5359('0x31')],_0x47cac5[_0x5359('0x32')]);_0xdc839b[_0x5359('0x36')]=_['intersection'](_0x47cac5[_0x5359('0x31')],qs[_0x5359('0x37')](_0x4b130a['query']['fields']));_0xdc839b[_0x5359('0x36')]=_0xdc839b[_0x5359('0x36')][_0x5359('0x38')]?_0xdc839b[_0x5359('0x36')]:_0x47cac5['model'];if(!_0x4b130a[_0x5359('0x32')]['hasOwnProperty'](_0x5359('0x39'))){_0xdc839b[_0x5359('0x1e')]=qs[_0x5359('0x1e')](_0x4b130a[_0x5359('0x32')][_0x5359('0x1e')]);_0xdc839b[_0x5359('0x21')]=qs[_0x5359('0x21')](_0x4b130a[_0x5359('0x32')][_0x5359('0x21')]);}_0xdc839b[_0x5359('0x3a')]=qs[_0x5359('0x3b')](_0x4b130a[_0x5359('0x32')]['sort']);_0xdc839b['where']=qs['filters'](_[_0x5359('0x3c')](_0x4b130a[_0x5359('0x32')],_0x47cac5['filters']),_0x5766e3);if(_0x4b130a['query'][_0x5359('0x3d')]){_0xdc839b[_0x5359('0x3e')]=_[_0x5359('0x3f')](_0xdc839b[_0x5359('0x3e')],{'$or':_[_0x5359('0x2b')](_0x5766e3,function(_0x19fd15){if(_0x19fd15['type']!=='VIRTUAL'){var _0x29f233={};_0x29f233[_0x19fd15[_0x5359('0x29')]]={'$like':'%'+_0x4b130a[_0x5359('0x32')][_0x5359('0x3d')]+'%'};return _0x29f233;}})});}_0xdc839b=_[_0x5359('0x3f')]({},_0xdc839b,_0x4b130a[_0x5359('0x40')]);var _0x1d6e43={'where':_0xdc839b[_0x5359('0x3e')]};return db['JscriptyAnswerReport'][_0x5359('0x20')](_0x1d6e43)['then'](function(_0x48250b){_0x9fc4a[_0x5359('0x20')]=_0x48250b;if(_0x4b130a[_0x5359('0x32')][_0x5359('0x41')]){_0xdc839b[_0x5359('0x42')]=[{'all':!![]}];}return db[_0x5359('0x2c')][_0x5359('0x43')](_0xdc839b);})['then'](function(_0x2fbab1){_0x9fc4a[_0x5359('0x44')]=_0x2fbab1;return _0x9fc4a;})[_0x5359('0x25')](respondWithFilteredResult(_0x1d6810,_0xdc839b))[_0x5359('0x45')](handleError(_0x1d6810,null));};exports['show']=function(_0x1ea447,_0x514178){var _0x23dc72={'raw':!![],'where':{'id':_0x1ea447[_0x5359('0x46')]['id']}},_0x204cab={};_0x204cab[_0x5359('0x31')]=_[_0x5359('0x33')](db[_0x5359('0x2c')][_0x5359('0x2d')]);_0x204cab[_0x5359('0x32')]=_[_0x5359('0x33')](_0x1ea447[_0x5359('0x32')]);_0x204cab[_0x5359('0x34')]=_[_0x5359('0x35')](_0x204cab['model'],_0x204cab[_0x5359('0x32')]);_0x23dc72[_0x5359('0x36')]=_[_0x5359('0x35')](_0x204cab[_0x5359('0x31')],qs[_0x5359('0x37')](_0x1ea447[_0x5359('0x32')][_0x5359('0x37')]));_0x23dc72['attributes']=_0x23dc72[_0x5359('0x36')]['length']?_0x23dc72[_0x5359('0x36')]:_0x204cab[_0x5359('0x31')];if(_0x1ea447[_0x5359('0x32')][_0x5359('0x41')]){_0x23dc72[_0x5359('0x42')]=[{'all':!![]}];}_0x23dc72=_['merge']({},_0x23dc72,_0x1ea447[_0x5359('0x40')]);return db[_0x5359('0x2c')]['find'](_0x23dc72)[_0x5359('0x25')](handleEntityNotFound(_0x514178,null))[_0x5359('0x25')](respondWithResult(_0x514178,null))[_0x5359('0x45')](handleError(_0x514178,null));};exports[_0x5359('0x47')]=function(_0x488d17,_0x3fcb9f){return db[_0x5359('0x2c')][_0x5359('0x47')](_0x488d17[_0x5359('0x48')],{})[_0x5359('0x25')](respondWithResult(_0x3fcb9f,0xc9))[_0x5359('0x45')](handleError(_0x3fcb9f,null));};exports[_0x5359('0x24')]=function(_0x2a043e,_0x4a023c){if(_0x2a043e[_0x5359('0x48')]['id']){delete _0x2a043e[_0x5359('0x48')]['id'];}return db[_0x5359('0x2c')]['find']({'where':{'id':_0x2a043e[_0x5359('0x46')]['id']}})[_0x5359('0x25')](handleEntityNotFound(_0x4a023c,null))['then'](saveUpdates(_0x2a043e[_0x5359('0x48')],null))[_0x5359('0x25')](respondWithResult(_0x4a023c,null))[_0x5359('0x45')](handleError(_0x4a023c,null));};exports[_0x5359('0x26')]=function(_0x53aa10,_0x5803bd){return db[_0x5359('0x2c')]['find']({'where':{'id':_0x53aa10['params']['id']}})['then'](handleEntityNotFound(_0x5803bd,null))[_0x5359('0x25')](removeEntity(_0x5803bd,null))[_0x5359('0x45')](handleError(_0x5803bd,null));};exports[_0x5359('0x49')]=function(_0xdc7882,_0x213456){return db[_0x5359('0x2c')]['describe']()[_0x5359('0x25')](respondWithResult(_0x213456,null))['catch'](handleError(_0x213456,null));}; \ No newline at end of file +var _0x0f89=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','where','merge','filter','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4a059d,_0x5aafd8){var _0x55e7e5=function(_0x51aedc){while(--_0x51aedc){_0x4a059d['push'](_0x4a059d['shift']());}};_0x55e7e5(++_0x5aafd8);}(_0x0f89,0x111));var _0x90f8=function(_0x2efae1,_0x99a042){_0x2efae1=_0x2efae1-0x0;var _0x4f05df=_0x0f89[_0x2efae1];return _0x4f05df;};'use strict';var emlformat=require(_0x90f8('0x0'));var rimraf=require(_0x90f8('0x1'));var zipdir=require(_0x90f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f8('0x3'));var moment=require(_0x90f8('0x4'));var BPromise=require(_0x90f8('0x5'));var Mustache=require(_0x90f8('0x6'));var util=require('util');var path=require(_0x90f8('0x7'));var sox=require(_0x90f8('0x8'));var csv=require('to-csv');var ejs=require(_0x90f8('0x9'));var fs=require('fs');var fs_extra=require(_0x90f8('0xa'));var _=require(_0x90f8('0xb'));var squel=require(_0x90f8('0xc'));var crypto=require(_0x90f8('0xd'));var jsforce=require(_0x90f8('0xe'));var deskjs=require(_0x90f8('0xf'));var toCsv=require(_0x90f8('0x10'));var querystring=require(_0x90f8('0x11'));var Papa=require(_0x90f8('0x12'));var Redis=require(_0x90f8('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90f8('0x14'));var hardwareService=require(_0x90f8('0x15'));var logger=require(_0x90f8('0x16'))(_0x90f8('0x17'));var utils=require(_0x90f8('0x18'));var config=require(_0x90f8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x90f8('0x1a'))['db'];function respondWithStatusCode(_0x4a1c3d,_0x4b31e6){_0x4b31e6=_0x4b31e6||0xcc;return function(_0x329f26){if(_0x329f26){return _0x4a1c3d[_0x90f8('0x1b')](_0x4b31e6);}return _0x4a1c3d['status'](_0x4b31e6)[_0x90f8('0x1c')]();};}function respondWithResult(_0x4e230b,_0x270a7d){_0x270a7d=_0x270a7d||0xc8;return function(_0x3f357f){if(_0x3f357f){return _0x4e230b[_0x90f8('0x1d')](_0x270a7d)[_0x90f8('0x1e')](_0x3f357f);}};}function respondWithFilteredResult(_0x4a36f9,_0x7bdc62){return function(_0x2767b3){if(_0x2767b3){var _0xec9212=typeof _0x7bdc62[_0x90f8('0x1f')]==='undefined'&&typeof _0x7bdc62[_0x90f8('0x20')]===_0x90f8('0x21');var _0x5615d2=_0x2767b3[_0x90f8('0x22')];var _0x31cc49=_0xec9212?0x0:_0x7bdc62[_0x90f8('0x1f')];var _0xae253e=_0xec9212?_0x2767b3[_0x90f8('0x22')]:_0x7bdc62[_0x90f8('0x1f')]+_0x7bdc62[_0x90f8('0x20')];var _0x1c3e04;if(_0xae253e>=_0x5615d2){_0xae253e=_0x5615d2;_0x1c3e04=0xc8;}else{_0x1c3e04=0xce;}_0x4a36f9[_0x90f8('0x1d')](_0x1c3e04);return _0x4a36f9[_0x90f8('0x23')](_0x90f8('0x24'),_0x31cc49+'-'+_0xae253e+'/'+_0x5615d2)[_0x90f8('0x1e')](_0x2767b3);}return null;};}function patchUpdates(_0x2994f9){return function(_0x4e9104){try{jsonpatch['apply'](_0x4e9104,_0x2994f9,!![]);}catch(_0xb207f5){return BPromise[_0x90f8('0x25')](_0xb207f5);}return _0x4e9104[_0x90f8('0x26')]();};}function saveUpdates(_0x1892f0,_0x26b420){return function(_0x17dfe7){if(_0x17dfe7){return _0x17dfe7[_0x90f8('0x27')](_0x1892f0)[_0x90f8('0x28')](function(_0x487236){return _0x487236;});}return null;};}function removeEntity(_0xa07586,_0x2a78b8){return function(_0x30e5ed){if(_0x30e5ed){return _0x30e5ed[_0x90f8('0x29')]()['then'](function(){_0xa07586['status'](0xcc)[_0x90f8('0x1c')]();});}};}function handleEntityNotFound(_0x153d61,_0x48a21e){return function(_0x6115fc){if(!_0x6115fc){_0x153d61[_0x90f8('0x1b')](0x194);}return _0x6115fc;};}function handleError(_0x39c465,_0x5e1e07){_0x5e1e07=_0x5e1e07||0x1f4;return function(_0xf1606f){logger[_0x90f8('0x2a')](_0xf1606f[_0x90f8('0x2b')]);if(_0xf1606f[_0x90f8('0x2c')]){delete _0xf1606f[_0x90f8('0x2c')];}_0x39c465[_0x90f8('0x1d')](_0x5e1e07)[_0x90f8('0x2d')](_0xf1606f);};}exports[_0x90f8('0x2e')]=function(_0x3877e5,_0x507efa){var _0x277ead={},_0x5304e6={},_0x461bf6={'count':0x0,'rows':[]};var _0x4fb78c=_[_0x90f8('0x2f')](db[_0x90f8('0x30')][_0x90f8('0x31')],function(_0x340658){return{'name':_0x340658['fieldName'],'type':_0x340658[_0x90f8('0x32')][_0x90f8('0x33')]};});_0x5304e6[_0x90f8('0x34')]=_[_0x90f8('0x2f')](_0x4fb78c,_0x90f8('0x2c'));_0x5304e6[_0x90f8('0x35')]=_['keys'](_0x3877e5[_0x90f8('0x35')]);_0x5304e6[_0x90f8('0x36')]=_[_0x90f8('0x37')](_0x5304e6[_0x90f8('0x34')],_0x5304e6['query']);_0x277ead[_0x90f8('0x38')]=_[_0x90f8('0x37')](_0x5304e6[_0x90f8('0x34')],qs[_0x90f8('0x39')](_0x3877e5['query'][_0x90f8('0x39')]));_0x277ead['attributes']=_0x277ead[_0x90f8('0x38')][_0x90f8('0x3a')]?_0x277ead[_0x90f8('0x38')]:_0x5304e6[_0x90f8('0x34')];if(!_0x3877e5[_0x90f8('0x35')]['hasOwnProperty']('nolimit')){_0x277ead[_0x90f8('0x20')]=qs[_0x90f8('0x20')](_0x3877e5['query']['limit']);_0x277ead[_0x90f8('0x1f')]=qs[_0x90f8('0x1f')](_0x3877e5['query'][_0x90f8('0x1f')]);}_0x277ead['order']=qs['sort'](_0x3877e5[_0x90f8('0x35')]['sort']);_0x277ead[_0x90f8('0x3b')]=qs[_0x90f8('0x36')](_['pick'](_0x3877e5[_0x90f8('0x35')],_0x5304e6[_0x90f8('0x36')]),_0x4fb78c);if(_0x3877e5[_0x90f8('0x35')]['filter']){_0x277ead[_0x90f8('0x3b')]=_[_0x90f8('0x3c')](_0x277ead[_0x90f8('0x3b')],{'$or':_['map'](_0x4fb78c,function(_0x331263){if(_0x331263[_0x90f8('0x32')]!=='VIRTUAL'){var _0x241308={};_0x241308[_0x331263['name']]={'$like':'%'+_0x3877e5[_0x90f8('0x35')][_0x90f8('0x3d')]+'%'};return _0x241308;}})});}_0x277ead=_[_0x90f8('0x3c')]({},_0x277ead,_0x3877e5['options']);var _0x4ed477={'where':_0x277ead['where']};return db[_0x90f8('0x30')][_0x90f8('0x22')](_0x4ed477)[_0x90f8('0x28')](function(_0x3600ce){_0x461bf6[_0x90f8('0x22')]=_0x3600ce;if(_0x3877e5[_0x90f8('0x35')][_0x90f8('0x3e')]){_0x277ead[_0x90f8('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x90f8('0x40')](_0x277ead);})[_0x90f8('0x28')](function(_0x1b208c){_0x461bf6[_0x90f8('0x41')]=_0x1b208c;return _0x461bf6;})['then'](respondWithFilteredResult(_0x507efa,_0x277ead))['catch'](handleError(_0x507efa,null));};exports[_0x90f8('0x42')]=function(_0x3f556f,_0x464c34){var _0x1214f9={'raw':!![],'where':{'id':_0x3f556f[_0x90f8('0x43')]['id']}},_0x5f0a86={};_0x5f0a86[_0x90f8('0x34')]=_[_0x90f8('0x44')](db[_0x90f8('0x30')][_0x90f8('0x31')]);_0x5f0a86[_0x90f8('0x35')]=_['keys'](_0x3f556f['query']);_0x5f0a86[_0x90f8('0x36')]=_[_0x90f8('0x37')](_0x5f0a86['model'],_0x5f0a86['query']);_0x1214f9[_0x90f8('0x38')]=_[_0x90f8('0x37')](_0x5f0a86[_0x90f8('0x34')],qs[_0x90f8('0x39')](_0x3f556f[_0x90f8('0x35')][_0x90f8('0x39')]));_0x1214f9[_0x90f8('0x38')]=_0x1214f9[_0x90f8('0x38')][_0x90f8('0x3a')]?_0x1214f9[_0x90f8('0x38')]:_0x5f0a86['model'];if(_0x3f556f['query'][_0x90f8('0x3e')]){_0x1214f9['include']=[{'all':!![]}];}_0x1214f9=_[_0x90f8('0x3c')]({},_0x1214f9,_0x3f556f[_0x90f8('0x45')]);return db[_0x90f8('0x30')]['find'](_0x1214f9)[_0x90f8('0x28')](handleEntityNotFound(_0x464c34,null))['then'](respondWithResult(_0x464c34,null))[_0x90f8('0x46')](handleError(_0x464c34,null));};exports[_0x90f8('0x47')]=function(_0x10819d,_0x5a1bec){return db[_0x90f8('0x30')][_0x90f8('0x47')](_0x10819d[_0x90f8('0x48')],{})[_0x90f8('0x28')](respondWithResult(_0x5a1bec,0xc9))['catch'](handleError(_0x5a1bec,null));};exports[_0x90f8('0x27')]=function(_0x35c2b9,_0x461913){if(_0x35c2b9[_0x90f8('0x48')]['id']){delete _0x35c2b9['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x35c2b9['params']['id']}})[_0x90f8('0x28')](handleEntityNotFound(_0x461913,null))[_0x90f8('0x28')](saveUpdates(_0x35c2b9['body'],null))[_0x90f8('0x28')](respondWithResult(_0x461913,null))[_0x90f8('0x46')](handleError(_0x461913,null));};exports[_0x90f8('0x29')]=function(_0x3da03c,_0x1c915a){return db['JscriptyAnswerReport'][_0x90f8('0x49')]({'where':{'id':_0x3da03c['params']['id']}})[_0x90f8('0x28')](handleEntityNotFound(_0x1c915a,null))[_0x90f8('0x28')](removeEntity(_0x1c915a,null))['catch'](handleError(_0x1c915a,null));};exports[_0x90f8('0x4a')]=function(_0x17f635,_0x8751a8){return db[_0x90f8('0x30')][_0x90f8('0x4a')]()[_0x90f8('0x28')](respondWithResult(_0x8751a8,null))[_0x90f8('0x46')](handleError(_0x8751a8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4d5c5e9..1ca8f49 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 _0x2cb9=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x5760f6,_0x45b7e8){var _0x9e4c7d=function(_0x25e9a9){while(--_0x25e9a9){_0x5760f6['push'](_0x5760f6['shift']());}};_0x9e4c7d(++_0x45b7e8);}(_0x2cb9,0x179));var _0x92cb=function(_0x39f4f5,_0x1750a1){_0x39f4f5=_0x39f4f5-0x0;var _0x2d656d=_0x2cb9[_0x39f4f5];return _0x2d656d;};'use strict';var _=require(_0x92cb('0x0'));var util=require(_0x92cb('0x1'));var logger=require(_0x92cb('0x2'))(_0x92cb('0x3'));var moment=require(_0x92cb('0x4'));var BPromise=require(_0x92cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x92cb('0x6'));var config=require(_0x92cb('0x7'));var attributes=require(_0x92cb('0x8'));module[_0x92cb('0x9')]=function(_0xdd5fa1,_0x3a7848){return _0xdd5fa1[_0x92cb('0xa')](_0x92cb('0xb'),attributes,{'tableName':_0x92cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14fa=['./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util','../../config/logger','api','moment','../../config/environment'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x14fa,0x199));var _0xa14f=function(_0x465ef6,_0x8adf2a){_0x465ef6=_0x465ef6-0x0;var _0x5cf599=_0x14fa[_0x465ef6];return _0x5cf599;};'use strict';var _=require('lodash');var util=require(_0xa14f('0x0'));var logger=require(_0xa14f('0x1'))(_0xa14f('0x2'));var moment=require(_0xa14f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa14f('0x4'));var attributes=require(_0xa14f('0x5'));module[_0xa14f('0x6')]=function(_0x239d2b,_0xfc770){return _0x239d2b[_0xa14f('0x7')]('JscriptyAnswerReport',attributes,{'tableName':_0xa14f('0x8'),'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 0063db4..cbf2ec8 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 _0xe1a1=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x4d233d,_0x4e3570){var _0x31c025=function(_0x1fc30c){while(--_0x1fc30c){_0x4d233d['push'](_0x4d233d['shift']());}};_0x31c025(++_0x4e3570);}(_0xe1a1,0xf0));var _0x1e1a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe1a1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1e1a('0x0'));var util=require(_0x1e1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e1a('0x2'));var fs=require('fs');var Redis=require(_0x1e1a('0x3'));var db=require(_0x1e1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e1a('0x5'))(_0x1e1a('0x6'));var config=require(_0x1e1a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e1a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2204de,_0x160a96,_0xa9f934){return new BPromise(function(_0x56ee8a,_0x253eee){return client['request'](_0x2204de,_0xa9f934)[_0x1e1a('0x9')](function(_0x150d8c){logger[_0x1e1a('0xa')](_0x1e1a('0xb'),_0x160a96,'request\x20sent');logger[_0x1e1a('0xc')](_0x1e1a('0xd'),_0x160a96,_0x1e1a('0xe'),JSON[_0x1e1a('0xf')](_0x150d8c));if(_0x150d8c['error']){if(_0x150d8c[_0x1e1a('0x10')][_0x1e1a('0x11')]===0x1f4){logger[_0x1e1a('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x160a96,_0x150d8c[_0x1e1a('0x10')]['message']);return _0x253eee(_0x150d8c[_0x1e1a('0x10')][_0x1e1a('0x12')]);}logger['error'](_0x1e1a('0xb'),_0x160a96,_0x150d8c[_0x1e1a('0x10')][_0x1e1a('0x12')]);return _0x56ee8a(_0x150d8c['error'][_0x1e1a('0x12')]);}else{logger['info'](_0x1e1a('0xb'),_0x160a96,_0x1e1a('0xe'));_0x56ee8a(_0x150d8c[_0x1e1a('0x13')][_0x1e1a('0x12')]);}})[_0x1e1a('0x14')](function(_0xbac19d){logger[_0x1e1a('0x10')](_0x1e1a('0xb'),_0x160a96,_0xbac19d);_0x253eee(_0xbac19d);});});} \ No newline at end of file +var _0x3c41=['info','request\x20sent','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x3c41,0xce));var _0x13c4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3c41[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x13c4('0x0'));var util=require('util');var moment=require(_0x13c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x13c4('0x2'));var fs=require('fs');var Redis=require(_0x13c4('0x3'));var db=require(_0x13c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x13c4('0x5'))('rpc');var config=require(_0x13c4('0x6'));var jayson=require(_0x13c4('0x7'));var client=jayson[_0x13c4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28347b,_0x115af9,_0xaef878){return new BPromise(function(_0x1f2b60,_0x259665){return client['request'](_0x28347b,_0xaef878)[_0x13c4('0x9')](function(_0x5db2a1){logger[_0x13c4('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x115af9,_0x13c4('0xb'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x115af9,'request\x20sent',JSON[_0x13c4('0xc')](_0x5db2a1));if(_0x5db2a1[_0x13c4('0xd')]){if(_0x5db2a1[_0x13c4('0xd')][_0x13c4('0xe')]===0x1f4){logger[_0x13c4('0xd')](_0x13c4('0xf'),_0x115af9,_0x5db2a1[_0x13c4('0xd')][_0x13c4('0x10')]);return _0x259665(_0x5db2a1[_0x13c4('0xd')]['message']);}logger[_0x13c4('0xd')](_0x13c4('0xf'),_0x115af9,_0x5db2a1[_0x13c4('0xd')][_0x13c4('0x10')]);return _0x1f2b60(_0x5db2a1[_0x13c4('0xd')][_0x13c4('0x10')]);}else{logger[_0x13c4('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x115af9,_0x13c4('0xb'));_0x1f2b60(_0x5db2a1['result'][_0x13c4('0x10')]);}})[_0x13c4('0x11')](function(_0x40f590){logger[_0x13c4('0xd')](_0x13c4('0xf'),_0x115af9,_0x40f590);_0x259665(_0x40f590);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c36680f..1aeb422 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 _0x2896=['/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create'];(function(_0x54abae,_0x154d8f){var _0x297e50=function(_0x1acbd6){while(--_0x1acbd6){_0x54abae['push'](_0x54abae['shift']());}};_0x297e50(++_0x154d8f);}(_0x2896,0x115));var _0x6289=function(_0x119799,_0x40cf39){_0x119799=_0x119799-0x0;var _0x66c3b6=_0x2896[_0x119799];return _0x66c3b6;};'use strict';var multer=require(_0x6289('0x0'));var util=require(_0x6289('0x1'));var path=require(_0x6289('0x2'));var timeout=require('connect-timeout');var express=require(_0x6289('0x3'));var router=express[_0x6289('0x4')]();var fs_extra=require(_0x6289('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6289('0x6'));var config=require(_0x6289('0x7'));var controller=require(_0x6289('0x8'));router[_0x6289('0x9')]('/',auth[_0x6289('0xa')](),controller['index']);router['get'](_0x6289('0xb'),auth[_0x6289('0xa')](),controller[_0x6289('0xc')]);router[_0x6289('0x9')]('/:id/sessions',auth[_0x6289('0xa')](),controller[_0x6289('0xd')]);router[_0x6289('0x9')](_0x6289('0xe'),auth[_0x6289('0xa')](),controller[_0x6289('0xf')]);router[_0x6289('0x9')](_0x6289('0x10'),auth['isAuthenticated'](),timeout(_0x6289('0x11')),controller['getSummary']);router[_0x6289('0x12')]('/',auth[_0x6289('0xa')](),controller[_0x6289('0x13')]);router[_0x6289('0x12')](_0x6289('0x14'),auth[_0x6289('0xa')](),controller[_0x6289('0x15')]);router[_0x6289('0x16')](_0x6289('0xb'),auth[_0x6289('0xa')](),controller[_0x6289('0x17')]);router[_0x6289('0x18')](_0x6289('0xb'),auth[_0x6289('0xa')](),controller[_0x6289('0x19')]);module[_0x6289('0x1a')]=router; \ No newline at end of file +var _0x4e7e=['fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','update','delete','destroy','exports','util','connect-timeout','Router'];(function(_0x104856,_0x3843c9){var _0x52eac3=function(_0x246346){while(--_0x246346){_0x104856['push'](_0x104856['shift']());}};_0x52eac3(++_0x3843c9);}(_0x4e7e,0x65));var _0xe4e7=function(_0x1aa82b,_0x18bf19){_0x1aa82b=_0x1aa82b-0x0;var _0x3c2709=_0x4e7e[_0x1aa82b];return _0x3c2709;};'use strict';var multer=require('multer');var util=require(_0xe4e7('0x0'));var path=require('path');var timeout=require(_0xe4e7('0x1'));var express=require('express');var router=express[_0xe4e7('0x2')]();var fs_extra=require(_0xe4e7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe4e7('0x4'));var config=require(_0xe4e7('0x5'));var controller=require(_0xe4e7('0x6'));router[_0xe4e7('0x7')]('/',auth[_0xe4e7('0x8')](),controller[_0xe4e7('0x9')]);router[_0xe4e7('0x7')](_0xe4e7('0xa'),auth['isAuthenticated'](),controller[_0xe4e7('0xb')]);router['get'](_0xe4e7('0xc'),auth[_0xe4e7('0x8')](),controller[_0xe4e7('0xd')]);router[_0xe4e7('0x7')](_0xe4e7('0xe'),auth['isAuthenticated'](),controller[_0xe4e7('0xf')]);router[_0xe4e7('0x7')](_0xe4e7('0x10'),auth[_0xe4e7('0x8')](),timeout(_0xe4e7('0x11')),controller['getSummary']);router[_0xe4e7('0x12')]('/',auth['isAuthenticated'](),controller[_0xe4e7('0x13')]);router[_0xe4e7('0x12')](_0xe4e7('0x14'),auth[_0xe4e7('0x8')](),controller[_0xe4e7('0x15')]);router['put'](_0xe4e7('0xa'),auth[_0xe4e7('0x8')](),controller[_0xe4e7('0x16')]);router[_0xe4e7('0x17')](_0xe4e7('0xa'),auth[_0xe4e7('0x8')](),controller[_0xe4e7('0x18')]);module[_0xe4e7('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 412cf82..eb258ba 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 _0x3b9e=['stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','long','setDataValue','formData'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x3b9e,0xc9));var _0xe3b9=function(_0x5e8dac,_0x4654a3){_0x5e8dac=_0x5e8dac-0x0;var _0x16086c=_0x3b9e[_0x5e8dac];return _0x16086c;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe3b9('0x0'));var util=require(_0xe3b9('0x1'));module['exports']={'name':{'type':Sequelize[_0xe3b9('0x2')],'unique':_0xe3b9('0x3')},'description':{'type':Sequelize[_0xe3b9('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xe3b9('0x4')),'set':function(_0x5bd69e){if(_['isObjectLike'](_0x5bd69e)){this[_0xe3b9('0x5')](_0xe3b9('0x6'),JSON[_0xe3b9('0x7')](_0x5bd69e));}else if(_[_0xe3b9('0x8')](_0x5bd69e)){this[_0xe3b9('0x5')]('formData',_0x5bd69e);}else{this[_0xe3b9('0x5')](_0xe3b9('0x6'),util['format'](_0xe3b9('0x9'),this[_0xe3b9('0xa')](_0xe3b9('0x3'))||'',this[_0xe3b9('0xa')](_0xe3b9('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe3b9('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe3b9('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xba09=['BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x4dbde4,_0x5f54ab){var _0x4f4de6=function(_0x1810e1){while(--_0x1810e1){_0x4dbde4['push'](_0x4dbde4['shift']());}};_0x4f4de6(++_0x5f54ab);}(_0xba09,0x160));var _0x9ba0=function(_0x150bf0,_0x3b0466){_0x150bf0=_0x150bf0-0x0;var _0x52698c=_0xba09[_0x150bf0];return _0x52698c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x9ba0('0x0'));var util=require(_0x9ba0('0x1'));module[_0x9ba0('0x2')]={'name':{'type':Sequelize[_0x9ba0('0x3')],'unique':_0x9ba0('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x9ba0('0x5')](_0x9ba0('0x6')),'set':function(_0x2414e2){if(_['isObjectLike'](_0x2414e2)){this[_0x9ba0('0x7')](_0x9ba0('0x8'),JSON[_0x9ba0('0x9')](_0x2414e2));}else if(_['isString'](_0x2414e2)){this[_0x9ba0('0x7')](_0x9ba0('0x8'),_0x2414e2);}else{this['setDataValue']('formData',util['format'](_0x9ba0('0xa'),this[_0x9ba0('0xb')]('name')||'',this[_0x9ba0('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9ba0('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9ba0('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 90fc1a3..e8f102c 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 _0x0b7f=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','createdAt','updatedAt','omit','role','UserProfileSection','findOne','hasOwnProperty','nolimit','ProjectId','JscriptySessionReport','JscriptyAnswerReport','pick','findAll','number','fromCharCode','apply','toString','indexOf','replace','getSummary','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','rawAttributes'];(function(_0xc8966a,_0x19753d){var _0x2a3be4=function(_0x5caf4e){while(--_0x5caf4e){_0xc8966a['push'](_0xc8966a['shift']());}};_0x2a3be4(++_0x19753d);}(_0x0b7f,0x115));var _0xf0b7=function(_0x4d12c2,_0x2ad644){_0x4d12c2=_0x4d12c2-0x0;var _0x18e9c6=_0x0b7f[_0x4d12c2];return _0x18e9c6;};'use strict';var emlformat=require(_0xf0b7('0x0'));var rimraf=require(_0xf0b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0b7('0x2'));var rp=require('request-promise');var moment=require(_0xf0b7('0x3'));var BPromise=require(_0xf0b7('0x4'));var Mustache=require(_0xf0b7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf0b7('0x6'));var csv=require(_0xf0b7('0x7'));var ejs=require(_0xf0b7('0x8'));var fs=require('fs');var fs_extra=require(_0xf0b7('0x9'));var _=require(_0xf0b7('0xa'));var squel=require('squel');var crypto=require(_0xf0b7('0xb'));var jsforce=require(_0xf0b7('0xc'));var deskjs=require(_0xf0b7('0xd'));var toCsv=require(_0xf0b7('0x7'));var querystring=require(_0xf0b7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf0b7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0b7('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf0b7('0x11'));var config=require(_0xf0b7('0x12'));var licenseUtil=require(_0xf0b7('0x13'));var db=require(_0xf0b7('0x14'))['db'];function respondWithStatusCode(_0x15e3e5,_0x217993){_0x217993=_0x217993||0xcc;return function(_0xbd18dc){if(_0xbd18dc){return _0x15e3e5[_0xf0b7('0x15')](_0x217993);}return _0x15e3e5['status'](_0x217993)['end']();};}function respondWithResult(_0x1c5d3f,_0x475d5b){_0x475d5b=_0x475d5b||0xc8;return function(_0x717ab0){if(_0x717ab0){return _0x1c5d3f[_0xf0b7('0x16')](_0x475d5b)[_0xf0b7('0x17')](_0x717ab0);}};}function respondWithFilteredResult(_0x514c24,_0x66d6e0){return function(_0x5c462){if(_0x5c462){var _0xfc8661=typeof _0x66d6e0[_0xf0b7('0x18')]==='undefined'&&typeof _0x66d6e0[_0xf0b7('0x19')]===_0xf0b7('0x1a');var _0x1e8825=_0x5c462[_0xf0b7('0x1b')];var _0x52b27e=_0xfc8661?0x0:_0x66d6e0[_0xf0b7('0x18')];var _0x153d23=_0xfc8661?_0x5c462[_0xf0b7('0x1b')]:_0x66d6e0[_0xf0b7('0x18')]+_0x66d6e0[_0xf0b7('0x19')];var _0x4b4c80;if(_0x153d23>=_0x1e8825){_0x153d23=_0x1e8825;_0x4b4c80=0xc8;}else{_0x4b4c80=0xce;}_0x514c24[_0xf0b7('0x16')](_0x4b4c80);return _0x514c24['set'](_0xf0b7('0x1c'),_0x52b27e+'-'+_0x153d23+'/'+_0x1e8825)[_0xf0b7('0x17')](_0x5c462);}return null;};}function patchUpdates(_0x374496){return function(_0x585394){try{jsonpatch['apply'](_0x585394,_0x374496,!![]);}catch(_0x2e7509){return BPromise[_0xf0b7('0x1d')](_0x2e7509);}return _0x585394[_0xf0b7('0x1e')]();};}function saveUpdates(_0x442e28,_0xb90b3c){return function(_0xc36f43){if(_0xc36f43){return _0xc36f43[_0xf0b7('0x1f')](_0x442e28)[_0xf0b7('0x20')](function(_0x2ca248){return _0x2ca248;});}return null;};}function removeEntity(_0x593e6a,_0x1b8e95){return function(_0x2cfb7b){if(_0x2cfb7b){return _0x2cfb7b[_0xf0b7('0x21')]()[_0xf0b7('0x20')](function(){var _0x2ba0da=_0x2cfb7b[_0xf0b7('0x22')]({'plain':!![]});var _0x4724f1=_0xf0b7('0x23');return db[_0xf0b7('0x24')][_0xf0b7('0x21')]({'where':{'type':_0x4724f1,'resourceId':_0x2ba0da['id']}})['then'](function(){return _0x2cfb7b;});})[_0xf0b7('0x20')](function(){_0x593e6a[_0xf0b7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d02e6,_0x1b58bb){return function(_0x3709a5){if(!_0x3709a5){_0x1d02e6['sendStatus'](0x194);}return _0x3709a5;};}function handleError(_0x2aedd3,_0x168f70){_0x168f70=_0x168f70||0x1f4;return function(_0x131097){logger['error'](_0x131097[_0xf0b7('0x25')]);if(_0x131097[_0xf0b7('0x26')]){delete _0x131097[_0xf0b7('0x26')];}_0x2aedd3[_0xf0b7('0x16')](_0x168f70)[_0xf0b7('0x27')](_0x131097);};}exports[_0xf0b7('0x28')]=function(_0x10643f,_0xf6a9cb){var _0x3cb0ef={},_0x976a8b={},_0x559510={'count':0x0,'rows':[]};var _0xd89848=_[_0xf0b7('0x29')](db[_0xf0b7('0x2a')]['rawAttributes'],function(_0x250186){return{'name':_0x250186[_0xf0b7('0x2b')],'type':_0x250186[_0xf0b7('0x2c')][_0xf0b7('0x2d')]};});_0x976a8b[_0xf0b7('0x2e')]=_[_0xf0b7('0x29')](_0xd89848,_0xf0b7('0x26'));_0x976a8b[_0xf0b7('0x2f')]=_[_0xf0b7('0x30')](_0x10643f['query']);_0x976a8b[_0xf0b7('0x31')]=_['intersection'](_0x976a8b['model'],_0x976a8b[_0xf0b7('0x2f')]);_0x3cb0ef['attributes']=_[_0xf0b7('0x32')](_0x976a8b[_0xf0b7('0x2e')],qs[_0xf0b7('0x33')](_0x10643f[_0xf0b7('0x2f')]['fields']));_0x3cb0ef[_0xf0b7('0x34')]=_0x3cb0ef[_0xf0b7('0x34')][_0xf0b7('0x35')]?_0x3cb0ef[_0xf0b7('0x34')]:_0x976a8b['model'];if(!_0x10643f[_0xf0b7('0x2f')]['hasOwnProperty']('nolimit')){_0x3cb0ef['limit']=qs['limit'](_0x10643f['query'][_0xf0b7('0x19')]);_0x3cb0ef[_0xf0b7('0x18')]=qs[_0xf0b7('0x18')](_0x10643f[_0xf0b7('0x2f')][_0xf0b7('0x18')]);}_0x3cb0ef[_0xf0b7('0x36')]=qs[_0xf0b7('0x37')](_0x10643f[_0xf0b7('0x2f')][_0xf0b7('0x37')]);_0x3cb0ef['where']=qs[_0xf0b7('0x31')](_['pick'](_0x10643f[_0xf0b7('0x2f')],_0x976a8b['filters']),_0xd89848);if(_0x10643f[_0xf0b7('0x2f')][_0xf0b7('0x38')]){_0x3cb0ef[_0xf0b7('0x39')]=_['merge'](_0x3cb0ef[_0xf0b7('0x39')],{'$or':_[_0xf0b7('0x29')](_0xd89848,function(_0x286556){if(_0x286556['type']!==_0xf0b7('0x3a')){var _0x6adffa={};_0x6adffa[_0x286556[_0xf0b7('0x26')]]={'$like':'%'+_0x10643f[_0xf0b7('0x2f')][_0xf0b7('0x38')]+'%'};return _0x6adffa;}})});}_0x3cb0ef=_[_0xf0b7('0x3b')]({},_0x3cb0ef,_0x10643f[_0xf0b7('0x3c')]);var _0x144f7a={'where':_0x3cb0ef['where']};return db[_0xf0b7('0x2a')][_0xf0b7('0x1b')](_0x144f7a)[_0xf0b7('0x20')](function(_0x46133f){_0x559510[_0xf0b7('0x1b')]=_0x46133f;if(_0x10643f[_0xf0b7('0x2f')][_0xf0b7('0x3d')]){_0x3cb0ef[_0xf0b7('0x3e')]=[{'all':!![]}];}return db[_0xf0b7('0x2a')]['findAll'](_0x3cb0ef);})[_0xf0b7('0x20')](function(_0x34e815){_0x559510[_0xf0b7('0x3f')]=_0x34e815;return _0x559510;})[_0xf0b7('0x20')](respondWithFilteredResult(_0xf6a9cb,_0x3cb0ef))['catch'](handleError(_0xf6a9cb,null));};exports['show']=function(_0x101f1b,_0xb08ec4){var _0x6925={'raw':![],'where':{'id':_0x101f1b['params']['id']}},_0xa9ddaa={};_0xa9ddaa[_0xf0b7('0x2e')]=_[_0xf0b7('0x30')](db[_0xf0b7('0x2a')][_0xf0b7('0x40')]);_0xa9ddaa[_0xf0b7('0x2f')]=_['keys'](_0x101f1b[_0xf0b7('0x2f')]);_0xa9ddaa[_0xf0b7('0x31')]=_['intersection'](_0xa9ddaa['model'],_0xa9ddaa[_0xf0b7('0x2f')]);_0x6925[_0xf0b7('0x34')]=_[_0xf0b7('0x32')](_0xa9ddaa[_0xf0b7('0x2e')],qs['fields'](_0x101f1b[_0xf0b7('0x2f')][_0xf0b7('0x33')]));_0x6925[_0xf0b7('0x34')]=_0x6925[_0xf0b7('0x34')][_0xf0b7('0x35')]?_0x6925['attributes']:_0xa9ddaa[_0xf0b7('0x2e')];if(_0x101f1b[_0xf0b7('0x2f')]['includeAll']){_0x6925[_0xf0b7('0x3e')]=[{'all':!![]}];}_0x6925=_[_0xf0b7('0x3b')]({},_0x6925,_0x101f1b[_0xf0b7('0x3c')]);return db['JscriptyProject'][_0xf0b7('0x41')](_0x6925)[_0xf0b7('0x20')](handleEntityNotFound(_0xb08ec4,null))[_0xf0b7('0x20')](respondWithResult(_0xb08ec4,null))['catch'](handleError(_0xb08ec4,null));};exports[_0xf0b7('0x42')]=function(_0x43b482,_0xe765d4){return db[_0xf0b7('0x2a')][_0xf0b7('0x42')](_0x43b482[_0xf0b7('0x43')],{})[_0xf0b7('0x20')](function(_0xca1957){var _0x11d0a=_0x43b482[_0xf0b7('0x44')][_0xf0b7('0x22')]({'plain':!![]});if(!_0x11d0a)throw new Error(_0xf0b7('0x45'));if(_0x11d0a['role']===_0xf0b7('0x44')){var _0x21100c=_0xca1957[_0xf0b7('0x22')]({'plain':!![]});var _0x3e808e='Projects';return db['UserProfileSection'][_0xf0b7('0x41')]({'where':{'name':_0x3e808e,'userProfileId':_0x11d0a[_0xf0b7('0x46')]},'raw':!![]})[_0xf0b7('0x20')](function(_0x2ce3d1){if(_0x2ce3d1&&_0x2ce3d1[_0xf0b7('0x47')]===0x0){return db[_0xf0b7('0x24')][_0xf0b7('0x42')]({'name':_0x21100c['name'],'resourceId':_0x21100c['id'],'type':_0x2ce3d1['name'],'sectionId':_0x2ce3d1['id']},{})[_0xf0b7('0x20')](function(){return _0xca1957;});}else{return _0xca1957;}})['catch'](function(_0x484089){logger[_0xf0b7('0x48')](_0xf0b7('0x49'),_0x484089);throw _0x484089;});}return _0xca1957;})['then'](respondWithResult(_0xe765d4,0xc9))[_0xf0b7('0x4a')](handleError(_0xe765d4,null));};exports['clone']=function(_0x46cd93,_0x43ae1e){var _0x143c14={'where':{'id':_0x46cd93[_0xf0b7('0x4b')]['id']}},_0x3a30be={};_0x3a30be[_0xf0b7('0x2e')]=_[_0xf0b7('0x30')](db[_0xf0b7('0x2a')][_0xf0b7('0x40')]);_0x143c14['attributes']=_['intersection'](_0x3a30be[_0xf0b7('0x2e')],qs['fields'](_0x46cd93[_0xf0b7('0x2f')][_0xf0b7('0x33')]));_0x143c14[_0xf0b7('0x34')]=_0x143c14[_0xf0b7('0x34')][_0xf0b7('0x35')]?_0x143c14[_0xf0b7('0x34')]:_0x3a30be[_0xf0b7('0x2e')];if(_0x46cd93[_0xf0b7('0x2f')]['includeAll']){_0x143c14[_0xf0b7('0x3e')]=[{'all':!![]}];}_0x143c14=_[_0xf0b7('0x3b')]({},_0x143c14,_0x46cd93[_0xf0b7('0x3c')]);return db[_0xf0b7('0x2a')]['find'](_0x143c14)['then'](handleEntityNotFound(_0x43ae1e,null))[_0xf0b7('0x20')](function(_0x3732e6){if(_0x3732e6){var _0x72ed49=_0x3732e6[_0xf0b7('0x22')]({'plain':!![]});_0x72ed49=qs['omit'](_0x72ed49,['id',_0xf0b7('0x4c'),_0xf0b7('0x4d')]);_0x46cd93['body']=_[_0xf0b7('0x4e')](_0x46cd93['body'],['id',_0xf0b7('0x4c'),_0xf0b7('0x4d')]);return db[_0xf0b7('0x2a')][_0xf0b7('0x42')](_[_0xf0b7('0x3b')](_0x72ed49,_0x46cd93[_0xf0b7('0x43')]),{'include':_0x46cd93[_0xf0b7('0x2f')][_0xf0b7('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0xe94050){var _0xd7e02d=_0x46cd93['user']['get']({'plain':!![]});if(!_0xd7e02d)throw new Error(_0xf0b7('0x45'));if(_0xd7e02d[_0xf0b7('0x4f')]===_0xf0b7('0x44')){var _0x4f1e4f=_0xe94050[_0xf0b7('0x22')]({'plain':!![]});var _0x4c8e90=_0xf0b7('0x23');return db[_0xf0b7('0x50')][_0xf0b7('0x41')]({'where':{'name':_0x4c8e90,'userProfileId':_0xd7e02d[_0xf0b7('0x46')]},'raw':!![]})['then'](function(_0xa104d4){if(_0xa104d4&&_0xa104d4[_0xf0b7('0x47')]===0x0){return db[_0xf0b7('0x24')][_0xf0b7('0x42')]({'name':_0x4f1e4f['name'],'resourceId':_0x4f1e4f['id'],'type':_0xa104d4[_0xf0b7('0x26')],'sectionId':_0xa104d4['id']},{})[_0xf0b7('0x20')](function(){return _0xe94050;});}else{return _0xe94050;}})['catch'](function(_0x4a9412){logger[_0xf0b7('0x48')](_0xf0b7('0x49'),_0x4a9412);throw _0x4a9412;});}return _0xe94050;});}})[_0xf0b7('0x20')](respondWithResult(_0x43ae1e,0xc9))['catch'](handleError(_0x43ae1e,null));};exports[_0xf0b7('0x1f')]=function(_0xc0db18,_0x12f3d6){if(_0xc0db18['body']['id']){delete _0xc0db18[_0xf0b7('0x43')]['id'];}return db[_0xf0b7('0x2a')]['find']({'where':{'id':_0xc0db18[_0xf0b7('0x4b')]['id']}})[_0xf0b7('0x20')](handleEntityNotFound(_0x12f3d6,null))[_0xf0b7('0x20')](saveUpdates(_0xc0db18[_0xf0b7('0x43')],null))['then'](respondWithResult(_0x12f3d6,null))['catch'](handleError(_0x12f3d6,null));};exports[_0xf0b7('0x21')]=function(_0x3db21c,_0x32c465){return db[_0xf0b7('0x2a')][_0xf0b7('0x41')]({'where':{'id':_0x3db21c[_0xf0b7('0x4b')]['id']}})[_0xf0b7('0x20')](handleEntityNotFound(_0x32c465,null))[_0xf0b7('0x20')](removeEntity(_0x32c465,null))['catch'](handleError(_0x32c465,null));};exports['getSessions']=function(_0xce0f8,_0x5ba172,_0x166b6d){var _0x16097b={'raw':!![],'where':{}};var _0x131694={};var _0x2ed36b={'count':0x0,'rows':[]};return db[_0xf0b7('0x2a')][_0xf0b7('0x51')]({'where':{'id':_0xce0f8[_0xf0b7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5ba172,null))[_0xf0b7('0x20')](function(_0x519b0c){if(_0x519b0c){_0x131694[_0xf0b7('0x2e')]=_[_0xf0b7('0x30')](db['JscriptySessionReport']['rawAttributes']);_0x131694[_0xf0b7('0x2f')]=_[_0xf0b7('0x30')](_0xce0f8['query']);_0x131694['filters']=_[_0xf0b7('0x32')](_0x131694[_0xf0b7('0x2e')],_0x131694[_0xf0b7('0x2f')]);_0x16097b['attributes']=_[_0xf0b7('0x32')](_0x131694[_0xf0b7('0x2e')],qs['fields'](_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x33')]));_0x16097b[_0xf0b7('0x34')]=_0x16097b['attributes']['length']?_0x16097b[_0xf0b7('0x34')]:_0x131694[_0xf0b7('0x2e')];if(!_0xce0f8['query'][_0xf0b7('0x52')](_0xf0b7('0x53'))){_0x16097b[_0xf0b7('0x19')]=qs[_0xf0b7('0x19')](_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x19')]);_0x16097b[_0xf0b7('0x18')]=qs['offset'](_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x18')]);}_0x16097b['order']=qs[_0xf0b7('0x37')](_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x37')]);_0x16097b[_0xf0b7('0x39')]=qs[_0xf0b7('0x31')](_['pick'](_0xce0f8[_0xf0b7('0x2f')],_0x131694[_0xf0b7('0x31')]));_0x16097b['where'][_0xf0b7('0x54')]=_0x519b0c['id'];if(_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x38')]){_0x16097b[_0xf0b7('0x39')]=_['merge'](_0x16097b[_0xf0b7('0x39')],{'$or':_[_0xf0b7('0x29')](_0x16097b[_0xf0b7('0x34')],function(_0x1d1358){var _0x30d5c0={};_0x30d5c0[_0x1d1358]={'$like':'%'+_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x38')]+'%'};return _0x30d5c0;})});}_0x16097b=_['merge']({},_0x16097b,_0xce0f8[_0xf0b7('0x3c')]);return db[_0xf0b7('0x55')][_0xf0b7('0x1b')]({'where':_0x16097b['where']})[_0xf0b7('0x20')](function(_0x229a40){_0x2ed36b['count']=_0x229a40;if(_0xce0f8[_0xf0b7('0x2f')][_0xf0b7('0x3d')]){_0x16097b[_0xf0b7('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x16097b);})[_0xf0b7('0x20')](function(_0x309f23){_0x2ed36b[_0xf0b7('0x3f')]=_0x309f23;return _0x2ed36b;});}})[_0xf0b7('0x20')](respondWithFilteredResult(_0x5ba172,_0x16097b))[_0xf0b7('0x4a')](handleError(_0x5ba172,null));};exports['getAnswers']=function(_0x71352,_0x5b9d8c,_0x438adf){var _0x7a7aef={'raw':!![],'where':{}};var _0x35196a={};var _0x1009ca={'count':0x0,'rows':[]};return db[_0xf0b7('0x2a')][_0xf0b7('0x51')]({'where':{'id':_0x71352[_0xf0b7('0x4b')]['id']}})[_0xf0b7('0x20')](handleEntityNotFound(_0x5b9d8c,null))[_0xf0b7('0x20')](function(_0x6cdead){if(_0x6cdead){_0x35196a['model']=_[_0xf0b7('0x30')](db[_0xf0b7('0x56')][_0xf0b7('0x40')]);_0x35196a[_0xf0b7('0x2f')]=_[_0xf0b7('0x30')](_0x71352[_0xf0b7('0x2f')]);_0x35196a[_0xf0b7('0x31')]=_['intersection'](_0x35196a['model'],_0x35196a[_0xf0b7('0x2f')]);_0x7a7aef[_0xf0b7('0x34')]=_['intersection'](_0x35196a[_0xf0b7('0x2e')],qs[_0xf0b7('0x33')](_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x33')]));_0x7a7aef[_0xf0b7('0x34')]=_0x7a7aef['attributes'][_0xf0b7('0x35')]?_0x7a7aef['attributes']:_0x35196a[_0xf0b7('0x2e')];if(!_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x52')](_0xf0b7('0x53'))){_0x7a7aef[_0xf0b7('0x19')]=qs[_0xf0b7('0x19')](_0x71352['query'][_0xf0b7('0x19')]);_0x7a7aef[_0xf0b7('0x18')]=qs[_0xf0b7('0x18')](_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x18')]);}_0x7a7aef[_0xf0b7('0x36')]=qs[_0xf0b7('0x37')](_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x37')]);_0x7a7aef[_0xf0b7('0x39')]=qs[_0xf0b7('0x31')](_[_0xf0b7('0x57')](_0x71352[_0xf0b7('0x2f')],_0x35196a[_0xf0b7('0x31')]));_0x7a7aef[_0xf0b7('0x39')][_0xf0b7('0x54')]=_0x6cdead['id'];if(_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x38')]){_0x7a7aef[_0xf0b7('0x39')]=_[_0xf0b7('0x3b')](_0x7a7aef[_0xf0b7('0x39')],{'$or':_[_0xf0b7('0x29')](_0x7a7aef[_0xf0b7('0x34')],function(_0x5dd527){var _0x39320a={};_0x39320a[_0x5dd527]={'$like':'%'+_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x38')]+'%'};return _0x39320a;})});}_0x7a7aef=_['merge']({},_0x7a7aef,_0x71352['options']);return db[_0xf0b7('0x56')][_0xf0b7('0x1b')]({'where':_0x7a7aef[_0xf0b7('0x39')]})[_0xf0b7('0x20')](function(_0x4a1156){_0x1009ca['count']=_0x4a1156;if(_0x71352[_0xf0b7('0x2f')][_0xf0b7('0x3d')]){_0x7a7aef['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf0b7('0x58')](_0x7a7aef);})['then'](function(_0x201fd8){_0x1009ca[_0xf0b7('0x3f')]=_0x201fd8;return _0x1009ca;});}})[_0xf0b7('0x20')](respondWithFilteredResult(_0x5b9d8c,_0x7a7aef))[_0xf0b7('0x4a')](handleError(_0x5b9d8c,null));};function char(_0x56d641){return _0xf0b7('0x59')===typeof _0x56d641?String[_0xf0b7('0x5a')][_0xf0b7('0x5b')](null,arguments):_0x56d641;}function needsEncapsulation(_0x318b08){return!!_0x318b08&&(_0x318b08[_0xf0b7('0x5c')]()[_0xf0b7('0x5d')](char(0xd))>=0x0||_0x318b08[_0xf0b7('0x5c')]()[_0xf0b7('0x5d')](char(0xa))>=0x0||_0x318b08['toString']()[_0xf0b7('0x5d')](char(0x2c))>=0x0||_0x318b08['toString']()[_0xf0b7('0x5d')](char(0x22))>=0x0);}function encapsulate(_0xf2b938){var _0x453d8f=char(0x22),_0x5cf2b6='\x5c'+char(0x22),_0x36dfbd=_0xf2b938[_0xf0b7('0x5c')]()[_0xf0b7('0x5e')](new RegExp(_0x453d8f,'g'),_0x5cf2b6);return _0x453d8f+_0x36dfbd+_0x453d8f;}exports[_0xf0b7('0x5f')]=function(_0x273e29,_0x7a987b,_0xdf9b7b){var _0x411b22,_0x457be8;var _0x52d793={'where':{'ProjectId':_0x273e29[_0xf0b7('0x4b')]['id']}};if(_0x273e29[_0xf0b7('0x2f')]['startTime']){_0x52d793[_0xf0b7('0x39')][_0xf0b7('0x60')]=JSON[_0xf0b7('0x61')](_0x273e29[_0xf0b7('0x2f')]['startTime']);}return db[_0xf0b7('0x55')][_0xf0b7('0x58')](_0x52d793)[_0xf0b7('0x20')](handleEntityNotFound(_0x7a987b,null))['then'](function(_0x1b8a10){if(_0x1b8a10){_0x411b22=_0x1b8a10;return db[_0xf0b7('0x62')][_0xf0b7('0x58')]({'where':{'SessionId':{'$in':_[_0xf0b7('0x29')](_0x411b22,'id')},'ProjectId':_0x273e29[_0xf0b7('0x4b')]['id']},'order':_0xf0b7('0x63')});}})[_0xf0b7('0x20')](handleEntityNotFound(_0x7a987b,null))[_0xf0b7('0x20')](function(_0x245165){if(_0x245165){_0x457be8=_0x245165;var _0x26fe3c={};for(var _0x4dd397=0x0,_0x450533=_0x457be8[_0xf0b7('0x35')];_0x4dd397<_0x450533;_0x4dd397++){if(!_0x26fe3c[_0xf0b7('0x52')](_0x457be8[_0x4dd397]['questionId'])){_0x26fe3c[_0x457be8[_0x4dd397][_0xf0b7('0x64')]]=needsEncapsulation(_0x457be8[_0x4dd397][_0xf0b7('0x65')])?encapsulate(_0x457be8[_0x4dd397][_0xf0b7('0x65')]):_0x457be8[_0x4dd397]['question'];}}var _0x570544=[],_0x3c7443={};for(var _0x2c3e0b=0x0,_0x34df23=_0x411b22[_0xf0b7('0x35')];_0x2c3e0b<_0x34df23;_0x2c3e0b++){_0x3c7443={'ProjectId':_0x273e29[_0xf0b7('0x4b')]['id'],'SessionId':_0x411b22[_0x2c3e0b]['id'],'StartTime':moment(_0x411b22[_0x2c3e0b][_0xf0b7('0x60')])[_0xf0b7('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xe02189=0x0,_0x57bb87=_0x457be8[_0xf0b7('0x35')];_0xe02189<_0x57bb87;_0xe02189++){if(_0x457be8[_0xe02189]['SessionId']==_0x411b22[_0x2c3e0b]['id']&&_0x26fe3c[_0xf0b7('0x52')](_0x457be8[_0xe02189][_0xf0b7('0x64')])){_0x3c7443[_0x26fe3c[_0x457be8[_0xe02189][_0xf0b7('0x64')]]]=_0x457be8[_0xe02189][_0xf0b7('0x67')];}}for(var _0x3d0bbd in _0x26fe3c){if(!_0x3c7443[_0xf0b7('0x52')](_0x26fe3c[_0x3d0bbd])){_0x3c7443[_0x26fe3c[_0x3d0bbd]]=null;}}_0x570544[_0xf0b7('0x68')](_0x3c7443);}return _0x570544;}})[_0xf0b7('0x20')](function(_0x4c0e9f){if(!_[_0xf0b7('0x69')](_0x4c0e9f)){var _0x8e1322=toCsv(_0x4c0e9f);var _0x5a7db9=Date[_0xf0b7('0x6a')]();fs['writeFileSync'](util[_0xf0b7('0x66')](_0xf0b7('0x6b'),_0x273e29[_0xf0b7('0x4b')]['id'],_0x5a7db9),_0x8e1322);_0x7a987b['setHeader']('Content-disposition',_0xf0b7('0x6c')+util[_0xf0b7('0x66')](_0xf0b7('0x6d'),_0x273e29[_0xf0b7('0x4b')]['id'],_0x5a7db9));_0x7a987b[_0xf0b7('0x6e')](_0xf0b7('0x6f'),_0xf0b7('0x70'));return _0x7a987b[_0xf0b7('0x71')](util[_0xf0b7('0x66')](_0xf0b7('0x6b'),_0x273e29['params']['id'],_0x5a7db9));}else{return _0x7a987b[_0xf0b7('0x15')](0xcc);}})[_0xf0b7('0x4a')](handleError(_0x7a987b,null));}; \ No newline at end of file +var _0xa503=['name','index','map','JscriptyProject','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','pick','ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','writeFileSync','format','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','end','stack'];(function(_0x478d8c,_0x3341c1){var _0x3f343a=function(_0x5d2b2a){while(--_0x5d2b2a){_0x478d8c['push'](_0x478d8c['shift']());}};_0x3f343a(++_0x3341c1);}(_0xa503,0x143));var _0x3a50=function(_0x46e953,_0x38f5df){_0x46e953=_0x46e953-0x0;var _0x505a64=_0xa503[_0x46e953];return _0x505a64;};'use strict';var emlformat=require(_0x3a50('0x0'));var rimraf=require(_0x3a50('0x1'));var zipdir=require(_0x3a50('0x2'));var jsonpatch=require(_0x3a50('0x3'));var rp=require(_0x3a50('0x4'));var moment=require(_0x3a50('0x5'));var BPromise=require(_0x3a50('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a50('0x7'));var sox=require(_0x3a50('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a50('0x9'));var _=require(_0x3a50('0xa'));var squel=require(_0x3a50('0xb'));var crypto=require(_0x3a50('0xc'));var jsforce=require(_0x3a50('0xd'));var deskjs=require(_0x3a50('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a50('0xf'));var Papa=require(_0x3a50('0x10'));var Redis=require(_0x3a50('0x11'));var authService=require(_0x3a50('0x12'));var qs=require(_0x3a50('0x13'));var as=require(_0x3a50('0x14'));var hardwareService=require(_0x3a50('0x15'));var logger=require('../../config/logger')(_0x3a50('0x16'));var utils=require(_0x3a50('0x17'));var config=require(_0x3a50('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a50('0x19'))['db'];function respondWithStatusCode(_0x4e9a5a,_0x1719c8){_0x1719c8=_0x1719c8||0xcc;return function(_0x401060){if(_0x401060){return _0x4e9a5a[_0x3a50('0x1a')](_0x1719c8);}return _0x4e9a5a[_0x3a50('0x1b')](_0x1719c8)['end']();};}function respondWithResult(_0x4762e2,_0x54cb88){_0x54cb88=_0x54cb88||0xc8;return function(_0x2aeba7){if(_0x2aeba7){return _0x4762e2[_0x3a50('0x1b')](_0x54cb88)[_0x3a50('0x1c')](_0x2aeba7);}};}function respondWithFilteredResult(_0x260374,_0x51aa93){return function(_0x55365e){if(_0x55365e){var _0x4b8971=typeof _0x51aa93[_0x3a50('0x1d')]===_0x3a50('0x1e')&&typeof _0x51aa93['limit']==='undefined';var _0x49f294=_0x55365e['count'];var _0x176e85=_0x4b8971?0x0:_0x51aa93[_0x3a50('0x1d')];var _0xaa2e18=_0x4b8971?_0x55365e[_0x3a50('0x1f')]:_0x51aa93['offset']+_0x51aa93[_0x3a50('0x20')];var _0x4d9c37;if(_0xaa2e18>=_0x49f294){_0xaa2e18=_0x49f294;_0x4d9c37=0xc8;}else{_0x4d9c37=0xce;}_0x260374[_0x3a50('0x1b')](_0x4d9c37);return _0x260374[_0x3a50('0x21')](_0x3a50('0x22'),_0x176e85+'-'+_0xaa2e18+'/'+_0x49f294)[_0x3a50('0x1c')](_0x55365e);}return null;};}function patchUpdates(_0x1871df){return function(_0x231a24){try{jsonpatch[_0x3a50('0x23')](_0x231a24,_0x1871df,!![]);}catch(_0x42c445){return BPromise[_0x3a50('0x24')](_0x42c445);}return _0x231a24[_0x3a50('0x25')]();};}function saveUpdates(_0x4081ba,_0x505bdc){return function(_0x3d2b0c){if(_0x3d2b0c){return _0x3d2b0c[_0x3a50('0x26')](_0x4081ba)['then'](function(_0x219f34){return _0x219f34;});}return null;};}function removeEntity(_0x33333f,_0x51f153){return function(_0x1e7f1c){if(_0x1e7f1c){return _0x1e7f1c[_0x3a50('0x27')]()[_0x3a50('0x28')](function(){var _0xbd8b18=_0x1e7f1c[_0x3a50('0x29')]({'plain':!![]});var _0xc4adc7=_0x3a50('0x2a');return db[_0x3a50('0x2b')][_0x3a50('0x27')]({'where':{'type':_0xc4adc7,'resourceId':_0xbd8b18['id']}})[_0x3a50('0x28')](function(){return _0x1e7f1c;});})[_0x3a50('0x28')](function(){_0x33333f[_0x3a50('0x1b')](0xcc)[_0x3a50('0x2c')]();});}};}function handleEntityNotFound(_0x267e0b,_0x357298){return function(_0xca5e99){if(!_0xca5e99){_0x267e0b[_0x3a50('0x1a')](0x194);}return _0xca5e99;};}function handleError(_0x253b13,_0x232efd){_0x232efd=_0x232efd||0x1f4;return function(_0x4dc6c8){logger['error'](_0x4dc6c8[_0x3a50('0x2d')]);if(_0x4dc6c8[_0x3a50('0x2e')]){delete _0x4dc6c8[_0x3a50('0x2e')];}_0x253b13['status'](_0x232efd)['send'](_0x4dc6c8);};}exports[_0x3a50('0x2f')]=function(_0x235e7b,_0x7e3dff){var _0x5ae379={},_0x202abc={},_0x119bb7={'count':0x0,'rows':[]};var _0x5f179a=_[_0x3a50('0x30')](db[_0x3a50('0x31')]['rawAttributes'],function(_0xaf4f0f){return{'name':_0xaf4f0f[_0x3a50('0x32')],'type':_0xaf4f0f['type'][_0x3a50('0x33')]};});_0x202abc[_0x3a50('0x34')]=_['map'](_0x5f179a,'name');_0x202abc[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x235e7b[_0x3a50('0x35')]);_0x202abc[_0x3a50('0x37')]=_['intersection'](_0x202abc['model'],_0x202abc[_0x3a50('0x35')]);_0x5ae379[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x202abc[_0x3a50('0x34')],qs['fields'](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x5ae379[_0x3a50('0x38')]=_0x5ae379[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x5ae379[_0x3a50('0x38')]:_0x202abc['model'];if(!_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x5ae379[_0x3a50('0x20')]=qs['limit'](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x20')]);_0x5ae379[_0x3a50('0x1d')]=qs[_0x3a50('0x1d')](_0x235e7b[_0x3a50('0x35')]['offset']);}_0x5ae379[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0x235e7b[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x5ae379['where']=qs['filters'](_['pick'](_0x235e7b[_0x3a50('0x35')],_0x202abc[_0x3a50('0x37')]),_0x5f179a);if(_0x235e7b[_0x3a50('0x35')][_0x3a50('0x40')]){_0x5ae379[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x5ae379['where'],{'$or':_[_0x3a50('0x30')](_0x5f179a,function(_0x4fee36){if(_0x4fee36[_0x3a50('0x43')]!==_0x3a50('0x44')){var _0x55ddd5={};_0x55ddd5[_0x4fee36[_0x3a50('0x2e')]]={'$like':'%'+_0x235e7b[_0x3a50('0x35')]['filter']+'%'};return _0x55ddd5;}})});}_0x5ae379=_[_0x3a50('0x42')]({},_0x5ae379,_0x235e7b[_0x3a50('0x45')]);var _0x2552b5={'where':_0x5ae379[_0x3a50('0x41')]};return db['JscriptyProject'][_0x3a50('0x1f')](_0x2552b5)[_0x3a50('0x28')](function(_0xd48e4b){_0x119bb7[_0x3a50('0x1f')]=_0xd48e4b;if(_0x235e7b[_0x3a50('0x35')][_0x3a50('0x46')]){_0x5ae379[_0x3a50('0x47')]=[{'all':!![]}];}return db[_0x3a50('0x31')]['findAll'](_0x5ae379);})[_0x3a50('0x28')](function(_0x403b8c){_0x119bb7[_0x3a50('0x48')]=_0x403b8c;return _0x119bb7;})[_0x3a50('0x28')](respondWithFilteredResult(_0x7e3dff,_0x5ae379))[_0x3a50('0x49')](handleError(_0x7e3dff,null));};exports[_0x3a50('0x4a')]=function(_0x5a881b,_0x189f05){var _0x280a75={'raw':![],'where':{'id':_0x5a881b[_0x3a50('0x4b')]['id']}},_0x54c9f9={};_0x54c9f9[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x31')][_0x3a50('0x4c')]);_0x54c9f9[_0x3a50('0x35')]=_['keys'](_0x5a881b[_0x3a50('0x35')]);_0x54c9f9[_0x3a50('0x37')]=_[_0x3a50('0x39')](_0x54c9f9['model'],_0x54c9f9['query']);_0x280a75[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x54c9f9['model'],qs[_0x3a50('0x3a')](_0x5a881b[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x280a75[_0x3a50('0x38')]=_0x280a75['attributes'][_0x3a50('0x3b')]?_0x280a75[_0x3a50('0x38')]:_0x54c9f9[_0x3a50('0x34')];if(_0x5a881b[_0x3a50('0x35')][_0x3a50('0x46')]){_0x280a75[_0x3a50('0x47')]=[{'all':!![]}];}_0x280a75=_['merge']({},_0x280a75,_0x5a881b[_0x3a50('0x45')]);return db[_0x3a50('0x31')]['find'](_0x280a75)[_0x3a50('0x28')](handleEntityNotFound(_0x189f05,null))[_0x3a50('0x28')](respondWithResult(_0x189f05,null))[_0x3a50('0x49')](handleError(_0x189f05,null));};exports['create']=function(_0x139e7e,_0x341d99){return db['JscriptyProject'][_0x3a50('0x4d')](_0x139e7e['body'],{})[_0x3a50('0x28')](function(_0x241569){var _0x3757d9=_0x139e7e[_0x3a50('0x4e')]['get']({'plain':!![]});if(!_0x3757d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3757d9[_0x3a50('0x4f')]===_0x3a50('0x4e')){var _0x453901=_0x241569[_0x3a50('0x29')]({'plain':!![]});var _0x78a968='Projects';return db[_0x3a50('0x50')][_0x3a50('0x51')]({'where':{'name':_0x78a968,'userProfileId':_0x3757d9[_0x3a50('0x52')]},'raw':!![]})[_0x3a50('0x28')](function(_0x39ce27){if(_0x39ce27&&_0x39ce27[_0x3a50('0x53')]===0x0){return db['UserProfileResource'][_0x3a50('0x4d')]({'name':_0x453901[_0x3a50('0x2e')],'resourceId':_0x453901['id'],'type':_0x39ce27['name'],'sectionId':_0x39ce27['id']},{})[_0x3a50('0x28')](function(){return _0x241569;});}else{return _0x241569;}})[_0x3a50('0x49')](function(_0x5a9a5e){logger[_0x3a50('0x54')](_0x3a50('0x55'),_0x5a9a5e);throw _0x5a9a5e;});}return _0x241569;})[_0x3a50('0x28')](respondWithResult(_0x341d99,0xc9))['catch'](handleError(_0x341d99,null));};exports['clone']=function(_0x33ebad,_0x38535a){var _0x1de526={'where':{'id':_0x33ebad[_0x3a50('0x4b')]['id']}},_0x194529={};_0x194529[_0x3a50('0x34')]=_[_0x3a50('0x36')](db[_0x3a50('0x31')][_0x3a50('0x4c')]);_0x1de526['attributes']=_['intersection'](_0x194529[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x33ebad[_0x3a50('0x35')][_0x3a50('0x3a')]));_0x1de526['attributes']=_0x1de526[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x1de526[_0x3a50('0x38')]:_0x194529['model'];if(_0x33ebad[_0x3a50('0x35')][_0x3a50('0x46')]){_0x1de526[_0x3a50('0x47')]=[{'all':!![]}];}_0x1de526=_[_0x3a50('0x42')]({},_0x1de526,_0x33ebad[_0x3a50('0x45')]);return db['JscriptyProject'][_0x3a50('0x51')](_0x1de526)['then'](handleEntityNotFound(_0x38535a,null))[_0x3a50('0x28')](function(_0x4bd89f){if(_0x4bd89f){var _0x5204c5=_0x4bd89f['get']({'plain':!![]});_0x5204c5=qs[_0x3a50('0x56')](_0x5204c5,['id',_0x3a50('0x57'),_0x3a50('0x58')]);_0x33ebad[_0x3a50('0x59')]=_[_0x3a50('0x56')](_0x33ebad[_0x3a50('0x59')],['id',_0x3a50('0x57'),'updatedAt']);return db[_0x3a50('0x31')][_0x3a50('0x4d')](_[_0x3a50('0x42')](_0x5204c5,_0x33ebad[_0x3a50('0x59')]),{'include':_0x33ebad[_0x3a50('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x3a50('0x28')](function(_0x2128b8){var _0x710df3=_0x33ebad[_0x3a50('0x4e')]['get']({'plain':!![]});if(!_0x710df3)throw new Error(_0x3a50('0x5a'));if(_0x710df3['role']===_0x3a50('0x4e')){var _0x3d246e=_0x2128b8[_0x3a50('0x29')]({'plain':!![]});var _0x45cc4d=_0x3a50('0x2a');return db['UserProfileSection'][_0x3a50('0x51')]({'where':{'name':_0x45cc4d,'userProfileId':_0x710df3[_0x3a50('0x52')]},'raw':!![]})[_0x3a50('0x28')](function(_0x3eb6f2){if(_0x3eb6f2&&_0x3eb6f2['autoAssociation']===0x0){return db[_0x3a50('0x2b')]['create']({'name':_0x3d246e['name'],'resourceId':_0x3d246e['id'],'type':_0x3eb6f2[_0x3a50('0x2e')],'sectionId':_0x3eb6f2['id']},{})[_0x3a50('0x28')](function(){return _0x2128b8;});}else{return _0x2128b8;}})['catch'](function(_0x4a7d82){logger['error'](_0x3a50('0x55'),_0x4a7d82);throw _0x4a7d82;});}return _0x2128b8;});}})['then'](respondWithResult(_0x38535a,0xc9))[_0x3a50('0x49')](handleError(_0x38535a,null));};exports[_0x3a50('0x26')]=function(_0x2cb0c6,_0x42065a){if(_0x2cb0c6[_0x3a50('0x59')]['id']){delete _0x2cb0c6[_0x3a50('0x59')]['id'];}return db[_0x3a50('0x31')]['find']({'where':{'id':_0x2cb0c6[_0x3a50('0x4b')]['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x42065a,null))['then'](saveUpdates(_0x2cb0c6[_0x3a50('0x59')],null))[_0x3a50('0x28')](respondWithResult(_0x42065a,null))[_0x3a50('0x49')](handleError(_0x42065a,null));};exports[_0x3a50('0x27')]=function(_0x5b3133,_0x32eb86){return db[_0x3a50('0x31')]['find']({'where':{'id':_0x5b3133['params']['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x32eb86,null))[_0x3a50('0x28')](removeEntity(_0x32eb86,null))[_0x3a50('0x49')](handleError(_0x32eb86,null));};exports[_0x3a50('0x5b')]=function(_0x4ed915,_0x374795,_0x5071e7){var _0x2fd2ed={'raw':!![],'where':{}};var _0x4b9049={};var _0x21ee47={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x3a50('0x5c')]({'where':{'id':_0x4ed915[_0x3a50('0x4b')]['id']}})['then'](handleEntityNotFound(_0x374795,null))[_0x3a50('0x28')](function(_0x3a688d){if(_0x3a688d){_0x4b9049['model']=_[_0x3a50('0x36')](db['JscriptySessionReport'][_0x3a50('0x4c')]);_0x4b9049[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x4ed915[_0x3a50('0x35')]);_0x4b9049['filters']=_['intersection'](_0x4b9049[_0x3a50('0x34')],_0x4b9049['query']);_0x2fd2ed[_0x3a50('0x38')]=_[_0x3a50('0x39')](_0x4b9049[_0x3a50('0x34')],qs[_0x3a50('0x3a')](_0x4ed915[_0x3a50('0x35')]['fields']));_0x2fd2ed[_0x3a50('0x38')]=_0x2fd2ed[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x2fd2ed[_0x3a50('0x38')]:_0x4b9049[_0x3a50('0x34')];if(!_0x4ed915[_0x3a50('0x35')][_0x3a50('0x3c')](_0x3a50('0x3d'))){_0x2fd2ed[_0x3a50('0x20')]=qs[_0x3a50('0x20')](_0x4ed915[_0x3a50('0x35')]['limit']);_0x2fd2ed[_0x3a50('0x1d')]=qs[_0x3a50('0x1d')](_0x4ed915[_0x3a50('0x35')][_0x3a50('0x1d')]);}_0x2fd2ed[_0x3a50('0x3e')]=qs[_0x3a50('0x3f')](_0x4ed915[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x2fd2ed['where']=qs[_0x3a50('0x37')](_[_0x3a50('0x5d')](_0x4ed915[_0x3a50('0x35')],_0x4b9049[_0x3a50('0x37')]));_0x2fd2ed[_0x3a50('0x41')][_0x3a50('0x5e')]=_0x3a688d['id'];if(_0x4ed915[_0x3a50('0x35')][_0x3a50('0x40')]){_0x2fd2ed['where']=_[_0x3a50('0x42')](_0x2fd2ed[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x2fd2ed[_0x3a50('0x38')],function(_0x47ae49){var _0x3a0752={};_0x3a0752[_0x47ae49]={'$like':'%'+_0x4ed915[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x3a0752;})});}_0x2fd2ed=_[_0x3a50('0x42')]({},_0x2fd2ed,_0x4ed915[_0x3a50('0x45')]);return db[_0x3a50('0x5f')][_0x3a50('0x1f')]({'where':_0x2fd2ed['where']})[_0x3a50('0x28')](function(_0x4a11a3){_0x21ee47[_0x3a50('0x1f')]=_0x4a11a3;if(_0x4ed915[_0x3a50('0x35')][_0x3a50('0x46')]){_0x2fd2ed['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3a50('0x60')](_0x2fd2ed);})[_0x3a50('0x28')](function(_0x3d1070){_0x21ee47[_0x3a50('0x48')]=_0x3d1070;return _0x21ee47;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x374795,_0x2fd2ed))[_0x3a50('0x49')](handleError(_0x374795,null));};exports[_0x3a50('0x61')]=function(_0x5bf52a,_0x39a017,_0x3216c9){var _0x3f9e3f={'raw':!![],'where':{}};var _0x38cbf9={};var _0x8c5094={'count':0x0,'rows':[]};return db[_0x3a50('0x31')][_0x3a50('0x5c')]({'where':{'id':_0x5bf52a['params']['id']}})[_0x3a50('0x28')](handleEntityNotFound(_0x39a017,null))['then'](function(_0x3dafd1){if(_0x3dafd1){_0x38cbf9[_0x3a50('0x34')]=_[_0x3a50('0x36')](db['JscriptyAnswerReport'][_0x3a50('0x4c')]);_0x38cbf9[_0x3a50('0x35')]=_[_0x3a50('0x36')](_0x5bf52a[_0x3a50('0x35')]);_0x38cbf9[_0x3a50('0x37')]=_['intersection'](_0x38cbf9[_0x3a50('0x34')],_0x38cbf9['query']);_0x3f9e3f[_0x3a50('0x38')]=_['intersection'](_0x38cbf9['model'],qs[_0x3a50('0x3a')](_0x5bf52a[_0x3a50('0x35')]['fields']));_0x3f9e3f['attributes']=_0x3f9e3f[_0x3a50('0x38')][_0x3a50('0x3b')]?_0x3f9e3f['attributes']:_0x38cbf9['model'];if(!_0x5bf52a[_0x3a50('0x35')]['hasOwnProperty'](_0x3a50('0x3d'))){_0x3f9e3f['limit']=qs[_0x3a50('0x20')](_0x5bf52a['query'][_0x3a50('0x20')]);_0x3f9e3f[_0x3a50('0x1d')]=qs['offset'](_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x1d')]);}_0x3f9e3f['order']=qs[_0x3a50('0x3f')](_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x3f')]);_0x3f9e3f[_0x3a50('0x41')]=qs[_0x3a50('0x37')](_['pick'](_0x5bf52a[_0x3a50('0x35')],_0x38cbf9['filters']));_0x3f9e3f['where'][_0x3a50('0x5e')]=_0x3dafd1['id'];if(_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x40')]){_0x3f9e3f[_0x3a50('0x41')]=_[_0x3a50('0x42')](_0x3f9e3f[_0x3a50('0x41')],{'$or':_[_0x3a50('0x30')](_0x3f9e3f[_0x3a50('0x38')],function(_0x88e0c8){var _0x581223={};_0x581223[_0x88e0c8]={'$like':'%'+_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x40')]+'%'};return _0x581223;})});}_0x3f9e3f=_['merge']({},_0x3f9e3f,_0x5bf52a['options']);return db[_0x3a50('0x62')][_0x3a50('0x1f')]({'where':_0x3f9e3f['where']})['then'](function(_0x1bdcf3){_0x8c5094[_0x3a50('0x1f')]=_0x1bdcf3;if(_0x5bf52a[_0x3a50('0x35')][_0x3a50('0x46')]){_0x3f9e3f[_0x3a50('0x47')]=[{'all':!![]}];}return db[_0x3a50('0x62')][_0x3a50('0x60')](_0x3f9e3f);})['then'](function(_0x44af97){_0x8c5094[_0x3a50('0x48')]=_0x44af97;return _0x8c5094;});}})[_0x3a50('0x28')](respondWithFilteredResult(_0x39a017,_0x3f9e3f))['catch'](handleError(_0x39a017,null));};function char(_0x14314d){return _0x3a50('0x63')===typeof _0x14314d?String[_0x3a50('0x64')]['apply'](null,arguments):_0x14314d;}function needsEncapsulation(_0x3a48b3){return!!_0x3a48b3&&(_0x3a48b3[_0x3a50('0x65')]()['indexOf'](char(0xd))>=0x0||_0x3a48b3[_0x3a50('0x65')]()[_0x3a50('0x66')](char(0xa))>=0x0||_0x3a48b3['toString']()['indexOf'](char(0x2c))>=0x0||_0x3a48b3[_0x3a50('0x65')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xeae2e5){var _0x55a581=char(0x22),_0x3e50b0='\x5c'+char(0x22),_0xdb9814=_0xeae2e5[_0x3a50('0x65')]()[_0x3a50('0x67')](new RegExp(_0x55a581,'g'),_0x3e50b0);return _0x55a581+_0xdb9814+_0x55a581;}exports[_0x3a50('0x68')]=function(_0xb3eb50,_0x36e64c,_0x23969c){var _0x48cb3b,_0x20746b;var _0x55be07={'where':{'ProjectId':_0xb3eb50[_0x3a50('0x4b')]['id']}};if(_0xb3eb50[_0x3a50('0x35')][_0x3a50('0x69')]){_0x55be07['where'][_0x3a50('0x6a')]=JSON['parse'](_0xb3eb50[_0x3a50('0x35')][_0x3a50('0x69')]);}return db[_0x3a50('0x5f')]['findAll'](_0x55be07)[_0x3a50('0x28')](handleEntityNotFound(_0x36e64c,null))['then'](function(_0x1c2626){if(_0x1c2626){_0x48cb3b=_0x1c2626;return db[_0x3a50('0x6b')][_0x3a50('0x60')]({'where':{'SessionId':{'$in':_[_0x3a50('0x30')](_0x48cb3b,'id')},'ProjectId':_0xb3eb50['params']['id']},'order':_0x3a50('0x6c')});}})['then'](handleEntityNotFound(_0x36e64c,null))[_0x3a50('0x28')](function(_0x45f666){if(_0x45f666){_0x20746b=_0x45f666;var _0x52d00d={};for(var _0x4aea5b=0x0,_0x44b01e=_0x20746b[_0x3a50('0x3b')];_0x4aea5b<_0x44b01e;_0x4aea5b++){if(!_0x52d00d[_0x3a50('0x3c')](_0x20746b[_0x4aea5b][_0x3a50('0x6d')])){_0x52d00d[_0x20746b[_0x4aea5b][_0x3a50('0x6d')]]=needsEncapsulation(_0x20746b[_0x4aea5b][_0x3a50('0x6e')])?encapsulate(_0x20746b[_0x4aea5b]['question']):_0x20746b[_0x4aea5b][_0x3a50('0x6e')];}}var _0x4f7d22=[],_0xab7a83={};for(var _0xc65400=0x0,_0x783bcc=_0x48cb3b[_0x3a50('0x3b')];_0xc65400<_0x783bcc;_0xc65400++){_0xab7a83={'ProjectId':_0xb3eb50[_0x3a50('0x4b')]['id'],'SessionId':_0x48cb3b[_0xc65400]['id'],'StartTime':moment(_0x48cb3b[_0xc65400]['starttime'])['format'](_0x3a50('0x6f'))};for(var _0x3f991e=0x0,_0x239735=_0x20746b[_0x3a50('0x3b')];_0x3f991e<_0x239735;_0x3f991e++){if(_0x20746b[_0x3f991e][_0x3a50('0x70')]==_0x48cb3b[_0xc65400]['id']&&_0x52d00d[_0x3a50('0x3c')](_0x20746b[_0x3f991e][_0x3a50('0x6d')])){_0xab7a83[_0x52d00d[_0x20746b[_0x3f991e]['questionId']]]=_0x20746b[_0x3f991e]['answer'];}}for(var _0x2b1fbe in _0x52d00d){if(!_0xab7a83['hasOwnProperty'](_0x52d00d[_0x2b1fbe])){_0xab7a83[_0x52d00d[_0x2b1fbe]]=null;}}_0x4f7d22[_0x3a50('0x71')](_0xab7a83);}return _0x4f7d22;}})[_0x3a50('0x28')](function(_0x46b5b){if(!_[_0x3a50('0x72')](_0x46b5b)){var _0x104c2c=toCsv(_0x46b5b);var _0x105190=Date['now']();fs[_0x3a50('0x73')](util[_0x3a50('0x74')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xb3eb50[_0x3a50('0x4b')]['id'],_0x105190),_0x104c2c);_0x36e64c['setHeader'](_0x3a50('0x75'),_0x3a50('0x76')+util[_0x3a50('0x74')](_0x3a50('0x77'),_0xb3eb50[_0x3a50('0x4b')]['id'],_0x105190));_0x36e64c['setHeader']('Content-type',_0x3a50('0x78'));return _0x36e64c[_0x3a50('0x79')](util[_0x3a50('0x74')](_0x3a50('0x7a'),_0xb3eb50[_0x3a50('0x4b')]['id'],_0x105190));}else{return _0x36e64c[_0x3a50('0x1a')](0xcc);}})[_0x3a50('0x49')](handleError(_0x36e64c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 0d1bb81..e02b658 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 _0xfd7b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','util'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xfd7b[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var logger=require(_0xbfd7('0x1'))(_0xbfd7('0x2'));var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require(_0xbfd7('0x6'));var rimraf=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var attributes=require(_0xbfd7('0x9'));module[_0xbfd7('0xa')]=function(_0x2ad158,_0x639dd4){return _0x2ad158['define'](_0xbfd7('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x782e=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','../../config/logger','api','bluebird','request-promise'];(function(_0x2a0f29,_0x5ea173){var _0x5528e9=function(_0x56fe8e){while(--_0x56fe8e){_0x2a0f29['push'](_0x2a0f29['shift']());}};_0x5528e9(++_0x5ea173);}(_0x782e,0xb9));var _0xe782=function(_0x187f9b,_0x2d22b0){_0x187f9b=_0x187f9b-0x0;var _0x48212d=_0x782e[_0x187f9b];return _0x48212d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe782('0x0'))(_0xe782('0x1'));var moment=require('moment');var BPromise=require(_0xe782('0x2'));var rp=require(_0xe782('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var attributes=require(_0xe782('0x6'));module[_0xe782('0x7')]=function(_0x5a75ef,_0x1b934f){return _0x5a75ef['define']('JscriptyProject',attributes,{'tableName':_0xe782('0x8'),'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 55396a1..2caf3b1 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x3f284c,_0x5d63e9){var _0x3d5569=function(_0x1c18b1){while(--_0x1c18b1){_0x3f284c['push'](_0x3f284c['shift']());}};_0x3d5569(++_0x5d63e9);}(_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 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 _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(_0x323413,_0x421d63){var _0xe2aca0=function(_0x427f9c){while(--_0x427f9c){_0x323413['push'](_0x323413['shift']());}};_0xe2aca0(++_0x421d63);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2b6fdc,_0x4119bc){_0x2b6fdc=_0x2b6fdc-0x0;var _0x4f372b=_0xf4eb[_0x2b6fdc];return _0x4f372b;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d66e621..b025e6f 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 _0xa3e3=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa3e3,0x1ca));var _0x3a3e=function(_0x2d85eb,_0x2c72ea){_0x2d85eb=_0x2d85eb-0x0;var _0x10922a=_0xa3e3[_0x2d85eb];return _0x10922a;};'use strict';var multer=require(_0x3a3e('0x0'));var util=require('util');var path=require(_0x3a3e('0x1'));var timeout=require(_0x3a3e('0x2'));var express=require(_0x3a3e('0x3'));var router=express[_0x3a3e('0x4')]();var fs_extra=require(_0x3a3e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3a3e('0x6'));var config=require(_0x3a3e('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x3a3e('0x8')]('/',auth[_0x3a3e('0x9')](),controller[_0x3a3e('0xa')]);router[_0x3a3e('0x8')]('/describe',auth[_0x3a3e('0x9')](),controller['describe']);router[_0x3a3e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3a3e('0xb')]);router[_0x3a3e('0xc')]('/',auth[_0x3a3e('0x9')](),controller[_0x3a3e('0xd')]);router[_0x3a3e('0xe')](_0x3a3e('0xf'),auth[_0x3a3e('0x9')](),controller[_0x3a3e('0x10')]);router[_0x3a3e('0x11')](_0x3a3e('0xf'),auth[_0x3a3e('0x9')](),controller[_0x3a3e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x70eb=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x212dad,_0xb862ef){var _0x4fea3f=function(_0x31664b){while(--_0x31664b){_0x212dad['push'](_0x212dad['shift']());}};_0x4fea3f(++_0xb862ef);}(_0x70eb,0x154));var _0xb70e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x70eb[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0xb70e('0x0'));var util=require(_0xb70e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb70e('0x2'));var router=express[_0xb70e('0x3')]();var fs_extra=require(_0xb70e('0x4'));var auth=require(_0xb70e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb70e('0x6'));var controller=require(_0xb70e('0x7'));router[_0xb70e('0x8')]('/',auth[_0xb70e('0x9')](),controller['index']);router['get']('/describe',auth[_0xb70e('0x9')](),controller[_0xb70e('0xa')]);router[_0xb70e('0x8')](_0xb70e('0xb'),auth['isAuthenticated'](),controller[_0xb70e('0xc')]);router[_0xb70e('0xd')]('/',auth[_0xb70e('0x9')](),controller[_0xb70e('0xe')]);router[_0xb70e('0xf')](_0xb70e('0xb'),auth[_0xb70e('0x9')](),controller['update']);router[_0xb70e('0x10')](_0xb70e('0xb'),auth[_0xb70e('0x9')](),controller[_0xb70e('0x11')]);module[_0xb70e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index b123b53..fa91dd2 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x3a0c2d,_0xc08383){_0x3a0c2d=_0x3a0c2d-0x0;var _0x10182e=_0x7a54[_0x3a0c2d];return _0x10182e;};'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(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7a54,0x106));var _0x47a5=function(_0x31eea0,_0x52163f){_0x31eea0=_0x31eea0-0x0;var _0x5d3fa0=_0x7a54[_0x31eea0];return _0x5d3fa0;};'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 ae7817f..247017a 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 _0x62a5=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','then','destroy','error','stack','send','index','JscriptyQuestionReport','rawAttributes','fieldName','model','map','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','show','includeAll','create','body','catch','describe','eml-format','rimraf'];(function(_0x369adf,_0x1e4428){var _0x164b44=function(_0x133edd){while(--_0x133edd){_0x369adf['push'](_0x369adf['shift']());}};_0x164b44(++_0x1e4428);}(_0x62a5,0x1a2));var _0x562a=function(_0x3a1595,_0x5b2694){_0x3a1595=_0x3a1595-0x0;var _0x4a63b1=_0x62a5[_0x3a1595];return _0x4a63b1;};'use strict';var emlformat=require(_0x562a('0x0'));var rimraf=require(_0x562a('0x1'));var zipdir=require(_0x562a('0x2'));var jsonpatch=require(_0x562a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x562a('0x4'));var Mustache=require(_0x562a('0x5'));var util=require(_0x562a('0x6'));var path=require(_0x562a('0x7'));var sox=require(_0x562a('0x8'));var csv=require(_0x562a('0x9'));var ejs=require(_0x562a('0xa'));var fs=require('fs');var fs_extra=require(_0x562a('0xb'));var _=require(_0x562a('0xc'));var squel=require(_0x562a('0xd'));var crypto=require(_0x562a('0xe'));var jsforce=require(_0x562a('0xf'));var deskjs=require(_0x562a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x562a('0x11'));var Papa=require('papaparse');var Redis=require(_0x562a('0x12'));var authService=require(_0x562a('0x13'));var qs=require(_0x562a('0x14'));var as=require(_0x562a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x562a('0x16'))(_0x562a('0x17'));var utils=require('../../config/utils');var config=require(_0x562a('0x18'));var licenseUtil=require(_0x562a('0x19'));var db=require(_0x562a('0x1a'))['db'];function respondWithStatusCode(_0x209ca0,_0x51bb47){_0x51bb47=_0x51bb47||0xcc;return function(_0x210a9d){if(_0x210a9d){return _0x209ca0[_0x562a('0x1b')](_0x51bb47);}return _0x209ca0[_0x562a('0x1c')](_0x51bb47)[_0x562a('0x1d')]();};}function respondWithResult(_0x527708,_0x2e370e){_0x2e370e=_0x2e370e||0xc8;return function(_0x5d2f08){if(_0x5d2f08){return _0x527708['status'](_0x2e370e)[_0x562a('0x1e')](_0x5d2f08);}};}function respondWithFilteredResult(_0x369079,_0x22f397){return function(_0x4d4628){if(_0x4d4628){var _0x2e2bad=typeof _0x22f397[_0x562a('0x1f')]===_0x562a('0x20')&&typeof _0x22f397['limit']==='undefined';var _0x1c79c4=_0x4d4628[_0x562a('0x21')];var _0x4782dd=_0x2e2bad?0x0:_0x22f397[_0x562a('0x1f')];var _0x24b401=_0x2e2bad?_0x4d4628[_0x562a('0x21')]:_0x22f397[_0x562a('0x1f')]+_0x22f397[_0x562a('0x22')];var _0x2a824f;if(_0x24b401>=_0x1c79c4){_0x24b401=_0x1c79c4;_0x2a824f=0xc8;}else{_0x2a824f=0xce;}_0x369079[_0x562a('0x1c')](_0x2a824f);return _0x369079['set']('Content-Range',_0x4782dd+'-'+_0x24b401+'/'+_0x1c79c4)[_0x562a('0x1e')](_0x4d4628);}return null;};}function patchUpdates(_0x6bc55){return function(_0x1e35a3){try{jsonpatch[_0x562a('0x23')](_0x1e35a3,_0x6bc55,!![]);}catch(_0x2c416d){return BPromise['reject'](_0x2c416d);}return _0x1e35a3[_0x562a('0x24')]();};}function saveUpdates(_0x1c8435,_0x207871){return function(_0x978e57){if(_0x978e57){return _0x978e57['update'](_0x1c8435)[_0x562a('0x25')](function(_0x2c1f17){return _0x2c1f17;});}return null;};}function removeEntity(_0xef5c04,_0x5b2e1c){return function(_0x198428){if(_0x198428){return _0x198428[_0x562a('0x26')]()['then'](function(){_0xef5c04[_0x562a('0x1c')](0xcc)[_0x562a('0x1d')]();});}};}function handleEntityNotFound(_0x5b8db1,_0x157312){return function(_0x1a1e48){if(!_0x1a1e48){_0x5b8db1['sendStatus'](0x194);}return _0x1a1e48;};}function handleError(_0x43b5cc,_0x2c6b85){_0x2c6b85=_0x2c6b85||0x1f4;return function(_0x1ee574){logger[_0x562a('0x27')](_0x1ee574[_0x562a('0x28')]);if(_0x1ee574['name']){delete _0x1ee574['name'];}_0x43b5cc[_0x562a('0x1c')](_0x2c6b85)[_0x562a('0x29')](_0x1ee574);};}exports[_0x562a('0x2a')]=function(_0x520f9a,_0x2683e5){var _0x172f55={},_0x17f4ff={},_0x120c15={'count':0x0,'rows':[]};var _0x297927=_['map'](db[_0x562a('0x2b')][_0x562a('0x2c')],function(_0x482e10){return{'name':_0x482e10[_0x562a('0x2d')],'type':_0x482e10['type']['key']};});_0x17f4ff[_0x562a('0x2e')]=_[_0x562a('0x2f')](_0x297927,_0x562a('0x30'));_0x17f4ff[_0x562a('0x31')]=_[_0x562a('0x32')](_0x520f9a[_0x562a('0x31')]);_0x17f4ff[_0x562a('0x33')]=_['intersection'](_0x17f4ff[_0x562a('0x2e')],_0x17f4ff[_0x562a('0x31')]);_0x172f55[_0x562a('0x34')]=_[_0x562a('0x35')](_0x17f4ff[_0x562a('0x2e')],qs[_0x562a('0x36')](_0x520f9a[_0x562a('0x31')]['fields']));_0x172f55[_0x562a('0x34')]=_0x172f55[_0x562a('0x34')][_0x562a('0x37')]?_0x172f55[_0x562a('0x34')]:_0x17f4ff[_0x562a('0x2e')];if(!_0x520f9a[_0x562a('0x31')]['hasOwnProperty'](_0x562a('0x38'))){_0x172f55[_0x562a('0x22')]=qs[_0x562a('0x22')](_0x520f9a[_0x562a('0x31')][_0x562a('0x22')]);_0x172f55[_0x562a('0x1f')]=qs[_0x562a('0x1f')](_0x520f9a['query'][_0x562a('0x1f')]);}_0x172f55[_0x562a('0x39')]=qs[_0x562a('0x3a')](_0x520f9a[_0x562a('0x31')][_0x562a('0x3a')]);_0x172f55[_0x562a('0x3b')]=qs[_0x562a('0x33')](_['pick'](_0x520f9a[_0x562a('0x31')],_0x17f4ff[_0x562a('0x33')]),_0x297927);if(_0x520f9a[_0x562a('0x31')][_0x562a('0x3c')]){_0x172f55[_0x562a('0x3b')]=_[_0x562a('0x3d')](_0x172f55[_0x562a('0x3b')],{'$or':_[_0x562a('0x2f')](_0x297927,function(_0x56997a){if(_0x56997a[_0x562a('0x3e')]!==_0x562a('0x3f')){var _0x736614={};_0x736614[_0x56997a[_0x562a('0x30')]]={'$like':'%'+_0x520f9a['query'][_0x562a('0x3c')]+'%'};return _0x736614;}})});}_0x172f55=_[_0x562a('0x3d')]({},_0x172f55,_0x520f9a['options']);var _0x3597d3={'where':_0x172f55[_0x562a('0x3b')]};return db[_0x562a('0x2b')][_0x562a('0x21')](_0x3597d3)[_0x562a('0x25')](function(_0x3a6e57){_0x120c15[_0x562a('0x21')]=_0x3a6e57;if(_0x520f9a['query']['includeAll']){_0x172f55['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x172f55);})['then'](function(_0x537351){_0x120c15['rows']=_0x537351;return _0x120c15;})['then'](respondWithFilteredResult(_0x2683e5,_0x172f55))['catch'](handleError(_0x2683e5,null));};exports[_0x562a('0x40')]=function(_0x51e322,_0x25196c){var _0x3ea7bd={'raw':!![],'where':{'id':_0x51e322['params']['id']}},_0x297b27={};_0x297b27['model']=_[_0x562a('0x32')](db[_0x562a('0x2b')]['rawAttributes']);_0x297b27[_0x562a('0x31')]=_[_0x562a('0x32')](_0x51e322['query']);_0x297b27['filters']=_[_0x562a('0x35')](_0x297b27[_0x562a('0x2e')],_0x297b27[_0x562a('0x31')]);_0x3ea7bd[_0x562a('0x34')]=_['intersection'](_0x297b27['model'],qs[_0x562a('0x36')](_0x51e322['query'][_0x562a('0x36')]));_0x3ea7bd[_0x562a('0x34')]=_0x3ea7bd['attributes'][_0x562a('0x37')]?_0x3ea7bd[_0x562a('0x34')]:_0x297b27[_0x562a('0x2e')];if(_0x51e322[_0x562a('0x31')][_0x562a('0x41')]){_0x3ea7bd['include']=[{'all':!![]}];}_0x3ea7bd=_[_0x562a('0x3d')]({},_0x3ea7bd,_0x51e322['options']);return db[_0x562a('0x2b')]['find'](_0x3ea7bd)[_0x562a('0x25')](handleEntityNotFound(_0x25196c,null))[_0x562a('0x25')](respondWithResult(_0x25196c,null))['catch'](handleError(_0x25196c,null));};exports[_0x562a('0x42')]=function(_0x1b706c,_0x15ce45){return db['JscriptyQuestionReport'][_0x562a('0x42')](_0x1b706c[_0x562a('0x43')],{})['then'](respondWithResult(_0x15ce45,0xc9))['catch'](handleError(_0x15ce45,null));};exports['update']=function(_0x3fdd62,_0x58bfc7){if(_0x3fdd62[_0x562a('0x43')]['id']){delete _0x3fdd62[_0x562a('0x43')]['id'];}return db[_0x562a('0x2b')]['find']({'where':{'id':_0x3fdd62['params']['id']}})[_0x562a('0x25')](handleEntityNotFound(_0x58bfc7,null))[_0x562a('0x25')](saveUpdates(_0x3fdd62[_0x562a('0x43')],null))['then'](respondWithResult(_0x58bfc7,null))[_0x562a('0x44')](handleError(_0x58bfc7,null));};exports[_0x562a('0x26')]=function(_0x1c6743,_0x551b70){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1c6743['params']['id']}})[_0x562a('0x25')](handleEntityNotFound(_0x551b70,null))[_0x562a('0x25')](removeEntity(_0x551b70,null))['catch'](handleError(_0x551b70,null));};exports['describe']=function(_0x1de97f,_0x2db1a5){return db[_0x562a('0x2b')][_0x562a('0x45')]()['then'](respondWithResult(_0x2db1a5,null))[_0x562a('0x44')](handleError(_0x2db1a5,null));}; \ No newline at end of file +var _0x5346=['keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type'];(function(_0x361e03,_0x158266){var _0x435fd3=function(_0x23774a){while(--_0x23774a){_0x361e03['push'](_0x361e03['shift']());}};_0x435fd3(++_0x158266);}(_0x5346,0xf8));var _0x6534=function(_0x4bede8,_0x5935f7){_0x4bede8=_0x4bede8-0x0;var _0x48b75c=_0x5346[_0x4bede8];return _0x48b75c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6534('0x0'));var zipdir=require(_0x6534('0x1'));var jsonpatch=require(_0x6534('0x2'));var rp=require('request-promise');var moment=require(_0x6534('0x3'));var BPromise=require(_0x6534('0x4'));var Mustache=require('mustache');var util=require(_0x6534('0x5'));var path=require(_0x6534('0x6'));var sox=require(_0x6534('0x7'));var csv=require(_0x6534('0x8'));var ejs=require(_0x6534('0x9'));var fs=require('fs');var fs_extra=require(_0x6534('0xa'));var _=require(_0x6534('0xb'));var squel=require(_0x6534('0xc'));var crypto=require('crypto');var jsforce=require(_0x6534('0xd'));var deskjs=require(_0x6534('0xe'));var toCsv=require(_0x6534('0x8'));var querystring=require(_0x6534('0xf'));var Papa=require(_0x6534('0x10'));var Redis=require('ioredis');var authService=require(_0x6534('0x11'));var qs=require(_0x6534('0x12'));var as=require(_0x6534('0x13'));var hardwareService=require(_0x6534('0x14'));var logger=require('../../config/logger')(_0x6534('0x15'));var utils=require(_0x6534('0x16'));var config=require(_0x6534('0x17'));var licenseUtil=require(_0x6534('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cc6ed,_0x1f3a45){_0x1f3a45=_0x1f3a45||0xcc;return function(_0x472e93){if(_0x472e93){return _0x1cc6ed[_0x6534('0x19')](_0x1f3a45);}return _0x1cc6ed[_0x6534('0x1a')](_0x1f3a45)[_0x6534('0x1b')]();};}function respondWithResult(_0x12e1df,_0x98c762){_0x98c762=_0x98c762||0xc8;return function(_0x5e9800){if(_0x5e9800){return _0x12e1df[_0x6534('0x1a')](_0x98c762)[_0x6534('0x1c')](_0x5e9800);}};}function respondWithFilteredResult(_0xe90758,_0xe61cd5){return function(_0x3689d9){if(_0x3689d9){var _0x130742=typeof _0xe61cd5[_0x6534('0x1d')]===_0x6534('0x1e')&&typeof _0xe61cd5[_0x6534('0x1f')]===_0x6534('0x1e');var _0x99ba06=_0x3689d9['count'];var _0x4dbd7d=_0x130742?0x0:_0xe61cd5['offset'];var _0x2ee942=_0x130742?_0x3689d9[_0x6534('0x20')]:_0xe61cd5[_0x6534('0x1d')]+_0xe61cd5[_0x6534('0x1f')];var _0x4b8a26;if(_0x2ee942>=_0x99ba06){_0x2ee942=_0x99ba06;_0x4b8a26=0xc8;}else{_0x4b8a26=0xce;}_0xe90758[_0x6534('0x1a')](_0x4b8a26);return _0xe90758['set'](_0x6534('0x21'),_0x4dbd7d+'-'+_0x2ee942+'/'+_0x99ba06)[_0x6534('0x1c')](_0x3689d9);}return null;};}function patchUpdates(_0x1f6338){return function(_0x798172){try{jsonpatch['apply'](_0x798172,_0x1f6338,!![]);}catch(_0x933b57){return BPromise[_0x6534('0x22')](_0x933b57);}return _0x798172[_0x6534('0x23')]();};}function saveUpdates(_0x1fdb63,_0x4f93ed){return function(_0x18557b){if(_0x18557b){return _0x18557b[_0x6534('0x24')](_0x1fdb63)[_0x6534('0x25')](function(_0x32feca){return _0x32feca;});}return null;};}function removeEntity(_0xec9e38,_0x5b0409){return function(_0x5331a4){if(_0x5331a4){return _0x5331a4[_0x6534('0x26')]()[_0x6534('0x25')](function(){_0xec9e38[_0x6534('0x1a')](0xcc)[_0x6534('0x1b')]();});}};}function handleEntityNotFound(_0x5c0b01,_0x28a0ff){return function(_0x141069){if(!_0x141069){_0x5c0b01[_0x6534('0x19')](0x194);}return _0x141069;};}function handleError(_0x2e005f,_0x308bdf){_0x308bdf=_0x308bdf||0x1f4;return function(_0x507350){logger['error'](_0x507350[_0x6534('0x27')]);if(_0x507350[_0x6534('0x28')]){delete _0x507350['name'];}_0x2e005f[_0x6534('0x1a')](_0x308bdf)[_0x6534('0x29')](_0x507350);};}exports[_0x6534('0x2a')]=function(_0x9f25d3,_0x303bea){var _0x498f1a={},_0x165334={},_0x34e85a={'count':0x0,'rows':[]};var _0x21eef9=_[_0x6534('0x2b')](db[_0x6534('0x2c')][_0x6534('0x2d')],function(_0x3c7b3f){return{'name':_0x3c7b3f[_0x6534('0x2e')],'type':_0x3c7b3f[_0x6534('0x2f')]['key']};});_0x165334['model']=_[_0x6534('0x2b')](_0x21eef9,_0x6534('0x28'));_0x165334['query']=_[_0x6534('0x30')](_0x9f25d3[_0x6534('0x31')]);_0x165334[_0x6534('0x32')]=_['intersection'](_0x165334[_0x6534('0x33')],_0x165334[_0x6534('0x31')]);_0x498f1a['attributes']=_[_0x6534('0x34')](_0x165334[_0x6534('0x33')],qs[_0x6534('0x35')](_0x9f25d3[_0x6534('0x31')][_0x6534('0x35')]));_0x498f1a[_0x6534('0x36')]=_0x498f1a[_0x6534('0x36')][_0x6534('0x37')]?_0x498f1a['attributes']:_0x165334[_0x6534('0x33')];if(!_0x9f25d3[_0x6534('0x31')][_0x6534('0x38')]('nolimit')){_0x498f1a['limit']=qs['limit'](_0x9f25d3[_0x6534('0x31')][_0x6534('0x1f')]);_0x498f1a[_0x6534('0x1d')]=qs[_0x6534('0x1d')](_0x9f25d3[_0x6534('0x31')][_0x6534('0x1d')]);}_0x498f1a[_0x6534('0x39')]=qs[_0x6534('0x3a')](_0x9f25d3[_0x6534('0x31')]['sort']);_0x498f1a['where']=qs[_0x6534('0x32')](_[_0x6534('0x3b')](_0x9f25d3['query'],_0x165334[_0x6534('0x32')]),_0x21eef9);if(_0x9f25d3[_0x6534('0x31')][_0x6534('0x3c')]){_0x498f1a[_0x6534('0x3d')]=_[_0x6534('0x3e')](_0x498f1a['where'],{'$or':_[_0x6534('0x2b')](_0x21eef9,function(_0x12b0c8){if(_0x12b0c8[_0x6534('0x2f')]!==_0x6534('0x3f')){var _0x173771={};_0x173771[_0x12b0c8[_0x6534('0x28')]]={'$like':'%'+_0x9f25d3[_0x6534('0x31')][_0x6534('0x3c')]+'%'};return _0x173771;}})});}_0x498f1a=_[_0x6534('0x3e')]({},_0x498f1a,_0x9f25d3['options']);var _0x4af834={'where':_0x498f1a[_0x6534('0x3d')]};return db[_0x6534('0x2c')]['count'](_0x4af834)[_0x6534('0x25')](function(_0x42caea){_0x34e85a[_0x6534('0x20')]=_0x42caea;if(_0x9f25d3[_0x6534('0x31')][_0x6534('0x40')]){_0x498f1a[_0x6534('0x41')]=[{'all':!![]}];}return db[_0x6534('0x2c')][_0x6534('0x42')](_0x498f1a);})[_0x6534('0x25')](function(_0x4080a2){_0x34e85a['rows']=_0x4080a2;return _0x34e85a;})[_0x6534('0x25')](respondWithFilteredResult(_0x303bea,_0x498f1a))['catch'](handleError(_0x303bea,null));};exports[_0x6534('0x43')]=function(_0x4883b9,_0x549749){var _0x51c3fc={'raw':!![],'where':{'id':_0x4883b9[_0x6534('0x44')]['id']}},_0x327dcf={};_0x327dcf[_0x6534('0x33')]=_[_0x6534('0x30')](db[_0x6534('0x2c')][_0x6534('0x2d')]);_0x327dcf[_0x6534('0x31')]=_[_0x6534('0x30')](_0x4883b9[_0x6534('0x31')]);_0x327dcf['filters']=_[_0x6534('0x34')](_0x327dcf[_0x6534('0x33')],_0x327dcf[_0x6534('0x31')]);_0x51c3fc[_0x6534('0x36')]=_[_0x6534('0x34')](_0x327dcf['model'],qs[_0x6534('0x35')](_0x4883b9[_0x6534('0x31')][_0x6534('0x35')]));_0x51c3fc[_0x6534('0x36')]=_0x51c3fc[_0x6534('0x36')][_0x6534('0x37')]?_0x51c3fc[_0x6534('0x36')]:_0x327dcf['model'];if(_0x4883b9['query'][_0x6534('0x40')]){_0x51c3fc[_0x6534('0x41')]=[{'all':!![]}];}_0x51c3fc=_[_0x6534('0x3e')]({},_0x51c3fc,_0x4883b9[_0x6534('0x45')]);return db[_0x6534('0x2c')][_0x6534('0x46')](_0x51c3fc)[_0x6534('0x25')](handleEntityNotFound(_0x549749,null))[_0x6534('0x25')](respondWithResult(_0x549749,null))['catch'](handleError(_0x549749,null));};exports[_0x6534('0x47')]=function(_0x240fd6,_0x481a57){return db[_0x6534('0x2c')][_0x6534('0x47')](_0x240fd6[_0x6534('0x48')],{})['then'](respondWithResult(_0x481a57,0xc9))[_0x6534('0x49')](handleError(_0x481a57,null));};exports['update']=function(_0x57d6fe,_0x260428){if(_0x57d6fe[_0x6534('0x48')]['id']){delete _0x57d6fe[_0x6534('0x48')]['id'];}return db[_0x6534('0x2c')][_0x6534('0x46')]({'where':{'id':_0x57d6fe[_0x6534('0x44')]['id']}})[_0x6534('0x25')](handleEntityNotFound(_0x260428,null))[_0x6534('0x25')](saveUpdates(_0x57d6fe[_0x6534('0x48')],null))['then'](respondWithResult(_0x260428,null))['catch'](handleError(_0x260428,null));};exports[_0x6534('0x26')]=function(_0x2e2569,_0x5eefd4){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x2e2569['params']['id']}})['then'](handleEntityNotFound(_0x5eefd4,null))[_0x6534('0x25')](removeEntity(_0x5eefd4,null))[_0x6534('0x49')](handleError(_0x5eefd4,null));};exports['describe']=function(_0x5ed90c,_0x50b8a4){return db['JscriptyQuestionReport']['describe']()[_0x6534('0x25')](respondWithResult(_0x50b8a4,null))[_0x6534('0x49')](handleError(_0x50b8a4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 34b1dbf..4b1d8fa 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 _0x97eb=['JscriptyQuestionReport','../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x9fe178,_0x48a5ee){var _0x2d62bb=function(_0x125be2){while(--_0x125be2){_0x9fe178['push'](_0x9fe178['shift']());}};_0x2d62bb(++_0x48a5ee);}(_0x97eb,0xe2));var _0xb97e=function(_0x3f751e,_0x306da1){_0x3f751e=_0x3f751e-0x0;var _0x4aa7f6=_0x97eb[_0x3f751e];return _0x4aa7f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb97e('0x0'))(_0xb97e('0x1'));var moment=require(_0xb97e('0x2'));var BPromise=require(_0xb97e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb97e('0x4'));var rimraf=require('rimraf');var config=require(_0xb97e('0x5'));var attributes=require(_0xb97e('0x6'));module[_0xb97e('0x7')]=function(_0x44278a,_0x446ddf){return _0x44278a['define'](_0xb97e('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0850=['api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger'];(function(_0x5b12fb,_0xbd01c0){var _0x8034a=function(_0x25fcc0){while(--_0x25fcc0){_0x5b12fb['push'](_0x5b12fb['shift']());}};_0x8034a(++_0xbd01c0);}(_0x0850,0x1ec));var _0x0085=function(_0x45a507,_0x937053){_0x45a507=_0x45a507-0x0;var _0x379da6=_0x0850[_0x45a507];return _0x379da6;};'use strict';var _=require('lodash');var util=require(_0x0085('0x0'));var logger=require(_0x0085('0x1'))(_0x0085('0x2'));var moment=require(_0x0085('0x3'));var BPromise=require(_0x0085('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0085('0x5'));var rimraf=require(_0x0085('0x6'));var config=require(_0x0085('0x7'));var attributes=require(_0x0085('0x8'));module[_0x0085('0x9')]=function(_0x5cc4af,_0x96e1db){return _0x5cc4af[_0x0085('0xa')](_0x0085('0xb'),attributes,{'tableName':_0x0085('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index bf7e673..2b00926 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 _0x4cab=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','info'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x4cab,0x1dd));var _0xb4ca=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x4cab[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xb4ca('0x0'));var util=require(_0xb4ca('0x1'));var moment=require(_0xb4ca('0x2'));var BPromise=require(_0xb4ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ca('0x4'));var db=require(_0xb4ca('0x5'))['db'];var utils=require(_0xb4ca('0x6'));var logger=require(_0xb4ca('0x7'))(_0xb4ca('0x8'));var config=require(_0xb4ca('0x9'));var jayson=require(_0xb4ca('0xa'));var client=jayson[_0xb4ca('0xb')][_0xb4ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48e124,_0x159112,_0x471e3c){return new BPromise(function(_0x33170f,_0xa90743){return client[_0xb4ca('0xd')](_0x48e124,_0x471e3c)[_0xb4ca('0xe')](function(_0x13642b){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x159112,'request\x20sent');logger[_0xb4ca('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x159112,_0xb4ca('0x10'),JSON[_0xb4ca('0x11')](_0x13642b));if(_0x13642b[_0xb4ca('0x12')]){if(_0x13642b[_0xb4ca('0x12')][_0xb4ca('0x13')]===0x1f4){logger[_0xb4ca('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x159112,_0x13642b[_0xb4ca('0x12')][_0xb4ca('0x14')]);return _0xa90743(_0x13642b[_0xb4ca('0x12')][_0xb4ca('0x14')]);}logger[_0xb4ca('0x12')](_0xb4ca('0x15'),_0x159112,_0x13642b['error'][_0xb4ca('0x14')]);return _0x33170f(_0x13642b[_0xb4ca('0x12')]['message']);}else{logger[_0xb4ca('0x16')](_0xb4ca('0x15'),_0x159112,_0xb4ca('0x10'));_0x33170f(_0x13642b[_0xb4ca('0x17')][_0xb4ca('0x14')]);}})[_0xb4ca('0x18')](function(_0x549b30){logger[_0xb4ca('0x12')](_0xb4ca('0x15'),_0x159112,_0x549b30);_0xa90743(_0x549b30);});});} \ No newline at end of file +var _0xbb3c=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51e2cd,_0x59a5c7){var _0x513481=function(_0x2e3e92){while(--_0x2e3e92){_0x51e2cd['push'](_0x51e2cd['shift']());}};_0x513481(++_0x59a5c7);}(_0xbb3c,0x17f));var _0xcbb3=function(_0x384a76,_0x4227b4){_0x384a76=_0x384a76-0x0;var _0x189fa1=_0xbb3c[_0x384a76];return _0x189fa1;};'use strict';var _=require(_0xcbb3('0x0'));var util=require(_0xcbb3('0x1'));var moment=require(_0xcbb3('0x2'));var BPromise=require(_0xcbb3('0x3'));var rs=require(_0xcbb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbb3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcbb3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x310eec,_0x1bff64,_0x158b29){return new BPromise(function(_0x5ba6a2,_0x183ed9){return client['request'](_0x310eec,_0x158b29)[_0xcbb3('0x8')](function(_0xbd00bb){logger[_0xcbb3('0x9')](_0xcbb3('0xa'),_0x1bff64,_0xcbb3('0xb'));logger[_0xcbb3('0xc')](_0xcbb3('0xd'),_0x1bff64,_0xcbb3('0xb'),JSON[_0xcbb3('0xe')](_0xbd00bb));if(_0xbd00bb['error']){if(_0xbd00bb['error']['code']===0x1f4){logger[_0xcbb3('0xf')](_0xcbb3('0xa'),_0x1bff64,_0xbd00bb[_0xcbb3('0xf')]['message']);return _0x183ed9(_0xbd00bb[_0xcbb3('0xf')]['message']);}logger[_0xcbb3('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1bff64,_0xbd00bb[_0xcbb3('0xf')][_0xcbb3('0x10')]);return _0x5ba6a2(_0xbd00bb[_0xcbb3('0xf')][_0xcbb3('0x10')]);}else{logger[_0xcbb3('0x9')](_0xcbb3('0xa'),_0x1bff64,_0xcbb3('0xb'));_0x5ba6a2(_0xbd00bb[_0xcbb3('0x11')][_0xcbb3('0x10')]);}})[_0xcbb3('0x12')](function(_0x2cb31e){logger[_0xcbb3('0xf')](_0xcbb3('0xa'),_0x1bff64,_0x2cb31e);_0x183ed9(_0x2cb31e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 03439a1..c5b153e 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 _0xc941=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9858f1,_0x40140d){var _0x36516f=function(_0x2083ea){while(--_0x2083ea){_0x9858f1['push'](_0x9858f1['shift']());}};_0x36516f(++_0x40140d);}(_0xc941,0xa0));var _0x1c94=function(_0x2d66a4,_0x15dc7a){_0x2d66a4=_0x2d66a4-0x0;var _0x2a18ee=_0xc941[_0x2d66a4];return _0x2a18ee;};'use strict';var multer=require(_0x1c94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1c94('0x1'));var express=require(_0x1c94('0x2'));var router=express[_0x1c94('0x3')]();var fs_extra=require(_0x1c94('0x4'));var auth=require(_0x1c94('0x5'));var interaction=require(_0x1c94('0x6'));var config=require(_0x1c94('0x7'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x1c94('0x8')](),controller[_0x1c94('0x9')]);router[_0x1c94('0xa')](_0x1c94('0xb'),auth[_0x1c94('0x8')](),controller[_0x1c94('0xc')]);router[_0x1c94('0xa')](_0x1c94('0xd'),auth[_0x1c94('0x8')](),controller[_0x1c94('0xe')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0x1c94('0xf')]('/',auth[_0x1c94('0x8')](),controller[_0x1c94('0x10')]);router[_0x1c94('0x11')]('/:id',auth[_0x1c94('0x8')](),controller[_0x1c94('0x12')]);router[_0x1c94('0x13')]('/:id',auth[_0x1c94('0x8')](),controller['destroy']);module[_0x1c94('0x14')]=router; \ No newline at end of file +var _0xa7f2=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','getQuestions','post','create','put','update','delete'];(function(_0x3706d6,_0x5b62f2){var _0x2376e0=function(_0xc635f0){while(--_0xc635f0){_0x3706d6['push'](_0x3706d6['shift']());}};_0x2376e0(++_0x5b62f2);}(_0xa7f2,0x8e));var _0x2a7f=function(_0x1d9dfa,_0x30598d){_0x1d9dfa=_0x1d9dfa-0x0;var _0x252661=_0xa7f2[_0x1d9dfa];return _0x252661;};'use strict';var multer=require(_0x2a7f('0x0'));var util=require(_0x2a7f('0x1'));var path=require(_0x2a7f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2a7f('0x3'));var auth=require(_0x2a7f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2a7f('0x5'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x2a7f('0x6')](),controller[_0x2a7f('0x7')]);router[_0x2a7f('0x8')](_0x2a7f('0x9'),auth[_0x2a7f('0x6')](),controller[_0x2a7f('0xa')]);router[_0x2a7f('0x8')](_0x2a7f('0xb'),auth[_0x2a7f('0x6')](),controller['show']);router['get']('/:id/questions',auth['isAuthenticated'](),controller[_0x2a7f('0xc')]);router[_0x2a7f('0xd')]('/',auth['isAuthenticated'](),controller[_0x2a7f('0xe')]);router[_0x2a7f('0xf')](_0x2a7f('0xb'),auth[_0x2a7f('0x6')](),controller[_0x2a7f('0x10')]);router[_0x2a7f('0x11')](_0x2a7f('0xb'),auth[_0x2a7f('0x6')](),controller[_0x2a7f('0x12')]);module[_0x2a7f('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 14d4488..3c2f2ef 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 _0x6889=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x6889,0x114));var _0x9688=function(_0x1082ab,_0x133d5b){_0x1082ab=_0x1082ab-0x0;var _0x2de4cf=_0x6889[_0x1082ab];return _0x2de4cf;};'use strict';var moment=require(_0x9688('0x0'));var Sequelize=require(_0x9688('0x1'));module[_0x9688('0x2')]={'starttime':{'type':Sequelize[_0x9688('0x3')],'set':function(_0x33b4f5){this['setDataValue'](_0x9688('0x4'),_0x33b4f5);this['setDataValue']('endtime',moment()[_0x9688('0x5')](_0x9688('0x6')));}},'endtime':{'type':Sequelize[_0x9688('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9688('0x7')]},'queue':{'type':Sequelize[_0x9688('0x7')]},'uniqueid':{'type':Sequelize[_0x9688('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9688('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9f0e=['starttime','setDataValue','endtime','STRING','BOOLEAN','moment','exports','DATE'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9f0e,0x8d));var _0xe9f0=function(_0x3774a8,_0x1127c1){_0x3774a8=_0x3774a8-0x0;var _0x4a5185=_0x9f0e[_0x3774a8];return _0x4a5185;};'use strict';var moment=require(_0xe9f0('0x0'));var Sequelize=require('sequelize');module[_0xe9f0('0x1')]={'starttime':{'type':Sequelize[_0xe9f0('0x2')],'set':function(_0x297217){this['setDataValue'](_0xe9f0('0x3'),_0x297217);this[_0xe9f0('0x4')](_0xe9f0('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xe9f0('0x2')]},'membername':{'type':Sequelize[_0xe9f0('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe9f0('0x6')]},'uniqueid':{'type':Sequelize[_0xe9f0('0x6')]},'calleridname':{'type':Sequelize[_0xe9f0('0x6')]},'calleridnum':{'type':Sequelize[_0xe9f0('0x6')]},'completed':{'type':Sequelize[_0xe9f0('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d55dcc8..e88b655 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 _0x6e2f=['findAll','rows','catch','params','keys','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','papaparse','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','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','JscriptySessionReport'];(function(_0x5ba562,_0x154225){var _0x190d63=function(_0x141ca2){while(--_0x141ca2){_0x5ba562['push'](_0x5ba562['shift']());}};_0x190d63(++_0x154225);}(_0x6e2f,0x9e));var _0xf6e2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x6e2f[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e2('0x0'));var zipdir=require(_0xf6e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6e2('0x2'));var Mustache=require(_0xf6e2('0x3'));var util=require(_0xf6e2('0x4'));var path=require(_0xf6e2('0x5'));var sox=require('sox');var csv=require(_0xf6e2('0x6'));var ejs=require(_0xf6e2('0x7'));var fs=require('fs');var fs_extra=require(_0xf6e2('0x8'));var _=require('lodash');var squel=require(_0xf6e2('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6e2('0x6'));var querystring=require('querystring');var Papa=require(_0xf6e2('0xa'));var Redis=require(_0xf6e2('0xb'));var authService=require(_0xf6e2('0xc'));var qs=require(_0xf6e2('0xd'));var as=require(_0xf6e2('0xe'));var hardwareService=require(_0xf6e2('0xf'));var logger=require(_0xf6e2('0x10'))(_0xf6e2('0x11'));var utils=require(_0xf6e2('0x12'));var config=require(_0xf6e2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6e2('0x14'))['db'];function respondWithStatusCode(_0x565226,_0x490c33){_0x490c33=_0x490c33||0xcc;return function(_0x1593c4){if(_0x1593c4){return _0x565226[_0xf6e2('0x15')](_0x490c33);}return _0x565226[_0xf6e2('0x16')](_0x490c33)['end']();};}function respondWithResult(_0x3a8a37,_0x5901f1){_0x5901f1=_0x5901f1||0xc8;return function(_0xc0084){if(_0xc0084){return _0x3a8a37[_0xf6e2('0x16')](_0x5901f1)[_0xf6e2('0x17')](_0xc0084);}};}function respondWithFilteredResult(_0x25f5f2,_0x55a245){return function(_0x43380c){if(_0x43380c){var _0x16a536=typeof _0x55a245[_0xf6e2('0x18')]==='undefined'&&typeof _0x55a245[_0xf6e2('0x19')]==='undefined';var _0x4e4e2d=_0x43380c[_0xf6e2('0x1a')];var _0xbea12e=_0x16a536?0x0:_0x55a245[_0xf6e2('0x18')];var _0x23d461=_0x16a536?_0x43380c[_0xf6e2('0x1a')]:_0x55a245[_0xf6e2('0x18')]+_0x55a245[_0xf6e2('0x19')];var _0x544e4a;if(_0x23d461>=_0x4e4e2d){_0x23d461=_0x4e4e2d;_0x544e4a=0xc8;}else{_0x544e4a=0xce;}_0x25f5f2[_0xf6e2('0x16')](_0x544e4a);return _0x25f5f2[_0xf6e2('0x1b')](_0xf6e2('0x1c'),_0xbea12e+'-'+_0x23d461+'/'+_0x4e4e2d)[_0xf6e2('0x17')](_0x43380c);}return null;};}function patchUpdates(_0x17922e){return function(_0x573c00){try{jsonpatch[_0xf6e2('0x1d')](_0x573c00,_0x17922e,!![]);}catch(_0x42bc5d){return BPromise[_0xf6e2('0x1e')](_0x42bc5d);}return _0x573c00['save']();};}function saveUpdates(_0xcde8c7,_0x20ad39){return function(_0x36fd97){if(_0x36fd97){return _0x36fd97['update'](_0xcde8c7)[_0xf6e2('0x1f')](function(_0xdb9403){return _0xdb9403;});}return null;};}function removeEntity(_0x20f6c7,_0x380e71){return function(_0x13f2a4){if(_0x13f2a4){return _0x13f2a4[_0xf6e2('0x20')]()[_0xf6e2('0x1f')](function(){_0x20f6c7[_0xf6e2('0x16')](0xcc)[_0xf6e2('0x21')]();});}};}function handleEntityNotFound(_0x5d7bca,_0x27d077){return function(_0x1313da){if(!_0x1313da){_0x5d7bca[_0xf6e2('0x15')](0x194);}return _0x1313da;};}function handleError(_0x3e24de,_0x5cfc5b){_0x5cfc5b=_0x5cfc5b||0x1f4;return function(_0x2a62b7){logger[_0xf6e2('0x22')](_0x2a62b7[_0xf6e2('0x23')]);if(_0x2a62b7[_0xf6e2('0x24')]){delete _0x2a62b7[_0xf6e2('0x24')];}_0x3e24de['status'](_0x5cfc5b)[_0xf6e2('0x25')](_0x2a62b7);};}exports[_0xf6e2('0x26')]=function(_0x556f3f,_0x4e0c04){var _0x303eb9={},_0x27506d={},_0x451497={'count':0x0,'rows':[]};var _0x53ba05=_[_0xf6e2('0x27')](db['JscriptySessionReport'][_0xf6e2('0x28')],function(_0x3a6e83){return{'name':_0x3a6e83[_0xf6e2('0x29')],'type':_0x3a6e83['type']['key']};});_0x27506d[_0xf6e2('0x2a')]=_[_0xf6e2('0x27')](_0x53ba05,_0xf6e2('0x24'));_0x27506d['query']=_['keys'](_0x556f3f[_0xf6e2('0x2b')]);_0x27506d[_0xf6e2('0x2c')]=_[_0xf6e2('0x2d')](_0x27506d[_0xf6e2('0x2a')],_0x27506d[_0xf6e2('0x2b')]);_0x303eb9[_0xf6e2('0x2e')]=_[_0xf6e2('0x2d')](_0x27506d[_0xf6e2('0x2a')],qs[_0xf6e2('0x2f')](_0x556f3f['query'][_0xf6e2('0x2f')]));_0x303eb9[_0xf6e2('0x2e')]=_0x303eb9[_0xf6e2('0x2e')][_0xf6e2('0x30')]?_0x303eb9[_0xf6e2('0x2e')]:_0x27506d[_0xf6e2('0x2a')];if(!_0x556f3f[_0xf6e2('0x2b')][_0xf6e2('0x31')](_0xf6e2('0x32'))){_0x303eb9['limit']=qs[_0xf6e2('0x19')](_0x556f3f[_0xf6e2('0x2b')][_0xf6e2('0x19')]);_0x303eb9['offset']=qs[_0xf6e2('0x18')](_0x556f3f[_0xf6e2('0x2b')]['offset']);}_0x303eb9[_0xf6e2('0x33')]=qs[_0xf6e2('0x34')](_0x556f3f[_0xf6e2('0x2b')][_0xf6e2('0x34')]);_0x303eb9[_0xf6e2('0x35')]=qs[_0xf6e2('0x2c')](_[_0xf6e2('0x36')](_0x556f3f[_0xf6e2('0x2b')],_0x27506d[_0xf6e2('0x2c')]),_0x53ba05);if(_0x556f3f['query'][_0xf6e2('0x37')]){_0x303eb9['where']=_[_0xf6e2('0x38')](_0x303eb9[_0xf6e2('0x35')],{'$or':_[_0xf6e2('0x27')](_0x53ba05,function(_0x40f4bb){if(_0x40f4bb['type']!==_0xf6e2('0x39')){var _0x6e5d02={};_0x6e5d02[_0x40f4bb[_0xf6e2('0x24')]]={'$like':'%'+_0x556f3f['query'][_0xf6e2('0x37')]+'%'};return _0x6e5d02;}})});}_0x303eb9=_[_0xf6e2('0x38')]({},_0x303eb9,_0x556f3f['options']);var _0x3691b1={'where':_0x303eb9[_0xf6e2('0x35')]};return db['JscriptySessionReport']['count'](_0x3691b1)[_0xf6e2('0x1f')](function(_0x63368d){_0x451497[_0xf6e2('0x1a')]=_0x63368d;if(_0x556f3f[_0xf6e2('0x2b')][_0xf6e2('0x3a')]){_0x303eb9[_0xf6e2('0x3b')]=[{'all':!![]}];}return db[_0xf6e2('0x3c')][_0xf6e2('0x3d')](_0x303eb9);})[_0xf6e2('0x1f')](function(_0x472f50){_0x451497[_0xf6e2('0x3e')]=_0x472f50;return _0x451497;})[_0xf6e2('0x1f')](respondWithFilteredResult(_0x4e0c04,_0x303eb9))[_0xf6e2('0x3f')](handleError(_0x4e0c04,null));};exports['show']=function(_0x208b48,_0x4d3a65){var _0x504b00={'raw':!![],'where':{'id':_0x208b48[_0xf6e2('0x40')]['id']}},_0x24113c={};_0x24113c[_0xf6e2('0x2a')]=_[_0xf6e2('0x41')](db[_0xf6e2('0x3c')][_0xf6e2('0x28')]);_0x24113c[_0xf6e2('0x2b')]=_[_0xf6e2('0x41')](_0x208b48[_0xf6e2('0x2b')]);_0x24113c[_0xf6e2('0x2c')]=_[_0xf6e2('0x2d')](_0x24113c[_0xf6e2('0x2a')],_0x24113c['query']);_0x504b00[_0xf6e2('0x2e')]=_['intersection'](_0x24113c[_0xf6e2('0x2a')],qs['fields'](_0x208b48[_0xf6e2('0x2b')][_0xf6e2('0x2f')]));_0x504b00[_0xf6e2('0x2e')]=_0x504b00[_0xf6e2('0x2e')][_0xf6e2('0x30')]?_0x504b00[_0xf6e2('0x2e')]:_0x24113c[_0xf6e2('0x2a')];if(_0x208b48[_0xf6e2('0x2b')]['includeAll']){_0x504b00[_0xf6e2('0x3b')]=[{'all':!![]}];}_0x504b00=_[_0xf6e2('0x38')]({},_0x504b00,_0x208b48['options']);return db['JscriptySessionReport'][_0xf6e2('0x42')](_0x504b00)[_0xf6e2('0x1f')](handleEntityNotFound(_0x4d3a65,null))[_0xf6e2('0x1f')](respondWithResult(_0x4d3a65,null))[_0xf6e2('0x3f')](handleError(_0x4d3a65,null));};exports[_0xf6e2('0x43')]=function(_0x368fad,_0x2683a4){return db[_0xf6e2('0x3c')][_0xf6e2('0x43')](_0x368fad[_0xf6e2('0x44')],{})['then'](respondWithResult(_0x2683a4,0xc9))[_0xf6e2('0x3f')](handleError(_0x2683a4,null));};exports['update']=function(_0x42c1d9,_0x4ae18b){if(_0x42c1d9[_0xf6e2('0x44')]['id']){delete _0x42c1d9[_0xf6e2('0x44')]['id'];}return db[_0xf6e2('0x3c')][_0xf6e2('0x42')]({'where':{'id':_0x42c1d9[_0xf6e2('0x40')]['id']}})[_0xf6e2('0x1f')](handleEntityNotFound(_0x4ae18b,null))[_0xf6e2('0x1f')](saveUpdates(_0x42c1d9[_0xf6e2('0x44')],null))[_0xf6e2('0x1f')](respondWithResult(_0x4ae18b,null))[_0xf6e2('0x3f')](handleError(_0x4ae18b,null));};exports[_0xf6e2('0x20')]=function(_0x5ea60b,_0x59e547){return db['JscriptySessionReport'][_0xf6e2('0x42')]({'where':{'id':_0x5ea60b[_0xf6e2('0x40')]['id']}})[_0xf6e2('0x1f')](handleEntityNotFound(_0x59e547,null))[_0xf6e2('0x1f')](removeEntity(_0x59e547,null))['catch'](handleError(_0x59e547,null));};exports[_0xf6e2('0x45')]=function(_0xfccb34,_0x213d42){return db[_0xf6e2('0x3c')][_0xf6e2('0x45')]()['then'](respondWithResult(_0x213d42,null))['catch'](handleError(_0x213d42,null));};exports[_0xf6e2('0x46')]=function(_0x666678,_0x41ea3c,_0x32b640){var _0x317947={'raw':!![],'where':{}};var _0x1b5036={};var _0x17a0a7={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xf6e2('0x47')]({'where':{'id':_0x666678[_0xf6e2('0x40')]['id']}})['then'](handleEntityNotFound(_0x41ea3c,null))[_0xf6e2('0x1f')](function(_0x353f36){if(_0x353f36){_0x1b5036[_0xf6e2('0x2a')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x1b5036['query']=_[_0xf6e2('0x41')](_0x666678[_0xf6e2('0x2b')]);_0x1b5036[_0xf6e2('0x2c')]=_[_0xf6e2('0x2d')](_0x1b5036['model'],_0x1b5036[_0xf6e2('0x2b')]);_0x317947[_0xf6e2('0x2e')]=_[_0xf6e2('0x2d')](_0x1b5036['model'],qs['fields'](_0x666678['query']['fields']));_0x317947[_0xf6e2('0x2e')]=_0x317947[_0xf6e2('0x2e')][_0xf6e2('0x30')]?_0x317947[_0xf6e2('0x2e')]:_0x1b5036[_0xf6e2('0x2a')];if(!_0x666678['query'][_0xf6e2('0x31')](_0xf6e2('0x32'))){_0x317947[_0xf6e2('0x19')]=qs[_0xf6e2('0x19')](_0x666678['query']['limit']);_0x317947[_0xf6e2('0x18')]=qs['offset'](_0x666678[_0xf6e2('0x2b')][_0xf6e2('0x18')]);}_0x317947[_0xf6e2('0x33')]=qs['sort'](_0x666678[_0xf6e2('0x2b')]['sort']);_0x317947[_0xf6e2('0x35')]=qs[_0xf6e2('0x2c')](_[_0xf6e2('0x36')](_0x666678[_0xf6e2('0x2b')],_0x1b5036[_0xf6e2('0x2c')]));_0x317947[_0xf6e2('0x35')]['SessionId']=_0x353f36['id'];if(_0x666678[_0xf6e2('0x2b')]['filter']){_0x317947['where']=_[_0xf6e2('0x38')](_0x317947[_0xf6e2('0x35')],{'$or':_['map'](_0x317947['attributes'],function(_0x569bf2){var _0x57750a={};_0x57750a[_0x569bf2]={'$like':'%'+_0x666678['query'][_0xf6e2('0x37')]+'%'};return _0x57750a;})});}_0x317947=_['merge']({},_0x317947,_0x666678['options']);return db['JscriptyQuestionReport'][_0xf6e2('0x1a')]({'where':_0x317947[_0xf6e2('0x35')]})[_0xf6e2('0x1f')](function(_0x3c29c5){_0x17a0a7[_0xf6e2('0x1a')]=_0x3c29c5;if(_0x666678['query'][_0xf6e2('0x3a')]){_0x317947[_0xf6e2('0x3b')]=[{'all':!![]}];}return db[_0xf6e2('0x48')][_0xf6e2('0x3d')](_0x317947);})[_0xf6e2('0x1f')](function(_0x5b5d66){_0x17a0a7[_0xf6e2('0x3e')]=_0x5b5d66;return _0x17a0a7;});}})[_0xf6e2('0x1f')](respondWithFilteredResult(_0x41ea3c,_0x317947))[_0xf6e2('0x3f')](handleError(_0x41ea3c,null));}; \ No newline at end of file +var _0xe9a8=['create','body','destroy','find','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','order','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','end','error','stack','name','map','JscriptySessionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length'];(function(_0xbad249,_0x52ca5d){var _0x99e39=function(_0x5a507d){while(--_0x5a507d){_0xbad249['push'](_0xbad249['shift']());}};_0x99e39(++_0x52ca5d);}(_0xe9a8,0xa2));var _0x8e9a=function(_0x3c6a41,_0x19ce75){_0x3c6a41=_0x3c6a41-0x0;var _0xee6d8d=_0xe9a8[_0x3c6a41];return _0xee6d8d;};'use strict';var emlformat=require(_0x8e9a('0x0'));var rimraf=require(_0x8e9a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e9a('0x2'));var rp=require(_0x8e9a('0x3'));var moment=require(_0x8e9a('0x4'));var BPromise=require(_0x8e9a('0x5'));var Mustache=require(_0x8e9a('0x6'));var util=require(_0x8e9a('0x7'));var path=require('path');var sox=require(_0x8e9a('0x8'));var csv=require('to-csv');var ejs=require(_0x8e9a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e9a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e9a('0xb'));var deskjs=require(_0x8e9a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8e9a('0xd'));var Papa=require(_0x8e9a('0xe'));var Redis=require('ioredis');var authService=require(_0x8e9a('0xf'));var qs=require(_0x8e9a('0x10'));var as=require(_0x8e9a('0x11'));var hardwareService=require(_0x8e9a('0x12'));var logger=require(_0x8e9a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8e9a('0x14'));var licenseUtil=require(_0x8e9a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f5577,_0x16f11b){_0x16f11b=_0x16f11b||0xcc;return function(_0x3b6550){if(_0x3b6550){return _0x1f5577[_0x8e9a('0x16')](_0x16f11b);}return _0x1f5577[_0x8e9a('0x17')](_0x16f11b)['end']();};}function respondWithResult(_0x1019bb,_0x150bad){_0x150bad=_0x150bad||0xc8;return function(_0x225dc1){if(_0x225dc1){return _0x1019bb[_0x8e9a('0x17')](_0x150bad)['json'](_0x225dc1);}};}function respondWithFilteredResult(_0x1f7729,_0x5b84cd){return function(_0x158cbb){if(_0x158cbb){var _0x7563bf=typeof _0x5b84cd[_0x8e9a('0x18')]===_0x8e9a('0x19')&&typeof _0x5b84cd[_0x8e9a('0x1a')]===_0x8e9a('0x19');var _0xe9fb7a=_0x158cbb[_0x8e9a('0x1b')];var _0x36417b=_0x7563bf?0x0:_0x5b84cd[_0x8e9a('0x18')];var _0x20f45a=_0x7563bf?_0x158cbb[_0x8e9a('0x1b')]:_0x5b84cd[_0x8e9a('0x18')]+_0x5b84cd['limit'];var _0x299a20;if(_0x20f45a>=_0xe9fb7a){_0x20f45a=_0xe9fb7a;_0x299a20=0xc8;}else{_0x299a20=0xce;}_0x1f7729[_0x8e9a('0x17')](_0x299a20);return _0x1f7729[_0x8e9a('0x1c')](_0x8e9a('0x1d'),_0x36417b+'-'+_0x20f45a+'/'+_0xe9fb7a)[_0x8e9a('0x1e')](_0x158cbb);}return null;};}function patchUpdates(_0x359b30){return function(_0x29b6cd){try{jsonpatch[_0x8e9a('0x1f')](_0x29b6cd,_0x359b30,!![]);}catch(_0x58862c){return BPromise['reject'](_0x58862c);}return _0x29b6cd[_0x8e9a('0x20')]();};}function saveUpdates(_0x77523e,_0x17d4b4){return function(_0x3d63ff){if(_0x3d63ff){return _0x3d63ff['update'](_0x77523e)[_0x8e9a('0x21')](function(_0x428432){return _0x428432;});}return null;};}function removeEntity(_0x30b244,_0x3e8e74){return function(_0x58a4c1){if(_0x58a4c1){return _0x58a4c1['destroy']()[_0x8e9a('0x21')](function(){_0x30b244['status'](0xcc)[_0x8e9a('0x22')]();});}};}function handleEntityNotFound(_0x782779,_0x4d8741){return function(_0x55055c){if(!_0x55055c){_0x782779[_0x8e9a('0x16')](0x194);}return _0x55055c;};}function handleError(_0x2e2963,_0x5cc319){_0x5cc319=_0x5cc319||0x1f4;return function(_0x55ff92){logger[_0x8e9a('0x23')](_0x55ff92[_0x8e9a('0x24')]);if(_0x55ff92['name']){delete _0x55ff92[_0x8e9a('0x25')];}_0x2e2963[_0x8e9a('0x17')](_0x5cc319)['send'](_0x55ff92);};}exports['index']=function(_0x40f61b,_0x2cb4bf){var _0x51763d={},_0x41657d={},_0x1e6fe6={'count':0x0,'rows':[]};var _0xffabc9=_[_0x8e9a('0x26')](db[_0x8e9a('0x27')][_0x8e9a('0x28')],function(_0x3b194d){return{'name':_0x3b194d['fieldName'],'type':_0x3b194d[_0x8e9a('0x29')][_0x8e9a('0x2a')]};});_0x41657d[_0x8e9a('0x2b')]=_[_0x8e9a('0x26')](_0xffabc9,_0x8e9a('0x25'));_0x41657d['query']=_['keys'](_0x40f61b[_0x8e9a('0x2c')]);_0x41657d[_0x8e9a('0x2d')]=_[_0x8e9a('0x2e')](_0x41657d[_0x8e9a('0x2b')],_0x41657d[_0x8e9a('0x2c')]);_0x51763d[_0x8e9a('0x2f')]=_['intersection'](_0x41657d[_0x8e9a('0x2b')],qs[_0x8e9a('0x30')](_0x40f61b['query'][_0x8e9a('0x30')]));_0x51763d[_0x8e9a('0x2f')]=_0x51763d[_0x8e9a('0x2f')]['length']?_0x51763d['attributes']:_0x41657d[_0x8e9a('0x2b')];if(!_0x40f61b['query']['hasOwnProperty'](_0x8e9a('0x31'))){_0x51763d[_0x8e9a('0x1a')]=qs[_0x8e9a('0x1a')](_0x40f61b['query'][_0x8e9a('0x1a')]);_0x51763d[_0x8e9a('0x18')]=qs[_0x8e9a('0x18')](_0x40f61b[_0x8e9a('0x2c')]['offset']);}_0x51763d['order']=qs[_0x8e9a('0x32')](_0x40f61b['query']['sort']);_0x51763d[_0x8e9a('0x33')]=qs[_0x8e9a('0x2d')](_[_0x8e9a('0x34')](_0x40f61b[_0x8e9a('0x2c')],_0x41657d[_0x8e9a('0x2d')]),_0xffabc9);if(_0x40f61b[_0x8e9a('0x2c')][_0x8e9a('0x35')]){_0x51763d[_0x8e9a('0x33')]=_[_0x8e9a('0x36')](_0x51763d[_0x8e9a('0x33')],{'$or':_[_0x8e9a('0x26')](_0xffabc9,function(_0x5ba455){if(_0x5ba455[_0x8e9a('0x29')]!==_0x8e9a('0x37')){var _0x16f501={};_0x16f501[_0x5ba455[_0x8e9a('0x25')]]={'$like':'%'+_0x40f61b[_0x8e9a('0x2c')][_0x8e9a('0x35')]+'%'};return _0x16f501;}})});}_0x51763d=_['merge']({},_0x51763d,_0x40f61b[_0x8e9a('0x38')]);var _0x57f147={'where':_0x51763d[_0x8e9a('0x33')]};return db['JscriptySessionReport'][_0x8e9a('0x1b')](_0x57f147)[_0x8e9a('0x21')](function(_0x84d8a4){_0x1e6fe6[_0x8e9a('0x1b')]=_0x84d8a4;if(_0x40f61b[_0x8e9a('0x2c')][_0x8e9a('0x39')]){_0x51763d[_0x8e9a('0x3a')]=[{'all':!![]}];}return db[_0x8e9a('0x27')][_0x8e9a('0x3b')](_0x51763d);})[_0x8e9a('0x21')](function(_0x3c5163){_0x1e6fe6[_0x8e9a('0x3c')]=_0x3c5163;return _0x1e6fe6;})['then'](respondWithFilteredResult(_0x2cb4bf,_0x51763d))[_0x8e9a('0x3d')](handleError(_0x2cb4bf,null));};exports[_0x8e9a('0x3e')]=function(_0x2f43c6,_0x13edab){var _0xba8260={'raw':!![],'where':{'id':_0x2f43c6[_0x8e9a('0x3f')]['id']}},_0x107ec9={};_0x107ec9[_0x8e9a('0x2b')]=_['keys'](db[_0x8e9a('0x27')][_0x8e9a('0x28')]);_0x107ec9['query']=_[_0x8e9a('0x40')](_0x2f43c6[_0x8e9a('0x2c')]);_0x107ec9[_0x8e9a('0x2d')]=_['intersection'](_0x107ec9[_0x8e9a('0x2b')],_0x107ec9['query']);_0xba8260[_0x8e9a('0x2f')]=_[_0x8e9a('0x2e')](_0x107ec9[_0x8e9a('0x2b')],qs[_0x8e9a('0x30')](_0x2f43c6['query']['fields']));_0xba8260[_0x8e9a('0x2f')]=_0xba8260[_0x8e9a('0x2f')][_0x8e9a('0x41')]?_0xba8260['attributes']:_0x107ec9[_0x8e9a('0x2b')];if(_0x2f43c6[_0x8e9a('0x2c')][_0x8e9a('0x39')]){_0xba8260[_0x8e9a('0x3a')]=[{'all':!![]}];}_0xba8260=_[_0x8e9a('0x36')]({},_0xba8260,_0x2f43c6[_0x8e9a('0x38')]);return db[_0x8e9a('0x27')]['find'](_0xba8260)[_0x8e9a('0x21')](handleEntityNotFound(_0x13edab,null))['then'](respondWithResult(_0x13edab,null))[_0x8e9a('0x3d')](handleError(_0x13edab,null));};exports[_0x8e9a('0x42')]=function(_0x441013,_0x5a3b62){return db['JscriptySessionReport'][_0x8e9a('0x42')](_0x441013[_0x8e9a('0x43')],{})[_0x8e9a('0x21')](respondWithResult(_0x5a3b62,0xc9))['catch'](handleError(_0x5a3b62,null));};exports['update']=function(_0x3711e2,_0x48e05e){if(_0x3711e2[_0x8e9a('0x43')]['id']){delete _0x3711e2[_0x8e9a('0x43')]['id'];}return db[_0x8e9a('0x27')]['find']({'where':{'id':_0x3711e2['params']['id']}})['then'](handleEntityNotFound(_0x48e05e,null))['then'](saveUpdates(_0x3711e2[_0x8e9a('0x43')],null))[_0x8e9a('0x21')](respondWithResult(_0x48e05e,null))[_0x8e9a('0x3d')](handleError(_0x48e05e,null));};exports[_0x8e9a('0x44')]=function(_0xfe92d3,_0x209bbf){return db[_0x8e9a('0x27')][_0x8e9a('0x45')]({'where':{'id':_0xfe92d3[_0x8e9a('0x3f')]['id']}})[_0x8e9a('0x21')](handleEntityNotFound(_0x209bbf,null))[_0x8e9a('0x21')](removeEntity(_0x209bbf,null))['catch'](handleError(_0x209bbf,null));};exports[_0x8e9a('0x46')]=function(_0x2a9f7b,_0x499d87){return db[_0x8e9a('0x27')][_0x8e9a('0x46')]()[_0x8e9a('0x21')](respondWithResult(_0x499d87,null))[_0x8e9a('0x3d')](handleError(_0x499d87,null));};exports[_0x8e9a('0x47')]=function(_0x3a42a3,_0x21cea8,_0x28780c){var _0x26a115={'raw':!![],'where':{}};var _0x4b4006={};var _0x1b309c={'count':0x0,'rows':[]};return db[_0x8e9a('0x27')]['findOne']({'where':{'id':_0x3a42a3[_0x8e9a('0x3f')]['id']}})[_0x8e9a('0x21')](handleEntityNotFound(_0x21cea8,null))[_0x8e9a('0x21')](function(_0x485651){if(_0x485651){_0x4b4006[_0x8e9a('0x2b')]=_[_0x8e9a('0x40')](db[_0x8e9a('0x48')][_0x8e9a('0x28')]);_0x4b4006[_0x8e9a('0x2c')]=_['keys'](_0x3a42a3[_0x8e9a('0x2c')]);_0x4b4006[_0x8e9a('0x2d')]=_[_0x8e9a('0x2e')](_0x4b4006[_0x8e9a('0x2b')],_0x4b4006['query']);_0x26a115[_0x8e9a('0x2f')]=_[_0x8e9a('0x2e')](_0x4b4006[_0x8e9a('0x2b')],qs[_0x8e9a('0x30')](_0x3a42a3['query'][_0x8e9a('0x30')]));_0x26a115[_0x8e9a('0x2f')]=_0x26a115[_0x8e9a('0x2f')][_0x8e9a('0x41')]?_0x26a115[_0x8e9a('0x2f')]:_0x4b4006['model'];if(!_0x3a42a3[_0x8e9a('0x2c')][_0x8e9a('0x49')](_0x8e9a('0x31'))){_0x26a115[_0x8e9a('0x1a')]=qs[_0x8e9a('0x1a')](_0x3a42a3[_0x8e9a('0x2c')]['limit']);_0x26a115[_0x8e9a('0x18')]=qs[_0x8e9a('0x18')](_0x3a42a3[_0x8e9a('0x2c')]['offset']);}_0x26a115[_0x8e9a('0x4a')]=qs[_0x8e9a('0x32')](_0x3a42a3[_0x8e9a('0x2c')][_0x8e9a('0x32')]);_0x26a115[_0x8e9a('0x33')]=qs['filters'](_[_0x8e9a('0x34')](_0x3a42a3[_0x8e9a('0x2c')],_0x4b4006[_0x8e9a('0x2d')]));_0x26a115['where'][_0x8e9a('0x4b')]=_0x485651['id'];if(_0x3a42a3[_0x8e9a('0x2c')]['filter']){_0x26a115[_0x8e9a('0x33')]=_[_0x8e9a('0x36')](_0x26a115[_0x8e9a('0x33')],{'$or':_[_0x8e9a('0x26')](_0x26a115[_0x8e9a('0x2f')],function(_0x2ffccb){var _0x4b3a17={};_0x4b3a17[_0x2ffccb]={'$like':'%'+_0x3a42a3[_0x8e9a('0x2c')]['filter']+'%'};return _0x4b3a17;})});}_0x26a115=_[_0x8e9a('0x36')]({},_0x26a115,_0x3a42a3[_0x8e9a('0x38')]);return db[_0x8e9a('0x48')][_0x8e9a('0x1b')]({'where':_0x26a115[_0x8e9a('0x33')]})[_0x8e9a('0x21')](function(_0x33a9fb){_0x1b309c[_0x8e9a('0x1b')]=_0x33a9fb;if(_0x3a42a3[_0x8e9a('0x2c')][_0x8e9a('0x39')]){_0x26a115['include']=[{'all':!![]}];}return db[_0x8e9a('0x48')][_0x8e9a('0x3b')](_0x26a115);})[_0x8e9a('0x21')](function(_0x772fbb){_0x1b309c[_0x8e9a('0x3c')]=_0x772fbb;return _0x1b309c;});}})[_0x8e9a('0x21')](respondWithFilteredResult(_0x21cea8,_0x26a115))[_0x8e9a('0x3d')](handleError(_0x21cea8,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 35cd709..3584b97 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 _0x56a4=['./jscriptySessionReport.attributes','exports','report_jscripty_sessions','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0x517f13,_0x4b9381){var _0x45d047=function(_0x131e68){while(--_0x131e68){_0x517f13['push'](_0x517f13['shift']());}};_0x45d047(++_0x4b9381);}(_0x56a4,0x11b));var _0x456a=function(_0x26ea61,_0x1b983c){_0x26ea61=_0x26ea61-0x0;var _0x1b89c4=_0x56a4[_0x26ea61];return _0x1b89c4;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('JscriptySessionReport',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafb9=['request-promise','path','rimraf','exports','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ea015,_0x510ef9){var _0x4b5bf7=function(_0x180733){while(--_0x180733){_0x5ea015['push'](_0x5ea015['shift']());}};_0x4b5bf7(++_0x510ef9);}(_0xafb9,0x68));var _0x9afb=function(_0x53a94d,_0x3272fc){_0x53a94d=_0x53a94d-0x0;var _0x2a0fa6=_0xafb9[_0x53a94d];return _0x2a0fa6;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('JscriptySessionReport',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 5148cfb..b5305b7 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xdf3217,_0x4a884d){var _0x3f5824=function(_0x243ae2){while(--_0x243ae2){_0xdf3217['push'](_0xdf3217['shift']());}};_0x3f5824(++_0x4a884d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x2d72=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','JscriptySessionReport,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x48f49c,_0x4affb6){var _0x124f63=function(_0x4e54af){while(--_0x4e54af){_0x48f49c['push'](_0x48f49c['shift']());}};_0x124f63(++_0x4affb6);}(_0x2d72,0xa8));var _0x22d7=function(_0xe664b,_0x1f42fb){_0xe664b=_0xe664b-0x0;var _0x27b456=_0x2d72[_0xe664b];return _0x27b456;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52a3e3,_0x23a731,_0x3791d6){return new BPromise(function(_0x492ca8,_0x3b12cd){return client[_0x22d7('0xe')](_0x52a3e3,_0x3791d6)[_0x22d7('0xf')](function(_0x3c694f){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x23a731,_0x22d7('0x10'));logger[_0x22d7('0x11')](_0x22d7('0x12'),_0x23a731,_0x22d7('0x10'),JSON[_0x22d7('0x13')](_0x3c694f));if(_0x3c694f['error']){if(_0x3c694f['error'][_0x22d7('0x14')]===0x1f4){logger['error'](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')]['message']);return _0x3b12cd(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);return _0x492ca8(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}else{logger['info'](_0x22d7('0x15'),_0x23a731,_0x22d7('0x10'));_0x492ca8(_0x3c694f[_0x22d7('0x18')]['message']);}})['catch'](function(_0x52b21c){logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x52b21c);_0x3b12cd(_0x52b21c);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 868abb6..dc3969d 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 _0x2b05=['isAuthenticated','update','downloadLogFile','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id'];(function(_0x8a5d12,_0x18481e){var _0x257079=function(_0x40ce19){while(--_0x40ce19){_0x8a5d12['push'](_0x8a5d12['shift']());}};_0x257079(++_0x18481e);}(_0x2b05,0x1d4));var _0x52b0=function(_0x3cef5a,_0x257de3){_0x3cef5a=_0x3cef5a-0x0;var _0x153d84=_0x2b05[_0x3cef5a];return _0x153d84;};'use strict';var multer=require(_0x52b0('0x0'));var util=require('util');var path=require(_0x52b0('0x1'));var timeout=require(_0x52b0('0x2'));var express=require(_0x52b0('0x3'));var router=express['Router']();var fs_extra=require(_0x52b0('0x4'));var auth=require(_0x52b0('0x5'));var interaction=require(_0x52b0('0x6'));var config=require('../../config/environment');var controller=require(_0x52b0('0x7'));router[_0x52b0('0x8')]('/',controller[_0x52b0('0x9')]);router[_0x52b0('0xa')](_0x52b0('0xb'),auth[_0x52b0('0xc')](),controller[_0x52b0('0xd')]);router[_0x52b0('0x8')]('/download_log_file',auth[_0x52b0('0xc')](),controller[_0x52b0('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9850=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','multer'];(function(_0x1e7954,_0x5c9ad2){var _0x11bfe8=function(_0x229940){while(--_0x229940){_0x1e7954['push'](_0x1e7954['shift']());}};_0x11bfe8(++_0x5c9ad2);}(_0x9850,0x167));var _0x0985=function(_0x46b1d9,_0x3cab96){_0x46b1d9=_0x46b1d9-0x0;var _0x561fc5=_0x9850[_0x46b1d9];return _0x561fc5;};'use strict';var multer=require(_0x0985('0x0'));var util=require(_0x0985('0x1'));var path=require('path');var timeout=require(_0x0985('0x2'));var express=require(_0x0985('0x3'));var router=express[_0x0985('0x4')]();var fs_extra=require(_0x0985('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0985('0x6'));var config=require(_0x0985('0x7'));var controller=require(_0x0985('0x8'));router['get']('/',controller['index']);router[_0x0985('0x9')](_0x0985('0xa'),auth[_0x0985('0xb')](),controller[_0x0985('0xc')]);router['get'](_0x0985('0xd'),auth[_0x0985('0xb')](),controller[_0x0985('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 19546bc..62faa7e 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 _0x3fa8=['exports','STRING','INTEGER','sequelize'];(function(_0x3cfaea,_0x59581c){var _0x5131f6=function(_0x57deeb){while(--_0x57deeb){_0x3cfaea['push'](_0x3cfaea['shift']());}};_0x5131f6(++_0x59581c);}(_0x3fa8,0x1f3));var _0x83fa=function(_0x140c64,_0x4c4056){_0x140c64=_0x140c64-0x0;var _0x3f0c30=_0x3fa8[_0x140c64];return _0x3f0c30;};'use strict';var Sequelize=require(_0x83fa('0x0'));module[_0x83fa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x83fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x83fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbbde=['STRING','sequelize','exports'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xbbde,0xdf));var _0xebbd=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xbbde[_0x19babd];return _0x314eaf;};'use strict';var Sequelize=require(_0xebbd('0x0'));module[_0xebbd('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xebbd('0x2')]},'data2':{'type':Sequelize['STRING']},'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 ba1174e..c44846c 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 _0xb054=['fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0xddeac9,_0x2ebf8c){var _0x65fa72=function(_0x795e4f){while(--_0x795e4f){_0xddeac9['push'](_0xddeac9['shift']());}};_0x65fa72(++_0x2ebf8c);}(_0xb054,0x88));var _0x4b05=function(_0x168fd3,_0x11fbbd){_0x168fd3=_0x168fd3-0x0;var _0x47f2b7=_0xb054[_0x168fd3];return _0x47f2b7;};'use strict';var emlformat=require(_0x4b05('0x0'));var rimraf=require(_0x4b05('0x1'));var zipdir=require(_0x4b05('0x2'));var jsonpatch=require(_0x4b05('0x3'));var rp=require(_0x4b05('0x4'));var moment=require('moment');var BPromise=require(_0x4b05('0x5'));var Mustache=require(_0x4b05('0x6'));var util=require(_0x4b05('0x7'));var path=require(_0x4b05('0x8'));var sox=require(_0x4b05('0x9'));var csv=require(_0x4b05('0xa'));var ejs=require(_0x4b05('0xb'));var fs=require('fs');var fs_extra=require(_0x4b05('0xc'));var _=require('lodash');var squel=require(_0x4b05('0xd'));var crypto=require(_0x4b05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4b05('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b05('0x10'));var Redis=require(_0x4b05('0x11'));var authService=require(_0x4b05('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4b05('0x13'));var hardwareService=require(_0x4b05('0x14'));var logger=require(_0x4b05('0x15'))(_0x4b05('0x16'));var utils=require(_0x4b05('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4b05('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f39be,_0x831199){_0x831199=_0x831199||0xcc;return function(_0x2cb09b){if(_0x2cb09b){return _0x2f39be[_0x4b05('0x19')](_0x831199);}return _0x2f39be[_0x4b05('0x1a')](_0x831199)['end']();};}function respondWithResult(_0x199664,_0x49caba){_0x49caba=_0x49caba||0xc8;return function(_0x5bfd98){if(_0x5bfd98){return _0x199664[_0x4b05('0x1a')](_0x49caba)[_0x4b05('0x1b')](_0x5bfd98);}};}function respondWithFilteredResult(_0x3ba755,_0x116eaf){return function(_0x32c42a){if(_0x32c42a){var _0x5db81d=typeof _0x116eaf['offset']===_0x4b05('0x1c')&&typeof _0x116eaf[_0x4b05('0x1d')]===_0x4b05('0x1c');var _0x3703f5=_0x32c42a['count'];var _0x31b5d5=_0x5db81d?0x0:_0x116eaf['offset'];var _0x3a9870=_0x5db81d?_0x32c42a[_0x4b05('0x1e')]:_0x116eaf[_0x4b05('0x1f')]+_0x116eaf[_0x4b05('0x1d')];var _0x24a545;if(_0x3a9870>=_0x3703f5){_0x3a9870=_0x3703f5;_0x24a545=0xc8;}else{_0x24a545=0xce;}_0x3ba755[_0x4b05('0x1a')](_0x24a545);return _0x3ba755[_0x4b05('0x20')](_0x4b05('0x21'),_0x31b5d5+'-'+_0x3a9870+'/'+_0x3703f5)['json'](_0x32c42a);}return null;};}function patchUpdates(_0x4fd60e){return function(_0x1a2aa8){try{jsonpatch[_0x4b05('0x22')](_0x1a2aa8,_0x4fd60e,!![]);}catch(_0x2781b2){return BPromise[_0x4b05('0x23')](_0x2781b2);}return _0x1a2aa8[_0x4b05('0x24')]();};}function saveUpdates(_0x315759,_0x4c30f5){return function(_0xf8c064){if(_0xf8c064){return _0xf8c064['update'](_0x315759)[_0x4b05('0x25')](function(_0x461d2d){return _0x461d2d;});}return null;};}function removeEntity(_0x13ac63,_0x46f692){return function(_0x11a97e){if(_0x11a97e){return _0x11a97e[_0x4b05('0x26')]()[_0x4b05('0x25')](function(){_0x13ac63[_0x4b05('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x588a8e,_0x4d0b1f){return function(_0x3cd23c){if(!_0x3cd23c){_0x588a8e[_0x4b05('0x19')](0x194);}return _0x3cd23c;};}function handleError(_0x2a5b2a,_0x473aac){_0x473aac=_0x473aac||0x1f4;return function(_0x46f973){logger[_0x4b05('0x27')](_0x46f973['stack']);if(_0x46f973[_0x4b05('0x28')]){delete _0x46f973[_0x4b05('0x28')];}_0x2a5b2a[_0x4b05('0x1a')](_0x473aac)[_0x4b05('0x29')](_0x46f973);};}var utilLicense=require(_0x4b05('0x18'));exports[_0x4b05('0x2a')]=function(_0x1e72e6,_0x5a87ef){var _0x474a90={'raw':!![],'where':{'id':0x1}},_0x168160={};_0x168160[_0x4b05('0x2b')]=_[_0x4b05('0x2c')](db[_0x4b05('0x2d')][_0x4b05('0x2e')]);_0x168160[_0x4b05('0x2f')]=_[_0x4b05('0x2c')](_0x1e72e6[_0x4b05('0x2f')]);_0x168160[_0x4b05('0x30')]=_[_0x4b05('0x31')](_0x168160[_0x4b05('0x2b')],_0x168160['query']);_0x474a90[_0x4b05('0x32')]=_[_0x4b05('0x31')](_0x168160['model'],qs[_0x4b05('0x33')](_0x1e72e6[_0x4b05('0x2f')][_0x4b05('0x33')]));_0x474a90[_0x4b05('0x32')]=_0x474a90['attributes'][_0x4b05('0x34')]?_0x474a90[_0x4b05('0x32')]:_0x168160['model'];_0x474a90=_[_0x4b05('0x35')]({},_0x474a90,_0x1e72e6[_0x4b05('0x36')]);return utilLicense[_0x4b05('0x37')](_0x474a90)[_0x4b05('0x25')](respondWithResult(_0x5a87ef,null))[_0x4b05('0x38')](handleError(_0x5a87ef,null));};exports['update']=function(_0x29d23c,_0x4d09f7){if(_0x29d23c[_0x4b05('0x39')]['id']){delete _0x29d23c[_0x4b05('0x39')]['id'];}return db[_0x4b05('0x2d')][_0x4b05('0x3a')]({'where':{'id':_0x29d23c[_0x4b05('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4d09f7,null))['then'](function(_0x309a81){var _0x13c8ea=_0x309a81[_0x4b05('0x3c')]({'plain':!![]});return utilLicense[_0x4b05('0x3d')](_0x13c8ea,_0x29d23c[_0x4b05('0x39')][_0x4b05('0x3e')]);})[_0x4b05('0x25')](function(_0x2b5a14){if(!_0x2b5a14['demo']){return saveUpdates(_0x29d23c[_0x4b05('0x39')],null);}return _0x2b5a14;})['then'](respondWithResult(_0x4d09f7,null))[_0x4b05('0x38')](handleError(_0x4d09f7,null));};exports[_0x4b05('0x3f')]=function(_0x43b05a,_0xb7f6b4){var _0x364287=_0x4b05('0x40');var _0x3bf58e=path[_0x4b05('0x41')](_0x4b05('0x42'),_0x4b05('0x43'),_0x4b05('0x44'),_0x364287);_0xb7f6b4[_0x4b05('0x45')]('Content-disposition',_0x4b05('0x46')+_0x364287);_0xb7f6b4[_0x4b05('0x20')](_0x4b05('0x47'),_0x4b05('0x48'));_0xb7f6b4[_0x4b05('0x49')](_0x3bf58e);}; \ No newline at end of file +var _0x1d91=['error','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','body','find','checkLicense','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus'];(function(_0x4111dc,_0xce5397){var _0xf85d3f=function(_0xde31e2){while(--_0xde31e2){_0x4111dc['push'](_0x4111dc['shift']());}};_0xf85d3f(++_0xce5397);}(_0x1d91,0x138));var _0x11d9=function(_0x25d5d9,_0x1c39ec){_0x25d5d9=_0x25d5d9-0x0;var _0x14a54e=_0x1d91[_0x25d5d9];return _0x14a54e;};'use strict';var emlformat=require(_0x11d9('0x0'));var rimraf=require(_0x11d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x11d9('0x2'));var moment=require(_0x11d9('0x3'));var BPromise=require(_0x11d9('0x4'));var Mustache=require(_0x11d9('0x5'));var util=require(_0x11d9('0x6'));var path=require(_0x11d9('0x7'));var sox=require(_0x11d9('0x8'));var csv=require(_0x11d9('0x9'));var ejs=require(_0x11d9('0xa'));var fs=require('fs');var fs_extra=require(_0x11d9('0xb'));var _=require('lodash');var squel=require(_0x11d9('0xc'));var crypto=require(_0x11d9('0xd'));var jsforce=require(_0x11d9('0xe'));var deskjs=require(_0x11d9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x11d9('0x10'));var Papa=require(_0x11d9('0x11'));var Redis=require(_0x11d9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x11d9('0x13'));var as=require(_0x11d9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11d9('0x15'))(_0x11d9('0x16'));var utils=require('../../config/utils');var config=require(_0x11d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x11d9('0x18'))['db'];function respondWithStatusCode(_0x295bfc,_0x45fdf5){_0x45fdf5=_0x45fdf5||0xcc;return function(_0x555357){if(_0x555357){return _0x295bfc['sendStatus'](_0x45fdf5);}return _0x295bfc['status'](_0x45fdf5)[_0x11d9('0x19')]();};}function respondWithResult(_0x3c441c,_0x542f29){_0x542f29=_0x542f29||0xc8;return function(_0x1483df){if(_0x1483df){return _0x3c441c[_0x11d9('0x1a')](_0x542f29)[_0x11d9('0x1b')](_0x1483df);}};}function respondWithFilteredResult(_0x20a265,_0x422255){return function(_0x4d8123){if(_0x4d8123){var _0x54a64f=typeof _0x422255[_0x11d9('0x1c')]===_0x11d9('0x1d')&&typeof _0x422255[_0x11d9('0x1e')]===_0x11d9('0x1d');var _0x4144e8=_0x4d8123[_0x11d9('0x1f')];var _0x94e132=_0x54a64f?0x0:_0x422255[_0x11d9('0x1c')];var _0x474701=_0x54a64f?_0x4d8123[_0x11d9('0x1f')]:_0x422255[_0x11d9('0x1c')]+_0x422255[_0x11d9('0x1e')];var _0x15f2b8;if(_0x474701>=_0x4144e8){_0x474701=_0x4144e8;_0x15f2b8=0xc8;}else{_0x15f2b8=0xce;}_0x20a265[_0x11d9('0x1a')](_0x15f2b8);return _0x20a265[_0x11d9('0x20')]('Content-Range',_0x94e132+'-'+_0x474701+'/'+_0x4144e8)[_0x11d9('0x1b')](_0x4d8123);}return null;};}function patchUpdates(_0x4696c4){return function(_0x3d9040){try{jsonpatch['apply'](_0x3d9040,_0x4696c4,!![]);}catch(_0x1b1ee7){return BPromise[_0x11d9('0x21')](_0x1b1ee7);}return _0x3d9040['save']();};}function saveUpdates(_0x468804,_0x16abe8){return function(_0x204b69){if(_0x204b69){return _0x204b69[_0x11d9('0x22')](_0x468804)[_0x11d9('0x23')](function(_0x4a409e){return _0x4a409e;});}return null;};}function removeEntity(_0x32248d,_0x3a554a){return function(_0xf84214){if(_0xf84214){return _0xf84214[_0x11d9('0x24')]()[_0x11d9('0x23')](function(){_0x32248d[_0x11d9('0x1a')](0xcc)[_0x11d9('0x19')]();});}};}function handleEntityNotFound(_0x327468,_0x58a784){return function(_0x3dfbb4){if(!_0x3dfbb4){_0x327468[_0x11d9('0x25')](0x194);}return _0x3dfbb4;};}function handleError(_0x42cabf,_0x506a24){_0x506a24=_0x506a24||0x1f4;return function(_0x547123){logger[_0x11d9('0x26')](_0x547123['stack']);if(_0x547123[_0x11d9('0x27')]){delete _0x547123[_0x11d9('0x27')];}_0x42cabf[_0x11d9('0x1a')](_0x506a24)[_0x11d9('0x28')](_0x547123);};}var utilLicense=require(_0x11d9('0x29'));exports[_0x11d9('0x2a')]=function(_0x3ad36b,_0x210c3d){var _0x22e09a={'raw':!![],'where':{'id':0x1}},_0x42cc2e={};_0x42cc2e[_0x11d9('0x2b')]=_[_0x11d9('0x2c')](db[_0x11d9('0x2d')][_0x11d9('0x2e')]);_0x42cc2e[_0x11d9('0x2f')]=_[_0x11d9('0x2c')](_0x3ad36b[_0x11d9('0x2f')]);_0x42cc2e[_0x11d9('0x30')]=_[_0x11d9('0x31')](_0x42cc2e[_0x11d9('0x2b')],_0x42cc2e[_0x11d9('0x2f')]);_0x22e09a['attributes']=_[_0x11d9('0x31')](_0x42cc2e[_0x11d9('0x2b')],qs[_0x11d9('0x32')](_0x3ad36b[_0x11d9('0x2f')]['fields']));_0x22e09a[_0x11d9('0x33')]=_0x22e09a[_0x11d9('0x33')][_0x11d9('0x34')]?_0x22e09a[_0x11d9('0x33')]:_0x42cc2e[_0x11d9('0x2b')];_0x22e09a=_['merge']({},_0x22e09a,_0x3ad36b[_0x11d9('0x35')]);return utilLicense[_0x11d9('0x36')](_0x22e09a)[_0x11d9('0x23')](respondWithResult(_0x210c3d,null))['catch'](handleError(_0x210c3d,null));};exports[_0x11d9('0x22')]=function(_0x1730d2,_0x2f18b4){if(_0x1730d2[_0x11d9('0x37')]['id']){delete _0x1730d2[_0x11d9('0x37')]['id'];}return db[_0x11d9('0x2d')][_0x11d9('0x38')]({'where':{'id':_0x1730d2['params']['id']}})['then'](handleEntityNotFound(_0x2f18b4,null))[_0x11d9('0x23')](function(_0x2b7bb6){var _0x56890e=_0x2b7bb6['get']({'plain':!![]});return utilLicense[_0x11d9('0x39')](_0x56890e,_0x1730d2['body'][_0x11d9('0x3a')]);})[_0x11d9('0x23')](function(_0x1719f8){if(!_0x1719f8[_0x11d9('0x3b')]){return saveUpdates(_0x1730d2[_0x11d9('0x37')],null);}return _0x1719f8;})[_0x11d9('0x23')](respondWithResult(_0x2f18b4,null))[_0x11d9('0x3c')](handleError(_0x2f18b4,null));};exports[_0x11d9('0x3d')]=function(_0x1dfb0e,_0x2816c0){var _0x17d166=_0x11d9('0x3e');var _0x3d6661=path[_0x11d9('0x3f')](_0x11d9('0x40'),_0x11d9('0x41'),_0x11d9('0x42'),_0x17d166);_0x2816c0['setHeader']('Content-disposition',_0x11d9('0x43')+_0x17d166);_0x2816c0[_0x11d9('0x20')](_0x11d9('0x44'),_0x11d9('0x45'));_0x2816c0['download'](_0x3d6661);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index de37c97..345b504 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 _0xaaed=['../../config/environment','./license.attributes','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3441e9,_0x269c8a){var _0x7f9ada=function(_0x4e62fd){while(--_0x4e62fd){_0x3441e9['push'](_0x3441e9['shift']());}};_0x7f9ada(++_0x269c8a);}(_0xaaed,0xb2));var _0xdaae=function(_0x2a65a0,_0x534902){_0x2a65a0=_0x2a65a0-0x0;var _0x51b716=_0xaaed[_0x2a65a0];return _0x51b716;};'use strict';var _=require('lodash');var util=require(_0xdaae('0x0'));var logger=require(_0xdaae('0x1'))('api');var moment=require(_0xdaae('0x2'));var BPromise=require(_0xdaae('0x3'));var rp=require(_0xdaae('0x4'));var fs=require('fs');var path=require(_0xdaae('0x5'));var rimraf=require('rimraf');var config=require(_0xdaae('0x6'));var attributes=require(_0xdaae('0x7'));module['exports']=function(_0xc01f6b,_0x217f77){return _0xc01f6b['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e7f=['rimraf','./license.attributes','define','License','license','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1e1ae0,_0x85a4f5){var _0x4e2df1=function(_0x2195e6){while(--_0x2195e6){_0x1e1ae0['push'](_0x1e1ae0['shift']());}};_0x4e2df1(++_0x85a4f5);}(_0x6e7f,0x145));var _0xf6e7=function(_0x45ce99,_0x1a8a94){_0x45ce99=_0x45ce99-0x0;var _0x21b9a5=_0x6e7f[_0x45ce99];return _0x21b9a5;};'use strict';var _=require(_0xf6e7('0x0'));var util=require('util');var logger=require(_0xf6e7('0x1'))('api');var moment=require(_0xf6e7('0x2'));var BPromise=require(_0xf6e7('0x3'));var rp=require(_0xf6e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xf6e7('0x6'));module['exports']=function(_0x33d29d,_0xb4a173){return _0x33d29d[_0xf6e7('0x7')](_0xf6e7('0x8'),attributes,{'tableName':_0xf6e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 44cacf5..ba4702c 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 _0x9356=['License,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x9356,0xa9));var _0x6935=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x9356[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x6935('0x0'));var util=require('util');var moment=require(_0x6935('0x1'));var BPromise=require(_0x6935('0x2'));var rs=require(_0x6935('0x3'));var fs=require('fs');var Redis=require(_0x6935('0x4'));var db=require(_0x6935('0x5'))['db'];var utils=require(_0x6935('0x6'));var logger=require(_0x6935('0x7'))('rpc');var config=require(_0x6935('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6935('0x9')][_0x6935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b02fb,_0x5094e9,_0x148b0c){return new BPromise(function(_0x245a3c,_0x395024){return client[_0x6935('0xb')](_0x4b02fb,_0x148b0c)[_0x6935('0xc')](function(_0x3fe554){logger[_0x6935('0xd')]('License,\x20%s,\x20%s',_0x5094e9,'request\x20sent');logger[_0x6935('0xe')](_0x6935('0xf'),_0x5094e9,_0x6935('0x10'),JSON[_0x6935('0x11')](_0x3fe554));if(_0x3fe554[_0x6935('0x12')]){if(_0x3fe554[_0x6935('0x12')]['code']===0x1f4){logger[_0x6935('0x12')]('License,\x20%s,\x20%s',_0x5094e9,_0x3fe554[_0x6935('0x12')][_0x6935('0x13')]);return _0x395024(_0x3fe554[_0x6935('0x12')][_0x6935('0x13')]);}logger['error'](_0x6935('0x14'),_0x5094e9,_0x3fe554[_0x6935('0x12')]['message']);return _0x245a3c(_0x3fe554[_0x6935('0x12')]['message']);}else{logger['info'](_0x6935('0x14'),_0x5094e9,_0x6935('0x10'));_0x245a3c(_0x3fe554['result'][_0x6935('0x13')]);}})['catch'](function(_0x5bced7){logger[_0x6935('0x12')](_0x6935('0x14'),_0x5094e9,_0x5bced7);_0x395024(_0x5bced7);});});} \ No newline at end of file +var _0xa614=['http','request','then','info','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x2ae70e,_0x5f1224){var _0x41e458=function(_0x2c6ce4){while(--_0x2c6ce4){_0x2ae70e['push'](_0x2ae70e['shift']());}};_0x41e458(++_0x5f1224);}(_0xa614,0x79));var _0x4a61=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0xa614[_0x442f02];return _0xab6ef1;};'use strict';var _=require(_0x4a61('0x0'));var util=require(_0x4a61('0x1'));var moment=require(_0x4a61('0x2'));var BPromise=require(_0x4a61('0x3'));var rs=require(_0x4a61('0x4'));var fs=require('fs');var Redis=require(_0x4a61('0x5'));var db=require(_0x4a61('0x6'))['db'];var utils=require(_0x4a61('0x7'));var logger=require(_0x4a61('0x8'))(_0x4a61('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a61('0xa')][_0x4a61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4eefd0,_0x1bec92,_0x3ae2f1){return new BPromise(function(_0x3b9ff7,_0x425934){return client[_0x4a61('0xc')](_0x4eefd0,_0x3ae2f1)[_0x4a61('0xd')](function(_0x17e8e7){logger[_0x4a61('0xe')]('License,\x20%s,\x20%s',_0x1bec92,_0x4a61('0xf'));logger[_0x4a61('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x1bec92,'request\x20sent',JSON[_0x4a61('0x11')](_0x17e8e7));if(_0x17e8e7[_0x4a61('0x12')]){if(_0x17e8e7[_0x4a61('0x12')][_0x4a61('0x13')]===0x1f4){logger['error'](_0x4a61('0x14'),_0x1bec92,_0x17e8e7['error'][_0x4a61('0x15')]);return _0x425934(_0x17e8e7[_0x4a61('0x12')][_0x4a61('0x15')]);}logger['error'](_0x4a61('0x14'),_0x1bec92,_0x17e8e7[_0x4a61('0x12')][_0x4a61('0x15')]);return _0x3b9ff7(_0x17e8e7[_0x4a61('0x12')]['message']);}else{logger[_0x4a61('0xe')]('License,\x20%s,\x20%s',_0x1bec92,'request\x20sent');_0x3b9ff7(_0x17e8e7['result'][_0x4a61('0x15')]);}})['catch'](function(_0x408e9f){logger[_0x4a61('0x12')]('License,\x20%s,\x20%s',_0x1bec92,_0x408e9f);_0x425934(_0x408e9f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6b71de5..d19c7a6 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 _0x6c8b=['/:id/out_servers','getSmtp','getInteractions','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','/:id/interactions','addInteraction','/:id/applications','addApplications','send','addAgents','put','removeAnswers','removeImap','removeSmtp','delete','removeAgents','exports','multer','util','path','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap'];(function(_0x2e1988,_0x51b133){var _0xbd6e4f=function(_0x49c608){while(--_0x49c608){_0x2e1988['push'](_0x2e1988['shift']());}};_0xbd6e4f(++_0x51b133);}(_0x6c8b,0x1f2));var _0xb6c8=function(_0x410246,_0x5b96cf){_0x410246=_0x410246-0x0;var _0x3210d6=_0x6c8b[_0x410246];return _0x3210d6;};'use strict';var multer=require(_0xb6c8('0x0'));var util=require(_0xb6c8('0x1'));var path=require(_0xb6c8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb6c8('0x3'));var config=require(_0xb6c8('0x4'));var controller=require(_0xb6c8('0x5'));router[_0xb6c8('0x6')]('/',auth['isAuthenticated'](),controller[_0xb6c8('0x7')]);router[_0xb6c8('0x6')](_0xb6c8('0x8'),auth[_0xb6c8('0x9')](),controller['describe']);router[_0xb6c8('0x6')](_0xb6c8('0xa'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0xb')]);router['get'](_0xb6c8('0xc'),auth['isAuthenticated'](),controller[_0xb6c8('0xd')]);router[_0xb6c8('0x6')](_0xb6c8('0xe'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0xf')]);router[_0xb6c8('0x6')](_0xb6c8('0x10'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x11')]);router[_0xb6c8('0x6')](_0xb6c8('0x12'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x13')]);router[_0xb6c8('0x6')]('/:id/interactions',auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x14')]);router[_0xb6c8('0x6')]('/:id/applications',auth[_0xb6c8('0x9')](),controller['getApplications']);router[_0xb6c8('0x6')](_0xb6c8('0x15'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x16')]);router[_0xb6c8('0x6')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0xb6c8('0x6')](_0xb6c8('0x17'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x18')]);router[_0xb6c8('0x19')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb6c8('0x1a')]);router[_0xb6c8('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb6c8('0x1b')]);router[_0xb6c8('0x19')]('/',auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x1c')]);router[_0xb6c8('0x19')](_0xb6c8('0x10'),auth[_0xb6c8('0x9')](),controller['addImap']);router['post'](_0xb6c8('0x12'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x1d')]);router[_0xb6c8('0x19')](_0xb6c8('0x1e'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x1f')]);router['post'](_0xb6c8('0x20'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x21')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xb6c8('0x22')]);router[_0xb6c8('0x19')](_0xb6c8('0x17'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x23')]);router[_0xb6c8('0x24')]('/:id',auth[_0xb6c8('0x9')](),controller['update']);router['delete'](_0xb6c8('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x25')]);router['delete']('/:id/in_servers',auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x26')]);router['delete'](_0xb6c8('0x12'),auth[_0xb6c8('0x9')](),controller[_0xb6c8('0x27')]);router['delete'](_0xb6c8('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xb6c8('0x28')](_0xb6c8('0x17'),auth['isAuthenticated'](),controller[_0xb6c8('0x29')]);module[_0xb6c8('0x2a')]=router; \ No newline at end of file +var _0x95d2=['/:id/dispositions','getDispositions','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','/:id/canned_answers','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','/:id','delete','removeDispositions','removeAnswers','destroy','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x57de49,_0x140369){var _0x4ce44f=function(_0x2f2eee){while(--_0x2f2eee){_0x57de49['push'](_0x57de49['shift']());}};_0x4ce44f(++_0x140369);}(_0x95d2,0x7b));var _0x295d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x95d2[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x295d('0x0'));var path=require('path');var timeout=require(_0x295d('0x1'));var express=require(_0x295d('0x2'));var router=express[_0x295d('0x3')]();var fs_extra=require(_0x295d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x295d('0x5'));var controller=require(_0x295d('0x6'));router[_0x295d('0x7')]('/',auth[_0x295d('0x8')](),controller['index']);router[_0x295d('0x7')](_0x295d('0x9'),auth[_0x295d('0x8')](),controller[_0x295d('0xa')]);router[_0x295d('0x7')]('/:id',auth[_0x295d('0x8')](),controller[_0x295d('0xb')]);router['get'](_0x295d('0xc'),auth[_0x295d('0x8')](),controller[_0x295d('0xd')]);router[_0x295d('0x7')]('/:id/canned_answers',auth[_0x295d('0x8')](),controller['getAnswers']);router[_0x295d('0x7')](_0x295d('0xe'),auth[_0x295d('0x8')](),controller['getImap']);router[_0x295d('0x7')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x295d('0xf')]);router[_0x295d('0x7')](_0x295d('0x10'),auth[_0x295d('0x8')](),controller[_0x295d('0x11')]);router[_0x295d('0x7')](_0x295d('0x12'),auth[_0x295d('0x8')](),controller[_0x295d('0x13')]);router[_0x295d('0x7')](_0x295d('0x14'),auth[_0x295d('0x8')](),controller['getMessages']);router[_0x295d('0x7')](_0x295d('0x15'),auth['isAuthenticated'](),controller[_0x295d('0x16')]);router['get'](_0x295d('0x17'),auth[_0x295d('0x8')](),controller[_0x295d('0x18')]);router['post'](_0x295d('0xc'),auth[_0x295d('0x8')](),controller[_0x295d('0x19')]);router[_0x295d('0x1a')](_0x295d('0x1b'),auth[_0x295d('0x8')](),controller[_0x295d('0x1c')]);router[_0x295d('0x1a')]('/',auth[_0x295d('0x8')](),controller[_0x295d('0x1d')]);router[_0x295d('0x1a')](_0x295d('0xe'),auth['isAuthenticated'](),controller[_0x295d('0x1e')]);router[_0x295d('0x1a')](_0x295d('0x1f'),auth[_0x295d('0x8')](),controller[_0x295d('0x20')]);router[_0x295d('0x1a')](_0x295d('0x10'),auth[_0x295d('0x8')](),controller[_0x295d('0x21')]);router[_0x295d('0x1a')](_0x295d('0x12'),auth['isAuthenticated'](),controller['addApplications']);router[_0x295d('0x1a')](_0x295d('0x22'),auth[_0x295d('0x8')](),controller[_0x295d('0x23')]);router['post'](_0x295d('0x17'),auth[_0x295d('0x8')](),controller[_0x295d('0x24')]);router[_0x295d('0x25')](_0x295d('0x26'),auth['isAuthenticated'](),controller['update']);router[_0x295d('0x27')](_0x295d('0xc'),auth[_0x295d('0x8')](),controller[_0x295d('0x28')]);router['delete'](_0x295d('0x1b'),auth[_0x295d('0x8')](),controller[_0x295d('0x29')]);router[_0x295d('0x27')](_0x295d('0xe'),auth[_0x295d('0x8')](),controller['removeImap']);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller['removeSmtp']);router[_0x295d('0x27')]('/:id',auth[_0x295d('0x8')](),controller[_0x295d('0x2a')]);router['delete'](_0x295d('0x17'),auth['isAuthenticated'](),controller[_0x295d('0x2b')]);module[_0x295d('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index c42cd57..9ac67de 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 _0xf8c0=['outlook365','custom','getDataValue','provider','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','gmail','yahoo'];(function(_0x247cc3,_0x48925f){var _0x41099c=function(_0x5bf4fa){while(--_0x5bf4fa){_0x247cc3['push'](_0x247cc3['shift']());}};_0x41099c(++_0x48925f);}(_0xf8c0,0x114));var _0x0f8c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xf8c0[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require('sequelize');module[_0x0f8c('0x0')]={'description':{'type':Sequelize[_0x0f8c('0x1')]},'name':{'type':Sequelize[_0x0f8c('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x0f8c('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0f8c('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x0f8c('0x3')]},'markAsUnread':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x0f8c('0x4')](0x2)[_0x0f8c('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0f8c('0x3')],'defaultValue':function(){return _0x0f8c('0x6');}},'notificationSound':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0f8c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f8c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0f8c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f8c('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x0f8c('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x0f8c('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x6117c6){if(!_0x6117c6)this[_0x0f8c('0x8')](_0x0f8c('0x9'),null);this['setDataValue']('mandatoryDisposition',_0x6117c6);}},'provider':{'type':Sequelize['ENUM'](_0x0f8c('0xa'),'hotmail',_0x0f8c('0xb'),_0x0f8c('0xc')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x0f8c('0xd');return this[_0x0f8c('0xe')](_0x0f8c('0xf'));},'set':function(_0x18411d){if(_0x18411d===_0x0f8c('0xd'))_0x18411d=null;return this[_0x0f8c('0x8')](_0x0f8c('0xf'),_0x18411d);}}}; \ No newline at end of file +var _0x5c61=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','STRING','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}}','BOOLEAN'];(function(_0x520ce8,_0x445e56){var _0x64369e=function(_0x3861e4){while(--_0x3861e4){_0x520ce8['push'](_0x520ce8['shift']());}};_0x64369e(++_0x445e56);}(_0x5c61,0xf4));var _0x15c6=function(_0x3d285a,_0x359ed3){_0x3d285a=_0x3d285a-0x0;var _0x40c68a=_0x5c61[_0x3d285a];return _0x40c68a;};'use strict';var Sequelize=require(_0x15c6('0x0'));module['exports']={'description':{'type':Sequelize[_0x15c6('0x1')]},'name':{'type':Sequelize[_0x15c6('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x15c6('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x15c6('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15c6('0x3')},'fontSize':{'type':Sequelize[_0x15c6('0x4')](0x2)[_0x15c6('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x15c6('0x2')],'defaultValue':function(){return _0x15c6('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x15c6('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x15c6('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x15c6('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15c6('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x15c6('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x15c6('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x15c6('0x9'),'set':function(_0x463901){if(!_0x463901)this[_0x15c6('0xa')](_0x15c6('0xb'),null);this[_0x15c6('0xa')](_0x15c6('0xc'),_0x463901);}},'provider':{'type':Sequelize[_0x15c6('0xd')](_0x15c6('0xe'),_0x15c6('0xf'),_0x15c6('0x10'),_0x15c6('0x11')),'defaultValue':null,'get':function(){if(!this[_0x15c6('0x12')](_0x15c6('0x13')))return _0x15c6('0x14');return this[_0x15c6('0x12')]('provider');},'set':function(_0x1ea297){if(_0x1ea297===_0x15c6('0x14'))_0x1ea297=null;return this[_0x15c6('0xa')]('provider',_0x1ea297);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 98e0761..0592377 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 _0x839e=['pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','email','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','priority','sendStatus','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','format','attachments','join','root','basename','getSmtpOptions','SendMail','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','json','update','destroy','get','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','username','Imap','Smtp','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','MailServerIn','find','body','provider','custom','params','describe','addDisposition','MailAccountId','Disposition','create','findOne'];(function(_0x4b5f1f,_0x1fee93){var _0x3bb747=function(_0x235c2b){while(--_0x235c2b){_0x4b5f1f['push'](_0x4b5f1f['shift']());}};_0x3bb747(++_0x1fee93);}(_0x839e,0x117));var _0xe839=function(_0x535e1e,_0x2b3930){_0x535e1e=_0x535e1e-0x0;var _0x5161d2=_0x839e[_0x535e1e];return _0x5161d2;};'use strict';var moment=require(_0xe839('0x0'));var BPromise=require('bluebird');var util=require(_0xe839('0x1'));var path=require('path');var _=require(_0xe839('0x2'));var juice=require(_0xe839('0x3'));var Redis=require(_0xe839('0x4'));var qs=require(_0xe839('0x5'));var logger=require(_0xe839('0x6'))('api');var config=require(_0xe839('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe839('0x8')](config['redis'],{'host':_0xe839('0x9'),'port':0x18eb});var socket=require(_0xe839('0xa'))(new Redis(config[_0xe839('0xb')]));require(_0xe839('0xc'))[_0xe839('0xd')](socket);var jayson=require(_0xe839('0xe'));var client=jayson[_0xe839('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x31f4cf,_0x2ce264,_0xc3c3bf,_0x15da21){return new BPromise(function(_0x346311,_0x239b19){var _0x168c39=_0x15da21||client;return _0x168c39[_0xe839('0x10')](_0x31f4cf,_0xc3c3bf)[_0xe839('0x11')](function(_0x40d313){logger[_0xe839('0x12')](_0xe839('0x13'),_0x2ce264,'request\x20sent');logger['debug'](_0xe839('0x14'),_0x2ce264,_0xe839('0x15'),JSON['stringify'](_0x40d313));if(_0x40d313[_0xe839('0x16')]){if(_0x40d313[_0xe839('0x16')][_0xe839('0x17')]===0x1f4){logger[_0xe839('0x16')]('MailAccount,\x20%s,\x20%s',_0x2ce264,_0x40d313[_0xe839('0x16')][_0xe839('0x18')]);return _0x239b19(_0x40d313[_0xe839('0x16')][_0xe839('0x18')]);}logger['error'](_0xe839('0x13'),_0x2ce264,_0x40d313[_0xe839('0x16')][_0xe839('0x18')]);return _0x346311(_0x40d313[_0xe839('0x16')][_0xe839('0x18')]);}else{logger[_0xe839('0x12')](_0xe839('0x13'),_0x2ce264,'request\x20sent');_0x346311(_0x40d313[_0xe839('0x19')]['message']);}})[_0xe839('0x1a')](function(_0x181077){logger[_0xe839('0x16')]('MailAccount,\x20%s,\x20%s',_0x2ce264,_0x181077);_0x239b19(_0x181077);});});}function respondWithStatusCode(_0x48dc74,_0x299ab0){_0x299ab0=_0x299ab0||0xcc;return function(_0x11322e){if(_0x11322e){return _0x48dc74['sendStatus'](_0x299ab0);}return _0x48dc74[_0xe839('0x1b')](_0x299ab0)[_0xe839('0x1c')]();};}function respondWithResult(_0x3019d7,_0x38811c){_0x38811c=_0x38811c||0xc8;return function(_0x20d6fa){if(_0x20d6fa){return _0x3019d7[_0xe839('0x1b')](_0x38811c)['json'](_0x20d6fa);}};}function respondWithFilteredResult(_0x5cd166,_0x345256){return function(_0x34a364){if(_0x34a364){var _0x50509d=typeof _0x345256[_0xe839('0x1d')]===_0xe839('0x1e')&&typeof _0x345256[_0xe839('0x1f')]===_0xe839('0x1e');var _0x1863d9=_0x34a364[_0xe839('0x20')];var _0x5ca714=_0x50509d?0x0:_0x345256[_0xe839('0x1d')];var _0x367a67=_0x50509d?_0x34a364['count']:_0x345256['offset']+_0x345256[_0xe839('0x1f')];var _0x4b3824;if(_0x367a67>=_0x1863d9){_0x367a67=_0x1863d9;_0x4b3824=0xc8;}else{_0x4b3824=0xce;}_0x5cd166[_0xe839('0x1b')](_0x4b3824);return _0x5cd166[_0xe839('0x21')]('Content-Range',_0x5ca714+'-'+_0x367a67+'/'+_0x1863d9)[_0xe839('0x22')](_0x34a364);}return null;};}function saveUpdates(_0xb570d){return function(_0x23559d){if(_0x23559d){return _0x23559d[_0xe839('0x23')](_0xb570d)[_0xe839('0x11')](function(_0x29c49e){return _0x29c49e;});}return null;};}function removeEntity(_0x5c5611){return function(_0x598238){if(_0x598238){return _0x598238[_0xe839('0x24')]()[_0xe839('0x11')](function(){var _0x26bb1d=_0x598238[_0xe839('0x25')]({'plain':!![]});var _0x496c69=_0xe839('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x496c69,'resourceId':_0x26bb1d['id']}})[_0xe839('0x11')](function(){return _0x598238;});})['then'](function(){_0x5c5611[_0xe839('0x1b')](0xcc)[_0xe839('0x1c')]();});}};}function handleEntityNotFound(_0x401df8){return function(_0x568045){if(!_0x568045){_0x401df8['sendStatus'](0x194);}return _0x568045;};}function handleError(_0x40ab3e,_0x143de2){_0x143de2=_0x143de2||0x1f4;return function(_0x2ea1ba){logger['error'](_0x2ea1ba[_0xe839('0x27')]);if(_0x2ea1ba[_0xe839('0x28')]){delete _0x2ea1ba[_0xe839('0x28')];}_0x40ab3e[_0xe839('0x1b')](_0x143de2)[_0xe839('0x29')](_0x2ea1ba);};}function getImapHost(_0x4d56d7){switch(_0x4d56d7){case _0xe839('0x2a'):return _0xe839('0x2b');case _0xe839('0x2c'):return _0xe839('0x2d');case _0xe839('0x2e'):return _0xe839('0x2f');case _0xe839('0x30'):return'outlook.office365.com';}throw new Error(_0xe839('0x31'),_0x4d56d7);}function getSmtpHost(_0x262b3c){switch(_0x262b3c){case _0xe839('0x2a'):return _0xe839('0x32');case _0xe839('0x2c'):return _0xe839('0x33');case'hotmail':return'smtp-mail.outlook.com';case _0xe839('0x30'):return _0xe839('0x34');}throw new Error(_0xe839('0x31'),_0x262b3c);}function getAuthenticationOptions(_0x409881,_0x368813){var _0x552254={};var _0x681065={};if(_0x409881){_0x552254['user']=_0x681065[_0xe839('0x35')]=_0x368813['username'];_0x552254[_0xe839('0x36')]=_0x681065['pass']=_0x368813['password'];if(_0x368813[_0xe839('0x37')]){_0x552254[_0xe839('0x37')]=_0x681065['modernAuthentication']=!![];_0x552254[_0xe839('0x38')]=_0x681065['CloudProviderId']=_0x368813[_0xe839('0x38')];_0x552254[_0xe839('0x36')]=_0x681065[_0xe839('0x39')]=null;}else{_0x552254[_0xe839('0x38')]=_0x681065['CloudProviderId']=null;}_0x552254[_0xe839('0x3a')]=getImapHost(_0x409881);_0x552254[_0xe839('0x3b')]=0x3e1;_0x681065['host']=getSmtpHost(_0x409881);_0x681065[_0xe839('0x3b')]=0x24b;_0x681065[_0xe839('0x3c')]=![];_0x552254[_0xe839('0x3d')]=_0x681065[_0xe839('0x3d')]=null;}else{if(_0x368813[_0xe839('0x3e')]){_0x552254[_0xe839('0x35')]=_0x681065[_0xe839('0x35')]=_0x368813[_0xe839('0x3f')];_0x552254[_0xe839('0x36')]=_0x681065[_0xe839('0x39')]=_0x368813['password'];}else{_0x552254['authentication']=_0x681065[_0xe839('0x3e')]=![];_0x552254['user']=_0x681065[_0xe839('0x35')]=null;_0x552254[_0xe839('0x36')]=_0x681065['pass']=null;}_0x552254['host']=_0x368813[_0xe839('0x40')]['host'];_0x552254['port']=_0x368813[_0xe839('0x40')][_0xe839('0x3b')];_0x681065[_0xe839('0x3a')]=_0x368813[_0xe839('0x41')][_0xe839('0x3a')];_0x681065['port']=_0x368813[_0xe839('0x41')]['port'];}return{'Imap':_0x552254,'Smtp':_0x681065};}exports['index']=function(_0x4a4666,_0x44fa80){var _0x1adfc7={'include':[{'model':db['MailServerIn'],'as':_0xe839('0x40')},{'model':db[_0xe839('0x42')],'as':_0xe839('0x41')},{'model':db[_0xe839('0x43')],'as':_0xe839('0x44')}]},_0x18e289={},_0xf9e601={'count':0x0,'rows':[]};var _0x493fcb=_[_0xe839('0x45')](db[_0xe839('0x46')][_0xe839('0x47')],function(_0x16ec34){return{'name':_0x16ec34[_0xe839('0x48')],'type':_0x16ec34[_0xe839('0x49')][_0xe839('0x4a')]};});_0x18e289[_0xe839('0x4b')]=_[_0xe839('0x45')](_0x493fcb,'name');_0x18e289[_0xe839('0x4c')]=_[_0xe839('0x4d')](_0x4a4666[_0xe839('0x4c')]);_0x18e289[_0xe839('0x4e')]=_[_0xe839('0x4f')](_0x18e289[_0xe839('0x4b')],_0x18e289[_0xe839('0x4c')]);_0x1adfc7[_0xe839('0x50')]=_[_0xe839('0x4f')](_0x18e289[_0xe839('0x4b')],qs['fields'](_0x4a4666[_0xe839('0x4c')][_0xe839('0x51')]));_0x1adfc7[_0xe839('0x50')]=_0x1adfc7['attributes'][_0xe839('0x52')]?_0x1adfc7['attributes']:_0x18e289[_0xe839('0x4b')];if(!_0x4a4666[_0xe839('0x4c')][_0xe839('0x53')](_0xe839('0x54'))){_0x1adfc7['limit']=qs['limit'](_0x4a4666[_0xe839('0x4c')][_0xe839('0x1f')]);_0x1adfc7['offset']=qs[_0xe839('0x1d')](_0x4a4666[_0xe839('0x4c')][_0xe839('0x1d')]);}_0x1adfc7[_0xe839('0x55')]=qs[_0xe839('0x56')](_0x4a4666[_0xe839('0x4c')][_0xe839('0x56')]);_0x1adfc7[_0xe839('0x57')]=qs[_0xe839('0x4e')](_['pick'](_0x4a4666[_0xe839('0x4c')],_0x18e289[_0xe839('0x4e')]),_0x493fcb);if(_0x4a4666['query'][_0xe839('0x58')]){_0x1adfc7[_0xe839('0x57')]=_[_0xe839('0x59')](_0x1adfc7[_0xe839('0x57')],{'$or':_['map'](_0x493fcb,function(_0x26a7b8){if(_0x26a7b8[_0xe839('0x49')]!==_0xe839('0x5a')){var _0x33ade5={};_0x33ade5[_0x26a7b8['name']]={'$like':'%'+_0x4a4666['query']['filter']+'%'};return _0x33ade5;}})});}_0x1adfc7=_[_0xe839('0x59')]({},_0x1adfc7,_0x4a4666[_0xe839('0x5b')]);var _0x4eb0aa={'where':_0x1adfc7['where']};return db[_0xe839('0x46')][_0xe839('0x20')](_0x4eb0aa)[_0xe839('0x11')](function(_0x966004){_0xf9e601[_0xe839('0x20')]=_0x966004;if(_0x4a4666[_0xe839('0x4c')][_0xe839('0x5c')]){_0x1adfc7[_0xe839('0x5d')]=[{'all':!![]}];}return db['MailAccount'][_0xe839('0x5e')](_0x1adfc7);})[_0xe839('0x11')](function(_0xba7c40){_0xf9e601[_0xe839('0x5f')]=_0xba7c40;return _0xf9e601;})[_0xe839('0x11')](respondWithFilteredResult(_0x44fa80,_0x1adfc7))[_0xe839('0x1a')](handleError(_0x44fa80,null));};exports[_0xe839('0x60')]=function(_0x4a41cf,_0x4599d7){var _0x526ab8={'raw':![],'where':{'id':_0x4a41cf['params']['id']},'include':[{'model':db[_0xe839('0x61')],'as':_0xe839('0x40')},{'model':db[_0xe839('0x42')],'as':_0xe839('0x41')},{'model':db[_0xe839('0x43')],'as':'mandatoryDispositionPause'}]},_0x275ecf={};_0x275ecf[_0xe839('0x4b')]=_[_0xe839('0x4d')](db[_0xe839('0x46')]['rawAttributes']);_0x275ecf[_0xe839('0x4c')]=_[_0xe839('0x4d')](_0x4a41cf['query']);_0x275ecf[_0xe839('0x4e')]=_['intersection'](_0x275ecf[_0xe839('0x4b')],_0x275ecf[_0xe839('0x4c')]);_0x526ab8[_0xe839('0x50')]=_[_0xe839('0x4f')](_0x275ecf[_0xe839('0x4b')],qs[_0xe839('0x51')](_0x4a41cf[_0xe839('0x4c')][_0xe839('0x51')]));_0x526ab8[_0xe839('0x50')]=_0x526ab8[_0xe839('0x50')][_0xe839('0x52')]?_0x526ab8['attributes']:_0x275ecf[_0xe839('0x4b')];if(_0x4a41cf[_0xe839('0x4c')][_0xe839('0x5c')]){_0x526ab8[_0xe839('0x5d')]=[{'all':!![]}];}_0x526ab8=_[_0xe839('0x59')]({},_0x526ab8,_0x4a41cf[_0xe839('0x5b')]);return db[_0xe839('0x46')][_0xe839('0x62')](_0x526ab8)['then'](handleEntityNotFound(_0x4599d7,null))[_0xe839('0x11')](respondWithResult(_0x4599d7,null))[_0xe839('0x1a')](handleError(_0x4599d7,null));};exports[_0xe839('0x23')]=function(_0x170d6e,_0x42a722){if(_0x170d6e[_0xe839('0x63')]['id']){delete _0x170d6e['body']['id'];}var _0x241112=_0x170d6e['body'][_0xe839('0x64')]===_0xe839('0x65')?null:_0x170d6e[_0xe839('0x63')][_0xe839('0x64')];var _0x5324f4=_0x170d6e[_0xe839('0x63')][_0xe839('0x40')]||{};var _0x57a0f8=_0x170d6e[_0xe839('0x63')]['Smtp']||{};if(_0x241112){_0x5324f4[_0xe839('0x3a')]=getImapHost(_0x241112);_0x5324f4[_0xe839('0x3b')]=0x3e1;_0x57a0f8[_0xe839('0x3a')]=getSmtpHost(_0x241112);_0x57a0f8['port']=0x24b;_0x57a0f8[_0xe839('0x3c')]=![];}if(_0x57a0f8['modernAuthentication']){_0x57a0f8[_0xe839('0x3c')]=![];}else{_0x57a0f8['CloudProviderId']=null;}if(!_0x5324f4[_0xe839('0x37')])_0x5324f4[_0xe839('0x38')]=null;_0x170d6e[_0xe839('0x63')][_0xe839('0x40')]=_0x5324f4;_0x170d6e[_0xe839('0x63')][_0xe839('0x41')]=_0x57a0f8;return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x170d6e[_0xe839('0x66')]['id']},'include':[{'model':db[_0xe839('0x61')],'as':'Imap'},{'model':db[_0xe839('0x42')],'as':_0xe839('0x41')},{'model':db[_0xe839('0x43')],'as':_0xe839('0x44')}]})[_0xe839('0x11')](handleEntityNotFound(_0x42a722,null))[_0xe839('0x11')](function(_0x396466){if(!_0x396466)throw new Error('Mail\x20Account\x20not\x20found');if(_0x396466[_0xe839('0x3d')])delete _0x170d6e[_0xe839('0x63')][_0xe839('0x40')];return _0x396466;})[_0xe839('0x11')](saveUpdates(_0x170d6e['body'],null))[_0xe839('0x11')](function(_0x55ff8a){if(!_0x170d6e[_0xe839('0x63')][_0xe839('0x40')])return _0x55ff8a;return db[_0xe839('0x61')][_0xe839('0x23')](_0x170d6e[_0xe839('0x63')]['Imap'],{'where':{'MailAccountId':_0x55ff8a['id']}})[_0xe839('0x11')](function(){return _0x55ff8a;});})[_0xe839('0x11')](function(_0x411913){if(!_0x170d6e[_0xe839('0x63')][_0xe839('0x41')])return _0x411913;return db[_0xe839('0x42')]['update'](_0x170d6e[_0xe839('0x63')][_0xe839('0x41')],{'where':{'MailAccountId':_0x411913['id']}})[_0xe839('0x11')](function(){return _0x411913;});})['then'](respondWithResult(_0x42a722,null))[_0xe839('0x1a')](handleError(_0x42a722,null));};exports['describe']=function(_0x450596,_0x265264){return db[_0xe839('0x46')][_0xe839('0x67')]()['then'](respondWithResult(_0x265264,null))[_0xe839('0x1a')](handleError(_0x265264,null));};exports[_0xe839('0x68')]=function(_0x320679,_0x5b81b9){if(_0x320679[_0xe839('0x63')]['id']){delete _0x320679['body']['id'];}return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x320679[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x5b81b9,null))['then'](function(_0x3a3e71){if(_0x3a3e71){_0x320679[_0xe839('0x63')][_0xe839('0x69')]=_0x3a3e71['id'];return db[_0xe839('0x6a')][_0xe839('0x6b')](_0x320679[_0xe839('0x63')]);}})[_0xe839('0x11')](respondWithResult(_0x5b81b9,null))[_0xe839('0x1a')](handleError(_0x5b81b9,null));};exports['getDispositions']=function(_0x5ec043,_0x1b1f9f){var _0x117db1={'raw':![],'where':{}};var _0x447514={};var _0x4b9b80={'count':0x0,'rows':[]};return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x5ec043[_0xe839('0x66')]['id']}})['then'](handleEntityNotFound(_0x1b1f9f,null))[_0xe839('0x11')](function(_0x122841){if(_0x122841){_0x447514[_0xe839('0x4b')]=_['keys'](db[_0xe839('0x6a')]['rawAttributes']);_0x447514[_0xe839('0x4c')]=_['keys'](_0x5ec043[_0xe839('0x4c')]);_0x447514[_0xe839('0x4e')]=_[_0xe839('0x4f')](_0x447514['model'],_0x447514[_0xe839('0x4c')]);_0x117db1[_0xe839('0x50')]=_['intersection'](_0x447514[_0xe839('0x4b')],qs[_0xe839('0x51')](_0x5ec043[_0xe839('0x4c')][_0xe839('0x51')]));_0x117db1[_0xe839('0x50')]=_0x117db1[_0xe839('0x50')][_0xe839('0x52')]?_0x117db1['attributes']:_0x447514[_0xe839('0x4b')];if(!_0x5ec043[_0xe839('0x4c')][_0xe839('0x53')](_0xe839('0x54'))){_0x117db1[_0xe839('0x1f')]=qs[_0xe839('0x1f')](_0x5ec043['query']['limit']);_0x117db1[_0xe839('0x1d')]=qs[_0xe839('0x1d')](_0x5ec043[_0xe839('0x4c')][_0xe839('0x1d')]);}_0x117db1['order']=qs[_0xe839('0x56')](_0x5ec043['query']['sort']);_0x117db1[_0xe839('0x57')]=qs[_0xe839('0x4e')](_[_0xe839('0x6d')](_0x5ec043['query'],_0x447514[_0xe839('0x4e')]));_0x117db1[_0xe839('0x57')][_0xe839('0x69')]=_0x122841['id'];if(_0x5ec043[_0xe839('0x4c')][_0xe839('0x58')]){_0x117db1['where']=_[_0xe839('0x59')](_0x117db1[_0xe839('0x57')],{'$or':_[_0xe839('0x45')](_0x117db1[_0xe839('0x50')],function(_0x4aee8f){var _0xd7cf98={};_0xd7cf98[_0x4aee8f]={'$like':'%'+_0x5ec043['query'][_0xe839('0x58')]+'%'};return _0xd7cf98;})});}_0x117db1=_[_0xe839('0x59')]({},_0x117db1,_0x5ec043[_0xe839('0x5b')]);return db[_0xe839('0x6a')]['count']({'where':_0x117db1[_0xe839('0x57')]})['then'](function(_0x46cde8){_0x4b9b80[_0xe839('0x20')]=_0x46cde8;if(_0x5ec043[_0xe839('0x4c')][_0xe839('0x5c')]){_0x117db1[_0xe839('0x5d')]=[{'all':!![]}];}return db[_0xe839('0x6a')][_0xe839('0x5e')](_0x117db1);})[_0xe839('0x11')](function(_0x565e8f){_0x4b9b80[_0xe839('0x5f')]=_0x565e8f;return _0x4b9b80;});}})['then'](respondWithFilteredResult(_0x1b1f9f,_0x117db1))[_0xe839('0x1a')](handleError(_0x1b1f9f,null));};exports[_0xe839('0x6e')]=function(_0x41670b,_0x3e0bbe){return db['MailAccount']['find']({'where':{'id':_0x41670b[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x3e0bbe,null))[_0xe839('0x11')](function(_0x21bb4c){if(_0x21bb4c){return _0x21bb4c[_0xe839('0x6e')](_0x41670b[_0xe839('0x4c')][_0xe839('0x6f')]);}})[_0xe839('0x11')](respondWithStatusCode(_0x3e0bbe,null))[_0xe839('0x1a')](handleError(_0x3e0bbe,null));};exports[_0xe839('0x70')]=function(_0x20273f,_0x361848){if(_0x20273f['body']['id']){delete _0x20273f['body']['id'];}return db[_0xe839('0x46')]['find']({'where':{'id':_0x20273f[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x361848,null))[_0xe839('0x11')](function(_0x98e9b3){if(_0x98e9b3){_0x20273f[_0xe839('0x63')][_0xe839('0x69')]=_0x98e9b3['id'];return db['CannedAnswer']['create'](_0x20273f[_0xe839('0x63')]);}})['then'](respondWithResult(_0x361848,null))[_0xe839('0x1a')](handleError(_0x361848,null));};exports[_0xe839('0x71')]=function(_0x13b43e,_0x18b07c){var _0x2d2be5={'raw':![],'where':{}};var _0x3986e5={};var _0x505aec={'count':0x0,'rows':[]};return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x13b43e[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x18b07c,null))[_0xe839('0x11')](function(_0x3a504a){if(_0x3a504a){_0x3986e5[_0xe839('0x4b')]=_['keys'](db[_0xe839('0x72')]['rawAttributes']);_0x3986e5['query']=_['keys'](_0x13b43e[_0xe839('0x4c')]);_0x3986e5['filters']=_[_0xe839('0x4f')](_0x3986e5[_0xe839('0x4b')],_0x3986e5[_0xe839('0x4c')]);_0x2d2be5[_0xe839('0x50')]=_[_0xe839('0x4f')](_0x3986e5[_0xe839('0x4b')],qs['fields'](_0x13b43e[_0xe839('0x4c')][_0xe839('0x51')]));_0x2d2be5[_0xe839('0x50')]=_0x2d2be5[_0xe839('0x50')][_0xe839('0x52')]?_0x2d2be5[_0xe839('0x50')]:_0x3986e5[_0xe839('0x4b')];if(!_0x13b43e[_0xe839('0x4c')][_0xe839('0x53')](_0xe839('0x54'))){_0x2d2be5['limit']=qs[_0xe839('0x1f')](_0x13b43e[_0xe839('0x4c')][_0xe839('0x1f')]);_0x2d2be5[_0xe839('0x1d')]=qs[_0xe839('0x1d')](_0x13b43e['query'][_0xe839('0x1d')]);}_0x2d2be5[_0xe839('0x55')]=qs[_0xe839('0x56')](_0x13b43e[_0xe839('0x4c')]['sort']);_0x2d2be5[_0xe839('0x57')]=qs['filters'](_[_0xe839('0x6d')](_0x13b43e[_0xe839('0x4c')],_0x3986e5['filters']));_0x2d2be5['where'][_0xe839('0x69')]=_0x3a504a['id'];if(_0x13b43e['query'][_0xe839('0x58')]){_0x2d2be5[_0xe839('0x57')]=_[_0xe839('0x59')](_0x2d2be5[_0xe839('0x57')],{'$or':_[_0xe839('0x45')](_0x2d2be5[_0xe839('0x50')],function(_0x42527c){var _0x402940={};_0x402940[_0x42527c]={'$like':'%'+_0x13b43e[_0xe839('0x4c')]['filter']+'%'};return _0x402940;})});}_0x2d2be5=_[_0xe839('0x59')]({},_0x2d2be5,_0x13b43e['options']);return db[_0xe839('0x72')][_0xe839('0x20')]({'where':_0x2d2be5['where']})['then'](function(_0x5127cf){_0x505aec[_0xe839('0x20')]=_0x5127cf;if(_0x13b43e[_0xe839('0x4c')]['includeAll']){_0x2d2be5[_0xe839('0x5d')]=[{'all':!![]}];}return db[_0xe839('0x72')]['findAll'](_0x2d2be5);})[_0xe839('0x11')](function(_0x7226b5){_0x505aec[_0xe839('0x5f')]=_0x7226b5;return _0x505aec;});}})['then'](respondWithFilteredResult(_0x18b07c,_0x2d2be5))['catch'](handleError(_0x18b07c,null));};exports['removeAnswers']=function(_0x32d61b,_0x1b5b12){return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x32d61b[_0xe839('0x66')]['id']}})['then'](handleEntityNotFound(_0x1b5b12,null))[_0xe839('0x11')](function(_0x40ba99){if(_0x40ba99){return _0x40ba99[_0xe839('0x73')](_0x32d61b[_0xe839('0x4c')][_0xe839('0x6f')]);}})['then'](respondWithStatusCode(_0x1b5b12,null))[_0xe839('0x1a')](handleError(_0x1b5b12,null));};exports[_0xe839('0x6b')]=function(_0x21c1d0,_0x1307ee){var _0x168afe={'name':_0x21c1d0[_0xe839('0x63')][_0xe839('0x28')],'key':_0x21c1d0[_0xe839('0x63')]['key'],'provider':_0x21c1d0[_0xe839('0x63')][_0xe839('0x64')]===_0xe839('0x65')?null:_0x21c1d0[_0xe839('0x63')][_0xe839('0x64')],'email':_0x21c1d0[_0xe839('0x63')][_0xe839('0x74')],'ListId':_0x21c1d0['body']['ListId'],'active':!_['isNil'](_0x21c1d0[_0xe839('0x63')][_0xe839('0x75')])?_0x21c1d0['body'][_0xe839('0x75')]:!![],'description':_0x21c1d0['body'][_0xe839('0x76')]||null};var _0x53aaba=getAuthenticationOptions(_0x168afe[_0xe839('0x64')],_0x21c1d0[_0xe839('0x63')]);_0x168afe[_0xe839('0x40')]=_0x53aaba[_0xe839('0x40')];_0x168afe[_0xe839('0x41')]=_0x53aaba[_0xe839('0x41')];return db['MailAccount'][_0xe839('0x6b')](_0x168afe,{'include':[{'model':db[_0xe839('0x42')],'as':_0xe839('0x41')},{'model':db[_0xe839('0x61')],'as':_0xe839('0x40')}]})[_0xe839('0x11')](function(_0x42bbdf){var _0x50afa5=_0x21c1d0[_0xe839('0x35')][_0xe839('0x25')]({'plain':!![]});if(!_0x50afa5)throw new Error(_0xe839('0x77'));if(_0x50afa5[_0xe839('0x78')]===_0xe839('0x35')){var _0x1b19b0=_0x42bbdf['get']({'plain':!![]});return db[_0xe839('0x79')][_0xe839('0x62')]({'where':{'name':'MailAccounts','userProfileId':_0x50afa5[_0xe839('0x7a')]},'raw':!![]})[_0xe839('0x11')](function(_0x4786a0){if(_0x4786a0&&_0x4786a0[_0xe839('0x7b')]===0x0){return db[_0xe839('0x7c')][_0xe839('0x6b')]({'name':_0x1b19b0[_0xe839('0x28')],'resourceId':_0x1b19b0['id'],'type':_0x4786a0[_0xe839('0x28')],'sectionId':_0x4786a0['id']},{})[_0xe839('0x11')](function(){return _0x42bbdf;});}else{return _0x42bbdf;}})[_0xe839('0x1a')](function(_0x1dff06){logger[_0xe839('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dff06);throw _0x1dff06;});}return _0x42bbdf;})['then'](respondWithResult(_0x1307ee,0xc9))['catch'](handleError(_0x1307ee,null));};exports[_0xe839('0x7d')]=function(_0x25ae6a,_0x1d715c){return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x25ae6a[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x1d715c,null))[_0xe839('0x11')](function(_0x55bd70){if(_0x55bd70){return _0x55bd70['getImap']();}return null;})[_0xe839('0x11')](respondWithResult(_0x1d715c,null))[_0xe839('0x1a')](handleError(_0x1d715c,null));};exports['addImap']=function(_0x45ee33,_0x1e0f17){if(_0x45ee33['body']['id']){delete _0x45ee33[_0xe839('0x63')]['id'];}return db['MailAccount'][_0xe839('0x62')]({'where':{'id':_0x45ee33[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x1e0f17,null))[_0xe839('0x11')](function(_0x24a189){if(_0x24a189){_0x45ee33[_0xe839('0x63')][_0xe839('0x69')]=_0x24a189['id'];return db[_0xe839('0x61')]['create'](_0x45ee33['body']);}})[_0xe839('0x11')](respondWithResult(_0x1e0f17,null))['catch'](handleError(_0x1e0f17,null));};exports[_0xe839('0x7e')]=function(_0xdbc64f,_0x109493){return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0xdbc64f[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x109493,null))[_0xe839('0x11')](function(_0x2741a0){if(_0x2741a0){return _0x2741a0[_0xe839('0x7f')](null);}return null;})[_0xe839('0x11')](respondWithStatusCode(_0x109493,null))[_0xe839('0x1a')](handleError(_0x109493,null));};exports['getSmtp']=function(_0x55e863,_0x553e29){return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x55e863[_0xe839('0x66')]['id']}})['then'](handleEntityNotFound(_0x553e29,null))[_0xe839('0x11')](function(_0x24d985){if(_0x24d985){return _0x24d985[_0xe839('0x80')]();}return null;})['then'](respondWithResult(_0x553e29,null))[_0xe839('0x1a')](handleError(_0x553e29,null));};exports[_0xe839('0x81')]=function(_0x2c3909,_0xefd41e){if(_0x2c3909[_0xe839('0x63')]['id']){delete _0x2c3909[_0xe839('0x63')]['id'];}return db[_0xe839('0x46')]['find']({'where':{'id':_0x2c3909[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0xefd41e,null))[_0xe839('0x11')](function(_0x32db62){if(_0x32db62){_0x2c3909[_0xe839('0x63')]['MailAccountId']=_0x32db62['id'];return db[_0xe839('0x42')][_0xe839('0x6b')](_0x2c3909['body']);}})[_0xe839('0x11')](respondWithResult(_0xefd41e,null))[_0xe839('0x1a')](handleError(_0xefd41e,null));};exports[_0xe839('0x82')]=function(_0xfd1728,_0x109a2a){return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0xfd1728[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x109a2a,null))['then'](function(_0x43f2cb){if(_0x43f2cb){return _0x43f2cb[_0xe839('0x83')](null);}return null;})[_0xe839('0x11')](respondWithStatusCode(_0x109a2a,null))['catch'](handleError(_0x109a2a,null));};exports['addInteraction']=function(_0x1b1c3d,_0x3e99a7){return db[_0xe839('0x84')][_0xe839('0x62')]({'where':{'id':_0x1b1c3d[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x3e99a7,null))['then'](function(_0x89dcc1){if(_0x89dcc1){return _0x89dcc1['addInteraction'](_0x1b1c3d[_0xe839('0x63')][_0xe839('0x6f')],_['omit'](_0x1b1c3d[_0xe839('0x63')],[_0xe839('0x6f'),'id'])||{});}})[_0xe839('0x11')](respondWithResult(_0x3e99a7,null))[_0xe839('0x1a')](handleError(_0x3e99a7,null));};exports[_0xe839('0x85')]=function(_0x31d7be,_0x370b0b){var _0x47d904={'raw':![],'where':{}};var _0x32f3a5={};var _0x3ad796={'count':0x0,'rows':[]};return db[_0xe839('0x46')]['findOne']({'where':{'id':_0x31d7be[_0xe839('0x66')]['id']}})['then'](handleEntityNotFound(_0x370b0b,null))['then'](function(_0x1f1dee){if(_0x1f1dee){_0x32f3a5['model']=_[_0xe839('0x4d')](db[_0xe839('0x84')][_0xe839('0x47')]);_0x32f3a5[_0xe839('0x4c')]=_[_0xe839('0x4d')](_0x31d7be[_0xe839('0x4c')]);_0x32f3a5[_0xe839('0x4e')]=_[_0xe839('0x4f')](_0x32f3a5[_0xe839('0x4b')],_0x32f3a5[_0xe839('0x4c')]);_0x47d904[_0xe839('0x50')]=_['intersection'](_0x32f3a5['model'],qs[_0xe839('0x51')](_0x31d7be[_0xe839('0x4c')][_0xe839('0x51')]));_0x47d904[_0xe839('0x50')]=_0x47d904['attributes']['length']?_0x47d904[_0xe839('0x50')]:_0x32f3a5[_0xe839('0x4b')];if(!_0x31d7be[_0xe839('0x4c')]['hasOwnProperty']('nolimit')){_0x47d904['limit']=qs[_0xe839('0x1f')](_0x31d7be[_0xe839('0x4c')][_0xe839('0x1f')]);_0x47d904[_0xe839('0x1d')]=qs['offset'](_0x31d7be['query']['offset']);}_0x47d904[_0xe839('0x55')]=qs['sort'](_0x31d7be[_0xe839('0x4c')][_0xe839('0x56')]);_0x47d904[_0xe839('0x57')]=qs[_0xe839('0x4e')](_[_0xe839('0x6d')](_0x31d7be[_0xe839('0x4c')],_0x32f3a5[_0xe839('0x4e')]));_0x47d904[_0xe839('0x57')][_0xe839('0x69')]=_0x1f1dee['id'];if(_0x31d7be[_0xe839('0x4c')][_0xe839('0x58')]){_0x47d904[_0xe839('0x57')]=_['merge'](_0x47d904[_0xe839('0x57')],{'$or':_[_0xe839('0x45')](_0x47d904[_0xe839('0x50')],function(_0x1a9076){var _0x3385c2={};_0x3385c2[_0x1a9076]={'$like':'%'+_0x31d7be['query'][_0xe839('0x58')]+'%'};return _0x3385c2;})});}_0x47d904=_[_0xe839('0x59')]({},_0x47d904,_0x31d7be[_0xe839('0x5b')]);return db[_0xe839('0x84')][_0xe839('0x20')]({'where':_0x47d904[_0xe839('0x57')]})[_0xe839('0x11')](function(_0xe7e8d3){_0x3ad796['count']=_0xe7e8d3;if(_0x31d7be[_0xe839('0x4c')][_0xe839('0x5c')]){_0x47d904['include']=[{'model':db[_0xe839('0x86')],'as':_0xe839('0x87'),'required':![]},{'model':db[_0xe839('0x88')],'as':'Owner','attributes':[_0xe839('0x28'),_0xe839('0x89'),_0xe839('0x8a')],'required':![]},{'model':db[_0xe839('0x8b')],'as':_0xe839('0x8c'),'attributes':['id',_0xe839('0x28'),_0xe839('0x8d')],'where':_0x31d7be[_0xe839('0x4c')][_0xe839('0x8e')]?{'id':_0x31d7be[_0xe839('0x4c')][_0xe839('0x8e')]}:undefined,'required':_0x31d7be['query']['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x47d904);})[_0xe839('0x11')](function(_0x46c254){_0x3ad796['rows']=_0x46c254;return _0x3ad796;});}})[_0xe839('0x11')](respondWithFilteredResult(_0x370b0b,_0x47d904))[_0xe839('0x1a')](handleError(_0x370b0b,null));};exports[_0xe839('0x8f')]=function addApplications(_0x3914eb,_0x33185f){var _0x286272=_0x3914eb[_0xe839('0x66')]['id'];var _0x2230e6=_0x3914eb[_0xe839('0x63')];var _0x344ce2=0xc8;var _0x41a9f4=null;return db[_0xe839('0x90')][_0xe839('0x91')]({'isolationLevel':db[_0xe839('0x90')]['Transaction']['ISOLATION_LEVELS'][_0xe839('0x92')]},function(_0x21482f){return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x286272},'transaction':_0x21482f})[_0xe839('0x11')](function(_0x388ea0){if(_0x388ea0){return db[_0xe839('0x93')][_0xe839('0x24')]({'where':{'MailAccountId':_0x286272},'transaction':_0x21482f})['then'](function(){var _0x3a5f6e=_[_0xe839('0x45')](_0x2230e6,function(_0x168596){_0x168596[_0xe839('0x69')]=_0x286272;return _0x168596;});return db[_0xe839('0x93')]['bulkCreate'](_0x3a5f6e,{'transaction':_0x21482f});});}else{_0x344ce2=0x194;_0x41a9f4=[];}});})[_0xe839('0x11')](function(){if(_0x344ce2!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x286272},'order':_0xe839('0x94')})[_0xe839('0x11')](function(_0x3505da){_0x41a9f4=_0x3505da;});}})['catch'](function(_0x22acaf){_0x344ce2=0x1f4;logger[_0xe839('0x16')](_0x22acaf[_0xe839('0x27')]);if(_0x22acaf[_0xe839('0x28')]){delete _0x22acaf['name'];}_0x41a9f4=_0x22acaf;})['finally'](function(){if(_0x41a9f4===null){_0x33185f[_0xe839('0x95')](_0x344ce2);}else{if(_0x344ce2===0x1f4){_0x33185f[_0xe839('0x1b')](_0x344ce2)[_0xe839('0x29')](_0x41a9f4);}else{_0x33185f['status'](_0x344ce2)[_0xe839('0x22')](_0x41a9f4);}}});};exports['getApplications']=function(_0x389000,_0x738b4b){var _0x3593b6={};var _0x4bce80={};var _0x504c15;var _0x31c4c3;return db[_0xe839('0x46')]['findOne']({'where':{'id':_0x389000[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x738b4b,null))[_0xe839('0x11')](function(_0x2366ce){if(_0x2366ce){_0x504c15=_0x2366ce;_0x4bce80[_0xe839('0x4b')]=_['keys'](db[_0xe839('0x93')][_0xe839('0x47')]);_0x4bce80['query']=_[_0xe839('0x4d')](_0x389000[_0xe839('0x4c')]);_0x4bce80['filters']=_[_0xe839('0x4f')](_0x4bce80[_0xe839('0x4b')],_0x4bce80[_0xe839('0x4c')]);_0x3593b6[_0xe839('0x50')]=_['intersection'](_0x4bce80[_0xe839('0x4b')],qs[_0xe839('0x51')](_0x389000[_0xe839('0x4c')]['fields']));_0x3593b6[_0xe839('0x50')]=_0x3593b6[_0xe839('0x50')][_0xe839('0x52')]?_0x3593b6['attributes']:_0x4bce80[_0xe839('0x4b')];_0x3593b6[_0xe839('0x55')]=qs[_0xe839('0x56')](_0x389000['query'][_0xe839('0x56')]);_0x3593b6[_0xe839('0x57')]=qs[_0xe839('0x4e')](_[_0xe839('0x6d')](_0x389000[_0xe839('0x4c')],_0x4bce80[_0xe839('0x4e')]));if(_0x389000[_0xe839('0x4c')][_0xe839('0x58')]){_0x3593b6['where']=_[_0xe839('0x59')](_0x3593b6[_0xe839('0x57')],{'$or':_['map'](_0x3593b6['attributes'],function(_0xc7a04a){var _0x4f54f5={};_0x4f54f5[_0xc7a04a]={'$like':'%'+_0x389000[_0xe839('0x4c')][_0xe839('0x58')]+'%'};return _0x4f54f5;})});}_0x3593b6=_['merge']({},_0x3593b6,_0x389000['options']);return _0x504c15[_0xe839('0x96')](_0x3593b6);}})['then'](function(_0x77745f){if(_0x77745f){_0x31c4c3=_0x77745f[_0xe839('0x52')];if(!_0x389000['query'][_0xe839('0x53')](_0xe839('0x54'))){_0x3593b6[_0xe839('0x1f')]=qs[_0xe839('0x1f')](_0x389000['query'][_0xe839('0x1f')]);_0x3593b6['offset']=qs[_0xe839('0x1d')](_0x389000['query'][_0xe839('0x1d')]);}return _0x504c15[_0xe839('0x96')](_0x3593b6);}})[_0xe839('0x11')](function(_0xa758dd){if(_0xa758dd){return _0xa758dd?{'count':_0x31c4c3,'rows':_0xa758dd}:null;}})[_0xe839('0x11')](respondWithResult(_0x738b4b,null))[_0xe839('0x1a')](handleError(_0x738b4b,null));};exports[_0xe839('0x97')]=function(_0x171f2a,_0x75bf65){var _0x9fd9a5={'raw':!![],'where':{}};var _0x2fa508={};var _0x40b02c={'count':0x0,'rows':[]};return db['MailAccount'][_0xe839('0x6c')]({'where':{'id':_0x171f2a['params']['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x75bf65,null))[_0xe839('0x11')](function(_0x340f10){if(_0x340f10){_0x2fa508[_0xe839('0x4b')]=_['keys'](db[_0xe839('0x98')][_0xe839('0x47')]);_0x2fa508[_0xe839('0x4c')]=_[_0xe839('0x4d')](_0x171f2a[_0xe839('0x4c')]);_0x2fa508[_0xe839('0x4e')]=_['intersection'](_0x2fa508[_0xe839('0x4b')],_0x2fa508[_0xe839('0x4c')]);_0x9fd9a5[_0xe839('0x50')]=_['intersection'](_0x2fa508[_0xe839('0x4b')],qs[_0xe839('0x51')](_0x171f2a['query'][_0xe839('0x51')]));_0x9fd9a5[_0xe839('0x50')]=_0x9fd9a5['attributes'][_0xe839('0x52')]?_0x9fd9a5[_0xe839('0x50')]:_0x2fa508[_0xe839('0x4b')];if(!_0x171f2a['query']['hasOwnProperty']('nolimit')){_0x9fd9a5[_0xe839('0x1f')]=qs[_0xe839('0x1f')](_0x171f2a[_0xe839('0x4c')][_0xe839('0x1f')]);_0x9fd9a5['offset']=qs[_0xe839('0x1d')](_0x171f2a['query']['offset']);}_0x9fd9a5['order']=qs[_0xe839('0x56')](_0x171f2a[_0xe839('0x4c')][_0xe839('0x56')]);_0x9fd9a5[_0xe839('0x57')]=qs[_0xe839('0x4e')](_[_0xe839('0x6d')](_0x171f2a[_0xe839('0x4c')],_0x2fa508[_0xe839('0x4e')]));_0x9fd9a5[_0xe839('0x57')][_0xe839('0x69')]=_0x340f10['id'];if(_0x171f2a[_0xe839('0x4c')][_0xe839('0x58')]){_0x9fd9a5[_0xe839('0x57')]=_[_0xe839('0x59')](_0x9fd9a5[_0xe839('0x57')],{'$or':_[_0xe839('0x45')](_0x9fd9a5[_0xe839('0x50')],function(_0x537658){var _0xc0ad0f={};_0xc0ad0f[_0x537658]={'$like':'%'+_0x171f2a['query'][_0xe839('0x58')]+'%'};return _0xc0ad0f;})});}if(_0x171f2a[_0xe839('0x4c')]['$gte']){var _0x8477dd=_0x171f2a['query'][_0xe839('0x99')][_0xe839('0x9a')](',');var _0x1c1ca0={};_0x1c1ca0[_0x8477dd[0x0]]={'$gte':moment(_0x8477dd[0x1])['format'](_0xe839('0x9b'))};_0x9fd9a5[_0xe839('0x57')]=_[_0xe839('0x59')](_0x9fd9a5['where'],_0x1c1ca0);}_0x9fd9a5=_[_0xe839('0x59')]({},_0x9fd9a5,_0x171f2a[_0xe839('0x5b')]);return db[_0xe839('0x98')][_0xe839('0x20')]({'where':_0x9fd9a5[_0xe839('0x57')]})[_0xe839('0x11')](function(_0x3c74d1){_0x40b02c[_0xe839('0x20')]=_0x3c74d1;if(_0x171f2a['query'][_0xe839('0x5c')]){_0x9fd9a5['include']=[{'all':!![]}];}return db[_0xe839('0x98')][_0xe839('0x5e')](_0x9fd9a5);})[_0xe839('0x11')](function(_0x2e37d9){if(_0x171f2a[_0xe839('0x4c')][_0xe839('0x9c')]===_0xe839('0x9d')){for(var _0x1e966a=0x0;_0x1e966a<_0x2e37d9['length'];_0x1e966a++){_0x2e37d9[_0x1e966a][_0xe839('0x63')]=juice(_0x2e37d9[_0x1e966a][_0xe839('0x63')]);}}_0x40b02c[_0xe839('0x5f')]=_0x2e37d9;return _0x40b02c;});}})['then'](respondWithFilteredResult(_0x75bf65,_0x9fd9a5))['catch'](handleError(_0x75bf65,null));};exports[_0xe839('0x29')]=function(_0x3b09ce,_0xff6c5f){var _0x3f8cec,_0x1ba4d7={},_0xbe9a6c;if(_0x3b09ce[_0xe839('0x63')]['to']){_0xbe9a6c=_0x3b09ce[_0xe839('0x63')]['to'][_0xe839('0x9a')](',')[0x0];}return db['MailAccount'][_0xe839('0x62')]({'where':{'id':_0x3b09ce[_0xe839('0x66')]['id']},'include':[{'model':db[_0xe839('0x9e')],'as':_0xe839('0x9f'),'include':[{'model':db[_0xe839('0x86')],'as':'Contacts','where':{'email':_0xbe9a6c},'limit':0x1,'order':[['updatedAt',_0xe839('0xa0')]]}]},{'model':db[_0xe839('0x42')],'as':_0xe839('0x41'),'raw':!![],'include':[{'model':db[_0xe839('0xa1')],'as':'CloudProvider','raw':!![]}]}]})[_0xe839('0x11')](handleEntityNotFound(_0xff6c5f,null))['then'](function(_0x28d7e7){if(!_0x28d7e7)return;_0x3f8cec=_0x28d7e7;if(!_0x28d7e7[_0xe839('0x41')])throw new Error(_0xe839('0xa2'));if(_[_0xe839('0xa3')](_0x3b09ce[_0xe839('0x63')][_0xe839('0xa4')])){_0x3b09ce[_0xe839('0x63')]['from']=util[_0xe839('0xa5')]('%s\x20<%s>',_0x28d7e7[_0xe839('0x28')],_0x28d7e7[_0xe839('0x74')]||_0x28d7e7[_0xe839('0x41')]['user']);}if(_0x3b09ce[_0xe839('0x63')][_0xe839('0xa6')]&&_0x3b09ce['body'][_0xe839('0xa6')][_0xe839('0x52')]){for(var _0x15a132=0x0;_0x15a132<_0x3b09ce[_0xe839('0x63')]['attachments'][_0xe839('0x52')];_0x15a132+=0x1){_0x3b09ce[_0xe839('0x63')][_0xe839('0xa6')][_0x15a132]={'filename':_0x3b09ce['body'][_0xe839('0xa6')][_0x15a132][_0xe839('0x28')],'path':path[_0xe839('0xa7')](config[_0xe839('0xa8')],'server/files/attachments',_0x3b09ce[_0xe839('0x63')][_0xe839('0xa6')][_0x15a132][_0xe839('0xa9')])};}}var _0x463314=_0x28d7e7[_0xe839('0xaa')]();return respondWithRpcPromise(_0xe839('0xab'),'sendMail',{'account':_0x463314,'message':_0x3b09ce[_0xe839('0x63')]});})['then'](function(_0xbfde2d){if(!_0xbfde2d)return;_0x1ba4d7=_0xbfde2d;if(!_0x3f8cec[_0xe839('0x9f')])throw new Error(_0xe839('0xac'));if(_0x3f8cec['List'][_0xe839('0xad')][_0xe839('0x52')])return _0x3f8cec[_0xe839('0x9f')]['Contacts'][0x0];return db['CmContact'][_0xe839('0x6b')](_[_0xe839('0x8')](_0x3b09ce[_0xe839('0x63')],{'firstName':_0x3b09ce[_0xe839('0x63')]['to'],'email':_0x3b09ce['body']['to'],'phone':_0x3b09ce[_0xe839('0x63')]['to'],'ListId':_0x3f8cec[_0xe839('0xae')]}));})[_0xe839('0x11')](function(_0x1fec41){if(!_0x1fec41)return;var _0x2452dc={'UserId':_0x3b09ce[_0xe839('0x35')]['id'],'ContactId':_0x1fec41['id'],'MailAccountId':_0x3f8cec['id'],'inReplyTo':_0x1ba4d7[_0xe839('0xaf')],'to':_0x3b09ce[_0xe839('0x63')]['from'],'cc':_0x3b09ce['body']['cc'],'subject':_0x3b09ce[_0xe839('0x63')][_0xe839('0xb0')],'attach':_0x3b09ce[_0xe839('0x63')][_0xe839('0xb1')],'firstMsgDirection':_0xe839('0xb2'),'lastMsgAt':moment()[_0xe839('0xa5')](_0xe839('0x9b')),'lastMsgDirection':'out','Messages':[_[_0xe839('0x59')](_0x3b09ce[_0xe839('0x63')],{'messageId':_0x1ba4d7['messageId'],'sentAt':moment()[_0xe839('0xa5')](_0xe839('0x9b')),'read':!![],'MailAccountId':_0x3f8cec['id'],'UserId':_0x3b09ce[_0xe839('0x35')]['id'],'ContactId':_0x1fec41['id']})]};if(_0x3b09ce[_0xe839('0x63')][_0xe839('0xb3')]){_0x2452dc=_[_0xe839('0x59')](_0x2452dc,_0x3b09ce[_0xe839('0x63')]['Interaction']);}return db[_0xe839('0x84')][_0xe839('0x6b')](_0x2452dc,{'include':[{'model':db[_0xe839('0x98')],'as':_0xe839('0xb4')}]});})[_0xe839('0x11')](respondWithResult(_0xff6c5f,null))[_0xe839('0x1a')](handleError(_0xff6c5f,null));};exports[_0xe839('0xb5')]=function(_0x470f3c,_0x3a53a8){return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x470f3c['params']['id']},'include':[{'model':db[_0xe839('0x42')],'as':_0xe839('0x41'),'raw':!![],'include':[{'model':db[_0xe839('0xa1')],'as':_0xe839('0xa1'),'raw':!![]}]}]})[_0xe839('0x11')](handleEntityNotFound(_0x3a53a8,null))[_0xe839('0x11')](function(_0x3a0cc5){if(!_0x3a0cc5[_0xe839('0x41')])return;var _0x583474=_0x3a0cc5['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0xe839('0xb5'),{'account':_0x583474});})[_0xe839('0x11')](respondWithResult(_0x3a53a8,null))[_0xe839('0x1a')](handleError(_0x3a53a8,null));};exports[_0xe839('0x24')]=function(_0x275f70,_0x3cd64c){return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x275f70['params']['id']}})['then'](handleEntityNotFound(_0x3cd64c,null))['then'](function(_0x101d97){if(_0x101d97&&_0x101d97[_0xe839('0x3d')]){throw new db[(_0xe839('0xb6'))][(_0xe839('0xb7'))](_0xe839('0xb8'));}return _0x101d97;})[_0xe839('0x11')](removeEntity(_0x3cd64c,null))['catch'](handleError(_0x3cd64c,null));};exports[_0xe839('0xb9')]=function(_0x2d559e,_0x35e277){return db[_0xe839('0x46')]['find']({'where':{'id':_0x2d559e[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0x35e277,null))[_0xe839('0x11')](function(_0x19ab0a){if(_0x19ab0a){return _0x19ab0a[_0xe839('0xb9')](_0x2d559e['body']['ids'],_[_0xe839('0xba')](_0x2d559e[_0xe839('0x63')],['ids','id'])||{})[_0xe839('0xbb')](function(_0x1f0a73){for(var _0x240664=0x0;_0x240664<_0x2d559e[_0xe839('0x63')][_0xe839('0x6f')][_0xe839('0x52')];_0x240664+=0x1){socket[_0xe839('0xbc')](_0xe839('0xbd'),{'UserId':Number(_0x2d559e[_0xe839('0x63')]['ids'][_0x240664]),'MailAccountId':Number(_0x2d559e[_0xe839('0x66')]['id'])});}return _0x1f0a73;});}})['then'](respondWithResult(_0x35e277,null))['catch'](handleError(_0x35e277,null));};exports['removeAgents']=function(_0x21e7ae,_0x3ab4e6){return db[_0xe839('0x46')][_0xe839('0x62')]({'where':{'id':_0x21e7ae[_0xe839('0x66')]['id']}})['then'](handleEntityNotFound(_0x3ab4e6,null))[_0xe839('0x11')](function(_0x289fe5){if(_0x289fe5){return _0x289fe5[_0xe839('0xbe')](_0x21e7ae[_0xe839('0x4c')][_0xe839('0x6f')])[_0xe839('0x11')](function(){if(_[_0xe839('0xbf')](_0x21e7ae[_0xe839('0x4c')][_0xe839('0x6f')])){for(var _0x30269e=0x0;_0x30269e<_0x21e7ae['query']['ids'][_0xe839('0x52')];_0x30269e+=0x1){socket[_0xe839('0xbc')](_0xe839('0xc0'),{'UserId':Number(_0x21e7ae['query']['ids'][_0x30269e]),'MailAccountId':Number(_0x21e7ae[_0xe839('0x66')]['id'])});}}else{socket[_0xe839('0xbc')]('userMailAccount:remove',{'UserId':Number(_0x21e7ae[_0xe839('0x4c')]['ids']),'MailAccountId':Number(_0x21e7ae[_0xe839('0x66')]['id'])});}});}})[_0xe839('0x11')](respondWithStatusCode(_0x3ab4e6,null))[_0xe839('0x1a')](handleError(_0x3ab4e6,null));};exports['getAgents']=function(_0x22645f,_0xe5e63){var _0x35d28e={};var _0x32d4ec={};var _0x1beaa7;var _0x58d423;return db[_0xe839('0x46')][_0xe839('0x6c')]({'where':{'id':_0x22645f[_0xe839('0x66')]['id']}})[_0xe839('0x11')](handleEntityNotFound(_0xe5e63,null))[_0xe839('0x11')](function(_0x207479){if(_0x207479){_0x1beaa7=_0x207479;_0x32d4ec['model']=_[_0xe839('0x4d')](db[_0xe839('0x88')][_0xe839('0x47')]);_0x32d4ec[_0xe839('0x4c')]=_['keys'](_0x22645f['query']);_0x32d4ec[_0xe839('0x4e')]=_['intersection'](_0x32d4ec['model'],_0x32d4ec[_0xe839('0x4c')]);_0x35d28e[_0xe839('0x50')]=_[_0xe839('0x4f')](_0x32d4ec[_0xe839('0x4b')],qs['fields'](_0x22645f[_0xe839('0x4c')][_0xe839('0x51')]));_0x35d28e[_0xe839('0x50')]=_0x35d28e[_0xe839('0x50')][_0xe839('0x52')]?_0x35d28e[_0xe839('0x50')]:_0x32d4ec[_0xe839('0x4b')];_0x35d28e[_0xe839('0x55')]=qs[_0xe839('0x56')](_0x22645f[_0xe839('0x4c')]['sort']);_0x35d28e['where']=qs['filters'](_[_0xe839('0x6d')](_0x22645f[_0xe839('0x4c')],_0x32d4ec[_0xe839('0x4e')]));if(_0x22645f[_0xe839('0x4c')]['filter']){_0x35d28e['where']=_[_0xe839('0x59')](_0x35d28e[_0xe839('0x57')],{'$or':_[_0xe839('0x45')](_0x35d28e[_0xe839('0x50')],function(_0x22bb4d){var _0x4a66bf={};_0x4a66bf[_0x22bb4d]={'$like':'%'+_0x22645f['query'][_0xe839('0x58')]+'%'};return _0x4a66bf;})});}_0x35d28e=_['merge']({},_0x35d28e,_0x22645f['options']);return _0x1beaa7[_0xe839('0xc1')](_0x35d28e);}})[_0xe839('0x11')](function(_0x3a91f0){if(_0x3a91f0){_0x58d423=_0x3a91f0['length'];if(!_0x22645f[_0xe839('0x4c')][_0xe839('0x53')](_0xe839('0x54'))){_0x35d28e[_0xe839('0x1f')]=qs['limit'](_0x22645f[_0xe839('0x4c')][_0xe839('0x1f')]);_0x35d28e[_0xe839('0x1d')]=qs[_0xe839('0x1d')](_0x22645f[_0xe839('0x4c')][_0xe839('0x1d')]);}return _0x1beaa7['getAgents'](_0x35d28e);}})['then'](function(_0x40eddd){if(_0x40eddd){return _0x40eddd?{'count':_0x58d423,'rows':_0x40eddd}:null;}})[_0xe839('0x11')](respondWithResult(_0xe5e63,null))[_0xe839('0x1a')](handleError(_0xe5e63,null));}; \ No newline at end of file +var _0xced4=['secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','map','MailAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','rows','show','mandatoryDispositionPause','merge','update','body','provider','custom','params','Pause','Mail\x20Account\x20not\x20found','describe','addDisposition','find','MailAccountId','Disposition','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','omit','getInteractions','MailInteraction','CmContact','Contact','User','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','format','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','SendMail','defaults','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','register','http','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','json','offset','undefined','limit','count','destroy','get','UserProfileResource','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port'];(function(_0x25aa00,_0x433fa9){var _0x2424db=function(_0x4a1503){while(--_0x4a1503){_0x25aa00['push'](_0x25aa00['shift']());}};_0x2424db(++_0x433fa9);}(_0xced4,0x139));var _0x4ced=function(_0x4b9c29,_0x46c107){_0x4b9c29=_0x4b9c29-0x0;var _0xfacb34=_0xced4[_0x4b9c29];return _0xfacb34;};'use strict';var moment=require(_0x4ced('0x0'));var BPromise=require('bluebird');var util=require(_0x4ced('0x1'));var path=require(_0x4ced('0x2'));var _=require(_0x4ced('0x3'));var juice=require('juice');var Redis=require(_0x4ced('0x4'));var qs=require(_0x4ced('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x4ced('0x6'));var db=require(_0x4ced('0x7'))['db'];config[_0x4ced('0x8')]=_['defaults'](config[_0x4ced('0x8')],{'host':_0x4ced('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ced('0x8')]));require('./mailAccount.socket')[_0x4ced('0xa')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4ced('0xb')]({'port':0x232b});function respondWithRpcPromise(_0x3d9fa3,_0x280072,_0x5e4d67,_0x32b9c2){return new BPromise(function(_0xabb8a8,_0x2d4440){var _0x3aa743=_0x32b9c2||client;return _0x3aa743[_0x4ced('0xc')](_0x3d9fa3,_0x5e4d67)[_0x4ced('0xd')](function(_0x205fcb){logger[_0x4ced('0xe')](_0x4ced('0xf'),_0x280072,_0x4ced('0x10'));logger[_0x4ced('0x11')](_0x4ced('0x12'),_0x280072,_0x4ced('0x10'),JSON[_0x4ced('0x13')](_0x205fcb));if(_0x205fcb[_0x4ced('0x14')]){if(_0x205fcb['error'][_0x4ced('0x15')]===0x1f4){logger['error'](_0x4ced('0xf'),_0x280072,_0x205fcb[_0x4ced('0x14')]['message']);return _0x2d4440(_0x205fcb[_0x4ced('0x14')][_0x4ced('0x16')]);}logger[_0x4ced('0x14')](_0x4ced('0xf'),_0x280072,_0x205fcb[_0x4ced('0x14')][_0x4ced('0x16')]);return _0xabb8a8(_0x205fcb['error'][_0x4ced('0x16')]);}else{logger[_0x4ced('0xe')]('MailAccount,\x20%s,\x20%s',_0x280072,'request\x20sent');_0xabb8a8(_0x205fcb[_0x4ced('0x17')]['message']);}})[_0x4ced('0x18')](function(_0x507d18){logger[_0x4ced('0x14')](_0x4ced('0xf'),_0x280072,_0x507d18);_0x2d4440(_0x507d18);});});}function respondWithStatusCode(_0x1144ff,_0x473139){_0x473139=_0x473139||0xcc;return function(_0x46600d){if(_0x46600d){return _0x1144ff[_0x4ced('0x19')](_0x473139);}return _0x1144ff[_0x4ced('0x1a')](_0x473139)['end']();};}function respondWithResult(_0x56cf8e,_0x4d6ae3){_0x4d6ae3=_0x4d6ae3||0xc8;return function(_0x46007d){if(_0x46007d){return _0x56cf8e['status'](_0x4d6ae3)[_0x4ced('0x1b')](_0x46007d);}};}function respondWithFilteredResult(_0x23ef9d,_0x48cca8){return function(_0x1c4770){if(_0x1c4770){var _0x206c22=typeof _0x48cca8[_0x4ced('0x1c')]===_0x4ced('0x1d')&&typeof _0x48cca8[_0x4ced('0x1e')]===_0x4ced('0x1d');var _0x3e4ca7=_0x1c4770[_0x4ced('0x1f')];var _0x1d8e2d=_0x206c22?0x0:_0x48cca8['offset'];var _0x2d8ed6=_0x206c22?_0x1c4770['count']:_0x48cca8[_0x4ced('0x1c')]+_0x48cca8[_0x4ced('0x1e')];var _0xed2269;if(_0x2d8ed6>=_0x3e4ca7){_0x2d8ed6=_0x3e4ca7;_0xed2269=0xc8;}else{_0xed2269=0xce;}_0x23ef9d[_0x4ced('0x1a')](_0xed2269);return _0x23ef9d['set']('Content-Range',_0x1d8e2d+'-'+_0x2d8ed6+'/'+_0x3e4ca7)[_0x4ced('0x1b')](_0x1c4770);}return null;};}function saveUpdates(_0x172a65){return function(_0x36bcb5){if(_0x36bcb5){return _0x36bcb5['update'](_0x172a65)['then'](function(_0x3e53ac){return _0x3e53ac;});}return null;};}function removeEntity(_0x2ef3b9){return function(_0xe50a59){if(_0xe50a59){return _0xe50a59[_0x4ced('0x20')]()[_0x4ced('0xd')](function(){var _0x1c63e3=_0xe50a59[_0x4ced('0x21')]({'plain':!![]});var _0x2e0a98='MailAccounts';return db[_0x4ced('0x22')][_0x4ced('0x20')]({'where':{'type':_0x2e0a98,'resourceId':_0x1c63e3['id']}})[_0x4ced('0xd')](function(){return _0xe50a59;});})[_0x4ced('0xd')](function(){_0x2ef3b9[_0x4ced('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f93c){return function(_0x226dbc){if(!_0x226dbc){_0x11f93c[_0x4ced('0x19')](0x194);}return _0x226dbc;};}function handleError(_0x1960f5,_0x58366a){_0x58366a=_0x58366a||0x1f4;return function(_0x3aeddd){logger['error'](_0x3aeddd[_0x4ced('0x23')]);if(_0x3aeddd[_0x4ced('0x24')]){delete _0x3aeddd[_0x4ced('0x24')];}_0x1960f5[_0x4ced('0x1a')](_0x58366a)[_0x4ced('0x25')](_0x3aeddd);};}function getImapHost(_0x561a4b){switch(_0x561a4b){case'gmail':return _0x4ced('0x26');case _0x4ced('0x27'):return _0x4ced('0x28');case'hotmail':return _0x4ced('0x29');case _0x4ced('0x2a'):return _0x4ced('0x2b');}throw new Error(_0x4ced('0x2c'),_0x561a4b);}function getSmtpHost(_0x24ab4a){switch(_0x24ab4a){case _0x4ced('0x2d'):return _0x4ced('0x2e');case _0x4ced('0x27'):return _0x4ced('0x2f');case'hotmail':return'smtp-mail.outlook.com';case _0x4ced('0x2a'):return _0x4ced('0x30');}throw new Error(_0x4ced('0x2c'),_0x24ab4a);}function getAuthenticationOptions(_0xc1d7ea,_0x1d6836){var _0x14f714={};var _0x2c6a2b={};if(_0xc1d7ea){_0x14f714[_0x4ced('0x31')]=_0x2c6a2b[_0x4ced('0x31')]=_0x1d6836[_0x4ced('0x32')];_0x14f714[_0x4ced('0x33')]=_0x2c6a2b[_0x4ced('0x34')]=_0x1d6836[_0x4ced('0x33')];if(_0x1d6836[_0x4ced('0x35')]){_0x14f714[_0x4ced('0x35')]=_0x2c6a2b['modernAuthentication']=!![];_0x14f714[_0x4ced('0x36')]=_0x2c6a2b[_0x4ced('0x36')]=_0x1d6836[_0x4ced('0x36')];_0x14f714['password']=_0x2c6a2b[_0x4ced('0x34')]=null;}else{_0x14f714['CloudProviderId']=_0x2c6a2b['CloudProviderId']=null;}_0x14f714[_0x4ced('0x37')]=getImapHost(_0xc1d7ea);_0x14f714[_0x4ced('0x38')]=0x3e1;_0x2c6a2b['host']=getSmtpHost(_0xc1d7ea);_0x2c6a2b['port']=0x24b;_0x2c6a2b[_0x4ced('0x39')]=![];_0x14f714[_0x4ced('0x3a')]=_0x2c6a2b[_0x4ced('0x3a')]=null;}else{if(_0x1d6836['authentication']){_0x14f714['user']=_0x2c6a2b[_0x4ced('0x31')]=_0x1d6836[_0x4ced('0x32')];_0x14f714[_0x4ced('0x33')]=_0x2c6a2b['pass']=_0x1d6836[_0x4ced('0x33')];}else{_0x14f714[_0x4ced('0x3b')]=_0x2c6a2b[_0x4ced('0x3b')]=![];_0x14f714[_0x4ced('0x31')]=_0x2c6a2b[_0x4ced('0x31')]=null;_0x14f714[_0x4ced('0x33')]=_0x2c6a2b[_0x4ced('0x34')]=null;}_0x14f714[_0x4ced('0x37')]=_0x1d6836[_0x4ced('0x3c')][_0x4ced('0x37')];_0x14f714[_0x4ced('0x38')]=_0x1d6836[_0x4ced('0x3c')][_0x4ced('0x38')];_0x2c6a2b['host']=_0x1d6836['Smtp']['host'];_0x2c6a2b[_0x4ced('0x38')]=_0x1d6836[_0x4ced('0x3d')]['port'];}return{'Imap':_0x14f714,'Smtp':_0x2c6a2b};}exports['index']=function(_0x2ee571,_0x3e65e7){var _0x3de1e3={'include':[{'model':db[_0x4ced('0x3e')],'as':'Imap'},{'model':db[_0x4ced('0x3f')],'as':_0x4ced('0x3d')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x45400f={},_0x244391={'count':0x0,'rows':[]};var _0x98d006=_[_0x4ced('0x40')](db[_0x4ced('0x41')][_0x4ced('0x42')],function(_0x5d2360){return{'name':_0x5d2360['fieldName'],'type':_0x5d2360[_0x4ced('0x43')][_0x4ced('0x44')]};});_0x45400f['model']=_['map'](_0x98d006,_0x4ced('0x24'));_0x45400f[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x2ee571['query']);_0x45400f[_0x4ced('0x47')]=_[_0x4ced('0x48')](_0x45400f[_0x4ced('0x49')],_0x45400f['query']);_0x3de1e3[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x45400f[_0x4ced('0x49')],qs[_0x4ced('0x4b')](_0x2ee571[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x3de1e3[_0x4ced('0x4a')]=_0x3de1e3['attributes'][_0x4ced('0x4c')]?_0x3de1e3[_0x4ced('0x4a')]:_0x45400f[_0x4ced('0x49')];if(!_0x2ee571[_0x4ced('0x45')][_0x4ced('0x4d')](_0x4ced('0x4e'))){_0x3de1e3[_0x4ced('0x1e')]=qs[_0x4ced('0x1e')](_0x2ee571[_0x4ced('0x45')][_0x4ced('0x1e')]);_0x3de1e3[_0x4ced('0x1c')]=qs['offset'](_0x2ee571[_0x4ced('0x45')][_0x4ced('0x1c')]);}_0x3de1e3['order']=qs[_0x4ced('0x4f')](_0x2ee571[_0x4ced('0x45')][_0x4ced('0x4f')]);_0x3de1e3[_0x4ced('0x50')]=qs[_0x4ced('0x47')](_[_0x4ced('0x51')](_0x2ee571[_0x4ced('0x45')],_0x45400f[_0x4ced('0x47')]),_0x98d006);if(_0x2ee571['query'][_0x4ced('0x52')]){_0x3de1e3[_0x4ced('0x50')]=_['merge'](_0x3de1e3[_0x4ced('0x50')],{'$or':_[_0x4ced('0x40')](_0x98d006,function(_0x26a295){if(_0x26a295['type']!=='VIRTUAL'){var _0x5f30f1={};_0x5f30f1[_0x26a295[_0x4ced('0x24')]]={'$like':'%'+_0x2ee571[_0x4ced('0x45')][_0x4ced('0x52')]+'%'};return _0x5f30f1;}})});}_0x3de1e3=_['merge']({},_0x3de1e3,_0x2ee571[_0x4ced('0x53')]);var _0x1d21ef={'where':_0x3de1e3[_0x4ced('0x50')]};return db[_0x4ced('0x41')][_0x4ced('0x1f')](_0x1d21ef)[_0x4ced('0xd')](function(_0x84c13){_0x244391[_0x4ced('0x1f')]=_0x84c13;if(_0x2ee571['query'][_0x4ced('0x54')]){_0x3de1e3[_0x4ced('0x55')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x3de1e3);})[_0x4ced('0xd')](function(_0xc0e1a1){_0x244391[_0x4ced('0x56')]=_0xc0e1a1;return _0x244391;})[_0x4ced('0xd')](respondWithFilteredResult(_0x3e65e7,_0x3de1e3))[_0x4ced('0x18')](handleError(_0x3e65e7,null));};exports[_0x4ced('0x57')]=function(_0x36db5b,_0x23a987){var _0x1a02bb={'raw':![],'where':{'id':_0x36db5b['params']['id']},'include':[{'model':db[_0x4ced('0x3e')],'as':_0x4ced('0x3c')},{'model':db[_0x4ced('0x3f')],'as':_0x4ced('0x3d')},{'model':db['Pause'],'as':_0x4ced('0x58')}]},_0x4a7eac={};_0x4a7eac[_0x4ced('0x49')]=_['keys'](db[_0x4ced('0x41')]['rawAttributes']);_0x4a7eac['query']=_['keys'](_0x36db5b[_0x4ced('0x45')]);_0x4a7eac[_0x4ced('0x47')]=_['intersection'](_0x4a7eac[_0x4ced('0x49')],_0x4a7eac[_0x4ced('0x45')]);_0x1a02bb[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x4a7eac[_0x4ced('0x49')],qs[_0x4ced('0x4b')](_0x36db5b[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x1a02bb['attributes']=_0x1a02bb[_0x4ced('0x4a')]['length']?_0x1a02bb[_0x4ced('0x4a')]:_0x4a7eac[_0x4ced('0x49')];if(_0x36db5b['query'][_0x4ced('0x54')]){_0x1a02bb[_0x4ced('0x55')]=[{'all':!![]}];}_0x1a02bb=_[_0x4ced('0x59')]({},_0x1a02bb,_0x36db5b[_0x4ced('0x53')]);return db['MailAccount']['find'](_0x1a02bb)[_0x4ced('0xd')](handleEntityNotFound(_0x23a987,null))['then'](respondWithResult(_0x23a987,null))[_0x4ced('0x18')](handleError(_0x23a987,null));};exports[_0x4ced('0x5a')]=function(_0x4c6963,_0x37258d){if(_0x4c6963[_0x4ced('0x5b')]['id']){delete _0x4c6963[_0x4ced('0x5b')]['id'];}var _0x5b845d=_0x4c6963['body'][_0x4ced('0x5c')]===_0x4ced('0x5d')?null:_0x4c6963[_0x4ced('0x5b')][_0x4ced('0x5c')];var _0x5dae60=_0x4c6963[_0x4ced('0x5b')][_0x4ced('0x3c')]||{};var _0x1453c8=_0x4c6963['body'][_0x4ced('0x3d')]||{};if(_0x5b845d){_0x5dae60[_0x4ced('0x37')]=getImapHost(_0x5b845d);_0x5dae60[_0x4ced('0x38')]=0x3e1;_0x1453c8[_0x4ced('0x37')]=getSmtpHost(_0x5b845d);_0x1453c8[_0x4ced('0x38')]=0x24b;_0x1453c8['secure']=![];}if(_0x1453c8['modernAuthentication']){_0x1453c8['secure']=![];}else{_0x1453c8[_0x4ced('0x36')]=null;}if(!_0x5dae60[_0x4ced('0x35')])_0x5dae60[_0x4ced('0x36')]=null;_0x4c6963['body']['Imap']=_0x5dae60;_0x4c6963[_0x4ced('0x5b')][_0x4ced('0x3d')]=_0x1453c8;return db[_0x4ced('0x41')]['find']({'where':{'id':_0x4c6963[_0x4ced('0x5e')]['id']},'include':[{'model':db[_0x4ced('0x3e')],'as':_0x4ced('0x3c')},{'model':db[_0x4ced('0x3f')],'as':'Smtp'},{'model':db[_0x4ced('0x5f')],'as':_0x4ced('0x58')}]})[_0x4ced('0xd')](handleEntityNotFound(_0x37258d,null))[_0x4ced('0xd')](function(_0x6130c3){if(!_0x6130c3)throw new Error(_0x4ced('0x60'));if(_0x6130c3[_0x4ced('0x3a')])delete _0x4c6963['body'][_0x4ced('0x3c')];return _0x6130c3;})[_0x4ced('0xd')](saveUpdates(_0x4c6963['body'],null))[_0x4ced('0xd')](function(_0x389d46){if(!_0x4c6963[_0x4ced('0x5b')][_0x4ced('0x3c')])return _0x389d46;return db[_0x4ced('0x3e')][_0x4ced('0x5a')](_0x4c6963[_0x4ced('0x5b')]['Imap'],{'where':{'MailAccountId':_0x389d46['id']}})[_0x4ced('0xd')](function(){return _0x389d46;});})['then'](function(_0x5d9d1c){if(!_0x4c6963[_0x4ced('0x5b')][_0x4ced('0x3d')])return _0x5d9d1c;return db[_0x4ced('0x3f')][_0x4ced('0x5a')](_0x4c6963[_0x4ced('0x5b')]['Smtp'],{'where':{'MailAccountId':_0x5d9d1c['id']}})['then'](function(){return _0x5d9d1c;});})['then'](respondWithResult(_0x37258d,null))['catch'](handleError(_0x37258d,null));};exports[_0x4ced('0x61')]=function(_0x5120be,_0x2b262d){return db[_0x4ced('0x41')][_0x4ced('0x61')]()['then'](respondWithResult(_0x2b262d,null))[_0x4ced('0x18')](handleError(_0x2b262d,null));};exports[_0x4ced('0x62')]=function(_0x558de5,_0x4c8705){if(_0x558de5['body']['id']){delete _0x558de5[_0x4ced('0x5b')]['id'];}return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x558de5['params']['id']}})['then'](handleEntityNotFound(_0x4c8705,null))['then'](function(_0x6f89a1){if(_0x6f89a1){_0x558de5['body'][_0x4ced('0x64')]=_0x6f89a1['id'];return db[_0x4ced('0x65')]['create'](_0x558de5[_0x4ced('0x5b')]);}})[_0x4ced('0xd')](respondWithResult(_0x4c8705,null))['catch'](handleError(_0x4c8705,null));};exports['getDispositions']=function(_0x6d1409,_0x2a8ab9){var _0x3d55cc={'raw':![],'where':{}};var _0x5f5c88={};var _0x217e8e={'count':0x0,'rows':[]};return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x6d1409[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2a8ab9,null))[_0x4ced('0xd')](function(_0x1fcff3){if(_0x1fcff3){_0x5f5c88['model']=_[_0x4ced('0x46')](db['Disposition'][_0x4ced('0x42')]);_0x5f5c88[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x6d1409['query']);_0x5f5c88[_0x4ced('0x47')]=_[_0x4ced('0x48')](_0x5f5c88[_0x4ced('0x49')],_0x5f5c88[_0x4ced('0x45')]);_0x3d55cc[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x5f5c88[_0x4ced('0x49')],qs[_0x4ced('0x4b')](_0x6d1409[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x3d55cc[_0x4ced('0x4a')]=_0x3d55cc['attributes'][_0x4ced('0x4c')]?_0x3d55cc['attributes']:_0x5f5c88[_0x4ced('0x49')];if(!_0x6d1409['query'][_0x4ced('0x4d')](_0x4ced('0x4e'))){_0x3d55cc[_0x4ced('0x1e')]=qs[_0x4ced('0x1e')](_0x6d1409['query'][_0x4ced('0x1e')]);_0x3d55cc[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x6d1409['query'][_0x4ced('0x1c')]);}_0x3d55cc[_0x4ced('0x67')]=qs[_0x4ced('0x4f')](_0x6d1409[_0x4ced('0x45')][_0x4ced('0x4f')]);_0x3d55cc[_0x4ced('0x50')]=qs[_0x4ced('0x47')](_['pick'](_0x6d1409[_0x4ced('0x45')],_0x5f5c88[_0x4ced('0x47')]));_0x3d55cc[_0x4ced('0x50')][_0x4ced('0x64')]=_0x1fcff3['id'];if(_0x6d1409['query'][_0x4ced('0x52')]){_0x3d55cc[_0x4ced('0x50')]=_['merge'](_0x3d55cc[_0x4ced('0x50')],{'$or':_['map'](_0x3d55cc[_0x4ced('0x4a')],function(_0x2037ca){var _0x56586c={};_0x56586c[_0x2037ca]={'$like':'%'+_0x6d1409[_0x4ced('0x45')]['filter']+'%'};return _0x56586c;})});}_0x3d55cc=_['merge']({},_0x3d55cc,_0x6d1409['options']);return db[_0x4ced('0x65')][_0x4ced('0x1f')]({'where':_0x3d55cc[_0x4ced('0x50')]})[_0x4ced('0xd')](function(_0x88bf1a){_0x217e8e['count']=_0x88bf1a;if(_0x6d1409['query'][_0x4ced('0x54')]){_0x3d55cc[_0x4ced('0x55')]=[{'all':!![]}];}return db[_0x4ced('0x65')][_0x4ced('0x68')](_0x3d55cc);})[_0x4ced('0xd')](function(_0x201613){_0x217e8e['rows']=_0x201613;return _0x217e8e;});}})[_0x4ced('0xd')](respondWithFilteredResult(_0x2a8ab9,_0x3d55cc))[_0x4ced('0x18')](handleError(_0x2a8ab9,null));};exports[_0x4ced('0x69')]=function(_0x214d17,_0x3ae8ea){return db[_0x4ced('0x41')]['find']({'where':{'id':_0x214d17[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x3ae8ea,null))[_0x4ced('0xd')](function(_0x4517ad){if(_0x4517ad){return _0x4517ad[_0x4ced('0x69')](_0x214d17['query'][_0x4ced('0x6a')]);}})[_0x4ced('0xd')](respondWithStatusCode(_0x3ae8ea,null))[_0x4ced('0x18')](handleError(_0x3ae8ea,null));};exports[_0x4ced('0x6b')]=function(_0x570e24,_0x42ac83){if(_0x570e24[_0x4ced('0x5b')]['id']){delete _0x570e24[_0x4ced('0x5b')]['id'];}return db[_0x4ced('0x41')]['find']({'where':{'id':_0x570e24[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x42ac83,null))['then'](function(_0x4c7642){if(_0x4c7642){_0x570e24['body'][_0x4ced('0x64')]=_0x4c7642['id'];return db[_0x4ced('0x6c')][_0x4ced('0x6d')](_0x570e24[_0x4ced('0x5b')]);}})[_0x4ced('0xd')](respondWithResult(_0x42ac83,null))['catch'](handleError(_0x42ac83,null));};exports[_0x4ced('0x6e')]=function(_0x121c48,_0xb3197f){var _0x50036d={'raw':![],'where':{}};var _0x24561b={};var _0x215709={'count':0x0,'rows':[]};return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x121c48[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0xb3197f,null))[_0x4ced('0xd')](function(_0x25f3a2){if(_0x25f3a2){_0x24561b[_0x4ced('0x49')]=_[_0x4ced('0x46')](db[_0x4ced('0x6c')][_0x4ced('0x42')]);_0x24561b[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x121c48[_0x4ced('0x45')]);_0x24561b['filters']=_[_0x4ced('0x48')](_0x24561b['model'],_0x24561b[_0x4ced('0x45')]);_0x50036d['attributes']=_['intersection'](_0x24561b[_0x4ced('0x49')],qs['fields'](_0x121c48[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x50036d[_0x4ced('0x4a')]=_0x50036d[_0x4ced('0x4a')][_0x4ced('0x4c')]?_0x50036d[_0x4ced('0x4a')]:_0x24561b[_0x4ced('0x49')];if(!_0x121c48[_0x4ced('0x45')][_0x4ced('0x4d')]('nolimit')){_0x50036d['limit']=qs[_0x4ced('0x1e')](_0x121c48[_0x4ced('0x45')]['limit']);_0x50036d[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x121c48['query'][_0x4ced('0x1c')]);}_0x50036d[_0x4ced('0x67')]=qs[_0x4ced('0x4f')](_0x121c48[_0x4ced('0x45')]['sort']);_0x50036d[_0x4ced('0x50')]=qs[_0x4ced('0x47')](_[_0x4ced('0x51')](_0x121c48[_0x4ced('0x45')],_0x24561b['filters']));_0x50036d['where'][_0x4ced('0x64')]=_0x25f3a2['id'];if(_0x121c48[_0x4ced('0x45')][_0x4ced('0x52')]){_0x50036d[_0x4ced('0x50')]=_[_0x4ced('0x59')](_0x50036d[_0x4ced('0x50')],{'$or':_[_0x4ced('0x40')](_0x50036d[_0x4ced('0x4a')],function(_0x428a0b){var _0x5cb440={};_0x5cb440[_0x428a0b]={'$like':'%'+_0x121c48[_0x4ced('0x45')][_0x4ced('0x52')]+'%'};return _0x5cb440;})});}_0x50036d=_[_0x4ced('0x59')]({},_0x50036d,_0x121c48['options']);return db[_0x4ced('0x6c')][_0x4ced('0x1f')]({'where':_0x50036d[_0x4ced('0x50')]})[_0x4ced('0xd')](function(_0x5c78c8){_0x215709[_0x4ced('0x1f')]=_0x5c78c8;if(_0x121c48['query'][_0x4ced('0x54')]){_0x50036d[_0x4ced('0x55')]=[{'all':!![]}];}return db[_0x4ced('0x6c')][_0x4ced('0x68')](_0x50036d);})[_0x4ced('0xd')](function(_0x59ec2e){_0x215709[_0x4ced('0x56')]=_0x59ec2e;return _0x215709;});}})['then'](respondWithFilteredResult(_0xb3197f,_0x50036d))[_0x4ced('0x18')](handleError(_0xb3197f,null));};exports[_0x4ced('0x6f')]=function(_0x5221f2,_0x54aa2c){return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x5221f2['params']['id']}})['then'](handleEntityNotFound(_0x54aa2c,null))[_0x4ced('0xd')](function(_0x4992b9){if(_0x4992b9){return _0x4992b9[_0x4ced('0x6f')](_0x5221f2[_0x4ced('0x45')]['ids']);}})[_0x4ced('0xd')](respondWithStatusCode(_0x54aa2c,null))[_0x4ced('0x18')](handleError(_0x54aa2c,null));};exports[_0x4ced('0x6d')]=function(_0x30da0a,_0x2c587f){var _0x575a3d={'name':_0x30da0a[_0x4ced('0x5b')]['name'],'key':_0x30da0a[_0x4ced('0x5b')][_0x4ced('0x44')],'provider':_0x30da0a[_0x4ced('0x5b')][_0x4ced('0x5c')]===_0x4ced('0x5d')?null:_0x30da0a[_0x4ced('0x5b')]['provider'],'email':_0x30da0a[_0x4ced('0x5b')]['email'],'ListId':_0x30da0a[_0x4ced('0x5b')]['ListId'],'active':!_[_0x4ced('0x70')](_0x30da0a[_0x4ced('0x5b')][_0x4ced('0x71')])?_0x30da0a[_0x4ced('0x5b')][_0x4ced('0x71')]:!![],'description':_0x30da0a['body']['description']||null};var _0x10a4d4=getAuthenticationOptions(_0x575a3d[_0x4ced('0x5c')],_0x30da0a[_0x4ced('0x5b')]);_0x575a3d[_0x4ced('0x3c')]=_0x10a4d4[_0x4ced('0x3c')];_0x575a3d['Smtp']=_0x10a4d4[_0x4ced('0x3d')];return db['MailAccount'][_0x4ced('0x6d')](_0x575a3d,{'include':[{'model':db[_0x4ced('0x3f')],'as':_0x4ced('0x3d')},{'model':db[_0x4ced('0x3e')],'as':_0x4ced('0x3c')}]})[_0x4ced('0xd')](function(_0x3e28f1){var _0x1fc7a8=_0x30da0a[_0x4ced('0x31')][_0x4ced('0x21')]({'plain':!![]});if(!_0x1fc7a8)throw new Error(_0x4ced('0x72'));if(_0x1fc7a8[_0x4ced('0x73')]===_0x4ced('0x31')){var _0x4234cb=_0x3e28f1[_0x4ced('0x21')]({'plain':!![]});return db[_0x4ced('0x74')][_0x4ced('0x63')]({'where':{'name':'MailAccounts','userProfileId':_0x1fc7a8['userProfileId']},'raw':!![]})[_0x4ced('0xd')](function(_0x262098){if(_0x262098&&_0x262098[_0x4ced('0x75')]===0x0){return db[_0x4ced('0x22')]['create']({'name':_0x4234cb['name'],'resourceId':_0x4234cb['id'],'type':_0x262098['name'],'sectionId':_0x262098['id']},{})[_0x4ced('0xd')](function(){return _0x3e28f1;});}else{return _0x3e28f1;}})[_0x4ced('0x18')](function(_0x3a7ba9){logger[_0x4ced('0x14')](_0x4ced('0x76'),_0x3a7ba9);throw _0x3a7ba9;});}return _0x3e28f1;})[_0x4ced('0xd')](respondWithResult(_0x2c587f,0xc9))[_0x4ced('0x18')](handleError(_0x2c587f,null));};exports[_0x4ced('0x77')]=function(_0x27c256,_0x209bd1){return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x27c256['params']['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x209bd1,null))['then'](function(_0x25c4bb){if(_0x25c4bb){return _0x25c4bb[_0x4ced('0x77')]();}return null;})['then'](respondWithResult(_0x209bd1,null))[_0x4ced('0x18')](handleError(_0x209bd1,null));};exports[_0x4ced('0x78')]=function(_0x440185,_0x524732){if(_0x440185['body']['id']){delete _0x440185[_0x4ced('0x5b')]['id'];}return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x440185[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x524732,null))['then'](function(_0x390e8f){if(_0x390e8f){_0x440185['body']['MailAccountId']=_0x390e8f['id'];return db[_0x4ced('0x3e')][_0x4ced('0x6d')](_0x440185['body']);}})['then'](respondWithResult(_0x524732,null))[_0x4ced('0x18')](handleError(_0x524732,null));};exports[_0x4ced('0x79')]=function(_0x5ede02,_0x2d970b){return db[_0x4ced('0x41')]['findOne']({'where':{'id':_0x5ede02[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x2d970b,null))[_0x4ced('0xd')](function(_0x55246f){if(_0x55246f){return _0x55246f[_0x4ced('0x7a')](null);}return null;})['then'](respondWithStatusCode(_0x2d970b,null))['catch'](handleError(_0x2d970b,null));};exports[_0x4ced('0x7b')]=function(_0x1ec3c3,_0x2a8ffc){return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x1ec3c3[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x2a8ffc,null))[_0x4ced('0xd')](function(_0x1400a4){if(_0x1400a4){return _0x1400a4[_0x4ced('0x7b')]();}return null;})[_0x4ced('0xd')](respondWithResult(_0x2a8ffc,null))[_0x4ced('0x18')](handleError(_0x2a8ffc,null));};exports['addSmtp']=function(_0x38f5db,_0xb5dce8){if(_0x38f5db['body']['id']){delete _0x38f5db[_0x4ced('0x5b')]['id'];}return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x38f5db[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0xb5dce8,null))[_0x4ced('0xd')](function(_0x11793c){if(_0x11793c){_0x38f5db[_0x4ced('0x5b')]['MailAccountId']=_0x11793c['id'];return db[_0x4ced('0x3f')][_0x4ced('0x6d')](_0x38f5db[_0x4ced('0x5b')]);}})[_0x4ced('0xd')](respondWithResult(_0xb5dce8,null))[_0x4ced('0x18')](handleError(_0xb5dce8,null));};exports['removeSmtp']=function(_0x40ecf0,_0x2f4c86){return db['MailAccount']['findOne']({'where':{'id':_0x40ecf0['params']['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x2f4c86,null))[_0x4ced('0xd')](function(_0x2ec54f){if(_0x2ec54f){return _0x2ec54f[_0x4ced('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x2f4c86,null))[_0x4ced('0x18')](handleError(_0x2f4c86,null));};exports['addInteraction']=function(_0x2d36de,_0x243e59){return db['MailInteraction'][_0x4ced('0x63')]({'where':{'id':_0x2d36de[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x243e59,null))[_0x4ced('0xd')](function(_0xdb2b36){if(_0xdb2b36){return _0xdb2b36['addInteraction'](_0x2d36de['body'][_0x4ced('0x6a')],_[_0x4ced('0x7d')](_0x2d36de[_0x4ced('0x5b')],[_0x4ced('0x6a'),'id'])||{});}})[_0x4ced('0xd')](respondWithResult(_0x243e59,null))[_0x4ced('0x18')](handleError(_0x243e59,null));};exports[_0x4ced('0x7e')]=function(_0x19848a,_0xdcb8cc){var _0x4d401a={'raw':![],'where':{}};var _0x35efdf={};var _0x524d2e={'count':0x0,'rows':[]};return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x19848a[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0xdcb8cc,null))[_0x4ced('0xd')](function(_0x43d7b5){if(_0x43d7b5){_0x35efdf[_0x4ced('0x49')]=_[_0x4ced('0x46')](db[_0x4ced('0x7f')][_0x4ced('0x42')]);_0x35efdf[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x19848a[_0x4ced('0x45')]);_0x35efdf[_0x4ced('0x47')]=_['intersection'](_0x35efdf[_0x4ced('0x49')],_0x35efdf[_0x4ced('0x45')]);_0x4d401a[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x35efdf[_0x4ced('0x49')],qs[_0x4ced('0x4b')](_0x19848a[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x4d401a[_0x4ced('0x4a')]=_0x4d401a['attributes']['length']?_0x4d401a[_0x4ced('0x4a')]:_0x35efdf[_0x4ced('0x49')];if(!_0x19848a[_0x4ced('0x45')][_0x4ced('0x4d')]('nolimit')){_0x4d401a[_0x4ced('0x1e')]=qs[_0x4ced('0x1e')](_0x19848a[_0x4ced('0x45')][_0x4ced('0x1e')]);_0x4d401a[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x19848a[_0x4ced('0x45')][_0x4ced('0x1c')]);}_0x4d401a[_0x4ced('0x67')]=qs[_0x4ced('0x4f')](_0x19848a['query'][_0x4ced('0x4f')]);_0x4d401a['where']=qs[_0x4ced('0x47')](_[_0x4ced('0x51')](_0x19848a['query'],_0x35efdf[_0x4ced('0x47')]));_0x4d401a[_0x4ced('0x50')][_0x4ced('0x64')]=_0x43d7b5['id'];if(_0x19848a[_0x4ced('0x45')][_0x4ced('0x52')]){_0x4d401a[_0x4ced('0x50')]=_[_0x4ced('0x59')](_0x4d401a[_0x4ced('0x50')],{'$or':_['map'](_0x4d401a[_0x4ced('0x4a')],function(_0x113edc){var _0x7a95a0={};_0x7a95a0[_0x113edc]={'$like':'%'+_0x19848a[_0x4ced('0x45')]['filter']+'%'};return _0x7a95a0;})});}_0x4d401a=_['merge']({},_0x4d401a,_0x19848a[_0x4ced('0x53')]);return db[_0x4ced('0x7f')][_0x4ced('0x1f')]({'where':_0x4d401a['where']})[_0x4ced('0xd')](function(_0x277016){_0x524d2e['count']=_0x277016;if(_0x19848a[_0x4ced('0x45')][_0x4ced('0x54')]){_0x4d401a[_0x4ced('0x55')]=[{'model':db[_0x4ced('0x80')],'as':_0x4ced('0x81'),'required':![]},{'model':db[_0x4ced('0x82')],'as':'Owner','attributes':[_0x4ced('0x24'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x4ced('0x83'),'attributes':['id',_0x4ced('0x24'),_0x4ced('0x84')],'where':_0x19848a[_0x4ced('0x45')][_0x4ced('0x85')]?{'id':_0x19848a[_0x4ced('0x45')]['tag']}:undefined,'required':_0x19848a[_0x4ced('0x45')]['tag']?!![]:![]}];}return db[_0x4ced('0x7f')][_0x4ced('0x68')](_0x4d401a);})[_0x4ced('0xd')](function(_0x33cc23){_0x524d2e[_0x4ced('0x56')]=_0x33cc23;return _0x524d2e;});}})[_0x4ced('0xd')](respondWithFilteredResult(_0xdcb8cc,_0x4d401a))[_0x4ced('0x18')](handleError(_0xdcb8cc,null));};exports[_0x4ced('0x86')]=function addApplications(_0x1f934a,_0x4e9e79){var _0x32020f=_0x1f934a[_0x4ced('0x5e')]['id'];var _0x30722c=_0x1f934a[_0x4ced('0x5b')];var _0x25822c=0xc8;var _0x36216f=null;return db[_0x4ced('0x87')][_0x4ced('0x88')]({'isolationLevel':db[_0x4ced('0x87')][_0x4ced('0x89')][_0x4ced('0x8a')][_0x4ced('0x8b')]},function(_0x99ca34){return db['MailAccount'][_0x4ced('0x66')]({'where':{'id':_0x32020f},'transaction':_0x99ca34})['then'](function(_0x1dfa29){if(_0x1dfa29){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x32020f},'transaction':_0x99ca34})[_0x4ced('0xd')](function(){var _0x167cf8=_[_0x4ced('0x40')](_0x30722c,function(_0xb361fc){_0xb361fc[_0x4ced('0x64')]=_0x32020f;return _0xb361fc;});return db[_0x4ced('0x8c')][_0x4ced('0x8d')](_0x167cf8,{'transaction':_0x99ca34});});}else{_0x25822c=0x194;_0x36216f=[];}});})['then'](function(){if(_0x25822c!==0x194){return db[_0x4ced('0x8c')]['findAndCountAll']({'where':{'MailAccountId':_0x32020f},'order':_0x4ced('0x8e')})[_0x4ced('0xd')](function(_0x3cfd6e){_0x36216f=_0x3cfd6e;});}})[_0x4ced('0x18')](function(_0x3f0df3){_0x25822c=0x1f4;logger[_0x4ced('0x14')](_0x3f0df3['stack']);if(_0x3f0df3[_0x4ced('0x24')]){delete _0x3f0df3['name'];}_0x36216f=_0x3f0df3;})['finally'](function(){if(_0x36216f===null){_0x4e9e79['sendStatus'](_0x25822c);}else{if(_0x25822c===0x1f4){_0x4e9e79[_0x4ced('0x1a')](_0x25822c)[_0x4ced('0x25')](_0x36216f);}else{_0x4e9e79['status'](_0x25822c)[_0x4ced('0x1b')](_0x36216f);}}});};exports[_0x4ced('0x8f')]=function(_0x4931c7,_0x32c7e4){var _0x2eab76={};var _0x1d8e6d={};var _0x1ab57e;var _0x33cfbc;return db['MailAccount'][_0x4ced('0x66')]({'where':{'id':_0x4931c7[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x32c7e4,null))['then'](function(_0x3c8c33){if(_0x3c8c33){_0x1ab57e=_0x3c8c33;_0x1d8e6d[_0x4ced('0x49')]=_[_0x4ced('0x46')](db[_0x4ced('0x8c')]['rawAttributes']);_0x1d8e6d[_0x4ced('0x45')]=_['keys'](_0x4931c7['query']);_0x1d8e6d['filters']=_[_0x4ced('0x48')](_0x1d8e6d[_0x4ced('0x49')],_0x1d8e6d[_0x4ced('0x45')]);_0x2eab76['attributes']=_['intersection'](_0x1d8e6d[_0x4ced('0x49')],qs[_0x4ced('0x4b')](_0x4931c7[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x2eab76[_0x4ced('0x4a')]=_0x2eab76[_0x4ced('0x4a')][_0x4ced('0x4c')]?_0x2eab76[_0x4ced('0x4a')]:_0x1d8e6d['model'];_0x2eab76[_0x4ced('0x67')]=qs['sort'](_0x4931c7[_0x4ced('0x45')][_0x4ced('0x4f')]);_0x2eab76[_0x4ced('0x50')]=qs[_0x4ced('0x47')](_[_0x4ced('0x51')](_0x4931c7[_0x4ced('0x45')],_0x1d8e6d[_0x4ced('0x47')]));if(_0x4931c7[_0x4ced('0x45')]['filter']){_0x2eab76[_0x4ced('0x50')]=_['merge'](_0x2eab76[_0x4ced('0x50')],{'$or':_[_0x4ced('0x40')](_0x2eab76[_0x4ced('0x4a')],function(_0x269f6d){var _0x2db0e4={};_0x2db0e4[_0x269f6d]={'$like':'%'+_0x4931c7[_0x4ced('0x45')][_0x4ced('0x52')]+'%'};return _0x2db0e4;})});}_0x2eab76=_[_0x4ced('0x59')]({},_0x2eab76,_0x4931c7[_0x4ced('0x53')]);return _0x1ab57e[_0x4ced('0x8f')](_0x2eab76);}})['then'](function(_0x375e01){if(_0x375e01){_0x33cfbc=_0x375e01[_0x4ced('0x4c')];if(!_0x4931c7[_0x4ced('0x45')][_0x4ced('0x4d')](_0x4ced('0x4e'))){_0x2eab76[_0x4ced('0x1e')]=qs[_0x4ced('0x1e')](_0x4931c7['query'][_0x4ced('0x1e')]);_0x2eab76[_0x4ced('0x1c')]=qs[_0x4ced('0x1c')](_0x4931c7[_0x4ced('0x45')]['offset']);}return _0x1ab57e[_0x4ced('0x8f')](_0x2eab76);}})[_0x4ced('0xd')](function(_0x55f26d){if(_0x55f26d){return _0x55f26d?{'count':_0x33cfbc,'rows':_0x55f26d}:null;}})[_0x4ced('0xd')](respondWithResult(_0x32c7e4,null))[_0x4ced('0x18')](handleError(_0x32c7e4,null));};exports[_0x4ced('0x90')]=function(_0x5a3813,_0x193a41){var _0x81a3cb={'raw':!![],'where':{}};var _0x1e9d20={};var _0x1c6323={'count':0x0,'rows':[]};return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x5a3813[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x193a41,null))[_0x4ced('0xd')](function(_0x40572d){if(_0x40572d){_0x1e9d20[_0x4ced('0x49')]=_[_0x4ced('0x46')](db[_0x4ced('0x91')][_0x4ced('0x42')]);_0x1e9d20[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x5a3813['query']);_0x1e9d20[_0x4ced('0x47')]=_[_0x4ced('0x48')](_0x1e9d20[_0x4ced('0x49')],_0x1e9d20[_0x4ced('0x45')]);_0x81a3cb[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x1e9d20[_0x4ced('0x49')],qs['fields'](_0x5a3813[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x81a3cb[_0x4ced('0x4a')]=_0x81a3cb[_0x4ced('0x4a')][_0x4ced('0x4c')]?_0x81a3cb[_0x4ced('0x4a')]:_0x1e9d20[_0x4ced('0x49')];if(!_0x5a3813[_0x4ced('0x45')][_0x4ced('0x4d')](_0x4ced('0x4e'))){_0x81a3cb[_0x4ced('0x1e')]=qs[_0x4ced('0x1e')](_0x5a3813['query'][_0x4ced('0x1e')]);_0x81a3cb[_0x4ced('0x1c')]=qs['offset'](_0x5a3813['query']['offset']);}_0x81a3cb[_0x4ced('0x67')]=qs[_0x4ced('0x4f')](_0x5a3813[_0x4ced('0x45')][_0x4ced('0x4f')]);_0x81a3cb[_0x4ced('0x50')]=qs['filters'](_[_0x4ced('0x51')](_0x5a3813[_0x4ced('0x45')],_0x1e9d20['filters']));_0x81a3cb['where'][_0x4ced('0x64')]=_0x40572d['id'];if(_0x5a3813[_0x4ced('0x45')][_0x4ced('0x52')]){_0x81a3cb['where']=_['merge'](_0x81a3cb[_0x4ced('0x50')],{'$or':_[_0x4ced('0x40')](_0x81a3cb[_0x4ced('0x4a')],function(_0x52ddfb){var _0x9985e2={};_0x9985e2[_0x52ddfb]={'$like':'%'+_0x5a3813[_0x4ced('0x45')][_0x4ced('0x52')]+'%'};return _0x9985e2;})});}if(_0x5a3813[_0x4ced('0x45')]['$gte']){var _0x182328=_0x5a3813[_0x4ced('0x45')][_0x4ced('0x92')]['split'](',');var _0x21759a={};_0x21759a[_0x182328[0x0]]={'$gte':moment(_0x182328[0x1])[_0x4ced('0x93')]('YYYY-MM-DD\x20HH:mm:ss')};_0x81a3cb['where']=_[_0x4ced('0x59')](_0x81a3cb['where'],_0x21759a);}_0x81a3cb=_[_0x4ced('0x59')]({},_0x81a3cb,_0x5a3813[_0x4ced('0x53')]);return db['MailMessage'][_0x4ced('0x1f')]({'where':_0x81a3cb[_0x4ced('0x50')]})['then'](function(_0x2c1270){_0x1c6323[_0x4ced('0x1f')]=_0x2c1270;if(_0x5a3813[_0x4ced('0x45')][_0x4ced('0x54')]){_0x81a3cb[_0x4ced('0x55')]=[{'all':!![]}];}return db['MailMessage'][_0x4ced('0x68')](_0x81a3cb);})[_0x4ced('0xd')](function(_0x727171){if(_0x5a3813['query'][_0x4ced('0x94')]===_0x4ced('0x95')){for(var _0x77e4e8=0x0;_0x77e4e8<_0x727171[_0x4ced('0x4c')];_0x77e4e8++){_0x727171[_0x77e4e8]['body']=juice(_0x727171[_0x77e4e8][_0x4ced('0x5b')]);}}_0x1c6323['rows']=_0x727171;return _0x1c6323;});}})[_0x4ced('0xd')](respondWithFilteredResult(_0x193a41,_0x81a3cb))[_0x4ced('0x18')](handleError(_0x193a41,null));};exports['send']=function(_0x384fb1,_0x15bc96){var _0x1da1ec,_0x56a463={},_0x200c8b;if(_0x384fb1[_0x4ced('0x5b')]['to']){_0x200c8b=_0x384fb1[_0x4ced('0x5b')]['to']['split'](',')[0x0];}return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x384fb1[_0x4ced('0x5e')]['id']},'include':[{'model':db[_0x4ced('0x96')],'as':_0x4ced('0x97'),'include':[{'model':db[_0x4ced('0x80')],'as':_0x4ced('0x98'),'where':{'email':_0x200c8b},'limit':0x1,'order':[[_0x4ced('0x99'),_0x4ced('0x9a')]]}]},{'model':db[_0x4ced('0x3f')],'as':_0x4ced('0x3d'),'raw':!![],'include':[{'model':db[_0x4ced('0x9b')],'as':_0x4ced('0x9b'),'raw':!![]}]}]})[_0x4ced('0xd')](handleEntityNotFound(_0x15bc96,null))[_0x4ced('0xd')](function(_0x3f401d){if(!_0x3f401d)return;_0x1da1ec=_0x3f401d;if(!_0x3f401d[_0x4ced('0x3d')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x4ced('0x70')](_0x384fb1[_0x4ced('0x5b')][_0x4ced('0x9c')])){_0x384fb1['body'][_0x4ced('0x9c')]=util[_0x4ced('0x93')](_0x4ced('0x9d'),_0x3f401d[_0x4ced('0x24')],_0x3f401d[_0x4ced('0x9e')]||_0x3f401d[_0x4ced('0x3d')][_0x4ced('0x31')]);}if(_0x384fb1[_0x4ced('0x5b')][_0x4ced('0x9f')]&&_0x384fb1[_0x4ced('0x5b')][_0x4ced('0x9f')][_0x4ced('0x4c')]){for(var _0x2543db=0x0;_0x2543db<_0x384fb1[_0x4ced('0x5b')]['attachments']['length'];_0x2543db+=0x1){_0x384fb1['body'][_0x4ced('0x9f')][_0x2543db]={'filename':_0x384fb1[_0x4ced('0x5b')][_0x4ced('0x9f')][_0x2543db][_0x4ced('0x24')],'path':path['join'](config[_0x4ced('0xa0')],_0x4ced('0xa1'),_0x384fb1[_0x4ced('0x5b')]['attachments'][_0x2543db][_0x4ced('0xa2')])};}}var _0x211a96=_0x3f401d['getSmtpOptions']();return respondWithRpcPromise(_0x4ced('0xa3'),'sendMail',{'account':_0x211a96,'message':_0x384fb1[_0x4ced('0x5b')]});})[_0x4ced('0xd')](function(_0x24ffcd){if(!_0x24ffcd)return;_0x56a463=_0x24ffcd;if(!_0x1da1ec['List'])throw new Error('List\x20not\x20found');if(_0x1da1ec[_0x4ced('0x97')][_0x4ced('0x98')][_0x4ced('0x4c')])return _0x1da1ec[_0x4ced('0x97')][_0x4ced('0x98')][0x0];return db['CmContact'][_0x4ced('0x6d')](_[_0x4ced('0xa4')](_0x384fb1[_0x4ced('0x5b')],{'firstName':_0x384fb1[_0x4ced('0x5b')]['to'],'email':_0x384fb1['body']['to'],'phone':_0x384fb1[_0x4ced('0x5b')]['to'],'ListId':_0x1da1ec['ListId']}));})[_0x4ced('0xd')](function(_0xf1d523){if(!_0xf1d523)return;var _0xe6945={'UserId':_0x384fb1[_0x4ced('0x31')]['id'],'ContactId':_0xf1d523['id'],'MailAccountId':_0x1da1ec['id'],'inReplyTo':_0x56a463[_0x4ced('0xa5')],'to':_0x384fb1[_0x4ced('0x5b')][_0x4ced('0x9c')],'cc':_0x384fb1[_0x4ced('0x5b')]['cc'],'subject':_0x384fb1[_0x4ced('0x5b')][_0x4ced('0xa6')],'attach':_0x384fb1[_0x4ced('0x5b')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x4ced('0x93')](_0x4ced('0xa7')),'lastMsgDirection':_0x4ced('0xa8'),'Messages':[_['merge'](_0x384fb1[_0x4ced('0x5b')],{'messageId':_0x56a463['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x1da1ec['id'],'UserId':_0x384fb1['user']['id'],'ContactId':_0xf1d523['id']})]};if(_0x384fb1[_0x4ced('0x5b')][_0x4ced('0xa9')]){_0xe6945=_[_0x4ced('0x59')](_0xe6945,_0x384fb1[_0x4ced('0x5b')]['Interaction']);}return db[_0x4ced('0x7f')][_0x4ced('0x6d')](_0xe6945,{'include':[{'model':db[_0x4ced('0x91')],'as':_0x4ced('0xaa')}]});})[_0x4ced('0xd')](respondWithResult(_0x15bc96,null))[_0x4ced('0x18')](handleError(_0x15bc96,null));};exports[_0x4ced('0xab')]=function(_0x5357a0,_0x555453){return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x5357a0[_0x4ced('0x5e')]['id']},'include':[{'model':db[_0x4ced('0x3f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4ced('0x9b')],'as':_0x4ced('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x555453,null))[_0x4ced('0xd')](function(_0x473af0){if(!_0x473af0[_0x4ced('0x3d')])return;var _0x47f213=_0x473af0[_0x4ced('0xac')]();return respondWithRpcPromise(_0x4ced('0xad'),_0x4ced('0xab'),{'account':_0x47f213});})['then'](respondWithResult(_0x555453,null))[_0x4ced('0x18')](handleError(_0x555453,null));};exports[_0x4ced('0x20')]=function(_0x124b7f,_0x17a610){return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x124b7f[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x17a610,null))[_0x4ced('0xd')](function(_0x396a04){if(_0x396a04&&_0x396a04[_0x4ced('0x3a')]){throw new db[(_0x4ced('0xae'))][(_0x4ced('0xaf'))](_0x4ced('0xb0'));}return _0x396a04;})[_0x4ced('0xd')](removeEntity(_0x17a610,null))[_0x4ced('0x18')](handleError(_0x17a610,null));};exports['addAgents']=function(_0x316a2d,_0x5e35df){return db[_0x4ced('0x41')][_0x4ced('0x63')]({'where':{'id':_0x316a2d[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5e35df,null))[_0x4ced('0xd')](function(_0x5b568f){if(_0x5b568f){return _0x5b568f[_0x4ced('0xb1')](_0x316a2d['body'][_0x4ced('0x6a')],_[_0x4ced('0x7d')](_0x316a2d['body'],[_0x4ced('0x6a'),'id'])||{})[_0x4ced('0xb2')](function(_0x2b997f){for(var _0x33962a=0x0;_0x33962a<_0x316a2d[_0x4ced('0x5b')][_0x4ced('0x6a')][_0x4ced('0x4c')];_0x33962a+=0x1){socket['emit'](_0x4ced('0xb3'),{'UserId':Number(_0x316a2d[_0x4ced('0x5b')][_0x4ced('0x6a')][_0x33962a]),'MailAccountId':Number(_0x316a2d[_0x4ced('0x5e')]['id'])});}return _0x2b997f;});}})['then'](respondWithResult(_0x5e35df,null))[_0x4ced('0x18')](handleError(_0x5e35df,null));};exports['removeAgents']=function(_0x12ce5b,_0x5efa28){return db['MailAccount'][_0x4ced('0x63')]({'where':{'id':_0x12ce5b[_0x4ced('0x5e')]['id']}})[_0x4ced('0xd')](handleEntityNotFound(_0x5efa28,null))['then'](function(_0x597cc1){if(_0x597cc1){return _0x597cc1[_0x4ced('0xb4')](_0x12ce5b[_0x4ced('0x45')][_0x4ced('0x6a')])['then'](function(){if(_[_0x4ced('0xb5')](_0x12ce5b[_0x4ced('0x45')][_0x4ced('0x6a')])){for(var _0x48d127=0x0;_0x48d127<_0x12ce5b['query'][_0x4ced('0x6a')][_0x4ced('0x4c')];_0x48d127+=0x1){socket['emit'](_0x4ced('0xb6'),{'UserId':Number(_0x12ce5b[_0x4ced('0x45')][_0x4ced('0x6a')][_0x48d127]),'MailAccountId':Number(_0x12ce5b[_0x4ced('0x5e')]['id'])});}}else{socket[_0x4ced('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x12ce5b[_0x4ced('0x45')][_0x4ced('0x6a')]),'MailAccountId':Number(_0x12ce5b[_0x4ced('0x5e')]['id'])});}});}})[_0x4ced('0xd')](respondWithStatusCode(_0x5efa28,null))[_0x4ced('0x18')](handleError(_0x5efa28,null));};exports[_0x4ced('0xb8')]=function(_0x1408d9,_0x24a22b){var _0x568afd={};var _0x4225e9={};var _0x16c174;var _0x1bfc36;return db[_0x4ced('0x41')][_0x4ced('0x66')]({'where':{'id':_0x1408d9[_0x4ced('0x5e')]['id']}})['then'](handleEntityNotFound(_0x24a22b,null))['then'](function(_0x30bc7d){if(_0x30bc7d){_0x16c174=_0x30bc7d;_0x4225e9[_0x4ced('0x49')]=_['keys'](db[_0x4ced('0x82')][_0x4ced('0x42')]);_0x4225e9[_0x4ced('0x45')]=_[_0x4ced('0x46')](_0x1408d9[_0x4ced('0x45')]);_0x4225e9[_0x4ced('0x47')]=_[_0x4ced('0x48')](_0x4225e9[_0x4ced('0x49')],_0x4225e9[_0x4ced('0x45')]);_0x568afd[_0x4ced('0x4a')]=_[_0x4ced('0x48')](_0x4225e9['model'],qs[_0x4ced('0x4b')](_0x1408d9[_0x4ced('0x45')][_0x4ced('0x4b')]));_0x568afd[_0x4ced('0x4a')]=_0x568afd[_0x4ced('0x4a')]['length']?_0x568afd[_0x4ced('0x4a')]:_0x4225e9[_0x4ced('0x49')];_0x568afd[_0x4ced('0x67')]=qs['sort'](_0x1408d9[_0x4ced('0x45')]['sort']);_0x568afd[_0x4ced('0x50')]=qs[_0x4ced('0x47')](_[_0x4ced('0x51')](_0x1408d9[_0x4ced('0x45')],_0x4225e9[_0x4ced('0x47')]));if(_0x1408d9[_0x4ced('0x45')][_0x4ced('0x52')]){_0x568afd[_0x4ced('0x50')]=_[_0x4ced('0x59')](_0x568afd[_0x4ced('0x50')],{'$or':_[_0x4ced('0x40')](_0x568afd[_0x4ced('0x4a')],function(_0x2c3162){var _0xc36894={};_0xc36894[_0x2c3162]={'$like':'%'+_0x1408d9[_0x4ced('0x45')][_0x4ced('0x52')]+'%'};return _0xc36894;})});}_0x568afd=_[_0x4ced('0x59')]({},_0x568afd,_0x1408d9[_0x4ced('0x53')]);return _0x16c174['getAgents'](_0x568afd);}})[_0x4ced('0xd')](function(_0x274734){if(_0x274734){_0x1bfc36=_0x274734[_0x4ced('0x4c')];if(!_0x1408d9['query'][_0x4ced('0x4d')](_0x4ced('0x4e'))){_0x568afd[_0x4ced('0x1e')]=qs['limit'](_0x1408d9['query'][_0x4ced('0x1e')]);_0x568afd['offset']=qs[_0x4ced('0x1c')](_0x1408d9[_0x4ced('0x45')][_0x4ced('0x1c')]);}return _0x16c174[_0x4ced('0xb8')](_0x568afd);}})[_0x4ced('0xd')](function(_0x3d1054){if(_0x3d1054){return _0x3d1054?{'count':_0x1bfc36,'rows':_0x3d1054}:null;}})[_0x4ced('0xd')](respondWithResult(_0x24a22b,null))[_0x4ced('0x18')](handleError(_0x24a22b,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 71305e2..4323e2a 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 _0x09b7=['exports','events','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x4d0556,_0x56acc2){var _0x2ee954=function(_0x151a4b){while(--_0x151a4b){_0x4d0556['push'](_0x4d0556['shift']());}};_0x2ee954(++_0x56acc2);}(_0x09b7,0x121));var _0x709b=function(_0x4cb9d5,_0x187d5a){_0x4cb9d5=_0x4cb9d5-0x0;var _0x444523=_0x09b7[_0x4cb9d5];return _0x444523;};'use strict';var EventEmitter=require(_0x709b('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x709b('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x709b('0x2')](0x0);var events={'afterCreate':_0x709b('0x3'),'afterUpdate':_0x709b('0x4'),'afterDestroy':_0x709b('0x5')};function emitEvent(_0x5041e4){return function(_0x1f84dd,_0xff2fd7,_0x2fc4e2){MailAccountEvents[_0x709b('0x6')](_0x5041e4+':'+_0x1f84dd['id'],_0x1f84dd);MailAccountEvents['emit'](_0x5041e4,_0x1f84dd);_0x2fc4e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x709b('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x3f3c=['update','remove','emit','exports','../../mysqldb','MailAccount','save'];(function(_0x3fb05b,_0x473ea3){var _0x36c70b=function(_0x418604){while(--_0x418604){_0x3fb05b['push'](_0x3fb05b['shift']());}};_0x36c70b(++_0x473ea3);}(_0x3f3c,0x1e0));var _0xc3f3=function(_0x96d116,_0x12e2c7){_0x96d116=_0x96d116-0x0;var _0x814fa3=_0x3f3c[_0x96d116];return _0x814fa3;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc3f3('0x0'))['db'][_0xc3f3('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3f3('0x2'),'afterUpdate':_0xc3f3('0x3'),'afterDestroy':_0xc3f3('0x4')};function emitEvent(_0x2b7ca0){return function(_0xb3c191,_0x591199,_0xdf1d7a){MailAccountEvents[_0xc3f3('0x5')](_0x2b7ca0+':'+_0xb3c191['id'],_0xb3c191);MailAccountEvents[_0xc3f3('0x5')](_0x2b7ca0,_0xb3c191);_0xdf1d7a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc3f3('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5fbe114..cd1b4af 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 _0xe3cb=['auth','pass','define','MailAccount','provider','custom','service','Smtp','port','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','data5'];(function(_0x28fee0,_0x3c93f0){var _0xce97c5=function(_0x7ab4ee){while(--_0x7ab4ee){_0x28fee0['push'](_0x28fee0['shift']());}};_0xce97c5(++_0x3c93f0);}(_0xe3cb,0x10c));var _0xbe3c=function(_0x1adda4,_0x537884){_0x1adda4=_0x1adda4-0x0;var _0x4f9025=_0xe3cb[_0x1adda4];return _0x4f9025;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x2c45ba){return _0x2c45ba[_0xbe3c('0x0')](_0xbe3c('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3432be=this;var _0x4403b7={'id':_0x3432be['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3432be[_0xbe3c('0x2')]!==_0xbe3c('0x3')){_0x4403b7[_0xbe3c('0x4')]=_0x3432be[_0xbe3c('0x2')];}else{_0x4403b7['host']=_0x3432be[_0xbe3c('0x5')]['host'];_0x4403b7[_0xbe3c('0x6')]=_0x3432be[_0xbe3c('0x5')][_0xbe3c('0x6')];_0x4403b7['secure']=_0x3432be['Smtp']['secure'];}if(_0x3432be[_0xbe3c('0x5')][_0xbe3c('0x7')]){if(_0x3432be['Smtp']['modernAuthentication']){if(!_0x3432be['Smtp'][_0xbe3c('0x8')])throw new Error(_0xbe3c('0x9'));_0x4403b7['auth']={'type':'OAuth2','user':_0x3432be[_0xbe3c('0x5')][_0xbe3c('0xa')],'accessToken':_0x3432be[_0xbe3c('0x5')][_0xbe3c('0x8')][_0xbe3c('0xb')]};}else{_0x4403b7[_0xbe3c('0xc')]={'user':_0x3432be['Smtp'][_0xbe3c('0xa')],'pass':_0x3432be['Smtp'][_0xbe3c('0xd')]};}}return _0x4403b7;}}});}; \ No newline at end of file +var _0x020b=['pass','./mailAccount.attributes','define','MailAccount','custom','provider','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user'];(function(_0x542bac,_0x238546){var _0x46bc5b=function(_0x54d20e){while(--_0x54d20e){_0x542bac['push'](_0x542bac['shift']());}};_0x46bc5b(++_0x238546);}(_0x020b,0x91));var _0xb020=function(_0x281e8c,_0xfffe0f){_0x281e8c=_0x281e8c-0x0;var _0x15f559=_0x020b[_0x281e8c];return _0x15f559;};'use strict';var attributes=require(_0xb020('0x0'));module['exports']=function(_0x200894){return _0x200894[_0xb020('0x1')](_0xb020('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x53be1b=this;var _0x93c600={'id':_0x53be1b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x53be1b['provider']!==_0xb020('0x3')){_0x93c600['service']=_0x53be1b[_0xb020('0x4')];}else{_0x93c600[_0xb020('0x5')]=_0x53be1b[_0xb020('0x6')][_0xb020('0x5')];_0x93c600[_0xb020('0x7')]=_0x53be1b[_0xb020('0x6')][_0xb020('0x7')];_0x93c600[_0xb020('0x8')]=_0x53be1b['Smtp'][_0xb020('0x8')];}if(_0x53be1b[_0xb020('0x6')][_0xb020('0x9')]){if(_0x53be1b['Smtp']['modernAuthentication']){if(!_0x53be1b[_0xb020('0x6')][_0xb020('0xa')])throw new Error(_0xb020('0xb'));_0x93c600[_0xb020('0xc')]={'type':_0xb020('0xd'),'user':_0x53be1b[_0xb020('0x6')][_0xb020('0xe')],'accessToken':_0x53be1b[_0xb020('0x6')][_0xb020('0xa')]['data5']};}else{_0x93c600[_0xb020('0xc')]={'user':_0x53be1b['Smtp'][_0xb020('0xe')],'pass':_0x53be1b['Smtp'][_0xb020('0xf')]};}}return _0x93c600;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 9e39e00..7e1bc1d 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 _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2282de,_0x37aaed){var _0x1097e1=function(_0x6046cc){while(--_0x6046cc){_0x2282de['push'](_0x2282de['shift']());}};_0x1097e1(++_0x37aaed);}(_0xc2c7,0x134));var _0x7c2c=function(_0x414562,_0x21af46){_0x414562=_0x414562-0x0;var _0x2a043f=_0xc2c7[_0x414562];return _0x2a043f;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file +var _0x4137=['Smtp','CloudProvider','get','omit','Applications','applications','priority','asc','push','length','Contacts','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailServerOut'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var BPromise=require(_0x7413('0x2'));var rs=require(_0x7413('0x3'));var Redis=require(_0x7413('0x4'));var db=require(_0x7413('0x5'))['db'];var logger=require(_0x7413('0x6'))(_0x7413('0x7'));var config=require(_0x7413('0x8'));var jayson=require(_0x7413('0x9'));var client=jayson[_0x7413('0xa')][_0x7413('0xb')]({'port':0x232c});config['redis']=_[_0x7413('0xc')](config[_0x7413('0xd')],{'host':_0x7413('0xe'),'port':0x18eb});var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);function respondWithRpcPromise(_0x4e320b,_0x422bf5,_0x2f4b54){return new BPromise(function(_0x50fde0,_0x29f124){return client[_0x7413('0x12')](_0x4e320b,_0x2f4b54)[_0x7413('0x13')](function(_0x3e026b){logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));logger[_0x7413('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'),JSON[_0x7413('0x17')](_0x3e026b));if(_0x3e026b[_0x7413('0x18')]){if(_0x3e026b['error']['code']===0x1f4){logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b[_0x7413('0x18')]['message']);return _0x29f124(_0x3e026b[_0x7413('0x18')][_0x7413('0x1a')]);}logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b['error']['message']);return _0x50fde0(_0x3e026b[_0x7413('0x18')]['message']);}else{logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));_0x50fde0(_0x3e026b[_0x7413('0x1b')][_0x7413('0x1a')]);}})[_0x7413('0x1c')](function(_0x2a3417){logger[_0x7413('0x18')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x2a3417);_0x29f124(_0x2a3417);});});}exports[_0x7413('0x1d')]=function(_0x17c062){var _0x11f8a1=this;return new Promise(function(_0xfe5b8c,_0x5bee15){return db[_0x7413('0x1e')][_0x7413('0x1f')]({'raw':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x21')]===undefined?!![]:![]:!![],'where':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x22')]||null:null,'attributes':_0x17c062['options']?_0x17c062['options'][_0x7413('0x23')]||null:null,'limit':_0x17c062['options']?_0x17c062[_0x7413('0x20')][_0x7413('0x24')]||null:null,'include':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x25')]?_[_0x7413('0x26')](_0x17c062[_0x7413('0x20')][_0x7413('0x25')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x25')]?_['map'](_0x1d455b[_0x7413('0x25')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x27')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes'],'include':_0x71cbb4[_0x7413('0x25')]?_[_0x7413('0x26')](_0x71cbb4[_0x7413('0x25')],function(_0x4843fd){return{'model':db[_0x4843fd[_0x7413('0x27')]],'as':_0x4843fd['as'],'attributes':_0x4843fd[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dce7){logger['info'](_0x7413('0x1d'),_0x17c062);logger[_0x7413('0x16')](_0x7413('0x1d'),_0x17c062,JSON[_0x7413('0x17')](_0x24dce7));_0xfe5b8c(_0x24dce7);})[_0x7413('0x1c')](function(_0x2004ea){logger['error'](_0x7413('0x1d'),_0x2004ea[_0x7413('0x1a')],_0x17c062);_0x5bee15(_0x11f8a1[_0x7413('0x18')](0x1f4,_0x2004ea[_0x7413('0x1a')]));});});};exports[_0x7413('0x28')]=function(_0x256395){var _0x185cfe=this;return new Promise(function(_0x5b4426,_0xd763f9){return db[_0x7413('0x1e')][_0x7413('0x29')]({'raw':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x22')]||null:null,'attributes':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['attributes']||null:null,'include':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x25')]?_[_0x7413('0x26')](_0x256395['options']['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x27')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x23')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x25')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x23')],'include':_0x5a92ab['include']?_[_0x7413('0x26')](_0x5a92ab[_0x7413('0x25')],function(_0xf34b21){return{'model':db[_0xf34b21[_0x7413('0x27')]],'as':_0xf34b21['as'],'attributes':_0xf34b21[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58bd2){if(_0x256395[_0x7413('0x20')][_0x7413('0x2a')]===!![])_0xa58bd2[_0x7413('0x2b')](_0x7413('0x2c'),_0xa58bd2[_0x7413('0x2d')]());logger[_0x7413('0x14')](_0x7413('0x28'),_0x256395);logger[_0x7413('0x16')](_0x7413('0x28'),_0x256395,JSON[_0x7413('0x17')](_0xa58bd2));_0x5b4426(_0xa58bd2);})[_0x7413('0x1c')](function(_0x5a9791){logger[_0x7413('0x18')]('ShowMailAccount',_0x5a9791['message'],_0x256395);_0xd763f9(_0x185cfe['error'](0x1f4,_0x5a9791['message']));});});};exports['NotifyMailAccount']=function(_0x44af7d){var _0x4c1770=this;return new Promise(function(_0x535e49,_0x5dc077){var _0x4d0008={'body':_0x44af7d['body'],'channel':_0x7413('0x2e')};var _0x32f1e8=_[_0x7413('0x2f')](_[_0x7413('0x30')](db[_0x7413('0x31')]['rawAttributes']),[_0x7413('0x32'),'updatedAt',_0x7413('0x33'),_0x7413('0x34')]);var _0xa063d1=![];if(_0x44af7d[_0x7413('0x35')]['id']){delete _0x44af7d[_0x7413('0x35')]['id'];}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x37')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x38')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x35')])||_0x44af7d['body'][_0x7413('0x35')]===''){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x39')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x3b')+_0x32f1e8));}if(!_[_0x7413('0x3c')](_0x32f1e8,_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770['error'](0x1f4,_0x7413('0x3d')+_0x32f1e8));}var _0x52a088={};_0x52a088[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d[_0x7413('0x35')][_0x7413('0x37')];return db[_0x7413('0x1e')][_0x7413('0x29')]({'where':{'id':_0x44af7d[_0x7413('0x3e')]['id']},'include':[{'model':db[_0x7413('0x3f')],'as':_0x7413('0x40'),'include':[{'model':db[_0x7413('0x31')],'as':'Contacts','where':_0x52a088,'limit':0x1,'order':[['updatedAt',_0x7413('0x41')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7413('0x42')],'as':_0x7413('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7413('0x44')}]}]})['then'](function(_0x562bae){if(_0x562bae&&_0x562bae[_0x7413('0x40')]){var _0x5f263e=_0x562bae[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x3e')]=_[_0x7413('0x46')](_0x5f263e,[_0x7413('0x47'),_0x7413('0x40')]);_0x4d0008[_0x7413('0x3e')][_0x7413('0x2c')]=_0x562bae[_0x7413('0x2d')]();_0x4d0008[_0x7413('0x48')]=_0x5f263e[_0x7413('0x47')];_0x4d0008['list']=_0x5f263e[_0x7413('0x40')];_0x4d0008['applications']=_['orderBy'](_0x4d0008['applications'],[_0x7413('0x49')],[_0x7413('0x4a')]);if(_0x4d0008[_0x7413('0x3e')]&&_0x4d0008[_0x7413('0x3e')]['autoclose']){_0x4d0008['applications'][_0x7413('0x4b')]({'id':0x0,'priority':_0x4d0008['applications'][_0x7413('0x4c')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4d0008['account']['Applications']){delete _0x4d0008[_0x7413('0x3e')][_0x7413('0x47')];}if(_0x4d0008[_0x7413('0x3e')][_0x7413('0x40')]){delete _0x4d0008[_0x7413('0x3e')]['List'];}if(_0x5f263e[_0x7413('0x40')][_0x7413('0x4d')][_0x7413('0x4c')]){return _0x5f263e['List'][_0x7413('0x4d')][0x0];}var _0x5c3324=_['defaults'](_0x44af7d[_0x7413('0x35')],{'firstName':_0x44af7d[_0x7413('0x35')][_0x7413('0x37')],'ListId':_0x5f263e[_0x7413('0x34')]});_0x5c3324[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d['body'][_0x7413('0x37')];return db['CmContact'][_0x7413('0x4e')](_0x5c3324);}else{throw new Error('List\x20not\x20found');}})[_0x7413('0x13')](function(_0x4d4faa){_0x4d0008[_0x7413('0x4f')]=_0x4d4faa;if(_0x4d4faa){if(!_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x50')]){_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')]=rs['generate']()+'\x20'+_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'];}var _0x3ce34c={'ContactId':_0x4d4faa['id'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'inReplyTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x52')],'lastMsgAt':moment()[_0x7413('0x53')](_0x7413('0x54')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x44af7d['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x7413('0x50')],'where':{'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['inReplyTo']}}]})[_0x7413('0x13')](function(_0xb7dd83){if(_0xb7dd83){return[_0xb7dd83,![]];}return db[_0x7413('0x55')][_0x7413('0x4e')](_0x3ce34c)[_0x7413('0x13')](function(_0x3db284){return[_0x3db284,!![]];});});}else{throw new Error(_0x7413('0x56'));}})[_0x7413('0x57')](function(_0x1ec131,_0x47512d){if(_0x1ec131){_0xa063d1=_0x47512d;if(!_0x47512d){return _0x1ec131[_0x7413('0x58')]({'inReplyTo':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['messageId'],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x1ec131[_0x7413('0x52')]?_0x1ec131['attach']:_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x7413('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7413('0x54')),'lastMsgDirection':'in'});}else{return _0x1ec131;}}})[_0x7413('0x13')](function(_0x167c6b){_0x4d0008[_0x7413('0x59')]=_0x167c6b[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x59')][_0x7413('0x5a')]=_0xa063d1;return db[_0x7413('0x5b')]['create']({'body':_0x44af7d[_0x7413('0x35')]['body'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'MailInteractionId':_0x167c6b['id'],'direction':'in','ContactId':_0x4d0008[_0x7413('0x4f')]['id'],'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x50')],'from':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'to':_0x44af7d[_0x7413('0x35')]['message']['to'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')]['attach'],'Attachments':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attachments'],'originTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x5c')],'originCc':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x5d')],'bcc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5e')],'ChatWebsiteId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5f')]||'Email','ChatOfflineMessageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x60')]||null},{'include':[{'model':db[_0x7413('0x61')],'as':_0x7413('0x62')}]});})[_0x7413('0x13')](function(_0x46e9f8){_0x4d0008[_0x7413('0x1a')]=_0x46e9f8;if(_0x4d0008[_0x7413('0x59')]['UserId']){return db[_0x7413('0x63')][_0x7413('0x29')]({'attributes':['id',_0x7413('0x64')],'where':{'id':_0x4d0008[_0x7413('0x59')][_0x7413('0x65')]}})[_0x7413('0x13')](function(_0x4c9d1b){if(_0x4c9d1b){_0x4d0008[_0x7413('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c9d1b[_0x7413('0x64')]+','+(_0x4d0008[_0x7413('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0x66')});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);})[_0x7413('0x13')](function(_0x2d361c){_0x535e49(_0x2d361c);})[_0x7413('0x1c')](function(_0x5f4765){_0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x5f4765['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 52116a2..dcf8d5d 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 _0x3495=['remove','update','emit','removeListener','register','length','./mailAccount.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3495,0x1de));var _0x5349=function(_0x1b7927,_0xf1e599){_0x1b7927=_0x1b7927-0x0;var _0x4229e5=_0x3495[_0x1b7927];return _0x4229e5;};'use strict';var MailAccountEvents=require(_0x5349('0x0'));var events=[_0x5349('0x1'),_0x5349('0x2'),_0x5349('0x3')];function createListener(_0x281a6d,_0x242a43){return function(_0x2e91c4){_0x242a43[_0x5349('0x4')](_0x281a6d,_0x2e91c4);};}function removeListener(_0xedbd32,_0x5912ac){return function(){MailAccountEvents[_0x5349('0x5')](_0xedbd32,_0x5912ac);};}exports[_0x5349('0x6')]=function(_0x5ce2cd){for(var _0xcb5a1=0x0,_0x538385=events[_0x5349('0x7')];_0xcb5a1<_0x538385;_0xcb5a1++){var _0x529323=events[_0xcb5a1];var _0x393873=createListener('mailAccount:'+_0x529323,_0x5ce2cd);MailAccountEvents['on'](_0x529323,_0x393873);}}; \ No newline at end of file +var _0x793b=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x46d326,_0x358e38){var _0x5d50fa=function(_0x2c22e1){while(--_0x2c22e1){_0x46d326['push'](_0x46d326['shift']());}};_0x5d50fa(++_0x358e38);}(_0x793b,0x189));var _0xb793=function(_0x40f8b7,_0x4275d4){_0x40f8b7=_0x40f8b7-0x0;var _0x48db54=_0x793b[_0x40f8b7];return _0x48db54;};'use strict';var MailAccountEvents=require(_0xb793('0x0'));var events=[_0xb793('0x1'),_0xb793('0x2'),_0xb793('0x3')];function createListener(_0x3cc05b,_0x59f46e){return function(_0x9a7c87){_0x59f46e[_0xb793('0x4')](_0x3cc05b,_0x9a7c87);};}function removeListener(_0x577e1c,_0x56ca69){return function(){MailAccountEvents[_0xb793('0x5')](_0x577e1c,_0x56ca69);};}exports[_0xb793('0x6')]=function(_0x322b07){for(var _0x2b1f19=0x0,_0x39f110=events[_0xb793('0x7')];_0x2b1f19<_0x39f110;_0x2b1f19++){var _0x134ac4=events[_0x2b1f19];var _0x23a718=createListener(_0xb793('0x8')+_0x134ac4,_0x322b07);MailAccountEvents['on'](_0x134ac4,_0x23a718);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8f85c10..38effc9 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 _0x8b57=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','put','delete','destroy','exports'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x8b57,0xf0));var _0x78b5=function(_0x2f2b79,_0x458032){_0x2f2b79=_0x2f2b79-0x0;var _0x5363c7=_0x8b57[_0x2f2b79];return _0x5363c7;};'use strict';var multer=require(_0x78b5('0x0'));var util=require(_0x78b5('0x1'));var path=require(_0x78b5('0x2'));var timeout=require(_0x78b5('0x3'));var express=require(_0x78b5('0x4'));var router=express[_0x78b5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x78b5('0x6'));var interaction=require(_0x78b5('0x7'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x78b5('0x8')](_0x78b5('0x9'),auth[_0x78b5('0xa')](),controller[_0x78b5('0xb')]);router[_0x78b5('0xc')](_0x78b5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x78b5('0xd')](_0x78b5('0x9'),auth[_0x78b5('0xa')](),controller[_0x78b5('0xe')]);module[_0x78b5('0xf')]=router; \ No newline at end of file +var _0x744f=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x57350c,_0x5b8cff){var _0x3eab6e=function(_0x3e4265){while(--_0x3e4265){_0x57350c['push'](_0x57350c['shift']());}};_0x3eab6e(++_0x5b8cff);}(_0x744f,0x1e6));var _0xf744=function(_0xdee463,_0x4941a6){_0xdee463=_0xdee463-0x0;var _0x4541c0=_0x744f[_0xdee463];return _0x4541c0;};'use strict';var multer=require('multer');var util=require(_0xf744('0x0'));var path=require(_0xf744('0x1'));var timeout=require(_0xf744('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf744('0x3'));var auth=require(_0xf744('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf744('0x5'));var controller=require('./mailApplication.controller');router[_0xf744('0x6')](_0xf744('0x7'),auth[_0xf744('0x8')](),controller['show']);router[_0xf744('0x9')](_0xf744('0x7'),auth['isAuthenticated'](),controller[_0xf744('0xa')]);router[_0xf744('0xb')]('/:id',auth[_0xf744('0x8')](),controller[_0xf744('0xc')]);module[_0xf744('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 29db062..6329ae5 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 _0xe321=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x27378b,_0x1a7162){var _0x4b637b=function(_0x719b6a){while(--_0x719b6a){_0x27378b['push'](_0x27378b['shift']());}};_0x4b637b(++_0x1a7162);}(_0xe321,0x109));var _0x1e32=function(_0x455679,_0x4fb020){_0x455679=_0x455679-0x0;var _0x3d0be2=_0xe321[_0x455679];return _0x3d0be2;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'priority':{'type':Sequelize[_0x1e32('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1e32('0x3')],'allowNull':![],'defaultValue':_0x1e32('0x4')},'appdata':{'type':Sequelize[_0x1e32('0x5')]()},'description':{'type':Sequelize[_0x1e32('0x3')]},'interval':{'type':Sequelize[_0x1e32('0x3')],'defaultValue':_0x1e32('0x6')}}; \ No newline at end of file +var _0x4a7f=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x23c82f,_0x165dd8){var _0x15ab73=function(_0x23271b){while(--_0x23271b){_0x23c82f['push'](_0x23c82f['shift']());}};_0x15ab73(++_0x165dd8);}(_0x4a7f,0x1f3));var _0xf4a7=function(_0xe660c6,_0x26595a){_0xe660c6=_0xe660c6-0x0;var _0x28d939=_0x4a7f[_0xe660c6];return _0x28d939;};'use strict';var Sequelize=require('sequelize');module[_0xf4a7('0x0')]={'priority':{'type':Sequelize[_0xf4a7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf4a7('0x2')],'allowNull':![],'defaultValue':_0xf4a7('0x3')},'appdata':{'type':Sequelize[_0xf4a7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf4a7('0x2')],'defaultValue':_0xf4a7('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6b04370..cfe5790 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x38e867,_0x391f20){var _0x37172a=function(_0x3e1e4f){while(--_0x3e1e4f){_0x38e867['push'](_0x38e867['shift']());}};_0x37172a(++_0x391f20);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _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(_0x210b46,_0x52a05f){var _0x203df2=function(_0x3421ea){while(--_0x3421ea){_0x210b46['push'](_0x210b46['shift']());}};_0x203df2(++_0x52a05f);}(_0x70e0,0x17b));var _0x070e=function(_0x5c4942,_0x147273){_0x5c4942=_0x5c4942-0x0;var _0x507a30=_0x70e0[_0x5c4942];return _0x507a30;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 463692e..cc486f6 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 _0xda08=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','../../config/environment','exports'];(function(_0x4acccd,_0x3b22d9){var _0x2b1b70=function(_0xb79605){while(--_0xb79605){_0x4acccd['push'](_0x4acccd['shift']());}};_0x2b1b70(++_0x3b22d9);}(_0xda08,0x122));var _0x8da0=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xda08[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x8da0('0x0'));var util=require('util');var logger=require(_0x8da0('0x1'))('api');var moment=require(_0x8da0('0x2'));var BPromise=require('bluebird');var rp=require(_0x8da0('0x3'));var fs=require('fs');var path=require(_0x8da0('0x4'));var rimraf=require('rimraf');var config=require(_0x8da0('0x5'));var attributes=require('./mailApplication.attributes');module[_0x8da0('0x6')]=function(_0xdc4c19,_0x360cb4){return _0xdc4c19['define'](_0x8da0('0x7'),attributes,{'tableName':_0x8da0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8da0('0x9'),'collate':_0x8da0('0xa')});}; \ No newline at end of file +var _0x3243=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications','utf8mb4','util','../../config/logger'];(function(_0x89cb3a,_0x385fd1){var _0x407cf1=function(_0x61fa77){while(--_0x61fa77){_0x89cb3a['push'](_0x89cb3a['shift']());}};_0x407cf1(++_0x385fd1);}(_0x3243,0x150));var _0x3324=function(_0x398c9c,_0x1a8dd2){_0x398c9c=_0x398c9c-0x0;var _0x29b5aa=_0x3243[_0x398c9c];return _0x29b5aa;};'use strict';var _=require('lodash');var util=require(_0x3324('0x0'));var logger=require(_0x3324('0x1'))(_0x3324('0x2'));var moment=require(_0x3324('0x3'));var BPromise=require(_0x3324('0x4'));var rp=require(_0x3324('0x5'));var fs=require('fs');var path=require(_0x3324('0x6'));var rimraf=require(_0x3324('0x7'));var config=require(_0x3324('0x8'));var attributes=require(_0x3324('0x9'));module['exports']=function(_0x11f4b4,_0xc48e15){return _0x11f4b4[_0x3324('0xa')]('MailApplication',attributes,{'tableName':_0x3324('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3324('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c024213..193ec53 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 _0xb2fa=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body','options','attributes','limit','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2fa,0x13c));var _0xab2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb2fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xab2f('0x0'));var util=require(_0xab2f('0x1'));var moment=require(_0xab2f('0x2'));var BPromise=require(_0xab2f('0x3'));var rs=require(_0xab2f('0x4'));var fs=require('fs');var Redis=require(_0xab2f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab2f('0x6'));var logger=require(_0xab2f('0x7'))(_0xab2f('0x8'));var config=require(_0xab2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab2f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17c57b,_0x1b5cfd,_0x4172f1){return new BPromise(function(_0x5184d2,_0x4ce943){return client[_0xab2f('0xb')](_0x17c57b,_0x4172f1)[_0xab2f('0xc')](function(_0x33ae1a){logger[_0xab2f('0xd')]('MailApplication,\x20%s,\x20%s',_0x1b5cfd,_0xab2f('0xe'));logger[_0xab2f('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1b5cfd,_0xab2f('0xe'),JSON[_0xab2f('0x10')](_0x33ae1a));if(_0x33ae1a[_0xab2f('0x11')]){if(_0x33ae1a[_0xab2f('0x11')][_0xab2f('0x12')]===0x1f4){logger[_0xab2f('0x11')](_0xab2f('0x13'),_0x1b5cfd,_0x33ae1a[_0xab2f('0x11')][_0xab2f('0x14')]);return _0x4ce943(_0x33ae1a[_0xab2f('0x11')]['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x1b5cfd,_0x33ae1a['error'][_0xab2f('0x14')]);return _0x5184d2(_0x33ae1a[_0xab2f('0x11')][_0xab2f('0x14')]);}else{logger[_0xab2f('0xd')](_0xab2f('0x13'),_0x1b5cfd,'request\x20sent');_0x5184d2(_0x33ae1a[_0xab2f('0x15')][_0xab2f('0x14')]);}})[_0xab2f('0x16')](function(_0x43072a){logger[_0xab2f('0x11')](_0xab2f('0x13'),_0x1b5cfd,_0x43072a);_0x4ce943(_0x43072a);});});}exports[_0xab2f('0x17')]=function(_0x5160ba){var _0x217c54=this;return new Promise(function(_0x1c39c0,_0x309dc4){return db['MailApplication'][_0xab2f('0x18')](_0x5160ba[_0xab2f('0x19')],{'raw':_0x5160ba[_0xab2f('0x1a')]?_0x5160ba['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5160ba[_0xab2f('0x1a')]?_0x5160ba[_0xab2f('0x1a')]['where']||null:null,'attributes':_0x5160ba[_0xab2f('0x1a')]?_0x5160ba['options'][_0xab2f('0x1b')]||null:null,'limit':_0x5160ba[_0xab2f('0x1a')]?_0x5160ba[_0xab2f('0x1a')][_0xab2f('0x1c')]||null:null})[_0xab2f('0xc')](function(_0x21c300){logger['info'](_0xab2f('0x17'),_0x5160ba);logger['debug'](_0xab2f('0x17'),_0x5160ba,JSON['stringify'](_0x21c300));_0x1c39c0(_0x21c300);})[_0xab2f('0x16')](function(_0x2d58b8){logger[_0xab2f('0x11')](_0xab2f('0x17'),_0x2d58b8[_0xab2f('0x14')],_0x5160ba);_0x309dc4(_0x217c54[_0xab2f('0x11')](0x1f4,_0x2d58b8[_0xab2f('0x14')]));});});}; \ No newline at end of file +var _0x9b10=['update','body','options','raw','where','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateMailApplication'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x9b10,0x18e));var _0x09b1=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x9b10[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x09b1('0x0'));var util=require('util');var moment=require(_0x09b1('0x1'));var BPromise=require(_0x09b1('0x2'));var rs=require(_0x09b1('0x3'));var fs=require('fs');var Redis=require(_0x09b1('0x4'));var db=require(_0x09b1('0x5'))['db'];var utils=require(_0x09b1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x09b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x09b1('0x8')][_0x09b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd5f5,_0x42d397,_0x5472d3){return new BPromise(function(_0x5e7c8a,_0x4ae917){return client['request'](_0x2fd5f5,_0x5472d3)[_0x09b1('0xa')](function(_0x56e868){logger[_0x09b1('0xb')](_0x09b1('0xc'),_0x42d397,'request\x20sent');logger[_0x09b1('0xd')](_0x09b1('0xe'),_0x42d397,_0x09b1('0xf'),JSON[_0x09b1('0x10')](_0x56e868));if(_0x56e868[_0x09b1('0x11')]){if(_0x56e868['error'][_0x09b1('0x12')]===0x1f4){logger[_0x09b1('0x11')]('MailApplication,\x20%s,\x20%s',_0x42d397,_0x56e868[_0x09b1('0x11')][_0x09b1('0x13')]);return _0x4ae917(_0x56e868[_0x09b1('0x11')][_0x09b1('0x13')]);}logger[_0x09b1('0x11')](_0x09b1('0xc'),_0x42d397,_0x56e868[_0x09b1('0x11')][_0x09b1('0x13')]);return _0x5e7c8a(_0x56e868[_0x09b1('0x11')]['message']);}else{logger[_0x09b1('0xb')](_0x09b1('0xc'),_0x42d397,'request\x20sent');_0x5e7c8a(_0x56e868[_0x09b1('0x14')][_0x09b1('0x13')]);}})['catch'](function(_0x50d330){logger[_0x09b1('0x11')](_0x09b1('0xc'),_0x42d397,_0x50d330);_0x4ae917(_0x50d330);});});}exports[_0x09b1('0x15')]=function(_0x82b070){var _0x3bf338=this;return new Promise(function(_0x52ea75,_0x10184d){return db['MailApplication'][_0x09b1('0x16')](_0x82b070[_0x09b1('0x17')],{'raw':_0x82b070['options']?_0x82b070[_0x09b1('0x18')][_0x09b1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x82b070[_0x09b1('0x18')]?_0x82b070[_0x09b1('0x18')][_0x09b1('0x1a')]||null:null,'attributes':_0x82b070[_0x09b1('0x18')]?_0x82b070['options'][_0x09b1('0x1b')]||null:null,'limit':_0x82b070[_0x09b1('0x18')]?_0x82b070[_0x09b1('0x18')][_0x09b1('0x1c')]||null:null})[_0x09b1('0xa')](function(_0x50ae69){logger[_0x09b1('0xb')]('UpdateMailApplication',_0x82b070);logger[_0x09b1('0xd')](_0x09b1('0x15'),_0x82b070,JSON[_0x09b1('0x10')](_0x50ae69));_0x52ea75(_0x50ae69);})[_0x09b1('0x1d')](function(_0xe5dc78){logger[_0x09b1('0x11')](_0x09b1('0x15'),_0xe5dc78[_0x09b1('0x13')],_0x82b070);_0x10184d(_0x3bf338[_0x09b1('0x11')](0x1f4,_0xe5dc78[_0x09b1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 72b5d89..f65a068 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 _0xd91d=['/:id/tags','tracked','mailinteraction:addtags','addTags','mail','mailinteraction:update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0xf4dd00,_0x24a99e){var _0x4a7cf4=function(_0x995364){while(--_0x995364){_0xf4dd00['push'](_0xf4dd00['shift']());}};_0x4a7cf4(++_0x24a99e);}(_0xd91d,0x169));var _0xdd91=function(_0x47373a,_0x201f23){_0x47373a=_0x47373a-0x0;var _0x13c3f3=_0xd91d[_0x47373a];return _0x13c3f3;};'use strict';var express=require(_0xdd91('0x0'));var router=express[_0xdd91('0x1')]();var auth=require(_0xdd91('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xdd91('0x3'));router[_0xdd91('0x4')]('/',auth[_0xdd91('0x5')](),controller[_0xdd91('0x6')]);router[_0xdd91('0x4')](_0xdd91('0x7'),auth[_0xdd91('0x5')](),controller['describe']);router[_0xdd91('0x4')](_0xdd91('0x8'),auth['isAuthenticated'](),controller[_0xdd91('0x9')]);router[_0xdd91('0x4')](_0xdd91('0xa'),auth[_0xdd91('0x5')](),controller[_0xdd91('0xb')]);router[_0xdd91('0x4')](_0xdd91('0xc'),auth[_0xdd91('0x5')](),controller[_0xdd91('0xd')]);router[_0xdd91('0xe')]('/',auth['isAuthenticated'](),controller[_0xdd91('0xf')]);router[_0xdd91('0xe')]('/:id/messages',auth['isAuthenticated'](),controller[_0xdd91('0x10')]);router[_0xdd91('0xe')](_0xdd91('0x11'),auth[_0xdd91('0x5')](),interaction[_0xdd91('0x12')]('mail',_0xdd91('0x13')),controller[_0xdd91('0x14')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xdd91('0x15'),_0xdd91('0x16')),controller['update']);router[_0xdd91('0x17')](_0xdd91('0x8'),auth[_0xdd91('0x5')](),interaction[_0xdd91('0x12')](_0xdd91('0x15'),'mailinteraction:destroy'),controller[_0xdd91('0x18')]);router[_0xdd91('0x17')](_0xdd91('0x11'),auth[_0xdd91('0x5')](),controller[_0xdd91('0x19')]);module[_0xdd91('0x1a')]=router; \ No newline at end of file +var _0x7ea6=['../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','mailinteraction:destroy','delete','removeTags','exports','express','Router','../../components/auth/service'];(function(_0x2c9d23,_0x38c204){var _0x5244c8=function(_0x32ae47){while(--_0x32ae47){_0x2c9d23['push'](_0x2c9d23['shift']());}};_0x5244c8(++_0x38c204);}(_0x7ea6,0x159));var _0x67ea=function(_0x5f0b1c,_0x37614a){_0x5f0b1c=_0x5f0b1c-0x0;var _0x46c649=_0x7ea6[_0x5f0b1c];return _0x46c649;};'use strict';var express=require(_0x67ea('0x0'));var router=express[_0x67ea('0x1')]();var auth=require(_0x67ea('0x2'));var interaction=require(_0x67ea('0x3'));var controller=require(_0x67ea('0x4'));router[_0x67ea('0x5')]('/',auth[_0x67ea('0x6')](),controller[_0x67ea('0x7')]);router[_0x67ea('0x5')](_0x67ea('0x8'),auth[_0x67ea('0x6')](),controller[_0x67ea('0x9')]);router[_0x67ea('0x5')](_0x67ea('0xa'),auth[_0x67ea('0x6')](),controller[_0x67ea('0xb')]);router[_0x67ea('0x5')]('/:id/messages',auth[_0x67ea('0x6')](),controller[_0x67ea('0xc')]);router[_0x67ea('0x5')](_0x67ea('0xd'),auth['isAuthenticated'](),controller[_0x67ea('0xe')]);router['post']('/',auth[_0x67ea('0x6')](),controller[_0x67ea('0xf')]);router[_0x67ea('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0x67ea('0x11')]);router[_0x67ea('0x10')](_0x67ea('0x12'),auth[_0x67ea('0x6')](),interaction[_0x67ea('0x13')](_0x67ea('0x14'),_0x67ea('0x15')),controller[_0x67ea('0x16')]);router[_0x67ea('0x17')](_0x67ea('0xa'),auth['isAuthenticated'](),interaction[_0x67ea('0x13')](_0x67ea('0x14'),_0x67ea('0x18')),controller['update']);router['delete'](_0x67ea('0xa'),auth[_0x67ea('0x6')](),interaction[_0x67ea('0x13')](_0x67ea('0x14'),_0x67ea('0x19')),controller['destroy']);router[_0x67ea('0x1a')](_0x67ea('0x12'),auth[_0x67ea('0x6')](),controller[_0x67ea('0x1b')]);module[_0x67ea('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index c015309..fae5b12 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 _0x7e9f=['BOOLEAN','out','ENUM','sequelize','exports','DATE','STRING','long','TEXT'];(function(_0x21d38f,_0x3edb2d){var _0x550bd7=function(_0xf21dc2){while(--_0xf21dc2){_0x21d38f['push'](_0x21d38f['shift']());}};_0x550bd7(++_0x3edb2d);}(_0x7e9f,0x108));var _0xf7e9=function(_0x18d8ed,_0x152558){_0x18d8ed=_0x18d8ed-0x0;var _0x2b0076=_0x7e9f[_0x18d8ed];return _0x2b0076;};'use strict';var Sequelize=require(_0xf7e9('0x0'));var iconv=require('iconv');module[_0xf7e9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf7e9('0x2')]},'disposition':{'type':Sequelize[_0xf7e9('0x3')]},'secondDisposition':{'type':Sequelize[_0xf7e9('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf7e9('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf7e9('0x3')]},'cc':{'type':Sequelize['TEXT'](_0xf7e9('0x4'))},'subject':{'type':Sequelize[_0xf7e9('0x5')]()},'attach':{'type':Sequelize[_0xf7e9('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf7e9('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf7e9('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf7e9('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf7e9('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf7e9('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf7e9('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xb708=['exports','DATE','STRING','long','TEXT','ENUM','BOOLEAN','sequelize'];(function(_0xc144be,_0x385142){var _0x4ffd89=function(_0x4d5ca1){while(--_0x4d5ca1){_0xc144be['push'](_0xc144be['shift']());}};_0x4ffd89(++_0x385142);}(_0xb708,0xe7));var _0x8b70=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0xb708[_0x3816c2];return _0x144669;};'use strict';var Sequelize=require(_0x8b70('0x0'));var iconv=require('iconv');module[_0x8b70('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8b70('0x2')]},'disposition':{'type':Sequelize[_0x8b70('0x3')]},'secondDisposition':{'type':Sequelize[_0x8b70('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8b70('0x3')]},'inReplyTo':{'type':Sequelize[_0x8b70('0x3')](0x1fe)},'to':{'type':Sequelize[_0x8b70('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x8b70('0x4'))},'subject':{'type':Sequelize[_0x8b70('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8b70('0x2')]},'substatus':{'type':Sequelize[_0x8b70('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x8b70('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8b70('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8b70('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8b70('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8b70('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index c6cabee..06ecf73 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 _0x8302=['status','json','offset','undefined','count','limit','set','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.fullname','ui.MailInteractionId','left_join','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','conditions','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','start','buildExpression','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getMailAccounts','isEmpty','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','rows','show','params','includeAll','include','create','body','destroy','describe','ids','omit','format','inlineCss','true','addTags','setTags','spread','findAll','emit','mailInteractionTags:save','removeTags','download','root','files','tmp','server','join','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','bcc','subject','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','unlinkSync','rimraf','moment','bluebird','util','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8302,0x1bf));var _0x2830=function(_0x323fca,_0x369c53){_0x323fca=_0x323fca-0x0;var _0x2f4122=_0x8302[_0x323fca];return _0x2f4122;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2830('0x0'));var zipdir=require('zip-dir');var moment=require(_0x2830('0x1'));var BPromise=require(_0x2830('0x2'));var util=require(_0x2830('0x3'));var path=require(_0x2830('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2830('0x5'));var juice=require(_0x2830('0x6'));var Redis=require(_0x2830('0x7'));var qs=require(_0x2830('0x8'));var as=require(_0x2830('0x9'));var logger=require(_0x2830('0xa'))(_0x2830('0xb'));var config=require(_0x2830('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x2830('0xd'));config[_0x2830('0xe')]=_[_0x2830('0xf')](config[_0x2830('0xe')],{'host':_0x2830('0x10'),'port':0x18eb});var socket=require(_0x2830('0x11'))(new Redis(config['redis']));require(_0x2830('0x12'))[_0x2830('0x13')](socket);function respondWithStatusCode(_0x30b65c,_0x580fac){_0x580fac=_0x580fac||0xcc;return function(_0x36e088){if(_0x36e088){return _0x30b65c[_0x2830('0x14')](_0x580fac);}return _0x30b65c['status'](_0x580fac)['end']();};}function respondWithResult(_0xdcca66,_0x4ae94b){_0x4ae94b=_0x4ae94b||0xc8;return function(_0x4a4006){if(_0x4a4006){return _0xdcca66[_0x2830('0x15')](_0x4ae94b)[_0x2830('0x16')](_0x4a4006);}};}function respondWithFilteredResult(_0x4f5368,_0x2a856e){return function(_0x3d2fca){if(_0x3d2fca){var _0x243a9d=typeof _0x2a856e[_0x2830('0x17')]===_0x2830('0x18')&&typeof _0x2a856e['limit']===_0x2830('0x18');var _0x2035d7=_0x3d2fca[_0x2830('0x19')];var _0x31958e=_0x243a9d?0x0:_0x2a856e['offset'];var _0x161d54=_0x243a9d?_0x3d2fca[_0x2830('0x19')]:_0x2a856e[_0x2830('0x17')]+_0x2a856e[_0x2830('0x1a')];var _0x3cdf0a;if(_0x161d54>=_0x2035d7){_0x161d54=_0x2035d7;_0x3cdf0a=0xc8;}else{_0x3cdf0a=0xce;}_0x4f5368[_0x2830('0x15')](_0x3cdf0a);return _0x4f5368[_0x2830('0x1b')]('Content-Range',_0x31958e+'-'+_0x161d54+'/'+_0x2035d7)[_0x2830('0x16')](_0x3d2fca);}return null;};}function saveUpdates(_0x27ab7b){return function(_0x5ca6d7){if(_0x5ca6d7){return _0x5ca6d7['update'](_0x27ab7b)[_0x2830('0x1c')](function(_0x419def){return _0x419def;});}return null;};}function removeEntity(_0x111359){return function(_0x214b09){if(_0x214b09){return _0x214b09['destroy']()[_0x2830('0x1c')](function(){_0x111359[_0x2830('0x15')](0xcc)[_0x2830('0x1d')]();});}};}function handleEntityNotFound(_0xffe7b7){return function(_0x2dd429){if(!_0x2dd429){_0xffe7b7[_0x2830('0x14')](0x194);}return _0x2dd429;};}function handleError(_0x2dada2,_0xdedd0e){_0xdedd0e=_0xdedd0e||0x1f4;return function(_0x54f003){logger[_0x2830('0x1e')](_0x54f003[_0x2830('0x1f')]);if(_0x54f003['name']){delete _0x54f003[_0x2830('0x20')];}_0x2dada2[_0x2830('0x15')](_0xdedd0e)[_0x2830('0x21')](_0x54f003);};}function getInteractionUsers(_0x594546,_0x58e64d){return new BPromise(function(_0x272a8f,_0x45e213){try{if(_0x58e64d[_0x594546['id']]){_0x594546[_0x2830('0x22')]=_[_0x2830('0x23')](_0x58e64d[_0x594546['id']],function(_0x33ad09){return{'id':_0x33ad09['id'],'fullname':_0x33ad09[_0x2830('0x24')]};});}}catch(_0x15ea87){_0x45e213(_0x15ea87);}_0x272a8f(_0x594546);});}function getInteractionTags(_0x593202,_0x2e66b1){return new BPromise(function(_0x2b9dfb,_0x3a13bf){try{if(_0x593202[_0x2830('0x25')]){_0x593202[_0x2830('0x26')]=[];_0x593202['TagIds'][_0x2830('0x27')](',')[_0x2830('0x28')](function(_0x5a5050){_0x593202['Tags'][_0x2830('0x29')](_0x2e66b1[_0x5a5050]);});}delete _0x593202[_0x2830('0x25')];}catch(_0x30e9dd){_0x3a13bf(_0x30e9dd);}_0x2b9dfb(_0x593202);});}function getLastMessageText(_0xf8dad6){return new BPromise(function(_0x1e389a,_0x40e18d){return db[_0x2830('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0xf8dad6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2830('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x2830('0x2c'),'raw':!![]})[_0x2830('0x1c')](function(_0x467e40){if(_0x467e40&&_0x467e40[_0x2830('0x2d')]){_0xf8dad6[_0x2830('0x2e')]=_[_0x2830('0x2f')](_0x467e40[_0x2830('0x2d')]);}_0x1e389a(_0xf8dad6);})[_0x2830('0x30')](function(_0x1e1de2){_0x40e18d(_0x1e1de2);});});}function updateMailInteraction(_0x19df69,_0x3ac026,_0x2d70d7,_0x5c4295){return new BPromise(function(_0x45a038,_0x37b997){return getInteractionUsers(_0x19df69,_0x2d70d7)[_0x2830('0x1c')](function(_0x2ff183){return getInteractionTags(_0x2ff183,_0x3ac026);})['then'](function(_0x212f73){return getStateInteraction(_0x212f73);})['then'](function(_0x5535fd){if(_0x5c4295){_0x45a038(getLastMessageText(_0x5535fd));}else{_0x45a038(_0x5535fd);}})[_0x2830('0x30')](function(_0x4e6c10){_0x37b997(_0x4e6c10);});});}function getStateInteraction(_0x152365){return new BPromise(function(_0x8a75ca){_0x152365[_0x2830('0x31')]=0x0;_0x152365[_0x2830('0x32')]=0x0;_0x152365[_0x2830('0x33')]=0x0;_0x152365[_0x2830('0x34')]=0x0;_0x152365[_0x2830('0x35')]=0x0;if(!_0x152365[_0x2830('0x36')]&&!_0x152365['UserId']){_0x152365[_0x2830('0x31')]+=0x1;}if(!_0x152365['closed']&&_0x152365[_0x2830('0x37')]){_0x152365[_0x2830('0x32')]+=0x1;if(_0x152365['waiting']){_0x152365[_0x2830('0x31')]-=0x1;}}if(_0x152365['closed']&&_0x152365[_0x2830('0x37')]){_0x152365[_0x2830('0x33')]+=0x1;if(_0x152365[_0x2830('0x32')]){_0x152365[_0x2830('0x32')]-=0x1;}}if(_0x152365[_0x2830('0x36')]&&!_0x152365[_0x2830('0x37')]){_0x152365[_0x2830('0x34')]+=0x1;if(_0x152365[_0x2830('0x31')]){_0x152365['waiting']-=0x1;}}_0x152365[_0x2830('0x35')]+=0x1;_0x8a75ca(_0x152365);});}exports[_0x2830('0x38')]=function(_0x1ec2d5,_0x1664c9){var _0xbc23c2={},_0x5d7177={},_0x492344={'count':0x0,'rows':[]};var _0x1a0ff3=_[_0x2830('0x23')](db[_0x2830('0x39')][_0x2830('0x3a')],function(_0x2b5b3f){return{'name':_0x2b5b3f[_0x2830('0x3b')],'type':_0x2b5b3f[_0x2830('0x3c')][_0x2830('0x3d')]};});_0x5d7177['model']=_[_0x2830('0x23')](_0x1a0ff3,_0x2830('0x20'));_0x5d7177[_0x2830('0x3e')]=_[_0x2830('0x3f')](_0x1ec2d5[_0x2830('0x3e')]);_0x5d7177[_0x2830('0x40')]=_[_0x2830('0x41')](_0x5d7177[_0x2830('0x42')],_0x5d7177['query']);_0xbc23c2['attributes']=_['intersection'](_0x5d7177[_0x2830('0x42')],qs[_0x2830('0x43')](_0x1ec2d5[_0x2830('0x3e')]['fields']));_0xbc23c2[_0x2830('0x44')]=_0xbc23c2[_0x2830('0x44')][_0x2830('0x45')]?_0xbc23c2[_0x2830('0x44')]:_0x5d7177[_0x2830('0x42')];if(!_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x46')](_0x2830('0x47'))){_0xbc23c2[_0x2830('0x1a')]=qs[_0x2830('0x1a')](_0x1ec2d5[_0x2830('0x3e')]['limit']);_0xbc23c2[_0x2830('0x17')]=qs[_0x2830('0x17')](_0x1ec2d5['query']['offset']);}_0xbc23c2[_0x2830('0x48')]=qs[_0x2830('0x49')](_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x49')]);_0xbc23c2[_0x2830('0x4a')]=qs[_0x2830('0x40')](_['pick'](_0x1ec2d5[_0x2830('0x3e')],_0x5d7177[_0x2830('0x40')]),_0x1a0ff3);var _0x4dbe60=[];var _0x474e01=squel[_0x2830('0x4b')]()[_0x2830('0x4c')]('id')[_0x2830('0x4c')](_0x2830('0x20'))[_0x2830('0x4c')]('color')[_0x2830('0x4d')](_0x2830('0x4e'));var _0x17a0d3=squel[_0x2830('0x4b')]()[_0x2830('0x4c')]('u.id')['field'](_0x2830('0x4f'))[_0x2830('0x4c')](_0x2830('0x50'))[_0x2830('0x4d')]('user_has_mail_interactions','ui')[_0x2830('0x51')]('users','u',_0x2830('0x52'));var _0x2e0363=squel[_0x2830('0x4b')]()['from'](_0x2830('0x53'),'i')[_0x2830('0x51')]('cm_contacts','c',_0x2830('0x54'))['left_join'](_0x2830('0x55'),'o',_0x2830('0x56'))[_0x2830('0x51')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x2830('0x51')]('mail_messages','me',_0x2830('0x57'))[_0x2830('0x51')](_0x2830('0x58'),'it',_0x2830('0x59'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x495a72=squel[_0x2830('0x5a')]();var _0x98001a=[];var _0x268362=squel[_0x2830('0x5a')]();var _0x5b3879;if(_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x5b')]){_0x5b3879=as['parseSearch'](_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x5b')]);var _0x574f8f=_0x5b3879['sqlOperator'];for(var _0x562f1b=0x0;_0x562f1b<_0x5b3879['conditions']['length'];_0x562f1b++){var _0x399278=_0x5b3879[_0x2830('0x5c')][_0x562f1b];var _0x20af9f='i';var _0x70d86=_[_0x2830('0x5d')](_0x1a0ff3,[_0x2830('0x20'),_0x399278[_0x2830('0x4c')]]);if(!_0x70d86){switch(_0x399278['field']){case _0x2830('0x5e'):if(_0x399278['value']==0x1){_0x2e0363[_0x2830('0x5f')]('`'+_0x399278['field']+_0x2830('0x60'));}else{_0x2e0363[_0x2830('0x5f')]('`'+_0x399278[_0x2830('0x4c')]+'`\x20>\x200');}break;case _0x2830('0x61'):if(_0x399278[_0x2830('0x62')]===_0x2830('0x63')){if(_0x399278[_0x2830('0x64')][_0x2830('0x27')]('\x20')[_0x2830('0x45')]>0x1){_0x495a72[_0x574f8f](_0x2830('0x65'),qs[_0x2830('0x66')](_0x399278['value']),null);}else{var _0x4a8f17='%'+_0x399278[_0x2830('0x64')]+'%';_0x495a72[_0x574f8f](_0x2830('0x67'),_0x4a8f17,_0x4a8f17,_0x4a8f17);}}else{_0x70d86=_[_0x2830('0x5d')](_0x1a0ff3,[_0x2830('0x20'),_0x2830('0x68')]);_0x399278[_0x2830('0x4c')]=_0x2830('0x68');_0x47e56e=as['buildExpression'](_0x20af9f,_0x70d86[_0x2830('0x3c')],_0x399278);_0x495a72[_0x574f8f](_0x47e56e[_0x2830('0x69')],_0x47e56e[_0x2830('0x64')]['start'],_0x47e56e['value'][_0x2830('0x1d')]);}break;case _0x2830('0x6a'):var _0x5eee37=_0x399278['value'][_0x2830('0x27')](',')[_0x2830('0x23')](function(_0x4266cc){return Number(_0x4266cc);});_0x5eee37[_0x2830('0x28')](function(_0x19ce84){_0x268362['or'](_0x2830('0x6b'),'%,'+_0x19ce84+',%');});_0x98001a=_[_0x2830('0x6c')](_0x98001a,_0x5eee37);break;case'User':if(_0x399278[_0x2830('0x62')]==='$substring'){_0x495a72[_0x574f8f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x399278[_0x2830('0x64')]+'%',null);}else{_0x70d86=_[_0x2830('0x5d')](_0x1a0ff3,['name',_0x2830('0x37')]);_0x399278['field']=_0x2830('0x37');_0x47e56e=as['buildExpression'](_0x20af9f,_0x70d86['type'],_0x399278);_0x495a72[_0x574f8f](_0x47e56e[_0x2830('0x69')],_0x47e56e[_0x2830('0x64')][_0x2830('0x6d')],_0x47e56e['value']['end']);}break;case'plainBody':_0x47e56e=as[_0x2830('0x6e')]('me',null,_0x399278);_0x495a72[_0x574f8f](_0x47e56e[_0x2830('0x69')],_0x47e56e[_0x2830('0x64')][_0x2830('0x6d')],_0x47e56e[_0x2830('0x64')][_0x2830('0x1d')]);break;}}else{var _0x47e56e=as[_0x2830('0x6e')](_0x20af9f,_0x70d86[_0x2830('0x3c')],_0x399278);_0x495a72[_0x574f8f](_0x47e56e[_0x2830('0x69')],_0x47e56e[_0x2830('0x64')][_0x2830('0x6d')],_0x47e56e[_0x2830('0x64')][_0x2830('0x1d')]);}}}else{var _0x397bd5=_(_0x1ec2d5[_0x2830('0x3e')])['keys']()['map'](function(_0x4fd1ef){return _[_0x2830('0x6f')](_0x1a0ff3,[_0x2830('0x20'),_0x4fd1ef])?_0x4fd1ef:undefined;})[_0x2830('0x70')]()[_0x2830('0x64')]();if(!_['isEmpty'](_0x397bd5)){_0x397bd5[_0x2830('0x28')](function(_0x2cad0b){if(_0x2cad0b===_0x2830('0x71')){_0x2e0363[_0x2830('0x4a')](_0x2830('0x72'),[][_0x2830('0x73')](_0x1ec2d5[_0x2830('0x3e')][_0x2cad0b]));}else if(_0x2cad0b===_0x2830('0x74')){var _0x10cf8a=JSON[_0x2830('0x75')](_0x1ec2d5[_0x2830('0x3e')][_0x2cad0b])[_0x2830('0x76')];var _0x3ad780=JSON[_0x2830('0x75')](_0x1ec2d5[_0x2830('0x3e')][_0x2cad0b])[_0x2830('0x77')];_0x2e0363[_0x2830('0x4a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x10cf8a,_0x3ad780);}else{if(_0x1ec2d5['query'][_0x2cad0b]===_0x2830('0x78')){_0x2e0363[_0x2830('0x4a')]('i.'+_0x2cad0b+_0x2830('0x79'));}else{_0x2e0363[_0x2830('0x4a')]('i.'+_0x2cad0b+_0x2830('0x7a'),_0x1ec2d5[_0x2830('0x3e')][_0x2cad0b]);}}});}if(_0x1ec2d5['query'][_0x2830('0x7b')]){if(_0x1ec2d5[_0x2830('0x3e')]['read']==0x1){_0x2e0363['having'](_0x2830('0x7c'));}else{_0x2e0363['having']('`unreadMessages`\x20>\x200');}}if(_0x1ec2d5['query']['tag']){_0x98001a=_[_0x2830('0x7d')](_0x1ec2d5[_0x2830('0x3e')]['tag'])?_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x7e')]:new Array(_0x1ec2d5['query']['tag']);_0x98001a['forEach'](function(_0x5dd318){_0x268362['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5dd318+',%');});}if(_0x1ec2d5['query'][_0x2830('0x7f')]){var _0x312da2=_0x1ec2d5['query'][_0x2830('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x2830('0x80')](/'/g,'\x27\x27');if(qs[_0x2830('0x81')](_0x312da2)){_0x495a72['or'](_0x2830('0x82'),_0x312da2+'%');}else if(qs['isEmail'](_0x312da2)){_0x495a72['or'](_0x2830('0x83'),_0x312da2+'%');}else{_0x495a72['or'](_0x2830('0x84'),qs['getFullTextValue'](_0x312da2))['or'](_0x2830('0x85'),qs[_0x2830('0x66')](_0x312da2));}}}_0x2e0363['where'](_0x495a72);_0x2e0363['group'](_0x2830('0x86'));var _0x429a74={'type':db[_0x2830('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3ce0b2=_0x2e0363[_0x2830('0x88')]();_0x3ce0b2[_0x2830('0x4c')](_0x2830('0x86'));_0x3ce0b2[_0x2830('0x4c')](_0x2830('0x89'),_0x2830('0x5e'));if(_0xbc23c2[_0x2830('0x48')]){_0xbc23c2[_0x2830('0x48')][_0x2830('0x28')](function(_0x5b5673){var _0x431f44=_0x5b5673[0x0]===_0x2830('0x8a')?_0x5b5673[0x0]:'i.'+_0x5b5673[0x0];_0x2e0363[_0x2830('0x48')](_0x431f44,_0x5b5673[0x1]===_0x2830('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x98001a)){_0x2e0363[_0x2830('0x5f')](_0x268362);_0x3ce0b2[_0x2830('0x4a')](_0x2830('0x8c'),_0x98001a);}BPromise[_0x2830('0x8d')]()[_0x2830('0x1c')](function(){if(!_0x5b3879){if(_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x71')])return;_0x3ce0b2['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x2e0363[_0x2830('0x4a')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1ec2d5[_0x2830('0x8e')][_0x2830('0x8f')]!==_0x2830('0x90'))return;return _0x1ec2d5[_0x2830('0x8e')][_0x2830('0x91')]({'attributes':['id'],'raw':!![]})[_0x2830('0x1c')](function(_0x23e053){if(_[_0x2830('0x92')](_0x23e053)){_0x3ce0b2[_0x2830('0x4a')]('i.MailAccountId\x20IS\x20NULL');_0x2e0363['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x3ce0b2[_0x2830('0x4a')](_0x2830('0x72'),_['map'](_0x23e053,'id'));_0x2e0363[_0x2830('0x4a')]('i.MailAccountId\x20IN\x20?',_['map'](_0x23e053,'id'));}});})[_0x2830('0x1c')](function(){if(_0x1ec2d5[_0x2830('0x8e')]['role']===_0x2830('0x90')&&!_0x5b3879&&!_0x1ec2d5[_0x2830('0x3e')][_0x2830('0x71')])return[];return db[_0x2830('0x93')][_0x2830('0x3e')](_0x3ce0b2[_0x2830('0x94')](),_0x429a74);})[_0x2830('0x1c')](function(_0x9ae2ba){_0x492344[_0x2830('0x19')]=_0x9ae2ba[_0x2830('0x45')];if(_0x492344[_0x2830('0x19')]===0x0)return[];return db[_0x2830('0x93')]['query'](_0x474e01[_0x2830('0x94')](),_0x429a74)[_0x2830('0x1c')](function(_0x8a8dfb){_0x4dbe60=_[_0x2830('0x95')](_0x8a8dfb,'id');_0x429a74=_[_0x2830('0x96')](_0x429a74,{'model':db[_0x2830('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ec2d5['query'][_0x2830('0x43')]){_0xbc23c2[_0x2830('0x44')][_0x2830('0x28')](function(_0x1d96ef){_0x2e0363[_0x2830('0x4c')]('i.'+_0x1d96ef);});}else{_0x2e0363[_0x2830('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2830('0x5e'));_0x2e0363[_0x2830('0x4c')](_0x2830('0x97'),_0x2830('0x98'));_0x2e0363['field'](_0x2830('0x99'),_0x2830('0x9a'));_0x2e0363[_0x2830('0x4c')](_0x2830('0x9b'),'Account.email');_0x2e0363[_0x2830('0x4c')](_0x2830('0x9c'),_0x2830('0x8a'));_0x2e0363[_0x2830('0x4c')](_0x2830('0x86'));_0x2e0363['field'](_0x2830('0x9d'));_0x2e0363[_0x2830('0x4c')](_0x2830('0x9e'));_0x2e0363[_0x2830('0x4c')](_0x2830('0x9f'));_0x2e0363['field'](_0x2830('0xa0'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xa1'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xa2'));_0x2e0363['field']('i.lastMsgDirection');_0x2e0363[_0x2830('0x4c')](_0x2830('0xa3'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xa4'));_0x2e0363['field'](_0x2830('0xa5'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xa6'));_0x2e0363[_0x2830('0x4c')]('i.substatus');_0x2e0363[_0x2830('0x4c')](_0x2830('0xa7'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xa8'));_0x2e0363[_0x2830('0x4c')]('i.MailAccountId');_0x2e0363[_0x2830('0x4c')]('i.UserId');_0x2e0363[_0x2830('0x4c')](_0x2830('0xa9'),_0x2830('0xaa'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xab'),_0x2830('0xac'));_0x2e0363['field']('c.email',_0x2830('0xad'));_0x2e0363['field'](_0x2830('0xae'),_0x2830('0xaf'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xb0'),'Contact.mobile');_0x2e0363[_0x2830('0x4c')](_0x2830('0xb1'),_0x2830('0xb2'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xb3'),_0x2830('0xb4'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xb5'),_0x2830('0xb6'));_0x2e0363[_0x2830('0x4c')](_0x2830('0xb7'),'TagIds');}if(_0xbc23c2['limit'])_0x2e0363[_0x2830('0x1a')](_0xbc23c2['limit']);if(_0xbc23c2['offset'])_0x2e0363[_0x2830('0x17')](_0xbc23c2[_0x2830('0x17')]);return db[_0x2830('0x93')][_0x2830('0x3e')](_0x2e0363['toString'](),_0x429a74);})['then'](function(_0x20ba3b){if(_0x20ba3b[_0x2830('0x45')]>0x0)_0x17a0d3[_0x2830('0x4a')](_0x2830('0xb8'),_['map'](_0x20ba3b,'id'));return db[_0x2830('0x93')][_0x2830('0x3e')](_0x17a0d3[_0x2830('0x94')](),_0x429a74)[_0x2830('0x1c')](function(_0x279b0f){var _0x423bb3=_[_0x2830('0xb9')](_0x279b0f,_0x2830('0xba'));var _0x3e362c=[];return db[_0x2830('0xbb')][_0x2830('0xbc')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x2830('0x1c')](function(_0x41b0df){var _0x12cce4=_0x41b0df[_0x2830('0xbd')];_0x20ba3b[_0x2830('0x28')](function(_0x219e90){_0x3e362c[_0x2830('0x29')](updateMailInteraction(_0x219e90,_0x4dbe60,_0x423bb3,_0x12cce4));});return BPromise[_0x2830('0xbe')](_0x3e362c);});});});})[_0x2830('0x1c')](function(_0x4b091d){_0x492344[_0x2830('0xbf')]=_0x4b091d;return _0x492344;})['then'](respondWithFilteredResult(_0x1664c9,_0xbc23c2))['catch'](handleError(_0x1664c9,null));};exports[_0x2830('0xc0')]=function(_0x4903eb,_0x2b535c){var _0x3c53bc={'raw':![],'where':{'id':_0x4903eb[_0x2830('0xc1')]['id']}},_0x3aa192={};_0x3aa192[_0x2830('0x42')]=_[_0x2830('0x3f')](db[_0x2830('0x39')]['rawAttributes']);_0x3aa192[_0x2830('0x3e')]=_[_0x2830('0x3f')](_0x4903eb[_0x2830('0x3e')]);_0x3aa192['filters']=_[_0x2830('0x41')](_0x3aa192[_0x2830('0x42')],_0x3aa192[_0x2830('0x3e')]);_0x3c53bc[_0x2830('0x44')]=_[_0x2830('0x41')](_0x3aa192[_0x2830('0x42')],qs['fields'](_0x4903eb[_0x2830('0x3e')][_0x2830('0x43')]));_0x3c53bc[_0x2830('0x44')]=_0x3c53bc['attributes'][_0x2830('0x45')]?_0x3c53bc[_0x2830('0x44')]:_0x3aa192[_0x2830('0x42')];if(_0x4903eb[_0x2830('0x3e')][_0x2830('0xc2')]){_0x3c53bc[_0x2830('0xc3')]=[{'all':!![]}];}_0x3c53bc=_['merge']({},_0x3c53bc,_0x4903eb['options']);return db[_0x2830('0x39')][_0x2830('0x5d')](_0x3c53bc)['then'](handleEntityNotFound(_0x2b535c,null))[_0x2830('0x1c')](respondWithResult(_0x2b535c,null))['catch'](handleError(_0x2b535c,null));};exports[_0x2830('0xc4')]=function(_0x64ae87,_0x1a3868){return db[_0x2830('0x39')]['create'](_0x64ae87[_0x2830('0xc5')],{})[_0x2830('0x1c')](respondWithResult(_0x1a3868,0xc9))['catch'](handleError(_0x1a3868,null));};exports['update']=function(_0x2494b9,_0x1ecdb6){if(_0x2494b9[_0x2830('0xc5')]['id']){delete _0x2494b9['body']['id'];}return db['MailInteraction'][_0x2830('0x5d')]({'where':{'id':_0x2494b9[_0x2830('0xc1')]['id']}})[_0x2830('0x1c')](handleEntityNotFound(_0x1ecdb6,null))[_0x2830('0x1c')](saveUpdates(_0x2494b9['body'],null))[_0x2830('0x1c')](respondWithResult(_0x1ecdb6,null))[_0x2830('0x30')](handleError(_0x1ecdb6,null));};exports[_0x2830('0xc6')]=function(_0x38b434,_0x2b9d0c){return db[_0x2830('0x39')][_0x2830('0x5d')]({'where':{'id':_0x38b434[_0x2830('0xc1')]['id']}})[_0x2830('0x1c')](handleEntityNotFound(_0x2b9d0c,null))[_0x2830('0x1c')](removeEntity(_0x2b9d0c,null))[_0x2830('0x30')](handleError(_0x2b9d0c,null));};exports[_0x2830('0xc7')]=function(_0x553403,_0x16d458){return db[_0x2830('0x39')][_0x2830('0xc7')]()[_0x2830('0x1c')](respondWithResult(_0x16d458,null))[_0x2830('0x30')](handleError(_0x16d458,null));};exports['addMessage']=function(_0x3269bf,_0x590981){return db['MailMessage']['find']({'where':{'id':_0x3269bf[_0x2830('0xc1')]['id']}})[_0x2830('0x1c')](handleEntityNotFound(_0x590981,null))[_0x2830('0x1c')](function(_0x4d07de){if(_0x4d07de){return _0x4d07de['addMessage'](_0x3269bf[_0x2830('0xc5')][_0x2830('0xc8')],_[_0x2830('0xc9')](_0x3269bf['body'],[_0x2830('0xc8'),'id'])||{});}})[_0x2830('0x1c')](respondWithResult(_0x590981,null))['catch'](handleError(_0x590981,null));};exports['getMessages']=function(_0x59c694,_0x108bf9){var _0x434438={'raw':![],'where':{}};var _0xd08cb7={};var _0x254987={'count':0x0,'rows':[]};return db['MailInteraction'][_0x2830('0xbc')]({'where':{'id':_0x59c694['params']['id']}})[_0x2830('0x1c')](handleEntityNotFound(_0x108bf9,null))[_0x2830('0x1c')](function(_0x44168c){if(_0x44168c){_0xd08cb7['model']=_['keys'](db['MailMessage']['rawAttributes']);_0xd08cb7[_0x2830('0x3e')]=_[_0x2830('0x3f')](_0x59c694[_0x2830('0x3e')]);_0xd08cb7['filters']=_[_0x2830('0x41')](_0xd08cb7['model'],_0xd08cb7[_0x2830('0x3e')]);_0x434438['attributes']=_['intersection'](_0xd08cb7[_0x2830('0x42')],qs['fields'](_0x59c694[_0x2830('0x3e')][_0x2830('0x43')]));_0x434438['attributes']=_0x434438[_0x2830('0x44')][_0x2830('0x45')]?_0x434438[_0x2830('0x44')]:_0xd08cb7[_0x2830('0x42')];if(!_0x59c694[_0x2830('0x3e')][_0x2830('0x46')](_0x2830('0x47'))){_0x434438[_0x2830('0x1a')]=qs['limit'](_0x59c694[_0x2830('0x3e')][_0x2830('0x1a')]);_0x434438['offset']=qs['offset'](_0x59c694[_0x2830('0x3e')][_0x2830('0x17')]);}_0x434438[_0x2830('0x48')]=qs['sort'](_0x59c694[_0x2830('0x3e')][_0x2830('0x49')]);_0x434438['where']=qs[_0x2830('0x40')](_['pick'](_0x59c694[_0x2830('0x3e')],_0xd08cb7[_0x2830('0x40')]));_0x434438[_0x2830('0x4a')][_0x2830('0xba')]=_0x44168c['id'];if(_0x59c694['query']['filter']){_0x434438[_0x2830('0x4a')]=_[_0x2830('0x96')](_0x434438[_0x2830('0x4a')],{'$or':_[_0x2830('0x23')](_0x434438[_0x2830('0x44')],function(_0x4783cb){var _0x10dd41={};_0x10dd41[_0x4783cb]={'$like':'%'+_0x59c694['query'][_0x2830('0x7f')]+'%'};return _0x10dd41;})});}if(_0x59c694[_0x2830('0x3e')][_0x2830('0x76')]){var _0x4547fa=_0x59c694['query'][_0x2830('0x76')][_0x2830('0x27')](',');var _0x48e78={};_0x48e78[_0x4547fa[0x0]]={'$gte':moment(_0x4547fa[0x1])[_0x2830('0xca')]('YYYY-MM-DD\x20HH:mm:ss')};_0x434438[_0x2830('0x4a')]=_[_0x2830('0x96')](_0x434438[_0x2830('0x4a')],_0x48e78);}_0x434438=_[_0x2830('0x96')]({},_0x434438,_0x59c694['options']);return db['MailMessage']['count']({'where':_0x434438[_0x2830('0x4a')]})[_0x2830('0x1c')](function(_0x1ffd3a){_0x254987[_0x2830('0x19')]=_0x1ffd3a;if(_0x59c694[_0x2830('0x3e')][_0x2830('0xc2')]){_0x434438[_0x2830('0xc3')]=[{'all':!![]}];}return db[_0x2830('0x2a')]['findAll'](_0x434438);})[_0x2830('0x1c')](function(_0x3a4722){if(_0x59c694[_0x2830('0x3e')][_0x2830('0xcb')]===_0x2830('0xcc')){for(var _0x3b109e=0x0;_0x3b109e<_0x3a4722['length'];_0x3b109e++){_0x3a4722[_0x3b109e][_0x2830('0xc5')]=juice(_0x3a4722[_0x3b109e][_0x2830('0xc5')]);}}_0x254987[_0x2830('0xbf')]=_0x3a4722;return _0x254987;});}})['then'](respondWithFilteredResult(_0x108bf9,_0x434438))[_0x2830('0x30')](handleError(_0x108bf9,null));};exports[_0x2830('0xcd')]=function(_0x2cbf8e,_0x464380){return db[_0x2830('0x39')][_0x2830('0x5d')]({'where':{'id':_0x2cbf8e[_0x2830('0xc1')]['id']}})[_0x2830('0x1c')](handleEntityNotFound(_0x464380,null))[_0x2830('0x1c')](function(_0x3fb4d5){if(_0x3fb4d5){return _0x3fb4d5[_0x2830('0xce')](_0x2cbf8e[_0x2830('0xc5')][_0x2830('0xc8')],_['omit'](_0x2cbf8e[_0x2830('0xc5')],['ids','id'])||{})[_0x2830('0xcf')](function(){return db[_0x2830('0x6a')][_0x2830('0xd0')]({'attributes':['id',_0x2830('0x20'),'color'],'where':{'id':_0x2cbf8e['body'][_0x2830('0xc8')]}});})['then'](function(_0x5b4e76){socket[_0x2830('0xd1')](_0x2830('0xd2'),{'id':Number(_0x2cbf8e['params']['id']),'tags':_0x5b4e76||[]});return{'id':Number(_0x2cbf8e[_0x2830('0xc1')]['id']),'tags':_0x5b4e76||[]};});}})[_0x2830('0x1c')](respondWithResult(_0x464380,null))[_0x2830('0x30')](handleError(_0x464380,null));};exports['removeTags']=function(_0x103de4,_0x3bf62c){return db[_0x2830('0x39')][_0x2830('0x5d')]({'where':{'id':_0x103de4['params']['id']}})['then'](handleEntityNotFound(_0x3bf62c,null))['then'](function(_0x629980){if(_0x629980){return _0x629980[_0x2830('0xd3')](_0x103de4['query'][_0x2830('0xc8')]);}})[_0x2830('0x1c')](respondWithStatusCode(_0x3bf62c,null))[_0x2830('0x30')](handleError(_0x3bf62c,null));};exports[_0x2830('0xd4')]=function(_0x3407b6,_0x179ee0){var _0x27c3a1=moment()['unix']()[_0x2830('0x94')]();var _0x1be8c5=path['join'](config[_0x2830('0xd5')],'server',_0x2830('0xd6'),_0x2830('0xd7'));var _0xf5ab69=path['join'](config[_0x2830('0xd5')],_0x2830('0xd8'),_0x2830('0xd6'),'attachments');var _0x23aedf=path[_0x2830('0xd9')](_0x1be8c5,_0x27c3a1);var _0x11b09a=util[_0x2830('0xca')](_0x2830('0xda'),_0x3407b6[_0x2830('0xc1')]['id'],_0x27c3a1);var _0x85e0ff=path[_0x2830('0xd9')](_0x1be8c5,_0x11b09a);var _0x1e604d=[];if(_0x3407b6[_0x2830('0x3e')][_0x2830('0xdb')]){_0x1e604d[_0x2830('0x29')]({'model':db[_0x2830('0xdc')],'as':_0x2830('0xdd'),'raw':!![]});}var _0x11ff1f=[{'model':db[_0x2830('0x2a')],'as':_0x2830('0xde'),'attributes':['id',_0x2830('0xc5'),_0x2830('0x4d'),'to','cc',_0x2830('0xdf'),_0x2830('0xe0'),'createdAt'],'where':{'secret':![]},'order':qs[_0x2830('0x49')]('id'),'include':_0x1e604d}];return db['MailInteraction'][_0x2830('0x5d')]({'where':{'id':_0x3407b6[_0x2830('0xc1')]['id']},'include':_0x11ff1f})['then'](handleEntityNotFound(_0x179ee0,null))[_0x2830('0x1c')](function(_0x2d7dcc){if(_0x2d7dcc&&_0x2d7dcc[_0x2830('0xde')]){var _0xf4c3ef=_0x2d7dcc[_0x2830('0xe1')]({'plain':!![]});fs['mkdirSync'](_0x23aedf);return BPromise[_0x2830('0xe2')](_0xf4c3ef[_0x2830('0xde')],function(_0x2fbe6c,_0x434405){var _0x1e0431={'from':_0x2fbe6c['from'],'to':_0x2fbe6c['to'],'subject':_0x2fbe6c[_0x2830('0xe0')],'html':htmlEntities[_0x2830('0xe3')](_0x2fbe6c[_0x2830('0xc5')]),'headers':{'Date':moment(_0x2fbe6c[_0x2830('0x74')])[_0x2830('0xca')](_0x2830('0xe4'))},'attachments':[]};if(_0x2fbe6c['cc']){_0x1e0431[_0x2830('0xe5')]['Cc']=_0x2fbe6c['cc'];}if(_0x2fbe6c['bcc']){_0x1e0431[_0x2830('0xe5')]['Bcc']=_0x2fbe6c[_0x2830('0xdf')];}return new BPromise(function(_0xf1228a,_0x51b0bc){if(_0x2fbe6c[_0x2830('0xdd')]){for(var _0x1eed50=0x0;_0x1eed50<_0x2fbe6c[_0x2830('0xdd')][_0x2830('0x45')];_0x1eed50++){var _0xbc3347=_0x2fbe6c[_0x2830('0xdd')][_0x1eed50];var _0x494f74=path[_0x2830('0xd9')](_0xf5ab69,_0xbc3347[_0x2830('0xe6')]);if(fs[_0x2830('0xe7')](_0x494f74)){_0x1e0431['attachments'][_0x2830('0x29')]({'name':_0xbc3347[_0x2830('0x20')],'contentType':_0xbc3347[_0x2830('0x3c')],'data':fs['readFileSync'](_0x494f74)});}}}emlformat[_0x2830('0xe8')](_0x1e0431,function(_0x4ec552,_0x45365d){if(_0x4ec552)return _0x51b0bc(_0x4ec552);fs['writeFileSync'](path[_0x2830('0xd9')](_0x23aedf,util[_0x2830('0xca')]('message%d.eml',_0x434405)),_0x45365d);return _0xf1228a(_0x45365d);});});})[_0x2830('0x1c')](function(){return new BPromise(function(_0x239d32,_0x48e1b3){zipdir(_0x23aedf,{'saveTo':_0x85e0ff},function(_0x1f01ad,_0x3680bf){if(_0x1f01ad)return _0x48e1b3(_0x1f01ad);return _0x239d32(_0x3680bf);});})[_0x2830('0x1c')](function(){return new BPromise(function(_0x279ef0,_0x2e521c){rimraf(_0x23aedf,function(_0x1180ba){if(_0x1180ba)_0x2e521c(_0x1180ba);return _0x279ef0();});});})['then'](function(){return _0x179ee0[_0x2830('0xd4')](_0x85e0ff,_0x11b09a,function(_0x230f7a){if(!_0x230f7a)fs[_0x2830('0xe9')](_0x85e0ff);});});});}else{return _0x179ee0[_0x2830('0x14')](0xc8);}})[_0x2830('0x30')](handleError(_0x179ee0,null));}; \ No newline at end of file +var _0xf923=['compact','MailAccountId','where','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IN\x20?','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','i.createdAt','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','params','MailInteraction','include','options','create','body','describe','addMessage','ids','MailMessage','rawAttributes','hasOwnProperty','includeAll','findAll','inlineCss','setTags','spread','mailInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachments','Messages','subject','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','readFileSync','writeFileSync','message%d.eml','download','eml-format','rimraf','moment','path','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','push','findOne','out','plainBody','-id','lastMsgText','catch','waiting','talking','unmanaged','closed','UserId','answered','total','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','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','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','keys','some'];(function(_0x1aac8f,_0x2ab7ac){var _0x5af387=function(_0x31f22b){while(--_0x31f22b){_0x1aac8f['push'](_0x1aac8f['shift']());}};_0x5af387(++_0x2ab7ac);}(_0xf923,0x74));var _0x3f92=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xf923[_0x80d733];return _0x435868;};'use strict';var emlformat=require(_0x3f92('0x0'));var rimraf=require(_0x3f92('0x1'));var zipdir=require('zip-dir');var moment=require(_0x3f92('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x3f92('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3f92('0x4'));var juice=require(_0x3f92('0x5'));var Redis=require(_0x3f92('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x3f92('0x7'));var logger=require(_0x3f92('0x8'))(_0x3f92('0x9'));var config=require('../../config/environment');var db=require(_0x3f92('0xa'))['db'];var htmlEntities=require(_0x3f92('0xb'));config['redis']=_[_0x3f92('0xc')](config[_0x3f92('0xd')],{'host':_0x3f92('0xe'),'port':0x18eb});var socket=require(_0x3f92('0xf'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x3f92('0x10')](socket);function respondWithStatusCode(_0x1771fd,_0x474ef3){_0x474ef3=_0x474ef3||0xcc;return function(_0x5482f7){if(_0x5482f7){return _0x1771fd[_0x3f92('0x11')](_0x474ef3);}return _0x1771fd[_0x3f92('0x12')](_0x474ef3)['end']();};}function respondWithResult(_0x32e537,_0x5dcdc1){_0x5dcdc1=_0x5dcdc1||0xc8;return function(_0xfea4ce){if(_0xfea4ce){return _0x32e537[_0x3f92('0x12')](_0x5dcdc1)[_0x3f92('0x13')](_0xfea4ce);}};}function respondWithFilteredResult(_0x36d43c,_0x2a60b3){return function(_0x51d9a9){if(_0x51d9a9){var _0x654f46=typeof _0x2a60b3[_0x3f92('0x14')]===_0x3f92('0x15')&&typeof _0x2a60b3[_0x3f92('0x16')]==='undefined';var _0x723e67=_0x51d9a9[_0x3f92('0x17')];var _0x11a2f3=_0x654f46?0x0:_0x2a60b3[_0x3f92('0x14')];var _0x163740=_0x654f46?_0x51d9a9[_0x3f92('0x17')]:_0x2a60b3['offset']+_0x2a60b3[_0x3f92('0x16')];var _0xccdbfa;if(_0x163740>=_0x723e67){_0x163740=_0x723e67;_0xccdbfa=0xc8;}else{_0xccdbfa=0xce;}_0x36d43c['status'](_0xccdbfa);return _0x36d43c[_0x3f92('0x18')](_0x3f92('0x19'),_0x11a2f3+'-'+_0x163740+'/'+_0x723e67)['json'](_0x51d9a9);}return null;};}function saveUpdates(_0x2df75a){return function(_0xe23be){if(_0xe23be){return _0xe23be[_0x3f92('0x1a')](_0x2df75a)[_0x3f92('0x1b')](function(_0x4d1482){return _0x4d1482;});}return null;};}function removeEntity(_0x181ca5){return function(_0x12a700){if(_0x12a700){return _0x12a700[_0x3f92('0x1c')]()[_0x3f92('0x1b')](function(){_0x181ca5[_0x3f92('0x12')](0xcc)[_0x3f92('0x1d')]();});}};}function handleEntityNotFound(_0x4ed232){return function(_0x1cb51b){if(!_0x1cb51b){_0x4ed232[_0x3f92('0x11')](0x194);}return _0x1cb51b;};}function handleError(_0x17db99,_0x39ae53){_0x39ae53=_0x39ae53||0x1f4;return function(_0x141a9e){logger[_0x3f92('0x1e')](_0x141a9e[_0x3f92('0x1f')]);if(_0x141a9e['name']){delete _0x141a9e[_0x3f92('0x20')];}_0x17db99[_0x3f92('0x12')](_0x39ae53)[_0x3f92('0x21')](_0x141a9e);};}function getInteractionUsers(_0x681fe7,_0x2817de){return new BPromise(function(_0x47c786,_0x44940b){try{if(_0x2817de[_0x681fe7['id']]){_0x681fe7[_0x3f92('0x22')]=_['map'](_0x2817de[_0x681fe7['id']],function(_0x4d0acc){return{'id':_0x4d0acc['id'],'fullname':_0x4d0acc[_0x3f92('0x23')]};});}}catch(_0x5b4f33){_0x44940b(_0x5b4f33);}_0x47c786(_0x681fe7);});}function getInteractionTags(_0x8e1724,_0x2848ba){return new BPromise(function(_0x556b3a,_0x2c089c){try{if(_0x8e1724[_0x3f92('0x24')]){_0x8e1724[_0x3f92('0x25')]=[];_0x8e1724[_0x3f92('0x24')][_0x3f92('0x26')](',')['forEach'](function(_0x19ce56){_0x8e1724[_0x3f92('0x25')][_0x3f92('0x27')](_0x2848ba[_0x19ce56]);});}delete _0x8e1724['TagIds'];}catch(_0x2b5a28){_0x2c089c(_0x2b5a28);}_0x556b3a(_0x8e1724);});}function getLastMessageText(_0x2b460d){return new BPromise(function(_0x122e54,_0x5064f6){return db['MailMessage'][_0x3f92('0x28')]({'where':{'$and':[{'MailInteractionId':_0x2b460d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x3f92('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3f92('0x2a')],'order':_0x3f92('0x2b'),'raw':!![]})[_0x3f92('0x1b')](function(_0x20a62c){if(_0x20a62c&&_0x20a62c[_0x3f92('0x2a')]){_0x2b460d[_0x3f92('0x2c')]=_['trimStart'](_0x20a62c[_0x3f92('0x2a')]);}_0x122e54(_0x2b460d);})[_0x3f92('0x2d')](function(_0x56132f){_0x5064f6(_0x56132f);});});}function updateMailInteraction(_0x866b5a,_0x4eee20,_0x660ae,_0x171950){return new BPromise(function(_0x4ff9fc,_0x25b17a){return getInteractionUsers(_0x866b5a,_0x660ae)[_0x3f92('0x1b')](function(_0x14b3a1){return getInteractionTags(_0x14b3a1,_0x4eee20);})['then'](function(_0x442ccd){return getStateInteraction(_0x442ccd);})[_0x3f92('0x1b')](function(_0x66e7bd){if(_0x171950){_0x4ff9fc(getLastMessageText(_0x66e7bd));}else{_0x4ff9fc(_0x66e7bd);}})['catch'](function(_0x31e9ec){_0x25b17a(_0x31e9ec);});});}function getStateInteraction(_0x509289){return new BPromise(function(_0x1bf6d3){_0x509289[_0x3f92('0x2e')]=0x0;_0x509289[_0x3f92('0x2f')]=0x0;_0x509289['answered']=0x0;_0x509289[_0x3f92('0x30')]=0x0;_0x509289['total']=0x0;if(!_0x509289[_0x3f92('0x31')]&&!_0x509289['UserId']){_0x509289['waiting']+=0x1;}if(!_0x509289['closed']&&_0x509289[_0x3f92('0x32')]){_0x509289[_0x3f92('0x2f')]+=0x1;if(_0x509289[_0x3f92('0x2e')]){_0x509289[_0x3f92('0x2e')]-=0x1;}}if(_0x509289[_0x3f92('0x31')]&&_0x509289['UserId']){_0x509289[_0x3f92('0x33')]+=0x1;if(_0x509289[_0x3f92('0x2f')]){_0x509289[_0x3f92('0x2f')]-=0x1;}}if(_0x509289[_0x3f92('0x31')]&&!_0x509289[_0x3f92('0x32')]){_0x509289[_0x3f92('0x30')]+=0x1;if(_0x509289['waiting']){_0x509289[_0x3f92('0x2e')]-=0x1;}}_0x509289[_0x3f92('0x34')]+=0x1;_0x1bf6d3(_0x509289);});}exports['index']=function(_0x57d56f,_0x2a52f6){var _0x56177e={},_0x1607e3={},_0x27187b={'count':0x0,'rows':[]};var _0x53245a=_[_0x3f92('0x35')](db['MailInteraction']['rawAttributes'],function(_0x20aa74){return{'name':_0x20aa74[_0x3f92('0x36')],'type':_0x20aa74[_0x3f92('0x37')][_0x3f92('0x38')]};});_0x1607e3[_0x3f92('0x39')]=_[_0x3f92('0x35')](_0x53245a,'name');_0x1607e3['query']=_['keys'](_0x57d56f[_0x3f92('0x3a')]);_0x1607e3[_0x3f92('0x3b')]=_[_0x3f92('0x3c')](_0x1607e3[_0x3f92('0x39')],_0x1607e3['query']);_0x56177e['attributes']=_[_0x3f92('0x3c')](_0x1607e3[_0x3f92('0x39')],qs['fields'](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x3d')]));_0x56177e['attributes']=_0x56177e[_0x3f92('0x3e')][_0x3f92('0x3f')]?_0x56177e[_0x3f92('0x3e')]:_0x1607e3[_0x3f92('0x39')];if(!_0x57d56f[_0x3f92('0x3a')]['hasOwnProperty'](_0x3f92('0x40'))){_0x56177e['limit']=qs[_0x3f92('0x16')](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x16')]);_0x56177e[_0x3f92('0x14')]=qs[_0x3f92('0x14')](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x14')]);}_0x56177e[_0x3f92('0x41')]=qs[_0x3f92('0x42')](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x42')]);_0x56177e['where']=qs['filters'](_[_0x3f92('0x43')](_0x57d56f['query'],_0x1607e3['filters']),_0x53245a);var _0x2487f5=[];var _0xf2aaea=squel[_0x3f92('0x44')]()['field']('id')[_0x3f92('0x45')](_0x3f92('0x20'))[_0x3f92('0x45')](_0x3f92('0x46'))[_0x3f92('0x47')](_0x3f92('0x48'));var _0x522e92=squel['select']()[_0x3f92('0x45')](_0x3f92('0x49'))[_0x3f92('0x45')](_0x3f92('0x4a'))[_0x3f92('0x45')]('ui.MailInteractionId')['from']('user_has_mail_interactions','ui')[_0x3f92('0x4b')](_0x3f92('0x4c'),'u',_0x3f92('0x4d'));var _0x1fdd6f=squel['select']()[_0x3f92('0x47')](_0x3f92('0x4e'),'i')['left_join']('cm_contacts','c',_0x3f92('0x4f'))[_0x3f92('0x4b')](_0x3f92('0x4c'),'o',_0x3f92('0x50'))[_0x3f92('0x4b')](_0x3f92('0x51'),'a',_0x3f92('0x52'))[_0x3f92('0x4b')](_0x3f92('0x53'),'me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0x3f92('0x54'),'it',_0x3f92('0x55'))[_0x3f92('0x4b')]('tools_tags','t',_0x3f92('0x56'));var _0x40f243=squel['expr']();var _0x398f89=[];var _0x556d4b=squel[_0x3f92('0x57')]();var _0x51275a;if(_0x57d56f['query'][_0x3f92('0x58')]){_0x51275a=as['parseSearch'](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x58')]);var _0x5e04c4=_0x51275a[_0x3f92('0x59')];for(var _0x54f277=0x0;_0x54f277<_0x51275a[_0x3f92('0x5a')][_0x3f92('0x3f')];_0x54f277++){var _0x17ec9f=_0x51275a[_0x3f92('0x5a')][_0x54f277];var _0x137bfd='i';var _0x561bca=_[_0x3f92('0x5b')](_0x53245a,['name',_0x17ec9f[_0x3f92('0x45')]]);if(!_0x561bca){switch(_0x17ec9f[_0x3f92('0x45')]){case _0x3f92('0x5c'):if(_0x17ec9f[_0x3f92('0x5d')]==0x1){_0x1fdd6f[_0x3f92('0x5e')]('`'+_0x17ec9f['field']+_0x3f92('0x5f'));}else{_0x1fdd6f['having']('`'+_0x17ec9f[_0x3f92('0x45')]+_0x3f92('0x60'));}break;case _0x3f92('0x61'):if(_0x17ec9f['operator']==='$substring'){if(_0x17ec9f['value'][_0x3f92('0x26')]('\x20')[_0x3f92('0x3f')]>0x1){_0x40f243[_0x5e04c4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3f92('0x62')](_0x17ec9f[_0x3f92('0x5d')]),null);}else{var _0x3970a5='%'+_0x17ec9f['value']+'%';_0x40f243[_0x5e04c4]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3970a5,_0x3970a5,_0x3970a5);}}else{_0x561bca=_[_0x3f92('0x5b')](_0x53245a,[_0x3f92('0x20'),_0x3f92('0x63')]);_0x17ec9f[_0x3f92('0x45')]=_0x3f92('0x63');_0x56d0bf=as[_0x3f92('0x64')](_0x137bfd,_0x561bca['type'],_0x17ec9f);_0x40f243[_0x5e04c4](_0x56d0bf[_0x3f92('0x65')],_0x56d0bf[_0x3f92('0x5d')][_0x3f92('0x66')],_0x56d0bf[_0x3f92('0x5d')][_0x3f92('0x1d')]);}break;case _0x3f92('0x67'):var _0x55cde5=_0x17ec9f['value'][_0x3f92('0x26')](',')[_0x3f92('0x35')](function(_0x31cf80){return Number(_0x31cf80);});_0x55cde5[_0x3f92('0x68')](function(_0x1c18cc){_0x556d4b['or'](_0x3f92('0x69'),'%,'+_0x1c18cc+',%');});_0x398f89=_[_0x3f92('0x6a')](_0x398f89,_0x55cde5);break;case _0x3f92('0x6b'):if(_0x17ec9f['operator']==='$substring'){_0x40f243[_0x5e04c4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x17ec9f[_0x3f92('0x5d')]+'%',null);}else{_0x561bca=_[_0x3f92('0x5b')](_0x53245a,[_0x3f92('0x20'),'UserId']);_0x17ec9f[_0x3f92('0x45')]=_0x3f92('0x32');_0x56d0bf=as[_0x3f92('0x64')](_0x137bfd,_0x561bca['type'],_0x17ec9f);_0x40f243[_0x5e04c4](_0x56d0bf['text'],_0x56d0bf['value'][_0x3f92('0x66')],_0x56d0bf[_0x3f92('0x5d')]['end']);}break;case _0x3f92('0x2a'):_0x56d0bf=as['buildExpression']('me',null,_0x17ec9f);_0x40f243[_0x5e04c4](_0x56d0bf['text'],_0x56d0bf[_0x3f92('0x5d')][_0x3f92('0x66')],_0x56d0bf['value']['end']);break;}}else{var _0x56d0bf=as[_0x3f92('0x64')](_0x137bfd,_0x561bca[_0x3f92('0x37')],_0x17ec9f);_0x40f243[_0x5e04c4](_0x56d0bf[_0x3f92('0x65')],_0x56d0bf[_0x3f92('0x5d')]['start'],_0x56d0bf['value'][_0x3f92('0x1d')]);}}}else{var _0x154850=_(_0x57d56f[_0x3f92('0x3a')])[_0x3f92('0x6c')]()[_0x3f92('0x35')](function(_0x260d6b){return _[_0x3f92('0x6d')](_0x53245a,[_0x3f92('0x20'),_0x260d6b])?_0x260d6b:undefined;})[_0x3f92('0x6e')]()['value']();if(!_['isEmpty'](_0x154850)){_0x154850['forEach'](function(_0x424632){if(_0x424632===_0x3f92('0x6f')){_0x1fdd6f[_0x3f92('0x70')]('i.MailAccountId\x20IN\x20?',[][_0x3f92('0x71')](_0x57d56f[_0x3f92('0x3a')][_0x424632]));}else if(_0x424632===_0x3f92('0x72')){var _0x42ec96=JSON[_0x3f92('0x73')](_0x57d56f[_0x3f92('0x3a')][_0x424632])[_0x3f92('0x74')];var _0x1f3a3e=JSON[_0x3f92('0x73')](_0x57d56f['query'][_0x424632])[_0x3f92('0x75')];_0x1fdd6f[_0x3f92('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42ec96,_0x1f3a3e);}else{if(_0x57d56f[_0x3f92('0x3a')][_0x424632]===_0x3f92('0x76')){_0x1fdd6f[_0x3f92('0x70')]('i.'+_0x424632+_0x3f92('0x77'));}else{_0x1fdd6f[_0x3f92('0x70')]('i.'+_0x424632+_0x3f92('0x78'),_0x57d56f[_0x3f92('0x3a')][_0x424632]);}}});}if(_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x79')]){if(_0x57d56f['query']['read']==0x1){_0x1fdd6f[_0x3f92('0x5e')](_0x3f92('0x7a'));}else{_0x1fdd6f[_0x3f92('0x5e')](_0x3f92('0x7b'));}}if(_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x7c')]){_0x398f89=_[_0x3f92('0x7d')](_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x7c')])?_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x7c')]:new Array(_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x7c')]);_0x398f89[_0x3f92('0x68')](function(_0x4202c8){_0x556d4b['or'](_0x3f92('0x69'),'%,'+_0x4202c8+',%');});}if(_0x57d56f[_0x3f92('0x3a')]['filter']){var _0x38afe6=_0x57d56f['query'][_0x3f92('0x7e')][_0x3f92('0x7f')]('\x5c','\x5c\x5c')[_0x3f92('0x7f')](/'/g,'\x27\x27');if(qs[_0x3f92('0x80')](_0x38afe6)){_0x40f243['or'](_0x3f92('0x81'),_0x38afe6+'%');}else if(qs[_0x3f92('0x82')](_0x38afe6)){_0x40f243['or']('c.email\x20LIKE\x20?',_0x38afe6+'%');}else{_0x40f243['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3f92('0x62')](_0x38afe6))['or'](_0x3f92('0x83'),qs[_0x3f92('0x62')](_0x38afe6));}}}_0x1fdd6f['where'](_0x40f243);_0x1fdd6f[_0x3f92('0x84')](_0x3f92('0x85'));var _0x422a25={'type':db[_0x3f92('0x86')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2dbc88=_0x1fdd6f[_0x3f92('0x87')]();_0x2dbc88[_0x3f92('0x45')]('i.id');_0x2dbc88[_0x3f92('0x45')](_0x3f92('0x88'),'unreadMessages');if(_0x56177e['order']){_0x56177e[_0x3f92('0x41')][_0x3f92('0x68')](function(_0x2da73e){var _0x4b9643=_0x2da73e[0x0]===_0x3f92('0x89')?_0x2da73e[0x0]:'i.'+_0x2da73e[0x0];_0x1fdd6f['order'](_0x4b9643,_0x2da73e[0x1]===_0x3f92('0x8a')?![]:!![]);});}if(!_[_0x3f92('0x8b')](_0x398f89)){_0x1fdd6f[_0x3f92('0x5e')](_0x556d4b);_0x2dbc88[_0x3f92('0x70')](_0x3f92('0x8c'),_0x398f89);}BPromise[_0x3f92('0x8d')]()[_0x3f92('0x1b')](function(){if(!_0x51275a){if(_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x6f')])return;_0x2dbc88[_0x3f92('0x70')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x1fdd6f[_0x3f92('0x70')](_0x3f92('0x8e'));return;}if(_0x57d56f[_0x3f92('0x8f')]['role']!==_0x3f92('0x90'))return;return _0x57d56f[_0x3f92('0x8f')][_0x3f92('0x91')]({'attributes':['id'],'raw':!![]})[_0x3f92('0x1b')](function(_0x5cc941){if(_[_0x3f92('0x8b')](_0x5cc941)){_0x2dbc88['where']('i.MailAccountId\x20IS\x20NULL');_0x1fdd6f[_0x3f92('0x70')]('i.MailAccountId\x20IS\x20NULL');}else{_0x2dbc88['where'](_0x3f92('0x92'),_[_0x3f92('0x35')](_0x5cc941,'id'));_0x1fdd6f[_0x3f92('0x70')](_0x3f92('0x92'),_[_0x3f92('0x35')](_0x5cc941,'id'));}});})[_0x3f92('0x1b')](function(){if(_0x57d56f[_0x3f92('0x8f')]['role']==='agent'&&!_0x51275a&&!_0x57d56f[_0x3f92('0x3a')]['MailAccountId'])return[];return db['sequelize'][_0x3f92('0x3a')](_0x2dbc88['toString'](),_0x422a25);})['then'](function(_0x58becd){_0x27187b[_0x3f92('0x17')]=_0x58becd[_0x3f92('0x3f')];if(_0x27187b['count']===0x0)return[];return db['sequelize'][_0x3f92('0x3a')](_0xf2aaea[_0x3f92('0x93')](),_0x422a25)['then'](function(_0x31ee89){_0x2487f5=_[_0x3f92('0x94')](_0x31ee89,'id');_0x422a25=_[_0x3f92('0x95')](_0x422a25,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57d56f[_0x3f92('0x3a')][_0x3f92('0x3d')]){_0x56177e['attributes']['forEach'](function(_0x2a4d0d){_0x1fdd6f[_0x3f92('0x45')]('i.'+_0x2a4d0d);});}else{_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x88'),_0x3f92('0x5c'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x96'),_0x3f92('0x97'));_0x1fdd6f['field'](_0x3f92('0x98'),_0x3f92('0x99'));_0x1fdd6f['field'](_0x3f92('0x9a'),_0x3f92('0x9b'));_0x1fdd6f['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x3f92('0x89'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x85'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x9c'));_0x1fdd6f[_0x3f92('0x45')]('i.updatedAt');_0x1fdd6f[_0x3f92('0x45')]('i.closed');_0x1fdd6f[_0x3f92('0x45')]('i.closedAt');_0x1fdd6f['field']('i.attach');_0x1fdd6f['field'](_0x3f92('0x9d'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x9e'));_0x1fdd6f[_0x3f92('0x45')]('i.subject');_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0x9f'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa0'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa1'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa2'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa3'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa4'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa5'));_0x1fdd6f[_0x3f92('0x45')]('i.UserId');_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa6'),_0x3f92('0xa7'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xa8'),'Contact.lastName');_0x1fdd6f[_0x3f92('0x45')]('c.email','Contact.email');_0x1fdd6f[_0x3f92('0x45')]('c.phone',_0x3f92('0xa9'));_0x1fdd6f[_0x3f92('0x45')](_0x3f92('0xaa'),_0x3f92('0xab'));_0x1fdd6f['field']('c.fax',_0x3f92('0xac'));_0x1fdd6f['field'](_0x3f92('0xad'),_0x3f92('0xae'));_0x1fdd6f['field'](_0x3f92('0xaf'),'Owner.internal');_0x1fdd6f['field'](_0x3f92('0xb0'),_0x3f92('0x24'));}if(_0x56177e['limit'])_0x1fdd6f[_0x3f92('0x16')](_0x56177e[_0x3f92('0x16')]);if(_0x56177e[_0x3f92('0x14')])_0x1fdd6f[_0x3f92('0x14')](_0x56177e['offset']);return db['sequelize'][_0x3f92('0x3a')](_0x1fdd6f['toString'](),_0x422a25);})[_0x3f92('0x1b')](function(_0x3ee7dd){if(_0x3ee7dd[_0x3f92('0x3f')]>0x0)_0x522e92[_0x3f92('0x70')]('ui.MailInteractionId\x20IN\x20?',_[_0x3f92('0x35')](_0x3ee7dd,'id'));return db[_0x3f92('0xb1')][_0x3f92('0x3a')](_0x522e92[_0x3f92('0x93')](),_0x422a25)[_0x3f92('0x1b')](function(_0x23b858){var _0x2b4934=_[_0x3f92('0xb2')](_0x23b858,_0x3f92('0xb3'));var _0x53ed72=[];return db[_0x3f92('0xb4')][_0x3f92('0x28')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x53bd87){var _0x4f38b4=_0x53bd87[_0x3f92('0xb5')];_0x3ee7dd[_0x3f92('0x68')](function(_0x50a0cc){_0x53ed72[_0x3f92('0x27')](updateMailInteraction(_0x50a0cc,_0x2487f5,_0x2b4934,_0x4f38b4));});return BPromise[_0x3f92('0xb6')](_0x53ed72);});});});})[_0x3f92('0x1b')](function(_0x3c0fd0){_0x27187b[_0x3f92('0xb7')]=_0x3c0fd0;return _0x27187b;})['then'](respondWithFilteredResult(_0x2a52f6,_0x56177e))[_0x3f92('0x2d')](handleError(_0x2a52f6,null));};exports['show']=function(_0x2ba28e,_0xe21d83){var _0x3e08f8={'raw':![],'where':{'id':_0x2ba28e[_0x3f92('0xb8')]['id']}},_0x184f7d={};_0x184f7d[_0x3f92('0x39')]=_['keys'](db[_0x3f92('0xb9')]['rawAttributes']);_0x184f7d[_0x3f92('0x3a')]=_[_0x3f92('0x6c')](_0x2ba28e[_0x3f92('0x3a')]);_0x184f7d[_0x3f92('0x3b')]=_['intersection'](_0x184f7d['model'],_0x184f7d[_0x3f92('0x3a')]);_0x3e08f8[_0x3f92('0x3e')]=_['intersection'](_0x184f7d['model'],qs[_0x3f92('0x3d')](_0x2ba28e[_0x3f92('0x3a')][_0x3f92('0x3d')]));_0x3e08f8[_0x3f92('0x3e')]=_0x3e08f8['attributes']['length']?_0x3e08f8['attributes']:_0x184f7d[_0x3f92('0x39')];if(_0x2ba28e[_0x3f92('0x3a')]['includeAll']){_0x3e08f8[_0x3f92('0xba')]=[{'all':!![]}];}_0x3e08f8=_[_0x3f92('0x95')]({},_0x3e08f8,_0x2ba28e[_0x3f92('0xbb')]);return db[_0x3f92('0xb9')]['find'](_0x3e08f8)['then'](handleEntityNotFound(_0xe21d83,null))[_0x3f92('0x1b')](respondWithResult(_0xe21d83,null))[_0x3f92('0x2d')](handleError(_0xe21d83,null));};exports[_0x3f92('0xbc')]=function(_0x4f218c,_0x9a5541){return db['MailInteraction'][_0x3f92('0xbc')](_0x4f218c[_0x3f92('0xbd')],{})['then'](respondWithResult(_0x9a5541,0xc9))[_0x3f92('0x2d')](handleError(_0x9a5541,null));};exports[_0x3f92('0x1a')]=function(_0x2f96b8,_0x481d0f){if(_0x2f96b8[_0x3f92('0xbd')]['id']){delete _0x2f96b8[_0x3f92('0xbd')]['id'];}return db[_0x3f92('0xb9')][_0x3f92('0x5b')]({'where':{'id':_0x2f96b8[_0x3f92('0xb8')]['id']}})[_0x3f92('0x1b')](handleEntityNotFound(_0x481d0f,null))[_0x3f92('0x1b')](saveUpdates(_0x2f96b8[_0x3f92('0xbd')],null))[_0x3f92('0x1b')](respondWithResult(_0x481d0f,null))['catch'](handleError(_0x481d0f,null));};exports[_0x3f92('0x1c')]=function(_0x1e4bfe,_0x25f15d){return db[_0x3f92('0xb9')][_0x3f92('0x5b')]({'where':{'id':_0x1e4bfe[_0x3f92('0xb8')]['id']}})['then'](handleEntityNotFound(_0x25f15d,null))[_0x3f92('0x1b')](removeEntity(_0x25f15d,null))[_0x3f92('0x2d')](handleError(_0x25f15d,null));};exports[_0x3f92('0xbe')]=function(_0x475c8a,_0x3e71f3){return db[_0x3f92('0xb9')][_0x3f92('0xbe')]()['then'](respondWithResult(_0x3e71f3,null))['catch'](handleError(_0x3e71f3,null));};exports[_0x3f92('0xbf')]=function(_0x568a89,_0x30c837){return db['MailMessage'][_0x3f92('0x5b')]({'where':{'id':_0x568a89['params']['id']}})[_0x3f92('0x1b')](handleEntityNotFound(_0x30c837,null))[_0x3f92('0x1b')](function(_0x235867){if(_0x235867){return _0x235867['addMessage'](_0x568a89[_0x3f92('0xbd')]['ids'],_['omit'](_0x568a89['body'],[_0x3f92('0xc0'),'id'])||{});}})[_0x3f92('0x1b')](respondWithResult(_0x30c837,null))[_0x3f92('0x2d')](handleError(_0x30c837,null));};exports['getMessages']=function(_0x5626af,_0x19b1a2){var _0xf60fff={'raw':![],'where':{}};var _0x129b09={};var _0x51a864={'count':0x0,'rows':[]};return db[_0x3f92('0xb9')][_0x3f92('0x28')]({'where':{'id':_0x5626af['params']['id']}})[_0x3f92('0x1b')](handleEntityNotFound(_0x19b1a2,null))[_0x3f92('0x1b')](function(_0x4e2e9b){if(_0x4e2e9b){_0x129b09[_0x3f92('0x39')]=_[_0x3f92('0x6c')](db[_0x3f92('0xc1')][_0x3f92('0xc2')]);_0x129b09[_0x3f92('0x3a')]=_[_0x3f92('0x6c')](_0x5626af['query']);_0x129b09[_0x3f92('0x3b')]=_[_0x3f92('0x3c')](_0x129b09[_0x3f92('0x39')],_0x129b09[_0x3f92('0x3a')]);_0xf60fff['attributes']=_[_0x3f92('0x3c')](_0x129b09[_0x3f92('0x39')],qs[_0x3f92('0x3d')](_0x5626af[_0x3f92('0x3a')][_0x3f92('0x3d')]));_0xf60fff[_0x3f92('0x3e')]=_0xf60fff[_0x3f92('0x3e')]['length']?_0xf60fff[_0x3f92('0x3e')]:_0x129b09[_0x3f92('0x39')];if(!_0x5626af[_0x3f92('0x3a')][_0x3f92('0xc3')](_0x3f92('0x40'))){_0xf60fff[_0x3f92('0x16')]=qs['limit'](_0x5626af[_0x3f92('0x3a')][_0x3f92('0x16')]);_0xf60fff[_0x3f92('0x14')]=qs[_0x3f92('0x14')](_0x5626af[_0x3f92('0x3a')][_0x3f92('0x14')]);}_0xf60fff[_0x3f92('0x41')]=qs['sort'](_0x5626af[_0x3f92('0x3a')][_0x3f92('0x42')]);_0xf60fff[_0x3f92('0x70')]=qs['filters'](_['pick'](_0x5626af[_0x3f92('0x3a')],_0x129b09[_0x3f92('0x3b')]));_0xf60fff['where'][_0x3f92('0xb3')]=_0x4e2e9b['id'];if(_0x5626af[_0x3f92('0x3a')][_0x3f92('0x7e')]){_0xf60fff[_0x3f92('0x70')]=_['merge'](_0xf60fff[_0x3f92('0x70')],{'$or':_[_0x3f92('0x35')](_0xf60fff[_0x3f92('0x3e')],function(_0x23d8c6){var _0x1d65e5={};_0x1d65e5[_0x23d8c6]={'$like':'%'+_0x5626af['query'][_0x3f92('0x7e')]+'%'};return _0x1d65e5;})});}if(_0x5626af['query'][_0x3f92('0x74')]){var _0x214f1d=_0x5626af[_0x3f92('0x3a')][_0x3f92('0x74')]['split'](',');var _0x473781={};_0x473781[_0x214f1d[0x0]]={'$gte':moment(_0x214f1d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xf60fff[_0x3f92('0x70')]=_['merge'](_0xf60fff[_0x3f92('0x70')],_0x473781);}_0xf60fff=_['merge']({},_0xf60fff,_0x5626af[_0x3f92('0xbb')]);return db[_0x3f92('0xc1')][_0x3f92('0x17')]({'where':_0xf60fff[_0x3f92('0x70')]})[_0x3f92('0x1b')](function(_0x45258f){_0x51a864[_0x3f92('0x17')]=_0x45258f;if(_0x5626af[_0x3f92('0x3a')][_0x3f92('0xc4')]){_0xf60fff[_0x3f92('0xba')]=[{'all':!![]}];}return db['MailMessage'][_0x3f92('0xc5')](_0xf60fff);})[_0x3f92('0x1b')](function(_0x5d24c4){if(_0x5626af[_0x3f92('0x3a')][_0x3f92('0xc6')]==='true'){for(var _0x3cebe0=0x0;_0x3cebe0<_0x5d24c4[_0x3f92('0x3f')];_0x3cebe0++){_0x5d24c4[_0x3cebe0][_0x3f92('0xbd')]=juice(_0x5d24c4[_0x3cebe0][_0x3f92('0xbd')]);}}_0x51a864['rows']=_0x5d24c4;return _0x51a864;});}})[_0x3f92('0x1b')](respondWithFilteredResult(_0x19b1a2,_0xf60fff))[_0x3f92('0x2d')](handleError(_0x19b1a2,null));};exports['addTags']=function(_0x75163,_0x515482){return db[_0x3f92('0xb9')][_0x3f92('0x5b')]({'where':{'id':_0x75163['params']['id']}})[_0x3f92('0x1b')](handleEntityNotFound(_0x515482,null))[_0x3f92('0x1b')](function(_0x654680){if(_0x654680){return _0x654680[_0x3f92('0xc7')](_0x75163['body']['ids'],_['omit'](_0x75163[_0x3f92('0xbd')],[_0x3f92('0xc0'),'id'])||{})[_0x3f92('0xc8')](function(){return db[_0x3f92('0x67')][_0x3f92('0xc5')]({'attributes':['id',_0x3f92('0x20'),_0x3f92('0x46')],'where':{'id':_0x75163[_0x3f92('0xbd')][_0x3f92('0xc0')]}});})['then'](function(_0x1d82a1){socket['emit'](_0x3f92('0xc9'),{'id':Number(_0x75163['params']['id']),'tags':_0x1d82a1||[]});return{'id':Number(_0x75163['params']['id']),'tags':_0x1d82a1||[]};});}})['then'](respondWithResult(_0x515482,null))[_0x3f92('0x2d')](handleError(_0x515482,null));};exports[_0x3f92('0xca')]=function(_0x40f7a1,_0x27fdf5){return db['MailInteraction'][_0x3f92('0x5b')]({'where':{'id':_0x40f7a1['params']['id']}})['then'](handleEntityNotFound(_0x27fdf5,null))[_0x3f92('0x1b')](function(_0xdda972){if(_0xdda972){return _0xdda972['removeTags'](_0x40f7a1[_0x3f92('0x3a')][_0x3f92('0xc0')]);}})[_0x3f92('0x1b')](respondWithStatusCode(_0x27fdf5,null))[_0x3f92('0x2d')](handleError(_0x27fdf5,null));};exports['download']=function(_0x53399b,_0x46e5a9){var _0x5698d3=moment()['unix']()[_0x3f92('0x93')]();var _0x3777fc=path[_0x3f92('0xcb')](config[_0x3f92('0xcc')],_0x3f92('0xcd'),_0x3f92('0xce'),_0x3f92('0xcf'));var _0x1d9bb1=path[_0x3f92('0xcb')](config[_0x3f92('0xcc')],_0x3f92('0xcd'),'files',_0x3f92('0xd0'));var _0x2c57f5=path[_0x3f92('0xcb')](_0x3777fc,_0x5698d3);var _0x48cda6=util[_0x3f92('0xd1')](_0x3f92('0xd2'),_0x53399b[_0x3f92('0xb8')]['id'],_0x5698d3);var _0x4360d3=path[_0x3f92('0xcb')](_0x3777fc,_0x48cda6);var _0x42dbd5=[];if(_0x53399b[_0x3f92('0x3a')][_0x3f92('0xd0')]){_0x42dbd5['push']({'model':db['Attachment'],'as':_0x3f92('0xd3'),'raw':!![]});}var _0x3f65f3=[{'model':db['MailMessage'],'as':_0x3f92('0xd4'),'attributes':['id','body','from','to','cc','bcc',_0x3f92('0xd5'),_0x3f92('0x72')],'where':{'secret':![]},'order':qs[_0x3f92('0x42')]('id'),'include':_0x42dbd5}];return db[_0x3f92('0xb9')][_0x3f92('0x5b')]({'where':{'id':_0x53399b['params']['id']},'include':_0x3f65f3})[_0x3f92('0x1b')](handleEntityNotFound(_0x46e5a9,null))[_0x3f92('0x1b')](function(_0x2cd76b){if(_0x2cd76b&&_0x2cd76b[_0x3f92('0xd4')]){var _0x37e77d=_0x2cd76b[_0x3f92('0xd6')]({'plain':!![]});fs[_0x3f92('0xd7')](_0x2c57f5);return BPromise['each'](_0x37e77d[_0x3f92('0xd4')],function(_0x1add77,_0x85c930){var _0x5ad9db={'from':_0x1add77[_0x3f92('0x47')],'to':_0x1add77['to'],'subject':_0x1add77[_0x3f92('0xd5')],'html':htmlEntities[_0x3f92('0xd8')](_0x1add77[_0x3f92('0xbd')]),'headers':{'Date':moment(_0x1add77['createdAt'])[_0x3f92('0xd1')](_0x3f92('0xd9'))},'attachments':[]};if(_0x1add77['cc']){_0x5ad9db[_0x3f92('0xda')]['Cc']=_0x1add77['cc'];}if(_0x1add77[_0x3f92('0xdb')]){_0x5ad9db[_0x3f92('0xda')][_0x3f92('0xdc')]=_0x1add77[_0x3f92('0xdb')];}return new BPromise(function(_0x4616e4,_0x40e715){if(_0x1add77[_0x3f92('0xd3')]){for(var _0x5ece5d=0x0;_0x5ece5d<_0x1add77[_0x3f92('0xd3')][_0x3f92('0x3f')];_0x5ece5d++){var _0x2c74fc=_0x1add77[_0x3f92('0xd3')][_0x5ece5d];var _0x98ff6e=path[_0x3f92('0xcb')](_0x1d9bb1,_0x2c74fc[_0x3f92('0xdd')]);if(fs['existsSync'](_0x98ff6e)){_0x5ad9db['attachments'][_0x3f92('0x27')]({'name':_0x2c74fc[_0x3f92('0x20')],'contentType':_0x2c74fc[_0x3f92('0x37')],'data':fs[_0x3f92('0xde')](_0x98ff6e)});}}}emlformat['build'](_0x5ad9db,function(_0x5ca521,_0x3093ef){if(_0x5ca521)return _0x40e715(_0x5ca521);fs[_0x3f92('0xdf')](path[_0x3f92('0xcb')](_0x2c57f5,util[_0x3f92('0xd1')](_0x3f92('0xe0'),_0x85c930)),_0x3093ef);return _0x4616e4(_0x3093ef);});});})['then'](function(){return new BPromise(function(_0x33e749,_0x2a2468){zipdir(_0x2c57f5,{'saveTo':_0x4360d3},function(_0x3027ad,_0x51a056){if(_0x3027ad)return _0x2a2468(_0x3027ad);return _0x33e749(_0x51a056);});})[_0x3f92('0x1b')](function(){return new BPromise(function(_0x505fa5,_0x2473ba){rimraf(_0x2c57f5,function(_0x80289f){if(_0x80289f)_0x2473ba(_0x80289f);return _0x505fa5();});});})[_0x3f92('0x1b')](function(){return _0x46e5a9[_0x3f92('0xe1')](_0x4360d3,_0x48cda6,function(_0x28c106){if(!_0x28c106)fs['unlinkSync'](_0x4360d3);});});});}else{return _0x46e5a9['sendStatus'](0xc8);}})[_0x3f92('0x2d')](handleError(_0x46e5a9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 89441a6..f734187 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 _0x9bc1=['then','setDataValue','Users','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x31ae8c,_0x15dd90){var _0x30e30b=function(_0x33676b){while(--_0x33676b){_0x31ae8c['push'](_0x31ae8c['shift']());}};_0x30e30b(++_0x15dd90);}(_0x9bc1,0x1b1));var _0x19bc=function(_0x349080,_0x485b71){_0x349080=_0x349080-0x0;var _0x1ef849=_0x9bc1[_0x349080];return _0x1ef849;};'use strict';var EventEmitter=require(_0x19bc('0x0'));var MailInteraction=require(_0x19bc('0x1'))['db'][_0x19bc('0x2')];var MailMessage=require(_0x19bc('0x1'))['db'][_0x19bc('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x19bc('0x4')](0x0);var events={'afterCreate':_0x19bc('0x5'),'afterUpdate':_0x19bc('0x6'),'afterDestroy':_0x19bc('0x7')};function emitEvent(_0x4f028e){return function(_0x215a9f,_0x16bf0b,_0x32fc9b){_0x215a9f[_0x19bc('0x8')]({'attributes':['id'],'raw':!![]})[_0x19bc('0x9')](function(_0x5be244){_0x215a9f[_0x19bc('0xa')](_0x19bc('0xb'),_0x5be244['map'](function(_0x41c2e0){return{'id':_0x41c2e0['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x215a9f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x19bc('0x9')](function(_0xa0805c){_0x215a9f[_0x19bc('0xa')]('unreadMessages',_0xa0805c['length']);MailInteractionEvents['emit'](_0x4f028e+':'+_0x215a9f['id'],_0x215a9f);MailInteractionEvents[_0x19bc('0xc')](_0x4f028e,_0x215a9f);_0x32fc9b(null);})[_0x19bc('0xd')](_0x32fc9b(null));};}for(var e in events){if(events[_0x19bc('0xe')](e)){var event=events[e];MailInteraction[_0x19bc('0xf')](e,emitEvent(event));}}module[_0x19bc('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xb948=['hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','emit','catch','hasOwnProperty'];(function(_0x16a2f6,_0x2464ad){var _0x2392dd=function(_0xd88a12){while(--_0xd88a12){_0x16a2f6['push'](_0x16a2f6['shift']());}};_0x2392dd(++_0x2464ad);}(_0xb948,0x134));var _0x8b94=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xb948[_0x5b6cf1];return _0x46278c;};'use strict';var EventEmitter=require(_0x8b94('0x0'));var MailInteraction=require(_0x8b94('0x1'))['db'][_0x8b94('0x2')];var MailMessage=require(_0x8b94('0x1'))['db'][_0x8b94('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8b94('0x4')](0x0);var events={'afterCreate':_0x8b94('0x5'),'afterUpdate':_0x8b94('0x6'),'afterDestroy':_0x8b94('0x7')};function emitEvent(_0x1f507f){return function(_0x5dbc87,_0x407936,_0x20c15b){_0x5dbc87[_0x8b94('0x8')]({'attributes':['id'],'raw':!![]})[_0x8b94('0x9')](function(_0x3d6e8b){_0x5dbc87[_0x8b94('0xa')](_0x8b94('0xb'),_0x3d6e8b['map'](function(_0x6472c7){return{'id':_0x6472c7['id']};}));return MailMessage[_0x8b94('0xc')]({'where':{'MailInteractionId':_0x5dbc87['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8b94('0x9')](function(_0x24dcae){_0x5dbc87[_0x8b94('0xa')]('unreadMessages',_0x24dcae['length']);MailInteractionEvents[_0x8b94('0xd')](_0x1f507f+':'+_0x5dbc87['id'],_0x5dbc87);MailInteractionEvents[_0x8b94('0xd')](_0x1f507f,_0x5dbc87);_0x20c15b(null);})[_0x8b94('0xe')](_0x20c15b(null));};}for(var e in events){if(events[_0x8b94('0xf')](e)){var event=events[e];MailInteraction[_0x8b94('0x10')](e,emitEvent(event));}}module[_0x8b94('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 30caca2..50ba5c2 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 _0xd533=['closed','closedAt','substatus','changed','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xd533,0x1d6));var _0x3d53=function(_0x1d4e42,_0x2b4631){_0x1d4e42=_0x1d4e42-0x0;var _0x320a1a=_0xd533[_0x1d4e42];return _0x320a1a;};'use strict';var _=require(_0x3d53('0x0'));var util=require(_0x3d53('0x1'));var logger=require(_0x3d53('0x2'))(_0x3d53('0x3'));var moment=require(_0x3d53('0x4'));var BPromise=require(_0x3d53('0x5'));var rp=require(_0x3d53('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d53('0x7'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x3d53('0x8')]=function(_0x31d9e0,_0x4668e5){return _0x31d9e0[_0x3d53('0x9')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x3d53('0xa'),'fields':[_0x3d53('0xb'),'to'],'type':_0x3d53('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x369e77,_0x530e60,_0x5ab330){if(_0x369e77['substatus']){_0x369e77[_0x3d53('0xd')]=moment()[_0x3d53('0xe')](_0x3d53('0xf'));}if(_0x369e77[_0x3d53('0x10')]){_0x369e77[_0x3d53('0x11')]=moment()[_0x3d53('0xe')](_0x3d53('0xf'));}_0x5ab330(null,_0x530e60);},'beforeUpdate':function(_0x426b01,_0x1c34bd,_0x81adcb){if(_0x426b01['changed'](_0x3d53('0x12'))){_0x426b01[_0x3d53('0xd')]=_0x426b01[_0x3d53('0x12')]?moment()['format'](_0x3d53('0xf')):null;}if(_0x426b01[_0x3d53('0x13')]('closed')){_0x426b01[_0x3d53('0x11')]=moment()['format'](_0x3d53('0xf'));_0x426b01[_0x3d53('0x12')]=null;_0x426b01[_0x3d53('0xd')]=null;}_0x81adcb(null,_0x426b01);},'afterUpdate':function(_0x414091,_0x3eb846,_0x10a28c){var _0x3eceab=_0x31d9e0[_0x3d53('0x14')];var _0x1e12f3=_0x414091[_0x3d53('0x15')]({'plain':!![]});if(_0x1e12f3['closed']){return _0x3eceab[_0x3d53('0x16')][_0x3d53('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x1e12f3['id']}})[_0x3d53('0x18')](function(){_0x10a28c();})[_0x3d53('0x19')](function(_0x12d719){_0x10a28c(_0x12d719);});}else{_0x10a28c();}}},'charset':'utf8mb4','collate':_0x3d53('0x1a')});}; \ No newline at end of file +var _0xc330=['fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions'];(function(_0x43f100,_0x5504d0){var _0x2c29c1=function(_0x48697b){while(--_0x48697b){_0x43f100['push'](_0x43f100['shift']());}};_0x2c29c1(++_0x5504d0);}(_0xc330,0x1ed));var _0x0c33=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc330[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x0c33('0x0'));var util=require(_0x0c33('0x1'));var logger=require('../../config/logger')(_0x0c33('0x2'));var moment=require(_0x0c33('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c33('0x4'));var rimraf=require(_0x0c33('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c33('0x6'));module[_0x0c33('0x7')]=function(_0xfe5c55,_0x3df30d){return _0xfe5c55[_0x0c33('0x8')](_0x0c33('0x9'),attributes,{'tableName':_0x0c33('0xa'),'paranoid':![],'indexes':[{'name':_0x0c33('0xb'),'fields':[_0x0c33('0xc'),'to'],'type':_0x0c33('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcd4e36,_0x43ff89,_0x17e24d){if(_0xcd4e36[_0x0c33('0xe')]){_0xcd4e36[_0x0c33('0xf')]=moment()[_0x0c33('0x10')](_0x0c33('0x11'));}if(_0xcd4e36[_0x0c33('0x12')]){_0xcd4e36[_0x0c33('0x13')]=moment()['format'](_0x0c33('0x11'));}_0x17e24d(null,_0x43ff89);},'beforeUpdate':function(_0x16ca80,_0x3290ef,_0x319f5f){if(_0x16ca80['changed']('substatus')){_0x16ca80[_0x0c33('0xf')]=_0x16ca80[_0x0c33('0xe')]?moment()[_0x0c33('0x10')](_0x0c33('0x11')):null;}if(_0x16ca80[_0x0c33('0x14')](_0x0c33('0x12'))){_0x16ca80[_0x0c33('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x16ca80[_0x0c33('0xe')]=null;_0x16ca80['substatusAt']=null;}_0x319f5f(null,_0x16ca80);},'afterUpdate':function(_0x5a2afe,_0x26e9e3,_0x57a545){var _0xf23aac=_0xfe5c55[_0x0c33('0x15')];var _0x448ab1=_0x5a2afe[_0x0c33('0x16')]({'plain':!![]});if(_0x448ab1[_0x0c33('0x12')]){return _0xf23aac['MailMessage'][_0x0c33('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x448ab1['id']}})[_0x0c33('0x18')](function(){_0x57a545();})[_0x0c33('0x19')](function(_0x4516c2){_0x57a545(_0x4516c2);});}else{_0x57a545();}}},'charset':_0x0c33('0x1a'),'collate':_0x0c33('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 90f2a85..5eaaf17 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 _0x9303=['error','code','message','catch','MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x2a069d,_0x19a3f3){var _0x4b2fb7=function(_0x259e0b){while(--_0x259e0b){_0x2a069d['push'](_0x2a069d['shift']());}};_0x4b2fb7(++_0x19a3f3);}(_0x9303,0xd7));var _0x3930=function(_0x4ec119,_0x5e20f7){_0x4ec119=_0x4ec119-0x0;var _0x1f45a9=_0x9303[_0x4ec119];return _0x1f45a9;};'use strict';var _=require(_0x3930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3930('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3930('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3930('0x3'))(_0x3930('0x4'));var config=require(_0x3930('0x5'));var jayson=require(_0x3930('0x6'));var client=jayson['client'][_0x3930('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3930('0x8')],{'host':_0x3930('0x9'),'port':0x18eb});var socket=require(_0x3930('0xa'))(new Redis(config[_0x3930('0x8')]));require(_0x3930('0xb'))['register'](socket);function respondWithRpcPromise(_0x5d5aef,_0x104088,_0x5c19e3){return new BPromise(function(_0x5269b3,_0x5503a7){return client[_0x3930('0xc')](_0x5d5aef,_0x5c19e3)[_0x3930('0xd')](function(_0x417b9c){logger[_0x3930('0xe')](_0x3930('0xf'),_0x104088,'request\x20sent');logger[_0x3930('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x104088,_0x3930('0x11'),JSON[_0x3930('0x12')](_0x417b9c));if(_0x417b9c[_0x3930('0x13')]){if(_0x417b9c['error'][_0x3930('0x14')]===0x1f4){logger[_0x3930('0x13')]('MailInteraction,\x20%s,\x20%s',_0x104088,_0x417b9c[_0x3930('0x13')][_0x3930('0x15')]);return _0x5503a7(_0x417b9c[_0x3930('0x13')][_0x3930('0x15')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x104088,_0x417b9c[_0x3930('0x13')]['message']);return _0x5269b3(_0x417b9c[_0x3930('0x13')]['message']);}else{logger[_0x3930('0xe')](_0x3930('0xf'),_0x104088,'request\x20sent');_0x5269b3(_0x417b9c['result']['message']);}})[_0x3930('0x16')](function(_0x1462db){logger[_0x3930('0x13')]('MailInteraction,\x20%s,\x20%s',_0x104088,_0x1462db);_0x5503a7(_0x1462db);});});}exports['UpdateMailInteraction']=function(_0x4f4e2e){var _0x5a2501=this;return new Promise(function(_0x3400f5,_0x2ba9ba){return db[_0x3930('0x17')][_0x3930('0x18')](_0x4f4e2e[_0x3930('0x19')],{'raw':_0x4f4e2e['options']?_0x4f4e2e[_0x3930('0x1a')][_0x3930('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f4e2e[_0x3930('0x1a')]?_0x4f4e2e['options'][_0x3930('0x1c')]||null:null,'attributes':_0x4f4e2e[_0x3930('0x1a')]?_0x4f4e2e[_0x3930('0x1a')][_0x3930('0x1d')]||null:null,'limit':_0x4f4e2e[_0x3930('0x1a')]?_0x4f4e2e[_0x3930('0x1a')][_0x3930('0x1e')]||null:null})[_0x3930('0xd')](function(_0x569cee){logger[_0x3930('0xe')](_0x3930('0x1f'),_0x4f4e2e);logger[_0x3930('0x10')](_0x3930('0x1f'),_0x4f4e2e,JSON[_0x3930('0x12')](_0x569cee));_0x3400f5(_0x569cee);})['catch'](function(_0x276940){logger[_0x3930('0x13')](_0x3930('0x1f'),_0x276940['message'],_0x4f4e2e);_0x2ba9ba(_0x5a2501[_0x3930('0x13')](0x1f4,_0x276940[_0x3930('0x15')]));});});};exports[_0x3930('0x20')]=function(_0x423fe6){return new Promise(function(_0x582b18,_0x575e76){return db[_0x3930('0x17')][_0x3930('0x21')]({'where':_0x423fe6[_0x3930('0x1a')]?_0x423fe6['options'][_0x3930('0x1c')]||null:null})[_0x3930('0xd')](function(_0x63acd5){if(_0x63acd5){return _0x63acd5[_0x3930('0x22')](_0x423fe6[_0x3930('0x19')][_0x3930('0x23')],_[_0x3930('0x24')](_0x423fe6[_0x3930('0x19')],[_0x3930('0x23'),'id'])||{});}})[_0x3930('0x25')](function(_0x43c17f){logger[_0x3930('0xe')](_0x3930('0x26'),_0x423fe6);logger[_0x3930('0x10')](_0x3930('0x26'),_0x423fe6,JSON[_0x3930('0x12')](_0x43c17f));_0x582b18(_0x43c17f);})[_0x3930('0x16')](function(_0x154a5e){logger[_0x3930('0x13')](_0x3930('0x26'),_0x154a5e['message'],_0x423fe6);_0x575e76(_this['error'](0x1f4,_0x154a5e['message']));});});}; \ No newline at end of file +var _0x5a4f=['addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','MailInteraction','find'];(function(_0x52ebb2,_0x4571e0){var _0x38951b=function(_0x584045){while(--_0x584045){_0x52ebb2['push'](_0x52ebb2['shift']());}};_0x38951b(++_0x4571e0);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5a4f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xf5a4('0x0'));var util=require('util');var moment=require(_0xf5a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a4('0x3'))['db'];var utils=require(_0xf5a4('0x4'));var logger=require(_0xf5a4('0x5'))(_0xf5a4('0x6'));var config=require(_0xf5a4('0x7'));var jayson=require(_0xf5a4('0x8'));var client=jayson[_0xf5a4('0x9')]['http']({'port':0x232a});config[_0xf5a4('0xa')]=_[_0xf5a4('0xb')](config[_0xf5a4('0xa')],{'host':_0xf5a4('0xc'),'port':0x18eb});var socket=require(_0xf5a4('0xd'))(new Redis(config[_0xf5a4('0xa')]));require(_0xf5a4('0xe'))[_0xf5a4('0xf')](socket);function respondWithRpcPromise(_0x63560e,_0xdb88b7,_0x3cdf31){return new BPromise(function(_0x548bc2,_0x1a9dc4){return client[_0xf5a4('0x10')](_0x63560e,_0x3cdf31)[_0xf5a4('0x11')](function(_0x410121){logger[_0xf5a4('0x12')](_0xf5a4('0x13'),_0xdb88b7,'request\x20sent');logger[_0xf5a4('0x14')](_0xf5a4('0x15'),_0xdb88b7,_0xf5a4('0x16'),JSON[_0xf5a4('0x17')](_0x410121));if(_0x410121[_0xf5a4('0x18')]){if(_0x410121[_0xf5a4('0x18')][_0xf5a4('0x19')]===0x1f4){logger['error'](_0xf5a4('0x13'),_0xdb88b7,_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);return _0x1a9dc4(_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);}logger[_0xf5a4('0x18')]('MailInteraction,\x20%s,\x20%s',_0xdb88b7,_0x410121[_0xf5a4('0x18')][_0xf5a4('0x1a')]);return _0x548bc2(_0x410121['error'][_0xf5a4('0x1a')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0xdb88b7,_0xf5a4('0x16'));_0x548bc2(_0x410121[_0xf5a4('0x1b')][_0xf5a4('0x1a')]);}})[_0xf5a4('0x1c')](function(_0x3a7acf){logger[_0xf5a4('0x18')](_0xf5a4('0x13'),_0xdb88b7,_0x3a7acf);_0x1a9dc4(_0x3a7acf);});});}exports[_0xf5a4('0x1d')]=function(_0x53c4b8){var _0x2db61d=this;return new Promise(function(_0x37a86b,_0x4fefcb){return db['MailInteraction'][_0xf5a4('0x1e')](_0x53c4b8[_0xf5a4('0x1f')],{'raw':_0x53c4b8[_0xf5a4('0x20')]?_0x53c4b8[_0xf5a4('0x20')][_0xf5a4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53c4b8['options']?_0x53c4b8['options'][_0xf5a4('0x22')]||null:null,'attributes':_0x53c4b8[_0xf5a4('0x20')]?_0x53c4b8[_0xf5a4('0x20')][_0xf5a4('0x23')]||null:null,'limit':_0x53c4b8[_0xf5a4('0x20')]?_0x53c4b8[_0xf5a4('0x20')]['limit']||null:null})[_0xf5a4('0x11')](function(_0x3655a2){logger['info'](_0xf5a4('0x1d'),_0x53c4b8);logger['debug'](_0xf5a4('0x1d'),_0x53c4b8,JSON[_0xf5a4('0x17')](_0x3655a2));_0x37a86b(_0x3655a2);})[_0xf5a4('0x1c')](function(_0x39612c){logger['error'](_0xf5a4('0x1d'),_0x39612c[_0xf5a4('0x1a')],_0x53c4b8);_0x4fefcb(_0x2db61d[_0xf5a4('0x18')](0x1f4,_0x39612c[_0xf5a4('0x1a')]));});});};exports[_0xf5a4('0x24')]=function(_0x2859c7){return new Promise(function(_0x135d6,_0x594303){return db[_0xf5a4('0x25')][_0xf5a4('0x26')]({'where':_0x2859c7[_0xf5a4('0x20')]?_0x2859c7[_0xf5a4('0x20')][_0xf5a4('0x22')]||null:null})['then'](function(_0x2fc67){if(_0x2fc67){return _0x2fc67[_0xf5a4('0x27')](_0x2859c7[_0xf5a4('0x1f')][_0xf5a4('0x28')],_[_0xf5a4('0x29')](_0x2859c7[_0xf5a4('0x1f')],[_0xf5a4('0x28'),'id'])||{});}})[_0xf5a4('0x2a')](function(_0x20b0a7){logger['info']('AddTags',_0x2859c7);logger[_0xf5a4('0x14')](_0xf5a4('0x2b'),_0x2859c7,JSON[_0xf5a4('0x17')](_0x20b0a7));_0x135d6(_0x20b0a7);})[_0xf5a4('0x1c')](function(_0x33236c){logger['error'](_0xf5a4('0x2b'),_0x33236c[_0xf5a4('0x1a')],_0x2859c7);_0x594303(_this[_0xf5a4('0x18')](0x1f4,_0x33236c[_0xf5a4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8697c30..ac422be 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 _0x1169=['remove','update','emit','removeListener','register','length','mailInteraction:','save'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x1169,0x127));var _0x9116=function(_0x2e574e,_0x4e8faa){_0x2e574e=_0x2e574e-0x0;var _0x4f8dd9=_0x1169[_0x2e574e];return _0x4f8dd9;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x9116('0x0'),_0x9116('0x1'),_0x9116('0x2')];function createListener(_0x41c026,_0x3ecdb9){return function(_0x565647){_0x3ecdb9[_0x9116('0x3')](_0x41c026,_0x565647);};}function removeListener(_0x361963,_0x1726c5){return function(){MailInteractionEvents[_0x9116('0x4')](_0x361963,_0x1726c5);};}exports[_0x9116('0x5')]=function(_0x51ef21){for(var _0x30bd9a=0x0,_0x11f24c=events[_0x9116('0x6')];_0x30bd9a<_0x11f24c;_0x30bd9a++){var _0x354078=events[_0x30bd9a];var _0x212e3a=createListener(_0x9116('0x7')+_0x354078,_0x51ef21);MailInteractionEvents['on'](_0x354078,_0x212e3a);}}; \ No newline at end of file +var _0xd7c9=['remove','update','emit','removeListener','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x7929d8,_0x8be119){var _0x40ff94=function(_0x48beda){while(--_0x48beda){_0x7929d8['push'](_0x7929d8['shift']());}};_0x40ff94(++_0x8be119);}(_0xd7c9,0xd6));var _0x9d7c=function(_0x48f011,_0x4f4a87){_0x48f011=_0x48f011-0x0;var _0x47824e=_0xd7c9[_0x48f011];return _0x47824e;};'use strict';var MailInteractionEvents=require(_0x9d7c('0x0'));var events=[_0x9d7c('0x1'),_0x9d7c('0x2'),_0x9d7c('0x3')];function createListener(_0x42e1bd,_0x4591a0){return function(_0x85761f){_0x4591a0[_0x9d7c('0x4')](_0x42e1bd,_0x85761f);};}function removeListener(_0x401204,_0x5e437e){return function(){MailInteractionEvents[_0x9d7c('0x5')](_0x401204,_0x5e437e);};}exports['register']=function(_0x52658b){for(var _0x1a5dfc=0x0,_0xc3c139=events[_0x9d7c('0x6')];_0x1a5dfc<_0xc3c139;_0x1a5dfc++){var _0x4d4945=events[_0x1a5dfc];var _0x490587=createListener(_0x9d7c('0x7')+_0x4d4945,_0x52658b);MailInteractionEvents['on'](_0x4d4945,_0x490587);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 49b848c..4749b2b 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 _0xb350=['isAuthenticated','index','/describe','describe','show','download','post','mailmessage:create','put','accept','/:id/reject','reject','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get'];(function(_0x1f58e7,_0x228f59){var _0x3104b0=function(_0x163d8a){while(--_0x163d8a){_0x1f58e7['push'](_0x1f58e7['shift']());}};_0x3104b0(++_0x228f59);}(_0xb350,0x6f));var _0x0b35=function(_0xb2ac76,_0x2d597e){_0xb2ac76=_0xb2ac76-0x0;var _0x5b0f22=_0xb350[_0xb2ac76];return _0x5b0f22;};'use strict';var multer=require(_0x0b35('0x0'));var util=require(_0x0b35('0x1'));var path=require(_0x0b35('0x2'));var timeout=require(_0x0b35('0x3'));var express=require('express');var router=express[_0x0b35('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b35('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0b35('0x6'));var controller=require(_0x0b35('0x7'));router[_0x0b35('0x8')]('/',auth[_0x0b35('0x9')](),controller[_0x0b35('0xa')]);router[_0x0b35('0x8')](_0x0b35('0xb'),auth[_0x0b35('0x9')](),controller[_0x0b35('0xc')]);router['get']('/:id',auth[_0x0b35('0x9')](),controller[_0x0b35('0xd')]);router[_0x0b35('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x0b35('0xe')]);router[_0x0b35('0xf')]('/',auth[_0x0b35('0x9')](),interaction['tracked']('mail',_0x0b35('0x10')),controller['create']);router[_0x0b35('0x11')]('/:id',auth[_0x0b35('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x0b35('0x9')](),controller[_0x0b35('0x12')]);router[_0x0b35('0x11')](_0x0b35('0x13'),auth[_0x0b35('0x9')](),controller[_0x0b35('0x14')]);router[_0x0b35('0x15')](_0x0b35('0x16'),auth['isAuthenticated'](),controller[_0x0b35('0x17')]);module['exports']=router; \ No newline at end of file +var _0xaf09=['put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/download','download','post','mailmessage:create','create'];(function(_0x5da9bb,_0x54bec2){var _0x5518ce=function(_0x4da829){while(--_0x4da829){_0x5da9bb['push'](_0x5da9bb['shift']());}};_0x5518ce(++_0x54bec2);}(_0xaf09,0x10d));var _0x9af0=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xaf09[_0x56e4e7];return _0x383618;};'use strict';var multer=require(_0x9af0('0x0'));var util=require(_0x9af0('0x1'));var path=require(_0x9af0('0x2'));var timeout=require(_0x9af0('0x3'));var express=require(_0x9af0('0x4'));var router=express[_0x9af0('0x5')]();var fs_extra=require(_0x9af0('0x6'));var auth=require(_0x9af0('0x7'));var interaction=require(_0x9af0('0x8'));var config=require('../../config/environment');var controller=require(_0x9af0('0x9'));router['get']('/',auth[_0x9af0('0xa')](),controller[_0x9af0('0xb')]);router['get'](_0x9af0('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9af0('0xd')](_0x9af0('0xe'),auth[_0x9af0('0xa')](),controller[_0x9af0('0xf')]);router[_0x9af0('0xd')](_0x9af0('0x10'),auth[_0x9af0('0xa')](),controller[_0x9af0('0x11')]);router[_0x9af0('0x12')]('/',auth[_0x9af0('0xa')](),interaction['tracked']('mail',_0x9af0('0x13')),controller[_0x9af0('0x14')]);router[_0x9af0('0x15')]('/:id',auth[_0x9af0('0xa')](),controller[_0x9af0('0x16')]);router[_0x9af0('0x15')]('/:id/accept',auth['isAuthenticated'](),controller[_0x9af0('0x17')]);router[_0x9af0('0x15')](_0x9af0('0x18'),auth['isAuthenticated'](),controller[_0x9af0('0x19')]);router[_0x9af0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x9af0('0x1b')]);module[_0x9af0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index cfb494c..5a4ed50 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 _0x9c07=['Chat','sequelize','lodash','exports','medium','BOOLEAN','out','STRING','TEXT','DATE','INTEGER','long','ENUM','Email'];(function(_0x397369,_0x5a907e){var _0x4aa037=function(_0x163fe3){while(--_0x163fe3){_0x397369['push'](_0x397369['shift']());}};_0x4aa037(++_0x5a907e);}(_0x9c07,0x9b));var _0x79c0=function(_0x28d21a,_0x24fe7a){_0x28d21a=_0x28d21a-0x0;var _0xa7ce37=_0x9c07[_0x28d21a];return _0xa7ce37;};'use strict';var Sequelize=require(_0x79c0('0x0'));var _=require(_0x79c0('0x1'));module[_0x79c0('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x79c0('0x3'))},'read':{'type':Sequelize[_0x79c0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x79c0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x79c0('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x79c0('0x7')]('long')},'cc':{'type':Sequelize[_0x79c0('0x7')]('long')},'bcc':{'type':Sequelize[_0x79c0('0x7')]('long')},'subject':{'type':Sequelize[_0x79c0('0x7')]},'sentAt':{'type':Sequelize[_0x79c0('0x8')]},'attach':{'type':Sequelize[_0x79c0('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x79c0('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x79c0('0x8')]},'originTo':{'type':Sequelize[_0x79c0('0x7')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x79c0('0xa'))},'originChannel':{'type':Sequelize[_0x79c0('0xb')](_0x79c0('0xc'),_0x79c0('0xd')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xe195=['STRING','INTEGER','DATE','Email','exports','TEXT','long','medium','ENUM','out'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe195,0x1c6));var _0x5e19=function(_0x460c96,_0x1cf0bc){_0x460c96=_0x460c96-0x0;var _0x40f5f4=_0xe195[_0x460c96];return _0x40f5f4;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x5e19('0x0')]={'body':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e19('0x4')]('in',_0x5e19('0x5')),'defaultValue':_0x5e19('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5e19('0x6')](0x1fe)},'from':{'type':Sequelize[_0x5e19('0x6')]},'to':{'type':Sequelize['TEXT'](_0x5e19('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x5e19('0x2'))},'bcc':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x2'))},'subject':{'type':Sequelize[_0x5e19('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x5e19('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5e19('0x8')]},'originTo':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x2'))},'originCc':{'type':Sequelize[_0x5e19('0x1')](_0x5e19('0x2'))},'originChannel':{'type':Sequelize[_0x5e19('0x4')](_0x5e19('0x9'),'Chat'),'defaultValue':_0x5e19('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 554c906..5324aff 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 _0x06b0=['Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','offset','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','body','describe','create','direction','out','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','ListId','messageId','format','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','QueryTypes','event','fromString','rejectmessage','download','server','files','message-%s.eml','from','bcc','createdAt','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers'];(function(_0x106e13,_0x48a3af){var _0x4bac33=function(_0x24217e){while(--_0x24217e){_0x106e13['push'](_0x106e13['shift']());}};_0x4bac33(++_0x48a3af);}(_0x06b0,0x1e3));var _0x006b=function(_0x25cdd9,_0x630240){_0x25cdd9=_0x25cdd9-0x0;var _0x5835cf=_0x06b0[_0x25cdd9];return _0x5835cf;};'use strict';var emlformat=require(_0x006b('0x0'));var moment=require(_0x006b('0x1'));var BPromise=require(_0x006b('0x2'));var util=require(_0x006b('0x3'));var path=require(_0x006b('0x4'));var fs=require('fs');var _=require(_0x006b('0x5'));var Redis=require('ioredis');var htmlToText=require(_0x006b('0x6'));var qs=require(_0x006b('0x7'));var logger=require(_0x006b('0x8'))(_0x006b('0x9'));var interaction_log=require(_0x006b('0x8'))(_0x006b('0xa'));var config=require(_0x006b('0xb'));var db=require(_0x006b('0xc'))['db'];config[_0x006b('0xd')]=_[_0x006b('0xe')](config[_0x006b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x006b('0xd')]));var htmlEntities=require(_0x006b('0xf'));require(_0x006b('0x10'))[_0x006b('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x006b('0x12')][_0x006b('0x13')]({'port':0x232c});var client9003=jayson[_0x006b('0x12')][_0x006b('0x13')]({'port':0x232b});var client9002=jayson[_0x006b('0x12')][_0x006b('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x436f21,_0x1a592b,_0x50579a,_0x57cbd9){return new BPromise(function(_0x32882d,_0x20966d){var _0xc87551=_0x57cbd9||client;return _0xc87551[_0x006b('0x14')](_0x436f21,_0x50579a)['then'](function(_0x10641){logger[_0x006b('0x15')](_0x006b('0x16'),_0x1a592b,_0x006b('0x17'));logger['debug'](_0x006b('0x18'),_0x1a592b,'request\x20sent',JSON[_0x006b('0x19')](_0x10641));if(_0x10641['error']){if(_0x10641['error'][_0x006b('0x1a')]===0x1f4){logger[_0x006b('0x1b')](_0x006b('0x16'),_0x1a592b,_0x10641[_0x006b('0x1b')][_0x006b('0x1c')]);return _0x20966d(_0x10641[_0x006b('0x1b')][_0x006b('0x1c')]);}logger[_0x006b('0x1b')](_0x006b('0x16'),_0x1a592b,_0x10641[_0x006b('0x1b')][_0x006b('0x1c')]);return _0x32882d(_0x10641[_0x006b('0x1b')]['message']);}else{logger[_0x006b('0x15')](_0x006b('0x16'),_0x1a592b,_0x006b('0x17'));_0x32882d(_0x10641[_0x006b('0x1d')][_0x006b('0x1c')]);}})[_0x006b('0x1e')](function(_0x34dec3){logger['error'](_0x006b('0x16'),_0x1a592b,_0x34dec3);_0x20966d(_0x34dec3);});});}function respondWithResult(_0x362601,_0x1a7113){_0x1a7113=_0x1a7113||0xc8;return function(_0x27e8de){if(_0x27e8de){return _0x362601[_0x006b('0x1f')](_0x1a7113)['json'](_0x27e8de);}};}function respondWithFilteredResult(_0x51427d,_0x4b888a){return function(_0x399025){if(_0x399025){var _0x4b7ffe=typeof _0x4b888a[_0x006b('0x20')]==='undefined'&&typeof _0x4b888a[_0x006b('0x21')]==='undefined';var _0x2347b1=_0x399025[_0x006b('0x22')];var _0x4bf506=_0x4b7ffe?0x0:_0x4b888a[_0x006b('0x20')];var _0x10ff9d=_0x4b7ffe?_0x399025[_0x006b('0x22')]:_0x4b888a[_0x006b('0x20')]+_0x4b888a[_0x006b('0x21')];var _0x983f8d;if(_0x10ff9d>=_0x2347b1){_0x10ff9d=_0x2347b1;_0x983f8d=0xc8;}else{_0x983f8d=0xce;}_0x51427d[_0x006b('0x1f')](_0x983f8d);return _0x51427d[_0x006b('0x23')](_0x006b('0x24'),_0x4bf506+'-'+_0x10ff9d+'/'+_0x2347b1)[_0x006b('0x25')](_0x399025);}return null;};}function saveUpdates(_0x58ad1f){return function(_0x3bbedd){if(_0x3bbedd){return _0x3bbedd[_0x006b('0x26')](_0x58ad1f)[_0x006b('0x27')](function(_0x2e569f){return _0x2e569f;});}return null;};}function removeEntity(_0x3d72ef){return function(_0xdf67a1){if(_0xdf67a1){return _0xdf67a1[_0x006b('0x28')]()[_0x006b('0x27')](function(){_0x3d72ef[_0x006b('0x1f')](0xcc)[_0x006b('0x29')]();});}};}function handleEntityNotFound(_0x5bf214){return function(_0x2cd926){if(!_0x2cd926){_0x5bf214[_0x006b('0x2a')](0x194);}return _0x2cd926;};}function handleError(_0x3cfca9,_0x14c89d){_0x14c89d=_0x14c89d||0x1f4;return function(_0x529537){logger[_0x006b('0x1b')](_0x529537['stack']);if(_0x529537[_0x006b('0x2b')]){delete _0x529537['name'];}_0x3cfca9[_0x006b('0x1f')](_0x14c89d)[_0x006b('0x2c')](_0x529537);};}exports[_0x006b('0x2d')]=function(_0x3af4ed,_0x255699){var _0x57180e={},_0x7b3e14={},_0x30a57e={'count':0x0,'rows':[]};var _0x52de45=_[_0x006b('0x2e')](db[_0x006b('0x2f')][_0x006b('0x30')],function(_0x57279f){return{'name':_0x57279f[_0x006b('0x31')],'type':_0x57279f[_0x006b('0x32')][_0x006b('0x33')]};});_0x7b3e14[_0x006b('0x34')]=_[_0x006b('0x2e')](_0x52de45,_0x006b('0x2b'));_0x7b3e14[_0x006b('0x35')]=_[_0x006b('0x36')](_0x3af4ed[_0x006b('0x35')]);_0x7b3e14[_0x006b('0x37')]=_[_0x006b('0x38')](_0x7b3e14[_0x006b('0x34')],_0x7b3e14[_0x006b('0x35')]);_0x57180e[_0x006b('0x39')]=_['intersection'](_0x7b3e14['model'],qs[_0x006b('0x3a')](_0x3af4ed[_0x006b('0x35')][_0x006b('0x3a')]));_0x57180e[_0x006b('0x39')]=_0x57180e[_0x006b('0x39')][_0x006b('0x3b')]?_0x57180e[_0x006b('0x39')]:_0x7b3e14[_0x006b('0x34')];if(!_0x3af4ed[_0x006b('0x35')][_0x006b('0x3c')](_0x006b('0x3d'))){_0x57180e[_0x006b('0x21')]=qs[_0x006b('0x21')](_0x3af4ed[_0x006b('0x35')][_0x006b('0x21')]);_0x57180e[_0x006b('0x20')]=qs[_0x006b('0x20')](_0x3af4ed[_0x006b('0x35')][_0x006b('0x20')]);}_0x57180e[_0x006b('0x3e')]=qs[_0x006b('0x3f')](_0x3af4ed[_0x006b('0x35')][_0x006b('0x3f')]);_0x57180e[_0x006b('0x40')]=qs[_0x006b('0x37')](_['pick'](_0x3af4ed[_0x006b('0x35')],_0x7b3e14['filters']),_0x52de45);if(_0x3af4ed[_0x006b('0x35')][_0x006b('0x41')]){_0x57180e[_0x006b('0x40')]=_[_0x006b('0x42')](_0x57180e[_0x006b('0x40')],{'$or':_['map'](_0x52de45,function(_0x1c9da9){if(_0x1c9da9[_0x006b('0x32')]!==_0x006b('0x43')){var _0x14d49c={};_0x14d49c[_0x1c9da9[_0x006b('0x2b')]]={'$like':'%'+_0x3af4ed[_0x006b('0x35')][_0x006b('0x41')]+'%'};return _0x14d49c;}})});}_0x57180e=_['merge']({},_0x57180e,_0x3af4ed['options']);var _0x2662f0={'where':_0x57180e[_0x006b('0x40')]};return db[_0x006b('0x2f')][_0x006b('0x22')](_0x2662f0)[_0x006b('0x27')](function(_0x4dd61d){_0x30a57e[_0x006b('0x22')]=_0x4dd61d;if(_0x3af4ed[_0x006b('0x35')][_0x006b('0x44')]){_0x57180e[_0x006b('0x45')]=[{'all':!![]}];}return db[_0x006b('0x2f')][_0x006b('0x46')](_0x57180e);})[_0x006b('0x27')](function(_0x40d012){_0x30a57e[_0x006b('0x47')]=_0x40d012;return _0x30a57e;})[_0x006b('0x27')](respondWithFilteredResult(_0x255699,_0x57180e))[_0x006b('0x1e')](handleError(_0x255699,null));};exports['show']=function(_0x538e4c,_0x11fbdd){var _0x237daa={'raw':!![],'where':{'id':_0x538e4c[_0x006b('0x48')]['id']}},_0x381fee={};_0x381fee[_0x006b('0x34')]=_[_0x006b('0x36')](db[_0x006b('0x2f')]['rawAttributes']);_0x381fee[_0x006b('0x35')]=_['keys'](_0x538e4c['query']);_0x381fee[_0x006b('0x37')]=_['intersection'](_0x381fee[_0x006b('0x34')],_0x381fee[_0x006b('0x35')]);_0x237daa['attributes']=_['intersection'](_0x381fee['model'],qs[_0x006b('0x3a')](_0x538e4c[_0x006b('0x35')][_0x006b('0x3a')]));_0x237daa[_0x006b('0x39')]=_0x237daa[_0x006b('0x39')][_0x006b('0x3b')]?_0x237daa[_0x006b('0x39')]:_0x381fee[_0x006b('0x34')];if(_0x538e4c[_0x006b('0x35')][_0x006b('0x44')]){_0x237daa[_0x006b('0x45')]=[{'all':!![]}];}_0x237daa=_['merge']({},_0x237daa,_0x538e4c[_0x006b('0x49')]);return db['MailMessage'][_0x006b('0x4a')](_0x237daa)[_0x006b('0x27')](handleEntityNotFound(_0x11fbdd,null))[_0x006b('0x27')](respondWithResult(_0x11fbdd,null))[_0x006b('0x1e')](handleError(_0x11fbdd,null));};exports[_0x006b('0x26')]=function(_0x5c31a4,_0x2b8ad2){if(_0x5c31a4[_0x006b('0x4b')]['id']){delete _0x5c31a4[_0x006b('0x4b')]['id'];}return db[_0x006b('0x2f')][_0x006b('0x4a')]({'where':{'id':_0x5c31a4[_0x006b('0x48')]['id']}})[_0x006b('0x27')](handleEntityNotFound(_0x2b8ad2,null))[_0x006b('0x27')](saveUpdates(_0x5c31a4[_0x006b('0x4b')],null))[_0x006b('0x27')](respondWithResult(_0x2b8ad2,null))[_0x006b('0x1e')](handleError(_0x2b8ad2,null));};exports[_0x006b('0x28')]=function(_0x42ea16,_0x5eb843){return db[_0x006b('0x2f')][_0x006b('0x4a')]({'where':{'id':_0x42ea16[_0x006b('0x48')]['id']}})[_0x006b('0x27')](handleEntityNotFound(_0x5eb843,null))[_0x006b('0x27')](removeEntity(_0x5eb843,null))[_0x006b('0x1e')](handleError(_0x5eb843,null));};exports[_0x006b('0x4c')]=function(_0x29521b,_0x1e1a78){return db['MailMessage'][_0x006b('0x4c')]()[_0x006b('0x27')](respondWithResult(_0x1e1a78,null))['catch'](handleError(_0x1e1a78,null));};exports[_0x006b('0x4d')]=function(_0x4f17f7,_0x43c544){return db[_0x006b('0x2f')][_0x006b('0x4d')](_0x4f17f7[_0x006b('0x4b')])[_0x006b('0x27')](function(_0x542cbc){if(_0x542cbc){if(_0x542cbc[_0x006b('0x4e')]===_0x006b('0x4f')&&!_0x542cbc['secret']){var _0x299386,_0x493f09,_0x3af0e8;if(_0x4f17f7[_0x006b('0x4b')]['to']){_0x493f09=_0x4f17f7[_0x006b('0x4b')]['to']['split'](',')[0x0];}return db[_0x006b('0x50')]['findOne']({'where':{'id':_0x542cbc[_0x006b('0x51')]},'include':[{'model':db[_0x006b('0x52')],'as':'List','include':[{'model':db[_0x006b('0x53')],'as':_0x006b('0x54'),'where':{'email':_0x493f09},'limit':0x1,'order':[[_0x006b('0x55'),_0x006b('0x56')]]}]},{'model':db[_0x006b('0x57')],'as':_0x006b('0x58'),'raw':!![],'include':[{'model':db[_0x006b('0x59')],'as':_0x006b('0x59'),'raw':!![]}]}]})[_0x006b('0x27')](function(_0x54ff16){_0x299386=_0x54ff16;if(!_0x299386||!_0x299386[_0x006b('0x58')])return;var _0x598e1c=_0x299386[_0x006b('0x5a')]();if(_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')]&&_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')][_0x006b('0x3b')]){for(var _0x50cb05=0x0;_0x50cb05<_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')]['length'];_0x50cb05+=0x1){_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')][_0x50cb05]={'filename':_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')][_0x50cb05][_0x006b('0x2b')],'path':path[_0x006b('0x5c')](config[_0x006b('0x5d')],_0x006b('0x5e'),_0x4f17f7[_0x006b('0x4b')][_0x006b('0x5b')][_0x50cb05][_0x006b('0x5f')])};}}_0x3af0e8={'account':_0x598e1c,'message':_0x4f17f7[_0x006b('0x4b')]};return;})['then'](function(){if(_0x299386['List']){if(_0x299386['List'][_0x006b('0x54')][_0x006b('0x3b')]){return _0x299386[_0x006b('0x60')][_0x006b('0x54')][0x0];}else{return db[_0x006b('0x53')][_0x006b('0x4d')](_['defaults'](_0x4f17f7[_0x006b('0x4b')],{'firstName':_0x4f17f7[_0x006b('0x4b')]['to'],'email':_0x4f17f7['body']['to'],'phone':_0x4f17f7[_0x006b('0x4b')]['to'],'ListId':_0x299386[_0x006b('0x61')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x006b('0x27')](function(){if(_0x3af0e8){return respondWithRpcPromise('SendMail','sendMail',_0x3af0e8,client9003)[_0x006b('0x27')](function(_0x3e3feb){return _0x542cbc[_0x006b('0x26')]({'read':!![],'messageId':_0x3e3feb[_0x006b('0x62')],'sentAt':moment()[_0x006b('0x63')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x006b('0x1e')](function(_0x47f31b){logger[_0x006b('0x1b')]('%s',JSON[_0x006b('0x19')](_0x47f31b));return _0x542cbc;});}return _0x542cbc;});}return _0x542cbc;}})[_0x006b('0x27')](respondWithResult(_0x43c544,0xc9))['catch'](handleError(_0x43c544,null));};exports[_0x006b('0x64')]=function(_0x586e57,_0x41e187){var _0x30e1b5={'agent':{},'channel':_0x006b('0x65')};if(_0x586e57['body']['id']){delete _0x586e57['body']['id'];}_0x586e57[_0x006b('0x4b')][_0x006b('0x66')]=!![];_0x586e57['body'][_0x006b('0x67')]=moment()[_0x006b('0x63')](_0x006b('0x68'));_0x586e57[_0x006b('0x4b')][_0x006b('0x69')]=_0x586e57['body'][_0x006b('0x69')]||_0x586e57['user']['id'];_0x30e1b5[_0x006b('0x6a')]['id']=_0x586e57['body']['UserId'];return db[_0x006b('0x2f')][_0x006b('0x4a')]({'where':{'id':_0x586e57[_0x006b('0x48')]['id'],'UserId':null}})[_0x006b('0x27')](handleEntityNotFound(_0x41e187,null))[_0x006b('0x27')](saveUpdates(_0x586e57[_0x006b('0x4b')],null))[_0x006b('0x27')](function(_0x8f240){if(_0x8f240){_0x30e1b5[_0x006b('0x1c')]=_0x8f240[_0x006b('0x6b')]({'plain':!![]});return db[_0x006b('0x6c')][_0x006b('0x4a')]({'where':{'id':_0x8f240[_0x006b('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x41e187,null))[_0x006b('0x27')](function(_0x3fd73e){if(_0x3fd73e){return _0x3fd73e['update']({'UserId':_0x586e57[_0x006b('0x4b')][_0x006b('0x69')],'read1stAt':_[_0x006b('0x6e')](_0x3fd73e[_0x006b('0x6f')])?moment()[_0x006b('0x63')](_0x006b('0x68')):undefined});}return null;})[_0x006b('0x27')](function(_0x3cb259){if(_0x3cb259){_0x30e1b5[_0x006b('0x70')]=_0x3cb259[_0x006b('0x6b')]({'plain':!![]});interaction_log[_0x006b('0x15')](_0x006b('0x71'),_0x586e57[_0x006b('0x72')]['id'],_0x586e57[_0x006b('0x72')][_0x006b('0x2b')],_0x586e57[_0x006b('0x72')][_0x006b('0x73')],_0x30e1b5[_0x006b('0x70')]['id'],_0x586e57['body']?JSON['stringify'](_0x586e57['body']):'null');return respondWithRpcPromise(_0x006b('0x74'),'acceptMessage',_0x30e1b5);}return null;})[_0x006b('0x27')](function(_0x21d2c1){var _0x45f1c8=_0x006b('0x75')+_0x21d2c1['message'][_0x006b('0x76')];return db[_0x006b('0x77')][_0x006b('0x35')](_0x45f1c8,{'type':db[_0x006b('0x78')]['QueryTypes'][_0x006b('0x79')],'raw':!![]})[_0x006b('0x27')](function(_0xfeae1c){return _0xfeae1c;});})['then'](function(_0x3bee5e){if(_0x3bee5e){_0x30e1b5[_0x006b('0x1c')]['contact']=_0x3bee5e[0x0];if(!_0x586e57['body'][_0x006b('0x69')])return;return db[_0x006b('0x7a')][_0x006b('0x4a')]({'where':{'id':_0x586e57[_0x006b('0x4b')][_0x006b('0x69')],'role':'agent'},'attributes':['id','name',_0x006b('0x7b'),_0x006b('0x7c'),_0x006b('0x7d')],'raw':!![]});}return null;})['then'](function(_0xf737){if(!_0xf737)return null;_0x30e1b5[_0x006b('0x1c')][_0x006b('0x6a')]=_0xf737;return _0x30e1b5;})[_0x006b('0x27')](function(_0x575015){if(_0x575015){if(_0x586e57[_0x006b('0x4b')][_0x006b('0x7e')]){_0x30e1b5[_0x006b('0x1c')][_0x006b('0x7f')]=util[_0x006b('0x63')](_0x006b('0x80'),_0x586e57['user'][_0x006b('0x2b')]);_0x30e1b5[_0x006b('0x1c')][_0x006b('0x81')]=_0x30e1b5[_0x006b('0x81')];_0x30e1b5['message'][_0x006b('0x82')]=_0x30e1b5[_0x006b('0x81')];_0x30e1b5[_0x006b('0x1c')]['event']='accept';_0x30e1b5[_0x006b('0x1c')][_0x006b('0x4b')]=htmlToText['fromString'](_0x30e1b5[_0x006b('0x1c')][_0x006b('0x4b')]);return respondWithRpcPromise('EventManager',_0x006b('0x83'),{'event':_0x006b('0x84'),'message':_0x30e1b5[_0x006b('0x1c')]},client9002)[_0x006b('0x27')](function(){return _0x30e1b5;});}return _0x30e1b5;}return null;})['then'](respondWithResult(_0x41e187,null))['catch'](handleError(_0x41e187,null));};exports[_0x006b('0x85')]=function(_0x4ba445,_0xcc7540){var _0x2538ff={'agent':{},'channel':_0x006b('0x65')};if(_0x4ba445[_0x006b('0x4b')]['id']){delete _0x4ba445[_0x006b('0x4b')]['id'];}_0x4ba445['body'][_0x006b('0x69')]=_0x4ba445[_0x006b('0x4b')][_0x006b('0x69')]||_0x4ba445['user']['id'];_0x2538ff['agent']['id']=_0x4ba445[_0x006b('0x4b')][_0x006b('0x69')];return db[_0x006b('0x2f')]['find']({'where':{'id':_0x4ba445[_0x006b('0x48')]['id'],'UserId':null}})[_0x006b('0x27')](handleEntityNotFound(_0xcc7540,null))['then'](function(_0x71ee36){if(_0x71ee36){_0x2538ff[_0x006b('0x1c')]=_0x71ee36['get']({'plain':!![]});return db[_0x006b('0x6c')][_0x006b('0x4a')]({'where':{'id':_0x71ee36[_0x006b('0x6d')]}});}return null;})[_0x006b('0x27')](handleEntityNotFound(_0xcc7540,null))[_0x006b('0x27')](function(_0x3612de){if(_0x3612de){_0x2538ff['interaction']=_0x3612de['get']({'plain':!![]});interaction_log[_0x006b('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ba445[_0x006b('0x72')]['id'],_0x4ba445['user']['name'],_0x4ba445[_0x006b('0x72')][_0x006b('0x73')],_0x2538ff[_0x006b('0x70')]['id'],_0x4ba445['body']?JSON[_0x006b('0x19')](_0x4ba445['body']):_0x006b('0x86'));return respondWithRpcPromise(_0x006b('0x87'),_0x006b('0x88'),_0x2538ff);}return null;})[_0x006b('0x27')](function(_0x4106e4){var _0x79c81b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4106e4[_0x006b('0x1c')]['ContactId'];return db['sequelize'][_0x006b('0x35')](_0x79c81b,{'type':db[_0x006b('0x78')][_0x006b('0x89')][_0x006b('0x79')],'raw':!![]})[_0x006b('0x27')](function(_0x444b5a){return _0x444b5a;});})['then'](function(_0x1e3874){if(_0x1e3874){_0x2538ff[_0x006b('0x1c')]['contact']=_0x1e3874[0x0];if(!_0x4ba445['body'][_0x006b('0x69')])return;return db[_0x006b('0x7a')][_0x006b('0x4a')]({'where':{'id':_0x4ba445[_0x006b('0x4b')][_0x006b('0x69')],'role':_0x006b('0x6a')},'attributes':['id',_0x006b('0x2b'),'fullname',_0x006b('0x7c'),_0x006b('0x7d')],'raw':!![]});}return null;})[_0x006b('0x27')](function(_0x32c8e4){if(!_0x32c8e4)return null;_0x2538ff[_0x006b('0x1c')][_0x006b('0x6a')]=_0x32c8e4;return _0x2538ff;})[_0x006b('0x27')](function(_0x2a44dd){if(_0x2a44dd){_0x2a44dd[_0x006b('0x1c')][_0x006b('0x7f')]=util['format'](_0x006b('0x80'),_0x4ba445['user'][_0x006b('0x2b')]);_0x2a44dd['message'][_0x006b('0x81')]=_0x2538ff[_0x006b('0x81')];_0x2a44dd[_0x006b('0x1c')][_0x006b('0x82')]=_0x2538ff[_0x006b('0x81')];_0x2a44dd['message'][_0x006b('0x8a')]=_0x006b('0x85');_0x2a44dd['message']['body']=htmlToText[_0x006b('0x8b')](_0x2538ff[_0x006b('0x1c')][_0x006b('0x4b')]);respondWithRpcPromise(_0x006b('0x83'),_0x006b('0x83'),{'event':_0x006b('0x8c'),'message':_0x2a44dd['message']},client9002);return _0x2538ff;}return null;})[_0x006b('0x27')](respondWithResult(_0xcc7540,null))['catch'](handleError(_0xcc7540,null));};exports[_0x006b('0x8d')]=function(_0x1ced73,_0x3fa99f){var _0x196048=moment()['unix']()['toString']();var _0x431aa1=path[_0x006b('0x5c')](config['root'],_0x006b('0x8e'),_0x006b('0x8f'),'tmp');var _0xc701b5=path[_0x006b('0x5c')](config[_0x006b('0x5d')],_0x006b('0x8e'),'files','attachments');var _0x3b11bd=util['format'](_0x006b('0x90'),_0x196048);return db[_0x006b('0x2f')][_0x006b('0x4a')]({'where':{'id':_0x1ced73[_0x006b('0x48')]['id']},'attributes':['id','body',_0x006b('0x91'),'to','cc',_0x006b('0x92'),'subject',_0x006b('0x93')],'include':_0x1ced73[_0x006b('0x35')]['attachments']?[{'model':db['Attachment'],'as':_0x006b('0x94')}]:undefined})[_0x006b('0x27')](handleEntityNotFound(_0x3fa99f,null))[_0x006b('0x27')](function(_0x3a9d76){if(_0x3a9d76){var _0x43eaca=_0x3a9d76;var _0x1c4786={'from':_0x43eaca[_0x006b('0x91')],'to':_0x43eaca['to'],'subject':_0x43eaca[_0x006b('0x95')],'html':htmlEntities[_0x006b('0x96')](_0x43eaca['body']),'headers':{'Date':moment(_0x43eaca[_0x006b('0x93')])['format'](_0x006b('0x97'))},'attachments':[]};if(_0x3a9d76['cc']){_0x1c4786['headers']['Cc']=_0x3a9d76['cc'];}if(_0x3a9d76['bcc']){_0x1c4786[_0x006b('0x98')][_0x006b('0x99')]=_0x3a9d76['bcc'];}return new BPromise(function(_0x165bf8,_0x2f4772){if(_0x3a9d76[_0x006b('0x94')]){for(var _0x1901ac=0x0;_0x1901ac<_0x3a9d76['Attachments'][_0x006b('0x3b')];_0x1901ac++){var _0x31e81b=_0x3a9d76[_0x006b('0x94')][_0x1901ac];var _0x3c1107=path[_0x006b('0x5c')](_0xc701b5,_0x31e81b[_0x006b('0x5f')]);if(fs[_0x006b('0x9a')](_0x3c1107)){_0x1c4786['attachments'][_0x006b('0x9b')]({'name':_0x31e81b['name'],'contentType':_0x31e81b[_0x006b('0x32')],'data':fs[_0x006b('0x9c')](_0x3c1107)});}}}emlformat['build'](_0x1c4786,function(_0x2bc09f,_0x1a042d){if(_0x2bc09f)return _0x2f4772(_0x2bc09f);fs[_0x006b('0x9d')](path[_0x006b('0x5c')](_0x431aa1,_0x3b11bd),_0x1a042d);return _0x165bf8(_0x1a042d);});});}})['then'](function(_0xd62682){if(_0xd62682){return _0x3fa99f['download'](path['join'](_0x431aa1,_0x3b11bd),_0x3b11bd,function(_0x6ba335){if(!_0x6ba335)fs[_0x006b('0x9e')](path[_0x006b('0x5c')](_0x431aa1,_0x3b11bd));});}})[_0x006b('0x1e')](handleError(_0x3fa99f,null));}; \ No newline at end of file +var _0xb131=['catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','keys','includeAll','include','find','body','describe','create','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','fullname','email','internal','interface','SIP/%s','channel','event','fromString','acceptmessage','reject','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','User','motionChannel','EventManager','rejectmessage','download','toString','server','tmp','files','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x1c9075,_0xb4e64){var _0x148f6b=function(_0x528c51){while(--_0x528c51){_0x1c9075['push'](_0x1c9075['shift']());}};_0x148f6b(++_0xb4e64);}(_0xb131,0x129));var _0x1b13=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0xb131[_0x1dac7a];return _0x4cb363;};'use strict';var emlformat=require(_0x1b13('0x0'));var moment=require(_0x1b13('0x1'));var BPromise=require(_0x1b13('0x2'));var util=require(_0x1b13('0x3'));var path=require(_0x1b13('0x4'));var fs=require('fs');var _=require(_0x1b13('0x5'));var Redis=require(_0x1b13('0x6'));var htmlToText=require(_0x1b13('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x1b13('0x8'))('api');var interaction_log=require('../../config/logger')(_0x1b13('0x9'));var config=require(_0x1b13('0xa'));var db=require(_0x1b13('0xb'))['db'];config[_0x1b13('0xc')]=_[_0x1b13('0xd')](config[_0x1b13('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b13('0xe'))(new Redis(config[_0x1b13('0xc')]));var htmlEntities=require(_0x1b13('0xf'));require(_0x1b13('0x10'))[_0x1b13('0x11')](socket);var jayson=require(_0x1b13('0x12'));var client=jayson[_0x1b13('0x13')][_0x1b13('0x14')]({'port':0x232c});var client9003=jayson[_0x1b13('0x13')]['http']({'port':0x232b});var client9002=jayson[_0x1b13('0x13')][_0x1b13('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x3569dd,_0x369814,_0x34d99d,_0x4df89b){return new BPromise(function(_0x5cd858,_0x5b6d35){var _0x1f3014=_0x4df89b||client;return _0x1f3014[_0x1b13('0x15')](_0x3569dd,_0x34d99d)[_0x1b13('0x16')](function(_0x1efba0){logger[_0x1b13('0x17')]('MailMessage,\x20%s,\x20%s',_0x369814,_0x1b13('0x18'));logger[_0x1b13('0x19')](_0x1b13('0x1a'),_0x369814,_0x1b13('0x18'),JSON[_0x1b13('0x1b')](_0x1efba0));if(_0x1efba0[_0x1b13('0x1c')]){if(_0x1efba0['error'][_0x1b13('0x1d')]===0x1f4){logger['error'](_0x1b13('0x1e'),_0x369814,_0x1efba0[_0x1b13('0x1c')][_0x1b13('0x1f')]);return _0x5b6d35(_0x1efba0[_0x1b13('0x1c')][_0x1b13('0x1f')]);}logger[_0x1b13('0x1c')](_0x1b13('0x1e'),_0x369814,_0x1efba0['error'][_0x1b13('0x1f')]);return _0x5cd858(_0x1efba0['error'][_0x1b13('0x1f')]);}else{logger[_0x1b13('0x17')](_0x1b13('0x1e'),_0x369814,'request\x20sent');_0x5cd858(_0x1efba0[_0x1b13('0x20')]['message']);}})[_0x1b13('0x21')](function(_0x3066d1){logger[_0x1b13('0x1c')](_0x1b13('0x1e'),_0x369814,_0x3066d1);_0x5b6d35(_0x3066d1);});});}function respondWithResult(_0x5f1c14,_0x1e7c0a){_0x1e7c0a=_0x1e7c0a||0xc8;return function(_0x4d5299){if(_0x4d5299){return _0x5f1c14[_0x1b13('0x22')](_0x1e7c0a)[_0x1b13('0x23')](_0x4d5299);}};}function respondWithFilteredResult(_0x2c5a6c,_0x461a16){return function(_0x12afd4){if(_0x12afd4){var _0x11c5c2=typeof _0x461a16[_0x1b13('0x24')]===_0x1b13('0x25')&&typeof _0x461a16['limit']==='undefined';var _0x3b1638=_0x12afd4[_0x1b13('0x26')];var _0x421717=_0x11c5c2?0x0:_0x461a16['offset'];var _0x3f7dd6=_0x11c5c2?_0x12afd4['count']:_0x461a16[_0x1b13('0x24')]+_0x461a16[_0x1b13('0x27')];var _0x589d37;if(_0x3f7dd6>=_0x3b1638){_0x3f7dd6=_0x3b1638;_0x589d37=0xc8;}else{_0x589d37=0xce;}_0x2c5a6c[_0x1b13('0x22')](_0x589d37);return _0x2c5a6c[_0x1b13('0x28')](_0x1b13('0x29'),_0x421717+'-'+_0x3f7dd6+'/'+_0x3b1638)['json'](_0x12afd4);}return null;};}function saveUpdates(_0x4e1dbe){return function(_0x153419){if(_0x153419){return _0x153419[_0x1b13('0x2a')](_0x4e1dbe)[_0x1b13('0x16')](function(_0x3174ba){return _0x3174ba;});}return null;};}function removeEntity(_0x26e77a){return function(_0x36aef9){if(_0x36aef9){return _0x36aef9[_0x1b13('0x2b')]()[_0x1b13('0x16')](function(){_0x26e77a[_0x1b13('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b9e58){return function(_0x198a58){if(!_0x198a58){_0x9b9e58[_0x1b13('0x2c')](0x194);}return _0x198a58;};}function handleError(_0x5ef4c8,_0x39020e){_0x39020e=_0x39020e||0x1f4;return function(_0x55a5d7){logger[_0x1b13('0x1c')](_0x55a5d7['stack']);if(_0x55a5d7[_0x1b13('0x2d')]){delete _0x55a5d7[_0x1b13('0x2d')];}_0x5ef4c8[_0x1b13('0x22')](_0x39020e)[_0x1b13('0x2e')](_0x55a5d7);};}exports[_0x1b13('0x2f')]=function(_0x2477b0,_0x3c801e){var _0x4511c0={},_0x567c53={},_0x4bda38={'count':0x0,'rows':[]};var _0x360f2f=_[_0x1b13('0x30')](db[_0x1b13('0x31')][_0x1b13('0x32')],function(_0xeaa7b5){return{'name':_0xeaa7b5[_0x1b13('0x33')],'type':_0xeaa7b5['type'][_0x1b13('0x34')]};});_0x567c53['model']=_[_0x1b13('0x30')](_0x360f2f,_0x1b13('0x2d'));_0x567c53[_0x1b13('0x35')]=_['keys'](_0x2477b0['query']);_0x567c53[_0x1b13('0x36')]=_[_0x1b13('0x37')](_0x567c53[_0x1b13('0x38')],_0x567c53[_0x1b13('0x35')]);_0x4511c0['attributes']=_[_0x1b13('0x37')](_0x567c53[_0x1b13('0x38')],qs['fields'](_0x2477b0['query'][_0x1b13('0x39')]));_0x4511c0[_0x1b13('0x3a')]=_0x4511c0['attributes'][_0x1b13('0x3b')]?_0x4511c0[_0x1b13('0x3a')]:_0x567c53[_0x1b13('0x38')];if(!_0x2477b0[_0x1b13('0x35')][_0x1b13('0x3c')](_0x1b13('0x3d'))){_0x4511c0[_0x1b13('0x27')]=qs[_0x1b13('0x27')](_0x2477b0['query']['limit']);_0x4511c0['offset']=qs[_0x1b13('0x24')](_0x2477b0[_0x1b13('0x35')][_0x1b13('0x24')]);}_0x4511c0[_0x1b13('0x3e')]=qs['sort'](_0x2477b0['query'][_0x1b13('0x3f')]);_0x4511c0[_0x1b13('0x40')]=qs[_0x1b13('0x36')](_['pick'](_0x2477b0[_0x1b13('0x35')],_0x567c53[_0x1b13('0x36')]),_0x360f2f);if(_0x2477b0[_0x1b13('0x35')][_0x1b13('0x41')]){_0x4511c0[_0x1b13('0x40')]=_[_0x1b13('0x42')](_0x4511c0[_0x1b13('0x40')],{'$or':_[_0x1b13('0x30')](_0x360f2f,function(_0x1dd264){if(_0x1dd264[_0x1b13('0x43')]!==_0x1b13('0x44')){var _0x2fa3c1={};_0x2fa3c1[_0x1dd264['name']]={'$like':'%'+_0x2477b0[_0x1b13('0x35')][_0x1b13('0x41')]+'%'};return _0x2fa3c1;}})});}_0x4511c0=_['merge']({},_0x4511c0,_0x2477b0[_0x1b13('0x45')]);var _0x29e5fc={'where':_0x4511c0[_0x1b13('0x40')]};return db[_0x1b13('0x31')][_0x1b13('0x26')](_0x29e5fc)[_0x1b13('0x16')](function(_0x46f42d){_0x4bda38['count']=_0x46f42d;if(_0x2477b0[_0x1b13('0x35')]['includeAll']){_0x4511c0['include']=[{'all':!![]}];}return db[_0x1b13('0x31')][_0x1b13('0x46')](_0x4511c0);})[_0x1b13('0x16')](function(_0x1d1eda){_0x4bda38[_0x1b13('0x47')]=_0x1d1eda;return _0x4bda38;})[_0x1b13('0x16')](respondWithFilteredResult(_0x3c801e,_0x4511c0))['catch'](handleError(_0x3c801e,null));};exports[_0x1b13('0x48')]=function(_0x72e36d,_0x248b71){var _0x2de391={'raw':!![],'where':{'id':_0x72e36d[_0x1b13('0x49')]['id']}},_0x25b10b={};_0x25b10b['model']=_[_0x1b13('0x4a')](db[_0x1b13('0x31')][_0x1b13('0x32')]);_0x25b10b[_0x1b13('0x35')]=_[_0x1b13('0x4a')](_0x72e36d[_0x1b13('0x35')]);_0x25b10b[_0x1b13('0x36')]=_['intersection'](_0x25b10b[_0x1b13('0x38')],_0x25b10b[_0x1b13('0x35')]);_0x2de391[_0x1b13('0x3a')]=_['intersection'](_0x25b10b['model'],qs[_0x1b13('0x39')](_0x72e36d[_0x1b13('0x35')][_0x1b13('0x39')]));_0x2de391[_0x1b13('0x3a')]=_0x2de391[_0x1b13('0x3a')][_0x1b13('0x3b')]?_0x2de391['attributes']:_0x25b10b['model'];if(_0x72e36d[_0x1b13('0x35')][_0x1b13('0x4b')]){_0x2de391[_0x1b13('0x4c')]=[{'all':!![]}];}_0x2de391=_[_0x1b13('0x42')]({},_0x2de391,_0x72e36d[_0x1b13('0x45')]);return db['MailMessage'][_0x1b13('0x4d')](_0x2de391)['then'](handleEntityNotFound(_0x248b71,null))[_0x1b13('0x16')](respondWithResult(_0x248b71,null))[_0x1b13('0x21')](handleError(_0x248b71,null));};exports['update']=function(_0x416be6,_0xd6a87c){if(_0x416be6[_0x1b13('0x4e')]['id']){delete _0x416be6[_0x1b13('0x4e')]['id'];}return db[_0x1b13('0x31')][_0x1b13('0x4d')]({'where':{'id':_0x416be6['params']['id']}})[_0x1b13('0x16')](handleEntityNotFound(_0xd6a87c,null))[_0x1b13('0x16')](saveUpdates(_0x416be6['body'],null))[_0x1b13('0x16')](respondWithResult(_0xd6a87c,null))[_0x1b13('0x21')](handleError(_0xd6a87c,null));};exports[_0x1b13('0x2b')]=function(_0x1969e2,_0x10087b){return db['MailMessage'][_0x1b13('0x4d')]({'where':{'id':_0x1969e2[_0x1b13('0x49')]['id']}})[_0x1b13('0x16')](handleEntityNotFound(_0x10087b,null))[_0x1b13('0x16')](removeEntity(_0x10087b,null))['catch'](handleError(_0x10087b,null));};exports[_0x1b13('0x4f')]=function(_0x4c0450,_0x112cf6){return db[_0x1b13('0x31')]['describe']()[_0x1b13('0x16')](respondWithResult(_0x112cf6,null))[_0x1b13('0x21')](handleError(_0x112cf6,null));};exports[_0x1b13('0x50')]=function(_0x3411c6,_0x1fceb5){return db[_0x1b13('0x31')][_0x1b13('0x50')](_0x3411c6[_0x1b13('0x4e')])[_0x1b13('0x16')](function(_0x500a25){if(_0x500a25){if(_0x500a25['direction']==='out'&&!_0x500a25[_0x1b13('0x51')]){var _0x1a7e6b,_0x27749b,_0x4b96b0;if(_0x3411c6[_0x1b13('0x4e')]['to']){_0x27749b=_0x3411c6['body']['to'][_0x1b13('0x52')](',')[0x0];}return db[_0x1b13('0x53')][_0x1b13('0x54')]({'where':{'id':_0x500a25[_0x1b13('0x55')]},'include':[{'model':db[_0x1b13('0x56')],'as':'List','include':[{'model':db[_0x1b13('0x57')],'as':_0x1b13('0x58'),'where':{'email':_0x27749b},'limit':0x1,'order':[[_0x1b13('0x59'),_0x1b13('0x5a')]]}]},{'model':db['MailServerOut'],'as':_0x1b13('0x5b'),'raw':!![],'include':[{'model':db[_0x1b13('0x5c')],'as':_0x1b13('0x5c'),'raw':!![]}]}]})[_0x1b13('0x16')](function(_0x2aec5c){_0x1a7e6b=_0x2aec5c;if(!_0x1a7e6b||!_0x1a7e6b['Smtp'])return;var _0x4bc7eb=_0x1a7e6b[_0x1b13('0x5d')]();if(_0x3411c6[_0x1b13('0x4e')][_0x1b13('0x5e')]&&_0x3411c6[_0x1b13('0x4e')][_0x1b13('0x5e')][_0x1b13('0x3b')]){for(var _0x304535=0x0;_0x304535<_0x3411c6[_0x1b13('0x4e')][_0x1b13('0x5e')][_0x1b13('0x3b')];_0x304535+=0x1){_0x3411c6[_0x1b13('0x4e')][_0x1b13('0x5e')][_0x304535]={'filename':_0x3411c6[_0x1b13('0x4e')]['attachments'][_0x304535][_0x1b13('0x2d')],'path':path[_0x1b13('0x5f')](config[_0x1b13('0x60')],_0x1b13('0x61'),_0x3411c6[_0x1b13('0x4e')]['attachments'][_0x304535][_0x1b13('0x62')])};}}_0x4b96b0={'account':_0x4bc7eb,'message':_0x3411c6[_0x1b13('0x4e')]};return;})[_0x1b13('0x16')](function(){if(_0x1a7e6b[_0x1b13('0x63')]){if(_0x1a7e6b['List'][_0x1b13('0x58')]['length']){return _0x1a7e6b['List'][_0x1b13('0x58')][0x0];}else{return db[_0x1b13('0x57')][_0x1b13('0x50')](_['defaults'](_0x3411c6['body'],{'firstName':_0x3411c6[_0x1b13('0x4e')]['to'],'email':_0x3411c6['body']['to'],'phone':_0x3411c6['body']['to'],'ListId':_0x1a7e6b[_0x1b13('0x64')]}));}}else{throw new Error(_0x1b13('0x65'));}})[_0x1b13('0x16')](function(){if(_0x4b96b0){return respondWithRpcPromise(_0x1b13('0x66'),_0x1b13('0x67'),_0x4b96b0,client9003)['then'](function(_0x305aa5){return _0x500a25[_0x1b13('0x2a')]({'read':!![],'messageId':_0x305aa5[_0x1b13('0x68')],'sentAt':moment()[_0x1b13('0x69')](_0x1b13('0x6a'))});})[_0x1b13('0x21')](function(_0x14ae43){logger[_0x1b13('0x1c')]('%s',JSON[_0x1b13('0x1b')](_0x14ae43));return _0x500a25;});}return _0x500a25;});}return _0x500a25;}})[_0x1b13('0x16')](respondWithResult(_0x1fceb5,0xc9))[_0x1b13('0x21')](handleError(_0x1fceb5,null));};exports[_0x1b13('0x6b')]=function(_0x1efd1d,_0x478c4c){var _0x4efc31={'agent':{},'channel':_0x1b13('0x6c')};if(_0x1efd1d[_0x1b13('0x4e')]['id']){delete _0x1efd1d['body']['id'];}_0x1efd1d[_0x1b13('0x4e')][_0x1b13('0x6d')]=!![];_0x1efd1d[_0x1b13('0x4e')][_0x1b13('0x6e')]=moment()[_0x1b13('0x69')](_0x1b13('0x6a'));_0x1efd1d['body'][_0x1b13('0x6f')]=_0x1efd1d[_0x1b13('0x4e')][_0x1b13('0x6f')]||_0x1efd1d['user']['id'];_0x4efc31[_0x1b13('0x70')]['id']=_0x1efd1d[_0x1b13('0x4e')][_0x1b13('0x6f')];return db['MailMessage']['find']({'where':{'id':_0x1efd1d[_0x1b13('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x478c4c,null))[_0x1b13('0x16')](saveUpdates(_0x1efd1d[_0x1b13('0x4e')],null))[_0x1b13('0x16')](function(_0x42ee3d){if(_0x42ee3d){_0x4efc31[_0x1b13('0x1f')]=_0x42ee3d[_0x1b13('0x71')]({'plain':!![]});return db[_0x1b13('0x72')]['find']({'where':{'id':_0x42ee3d[_0x1b13('0x73')]}});}return null;})[_0x1b13('0x16')](handleEntityNotFound(_0x478c4c,null))[_0x1b13('0x16')](function(_0x9aefac){if(_0x9aefac){return _0x9aefac[_0x1b13('0x2a')]({'UserId':_0x1efd1d['body'][_0x1b13('0x6f')],'read1stAt':_[_0x1b13('0x74')](_0x9aefac[_0x1b13('0x75')])?moment()[_0x1b13('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x11cca9){if(_0x11cca9){_0x4efc31['interaction']=_0x11cca9[_0x1b13('0x71')]({'plain':!![]});interaction_log[_0x1b13('0x17')](_0x1b13('0x76'),_0x1efd1d[_0x1b13('0x77')]['id'],_0x1efd1d[_0x1b13('0x77')][_0x1b13('0x2d')],_0x1efd1d['user'][_0x1b13('0x78')],_0x4efc31[_0x1b13('0x79')]['id'],_0x1efd1d['body']?JSON[_0x1b13('0x1b')](_0x1efd1d['body']):'null');return respondWithRpcPromise(_0x1b13('0x7a'),_0x1b13('0x7b'),_0x4efc31);}return null;})[_0x1b13('0x16')](function(_0x24a28a){var _0x26f617=_0x1b13('0x7c')+_0x24a28a[_0x1b13('0x1f')]['ContactId'];return db[_0x1b13('0x7d')][_0x1b13('0x35')](_0x26f617,{'type':db[_0x1b13('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1b13('0x16')](function(_0xe1024d){return _0xe1024d;});})[_0x1b13('0x16')](function(_0x3505b4){if(_0x3505b4){_0x4efc31['message'][_0x1b13('0x7f')]=_0x3505b4[0x0];if(!_0x1efd1d['body']['UserId'])return;return db['User'][_0x1b13('0x4d')]({'where':{'id':_0x1efd1d[_0x1b13('0x4e')][_0x1b13('0x6f')],'role':_0x1b13('0x70')},'attributes':['id',_0x1b13('0x2d'),_0x1b13('0x80'),_0x1b13('0x81'),_0x1b13('0x82')],'raw':!![]});}return null;})[_0x1b13('0x16')](function(_0x58d1bd){if(!_0x58d1bd)return null;_0x4efc31[_0x1b13('0x1f')]['agent']=_0x58d1bd;return _0x4efc31;})[_0x1b13('0x16')](function(_0x4d74a5){if(_0x4d74a5){if(_0x1efd1d['body']['manual']){_0x4efc31[_0x1b13('0x1f')][_0x1b13('0x83')]=util['format'](_0x1b13('0x84'),_0x1efd1d['user'][_0x1b13('0x2d')]);_0x4efc31[_0x1b13('0x1f')][_0x1b13('0x85')]=_0x4efc31[_0x1b13('0x85')];_0x4efc31[_0x1b13('0x1f')]['motionChannel']=_0x4efc31[_0x1b13('0x85')];_0x4efc31[_0x1b13('0x1f')][_0x1b13('0x86')]=_0x1b13('0x6b');_0x4efc31[_0x1b13('0x1f')][_0x1b13('0x4e')]=htmlToText[_0x1b13('0x87')](_0x4efc31['message'][_0x1b13('0x4e')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x1b13('0x88'),'message':_0x4efc31[_0x1b13('0x1f')]},client9002)[_0x1b13('0x16')](function(){return _0x4efc31;});}return _0x4efc31;}return null;})[_0x1b13('0x16')](respondWithResult(_0x478c4c,null))['catch'](handleError(_0x478c4c,null));};exports[_0x1b13('0x89')]=function(_0xa843,_0x43d7bb){var _0x48ee91={'agent':{},'channel':'mail'};if(_0xa843[_0x1b13('0x4e')]['id']){delete _0xa843[_0x1b13('0x4e')]['id'];}_0xa843[_0x1b13('0x4e')][_0x1b13('0x6f')]=_0xa843[_0x1b13('0x4e')][_0x1b13('0x6f')]||_0xa843[_0x1b13('0x77')]['id'];_0x48ee91[_0x1b13('0x70')]['id']=_0xa843[_0x1b13('0x4e')]['UserId'];return db[_0x1b13('0x31')][_0x1b13('0x4d')]({'where':{'id':_0xa843[_0x1b13('0x49')]['id'],'UserId':null}})[_0x1b13('0x16')](handleEntityNotFound(_0x43d7bb,null))[_0x1b13('0x16')](function(_0x23ba1f){if(_0x23ba1f){_0x48ee91[_0x1b13('0x1f')]=_0x23ba1f[_0x1b13('0x71')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23ba1f[_0x1b13('0x73')]}});}return null;})[_0x1b13('0x16')](handleEntityNotFound(_0x43d7bb,null))['then'](function(_0x23e6cb){if(_0x23e6cb){_0x48ee91[_0x1b13('0x79')]=_0x23e6cb[_0x1b13('0x71')]({'plain':!![]});interaction_log[_0x1b13('0x17')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa843['user']['id'],_0xa843[_0x1b13('0x77')][_0x1b13('0x2d')],_0xa843[_0x1b13('0x77')][_0x1b13('0x78')],_0x48ee91['interaction']['id'],_0xa843['body']?JSON[_0x1b13('0x1b')](_0xa843[_0x1b13('0x4e')]):'null');return respondWithRpcPromise(_0x1b13('0x8a'),_0x1b13('0x8b'),_0x48ee91);}return null;})[_0x1b13('0x16')](function(_0x4fe249){var _0x11f340='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4fe249['message'][_0x1b13('0x8c')];return db['sequelize'][_0x1b13('0x35')](_0x11f340,{'type':db['Sequelize'][_0x1b13('0x8d')][_0x1b13('0x8e')],'raw':!![]})[_0x1b13('0x16')](function(_0x508a8b){return _0x508a8b;});})[_0x1b13('0x16')](function(_0x1b89fc){if(_0x1b89fc){_0x48ee91[_0x1b13('0x1f')]['contact']=_0x1b89fc[0x0];if(!_0xa843[_0x1b13('0x4e')][_0x1b13('0x6f')])return;return db[_0x1b13('0x8f')][_0x1b13('0x4d')]({'where':{'id':_0xa843[_0x1b13('0x4e')]['UserId'],'role':_0x1b13('0x70')},'attributes':['id',_0x1b13('0x2d'),_0x1b13('0x80'),_0x1b13('0x81'),_0x1b13('0x82')],'raw':!![]});}return null;})[_0x1b13('0x16')](function(_0x4e9621){if(!_0x4e9621)return null;_0x48ee91[_0x1b13('0x1f')][_0x1b13('0x70')]=_0x4e9621;return _0x48ee91;})[_0x1b13('0x16')](function(_0x33ded2){if(_0x33ded2){_0x33ded2[_0x1b13('0x1f')][_0x1b13('0x83')]=util['format'](_0x1b13('0x84'),_0xa843[_0x1b13('0x77')][_0x1b13('0x2d')]);_0x33ded2[_0x1b13('0x1f')][_0x1b13('0x85')]=_0x48ee91[_0x1b13('0x85')];_0x33ded2[_0x1b13('0x1f')][_0x1b13('0x90')]=_0x48ee91['channel'];_0x33ded2['message'][_0x1b13('0x86')]=_0x1b13('0x89');_0x33ded2[_0x1b13('0x1f')]['body']=htmlToText[_0x1b13('0x87')](_0x48ee91[_0x1b13('0x1f')][_0x1b13('0x4e')]);respondWithRpcPromise(_0x1b13('0x91'),_0x1b13('0x91'),{'event':_0x1b13('0x92'),'message':_0x33ded2[_0x1b13('0x1f')]},client9002);return _0x48ee91;}return null;})['then'](respondWithResult(_0x43d7bb,null))[_0x1b13('0x21')](handleError(_0x43d7bb,null));};exports[_0x1b13('0x93')]=function(_0x1da140,_0x3e4a09){var _0x334863=moment()['unix']()[_0x1b13('0x94')]();var _0x27dae1=path[_0x1b13('0x5f')](config[_0x1b13('0x60')],_0x1b13('0x95'),'files',_0x1b13('0x96'));var _0x4d9fb7=path[_0x1b13('0x5f')](config['root'],_0x1b13('0x95'),_0x1b13('0x97'),_0x1b13('0x5e'));var _0x4400d9=util[_0x1b13('0x69')]('message-%s.eml',_0x334863);return db[_0x1b13('0x31')][_0x1b13('0x4d')]({'where':{'id':_0x1da140[_0x1b13('0x49')]['id']},'attributes':['id',_0x1b13('0x4e'),_0x1b13('0x98'),'to','cc',_0x1b13('0x99'),_0x1b13('0x9a'),'createdAt'],'include':_0x1da140['query'][_0x1b13('0x5e')]?[{'model':db[_0x1b13('0x9b')],'as':_0x1b13('0x9c')}]:undefined})[_0x1b13('0x16')](handleEntityNotFound(_0x3e4a09,null))['then'](function(_0x363a79){if(_0x363a79){var _0x54b675=_0x363a79;var _0x7b20c8={'from':_0x54b675[_0x1b13('0x98')],'to':_0x54b675['to'],'subject':_0x54b675[_0x1b13('0x9a')],'html':htmlEntities[_0x1b13('0x9d')](_0x54b675[_0x1b13('0x4e')]),'headers':{'Date':moment(_0x54b675['createdAt'])[_0x1b13('0x69')](_0x1b13('0x9e'))},'attachments':[]};if(_0x363a79['cc']){_0x7b20c8[_0x1b13('0x9f')]['Cc']=_0x363a79['cc'];}if(_0x363a79['bcc']){_0x7b20c8[_0x1b13('0x9f')][_0x1b13('0xa0')]=_0x363a79['bcc'];}return new BPromise(function(_0x18c033,_0x1003cb){if(_0x363a79[_0x1b13('0x9c')]){for(var _0x5075c4=0x0;_0x5075c4<_0x363a79[_0x1b13('0x9c')][_0x1b13('0x3b')];_0x5075c4++){var _0x35117b=_0x363a79[_0x1b13('0x9c')][_0x5075c4];var _0x2bb0b3=path[_0x1b13('0x5f')](_0x4d9fb7,_0x35117b[_0x1b13('0x62')]);if(fs['existsSync'](_0x2bb0b3)){_0x7b20c8[_0x1b13('0x5e')][_0x1b13('0xa1')]({'name':_0x35117b[_0x1b13('0x2d')],'contentType':_0x35117b[_0x1b13('0x43')],'data':fs[_0x1b13('0xa2')](_0x2bb0b3)});}}}emlformat[_0x1b13('0xa3')](_0x7b20c8,function(_0x4000bd,_0x4ddadc){if(_0x4000bd)return _0x1003cb(_0x4000bd);fs['writeFileSync'](path[_0x1b13('0x5f')](_0x27dae1,_0x4400d9),_0x4ddadc);return _0x18c033(_0x4ddadc);});});}})[_0x1b13('0x16')](function(_0x36fb12){if(_0x36fb12){return _0x3e4a09[_0x1b13('0x93')](path['join'](_0x27dae1,_0x4400d9),_0x4400d9,function(_0x26796e){if(!_0x26796e)fs[_0x1b13('0xa4')](path[_0x1b13('0x5f')](_0x27dae1,_0x4400d9));});}})[_0x1b13('0x21')](handleError(_0x3e4a09,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f87720e..2b402f8 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 _0xfdf1=['hook','exports','events','../../mysqldb','MailMessage','save','update','remove','emit'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xfdf1,0x1a9));var _0x1fdf=function(_0x3616da,_0x143c50){_0x3616da=_0x3616da-0x0;var _0x574cc1=_0xfdf1[_0x3616da];return _0x574cc1;};'use strict';var EventEmitter=require(_0x1fdf('0x0'));var MailMessage=require(_0x1fdf('0x1'))['db'][_0x1fdf('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1fdf('0x3'),'afterUpdate':_0x1fdf('0x4'),'afterDestroy':_0x1fdf('0x5')};function emitEvent(_0x348058){return function(_0xdff1cd,_0x4dfc15,_0x1365de){MailMessageEvents['emit'](_0x348058+':'+_0xdff1cd['id'],_0xdff1cd);MailMessageEvents[_0x1fdf('0x6')](_0x348058,_0xdff1cd);_0x1365de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x1fdf('0x7')](e,emitEvent(event));}}module[_0x1fdf('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x963f=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x53748b,_0x230d05){var _0x534571=function(_0x3df1ec){while(--_0x3df1ec){_0x53748b['push'](_0x53748b['shift']());}};_0x534571(++_0x230d05);}(_0x963f,0xcf));var _0xf963=function(_0x57de49,_0x140369){_0x57de49=_0x57de49-0x0;var _0x4ce44f=_0x963f[_0x57de49];return _0x4ce44f;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xf963('0x0'))['db'][_0xf963('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf963('0x2')](0x0);var events={'afterCreate':_0xf963('0x3'),'afterUpdate':_0xf963('0x4'),'afterDestroy':_0xf963('0x5')};function emitEvent(_0x1cede4){return function(_0x29b67b,_0x941318,_0x58d2f7){MailMessageEvents[_0xf963('0x6')](_0x1cede4+':'+_0x29b67b['id'],_0x29b67b);MailMessageEvents['emit'](_0x1cede4,_0x29b67b);_0x58d2f7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xf963('0x7')](e,emitEvent(event));}}module[_0xf963('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 2e3013d..b6c750b 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 _0x4eb6=['util','../../config/logger','api','moment','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','utf8mb4_unicode_ci','lodash'];(function(_0x4ec119,_0x5e20f7){var _0x1f45a9=function(_0x247f80){while(--_0x247f80){_0x4ec119['push'](_0x4ec119['shift']());}};_0x1f45a9(++_0x5e20f7);}(_0x4eb6,0x1bf));var _0x64eb=function(_0x255c3c,_0xc909ba){_0x255c3c=_0x255c3c-0x0;var _0x1bcbce=_0x4eb6[_0x255c3c];return _0x1bcbce;};'use strict';var _=require(_0x64eb('0x0'));var util=require(_0x64eb('0x1'));var logger=require(_0x64eb('0x2'))(_0x64eb('0x3'));var moment=require(_0x64eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x64eb('0x5'));var htmlToText=require(_0x64eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64eb('0x7'));var config=require(_0x64eb('0x8'));var attributes=require(_0x64eb('0x9'));module['exports']=function(_0x2deef4,_0x815ee6){return _0x2deef4['define'](_0x64eb('0xa'),attributes,{'tableName':_0x64eb('0xb'),'paranoid':![],'indexes':[{'name':_0x64eb('0xc'),'fields':[_0x64eb('0xc')]},{'name':_0x64eb('0xd'),'fields':[_0x64eb('0xe'),'subject'],'type':_0x64eb('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15792e,_0xec6b71,_0xb7d9b){if(_0x15792e[_0x64eb('0x10')]){_0x15792e[_0x64eb('0xe')]=htmlToText[_0x64eb('0x11')](_0x15792e['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xb7d9b(null,_0xec6b71);},'afterCreate':function(_0xb6d14f,_0x1b74be,_0x5941f0){var _0x5da7c1=_0x2deef4[_0x64eb('0x12')];var _0xf1f22=_0xb6d14f[_0x64eb('0x13')]({'plain':!![]});if(_0xf1f22[_0x64eb('0x14')][_0x64eb('0x15')]()==='in'||_0xf1f22[_0x64eb('0x14')][_0x64eb('0x15')]()===_0x64eb('0x16')&&!_0xf1f22['secret']&&!_[_0x64eb('0x17')](_0xf1f22[_0x64eb('0x18')])){_0x5da7c1[_0x64eb('0x19')][_0x64eb('0x1a')]({'where':{'id':_0xf1f22[_0x64eb('0x1b')]}})[_0x64eb('0x1c')](function(_0x25c97e){if(_0x25c97e){_0x25c97e[_0x64eb('0x1d')]({'lastMsgAt':_0xf1f22['createdAt'],'lastMsgDirection':_0xf1f22[_0x64eb('0x14')][_0x64eb('0x15')]()});}})[_0x64eb('0x1e')](function(_0x29742f){console['error'](_0x29742f);});}_0x5941f0();}},'charset':'utf8mb4','collate':_0x64eb('0x1f')});}; \ No newline at end of file +var _0x9385=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','out','secret','isNil','UserId','MailInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9385,0x9b));var _0x5938=function(_0x5c528c,_0x30cbae){_0x5c528c=_0x5c528c-0x0;var _0x31a944=_0x9385[_0x5c528c];return _0x31a944;};'use strict';var _=require(_0x5938('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5938('0x1'));var BPromise=require(_0x5938('0x2'));var rp=require(_0x5938('0x3'));var htmlToText=require(_0x5938('0x4'));var fs=require('fs');var path=require(_0x5938('0x5'));var rimraf=require(_0x5938('0x6'));var config=require(_0x5938('0x7'));var attributes=require(_0x5938('0x8'));module[_0x5938('0x9')]=function(_0x313a0e,_0x1fd6d5){return _0x313a0e['define'](_0x5938('0xa'),attributes,{'tableName':_0x5938('0xb'),'paranoid':![],'indexes':[{'name':_0x5938('0xc'),'fields':[_0x5938('0xc')]},{'name':_0x5938('0xd'),'fields':[_0x5938('0xe'),_0x5938('0xf')],'type':_0x5938('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x325f79,_0x3a7ae7,_0x4da0c1){if(_0x325f79[_0x5938('0x11')]){_0x325f79['plainBody']=htmlToText[_0x5938('0x12')](_0x325f79[_0x5938('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4da0c1(null,_0x3a7ae7);},'afterCreate':function(_0x59c336,_0x45c2f9,_0x43b1c3){var _0x3d5c68=_0x313a0e[_0x5938('0x13')];var _0x33028d=_0x59c336[_0x5938('0x14')]({'plain':!![]});if(_0x33028d[_0x5938('0x15')]['toLowerCase']()==='in'||_0x33028d['direction']['toLowerCase']()===_0x5938('0x16')&&!_0x33028d[_0x5938('0x17')]&&!_[_0x5938('0x18')](_0x33028d[_0x5938('0x19')])){_0x3d5c68[_0x5938('0x1a')][_0x5938('0x1b')]({'where':{'id':_0x33028d['MailInteractionId']}})['then'](function(_0x46ff54){if(_0x46ff54){_0x46ff54['update']({'lastMsgAt':_0x33028d[_0x5938('0x1c')],'lastMsgDirection':_0x33028d[_0x5938('0x15')]['toLowerCase']()});}})[_0x5938('0x1d')](function(_0x49245a){console[_0x5938('0x1e')](_0x49245a);});}_0x43b1c3();}},'charset':_0x5938('0x1f'),'collate':_0x5938('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9a51a0b..527a3ea 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 _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x6ed92b,_0x21fea8){var _0x443c72=function(_0x1e309f){while(--_0x1e309f){_0x6ed92b['push'](_0x6ed92b['shift']());}};_0x443c72(++_0x21fea8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x14a8b2,_0x157a99){_0x14a8b2=_0x14a8b2-0x0;var _0x3e40e6=_0xd4f4[_0x14a8b2];return _0x3e40e6;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file +var _0x66fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','request','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify'];(function(_0x24d4f2,_0x72cda9){var _0x16f94f=function(_0x52233f){while(--_0x52233f){_0x24d4f2['push'](_0x24d4f2['shift']());}};_0x16f94f(++_0x72cda9);}(_0x66fa,0x117));var _0xa66f=function(_0x302598,_0x5bea56){_0x302598=_0x302598-0x0;var _0x4c5bb7=_0x66fa[_0x302598];return _0x4c5bb7;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});}exports[_0xa66f('0x18')]=function(_0x408bc7){var _0x251f60=this;return new Promise(function(_0x150291,_0x2033a4){return db[_0xa66f('0x19')][_0xa66f('0x1a')](_0x408bc7[_0xa66f('0x1b')],{'raw':_0x408bc7[_0xa66f('0x1c')]?_0x408bc7[_0xa66f('0x1c')][_0xa66f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x27f570){logger[_0xa66f('0x16')](_0xa66f('0x18'),_0x408bc7);logger[_0xa66f('0x11')]('CreateMailMessage',_0x408bc7,JSON[_0xa66f('0x1e')](_0x27f570));_0x150291(_0x27f570);})[_0xa66f('0x17')](function(_0x209f4d){logger[_0xa66f('0x14')]('CreateMailMessage',_0x209f4d['message'],_0x408bc7);_0x2033a4(_0x251f60[_0xa66f('0x14')](0x1f4,_0x209f4d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f44c3b7..521a310 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 _0x48d0=['register','length','mailMessage:','./mailMessage.events','save','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48d0,0xd3));var _0x048d=function(_0x23261a,_0x2a8022){_0x23261a=_0x23261a-0x0;var _0x5b35b9=_0x48d0[_0x23261a];return _0x5b35b9;};'use strict';var MailMessageEvents=require(_0x048d('0x0'));var events=[_0x048d('0x1'),'remove',_0x048d('0x2')];function createListener(_0x2051c6,_0x13b589){return function(_0x4ec740){_0x13b589[_0x048d('0x3')](_0x2051c6,_0x4ec740);};}function removeListener(_0x1e9131,_0x57d051){return function(){MailMessageEvents[_0x048d('0x4')](_0x1e9131,_0x57d051);};}exports[_0x048d('0x5')]=function(_0x14b983){for(var _0x49c342=0x0,_0x16b9b6=events[_0x048d('0x6')];_0x49c342<_0x16b9b6;_0x49c342++){var _0x54a5f3=events[_0x49c342];var _0x3939cb=createListener(_0x048d('0x7')+_0x54a5f3,_0x14b983);MailMessageEvents['on'](_0x54a5f3,_0x3939cb);}}; \ No newline at end of file +var _0xfb85=['remove','update','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfb85,0x12e));var _0x5fb8=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xfb85[_0x1d1779];return _0x2377e9;};'use strict';var MailMessageEvents=require(_0x5fb8('0x0'));var events=[_0x5fb8('0x1'),_0x5fb8('0x2'),_0x5fb8('0x3')];function createListener(_0x385fc4,_0x5cb84e){return function(_0x345bfc){_0x5cb84e['emit'](_0x385fc4,_0x345bfc);};}function removeListener(_0x5ce886,_0x5dc61d){return function(){MailMessageEvents[_0x5fb8('0x4')](_0x5ce886,_0x5dc61d);};}exports[_0x5fb8('0x5')]=function(_0x136060){for(var _0x2bee8b=0x0,_0x5abea1=events[_0x5fb8('0x6')];_0x2bee8b<_0x5abea1;_0x2bee8b++){var _0x4dbfed=events[_0x2bee8b];var _0x54c454=createListener(_0x5fb8('0x7')+_0x4dbfed,_0x136060);MailMessageEvents['on'](_0x4dbfed,_0x54c454);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e159909..049f81e 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 _0xe7fd=['/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','getTeams','/:id/users','post'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe7fd,0x190));var _0xde7f=function(_0x906680,_0x33e1ce){_0x906680=_0x906680-0x0;var _0x18f494=_0xe7fd[_0x906680];return _0x18f494;};'use strict';var multer=require(_0xde7f('0x0'));var util=require(_0xde7f('0x1'));var path=require(_0xde7f('0x2'));var timeout=require(_0xde7f('0x3'));var express=require('express');var router=express[_0xde7f('0x4')]();var fs_extra=require(_0xde7f('0x5'));var auth=require(_0xde7f('0x6'));var interaction=require(_0xde7f('0x7'));var config=require(_0xde7f('0x8'));var controller=require(_0xde7f('0x9'));router[_0xde7f('0xa')]('/',auth[_0xde7f('0xb')](),controller[_0xde7f('0xc')]);router[_0xde7f('0xa')]('/describe',auth[_0xde7f('0xb')](),controller[_0xde7f('0xd')]);router['get'](_0xde7f('0xe'),auth[_0xde7f('0xb')](),controller[_0xde7f('0xf')]);router[_0xde7f('0xa')]('/:id/members',auth[_0xde7f('0xb')](),controller[_0xde7f('0x10')]);router[_0xde7f('0xa')]('/:id/teams',auth[_0xde7f('0xb')](),controller[_0xde7f('0x11')]);router[_0xde7f('0xa')](_0xde7f('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xde7f('0xb')](),controller['create']);router[_0xde7f('0x13')](_0xde7f('0x14'),auth[_0xde7f('0xb')](),controller[_0xde7f('0x15')]);router[_0xde7f('0x13')]('/:id/users',auth[_0xde7f('0xb')](),controller[_0xde7f('0x16')]);router[_0xde7f('0x17')]('/:id',auth[_0xde7f('0xb')](),controller['update']);router[_0xde7f('0x18')](_0xde7f('0xe'),auth[_0xde7f('0xb')](),controller[_0xde7f('0x19')]);router[_0xde7f('0x18')]('/:id/teams',auth[_0xde7f('0xb')](),controller[_0xde7f('0x1a')]);router[_0xde7f('0x18')]('/:id/users',auth[_0xde7f('0xb')](),controller[_0xde7f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2238=['removeTeams','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','put','update','delete','destroy'];(function(_0x3d432a,_0x4fd459){var _0x5ea3c9=function(_0x4b327a){while(--_0x4b327a){_0x3d432a['push'](_0x3d432a['shift']());}};_0x5ea3c9(++_0x4fd459);}(_0x2238,0x120));var _0x8223=function(_0x129c19,_0x217792){_0x129c19=_0x129c19-0x0;var _0x3a16d5=_0x2238[_0x129c19];return _0x3a16d5;};'use strict';var multer=require('multer');var util=require(_0x8223('0x0'));var path=require('path');var timeout=require(_0x8223('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8223('0x2'));var auth=require(_0x8223('0x3'));var interaction=require(_0x8223('0x4'));var config=require(_0x8223('0x5'));var controller=require(_0x8223('0x6'));router[_0x8223('0x7')]('/',auth[_0x8223('0x8')](),controller[_0x8223('0x9')]);router[_0x8223('0x7')](_0x8223('0xa'),auth['isAuthenticated'](),controller[_0x8223('0xb')]);router['get'](_0x8223('0xc'),auth[_0x8223('0x8')](),controller['show']);router[_0x8223('0x7')](_0x8223('0xd'),auth[_0x8223('0x8')](),controller[_0x8223('0xe')]);router[_0x8223('0x7')](_0x8223('0xf'),auth[_0x8223('0x8')](),controller['getTeams']);router[_0x8223('0x7')](_0x8223('0x10'),auth[_0x8223('0x8')](),controller[_0x8223('0x11')]);router[_0x8223('0x12')]('/',auth[_0x8223('0x8')](),controller[_0x8223('0x13')]);router[_0x8223('0x12')](_0x8223('0xf'),auth[_0x8223('0x8')](),controller['addTeams']);router[_0x8223('0x12')](_0x8223('0x10'),auth[_0x8223('0x8')](),controller['addAgents']);router[_0x8223('0x14')](_0x8223('0xc'),auth[_0x8223('0x8')](),controller[_0x8223('0x15')]);router[_0x8223('0x16')]('/:id',auth[_0x8223('0x8')](),controller[_0x8223('0x17')]);router[_0x8223('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8223('0x18')]);router[_0x8223('0x16')](_0x8223('0x10'),auth[_0x8223('0x8')](),controller['removeAgents']);module[_0x8223('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 838b471..0a3124b 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 _0xd225=['ENUM','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0xd225,0xa4));var _0x5d22=function(_0x4cdea5,_0x3ee1df){_0x4cdea5=_0x4cdea5-0x0;var _0x27f8c3=_0xd225[_0x4cdea5];return _0x27f8c3;};'use strict';var Sequelize=require(_0x5d22('0x0'));module[_0x5d22('0x1')]={'name':{'type':Sequelize[_0x5d22('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5d22('0x2')]},'timeout':{'type':Sequelize[_0x5d22('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5d22('0x4')]('rrmemory',_0x5d22('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xf2d6=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2c9e54,_0x178247){var _0x25d074=function(_0x14e87e){while(--_0x14e87e){_0x2c9e54['push'](_0x2c9e54['shift']());}};_0x25d074(++_0x178247);}(_0xf2d6,0x132));var _0x6f2d=function(_0x1d759a,_0x47e03e){_0x1d759a=_0x1d759a-0x0;var _0x1949a3=_0xf2d6[_0x1d759a];return _0x1949a3;};'use strict';var Sequelize=require('sequelize');module[_0x6f2d('0x0')]={'name':{'type':Sequelize[_0x6f2d('0x1')],'unique':_0x6f2d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f2d('0x1')]},'timeout':{'type':Sequelize[_0x6f2d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6f2d('0x4')](_0x6f2d('0x5'),_0x6f2d('0x6'),_0x6f2d('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 6012b24..958d8d9 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 _0x3dc0=['SIP','mailPause','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit','removeTeams','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','forEach','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','get','MailQueues','UserProfileResource','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','MailQueueId','findAll','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s'];(function(_0x17c378,_0x4ab34b){var _0x36b093=function(_0x4eb6ae){while(--_0x4eb6ae){_0x17c378['push'](_0x17c378['shift']());}};_0x36b093(++_0x4ab34b);}(_0x3dc0,0xad));var _0x03dc=function(_0x1b6d66,_0x331a0f){_0x1b6d66=_0x1b6d66-0x0;var _0x19212d=_0x3dc0[_0x1b6d66];return _0x19212d;};'use strict';var emlformat=require(_0x03dc('0x0'));var rimraf=require(_0x03dc('0x1'));var zipdir=require(_0x03dc('0x2'));var jsonpatch=require(_0x03dc('0x3'));var rp=require(_0x03dc('0x4'));var moment=require(_0x03dc('0x5'));var BPromise=require(_0x03dc('0x6'));var Mustache=require(_0x03dc('0x7'));var util=require(_0x03dc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x03dc('0x9'));var ejs=require(_0x03dc('0xa'));var fs=require('fs');var fs_extra=require(_0x03dc('0xb'));var _=require('lodash');var squel=require(_0x03dc('0xc'));var crypto=require(_0x03dc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03dc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03dc('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x03dc('0x10'));var hardwareService=require(_0x03dc('0x11'));var logger=require(_0x03dc('0x12'))(_0x03dc('0x13'));var utils=require(_0x03dc('0x14'));var config=require(_0x03dc('0x15'));var licenseUtil=require(_0x03dc('0x16'));var db=require(_0x03dc('0x17'))['db'];config[_0x03dc('0x18')]=_[_0x03dc('0x19')](config[_0x03dc('0x18')],{'host':_0x03dc('0x1a'),'port':0x18eb});var socket=require(_0x03dc('0x1b'))(new Redis(config[_0x03dc('0x18')]));require('./mailQueue.socket')[_0x03dc('0x1c')](socket);function respondWithStatusCode(_0x214d18,_0x51ac57){_0x51ac57=_0x51ac57||0xcc;return function(_0x13036f){if(_0x13036f){return _0x214d18[_0x03dc('0x1d')](_0x51ac57);}return _0x214d18[_0x03dc('0x1e')](_0x51ac57)[_0x03dc('0x1f')]();};}function respondWithResult(_0x19961d,_0x36db62){_0x36db62=_0x36db62||0xc8;return function(_0x5ed240){if(_0x5ed240){return _0x19961d[_0x03dc('0x1e')](_0x36db62)[_0x03dc('0x20')](_0x5ed240);}};}function respondWithFilteredResult(_0x2e5a37,_0x22a2d9){return function(_0x58f0f5){if(_0x58f0f5){var _0x1cd238=typeof _0x22a2d9[_0x03dc('0x21')]===_0x03dc('0x22')&&typeof _0x22a2d9[_0x03dc('0x23')]===_0x03dc('0x22');var _0x207c68=_0x58f0f5[_0x03dc('0x24')];var _0x2ec6a8=_0x1cd238?0x0:_0x22a2d9[_0x03dc('0x21')];var _0x30b142=_0x1cd238?_0x58f0f5[_0x03dc('0x24')]:_0x22a2d9[_0x03dc('0x21')]+_0x22a2d9['limit'];var _0x3c75c4;if(_0x30b142>=_0x207c68){_0x30b142=_0x207c68;_0x3c75c4=0xc8;}else{_0x3c75c4=0xce;}_0x2e5a37['status'](_0x3c75c4);return _0x2e5a37['set']('Content-Range',_0x2ec6a8+'-'+_0x30b142+'/'+_0x207c68)['json'](_0x58f0f5);}return null;};}function patchUpdates(_0x5399f2){return function(_0x3d0f6a){try{jsonpatch['apply'](_0x3d0f6a,_0x5399f2,!![]);}catch(_0x508fc1){return BPromise['reject'](_0x508fc1);}return _0x3d0f6a[_0x03dc('0x25')]();};}function saveUpdates(_0x594e45,_0x2c8172){return function(_0x3a00e7){if(_0x3a00e7){return _0x3a00e7[_0x03dc('0x26')](_0x594e45)[_0x03dc('0x27')](function(_0x438169){return _0x438169;});}return null;};}function removeEntity(_0x481fb2,_0x3d9a37){return function(_0x1830af){if(_0x1830af){return _0x1830af[_0x03dc('0x28')]()[_0x03dc('0x27')](function(){var _0x269882=_0x1830af[_0x03dc('0x29')]({'plain':!![]});var _0x19fc05=_0x03dc('0x2a');return db[_0x03dc('0x2b')][_0x03dc('0x28')]({'where':{'type':_0x19fc05,'resourceId':_0x269882['id']}})['then'](function(){return _0x1830af;});})['then'](function(){_0x481fb2[_0x03dc('0x1e')](0xcc)[_0x03dc('0x1f')]();});}};}function handleEntityNotFound(_0x33fe2f,_0x25c9b5){return function(_0x3ef70b){if(!_0x3ef70b){_0x33fe2f['sendStatus'](0x194);}return _0x3ef70b;};}function handleError(_0xb007e4,_0x207ba5){_0x207ba5=_0x207ba5||0x1f4;return function(_0x5e5b9d){logger['error'](_0x5e5b9d[_0x03dc('0x2c')]);if(_0x5e5b9d[_0x03dc('0x2d')]){delete _0x5e5b9d[_0x03dc('0x2d')];}_0xb007e4[_0x03dc('0x1e')](_0x207ba5)[_0x03dc('0x2e')](_0x5e5b9d);};}exports[_0x03dc('0x2f')]=function(_0x674b4,_0x3f6381){var _0x4e5cfd={},_0x271789={},_0x25740d={'count':0x0,'rows':[]};var _0x513b0b=_[_0x03dc('0x30')](db[_0x03dc('0x31')][_0x03dc('0x32')],function(_0x197339){return{'name':_0x197339[_0x03dc('0x33')],'type':_0x197339[_0x03dc('0x34')]['key']};});_0x271789[_0x03dc('0x35')]=_['map'](_0x513b0b,'name');_0x271789[_0x03dc('0x36')]=_[_0x03dc('0x37')](_0x674b4[_0x03dc('0x36')]);_0x271789[_0x03dc('0x38')]=_[_0x03dc('0x39')](_0x271789[_0x03dc('0x35')],_0x271789[_0x03dc('0x36')]);_0x4e5cfd[_0x03dc('0x3a')]=_[_0x03dc('0x39')](_0x271789[_0x03dc('0x35')],qs[_0x03dc('0x3b')](_0x674b4[_0x03dc('0x36')][_0x03dc('0x3b')]));_0x4e5cfd[_0x03dc('0x3a')]=_0x4e5cfd['attributes']['length']?_0x4e5cfd[_0x03dc('0x3a')]:_0x271789['model'];if(!_0x674b4[_0x03dc('0x36')][_0x03dc('0x3c')]('nolimit')){_0x4e5cfd[_0x03dc('0x23')]=qs[_0x03dc('0x23')](_0x674b4[_0x03dc('0x36')][_0x03dc('0x23')]);_0x4e5cfd[_0x03dc('0x21')]=qs['offset'](_0x674b4[_0x03dc('0x36')][_0x03dc('0x21')]);}_0x4e5cfd[_0x03dc('0x3d')]=qs[_0x03dc('0x3e')](_0x674b4['query']['sort']);_0x4e5cfd[_0x03dc('0x3f')]=qs[_0x03dc('0x38')](_[_0x03dc('0x40')](_0x674b4[_0x03dc('0x36')],_0x271789['filters']),_0x513b0b);if(_0x674b4['query'][_0x03dc('0x41')]){_0x4e5cfd[_0x03dc('0x3f')]=_[_0x03dc('0x42')](_0x4e5cfd[_0x03dc('0x3f')],{'$or':_[_0x03dc('0x30')](_0x513b0b,function(_0x499ab5){if(_0x499ab5['type']!=='VIRTUAL'){var _0x5ec0f4={};_0x5ec0f4[_0x499ab5[_0x03dc('0x2d')]]={'$like':'%'+_0x674b4['query']['filter']+'%'};return _0x5ec0f4;}})});}_0x4e5cfd=_[_0x03dc('0x42')]({},_0x4e5cfd,_0x674b4[_0x03dc('0x43')]);var _0x391ed1={'where':_0x4e5cfd[_0x03dc('0x3f')]};return db[_0x03dc('0x31')]['count'](_0x391ed1)[_0x03dc('0x27')](function(_0x34954e){_0x25740d['count']=_0x34954e;if(_0x674b4['query'][_0x03dc('0x44')]){_0x4e5cfd[_0x03dc('0x45')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x4e5cfd);})[_0x03dc('0x27')](function(_0x21e6e2){_0x25740d[_0x03dc('0x46')]=_0x21e6e2;return _0x25740d;})[_0x03dc('0x27')](respondWithFilteredResult(_0x3f6381,_0x4e5cfd))['catch'](handleError(_0x3f6381,null));};exports[_0x03dc('0x47')]=function(_0x317761,_0x1e8569){var _0x260da7={'raw':!![],'where':{'id':_0x317761[_0x03dc('0x48')]['id']}},_0x965cd7={};_0x965cd7['model']=_[_0x03dc('0x37')](db[_0x03dc('0x31')][_0x03dc('0x32')]);_0x965cd7[_0x03dc('0x36')]=_[_0x03dc('0x37')](_0x317761[_0x03dc('0x36')]);_0x965cd7['filters']=_['intersection'](_0x965cd7[_0x03dc('0x35')],_0x965cd7['query']);_0x260da7['attributes']=_[_0x03dc('0x39')](_0x965cd7['model'],qs[_0x03dc('0x3b')](_0x317761[_0x03dc('0x36')][_0x03dc('0x3b')]));_0x260da7['attributes']=_0x260da7[_0x03dc('0x3a')][_0x03dc('0x49')]?_0x260da7[_0x03dc('0x3a')]:_0x965cd7[_0x03dc('0x35')];if(_0x317761[_0x03dc('0x36')][_0x03dc('0x44')]){_0x260da7[_0x03dc('0x45')]=[{'all':!![]}];}_0x260da7=_[_0x03dc('0x42')]({},_0x260da7,_0x317761[_0x03dc('0x43')]);return db[_0x03dc('0x31')][_0x03dc('0x4a')](_0x260da7)[_0x03dc('0x27')](handleEntityNotFound(_0x1e8569,null))[_0x03dc('0x27')](respondWithResult(_0x1e8569,null))['catch'](handleError(_0x1e8569,null));};exports[_0x03dc('0x4b')]=function(_0x26e933,_0x31e836){return db[_0x03dc('0x31')]['create'](_0x26e933[_0x03dc('0x4c')],{})['then'](function(_0x224399){var _0x289a06=_0x26e933[_0x03dc('0x4d')][_0x03dc('0x29')]({'plain':!![]});if(!_0x289a06)throw new Error(_0x03dc('0x4e'));if(_0x289a06[_0x03dc('0x4f')]==='user'){var _0x186eb0=_0x224399[_0x03dc('0x29')]({'plain':!![]});var _0x4e3da1=_0x03dc('0x2a');return db['UserProfileSection'][_0x03dc('0x4a')]({'where':{'name':_0x4e3da1,'userProfileId':_0x289a06['userProfileId']},'raw':!![]})[_0x03dc('0x27')](function(_0x28a324){if(_0x28a324&&_0x28a324[_0x03dc('0x50')]===0x0){return db[_0x03dc('0x2b')][_0x03dc('0x4b')]({'name':_0x186eb0['name'],'resourceId':_0x186eb0['id'],'type':_0x28a324[_0x03dc('0x2d')],'sectionId':_0x28a324['id']},{})[_0x03dc('0x27')](function(){return _0x224399;});}else{return _0x224399;}})[_0x03dc('0x51')](function(_0x2c667a){logger['error'](_0x03dc('0x52'),_0x2c667a);throw _0x2c667a;});}return _0x224399;})[_0x03dc('0x27')](respondWithResult(_0x31e836,0xc9))[_0x03dc('0x51')](handleError(_0x31e836,null));};exports[_0x03dc('0x26')]=function(_0x13f227,_0x2cedf6){if(_0x13f227[_0x03dc('0x4c')]['id']){delete _0x13f227[_0x03dc('0x4c')]['id'];}return db[_0x03dc('0x31')]['find']({'where':{'id':_0x13f227[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](handleEntityNotFound(_0x2cedf6,null))[_0x03dc('0x27')](saveUpdates(_0x13f227[_0x03dc('0x4c')],null))['then'](respondWithResult(_0x2cedf6,null))[_0x03dc('0x51')](handleError(_0x2cedf6,null));};exports[_0x03dc('0x28')]=function(_0x67a3eb,_0x3dc31c){return db['MailQueue'][_0x03dc('0x4a')]({'where':{'id':_0x67a3eb[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](handleEntityNotFound(_0x3dc31c,null))[_0x03dc('0x27')](removeEntity(_0x3dc31c,null))[_0x03dc('0x51')](handleError(_0x3dc31c,null));};exports[_0x03dc('0x53')]=function(_0x4ac242,_0x30e723){return db['MailQueue'][_0x03dc('0x53')]()[_0x03dc('0x27')](respondWithResult(_0x30e723,null))['catch'](handleError(_0x30e723,null));};exports[_0x03dc('0x54')]=function(_0x2fcb1f,_0x401535,_0xc79465){var _0x597f9d={'raw':!![],'where':{}},_0x7d3c61={},_0xc7d1c8;return db[_0x03dc('0x31')][_0x03dc('0x55')]({'where':{'id':_0x2fcb1f[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](handleEntityNotFound(_0x401535,null))[_0x03dc('0x27')](function(_0x4ed943){if(_0x4ed943){_0xc7d1c8=_0x4ed943[_0x03dc('0x29')]({'plain':!![]});_0x7d3c61['model']=_['keys'](db['UserMailQueue'][_0x03dc('0x32')]);_0x7d3c61[_0x03dc('0x36')]=_[_0x03dc('0x37')](_0x2fcb1f[_0x03dc('0x36')]);_0x7d3c61[_0x03dc('0x38')]=_['intersection'](_0x7d3c61[_0x03dc('0x35')],_0x7d3c61[_0x03dc('0x36')]);_0x597f9d['attributes']=_[_0x03dc('0x39')](_0x7d3c61['model'],qs['fields'](_0x2fcb1f['query'][_0x03dc('0x3b')]));_0x597f9d[_0x03dc('0x3a')]=_0x597f9d[_0x03dc('0x3a')][_0x03dc('0x49')]?_0x597f9d[_0x03dc('0x3a')]:_0x7d3c61['model'];if(!_0x2fcb1f[_0x03dc('0x36')]['hasOwnProperty'](_0x03dc('0x56'))){_0x597f9d[_0x03dc('0x23')]=qs[_0x03dc('0x23')](_0x2fcb1f[_0x03dc('0x36')][_0x03dc('0x23')]);_0x597f9d[_0x03dc('0x21')]=qs[_0x03dc('0x21')](_0x2fcb1f[_0x03dc('0x36')][_0x03dc('0x21')]);}_0x597f9d[_0x03dc('0x3d')]=qs[_0x03dc('0x3e')](_0x2fcb1f[_0x03dc('0x36')][_0x03dc('0x3e')]);_0x597f9d['where']=qs[_0x03dc('0x38')](_[_0x03dc('0x40')](_0x2fcb1f['query'],_0x7d3c61['filters']));_0x597f9d['where'][_0x03dc('0x57')]=_0x4ed943['id'];if(_0x2fcb1f['query'][_0x03dc('0x41')]){_0x597f9d[_0x03dc('0x3f')]=_[_0x03dc('0x42')](_0x597f9d[_0x03dc('0x3f')],{'$or':_[_0x03dc('0x30')](_0x597f9d[_0x03dc('0x3a')],function(_0x272a50){var _0x354d84={};_0x354d84[_0x272a50]={'$like':'%'+_0x2fcb1f['query'][_0x03dc('0x41')]+'%'};return _0x354d84;})});}_0x597f9d=_[_0x03dc('0x42')]({},_0x597f9d,_0x2fcb1f[_0x03dc('0x43')]);return db['UserMailQueue'][_0x03dc('0x58')](_0x597f9d);}})['then'](function(_0x9253ee){if(_0x9253ee){return db['User'][_0x03dc('0x59')]({'where':{'id':_['map'](_0x9253ee,'UserId'),'role':_0x03dc('0x5a')},'attributes':['id',_0x03dc('0x2d'),'mailPause',_0x03dc('0x5b'),_0x03dc('0x5c')]});}})[_0x03dc('0x27')](function(_0x368a16){if(_0x368a16){return{'count':_0x368a16[_0x03dc('0x24')],'rows':_[_0x03dc('0x30')](_0x368a16[_0x03dc('0x46')],function(_0x335ec8){return{'membername':_0x335ec8[_0x03dc('0x2d')],'UserId':_0x335ec8['id'],'queue_name':_0xc7d1c8[_0x03dc('0x2d')],'MailQueueId':_0xc7d1c8['id'],'interface':util[_0x03dc('0x5d')](_0x03dc('0x5e'),_0x03dc('0x5f'),_0x335ec8['name']),'penalty':0x0,'paused':_0x335ec8[_0x03dc('0x60')],'createdAt':_0x335ec8[_0x03dc('0x5c')],'updatedAt':_0x335ec8[_0x03dc('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x03dc('0x27')](respondWithFilteredResult(_0x401535,_0x597f9d))[_0x03dc('0x51')](handleError(_0x401535,null));};exports[_0x03dc('0x61')]=function(_0x3062ac,_0x559ed5,_0x1a94f7){var _0x4277ff={};var _0x18b69f={};var _0x23b0e6;var _0x1e1d15;return db[_0x03dc('0x31')][_0x03dc('0x55')]({'where':{'id':_0x3062ac['params']['id']}})['then'](handleEntityNotFound(_0x559ed5,null))[_0x03dc('0x27')](function(_0x1bcc2a){if(_0x1bcc2a){_0x23b0e6=_0x1bcc2a;_0x18b69f[_0x03dc('0x35')]=_[_0x03dc('0x37')](db[_0x03dc('0x62')][_0x03dc('0x32')]);_0x18b69f['query']=_[_0x03dc('0x37')](_0x3062ac[_0x03dc('0x36')]);_0x18b69f[_0x03dc('0x38')]=_[_0x03dc('0x39')](_0x18b69f[_0x03dc('0x35')],_0x18b69f['query']);_0x4277ff[_0x03dc('0x3a')]=_[_0x03dc('0x39')](_0x18b69f[_0x03dc('0x35')],qs['fields'](_0x3062ac[_0x03dc('0x36')][_0x03dc('0x3b')]));_0x4277ff['attributes']=_0x4277ff['attributes'][_0x03dc('0x49')]?_0x4277ff[_0x03dc('0x3a')]:_0x18b69f[_0x03dc('0x35')];_0x4277ff[_0x03dc('0x3d')]=qs[_0x03dc('0x3e')](_0x3062ac['query']['sort']);_0x4277ff[_0x03dc('0x3f')]=qs['filters'](_[_0x03dc('0x40')](_0x3062ac['query'],_0x18b69f[_0x03dc('0x38')]));if(_0x3062ac[_0x03dc('0x36')]['filter']){_0x4277ff[_0x03dc('0x3f')]=_[_0x03dc('0x42')](_0x4277ff[_0x03dc('0x3f')],{'$or':_['map'](_0x4277ff['attributes'],function(_0xe6300c){var _0x1f1bb3={};_0x1f1bb3[_0xe6300c]={'$like':'%'+_0x3062ac[_0x03dc('0x36')][_0x03dc('0x41')]+'%'};return _0x1f1bb3;})});}_0x4277ff=_[_0x03dc('0x42')]({},_0x4277ff,_0x3062ac[_0x03dc('0x43')]);return _0x23b0e6[_0x03dc('0x61')](_0x4277ff);}})[_0x03dc('0x27')](function(_0x431dea){if(_0x431dea){_0x1e1d15=_0x431dea[_0x03dc('0x49')];if(!_0x3062ac[_0x03dc('0x36')][_0x03dc('0x3c')](_0x03dc('0x56'))){_0x4277ff[_0x03dc('0x23')]=qs[_0x03dc('0x23')](_0x3062ac[_0x03dc('0x36')][_0x03dc('0x23')]);_0x4277ff[_0x03dc('0x21')]=qs[_0x03dc('0x21')](_0x3062ac[_0x03dc('0x36')]['offset']);}return _0x23b0e6['getTeams'](_0x4277ff);}})[_0x03dc('0x27')](function(_0x44b1ec){if(_0x44b1ec){return _0x44b1ec?{'count':_0x1e1d15,'rows':_0x44b1ec}:null;}})['then'](respondWithResult(_0x559ed5,null))[_0x03dc('0x51')](handleError(_0x559ed5,null));};exports[_0x03dc('0x63')]=function(_0x709e23,_0x144e32,_0x2c267e){var _0xe9e34e=_0x709e23[_0x03dc('0x4c')][_0x03dc('0x64')];return db['Team']['findAll']({'where':{'id':_0xe9e34e},'attributes':['id'],'include':[{'model':db[_0x03dc('0x65')],'as':_0x03dc('0x66'),'attributes':['id',_0x03dc('0x2d'),_0x03dc('0x67'),_0x03dc('0x68'),'interface'],'raw':!![]}]})[_0x03dc('0x27')](function(_0x2cea60){if(_0x2cea60){var _0x163ebe=_['flatMap'](_0x2cea60,function(_0x17037c){var _0x154c58=_0x17037c[_0x03dc('0x29')]({'plain':!![]});return _0x154c58[_0x03dc('0x66')];});return db['MailQueue'][_0x03dc('0x4a')]({'where':{'id':_0x709e23[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](function(_0x57cc13){return db[_0x03dc('0x69')][_0x03dc('0x6a')](function(_0x4b84c2){return _0x57cc13['addTeams'](_0xe9e34e,{'transaction':_0x4b84c2})[_0x03dc('0x27')](function(){return BPromise[_0x03dc('0x6b')](_0x163ebe,function(_0x279620){return db['UserMailQueue'][_0x03dc('0x6c')]({'where':{'UserId':_0x279620['id'],'MailQueueId':_0x709e23[_0x03dc('0x48')]['id']},'transaction':_0x4b84c2});});})[_0x03dc('0x27')](function(){_0x163ebe['forEach'](function(_0x180014){socket[_0x03dc('0x6d')]('userMailQueue:save',{'UserId':_0x180014['id'],'MailQueueId':_0x57cc13['id']});});});});});}})[_0x03dc('0x27')](respondWithStatusCode(_0x144e32,null))[_0x03dc('0x51')](handleError(_0x144e32,null));};exports[_0x03dc('0x6e')]=function(_0x4cf3e9,_0x568426,_0x121078){return db[_0x03dc('0x62')]['findAll']({'where':{'id':_0x4cf3e9[_0x03dc('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x03dc('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x03dc('0x27')](handleEntityNotFound(_0x568426,null))[_0x03dc('0x27')](function(_0xf46e1a){var _0x2567dd=_[_0x03dc('0x30')](_0xf46e1a,'id');var _0x415fc1=[];var _0x4a5076=[];var _0x5e3e7b=squel['select']();_0x5e3e7b['field'](_0x03dc('0x6f'))[_0x03dc('0x70')](_0x03dc('0x71'),'tq')['join'](_0x03dc('0x72'),'ut',_0x03dc('0x73'))[_0x03dc('0x3f')](_0x03dc('0x74'),_0x4cf3e9[_0x03dc('0x48')]['id']);for(var _0x14b1a3=0x0;_0x14b1a3<_0xf46e1a[_0x03dc('0x49')];_0x14b1a3+=0x1){let _0x48797d=_0xf46e1a[_0x14b1a3];for(var _0x185180=0x0;_0x185180<_0x48797d[_0x03dc('0x66')][_0x03dc('0x49')];_0x185180+=0x1){let _0x360ccd=_0x48797d[_0x03dc('0x66')][_0x185180];var _0x5907aa=_0x5e3e7b[_0x03dc('0x75')]();_0x5907aa[_0x03dc('0x3f')](_0x03dc('0x76'),_0x360ccd['id']);_0x4a5076['push'](db[_0x03dc('0x69')]['query'](_0x5907aa['toString'](),{'type':db['sequelize']['QueryTypes'][_0x03dc('0x77')]})[_0x03dc('0x27')](function(_0x5ac61e){if(_0x5ac61e['length']===0x1){return _0x360ccd['id'];}else{var _0x5a663c=_[_0x03dc('0x78')](_['map'](_0x5ac61e,_0x03dc('0x79')),function(_0x3629c1){return _[_0x03dc('0x7a')](_0x2567dd,_0x3629c1);});if(_0x5a663c){return _0x360ccd['id'];}}}));}}return BPromise[_0x03dc('0x7b')](_0x4a5076)[_0x03dc('0x27')](function(_0x503fb6){_0x415fc1=_(_0x415fc1)[_0x03dc('0x7c')](_0x503fb6)[_0x03dc('0x7d')]()[_0x03dc('0x7e')]();return db[_0x03dc('0x31')][_0x03dc('0x4a')]({'where':{'id':_0x4cf3e9[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](function(_0xe22013){return db['sequelize'][_0x03dc('0x6a')](function(_0x14a966){return _0xe22013['removeTeams'](_0x4cf3e9[_0x03dc('0x36')][_0x03dc('0x64')],{'transaction':_0x14a966})[_0x03dc('0x27')](function(){if(!_['isEmpty'](_0x415fc1)){return _0xe22013[_0x03dc('0x7f')](_0x415fc1,{'transaction':_0x14a966});}})[_0x03dc('0x27')](function(){_0x415fc1[_0x03dc('0x80')](function(_0x1256bb){socket[_0x03dc('0x6d')](_0x03dc('0x81'),{'UserId':_0x1256bb,'MailQueueId':_0xe22013['id']});});});});});});})[_0x03dc('0x27')](respondWithStatusCode(_0x568426,null))[_0x03dc('0x51')](handleError(_0x568426,null));};exports[_0x03dc('0x82')]=function(_0x5b19e4,_0x44a0de,_0x481053){return db[_0x03dc('0x31')]['find']({'where':{'id':_0x5b19e4[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](handleEntityNotFound(_0x44a0de,null))['then'](function(_0x52100a){if(_0x52100a){return _0x52100a[_0x03dc('0x82')](_0x5b19e4[_0x03dc('0x4c')][_0x03dc('0x64')],_[_0x03dc('0x83')](_0x5b19e4['body'],[_0x03dc('0x64'),'id'])||{})['spread'](function(_0x98b786){for(var _0x466ee2=0x0;_0x466ee2<_0x5b19e4[_0x03dc('0x4c')]['ids'][_0x03dc('0x49')];_0x466ee2+=0x1){socket[_0x03dc('0x6d')]('userMailQueue:save',{'UserId':Number(_0x5b19e4[_0x03dc('0x4c')]['ids'][_0x466ee2]),'MailQueueId':Number(_0x5b19e4['params']['id'])});}return _0x98b786;});}})['then'](respondWithResult(_0x44a0de,null))['catch'](handleError(_0x44a0de,null));};exports[_0x03dc('0x7f')]=function(_0x1f5052,_0x326154,_0x279089){return db[_0x03dc('0x31')][_0x03dc('0x4a')]({'where':{'id':_0x1f5052[_0x03dc('0x48')]['id']}})['then'](handleEntityNotFound(_0x326154,null))['then'](function(_0x442e62){if(_0x442e62){return _0x442e62[_0x03dc('0x7f')](_0x1f5052[_0x03dc('0x36')]['ids'])[_0x03dc('0x27')](function(){if(_[_0x03dc('0x84')](_0x1f5052[_0x03dc('0x36')][_0x03dc('0x64')])){for(var _0x455739=0x0;_0x455739<_0x1f5052['query']['ids'][_0x03dc('0x49')];_0x455739+=0x1){socket[_0x03dc('0x6d')](_0x03dc('0x81'),{'UserId':Number(_0x1f5052[_0x03dc('0x36')][_0x03dc('0x64')][_0x455739]),'MailQueueId':Number(_0x1f5052[_0x03dc('0x48')]['id'])});}}else{socket[_0x03dc('0x6d')](_0x03dc('0x81'),{'UserId':Number(_0x1f5052[_0x03dc('0x36')][_0x03dc('0x64')]),'MailQueueId':Number(_0x1f5052['params']['id'])});}});}})[_0x03dc('0x27')](respondWithStatusCode(_0x326154,null))[_0x03dc('0x51')](handleError(_0x326154,null));};exports[_0x03dc('0x85')]=function(_0x25394e,_0x123657,_0xe89046){var _0x37eeca={};var _0x439b49={};var _0x4263f7;var _0x404b9f;return db[_0x03dc('0x31')]['findOne']({'where':{'id':_0x25394e[_0x03dc('0x48')]['id']}})[_0x03dc('0x27')](handleEntityNotFound(_0x123657,null))[_0x03dc('0x27')](function(_0x110e25){if(_0x110e25){_0x4263f7=_0x110e25;_0x439b49[_0x03dc('0x35')]=_['keys'](db[_0x03dc('0x65')]['rawAttributes']);_0x439b49[_0x03dc('0x36')]=_[_0x03dc('0x37')](_0x25394e[_0x03dc('0x36')]);_0x439b49[_0x03dc('0x38')]=_[_0x03dc('0x39')](_0x439b49[_0x03dc('0x35')],_0x439b49[_0x03dc('0x36')]);_0x37eeca[_0x03dc('0x3a')]=_[_0x03dc('0x39')](_0x439b49[_0x03dc('0x35')],qs['fields'](_0x25394e[_0x03dc('0x36')][_0x03dc('0x3b')]));_0x37eeca[_0x03dc('0x3a')]=_0x37eeca[_0x03dc('0x3a')][_0x03dc('0x49')]?_0x37eeca[_0x03dc('0x3a')]:_0x439b49[_0x03dc('0x35')];_0x37eeca[_0x03dc('0x3d')]=qs['sort'](_0x25394e[_0x03dc('0x36')][_0x03dc('0x3e')]);_0x37eeca[_0x03dc('0x3f')]=qs[_0x03dc('0x38')](_['pick'](_0x25394e[_0x03dc('0x36')],_0x439b49[_0x03dc('0x38')]));if(_0x25394e['query']['filter']){_0x37eeca[_0x03dc('0x3f')]=_[_0x03dc('0x42')](_0x37eeca[_0x03dc('0x3f')],{'$or':_[_0x03dc('0x30')](_0x37eeca[_0x03dc('0x3a')],function(_0x500b3f){var _0x289628={};_0x289628[_0x500b3f]={'$like':'%'+_0x25394e[_0x03dc('0x36')]['filter']+'%'};return _0x289628;})});}_0x37eeca=_['merge']({},_0x37eeca,_0x25394e[_0x03dc('0x43')]);return _0x4263f7['getAgents'](_0x37eeca);}})[_0x03dc('0x27')](function(_0x58036e){if(_0x58036e){_0x404b9f=_0x58036e['length'];if(!_0x25394e[_0x03dc('0x36')][_0x03dc('0x3c')]('nolimit')){_0x37eeca[_0x03dc('0x23')]=qs['limit'](_0x25394e['query'][_0x03dc('0x23')]);_0x37eeca[_0x03dc('0x21')]=qs[_0x03dc('0x21')](_0x25394e[_0x03dc('0x36')][_0x03dc('0x21')]);}return _0x4263f7[_0x03dc('0x85')](_0x37eeca);}})['then'](function(_0x2feabd){if(_0x2feabd){return _0x2feabd?{'count':_0x404b9f,'rows':_0x2feabd}:null;}})['then'](respondWithResult(_0x123657,null))[_0x03dc('0x51')](handleError(_0x123657,null));}; \ No newline at end of file +var _0x072f=['findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','value','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','MailQueues','error','stack','index','MailQueue','fieldName','key','model','map','name','query','keys','intersection','attributes','fields','length','order','where','filters','filter','VIRTUAL','merge','includeAll','include','rows','show','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','get','UserMailQueue','hasOwnProperty','nolimit','sort','pick','MailQueueId','UserId','updatedAt','count','format','%s/%s','SIP','mailPause','getTeams','findOne','Team','addTeams','ids','findAll','User','flatMap','Agents','sequelize','transaction','each'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x072f,0x1a7));var _0xf072=function(_0x47d00b,_0x3ea182){_0x47d00b=_0x47d00b-0x0;var _0x551857=_0x072f[_0x47d00b];return _0x551857;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf072('0x0'));var zipdir=require(_0xf072('0x1'));var jsonpatch=require(_0xf072('0x2'));var rp=require(_0xf072('0x3'));var moment=require(_0xf072('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf072('0x5'));var path=require(_0xf072('0x6'));var sox=require(_0xf072('0x7'));var csv=require('to-csv');var ejs=require(_0xf072('0x8'));var fs=require('fs');var fs_extra=require(_0xf072('0x9'));var _=require(_0xf072('0xa'));var squel=require(_0xf072('0xb'));var crypto=require(_0xf072('0xc'));var jsforce=require(_0xf072('0xd'));var deskjs=require(_0xf072('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf072('0xf'));var Papa=require(_0xf072('0x10'));var Redis=require(_0xf072('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf072('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf072('0x13'));var logger=require(_0xf072('0x14'))('api');var utils=require(_0xf072('0x15'));var config=require(_0xf072('0x16'));var licenseUtil=require(_0xf072('0x17'));var db=require(_0xf072('0x18'))['db'];config['redis']=_[_0xf072('0x19')](config[_0xf072('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf072('0x1b'))(new Redis(config['redis']));require(_0xf072('0x1c'))[_0xf072('0x1d')](socket);function respondWithStatusCode(_0x4cf5c9,_0x3949a4){_0x3949a4=_0x3949a4||0xcc;return function(_0x4d7705){if(_0x4d7705){return _0x4cf5c9[_0xf072('0x1e')](_0x3949a4);}return _0x4cf5c9[_0xf072('0x1f')](_0x3949a4)[_0xf072('0x20')]();};}function respondWithResult(_0x288680,_0x38fd50){_0x38fd50=_0x38fd50||0xc8;return function(_0x1c9309){if(_0x1c9309){return _0x288680[_0xf072('0x1f')](_0x38fd50)['json'](_0x1c9309);}};}function respondWithFilteredResult(_0x1ba2ba,_0x4f3d58){return function(_0x551b68){if(_0x551b68){var _0x1bdac8=typeof _0x4f3d58[_0xf072('0x21')]==='undefined'&&typeof _0x4f3d58['limit']===_0xf072('0x22');var _0x2178a3=_0x551b68['count'];var _0x197af5=_0x1bdac8?0x0:_0x4f3d58['offset'];var _0x44724f=_0x1bdac8?_0x551b68['count']:_0x4f3d58['offset']+_0x4f3d58[_0xf072('0x23')];var _0x59c03e;if(_0x44724f>=_0x2178a3){_0x44724f=_0x2178a3;_0x59c03e=0xc8;}else{_0x59c03e=0xce;}_0x1ba2ba[_0xf072('0x1f')](_0x59c03e);return _0x1ba2ba[_0xf072('0x24')](_0xf072('0x25'),_0x197af5+'-'+_0x44724f+'/'+_0x2178a3)[_0xf072('0x26')](_0x551b68);}return null;};}function patchUpdates(_0x2b12b3){return function(_0x5ce568){try{jsonpatch[_0xf072('0x27')](_0x5ce568,_0x2b12b3,!![]);}catch(_0x524e40){return BPromise[_0xf072('0x28')](_0x524e40);}return _0x5ce568[_0xf072('0x29')]();};}function saveUpdates(_0x533264,_0x50d9a7){return function(_0x2d693e){if(_0x2d693e){return _0x2d693e[_0xf072('0x2a')](_0x533264)[_0xf072('0x2b')](function(_0x1ac8ab){return _0x1ac8ab;});}return null;};}function removeEntity(_0x479c77,_0x379261){return function(_0x2c2eb6){if(_0x2c2eb6){return _0x2c2eb6[_0xf072('0x2c')]()[_0xf072('0x2b')](function(){var _0x124482=_0x2c2eb6['get']({'plain':!![]});var _0x30ae99=_0xf072('0x2d');return db['UserProfileResource'][_0xf072('0x2c')]({'where':{'type':_0x30ae99,'resourceId':_0x124482['id']}})['then'](function(){return _0x2c2eb6;});})[_0xf072('0x2b')](function(){_0x479c77[_0xf072('0x1f')](0xcc)[_0xf072('0x20')]();});}};}function handleEntityNotFound(_0x795c80,_0x1b24de){return function(_0x29ef25){if(!_0x29ef25){_0x795c80[_0xf072('0x1e')](0x194);}return _0x29ef25;};}function handleError(_0x257a75,_0x57b698){_0x57b698=_0x57b698||0x1f4;return function(_0x171a83){logger[_0xf072('0x2e')](_0x171a83[_0xf072('0x2f')]);if(_0x171a83['name']){delete _0x171a83['name'];}_0x257a75[_0xf072('0x1f')](_0x57b698)['send'](_0x171a83);};}exports[_0xf072('0x30')]=function(_0x5cd03f,_0x355a7e){var _0xadd541={},_0x28890e={},_0x11cbff={'count':0x0,'rows':[]};var _0x4ba352=_['map'](db[_0xf072('0x31')]['rawAttributes'],function(_0x2fefbe){return{'name':_0x2fefbe[_0xf072('0x32')],'type':_0x2fefbe['type'][_0xf072('0x33')]};});_0x28890e[_0xf072('0x34')]=_[_0xf072('0x35')](_0x4ba352,_0xf072('0x36'));_0x28890e[_0xf072('0x37')]=_[_0xf072('0x38')](_0x5cd03f['query']);_0x28890e['filters']=_[_0xf072('0x39')](_0x28890e['model'],_0x28890e['query']);_0xadd541[_0xf072('0x3a')]=_[_0xf072('0x39')](_0x28890e[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x5cd03f[_0xf072('0x37')][_0xf072('0x3b')]));_0xadd541['attributes']=_0xadd541[_0xf072('0x3a')][_0xf072('0x3c')]?_0xadd541[_0xf072('0x3a')]:_0x28890e['model'];if(!_0x5cd03f[_0xf072('0x37')]['hasOwnProperty']('nolimit')){_0xadd541[_0xf072('0x23')]=qs['limit'](_0x5cd03f[_0xf072('0x37')]['limit']);_0xadd541[_0xf072('0x21')]=qs[_0xf072('0x21')](_0x5cd03f[_0xf072('0x37')]['offset']);}_0xadd541[_0xf072('0x3d')]=qs['sort'](_0x5cd03f[_0xf072('0x37')]['sort']);_0xadd541[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_['pick'](_0x5cd03f[_0xf072('0x37')],_0x28890e['filters']),_0x4ba352);if(_0x5cd03f[_0xf072('0x37')][_0xf072('0x40')]){_0xadd541[_0xf072('0x3e')]=_['merge'](_0xadd541[_0xf072('0x3e')],{'$or':_[_0xf072('0x35')](_0x4ba352,function(_0x36129c){if(_0x36129c['type']!==_0xf072('0x41')){var _0x455374={};_0x455374[_0x36129c[_0xf072('0x36')]]={'$like':'%'+_0x5cd03f['query'][_0xf072('0x40')]+'%'};return _0x455374;}})});}_0xadd541=_[_0xf072('0x42')]({},_0xadd541,_0x5cd03f['options']);var _0x3bdcfa={'where':_0xadd541[_0xf072('0x3e')]};return db['MailQueue']['count'](_0x3bdcfa)[_0xf072('0x2b')](function(_0x54cf1a){_0x11cbff['count']=_0x54cf1a;if(_0x5cd03f[_0xf072('0x37')][_0xf072('0x43')]){_0xadd541[_0xf072('0x44')]=[{'all':!![]}];}return db[_0xf072('0x31')]['findAll'](_0xadd541);})[_0xf072('0x2b')](function(_0x18c13d){_0x11cbff[_0xf072('0x45')]=_0x18c13d;return _0x11cbff;})['then'](respondWithFilteredResult(_0x355a7e,_0xadd541))['catch'](handleError(_0x355a7e,null));};exports[_0xf072('0x46')]=function(_0x263f9,_0x50a04b){var _0xc1965d={'raw':!![],'where':{'id':_0x263f9['params']['id']}},_0x23ae8a={};_0x23ae8a[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x31')][_0xf072('0x47')]);_0x23ae8a[_0xf072('0x37')]=_[_0xf072('0x38')](_0x263f9[_0xf072('0x37')]);_0x23ae8a['filters']=_[_0xf072('0x39')](_0x23ae8a['model'],_0x23ae8a['query']);_0xc1965d['attributes']=_[_0xf072('0x39')](_0x23ae8a[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x263f9[_0xf072('0x37')]['fields']));_0xc1965d[_0xf072('0x3a')]=_0xc1965d['attributes'][_0xf072('0x3c')]?_0xc1965d[_0xf072('0x3a')]:_0x23ae8a['model'];if(_0x263f9[_0xf072('0x37')][_0xf072('0x43')]){_0xc1965d[_0xf072('0x44')]=[{'all':!![]}];}_0xc1965d=_['merge']({},_0xc1965d,_0x263f9[_0xf072('0x48')]);return db[_0xf072('0x31')][_0xf072('0x49')](_0xc1965d)[_0xf072('0x2b')](handleEntityNotFound(_0x50a04b,null))[_0xf072('0x2b')](respondWithResult(_0x50a04b,null))[_0xf072('0x4a')](handleError(_0x50a04b,null));};exports[_0xf072('0x4b')]=function(_0x1f55eb,_0x297da6){return db[_0xf072('0x31')]['create'](_0x1f55eb[_0xf072('0x4c')],{})['then'](function(_0x2b0b10){var _0x59b822=_0x1f55eb[_0xf072('0x4d')]['get']({'plain':!![]});if(!_0x59b822)throw new Error(_0xf072('0x4e'));if(_0x59b822[_0xf072('0x4f')]===_0xf072('0x4d')){var _0x318b67=_0x2b0b10['get']({'plain':!![]});var _0x1371b2=_0xf072('0x2d');return db['UserProfileSection'][_0xf072('0x49')]({'where':{'name':_0x1371b2,'userProfileId':_0x59b822['userProfileId']},'raw':!![]})[_0xf072('0x2b')](function(_0x59eb8f){if(_0x59eb8f&&_0x59eb8f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf072('0x4b')]({'name':_0x318b67[_0xf072('0x36')],'resourceId':_0x318b67['id'],'type':_0x59eb8f[_0xf072('0x36')],'sectionId':_0x59eb8f['id']},{})[_0xf072('0x2b')](function(){return _0x2b0b10;});}else{return _0x2b0b10;}})[_0xf072('0x4a')](function(_0x111a1e){logger['error'](_0xf072('0x50'),_0x111a1e);throw _0x111a1e;});}return _0x2b0b10;})[_0xf072('0x2b')](respondWithResult(_0x297da6,0xc9))[_0xf072('0x4a')](handleError(_0x297da6,null));};exports[_0xf072('0x2a')]=function(_0x56b4b7,_0x51a43c){if(_0x56b4b7[_0xf072('0x4c')]['id']){delete _0x56b4b7[_0xf072('0x4c')]['id'];}return db[_0xf072('0x31')]['find']({'where':{'id':_0x56b4b7[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x51a43c,null))[_0xf072('0x2b')](saveUpdates(_0x56b4b7[_0xf072('0x4c')],null))[_0xf072('0x2b')](respondWithResult(_0x51a43c,null))[_0xf072('0x4a')](handleError(_0x51a43c,null));};exports[_0xf072('0x2c')]=function(_0x59fa26,_0x236438){return db['MailQueue'][_0xf072('0x49')]({'where':{'id':_0x59fa26[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x236438,null))[_0xf072('0x2b')](removeEntity(_0x236438,null))[_0xf072('0x4a')](handleError(_0x236438,null));};exports[_0xf072('0x52')]=function(_0x16f89e,_0x12cb59){return db['MailQueue'][_0xf072('0x52')]()['then'](respondWithResult(_0x12cb59,null))['catch'](handleError(_0x12cb59,null));};exports['getMembers']=function(_0x2befa7,_0xb774d1,_0xaa3880){var _0x37f4b2={'raw':!![],'where':{}},_0x2f8bac={},_0x424427;return db[_0xf072('0x31')]['findOne']({'where':{'id':_0x2befa7[_0xf072('0x51')]['id']}})['then'](handleEntityNotFound(_0xb774d1,null))['then'](function(_0x2d5bc7){if(_0x2d5bc7){_0x424427=_0x2d5bc7[_0xf072('0x53')]({'plain':!![]});_0x2f8bac[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x54')]['rawAttributes']);_0x2f8bac[_0xf072('0x37')]=_[_0xf072('0x38')](_0x2befa7[_0xf072('0x37')]);_0x2f8bac[_0xf072('0x3f')]=_['intersection'](_0x2f8bac[_0xf072('0x34')],_0x2f8bac[_0xf072('0x37')]);_0x37f4b2[_0xf072('0x3a')]=_[_0xf072('0x39')](_0x2f8bac[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x2befa7['query']['fields']));_0x37f4b2[_0xf072('0x3a')]=_0x37f4b2[_0xf072('0x3a')][_0xf072('0x3c')]?_0x37f4b2[_0xf072('0x3a')]:_0x2f8bac[_0xf072('0x34')];if(!_0x2befa7[_0xf072('0x37')][_0xf072('0x55')](_0xf072('0x56'))){_0x37f4b2[_0xf072('0x23')]=qs[_0xf072('0x23')](_0x2befa7[_0xf072('0x37')][_0xf072('0x23')]);_0x37f4b2['offset']=qs[_0xf072('0x21')](_0x2befa7['query'][_0xf072('0x21')]);}_0x37f4b2[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x2befa7[_0xf072('0x37')]['sort']);_0x37f4b2[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_[_0xf072('0x58')](_0x2befa7[_0xf072('0x37')],_0x2f8bac[_0xf072('0x3f')]));_0x37f4b2[_0xf072('0x3e')][_0xf072('0x59')]=_0x2d5bc7['id'];if(_0x2befa7['query'][_0xf072('0x40')]){_0x37f4b2['where']=_['merge'](_0x37f4b2['where'],{'$or':_['map'](_0x37f4b2[_0xf072('0x3a')],function(_0x5e95dc){var _0x1df584={};_0x1df584[_0x5e95dc]={'$like':'%'+_0x2befa7[_0xf072('0x37')]['filter']+'%'};return _0x1df584;})});}_0x37f4b2=_[_0xf072('0x42')]({},_0x37f4b2,_0x2befa7[_0xf072('0x48')]);return db[_0xf072('0x54')]['findAll'](_0x37f4b2);}})[_0xf072('0x2b')](function(_0x2f7de8){if(_0x2f7de8){return db['User']['findAndCountAll']({'where':{'id':_[_0xf072('0x35')](_0x2f7de8,_0xf072('0x5a')),'role':'agent'},'attributes':['id',_0xf072('0x36'),'mailPause',_0xf072('0x5b'),'createdAt']});}})[_0xf072('0x2b')](function(_0x4bb16b){if(_0x4bb16b){return{'count':_0x4bb16b[_0xf072('0x5c')],'rows':_[_0xf072('0x35')](_0x4bb16b[_0xf072('0x45')],function(_0x222790){return{'membername':_0x222790['name'],'UserId':_0x222790['id'],'queue_name':_0x424427[_0xf072('0x36')],'MailQueueId':_0x424427['id'],'interface':util[_0xf072('0x5d')](_0xf072('0x5e'),_0xf072('0x5f'),_0x222790[_0xf072('0x36')]),'penalty':0x0,'paused':_0x222790[_0xf072('0x60')],'createdAt':_0x222790['createdAt'],'updatedAt':_0x222790[_0xf072('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf072('0x2b')](respondWithFilteredResult(_0xb774d1,_0x37f4b2))[_0xf072('0x4a')](handleError(_0xb774d1,null));};exports[_0xf072('0x61')]=function(_0x10b026,_0x2ed98e,_0x36c9bd){var _0x424700={};var _0x570867={};var _0x53b7d8;var _0x43b3fc;return db['MailQueue'][_0xf072('0x62')]({'where':{'id':_0x10b026['params']['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x2ed98e,null))['then'](function(_0x4dc05e){if(_0x4dc05e){_0x53b7d8=_0x4dc05e;_0x570867[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x63')][_0xf072('0x47')]);_0x570867[_0xf072('0x37')]=_[_0xf072('0x38')](_0x10b026[_0xf072('0x37')]);_0x570867[_0xf072('0x3f')]=_['intersection'](_0x570867[_0xf072('0x34')],_0x570867[_0xf072('0x37')]);_0x424700[_0xf072('0x3a')]=_['intersection'](_0x570867[_0xf072('0x34')],qs['fields'](_0x10b026[_0xf072('0x37')][_0xf072('0x3b')]));_0x424700[_0xf072('0x3a')]=_0x424700[_0xf072('0x3a')][_0xf072('0x3c')]?_0x424700[_0xf072('0x3a')]:_0x570867[_0xf072('0x34')];_0x424700[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x10b026[_0xf072('0x37')]['sort']);_0x424700[_0xf072('0x3e')]=qs[_0xf072('0x3f')](_[_0xf072('0x58')](_0x10b026[_0xf072('0x37')],_0x570867['filters']));if(_0x10b026[_0xf072('0x37')][_0xf072('0x40')]){_0x424700['where']=_[_0xf072('0x42')](_0x424700['where'],{'$or':_[_0xf072('0x35')](_0x424700['attributes'],function(_0x1a714c){var _0x4fabb0={};_0x4fabb0[_0x1a714c]={'$like':'%'+_0x10b026[_0xf072('0x37')][_0xf072('0x40')]+'%'};return _0x4fabb0;})});}_0x424700=_['merge']({},_0x424700,_0x10b026[_0xf072('0x48')]);return _0x53b7d8[_0xf072('0x61')](_0x424700);}})[_0xf072('0x2b')](function(_0xe86e1e){if(_0xe86e1e){_0x43b3fc=_0xe86e1e['length'];if(!_0x10b026[_0xf072('0x37')]['hasOwnProperty'](_0xf072('0x56'))){_0x424700[_0xf072('0x23')]=qs['limit'](_0x10b026[_0xf072('0x37')]['limit']);_0x424700[_0xf072('0x21')]=qs['offset'](_0x10b026[_0xf072('0x37')][_0xf072('0x21')]);}return _0x53b7d8[_0xf072('0x61')](_0x424700);}})['then'](function(_0x2b542e){if(_0x2b542e){return _0x2b542e?{'count':_0x43b3fc,'rows':_0x2b542e}:null;}})[_0xf072('0x2b')](respondWithResult(_0x2ed98e,null))[_0xf072('0x4a')](handleError(_0x2ed98e,null));};exports[_0xf072('0x64')]=function(_0x180cb5,_0x2b1d0f,_0x3f98ed){var _0x1198c7=_0x180cb5[_0xf072('0x4c')][_0xf072('0x65')];return db[_0xf072('0x63')][_0xf072('0x66')]({'where':{'id':_0x1198c7},'attributes':['id'],'include':[{'model':db[_0xf072('0x67')],'as':'Agents','attributes':['id',_0xf072('0x36'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x6dcbed){if(_0x6dcbed){var _0x16e76c=_[_0xf072('0x68')](_0x6dcbed,function(_0x49f5e0){var _0x2f28e4=_0x49f5e0['get']({'plain':!![]});return _0x2f28e4[_0xf072('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x180cb5[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](function(_0x25e6a2){return db[_0xf072('0x6a')][_0xf072('0x6b')](function(_0x476948){return _0x25e6a2[_0xf072('0x64')](_0x1198c7,{'transaction':_0x476948})[_0xf072('0x2b')](function(){return BPromise[_0xf072('0x6c')](_0x16e76c,function(_0x4da3da){return db[_0xf072('0x54')][_0xf072('0x6d')]({'where':{'UserId':_0x4da3da['id'],'MailQueueId':_0x180cb5[_0xf072('0x51')]['id']},'transaction':_0x476948});});})[_0xf072('0x2b')](function(){_0x16e76c[_0xf072('0x6e')](function(_0xd34886){socket['emit'](_0xf072('0x6f'),{'UserId':_0xd34886['id'],'MailQueueId':_0x25e6a2['id']});});});});});}})[_0xf072('0x2b')](respondWithStatusCode(_0x2b1d0f,null))['catch'](handleError(_0x2b1d0f,null));};exports[_0xf072('0x70')]=function(_0x2cb96f,_0x461b5,_0x100ce0){return db[_0xf072('0x63')][_0xf072('0x66')]({'where':{'id':_0x2cb96f[_0xf072('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf072('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf072('0x2b')](handleEntityNotFound(_0x461b5,null))[_0xf072('0x2b')](function(_0x32e516){var _0x42d305=_['map'](_0x32e516,'id');var _0x2ddcaf=[];var _0x11ab02=[];var _0x486221=squel[_0xf072('0x71')]();_0x486221[_0xf072('0x72')](_0xf072('0x73'))[_0xf072('0x74')](_0xf072('0x75'),'tq')['join']('user_has_teams','ut',_0xf072('0x76'))[_0xf072('0x3e')]('MailQueueId\x20=\x20?',_0x2cb96f['params']['id']);for(var _0x3febb1=0x0;_0x3febb1<_0x32e516[_0xf072('0x3c')];_0x3febb1+=0x1){let _0x293a74=_0x32e516[_0x3febb1];for(var _0x4c760c=0x0;_0x4c760c<_0x293a74[_0xf072('0x69')]['length'];_0x4c760c+=0x1){let _0x285dbd=_0x293a74[_0xf072('0x69')][_0x4c760c];var _0x164101=_0x486221['clone']();_0x164101[_0xf072('0x3e')](_0xf072('0x77'),_0x285dbd['id']);_0x11ab02[_0xf072('0x78')](db[_0xf072('0x6a')][_0xf072('0x37')](_0x164101[_0xf072('0x79')](),{'type':db[_0xf072('0x6a')][_0xf072('0x7a')][_0xf072('0x7b')]})[_0xf072('0x2b')](function(_0x54c44d){if(_0x54c44d[_0xf072('0x3c')]===0x1){return _0x285dbd['id'];}else{var _0xdfa554=_['every'](_[_0xf072('0x35')](_0x54c44d,'TeamId'),function(_0x51c860){return _['includes'](_0x42d305,_0x51c860);});if(_0xdfa554){return _0x285dbd['id'];}}}));}}return BPromise[_0xf072('0x7c')](_0x11ab02)['then'](function(_0x4c2fa5){_0x2ddcaf=_(_0x2ddcaf)['union'](_0x4c2fa5)['compact']()[_0xf072('0x7d')]();return db[_0xf072('0x31')][_0xf072('0x49')]({'where':{'id':_0x2cb96f[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](function(_0x3f347a){return db[_0xf072('0x6a')]['transaction'](function(_0x1f0312){return _0x3f347a[_0xf072('0x70')](_0x2cb96f[_0xf072('0x37')][_0xf072('0x65')],{'transaction':_0x1f0312})[_0xf072('0x2b')](function(){if(!_['isEmpty'](_0x2ddcaf)){return _0x3f347a[_0xf072('0x7e')](_0x2ddcaf,{'transaction':_0x1f0312});}})[_0xf072('0x2b')](function(){_0x2ddcaf[_0xf072('0x6e')](function(_0x49cb0c){socket[_0xf072('0x7f')](_0xf072('0x80'),{'UserId':_0x49cb0c,'MailQueueId':_0x3f347a['id']});});});});});});})[_0xf072('0x2b')](respondWithStatusCode(_0x461b5,null))[_0xf072('0x4a')](handleError(_0x461b5,null));};exports['addAgents']=function(_0x3dce36,_0x2df4ca,_0x424fd7){return db[_0xf072('0x31')]['find']({'where':{'id':_0x3dce36[_0xf072('0x51')]['id']}})['then'](handleEntityNotFound(_0x2df4ca,null))[_0xf072('0x2b')](function(_0x285d58){if(_0x285d58){return _0x285d58[_0xf072('0x81')](_0x3dce36[_0xf072('0x4c')]['ids'],_[_0xf072('0x82')](_0x3dce36[_0xf072('0x4c')],[_0xf072('0x65'),'id'])||{})['spread'](function(_0x31edbe){for(var _0x5f5819=0x0;_0x5f5819<_0x3dce36[_0xf072('0x4c')][_0xf072('0x65')][_0xf072('0x3c')];_0x5f5819+=0x1){socket[_0xf072('0x7f')](_0xf072('0x6f'),{'UserId':Number(_0x3dce36[_0xf072('0x4c')][_0xf072('0x65')][_0x5f5819]),'MailQueueId':Number(_0x3dce36[_0xf072('0x51')]['id'])});}return _0x31edbe;});}})[_0xf072('0x2b')](respondWithResult(_0x2df4ca,null))[_0xf072('0x4a')](handleError(_0x2df4ca,null));};exports[_0xf072('0x7e')]=function(_0x5a73cc,_0x4b82c9,_0x49b0c0){return db[_0xf072('0x31')][_0xf072('0x49')]({'where':{'id':_0x5a73cc['params']['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x4b82c9,null))['then'](function(_0x15f807){if(_0x15f807){return _0x15f807[_0xf072('0x7e')](_0x5a73cc[_0xf072('0x37')]['ids'])['then'](function(){if(_[_0xf072('0x83')](_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')])){for(var _0x347938=0x0;_0x347938<_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')][_0xf072('0x3c')];_0x347938+=0x1){socket['emit'](_0xf072('0x80'),{'UserId':Number(_0x5a73cc[_0xf072('0x37')][_0xf072('0x65')][_0x347938]),'MailQueueId':Number(_0x5a73cc[_0xf072('0x51')]['id'])});}}else{socket[_0xf072('0x7f')](_0xf072('0x80'),{'UserId':Number(_0x5a73cc['query'][_0xf072('0x65')]),'MailQueueId':Number(_0x5a73cc[_0xf072('0x51')]['id'])});}});}})[_0xf072('0x2b')](respondWithStatusCode(_0x4b82c9,null))['catch'](handleError(_0x4b82c9,null));};exports[_0xf072('0x84')]=function(_0x443096,_0x2d1228,_0x123c7f){var _0x153c30={};var _0x1a6673={};var _0x1d53f3;var _0xcd6225;return db[_0xf072('0x31')][_0xf072('0x62')]({'where':{'id':_0x443096[_0xf072('0x51')]['id']}})[_0xf072('0x2b')](handleEntityNotFound(_0x2d1228,null))[_0xf072('0x2b')](function(_0x82a35){if(_0x82a35){_0x1d53f3=_0x82a35;_0x1a6673[_0xf072('0x34')]=_[_0xf072('0x38')](db[_0xf072('0x67')]['rawAttributes']);_0x1a6673[_0xf072('0x37')]=_[_0xf072('0x38')](_0x443096[_0xf072('0x37')]);_0x1a6673[_0xf072('0x3f')]=_[_0xf072('0x39')](_0x1a6673['model'],_0x1a6673[_0xf072('0x37')]);_0x153c30[_0xf072('0x3a')]=_['intersection'](_0x1a6673[_0xf072('0x34')],qs[_0xf072('0x3b')](_0x443096['query'][_0xf072('0x3b')]));_0x153c30[_0xf072('0x3a')]=_0x153c30[_0xf072('0x3a')]['length']?_0x153c30['attributes']:_0x1a6673[_0xf072('0x34')];_0x153c30[_0xf072('0x3d')]=qs[_0xf072('0x57')](_0x443096[_0xf072('0x37')][_0xf072('0x57')]);_0x153c30['where']=qs['filters'](_[_0xf072('0x58')](_0x443096[_0xf072('0x37')],_0x1a6673['filters']));if(_0x443096[_0xf072('0x37')]['filter']){_0x153c30[_0xf072('0x3e')]=_[_0xf072('0x42')](_0x153c30['where'],{'$or':_['map'](_0x153c30['attributes'],function(_0x47f4e4){var _0xbb6fb={};_0xbb6fb[_0x47f4e4]={'$like':'%'+_0x443096['query'][_0xf072('0x40')]+'%'};return _0xbb6fb;})});}_0x153c30=_[_0xf072('0x42')]({},_0x153c30,_0x443096[_0xf072('0x48')]);return _0x1d53f3['getAgents'](_0x153c30);}})[_0xf072('0x2b')](function(_0x8fd3c0){if(_0x8fd3c0){_0xcd6225=_0x8fd3c0[_0xf072('0x3c')];if(!_0x443096[_0xf072('0x37')][_0xf072('0x55')](_0xf072('0x56'))){_0x153c30['limit']=qs['limit'](_0x443096['query']['limit']);_0x153c30[_0xf072('0x21')]=qs['offset'](_0x443096[_0xf072('0x37')]['offset']);}return _0x1d53f3[_0xf072('0x84')](_0x153c30);}})[_0xf072('0x2b')](function(_0x5c4303){if(_0x5c4303){return _0x5c4303?{'count':_0xcd6225,'rows':_0x5c4303}:null;}})['then'](respondWithResult(_0x2d1228,null))[_0xf072('0x4a')](handleError(_0x2d1228,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a25e334..a0171c6 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 _0xdca9=['emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','save','update','remove'];(function(_0x4d8aff,_0x106ac5){var _0x243021=function(_0x965e00){while(--_0x965e00){_0x4d8aff['push'](_0x4d8aff['shift']());}};_0x243021(++_0x106ac5);}(_0xdca9,0xed));var _0x9dca=function(_0x231d17,_0xd73f51){_0x231d17=_0x231d17-0x0;var _0x2a6c20=_0xdca9[_0x231d17];return _0x2a6c20;};'use strict';var EventEmitter=require(_0x9dca('0x0'));var MailQueue=require(_0x9dca('0x1'))['db'][_0x9dca('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9dca('0x3'),'afterUpdate':_0x9dca('0x4'),'afterDestroy':_0x9dca('0x5')};function emitEvent(_0x5d703a){return function(_0x4cf1f5,_0x202993,_0x91c4ae){MailQueueEvents[_0x9dca('0x6')](_0x5d703a+':'+_0x4cf1f5['id'],_0x4cf1f5);MailQueueEvents[_0x9dca('0x6')](_0x5d703a,_0x4cf1f5);_0x91c4ae(null);};}for(var e in events){if(events[_0x9dca('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x9dca('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x1d5d=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0xa6b197,_0x8fd003){var _0x528a53=function(_0xe0c8c){while(--_0xe0c8c){_0xa6b197['push'](_0xa6b197['shift']());}};_0x528a53(++_0x8fd003);}(_0x1d5d,0x130));var _0xd1d5=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x1d5d[_0xf0bcac];return _0x4e4c65;};'use strict';var EventEmitter=require(_0xd1d5('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xd1d5('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd1d5('0x2')](0x0);var events={'afterCreate':_0xd1d5('0x3'),'afterUpdate':_0xd1d5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbebe6e){return function(_0x48ba26,_0x7995cc,_0x5004a1){MailQueueEvents[_0xd1d5('0x5')](_0xbebe6e+':'+_0x48ba26['id'],_0x48ba26);MailQueueEvents['emit'](_0xbebe6e,_0x48ba26);_0x5004a1(null);};}for(var e in events){if(events[_0xd1d5('0x6')](e)){var event=events[e];MailQueue[_0xd1d5('0x7')](e,emitEvent(event));}}module[_0xd1d5('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f6e92b0..47f8488 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 _0x7eb6=['define','MailQueue','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x1bfdf9,_0x4b8e5d){var _0x28db37=function(_0x4e2587){while(--_0x4e2587){_0x1bfdf9['push'](_0x1bfdf9['shift']());}};_0x28db37(++_0x4b8e5d);}(_0x7eb6,0x157));var _0x67eb=function(_0x571c8e,_0x18546d){_0x571c8e=_0x571c8e-0x0;var _0x1fe343=_0x7eb6[_0x571c8e];return _0x1fe343;};'use strict';var _=require(_0x67eb('0x0'));var util=require(_0x67eb('0x1'));var logger=require('../../config/logger')(_0x67eb('0x2'));var moment=require(_0x67eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x67eb('0x4'));var fs=require('fs');var path=require(_0x67eb('0x5'));var rimraf=require(_0x67eb('0x6'));var config=require(_0x67eb('0x7'));var attributes=require(_0x67eb('0x8'));module['exports']=function(_0x45360d,_0x300e5d){return _0x45360d[_0x67eb('0x9')](_0x67eb('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc53b=['rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa184c6,_0x392368){var _0x4d4168=function(_0x4f9739){while(--_0x4f9739){_0xa184c6['push'](_0xa184c6['shift']());}};_0x4d4168(++_0x392368);}(_0xc53b,0x13d));var _0xbc53=function(_0x4ddd16,_0x2fb20b){_0x4ddd16=_0x4ddd16-0x0;var _0x3bedbc=_0xc53b[_0x4ddd16];return _0x3bedbc;};'use strict';var _=require(_0xbc53('0x0'));var util=require(_0xbc53('0x1'));var logger=require(_0xbc53('0x2'))(_0xbc53('0x3'));var moment=require(_0xbc53('0x4'));var BPromise=require(_0xbc53('0x5'));var rp=require(_0xbc53('0x6'));var fs=require('fs');var path=require(_0xbc53('0x7'));var rimraf=require(_0xbc53('0x8'));var config=require(_0xbc53('0x9'));var attributes=require(_0xbc53('0xa'));module['exports']=function(_0x25b5aa,_0x54f017){return _0x25b5aa['define'](_0xbc53('0xb'),attributes,{'tableName':_0xbc53('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 3e3c502..8cd9727 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 _0x6b7b=['request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','MailQueue','findAll','options','raw','where','attributes','include','map','model','GetMailQueue','ShowMailQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info'];(function(_0x11e5d0,_0x3a901e){var _0x4db806=function(_0x119ea5){while(--_0x119ea5){_0x11e5d0['push'](_0x11e5d0['shift']());}};_0x4db806(++_0x3a901e);}(_0x6b7b,0x93));var _0xb6b7=function(_0x31c113,_0x16baaf){_0x31c113=_0x31c113-0x0;var _0x1ed2d3=_0x6b7b[_0x31c113];return _0x1ed2d3;};'use strict';var _=require('lodash');var util=require(_0xb6b7('0x0'));var moment=require(_0xb6b7('0x1'));var BPromise=require(_0xb6b7('0x2'));var rs=require(_0xb6b7('0x3'));var fs=require('fs');var Redis=require(_0xb6b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6b7('0x5'));var logger=require(_0xb6b7('0x6'))(_0xb6b7('0x7'));var config=require(_0xb6b7('0x8'));var jayson=require(_0xb6b7('0x9'));var client=jayson[_0xb6b7('0xa')][_0xb6b7('0xb')]({'port':0x232a});config[_0xb6b7('0xc')]=_[_0xb6b7('0xd')](config[_0xb6b7('0xc')],{'host':_0xb6b7('0xe'),'port':0x18eb});var socket=require(_0xb6b7('0xf'))(new Redis(config['redis']));require(_0xb6b7('0x10'))[_0xb6b7('0x11')](socket);function respondWithRpcPromise(_0x5a4700,_0x8b9add,_0x3531c2){return new BPromise(function(_0x2ef1ed,_0x239892){return client[_0xb6b7('0x12')](_0x5a4700,_0x3531c2)[_0xb6b7('0x13')](function(_0x2b3da7){logger[_0xb6b7('0x14')]('MailQueue,\x20%s,\x20%s',_0x8b9add,_0xb6b7('0x15'));logger['debug'](_0xb6b7('0x16'),_0x8b9add,_0xb6b7('0x15'),JSON[_0xb6b7('0x17')](_0x2b3da7));if(_0x2b3da7[_0xb6b7('0x18')]){if(_0x2b3da7[_0xb6b7('0x18')][_0xb6b7('0x19')]===0x1f4){logger[_0xb6b7('0x18')](_0xb6b7('0x1a'),_0x8b9add,_0x2b3da7[_0xb6b7('0x18')][_0xb6b7('0x1b')]);return _0x239892(_0x2b3da7[_0xb6b7('0x18')][_0xb6b7('0x1b')]);}logger[_0xb6b7('0x18')](_0xb6b7('0x1a'),_0x8b9add,_0x2b3da7[_0xb6b7('0x18')][_0xb6b7('0x1b')]);return _0x2ef1ed(_0x2b3da7[_0xb6b7('0x18')][_0xb6b7('0x1b')]);}else{logger[_0xb6b7('0x14')](_0xb6b7('0x1a'),_0x8b9add,_0xb6b7('0x15'));_0x2ef1ed(_0x2b3da7[_0xb6b7('0x1c')][_0xb6b7('0x1b')]);}})[_0xb6b7('0x1d')](function(_0x6a3e82){logger[_0xb6b7('0x18')](_0xb6b7('0x1a'),_0x8b9add,_0x6a3e82);_0x239892(_0x6a3e82);});});}exports['GetMailQueue']=function(_0xc6ec0e){var _0x30b227=this;return new Promise(function(_0x4a0c7e,_0x255d70){return db[_0xb6b7('0x1e')][_0xb6b7('0x1f')]({'raw':_0xc6ec0e['options']?_0xc6ec0e[_0xb6b7('0x20')][_0xb6b7('0x21')]===undefined?!![]:![]:!![],'where':_0xc6ec0e[_0xb6b7('0x20')]?_0xc6ec0e['options'][_0xb6b7('0x22')]||null:null,'attributes':_0xc6ec0e['options']?_0xc6ec0e[_0xb6b7('0x20')][_0xb6b7('0x23')]||null:null,'limit':_0xc6ec0e['options']?_0xc6ec0e[_0xb6b7('0x20')]['limit']||null:null,'include':_0xc6ec0e[_0xb6b7('0x20')]?_0xc6ec0e['options'][_0xb6b7('0x24')]?_[_0xb6b7('0x25')](_0xc6ec0e[_0xb6b7('0x20')][_0xb6b7('0x24')],function(_0x48a7fd){return{'model':db[_0x48a7fd[_0xb6b7('0x26')]],'as':_0x48a7fd['as'],'attributes':_0x48a7fd['attributes'],'include':_0x48a7fd[_0xb6b7('0x24')]?_['map'](_0x48a7fd[_0xb6b7('0x24')],function(_0x5de518){return{'model':db[_0x5de518['model']],'as':_0x5de518['as'],'attributes':_0x5de518[_0xb6b7('0x23')],'include':_0x5de518[_0xb6b7('0x24')]?_['map'](_0x5de518[_0xb6b7('0x24')],function(_0x26a67c){return{'model':db[_0x26a67c[_0xb6b7('0x26')]],'as':_0x26a67c['as'],'attributes':_0x26a67c[_0xb6b7('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb6b7('0x13')](function(_0x25ac89){logger['info'](_0xb6b7('0x27'),_0xc6ec0e);logger['debug'](_0xb6b7('0x27'),_0xc6ec0e,JSON['stringify'](_0x25ac89));_0x4a0c7e(_0x25ac89);})[_0xb6b7('0x1d')](function(_0x1b2be1){logger[_0xb6b7('0x18')](_0xb6b7('0x27'),_0x1b2be1[_0xb6b7('0x1b')],_0xc6ec0e);_0x255d70(_0x30b227[_0xb6b7('0x18')](0x1f4,_0x1b2be1['message']));});});};exports[_0xb6b7('0x28')]=function(_0x41d718){var _0x3ebf8f=this;return new Promise(function(_0x24e652,_0x25a4f0){return db['MailQueue'][_0xb6b7('0x29')]({'raw':_0x41d718[_0xb6b7('0x20')]?_0x41d718[_0xb6b7('0x20')][_0xb6b7('0x21')]===undefined?!![]:![]:!![],'where':_0x41d718[_0xb6b7('0x20')]?_0x41d718[_0xb6b7('0x20')][_0xb6b7('0x22')]||null:null,'attributes':_0x41d718[_0xb6b7('0x20')]?_0x41d718[_0xb6b7('0x20')]['attributes']||null:null,'include':_0x41d718[_0xb6b7('0x20')]?_0x41d718[_0xb6b7('0x20')][_0xb6b7('0x24')]?_[_0xb6b7('0x25')](_0x41d718[_0xb6b7('0x20')]['include'],function(_0x2ffd27){return{'model':db[_0x2ffd27[_0xb6b7('0x26')]],'as':_0x2ffd27['as'],'attributes':_0x2ffd27['attributes'],'include':_0x2ffd27['include']?_[_0xb6b7('0x25')](_0x2ffd27[_0xb6b7('0x24')],function(_0x2a9cff){return{'model':db[_0x2a9cff[_0xb6b7('0x26')]],'as':_0x2a9cff['as'],'attributes':_0x2a9cff['attributes'],'include':_0x2a9cff[_0xb6b7('0x24')]?_[_0xb6b7('0x25')](_0x2a9cff[_0xb6b7('0x24')],function(_0x19152c){return{'model':db[_0x19152c['model']],'as':_0x19152c['as'],'attributes':_0x19152c[_0xb6b7('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb6b7('0x13')](function(_0x38349e){logger[_0xb6b7('0x14')](_0xb6b7('0x28'),_0x41d718);logger['debug']('ShowMailQueue',_0x41d718,JSON['stringify'](_0x38349e));_0x24e652(_0x38349e);})[_0xb6b7('0x1d')](function(_0x13e373){logger[_0xb6b7('0x18')](_0xb6b7('0x28'),_0x13e373[_0xb6b7('0x1b')],_0x41d718);_0x25a4f0(_0x3ebf8f[_0xb6b7('0x18')](0x1f4,_0x13e373[_0xb6b7('0x1b')]));});});}; \ No newline at end of file +var _0x602a=['options','where','attributes','include','map','model','then','debug','ShowMailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetMailQueue','MailQueue','findAll'];(function(_0x117685,_0x4e6e90){var _0x4e3666=function(_0x2f87d2){while(--_0x2f87d2){_0x117685['push'](_0x117685['shift']());}};_0x4e3666(++_0x4e6e90);}(_0x602a,0x1de));var _0xa602=function(_0x3ec5f8,_0x4e622a){_0x3ec5f8=_0x3ec5f8-0x0;var _0x309109=_0x602a[_0x3ec5f8];return _0x309109;};'use strict';var _=require(_0xa602('0x0'));var util=require('util');var moment=require(_0xa602('0x1'));var BPromise=require(_0xa602('0x2'));var rs=require(_0xa602('0x3'));var fs=require('fs');var Redis=require(_0xa602('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa602('0x5'));var logger=require(_0xa602('0x6'))('rpc');var config=require(_0xa602('0x7'));var jayson=require(_0xa602('0x8'));var client=jayson[_0xa602('0x9')][_0xa602('0xa')]({'port':0x232a});config['redis']=_[_0xa602('0xb')](config[_0xa602('0xc')],{'host':_0xa602('0xd'),'port':0x18eb});var socket=require(_0xa602('0xe'))(new Redis(config[_0xa602('0xc')]));require(_0xa602('0xf'))['register'](socket);function respondWithRpcPromise(_0xc3bddc,_0x198c0c,_0x2d823f){return new BPromise(function(_0x533f76,_0x5ecffe){return client['request'](_0xc3bddc,_0x2d823f)['then'](function(_0x331ffa){logger[_0xa602('0x10')](_0xa602('0x11'),_0x198c0c,_0xa602('0x12'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x198c0c,_0xa602('0x12'),JSON[_0xa602('0x13')](_0x331ffa));if(_0x331ffa[_0xa602('0x14')]){if(_0x331ffa['error']['code']===0x1f4){logger[_0xa602('0x14')](_0xa602('0x11'),_0x198c0c,_0x331ffa[_0xa602('0x14')][_0xa602('0x15')]);return _0x5ecffe(_0x331ffa[_0xa602('0x14')][_0xa602('0x15')]);}logger[_0xa602('0x14')](_0xa602('0x11'),_0x198c0c,_0x331ffa[_0xa602('0x14')][_0xa602('0x15')]);return _0x533f76(_0x331ffa[_0xa602('0x14')][_0xa602('0x15')]);}else{logger[_0xa602('0x10')](_0xa602('0x11'),_0x198c0c,_0xa602('0x12'));_0x533f76(_0x331ffa['result'][_0xa602('0x15')]);}})[_0xa602('0x16')](function(_0x1eac73){logger[_0xa602('0x14')](_0xa602('0x11'),_0x198c0c,_0x1eac73);_0x5ecffe(_0x1eac73);});});}exports[_0xa602('0x17')]=function(_0x433732){var _0x1ddc59=this;return new Promise(function(_0x1ffc2a,_0x5b3ad9){return db[_0xa602('0x18')][_0xa602('0x19')]({'raw':_0x433732['options']?_0x433732['options']['raw']===undefined?!![]:![]:!![],'where':_0x433732[_0xa602('0x1a')]?_0x433732[_0xa602('0x1a')][_0xa602('0x1b')]||null:null,'attributes':_0x433732[_0xa602('0x1a')]?_0x433732[_0xa602('0x1a')][_0xa602('0x1c')]||null:null,'limit':_0x433732[_0xa602('0x1a')]?_0x433732['options']['limit']||null:null,'include':_0x433732[_0xa602('0x1a')]?_0x433732[_0xa602('0x1a')][_0xa602('0x1d')]?_[_0xa602('0x1e')](_0x433732[_0xa602('0x1a')][_0xa602('0x1d')],function(_0x32e0c3){return{'model':db[_0x32e0c3[_0xa602('0x1f')]],'as':_0x32e0c3['as'],'attributes':_0x32e0c3['attributes'],'include':_0x32e0c3['include']?_[_0xa602('0x1e')](_0x32e0c3[_0xa602('0x1d')],function(_0x580ce0){return{'model':db[_0x580ce0[_0xa602('0x1f')]],'as':_0x580ce0['as'],'attributes':_0x580ce0[_0xa602('0x1c')],'include':_0x580ce0[_0xa602('0x1d')]?_[_0xa602('0x1e')](_0x580ce0[_0xa602('0x1d')],function(_0x298870){return{'model':db[_0x298870[_0xa602('0x1f')]],'as':_0x298870['as'],'attributes':_0x298870[_0xa602('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa602('0x20')](function(_0x551ae8){logger['info']('GetMailQueue',_0x433732);logger[_0xa602('0x21')](_0xa602('0x17'),_0x433732,JSON['stringify'](_0x551ae8));_0x1ffc2a(_0x551ae8);})[_0xa602('0x16')](function(_0x1ddb58){logger['error'](_0xa602('0x17'),_0x1ddb58[_0xa602('0x15')],_0x433732);_0x5b3ad9(_0x1ddc59['error'](0x1f4,_0x1ddb58['message']));});});};exports[_0xa602('0x22')]=function(_0x3b068e){var _0x1da9fa=this;return new Promise(function(_0x4f9847,_0xb23f65){return db[_0xa602('0x18')][_0xa602('0x23')]({'raw':_0x3b068e[_0xa602('0x1a')]?_0x3b068e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b068e[_0xa602('0x1a')]?_0x3b068e[_0xa602('0x1a')][_0xa602('0x1b')]||null:null,'attributes':_0x3b068e[_0xa602('0x1a')]?_0x3b068e[_0xa602('0x1a')][_0xa602('0x1c')]||null:null,'include':_0x3b068e['options']?_0x3b068e[_0xa602('0x1a')][_0xa602('0x1d')]?_['map'](_0x3b068e[_0xa602('0x1a')][_0xa602('0x1d')],function(_0x41a43a){return{'model':db[_0x41a43a[_0xa602('0x1f')]],'as':_0x41a43a['as'],'attributes':_0x41a43a[_0xa602('0x1c')],'include':_0x41a43a['include']?_[_0xa602('0x1e')](_0x41a43a[_0xa602('0x1d')],function(_0x6b4a19){return{'model':db[_0x6b4a19[_0xa602('0x1f')]],'as':_0x6b4a19['as'],'attributes':_0x6b4a19['attributes'],'include':_0x6b4a19[_0xa602('0x1d')]?_[_0xa602('0x1e')](_0x6b4a19[_0xa602('0x1d')],function(_0x3f8423){return{'model':db[_0x3f8423[_0xa602('0x1f')]],'as':_0x3f8423['as'],'attributes':_0x3f8423[_0xa602('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8f43b9){logger[_0xa602('0x10')]('ShowMailQueue',_0x3b068e);logger[_0xa602('0x21')]('ShowMailQueue',_0x3b068e,JSON['stringify'](_0x8f43b9));_0x4f9847(_0x8f43b9);})[_0xa602('0x16')](function(_0x45ea69){logger[_0xa602('0x14')](_0xa602('0x22'),_0x45ea69[_0xa602('0x15')],_0x3b068e);_0xb23f65(_0x1da9fa[_0xa602('0x14')](0x1f4,_0x45ea69[_0xa602('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c8bf266..4dd988c 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 _0xa02f=['register','length','save','remove','update','removeListener'];(function(_0x410e14,_0x34434a){var _0x4bcfe4=function(_0xf5e36d){while(--_0xf5e36d){_0x410e14['push'](_0x410e14['shift']());}};_0x4bcfe4(++_0x34434a);}(_0xa02f,0xce));var _0xfa02=function(_0x3d83fe,_0x57cf49){_0x3d83fe=_0x3d83fe-0x0;var _0x2a9e76=_0xa02f[_0x3d83fe];return _0x2a9e76;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xfa02('0x0'),_0xfa02('0x1'),_0xfa02('0x2')];function createListener(_0x3a1ac1,_0x5c8ca7){return function(_0x471846){_0x5c8ca7['emit'](_0x3a1ac1,_0x471846);};}function removeListener(_0x42cd8a,_0x2b84fc){return function(){MailQueueEvents[_0xfa02('0x3')](_0x42cd8a,_0x2b84fc);};}exports[_0xfa02('0x4')]=function(_0x31dea9){for(var _0x4db7f4=0x0,_0x31d4ca=events[_0xfa02('0x5')];_0x4db7f4<_0x31d4ca;_0x4db7f4++){var _0x442a34=events[_0x4db7f4];var _0x3fbd13=createListener('mailQueue:'+_0x442a34,_0x31dea9);MailQueueEvents['on'](_0x442a34,_0x3fbd13);}}; \ No newline at end of file +var _0xe348=['register','length','mailQueue:','./mailQueue.events','save','update','emit'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe348,0x137));var _0x8e34=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xe348[_0x5627e1];return _0x2f013f;};'use strict';var MailQueueEvents=require(_0x8e34('0x0'));var events=[_0x8e34('0x1'),'remove',_0x8e34('0x2')];function createListener(_0xfc4691,_0x28d9cc){return function(_0x220108){_0x28d9cc[_0x8e34('0x3')](_0xfc4691,_0x220108);};}function removeListener(_0x223ff7,_0x9cfb7b){return function(){MailQueueEvents['removeListener'](_0x223ff7,_0x9cfb7b);};}exports[_0x8e34('0x4')]=function(_0x139dfe){for(var _0x155a8f=0x0,_0x4e8565=events[_0x8e34('0x5')];_0x155a8f<_0x4e8565;_0x155a8f++){var _0x5b4bbe=events[_0x155a8f];var _0x161e98=createListener(_0x8e34('0x6')+_0x5b4bbe,_0x139dfe);MailQueueEvents['on'](_0x5b4bbe,_0x161e98);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5df6011..641096d 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 _0x3be4=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x559a51,_0x3c4c09){var _0x1233c7=function(_0x417a13){while(--_0x417a13){_0x559a51['push'](_0x559a51['shift']());}};_0x1233c7(++_0x3c4c09);}(_0x3be4,0x16b));var _0x43be=function(_0x525886,_0x5af525){_0x525886=_0x525886-0x0;var _0x3a0ea9=_0x3be4[_0x525886];return _0x3a0ea9;};'use strict';var multer=require(_0x43be('0x0'));var util=require(_0x43be('0x1'));var path=require('path');var timeout=require(_0x43be('0x2'));var express=require(_0x43be('0x3'));var router=express[_0x43be('0x4')]();var fs_extra=require(_0x43be('0x5'));var auth=require(_0x43be('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x43be('0x7'));router[_0x43be('0x8')]('/',auth['isAuthenticated'](),controller[_0x43be('0x9')]);router['get'](_0x43be('0xa'),auth[_0x43be('0xb')](),controller[_0x43be('0xc')]);router[_0x43be('0x8')](_0x43be('0xd'),auth['isAuthenticated'](),controller[_0x43be('0xe')]);router['post']('/',auth[_0x43be('0xb')](),controller[_0x43be('0xf')]);router[_0x43be('0x10')](_0x43be('0xd'),auth['isAuthenticated'](),controller[_0x43be('0x11')]);router[_0x43be('0x12')]('/:id',auth[_0x43be('0xb')](),controller['destroy']);module[_0x43be('0x13')]=router; \ No newline at end of file +var _0xe240=['get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller'];(function(_0x62370b,_0x60c55){var _0x4bf404=function(_0x13e6ba){while(--_0x13e6ba){_0x62370b['push'](_0x62370b['shift']());}};_0x4bf404(++_0x60c55);}(_0xe240,0xac));var _0x0e24=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe240[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require('multer');var util=require(_0x0e24('0x0'));var path=require(_0x0e24('0x1'));var timeout=require(_0x0e24('0x2'));var express=require(_0x0e24('0x3'));var router=express[_0x0e24('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e24('0x5'));var config=require(_0x0e24('0x6'));var controller=require(_0x0e24('0x7'));router[_0x0e24('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e24('0x9')]);router['get'](_0x0e24('0xa'),auth[_0x0e24('0xb')](),controller[_0x0e24('0xc')]);router[_0x0e24('0x8')]('/:id',auth[_0x0e24('0xb')](),controller[_0x0e24('0xd')]);router[_0x0e24('0xe')]('/',auth['isAuthenticated'](),controller[_0x0e24('0xf')]);router[_0x0e24('0x10')](_0x0e24('0x11'),auth['isAuthenticated'](),controller[_0x0e24('0x12')]);router[_0x0e24('0x13')](_0x0e24('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index cbef84d..3f39841 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 _0x1352=['exports','STRING','DATE','moment','sequelize'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x1352,0x17a));var _0x2135=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x1352[_0x2cf2e9];return _0xd3670d;};'use strict';var moment=require(_0x2135('0x0'));var Sequelize=require(_0x2135('0x1'));module[_0x2135('0x2')]={'uniqueid':{'type':Sequelize[_0x2135('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2135('0x3')]},'joinAt':{'type':Sequelize[_0x2135('0x4')]},'leaveAt':{'type':Sequelize[_0x2135('0x4')]},'acceptAt':{'type':Sequelize[_0x2135('0x4')]},'exitAt':{'type':Sequelize[_0x2135('0x4')]},'reason':{'type':Sequelize[_0x2135('0x3')]}}; \ No newline at end of file +var _0x8e8d=['STRING','DATE','moment','sequelize','exports'];(function(_0x162111,_0xda63dd){var _0x30d90d=function(_0x38e558){while(--_0x38e558){_0x162111['push'](_0x162111['shift']());}};_0x30d90d(++_0xda63dd);}(_0x8e8d,0x13d));var _0xd8e8=function(_0x393d9f,_0x183df2){_0x393d9f=_0x393d9f-0x0;var _0x1be2da=_0x8e8d[_0x393d9f];return _0x1be2da;};'use strict';var moment=require(_0xd8e8('0x0'));var Sequelize=require(_0xd8e8('0x1'));module[_0xd8e8('0x2')]={'uniqueid':{'type':Sequelize[_0xd8e8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd8e8('0x3')]},'joinAt':{'type':Sequelize[_0xd8e8('0x4')]},'leaveAt':{'type':Sequelize[_0xd8e8('0x4')]},'acceptAt':{'type':Sequelize[_0xd8e8('0x4')]},'exitAt':{'type':Sequelize[_0xd8e8('0x4')]},'reason':{'type':Sequelize[_0xd8e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c2ebce5..130a304 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 _0xdb28=['index','MailQueueReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','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'];(function(_0x12d93a,_0x460b08){var _0x5e0913=function(_0x353783){while(--_0x353783){_0x12d93a['push'](_0x12d93a['shift']());}};_0x5e0913(++_0x460b08);}(_0xdb28,0x106));var _0x8db2=function(_0x3d9a74,_0x113ca7){_0x3d9a74=_0x3d9a74-0x0;var _0x5e3bb8=_0xdb28[_0x3d9a74];return _0x5e3bb8;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file +var _0x8aad=['sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x10841f,_0x4004aa){var _0x28ae82=function(_0x4cc02c){while(--_0x4cc02c){_0x10841f['push'](_0x10841f['shift']());}};_0x28ae82(++_0x4004aa);}(_0x8aad,0x146));var _0xd8aa=function(_0x28e88d,_0x21ab5f){_0x28e88d=_0x28e88d-0x0;var _0x69e99c=_0x8aad[_0x28e88d];return _0x69e99c;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];function respondWithStatusCode(_0x6ec0eb,_0x549fad){_0x549fad=_0x549fad||0xcc;return function(_0x1e7db8){if(_0x1e7db8){return _0x6ec0eb[_0xd8aa('0x17')](_0x549fad);}return _0x6ec0eb[_0xd8aa('0x18')](_0x549fad)['end']();};}function respondWithResult(_0x5a8c79,_0x275eff){_0x275eff=_0x275eff||0xc8;return function(_0x319ffe){if(_0x319ffe){return _0x5a8c79[_0xd8aa('0x18')](_0x275eff)['json'](_0x319ffe);}};}function respondWithFilteredResult(_0x2678ed,_0x180c56){return function(_0x39b5bc){if(_0x39b5bc){var _0x404ed6=typeof _0x180c56['offset']===_0xd8aa('0x19')&&typeof _0x180c56[_0xd8aa('0x1a')]==='undefined';var _0x16d5c6=_0x39b5bc[_0xd8aa('0x1b')];var _0x32e2cd=_0x404ed6?0x0:_0x180c56[_0xd8aa('0x1c')];var _0x2d34ac=_0x404ed6?_0x39b5bc['count']:_0x180c56[_0xd8aa('0x1c')]+_0x180c56[_0xd8aa('0x1a')];var _0xb156e6;if(_0x2d34ac>=_0x16d5c6){_0x2d34ac=_0x16d5c6;_0xb156e6=0xc8;}else{_0xb156e6=0xce;}_0x2678ed[_0xd8aa('0x18')](_0xb156e6);return _0x2678ed['set'](_0xd8aa('0x1d'),_0x32e2cd+'-'+_0x2d34ac+'/'+_0x16d5c6)[_0xd8aa('0x1e')](_0x39b5bc);}return null;};}function patchUpdates(_0x46d69b){return function(_0x3588ee){try{jsonpatch[_0xd8aa('0x1f')](_0x3588ee,_0x46d69b,!![]);}catch(_0x4fe5d8){return BPromise[_0xd8aa('0x20')](_0x4fe5d8);}return _0x3588ee[_0xd8aa('0x21')]();};}function saveUpdates(_0xc4f55c,_0x5910b3){return function(_0xa7cf85){if(_0xa7cf85){return _0xa7cf85[_0xd8aa('0x22')](_0xc4f55c)[_0xd8aa('0x23')](function(_0x290849){return _0x290849;});}return null;};}function removeEntity(_0x3ef3a9,_0x16758a){return function(_0x1f64f8){if(_0x1f64f8){return _0x1f64f8[_0xd8aa('0x24')]()[_0xd8aa('0x23')](function(){_0x3ef3a9[_0xd8aa('0x18')](0xcc)[_0xd8aa('0x25')]();});}};}function handleEntityNotFound(_0x370d6f,_0x26cc66){return function(_0x5f1027){if(!_0x5f1027){_0x370d6f[_0xd8aa('0x17')](0x194);}return _0x5f1027;};}function handleError(_0x59eb3f,_0xd4d204){_0xd4d204=_0xd4d204||0x1f4;return function(_0x1f6ab2){logger[_0xd8aa('0x26')](_0x1f6ab2[_0xd8aa('0x27')]);if(_0x1f6ab2[_0xd8aa('0x28')]){delete _0x1f6ab2[_0xd8aa('0x28')];}_0x59eb3f[_0xd8aa('0x18')](_0xd4d204)[_0xd8aa('0x29')](_0x1f6ab2);};}exports['index']=function(_0x1f2a28,_0x34b792){var _0x214393={},_0x49a7c8={},_0x19a59d={'count':0x0,'rows':[]};var _0x51c6f4=_[_0xd8aa('0x2a')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')],function(_0x168a2e){return{'name':_0x168a2e[_0xd8aa('0x2d')],'type':_0x168a2e[_0xd8aa('0x2e')][_0xd8aa('0x2f')]};});_0x49a7c8[_0xd8aa('0x30')]=_['map'](_0x51c6f4,_0xd8aa('0x28'));_0x49a7c8[_0xd8aa('0x31')]=_[_0xd8aa('0x32')](_0x1f2a28[_0xd8aa('0x31')]);_0x49a7c8[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],_0x49a7c8[_0xd8aa('0x31')]);_0x214393['attributes']=_[_0xd8aa('0x34')](_0x49a7c8[_0xd8aa('0x30')],qs[_0xd8aa('0x35')](_0x1f2a28['query'][_0xd8aa('0x35')]));_0x214393[_0xd8aa('0x36')]=_0x214393[_0xd8aa('0x36')][_0xd8aa('0x37')]?_0x214393[_0xd8aa('0x36')]:_0x49a7c8[_0xd8aa('0x30')];if(!_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x38')](_0xd8aa('0x39'))){_0x214393['limit']=qs[_0xd8aa('0x1a')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1a')]);_0x214393[_0xd8aa('0x1c')]=qs[_0xd8aa('0x1c')](_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x1c')]);}_0x214393[_0xd8aa('0x3a')]=qs[_0xd8aa('0x3b')](_0x1f2a28['query'][_0xd8aa('0x3b')]);_0x214393['where']=qs[_0xd8aa('0x33')](_[_0xd8aa('0x3c')](_0x1f2a28['query'],_0x49a7c8[_0xd8aa('0x33')]),_0x51c6f4);if(_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]){_0x214393[_0xd8aa('0x3e')]=_[_0xd8aa('0x3f')](_0x214393['where'],{'$or':_['map'](_0x51c6f4,function(_0x25145c){if(_0x25145c['type']!==_0xd8aa('0x40')){var _0x7a6df2={};_0x7a6df2[_0x25145c[_0xd8aa('0x28')]]={'$like':'%'+_0x1f2a28[_0xd8aa('0x31')][_0xd8aa('0x3d')]+'%'};return _0x7a6df2;}})});}_0x214393=_[_0xd8aa('0x3f')]({},_0x214393,_0x1f2a28[_0xd8aa('0x41')]);var _0x3b0220={'where':_0x214393[_0xd8aa('0x3e')]};return db[_0xd8aa('0x2b')][_0xd8aa('0x1b')](_0x3b0220)['then'](function(_0x17ebb4){_0x19a59d[_0xd8aa('0x1b')]=_0x17ebb4;if(_0x1f2a28[_0xd8aa('0x31')]['includeAll']){_0x214393[_0xd8aa('0x42')]=[{'all':!![]}];}return db[_0xd8aa('0x2b')][_0xd8aa('0x43')](_0x214393);})[_0xd8aa('0x23')](function(_0x3a0284){_0x19a59d[_0xd8aa('0x44')]=_0x3a0284;return _0x19a59d;})[_0xd8aa('0x23')](respondWithFilteredResult(_0x34b792,_0x214393))[_0xd8aa('0x45')](handleError(_0x34b792,null));};exports[_0xd8aa('0x46')]=function(_0x3f5857,_0x20c7a0){var _0x3ec42f={'raw':!![],'where':{'id':_0x3f5857[_0xd8aa('0x47')]['id']}},_0x3b26c9={};_0x3b26c9[_0xd8aa('0x30')]=_[_0xd8aa('0x32')](db[_0xd8aa('0x2b')][_0xd8aa('0x2c')]);_0x3b26c9['query']=_[_0xd8aa('0x32')](_0x3f5857[_0xd8aa('0x31')]);_0x3b26c9[_0xd8aa('0x33')]=_[_0xd8aa('0x34')](_0x3b26c9[_0xd8aa('0x30')],_0x3b26c9[_0xd8aa('0x31')]);_0x3ec42f['attributes']=_[_0xd8aa('0x34')](_0x3b26c9['model'],qs[_0xd8aa('0x35')](_0x3f5857['query'][_0xd8aa('0x35')]));_0x3ec42f['attributes']=_0x3ec42f['attributes'][_0xd8aa('0x37')]?_0x3ec42f[_0xd8aa('0x36')]:_0x3b26c9[_0xd8aa('0x30')];if(_0x3f5857[_0xd8aa('0x31')][_0xd8aa('0x48')]){_0x3ec42f[_0xd8aa('0x42')]=[{'all':!![]}];}_0x3ec42f=_['merge']({},_0x3ec42f,_0x3f5857[_0xd8aa('0x41')]);return db[_0xd8aa('0x2b')][_0xd8aa('0x49')](_0x3ec42f)[_0xd8aa('0x23')](handleEntityNotFound(_0x20c7a0,null))[_0xd8aa('0x23')](respondWithResult(_0x20c7a0,null))['catch'](handleError(_0x20c7a0,null));};exports['create']=function(_0x58cf42,_0x1fd1dc){return db[_0xd8aa('0x2b')][_0xd8aa('0x4a')](_0x58cf42[_0xd8aa('0x4b')],{})[_0xd8aa('0x23')](respondWithResult(_0x1fd1dc,0xc9))[_0xd8aa('0x45')](handleError(_0x1fd1dc,null));};exports['update']=function(_0x221e2b,_0x241e23){if(_0x221e2b['body']['id']){delete _0x221e2b[_0xd8aa('0x4b')]['id'];}return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x221e2b['params']['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x241e23,null))[_0xd8aa('0x23')](saveUpdates(_0x221e2b[_0xd8aa('0x4b')],null))[_0xd8aa('0x23')](respondWithResult(_0x241e23,null))[_0xd8aa('0x45')](handleError(_0x241e23,null));};exports[_0xd8aa('0x24')]=function(_0x4f494d,_0x566d52){return db[_0xd8aa('0x2b')][_0xd8aa('0x49')]({'where':{'id':_0x4f494d[_0xd8aa('0x47')]['id']}})[_0xd8aa('0x23')](handleEntityNotFound(_0x566d52,null))[_0xd8aa('0x23')](removeEntity(_0x566d52,null))[_0xd8aa('0x45')](handleError(_0x566d52,null));};exports[_0xd8aa('0x4c')]=function(_0x4f9d21,_0x9db7e3){return db[_0xd8aa('0x2b')]['describe']()[_0xd8aa('0x23')](respondWithResult(_0x9db7e3,null))['catch'](handleError(_0x9db7e3,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 469bb90..e219f2e 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 _0xdb22=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport'];(function(_0x1b51dd,_0x59cf4b){var _0x1d96a0=function(_0xce0595){while(--_0xce0595){_0x1b51dd['push'](_0x1b51dd['shift']());}};_0x1d96a0(++_0x59cf4b);}(_0xdb22,0xf8));var _0x2db2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb22[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2db2('0x0'));var util=require(_0x2db2('0x1'));var logger=require(_0x2db2('0x2'))(_0x2db2('0x3'));var moment=require(_0x2db2('0x4'));var BPromise=require(_0x2db2('0x5'));var rp=require(_0x2db2('0x6'));var fs=require('fs');var path=require(_0x2db2('0x7'));var rimraf=require(_0x2db2('0x8'));var config=require(_0x2db2('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0x2db2('0xa')]=function(_0x44a9ab,_0x3fb269){return _0x44a9ab['define'](_0x2db2('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x2db2('0xc'),'fields':[_0x2db2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa417=['define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','moment','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x48c964,_0x35dfdd){var _0x5fad52=function(_0x3e2d45){while(--_0x3e2d45){_0x48c964['push'](_0x48c964['shift']());}};_0x5fad52(++_0x35dfdd);}(_0xa417,0xf6));var _0x7a41=function(_0x4b1e1f,_0x3b4477){_0x4b1e1f=_0x4b1e1f-0x0;var _0x41a007=_0xa417[_0x4b1e1f];return _0x41a007;};'use strict';var _=require('lodash');var util=require(_0x7a41('0x0'));var logger=require(_0x7a41('0x1'))('api');var moment=require(_0x7a41('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a41('0x3'));var rimraf=require('rimraf');var config=require(_0x7a41('0x4'));var attributes=require(_0x7a41('0x5'));module[_0x7a41('0x6')]=function(_0x426483,_0x2cc960){return _0x426483[_0x7a41('0x7')](_0x7a41('0x8'),attributes,{'tableName':_0x7a41('0x9'),'paranoid':![],'indexes':[{'name':_0x7a41('0xa'),'fields':[_0x7a41('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3556b1c..59d4d22 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x1353bc,_0x432b07){var _0x3097a6=function(_0x1ab3c2){while(--_0x1ab3c2){_0x1353bc['push'](_0x1353bc['shift']());}};_0x3097a6(++_0x432b07);}(_0x2ef3,0xba));var _0x32ef=function(_0x57cb4c,_0x22d9a9){_0x57cb4c=_0x57cb4c-0x0;var _0xf4b654=_0x2ef3[_0x57cb4c];return _0xf4b654;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xb1ac24,_0x500587){var _0x56214f=function(_0x8e2926){while(--_0x8e2926){_0xb1ac24['push'](_0xb1ac24['shift']());}};_0x56214f(++_0x500587);}(_0x1261,0x144));var _0x1126=function(_0xb65ffb,_0x2cc0af){_0xb65ffb=_0xb65ffb-0x0;var _0x58f55c=_0x1261[_0xb65ffb];return _0x58f55c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4fbb047..58f05b9 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ff281,_0x2afc08){var _0x321cec=function(_0x6de702){while(--_0x6de702){_0x4ff281['push'](_0x4ff281['shift']());}};_0x321cec(++_0x2afc08);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xcb91[_0x163742];return _0x1152ac;};'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(_0x7ed9c2,_0x4dcfb5){var _0x2fb4c9=function(_0x38c55b){while(--_0x38c55b){_0x7ed9c2['push'](_0x7ed9c2['shift']());}};_0x2fb4c9(++_0x4dcfb5);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b6337c8..ab0e805 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 _0x054c=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x054c,0xb9));var _0xc054=function(_0x39b27a,_0x3425a5){_0x39b27a=_0x39b27a-0x0;var _0x3e81df=_0x054c[_0x39b27a];return _0x3e81df;};'use strict';var Sequelize=require('sequelize');module[_0xc054('0x0')]={'description':{'type':Sequelize[_0xc054('0x1')]},'host':{'type':Sequelize[_0xc054('0x1')]},'authentication':{'type':Sequelize[_0xc054('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc054('0x1')]},'password':{'type':Sequelize[_0xc054('0x1')]},'port':{'type':Sequelize[_0xc054('0x3')]},'tls':{'type':Sequelize[_0xc054('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc054('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xc054('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc054('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc054('0x1')]},'modernAuthentication':{'type':Sequelize[_0xc054('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7c76=['STRING','BOOLEAN','INBOX','INTEGER','sequelize','exports'];(function(_0x57f071,_0x46360f){var _0x150360=function(_0x1197cc){while(--_0x1197cc){_0x57f071['push'](_0x57f071['shift']());}};_0x150360(++_0x46360f);}(_0x7c76,0xe2));var _0x67c7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7c76[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x67c7('0x0'));module[_0x67c7('0x1')]={'description':{'type':Sequelize[_0x67c7('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x67c7('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x67c7('0x2')]},'password':{'type':Sequelize[_0x67c7('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x67c7('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x67c7('0x2')],'defaultValue':_0x67c7('0x4')},'connTimeout':{'type':Sequelize[_0x67c7('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x67c7('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x67c7('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 713a565..ef7ef69 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 _0xd36b=['moment','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','util','../../config/logger','api'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xd36b,0x18d));var _0xbd36=function(_0x542a55,_0x2b89d2){_0x542a55=_0x542a55-0x0;var _0x544873=_0xd36b[_0x542a55];return _0x544873;};'use strict';var _=require('lodash');var util=require(_0xbd36('0x0'));var logger=require(_0xbd36('0x1'))(_0xbd36('0x2'));var moment=require(_0xbd36('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd36('0x4'));var config=require(_0xbd36('0x5'));var attributes=require(_0xbd36('0x6'));module[_0xbd36('0x7')]=function(_0x42edcc,_0x159b8c){return _0x42edcc[_0xbd36('0x8')](_0xbd36('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ef3=['bluebird','request-promise','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash','../../config/logger','moment'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0x6ef3,0x9d));var _0x36ef=function(_0x234b26,_0xd3bb8a){_0x234b26=_0x234b26-0x0;var _0x32fadc=_0x6ef3[_0x234b26];return _0x32fadc;};'use strict';var _=require(_0x36ef('0x0'));var util=require('util');var logger=require(_0x36ef('0x1'))('api');var moment=require(_0x36ef('0x2'));var BPromise=require(_0x36ef('0x3'));var rp=require(_0x36ef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36ef('0x5'));var config=require(_0x36ef('0x6'));var attributes=require('./mailServerIn.attributes');module[_0x36ef('0x7')]=function(_0x4deda0,_0x2c0bdc){return _0x4deda0['define'](_0x36ef('0x8'),attributes,{'tableName':_0x36ef('0x9'),'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 d294e10..8a3b5a0 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 _0x9cfa=['code','message','MailServerIn,\x20%s,\x20%s','info','result','catch','GetMailServerIn','options','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x10e46b,_0x26840d){var _0x1cb58f=function(_0x192c81){while(--_0x192c81){_0x10e46b['push'](_0x10e46b['shift']());}};_0x1cb58f(++_0x26840d);}(_0x9cfa,0xfc));var _0xa9cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9cfa[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa9cf('0x0'));var moment=require(_0xa9cf('0x1'));var BPromise=require(_0xa9cf('0x2'));var rs=require(_0xa9cf('0x3'));var fs=require('fs');var Redis=require(_0xa9cf('0x4'));var db=require(_0xa9cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9cf('0x6'));var config=require(_0xa9cf('0x7'));var jayson=require(_0xa9cf('0x8'));var client=jayson[_0xa9cf('0x9')][_0xa9cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316c3b,_0x48cd71,_0x42e1b8){return new BPromise(function(_0x14ef20,_0x3d499b){return client[_0xa9cf('0xb')](_0x316c3b,_0x42e1b8)[_0xa9cf('0xc')](function(_0x32d536){logger['info']('MailServerIn,\x20%s,\x20%s',_0x48cd71,_0xa9cf('0xd'));logger[_0xa9cf('0xe')](_0xa9cf('0xf'),_0x48cd71,'request\x20sent',JSON[_0xa9cf('0x10')](_0x32d536));if(_0x32d536[_0xa9cf('0x11')]){if(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x12')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x48cd71,_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);return _0x3d499b(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);}logger[_0xa9cf('0x11')](_0xa9cf('0x14'),_0x48cd71,_0x32d536['error'][_0xa9cf('0x13')]);return _0x14ef20(_0x32d536[_0xa9cf('0x11')][_0xa9cf('0x13')]);}else{logger[_0xa9cf('0x15')](_0xa9cf('0x14'),_0x48cd71,_0xa9cf('0xd'));_0x14ef20(_0x32d536[_0xa9cf('0x16')]['message']);}})[_0xa9cf('0x17')](function(_0x127795){logger['error'](_0xa9cf('0x14'),_0x48cd71,_0x127795);_0x3d499b(_0x127795);});});}exports[_0xa9cf('0x18')]=function(_0x1429cd){var _0x202bfe=this;return new Promise(function(_0x25ad64,_0x130d47){return db['MailServerIn']['findAll']({'raw':_0x1429cd[_0xa9cf('0x19')]?_0x1429cd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1429cd[_0xa9cf('0x19')]?_0x1429cd['options']['where']||null:null,'attributes':_0x1429cd['options']?_0x1429cd[_0xa9cf('0x19')][_0xa9cf('0x1a')]||null:null,'limit':_0x1429cd[_0xa9cf('0x19')]?_0x1429cd[_0xa9cf('0x19')]['limit']||null:null,'include':_0x1429cd[_0xa9cf('0x19')]?_0x1429cd[_0xa9cf('0x19')][_0xa9cf('0x1b')]?_[_0xa9cf('0x1c')](_0x1429cd[_0xa9cf('0x19')][_0xa9cf('0x1b')],function(_0x283ba6){return{'model':db[_0x283ba6['model']],'as':_0x283ba6['as'],'attributes':_0x283ba6[_0xa9cf('0x1a')],'include':_0x283ba6[_0xa9cf('0x1b')]?_['map'](_0x283ba6[_0xa9cf('0x1b')],function(_0x359340){return{'model':db[_0x359340['model']],'as':_0x359340['as'],'attributes':_0x359340['attributes'],'include':_0x359340[_0xa9cf('0x1b')]?_['map'](_0x359340[_0xa9cf('0x1b')],function(_0x221c1e){return{'model':db[_0x221c1e[_0xa9cf('0x1d')]],'as':_0x221c1e['as'],'attributes':_0x221c1e[_0xa9cf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa9cf('0xc')](function(_0x146a5c){logger[_0xa9cf('0x15')]('GetMailServerIn',_0x1429cd);logger[_0xa9cf('0xe')](_0xa9cf('0x18'),_0x1429cd,JSON[_0xa9cf('0x10')](_0x146a5c));_0x25ad64(_0x146a5c);})[_0xa9cf('0x17')](function(_0x433f5b){logger[_0xa9cf('0x11')]('GetMailServerIn',_0x433f5b[_0xa9cf('0x13')],_0x1429cd);_0x130d47(_0x202bfe[_0xa9cf('0x11')](0x1f4,_0x433f5b['message']));});});}; \ No newline at end of file +var _0x795a=['../../config/environment','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4651ca,_0x451e55){var _0x32063c=function(_0x2637a9){while(--_0x2637a9){_0x4651ca['push'](_0x4651ca['shift']());}};_0x32063c(++_0x451e55);}(_0x795a,0x79));var _0xa795=function(_0x11da18,_0x4c0a08){_0x11da18=_0x11da18-0x0;var _0x1e8583=_0x795a[_0x11da18];return _0x1e8583;};'use strict';var _=require(_0xa795('0x0'));var util=require(_0xa795('0x1'));var moment=require('moment');var BPromise=require(_0xa795('0x2'));var rs=require(_0xa795('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa795('0x4'))['db'];var utils=require(_0xa795('0x5'));var logger=require(_0xa795('0x6'))('rpc');var config=require(_0xa795('0x7'));var jayson=require(_0xa795('0x8'));var client=jayson['client'][_0xa795('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed37b,_0x4fb825,_0x448c8d){return new BPromise(function(_0x2115e1,_0x1c7b14){return client[_0xa795('0xa')](_0x1ed37b,_0x448c8d)['then'](function(_0x43ad14){logger[_0xa795('0xb')](_0xa795('0xc'),_0x4fb825,_0xa795('0xd'));logger[_0xa795('0xe')](_0xa795('0xf'),_0x4fb825,_0xa795('0xd'),JSON[_0xa795('0x10')](_0x43ad14));if(_0x43ad14[_0xa795('0x11')]){if(_0x43ad14[_0xa795('0x11')][_0xa795('0x12')]===0x1f4){logger[_0xa795('0x11')](_0xa795('0xc'),_0x4fb825,_0x43ad14[_0xa795('0x11')][_0xa795('0x13')]);return _0x1c7b14(_0x43ad14[_0xa795('0x11')][_0xa795('0x13')]);}logger['error'](_0xa795('0xc'),_0x4fb825,_0x43ad14['error'][_0xa795('0x13')]);return _0x2115e1(_0x43ad14[_0xa795('0x11')]['message']);}else{logger[_0xa795('0xb')](_0xa795('0xc'),_0x4fb825,_0xa795('0xd'));_0x2115e1(_0x43ad14[_0xa795('0x14')][_0xa795('0x13')]);}})[_0xa795('0x15')](function(_0x5d980f){logger[_0xa795('0x11')](_0xa795('0xc'),_0x4fb825,_0x5d980f);_0x1c7b14(_0x5d980f);});});}exports[_0xa795('0x16')]=function(_0x84950f){var _0x5cc547=this;return new Promise(function(_0x103ccf,_0x1ccb12){return db[_0xa795('0x17')][_0xa795('0x18')]({'raw':_0x84950f[_0xa795('0x19')]?_0x84950f['options'][_0xa795('0x1a')]===undefined?!![]:![]:!![],'where':_0x84950f[_0xa795('0x19')]?_0x84950f[_0xa795('0x19')]['where']||null:null,'attributes':_0x84950f[_0xa795('0x19')]?_0x84950f[_0xa795('0x19')][_0xa795('0x1b')]||null:null,'limit':_0x84950f['options']?_0x84950f['options'][_0xa795('0x1c')]||null:null,'include':_0x84950f['options']?_0x84950f[_0xa795('0x19')][_0xa795('0x1d')]?_[_0xa795('0x1e')](_0x84950f['options'][_0xa795('0x1d')],function(_0x3e2048){return{'model':db[_0x3e2048[_0xa795('0x1f')]],'as':_0x3e2048['as'],'attributes':_0x3e2048[_0xa795('0x1b')],'include':_0x3e2048[_0xa795('0x1d')]?_[_0xa795('0x1e')](_0x3e2048[_0xa795('0x1d')],function(_0x3e1b04){return{'model':db[_0x3e1b04[_0xa795('0x1f')]],'as':_0x3e1b04['as'],'attributes':_0x3e1b04['attributes'],'include':_0x3e1b04[_0xa795('0x1d')]?_['map'](_0x3e1b04['include'],function(_0x3f576e){return{'model':db[_0x3f576e[_0xa795('0x1f')]],'as':_0x3f576e['as'],'attributes':_0x3f576e[_0xa795('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32477b){logger[_0xa795('0xb')](_0xa795('0x16'),_0x84950f);logger['debug'](_0xa795('0x16'),_0x84950f,JSON[_0xa795('0x10')](_0x32477b));_0x103ccf(_0x32477b);})[_0xa795('0x15')](function(_0x54ef3e){logger['error'](_0xa795('0x16'),_0x54ef3e[_0xa795('0x13')],_0x84950f);_0x1ccb12(_0x5cc547[_0xa795('0x11')](0x1f4,_0x54ef3e[_0xa795('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ddae968..885cab5 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(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_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('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(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 8413362..138cb7b 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 _0x7072=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7072,0x138));var _0x2707=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7072[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'description':{'type':Sequelize[_0x2707('0x1')]},'host':{'type':Sequelize[_0x2707('0x1')]},'user':{'type':Sequelize[_0x2707('0x1')]},'pass':{'type':Sequelize[_0x2707('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x2707('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2707('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c00=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x2f48a7,_0x54ea3c){var _0x3546f6=function(_0x2323d4){while(--_0x2323d4){_0x2f48a7['push'](_0x2f48a7['shift']());}};_0x3546f6(++_0x54ea3c);}(_0x5c00,0x17e));var _0x05c0=function(_0x4dedd3,_0x175841){_0x4dedd3=_0x4dedd3-0x0;var _0x48f768=_0x5c00[_0x4dedd3];return _0x48f768;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'description':{'type':Sequelize[_0x05c0('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x05c0('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x05c0('0x3')]},'secure':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x05c0('0x2')]},'authentication':{'type':Sequelize[_0x05c0('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 1574623..6780d58 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 _0x86e6=['name','send','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','rawAttributes','find','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack'];(function(_0xa942f6,_0x1953f3){var _0x5b700f=function(_0x414a1e){while(--_0x414a1e){_0xa942f6['push'](_0xa942f6['shift']());}};_0x5b700f(++_0x1953f3);}(_0x86e6,0x69));var _0x686e=function(_0x3fa1bd,_0x6e16ba){_0x3fa1bd=_0x3fa1bd-0x0;var _0x267431=_0x86e6[_0x3fa1bd];return _0x267431;};'use strict';var emlformat=require(_0x686e('0x0'));var rimraf=require(_0x686e('0x1'));var zipdir=require(_0x686e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x686e('0x3'));var moment=require(_0x686e('0x4'));var BPromise=require(_0x686e('0x5'));var Mustache=require('mustache');var util=require(_0x686e('0x6'));var path=require(_0x686e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x686e('0x8'));var fs=require('fs');var fs_extra=require(_0x686e('0x9'));var _=require(_0x686e('0xa'));var squel=require(_0x686e('0xb'));var crypto=require(_0x686e('0xc'));var jsforce=require(_0x686e('0xd'));var deskjs=require(_0x686e('0xe'));var toCsv=require(_0x686e('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x686e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x686e('0x11'));var as=require(_0x686e('0x12'));var hardwareService=require(_0x686e('0x13'));var logger=require(_0x686e('0x14'))(_0x686e('0x15'));var utils=require('../../config/utils');var config=require(_0x686e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x686e('0x17'))['db'];function respondWithStatusCode(_0xbec09a,_0x5be094){_0x5be094=_0x5be094||0xcc;return function(_0x38963c){if(_0x38963c){return _0xbec09a['sendStatus'](_0x5be094);}return _0xbec09a['status'](_0x5be094)[_0x686e('0x18')]();};}function respondWithResult(_0x4292cb,_0x5a1461){_0x5a1461=_0x5a1461||0xc8;return function(_0x30d343){if(_0x30d343){return _0x4292cb[_0x686e('0x19')](_0x5a1461)[_0x686e('0x1a')](_0x30d343);}};}function respondWithFilteredResult(_0x4fdb01,_0x279cc2){return function(_0x586874){if(_0x586874){var _0x483a48=typeof _0x279cc2[_0x686e('0x1b')]===_0x686e('0x1c')&&typeof _0x279cc2['limit']===_0x686e('0x1c');var _0xb235dc=_0x586874['count'];var _0x4d5cf3=_0x483a48?0x0:_0x279cc2['offset'];var _0x35e7fd=_0x483a48?_0x586874[_0x686e('0x1d')]:_0x279cc2[_0x686e('0x1b')]+_0x279cc2[_0x686e('0x1e')];var _0xf478a9;if(_0x35e7fd>=_0xb235dc){_0x35e7fd=_0xb235dc;_0xf478a9=0xc8;}else{_0xf478a9=0xce;}_0x4fdb01[_0x686e('0x19')](_0xf478a9);return _0x4fdb01[_0x686e('0x1f')](_0x686e('0x20'),_0x4d5cf3+'-'+_0x35e7fd+'/'+_0xb235dc)[_0x686e('0x1a')](_0x586874);}return null;};}function patchUpdates(_0x213cb1){return function(_0x41e29c){try{jsonpatch['apply'](_0x41e29c,_0x213cb1,!![]);}catch(_0x47d4d7){return BPromise[_0x686e('0x21')](_0x47d4d7);}return _0x41e29c[_0x686e('0x22')]();};}function saveUpdates(_0x2af350,_0x66e0bc){return function(_0x4a8016){if(_0x4a8016){return _0x4a8016[_0x686e('0x23')](_0x2af350)['then'](function(_0x1c90d3){return _0x1c90d3;});}return null;};}function removeEntity(_0x5bc07d,_0x1b44f7){return function(_0x2cdb21){if(_0x2cdb21){return _0x2cdb21['destroy']()[_0x686e('0x24')](function(){_0x5bc07d[_0x686e('0x19')](0xcc)[_0x686e('0x18')]();});}};}function handleEntityNotFound(_0x311ba2,_0x2613c9){return function(_0x8add2a){if(!_0x8add2a){_0x311ba2['sendStatus'](0x194);}return _0x8add2a;};}function handleError(_0x3c698c,_0x4225fc){_0x4225fc=_0x4225fc||0x1f4;return function(_0x559767){logger[_0x686e('0x25')](_0x559767[_0x686e('0x26')]);if(_0x559767[_0x686e('0x27')]){delete _0x559767['name'];}_0x3c698c[_0x686e('0x19')](_0x4225fc)[_0x686e('0x28')](_0x559767);};}exports[_0x686e('0x29')]=function(_0x593c51,_0x55bc71){var _0x2c3ae2={},_0x4692c6={},_0x139f0b={'count':0x0,'rows':[]};var _0x4ea536=_[_0x686e('0x2a')](db[_0x686e('0x2b')]['rawAttributes'],function(_0xeb4dfe){return{'name':_0xeb4dfe[_0x686e('0x2c')],'type':_0xeb4dfe[_0x686e('0x2d')][_0x686e('0x2e')]};});_0x4692c6[_0x686e('0x2f')]=_['map'](_0x4ea536,'name');_0x4692c6[_0x686e('0x30')]=_[_0x686e('0x31')](_0x593c51[_0x686e('0x30')]);_0x4692c6[_0x686e('0x32')]=_[_0x686e('0x33')](_0x4692c6[_0x686e('0x2f')],_0x4692c6[_0x686e('0x30')]);_0x2c3ae2[_0x686e('0x34')]=_[_0x686e('0x33')](_0x4692c6[_0x686e('0x2f')],qs[_0x686e('0x35')](_0x593c51[_0x686e('0x30')][_0x686e('0x35')]));_0x2c3ae2[_0x686e('0x34')]=_0x2c3ae2[_0x686e('0x34')][_0x686e('0x36')]?_0x2c3ae2[_0x686e('0x34')]:_0x4692c6[_0x686e('0x2f')];if(!_0x593c51['query']['hasOwnProperty'](_0x686e('0x37'))){_0x2c3ae2[_0x686e('0x1e')]=qs[_0x686e('0x1e')](_0x593c51['query'][_0x686e('0x1e')]);_0x2c3ae2[_0x686e('0x1b')]=qs[_0x686e('0x1b')](_0x593c51[_0x686e('0x30')][_0x686e('0x1b')]);}_0x2c3ae2['order']=qs[_0x686e('0x38')](_0x593c51['query'][_0x686e('0x38')]);_0x2c3ae2[_0x686e('0x39')]=qs[_0x686e('0x32')](_[_0x686e('0x3a')](_0x593c51['query'],_0x4692c6[_0x686e('0x32')]),_0x4ea536);if(_0x593c51[_0x686e('0x30')]['filter']){_0x2c3ae2[_0x686e('0x39')]=_[_0x686e('0x3b')](_0x2c3ae2[_0x686e('0x39')],{'$or':_[_0x686e('0x2a')](_0x4ea536,function(_0x12fa7e){if(_0x12fa7e[_0x686e('0x2d')]!==_0x686e('0x3c')){var _0x2a3bfb={};_0x2a3bfb[_0x12fa7e['name']]={'$like':'%'+_0x593c51['query'][_0x686e('0x3d')]+'%'};return _0x2a3bfb;}})});}_0x2c3ae2=_[_0x686e('0x3b')]({},_0x2c3ae2,_0x593c51[_0x686e('0x3e')]);var _0x15853d={'where':_0x2c3ae2[_0x686e('0x39')]};return db[_0x686e('0x2b')]['count'](_0x15853d)['then'](function(_0x59af35){_0x139f0b[_0x686e('0x1d')]=_0x59af35;if(_0x593c51[_0x686e('0x30')][_0x686e('0x3f')]){_0x2c3ae2[_0x686e('0x40')]=[{'all':!![]}];}return db[_0x686e('0x2b')][_0x686e('0x41')](_0x2c3ae2);})[_0x686e('0x24')](function(_0x30ee97){_0x139f0b['rows']=_0x30ee97;return _0x139f0b;})[_0x686e('0x24')](respondWithFilteredResult(_0x55bc71,_0x2c3ae2))[_0x686e('0x42')](handleError(_0x55bc71,null));};exports['show']=function(_0x3ee632,_0x51ccbe){var _0x4675c8={'raw':!![],'where':{'id':_0x3ee632['params']['id']}},_0x42b3f9={};_0x42b3f9['model']=_['keys'](db[_0x686e('0x2b')][_0x686e('0x43')]);_0x42b3f9[_0x686e('0x30')]=_['keys'](_0x3ee632[_0x686e('0x30')]);_0x42b3f9[_0x686e('0x32')]=_[_0x686e('0x33')](_0x42b3f9[_0x686e('0x2f')],_0x42b3f9[_0x686e('0x30')]);_0x4675c8['attributes']=_['intersection'](_0x42b3f9[_0x686e('0x2f')],qs[_0x686e('0x35')](_0x3ee632[_0x686e('0x30')]['fields']));_0x4675c8[_0x686e('0x34')]=_0x4675c8[_0x686e('0x34')][_0x686e('0x36')]?_0x4675c8[_0x686e('0x34')]:_0x42b3f9[_0x686e('0x2f')];if(_0x3ee632['query']['includeAll']){_0x4675c8[_0x686e('0x40')]=[{'all':!![]}];}_0x4675c8=_[_0x686e('0x3b')]({},_0x4675c8,_0x3ee632[_0x686e('0x3e')]);return db[_0x686e('0x2b')][_0x686e('0x44')](_0x4675c8)[_0x686e('0x24')](handleEntityNotFound(_0x51ccbe,null))[_0x686e('0x24')](respondWithResult(_0x51ccbe,null))['catch'](handleError(_0x51ccbe,null));};exports['create']=function(_0xc89b4e,_0x1da24d){return db[_0x686e('0x2b')]['create'](_0xc89b4e[_0x686e('0x45')],{})[_0x686e('0x24')](respondWithResult(_0x1da24d,0xc9))[_0x686e('0x42')](handleError(_0x1da24d,null));};exports[_0x686e('0x23')]=function(_0x48e898,_0x409fd4){if(_0x48e898[_0x686e('0x45')]['id']){delete _0x48e898[_0x686e('0x45')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x48e898[_0x686e('0x46')]['id']}})[_0x686e('0x24')](handleEntityNotFound(_0x409fd4,null))['then'](saveUpdates(_0x48e898['body'],null))[_0x686e('0x24')](respondWithResult(_0x409fd4,null))['catch'](handleError(_0x409fd4,null));};exports[_0x686e('0x47')]=function(_0x54ae26,_0x4c0ef5){return db[_0x686e('0x2b')][_0x686e('0x44')]({'where':{'id':_0x54ae26[_0x686e('0x46')]['id']}})[_0x686e('0x24')](handleEntityNotFound(_0x4c0ef5,null))[_0x686e('0x24')](removeEntity(_0x4c0ef5,null))[_0x686e('0x42')](handleError(_0x4c0ef5,null));}; \ No newline at end of file +var _0x5eb2=['keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','merge','options','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','MailServerOut','fieldName','type','key','model'];(function(_0x5936c8,_0x5731e9){var _0x1dff51=function(_0x44eab2){while(--_0x44eab2){_0x5936c8['push'](_0x5936c8['shift']());}};_0x1dff51(++_0x5731e9);}(_0x5eb2,0x106));var _0x25eb=function(_0x460bd7,_0x5f0236){_0x460bd7=_0x460bd7-0x0;var _0x5bd884=_0x5eb2[_0x460bd7];return _0x5bd884;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25eb('0x0'));var zipdir=require(_0x25eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25eb('0x2'));var moment=require(_0x25eb('0x3'));var BPromise=require(_0x25eb('0x4'));var Mustache=require('mustache');var util=require(_0x25eb('0x5'));var path=require(_0x25eb('0x6'));var sox=require(_0x25eb('0x7'));var csv=require(_0x25eb('0x8'));var ejs=require(_0x25eb('0x9'));var fs=require('fs');var fs_extra=require(_0x25eb('0xa'));var _=require(_0x25eb('0xb'));var squel=require('squel');var crypto=require(_0x25eb('0xc'));var jsforce=require(_0x25eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x25eb('0x8'));var querystring=require(_0x25eb('0xe'));var Papa=require(_0x25eb('0xf'));var Redis=require(_0x25eb('0x10'));var authService=require(_0x25eb('0x11'));var qs=require(_0x25eb('0x12'));var as=require(_0x25eb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25eb('0x14'))(_0x25eb('0x15'));var utils=require(_0x25eb('0x16'));var config=require(_0x25eb('0x17'));var licenseUtil=require(_0x25eb('0x18'));var db=require(_0x25eb('0x19'))['db'];function respondWithStatusCode(_0x176c04,_0x553eb1){_0x553eb1=_0x553eb1||0xcc;return function(_0x24f209){if(_0x24f209){return _0x176c04[_0x25eb('0x1a')](_0x553eb1);}return _0x176c04[_0x25eb('0x1b')](_0x553eb1)[_0x25eb('0x1c')]();};}function respondWithResult(_0x2082b1,_0x3ca216){_0x3ca216=_0x3ca216||0xc8;return function(_0x5c79be){if(_0x5c79be){return _0x2082b1[_0x25eb('0x1b')](_0x3ca216)[_0x25eb('0x1d')](_0x5c79be);}};}function respondWithFilteredResult(_0x1101fd,_0x3e6b98){return function(_0xfe12a6){if(_0xfe12a6){var _0xea5b99=typeof _0x3e6b98[_0x25eb('0x1e')]==='undefined'&&typeof _0x3e6b98[_0x25eb('0x1f')]==='undefined';var _0x58c14f=_0xfe12a6['count'];var _0x42208d=_0xea5b99?0x0:_0x3e6b98[_0x25eb('0x1e')];var _0x1bde62=_0xea5b99?_0xfe12a6[_0x25eb('0x20')]:_0x3e6b98[_0x25eb('0x1e')]+_0x3e6b98[_0x25eb('0x1f')];var _0x28ada7;if(_0x1bde62>=_0x58c14f){_0x1bde62=_0x58c14f;_0x28ada7=0xc8;}else{_0x28ada7=0xce;}_0x1101fd[_0x25eb('0x1b')](_0x28ada7);return _0x1101fd[_0x25eb('0x21')](_0x25eb('0x22'),_0x42208d+'-'+_0x1bde62+'/'+_0x58c14f)[_0x25eb('0x1d')](_0xfe12a6);}return null;};}function patchUpdates(_0x39baec){return function(_0x2d039b){try{jsonpatch[_0x25eb('0x23')](_0x2d039b,_0x39baec,!![]);}catch(_0x3819c8){return BPromise[_0x25eb('0x24')](_0x3819c8);}return _0x2d039b[_0x25eb('0x25')]();};}function saveUpdates(_0x180cb1,_0x4546d1){return function(_0x5ed6e2){if(_0x5ed6e2){return _0x5ed6e2[_0x25eb('0x26')](_0x180cb1)[_0x25eb('0x27')](function(_0x5b2dd4){return _0x5b2dd4;});}return null;};}function removeEntity(_0x16e691,_0x4adfa2){return function(_0x40c32c){if(_0x40c32c){return _0x40c32c['destroy']()[_0x25eb('0x27')](function(){_0x16e691['status'](0xcc)[_0x25eb('0x1c')]();});}};}function handleEntityNotFound(_0x3220ee,_0x5b3146){return function(_0x283cad){if(!_0x283cad){_0x3220ee[_0x25eb('0x1a')](0x194);}return _0x283cad;};}function handleError(_0x2a6531,_0x5ce412){_0x5ce412=_0x5ce412||0x1f4;return function(_0x2e8896){logger[_0x25eb('0x28')](_0x2e8896[_0x25eb('0x29')]);if(_0x2e8896[_0x25eb('0x2a')]){delete _0x2e8896[_0x25eb('0x2a')];}_0x2a6531[_0x25eb('0x1b')](_0x5ce412)[_0x25eb('0x2b')](_0x2e8896);};}exports['index']=function(_0x5cc6dd,_0x5d9044){var _0x3841c6={},_0x3ff245={},_0x5efd16={'count':0x0,'rows':[]};var _0x2e802c=_[_0x25eb('0x2c')](db[_0x25eb('0x2d')]['rawAttributes'],function(_0x3959c9){return{'name':_0x3959c9[_0x25eb('0x2e')],'type':_0x3959c9[_0x25eb('0x2f')][_0x25eb('0x30')]};});_0x3ff245[_0x25eb('0x31')]=_[_0x25eb('0x2c')](_0x2e802c,'name');_0x3ff245['query']=_[_0x25eb('0x32')](_0x5cc6dd[_0x25eb('0x33')]);_0x3ff245[_0x25eb('0x34')]=_[_0x25eb('0x35')](_0x3ff245['model'],_0x3ff245['query']);_0x3841c6[_0x25eb('0x36')]=_['intersection'](_0x3ff245[_0x25eb('0x31')],qs[_0x25eb('0x37')](_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x37')]));_0x3841c6['attributes']=_0x3841c6[_0x25eb('0x36')]['length']?_0x3841c6[_0x25eb('0x36')]:_0x3ff245[_0x25eb('0x31')];if(!_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x38')](_0x25eb('0x39'))){_0x3841c6[_0x25eb('0x1f')]=qs['limit'](_0x5cc6dd['query']['limit']);_0x3841c6[_0x25eb('0x1e')]=qs[_0x25eb('0x1e')](_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x1e')]);}_0x3841c6[_0x25eb('0x3a')]=qs[_0x25eb('0x3b')](_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x3b')]);_0x3841c6[_0x25eb('0x3c')]=qs[_0x25eb('0x34')](_['pick'](_0x5cc6dd[_0x25eb('0x33')],_0x3ff245[_0x25eb('0x34')]),_0x2e802c);if(_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x3d')]){_0x3841c6[_0x25eb('0x3c')]=_['merge'](_0x3841c6['where'],{'$or':_[_0x25eb('0x2c')](_0x2e802c,function(_0x3fd4ab){if(_0x3fd4ab[_0x25eb('0x2f')]!==_0x25eb('0x3e')){var _0x28ede1={};_0x28ede1[_0x3fd4ab[_0x25eb('0x2a')]]={'$like':'%'+_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x3d')]+'%'};return _0x28ede1;}})});}_0x3841c6=_['merge']({},_0x3841c6,_0x5cc6dd['options']);var _0x4f411e={'where':_0x3841c6['where']};return db[_0x25eb('0x2d')][_0x25eb('0x20')](_0x4f411e)[_0x25eb('0x27')](function(_0x14198f){_0x5efd16[_0x25eb('0x20')]=_0x14198f;if(_0x5cc6dd[_0x25eb('0x33')][_0x25eb('0x3f')]){_0x3841c6[_0x25eb('0x40')]=[{'all':!![]}];}return db[_0x25eb('0x2d')][_0x25eb('0x41')](_0x3841c6);})[_0x25eb('0x27')](function(_0x4440a8){_0x5efd16[_0x25eb('0x42')]=_0x4440a8;return _0x5efd16;})[_0x25eb('0x27')](respondWithFilteredResult(_0x5d9044,_0x3841c6))[_0x25eb('0x43')](handleError(_0x5d9044,null));};exports[_0x25eb('0x44')]=function(_0xf21fd1,_0x10a5fa){var _0x5919b4={'raw':!![],'where':{'id':_0xf21fd1[_0x25eb('0x45')]['id']}},_0x5dd5c8={};_0x5dd5c8[_0x25eb('0x31')]=_[_0x25eb('0x32')](db[_0x25eb('0x2d')][_0x25eb('0x46')]);_0x5dd5c8['query']=_[_0x25eb('0x32')](_0xf21fd1[_0x25eb('0x33')]);_0x5dd5c8[_0x25eb('0x34')]=_['intersection'](_0x5dd5c8[_0x25eb('0x31')],_0x5dd5c8[_0x25eb('0x33')]);_0x5919b4['attributes']=_[_0x25eb('0x35')](_0x5dd5c8['model'],qs['fields'](_0xf21fd1[_0x25eb('0x33')][_0x25eb('0x37')]));_0x5919b4[_0x25eb('0x36')]=_0x5919b4[_0x25eb('0x36')][_0x25eb('0x47')]?_0x5919b4[_0x25eb('0x36')]:_0x5dd5c8[_0x25eb('0x31')];if(_0xf21fd1[_0x25eb('0x33')][_0x25eb('0x3f')]){_0x5919b4[_0x25eb('0x40')]=[{'all':!![]}];}_0x5919b4=_[_0x25eb('0x48')]({},_0x5919b4,_0xf21fd1[_0x25eb('0x49')]);return db['MailServerOut'][_0x25eb('0x4a')](_0x5919b4)[_0x25eb('0x27')](handleEntityNotFound(_0x10a5fa,null))[_0x25eb('0x27')](respondWithResult(_0x10a5fa,null))[_0x25eb('0x43')](handleError(_0x10a5fa,null));};exports[_0x25eb('0x4b')]=function(_0x230df2,_0xeff8fe){return db[_0x25eb('0x2d')][_0x25eb('0x4b')](_0x230df2[_0x25eb('0x4c')],{})[_0x25eb('0x27')](respondWithResult(_0xeff8fe,0xc9))[_0x25eb('0x43')](handleError(_0xeff8fe,null));};exports[_0x25eb('0x26')]=function(_0x392d0a,_0x26601f){if(_0x392d0a[_0x25eb('0x4c')]['id']){delete _0x392d0a['body']['id'];}return db[_0x25eb('0x2d')][_0x25eb('0x4a')]({'where':{'id':_0x392d0a[_0x25eb('0x45')]['id']}})[_0x25eb('0x27')](handleEntityNotFound(_0x26601f,null))[_0x25eb('0x27')](saveUpdates(_0x392d0a[_0x25eb('0x4c')],null))[_0x25eb('0x27')](respondWithResult(_0x26601f,null))[_0x25eb('0x43')](handleError(_0x26601f,null));};exports[_0x25eb('0x4d')]=function(_0x29f75b,_0x550097){return db[_0x25eb('0x2d')]['find']({'where':{'id':_0x29f75b['params']['id']}})[_0x25eb('0x27')](handleEntityNotFound(_0x550097,null))[_0x25eb('0x27')](removeEntity(_0x550097,null))['catch'](handleError(_0x550097,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 5b5d561..d1931a8 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 _0xc7c5=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc7c5,0x1da));var _0x5c7c=function(_0x436082,_0x358406){_0x436082=_0x436082-0x0;var _0x1455fd=_0xc7c5[_0x436082];return _0x1455fd;};'use strict';var _=require(_0x5c7c('0x0'));var util=require(_0x5c7c('0x1'));var logger=require(_0x5c7c('0x2'))('api');var moment=require(_0x5c7c('0x3'));var BPromise=require(_0x5c7c('0x4'));var rp=require(_0x5c7c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c7c('0x6'));var config=require(_0x5c7c('0x7'));var attributes=require(_0x5c7c('0x8'));module[_0x5c7c('0x9')]=function(_0x1a976b,_0x25dce6){return _0x1a976b[_0x5c7c('0xa')](_0x5c7c('0xb'),attributes,{'tableName':_0x5c7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c5=['mail_servers_out','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','define'];(function(_0x3a47e2,_0x18184b){var _0x5e5d40=function(_0x51e9b5){while(--_0x51e9b5){_0x3a47e2['push'](_0x3a47e2['shift']());}};_0x5e5d40(++_0x18184b);}(_0xe0c5,0x16c));var _0x5e0c=function(_0x1a821e,_0x590c41){_0x1a821e=_0x1a821e-0x0;var _0x1ee88d=_0xe0c5[_0x1a821e];return _0x1ee88d;};'use strict';var _=require(_0x5e0c('0x0'));var util=require('util');var logger=require(_0x5e0c('0x1'))(_0x5e0c('0x2'));var moment=require(_0x5e0c('0x3'));var BPromise=require(_0x5e0c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e0c('0x5'));var rimraf=require(_0x5e0c('0x6'));var config=require(_0x5e0c('0x7'));var attributes=require(_0x5e0c('0x8'));module['exports']=function(_0x32998e,_0x569da5){return _0x32998e[_0x5e0c('0x9')]('MailServerOut',attributes,{'tableName':_0x5e0c('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 9f62c40..dfac6b2 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x452255,_0x5400ad){_0x452255=_0x452255-0x0;var _0x19251b=_0x7a54[_0x452255];return _0x19251b;};'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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x233848,_0x5b6a60){var _0x22c2b9=function(_0x4376cb){while(--_0x4376cb){_0x233848['push'](_0x233848['shift']());}};_0x22c2b9(++_0x5b6a60);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b1753,_0x5b814c){_0x4b1753=_0x4b1753-0x0;var _0x3434f9=_0x5f2f[_0x4b1753];return _0x3434f9;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index db1a055..0bdb7f4 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 _0xcdf1=['create','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x908ed9,_0x6330eb){var _0x177540=function(_0x558618){while(--_0x558618){_0x908ed9['push'](_0x908ed9['shift']());}};_0x177540(++_0x6330eb);}(_0xcdf1,0x19b));var _0x1cdf=function(_0xfe7cab,_0x303f19){_0xfe7cab=_0xfe7cab-0x0;var _0x221b12=_0xcdf1[_0xfe7cab];return _0x221b12;};'use strict';var multer=require('multer');var util=require(_0x1cdf('0x0'));var path=require(_0x1cdf('0x1'));var timeout=require('connect-timeout');var express=require(_0x1cdf('0x2'));var router=express[_0x1cdf('0x3')]();var fs_extra=require(_0x1cdf('0x4'));var auth=require(_0x1cdf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1cdf('0x6'));router[_0x1cdf('0x7')]('/',auth[_0x1cdf('0x8')](),controller[_0x1cdf('0x9')]);router[_0x1cdf('0x7')](_0x1cdf('0xa'),auth[_0x1cdf('0x8')](),controller[_0x1cdf('0xb')]);router[_0x1cdf('0x7')](_0x1cdf('0xc'),auth['isAuthenticated'](),controller[_0x1cdf('0xd')]);router['post']('/',auth[_0x1cdf('0x8')](),controller[_0x1cdf('0xe')]);router['put'](_0x1cdf('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1cdf('0xf')](_0x1cdf('0xc'),auth[_0x1cdf('0x8')](),controller['destroy']);module[_0x1cdf('0x10')]=router; \ No newline at end of file +var _0x943d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xc857f4,_0x598666){var _0x5b9d4b=function(_0x28312d){while(--_0x28312d){_0xc857f4['push'](_0xc857f4['shift']());}};_0x5b9d4b(++_0x598666);}(_0x943d,0x19e));var _0xd943=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x943d[_0x695b76];return _0x1dc21f;};'use strict';var multer=require(_0xd943('0x0'));var util=require(_0xd943('0x1'));var path=require(_0xd943('0x2'));var timeout=require(_0xd943('0x3'));var express=require(_0xd943('0x4'));var router=express[_0xd943('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd943('0x6'));var interaction=require(_0xd943('0x7'));var config=require(_0xd943('0x8'));var controller=require(_0xd943('0x9'));router[_0xd943('0xa')]('/',auth[_0xd943('0xb')](),controller['index']);router[_0xd943('0xa')](_0xd943('0xc'),auth[_0xd943('0xb')](),controller[_0xd943('0xd')]);router['get'](_0xd943('0xe'),auth[_0xd943('0xb')](),controller['show']);router[_0xd943('0xf')]('/',auth['isAuthenticated'](),controller[_0xd943('0x10')]);router[_0xd943('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd943('0x12')]);router[_0xd943('0x13')]('/:id',auth[_0xd943('0xb')](),controller[_0xd943('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index e60cecc..ff2ce07 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 _0x71ab=['exports','name'];(function(_0x541e09,_0x12cb1a){var _0x419ee3=function(_0x556e03){while(--_0x556e03){_0x541e09['push'](_0x541e09['shift']());}};_0x419ee3(++_0x12cb1a);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb71a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcf98=['exports','STRING','name'];(function(_0x45eaa8,_0x354904){var _0x249ae1=function(_0xd17493){while(--_0xd17493){_0x45eaa8['push'](_0x45eaa8['shift']());}};_0x249ae1(++_0x354904);}(_0xcf98,0x8d));var _0x8cf9=function(_0x2558d3,_0x5b1529){_0x2558d3=_0x2558d3-0x0;var _0x5d3a71=_0xcf98[_0x2558d3];return _0x5d3a71;};'use strict';var Sequelize=require('sequelize');module[_0x8cf9('0x0')]={'name':{'type':Sequelize[_0x8cf9('0x1')],'unique':_0x8cf9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8cf9('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 16b71b5..54f97f1 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 _0x50c1=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x370cf4,_0xdb72eb){var _0xce824e=function(_0x36dc47){while(--_0x36dc47){_0x370cf4['push'](_0x370cf4['shift']());}};_0xce824e(++_0xdb72eb);}(_0x50c1,0x1e4));var _0x150c=function(_0x7a333e,_0x585018){_0x7a333e=_0x7a333e-0x0;var _0xaf622c=_0x50c1[_0x7a333e];return _0xaf622c;};'use strict';var emlformat=require(_0x150c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x150c('0x1'));var rp=require(_0x150c('0x2'));var moment=require(_0x150c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x150c('0x4'));var util=require(_0x150c('0x5'));var path=require(_0x150c('0x6'));var sox=require(_0x150c('0x7'));var csv=require(_0x150c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x150c('0x9'));var _=require(_0x150c('0xa'));var squel=require(_0x150c('0xb'));var crypto=require(_0x150c('0xc'));var jsforce=require(_0x150c('0xd'));var deskjs=require(_0x150c('0xe'));var toCsv=require(_0x150c('0x8'));var querystring=require(_0x150c('0xf'));var Papa=require(_0x150c('0x10'));var Redis=require(_0x150c('0x11'));var authService=require(_0x150c('0x12'));var qs=require(_0x150c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x150c('0x14'));var logger=require(_0x150c('0x15'))(_0x150c('0x16'));var utils=require(_0x150c('0x17'));var config=require(_0x150c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x150c('0x19'))['db'];function respondWithStatusCode(_0x4aafb6,_0x3dc301){_0x3dc301=_0x3dc301||0xcc;return function(_0x432e07){if(_0x432e07){return _0x4aafb6[_0x150c('0x1a')](_0x3dc301);}return _0x4aafb6[_0x150c('0x1b')](_0x3dc301)['end']();};}function respondWithResult(_0x456dda,_0x2c8c52){_0x2c8c52=_0x2c8c52||0xc8;return function(_0x4d1789){if(_0x4d1789){return _0x456dda[_0x150c('0x1b')](_0x2c8c52)[_0x150c('0x1c')](_0x4d1789);}};}function respondWithFilteredResult(_0x3545a1,_0x4a70cf){return function(_0x11064f){if(_0x11064f){var _0x1a5dce=typeof _0x4a70cf[_0x150c('0x1d')]===_0x150c('0x1e')&&typeof _0x4a70cf[_0x150c('0x1f')]===_0x150c('0x1e');var _0x34be5e=_0x11064f['count'];var _0xc7264a=_0x1a5dce?0x0:_0x4a70cf[_0x150c('0x1d')];var _0x2fd388=_0x1a5dce?_0x11064f[_0x150c('0x20')]:_0x4a70cf[_0x150c('0x1d')]+_0x4a70cf['limit'];var _0xe60b95;if(_0x2fd388>=_0x34be5e){_0x2fd388=_0x34be5e;_0xe60b95=0xc8;}else{_0xe60b95=0xce;}_0x3545a1[_0x150c('0x1b')](_0xe60b95);return _0x3545a1[_0x150c('0x21')](_0x150c('0x22'),_0xc7264a+'-'+_0x2fd388+'/'+_0x34be5e)[_0x150c('0x1c')](_0x11064f);}return null;};}function patchUpdates(_0x5ee3f6){return function(_0x2c997c){try{jsonpatch[_0x150c('0x23')](_0x2c997c,_0x5ee3f6,!![]);}catch(_0x19916d){return BPromise['reject'](_0x19916d);}return _0x2c997c[_0x150c('0x24')]();};}function saveUpdates(_0x512fb1,_0x545c9a){return function(_0x11d8ae){if(_0x11d8ae){return _0x11d8ae[_0x150c('0x25')](_0x512fb1)[_0x150c('0x26')](function(_0x3d1aad){return _0x3d1aad;});}return null;};}function removeEntity(_0x2d6e4b,_0x238b35){return function(_0x1c7a9e){if(_0x1c7a9e){return _0x1c7a9e[_0x150c('0x27')]()[_0x150c('0x26')](function(){_0x2d6e4b[_0x150c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb48c1d,_0x18224d){return function(_0x385445){if(!_0x385445){_0xb48c1d['sendStatus'](0x194);}return _0x385445;};}function handleError(_0x30c83b,_0x36909b){_0x36909b=_0x36909b||0x1f4;return function(_0x5b9bc6){logger[_0x150c('0x28')](_0x5b9bc6[_0x150c('0x29')]);if(_0x5b9bc6[_0x150c('0x2a')]){delete _0x5b9bc6['name'];}_0x30c83b['status'](_0x36909b)[_0x150c('0x2b')](_0x5b9bc6);};}exports[_0x150c('0x2c')]=function(_0x21e328,_0x45cfac){var _0x501109={},_0x1ca03d={},_0x4a3aca={'count':0x0,'rows':[]};var _0x18eeea=_[_0x150c('0x2d')](db[_0x150c('0x2e')]['rawAttributes'],function(_0x53ea01){return{'name':_0x53ea01[_0x150c('0x2f')],'type':_0x53ea01[_0x150c('0x30')][_0x150c('0x31')]};});_0x1ca03d[_0x150c('0x32')]=_[_0x150c('0x2d')](_0x18eeea,'name');_0x1ca03d['query']=_[_0x150c('0x33')](_0x21e328[_0x150c('0x34')]);_0x1ca03d[_0x150c('0x35')]=_[_0x150c('0x36')](_0x1ca03d[_0x150c('0x32')],_0x1ca03d[_0x150c('0x34')]);_0x501109[_0x150c('0x37')]=_[_0x150c('0x36')](_0x1ca03d[_0x150c('0x32')],qs[_0x150c('0x38')](_0x21e328[_0x150c('0x34')][_0x150c('0x38')]));_0x501109[_0x150c('0x37')]=_0x501109[_0x150c('0x37')]['length']?_0x501109[_0x150c('0x37')]:_0x1ca03d[_0x150c('0x32')];if(!_0x21e328[_0x150c('0x34')][_0x150c('0x39')](_0x150c('0x3a'))){_0x501109[_0x150c('0x1f')]=qs[_0x150c('0x1f')](_0x21e328[_0x150c('0x34')][_0x150c('0x1f')]);_0x501109[_0x150c('0x1d')]=qs[_0x150c('0x1d')](_0x21e328[_0x150c('0x34')][_0x150c('0x1d')]);}_0x501109[_0x150c('0x3b')]=qs[_0x150c('0x3c')](_0x21e328['query'][_0x150c('0x3c')]);_0x501109[_0x150c('0x3d')]=qs[_0x150c('0x35')](_['pick'](_0x21e328['query'],_0x1ca03d[_0x150c('0x35')]),_0x18eeea);if(_0x21e328[_0x150c('0x34')][_0x150c('0x3e')]){_0x501109[_0x150c('0x3d')]=_[_0x150c('0x3f')](_0x501109[_0x150c('0x3d')],{'$or':_[_0x150c('0x2d')](_0x18eeea,function(_0x2bd511){if(_0x2bd511[_0x150c('0x30')]!==_0x150c('0x40')){var _0x5263aa={};_0x5263aa[_0x2bd511[_0x150c('0x2a')]]={'$like':'%'+_0x21e328['query'][_0x150c('0x3e')]+'%'};return _0x5263aa;}})});}_0x501109=_[_0x150c('0x3f')]({},_0x501109,_0x21e328[_0x150c('0x41')]);var _0x49ec5b={'where':_0x501109[_0x150c('0x3d')]};return db[_0x150c('0x2e')][_0x150c('0x20')](_0x49ec5b)[_0x150c('0x26')](function(_0x5f336e){_0x4a3aca[_0x150c('0x20')]=_0x5f336e;if(_0x21e328[_0x150c('0x34')][_0x150c('0x42')]){_0x501109[_0x150c('0x43')]=[{'all':!![]}];}return db[_0x150c('0x2e')][_0x150c('0x44')](_0x501109);})['then'](function(_0x4a3e61){_0x4a3aca[_0x150c('0x45')]=_0x4a3e61;return _0x4a3aca;})[_0x150c('0x26')](respondWithFilteredResult(_0x45cfac,_0x501109))[_0x150c('0x46')](handleError(_0x45cfac,null));};exports['show']=function(_0x255b29,_0x175175){var _0x509edd={'raw':!![],'where':{'id':_0x255b29[_0x150c('0x47')]['id']}},_0x3e248d={};_0x3e248d[_0x150c('0x32')]=_[_0x150c('0x33')](db['MailSubstatus'][_0x150c('0x48')]);_0x3e248d[_0x150c('0x34')]=_[_0x150c('0x33')](_0x255b29[_0x150c('0x34')]);_0x3e248d[_0x150c('0x35')]=_[_0x150c('0x36')](_0x3e248d[_0x150c('0x32')],_0x3e248d[_0x150c('0x34')]);_0x509edd[_0x150c('0x37')]=_[_0x150c('0x36')](_0x3e248d[_0x150c('0x32')],qs['fields'](_0x255b29['query']['fields']));_0x509edd[_0x150c('0x37')]=_0x509edd[_0x150c('0x37')]['length']?_0x509edd[_0x150c('0x37')]:_0x3e248d[_0x150c('0x32')];if(_0x255b29['query'][_0x150c('0x42')]){_0x509edd['include']=[{'all':!![]}];}_0x509edd=_[_0x150c('0x3f')]({},_0x509edd,_0x255b29[_0x150c('0x41')]);return db['MailSubstatus'][_0x150c('0x49')](_0x509edd)[_0x150c('0x26')](handleEntityNotFound(_0x175175,null))[_0x150c('0x26')](respondWithResult(_0x175175,null))['catch'](handleError(_0x175175,null));};exports[_0x150c('0x4a')]=function(_0x5034e9,_0x3eef67){return db[_0x150c('0x2e')][_0x150c('0x4a')](_0x5034e9[_0x150c('0x4b')],{})['then'](respondWithResult(_0x3eef67,0xc9))['catch'](handleError(_0x3eef67,null));};exports['update']=function(_0x151a6b,_0x100316){if(_0x151a6b[_0x150c('0x4b')]['id']){delete _0x151a6b[_0x150c('0x4b')]['id'];}return db[_0x150c('0x2e')][_0x150c('0x49')]({'where':{'id':_0x151a6b['params']['id']}})[_0x150c('0x26')](handleEntityNotFound(_0x100316,null))['then'](saveUpdates(_0x151a6b[_0x150c('0x4b')],null))['then'](respondWithResult(_0x100316,null))['catch'](handleError(_0x100316,null));};exports['destroy']=function(_0x22c99b,_0x1f589d){return db[_0x150c('0x2e')]['find']({'where':{'id':_0x22c99b['params']['id']}})['then'](handleEntityNotFound(_0x1f589d,null))[_0x150c('0x26')](removeEntity(_0x1f589d,null))[_0x150c('0x46')](handleError(_0x1f589d,null));};exports['describe']=function(_0x3ef82d,_0x5ed887){return db['MailSubstatus'][_0x150c('0x4c')]()[_0x150c('0x26')](respondWithResult(_0x5ed887,null))['catch'](handleError(_0x5ed887,null));}; \ No newline at end of file +var _0x817b=['count','set','apply','save','then','destroy','end','stack','name','send','index','map','MailSubstatus','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','crypto','jsforce','desk.js','to-csv','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit'];(function(_0x20e621,_0x559acb){var _0x826d70=function(_0x1ca3d3){while(--_0x1ca3d3){_0x20e621['push'](_0x20e621['shift']());}};_0x826d70(++_0x559acb);}(_0x817b,0x71));var _0xb817=function(_0x7a3964,_0x1a6718){_0x7a3964=_0x7a3964-0x0;var _0x4b655d=_0x817b[_0x7a3964];return _0x4b655d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb817('0x0'));var zipdir=require(_0xb817('0x1'));var jsonpatch=require(_0xb817('0x2'));var rp=require(_0xb817('0x3'));var moment=require(_0xb817('0x4'));var BPromise=require(_0xb817('0x5'));var Mustache=require(_0xb817('0x6'));var util=require(_0xb817('0x7'));var path=require(_0xb817('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb817('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb817('0xa'));var jsforce=require(_0xb817('0xb'));var deskjs=require(_0xb817('0xc'));var toCsv=require(_0xb817('0xd'));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(_0xb817('0xe'));var hardwareService=require(_0xb817('0xf'));var logger=require(_0xb817('0x10'))(_0xb817('0x11'));var utils=require(_0xb817('0x12'));var config=require(_0xb817('0x13'));var licenseUtil=require(_0xb817('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24cbd5,_0x570a2a){_0x570a2a=_0x570a2a||0xcc;return function(_0x401438){if(_0x401438){return _0x24cbd5[_0xb817('0x15')](_0x570a2a);}return _0x24cbd5[_0xb817('0x16')](_0x570a2a)['end']();};}function respondWithResult(_0x500740,_0x28a708){_0x28a708=_0x28a708||0xc8;return function(_0x1cda88){if(_0x1cda88){return _0x500740['status'](_0x28a708)[_0xb817('0x17')](_0x1cda88);}};}function respondWithFilteredResult(_0x5b4c3c,_0x497e2a){return function(_0x1a3c08){if(_0x1a3c08){var _0x6cccf7=typeof _0x497e2a[_0xb817('0x18')]===_0xb817('0x19')&&typeof _0x497e2a[_0xb817('0x1a')]==='undefined';var _0x3d02af=_0x1a3c08['count'];var _0x129a87=_0x6cccf7?0x0:_0x497e2a[_0xb817('0x18')];var _0x530d78=_0x6cccf7?_0x1a3c08[_0xb817('0x1b')]:_0x497e2a[_0xb817('0x18')]+_0x497e2a['limit'];var _0x2c4fe8;if(_0x530d78>=_0x3d02af){_0x530d78=_0x3d02af;_0x2c4fe8=0xc8;}else{_0x2c4fe8=0xce;}_0x5b4c3c[_0xb817('0x16')](_0x2c4fe8);return _0x5b4c3c[_0xb817('0x1c')]('Content-Range',_0x129a87+'-'+_0x530d78+'/'+_0x3d02af)[_0xb817('0x17')](_0x1a3c08);}return null;};}function patchUpdates(_0x10d18b){return function(_0x3e3f80){try{jsonpatch[_0xb817('0x1d')](_0x3e3f80,_0x10d18b,!![]);}catch(_0x58a70e){return BPromise['reject'](_0x58a70e);}return _0x3e3f80[_0xb817('0x1e')]();};}function saveUpdates(_0x26e596,_0x17f4a7){return function(_0x26fcfc){if(_0x26fcfc){return _0x26fcfc['update'](_0x26e596)[_0xb817('0x1f')](function(_0x3b057c){return _0x3b057c;});}return null;};}function removeEntity(_0x581caa,_0x4936eb){return function(_0x48f618){if(_0x48f618){return _0x48f618[_0xb817('0x20')]()[_0xb817('0x1f')](function(){_0x581caa['status'](0xcc)[_0xb817('0x21')]();});}};}function handleEntityNotFound(_0x3a6adf,_0x15f247){return function(_0x40d3b0){if(!_0x40d3b0){_0x3a6adf[_0xb817('0x15')](0x194);}return _0x40d3b0;};}function handleError(_0x4fbefb,_0x39efd5){_0x39efd5=_0x39efd5||0x1f4;return function(_0x335946){logger['error'](_0x335946[_0xb817('0x22')]);if(_0x335946['name']){delete _0x335946[_0xb817('0x23')];}_0x4fbefb['status'](_0x39efd5)[_0xb817('0x24')](_0x335946);};}exports[_0xb817('0x25')]=function(_0x43bc0e,_0x10cdbb){var _0x2f93ed={},_0x40b7f7={},_0x50a72b={'count':0x0,'rows':[]};var _0x206d88=_[_0xb817('0x26')](db[_0xb817('0x27')]['rawAttributes'],function(_0x5af8ba){return{'name':_0x5af8ba[_0xb817('0x28')],'type':_0x5af8ba['type']['key']};});_0x40b7f7[_0xb817('0x29')]=_[_0xb817('0x26')](_0x206d88,_0xb817('0x23'));_0x40b7f7[_0xb817('0x2a')]=_['keys'](_0x43bc0e['query']);_0x40b7f7[_0xb817('0x2b')]=_[_0xb817('0x2c')](_0x40b7f7[_0xb817('0x29')],_0x40b7f7[_0xb817('0x2a')]);_0x2f93ed['attributes']=_[_0xb817('0x2c')](_0x40b7f7[_0xb817('0x29')],qs[_0xb817('0x2d')](_0x43bc0e[_0xb817('0x2a')]['fields']));_0x2f93ed[_0xb817('0x2e')]=_0x2f93ed[_0xb817('0x2e')]['length']?_0x2f93ed[_0xb817('0x2e')]:_0x40b7f7[_0xb817('0x29')];if(!_0x43bc0e['query'][_0xb817('0x2f')](_0xb817('0x30'))){_0x2f93ed[_0xb817('0x1a')]=qs['limit'](_0x43bc0e[_0xb817('0x2a')][_0xb817('0x1a')]);_0x2f93ed[_0xb817('0x18')]=qs[_0xb817('0x18')](_0x43bc0e[_0xb817('0x2a')][_0xb817('0x18')]);}_0x2f93ed['order']=qs[_0xb817('0x31')](_0x43bc0e[_0xb817('0x2a')]['sort']);_0x2f93ed[_0xb817('0x32')]=qs[_0xb817('0x2b')](_[_0xb817('0x33')](_0x43bc0e['query'],_0x40b7f7[_0xb817('0x2b')]),_0x206d88);if(_0x43bc0e['query'][_0xb817('0x34')]){_0x2f93ed[_0xb817('0x32')]=_[_0xb817('0x35')](_0x2f93ed['where'],{'$or':_['map'](_0x206d88,function(_0x2a55e2){if(_0x2a55e2[_0xb817('0x36')]!==_0xb817('0x37')){var _0x32c213={};_0x32c213[_0x2a55e2[_0xb817('0x23')]]={'$like':'%'+_0x43bc0e[_0xb817('0x2a')][_0xb817('0x34')]+'%'};return _0x32c213;}})});}_0x2f93ed=_[_0xb817('0x35')]({},_0x2f93ed,_0x43bc0e[_0xb817('0x38')]);var _0x5e5fdb={'where':_0x2f93ed[_0xb817('0x32')]};return db['MailSubstatus']['count'](_0x5e5fdb)[_0xb817('0x1f')](function(_0x512c83){_0x50a72b[_0xb817('0x1b')]=_0x512c83;if(_0x43bc0e[_0xb817('0x2a')][_0xb817('0x39')]){_0x2f93ed[_0xb817('0x3a')]=[{'all':!![]}];}return db[_0xb817('0x27')][_0xb817('0x3b')](_0x2f93ed);})[_0xb817('0x1f')](function(_0x455483){_0x50a72b[_0xb817('0x3c')]=_0x455483;return _0x50a72b;})[_0xb817('0x1f')](respondWithFilteredResult(_0x10cdbb,_0x2f93ed))[_0xb817('0x3d')](handleError(_0x10cdbb,null));};exports[_0xb817('0x3e')]=function(_0x38367e,_0xcebcde){var _0x5dacb6={'raw':!![],'where':{'id':_0x38367e[_0xb817('0x3f')]['id']}},_0x2f4953={};_0x2f4953[_0xb817('0x29')]=_[_0xb817('0x40')](db[_0xb817('0x27')]['rawAttributes']);_0x2f4953[_0xb817('0x2a')]=_[_0xb817('0x40')](_0x38367e[_0xb817('0x2a')]);_0x2f4953['filters']=_['intersection'](_0x2f4953[_0xb817('0x29')],_0x2f4953[_0xb817('0x2a')]);_0x5dacb6['attributes']=_[_0xb817('0x2c')](_0x2f4953['model'],qs['fields'](_0x38367e['query']['fields']));_0x5dacb6[_0xb817('0x2e')]=_0x5dacb6['attributes']['length']?_0x5dacb6[_0xb817('0x2e')]:_0x2f4953[_0xb817('0x29')];if(_0x38367e[_0xb817('0x2a')][_0xb817('0x39')]){_0x5dacb6[_0xb817('0x3a')]=[{'all':!![]}];}_0x5dacb6=_[_0xb817('0x35')]({},_0x5dacb6,_0x38367e[_0xb817('0x38')]);return db[_0xb817('0x27')][_0xb817('0x41')](_0x5dacb6)[_0xb817('0x1f')](handleEntityNotFound(_0xcebcde,null))[_0xb817('0x1f')](respondWithResult(_0xcebcde,null))[_0xb817('0x3d')](handleError(_0xcebcde,null));};exports[_0xb817('0x42')]=function(_0x55b170,_0x4167f4){return db[_0xb817('0x27')][_0xb817('0x42')](_0x55b170[_0xb817('0x43')],{})[_0xb817('0x1f')](respondWithResult(_0x4167f4,0xc9))[_0xb817('0x3d')](handleError(_0x4167f4,null));};exports[_0xb817('0x44')]=function(_0x55525d,_0x4e4172){if(_0x55525d[_0xb817('0x43')]['id']){delete _0x55525d[_0xb817('0x43')]['id'];}return db[_0xb817('0x27')][_0xb817('0x41')]({'where':{'id':_0x55525d['params']['id']}})[_0xb817('0x1f')](handleEntityNotFound(_0x4e4172,null))[_0xb817('0x1f')](saveUpdates(_0x55525d[_0xb817('0x43')],null))[_0xb817('0x1f')](respondWithResult(_0x4e4172,null))[_0xb817('0x3d')](handleError(_0x4e4172,null));};exports['destroy']=function(_0x2ac05d,_0x15de8b){return db[_0xb817('0x27')]['find']({'where':{'id':_0x2ac05d[_0xb817('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15de8b,null))['then'](removeEntity(_0x15de8b,null))[_0xb817('0x3d')](handleError(_0x15de8b,null));};exports[_0xb817('0x45')]=function(_0x55b59b,_0x425c63){return db[_0xb817('0x27')][_0xb817('0x45')]()['then'](respondWithResult(_0x425c63,null))[_0xb817('0x3d')](handleError(_0x425c63,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 86386cd..3321ad7 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 _0x9567=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus'];(function(_0x332ea7,_0x330201){var _0x6e586b=function(_0x23eddd){while(--_0x23eddd){_0x332ea7['push'](_0x332ea7['shift']());}};_0x6e586b(++_0x330201);}(_0x9567,0x1ed));var _0x7956=function(_0x21967c,_0x58dcc2){_0x21967c=_0x21967c-0x0;var _0x5b6c7b=_0x9567[_0x21967c];return _0x5b6c7b;};'use strict';var EventEmitter=require(_0x7956('0x0'));var MailSubstatus=require(_0x7956('0x1'))['db'][_0x7956('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x7956('0x3')};function emitEvent(_0x5ae0aa){return function(_0x14e548,_0x256bae,_0x3bfd86){MailSubstatusEvents[_0x7956('0x4')](_0x5ae0aa+':'+_0x14e548['id'],_0x14e548);MailSubstatusEvents[_0x7956('0x4')](_0x5ae0aa,_0x14e548);_0x3bfd86(null);};}for(var e in events){if(events[_0x7956('0x5')](e)){var event=events[e];MailSubstatus[_0x7956('0x6')](e,emitEvent(event));}}module[_0x7956('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x7888=['update','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x4da6a4,_0x5e5342){var _0x53c698=function(_0x3f0d4c){while(--_0x3f0d4c){_0x4da6a4['push'](_0x4da6a4['shift']());}};_0x53c698(++_0x5e5342);}(_0x7888,0x94));var _0x8788=function(_0x368f01,_0xf64f4f){_0x368f01=_0x368f01-0x0;var _0x164262=_0x7888[_0x368f01];return _0x164262;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x8788('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8788('0x1')](0x0);var events={'afterUpdate':_0x8788('0x2')};function emitEvent(_0x1d62b0){return function(_0x51758d,_0x9ab9f,_0x4b560e){MailSubstatusEvents['emit'](_0x1d62b0+':'+_0x51758d['id'],_0x51758d);MailSubstatusEvents['emit'](_0x1d62b0,_0x51758d);_0x4b560e(null);};}for(var e in events){if(events[_0x8788('0x3')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x8788('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 a7d0293..cd5e14a 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 _0x3945=['define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','./mailSubstatus.attributes','exports','models'];(function(_0x29e3ec,_0x138a18){var _0x25727e=function(_0x2bea0d){while(--_0x2bea0d){_0x29e3ec['push'](_0x29e3ec['shift']());}};_0x25727e(++_0x138a18);}(_0x3945,0x165));var _0x5394=function(_0x4e6a76,_0x405d19){_0x4e6a76=_0x4e6a76-0x0;var _0x125787=_0x3945[_0x4e6a76];return _0x125787;};'use strict';var attributes=require(_0x5394('0x0'));module[_0x5394('0x1')]=function(_0x4b57f4){var _0x5135df=_0x4b57f4[_0x5394('0x2')];return _0x4b57f4[_0x5394('0x3')](_0x5394('0x4'),attributes,{'tableName':_0x5394('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x255019,_0x472a86,_0x5dfc44){return _0x5135df[_0x5394('0x6')][_0x5394('0x7')]({'value':_0x255019[_0x5394('0x8')]},{'where':{'field':'mailSubstatus','value':_0x255019[_0x5394('0x9')][_0x5394('0x8')]}})['then'](function(){_0x5dfc44();})['catch'](function(_0x5783d5){_0x5dfc44(_0x5783d5);});}}});}; \ No newline at end of file +var _0x5d06=['mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','name'];(function(_0x3835b6,_0x19925a){var _0x4cc7e1=function(_0xc4933b){while(--_0xc4933b){_0x3835b6['push'](_0x3835b6['shift']());}};_0x4cc7e1(++_0x19925a);}(_0x5d06,0x13a));var _0x65d0=function(_0x2d3c1f,_0x5e95d2){_0x2d3c1f=_0x2d3c1f-0x0;var _0x440ece=_0x5d06[_0x2d3c1f];return _0x440ece;};'use strict';var attributes=require(_0x65d0('0x0'));module[_0x65d0('0x1')]=function(_0x1ad818){var _0x18c87f=_0x1ad818[_0x65d0('0x2')];return _0x1ad818[_0x65d0('0x3')](_0x65d0('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x59355b,_0x90be7c,_0x51bb61){return _0x18c87f['Condition']['update']({'value':_0x59355b[_0x65d0('0x5')]},{'where':{'field':_0x65d0('0x6'),'value':_0x59355b[_0x65d0('0x7')][_0x65d0('0x5')]}})[_0x65d0('0x8')](function(){_0x51bb61();})[_0x65d0('0x9')](function(_0x1118b7){_0x51bb61(_0x1118b7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1c964fd..b2023a6 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 _0xed31=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent'];(function(_0x1f49fd,_0x20a0bb){var _0x3ba6dc=function(_0xdbbc98){while(--_0xdbbc98){_0x1f49fd['push'](_0x1f49fd['shift']());}};_0x3ba6dc(++_0x20a0bb);}(_0xed31,0x117));var _0x1ed3=function(_0x31784e,_0x38448f){_0x31784e=_0x31784e-0x0;var _0x5f1d91=_0xed31[_0x31784e];return _0x5f1d91;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ed3('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ed3('0x1'))['db'];var utils=require(_0x1ed3('0x2'));var logger=require('../../config/logger')(_0x1ed3('0x3'));var config=require('../../config/environment');var jayson=require(_0x1ed3('0x4'));var client=jayson[_0x1ed3('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36332e,_0x1db249,_0x4f9aa6){return new BPromise(function(_0x211446,_0x5ef3e4){return client[_0x1ed3('0x6')](_0x36332e,_0x4f9aa6)[_0x1ed3('0x7')](function(_0x57c93d){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x1db249,_0x1ed3('0x8'));logger[_0x1ed3('0x9')](_0x1ed3('0xa'),_0x1db249,_0x1ed3('0x8'),JSON[_0x1ed3('0xb')](_0x57c93d));if(_0x57c93d[_0x1ed3('0xc')]){if(_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xd')]===0x1f4){logger[_0x1ed3('0xc')](_0x1ed3('0xe'),_0x1db249,_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);return _0x5ef3e4(_0x57c93d['error']['message']);}logger['error'](_0x1ed3('0xe'),_0x1db249,_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);return _0x211446(_0x57c93d[_0x1ed3('0xc')][_0x1ed3('0xf')]);}else{logger[_0x1ed3('0x10')](_0x1ed3('0xe'),_0x1db249,'request\x20sent');_0x211446(_0x57c93d[_0x1ed3('0x11')][_0x1ed3('0xf')]);}})['catch'](function(_0xa8ec06){logger[_0x1ed3('0xc')](_0x1ed3('0xe'),_0x1db249,_0xa8ec06);_0x5ef3e4(_0xa8ec06);});});} \ No newline at end of file +var _0xd4ca=['request\x20sent','error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x19f889,_0x460eb6){var _0x48ff4c=function(_0x2c2803){while(--_0x2c2803){_0x19f889['push'](_0x19f889['shift']());}};_0x48ff4c(++_0x460eb6);}(_0xd4ca,0x1c0));var _0xad4c=function(_0x422ca2,_0x28cf8e){_0x422ca2=_0x422ca2-0x0;var _0xad625c=_0xd4ca[_0x422ca2];return _0xad625c;};'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(_0xad4c('0x0'));var db=require(_0xad4c('0x1'))['db'];var utils=require(_0xad4c('0x2'));var logger=require(_0xad4c('0x3'))(_0xad4c('0x4'));var config=require(_0xad4c('0x5'));var jayson=require(_0xad4c('0x6'));var client=jayson[_0xad4c('0x7')][_0xad4c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3788f7,_0x8f3732,_0x1a5df3){return new BPromise(function(_0x30abb1,_0x272da5){return client[_0xad4c('0x9')](_0x3788f7,_0x1a5df3)[_0xad4c('0xa')](function(_0x21d05a){logger[_0xad4c('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x8f3732,'request\x20sent');logger[_0xad4c('0xc')](_0xad4c('0xd'),_0x8f3732,_0xad4c('0xe'),JSON['stringify'](_0x21d05a));if(_0x21d05a[_0xad4c('0xf')]){if(_0x21d05a[_0xad4c('0xf')][_0xad4c('0x10')]===0x1f4){logger[_0xad4c('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x8f3732,_0x21d05a['error'][_0xad4c('0x11')]);return _0x272da5(_0x21d05a[_0xad4c('0xf')][_0xad4c('0x11')]);}logger[_0xad4c('0xf')](_0xad4c('0x12'),_0x8f3732,_0x21d05a[_0xad4c('0xf')][_0xad4c('0x11')]);return _0x30abb1(_0x21d05a['error'][_0xad4c('0x11')]);}else{logger[_0xad4c('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x8f3732,_0xad4c('0xe'));_0x30abb1(_0x21d05a[_0xad4c('0x13')][_0xad4c('0x11')]);}})[_0xad4c('0x14')](function(_0x41d033){logger[_0xad4c('0xf')](_0xad4c('0x12'),_0x8f3732,_0x41d033);_0x272da5(_0x41d033);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e4fea2f..490ab49 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 _0x703d=['index','/describe','describe','show','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x5b49ea,_0x3ba4b3){var _0xdb1e6b=function(_0x1dc3e6){while(--_0x1dc3e6){_0x5b49ea['push'](_0x5b49ea['shift']());}};_0xdb1e6b(++_0x3ba4b3);}(_0x703d,0x1d8));var _0xd703=function(_0x212d98,_0x14a2a6){_0x212d98=_0x212d98-0x0;var _0x4637ca=_0x703d[_0x212d98];return _0x4637ca;};'use strict';var multer=require(_0xd703('0x0'));var util=require(_0xd703('0x1'));var path=require(_0xd703('0x2'));var timeout=require('connect-timeout');var express=require(_0xd703('0x3'));var router=express[_0xd703('0x4')]();var fs_extra=require(_0xd703('0x5'));var auth=require(_0xd703('0x6'));var interaction=require(_0xd703('0x7'));var config=require('../../config/environment');var controller=require(_0xd703('0x8'));router[_0xd703('0x9')]('/',auth[_0xd703('0xa')](),controller[_0xd703('0xb')]);router[_0xd703('0x9')](_0xd703('0xc'),auth[_0xd703('0xa')](),controller[_0xd703('0xd')]);router[_0xd703('0x9')]('/:id',auth[_0xd703('0xa')](),controller[_0xd703('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd703('0xf')]);router[_0xd703('0x10')](_0xd703('0x11'),auth[_0xd703('0xa')](),controller[_0xd703('0x12')]);router['delete'](_0xd703('0x11'),auth['isAuthenticated'](),controller[_0xd703('0x13')]);module[_0xd703('0x14')]=router; \ No newline at end of file +var _0x108e=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','exports'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x108e,0x1f4));var _0xe108=function(_0x53ddda,_0x5e8608){_0x53ddda=_0x53ddda-0x0;var _0x56cf93=_0x108e[_0x53ddda];return _0x56cf93;};'use strict';var multer=require(_0xe108('0x0'));var util=require(_0xe108('0x1'));var path=require('path');var timeout=require(_0xe108('0x2'));var express=require(_0xe108('0x3'));var router=express[_0xe108('0x4')]();var fs_extra=require(_0xe108('0x5'));var auth=require(_0xe108('0x6'));var interaction=require(_0xe108('0x7'));var config=require('../../config/environment');var controller=require(_0xe108('0x8'));router[_0xe108('0x9')]('/',auth[_0xe108('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe108('0xb')]);router['get']('/:id',auth[_0xe108('0xa')](),controller[_0xe108('0xc')]);router[_0xe108('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe108('0xe')](_0xe108('0xf'),auth[_0xe108('0xa')](),controller[_0xe108('0x10')]);router[_0xe108('0x11')]('/:id',auth[_0xe108('0xa')](),controller[_0xe108('0x12')]);module[_0xe108('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 f96afbc..cbac3c8 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x191639,_0x39d148){var _0xb8cfdc=function(_0x17e3b5){while(--_0x17e3b5){_0x191639['push'](_0x191639['shift']());}};_0xb8cfdc(++_0x39d148);}(_0xf4eb,0xec));var _0xbf4e=function(_0x490a58,_0xcd83e6){_0x490a58=_0x490a58-0x0;var _0x286ee8=_0xf4eb[_0x490a58];return _0x286ee8;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x13c174,_0xda25fe){var _0x160654=function(_0x1b6ac2){while(--_0x1b6ac2){_0x13c174['push'](_0x13c174['shift']());}};_0x160654(++_0xda25fe);}(_0x34e8,0x12c));var _0x834e=function(_0x11050d,_0xf5957){_0x11050d=_0x11050d-0x0;var _0x195d37=_0x34e8[_0x11050d];return _0x195d37;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 442ff64..7944759 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 _0x3754=['status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','send','index','MailTransferReport','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','merge','catch','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xced689,_0x2f74a6){var _0x3ff91b=function(_0x179314){while(--_0x179314){_0xced689['push'](_0xced689['shift']());}};_0x3ff91b(++_0x2f74a6);}(_0x3754,0x125));var _0x4375=function(_0x4e59ac,_0xef8257){_0x4e59ac=_0x4e59ac-0x0;var _0x2292ad=_0x3754[_0x4e59ac];return _0x2292ad;};'use strict';var emlformat=require(_0x4375('0x0'));var rimraf=require(_0x4375('0x1'));var zipdir=require(_0x4375('0x2'));var jsonpatch=require(_0x4375('0x3'));var rp=require(_0x4375('0x4'));var moment=require(_0x4375('0x5'));var BPromise=require(_0x4375('0x6'));var Mustache=require('mustache');var util=require(_0x4375('0x7'));var path=require('path');var sox=require(_0x4375('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4375('0x9'));var squel=require(_0x4375('0xa'));var crypto=require(_0x4375('0xb'));var jsforce=require(_0x4375('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4375('0xd'));var querystring=require(_0x4375('0xe'));var Papa=require(_0x4375('0xf'));var Redis=require(_0x4375('0x10'));var authService=require(_0x4375('0x11'));var qs=require(_0x4375('0x12'));var as=require(_0x4375('0x13'));var hardwareService=require(_0x4375('0x14'));var logger=require(_0x4375('0x15'))('api');var utils=require(_0x4375('0x16'));var config=require(_0x4375('0x17'));var licenseUtil=require(_0x4375('0x18'));var db=require(_0x4375('0x19'))['db'];function respondWithStatusCode(_0x1a4736,_0x731afd){_0x731afd=_0x731afd||0xcc;return function(_0x25863d){if(_0x25863d){return _0x1a4736[_0x4375('0x1a')](_0x731afd);}return _0x1a4736[_0x4375('0x1b')](_0x731afd)[_0x4375('0x1c')]();};}function respondWithResult(_0x16bd9a,_0x52c54d){_0x52c54d=_0x52c54d||0xc8;return function(_0x3477ca){if(_0x3477ca){return _0x16bd9a[_0x4375('0x1b')](_0x52c54d)[_0x4375('0x1d')](_0x3477ca);}};}function respondWithFilteredResult(_0x59c4d0,_0x4de4a8){return function(_0x395ccc){if(_0x395ccc){var _0x349fa7=typeof _0x4de4a8[_0x4375('0x1e')]===_0x4375('0x1f')&&typeof _0x4de4a8['limit']==='undefined';var _0x2a1bde=_0x395ccc['count'];var _0x4e4e53=_0x349fa7?0x0:_0x4de4a8[_0x4375('0x1e')];var _0x26e999=_0x349fa7?_0x395ccc[_0x4375('0x20')]:_0x4de4a8['offset']+_0x4de4a8[_0x4375('0x21')];var _0x5e944a;if(_0x26e999>=_0x2a1bde){_0x26e999=_0x2a1bde;_0x5e944a=0xc8;}else{_0x5e944a=0xce;}_0x59c4d0['status'](_0x5e944a);return _0x59c4d0[_0x4375('0x22')]('Content-Range',_0x4e4e53+'-'+_0x26e999+'/'+_0x2a1bde)['json'](_0x395ccc);}return null;};}function patchUpdates(_0x5df2fc){return function(_0x58ed21){try{jsonpatch[_0x4375('0x23')](_0x58ed21,_0x5df2fc,!![]);}catch(_0x6efc79){return BPromise[_0x4375('0x24')](_0x6efc79);}return _0x58ed21[_0x4375('0x25')]();};}function saveUpdates(_0x25337c,_0x896a09){return function(_0x28ec10){if(_0x28ec10){return _0x28ec10[_0x4375('0x26')](_0x25337c)[_0x4375('0x27')](function(_0x4abf88){return _0x4abf88;});}return null;};}function removeEntity(_0x43d598,_0x703066){return function(_0x1cbcbe){if(_0x1cbcbe){return _0x1cbcbe['destroy']()['then'](function(){_0x43d598[_0x4375('0x1b')](0xcc)[_0x4375('0x1c')]();});}};}function handleEntityNotFound(_0x17a2fa,_0x511028){return function(_0xabbd32){if(!_0xabbd32){_0x17a2fa['sendStatus'](0x194);}return _0xabbd32;};}function handleError(_0x49066b,_0x4c51df){_0x4c51df=_0x4c51df||0x1f4;return function(_0x22b975){logger[_0x4375('0x28')](_0x22b975[_0x4375('0x29')]);if(_0x22b975[_0x4375('0x2a')]){delete _0x22b975[_0x4375('0x2a')];}_0x49066b[_0x4375('0x1b')](_0x4c51df)[_0x4375('0x2b')](_0x22b975);};}exports[_0x4375('0x2c')]=function(_0x4d739c,_0xa15d90){var _0x16e973={},_0x108bdc={},_0x5f0a72={'count':0x0,'rows':[]};var _0x2012c3=_['map'](db[_0x4375('0x2d')]['rawAttributes'],function(_0x1bd0bf){return{'name':_0x1bd0bf['fieldName'],'type':_0x1bd0bf[_0x4375('0x2e')][_0x4375('0x2f')]};});_0x108bdc[_0x4375('0x30')]=_[_0x4375('0x31')](_0x2012c3,_0x4375('0x2a'));_0x108bdc[_0x4375('0x32')]=_[_0x4375('0x33')](_0x4d739c[_0x4375('0x32')]);_0x108bdc[_0x4375('0x34')]=_[_0x4375('0x35')](_0x108bdc['model'],_0x108bdc[_0x4375('0x32')]);_0x16e973[_0x4375('0x36')]=_[_0x4375('0x35')](_0x108bdc[_0x4375('0x30')],qs[_0x4375('0x37')](_0x4d739c[_0x4375('0x32')]['fields']));_0x16e973[_0x4375('0x36')]=_0x16e973[_0x4375('0x36')][_0x4375('0x38')]?_0x16e973[_0x4375('0x36')]:_0x108bdc['model'];if(!_0x4d739c[_0x4375('0x32')][_0x4375('0x39')](_0x4375('0x3a'))){_0x16e973[_0x4375('0x21')]=qs[_0x4375('0x21')](_0x4d739c[_0x4375('0x32')][_0x4375('0x21')]);_0x16e973['offset']=qs[_0x4375('0x1e')](_0x4d739c[_0x4375('0x32')]['offset']);}_0x16e973[_0x4375('0x3b')]=qs[_0x4375('0x3c')](_0x4d739c[_0x4375('0x32')][_0x4375('0x3c')]);_0x16e973['where']=qs[_0x4375('0x34')](_[_0x4375('0x3d')](_0x4d739c[_0x4375('0x32')],_0x108bdc[_0x4375('0x34')]),_0x2012c3);if(_0x4d739c[_0x4375('0x32')][_0x4375('0x3e')]){_0x16e973[_0x4375('0x3f')]=_['merge'](_0x16e973[_0x4375('0x3f')],{'$or':_[_0x4375('0x31')](_0x2012c3,function(_0x1550e6){if(_0x1550e6[_0x4375('0x2e')]!==_0x4375('0x40')){var _0x20ec6f={};_0x20ec6f[_0x1550e6[_0x4375('0x2a')]]={'$like':'%'+_0x4d739c[_0x4375('0x32')][_0x4375('0x3e')]+'%'};return _0x20ec6f;}})});}_0x16e973=_['merge']({},_0x16e973,_0x4d739c[_0x4375('0x41')]);var _0x11431c={'where':_0x16e973['where']};return db[_0x4375('0x2d')]['count'](_0x11431c)[_0x4375('0x27')](function(_0x3bfe14){_0x5f0a72['count']=_0x3bfe14;if(_0x4d739c[_0x4375('0x32')][_0x4375('0x42')]){_0x16e973[_0x4375('0x43')]=[{'all':!![]}];}return db['MailTransferReport'][_0x4375('0x44')](_0x16e973);})[_0x4375('0x27')](function(_0x50b8c9){_0x5f0a72[_0x4375('0x45')]=_0x50b8c9;return _0x5f0a72;})[_0x4375('0x27')](respondWithFilteredResult(_0xa15d90,_0x16e973))['catch'](handleError(_0xa15d90,null));};exports[_0x4375('0x46')]=function(_0x3fa49d,_0x1d747c){var _0x15b8ae={'raw':!![],'where':{'id':_0x3fa49d['params']['id']}},_0x34c2ad={};_0x34c2ad['model']=_[_0x4375('0x33')](db[_0x4375('0x2d')][_0x4375('0x47')]);_0x34c2ad[_0x4375('0x32')]=_[_0x4375('0x33')](_0x3fa49d[_0x4375('0x32')]);_0x34c2ad[_0x4375('0x34')]=_[_0x4375('0x35')](_0x34c2ad[_0x4375('0x30')],_0x34c2ad[_0x4375('0x32')]);_0x15b8ae[_0x4375('0x36')]=_[_0x4375('0x35')](_0x34c2ad[_0x4375('0x30')],qs[_0x4375('0x37')](_0x3fa49d['query'][_0x4375('0x37')]));_0x15b8ae[_0x4375('0x36')]=_0x15b8ae[_0x4375('0x36')][_0x4375('0x38')]?_0x15b8ae[_0x4375('0x36')]:_0x34c2ad[_0x4375('0x30')];if(_0x3fa49d[_0x4375('0x32')][_0x4375('0x42')]){_0x15b8ae['include']=[{'all':!![]}];}_0x15b8ae=_[_0x4375('0x48')]({},_0x15b8ae,_0x3fa49d[_0x4375('0x41')]);return db[_0x4375('0x2d')]['find'](_0x15b8ae)[_0x4375('0x27')](handleEntityNotFound(_0x1d747c,null))['then'](respondWithResult(_0x1d747c,null))[_0x4375('0x49')](handleError(_0x1d747c,null));};exports['create']=function(_0x27d221,_0x2d92c4){return db['MailTransferReport'][_0x4375('0x4a')](_0x27d221['body'],{})['then'](respondWithResult(_0x2d92c4,0xc9))[_0x4375('0x49')](handleError(_0x2d92c4,null));};exports[_0x4375('0x26')]=function(_0x442a24,_0xf649f2){if(_0x442a24[_0x4375('0x4b')]['id']){delete _0x442a24[_0x4375('0x4b')]['id'];}return db['MailTransferReport'][_0x4375('0x4c')]({'where':{'id':_0x442a24[_0x4375('0x4d')]['id']}})[_0x4375('0x27')](handleEntityNotFound(_0xf649f2,null))[_0x4375('0x27')](saveUpdates(_0x442a24[_0x4375('0x4b')],null))[_0x4375('0x27')](respondWithResult(_0xf649f2,null))['catch'](handleError(_0xf649f2,null));};exports[_0x4375('0x4e')]=function(_0x28577e,_0x3f797c){return db[_0x4375('0x2d')][_0x4375('0x4c')]({'where':{'id':_0x28577e[_0x4375('0x4d')]['id']}})[_0x4375('0x27')](handleEntityNotFound(_0x3f797c,null))[_0x4375('0x27')](removeEntity(_0x3f797c,null))[_0x4375('0x49')](handleError(_0x3f797c,null));};exports[_0x4375('0x4f')]=function(_0x511b39,_0x58852d){return db[_0x4375('0x2d')][_0x4375('0x4f')]()[_0x4375('0x27')](respondWithResult(_0x58852d,null))['catch'](handleError(_0x58852d,null));}; \ No newline at end of file +var _0xb838=['sendStatus','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','end','status','offset','undefined','limit','set','json','apply','reject','then','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb838,0x6e));var _0x8b83=function(_0x39b7e7,_0x2fc81e){_0x39b7e7=_0x39b7e7-0x0;var _0x399ebb=_0xb838[_0x39b7e7];return _0x399ebb;};'use strict';var emlformat=require(_0x8b83('0x0'));var rimraf=require(_0x8b83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b83('0x2'));var rp=require(_0x8b83('0x3'));var moment=require(_0x8b83('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8b83('0x5'));var sox=require(_0x8b83('0x6'));var csv=require(_0x8b83('0x7'));var ejs=require(_0x8b83('0x8'));var fs=require('fs');var fs_extra=require(_0x8b83('0x9'));var _=require(_0x8b83('0xa'));var squel=require(_0x8b83('0xb'));var crypto=require(_0x8b83('0xc'));var jsforce=require(_0x8b83('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8b83('0x7'));var querystring=require(_0x8b83('0xe'));var Papa=require('papaparse');var Redis=require(_0x8b83('0xf'));var authService=require(_0x8b83('0x10'));var qs=require(_0x8b83('0x11'));var as=require(_0x8b83('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b83('0x13'))('api');var utils=require(_0x8b83('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5536ee,_0x64b7d7){_0x64b7d7=_0x64b7d7||0xcc;return function(_0x429e3d){if(_0x429e3d){return _0x5536ee['sendStatus'](_0x64b7d7);}return _0x5536ee['status'](_0x64b7d7)[_0x8b83('0x15')]();};}function respondWithResult(_0x42d39e,_0x48e0ed){_0x48e0ed=_0x48e0ed||0xc8;return function(_0x5d0aad){if(_0x5d0aad){return _0x42d39e[_0x8b83('0x16')](_0x48e0ed)['json'](_0x5d0aad);}};}function respondWithFilteredResult(_0x475855,_0x5671b6){return function(_0x234dda){if(_0x234dda){var _0x357d42=typeof _0x5671b6[_0x8b83('0x17')]===_0x8b83('0x18')&&typeof _0x5671b6[_0x8b83('0x19')]===_0x8b83('0x18');var _0x41e783=_0x234dda['count'];var _0x9afc72=_0x357d42?0x0:_0x5671b6[_0x8b83('0x17')];var _0x3767a6=_0x357d42?_0x234dda['count']:_0x5671b6[_0x8b83('0x17')]+_0x5671b6[_0x8b83('0x19')];var _0x10b586;if(_0x3767a6>=_0x41e783){_0x3767a6=_0x41e783;_0x10b586=0xc8;}else{_0x10b586=0xce;}_0x475855[_0x8b83('0x16')](_0x10b586);return _0x475855[_0x8b83('0x1a')]('Content-Range',_0x9afc72+'-'+_0x3767a6+'/'+_0x41e783)[_0x8b83('0x1b')](_0x234dda);}return null;};}function patchUpdates(_0x520fd1){return function(_0x5ab525){try{jsonpatch[_0x8b83('0x1c')](_0x5ab525,_0x520fd1,!![]);}catch(_0x46ecb2){return BPromise[_0x8b83('0x1d')](_0x46ecb2);}return _0x5ab525['save']();};}function saveUpdates(_0x3c20b1,_0x4041e2){return function(_0x4b66ec){if(_0x4b66ec){return _0x4b66ec['update'](_0x3c20b1)[_0x8b83('0x1e')](function(_0x495950){return _0x495950;});}return null;};}function removeEntity(_0x2a0658,_0x1c717d){return function(_0x1394e3){if(_0x1394e3){return _0x1394e3[_0x8b83('0x1f')]()['then'](function(){_0x2a0658[_0x8b83('0x16')](0xcc)[_0x8b83('0x15')]();});}};}function handleEntityNotFound(_0x4bbed5,_0x5bb7c8){return function(_0x20af02){if(!_0x20af02){_0x4bbed5[_0x8b83('0x20')](0x194);}return _0x20af02;};}function handleError(_0x15b2d6,_0x1e426c){_0x1e426c=_0x1e426c||0x1f4;return function(_0x4bbaba){logger[_0x8b83('0x21')](_0x4bbaba[_0x8b83('0x22')]);if(_0x4bbaba[_0x8b83('0x23')]){delete _0x4bbaba[_0x8b83('0x23')];}_0x15b2d6[_0x8b83('0x16')](_0x1e426c)[_0x8b83('0x24')](_0x4bbaba);};}exports[_0x8b83('0x25')]=function(_0xa5336,_0x262c6d){var _0x4a39cb={},_0x465a9e={},_0x3c5370={'count':0x0,'rows':[]};var _0x1dd489=_['map'](db[_0x8b83('0x26')][_0x8b83('0x27')],function(_0x4c38d7){return{'name':_0x4c38d7[_0x8b83('0x28')],'type':_0x4c38d7['type'][_0x8b83('0x29')]};});_0x465a9e[_0x8b83('0x2a')]=_[_0x8b83('0x2b')](_0x1dd489,'name');_0x465a9e[_0x8b83('0x2c')]=_['keys'](_0xa5336['query']);_0x465a9e[_0x8b83('0x2d')]=_['intersection'](_0x465a9e[_0x8b83('0x2a')],_0x465a9e[_0x8b83('0x2c')]);_0x4a39cb[_0x8b83('0x2e')]=_[_0x8b83('0x2f')](_0x465a9e[_0x8b83('0x2a')],qs[_0x8b83('0x30')](_0xa5336['query'][_0x8b83('0x30')]));_0x4a39cb[_0x8b83('0x2e')]=_0x4a39cb[_0x8b83('0x2e')][_0x8b83('0x31')]?_0x4a39cb[_0x8b83('0x2e')]:_0x465a9e[_0x8b83('0x2a')];if(!_0xa5336[_0x8b83('0x2c')][_0x8b83('0x32')](_0x8b83('0x33'))){_0x4a39cb['limit']=qs[_0x8b83('0x19')](_0xa5336[_0x8b83('0x2c')][_0x8b83('0x19')]);_0x4a39cb[_0x8b83('0x17')]=qs[_0x8b83('0x17')](_0xa5336[_0x8b83('0x2c')]['offset']);}_0x4a39cb['order']=qs[_0x8b83('0x34')](_0xa5336[_0x8b83('0x2c')][_0x8b83('0x34')]);_0x4a39cb[_0x8b83('0x35')]=qs['filters'](_[_0x8b83('0x36')](_0xa5336['query'],_0x465a9e['filters']),_0x1dd489);if(_0xa5336[_0x8b83('0x2c')][_0x8b83('0x37')]){_0x4a39cb[_0x8b83('0x35')]=_[_0x8b83('0x38')](_0x4a39cb[_0x8b83('0x35')],{'$or':_[_0x8b83('0x2b')](_0x1dd489,function(_0x4944d3){if(_0x4944d3['type']!==_0x8b83('0x39')){var _0x5e767b={};_0x5e767b[_0x4944d3[_0x8b83('0x23')]]={'$like':'%'+_0xa5336[_0x8b83('0x2c')][_0x8b83('0x37')]+'%'};return _0x5e767b;}})});}_0x4a39cb=_['merge']({},_0x4a39cb,_0xa5336[_0x8b83('0x3a')]);var _0x21df3f={'where':_0x4a39cb['where']};return db['MailTransferReport']['count'](_0x21df3f)['then'](function(_0x4b57d2){_0x3c5370['count']=_0x4b57d2;if(_0xa5336['query'][_0x8b83('0x3b')]){_0x4a39cb[_0x8b83('0x3c')]=[{'all':!![]}];}return db[_0x8b83('0x26')][_0x8b83('0x3d')](_0x4a39cb);})[_0x8b83('0x1e')](function(_0x1e618a){_0x3c5370[_0x8b83('0x3e')]=_0x1e618a;return _0x3c5370;})[_0x8b83('0x1e')](respondWithFilteredResult(_0x262c6d,_0x4a39cb))[_0x8b83('0x3f')](handleError(_0x262c6d,null));};exports[_0x8b83('0x40')]=function(_0x5c5a7e,_0x1cc8a3){var _0xd578f={'raw':!![],'where':{'id':_0x5c5a7e[_0x8b83('0x41')]['id']}},_0x290228={};_0x290228[_0x8b83('0x2a')]=_[_0x8b83('0x42')](db[_0x8b83('0x26')][_0x8b83('0x27')]);_0x290228[_0x8b83('0x2c')]=_['keys'](_0x5c5a7e[_0x8b83('0x2c')]);_0x290228[_0x8b83('0x2d')]=_[_0x8b83('0x2f')](_0x290228[_0x8b83('0x2a')],_0x290228[_0x8b83('0x2c')]);_0xd578f[_0x8b83('0x2e')]=_[_0x8b83('0x2f')](_0x290228['model'],qs['fields'](_0x5c5a7e[_0x8b83('0x2c')][_0x8b83('0x30')]));_0xd578f[_0x8b83('0x2e')]=_0xd578f['attributes'][_0x8b83('0x31')]?_0xd578f[_0x8b83('0x2e')]:_0x290228[_0x8b83('0x2a')];if(_0x5c5a7e[_0x8b83('0x2c')]['includeAll']){_0xd578f[_0x8b83('0x3c')]=[{'all':!![]}];}_0xd578f=_['merge']({},_0xd578f,_0x5c5a7e['options']);return db[_0x8b83('0x26')][_0x8b83('0x43')](_0xd578f)[_0x8b83('0x1e')](handleEntityNotFound(_0x1cc8a3,null))[_0x8b83('0x1e')](respondWithResult(_0x1cc8a3,null))[_0x8b83('0x3f')](handleError(_0x1cc8a3,null));};exports[_0x8b83('0x44')]=function(_0x49d4cd,_0xaad0d5){return db[_0x8b83('0x26')]['create'](_0x49d4cd[_0x8b83('0x45')],{})['then'](respondWithResult(_0xaad0d5,0xc9))[_0x8b83('0x3f')](handleError(_0xaad0d5,null));};exports['update']=function(_0x521fba,_0x366321){if(_0x521fba[_0x8b83('0x45')]['id']){delete _0x521fba[_0x8b83('0x45')]['id'];}return db['MailTransferReport'][_0x8b83('0x43')]({'where':{'id':_0x521fba[_0x8b83('0x41')]['id']}})[_0x8b83('0x1e')](handleEntityNotFound(_0x366321,null))[_0x8b83('0x1e')](saveUpdates(_0x521fba[_0x8b83('0x45')],null))['then'](respondWithResult(_0x366321,null))[_0x8b83('0x3f')](handleError(_0x366321,null));};exports[_0x8b83('0x1f')]=function(_0x3a4679,_0x378d06){return db['MailTransferReport'][_0x8b83('0x43')]({'where':{'id':_0x3a4679['params']['id']}})[_0x8b83('0x1e')](handleEntityNotFound(_0x378d06,null))[_0x8b83('0x1e')](removeEntity(_0x378d06,null))['catch'](handleError(_0x378d06,null));};exports[_0x8b83('0x46')]=function(_0x4b2b08,_0x156b54){return db[_0x8b83('0x26')]['describe']()[_0x8b83('0x1e')](respondWithResult(_0x156b54,null))['catch'](handleError(_0x156b54,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 6ca9351..800f271 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 _0x7cab=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x7cab,0x91));var _0xb7ca=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7cab[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xb7ca('0x0'));var util=require(_0xb7ca('0x1'));var logger=require(_0xb7ca('0x2'))('api');var moment=require(_0xb7ca('0x3'));var BPromise=require(_0xb7ca('0x4'));var rp=require(_0xb7ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7ca('0x6'));var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0xb7ca('0x7')]=function(_0x3f038a,_0x582824){return _0x3f038a[_0xb7ca('0x8')]('MailTransferReport',attributes,{'tableName':_0xb7ca('0x9'),'paranoid':![],'indexes':[{'name':_0xb7ca('0xa'),'fields':[_0xb7ca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7e6=['moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x136451,_0x4408c0){var _0x49d00b=function(_0x2ea229){while(--_0x2ea229){_0x136451['push'](_0x136451['shift']());}};_0x49d00b(++_0x4408c0);}(_0xa7e6,0x74));var _0x6a7e=function(_0x591248,_0x106775){_0x591248=_0x591248-0x0;var _0x2c0671=_0xa7e6[_0x591248];return _0x2c0671;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7e('0x6'));var rimraf=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var attributes=require(_0x6a7e('0x9'));module[_0x6a7e('0xa')]=function(_0x599006,_0x79df6f){return _0x599006[_0x6a7e('0xb')](_0x6a7e('0xc'),attributes,{'tableName':_0x6a7e('0xd'),'paranoid':![],'indexes':[{'name':_0x6a7e('0xe'),'fields':[_0x6a7e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c57e38e..efc3fcb 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 _0x4f52=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x4f52,0x1eb));var _0x24f5=function(_0x6bb2d5,_0x722686){_0x6bb2d5=_0x6bb2d5-0x0;var _0x3e3adc=_0x4f52[_0x6bb2d5];return _0x3e3adc;};'use strict';var _=require(_0x24f5('0x0'));var util=require('util');var moment=require(_0x24f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x24f5('0x2'));var fs=require('fs');var Redis=require(_0x24f5('0x3'));var db=require(_0x24f5('0x4'))['db'];var utils=require(_0x24f5('0x5'));var logger=require(_0x24f5('0x6'))(_0x24f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x24f5('0x8'));var client=jayson[_0x24f5('0x9')][_0x24f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a3a0f,_0x12f5e5,_0x337fb1){return new BPromise(function(_0x39b76c,_0x51f269){return client[_0x24f5('0xb')](_0x2a3a0f,_0x337fb1)['then'](function(_0x233612){logger[_0x24f5('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x12f5e5,_0x24f5('0xd'));logger[_0x24f5('0xe')](_0x24f5('0xf'),_0x12f5e5,_0x24f5('0xd'),JSON['stringify'](_0x233612));if(_0x233612[_0x24f5('0x10')]){if(_0x233612[_0x24f5('0x10')][_0x24f5('0x11')]===0x1f4){logger[_0x24f5('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x12f5e5,_0x233612[_0x24f5('0x10')][_0x24f5('0x12')]);return _0x51f269(_0x233612[_0x24f5('0x10')][_0x24f5('0x12')]);}logger[_0x24f5('0x10')](_0x24f5('0x13'),_0x12f5e5,_0x233612[_0x24f5('0x10')][_0x24f5('0x12')]);return _0x39b76c(_0x233612[_0x24f5('0x10')][_0x24f5('0x12')]);}else{logger[_0x24f5('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x12f5e5,'request\x20sent');_0x39b76c(_0x233612['result']['message']);}})[_0x24f5('0x14')](function(_0x31b8ff){logger[_0x24f5('0x10')](_0x24f5('0x13'),_0x12f5e5,_0x31b8ff);_0x51f269(_0x31b8ff);});});} \ No newline at end of file +var _0x68c0=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x2e16d4,_0x5a7a9a){var _0x30747e=function(_0x34aaa8){while(--_0x34aaa8){_0x2e16d4['push'](_0x2e16d4['shift']());}};_0x30747e(++_0x5a7a9a);}(_0x68c0,0x145));var _0x068c=function(_0x3303f3,_0x1b790c){_0x3303f3=_0x3303f3-0x0;var _0x5dac55=_0x68c0[_0x3303f3];return _0x5dac55;};'use strict';var _=require('lodash');var util=require(_0x068c('0x0'));var moment=require(_0x068c('0x1'));var BPromise=require(_0x068c('0x2'));var rs=require(_0x068c('0x3'));var fs=require('fs');var Redis=require(_0x068c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x068c('0x5'));var logger=require('../../config/logger')(_0x068c('0x6'));var config=require(_0x068c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x068c('0x8')][_0x068c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25ac15,_0x2407ea,_0x438748){return new BPromise(function(_0x2e1195,_0x11dfef){return client['request'](_0x25ac15,_0x438748)['then'](function(_0x2f45c1){logger[_0x068c('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2407ea,_0x068c('0xb'));logger['debug'](_0x068c('0xc'),_0x2407ea,_0x068c('0xb'),JSON['stringify'](_0x2f45c1));if(_0x2f45c1['error']){if(_0x2f45c1[_0x068c('0xd')][_0x068c('0xe')]===0x1f4){logger[_0x068c('0xd')](_0x068c('0xf'),_0x2407ea,_0x2f45c1[_0x068c('0xd')]['message']);return _0x11dfef(_0x2f45c1[_0x068c('0xd')][_0x068c('0x10')]);}logger[_0x068c('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x2407ea,_0x2f45c1[_0x068c('0xd')][_0x068c('0x10')]);return _0x2e1195(_0x2f45c1[_0x068c('0xd')][_0x068c('0x10')]);}else{logger['info'](_0x068c('0xf'),_0x2407ea,_0x068c('0xb'));_0x2e1195(_0x2f45c1['result'][_0x068c('0x10')]);}})[_0x068c('0x11')](function(_0x6db8fa){logger[_0x068c('0xd')](_0x068c('0xf'),_0x2407ea,_0x6db8fa);_0x11dfef(_0x6db8fa);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0651df9..4974211 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 _0x1ae2=['isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x52a617,_0x4cab65){var _0x3156a6=function(_0x3cafe3){while(--_0x3cafe3){_0x52a617['push'](_0x52a617['shift']());}};_0x3156a6(++_0x4cab65);}(_0x1ae2,0x107));var _0x21ae=function(_0x2836a0,_0x343246){_0x2836a0=_0x2836a0-0x0;var _0x53c107=_0x1ae2[_0x2836a0];return _0x53c107;};'use strict';var multer=require(_0x21ae('0x0'));var util=require(_0x21ae('0x1'));var path=require(_0x21ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x21ae('0x3'));var router=express['Router']();var fs_extra=require(_0x21ae('0x4'));var auth=require(_0x21ae('0x5'));var interaction=require(_0x21ae('0x6'));var config=require(_0x21ae('0x7'));var controller=require(_0x21ae('0x8'));router[_0x21ae('0x9')]('/',auth[_0x21ae('0xa')](),controller[_0x21ae('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x21ae('0xc')]);router[_0x21ae('0x9')](_0x21ae('0xd'),auth[_0x21ae('0xa')](),controller[_0x21ae('0xe')]);router[_0x21ae('0xf')]('/',auth[_0x21ae('0xa')](),controller[_0x21ae('0x10')]);router['put'](_0x21ae('0xd'),auth['isAuthenticated'](),controller[_0x21ae('0x11')]);router[_0x21ae('0x12')](_0x21ae('0xd'),auth[_0x21ae('0xa')](),controller[_0x21ae('0x13')]);module[_0x21ae('0x14')]=router; \ No newline at end of file +var _0x3e83=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e83,0x192));var _0x33e8=function(_0x374a3,_0x451296){_0x374a3=_0x374a3-0x0;var _0x38f7ad=_0x3e83[_0x374a3];return _0x38f7ad;};'use strict';var multer=require(_0x33e8('0x0'));var util=require(_0x33e8('0x1'));var path=require(_0x33e8('0x2'));var timeout=require(_0x33e8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x33e8('0x4'));var auth=require(_0x33e8('0x5'));var interaction=require(_0x33e8('0x6'));var config=require(_0x33e8('0x7'));var controller=require(_0x33e8('0x8'));router[_0x33e8('0x9')]('/',auth[_0x33e8('0xa')](),controller[_0x33e8('0xb')]);router[_0x33e8('0x9')]('/describe',auth[_0x33e8('0xa')](),controller[_0x33e8('0xc')]);router[_0x33e8('0x9')](_0x33e8('0xd'),auth[_0x33e8('0xa')](),controller['show']);router['post']('/',auth[_0x33e8('0xa')](),controller[_0x33e8('0xe')]);router[_0x33e8('0xf')]('/:id',auth[_0x33e8('0xa')](),controller[_0x33e8('0x10')]);router[_0x33e8('0x11')](_0x33e8('0xd'),auth['isAuthenticated'](),controller[_0x33e8('0x12')]);module[_0x33e8('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 ee018fa..cc1da7b 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 _0x6580=['INTEGER','DATE','enterAt','diff','exitAt','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x3960b4,_0x3505a5){var _0x1e5be4=function(_0x126a03){while(--_0x126a03){_0x3960b4['push'](_0x3960b4['shift']());}};_0x1e5be4(++_0x3505a5);}(_0x6580,0xc1));var _0x0658=function(_0x4af710,_0x525994){_0x4af710=_0x4af710-0x0;var _0x4b4e39=_0x6580[_0x4af710];return _0x4b4e39;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0658('0x0')]={'channel':{'type':Sequelize[_0x0658('0x1')]},'membername':{'type':Sequelize[_0x0658('0x1')]},'interface':{'type':Sequelize[_0x0658('0x1')]},'type':{'type':Sequelize[_0x0658('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x0658('0x2')},'duration':{'type':Sequelize[_0x0658('0x3')]},'enterAt':{'type':Sequelize[_0x0658('0x4')]},'exitAt':{'type':Sequelize[_0x0658('0x4')],'set':function(_0x309c04){var _0x426a31=moment(_0x309c04);var _0xef29=moment(this['getDataValue'](_0x0658('0x5')));var _0x169b6e=_0x426a31[_0x0658('0x6')](_0xef29,'seconds');this['setDataValue'](_0x0658('0x7'),_0x309c04);this[_0x0658('0x8')](_0x0658('0x9'),_0x169b6e>=0x0?_0x169b6e:null);}},'data1':{'type':Sequelize[_0x0658('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0658('0x1')],'comment':_0x0658('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x0658('0xb')},'data4':{'type':Sequelize[_0x0658('0x1')],'comment':_0x0658('0xc')},'data5':{'type':Sequelize[_0x0658('0x1')],'comment':_0x0658('0xd')},'role':{'type':Sequelize[_0x0658('0x1')]},'internal':{'type':Sequelize[_0x0658('0x3')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x31f7=['talk:[destination]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]'];(function(_0x12a008,_0x30fe0e){var _0x5e7308=function(_0x3c5a65){while(--_0x3c5a65){_0x12a008['push'](_0x12a008['shift']());}};_0x5e7308(++_0x30fe0e);}(_0x31f7,0x68));var _0x731f=function(_0x2dfaac,_0x2c9b82){_0x2dfaac=_0x2dfaac-0x0;var _0x1c7ecc=_0x31f7[_0x2dfaac];return _0x1c7ecc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x731f('0x0'));module[_0x731f('0x1')]={'channel':{'type':Sequelize[_0x731f('0x2')]},'membername':{'type':Sequelize[_0x731f('0x2')]},'interface':{'type':Sequelize[_0x731f('0x2')]},'type':{'type':Sequelize[_0x731f('0x2')],'defaultValue':_0x731f('0x3'),'comment':_0x731f('0x4')},'duration':{'type':Sequelize[_0x731f('0x5')]},'enterAt':{'type':Sequelize[_0x731f('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x15ba56){var _0x60fdbc=moment(_0x15ba56);var _0x5cb24b=moment(this[_0x731f('0x7')](_0x731f('0x8')));var _0x4eccd9=_0x60fdbc[_0x731f('0x9')](_0x5cb24b,_0x731f('0xa'));this[_0x731f('0xb')](_0x731f('0xc'),_0x15ba56);this[_0x731f('0xb')](_0x731f('0xd'),_0x4eccd9>=0x0?_0x4eccd9:null);}},'data1':{'type':Sequelize[_0x731f('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x731f('0xe')},'data3':{'type':Sequelize[_0x731f('0x2')],'comment':_0x731f('0xf')},'data4':{'type':Sequelize[_0x731f('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x731f('0x2')],'comment':_0x731f('0x10')},'role':{'type':Sequelize[_0x731f('0x2')]},'internal':{'type':Sequelize[_0x731f('0x5')]},'uniqueid':{'type':Sequelize[_0x731f('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 71e47d3..b3c747c 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x55ca,0x126));var _0xa55c=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0x55ca[_0x1e2671];return _0x492489;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x373059,_0x17b09c){var _0x368f67=function(_0xccc46c){while(--_0xccc46c){_0x373059['push'](_0x373059['shift']());}};_0x368f67(++_0x17b09c);}(_0x008c,0x188));var _0xc008=function(_0x5ee2db,_0x47ea25){_0x5ee2db=_0x5ee2db-0x0;var _0x2cab07=_0x008c[_0x5ee2db];return _0x2cab07;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 70dbb11..213a1b0 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 _0x4ee5=['membername','interface','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4ee5,0xd4));var _0x54ee=function(_0x261089,_0x399d96){_0x261089=_0x261089-0x0;var _0x136e06=_0x4ee5[_0x261089];return _0x136e06;};'use strict';var _=require(_0x54ee('0x0'));var util=require('util');var logger=require(_0x54ee('0x1'))(_0x54ee('0x2'));var moment=require('moment');var BPromise=require(_0x54ee('0x3'));var rp=require(_0x54ee('0x4'));var fs=require('fs');var path=require(_0x54ee('0x5'));var rimraf=require(_0x54ee('0x6'));var config=require(_0x54ee('0x7'));var attributes=require(_0x54ee('0x8'));module[_0x54ee('0x9')]=function(_0x3e0c4f,_0x38fb0d){return _0x3e0c4f['define'](_0x54ee('0xa'),attributes,{'tableName':_0x54ee('0xb'),'paranoid':![],'indexes':[{'name':_0x54ee('0xc'),'fields':[_0x54ee('0xd'),_0x54ee('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca6=['../../config/environment','./memberReport.attributes','define','report_member','interface','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x4ca6,0x1a9));var _0x64ca=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x4ca6[_0x2d486b];return _0x4291d1;};'use strict';var _=require(_0x64ca('0x0'));var util=require(_0x64ca('0x1'));var logger=require(_0x64ca('0x2'))(_0x64ca('0x3'));var moment=require(_0x64ca('0x4'));var BPromise=require(_0x64ca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64ca('0x6'));var rimraf=require('rimraf');var config=require(_0x64ca('0x7'));var attributes=require(_0x64ca('0x8'));module['exports']=function(_0x175912,_0x5a4c8e){return _0x175912[_0x64ca('0x9')]('MemberReport',attributes,{'tableName':_0x64ca('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x64ca('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index edae672..c9090e9 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 _0x8375=['where','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','GetMemberReport','MemberReport','options','raw','attributes','limit','include','map','model','debug','stringify','catch','CreateMemberReport','create','body','update'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x8375,0x132));var _0x5837=function(_0xec2f66,_0x7ea381){_0xec2f66=_0xec2f66-0x0;var _0x5b41bb=_0x8375[_0xec2f66];return _0x5b41bb;};'use strict';var _=require('lodash');var util=require(_0x5837('0x0'));var moment=require(_0x5837('0x1'));var BPromise=require(_0x5837('0x2'));var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5837('0x6'))(_0x5837('0x7'));var config=require('../../config/environment');var jayson=require(_0x5837('0x8'));var client=jayson[_0x5837('0x9')][_0x5837('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d00,_0x5e980d,_0x23454c){return new BPromise(function(_0x1f4f78,_0x89657e){return client[_0x5837('0xb')](_0x1e0d00,_0x23454c)[_0x5837('0xc')](function(_0x32e545){logger[_0x5837('0xd')](_0x5837('0xe'),_0x5e980d,_0x5837('0xf'));logger['debug'](_0x5837('0x10'),_0x5e980d,_0x5837('0xf'),JSON['stringify'](_0x32e545));if(_0x32e545[_0x5837('0x11')]){if(_0x32e545[_0x5837('0x11')]['code']===0x1f4){logger[_0x5837('0x11')]('MemberReport,\x20%s,\x20%s',_0x5e980d,_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);return _0x89657e(_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);}logger['error'](_0x5837('0xe'),_0x5e980d,_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);return _0x1f4f78(_0x32e545['error'][_0x5837('0x12')]);}else{logger[_0x5837('0xd')](_0x5837('0xe'),_0x5e980d,_0x5837('0xf'));_0x1f4f78(_0x32e545[_0x5837('0x13')][_0x5837('0x12')]);}})['catch'](function(_0x555ebb){logger['error'](_0x5837('0xe'),_0x5e980d,_0x555ebb);_0x89657e(_0x555ebb);});});}exports[_0x5837('0x14')]=function(_0x1a5725){var _0x423a9f=this;return new Promise(function(_0x128b4a,_0x602f19){return db[_0x5837('0x15')]['findAll']({'raw':_0x1a5725[_0x5837('0x16')]?_0x1a5725[_0x5837('0x16')][_0x5837('0x17')]===undefined?!![]:![]:!![],'where':_0x1a5725[_0x5837('0x16')]?_0x1a5725[_0x5837('0x16')]['where']||null:null,'attributes':_0x1a5725['options']?_0x1a5725[_0x5837('0x16')][_0x5837('0x18')]||null:null,'limit':_0x1a5725[_0x5837('0x16')]?_0x1a5725['options'][_0x5837('0x19')]||null:null,'include':_0x1a5725[_0x5837('0x16')]?_0x1a5725['options'][_0x5837('0x1a')]?_[_0x5837('0x1b')](_0x1a5725['options'][_0x5837('0x1a')],function(_0x2709cf){return{'model':db[_0x2709cf[_0x5837('0x1c')]],'as':_0x2709cf['as'],'attributes':_0x2709cf['attributes'],'include':_0x2709cf[_0x5837('0x1a')]?_['map'](_0x2709cf[_0x5837('0x1a')],function(_0x8e5a48){return{'model':db[_0x8e5a48[_0x5837('0x1c')]],'as':_0x8e5a48['as'],'attributes':_0x8e5a48[_0x5837('0x18')],'include':_0x8e5a48[_0x5837('0x1a')]?_[_0x5837('0x1b')](_0x8e5a48[_0x5837('0x1a')],function(_0x1d7285){return{'model':db[_0x1d7285[_0x5837('0x1c')]],'as':_0x1d7285['as'],'attributes':_0x1d7285[_0x5837('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5837('0xc')](function(_0x27848d){logger[_0x5837('0xd')](_0x5837('0x14'),_0x1a5725);logger[_0x5837('0x1d')]('GetMemberReport',_0x1a5725,JSON[_0x5837('0x1e')](_0x27848d));_0x128b4a(_0x27848d);})[_0x5837('0x1f')](function(_0x170cb2){logger[_0x5837('0x11')](_0x5837('0x14'),_0x170cb2[_0x5837('0x12')],_0x1a5725);_0x602f19(_0x423a9f[_0x5837('0x11')](0x1f4,_0x170cb2['message']));});});};exports[_0x5837('0x20')]=function(_0x290e14){var _0x3a3a34=this;return new Promise(function(_0x285186,_0x55b71b){return db['MemberReport'][_0x5837('0x21')](_0x290e14[_0x5837('0x22')],{'raw':_0x290e14[_0x5837('0x16')]?_0x290e14['options'][_0x5837('0x17')]===undefined?!![]:![]:!![]})[_0x5837('0xc')](function(_0x33b918){logger[_0x5837('0xd')](_0x5837('0x20'),_0x290e14);logger[_0x5837('0x1d')]('CreateMemberReport',_0x290e14,JSON[_0x5837('0x1e')](_0x33b918));_0x285186(_0x33b918);})[_0x5837('0x1f')](function(_0x4881e5){logger[_0x5837('0x11')](_0x5837('0x20'),_0x4881e5[_0x5837('0x12')],_0x290e14);_0x55b71b(_0x3a3a34['error'](0x1f4,_0x4881e5['message']));});});};exports['UpdateMemberReport']=function(_0x550fd0){var _0xab3ad2=this;return new Promise(function(_0x57322c,_0x4bc062){return db[_0x5837('0x15')][_0x5837('0x23')](_0x550fd0['body'],{'raw':_0x550fd0[_0x5837('0x16')]?_0x550fd0['options'][_0x5837('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x550fd0[_0x5837('0x16')]?_0x550fd0['options'][_0x5837('0x24')]||null:null,'attributes':_0x550fd0[_0x5837('0x16')]?_0x550fd0['options'][_0x5837('0x18')]||null:null,'limit':_0x550fd0['options']?_0x550fd0[_0x5837('0x16')]['limit']||null:null})['then'](function(_0x30d48e){logger[_0x5837('0xd')](_0x5837('0x25'),_0x550fd0);logger[_0x5837('0x1d')](_0x5837('0x25'),_0x550fd0,JSON['stringify'](_0x30d48e));_0x57322c(_0x30d48e);})[_0x5837('0x1f')](function(_0x4f65be){logger['error'](_0x5837('0x25'),_0x4f65be[_0x5837('0x12')],_0x550fd0);_0x4bc062(_0xab3ad2['error'](0x1f4,_0x4f65be[_0x5837('0x12')]));});});}; \ No newline at end of file +var _0x12e9=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','MemberReport','options','raw','where','attributes','include','model','map','then','info','GetMemberReport','stringify','create','body','CreateMemberReport','UpdateMemberReport','update','moment','randomstring','ioredis'];(function(_0x11c2a5,_0x525498){var _0x2c7cac=function(_0x131caa){while(--_0x131caa){_0x11c2a5['push'](_0x11c2a5['shift']());}};_0x2c7cac(++_0x525498);}(_0x12e9,0x66));var _0x912e=function(_0x11a0e1,_0x54b103){_0x11a0e1=_0x11a0e1-0x0;var _0x4ad82c=_0x12e9[_0x11a0e1];return _0x4ad82c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x912e('0x0'));var BPromise=require('bluebird');var rs=require(_0x912e('0x1'));var fs=require('fs');var Redis=require(_0x912e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x912e('0x3'));var logger=require(_0x912e('0x4'))('rpc');var config=require(_0x912e('0x5'));var jayson=require(_0x912e('0x6'));var client=jayson[_0x912e('0x7')][_0x912e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f4dbb,_0x2e950a,_0x2ccba9){return new BPromise(function(_0x2a8fc3,_0x7ac782){return client[_0x912e('0x9')](_0x4f4dbb,_0x2ccba9)['then'](function(_0x4beb4d){logger['info'](_0x912e('0xa'),_0x2e950a,_0x912e('0xb'));logger[_0x912e('0xc')](_0x912e('0xd'),_0x2e950a,_0x912e('0xb'),JSON['stringify'](_0x4beb4d));if(_0x4beb4d[_0x912e('0xe')]){if(_0x4beb4d[_0x912e('0xe')][_0x912e('0xf')]===0x1f4){logger[_0x912e('0xe')](_0x912e('0xa'),_0x2e950a,_0x4beb4d[_0x912e('0xe')][_0x912e('0x10')]);return _0x7ac782(_0x4beb4d[_0x912e('0xe')][_0x912e('0x10')]);}logger[_0x912e('0xe')](_0x912e('0xa'),_0x2e950a,_0x4beb4d[_0x912e('0xe')]['message']);return _0x2a8fc3(_0x4beb4d[_0x912e('0xe')]['message']);}else{logger['info'](_0x912e('0xa'),_0x2e950a,_0x912e('0xb'));_0x2a8fc3(_0x4beb4d[_0x912e('0x11')]['message']);}})['catch'](function(_0x174227){logger[_0x912e('0xe')](_0x912e('0xa'),_0x2e950a,_0x174227);_0x7ac782(_0x174227);});});}exports['GetMemberReport']=function(_0x36fb67){var _0x100790=this;return new Promise(function(_0x3286bb,_0x1d3345){return db[_0x912e('0x12')]['findAll']({'raw':_0x36fb67[_0x912e('0x13')]?_0x36fb67[_0x912e('0x13')][_0x912e('0x14')]===undefined?!![]:![]:!![],'where':_0x36fb67[_0x912e('0x13')]?_0x36fb67[_0x912e('0x13')][_0x912e('0x15')]||null:null,'attributes':_0x36fb67[_0x912e('0x13')]?_0x36fb67[_0x912e('0x13')][_0x912e('0x16')]||null:null,'limit':_0x36fb67[_0x912e('0x13')]?_0x36fb67[_0x912e('0x13')]['limit']||null:null,'include':_0x36fb67[_0x912e('0x13')]?_0x36fb67['options'][_0x912e('0x17')]?_['map'](_0x36fb67[_0x912e('0x13')][_0x912e('0x17')],function(_0x59feaa){return{'model':db[_0x59feaa[_0x912e('0x18')]],'as':_0x59feaa['as'],'attributes':_0x59feaa[_0x912e('0x16')],'include':_0x59feaa[_0x912e('0x17')]?_[_0x912e('0x19')](_0x59feaa[_0x912e('0x17')],function(_0x5ba003){return{'model':db[_0x5ba003[_0x912e('0x18')]],'as':_0x5ba003['as'],'attributes':_0x5ba003[_0x912e('0x16')],'include':_0x5ba003[_0x912e('0x17')]?_['map'](_0x5ba003[_0x912e('0x17')],function(_0x52c388){return{'model':db[_0x52c388[_0x912e('0x18')]],'as':_0x52c388['as'],'attributes':_0x52c388[_0x912e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x912e('0x1a')](function(_0x3c6a2a){logger[_0x912e('0x1b')]('GetMemberReport',_0x36fb67);logger[_0x912e('0xc')](_0x912e('0x1c'),_0x36fb67,JSON[_0x912e('0x1d')](_0x3c6a2a));_0x3286bb(_0x3c6a2a);})['catch'](function(_0x357668){logger['error']('GetMemberReport',_0x357668['message'],_0x36fb67);_0x1d3345(_0x100790[_0x912e('0xe')](0x1f4,_0x357668['message']));});});};exports['CreateMemberReport']=function(_0x58d575){var _0x3f61a2=this;return new Promise(function(_0x106e86,_0x3c4cac){return db[_0x912e('0x12')][_0x912e('0x1e')](_0x58d575[_0x912e('0x1f')],{'raw':_0x58d575[_0x912e('0x13')]?_0x58d575[_0x912e('0x13')][_0x912e('0x14')]===undefined?!![]:![]:!![]})[_0x912e('0x1a')](function(_0x2faa5d){logger[_0x912e('0x1b')](_0x912e('0x20'),_0x58d575);logger['debug']('CreateMemberReport',_0x58d575,JSON[_0x912e('0x1d')](_0x2faa5d));_0x106e86(_0x2faa5d);})['catch'](function(_0xe5f115){logger[_0x912e('0xe')](_0x912e('0x20'),_0xe5f115[_0x912e('0x10')],_0x58d575);_0x3c4cac(_0x3f61a2[_0x912e('0xe')](0x1f4,_0xe5f115[_0x912e('0x10')]));});});};exports[_0x912e('0x21')]=function(_0x2405e1){var _0x7314f1=this;return new Promise(function(_0x1aa316,_0x5dd9e9){return db[_0x912e('0x12')][_0x912e('0x22')](_0x2405e1[_0x912e('0x1f')],{'raw':_0x2405e1[_0x912e('0x13')]?_0x2405e1[_0x912e('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2405e1[_0x912e('0x13')]?_0x2405e1['options'][_0x912e('0x15')]||null:null,'attributes':_0x2405e1[_0x912e('0x13')]?_0x2405e1[_0x912e('0x13')]['attributes']||null:null,'limit':_0x2405e1[_0x912e('0x13')]?_0x2405e1[_0x912e('0x13')]['limit']||null:null})[_0x912e('0x1a')](function(_0x3e3418){logger['info'](_0x912e('0x21'),_0x2405e1);logger[_0x912e('0xc')](_0x912e('0x21'),_0x2405e1,JSON[_0x912e('0x1d')](_0x3e3418));_0x1aa316(_0x3e3418);})['catch'](function(_0x243ee9){logger['error']('UpdateMemberReport',_0x243ee9[_0x912e('0x10')],_0x2405e1);_0x5dd9e9(_0x7314f1[_0x912e('0xe')](0x1f4,_0x243ee9[_0x912e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index addd89e..42e00dc 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 _0x1ac8=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer','util','path'];(function(_0x1fb488,_0x398bac){var _0x23875a=function(_0x584708){while(--_0x584708){_0x1fb488['push'](_0x1fb488['shift']());}};_0x23875a(++_0x398bac);}(_0x1ac8,0xed));var _0x81ac=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1ac8[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x81ac('0x0'));var util=require(_0x81ac('0x1'));var path=require(_0x81ac('0x2'));var timeout=require(_0x81ac('0x3'));var express=require(_0x81ac('0x4'));var router=express['Router']();var fs_extra=require(_0x81ac('0x5'));var auth=require(_0x81ac('0x6'));var interaction=require(_0x81ac('0x7'));var config=require(_0x81ac('0x8'));var controller=require(_0x81ac('0x9'));router[_0x81ac('0xa')]('/',controller[_0x81ac('0xb')]);module['exports']=router; \ No newline at end of file +var _0xcfab=['multer','path','express','fs-extra','../../config/environment','./migration.controller','get','exports'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0xcfab,0x1e0));var _0xbcfa=function(_0x56a024,_0x48cfc1){_0x56a024=_0x56a024-0x0;var _0xf8bd5f=_0xcfab[_0x56a024];return _0xf8bd5f;};'use strict';var multer=require(_0xbcfa('0x0'));var util=require('util');var path=require(_0xbcfa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcfa('0x2'));var router=express['Router']();var fs_extra=require(_0xbcfa('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbcfa('0x4'));var controller=require(_0xbcfa('0x5'));router[_0xbcfa('0x6')]('/',controller['index']);module[_0xbcfa('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index d2d9b67..a5f4ac0 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 _0x1c42=['STRING','version','sequelize'];(function(_0x465ba2,_0x19e944){var _0x48148b=function(_0x2bd339){while(--_0x2bd339){_0x465ba2['push'](_0x465ba2['shift']());}};_0x48148b(++_0x19e944);}(_0x1c42,0x1f1));var _0x21c4=function(_0xc5be49,_0x57d928){_0xc5be49=_0xc5be49-0x0;var _0x4b5e3b=_0x1c42[_0xc5be49];return _0x4b5e3b;};'use strict';var Sequelize=require(_0x21c4('0x0'));module['exports']={'version':{'type':Sequelize[_0x21c4('0x1')],'unique':_0x21c4('0x2')}}; \ No newline at end of file +var _0x6a06=['exports','version','sequelize'];(function(_0x448959,_0x2a49ed){var _0x1ae38b=function(_0x142479){while(--_0x142479){_0x448959['push'](_0x448959['shift']());}};_0x1ae38b(++_0x2a49ed);}(_0x6a06,0x143));var _0x66a0=function(_0x5ac81b,_0x5b2f34){_0x5ac81b=_0x5ac81b-0x0;var _0x286915=_0x6a06[_0x5ac81b];return _0x286915;};'use strict';var Sequelize=require(_0x66a0('0x0'));module[_0x66a0('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x66a0('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index c80fdb3..5f546b5 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 _0x757b=['end','sendStatus','error','name','send','index','map','Migration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x20310e,_0x5f36a5){var _0x482a4f=function(_0x2cf62d){while(--_0x2cf62d){_0x20310e['push'](_0x20310e['shift']());}};_0x482a4f(++_0x5f36a5);}(_0x757b,0xa7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb757('0x0'));var rimraf=require(_0xb757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb757('0x2'));var rp=require('request-promise');var moment=require(_0xb757('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb757('0x4'));var util=require(_0xb757('0x5'));var path=require(_0xb757('0x6'));var sox=require(_0xb757('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb757('0x8'));var squel=require(_0xb757('0x9'));var crypto=require(_0xb757('0xa'));var jsforce=require(_0xb757('0xb'));var deskjs=require(_0xb757('0xc'));var toCsv=require(_0xb757('0xd'));var querystring=require(_0xb757('0xe'));var Papa=require(_0xb757('0xf'));var Redis=require(_0xb757('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb757('0x11'));var as=require(_0xb757('0x12'));var hardwareService=require(_0xb757('0x13'));var logger=require(_0xb757('0x14'))('api');var utils=require(_0xb757('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb757('0x16'));var db=require(_0xb757('0x17'))['db'];function respondWithStatusCode(_0x32b23a,_0x4c9b20){_0x4c9b20=_0x4c9b20||0xcc;return function(_0x1443fc){if(_0x1443fc){return _0x32b23a['sendStatus'](_0x4c9b20);}return _0x32b23a[_0xb757('0x18')](_0x4c9b20)['end']();};}function respondWithResult(_0x5b42ad,_0x175c43){_0x175c43=_0x175c43||0xc8;return function(_0x415265){if(_0x415265){return _0x5b42ad['status'](_0x175c43)[_0xb757('0x19')](_0x415265);}};}function respondWithFilteredResult(_0x3c3816,_0x66bb63){return function(_0x23de24){if(_0x23de24){var _0x454784=typeof _0x66bb63[_0xb757('0x1a')]===_0xb757('0x1b')&&typeof _0x66bb63[_0xb757('0x1c')]===_0xb757('0x1b');var _0x2a9e8a=_0x23de24[_0xb757('0x1d')];var _0x162169=_0x454784?0x0:_0x66bb63['offset'];var _0x3e716c=_0x454784?_0x23de24[_0xb757('0x1d')]:_0x66bb63[_0xb757('0x1a')]+_0x66bb63['limit'];var _0x149b41;if(_0x3e716c>=_0x2a9e8a){_0x3e716c=_0x2a9e8a;_0x149b41=0xc8;}else{_0x149b41=0xce;}_0x3c3816[_0xb757('0x18')](_0x149b41);return _0x3c3816[_0xb757('0x1e')](_0xb757('0x1f'),_0x162169+'-'+_0x3e716c+'/'+_0x2a9e8a)['json'](_0x23de24);}return null;};}function patchUpdates(_0x1fe812){return function(_0x5331e1){try{jsonpatch[_0xb757('0x20')](_0x5331e1,_0x1fe812,!![]);}catch(_0x3d4ee6){return BPromise[_0xb757('0x21')](_0x3d4ee6);}return _0x5331e1['save']();};}function saveUpdates(_0x5cf1b7,_0x12b777){return function(_0x34660c){if(_0x34660c){return _0x34660c[_0xb757('0x22')](_0x5cf1b7)[_0xb757('0x23')](function(_0x456c7c){return _0x456c7c;});}return null;};}function removeEntity(_0x33fb8b,_0x55c6e9){return function(_0x1a1679){if(_0x1a1679){return _0x1a1679[_0xb757('0x24')]()[_0xb757('0x23')](function(){_0x33fb8b[_0xb757('0x18')](0xcc)[_0xb757('0x25')]();});}};}function handleEntityNotFound(_0x27cf2d,_0x4ecd24){return function(_0x5a7baf){if(!_0x5a7baf){_0x27cf2d[_0xb757('0x26')](0x194);}return _0x5a7baf;};}function handleError(_0x1d0368,_0x1e6f0f){_0x1e6f0f=_0x1e6f0f||0x1f4;return function(_0x2949d0){logger[_0xb757('0x27')](_0x2949d0['stack']);if(_0x2949d0['name']){delete _0x2949d0[_0xb757('0x28')];}_0x1d0368[_0xb757('0x18')](_0x1e6f0f)[_0xb757('0x29')](_0x2949d0);};}exports[_0xb757('0x2a')]=function(_0xa97b6b,_0xddc24c){var _0x574b19={},_0x11b84c={},_0x1240bc={'count':0x0,'rows':[]};var _0x817e96=_[_0xb757('0x2b')](db[_0xb757('0x2c')][_0xb757('0x2d')],function(_0x3792a1){return{'name':_0x3792a1[_0xb757('0x2e')],'type':_0x3792a1['type']['key']};});_0x11b84c[_0xb757('0x2f')]=_[_0xb757('0x2b')](_0x817e96,_0xb757('0x28'));_0x11b84c[_0xb757('0x30')]=_[_0xb757('0x31')](_0xa97b6b[_0xb757('0x30')]);_0x11b84c[_0xb757('0x32')]=_[_0xb757('0x33')](_0x11b84c['model'],_0x11b84c[_0xb757('0x30')]);_0x574b19['attributes']=_['intersection'](_0x11b84c[_0xb757('0x2f')],qs['fields'](_0xa97b6b['query']['fields']));_0x574b19[_0xb757('0x34')]=_0x574b19[_0xb757('0x34')][_0xb757('0x35')]?_0x574b19['attributes']:_0x11b84c[_0xb757('0x2f')];if(!_0xa97b6b[_0xb757('0x30')][_0xb757('0x36')](_0xb757('0x37'))){_0x574b19[_0xb757('0x1c')]=qs[_0xb757('0x1c')](_0xa97b6b['query'][_0xb757('0x1c')]);_0x574b19[_0xb757('0x1a')]=qs['offset'](_0xa97b6b[_0xb757('0x30')][_0xb757('0x1a')]);}_0x574b19[_0xb757('0x38')]=qs['sort'](_0xa97b6b[_0xb757('0x30')]['sort']);_0x574b19['where']=qs[_0xb757('0x32')](_[_0xb757('0x39')](_0xa97b6b['query'],_0x11b84c[_0xb757('0x32')]),_0x817e96);if(_0xa97b6b[_0xb757('0x30')][_0xb757('0x3a')]){_0x574b19[_0xb757('0x3b')]=_[_0xb757('0x3c')](_0x574b19['where'],{'$or':_['map'](_0x817e96,function(_0x3c08d7){if(_0x3c08d7[_0xb757('0x3d')]!==_0xb757('0x3e')){var _0x5e48d7={};_0x5e48d7[_0x3c08d7[_0xb757('0x28')]]={'$like':'%'+_0xa97b6b['query'][_0xb757('0x3a')]+'%'};return _0x5e48d7;}})});}_0x574b19=_[_0xb757('0x3c')]({},_0x574b19,_0xa97b6b[_0xb757('0x3f')]);var _0x4f1adb={'where':_0x574b19['where']};return db['Migration'][_0xb757('0x1d')](_0x4f1adb)[_0xb757('0x23')](function(_0x1854e7){_0x1240bc[_0xb757('0x1d')]=_0x1854e7;if(_0xa97b6b[_0xb757('0x30')][_0xb757('0x40')]){_0x574b19[_0xb757('0x41')]=[{'all':!![]}];}return db['Migration'][_0xb757('0x42')](_0x574b19);})['then'](function(_0x2b240d){_0x1240bc[_0xb757('0x43')]=_0x2b240d;return _0x1240bc;})[_0xb757('0x23')](respondWithFilteredResult(_0xddc24c,_0x574b19))['catch'](handleError(_0xddc24c,null));}; \ No newline at end of file +var _0xd90d=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','destroy','end','error','name','send','index','map','Migration','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','options','include','findAll','then','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd90d,0x141));var _0xdd90=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd90d[_0x494d1f];return _0x457b6e;};'use strict';var emlformat=require(_0xdd90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd90('0x1'));var jsonpatch=require(_0xdd90('0x2'));var rp=require(_0xdd90('0x3'));var moment=require('moment');var BPromise=require(_0xdd90('0x4'));var Mustache=require(_0xdd90('0x5'));var util=require(_0xdd90('0x6'));var path=require(_0xdd90('0x7'));var sox=require(_0xdd90('0x8'));var csv=require(_0xdd90('0x9'));var ejs=require(_0xdd90('0xa'));var fs=require('fs');var fs_extra=require(_0xdd90('0xb'));var _=require(_0xdd90('0xc'));var squel=require(_0xdd90('0xd'));var crypto=require(_0xdd90('0xe'));var jsforce=require(_0xdd90('0xf'));var deskjs=require(_0xdd90('0x10'));var toCsv=require(_0xdd90('0x9'));var querystring=require(_0xdd90('0x11'));var Papa=require('papaparse');var Redis=require(_0xdd90('0x12'));var authService=require(_0xdd90('0x13'));var qs=require(_0xdd90('0x14'));var as=require(_0xdd90('0x15'));var hardwareService=require(_0xdd90('0x16'));var logger=require(_0xdd90('0x17'))(_0xdd90('0x18'));var utils=require(_0xdd90('0x19'));var config=require(_0xdd90('0x1a'));var licenseUtil=require(_0xdd90('0x1b'));var db=require(_0xdd90('0x1c'))['db'];function respondWithStatusCode(_0x57b3a2,_0x83a290){_0x83a290=_0x83a290||0xcc;return function(_0x481627){if(_0x481627){return _0x57b3a2[_0xdd90('0x1d')](_0x83a290);}return _0x57b3a2[_0xdd90('0x1e')](_0x83a290)['end']();};}function respondWithResult(_0x2dfb20,_0x45b19d){_0x45b19d=_0x45b19d||0xc8;return function(_0x47c354){if(_0x47c354){return _0x2dfb20[_0xdd90('0x1e')](_0x45b19d)[_0xdd90('0x1f')](_0x47c354);}};}function respondWithFilteredResult(_0x2e9abe,_0x5a189b){return function(_0x39f5e2){if(_0x39f5e2){var _0x12f4d7=typeof _0x5a189b[_0xdd90('0x20')]===_0xdd90('0x21')&&typeof _0x5a189b[_0xdd90('0x22')]===_0xdd90('0x21');var _0x1d2db6=_0x39f5e2[_0xdd90('0x23')];var _0x139508=_0x12f4d7?0x0:_0x5a189b[_0xdd90('0x20')];var _0x1cb241=_0x12f4d7?_0x39f5e2[_0xdd90('0x23')]:_0x5a189b['offset']+_0x5a189b[_0xdd90('0x22')];var _0x2cc61b;if(_0x1cb241>=_0x1d2db6){_0x1cb241=_0x1d2db6;_0x2cc61b=0xc8;}else{_0x2cc61b=0xce;}_0x2e9abe[_0xdd90('0x1e')](_0x2cc61b);return _0x2e9abe[_0xdd90('0x24')]('Content-Range',_0x139508+'-'+_0x1cb241+'/'+_0x1d2db6)[_0xdd90('0x1f')](_0x39f5e2);}return null;};}function patchUpdates(_0x3a3fda){return function(_0x3612c6){try{jsonpatch[_0xdd90('0x25')](_0x3612c6,_0x3a3fda,!![]);}catch(_0x579034){return BPromise['reject'](_0x579034);}return _0x3612c6['save']();};}function saveUpdates(_0x4b99ca,_0x1091eb){return function(_0x5bce3a){if(_0x5bce3a){return _0x5bce3a[_0xdd90('0x26')](_0x4b99ca)['then'](function(_0x5e4748){return _0x5e4748;});}return null;};}function removeEntity(_0x5cdadb,_0x583c66){return function(_0xdd8dc4){if(_0xdd8dc4){return _0xdd8dc4[_0xdd90('0x27')]()['then'](function(){_0x5cdadb[_0xdd90('0x1e')](0xcc)[_0xdd90('0x28')]();});}};}function handleEntityNotFound(_0x499bd0,_0x5906e3){return function(_0x25aff4){if(!_0x25aff4){_0x499bd0['sendStatus'](0x194);}return _0x25aff4;};}function handleError(_0x1f40c7,_0x57deeb){_0x57deeb=_0x57deeb||0x1f4;return function(_0x5b18fc){logger[_0xdd90('0x29')](_0x5b18fc['stack']);if(_0x5b18fc[_0xdd90('0x2a')]){delete _0x5b18fc[_0xdd90('0x2a')];}_0x1f40c7[_0xdd90('0x1e')](_0x57deeb)[_0xdd90('0x2b')](_0x5b18fc);};}exports[_0xdd90('0x2c')]=function(_0x584c3d,_0x3d0997){var _0x409107={},_0xc89427={},_0x19ee9a={'count':0x0,'rows':[]};var _0x222c8f=_[_0xdd90('0x2d')](db[_0xdd90('0x2e')][_0xdd90('0x2f')],function(_0x30f8a2){return{'name':_0x30f8a2['fieldName'],'type':_0x30f8a2[_0xdd90('0x30')][_0xdd90('0x31')]};});_0xc89427[_0xdd90('0x32')]=_['map'](_0x222c8f,_0xdd90('0x2a'));_0xc89427['query']=_[_0xdd90('0x33')](_0x584c3d[_0xdd90('0x34')]);_0xc89427[_0xdd90('0x35')]=_[_0xdd90('0x36')](_0xc89427['model'],_0xc89427[_0xdd90('0x34')]);_0x409107['attributes']=_[_0xdd90('0x36')](_0xc89427[_0xdd90('0x32')],qs['fields'](_0x584c3d[_0xdd90('0x34')][_0xdd90('0x37')]));_0x409107[_0xdd90('0x38')]=_0x409107[_0xdd90('0x38')]['length']?_0x409107[_0xdd90('0x38')]:_0xc89427['model'];if(!_0x584c3d[_0xdd90('0x34')]['hasOwnProperty'](_0xdd90('0x39'))){_0x409107[_0xdd90('0x22')]=qs[_0xdd90('0x22')](_0x584c3d[_0xdd90('0x34')]['limit']);_0x409107[_0xdd90('0x20')]=qs['offset'](_0x584c3d[_0xdd90('0x34')]['offset']);}_0x409107['order']=qs[_0xdd90('0x3a')](_0x584c3d[_0xdd90('0x34')][_0xdd90('0x3a')]);_0x409107[_0xdd90('0x3b')]=qs[_0xdd90('0x35')](_[_0xdd90('0x3c')](_0x584c3d[_0xdd90('0x34')],_0xc89427['filters']),_0x222c8f);if(_0x584c3d[_0xdd90('0x34')][_0xdd90('0x3d')]){_0x409107[_0xdd90('0x3b')]=_['merge'](_0x409107[_0xdd90('0x3b')],{'$or':_['map'](_0x222c8f,function(_0x1b9411){if(_0x1b9411['type']!=='VIRTUAL'){var _0x142d17={};_0x142d17[_0x1b9411[_0xdd90('0x2a')]]={'$like':'%'+_0x584c3d['query']['filter']+'%'};return _0x142d17;}})});}_0x409107=_[_0xdd90('0x3e')]({},_0x409107,_0x584c3d[_0xdd90('0x3f')]);var _0x476335={'where':_0x409107['where']};return db[_0xdd90('0x2e')][_0xdd90('0x23')](_0x476335)['then'](function(_0x21f6a6){_0x19ee9a[_0xdd90('0x23')]=_0x21f6a6;if(_0x584c3d['query']['includeAll']){_0x409107[_0xdd90('0x40')]=[{'all':!![]}];}return db[_0xdd90('0x2e')][_0xdd90('0x41')](_0x409107);})[_0xdd90('0x42')](function(_0x42385a){_0x19ee9a[_0xdd90('0x43')]=_0x42385a;return _0x19ee9a;})[_0xdd90('0x42')](respondWithFilteredResult(_0x3d0997,_0x409107))[_0xdd90('0x44')](handleError(_0x3d0997,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8061af5..99526bc 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 _0xfe33=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfe33,0x1c5));var _0x3fe3=function(_0x16d991,_0x3f07cc){_0x16d991=_0x16d991-0x0;var _0x4f41c3=_0xfe33[_0x16d991];return _0x4f41c3;};'use strict';var _=require(_0x3fe3('0x0'));var util=require('util');var logger=require(_0x3fe3('0x1'))('api');var moment=require(_0x3fe3('0x2'));var BPromise=require(_0x3fe3('0x3'));var rp=require(_0x3fe3('0x4'));var fs=require('fs');var path=require(_0x3fe3('0x5'));var rimraf=require(_0x3fe3('0x6'));var config=require(_0x3fe3('0x7'));var attributes=require(_0x3fe3('0x8'));module[_0x3fe3('0x9')]=function(_0x6f7fd3,_0xc5f311){return _0x6f7fd3[_0x3fe3('0xa')](_0x3fe3('0xb'),attributes,{'tableName':_0x3fe3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59f7=['./migration.attributes','exports','Migration','migrations','util','api','bluebird','request-promise','path'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x59f7,0x1ea));var _0x759f=function(_0x43b7ba,_0x1c9941){_0x43b7ba=_0x43b7ba-0x0;var _0x1690c4=_0x59f7[_0x43b7ba];return _0x1690c4;};'use strict';var _=require('lodash');var util=require(_0x759f('0x0'));var logger=require('../../config/logger')(_0x759f('0x1'));var moment=require('moment');var BPromise=require(_0x759f('0x2'));var rp=require(_0x759f('0x3'));var fs=require('fs');var path=require(_0x759f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x759f('0x5'));module[_0x759f('0x6')]=function(_0x1e83d6,_0x224ea7){return _0x1e83d6['define'](_0x759f('0x7'),attributes,{'tableName':_0x759f('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 7451723..d38abcb 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 _0x3d9c=['rpc','../../config/environment','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b1f89,_0x3041ec){var _0x43068c=function(_0x1f7e0c){while(--_0x1f7e0c){_0x3b1f89['push'](_0x3b1f89['shift']());}};_0x43068c(++_0x3041ec);}(_0x3d9c,0x134));var _0xc3d9=function(_0x49183f,_0xa5a4df){_0x49183f=_0x49183f-0x0;var _0x218bea=_0x3d9c[_0x49183f];return _0x218bea;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var moment=require(_0xc3d9('0x1'));var BPromise=require(_0xc3d9('0x2'));var rs=require(_0xc3d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3d9('0x4'))['db'];var utils=require(_0xc3d9('0x5'));var logger=require(_0xc3d9('0x6'))(_0xc3d9('0x7'));var config=require(_0xc3d9('0x8'));var jayson=require(_0xc3d9('0x9'));var client=jayson[_0xc3d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375380,_0x46704e,_0x4ecff0){return new BPromise(function(_0x3c0a2f,_0x50bfe8){return client[_0xc3d9('0xb')](_0x375380,_0x4ecff0)[_0xc3d9('0xc')](function(_0x3f04bf){logger['info'](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));logger['debug'](_0xc3d9('0xf'),_0x46704e,_0xc3d9('0xe'),JSON[_0xc3d9('0x10')](_0x3f04bf));if(_0x3f04bf[_0xc3d9('0x11')]){if(_0x3f04bf['error'][_0xc3d9('0x12')]===0x1f4){logger['error'](_0xc3d9('0xd'),_0x46704e,_0x3f04bf[_0xc3d9('0x11')][_0xc3d9('0x13')]);return _0x50bfe8(_0x3f04bf['error'][_0xc3d9('0x13')]);}logger[_0xc3d9('0x11')]('Migration,\x20%s,\x20%s',_0x46704e,_0x3f04bf['error'][_0xc3d9('0x13')]);return _0x3c0a2f(_0x3f04bf['error'][_0xc3d9('0x13')]);}else{logger[_0xc3d9('0x14')](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));_0x3c0a2f(_0x3f04bf['result']['message']);}})['catch'](function(_0x143194){logger[_0xc3d9('0x11')](_0xc3d9('0xd'),_0x46704e,_0x143194);_0x50bfe8(_0x143194);});});} \ No newline at end of file +var _0x9189=['request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','result','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x3193f2,_0x311fa0){var _0x2a1a2a=function(_0x573a0f){while(--_0x573a0f){_0x3193f2['push'](_0x3193f2['shift']());}};_0x2a1a2a(++_0x311fa0);}(_0x9189,0x1b0));var _0x9918=function(_0x4f10db,_0x1b6230){_0x4f10db=_0x4f10db-0x0;var _0x41445=_0x9189[_0x4f10db];return _0x41445;};'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')]('Migration,\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/network/index.js b/server/api/network/index.js index 78bf81e..e680dfa 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 _0x29f4=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x3c84dc,_0x5f4f1a){var _0xb1ee54=function(_0x13de21){while(--_0x13de21){_0x3c84dc['push'](_0x3c84dc['shift']());}};_0xb1ee54(++_0x5f4f1a);}(_0x29f4,0x1d1));var _0x429f=function(_0x56b41a,_0x1e91f8){_0x56b41a=_0x56b41a-0x0;var _0x37276e=_0x29f4[_0x56b41a];return _0x37276e;};'use strict';var multer=require(_0x429f('0x0'));var util=require(_0x429f('0x1'));var path=require(_0x429f('0x2'));var timeout=require(_0x429f('0x3'));var express=require(_0x429f('0x4'));var router=express[_0x429f('0x5')]();var fs_extra=require(_0x429f('0x6'));var auth=require(_0x429f('0x7'));var interaction=require(_0x429f('0x8'));var config=require(_0x429f('0x9'));var controller=require(_0x429f('0xa'));router['get']('/',auth[_0x429f('0xb')](),controller[_0x429f('0xc')]);router[_0x429f('0xd')](_0x429f('0xe'),auth['isAuthenticated'](),controller[_0x429f('0xf')]);router[_0x429f('0x10')]('/',auth[_0x429f('0xb')](),controller['create']);router[_0x429f('0x11')]('/:id',auth[_0x429f('0xb')](),controller[_0x429f('0x12')]);router['delete'](_0x429f('0xe'),auth['isAuthenticated'](),controller[_0x429f('0x13')]);module[_0x429f('0x14')]=router; \ No newline at end of file +var _0x47a1=['fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x2bb930,_0xe92f28){var _0x4a7d19=function(_0x31d554){while(--_0x31d554){_0x2bb930['push'](_0x2bb930['shift']());}};_0x4a7d19(++_0xe92f28);}(_0x47a1,0xbd));var _0x147a=function(_0x121885,_0x68b5b6){_0x121885=_0x121885-0x0;var _0x2aa245=_0x47a1[_0x121885];return _0x2aa245;};'use strict';var multer=require(_0x147a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x147a('0x1'));var express=require('express');var router=express[_0x147a('0x2')]();var fs_extra=require(_0x147a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x147a('0x4'));var config=require(_0x147a('0x5'));var controller=require(_0x147a('0x6'));router[_0x147a('0x7')]('/',auth[_0x147a('0x8')](),controller['index']);router[_0x147a('0x7')](_0x147a('0x9'),auth[_0x147a('0x8')](),controller[_0x147a('0xa')]);router[_0x147a('0xb')]('/',auth[_0x147a('0x8')](),controller[_0x147a('0xc')]);router['put'](_0x147a('0x9'),auth[_0x147a('0x8')](),controller['update']);router[_0x147a('0xd')]('/:id',auth[_0x147a('0x8')](),controller[_0x147a('0xe')]);module[_0x147a('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e552690..d1dc667 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 _0x931c=['stun','STRING','sequelize','exports','localnet','externip'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x931c,0x8c));var _0xc931=function(_0x2bd47b,_0x2a5f8f){_0x2bd47b=_0x2bd47b-0x0;var _0x6019dd=_0x931c[_0x2bd47b];return _0x6019dd;};'use strict';var Sequelize=require(_0xc931('0x0'));module[_0xc931('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc931('0x2'),_0xc931('0x3'),_0xc931('0x4'),'turn')},'value':{'type':Sequelize[_0xc931('0x5')]},'username':{'type':Sequelize[_0xc931('0x5')]},'password':{'type':Sequelize[_0xc931('0x5')]}}; \ No newline at end of file +var _0x18a4=['exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18a4,0x16c));var _0x418a=function(_0x4f5864,_0xbfa5b2){_0x4f5864=_0x4f5864-0x0;var _0x5c8a1d=_0x18a4[_0x4f5864];return _0x5c8a1d;};'use strict';var Sequelize=require('sequelize');module[_0x418a('0x0')]={'type':{'type':Sequelize[_0x418a('0x1')](_0x418a('0x2'),_0x418a('0x3'),_0x418a('0x4'),_0x418a('0x5'))},'value':{'type':Sequelize[_0x418a('0x6')]},'username':{'type':Sequelize[_0x418a('0x6')]},'password':{'type':Sequelize[_0x418a('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d84c34c..b1523c3 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 _0x2da3=['utf8','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','path','../../components/parsers/qs','../../config/logger','api','../../config/environment','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','limit','count','set','update','destroy','end','sendStatus','name','send','map','Network','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','create','body','findAll','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs'];(function(_0x5b9b0a,_0x482243){var _0x5d48c1=function(_0x2b48b1){while(--_0x2b48b1){_0x5b9b0a['push'](_0x5b9b0a['shift']());}};_0x5d48c1(++_0x482243);}(_0x2da3,0xad));var _0x32da=function(_0x44a92f,_0x1f9907){_0x44a92f=_0x44a92f-0x0;var _0x49c5c4=_0x2da3[_0x44a92f];return _0x49c5c4;};'use strict';var util=require('util');var path=require(_0x32da('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0x32da('0x1'));var logger=require(_0x32da('0x2'))(_0x32da('0x3'));var config=require(_0x32da('0x4'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x32da('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x598a2f,_0x27cd3a,_0x25456c,_0x368472){return new Promise(function(_0x336eea,_0x3ca044){var _0x1815e7=_0x368472||client;return _0x1815e7[_0x32da('0x6')](_0x598a2f,_0x25456c)[_0x32da('0x7')](function(_0x3eb45b){logger[_0x32da('0x8')](_0x32da('0x9'),_0x27cd3a,_0x32da('0xa'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x27cd3a,_0x32da('0xa'),JSON[_0x32da('0xb')](_0x3eb45b));if(_0x3eb45b['error']){if(_0x3eb45b['error']['code']===0x1f4){logger[_0x32da('0xc')](_0x32da('0x9'),_0x27cd3a,_0x3eb45b[_0x32da('0xc')][_0x32da('0xd')]);return _0x3ca044(_0x3eb45b[_0x32da('0xc')][_0x32da('0xd')]);}logger[_0x32da('0xc')](_0x32da('0x9'),_0x27cd3a,_0x3eb45b['error']['message']);return _0x336eea(_0x3eb45b[_0x32da('0xc')][_0x32da('0xd')]);}else{logger[_0x32da('0x8')](_0x32da('0x9'),_0x27cd3a,_0x32da('0xa'));_0x336eea(_0x3eb45b['result'][_0x32da('0xd')]);}})[_0x32da('0xe')](function(_0x313d2e){logger[_0x32da('0xc')](_0x32da('0x9'),_0x27cd3a,_0x313d2e);_0x3ca044(_0x313d2e);});});}function respondWithResult(_0x480422,_0x3f685d){_0x3f685d=_0x3f685d||0xc8;return function(_0x5e5c6a){if(_0x5e5c6a){return _0x480422[_0x32da('0xf')](_0x3f685d)[_0x32da('0x10')](_0x5e5c6a);}};}function respondWithFilteredResult(_0x2045ae,_0x1ab9f3){return function(_0x12dd55){if(_0x12dd55){var _0x4ba1d3=typeof _0x1ab9f3[_0x32da('0x11')]==='undefined'&&typeof _0x1ab9f3[_0x32da('0x12')]==='undefined';var _0x18039f=_0x12dd55[_0x32da('0x13')];var _0x16ef0f=_0x4ba1d3?0x0:_0x1ab9f3[_0x32da('0x11')];var _0x592f3a=_0x4ba1d3?_0x12dd55['count']:_0x1ab9f3['offset']+_0x1ab9f3[_0x32da('0x12')];var _0x440537;if(_0x592f3a>=_0x18039f){_0x592f3a=_0x18039f;_0x440537=0xc8;}else{_0x440537=0xce;}_0x2045ae['status'](_0x440537);return _0x2045ae[_0x32da('0x14')]('Content-Range',_0x16ef0f+'-'+_0x592f3a+'/'+_0x18039f)[_0x32da('0x10')](_0x12dd55);}return null;};}function saveUpdates(_0x190135){return function(_0x5cb847){if(_0x5cb847){return _0x5cb847[_0x32da('0x15')](_0x190135)[_0x32da('0x7')](function(_0x498bd1){return _0x498bd1;});}return null;};}function removeEntity(_0x372416){return function(_0x96a613){if(_0x96a613){return _0x96a613[_0x32da('0x16')]()['then'](function(){_0x372416[_0x32da('0xf')](0xcc)[_0x32da('0x17')]();});}};}function handleEntityNotFound(_0x432cb7){return function(_0x997085){if(!_0x997085){_0x432cb7[_0x32da('0x18')](0x194);}return _0x997085;};}function handleError(_0x50301d,_0x184731){_0x184731=_0x184731||0x1f4;return function(_0x405dc0){logger[_0x32da('0xc')](_0x405dc0['stack']);if(_0x405dc0[_0x32da('0x19')]){delete _0x405dc0['name'];}_0x50301d[_0x32da('0xf')](_0x184731)[_0x32da('0x1a')](_0x405dc0);};}exports['index']=function(_0x25f153,_0xe38764){var _0x4ac391={},_0x3115fd={},_0x17ab3e={'count':0x0,'rows':[]};var _0x5da29c=_[_0x32da('0x1b')](db[_0x32da('0x1c')][_0x32da('0x1d')],function(_0x54c642){return{'name':_0x54c642[_0x32da('0x1e')],'type':_0x54c642[_0x32da('0x1f')][_0x32da('0x20')]};});_0x3115fd[_0x32da('0x21')]=_[_0x32da('0x1b')](_0x5da29c,'name');_0x3115fd['query']=_[_0x32da('0x22')](_0x25f153['query']);_0x3115fd[_0x32da('0x23')]=_[_0x32da('0x24')](_0x3115fd[_0x32da('0x21')],_0x3115fd[_0x32da('0x25')]);_0x4ac391[_0x32da('0x26')]=_[_0x32da('0x24')](_0x3115fd['model'],qs[_0x32da('0x27')](_0x25f153[_0x32da('0x25')][_0x32da('0x27')]));_0x4ac391[_0x32da('0x26')]=_0x4ac391[_0x32da('0x26')][_0x32da('0x28')]?_0x4ac391['attributes']:_0x3115fd[_0x32da('0x21')];if(!_0x25f153['query'][_0x32da('0x29')]('nolimit')){_0x4ac391[_0x32da('0x12')]=qs[_0x32da('0x12')](_0x25f153[_0x32da('0x25')][_0x32da('0x12')]);_0x4ac391[_0x32da('0x11')]=qs['offset'](_0x25f153[_0x32da('0x25')][_0x32da('0x11')]);}_0x4ac391[_0x32da('0x2a')]=qs[_0x32da('0x2b')](_0x25f153[_0x32da('0x25')][_0x32da('0x2b')]);_0x4ac391[_0x32da('0x2c')]=qs['filters'](_[_0x32da('0x2d')](_0x25f153[_0x32da('0x25')],_0x3115fd['filters']),_0x5da29c);if(_0x25f153[_0x32da('0x25')]['filter']){_0x4ac391[_0x32da('0x2c')]=_[_0x32da('0x2e')](_0x4ac391['where'],{'$or':_[_0x32da('0x1b')](_0x5da29c,function(_0xfd30cc){if(_0xfd30cc[_0x32da('0x1f')]!==_0x32da('0x2f')){var _0x260e0d={};_0x260e0d[_0xfd30cc[_0x32da('0x19')]]={'$like':'%'+_0x25f153[_0x32da('0x25')][_0x32da('0x30')]+'%'};return _0x260e0d;}})});}_0x4ac391=_['merge']({},_0x4ac391,_0x25f153[_0x32da('0x31')]);var _0x10c1cf={'where':_0x4ac391['where']};return db['Network'][_0x32da('0x13')](_0x10c1cf)[_0x32da('0x7')](function(_0x589963){_0x17ab3e['count']=_0x589963;if(_0x25f153[_0x32da('0x25')][_0x32da('0x32')]){_0x4ac391[_0x32da('0x33')]=[{'all':!![]}];}return db[_0x32da('0x1c')]['findAll'](_0x4ac391);})[_0x32da('0x7')](function(_0x1a4806){_0x17ab3e[_0x32da('0x34')]=_0x1a4806;return _0x17ab3e;})[_0x32da('0x7')](respondWithFilteredResult(_0xe38764,_0x4ac391))[_0x32da('0xe')](handleError(_0xe38764,null));};exports[_0x32da('0x35')]=function(_0x4530b7,_0x104a67){var _0x22e23b={'raw':!![],'where':{'id':_0x4530b7[_0x32da('0x36')]['id']}},_0x3e23da={};_0x3e23da[_0x32da('0x21')]=_[_0x32da('0x22')](db[_0x32da('0x1c')][_0x32da('0x1d')]);_0x3e23da[_0x32da('0x25')]=_[_0x32da('0x22')](_0x4530b7['query']);_0x3e23da['filters']=_['intersection'](_0x3e23da[_0x32da('0x21')],_0x3e23da[_0x32da('0x25')]);_0x22e23b[_0x32da('0x26')]=_[_0x32da('0x24')](_0x3e23da[_0x32da('0x21')],qs['fields'](_0x4530b7[_0x32da('0x25')][_0x32da('0x27')]));_0x22e23b[_0x32da('0x26')]=_0x22e23b[_0x32da('0x26')][_0x32da('0x28')]?_0x22e23b[_0x32da('0x26')]:_0x3e23da[_0x32da('0x21')];if(_0x4530b7['query'][_0x32da('0x32')]){_0x22e23b[_0x32da('0x33')]=[{'all':!![]}];}_0x22e23b=_['merge']({},_0x22e23b,_0x4530b7['options']);return db[_0x32da('0x1c')][_0x32da('0x37')](_0x22e23b)[_0x32da('0x7')](handleEntityNotFound(_0x104a67,null))[_0x32da('0x7')](respondWithResult(_0x104a67,null))[_0x32da('0xe')](handleError(_0x104a67,null));};exports[_0x32da('0x38')]=function(_0x1a160d,_0x1b20ad){var _0x1d5b97;return db[_0x32da('0x1c')][_0x32da('0x38')](_0x1a160d[_0x32da('0x39')],{'raw':!![]})[_0x32da('0x7')](function(_0x2e50c3){_0x1d5b97=_0x2e50c3;return db['Network'][_0x32da('0x3a')]({'where':{'type':_0x1a160d['body'][_0x32da('0x1f')]},'raw':!![]});})[_0x32da('0x7')](function(_0x5cc910){if(_0x1d5b97[_0x32da('0x1f')]['toUpperCase']()==_0x32da('0x3b')){var _0x487ba7=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],_0x32da('0x3f')),_0x32da('0x40'));var _0x19a8bb=ejs['render'](_0x487ba7,{'networks':_0x5cc910||[]});fs[_0x32da('0x41')]('/etc/asterisk/stun_xcally.conf',_0x19a8bb);return respondWithRpcPromise(_0x32da('0x42'),_0x32da('0x38'),{'module':_0x32da('0x43')});}else if(_0x1d5b97[_0x32da('0x1f')][_0x32da('0x44')]()==_0x32da('0x45')){var _0x386153=fs['readFileSync'](path[_0x32da('0x3d')](config[_0x32da('0x3e')],_0x32da('0x46')),'utf8');var _0x2f7315=ejs[_0x32da('0x47')](_0x386153,{'networks':_0x5cc910||[]});fs[_0x32da('0x41')](_0x32da('0x48'),_0x2f7315);return respondWithRpcPromise(_0x32da('0x42'),_0x32da('0x38'),{'module':_0x32da('0x43')});}else{var _0x3b708a=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],'server/files/templates/network.ejs'),_0x32da('0x40'));var _0x6412e2=ejs[_0x32da('0x47')](_0x3b708a,{'networks':_0x5cc910||[]});fs[_0x32da('0x41')](util[_0x32da('0x49')]('/etc/asterisk/sip_xcally_%s.conf',_0x1a160d[_0x32da('0x39')][_0x32da('0x1f')]['toLowerCase']()),_0x6412e2);return respondWithRpcPromise(_0x32da('0x42'),_0x32da('0x38'),{'module':'chan_sip.so'});}})[_0x32da('0x7')](function(){return _0x1d5b97;})[_0x32da('0x7')](respondWithResult(_0x1b20ad,0xc9))[_0x32da('0xe')](handleError(_0x1b20ad,null));};exports[_0x32da('0x15')]=function(_0x542ab9,_0x5e46b2){var _0x2a2721;return db['Network'][_0x32da('0x37')]({'where':{'id':_0x542ab9['params']['id']}})[_0x32da('0x7')](handleEntityNotFound(_0x5e46b2,null))[_0x32da('0x7')](saveUpdates(_0x542ab9[_0x32da('0x39')],null))['then'](function(_0x1cf1ce){if(_0x1cf1ce){_0x2a2721=_0x1cf1ce;return db['Network'][_0x32da('0x3a')]({'where':{'type':_0x2a2721[_0x32da('0x1f')]},'raw':!![]});}return null;})['then'](function(_0x19aaf0){if(_0x2a2721[_0x32da('0x1f')][_0x32da('0x44')]()==_0x32da('0x3b')){var _0x4bfe1f=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],'server/files/templates/stun_multiple.ejs'),_0x32da('0x40'));var _0x587f57=ejs[_0x32da('0x47')](_0x4bfe1f,{'networks':_0x19aaf0||[]});fs[_0x32da('0x41')](_0x32da('0x4a'),_0x587f57);return respondWithRpcPromise(_0x32da('0x42'),_0x32da('0x15'),{'module':_0x32da('0x43')});}else if(_0x2a2721[_0x32da('0x1f')]['toUpperCase']()=='TURN'){var _0xeb44ec=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],_0x32da('0x46')),_0x32da('0x40'));var _0x310f3f=ejs[_0x32da('0x47')](_0xeb44ec,{'networks':_0x19aaf0||[]});fs[_0x32da('0x41')](_0x32da('0x48'),_0x310f3f);return respondWithRpcPromise('Reload','update',{'module':_0x32da('0x43')});}else{var _0x1d9fa4=fs['readFileSync'](path['join'](config[_0x32da('0x3e')],_0x32da('0x4b')),'utf8');var _0x2a605c=ejs[_0x32da('0x47')](_0x1d9fa4,{'networks':_0x19aaf0||[]});fs[_0x32da('0x41')](util['format'](_0x32da('0x4c'),_0x542ab9[_0x32da('0x39')][_0x32da('0x1f')][_0x32da('0x4d')]()),_0x2a605c);return respondWithRpcPromise('Reload',_0x32da('0x15'),{'module':_0x32da('0x4e')});}})[_0x32da('0x7')](function(_0x131e0c){if(_0x131e0c){return _0x2a2721;}return null;})[_0x32da('0x7')](respondWithResult(_0x5e46b2,null))['catch'](handleError(_0x5e46b2,null));};exports[_0x32da('0x16')]=function(_0x5b89aa,_0x224aeb){var _0x6ffe40;return db[_0x32da('0x1c')][_0x32da('0x37')]({'where':{'id':_0x5b89aa[_0x32da('0x36')]['id']}})['then'](function(_0x10ef4f){_0x6ffe40=_0x10ef4f;return _0x10ef4f;})[_0x32da('0x7')](handleEntityNotFound(_0x224aeb,null))[_0x32da('0x7')](removeEntity(_0x224aeb,null))[_0x32da('0x7')](function(){if(_0x6ffe40){return db[_0x32da('0x1c')][_0x32da('0x3a')]({'where':{'type':_0x6ffe40[_0x32da('0x1f')]},'raw':!![]});}})[_0x32da('0x7')](function(_0x2f08e4){if(_0x6ffe40['type'][_0x32da('0x44')]()==_0x32da('0x3b')){var _0x36035c=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],'server/files/templates/stun_multiple.ejs'),_0x32da('0x40'));var _0x1ce1f9=ejs[_0x32da('0x47')](_0x36035c,{'networks':_0x2f08e4||[]});fs[_0x32da('0x41')](_0x32da('0x4a'),_0x1ce1f9);return respondWithRpcPromise(_0x32da('0x42'),_0x32da('0x16'),{'module':_0x32da('0x43')});}else if(_0x6ffe40[_0x32da('0x1f')][_0x32da('0x44')]()=='TURN'){var _0x1e25bf=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],_0x32da('0x46')),_0x32da('0x40'));var _0x5dc985=ejs[_0x32da('0x47')](_0x1e25bf,{'networks':_0x2f08e4||[]});fs['writeFileSync'](_0x32da('0x48'),_0x5dc985);return respondWithRpcPromise('Reload',_0x32da('0x16'),{'module':'res_stun_monitor.so'});}else{var _0x255702=fs[_0x32da('0x3c')](path[_0x32da('0x3d')](config[_0x32da('0x3e')],'server/files/templates/network.ejs'),_0x32da('0x40'));var _0x86ceac=ejs[_0x32da('0x47')](_0x255702,{'networks':_0x2f08e4||[]});fs['writeFileSync'](util[_0x32da('0x49')](_0x32da('0x4c'),_0x6ffe40['type']['toLowerCase']()),_0x86ceac);return respondWithRpcPromise('Reload',_0x32da('0x16'),{'module':_0x32da('0x4e')});}})[_0x32da('0xe')](handleError(_0x224aeb,null));}; \ No newline at end of file +var _0x3e3a=['filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','length','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','server/files/templates/turn_multiple.ejs','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','sendStatus','name','index','Network','fieldName','type','key','model','query','keys'];(function(_0x5e1ec0,_0x4d0c15){var _0x260301=function(_0x38fac6){while(--_0x38fac6){_0x5e1ec0['push'](_0x5e1ec0['shift']());}};_0x260301(++_0x4d0c15);}(_0x3e3a,0x128));var _0xa3e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e3a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var path=require(_0xa3e3('0x0'));var ejs=require(_0xa3e3('0x1'));var fs=require('fs');var _=require(_0xa3e3('0x2'));var qs=require(_0xa3e3('0x3'));var logger=require(_0xa3e3('0x4'))('api');var config=require(_0xa3e3('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa3e3('0x6'));var client=jayson[_0xa3e3('0x7')][_0xa3e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f5375,_0x27cc4f,_0x532327,_0x587198){return new Promise(function(_0x5db323,_0x1dbe69){var _0x4765e4=_0x587198||client;return _0x4765e4['request'](_0x3f5375,_0x532327)[_0xa3e3('0x9')](function(_0x36f071){logger[_0xa3e3('0xa')](_0xa3e3('0xb'),_0x27cc4f,_0xa3e3('0xc'));logger[_0xa3e3('0xd')](_0xa3e3('0xe'),_0x27cc4f,_0xa3e3('0xc'),JSON[_0xa3e3('0xf')](_0x36f071));if(_0x36f071[_0xa3e3('0x10')]){if(_0x36f071[_0xa3e3('0x10')]['code']===0x1f4){logger[_0xa3e3('0x10')]('Network,\x20%s,\x20%s',_0x27cc4f,_0x36f071[_0xa3e3('0x10')]['message']);return _0x1dbe69(_0x36f071['error'][_0xa3e3('0x11')]);}logger[_0xa3e3('0x10')](_0xa3e3('0xb'),_0x27cc4f,_0x36f071[_0xa3e3('0x10')][_0xa3e3('0x11')]);return _0x5db323(_0x36f071[_0xa3e3('0x10')][_0xa3e3('0x11')]);}else{logger[_0xa3e3('0xa')]('Network,\x20%s,\x20%s',_0x27cc4f,_0xa3e3('0xc'));_0x5db323(_0x36f071[_0xa3e3('0x12')][_0xa3e3('0x11')]);}})[_0xa3e3('0x13')](function(_0x10eca0){logger[_0xa3e3('0x10')](_0xa3e3('0xb'),_0x27cc4f,_0x10eca0);_0x1dbe69(_0x10eca0);});});}function respondWithResult(_0x295434,_0x143e56){_0x143e56=_0x143e56||0xc8;return function(_0x20ca66){if(_0x20ca66){return _0x295434[_0xa3e3('0x14')](_0x143e56)[_0xa3e3('0x15')](_0x20ca66);}};}function respondWithFilteredResult(_0x47010b,_0x4515e5){return function(_0x1f027d){if(_0x1f027d){var _0xe89848=typeof _0x4515e5[_0xa3e3('0x16')]===_0xa3e3('0x17')&&typeof _0x4515e5['limit']==='undefined';var _0x1c303b=_0x1f027d[_0xa3e3('0x18')];var _0xdee377=_0xe89848?0x0:_0x4515e5[_0xa3e3('0x16')];var _0x3dcdec=_0xe89848?_0x1f027d['count']:_0x4515e5['offset']+_0x4515e5[_0xa3e3('0x19')];var _0x338d09;if(_0x3dcdec>=_0x1c303b){_0x3dcdec=_0x1c303b;_0x338d09=0xc8;}else{_0x338d09=0xce;}_0x47010b[_0xa3e3('0x14')](_0x338d09);return _0x47010b[_0xa3e3('0x1a')](_0xa3e3('0x1b'),_0xdee377+'-'+_0x3dcdec+'/'+_0x1c303b)[_0xa3e3('0x15')](_0x1f027d);}return null;};}function saveUpdates(_0x3cb0fe){return function(_0x498791){if(_0x498791){return _0x498791[_0xa3e3('0x1c')](_0x3cb0fe)[_0xa3e3('0x9')](function(_0x1ec7e6){return _0x1ec7e6;});}return null;};}function removeEntity(_0xf1defb){return function(_0x17fcec){if(_0x17fcec){return _0x17fcec[_0xa3e3('0x1d')]()[_0xa3e3('0x9')](function(){_0xf1defb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x147937){return function(_0x1fd5cf){if(!_0x1fd5cf){_0x147937[_0xa3e3('0x1e')](0x194);}return _0x1fd5cf;};}function handleError(_0x1bd23a,_0x3c82b3){_0x3c82b3=_0x3c82b3||0x1f4;return function(_0x331bd9){logger['error'](_0x331bd9['stack']);if(_0x331bd9[_0xa3e3('0x1f')]){delete _0x331bd9[_0xa3e3('0x1f')];}_0x1bd23a[_0xa3e3('0x14')](_0x3c82b3)['send'](_0x331bd9);};}exports[_0xa3e3('0x20')]=function(_0x39d8bd,_0x2f57c9){var _0x593f3b={},_0x48e07a={},_0x40fba2={'count':0x0,'rows':[]};var _0xde96d2=_['map'](db[_0xa3e3('0x21')]['rawAttributes'],function(_0x47e0c1){return{'name':_0x47e0c1[_0xa3e3('0x22')],'type':_0x47e0c1[_0xa3e3('0x23')][_0xa3e3('0x24')]};});_0x48e07a[_0xa3e3('0x25')]=_['map'](_0xde96d2,'name');_0x48e07a[_0xa3e3('0x26')]=_[_0xa3e3('0x27')](_0x39d8bd[_0xa3e3('0x26')]);_0x48e07a[_0xa3e3('0x28')]=_[_0xa3e3('0x29')](_0x48e07a[_0xa3e3('0x25')],_0x48e07a[_0xa3e3('0x26')]);_0x593f3b[_0xa3e3('0x2a')]=_[_0xa3e3('0x29')](_0x48e07a[_0xa3e3('0x25')],qs[_0xa3e3('0x2b')](_0x39d8bd[_0xa3e3('0x26')][_0xa3e3('0x2b')]));_0x593f3b[_0xa3e3('0x2a')]=_0x593f3b[_0xa3e3('0x2a')]['length']?_0x593f3b['attributes']:_0x48e07a[_0xa3e3('0x25')];if(!_0x39d8bd[_0xa3e3('0x26')][_0xa3e3('0x2c')]('nolimit')){_0x593f3b[_0xa3e3('0x19')]=qs[_0xa3e3('0x19')](_0x39d8bd['query']['limit']);_0x593f3b[_0xa3e3('0x16')]=qs[_0xa3e3('0x16')](_0x39d8bd[_0xa3e3('0x26')][_0xa3e3('0x16')]);}_0x593f3b[_0xa3e3('0x2d')]=qs[_0xa3e3('0x2e')](_0x39d8bd['query'][_0xa3e3('0x2e')]);_0x593f3b[_0xa3e3('0x2f')]=qs['filters'](_[_0xa3e3('0x30')](_0x39d8bd[_0xa3e3('0x26')],_0x48e07a[_0xa3e3('0x28')]),_0xde96d2);if(_0x39d8bd[_0xa3e3('0x26')][_0xa3e3('0x31')]){_0x593f3b[_0xa3e3('0x2f')]=_[_0xa3e3('0x32')](_0x593f3b[_0xa3e3('0x2f')],{'$or':_[_0xa3e3('0x33')](_0xde96d2,function(_0x737f13){if(_0x737f13['type']!==_0xa3e3('0x34')){var _0x241164={};_0x241164[_0x737f13[_0xa3e3('0x1f')]]={'$like':'%'+_0x39d8bd['query'][_0xa3e3('0x31')]+'%'};return _0x241164;}})});}_0x593f3b=_[_0xa3e3('0x32')]({},_0x593f3b,_0x39d8bd['options']);var _0x54c456={'where':_0x593f3b[_0xa3e3('0x2f')]};return db[_0xa3e3('0x21')][_0xa3e3('0x18')](_0x54c456)[_0xa3e3('0x9')](function(_0x4cc86e){_0x40fba2['count']=_0x4cc86e;if(_0x39d8bd['query'][_0xa3e3('0x35')]){_0x593f3b[_0xa3e3('0x36')]=[{'all':!![]}];}return db[_0xa3e3('0x21')][_0xa3e3('0x37')](_0x593f3b);})['then'](function(_0x2939e1){_0x40fba2[_0xa3e3('0x38')]=_0x2939e1;return _0x40fba2;})['then'](respondWithFilteredResult(_0x2f57c9,_0x593f3b))[_0xa3e3('0x13')](handleError(_0x2f57c9,null));};exports[_0xa3e3('0x39')]=function(_0x4fa7d8,_0x525995){var _0x1add34={'raw':!![],'where':{'id':_0x4fa7d8['params']['id']}},_0x46a2eb={};_0x46a2eb['model']=_['keys'](db[_0xa3e3('0x21')][_0xa3e3('0x3a')]);_0x46a2eb[_0xa3e3('0x26')]=_['keys'](_0x4fa7d8[_0xa3e3('0x26')]);_0x46a2eb['filters']=_[_0xa3e3('0x29')](_0x46a2eb[_0xa3e3('0x25')],_0x46a2eb[_0xa3e3('0x26')]);_0x1add34['attributes']=_['intersection'](_0x46a2eb[_0xa3e3('0x25')],qs[_0xa3e3('0x2b')](_0x4fa7d8[_0xa3e3('0x26')][_0xa3e3('0x2b')]));_0x1add34['attributes']=_0x1add34[_0xa3e3('0x2a')][_0xa3e3('0x3b')]?_0x1add34[_0xa3e3('0x2a')]:_0x46a2eb['model'];if(_0x4fa7d8['query'][_0xa3e3('0x35')]){_0x1add34[_0xa3e3('0x36')]=[{'all':!![]}];}_0x1add34=_['merge']({},_0x1add34,_0x4fa7d8['options']);return db[_0xa3e3('0x21')][_0xa3e3('0x3c')](_0x1add34)[_0xa3e3('0x9')](handleEntityNotFound(_0x525995,null))['then'](respondWithResult(_0x525995,null))[_0xa3e3('0x13')](handleError(_0x525995,null));};exports['create']=function(_0x2c0912,_0x24ca8b){var _0x1a0acf;return db['Network'][_0xa3e3('0x3d')](_0x2c0912['body'],{'raw':!![]})[_0xa3e3('0x9')](function(_0x58227d){_0x1a0acf=_0x58227d;return db[_0xa3e3('0x21')][_0xa3e3('0x37')]({'where':{'type':_0x2c0912[_0xa3e3('0x3e')][_0xa3e3('0x23')]},'raw':!![]});})[_0xa3e3('0x9')](function(_0x3a39c5){if(_0x1a0acf[_0xa3e3('0x23')][_0xa3e3('0x3f')]()==_0xa3e3('0x40')){var _0x6622ba=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x44')),_0xa3e3('0x45'));var _0x51a130=ejs[_0xa3e3('0x46')](_0x6622ba,{'networks':_0x3a39c5||[]});fs[_0xa3e3('0x47')](_0xa3e3('0x48'),_0x51a130);return respondWithRpcPromise(_0xa3e3('0x49'),'create',{'module':_0xa3e3('0x4a')});}else if(_0x1a0acf['type'][_0xa3e3('0x3f')]()==_0xa3e3('0x4b')){var _0x5c0100=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],'server/files/templates/turn_multiple.ejs'),_0xa3e3('0x45'));var _0x3fc38e=ejs[_0xa3e3('0x46')](_0x5c0100,{'networks':_0x3a39c5||[]});fs[_0xa3e3('0x47')](_0xa3e3('0x4c'),_0x3fc38e);return respondWithRpcPromise('Reload',_0xa3e3('0x3d'),{'module':'res_stun_monitor.so'});}else{var _0x15db6e=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x4d')),'utf8');var _0x4a7363=ejs[_0xa3e3('0x46')](_0x15db6e,{'networks':_0x3a39c5||[]});fs[_0xa3e3('0x47')](util[_0xa3e3('0x4e')](_0xa3e3('0x4f'),_0x2c0912[_0xa3e3('0x3e')][_0xa3e3('0x23')][_0xa3e3('0x50')]()),_0x4a7363);return respondWithRpcPromise('Reload',_0xa3e3('0x3d'),{'module':_0xa3e3('0x51')});}})[_0xa3e3('0x9')](function(){return _0x1a0acf;})[_0xa3e3('0x9')](respondWithResult(_0x24ca8b,0xc9))['catch'](handleError(_0x24ca8b,null));};exports['update']=function(_0x69eda7,_0x1733f7){var _0x58ca61;return db[_0xa3e3('0x21')]['find']({'where':{'id':_0x69eda7[_0xa3e3('0x52')]['id']}})[_0xa3e3('0x9')](handleEntityNotFound(_0x1733f7,null))[_0xa3e3('0x9')](saveUpdates(_0x69eda7[_0xa3e3('0x3e')],null))['then'](function(_0x51802f){if(_0x51802f){_0x58ca61=_0x51802f;return db[_0xa3e3('0x21')]['findAll']({'where':{'type':_0x58ca61[_0xa3e3('0x23')]},'raw':!![]});}return null;})['then'](function(_0x5b760d){if(_0x58ca61[_0xa3e3('0x23')][_0xa3e3('0x3f')]()==_0xa3e3('0x40')){var _0x367c23=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x44')),_0xa3e3('0x45'));var _0x56cd89=ejs[_0xa3e3('0x46')](_0x367c23,{'networks':_0x5b760d||[]});fs['writeFileSync'](_0xa3e3('0x48'),_0x56cd89);return respondWithRpcPromise('Reload',_0xa3e3('0x1c'),{'module':_0xa3e3('0x4a')});}else if(_0x58ca61[_0xa3e3('0x23')][_0xa3e3('0x3f')]()==_0xa3e3('0x4b')){var _0x21eadb=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x53')),_0xa3e3('0x45'));var _0x4bc7ff=ejs[_0xa3e3('0x46')](_0x21eadb,{'networks':_0x5b760d||[]});fs[_0xa3e3('0x47')](_0xa3e3('0x4c'),_0x4bc7ff);return respondWithRpcPromise(_0xa3e3('0x49'),_0xa3e3('0x1c'),{'module':_0xa3e3('0x4a')});}else{var _0x25e4b0=fs['readFileSync'](path[_0xa3e3('0x42')](config['root'],_0xa3e3('0x4d')),_0xa3e3('0x45'));var _0x104675=ejs[_0xa3e3('0x46')](_0x25e4b0,{'networks':_0x5b760d||[]});fs['writeFileSync'](util['format'](_0xa3e3('0x4f'),_0x69eda7[_0xa3e3('0x3e')][_0xa3e3('0x23')][_0xa3e3('0x50')]()),_0x104675);return respondWithRpcPromise(_0xa3e3('0x49'),_0xa3e3('0x1c'),{'module':_0xa3e3('0x51')});}})[_0xa3e3('0x9')](function(_0x529a23){if(_0x529a23){return _0x58ca61;}return null;})[_0xa3e3('0x9')](respondWithResult(_0x1733f7,null))[_0xa3e3('0x13')](handleError(_0x1733f7,null));};exports[_0xa3e3('0x1d')]=function(_0x5ba5aa,_0x383110){var _0x26d607;return db['Network'][_0xa3e3('0x3c')]({'where':{'id':_0x5ba5aa['params']['id']}})['then'](function(_0x4cb350){_0x26d607=_0x4cb350;return _0x4cb350;})[_0xa3e3('0x9')](handleEntityNotFound(_0x383110,null))[_0xa3e3('0x9')](removeEntity(_0x383110,null))[_0xa3e3('0x9')](function(){if(_0x26d607){return db[_0xa3e3('0x21')][_0xa3e3('0x37')]({'where':{'type':_0x26d607[_0xa3e3('0x23')]},'raw':!![]});}})[_0xa3e3('0x9')](function(_0x36c5ee){if(_0x26d607[_0xa3e3('0x23')][_0xa3e3('0x3f')]()==_0xa3e3('0x40')){var _0xa6ec99=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x44')),'utf8');var _0x9736b1=ejs[_0xa3e3('0x46')](_0xa6ec99,{'networks':_0x36c5ee||[]});fs[_0xa3e3('0x47')](_0xa3e3('0x48'),_0x9736b1);return respondWithRpcPromise(_0xa3e3('0x49'),_0xa3e3('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x26d607[_0xa3e3('0x23')][_0xa3e3('0x3f')]()=='TURN'){var _0x36a22c=fs['readFileSync'](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x53')),'utf8');var _0x231ea9=ejs[_0xa3e3('0x46')](_0x36a22c,{'networks':_0x36c5ee||[]});fs[_0xa3e3('0x47')]('/etc/asterisk/turn_xcally.conf',_0x231ea9);return respondWithRpcPromise(_0xa3e3('0x49'),_0xa3e3('0x1d'),{'module':_0xa3e3('0x4a')});}else{var _0x394047=fs[_0xa3e3('0x41')](path[_0xa3e3('0x42')](config[_0xa3e3('0x43')],_0xa3e3('0x4d')),_0xa3e3('0x45'));var _0x5d0bfd=ejs[_0xa3e3('0x46')](_0x394047,{'networks':_0x36c5ee||[]});fs[_0xa3e3('0x47')](util[_0xa3e3('0x4e')](_0xa3e3('0x4f'),_0x26d607[_0xa3e3('0x23')]['toLowerCase']()),_0x5d0bfd);return respondWithRpcPromise('Reload',_0xa3e3('0x1d'),{'module':_0xa3e3('0x51')});}})[_0xa3e3('0x13')](handleError(_0x383110,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 5c37cd0..17c97b8 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 _0x0624=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Network','network'];(function(_0xb74c89,_0x246040){var _0xe4ccef=function(_0x12b652){while(--_0x12b652){_0xb74c89['push'](_0xb74c89['shift']());}};_0xe4ccef(++_0x246040);}(_0x0624,0x132));var _0x4062=function(_0x3c8309,_0x5d2981){_0x3c8309=_0x3c8309-0x0;var _0x11b949=_0x0624[_0x3c8309];return _0x11b949;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4062('0x0'));var BPromise=require(_0x4062('0x1'));var rp=require(_0x4062('0x2'));var fs=require('fs');var path=require(_0x4062('0x3'));var rimraf=require(_0x4062('0x4'));var config=require(_0x4062('0x5'));var attributes=require('./network.attributes');module['exports']=function(_0x353a85,_0x2ec6dd){return _0x353a85[_0x4062('0x6')](_0x4062('0x7'),attributes,{'tableName':_0x4062('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9aea=['Network','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9aea,0xdd));var _0xa9ae=function(_0x3ab191,_0x1615b1){_0x3ab191=_0x3ab191-0x0;var _0x4e05fc=_0x9aea[_0x3ab191];return _0x4e05fc;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var logger=require(_0xa9ae('0x1'))('api');var moment=require(_0xa9ae('0x2'));var BPromise=require(_0xa9ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9ae('0x4'));var rimraf=require(_0xa9ae('0x5'));var config=require(_0xa9ae('0x6'));var attributes=require(_0xa9ae('0x7'));module[_0xa9ae('0x8')]=function(_0x56f942,_0x1aa3b9){return _0x56f942[_0xa9ae('0x9')](_0xa9ae('0xa'),attributes,{'tableName':'network','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 c5cddb7..38a0ed7 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(_0x364afd,_0x233cd8){_0x364afd=_0x364afd-0x0;var _0x26e0d3=_0x7a54[_0x364afd];return _0x26e0d3;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x37448b,_0x1ecd8b){_0x37448b=_0x37448b-0x0;var _0x135d36=_0x7a54[_0x37448b];return _0x135d36;};'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 316884d..e810733 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 _0x8543=['/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','/:id/applications','addApplications','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index'];(function(_0x89b4e4,_0x4d0ba4){var _0x10243c=function(_0x5506bd){while(--_0x5506bd){_0x89b4e4['push'](_0x89b4e4['shift']());}};_0x10243c(++_0x4d0ba4);}(_0x8543,0x1a2));var _0x3854=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8543[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x3854('0x0'));var util=require(_0x3854('0x1'));var path=require(_0x3854('0x2'));var timeout=require(_0x3854('0x3'));var express=require(_0x3854('0x4'));var router=express[_0x3854('0x5')]();var fs_extra=require(_0x3854('0x6'));var auth=require(_0x3854('0x7'));var interaction=require(_0x3854('0x8'));var config=require(_0x3854('0x9'));var controller=require(_0x3854('0xa'));router[_0x3854('0xb')]('/',auth[_0x3854('0xc')](),controller[_0x3854('0xd')]);router['get'](_0x3854('0xe'),auth[_0x3854('0xc')](),controller['describe']);router[_0x3854('0xb')]('/:id',auth[_0x3854('0xc')](),controller[_0x3854('0xf')]);router[_0x3854('0xb')](_0x3854('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3854('0xb')](_0x3854('0x11'),auth[_0x3854('0xc')](),controller[_0x3854('0x12')]);router['get']('/:id/applications',auth[_0x3854('0xc')](),controller['getApplications']);router[_0x3854('0xb')]('/:id/interactions',auth[_0x3854('0xc')](),controller[_0x3854('0x13')]);router[_0x3854('0xb')](_0x3854('0x14'),auth[_0x3854('0xc')](),controller[_0x3854('0x15')]);router[_0x3854('0x16')]('/',auth[_0x3854('0xc')](),controller[_0x3854('0x17')]);router[_0x3854('0x16')](_0x3854('0x10'),auth[_0x3854('0xc')](),controller[_0x3854('0x18')]);router['post'](_0x3854('0x11'),auth[_0x3854('0xc')](),controller['addAnswer']);router['post'](_0x3854('0x19'),controller['notify']);router[_0x3854('0x16')](_0x3854('0x1a'),auth['isAuthenticated'](),controller[_0x3854('0x1b')]);router[_0x3854('0x16')](_0x3854('0x14'),auth[_0x3854('0xc')](),controller[_0x3854('0x1c')]);router[_0x3854('0x16')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x3854('0x1d')](_0x3854('0x1e'),auth[_0x3854('0xc')](),controller[_0x3854('0x1f')]);router[_0x3854('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x3854('0x21')]);router['delete']('/:id/dispositions',auth[_0x3854('0xc')](),controller['removeDispositions']);router[_0x3854('0x20')](_0x3854('0x11'),auth[_0x3854('0xc')](),controller['removeAnswers']);router[_0x3854('0x20')](_0x3854('0x14'),auth[_0x3854('0xc')](),controller[_0x3854('0x22')]);module[_0x3854('0x23')]=router; \ No newline at end of file +var _0xf786=['removeDispositions','removeAgents','multer','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','show','getAnswers','/:id/applications','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','destroy','delete'];(function(_0x492a60,_0x3bfcaf){var _0x401851=function(_0x13a8b1){while(--_0x13a8b1){_0x492a60['push'](_0x492a60['shift']());}};_0x401851(++_0x3bfcaf);}(_0xf786,0x1a2));var _0x6f78=function(_0x1b1049,_0x42b88b){_0x1b1049=_0x1b1049-0x0;var _0x1a3bb8=_0xf786[_0x1b1049];return _0x1a3bb8;};'use strict';var multer=require(_0x6f78('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f78('0x1'));var router=express[_0x6f78('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f78('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x6f78('0x4')](),controller[_0x6f78('0x5')]);router[_0x6f78('0x6')](_0x6f78('0x7'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x8')]);router[_0x6f78('0x6')](_0x6f78('0x9'),auth['isAuthenticated'](),controller[_0x6f78('0xa')]);router[_0x6f78('0x6')]('/:id/dispositions',auth[_0x6f78('0x4')](),controller['getDispositions']);router[_0x6f78('0x6')]('/:id/canned_answers',auth[_0x6f78('0x4')](),controller[_0x6f78('0xb')]);router[_0x6f78('0x6')](_0x6f78('0xc'),auth[_0x6f78('0x4')](),controller['getApplications']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/users',auth[_0x6f78('0x4')](),controller[_0x6f78('0xd')]);router[_0x6f78('0xe')]('/',auth[_0x6f78('0x4')](),controller[_0x6f78('0xf')]);router['post'](_0x6f78('0x10'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x11')]);router[_0x6f78('0xe')](_0x6f78('0x12'),auth[_0x6f78('0x4')](),controller['addAnswer']);router[_0x6f78('0xe')](_0x6f78('0x13'),controller[_0x6f78('0x14')]);router[_0x6f78('0xe')](_0x6f78('0xc'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x15')]);router[_0x6f78('0xe')](_0x6f78('0x16'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x17')]);router[_0x6f78('0xe')](_0x6f78('0x18'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x19')]);router[_0x6f78('0x1a')](_0x6f78('0x9'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x1b')]);router['delete'](_0x6f78('0x9'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x1c')]);router[_0x6f78('0x1d')](_0x6f78('0x10'),auth[_0x6f78('0x4')](),controller[_0x6f78('0x1e')]);router[_0x6f78('0x1d')](_0x6f78('0x12'),auth[_0x6f78('0x4')](),controller['removeAnswers']);router[_0x6f78('0x1d')](_0x6f78('0x16'),auth['isAuthenticated'](),controller[_0x6f78('0x1f')]);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 07f4f5e..8dc6d59 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 _0x9232=['name','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x9232,0x11b));var _0x2923=function(_0x5c8eaa,_0x1ae20){_0x5c8eaa=_0x5c8eaa-0x0;var _0x1de60f=_0x9232[_0x5c8eaa];return _0x1de60f;};'use strict';var Sequelize=require(_0x2923('0x0'));var rs=require(_0x2923('0x1'));module[_0x2923('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2923('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2923('0x4')]},'token':{'type':Sequelize[_0x2923('0x4')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2923('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2923('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2923('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2923('0x4')]},'queueTransfer':{'type':Sequelize[_0x2923('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2923('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2923('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2923('0x9'),'set':function(_0x5285fb){if(!_0x5285fb)this['setDataValue'](_0x2923('0xa'),null);this[_0x2923('0xb')](_0x2923('0xc'),_0x5285fb);}}}; \ No newline at end of file +var _0x174c=['mandatoryDispositionPauseId','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x51187f,_0x800397){var _0xd56167=function(_0xa34071){while(--_0xa34071){_0x51187f['push'](_0x51187f['shift']());}};_0xd56167(++_0x800397);}(_0x174c,0x1d7));var _0xc174=function(_0x2db29c,_0xdfad2c){_0x2db29c=_0x2db29c-0x0;var _0x54a99c=_0x174c[_0x2db29c];return _0x54a99c;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xc174('0x0')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc174('0x0')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc174('0x1')]();}},'replyUri':{'type':Sequelize[_0xc174('0x0')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc174('0x2')],'defaultValue':function(){return _0xc174('0x3');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc174('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc174('0x0')]},'queueTransfer':{'type':Sequelize[_0xc174('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc174('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc174('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc174('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xc174('0x5')],'defaultValue':![],'comment':_0xc174('0x7'),'set':function(_0x5be2f3){if(!_0x5be2f3)this[_0xc174('0x8')](_0xc174('0x9'),null);this[_0xc174('0x8')]('mandatoryDisposition',_0x5be2f3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 6ae9328..f2a2738 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 _0xb079=['ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','Applications','account','applications','orderBy','priority','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','findAndCountAll','getInteractions','fullname','internal','Tags','tag','addAgents','omit','userOpenchannelAccount:save','isArray','emit','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','spread','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','get','OpenchannelAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','body','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','removeDispositions'];(function(_0xd3248f,_0x3d5474){var _0x4f53a7=function(_0x931f73){while(--_0x931f73){_0xd3248f['push'](_0xd3248f['shift']());}};_0x4f53a7(++_0x3d5474);}(_0xb079,0x1c9));var _0x9b07=function(_0x17eedc,_0x5a26ae){_0x17eedc=_0x17eedc-0x0;var _0x4a5767=_0xb079[_0x17eedc];return _0x4a5767;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b07('0x0'));var zipdir=require(_0x9b07('0x1'));var jsonpatch=require(_0x9b07('0x2'));var rp=require(_0x9b07('0x3'));var moment=require(_0x9b07('0x4'));var BPromise=require(_0x9b07('0x5'));var Mustache=require(_0x9b07('0x6'));var util=require(_0x9b07('0x7'));var path=require(_0x9b07('0x8'));var sox=require(_0x9b07('0x9'));var csv=require(_0x9b07('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b07('0xb'));var _=require(_0x9b07('0xc'));var squel=require('squel');var crypto=require(_0x9b07('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b07('0xa'));var querystring=require(_0x9b07('0xe'));var Papa=require(_0x9b07('0xf'));var Redis=require(_0x9b07('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b07('0x11'));var as=require(_0x9b07('0x12'));var hardwareService=require(_0x9b07('0x13'));var logger=require(_0x9b07('0x14'))(_0x9b07('0x15'));var utils=require(_0x9b07('0x16'));var config=require(_0x9b07('0x17'));var licenseUtil=require(_0x9b07('0x18'));var db=require(_0x9b07('0x19'))['db'];config[_0x9b07('0x1a')]=_[_0x9b07('0x1b')](config[_0x9b07('0x1a')],{'host':_0x9b07('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9b07('0x1d'))[_0x9b07('0x1e')](socket);var jayson=require(_0x9b07('0x1f'));var client=jayson[_0x9b07('0x20')][_0x9b07('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x9b07('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x43d4a7,_0x18eda4,_0x50cb56,_0x3433c1){return new BPromise(function(_0x1cddd5,_0x3fe8ae){var _0x130668=_0x3433c1||client;return _0x130668[_0x9b07('0x22')](_0x43d4a7,_0x50cb56)[_0x9b07('0x23')](function(_0x1dfbf1){logger[_0x9b07('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x18eda4,'request\x20sent');logger[_0x9b07('0x25')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x18eda4,_0x9b07('0x26'),JSON['stringify'](_0x1dfbf1));if(_0x1dfbf1[_0x9b07('0x27')]){if(_0x1dfbf1[_0x9b07('0x27')][_0x9b07('0x28')]===0x1f4){logger['error'](_0x9b07('0x29'),_0x18eda4,_0x1dfbf1[_0x9b07('0x27')][_0x9b07('0x2a')]);return _0x3fe8ae(_0x1dfbf1[_0x9b07('0x27')]['message']);}logger[_0x9b07('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x18eda4,_0x1dfbf1[_0x9b07('0x27')][_0x9b07('0x2a')]);return _0x1cddd5(_0x1dfbf1[_0x9b07('0x27')][_0x9b07('0x2a')]);}else{logger[_0x9b07('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x18eda4,_0x9b07('0x26'));_0x1cddd5(_0x1dfbf1['result'][_0x9b07('0x2a')]);}})[_0x9b07('0x2b')](function(_0x518f7c){logger[_0x9b07('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x18eda4,_0x518f7c);_0x3fe8ae(_0x518f7c);});});}function respondWithStatusCode(_0x44e47d,_0x2817d8){_0x2817d8=_0x2817d8||0xcc;return function(_0x2553d9){if(_0x2553d9){return _0x44e47d[_0x9b07('0x2c')](_0x2817d8);}return _0x44e47d[_0x9b07('0x2d')](_0x2817d8)[_0x9b07('0x2e')]();};}function respondWithResult(_0x855dfa,_0x3614a4){_0x3614a4=_0x3614a4||0xc8;return function(_0x3511a3){if(_0x3511a3){return _0x855dfa[_0x9b07('0x2d')](_0x3614a4)[_0x9b07('0x2f')](_0x3511a3);}};}function respondWithFilteredResult(_0x3020b4,_0x758425){return function(_0x1d4040){if(_0x1d4040){var _0x57a197=typeof _0x758425[_0x9b07('0x30')]===_0x9b07('0x31')&&typeof _0x758425[_0x9b07('0x32')]===_0x9b07('0x31');var _0x3ff84c=_0x1d4040[_0x9b07('0x33')];var _0x7fd82=_0x57a197?0x0:_0x758425[_0x9b07('0x30')];var _0x195dac=_0x57a197?_0x1d4040[_0x9b07('0x33')]:_0x758425[_0x9b07('0x30')]+_0x758425[_0x9b07('0x32')];var _0x32c5d0;if(_0x195dac>=_0x3ff84c){_0x195dac=_0x3ff84c;_0x32c5d0=0xc8;}else{_0x32c5d0=0xce;}_0x3020b4['status'](_0x32c5d0);return _0x3020b4[_0x9b07('0x34')](_0x9b07('0x35'),_0x7fd82+'-'+_0x195dac+'/'+_0x3ff84c)[_0x9b07('0x2f')](_0x1d4040);}return null;};}function patchUpdates(_0x30f93b){return function(_0x722a70){try{jsonpatch[_0x9b07('0x36')](_0x722a70,_0x30f93b,!![]);}catch(_0x13186a){return BPromise[_0x9b07('0x37')](_0x13186a);}return _0x722a70['save']();};}function saveUpdates(_0x114ea6,_0x2a1c27){return function(_0x2ca01b){if(_0x2ca01b){return _0x2ca01b['update'](_0x114ea6)['then'](function(_0x11eba1){return _0x11eba1;});}return null;};}function removeEntity(_0x3d3ef6,_0x5d00da){return function(_0x38de38){if(_0x38de38){return _0x38de38['destroy']()[_0x9b07('0x23')](function(){var _0x14104a=_0x38de38[_0x9b07('0x38')]({'plain':!![]});var _0x199e14=_0x9b07('0x39');return db['UserProfileResource'][_0x9b07('0x3a')]({'where':{'type':_0x199e14,'resourceId':_0x14104a['id']}})[_0x9b07('0x23')](function(){return _0x38de38;});})[_0x9b07('0x23')](function(){_0x3d3ef6[_0x9b07('0x2d')](0xcc)[_0x9b07('0x2e')]();});}};}function handleEntityNotFound(_0xeb08f8,_0x3ba628){return function(_0x33c9f8){if(!_0x33c9f8){_0xeb08f8[_0x9b07('0x2c')](0x194);}return _0x33c9f8;};}function handleError(_0x54defd,_0x5370e1){_0x5370e1=_0x5370e1||0x1f4;return function(_0x24332c){logger[_0x9b07('0x27')](_0x24332c[_0x9b07('0x3b')]);if(_0x24332c[_0x9b07('0x3c')]){delete _0x24332c['name'];}_0x54defd[_0x9b07('0x2d')](_0x5370e1)[_0x9b07('0x3d')](_0x24332c);};}exports[_0x9b07('0x3e')]=function(_0x3be375,_0x5b7a97){var _0x3adcc1={'include':[{'model':db[_0x9b07('0x3f')],'as':_0x9b07('0x40')}]},_0x29c183={},_0x2d0c06={'count':0x0,'rows':[]};var _0x43281f=_['map'](db[_0x9b07('0x41')][_0x9b07('0x42')],function(_0x2b4536){return{'name':_0x2b4536[_0x9b07('0x43')],'type':_0x2b4536[_0x9b07('0x44')][_0x9b07('0x45')]};});_0x29c183[_0x9b07('0x46')]=_[_0x9b07('0x47')](_0x43281f,_0x9b07('0x3c'));_0x29c183[_0x9b07('0x48')]=_[_0x9b07('0x49')](_0x3be375['query']);_0x29c183[_0x9b07('0x4a')]=_[_0x9b07('0x4b')](_0x29c183[_0x9b07('0x46')],_0x29c183[_0x9b07('0x48')]);_0x3adcc1[_0x9b07('0x4c')]=_[_0x9b07('0x4b')](_0x29c183[_0x9b07('0x46')],qs[_0x9b07('0x4d')](_0x3be375[_0x9b07('0x48')][_0x9b07('0x4d')]));_0x3adcc1[_0x9b07('0x4c')]=_0x3adcc1[_0x9b07('0x4c')][_0x9b07('0x4e')]?_0x3adcc1[_0x9b07('0x4c')]:_0x29c183[_0x9b07('0x46')];if(!_0x3be375[_0x9b07('0x48')][_0x9b07('0x4f')](_0x9b07('0x50'))){_0x3adcc1['limit']=qs[_0x9b07('0x32')](_0x3be375[_0x9b07('0x48')][_0x9b07('0x32')]);_0x3adcc1[_0x9b07('0x30')]=qs[_0x9b07('0x30')](_0x3be375[_0x9b07('0x48')][_0x9b07('0x30')]);}_0x3adcc1[_0x9b07('0x51')]=qs[_0x9b07('0x52')](_0x3be375['query']['sort']);_0x3adcc1[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_[_0x9b07('0x54')](_0x3be375[_0x9b07('0x48')],_0x29c183[_0x9b07('0x4a')]),_0x43281f);if(_0x3be375[_0x9b07('0x48')][_0x9b07('0x55')]){_0x3adcc1[_0x9b07('0x53')]=_[_0x9b07('0x56')](_0x3adcc1[_0x9b07('0x53')],{'$or':_[_0x9b07('0x47')](_0x43281f,function(_0x5ced29){if(_0x5ced29['type']!==_0x9b07('0x57')){var _0xbd465={};_0xbd465[_0x5ced29[_0x9b07('0x3c')]]={'$like':'%'+_0x3be375['query'][_0x9b07('0x55')]+'%'};return _0xbd465;}})});}_0x3adcc1=_['merge']({},_0x3adcc1,_0x3be375['options']);var _0x1d60be={'where':_0x3adcc1[_0x9b07('0x53')]};return db['OpenchannelAccount'][_0x9b07('0x33')](_0x1d60be)['then'](function(_0x1c14bf){_0x2d0c06[_0x9b07('0x33')]=_0x1c14bf;if(_0x3be375['query'][_0x9b07('0x58')]){_0x3adcc1[_0x9b07('0x59')]=[{'all':!![]}];}return db[_0x9b07('0x41')][_0x9b07('0x5a')](_0x3adcc1);})[_0x9b07('0x23')](function(_0x255195){_0x2d0c06[_0x9b07('0x5b')]=_0x255195;return _0x2d0c06;})[_0x9b07('0x23')](respondWithFilteredResult(_0x5b7a97,_0x3adcc1))[_0x9b07('0x2b')](handleError(_0x5b7a97,null));};exports[_0x9b07('0x5c')]=function(_0xc3f71f,_0x3f3fff){var _0x22d8a0={'raw':![],'where':{'id':_0xc3f71f[_0x9b07('0x5d')]['id']},'include':[{'model':db[_0x9b07('0x3f')],'as':_0x9b07('0x40')}]},_0x361be5={};_0x361be5[_0x9b07('0x46')]=_[_0x9b07('0x49')](db[_0x9b07('0x41')][_0x9b07('0x42')]);_0x361be5[_0x9b07('0x48')]=_[_0x9b07('0x49')](_0xc3f71f[_0x9b07('0x48')]);_0x361be5[_0x9b07('0x4a')]=_['intersection'](_0x361be5[_0x9b07('0x46')],_0x361be5[_0x9b07('0x48')]);_0x22d8a0[_0x9b07('0x4c')]=_[_0x9b07('0x4b')](_0x361be5[_0x9b07('0x46')],qs[_0x9b07('0x4d')](_0xc3f71f[_0x9b07('0x48')]['fields']));_0x22d8a0[_0x9b07('0x4c')]=_0x22d8a0[_0x9b07('0x4c')][_0x9b07('0x4e')]?_0x22d8a0[_0x9b07('0x4c')]:_0x361be5[_0x9b07('0x46')];if(_0xc3f71f[_0x9b07('0x48')][_0x9b07('0x58')]){_0x22d8a0[_0x9b07('0x59')]=[{'all':!![]}];}_0x22d8a0=_[_0x9b07('0x56')]({},_0x22d8a0,_0xc3f71f[_0x9b07('0x5e')]);return db['OpenchannelAccount'][_0x9b07('0x5f')](_0x22d8a0)[_0x9b07('0x23')](handleEntityNotFound(_0x3f3fff,null))[_0x9b07('0x23')](respondWithResult(_0x3f3fff,null))[_0x9b07('0x2b')](handleError(_0x3f3fff,null));};exports[_0x9b07('0x60')]=function(_0x1e52f3,_0xa1285e){return db[_0x9b07('0x41')][_0x9b07('0x60')](_0x1e52f3['body'],{})[_0x9b07('0x23')](function(_0x32afb2){var _0x48f1a6=_0x1e52f3[_0x9b07('0x61')][_0x9b07('0x38')]({'plain':!![]});if(!_0x48f1a6)throw new Error(_0x9b07('0x62'));if(_0x48f1a6[_0x9b07('0x63')]===_0x9b07('0x61')){var _0x345bc4=_0x32afb2[_0x9b07('0x38')]({'plain':!![]});var _0x40d411=_0x9b07('0x39');return db[_0x9b07('0x64')]['find']({'where':{'name':_0x40d411,'userProfileId':_0x48f1a6['userProfileId']},'raw':!![]})[_0x9b07('0x23')](function(_0x1ed6fc){if(_0x1ed6fc&&_0x1ed6fc[_0x9b07('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x345bc4[_0x9b07('0x3c')],'resourceId':_0x345bc4['id'],'type':_0x1ed6fc[_0x9b07('0x3c')],'sectionId':_0x1ed6fc['id']},{})['then'](function(){return _0x32afb2;});}else{return _0x32afb2;}})[_0x9b07('0x2b')](function(_0x25a867){logger[_0x9b07('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25a867);throw _0x25a867;});}return _0x32afb2;})[_0x9b07('0x23')](respondWithResult(_0xa1285e,0xc9))[_0x9b07('0x2b')](handleError(_0xa1285e,null));};exports[_0x9b07('0x66')]=function(_0x2fa32a,_0x59ccfa){if(_0x2fa32a[_0x9b07('0x67')]['id']){delete _0x2fa32a['body']['id'];}return db['OpenchannelAccount'][_0x9b07('0x5f')]({'where':{'id':_0x2fa32a[_0x9b07('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x9b07('0x40')}]})[_0x9b07('0x23')](handleEntityNotFound(_0x59ccfa,null))[_0x9b07('0x23')](saveUpdates(_0x2fa32a[_0x9b07('0x67')],null))[_0x9b07('0x23')](respondWithResult(_0x59ccfa,null))[_0x9b07('0x2b')](handleError(_0x59ccfa,null));};exports[_0x9b07('0x3a')]=function(_0x207d35,_0x11657d){return db['OpenchannelAccount'][_0x9b07('0x5f')]({'where':{'id':_0x207d35[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x11657d,null))[_0x9b07('0x23')](removeEntity(_0x11657d,null))[_0x9b07('0x2b')](handleError(_0x11657d,null));};exports[_0x9b07('0x68')]=function(_0x5036ce,_0x4ea498){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x4ea498,null))[_0x9b07('0x2b')](handleError(_0x4ea498,null));};exports[_0x9b07('0x69')]=function(_0xd9cec1,_0x528bec,_0x528cda){if(_0xd9cec1[_0x9b07('0x67')]['id']){delete _0xd9cec1['body']['id'];}return db[_0x9b07('0x41')][_0x9b07('0x5f')]({'where':{'id':_0xd9cec1[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x528bec,null))[_0x9b07('0x23')](function(_0x11d6bc){if(_0x11d6bc){_0xd9cec1[_0x9b07('0x67')]['OpenchannelAccountId']=_0x11d6bc['id'];return db[_0x9b07('0x6a')][_0x9b07('0x60')](_0xd9cec1[_0x9b07('0x67')]);}})[_0x9b07('0x23')](respondWithResult(_0x528bec,null))[_0x9b07('0x2b')](handleError(_0x528bec,null));};exports[_0x9b07('0x6b')]=function(_0x1e98e6,_0x1a60e6,_0x84bc09){var _0x172157={'raw':![],'where':{}};var _0x3b6c9a={};var _0x3ffbbe={'count':0x0,'rows':[]};return db[_0x9b07('0x41')]['findOne']({'where':{'id':_0x1e98e6[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x1a60e6,null))['then'](function(_0x2d5170){if(_0x2d5170){_0x3b6c9a[_0x9b07('0x46')]=_[_0x9b07('0x49')](db['Disposition']['rawAttributes']);_0x3b6c9a[_0x9b07('0x48')]=_[_0x9b07('0x49')](_0x1e98e6[_0x9b07('0x48')]);_0x3b6c9a[_0x9b07('0x4a')]=_[_0x9b07('0x4b')](_0x3b6c9a['model'],_0x3b6c9a[_0x9b07('0x48')]);_0x172157[_0x9b07('0x4c')]=_['intersection'](_0x3b6c9a[_0x9b07('0x46')],qs[_0x9b07('0x4d')](_0x1e98e6[_0x9b07('0x48')][_0x9b07('0x4d')]));_0x172157[_0x9b07('0x4c')]=_0x172157[_0x9b07('0x4c')][_0x9b07('0x4e')]?_0x172157[_0x9b07('0x4c')]:_0x3b6c9a[_0x9b07('0x46')];if(!_0x1e98e6['query']['hasOwnProperty'](_0x9b07('0x50'))){_0x172157['limit']=qs['limit'](_0x1e98e6[_0x9b07('0x48')][_0x9b07('0x32')]);_0x172157[_0x9b07('0x30')]=qs[_0x9b07('0x30')](_0x1e98e6[_0x9b07('0x48')][_0x9b07('0x30')]);}_0x172157[_0x9b07('0x51')]=qs[_0x9b07('0x52')](_0x1e98e6[_0x9b07('0x48')][_0x9b07('0x52')]);_0x172157[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_[_0x9b07('0x54')](_0x1e98e6[_0x9b07('0x48')],_0x3b6c9a[_0x9b07('0x4a')]));_0x172157[_0x9b07('0x53')][_0x9b07('0x6c')]=_0x2d5170['id'];if(_0x1e98e6[_0x9b07('0x48')][_0x9b07('0x55')]){_0x172157[_0x9b07('0x53')]=_[_0x9b07('0x56')](_0x172157[_0x9b07('0x53')],{'$or':_[_0x9b07('0x47')](_0x172157['attributes'],function(_0x3de431){var _0x398510={};_0x398510[_0x3de431]={'$like':'%'+_0x1e98e6['query'][_0x9b07('0x55')]+'%'};return _0x398510;})});}_0x172157=_[_0x9b07('0x56')]({},_0x172157,_0x1e98e6[_0x9b07('0x5e')]);return db[_0x9b07('0x6a')][_0x9b07('0x33')]({'where':_0x172157[_0x9b07('0x53')]})[_0x9b07('0x23')](function(_0x5bc01b){_0x3ffbbe[_0x9b07('0x33')]=_0x5bc01b;if(_0x1e98e6[_0x9b07('0x48')]['includeAll']){_0x172157[_0x9b07('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x9b07('0x5a')](_0x172157);})[_0x9b07('0x23')](function(_0x56335d){_0x3ffbbe[_0x9b07('0x5b')]=_0x56335d;return _0x3ffbbe;});}})['then'](respondWithFilteredResult(_0x1a60e6,_0x172157))[_0x9b07('0x2b')](handleError(_0x1a60e6,null));};exports[_0x9b07('0x6d')]=function(_0x49dad5,_0x31d384,_0x5482d7){return db[_0x9b07('0x41')][_0x9b07('0x5f')]({'where':{'id':_0x49dad5[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x31d384,null))[_0x9b07('0x23')](function(_0x4959de){if(_0x4959de){return _0x4959de['removeDispositions'](_0x49dad5[_0x9b07('0x48')][_0x9b07('0x6e')]);}})[_0x9b07('0x23')](respondWithStatusCode(_0x31d384,null))[_0x9b07('0x2b')](handleError(_0x31d384,null));};exports[_0x9b07('0x6f')]=function(_0x18104c,_0xf11b0b,_0xe80f9){if(_0x18104c[_0x9b07('0x67')]['id']){delete _0x18104c['body']['id'];}return db['OpenchannelAccount'][_0x9b07('0x5f')]({'where':{'id':_0x18104c[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0xf11b0b,null))[_0x9b07('0x23')](function(_0x2f56be){if(_0x2f56be){_0x18104c[_0x9b07('0x67')]['OpenchannelAccountId']=_0x2f56be['id'];return db[_0x9b07('0x70')][_0x9b07('0x60')](_0x18104c[_0x9b07('0x67')]);}})[_0x9b07('0x23')](respondWithResult(_0xf11b0b,null))['catch'](handleError(_0xf11b0b,null));};exports[_0x9b07('0x71')]=function(_0x50bbf3,_0x2c4c9e,_0x4e7561){var _0x4b6286={'raw':![],'where':{}};var _0xd97a32={};var _0x46a8fc={'count':0x0,'rows':[]};return db[_0x9b07('0x41')][_0x9b07('0x72')]({'where':{'id':_0x50bbf3[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x2c4c9e,null))[_0x9b07('0x23')](function(_0x54636e){if(_0x54636e){_0xd97a32[_0x9b07('0x46')]=_[_0x9b07('0x49')](db[_0x9b07('0x70')]['rawAttributes']);_0xd97a32[_0x9b07('0x48')]=_['keys'](_0x50bbf3[_0x9b07('0x48')]);_0xd97a32['filters']=_[_0x9b07('0x4b')](_0xd97a32[_0x9b07('0x46')],_0xd97a32[_0x9b07('0x48')]);_0x4b6286[_0x9b07('0x4c')]=_['intersection'](_0xd97a32[_0x9b07('0x46')],qs['fields'](_0x50bbf3['query'][_0x9b07('0x4d')]));_0x4b6286[_0x9b07('0x4c')]=_0x4b6286[_0x9b07('0x4c')]['length']?_0x4b6286[_0x9b07('0x4c')]:_0xd97a32[_0x9b07('0x46')];if(!_0x50bbf3[_0x9b07('0x48')][_0x9b07('0x4f')](_0x9b07('0x50'))){_0x4b6286[_0x9b07('0x32')]=qs[_0x9b07('0x32')](_0x50bbf3['query'][_0x9b07('0x32')]);_0x4b6286[_0x9b07('0x30')]=qs[_0x9b07('0x30')](_0x50bbf3[_0x9b07('0x48')]['offset']);}_0x4b6286[_0x9b07('0x51')]=qs[_0x9b07('0x52')](_0x50bbf3[_0x9b07('0x48')][_0x9b07('0x52')]);_0x4b6286[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_['pick'](_0x50bbf3[_0x9b07('0x48')],_0xd97a32[_0x9b07('0x4a')]));_0x4b6286[_0x9b07('0x53')][_0x9b07('0x6c')]=_0x54636e['id'];if(_0x50bbf3[_0x9b07('0x48')][_0x9b07('0x55')]){_0x4b6286[_0x9b07('0x53')]=_['merge'](_0x4b6286[_0x9b07('0x53')],{'$or':_[_0x9b07('0x47')](_0x4b6286[_0x9b07('0x4c')],function(_0x48f7d7){var _0x4a0be4={};_0x4a0be4[_0x48f7d7]={'$like':'%'+_0x50bbf3[_0x9b07('0x48')]['filter']+'%'};return _0x4a0be4;})});}_0x4b6286=_['merge']({},_0x4b6286,_0x50bbf3[_0x9b07('0x5e')]);return db[_0x9b07('0x70')][_0x9b07('0x33')]({'where':_0x4b6286[_0x9b07('0x53')]})[_0x9b07('0x23')](function(_0x41e058){_0x46a8fc[_0x9b07('0x33')]=_0x41e058;if(_0x50bbf3[_0x9b07('0x48')][_0x9b07('0x58')]){_0x4b6286['include']=[{'all':!![]}];}return db[_0x9b07('0x70')][_0x9b07('0x5a')](_0x4b6286);})[_0x9b07('0x23')](function(_0x126aa7){_0x46a8fc[_0x9b07('0x5b')]=_0x126aa7;return _0x46a8fc;});}})[_0x9b07('0x23')](respondWithFilteredResult(_0x2c4c9e,_0x4b6286))[_0x9b07('0x2b')](handleError(_0x2c4c9e,null));};exports[_0x9b07('0x73')]=function(_0x3a2760,_0x153b40,_0x2c5a99){return db[_0x9b07('0x41')]['find']({'where':{'id':_0x3a2760[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x153b40,null))[_0x9b07('0x23')](function(_0x2c68a6){if(_0x2c68a6){return _0x2c68a6[_0x9b07('0x73')](_0x3a2760[_0x9b07('0x48')]['ids']);}})[_0x9b07('0x23')](respondWithStatusCode(_0x153b40,null))['catch'](handleError(_0x153b40,null));};exports[_0x9b07('0x74')]=function(_0x49c34a,_0x14561b,_0x18dcff){var _0x336952={'body':_0x49c34a[_0x9b07('0x67')],'channel':'openchannel'};var _0x1e9bd8=[];var _0x44e53d=[];var _0x101876={};var _0x19a290=![];return db[_0x9b07('0x75')][_0x9b07('0x68')]()[_0x9b07('0x23')](function(_0x39f621){if(!_0x39f621){throw new db[(_0x9b07('0x76'))][(_0x9b07('0x77'))](_0x9b07('0x78'));}_0x1e9bd8=_[_0x9b07('0x79')](_['keys'](_0x39f621),[_0x9b07('0x7a'),_0x9b07('0x7b')]);_0x44e53d=_[_0x9b07('0x79')](_[_0x9b07('0x49')](_0x39f621),[_0x9b07('0x7a'),_0x9b07('0x7b'),_0x9b07('0x7c'),_0x9b07('0x7d')]);if(_0x49c34a[_0x9b07('0x67')]['id']){delete _0x49c34a['body']['id'];}if(_[_0x9b07('0x7e')](_0x49c34a[_0x9b07('0x67')]['from'])){throw new db[(_0x9b07('0x76'))][(_0x9b07('0x77'))](_0x9b07('0x7f'));}if(_[_0x9b07('0x7e')](_0x49c34a[_0x9b07('0x67')][_0x9b07('0x67')])||_0x49c34a[_0x9b07('0x67')]['body']===''){throw new db[(_0x9b07('0x76'))][(_0x9b07('0x77'))](_0x9b07('0x80'));}if(_[_0x9b07('0x7e')](_0x49c34a[_0x9b07('0x67')][_0x9b07('0x81')])){throw new db['Sequelize'][(_0x9b07('0x77'))](_0x9b07('0x82')+_0x44e53d);}if(!_[_0x9b07('0x83')](_0x44e53d,_0x49c34a[_0x9b07('0x67')][_0x9b07('0x81')])){throw new db[(_0x9b07('0x76'))][(_0x9b07('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44e53d);}_0x101876[_0x49c34a[_0x9b07('0x67')][_0x9b07('0x81')]]=_0x49c34a[_0x9b07('0x67')]['from'];})[_0x9b07('0x23')](function(){return db[_0x9b07('0x41')][_0x9b07('0x5f')]({'where':{'id':_0x49c34a['params']['id']},'include':[{'model':db[_0x9b07('0x84')],'as':_0x9b07('0x85'),'include':[{'model':db[_0x9b07('0x75')],'as':_0x9b07('0x86'),'where':_0x101876,'limit':0x1,'order':[[_0x9b07('0x7b'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x9b07('0x87')}]});})[_0x9b07('0x23')](handleEntityNotFound(_0x14561b,null))[_0x9b07('0x23')](function(_0x47622c){if(_0x47622c&&_0x47622c['List']){_0x336952[_0x9b07('0x88')]=_0x47622c;_0x336952[_0x9b07('0x89')]=_0x47622c[_0x9b07('0x87')];_0x336952['list']=_0x47622c[_0x9b07('0x85')];_0x336952[_0x9b07('0x89')]=_[_0x9b07('0x8a')](_0x336952[_0x9b07('0x89')],[_0x9b07('0x8b')],['asc']);if(_0x336952[_0x9b07('0x88')]['Applications']){delete _0x336952['account'][_0x9b07('0x87')];}if(_0x336952['account'][_0x9b07('0x85')]&&_0x336952[_0x9b07('0x88')][_0x9b07('0x85')]['Contacts']['length']){return _0x336952[_0x9b07('0x88')]['List']['Contacts'][0x0];}var _0x166b89=_[_0x9b07('0x1b')](_0x49c34a[_0x9b07('0x67')],{'firstName':_0x49c34a[_0x9b07('0x67')][_0x9b07('0x8c')],'ListId':_0x47622c[_0x9b07('0x7d')]});_0x166b89[_0x49c34a[_0x9b07('0x67')][_0x9b07('0x81')]]=_0x49c34a[_0x9b07('0x67')][_0x9b07('0x8c')];return db['CmContact'][_0x9b07('0x60')](_0x166b89,{'fields':_0x1e9bd8,'raw':!![]});}})[_0x9b07('0x23')](handleEntityNotFound(_0x14561b,null))[_0x9b07('0x23')](function(_0x37cf56){_0x336952[_0x9b07('0x8d')]=_0x37cf56;if(_0x37cf56){var _0x1e1916={'ContactId':_0x37cf56['id'],'OpenchannelAccountId':_0x49c34a[_0x9b07('0x5d')]['id'],'from':(_0x37cf56[_0x9b07('0x8e')]||'')+'\x20'+(_0x37cf56[_0x9b07('0x8f')]||'')};var _0x1b3cf3={'OpenchannelAccountId':_0x49c34a[_0x9b07('0x5d')]['id'],'closed':![]};if(_0x49c34a[_0x9b07('0x67')][_0x9b07('0x90')]){_0x1b3cf3['threadId']=_0x49c34a[_0x9b07('0x67')]['threadId'];return db[_0x9b07('0x91')]['find']({'where':_0x1b3cf3})[_0x9b07('0x23')](function(_0x8eddef){if(_0x8eddef){return[_0x8eddef,![]];}_0x1e1916[_0x9b07('0x90')]=_0x49c34a['body']['threadId'];_0x1e1916[_0x9b07('0x92')]=_0x49c34a['body'][_0x9b07('0x92')];return db[_0x9b07('0x91')][_0x9b07('0x60')](_0x1e1916)[_0x9b07('0x23')](function(_0x2da143){return[_0x2da143,!![]];});});}else{_0x1b3cf3['threadId']=null;}_0x1b3cf3[_0x9b07('0x93')]=_0x37cf56['id'];return db['OpenchannelInteraction']['find']({'where':_0x1b3cf3})['then'](function(_0x3979bb){if(_0x3979bb){return[_0x3979bb,![]];}return db[_0x9b07('0x91')][_0x9b07('0x60')](_0x1e1916)[_0x9b07('0x23')](function(_0x3d42ae){return[_0x3d42ae,!![]];});});}})['spread'](function(_0x5af9fb,_0x3bc0e3){if(_0x5af9fb){_0x19a290=_0x3bc0e3;if(!_0x3bc0e3){var _0x489fad={'from':(_0x336952['contact'][_0x9b07('0x8e')]||'')+'\x20'+(_0x336952[_0x9b07('0x8d')][_0x9b07('0x8f')]||'')};if(_0x49c34a[_0x9b07('0x67')][_0x9b07('0x90')]&&_0x49c34a[_0x9b07('0x67')][_0x9b07('0x94')]&&_0x49c34a[_0x9b07('0x67')][_0x9b07('0x90')]!=_0x49c34a['body'][_0x9b07('0x94')]){_0x489fad[_0x9b07('0x90')]=_0x49c34a['body'][_0x9b07('0x94')];}return _0x5af9fb[_0x9b07('0x66')](_0x489fad);}else{return _0x5af9fb;}}})[_0x9b07('0x23')](function(_0x2cc448){_0x336952['interaction']=_0x2cc448[_0x9b07('0x38')]({'plain':!![]});_0x336952[_0x9b07('0x95')][_0x9b07('0x96')]=_0x19a290;if(_0x336952[_0x9b07('0x95')][_0x9b07('0x96')]){if(_0x336952[_0x9b07('0x88')][_0x9b07('0x97')]){_0x336952['applications'][_0x9b07('0x98')]({'id':0x0,'priority':_0x336952[_0x9b07('0x89')][_0x9b07('0x4e')]+0x1,'app':_0x9b07('0x99'),'appdata':'unmanaged','interval':_0x9b07('0x9a')});}}return db[_0x9b07('0x9b')][_0x9b07('0x60')]({'body':_0x49c34a[_0x9b07('0x67')][_0x9b07('0x67')],'OpenchannelAccountId':_0x49c34a[_0x9b07('0x5d')]['id'],'OpenchannelInteractionId':_0x2cc448['id'],'direction':'in','ContactId':_0x336952[_0x9b07('0x8d')]['id'],'AttachmentId':_0x49c34a[_0x9b07('0x67')][_0x9b07('0x9c')]});})['then'](function(_0x4d3909){_0x336952[_0x9b07('0x2a')]=_0x4d3909;if(_0x336952['interaction'][_0x9b07('0x9d')]){return db[_0x9b07('0x9e')]['find']({'attributes':['id',_0x9b07('0x3c')],'where':{'id':_0x336952[_0x9b07('0x95')][_0x9b07('0x9d')]}})[_0x9b07('0x23')](function(_0x332028){if(_0x332028){_0x336952[_0x9b07('0x89')][_0x9b07('0x9f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x332028[_0x9b07('0x3c')]+','+(_0x336952['account'][_0x9b07('0xa0')]||0xa),'interval':_0x9b07('0x9a')});_0x336952[_0x9b07('0xa1')]=![];}return respondWithRpcPromise('Start',_0x9b07('0xa2'),_0x336952);});}return respondWithRpcPromise('Start',_0x9b07('0xa2'),_0x336952);})['then'](function(_0x5a3492){respondWithRpcPromise('EventManager',_0x9b07('0xa3'),{'event':_0x9b07('0x74'),'message':_0x5a3492},client9002);return _0x5a3492;})[_0x9b07('0x23')](respondWithResult(_0x14561b,null))[_0x9b07('0x2b')](handleError(_0x14561b,null));};exports[_0x9b07('0xa4')]=function(_0x4ddba0,_0x4089ae){var _0x14ef0d=_0x4ddba0[_0x9b07('0x5d')]['id'];var _0x1692ac=_0x4ddba0['body'];var _0x5105a7=0xc8;var _0x333178=null;return db[_0x9b07('0xa5')][_0x9b07('0xa6')]({'isolationLevel':db[_0x9b07('0xa5')][_0x9b07('0xa7')][_0x9b07('0xa8')][_0x9b07('0xa9')]},function(_0x581bb1){return db['OpenchannelAccount'][_0x9b07('0x72')]({'where':{'id':_0x14ef0d},'transaction':_0x581bb1})[_0x9b07('0x23')](function(_0x50cbde){if(_0x50cbde){return db['OpenchannelApplication'][_0x9b07('0x3a')]({'where':{'OpenchannelAccountId':_0x14ef0d},'transaction':_0x581bb1})[_0x9b07('0x23')](function(){var _0x3419f5=_[_0x9b07('0x47')](_0x1692ac,function(_0x580688){_0x580688[_0x9b07('0x6c')]=_0x14ef0d;return _0x580688;});return db[_0x9b07('0xaa')]['bulkCreate'](_0x3419f5,{'transaction':_0x581bb1});});}else{_0x5105a7=0x194;_0x333178=[];}});})['then'](function(){if(_0x5105a7!==0x194){return db[_0x9b07('0xaa')][_0x9b07('0xab')]({'where':{'OpenchannelAccountId':_0x14ef0d},'order':'priority'})['then'](function(_0x2a0e18){_0x333178=_0x2a0e18;});}})[_0x9b07('0x2b')](function(_0x4e500b){_0x5105a7=0x1f4;logger[_0x9b07('0x27')](_0x4e500b[_0x9b07('0x3b')]);if(_0x4e500b[_0x9b07('0x3c')]){delete _0x4e500b[_0x9b07('0x3c')];}_0x333178=_0x4e500b;})['finally'](function(){if(_0x333178===null){_0x4089ae[_0x9b07('0x2c')](_0x5105a7);}else{if(_0x5105a7===0x1f4){_0x4089ae[_0x9b07('0x2d')](_0x5105a7)[_0x9b07('0x3d')](_0x333178);}else{_0x4089ae[_0x9b07('0x2d')](_0x5105a7)[_0x9b07('0x2f')](_0x333178);}}});};exports['getApplications']=function(_0x386ded,_0x2a2422,_0x53d6e9){var _0x16831f={};var _0x38c62e={};var _0x930a23;var _0x3cf28b;return db['OpenchannelAccount'][_0x9b07('0x72')]({'where':{'id':_0x386ded[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x2a2422,null))[_0x9b07('0x23')](function(_0x26ee60){if(_0x26ee60){_0x930a23=_0x26ee60;_0x38c62e['model']=_[_0x9b07('0x49')](db['OpenchannelApplication'][_0x9b07('0x42')]);_0x38c62e['query']=_[_0x9b07('0x49')](_0x386ded[_0x9b07('0x48')]);_0x38c62e['filters']=_[_0x9b07('0x4b')](_0x38c62e[_0x9b07('0x46')],_0x38c62e['query']);_0x16831f[_0x9b07('0x4c')]=_[_0x9b07('0x4b')](_0x38c62e[_0x9b07('0x46')],qs['fields'](_0x386ded[_0x9b07('0x48')][_0x9b07('0x4d')]));_0x16831f[_0x9b07('0x4c')]=_0x16831f[_0x9b07('0x4c')][_0x9b07('0x4e')]?_0x16831f[_0x9b07('0x4c')]:_0x38c62e[_0x9b07('0x46')];_0x16831f[_0x9b07('0x51')]=qs[_0x9b07('0x52')](_0x386ded['query']['sort']);_0x16831f[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_[_0x9b07('0x54')](_0x386ded[_0x9b07('0x48')],_0x38c62e[_0x9b07('0x4a')]));if(_0x386ded['query'][_0x9b07('0x55')]){_0x16831f['where']=_[_0x9b07('0x56')](_0x16831f[_0x9b07('0x53')],{'$or':_[_0x9b07('0x47')](_0x16831f[_0x9b07('0x4c')],function(_0x59a11a){var _0x20aafc={};_0x20aafc[_0x59a11a]={'$like':'%'+_0x386ded['query'][_0x9b07('0x55')]+'%'};return _0x20aafc;})});}_0x16831f=_[_0x9b07('0x56')]({},_0x16831f,_0x386ded['options']);return _0x930a23['getApplications'](_0x16831f);}})['then'](function(_0x242be3){if(_0x242be3){_0x3cf28b=_0x242be3['length'];if(!_0x386ded[_0x9b07('0x48')][_0x9b07('0x4f')](_0x9b07('0x50'))){_0x16831f[_0x9b07('0x32')]=qs['limit'](_0x386ded['query'][_0x9b07('0x32')]);_0x16831f['offset']=qs[_0x9b07('0x30')](_0x386ded[_0x9b07('0x48')][_0x9b07('0x30')]);}return _0x930a23['getApplications'](_0x16831f);}})[_0x9b07('0x23')](function(_0x4adbce){if(_0x4adbce){return _0x4adbce?{'count':_0x3cf28b,'rows':_0x4adbce}:null;}})[_0x9b07('0x23')](respondWithResult(_0x2a2422,null))[_0x9b07('0x2b')](handleError(_0x2a2422,null));};exports[_0x9b07('0xac')]=function(_0x425cad,_0x3ed5ee,_0x34cbbc){var _0x1f9345={'raw':![],'where':{}};var _0x23403c={};var _0x3b9ea1={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x425cad[_0x9b07('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ed5ee,null))['then'](function(_0x5b8a75){if(_0x5b8a75){_0x23403c[_0x9b07('0x46')]=_['keys'](db[_0x9b07('0x91')][_0x9b07('0x42')]);_0x23403c[_0x9b07('0x48')]=_[_0x9b07('0x49')](_0x425cad[_0x9b07('0x48')]);_0x23403c[_0x9b07('0x4a')]=_[_0x9b07('0x4b')](_0x23403c[_0x9b07('0x46')],_0x23403c[_0x9b07('0x48')]);_0x1f9345['attributes']=_[_0x9b07('0x4b')](_0x23403c[_0x9b07('0x46')],qs[_0x9b07('0x4d')](_0x425cad[_0x9b07('0x48')]['fields']));_0x1f9345[_0x9b07('0x4c')]=_0x1f9345[_0x9b07('0x4c')][_0x9b07('0x4e')]?_0x1f9345['attributes']:_0x23403c['model'];if(!_0x425cad[_0x9b07('0x48')][_0x9b07('0x4f')](_0x9b07('0x50'))){_0x1f9345[_0x9b07('0x32')]=qs[_0x9b07('0x32')](_0x425cad['query']['limit']);_0x1f9345[_0x9b07('0x30')]=qs[_0x9b07('0x30')](_0x425cad[_0x9b07('0x48')][_0x9b07('0x30')]);}_0x1f9345['order']=qs[_0x9b07('0x52')](_0x425cad['query'][_0x9b07('0x52')]);_0x1f9345[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_['pick'](_0x425cad['query'],_0x23403c[_0x9b07('0x4a')]));_0x1f9345[_0x9b07('0x53')][_0x9b07('0x6c')]=_0x5b8a75['id'];if(_0x425cad[_0x9b07('0x48')][_0x9b07('0x55')]){_0x1f9345['where']=_[_0x9b07('0x56')](_0x1f9345[_0x9b07('0x53')],{'$or':_[_0x9b07('0x47')](_0x1f9345[_0x9b07('0x4c')],function(_0x407e6f){var _0x8d44fb={};_0x8d44fb[_0x407e6f]={'$like':'%'+_0x425cad[_0x9b07('0x48')][_0x9b07('0x55')]+'%'};return _0x8d44fb;})});}_0x1f9345=_['merge']({},_0x1f9345,_0x425cad[_0x9b07('0x5e')]);return db[_0x9b07('0x91')][_0x9b07('0x33')]({'where':_0x1f9345[_0x9b07('0x53')]})[_0x9b07('0x23')](function(_0x4c87ca){_0x3b9ea1[_0x9b07('0x33')]=_0x4c87ca;if(_0x425cad['query'][_0x9b07('0x58')]){_0x1f9345[_0x9b07('0x59')]=[{'model':db[_0x9b07('0x75')],'as':'Contact','required':![]},{'model':db[_0x9b07('0x9e')],'as':'Owner','attributes':[_0x9b07('0x3c'),_0x9b07('0xad'),_0x9b07('0xae')],'required':![]},{'model':db['Tag'],'as':_0x9b07('0xaf'),'attributes':['id',_0x9b07('0x3c'),'color'],'where':_0x425cad[_0x9b07('0x48')]['tag']?{'id':_0x425cad[_0x9b07('0x48')]['tag']}:undefined,'required':_0x425cad['query'][_0x9b07('0xb0')]?!![]:![]}];}return db[_0x9b07('0x91')][_0x9b07('0x5a')](_0x1f9345);})['then'](function(_0x4fde7c){_0x3b9ea1[_0x9b07('0x5b')]=_0x4fde7c;return _0x3b9ea1;});}})[_0x9b07('0x23')](respondWithFilteredResult(_0x3ed5ee,_0x1f9345))['catch'](handleError(_0x3ed5ee,null));};exports[_0x9b07('0xb1')]=function(_0xbc029e,_0x5b5c7c,_0x12dab5){return db['OpenchannelAccount'][_0x9b07('0x5f')]({'where':{'id':_0xbc029e[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x5b5c7c,null))[_0x9b07('0x23')](function(_0x27590a){if(_0x27590a){return _0x27590a[_0x9b07('0xb1')](_0xbc029e[_0x9b07('0x67')][_0x9b07('0x6e')],_[_0x9b07('0xb2')](_0xbc029e[_0x9b07('0x67')],['ids','id'])||{})['spread'](function(_0x2dfc0d){for(var _0x50451b=0x0;_0x50451b<_0xbc029e[_0x9b07('0x67')]['ids'][_0x9b07('0x4e')];_0x50451b+=0x1){socket['emit'](_0x9b07('0xb3'),{'UserId':Number(_0xbc029e[_0x9b07('0x67')][_0x9b07('0x6e')][_0x50451b]),'OpenchannelAccountId':Number(_0xbc029e[_0x9b07('0x5d')]['id'])});}return _0x2dfc0d;});}})[_0x9b07('0x23')](respondWithResult(_0x5b5c7c,null))[_0x9b07('0x2b')](handleError(_0x5b5c7c,null));};exports['removeAgents']=function(_0x464cfc,_0x9c9b4a,_0x53d584){return db[_0x9b07('0x41')]['find']({'where':{'id':_0x464cfc['params']['id']}})['then'](handleEntityNotFound(_0x9c9b4a,null))[_0x9b07('0x23')](function(_0x2cd33a){if(_0x2cd33a){return _0x2cd33a['removeAgents'](_0x464cfc[_0x9b07('0x48')]['ids'])['then'](function(){if(_[_0x9b07('0xb4')](_0x464cfc[_0x9b07('0x48')][_0x9b07('0x6e')])){for(var _0x1a215e=0x0;_0x1a215e<_0x464cfc[_0x9b07('0x48')][_0x9b07('0x6e')][_0x9b07('0x4e')];_0x1a215e+=0x1){socket[_0x9b07('0xb5')](_0x9b07('0xb6'),{'UserId':Number(_0x464cfc[_0x9b07('0x48')][_0x9b07('0x6e')][_0x1a215e]),'OpenchannelAccountId':Number(_0x464cfc[_0x9b07('0x5d')]['id'])});}}else{socket[_0x9b07('0xb5')](_0x9b07('0xb6'),{'UserId':Number(_0x464cfc['query']['ids']),'OpenchannelAccountId':Number(_0x464cfc[_0x9b07('0x5d')]['id'])});}});}})[_0x9b07('0x23')](respondWithStatusCode(_0x9c9b4a,null))[_0x9b07('0x2b')](handleError(_0x9c9b4a,null));};exports[_0x9b07('0xb7')]=function(_0x3dfee6,_0x7e0f06,_0x2d60aa){var _0x364580={};var _0x5448b8={};var _0x5879d1;var _0x155b3d;return db[_0x9b07('0x41')]['findOne']({'where':{'id':_0x3dfee6[_0x9b07('0x5d')]['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x7e0f06,null))[_0x9b07('0x23')](function(_0x5de70d){if(_0x5de70d){_0x5879d1=_0x5de70d;_0x5448b8[_0x9b07('0x46')]=_[_0x9b07('0x49')](db[_0x9b07('0x9e')][_0x9b07('0x42')]);_0x5448b8['query']=_[_0x9b07('0x49')](_0x3dfee6[_0x9b07('0x48')]);_0x5448b8[_0x9b07('0x4a')]=_['intersection'](_0x5448b8[_0x9b07('0x46')],_0x5448b8[_0x9b07('0x48')]);_0x364580[_0x9b07('0x4c')]=_['intersection'](_0x5448b8[_0x9b07('0x46')],qs[_0x9b07('0x4d')](_0x3dfee6['query'][_0x9b07('0x4d')]));_0x364580[_0x9b07('0x4c')]=_0x364580['attributes']['length']?_0x364580['attributes']:_0x5448b8[_0x9b07('0x46')];_0x364580[_0x9b07('0x51')]=qs[_0x9b07('0x52')](_0x3dfee6[_0x9b07('0x48')]['sort']);_0x364580[_0x9b07('0x53')]=qs[_0x9b07('0x4a')](_['pick'](_0x3dfee6['query'],_0x5448b8[_0x9b07('0x4a')]));if(_0x3dfee6[_0x9b07('0x48')][_0x9b07('0x55')]){_0x364580[_0x9b07('0x53')]=_[_0x9b07('0x56')](_0x364580[_0x9b07('0x53')],{'$or':_['map'](_0x364580[_0x9b07('0x4c')],function(_0x57c47e){var _0x41d786={};_0x41d786[_0x57c47e]={'$like':'%'+_0x3dfee6[_0x9b07('0x48')][_0x9b07('0x55')]+'%'};return _0x41d786;})});}_0x364580=_[_0x9b07('0x56')]({},_0x364580,_0x3dfee6[_0x9b07('0x5e')]);return _0x5879d1['getAgents'](_0x364580);}})[_0x9b07('0x23')](function(_0x4e2ee2){if(_0x4e2ee2){_0x155b3d=_0x4e2ee2[_0x9b07('0x4e')];if(!_0x3dfee6[_0x9b07('0x48')][_0x9b07('0x4f')]('nolimit')){_0x364580[_0x9b07('0x32')]=qs[_0x9b07('0x32')](_0x3dfee6['query'][_0x9b07('0x32')]);_0x364580['offset']=qs[_0x9b07('0x30')](_0x3dfee6[_0x9b07('0x48')][_0x9b07('0x30')]);}return _0x5879d1[_0x9b07('0xb7')](_0x364580);}})[_0x9b07('0x23')](function(_0x268497){if(_0x268497){return _0x268497?{'count':_0x155b3d,'rows':_0x268497}:null;}})['then'](respondWithResult(_0x7e0f06,null))['catch'](handleError(_0x7e0f06,null));};exports[_0x9b07('0x3d')]=function(_0xe56fa3,_0x38f10d,_0x410ee5){var _0x57e7f0,_0x5007c2,_0x1dae97;if(_['isNil'](_0xe56fa3['body'][_0x9b07('0x67')])||_0xe56fa3[_0x9b07('0x67')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x9b07('0x80'));}if(_[_0x9b07('0x7e')](_0xe56fa3['body']['to'])){}_0x57e7f0=_0xe56fa3[_0x9b07('0x67')]['to'];return db[_0x9b07('0x41')][_0x9b07('0x72')]({'where':{'id':_0xe56fa3['params']['id']}})[_0x9b07('0x23')](handleEntityNotFound(_0x38f10d,null))[_0x9b07('0x23')](function(_0x425ada){if(_0x425ada){return db[_0x9b07('0x41')][_0x9b07('0x5f')]({'where':{'id':_0x425ada['id']},'include':[{'model':db[_0x9b07('0x84')],'as':_0x9b07('0x85'),'include':[{'model':db[_0x9b07('0x75')],'as':_0x9b07('0x86'),'where':{[_0x425ada['mapKey']]:_0x57e7f0},'limit':0x1,'order':[['updatedAt',_0x9b07('0xb8')]]}]}]})[_0x9b07('0x23')](handleEntityNotFound(_0x38f10d,null))[_0x9b07('0x23')](function(_0x244bde){if(_0x244bde&&_0x244bde[_0x9b07('0x85')]){_0x5007c2=_0x244bde[_0x9b07('0x38')]({'plain':!![]});if(_0x5007c2['List']&&_0x5007c2['List']['Contacts'][_0x9b07('0x4e')]){return _0x5007c2[_0x9b07('0x85')][_0x9b07('0x86')][0x0];}return db[_0x9b07('0x75')][_0x9b07('0x60')](_[_0x9b07('0x1b')](_0xe56fa3[_0x9b07('0x67')],{'firstName':_0x57e7f0,[_0x244bde[_0x9b07('0x81')]]:_0x57e7f0,'phone':_0x57e7f0,'ListId':_0x5007c2[_0x9b07('0x7d')]}));}})[_0x9b07('0x23')](handleEntityNotFound(_0x38f10d,null))[_0x9b07('0x23')](function(_0x114703){if(_0x114703){_0x1dae97=_0x114703;return db[_0x9b07('0x91')]['find']({'where':{'ContactId':_0x1dae97['id'],'closed':![],'OpenchannelAccountId':_0x5007c2['id']}})[_0x9b07('0x23')](function(_0x5c84ef){if(_0x5c84ef){return[_0x5c84ef,![]];}return db[_0x9b07('0x91')]['create']({'UserId':_0xe56fa3[_0x9b07('0x61')]['id'],'ContactId':_0x1dae97['id'],'OpenchannelAccountId':_0x5007c2['id'],'lastMsgDirection':_0x9b07('0xb9'),'firstMsgDirection':_0x9b07('0xb9'),'Messages':[_[_0x9b07('0x56')](_0xe56fa3[_0x9b07('0x67')],{'read':![],'body':_0xe56fa3[_0x9b07('0x67')][_0x9b07('0x67')],'OpenchannelAccountId':_0x5007c2['id'],'UserId':_0xe56fa3[_0x9b07('0x61')]['id'],'ContactId':_0x1dae97['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x9b07('0xba')}]})[_0x9b07('0x23')](function(_0xd5b854){return[_0xd5b854,!![]];});});}})[_0x9b07('0xbb')](function(_0x2b2384,_0x7e93c0){if(_0x7e93c0){return _0x2b2384;}return db[_0x9b07('0x9b')][_0x9b07('0x60')](_[_0x9b07('0x56')](_0xe56fa3[_0x9b07('0x67')],{'read':![],'body':_0xe56fa3[_0x9b07('0x67')][_0x9b07('0x67')],'OpenchannelAccountId':_0x5007c2['id'],'OpenchannelInteractionId':_0x2b2384['id'],'UserId':_0xe56fa3[_0x9b07('0x61')]['id'],'ContactId':_0x1dae97['id']}))[_0x9b07('0x23')](function(_0x348026){_0x2b2384[_0x9b07('0xbc')][_0x9b07('0xba')]=[];_0x2b2384['dataValues'][_0x9b07('0xba')][_0x9b07('0x98')](_0x348026['dataValues']);return _0x2b2384;});});}})['then'](respondWithResult(_0x38f10d,null))[_0x9b07('0x2b')](handleError(_0x38f10d,null));}; \ No newline at end of file +var _0xeb0d=['ContactId','spread','messageId','interaction','created','autoclose','push','close','OpenchannelMessage','AttachmentId','agent','*,*,*,*','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','OpenchannelAccount','includeAll','rows','catch','params','options','create','body','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','Disposition','nolimit','pick','include','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','DESC','applications','orderBy','priority','asc','account','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl'];(function(_0x19b421,_0x3daa42){var _0x57472e=function(_0x4cbbc5){while(--_0x4cbbc5){_0x19b421['push'](_0x19b421['shift']());}};_0x57472e(++_0x3daa42);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x3e81d9,_0x488e01){_0x3e81d9=_0x3e81d9-0x0;var _0x311823=_0xeb0d[_0x3e81d9];return _0x311823;};'use strict';var emlformat=require(_0xdeb0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdeb0('0x1'));var moment=require(_0xdeb0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdeb0('0x3'));var util=require(_0xdeb0('0x4'));var path=require(_0xdeb0('0x5'));var sox=require(_0xdeb0('0x6'));var csv=require(_0xdeb0('0x7'));var ejs=require(_0xdeb0('0x8'));var fs=require('fs');var fs_extra=require(_0xdeb0('0x9'));var _=require(_0xdeb0('0xa'));var squel=require('squel');var crypto=require(_0xdeb0('0xb'));var jsforce=require(_0xdeb0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdeb0('0x7'));var querystring=require(_0xdeb0('0xd'));var Papa=require(_0xdeb0('0xe'));var Redis=require(_0xdeb0('0xf'));var authService=require(_0xdeb0('0x10'));var qs=require(_0xdeb0('0x11'));var as=require(_0xdeb0('0x12'));var hardwareService=require(_0xdeb0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xdeb0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdeb0('0x15'));var db=require(_0xdeb0('0x16'))['db'];config[_0xdeb0('0x17')]=_[_0xdeb0('0x18')](config[_0xdeb0('0x17')],{'host':_0xdeb0('0x19'),'port':0x18eb});var socket=require(_0xdeb0('0x1a'))(new Redis(config[_0xdeb0('0x17')]));require(_0xdeb0('0x1b'))['register'](socket);var jayson=require(_0xdeb0('0x1c'));var client=jayson[_0xdeb0('0x1d')][_0xdeb0('0x1e')]({'port':0x232c});var client9002=jayson[_0xdeb0('0x1d')][_0xdeb0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x55fab1,_0x1510ce,_0x52394f,_0x2de424){return new BPromise(function(_0x473fb9,_0x1cb7b2){var _0x5c3c97=_0x2de424||client;return _0x5c3c97[_0xdeb0('0x1f')](_0x55fab1,_0x52394f)['then'](function(_0x7f30d2){logger[_0xdeb0('0x20')](_0xdeb0('0x21'),_0x1510ce,'request\x20sent');logger[_0xdeb0('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1510ce,_0xdeb0('0x23'),JSON[_0xdeb0('0x24')](_0x7f30d2));if(_0x7f30d2[_0xdeb0('0x25')]){if(_0x7f30d2[_0xdeb0('0x25')]['code']===0x1f4){logger[_0xdeb0('0x25')](_0xdeb0('0x21'),_0x1510ce,_0x7f30d2[_0xdeb0('0x25')][_0xdeb0('0x26')]);return _0x1cb7b2(_0x7f30d2[_0xdeb0('0x25')][_0xdeb0('0x26')]);}logger[_0xdeb0('0x25')](_0xdeb0('0x21'),_0x1510ce,_0x7f30d2[_0xdeb0('0x25')][_0xdeb0('0x26')]);return _0x473fb9(_0x7f30d2[_0xdeb0('0x25')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1510ce,_0xdeb0('0x23'));_0x473fb9(_0x7f30d2['result']['message']);}})['catch'](function(_0x38bd4d){logger[_0xdeb0('0x25')](_0xdeb0('0x21'),_0x1510ce,_0x38bd4d);_0x1cb7b2(_0x38bd4d);});});}function respondWithStatusCode(_0x103e98,_0x3ae683){_0x3ae683=_0x3ae683||0xcc;return function(_0x2cd180){if(_0x2cd180){return _0x103e98[_0xdeb0('0x27')](_0x3ae683);}return _0x103e98[_0xdeb0('0x28')](_0x3ae683)[_0xdeb0('0x29')]();};}function respondWithResult(_0x39d337,_0x191824){_0x191824=_0x191824||0xc8;return function(_0x29bc1d){if(_0x29bc1d){return _0x39d337[_0xdeb0('0x28')](_0x191824)[_0xdeb0('0x2a')](_0x29bc1d);}};}function respondWithFilteredResult(_0x8f5bb3,_0x224528){return function(_0x9ac567){if(_0x9ac567){var _0x59cc01=typeof _0x224528[_0xdeb0('0x2b')]===_0xdeb0('0x2c')&&typeof _0x224528['limit']===_0xdeb0('0x2c');var _0x507b49=_0x9ac567['count'];var _0x1d338=_0x59cc01?0x0:_0x224528[_0xdeb0('0x2b')];var _0x32ec24=_0x59cc01?_0x9ac567[_0xdeb0('0x2d')]:_0x224528['offset']+_0x224528[_0xdeb0('0x2e')];var _0x14ec2e;if(_0x32ec24>=_0x507b49){_0x32ec24=_0x507b49;_0x14ec2e=0xc8;}else{_0x14ec2e=0xce;}_0x8f5bb3[_0xdeb0('0x28')](_0x14ec2e);return _0x8f5bb3['set'](_0xdeb0('0x2f'),_0x1d338+'-'+_0x32ec24+'/'+_0x507b49)['json'](_0x9ac567);}return null;};}function patchUpdates(_0x2cbbc1){return function(_0x2d9f38){try{jsonpatch[_0xdeb0('0x30')](_0x2d9f38,_0x2cbbc1,!![]);}catch(_0x59688f){return BPromise[_0xdeb0('0x31')](_0x59688f);}return _0x2d9f38['save']();};}function saveUpdates(_0x1727ce,_0x43f180){return function(_0x239eae){if(_0x239eae){return _0x239eae[_0xdeb0('0x32')](_0x1727ce)[_0xdeb0('0x33')](function(_0x3f5ea4){return _0x3f5ea4;});}return null;};}function removeEntity(_0x4be012,_0x328e00){return function(_0x3294b6){if(_0x3294b6){return _0x3294b6[_0xdeb0('0x34')]()['then'](function(){var _0x301f28=_0x3294b6[_0xdeb0('0x35')]({'plain':!![]});var _0x5ca646=_0xdeb0('0x36');return db[_0xdeb0('0x37')][_0xdeb0('0x34')]({'where':{'type':_0x5ca646,'resourceId':_0x301f28['id']}})[_0xdeb0('0x33')](function(){return _0x3294b6;});})[_0xdeb0('0x33')](function(){_0x4be012[_0xdeb0('0x28')](0xcc)[_0xdeb0('0x29')]();});}};}function handleEntityNotFound(_0x44740d,_0xb9f870){return function(_0x24bb81){if(!_0x24bb81){_0x44740d[_0xdeb0('0x27')](0x194);}return _0x24bb81;};}function handleError(_0x58ce22,_0x3862c4){_0x3862c4=_0x3862c4||0x1f4;return function(_0x4be7f0){logger[_0xdeb0('0x25')](_0x4be7f0[_0xdeb0('0x38')]);if(_0x4be7f0[_0xdeb0('0x39')]){delete _0x4be7f0[_0xdeb0('0x39')];}_0x58ce22['status'](_0x3862c4)[_0xdeb0('0x3a')](_0x4be7f0);};}exports[_0xdeb0('0x3b')]=function(_0x1ddbee,_0x443c04){var _0x435048={'include':[{'model':db[_0xdeb0('0x3c')],'as':_0xdeb0('0x3d')}]},_0x2fcbc8={},_0xfed4d1={'count':0x0,'rows':[]};var _0x169834=_[_0xdeb0('0x3e')](db['OpenchannelAccount'][_0xdeb0('0x3f')],function(_0x42eea3){return{'name':_0x42eea3['fieldName'],'type':_0x42eea3[_0xdeb0('0x40')][_0xdeb0('0x41')]};});_0x2fcbc8[_0xdeb0('0x42')]=_[_0xdeb0('0x3e')](_0x169834,'name');_0x2fcbc8[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0x1ddbee['query']);_0x2fcbc8[_0xdeb0('0x45')]=_['intersection'](_0x2fcbc8[_0xdeb0('0x42')],_0x2fcbc8[_0xdeb0('0x43')]);_0x435048['attributes']=_[_0xdeb0('0x46')](_0x2fcbc8[_0xdeb0('0x42')],qs['fields'](_0x1ddbee['query'][_0xdeb0('0x47')]));_0x435048[_0xdeb0('0x48')]=_0x435048[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x435048[_0xdeb0('0x48')]:_0x2fcbc8[_0xdeb0('0x42')];if(!_0x1ddbee['query'][_0xdeb0('0x4a')]('nolimit')){_0x435048[_0xdeb0('0x2e')]=qs[_0xdeb0('0x2e')](_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x2e')]);_0x435048['offset']=qs[_0xdeb0('0x2b')](_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x2b')]);}_0x435048[_0xdeb0('0x4b')]=qs[_0xdeb0('0x4c')](_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x4c')]);_0x435048[_0xdeb0('0x4d')]=qs[_0xdeb0('0x45')](_['pick'](_0x1ddbee[_0xdeb0('0x43')],_0x2fcbc8[_0xdeb0('0x45')]),_0x169834);if(_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x4e')]){_0x435048[_0xdeb0('0x4d')]=_[_0xdeb0('0x4f')](_0x435048['where'],{'$or':_[_0xdeb0('0x3e')](_0x169834,function(_0x2ca997){if(_0x2ca997[_0xdeb0('0x40')]!=='VIRTUAL'){var _0xea8faa={};_0xea8faa[_0x2ca997[_0xdeb0('0x39')]]={'$like':'%'+_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x4e')]+'%'};return _0xea8faa;}})});}_0x435048=_[_0xdeb0('0x4f')]({},_0x435048,_0x1ddbee['options']);var _0xe9fcd6={'where':_0x435048[_0xdeb0('0x4d')]};return db[_0xdeb0('0x50')][_0xdeb0('0x2d')](_0xe9fcd6)[_0xdeb0('0x33')](function(_0x5814af){_0xfed4d1['count']=_0x5814af;if(_0x1ddbee[_0xdeb0('0x43')][_0xdeb0('0x51')]){_0x435048['include']=[{'all':!![]}];}return db[_0xdeb0('0x50')]['findAll'](_0x435048);})[_0xdeb0('0x33')](function(_0x106119){_0xfed4d1[_0xdeb0('0x52')]=_0x106119;return _0xfed4d1;})[_0xdeb0('0x33')](respondWithFilteredResult(_0x443c04,_0x435048))[_0xdeb0('0x53')](handleError(_0x443c04,null));};exports['show']=function(_0x2de391,_0x75e976){var _0x256fe6={'raw':![],'where':{'id':_0x2de391[_0xdeb0('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2d0ea9={};_0x2d0ea9[_0xdeb0('0x42')]=_[_0xdeb0('0x44')](db[_0xdeb0('0x50')][_0xdeb0('0x3f')]);_0x2d0ea9[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0x2de391[_0xdeb0('0x43')]);_0x2d0ea9[_0xdeb0('0x45')]=_[_0xdeb0('0x46')](_0x2d0ea9['model'],_0x2d0ea9[_0xdeb0('0x43')]);_0x256fe6['attributes']=_['intersection'](_0x2d0ea9[_0xdeb0('0x42')],qs['fields'](_0x2de391['query'][_0xdeb0('0x47')]));_0x256fe6[_0xdeb0('0x48')]=_0x256fe6[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x256fe6[_0xdeb0('0x48')]:_0x2d0ea9['model'];if(_0x2de391[_0xdeb0('0x43')]['includeAll']){_0x256fe6['include']=[{'all':!![]}];}_0x256fe6=_[_0xdeb0('0x4f')]({},_0x256fe6,_0x2de391[_0xdeb0('0x55')]);return db['OpenchannelAccount']['find'](_0x256fe6)['then'](handleEntityNotFound(_0x75e976,null))[_0xdeb0('0x33')](respondWithResult(_0x75e976,null))[_0xdeb0('0x53')](handleError(_0x75e976,null));};exports[_0xdeb0('0x56')]=function(_0x1b6173,_0x4f6aba){return db['OpenchannelAccount'][_0xdeb0('0x56')](_0x1b6173[_0xdeb0('0x57')],{})[_0xdeb0('0x33')](function(_0x28fffb){var _0x2ac692=_0x1b6173['user'][_0xdeb0('0x35')]({'plain':!![]});if(!_0x2ac692)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac692[_0xdeb0('0x58')]===_0xdeb0('0x59')){var _0x250a6e=_0x28fffb[_0xdeb0('0x35')]({'plain':!![]});var _0x5f4711=_0xdeb0('0x36');return db[_0xdeb0('0x5a')][_0xdeb0('0x5b')]({'where':{'name':_0x5f4711,'userProfileId':_0x2ac692['userProfileId']},'raw':!![]})['then'](function(_0xdc5199){if(_0xdc5199&&_0xdc5199[_0xdeb0('0x5c')]===0x0){return db[_0xdeb0('0x37')][_0xdeb0('0x56')]({'name':_0x250a6e[_0xdeb0('0x39')],'resourceId':_0x250a6e['id'],'type':_0xdc5199['name'],'sectionId':_0xdc5199['id']},{})['then'](function(){return _0x28fffb;});}else{return _0x28fffb;}})[_0xdeb0('0x53')](function(_0x526fb4){logger[_0xdeb0('0x25')](_0xdeb0('0x5d'),_0x526fb4);throw _0x526fb4;});}return _0x28fffb;})[_0xdeb0('0x33')](respondWithResult(_0x4f6aba,0xc9))[_0xdeb0('0x53')](handleError(_0x4f6aba,null));};exports[_0xdeb0('0x32')]=function(_0x3bb201,_0x31044a){if(_0x3bb201[_0xdeb0('0x57')]['id']){delete _0x3bb201[_0xdeb0('0x57')]['id'];}return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x3bb201[_0xdeb0('0x54')]['id']},'include':[{'model':db[_0xdeb0('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x31044a,null))[_0xdeb0('0x33')](saveUpdates(_0x3bb201[_0xdeb0('0x57')],null))['then'](respondWithResult(_0x31044a,null))['catch'](handleError(_0x31044a,null));};exports[_0xdeb0('0x34')]=function(_0x3920df,_0xaacfa9){return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x3920df[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0xaacfa9,null))[_0xdeb0('0x33')](removeEntity(_0xaacfa9,null))[_0xdeb0('0x53')](handleError(_0xaacfa9,null));};exports['describe']=function(_0x476e20,_0x2ba84c){return db[_0xdeb0('0x50')][_0xdeb0('0x5e')]()[_0xdeb0('0x33')](respondWithResult(_0x2ba84c,null))[_0xdeb0('0x53')](handleError(_0x2ba84c,null));};exports[_0xdeb0('0x5f')]=function(_0x2c095a,_0x3f87f6,_0x451c5a){if(_0x2c095a['body']['id']){delete _0x2c095a[_0xdeb0('0x57')]['id'];}return db['OpenchannelAccount'][_0xdeb0('0x5b')]({'where':{'id':_0x2c095a['params']['id']}})['then'](handleEntityNotFound(_0x3f87f6,null))[_0xdeb0('0x33')](function(_0x5d355b){if(_0x5d355b){_0x2c095a[_0xdeb0('0x57')][_0xdeb0('0x60')]=_0x5d355b['id'];return db['Disposition'][_0xdeb0('0x56')](_0x2c095a[_0xdeb0('0x57')]);}})[_0xdeb0('0x33')](respondWithResult(_0x3f87f6,null))[_0xdeb0('0x53')](handleError(_0x3f87f6,null));};exports[_0xdeb0('0x61')]=function(_0x1ba628,_0x3cc3d4,_0x1f630e){var _0x302229={'raw':![],'where':{}};var _0x383c53={};var _0x4853b9={'count':0x0,'rows':[]};return db[_0xdeb0('0x50')]['findOne']({'where':{'id':_0x1ba628[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x3cc3d4,null))[_0xdeb0('0x33')](function(_0xafd946){if(_0xafd946){_0x383c53[_0xdeb0('0x42')]=_[_0xdeb0('0x44')](db[_0xdeb0('0x62')]['rawAttributes']);_0x383c53[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0x1ba628['query']);_0x383c53['filters']=_[_0xdeb0('0x46')](_0x383c53[_0xdeb0('0x42')],_0x383c53[_0xdeb0('0x43')]);_0x302229[_0xdeb0('0x48')]=_[_0xdeb0('0x46')](_0x383c53[_0xdeb0('0x42')],qs['fields'](_0x1ba628[_0xdeb0('0x43')][_0xdeb0('0x47')]));_0x302229[_0xdeb0('0x48')]=_0x302229[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x302229['attributes']:_0x383c53['model'];if(!_0x1ba628[_0xdeb0('0x43')]['hasOwnProperty'](_0xdeb0('0x63'))){_0x302229[_0xdeb0('0x2e')]=qs[_0xdeb0('0x2e')](_0x1ba628[_0xdeb0('0x43')]['limit']);_0x302229[_0xdeb0('0x2b')]=qs['offset'](_0x1ba628[_0xdeb0('0x43')][_0xdeb0('0x2b')]);}_0x302229['order']=qs['sort'](_0x1ba628['query'][_0xdeb0('0x4c')]);_0x302229[_0xdeb0('0x4d')]=qs['filters'](_[_0xdeb0('0x64')](_0x1ba628[_0xdeb0('0x43')],_0x383c53[_0xdeb0('0x45')]));_0x302229[_0xdeb0('0x4d')]['OpenchannelAccountId']=_0xafd946['id'];if(_0x1ba628[_0xdeb0('0x43')][_0xdeb0('0x4e')]){_0x302229[_0xdeb0('0x4d')]=_[_0xdeb0('0x4f')](_0x302229[_0xdeb0('0x4d')],{'$or':_[_0xdeb0('0x3e')](_0x302229['attributes'],function(_0x35a50d){var _0x4d0b2e={};_0x4d0b2e[_0x35a50d]={'$like':'%'+_0x1ba628[_0xdeb0('0x43')]['filter']+'%'};return _0x4d0b2e;})});}_0x302229=_[_0xdeb0('0x4f')]({},_0x302229,_0x1ba628[_0xdeb0('0x55')]);return db[_0xdeb0('0x62')][_0xdeb0('0x2d')]({'where':_0x302229[_0xdeb0('0x4d')]})[_0xdeb0('0x33')](function(_0x457a72){_0x4853b9[_0xdeb0('0x2d')]=_0x457a72;if(_0x1ba628[_0xdeb0('0x43')]['includeAll']){_0x302229[_0xdeb0('0x65')]=[{'all':!![]}];}return db[_0xdeb0('0x62')][_0xdeb0('0x66')](_0x302229);})[_0xdeb0('0x33')](function(_0x4cae3d){_0x4853b9[_0xdeb0('0x52')]=_0x4cae3d;return _0x4853b9;});}})[_0xdeb0('0x33')](respondWithFilteredResult(_0x3cc3d4,_0x302229))[_0xdeb0('0x53')](handleError(_0x3cc3d4,null));};exports[_0xdeb0('0x67')]=function(_0x270db1,_0x4077a4,_0x64a848){return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x270db1[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x4077a4,null))['then'](function(_0x25116b){if(_0x25116b){return _0x25116b[_0xdeb0('0x67')](_0x270db1[_0xdeb0('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x4077a4,null))[_0xdeb0('0x53')](handleError(_0x4077a4,null));};exports[_0xdeb0('0x68')]=function(_0x555311,_0x55f0c9,_0x7f5d0c){if(_0x555311[_0xdeb0('0x57')]['id']){delete _0x555311['body']['id'];}return db['OpenchannelAccount'][_0xdeb0('0x5b')]({'where':{'id':_0x555311[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x55f0c9,null))['then'](function(_0x5b2188){if(_0x5b2188){_0x555311[_0xdeb0('0x57')]['OpenchannelAccountId']=_0x5b2188['id'];return db[_0xdeb0('0x69')]['create'](_0x555311[_0xdeb0('0x57')]);}})[_0xdeb0('0x33')](respondWithResult(_0x55f0c9,null))[_0xdeb0('0x53')](handleError(_0x55f0c9,null));};exports[_0xdeb0('0x6a')]=function(_0xa6886a,_0x255cf1,_0x512e94){var _0x2d425c={'raw':![],'where':{}};var _0x141280={};var _0x4b96aa={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xdeb0('0x6b')]({'where':{'id':_0xa6886a[_0xdeb0('0x54')]['id']}})['then'](handleEntityNotFound(_0x255cf1,null))['then'](function(_0x4c2bd3){if(_0x4c2bd3){_0x141280[_0xdeb0('0x42')]=_[_0xdeb0('0x44')](db[_0xdeb0('0x69')][_0xdeb0('0x3f')]);_0x141280[_0xdeb0('0x43')]=_['keys'](_0xa6886a['query']);_0x141280[_0xdeb0('0x45')]=_[_0xdeb0('0x46')](_0x141280[_0xdeb0('0x42')],_0x141280[_0xdeb0('0x43')]);_0x2d425c[_0xdeb0('0x48')]=_[_0xdeb0('0x46')](_0x141280[_0xdeb0('0x42')],qs[_0xdeb0('0x47')](_0xa6886a[_0xdeb0('0x43')][_0xdeb0('0x47')]));_0x2d425c['attributes']=_0x2d425c[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x2d425c[_0xdeb0('0x48')]:_0x141280[_0xdeb0('0x42')];if(!_0xa6886a[_0xdeb0('0x43')][_0xdeb0('0x4a')](_0xdeb0('0x63'))){_0x2d425c[_0xdeb0('0x2e')]=qs[_0xdeb0('0x2e')](_0xa6886a['query'][_0xdeb0('0x2e')]);_0x2d425c[_0xdeb0('0x2b')]=qs[_0xdeb0('0x2b')](_0xa6886a['query'][_0xdeb0('0x2b')]);}_0x2d425c[_0xdeb0('0x4b')]=qs[_0xdeb0('0x4c')](_0xa6886a['query'][_0xdeb0('0x4c')]);_0x2d425c[_0xdeb0('0x4d')]=qs[_0xdeb0('0x45')](_['pick'](_0xa6886a[_0xdeb0('0x43')],_0x141280[_0xdeb0('0x45')]));_0x2d425c[_0xdeb0('0x4d')]['OpenchannelAccountId']=_0x4c2bd3['id'];if(_0xa6886a[_0xdeb0('0x43')][_0xdeb0('0x4e')]){_0x2d425c[_0xdeb0('0x4d')]=_[_0xdeb0('0x4f')](_0x2d425c[_0xdeb0('0x4d')],{'$or':_[_0xdeb0('0x3e')](_0x2d425c[_0xdeb0('0x48')],function(_0x2ea807){var _0x638b6a={};_0x638b6a[_0x2ea807]={'$like':'%'+_0xa6886a[_0xdeb0('0x43')]['filter']+'%'};return _0x638b6a;})});}_0x2d425c=_[_0xdeb0('0x4f')]({},_0x2d425c,_0xa6886a[_0xdeb0('0x55')]);return db[_0xdeb0('0x69')][_0xdeb0('0x2d')]({'where':_0x2d425c[_0xdeb0('0x4d')]})[_0xdeb0('0x33')](function(_0x51ee53){_0x4b96aa[_0xdeb0('0x2d')]=_0x51ee53;if(_0xa6886a['query'][_0xdeb0('0x51')]){_0x2d425c[_0xdeb0('0x65')]=[{'all':!![]}];}return db[_0xdeb0('0x69')][_0xdeb0('0x66')](_0x2d425c);})['then'](function(_0xd8f3c0){_0x4b96aa[_0xdeb0('0x52')]=_0xd8f3c0;return _0x4b96aa;});}})[_0xdeb0('0x33')](respondWithFilteredResult(_0x255cf1,_0x2d425c))['catch'](handleError(_0x255cf1,null));};exports[_0xdeb0('0x6c')]=function(_0x1270d4,_0x4a962f,_0xc35d21){return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x1270d4[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x4a962f,null))[_0xdeb0('0x33')](function(_0x4b08c2){if(_0x4b08c2){return _0x4b08c2[_0xdeb0('0x6c')](_0x1270d4[_0xdeb0('0x43')][_0xdeb0('0x6d')]);}})[_0xdeb0('0x33')](respondWithStatusCode(_0x4a962f,null))[_0xdeb0('0x53')](handleError(_0x4a962f,null));};exports[_0xdeb0('0x6e')]=function(_0x32665f,_0x29a10d,_0x1ee03c){var _0x5982be={'body':_0x32665f[_0xdeb0('0x57')],'channel':_0xdeb0('0x6f')};var _0x579b03=[];var _0x3c4844=[];var _0x4ab58a={};var _0x13db62=![];return db[_0xdeb0('0x70')][_0xdeb0('0x5e')]()['then'](function(_0x10543c){if(!_0x10543c){throw new db[(_0xdeb0('0x71'))][(_0xdeb0('0x72'))]('no\x20available\x20attributes');}_0x579b03=_[_0xdeb0('0x73')](_[_0xdeb0('0x44')](_0x10543c),['createdAt','updatedAt']);_0x3c4844=_['difference'](_[_0xdeb0('0x44')](_0x10543c),[_0xdeb0('0x74'),_0xdeb0('0x75'),_0xdeb0('0x76'),_0xdeb0('0x77')]);if(_0x32665f['body']['id']){delete _0x32665f[_0xdeb0('0x57')]['id'];}if(_[_0xdeb0('0x78')](_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x79')])){throw new db[(_0xdeb0('0x71'))]['ValidationError'](_0xdeb0('0x7a'));}if(_[_0xdeb0('0x78')](_0x32665f[_0xdeb0('0x57')]['body'])||_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x57')]===''){throw new db[(_0xdeb0('0x71'))][(_0xdeb0('0x72'))](_0xdeb0('0x7b'));}if(_['isNil'](_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x7c')])){throw new db[(_0xdeb0('0x71'))][(_0xdeb0('0x72'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c4844);}if(!_[_0xdeb0('0x7d')](_0x3c4844,_0x32665f['body'][_0xdeb0('0x7c')])){throw new db[(_0xdeb0('0x71'))][(_0xdeb0('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c4844);}_0x4ab58a[_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x7c')]]=_0x32665f['body'][_0xdeb0('0x79')];})['then'](function(){return db['OpenchannelAccount'][_0xdeb0('0x5b')]({'where':{'id':_0x32665f[_0xdeb0('0x54')]['id']},'include':[{'model':db[_0xdeb0('0x7e')],'as':_0xdeb0('0x7f'),'include':[{'model':db[_0xdeb0('0x70')],'as':_0xdeb0('0x80'),'where':_0x4ab58a,'limit':0x1,'order':[[_0xdeb0('0x75'),_0xdeb0('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xdeb0('0x33')](handleEntityNotFound(_0x29a10d,null))[_0xdeb0('0x33')](function(_0x1acf22){if(_0x1acf22&&_0x1acf22[_0xdeb0('0x7f')]){_0x5982be['account']=_0x1acf22;_0x5982be[_0xdeb0('0x82')]=_0x1acf22['Applications'];_0x5982be['list']=_0x1acf22[_0xdeb0('0x7f')];_0x5982be[_0xdeb0('0x82')]=_[_0xdeb0('0x83')](_0x5982be[_0xdeb0('0x82')],[_0xdeb0('0x84')],[_0xdeb0('0x85')]);if(_0x5982be[_0xdeb0('0x86')][_0xdeb0('0x87')]){delete _0x5982be['account'][_0xdeb0('0x87')];}if(_0x5982be[_0xdeb0('0x86')][_0xdeb0('0x7f')]&&_0x5982be[_0xdeb0('0x86')]['List'][_0xdeb0('0x80')][_0xdeb0('0x49')]){return _0x5982be[_0xdeb0('0x86')][_0xdeb0('0x7f')]['Contacts'][0x0];}var _0x9099ac=_['defaults'](_0x32665f[_0xdeb0('0x57')],{'firstName':_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x79')],'ListId':_0x1acf22[_0xdeb0('0x77')]});_0x9099ac[_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x7c')]]=_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x79')];return db['CmContact'][_0xdeb0('0x56')](_0x9099ac,{'fields':_0x579b03,'raw':!![]});}})[_0xdeb0('0x33')](handleEntityNotFound(_0x29a10d,null))[_0xdeb0('0x33')](function(_0x1ebc67){_0x5982be[_0xdeb0('0x88')]=_0x1ebc67;if(_0x1ebc67){var _0x6e9f35={'ContactId':_0x1ebc67['id'],'OpenchannelAccountId':_0x32665f[_0xdeb0('0x54')]['id'],'from':(_0x1ebc67[_0xdeb0('0x89')]||'')+'\x20'+(_0x1ebc67[_0xdeb0('0x8a')]||'')};var _0x4960e3={'OpenchannelAccountId':_0x32665f[_0xdeb0('0x54')]['id'],'closed':![]};if(_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x8b')]){_0x4960e3[_0xdeb0('0x8b')]=_0x32665f['body'][_0xdeb0('0x8b')];return db[_0xdeb0('0x8c')][_0xdeb0('0x5b')]({'where':_0x4960e3})[_0xdeb0('0x33')](function(_0x360c0e){if(_0x360c0e){return[_0x360c0e,![]];}_0x6e9f35['threadId']=_0x32665f[_0xdeb0('0x57')]['threadId'];_0x6e9f35[_0xdeb0('0x8d')]=_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x8d')];return db['OpenchannelInteraction'][_0xdeb0('0x56')](_0x6e9f35)[_0xdeb0('0x33')](function(_0x2551cb){return[_0x2551cb,!![]];});});}else{_0x4960e3[_0xdeb0('0x8b')]=null;}_0x4960e3[_0xdeb0('0x8e')]=_0x1ebc67['id'];return db[_0xdeb0('0x8c')]['find']({'where':_0x4960e3})[_0xdeb0('0x33')](function(_0x3ac8bc){if(_0x3ac8bc){return[_0x3ac8bc,![]];}return db[_0xdeb0('0x8c')][_0xdeb0('0x56')](_0x6e9f35)[_0xdeb0('0x33')](function(_0x8e2aec){return[_0x8e2aec,!![]];});});}})[_0xdeb0('0x8f')](function(_0x164763,_0x4e3b23){if(_0x164763){_0x13db62=_0x4e3b23;if(!_0x4e3b23){var _0x4b030f={'from':(_0x5982be[_0xdeb0('0x88')]['firstName']||'')+'\x20'+(_0x5982be[_0xdeb0('0x88')][_0xdeb0('0x8a')]||'')};if(_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x8b')]&&_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x90')]&&_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x8b')]!=_0x32665f['body'][_0xdeb0('0x90')]){_0x4b030f['threadId']=_0x32665f[_0xdeb0('0x57')][_0xdeb0('0x90')];}return _0x164763[_0xdeb0('0x32')](_0x4b030f);}else{return _0x164763;}}})['then'](function(_0x1fd06b){_0x5982be[_0xdeb0('0x91')]=_0x1fd06b['get']({'plain':!![]});_0x5982be[_0xdeb0('0x91')][_0xdeb0('0x92')]=_0x13db62;if(_0x5982be[_0xdeb0('0x91')][_0xdeb0('0x92')]){if(_0x5982be[_0xdeb0('0x86')][_0xdeb0('0x93')]){_0x5982be[_0xdeb0('0x82')][_0xdeb0('0x94')]({'id':0x0,'priority':_0x5982be[_0xdeb0('0x82')]['length']+0x1,'app':_0xdeb0('0x95'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xdeb0('0x96')][_0xdeb0('0x56')]({'body':_0x32665f['body'][_0xdeb0('0x57')],'OpenchannelAccountId':_0x32665f[_0xdeb0('0x54')]['id'],'OpenchannelInteractionId':_0x1fd06b['id'],'direction':'in','ContactId':_0x5982be[_0xdeb0('0x88')]['id'],'AttachmentId':_0x32665f['body'][_0xdeb0('0x97')]});})[_0xdeb0('0x33')](function(_0x5a9a26){_0x5982be[_0xdeb0('0x26')]=_0x5a9a26;if(_0x5982be[_0xdeb0('0x91')]['UserId']){return db['User'][_0xdeb0('0x5b')]({'attributes':['id',_0xdeb0('0x39')],'where':{'id':_0x5982be['interaction']['UserId']}})[_0xdeb0('0x33')](function(_0x35eeac){if(_0x35eeac){_0x5982be[_0xdeb0('0x82')]['unshift']({'id':0x0,'priority':0x0,'app':_0xdeb0('0x98'),'appdata':_0x35eeac[_0xdeb0('0x39')]+','+(_0x5982be[_0xdeb0('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0xdeb0('0x99')});_0x5982be['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xdeb0('0x9a'),_0x5982be);});}return respondWithRpcPromise(_0xdeb0('0x9b'),_0xdeb0('0x9a'),_0x5982be);})[_0xdeb0('0x33')](function(_0x48a03d){respondWithRpcPromise(_0xdeb0('0x9c'),_0xdeb0('0x9c'),{'event':_0xdeb0('0x6e'),'message':_0x48a03d},client9002);return _0x48a03d;})[_0xdeb0('0x33')](respondWithResult(_0x29a10d,null))[_0xdeb0('0x53')](handleError(_0x29a10d,null));};exports[_0xdeb0('0x9d')]=function(_0x505a13,_0xbd9daf){var _0x5b147c=_0x505a13[_0xdeb0('0x54')]['id'];var _0x1bfdf8=_0x505a13[_0xdeb0('0x57')];var _0x184e65=0xc8;var _0x275a1b=null;return db[_0xdeb0('0x9e')][_0xdeb0('0x9f')]({'isolationLevel':db[_0xdeb0('0x9e')][_0xdeb0('0xa0')][_0xdeb0('0xa1')]['READ_COMMITTED']},function(_0x3eefc7){return db[_0xdeb0('0x50')]['findOne']({'where':{'id':_0x5b147c},'transaction':_0x3eefc7})['then'](function(_0x2e188a){if(_0x2e188a){return db[_0xdeb0('0xa2')][_0xdeb0('0x34')]({'where':{'OpenchannelAccountId':_0x5b147c},'transaction':_0x3eefc7})['then'](function(){var _0x3eac36=_[_0xdeb0('0x3e')](_0x1bfdf8,function(_0x395468){_0x395468['OpenchannelAccountId']=_0x5b147c;return _0x395468;});return db['OpenchannelApplication'][_0xdeb0('0xa3')](_0x3eac36,{'transaction':_0x3eefc7});});}else{_0x184e65=0x194;_0x275a1b=[];}});})['then'](function(){if(_0x184e65!==0x194){return db[_0xdeb0('0xa2')][_0xdeb0('0xa4')]({'where':{'OpenchannelAccountId':_0x5b147c},'order':_0xdeb0('0x84')})['then'](function(_0x625db9){_0x275a1b=_0x625db9;});}})[_0xdeb0('0x53')](function(_0x527ee6){_0x184e65=0x1f4;logger[_0xdeb0('0x25')](_0x527ee6[_0xdeb0('0x38')]);if(_0x527ee6['name']){delete _0x527ee6[_0xdeb0('0x39')];}_0x275a1b=_0x527ee6;})['finally'](function(){if(_0x275a1b===null){_0xbd9daf[_0xdeb0('0x27')](_0x184e65);}else{if(_0x184e65===0x1f4){_0xbd9daf['status'](_0x184e65)['send'](_0x275a1b);}else{_0xbd9daf[_0xdeb0('0x28')](_0x184e65)['json'](_0x275a1b);}}});};exports[_0xdeb0('0xa5')]=function(_0x315de5,_0x470b31,_0xa3c56a){var _0x187b94={};var _0x32f5c0={};var _0x57de40;var _0x177b6e;return db['OpenchannelAccount'][_0xdeb0('0x6b')]({'where':{'id':_0x315de5[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x470b31,null))[_0xdeb0('0x33')](function(_0x455e1b){if(_0x455e1b){_0x57de40=_0x455e1b;_0x32f5c0['model']=_['keys'](db['OpenchannelApplication'][_0xdeb0('0x3f')]);_0x32f5c0[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0x315de5[_0xdeb0('0x43')]);_0x32f5c0[_0xdeb0('0x45')]=_[_0xdeb0('0x46')](_0x32f5c0[_0xdeb0('0x42')],_0x32f5c0[_0xdeb0('0x43')]);_0x187b94[_0xdeb0('0x48')]=_[_0xdeb0('0x46')](_0x32f5c0[_0xdeb0('0x42')],qs[_0xdeb0('0x47')](_0x315de5[_0xdeb0('0x43')][_0xdeb0('0x47')]));_0x187b94['attributes']=_0x187b94[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x187b94[_0xdeb0('0x48')]:_0x32f5c0[_0xdeb0('0x42')];_0x187b94['order']=qs[_0xdeb0('0x4c')](_0x315de5[_0xdeb0('0x43')][_0xdeb0('0x4c')]);_0x187b94[_0xdeb0('0x4d')]=qs[_0xdeb0('0x45')](_[_0xdeb0('0x64')](_0x315de5[_0xdeb0('0x43')],_0x32f5c0[_0xdeb0('0x45')]));if(_0x315de5[_0xdeb0('0x43')][_0xdeb0('0x4e')]){_0x187b94['where']=_[_0xdeb0('0x4f')](_0x187b94['where'],{'$or':_['map'](_0x187b94[_0xdeb0('0x48')],function(_0x377928){var _0x5b3060={};_0x5b3060[_0x377928]={'$like':'%'+_0x315de5['query']['filter']+'%'};return _0x5b3060;})});}_0x187b94=_[_0xdeb0('0x4f')]({},_0x187b94,_0x315de5[_0xdeb0('0x55')]);return _0x57de40[_0xdeb0('0xa5')](_0x187b94);}})['then'](function(_0x3e9c46){if(_0x3e9c46){_0x177b6e=_0x3e9c46[_0xdeb0('0x49')];if(!_0x315de5[_0xdeb0('0x43')][_0xdeb0('0x4a')]('nolimit')){_0x187b94['limit']=qs[_0xdeb0('0x2e')](_0x315de5[_0xdeb0('0x43')]['limit']);_0x187b94['offset']=qs['offset'](_0x315de5[_0xdeb0('0x43')]['offset']);}return _0x57de40['getApplications'](_0x187b94);}})[_0xdeb0('0x33')](function(_0x2f358c){if(_0x2f358c){return _0x2f358c?{'count':_0x177b6e,'rows':_0x2f358c}:null;}})[_0xdeb0('0x33')](respondWithResult(_0x470b31,null))[_0xdeb0('0x53')](handleError(_0x470b31,null));};exports[_0xdeb0('0xa6')]=function(_0x171c01,_0xd3cd5,_0xa88f8a){var _0x216c6f={'raw':![],'where':{}};var _0x202c9d={};var _0x140da0={'count':0x0,'rows':[]};return db[_0xdeb0('0x50')][_0xdeb0('0x6b')]({'where':{'id':_0x171c01['params']['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0xd3cd5,null))[_0xdeb0('0x33')](function(_0x50ff8e){if(_0x50ff8e){_0x202c9d[_0xdeb0('0x42')]=_[_0xdeb0('0x44')](db[_0xdeb0('0x8c')][_0xdeb0('0x3f')]);_0x202c9d[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0x171c01[_0xdeb0('0x43')]);_0x202c9d[_0xdeb0('0x45')]=_['intersection'](_0x202c9d[_0xdeb0('0x42')],_0x202c9d[_0xdeb0('0x43')]);_0x216c6f[_0xdeb0('0x48')]=_['intersection'](_0x202c9d[_0xdeb0('0x42')],qs[_0xdeb0('0x47')](_0x171c01['query']['fields']));_0x216c6f[_0xdeb0('0x48')]=_0x216c6f[_0xdeb0('0x48')][_0xdeb0('0x49')]?_0x216c6f[_0xdeb0('0x48')]:_0x202c9d[_0xdeb0('0x42')];if(!_0x171c01['query'][_0xdeb0('0x4a')]('nolimit')){_0x216c6f[_0xdeb0('0x2e')]=qs[_0xdeb0('0x2e')](_0x171c01[_0xdeb0('0x43')][_0xdeb0('0x2e')]);_0x216c6f[_0xdeb0('0x2b')]=qs[_0xdeb0('0x2b')](_0x171c01[_0xdeb0('0x43')][_0xdeb0('0x2b')]);}_0x216c6f[_0xdeb0('0x4b')]=qs[_0xdeb0('0x4c')](_0x171c01[_0xdeb0('0x43')][_0xdeb0('0x4c')]);_0x216c6f[_0xdeb0('0x4d')]=qs[_0xdeb0('0x45')](_[_0xdeb0('0x64')](_0x171c01[_0xdeb0('0x43')],_0x202c9d[_0xdeb0('0x45')]));_0x216c6f[_0xdeb0('0x4d')][_0xdeb0('0x60')]=_0x50ff8e['id'];if(_0x171c01[_0xdeb0('0x43')]['filter']){_0x216c6f['where']=_[_0xdeb0('0x4f')](_0x216c6f[_0xdeb0('0x4d')],{'$or':_['map'](_0x216c6f[_0xdeb0('0x48')],function(_0x157e1b){var _0x43230c={};_0x43230c[_0x157e1b]={'$like':'%'+_0x171c01[_0xdeb0('0x43')][_0xdeb0('0x4e')]+'%'};return _0x43230c;})});}_0x216c6f=_[_0xdeb0('0x4f')]({},_0x216c6f,_0x171c01[_0xdeb0('0x55')]);return db['OpenchannelInteraction'][_0xdeb0('0x2d')]({'where':_0x216c6f[_0xdeb0('0x4d')]})[_0xdeb0('0x33')](function(_0x55a848){_0x140da0['count']=_0x55a848;if(_0x171c01['query'][_0xdeb0('0x51')]){_0x216c6f['include']=[{'model':db[_0xdeb0('0x70')],'as':_0xdeb0('0xa7'),'required':![]},{'model':db[_0xdeb0('0xa8')],'as':'Owner','attributes':[_0xdeb0('0x39'),'fullname',_0xdeb0('0xa9')],'required':![]},{'model':db[_0xdeb0('0xaa')],'as':'Tags','attributes':['id',_0xdeb0('0x39'),_0xdeb0('0xab')],'where':_0x171c01['query']['tag']?{'id':_0x171c01['query'][_0xdeb0('0xac')]}:undefined,'required':_0x171c01['query'][_0xdeb0('0xac')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xdeb0('0x66')](_0x216c6f);})[_0xdeb0('0x33')](function(_0x3dcb2d){_0x140da0[_0xdeb0('0x52')]=_0x3dcb2d;return _0x140da0;});}})[_0xdeb0('0x33')](respondWithFilteredResult(_0xd3cd5,_0x216c6f))[_0xdeb0('0x53')](handleError(_0xd3cd5,null));};exports[_0xdeb0('0xad')]=function(_0x43886f,_0x500de3,_0x54bff2){return db['OpenchannelAccount'][_0xdeb0('0x5b')]({'where':{'id':_0x43886f[_0xdeb0('0x54')]['id']}})['then'](handleEntityNotFound(_0x500de3,null))['then'](function(_0x182e76){if(_0x182e76){return _0x182e76[_0xdeb0('0xad')](_0x43886f[_0xdeb0('0x57')][_0xdeb0('0x6d')],_[_0xdeb0('0xae')](_0x43886f[_0xdeb0('0x57')],[_0xdeb0('0x6d'),'id'])||{})[_0xdeb0('0x8f')](function(_0x318105){for(var _0x5d668a=0x0;_0x5d668a<_0x43886f['body'][_0xdeb0('0x6d')][_0xdeb0('0x49')];_0x5d668a+=0x1){socket[_0xdeb0('0xaf')](_0xdeb0('0xb0'),{'UserId':Number(_0x43886f[_0xdeb0('0x57')][_0xdeb0('0x6d')][_0x5d668a]),'OpenchannelAccountId':Number(_0x43886f['params']['id'])});}return _0x318105;});}})['then'](respondWithResult(_0x500de3,null))[_0xdeb0('0x53')](handleError(_0x500de3,null));};exports[_0xdeb0('0xb1')]=function(_0x18610c,_0x614080,_0x284f46){return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x18610c[_0xdeb0('0x54')]['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x614080,null))[_0xdeb0('0x33')](function(_0x3ca452){if(_0x3ca452){return _0x3ca452[_0xdeb0('0xb1')](_0x18610c[_0xdeb0('0x43')][_0xdeb0('0x6d')])[_0xdeb0('0x33')](function(){if(_[_0xdeb0('0xb2')](_0x18610c['query'][_0xdeb0('0x6d')])){for(var _0x35b93f=0x0;_0x35b93f<_0x18610c[_0xdeb0('0x43')]['ids'][_0xdeb0('0x49')];_0x35b93f+=0x1){socket[_0xdeb0('0xaf')](_0xdeb0('0xb3'),{'UserId':Number(_0x18610c[_0xdeb0('0x43')][_0xdeb0('0x6d')][_0x35b93f]),'OpenchannelAccountId':Number(_0x18610c[_0xdeb0('0x54')]['id'])});}}else{socket[_0xdeb0('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x18610c[_0xdeb0('0x43')]['ids']),'OpenchannelAccountId':Number(_0x18610c[_0xdeb0('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x614080,null))[_0xdeb0('0x53')](handleError(_0x614080,null));};exports[_0xdeb0('0xb4')]=function(_0xc2df73,_0x19c780,_0xb49866){var _0x5c79e1={};var _0x1c6b9f={};var _0x16102a;var _0x275fb0;return db['OpenchannelAccount'][_0xdeb0('0x6b')]({'where':{'id':_0xc2df73[_0xdeb0('0x54')]['id']}})['then'](handleEntityNotFound(_0x19c780,null))[_0xdeb0('0x33')](function(_0x976409){if(_0x976409){_0x16102a=_0x976409;_0x1c6b9f[_0xdeb0('0x42')]=_[_0xdeb0('0x44')](db[_0xdeb0('0xa8')][_0xdeb0('0x3f')]);_0x1c6b9f[_0xdeb0('0x43')]=_[_0xdeb0('0x44')](_0xc2df73[_0xdeb0('0x43')]);_0x1c6b9f[_0xdeb0('0x45')]=_[_0xdeb0('0x46')](_0x1c6b9f[_0xdeb0('0x42')],_0x1c6b9f[_0xdeb0('0x43')]);_0x5c79e1[_0xdeb0('0x48')]=_['intersection'](_0x1c6b9f[_0xdeb0('0x42')],qs['fields'](_0xc2df73[_0xdeb0('0x43')]['fields']));_0x5c79e1[_0xdeb0('0x48')]=_0x5c79e1[_0xdeb0('0x48')]['length']?_0x5c79e1[_0xdeb0('0x48')]:_0x1c6b9f['model'];_0x5c79e1['order']=qs[_0xdeb0('0x4c')](_0xc2df73[_0xdeb0('0x43')][_0xdeb0('0x4c')]);_0x5c79e1[_0xdeb0('0x4d')]=qs[_0xdeb0('0x45')](_['pick'](_0xc2df73[_0xdeb0('0x43')],_0x1c6b9f['filters']));if(_0xc2df73[_0xdeb0('0x43')][_0xdeb0('0x4e')]){_0x5c79e1['where']=_[_0xdeb0('0x4f')](_0x5c79e1['where'],{'$or':_['map'](_0x5c79e1[_0xdeb0('0x48')],function(_0x17c3db){var _0x18bb97={};_0x18bb97[_0x17c3db]={'$like':'%'+_0xc2df73['query'][_0xdeb0('0x4e')]+'%'};return _0x18bb97;})});}_0x5c79e1=_['merge']({},_0x5c79e1,_0xc2df73[_0xdeb0('0x55')]);return _0x16102a[_0xdeb0('0xb4')](_0x5c79e1);}})[_0xdeb0('0x33')](function(_0x5494a0){if(_0x5494a0){_0x275fb0=_0x5494a0[_0xdeb0('0x49')];if(!_0xc2df73[_0xdeb0('0x43')][_0xdeb0('0x4a')](_0xdeb0('0x63'))){_0x5c79e1[_0xdeb0('0x2e')]=qs[_0xdeb0('0x2e')](_0xc2df73['query']['limit']);_0x5c79e1[_0xdeb0('0x2b')]=qs[_0xdeb0('0x2b')](_0xc2df73[_0xdeb0('0x43')]['offset']);}return _0x16102a[_0xdeb0('0xb4')](_0x5c79e1);}})['then'](function(_0x36b93e){if(_0x36b93e){return _0x36b93e?{'count':_0x275fb0,'rows':_0x36b93e}:null;}})[_0xdeb0('0x33')](respondWithResult(_0x19c780,null))[_0xdeb0('0x53')](handleError(_0x19c780,null));};exports[_0xdeb0('0x3a')]=function(_0xd4edd3,_0x1a762c,_0x32c623){var _0x3d06e8,_0x5453ad,_0x1d64ba;if(_[_0xdeb0('0x78')](_0xd4edd3[_0xdeb0('0x57')]['body'])||_0xd4edd3['body']['body']===''){throw new db[(_0xdeb0('0x71'))]['ValidationError'](_0xdeb0('0x7b'));}if(_['isNil'](_0xd4edd3['body']['to'])){}_0x3d06e8=_0xd4edd3[_0xdeb0('0x57')]['to'];return db[_0xdeb0('0x50')][_0xdeb0('0x6b')]({'where':{'id':_0xd4edd3['params']['id']}})[_0xdeb0('0x33')](handleEntityNotFound(_0x1a762c,null))[_0xdeb0('0x33')](function(_0x2f3c87){if(_0x2f3c87){return db[_0xdeb0('0x50')][_0xdeb0('0x5b')]({'where':{'id':_0x2f3c87['id']},'include':[{'model':db[_0xdeb0('0x7e')],'as':_0xdeb0('0x7f'),'include':[{'model':db['CmContact'],'as':_0xdeb0('0x80'),'where':{[_0x2f3c87['mapKey']]:_0x3d06e8},'limit':0x1,'order':[[_0xdeb0('0x75'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1a762c,null))['then'](function(_0x297e85){if(_0x297e85&&_0x297e85[_0xdeb0('0x7f')]){_0x5453ad=_0x297e85[_0xdeb0('0x35')]({'plain':!![]});if(_0x5453ad[_0xdeb0('0x7f')]&&_0x5453ad[_0xdeb0('0x7f')]['Contacts']['length']){return _0x5453ad['List'][_0xdeb0('0x80')][0x0];}return db[_0xdeb0('0x70')]['create'](_[_0xdeb0('0x18')](_0xd4edd3[_0xdeb0('0x57')],{'firstName':_0x3d06e8,[_0x297e85[_0xdeb0('0x7c')]]:_0x3d06e8,'phone':_0x3d06e8,'ListId':_0x5453ad[_0xdeb0('0x77')]}));}})[_0xdeb0('0x33')](handleEntityNotFound(_0x1a762c,null))['then'](function(_0x416c13){if(_0x416c13){_0x1d64ba=_0x416c13;return db['OpenchannelInteraction'][_0xdeb0('0x5b')]({'where':{'ContactId':_0x1d64ba['id'],'closed':![],'OpenchannelAccountId':_0x5453ad['id']}})['then'](function(_0x1e4378){if(_0x1e4378){return[_0x1e4378,![]];}return db[_0xdeb0('0x8c')]['create']({'UserId':_0xd4edd3[_0xdeb0('0x59')]['id'],'ContactId':_0x1d64ba['id'],'OpenchannelAccountId':_0x5453ad['id'],'lastMsgDirection':'out','firstMsgDirection':_0xdeb0('0xb5'),'Messages':[_[_0xdeb0('0x4f')](_0xd4edd3['body'],{'read':![],'body':_0xd4edd3[_0xdeb0('0x57')][_0xdeb0('0x57')],'OpenchannelAccountId':_0x5453ad['id'],'UserId':_0xd4edd3[_0xdeb0('0x59')]['id'],'ContactId':_0x1d64ba['id']})]},{'include':[{'model':db[_0xdeb0('0x96')],'as':_0xdeb0('0xb6')}]})['then'](function(_0x3be9ab){return[_0x3be9ab,!![]];});});}})[_0xdeb0('0x8f')](function(_0x3c2958,_0x5bd98a){if(_0x5bd98a){return _0x3c2958;}return db[_0xdeb0('0x96')][_0xdeb0('0x56')](_[_0xdeb0('0x4f')](_0xd4edd3['body'],{'read':![],'body':_0xd4edd3[_0xdeb0('0x57')]['body'],'OpenchannelAccountId':_0x5453ad['id'],'OpenchannelInteractionId':_0x3c2958['id'],'UserId':_0xd4edd3['user']['id'],'ContactId':_0x1d64ba['id']}))[_0xdeb0('0x33')](function(_0x46e860){_0x3c2958[_0xdeb0('0xb7')][_0xdeb0('0xb6')]=[];_0x3c2958[_0xdeb0('0xb7')][_0xdeb0('0xb6')][_0xdeb0('0x94')](_0x46e860[_0xdeb0('0xb7')]);return _0x3c2958;});});}})['then'](respondWithResult(_0x1a762c,null))[_0xdeb0('0x53')](handleError(_0x1a762c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3c9d9e5..aaba4b4 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 _0xa571=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa571,0x107));var _0x1a57=function(_0x485ec0,_0x4c1c93){_0x485ec0=_0x485ec0-0x0;var _0x12cb19=_0xa571[_0x485ec0];return _0x12cb19;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var OpenchannelAccount=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a57('0x4'),'afterDestroy':_0x1a57('0x5')};function emitEvent(_0x4d5f7a){return function(_0x5ec815,_0x1f2c44,_0x5067fa){OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a+':'+_0x5ec815['id'],_0x5ec815);OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a,_0x5ec815);_0x5067fa(null);};}for(var e in events){if(events[_0x1a57('0x7')](e)){var event=events[e];OpenchannelAccount[_0x1a57('0x8')](e,emitEvent(event));}}module[_0x1a57('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x750a=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x322f4d,_0x2211c6){var _0x548443=function(_0x5f42a4){while(--_0x5f42a4){_0x322f4d['push'](_0x322f4d['shift']());}};_0x548443(++_0x2211c6);}(_0x750a,0x140));var _0xa750=function(_0x344d90,_0x14d67e){_0x344d90=_0x344d90-0x0;var _0x13c3d5=_0x750a[_0x344d90];return _0x13c3d5;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xa750('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa750('0x1'),'afterUpdate':_0xa750('0x2'),'afterDestroy':_0xa750('0x3')};function emitEvent(_0x19bd5f){return function(_0x457cae,_0x43d704,_0x562911){OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f+':'+_0x457cae['id'],_0x457cae);OpenchannelAccountEvents[_0xa750('0x4')](_0x19bd5f,_0x457cae);_0x562911(null);};}for(var e in events){if(events[_0xa750('0x5')](e)){var event=events[e];OpenchannelAccount[_0xa750('0x6')](e,emitEvent(event));}}module[_0xa750('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index eb1e67d..e12d081 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(_0x2740f6,_0xfb2ddd){var _0x5af397=function(_0x5bceb2){while(--_0x5bceb2){_0x2740f6['push'](_0x2740f6['shift']());}};_0x5af397(++_0xfb2ddd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x4032e4,_0xce2da1){var _0x5a73a9=function(_0x4b0deb){while(--_0x4b0deb){_0x4032e4['push'](_0x4032e4['shift']());}};_0x5a73a9(++_0xce2da1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 b7a1f0b..76be309 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 _0x4227=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x4227,0x89));var _0x7422=function(_0x4877c3,_0x3b4bb5){_0x4877c3=_0x4877c3-0x0;var _0x46d98e=_0x4227[_0x4877c3];return _0x46d98e;};'use strict';var _=require(_0x7422('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7422('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7422('0x2'));var db=require(_0x7422('0x3'))['db'];var utils=require(_0x7422('0x4'));var logger=require('../../config/logger')(_0x7422('0x5'));var config=require(_0x7422('0x6'));var jayson=require(_0x7422('0x7'));var client=jayson[_0x7422('0x8')][_0x7422('0x9')]({'port':0x232a});config[_0x7422('0xa')]=_[_0x7422('0xb')](config[_0x7422('0xa')],{'host':_0x7422('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7422('0xa')]));require(_0x7422('0xd'))[_0x7422('0xe')](socket);function respondWithRpcPromise(_0x511340,_0x1603ee,_0x5f27cb){return new BPromise(function(_0x3cc76d,_0x37be02){return client[_0x7422('0xf')](_0x511340,_0x5f27cb)[_0x7422('0x10')](function(_0x15a472){logger['info'](_0x7422('0x11'),_0x1603ee,_0x7422('0x12'));logger['debug'](_0x7422('0x13'),_0x1603ee,_0x7422('0x12'),JSON['stringify'](_0x15a472));if(_0x15a472[_0x7422('0x14')]){if(_0x15a472[_0x7422('0x14')]['code']===0x1f4){logger['error'](_0x7422('0x11'),_0x1603ee,_0x15a472['error'][_0x7422('0x15')]);return _0x37be02(_0x15a472[_0x7422('0x14')]['message']);}logger[_0x7422('0x14')](_0x7422('0x11'),_0x1603ee,_0x15a472[_0x7422('0x14')][_0x7422('0x15')]);return _0x3cc76d(_0x15a472[_0x7422('0x14')][_0x7422('0x15')]);}else{logger['info'](_0x7422('0x11'),_0x1603ee,_0x7422('0x12'));_0x3cc76d(_0x15a472[_0x7422('0x16')][_0x7422('0x15')]);}})['catch'](function(_0x1f9e09){logger['error'](_0x7422('0x11'),_0x1603ee,_0x1f9e09);_0x37be02(_0x1f9e09);});});} \ No newline at end of file +var _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x4573b5,_0x41574f){var _0x2290ac=function(_0x1003d){while(--_0x1003d){_0x4573b5['push'](_0x4573b5['shift']());}};_0x2290ac(++_0x41574f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2f2481,_0x397cc6){_0x2f2481=_0x2f2481-0x0;var _0x35fe7b=_0xee5b[_0x2f2481];return _0x35fe7b;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});config[_0xbee5('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbee5('0xb'))[_0xbee5('0xc')](socket);function respondWithRpcPromise(_0x45c2c7,_0x20f717,_0x4a15bf){return new BPromise(function(_0x143bd6,_0x305921){return client[_0xbee5('0xd')](_0x45c2c7,_0x4a15bf)[_0xbee5('0xe')](function(_0x16377d){logger[_0xbee5('0xf')](_0xbee5('0x10'),_0x20f717,_0xbee5('0x11'));logger[_0xbee5('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x20f717,_0xbee5('0x11'),JSON['stringify'](_0x16377d));if(_0x16377d[_0xbee5('0x13')]){if(_0x16377d[_0xbee5('0x13')][_0xbee5('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x20f717,_0x16377d[_0xbee5('0x13')]['message']);return _0x305921(_0x16377d[_0xbee5('0x13')]['message']);}logger[_0xbee5('0x13')](_0xbee5('0x10'),_0x20f717,_0x16377d[_0xbee5('0x13')]['message']);return _0x143bd6(_0x16377d[_0xbee5('0x13')][_0xbee5('0x15')]);}else{logger['info'](_0xbee5('0x10'),_0x20f717,_0xbee5('0x11'));_0x143bd6(_0x16377d[_0xbee5('0x16')][_0xbee5('0x15')]);}})[_0xbee5('0x17')](function(_0xac51f5){logger[_0xbee5('0x13')](_0xbee5('0x10'),_0x20f717,_0xac51f5);_0x305921(_0xac51f5);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a8e1f44..c1dc20d 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 _0xec56=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','update','emit'];(function(_0x291659,_0x55ef07){var _0xa6afaf=function(_0x758d77){while(--_0x758d77){_0x291659['push'](_0x291659['shift']());}};_0xa6afaf(++_0x55ef07);}(_0xec56,0x1bd));var _0x6ec5=function(_0x42506e,_0x4367ff){_0x42506e=_0x42506e-0x0;var _0x472b69=_0xec56[_0x42506e];return _0x472b69;};'use strict';var OpenchannelAccountEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){OpenchannelAccountEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);OpenchannelAccountEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file +var _0x0c5d=['./openchannelAccount.events','save','update','emit','removeListener','register'];(function(_0x204047,_0x2df7af){var _0x5956d2=function(_0x2d32a8){while(--_0x2d32a8){_0x204047['push'](_0x204047['shift']());}};_0x5956d2(++_0x2df7af);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x4261ba,_0x3e8c96){_0x4261ba=_0x4261ba-0x0;var _0x42ed58=_0x0c5d[_0x4261ba];return _0x42ed58;};'use strict';var OpenchannelAccountEvents=require(_0xd0c5('0x0'));var events=[_0xd0c5('0x1'),'remove',_0xd0c5('0x2')];function createListener(_0x489424,_0x236d6c){return function(_0x2dfaba){_0x236d6c[_0xd0c5('0x3')](_0x489424,_0x2dfaba);};}function removeListener(_0x177811,_0x4664bc){return function(){OpenchannelAccountEvents[_0xd0c5('0x4')](_0x177811,_0x4664bc);};}exports[_0xd0c5('0x5')]=function(_0x121911){for(var _0x569992=0x0,_0x2ef2f6=events['length'];_0x569992<_0x2ef2f6;_0x569992++){var _0x47f0f4=events[_0x569992];var _0x365e04=createListener('openchannelAccount:'+_0x47f0f4,_0x121911);OpenchannelAccountEvents['on'](_0x47f0f4,_0x365e04);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e0d6aff..1f04562 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 _0xc541=['get','index','show','post','isAuthenticated','create','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5822a4,_0x4ff629){var _0x27f186=function(_0x534d48){while(--_0x534d48){_0x5822a4['push'](_0x5822a4['shift']());}};_0x27f186(++_0x4ff629);}(_0xc541,0x16f));var _0x1c54=function(_0x3ed1c1,_0x45fe0a){_0x3ed1c1=_0x3ed1c1-0x0;var _0x11797d=_0xc541[_0x3ed1c1];return _0x11797d;};'use strict';var multer=require('multer');var util=require(_0x1c54('0x0'));var path=require(_0x1c54('0x1'));var timeout=require(_0x1c54('0x2'));var express=require('express');var router=express[_0x1c54('0x3')]();var fs_extra=require(_0x1c54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c54('0x5'));var config=require(_0x1c54('0x6'));var controller=require('./openchannelApplication.controller');router[_0x1c54('0x7')]('/',auth['isAuthenticated'](),controller[_0x1c54('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1c54('0x9')]);router[_0x1c54('0xa')]('/',auth[_0x1c54('0xb')](),controller[_0x1c54('0xc')]);router['put'](_0x1c54('0xd'),auth[_0x1c54('0xb')](),controller['update']);router[_0x1c54('0xe')](_0x1c54('0xd'),auth[_0x1c54('0xb')](),controller[_0x1c54('0xf')]);module[_0x1c54('0x10')]=router; \ No newline at end of file +var _0x0e27=['Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0xe0cb01,_0x370366){var _0xe0c3f0=function(_0x4dc187){while(--_0x4dc187){_0xe0cb01['push'](_0xe0cb01['shift']());}};_0xe0c3f0(++_0x370366);}(_0x0e27,0x81));var _0x70e2=function(_0x3a89dc,_0x54bb1e){_0x3a89dc=_0x3a89dc-0x0;var _0x11c5c9=_0x0e27[_0x3a89dc];return _0x11c5c9;};'use strict';var multer=require(_0x70e2('0x0'));var util=require(_0x70e2('0x1'));var path=require(_0x70e2('0x2'));var timeout=require(_0x70e2('0x3'));var express=require('express');var router=express[_0x70e2('0x4')]();var fs_extra=require(_0x70e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x70e2('0x6'));var config=require(_0x70e2('0x7'));var controller=require(_0x70e2('0x8'));router[_0x70e2('0x9')]('/',auth[_0x70e2('0xa')](),controller[_0x70e2('0xb')]);router[_0x70e2('0x9')](_0x70e2('0xc'),auth[_0x70e2('0xa')](),controller[_0x70e2('0xd')]);router[_0x70e2('0xe')]('/',auth['isAuthenticated'](),controller[_0x70e2('0xf')]);router[_0x70e2('0x10')](_0x70e2('0xc'),auth[_0x70e2('0xa')](),controller[_0x70e2('0x11')]);router['delete'](_0x70e2('0xc'),auth[_0x70e2('0xa')](),controller['destroy']);module[_0x70e2('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index bf03213..ba5d369 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 _0x506b=['INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x506b,0xf3));var _0xb506=function(_0x154f9f,_0x502ba8){_0x154f9f=_0x154f9f-0x0;var _0x1f0e68=_0x506b[_0x154f9f];return _0x1f0e68;};'use strict';var Sequelize=require(_0xb506('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb506('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb506('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb506('0x2')]},'interval':{'type':Sequelize[_0xb506('0x2')],'defaultValue':_0xb506('0x3')}}; \ No newline at end of file +var _0x85f7=['STRING','exports','INTEGER','noop'];(function(_0x5c027f,_0xa40135){var _0x5392f3=function(_0x581c3b){while(--_0x581c3b){_0x5c027f['push'](_0x5c027f['shift']());}};_0x5392f3(++_0xa40135);}(_0x85f7,0x1ad));var _0x785f=function(_0x1d7428,_0x23ebec){_0x1d7428=_0x1d7428-0x0;var _0xab8364=_0x85f7[_0x1d7428];return _0xab8364;};'use strict';var Sequelize=require('sequelize');module[_0x785f('0x0')]={'priority':{'type':Sequelize[_0x785f('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x785f('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x785f('0x3')]},'interval':{'type':Sequelize[_0x785f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index c800b98..887ca99 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 _0x8bac=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','OpenchannelApplication','fieldName'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8bac,0xaa));var _0xc8ba=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x8bac[_0x715d76];return _0x48fe88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8ba('0x0'));var jsonpatch=require(_0xc8ba('0x1'));var rp=require(_0xc8ba('0x2'));var moment=require('moment');var BPromise=require(_0xc8ba('0x3'));var Mustache=require('mustache');var util=require(_0xc8ba('0x4'));var path=require(_0xc8ba('0x5'));var sox=require(_0xc8ba('0x6'));var csv=require(_0xc8ba('0x7'));var ejs=require(_0xc8ba('0x8'));var fs=require('fs');var fs_extra=require(_0xc8ba('0x9'));var _=require(_0xc8ba('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc8ba('0xb'));var deskjs=require(_0xc8ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc8ba('0xd'));var Papa=require(_0xc8ba('0xe'));var Redis=require(_0xc8ba('0xf'));var authService=require(_0xc8ba('0x10'));var qs=require(_0xc8ba('0x11'));var as=require(_0xc8ba('0x12'));var hardwareService=require(_0xc8ba('0x13'));var logger=require(_0xc8ba('0x14'))(_0xc8ba('0x15'));var utils=require(_0xc8ba('0x16'));var config=require(_0xc8ba('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d2831,_0x225133){_0x225133=_0x225133||0xcc;return function(_0x6c2ba1){if(_0x6c2ba1){return _0x2d2831[_0xc8ba('0x18')](_0x225133);}return _0x2d2831['status'](_0x225133)['end']();};}function respondWithResult(_0x2ce211,_0x332356){_0x332356=_0x332356||0xc8;return function(_0x38ae3c){if(_0x38ae3c){return _0x2ce211[_0xc8ba('0x19')](_0x332356)[_0xc8ba('0x1a')](_0x38ae3c);}};}function respondWithFilteredResult(_0x39f35,_0x109f40){return function(_0x2528f5){if(_0x2528f5){var _0x7b1750=typeof _0x109f40[_0xc8ba('0x1b')]===_0xc8ba('0x1c')&&typeof _0x109f40[_0xc8ba('0x1d')]===_0xc8ba('0x1c');var _0x1c7ea1=_0x2528f5[_0xc8ba('0x1e')];var _0xee68b5=_0x7b1750?0x0:_0x109f40[_0xc8ba('0x1b')];var _0x1bdc73=_0x7b1750?_0x2528f5['count']:_0x109f40[_0xc8ba('0x1b')]+_0x109f40[_0xc8ba('0x1d')];var _0x2a09f6;if(_0x1bdc73>=_0x1c7ea1){_0x1bdc73=_0x1c7ea1;_0x2a09f6=0xc8;}else{_0x2a09f6=0xce;}_0x39f35[_0xc8ba('0x19')](_0x2a09f6);return _0x39f35[_0xc8ba('0x1f')](_0xc8ba('0x20'),_0xee68b5+'-'+_0x1bdc73+'/'+_0x1c7ea1)[_0xc8ba('0x1a')](_0x2528f5);}return null;};}function patchUpdates(_0x5af771){return function(_0x322151){try{jsonpatch['apply'](_0x322151,_0x5af771,!![]);}catch(_0x513f6e){return BPromise['reject'](_0x513f6e);}return _0x322151['save']();};}function saveUpdates(_0xff44ce,_0x2a747d){return function(_0x4d2e84){if(_0x4d2e84){return _0x4d2e84[_0xc8ba('0x21')](_0xff44ce)[_0xc8ba('0x22')](function(_0x57bcaf){return _0x57bcaf;});}return null;};}function removeEntity(_0x24935e,_0x339757){return function(_0x2c1b56){if(_0x2c1b56){return _0x2c1b56[_0xc8ba('0x23')]()['then'](function(){_0x24935e[_0xc8ba('0x19')](0xcc)[_0xc8ba('0x24')]();});}};}function handleEntityNotFound(_0x2ab9d4,_0x9154a0){return function(_0x182dcf){if(!_0x182dcf){_0x2ab9d4[_0xc8ba('0x18')](0x194);}return _0x182dcf;};}function handleError(_0x22c428,_0x255e99){_0x255e99=_0x255e99||0x1f4;return function(_0x3fc6d3){logger[_0xc8ba('0x25')](_0x3fc6d3['stack']);if(_0x3fc6d3['name']){delete _0x3fc6d3[_0xc8ba('0x26')];}_0x22c428[_0xc8ba('0x19')](_0x255e99)[_0xc8ba('0x27')](_0x3fc6d3);};}exports[_0xc8ba('0x28')]=function(_0x533acb,_0x4d631a){var _0xaa8f56={},_0x41f29a={},_0x2c73df={'count':0x0,'rows':[]};var _0x34b0d0=_['map'](db[_0xc8ba('0x29')]['rawAttributes'],function(_0x342007){return{'name':_0x342007[_0xc8ba('0x2a')],'type':_0x342007[_0xc8ba('0x2b')][_0xc8ba('0x2c')]};});_0x41f29a[_0xc8ba('0x2d')]=_[_0xc8ba('0x2e')](_0x34b0d0,_0xc8ba('0x26'));_0x41f29a['query']=_[_0xc8ba('0x2f')](_0x533acb[_0xc8ba('0x30')]);_0x41f29a[_0xc8ba('0x31')]=_[_0xc8ba('0x32')](_0x41f29a[_0xc8ba('0x2d')],_0x41f29a['query']);_0xaa8f56[_0xc8ba('0x33')]=_['intersection'](_0x41f29a['model'],qs[_0xc8ba('0x34')](_0x533acb[_0xc8ba('0x30')][_0xc8ba('0x34')]));_0xaa8f56['attributes']=_0xaa8f56['attributes'][_0xc8ba('0x35')]?_0xaa8f56[_0xc8ba('0x33')]:_0x41f29a[_0xc8ba('0x2d')];if(!_0x533acb[_0xc8ba('0x30')]['hasOwnProperty'](_0xc8ba('0x36'))){_0xaa8f56[_0xc8ba('0x1d')]=qs[_0xc8ba('0x1d')](_0x533acb[_0xc8ba('0x30')][_0xc8ba('0x1d')]);_0xaa8f56[_0xc8ba('0x1b')]=qs[_0xc8ba('0x1b')](_0x533acb['query']['offset']);}_0xaa8f56[_0xc8ba('0x37')]=qs['sort'](_0x533acb[_0xc8ba('0x30')]['sort']);_0xaa8f56[_0xc8ba('0x38')]=qs[_0xc8ba('0x31')](_[_0xc8ba('0x39')](_0x533acb[_0xc8ba('0x30')],_0x41f29a[_0xc8ba('0x31')]),_0x34b0d0);if(_0x533acb['query'][_0xc8ba('0x3a')]){_0xaa8f56[_0xc8ba('0x38')]=_['merge'](_0xaa8f56['where'],{'$or':_[_0xc8ba('0x2e')](_0x34b0d0,function(_0x2d3120){if(_0x2d3120[_0xc8ba('0x2b')]!==_0xc8ba('0x3b')){var _0x460c8c={};_0x460c8c[_0x2d3120['name']]={'$like':'%'+_0x533acb[_0xc8ba('0x30')][_0xc8ba('0x3a')]+'%'};return _0x460c8c;}})});}_0xaa8f56=_[_0xc8ba('0x3c')]({},_0xaa8f56,_0x533acb[_0xc8ba('0x3d')]);var _0x2ba23e={'where':_0xaa8f56['where']};return db[_0xc8ba('0x29')][_0xc8ba('0x1e')](_0x2ba23e)['then'](function(_0x53ea81){_0x2c73df[_0xc8ba('0x1e')]=_0x53ea81;if(_0x533acb[_0xc8ba('0x30')]['includeAll']){_0xaa8f56[_0xc8ba('0x3e')]=[{'all':!![]}];}return db[_0xc8ba('0x29')][_0xc8ba('0x3f')](_0xaa8f56);})['then'](function(_0x38044d){_0x2c73df['rows']=_0x38044d;return _0x2c73df;})[_0xc8ba('0x22')](respondWithFilteredResult(_0x4d631a,_0xaa8f56))[_0xc8ba('0x40')](handleError(_0x4d631a,null));};exports['show']=function(_0x404c7b,_0x57e9c2){var _0x20019c={'raw':!![],'where':{'id':_0x404c7b[_0xc8ba('0x41')]['id']}},_0x28a12f={};_0x28a12f[_0xc8ba('0x2d')]=_[_0xc8ba('0x2f')](db[_0xc8ba('0x29')][_0xc8ba('0x42')]);_0x28a12f[_0xc8ba('0x30')]=_[_0xc8ba('0x2f')](_0x404c7b[_0xc8ba('0x30')]);_0x28a12f[_0xc8ba('0x31')]=_[_0xc8ba('0x32')](_0x28a12f['model'],_0x28a12f[_0xc8ba('0x30')]);_0x20019c[_0xc8ba('0x33')]=_[_0xc8ba('0x32')](_0x28a12f[_0xc8ba('0x2d')],qs['fields'](_0x404c7b[_0xc8ba('0x30')]['fields']));_0x20019c[_0xc8ba('0x33')]=_0x20019c[_0xc8ba('0x33')][_0xc8ba('0x35')]?_0x20019c[_0xc8ba('0x33')]:_0x28a12f[_0xc8ba('0x2d')];if(_0x404c7b[_0xc8ba('0x30')][_0xc8ba('0x43')]){_0x20019c[_0xc8ba('0x3e')]=[{'all':!![]}];}_0x20019c=_['merge']({},_0x20019c,_0x404c7b[_0xc8ba('0x3d')]);return db[_0xc8ba('0x29')][_0xc8ba('0x44')](_0x20019c)[_0xc8ba('0x22')](handleEntityNotFound(_0x57e9c2,null))[_0xc8ba('0x22')](respondWithResult(_0x57e9c2,null))[_0xc8ba('0x40')](handleError(_0x57e9c2,null));};exports[_0xc8ba('0x45')]=function(_0x125d5e,_0x25a843){return db[_0xc8ba('0x29')][_0xc8ba('0x45')](_0x125d5e[_0xc8ba('0x46')],{})[_0xc8ba('0x22')](respondWithResult(_0x25a843,0xc9))[_0xc8ba('0x40')](handleError(_0x25a843,null));};exports[_0xc8ba('0x21')]=function(_0x505e2d,_0x36573f){if(_0x505e2d[_0xc8ba('0x46')]['id']){delete _0x505e2d[_0xc8ba('0x46')]['id'];}return db[_0xc8ba('0x29')]['find']({'where':{'id':_0x505e2d[_0xc8ba('0x41')]['id']}})[_0xc8ba('0x22')](handleEntityNotFound(_0x36573f,null))[_0xc8ba('0x22')](saveUpdates(_0x505e2d['body'],null))[_0xc8ba('0x22')](respondWithResult(_0x36573f,null))[_0xc8ba('0x40')](handleError(_0x36573f,null));};exports[_0xc8ba('0x23')]=function(_0x1025e9,_0xa1ad07){return db[_0xc8ba('0x29')]['find']({'where':{'id':_0x1025e9[_0xc8ba('0x41')]['id']}})[_0xc8ba('0x22')](handleEntityNotFound(_0xa1ad07,null))[_0xc8ba('0x22')](removeEntity(_0xa1ad07,null))[_0xc8ba('0x40')](handleError(_0xa1ad07,null));}; \ No newline at end of file +var _0xa484=['keys','rawAttributes','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0xd2e533,_0x1dcede){var _0x2f52ae=function(_0x42b355){while(--_0x42b355){_0xd2e533['push'](_0xd2e533['shift']());}};_0x2f52ae(++_0x1dcede);}(_0xa484,0x1ce));var _0x4a48=function(_0x28e16f,_0x2f93f1){_0x28e16f=_0x28e16f-0x0;var _0x3a0e2d=_0xa484[_0x28e16f];return _0x3a0e2d;};'use strict';var emlformat=require(_0x4a48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a48('0x1'));var jsonpatch=require(_0x4a48('0x2'));var rp=require(_0x4a48('0x3'));var moment=require(_0x4a48('0x4'));var BPromise=require(_0x4a48('0x5'));var Mustache=require(_0x4a48('0x6'));var util=require(_0x4a48('0x7'));var path=require('path');var sox=require(_0x4a48('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a48('0x9'));var _=require(_0x4a48('0xa'));var squel=require('squel');var crypto=require(_0x4a48('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a48('0xc'));var querystring=require('querystring');var Papa=require(_0x4a48('0xd'));var Redis=require(_0x4a48('0xe'));var authService=require(_0x4a48('0xf'));var qs=require(_0x4a48('0x10'));var as=require(_0x4a48('0x11'));var hardwareService=require(_0x4a48('0x12'));var logger=require(_0x4a48('0x13'))(_0x4a48('0x14'));var utils=require(_0x4a48('0x15'));var config=require(_0x4a48('0x16'));var licenseUtil=require(_0x4a48('0x17'));var db=require(_0x4a48('0x18'))['db'];function respondWithStatusCode(_0x52d0d5,_0x2629c7){_0x2629c7=_0x2629c7||0xcc;return function(_0x17a958){if(_0x17a958){return _0x52d0d5[_0x4a48('0x19')](_0x2629c7);}return _0x52d0d5[_0x4a48('0x1a')](_0x2629c7)['end']();};}function respondWithResult(_0x49cc44,_0x490400){_0x490400=_0x490400||0xc8;return function(_0x416115){if(_0x416115){return _0x49cc44['status'](_0x490400)[_0x4a48('0x1b')](_0x416115);}};}function respondWithFilteredResult(_0x50c65b,_0x2c03e2){return function(_0x40edae){if(_0x40edae){var _0x2950d0=typeof _0x2c03e2['offset']==='undefined'&&typeof _0x2c03e2[_0x4a48('0x1c')]===_0x4a48('0x1d');var _0x14b09b=_0x40edae[_0x4a48('0x1e')];var _0x55245c=_0x2950d0?0x0:_0x2c03e2[_0x4a48('0x1f')];var _0xaea408=_0x2950d0?_0x40edae['count']:_0x2c03e2[_0x4a48('0x1f')]+_0x2c03e2[_0x4a48('0x1c')];var _0x385027;if(_0xaea408>=_0x14b09b){_0xaea408=_0x14b09b;_0x385027=0xc8;}else{_0x385027=0xce;}_0x50c65b['status'](_0x385027);return _0x50c65b[_0x4a48('0x20')]('Content-Range',_0x55245c+'-'+_0xaea408+'/'+_0x14b09b)[_0x4a48('0x1b')](_0x40edae);}return null;};}function patchUpdates(_0x446deb){return function(_0x561bd3){try{jsonpatch[_0x4a48('0x21')](_0x561bd3,_0x446deb,!![]);}catch(_0x3594b9){return BPromise[_0x4a48('0x22')](_0x3594b9);}return _0x561bd3[_0x4a48('0x23')]();};}function saveUpdates(_0x486db7,_0x4ba2d8){return function(_0xee61f1){if(_0xee61f1){return _0xee61f1[_0x4a48('0x24')](_0x486db7)[_0x4a48('0x25')](function(_0x529420){return _0x529420;});}return null;};}function removeEntity(_0x53e354,_0x11aaca){return function(_0x502926){if(_0x502926){return _0x502926[_0x4a48('0x26')]()[_0x4a48('0x25')](function(){_0x53e354['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e48c2,_0x2aa113){return function(_0x23e246){if(!_0x23e246){_0x4e48c2['sendStatus'](0x194);}return _0x23e246;};}function handleError(_0x3a7163,_0x401f7b){_0x401f7b=_0x401f7b||0x1f4;return function(_0x317cd4){logger[_0x4a48('0x27')](_0x317cd4[_0x4a48('0x28')]);if(_0x317cd4['name']){delete _0x317cd4[_0x4a48('0x29')];}_0x3a7163[_0x4a48('0x1a')](_0x401f7b)[_0x4a48('0x2a')](_0x317cd4);};}exports[_0x4a48('0x2b')]=function(_0x3ee768,_0x56771a){var _0x97d03a={},_0x449551={},_0x20b20d={'count':0x0,'rows':[]};var _0x15c02a=_[_0x4a48('0x2c')](db[_0x4a48('0x2d')]['rawAttributes'],function(_0x4e2f2d){return{'name':_0x4e2f2d[_0x4a48('0x2e')],'type':_0x4e2f2d[_0x4a48('0x2f')][_0x4a48('0x30')]};});_0x449551[_0x4a48('0x31')]=_['map'](_0x15c02a,_0x4a48('0x29'));_0x449551[_0x4a48('0x32')]=_['keys'](_0x3ee768[_0x4a48('0x32')]);_0x449551['filters']=_[_0x4a48('0x33')](_0x449551[_0x4a48('0x31')],_0x449551[_0x4a48('0x32')]);_0x97d03a[_0x4a48('0x34')]=_[_0x4a48('0x33')](_0x449551[_0x4a48('0x31')],qs[_0x4a48('0x35')](_0x3ee768['query'][_0x4a48('0x35')]));_0x97d03a[_0x4a48('0x34')]=_0x97d03a['attributes'][_0x4a48('0x36')]?_0x97d03a[_0x4a48('0x34')]:_0x449551[_0x4a48('0x31')];if(!_0x3ee768['query'][_0x4a48('0x37')]('nolimit')){_0x97d03a[_0x4a48('0x1c')]=qs[_0x4a48('0x1c')](_0x3ee768['query'][_0x4a48('0x1c')]);_0x97d03a[_0x4a48('0x1f')]=qs[_0x4a48('0x1f')](_0x3ee768[_0x4a48('0x32')]['offset']);}_0x97d03a['order']=qs['sort'](_0x3ee768[_0x4a48('0x32')][_0x4a48('0x38')]);_0x97d03a[_0x4a48('0x39')]=qs['filters'](_[_0x4a48('0x3a')](_0x3ee768['query'],_0x449551[_0x4a48('0x3b')]),_0x15c02a);if(_0x3ee768[_0x4a48('0x32')]['filter']){_0x97d03a[_0x4a48('0x39')]=_['merge'](_0x97d03a[_0x4a48('0x39')],{'$or':_[_0x4a48('0x2c')](_0x15c02a,function(_0x580cc0){if(_0x580cc0['type']!==_0x4a48('0x3c')){var _0x5deddd={};_0x5deddd[_0x580cc0[_0x4a48('0x29')]]={'$like':'%'+_0x3ee768['query'][_0x4a48('0x3d')]+'%'};return _0x5deddd;}})});}_0x97d03a=_[_0x4a48('0x3e')]({},_0x97d03a,_0x3ee768[_0x4a48('0x3f')]);var _0x3bce4d={'where':_0x97d03a[_0x4a48('0x39')]};return db[_0x4a48('0x2d')][_0x4a48('0x1e')](_0x3bce4d)[_0x4a48('0x25')](function(_0xcdcc1f){_0x20b20d[_0x4a48('0x1e')]=_0xcdcc1f;if(_0x3ee768['query'][_0x4a48('0x40')]){_0x97d03a[_0x4a48('0x41')]=[{'all':!![]}];}return db[_0x4a48('0x2d')][_0x4a48('0x42')](_0x97d03a);})[_0x4a48('0x25')](function(_0x126047){_0x20b20d[_0x4a48('0x43')]=_0x126047;return _0x20b20d;})[_0x4a48('0x25')](respondWithFilteredResult(_0x56771a,_0x97d03a))[_0x4a48('0x44')](handleError(_0x56771a,null));};exports[_0x4a48('0x45')]=function(_0x4678f0,_0x5dfea0){var _0x20af35={'raw':!![],'where':{'id':_0x4678f0['params']['id']}},_0xf8cd12={};_0xf8cd12['model']=_[_0x4a48('0x46')](db['OpenchannelApplication'][_0x4a48('0x47')]);_0xf8cd12['query']=_[_0x4a48('0x46')](_0x4678f0[_0x4a48('0x32')]);_0xf8cd12[_0x4a48('0x3b')]=_['intersection'](_0xf8cd12[_0x4a48('0x31')],_0xf8cd12[_0x4a48('0x32')]);_0x20af35[_0x4a48('0x34')]=_['intersection'](_0xf8cd12['model'],qs[_0x4a48('0x35')](_0x4678f0[_0x4a48('0x32')]['fields']));_0x20af35[_0x4a48('0x34')]=_0x20af35[_0x4a48('0x34')][_0x4a48('0x36')]?_0x20af35['attributes']:_0xf8cd12['model'];if(_0x4678f0[_0x4a48('0x32')][_0x4a48('0x40')]){_0x20af35['include']=[{'all':!![]}];}_0x20af35=_['merge']({},_0x20af35,_0x4678f0[_0x4a48('0x3f')]);return db[_0x4a48('0x2d')][_0x4a48('0x48')](_0x20af35)[_0x4a48('0x25')](handleEntityNotFound(_0x5dfea0,null))[_0x4a48('0x25')](respondWithResult(_0x5dfea0,null))[_0x4a48('0x44')](handleError(_0x5dfea0,null));};exports[_0x4a48('0x49')]=function(_0x423a13,_0x54c9c4){return db[_0x4a48('0x2d')][_0x4a48('0x49')](_0x423a13[_0x4a48('0x4a')],{})[_0x4a48('0x25')](respondWithResult(_0x54c9c4,0xc9))[_0x4a48('0x44')](handleError(_0x54c9c4,null));};exports[_0x4a48('0x24')]=function(_0x3432c4,_0x3cd263){if(_0x3432c4['body']['id']){delete _0x3432c4[_0x4a48('0x4a')]['id'];}return db[_0x4a48('0x2d')][_0x4a48('0x48')]({'where':{'id':_0x3432c4[_0x4a48('0x4b')]['id']}})[_0x4a48('0x25')](handleEntityNotFound(_0x3cd263,null))[_0x4a48('0x25')](saveUpdates(_0x3432c4[_0x4a48('0x4a')],null))[_0x4a48('0x25')](respondWithResult(_0x3cd263,null))[_0x4a48('0x44')](handleError(_0x3cd263,null));};exports['destroy']=function(_0x5ab2ff,_0xc4cc85){return db[_0x4a48('0x2d')]['find']({'where':{'id':_0x5ab2ff['params']['id']}})[_0x4a48('0x25')](handleEntityNotFound(_0xc4cc85,null))[_0x4a48('0x25')](removeEntity(_0xc4cc85,null))['catch'](handleError(_0xc4cc85,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a25c586..d843b18 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 _0x1d9c=['../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf'];(function(_0x5b0779,_0x40d92a){var _0x2d8671=function(_0x5cd62d){while(--_0x5cd62d){_0x5b0779['push'](_0x5b0779['shift']());}};_0x2d8671(++_0x40d92a);}(_0x1d9c,0x1b6));var _0xc1d9=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0x1d9c[_0x46306f];return _0x16a27f;};'use strict';var _=require(_0xc1d9('0x0'));var util=require(_0xc1d9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc1d9('0x2'));var BPromise=require(_0xc1d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1d9('0x4'));var rimraf=require(_0xc1d9('0x5'));var config=require(_0xc1d9('0x6'));var attributes=require(_0xc1d9('0x7'));module[_0xc1d9('0x8')]=function(_0x4e4e1d,_0x12ec80){return _0x4e4e1d[_0xc1d9('0x9')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc1d9('0xa'),'collate':_0xc1d9('0xb')});}; \ No newline at end of file +var _0x3a50=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2049d8,_0x38755b){var _0x2afc52=function(_0x48542b){while(--_0x48542b){_0x2049d8['push'](_0x2049d8['shift']());}};_0x2afc52(++_0x38755b);}(_0x3a50,0xf2));var _0x03a5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x3a50[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x03a5('0x0'));var logger=require(_0x03a5('0x1'))('api');var moment=require(_0x03a5('0x2'));var BPromise=require(_0x03a5('0x3'));var rp=require(_0x03a5('0x4'));var fs=require('fs');var path=require(_0x03a5('0x5'));var rimraf=require(_0x03a5('0x6'));var config=require(_0x03a5('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x03a5('0x8')]=function(_0x4fb5ba,_0x2d19cc){return _0x4fb5ba[_0x03a5('0x9')](_0x03a5('0xa'),attributes,{'tableName':_0x03a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03a5('0xc'),'collate':_0x03a5('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 011fdc6..6bb7161 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 _0x2324=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2324,0xe2));var _0x4232=function(_0x360634,_0x1d91e2){_0x360634=_0x360634-0x0;var _0x8baf82=_0x2324[_0x360634];return _0x8baf82;};'use strict';var _=require(_0x4232('0x0'));var util=require(_0x4232('0x1'));var moment=require(_0x4232('0x2'));var BPromise=require(_0x4232('0x3'));var rs=require(_0x4232('0x4'));var fs=require('fs');var Redis=require(_0x4232('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4232('0x6'));var logger=require('../../config/logger')(_0x4232('0x7'));var config=require('../../config/environment');var jayson=require(_0x4232('0x8'));var client=jayson[_0x4232('0x9')][_0x4232('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26c0df,_0x51bb78,_0x27e533){return new BPromise(function(_0x5f1939,_0x4075b2){return client[_0x4232('0xb')](_0x26c0df,_0x27e533)[_0x4232('0xc')](function(_0x471ae2){logger[_0x4232('0xd')](_0x4232('0xe'),_0x51bb78,'request\x20sent');logger[_0x4232('0xf')](_0x4232('0x10'),_0x51bb78,_0x4232('0x11'),JSON[_0x4232('0x12')](_0x471ae2));if(_0x471ae2[_0x4232('0x13')]){if(_0x471ae2[_0x4232('0x13')]['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x51bb78,_0x471ae2['error']['message']);return _0x4075b2(_0x471ae2[_0x4232('0x13')][_0x4232('0x14')]);}logger[_0x4232('0x13')](_0x4232('0xe'),_0x51bb78,_0x471ae2['error'][_0x4232('0x14')]);return _0x5f1939(_0x471ae2['error'][_0x4232('0x14')]);}else{logger[_0x4232('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x51bb78,_0x4232('0x11'));_0x5f1939(_0x471ae2[_0x4232('0x15')][_0x4232('0x14')]);}})[_0x4232('0x16')](function(_0x4db886){logger[_0x4232('0x13')](_0x4232('0xe'),_0x51bb78,_0x4db886);_0x4075b2(_0x4db886);});});}exports[_0x4232('0x17')]=function(_0x3d582b){var _0x36fa41=this;return new Promise(function(_0x3de309,_0x17258d){return db[_0x4232('0x18')][_0x4232('0x19')](_0x3d582b[_0x4232('0x1a')],{'raw':_0x3d582b[_0x4232('0x1b')]?_0x3d582b[_0x4232('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d582b[_0x4232('0x1b')]?_0x3d582b[_0x4232('0x1b')]['where']||null:null,'attributes':_0x3d582b[_0x4232('0x1b')]?_0x3d582b['options']['attributes']||null:null,'limit':_0x3d582b[_0x4232('0x1b')]?_0x3d582b[_0x4232('0x1b')][_0x4232('0x1c')]||null:null})[_0x4232('0xc')](function(_0x1aef68){logger[_0x4232('0xd')](_0x4232('0x17'),_0x3d582b);logger[_0x4232('0xf')](_0x4232('0x17'),_0x3d582b,JSON[_0x4232('0x12')](_0x1aef68));_0x3de309(_0x1aef68);})[_0x4232('0x16')](function(_0x297f1f){logger[_0x4232('0x13')](_0x4232('0x17'),_0x297f1f[_0x4232('0x14')],_0x3d582b);_0x17258d(_0x36fa41[_0x4232('0x13')](0x1f4,_0x297f1f['message']));});});}; \ No newline at end of file +var _0x6812=['../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','attributes','limit','then','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x193005,_0x57368f){var _0x500857=function(_0x22b989){while(--_0x22b989){_0x193005['push'](_0x193005['shift']());}};_0x500857(++_0x57368f);}(_0x6812,0x8b));var _0x2681=function(_0x446a12,_0x1cc4ee){_0x446a12=_0x446a12-0x0;var _0x54352b=_0x6812[_0x446a12];return _0x54352b;};'use strict';var _=require('lodash');var util=require(_0x2681('0x0'));var moment=require('moment');var BPromise=require(_0x2681('0x1'));var rs=require(_0x2681('0x2'));var fs=require('fs');var Redis=require(_0x2681('0x3'));var db=require(_0x2681('0x4'))['db'];var utils=require(_0x2681('0x5'));var logger=require(_0x2681('0x6'))(_0x2681('0x7'));var config=require('../../config/environment');var jayson=require(_0x2681('0x8'));var client=jayson[_0x2681('0x9')][_0x2681('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x593726,_0x557446,_0x3da518){return new BPromise(function(_0x33727d,_0x242b95){return client[_0x2681('0xb')](_0x593726,_0x3da518)['then'](function(_0xc99e5c){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x557446,_0x2681('0xc'));logger[_0x2681('0xd')](_0x2681('0xe'),_0x557446,'request\x20sent',JSON['stringify'](_0xc99e5c));if(_0xc99e5c[_0x2681('0xf')]){if(_0xc99e5c[_0x2681('0xf')][_0x2681('0x10')]===0x1f4){logger['error'](_0x2681('0x11'),_0x557446,_0xc99e5c['error']['message']);return _0x242b95(_0xc99e5c['error'][_0x2681('0x12')]);}logger[_0x2681('0xf')](_0x2681('0x11'),_0x557446,_0xc99e5c[_0x2681('0xf')][_0x2681('0x12')]);return _0x33727d(_0xc99e5c['error']['message']);}else{logger[_0x2681('0x13')](_0x2681('0x11'),_0x557446,_0x2681('0xc'));_0x33727d(_0xc99e5c['result'][_0x2681('0x12')]);}})[_0x2681('0x14')](function(_0x1462ec){logger[_0x2681('0xf')](_0x2681('0x11'),_0x557446,_0x1462ec);_0x242b95(_0x1462ec);});});}exports[_0x2681('0x15')]=function(_0x486a58){var _0x2471a2=this;return new Promise(function(_0x4585fe,_0x538271){return db[_0x2681('0x16')][_0x2681('0x17')](_0x486a58['body'],{'raw':_0x486a58[_0x2681('0x18')]?_0x486a58[_0x2681('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486a58[_0x2681('0x18')]?_0x486a58[_0x2681('0x18')]['where']||null:null,'attributes':_0x486a58[_0x2681('0x18')]?_0x486a58[_0x2681('0x18')][_0x2681('0x19')]||null:null,'limit':_0x486a58['options']?_0x486a58[_0x2681('0x18')][_0x2681('0x1a')]||null:null})[_0x2681('0x1b')](function(_0x3d30f0){logger[_0x2681('0x13')](_0x2681('0x15'),_0x486a58);logger[_0x2681('0xd')](_0x2681('0x15'),_0x486a58,JSON[_0x2681('0x1c')](_0x3d30f0));_0x4585fe(_0x3d30f0);})[_0x2681('0x14')](function(_0x52c6d6){logger[_0x2681('0xf')](_0x2681('0x15'),_0x52c6d6[_0x2681('0x12')],_0x486a58);_0x538271(_0x2471a2[_0x2681('0xf')](0x1f4,_0x52c6d6[_0x2681('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bf106e5..5e5ebd9 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 _0x9a61=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','destroy','delete','removeTags','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a61,0x11f));var _0x19a6=function(_0x25d40a,_0x39b18c){_0x25d40a=_0x25d40a-0x0;var _0x453eef=_0x9a61[_0x25d40a];return _0x453eef;};'use strict';var multer=require(_0x19a6('0x0'));var util=require(_0x19a6('0x1'));var path=require(_0x19a6('0x2'));var timeout=require(_0x19a6('0x3'));var express=require('express');var router=express[_0x19a6('0x4')]();var fs_extra=require(_0x19a6('0x5'));var auth=require(_0x19a6('0x6'));var interaction=require(_0x19a6('0x7'));var config=require('../../config/environment');var controller=require(_0x19a6('0x8'));router[_0x19a6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x19a6('0x9')]('/describe',auth[_0x19a6('0xa')](),controller['describe']);router[_0x19a6('0x9')](_0x19a6('0xb'),auth['isAuthenticated'](),controller[_0x19a6('0xc')]);router[_0x19a6('0x9')](_0x19a6('0xd'),auth[_0x19a6('0xa')](),controller[_0x19a6('0xe')]);router[_0x19a6('0x9')](_0x19a6('0xf'),auth['isAuthenticated'](),controller[_0x19a6('0x10')]);router[_0x19a6('0x11')]('/',auth['isAuthenticated'](),controller[_0x19a6('0x12')]);router[_0x19a6('0x11')](_0x19a6('0xd'),auth[_0x19a6('0xa')](),controller[_0x19a6('0x13')]);router[_0x19a6('0x11')](_0x19a6('0x14'),auth[_0x19a6('0xa')](),interaction[_0x19a6('0x15')](_0x19a6('0x16'),_0x19a6('0x17')),controller[_0x19a6('0x18')]);router[_0x19a6('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x19a6('0x15')](_0x19a6('0x16'),_0x19a6('0x1a')),controller[_0x19a6('0x1b')]);router['delete'](_0x19a6('0xb'),auth['isAuthenticated'](),interaction[_0x19a6('0x15')]('openchannel','openchannelinteraction:destroy'),controller[_0x19a6('0x1c')]);router[_0x19a6('0x1d')]('/:id/tags',auth[_0x19a6('0xa')](),controller[_0x19a6('0x1e')]);module[_0x19a6('0x1f')]=router; \ No newline at end of file +var _0x23d7=['openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put'];(function(_0x3fe26a,_0xe680e3){var _0x305900=function(_0x2bf94e){while(--_0x2bf94e){_0x3fe26a['push'](_0x3fe26a['shift']());}};_0x305900(++_0xe680e3);}(_0x23d7,0xb6));var _0x723d=function(_0x262ee7,_0x52ee92){_0x262ee7=_0x262ee7-0x0;var _0x1dc842=_0x23d7[_0x262ee7];return _0x1dc842;};'use strict';var multer=require(_0x723d('0x0'));var util=require(_0x723d('0x1'));var path=require(_0x723d('0x2'));var timeout=require(_0x723d('0x3'));var express=require(_0x723d('0x4'));var router=express[_0x723d('0x5')]();var fs_extra=require(_0x723d('0x6'));var auth=require(_0x723d('0x7'));var interaction=require(_0x723d('0x8'));var config=require(_0x723d('0x9'));var controller=require(_0x723d('0xa'));router[_0x723d('0xb')]('/',auth[_0x723d('0xc')](),controller[_0x723d('0xd')]);router['get'](_0x723d('0xe'),auth[_0x723d('0xc')](),controller[_0x723d('0xf')]);router[_0x723d('0xb')](_0x723d('0x10'),auth[_0x723d('0xc')](),controller['show']);router[_0x723d('0xb')](_0x723d('0x11'),auth['isAuthenticated'](),controller[_0x723d('0x12')]);router[_0x723d('0xb')]('/:id/download',auth[_0x723d('0xc')](),controller[_0x723d('0x13')]);router[_0x723d('0x14')]('/',auth[_0x723d('0xc')](),controller[_0x723d('0x15')]);router[_0x723d('0x14')](_0x723d('0x11'),auth[_0x723d('0xc')](),controller[_0x723d('0x16')]);router['post'](_0x723d('0x17'),auth[_0x723d('0xc')](),interaction[_0x723d('0x18')]('openchannel',_0x723d('0x19')),controller[_0x723d('0x1a')]);router[_0x723d('0x1b')](_0x723d('0x10'),auth[_0x723d('0xc')](),interaction[_0x723d('0x18')](_0x723d('0x1c'),_0x723d('0x1d')),controller[_0x723d('0x1e')]);router[_0x723d('0x1f')]('/:id',auth[_0x723d('0xc')](),interaction['tracked'](_0x723d('0x1c'),_0x723d('0x20')),controller['destroy']);router['delete']('/:id/tags',auth[_0x723d('0xc')](),controller[_0x723d('0x21')]);module[_0x723d('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 03e27f9..d870cef 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 _0x0624=['ENUM','out','STRING','DATE'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x0624,0x132));var _0x4062=function(_0x564a43,_0x2ebdbe){_0x564a43=_0x564a43-0x0;var _0x7b42f=_0x0624[_0x564a43];return _0x7b42f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4062('0x0')]},'secondDisposition':{'type':Sequelize[_0x4062('0x0')]},'thirdDisposition':{'type':Sequelize[_0x4062('0x0')]},'note':{'type':Sequelize[_0x4062('0x0')]},'read1stAt':{'type':Sequelize[_0x4062('0x1')]},'threadId':{'type':Sequelize[_0x4062('0x0')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4062('0x2')]('in',_0x4062('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x4062('0x2')]('in',_0x4062('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4062('0x0')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2c6a=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa2c6('0x0'));module[_0xa2c6('0x1')]={'closed':{'type':Sequelize[_0xa2c6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa2c6('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa2c6('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa2c6('0x3')]},'threadId':{'type':Sequelize[_0xa2c6('0x4')]},'externalUrl':{'type':Sequelize[_0xa2c6('0x4')]},'lastMsgAt':{'type':Sequelize[_0xa2c6('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xa2c6('0x5')]('in',_0xa2c6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa2c6('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa2c6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index b36ae28..eab0f23 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 _0x3e59=['push','all','rows','catch','params','includeAll','include','merge','options','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','attachments','transcript-%d-%s.zip','User','Contact','lastName','Attachment','Messages','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','firstName','direction','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','end','error','stack','name','send','Users','map','fullname','TagIds','split','talking','answered','total','closed','UserId','waiting','unmanaged','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','buildExpression','body','compact','isEmpty','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\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?','i.from\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','agent','toString','sequelize','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId'];(function(_0x262e81,_0x357386){var _0x45863e=function(_0x490d7d){while(--_0x490d7d){_0x262e81['push'](_0x262e81['shift']());}};_0x45863e(++_0x357386);}(_0x3e59,0x12c));var _0x93e5=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x3e59[_0x212b03];return _0x423115;};'use strict';var rimraf=require(_0x93e5('0x0'));var zipdir=require(_0x93e5('0x1'));var moment=require('moment');var util=require(_0x93e5('0x2'));var path=require('path');var ejs=require(_0x93e5('0x3'));var fs=require('fs');var _=require(_0x93e5('0x4'));var squel=require(_0x93e5('0x5'));var Redis=require(_0x93e5('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x93e5('0x7'));var pdf=require(_0x93e5('0x8'));var logger=require(_0x93e5('0x9'))(_0x93e5('0xa'));var config=require(_0x93e5('0xb'));var db=require('../../mysqldb')['db'];config[_0x93e5('0xc')]=_[_0x93e5('0xd')](config['redis'],{'host':_0x93e5('0xe'),'port':0x18eb});var socket=require(_0x93e5('0xf'))(new Redis(config['redis']));require(_0x93e5('0x10'))[_0x93e5('0x11')](socket);function respondWithStatusCode(_0x484857,_0x668322){_0x668322=_0x668322||0xcc;return function(_0x135d37){if(_0x135d37){return _0x484857[_0x93e5('0x12')](_0x668322);}return _0x484857[_0x93e5('0x13')](_0x668322)['end']();};}function respondWithResult(_0x29215b,_0x561895){_0x561895=_0x561895||0xc8;return function(_0x2add27){if(_0x2add27){return _0x29215b['status'](_0x561895)[_0x93e5('0x14')](_0x2add27);}};}function respondWithFilteredResult(_0x27afff,_0x3613aa){return function(_0x41c77a){if(_0x41c77a){var _0x4d7c08=typeof _0x3613aa[_0x93e5('0x15')]===_0x93e5('0x16')&&typeof _0x3613aa[_0x93e5('0x17')]===_0x93e5('0x16');var _0x529a8a=_0x41c77a[_0x93e5('0x18')];var _0x4a8e83=_0x4d7c08?0x0:_0x3613aa['offset'];var _0x124afc=_0x4d7c08?_0x41c77a[_0x93e5('0x18')]:_0x3613aa['offset']+_0x3613aa['limit'];var _0x405a47;if(_0x124afc>=_0x529a8a){_0x124afc=_0x529a8a;_0x405a47=0xc8;}else{_0x405a47=0xce;}_0x27afff[_0x93e5('0x13')](_0x405a47);return _0x27afff[_0x93e5('0x19')](_0x93e5('0x1a'),_0x4a8e83+'-'+_0x124afc+'/'+_0x529a8a)[_0x93e5('0x14')](_0x41c77a);}return null;};}function saveUpdates(_0x551059){return function(_0x4dd1bd){if(_0x4dd1bd){return _0x4dd1bd['update'](_0x551059)[_0x93e5('0x1b')](function(_0x461904){return _0x461904;});}return null;};}function removeEntity(_0x5749b7){return function(_0x18db93){if(_0x18db93){return _0x18db93['destroy']()[_0x93e5('0x1b')](function(){_0x5749b7[_0x93e5('0x13')](0xcc)[_0x93e5('0x1c')]();});}};}function handleEntityNotFound(_0x24405d){return function(_0x37cf71){if(!_0x37cf71){_0x24405d[_0x93e5('0x12')](0x194);}return _0x37cf71;};}function handleError(_0x126e21,_0x2c14ee){_0x2c14ee=_0x2c14ee||0x1f4;return function(_0xb27e7f){logger[_0x93e5('0x1d')](_0xb27e7f[_0x93e5('0x1e')]);if(_0xb27e7f[_0x93e5('0x1f')]){delete _0xb27e7f[_0x93e5('0x1f')];}_0x126e21[_0x93e5('0x13')](_0x2c14ee)[_0x93e5('0x20')](_0xb27e7f);};}function getInteractionUsers(_0x46acb7,_0x2b55c6){return new Promise(function(_0x2eae67,_0x4642c4){try{if(_0x2b55c6[_0x46acb7['id']]){_0x46acb7[_0x93e5('0x21')]=_[_0x93e5('0x22')](_0x2b55c6[_0x46acb7['id']],function(_0x3f8b1e){return{'id':_0x3f8b1e['id'],'fullname':_0x3f8b1e[_0x93e5('0x23')]};});}}catch(_0x31254a){_0x4642c4(_0x31254a);}_0x2eae67(_0x46acb7);});}function getInteractionTags(_0x48d5fa,_0x4ec81a){return new Promise(function(_0x1189d5,_0x12f5b0){try{if(_0x48d5fa[_0x93e5('0x24')]){_0x48d5fa['Tags']=[];_0x48d5fa['TagIds'][_0x93e5('0x25')](',')['forEach'](function(_0x1c07aa){_0x48d5fa['Tags']['push'](_0x4ec81a[_0x1c07aa]);});}delete _0x48d5fa[_0x93e5('0x24')];}catch(_0x12b7d8){_0x12f5b0(_0x12b7d8);}_0x1189d5(_0x48d5fa);});}function updateOpenchannelInteraction(_0x52f3b3,_0x49d110,_0x20b043){return new Promise(function(_0x2c71b9,_0xed2a98){return getInteractionUsers(_0x52f3b3,_0x20b043)[_0x93e5('0x1b')](function(_0x139cba){return getInteractionTags(_0x139cba,_0x49d110);})[_0x93e5('0x1b')](function(_0x5bbd0e){return getStateInteraction(_0x5bbd0e);})[_0x93e5('0x1b')](function(_0x22f0f9){_0x2c71b9(_0x22f0f9);})['catch'](function(_0x3756f7){_0xed2a98(_0x3756f7);});});}function getStateInteraction(_0x23e4f5){return new Promise(function(_0x457832){_0x23e4f5['waiting']=0x0;_0x23e4f5[_0x93e5('0x26')]=0x0;_0x23e4f5[_0x93e5('0x27')]=0x0;_0x23e4f5['unmanaged']=0x0;_0x23e4f5[_0x93e5('0x28')]=0x0;if(!_0x23e4f5[_0x93e5('0x29')]&&!_0x23e4f5[_0x93e5('0x2a')]){_0x23e4f5[_0x93e5('0x2b')]+=0x1;}if(!_0x23e4f5[_0x93e5('0x29')]&&_0x23e4f5[_0x93e5('0x2a')]){_0x23e4f5[_0x93e5('0x26')]+=0x1;if(_0x23e4f5[_0x93e5('0x2b')]){_0x23e4f5[_0x93e5('0x2b')]-=0x1;}}if(_0x23e4f5[_0x93e5('0x29')]&&_0x23e4f5['UserId']){_0x23e4f5['answered']+=0x1;if(_0x23e4f5[_0x93e5('0x26')]){_0x23e4f5[_0x93e5('0x26')]-=0x1;}}if(_0x23e4f5[_0x93e5('0x29')]&&!_0x23e4f5[_0x93e5('0x2a')]){_0x23e4f5[_0x93e5('0x2c')]+=0x1;if(_0x23e4f5[_0x93e5('0x2b')]){_0x23e4f5[_0x93e5('0x2b')]-=0x1;}}_0x23e4f5[_0x93e5('0x28')]+=0x1;_0x457832(_0x23e4f5);});}exports[_0x93e5('0x2d')]=function(_0x38c418,_0xeb98ae){var _0x479a0c={},_0x4bcae1={},_0x22c112={'count':0x0,'rows':[]};var _0x41eaac=_[_0x93e5('0x22')](db[_0x93e5('0x2e')][_0x93e5('0x2f')],function(_0x594ab8){return{'name':_0x594ab8[_0x93e5('0x30')],'type':_0x594ab8[_0x93e5('0x31')][_0x93e5('0x32')]};});_0x4bcae1[_0x93e5('0x33')]=_['map'](_0x41eaac,_0x93e5('0x1f'));_0x4bcae1['query']=_[_0x93e5('0x34')](_0x38c418[_0x93e5('0x35')]);_0x4bcae1[_0x93e5('0x36')]=_[_0x93e5('0x37')](_0x4bcae1[_0x93e5('0x33')],_0x4bcae1[_0x93e5('0x35')]);_0x479a0c[_0x93e5('0x38')]=_[_0x93e5('0x37')](_0x4bcae1['model'],qs[_0x93e5('0x39')](_0x38c418[_0x93e5('0x35')][_0x93e5('0x39')]));_0x479a0c[_0x93e5('0x38')]=_0x479a0c[_0x93e5('0x38')][_0x93e5('0x3a')]?_0x479a0c[_0x93e5('0x38')]:_0x4bcae1['model'];if(!_0x38c418[_0x93e5('0x35')]['hasOwnProperty'](_0x93e5('0x3b'))){_0x479a0c[_0x93e5('0x17')]=qs[_0x93e5('0x17')](_0x38c418['query']['limit']);_0x479a0c[_0x93e5('0x15')]=qs[_0x93e5('0x15')](_0x38c418[_0x93e5('0x35')]['offset']);}_0x479a0c[_0x93e5('0x3c')]=qs['sort'](_0x38c418[_0x93e5('0x35')]['sort']);_0x479a0c['where']=qs[_0x93e5('0x36')](_[_0x93e5('0x3d')](_0x38c418[_0x93e5('0x35')],_0x4bcae1[_0x93e5('0x36')]),_0x41eaac);var _0x173f31=[];var _0x23bea6=squel[_0x93e5('0x3e')]()[_0x93e5('0x3f')]('id')['field']('name')['field'](_0x93e5('0x40'))[_0x93e5('0x41')](_0x93e5('0x42'));var _0x4d9b43=squel[_0x93e5('0x3e')]()[_0x93e5('0x3f')]('u.id')[_0x93e5('0x3f')](_0x93e5('0x43'))[_0x93e5('0x3f')](_0x93e5('0x44'))[_0x93e5('0x41')]('user_has_openchannel_interactions','ui')[_0x93e5('0x45')]('users','u',_0x93e5('0x46'));var _0x5e38fb=squel[_0x93e5('0x3e')]()[_0x93e5('0x41')](_0x93e5('0x47'),'i')[_0x93e5('0x45')](_0x93e5('0x48'),'c',_0x93e5('0x49'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x93e5('0x45')](_0x93e5('0x4a'),'a',_0x93e5('0x4b'))['left_join'](_0x93e5('0x4c'),'me',_0x93e5('0x4d'))[_0x93e5('0x45')](_0x93e5('0x4e'),'it',_0x93e5('0x4f'))['left_join'](_0x93e5('0x42'),'t',_0x93e5('0x50'));var _0x12ca02=squel[_0x93e5('0x51')]();var _0x29ee5b=[];var _0x2b4405=squel[_0x93e5('0x51')]();var _0x1ab911;if(_0x38c418['query'][_0x93e5('0x52')]){_0x1ab911=as[_0x93e5('0x53')](_0x38c418['query'][_0x93e5('0x52')]);var _0xf3dda1=_0x1ab911[_0x93e5('0x54')];for(var _0x423fac=0x0;_0x423fac<_0x1ab911[_0x93e5('0x55')][_0x93e5('0x3a')];_0x423fac++){var _0x24a31c=_0x1ab911[_0x93e5('0x55')][_0x423fac];var _0xdcdebf='i';var _0x25496b=_[_0x93e5('0x56')](_0x41eaac,['name',_0x24a31c[_0x93e5('0x3f')]]);if(!_0x25496b){switch(_0x24a31c['field']){case'unreadMessages':if(_0x24a31c[_0x93e5('0x57')]==0x1){_0x5e38fb[_0x93e5('0x58')]('`'+_0x24a31c['field']+_0x93e5('0x59'));}else{_0x5e38fb[_0x93e5('0x58')]('`'+_0x24a31c['field']+_0x93e5('0x5a'));}break;case'Contact':if(_0x24a31c['operator']==='$substring'){if(_0x24a31c[_0x93e5('0x57')][_0x93e5('0x25')]('\x20')[_0x93e5('0x3a')]>0x1){_0x12ca02[_0xf3dda1](_0x93e5('0x5b'),qs[_0x93e5('0x5c')](_0x24a31c['value']),null);}else{var _0x3411be='%'+_0x24a31c[_0x93e5('0x57')]+'%';_0x12ca02[_0xf3dda1](_0x93e5('0x5d'),_0x3411be,_0x3411be,_0x3411be);}}else{_0x25496b=_[_0x93e5('0x56')](_0x41eaac,['name',_0x93e5('0x5e')]);_0x24a31c[_0x93e5('0x3f')]=_0x93e5('0x5e');_0x4f9b8d=as['buildExpression'](_0xdcdebf,_0x25496b[_0x93e5('0x31')],_0x24a31c);_0x12ca02[_0xf3dda1](_0x4f9b8d[_0x93e5('0x5f')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x60')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x1c')]);}break;case _0x93e5('0x61'):var _0x4c2e22=_0x24a31c[_0x93e5('0x57')][_0x93e5('0x25')](',')[_0x93e5('0x22')](function(_0x3f28bb){return Number(_0x3f28bb);});_0x4c2e22[_0x93e5('0x62')](function(_0x4345d0){_0x2b4405['or'](_0x93e5('0x63'),'%,'+_0x4345d0+',%');});_0x29ee5b=_[_0x93e5('0x64')](_0x29ee5b,_0x4c2e22);break;case'User':if(_0x24a31c[_0x93e5('0x65')]===_0x93e5('0x66')){_0x12ca02[_0xf3dda1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x24a31c[_0x93e5('0x57')]+'%',null);}else{_0x25496b=_[_0x93e5('0x56')](_0x41eaac,[_0x93e5('0x1f'),'UserId']);_0x24a31c[_0x93e5('0x3f')]=_0x93e5('0x2a');_0x4f9b8d=as[_0x93e5('0x67')](_0xdcdebf,_0x25496b[_0x93e5('0x31')],_0x24a31c);_0x12ca02[_0xf3dda1](_0x4f9b8d[_0x93e5('0x5f')],_0x4f9b8d['value'][_0x93e5('0x60')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x1c')]);}break;case _0x93e5('0x68'):_0x4f9b8d=as[_0x93e5('0x67')]('me',null,_0x24a31c);_0x12ca02[_0xf3dda1](_0x4f9b8d[_0x93e5('0x5f')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x60')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x1c')]);break;}}else{var _0x4f9b8d=as[_0x93e5('0x67')](_0xdcdebf,_0x25496b['type'],_0x24a31c);_0x12ca02[_0xf3dda1](_0x4f9b8d[_0x93e5('0x5f')],_0x4f9b8d[_0x93e5('0x57')][_0x93e5('0x60')],_0x4f9b8d['value'][_0x93e5('0x1c')]);}}}else{var _0x5bc397=_(_0x38c418[_0x93e5('0x35')])[_0x93e5('0x34')]()[_0x93e5('0x22')](function(_0x4a112f){return _['some'](_0x41eaac,[_0x93e5('0x1f'),_0x4a112f])?_0x4a112f:undefined;})[_0x93e5('0x69')]()[_0x93e5('0x57')]();if(!_[_0x93e5('0x6a')](_0x5bc397)){_0x5bc397['forEach'](function(_0x236090){if(_0x236090==='OpenchannelAccountId'){_0x5e38fb[_0x93e5('0x6b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x93e5('0x6c')](_0x38c418[_0x93e5('0x35')][_0x236090]));}else if(_0x236090==='createdAt'){var _0x247c2=JSON[_0x93e5('0x6d')](_0x38c418[_0x93e5('0x35')][_0x236090])['$gte'];var _0x548d38=JSON[_0x93e5('0x6d')](_0x38c418[_0x93e5('0x35')][_0x236090])[_0x93e5('0x6e')];_0x5e38fb['where'](_0x93e5('0x6f'),_0x247c2,_0x548d38);}else{if(_0x38c418['query'][_0x236090]==='null'){_0x5e38fb['where']('i.'+_0x236090+_0x93e5('0x70'));}else{_0x5e38fb[_0x93e5('0x6b')]('i.'+_0x236090+_0x93e5('0x71'),_0x38c418[_0x93e5('0x35')][_0x236090]);}}});}if(_0x38c418[_0x93e5('0x35')][_0x93e5('0x72')]){if(_0x38c418[_0x93e5('0x35')]['read']==0x1){_0x5e38fb[_0x93e5('0x58')](_0x93e5('0x73'));}else{_0x5e38fb['having']('`unreadMessages`\x20>\x200');}}if(_0x38c418[_0x93e5('0x35')][_0x93e5('0x74')]){_0x29ee5b=_[_0x93e5('0x75')](_0x38c418[_0x93e5('0x35')][_0x93e5('0x74')])?_0x38c418[_0x93e5('0x35')][_0x93e5('0x74')]:new Array(_0x38c418[_0x93e5('0x35')]['tag']);_0x29ee5b['forEach'](function(_0x490347){_0x2b4405['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x490347+',%');});}if(_0x38c418[_0x93e5('0x35')]['filter']){var _0x32f5de=_0x38c418[_0x93e5('0x35')][_0x93e5('0x76')][_0x93e5('0x77')]('\x5c','\x5c\x5c')[_0x93e5('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x32f5de)){_0x12ca02['or'](_0x93e5('0x78'),_0x32f5de+'%');}else{_0x12ca02['or'](_0x93e5('0x79'),qs[_0x93e5('0x5c')](_0x32f5de))['or'](_0x93e5('0x7a'),_0x32f5de+'%');}_0x12ca02['or'](_0x93e5('0x7b'),_0x32f5de+'%');}}_0x5e38fb[_0x93e5('0x6b')](_0x12ca02);_0x5e38fb[_0x93e5('0x7c')](_0x93e5('0x7d'));var _0x82b159={'type':db['Sequelize'][_0x93e5('0x7e')][_0x93e5('0x7f')],'raw':!![]};var _0x3858e3=_0x5e38fb[_0x93e5('0x80')]();_0x3858e3[_0x93e5('0x3f')](_0x93e5('0x7d'));_0x3858e3[_0x93e5('0x3f')](_0x93e5('0x81'),_0x93e5('0x82'));if(_0x479a0c[_0x93e5('0x3c')]){_0x479a0c[_0x93e5('0x3c')]['forEach'](function(_0x55f073){var _0x5dbfe4=_0x55f073[0x0]===_0x93e5('0x83')?_0x55f073[0x0]:'i.'+_0x55f073[0x0];_0x5e38fb[_0x93e5('0x3c')](_0x5dbfe4,_0x55f073[0x1]===_0x93e5('0x84')?![]:!![]);});}if(!_[_0x93e5('0x6a')](_0x29ee5b)){_0x5e38fb[_0x93e5('0x58')](_0x2b4405);_0x3858e3['where'](_0x93e5('0x85'),_0x29ee5b);}Promise[_0x93e5('0x86')]()['then'](function(){if(!_0x1ab911){if(_0x38c418[_0x93e5('0x35')][_0x93e5('0x87')])return;_0x3858e3['where'](_0x93e5('0x88'));_0x5e38fb[_0x93e5('0x6b')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x38c418[_0x93e5('0x89')]['role']!=='agent')return;return _0x38c418['user'][_0x93e5('0x8a')]({'attributes':['id'],'raw':!![]})[_0x93e5('0x1b')](function(_0x1a21d7){if(_[_0x93e5('0x6a')](_0x1a21d7)){_0x3858e3[_0x93e5('0x6b')](_0x93e5('0x8b'));_0x5e38fb[_0x93e5('0x6b')](_0x93e5('0x8b'));}else{_0x3858e3[_0x93e5('0x6b')](_0x93e5('0x8c'),_['map'](_0x1a21d7,'id'));_0x5e38fb['where'](_0x93e5('0x8c'),_[_0x93e5('0x22')](_0x1a21d7,'id'));}});})[_0x93e5('0x1b')](function(){if(_0x38c418['user'][_0x93e5('0x8d')]===_0x93e5('0x8e')&&!_0x1ab911&&!_0x38c418[_0x93e5('0x35')]['OpenchannelAccountId'])return[];return db['sequelize']['query'](_0x3858e3[_0x93e5('0x8f')](),_0x82b159);})[_0x93e5('0x1b')](function(_0x258601){_0x22c112['count']=_0x258601[_0x93e5('0x3a')];if(_0x22c112[_0x93e5('0x18')]===0x0)return[];return db[_0x93e5('0x90')][_0x93e5('0x35')](_0x23bea6[_0x93e5('0x8f')](),_0x82b159)[_0x93e5('0x1b')](function(_0x3d99ec){_0x173f31=_['keyBy'](_0x3d99ec,'id');_0x82b159=_['merge'](_0x82b159,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38c418['query'][_0x93e5('0x39')]){_0x479a0c[_0x93e5('0x38')][_0x93e5('0x62')](function(_0x3208cd){_0x5e38fb[_0x93e5('0x3f')]('i.'+_0x3208cd);});}else{_0x5e38fb[_0x93e5('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x93e5('0x82'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x91'),'Account.key');_0x5e38fb['field'](_0x93e5('0x92'),'Account.mandatoryDisposition');_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x93'),_0x93e5('0x83'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x94'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x95'),_0x93e5('0x96'));_0x5e38fb['field'](_0x93e5('0x97'),_0x93e5('0x98'));_0x5e38fb[_0x93e5('0x3f')]('c.email',_0x93e5('0x99'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x9a'),'Contact.phone');_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x9b'),_0x93e5('0x9c'));_0x5e38fb['field'](_0x93e5('0x9d'),_0x93e5('0x9e'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0x9f'),_0x93e5('0xa0'));_0x5e38fb[_0x93e5('0x3f')](_0x93e5('0xa1'),_0x93e5('0xa2'));_0x5e38fb[_0x93e5('0x3f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x93e5('0x24'));}if(_0x479a0c[_0x93e5('0x17')])_0x5e38fb[_0x93e5('0x17')](_0x479a0c['limit']);if(_0x479a0c['offset'])_0x5e38fb[_0x93e5('0x15')](_0x479a0c[_0x93e5('0x15')]);return db[_0x93e5('0x90')]['query'](_0x5e38fb[_0x93e5('0x8f')](),_0x82b159);})['then'](function(_0x494958){if(_0x494958['length']>0x0)_0x4d9b43['where'](_0x93e5('0xa3'),_[_0x93e5('0x22')](_0x494958,'id'));return db[_0x93e5('0x90')][_0x93e5('0x35')](_0x4d9b43['toString'](),_0x82b159)[_0x93e5('0x1b')](function(_0x538747){var _0xd8ae0d=_[_0x93e5('0xa4')](_0x538747,_0x93e5('0xa5'));var _0x198891=[];_0x494958[_0x93e5('0x62')](function(_0x404457){_0x198891[_0x93e5('0xa6')](updateOpenchannelInteraction(_0x404457,_0x173f31,_0xd8ae0d));});return Promise[_0x93e5('0xa7')](_0x198891);});});})[_0x93e5('0x1b')](function(_0x1ced22){_0x22c112[_0x93e5('0xa8')]=_0x1ced22;return _0x22c112;})['then'](respondWithFilteredResult(_0xeb98ae,_0x479a0c))[_0x93e5('0xa9')](handleError(_0xeb98ae,null));};exports['show']=function(_0x2dcbc8,_0x2e3a1f){var _0x2e73c0={};if(_0x2dcbc8[_0x93e5('0x35')]['type']&&_0x2dcbc8[_0x93e5('0x35')][_0x93e5('0x31')]==='from'){_0x2e73c0[_0x93e5('0x41')]=_0x2dcbc8[_0x93e5('0xaa')]['id'];}else{_0x2e73c0['id']=_0x2dcbc8[_0x93e5('0xaa')]['id'];}var _0x21ea1e={'raw':![],'where':_0x2e73c0},_0x519d46={};_0x519d46[_0x93e5('0x33')]=_[_0x93e5('0x34')](db[_0x93e5('0x2e')][_0x93e5('0x2f')]);_0x519d46['query']=_['keys'](_0x2dcbc8[_0x93e5('0x35')]);_0x519d46[_0x93e5('0x36')]=_[_0x93e5('0x37')](_0x519d46[_0x93e5('0x33')],_0x519d46['query']);_0x21ea1e[_0x93e5('0x38')]=_[_0x93e5('0x37')](_0x519d46[_0x93e5('0x33')],qs['fields'](_0x2dcbc8[_0x93e5('0x35')][_0x93e5('0x39')]));_0x21ea1e[_0x93e5('0x38')]=_0x21ea1e[_0x93e5('0x38')]['length']?_0x21ea1e[_0x93e5('0x38')]:_0x519d46[_0x93e5('0x33')];if(_0x2dcbc8['query'][_0x93e5('0xab')]){_0x21ea1e[_0x93e5('0xac')]=[{'all':!![]}];}_0x21ea1e=_[_0x93e5('0xad')]({},_0x21ea1e,_0x2dcbc8[_0x93e5('0xae')]);return db['OpenchannelInteraction'][_0x93e5('0x56')](_0x21ea1e)[_0x93e5('0x1b')](handleEntityNotFound(_0x2e3a1f,null))[_0x93e5('0x1b')](respondWithResult(_0x2e3a1f,null))[_0x93e5('0xa9')](handleError(_0x2e3a1f,null));};exports[_0x93e5('0xaf')]=function(_0x307410,_0xd5c8e0){return db[_0x93e5('0x2e')][_0x93e5('0xaf')](_0x307410[_0x93e5('0x68')],{})['then'](respondWithResult(_0xd5c8e0,0xc9))[_0x93e5('0xa9')](handleError(_0xd5c8e0,null));};exports[_0x93e5('0xb0')]=function(_0x5195aa,_0x13dba2){if(_0x5195aa[_0x93e5('0x68')]['id']){delete _0x5195aa[_0x93e5('0x68')]['id'];}return db[_0x93e5('0x2e')][_0x93e5('0x56')]({'where':{'id':_0x5195aa[_0x93e5('0xaa')]['id']}})[_0x93e5('0x1b')](handleEntityNotFound(_0x13dba2,null))[_0x93e5('0x1b')](saveUpdates(_0x5195aa['body'],null))[_0x93e5('0x1b')](respondWithResult(_0x13dba2,null))[_0x93e5('0xa9')](handleError(_0x13dba2,null));};exports[_0x93e5('0xb1')]=function(_0x4bc23d,_0x43be73){return db[_0x93e5('0x2e')][_0x93e5('0x56')]({'where':{'id':_0x4bc23d[_0x93e5('0xaa')]['id']}})['then'](handleEntityNotFound(_0x43be73,null))[_0x93e5('0x1b')](removeEntity(_0x43be73,null))[_0x93e5('0xa9')](handleError(_0x43be73,null));};exports[_0x93e5('0xb2')]=function(_0x5781f8,_0x1a7c0d){return db[_0x93e5('0x2e')]['describe']()[_0x93e5('0x1b')](respondWithResult(_0x1a7c0d,null))[_0x93e5('0xa9')](handleError(_0x1a7c0d,null));};exports[_0x93e5('0xb3')]=function(_0xe16127,_0x1f7dae){return db[_0x93e5('0xb4')][_0x93e5('0x56')]({'where':{'id':_0xe16127[_0x93e5('0xaa')]['id']}})[_0x93e5('0x1b')](handleEntityNotFound(_0x1f7dae,null))[_0x93e5('0x1b')](function(_0x11a372){if(_0x11a372){return _0x11a372['addMessage'](_0xe16127[_0x93e5('0x68')][_0x93e5('0xb5')],_[_0x93e5('0xb6')](_0xe16127[_0x93e5('0x68')],[_0x93e5('0xb5'),'id'])||{});}})[_0x93e5('0x1b')](respondWithResult(_0x1f7dae,null))[_0x93e5('0xa9')](handleError(_0x1f7dae,null));};exports[_0x93e5('0xb7')]=function(_0xc04c3f,_0x1cda62){var _0x40c387={'raw':![],'where':{}};var _0x25ebe1={};var _0x3441e5={'count':0x0,'rows':[]};return db[_0x93e5('0x2e')]['findOne']({'where':{'id':_0xc04c3f['params']['id']}})[_0x93e5('0x1b')](handleEntityNotFound(_0x1cda62,null))[_0x93e5('0x1b')](function(_0x5ec0f8){if(_0x5ec0f8){_0x25ebe1['model']=_['keys'](db[_0x93e5('0xb4')][_0x93e5('0x2f')]);_0x25ebe1['query']=_[_0x93e5('0x34')](_0xc04c3f[_0x93e5('0x35')]);_0x25ebe1[_0x93e5('0x36')]=_['intersection'](_0x25ebe1[_0x93e5('0x33')],_0x25ebe1['query']);_0x40c387['attributes']=_['intersection'](_0x25ebe1[_0x93e5('0x33')],qs[_0x93e5('0x39')](_0xc04c3f['query'][_0x93e5('0x39')]));_0x40c387[_0x93e5('0x38')]=_0x40c387[_0x93e5('0x38')][_0x93e5('0x3a')]?_0x40c387['attributes']:_0x25ebe1[_0x93e5('0x33')];if(!_0xc04c3f[_0x93e5('0x35')][_0x93e5('0xb8')](_0x93e5('0x3b'))){_0x40c387[_0x93e5('0x17')]=qs[_0x93e5('0x17')](_0xc04c3f['query'][_0x93e5('0x17')]);_0x40c387[_0x93e5('0x15')]=qs[_0x93e5('0x15')](_0xc04c3f[_0x93e5('0x35')]['offset']);}_0x40c387[_0x93e5('0x3c')]=qs[_0x93e5('0xb9')](_0xc04c3f[_0x93e5('0x35')][_0x93e5('0xb9')]);_0x40c387[_0x93e5('0x6b')]=qs[_0x93e5('0x36')](_[_0x93e5('0x3d')](_0xc04c3f[_0x93e5('0x35')],_0x25ebe1[_0x93e5('0x36')]));_0x40c387[_0x93e5('0x6b')][_0x93e5('0xa5')]=_0x5ec0f8['id'];if(_0xc04c3f[_0x93e5('0x35')][_0x93e5('0x76')]){_0x40c387[_0x93e5('0x6b')]=_[_0x93e5('0xad')](_0x40c387[_0x93e5('0x6b')],{'$or':_[_0x93e5('0x22')](_0x40c387['attributes'],function(_0x16ab47){var _0x4562e2={};_0x4562e2[_0x16ab47]={'$like':'%'+_0xc04c3f['query'][_0x93e5('0x76')]+'%'};return _0x4562e2;})});}if(_0xc04c3f[_0x93e5('0x35')]['$gte']){var _0x484705=_0xc04c3f[_0x93e5('0x35')][_0x93e5('0xba')]['split'](',');var _0xfaeee8={};_0xfaeee8[_0x484705[0x0]]={'$gte':moment(_0x484705[0x1])[_0x93e5('0xbb')](_0x93e5('0xbc'))};_0x40c387[_0x93e5('0x6b')]=_['merge'](_0x40c387[_0x93e5('0x6b')],_0xfaeee8);}_0x40c387=_['merge']({},_0x40c387,_0xc04c3f['options']);return db[_0x93e5('0xb4')][_0x93e5('0x18')]({'where':_0x40c387[_0x93e5('0x6b')]})['then'](function(_0x41d1f2){_0x3441e5[_0x93e5('0x18')]=_0x41d1f2;if(_0xc04c3f[_0x93e5('0x35')][_0x93e5('0xab')]){_0x40c387[_0x93e5('0xac')]=[{'all':!![]}];}return db[_0x93e5('0xb4')]['findAll'](_0x40c387);})[_0x93e5('0x1b')](function(_0x1c4484){_0x3441e5[_0x93e5('0xa8')]=_0x1c4484;return _0x3441e5;});}})[_0x93e5('0x1b')](respondWithFilteredResult(_0x1cda62,_0x40c387))['catch'](handleError(_0x1cda62,null));};exports[_0x93e5('0xbd')]=function(_0xbd63c5,_0x238f65){return db[_0x93e5('0x2e')][_0x93e5('0x56')]({'where':{'id':_0xbd63c5['params']['id']}})[_0x93e5('0x1b')](handleEntityNotFound(_0x238f65,null))[_0x93e5('0x1b')](function(_0x54fae6){if(_0x54fae6){return _0x54fae6['setTags'](_0xbd63c5[_0x93e5('0x68')]['ids'],_[_0x93e5('0xb6')](_0xbd63c5[_0x93e5('0x68')],[_0x93e5('0xb5'),'id'])||{})[_0x93e5('0xbe')](function(){return db[_0x93e5('0x61')][_0x93e5('0xbf')]({'attributes':['id',_0x93e5('0x1f'),_0x93e5('0x40')],'where':{'id':_0xbd63c5[_0x93e5('0x68')][_0x93e5('0xb5')]}});})[_0x93e5('0x1b')](function(_0x25ddf2){socket[_0x93e5('0xc0')](_0x93e5('0xc1'),{'id':Number(_0xbd63c5[_0x93e5('0xaa')]['id']),'tags':_0x25ddf2||[]});return{'id':Number(_0xbd63c5['params']['id']),'tags':_0x25ddf2||[]};});}})[_0x93e5('0x1b')](respondWithResult(_0x238f65,null))[_0x93e5('0xa9')](handleError(_0x238f65,null));};exports[_0x93e5('0xc2')]=function(_0xec7806,_0x3fdea7){return db['OpenchannelInteraction'][_0x93e5('0x56')]({'where':{'id':_0xec7806[_0x93e5('0xaa')]['id']}})[_0x93e5('0x1b')](handleEntityNotFound(_0x3fdea7,null))[_0x93e5('0x1b')](function(_0x5199f7){if(_0x5199f7){return _0x5199f7['removeTags'](_0xec7806[_0x93e5('0x35')]['ids']);}})[_0x93e5('0x1b')](respondWithStatusCode(_0x3fdea7,null))['catch'](handleError(_0x3fdea7,null));};exports[_0x93e5('0xc3')]=function(_0x5b5173,_0x235f70){var _0x388e49=moment()['unix']()[_0x93e5('0x8f')]();var _0x97c1ce=path[_0x93e5('0xc4')](config[_0x93e5('0xc5')],_0x93e5('0xc6'),'files','tmp');var _0x487032=path[_0x93e5('0xc4')](config['root'],_0x93e5('0xc6'),'files',_0x93e5('0xc7'));var _0xfbd9f5=path['join'](_0x97c1ce,_0x388e49);var _0xfb4d06=util[_0x93e5('0xbb')](_0x93e5('0xc8'),_0x5b5173[_0x93e5('0xaa')]['id'],_0x388e49);var _0x47641f=path[_0x93e5('0xc4')](_0x97c1ce,_0xfb4d06);var _0x444d8a=[];_0x444d8a['push']({'model':db[_0x93e5('0xc9')],'as':_0x93e5('0xc9'),'attributes':['id','fullname'],'raw':!![]});_0x444d8a[_0x93e5('0xa6')]({'model':db['CmContact'],'as':_0x93e5('0xca'),'attributes':['id','firstName',_0x93e5('0xcb')],'raw':!![]});if(_0x5b5173['query']['attachments']){_0x444d8a['push']({'model':db['Attachment'],'as':_0x93e5('0xcc'),'raw':!![]});}var _0x30683e=[{'model':db['OpenchannelMessage'],'as':_0x93e5('0xcd'),'attributes':['id',_0x93e5('0x68'),'createdAt','direction','secret',_0x93e5('0x72')],'include':_0x444d8a}];_0x30683e[_0x93e5('0xa6')]({'model':db[_0x93e5('0xce')],'as':_0x93e5('0xcf'),'attributes':['id',_0x93e5('0x1f')]});_0x30683e['push']({'model':db[_0x93e5('0xc9')],'as':_0x93e5('0xd0'),'attributes':['id','fullname']});return db[_0x93e5('0x2e')]['find']({'where':{'id':_0x5b5173[_0x93e5('0xaa')]['id']},'include':_0x30683e})[_0x93e5('0x1b')](handleEntityNotFound(_0x235f70,null))[_0x93e5('0x1b')](function(_0x1f3716){if(_0x1f3716){var _0x174853=_0x1f3716[_0x93e5('0xd1')]({'plain':!![]});fs[_0x93e5('0xd2')](_0xfbd9f5);var _0x721e9f={'channel':_0x93e5('0xd3'),'account':_0x174853['Account']['name'],'agent':_0x174853[_0x93e5('0xd0')]?_0x174853[_0x93e5('0xd0')][_0x93e5('0x23')]:_0x93e5('0xd4'),'createdAt':moment(_0x174853[_0x93e5('0xd5')])[_0x93e5('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x174853[_0x93e5('0x29')]?moment(_0x174853['closedAt'])['format'](_0x93e5('0xbc'))[_0x93e5('0x8f')]():'','disposition':_0x174853[_0x93e5('0xd6')],'visibility':_0x174853[_0x93e5('0xd7')]?_0x93e5('0xd8'):_0x93e5('0xd9'),'messages':_(_0x174853[_0x93e5('0xcd')])[_0x93e5('0x76')]({'secret':![]})[_0x93e5('0x22')](function(_0x4365b1){if(_0x4365b1[_0x93e5('0xcc')]){var _0x43a454=path[_0x93e5('0xc4')](_0x487032,_0x4365b1['Attachment'][_0x93e5('0xda')]);if(fs[_0x93e5('0xdb')](_0x43a454)){fs['createReadStream'](_0x43a454)[_0x93e5('0xdc')](fs[_0x93e5('0xdd')](path['join'](_0xfbd9f5,_0x4365b1['Attachment'][_0x93e5('0xda')])));}}return{'date':moment(_0x4365b1[_0x93e5('0xd5')])[_0x93e5('0xbb')](_0x93e5('0xbc'))['toString'](),'sender':_0x4365b1['direction']===_0x93e5('0xde')?_0x4365b1[_0x93e5('0xc9')]?_0x4365b1['User']['fullname']:_0x93e5('0xdf'):_0x4365b1[_0x93e5('0xca')][_0x93e5('0xe0')]+(_0x4365b1[_0x93e5('0xca')][_0x93e5('0xcb')]?'\x20'+_0x4365b1[_0x93e5('0xca')]['lastName']:''),'body':_0x4365b1[_0x93e5('0xcc')]?_0x4365b1[_0x93e5('0xcc')][_0x93e5('0xda')]:_0x4365b1[_0x93e5('0x68')],'direction':_0x4365b1[_0x93e5('0xe1')]===_0x93e5('0xde')?'A':'C','secret':_0x4365b1['secret'],'read':_0x4365b1['read'],'attachment':_0x4365b1[_0x93e5('0xcc')]};})[_0x93e5('0x57')]()};return ejs[_0x93e5('0xe2')](path[_0x93e5('0xc4')](config['root'],_0x93e5('0xc6'),_0x93e5('0xe3'),_0x93e5('0xe4')),{'interaction':_0x721e9f})[_0x93e5('0x1b')](function(_0x5a1d77){var _0x1a9b8f=path['join'](_0xfbd9f5,'transcript-'+_0x174853['id']+'-'+_0x388e49+_0x93e5('0xe5'));var _0x2e9876={'path':_0x1a9b8f,'channel':'Openchannel','interactionId':_0x174853['id']};return pdf[_0x93e5('0xe6')](_0x5a1d77,_0x2e9876);})[_0x93e5('0x1b')](function(){return new Promise(function(_0x1e6bf2,_0x32f25a){zipdir(_0xfbd9f5,{'saveTo':_0x47641f},function(_0x31ece0,_0x4fe0aa){if(_0x31ece0)return _0x32f25a(_0x31ece0);return _0x1e6bf2(_0x4fe0aa);});})[_0x93e5('0x1b')](function(){return new Promise(function(_0x52aef6,_0x5c6910){rimraf(_0xfbd9f5,function(_0x18bbd1){if(_0x18bbd1)_0x5c6910(_0x18bbd1);return _0x52aef6();});});})['then'](function(){return _0x235f70[_0x93e5('0xc3')](_0x47641f,_0xfb4d06,function(_0x5f02da){if(_0x5f02da){logger[_0x93e5('0x1d')](_0x93e5('0xe7'),_0x5f02da);}else{fs[_0x93e5('0xe8')](_0x47641f);}});});});}else{return _0x235f70[_0x93e5('0x12')](0xc8);}})[_0x93e5('0xa9')](handleError(_0x235f70,null));}; \ No newline at end of file +var _0xb3f9=['compact','isEmpty','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.from\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','rows','params','includeAll','include','options','catch','create','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','fullname','CmContact','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','closedAt','Public','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','basename','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','update','then','destroy','error','name','Users','TagIds','Tags','forEach','talking','unmanaged','total','closed','UserId','waiting','index','map','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','select','field','color','tools_tags','u.id','u.fullname','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','split','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','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body'];(function(_0x55decb,_0x3fa794){var _0x584d41=function(_0x3c09d3){while(--_0x3c09d3){_0x55decb['push'](_0x55decb['shift']());}};_0x584d41(++_0x3fa794);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x59caa3,_0x487f4e){_0x59caa3=_0x59caa3-0x0;var _0x5c3246=_0xb3f9[_0x59caa3];return _0x5c3246;};'use strict';var rimraf=require(_0x9b3f('0x0'));var zipdir=require(_0x9b3f('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x9b3f('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b3f('0x3'));var squel=require(_0x9b3f('0x4'));var Redis=require(_0x9b3f('0x5'));var qs=require(_0x9b3f('0x6'));var as=require(_0x9b3f('0x7'));var pdf=require(_0x9b3f('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x9b3f('0x9'));var db=require(_0x9b3f('0xa'))['db'];config['redis']=_[_0x9b3f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b3f('0xc')]));require('./openchannelInteraction.socket')[_0x9b3f('0xd')](socket);function respondWithStatusCode(_0x258f1e,_0x2d905f){_0x2d905f=_0x2d905f||0xcc;return function(_0x230b57){if(_0x230b57){return _0x258f1e[_0x9b3f('0xe')](_0x2d905f);}return _0x258f1e['status'](_0x2d905f)[_0x9b3f('0xf')]();};}function respondWithResult(_0x56aebb,_0x29caeb){_0x29caeb=_0x29caeb||0xc8;return function(_0x44d176){if(_0x44d176){return _0x56aebb[_0x9b3f('0x10')](_0x29caeb)[_0x9b3f('0x11')](_0x44d176);}};}function respondWithFilteredResult(_0x35554e,_0x6a6bae){return function(_0x48f05f){if(_0x48f05f){var _0x537ab1=typeof _0x6a6bae[_0x9b3f('0x12')]===_0x9b3f('0x13')&&typeof _0x6a6bae[_0x9b3f('0x14')]===_0x9b3f('0x13');var _0x76978e=_0x48f05f['count'];var _0x4aa66a=_0x537ab1?0x0:_0x6a6bae['offset'];var _0x34fb19=_0x537ab1?_0x48f05f[_0x9b3f('0x15')]:_0x6a6bae[_0x9b3f('0x12')]+_0x6a6bae[_0x9b3f('0x14')];var _0xd1e302;if(_0x34fb19>=_0x76978e){_0x34fb19=_0x76978e;_0xd1e302=0xc8;}else{_0xd1e302=0xce;}_0x35554e[_0x9b3f('0x10')](_0xd1e302);return _0x35554e['set']('Content-Range',_0x4aa66a+'-'+_0x34fb19+'/'+_0x76978e)[_0x9b3f('0x11')](_0x48f05f);}return null;};}function saveUpdates(_0x235434){return function(_0x129e24){if(_0x129e24){return _0x129e24[_0x9b3f('0x16')](_0x235434)[_0x9b3f('0x17')](function(_0x297fa8){return _0x297fa8;});}return null;};}function removeEntity(_0x1524cb){return function(_0x17f2d3){if(_0x17f2d3){return _0x17f2d3[_0x9b3f('0x18')]()[_0x9b3f('0x17')](function(){_0x1524cb[_0x9b3f('0x10')](0xcc)[_0x9b3f('0xf')]();});}};}function handleEntityNotFound(_0x2db45b){return function(_0x1218c0){if(!_0x1218c0){_0x2db45b[_0x9b3f('0xe')](0x194);}return _0x1218c0;};}function handleError(_0x1eb748,_0x1d5c43){_0x1d5c43=_0x1d5c43||0x1f4;return function(_0x5195e9){logger[_0x9b3f('0x19')](_0x5195e9['stack']);if(_0x5195e9[_0x9b3f('0x1a')]){delete _0x5195e9['name'];}_0x1eb748[_0x9b3f('0x10')](_0x1d5c43)['send'](_0x5195e9);};}function getInteractionUsers(_0x3c9d8d,_0x28dd96){return new Promise(function(_0x16452e,_0x59469f){try{if(_0x28dd96[_0x3c9d8d['id']]){_0x3c9d8d[_0x9b3f('0x1b')]=_['map'](_0x28dd96[_0x3c9d8d['id']],function(_0x325c74){return{'id':_0x325c74['id'],'fullname':_0x325c74['fullname']};});}}catch(_0x1b3ba8){_0x59469f(_0x1b3ba8);}_0x16452e(_0x3c9d8d);});}function getInteractionTags(_0x32aa3e,_0x51014e){return new Promise(function(_0x248c9d,_0x4719f1){try{if(_0x32aa3e[_0x9b3f('0x1c')]){_0x32aa3e[_0x9b3f('0x1d')]=[];_0x32aa3e['TagIds']['split'](',')[_0x9b3f('0x1e')](function(_0x555bf4){_0x32aa3e[_0x9b3f('0x1d')]['push'](_0x51014e[_0x555bf4]);});}delete _0x32aa3e[_0x9b3f('0x1c')];}catch(_0x128542){_0x4719f1(_0x128542);}_0x248c9d(_0x32aa3e);});}function updateOpenchannelInteraction(_0x35f2dd,_0x1c89d3,_0x2f0045){return new Promise(function(_0x590e9c,_0x23dff5){return getInteractionUsers(_0x35f2dd,_0x2f0045)[_0x9b3f('0x17')](function(_0x1dad0e){return getInteractionTags(_0x1dad0e,_0x1c89d3);})[_0x9b3f('0x17')](function(_0x413a00){return getStateInteraction(_0x413a00);})[_0x9b3f('0x17')](function(_0x17a41d){_0x590e9c(_0x17a41d);})['catch'](function(_0x497128){_0x23dff5(_0x497128);});});}function getStateInteraction(_0x25968b){return new Promise(function(_0x4ddecb){_0x25968b['waiting']=0x0;_0x25968b[_0x9b3f('0x1f')]=0x0;_0x25968b['answered']=0x0;_0x25968b[_0x9b3f('0x20')]=0x0;_0x25968b[_0x9b3f('0x21')]=0x0;if(!_0x25968b[_0x9b3f('0x22')]&&!_0x25968b[_0x9b3f('0x23')]){_0x25968b[_0x9b3f('0x24')]+=0x1;}if(!_0x25968b['closed']&&_0x25968b[_0x9b3f('0x23')]){_0x25968b[_0x9b3f('0x1f')]+=0x1;if(_0x25968b[_0x9b3f('0x24')]){_0x25968b[_0x9b3f('0x24')]-=0x1;}}if(_0x25968b[_0x9b3f('0x22')]&&_0x25968b[_0x9b3f('0x23')]){_0x25968b['answered']+=0x1;if(_0x25968b[_0x9b3f('0x1f')]){_0x25968b[_0x9b3f('0x1f')]-=0x1;}}if(_0x25968b[_0x9b3f('0x22')]&&!_0x25968b['UserId']){_0x25968b[_0x9b3f('0x20')]+=0x1;if(_0x25968b[_0x9b3f('0x24')]){_0x25968b[_0x9b3f('0x24')]-=0x1;}}_0x25968b[_0x9b3f('0x21')]+=0x1;_0x4ddecb(_0x25968b);});}exports[_0x9b3f('0x25')]=function(_0x203d79,_0x5431a6){var _0x1cfa30={},_0x115d38={},_0x11174c={'count':0x0,'rows':[]};var _0x3f4a1d=_[_0x9b3f('0x26')](db[_0x9b3f('0x27')][_0x9b3f('0x28')],function(_0x10dca3){return{'name':_0x10dca3['fieldName'],'type':_0x10dca3[_0x9b3f('0x29')][_0x9b3f('0x2a')]};});_0x115d38[_0x9b3f('0x2b')]=_[_0x9b3f('0x26')](_0x3f4a1d,_0x9b3f('0x1a'));_0x115d38[_0x9b3f('0x2c')]=_[_0x9b3f('0x2d')](_0x203d79['query']);_0x115d38[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](_0x115d38['model'],_0x115d38[_0x9b3f('0x2c')]);_0x1cfa30[_0x9b3f('0x30')]=_['intersection'](_0x115d38[_0x9b3f('0x2b')],qs[_0x9b3f('0x31')](_0x203d79[_0x9b3f('0x2c')]['fields']));_0x1cfa30[_0x9b3f('0x30')]=_0x1cfa30[_0x9b3f('0x30')][_0x9b3f('0x32')]?_0x1cfa30[_0x9b3f('0x30')]:_0x115d38[_0x9b3f('0x2b')];if(!_0x203d79['query']['hasOwnProperty'](_0x9b3f('0x33'))){_0x1cfa30[_0x9b3f('0x14')]=qs['limit'](_0x203d79['query'][_0x9b3f('0x14')]);_0x1cfa30['offset']=qs[_0x9b3f('0x12')](_0x203d79['query'][_0x9b3f('0x12')]);}_0x1cfa30['order']=qs['sort'](_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x34')]);_0x1cfa30[_0x9b3f('0x35')]=qs[_0x9b3f('0x2e')](_['pick'](_0x203d79['query'],_0x115d38[_0x9b3f('0x2e')]),_0x3f4a1d);var _0x587890=[];var _0x17d843=squel[_0x9b3f('0x36')]()['field']('id')[_0x9b3f('0x37')](_0x9b3f('0x1a'))[_0x9b3f('0x37')](_0x9b3f('0x38'))['from'](_0x9b3f('0x39'));var _0x3dcce8=squel[_0x9b3f('0x36')]()[_0x9b3f('0x37')](_0x9b3f('0x3a'))['field'](_0x9b3f('0x3b'))[_0x9b3f('0x37')]('ui.OpenchannelInteractionId')[_0x9b3f('0x3c')](_0x9b3f('0x3d'),'ui')[_0x9b3f('0x3e')](_0x9b3f('0x3f'),'u',_0x9b3f('0x40'));var _0xdf1738=squel[_0x9b3f('0x36')]()['from'](_0x9b3f('0x41'),'i')[_0x9b3f('0x3e')](_0x9b3f('0x42'),'c',_0x9b3f('0x43'))[_0x9b3f('0x3e')](_0x9b3f('0x3f'),'o',_0x9b3f('0x44'))[_0x9b3f('0x3e')](_0x9b3f('0x45'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x9b3f('0x3e')]('openchannel_messages','me',_0x9b3f('0x46'))[_0x9b3f('0x3e')](_0x9b3f('0x47'),'it',_0x9b3f('0x48'))['left_join'](_0x9b3f('0x39'),'t',_0x9b3f('0x49'));var _0xb55fb0=squel[_0x9b3f('0x4a')]();var _0x566e4b=[];var _0x571f57=squel['expr']();var _0x4cc15b;if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x4b')]){_0x4cc15b=as[_0x9b3f('0x4c')](_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x4b')]);var _0x5891f1=_0x4cc15b[_0x9b3f('0x4d')];for(var _0x48ac1f=0x0;_0x48ac1f<_0x4cc15b[_0x9b3f('0x4e')][_0x9b3f('0x32')];_0x48ac1f++){var _0x5df6dc=_0x4cc15b[_0x9b3f('0x4e')][_0x48ac1f];var _0x1044ce='i';var _0x392a6d=_[_0x9b3f('0x4f')](_0x3f4a1d,[_0x9b3f('0x1a'),_0x5df6dc[_0x9b3f('0x37')]]);if(!_0x392a6d){switch(_0x5df6dc[_0x9b3f('0x37')]){case'unreadMessages':if(_0x5df6dc[_0x9b3f('0x50')]==0x1){_0xdf1738['having']('`'+_0x5df6dc[_0x9b3f('0x37')]+_0x9b3f('0x51'));}else{_0xdf1738[_0x9b3f('0x52')]('`'+_0x5df6dc[_0x9b3f('0x37')]+_0x9b3f('0x53'));}break;case'Contact':if(_0x5df6dc[_0x9b3f('0x54')]===_0x9b3f('0x55')){if(_0x5df6dc['value'][_0x9b3f('0x56')]('\x20')[_0x9b3f('0x32')]>0x1){_0xb55fb0[_0x5891f1](_0x9b3f('0x57'),qs['getFullTextValue'](_0x5df6dc[_0x9b3f('0x50')]),null);}else{var _0x3d465a='%'+_0x5df6dc['value']+'%';_0xb55fb0[_0x5891f1](_0x9b3f('0x58'),_0x3d465a,_0x3d465a,_0x3d465a);}}else{_0x392a6d=_[_0x9b3f('0x4f')](_0x3f4a1d,[_0x9b3f('0x1a'),_0x9b3f('0x59')]);_0x5df6dc[_0x9b3f('0x37')]='ContactId';_0x8d404d=as[_0x9b3f('0x5a')](_0x1044ce,_0x392a6d[_0x9b3f('0x29')],_0x5df6dc);_0xb55fb0[_0x5891f1](_0x8d404d[_0x9b3f('0x5b')],_0x8d404d[_0x9b3f('0x50')][_0x9b3f('0x5c')],_0x8d404d[_0x9b3f('0x50')][_0x9b3f('0xf')]);}break;case _0x9b3f('0x5d'):var _0x323c6d=_0x5df6dc[_0x9b3f('0x50')][_0x9b3f('0x56')](',')[_0x9b3f('0x26')](function(_0x2dc40e){return Number(_0x2dc40e);});_0x323c6d[_0x9b3f('0x1e')](function(_0x3e4bfe){_0x571f57['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3e4bfe+',%');});_0x566e4b=_[_0x9b3f('0x5e')](_0x566e4b,_0x323c6d);break;case _0x9b3f('0x5f'):if(_0x5df6dc[_0x9b3f('0x54')]===_0x9b3f('0x55')){_0xb55fb0[_0x5891f1](_0x9b3f('0x60'),'%'+_0x5df6dc[_0x9b3f('0x50')]+'%',null);}else{_0x392a6d=_[_0x9b3f('0x4f')](_0x3f4a1d,[_0x9b3f('0x1a'),'UserId']);_0x5df6dc[_0x9b3f('0x37')]='UserId';_0x8d404d=as[_0x9b3f('0x5a')](_0x1044ce,_0x392a6d[_0x9b3f('0x29')],_0x5df6dc);_0xb55fb0[_0x5891f1](_0x8d404d[_0x9b3f('0x5b')],_0x8d404d[_0x9b3f('0x50')][_0x9b3f('0x5c')],_0x8d404d[_0x9b3f('0x50')][_0x9b3f('0xf')]);}break;case _0x9b3f('0x61'):_0x8d404d=as[_0x9b3f('0x5a')]('me',null,_0x5df6dc);_0xb55fb0[_0x5891f1](_0x8d404d[_0x9b3f('0x5b')],_0x8d404d['value'][_0x9b3f('0x5c')],_0x8d404d[_0x9b3f('0x50')][_0x9b3f('0xf')]);break;}}else{var _0x8d404d=as[_0x9b3f('0x5a')](_0x1044ce,_0x392a6d['type'],_0x5df6dc);_0xb55fb0[_0x5891f1](_0x8d404d[_0x9b3f('0x5b')],_0x8d404d[_0x9b3f('0x50')]['start'],_0x8d404d[_0x9b3f('0x50')]['end']);}}}else{var _0x4f2ecf=_(_0x203d79['query'])['keys']()[_0x9b3f('0x26')](function(_0x401089){return _['some'](_0x3f4a1d,['name',_0x401089])?_0x401089:undefined;})[_0x9b3f('0x62')]()[_0x9b3f('0x50')]();if(!_[_0x9b3f('0x63')](_0x4f2ecf)){_0x4f2ecf['forEach'](function(_0x3a5055){if(_0x3a5055==='OpenchannelAccountId'){_0xdf1738['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x203d79['query'][_0x3a5055]));}else if(_0x3a5055===_0x9b3f('0x64')){var _0x151ede=JSON[_0x9b3f('0x65')](_0x203d79[_0x9b3f('0x2c')][_0x3a5055])[_0x9b3f('0x66')];var _0x20cd38=JSON[_0x9b3f('0x65')](_0x203d79['query'][_0x3a5055])[_0x9b3f('0x67')];_0xdf1738[_0x9b3f('0x35')](_0x9b3f('0x68'),_0x151ede,_0x20cd38);}else{if(_0x203d79[_0x9b3f('0x2c')][_0x3a5055]===_0x9b3f('0x69')){_0xdf1738['where']('i.'+_0x3a5055+'\x20IS\x20NULL');}else{_0xdf1738[_0x9b3f('0x35')]('i.'+_0x3a5055+_0x9b3f('0x6a'),_0x203d79['query'][_0x3a5055]);}}});}if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6b')]){if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6b')]==0x1){_0xdf1738[_0x9b3f('0x52')]('`unreadMessages`\x20=\x200');}else{_0xdf1738[_0x9b3f('0x52')](_0x9b3f('0x6c'));}}if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6d')]){_0x566e4b=_['isArray'](_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6d')])?_0x203d79[_0x9b3f('0x2c')]['tag']:new Array(_0x203d79[_0x9b3f('0x2c')]['tag']);_0x566e4b[_0x9b3f('0x1e')](function(_0x10ece9){_0x571f57['or'](_0x9b3f('0x6e'),'%,'+_0x10ece9+',%');});}if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6f')]){var _0x25b2a5=_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x6f')][_0x9b3f('0x70')]('\x5c','\x5c\x5c')[_0x9b3f('0x70')](/'/g,'\x27\x27');if(qs[_0x9b3f('0x71')](_0x25b2a5)){_0xb55fb0['or'](_0x9b3f('0x72'),_0x25b2a5+'%');}else{_0xb55fb0['or'](_0x9b3f('0x73'),qs[_0x9b3f('0x74')](_0x25b2a5))['or'](_0x9b3f('0x75'),_0x25b2a5+'%');}_0xb55fb0['or'](_0x9b3f('0x76'),_0x25b2a5+'%');}}_0xdf1738['where'](_0xb55fb0);_0xdf1738['group'](_0x9b3f('0x77'));var _0x11c09b={'type':db[_0x9b3f('0x78')][_0x9b3f('0x79')][_0x9b3f('0x7a')],'raw':!![]};var _0x33d381=_0xdf1738[_0x9b3f('0x7b')]();_0x33d381[_0x9b3f('0x37')]('i.id');_0x33d381[_0x9b3f('0x37')](_0x9b3f('0x7c'),_0x9b3f('0x7d'));if(_0x1cfa30[_0x9b3f('0x7e')]){_0x1cfa30[_0x9b3f('0x7e')][_0x9b3f('0x1e')](function(_0x501561){var _0x1cb969=_0x501561[0x0]===_0x9b3f('0x7f')?_0x501561[0x0]:'i.'+_0x501561[0x0];_0xdf1738['order'](_0x1cb969,_0x501561[0x1]===_0x9b3f('0x80')?![]:!![]);});}if(!_['isEmpty'](_0x566e4b)){_0xdf1738[_0x9b3f('0x52')](_0x571f57);_0x33d381[_0x9b3f('0x35')]('t.id\x20IN\x20?',_0x566e4b);}Promise[_0x9b3f('0x81')]()[_0x9b3f('0x17')](function(){if(!_0x4cc15b){if(_0x203d79[_0x9b3f('0x2c')][_0x9b3f('0x82')])return;_0x33d381[_0x9b3f('0x35')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0xdf1738[_0x9b3f('0x35')](_0x9b3f('0x83'));return;}if(_0x203d79[_0x9b3f('0x84')][_0x9b3f('0x85')]!==_0x9b3f('0x86'))return;return _0x203d79[_0x9b3f('0x84')][_0x9b3f('0x87')]({'attributes':['id'],'raw':!![]})[_0x9b3f('0x17')](function(_0x2e4773){if(_['isEmpty'](_0x2e4773)){_0x33d381[_0x9b3f('0x35')](_0x9b3f('0x88'));_0xdf1738[_0x9b3f('0x35')](_0x9b3f('0x88'));}else{_0x33d381[_0x9b3f('0x35')](_0x9b3f('0x89'),_[_0x9b3f('0x26')](_0x2e4773,'id'));_0xdf1738[_0x9b3f('0x35')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x9b3f('0x26')](_0x2e4773,'id'));}});})['then'](function(){if(_0x203d79[_0x9b3f('0x84')][_0x9b3f('0x85')]===_0x9b3f('0x86')&&!_0x4cc15b&&!_0x203d79[_0x9b3f('0x2c')]['OpenchannelAccountId'])return[];return db[_0x9b3f('0x8a')][_0x9b3f('0x2c')](_0x33d381[_0x9b3f('0x8b')](),_0x11c09b);})['then'](function(_0x5c4447){_0x11174c[_0x9b3f('0x15')]=_0x5c4447[_0x9b3f('0x32')];if(_0x11174c[_0x9b3f('0x15')]===0x0)return[];return db['sequelize']['query'](_0x17d843[_0x9b3f('0x8b')](),_0x11c09b)['then'](function(_0x48a45c){_0x587890=_[_0x9b3f('0x8c')](_0x48a45c,'id');_0x11c09b=_[_0x9b3f('0x8d')](_0x11c09b,{'model':db[_0x9b3f('0x27')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x203d79['query']['fields']){_0x1cfa30[_0x9b3f('0x30')][_0x9b3f('0x1e')](function(_0x5d7cf7){_0xdf1738['field']('i.'+_0x5d7cf7);});}else{_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x7c'),_0x9b3f('0x7d'));_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x8e'),_0x9b3f('0x8f'));_0xdf1738[_0x9b3f('0x37')]('a.mandatoryDisposition',_0x9b3f('0x90'));_0xdf1738['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',_0x9b3f('0x7f'));_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x91'));_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x92'),_0x9b3f('0x93'));_0xdf1738[_0x9b3f('0x37')]('c.lastName',_0x9b3f('0x94'));_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x95'),_0x9b3f('0x96'));_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x97'),'Contact.phone');_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x98'),'Contact.mobile');_0xdf1738['field'](_0x9b3f('0x99'),_0x9b3f('0x9a'));_0xdf1738[_0x9b3f('0x37')]('o.fullname','Owner.fullname');_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x9b'),'Owner.internal');_0xdf1738[_0x9b3f('0x37')](_0x9b3f('0x9c'),_0x9b3f('0x1c'));}if(_0x1cfa30['limit'])_0xdf1738[_0x9b3f('0x14')](_0x1cfa30[_0x9b3f('0x14')]);if(_0x1cfa30[_0x9b3f('0x12')])_0xdf1738[_0x9b3f('0x12')](_0x1cfa30[_0x9b3f('0x12')]);return db[_0x9b3f('0x8a')][_0x9b3f('0x2c')](_0xdf1738['toString'](),_0x11c09b);})[_0x9b3f('0x17')](function(_0x2347b2){if(_0x2347b2[_0x9b3f('0x32')]>0x0)_0x3dcce8[_0x9b3f('0x35')](_0x9b3f('0x9d'),_[_0x9b3f('0x26')](_0x2347b2,'id'));return db[_0x9b3f('0x8a')][_0x9b3f('0x2c')](_0x3dcce8[_0x9b3f('0x8b')](),_0x11c09b)[_0x9b3f('0x17')](function(_0x5a6fa1){var _0x5e7901=_[_0x9b3f('0x9e')](_0x5a6fa1,_0x9b3f('0x9f'));var _0xaa18c9=[];_0x2347b2[_0x9b3f('0x1e')](function(_0x7e5dce){_0xaa18c9[_0x9b3f('0xa0')](updateOpenchannelInteraction(_0x7e5dce,_0x587890,_0x5e7901));});return Promise['all'](_0xaa18c9);});});})['then'](function(_0x20adb3){_0x11174c[_0x9b3f('0xa1')]=_0x20adb3;return _0x11174c;})[_0x9b3f('0x17')](respondWithFilteredResult(_0x5431a6,_0x1cfa30))['catch'](handleError(_0x5431a6,null));};exports['show']=function(_0x39803b,_0x573abe){var _0x3801d1={};if(_0x39803b[_0x9b3f('0x2c')][_0x9b3f('0x29')]&&_0x39803b['query'][_0x9b3f('0x29')]===_0x9b3f('0x3c')){_0x3801d1['from']=_0x39803b[_0x9b3f('0xa2')]['id'];}else{_0x3801d1['id']=_0x39803b[_0x9b3f('0xa2')]['id'];}var _0x5855c1={'raw':![],'where':_0x3801d1},_0x52252f={};_0x52252f['model']=_[_0x9b3f('0x2d')](db[_0x9b3f('0x27')][_0x9b3f('0x28')]);_0x52252f[_0x9b3f('0x2c')]=_[_0x9b3f('0x2d')](_0x39803b['query']);_0x52252f[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](_0x52252f['model'],_0x52252f[_0x9b3f('0x2c')]);_0x5855c1[_0x9b3f('0x30')]=_[_0x9b3f('0x2f')](_0x52252f['model'],qs[_0x9b3f('0x31')](_0x39803b[_0x9b3f('0x2c')][_0x9b3f('0x31')]));_0x5855c1[_0x9b3f('0x30')]=_0x5855c1['attributes'][_0x9b3f('0x32')]?_0x5855c1[_0x9b3f('0x30')]:_0x52252f[_0x9b3f('0x2b')];if(_0x39803b[_0x9b3f('0x2c')][_0x9b3f('0xa3')]){_0x5855c1[_0x9b3f('0xa4')]=[{'all':!![]}];}_0x5855c1=_[_0x9b3f('0x8d')]({},_0x5855c1,_0x39803b[_0x9b3f('0xa5')]);return db['OpenchannelInteraction']['find'](_0x5855c1)['then'](handleEntityNotFound(_0x573abe,null))['then'](respondWithResult(_0x573abe,null))[_0x9b3f('0xa6')](handleError(_0x573abe,null));};exports['create']=function(_0x2763c5,_0x4e78a0){return db['OpenchannelInteraction'][_0x9b3f('0xa7')](_0x2763c5['body'],{})[_0x9b3f('0x17')](respondWithResult(_0x4e78a0,0xc9))[_0x9b3f('0xa6')](handleError(_0x4e78a0,null));};exports['update']=function(_0x564126,_0x3f69ad){if(_0x564126[_0x9b3f('0x61')]['id']){delete _0x564126[_0x9b3f('0x61')]['id'];}return db['OpenchannelInteraction'][_0x9b3f('0x4f')]({'where':{'id':_0x564126[_0x9b3f('0xa2')]['id']}})['then'](handleEntityNotFound(_0x3f69ad,null))[_0x9b3f('0x17')](saveUpdates(_0x564126[_0x9b3f('0x61')],null))['then'](respondWithResult(_0x3f69ad,null))[_0x9b3f('0xa6')](handleError(_0x3f69ad,null));};exports[_0x9b3f('0x18')]=function(_0x4389cd,_0x1fc038){return db['OpenchannelInteraction']['find']({'where':{'id':_0x4389cd[_0x9b3f('0xa2')]['id']}})['then'](handleEntityNotFound(_0x1fc038,null))['then'](removeEntity(_0x1fc038,null))[_0x9b3f('0xa6')](handleError(_0x1fc038,null));};exports['describe']=function(_0x2d24a5,_0x3476d7){return db[_0x9b3f('0x27')][_0x9b3f('0xa8')]()['then'](respondWithResult(_0x3476d7,null))[_0x9b3f('0xa6')](handleError(_0x3476d7,null));};exports[_0x9b3f('0xa9')]=function(_0x515fbc,_0x15d027){return db['OpenchannelMessage'][_0x9b3f('0x4f')]({'where':{'id':_0x515fbc[_0x9b3f('0xa2')]['id']}})[_0x9b3f('0x17')](handleEntityNotFound(_0x15d027,null))['then'](function(_0x2de710){if(_0x2de710){return _0x2de710[_0x9b3f('0xa9')](_0x515fbc[_0x9b3f('0x61')][_0x9b3f('0xaa')],_[_0x9b3f('0xab')](_0x515fbc[_0x9b3f('0x61')],[_0x9b3f('0xaa'),'id'])||{});}})[_0x9b3f('0x17')](respondWithResult(_0x15d027,null))[_0x9b3f('0xa6')](handleError(_0x15d027,null));};exports[_0x9b3f('0xac')]=function(_0x279406,_0x136498){var _0xf47c7={'raw':![],'where':{}};var _0x38a399={};var _0x3625ec={'count':0x0,'rows':[]};return db[_0x9b3f('0x27')][_0x9b3f('0xad')]({'where':{'id':_0x279406[_0x9b3f('0xa2')]['id']}})[_0x9b3f('0x17')](handleEntityNotFound(_0x136498,null))['then'](function(_0x4fc957){if(_0x4fc957){_0x38a399['model']=_[_0x9b3f('0x2d')](db['OpenchannelMessage'][_0x9b3f('0x28')]);_0x38a399[_0x9b3f('0x2c')]=_['keys'](_0x279406[_0x9b3f('0x2c')]);_0x38a399[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](_0x38a399[_0x9b3f('0x2b')],_0x38a399[_0x9b3f('0x2c')]);_0xf47c7[_0x9b3f('0x30')]=_[_0x9b3f('0x2f')](_0x38a399['model'],qs[_0x9b3f('0x31')](_0x279406[_0x9b3f('0x2c')][_0x9b3f('0x31')]));_0xf47c7[_0x9b3f('0x30')]=_0xf47c7['attributes'][_0x9b3f('0x32')]?_0xf47c7[_0x9b3f('0x30')]:_0x38a399[_0x9b3f('0x2b')];if(!_0x279406['query'][_0x9b3f('0xae')]('nolimit')){_0xf47c7['limit']=qs['limit'](_0x279406['query']['limit']);_0xf47c7['offset']=qs['offset'](_0x279406[_0x9b3f('0x2c')][_0x9b3f('0x12')]);}_0xf47c7[_0x9b3f('0x7e')]=qs[_0x9b3f('0x34')](_0x279406[_0x9b3f('0x2c')][_0x9b3f('0x34')]);_0xf47c7[_0x9b3f('0x35')]=qs[_0x9b3f('0x2e')](_[_0x9b3f('0xaf')](_0x279406[_0x9b3f('0x2c')],_0x38a399[_0x9b3f('0x2e')]));_0xf47c7['where'][_0x9b3f('0x9f')]=_0x4fc957['id'];if(_0x279406[_0x9b3f('0x2c')][_0x9b3f('0x6f')]){_0xf47c7[_0x9b3f('0x35')]=_['merge'](_0xf47c7[_0x9b3f('0x35')],{'$or':_[_0x9b3f('0x26')](_0xf47c7[_0x9b3f('0x30')],function(_0x546c23){var _0x164294={};_0x164294[_0x546c23]={'$like':'%'+_0x279406[_0x9b3f('0x2c')][_0x9b3f('0x6f')]+'%'};return _0x164294;})});}if(_0x279406['query'][_0x9b3f('0x66')]){var _0x5a3218=_0x279406[_0x9b3f('0x2c')]['$gte']['split'](',');var _0x28fe76={};_0x28fe76[_0x5a3218[0x0]]={'$gte':moment(_0x5a3218[0x1])[_0x9b3f('0xb0')](_0x9b3f('0xb1'))};_0xf47c7[_0x9b3f('0x35')]=_[_0x9b3f('0x8d')](_0xf47c7[_0x9b3f('0x35')],_0x28fe76);}_0xf47c7=_[_0x9b3f('0x8d')]({},_0xf47c7,_0x279406[_0x9b3f('0xa5')]);return db[_0x9b3f('0xb2')]['count']({'where':_0xf47c7[_0x9b3f('0x35')]})[_0x9b3f('0x17')](function(_0x3d9f9a){_0x3625ec['count']=_0x3d9f9a;if(_0x279406[_0x9b3f('0x2c')][_0x9b3f('0xa3')]){_0xf47c7[_0x9b3f('0xa4')]=[{'all':!![]}];}return db[_0x9b3f('0xb2')][_0x9b3f('0xb3')](_0xf47c7);})[_0x9b3f('0x17')](function(_0x3b2150){_0x3625ec['rows']=_0x3b2150;return _0x3625ec;});}})[_0x9b3f('0x17')](respondWithFilteredResult(_0x136498,_0xf47c7))['catch'](handleError(_0x136498,null));};exports[_0x9b3f('0xb4')]=function(_0x2a88b5,_0x38b675){return db['OpenchannelInteraction'][_0x9b3f('0x4f')]({'where':{'id':_0x2a88b5[_0x9b3f('0xa2')]['id']}})[_0x9b3f('0x17')](handleEntityNotFound(_0x38b675,null))[_0x9b3f('0x17')](function(_0x12e43d){if(_0x12e43d){return _0x12e43d['setTags'](_0x2a88b5[_0x9b3f('0x61')][_0x9b3f('0xaa')],_[_0x9b3f('0xab')](_0x2a88b5['body'],[_0x9b3f('0xaa'),'id'])||{})[_0x9b3f('0xb5')](function(){return db['Tag'][_0x9b3f('0xb3')]({'attributes':['id',_0x9b3f('0x1a'),'color'],'where':{'id':_0x2a88b5[_0x9b3f('0x61')][_0x9b3f('0xaa')]}});})['then'](function(_0xaf4cfc){socket[_0x9b3f('0xb6')](_0x9b3f('0xb7'),{'id':Number(_0x2a88b5[_0x9b3f('0xa2')]['id']),'tags':_0xaf4cfc||[]});return{'id':Number(_0x2a88b5[_0x9b3f('0xa2')]['id']),'tags':_0xaf4cfc||[]};});}})['then'](respondWithResult(_0x38b675,null))[_0x9b3f('0xa6')](handleError(_0x38b675,null));};exports['removeTags']=function(_0x36c66a,_0x4c3e07){return db[_0x9b3f('0x27')][_0x9b3f('0x4f')]({'where':{'id':_0x36c66a[_0x9b3f('0xa2')]['id']}})[_0x9b3f('0x17')](handleEntityNotFound(_0x4c3e07,null))['then'](function(_0xd998c6){if(_0xd998c6){return _0xd998c6[_0x9b3f('0xb8')](_0x36c66a[_0x9b3f('0x2c')][_0x9b3f('0xaa')]);}})[_0x9b3f('0x17')](respondWithStatusCode(_0x4c3e07,null))[_0x9b3f('0xa6')](handleError(_0x4c3e07,null));};exports[_0x9b3f('0xb9')]=function(_0x31443f,_0x42c2a7){var _0x408c21=moment()[_0x9b3f('0xba')]()[_0x9b3f('0x8b')]();var _0x2ce637=path[_0x9b3f('0xbb')](config[_0x9b3f('0xbc')],_0x9b3f('0xbd'),_0x9b3f('0xbe'),_0x9b3f('0xbf'));var _0x483f40=path[_0x9b3f('0xbb')](config[_0x9b3f('0xbc')],_0x9b3f('0xbd'),_0x9b3f('0xbe'),_0x9b3f('0xc0'));var _0x1865d8=path[_0x9b3f('0xbb')](_0x2ce637,_0x408c21);var _0xb45da2=util[_0x9b3f('0xb0')]('transcript-%d-%s.zip',_0x31443f[_0x9b3f('0xa2')]['id'],_0x408c21);var _0x16bf29=path[_0x9b3f('0xbb')](_0x2ce637,_0xb45da2);var _0x45bd1f=[];_0x45bd1f[_0x9b3f('0xa0')]({'model':db[_0x9b3f('0x5f')],'as':'User','attributes':['id',_0x9b3f('0xc1')],'raw':!![]});_0x45bd1f['push']({'model':db[_0x9b3f('0xc2')],'as':'Contact','attributes':['id','firstName',_0x9b3f('0xc3')],'raw':!![]});if(_0x31443f['query'][_0x9b3f('0xc0')]){_0x45bd1f[_0x9b3f('0xa0')]({'model':db['Attachment'],'as':_0x9b3f('0xc4'),'raw':!![]});}var _0x55b3e5=[{'model':db[_0x9b3f('0xb2')],'as':_0x9b3f('0xc5'),'attributes':['id','body',_0x9b3f('0x64'),'direction',_0x9b3f('0xc6'),_0x9b3f('0x6b')],'include':_0x45bd1f}];_0x55b3e5[_0x9b3f('0xa0')]({'model':db[_0x9b3f('0xc7')],'as':_0x9b3f('0xc8'),'attributes':['id',_0x9b3f('0x1a')]});_0x55b3e5[_0x9b3f('0xa0')]({'model':db[_0x9b3f('0x5f')],'as':_0x9b3f('0xc9'),'attributes':['id',_0x9b3f('0xc1')]});return db[_0x9b3f('0x27')]['find']({'where':{'id':_0x31443f[_0x9b3f('0xa2')]['id']},'include':_0x55b3e5})['then'](handleEntityNotFound(_0x42c2a7,null))[_0x9b3f('0x17')](function(_0x350543){if(_0x350543){var _0x10ae5a=_0x350543['get']({'plain':!![]});fs[_0x9b3f('0xca')](_0x1865d8);var _0x3daa73={'channel':'Openchannel','account':_0x10ae5a[_0x9b3f('0xc8')][_0x9b3f('0x1a')],'agent':_0x10ae5a['Owner']?_0x10ae5a[_0x9b3f('0xc9')][_0x9b3f('0xc1')]:_0x9b3f('0xcb'),'createdAt':moment(_0x10ae5a[_0x9b3f('0x64')])[_0x9b3f('0xb0')](_0x9b3f('0xb1'))[_0x9b3f('0x8b')](),'closedAt':_0x10ae5a[_0x9b3f('0x22')]?moment(_0x10ae5a[_0x9b3f('0xcc')])['format'](_0x9b3f('0xb1'))[_0x9b3f('0x8b')]():'','disposition':_0x10ae5a['disposition'],'visibility':_0x10ae5a['threadId']?_0x9b3f('0xcd'):'Private','messages':_(_0x10ae5a[_0x9b3f('0xc5')])[_0x9b3f('0x6f')]({'secret':![]})[_0x9b3f('0x26')](function(_0x53b787){if(_0x53b787['Attachment']){var _0x18cfe7=path[_0x9b3f('0xbb')](_0x483f40,_0x53b787[_0x9b3f('0xc4')]['basename']);if(fs[_0x9b3f('0xce')](_0x18cfe7)){fs[_0x9b3f('0xcf')](_0x18cfe7)[_0x9b3f('0xd0')](fs[_0x9b3f('0xd1')](path[_0x9b3f('0xbb')](_0x1865d8,_0x53b787[_0x9b3f('0xc4')]['basename'])));}}return{'date':moment(_0x53b787[_0x9b3f('0x64')])[_0x9b3f('0xb0')](_0x9b3f('0xb1'))[_0x9b3f('0x8b')](),'sender':_0x53b787['direction']===_0x9b3f('0xd2')?_0x53b787[_0x9b3f('0x5f')]?_0x53b787[_0x9b3f('0x5f')][_0x9b3f('0xc1')]:_0x9b3f('0xd3'):_0x53b787[_0x9b3f('0xd4')]['firstName']+(_0x53b787[_0x9b3f('0xd4')][_0x9b3f('0xc3')]?'\x20'+_0x53b787[_0x9b3f('0xd4')][_0x9b3f('0xc3')]:''),'body':_0x53b787[_0x9b3f('0xc4')]?_0x53b787['Attachment'][_0x9b3f('0xd5')]:_0x53b787[_0x9b3f('0x61')],'direction':_0x53b787['direction']===_0x9b3f('0xd2')?'A':'C','secret':_0x53b787[_0x9b3f('0xc6')],'read':_0x53b787[_0x9b3f('0x6b')],'attachment':_0x53b787[_0x9b3f('0xc4')]};})[_0x9b3f('0x50')]()};return ejs[_0x9b3f('0xd6')](path['join'](config['root'],_0x9b3f('0xbd'),_0x9b3f('0xd7'),_0x9b3f('0xd8')),{'interaction':_0x3daa73})[_0x9b3f('0x17')](function(_0x10a53a){var _0xa85fa=path['join'](_0x1865d8,'transcript-'+_0x10ae5a['id']+'-'+_0x408c21+_0x9b3f('0xd9'));var _0x2be416={'path':_0xa85fa,'channel':_0x9b3f('0xda'),'interactionId':_0x10ae5a['id']};return pdf['createPdfFromHTML'](_0x10a53a,_0x2be416);})['then'](function(){return new Promise(function(_0x340701,_0xa9269b){zipdir(_0x1865d8,{'saveTo':_0x16bf29},function(_0xc97c1f,_0x3f0ddf){if(_0xc97c1f)return _0xa9269b(_0xc97c1f);return _0x340701(_0x3f0ddf);});})[_0x9b3f('0x17')](function(){return new Promise(function(_0x51c72d,_0x224012){rimraf(_0x1865d8,function(_0x4cb118){if(_0x4cb118)_0x224012(_0x4cb118);return _0x51c72d();});});})['then'](function(){return _0x42c2a7['download'](_0x16bf29,_0xb45da2,function(_0x1c224a){if(_0x1c224a){logger[_0x9b3f('0x19')](_0x9b3f('0xdb'),_0x1c224a);}else{fs['unlinkSync'](_0x16bf29);}});});});}else{return _0x42c2a7['sendStatus'](0xc8);}})[_0x9b3f('0xa6')](handleError(_0x42c2a7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f3f7fa9..352090d 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 _0x3561=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','save','update','then','Users','map','findAll','setDataValue','unreadMessages'];(function(_0x3e07e0,_0x5f02d2){var _0x15d635=function(_0x154dd3){while(--_0x154dd3){_0x3e07e0['push'](_0x3e07e0['shift']());}};_0x15d635(++_0x5f02d2);}(_0x3561,0x16b));var _0x1356=function(_0x553ed8,_0x46a246){_0x553ed8=_0x553ed8-0x0;var _0x4e6f7a=_0x3561[_0x553ed8];return _0x4e6f7a;};'use strict';var EventEmitter=require(_0x1356('0x0'));var OpenchannelInteraction=require(_0x1356('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x1356('0x1'))['db'][_0x1356('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1356('0x3'),'afterUpdate':_0x1356('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5231bf){return function(_0x302db1,_0x39a852,_0x5da904){_0x302db1['getUsers']({'attributes':['id'],'raw':!![]})[_0x1356('0x5')](function(_0x4a6077){_0x302db1['setDataValue'](_0x1356('0x6'),_0x4a6077[_0x1356('0x7')](function(_0x23c53e){return{'id':_0x23c53e['id']};}));return OpenchannelMessage[_0x1356('0x8')]({'where':{'OpenchannelInteractionId':_0x302db1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1356('0x5')](function(_0x51b0a2){_0x302db1[_0x1356('0x9')](_0x1356('0xa'),_0x51b0a2[_0x1356('0xb')]);OpenchannelInteractionEvents[_0x1356('0xc')](_0x5231bf+':'+_0x302db1['id'],_0x302db1);OpenchannelInteractionEvents[_0x1356('0xc')](_0x5231bf,_0x302db1);_0x5da904(null);})[_0x1356('0xd')](_0x5da904(null));};}for(var e in events){if(events[_0x1356('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x1356('0xf')](e,emitEvent(event));}}module[_0x1356('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x52bd=['Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','update','remove','getUsers','then','setDataValue'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x52bd,0x105));var _0xd52b=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x52bd[_0x2cfb58];return _0xd99951;};'use strict';var EventEmitter=require(_0xd52b('0x0'));var OpenchannelInteraction=require(_0xd52b('0x1'))['db'][_0xd52b('0x2')];var OpenchannelMessage=require(_0xd52b('0x1'))['db'][_0xd52b('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd52b('0x4'),'afterDestroy':_0xd52b('0x5')};function emitEvent(_0x585a05){return function(_0x191719,_0x1fdaaf,_0x2ae33e){_0x191719[_0xd52b('0x6')]({'attributes':['id'],'raw':!![]})[_0xd52b('0x7')](function(_0xe97bb9){_0x191719[_0xd52b('0x8')](_0xd52b('0x9'),_0xe97bb9[_0xd52b('0xa')](function(_0x4c0b12){return{'id':_0x4c0b12['id']};}));return OpenchannelMessage[_0xd52b('0xb')]({'where':{'OpenchannelInteractionId':_0x191719['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd52b('0x7')](function(_0x4c8dd9){_0x191719['setDataValue'](_0xd52b('0xc'),_0x4c8dd9[_0xd52b('0xd')]);OpenchannelInteractionEvents[_0xd52b('0xe')](_0x585a05+':'+_0x191719['id'],_0x191719);OpenchannelInteractionEvents['emit'](_0x585a05,_0x191719);_0x2ae33e(null);})['catch'](_0x2ae33e(null));};}for(var e in events){if(events[_0xd52b('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xd52b('0x10')](e,emitEvent(event));}}module[_0xd52b('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 51e3886..50eaa64 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 _0xf6ff=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','rimraf','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4_unicode_ci','changed'];(function(_0x3897f3,_0x2ed03d){var _0x4acc92=function(_0x31bf27){while(--_0x31bf27){_0x3897f3['push'](_0x3897f3['shift']());}};_0x4acc92(++_0x2ed03d);}(_0xf6ff,0x11b));var _0xff6f=function(_0x1fe2f3,_0x3abe8d){_0x1fe2f3=_0x1fe2f3-0x0;var _0x49e14c=_0xf6ff[_0x1fe2f3];return _0x49e14c;};'use strict';var _=require(_0xff6f('0x0'));var util=require(_0xff6f('0x1'));var logger=require('../../config/logger')(_0xff6f('0x2'));var moment=require(_0xff6f('0x3'));var BPromise=require('bluebird');var rp=require(_0xff6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff6f('0x5'));var config=require('../../config/environment');var attributes=require(_0xff6f('0x6'));module['exports']=function(_0x4be55b,_0x26967b){return _0x4be55b[_0xff6f('0x7')](_0xff6f('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xff6f('0x9'),'hooks':{'beforeUpdate':function(_0x7cc40c,_0xc8136,_0x55897b){if(_0x7cc40c[_0xff6f('0xa')](_0xff6f('0xb'))){_0x7cc40c['closedAt']=moment()[_0xff6f('0xc')](_0xff6f('0xd'));}_0x55897b(null,_0x7cc40c);}}});}; \ No newline at end of file +var _0x21a0=['closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','path','../../config/environment','./openchannelInteraction.attributes','exports','utf8mb4','changed'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21a0,0x10b));var _0x021a=function(_0x4a8bd8,_0x42d7c4){_0x4a8bd8=_0x4a8bd8-0x0;var _0x2654b9=_0x21a0[_0x4a8bd8];return _0x2654b9;};'use strict';var _=require('lodash');var util=require(_0x021a('0x0'));var logger=require(_0x021a('0x1'))('api');var moment=require(_0x021a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x021a('0x3'));var rimraf=require('rimraf');var config=require(_0x021a('0x4'));var attributes=require(_0x021a('0x5'));module[_0x021a('0x6')]=function(_0x49f95c,_0x378771){return _0x49f95c['define']('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x021a('0x7'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x25dee0,_0xbabcd8,_0x24d2d0){if(_0x25dee0[_0x021a('0x8')](_0x021a('0x9'))){_0x25dee0['closedAt']=moment()[_0x021a('0xa')](_0x021a('0xb'));}_0x24d2d0(null,_0x25dee0);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 6e3f6a6..6bfc995 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 _0x811d=['OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','then'];(function(_0x4e128a,_0x3ad506){var _0x3829f6=function(_0x3cc48d){while(--_0x3cc48d){_0x4e128a['push'](_0x4e128a['shift']());}};_0x3829f6(++_0x3ad506);}(_0x811d,0x1a7));var _0xd811=function(_0x35c6b5,_0xa0e9da){_0x35c6b5=_0x35c6b5-0x0;var _0x415194=_0x811d[_0x35c6b5];return _0x415194;};'use strict';var _=require(_0xd811('0x0'));var util=require(_0xd811('0x1'));var moment=require(_0xd811('0x2'));var BPromise=require(_0xd811('0x3'));var rs=require(_0xd811('0x4'));var fs=require('fs');var Redis=require(_0xd811('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd811('0x6'))('rpc');var config=require(_0xd811('0x7'));var jayson=require(_0xd811('0x8'));var client=jayson[_0xd811('0x9')][_0xd811('0xa')]({'port':0x232a});config['redis']=_[_0xd811('0xb')](config[_0xd811('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd811('0xd'))(new Redis(config[_0xd811('0xc')]));require(_0xd811('0xe'))[_0xd811('0xf')](socket);function respondWithRpcPromise(_0x332b86,_0x3907a3,_0x4579e7){return new BPromise(function(_0x25f4f0,_0x528b79){return client['request'](_0x332b86,_0x4579e7)[_0xd811('0x10')](function(_0x4980fc){logger['info'](_0xd811('0x11'),_0x3907a3,_0xd811('0x12'));logger[_0xd811('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3907a3,_0xd811('0x12'),JSON[_0xd811('0x14')](_0x4980fc));if(_0x4980fc[_0xd811('0x15')]){if(_0x4980fc[_0xd811('0x15')][_0xd811('0x16')]===0x1f4){logger['error'](_0xd811('0x11'),_0x3907a3,_0x4980fc[_0xd811('0x15')][_0xd811('0x17')]);return _0x528b79(_0x4980fc['error'][_0xd811('0x17')]);}logger[_0xd811('0x15')](_0xd811('0x11'),_0x3907a3,_0x4980fc[_0xd811('0x15')][_0xd811('0x17')]);return _0x25f4f0(_0x4980fc['error'][_0xd811('0x17')]);}else{logger[_0xd811('0x18')](_0xd811('0x11'),_0x3907a3,'request\x20sent');_0x25f4f0(_0x4980fc[_0xd811('0x19')][_0xd811('0x17')]);}})[_0xd811('0x1a')](function(_0x5294fc){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3907a3,_0x5294fc);_0x528b79(_0x5294fc);});});}exports[_0xd811('0x1b')]=function(_0x18067d){var _0x4e3be6=this;return new Promise(function(_0x1163fc,_0x3c03a8){return db[_0xd811('0x1c')][_0xd811('0x1d')](_0x18067d[_0xd811('0x1e')],{'raw':_0x18067d[_0xd811('0x1f')]?_0x18067d[_0xd811('0x1f')][_0xd811('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18067d[_0xd811('0x1f')]?_0x18067d[_0xd811('0x1f')][_0xd811('0x21')]||null:null,'attributes':_0x18067d[_0xd811('0x1f')]?_0x18067d['options'][_0xd811('0x22')]||null:null,'limit':_0x18067d[_0xd811('0x1f')]?_0x18067d[_0xd811('0x1f')][_0xd811('0x23')]||null:null})[_0xd811('0x10')](function(_0x40a3a1){logger[_0xd811('0x18')]('UpdateOpenchannelInteraction',_0x18067d);logger[_0xd811('0x13')](_0xd811('0x1b'),_0x18067d,JSON[_0xd811('0x14')](_0x40a3a1));_0x1163fc(_0x40a3a1);})[_0xd811('0x1a')](function(_0x1adeb5){logger[_0xd811('0x15')](_0xd811('0x1b'),_0x1adeb5['message'],_0x18067d);_0x3c03a8(_0x4e3be6[_0xd811('0x15')](0x1f4,_0x1adeb5[_0xd811('0x17')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0xde7862){return new Promise(function(_0x30dffd,_0x452286){return db[_0xd811('0x1c')]['find']({'where':_0xde7862[_0xd811('0x1f')]?_0xde7862[_0xd811('0x1f')][_0xd811('0x21')]||null:null})[_0xd811('0x10')](function(_0x32c49b){if(_0x32c49b){return _0x32c49b[_0xd811('0x24')](_0xde7862['body'][_0xd811('0x25')],_['omit'](_0xde7862[_0xd811('0x1e')],[_0xd811('0x25'),'id'])||{});}})[_0xd811('0x26')](function(_0x36e971){logger[_0xd811('0x18')](_0xd811('0x27'),_0xde7862);logger[_0xd811('0x13')](_0xd811('0x27'),_0xde7862,JSON['stringify'](_0x36e971));_0x30dffd(_0x36e971);})['catch'](function(_0x9b3487){logger[_0xd811('0x15')](_0xd811('0x27'),_0x9b3487[_0xd811('0x17')],_0xde7862);_0x452286(_this[_0xd811('0x15')](0x1f4,_0x9b3487['message']));});});}; \ No newline at end of file +var _0xf52b=['body','options','where','attributes','limit','stringify','catch','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update'];(function(_0x1d3046,_0x8b14e1){var _0x3b9b62=function(_0xb69d69){while(--_0xb69d69){_0x1d3046['push'](_0x1d3046['shift']());}};_0x3b9b62(++_0x8b14e1);}(_0xf52b,0x16c));var _0xbf52=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xf52b[_0x1a0600];return _0x734670;};'use strict';var _=require(_0xbf52('0x0'));var util=require(_0xbf52('0x1'));var moment=require(_0xbf52('0x2'));var BPromise=require(_0xbf52('0x3'));var rs=require(_0xbf52('0x4'));var fs=require('fs');var Redis=require(_0xbf52('0x5'));var db=require(_0xbf52('0x6'))['db'];var utils=require(_0xbf52('0x7'));var logger=require(_0xbf52('0x8'))(_0xbf52('0x9'));var config=require(_0xbf52('0xa'));var jayson=require(_0xbf52('0xb'));var client=jayson[_0xbf52('0xc')][_0xbf52('0xd')]({'port':0x232a});config[_0xbf52('0xe')]=_[_0xbf52('0xf')](config['redis'],{'host':_0xbf52('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbf52('0x11'))['register'](socket);function respondWithRpcPromise(_0x49eef2,_0x151df0,_0x2c1601){return new BPromise(function(_0x3f16d6,_0x3c8ecc){return client[_0xbf52('0x12')](_0x49eef2,_0x2c1601)[_0xbf52('0x13')](function(_0x41678c){logger[_0xbf52('0x14')](_0xbf52('0x15'),_0x151df0,'request\x20sent');logger[_0xbf52('0x16')](_0xbf52('0x17'),_0x151df0,_0xbf52('0x18'),JSON['stringify'](_0x41678c));if(_0x41678c['error']){if(_0x41678c['error'][_0xbf52('0x19')]===0x1f4){logger[_0xbf52('0x1a')](_0xbf52('0x15'),_0x151df0,_0x41678c[_0xbf52('0x1a')][_0xbf52('0x1b')]);return _0x3c8ecc(_0x41678c[_0xbf52('0x1a')][_0xbf52('0x1b')]);}logger[_0xbf52('0x1a')](_0xbf52('0x15'),_0x151df0,_0x41678c[_0xbf52('0x1a')][_0xbf52('0x1b')]);return _0x3f16d6(_0x41678c[_0xbf52('0x1a')][_0xbf52('0x1b')]);}else{logger[_0xbf52('0x14')](_0xbf52('0x15'),_0x151df0,_0xbf52('0x18'));_0x3f16d6(_0x41678c[_0xbf52('0x1c')][_0xbf52('0x1b')]);}})['catch'](function(_0xeb7f2f){logger['error'](_0xbf52('0x15'),_0x151df0,_0xeb7f2f);_0x3c8ecc(_0xeb7f2f);});});}exports[_0xbf52('0x1d')]=function(_0x42934c){var _0x4255b1=this;return new Promise(function(_0x285214,_0x87be2b){return db[_0xbf52('0x1e')][_0xbf52('0x1f')](_0x42934c[_0xbf52('0x20')],{'raw':_0x42934c[_0xbf52('0x21')]?_0x42934c[_0xbf52('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42934c[_0xbf52('0x21')]?_0x42934c[_0xbf52('0x21')][_0xbf52('0x22')]||null:null,'attributes':_0x42934c['options']?_0x42934c['options'][_0xbf52('0x23')]||null:null,'limit':_0x42934c[_0xbf52('0x21')]?_0x42934c[_0xbf52('0x21')][_0xbf52('0x24')]||null:null})[_0xbf52('0x13')](function(_0x27524f){logger[_0xbf52('0x14')](_0xbf52('0x1d'),_0x42934c);logger['debug']('UpdateOpenchannelInteraction',_0x42934c,JSON[_0xbf52('0x25')](_0x27524f));_0x285214(_0x27524f);})[_0xbf52('0x26')](function(_0x29289a){logger['error'](_0xbf52('0x1d'),_0x29289a[_0xbf52('0x1b')],_0x42934c);_0x87be2b(_0x4255b1[_0xbf52('0x1a')](0x1f4,_0x29289a['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x511318){return new Promise(function(_0x1638bd,_0x287874){return db[_0xbf52('0x1e')]['find']({'where':_0x511318[_0xbf52('0x21')]?_0x511318[_0xbf52('0x21')][_0xbf52('0x22')]||null:null})[_0xbf52('0x13')](function(_0x12c946){if(_0x12c946){return _0x12c946[_0xbf52('0x27')](_0x511318[_0xbf52('0x20')][_0xbf52('0x28')],_[_0xbf52('0x29')](_0x511318[_0xbf52('0x20')],[_0xbf52('0x28'),'id'])||{});}})[_0xbf52('0x2a')](function(_0xf36c59){logger[_0xbf52('0x14')](_0xbf52('0x2b'),_0x511318);logger[_0xbf52('0x16')](_0xbf52('0x2b'),_0x511318,JSON[_0xbf52('0x25')](_0xf36c59));_0x1638bd(_0xf36c59);})[_0xbf52('0x26')](function(_0x40eac6){logger[_0xbf52('0x1a')]('AddTags',_0x40eac6['message'],_0x511318);_0x287874(_this[_0xbf52('0x1a')](0x1f4,_0x40eac6[_0xbf52('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0275075..c8bb4b6 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 _0xbd85=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener','register'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xbd85,0x9c));var _0x5bd8=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0xbd85[_0x631a3c];return _0x2bdfa3;};'use strict';var OpenchannelInteractionEvents=require(_0x5bd8('0x0'));var events=['save',_0x5bd8('0x1'),_0x5bd8('0x2')];function createListener(_0x48abe4,_0x3dee74){return function(_0x2a9a2a){_0x3dee74['emit'](_0x48abe4,_0x2a9a2a);};}function removeListener(_0x10d577,_0x5bf279){return function(){OpenchannelInteractionEvents[_0x5bd8('0x3')](_0x10d577,_0x5bf279);};}exports[_0x5bd8('0x4')]=function(_0x34de51){for(var _0x4ddea4=0x0,_0x4252d8=events[_0x5bd8('0x5')];_0x4ddea4<_0x4252d8;_0x4ddea4++){var _0x5b95e0=events[_0x4ddea4];var _0x486c9b=createListener(_0x5bd8('0x6')+_0x5b95e0,_0x34de51);OpenchannelInteractionEvents['on'](_0x5b95e0,_0x486c9b);}}; \ No newline at end of file +var _0x2ec7=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x2ec7,0x181));var _0x72ec=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x2ec7[_0x199572];return _0x13cfa3;};'use strict';var OpenchannelInteractionEvents=require(_0x72ec('0x0'));var events=[_0x72ec('0x1'),'remove',_0x72ec('0x2')];function createListener(_0x33c3a1,_0x58eb6e){return function(_0x3892a4){_0x58eb6e[_0x72ec('0x3')](_0x33c3a1,_0x3892a4);};}function removeListener(_0x49a4db,_0x428b87){return function(){OpenchannelInteractionEvents[_0x72ec('0x4')](_0x49a4db,_0x428b87);};}exports[_0x72ec('0x5')]=function(_0x1b2f0a){for(var _0x3ad203=0x0,_0x98dea0=events[_0x72ec('0x6')];_0x3ad203<_0x98dea0;_0x3ad203++){var _0x1cb492=events[_0x3ad203];var _0x3ea213=createListener(_0x72ec('0x7')+_0x1cb492,_0x1b2f0a);OpenchannelInteractionEvents['on'](_0x1cb492,_0x3ea213);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index cd49bbc..144feec 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2c0c49,_0x11cc5c){var _0x4fd1fd=function(_0x34e263){while(--_0x34e263){_0x2c0c49['push'](_0x2c0c49['shift']());}};_0x4fd1fd(++_0x11cc5c);}(_0xedd9,0xfc));var _0x9edd=function(_0x39bcb1,_0x2bca3c){_0x39bcb1=_0x39bcb1-0x0;var _0x1941ed=_0xedd9[_0x39bcb1];return _0x1941ed;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x447b8f,_0x396387){var _0x237474=function(_0x15ad47){while(--_0x15ad47){_0x447b8f['push'](_0x447b8f['shift']());}};_0x237474(++_0x396387);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2f3b51a..4fdb600 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 _0x6ea9=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x739814,_0x2048d9){var _0x5192bf=function(_0x5bd9f0){while(--_0x5bd9f0){_0x739814['push'](_0x739814['shift']());}};_0x5192bf(++_0x2048d9);}(_0x6ea9,0x89));var _0x96ea=function(_0x1cc6b8,_0x273e05){_0x1cc6b8=_0x1cc6b8-0x0;var _0x142533=_0x6ea9[_0x1cc6b8];return _0x142533;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'body':{'type':Sequelize[_0x96ea('0x2')](_0x96ea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96ea('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x96ea('0x5')]('in',_0x96ea('0x6')),'defaultValue':_0x96ea('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x96ea('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x235a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x485c9f,_0x399a20){var _0x2ba76e=function(_0x3598d4){while(--_0x3598d4){_0x485c9f['push'](_0x485c9f['shift']());}};_0x2ba76e(++_0x399a20);}(_0x235a,0x1ef));var _0xa235=function(_0x26d518,_0x2b3c4a){_0x26d518=_0x26d518-0x0;var _0xd49c5=_0x235a[_0x26d518];return _0xd49c5;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'body':{'type':Sequelize[_0xa235('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa235('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa235('0x4')]('in',_0xa235('0x5')),'defaultValue':_0xa235('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa235('0x6')]},'providerName':{'type':Sequelize[_0xa235('0x7')]},'providerResponse':{'type':Sequelize[_0xa235('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2fa3041..96d4347 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 _0xf0f5=['request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','OpenchannelMessage','rawAttributes','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','create','body','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteractionId','isNil','read1stAt','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','contact','User','fullname','interface','SIP/%s','channel','motionChannel','EventManager','OpenchannelInteraction','interaction','RejectMessage','rejectMessage','ContactId','SELECT','event','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client'];(function(_0xae263,_0x2678c5){var _0x4ee809=function(_0x4c8748){while(--_0x4c8748){_0xae263['push'](_0xae263['shift']());}};_0x4ee809(++_0x2678c5);}(_0xf0f5,0x1e8));var _0x5f0f=function(_0x35860c,_0x30f18e){_0x35860c=_0x35860c-0x0;var _0x24a257=_0xf0f5[_0x35860c];return _0x24a257;};'use strict';var emlformat=require(_0x5f0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f0f('0x1'));var jsonpatch=require(_0x5f0f('0x2'));var rp=require(_0x5f0f('0x3'));var moment=require(_0x5f0f('0x4'));var BPromise=require(_0x5f0f('0x5'));var Mustache=require('mustache');var util=require(_0x5f0f('0x6'));var path=require(_0x5f0f('0x7'));var sox=require(_0x5f0f('0x8'));var csv=require('to-csv');var ejs=require(_0x5f0f('0x9'));var fs=require('fs');var fs_extra=require(_0x5f0f('0xa'));var _=require(_0x5f0f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f0f('0xc'));var deskjs=require(_0x5f0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5f0f('0xe'));var Papa=require(_0x5f0f('0xf'));var Redis=require(_0x5f0f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f0f('0x11'));var hardwareService=require(_0x5f0f('0x12'));var logger=require(_0x5f0f('0x13'))(_0x5f0f('0x14'));var utils=require(_0x5f0f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f0f('0x16'))['db'];config[_0x5f0f('0x17')]=_[_0x5f0f('0x18')](config[_0x5f0f('0x17')],{'host':_0x5f0f('0x19'),'port':0x18eb});var socket=require(_0x5f0f('0x1a'))(new Redis(config[_0x5f0f('0x17')]));require(_0x5f0f('0x1b'))[_0x5f0f('0x1c')](socket);var jayson=require(_0x5f0f('0x1d'));var client=jayson['client'][_0x5f0f('0x1e')]({'port':0x232c});var client9002=jayson[_0x5f0f('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16df4e,_0x2c4cfa,_0x1c43a3,_0x19b57b){return new BPromise(function(_0x5104c1,_0x43ddc0){var _0x427a3f=_0x19b57b||client;return _0x427a3f[_0x5f0f('0x20')](_0x16df4e,_0x1c43a3)[_0x5f0f('0x21')](function(_0x10342c){logger[_0x5f0f('0x22')](_0x5f0f('0x23'),_0x2c4cfa,_0x5f0f('0x24'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2c4cfa,'request\x20sent',JSON[_0x5f0f('0x25')](_0x10342c));if(_0x10342c['error']){if(_0x10342c['error'][_0x5f0f('0x26')]===0x1f4){logger['error'](_0x5f0f('0x23'),_0x2c4cfa,_0x10342c[_0x5f0f('0x27')][_0x5f0f('0x28')]);return _0x43ddc0(_0x10342c[_0x5f0f('0x27')]['message']);}logger[_0x5f0f('0x27')](_0x5f0f('0x23'),_0x2c4cfa,_0x10342c[_0x5f0f('0x27')]['message']);return _0x5104c1(_0x10342c[_0x5f0f('0x27')]['message']);}else{logger[_0x5f0f('0x22')](_0x5f0f('0x23'),_0x2c4cfa,_0x5f0f('0x24'));_0x5104c1(_0x10342c[_0x5f0f('0x29')][_0x5f0f('0x28')]);}})[_0x5f0f('0x2a')](function(_0x31f8f8){logger[_0x5f0f('0x27')](_0x5f0f('0x23'),_0x2c4cfa,_0x31f8f8);_0x43ddc0(_0x31f8f8);});});}function respondWithStatusCode(_0x2b1fdf,_0x5289f3){_0x5289f3=_0x5289f3||0xcc;return function(_0x12a9d4){if(_0x12a9d4){return _0x2b1fdf[_0x5f0f('0x2b')](_0x5289f3);}return _0x2b1fdf[_0x5f0f('0x2c')](_0x5289f3)['end']();};}function respondWithResult(_0x32fbf0,_0x4477f8){_0x4477f8=_0x4477f8||0xc8;return function(_0x1dd95e){if(_0x1dd95e){return _0x32fbf0[_0x5f0f('0x2c')](_0x4477f8)[_0x5f0f('0x2d')](_0x1dd95e);}};}function respondWithFilteredResult(_0x1d8fae,_0x5b6f2e){return function(_0x30abb0){if(_0x30abb0){var _0xc783d0=typeof _0x5b6f2e[_0x5f0f('0x2e')]===_0x5f0f('0x2f')&&typeof _0x5b6f2e['limit']==='undefined';var _0x26971c=_0x30abb0[_0x5f0f('0x30')];var _0x55b458=_0xc783d0?0x0:_0x5b6f2e['offset'];var _0x27dcde=_0xc783d0?_0x30abb0['count']:_0x5b6f2e[_0x5f0f('0x2e')]+_0x5b6f2e[_0x5f0f('0x31')];var _0x1063d1;if(_0x27dcde>=_0x26971c){_0x27dcde=_0x26971c;_0x1063d1=0xc8;}else{_0x1063d1=0xce;}_0x1d8fae[_0x5f0f('0x2c')](_0x1063d1);return _0x1d8fae[_0x5f0f('0x32')](_0x5f0f('0x33'),_0x55b458+'-'+_0x27dcde+'/'+_0x26971c)[_0x5f0f('0x2d')](_0x30abb0);}return null;};}function patchUpdates(_0x5d253){return function(_0x3d0a2b){try{jsonpatch[_0x5f0f('0x34')](_0x3d0a2b,_0x5d253,!![]);}catch(_0x152f9c){return BPromise[_0x5f0f('0x35')](_0x152f9c);}return _0x3d0a2b[_0x5f0f('0x36')]();};}function saveUpdates(_0x188ee0,_0x3345b6){return function(_0x4a5591){if(_0x4a5591){return _0x4a5591[_0x5f0f('0x37')](_0x188ee0)[_0x5f0f('0x21')](function(_0x1a81be){return _0x1a81be;});}return null;};}function removeEntity(_0x34cb32,_0x53956b){return function(_0x42fed6){if(_0x42fed6){return _0x42fed6[_0x5f0f('0x38')]()[_0x5f0f('0x21')](function(){_0x34cb32[_0x5f0f('0x2c')](0xcc)[_0x5f0f('0x39')]();});}};}function handleEntityNotFound(_0xf30980,_0x14a54f){return function(_0x5ad981){if(!_0x5ad981){_0xf30980[_0x5f0f('0x2b')](0x194);}return _0x5ad981;};}function handleError(_0x253497,_0x5867a5){_0x5867a5=_0x5867a5||0x1f4;return function(_0x556c54){logger['error'](_0x556c54[_0x5f0f('0x3a')]);if(_0x556c54[_0x5f0f('0x3b')]){delete _0x556c54[_0x5f0f('0x3b')];}_0x253497[_0x5f0f('0x2c')](_0x5867a5)[_0x5f0f('0x3c')](_0x556c54);};}exports[_0x5f0f('0x3d')]=function(_0x1bd014,_0x4ce0c8){var _0x4234ad={},_0x1b81c9={},_0x39aaa6={'count':0x0,'rows':[]};var _0x53e30c=_['map'](db[_0x5f0f('0x3e')][_0x5f0f('0x3f')],function(_0x5c7b4c){return{'name':_0x5c7b4c['fieldName'],'type':_0x5c7b4c[_0x5f0f('0x40')]['key']};});_0x1b81c9[_0x5f0f('0x41')]=_[_0x5f0f('0x42')](_0x53e30c,_0x5f0f('0x3b'));_0x1b81c9[_0x5f0f('0x43')]=_[_0x5f0f('0x44')](_0x1bd014[_0x5f0f('0x43')]);_0x1b81c9[_0x5f0f('0x45')]=_['intersection'](_0x1b81c9[_0x5f0f('0x41')],_0x1b81c9[_0x5f0f('0x43')]);_0x4234ad[_0x5f0f('0x46')]=_['intersection'](_0x1b81c9[_0x5f0f('0x41')],qs[_0x5f0f('0x47')](_0x1bd014['query'][_0x5f0f('0x47')]));_0x4234ad[_0x5f0f('0x46')]=_0x4234ad[_0x5f0f('0x46')][_0x5f0f('0x48')]?_0x4234ad['attributes']:_0x1b81c9['model'];if(!_0x1bd014[_0x5f0f('0x43')][_0x5f0f('0x49')](_0x5f0f('0x4a'))){_0x4234ad[_0x5f0f('0x31')]=qs[_0x5f0f('0x31')](_0x1bd014['query'][_0x5f0f('0x31')]);_0x4234ad[_0x5f0f('0x2e')]=qs['offset'](_0x1bd014[_0x5f0f('0x43')][_0x5f0f('0x2e')]);}_0x4234ad[_0x5f0f('0x4b')]=qs['sort'](_0x1bd014[_0x5f0f('0x43')]['sort']);_0x4234ad[_0x5f0f('0x4c')]=qs[_0x5f0f('0x45')](_[_0x5f0f('0x4d')](_0x1bd014[_0x5f0f('0x43')],_0x1b81c9[_0x5f0f('0x45')]),_0x53e30c);if(_0x1bd014['query'][_0x5f0f('0x4e')]){_0x4234ad['where']=_[_0x5f0f('0x4f')](_0x4234ad[_0x5f0f('0x4c')],{'$or':_[_0x5f0f('0x42')](_0x53e30c,function(_0x4d47b8){if(_0x4d47b8[_0x5f0f('0x40')]!==_0x5f0f('0x50')){var _0xf94ba9={};_0xf94ba9[_0x4d47b8['name']]={'$like':'%'+_0x1bd014[_0x5f0f('0x43')][_0x5f0f('0x4e')]+'%'};return _0xf94ba9;}})});}_0x4234ad=_[_0x5f0f('0x4f')]({},_0x4234ad,_0x1bd014[_0x5f0f('0x51')]);var _0xb0852={'where':_0x4234ad[_0x5f0f('0x4c')]};return db[_0x5f0f('0x3e')][_0x5f0f('0x30')](_0xb0852)['then'](function(_0x47c7da){_0x39aaa6[_0x5f0f('0x30')]=_0x47c7da;if(_0x1bd014[_0x5f0f('0x43')][_0x5f0f('0x52')]){_0x4234ad[_0x5f0f('0x53')]=[{'all':!![]}];}return db[_0x5f0f('0x3e')]['findAll'](_0x4234ad);})[_0x5f0f('0x21')](function(_0x271496){_0x39aaa6[_0x5f0f('0x54')]=_0x271496;return _0x39aaa6;})['then'](respondWithFilteredResult(_0x4ce0c8,_0x4234ad))['catch'](handleError(_0x4ce0c8,null));};exports[_0x5f0f('0x55')]=function(_0x53c43b,_0x68b52f){var _0x2a4d9e={'raw':!![],'where':{'id':_0x53c43b[_0x5f0f('0x56')]['id']}},_0x1ab3c7={};_0x1ab3c7[_0x5f0f('0x41')]=_[_0x5f0f('0x44')](db[_0x5f0f('0x3e')]['rawAttributes']);_0x1ab3c7[_0x5f0f('0x43')]=_['keys'](_0x53c43b[_0x5f0f('0x43')]);_0x1ab3c7[_0x5f0f('0x45')]=_[_0x5f0f('0x57')](_0x1ab3c7[_0x5f0f('0x41')],_0x1ab3c7[_0x5f0f('0x43')]);_0x2a4d9e['attributes']=_[_0x5f0f('0x57')](_0x1ab3c7[_0x5f0f('0x41')],qs[_0x5f0f('0x47')](_0x53c43b['query'][_0x5f0f('0x47')]));_0x2a4d9e[_0x5f0f('0x46')]=_0x2a4d9e[_0x5f0f('0x46')][_0x5f0f('0x48')]?_0x2a4d9e[_0x5f0f('0x46')]:_0x1ab3c7['model'];if(_0x53c43b['query'][_0x5f0f('0x52')]){_0x2a4d9e[_0x5f0f('0x53')]=[{'all':!![]}];}_0x2a4d9e=_[_0x5f0f('0x4f')]({},_0x2a4d9e,_0x53c43b['options']);return db[_0x5f0f('0x3e')][_0x5f0f('0x58')](_0x2a4d9e)[_0x5f0f('0x21')](handleEntityNotFound(_0x68b52f,null))[_0x5f0f('0x21')](respondWithResult(_0x68b52f,null))[_0x5f0f('0x2a')](handleError(_0x68b52f,null));};exports[_0x5f0f('0x59')]=function(_0x380826,_0x4d4999){return db[_0x5f0f('0x3e')][_0x5f0f('0x59')](_0x380826['body'],{})[_0x5f0f('0x21')](respondWithResult(_0x4d4999,0xc9))[_0x5f0f('0x2a')](handleError(_0x4d4999,null));};exports[_0x5f0f('0x37')]=function(_0x1f41bb,_0x377c01){if(_0x1f41bb[_0x5f0f('0x5a')]['id']){delete _0x1f41bb[_0x5f0f('0x5a')]['id'];}return db[_0x5f0f('0x3e')]['find']({'where':{'id':_0x1f41bb[_0x5f0f('0x56')]['id']}})['then'](handleEntityNotFound(_0x377c01,null))['then'](saveUpdates(_0x1f41bb[_0x5f0f('0x5a')],null))[_0x5f0f('0x21')](respondWithResult(_0x377c01,null))['catch'](handleError(_0x377c01,null));};exports['destroy']=function(_0x52a703,_0x6f5fe1){return db[_0x5f0f('0x3e')][_0x5f0f('0x58')]({'where':{'id':_0x52a703[_0x5f0f('0x56')]['id']}})[_0x5f0f('0x21')](handleEntityNotFound(_0x6f5fe1,null))[_0x5f0f('0x21')](removeEntity(_0x6f5fe1,null))[_0x5f0f('0x2a')](handleError(_0x6f5fe1,null));};exports[_0x5f0f('0x5b')]=function(_0x4585ce,_0x5eff98){return db[_0x5f0f('0x3e')]['describe']()[_0x5f0f('0x21')](respondWithResult(_0x5eff98,null))[_0x5f0f('0x2a')](handleError(_0x5eff98,null));};var interaction_log=require(_0x5f0f('0x13'))(_0x5f0f('0x5c'));exports[_0x5f0f('0x5d')]=function(_0x1cec6d,_0x5da4c5,_0x210230){var _0x1926fc={'agent':{},'channel':'openchannel'};if(_0x1cec6d['body']['id']){delete _0x1cec6d[_0x5f0f('0x5a')]['id'];}_0x1cec6d[_0x5f0f('0x5a')][_0x5f0f('0x5e')]=!![];_0x1cec6d['body'][_0x5f0f('0x5f')]=moment()[_0x5f0f('0x60')](_0x5f0f('0x61'));_0x1cec6d[_0x5f0f('0x5a')]['UserId']=_0x1cec6d[_0x5f0f('0x5a')][_0x5f0f('0x62')]||_0x1cec6d[_0x5f0f('0x63')]['id'];_0x1926fc[_0x5f0f('0x64')]['id']=_0x1cec6d['body'][_0x5f0f('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x1cec6d['params']['id'],'UserId':null}})[_0x5f0f('0x21')](handleEntityNotFound(_0x5da4c5,null))['then'](saveUpdates(_0x1cec6d['body'],null))['then'](function(_0x352f1f){if(_0x352f1f){_0x1926fc[_0x5f0f('0x28')]=_0x352f1f['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x5f0f('0x58')]({'where':{'id':_0x352f1f[_0x5f0f('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5da4c5,null))['then'](function(_0x195a63){if(_0x195a63){return _0x195a63[_0x5f0f('0x37')]({'UserId':_0x1cec6d[_0x5f0f('0x5a')][_0x5f0f('0x62')],'read1stAt':_[_0x5f0f('0x66')](_0x195a63[_0x5f0f('0x67')])?moment()[_0x5f0f('0x60')](_0x5f0f('0x61')):undefined});}return null;})[_0x5f0f('0x21')](function(_0x4c0433){if(_0x4c0433){_0x1926fc['interaction']=_0x4c0433[_0x5f0f('0x68')]({'plain':!![]});interaction_log[_0x5f0f('0x22')](_0x5f0f('0x69'),_0x1cec6d[_0x5f0f('0x63')]['id'],_0x1cec6d[_0x5f0f('0x63')][_0x5f0f('0x3b')],_0x1cec6d['user'][_0x5f0f('0x6a')],_0x1926fc['interaction']['id'],_0x1cec6d[_0x5f0f('0x5a')]?JSON[_0x5f0f('0x25')](_0x1cec6d[_0x5f0f('0x5a')]):_0x5f0f('0x6b'));return respondWithRpcPromise(_0x5f0f('0x6c'),_0x5f0f('0x6d'),_0x1926fc);}return null;})['then'](function(_0x468a75){var _0x5cba2a=_0x5f0f('0x6e')+_0x468a75[_0x5f0f('0x28')]['ContactId'];return db[_0x5f0f('0x6f')][_0x5f0f('0x43')](_0x5cba2a,{'type':db[_0x5f0f('0x70')][_0x5f0f('0x71')]['SELECT'],'raw':!![]})[_0x5f0f('0x21')](function(_0x580289){return _0x580289;});})[_0x5f0f('0x21')](function(_0x53add0){if(_0x53add0){_0x1926fc[_0x5f0f('0x28')][_0x5f0f('0x72')]=_0x53add0[0x0];if(!_0x1cec6d['body'][_0x5f0f('0x62')])return;return db[_0x5f0f('0x73')][_0x5f0f('0x58')]({'where':{'id':_0x1cec6d[_0x5f0f('0x5a')][_0x5f0f('0x62')],'role':_0x5f0f('0x64')},'attributes':['id','name',_0x5f0f('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x5f0f('0x21')](function(_0x4343d9){if(!_0x4343d9)return null;_0x1926fc[_0x5f0f('0x28')][_0x5f0f('0x64')]=_0x4343d9;return _0x1926fc;})[_0x5f0f('0x21')](function(_0x4f7a93){if(_0x4f7a93){if(_0x1cec6d[_0x5f0f('0x5a')]['manual']){_0x1926fc['message'][_0x5f0f('0x75')]=util['format'](_0x5f0f('0x76'),_0x1cec6d[_0x5f0f('0x63')][_0x5f0f('0x3b')]);_0x1926fc['message'][_0x5f0f('0x77')]=_0x1926fc[_0x5f0f('0x77')];_0x1926fc[_0x5f0f('0x28')][_0x5f0f('0x78')]=_0x1926fc[_0x5f0f('0x77')];_0x1926fc[_0x5f0f('0x28')]['event']=_0x5f0f('0x5d');return respondWithRpcPromise(_0x5f0f('0x79'),_0x5f0f('0x79'),{'event':'acceptmessage','message':_0x1926fc[_0x5f0f('0x28')]},client9002)[_0x5f0f('0x21')](function(){return _0x1926fc;});}return _0x1926fc;}return null;})['then'](respondWithResult(_0x5da4c5,null))[_0x5f0f('0x2a')](handleError(_0x5da4c5,null));};var interaction_log=require(_0x5f0f('0x13'))('openchannel-interactions');exports[_0x5f0f('0x35')]=function(_0x5efb0e,_0x2f035b,_0x336712){var _0x45b103={'agent':{},'channel':'openchannel'};if(_0x5efb0e[_0x5f0f('0x5a')]['id']){delete _0x5efb0e[_0x5f0f('0x5a')]['id'];}_0x5efb0e['body']['UserId']=_0x5efb0e[_0x5f0f('0x5a')][_0x5f0f('0x62')]||_0x5efb0e['user']['id'];_0x45b103[_0x5f0f('0x64')]['id']=_0x5efb0e['body'][_0x5f0f('0x62')];return db[_0x5f0f('0x3e')][_0x5f0f('0x58')]({'where':{'id':_0x5efb0e[_0x5f0f('0x56')]['id'],'UserId':null}})[_0x5f0f('0x21')](handleEntityNotFound(_0x2f035b,null))['then'](function(_0x2443f2){if(_0x2443f2){_0x45b103[_0x5f0f('0x28')]=_0x2443f2[_0x5f0f('0x68')]({'plain':!![]});return db[_0x5f0f('0x7a')][_0x5f0f('0x58')]({'where':{'id':_0x2443f2[_0x5f0f('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2f035b,null))[_0x5f0f('0x21')](function(_0x2df5ad){if(_0x2df5ad){_0x45b103[_0x5f0f('0x7b')]=_0x2df5ad[_0x5f0f('0x68')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5efb0e['user']['id'],_0x5efb0e[_0x5f0f('0x63')][_0x5f0f('0x3b')],_0x5efb0e[_0x5f0f('0x63')][_0x5f0f('0x6a')],_0x45b103['interaction']['id'],_0x5efb0e[_0x5f0f('0x5a')]?JSON[_0x5f0f('0x25')](_0x5efb0e[_0x5f0f('0x5a')]):_0x5f0f('0x6b'));return respondWithRpcPromise(_0x5f0f('0x7c'),_0x5f0f('0x7d'),_0x45b103);}return null;})[_0x5f0f('0x21')](function(_0x1c51b0){var _0x39f4a8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c51b0[_0x5f0f('0x28')][_0x5f0f('0x7e')];return db['sequelize'][_0x5f0f('0x43')](_0x39f4a8,{'type':db[_0x5f0f('0x70')]['QueryTypes'][_0x5f0f('0x7f')],'raw':!![]})[_0x5f0f('0x21')](function(_0x4e164a){return _0x4e164a;});})[_0x5f0f('0x21')](function(_0xb13a17){if(_0xb13a17){_0x45b103[_0x5f0f('0x28')][_0x5f0f('0x72')]=_0xb13a17[0x0];if(!_0x5efb0e[_0x5f0f('0x5a')]['UserId'])return;return db['User'][_0x5f0f('0x58')]({'where':{'id':_0x5efb0e['body'][_0x5f0f('0x62')],'role':_0x5f0f('0x64')},'attributes':['id',_0x5f0f('0x3b'),_0x5f0f('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x5f0f('0x21')](function(_0x418525){if(!_0x418525)return null;_0x45b103[_0x5f0f('0x28')][_0x5f0f('0x64')]=_0x418525;return _0x45b103;})[_0x5f0f('0x21')](function(_0x33a5e0){if(_0x33a5e0){_0x33a5e0[_0x5f0f('0x28')][_0x5f0f('0x75')]=util['format'](_0x5f0f('0x76'),_0x5efb0e[_0x5f0f('0x63')]['name']);_0x33a5e0[_0x5f0f('0x28')]['channel']=_0x45b103[_0x5f0f('0x77')];_0x33a5e0[_0x5f0f('0x28')][_0x5f0f('0x78')]=_0x45b103[_0x5f0f('0x77')];_0x33a5e0[_0x5f0f('0x28')][_0x5f0f('0x80')]='reject';respondWithRpcPromise(_0x5f0f('0x79'),'EventManager',{'event':_0x5f0f('0x81'),'message':_0x33a5e0[_0x5f0f('0x28')]},client9002);return _0x45b103;}return null;})[_0x5f0f('0x21')](respondWithResult(_0x2f035b,null))[_0x5f0f('0x2a')](handleError(_0x2f035b,null));}; \ No newline at end of file +var _0x3249=['sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','create','body','update','find','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','Sequelize','event','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3249,0xdb));var _0x9324=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x3249[_0x4ae829];return _0x256b31;};'use strict';var emlformat=require(_0x9324('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9324('0x1'));var jsonpatch=require(_0x9324('0x2'));var rp=require(_0x9324('0x3'));var moment=require(_0x9324('0x4'));var BPromise=require(_0x9324('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9324('0x6'));var sox=require(_0x9324('0x7'));var csv=require('to-csv');var ejs=require(_0x9324('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9324('0x9'));var squel=require('squel');var crypto=require(_0x9324('0xa'));var jsforce=require(_0x9324('0xb'));var deskjs=require(_0x9324('0xc'));var toCsv=require(_0x9324('0xd'));var querystring=require(_0x9324('0xe'));var Papa=require(_0x9324('0xf'));var Redis=require(_0x9324('0x10'));var authService=require(_0x9324('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9324('0x12'));var hardwareService=require(_0x9324('0x13'));var logger=require(_0x9324('0x14'))(_0x9324('0x15'));var utils=require('../../config/utils');var config=require(_0x9324('0x16'));var licenseUtil=require(_0x9324('0x17'));var db=require(_0x9324('0x18'))['db'];config[_0x9324('0x19')]=_[_0x9324('0x1a')](config[_0x9324('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9324('0x19')]));require('./openchannelMessage.socket')[_0x9324('0x1b')](socket);var jayson=require(_0x9324('0x1c'));var client=jayson[_0x9324('0x1d')][_0x9324('0x1e')]({'port':0x232c});var client9002=jayson[_0x9324('0x1d')][_0x9324('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xf3ae6a,_0x10bb6d,_0x3d033e,_0x3981ba){return new BPromise(function(_0x1cf337,_0x50de11){var _0x14ab1e=_0x3981ba||client;return _0x14ab1e[_0x9324('0x1f')](_0xf3ae6a,_0x3d033e)[_0x9324('0x20')](function(_0x3bb180){logger['info'](_0x9324('0x21'),_0x10bb6d,'request\x20sent');logger[_0x9324('0x22')](_0x9324('0x23'),_0x10bb6d,_0x9324('0x24'),JSON[_0x9324('0x25')](_0x3bb180));if(_0x3bb180[_0x9324('0x26')]){if(_0x3bb180[_0x9324('0x26')]['code']===0x1f4){logger[_0x9324('0x26')](_0x9324('0x21'),_0x10bb6d,_0x3bb180['error'][_0x9324('0x27')]);return _0x50de11(_0x3bb180['error'][_0x9324('0x27')]);}logger[_0x9324('0x26')](_0x9324('0x21'),_0x10bb6d,_0x3bb180[_0x9324('0x26')]['message']);return _0x1cf337(_0x3bb180[_0x9324('0x26')][_0x9324('0x27')]);}else{logger[_0x9324('0x28')](_0x9324('0x21'),_0x10bb6d,_0x9324('0x24'));_0x1cf337(_0x3bb180[_0x9324('0x29')][_0x9324('0x27')]);}})[_0x9324('0x2a')](function(_0x12ad2d){logger[_0x9324('0x26')](_0x9324('0x21'),_0x10bb6d,_0x12ad2d);_0x50de11(_0x12ad2d);});});}function respondWithStatusCode(_0x3076e8,_0xdd3698){_0xdd3698=_0xdd3698||0xcc;return function(_0xc1c11c){if(_0xc1c11c){return _0x3076e8[_0x9324('0x2b')](_0xdd3698);}return _0x3076e8[_0x9324('0x2c')](_0xdd3698)[_0x9324('0x2d')]();};}function respondWithResult(_0x4d88f0,_0x299fe4){_0x299fe4=_0x299fe4||0xc8;return function(_0x514093){if(_0x514093){return _0x4d88f0[_0x9324('0x2c')](_0x299fe4)[_0x9324('0x2e')](_0x514093);}};}function respondWithFilteredResult(_0x32d55e,_0x574cd7){return function(_0x4c0933){if(_0x4c0933){var _0x58cb0f=typeof _0x574cd7[_0x9324('0x2f')]==='undefined'&&typeof _0x574cd7[_0x9324('0x30')]===_0x9324('0x31');var _0x1a1128=_0x4c0933[_0x9324('0x32')];var _0x827abe=_0x58cb0f?0x0:_0x574cd7[_0x9324('0x2f')];var _0x1d7f8e=_0x58cb0f?_0x4c0933[_0x9324('0x32')]:_0x574cd7[_0x9324('0x2f')]+_0x574cd7[_0x9324('0x30')];var _0x36cc0d;if(_0x1d7f8e>=_0x1a1128){_0x1d7f8e=_0x1a1128;_0x36cc0d=0xc8;}else{_0x36cc0d=0xce;}_0x32d55e[_0x9324('0x2c')](_0x36cc0d);return _0x32d55e[_0x9324('0x33')]('Content-Range',_0x827abe+'-'+_0x1d7f8e+'/'+_0x1a1128)[_0x9324('0x2e')](_0x4c0933);}return null;};}function patchUpdates(_0x35ceca){return function(_0x4d6bd1){try{jsonpatch[_0x9324('0x34')](_0x4d6bd1,_0x35ceca,!![]);}catch(_0x2b07a8){return BPromise[_0x9324('0x35')](_0x2b07a8);}return _0x4d6bd1[_0x9324('0x36')]();};}function saveUpdates(_0x2ea13f,_0x59be2f){return function(_0x55142b){if(_0x55142b){return _0x55142b['update'](_0x2ea13f)[_0x9324('0x20')](function(_0x3018d5){return _0x3018d5;});}return null;};}function removeEntity(_0x5184b8,_0x1fc79c){return function(_0x5da827){if(_0x5da827){return _0x5da827[_0x9324('0x37')]()['then'](function(){_0x5184b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x525e38,_0x1a0fd4){return function(_0xc50ee5){if(!_0xc50ee5){_0x525e38['sendStatus'](0x194);}return _0xc50ee5;};}function handleError(_0x19cd28,_0x59a159){_0x59a159=_0x59a159||0x1f4;return function(_0x1106b6){logger['error'](_0x1106b6[_0x9324('0x38')]);if(_0x1106b6['name']){delete _0x1106b6[_0x9324('0x39')];}_0x19cd28[_0x9324('0x2c')](_0x59a159)[_0x9324('0x3a')](_0x1106b6);};}exports[_0x9324('0x3b')]=function(_0x1bfae8,_0x2e097b){var _0x3eb215={},_0x19b5dc={},_0x485013={'count':0x0,'rows':[]};var _0x5b2966=_['map'](db[_0x9324('0x3c')][_0x9324('0x3d')],function(_0x51aa62){return{'name':_0x51aa62['fieldName'],'type':_0x51aa62[_0x9324('0x3e')][_0x9324('0x3f')]};});_0x19b5dc['model']=_[_0x9324('0x40')](_0x5b2966,'name');_0x19b5dc[_0x9324('0x41')]=_['keys'](_0x1bfae8['query']);_0x19b5dc[_0x9324('0x42')]=_[_0x9324('0x43')](_0x19b5dc[_0x9324('0x44')],_0x19b5dc[_0x9324('0x41')]);_0x3eb215[_0x9324('0x45')]=_[_0x9324('0x43')](_0x19b5dc[_0x9324('0x44')],qs[_0x9324('0x46')](_0x1bfae8['query'][_0x9324('0x46')]));_0x3eb215['attributes']=_0x3eb215['attributes'][_0x9324('0x47')]?_0x3eb215[_0x9324('0x45')]:_0x19b5dc[_0x9324('0x44')];if(!_0x1bfae8[_0x9324('0x41')]['hasOwnProperty']('nolimit')){_0x3eb215[_0x9324('0x30')]=qs['limit'](_0x1bfae8[_0x9324('0x41')][_0x9324('0x30')]);_0x3eb215[_0x9324('0x2f')]=qs[_0x9324('0x2f')](_0x1bfae8['query']['offset']);}_0x3eb215[_0x9324('0x48')]=qs[_0x9324('0x49')](_0x1bfae8['query'][_0x9324('0x49')]);_0x3eb215[_0x9324('0x4a')]=qs[_0x9324('0x42')](_['pick'](_0x1bfae8['query'],_0x19b5dc[_0x9324('0x42')]),_0x5b2966);if(_0x1bfae8[_0x9324('0x41')][_0x9324('0x4b')]){_0x3eb215[_0x9324('0x4a')]=_[_0x9324('0x4c')](_0x3eb215[_0x9324('0x4a')],{'$or':_[_0x9324('0x40')](_0x5b2966,function(_0xbb6ed8){if(_0xbb6ed8['type']!==_0x9324('0x4d')){var _0x9c1d96={};_0x9c1d96[_0xbb6ed8['name']]={'$like':'%'+_0x1bfae8[_0x9324('0x41')]['filter']+'%'};return _0x9c1d96;}})});}_0x3eb215=_['merge']({},_0x3eb215,_0x1bfae8['options']);var _0x5c3344={'where':_0x3eb215[_0x9324('0x4a')]};return db[_0x9324('0x3c')]['count'](_0x5c3344)['then'](function(_0x4b47d1){_0x485013['count']=_0x4b47d1;if(_0x1bfae8[_0x9324('0x41')][_0x9324('0x4e')]){_0x3eb215[_0x9324('0x4f')]=[{'all':!![]}];}return db[_0x9324('0x3c')][_0x9324('0x50')](_0x3eb215);})[_0x9324('0x20')](function(_0x3730ee){_0x485013[_0x9324('0x51')]=_0x3730ee;return _0x485013;})[_0x9324('0x20')](respondWithFilteredResult(_0x2e097b,_0x3eb215))[_0x9324('0x2a')](handleError(_0x2e097b,null));};exports[_0x9324('0x52')]=function(_0x57259d,_0x4d7aa7){var _0x2b19db={'raw':!![],'where':{'id':_0x57259d[_0x9324('0x53')]['id']}},_0x4eea6a={};_0x4eea6a[_0x9324('0x44')]=_[_0x9324('0x54')](db['OpenchannelMessage'][_0x9324('0x3d')]);_0x4eea6a[_0x9324('0x41')]=_['keys'](_0x57259d[_0x9324('0x41')]);_0x4eea6a[_0x9324('0x42')]=_['intersection'](_0x4eea6a[_0x9324('0x44')],_0x4eea6a[_0x9324('0x41')]);_0x2b19db[_0x9324('0x45')]=_[_0x9324('0x43')](_0x4eea6a[_0x9324('0x44')],qs[_0x9324('0x46')](_0x57259d[_0x9324('0x41')][_0x9324('0x46')]));_0x2b19db[_0x9324('0x45')]=_0x2b19db[_0x9324('0x45')][_0x9324('0x47')]?_0x2b19db[_0x9324('0x45')]:_0x4eea6a[_0x9324('0x44')];if(_0x57259d['query'][_0x9324('0x4e')]){_0x2b19db[_0x9324('0x4f')]=[{'all':!![]}];}_0x2b19db=_[_0x9324('0x4c')]({},_0x2b19db,_0x57259d[_0x9324('0x55')]);return db[_0x9324('0x3c')]['find'](_0x2b19db)[_0x9324('0x20')](handleEntityNotFound(_0x4d7aa7,null))[_0x9324('0x20')](respondWithResult(_0x4d7aa7,null))[_0x9324('0x2a')](handleError(_0x4d7aa7,null));};exports[_0x9324('0x56')]=function(_0x37d577,_0x6cbad4){return db['OpenchannelMessage'][_0x9324('0x56')](_0x37d577[_0x9324('0x57')],{})[_0x9324('0x20')](respondWithResult(_0x6cbad4,0xc9))[_0x9324('0x2a')](handleError(_0x6cbad4,null));};exports[_0x9324('0x58')]=function(_0x3130e1,_0x440d54){if(_0x3130e1['body']['id']){delete _0x3130e1[_0x9324('0x57')]['id'];}return db[_0x9324('0x3c')][_0x9324('0x59')]({'where':{'id':_0x3130e1[_0x9324('0x53')]['id']}})[_0x9324('0x20')](handleEntityNotFound(_0x440d54,null))[_0x9324('0x20')](saveUpdates(_0x3130e1[_0x9324('0x57')],null))['then'](respondWithResult(_0x440d54,null))[_0x9324('0x2a')](handleError(_0x440d54,null));};exports['destroy']=function(_0x317523,_0x5ccab6){return db[_0x9324('0x3c')][_0x9324('0x59')]({'where':{'id':_0x317523[_0x9324('0x53')]['id']}})[_0x9324('0x20')](handleEntityNotFound(_0x5ccab6,null))[_0x9324('0x20')](removeEntity(_0x5ccab6,null))['catch'](handleError(_0x5ccab6,null));};exports[_0x9324('0x5a')]=function(_0x3a92be,_0x2cce38){return db[_0x9324('0x3c')][_0x9324('0x5a')]()[_0x9324('0x20')](respondWithResult(_0x2cce38,null))['catch'](handleError(_0x2cce38,null));};var interaction_log=require(_0x9324('0x14'))(_0x9324('0x5b'));exports['accept']=function(_0x3847fd,_0x42f2e7,_0x4ad780){var _0x357928={'agent':{},'channel':_0x9324('0x5c')};if(_0x3847fd[_0x9324('0x57')]['id']){delete _0x3847fd['body']['id'];}_0x3847fd[_0x9324('0x57')][_0x9324('0x5d')]=!![];_0x3847fd[_0x9324('0x57')][_0x9324('0x5e')]=moment()[_0x9324('0x5f')](_0x9324('0x60'));_0x3847fd[_0x9324('0x57')][_0x9324('0x61')]=_0x3847fd[_0x9324('0x57')][_0x9324('0x61')]||_0x3847fd[_0x9324('0x62')]['id'];_0x357928['agent']['id']=_0x3847fd[_0x9324('0x57')][_0x9324('0x61')];return db[_0x9324('0x3c')][_0x9324('0x59')]({'where':{'id':_0x3847fd[_0x9324('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42f2e7,null))[_0x9324('0x20')](saveUpdates(_0x3847fd[_0x9324('0x57')],null))[_0x9324('0x20')](function(_0x26dbb2){if(_0x26dbb2){_0x357928[_0x9324('0x27')]=_0x26dbb2[_0x9324('0x63')]({'plain':!![]});return db[_0x9324('0x64')][_0x9324('0x59')]({'where':{'id':_0x26dbb2['OpenchannelInteractionId']}});}return null;})[_0x9324('0x20')](handleEntityNotFound(_0x42f2e7,null))['then'](function(_0x53c9d1){if(_0x53c9d1){return _0x53c9d1[_0x9324('0x58')]({'UserId':_0x3847fd[_0x9324('0x57')]['UserId'],'read1stAt':_[_0x9324('0x65')](_0x53c9d1[_0x9324('0x66')])?moment()[_0x9324('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9324('0x20')](function(_0x35d9a0){if(_0x35d9a0){_0x357928['interaction']=_0x35d9a0[_0x9324('0x63')]({'plain':!![]});interaction_log[_0x9324('0x28')](_0x9324('0x67'),_0x3847fd[_0x9324('0x62')]['id'],_0x3847fd['user']['name'],_0x3847fd[_0x9324('0x62')]['role'],_0x357928['interaction']['id'],_0x3847fd[_0x9324('0x57')]?JSON[_0x9324('0x25')](_0x3847fd[_0x9324('0x57')]):'null');return respondWithRpcPromise(_0x9324('0x68'),_0x9324('0x69'),_0x357928);}return null;})[_0x9324('0x20')](function(_0x50f259){var _0x47a84a=_0x9324('0x6a')+_0x50f259['message'][_0x9324('0x6b')];return db['sequelize'][_0x9324('0x41')](_0x47a84a,{'type':db['Sequelize'][_0x9324('0x6c')][_0x9324('0x6d')],'raw':!![]})['then'](function(_0x1f8cc5){return _0x1f8cc5;});})[_0x9324('0x20')](function(_0x2aa94e){if(_0x2aa94e){_0x357928[_0x9324('0x27')][_0x9324('0x6e')]=_0x2aa94e[0x0];if(!_0x3847fd['body'][_0x9324('0x61')])return;return db['User'][_0x9324('0x59')]({'where':{'id':_0x3847fd[_0x9324('0x57')][_0x9324('0x61')],'role':_0x9324('0x6f')},'attributes':['id',_0x9324('0x39'),_0x9324('0x70'),_0x9324('0x71'),_0x9324('0x72')],'raw':!![]});}return null;})[_0x9324('0x20')](function(_0x4373cf){if(!_0x4373cf)return null;_0x357928['message']['agent']=_0x4373cf;return _0x357928;})[_0x9324('0x20')](function(_0x50986a){if(_0x50986a){if(_0x3847fd[_0x9324('0x57')][_0x9324('0x73')]){_0x357928[_0x9324('0x27')][_0x9324('0x74')]=util[_0x9324('0x5f')](_0x9324('0x75'),_0x3847fd[_0x9324('0x62')][_0x9324('0x39')]);_0x357928[_0x9324('0x27')]['channel']=_0x357928[_0x9324('0x76')];_0x357928['message'][_0x9324('0x77')]=_0x357928['channel'];_0x357928[_0x9324('0x27')]['event']=_0x9324('0x78');return respondWithRpcPromise(_0x9324('0x79'),_0x9324('0x79'),{'event':_0x9324('0x7a'),'message':_0x357928[_0x9324('0x27')]},client9002)[_0x9324('0x20')](function(){return _0x357928;});}return _0x357928;}return null;})[_0x9324('0x20')](respondWithResult(_0x42f2e7,null))['catch'](handleError(_0x42f2e7,null));};var interaction_log=require(_0x9324('0x14'))(_0x9324('0x5b'));exports[_0x9324('0x35')]=function(_0x2534c7,_0x147145,_0x307cd){var _0x24c97c={'agent':{},'channel':_0x9324('0x5c')};if(_0x2534c7[_0x9324('0x57')]['id']){delete _0x2534c7[_0x9324('0x57')]['id'];}_0x2534c7[_0x9324('0x57')][_0x9324('0x61')]=_0x2534c7['body'][_0x9324('0x61')]||_0x2534c7[_0x9324('0x62')]['id'];_0x24c97c['agent']['id']=_0x2534c7[_0x9324('0x57')][_0x9324('0x61')];return db[_0x9324('0x3c')][_0x9324('0x59')]({'where':{'id':_0x2534c7[_0x9324('0x53')]['id'],'UserId':null}})[_0x9324('0x20')](handleEntityNotFound(_0x147145,null))['then'](function(_0x3c5c02){if(_0x3c5c02){_0x24c97c['message']=_0x3c5c02[_0x9324('0x63')]({'plain':!![]});return db[_0x9324('0x64')][_0x9324('0x59')]({'where':{'id':_0x3c5c02[_0x9324('0x7b')]}});}return null;})[_0x9324('0x20')](handleEntityNotFound(_0x147145,null))[_0x9324('0x20')](function(_0xe2650){if(_0xe2650){_0x24c97c[_0x9324('0x7c')]=_0xe2650[_0x9324('0x63')]({'plain':!![]});interaction_log[_0x9324('0x28')](_0x9324('0x7d'),_0x2534c7[_0x9324('0x62')]['id'],_0x2534c7[_0x9324('0x62')][_0x9324('0x39')],_0x2534c7[_0x9324('0x62')][_0x9324('0x7e')],_0x24c97c['interaction']['id'],_0x2534c7['body']?JSON[_0x9324('0x25')](_0x2534c7[_0x9324('0x57')]):'null');return respondWithRpcPromise('RejectMessage',_0x9324('0x7f'),_0x24c97c);}return null;})[_0x9324('0x20')](function(_0x228291){var _0x265e5f=_0x9324('0x6a')+_0x228291[_0x9324('0x27')][_0x9324('0x6b')];return db['sequelize'][_0x9324('0x41')](_0x265e5f,{'type':db[_0x9324('0x80')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x22bac9){return _0x22bac9;});})[_0x9324('0x20')](function(_0x2480e5){if(_0x2480e5){_0x24c97c['message']['contact']=_0x2480e5[0x0];if(!_0x2534c7[_0x9324('0x57')][_0x9324('0x61')])return;return db['User'][_0x9324('0x59')]({'where':{'id':_0x2534c7[_0x9324('0x57')][_0x9324('0x61')],'role':_0x9324('0x6f')},'attributes':['id',_0x9324('0x39'),_0x9324('0x70'),'email','internal'],'raw':!![]});}return null;})[_0x9324('0x20')](function(_0x103fce){if(!_0x103fce)return null;_0x24c97c[_0x9324('0x27')][_0x9324('0x6f')]=_0x103fce;return _0x24c97c;})[_0x9324('0x20')](function(_0x4e43a2){if(_0x4e43a2){_0x4e43a2[_0x9324('0x27')][_0x9324('0x74')]=util[_0x9324('0x5f')](_0x9324('0x75'),_0x2534c7[_0x9324('0x62')][_0x9324('0x39')]);_0x4e43a2['message'][_0x9324('0x76')]=_0x24c97c['channel'];_0x4e43a2[_0x9324('0x27')]['motionChannel']=_0x24c97c[_0x9324('0x76')];_0x4e43a2[_0x9324('0x27')][_0x9324('0x81')]=_0x9324('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9324('0x82'),'message':_0x4e43a2[_0x9324('0x27')]},client9002);return _0x24c97c;}return null;})[_0x9324('0x20')](respondWithResult(_0x147145,null))[_0x9324('0x2a')](handleError(_0x147145,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 0908130..7d9a7a0 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 _0xeba7=['hook','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3582d7,_0x637758){var _0xeeeb3e=function(_0x53ff0f){while(--_0x53ff0f){_0x3582d7['push'](_0x3582d7['shift']());}};_0xeeeb3e(++_0x637758);}(_0xeba7,0x1c1));var _0x7eba=function(_0x1f5e0e,_0x223867){_0x1f5e0e=_0x1f5e0e-0x0;var _0x2f4518=_0xeba7[_0x1f5e0e];return _0x2f4518;};'use strict';var EventEmitter=require(_0x7eba('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7eba('0x1')](0x0);var events={'afterCreate':_0x7eba('0x2'),'afterUpdate':_0x7eba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5329e4){return function(_0x75b2d6,_0x1eed32,_0x33806a){OpenchannelMessageEvents['emit'](_0x5329e4+':'+_0x75b2d6['id'],_0x75b2d6);OpenchannelMessageEvents[_0x7eba('0x4')](_0x5329e4,_0x75b2d6);_0x33806a(null);};}for(var e in events){if(events[_0x7eba('0x5')](e)){var event=events[e];OpenchannelMessage[_0x7eba('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x0f7d=['OpenchannelMessage','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x54ed00,_0x253ac2){var _0x2f9a44=function(_0x38bfb4){while(--_0x38bfb4){_0x54ed00['push'](_0x54ed00['shift']());}};_0x2f9a44(++_0x253ac2);}(_0x0f7d,0x1b1));var _0xd0f7=function(_0x14634f,_0x5ed190){_0x14634f=_0x14634f-0x0;var _0x5021f9=_0x0f7d[_0x14634f];return _0x5021f9;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd0f7('0x0'))['db'][_0xd0f7('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd0f7('0x2'),'afterUpdate':'update','afterDestroy':_0xd0f7('0x3')};function emitEvent(_0x48158b){return function(_0x16823b,_0x3f38f6,_0x127895){OpenchannelMessageEvents[_0xd0f7('0x4')](_0x48158b+':'+_0x16823b['id'],_0x16823b);OpenchannelMessageEvents[_0xd0f7('0x4')](_0x48158b,_0x16823b);_0x127895(null);};}for(var e in events){if(events[_0xd0f7('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd0f7('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 37d0d2f..436d56d 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 _0x72ba=['OpenchannelMessage','fti_openchannel_messages','body','get','direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','secret','describe','then','find','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','method','GET','POST','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define'];(function(_0x16eb49,_0x591e1f){var _0x3fb01e=function(_0x413b70){while(--_0x413b70){_0x16eb49['push'](_0x16eb49['shift']());}};_0x3fb01e(++_0x591e1f);}(_0x72ba,0x152));var _0xa72b=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x72ba[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0xa72b('0x0'));var util=require(_0xa72b('0x1'));var logger=require(_0xa72b('0x2'))(_0xa72b('0x3'));var moment=require(_0xa72b('0x4'));var BPromise=require(_0xa72b('0x5'));var rp=require(_0xa72b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa72b('0x7'));var config=require(_0xa72b('0x8'));var attributes=require(_0xa72b('0x9'));module[_0xa72b('0xa')]=function(_0x22ead8,_0x20e270){return _0x22ead8[_0xa72b('0xb')](_0xa72b('0xc'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xa72b('0xd'),'fields':[_0xa72b('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fac09,_0x32f471,_0x130c2){var _0x271c6b=_0x22ead8['models'];var _0xfd0588=_0x2fac09[_0xa72b('0xf')]({'plain':!![]});if(_0xfd0588[_0xa72b('0x10')]['toLowerCase']()==='in'||_0xfd0588[_0xa72b('0x10')][_0xa72b('0x11')]()===_0xa72b('0x12')&&!_0xfd0588['secret']&&!_['isNil'](_0xfd0588[_0xa72b('0x13')])){_0x271c6b[_0xa72b('0x14')][_0xa72b('0x15')]({'where':{'id':_0xfd0588[_0xa72b('0x16')]}})['then'](function(_0x1564cd){if(_0x1564cd){_0x1564cd[_0xa72b('0x17')]({'lastMsgAt':_0xfd0588[_0xa72b('0x18')],'lastMsgDirection':_0xfd0588[_0xa72b('0x10')][_0xa72b('0x11')]()});}})['catch'](function(_0x43bed9){console[_0xa72b('0x19')](_0x43bed9);});}if(_0xfd0588['direction']==='out'&&!_0xfd0588[_0xa72b('0x1a')]){var _0x1a8296;_0x271c6b['CmContact'][_0xa72b('0x1b')]()[_0xa72b('0x1c')](function(_0x3e7a1b){return _0x271c6b['OpenchannelAccount'][_0xa72b('0x1d')]({'where':{'id':_0xfd0588['OpenchannelAccountId']},'include':[{'model':_0x271c6b[_0xa72b('0x14')],'as':_0xa72b('0x1e'),'where':{'id':_0xfd0588[_0xa72b('0x16')]},'limit':0x1,'include':[{'model':_0x271c6b['CmContact'],'as':'Contact','attributes':_[_0xa72b('0x1f')](_0x3e7a1b)}]}]});})[_0xa72b('0x1c')](function(_0x12d8e3){_0x1a8296=_0x12d8e3['get']({'plain':!![]});if(_0x1a8296&&_0x1a8296[_0xa72b('0x20')]){logger[_0xa72b('0x21')](_0xa72b('0x22'),_0xa72b('0x23'),util['format'](_0xa72b('0x24'),_0xfd0588['id'],_0x1a8296[_0xa72b('0x20')]));if(_0x1a8296[_0xa72b('0x1e')]&&_0x1a8296['Interactions'][_0xa72b('0x25')]){_0xfd0588[_0xa72b('0x26')]=_[_0xa72b('0x27')](_0x1a8296[_0xa72b('0x1e')][0x0],_0xa72b('0x28'));_0xfd0588[_0xa72b('0x28')]=_0x1a8296[_0xa72b('0x1e')][0x0][_0xa72b('0x28')];}var _0x32f471={'method':'POST','uri':encodeURI(_0x1a8296[_0xa72b('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32f471[_0xa72b('0x29')]){case _0xa72b('0x2a'):_0x32f471['qs']=_0xfd0588;break;case _0xa72b('0x2b'):_0x32f471[_0xa72b('0xe')]=_0xfd0588;break;}return rp(_0x32f471)[_0xa72b('0x1c')](function(_0x21fd3b){logger[_0xa72b('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xa72b('0x2c')](_0xa72b('0x2d'),_0xfd0588['id'],_0x1a8296[_0xa72b('0x20')]));if(_0x21fd3b['body'][_0xa72b('0x2e')]&&_0x21fd3b[_0xa72b('0xe')][_0xa72b('0x2e')]!=_0xfd0588[_0xa72b('0x26')][_0xa72b('0x2e')]){return _0x271c6b[_0xa72b('0x14')][_0xa72b('0x17')]({'threadId':_0x21fd3b[_0xa72b('0xe')][_0xa72b('0x2e')]},{'where':{'id':_0xfd0588[_0xa72b('0x26')]['id']}});}else{return;}})[_0xa72b('0x1c')](function(){return _0x2fac09['update']({'read':!![]});})[_0xa72b('0x2f')](function(_0x41c929){logger[_0xa72b('0x19')](_0xa72b('0x22'),_0xa72b('0x23'),util[_0xa72b('0x30')](_0x41c929,{'showHidden':![],'depth':null}));_0x130c2();});}else{_0x130c2();}})['finally'](function(){_0x130c2();});}else{_0x130c2();}}},'charset':_0xa72b('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x887e=['update','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction'];(function(_0x49052b,_0x1612f7){var _0x2f40cf=function(_0x3357a2){while(--_0x3357a2){_0x49052b['push'](_0x49052b['shift']());}};_0x2f40cf(++_0x1612f7);}(_0x887e,0xd0));var _0xe887=function(_0x1d1407,_0x50c9db){_0x1d1407=_0x1d1407-0x0;var _0x252466=_0x887e[_0x1d1407];return _0x252466;};'use strict';var _=require(_0xe887('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe887('0x1'));var moment=require(_0xe887('0x2'));var BPromise=require(_0xe887('0x3'));var rp=require(_0xe887('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe887('0x5'));var attributes=require(_0xe887('0x6'));module[_0xe887('0x7')]=function(_0x1942f2,_0x24c472){return _0x1942f2[_0xe887('0x8')](_0xe887('0x9'),attributes,{'tableName':_0xe887('0xa'),'paranoid':![],'indexes':[{'name':_0xe887('0xb'),'fields':[_0xe887('0xc')],'type':_0xe887('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17faf7,_0x29d44b,_0x2813ca){var _0x433485=_0x1942f2[_0xe887('0xe')];var _0x4ac4ce=_0x17faf7[_0xe887('0xf')]({'plain':!![]});if(_0x4ac4ce[_0xe887('0x10')][_0xe887('0x11')]()==='in'||_0x4ac4ce[_0xe887('0x10')][_0xe887('0x11')]()===_0xe887('0x12')&&!_0x4ac4ce[_0xe887('0x13')]&&!_[_0xe887('0x14')](_0x4ac4ce['UserId'])){_0x433485['OpenchannelInteraction']['findOne']({'where':{'id':_0x4ac4ce[_0xe887('0x15')]}})[_0xe887('0x16')](function(_0x2ef12c){if(_0x2ef12c){_0x2ef12c['update']({'lastMsgAt':_0x4ac4ce[_0xe887('0x17')],'lastMsgDirection':_0x4ac4ce[_0xe887('0x10')][_0xe887('0x11')]()});}})[_0xe887('0x18')](function(_0x36bf8d){console[_0xe887('0x19')](_0x36bf8d);});}if(_0x4ac4ce['direction']==='out'&&!_0x4ac4ce[_0xe887('0x13')]){var _0x51f071;_0x433485[_0xe887('0x1a')][_0xe887('0x1b')]()['then'](function(_0x4acced){return _0x433485[_0xe887('0x1c')][_0xe887('0x1d')]({'where':{'id':_0x4ac4ce[_0xe887('0x1e')]},'include':[{'model':_0x433485['OpenchannelInteraction'],'as':_0xe887('0x1f'),'where':{'id':_0x4ac4ce[_0xe887('0x15')]},'limit':0x1,'include':[{'model':_0x433485['CmContact'],'as':_0xe887('0x20'),'attributes':_[_0xe887('0x21')](_0x4acced)}]}]});})['then'](function(_0x4ba099){_0x51f071=_0x4ba099[_0xe887('0xf')]({'plain':!![]});if(_0x51f071&&_0x51f071[_0xe887('0x22')]){logger[_0xe887('0x23')](_0xe887('0x24'),'afterCreate',util[_0xe887('0x25')](_0xe887('0x26'),_0x4ac4ce['id'],_0x51f071[_0xe887('0x22')]));if(_0x51f071[_0xe887('0x1f')]&&_0x51f071[_0xe887('0x1f')][_0xe887('0x27')]){_0x4ac4ce[_0xe887('0x28')]=_[_0xe887('0x29')](_0x51f071[_0xe887('0x1f')][0x0],_0xe887('0x20'));_0x4ac4ce['Contact']=_0x51f071['Interactions'][0x0][_0xe887('0x20')];}var _0x29d44b={'method':_0xe887('0x2a'),'uri':encodeURI(_0x51f071['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x29d44b[_0xe887('0x2b')]){case'GET':_0x29d44b['qs']=_0x4ac4ce;break;case _0xe887('0x2a'):_0x29d44b['body']=_0x4ac4ce;break;}return rp(_0x29d44b)['then'](function(_0x5021bb){logger[_0xe887('0x23')](_0xe887('0x24'),'afterCreate',util[_0xe887('0x25')](_0xe887('0x2c'),_0x4ac4ce['id'],_0x51f071[_0xe887('0x22')]));if(_0x5021bb[_0xe887('0xc')][_0xe887('0x2d')]&&_0x5021bb[_0xe887('0xc')][_0xe887('0x2d')]!=_0x4ac4ce[_0xe887('0x28')]['threadId']){return _0x433485[_0xe887('0x2e')][_0xe887('0x2f')]({'threadId':_0x5021bb[_0xe887('0xc')][_0xe887('0x2d')]},{'where':{'id':_0x4ac4ce['Interaction']['id']}});}else{return;}})['then'](function(){return _0x17faf7[_0xe887('0x2f')]({'read':!![]});})[_0xe887('0x18')](function(_0x435ceb){logger[_0xe887('0x19')](_0xe887('0x24'),'afterCreate',util['inspect'](_0x435ceb,{'showHidden':![],'depth':null}));_0x2813ca();});}else{_0x2813ca();}})[_0xe887('0x30')](function(){_0x2813ca();});}else{_0x2813ca();}}},'charset':_0xe887('0x31'),'collate':_0xe887('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0de0ceb..078ec5e 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2e32ea,_0x3da99d){var _0x280817=function(_0x3b5b04){while(--_0x3b5b04){_0x2e32ea['push'](_0x2e32ea['shift']());}};_0x280817(++_0x3da99d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'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});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x2531d0,_0x19bf8a){var _0xfb941b=function(_0x1f3949){while(--_0x1f3949){_0x2531d0['push'](_0x2531d0['shift']());}};_0xfb941b(++_0x19bf8a);}(_0xadb5,0xad));var _0x5adb=function(_0x26df3b,_0x525d3e){_0x26df3b=_0x26df3b-0x0;var _0x22cf16=_0xadb5[_0x26df3b];return _0x22cf16;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 5e9b6d0..813ab27 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 _0x0c46=['remove','update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0xc98354,_0x3bf67b){var _0x424479=function(_0x2604c7){while(--_0x2604c7){_0xc98354['push'](_0xc98354['shift']());}};_0x424479(++_0x3bf67b);}(_0x0c46,0xe6));var _0x60c4=function(_0x4c23b6,_0x1aa554){_0x4c23b6=_0x4c23b6-0x0;var _0x5bfe18=_0x0c46[_0x4c23b6];return _0x5bfe18;};'use strict';var OpenchannelMessageEvents=require(_0x60c4('0x0'));var events=['save',_0x60c4('0x1'),_0x60c4('0x2')];function createListener(_0x10b897,_0x1fab30){return function(_0xed07dd){_0x1fab30[_0x60c4('0x3')](_0x10b897,_0xed07dd);};}function removeListener(_0x31b326,_0x33600d){return function(){OpenchannelMessageEvents[_0x60c4('0x4')](_0x31b326,_0x33600d);};}exports['register']=function(_0x146d31){for(var _0xe35865=0x0,_0x29d4d8=events[_0x60c4('0x5')];_0xe35865<_0x29d4d8;_0xe35865++){var _0x2bd4be=events[_0xe35865];var _0x3d8465=createListener(_0x60c4('0x6')+_0x2bd4be,_0x146d31);OpenchannelMessageEvents['on'](_0x2bd4be,_0x3d8465);}}; \ No newline at end of file +var _0x980f=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x980f,0xe6));var _0xf980=function(_0x1b1f60,_0x362a0b){_0x1b1f60=_0x1b1f60-0x0;var _0x1a0e79=_0x980f[_0x1b1f60];return _0x1a0e79;};'use strict';var OpenchannelMessageEvents=require(_0xf980('0x0'));var events=[_0xf980('0x1'),_0xf980('0x2'),_0xf980('0x3')];function createListener(_0x2712bf,_0x519d3c){return function(_0x2b4311){_0x519d3c[_0xf980('0x4')](_0x2712bf,_0x2b4311);};}function removeListener(_0x4865a7,_0x2a9289){return function(){OpenchannelMessageEvents[_0xf980('0x5')](_0x4865a7,_0x2a9289);};}exports[_0xf980('0x6')]=function(_0x2aa0a0){for(var _0x35fdb7=0x0,_0x361b91=events[_0xf980('0x7')];_0x35fdb7<_0x361b91;_0x35fdb7++){var _0x391137=events[_0x35fdb7];var _0x567d74=createListener(_0xf980('0x8')+_0x391137,_0x2aa0a0);OpenchannelMessageEvents['on'](_0x391137,_0x567d74);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 43c1f0a..2bf9820 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 _0x31c5=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','removeTeams','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x31c5,0x1c9));var _0x531c=function(_0x4b7c3e,_0x3cf98a){_0x4b7c3e=_0x4b7c3e-0x0;var _0x251f0f=_0x31c5[_0x4b7c3e];return _0x251f0f;};'use strict';var multer=require('multer');var util=require(_0x531c('0x0'));var path=require(_0x531c('0x1'));var timeout=require(_0x531c('0x2'));var express=require(_0x531c('0x3'));var router=express[_0x531c('0x4')]();var fs_extra=require(_0x531c('0x5'));var auth=require(_0x531c('0x6'));var interaction=require(_0x531c('0x7'));var config=require(_0x531c('0x8'));var controller=require(_0x531c('0x9'));router[_0x531c('0xa')]('/',auth[_0x531c('0xb')](),controller[_0x531c('0xc')]);router[_0x531c('0xa')](_0x531c('0xd'),auth['isAuthenticated'](),controller[_0x531c('0xe')]);router[_0x531c('0xa')]('/:id',auth[_0x531c('0xb')](),controller[_0x531c('0xf')]);router[_0x531c('0xa')](_0x531c('0x10'),auth[_0x531c('0xb')](),controller[_0x531c('0x11')]);router[_0x531c('0xa')](_0x531c('0x12'),auth[_0x531c('0xb')](),controller[_0x531c('0x13')]);router[_0x531c('0xa')](_0x531c('0x14'),auth[_0x531c('0xb')](),controller[_0x531c('0x15')]);router[_0x531c('0x16')]('/',auth[_0x531c('0xb')](),controller[_0x531c('0x17')]);router[_0x531c('0x16')](_0x531c('0x12'),auth[_0x531c('0xb')](),controller[_0x531c('0x18')]);router[_0x531c('0x16')](_0x531c('0x14'),auth[_0x531c('0xb')](),controller['addAgents']);router[_0x531c('0x19')]('/:id',auth[_0x531c('0xb')](),controller[_0x531c('0x1a')]);router[_0x531c('0x1b')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x531c('0x1b')](_0x531c('0x12'),auth[_0x531c('0xb')](),controller[_0x531c('0x1c')]);router[_0x531c('0x1b')](_0x531c('0x14'),auth[_0x531c('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x70e6=['post','create','addTeams','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','/:id/users','getAgents'];(function(_0x479e20,_0x1e43d7){var _0x40c3fc=function(_0x2c02d2){while(--_0x2c02d2){_0x479e20['push'](_0x479e20['shift']());}};_0x40c3fc(++_0x1e43d7);}(_0x70e6,0x104));var _0x670e=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x70e6[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x670e('0x0'));var util=require(_0x670e('0x1'));var path=require(_0x670e('0x2'));var timeout=require(_0x670e('0x3'));var express=require(_0x670e('0x4'));var router=express[_0x670e('0x5')]();var fs_extra=require(_0x670e('0x6'));var auth=require(_0x670e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x670e('0x8'));var controller=require(_0x670e('0x9'));router[_0x670e('0xa')]('/',auth[_0x670e('0xb')](),controller[_0x670e('0xc')]);router[_0x670e('0xa')](_0x670e('0xd'),auth[_0x670e('0xb')](),controller[_0x670e('0xe')]);router[_0x670e('0xa')](_0x670e('0xf'),auth[_0x670e('0xb')](),controller['show']);router[_0x670e('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x670e('0x10')]);router['get'](_0x670e('0x11'),auth[_0x670e('0xb')](),controller['getTeams']);router['get'](_0x670e('0x12'),auth['isAuthenticated'](),controller[_0x670e('0x13')]);router[_0x670e('0x14')]('/',auth[_0x670e('0xb')](),controller[_0x670e('0x15')]);router[_0x670e('0x14')](_0x670e('0x11'),auth[_0x670e('0xb')](),controller[_0x670e('0x16')]);router[_0x670e('0x14')](_0x670e('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x670e('0x17')]);router[_0x670e('0x18')]('/:id',auth[_0x670e('0xb')](),controller[_0x670e('0x19')]);router[_0x670e('0x18')]('/:id/teams',auth[_0x670e('0xb')](),controller['removeTeams']);router['delete'](_0x670e('0x12'),auth[_0x670e('0xb')](),controller[_0x670e('0x1a')]);module[_0x670e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 367c1a3..e0926cd 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 _0xaa84=['beepall','roundrobin','exports','name','STRING','INTEGER','ENUM'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaa84,0x72));var _0x4aa8=function(_0x13c527,_0xc167ed){_0x13c527=_0x13c527-0x0;var _0x156d8d=_0xaa84[_0x13c527];return _0x156d8d;};'use strict';var Sequelize=require('sequelize');module[_0x4aa8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4aa8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4aa8('0x2')]},'timeout':{'type':Sequelize[_0x4aa8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4aa8('0x4')]('rrmemory',_0x4aa8('0x5'),_0x4aa8('0x6'))}}; \ No newline at end of file +var _0x7cca=['INTEGER','ENUM','beepall','roundrobin','exports','name','STRING'];(function(_0x50da62,_0x516285){var _0x469df3=function(_0x4cb1d8){while(--_0x4cb1d8){_0x50da62['push'](_0x50da62['shift']());}};_0x469df3(++_0x516285);}(_0x7cca,0x9e));var _0xa7cc=function(_0x1dbe58,_0x19c79d){_0x1dbe58=_0x1dbe58-0x0;var _0x56ea13=_0x7cca[_0x1dbe58];return _0x56ea13;};'use strict';var Sequelize=require('sequelize');module[_0xa7cc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa7cc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7cc('0x2')]},'timeout':{'type':Sequelize[_0xa7cc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7cc('0x4')]('rrmemory',_0xa7cc('0x5'),_0xa7cc('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5355999..743e529 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 _0xe781=['toString','QueryTypes','every','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','get','OpenchannelQueues','destroy','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','params','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?'];(function(_0x3d3379,_0x4c9bc1){var _0x358633=function(_0x54510c){while(--_0x54510c){_0x3d3379['push'](_0x3d3379['shift']());}};_0x358633(++_0x4c9bc1);}(_0xe781,0x134));var _0x1e78=function(_0x4b135f,_0x5ff80b){_0x4b135f=_0x4b135f-0x0;var _0x2c254b=_0xe781[_0x4b135f];return _0x2c254b;};'use strict';var emlformat=require(_0x1e78('0x0'));var rimraf=require(_0x1e78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e78('0x2'));var rp=require(_0x1e78('0x3'));var moment=require(_0x1e78('0x4'));var BPromise=require(_0x1e78('0x5'));var Mustache=require(_0x1e78('0x6'));var util=require(_0x1e78('0x7'));var path=require(_0x1e78('0x8'));var sox=require(_0x1e78('0x9'));var csv=require(_0x1e78('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e78('0xb'));var _=require('lodash');var squel=require(_0x1e78('0xc'));var crypto=require(_0x1e78('0xd'));var jsforce=require(_0x1e78('0xe'));var deskjs=require(_0x1e78('0xf'));var toCsv=require(_0x1e78('0xa'));var querystring=require(_0x1e78('0x10'));var Papa=require(_0x1e78('0x11'));var Redis=require(_0x1e78('0x12'));var authService=require(_0x1e78('0x13'));var qs=require(_0x1e78('0x14'));var as=require(_0x1e78('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e78('0x16'))(_0x1e78('0x17'));var utils=require('../../config/utils');var config=require(_0x1e78('0x18'));var licenseUtil=require(_0x1e78('0x19'));var db=require(_0x1e78('0x1a'))['db'];config['redis']=_['defaults'](config[_0x1e78('0x1b')],{'host':_0x1e78('0x1c'),'port':0x18eb});var socket=require(_0x1e78('0x1d'))(new Redis(config[_0x1e78('0x1b')]));require(_0x1e78('0x1e'))[_0x1e78('0x1f')](socket);function respondWithStatusCode(_0x527a14,_0x547ec3){_0x547ec3=_0x547ec3||0xcc;return function(_0x57eb7e){if(_0x57eb7e){return _0x527a14[_0x1e78('0x20')](_0x547ec3);}return _0x527a14[_0x1e78('0x21')](_0x547ec3)[_0x1e78('0x22')]();};}function respondWithResult(_0x5f0ca0,_0x424796){_0x424796=_0x424796||0xc8;return function(_0x4a090d){if(_0x4a090d){return _0x5f0ca0[_0x1e78('0x21')](_0x424796)['json'](_0x4a090d);}};}function respondWithFilteredResult(_0x2bdff0,_0x4f044b){return function(_0xa82a2a){if(_0xa82a2a){var _0x531688=typeof _0x4f044b[_0x1e78('0x23')]===_0x1e78('0x24')&&typeof _0x4f044b[_0x1e78('0x25')]===_0x1e78('0x24');var _0x1f96f0=_0xa82a2a[_0x1e78('0x26')];var _0x41a586=_0x531688?0x0:_0x4f044b[_0x1e78('0x23')];var _0x5bff26=_0x531688?_0xa82a2a[_0x1e78('0x26')]:_0x4f044b[_0x1e78('0x23')]+_0x4f044b[_0x1e78('0x25')];var _0x5acae8;if(_0x5bff26>=_0x1f96f0){_0x5bff26=_0x1f96f0;_0x5acae8=0xc8;}else{_0x5acae8=0xce;}_0x2bdff0[_0x1e78('0x21')](_0x5acae8);return _0x2bdff0['set'](_0x1e78('0x27'),_0x41a586+'-'+_0x5bff26+'/'+_0x1f96f0)[_0x1e78('0x28')](_0xa82a2a);}return null;};}function patchUpdates(_0x5e9ba6){return function(_0x51abf6){try{jsonpatch[_0x1e78('0x29')](_0x51abf6,_0x5e9ba6,!![]);}catch(_0x1231b9){return BPromise[_0x1e78('0x2a')](_0x1231b9);}return _0x51abf6[_0x1e78('0x2b')]();};}function saveUpdates(_0x5d75ef,_0x2c91a3){return function(_0x5e00e9){if(_0x5e00e9){return _0x5e00e9['update'](_0x5d75ef)['then'](function(_0x329201){return _0x329201;});}return null;};}function removeEntity(_0x20d79d,_0x435fa6){return function(_0x55cfd1){if(_0x55cfd1){return _0x55cfd1['destroy']()[_0x1e78('0x2c')](function(){var _0x43e1f4=_0x55cfd1[_0x1e78('0x2d')]({'plain':!![]});var _0x2470a1=_0x1e78('0x2e');return db['UserProfileResource'][_0x1e78('0x2f')]({'where':{'type':_0x2470a1,'resourceId':_0x43e1f4['id']}})[_0x1e78('0x2c')](function(){return _0x55cfd1;});})['then'](function(){_0x20d79d[_0x1e78('0x21')](0xcc)[_0x1e78('0x22')]();});}};}function handleEntityNotFound(_0x302d06,_0x4e94e0){return function(_0x2c1d4e){if(!_0x2c1d4e){_0x302d06['sendStatus'](0x194);}return _0x2c1d4e;};}function handleError(_0x4e8c66,_0x4d8453){_0x4d8453=_0x4d8453||0x1f4;return function(_0x4776d0){logger['error'](_0x4776d0[_0x1e78('0x30')]);if(_0x4776d0[_0x1e78('0x31')]){delete _0x4776d0[_0x1e78('0x31')];}_0x4e8c66['status'](_0x4d8453)[_0x1e78('0x32')](_0x4776d0);};}exports[_0x1e78('0x33')]=function(_0x590fc8,_0x4d39cd){var _0x44253d={},_0x12943a={},_0x450306={'count':0x0,'rows':[]};var _0x561abc=_['map'](db[_0x1e78('0x34')][_0x1e78('0x35')],function(_0x3515ed){return{'name':_0x3515ed[_0x1e78('0x36')],'type':_0x3515ed[_0x1e78('0x37')][_0x1e78('0x38')]};});_0x12943a['model']=_['map'](_0x561abc,_0x1e78('0x31'));_0x12943a[_0x1e78('0x39')]=_['keys'](_0x590fc8[_0x1e78('0x39')]);_0x12943a['filters']=_['intersection'](_0x12943a[_0x1e78('0x3a')],_0x12943a[_0x1e78('0x39')]);_0x44253d['attributes']=_[_0x1e78('0x3b')](_0x12943a['model'],qs[_0x1e78('0x3c')](_0x590fc8[_0x1e78('0x39')]['fields']));_0x44253d['attributes']=_0x44253d[_0x1e78('0x3d')][_0x1e78('0x3e')]?_0x44253d[_0x1e78('0x3d')]:_0x12943a[_0x1e78('0x3a')];if(!_0x590fc8[_0x1e78('0x39')][_0x1e78('0x3f')]('nolimit')){_0x44253d[_0x1e78('0x25')]=qs[_0x1e78('0x25')](_0x590fc8['query'][_0x1e78('0x25')]);_0x44253d[_0x1e78('0x23')]=qs[_0x1e78('0x23')](_0x590fc8[_0x1e78('0x39')][_0x1e78('0x23')]);}_0x44253d['order']=qs[_0x1e78('0x40')](_0x590fc8[_0x1e78('0x39')][_0x1e78('0x40')]);_0x44253d[_0x1e78('0x41')]=qs['filters'](_[_0x1e78('0x42')](_0x590fc8[_0x1e78('0x39')],_0x12943a[_0x1e78('0x43')]),_0x561abc);if(_0x590fc8[_0x1e78('0x39')][_0x1e78('0x44')]){_0x44253d['where']=_[_0x1e78('0x45')](_0x44253d[_0x1e78('0x41')],{'$or':_[_0x1e78('0x46')](_0x561abc,function(_0x3d17ea){if(_0x3d17ea[_0x1e78('0x37')]!==_0x1e78('0x47')){var _0x4712fe={};_0x4712fe[_0x3d17ea[_0x1e78('0x31')]]={'$like':'%'+_0x590fc8[_0x1e78('0x39')][_0x1e78('0x44')]+'%'};return _0x4712fe;}})});}_0x44253d=_[_0x1e78('0x45')]({},_0x44253d,_0x590fc8['options']);var _0x17f241={'where':_0x44253d[_0x1e78('0x41')]};return db[_0x1e78('0x34')][_0x1e78('0x26')](_0x17f241)[_0x1e78('0x2c')](function(_0x5ad329){_0x450306['count']=_0x5ad329;if(_0x590fc8[_0x1e78('0x39')][_0x1e78('0x48')]){_0x44253d[_0x1e78('0x49')]=[{'all':!![]}];}return db[_0x1e78('0x34')][_0x1e78('0x4a')](_0x44253d);})[_0x1e78('0x2c')](function(_0x5b0bf2){_0x450306[_0x1e78('0x4b')]=_0x5b0bf2;return _0x450306;})[_0x1e78('0x2c')](respondWithFilteredResult(_0x4d39cd,_0x44253d))[_0x1e78('0x4c')](handleError(_0x4d39cd,null));};exports[_0x1e78('0x4d')]=function(_0x15bed8,_0x5bdb4c){var _0x407e8b={'raw':!![],'where':{'id':_0x15bed8['params']['id']}},_0x136000={};_0x136000[_0x1e78('0x3a')]=_['keys'](db[_0x1e78('0x34')]['rawAttributes']);_0x136000[_0x1e78('0x39')]=_[_0x1e78('0x4e')](_0x15bed8[_0x1e78('0x39')]);_0x136000[_0x1e78('0x43')]=_[_0x1e78('0x3b')](_0x136000['model'],_0x136000[_0x1e78('0x39')]);_0x407e8b[_0x1e78('0x3d')]=_[_0x1e78('0x3b')](_0x136000['model'],qs['fields'](_0x15bed8[_0x1e78('0x39')][_0x1e78('0x3c')]));_0x407e8b[_0x1e78('0x3d')]=_0x407e8b['attributes']['length']?_0x407e8b[_0x1e78('0x3d')]:_0x136000[_0x1e78('0x3a')];if(_0x15bed8['query'][_0x1e78('0x48')]){_0x407e8b['include']=[{'all':!![]}];}_0x407e8b=_['merge']({},_0x407e8b,_0x15bed8[_0x1e78('0x4f')]);return db[_0x1e78('0x34')]['find'](_0x407e8b)['then'](handleEntityNotFound(_0x5bdb4c,null))['then'](respondWithResult(_0x5bdb4c,null))[_0x1e78('0x4c')](handleError(_0x5bdb4c,null));};exports[_0x1e78('0x50')]=function(_0x34a11a,_0x5e3acb){return db[_0x1e78('0x34')][_0x1e78('0x50')](_0x34a11a[_0x1e78('0x51')],{})['then'](function(_0x32d33b){var _0x19779a=_0x34a11a[_0x1e78('0x52')]['get']({'plain':!![]});if(!_0x19779a)throw new Error(_0x1e78('0x53'));if(_0x19779a[_0x1e78('0x54')]===_0x1e78('0x52')){var _0x225b1a=_0x32d33b['get']({'plain':!![]});var _0x268448=_0x1e78('0x2e');return db[_0x1e78('0x55')][_0x1e78('0x56')]({'where':{'name':_0x268448,'userProfileId':_0x19779a['userProfileId']},'raw':!![]})[_0x1e78('0x2c')](function(_0x55d9b9){if(_0x55d9b9&&_0x55d9b9[_0x1e78('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x225b1a[_0x1e78('0x31')],'resourceId':_0x225b1a['id'],'type':_0x55d9b9[_0x1e78('0x31')],'sectionId':_0x55d9b9['id']},{})[_0x1e78('0x2c')](function(){return _0x32d33b;});}else{return _0x32d33b;}})[_0x1e78('0x4c')](function(_0x5b8966){logger[_0x1e78('0x58')](_0x1e78('0x59'),_0x5b8966);throw _0x5b8966;});}return _0x32d33b;})[_0x1e78('0x2c')](respondWithResult(_0x5e3acb,0xc9))['catch'](handleError(_0x5e3acb,null));};exports[_0x1e78('0x5a')]=function(_0x2f801b,_0x1b0b30){if(_0x2f801b['body']['id']){delete _0x2f801b['body']['id'];}return db[_0x1e78('0x34')][_0x1e78('0x56')]({'where':{'id':_0x2f801b['params']['id']}})[_0x1e78('0x2c')](handleEntityNotFound(_0x1b0b30,null))[_0x1e78('0x2c')](saveUpdates(_0x2f801b[_0x1e78('0x51')],null))[_0x1e78('0x2c')](respondWithResult(_0x1b0b30,null))[_0x1e78('0x4c')](handleError(_0x1b0b30,null));};exports[_0x1e78('0x2f')]=function(_0x3dc2d8,_0x581888){return db[_0x1e78('0x34')]['find']({'where':{'id':_0x3dc2d8['params']['id']}})[_0x1e78('0x2c')](handleEntityNotFound(_0x581888,null))[_0x1e78('0x2c')](removeEntity(_0x581888,null))[_0x1e78('0x4c')](handleError(_0x581888,null));};exports['describe']=function(_0x410bb5,_0x10e73f){return db[_0x1e78('0x34')]['describe']()[_0x1e78('0x2c')](respondWithResult(_0x10e73f,null))[_0x1e78('0x4c')](handleError(_0x10e73f,null));};exports[_0x1e78('0x5b')]=function(_0x5c6eaf,_0x5513b9,_0x5b5db0){var _0x325983={'raw':!![],'where':{}},_0x290f20={},_0x12c9fe;return db[_0x1e78('0x34')][_0x1e78('0x5c')]({'where':{'id':_0x5c6eaf['params']['id']}})[_0x1e78('0x2c')](handleEntityNotFound(_0x5513b9,null))['then'](function(_0x23614e){if(_0x23614e){_0x12c9fe=_0x23614e[_0x1e78('0x2d')]({'plain':!![]});_0x290f20[_0x1e78('0x3a')]=_[_0x1e78('0x4e')](db[_0x1e78('0x5d')][_0x1e78('0x35')]);_0x290f20[_0x1e78('0x39')]=_[_0x1e78('0x4e')](_0x5c6eaf[_0x1e78('0x39')]);_0x290f20[_0x1e78('0x43')]=_[_0x1e78('0x3b')](_0x290f20[_0x1e78('0x3a')],_0x290f20[_0x1e78('0x39')]);_0x325983['attributes']=_[_0x1e78('0x3b')](_0x290f20[_0x1e78('0x3a')],qs['fields'](_0x5c6eaf[_0x1e78('0x39')][_0x1e78('0x3c')]));_0x325983[_0x1e78('0x3d')]=_0x325983[_0x1e78('0x3d')]['length']?_0x325983['attributes']:_0x290f20[_0x1e78('0x3a')];if(!_0x5c6eaf['query'][_0x1e78('0x3f')](_0x1e78('0x5e'))){_0x325983[_0x1e78('0x25')]=qs['limit'](_0x5c6eaf[_0x1e78('0x39')][_0x1e78('0x25')]);_0x325983[_0x1e78('0x23')]=qs['offset'](_0x5c6eaf['query'][_0x1e78('0x23')]);}_0x325983[_0x1e78('0x5f')]=qs[_0x1e78('0x40')](_0x5c6eaf[_0x1e78('0x39')][_0x1e78('0x40')]);_0x325983[_0x1e78('0x41')]=qs[_0x1e78('0x43')](_[_0x1e78('0x42')](_0x5c6eaf['query'],_0x290f20[_0x1e78('0x43')]));_0x325983[_0x1e78('0x41')][_0x1e78('0x60')]=_0x23614e['id'];if(_0x5c6eaf[_0x1e78('0x39')]['filter']){_0x325983[_0x1e78('0x41')]=_[_0x1e78('0x45')](_0x325983[_0x1e78('0x41')],{'$or':_['map'](_0x325983[_0x1e78('0x3d')],function(_0x2c2adf){var _0x3e3938={};_0x3e3938[_0x2c2adf]={'$like':'%'+_0x5c6eaf['query'][_0x1e78('0x44')]+'%'};return _0x3e3938;})});}_0x325983=_[_0x1e78('0x45')]({},_0x325983,_0x5c6eaf[_0x1e78('0x4f')]);return db[_0x1e78('0x5d')][_0x1e78('0x4a')](_0x325983);}})[_0x1e78('0x2c')](function(_0x33dcc3){if(_0x33dcc3){return db[_0x1e78('0x61')][_0x1e78('0x62')]({'where':{'id':_[_0x1e78('0x46')](_0x33dcc3,_0x1e78('0x63')),'role':_0x1e78('0x64')},'attributes':['id',_0x1e78('0x31'),'openchannelPause',_0x1e78('0x65'),_0x1e78('0x66')]});}})['then'](function(_0x39c0c5){if(_0x39c0c5){return{'count':_0x39c0c5['count'],'rows':_[_0x1e78('0x46')](_0x39c0c5[_0x1e78('0x4b')],function(_0x3e8728){return{'membername':_0x3e8728[_0x1e78('0x31')],'UserId':_0x3e8728['id'],'queue_name':_0x12c9fe[_0x1e78('0x31')],'OpenchannelQueueId':_0x12c9fe['id'],'interface':util['format'](_0x1e78('0x67'),_0x1e78('0x68'),_0x3e8728[_0x1e78('0x31')]),'penalty':0x0,'paused':_0x3e8728['openchannelPause'],'createdAt':_0x3e8728[_0x1e78('0x66')],'updatedAt':_0x3e8728['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5513b9,_0x325983))[_0x1e78('0x4c')](handleError(_0x5513b9,null));};exports[_0x1e78('0x69')]=function(_0x15d57f,_0x5d60dd,_0x2a603c){var _0x31d4b4={};var _0x2632c4={};var _0x165225;var _0x586de6;return db[_0x1e78('0x34')][_0x1e78('0x5c')]({'where':{'id':_0x15d57f[_0x1e78('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5d60dd,null))['then'](function(_0x271053){if(_0x271053){_0x165225=_0x271053;_0x2632c4['model']=_[_0x1e78('0x4e')](db[_0x1e78('0x6b')][_0x1e78('0x35')]);_0x2632c4['query']=_[_0x1e78('0x4e')](_0x15d57f['query']);_0x2632c4[_0x1e78('0x43')]=_[_0x1e78('0x3b')](_0x2632c4[_0x1e78('0x3a')],_0x2632c4[_0x1e78('0x39')]);_0x31d4b4[_0x1e78('0x3d')]=_[_0x1e78('0x3b')](_0x2632c4['model'],qs[_0x1e78('0x3c')](_0x15d57f[_0x1e78('0x39')][_0x1e78('0x3c')]));_0x31d4b4['attributes']=_0x31d4b4[_0x1e78('0x3d')][_0x1e78('0x3e')]?_0x31d4b4[_0x1e78('0x3d')]:_0x2632c4[_0x1e78('0x3a')];_0x31d4b4[_0x1e78('0x5f')]=qs[_0x1e78('0x40')](_0x15d57f[_0x1e78('0x39')][_0x1e78('0x40')]);_0x31d4b4[_0x1e78('0x41')]=qs['filters'](_[_0x1e78('0x42')](_0x15d57f[_0x1e78('0x39')],_0x2632c4['filters']));if(_0x15d57f[_0x1e78('0x39')][_0x1e78('0x44')]){_0x31d4b4[_0x1e78('0x41')]=_[_0x1e78('0x45')](_0x31d4b4[_0x1e78('0x41')],{'$or':_[_0x1e78('0x46')](_0x31d4b4[_0x1e78('0x3d')],function(_0x1520f7){var _0x164eaa={};_0x164eaa[_0x1520f7]={'$like':'%'+_0x15d57f['query']['filter']+'%'};return _0x164eaa;})});}_0x31d4b4=_[_0x1e78('0x45')]({},_0x31d4b4,_0x15d57f[_0x1e78('0x4f')]);return _0x165225[_0x1e78('0x69')](_0x31d4b4);}})[_0x1e78('0x2c')](function(_0x5b12b1){if(_0x5b12b1){_0x586de6=_0x5b12b1[_0x1e78('0x3e')];if(!_0x15d57f['query'][_0x1e78('0x3f')](_0x1e78('0x5e'))){_0x31d4b4[_0x1e78('0x25')]=qs['limit'](_0x15d57f['query'][_0x1e78('0x25')]);_0x31d4b4[_0x1e78('0x23')]=qs['offset'](_0x15d57f['query']['offset']);}return _0x165225[_0x1e78('0x69')](_0x31d4b4);}})[_0x1e78('0x2c')](function(_0x58fa80){if(_0x58fa80){return _0x58fa80?{'count':_0x586de6,'rows':_0x58fa80}:null;}})[_0x1e78('0x2c')](respondWithResult(_0x5d60dd,null))['catch'](handleError(_0x5d60dd,null));};exports[_0x1e78('0x6c')]=function(_0x193f9d,_0x248ceb,_0x453335){var _0xb6dbda=_0x193f9d['body'][_0x1e78('0x6d')];return db['Team']['findAll']({'where':{'id':_0xb6dbda},'attributes':['id'],'include':[{'model':db[_0x1e78('0x61')],'as':_0x1e78('0x6e'),'attributes':['id',_0x1e78('0x31'),_0x1e78('0x6f'),_0x1e78('0x70'),_0x1e78('0x71')],'raw':!![]}]})[_0x1e78('0x2c')](function(_0x39caf1){if(_0x39caf1){var _0x5a5540=_[_0x1e78('0x72')](_0x39caf1,function(_0x1aa869){var _0x295ea3=_0x1aa869[_0x1e78('0x2d')]({'plain':!![]});return _0x295ea3[_0x1e78('0x6e')];});return db[_0x1e78('0x34')]['find']({'where':{'id':_0x193f9d[_0x1e78('0x6a')]['id']}})['then'](function(_0x3be195){return db['sequelize'][_0x1e78('0x73')](function(_0x1cb3d0){return _0x3be195[_0x1e78('0x6c')](_0xb6dbda,{'transaction':_0x1cb3d0})[_0x1e78('0x2c')](function(){return BPromise[_0x1e78('0x74')](_0x5a5540,function(_0x37c75d){return db[_0x1e78('0x5d')][_0x1e78('0x75')]({'where':{'UserId':_0x37c75d['id'],'OpenchannelQueueId':_0x193f9d[_0x1e78('0x6a')]['id']},'transaction':_0x1cb3d0});});})[_0x1e78('0x2c')](function(){_0x5a5540[_0x1e78('0x76')](function(_0x3d18de){socket[_0x1e78('0x77')]('userOpenchannelQueue:save',{'UserId':_0x3d18de['id'],'OpenchannelQueueId':_0x3be195['id']});});});});});}})[_0x1e78('0x2c')](respondWithStatusCode(_0x248ceb,null))[_0x1e78('0x4c')](handleError(_0x248ceb,null));};exports[_0x1e78('0x78')]=function(_0x1311ee,_0x5e0a29,_0x23f925){return db[_0x1e78('0x6b')][_0x1e78('0x4a')]({'where':{'id':_0x1311ee['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x1e78('0x61')],'as':_0x1e78('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e0a29,null))[_0x1e78('0x2c')](function(_0x1df80a){var _0x2a3735=_[_0x1e78('0x46')](_0x1df80a,'id');var _0x33eec1=[];var _0xa4918f=[];var _0x595392=squel[_0x1e78('0x79')]();_0x595392[_0x1e78('0x7a')](_0x1e78('0x7b'))[_0x1e78('0x7c')](_0x1e78('0x7d'),'tq')['join'](_0x1e78('0x7e'),'ut',_0x1e78('0x7f'))['where']('OpenchannelQueueId\x20=\x20?',_0x1311ee['params']['id']);for(var _0x1d8802=0x0;_0x1d8802<_0x1df80a[_0x1e78('0x3e')];_0x1d8802+=0x1){let _0x30cc7f=_0x1df80a[_0x1d8802];for(var _0x23ff17=0x0;_0x23ff17<_0x30cc7f['Agents'][_0x1e78('0x3e')];_0x23ff17+=0x1){let _0x47f2f0=_0x30cc7f[_0x1e78('0x6e')][_0x23ff17];var _0x353fd5=_0x595392[_0x1e78('0x80')]();_0x353fd5[_0x1e78('0x41')](_0x1e78('0x81'),_0x47f2f0['id']);_0xa4918f['push'](db['sequelize'][_0x1e78('0x39')](_0x353fd5[_0x1e78('0x82')](),{'type':db['sequelize'][_0x1e78('0x83')]['SELECT']})[_0x1e78('0x2c')](function(_0x310186){if(_0x310186[_0x1e78('0x3e')]===0x1){return _0x47f2f0['id'];}else{var _0x399d77=_[_0x1e78('0x84')](_[_0x1e78('0x46')](_0x310186,_0x1e78('0x85')),function(_0x1845ad){return _['includes'](_0x2a3735,_0x1845ad);});if(_0x399d77){return _0x47f2f0['id'];}}}));}}return BPromise[_0x1e78('0x86')](_0xa4918f)[_0x1e78('0x2c')](function(_0x427f41){_0x33eec1=_(_0x33eec1)[_0x1e78('0x87')](_0x427f41)[_0x1e78('0x88')]()[_0x1e78('0x89')]();return db[_0x1e78('0x34')]['find']({'where':{'id':_0x1311ee[_0x1e78('0x6a')]['id']}})[_0x1e78('0x2c')](function(_0x314629){return db[_0x1e78('0x8a')][_0x1e78('0x73')](function(_0x5f093c){return _0x314629[_0x1e78('0x78')](_0x1311ee['query'][_0x1e78('0x6d')],{'transaction':_0x5f093c})[_0x1e78('0x2c')](function(){if(!_[_0x1e78('0x8b')](_0x33eec1)){return _0x314629[_0x1e78('0x8c')](_0x33eec1,{'transaction':_0x5f093c});}})['then'](function(){_0x33eec1[_0x1e78('0x76')](function(_0x35c2f9){socket[_0x1e78('0x77')]('userOpenchannelQueue:remove',{'UserId':_0x35c2f9,'OpenchannelQueueId':_0x314629['id']});});});});});});})[_0x1e78('0x2c')](respondWithStatusCode(_0x5e0a29,null))[_0x1e78('0x4c')](handleError(_0x5e0a29,null));};exports['addAgents']=function(_0x5029ae,_0x2986d2,_0x19d13c){return db['OpenchannelQueue'][_0x1e78('0x56')]({'where':{'id':_0x5029ae['params']['id']}})['then'](handleEntityNotFound(_0x2986d2,null))[_0x1e78('0x2c')](function(_0x7bcec0){if(_0x7bcec0){return _0x7bcec0['addAgents'](_0x5029ae[_0x1e78('0x51')]['ids'],_['omit'](_0x5029ae[_0x1e78('0x51')],[_0x1e78('0x6d'),'id'])||{})[_0x1e78('0x8d')](function(_0x4c4e67){for(var _0x649fbe=0x0;_0x649fbe<_0x5029ae[_0x1e78('0x51')][_0x1e78('0x6d')][_0x1e78('0x3e')];_0x649fbe+=0x1){socket[_0x1e78('0x77')](_0x1e78('0x8e'),{'UserId':Number(_0x5029ae[_0x1e78('0x51')][_0x1e78('0x6d')][_0x649fbe]),'OpenchannelQueueId':Number(_0x5029ae[_0x1e78('0x6a')]['id'])});}return _0x4c4e67;});}})[_0x1e78('0x2c')](respondWithResult(_0x2986d2,null))[_0x1e78('0x4c')](handleError(_0x2986d2,null));};exports[_0x1e78('0x8c')]=function(_0x52c228,_0x31a42b,_0x431d3b){return db[_0x1e78('0x34')][_0x1e78('0x56')]({'where':{'id':_0x52c228[_0x1e78('0x6a')]['id']}})[_0x1e78('0x2c')](handleEntityNotFound(_0x31a42b,null))[_0x1e78('0x2c')](function(_0x39f20c){if(_0x39f20c){return _0x39f20c[_0x1e78('0x8c')](_0x52c228[_0x1e78('0x39')][_0x1e78('0x6d')])[_0x1e78('0x2c')](function(){if(_[_0x1e78('0x8f')](_0x52c228[_0x1e78('0x39')][_0x1e78('0x6d')])){for(var _0x367442=0x0;_0x367442<_0x52c228['query'][_0x1e78('0x6d')][_0x1e78('0x3e')];_0x367442+=0x1){socket['emit'](_0x1e78('0x90'),{'UserId':Number(_0x52c228[_0x1e78('0x39')][_0x1e78('0x6d')][_0x367442]),'OpenchannelQueueId':Number(_0x52c228[_0x1e78('0x6a')]['id'])});}}else{socket[_0x1e78('0x77')](_0x1e78('0x90'),{'UserId':Number(_0x52c228[_0x1e78('0x39')][_0x1e78('0x6d')]),'OpenchannelQueueId':Number(_0x52c228[_0x1e78('0x6a')]['id'])});}});}})['then'](respondWithStatusCode(_0x31a42b,null))[_0x1e78('0x4c')](handleError(_0x31a42b,null));};exports['getAgents']=function(_0x39e681,_0x5568bf,_0x36b809){var _0x4b821e={};var _0x13bdc6={};var _0x217cc5;var _0x12d549;return db[_0x1e78('0x34')]['findOne']({'where':{'id':_0x39e681[_0x1e78('0x6a')]['id']}})[_0x1e78('0x2c')](handleEntityNotFound(_0x5568bf,null))['then'](function(_0x3e2cb5){if(_0x3e2cb5){_0x217cc5=_0x3e2cb5;_0x13bdc6[_0x1e78('0x3a')]=_['keys'](db[_0x1e78('0x61')]['rawAttributes']);_0x13bdc6[_0x1e78('0x39')]=_[_0x1e78('0x4e')](_0x39e681[_0x1e78('0x39')]);_0x13bdc6[_0x1e78('0x43')]=_[_0x1e78('0x3b')](_0x13bdc6['model'],_0x13bdc6[_0x1e78('0x39')]);_0x4b821e[_0x1e78('0x3d')]=_[_0x1e78('0x3b')](_0x13bdc6[_0x1e78('0x3a')],qs[_0x1e78('0x3c')](_0x39e681[_0x1e78('0x39')][_0x1e78('0x3c')]));_0x4b821e['attributes']=_0x4b821e[_0x1e78('0x3d')]['length']?_0x4b821e[_0x1e78('0x3d')]:_0x13bdc6[_0x1e78('0x3a')];_0x4b821e[_0x1e78('0x5f')]=qs[_0x1e78('0x40')](_0x39e681[_0x1e78('0x39')]['sort']);_0x4b821e['where']=qs['filters'](_[_0x1e78('0x42')](_0x39e681[_0x1e78('0x39')],_0x13bdc6[_0x1e78('0x43')]));if(_0x39e681[_0x1e78('0x39')][_0x1e78('0x44')]){_0x4b821e[_0x1e78('0x41')]=_[_0x1e78('0x45')](_0x4b821e[_0x1e78('0x41')],{'$or':_['map'](_0x4b821e['attributes'],function(_0xaad8d9){var _0x2629f7={};_0x2629f7[_0xaad8d9]={'$like':'%'+_0x39e681['query'][_0x1e78('0x44')]+'%'};return _0x2629f7;})});}_0x4b821e=_[_0x1e78('0x45')]({},_0x4b821e,_0x39e681[_0x1e78('0x4f')]);return _0x217cc5[_0x1e78('0x91')](_0x4b821e);}})['then'](function(_0x209f44){if(_0x209f44){_0x12d549=_0x209f44['length'];if(!_0x39e681['query'][_0x1e78('0x3f')](_0x1e78('0x5e'))){_0x4b821e[_0x1e78('0x25')]=qs[_0x1e78('0x25')](_0x39e681['query']['limit']);_0x4b821e[_0x1e78('0x23')]=qs[_0x1e78('0x23')](_0x39e681['query'][_0x1e78('0x23')]);}return _0x217cc5[_0x1e78('0x91')](_0x4b821e);}})[_0x1e78('0x2c')](function(_0x121d67){if(_0x121d67){return _0x121d67?{'count':_0x12d549,'rows':_0x121d67}:null;}})['then'](respondWithResult(_0x5568bf,null))[_0x1e78('0x4c')](handleError(_0x5568bf,null));}; \ No newline at end of file +var _0xefa1=['OpenchannelQueueId\x20=\x20?','push','toString','SELECT','every','includes','all','union','compact','value','transaction','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','catch','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','UserOpenchannelQueue','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefa1,0x128));var _0x1efa=function(_0x20f221,_0xd4a407){_0x20f221=_0x20f221-0x0;var _0x45aea0=_0xefa1[_0x20f221];return _0x45aea0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1efa('0x0'));var jsonpatch=require(_0x1efa('0x1'));var rp=require(_0x1efa('0x2'));var moment=require(_0x1efa('0x3'));var BPromise=require(_0x1efa('0x4'));var Mustache=require('mustache');var util=require(_0x1efa('0x5'));var path=require(_0x1efa('0x6'));var sox=require('sox');var csv=require(_0x1efa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1efa('0x8'));var _=require(_0x1efa('0x9'));var squel=require(_0x1efa('0xa'));var crypto=require(_0x1efa('0xb'));var jsforce=require(_0x1efa('0xc'));var deskjs=require(_0x1efa('0xd'));var toCsv=require(_0x1efa('0x7'));var querystring=require(_0x1efa('0xe'));var Papa=require('papaparse');var Redis=require(_0x1efa('0xf'));var authService=require(_0x1efa('0x10'));var qs=require(_0x1efa('0x11'));var as=require(_0x1efa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1efa('0x13'));var config=require(_0x1efa('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1efa('0x15'))['db'];config[_0x1efa('0x16')]=_[_0x1efa('0x17')](config[_0x1efa('0x16')],{'host':_0x1efa('0x18'),'port':0x18eb});var socket=require(_0x1efa('0x19'))(new Redis(config[_0x1efa('0x16')]));require(_0x1efa('0x1a'))[_0x1efa('0x1b')](socket);function respondWithStatusCode(_0x5858d5,_0xcffd9d){_0xcffd9d=_0xcffd9d||0xcc;return function(_0x5e5ce0){if(_0x5e5ce0){return _0x5858d5[_0x1efa('0x1c')](_0xcffd9d);}return _0x5858d5[_0x1efa('0x1d')](_0xcffd9d)[_0x1efa('0x1e')]();};}function respondWithResult(_0x39594a,_0x152bd5){_0x152bd5=_0x152bd5||0xc8;return function(_0x4acf72){if(_0x4acf72){return _0x39594a['status'](_0x152bd5)[_0x1efa('0x1f')](_0x4acf72);}};}function respondWithFilteredResult(_0x4a1c9f,_0x586371){return function(_0x503659){if(_0x503659){var _0x3cb5e2=typeof _0x586371[_0x1efa('0x20')]===_0x1efa('0x21')&&typeof _0x586371[_0x1efa('0x22')]===_0x1efa('0x21');var _0x5531e0=_0x503659[_0x1efa('0x23')];var _0x3f8406=_0x3cb5e2?0x0:_0x586371[_0x1efa('0x20')];var _0x32229c=_0x3cb5e2?_0x503659[_0x1efa('0x23')]:_0x586371[_0x1efa('0x20')]+_0x586371[_0x1efa('0x22')];var _0x3c87f5;if(_0x32229c>=_0x5531e0){_0x32229c=_0x5531e0;_0x3c87f5=0xc8;}else{_0x3c87f5=0xce;}_0x4a1c9f[_0x1efa('0x1d')](_0x3c87f5);return _0x4a1c9f['set'](_0x1efa('0x24'),_0x3f8406+'-'+_0x32229c+'/'+_0x5531e0)['json'](_0x503659);}return null;};}function patchUpdates(_0x5c8382){return function(_0x4f52d0){try{jsonpatch[_0x1efa('0x25')](_0x4f52d0,_0x5c8382,!![]);}catch(_0x3588b2){return BPromise[_0x1efa('0x26')](_0x3588b2);}return _0x4f52d0['save']();};}function saveUpdates(_0x709a9,_0x36a465){return function(_0x403ef6){if(_0x403ef6){return _0x403ef6[_0x1efa('0x27')](_0x709a9)[_0x1efa('0x28')](function(_0x1a9b7b){return _0x1a9b7b;});}return null;};}function removeEntity(_0x5777e0,_0x39a32b){return function(_0x30c8e5){if(_0x30c8e5){return _0x30c8e5[_0x1efa('0x29')]()[_0x1efa('0x28')](function(){var _0x536804=_0x30c8e5['get']({'plain':!![]});var _0x182025='OpenchannelQueues';return db[_0x1efa('0x2a')][_0x1efa('0x29')]({'where':{'type':_0x182025,'resourceId':_0x536804['id']}})['then'](function(){return _0x30c8e5;});})['then'](function(){_0x5777e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13553d,_0x3959e3){return function(_0x405c0a){if(!_0x405c0a){_0x13553d[_0x1efa('0x1c')](0x194);}return _0x405c0a;};}function handleError(_0x285146,_0x30ebab){_0x30ebab=_0x30ebab||0x1f4;return function(_0x2c1886){logger[_0x1efa('0x2b')](_0x2c1886[_0x1efa('0x2c')]);if(_0x2c1886[_0x1efa('0x2d')]){delete _0x2c1886['name'];}_0x285146[_0x1efa('0x1d')](_0x30ebab)[_0x1efa('0x2e')](_0x2c1886);};}exports[_0x1efa('0x2f')]=function(_0x4364e6,_0x48d50f){var _0x149418={},_0x1172a6={},_0x132dc6={'count':0x0,'rows':[]};var _0x23e58d=_['map'](db[_0x1efa('0x30')][_0x1efa('0x31')],function(_0x1fe2f2){return{'name':_0x1fe2f2[_0x1efa('0x32')],'type':_0x1fe2f2[_0x1efa('0x33')]['key']};});_0x1172a6['model']=_[_0x1efa('0x34')](_0x23e58d,_0x1efa('0x2d'));_0x1172a6[_0x1efa('0x35')]=_[_0x1efa('0x36')](_0x4364e6['query']);_0x1172a6[_0x1efa('0x37')]=_[_0x1efa('0x38')](_0x1172a6[_0x1efa('0x39')],_0x1172a6[_0x1efa('0x35')]);_0x149418[_0x1efa('0x3a')]=_[_0x1efa('0x38')](_0x1172a6[_0x1efa('0x39')],qs[_0x1efa('0x3b')](_0x4364e6[_0x1efa('0x35')][_0x1efa('0x3b')]));_0x149418[_0x1efa('0x3a')]=_0x149418['attributes'][_0x1efa('0x3c')]?_0x149418[_0x1efa('0x3a')]:_0x1172a6[_0x1efa('0x39')];if(!_0x4364e6[_0x1efa('0x35')][_0x1efa('0x3d')]('nolimit')){_0x149418['limit']=qs[_0x1efa('0x22')](_0x4364e6['query'][_0x1efa('0x22')]);_0x149418['offset']=qs[_0x1efa('0x20')](_0x4364e6['query'][_0x1efa('0x20')]);}_0x149418[_0x1efa('0x3e')]=qs[_0x1efa('0x3f')](_0x4364e6[_0x1efa('0x35')][_0x1efa('0x3f')]);_0x149418[_0x1efa('0x40')]=qs[_0x1efa('0x37')](_[_0x1efa('0x41')](_0x4364e6[_0x1efa('0x35')],_0x1172a6['filters']),_0x23e58d);if(_0x4364e6[_0x1efa('0x35')][_0x1efa('0x42')]){_0x149418[_0x1efa('0x40')]=_[_0x1efa('0x43')](_0x149418[_0x1efa('0x40')],{'$or':_[_0x1efa('0x34')](_0x23e58d,function(_0x3d88fd){if(_0x3d88fd[_0x1efa('0x33')]!==_0x1efa('0x44')){var _0x42cf16={};_0x42cf16[_0x3d88fd[_0x1efa('0x2d')]]={'$like':'%'+_0x4364e6[_0x1efa('0x35')][_0x1efa('0x42')]+'%'};return _0x42cf16;}})});}_0x149418=_[_0x1efa('0x43')]({},_0x149418,_0x4364e6['options']);var _0x5ab242={'where':_0x149418[_0x1efa('0x40')]};return db[_0x1efa('0x30')]['count'](_0x5ab242)[_0x1efa('0x28')](function(_0x298021){_0x132dc6[_0x1efa('0x23')]=_0x298021;if(_0x4364e6['query'][_0x1efa('0x45')]){_0x149418['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1efa('0x46')](_0x149418);})[_0x1efa('0x28')](function(_0x3cbd01){_0x132dc6[_0x1efa('0x47')]=_0x3cbd01;return _0x132dc6;})['then'](respondWithFilteredResult(_0x48d50f,_0x149418))['catch'](handleError(_0x48d50f,null));};exports[_0x1efa('0x48')]=function(_0x5c8368,_0x5cd8d1){var _0x3d8c44={'raw':!![],'where':{'id':_0x5c8368[_0x1efa('0x49')]['id']}},_0x2a2257={};_0x2a2257['model']=_[_0x1efa('0x36')](db['OpenchannelQueue']['rawAttributes']);_0x2a2257[_0x1efa('0x35')]=_[_0x1efa('0x36')](_0x5c8368[_0x1efa('0x35')]);_0x2a2257['filters']=_['intersection'](_0x2a2257[_0x1efa('0x39')],_0x2a2257[_0x1efa('0x35')]);_0x3d8c44[_0x1efa('0x3a')]=_[_0x1efa('0x38')](_0x2a2257[_0x1efa('0x39')],qs['fields'](_0x5c8368[_0x1efa('0x35')][_0x1efa('0x3b')]));_0x3d8c44[_0x1efa('0x3a')]=_0x3d8c44[_0x1efa('0x3a')][_0x1efa('0x3c')]?_0x3d8c44[_0x1efa('0x3a')]:_0x2a2257['model'];if(_0x5c8368['query'][_0x1efa('0x45')]){_0x3d8c44['include']=[{'all':!![]}];}_0x3d8c44=_['merge']({},_0x3d8c44,_0x5c8368[_0x1efa('0x4a')]);return db[_0x1efa('0x30')]['find'](_0x3d8c44)[_0x1efa('0x28')](handleEntityNotFound(_0x5cd8d1,null))['then'](respondWithResult(_0x5cd8d1,null))[_0x1efa('0x4b')](handleError(_0x5cd8d1,null));};exports[_0x1efa('0x4c')]=function(_0x389edb,_0x1482fd){return db[_0x1efa('0x30')][_0x1efa('0x4c')](_0x389edb['body'],{})['then'](function(_0x3f9d9b){var _0x42e859=_0x389edb[_0x1efa('0x4d')][_0x1efa('0x4e')]({'plain':!![]});if(!_0x42e859)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42e859[_0x1efa('0x4f')]===_0x1efa('0x4d')){var _0x408207=_0x3f9d9b[_0x1efa('0x4e')]({'plain':!![]});var _0xc774c2='OpenchannelQueues';return db[_0x1efa('0x50')][_0x1efa('0x51')]({'where':{'name':_0xc774c2,'userProfileId':_0x42e859[_0x1efa('0x52')]},'raw':!![]})[_0x1efa('0x28')](function(_0x4af0ee){if(_0x4af0ee&&_0x4af0ee[_0x1efa('0x53')]===0x0){return db[_0x1efa('0x2a')][_0x1efa('0x4c')]({'name':_0x408207[_0x1efa('0x2d')],'resourceId':_0x408207['id'],'type':_0x4af0ee[_0x1efa('0x2d')],'sectionId':_0x4af0ee['id']},{})[_0x1efa('0x28')](function(){return _0x3f9d9b;});}else{return _0x3f9d9b;}})['catch'](function(_0x3df7bf){logger[_0x1efa('0x2b')](_0x1efa('0x54'),_0x3df7bf);throw _0x3df7bf;});}return _0x3f9d9b;})[_0x1efa('0x28')](respondWithResult(_0x1482fd,0xc9))['catch'](handleError(_0x1482fd,null));};exports[_0x1efa('0x27')]=function(_0x3d22e1,_0x2b638f){if(_0x3d22e1[_0x1efa('0x55')]['id']){delete _0x3d22e1[_0x1efa('0x55')]['id'];}return db[_0x1efa('0x30')][_0x1efa('0x51')]({'where':{'id':_0x3d22e1[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](handleEntityNotFound(_0x2b638f,null))[_0x1efa('0x28')](saveUpdates(_0x3d22e1['body'],null))[_0x1efa('0x28')](respondWithResult(_0x2b638f,null))[_0x1efa('0x4b')](handleError(_0x2b638f,null));};exports[_0x1efa('0x29')]=function(_0x5c82cc,_0x583948){return db[_0x1efa('0x30')]['find']({'where':{'id':_0x5c82cc[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](handleEntityNotFound(_0x583948,null))['then'](removeEntity(_0x583948,null))['catch'](handleError(_0x583948,null));};exports[_0x1efa('0x56')]=function(_0x7085e3,_0x45a5d9){return db[_0x1efa('0x30')][_0x1efa('0x56')]()[_0x1efa('0x28')](respondWithResult(_0x45a5d9,null))['catch'](handleError(_0x45a5d9,null));};exports[_0x1efa('0x57')]=function(_0x5bb5f4,_0x497e9e,_0x26420e){var _0x54344b={'raw':!![],'where':{}},_0x45aeb3={},_0x33333a;return db[_0x1efa('0x30')][_0x1efa('0x58')]({'where':{'id':_0x5bb5f4['params']['id']}})['then'](handleEntityNotFound(_0x497e9e,null))[_0x1efa('0x28')](function(_0x457ab7){if(_0x457ab7){_0x33333a=_0x457ab7[_0x1efa('0x4e')]({'plain':!![]});_0x45aeb3[_0x1efa('0x39')]=_[_0x1efa('0x36')](db['UserOpenchannelQueue'][_0x1efa('0x31')]);_0x45aeb3['query']=_['keys'](_0x5bb5f4[_0x1efa('0x35')]);_0x45aeb3[_0x1efa('0x37')]=_[_0x1efa('0x38')](_0x45aeb3[_0x1efa('0x39')],_0x45aeb3[_0x1efa('0x35')]);_0x54344b[_0x1efa('0x3a')]=_[_0x1efa('0x38')](_0x45aeb3[_0x1efa('0x39')],qs[_0x1efa('0x3b')](_0x5bb5f4['query'][_0x1efa('0x3b')]));_0x54344b['attributes']=_0x54344b[_0x1efa('0x3a')][_0x1efa('0x3c')]?_0x54344b[_0x1efa('0x3a')]:_0x45aeb3['model'];if(!_0x5bb5f4['query'][_0x1efa('0x3d')](_0x1efa('0x59'))){_0x54344b[_0x1efa('0x22')]=qs[_0x1efa('0x22')](_0x5bb5f4[_0x1efa('0x35')][_0x1efa('0x22')]);_0x54344b[_0x1efa('0x20')]=qs[_0x1efa('0x20')](_0x5bb5f4[_0x1efa('0x35')][_0x1efa('0x20')]);}_0x54344b[_0x1efa('0x3e')]=qs[_0x1efa('0x3f')](_0x5bb5f4['query'][_0x1efa('0x3f')]);_0x54344b[_0x1efa('0x40')]=qs[_0x1efa('0x37')](_[_0x1efa('0x41')](_0x5bb5f4['query'],_0x45aeb3[_0x1efa('0x37')]));_0x54344b[_0x1efa('0x40')]['OpenchannelQueueId']=_0x457ab7['id'];if(_0x5bb5f4[_0x1efa('0x35')][_0x1efa('0x42')]){_0x54344b[_0x1efa('0x40')]=_['merge'](_0x54344b[_0x1efa('0x40')],{'$or':_[_0x1efa('0x34')](_0x54344b[_0x1efa('0x3a')],function(_0x15a97c){var _0x4c9262={};_0x4c9262[_0x15a97c]={'$like':'%'+_0x5bb5f4[_0x1efa('0x35')][_0x1efa('0x42')]+'%'};return _0x4c9262;})});}_0x54344b=_[_0x1efa('0x43')]({},_0x54344b,_0x5bb5f4[_0x1efa('0x4a')]);return db[_0x1efa('0x5a')][_0x1efa('0x46')](_0x54344b);}})['then'](function(_0x427165){if(_0x427165){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x427165,_0x1efa('0x5b')),'role':_0x1efa('0x5c')},'attributes':['id',_0x1efa('0x2d'),_0x1efa('0x5d'),_0x1efa('0x5e'),_0x1efa('0x5f')]});}})[_0x1efa('0x28')](function(_0x56f0ca){if(_0x56f0ca){return{'count':_0x56f0ca[_0x1efa('0x23')],'rows':_['map'](_0x56f0ca[_0x1efa('0x47')],function(_0x470c5a){return{'membername':_0x470c5a[_0x1efa('0x2d')],'UserId':_0x470c5a['id'],'queue_name':_0x33333a[_0x1efa('0x2d')],'OpenchannelQueueId':_0x33333a['id'],'interface':util[_0x1efa('0x60')](_0x1efa('0x61'),_0x1efa('0x62'),_0x470c5a[_0x1efa('0x2d')]),'penalty':0x0,'paused':_0x470c5a['openchannelPause'],'createdAt':_0x470c5a['createdAt'],'updatedAt':_0x470c5a[_0x1efa('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x497e9e,_0x54344b))[_0x1efa('0x4b')](handleError(_0x497e9e,null));};exports[_0x1efa('0x63')]=function(_0x550638,_0x4c0112,_0x427eaa){var _0x40da6f={};var _0x4ef447={};var _0x8cb557;var _0x52806e;return db['OpenchannelQueue'][_0x1efa('0x58')]({'where':{'id':_0x550638[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](handleEntityNotFound(_0x4c0112,null))['then'](function(_0x1d1036){if(_0x1d1036){_0x8cb557=_0x1d1036;_0x4ef447['model']=_['keys'](db[_0x1efa('0x64')][_0x1efa('0x31')]);_0x4ef447[_0x1efa('0x35')]=_[_0x1efa('0x36')](_0x550638[_0x1efa('0x35')]);_0x4ef447[_0x1efa('0x37')]=_[_0x1efa('0x38')](_0x4ef447['model'],_0x4ef447[_0x1efa('0x35')]);_0x40da6f[_0x1efa('0x3a')]=_['intersection'](_0x4ef447['model'],qs[_0x1efa('0x3b')](_0x550638[_0x1efa('0x35')][_0x1efa('0x3b')]));_0x40da6f['attributes']=_0x40da6f[_0x1efa('0x3a')]['length']?_0x40da6f[_0x1efa('0x3a')]:_0x4ef447[_0x1efa('0x39')];_0x40da6f[_0x1efa('0x3e')]=qs[_0x1efa('0x3f')](_0x550638[_0x1efa('0x35')]['sort']);_0x40da6f[_0x1efa('0x40')]=qs[_0x1efa('0x37')](_[_0x1efa('0x41')](_0x550638[_0x1efa('0x35')],_0x4ef447[_0x1efa('0x37')]));if(_0x550638[_0x1efa('0x35')][_0x1efa('0x42')]){_0x40da6f[_0x1efa('0x40')]=_[_0x1efa('0x43')](_0x40da6f[_0x1efa('0x40')],{'$or':_[_0x1efa('0x34')](_0x40da6f['attributes'],function(_0x151604){var _0x20ca99={};_0x20ca99[_0x151604]={'$like':'%'+_0x550638['query'][_0x1efa('0x42')]+'%'};return _0x20ca99;})});}_0x40da6f=_[_0x1efa('0x43')]({},_0x40da6f,_0x550638[_0x1efa('0x4a')]);return _0x8cb557[_0x1efa('0x63')](_0x40da6f);}})[_0x1efa('0x28')](function(_0x30cecd){if(_0x30cecd){_0x52806e=_0x30cecd['length'];if(!_0x550638[_0x1efa('0x35')][_0x1efa('0x3d')](_0x1efa('0x59'))){_0x40da6f[_0x1efa('0x22')]=qs['limit'](_0x550638[_0x1efa('0x35')][_0x1efa('0x22')]);_0x40da6f[_0x1efa('0x20')]=qs[_0x1efa('0x20')](_0x550638['query']['offset']);}return _0x8cb557['getTeams'](_0x40da6f);}})[_0x1efa('0x28')](function(_0x191a51){if(_0x191a51){return _0x191a51?{'count':_0x52806e,'rows':_0x191a51}:null;}})['then'](respondWithResult(_0x4c0112,null))[_0x1efa('0x4b')](handleError(_0x4c0112,null));};exports[_0x1efa('0x65')]=function(_0x4490c9,_0x2a71f0,_0x1fc9aa){var _0x130235=_0x4490c9[_0x1efa('0x55')][_0x1efa('0x66')];return db['Team'][_0x1efa('0x46')]({'where':{'id':_0x130235},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1efa('0x67'),'attributes':['id','name','online',_0x1efa('0x68'),_0x1efa('0x69')],'raw':!![]}]})[_0x1efa('0x28')](function(_0x40b774){if(_0x40b774){var _0x276420=_[_0x1efa('0x6a')](_0x40b774,function(_0x23d093){var _0x58574c=_0x23d093['get']({'plain':!![]});return _0x58574c[_0x1efa('0x67')];});return db['OpenchannelQueue'][_0x1efa('0x51')]({'where':{'id':_0x4490c9[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](function(_0x16fa36){return db[_0x1efa('0x6b')]['transaction'](function(_0x3cd7f9){return _0x16fa36[_0x1efa('0x65')](_0x130235,{'transaction':_0x3cd7f9})[_0x1efa('0x28')](function(){return BPromise[_0x1efa('0x6c')](_0x276420,function(_0x23d51b){return db['UserOpenchannelQueue'][_0x1efa('0x6d')]({'where':{'UserId':_0x23d51b['id'],'OpenchannelQueueId':_0x4490c9[_0x1efa('0x49')]['id']},'transaction':_0x3cd7f9});});})['then'](function(){_0x276420['forEach'](function(_0xd86c7c){socket[_0x1efa('0x6e')](_0x1efa('0x6f'),{'UserId':_0xd86c7c['id'],'OpenchannelQueueId':_0x16fa36['id']});});});});});}})[_0x1efa('0x28')](respondWithStatusCode(_0x2a71f0,null))['catch'](handleError(_0x2a71f0,null));};exports[_0x1efa('0x70')]=function(_0x303e23,_0x29e4c0,_0x4ce868){return db['Team'][_0x1efa('0x46')]({'where':{'id':_0x303e23['query'][_0x1efa('0x66')]},'attributes':['id'],'include':[{'model':db[_0x1efa('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1efa('0x28')](handleEntityNotFound(_0x29e4c0,null))['then'](function(_0x1a48e9){var _0x33385f=_[_0x1efa('0x34')](_0x1a48e9,'id');var _0x2e2de6=[];var _0x1161e3=[];var _0x5f20a8=squel[_0x1efa('0x72')]();_0x5f20a8[_0x1efa('0x73')](_0x1efa('0x74'))[_0x1efa('0x75')](_0x1efa('0x76'),'tq')[_0x1efa('0x77')]('user_has_teams','ut',_0x1efa('0x78'))['where'](_0x1efa('0x79'),_0x303e23[_0x1efa('0x49')]['id']);for(var _0x2af1f8=0x0;_0x2af1f8<_0x1a48e9['length'];_0x2af1f8+=0x1){let _0x20629c=_0x1a48e9[_0x2af1f8];for(var _0x4423ff=0x0;_0x4423ff<_0x20629c[_0x1efa('0x67')]['length'];_0x4423ff+=0x1){let _0x1af491=_0x20629c[_0x1efa('0x67')][_0x4423ff];var _0x4a762a=_0x5f20a8['clone']();_0x4a762a[_0x1efa('0x40')]('ut.UserId\x20=\x20?',_0x1af491['id']);_0x1161e3[_0x1efa('0x7a')](db[_0x1efa('0x6b')][_0x1efa('0x35')](_0x4a762a[_0x1efa('0x7b')](),{'type':db[_0x1efa('0x6b')]['QueryTypes'][_0x1efa('0x7c')]})[_0x1efa('0x28')](function(_0x2555f9){if(_0x2555f9[_0x1efa('0x3c')]===0x1){return _0x1af491['id'];}else{var _0x222ff0=_[_0x1efa('0x7d')](_[_0x1efa('0x34')](_0x2555f9,'TeamId'),function(_0x36569a){return _[_0x1efa('0x7e')](_0x33385f,_0x36569a);});if(_0x222ff0){return _0x1af491['id'];}}}));}}return BPromise[_0x1efa('0x7f')](_0x1161e3)[_0x1efa('0x28')](function(_0xaf2a6e){_0x2e2de6=_(_0x2e2de6)[_0x1efa('0x80')](_0xaf2a6e)[_0x1efa('0x81')]()[_0x1efa('0x82')]();return db[_0x1efa('0x30')]['find']({'where':{'id':_0x303e23['params']['id']}})[_0x1efa('0x28')](function(_0x449654){return db['sequelize'][_0x1efa('0x83')](function(_0x360155){return _0x449654[_0x1efa('0x70')](_0x303e23[_0x1efa('0x35')][_0x1efa('0x66')],{'transaction':_0x360155})[_0x1efa('0x28')](function(){if(!_['isEmpty'](_0x2e2de6)){return _0x449654[_0x1efa('0x84')](_0x2e2de6,{'transaction':_0x360155});}})[_0x1efa('0x28')](function(){_0x2e2de6[_0x1efa('0x85')](function(_0x137bad){socket[_0x1efa('0x6e')](_0x1efa('0x86'),{'UserId':_0x137bad,'OpenchannelQueueId':_0x449654['id']});});});});});});})[_0x1efa('0x28')](respondWithStatusCode(_0x29e4c0,null))[_0x1efa('0x4b')](handleError(_0x29e4c0,null));};exports[_0x1efa('0x87')]=function(_0x34b830,_0x116ba4,_0xf0455e){return db[_0x1efa('0x30')][_0x1efa('0x51')]({'where':{'id':_0x34b830[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](handleEntityNotFound(_0x116ba4,null))[_0x1efa('0x28')](function(_0xced81e){if(_0xced81e){return _0xced81e[_0x1efa('0x87')](_0x34b830[_0x1efa('0x55')][_0x1efa('0x66')],_[_0x1efa('0x88')](_0x34b830[_0x1efa('0x55')],[_0x1efa('0x66'),'id'])||{})[_0x1efa('0x89')](function(_0xe2d998){for(var _0x3a3d85=0x0;_0x3a3d85<_0x34b830[_0x1efa('0x55')][_0x1efa('0x66')][_0x1efa('0x3c')];_0x3a3d85+=0x1){socket[_0x1efa('0x6e')](_0x1efa('0x6f'),{'UserId':Number(_0x34b830[_0x1efa('0x55')]['ids'][_0x3a3d85]),'OpenchannelQueueId':Number(_0x34b830[_0x1efa('0x49')]['id'])});}return _0xe2d998;});}})[_0x1efa('0x28')](respondWithResult(_0x116ba4,null))[_0x1efa('0x4b')](handleError(_0x116ba4,null));};exports[_0x1efa('0x84')]=function(_0x15a828,_0x4c83ca,_0x3e4a2c){return db[_0x1efa('0x30')][_0x1efa('0x51')]({'where':{'id':_0x15a828[_0x1efa('0x49')]['id']}})[_0x1efa('0x28')](handleEntityNotFound(_0x4c83ca,null))['then'](function(_0xaf38e7){if(_0xaf38e7){return _0xaf38e7['removeAgents'](_0x15a828[_0x1efa('0x35')][_0x1efa('0x66')])[_0x1efa('0x28')](function(){if(_['isArray'](_0x15a828[_0x1efa('0x35')]['ids'])){for(var _0x3e91f7=0x0;_0x3e91f7<_0x15a828[_0x1efa('0x35')][_0x1efa('0x66')]['length'];_0x3e91f7+=0x1){socket['emit'](_0x1efa('0x86'),{'UserId':Number(_0x15a828[_0x1efa('0x35')][_0x1efa('0x66')][_0x3e91f7]),'OpenchannelQueueId':Number(_0x15a828[_0x1efa('0x49')]['id'])});}}else{socket[_0x1efa('0x6e')](_0x1efa('0x86'),{'UserId':Number(_0x15a828['query']['ids']),'OpenchannelQueueId':Number(_0x15a828[_0x1efa('0x49')]['id'])});}});}})[_0x1efa('0x28')](respondWithStatusCode(_0x4c83ca,null))['catch'](handleError(_0x4c83ca,null));};exports[_0x1efa('0x8a')]=function(_0x57db96,_0x5ab663,_0x940502){var _0x4bc477={};var _0x128edf={};var _0x372512;var _0x247376;return db['OpenchannelQueue'][_0x1efa('0x58')]({'where':{'id':_0x57db96['params']['id']}})['then'](handleEntityNotFound(_0x5ab663,null))[_0x1efa('0x28')](function(_0x1865e4){if(_0x1865e4){_0x372512=_0x1865e4;_0x128edf[_0x1efa('0x39')]=_[_0x1efa('0x36')](db[_0x1efa('0x71')][_0x1efa('0x31')]);_0x128edf[_0x1efa('0x35')]=_[_0x1efa('0x36')](_0x57db96[_0x1efa('0x35')]);_0x128edf[_0x1efa('0x37')]=_[_0x1efa('0x38')](_0x128edf['model'],_0x128edf[_0x1efa('0x35')]);_0x4bc477[_0x1efa('0x3a')]=_[_0x1efa('0x38')](_0x128edf['model'],qs['fields'](_0x57db96['query'][_0x1efa('0x3b')]));_0x4bc477['attributes']=_0x4bc477[_0x1efa('0x3a')][_0x1efa('0x3c')]?_0x4bc477[_0x1efa('0x3a')]:_0x128edf[_0x1efa('0x39')];_0x4bc477[_0x1efa('0x3e')]=qs[_0x1efa('0x3f')](_0x57db96[_0x1efa('0x35')][_0x1efa('0x3f')]);_0x4bc477['where']=qs[_0x1efa('0x37')](_[_0x1efa('0x41')](_0x57db96['query'],_0x128edf[_0x1efa('0x37')]));if(_0x57db96[_0x1efa('0x35')][_0x1efa('0x42')]){_0x4bc477[_0x1efa('0x40')]=_[_0x1efa('0x43')](_0x4bc477[_0x1efa('0x40')],{'$or':_['map'](_0x4bc477[_0x1efa('0x3a')],function(_0x4df820){var _0x58c85c={};_0x58c85c[_0x4df820]={'$like':'%'+_0x57db96[_0x1efa('0x35')][_0x1efa('0x42')]+'%'};return _0x58c85c;})});}_0x4bc477=_[_0x1efa('0x43')]({},_0x4bc477,_0x57db96[_0x1efa('0x4a')]);return _0x372512['getAgents'](_0x4bc477);}})['then'](function(_0x5ae987){if(_0x5ae987){_0x247376=_0x5ae987[_0x1efa('0x3c')];if(!_0x57db96[_0x1efa('0x35')][_0x1efa('0x3d')](_0x1efa('0x59'))){_0x4bc477[_0x1efa('0x22')]=qs['limit'](_0x57db96['query'][_0x1efa('0x22')]);_0x4bc477[_0x1efa('0x20')]=qs[_0x1efa('0x20')](_0x57db96[_0x1efa('0x35')][_0x1efa('0x20')]);}return _0x372512[_0x1efa('0x8a')](_0x4bc477);}})[_0x1efa('0x28')](function(_0x1cb82b){if(_0x1cb82b){return _0x1cb82b?{'count':_0x247376,'rows':_0x1cb82b}:null;}})[_0x1efa('0x28')](respondWithResult(_0x5ab663,null))[_0x1efa('0x4b')](handleError(_0x5ab663,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e518f00..5303662 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 _0x8a6c=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8a6c,0x6f));var _0xc8a6=function(_0x1c79a7,_0x38220e){_0x1c79a7=_0x1c79a7-0x0;var _0x4de69f=_0x8a6c[_0x1c79a7];return _0x4de69f;};'use strict';var EventEmitter=require(_0xc8a6('0x0'));var OpenchannelQueue=require(_0xc8a6('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc8a6('0x2')](0x0);var events={'afterCreate':_0xc8a6('0x3'),'afterUpdate':_0xc8a6('0x4'),'afterDestroy':_0xc8a6('0x5')};function emitEvent(_0x1a66ef){return function(_0x3e427f,_0x4112cc,_0x368912){OpenchannelQueueEvents[_0xc8a6('0x6')](_0x1a66ef+':'+_0x3e427f['id'],_0x3e427f);OpenchannelQueueEvents[_0xc8a6('0x6')](_0x1a66ef,_0x3e427f);_0x368912(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xc8a6('0x7')](e,emitEvent(event));}}module[_0xc8a6('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x07f4=['exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x47b51a,_0x348e65){var _0x4dff98=function(_0x1fe588){while(--_0x1fe588){_0x47b51a['push'](_0x47b51a['shift']());}};_0x4dff98(++_0x348e65);}(_0x07f4,0x1e9));var _0x407f=function(_0x47bfac,_0x1302ec){_0x47bfac=_0x47bfac-0x0;var _0x498479=_0x07f4[_0x47bfac];return _0x498479;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x407f('0x0'))['db'][_0x407f('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x407f('0x2')](0x0);var events={'afterCreate':_0x407f('0x3'),'afterUpdate':_0x407f('0x4'),'afterDestroy':_0x407f('0x5')};function emitEvent(_0xd79c03){return function(_0xff3e13,_0x5b5944,_0x389cc0){OpenchannelQueueEvents[_0x407f('0x6')](_0xd79c03+':'+_0xff3e13['id'],_0xff3e13);OpenchannelQueueEvents[_0x407f('0x6')](_0xd79c03,_0xff3e13);_0x389cc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x407f('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index fe85c6a..0e722a0 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 _0x188c=['define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x188c,0xc9));var _0xc188=function(_0x37a416,_0x14ee6a){_0x37a416=_0x37a416-0x0;var _0x47959e=_0x188c[_0x37a416];return _0x47959e;};'use strict';var _=require(_0xc188('0x0'));var util=require('util');var logger=require(_0xc188('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc188('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc188('0x3'));var rimraf=require(_0xc188('0x4'));var config=require(_0xc188('0x5'));var attributes=require(_0xc188('0x6'));module[_0xc188('0x7')]=function(_0xb174a7,_0x40093c){return _0xb174a7[_0xc188('0x8')](_0xc188('0x9'),attributes,{'tableName':_0xc188('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x283e=['OpenchannelQueue','openchannel_queues','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x283e,0x6e));var _0xe283=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x283e[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe283('0x0'));var logger=require(_0xe283('0x1'))('api');var moment=require(_0xe283('0x2'));var BPromise=require(_0xe283('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe283('0x4'));var rimraf=require(_0xe283('0x5'));var config=require(_0xe283('0x6'));var attributes=require(_0xe283('0x7'));module[_0xe283('0x8')]=function(_0xec432a,_0x2af5d4){return _0xec432a[_0xe283('0x9')](_0xe283('0xa'),attributes,{'tableName':_0xe283('0xb'),'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 de4d8b2..5b09dad 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 _0xc2a8=['map','model','debug','catch','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetOpenchannelQueue','findAll','options','raw','where','attributes','include'];(function(_0x9f7d4c,_0x28ddbd){var _0x541c20=function(_0x5f0807){while(--_0x5f0807){_0x9f7d4c['push'](_0x9f7d4c['shift']());}};_0x541c20(++_0x28ddbd);}(_0xc2a8,0xfd));var _0x8c2a=function(_0x32342e,_0x384a7e){_0x32342e=_0x32342e-0x0;var _0x46ec89=_0xc2a8[_0x32342e];return _0x46ec89;};'use strict';var _=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var moment=require(_0x8c2a('0x2'));var BPromise=require(_0x8c2a('0x3'));var rs=require(_0x8c2a('0x4'));var fs=require('fs');var Redis=require(_0x8c2a('0x5'));var db=require(_0x8c2a('0x6'))['db'];var utils=require(_0x8c2a('0x7'));var logger=require(_0x8c2a('0x8'))(_0x8c2a('0x9'));var config=require(_0x8c2a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8c2a('0xb')]({'port':0x232a});config['redis']=_[_0x8c2a('0xc')](config[_0x8c2a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c2a('0xe'))(new Redis(config[_0x8c2a('0xd')]));require('./openchannelQueue.socket')[_0x8c2a('0xf')](socket);function respondWithRpcPromise(_0x42cc36,_0x5c67bb,_0x4608ac){return new BPromise(function(_0x2af91d,_0x2bbbed){return client[_0x8c2a('0x10')](_0x42cc36,_0x4608ac)[_0x8c2a('0x11')](function(_0x3c06ce){logger['info'](_0x8c2a('0x12'),_0x5c67bb,_0x8c2a('0x13'));logger['debug'](_0x8c2a('0x14'),_0x5c67bb,_0x8c2a('0x13'),JSON[_0x8c2a('0x15')](_0x3c06ce));if(_0x3c06ce[_0x8c2a('0x16')]){if(_0x3c06ce[_0x8c2a('0x16')][_0x8c2a('0x17')]===0x1f4){logger['error'](_0x8c2a('0x12'),_0x5c67bb,_0x3c06ce['error'][_0x8c2a('0x18')]);return _0x2bbbed(_0x3c06ce['error'][_0x8c2a('0x18')]);}logger[_0x8c2a('0x16')](_0x8c2a('0x12'),_0x5c67bb,_0x3c06ce[_0x8c2a('0x16')][_0x8c2a('0x18')]);return _0x2af91d(_0x3c06ce['error'][_0x8c2a('0x18')]);}else{logger[_0x8c2a('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x5c67bb,_0x8c2a('0x13'));_0x2af91d(_0x3c06ce[_0x8c2a('0x1a')][_0x8c2a('0x18')]);}})['catch'](function(_0x36214){logger[_0x8c2a('0x16')](_0x8c2a('0x12'),_0x5c67bb,_0x36214);_0x2bbbed(_0x36214);});});}exports[_0x8c2a('0x1b')]=function(_0x333a31){var _0x2181ca=this;return new Promise(function(_0x36963f,_0xda49da){return db['OpenchannelQueue'][_0x8c2a('0x1c')]({'raw':_0x333a31[_0x8c2a('0x1d')]?_0x333a31[_0x8c2a('0x1d')][_0x8c2a('0x1e')]===undefined?!![]:![]:!![],'where':_0x333a31[_0x8c2a('0x1d')]?_0x333a31['options'][_0x8c2a('0x1f')]||null:null,'attributes':_0x333a31[_0x8c2a('0x1d')]?_0x333a31['options'][_0x8c2a('0x20')]||null:null,'limit':_0x333a31[_0x8c2a('0x1d')]?_0x333a31[_0x8c2a('0x1d')]['limit']||null:null,'include':_0x333a31['options']?_0x333a31[_0x8c2a('0x1d')][_0x8c2a('0x21')]?_[_0x8c2a('0x22')](_0x333a31['options'][_0x8c2a('0x21')],function(_0x12be52){return{'model':db[_0x12be52['model']],'as':_0x12be52['as'],'attributes':_0x12be52[_0x8c2a('0x20')],'include':_0x12be52['include']?_[_0x8c2a('0x22')](_0x12be52[_0x8c2a('0x21')],function(_0x40a45c){return{'model':db[_0x40a45c['model']],'as':_0x40a45c['as'],'attributes':_0x40a45c[_0x8c2a('0x20')],'include':_0x40a45c[_0x8c2a('0x21')]?_[_0x8c2a('0x22')](_0x40a45c[_0x8c2a('0x21')],function(_0x44825a){return{'model':db[_0x44825a[_0x8c2a('0x23')]],'as':_0x44825a['as'],'attributes':_0x44825a[_0x8c2a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8c2a('0x11')](function(_0x106dfb){logger[_0x8c2a('0x19')](_0x8c2a('0x1b'),_0x333a31);logger[_0x8c2a('0x24')](_0x8c2a('0x1b'),_0x333a31,JSON[_0x8c2a('0x15')](_0x106dfb));_0x36963f(_0x106dfb);})[_0x8c2a('0x25')](function(_0x26f8da){logger[_0x8c2a('0x16')](_0x8c2a('0x1b'),_0x26f8da['message'],_0x333a31);_0xda49da(_0x2181ca['error'](0x1f4,_0x26f8da[_0x8c2a('0x18')]));});});};exports[_0x8c2a('0x26')]=function(_0xe0480b){var _0x4f704c=this;return new Promise(function(_0x3ccdf7,_0x50efc9){return db[_0x8c2a('0x27')][_0x8c2a('0x28')]({'raw':_0xe0480b[_0x8c2a('0x1d')]?_0xe0480b[_0x8c2a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xe0480b['options']?_0xe0480b[_0x8c2a('0x1d')][_0x8c2a('0x1f')]||null:null,'attributes':_0xe0480b[_0x8c2a('0x1d')]?_0xe0480b[_0x8c2a('0x1d')][_0x8c2a('0x20')]||null:null,'include':_0xe0480b[_0x8c2a('0x1d')]?_0xe0480b[_0x8c2a('0x1d')][_0x8c2a('0x21')]?_[_0x8c2a('0x22')](_0xe0480b[_0x8c2a('0x1d')][_0x8c2a('0x21')],function(_0x3f683e){return{'model':db[_0x3f683e[_0x8c2a('0x23')]],'as':_0x3f683e['as'],'attributes':_0x3f683e[_0x8c2a('0x20')],'include':_0x3f683e[_0x8c2a('0x21')]?_['map'](_0x3f683e['include'],function(_0x52fcaf){return{'model':db[_0x52fcaf[_0x8c2a('0x23')]],'as':_0x52fcaf['as'],'attributes':_0x52fcaf[_0x8c2a('0x20')],'include':_0x52fcaf[_0x8c2a('0x21')]?_[_0x8c2a('0x22')](_0x52fcaf[_0x8c2a('0x21')],function(_0x1dd90c){return{'model':db[_0x1dd90c[_0x8c2a('0x23')]],'as':_0x1dd90c['as'],'attributes':_0x1dd90c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c2a('0x11')](function(_0x17d91a){logger[_0x8c2a('0x19')]('ShowOpenchannelQueue',_0xe0480b);logger[_0x8c2a('0x24')](_0x8c2a('0x26'),_0xe0480b,JSON['stringify'](_0x17d91a));_0x3ccdf7(_0x17d91a);})['catch'](function(_0x8241f7){logger[_0x8c2a('0x16')](_0x8c2a('0x26'),_0x8241f7['message'],_0xe0480b);_0x50efc9(_0x4f704c[_0x8c2a('0x16')](0x1f4,_0x8241f7[_0x8c2a('0x18')]));});});}; \ No newline at end of file +var _0xbec8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','lodash','moment'];(function(_0x3cf21d,_0x5b9d27){var _0x144502=function(_0x3b37e2){while(--_0x3b37e2){_0x3cf21d['push'](_0x3cf21d['shift']());}};_0x144502(++_0x5b9d27);}(_0xbec8,0xee));var _0x8bec=function(_0x3cdf50,_0x3e8eb2){_0x3cdf50=_0x3cdf50-0x0;var _0x22d47a=_0xbec8[_0x3cdf50];return _0x22d47a;};'use strict';var _=require(_0x8bec('0x0'));var util=require('util');var moment=require(_0x8bec('0x1'));var BPromise=require(_0x8bec('0x2'));var rs=require(_0x8bec('0x3'));var fs=require('fs');var Redis=require(_0x8bec('0x4'));var db=require(_0x8bec('0x5'))['db'];var utils=require(_0x8bec('0x6'));var logger=require(_0x8bec('0x7'))('rpc');var config=require(_0x8bec('0x8'));var jayson=require(_0x8bec('0x9'));var client=jayson[_0x8bec('0xa')][_0x8bec('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8bec('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bec('0xc')]));require(_0x8bec('0xd'))[_0x8bec('0xe')](socket);function respondWithRpcPromise(_0x2e0c6a,_0x1470af,_0x1b289c){return new BPromise(function(_0x1818eb,_0x535c87){return client[_0x8bec('0xf')](_0x2e0c6a,_0x1b289c)[_0x8bec('0x10')](function(_0x338497){logger[_0x8bec('0x11')](_0x8bec('0x12'),_0x1470af,'request\x20sent');logger[_0x8bec('0x13')](_0x8bec('0x14'),_0x1470af,'request\x20sent',JSON[_0x8bec('0x15')](_0x338497));if(_0x338497[_0x8bec('0x16')]){if(_0x338497[_0x8bec('0x16')][_0x8bec('0x17')]===0x1f4){logger[_0x8bec('0x16')](_0x8bec('0x12'),_0x1470af,_0x338497['error'][_0x8bec('0x18')]);return _0x535c87(_0x338497[_0x8bec('0x16')][_0x8bec('0x18')]);}logger[_0x8bec('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1470af,_0x338497['error'][_0x8bec('0x18')]);return _0x1818eb(_0x338497[_0x8bec('0x16')][_0x8bec('0x18')]);}else{logger[_0x8bec('0x11')](_0x8bec('0x12'),_0x1470af,_0x8bec('0x19'));_0x1818eb(_0x338497['result'][_0x8bec('0x18')]);}})[_0x8bec('0x1a')](function(_0x356c63){logger[_0x8bec('0x16')](_0x8bec('0x12'),_0x1470af,_0x356c63);_0x535c87(_0x356c63);});});}exports[_0x8bec('0x1b')]=function(_0xbdae3f){var _0x3a208e=this;return new Promise(function(_0x5ecc82,_0xac9b47){return db[_0x8bec('0x1c')][_0x8bec('0x1d')]({'raw':_0xbdae3f[_0x8bec('0x1e')]?_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x1f')]===undefined?!![]:![]:!![],'where':_0xbdae3f[_0x8bec('0x1e')]?_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x20')]||null:null,'attributes':_0xbdae3f['options']?_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x21')]||null:null,'limit':_0xbdae3f[_0x8bec('0x1e')]?_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x22')]||null:null,'include':_0xbdae3f[_0x8bec('0x1e')]?_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x23')]?_[_0x8bec('0x24')](_0xbdae3f[_0x8bec('0x1e')][_0x8bec('0x23')],function(_0x578560){return{'model':db[_0x578560[_0x8bec('0x25')]],'as':_0x578560['as'],'attributes':_0x578560[_0x8bec('0x21')],'include':_0x578560[_0x8bec('0x23')]?_[_0x8bec('0x24')](_0x578560[_0x8bec('0x23')],function(_0x31164e){return{'model':db[_0x31164e['model']],'as':_0x31164e['as'],'attributes':_0x31164e[_0x8bec('0x21')],'include':_0x31164e[_0x8bec('0x23')]?_[_0x8bec('0x24')](_0x31164e['include'],function(_0x25c812){return{'model':db[_0x25c812['model']],'as':_0x25c812['as'],'attributes':_0x25c812[_0x8bec('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8bec('0x10')](function(_0x558a4b){logger[_0x8bec('0x11')]('GetOpenchannelQueue',_0xbdae3f);logger['debug'](_0x8bec('0x1b'),_0xbdae3f,JSON[_0x8bec('0x15')](_0x558a4b));_0x5ecc82(_0x558a4b);})[_0x8bec('0x1a')](function(_0x125fe8){logger['error'](_0x8bec('0x1b'),_0x125fe8[_0x8bec('0x18')],_0xbdae3f);_0xac9b47(_0x3a208e['error'](0x1f4,_0x125fe8[_0x8bec('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x14f754){var _0x1868e3=this;return new Promise(function(_0x11a0bf,_0x4d9f70){return db[_0x8bec('0x1c')][_0x8bec('0x26')]({'raw':_0x14f754[_0x8bec('0x1e')]?_0x14f754[_0x8bec('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x14f754[_0x8bec('0x1e')]?_0x14f754[_0x8bec('0x1e')]['where']||null:null,'attributes':_0x14f754['options']?_0x14f754[_0x8bec('0x1e')]['attributes']||null:null,'include':_0x14f754[_0x8bec('0x1e')]?_0x14f754[_0x8bec('0x1e')][_0x8bec('0x23')]?_[_0x8bec('0x24')](_0x14f754['options']['include'],function(_0x57c226){return{'model':db[_0x57c226[_0x8bec('0x25')]],'as':_0x57c226['as'],'attributes':_0x57c226[_0x8bec('0x21')],'include':_0x57c226[_0x8bec('0x23')]?_['map'](_0x57c226[_0x8bec('0x23')],function(_0x3a69e3){return{'model':db[_0x3a69e3[_0x8bec('0x25')]],'as':_0x3a69e3['as'],'attributes':_0x3a69e3[_0x8bec('0x21')],'include':_0x3a69e3[_0x8bec('0x23')]?_[_0x8bec('0x24')](_0x3a69e3['include'],function(_0x1a1050){return{'model':db[_0x1a1050[_0x8bec('0x25')]],'as':_0x1a1050['as'],'attributes':_0x1a1050[_0x8bec('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11aba0){logger['info'](_0x8bec('0x27'),_0x14f754);logger[_0x8bec('0x13')](_0x8bec('0x27'),_0x14f754,JSON[_0x8bec('0x15')](_0x11aba0));_0x11a0bf(_0x11aba0);})[_0x8bec('0x1a')](function(_0x54a93e){logger[_0x8bec('0x16')]('ShowOpenchannelQueue',_0x54a93e[_0x8bec('0x18')],_0x14f754);_0x4d9f70(_0x1868e3['error'](0x1f4,_0x54a93e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 954fea9..980b06b 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 _0x1cbe=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x4866fd,_0x476258){var _0xd5beca=function(_0x3b24fe){while(--_0x3b24fe){_0x4866fd['push'](_0x4866fd['shift']());}};_0xd5beca(++_0x476258);}(_0x1cbe,0x1c9));var _0xe1cb=function(_0x151b38,_0x170ba3){_0x151b38=_0x151b38-0x0;var _0x204c86=_0x1cbe[_0x151b38];return _0x204c86;};'use strict';var OpenchannelQueueEvents=require(_0xe1cb('0x0'));var events=[_0xe1cb('0x1'),_0xe1cb('0x2'),_0xe1cb('0x3')];function createListener(_0x1c53fd,_0x5d1343){return function(_0x48fe25){_0x5d1343[_0xe1cb('0x4')](_0x1c53fd,_0x48fe25);};}function removeListener(_0x5e4ae8,_0x2bd473){return function(){OpenchannelQueueEvents[_0xe1cb('0x5')](_0x5e4ae8,_0x2bd473);};}exports[_0xe1cb('0x6')]=function(_0x2b6c08){for(var _0x2d10d2=0x0,_0x467e99=events[_0xe1cb('0x7')];_0x2d10d2<_0x467e99;_0x2d10d2++){var _0x1860ee=events[_0x2d10d2];var _0x6190e5=createListener(_0xe1cb('0x8')+_0x1860ee,_0x2b6c08);OpenchannelQueueEvents['on'](_0x1860ee,_0x6190e5);}}; \ No newline at end of file +var _0x374e=['update','emit','removeListener','register','length','openchannelQueue:','save','remove'];(function(_0x318b2e,_0x41e795){var _0x3609bd=function(_0x4d2423){while(--_0x4d2423){_0x318b2e['push'](_0x318b2e['shift']());}};_0x3609bd(++_0x41e795);}(_0x374e,0x146));var _0xe374=function(_0x571d3a,_0x340d31){_0x571d3a=_0x571d3a-0x0;var _0x5c40e4=_0x374e[_0x571d3a];return _0x5c40e4;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xe374('0x0'),_0xe374('0x1'),_0xe374('0x2')];function createListener(_0x340a31,_0x5e5030){return function(_0x5582ac){_0x5e5030[_0xe374('0x3')](_0x340a31,_0x5582ac);};}function removeListener(_0x2625cb,_0x30d00d){return function(){OpenchannelQueueEvents[_0xe374('0x4')](_0x2625cb,_0x30d00d);};}exports[_0xe374('0x5')]=function(_0x33f5d2){for(var _0x9e2c2e=0x0,_0x301861=events[_0xe374('0x6')];_0x9e2c2e<_0x301861;_0x9e2c2e++){var _0x924214=events[_0x9e2c2e];var _0x2c1f4d=createListener(_0xe374('0x7')+_0x924214,_0x33f5d2);OpenchannelQueueEvents['on'](_0x924214,_0x2c1f4d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 45f6490..5e34f8a 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 _0x7524=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x314c1d,_0x3fba0c){var _0x511529=function(_0xf49646){while(--_0xf49646){_0x314c1d['push'](_0x314c1d['shift']());}};_0x511529(++_0x3fba0c);}(_0x7524,0xc1));var _0x4752=function(_0x14444f,_0x3ea23e){_0x14444f=_0x14444f-0x0;var _0x9c37b3=_0x7524[_0x14444f];return _0x9c37b3;};'use strict';var multer=require(_0x4752('0x0'));var util=require(_0x4752('0x1'));var path=require(_0x4752('0x2'));var timeout=require(_0x4752('0x3'));var express=require(_0x4752('0x4'));var router=express[_0x4752('0x5')]();var fs_extra=require(_0x4752('0x6'));var auth=require(_0x4752('0x7'));var interaction=require(_0x4752('0x8'));var config=require(_0x4752('0x9'));var controller=require(_0x4752('0xa'));router[_0x4752('0xb')]('/',auth[_0x4752('0xc')](),controller[_0x4752('0xd')]);router[_0x4752('0xb')](_0x4752('0xe'),auth[_0x4752('0xc')](),controller[_0x4752('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4752('0x10')]);router[_0x4752('0x11')]('/',auth[_0x4752('0xc')](),controller[_0x4752('0x12')]);router[_0x4752('0x13')](_0x4752('0x14'),auth[_0x4752('0xc')](),controller[_0x4752('0x15')]);router[_0x4752('0x16')]('/:id',auth[_0x4752('0xc')](),controller['destroy']);module[_0x4752('0x17')]=router; \ No newline at end of file +var _0xa5be=['describe','/:id','show','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xa5be,0x106));var _0xea5b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa5be[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea5b('0x0'));var timeout=require('connect-timeout');var express=require(_0xea5b('0x1'));var router=express[_0xea5b('0x2')]();var fs_extra=require(_0xea5b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xea5b('0x4'));var config=require(_0xea5b('0x5'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0xea5b('0x6')](),controller[_0xea5b('0x7')]);router[_0xea5b('0x8')](_0xea5b('0x9'),auth['isAuthenticated'](),controller[_0xea5b('0xa')]);router['get'](_0xea5b('0xb'),auth['isAuthenticated'](),controller[_0xea5b('0xc')]);router['post']('/',auth[_0xea5b('0x6')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xea5b('0xd')]);router[_0xea5b('0xe')](_0xea5b('0xb'),auth[_0xea5b('0x6')](),controller[_0xea5b('0xf')]);module[_0xea5b('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 6aab896..e069ed3 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 _0x9e6b=['STRING','moment','sequelize'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x9e6b,0x76));var _0xb9e6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9e6b[_0x53ccf2];return _0x5a2964;};'use strict';var moment=require(_0xb9e6('0x0'));var Sequelize=require(_0xb9e6('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9e6('0x2')]}}; \ No newline at end of file +var _0xd341=['sequelize','exports','STRING','DATE','moment'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xd341,0x1a3));var _0x1d34=function(_0x3edd5a,_0x4e9b1a){_0x3edd5a=_0x3edd5a-0x0;var _0x348657=_0xd341[_0x3edd5a];return _0x348657;};'use strict';var moment=require(_0x1d34('0x0'));var Sequelize=require(_0x1d34('0x1'));module[_0x1d34('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1d34('0x3')]},'joinAt':{'type':Sequelize[_0x1d34('0x4')]},'leaveAt':{'type':Sequelize[_0x1d34('0x4')]},'acceptAt':{'type':Sequelize[_0x1d34('0x4')]},'exitAt':{'type':Sequelize[_0x1d34('0x4')]},'reason':{'type':Sequelize[_0x1d34('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 15e9145..27d58f0 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 _0x3df3=['include','findAll','rows','show','params','intersection','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x215775,_0x15bc76){var _0x2c189d=function(_0x287040){while(--_0x287040){_0x215775['push'](_0x215775['shift']());}};_0x2c189d(++_0x15bc76);}(_0x3df3,0x132));var _0x33df=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0x3df3[_0x5bd1a9];return _0x2ba345;};'use strict';var emlformat=require(_0x33df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33df('0x1'));var jsonpatch=require(_0x33df('0x2'));var rp=require('request-promise');var moment=require(_0x33df('0x3'));var BPromise=require(_0x33df('0x4'));var Mustache=require(_0x33df('0x5'));var util=require(_0x33df('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x33df('0x7'));var fs=require('fs');var fs_extra=require(_0x33df('0x8'));var _=require(_0x33df('0x9'));var squel=require(_0x33df('0xa'));var crypto=require(_0x33df('0xb'));var jsforce=require(_0x33df('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33df('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x33df('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x33df('0xf'));var as=require(_0x33df('0x10'));var hardwareService=require(_0x33df('0x11'));var logger=require(_0x33df('0x12'))(_0x33df('0x13'));var utils=require(_0x33df('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x33df('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe8d6e8,_0xcef44d){_0xcef44d=_0xcef44d||0xcc;return function(_0xeeb41a){if(_0xeeb41a){return _0xe8d6e8[_0x33df('0x16')](_0xcef44d);}return _0xe8d6e8[_0x33df('0x17')](_0xcef44d)[_0x33df('0x18')]();};}function respondWithResult(_0x2ac0ee,_0x2f07b5){_0x2f07b5=_0x2f07b5||0xc8;return function(_0x39125a){if(_0x39125a){return _0x2ac0ee[_0x33df('0x17')](_0x2f07b5)['json'](_0x39125a);}};}function respondWithFilteredResult(_0x5b04f3,_0x53ca1b){return function(_0x51b1de){if(_0x51b1de){var _0x409800=typeof _0x53ca1b[_0x33df('0x19')]===_0x33df('0x1a')&&typeof _0x53ca1b[_0x33df('0x1b')]===_0x33df('0x1a');var _0x481548=_0x51b1de[_0x33df('0x1c')];var _0x43b1cb=_0x409800?0x0:_0x53ca1b[_0x33df('0x19')];var _0x2b5236=_0x409800?_0x51b1de[_0x33df('0x1c')]:_0x53ca1b[_0x33df('0x19')]+_0x53ca1b[_0x33df('0x1b')];var _0x5976de;if(_0x2b5236>=_0x481548){_0x2b5236=_0x481548;_0x5976de=0xc8;}else{_0x5976de=0xce;}_0x5b04f3[_0x33df('0x17')](_0x5976de);return _0x5b04f3[_0x33df('0x1d')](_0x33df('0x1e'),_0x43b1cb+'-'+_0x2b5236+'/'+_0x481548)[_0x33df('0x1f')](_0x51b1de);}return null;};}function patchUpdates(_0x26c5c3){return function(_0x44aadc){try{jsonpatch[_0x33df('0x20')](_0x44aadc,_0x26c5c3,!![]);}catch(_0x30e240){return BPromise[_0x33df('0x21')](_0x30e240);}return _0x44aadc[_0x33df('0x22')]();};}function saveUpdates(_0x2b3edb,_0x32667b){return function(_0x28e3b8){if(_0x28e3b8){return _0x28e3b8[_0x33df('0x23')](_0x2b3edb)[_0x33df('0x24')](function(_0x280bf7){return _0x280bf7;});}return null;};}function removeEntity(_0x3a58d7,_0x2917b6){return function(_0x2c707a){if(_0x2c707a){return _0x2c707a[_0x33df('0x25')]()[_0x33df('0x24')](function(){_0x3a58d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc245,_0x5ebd34){return function(_0x299404){if(!_0x299404){_0x2dc245[_0x33df('0x16')](0x194);}return _0x299404;};}function handleError(_0x2f53ab,_0x1d99f2){_0x1d99f2=_0x1d99f2||0x1f4;return function(_0x4aaef6){logger[_0x33df('0x26')](_0x4aaef6[_0x33df('0x27')]);if(_0x4aaef6['name']){delete _0x4aaef6['name'];}_0x2f53ab[_0x33df('0x17')](_0x1d99f2)[_0x33df('0x28')](_0x4aaef6);};}exports['index']=function(_0x24c7ab,_0x235c23){var _0x5ac3ec={},_0x4b2f2b={},_0x2967ca={'count':0x0,'rows':[]};var _0x26c310=_[_0x33df('0x29')](db[_0x33df('0x2a')][_0x33df('0x2b')],function(_0x357e52){return{'name':_0x357e52[_0x33df('0x2c')],'type':_0x357e52[_0x33df('0x2d')]['key']};});_0x4b2f2b[_0x33df('0x2e')]=_[_0x33df('0x29')](_0x26c310,'name');_0x4b2f2b['query']=_[_0x33df('0x2f')](_0x24c7ab[_0x33df('0x30')]);_0x4b2f2b['filters']=_['intersection'](_0x4b2f2b['model'],_0x4b2f2b[_0x33df('0x30')]);_0x5ac3ec[_0x33df('0x31')]=_['intersection'](_0x4b2f2b[_0x33df('0x2e')],qs[_0x33df('0x32')](_0x24c7ab[_0x33df('0x30')][_0x33df('0x32')]));_0x5ac3ec[_0x33df('0x31')]=_0x5ac3ec[_0x33df('0x31')][_0x33df('0x33')]?_0x5ac3ec['attributes']:_0x4b2f2b[_0x33df('0x2e')];if(!_0x24c7ab['query'][_0x33df('0x34')](_0x33df('0x35'))){_0x5ac3ec[_0x33df('0x1b')]=qs[_0x33df('0x1b')](_0x24c7ab[_0x33df('0x30')]['limit']);_0x5ac3ec['offset']=qs[_0x33df('0x19')](_0x24c7ab[_0x33df('0x30')][_0x33df('0x19')]);}_0x5ac3ec[_0x33df('0x36')]=qs['sort'](_0x24c7ab[_0x33df('0x30')]['sort']);_0x5ac3ec[_0x33df('0x37')]=qs[_0x33df('0x38')](_[_0x33df('0x39')](_0x24c7ab[_0x33df('0x30')],_0x4b2f2b['filters']),_0x26c310);if(_0x24c7ab[_0x33df('0x30')][_0x33df('0x3a')]){_0x5ac3ec[_0x33df('0x37')]=_[_0x33df('0x3b')](_0x5ac3ec[_0x33df('0x37')],{'$or':_[_0x33df('0x29')](_0x26c310,function(_0x16205b){if(_0x16205b[_0x33df('0x2d')]!==_0x33df('0x3c')){var _0x58f490={};_0x58f490[_0x16205b[_0x33df('0x3d')]]={'$like':'%'+_0x24c7ab['query']['filter']+'%'};return _0x58f490;}})});}_0x5ac3ec=_['merge']({},_0x5ac3ec,_0x24c7ab[_0x33df('0x3e')]);var _0x2ad079={'where':_0x5ac3ec[_0x33df('0x37')]};return db['OpenchannelQueueReport']['count'](_0x2ad079)['then'](function(_0x81f24d){_0x2967ca['count']=_0x81f24d;if(_0x24c7ab[_0x33df('0x30')][_0x33df('0x3f')]){_0x5ac3ec[_0x33df('0x40')]=[{'all':!![]}];}return db[_0x33df('0x2a')][_0x33df('0x41')](_0x5ac3ec);})[_0x33df('0x24')](function(_0x1d4a6e){_0x2967ca[_0x33df('0x42')]=_0x1d4a6e;return _0x2967ca;})[_0x33df('0x24')](respondWithFilteredResult(_0x235c23,_0x5ac3ec))['catch'](handleError(_0x235c23,null));};exports[_0x33df('0x43')]=function(_0x303573,_0x53ea65){var _0x3c28fe={'raw':!![],'where':{'id':_0x303573[_0x33df('0x44')]['id']}},_0x4cf3ad={};_0x4cf3ad['model']=_[_0x33df('0x2f')](db[_0x33df('0x2a')][_0x33df('0x2b')]);_0x4cf3ad[_0x33df('0x30')]=_[_0x33df('0x2f')](_0x303573[_0x33df('0x30')]);_0x4cf3ad[_0x33df('0x38')]=_['intersection'](_0x4cf3ad[_0x33df('0x2e')],_0x4cf3ad[_0x33df('0x30')]);_0x3c28fe[_0x33df('0x31')]=_[_0x33df('0x45')](_0x4cf3ad['model'],qs[_0x33df('0x32')](_0x303573[_0x33df('0x30')]['fields']));_0x3c28fe[_0x33df('0x31')]=_0x3c28fe[_0x33df('0x31')][_0x33df('0x33')]?_0x3c28fe['attributes']:_0x4cf3ad[_0x33df('0x2e')];if(_0x303573[_0x33df('0x30')][_0x33df('0x3f')]){_0x3c28fe[_0x33df('0x40')]=[{'all':!![]}];}_0x3c28fe=_[_0x33df('0x3b')]({},_0x3c28fe,_0x303573[_0x33df('0x3e')]);return db[_0x33df('0x2a')]['find'](_0x3c28fe)[_0x33df('0x24')](handleEntityNotFound(_0x53ea65,null))[_0x33df('0x24')](respondWithResult(_0x53ea65,null))[_0x33df('0x46')](handleError(_0x53ea65,null));};exports['create']=function(_0x47a37d,_0x364f12){return db['OpenchannelQueueReport'][_0x33df('0x47')](_0x47a37d[_0x33df('0x48')],{})[_0x33df('0x24')](respondWithResult(_0x364f12,0xc9))['catch'](handleError(_0x364f12,null));};exports[_0x33df('0x23')]=function(_0x4ce630,_0x4184a8){if(_0x4ce630[_0x33df('0x48')]['id']){delete _0x4ce630[_0x33df('0x48')]['id'];}return db[_0x33df('0x2a')]['find']({'where':{'id':_0x4ce630[_0x33df('0x44')]['id']}})[_0x33df('0x24')](handleEntityNotFound(_0x4184a8,null))[_0x33df('0x24')](saveUpdates(_0x4ce630[_0x33df('0x48')],null))[_0x33df('0x24')](respondWithResult(_0x4184a8,null))[_0x33df('0x46')](handleError(_0x4184a8,null));};exports[_0x33df('0x25')]=function(_0x49b38f,_0x2daaec){return db[_0x33df('0x2a')][_0x33df('0x49')]({'where':{'id':_0x49b38f[_0x33df('0x44')]['id']}})['then'](handleEntityNotFound(_0x2daaec,null))[_0x33df('0x24')](removeEntity(_0x2daaec,null))[_0x33df('0x46')](handleError(_0x2daaec,null));};exports['describe']=function(_0x20f074,_0xf7bd3c){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0xf7bd3c,null))[_0x33df('0x46')](handleError(_0xf7bd3c,null));}; \ No newline at end of file +var _0x18ee=['limit','count','apply','save','update','destroy','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x27a457,_0x120bf4){var _0x1211eb=function(_0x577d53){while(--_0x577d53){_0x27a457['push'](_0x27a457['shift']());}};_0x1211eb(++_0x120bf4);}(_0x18ee,0x10b));var _0xe18e=function(_0x1a7c9b,_0x2e45d0){_0x1a7c9b=_0x1a7c9b-0x0;var _0x5b433f=_0x18ee[_0x1a7c9b];return _0x5b433f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe18e('0x0'));var zipdir=require(_0xe18e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe18e('0x2'));var moment=require(_0xe18e('0x3'));var BPromise=require(_0xe18e('0x4'));var Mustache=require(_0xe18e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe18e('0x6'));var csv=require(_0xe18e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe18e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe18e('0x9'));var deskjs=require(_0xe18e('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe18e('0xb'));var Papa=require(_0xe18e('0xc'));var Redis=require(_0xe18e('0xd'));var authService=require(_0xe18e('0xe'));var qs=require(_0xe18e('0xf'));var as=require(_0xe18e('0x10'));var hardwareService=require(_0xe18e('0x11'));var logger=require(_0xe18e('0x12'))(_0xe18e('0x13'));var utils=require(_0xe18e('0x14'));var config=require(_0xe18e('0x15'));var licenseUtil=require(_0xe18e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24d51f,_0x117488){_0x117488=_0x117488||0xcc;return function(_0xb75cf1){if(_0xb75cf1){return _0x24d51f[_0xe18e('0x17')](_0x117488);}return _0x24d51f[_0xe18e('0x18')](_0x117488)[_0xe18e('0x19')]();};}function respondWithResult(_0x6cb960,_0x59f5ce){_0x59f5ce=_0x59f5ce||0xc8;return function(_0x2b02eb){if(_0x2b02eb){return _0x6cb960[_0xe18e('0x18')](_0x59f5ce)[_0xe18e('0x1a')](_0x2b02eb);}};}function respondWithFilteredResult(_0x3dd1d7,_0x360257){return function(_0x40cb44){if(_0x40cb44){var _0x1a581e=typeof _0x360257[_0xe18e('0x1b')]===_0xe18e('0x1c')&&typeof _0x360257[_0xe18e('0x1d')]===_0xe18e('0x1c');var _0x1c0166=_0x40cb44['count'];var _0x541dc1=_0x1a581e?0x0:_0x360257['offset'];var _0x1a4d55=_0x1a581e?_0x40cb44[_0xe18e('0x1e')]:_0x360257[_0xe18e('0x1b')]+_0x360257[_0xe18e('0x1d')];var _0xd393fc;if(_0x1a4d55>=_0x1c0166){_0x1a4d55=_0x1c0166;_0xd393fc=0xc8;}else{_0xd393fc=0xce;}_0x3dd1d7[_0xe18e('0x18')](_0xd393fc);return _0x3dd1d7['set']('Content-Range',_0x541dc1+'-'+_0x1a4d55+'/'+_0x1c0166)[_0xe18e('0x1a')](_0x40cb44);}return null;};}function patchUpdates(_0x99a835){return function(_0x556c7f){try{jsonpatch[_0xe18e('0x1f')](_0x556c7f,_0x99a835,!![]);}catch(_0x4b5487){return BPromise['reject'](_0x4b5487);}return _0x556c7f[_0xe18e('0x20')]();};}function saveUpdates(_0xccdb0d,_0x7af971){return function(_0x3efdb1){if(_0x3efdb1){return _0x3efdb1[_0xe18e('0x21')](_0xccdb0d)['then'](function(_0x1bbea3){return _0x1bbea3;});}return null;};}function removeEntity(_0x17a391,_0x32a67f){return function(_0x4d1cfd){if(_0x4d1cfd){return _0x4d1cfd[_0xe18e('0x22')]()[_0xe18e('0x23')](function(){_0x17a391[_0xe18e('0x18')](0xcc)[_0xe18e('0x19')]();});}};}function handleEntityNotFound(_0x178527,_0x41d513){return function(_0x4c3790){if(!_0x4c3790){_0x178527[_0xe18e('0x17')](0x194);}return _0x4c3790;};}function handleError(_0x2f07de,_0x30c0dc){_0x30c0dc=_0x30c0dc||0x1f4;return function(_0x388888){logger[_0xe18e('0x24')](_0x388888[_0xe18e('0x25')]);if(_0x388888['name']){delete _0x388888[_0xe18e('0x26')];}_0x2f07de[_0xe18e('0x18')](_0x30c0dc)[_0xe18e('0x27')](_0x388888);};}exports[_0xe18e('0x28')]=function(_0x3e560a,_0x23999a){var _0xcbbdd1={},_0x630e94={},_0x2e1385={'count':0x0,'rows':[]};var _0x2afddd=_[_0xe18e('0x29')](db[_0xe18e('0x2a')][_0xe18e('0x2b')],function(_0x3b9663){return{'name':_0x3b9663[_0xe18e('0x2c')],'type':_0x3b9663[_0xe18e('0x2d')]['key']};});_0x630e94[_0xe18e('0x2e')]=_['map'](_0x2afddd,_0xe18e('0x26'));_0x630e94[_0xe18e('0x2f')]=_[_0xe18e('0x30')](_0x3e560a[_0xe18e('0x2f')]);_0x630e94['filters']=_[_0xe18e('0x31')](_0x630e94[_0xe18e('0x2e')],_0x630e94['query']);_0xcbbdd1[_0xe18e('0x32')]=_[_0xe18e('0x31')](_0x630e94['model'],qs[_0xe18e('0x33')](_0x3e560a['query'][_0xe18e('0x33')]));_0xcbbdd1[_0xe18e('0x32')]=_0xcbbdd1[_0xe18e('0x32')][_0xe18e('0x34')]?_0xcbbdd1['attributes']:_0x630e94['model'];if(!_0x3e560a[_0xe18e('0x2f')][_0xe18e('0x35')](_0xe18e('0x36'))){_0xcbbdd1[_0xe18e('0x1d')]=qs['limit'](_0x3e560a['query']['limit']);_0xcbbdd1[_0xe18e('0x1b')]=qs[_0xe18e('0x1b')](_0x3e560a[_0xe18e('0x2f')][_0xe18e('0x1b')]);}_0xcbbdd1['order']=qs['sort'](_0x3e560a['query'][_0xe18e('0x37')]);_0xcbbdd1[_0xe18e('0x38')]=qs['filters'](_[_0xe18e('0x39')](_0x3e560a[_0xe18e('0x2f')],_0x630e94[_0xe18e('0x3a')]),_0x2afddd);if(_0x3e560a[_0xe18e('0x2f')][_0xe18e('0x3b')]){_0xcbbdd1[_0xe18e('0x38')]=_['merge'](_0xcbbdd1[_0xe18e('0x38')],{'$or':_[_0xe18e('0x29')](_0x2afddd,function(_0x30a97b){if(_0x30a97b[_0xe18e('0x2d')]!==_0xe18e('0x3c')){var _0x2f0e8c={};_0x2f0e8c[_0x30a97b[_0xe18e('0x26')]]={'$like':'%'+_0x3e560a['query'][_0xe18e('0x3b')]+'%'};return _0x2f0e8c;}})});}_0xcbbdd1=_[_0xe18e('0x3d')]({},_0xcbbdd1,_0x3e560a[_0xe18e('0x3e')]);var _0x2264ad={'where':_0xcbbdd1[_0xe18e('0x38')]};return db[_0xe18e('0x2a')][_0xe18e('0x1e')](_0x2264ad)[_0xe18e('0x23')](function(_0x2783ff){_0x2e1385[_0xe18e('0x1e')]=_0x2783ff;if(_0x3e560a[_0xe18e('0x2f')][_0xe18e('0x3f')]){_0xcbbdd1[_0xe18e('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xe18e('0x41')](_0xcbbdd1);})[_0xe18e('0x23')](function(_0x335b5d){_0x2e1385[_0xe18e('0x42')]=_0x335b5d;return _0x2e1385;})['then'](respondWithFilteredResult(_0x23999a,_0xcbbdd1))[_0xe18e('0x43')](handleError(_0x23999a,null));};exports[_0xe18e('0x44')]=function(_0x326a63,_0x39c3b7){var _0x3ecb7f={'raw':!![],'where':{'id':_0x326a63[_0xe18e('0x45')]['id']}},_0x82ad3e={};_0x82ad3e[_0xe18e('0x2e')]=_[_0xe18e('0x30')](db[_0xe18e('0x2a')][_0xe18e('0x2b')]);_0x82ad3e[_0xe18e('0x2f')]=_['keys'](_0x326a63[_0xe18e('0x2f')]);_0x82ad3e[_0xe18e('0x3a')]=_[_0xe18e('0x31')](_0x82ad3e[_0xe18e('0x2e')],_0x82ad3e[_0xe18e('0x2f')]);_0x3ecb7f[_0xe18e('0x32')]=_['intersection'](_0x82ad3e[_0xe18e('0x2e')],qs[_0xe18e('0x33')](_0x326a63[_0xe18e('0x2f')][_0xe18e('0x33')]));_0x3ecb7f[_0xe18e('0x32')]=_0x3ecb7f[_0xe18e('0x32')]['length']?_0x3ecb7f[_0xe18e('0x32')]:_0x82ad3e['model'];if(_0x326a63['query'][_0xe18e('0x3f')]){_0x3ecb7f[_0xe18e('0x40')]=[{'all':!![]}];}_0x3ecb7f=_[_0xe18e('0x3d')]({},_0x3ecb7f,_0x326a63['options']);return db[_0xe18e('0x2a')][_0xe18e('0x46')](_0x3ecb7f)['then'](handleEntityNotFound(_0x39c3b7,null))[_0xe18e('0x23')](respondWithResult(_0x39c3b7,null))[_0xe18e('0x43')](handleError(_0x39c3b7,null));};exports[_0xe18e('0x47')]=function(_0x40cf19,_0x4c609b){return db['OpenchannelQueueReport'][_0xe18e('0x47')](_0x40cf19[_0xe18e('0x48')],{})[_0xe18e('0x23')](respondWithResult(_0x4c609b,0xc9))[_0xe18e('0x43')](handleError(_0x4c609b,null));};exports['update']=function(_0x19ae91,_0x2a0fe2){if(_0x19ae91['body']['id']){delete _0x19ae91['body']['id'];}return db[_0xe18e('0x2a')]['find']({'where':{'id':_0x19ae91[_0xe18e('0x45')]['id']}})[_0xe18e('0x23')](handleEntityNotFound(_0x2a0fe2,null))[_0xe18e('0x23')](saveUpdates(_0x19ae91[_0xe18e('0x48')],null))[_0xe18e('0x23')](respondWithResult(_0x2a0fe2,null))[_0xe18e('0x43')](handleError(_0x2a0fe2,null));};exports['destroy']=function(_0x41cd39,_0x325b45){return db[_0xe18e('0x2a')][_0xe18e('0x46')]({'where':{'id':_0x41cd39[_0xe18e('0x45')]['id']}})['then'](handleEntityNotFound(_0x325b45,null))['then'](removeEntity(_0x325b45,null))[_0xe18e('0x43')](handleError(_0x325b45,null));};exports[_0xe18e('0x49')]=function(_0x3e19d4,_0x1c49cd){return db[_0xe18e('0x2a')]['describe']()['then'](respondWithResult(_0x1c49cd,null))[_0xe18e('0x43')](handleError(_0x1c49cd,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index c04accb..ffaa90d 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x2ec93f,_0x6e4e8a){var _0x192c26=function(_0x132b43){while(--_0x132b43){_0x2ec93f['push'](_0x2ec93f['shift']());}};_0x192c26(++_0x6e4e8a);}(_0x2ef3,0xba));var _0x32ef=function(_0x240c9d,_0x1d2fd5){_0x240c9d=_0x240c9d-0x0;var _0x2f5395=_0x2ef3[_0x240c9d];return _0x2f5395;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x814b,0x1a2));var _0xb814=function(_0x3559c4,_0x47580b){_0x3559c4=_0x3559c4-0x0;var _0x124053=_0x814b[_0x3559c4];return _0x124053;};'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_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9adc9d8..b9ac16f 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 _0xa30a=['body','debug','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateOpenchannelQueueReport','create'];(function(_0x1caac5,_0x4a13d8){var _0x21a0ae=function(_0x49ec25){while(--_0x49ec25){_0x1caac5['push'](_0x1caac5['shift']());}};_0x21a0ae(++_0x4a13d8);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['OpenchannelQueueReport'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![]})[_0xaa30('0xc')](function(_0x3e4f1d){logger[_0xaa30('0xd')](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x18')]('CreateOpenchannelQueueReport',_0x540e36,JSON[_0xaa30('0x10')](_0x3e4f1d));_0x53f9fd(_0x3e4f1d);})[_0xaa30('0x19')](function(_0x2e16e7){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x2e16e7['message'],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x2e16e7[_0xaa30('0x13')]));});});};exports[_0xaa30('0x1a')]=function(_0x326f84){var _0x57d1ca=this;return new Promise(function(_0x14d7fa,_0x1be54c){return db[_0xaa30('0x1b')][_0xaa30('0x1c')](_0x326f84[_0xaa30('0x17')],{'raw':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1f')]||null:null,'attributes':_0x326f84['options']?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x20')]||null:null,'limit':_0x326f84[_0xaa30('0x1d')]?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x21')]||null:null})[_0xaa30('0xc')](function(_0x6ff09a){logger[_0xaa30('0xd')](_0xaa30('0x1a'),_0x326f84);logger[_0xaa30('0x18')](_0xaa30('0x1a'),_0x326f84,JSON[_0xaa30('0x10')](_0x6ff09a));_0x14d7fa(_0x6ff09a);})[_0xaa30('0x19')](function(_0x46abb9){logger[_0xaa30('0x11')](_0xaa30('0x1a'),_0x46abb9[_0xaa30('0x13')],_0x326f84);_0x1be54c(_0x57d1ca[_0xaa30('0x11')](0x1f4,_0x46abb9['message']));});});}; \ No newline at end of file +var _0x5f66=['error','info','catch','CreateOpenchannelQueueReport','create','raw','update','body','options','where','attributes','limit','UpdateOpenchannelQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['OpenchannelQueueReport'][_0x65f6('0x16')](_0x1f974c['body'],{'raw':_0x1f974c['options']?_0x1f974c['options'][_0x65f6('0x17')]===undefined?!![]:![]:!![]})[_0x65f6('0xa')](function(_0x5114a4){logger[_0x65f6('0x13')](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON[_0x65f6('0xf')](_0x5114a4));_0x18380e(_0x5114a4);})[_0x65f6('0x14')](function(_0x581374){logger[_0x65f6('0x12')]('CreateOpenchannelQueueReport',_0x581374['message'],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x581374[_0x65f6('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1eeaaa){var _0x471a33=this;return new Promise(function(_0x2317ce,_0x2774a1){return db['OpenchannelQueueReport'][_0x65f6('0x18')](_0x1eeaaa[_0x65f6('0x19')],{'raw':_0x1eeaaa[_0x65f6('0x1a')]?_0x1eeaaa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1b')]||null:null,'attributes':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'limit':_0x1eeaaa['options']?_0x1eeaaa[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null})[_0x65f6('0xa')](function(_0x559330){logger['info']('UpdateOpenchannelQueueReport',_0x1eeaaa);logger[_0x65f6('0xd')](_0x65f6('0x1e'),_0x1eeaaa,JSON[_0x65f6('0xf')](_0x559330));_0x2317ce(_0x559330);})[_0x65f6('0x14')](function(_0x518cac){logger[_0x65f6('0x12')](_0x65f6('0x1e'),_0x518cac['message'],_0x1eeaaa);_0x2774a1(_0x471a33['error'](0x1f4,_0x518cac[_0x65f6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 28a13c5..865d656 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 _0x07c8=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x5660d9,_0x1aeaa0){var _0xb5405b=function(_0x2167ab){while(--_0x2167ab){_0x5660d9['push'](_0x5660d9['shift']());}};_0xb5405b(++_0x1aeaa0);}(_0x07c8,0x1b7));var _0x807c=function(_0x187a22,_0x5a90ee){_0x187a22=_0x187a22-0x0;var _0x1c836a=_0x07c8[_0x187a22];return _0x1c836a;};'use strict';var multer=require(_0x807c('0x0'));var util=require(_0x807c('0x1'));var path=require(_0x807c('0x2'));var timeout=require(_0x807c('0x3'));var express=require(_0x807c('0x4'));var router=express[_0x807c('0x5')]();var fs_extra=require(_0x807c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807c('0x7'));var controller=require(_0x807c('0x8'));router[_0x807c('0x9')]('/',auth[_0x807c('0xa')](),controller['index']);router[_0x807c('0x9')](_0x807c('0xb'),auth[_0x807c('0xa')](),controller[_0x807c('0xc')]);router[_0x807c('0x9')](_0x807c('0xd'),auth[_0x807c('0xa')](),controller[_0x807c('0xe')]);router[_0x807c('0xf')]('/',auth[_0x807c('0xa')](),controller[_0x807c('0x10')]);router['put'](_0x807c('0xd'),auth[_0x807c('0xa')](),controller[_0x807c('0x11')]);router[_0x807c('0x12')]('/:id',auth[_0x807c('0xa')](),controller[_0x807c('0x13')]);module[_0x807c('0x14')]=router; \ No newline at end of file +var _0xda9c=['create','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x37f004,_0x62b34f){var _0x26e286=function(_0x39d65a){while(--_0x39d65a){_0x37f004['push'](_0x37f004['shift']());}};_0x26e286(++_0x62b34f);}(_0xda9c,0x124));var _0xcda9=function(_0xd3714f,_0x4ebefe){_0xd3714f=_0xd3714f-0x0;var _0x2a4d62=_0xda9c[_0xd3714f];return _0x2a4d62;};'use strict';var multer=require(_0xcda9('0x0'));var util=require(_0xcda9('0x1'));var path=require('path');var timeout=require(_0xcda9('0x2'));var express=require(_0xcda9('0x3'));var router=express['Router']();var fs_extra=require(_0xcda9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcda9('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xcda9('0x6')]('/',auth[_0xcda9('0x7')](),controller['index']);router[_0xcda9('0x6')](_0xcda9('0x8'),auth[_0xcda9('0x7')](),controller[_0xcda9('0x9')]);router['get'](_0xcda9('0xa'),auth[_0xcda9('0x7')](),controller[_0xcda9('0xb')]);router['post']('/',auth[_0xcda9('0x7')](),controller[_0xcda9('0xc')]);router[_0xcda9('0xd')](_0xcda9('0xa'),auth[_0xcda9('0x7')](),controller[_0xcda9('0xe')]);router['delete'](_0xcda9('0xa'),auth['isAuthenticated'](),controller[_0xcda9('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index debc6a9..f814575 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x521277,_0x4d44e9){var _0x4b43a7=function(_0x29b080){while(--_0x29b080){_0x521277['push'](_0x521277['shift']());}};_0x4b43a7(++_0x4d44e9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x15b058,_0x5e820e){_0x15b058=_0x15b058-0x0;var _0x200879=_0xf4eb[_0x15b058];return _0x200879;};'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(_0x1e5c8d,_0x1bd355){var _0x17f720=function(_0x4cdadf){while(--_0x4cdadf){_0x1e5c8d['push'](_0x1e5c8d['shift']());}};_0x17f720(++_0x1bd355);}(_0x54ef,0x112));var _0xf54e=function(_0x5dfd85,_0xeb39d3){_0x5dfd85=_0x5dfd85-0x0;var _0x36c1d3=_0x54ef[_0x5dfd85];return _0x36c1d3;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 0bd714c..9f43bfc 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 _0x263a=['includeAll','include','rows','catch','show','keys','merge','options','find','create','body','params','describe','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','OpenchannelTransferReport'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x263a,0xf1));var _0xa263=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x263a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa263('0x0'));var zipdir=require(_0xa263('0x1'));var jsonpatch=require(_0xa263('0x2'));var rp=require(_0xa263('0x3'));var moment=require(_0xa263('0x4'));var BPromise=require(_0xa263('0x5'));var Mustache=require(_0xa263('0x6'));var util=require(_0xa263('0x7'));var path=require(_0xa263('0x8'));var sox=require(_0xa263('0x9'));var csv=require(_0xa263('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa263('0xb'));var _=require(_0xa263('0xc'));var squel=require(_0xa263('0xd'));var crypto=require(_0xa263('0xe'));var jsforce=require(_0xa263('0xf'));var deskjs=require(_0xa263('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa263('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa263('0x12'));var as=require(_0xa263('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa263('0x14'))(_0xa263('0x15'));var utils=require(_0xa263('0x16'));var config=require(_0xa263('0x17'));var licenseUtil=require(_0xa263('0x18'));var db=require(_0xa263('0x19'))['db'];function respondWithStatusCode(_0x47ad90,_0x132ce4){_0x132ce4=_0x132ce4||0xcc;return function(_0x2729d5){if(_0x2729d5){return _0x47ad90['sendStatus'](_0x132ce4);}return _0x47ad90[_0xa263('0x1a')](_0x132ce4)[_0xa263('0x1b')]();};}function respondWithResult(_0x4a9daf,_0x3050eb){_0x3050eb=_0x3050eb||0xc8;return function(_0x44d9ff){if(_0x44d9ff){return _0x4a9daf[_0xa263('0x1a')](_0x3050eb)[_0xa263('0x1c')](_0x44d9ff);}};}function respondWithFilteredResult(_0x371f8c,_0x9fade6){return function(_0x5cf940){if(_0x5cf940){var _0x50d5ec=typeof _0x9fade6[_0xa263('0x1d')]===_0xa263('0x1e')&&typeof _0x9fade6['limit']===_0xa263('0x1e');var _0x257379=_0x5cf940[_0xa263('0x1f')];var _0x2e7bec=_0x50d5ec?0x0:_0x9fade6[_0xa263('0x1d')];var _0x57df8e=_0x50d5ec?_0x5cf940[_0xa263('0x1f')]:_0x9fade6[_0xa263('0x1d')]+_0x9fade6[_0xa263('0x20')];var _0x528341;if(_0x57df8e>=_0x257379){_0x57df8e=_0x257379;_0x528341=0xc8;}else{_0x528341=0xce;}_0x371f8c['status'](_0x528341);return _0x371f8c[_0xa263('0x21')]('Content-Range',_0x2e7bec+'-'+_0x57df8e+'/'+_0x257379)[_0xa263('0x1c')](_0x5cf940);}return null;};}function patchUpdates(_0x2f3daf){return function(_0x4f4711){try{jsonpatch[_0xa263('0x22')](_0x4f4711,_0x2f3daf,!![]);}catch(_0x174af7){return BPromise[_0xa263('0x23')](_0x174af7);}return _0x4f4711[_0xa263('0x24')]();};}function saveUpdates(_0x4cf5b9,_0xbeccfa){return function(_0x37d819){if(_0x37d819){return _0x37d819[_0xa263('0x25')](_0x4cf5b9)['then'](function(_0x263816){return _0x263816;});}return null;};}function removeEntity(_0x25757c,_0x1ff686){return function(_0x1c0e40){if(_0x1c0e40){return _0x1c0e40[_0xa263('0x26')]()[_0xa263('0x27')](function(){_0x25757c['status'](0xcc)[_0xa263('0x1b')]();});}};}function handleEntityNotFound(_0x34aae0,_0x5a43ff){return function(_0x3cf904){if(!_0x3cf904){_0x34aae0[_0xa263('0x28')](0x194);}return _0x3cf904;};}function handleError(_0x17079b,_0x50c779){_0x50c779=_0x50c779||0x1f4;return function(_0xce0c00){logger[_0xa263('0x29')](_0xce0c00[_0xa263('0x2a')]);if(_0xce0c00[_0xa263('0x2b')]){delete _0xce0c00['name'];}_0x17079b[_0xa263('0x1a')](_0x50c779)[_0xa263('0x2c')](_0xce0c00);};}exports[_0xa263('0x2d')]=function(_0x28f01f,_0x462f94){var _0x26688d={},_0x6091b3={},_0xfe0ec5={'count':0x0,'rows':[]};var _0x4fb97a=_[_0xa263('0x2e')](db['OpenchannelTransferReport'][_0xa263('0x2f')],function(_0x5b9e66){return{'name':_0x5b9e66[_0xa263('0x30')],'type':_0x5b9e66[_0xa263('0x31')]['key']};});_0x6091b3[_0xa263('0x32')]=_[_0xa263('0x2e')](_0x4fb97a,_0xa263('0x2b'));_0x6091b3[_0xa263('0x33')]=_['keys'](_0x28f01f[_0xa263('0x33')]);_0x6091b3[_0xa263('0x34')]=_['intersection'](_0x6091b3[_0xa263('0x32')],_0x6091b3['query']);_0x26688d['attributes']=_[_0xa263('0x35')](_0x6091b3['model'],qs[_0xa263('0x36')](_0x28f01f[_0xa263('0x33')][_0xa263('0x36')]));_0x26688d[_0xa263('0x37')]=_0x26688d['attributes'][_0xa263('0x38')]?_0x26688d[_0xa263('0x37')]:_0x6091b3['model'];if(!_0x28f01f[_0xa263('0x33')][_0xa263('0x39')]('nolimit')){_0x26688d[_0xa263('0x20')]=qs[_0xa263('0x20')](_0x28f01f['query'][_0xa263('0x20')]);_0x26688d['offset']=qs[_0xa263('0x1d')](_0x28f01f[_0xa263('0x33')][_0xa263('0x1d')]);}_0x26688d['order']=qs[_0xa263('0x3a')](_0x28f01f[_0xa263('0x33')][_0xa263('0x3a')]);_0x26688d[_0xa263('0x3b')]=qs[_0xa263('0x34')](_[_0xa263('0x3c')](_0x28f01f['query'],_0x6091b3['filters']),_0x4fb97a);if(_0x28f01f[_0xa263('0x33')][_0xa263('0x3d')]){_0x26688d[_0xa263('0x3b')]=_['merge'](_0x26688d[_0xa263('0x3b')],{'$or':_[_0xa263('0x2e')](_0x4fb97a,function(_0x101c8a){if(_0x101c8a[_0xa263('0x31')]!=='VIRTUAL'){var _0x177d15={};_0x177d15[_0x101c8a[_0xa263('0x2b')]]={'$like':'%'+_0x28f01f[_0xa263('0x33')][_0xa263('0x3d')]+'%'};return _0x177d15;}})});}_0x26688d=_['merge']({},_0x26688d,_0x28f01f['options']);var _0x61aadb={'where':_0x26688d[_0xa263('0x3b')]};return db[_0xa263('0x3e')][_0xa263('0x1f')](_0x61aadb)[_0xa263('0x27')](function(_0xda72f){_0xfe0ec5[_0xa263('0x1f')]=_0xda72f;if(_0x28f01f[_0xa263('0x33')][_0xa263('0x3f')]){_0x26688d[_0xa263('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x26688d);})[_0xa263('0x27')](function(_0x368233){_0xfe0ec5[_0xa263('0x41')]=_0x368233;return _0xfe0ec5;})[_0xa263('0x27')](respondWithFilteredResult(_0x462f94,_0x26688d))[_0xa263('0x42')](handleError(_0x462f94,null));};exports[_0xa263('0x43')]=function(_0xc88d06,_0xcdab26){var _0x5da390={'raw':!![],'where':{'id':_0xc88d06['params']['id']}},_0x3b6e8d={};_0x3b6e8d[_0xa263('0x32')]=_[_0xa263('0x44')](db['OpenchannelTransferReport'][_0xa263('0x2f')]);_0x3b6e8d[_0xa263('0x33')]=_[_0xa263('0x44')](_0xc88d06[_0xa263('0x33')]);_0x3b6e8d[_0xa263('0x34')]=_[_0xa263('0x35')](_0x3b6e8d['model'],_0x3b6e8d[_0xa263('0x33')]);_0x5da390[_0xa263('0x37')]=_[_0xa263('0x35')](_0x3b6e8d[_0xa263('0x32')],qs['fields'](_0xc88d06[_0xa263('0x33')][_0xa263('0x36')]));_0x5da390['attributes']=_0x5da390[_0xa263('0x37')][_0xa263('0x38')]?_0x5da390[_0xa263('0x37')]:_0x3b6e8d[_0xa263('0x32')];if(_0xc88d06[_0xa263('0x33')]['includeAll']){_0x5da390[_0xa263('0x40')]=[{'all':!![]}];}_0x5da390=_[_0xa263('0x45')]({},_0x5da390,_0xc88d06[_0xa263('0x46')]);return db[_0xa263('0x3e')][_0xa263('0x47')](_0x5da390)[_0xa263('0x27')](handleEntityNotFound(_0xcdab26,null))[_0xa263('0x27')](respondWithResult(_0xcdab26,null))['catch'](handleError(_0xcdab26,null));};exports[_0xa263('0x48')]=function(_0x7f13e4,_0x301166){return db[_0xa263('0x3e')][_0xa263('0x48')](_0x7f13e4[_0xa263('0x49')],{})['then'](respondWithResult(_0x301166,0xc9))['catch'](handleError(_0x301166,null));};exports[_0xa263('0x25')]=function(_0x1eee8b,_0xd090be){if(_0x1eee8b['body']['id']){delete _0x1eee8b[_0xa263('0x49')]['id'];}return db[_0xa263('0x3e')][_0xa263('0x47')]({'where':{'id':_0x1eee8b[_0xa263('0x4a')]['id']}})[_0xa263('0x27')](handleEntityNotFound(_0xd090be,null))[_0xa263('0x27')](saveUpdates(_0x1eee8b[_0xa263('0x49')],null))[_0xa263('0x27')](respondWithResult(_0xd090be,null))[_0xa263('0x42')](handleError(_0xd090be,null));};exports['destroy']=function(_0x2b791d,_0x5cf24b){return db[_0xa263('0x3e')][_0xa263('0x47')]({'where':{'id':_0x2b791d[_0xa263('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cf24b,null))[_0xa263('0x27')](removeEntity(_0x5cf24b,null))['catch'](handleError(_0x5cf24b,null));};exports[_0xa263('0x4b')]=function(_0x147010,_0x133933){return db['OpenchannelTransferReport'][_0xa263('0x4b')]()[_0xa263('0x27')](respondWithResult(_0x133933,null))['catch'](handleError(_0x133933,null));}; \ No newline at end of file +var _0x36ac=['../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','fields','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x540160,_0x24c6b6){var _0x476120=function(_0x28046c){while(--_0x28046c){_0x540160['push'](_0x540160['shift']());}};_0x476120(++_0x24c6b6);}(_0x36ac,0x1d0));var _0xc36a=function(_0x38207f,_0x4a1d2b){_0x38207f=_0x38207f-0x0;var _0x3904df=_0x36ac[_0x38207f];return _0x3904df;};'use strict';var emlformat=require(_0xc36a('0x0'));var rimraf=require(_0xc36a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc36a('0x2'));var rp=require(_0xc36a('0x3'));var moment=require(_0xc36a('0x4'));var BPromise=require(_0xc36a('0x5'));var Mustache=require(_0xc36a('0x6'));var util=require('util');var path=require(_0xc36a('0x7'));var sox=require(_0xc36a('0x8'));var csv=require(_0xc36a('0x9'));var ejs=require(_0xc36a('0xa'));var fs=require('fs');var fs_extra=require(_0xc36a('0xb'));var _=require(_0xc36a('0xc'));var squel=require(_0xc36a('0xd'));var crypto=require(_0xc36a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc36a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc36a('0x10'));var Papa=require(_0xc36a('0x11'));var Redis=require(_0xc36a('0x12'));var authService=require(_0xc36a('0x13'));var qs=require(_0xc36a('0x14'));var as=require(_0xc36a('0x15'));var hardwareService=require(_0xc36a('0x16'));var logger=require(_0xc36a('0x17'))(_0xc36a('0x18'));var utils=require(_0xc36a('0x19'));var config=require(_0xc36a('0x1a'));var licenseUtil=require(_0xc36a('0x1b'));var db=require(_0xc36a('0x1c'))['db'];function respondWithStatusCode(_0x5c153d,_0x44fd9d){_0x44fd9d=_0x44fd9d||0xcc;return function(_0x13a966){if(_0x13a966){return _0x5c153d[_0xc36a('0x1d')](_0x44fd9d);}return _0x5c153d[_0xc36a('0x1e')](_0x44fd9d)[_0xc36a('0x1f')]();};}function respondWithResult(_0x441f5b,_0x2e24aa){_0x2e24aa=_0x2e24aa||0xc8;return function(_0x836da8){if(_0x836da8){return _0x441f5b[_0xc36a('0x1e')](_0x2e24aa)['json'](_0x836da8);}};}function respondWithFilteredResult(_0x34d1cb,_0x204294){return function(_0x2cbda1){if(_0x2cbda1){var _0x152dd8=typeof _0x204294[_0xc36a('0x20')]===_0xc36a('0x21')&&typeof _0x204294['limit']===_0xc36a('0x21');var _0x22f3e8=_0x2cbda1[_0xc36a('0x22')];var _0x3298ea=_0x152dd8?0x0:_0x204294[_0xc36a('0x20')];var _0x4067d2=_0x152dd8?_0x2cbda1['count']:_0x204294[_0xc36a('0x20')]+_0x204294[_0xc36a('0x23')];var _0x4a0ad5;if(_0x4067d2>=_0x22f3e8){_0x4067d2=_0x22f3e8;_0x4a0ad5=0xc8;}else{_0x4a0ad5=0xce;}_0x34d1cb[_0xc36a('0x1e')](_0x4a0ad5);return _0x34d1cb[_0xc36a('0x24')](_0xc36a('0x25'),_0x3298ea+'-'+_0x4067d2+'/'+_0x22f3e8)[_0xc36a('0x26')](_0x2cbda1);}return null;};}function patchUpdates(_0x2f7bcb){return function(_0x424df0){try{jsonpatch[_0xc36a('0x27')](_0x424df0,_0x2f7bcb,!![]);}catch(_0x4e2068){return BPromise['reject'](_0x4e2068);}return _0x424df0[_0xc36a('0x28')]();};}function saveUpdates(_0x4a2436,_0x27c98c){return function(_0x5b9700){if(_0x5b9700){return _0x5b9700['update'](_0x4a2436)[_0xc36a('0x29')](function(_0x4ec34d){return _0x4ec34d;});}return null;};}function removeEntity(_0x1191b9,_0x29ddab){return function(_0x38314f){if(_0x38314f){return _0x38314f[_0xc36a('0x2a')]()[_0xc36a('0x29')](function(){_0x1191b9[_0xc36a('0x1e')](0xcc)[_0xc36a('0x1f')]();});}};}function handleEntityNotFound(_0xbca3cf,_0x381dd3){return function(_0x431718){if(!_0x431718){_0xbca3cf['sendStatus'](0x194);}return _0x431718;};}function handleError(_0x293a06,_0x561643){_0x561643=_0x561643||0x1f4;return function(_0x2ab461){logger[_0xc36a('0x2b')](_0x2ab461[_0xc36a('0x2c')]);if(_0x2ab461[_0xc36a('0x2d')]){delete _0x2ab461[_0xc36a('0x2d')];}_0x293a06['status'](_0x561643)[_0xc36a('0x2e')](_0x2ab461);};}exports[_0xc36a('0x2f')]=function(_0x2612ee,_0x3a1206){var _0x16c75e={},_0x10403b={},_0x231fb8={'count':0x0,'rows':[]};var _0x779f09=_[_0xc36a('0x30')](db[_0xc36a('0x31')][_0xc36a('0x32')],function(_0x401c31){return{'name':_0x401c31[_0xc36a('0x33')],'type':_0x401c31[_0xc36a('0x34')][_0xc36a('0x35')]};});_0x10403b[_0xc36a('0x36')]=_[_0xc36a('0x30')](_0x779f09,_0xc36a('0x2d'));_0x10403b[_0xc36a('0x37')]=_[_0xc36a('0x38')](_0x2612ee['query']);_0x10403b[_0xc36a('0x39')]=_['intersection'](_0x10403b[_0xc36a('0x36')],_0x10403b[_0xc36a('0x37')]);_0x16c75e[_0xc36a('0x3a')]=_['intersection'](_0x10403b[_0xc36a('0x36')],qs['fields'](_0x2612ee['query']['fields']));_0x16c75e[_0xc36a('0x3a')]=_0x16c75e[_0xc36a('0x3a')][_0xc36a('0x3b')]?_0x16c75e[_0xc36a('0x3a')]:_0x10403b[_0xc36a('0x36')];if(!_0x2612ee['query'][_0xc36a('0x3c')](_0xc36a('0x3d'))){_0x16c75e[_0xc36a('0x23')]=qs[_0xc36a('0x23')](_0x2612ee[_0xc36a('0x37')]['limit']);_0x16c75e[_0xc36a('0x20')]=qs[_0xc36a('0x20')](_0x2612ee[_0xc36a('0x37')]['offset']);}_0x16c75e['order']=qs['sort'](_0x2612ee[_0xc36a('0x37')][_0xc36a('0x3e')]);_0x16c75e[_0xc36a('0x3f')]=qs['filters'](_[_0xc36a('0x40')](_0x2612ee[_0xc36a('0x37')],_0x10403b[_0xc36a('0x39')]),_0x779f09);if(_0x2612ee[_0xc36a('0x37')]['filter']){_0x16c75e[_0xc36a('0x3f')]=_[_0xc36a('0x41')](_0x16c75e['where'],{'$or':_[_0xc36a('0x30')](_0x779f09,function(_0x56fbba){if(_0x56fbba[_0xc36a('0x34')]!==_0xc36a('0x42')){var _0x546a01={};_0x546a01[_0x56fbba[_0xc36a('0x2d')]]={'$like':'%'+_0x2612ee[_0xc36a('0x37')][_0xc36a('0x43')]+'%'};return _0x546a01;}})});}_0x16c75e=_[_0xc36a('0x41')]({},_0x16c75e,_0x2612ee[_0xc36a('0x44')]);var _0x144065={'where':_0x16c75e[_0xc36a('0x3f')]};return db[_0xc36a('0x31')][_0xc36a('0x22')](_0x144065)[_0xc36a('0x29')](function(_0x4252f7){_0x231fb8[_0xc36a('0x22')]=_0x4252f7;if(_0x2612ee['query'][_0xc36a('0x45')]){_0x16c75e[_0xc36a('0x46')]=[{'all':!![]}];}return db[_0xc36a('0x31')][_0xc36a('0x47')](_0x16c75e);})[_0xc36a('0x29')](function(_0x4bf44d){_0x231fb8[_0xc36a('0x48')]=_0x4bf44d;return _0x231fb8;})['then'](respondWithFilteredResult(_0x3a1206,_0x16c75e))[_0xc36a('0x49')](handleError(_0x3a1206,null));};exports['show']=function(_0x2e0a40,_0x2f0a73){var _0x42d563={'raw':!![],'where':{'id':_0x2e0a40[_0xc36a('0x4a')]['id']}},_0x3ed624={};_0x3ed624[_0xc36a('0x36')]=_['keys'](db[_0xc36a('0x31')][_0xc36a('0x32')]);_0x3ed624[_0xc36a('0x37')]=_[_0xc36a('0x38')](_0x2e0a40[_0xc36a('0x37')]);_0x3ed624['filters']=_[_0xc36a('0x4b')](_0x3ed624[_0xc36a('0x36')],_0x3ed624[_0xc36a('0x37')]);_0x42d563['attributes']=_[_0xc36a('0x4b')](_0x3ed624[_0xc36a('0x36')],qs[_0xc36a('0x4c')](_0x2e0a40[_0xc36a('0x37')]['fields']));_0x42d563['attributes']=_0x42d563[_0xc36a('0x3a')][_0xc36a('0x3b')]?_0x42d563[_0xc36a('0x3a')]:_0x3ed624[_0xc36a('0x36')];if(_0x2e0a40['query']['includeAll']){_0x42d563[_0xc36a('0x46')]=[{'all':!![]}];}_0x42d563=_[_0xc36a('0x41')]({},_0x42d563,_0x2e0a40[_0xc36a('0x44')]);return db[_0xc36a('0x31')][_0xc36a('0x4d')](_0x42d563)[_0xc36a('0x29')](handleEntityNotFound(_0x2f0a73,null))['then'](respondWithResult(_0x2f0a73,null))[_0xc36a('0x49')](handleError(_0x2f0a73,null));};exports[_0xc36a('0x4e')]=function(_0x2a86d2,_0x4f7009){return db[_0xc36a('0x31')]['create'](_0x2a86d2[_0xc36a('0x4f')],{})[_0xc36a('0x29')](respondWithResult(_0x4f7009,0xc9))[_0xc36a('0x49')](handleError(_0x4f7009,null));};exports[_0xc36a('0x50')]=function(_0x3e9352,_0x212c8b){if(_0x3e9352[_0xc36a('0x4f')]['id']){delete _0x3e9352[_0xc36a('0x4f')]['id'];}return db[_0xc36a('0x31')][_0xc36a('0x4d')]({'where':{'id':_0x3e9352['params']['id']}})[_0xc36a('0x29')](handleEntityNotFound(_0x212c8b,null))['then'](saveUpdates(_0x3e9352[_0xc36a('0x4f')],null))[_0xc36a('0x29')](respondWithResult(_0x212c8b,null))[_0xc36a('0x49')](handleError(_0x212c8b,null));};exports[_0xc36a('0x2a')]=function(_0x3ed933,_0x1978ea){return db[_0xc36a('0x31')][_0xc36a('0x4d')]({'where':{'id':_0x3ed933[_0xc36a('0x4a')]['id']}})[_0xc36a('0x29')](handleEntityNotFound(_0x1978ea,null))[_0xc36a('0x29')](removeEntity(_0x1978ea,null))[_0xc36a('0x49')](handleError(_0x1978ea,null));};exports[_0xc36a('0x51')]=function(_0x1a6bcf,_0x1d5526){return db[_0xc36a('0x31')][_0xc36a('0x51')]()['then'](respondWithResult(_0x1d5526,null))['catch'](handleError(_0x1d5526,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f0629a4..fc93be8 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 _0x76e1=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x2fe050,_0xe58b2b){var _0x38492a=function(_0x3c82a1){while(--_0x3c82a1){_0x2fe050['push'](_0x2fe050['shift']());}};_0x38492a(++_0xe58b2b);}(_0x76e1,0x15f));var _0x176e=function(_0x433d1b,_0x3be1b5){_0x433d1b=_0x433d1b-0x0;var _0x5acf87=_0x76e1[_0x433d1b];return _0x5acf87;};'use strict';var _=require(_0x176e('0x0'));var util=require(_0x176e('0x1'));var logger=require(_0x176e('0x2'))(_0x176e('0x3'));var moment=require(_0x176e('0x4'));var BPromise=require(_0x176e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x176e('0x6'));var rimraf=require(_0x176e('0x7'));var config=require(_0x176e('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x176e('0x9')]=function(_0x4718b3,_0x186f8b){return _0x4718b3['define'](_0x176e('0xa'),attributes,{'tableName':_0x176e('0xb'),'paranoid':![],'indexes':[{'name':_0x176e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x61e9=['../../config/logger','api','moment','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x14fb3c,_0x28a123){var _0x49adab=function(_0x15c5f8){while(--_0x15c5f8){_0x14fb3c['push'](_0x14fb3c['shift']());}};_0x49adab(++_0x28a123);}(_0x61e9,0x80));var _0x961e=function(_0x3bc19b,_0x2400d3){_0x3bc19b=_0x3bc19b-0x0;var _0x7ee092=_0x61e9[_0x3bc19b];return _0x7ee092;};'use strict';var _=require(_0x961e('0x0'));var util=require(_0x961e('0x1'));var logger=require(_0x961e('0x2'))(_0x961e('0x3'));var moment=require(_0x961e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x961e('0x5'));var config=require(_0x961e('0x6'));var attributes=require(_0x961e('0x7'));module[_0x961e('0x8')]=function(_0x5e984d,_0x5c98e8){return _0x5e984d[_0x961e('0x9')](_0x961e('0xa'),attributes,{'tableName':_0x961e('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x961e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 832769e..db70484 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4e632d,_0x50f155){_0x4e632d=_0x4e632d-0x0;var _0x4944fc=_0x1cb9[_0x4e632d];return _0x4944fc;};'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')]('OpenchannelTransferReport,\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);});});} \ No newline at end of file +var _0x4006=['moment','bluebird','randomstring','../../config/utils','rpc','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x4c5278,_0xc4080){var _0x3bcb6f=function(_0x224608){while(--_0x224608){_0x4c5278['push'](_0x4c5278['shift']());}};_0x3bcb6f(++_0xc4080);}(_0x4006,0x1c7));var _0x6400=function(_0x567b32,_0x1d567e){_0x567b32=_0x567b32-0x0;var _0x2ac952=_0x4006[_0x567b32];return _0x2ac952;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var moment=require(_0x6400('0x1'));var BPromise=require(_0x6400('0x2'));var rs=require(_0x6400('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6400('0x4'));var logger=require('../../config/logger')(_0x6400('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6400('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32c0db,_0x2d365b,_0x2bf4f8){return new BPromise(function(_0x250dba,_0x5cbe4f){return client[_0x6400('0x7')](_0x32c0db,_0x2bf4f8)[_0x6400('0x8')](function(_0x31a8d0){logger[_0x6400('0x9')](_0x6400('0xa'),_0x2d365b,_0x6400('0xb'));logger[_0x6400('0xc')](_0x6400('0xd'),_0x2d365b,_0x6400('0xb'),JSON[_0x6400('0xe')](_0x31a8d0));if(_0x31a8d0[_0x6400('0xf')]){if(_0x31a8d0['error'][_0x6400('0x10')]===0x1f4){logger[_0x6400('0xf')](_0x6400('0xa'),_0x2d365b,_0x31a8d0[_0x6400('0xf')]['message']);return _0x5cbe4f(_0x31a8d0[_0x6400('0xf')][_0x6400('0x11')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2d365b,_0x31a8d0['error'][_0x6400('0x11')]);return _0x250dba(_0x31a8d0[_0x6400('0xf')]['message']);}else{logger[_0x6400('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2d365b,_0x6400('0xb'));_0x250dba(_0x31a8d0['result'][_0x6400('0x11')]);}})[_0x6400('0x12')](function(_0x276fb2){logger[_0x6400('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2d365b,_0x276fb2);_0x5cbe4f(_0x276fb2);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 5392608..cfa077f 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 _0x4163=['put','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','./pause.controller','get','isAuthenticated','/:id','show'];(function(_0x59798a,_0x346f3c){var _0x2172d1=function(_0x8f6766){while(--_0x8f6766){_0x59798a['push'](_0x59798a['shift']());}};_0x2172d1(++_0x346f3c);}(_0x4163,0x17c));var _0x3416=function(_0x56e4b7,_0x4c0b79){_0x56e4b7=_0x56e4b7-0x0;var _0x463c26=_0x4163[_0x56e4b7];return _0x463c26;};'use strict';var multer=require(_0x3416('0x0'));var util=require('util');var path=require(_0x3416('0x1'));var timeout=require('connect-timeout');var express=require(_0x3416('0x2'));var router=express['Router']();var fs_extra=require(_0x3416('0x3'));var auth=require(_0x3416('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3416('0x5'));router[_0x3416('0x6')]('/',auth[_0x3416('0x7')](),controller['index']);router['get'](_0x3416('0x8'),auth['isAuthenticated'](),controller[_0x3416('0x9')]);router['post']('/',auth[_0x3416('0x7')](),controller['create']);router[_0x3416('0xa')](_0x3416('0x8'),auth[_0x3416('0x7')](),controller['update']);router[_0x3416('0xb')](_0x3416('0x8'),auth[_0x3416('0x7')](),controller[_0x3416('0xc')]);module['exports']=router; \ No newline at end of file +var _0x9f07=['get','isAuthenticated','/:id','show','post','create','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller'];(function(_0x33a97b,_0x291407){var _0x13d691=function(_0x267cff){while(--_0x267cff){_0x33a97b['push'](_0x33a97b['shift']());}};_0x13d691(++_0x291407);}(_0x9f07,0x18e));var _0x79f0=function(_0x373419,_0x570f7d){_0x373419=_0x373419-0x0;var _0x3e5f2d=_0x9f07[_0x373419];return _0x3e5f2d;};'use strict';var multer=require(_0x79f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x79f0('0x1'));var express=require(_0x79f0('0x2'));var router=express[_0x79f0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x79f0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x79f0('0x5'));var controller=require(_0x79f0('0x6'));router[_0x79f0('0x7')]('/',auth[_0x79f0('0x8')](),controller['index']);router['get'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller[_0x79f0('0xa')]);router[_0x79f0('0xb')]('/',auth[_0x79f0('0x8')](),controller[_0x79f0('0xc')]);router['put'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller['update']);router['delete'](_0x79f0('0x9'),auth[_0x79f0('0x8')](),controller[_0x79f0('0xd')]);module[_0x79f0('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 4e96c36..d96bd2c 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 _0x5f23=['sequelize','exports','name','STRING'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x5f23,0x10c));var _0x35f2=function(_0x157607,_0x8511a4){_0x157607=_0x157607-0x0;var _0x537b9f=_0x5f23[_0x157607];return _0x537b9f;};'use strict';var Sequelize=require(_0x35f2('0x0'));module[_0x35f2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x35f2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x35f2('0x3')]}}; \ No newline at end of file +var _0x9d5c=['sequelize','STRING'];(function(_0x378752,_0x158b32){var _0xd5a262=function(_0x3c6f94){while(--_0x3c6f94){_0x378752['push'](_0x378752['shift']());}};_0xd5a262(++_0x158b32);}(_0x9d5c,0x1ec));var _0xc9d5=function(_0x4fed6b,_0x36778f){_0x4fed6b=_0x4fed6b-0x0;var _0x430512=_0x9d5c[_0x4fed6b];return _0x430512;};'use strict';var Sequelize=require(_0xc9d5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9d5('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc9d5('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c5cf850..6186692 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 _0xdc43=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','set','Content-Range','reject','update','then','get','Pauses','destroy','status','error','index','map','Pause','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xdc43,0x188));var _0x3dc4=function(_0x176887,_0x1a15f8){_0x176887=_0x176887-0x0;var _0x3541e1=_0xdc43[_0x176887];return _0x3541e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3dc4('0x0'));var jsonpatch=require(_0x3dc4('0x1'));var rp=require(_0x3dc4('0x2'));var moment=require(_0x3dc4('0x3'));var BPromise=require(_0x3dc4('0x4'));var Mustache=require(_0x3dc4('0x5'));var util=require(_0x3dc4('0x6'));var path=require(_0x3dc4('0x7'));var sox=require(_0x3dc4('0x8'));var csv=require(_0x3dc4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dc4('0xa'));var _=require(_0x3dc4('0xb'));var squel=require(_0x3dc4('0xc'));var crypto=require(_0x3dc4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3dc4('0xe'));var toCsv=require(_0x3dc4('0x9'));var querystring=require(_0x3dc4('0xf'));var Papa=require(_0x3dc4('0x10'));var Redis=require('ioredis');var authService=require(_0x3dc4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dc4('0x12'));var logger=require('../../config/logger')(_0x3dc4('0x13'));var utils=require(_0x3dc4('0x14'));var config=require(_0x3dc4('0x15'));var licenseUtil=require(_0x3dc4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd6f5,_0x2c38c1){_0x2c38c1=_0x2c38c1||0xcc;return function(_0x1b60f9){if(_0x1b60f9){return _0x2bd6f5[_0x3dc4('0x17')](_0x2c38c1);}return _0x2bd6f5['status'](_0x2c38c1)[_0x3dc4('0x18')]();};}function respondWithResult(_0x3a421d,_0x4840bc){_0x4840bc=_0x4840bc||0xc8;return function(_0x1fe97d){if(_0x1fe97d){return _0x3a421d['status'](_0x4840bc)[_0x3dc4('0x19')](_0x1fe97d);}};}function respondWithFilteredResult(_0x7e6067,_0x144f0f){return function(_0x357d3a){if(_0x357d3a){var _0x2a0fcf=typeof _0x144f0f[_0x3dc4('0x1a')]===_0x3dc4('0x1b')&&typeof _0x144f0f['limit']===_0x3dc4('0x1b');var _0x5e5b0a=_0x357d3a[_0x3dc4('0x1c')];var _0x1036ca=_0x2a0fcf?0x0:_0x144f0f['offset'];var _0x4073da=_0x2a0fcf?_0x357d3a['count']:_0x144f0f[_0x3dc4('0x1a')]+_0x144f0f['limit'];var _0x17bff1;if(_0x4073da>=_0x5e5b0a){_0x4073da=_0x5e5b0a;_0x17bff1=0xc8;}else{_0x17bff1=0xce;}_0x7e6067['status'](_0x17bff1);return _0x7e6067[_0x3dc4('0x1d')](_0x3dc4('0x1e'),_0x1036ca+'-'+_0x4073da+'/'+_0x5e5b0a)[_0x3dc4('0x19')](_0x357d3a);}return null;};}function patchUpdates(_0x1b2de5){return function(_0x272c60){try{jsonpatch['apply'](_0x272c60,_0x1b2de5,!![]);}catch(_0x481275){return BPromise[_0x3dc4('0x1f')](_0x481275);}return _0x272c60['save']();};}function saveUpdates(_0x2ed800,_0x510bf5){return function(_0x1cda6d){if(_0x1cda6d){return _0x1cda6d[_0x3dc4('0x20')](_0x2ed800)[_0x3dc4('0x21')](function(_0x1d08e9){return _0x1d08e9;});}return null;};}function removeEntity(_0x53f3b8,_0x31da40){return function(_0x11c243){if(_0x11c243){return _0x11c243['destroy']()[_0x3dc4('0x21')](function(){var _0x326a99=_0x11c243[_0x3dc4('0x22')]({'plain':!![]});var _0x51014c=_0x3dc4('0x23');return db['UserProfileResource'][_0x3dc4('0x24')]({'where':{'type':_0x51014c,'resourceId':_0x326a99['id']}})[_0x3dc4('0x21')](function(){return _0x11c243;});})['then'](function(){_0x53f3b8[_0x3dc4('0x25')](0xcc)[_0x3dc4('0x18')]();});}};}function handleEntityNotFound(_0x470fe5,_0x11e690){return function(_0x1e7f4b){if(!_0x1e7f4b){_0x470fe5[_0x3dc4('0x17')](0x194);}return _0x1e7f4b;};}function handleError(_0x1aa0f3,_0x32ab52){_0x32ab52=_0x32ab52||0x1f4;return function(_0x4f626c){logger[_0x3dc4('0x26')](_0x4f626c['stack']);if(_0x4f626c['name']){delete _0x4f626c['name'];}_0x1aa0f3[_0x3dc4('0x25')](_0x32ab52)['send'](_0x4f626c);};}exports[_0x3dc4('0x27')]=function(_0x444e22,_0x34e6c7){var _0x4031d4={},_0x41d89f={},_0x48836e={'count':0x0,'rows':[]};var _0x3d09ac=_[_0x3dc4('0x28')](db[_0x3dc4('0x29')]['rawAttributes'],function(_0x395fa1){return{'name':_0x395fa1[_0x3dc4('0x2a')],'type':_0x395fa1[_0x3dc4('0x2b')][_0x3dc4('0x2c')]};});_0x41d89f[_0x3dc4('0x2d')]=_[_0x3dc4('0x28')](_0x3d09ac,_0x3dc4('0x2e'));_0x41d89f[_0x3dc4('0x2f')]=_['keys'](_0x444e22['query']);_0x41d89f[_0x3dc4('0x30')]=_[_0x3dc4('0x31')](_0x41d89f[_0x3dc4('0x2d')],_0x41d89f[_0x3dc4('0x2f')]);_0x4031d4[_0x3dc4('0x32')]=_[_0x3dc4('0x31')](_0x41d89f[_0x3dc4('0x2d')],qs[_0x3dc4('0x33')](_0x444e22[_0x3dc4('0x2f')][_0x3dc4('0x33')]));_0x4031d4['attributes']=_0x4031d4[_0x3dc4('0x32')][_0x3dc4('0x34')]?_0x4031d4['attributes']:_0x41d89f[_0x3dc4('0x2d')];if(!_0x444e22[_0x3dc4('0x2f')]['hasOwnProperty'](_0x3dc4('0x35'))){_0x4031d4['limit']=qs['limit'](_0x444e22[_0x3dc4('0x2f')][_0x3dc4('0x36')]);_0x4031d4[_0x3dc4('0x1a')]=qs[_0x3dc4('0x1a')](_0x444e22[_0x3dc4('0x2f')][_0x3dc4('0x1a')]);}_0x4031d4[_0x3dc4('0x37')]=qs[_0x3dc4('0x38')](_0x444e22[_0x3dc4('0x2f')][_0x3dc4('0x38')]);_0x4031d4[_0x3dc4('0x39')]=qs[_0x3dc4('0x30')](_['pick'](_0x444e22[_0x3dc4('0x2f')],_0x41d89f[_0x3dc4('0x30')]),_0x3d09ac);if(_0x444e22[_0x3dc4('0x2f')][_0x3dc4('0x3a')]){_0x4031d4[_0x3dc4('0x39')]=_[_0x3dc4('0x3b')](_0x4031d4[_0x3dc4('0x39')],{'$or':_[_0x3dc4('0x28')](_0x3d09ac,function(_0x4a0ff7){if(_0x4a0ff7[_0x3dc4('0x2b')]!==_0x3dc4('0x3c')){var _0x1b7d15={};_0x1b7d15[_0x4a0ff7[_0x3dc4('0x2e')]]={'$like':'%'+_0x444e22['query'][_0x3dc4('0x3a')]+'%'};return _0x1b7d15;}})});}_0x4031d4=_[_0x3dc4('0x3b')]({},_0x4031d4,_0x444e22[_0x3dc4('0x3d')]);var _0x47075b={'where':_0x4031d4[_0x3dc4('0x39')]};return db[_0x3dc4('0x29')]['count'](_0x47075b)['then'](function(_0x27e0f7){_0x48836e[_0x3dc4('0x1c')]=_0x27e0f7;if(_0x444e22[_0x3dc4('0x2f')]['includeAll']){_0x4031d4[_0x3dc4('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x3dc4('0x3f')](_0x4031d4);})[_0x3dc4('0x21')](function(_0x236bcf){_0x48836e[_0x3dc4('0x40')]=_0x236bcf;return _0x48836e;})[_0x3dc4('0x21')](respondWithFilteredResult(_0x34e6c7,_0x4031d4))[_0x3dc4('0x41')](handleError(_0x34e6c7,null));};exports[_0x3dc4('0x42')]=function(_0x511088,_0x54eaaf){var _0x1b37b2={'raw':!![],'where':{'id':_0x511088['params']['id']}},_0xc0d89d={};_0xc0d89d['model']=_[_0x3dc4('0x43')](db['Pause'][_0x3dc4('0x44')]);_0xc0d89d[_0x3dc4('0x2f')]=_[_0x3dc4('0x43')](_0x511088[_0x3dc4('0x2f')]);_0xc0d89d[_0x3dc4('0x30')]=_[_0x3dc4('0x31')](_0xc0d89d[_0x3dc4('0x2d')],_0xc0d89d['query']);_0x1b37b2[_0x3dc4('0x32')]=_[_0x3dc4('0x31')](_0xc0d89d[_0x3dc4('0x2d')],qs[_0x3dc4('0x33')](_0x511088[_0x3dc4('0x2f')][_0x3dc4('0x33')]));_0x1b37b2[_0x3dc4('0x32')]=_0x1b37b2['attributes'][_0x3dc4('0x34')]?_0x1b37b2['attributes']:_0xc0d89d[_0x3dc4('0x2d')];if(_0x511088[_0x3dc4('0x2f')][_0x3dc4('0x45')]){_0x1b37b2['include']=[{'all':!![]}];}_0x1b37b2=_[_0x3dc4('0x3b')]({},_0x1b37b2,_0x511088[_0x3dc4('0x3d')]);return db[_0x3dc4('0x29')][_0x3dc4('0x46')](_0x1b37b2)[_0x3dc4('0x21')](handleEntityNotFound(_0x54eaaf,null))[_0x3dc4('0x21')](respondWithResult(_0x54eaaf,null))['catch'](handleError(_0x54eaaf,null));};exports[_0x3dc4('0x47')]=function(_0x1fed80,_0x8f93bf){return db[_0x3dc4('0x29')][_0x3dc4('0x47')](_0x1fed80[_0x3dc4('0x48')],{})[_0x3dc4('0x21')](function(_0x1308e9){var _0x2c8d16=_0x1fed80[_0x3dc4('0x49')][_0x3dc4('0x22')]({'plain':!![]});if(!_0x2c8d16)throw new Error(_0x3dc4('0x4a'));if(_0x2c8d16[_0x3dc4('0x4b')]===_0x3dc4('0x49')){var _0x445aa1=_0x1308e9[_0x3dc4('0x22')]({'plain':!![]});var _0x3797f7='Pauses';return db[_0x3dc4('0x4c')][_0x3dc4('0x46')]({'where':{'name':_0x3797f7,'userProfileId':_0x2c8d16[_0x3dc4('0x4d')]},'raw':!![]})['then'](function(_0x4d500d){if(_0x4d500d&&_0x4d500d[_0x3dc4('0x4e')]===0x0){return db[_0x3dc4('0x4f')][_0x3dc4('0x47')]({'name':_0x445aa1['name'],'resourceId':_0x445aa1['id'],'type':_0x4d500d[_0x3dc4('0x2e')],'sectionId':_0x4d500d['id']},{})[_0x3dc4('0x21')](function(){return _0x1308e9;});}else{return _0x1308e9;}})[_0x3dc4('0x41')](function(_0x4f2113){logger[_0x3dc4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2113);throw _0x4f2113;});}return _0x1308e9;})[_0x3dc4('0x21')](respondWithResult(_0x8f93bf,0xc9))[_0x3dc4('0x41')](handleError(_0x8f93bf,null));};exports[_0x3dc4('0x20')]=function(_0x29715c,_0x104823){if(_0x29715c[_0x3dc4('0x48')]['id']){delete _0x29715c['body']['id'];}return db[_0x3dc4('0x29')][_0x3dc4('0x46')]({'where':{'id':_0x29715c[_0x3dc4('0x50')]['id']}})[_0x3dc4('0x21')](handleEntityNotFound(_0x104823,null))['then'](saveUpdates(_0x29715c['body'],null))['then'](respondWithResult(_0x104823,null))[_0x3dc4('0x41')](handleError(_0x104823,null));};exports[_0x3dc4('0x24')]=function(_0x569bc5,_0xbf2176){return db[_0x3dc4('0x29')][_0x3dc4('0x46')]({'where':{'id':_0x569bc5[_0x3dc4('0x50')]['id']}})['then'](handleEntityNotFound(_0xbf2176,null))['then'](removeEntity(_0xbf2176,null))['catch'](handleError(_0xbf2176,null));}; \ No newline at end of file +var _0xaaac=['options','find','catch','create','body','user','role','Pauses','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','UserProfileResource','destroy','then','error','stack','name','send','index','Pause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xaaac,0x1af));var _0xcaaa=function(_0xafd22b,_0x23c68a){_0xafd22b=_0xafd22b-0x0;var _0x192abd=_0xaaac[_0xafd22b];return _0x192abd;};'use strict';var emlformat=require(_0xcaaa('0x0'));var rimraf=require(_0xcaaa('0x1'));var zipdir=require(_0xcaaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaaa('0x3'));var moment=require(_0xcaaa('0x4'));var BPromise=require(_0xcaaa('0x5'));var Mustache=require('mustache');var util=require(_0xcaaa('0x6'));var path=require(_0xcaaa('0x7'));var sox=require('sox');var csv=require(_0xcaaa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcaaa('0x9'));var _=require(_0xcaaa('0xa'));var squel=require(_0xcaaa('0xb'));var crypto=require(_0xcaaa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcaaa('0xd'));var toCsv=require(_0xcaaa('0x8'));var querystring=require(_0xcaaa('0xe'));var Papa=require(_0xcaaa('0xf'));var Redis=require(_0xcaaa('0x10'));var authService=require(_0xcaaa('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcaaa('0x12'));var logger=require('../../config/logger')(_0xcaaa('0x13'));var utils=require(_0xcaaa('0x14'));var config=require(_0xcaaa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcaaa('0x16'))['db'];function respondWithStatusCode(_0x1a26e1,_0x34f718){_0x34f718=_0x34f718||0xcc;return function(_0x2b7e0a){if(_0x2b7e0a){return _0x1a26e1[_0xcaaa('0x17')](_0x34f718);}return _0x1a26e1[_0xcaaa('0x18')](_0x34f718)[_0xcaaa('0x19')]();};}function respondWithResult(_0x3d8ed2,_0x1dd4df){_0x1dd4df=_0x1dd4df||0xc8;return function(_0x4ed113){if(_0x4ed113){return _0x3d8ed2[_0xcaaa('0x18')](_0x1dd4df)[_0xcaaa('0x1a')](_0x4ed113);}};}function respondWithFilteredResult(_0x1d8532,_0x234ed5){return function(_0x27e636){if(_0x27e636){var _0xda6ee0=typeof _0x234ed5[_0xcaaa('0x1b')]===_0xcaaa('0x1c')&&typeof _0x234ed5[_0xcaaa('0x1d')]==='undefined';var _0x1db4b7=_0x27e636[_0xcaaa('0x1e')];var _0x55c0f0=_0xda6ee0?0x0:_0x234ed5[_0xcaaa('0x1b')];var _0x3c9a86=_0xda6ee0?_0x27e636[_0xcaaa('0x1e')]:_0x234ed5['offset']+_0x234ed5[_0xcaaa('0x1d')];var _0x5a6f84;if(_0x3c9a86>=_0x1db4b7){_0x3c9a86=_0x1db4b7;_0x5a6f84=0xc8;}else{_0x5a6f84=0xce;}_0x1d8532[_0xcaaa('0x18')](_0x5a6f84);return _0x1d8532[_0xcaaa('0x1f')](_0xcaaa('0x20'),_0x55c0f0+'-'+_0x3c9a86+'/'+_0x1db4b7)[_0xcaaa('0x1a')](_0x27e636);}return null;};}function patchUpdates(_0x2b96c1){return function(_0x765a99){try{jsonpatch['apply'](_0x765a99,_0x2b96c1,!![]);}catch(_0x2565cb){return BPromise[_0xcaaa('0x21')](_0x2565cb);}return _0x765a99[_0xcaaa('0x22')]();};}function saveUpdates(_0x2f3195,_0x1f4b4){return function(_0x4a3c95){if(_0x4a3c95){return _0x4a3c95['update'](_0x2f3195)['then'](function(_0xd4f728){return _0xd4f728;});}return null;};}function removeEntity(_0x328c8d,_0xe4928d){return function(_0x5941af){if(_0x5941af){return _0x5941af['destroy']()['then'](function(){var _0x2c73a6=_0x5941af[_0xcaaa('0x23')]({'plain':!![]});var _0x1c09c6='Pauses';return db[_0xcaaa('0x24')][_0xcaaa('0x25')]({'where':{'type':_0x1c09c6,'resourceId':_0x2c73a6['id']}})[_0xcaaa('0x26')](function(){return _0x5941af;});})[_0xcaaa('0x26')](function(){_0x328c8d['status'](0xcc)[_0xcaaa('0x19')]();});}};}function handleEntityNotFound(_0x4036d9,_0x2422c2){return function(_0x3b770b){if(!_0x3b770b){_0x4036d9[_0xcaaa('0x17')](0x194);}return _0x3b770b;};}function handleError(_0x211408,_0x431fc9){_0x431fc9=_0x431fc9||0x1f4;return function(_0x62899e){logger[_0xcaaa('0x27')](_0x62899e[_0xcaaa('0x28')]);if(_0x62899e[_0xcaaa('0x29')]){delete _0x62899e[_0xcaaa('0x29')];}_0x211408[_0xcaaa('0x18')](_0x431fc9)[_0xcaaa('0x2a')](_0x62899e);};}exports[_0xcaaa('0x2b')]=function(_0x14e102,_0x1b9450){var _0x540b7c={},_0x30bae7={},_0x5b8c12={'count':0x0,'rows':[]};var _0x355a63=_['map'](db[_0xcaaa('0x2c')][_0xcaaa('0x2d')],function(_0x1a9ee8){return{'name':_0x1a9ee8[_0xcaaa('0x2e')],'type':_0x1a9ee8['type'][_0xcaaa('0x2f')]};});_0x30bae7[_0xcaaa('0x30')]=_[_0xcaaa('0x31')](_0x355a63,_0xcaaa('0x29'));_0x30bae7[_0xcaaa('0x32')]=_[_0xcaaa('0x33')](_0x14e102[_0xcaaa('0x32')]);_0x30bae7[_0xcaaa('0x34')]=_[_0xcaaa('0x35')](_0x30bae7[_0xcaaa('0x30')],_0x30bae7[_0xcaaa('0x32')]);_0x540b7c[_0xcaaa('0x36')]=_['intersection'](_0x30bae7[_0xcaaa('0x30')],qs[_0xcaaa('0x37')](_0x14e102['query'][_0xcaaa('0x37')]));_0x540b7c[_0xcaaa('0x36')]=_0x540b7c[_0xcaaa('0x36')][_0xcaaa('0x38')]?_0x540b7c[_0xcaaa('0x36')]:_0x30bae7[_0xcaaa('0x30')];if(!_0x14e102[_0xcaaa('0x32')][_0xcaaa('0x39')](_0xcaaa('0x3a'))){_0x540b7c[_0xcaaa('0x1d')]=qs['limit'](_0x14e102[_0xcaaa('0x32')]['limit']);_0x540b7c['offset']=qs[_0xcaaa('0x1b')](_0x14e102[_0xcaaa('0x32')][_0xcaaa('0x1b')]);}_0x540b7c[_0xcaaa('0x3b')]=qs[_0xcaaa('0x3c')](_0x14e102['query']['sort']);_0x540b7c[_0xcaaa('0x3d')]=qs[_0xcaaa('0x34')](_[_0xcaaa('0x3e')](_0x14e102[_0xcaaa('0x32')],_0x30bae7[_0xcaaa('0x34')]),_0x355a63);if(_0x14e102['query'][_0xcaaa('0x3f')]){_0x540b7c[_0xcaaa('0x3d')]=_[_0xcaaa('0x40')](_0x540b7c[_0xcaaa('0x3d')],{'$or':_[_0xcaaa('0x31')](_0x355a63,function(_0x31565d){if(_0x31565d[_0xcaaa('0x41')]!==_0xcaaa('0x42')){var _0x5b7fa5={};_0x5b7fa5[_0x31565d[_0xcaaa('0x29')]]={'$like':'%'+_0x14e102[_0xcaaa('0x32')][_0xcaaa('0x3f')]+'%'};return _0x5b7fa5;}})});}_0x540b7c=_['merge']({},_0x540b7c,_0x14e102['options']);var _0x5c1390={'where':_0x540b7c['where']};return db['Pause'][_0xcaaa('0x1e')](_0x5c1390)['then'](function(_0x6515ec){_0x5b8c12[_0xcaaa('0x1e')]=_0x6515ec;if(_0x14e102[_0xcaaa('0x32')][_0xcaaa('0x43')]){_0x540b7c[_0xcaaa('0x44')]=[{'all':!![]}];}return db[_0xcaaa('0x2c')][_0xcaaa('0x45')](_0x540b7c);})[_0xcaaa('0x26')](function(_0x98beb3){_0x5b8c12[_0xcaaa('0x46')]=_0x98beb3;return _0x5b8c12;})[_0xcaaa('0x26')](respondWithFilteredResult(_0x1b9450,_0x540b7c))['catch'](handleError(_0x1b9450,null));};exports[_0xcaaa('0x47')]=function(_0x49637a,_0x24bc89){var _0x1fafbe={'raw':!![],'where':{'id':_0x49637a[_0xcaaa('0x48')]['id']}},_0x43ce75={};_0x43ce75['model']=_[_0xcaaa('0x33')](db[_0xcaaa('0x2c')][_0xcaaa('0x2d')]);_0x43ce75[_0xcaaa('0x32')]=_[_0xcaaa('0x33')](_0x49637a[_0xcaaa('0x32')]);_0x43ce75[_0xcaaa('0x34')]=_[_0xcaaa('0x35')](_0x43ce75[_0xcaaa('0x30')],_0x43ce75[_0xcaaa('0x32')]);_0x1fafbe[_0xcaaa('0x36')]=_[_0xcaaa('0x35')](_0x43ce75[_0xcaaa('0x30')],qs[_0xcaaa('0x37')](_0x49637a[_0xcaaa('0x32')]['fields']));_0x1fafbe[_0xcaaa('0x36')]=_0x1fafbe['attributes'][_0xcaaa('0x38')]?_0x1fafbe[_0xcaaa('0x36')]:_0x43ce75['model'];if(_0x49637a[_0xcaaa('0x32')][_0xcaaa('0x43')]){_0x1fafbe[_0xcaaa('0x44')]=[{'all':!![]}];}_0x1fafbe=_[_0xcaaa('0x40')]({},_0x1fafbe,_0x49637a[_0xcaaa('0x49')]);return db[_0xcaaa('0x2c')][_0xcaaa('0x4a')](_0x1fafbe)[_0xcaaa('0x26')](handleEntityNotFound(_0x24bc89,null))[_0xcaaa('0x26')](respondWithResult(_0x24bc89,null))[_0xcaaa('0x4b')](handleError(_0x24bc89,null));};exports[_0xcaaa('0x4c')]=function(_0x1291e8,_0x2d4b61){return db['Pause'][_0xcaaa('0x4c')](_0x1291e8[_0xcaaa('0x4d')],{})[_0xcaaa('0x26')](function(_0x3700e3){var _0x2d5072=_0x1291e8[_0xcaaa('0x4e')]['get']({'plain':!![]});if(!_0x2d5072)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d5072[_0xcaaa('0x4f')]===_0xcaaa('0x4e')){var _0x96e56b=_0x3700e3[_0xcaaa('0x23')]({'plain':!![]});var _0x18c8b4=_0xcaaa('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x18c8b4,'userProfileId':_0x2d5072[_0xcaaa('0x51')]},'raw':!![]})[_0xcaaa('0x26')](function(_0x527791){if(_0x527791&&_0x527791['autoAssociation']===0x0){return db['UserProfileResource'][_0xcaaa('0x4c')]({'name':_0x96e56b['name'],'resourceId':_0x96e56b['id'],'type':_0x527791['name'],'sectionId':_0x527791['id']},{})[_0xcaaa('0x26')](function(){return _0x3700e3;});}else{return _0x3700e3;}})['catch'](function(_0x214e29){logger[_0xcaaa('0x27')](_0xcaaa('0x52'),_0x214e29);throw _0x214e29;});}return _0x3700e3;})[_0xcaaa('0x26')](respondWithResult(_0x2d4b61,0xc9))[_0xcaaa('0x4b')](handleError(_0x2d4b61,null));};exports[_0xcaaa('0x53')]=function(_0x500d09,_0x178614){if(_0x500d09[_0xcaaa('0x4d')]['id']){delete _0x500d09[_0xcaaa('0x4d')]['id'];}return db['Pause'][_0xcaaa('0x4a')]({'where':{'id':_0x500d09[_0xcaaa('0x48')]['id']}})['then'](handleEntityNotFound(_0x178614,null))[_0xcaaa('0x26')](saveUpdates(_0x500d09[_0xcaaa('0x4d')],null))[_0xcaaa('0x26')](respondWithResult(_0x178614,null))[_0xcaaa('0x4b')](handleError(_0x178614,null));};exports[_0xcaaa('0x25')]=function(_0x44de40,_0xce4f62){return db[_0xcaaa('0x2c')][_0xcaaa('0x4a')]({'where':{'id':_0x44de40[_0xcaaa('0x48')]['id']}})[_0xcaaa('0x26')](handleEntityNotFound(_0xce4f62,null))['then'](removeEntity(_0xce4f62,null))[_0xcaaa('0x4b')](handleError(_0xce4f62,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index dc0a7be..7f63330 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x49f603,_0x10e69a){var _0x43e306=function(_0x3cbcf3){while(--_0x3cbcf3){_0x49f603['push'](_0x49f603['shift']());}};_0x43e306(++_0x10e69a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x59a992,_0x58f718){_0x59a992=_0x59a992-0x0;var _0x2192a2=_0x1cb9[_0x59a992];return _0x2192a2;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x4e1b63,_0x4753bf){var _0x128308=function(_0x5d20f3){while(--_0x5d20f3){_0x4e1b63['push'](_0x4e1b63['shift']());}};_0x128308(++_0x4753bf);}(_0x326f,0xd1));var _0xf326=function(_0x5eac1a,_0x55c34d){_0x5eac1a=_0x5eac1a-0x0;var _0xccc6ca=_0x326f[_0x5eac1a];return _0xccc6ca;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 36a4be4..19213d8 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4fefc9,_0x1b03ff){var _0x944b43=function(_0x59bdad){while(--_0x59bdad){_0x4fefc9['push'](_0x4fefc9['shift']());}};_0x944b43(++_0x1b03ff);}(_0xb10b,0x12a));var _0xbb10=function(_0x34e725,_0x5633f8){_0x34e725=_0x34e725-0x0;var _0x57acc4=_0xb10b[_0x34e725];return _0x57acc4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +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(_0x11aca5,_0x27e435){var _0x3b8719=function(_0x487da0){while(--_0x487da0){_0x11aca5['push'](_0x11aca5['shift']());}};_0x3b8719(++_0x27e435);}(_0x7a54,0x106));var _0x47a5=function(_0x5bec36,_0x437675){_0x5bec36=_0x5bec36-0x0;var _0x4c3f30=_0x7a54[_0x5bec36];return _0x4c3f30;};'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 94c41a2..ac7b7f7 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 _0x6334=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','format','%s-%s%s','extname','now','originalname','post','file','upload','webhookPost','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x48a445,_0x406985){var _0x2746f2=function(_0xdb1226){while(--_0xdb1226){_0x48a445['push'](_0x48a445['shift']());}};_0x2746f2(++_0x406985);}(_0x6334,0x119));var _0x4633=function(_0x289842,_0x2d9db4){_0x289842=_0x289842-0x0;var _0x16155a=_0x6334[_0x289842];return _0x16155a;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4633('0x6'));var interaction=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var controller=require(_0x4633('0x9'));router[_0x4633('0xa')]('/',auth[_0x4633('0xb')](),controller[_0x4633('0xc')]);router['get'](_0x4633('0xd'),controller['webhookGet']);router[_0x4633('0xa')](_0x4633('0xe'),auth['isAuthenticated'](),controller[_0x4633('0xf')]);router[_0x4633('0xa')](_0x4633('0x10'),auth['isAuthenticated'](),controller[_0x4633('0x11')]);var upload=multer({'storage':multer[_0x4633('0x12')]({'destination':function(_0x5157a7,_0x6a63b,_0x3d5182){_0x3d5182(null,path[_0x4633('0x13')](config[_0x4633('0x14')],'server/files/plugins'));},'filename':function(_0x73b5e4,_0xad405,_0x438e87){_0xad405['originalname']=_0xad405['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x438e87(null,util[_0x4633('0x15')](_0x4633('0x16'),path['basename'](_0xad405['originalname'],path[_0x4633('0x17')](_0xad405['originalname'])),Date[_0x4633('0x18')](),path[_0x4633('0x17')](_0xad405[_0x4633('0x19')])));}})});router[_0x4633('0x1a')]('/',upload['single'](_0x4633('0x1b')),controller[_0x4633('0x1c')]);router[_0x4633('0x1a')]('/webhook',controller[_0x4633('0x1d')]);router[_0x4633('0x1e')](_0x4633('0xe'),auth[_0x4633('0xb')](),controller[_0x4633('0x1f')]);router['delete'](_0x4633('0xe'),auth[_0x4633('0xb')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xb4e6=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost'];(function(_0x3189b3,_0x1052c6){var _0x3be953=function(_0x3dcd83){while(--_0x3dcd83){_0x3189b3['push'](_0x3189b3['shift']());}};_0x3be953(++_0x1052c6);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb4e6[_0x125ff8];return _0x2d9ef;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/webhook',controller['webhookGet']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router[_0x6b4e('0x9')](_0x6b4e('0xc'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xd')]);var upload=multer({'storage':multer[_0x6b4e('0xe')]({'destination':function(_0x323487,_0x49c734,_0x39b4ec){_0x39b4ec(null,path[_0x6b4e('0xf')](config['root'],_0x6b4e('0x10')));},'filename':function(_0x9cd7da,_0x432399,_0x2b2ce0){_0x432399[_0x6b4e('0x11')]=_0x432399[_0x6b4e('0x11')][_0x6b4e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b2ce0(null,util['format'](_0x6b4e('0x13'),path[_0x6b4e('0x14')](_0x432399['originalname'],path[_0x6b4e('0x15')](_0x432399['originalname'])),Date[_0x6b4e('0x16')](),path[_0x6b4e('0x15')](_0x432399[_0x6b4e('0x11')])));}})});router[_0x6b4e('0x17')]('/',upload[_0x6b4e('0x18')](_0x6b4e('0x19')),controller['upload']);router['post'](_0x6b4e('0x1a'),controller[_0x6b4e('0x1b')]);router[_0x6b4e('0x1c')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1e')]);router[_0x6b4e('0x1f')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1f')]);module[_0x6b4e('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 64747c5..6d17ca6 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 _0x2e50=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html'];(function(_0x5769a7,_0x566457){var _0x36ead4=function(_0x716140){while(--_0x716140){_0x5769a7['push'](_0x5769a7['shift']());}};_0x36ead4(++_0x566457);}(_0x2e50,0xf8));var _0x02e5=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x2e50[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0x02e5('0x0'));module[_0x02e5('0x1')]={'name':{'type':Sequelize[_0x02e5('0x2')]},'type':{'type':Sequelize['ENUM'](_0x02e5('0x3'),_0x02e5('0x4'))},'description':{'type':Sequelize[_0x02e5('0x5')]},'version':{'type':Sequelize[_0x02e5('0x5')]},'path':{'type':Sequelize[_0x02e5('0x2')],'comment':_0x02e5('0x6')},'active':{'type':Sequelize[_0x02e5('0x7')],'defaultValue':0x0,'comment':_0x02e5('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x02e5('0x9'),_0x02e5('0xa'),'always',_0x02e5('0xb')),'defaultValue':_0x02e5('0xc'),'comment':_0x02e5('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x02e5('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x02e5('0x2')]},'scriptPath':{'type':Sequelize[_0x02e5('0x2')]}}; \ No newline at end of file +var _0xd667=['script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html'];(function(_0x2271e5,_0x6ea709){var _0x5a054e=function(_0x4d1cd0){while(--_0x4d1cd0){_0x2271e5['push'](_0x2271e5['shift']());}};_0x5a054e(++_0x6ea709);}(_0xd667,0xbf));var _0x7d66=function(_0x49bc23,_0x5a640f){_0x49bc23=_0x49bc23-0x0;var _0xf5359a=_0xd667[_0x49bc23];return _0xf5359a;};'use strict';var Sequelize=require(_0x7d66('0x0'));module[_0x7d66('0x1')]={'name':{'type':Sequelize[_0x7d66('0x2')]},'type':{'type':Sequelize['ENUM'](_0x7d66('0x3'),_0x7d66('0x4'))},'description':{'type':Sequelize[_0x7d66('0x5')]},'version':{'type':Sequelize[_0x7d66('0x5')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x7d66('0x6')],'defaultValue':0x0,'comment':_0x7d66('0x7')},'sidebar':{'type':Sequelize[_0x7d66('0x8')]('adminOnly',_0x7d66('0x9'),'always',_0x7d66('0xa')),'defaultValue':_0x7d66('0xb'),'comment':_0x7d66('0xc')},'icon':{'type':Sequelize[_0x7d66('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x7d66('0x2')]},'scriptName':{'type':Sequelize[_0x7d66('0x2')]},'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 a043464..3a604fc 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 _0xfb4e=['extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','UserProfileResource','name','send','index','map','Plugin','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','download','params','join','root','server/files/plugins','format','%s.zip','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','pipe','basename','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Download\x20completed','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','type','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','role','body','userProfileId','user','get','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xfb4e,0x13b));var _0xefb4=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0xfb4e[_0x2872b0];return _0x58b379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefb4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefb4('0x1'));var rp=require(_0xefb4('0x2'));var moment=require(_0xefb4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefb4('0x4'));var path=require(_0xefb4('0x5'));var sox=require(_0xefb4('0x6'));var csv=require(_0xefb4('0x7'));var ejs=require(_0xefb4('0x8'));var fs=require('fs');var fs_extra=require(_0xefb4('0x9'));var _=require(_0xefb4('0xa'));var squel=require(_0xefb4('0xb'));var crypto=require(_0xefb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xefb4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xefb4('0xe'));var extract=require(_0xefb4('0xf'));var rimraf=require(_0xefb4('0x0'));var archiver=require(_0xefb4('0x10'));var Redis=require(_0xefb4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xefb4('0x12'));var as=require(_0xefb4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xefb4('0x14'));var utils=require('../../config/utils');var config=require(_0xefb4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xefb4('0x16'))['db'];config[_0xefb4('0x17')]=_[_0xefb4('0x18')](config[_0xefb4('0x17')],{'host':_0xefb4('0x19'),'port':0x18eb});var socket=require(_0xefb4('0x1a'))(new Redis(config[_0xefb4('0x17')]));require(_0xefb4('0x1b'))[_0xefb4('0x1c')](socket);function respondWithStatusCode(_0x49d335,_0x162d09){_0x162d09=_0x162d09||0xcc;return function(_0x195ff2){if(_0x195ff2){return _0x49d335[_0xefb4('0x1d')](_0x162d09);}return _0x49d335[_0xefb4('0x1e')](_0x162d09)[_0xefb4('0x1f')]();};}function respondWithResult(_0x3a2805,_0x45245b){_0x45245b=_0x45245b||0xc8;return function(_0x513ee4){if(_0x513ee4){return _0x3a2805['status'](_0x45245b)[_0xefb4('0x20')](_0x513ee4);}};}function respondWithFilteredResult(_0x126612,_0x2b773d){return function(_0x50609d){if(_0x50609d){var _0x2193a2=typeof _0x2b773d[_0xefb4('0x21')]==='undefined'&&typeof _0x2b773d[_0xefb4('0x22')]===_0xefb4('0x23');var _0x5b7004=_0x50609d[_0xefb4('0x24')];var _0x22359c=_0x2193a2?0x0:_0x2b773d[_0xefb4('0x21')];var _0x512a82=_0x2193a2?_0x50609d[_0xefb4('0x24')]:_0x2b773d[_0xefb4('0x21')]+_0x2b773d[_0xefb4('0x22')];var _0x436c2d;if(_0x512a82>=_0x5b7004){_0x512a82=_0x5b7004;_0x436c2d=0xc8;}else{_0x436c2d=0xce;}_0x126612[_0xefb4('0x1e')](_0x436c2d);return _0x126612['set'](_0xefb4('0x25'),_0x22359c+'-'+_0x512a82+'/'+_0x5b7004)[_0xefb4('0x20')](_0x50609d);}return null;};}function patchUpdates(_0x27f1c5){return function(_0x33d1a1){try{jsonpatch[_0xefb4('0x26')](_0x33d1a1,_0x27f1c5,!![]);}catch(_0x1c6b3f){return BPromise['reject'](_0x1c6b3f);}return _0x33d1a1[_0xefb4('0x27')]();};}function saveUpdates(_0x167e1f,_0x2a4dee){return function(_0x3be321){if(_0x3be321){return _0x3be321[_0xefb4('0x28')](_0x167e1f)[_0xefb4('0x29')](function(_0x4db4ef){return _0x4db4ef;});}return null;};}function removeEntity(_0x2aff7d,_0x5a7f96){return function(_0x2553f3){if(_0x2553f3){return _0x2553f3[_0xefb4('0x2a')]()[_0xefb4('0x29')](function(){var _0x30c2d4=_0x2553f3['get']({'plain':!![]});var _0x1a2bff='Plugins';return db[_0xefb4('0x2b')]['destroy']({'where':{'type':_0x1a2bff,'resourceId':_0x30c2d4['id']}})[_0xefb4('0x29')](function(){return _0x2553f3;});})[_0xefb4('0x29')](function(){_0x2aff7d[_0xefb4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57bb05,_0x66ec9a){return function(_0x240a90){if(!_0x240a90){_0x57bb05['sendStatus'](0x194);}return _0x240a90;};}function handleError(_0x5e5f2e,_0xc781f6){_0xc781f6=_0xc781f6||0x1f4;return function(_0xa04630){logger['error'](_0xa04630['stack']);if(_0xa04630[_0xefb4('0x2c')]){delete _0xa04630[_0xefb4('0x2c')];}_0x5e5f2e['status'](_0xc781f6)[_0xefb4('0x2d')](_0xa04630);};}exports[_0xefb4('0x2e')]=function(_0x1a0268,_0x5d96db){var _0x5a64fc={},_0x1636aa={},_0x17f691={'count':0x0,'rows':[]};var _0x5b7e27=_[_0xefb4('0x2f')](db[_0xefb4('0x30')][_0xefb4('0x31')],function(_0x111889){return{'name':_0x111889[_0xefb4('0x32')],'type':_0x111889['type'][_0xefb4('0x33')]};});_0x1636aa[_0xefb4('0x34')]=_[_0xefb4('0x2f')](_0x5b7e27,_0xefb4('0x2c'));_0x1636aa[_0xefb4('0x35')]=_[_0xefb4('0x36')](_0x1a0268[_0xefb4('0x35')]);_0x1636aa[_0xefb4('0x37')]=_[_0xefb4('0x38')](_0x1636aa[_0xefb4('0x34')],_0x1636aa[_0xefb4('0x35')]);_0x5a64fc['attributes']=_['intersection'](_0x1636aa[_0xefb4('0x34')],qs[_0xefb4('0x39')](_0x1a0268[_0xefb4('0x35')][_0xefb4('0x39')]));_0x5a64fc[_0xefb4('0x3a')]=_0x5a64fc[_0xefb4('0x3a')]['length']?_0x5a64fc[_0xefb4('0x3a')]:_0x1636aa['model'];if(!_0x1a0268[_0xefb4('0x35')][_0xefb4('0x3b')](_0xefb4('0x3c'))){_0x5a64fc[_0xefb4('0x22')]=qs[_0xefb4('0x22')](_0x1a0268['query']['limit']);_0x5a64fc[_0xefb4('0x21')]=qs['offset'](_0x1a0268[_0xefb4('0x35')][_0xefb4('0x21')]);}_0x5a64fc['order']=qs[_0xefb4('0x3d')](_0x1a0268[_0xefb4('0x35')][_0xefb4('0x3d')]);_0x5a64fc[_0xefb4('0x3e')]=qs[_0xefb4('0x37')](_[_0xefb4('0x3f')](_0x1a0268[_0xefb4('0x35')],_0x1636aa[_0xefb4('0x37')]),_0x5b7e27);if(_0x1a0268[_0xefb4('0x35')][_0xefb4('0x40')]){_0x5a64fc[_0xefb4('0x3e')]=_['merge'](_0x5a64fc[_0xefb4('0x3e')],{'$or':_[_0xefb4('0x2f')](_0x5b7e27,function(_0x412d1d){if(_0x412d1d['type']!==_0xefb4('0x41')){var _0x5167d5={};_0x5167d5[_0x412d1d[_0xefb4('0x2c')]]={'$like':'%'+_0x1a0268[_0xefb4('0x35')][_0xefb4('0x40')]+'%'};return _0x5167d5;}})});}_0x5a64fc=_['merge']({},_0x5a64fc,_0x1a0268['options']);var _0x680ea1={'where':_0x5a64fc[_0xefb4('0x3e')]};return db[_0xefb4('0x30')][_0xefb4('0x24')](_0x680ea1)[_0xefb4('0x29')](function(_0x175c5d){_0x17f691[_0xefb4('0x24')]=_0x175c5d;if(_0x1a0268[_0xefb4('0x35')][_0xefb4('0x42')]){_0x5a64fc[_0xefb4('0x43')]=[{'all':!![]}];}return db[_0xefb4('0x30')][_0xefb4('0x44')](_0x5a64fc);})[_0xefb4('0x29')](function(_0x13c8cb){_0x17f691[_0xefb4('0x45')]=_0x13c8cb;return _0x17f691;})[_0xefb4('0x29')](respondWithFilteredResult(_0x5d96db,_0x5a64fc))[_0xefb4('0x46')](handleError(_0x5d96db,null));};exports[_0xefb4('0x47')]=function(_0xa78ad3,_0xd8bb49){var _0x42916e={'raw':!![],'where':{'id':_0xa78ad3['params']['id']}},_0x15e456={};_0x15e456['model']=_[_0xefb4('0x36')](db[_0xefb4('0x30')][_0xefb4('0x31')]);_0x15e456[_0xefb4('0x35')]=_[_0xefb4('0x36')](_0xa78ad3[_0xefb4('0x35')]);_0x15e456[_0xefb4('0x37')]=_[_0xefb4('0x38')](_0x15e456[_0xefb4('0x34')],_0x15e456['query']);_0x42916e['attributes']=_[_0xefb4('0x38')](_0x15e456[_0xefb4('0x34')],qs[_0xefb4('0x39')](_0xa78ad3[_0xefb4('0x35')][_0xefb4('0x39')]));_0x42916e[_0xefb4('0x3a')]=_0x42916e[_0xefb4('0x3a')][_0xefb4('0x48')]?_0x42916e['attributes']:_0x15e456[_0xefb4('0x34')];if(_0xa78ad3[_0xefb4('0x35')]['includeAll']){_0x42916e[_0xefb4('0x43')]=[{'all':!![]}];}_0x42916e=_['merge']({},_0x42916e,_0xa78ad3['options']);return db[_0xefb4('0x30')][_0xefb4('0x49')](_0x42916e)[_0xefb4('0x29')](handleEntityNotFound(_0xd8bb49,null))[_0xefb4('0x29')](respondWithResult(_0xd8bb49,null))[_0xefb4('0x46')](handleError(_0xd8bb49,null));};exports[_0xefb4('0x4a')]=function(_0x4110a4,_0x5037c3,_0x2e9a46){return db['Plugin'][_0xefb4('0x49')]({'where':{'id':_0x4110a4[_0xefb4('0x4b')]['id']},'attributes':[_0xefb4('0x2c'),_0xefb4('0x5')],'raw':!![]})[_0xefb4('0x29')](handleEntityNotFound(_0x5037c3,null))[_0xefb4('0x29')](function(_0x170dc8){if(_0x170dc8){var _0x287c3d=path[_0xefb4('0x4c')](config[_0xefb4('0x4d')],_0xefb4('0x4e'),util[_0xefb4('0x4f')](_0xefb4('0x50'),path['basename'](_0x170dc8[_0xefb4('0x5')])));var _0x4f3e2c=fs['createWriteStream'](_0x287c3d);var _0x49a61d=archiver(_0xefb4('0x51'),{'zlib':{'level':0x9}});_0x49a61d['on'](_0xefb4('0x52'),function(_0x20d107){if(_0x20d107['code']==='ENOENT'){logger['error'](_0x20d107);}else{throw new db[(_0xefb4('0x53'))][(_0xefb4('0x54'))](_0xefb4('0x55'));}});_0x49a61d['on'](_0xefb4('0x56'),function(_0x272791){throw new db[(_0xefb4('0x53'))][(_0xefb4('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x49a61d[_0xefb4('0x57')](_0x4f3e2c);_0x49a61d['glob']('**/*',{'cwd':path[_0xefb4('0x4c')](config[_0xefb4('0x4d')],'server/files/plugins',path['dirname'](_0x170dc8[_0xefb4('0x5')])),'ignore':[path[_0xefb4('0x4c')](path['basename'](_0x170dc8[_0xefb4('0x5')]),'node_modules/**/*'),path['join'](path[_0xefb4('0x58')](_0x170dc8['path']),_0xefb4('0x59'))],'nodir':!![]})['finalize']();_0x4f3e2c['on'](_0xefb4('0x5a'),function(){if(!fs[_0xefb4('0x5b')](_0x287c3d)){throw new db[(_0xefb4('0x53'))][(_0xefb4('0x54'))](_0xefb4('0x5c'));}return _0x5037c3['download'](_0x287c3d,util[_0xefb4('0x4f')](_0xefb4('0x50'),path['basename'](_0x170dc8['path'])),function(_0x2bfdb2){if(_0x2bfdb2){throw new db['Sequelize'][(_0xefb4('0x54'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x287c3d);logger['info'](_0xefb4('0x5d'));logger[_0xefb4('0x5e')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x5037c3,null));};exports[_0xefb4('0x5f')]=function(_0x32825c,_0x427926,_0x2160c6){var _0x56232f=path[_0xefb4('0x58')](_0x32825c[_0xefb4('0x60')][_0xefb4('0x61')],path[_0xefb4('0x62')](_0x32825c['file']['filename']));var _0x5aba67=path[_0xefb4('0x4c')](config['root'],'server/files/plugins',_0x32825c[_0xefb4('0x60')][_0xefb4('0x61')]);var _0x309ef6=path['join'](config['root'],_0xefb4('0x4e'),_0x56232f);logger[_0xefb4('0x5e')](_0xefb4('0x63'),_0x5aba67);logger[_0xefb4('0x5e')](_0xefb4('0x64'),_0x309ef6);try{fs[_0xefb4('0x65')](_0x5aba67,parseInt(_0xefb4('0x66'),0x8));extract(_0x5aba67,{'dir':_0x309ef6},function(_0x359e85){if(_0x359e85){logger[_0xefb4('0x56')](_0x359e85);handleError(_0x359e85,!![]);};var _0x192db9=fs[_0xefb4('0x67')](_0x309ef6);if(_0x192db9[_0xefb4('0x48')]>0x1){removeReferences(_0x5aba67,_0x309ef6);logger['error'](_0xefb4('0x68'));return _0x2160c6(new Error(_0xefb4('0x68')));}var _0x39bb0d=fs[_0xefb4('0x69')](path['join'](_0x309ef6,_0x192db9[0x0]));if(_0x39bb0d[_0xefb4('0x6a')]()){removeReferences(_0x5aba67,_0x309ef6);logger[_0xefb4('0x56')]('Invalid\x20plugin\x20structure');return _0x2160c6(new Error('Invalid\x20plugin\x20structure'));}if(_0x39bb0d[_0xefb4('0x6b')]()){var _0x1e6459=fs[_0xefb4('0x67')](path[_0xefb4('0x4c')](_0x309ef6,_0x192db9[0x0]));if(_0x1e6459[_0xefb4('0x48')]===0x0){removeReferences(_0x5aba67,_0x309ef6);logger[_0xefb4('0x56')](_0xefb4('0x68'));return _0x2160c6(new Error(_0xefb4('0x68')));}var _0x5888e4=_0x1e6459[_0xefb4('0x6c')](function(_0x2940a7){return _0x2940a7===_0xefb4('0x6d');});if(!_0x5888e4){return _0x2160c6(new Error(_0xefb4('0x6e')));}var _0x2edf72=fs['readFileSync'](path[_0xefb4('0x4c')](_0x309ef6,_0x192db9[0x0],_0xefb4('0x6d')));var _0x32ae09=JSON[_0xefb4('0x6f')](_0x2edf72);if(_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x2c')]){return _0x2160c6(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x32ae09[_0xefb4('0x70')]){return _0x2160c6(new Error(_0xefb4('0x71')));}if(_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x72')]){return _0x2160c6(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x32ae09[_0xefb4('0x73')]){return _0x2160c6(new Error(_0xefb4('0x74')));}if(_0x32ae09[_0xefb4('0x70')]===_0xefb4('0x75')){if(_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')]){return _0x2160c6(new Error(_0xefb4('0x77')));}if(_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x78')]&&_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x73')]['views'][_0xefb4('0x79')]){return _0x2160c6(new Error(_0xefb4('0x7a')));}}else if(_0x32ae09[_0xefb4('0x70')]===_0xefb4('0x7b')){if(_0xefb4('0x23')==typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x7c')]){return _0x2160c6(new Error(_0xefb4('0x7d')));}if('undefined'==typeof _0x32ae09[_0xefb4('0x73')]['scriptPath']){return _0x2160c6(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2160c6(new Error(_0xefb4('0x7e')));}var _0x29f1e0=_0x32ae09[_0xefb4('0x2c')];var _0x366bf7=_0x32ae09[_0xefb4('0x7f')];var _0x3e4be4=_0x32ae09[_0xefb4('0x70')];var _0x363d34=_0x32ae09[_0xefb4('0x80')]?_0x32ae09[_0xefb4('0x80')]:'always';var _0x3f3e64=_0x32ae09[_0xefb4('0x81')]?_0x32ae09[_0xefb4('0x81')]:_0xefb4('0x82');var _0x15f5a9='';var _0x255149='';var _0x13fbab='';var _0x10fad7='';var _0x59e420=_0x32ae09[_0xefb4('0x72')];if(_0x3e4be4===_0xefb4('0x75')){if(_0xefb4('0x23')!=typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')]['admin']){var _0x574d0d=_0x32ae09[_0xefb4('0x73')]['views'][_0xefb4('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xefb4('0x83')](_0x574d0d)){_0x15f5a9=path[_0xefb4('0x4c')](_0xefb4('0x84'),_0x56232f,_0x192db9[0x0],_0x574d0d);}else{_0x15f5a9=_0x574d0d;}}else{logger['info'](_0xefb4('0x85'));}if(_0xefb4('0x23')!=typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x79')]){var _0x192ddf=_0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x79')];if(!/^(f|ht)tps?:\/\//i['test'](_0x192ddf)){_0x255149=path[_0xefb4('0x4c')](_0xefb4('0x84'),_0x56232f,_0x192db9[0x0],_0x192ddf);}else{_0x255149=_0x192ddf;}}else{logger['info'](_0xefb4('0x86'));}}else if(_0x3e4be4===_0xefb4('0x7b')){_0x13fbab=_0x32ae09[_0xefb4('0x73')][_0xefb4('0x7c')];_0x10fad7=_0x32ae09[_0xefb4('0x73')][_0xefb4('0x87')];if(_0xefb4('0x23')!=typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')]){if('undefined'!=typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x78')]){var _0x574d0d=_0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x78')];if(!/^(f|ht)tps?:\/\//i[_0xefb4('0x83')](_0x574d0d)){_0x15f5a9=path[_0xefb4('0x4c')]('plugins',_0x56232f,_0x192db9[0x0],_0x574d0d);}else{_0x15f5a9=_0x574d0d;}}if(_0xefb4('0x23')!=typeof _0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')][_0xefb4('0x79')]){var _0x192ddf=_0x32ae09[_0xefb4('0x73')][_0xefb4('0x76')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xefb4('0x83')](_0x192ddf)){_0x255149=path[_0xefb4('0x4c')]('plugins',_0x56232f,_0x192db9[0x0],_0x192ddf);}else{_0x255149=_0x192ddf;}}}}var _0x4dc4fe={'name':_0x29f1e0,'description':_0x366bf7,'path':path[_0xefb4('0x4c')](_0x56232f,_0x192db9[0x0]),'type':_0x3e4be4,'sidebar':_0x363d34,'icon':_0x3f3e64,'adminUrl':_0x15f5a9,'agentUrl':_0x255149,'scriptName':_0x13fbab,'scriptPath':_0x10fad7,'version':_0x59e420};removeReferences(_0x5aba67,null);return db[_0xefb4('0x30')][_0xefb4('0x88')](_0x4dc4fe)[_0xefb4('0x29')](function(_0xa21d70){var _0x37f9c3={'role':_0x32825c['body'][_0xefb4('0x89')],'userProfileId':_0x32825c[_0xefb4('0x8a')][_0xefb4('0x8b')]};if(!_0x37f9c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37f9c3[_0xefb4('0x89')]===_0xefb4('0x8c')){var _0x102c70=_0xa21d70[_0xefb4('0x8d')]({'plain':!![]});return db['UserProfileSection'][_0xefb4('0x49')]({'where':{'name':_0xefb4('0x8e'),'userProfileId':_0x37f9c3[_0xefb4('0x8b')]},'raw':!![]})['then'](function(_0x264256){if(_0x264256&&_0x264256[_0xefb4('0x8f')]===0x0){return db[_0xefb4('0x2b')][_0xefb4('0x88')]({'name':_0x102c70[_0xefb4('0x2c')],'resourceId':_0x102c70['id'],'type':_0x264256[_0xefb4('0x2c')],'sectionId':_0x264256['id']},{})[_0xefb4('0x29')](function(){return _0xa21d70;});}else{return _0xa21d70;}})['catch'](function(_0x3b306c){logger[_0xefb4('0x56')](_0xefb4('0x90'),_0x3b306c);throw _0x3b306c;});}return _0xa21d70;})[_0xefb4('0x29')](respondWithResult(_0x427926,null))[_0xefb4('0x46')](handleError(_0x427926,null));}});}catch(_0x1a7be8){_0x427926[_0xefb4('0x1e')](0x1f4)[_0xefb4('0x2d')](_0x1a7be8);}};function removeReferences(_0x548e6c,_0x50ae8b){try{if(_0x548e6c){fs['unlinkSync'](_0x548e6c);logger[_0xefb4('0x5e')](_0xefb4('0x91'));}if(_0x50ae8b){rimraf(_0x50ae8b,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x2bf239){logger[_0xefb4('0x56')](_0x2bf239);}}exports[_0xefb4('0x28')]=function(_0x4305d0,_0x1c89af,_0x32e8fb){return db['Plugin'][_0xefb4('0x49')]({'where':{'id':_0x4305d0[_0xefb4('0x4b')]['id']}})[_0xefb4('0x29')](handleEntityNotFound(_0x1c89af,null))['then'](saveUpdates(_0x4305d0['body'],null))['then'](respondWithResult(_0x1c89af,null))[_0xefb4('0x46')](handleError(_0x1c89af,null));};exports[_0xefb4('0x92')]=function(_0x2e09dc,_0x53deea,_0x1d2d84){return db['Plugin'][_0xefb4('0x49')]({'where':{'id':_0x2e09dc[_0xefb4('0x4b')]['id']}})[_0xefb4('0x29')](function(_0x139289){if(_0x139289){return _0x139289['destroy']();}})['then'](function(_0x58fd8b){rimraf(path[_0xefb4('0x4c')](config[_0xefb4('0x4d')],_0xefb4('0x4e'),path[_0xefb4('0x93')](_0x58fd8b[_0xefb4('0x5')])),function(){});return _0x58fd8b;})[_0xefb4('0x29')](handleEntityNotFound(_0x53deea,null))[_0xefb4('0x29')](respondWithStatusCode(_0x53deea,null))['catch'](handleError(_0x53deea,null));};exports[_0xefb4('0x94')]=function(_0x16d5fb,_0x1dab7d,_0x25b0a1){return BPromise[_0xefb4('0x95')]()[_0xefb4('0x29')](function(){if(!_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x5')]){throw new Error(_0xefb4('0x96'));}if(!_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x97')]){throw new Error(_0xefb4('0x98'));}var _0x20a4e2=_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x99')]?_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x99')]+':'+_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x97')]:_0xefb4('0x9a')+_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x97')];var _0x3a82bb=_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x20')]?_0x16d5fb['query'][_0xefb4('0x20')]:!![];var _0x517b16=_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x9b')]?_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x9b')]:null;var _0x866abd={'method':_0x16d5fb[_0xefb4('0x9c')],'uri':util[_0xefb4('0x4f')](_0xefb4('0x9d'),_0x20a4e2,_0x16d5fb['query'][_0xefb4('0x5')]),'json':_0x3a82bb,'resolveWithFullResponse':!![],'encoding':_0x517b16,'qs':_0x16d5fb[_0xefb4('0x35')]};if(_0x16d5fb[_0xefb4('0x9e')]){_0x866abd['headers']=_0x16d5fb[_0xefb4('0x9e')];if(_0x866abd[_0xefb4('0x9e')][_0xefb4('0x9f')]){delete _0x866abd[_0xefb4('0x9e')][_0xefb4('0x9f')];}}if(_0x866abd['headers'][_0xefb4('0xa0')]){delete _0x866abd[_0xefb4('0x9e')][_0xefb4('0xa0')];}return rp(_0x866abd);})[_0xefb4('0x29')](function(_0x55bb00){if(_0x55bb00){_0x1dab7d[_0xefb4('0xa1')](_0x55bb00[_0xefb4('0x9e')]);logger['info'](_0x55bb00[_0xefb4('0x8a')]);if(_[_0xefb4('0xa2')](_0x16d5fb[_0xefb4('0x35')][_0xefb4('0x5')],'download')&&_0x55bb00[_0xefb4('0xa3')]==0x1f4){return _0x1dab7d['sendStatus'](_0x55bb00[_0xefb4('0xa3')]);}else{return _0x1dab7d[_0xefb4('0x1e')](_0x55bb00[_0xefb4('0xa3')])[_0xefb4('0x2d')](_0x55bb00[_0xefb4('0x8a')]);}}else{return _0x1dab7d[_0xefb4('0x1d')](0xc8);}})[_0xefb4('0x46')](handleError(_0x1dab7d,null));};exports[_0xefb4('0xa4')]=function(_0x30455a,_0x51e65a,_0x5ee4be){return BPromise[_0xefb4('0x95')]()[_0xefb4('0x29')](function(){if(!_0x30455a[_0xefb4('0x35')][_0xefb4('0x5')]){throw new Error(_0xefb4('0x96'));}if(!_0x30455a[_0xefb4('0x35')][_0xefb4('0x97')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x14768a=_0x30455a[_0xefb4('0x35')][_0xefb4('0x99')]?_0x30455a['query']['hostname']+':'+_0x30455a[_0xefb4('0x35')][_0xefb4('0x97')]:_0xefb4('0x9a')+_0x30455a[_0xefb4('0x35')][_0xefb4('0x97')];var _0x11c729=_0x30455a[_0xefb4('0x35')]['json']?_0x30455a['query'][_0xefb4('0x20')]:!![];var _0x336ed9=_0x30455a['query'][_0xefb4('0x9b')]?_0x30455a[_0xefb4('0x35')][_0xefb4('0x9b')]:null;var _0x5c838d={'method':_0x30455a[_0xefb4('0x9c')],'uri':util[_0xefb4('0x4f')](_0xefb4('0x9d'),_0x14768a,_0x30455a[_0xefb4('0x35')]['path']),'json':_0x11c729,'resolveWithFullResponse':!![],'encoding':_0x336ed9,'body':_0x30455a[_0xefb4('0x8a')]};if(_0x30455a[_0xefb4('0x9e')]){_0x5c838d['headers']=_0x30455a[_0xefb4('0x9e')];if(_0x5c838d[_0xefb4('0x9e')]['content-length']){delete _0x5c838d[_0xefb4('0x9e')][_0xefb4('0x9f')];}}if(_0x5c838d[_0xefb4('0x9e')][_0xefb4('0xa0')]){delete _0x5c838d[_0xefb4('0x9e')][_0xefb4('0xa0')];}return rp(_0x5c838d);})[_0xefb4('0x29')](function(_0x14b343){if(_0x14b343){_0x51e65a['set'](_0x14b343[_0xefb4('0x9e')]);logger['info'](_0x14b343[_0xefb4('0x8a')]);return _0x51e65a[_0xefb4('0x1e')](_0x14b343[_0xefb4('0xa3')])[_0xefb4('0x2d')](_0x14b343[_0xefb4('0x8a')]);}else{return _0x51e65a['sendStatus'](0xc8);}})[_0xefb4('0x46')](handleError(_0x51e65a,null));}; \ No newline at end of file +var _0x3d85=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','download','path','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','root','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','lstatSync','Invalid\x20plugin\x20structure','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','script','scriptName','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Plugins','UserProfileResource','name','send','map','Plugin','rawAttributes','fieldName','type','key'];(function(_0xd24b2e,_0x449c5a){var _0x3ed92a=function(_0x13ffec){while(--_0x13ffec){_0xd24b2e['push'](_0xd24b2e['shift']());}};_0x3ed92a(++_0x449c5a);}(_0x3d85,0x74));var _0x53d8=function(_0x133a52,_0x2754f1){_0x133a52=_0x133a52-0x0;var _0x3f60cd=_0x3d85[_0x133a52];return _0x3f60cd;};'use strict';var emlformat=require(_0x53d8('0x0'));var rimraf=require(_0x53d8('0x1'));var zipdir=require(_0x53d8('0x2'));var jsonpatch=require(_0x53d8('0x3'));var rp=require('request-promise');var moment=require(_0x53d8('0x4'));var BPromise=require(_0x53d8('0x5'));var Mustache=require(_0x53d8('0x6'));var util=require(_0x53d8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x53d8('0x8'));var ejs=require(_0x53d8('0x9'));var fs=require('fs');var fs_extra=require(_0x53d8('0xa'));var _=require(_0x53d8('0xb'));var squel=require(_0x53d8('0xc'));var crypto=require(_0x53d8('0xd'));var jsforce=require(_0x53d8('0xe'));var deskjs=require(_0x53d8('0xf'));var toCsv=require(_0x53d8('0x8'));var querystring=require('querystring');var Papa=require(_0x53d8('0x10'));var extract=require(_0x53d8('0x11'));var rimraf=require('rimraf');var archiver=require(_0x53d8('0x12'));var Redis=require(_0x53d8('0x13'));var authService=require(_0x53d8('0x14'));var qs=require(_0x53d8('0x15'));var as=require(_0x53d8('0x16'));var hardwareService=require(_0x53d8('0x17'));var logger=require(_0x53d8('0x18'))(_0x53d8('0x19'));var utils=require(_0x53d8('0x1a'));var config=require(_0x53d8('0x1b'));var licenseUtil=require(_0x53d8('0x1c'));var db=require(_0x53d8('0x1d'))['db'];config['redis']=_['defaults'](config[_0x53d8('0x1e')],{'host':_0x53d8('0x1f'),'port':0x18eb});var socket=require(_0x53d8('0x20'))(new Redis(config[_0x53d8('0x1e')]));require(_0x53d8('0x21'))[_0x53d8('0x22')](socket);function respondWithStatusCode(_0x1f1dd4,_0x3901aa){_0x3901aa=_0x3901aa||0xcc;return function(_0x4e9d2e){if(_0x4e9d2e){return _0x1f1dd4[_0x53d8('0x23')](_0x3901aa);}return _0x1f1dd4['status'](_0x3901aa)[_0x53d8('0x24')]();};}function respondWithResult(_0x3c219a,_0x89599d){_0x89599d=_0x89599d||0xc8;return function(_0x15b4cd){if(_0x15b4cd){return _0x3c219a[_0x53d8('0x25')](_0x89599d)[_0x53d8('0x26')](_0x15b4cd);}};}function respondWithFilteredResult(_0x538e5e,_0x344aca){return function(_0x388cb1){if(_0x388cb1){var _0x2a42f6=typeof _0x344aca[_0x53d8('0x27')]===_0x53d8('0x28')&&typeof _0x344aca[_0x53d8('0x29')]===_0x53d8('0x28');var _0x1cdfdb=_0x388cb1['count'];var _0x49ec34=_0x2a42f6?0x0:_0x344aca['offset'];var _0xc55dc3=_0x2a42f6?_0x388cb1[_0x53d8('0x2a')]:_0x344aca[_0x53d8('0x27')]+_0x344aca[_0x53d8('0x29')];var _0x3fd0e6;if(_0xc55dc3>=_0x1cdfdb){_0xc55dc3=_0x1cdfdb;_0x3fd0e6=0xc8;}else{_0x3fd0e6=0xce;}_0x538e5e[_0x53d8('0x25')](_0x3fd0e6);return _0x538e5e[_0x53d8('0x2b')](_0x53d8('0x2c'),_0x49ec34+'-'+_0xc55dc3+'/'+_0x1cdfdb)[_0x53d8('0x26')](_0x388cb1);}return null;};}function patchUpdates(_0x11292a){return function(_0x1fe0a3){try{jsonpatch[_0x53d8('0x2d')](_0x1fe0a3,_0x11292a,!![]);}catch(_0x73c20c){return BPromise[_0x53d8('0x2e')](_0x73c20c);}return _0x1fe0a3['save']();};}function saveUpdates(_0x5cd93c,_0x1fa23c){return function(_0x2d8e38){if(_0x2d8e38){return _0x2d8e38[_0x53d8('0x2f')](_0x5cd93c)['then'](function(_0x1ab243){return _0x1ab243;});}return null;};}function removeEntity(_0x5eedb3,_0x285255){return function(_0x55aba2){if(_0x55aba2){return _0x55aba2[_0x53d8('0x30')]()[_0x53d8('0x31')](function(){var _0x56e836=_0x55aba2[_0x53d8('0x32')]({'plain':!![]});var _0x39870e=_0x53d8('0x33');return db[_0x53d8('0x34')][_0x53d8('0x30')]({'where':{'type':_0x39870e,'resourceId':_0x56e836['id']}})[_0x53d8('0x31')](function(){return _0x55aba2;});})[_0x53d8('0x31')](function(){_0x5eedb3[_0x53d8('0x25')](0xcc)[_0x53d8('0x24')]();});}};}function handleEntityNotFound(_0xa7c861,_0x5d63ee){return function(_0x5f2d18){if(!_0x5f2d18){_0xa7c861[_0x53d8('0x23')](0x194);}return _0x5f2d18;};}function handleError(_0x95f861,_0x5add7b){_0x5add7b=_0x5add7b||0x1f4;return function(_0x525da6){logger['error'](_0x525da6['stack']);if(_0x525da6[_0x53d8('0x35')]){delete _0x525da6[_0x53d8('0x35')];}_0x95f861[_0x53d8('0x25')](_0x5add7b)[_0x53d8('0x36')](_0x525da6);};}exports['index']=function(_0x2bd1ec,_0x1991ec){var _0x213918={},_0x31fe30={},_0x18bb18={'count':0x0,'rows':[]};var _0x18f51a=_[_0x53d8('0x37')](db[_0x53d8('0x38')][_0x53d8('0x39')],function(_0x5956d5){return{'name':_0x5956d5[_0x53d8('0x3a')],'type':_0x5956d5[_0x53d8('0x3b')][_0x53d8('0x3c')]};});_0x31fe30[_0x53d8('0x3d')]=_[_0x53d8('0x37')](_0x18f51a,_0x53d8('0x35'));_0x31fe30[_0x53d8('0x3e')]=_[_0x53d8('0x3f')](_0x2bd1ec['query']);_0x31fe30[_0x53d8('0x40')]=_[_0x53d8('0x41')](_0x31fe30[_0x53d8('0x3d')],_0x31fe30[_0x53d8('0x3e')]);_0x213918[_0x53d8('0x42')]=_[_0x53d8('0x41')](_0x31fe30[_0x53d8('0x3d')],qs['fields'](_0x2bd1ec[_0x53d8('0x3e')][_0x53d8('0x43')]));_0x213918[_0x53d8('0x42')]=_0x213918[_0x53d8('0x42')][_0x53d8('0x44')]?_0x213918[_0x53d8('0x42')]:_0x31fe30['model'];if(!_0x2bd1ec['query'][_0x53d8('0x45')](_0x53d8('0x46'))){_0x213918['limit']=qs[_0x53d8('0x29')](_0x2bd1ec['query']['limit']);_0x213918[_0x53d8('0x27')]=qs['offset'](_0x2bd1ec['query']['offset']);}_0x213918[_0x53d8('0x47')]=qs[_0x53d8('0x48')](_0x2bd1ec[_0x53d8('0x3e')][_0x53d8('0x48')]);_0x213918[_0x53d8('0x49')]=qs[_0x53d8('0x40')](_[_0x53d8('0x4a')](_0x2bd1ec[_0x53d8('0x3e')],_0x31fe30[_0x53d8('0x40')]),_0x18f51a);if(_0x2bd1ec['query'][_0x53d8('0x4b')]){_0x213918['where']=_[_0x53d8('0x4c')](_0x213918[_0x53d8('0x49')],{'$or':_['map'](_0x18f51a,function(_0x4e86e5){if(_0x4e86e5[_0x53d8('0x3b')]!==_0x53d8('0x4d')){var _0x2521a6={};_0x2521a6[_0x4e86e5['name']]={'$like':'%'+_0x2bd1ec[_0x53d8('0x3e')][_0x53d8('0x4b')]+'%'};return _0x2521a6;}})});}_0x213918=_[_0x53d8('0x4c')]({},_0x213918,_0x2bd1ec[_0x53d8('0x4e')]);var _0x4fd265={'where':_0x213918[_0x53d8('0x49')]};return db[_0x53d8('0x38')][_0x53d8('0x2a')](_0x4fd265)[_0x53d8('0x31')](function(_0x22dcd2){_0x18bb18['count']=_0x22dcd2;if(_0x2bd1ec['query'][_0x53d8('0x4f')]){_0x213918[_0x53d8('0x50')]=[{'all':!![]}];}return db[_0x53d8('0x38')][_0x53d8('0x51')](_0x213918);})['then'](function(_0x5d62a9){_0x18bb18[_0x53d8('0x52')]=_0x5d62a9;return _0x18bb18;})[_0x53d8('0x31')](respondWithFilteredResult(_0x1991ec,_0x213918))[_0x53d8('0x53')](handleError(_0x1991ec,null));};exports['show']=function(_0x41b0d3,_0x5ef250){var _0x5efc65={'raw':!![],'where':{'id':_0x41b0d3[_0x53d8('0x54')]['id']}},_0x1d7847={};_0x1d7847[_0x53d8('0x3d')]=_[_0x53d8('0x3f')](db[_0x53d8('0x38')][_0x53d8('0x39')]);_0x1d7847[_0x53d8('0x3e')]=_[_0x53d8('0x3f')](_0x41b0d3[_0x53d8('0x3e')]);_0x1d7847[_0x53d8('0x40')]=_[_0x53d8('0x41')](_0x1d7847[_0x53d8('0x3d')],_0x1d7847[_0x53d8('0x3e')]);_0x5efc65[_0x53d8('0x42')]=_[_0x53d8('0x41')](_0x1d7847[_0x53d8('0x3d')],qs[_0x53d8('0x43')](_0x41b0d3[_0x53d8('0x3e')]['fields']));_0x5efc65[_0x53d8('0x42')]=_0x5efc65[_0x53d8('0x42')]['length']?_0x5efc65[_0x53d8('0x42')]:_0x1d7847[_0x53d8('0x3d')];if(_0x41b0d3['query'][_0x53d8('0x4f')]){_0x5efc65[_0x53d8('0x50')]=[{'all':!![]}];}_0x5efc65=_['merge']({},_0x5efc65,_0x41b0d3[_0x53d8('0x4e')]);return db[_0x53d8('0x38')][_0x53d8('0x55')](_0x5efc65)['then'](handleEntityNotFound(_0x5ef250,null))[_0x53d8('0x31')](respondWithResult(_0x5ef250,null))['catch'](handleError(_0x5ef250,null));};exports[_0x53d8('0x56')]=function(_0x433a57,_0x178777,_0x515b51){return db[_0x53d8('0x38')][_0x53d8('0x55')]({'where':{'id':_0x433a57[_0x53d8('0x54')]['id']},'attributes':[_0x53d8('0x35'),_0x53d8('0x57')],'raw':!![]})[_0x53d8('0x31')](handleEntityNotFound(_0x178777,null))[_0x53d8('0x31')](function(_0x584a6d){if(_0x584a6d){var _0x26bbcf=path['join'](config['root'],_0x53d8('0x58'),util[_0x53d8('0x59')](_0x53d8('0x5a'),path[_0x53d8('0x5b')](_0x584a6d[_0x53d8('0x57')])));var _0x6eb3bf=fs[_0x53d8('0x5c')](_0x26bbcf);var _0x26d078=archiver(_0x53d8('0x5d'),{'zlib':{'level':0x9}});_0x26d078['on'](_0x53d8('0x5e'),function(_0x306b84){if(_0x306b84[_0x53d8('0x5f')]===_0x53d8('0x60')){logger[_0x53d8('0x61')](_0x306b84);}else{throw new db[(_0x53d8('0x62'))][(_0x53d8('0x63'))](_0x53d8('0x64'));}});_0x26d078['on']('error',function(_0xe6ebe9){throw new db['Sequelize'][(_0x53d8('0x63'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x26d078[_0x53d8('0x65')](_0x6eb3bf);_0x26d078[_0x53d8('0x66')]('**/*',{'cwd':path[_0x53d8('0x67')](config[_0x53d8('0x68')],_0x53d8('0x58'),path['dirname'](_0x584a6d['path'])),'ignore':[path['join'](path['basename'](_0x584a6d['path']),_0x53d8('0x69')),path[_0x53d8('0x67')](path['basename'](_0x584a6d[_0x53d8('0x57')]),'attachments/**/*')],'nodir':!![]})[_0x53d8('0x6a')]();_0x6eb3bf['on']('close',function(){if(!fs[_0x53d8('0x6b')](_0x26bbcf)){throw new db['Sequelize'][(_0x53d8('0x63'))](_0x53d8('0x6c'));}return _0x178777[_0x53d8('0x56')](_0x26bbcf,util[_0x53d8('0x59')](_0x53d8('0x5a'),path[_0x53d8('0x5b')](_0x584a6d['path'])),function(_0x261c33){if(_0x261c33){throw new db[(_0x53d8('0x62'))][(_0x53d8('0x63'))](_0x53d8('0x6d'));}fs[_0x53d8('0x6e')](_0x26bbcf);logger[_0x53d8('0x6f')](_0x53d8('0x70'));logger[_0x53d8('0x6f')](_0x53d8('0x71'));});});}return null;})['catch'](handleError(_0x178777,null));};exports[_0x53d8('0x72')]=function(_0x5c293a,_0x2d9a61,_0x5c58cf){var _0x42573c=path['basename'](_0x5c293a['file'][_0x53d8('0x73')],path[_0x53d8('0x74')](_0x5c293a[_0x53d8('0x75')][_0x53d8('0x73')]));var _0x3b09ca=path[_0x53d8('0x67')](config[_0x53d8('0x68')],_0x53d8('0x58'),_0x5c293a[_0x53d8('0x75')]['filename']);var _0x3d64c7=path[_0x53d8('0x67')](config['root'],_0x53d8('0x58'),_0x42573c);logger[_0x53d8('0x6f')](_0x53d8('0x76'),_0x3b09ca);logger[_0x53d8('0x6f')]('Plugin\x20upload\x20destination:\x20%s',_0x3d64c7);try{fs[_0x53d8('0x77')](_0x3b09ca,parseInt(_0x53d8('0x78'),0x8));extract(_0x3b09ca,{'dir':_0x3d64c7},function(_0x483f78){if(_0x483f78){logger[_0x53d8('0x61')](_0x483f78);handleError(_0x483f78,!![]);};var _0x41ce7e=fs[_0x53d8('0x79')](_0x3d64c7);if(_0x41ce7e[_0x53d8('0x44')]>0x1){removeReferences(_0x3b09ca,_0x3d64c7);logger[_0x53d8('0x61')]('Invalid\x20plugin\x20structure');return _0x5c58cf(new Error('Invalid\x20plugin\x20structure'));}var _0xaa5d04=fs[_0x53d8('0x7a')](path[_0x53d8('0x67')](_0x3d64c7,_0x41ce7e[0x0]));if(_0xaa5d04['isFile']()){removeReferences(_0x3b09ca,_0x3d64c7);logger[_0x53d8('0x61')](_0x53d8('0x7b'));return _0x5c58cf(new Error('Invalid\x20plugin\x20structure'));}if(_0xaa5d04['isDirectory']()){var _0x24dfc3=fs[_0x53d8('0x79')](path[_0x53d8('0x67')](_0x3d64c7,_0x41ce7e[0x0]));if(_0x24dfc3[_0x53d8('0x44')]===0x0){removeReferences(_0x3b09ca,_0x3d64c7);logger[_0x53d8('0x61')](_0x53d8('0x7b'));return _0x5c58cf(new Error(_0x53d8('0x7b')));}var _0x1afea9=_0x24dfc3['some'](function(_0x67728e){return _0x67728e==='manifest.json';});if(!_0x1afea9){return _0x5c58cf(new Error(_0x53d8('0x7c')));}var _0x3cffa9=fs[_0x53d8('0x7d')](path[_0x53d8('0x67')](_0x3d64c7,_0x41ce7e[0x0],_0x53d8('0x7e')));var _0xe2a541=JSON['parse'](_0x3cffa9);if(_0x53d8('0x28')==typeof _0xe2a541['name']){return _0x5c58cf(new Error(_0x53d8('0x7f')));}if('undefined'==typeof _0xe2a541[_0x53d8('0x3b')]){return _0x5c58cf(new Error(_0x53d8('0x80')));}if(_0x53d8('0x28')==typeof _0xe2a541[_0x53d8('0x81')]){return _0x5c58cf(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x53d8('0x28')==typeof _0xe2a541[_0x53d8('0x82')]){return _0x5c58cf(new Error(_0x53d8('0x83')));}if(_0xe2a541[_0x53d8('0x3b')]===_0x53d8('0x84')){if('undefined'==typeof _0xe2a541[_0x53d8('0x82')][_0x53d8('0x85')]){return _0x5c58cf(new Error(_0x53d8('0x86')));}if('undefined'==typeof _0xe2a541[_0x53d8('0x82')]['views'][_0x53d8('0x87')]&&_0x53d8('0x28')==typeof _0xe2a541['parameters'][_0x53d8('0x85')][_0x53d8('0x88')]){return _0x5c58cf(new Error(_0x53d8('0x89')));}}else if(_0xe2a541[_0x53d8('0x3b')]==='script'){if(_0x53d8('0x28')==typeof _0xe2a541[_0x53d8('0x82')]['scriptName']){return _0x5c58cf(new Error(_0x53d8('0x8a')));}if('undefined'==typeof _0xe2a541[_0x53d8('0x82')][_0x53d8('0x8b')]){return _0x5c58cf(new Error(_0x53d8('0x8c')));}}else{return _0x5c58cf(new Error(_0x53d8('0x8d')));}var _0x31a14b=_0xe2a541['name'];var _0x2bb964=_0xe2a541['description'];var _0x35b23e=_0xe2a541[_0x53d8('0x3b')];var _0x51c60b=_0xe2a541['sidebar']?_0xe2a541[_0x53d8('0x8e')]:_0x53d8('0x8f');var _0x3487a7=_0xe2a541['icon']?_0xe2a541[_0x53d8('0x90')]:_0x53d8('0x91');var _0x3760d9='';var _0x557841='';var _0x131f07='';var _0x5dea7d='';var _0x1e5e8f=_0xe2a541['version'];if(_0x35b23e==='html'){if('undefined'!=typeof _0xe2a541[_0x53d8('0x82')][_0x53d8('0x85')][_0x53d8('0x87')]){var _0x2b377a=_0xe2a541[_0x53d8('0x82')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x53d8('0x92')](_0x2b377a)){_0x3760d9=path[_0x53d8('0x67')]('plugins',_0x42573c,_0x41ce7e[0x0],_0x2b377a);}else{_0x3760d9=_0x2b377a;}}else{logger[_0x53d8('0x6f')](_0x53d8('0x93'));}if(_0x53d8('0x28')!=typeof _0xe2a541[_0x53d8('0x82')]['views']['agent']){var _0x4973ff=_0xe2a541[_0x53d8('0x82')][_0x53d8('0x85')][_0x53d8('0x88')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4973ff)){_0x557841=path['join'](_0x53d8('0x94'),_0x42573c,_0x41ce7e[0x0],_0x4973ff);}else{_0x557841=_0x4973ff;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x35b23e===_0x53d8('0x95')){_0x131f07=_0xe2a541['parameters'][_0x53d8('0x96')];_0x5dea7d=_0xe2a541[_0x53d8('0x82')][_0x53d8('0x8b')];if('undefined'!=typeof _0xe2a541['parameters']['views']){if(_0x53d8('0x28')!=typeof _0xe2a541[_0x53d8('0x82')]['views'][_0x53d8('0x87')]){var _0x2b377a=_0xe2a541[_0x53d8('0x82')][_0x53d8('0x85')][_0x53d8('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x53d8('0x92')](_0x2b377a)){_0x3760d9=path[_0x53d8('0x67')](_0x53d8('0x94'),_0x42573c,_0x41ce7e[0x0],_0x2b377a);}else{_0x3760d9=_0x2b377a;}}if('undefined'!=typeof _0xe2a541[_0x53d8('0x82')][_0x53d8('0x85')][_0x53d8('0x88')]){var _0x4973ff=_0xe2a541[_0x53d8('0x82')]['views'][_0x53d8('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x53d8('0x92')](_0x4973ff)){_0x557841=path[_0x53d8('0x67')](_0x53d8('0x94'),_0x42573c,_0x41ce7e[0x0],_0x4973ff);}else{_0x557841=_0x4973ff;}}}}var _0x4f2520={'name':_0x31a14b,'description':_0x2bb964,'path':path['join'](_0x42573c,_0x41ce7e[0x0]),'type':_0x35b23e,'sidebar':_0x51c60b,'icon':_0x3487a7,'adminUrl':_0x3760d9,'agentUrl':_0x557841,'scriptName':_0x131f07,'scriptPath':_0x5dea7d,'version':_0x1e5e8f};removeReferences(_0x3b09ca,null);return db[_0x53d8('0x38')]['create'](_0x4f2520)[_0x53d8('0x31')](function(_0x10b67d){var _0x5a5f8a={'role':_0x5c293a[_0x53d8('0x97')]['role'],'userProfileId':_0x5c293a[_0x53d8('0x97')][_0x53d8('0x98')]};if(!_0x5a5f8a)throw new Error(_0x53d8('0x99'));if(_0x5a5f8a['role']===_0x53d8('0x9a')){var _0x68c22=_0x10b67d['get']({'plain':!![]});return db[_0x53d8('0x9b')]['find']({'where':{'name':'Plugins','userProfileId':_0x5a5f8a[_0x53d8('0x98')]},'raw':!![]})[_0x53d8('0x31')](function(_0x1d3e13){if(_0x1d3e13&&_0x1d3e13[_0x53d8('0x9c')]===0x0){return db[_0x53d8('0x34')]['create']({'name':_0x68c22[_0x53d8('0x35')],'resourceId':_0x68c22['id'],'type':_0x1d3e13[_0x53d8('0x35')],'sectionId':_0x1d3e13['id']},{})[_0x53d8('0x31')](function(){return _0x10b67d;});}else{return _0x10b67d;}})[_0x53d8('0x53')](function(_0x5d05cc){logger[_0x53d8('0x61')](_0x53d8('0x9d'),_0x5d05cc);throw _0x5d05cc;});}return _0x10b67d;})['then'](respondWithResult(_0x2d9a61,null))[_0x53d8('0x53')](handleError(_0x2d9a61,null));}});}catch(_0x59ec64){_0x2d9a61[_0x53d8('0x25')](0x1f4)[_0x53d8('0x36')](_0x59ec64);}};function removeReferences(_0x1fa654,_0x35d358){try{if(_0x1fa654){fs[_0x53d8('0x6e')](_0x1fa654);logger['info'](_0x53d8('0x9e'));}if(_0x35d358){rimraf(_0x35d358,function(){});logger[_0x53d8('0x6f')]('Extracted\x20folder\x20removed');}}catch(_0xfb75b){logger[_0x53d8('0x61')](_0xfb75b);}}exports['update']=function(_0x3b9a4,_0x2b1672,_0x32e217){return db[_0x53d8('0x38')][_0x53d8('0x55')]({'where':{'id':_0x3b9a4[_0x53d8('0x54')]['id']}})[_0x53d8('0x31')](handleEntityNotFound(_0x2b1672,null))[_0x53d8('0x31')](saveUpdates(_0x3b9a4[_0x53d8('0x97')],null))[_0x53d8('0x31')](respondWithResult(_0x2b1672,null))[_0x53d8('0x53')](handleError(_0x2b1672,null));};exports[_0x53d8('0x9f')]=function(_0x1f49cb,_0x5b53e0,_0x2c2bcd){return db[_0x53d8('0x38')][_0x53d8('0x55')]({'where':{'id':_0x1f49cb[_0x53d8('0x54')]['id']}})['then'](function(_0x41963a){if(_0x41963a){return _0x41963a['destroy']();}})['then'](function(_0xd387fe){rimraf(path[_0x53d8('0x67')](config[_0x53d8('0x68')],_0x53d8('0x58'),path[_0x53d8('0xa0')](_0xd387fe[_0x53d8('0x57')])),function(){});return _0xd387fe;})[_0x53d8('0x31')](handleEntityNotFound(_0x5b53e0,null))[_0x53d8('0x31')](respondWithStatusCode(_0x5b53e0,null))[_0x53d8('0x53')](handleError(_0x5b53e0,null));};exports[_0x53d8('0xa1')]=function(_0x4621cb,_0x559a34,_0x1864e4){return BPromise['resolve']()[_0x53d8('0x31')](function(){if(!_0x4621cb[_0x53d8('0x3e')]['path']){throw new Error(_0x53d8('0xa2'));}if(!_0x4621cb['query'][_0x53d8('0xa3')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x385c99=_0x4621cb[_0x53d8('0x3e')]['hostname']?_0x4621cb[_0x53d8('0x3e')]['hostname']+':'+_0x4621cb[_0x53d8('0x3e')][_0x53d8('0xa3')]:_0x53d8('0xa4')+_0x4621cb[_0x53d8('0x3e')]['port'];var _0x36f22d=_0x4621cb['query'][_0x53d8('0x26')]?_0x4621cb[_0x53d8('0x3e')][_0x53d8('0x26')]:!![];var _0x13c9fa=_0x4621cb['query'][_0x53d8('0xa5')]?_0x4621cb[_0x53d8('0x3e')][_0x53d8('0xa5')]:null;var _0x48ab13={'method':_0x4621cb[_0x53d8('0xa6')],'uri':util[_0x53d8('0x59')](_0x53d8('0xa7'),_0x385c99,_0x4621cb['query'][_0x53d8('0x57')]),'json':_0x36f22d,'resolveWithFullResponse':!![],'encoding':_0x13c9fa,'qs':_0x4621cb['query']};if(_0x4621cb['headers']){_0x48ab13['headers']=_0x4621cb[_0x53d8('0xa8')];if(_0x48ab13['headers'][_0x53d8('0xa9')]){delete _0x48ab13[_0x53d8('0xa8')][_0x53d8('0xa9')];}}if(_0x48ab13[_0x53d8('0xa8')]['content-type']){delete _0x48ab13['headers'][_0x53d8('0xaa')];}return rp(_0x48ab13);})['then'](function(_0x3b8469){if(_0x3b8469){_0x559a34[_0x53d8('0x2b')](_0x3b8469['headers']);logger[_0x53d8('0x6f')](_0x3b8469[_0x53d8('0x97')]);if(_[_0x53d8('0xab')](_0x4621cb[_0x53d8('0x3e')][_0x53d8('0x57')],_0x53d8('0x56'))&&_0x3b8469[_0x53d8('0xac')]==0x1f4){return _0x559a34['sendStatus'](_0x3b8469['statusCode']);}else{return _0x559a34[_0x53d8('0x25')](_0x3b8469['statusCode'])[_0x53d8('0x36')](_0x3b8469[_0x53d8('0x97')]);}}else{return _0x559a34['sendStatus'](0xc8);}})[_0x53d8('0x53')](handleError(_0x559a34,null));};exports[_0x53d8('0xad')]=function(_0x25f08f,_0x4f204e,_0x39366a){return BPromise[_0x53d8('0xae')]()[_0x53d8('0x31')](function(){if(!_0x25f08f[_0x53d8('0x3e')][_0x53d8('0x57')]){throw new Error(_0x53d8('0xa2'));}if(!_0x25f08f[_0x53d8('0x3e')][_0x53d8('0xa3')]){throw new Error(_0x53d8('0xaf'));}var _0x799e91=_0x25f08f[_0x53d8('0x3e')][_0x53d8('0xb0')]?_0x25f08f['query'][_0x53d8('0xb0')]+':'+_0x25f08f[_0x53d8('0x3e')][_0x53d8('0xa3')]:_0x53d8('0xa4')+_0x25f08f[_0x53d8('0x3e')]['port'];var _0x5e4446=_0x25f08f[_0x53d8('0x3e')][_0x53d8('0x26')]?_0x25f08f[_0x53d8('0x3e')][_0x53d8('0x26')]:!![];var _0x58328a=_0x25f08f[_0x53d8('0x3e')][_0x53d8('0xa5')]?_0x25f08f[_0x53d8('0x3e')][_0x53d8('0xa5')]:null;var _0x466c9f={'method':_0x25f08f[_0x53d8('0xa6')],'uri':util[_0x53d8('0x59')](_0x53d8('0xa7'),_0x799e91,_0x25f08f[_0x53d8('0x3e')]['path']),'json':_0x5e4446,'resolveWithFullResponse':!![],'encoding':_0x58328a,'body':_0x25f08f[_0x53d8('0x97')]};if(_0x25f08f[_0x53d8('0xa8')]){_0x466c9f[_0x53d8('0xa8')]=_0x25f08f[_0x53d8('0xa8')];if(_0x466c9f[_0x53d8('0xa8')][_0x53d8('0xa9')]){delete _0x466c9f[_0x53d8('0xa8')][_0x53d8('0xa9')];}}if(_0x466c9f[_0x53d8('0xa8')][_0x53d8('0xaa')]){delete _0x466c9f['headers'][_0x53d8('0xaa')];}return rp(_0x466c9f);})[_0x53d8('0x31')](function(_0x325935){if(_0x325935){_0x4f204e[_0x53d8('0x2b')](_0x325935[_0x53d8('0xa8')]);logger['info'](_0x325935[_0x53d8('0x97')]);return _0x4f204e[_0x53d8('0x25')](_0x325935['statusCode'])[_0x53d8('0x36')](_0x325935['body']);}else{return _0x4f204e['sendStatus'](0xc8);}})[_0x53d8('0x53')](handleError(_0x4f204e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e4400af..10aaa31 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 _0x4cfd=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x358a22,_0x29afb9){var _0x356acc=function(_0x2213f5){while(--_0x2213f5){_0x358a22['push'](_0x358a22['shift']());}};_0x356acc(++_0x29afb9);}(_0x4cfd,0x170));var _0xd4cf=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x4cfd[_0x2e8418];return _0x548fe6;};'use strict';var EventEmitter=require(_0xd4cf('0x0'));var Plugin=require(_0xd4cf('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xd4cf('0x2')](0x0);var events={'afterCreate':_0xd4cf('0x3'),'afterUpdate':_0xd4cf('0x4'),'afterDestroy':_0xd4cf('0x5')};function emitEvent(_0x332f55){return function(_0xe90497,_0x4e6f40,_0x1b69e1){PluginEvents[_0xd4cf('0x6')](_0x332f55+':'+_0xe90497['id'],_0xe90497);PluginEvents[_0xd4cf('0x6')](_0x332f55,_0xe90497);_0x1b69e1(null);};}for(var e in events){if(events[_0xd4cf('0x7')](e)){var event=events[e];Plugin[_0xd4cf('0x8')](e,emitEvent(event));}}module[_0xd4cf('0x9')]=PluginEvents; \ No newline at end of file +var _0x78d3=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2dc74f,_0x5a307c){var _0x3171b8=function(_0x39af18){while(--_0x39af18){_0x2dc74f['push'](_0x2dc74f['shift']());}};_0x3171b8(++_0x5a307c);}(_0x78d3,0x73));var _0x378d=function(_0x343c56,_0x3c0577){_0x343c56=_0x343c56-0x0;var _0x203ecd=_0x78d3[_0x343c56];return _0x203ecd;};'use strict';var EventEmitter=require(_0x378d('0x0'));var Plugin=require(_0x378d('0x1'))['db'][_0x378d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x378d('0x3')](0x0);var events={'afterCreate':_0x378d('0x4'),'afterUpdate':_0x378d('0x5'),'afterDestroy':_0x378d('0x6')};function emitEvent(_0x29273c){return function(_0x52f934,_0x32a62f,_0x23360d){PluginEvents[_0x378d('0x7')](_0x29273c+':'+_0x52f934['id'],_0x52f934);PluginEvents[_0x378d('0x7')](_0x29273c,_0x52f934);_0x23360d(null);};}for(var e in events){if(events[_0x378d('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b957d71..fb0dd81 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 _0x102b=['Plugin','plugins','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x102b,0x1be));var _0xb102=function(_0x37d9b8,_0x3500f1){_0x37d9b8=_0x37d9b8-0x0;var _0x58e987=_0x102b[_0x37d9b8];return _0x58e987;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var logger=require('../../config/logger')(_0xb102('0x1'));var moment=require(_0xb102('0x2'));var BPromise=require(_0xb102('0x3'));var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require(_0xb102('0x8'));module['exports']=function(_0x3325b7,_0x370baa){return _0x3325b7[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','plugins','lodash'];(function(_0x3cc81e,_0x435f44){var _0x5b15e3=function(_0x4eadb5){while(--_0x4eadb5){_0x3cc81e['push'](_0x3cc81e['shift']());}};_0x5b15e3(++_0x435f44);}(_0xabce,0x103));var _0xeabc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xabce[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./plugin.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Plugin',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c6c07d4..67c9f33 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 _0x6582=['CreatePlugin','create','options','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','then','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6582,0x1b3));var _0x2658=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x6582[_0xe59443];return _0x155142;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2658('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2658('0x5'));var logger=require(_0x2658('0x6'))('rpc');var config=require(_0x2658('0x7'));var jayson=require(_0x2658('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2658('0x9')](config[_0x2658('0xa')],{'host':_0x2658('0xb'),'port':0x18eb});var socket=require(_0x2658('0xc'))(new Redis(config[_0x2658('0xa')]));require('./plugin.socket')[_0x2658('0xd')](socket);function respondWithRpcPromise(_0x3ecdcf,_0xa97d50,_0x21f17a){return new BPromise(function(_0x2f66f0,_0x4580aa){return client['request'](_0x3ecdcf,_0x21f17a)[_0x2658('0xe')](function(_0x3342ab){logger['info'](_0x2658('0xf'),_0xa97d50,'request\x20sent');logger['debug'](_0x2658('0x10'),_0xa97d50,'request\x20sent',JSON[_0x2658('0x11')](_0x3342ab));if(_0x3342ab[_0x2658('0x12')]){if(_0x3342ab[_0x2658('0x12')][_0x2658('0x13')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xa97d50,_0x3342ab[_0x2658('0x12')][_0x2658('0x14')]);return _0x4580aa(_0x3342ab[_0x2658('0x12')]['message']);}logger[_0x2658('0x12')](_0x2658('0xf'),_0xa97d50,_0x3342ab['error'][_0x2658('0x14')]);return _0x2f66f0(_0x3342ab[_0x2658('0x12')]['message']);}else{logger[_0x2658('0x15')](_0x2658('0xf'),_0xa97d50,'request\x20sent');_0x2f66f0(_0x3342ab[_0x2658('0x16')][_0x2658('0x14')]);}})[_0x2658('0x17')](function(_0x39f531){logger['error']('Plugin,\x20%s,\x20%s',_0xa97d50,_0x39f531);_0x4580aa(_0x39f531);});});}exports[_0x2658('0x18')]=function(_0xa629e4){var _0x28def4=this;return new Promise(function(_0x510b71,_0x1d7e57){return db['Plugin'][_0x2658('0x19')](_0xa629e4['body'],{'raw':_0xa629e4['options']?_0xa629e4[_0x2658('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2658('0xe')](function(_0x524e9b){logger[_0x2658('0x15')](_0x2658('0x18'),_0xa629e4);logger['debug'](_0x2658('0x18'),_0xa629e4,JSON[_0x2658('0x11')](_0x524e9b));_0x510b71(_0x524e9b);})[_0x2658('0x17')](function(_0x4aec6c){logger[_0x2658('0x12')](_0x2658('0x18'),_0x4aec6c[_0x2658('0x14')],_0xa629e4);_0x1d7e57(_0x28def4['error'](0x1f4,_0x4aec6c[_0x2658('0x14')]));});});}; \ No newline at end of file +var _0xba1b=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request'];(function(_0x373f29,_0x3df72f){var _0x22a2c3=function(_0x2763a3){while(--_0x2763a3){_0x373f29['push'](_0x373f29['shift']());}};_0x22a2c3(++_0x3df72f);}(_0xba1b,0x1d1));var _0xbba1=function(_0x118986,_0x2ea044){_0x118986=_0x118986-0x0;var _0x25c9e6=_0xba1b[_0x118986];return _0x25c9e6;};'use strict';var _=require('lodash');var util=require(_0xbba1('0x0'));var moment=require(_0xbba1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbba1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbba1('0x3'));var config=require(_0xbba1('0x4'));var jayson=require(_0xbba1('0x5'));var client=jayson[_0xbba1('0x6')][_0xbba1('0x7')]({'port':0x232a});config[_0xbba1('0x8')]=_[_0xbba1('0x9')](config[_0xbba1('0x8')],{'host':_0xbba1('0xa'),'port':0x18eb});var socket=require(_0xbba1('0xb'))(new Redis(config[_0xbba1('0x8')]));require(_0xbba1('0xc'))[_0xbba1('0xd')](socket);function respondWithRpcPromise(_0x20d0cf,_0x1a8e81,_0x6ce23a){return new BPromise(function(_0x4dbb4a,_0x4227d4){return client[_0xbba1('0xe')](_0x20d0cf,_0x6ce23a)[_0xbba1('0xf')](function(_0x32bfaa){logger[_0xbba1('0x10')](_0xbba1('0x11'),_0x1a8e81,_0xbba1('0x12'));logger[_0xbba1('0x13')](_0xbba1('0x14'),_0x1a8e81,_0xbba1('0x12'),JSON[_0xbba1('0x15')](_0x32bfaa));if(_0x32bfaa[_0xbba1('0x16')]){if(_0x32bfaa[_0xbba1('0x16')]['code']===0x1f4){logger[_0xbba1('0x16')](_0xbba1('0x11'),_0x1a8e81,_0x32bfaa['error']['message']);return _0x4227d4(_0x32bfaa[_0xbba1('0x16')][_0xbba1('0x17')]);}logger[_0xbba1('0x16')](_0xbba1('0x11'),_0x1a8e81,_0x32bfaa[_0xbba1('0x16')][_0xbba1('0x17')]);return _0x4dbb4a(_0x32bfaa[_0xbba1('0x16')]['message']);}else{logger[_0xbba1('0x10')]('Plugin,\x20%s,\x20%s',_0x1a8e81,_0xbba1('0x12'));_0x4dbb4a(_0x32bfaa[_0xbba1('0x18')][_0xbba1('0x17')]);}})[_0xbba1('0x19')](function(_0x57b5a2){logger[_0xbba1('0x16')]('Plugin,\x20%s,\x20%s',_0x1a8e81,_0x57b5a2);_0x4227d4(_0x57b5a2);});});}exports[_0xbba1('0x1a')]=function(_0x4527b9){var _0x8183ac=this;return new Promise(function(_0x194725,_0xda95d3){return db[_0xbba1('0x1b')][_0xbba1('0x1c')](_0x4527b9[_0xbba1('0x1d')],{'raw':_0x4527b9[_0xbba1('0x1e')]?_0x4527b9[_0xbba1('0x1e')][_0xbba1('0x1f')]===undefined?!![]:![]:!![]})[_0xbba1('0xf')](function(_0x29115c){logger[_0xbba1('0x10')](_0xbba1('0x1a'),_0x4527b9);logger[_0xbba1('0x13')](_0xbba1('0x1a'),_0x4527b9,JSON[_0xbba1('0x15')](_0x29115c));_0x194725(_0x29115c);})['catch'](function(_0x2853c4){logger[_0xbba1('0x16')]('CreatePlugin',_0x2853c4['message'],_0x4527b9);_0xda95d3(_0x8183ac[_0xbba1('0x16')](0x1f4,_0x2853c4[_0xbba1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index fd6bb93..b05f944 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 _0x4271=['./plugin.events','save','remove','update','removeListener','length','plugin:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4271,0x18f));var _0x1427=function(_0x225939,_0x5f5d9e){_0x225939=_0x225939-0x0;var _0x557283=_0x4271[_0x225939];return _0x557283;};'use strict';var PluginEvents=require(_0x1427('0x0'));var events=[_0x1427('0x1'),_0x1427('0x2'),_0x1427('0x3')];function createListener(_0x5f0138,_0x51ead4){return function(_0x140e30){_0x51ead4['emit'](_0x5f0138,_0x140e30);};}function removeListener(_0x2326c9,_0x39f9d9){return function(){PluginEvents[_0x1427('0x4')](_0x2326c9,_0x39f9d9);};}exports['register']=function(_0x4b4fc6){for(var _0x2e3b89=0x0,_0x373801=events[_0x1427('0x5')];_0x2e3b89<_0x373801;_0x2e3b89++){var _0x5dd823=events[_0x2e3b89];var _0x5b3542=createListener(_0x1427('0x6')+_0x5dd823,_0x4b4fc6);PluginEvents['on'](_0x5dd823,_0x5b3542);}}; \ No newline at end of file +var _0xcdee=['remove','update','emit','removeListener','plugin:','./plugin.events','save'];(function(_0xf75a3e,_0x3550b2){var _0x2f9d73=function(_0x39d7af){while(--_0x39d7af){_0xf75a3e['push'](_0xf75a3e['shift']());}};_0x2f9d73(++_0x3550b2);}(_0xcdee,0x10f));var _0xecde=function(_0x58c9f2,_0xf97608){_0x58c9f2=_0x58c9f2-0x0;var _0xc80882=_0xcdee[_0x58c9f2];return _0xc80882;};'use strict';var PluginEvents=require(_0xecde('0x0'));var events=[_0xecde('0x1'),_0xecde('0x2'),_0xecde('0x3')];function createListener(_0x594667,_0x592915){return function(_0xa75d63){_0x592915[_0xecde('0x4')](_0x594667,_0xa75d63);};}function removeListener(_0x52c8f3,_0x3e1227){return function(){PluginEvents[_0xecde('0x5')](_0x52c8f3,_0x3e1227);};}exports['register']=function(_0x118e55){for(var _0x31b27f=0x0,_0x1aef27=events['length'];_0x31b27f<_0x1aef27;_0x31b27f++){var _0x37f9b2=events[_0x31b27f];var _0x2fa7af=createListener(_0xecde('0x6')+_0x37f9b2,_0x118e55);PluginEvents['on'](_0x37f9b2,_0x2fa7af);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 5c7f31d..5da47a7 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(_0x4f97be,_0xae4d92){var _0x34ce21=function(_0x152ed0){while(--_0x152ed0){_0x4f97be['push'](_0x4f97be['shift']());}};_0x34ce21(++_0xae4d92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x5084e7,_0x496348){var _0x5772e6=function(_0x3a465d){while(--_0x3a465d){_0x5084e7['push'](_0x5084e7['shift']());}};_0x5772e6(++_0x496348);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 3690a36..25de251 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 _0x7072=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','express','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump'];(function(_0x372c58,_0x51e42c){var _0x44e74e=function(_0x2ad837){while(--_0x2ad837){_0x372c58['push'](_0x372c58['shift']());}};_0x44e74e(++_0x51e42c);}(_0x7072,0x138));var _0x2707=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7072[_0xef8146];return _0x5a6cb0;};'use strict';var _=require('lodash');var pm2=require(_0x2707('0x0'));var logger=require(_0x2707('0x1'))(_0x2707('0x2'));var path=require(_0x2707('0x3'));var exec=require(_0x2707('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0xfdfa7a,_0x5f3c1c){return function(_0xd36287){if(!_0xd36287){_0xfdfa7a[_0x2707('0x5')](0x194);;}return _0xd36287;};}function respondWithResult(_0x1e86f2,_0x194132){_0x194132=_0x194132||0xc8;return function(_0x2fd8ff){if(_0x2fd8ff){return _0x1e86f2[_0x2707('0x6')](_0x194132)[_0x2707('0x7')](_0x2fd8ff);}return null;};}function handleError(_0x745cfd,_0x4062b6){_0x4062b6=_0x4062b6||0x1f4;return function(_0x2820ef){logger['error'](_0x2820ef['stack']);if(_0x2820ef[_0x2707('0x8')]){delete _0x2820ef[_0x2707('0x8')];}_0x745cfd[_0x2707('0x6')](_0x4062b6)[_0x2707('0x9')](_0x2820ef);};}function execChildProcess(){return new BPromise(function(_0x30090e,_0x2e1a46){exec(_0x2707('0xa'),function(_0x19881c,_0x115535,_0x478717){logger[_0x2707('0xb')](_0x115535);logger[_0x2707('0xb')](_0x478717);if(_0x19881c){logger[_0x2707('0xc')](_0x19881c);return _0x2e1a46(_0x19881c);}return _0x30090e(_0x115535);});});}exports['index']=function(_0x44c1d7,_0x590152){return pm2[_0x2707('0xd')]()[_0x2707('0xe')](function(_0xfe975c){if(_0xfe975c){var _0x3a67f2=_[_0x2707('0xf')](_0xfe975c,function(_0x4e52a3){return _0x4e52a3[_0x2707('0x8')]===_0x2707('0x10')||_0x4e52a3[_0x2707('0x8')]==='motion2';});return{'rows':_0x3a67f2,'count':_0x3a67f2[_0x2707('0x11')]};}return null;})[_0x2707('0xe')](respondWithResult(_0x590152,null))[_0x2707('0x12')](handleError(_0x590152,null));};exports[_0x2707('0x13')]=function(_0x7ed037,_0x27a3ea){return pm2['describe'](_0x7ed037[_0x2707('0x14')]['id'])[_0x2707('0xe')](respondWithResult(_0x27a3ea,null))[_0x2707('0xe')](handleEntityNotFound(_0x27a3ea,null))['catch'](handleError(_0x27a3ea,null));};exports['create']=function(_0x58a4ee,_0x1da4a6){if(_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')]&&_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]){var _0x3c2935=path[_0x2707('0x17')](__dirname,_0x2707('0x18'),_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]);var _0x37c475=process[_0x2707('0x19')]();process[_0x2707('0x1a')](path[_0x2707('0x1b')](_0x3c2935));return execChildProcess()['then'](function(_0x1acf22){process[_0x2707('0x1a')](_0x37c475);return pm2[_0x2707('0x1c')]({'name':_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')],'script':_0x3c2935});})[_0x2707('0xe')](function(_0x4831ed){pm2[_0x2707('0x1d')]();return _0x4831ed[0x0];})[_0x2707('0xe')](respondWithResult(_0x1da4a6,0xc9))[_0x2707('0x12')](handleError(_0x1da4a6,null));}else{return _0x1da4a6[_0x2707('0x6')](0x1f4)[_0x2707('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2707('0x1e')]=function(_0x4ca05d,_0x29dad2){if(_0x4ca05d[_0x2707('0x15')]['id']){delete _0x4ca05d[_0x2707('0x15')]['id'];}var _0x57da26={'online':_0x2707('0x1f'),'stopped':_0x2707('0x20')};if(_0x57da26[_0x2707('0x21')](_0x4ca05d['body'][_0x2707('0x6')])){return pm2[_0x57da26[_0x4ca05d[_0x2707('0x15')]['status']]](_0x4ca05d[_0x2707('0x14')]['id'])['then'](respondWithResult(_0x29dad2,0xc8))['catch'](handleError(_0x29dad2,null));}else{return _0x29dad2[_0x2707('0x6')](0x1f4)['send']({'message':_0x2707('0x22')});}};exports[_0x2707('0x23')]=function(_0x417a97,_0x36b2e9){if(_0x417a97['body']['id']){delete _0x417a97[_0x2707('0x15')]['id'];}if(_0x417a97[_0x2707('0x14')]['id']){return pm2[_0x2707('0x24')](_0x417a97[_0x2707('0x14')]['id'])[_0x2707('0xe')](function(_0x341e14){pm2[_0x2707('0x1d')]();return _0x341e14[0x0];})[_0x2707('0xe')](respondWithResult(_0x36b2e9,null))[_0x2707('0x12')](handleError(_0x36b2e9,null));}else{return _0x36b2e9['status'](0x1f4)[_0x2707('0x9')]({'message':_0x2707('0x25')});}}; \ No newline at end of file +var _0xb43b=['stack','name','send','npm\x20install','info','index','list','express','then','describe','catch','create','body','script','join','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','bluebird','status','json'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3f4bde,_0x55dd6b){_0x3f4bde=_0x3f4bde-0x0;var _0x34ba33=_0xb43b[_0x3f4bde];return _0x34ba33;};'use strict';var _=require(_0xbb43('0x0'));var pm2=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var path=require(_0xbb43('0x3'));var exec=require(_0xbb43('0x4'))['exec'];var BPromise=require(_0xbb43('0x5'));function handleEntityNotFound(_0x41aff6,_0x351254){return function(_0x16432a){if(!_0x16432a){_0x41aff6['sendStatus'](0x194);;}return _0x16432a;};}function respondWithResult(_0x491fb9,_0x378df5){_0x378df5=_0x378df5||0xc8;return function(_0x553520){if(_0x553520){return _0x491fb9[_0xbb43('0x6')](_0x378df5)[_0xbb43('0x7')](_0x553520);}return null;};}function handleError(_0x2a2f11,_0x29ae1a){_0x29ae1a=_0x29ae1a||0x1f4;return function(_0x364718){logger['error'](_0x364718[_0xbb43('0x8')]);if(_0x364718[_0xbb43('0x9')]){delete _0x364718['name'];}_0x2a2f11[_0xbb43('0x6')](_0x29ae1a)[_0xbb43('0xa')](_0x364718);};}function execChildProcess(){return new BPromise(function(_0xd37cdf,_0x5e3611){exec(_0xbb43('0xb'),function(_0x2bef86,_0x480cc2,_0x36a473){logger[_0xbb43('0xc')](_0x480cc2);logger['info'](_0x36a473);if(_0x2bef86){logger['error'](_0x2bef86);return _0x5e3611(_0x2bef86);}return _0xd37cdf(_0x480cc2);});});}exports[_0xbb43('0xd')]=function(_0x4a3714,_0x593d0b){return pm2[_0xbb43('0xe')]()['then'](function(_0x68d45d){if(_0x68d45d){var _0x43021d=_['reject'](_0x68d45d,function(_0x4a6e18){return _0x4a6e18['name']===_0xbb43('0xf')||_0x4a6e18[_0xbb43('0x9')]==='motion2';});return{'rows':_0x43021d,'count':_0x43021d['length']};}return null;})[_0xbb43('0x10')](respondWithResult(_0x593d0b,null))['catch'](handleError(_0x593d0b,null));};exports['show']=function(_0x2b0797,_0x8242ab){return pm2[_0xbb43('0x11')](_0x2b0797['params']['id'])[_0xbb43('0x10')](respondWithResult(_0x8242ab,null))['then'](handleEntityNotFound(_0x8242ab,null))[_0xbb43('0x12')](handleError(_0x8242ab,null));};exports[_0xbb43('0x13')]=function(_0x4dfc54,_0x5d765b){if(_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')]&&_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x15')]){var _0x5bcce7=path[_0xbb43('0x16')](__dirname,'../../files/plugins',_0x4dfc54[_0xbb43('0x14')]['script']);var _0x2f5e31=process['cwd']();process[_0xbb43('0x17')](path[_0xbb43('0x18')](_0x5bcce7));return execChildProcess()['then'](function(_0x1d0768){process['chdir'](_0x2f5e31);return pm2[_0xbb43('0x19')]({'name':_0x4dfc54[_0xbb43('0x14')][_0xbb43('0x9')],'script':_0x5bcce7});})['then'](function(_0x53f0d5){pm2['dump']();return _0x53f0d5[0x0];})[_0xbb43('0x10')](respondWithResult(_0x5d765b,0xc9))[_0xbb43('0x12')](handleError(_0x5d765b,null));}else{return _0x5d765b['status'](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x1a')});}};exports[_0xbb43('0x1b')]=function(_0x3874fb,_0x4ed43f){if(_0x3874fb['body']['id']){delete _0x3874fb[_0xbb43('0x14')]['id'];}var _0x42800f={'online':_0xbb43('0x1c'),'stopped':_0xbb43('0x1d')};if(_0x42800f[_0xbb43('0x1e')](_0x3874fb[_0xbb43('0x14')][_0xbb43('0x6')])){return pm2[_0x42800f[_0x3874fb[_0xbb43('0x14')]['status']]](_0x3874fb[_0xbb43('0x1f')]['id'])['then'](respondWithResult(_0x4ed43f,0xc8))[_0xbb43('0x12')](handleError(_0x4ed43f,null));}else{return _0x4ed43f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x20')});}};exports['destroy']=function(_0x157d62,_0x547a6f){if(_0x157d62['body']['id']){delete _0x157d62['body']['id'];}if(_0x157d62[_0xbb43('0x1f')]['id']){return pm2['delete'](_0x157d62[_0xbb43('0x1f')]['id'])[_0xbb43('0x10')](function(_0xc577ac){pm2['dump']();return _0xc577ac[0x0];})[_0xbb43('0x10')](respondWithResult(_0x547a6f,null))[_0xbb43('0x12')](handleError(_0x547a6f,null));}else{return _0x547a6f[_0xbb43('0x6')](0x1f4)[_0xbb43('0xa')]({'message':_0xbb43('0x21')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index aed7ef7..cb03589 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 _0xfe94=['express','./realtime.controller','/agents','getAgents','get','/queues','getQueues','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xfe94,0x170));var _0x4fe9=function(_0x4b9a74,_0x4f508a){_0x4b9a74=_0x4b9a74-0x0;var _0x3d3d28=_0xfe94[_0x4b9a74];return _0x3d3d28;};'use strict';var express=require(_0x4fe9('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x4fe9('0x1'));router['get'](_0x4fe9('0x2'),auth['isAuthenticated'](),controller[_0x4fe9('0x3')]);router[_0x4fe9('0x4')](_0x4fe9('0x5'),auth['isAuthenticated'](),controller[_0x4fe9('0x6')]);module[_0x4fe9('0x7')]=router; \ No newline at end of file +var _0xc983=['/queues','getQueues','exports','Router','./realtime.controller','/agents','isAuthenticated','getAgents','get'];(function(_0x31c647,_0x3a64bb){var _0x20f942=function(_0x2cdda3){while(--_0x2cdda3){_0x31c647['push'](_0x31c647['shift']());}};_0x20f942(++_0x3a64bb);}(_0xc983,0x17d));var _0x3c98=function(_0x5725ed,_0x1e6bb2){_0x5725ed=_0x5725ed-0x0;var _0x228b4b=_0xc983[_0x5725ed];return _0x228b4b;};'use strict';var express=require('express');var router=express[_0x3c98('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3c98('0x1'));router['get'](_0x3c98('0x2'),auth[_0x3c98('0x3')](),controller[_0x3c98('0x4')]);router[_0x3c98('0x5')](_0x3c98('0x6'),auth['isAuthenticated'](),controller[_0x3c98('0x7')]);module[_0x3c98('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 1a3953f..c551aea 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 _0xda63=['getRealtimeAgents','rows','getSortedAgentsIdsByStatus','User','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','forEach','where','user','extraQueryConditions','assign','findAndCountAll','filterAgentAttributes','globalStatus','pause','Status','getQueues','Queue','rawAttributes','userProfileId','type','Queues','getResources','all','catch','util','lodash','jayson/promise','../../components/realtime/agents','../../config/logger','api','http','client','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','voice','then','result','VoiceQueuesChannels','loggedIn','available','waiting','talking','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','map','get','agents','paused','outbound','find','merge','pick','filter','queue','length','busy','some','connectedlinenum','getMembers','UserId','voiceStatus','online','startCase','Pause','findAll','QueueId','loggedInDb','includes','toLowerCase','Invalid\x20channel','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','channel','sort','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0xda63,0x92));var _0x3da6=function(_0x37f8ad,_0x5c3a37){_0x37f8ad=_0x37f8ad-0x0;var _0x12bd86=_0xda63[_0x37f8ad];return _0x12bd86;};'use strict';var util=require(_0x3da6('0x0'));var _=require(_0x3da6('0x1'));var jayson=require(_0x3da6('0x2'));var rta=require(_0x3da6('0x3'));var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var logger=require(_0x3da6('0x4'))(_0x3da6('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x3da6('0x6')]({'port':0x232a});var routingClient=jayson[_0x3da6('0x7')]['http']({'port':0x232c});function respondWithFilteredResult(_0x3d37a4,_0x6f9aea){return function(_0x5db581){if(_0x5db581){var _0x5640ba=typeof _0x6f9aea[_0x3da6('0x8')]===_0x3da6('0x9')&&typeof _0x6f9aea[_0x3da6('0xa')]==='undefined';var _0x18fdbe=_0x5db581[_0x3da6('0xb')];var _0x378da8=_0x5640ba?0x0:_0x6f9aea[_0x3da6('0x8')];var _0x147afc=_0x5640ba?_0x5db581['count']:_0x6f9aea[_0x3da6('0x8')]+_0x6f9aea[_0x3da6('0xa')];var _0x405255;if(_0x147afc>=_0x18fdbe){_0x147afc=_0x18fdbe;_0x405255=0xc8;}else{_0x405255=0xce;}_0x3d37a4[_0x3da6('0xc')](_0x405255);return _0x3d37a4[_0x3da6('0xd')](_0x3da6('0xe'),_0x378da8+'-'+_0x147afc+'/'+_0x18fdbe)[_0x3da6('0xf')](_0x5db581);}return null;};}function handleError(_0x1fd009,_0x193b23){_0x193b23=_0x193b23||0x1f4;return function(_0x1e277d){logger[_0x3da6('0x10')](_0x1e277d[_0x3da6('0x11')]);if(_0x1e277d[_0x3da6('0x12')]){delete _0x1e277d[_0x3da6('0x12')];}_0x1fd009[_0x3da6('0xc')](_0x193b23)['send'](_0x1e277d);};}function getRealtimeQueues(_0x2979be,_0x37c01f){return new Promise(function(_0x2ad8f,_0x308d6d){var _0x3fc72b=_0x37c01f===_0x3da6('0x13')?amiClient:routingClient;return _0x3fc72b['request'](_['startCase'](_0x37c01f)+'Queues',_0x2979be)[_0x3da6('0x14')](function(_0x50f31f){if(_0x50f31f['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x37c01f));return _0x2ad8f(_0x50f31f[_0x3da6('0x15')]);})['catch'](function(_0x437361){_0x308d6d(_0x437361);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4e64d0,_0x4c9c16){return amiClient['request'](_0x3da6('0x16'),{})[_0x3da6('0x14')](function(_0x5153e8){if(_0x5153e8[_0x3da6('0x10')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x4e64d0(_0x5153e8['result']);})['catch'](function(_0x442474){_0x4c9c16(_0x442474);});});}function initializeQueues(_0x1c1557,_0x2e3fcc,_0x4d8faf,_0x1481e4){var _0x2c1a6d=[_0x3da6('0x17'),_0x3da6('0x18'),_0x3da6('0x19'),_0x3da6('0x1a'),'paused'];if(_0x4d8faf===_0x3da6('0x13')&&_0x1481e4==='outbound'){_0x2c1a6d[_0x3da6('0x1b')](_0x3da6('0x1c'),_0x3da6('0x1d'),'message',_0x3da6('0x1e'),_0x3da6('0x1f'),_0x3da6('0x20'),_0x3da6('0x21'),_0x3da6('0x22'),_0x3da6('0x23'),_0x3da6('0x24'),_0x3da6('0x25'),'erlangBusyFactor',_0x3da6('0x26'),_0x3da6('0x27'),_0x3da6('0x28'),'predictiveIntervalAvailable',_0x3da6('0x29'),'predictiveIntervalAnsweredCalls',_0x3da6('0x2a'),_0x3da6('0x2b'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0x1c1557[_0x3da6('0x2c')](function(_0x564505){var _0x444a3f=_0x564505[_0x3da6('0x2d')]({'plain':!![]});_0x444a3f[_0x3da6('0x2e')]=[];_0x444a3f[_0x3da6('0x2f')]=0x0;_0x444a3f['loggedInDb']=0x0;_0x444a3f[_0x3da6('0x17')]=0x0;_0x444a3f[_0x3da6('0x18')]=0x0;_0x444a3f[_0x3da6('0x19')]=0x0;if(_0x4d8faf===_0x3da6('0x13')){_0x444a3f[_0x3da6('0x1a')]=0x0;_0x444a3f['busy']=0x0;if(_0x1481e4===_0x3da6('0x30')){_0x444a3f['pTalking']=0x0;_0x444a3f['originated']=0x0;}}var _0xa7dc40=_[_0x3da6('0x31')](_0x2e3fcc,['id',_0x444a3f['id']]);if(_0xa7dc40)_[_0x3da6('0x32')](_0x444a3f,_[_0x3da6('0x33')](_0xa7dc40,_0x2c1a6d));return _0x444a3f;});}function updateAgentVoiceStatus(_0x3c9bea,_0x491b22,_0x311359){var _0x3ffcdf=_[_0x3da6('0x34')](_0x311359,[_0x3da6('0x35'),_0x491b22[_0x3da6('0x12')]]);if(_0x3ffcdf[_0x3da6('0x36')]===0x0)return _0x3c9bea[_0x3da6('0x37')]=!![];if(_[_0x3da6('0x38')](_0x3ffcdf,[_0x3da6('0x39'),_0x3c9bea['internal']['toString']()]))return _0x3c9bea[_0x3da6('0x1a')]=!![];if(!_0x3c9bea['talking'])return _0x3c9bea[_0x3da6('0x37')]=!![];}function getVoiceQueueAgents(_0x3f2e24,_0x34d9c4,_0xed9080,_0x1eeff2){var _0x6b58af=_[_0x3da6('0x31')](_0x34d9c4,['id',_0x3f2e24['id']]);if(!_0x6b58af)return _0x3f2e24;return _0x6b58af[_0x3da6('0x3a')]({'raw':!![]})[_0x3da6('0x14')](function(_0x138f94){for(var _0x5b4c37=0x0;_0x5b4c37<_0x138f94[_0x3da6('0x36')];_0x5b4c37++){var _0x8a04ac=_[_0x3da6('0x31')](_0xed9080,['id',_0x138f94[_0x5b4c37][_0x3da6('0x3b')]]);if(!_0x8a04ac){_0x8a04ac={'id':_0x138f94[_0x5b4c37][_0x3da6('0x3b')],'name':_0x138f94[_0x5b4c37][_0x3da6('0x3b')],'accountcode':'','online':![]};}var _0x16d8b8={'id':_0x8a04ac['id'],'name':_0x8a04ac[_0x3da6('0x12')],'internal':_0x8a04ac['accountcode'],'online':Boolean(_0x8a04ac['online']),'paused':Boolean(_0x138f94[_0x5b4c37][_0x3da6('0x2f')])};if(_0x8a04ac[_0x3da6('0x3c')]===_0x3da6('0x1a'))updateAgentVoiceStatus(_0x16d8b8,_0x3f2e24,_0x1eeff2);if(_0x16d8b8[_0x3da6('0x3d')])_0x3f2e24['loggedInDb']++;if(_0x16d8b8[_0x3da6('0x37')])_0x3f2e24[_0x3da6('0x37')]++;if(_0x16d8b8[_0x3da6('0x2f')]&&!_0x16d8b8[_0x3da6('0x37')]&&!_0x16d8b8['talking'])_0x3f2e24[_0x3da6('0x2f')]++;_0x3f2e24[_0x3da6('0x2e')][_0x3da6('0x1b')](_0x16d8b8);}return _0x3f2e24;});}function getQueueAgents(_0x466ae6,_0xc76d51,_0x2571f2){var _0x32f256='User'+_[_0x3da6('0x3e')](_0x2571f2)+'Queue';var _0x170084=_0x2571f2+_0x3da6('0x3f');return db[_0x32f256][_0x3da6('0x40')]({'where':{[_[_0x3da6('0x3e')](_0x2571f2)+_0x3da6('0x41')]:_0x466ae6['id']},'raw':!![]})['then'](function(_0x1eddb9){for(var _0x39b9a3=0x0;_0x39b9a3<_0x1eddb9[_0x3da6('0x36')];_0x39b9a3++){var _0x15e511=_[_0x3da6('0x31')](_0xc76d51,['id',_0x1eddb9[_0x39b9a3][_0x3da6('0x3b')]]);if(!_0x15e511){_0x15e511={'id':_0x1eddb9[_0x39b9a3][_0x3da6('0x3b')],'name':_0x1eddb9[_0x39b9a3][_0x3da6('0x3b')],'online':![],['pauseField']:![]};}var _0x2c0ee9={'id':_0x15e511['id'],'name':_0x15e511[_0x3da6('0x12')],'online':Boolean(_0x15e511[_0x3da6('0x3d')]),'paused':Boolean(_0x15e511[_0x170084])};if(_0x2c0ee9[_0x3da6('0x3d')])_0x466ae6[_0x3da6('0x42')]++;_0x466ae6[_0x3da6('0x2e')][_0x3da6('0x1b')](_0x2c0ee9);}return _0x466ae6;});}function validateChannel(_0x5915fb){var _0x226b81=utils['getChannels']();if(!_[_0x3da6('0x43')](_0x226b81,_0x5915fb[_0x3da6('0x44')]()))throw new Error(_0x3da6('0x45'));return _0x5915fb['toLowerCase']();}exports['getAgents']=function(_0x5accec,_0x5d31f1){var _0xd5f2a9={'count':0x0,'rows':[]};var _0x51d3ed={};var _0x24f29e;var _0x52680c;var _0x39dfd2;var _0x2e9abf;var _0x1577c1=utils['getChannels']();var _0x5cdb8c=_0x5accec[_0x3da6('0x46')][_0x3da6('0x47')];var _0x17f134=_0x5accec['query'][_0x3da6('0x48')];var _0x36a17e=_0x5accec['query'][_0x3da6('0x49')];var _0x11f052=_0x17f134==='pause'||_0x17f134===_0x3da6('0x4a')?!![]:![];var _0x123603=[];var _0x19000c;Promise[_0x3da6('0x4b')]()[_0x3da6('0x14')](function(){if(_0x5accec[_0x3da6('0x46')]['channel']){_0x24f29e=validateChannel(_0x5accec[_0x3da6('0x46')][_0x3da6('0x4c')]);}if(!_0x5accec[_0x3da6('0x46')]['sort']||!_0x5accec[_0x3da6('0x46')]['sort'][_0x3da6('0x43')]('globalStatus')){_0x5accec[_0x3da6('0x46')][_0x3da6('0x4d')]=rta[_0x3da6('0x4e')](_0x5accec['query'][_0x3da6('0x4d')]);return;}var _0x1b08b0=rta[_0x3da6('0x4f')](_0x5accec[_0x3da6('0x46')][_0x3da6('0x4d')]);_0x5accec[_0x3da6('0x46')]['sort']=_0x1b08b0[_0x3da6('0x50')][_0x3da6('0x51')](',');_0x52680c=_0x1b08b0[_0x3da6('0x52')];})['then'](function(){if(!_0x5cdb8c){return[];}return rta[_0x3da6('0x53')](_0x5cdb8c,_0x24f29e);})['then'](function(_0x1b832d){_0x123603=_0x1b832d;return rta[_0x3da6('0x54')]();})['then'](function(_0x49d3a8){_0x2e9abf=_0x49d3a8[_0x3da6('0x55')];if((!_0x17f134||_0x11f052)&&!_0x52680c){return _0x123603;}if(_0x52680c&&!_0x17f134){return rta[_0x3da6('0x56')](_0x2e9abf,_0x123603,_0x52680c);}else{return rta['getAgentIdsByStatus'](_0x2e9abf,_0x123603,_0x17f134);}})[_0x3da6('0x14')](function(_0x345591){_0x123603=_0x345591;var _0x4f6e10=![];if(_0x123603['length']===0x0){if(_0x5cdb8c||_0x17f134){_0x4f6e10=!![];}if(_0x11f052){_0x4f6e10=![];}}if(_0x4f6e10){return _0xd5f2a9;}var _0x22e338=_[_0x3da6('0x2c')](db[_0x3da6('0x57')]['rawAttributes'],function(_0x2f30b0){return{'name':_0x2f30b0['fieldName'],'type':_0x2f30b0['type'][_0x3da6('0x58')]};});_0x5accec['query'][_0x3da6('0x59')]=_0x3da6('0x5a');_0x5accec[_0x3da6('0x46')]['online']=!![];_0x51d3ed=qs[_0x3da6('0x5b')](_0x22e338,_0x5accec);_0x51d3ed[_0x3da6('0x5c')]=!![];var _0x1aff32=[];if(_0x123603[_0x3da6('0x36')]>0x0){_0x1aff32[_0x3da6('0x1b')]({'id':{'$in':_0x123603}});if(_0x52680c&&!_0x17f134){_0x19000c=[db[_0x3da6('0x5d')][_0x3da6('0x5e')](_0x3da6('0x5f')+_0x123603+')')];_0x51d3ed[_0x3da6('0x52')]=_0x19000c;}}if(_0x11f052){_0x1577c1[_0x3da6('0x60')](function(_0x2ad2fc){var _0x56c8b3=!![];if(_0x17f134===_0x3da6('0x4a')&&_0x24f29e!==_0x2ad2fc){_0x56c8b3=![];}_0x1aff32[_0x3da6('0x1b')]({[_0x2ad2fc+'Pause']:_0x56c8b3});});if(_0x36a17e){_0x1aff32[_0x3da6('0x1b')]({'pauseType':_0x36a17e});}}else if(_0x17f134){_0x1577c1[_0x3da6('0x60')](function(_0x10dd38){_0x1aff32['push']({[_0x10dd38+'Pause']:![]});});}_0x51d3ed['where']=_[_0x3da6('0x32')](_0x51d3ed[_0x3da6('0x61')],{'$and':_0x1aff32});if(_0x5accec['user'][_0x3da6('0x59')]==='user'){var _0x3e81f7={'params':{'id':_0x5accec[_0x3da6('0x62')]['userProfileId']},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x123603,'customSorting':_0x19000c}};if(_0x11f052){_0x3e81f7[_0x3da6('0x46')][_0x3da6('0x63')]=_0x1aff32;}_0x3e81f7[_0x3da6('0x46')]=Object[_0x3da6('0x64')](_0x3e81f7[_0x3da6('0x46')],_0x5accec[_0x3da6('0x46')]);delete _0x3e81f7[_0x3da6('0x46')]['id'];return db['UserProfile']['getResources'](_0x3e81f7);}return db[_0x3da6('0x57')][_0x3da6('0x65')](_0x51d3ed);})[_0x3da6('0x14')](function(_0x37c560){_0xd5f2a9[_0x3da6('0xb')]=_0x37c560[_0x3da6('0xb')];_0x39dfd2=_0x37c560[_0x3da6('0x55')];return _0x39dfd2[_0x3da6('0x2c')](function(_0x4e03c2){var _0x2cf68c=_[_0x3da6('0x31')](_0x2e9abf,['id',_0x4e03c2['id']]);if(_0x2cf68c){var _0x4a9ab2=rta[_0x3da6('0x66')](_0x2cf68c);_['merge'](_0x4e03c2,_0x4a9ab2);}_0x4e03c2[_0x3da6('0x67')]=rta['getAgentStatus'](_0x4e03c2);if(_0x4e03c2[_0x3da6('0x67')]['includes'](_0x3da6('0x68'))){_0x1577c1[_0x3da6('0x60')](function(_0x4c60dc){if(_0x4e03c2[_0x4c60dc+_0x3da6('0x3f')]){_0x4e03c2[_0x4c60dc+_0x3da6('0x69')]=_0x3da6('0x68');}});}return _0x4e03c2;});})['then'](function(_0xc1711f){if(!_0x52680c||_0x19000c){return _0xc1711f;}return rta['sortAgentsByStatus'](_0xc1711f,_0x52680c);})['then'](function(_0x19bafa){_0xd5f2a9[_0x3da6('0x55')]=_0x19bafa;return _0xd5f2a9;})[_0x3da6('0x14')](respondWithFilteredResult(_0x5d31f1,_0x51d3ed))['catch'](handleError(_0x5d31f1,null));};exports[_0x3da6('0x6a')]=function(_0x5a51f9,_0x675f47){var _0xf1dcf={'count':0x0,'rows':[]},_0x59626f={},_0x12e224,_0x45002d,_0x365fd7,_0x4aa876,_0x434c8c;Promise[_0x3da6('0x4b')]()[_0x3da6('0x14')](function(){if(_0x5a51f9[_0x3da6('0x46')][_0x3da6('0x4c')])_0x12e224=validateChannel(_0x5a51f9[_0x3da6('0x46')][_0x3da6('0x4c')]);var _0x22a0cd=_[_0x3da6('0x3e')](_0x12e224)+_0x3da6('0x6b');var _0x4c42a5=_['map'](db[_0x22a0cd][_0x3da6('0x6c')],function(_0x476886){return{'name':_0x476886['fieldName'],'type':_0x476886['type']['key']};});_0x59626f=qs[_0x3da6('0x5b')](_0x4c42a5,_0x5a51f9);if(_0x5a51f9[_0x3da6('0x62')][_0x3da6('0x59')]===_0x3da6('0x62')){var _0x39db11={'params':{'id':_0x5a51f9['user'][_0x3da6('0x6d')]},'query':{'section':_0x12e224===_0x3da6('0x13')&&_0x5a51f9[_0x3da6('0x46')][_0x3da6('0x6e')]===_0x3da6('0x30')?'QueueCampaigns':_[_0x3da6('0x3e')](_0x12e224)+_0x3da6('0x6f'),'type':_0x5a51f9['query'][_0x3da6('0x6e')],'nolimit':!![],'sort':'name','filter':_0x5a51f9[_0x3da6('0x46')][_0x3da6('0x34')]}};return db['UserProfile'][_0x3da6('0x70')](_0x39db11);}return db[_0x22a0cd][_0x3da6('0x65')](_0x59626f);})[_0x3da6('0x14')](function(_0x2083e2){_0xf1dcf[_0x3da6('0xb')]=_0x2083e2['count'];_0x45002d=_0x2083e2[_0x3da6('0x55')];return getRealtimeQueues(_0x5a51f9,_0x12e224);})['then'](function(_0x5094bd){_0x4aa876=_0x5094bd[_0x3da6('0x55')];return rta[_0x3da6('0x54')]();})[_0x3da6('0x14')](function(_0x30c29a){_0x365fd7=_0x30c29a['rows'];if(_0x12e224!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x3da6('0x14')](function(_0x53f575){_0x434c8c=_0x53f575?_0x53f575[_0x3da6('0x55')]:[];return initializeQueues(_0x45002d,_0x4aa876,_0x12e224,_0x5a51f9['query'][_0x3da6('0x6e')]);})[_0x3da6('0x14')](function(_0x174c52){var _0xedcb7=_0x174c52[_0x3da6('0x2c')](function(_0x2a2bf6){if(_0x12e224===_0x3da6('0x13'))return getVoiceQueueAgents(_0x2a2bf6,_0x45002d,_0x365fd7,_0x434c8c);else return getQueueAgents(_0x2a2bf6,_0x365fd7,_0x12e224);});return Promise[_0x3da6('0x71')](_0xedcb7);})[_0x3da6('0x14')](function(_0x5eac93){_0xf1dcf[_0x3da6('0x55')]=_0x5eac93;return _0xf1dcf;})[_0x3da6('0x14')](respondWithFilteredResult(_0x675f47,_0x59626f))[_0x3da6('0x72')](handleError(_0x675f47,null));}; \ No newline at end of file +var _0xbb47=['key','agent','getOptions','raw','sequelize','FIELD(id,','forEach','where','role','user','userProfileId','Agents','extraQueryConditions','assign','findAndCountAll','globalStatus','getAgentStatus','Status','getQueues','resolve','Queue','QueueCampaigns','filter','UserProfile','getResources','util','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','api','http','client','offset','undefined','limit','count','status','set','Content-Range','json','stack','name','send','voice','request','startCase','Queues','then','error','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','catch','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','dialActive','dialMethod','startPredictive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','originated','find','merge','queue','length','some','internal','toString','getMembers','UserId','accountcode','voiceStatus','online','Pause','findAll','QueueId','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','channel','sort','includes','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','User','rawAttributes','fieldName','type'];(function(_0x4579bc,_0x4ffa67){var _0x19e07a=function(_0xdcbe1d){while(--_0xdcbe1d){_0x4579bc['push'](_0x4579bc['shift']());}};_0x19e07a(++_0x4ffa67);}(_0xbb47,0x107));var _0x7bb4=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0xbb47[_0x5f746f];return _0x198d15;};'use strict';var util=require(_0x7bb4('0x0'));var _=require('lodash');var jayson=require(_0x7bb4('0x1'));var rta=require(_0x7bb4('0x2'));var qs=require(_0x7bb4('0x3'));var utils=require(_0x7bb4('0x4'));var logger=require('../../config/logger')(_0x7bb4('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x7bb4('0x6')]({'port':0x232a});var routingClient=jayson[_0x7bb4('0x7')][_0x7bb4('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xb574b2,_0x59f05c){return function(_0x2dc84b){if(_0x2dc84b){var _0x27cc08=typeof _0x59f05c[_0x7bb4('0x8')]===_0x7bb4('0x9')&&typeof _0x59f05c[_0x7bb4('0xa')]===_0x7bb4('0x9');var _0x9292af=_0x2dc84b[_0x7bb4('0xb')];var _0x49471e=_0x27cc08?0x0:_0x59f05c[_0x7bb4('0x8')];var _0x1b964c=_0x27cc08?_0x2dc84b[_0x7bb4('0xb')]:_0x59f05c[_0x7bb4('0x8')]+_0x59f05c[_0x7bb4('0xa')];var _0x1922c2;if(_0x1b964c>=_0x9292af){_0x1b964c=_0x9292af;_0x1922c2=0xc8;}else{_0x1922c2=0xce;}_0xb574b2[_0x7bb4('0xc')](_0x1922c2);return _0xb574b2[_0x7bb4('0xd')](_0x7bb4('0xe'),_0x49471e+'-'+_0x1b964c+'/'+_0x9292af)[_0x7bb4('0xf')](_0x2dc84b);}return null;};}function handleError(_0x38a608,_0x294e7b){_0x294e7b=_0x294e7b||0x1f4;return function(_0x4d0e43){logger['error'](_0x4d0e43[_0x7bb4('0x10')]);if(_0x4d0e43[_0x7bb4('0x11')]){delete _0x4d0e43[_0x7bb4('0x11')];}_0x38a608[_0x7bb4('0xc')](_0x294e7b)[_0x7bb4('0x12')](_0x4d0e43);};}function getRealtimeQueues(_0x4f8089,_0x128366){return new Promise(function(_0x37620c,_0x158384){var _0x13ac1a=_0x128366===_0x7bb4('0x13')?amiClient:routingClient;return _0x13ac1a[_0x7bb4('0x14')](_[_0x7bb4('0x15')](_0x128366)+_0x7bb4('0x16'),_0x4f8089)[_0x7bb4('0x17')](function(_0x452798){if(_0x452798[_0x7bb4('0x18')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x128366));return _0x37620c(_0x452798['result']);})['catch'](function(_0x3afe89){_0x158384(_0x3afe89);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x181f04,_0x5b29aa){return amiClient[_0x7bb4('0x14')](_0x7bb4('0x19'),{})[_0x7bb4('0x17')](function(_0x560783){if(_0x560783[_0x7bb4('0x18')])throw new Error(_0x7bb4('0x1a'));return _0x181f04(_0x560783[_0x7bb4('0x1b')]);})[_0x7bb4('0x1c')](function(_0x38dea1){_0x5b29aa(_0x38dea1);});});}function initializeQueues(_0x306fc4,_0x1e4466,_0x57b973,_0x3f558e){var _0x66b35=[_0x7bb4('0x1d'),_0x7bb4('0x1e'),_0x7bb4('0x1f'),_0x7bb4('0x20'),_0x7bb4('0x21')];if(_0x57b973===_0x7bb4('0x13')&&_0x3f558e===_0x7bb4('0x22')){_0x66b35[_0x7bb4('0x23')](_0x7bb4('0x24'),'originated','message',_0x7bb4('0x25'),_0x7bb4('0x26'),'Trunk',_0x7bb4('0x27'),'startProgressive','erlangCalls',_0x7bb4('0x28'),'erlangAbandonmentRate',_0x7bb4('0x29'),_0x7bb4('0x2a'),_0x7bb4('0x2b'),_0x7bb4('0x2c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x7bb4('0x2d'),'predictiveIntervalDroppedCallsCallersExit',_0x7bb4('0x2e'),_0x7bb4('0x2f'));}return _0x306fc4[_0x7bb4('0x30')](function(_0x11df71){var _0x3aa2a0=_0x11df71[_0x7bb4('0x31')]({'plain':!![]});_0x3aa2a0[_0x7bb4('0x32')]=[];_0x3aa2a0[_0x7bb4('0x21')]=0x0;_0x3aa2a0[_0x7bb4('0x33')]=0x0;_0x3aa2a0[_0x7bb4('0x1d')]=0x0;_0x3aa2a0[_0x7bb4('0x1e')]=0x0;_0x3aa2a0[_0x7bb4('0x1f')]=0x0;if(_0x57b973===_0x7bb4('0x13')){_0x3aa2a0[_0x7bb4('0x20')]=0x0;_0x3aa2a0[_0x7bb4('0x34')]=0x0;if(_0x3f558e===_0x7bb4('0x22')){_0x3aa2a0[_0x7bb4('0x24')]=0x0;_0x3aa2a0[_0x7bb4('0x35')]=0x0;}}var _0x339a42=_[_0x7bb4('0x36')](_0x1e4466,['id',_0x3aa2a0['id']]);if(_0x339a42)_[_0x7bb4('0x37')](_0x3aa2a0,_['pick'](_0x339a42,_0x66b35));return _0x3aa2a0;});}function updateAgentVoiceStatus(_0x2e58c5,_0x3db737,_0x2cb316){var _0x3b5282=_['filter'](_0x2cb316,[_0x7bb4('0x38'),_0x3db737['name']]);if(_0x3b5282[_0x7bb4('0x39')]===0x0)return _0x2e58c5[_0x7bb4('0x34')]=!![];if(_[_0x7bb4('0x3a')](_0x3b5282,['connectedlinenum',_0x2e58c5[_0x7bb4('0x3b')][_0x7bb4('0x3c')]()]))return _0x2e58c5[_0x7bb4('0x20')]=!![];if(!_0x2e58c5[_0x7bb4('0x20')])return _0x2e58c5[_0x7bb4('0x34')]=!![];}function getVoiceQueueAgents(_0x29d85f,_0x377a73,_0x14a527,_0x55f419){var _0x2c2986=_[_0x7bb4('0x36')](_0x377a73,['id',_0x29d85f['id']]);if(!_0x2c2986)return _0x29d85f;return _0x2c2986[_0x7bb4('0x3d')]({'raw':!![]})[_0x7bb4('0x17')](function(_0x31b27f){for(var _0x215030=0x0;_0x215030<_0x31b27f['length'];_0x215030++){var _0x2f891e=_['find'](_0x14a527,['id',_0x31b27f[_0x215030][_0x7bb4('0x3e')]]);if(!_0x2f891e){_0x2f891e={'id':_0x31b27f[_0x215030]['UserId'],'name':_0x31b27f[_0x215030][_0x7bb4('0x3e')],'accountcode':'','online':![]};}var _0x245693={'id':_0x2f891e['id'],'name':_0x2f891e[_0x7bb4('0x11')],'internal':_0x2f891e[_0x7bb4('0x3f')],'online':Boolean(_0x2f891e['online']),'paused':Boolean(_0x31b27f[_0x215030][_0x7bb4('0x21')])};if(_0x2f891e[_0x7bb4('0x40')]===_0x7bb4('0x20'))updateAgentVoiceStatus(_0x245693,_0x29d85f,_0x55f419);if(_0x245693[_0x7bb4('0x41')])_0x29d85f[_0x7bb4('0x33')]++;if(_0x245693[_0x7bb4('0x34')])_0x29d85f[_0x7bb4('0x34')]++;if(_0x245693[_0x7bb4('0x21')]&&!_0x245693[_0x7bb4('0x34')]&&!_0x245693[_0x7bb4('0x20')])_0x29d85f[_0x7bb4('0x21')]++;_0x29d85f[_0x7bb4('0x32')][_0x7bb4('0x23')](_0x245693);}return _0x29d85f;});}function getQueueAgents(_0x267519,_0x10fbcc,_0x3d9fa9){var _0x8b215c='User'+_[_0x7bb4('0x15')](_0x3d9fa9)+'Queue';var _0x3d20ad=_0x3d9fa9+_0x7bb4('0x42');return db[_0x8b215c][_0x7bb4('0x43')]({'where':{[_[_0x7bb4('0x15')](_0x3d9fa9)+_0x7bb4('0x44')]:_0x267519['id']},'raw':!![]})['then'](function(_0xf6309b){for(var _0x4a21a0=0x0;_0x4a21a0<_0xf6309b[_0x7bb4('0x39')];_0x4a21a0++){var _0x432e83=_[_0x7bb4('0x36')](_0x10fbcc,['id',_0xf6309b[_0x4a21a0][_0x7bb4('0x3e')]]);if(!_0x432e83){_0x432e83={'id':_0xf6309b[_0x4a21a0][_0x7bb4('0x3e')],'name':_0xf6309b[_0x4a21a0]['UserId'],'online':![],['pauseField']:![]};}var _0x5d95fa={'id':_0x432e83['id'],'name':_0x432e83[_0x7bb4('0x11')],'online':Boolean(_0x432e83[_0x7bb4('0x41')]),'paused':Boolean(_0x432e83[_0x3d20ad])};if(_0x5d95fa[_0x7bb4('0x41')])_0x267519[_0x7bb4('0x33')]++;_0x267519['agents'][_0x7bb4('0x23')](_0x5d95fa);}return _0x267519;});}function validateChannel(_0x5865fc){var _0x2a86d8=utils[_0x7bb4('0x45')]();if(!_['includes'](_0x2a86d8,_0x5865fc[_0x7bb4('0x46')]()))throw new Error(_0x7bb4('0x47'));return _0x5865fc['toLowerCase']();}exports[_0x7bb4('0x48')]=function(_0x14609e,_0x331a5a){var _0x26e5c8={'count':0x0,'rows':[]};var _0x166af9={};var _0x118546;var _0x1ad4d3;var _0xebb2e2;var _0x3d5921;var _0x29d6f0=utils['getChannels']();var _0x17737d=_0x14609e[_0x7bb4('0x49')]['globalQueueFilter'];var _0x5c711d=_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4a')];var _0x211fcb=_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4b')];var _0x3949da=_0x5c711d===_0x7bb4('0x4c')||_0x5c711d===_0x7bb4('0x4d')?!![]:![];var _0xb3f77c=[];var _0xed540c;Promise['resolve']()[_0x7bb4('0x17')](function(){if(_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4e')]){_0x118546=validateChannel(_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4e')]);}if(!_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')]||!_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')][_0x7bb4('0x50')]('globalStatus')){_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')]=rta[_0x7bb4('0x51')](_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')]);return;}var _0x4face4=rta['getUpdatedSortOptions'](_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')]);_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x4f')]=_0x4face4[_0x7bb4('0x52')][_0x7bb4('0x53')](',');_0x1ad4d3=_0x4face4[_0x7bb4('0x54')];})[_0x7bb4('0x17')](function(){if(!_0x17737d){return[];}return rta[_0x7bb4('0x55')](_0x17737d,_0x118546);})[_0x7bb4('0x17')](function(_0xb2ae93){_0xb3f77c=_0xb2ae93;return rta[_0x7bb4('0x56')]();})[_0x7bb4('0x17')](function(_0x52fd2b){_0x3d5921=_0x52fd2b[_0x7bb4('0x57')];if((!_0x5c711d||_0x3949da)&&!_0x1ad4d3){return _0xb3f77c;}if(_0x1ad4d3&&!_0x5c711d){return rta[_0x7bb4('0x58')](_0x3d5921,_0xb3f77c,_0x1ad4d3);}else{return rta[_0x7bb4('0x59')](_0x3d5921,_0xb3f77c,_0x5c711d);}})[_0x7bb4('0x17')](function(_0xc0e065){_0xb3f77c=_0xc0e065;var _0x74c42c=![];if(_0xb3f77c[_0x7bb4('0x39')]===0x0){if(_0x17737d||_0x5c711d){_0x74c42c=!![];}if(_0x3949da){_0x74c42c=![];}}if(_0x74c42c){return _0x26e5c8;}var _0x2cb4fb=_[_0x7bb4('0x30')](db[_0x7bb4('0x5a')][_0x7bb4('0x5b')],function(_0x3c67c3){return{'name':_0x3c67c3[_0x7bb4('0x5c')],'type':_0x3c67c3[_0x7bb4('0x5d')][_0x7bb4('0x5e')]};});_0x14609e[_0x7bb4('0x49')]['role']=_0x7bb4('0x5f');_0x14609e[_0x7bb4('0x49')][_0x7bb4('0x41')]=!![];_0x166af9=qs[_0x7bb4('0x60')](_0x2cb4fb,_0x14609e);_0x166af9[_0x7bb4('0x61')]=!![];var _0x4aad5f=[];if(_0xb3f77c[_0x7bb4('0x39')]>0x0){_0x4aad5f[_0x7bb4('0x23')]({'id':{'$in':_0xb3f77c}});if(_0x1ad4d3&&!_0x5c711d){_0xed540c=[db[_0x7bb4('0x62')]['literal'](_0x7bb4('0x63')+_0xb3f77c+')')];_0x166af9['order']=_0xed540c;}}if(_0x3949da){_0x29d6f0[_0x7bb4('0x64')](function(_0x5e6772){var _0xf50b37=!![];if(_0x5c711d===_0x7bb4('0x4d')&&_0x118546!==_0x5e6772){_0xf50b37=![];}_0x4aad5f[_0x7bb4('0x23')]({[_0x5e6772+_0x7bb4('0x42')]:_0xf50b37});});if(_0x211fcb){_0x4aad5f['push']({'pauseType':_0x211fcb});}}else if(_0x5c711d){_0x29d6f0[_0x7bb4('0x64')](function(_0x136be6){_0x4aad5f[_0x7bb4('0x23')]({[_0x136be6+_0x7bb4('0x42')]:![]});});}_0x166af9[_0x7bb4('0x65')]=_[_0x7bb4('0x37')](_0x166af9[_0x7bb4('0x65')],{'$and':_0x4aad5f});if(_0x14609e['user'][_0x7bb4('0x66')]===_0x7bb4('0x67')){var _0x4c83fc={'params':{'id':_0x14609e[_0x7bb4('0x67')][_0x7bb4('0x68')]},'query':{'section':_0x7bb4('0x69'),'role':'agent','online':!![],'raw':!![],'ids':_0xb3f77c,'customSorting':_0xed540c}};if(_0x3949da){_0x4c83fc[_0x7bb4('0x49')][_0x7bb4('0x6a')]=_0x4aad5f;}_0x4c83fc[_0x7bb4('0x49')]=Object[_0x7bb4('0x6b')](_0x4c83fc[_0x7bb4('0x49')],_0x14609e[_0x7bb4('0x49')]);delete _0x4c83fc['query']['id'];return db['UserProfile']['getResources'](_0x4c83fc);}return db[_0x7bb4('0x5a')][_0x7bb4('0x6c')](_0x166af9);})['then'](function(_0x2e7035){_0x26e5c8['count']=_0x2e7035[_0x7bb4('0xb')];_0xebb2e2=_0x2e7035[_0x7bb4('0x57')];return _0xebb2e2['map'](function(_0x191b9c){var _0x1bc323=_['find'](_0x3d5921,['id',_0x191b9c['id']]);if(_0x1bc323){var _0x433a9c=rta['filterAgentAttributes'](_0x1bc323);_['merge'](_0x191b9c,_0x433a9c);}_0x191b9c[_0x7bb4('0x6d')]=rta[_0x7bb4('0x6e')](_0x191b9c);if(_0x191b9c[_0x7bb4('0x6d')][_0x7bb4('0x50')](_0x7bb4('0x4c'))){_0x29d6f0[_0x7bb4('0x64')](function(_0x301537){if(_0x191b9c[_0x301537+_0x7bb4('0x42')]){_0x191b9c[_0x301537+_0x7bb4('0x6f')]=_0x7bb4('0x4c');}});}return _0x191b9c;});})[_0x7bb4('0x17')](function(_0x3c6086){if(!_0x1ad4d3||_0xed540c){return _0x3c6086;}return rta['sortAgentsByStatus'](_0x3c6086,_0x1ad4d3);})[_0x7bb4('0x17')](function(_0x2214df){_0x26e5c8['rows']=_0x2214df;return _0x26e5c8;})['then'](respondWithFilteredResult(_0x331a5a,_0x166af9))[_0x7bb4('0x1c')](handleError(_0x331a5a,null));};exports[_0x7bb4('0x70')]=function(_0x454bb5,_0x2e71b2){var _0x3f7e08={'count':0x0,'rows':[]},_0x40b60d={},_0x2c7f37,_0x3d886f,_0x4dc94c,_0x2b79df,_0x4cfcfc;Promise[_0x7bb4('0x71')]()[_0x7bb4('0x17')](function(){if(_0x454bb5[_0x7bb4('0x49')]['channel'])_0x2c7f37=validateChannel(_0x454bb5['query'][_0x7bb4('0x4e')]);var _0x5a33d9=_[_0x7bb4('0x15')](_0x2c7f37)+_0x7bb4('0x72');var _0x3abd2e=_['map'](db[_0x5a33d9]['rawAttributes'],function(_0x416c10){return{'name':_0x416c10[_0x7bb4('0x5c')],'type':_0x416c10[_0x7bb4('0x5d')][_0x7bb4('0x5e')]};});_0x40b60d=qs[_0x7bb4('0x60')](_0x3abd2e,_0x454bb5);if(_0x454bb5['user'][_0x7bb4('0x66')]==='user'){var _0x511375={'params':{'id':_0x454bb5['user']['userProfileId']},'query':{'section':_0x2c7f37==='voice'&&_0x454bb5[_0x7bb4('0x49')][_0x7bb4('0x5d')]===_0x7bb4('0x22')?_0x7bb4('0x73'):_[_0x7bb4('0x15')](_0x2c7f37)+_0x7bb4('0x16'),'type':_0x454bb5[_0x7bb4('0x49')][_0x7bb4('0x5d')],'nolimit':!![],'sort':_0x7bb4('0x11'),'filter':_0x454bb5[_0x7bb4('0x49')][_0x7bb4('0x74')]}};return db[_0x7bb4('0x75')][_0x7bb4('0x76')](_0x511375);}return db[_0x5a33d9][_0x7bb4('0x6c')](_0x40b60d);})[_0x7bb4('0x17')](function(_0x2f2acd){_0x3f7e08[_0x7bb4('0xb')]=_0x2f2acd['count'];_0x3d886f=_0x2f2acd['rows'];return getRealtimeQueues(_0x454bb5,_0x2c7f37);})[_0x7bb4('0x17')](function(_0x2ed98c){_0x2b79df=_0x2ed98c['rows'];return rta[_0x7bb4('0x56')]();})[_0x7bb4('0x17')](function(_0x4124f0){_0x4dc94c=_0x4124f0['rows'];if(_0x2c7f37!=_0x7bb4('0x13'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x9bb13a){_0x4cfcfc=_0x9bb13a?_0x9bb13a['rows']:[];return initializeQueues(_0x3d886f,_0x2b79df,_0x2c7f37,_0x454bb5[_0x7bb4('0x49')]['type']);})['then'](function(_0x4f2ed3){var _0x382fb8=_0x4f2ed3['map'](function(_0x5811c7){if(_0x2c7f37==='voice')return getVoiceQueueAgents(_0x5811c7,_0x3d886f,_0x4dc94c,_0x4cfcfc);else return getQueueAgents(_0x5811c7,_0x4dc94c,_0x2c7f37);});return Promise['all'](_0x382fb8);})[_0x7bb4('0x17')](function(_0x2c19be){_0x3f7e08[_0x7bb4('0x57')]=_0x2c19be;return _0x3f7e08;})[_0x7bb4('0x17')](respondWithFilteredResult(_0x2e71b2,_0x40b60d))['catch'](handleError(_0x2e71b2,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index da6164a..69be939 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x514395,_0x1649ac){var _0x4efcb0=function(_0x35396c){while(--_0x35396c){_0x514395['push'](_0x514395['shift']());}};_0x4efcb0(++_0x1649ac);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x12fbf6,_0xf60217){var _0x1ae525=function(_0x5e3b1c){while(--_0x5e3b1c){_0x12fbf6['push'](_0x12fbf6['shift']());}};_0x1ae525(++_0xf60217);}(_0x70e0,0x17b));var _0x070e=function(_0x7de62d,_0x1ee679){_0x7de62d=_0x7de62d-0x0;var _0x4352c3=_0x70e0[_0x7de62d];return _0x4352c3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 5d91988..e931535 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 _0xe944=['sequelize','STRING','DATE'];(function(_0x10ca08,_0x29259c){var _0x3b9232=function(_0x33f3c7){while(--_0x33f3c7){_0x10ca08['push'](_0x10ca08['shift']());}};_0x3b9232(++_0x29259c);}(_0xe944,0x174));var _0x4e94=function(_0x27d01c,_0x1d38fe){_0x27d01c=_0x27d01c-0x0;var _0x2e02f7=_0xe944[_0x27d01c];return _0x2e02f7;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4e94('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4e94('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4e94('0x1')]},'campaigntype':{'type':Sequelize[_0x4e94('0x1')]},'membername':{'type':Sequelize[_0x4e94('0x1')]}}; \ No newline at end of file +var _0x6347=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x6347,0x1c9));var _0x7634=function(_0x213b04,_0x50ca2e){_0x213b04=_0x213b04-0x0;var _0x1bae9e=_0x6347[_0x213b04];return _0x1bae9e;};'use strict';var Sequelize=require(_0x7634('0x0'));module[_0x7634('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7634('0x2')]},'scheduledat':{'type':Sequelize[_0x7634('0x3')]},'uniqueid':{'type':Sequelize[_0x7634('0x2')]},'starttime':{'type':Sequelize[_0x7634('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x7634('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7634('0x2')]},'membername':{'type':Sequelize[_0x7634('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 68a20a9..d174b4b 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 _0x5193=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util'];(function(_0x5a5674,_0x33df60){var _0x4ee2ce=function(_0x5a792d){while(--_0x5a792d){_0x5a5674['push'](_0x5a5674['shift']());}};_0x4ee2ce(++_0x33df60);}(_0x5193,0x107));var _0x3519=function(_0x1bd2d1,_0x18c080){_0x1bd2d1=_0x1bd2d1-0x0;var _0x543bb9=_0x5193[_0x1bd2d1];return _0x543bb9;};'use strict';var _=require('lodash');var util=require(_0x3519('0x0'));var logger=require(_0x3519('0x1'))('api');var moment=require(_0x3519('0x2'));var BPromise=require(_0x3519('0x3'));var rp=require(_0x3519('0x4'));var fs=require('fs');var path=require(_0x3519('0x5'));var rimraf=require('rimraf');var config=require(_0x3519('0x6'));var attributes=require(_0x3519('0x7'));module[_0x3519('0x8')]=function(_0x8ad272,_0x5cde44){return _0x8ad272[_0x3519('0x9')](_0x3519('0xa'),attributes,{'tableName':_0x3519('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x103d=['../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2f0580,_0x25404f){var _0x1a3a28=function(_0x1af248){while(--_0x1af248){_0x2f0580['push'](_0x2f0580['shift']());}};_0x1a3a28(++_0x25404f);}(_0x103d,0x17e));var _0xd103=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x103d[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd103('0x0'));var util=require(_0xd103('0x1'));var logger=require(_0xd103('0x2'))(_0xd103('0x3'));var moment=require('moment');var BPromise=require(_0xd103('0x4'));var rp=require(_0xd103('0x5'));var fs=require('fs');var path=require(_0xd103('0x6'));var rimraf=require(_0xd103('0x7'));var config=require(_0xd103('0x8'));var attributes=require(_0xd103('0x9'));module['exports']=function(_0x54ae1f,_0xc4390c){return _0x54ae1f[_0xd103('0xa')](_0xd103('0xb'),attributes,{'tableName':_0xd103('0xc'),'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 c595885..3c79378 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 _0xccb7=['raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options'];(function(_0x2d7771,_0x528100){var _0x554886=function(_0x263e6d){while(--_0x263e6d){_0x2d7771['push'](_0x2d7771['shift']());}};_0x554886(++_0x528100);}(_0xccb7,0x143));var _0x7ccb=function(_0x417d6b,_0x567ff0){_0x417d6b=_0x417d6b-0x0;var _0x5ab541=_0xccb7[_0x417d6b];return _0x5ab541;};'use strict';var _=require(_0x7ccb('0x0'));var util=require(_0x7ccb('0x1'));var moment=require(_0x7ccb('0x2'));var BPromise=require(_0x7ccb('0x3'));var rs=require(_0x7ccb('0x4'));var fs=require('fs');var Redis=require(_0x7ccb('0x5'));var db=require(_0x7ccb('0x6'))['db'];var utils=require(_0x7ccb('0x7'));var logger=require(_0x7ccb('0x8'))(_0x7ccb('0x9'));var config=require(_0x7ccb('0xa'));var jayson=require(_0x7ccb('0xb'));var client=jayson[_0x7ccb('0xc')][_0x7ccb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3bf1fe,_0x13967e,_0x238011){return new BPromise(function(_0x3ed620,_0x383bcd){return client[_0x7ccb('0xe')](_0x3bf1fe,_0x238011)['then'](function(_0x1128a2){logger[_0x7ccb('0xf')](_0x7ccb('0x10'),_0x13967e,_0x7ccb('0x11'));logger[_0x7ccb('0x12')](_0x7ccb('0x13'),_0x13967e,_0x7ccb('0x11'),JSON[_0x7ccb('0x14')](_0x1128a2));if(_0x1128a2[_0x7ccb('0x15')]){if(_0x1128a2[_0x7ccb('0x15')][_0x7ccb('0x16')]===0x1f4){logger[_0x7ccb('0x15')](_0x7ccb('0x10'),_0x13967e,_0x1128a2[_0x7ccb('0x15')][_0x7ccb('0x17')]);return _0x383bcd(_0x1128a2[_0x7ccb('0x15')][_0x7ccb('0x17')]);}logger[_0x7ccb('0x15')](_0x7ccb('0x10'),_0x13967e,_0x1128a2[_0x7ccb('0x15')][_0x7ccb('0x17')]);return _0x3ed620(_0x1128a2['error'][_0x7ccb('0x17')]);}else{logger[_0x7ccb('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x13967e,_0x7ccb('0x11'));_0x3ed620(_0x1128a2[_0x7ccb('0x18')][_0x7ccb('0x17')]);}})['catch'](function(_0x434b48){logger[_0x7ccb('0x15')](_0x7ccb('0x10'),_0x13967e,_0x434b48);_0x383bcd(_0x434b48);});});}exports[_0x7ccb('0x19')]=function(_0x4db988){var _0x10a262=this;return new Promise(function(_0x1c6ed5,_0x1807e8){return db[_0x7ccb('0x1a')]['create'](_0x4db988[_0x7ccb('0x1b')],{'raw':_0x4db988[_0x7ccb('0x1c')]?_0x4db988['options'][_0x7ccb('0x1d')]===undefined?!![]:![]:!![]})[_0x7ccb('0x1e')](function(_0x4454e9){logger[_0x7ccb('0xf')]('CreateReportAgentPreview',_0x4db988);logger[_0x7ccb('0x12')](_0x7ccb('0x19'),_0x4db988,JSON[_0x7ccb('0x14')](_0x4454e9));_0x1c6ed5(_0x4454e9);})[_0x7ccb('0x1f')](function(_0xeea0e7){logger[_0x7ccb('0x15')](_0x7ccb('0x19'),_0xeea0e7['message'],_0x4db988);_0x1807e8(_0x10a262[_0x7ccb('0x15')](0x1f4,_0xeea0e7[_0x7ccb('0x17')]));});});}; \ No newline at end of file +var _0xc55c=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ReportAgentPreview','create','body','raw','then','CreateReportAgentPreview','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc55c,0x15d));var _0xcc55=function(_0x5b8c72,_0x38cf40){_0x5b8c72=_0x5b8c72-0x0;var _0x1fcf2c=_0xc55c[_0x5b8c72];return _0x1fcf2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc55('0x0'));var BPromise=require(_0xcc55('0x1'));var rs=require(_0xcc55('0x2'));var fs=require('fs');var Redis=require(_0xcc55('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc55('0x4'));var logger=require(_0xcc55('0x5'))('rpc');var config=require(_0xcc55('0x6'));var jayson=require(_0xcc55('0x7'));var client=jayson['client'][_0xcc55('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x362def,_0x3801d6,_0x3b11e1){return new BPromise(function(_0x2baaca,_0x3480e1){return client[_0xcc55('0x9')](_0x362def,_0x3b11e1)['then'](function(_0x26d75e){logger['info'](_0xcc55('0xa'),_0x3801d6,_0xcc55('0xb'));logger[_0xcc55('0xc')](_0xcc55('0xd'),_0x3801d6,_0xcc55('0xb'),JSON[_0xcc55('0xe')](_0x26d75e));if(_0x26d75e[_0xcc55('0xf')]){if(_0x26d75e[_0xcc55('0xf')][_0xcc55('0x10')]===0x1f4){logger[_0xcc55('0xf')](_0xcc55('0xa'),_0x3801d6,_0x26d75e[_0xcc55('0xf')][_0xcc55('0x11')]);return _0x3480e1(_0x26d75e['error'][_0xcc55('0x11')]);}logger[_0xcc55('0xf')](_0xcc55('0xa'),_0x3801d6,_0x26d75e[_0xcc55('0xf')][_0xcc55('0x11')]);return _0x2baaca(_0x26d75e[_0xcc55('0xf')]['message']);}else{logger[_0xcc55('0x12')](_0xcc55('0xa'),_0x3801d6,_0xcc55('0xb'));_0x2baaca(_0x26d75e[_0xcc55('0x13')]['message']);}})[_0xcc55('0x14')](function(_0x580dea){logger[_0xcc55('0xf')](_0xcc55('0xa'),_0x3801d6,_0x580dea);_0x3480e1(_0x580dea);});});}exports['CreateReportAgentPreview']=function(_0x4b1b92){var _0x3db9ef=this;return new Promise(function(_0x1666a9,_0x120a0b){return db[_0xcc55('0x15')][_0xcc55('0x16')](_0x4b1b92[_0xcc55('0x17')],{'raw':_0x4b1b92['options']?_0x4b1b92['options'][_0xcc55('0x18')]===undefined?!![]:![]:!![]})[_0xcc55('0x19')](function(_0x59a496){logger['info']('CreateReportAgentPreview',_0x4b1b92);logger[_0xcc55('0xc')]('CreateReportAgentPreview',_0x4b1b92,JSON[_0xcc55('0xe')](_0x59a496));_0x1666a9(_0x59a496);})[_0xcc55('0x14')](function(_0x2d285a){logger[_0xcc55('0xf')](_0xcc55('0x1a'),_0x2d285a[_0xcc55('0x11')],_0x4b1b92);_0x120a0b(_0x3db9ef[_0xcc55('0xf')](0x1f4,_0x2d285a[_0xcc55('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 2c3c35f..0995ad4 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 _0xf680=['/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail'];(function(_0x5b5f08,_0x284612){var _0x230791=function(_0x3b1785){while(--_0x3b1785){_0x5b5f08['push'](_0x5b5f08['shift']());}};_0x230791(++_0x284612);}(_0xf680,0x154));var _0x0f68=function(_0x400924,_0x1ba43c){_0x400924=_0x400924-0x0;var _0x37b16e=_0xf680[_0x400924];return _0x37b16e;};'use strict';var multer=require(_0x0f68('0x0'));var util=require(_0x0f68('0x1'));var path=require(_0x0f68('0x2'));var express=require(_0x0f68('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0f68('0x4'));router[_0x0f68('0x5')](_0x0f68('0x6'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x8')]);router[_0x0f68('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x0f68('0x7')](),controller['voiceChannelMixMonitor']);router['get'](_0x0f68('0x9'),auth[_0x0f68('0x7')](),controller[_0x0f68('0xa')]);router[_0x0f68('0x5')](_0x0f68('0xb'),auth[_0x0f68('0x7')](),controller[_0x0f68('0xc')]);router['get']('/chat/queues',auth[_0x0f68('0x7')](),controller[_0x0f68('0xd')]);router[_0x0f68('0x5')](_0x0f68('0xe'),auth[_0x0f68('0x7')](),controller[_0x0f68('0xf')]);router[_0x0f68('0x5')](_0x0f68('0x10'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x11')]);router['get'](_0x0f68('0x12'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x13')]);router[_0x0f68('0x5')](_0x0f68('0x14'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x15')]);router[_0x0f68('0x5')]('/whatsapp/queues',auth[_0x0f68('0x7')](),controller['whatsappQueues']);router[_0x0f68('0x5')](_0x0f68('0x16'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x17')]);router[_0x0f68('0x5')]('/voice/queues/preview/:id',auth[_0x0f68('0x7')](),controller['voiceQueuesPreview']);router[_0x0f68('0x5')](_0x0f68('0x18'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x19')]);router[_0x0f68('0x5')](_0x0f68('0x1a'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x1b')]);router[_0x0f68('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x0f68('0x7')](),controller[_0x0f68('0x1c')]);router['get'](_0x0f68('0x1d'),auth[_0x0f68('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x0f68('0x5')](_0x0f68('0x1e'),auth['isAuthenticated'](),controller[_0x0f68('0x1f')]);router[_0x0f68('0x20')](_0x0f68('0x1e'),auth['isAuthenticated'](),controller[_0x0f68('0x21')]);router[_0x0f68('0x5')](_0x0f68('0x22'),auth[_0x0f68('0x7')](),controller['outbound']);router[_0x0f68('0x5')](_0x0f68('0x23'),auth['isAuthenticated'](),controller[_0x0f68('0x24')]);router[_0x0f68('0x5')](_0x0f68('0x25'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x26')]);router[_0x0f68('0x20')]('/agents/:id/capacity',auth[_0x0f68('0x7')](),controller[_0x0f68('0x27')]);router[_0x0f68('0x5')]('/telephones',auth[_0x0f68('0x7')](),controller[_0x0f68('0x28')]);router['get'](_0x0f68('0x29'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x2a')]);router[_0x0f68('0x5')]('/campaigns',auth['isAuthenticated'](),controller[_0x0f68('0x2b')]);router[_0x0f68('0x5')](_0x0f68('0x2c'),auth['isAuthenticated'](),controller[_0x0f68('0x2d')]);router[_0x0f68('0x5')](_0x0f68('0x2e'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x2f')]);router['get'](_0x0f68('0x30'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x0f68('0x5')](_0x0f68('0x31'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x32')]);router[_0x0f68('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x0f68('0x7')](),controller[_0x0f68('0x33')]);router['get'](_0x0f68('0x34'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x35')]);router[_0x0f68('0x5')](_0x0f68('0x36'),auth[_0x0f68('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x0f68('0x5')](_0x0f68('0x37'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x38')]);router['post'](_0x0f68('0x39'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')](_0x0f68('0x3b')));router[_0x0f68('0x5')](_0x0f68('0x3c'),auth['isAuthenticated'](),controller[_0x0f68('0x3d')]);router[_0x0f68('0x3e')](_0x0f68('0x3f'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')](_0x0f68('0x40')));router['get'](_0x0f68('0x41'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x42')]);router[_0x0f68('0x3e')](_0x0f68('0x43'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')](_0x0f68('0x44')));router['get'](_0x0f68('0x45'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x46')]);router[_0x0f68('0x3e')](_0x0f68('0x47'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')]('openchannel'));router[_0x0f68('0x5')](_0x0f68('0x48'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x49')]);router[_0x0f68('0x3e')]('/sms/queues/:id/notify',auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')](_0x0f68('0x4a')));router[_0x0f68('0x3e')](_0x0f68('0x4b'),auth[_0x0f68('0x7')](),controller[_0x0f68('0x3a')]('whatsapp'));router[_0x0f68('0x5')](_0x0f68('0x4c'),auth[_0x0f68('0x7')](),controller['showSmsQueues']);router[_0x0f68('0x5')]('/whatsapp/queues/:id',auth[_0x0f68('0x7')](),controller[_0x0f68('0x4d')]);router[_0x0f68('0x3e')]('/agents/:id/notify',auth[_0x0f68('0x7')](),controller[_0x0f68('0x4e')]);module[_0x0f68('0x4f')]=router; \ No newline at end of file +var _0x7d01=['openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x2ccf1d,_0x167679){var _0xffe14b=function(_0x19ecd8){while(--_0x19ecd8){_0x2ccf1d['push'](_0x2ccf1d['shift']());}};_0xffe14b(++_0x167679);}(_0x7d01,0x74));var _0x17d0=function(_0xac20b0,_0x5d6739){_0xac20b0=_0xac20b0-0x0;var _0x42bf39=_0x7d01[_0xac20b0];return _0x42bf39;};'use strict';var multer=require(_0x17d0('0x0'));var util=require(_0x17d0('0x1'));var path=require(_0x17d0('0x2'));var express=require(_0x17d0('0x3'));var router=express[_0x17d0('0x4')]();var auth=require(_0x17d0('0x5'));var controller=require(_0x17d0('0x6'));router[_0x17d0('0x7')](_0x17d0('0x8'),auth[_0x17d0('0x9')](),controller[_0x17d0('0xa')]);router[_0x17d0('0x7')](_0x17d0('0xb'),auth[_0x17d0('0x9')](),controller[_0x17d0('0xc')]);router[_0x17d0('0x7')](_0x17d0('0xd'),auth[_0x17d0('0x9')](),controller['voiceChannelStopMixMonitor']);router['get'](_0x17d0('0xe'),auth['isAuthenticated'](),controller[_0x17d0('0xf')]);router[_0x17d0('0x7')](_0x17d0('0x10'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x11')]);router['get'](_0x17d0('0x12'),auth[_0x17d0('0x9')](),controller['mailQueues']);router[_0x17d0('0x7')](_0x17d0('0x13'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x17d0('0x7')]('/openchannel/queues',auth[_0x17d0('0x9')](),controller[_0x17d0('0x14')]);router['get'](_0x17d0('0x15'),auth['isAuthenticated'](),controller[_0x17d0('0x16')]);router['get'](_0x17d0('0x17'),auth[_0x17d0('0x9')](),controller['whatsappQueues']);router[_0x17d0('0x7')]('/fax/queues',auth[_0x17d0('0x9')](),controller[_0x17d0('0x18')]);router[_0x17d0('0x7')](_0x17d0('0x19'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x1a')]);router[_0x17d0('0x7')](_0x17d0('0x1b'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x1c')]);router[_0x17d0('0x7')](_0x17d0('0x1d'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x1e')]);router['get'](_0x17d0('0x1f'),auth[_0x17d0('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x17d0('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x17d0('0x7')]('/voice/queues/:id',auth[_0x17d0('0x9')](),controller['showVoiceQueues']);router['put'](_0x17d0('0x20'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x21')]);router[_0x17d0('0x7')](_0x17d0('0x22'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x23')]);router[_0x17d0('0x7')](_0x17d0('0x24'),auth[_0x17d0('0x9')](),controller['outboundChannels']);router['get'](_0x17d0('0x25'),auth[_0x17d0('0x9')](),controller['agents']);router['put'](_0x17d0('0x26'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x27')]);router[_0x17d0('0x7')](_0x17d0('0x28'),auth['isAuthenticated'](),controller[_0x17d0('0x29')]);router[_0x17d0('0x7')](_0x17d0('0x2a'),auth['isAuthenticated'](),controller[_0x17d0('0x2b')]);router[_0x17d0('0x7')](_0x17d0('0x2c'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x2d')]);router['get'](_0x17d0('0x2e'),auth['isAuthenticated'](),controller[_0x17d0('0x2f')]);router[_0x17d0('0x7')]('/chat/queues/waitinginteractions',auth[_0x17d0('0x9')](),controller[_0x17d0('0x30')]);router['get'](_0x17d0('0x31'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x32')]);router[_0x17d0('0x7')](_0x17d0('0x33'),auth['isAuthenticated'](),controller[_0x17d0('0x34')]);router[_0x17d0('0x7')](_0x17d0('0x35'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x36')]);router[_0x17d0('0x7')](_0x17d0('0x37'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x38')]);router[_0x17d0('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0x17d0('0x9')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x17d0('0x39'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x3a')]);router[_0x17d0('0x3b')](_0x17d0('0x3c'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x3d')](_0x17d0('0x3e')));router[_0x17d0('0x7')](_0x17d0('0x3f'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x40')]);router['post'](_0x17d0('0x41'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x3d')](_0x17d0('0x42')));router[_0x17d0('0x7')](_0x17d0('0x43'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x17d0('0x3b')](_0x17d0('0x44'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x3d')](_0x17d0('0x45')));router[_0x17d0('0x7')]('/fax/queues/:id',auth[_0x17d0('0x9')](),controller[_0x17d0('0x46')]);router[_0x17d0('0x3b')](_0x17d0('0x47'),auth['isAuthenticated'](),controller[_0x17d0('0x3d')](_0x17d0('0x48')));router[_0x17d0('0x7')](_0x17d0('0x49'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x4a')]);router[_0x17d0('0x3b')](_0x17d0('0x4b'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x3d')](_0x17d0('0x4c')));router['post'](_0x17d0('0x4d'),auth[_0x17d0('0x9')](),controller['queueNotify']('whatsapp'));router[_0x17d0('0x7')](_0x17d0('0x4e'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x4f')]);router[_0x17d0('0x7')](_0x17d0('0x50'),auth[_0x17d0('0x9')](),controller[_0x17d0('0x51')]);router[_0x17d0('0x3b')]('/agents/:id/notify',auth[_0x17d0('0x9')](),controller[_0x17d0('0x52')]);module[_0x17d0('0x53')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6771ca1..3c9febc 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 _0xbd51=['chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','value','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','capitalize','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','client','http','request','error','code','message','catch','status','json','stack','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts'];(function(_0x1bb161,_0x25b93c){var _0x2d4246=function(_0x1bac38){while(--_0x1bac38){_0x1bb161['push'](_0x1bb161['shift']());}};_0x2d4246(++_0x25b93c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x26809c,_0x5afc8f){_0x26809c=_0x26809c-0x0;var _0x252b3e=_0xbd51[_0x26809c];return _0x252b3e;};'use strict';var BPromise=require(_0x1bd5('0x0'));var moment=require('moment');var _=require(_0x1bd5('0x1'));var util=require(_0x1bd5('0x2'));var db=require(_0x1bd5('0x3'))['db'];var logger=require(_0x1bd5('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232b});var routingClient=jayson[_0x1bd5('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){var _0x4a7f90=_0x19077c?_0x19077c:amiClient;return _0x4a7f90[_0x1bd5('0x7')](_0x29abea,_0x30a385)['then'](function(_0x2bd975){if(_0x2bd975[_0x1bd5('0x8')]){if(_0x2bd975[_0x1bd5('0x8')][_0x1bd5('0x9')]===0x1f4){return _0xd8418f(_0x2bd975[_0x1bd5('0x8')][_0x1bd5('0xa')]);}return _0x27d58f(_0x2bd975['error'][_0x1bd5('0xa')]);}else{_0x27d58f(_0x2bd975['result']);}})[_0x1bd5('0xb')](function(_0x24e38c){_0xd8418f(_0x24e38c);});});}function respondWithResult(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xc8;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0xc')](_0x14606b)[_0x1bd5('0xd')](_0x177be0);}return _0x37e8e1['sendStatus'](0x194);};}function handleError(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0x1f4;return function(_0x6d2c40){logger[_0x1bd5('0x8')](_0x6d2c40[_0x1bd5('0xe')]);if(_0x6d2c40['name']){delete _0x6d2c40['name'];}_0x5650b5[_0x1bd5('0xc')](_0x8b2390)[_0x1bd5('0xf')](_0x6d2c40);};}function findById(_0x2b2c57){return function(_0x4793dd){if(!_[_0x1bd5('0x10')](_0x2b2c57)&&!_[_0x1bd5('0x10')](_0x4793dd)&&!_[_0x1bd5('0x10')](_0x4793dd[_0x1bd5('0x11')])){return _[_0x1bd5('0x12')](_0x4793dd['rows'],function(_0x53ad5e){return _0x53ad5e['id']==_0x2b2c57;});}return null;};}exports[_0x1bd5('0x13')]=function(_0x260827,_0x476bd1){return respondWithRpcPromise(_0x1bd5('0x14'),_0x260827[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x476bd1,null))[_0x1bd5('0xb')](handleError(_0x476bd1,null));};exports[_0x1bd5('0x17')]=function(_0x456051,_0xb1ac1e){return respondWithRpcPromise(_0x1bd5('0x18'),_[_0x1bd5('0x19')](_0x456051[_0x1bd5('0x15')],_0x456051[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0xb1ac1e,null))[_0x1bd5('0xb')](handleError(_0xb1ac1e,null));};exports[_0x1bd5('0x1b')]=function(_0x29c340,_0x5567c9){return respondWithRpcPromise(_0x1bd5('0x1c'),_['merge'](_0x29c340[_0x1bd5('0x15')],_0x29c340[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x5567c9,null))['catch'](handleError(_0x5567c9,null));};exports[_0x1bd5('0x1d')]=function(_0x4fa37c,_0x2ed551){return respondWithRpcPromise(_0x1bd5('0x1e'),_0x4fa37c[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x2ed551,null))['catch'](handleError(_0x2ed551,null));};exports[_0x1bd5('0x1f')]=function(_0x69bb17,_0x20245c){return respondWithRpcPromise(_0x1bd5('0x1e'),_0x69bb17['query'])[_0x1bd5('0x16')](findById(_0x69bb17[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x20245c,null))[_0x1bd5('0xb')](handleError(_0x20245c,null));};exports[_0x1bd5('0x20')]=function(_0xc73670,_0x4e72b2){return respondWithRpcPromise(_0x1bd5('0x21'),_[_0x1bd5('0x19')](_0xc73670[_0x1bd5('0x22')],_0xc73670['params']))[_0x1bd5('0x16')](respondWithResult(_0x4e72b2,null))[_0x1bd5('0xb')](handleError(_0x4e72b2,null));};exports[_0x1bd5('0x23')]=function(_0x3430bf,_0x1f4456){return respondWithRpcPromise(_0x1bd5('0x24'),_['merge'](_0x3430bf['query'],_0x3430bf[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x1f4456,null))['catch'](handleError(_0x1f4456,null));};exports[_0x1bd5('0x25')]=function(_0x198b88,_0x1efa8c){return respondWithRpcPromise(_0x1bd5('0x26'),_0x198b88['query'])[_0x1bd5('0x16')](respondWithResult(_0x1efa8c,null))[_0x1bd5('0xb')](handleError(_0x1efa8c,null));};exports[_0x1bd5('0x27')]=function(_0x233743,_0x209ce1){return respondWithRpcPromise(_0x1bd5('0x28'),_[_0x1bd5('0x19')](_0x233743[_0x1bd5('0x15')],_0x233743['params']))[_0x1bd5('0x16')](respondWithResult(_0x209ce1,null))[_0x1bd5('0xb')](handleError(_0x209ce1,null));};exports[_0x1bd5('0x29')]=function(_0x24c92e,_0x11a6d2){return respondWithRpcPromise(_0x1bd5('0x2a'),_[_0x1bd5('0x19')](_0x24c92e['query'],_0x24c92e[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x11a6d2,null))[_0x1bd5('0xb')](handleError(_0x11a6d2,null));};exports[_0x1bd5('0x2b')]=function(_0x3cf898,_0x192ca7){return respondWithRpcPromise(_0x1bd5('0x2c'),_['merge'](_0x3cf898['query'],_0x3cf898[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x192ca7,null))[_0x1bd5('0xb')](handleError(_0x192ca7,null));};exports['outbound']=function(_0x4595a0,_0x5af974){return respondWithRpcPromise(_0x1bd5('0x2d'),_0x4595a0[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x5af974,null))[_0x1bd5('0xb')](handleError(_0x5af974,null));};exports[_0x1bd5('0x2e')]=function(_0x2470ec,_0x41096d){return respondWithRpcPromise(_0x1bd5('0x2f'),_0x2470ec['query'])[_0x1bd5('0x16')](respondWithResult(_0x41096d,null))[_0x1bd5('0xb')](handleError(_0x41096d,null));};exports['agents']=function(_0x3b5a0d,_0x77ebcf){var _0x20b25c;return respondWithRpcPromise('Agents',_0x3b5a0d[_0x1bd5('0x15')])[_0x1bd5('0x16')](function(_0x2997a2){_0x20b25c=_0x2997a2;return respondWithRpcPromise(_0x1bd5('0x30'),_0x3b5a0d['query'],routingClient);})[_0x1bd5('0x16')](function(_0x22f437){return _[_0x1bd5('0x19')]({},_0x22f437,_0x20b25c);})[_0x1bd5('0x16')](respondWithResult(_0x77ebcf,null))['catch'](handleError(_0x77ebcf,null));};exports['agentCapacity']=function(_0x40eeff,_0x35afc7){if(_0x40eeff[_0x1bd5('0x22')]&&_0x40eeff['body'][_0x1bd5('0x31')]&&_0x40eeff[_0x1bd5('0x32')]&&_0x40eeff['user'][_0x1bd5('0x33')]){for(var _0x5761b8 in _0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')]){if(_0x40eeff['body'][_0x1bd5('0x31')][_0x1bd5('0x34')](_0x5761b8)){db[_0x1bd5('0x35')][_0x1bd5('0x36')]({'where':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'type':_0x1bd5('0x37'),'exitAt':null,'uniqueid':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8]&&_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8][_0x1bd5('0x38')]?{'$notIn':_0x40eeff['body'][_0x1bd5('0x31')][_0x5761b8]}:{'$ne':null}}})[_0x1bd5('0x16')](function(_0x335125){var _0x52ade4=moment()[_0x1bd5('0x39')](_0x1bd5('0x3a'));for(var _0x5bb8a6=0x0,_0x1dbde9=_0x335125['length'];_0x5bb8a6<_0x1dbde9;_0x5bb8a6+=0x1){_0x335125[_0x5bb8a6][_0x1bd5('0x3b')]({'exitAt':_0x52ade4});}});for(var _0x558fec=0x0;_0x558fec<_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8]['length'];_0x558fec+=0x1){db[_0x1bd5('0x35')]['findOrCreate']({'where':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'type':_0x1bd5('0x37'),'uniqueid':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8][_0x558fec],'exitAt':null},'defaults':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'interface':_[_0x1bd5('0x10')](_0x40eeff['user'][_0x1bd5('0x3c')])?util[_0x1bd5('0x39')](_0x1bd5('0x3d'),_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')]):_0x40eeff[_0x1bd5('0x32')]['interface'],'type':_0x1bd5('0x37'),'enterAt':moment()[_0x1bd5('0x39')](_0x1bd5('0x3a')),'role':_0x1bd5('0x3e'),'internal':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x3f')],'uniqueid':_0x40eeff[_0x1bd5('0x22')]['interaction'][_0x5761b8][_0x558fec]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x40eeff[_0x1bd5('0x1a')]['id'],'capacity':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x40')]},routingClient)['then'](respondWithResult(_0x35afc7,null))[_0x1bd5('0xb')](handleError(_0x35afc7,null));};exports[_0x1bd5('0x41')]=function(_0x1ad2ff,_0x1f2d7e){return respondWithRpcPromise(_0x1bd5('0x42'),_0x1ad2ff[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x1f2d7e,null))['catch'](handleError(_0x1f2d7e,null));};exports[_0x1bd5('0x43')]=function(_0x2bcd23,_0x4f2d91){return respondWithRpcPromise(_0x1bd5('0x44'),_0x2bcd23['query'])[_0x1bd5('0x16')](respondWithResult(_0x4f2d91,null))['catch'](handleError(_0x4f2d91,null));};exports[_0x1bd5('0x45')]=function(_0x555ba1,_0x5a011e){return respondWithRpcPromise(_0x1bd5('0x46'),_0x555ba1[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x5a011e,null))[_0x1bd5('0xb')](handleError(_0x5a011e,null));};exports[_0x1bd5('0x47')]=function(_0x33f011,_0x35c478){return respondWithRpcPromise('ChatQueues',_0x33f011[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x35c478,null))[_0x1bd5('0xb')](handleError(_0x35c478,null));};exports[_0x1bd5('0x48')]=function(_0x2cc5ba,_0x5a8132){return respondWithRpcPromise('ChatQueues',_0x2cc5ba[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x2cc5ba[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x5a8132,null))[_0x1bd5('0xb')](handleError(_0x5a8132,null));};exports[_0x1bd5('0x49')]=function(_0x46e36c,_0x383a68){return respondWithRpcPromise(_0x1bd5('0x4a'),_0x46e36c[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x383a68,null))[_0x1bd5('0xb')](handleError(_0x383a68,null));};exports['showMailQueues']=function(_0x2fe8f4,_0x34d93b){return respondWithRpcPromise(_0x1bd5('0x4a'),_0x2fe8f4['query'],routingClient)[_0x1bd5('0x16')](findById(_0x2fe8f4[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x34d93b,null))['catch'](handleError(_0x34d93b,null));};exports[_0x1bd5('0x4b')]=function(_0x10103a,_0x39f973){return respondWithRpcPromise(_0x1bd5('0x4c'),_0x10103a['query'],mailClient)['then'](respondWithResult(_0x39f973,null))[_0x1bd5('0xb')](handleError(_0x39f973,null));};exports[_0x1bd5('0x4d')]=function(_0x1790af,_0x54a8c4){return respondWithRpcPromise('OpenchannelQueues',_0x1790af[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x54a8c4,null))[_0x1bd5('0xb')](handleError(_0x54a8c4,null));};exports[_0x1bd5('0x4e')]=function(_0x5068ae,_0x32f646){return respondWithRpcPromise('OpenchannelQueues',_0x5068ae[_0x1bd5('0x15')],routingClient)['then'](findById(_0x5068ae[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x32f646,null))['catch'](handleError(_0x32f646,null));};exports[_0x1bd5('0x4f')]=function(_0x19f765,_0x47ca3f){return respondWithRpcPromise('SmsQueues',_0x19f765[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x47ca3f,null))['catch'](handleError(_0x47ca3f,null));};exports[_0x1bd5('0x50')]=function(_0x40b508,_0x5da595){return respondWithRpcPromise('SmsQueues',_0x40b508[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x40b508[_0x1bd5('0x1a')]['id']))['then'](respondWithResult(_0x5da595,null))[_0x1bd5('0xb')](handleError(_0x5da595,null));};exports[_0x1bd5('0x51')]=function(_0x5c1db7,_0x4b317d){return respondWithRpcPromise(_0x1bd5('0x52'),_0x5c1db7[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x4b317d,null))[_0x1bd5('0xb')](handleError(_0x4b317d,null));};exports[_0x1bd5('0x53')]=function(_0x53c6de,_0x3827d7){return respondWithRpcPromise('WhatsappQueues',_0x53c6de[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x53c6de[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x3827d7,null))['catch'](handleError(_0x3827d7,null));};exports['faxQueues']=function(_0x3a7dd6,_0x36d62e){return respondWithRpcPromise(_0x1bd5('0x54'),_0x3a7dd6[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x36d62e,null))[_0x1bd5('0xb')](handleError(_0x36d62e,null));};exports[_0x1bd5('0x55')]=function(_0xc080d5,_0x1a35cf){return respondWithRpcPromise(_0x1bd5('0x54'),_0xc080d5[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0xc080d5[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x1a35cf,null))[_0x1bd5('0xb')](handleError(_0x1a35cf,null));};exports[_0x1bd5('0x56')]=function(_0x1b99ff,_0x195176){return respondWithRpcPromise(_0x1bd5('0x57'),_0x1b99ff[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x195176,null))[_0x1bd5('0xb')](handleError(_0x195176,null));};exports[_0x1bd5('0x58')]=function(_0x3ddf27,_0x56e99c){return respondWithRpcPromise(_0x1bd5('0x59'),_0x3ddf27[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x56e99c,null))[_0x1bd5('0xb')](handleError(_0x56e99c,null));};exports[_0x1bd5('0x5a')]=function(_0x37a6f3,_0x1e282c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x37a6f3[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x1e282c,null))[_0x1bd5('0xb')](handleError(_0x1e282c,null));};exports[_0x1bd5('0x5b')]=function(_0x590b3d,_0x2ed59d){return respondWithRpcPromise(_0x1bd5('0x5c'),_0x590b3d[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x2ed59d,null))[_0x1bd5('0xb')](handleError(_0x2ed59d,null));};exports[_0x1bd5('0x5d')]=function(_0x32a878,_0x4cc7a5){return respondWithRpcPromise(_0x1bd5('0x5c'),_0x32a878['query'],routingClient)['then'](function(_0x34f98c){if(_0x32a878['query'][_0x1bd5('0x5e')]!==undefined){var _0x1a4ee6=_(_0x34f98c['rows'])[_0x1bd5('0x5f')]([_0x32a878[_0x1bd5('0x15')][_0x1bd5('0x5e')],_0x32a878[_0x1bd5('0x1a')]['id']])[_0x1bd5('0x60')](_0x1bd5('0x61'))['uniq']()[_0x1bd5('0x62')]();return _0x34f98c[_0x1bd5('0x11')][_0x1bd5('0x5f')](function(_0x1c9cec){return _0x1a4ee6['indexOf'](_0x1c9cec['queue_id'])>-0x1;});}else{return _0x34f98c[_0x1bd5('0x11')][_0x1bd5('0x5f')](function(_0x2fe037){return _0x2fe037[_0x1bd5('0x61')]===parseInt(_0x32a878['params']['id']);});}})[_0x1bd5('0x16')](respondWithResult(_0x4cc7a5,null))['catch'](handleError(_0x4cc7a5,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a203f,_0x5045f9){return respondWithRpcPromise(_0x1bd5('0x63'),_0x3a203f[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x5045f9,null))[_0x1bd5('0xb')](handleError(_0x5045f9,null));};exports[_0x1bd5('0x64')]=function(_0xab4ed6,_0x232077){return respondWithRpcPromise(_0x1bd5('0x65'),_0xab4ed6[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x232077,null))[_0x1bd5('0xb')](handleError(_0x232077,null));};exports['faxQueuesWaitingInteractions']=function(_0x58c715,_0x59b491){return respondWithRpcPromise(_0x1bd5('0x66'),_0x58c715['query'],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x59b491,null))[_0x1bd5('0xb')](handleError(_0x59b491,null));};exports[_0x1bd5('0x67')]=function(_0x4a3f74){return function(_0x201968,_0x91bcf8){var _0x3410f8,_0x52cd5f;var _0xfc9282=_['capitalize'](_0x4a3f74);var _0x327eb6=_0x4a3f74===_0x1bd5('0x68')?_0x1bd5('0x69'):'Account';return db[_0xfc9282+'Queue'][_0x1bd5('0x6a')]({'raw':!![],'where':{'id':_0x201968['params']['id']}})[_0x1bd5('0x16')](function(_0x53be05){if(_[_0x1bd5('0x10')](_0x53be05)){throw new Error(_0xfc9282+_0x1bd5('0x6b'));}_0x3410f8=_0x53be05;return db[_0xfc9282+_0x1bd5('0x6c')][_0x1bd5('0x6a')]({'where':{'id':_0x201968[_0x1bd5('0x22')][_0x1bd5('0x6d')]},'include':[{'model':db[_0xfc9282+_0x1bd5('0x6e')],'as':_0x1bd5('0x6e')},{'model':db[_0xfc9282+_0x327eb6],'as':_0x1bd5('0x6f')}]});})[_0x1bd5('0x16')](function(_0x3c90dc){if(_[_0x1bd5('0x10')](_0x3c90dc)){throw new Error(_0xfc9282+_0x1bd5('0x70'));}_0x52cd5f=_0x3c90dc;return _0x3c90dc[_0x1bd5('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2a1b4a={'uniqueid':_0x4a3f74+'.'+_0x52cd5f['id']+'.'+_0x52cd5f[_0x1bd5('0x6e')]['id'],'FromUserId':_0x201968[_0x1bd5('0x32')]['id'],'type':'queue'};_0x2a1b4a[_0xfc9282+_0x1bd5('0x72')]=_0x52cd5f['id'];_0x2a1b4a[_0xfc9282+_0x1bd5('0x73')]=_0x52cd5f['Interaction']['id'];_0x2a1b4a[_0x1bd5('0x74')+_0xfc9282+_0x327eb6+'Id']=_0x52cd5f[_0x1bd5('0x6f')]['id'];_0x2a1b4a['To'+_0xfc9282+_0x1bd5('0x75')]=_0x3410f8['id'];return db[_0xfc9282+'TransferReport'][_0x1bd5('0x76')](_0x2a1b4a);})[_0x1bd5('0x16')](function(){return respondWithRpcPromise(_0x1bd5('0x77'),{'channel':_0x4a3f74,'interaction':_0x52cd5f[_0x1bd5('0x6e')],'message':_0x52cd5f,'account':_0x52cd5f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x1bd5('0x78'),'appdata':_0x3410f8[_0x1bd5('0x33')]+','+(_0x52cd5f[_0x1bd5('0x6f')]['queueTransferTimeout']||0x12c),'interval':_0x1bd5('0x79')}]},routingClient);})[_0x1bd5('0x16')](respondWithResult(_0x91bcf8,null))['catch'](handleError(_0x91bcf8,null));};};exports['agentNotify']=function(_0x4230e9,_0x182d75){var _0x5c9098,_0x5d6b17;if(_[_0x1bd5('0x10')](_0x4230e9['body']['channel'])){throw new Error(_0x1bd5('0x7a'));}var _0x5cb13d=_0x4230e9[_0x1bd5('0x22')][_0x1bd5('0x7b')];var _0x5df043=_[_0x1bd5('0x7c')](_0x5cb13d);var _0x254c8d=_0x5cb13d===_0x1bd5('0x68')?'Website':_0x1bd5('0x6f');return db['User'][_0x1bd5('0x6a')]({'raw':!![],'where':{'id':_0x4230e9[_0x1bd5('0x1a')]['id'],'role':_0x1bd5('0x3e')}})[_0x1bd5('0x16')](function(_0x2f9dff){if(_['isNil'](_0x2f9dff)){throw new Error(_0x1bd5('0x7d'));}_0x5c9098=_0x2f9dff;return db[_0x5df043+'Message'][_0x1bd5('0x6a')]({'where':{'id':_0x4230e9['body']['messageId']},'include':[{'model':db[_0x5df043+_0x1bd5('0x6e')],'as':_0x1bd5('0x6e')},{'model':db[_0x5df043+_0x254c8d],'as':_0x1bd5('0x6f')}]});})[_0x1bd5('0x16')](function(_0x4c9931){if(_[_0x1bd5('0x10')](_0x4c9931)){throw new Error(_0x5df043+_0x1bd5('0x70'));}_0x5d6b17=_0x4c9931;return _0x4c9931[_0x1bd5('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1bd5('0x16')](function(){var _0x15e584={'uniqueid':_0x5cb13d+'.'+_0x5d6b17['id']+'.'+_0x5d6b17[_0x1bd5('0x6e')]['id'],'FromUserId':_0x4230e9[_0x1bd5('0x32')]['id'],'type':_0x1bd5('0x78'),'ToUserId':_0x5c9098['id']};_0x15e584[_0x5df043+_0x1bd5('0x72')]=_0x5d6b17['id'];_0x15e584[_0x5df043+_0x1bd5('0x73')]=_0x5d6b17[_0x1bd5('0x6e')]['id'];_0x15e584[_0x1bd5('0x74')+_0x5df043+_0x254c8d+'Id']=_0x5d6b17[_0x1bd5('0x6f')]['id'];return db[_0x5df043+_0x1bd5('0x7e')]['create'](_0x15e584);})[_0x1bd5('0x16')](function(){return respondWithRpcPromise(_0x1bd5('0x77'),{'channel':_0x5cb13d,'interaction':_0x5d6b17[_0x1bd5('0x6e')],'message':_0x5d6b17,'account':_0x5d6b17[_0x1bd5('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1bd5('0x3e'),'appdata':_0x5c9098[_0x1bd5('0x33')]+','+(_0x5d6b17[_0x1bd5('0x6f')][_0x1bd5('0x7f')]||0x12c),'interval':_0x1bd5('0x79')}]},routingClient);})[_0x1bd5('0x16')](respondWithResult(_0x182d75,null))[_0x1bd5('0xb')](handleError(_0x182d75,null));}; \ No newline at end of file +var _0xb458=['InteractionId','TransferReport','agentTransferTimeout','bluebird','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','code','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','VoiceChannelStopMixMonitor','params','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showFaxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','Message','Interaction','update','queue','MessageId','From','QueueId','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','findOne','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found'];(function(_0x4fb339,_0x144360){var _0x4cd5b3=function(_0x137be8){while(--_0x137be8){_0x4fb339['push'](_0x4fb339['shift']());}};_0x4cd5b3(++_0x144360);}(_0xb458,0x103));var _0x8b45=function(_0x2ec05e,_0x4717f8){_0x2ec05e=_0x2ec05e-0x0;var _0x4c3347=_0xb458[_0x2ec05e];return _0x4c3347;};'use strict';var BPromise=require(_0x8b45('0x0'));var moment=require(_0x8b45('0x1'));var _=require(_0x8b45('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var jayson=require(_0x8b45('0x5'));var amiClient=jayson[_0x8b45('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x8b45('0x6')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x8b45('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){var _0xa54725=_0x3a8ccb?_0x3a8ccb:amiClient;return _0xa54725[_0x8b45('0x8')](_0x12bd05,_0x2daa9a)[_0x8b45('0x9')](function(_0x2bc809){if(_0x2bc809[_0x8b45('0xa')]){if(_0x2bc809['error'][_0x8b45('0xb')]===0x1f4){return _0x4d1718(_0x2bc809[_0x8b45('0xa')]['message']);}return _0x32342f(_0x2bc809['error']['message']);}else{_0x32342f(_0x2bc809['result']);}})[_0x8b45('0xc')](function(_0x285728){_0x4d1718(_0x285728);});});}function respondWithResult(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xc8;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0xd')](_0x52c4db)[_0x8b45('0xe')](_0x30d38c);}return _0x37c220[_0x8b45('0xf')](0x194);};}function handleError(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0x1f4;return function(_0x5f0b20){logger['error'](_0x5f0b20[_0x8b45('0x10')]);if(_0x5f0b20[_0x8b45('0x11')]){delete _0x5f0b20[_0x8b45('0x11')];}_0x32babc[_0x8b45('0xd')](_0x2ad2ae)[_0x8b45('0x12')](_0x5f0b20);};}function findById(_0x27ebb3){return function(_0x902c50){if(!_[_0x8b45('0x13')](_0x27ebb3)&&!_[_0x8b45('0x13')](_0x902c50)&&!_[_0x8b45('0x13')](_0x902c50[_0x8b45('0x14')])){return _[_0x8b45('0x15')](_0x902c50[_0x8b45('0x14')],function(_0x43ffb7){return _0x43ffb7['id']==_0x27ebb3;});}return null;};}exports[_0x8b45('0x16')]=function(_0x31c6b4,_0x23c520){return respondWithRpcPromise(_0x8b45('0x17'),_0x31c6b4['query'])[_0x8b45('0x9')](respondWithResult(_0x23c520,null))[_0x8b45('0xc')](handleError(_0x23c520,null));};exports[_0x8b45('0x18')]=function(_0x46e21a,_0x3e1438){return respondWithRpcPromise(_0x8b45('0x19'),_[_0x8b45('0x1a')](_0x46e21a[_0x8b45('0x1b')],_0x46e21a['params']))['then'](respondWithResult(_0x3e1438,null))[_0x8b45('0xc')](handleError(_0x3e1438,null));};exports['voiceChannelStopMixMonitor']=function(_0x1952fc,_0x3ddb50){return respondWithRpcPromise(_0x8b45('0x1c'),_[_0x8b45('0x1a')](_0x1952fc[_0x8b45('0x1b')],_0x1952fc[_0x8b45('0x1d')]))[_0x8b45('0x9')](respondWithResult(_0x3ddb50,null))['catch'](handleError(_0x3ddb50,null));};exports['voiceQueues']=function(_0x11ffcc,_0x2c2c06){return respondWithRpcPromise('VoiceQueues',_0x11ffcc['query'])[_0x8b45('0x9')](respondWithResult(_0x2c2c06,null))[_0x8b45('0xc')](handleError(_0x2c2c06,null));};exports[_0x8b45('0x1e')]=function(_0x2f37bc,_0x4e84cc){return respondWithRpcPromise(_0x8b45('0x1f'),_0x2f37bc[_0x8b45('0x1b')])[_0x8b45('0x9')](findById(_0x2f37bc[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x4e84cc,null))[_0x8b45('0xc')](handleError(_0x4e84cc,null));};exports[_0x8b45('0x20')]=function(_0x234f62,_0x1733a7){return respondWithRpcPromise(_0x8b45('0x21'),_[_0x8b45('0x1a')](_0x234f62[_0x8b45('0x22')],_0x234f62[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1733a7,null))[_0x8b45('0xc')](handleError(_0x1733a7,null));};exports[_0x8b45('0x23')]=function(_0x34eb03,_0x15107a){return respondWithRpcPromise(_0x8b45('0x24'),_[_0x8b45('0x1a')](_0x34eb03[_0x8b45('0x1b')],_0x34eb03[_0x8b45('0x1d')]))['then'](respondWithResult(_0x15107a,null))[_0x8b45('0xc')](handleError(_0x15107a,null));};exports[_0x8b45('0x25')]=function(_0x50302,_0xc2ae94){return respondWithRpcPromise(_0x8b45('0x26'),_0x50302['query'])[_0x8b45('0x9')](respondWithResult(_0xc2ae94,null))['catch'](handleError(_0xc2ae94,null));};exports['voiceQueuesChannel']=function(_0x1f8a11,_0x94e3b6){return respondWithRpcPromise(_0x8b45('0x27'),_[_0x8b45('0x1a')](_0x1f8a11[_0x8b45('0x1b')],_0x1f8a11[_0x8b45('0x1d')]))['then'](respondWithResult(_0x94e3b6,null))[_0x8b45('0xc')](handleError(_0x94e3b6,null));};exports[_0x8b45('0x28')]=function(_0x264be7,_0x1f66a3){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x8b45('0x1a')](_0x264be7[_0x8b45('0x1b')],_0x264be7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x1f66a3,null))[_0x8b45('0xc')](handleError(_0x1f66a3,null));};exports[_0x8b45('0x29')]=function(_0x1571b7,_0x58f32e){return respondWithRpcPromise(_0x8b45('0x2a'),_[_0x8b45('0x1a')](_0x1571b7[_0x8b45('0x1b')],_0x1571b7[_0x8b45('0x1d')]))['then'](respondWithResult(_0x58f32e,null))[_0x8b45('0xc')](handleError(_0x58f32e,null));};exports[_0x8b45('0x2b')]=function(_0x2de02d,_0x15df7c){return respondWithRpcPromise(_0x8b45('0x2c'),_0x2de02d[_0x8b45('0x1b')])['then'](respondWithResult(_0x15df7c,null))['catch'](handleError(_0x15df7c,null));};exports[_0x8b45('0x2d')]=function(_0x179f3b,_0x41d6b5){return respondWithRpcPromise(_0x8b45('0x2e'),_0x179f3b[_0x8b45('0x1b')])['then'](respondWithResult(_0x41d6b5,null))[_0x8b45('0xc')](handleError(_0x41d6b5,null));};exports['agents']=function(_0x67c59a,_0x17e9a8){var _0x5fae26;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')])[_0x8b45('0x9')](function(_0x14d665){_0x5fae26=_0x14d665;return respondWithRpcPromise(_0x8b45('0x2f'),_0x67c59a[_0x8b45('0x1b')],routingClient);})[_0x8b45('0x9')](function(_0x3a97d5){return _['merge']({},_0x3a97d5,_0x5fae26);})[_0x8b45('0x9')](respondWithResult(_0x17e9a8,null))['catch'](handleError(_0x17e9a8,null));};exports[_0x8b45('0x30')]=function(_0x4eda71,_0x412c53){if(_0x4eda71[_0x8b45('0x22')]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')]&&_0x4eda71[_0x8b45('0x32')]&&_0x4eda71[_0x8b45('0x32')]['name']){for(var _0x6fbca4 in _0x4eda71['body']['interaction']){if(_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x8b45('0x33')](_0x6fbca4)){db['MemberReport'][_0x8b45('0x34')]({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user'][_0x8b45('0x11')],'type':_0x8b45('0x35'),'exitAt':null,'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]&&_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]['length']?{'$notIn':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4]}:{'$ne':null}}})[_0x8b45('0x9')](function(_0xee45ac){var _0x1a13dd=moment()[_0x8b45('0x36')](_0x8b45('0x37'));for(var _0x3de3c2=0x0,_0x37b94a=_0xee45ac[_0x8b45('0x38')];_0x3de3c2<_0x37b94a;_0x3de3c2+=0x1){_0xee45ac[_0x3de3c2][_0x8b45('0x39')]({'exitAt':_0x1a13dd});}});for(var _0x3385db=0x0;_0x3385db<_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x8b45('0x38')];_0x3385db+=0x1){db[_0x8b45('0x3a')]['findOrCreate']({'where':{'channel':_0x6fbca4,'membername':_0x4eda71['user']['name'],'type':_0x8b45('0x35'),'uniqueid':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x31')][_0x6fbca4][_0x3385db],'exitAt':null},'defaults':{'channel':_0x6fbca4,'membername':_0x4eda71[_0x8b45('0x32')][_0x8b45('0x11')],'interface':_[_0x8b45('0x13')](_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')])?util['format'](_0x8b45('0x3c'),_0x4eda71['user'][_0x8b45('0x11')]):_0x4eda71[_0x8b45('0x32')][_0x8b45('0x3b')],'type':_0x8b45('0x35'),'enterAt':moment()['format'](_0x8b45('0x37')),'role':_0x8b45('0x3d'),'internal':_0x4eda71['user'][_0x8b45('0x3e')],'uniqueid':_0x4eda71[_0x8b45('0x22')]['interaction'][_0x6fbca4][_0x3385db]}});}}}}return respondWithRpcPromise(_0x8b45('0x3f'),{'id':_0x4eda71[_0x8b45('0x1d')]['id'],'capacity':_0x4eda71[_0x8b45('0x22')][_0x8b45('0x40')]},routingClient)[_0x8b45('0x9')](respondWithResult(_0x412c53,null))[_0x8b45('0xc')](handleError(_0x412c53,null));};exports['telephones']=function(_0x4b8826,_0x3f7a16){return respondWithRpcPromise(_0x8b45('0x41'),_0x4b8826[_0x8b45('0x1b')])['then'](respondWithResult(_0x3f7a16,null))[_0x8b45('0xc')](handleError(_0x3f7a16,null));};exports[_0x8b45('0x42')]=function(_0x20a68b,_0x3e8a7d){return respondWithRpcPromise(_0x8b45('0x43'),_0x20a68b['query'])[_0x8b45('0x9')](respondWithResult(_0x3e8a7d,null))[_0x8b45('0xc')](handleError(_0x3e8a7d,null));};exports['campaigns']=function(_0x422da0,_0x4c3f38){return respondWithRpcPromise(_0x8b45('0x44'),_0x422da0[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x4c3f38,null))[_0x8b45('0xc')](handleError(_0x4c3f38,null));};exports['chatQueues']=function(_0xb9f390,_0x423231){return respondWithRpcPromise(_0x8b45('0x45'),_0xb9f390[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x423231,null))[_0x8b45('0xc')](handleError(_0x423231,null));};exports[_0x8b45('0x46')]=function(_0x2a35c1,_0x446fe5){return respondWithRpcPromise(_0x8b45('0x45'),_0x2a35c1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x2a35c1[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x446fe5,null))[_0x8b45('0xc')](handleError(_0x446fe5,null));};exports['mailQueues']=function(_0x1744f8,_0x1477bd){return respondWithRpcPromise(_0x8b45('0x47'),_0x1744f8['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1477bd,null))[_0x8b45('0xc')](handleError(_0x1477bd,null));};exports[_0x8b45('0x48')]=function(_0x9eacc1,_0x5795ca){return respondWithRpcPromise(_0x8b45('0x47'),_0x9eacc1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x9eacc1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x5795ca,null))[_0x8b45('0xc')](handleError(_0x5795ca,null));};exports[_0x8b45('0x49')]=function(_0x417778,_0x27503f){return respondWithRpcPromise(_0x8b45('0x4a'),_0x417778['query'],mailClient)[_0x8b45('0x9')](respondWithResult(_0x27503f,null))['catch'](handleError(_0x27503f,null));};exports[_0x8b45('0x4b')]=function(_0x2f7ab0,_0x19152b){return respondWithRpcPromise(_0x8b45('0x4c'),_0x2f7ab0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x19152b,null))['catch'](handleError(_0x19152b,null));};exports['showOpenchannelQueues']=function(_0x5ace1,_0x2224b7){return respondWithRpcPromise('OpenchannelQueues',_0x5ace1[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x5ace1[_0x8b45('0x1d')]['id']))['then'](respondWithResult(_0x2224b7,null))['catch'](handleError(_0x2224b7,null));};exports[_0x8b45('0x4d')]=function(_0x8e5a41,_0x5abc79){return respondWithRpcPromise(_0x8b45('0x4e'),_0x8e5a41['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x5abc79,null))['catch'](handleError(_0x5abc79,null));};exports['showSmsQueues']=function(_0x28e57a,_0x7f5a4e){return respondWithRpcPromise('SmsQueues',_0x28e57a[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x28e57a[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x7f5a4e,null))[_0x8b45('0xc')](handleError(_0x7f5a4e,null));};exports['whatsappQueues']=function(_0x37f580,_0x3b3d21){return respondWithRpcPromise(_0x8b45('0x4f'),_0x37f580['query'],routingClient)['then'](respondWithResult(_0x3b3d21,null))[_0x8b45('0xc')](handleError(_0x3b3d21,null));};exports['showWhatsappQueues']=function(_0x43f031,_0x5a4834){return respondWithRpcPromise('WhatsappQueues',_0x43f031['query'],routingClient)[_0x8b45('0x9')](findById(_0x43f031['params']['id']))[_0x8b45('0x9')](respondWithResult(_0x5a4834,null))[_0x8b45('0xc')](handleError(_0x5a4834,null));};exports['faxQueues']=function(_0x3db84e,_0x1b3890){return respondWithRpcPromise('FaxQueues',_0x3db84e[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1b3890,null))[_0x8b45('0xc')](handleError(_0x1b3890,null));};exports[_0x8b45('0x50')]=function(_0x15cf9d,_0x877766){return respondWithRpcPromise(_0x8b45('0x51'),_0x15cf9d[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](findById(_0x15cf9d[_0x8b45('0x1d')]['id']))[_0x8b45('0x9')](respondWithResult(_0x877766,null))[_0x8b45('0xc')](handleError(_0x877766,null));};exports['faxAccounts']=function(_0x225180,_0x403ee2){return respondWithRpcPromise(_0x8b45('0x52'),_0x225180[_0x8b45('0x1b')])[_0x8b45('0x9')](respondWithResult(_0x403ee2,null))[_0x8b45('0xc')](handleError(_0x403ee2,null));};exports[_0x8b45('0x53')]=function(_0x3d3216,_0x243632){return respondWithRpcPromise(_0x8b45('0x54'),_0x3d3216[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x243632,null))[_0x8b45('0xc')](handleError(_0x243632,null));};exports[_0x8b45('0x55')]=function(_0x562c5f,_0x53143d){return respondWithRpcPromise(_0x8b45('0x56'),_0x562c5f[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x53143d,null))[_0x8b45('0xc')](handleError(_0x53143d,null));};exports[_0x8b45('0x57')]=function(_0xd88538,_0x1ebbca){return respondWithRpcPromise(_0x8b45('0x58'),_0xd88538['query'],routingClient)[_0x8b45('0x9')](respondWithResult(_0x1ebbca,null))[_0x8b45('0xc')](handleError(_0x1ebbca,null));};exports[_0x8b45('0x59')]=function(_0xa22bd0,_0xa44ba5){return respondWithRpcPromise(_0x8b45('0x58'),_0xa22bd0[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](function(_0x2a6fee){if(_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')]!==undefined){var _0x5e54c6=_(_0x2a6fee['rows'])[_0x8b45('0x5b')]([_0xa22bd0[_0x8b45('0x1b')][_0x8b45('0x5a')],_0xa22bd0[_0x8b45('0x1d')]['id']])[_0x8b45('0x5c')](_0x8b45('0x5d'))[_0x8b45('0x5e')]()[_0x8b45('0x5f')]();return _0x2a6fee[_0x8b45('0x14')]['filter'](function(_0x55acf0){return _0x5e54c6[_0x8b45('0x60')](_0x55acf0[_0x8b45('0x5d')])>-0x1;});}else{return _0x2a6fee[_0x8b45('0x14')][_0x8b45('0x5b')](function(_0x55bafb){return _0x55bafb[_0x8b45('0x5d')]===parseInt(_0xa22bd0[_0x8b45('0x1d')]['id']);});}})[_0x8b45('0x9')](respondWithResult(_0xa44ba5,null))[_0x8b45('0xc')](handleError(_0xa44ba5,null));};exports[_0x8b45('0x61')]=function(_0x17588b,_0x4ed113){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x17588b[_0x8b45('0x1b')],routingClient)['then'](respondWithResult(_0x4ed113,null))['catch'](handleError(_0x4ed113,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xf602c7,_0x170b95){return respondWithRpcPromise(_0x8b45('0x62'),_0xf602c7[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0x170b95,null))[_0x8b45('0xc')](handleError(_0x170b95,null));};exports[_0x8b45('0x63')]=function(_0xc9be77,_0xc89fc6){return respondWithRpcPromise(_0x8b45('0x64'),_0xc9be77[_0x8b45('0x1b')],routingClient)[_0x8b45('0x9')](respondWithResult(_0xc89fc6,null))[_0x8b45('0xc')](handleError(_0xc89fc6,null));};exports[_0x8b45('0x65')]=function(_0x42b192){return function(_0x4a42e1,_0x29bfcc){var _0x91270d,_0x217798;var _0x19a135=_[_0x8b45('0x66')](_0x42b192);var _0x1446b1=_0x42b192===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x19a135+_0x8b45('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x4a42e1[_0x8b45('0x1d')]['id']}})[_0x8b45('0x9')](function(_0x408fff){if(_[_0x8b45('0x13')](_0x408fff)){throw new Error(_0x19a135+'\x20Queue\x20not\x20found');}_0x91270d=_0x408fff;return db[_0x19a135+_0x8b45('0x6b')]['findOne']({'where':{'id':_0x4a42e1[_0x8b45('0x22')]['messageId']},'include':[{'model':db[_0x19a135+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x19a135+_0x1446b1],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x16bb83){if(_[_0x8b45('0x13')](_0x16bb83)){throw new Error(_0x19a135+'\x20Message\x20not\x20found');}_0x217798=_0x16bb83;return _0x16bb83[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x17364d={'uniqueid':_0x42b192+'.'+_0x217798['id']+'.'+_0x217798[_0x8b45('0x6c')]['id'],'FromUserId':_0x4a42e1['user']['id'],'type':_0x8b45('0x6e')};_0x17364d[_0x19a135+_0x8b45('0x6f')]=_0x217798['id'];_0x17364d[_0x19a135+'InteractionId']=_0x217798['Interaction']['id'];_0x17364d[_0x8b45('0x70')+_0x19a135+_0x1446b1+'Id']=_0x217798[_0x8b45('0x69')]['id'];_0x17364d['To'+_0x19a135+_0x8b45('0x71')]=_0x91270d['id'];return db[_0x19a135+'TransferReport'][_0x8b45('0x72')](_0x17364d);})['then'](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x42b192,'interaction':_0x217798[_0x8b45('0x6c')],'message':_0x217798,'account':_0x217798['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x91270d[_0x8b45('0x11')]+','+(_0x217798[_0x8b45('0x69')][_0x8b45('0x74')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})['then'](respondWithResult(_0x29bfcc,null))[_0x8b45('0xc')](handleError(_0x29bfcc,null));};};exports[_0x8b45('0x76')]=function(_0x376416,_0x1d475c){var _0x2680d5,_0x1abe69;if(_['isNil'](_0x376416[_0x8b45('0x22')][_0x8b45('0x77')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x10a91a=_0x376416[_0x8b45('0x22')]['channel'];var _0x4837af=_['capitalize'](_0x10a91a);var _0x186aa2=_0x10a91a===_0x8b45('0x67')?_0x8b45('0x68'):_0x8b45('0x69');return db[_0x8b45('0x78')][_0x8b45('0x79')]({'raw':!![],'where':{'id':_0x376416[_0x8b45('0x1d')]['id'],'role':'agent'}})[_0x8b45('0x9')](function(_0x3d321f){if(_[_0x8b45('0x13')](_0x3d321f)){throw new Error(_0x8b45('0x7a'));}_0x2680d5=_0x3d321f;return db[_0x4837af+_0x8b45('0x6b')][_0x8b45('0x79')]({'where':{'id':_0x376416['body'][_0x8b45('0x7b')]},'include':[{'model':db[_0x4837af+_0x8b45('0x6c')],'as':_0x8b45('0x6c')},{'model':db[_0x4837af+_0x186aa2],'as':_0x8b45('0x69')}]});})[_0x8b45('0x9')](function(_0x4c3bc9){if(_['isNil'](_0x4c3bc9)){throw new Error(_0x4837af+_0x8b45('0x7c'));}_0x1abe69=_0x4c3bc9;return _0x4c3bc9[_0x8b45('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8b45('0x9')](function(){var _0x9993ce={'uniqueid':_0x10a91a+'.'+_0x1abe69['id']+'.'+_0x1abe69[_0x8b45('0x6c')]['id'],'FromUserId':_0x376416['user']['id'],'type':_0x8b45('0x6e'),'ToUserId':_0x2680d5['id']};_0x9993ce[_0x4837af+'MessageId']=_0x1abe69['id'];_0x9993ce[_0x4837af+_0x8b45('0x7d')]=_0x1abe69['Interaction']['id'];_0x9993ce[_0x8b45('0x70')+_0x4837af+_0x186aa2+'Id']=_0x1abe69[_0x8b45('0x69')]['id'];return db[_0x4837af+_0x8b45('0x7e')][_0x8b45('0x72')](_0x9993ce);})[_0x8b45('0x9')](function(){return respondWithRpcPromise(_0x8b45('0x73'),{'channel':_0x10a91a,'interaction':_0x1abe69[_0x8b45('0x6c')],'message':_0x1abe69,'account':_0x1abe69[_0x8b45('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8b45('0x3d'),'appdata':_0x2680d5[_0x8b45('0x11')]+','+(_0x1abe69[_0x8b45('0x69')][_0x8b45('0x7f')]||0x12c),'interval':_0x8b45('0x75')}]},routingClient);})[_0x8b45('0x9')](respondWithResult(_0x1d475c,null))['catch'](handleError(_0x1d475c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 64733f5..53ea261 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 _0xc403=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','/:id','show','get','run','create','put','update','delete','destroy','multer','path'];(function(_0x13d016,_0x41169b){var _0x551212=function(_0x39e6ef){while(--_0x39e6ef){_0x13d016['push'](_0x13d016['shift']());}};_0x551212(++_0x41169b);}(_0xc403,0x163));var _0x3c40=function(_0x1e447d,_0x492bc9){_0x1e447d=_0x1e447d-0x0;var _0x2ab894=_0xc403[_0x1e447d];return _0x2ab894;};'use strict';var multer=require(_0x3c40('0x0'));var util=require('util');var path=require(_0x3c40('0x1'));var timeout=require(_0x3c40('0x2'));var express=require(_0x3c40('0x3'));var router=express[_0x3c40('0x4')]();var fs_extra=require(_0x3c40('0x5'));var auth=require(_0x3c40('0x6'));var interaction=require(_0x3c40('0x7'));var config=require(_0x3c40('0x8'));var controller=require(_0x3c40('0x9'));router['get']('/',auth[_0x3c40('0xa')](),controller[_0x3c40('0xb')]);router['get'](_0x3c40('0xc'),auth[_0x3c40('0xa')](),controller[_0x3c40('0xd')]);router[_0x3c40('0xe')]('/:id/run',auth[_0x3c40('0xa')](),controller[_0x3c40('0xf')]);router['post']('/',auth[_0x3c40('0xa')](),controller[_0x3c40('0x10')]);router[_0x3c40('0x11')](_0x3c40('0xc'),auth[_0x3c40('0xa')](),controller[_0x3c40('0x12')]);router[_0x3c40('0x13')](_0x3c40('0xc'),auth['isAuthenticated'](),controller[_0x3c40('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb678=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run'];(function(_0x5b4ffb,_0x522ee3){var _0x10a89e=function(_0x216797){while(--_0x216797){_0x5b4ffb['push'](_0x5b4ffb['shift']());}};_0x10a89e(++_0x522ee3);}(_0xb678,0x1d4));var _0x8b67=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xb678[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0x8b67('0x0'));var util=require(_0x8b67('0x1'));var path=require(_0x8b67('0x2'));var timeout=require(_0x8b67('0x3'));var express=require(_0x8b67('0x4'));var router=express[_0x8b67('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8b67('0x6'));var interaction=require(_0x8b67('0x7'));var config=require(_0x8b67('0x8'));var controller=require(_0x8b67('0x9'));router[_0x8b67('0xa')]('/',auth[_0x8b67('0xb')](),controller[_0x8b67('0xc')]);router['get'](_0x8b67('0xd'),auth['isAuthenticated'](),controller[_0x8b67('0xe')]);router[_0x8b67('0xa')](_0x8b67('0xf'),auth[_0x8b67('0xb')](),controller['run']);router[_0x8b67('0x10')]('/',auth[_0x8b67('0xb')](),controller[_0x8b67('0x11')]);router[_0x8b67('0x12')](_0x8b67('0xd'),auth[_0x8b67('0xb')](),controller[_0x8b67('0x13')]);router[_0x8b67('0x14')](_0x8b67('0xd'),auth[_0x8b67('0xb')](),controller[_0x8b67('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 5243eb4..fa07839 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 _0x7358=['quarters','weeks','days','minutes','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','ENUM','years'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x7358,0x79));var _0x8735=function(_0x2420c3,_0x1e54c6){_0x2420c3=_0x2420c3-0x0;var _0x482a2b=_0x7358[_0x2420c3];return _0x482a2b;};'use strict';var Sequelize=require(_0x8735('0x0'));module[_0x8735('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8735('0x2')]},'active':{'type':Sequelize[_0x8735('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8735('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8735('0x5')](_0x8735('0x6'),_0x8735('0x7'),'months',_0x8735('0x8'),_0x8735('0x9'),'hours',_0x8735('0xa')),'allowNull':![],'defaultValue':_0x8735('0x9')},'output':{'type':Sequelize['ENUM'](_0x8735('0xb'),'pdf',_0x8735('0xc')),'allowNull':![],'defaultValue':_0x8735('0xb')},'type':{'type':Sequelize[_0x8735('0x5')](_0x8735('0xd'),_0x8735('0xe')),'allowNull':![],'defaultValue':_0x8735('0xd')},'sendMail':{'type':Sequelize[_0x8735('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8735('0xf')]},'bcc':{'type':Sequelize[_0x8735('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x8735('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9b87=['sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','days','hours','minutes','csv','pdf','default','custom','BOOLEAN','TEXT'];(function(_0x11422a,_0x2190e4){var _0x1bd403=function(_0x1ca5e5){while(--_0x1ca5e5){_0x11422a['push'](_0x11422a['shift']());}};_0x1bd403(++_0x2190e4);}(_0x9b87,0xff));var _0x79b8=function(_0x56d295,_0x1ac769){_0x56d295=_0x56d295-0x0;var _0x5792f9=_0x9b87[_0x56d295];return _0x5792f9;};'use strict';var Sequelize=require(_0x79b8('0x0'));module['exports']={'name':{'type':Sequelize[_0x79b8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x79b8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x79b8('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x79b8('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x79b8('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x79b8('0x5')](_0x79b8('0x6'),_0x79b8('0x7'),'months','weeks',_0x79b8('0x8'),_0x79b8('0x9'),_0x79b8('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x79b8('0xb'),_0x79b8('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x79b8('0xb')},'type':{'type':Sequelize['ENUM']('custom',_0x79b8('0xd')),'allowNull':![],'defaultValue':_0x79b8('0xe')},'sendMail':{'type':Sequelize[_0x79b8('0xf')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x79b8('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x79b8('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index fed65e8..e8c0b14 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 _0x629e=['undefined','limit','count','set','apply','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','attributes','fields','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','run','eml-format','rimraf','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2a0863,_0x49d3f9){var _0x43a2cd=function(_0x2e8f74){while(--_0x2e8f74){_0x2a0863['push'](_0x2a0863['shift']());}};_0x43a2cd(++_0x49d3f9);}(_0x629e,0x11e));var _0xe629=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x629e[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xe629('0x0'));var rimraf=require(_0xe629('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe629('0x2'));var sox=require(_0xe629('0x3'));var csv=require(_0xe629('0x4'));var ejs=require(_0xe629('0x5'));var fs=require('fs');var fs_extra=require(_0xe629('0x6'));var _=require('lodash');var squel=require(_0xe629('0x7'));var crypto=require(_0xe629('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xe629('0x9'));var toCsv=require(_0xe629('0x4'));var querystring=require('querystring');var Papa=require(_0xe629('0xa'));var Redis=require('ioredis');var authService=require(_0xe629('0xb'));var qs=require(_0xe629('0xc'));var as=require(_0xe629('0xd'));var hardwareService=require(_0xe629('0xe'));var logger=require(_0xe629('0xf'))(_0xe629('0x10'));var utils=require(_0xe629('0x11'));var config=require(_0xe629('0x12'));var licenseUtil=require(_0xe629('0x13'));var db=require(_0xe629('0x14'))['db'];function respondWithStatusCode(_0x30e556,_0x13765d){_0x13765d=_0x13765d||0xcc;return function(_0x219088){if(_0x219088){return _0x30e556[_0xe629('0x15')](_0x13765d);}return _0x30e556[_0xe629('0x16')](_0x13765d)[_0xe629('0x17')]();};}function respondWithResult(_0x3ea0f9,_0x224a26){_0x224a26=_0x224a26||0xc8;return function(_0x140954){if(_0x140954){return _0x3ea0f9[_0xe629('0x16')](_0x224a26)[_0xe629('0x18')](_0x140954);}};}function respondWithFilteredResult(_0x10b0c8,_0x31ad93){return function(_0x15565b){if(_0x15565b){var _0x1b41c9=typeof _0x31ad93[_0xe629('0x19')]===_0xe629('0x1a')&&typeof _0x31ad93[_0xe629('0x1b')]===_0xe629('0x1a');var _0x37eedf=_0x15565b['count'];var _0x1e6a25=_0x1b41c9?0x0:_0x31ad93['offset'];var _0x52ba01=_0x1b41c9?_0x15565b[_0xe629('0x1c')]:_0x31ad93[_0xe629('0x19')]+_0x31ad93[_0xe629('0x1b')];var _0x127183;if(_0x52ba01>=_0x37eedf){_0x52ba01=_0x37eedf;_0x127183=0xc8;}else{_0x127183=0xce;}_0x10b0c8[_0xe629('0x16')](_0x127183);return _0x10b0c8[_0xe629('0x1d')]('Content-Range',_0x1e6a25+'-'+_0x52ba01+'/'+_0x37eedf)[_0xe629('0x18')](_0x15565b);}return null;};}function patchUpdates(_0x394bd9){return function(_0x537d46){try{jsonpatch[_0xe629('0x1e')](_0x537d46,_0x394bd9,!![]);}catch(_0x364506){return BPromise[_0xe629('0x1f')](_0x364506);}return _0x537d46['save']();};}function saveUpdates(_0x54217e,_0x4b7b65){return function(_0x788f0a){if(_0x788f0a){return _0x788f0a[_0xe629('0x20')](_0x54217e)[_0xe629('0x21')](function(_0x3c3b20){return _0x3c3b20;});}return null;};}function removeEntity(_0x8ea7c5,_0x103527){return function(_0x34815c){if(_0x34815c){return _0x34815c[_0xe629('0x22')]()[_0xe629('0x21')](function(){var _0x340c4b=_0x34815c[_0xe629('0x23')]({'plain':!![]});var _0x427ba0=_0xe629('0x24');return db[_0xe629('0x25')]['destroy']({'where':{'type':_0x427ba0,'resourceId':_0x340c4b['id']}})[_0xe629('0x21')](function(){return _0x34815c;});})['then'](function(){_0x8ea7c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12dbab,_0x40ea25){return function(_0x3272b7){if(!_0x3272b7){_0x12dbab[_0xe629('0x15')](0x194);}return _0x3272b7;};}function handleError(_0x1acb88,_0x36a506){_0x36a506=_0x36a506||0x1f4;return function(_0x23287c){logger[_0xe629('0x26')](_0x23287c[_0xe629('0x27')]);if(_0x23287c[_0xe629('0x28')]){delete _0x23287c[_0xe629('0x28')];}_0x1acb88[_0xe629('0x16')](_0x36a506)[_0xe629('0x29')](_0x23287c);};}exports['index']=function(_0x2e78c4,_0xeb4039){var _0x5b318c={},_0x5135b2={},_0x439e6e={'count':0x0,'rows':[]};var _0xaad0e5=_[_0xe629('0x2a')](db[_0xe629('0x2b')][_0xe629('0x2c')],function(_0x1266d5){return{'name':_0x1266d5[_0xe629('0x2d')],'type':_0x1266d5[_0xe629('0x2e')]['key']};});_0x5135b2[_0xe629('0x2f')]=_[_0xe629('0x2a')](_0xaad0e5,'name');_0x5135b2[_0xe629('0x30')]=_[_0xe629('0x31')](_0x2e78c4[_0xe629('0x30')]);_0x5135b2[_0xe629('0x32')]=_['intersection'](_0x5135b2['model'],_0x5135b2[_0xe629('0x30')]);_0x5b318c['attributes']=_[_0xe629('0x33')](_0x5135b2[_0xe629('0x2f')],qs['fields'](_0x2e78c4[_0xe629('0x30')]['fields']));_0x5b318c['attributes']=_0x5b318c['attributes'][_0xe629('0x34')]?_0x5b318c['attributes']:_0x5135b2[_0xe629('0x2f')];if(!_0x2e78c4[_0xe629('0x30')][_0xe629('0x35')](_0xe629('0x36'))){_0x5b318c[_0xe629('0x1b')]=qs['limit'](_0x2e78c4['query'][_0xe629('0x1b')]);_0x5b318c[_0xe629('0x19')]=qs[_0xe629('0x19')](_0x2e78c4[_0xe629('0x30')]['offset']);}_0x5b318c['order']=qs[_0xe629('0x37')](_0x2e78c4[_0xe629('0x30')][_0xe629('0x37')]);_0x5b318c[_0xe629('0x38')]=qs[_0xe629('0x32')](_[_0xe629('0x39')](_0x2e78c4['query'],_0x5135b2[_0xe629('0x32')]),_0xaad0e5);if(_0x2e78c4[_0xe629('0x30')][_0xe629('0x3a')]){_0x5b318c[_0xe629('0x38')]=_['merge'](_0x5b318c[_0xe629('0x38')],{'$or':_[_0xe629('0x2a')](_0xaad0e5,function(_0x5bdd35){if(_0x5bdd35['type']!==_0xe629('0x3b')){var _0x2142bc={};_0x2142bc[_0x5bdd35[_0xe629('0x28')]]={'$like':'%'+_0x2e78c4[_0xe629('0x30')][_0xe629('0x3a')]+'%'};return _0x2142bc;}})});}_0x5b318c=_[_0xe629('0x3c')]({},_0x5b318c,_0x2e78c4[_0xe629('0x3d')]);var _0x223c6d={'where':_0x5b318c[_0xe629('0x38')]};return db[_0xe629('0x2b')][_0xe629('0x1c')](_0x223c6d)[_0xe629('0x21')](function(_0x541f64){_0x439e6e[_0xe629('0x1c')]=_0x541f64;if(_0x2e78c4[_0xe629('0x30')][_0xe629('0x3e')]){_0x5b318c[_0xe629('0x3f')]=[{'all':!![]}];}return db[_0xe629('0x2b')][_0xe629('0x40')](_0x5b318c);})[_0xe629('0x21')](function(_0x46c788){_0x439e6e['rows']=_0x46c788;return _0x439e6e;})[_0xe629('0x21')](respondWithFilteredResult(_0xeb4039,_0x5b318c))[_0xe629('0x41')](handleError(_0xeb4039,null));};exports[_0xe629('0x42')]=function(_0x47037a,_0x99bc78){var _0x27f832={'raw':![],'where':{'id':_0x47037a[_0xe629('0x43')]['id']}},_0x1d0a67={};_0x1d0a67[_0xe629('0x2f')]=_[_0xe629('0x31')](db[_0xe629('0x2b')][_0xe629('0x2c')]);_0x1d0a67[_0xe629('0x30')]=_[_0xe629('0x31')](_0x47037a[_0xe629('0x30')]);_0x1d0a67[_0xe629('0x32')]=_[_0xe629('0x33')](_0x1d0a67[_0xe629('0x2f')],_0x1d0a67[_0xe629('0x30')]);_0x27f832[_0xe629('0x44')]=_['intersection'](_0x1d0a67[_0xe629('0x2f')],qs[_0xe629('0x45')](_0x47037a['query'][_0xe629('0x45')]));_0x27f832[_0xe629('0x44')]=_0x27f832[_0xe629('0x44')][_0xe629('0x34')]?_0x27f832[_0xe629('0x44')]:_0x1d0a67['model'];if(_0x47037a['query']['includeAll']){_0x27f832[_0xe629('0x3f')]=[{'all':!![]}];}_0x27f832=_['merge']({},_0x27f832,_0x47037a[_0xe629('0x3d')]);return db[_0xe629('0x2b')][_0xe629('0x46')](_0x27f832)[_0xe629('0x21')](handleEntityNotFound(_0x99bc78,null))[_0xe629('0x21')](respondWithResult(_0x99bc78,null))['catch'](handleError(_0x99bc78,null));};exports['create']=function(_0x1407c5,_0x4748d2){return db[_0xe629('0x2b')]['create'](_0x1407c5[_0xe629('0x47')],{})[_0xe629('0x21')](function(_0x249b00){var _0x1f6c95=_0x1407c5[_0xe629('0x48')][_0xe629('0x23')]({'plain':!![]});if(!_0x1f6c95)throw new Error(_0xe629('0x49'));if(_0x1f6c95[_0xe629('0x4a')]===_0xe629('0x48')){var _0x59fe1d=_0x249b00[_0xe629('0x23')]({'plain':!![]});var _0x5bca75=_0xe629('0x24');return db['UserProfileSection'][_0xe629('0x46')]({'where':{'name':_0x5bca75,'userProfileId':_0x1f6c95['userProfileId']},'raw':!![]})[_0xe629('0x21')](function(_0x53d8fa){if(_0x53d8fa&&_0x53d8fa[_0xe629('0x4b')]===0x0){return db['UserProfileResource'][_0xe629('0x4c')]({'name':_0x59fe1d[_0xe629('0x28')],'resourceId':_0x59fe1d['id'],'type':_0x53d8fa[_0xe629('0x28')],'sectionId':_0x53d8fa['id']},{})['then'](function(){return _0x249b00;});}else{return _0x249b00;}})[_0xe629('0x41')](function(_0x5a68a2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a68a2);throw _0x5a68a2;});}return _0x249b00;})[_0xe629('0x21')](respondWithResult(_0x4748d2,0xc9))[_0xe629('0x41')](handleError(_0x4748d2,null));};exports[_0xe629('0x20')]=function(_0x10650a,_0x348507){if(_0x10650a[_0xe629('0x47')]['id']){delete _0x10650a['body']['id'];}return db[_0xe629('0x2b')]['find']({'where':{'id':_0x10650a['params']['id']}})[_0xe629('0x21')](handleEntityNotFound(_0x348507,null))[_0xe629('0x21')](saveUpdates(_0x10650a['body'],null))['then'](respondWithResult(_0x348507,null))[_0xe629('0x41')](handleError(_0x348507,null));};exports[_0xe629('0x22')]=function(_0x3e1581,_0x3efa45){return db['Schedule']['find']({'where':{'id':_0x3e1581[_0xe629('0x43')]['id']}})[_0xe629('0x21')](handleEntityNotFound(_0x3efa45,null))[_0xe629('0x21')](removeEntity(_0x3efa45,null))[_0xe629('0x41')](handleError(_0x3efa45,null));};exports[_0xe629('0x4d')]=function(_0x3f3075,_0x4cf6ae,_0x4a84ac){var _0x165b8d=require('../../config/schedule');return db[_0xe629('0x2b')][_0xe629('0x46')]({'where':{'id':_0x3f3075[_0xe629('0x43')]['id']},'raw':!![]})[_0xe629('0x21')](handleEntityNotFound(_0x4cf6ae,null))[_0xe629('0x21')](function(){_0x165b8d[_0xe629('0x4d')](_0x3f3075[_0xe629('0x43')]['id']);})['then'](respondWithStatusCode(_0x4cf6ae,null))['catch'](handleError(_0x4cf6ae,null));}; \ No newline at end of file +var _0x2b3d=['attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Schedule','includeAll','include','rows','catch','show','keys','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','name','send','index','map','fieldName','type','model','query'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2b3d,0x11b));var _0xd2b3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2b3d[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xd2b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2b3('0x1'));var jsonpatch=require(_0xd2b3('0x2'));var rp=require('request-promise');var moment=require(_0xd2b3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2b3('0x4'));var path=require(_0xd2b3('0x5'));var sox=require(_0xd2b3('0x6'));var csv=require(_0xd2b3('0x7'));var ejs=require(_0xd2b3('0x8'));var fs=require('fs');var fs_extra=require(_0xd2b3('0x9'));var _=require('lodash');var squel=require(_0xd2b3('0xa'));var crypto=require(_0xd2b3('0xb'));var jsforce=require(_0xd2b3('0xc'));var deskjs=require(_0xd2b3('0xd'));var toCsv=require(_0xd2b3('0x7'));var querystring=require(_0xd2b3('0xe'));var Papa=require(_0xd2b3('0xf'));var Redis=require('ioredis');var authService=require(_0xd2b3('0x10'));var qs=require(_0xd2b3('0x11'));var as=require(_0xd2b3('0x12'));var hardwareService=require(_0xd2b3('0x13'));var logger=require(_0xd2b3('0x14'))(_0xd2b3('0x15'));var utils=require('../../config/utils');var config=require(_0xd2b3('0x16'));var licenseUtil=require(_0xd2b3('0x17'));var db=require(_0xd2b3('0x18'))['db'];function respondWithStatusCode(_0x3dbd42,_0x1c2d39){_0x1c2d39=_0x1c2d39||0xcc;return function(_0x101093){if(_0x101093){return _0x3dbd42[_0xd2b3('0x19')](_0x1c2d39);}return _0x3dbd42[_0xd2b3('0x1a')](_0x1c2d39)[_0xd2b3('0x1b')]();};}function respondWithResult(_0x39dfac,_0x1a29d7){_0x1a29d7=_0x1a29d7||0xc8;return function(_0x43c8c6){if(_0x43c8c6){return _0x39dfac[_0xd2b3('0x1a')](_0x1a29d7)[_0xd2b3('0x1c')](_0x43c8c6);}};}function respondWithFilteredResult(_0x18ad23,_0xb97d49){return function(_0x42ab8d){if(_0x42ab8d){var _0x1175bd=typeof _0xb97d49['offset']==='undefined'&&typeof _0xb97d49[_0xd2b3('0x1d')]===_0xd2b3('0x1e');var _0x4f1923=_0x42ab8d[_0xd2b3('0x1f')];var _0x250e46=_0x1175bd?0x0:_0xb97d49['offset'];var _0x16f1d5=_0x1175bd?_0x42ab8d[_0xd2b3('0x1f')]:_0xb97d49[_0xd2b3('0x20')]+_0xb97d49[_0xd2b3('0x1d')];var _0x3c2a2c;if(_0x16f1d5>=_0x4f1923){_0x16f1d5=_0x4f1923;_0x3c2a2c=0xc8;}else{_0x3c2a2c=0xce;}_0x18ad23[_0xd2b3('0x1a')](_0x3c2a2c);return _0x18ad23[_0xd2b3('0x21')](_0xd2b3('0x22'),_0x250e46+'-'+_0x16f1d5+'/'+_0x4f1923)[_0xd2b3('0x1c')](_0x42ab8d);}return null;};}function patchUpdates(_0x89fa3d){return function(_0x2424ee){try{jsonpatch[_0xd2b3('0x23')](_0x2424ee,_0x89fa3d,!![]);}catch(_0x8eb875){return BPromise[_0xd2b3('0x24')](_0x8eb875);}return _0x2424ee[_0xd2b3('0x25')]();};}function saveUpdates(_0x386304,_0xf2b72){return function(_0x12afe2){if(_0x12afe2){return _0x12afe2[_0xd2b3('0x26')](_0x386304)[_0xd2b3('0x27')](function(_0x5167da){return _0x5167da;});}return null;};}function removeEntity(_0x1a5fd3,_0x5bdb17){return function(_0x2bc853){if(_0x2bc853){return _0x2bc853[_0xd2b3('0x28')]()['then'](function(){var _0x4ca4a0=_0x2bc853[_0xd2b3('0x29')]({'plain':!![]});var _0x1097a4=_0xd2b3('0x2a');return db[_0xd2b3('0x2b')][_0xd2b3('0x28')]({'where':{'type':_0x1097a4,'resourceId':_0x4ca4a0['id']}})['then'](function(){return _0x2bc853;});})[_0xd2b3('0x27')](function(){_0x1a5fd3[_0xd2b3('0x1a')](0xcc)[_0xd2b3('0x1b')]();});}};}function handleEntityNotFound(_0x349889,_0x21f5ce){return function(_0x5865b2){if(!_0x5865b2){_0x349889[_0xd2b3('0x19')](0x194);}return _0x5865b2;};}function handleError(_0x593108,_0x39501d){_0x39501d=_0x39501d||0x1f4;return function(_0x590c7e){logger[_0xd2b3('0x2c')](_0x590c7e['stack']);if(_0x590c7e[_0xd2b3('0x2d')]){delete _0x590c7e['name'];}_0x593108[_0xd2b3('0x1a')](_0x39501d)[_0xd2b3('0x2e')](_0x590c7e);};}exports[_0xd2b3('0x2f')]=function(_0x40a344,_0x57b830){var _0xee97ce={},_0x12f0a5={},_0x78229a={'count':0x0,'rows':[]};var _0x2490f0=_[_0xd2b3('0x30')](db['Schedule']['rawAttributes'],function(_0x4e9d8b){return{'name':_0x4e9d8b[_0xd2b3('0x31')],'type':_0x4e9d8b[_0xd2b3('0x32')]['key']};});_0x12f0a5[_0xd2b3('0x33')]=_[_0xd2b3('0x30')](_0x2490f0,_0xd2b3('0x2d'));_0x12f0a5['query']=_['keys'](_0x40a344[_0xd2b3('0x34')]);_0x12f0a5['filters']=_['intersection'](_0x12f0a5[_0xd2b3('0x33')],_0x12f0a5['query']);_0xee97ce[_0xd2b3('0x35')]=_[_0xd2b3('0x36')](_0x12f0a5['model'],qs[_0xd2b3('0x37')](_0x40a344[_0xd2b3('0x34')]['fields']));_0xee97ce[_0xd2b3('0x35')]=_0xee97ce[_0xd2b3('0x35')][_0xd2b3('0x38')]?_0xee97ce[_0xd2b3('0x35')]:_0x12f0a5[_0xd2b3('0x33')];if(!_0x40a344['query']['hasOwnProperty'](_0xd2b3('0x39'))){_0xee97ce['limit']=qs['limit'](_0x40a344[_0xd2b3('0x34')]['limit']);_0xee97ce[_0xd2b3('0x20')]=qs['offset'](_0x40a344[_0xd2b3('0x34')]['offset']);}_0xee97ce[_0xd2b3('0x3a')]=qs[_0xd2b3('0x3b')](_0x40a344[_0xd2b3('0x34')][_0xd2b3('0x3b')]);_0xee97ce[_0xd2b3('0x3c')]=qs[_0xd2b3('0x3d')](_['pick'](_0x40a344[_0xd2b3('0x34')],_0x12f0a5[_0xd2b3('0x3d')]),_0x2490f0);if(_0x40a344[_0xd2b3('0x34')][_0xd2b3('0x3e')]){_0xee97ce['where']=_[_0xd2b3('0x3f')](_0xee97ce[_0xd2b3('0x3c')],{'$or':_['map'](_0x2490f0,function(_0x998404){if(_0x998404[_0xd2b3('0x32')]!==_0xd2b3('0x40')){var _0x34ea31={};_0x34ea31[_0x998404[_0xd2b3('0x2d')]]={'$like':'%'+_0x40a344[_0xd2b3('0x34')][_0xd2b3('0x3e')]+'%'};return _0x34ea31;}})});}_0xee97ce=_[_0xd2b3('0x3f')]({},_0xee97ce,_0x40a344[_0xd2b3('0x41')]);var _0x4aab90={'where':_0xee97ce[_0xd2b3('0x3c')]};return db[_0xd2b3('0x42')][_0xd2b3('0x1f')](_0x4aab90)['then'](function(_0x20507b){_0x78229a[_0xd2b3('0x1f')]=_0x20507b;if(_0x40a344[_0xd2b3('0x34')][_0xd2b3('0x43')]){_0xee97ce[_0xd2b3('0x44')]=[{'all':!![]}];}return db[_0xd2b3('0x42')]['findAll'](_0xee97ce);})[_0xd2b3('0x27')](function(_0xcdae9a){_0x78229a[_0xd2b3('0x45')]=_0xcdae9a;return _0x78229a;})['then'](respondWithFilteredResult(_0x57b830,_0xee97ce))[_0xd2b3('0x46')](handleError(_0x57b830,null));};exports[_0xd2b3('0x47')]=function(_0x132a8c,_0x1c6266){var _0x695e9f={'raw':![],'where':{'id':_0x132a8c['params']['id']}},_0x3a8c49={};_0x3a8c49[_0xd2b3('0x33')]=_[_0xd2b3('0x48')](db[_0xd2b3('0x42')]['rawAttributes']);_0x3a8c49['query']=_[_0xd2b3('0x48')](_0x132a8c['query']);_0x3a8c49[_0xd2b3('0x3d')]=_[_0xd2b3('0x36')](_0x3a8c49['model'],_0x3a8c49[_0xd2b3('0x34')]);_0x695e9f[_0xd2b3('0x35')]=_[_0xd2b3('0x36')](_0x3a8c49[_0xd2b3('0x33')],qs[_0xd2b3('0x37')](_0x132a8c[_0xd2b3('0x34')][_0xd2b3('0x37')]));_0x695e9f[_0xd2b3('0x35')]=_0x695e9f[_0xd2b3('0x35')]['length']?_0x695e9f[_0xd2b3('0x35')]:_0x3a8c49['model'];if(_0x132a8c[_0xd2b3('0x34')][_0xd2b3('0x43')]){_0x695e9f['include']=[{'all':!![]}];}_0x695e9f=_[_0xd2b3('0x3f')]({},_0x695e9f,_0x132a8c[_0xd2b3('0x41')]);return db[_0xd2b3('0x42')]['find'](_0x695e9f)[_0xd2b3('0x27')](handleEntityNotFound(_0x1c6266,null))[_0xd2b3('0x27')](respondWithResult(_0x1c6266,null))[_0xd2b3('0x46')](handleError(_0x1c6266,null));};exports['create']=function(_0x7e5888,_0x2411ba){return db[_0xd2b3('0x42')][_0xd2b3('0x49')](_0x7e5888[_0xd2b3('0x4a')],{})[_0xd2b3('0x27')](function(_0x2711b6){var _0x271f13=_0x7e5888[_0xd2b3('0x4b')][_0xd2b3('0x29')]({'plain':!![]});if(!_0x271f13)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x271f13[_0xd2b3('0x4c')]===_0xd2b3('0x4b')){var _0x433be7=_0x2711b6[_0xd2b3('0x29')]({'plain':!![]});var _0x5b5d5a=_0xd2b3('0x2a');return db[_0xd2b3('0x4d')][_0xd2b3('0x4e')]({'where':{'name':_0x5b5d5a,'userProfileId':_0x271f13[_0xd2b3('0x4f')]},'raw':!![]})[_0xd2b3('0x27')](function(_0x64553d){if(_0x64553d&&_0x64553d[_0xd2b3('0x50')]===0x0){return db[_0xd2b3('0x2b')]['create']({'name':_0x433be7[_0xd2b3('0x2d')],'resourceId':_0x433be7['id'],'type':_0x64553d[_0xd2b3('0x2d')],'sectionId':_0x64553d['id']},{})['then'](function(){return _0x2711b6;});}else{return _0x2711b6;}})[_0xd2b3('0x46')](function(_0x2106de){logger[_0xd2b3('0x2c')](_0xd2b3('0x51'),_0x2106de);throw _0x2106de;});}return _0x2711b6;})[_0xd2b3('0x27')](respondWithResult(_0x2411ba,0xc9))[_0xd2b3('0x46')](handleError(_0x2411ba,null));};exports[_0xd2b3('0x26')]=function(_0x1c68be,_0x1bcaf9){if(_0x1c68be[_0xd2b3('0x4a')]['id']){delete _0x1c68be[_0xd2b3('0x4a')]['id'];}return db['Schedule'][_0xd2b3('0x4e')]({'where':{'id':_0x1c68be[_0xd2b3('0x52')]['id']}})[_0xd2b3('0x27')](handleEntityNotFound(_0x1bcaf9,null))[_0xd2b3('0x27')](saveUpdates(_0x1c68be[_0xd2b3('0x4a')],null))['then'](respondWithResult(_0x1bcaf9,null))[_0xd2b3('0x46')](handleError(_0x1bcaf9,null));};exports['destroy']=function(_0x5cb173,_0x2b2ea7){return db[_0xd2b3('0x42')]['find']({'where':{'id':_0x5cb173[_0xd2b3('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b2ea7,null))[_0xd2b3('0x27')](removeEntity(_0x2b2ea7,null))[_0xd2b3('0x46')](handleError(_0x2b2ea7,null));};exports[_0xd2b3('0x53')]=function(_0x385b9e,_0x5f32a1,_0x406b84){var _0x581825=require('../../config/schedule');return db[_0xd2b3('0x42')][_0xd2b3('0x4e')]({'where':{'id':_0x385b9e[_0xd2b3('0x52')]['id']},'raw':!![]})[_0xd2b3('0x27')](handleEntityNotFound(_0x5f32a1,null))['then'](function(){_0x581825[_0xd2b3('0x53')](_0x385b9e[_0xd2b3('0x52')]['id']);})[_0xd2b3('0x27')](respondWithStatusCode(_0x5f32a1,null))['catch'](handleError(_0x5f32a1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 514f566..270e469 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 _0x9b5e=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9b5e,0x134));var _0xe9b5=function(_0x51f80b,_0x2afae3){_0x51f80b=_0x51f80b-0x0;var _0x26ffdd=_0x9b5e[_0x51f80b];return _0x26ffdd;};'use strict';var _=require(_0xe9b5('0x0'));var util=require(_0xe9b5('0x1'));var logger=require(_0xe9b5('0x2'))(_0xe9b5('0x3'));var moment=require(_0xe9b5('0x4'));var BPromise=require(_0xe9b5('0x5'));var rp=require(_0xe9b5('0x6'));var fs=require('fs');var path=require(_0xe9b5('0x7'));var rimraf=require(_0xe9b5('0x8'));var config=require(_0xe9b5('0x9'));var attributes=require(_0xe9b5('0xa'));module[_0xe9b5('0xb')]=function(_0x204207,_0x515acd){return _0x204207[_0xe9b5('0xc')](_0xe9b5('0xd'),attributes,{'tableName':_0xe9b5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd431=['tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x4dc15b,_0xb9524c){var _0x43744e=function(_0xa817e8){while(--_0xa817e8){_0x4dc15b['push'](_0x4dc15b['shift']());}};_0x43744e(++_0xb9524c);}(_0xd431,0x11f));var _0x1d43=function(_0x5e5dbf,_0x1e8c22){_0x5e5dbf=_0x5e5dbf-0x0;var _0xfd8d51=_0xd431[_0x5e5dbf];return _0xfd8d51;};'use strict';var _=require(_0x1d43('0x0'));var util=require(_0x1d43('0x1'));var logger=require(_0x1d43('0x2'))('api');var moment=require(_0x1d43('0x3'));var BPromise=require(_0x1d43('0x4'));var rp=require(_0x1d43('0x5'));var fs=require('fs');var path=require(_0x1d43('0x6'));var rimraf=require(_0x1d43('0x7'));var config=require(_0x1d43('0x8'));var attributes=require('./schedule.attributes');module[_0x1d43('0x9')]=function(_0x7bbc41,_0x15e5be){return _0x7bbc41[_0x1d43('0xa')](_0x1d43('0xb'),attributes,{'tableName':_0x1d43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index b1c4b8d..e01f790 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 _0xf055=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x119ef5,_0x1965b9){var _0x1ab971=function(_0x1aae08){while(--_0x1aae08){_0x119ef5['push'](_0x119ef5['shift']());}};_0x1ab971(++_0x1965b9);}(_0xf055,0x13d));var _0x5f05=function(_0x6238a2,_0x5bc389){_0x6238a2=_0x6238a2-0x0;var _0x429b25=_0xf055[_0x6238a2];return _0x429b25;};'use strict';var _=require(_0x5f05('0x0'));var util=require(_0x5f05('0x1'));var moment=require(_0x5f05('0x2'));var BPromise=require(_0x5f05('0x3'));var rs=require(_0x5f05('0x4'));var fs=require('fs');var Redis=require(_0x5f05('0x5'));var db=require(_0x5f05('0x6'))['db'];var utils=require(_0x5f05('0x7'));var logger=require(_0x5f05('0x8'))('rpc');var config=require(_0x5f05('0x9'));var jayson=require(_0x5f05('0xa'));var client=jayson[_0x5f05('0xb')][_0x5f05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13edba,_0x38a6a1,_0x144011){return new BPromise(function(_0x4d7eb1,_0x1d07d4){return client['request'](_0x13edba,_0x144011)[_0x5f05('0xd')](function(_0x21ba1f){logger[_0x5f05('0xe')](_0x5f05('0xf'),_0x38a6a1,_0x5f05('0x10'));logger[_0x5f05('0x11')](_0x5f05('0x12'),_0x38a6a1,_0x5f05('0x10'),JSON[_0x5f05('0x13')](_0x21ba1f));if(_0x21ba1f[_0x5f05('0x14')]){if(_0x21ba1f[_0x5f05('0x14')]['code']===0x1f4){logger['error'](_0x5f05('0xf'),_0x38a6a1,_0x21ba1f['error'][_0x5f05('0x15')]);return _0x1d07d4(_0x21ba1f[_0x5f05('0x14')][_0x5f05('0x15')]);}logger[_0x5f05('0x14')](_0x5f05('0xf'),_0x38a6a1,_0x21ba1f['error'][_0x5f05('0x15')]);return _0x4d7eb1(_0x21ba1f[_0x5f05('0x14')][_0x5f05('0x15')]);}else{logger[_0x5f05('0xe')]('Schedule,\x20%s,\x20%s',_0x38a6a1,_0x5f05('0x10'));_0x4d7eb1(_0x21ba1f['result']['message']);}})[_0x5f05('0x16')](function(_0xcc326f){logger[_0x5f05('0x14')]('Schedule,\x20%s,\x20%s',_0x38a6a1,_0xcc326f);_0x1d07d4(_0xcc326f);});});} \ No newline at end of file +var _0x3abf=['../../config/environment','http','request','then','info','debug','request\x20sent','error','Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x27fc96,_0x165adf){var _0x48d60a=function(_0x45a186){while(--_0x45a186){_0x27fc96['push'](_0x27fc96['shift']());}};_0x48d60a(++_0x165adf);}(_0x3abf,0xbf));var _0xf3ab=function(_0x44f34c,_0x52fa7c){_0x44f34c=_0x44f34c-0x0;var _0x5e7372=_0x3abf[_0x44f34c];return _0x5e7372;};'use strict';var _=require(_0xf3ab('0x0'));var util=require(_0xf3ab('0x1'));var moment=require(_0xf3ab('0x2'));var BPromise=require(_0xf3ab('0x3'));var rs=require(_0xf3ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3ab('0x5'))['db'];var utils=require(_0xf3ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf3ab('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf3ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x460114,_0x4c1786,_0x171a13){return new BPromise(function(_0xcf3a7c,_0x441079){return client[_0xf3ab('0x9')](_0x460114,_0x171a13)[_0xf3ab('0xa')](function(_0xc1e2d1){logger[_0xf3ab('0xb')]('Schedule,\x20%s,\x20%s',_0x4c1786,'request\x20sent');logger[_0xf3ab('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4c1786,_0xf3ab('0xd'),JSON['stringify'](_0xc1e2d1));if(_0xc1e2d1[_0xf3ab('0xe')]){if(_0xc1e2d1[_0xf3ab('0xe')]['code']===0x1f4){logger[_0xf3ab('0xe')](_0xf3ab('0xf'),_0x4c1786,_0xc1e2d1[_0xf3ab('0xe')][_0xf3ab('0x10')]);return _0x441079(_0xc1e2d1[_0xf3ab('0xe')][_0xf3ab('0x10')]);}logger[_0xf3ab('0xe')](_0xf3ab('0xf'),_0x4c1786,_0xc1e2d1[_0xf3ab('0xe')]['message']);return _0xcf3a7c(_0xc1e2d1['error'][_0xf3ab('0x10')]);}else{logger[_0xf3ab('0xb')](_0xf3ab('0xf'),_0x4c1786,_0xf3ab('0xd'));_0xcf3a7c(_0xc1e2d1['result']['message']);}})[_0xf3ab('0x11')](function(_0x2743cb){logger['error'](_0xf3ab('0xf'),_0x4c1786,_0x2743cb);_0x441079(_0x2743cb);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b058721..a5942f7 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 _0x497b=['describe','/:id','/:id/download','download','post','put','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x20cedb,_0x2157a3){var _0x2cd7a0=function(_0x730318){while(--_0x730318){_0x20cedb['push'](_0x20cedb['shift']());}};_0x2cd7a0(++_0x2157a3);}(_0x497b,0x138));var _0xb497=function(_0x50f9da,_0xa3af01){_0x50f9da=_0x50f9da-0x0;var _0x3638f7=_0x497b[_0x50f9da];return _0x3638f7;};'use strict';var multer=require(_0xb497('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb497('0x1'));var express=require('express');var router=express[_0xb497('0x2')]();var fs_extra=require(_0xb497('0x3'));var auth=require(_0xb497('0x4'));var interaction=require(_0xb497('0x5'));var config=require(_0xb497('0x6'));var controller=require('./screenRecording.controller');router[_0xb497('0x7')]('/',auth[_0xb497('0x8')](),controller[_0xb497('0x9')]);router[_0xb497('0x7')](_0xb497('0xa'),auth['isAuthenticated'](),controller[_0xb497('0xb')]);router[_0xb497('0x7')](_0xb497('0xc'),auth[_0xb497('0x8')](),controller['show']);router[_0xb497('0x7')](_0xb497('0xd'),auth[_0xb497('0x8')](),controller[_0xb497('0xe')]);router[_0xb497('0xf')]('/',auth[_0xb497('0x8')](),controller['create']);router[_0xb497('0x10')]('/:id',auth[_0xb497('0x8')](),controller[_0xb497('0x11')]);router['delete'](_0xb497('0xc'),auth[_0xb497('0x8')](),controller['destroy']);module[_0xb497('0x12')]=router; \ No newline at end of file +var _0x5e7f=['create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post'];(function(_0x1229f5,_0x25cda3){var _0x1e9696=function(_0x42603c){while(--_0x42603c){_0x1229f5['push'](_0x1229f5['shift']());}};_0x1e9696(++_0x25cda3);}(_0x5e7f,0xff));var _0xf5e7=function(_0x585c59,_0xd59a89){_0x585c59=_0x585c59-0x0;var _0x4f78ad=_0x5e7f[_0x585c59];return _0x4f78ad;};'use strict';var multer=require(_0xf5e7('0x0'));var util=require(_0xf5e7('0x1'));var path=require(_0xf5e7('0x2'));var timeout=require(_0xf5e7('0x3'));var express=require(_0xf5e7('0x4'));var router=express[_0xf5e7('0x5')]();var fs_extra=require(_0xf5e7('0x6'));var auth=require(_0xf5e7('0x7'));var interaction=require(_0xf5e7('0x8'));var config=require(_0xf5e7('0x9'));var controller=require(_0xf5e7('0xa'));router[_0xf5e7('0xb')]('/',auth[_0xf5e7('0xc')](),controller[_0xf5e7('0xd')]);router[_0xf5e7('0xb')](_0xf5e7('0xe'),auth['isAuthenticated'](),controller[_0xf5e7('0xf')]);router[_0xf5e7('0xb')](_0xf5e7('0x10'),auth['isAuthenticated'](),controller[_0xf5e7('0x11')]);router[_0xf5e7('0xb')](_0xf5e7('0x12'),auth[_0xf5e7('0xc')](),controller[_0xf5e7('0x13')]);router[_0xf5e7('0x14')]('/',auth[_0xf5e7('0xc')](),controller[_0xf5e7('0x15')]);router['put'](_0xf5e7('0x10'),auth[_0xf5e7('0xc')](),controller['update']);router['delete'](_0xf5e7('0x10'),auth[_0xf5e7('0xc')](),controller['destroy']);module[_0xf5e7('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1df190f..04002fa 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 _0x28f2=['MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0x28f2,0x193));var _0x228f=function(_0x484952,_0x11ff48){_0x484952=_0x484952-0x0;var _0x47183a=_0x28f2[_0x484952];return _0x47183a;};'use strict';var Sequelize=require(_0x228f('0x0'));var moment=require(_0x228f('0x1'));var path=require(_0x228f('0x2'));var config=require(_0x228f('0x3'));module[_0x228f('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x228f('0x5')](_0x228f('0x6'))?path[_0x228f('0x7')](this[_0x228f('0x5')](_0x228f('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x228f('0x8')]},'channel':{'type':Sequelize[_0x228f('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x10da58){var _0x4a4a44=_0x10da58[_0x228f('0x9')](/\\/g,'/');this[_0x228f('0xa')](_0x228f('0x6'),_0x4a4a44);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x228f('0xb')],'set':function(_0x4d0038){this[_0x228f('0xa')](_0x228f('0xc'),moment()['subtract'](_0x4d0038,'ms'));this[_0x228f('0xa')](_0x228f('0xd'),moment());this[_0x228f('0xa')](_0x228f('0xe'),_0x4d0038);}},'startedAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this['getDataValue'](_0x228f('0xc')))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}},'closedAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this[_0x228f('0x5')](_0x228f('0xd')))[_0x228f('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x228f('0x12')]();}},'createdAt':{'type':Sequelize[_0x228f('0xf')],'get':function(){return moment(this[_0x228f('0x5')](_0x228f('0x13')))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x228f('0x5')]('updatedAt'))[_0x228f('0x10')](_0x228f('0x11'))[_0x228f('0x12')]();}}}; \ No newline at end of file +var _0xc6d7=['closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract'];(function(_0x46bf0c,_0x2ba8d4){var _0x5a151f=function(_0x2ca96c){while(--_0x2ca96c){_0x46bf0c['push'](_0x46bf0c['shift']());}};_0x5a151f(++_0x2ba8d4);}(_0xc6d7,0x71));var _0x7c6d=function(_0x5af7b8,_0x396a2d){_0x5af7b8=_0x5af7b8-0x0;var _0x318cdf=_0xc6d7[_0x5af7b8];return _0x318cdf;};'use strict';var Sequelize=require(_0x7c6d('0x0'));var moment=require(_0x7c6d('0x1'));var path=require(_0x7c6d('0x2'));var config=require(_0x7c6d('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7c6d('0x4')](_0x7c6d('0x5'))?path[_0x7c6d('0x6')](this[_0x7c6d('0x4')](_0x7c6d('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x7c6d('0x7')]},'channel':{'type':Sequelize[_0x7c6d('0x7')]},'value':{'type':Sequelize[_0x7c6d('0x7')],'set':function(_0x446b68){var _0x45713e=_0x446b68[_0x7c6d('0x8')](/\\/g,'/');this[_0x7c6d('0x9')](_0x7c6d('0x5'),_0x45713e);}},'rating':{'type':Sequelize[_0x7c6d('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x477a41){this['setDataValue'](_0x7c6d('0xb'),moment()[_0x7c6d('0xc')](_0x477a41,'ms'));this[_0x7c6d('0x9')](_0x7c6d('0xd'),moment());this['setDataValue'](_0x7c6d('0xe'),_0x477a41);}},'startedAt':{'type':Sequelize[_0x7c6d('0xf')],'get':function(){return moment(this[_0x7c6d('0x4')](_0x7c6d('0xb')))[_0x7c6d('0x10')](_0x7c6d('0x11'))[_0x7c6d('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7c6d('0x4')](_0x7c6d('0xd')))[_0x7c6d('0x10')](_0x7c6d('0x11'))[_0x7c6d('0x12')]();}},'createdAt':{'type':Sequelize[_0x7c6d('0xf')],'get':function(){return moment(this[_0x7c6d('0x4')](_0x7c6d('0x13')))[_0x7c6d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x7c6d('0x12')]();}},'updatedAt':{'type':Sequelize[_0x7c6d('0xf')],'get':function(){return moment(this['getDataValue'](_0x7c6d('0x14')))[_0x7c6d('0x10')](_0x7c6d('0x11'))[_0x7c6d('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f16c723..923a630 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 _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../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','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x5483d2,_0x49c98d){var _0x157947=function(_0x3f8fb4){while(--_0x3f8fb4){_0x5483d2['push'](_0x5483d2['shift']());}};_0x157947(++_0x49c98d);}(_0xb138,0x1dd));var _0x8b13=function(_0x55ab2a,_0xd43351){_0x55ab2a=_0x55ab2a-0x0;var _0x50fd97=_0xb138[_0x55ab2a];return _0x50fd97;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file +var _0x7217=['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','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3be5d2,_0x2e9740){var _0x440de1=function(_0x15b672){while(--_0x15b672){_0x3be5d2['push'](_0x3be5d2['shift']());}};_0x440de1(++_0x2e9740);}(_0x7217,0x19e));var _0x7721=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7217[_0x9df060];return _0x338dfe;};'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('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 2417a92..693229d 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 _0x9308=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9308,0x1e9));var _0x8930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9308[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8930('0x0'));var util=require(_0x8930('0x1'));var logger=require(_0x8930('0x2'))(_0x8930('0x3'));var moment=require('moment');var BPromise=require(_0x8930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8930('0x5'));var config=require(_0x8930('0x6'));var attributes=require(_0x8930('0x7'));module[_0x8930('0x8')]=function(_0x12c160,_0x148fe9){return _0x12c160[_0x8930('0x9')](_0x8930('0xa'),attributes,{'tableName':_0x8930('0xb'),'paranoid':![],'indexes':[{'name':_0x8930('0xc'),'fields':[_0x8930('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x516d=['screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording'];(function(_0xf2f868,_0x488437){var _0x39555e=function(_0x5acf43){while(--_0x5acf43){_0xf2f868['push'](_0xf2f868['shift']());}};_0x39555e(++_0x488437);}(_0x516d,0x1b4));var _0xd516=function(_0x1eb808,_0x4b7952){_0x1eb808=_0x1eb808-0x0;var _0x1701f7=_0x516d[_0x1eb808];return _0x1701f7;};'use strict';var _=require(_0xd516('0x0'));var util=require(_0xd516('0x1'));var logger=require(_0xd516('0x2'))(_0xd516('0x3'));var moment=require(_0xd516('0x4'));var BPromise=require(_0xd516('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd516('0x6'));var rimraf=require(_0xd516('0x7'));var config=require(_0xd516('0x8'));var attributes=require(_0xd516('0x9'));module['exports']=function(_0x3aa12e,_0x487ac2){return _0x3aa12e[_0xd516('0xa')](_0xd516('0xb'),attributes,{'tableName':_0xd516('0xc'),'paranoid':![],'indexes':[{'name':_0xd516('0xd'),'fields':[_0xd516('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 201e44a..df56075 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 _0x4efd=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash','util','moment'];(function(_0x20c809,_0x26b566){var _0x1064a1=function(_0x39c6db){while(--_0x39c6db){_0x20c809['push'](_0x20c809['shift']());}};_0x1064a1(++_0x26b566);}(_0x4efd,0x11b));var _0xd4ef=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0x4efd[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0xd4ef('0x0'));var util=require(_0xd4ef('0x1'));var moment=require(_0xd4ef('0x2'));var BPromise=require(_0xd4ef('0x3'));var rs=require(_0xd4ef('0x4'));var fs=require('fs');var Redis=require(_0xd4ef('0x5'));var db=require(_0xd4ef('0x6'))['db'];var utils=require(_0xd4ef('0x7'));var logger=require(_0xd4ef('0x8'))(_0xd4ef('0x9'));var config=require('../../config/environment');var jayson=require(_0xd4ef('0xa'));var client=jayson[_0xd4ef('0xb')][_0xd4ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf3c7ec,_0x35210c,_0x1ea130){return new BPromise(function(_0x4aa664,_0xf17b4e){return client['request'](_0xf3c7ec,_0x1ea130)[_0xd4ef('0xd')](function(_0x1101ac){logger[_0xd4ef('0xe')](_0xd4ef('0xf'),_0x35210c,_0xd4ef('0x10'));logger[_0xd4ef('0x11')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x35210c,'request\x20sent',JSON['stringify'](_0x1101ac));if(_0x1101ac['error']){if(_0x1101ac['error'][_0xd4ef('0x12')]===0x1f4){logger['error'](_0xd4ef('0xf'),_0x35210c,_0x1101ac[_0xd4ef('0x13')][_0xd4ef('0x14')]);return _0xf17b4e(_0x1101ac[_0xd4ef('0x13')][_0xd4ef('0x14')]);}logger[_0xd4ef('0x13')](_0xd4ef('0xf'),_0x35210c,_0x1101ac['error'][_0xd4ef('0x14')]);return _0x4aa664(_0x1101ac['error'][_0xd4ef('0x14')]);}else{logger[_0xd4ef('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x35210c,_0xd4ef('0x10'));_0x4aa664(_0x1101ac[_0xd4ef('0x15')][_0xd4ef('0x14')]);}})['catch'](function(_0x5e004a){logger[_0xd4ef('0x13')](_0xd4ef('0xf'),_0x35210c,_0x5e004a);_0xf17b4e(_0x5e004a);});});} \ No newline at end of file +var _0x5bbb=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3246df,_0x404d23){var _0x2d8ed3=function(_0x8086e8){while(--_0x8086e8){_0x3246df['push'](_0x3246df['shift']());}};_0x2d8ed3(++_0x404d23);}(_0x5bbb,0x148));var _0xb5bb=function(_0x83f891,_0x148467){_0x83f891=_0x83f891-0x0;var _0x3fe0f3=_0x5bbb[_0x83f891];return _0x3fe0f3;};'use strict';var _=require('lodash');var util=require(_0xb5bb('0x0'));var moment=require(_0xb5bb('0x1'));var BPromise=require(_0xb5bb('0x2'));var rs=require(_0xb5bb('0x3'));var fs=require('fs');var Redis=require(_0xb5bb('0x4'));var db=require(_0xb5bb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5bb('0x6'))(_0xb5bb('0x7'));var config=require(_0xb5bb('0x8'));var jayson=require(_0xb5bb('0x9'));var client=jayson[_0xb5bb('0xa')][_0xb5bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x381cc6,_0x15751a,_0x1df61d){return new BPromise(function(_0x102a65,_0x1bb600){return client[_0xb5bb('0xc')](_0x381cc6,_0x1df61d)['then'](function(_0x17a2e2){logger[_0xb5bb('0xd')](_0xb5bb('0xe'),_0x15751a,_0xb5bb('0xf'));logger[_0xb5bb('0x10')](_0xb5bb('0x11'),_0x15751a,_0xb5bb('0xf'),JSON[_0xb5bb('0x12')](_0x17a2e2));if(_0x17a2e2['error']){if(_0x17a2e2[_0xb5bb('0x13')][_0xb5bb('0x14')]===0x1f4){logger['error'](_0xb5bb('0xe'),_0x15751a,_0x17a2e2[_0xb5bb('0x13')][_0xb5bb('0x15')]);return _0x1bb600(_0x17a2e2[_0xb5bb('0x13')][_0xb5bb('0x15')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x15751a,_0x17a2e2['error']['message']);return _0x102a65(_0x17a2e2[_0xb5bb('0x13')]['message']);}else{logger[_0xb5bb('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x15751a,_0xb5bb('0xf'));_0x102a65(_0x17a2e2[_0xb5bb('0x16')][_0xb5bb('0x15')]);}})['catch'](function(_0x2a32f2){logger['error'](_0xb5bb('0xe'),_0x15751a,_0x2a32f2);_0x1bb600(_0x2a32f2);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b7b8b2e..fa3b0e6 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 _0xdbbd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','format','extname','originalname','post','/:id/logo','file','addLogo','%s%s','logologin','/:id/logo_login','single','server/files/images/logos/','preferred','addPreferred','put','update','exports','multer'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdbbd,0x11e));var _0xddbb=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xdbbd[_0x4ae625];return _0x31accf;};'use strict';var multer=require(_0xddbb('0x0'));var util=require('util');var path=require(_0xddbb('0x1'));var timeout=require(_0xddbb('0x2'));var express=require(_0xddbb('0x3'));var router=express[_0xddbb('0x4')]();var fs_extra=require(_0xddbb('0x5'));var auth=require(_0xddbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xddbb('0x7'));var controller=require(_0xddbb('0x8'));router[_0xddbb('0x9')]('/',auth[_0xddbb('0xa')](),controller[_0xddbb('0xb')]);router[_0xddbb('0x9')](_0xddbb('0xc'),controller['getDate']);router[_0xddbb('0x9')](_0xddbb('0xd'),controller[_0xddbb('0xe')]);router[_0xddbb('0x9')]('/:id/logo',controller[_0xddbb('0xf')]);router[_0xddbb('0x9')]('/:id/logo_login',controller['getLogoLogin']);router[_0xddbb('0x9')](_0xddbb('0x10'),controller[_0xddbb('0x11')]);router[_0xddbb('0x9')](_0xddbb('0x12'),controller['getPreferred']);router[_0xddbb('0x9')](_0xddbb('0x13'),controller[_0xddbb('0x14')]);var upload=multer({'storage':multer[_0xddbb('0x15')]({'destination':function(_0x40a85a,_0x12cbb2,_0x212de6){_0x212de6(null,path[_0xddbb('0x16')](config[_0xddbb('0x17')],'server/files/images/logos/'));},'filename':function(_0x450fa9,_0x173e92,_0x116290){_0x116290(null,util[_0xddbb('0x18')]('%s%s','logo',path[_0xddbb('0x19')](_0x173e92[_0xddbb('0x1a')])));}})});router[_0xddbb('0x1b')](_0xddbb('0x1c'),upload['single'](_0xddbb('0x1d')),controller[_0xddbb('0x1e')]);var upload=multer({'storage':multer[_0xddbb('0x15')]({'destination':function(_0xfe8dca,_0x5a87d8,_0x4f2ea5){_0x4f2ea5(null,path['join'](config[_0xddbb('0x17')],'server/files/images/logos/'));},'filename':function(_0x385a3d,_0x2293bd,_0x413d39){_0x413d39(null,util[_0xddbb('0x18')](_0xddbb('0x1f'),_0xddbb('0x20'),path[_0xddbb('0x19')](_0x2293bd['originalname'])));}})});router[_0xddbb('0x1b')](_0xddbb('0x21'),upload[_0xddbb('0x22')](_0xddbb('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11b12b,_0x3e4ad4,_0x5c28ce){_0x5c28ce(null,path[_0xddbb('0x16')](config['root'],_0xddbb('0x23')));},'filename':function(_0x4f13c5,_0x472218,_0x2f5e29){_0x2f5e29(null,util[_0xddbb('0x18')](_0xddbb('0x1f'),_0xddbb('0x24'),path[_0xddbb('0x19')](_0x472218['originalname'])));}})});router[_0xddbb('0x1b')](_0xddbb('0x12'),upload[_0xddbb('0x22')](_0xddbb('0x1d')),controller[_0xddbb('0x25')]);var upload=multer({'storage':multer[_0xddbb('0x15')]({'destination':function(_0x2d84b8,_0x1a8a23,_0x1c945e){_0x1c945e(null,path[_0xddbb('0x16')](config[_0xddbb('0x17')],_0xddbb('0x23')));},'filename':function(_0x48f0e6,_0x456787,_0x14f2d9){_0x14f2d9(null,util[_0xddbb('0x18')]('%s%s','favicon',path[_0xddbb('0x19')](_0x456787[_0xddbb('0x1a')])));}})});router['post']('/:id/favicon',upload['single'](_0xddbb('0x1d')),controller['addFavicon']);router[_0xddbb('0x26')]('/:id',auth[_0xddbb('0xa')](),controller[_0xddbb('0x27')]);module[_0xddbb('0x28')]=router; \ No newline at end of file +var _0x2a23=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','originalname','post','file','addLogo','extname','single','addLogoLogin','preferred','addPreferred','put','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x2a23,0x72));var _0x32a2=function(_0x488e1c,_0x256319){_0x488e1c=_0x488e1c-0x0;var _0x5c144a=_0x2a23[_0x488e1c];return _0x5c144a;};'use strict';var multer=require('multer');var util=require(_0x32a2('0x0'));var path=require(_0x32a2('0x1'));var timeout=require(_0x32a2('0x2'));var express=require(_0x32a2('0x3'));var router=express[_0x32a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x32a2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x32a2('0x6'));var controller=require(_0x32a2('0x7'));router[_0x32a2('0x8')]('/',auth[_0x32a2('0x9')](),controller[_0x32a2('0xa')]);router[_0x32a2('0x8')](_0x32a2('0xb'),controller['getDate']);router[_0x32a2('0x8')](_0x32a2('0xc'),controller[_0x32a2('0xd')]);router[_0x32a2('0x8')](_0x32a2('0xe'),controller[_0x32a2('0xf')]);router[_0x32a2('0x8')](_0x32a2('0x10'),controller[_0x32a2('0x11')]);router[_0x32a2('0x8')](_0x32a2('0x12'),controller['gdpr']);router[_0x32a2('0x8')](_0x32a2('0x13'),controller['getPreferred']);router[_0x32a2('0x8')](_0x32a2('0x14'),controller['getFavicon']);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x55166e,_0x184751,_0x284458){_0x284458(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0xa1324,_0x5f1ea9,_0x1ff8ad){_0x1ff8ad(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'logo',path['extname'](_0x5f1ea9[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0xe'),upload['single'](_0x32a2('0x1d')),controller[_0x32a2('0x1e')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x4e116b,_0x576b1c,_0x1db555){_0x1db555(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x263ccc,_0x53aec4,_0x48fff5){_0x48fff5(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'logologin',path[_0x32a2('0x1f')](_0x53aec4[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0x10'),upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller[_0x32a2('0x21')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x230f2b,_0x189fdb,_0x5004ee){_0x5004ee(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x3b0d8c,_0x26b466,_0x31933f){_0x31933f(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),_0x32a2('0x22'),path[_0x32a2('0x1f')](_0x26b466[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')]('/:id/preferred',upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller[_0x32a2('0x23')]);var upload=multer({'storage':multer[_0x32a2('0x15')]({'destination':function(_0x273938,_0x5fac32,_0xa0315e){_0xa0315e(null,path[_0x32a2('0x16')](config[_0x32a2('0x17')],_0x32a2('0x18')));},'filename':function(_0x2faa5b,_0x313e16,_0x220f8e){_0x220f8e(null,util[_0x32a2('0x19')](_0x32a2('0x1a'),'favicon',path[_0x32a2('0x1f')](_0x313e16[_0x32a2('0x1b')])));}})});router[_0x32a2('0x1c')](_0x32a2('0x14'),upload[_0x32a2('0x20')](_0x32a2('0x1d')),controller['addFavicon']);router[_0x32a2('0x24')](_0x32a2('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x32a2('0x25')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 911c8e1..7e165de 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(_0x33bb5f,_0x5603eb){var _0x1781f1=function(_0x4157e6){while(--_0x4157e6){_0x33bb5f['push'](_0x33bb5f['shift']());}};_0x1781f1(++_0x5603eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4b708b,_0x304840){var _0x5b63b9=function(_0xad959e){while(--_0xad959e){_0x4b708b['push'](_0x4b708b['shift']());}};_0x5b63b9(++_0x304840);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9588054..920d4ef 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 _0x5144=['jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','Setting','includeAll','include','findAll','rows','show','find','body','file','filename','params','addLogoLogin','loginLogo','getLogo','getLicense','logo','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','ValidationError','getLogoLogin','server/files/images/logos','defaultLogo','default_loginLogo.svg','Sequelize','\x20not\x20found','download','gdpr','securePassword','addPreferred','preferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x5144,0xe2));var _0x4514=function(_0x1ce3aa,_0x37b150){_0x1ce3aa=_0x1ce3aa-0x0;var _0x2a243d=_0x5144[_0x1ce3aa];return _0x2a243d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4514('0x0'));var zipdir=require(_0x4514('0x1'));var jsonpatch=require(_0x4514('0x2'));var rp=require(_0x4514('0x3'));var moment=require(_0x4514('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4514('0x5'));var util=require('util');var path=require(_0x4514('0x6'));var sox=require(_0x4514('0x7'));var csv=require(_0x4514('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4514('0x9'));var _=require(_0x4514('0xa'));var squel=require(_0x4514('0xb'));var crypto=require(_0x4514('0xc'));var jsforce=require(_0x4514('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4514('0xe'));var Papa=require(_0x4514('0xf'));var Redis=require(_0x4514('0x10'));var authService=require(_0x4514('0x11'));var qs=require(_0x4514('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4514('0x13'))(_0x4514('0x14'));var utils=require(_0x4514('0x15'));var config=require(_0x4514('0x16'));var licenseUtil=require(_0x4514('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4514('0x18'));var client=jayson[_0x4514('0x19')][_0x4514('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x51d9ed,_0x346178,_0x3ad0bc,_0x496170){return new BPromise(function(_0x1ff147,_0x19b115){var _0x1386d8=_0x496170||client;return _0x1386d8['request'](_0x51d9ed,_0x3ad0bc)[_0x4514('0x1b')](function(_0x47bc87){logger[_0x4514('0x1c')](_0x4514('0x1d'),_0x346178,_0x4514('0x1e'));logger[_0x4514('0x1f')](_0x4514('0x20'),_0x346178,_0x4514('0x1e'),JSON[_0x4514('0x21')](_0x47bc87));if(_0x47bc87[_0x4514('0x22')]){if(_0x47bc87[_0x4514('0x22')][_0x4514('0x23')]===0x1f4){logger[_0x4514('0x22')](_0x4514('0x1d'),_0x346178,_0x47bc87[_0x4514('0x22')]['message']);return _0x19b115(_0x47bc87[_0x4514('0x22')][_0x4514('0x24')]);}logger[_0x4514('0x22')](_0x4514('0x1d'),_0x346178,_0x47bc87[_0x4514('0x22')][_0x4514('0x24')]);return _0x1ff147(_0x47bc87['error'][_0x4514('0x24')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x346178,_0x4514('0x1e'));_0x1ff147(_0x47bc87['result'][_0x4514('0x24')]);}})[_0x4514('0x25')](function(_0x4c89b4){logger['error']('Setting,\x20%s,\x20%s',_0x346178,_0x4c89b4);_0x19b115(_0x4c89b4);});});}function respondWithStatusCode(_0x519818,_0x4f3066){_0x4f3066=_0x4f3066||0xcc;return function(_0x2bc1e3){if(_0x2bc1e3){return _0x519818[_0x4514('0x26')](_0x4f3066);}return _0x519818[_0x4514('0x27')](_0x4f3066)[_0x4514('0x28')]();};}function respondWithResult(_0x21250e,_0x58e6d6){_0x58e6d6=_0x58e6d6||0xc8;return function(_0x44b4ce){if(_0x44b4ce){return _0x21250e[_0x4514('0x27')](_0x58e6d6)[_0x4514('0x29')](_0x44b4ce);}};}function respondWithFilteredResult(_0xea9665,_0x4f90a4){return function(_0x1a4b9b){if(_0x1a4b9b){var _0xa02f87=typeof _0x4f90a4[_0x4514('0x2a')]==='undefined'&&typeof _0x4f90a4[_0x4514('0x2b')]===_0x4514('0x2c');var _0x11dc89=_0x1a4b9b[_0x4514('0x2d')];var _0x4f02a2=_0xa02f87?0x0:_0x4f90a4[_0x4514('0x2a')];var _0x46af3e=_0xa02f87?_0x1a4b9b['count']:_0x4f90a4[_0x4514('0x2a')]+_0x4f90a4[_0x4514('0x2b')];var _0x18c468;if(_0x46af3e>=_0x11dc89){_0x46af3e=_0x11dc89;_0x18c468=0xc8;}else{_0x18c468=0xce;}_0xea9665[_0x4514('0x27')](_0x18c468);return _0xea9665[_0x4514('0x2e')](_0x4514('0x2f'),_0x4f02a2+'-'+_0x46af3e+'/'+_0x11dc89)[_0x4514('0x29')](_0x1a4b9b);}return null;};}function patchUpdates(_0x3935a3){return function(_0x3213b9){try{jsonpatch[_0x4514('0x30')](_0x3213b9,_0x3935a3,!![]);}catch(_0xbda39c){return BPromise[_0x4514('0x31')](_0xbda39c);}return _0x3213b9[_0x4514('0x32')]();};}function saveUpdates(_0x5da059,_0x22deb2){return function(_0x3b81b0){if(_0x3b81b0){return _0x3b81b0[_0x4514('0x33')](_0x5da059)[_0x4514('0x1b')](function(_0x2142f7){return _0x2142f7;});}return null;};}function removeEntity(_0x4f366d,_0x1168ff){return function(_0x5cee5e){if(_0x5cee5e){return _0x5cee5e[_0x4514('0x34')]()[_0x4514('0x1b')](function(){_0x4f366d[_0x4514('0x27')](0xcc)[_0x4514('0x28')]();});}};}function handleEntityNotFound(_0x2fceda,_0xb2d6c){return function(_0x19680f){if(!_0x19680f){_0x2fceda[_0x4514('0x26')](0x194);}return _0x19680f;};}function handleError(_0x3d46d3,_0x762c90){_0x762c90=_0x762c90||0x1f4;return function(_0x35c1a8){logger['error'](_0x35c1a8[_0x4514('0x35')]);if(_0x35c1a8[_0x4514('0x36')]){delete _0x35c1a8[_0x4514('0x36')];}_0x3d46d3[_0x4514('0x27')](_0x762c90)[_0x4514('0x37')](_0x35c1a8);};}exports[_0x4514('0x38')]=function(_0x39388c,_0x5dc5f0){var _0x4251a7={},_0x56cb5f={},_0x567876={'count':0x0,'rows':[]};var _0x43e061=_['map'](db['Setting'][_0x4514('0x39')],function(_0x118bab){return{'name':_0x118bab['fieldName'],'type':_0x118bab['type'][_0x4514('0x3a')]};});_0x56cb5f['model']=_[_0x4514('0x3b')](_0x43e061,'name');_0x56cb5f[_0x4514('0x3c')]=_[_0x4514('0x3d')](_0x39388c[_0x4514('0x3c')]);_0x56cb5f[_0x4514('0x3e')]=_[_0x4514('0x3f')](_0x56cb5f[_0x4514('0x40')],_0x56cb5f[_0x4514('0x3c')]);_0x4251a7[_0x4514('0x41')]=_['intersection'](_0x56cb5f[_0x4514('0x40')],qs[_0x4514('0x42')](_0x39388c[_0x4514('0x3c')][_0x4514('0x42')]));_0x4251a7[_0x4514('0x41')]=_0x4251a7['attributes'][_0x4514('0x43')]?_0x4251a7[_0x4514('0x41')]:_0x56cb5f[_0x4514('0x40')];if(!_0x39388c['query'][_0x4514('0x44')](_0x4514('0x45'))){_0x4251a7['limit']=qs[_0x4514('0x2b')](_0x39388c[_0x4514('0x3c')][_0x4514('0x2b')]);_0x4251a7['offset']=qs[_0x4514('0x2a')](_0x39388c[_0x4514('0x3c')][_0x4514('0x2a')]);}_0x4251a7[_0x4514('0x46')]=qs[_0x4514('0x47')](_0x39388c[_0x4514('0x3c')]['sort']);_0x4251a7[_0x4514('0x48')]=qs['filters'](_[_0x4514('0x49')](_0x39388c['query'],_0x56cb5f['filters']),_0x43e061);if(_0x39388c[_0x4514('0x3c')][_0x4514('0x4a')]){_0x4251a7[_0x4514('0x48')]=_['merge'](_0x4251a7[_0x4514('0x48')],{'$or':_[_0x4514('0x3b')](_0x43e061,function(_0x3835a9){if(_0x3835a9[_0x4514('0x4b')]!=='VIRTUAL'){var _0x3f06a={};_0x3f06a[_0x3835a9[_0x4514('0x36')]]={'$like':'%'+_0x39388c['query']['filter']+'%'};return _0x3f06a;}})});}_0x4251a7=_[_0x4514('0x4c')]({},_0x4251a7,_0x39388c[_0x4514('0x4d')]);var _0x5fefe1={'where':_0x4251a7[_0x4514('0x48')]};return db[_0x4514('0x4e')][_0x4514('0x2d')](_0x5fefe1)['then'](function(_0xcd10c2){_0x567876[_0x4514('0x2d')]=_0xcd10c2;if(_0x39388c[_0x4514('0x3c')][_0x4514('0x4f')]){_0x4251a7[_0x4514('0x50')]=[{'all':!![]}];}return db[_0x4514('0x4e')][_0x4514('0x51')](_0x4251a7);})['then'](function(_0x2783b8){_0x567876[_0x4514('0x52')]=_0x2783b8;return _0x567876;})[_0x4514('0x1b')](respondWithFilteredResult(_0x5dc5f0,_0x4251a7))['catch'](handleError(_0x5dc5f0,null));};exports[_0x4514('0x53')]=function(_0x20fdce,_0x9b1eff){var _0x4d441a={'raw':![],'where':{'id':_0x20fdce['params']['id']}},_0x328b7b={};_0x328b7b[_0x4514('0x40')]=_[_0x4514('0x3d')](db[_0x4514('0x4e')][_0x4514('0x39')]);_0x328b7b[_0x4514('0x3c')]=_[_0x4514('0x3d')](_0x20fdce[_0x4514('0x3c')]);_0x328b7b[_0x4514('0x3e')]=_['intersection'](_0x328b7b[_0x4514('0x40')],_0x328b7b[_0x4514('0x3c')]);_0x4d441a[_0x4514('0x41')]=_[_0x4514('0x3f')](_0x328b7b[_0x4514('0x40')],qs[_0x4514('0x42')](_0x20fdce[_0x4514('0x3c')]['fields']));_0x4d441a[_0x4514('0x41')]=_0x4d441a[_0x4514('0x41')][_0x4514('0x43')]?_0x4d441a[_0x4514('0x41')]:_0x328b7b[_0x4514('0x40')];if(_0x20fdce[_0x4514('0x3c')]['includeAll']){_0x4d441a[_0x4514('0x50')]=[{'all':!![]}];}_0x4d441a=_[_0x4514('0x4c')]({},_0x4d441a,_0x20fdce[_0x4514('0x4d')]);return db[_0x4514('0x4e')][_0x4514('0x54')](_0x4d441a)[_0x4514('0x1b')](handleEntityNotFound(_0x9b1eff,null))[_0x4514('0x1b')](respondWithResult(_0x9b1eff,null))[_0x4514('0x25')](handleError(_0x9b1eff,null));};exports['update']=function(_0x5e1905,_0x5cb185){if(_0x5e1905['body']['id']){delete _0x5e1905[_0x4514('0x55')]['id'];}return db['Setting'][_0x4514('0x54')]({'where':{'id':_0x5e1905['params']['id']}})['then'](handleEntityNotFound(_0x5cb185,null))[_0x4514('0x1b')](saveUpdates(_0x5e1905[_0x4514('0x55')],null))[_0x4514('0x1b')](respondWithResult(_0x5cb185,null))[_0x4514('0x25')](handleError(_0x5cb185,null));};exports['addLogo']=function(_0x1ee215,_0x5555c2,_0x47c985){if(_0x1ee215[_0x4514('0x56')]&&_0x1ee215[_0x4514('0x56')][_0x4514('0x57')]){_0x1ee215['body']['logo']=_0x1ee215[_0x4514('0x56')][_0x4514('0x57')];}return db['Setting'][_0x4514('0x54')]({'where':{'id':_0x1ee215[_0x4514('0x58')]['id']}})[_0x4514('0x1b')](handleEntityNotFound(_0x5555c2,null))[_0x4514('0x1b')](saveUpdates(_0x1ee215[_0x4514('0x55')],null))['then'](respondWithResult(_0x5555c2,null))['catch'](handleError(_0x5555c2,null));};exports[_0x4514('0x59')]=function(_0x5b203f,_0x909a8c,_0x475b0b){if(_0x5b203f[_0x4514('0x56')]&&_0x5b203f[_0x4514('0x56')]['filename']){_0x5b203f[_0x4514('0x55')][_0x4514('0x5a')]=_0x5b203f[_0x4514('0x56')][_0x4514('0x57')];}return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x5b203f['params']['id']}})[_0x4514('0x1b')](handleEntityNotFound(_0x909a8c,null))[_0x4514('0x1b')](saveUpdates(_0x5b203f[_0x4514('0x55')],null))[_0x4514('0x1b')](respondWithResult(_0x909a8c,null))[_0x4514('0x25')](handleError(_0x909a8c,null));};var utilLicense=require(_0x4514('0x17'));exports[_0x4514('0x5b')]=function(_0x744dfa,_0xf53df5,_0x3b166e){var _0x3a545c='server/files/images/logos';var _0xb36352={'custom':![]};return utilLicense[_0x4514('0x5c')]()[_0x4514('0x1b')](function(_0x46ebd5){if(_0x46ebd5){_0xb36352=_0x46ebd5;}return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x744dfa['params']['id']},'attributes':[_0x4514('0x5d'),_0x4514('0x5a'),'preferred',_0x4514('0x5e'),'defaultLogo',_0x4514('0x5f'),_0x4514('0x60'),_0x4514('0x61')],'raw':!![]});})[_0x4514('0x1b')](handleEntityNotFound(_0xf53df5,null))[_0x4514('0x1b')](function(_0x6cac02){if(_0x6cac02){var _0xa588b2=_0x6cac02[_0x4514('0x5d')]&&fs[_0x4514('0x62')](path[_0x4514('0x63')](config[_0x4514('0x64')],_0x3a545c,_[_0x4514('0x65')](_0x6cac02[_0x4514('0x5d')])))?path[_0x4514('0x63')](config[_0x4514('0x64')],_0x3a545c,_['toLower'](_0x6cac02['logo'])):path[_0x4514('0x63')](config[_0x4514('0x64')],_0x3a545c,_[_0x4514('0x65')]('default_logo.svg'));var _0x488e1f=_0x4514('0x66')+_[_0x4514('0x67')](_0x4514('0x5d'));if(_0x6cac02[_0x488e1f]||!_0xb36352[_0x4514('0x68')]){_0xa588b2=path[_0x4514('0x63')](config[_0x4514('0x64')],_0x3a545c,_[_0x4514('0x65')]('default_logo.svg'));}if(!fs[_0x4514('0x62')](_0xa588b2)){throw new db['Sequelize'][(_0x4514('0x69'))](_[_0x4514('0x67')](_0x4514('0x5d'))+'\x20not\x20found');}return _0xf53df5['download'](_0xa588b2);}})['catch'](handleError(_0xf53df5,null));};var utilLicense=require(_0x4514('0x17'));exports[_0x4514('0x6a')]=function(_0x398356,_0x30ea9c,_0x4e66ab){var _0x30e002=_0x4514('0x6b');var _0x53e486={'custom':![]};return utilLicense[_0x4514('0x5c')]()[_0x4514('0x1b')](function(_0x1c0661){if(_0x1c0661){_0x53e486=_0x1c0661;}return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x398356[_0x4514('0x58')]['id']},'attributes':[_0x4514('0x5d'),_0x4514('0x5a'),'preferred',_0x4514('0x5e'),_0x4514('0x6c'),_0x4514('0x5f'),_0x4514('0x60'),_0x4514('0x61')],'raw':!![]});})[_0x4514('0x1b')](handleEntityNotFound(_0x30ea9c,null))[_0x4514('0x1b')](function(_0x360ab3){if(_0x360ab3){var _0x403621=_0x360ab3['loginLogo']&&fs[_0x4514('0x62')](path['join'](config['root'],_0x30e002,_[_0x4514('0x65')](_0x360ab3[_0x4514('0x5a')])))?path[_0x4514('0x63')](config[_0x4514('0x64')],_0x30e002,_['toLower'](_0x360ab3[_0x4514('0x5a')])):path[_0x4514('0x63')](config['root'],_0x30e002,_[_0x4514('0x65')](_0x4514('0x6d')));var _0x1a486e=_0x4514('0x66')+_[_0x4514('0x67')]('loginLogo');if(_0x360ab3[_0x1a486e]||!_0x53e486[_0x4514('0x68')]){_0x403621=path[_0x4514('0x63')](config[_0x4514('0x64')],_0x30e002,_['toLower'](_0x4514('0x6d')));}if(!fs[_0x4514('0x62')](_0x403621)){throw new db[(_0x4514('0x6e'))][(_0x4514('0x69'))](_[_0x4514('0x67')](_0x4514('0x5a'))+_0x4514('0x6f'));}return _0x30ea9c[_0x4514('0x70')](_0x403621);}})[_0x4514('0x25')](handleError(_0x30ea9c,null));};exports[_0x4514('0x71')]=function(_0x12047d,_0x20f340){return db['Setting']['find']({'where':{'id':_0x12047d[_0x4514('0x58')]['id']},'attributes':[_0x4514('0x72')]})['then'](respondWithResult(_0x20f340,null))['catch'](handleError(_0x20f340,null));};exports[_0x4514('0x73')]=function(_0xbf2df8,_0x3bc6a7,_0x430ca5){if(_0xbf2df8[_0x4514('0x56')]&&_0xbf2df8['file'][_0x4514('0x57')]){_0xbf2df8['body'][_0x4514('0x74')]=_0xbf2df8[_0x4514('0x56')][_0x4514('0x57')];}return db['Setting'][_0x4514('0x54')]({'where':{'id':_0xbf2df8['params']['id']}})[_0x4514('0x1b')](handleEntityNotFound(_0x3bc6a7,null))[_0x4514('0x1b')](saveUpdates(_0xbf2df8['body'],null))['then'](respondWithResult(_0x3bc6a7,null))[_0x4514('0x25')](handleError(_0x3bc6a7,null));};var utilLicense=require(_0x4514('0x17'));exports['getPreferred']=function(_0x41729b,_0x266c47,_0xf62ce9){var _0x1ed6fe=_0x4514('0x6b');var _0x1d234c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x475178){if(_0x475178){_0x1d234c=_0x475178;}return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x41729b[_0x4514('0x58')]['id']},'attributes':[_0x4514('0x5d'),_0x4514('0x5a'),_0x4514('0x74'),_0x4514('0x5e'),_0x4514('0x6c'),'defaultLoginLogo',_0x4514('0x60'),_0x4514('0x61')],'raw':!![]});})[_0x4514('0x1b')](handleEntityNotFound(_0x266c47,null))['then'](function(_0x2662a9){if(_0x2662a9){var _0x4fee8=_0x2662a9['preferred']&&fs[_0x4514('0x62')](path[_0x4514('0x63')](config[_0x4514('0x64')],_0x1ed6fe,_[_0x4514('0x65')](_0x2662a9[_0x4514('0x74')])))?path[_0x4514('0x63')](config[_0x4514('0x64')],_0x1ed6fe,_[_0x4514('0x65')](_0x2662a9['preferred'])):path['join'](config['root'],_0x1ed6fe,_['toLower']('default_preferred.png'));var _0xa33660=_0x4514('0x66')+_[_0x4514('0x67')]('preferred');if(_0x2662a9[_0xa33660]||!_0x1d234c[_0x4514('0x68')]||!_0x1d234c[_0x4514('0x74')]){_0x4fee8=path[_0x4514('0x63')](config['root'],_0x1ed6fe,_[_0x4514('0x65')](_0x4514('0x75')));}if(!fs[_0x4514('0x62')](_0x4fee8)){throw new db[(_0x4514('0x6e'))][(_0x4514('0x69'))](_[_0x4514('0x67')]('preferred')+'\x20not\x20found');}return _0x266c47[_0x4514('0x70')](_0x4fee8);}})[_0x4514('0x25')](handleError(_0x266c47,null));};exports[_0x4514('0x76')]=function(_0x1fd05b,_0x586c2d,_0x216a68){if(_0x1fd05b[_0x4514('0x56')]&&_0x1fd05b[_0x4514('0x56')][_0x4514('0x57')]){_0x1fd05b[_0x4514('0x55')][_0x4514('0x5e')]=_0x1fd05b[_0x4514('0x56')][_0x4514('0x57')];}return db[_0x4514('0x4e')][_0x4514('0x54')]({'where':{'id':_0x1fd05b[_0x4514('0x58')]['id']}})[_0x4514('0x1b')](handleEntityNotFound(_0x586c2d,null))[_0x4514('0x1b')](saveUpdates(_0x1fd05b[_0x4514('0x55')],null))[_0x4514('0x1b')](respondWithResult(_0x586c2d,null))[_0x4514('0x25')](handleError(_0x586c2d,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x172cb9,_0x6bd8a8,_0x4a3c69){var _0x119a23=_0x4514('0x6b');var _0x1451b8={'custom':![]};return utilLicense[_0x4514('0x5c')]()[_0x4514('0x1b')](function(_0x22ea62){if(_0x22ea62){_0x1451b8=_0x22ea62;}return db[_0x4514('0x4e')]['find']({'where':{'id':_0x172cb9[_0x4514('0x58')]['id']},'attributes':[_0x4514('0x5d'),_0x4514('0x5a'),'preferred',_0x4514('0x5e'),'defaultLogo',_0x4514('0x5f'),'defaultPreferred',_0x4514('0x61')],'raw':!![]});})[_0x4514('0x1b')](handleEntityNotFound(_0x6bd8a8,null))[_0x4514('0x1b')](function(_0x8f0608){if(_0x8f0608){var _0x452bd5=_0x8f0608[_0x4514('0x5e')]&&fs['existsSync'](path['join'](config[_0x4514('0x64')],_0x119a23,_[_0x4514('0x65')](_0x8f0608['favicon'])))?path[_0x4514('0x63')](config[_0x4514('0x64')],_0x119a23,_[_0x4514('0x65')](_0x8f0608[_0x4514('0x5e')])):path['join'](config[_0x4514('0x64')],_0x119a23,_[_0x4514('0x65')](_0x4514('0x77')));var _0x45089e=_0x4514('0x66')+_[_0x4514('0x67')](_0x4514('0x5e'));if(_0x8f0608[_0x45089e]||!_0x1451b8[_0x4514('0x68')]){_0x452bd5=path[_0x4514('0x63')](config['root'],_0x119a23,_[_0x4514('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x452bd5)){throw new db[(_0x4514('0x6e'))][(_0x4514('0x69'))](_[_0x4514('0x67')](_0x4514('0x5e'))+_0x4514('0x6f'));}return _0x6bd8a8[_0x4514('0x70')](_0x452bd5);}})[_0x4514('0x25')](handleError(_0x6bd8a8,null));};exports[_0x4514('0x78')]=function(_0x5b58b2,_0x436d1c){var _0x3d56c9={'offset':moment()[_0x4514('0x79')]()};_0x3d56c9[_0x4514('0x7a')]=moment()[_0x4514('0x79')](_0x3d56c9[_0x4514('0x2a')])[_0x4514('0x7b')](_0x4514('0x7c'));return _0x436d1c['status'](0xc8)[_0x4514('0x37')](_0x3d56c9);}; \ No newline at end of file +var _0x4499=['destroy','stack','name','index','Setting','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','update','find','body','file','filename','logo','addLogoLogin','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save'];(function(_0x18cb9c,_0x2e4977){var _0x2c9bbf=function(_0x3908a5){while(--_0x3908a5){_0x18cb9c['push'](_0x18cb9c['shift']());}};_0x2c9bbf(++_0x2e4977);}(_0x4499,0x145));var _0x9449=function(_0x4db1a6,_0x255276){_0x4db1a6=_0x4db1a6-0x0;var _0x2796a8=_0x4499[_0x4db1a6];return _0x2796a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9449('0x0'));var jsonpatch=require(_0x9449('0x1'));var rp=require(_0x9449('0x2'));var moment=require(_0x9449('0x3'));var BPromise=require(_0x9449('0x4'));var Mustache=require(_0x9449('0x5'));var util=require('util');var path=require(_0x9449('0x6'));var sox=require(_0x9449('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9449('0x8'));var _=require(_0x9449('0x9'));var squel=require(_0x9449('0xa'));var crypto=require(_0x9449('0xb'));var jsforce=require(_0x9449('0xc'));var deskjs=require(_0x9449('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9449('0xe'));var Papa=require(_0x9449('0xf'));var Redis=require(_0x9449('0x10'));var authService=require(_0x9449('0x11'));var qs=require(_0x9449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9449('0x13'));var logger=require(_0x9449('0x14'))(_0x9449('0x15'));var utils=require('../../config/utils');var config=require(_0x9449('0x16'));var licenseUtil=require(_0x9449('0x17'));var db=require(_0x9449('0x18'))['db'];var jayson=require(_0x9449('0x19'));var client=jayson[_0x9449('0x1a')][_0x9449('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5274f,_0x3e30c8,_0xdd39a3,_0x12028a){return new BPromise(function(_0x123e1e,_0x291e1e){var _0x437fbb=_0x12028a||client;return _0x437fbb[_0x9449('0x1c')](_0x5274f,_0xdd39a3)[_0x9449('0x1d')](function(_0x3cd153){logger[_0x9449('0x1e')](_0x9449('0x1f'),_0x3e30c8,_0x9449('0x20'));logger[_0x9449('0x21')](_0x9449('0x22'),_0x3e30c8,'request\x20sent',JSON['stringify'](_0x3cd153));if(_0x3cd153[_0x9449('0x23')]){if(_0x3cd153[_0x9449('0x23')]['code']===0x1f4){logger[_0x9449('0x23')](_0x9449('0x1f'),_0x3e30c8,_0x3cd153[_0x9449('0x23')][_0x9449('0x24')]);return _0x291e1e(_0x3cd153[_0x9449('0x23')][_0x9449('0x24')]);}logger[_0x9449('0x23')](_0x9449('0x1f'),_0x3e30c8,_0x3cd153['error']['message']);return _0x123e1e(_0x3cd153[_0x9449('0x23')]['message']);}else{logger[_0x9449('0x1e')](_0x9449('0x1f'),_0x3e30c8,_0x9449('0x20'));_0x123e1e(_0x3cd153['result'][_0x9449('0x24')]);}})[_0x9449('0x25')](function(_0x2f57db){logger['error']('Setting,\x20%s,\x20%s',_0x3e30c8,_0x2f57db);_0x291e1e(_0x2f57db);});});}function respondWithStatusCode(_0x55a5ed,_0x8a3fe4){_0x8a3fe4=_0x8a3fe4||0xcc;return function(_0x357975){if(_0x357975){return _0x55a5ed[_0x9449('0x26')](_0x8a3fe4);}return _0x55a5ed[_0x9449('0x27')](_0x8a3fe4)[_0x9449('0x28')]();};}function respondWithResult(_0x243c65,_0x254886){_0x254886=_0x254886||0xc8;return function(_0x1cd614){if(_0x1cd614){return _0x243c65[_0x9449('0x27')](_0x254886)[_0x9449('0x29')](_0x1cd614);}};}function respondWithFilteredResult(_0x4edda2,_0x3143a5){return function(_0x54a3b6){if(_0x54a3b6){var _0x309a8b=typeof _0x3143a5['offset']===_0x9449('0x2a')&&typeof _0x3143a5[_0x9449('0x2b')]===_0x9449('0x2a');var _0x557d1d=_0x54a3b6[_0x9449('0x2c')];var _0xae0cc2=_0x309a8b?0x0:_0x3143a5[_0x9449('0x2d')];var _0xa945ad=_0x309a8b?_0x54a3b6[_0x9449('0x2c')]:_0x3143a5['offset']+_0x3143a5[_0x9449('0x2b')];var _0x5046be;if(_0xa945ad>=_0x557d1d){_0xa945ad=_0x557d1d;_0x5046be=0xc8;}else{_0x5046be=0xce;}_0x4edda2[_0x9449('0x27')](_0x5046be);return _0x4edda2[_0x9449('0x2e')](_0x9449('0x2f'),_0xae0cc2+'-'+_0xa945ad+'/'+_0x557d1d)[_0x9449('0x29')](_0x54a3b6);}return null;};}function patchUpdates(_0x33140d){return function(_0x592e42){try{jsonpatch['apply'](_0x592e42,_0x33140d,!![]);}catch(_0x30c758){return BPromise[_0x9449('0x30')](_0x30c758);}return _0x592e42[_0x9449('0x31')]();};}function saveUpdates(_0x307720,_0x37065b){return function(_0x48cad9){if(_0x48cad9){return _0x48cad9['update'](_0x307720)['then'](function(_0x582121){return _0x582121;});}return null;};}function removeEntity(_0x6cf817,_0x22e9c0){return function(_0xed8f21){if(_0xed8f21){return _0xed8f21[_0x9449('0x32')]()[_0x9449('0x1d')](function(){_0x6cf817[_0x9449('0x27')](0xcc)[_0x9449('0x28')]();});}};}function handleEntityNotFound(_0x5c16de,_0x628b0b){return function(_0x4ae12c){if(!_0x4ae12c){_0x5c16de[_0x9449('0x26')](0x194);}return _0x4ae12c;};}function handleError(_0xc357a4,_0x1ed9fe){_0x1ed9fe=_0x1ed9fe||0x1f4;return function(_0xe66551){logger[_0x9449('0x23')](_0xe66551[_0x9449('0x33')]);if(_0xe66551['name']){delete _0xe66551[_0x9449('0x34')];}_0xc357a4['status'](_0x1ed9fe)['send'](_0xe66551);};}exports[_0x9449('0x35')]=function(_0x44734e,_0x1efd48){var _0x431d17={},_0x4d7446={},_0x280b01={'count':0x0,'rows':[]};var _0x331209=_['map'](db[_0x9449('0x36')][_0x9449('0x37')],function(_0x3b9e54){return{'name':_0x3b9e54['fieldName'],'type':_0x3b9e54[_0x9449('0x38')][_0x9449('0x39')]};});_0x4d7446[_0x9449('0x3a')]=_[_0x9449('0x3b')](_0x331209,'name');_0x4d7446[_0x9449('0x3c')]=_[_0x9449('0x3d')](_0x44734e[_0x9449('0x3c')]);_0x4d7446[_0x9449('0x3e')]=_[_0x9449('0x3f')](_0x4d7446[_0x9449('0x3a')],_0x4d7446[_0x9449('0x3c')]);_0x431d17[_0x9449('0x40')]=_[_0x9449('0x3f')](_0x4d7446['model'],qs['fields'](_0x44734e[_0x9449('0x3c')][_0x9449('0x41')]));_0x431d17[_0x9449('0x40')]=_0x431d17[_0x9449('0x40')][_0x9449('0x42')]?_0x431d17[_0x9449('0x40')]:_0x4d7446[_0x9449('0x3a')];if(!_0x44734e['query'][_0x9449('0x43')]('nolimit')){_0x431d17['limit']=qs['limit'](_0x44734e[_0x9449('0x3c')][_0x9449('0x2b')]);_0x431d17[_0x9449('0x2d')]=qs[_0x9449('0x2d')](_0x44734e[_0x9449('0x3c')][_0x9449('0x2d')]);}_0x431d17[_0x9449('0x44')]=qs[_0x9449('0x45')](_0x44734e['query']['sort']);_0x431d17[_0x9449('0x46')]=qs[_0x9449('0x3e')](_[_0x9449('0x47')](_0x44734e['query'],_0x4d7446[_0x9449('0x3e')]),_0x331209);if(_0x44734e['query'][_0x9449('0x48')]){_0x431d17['where']=_['merge'](_0x431d17['where'],{'$or':_[_0x9449('0x3b')](_0x331209,function(_0x192ad7){if(_0x192ad7[_0x9449('0x38')]!==_0x9449('0x49')){var _0x30fceb={};_0x30fceb[_0x192ad7[_0x9449('0x34')]]={'$like':'%'+_0x44734e[_0x9449('0x3c')][_0x9449('0x48')]+'%'};return _0x30fceb;}})});}_0x431d17=_[_0x9449('0x4a')]({},_0x431d17,_0x44734e[_0x9449('0x4b')]);var _0x5246ab={'where':_0x431d17[_0x9449('0x46')]};return db['Setting']['count'](_0x5246ab)[_0x9449('0x1d')](function(_0x19ca63){_0x280b01[_0x9449('0x2c')]=_0x19ca63;if(_0x44734e[_0x9449('0x3c')][_0x9449('0x4c')]){_0x431d17[_0x9449('0x4d')]=[{'all':!![]}];}return db[_0x9449('0x36')][_0x9449('0x4e')](_0x431d17);})[_0x9449('0x1d')](function(_0x5dd66c){_0x280b01[_0x9449('0x4f')]=_0x5dd66c;return _0x280b01;})[_0x9449('0x1d')](respondWithFilteredResult(_0x1efd48,_0x431d17))[_0x9449('0x25')](handleError(_0x1efd48,null));};exports['show']=function(_0x5457a5,_0xc74050){var _0xd3750d={'raw':![],'where':{'id':_0x5457a5[_0x9449('0x50')]['id']}},_0xcdef36={};_0xcdef36[_0x9449('0x3a')]=_[_0x9449('0x3d')](db['Setting']['rawAttributes']);_0xcdef36[_0x9449('0x3c')]=_[_0x9449('0x3d')](_0x5457a5[_0x9449('0x3c')]);_0xcdef36[_0x9449('0x3e')]=_[_0x9449('0x3f')](_0xcdef36['model'],_0xcdef36[_0x9449('0x3c')]);_0xd3750d[_0x9449('0x40')]=_[_0x9449('0x3f')](_0xcdef36['model'],qs[_0x9449('0x41')](_0x5457a5[_0x9449('0x3c')][_0x9449('0x41')]));_0xd3750d['attributes']=_0xd3750d[_0x9449('0x40')][_0x9449('0x42')]?_0xd3750d[_0x9449('0x40')]:_0xcdef36[_0x9449('0x3a')];if(_0x5457a5[_0x9449('0x3c')][_0x9449('0x4c')]){_0xd3750d[_0x9449('0x4d')]=[{'all':!![]}];}_0xd3750d=_[_0x9449('0x4a')]({},_0xd3750d,_0x5457a5[_0x9449('0x4b')]);return db[_0x9449('0x36')]['find'](_0xd3750d)[_0x9449('0x1d')](handleEntityNotFound(_0xc74050,null))[_0x9449('0x1d')](respondWithResult(_0xc74050,null))[_0x9449('0x25')](handleError(_0xc74050,null));};exports[_0x9449('0x51')]=function(_0x247ef1,_0x40f316){if(_0x247ef1['body']['id']){delete _0x247ef1['body']['id'];}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x247ef1[_0x9449('0x50')]['id']}})['then'](handleEntityNotFound(_0x40f316,null))[_0x9449('0x1d')](saveUpdates(_0x247ef1[_0x9449('0x53')],null))['then'](respondWithResult(_0x40f316,null))[_0x9449('0x25')](handleError(_0x40f316,null));};exports['addLogo']=function(_0x331d67,_0x35400a,_0x110c86){if(_0x331d67['file']&&_0x331d67[_0x9449('0x54')][_0x9449('0x55')]){_0x331d67['body'][_0x9449('0x56')]=_0x331d67[_0x9449('0x54')]['filename'];}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x331d67[_0x9449('0x50')]['id']}})['then'](handleEntityNotFound(_0x35400a,null))[_0x9449('0x1d')](saveUpdates(_0x331d67[_0x9449('0x53')],null))['then'](respondWithResult(_0x35400a,null))[_0x9449('0x25')](handleError(_0x35400a,null));};exports[_0x9449('0x57')]=function(_0x37177b,_0x19fb95,_0x272add){if(_0x37177b[_0x9449('0x54')]&&_0x37177b[_0x9449('0x54')][_0x9449('0x55')]){_0x37177b['body']['loginLogo']=_0x37177b[_0x9449('0x54')]['filename'];}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x37177b['params']['id']}})[_0x9449('0x1d')](handleEntityNotFound(_0x19fb95,null))[_0x9449('0x1d')](saveUpdates(_0x37177b['body'],null))['then'](respondWithResult(_0x19fb95,null))[_0x9449('0x25')](handleError(_0x19fb95,null));};var utilLicense=require(_0x9449('0x17'));exports['getLogo']=function(_0x2b1d14,_0x161442,_0x5a9b4e){var _0x2e6694='server/files/images/logos';var _0x464f65={'custom':![]};return utilLicense['getLicense']()[_0x9449('0x1d')](function(_0x3f13fc){if(_0x3f13fc){_0x464f65=_0x3f13fc;}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x2b1d14[_0x9449('0x50')]['id']},'attributes':[_0x9449('0x56'),_0x9449('0x58'),_0x9449('0x59'),_0x9449('0x5a'),_0x9449('0x5b'),_0x9449('0x5c'),_0x9449('0x5d'),_0x9449('0x5e')],'raw':!![]});})[_0x9449('0x1d')](handleEntityNotFound(_0x161442,null))[_0x9449('0x1d')](function(_0x4deef){if(_0x4deef){var _0x1fb88b=_0x4deef['logo']&&fs[_0x9449('0x5f')](path[_0x9449('0x60')](config[_0x9449('0x61')],_0x2e6694,_[_0x9449('0x62')](_0x4deef[_0x9449('0x56')])))?path[_0x9449('0x60')](config[_0x9449('0x61')],_0x2e6694,_[_0x9449('0x62')](_0x4deef[_0x9449('0x56')])):path[_0x9449('0x60')](config[_0x9449('0x61')],_0x2e6694,_[_0x9449('0x62')](_0x9449('0x63')));var _0x32762b=_0x9449('0x64')+_[_0x9449('0x65')](_0x9449('0x56'));if(_0x4deef[_0x32762b]||!_0x464f65[_0x9449('0x66')]){_0x1fb88b=path[_0x9449('0x60')](config[_0x9449('0x61')],_0x2e6694,_[_0x9449('0x62')](_0x9449('0x63')));}if(!fs['existsSync'](_0x1fb88b)){throw new db[(_0x9449('0x67'))][(_0x9449('0x68'))](_[_0x9449('0x65')](_0x9449('0x56'))+_0x9449('0x69'));}return _0x161442[_0x9449('0x6a')](_0x1fb88b);}})[_0x9449('0x25')](handleError(_0x161442,null));};var utilLicense=require('../../config/license/util');exports[_0x9449('0x6b')]=function(_0x3908f3,_0x5c55ba,_0x60ee4e){var _0x54c2c9='server/files/images/logos';var _0x33f2a1={'custom':![]};return utilLicense[_0x9449('0x6c')]()[_0x9449('0x1d')](function(_0x4e1b01){if(_0x4e1b01){_0x33f2a1=_0x4e1b01;}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x3908f3[_0x9449('0x50')]['id']},'attributes':['logo',_0x9449('0x58'),_0x9449('0x59'),_0x9449('0x5a'),'defaultLogo',_0x9449('0x5c'),_0x9449('0x5d'),_0x9449('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x5c55ba,null))[_0x9449('0x1d')](function(_0xad0547){if(_0xad0547){var _0x2d9467=_0xad0547[_0x9449('0x58')]&&fs[_0x9449('0x5f')](path[_0x9449('0x60')](config[_0x9449('0x61')],_0x54c2c9,_[_0x9449('0x62')](_0xad0547[_0x9449('0x58')])))?path[_0x9449('0x60')](config[_0x9449('0x61')],_0x54c2c9,_[_0x9449('0x62')](_0xad0547['loginLogo'])):path[_0x9449('0x60')](config['root'],_0x54c2c9,_[_0x9449('0x62')](_0x9449('0x6d')));var _0x114b4f=_0x9449('0x64')+_[_0x9449('0x65')](_0x9449('0x58'));if(_0xad0547[_0x114b4f]||!_0x33f2a1[_0x9449('0x66')]){_0x2d9467=path[_0x9449('0x60')](config[_0x9449('0x61')],_0x54c2c9,_['toLower'](_0x9449('0x6d')));}if(!fs[_0x9449('0x5f')](_0x2d9467)){throw new db[(_0x9449('0x67'))][(_0x9449('0x68'))](_[_0x9449('0x65')](_0x9449('0x58'))+_0x9449('0x69'));}return _0x5c55ba['download'](_0x2d9467);}})['catch'](handleError(_0x5c55ba,null));};exports[_0x9449('0x6e')]=function(_0x5e6692,_0x469d5f){return db[_0x9449('0x36')]['find']({'where':{'id':_0x5e6692['params']['id']},'attributes':[_0x9449('0x6f')]})[_0x9449('0x1d')](respondWithResult(_0x469d5f,null))[_0x9449('0x25')](handleError(_0x469d5f,null));};exports[_0x9449('0x70')]=function(_0x27f309,_0x4e8f6b,_0x459fe3){if(_0x27f309[_0x9449('0x54')]&&_0x27f309[_0x9449('0x54')]['filename']){_0x27f309[_0x9449('0x53')][_0x9449('0x59')]=_0x27f309[_0x9449('0x54')]['filename'];}return db['Setting'][_0x9449('0x52')]({'where':{'id':_0x27f309[_0x9449('0x50')]['id']}})[_0x9449('0x1d')](handleEntityNotFound(_0x4e8f6b,null))[_0x9449('0x1d')](saveUpdates(_0x27f309['body'],null))['then'](respondWithResult(_0x4e8f6b,null))[_0x9449('0x25')](handleError(_0x4e8f6b,null));};var utilLicense=require(_0x9449('0x17'));exports[_0x9449('0x71')]=function(_0x348bc7,_0x15f9ea,_0x2b89c5){var _0x1d10e7=_0x9449('0x72');var _0x1b5d7c={'custom':![]};return utilLicense['getLicense']()[_0x9449('0x1d')](function(_0x2dc41d){if(_0x2dc41d){_0x1b5d7c=_0x2dc41d;}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x348bc7[_0x9449('0x50')]['id']},'attributes':['logo',_0x9449('0x58'),_0x9449('0x59'),_0x9449('0x5a'),_0x9449('0x5b'),_0x9449('0x5c'),_0x9449('0x5d'),_0x9449('0x5e')],'raw':!![]});})[_0x9449('0x1d')](handleEntityNotFound(_0x15f9ea,null))[_0x9449('0x1d')](function(_0x40a11d){if(_0x40a11d){var _0x25b5a0=_0x40a11d['preferred']&&fs[_0x9449('0x5f')](path[_0x9449('0x60')](config[_0x9449('0x61')],_0x1d10e7,_[_0x9449('0x62')](_0x40a11d[_0x9449('0x59')])))?path[_0x9449('0x60')](config[_0x9449('0x61')],_0x1d10e7,_[_0x9449('0x62')](_0x40a11d[_0x9449('0x59')])):path[_0x9449('0x60')](config['root'],_0x1d10e7,_[_0x9449('0x62')]('default_preferred.png'));var _0x5df435='default'+_['upperFirst'](_0x9449('0x59'));if(_0x40a11d[_0x5df435]||!_0x1b5d7c[_0x9449('0x66')]||!_0x1b5d7c[_0x9449('0x59')]){_0x25b5a0=path['join'](config[_0x9449('0x61')],_0x1d10e7,_['toLower'](_0x9449('0x73')));}if(!fs[_0x9449('0x5f')](_0x25b5a0)){throw new db[(_0x9449('0x67'))]['ValidationError'](_[_0x9449('0x65')](_0x9449('0x59'))+_0x9449('0x69'));}return _0x15f9ea[_0x9449('0x6a')](_0x25b5a0);}})['catch'](handleError(_0x15f9ea,null));};exports[_0x9449('0x74')]=function(_0x25ebfb,_0x3c71ac,_0x4b91b6){if(_0x25ebfb[_0x9449('0x54')]&&_0x25ebfb['file']['filename']){_0x25ebfb['body'][_0x9449('0x5a')]=_0x25ebfb[_0x9449('0x54')][_0x9449('0x55')];}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x25ebfb['params']['id']}})[_0x9449('0x1d')](handleEntityNotFound(_0x3c71ac,null))[_0x9449('0x1d')](saveUpdates(_0x25ebfb[_0x9449('0x53')],null))[_0x9449('0x1d')](respondWithResult(_0x3c71ac,null))[_0x9449('0x25')](handleError(_0x3c71ac,null));};var utilLicense=require(_0x9449('0x17'));exports[_0x9449('0x75')]=function(_0x138e57,_0x17345d,_0x98ddb7){var _0x3cac33=_0x9449('0x72');var _0x27f16d={'custom':![]};return utilLicense[_0x9449('0x6c')]()['then'](function(_0x27fba4){if(_0x27fba4){_0x27f16d=_0x27fba4;}return db[_0x9449('0x36')][_0x9449('0x52')]({'where':{'id':_0x138e57[_0x9449('0x50')]['id']},'attributes':[_0x9449('0x56'),'loginLogo',_0x9449('0x59'),'favicon',_0x9449('0x5b'),_0x9449('0x5c'),_0x9449('0x5d'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x17345d,null))['then'](function(_0x2a42a9){if(_0x2a42a9){var _0x5224e3=_0x2a42a9[_0x9449('0x5a')]&&fs[_0x9449('0x5f')](path[_0x9449('0x60')](config[_0x9449('0x61')],_0x3cac33,_[_0x9449('0x62')](_0x2a42a9[_0x9449('0x5a')])))?path[_0x9449('0x60')](config['root'],_0x3cac33,_['toLower'](_0x2a42a9[_0x9449('0x5a')])):path[_0x9449('0x60')](config[_0x9449('0x61')],_0x3cac33,_[_0x9449('0x62')](_0x9449('0x76')));var _0x5eb742=_0x9449('0x64')+_[_0x9449('0x65')](_0x9449('0x5a'));if(_0x2a42a9[_0x5eb742]||!_0x27f16d['custom']){_0x5224e3=path[_0x9449('0x60')](config['root'],_0x3cac33,_['toLower']('default_favicon.ico'));}if(!fs[_0x9449('0x5f')](_0x5224e3)){throw new db[(_0x9449('0x67'))]['ValidationError'](_[_0x9449('0x65')](_0x9449('0x5a'))+'\x20not\x20found');}return _0x17345d[_0x9449('0x6a')](_0x5224e3);}})['catch'](handleError(_0x17345d,null));};exports[_0x9449('0x77')]=function(_0x56af2f,_0x8df707){var _0x352f35={'offset':moment()['utcOffset']()};_0x352f35[_0x9449('0x78')]=moment()[_0x9449('0x79')](_0x352f35[_0x9449('0x2d')])[_0x9449('0x7a')](_0x9449('0x7b'));return _0x8df707[_0x9449('0x27')](0xc8)[_0x9449('0x7c')](_0x352f35);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 2a5f20d..caf517d 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x35ba71,_0xa2fbbd){var _0x5f04f4=function(_0x30a04f){while(--_0x30a04f){_0x35ba71['push'](_0x35ba71['shift']());}};_0x5f04f4(++_0xa2fbbd);}(_0x3e74,0x175));var _0x43e7=function(_0x54b7e8,_0x53ffef){_0x54b7e8=_0x54b7e8-0x0;var _0x367755=_0x3e74[_0x54b7e8];return _0x367755;};'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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x112c51,_0x412efd){var _0x561069=function(_0x35d8af){while(--_0x35d8af){_0x112c51['push'](_0x112c51['shift']());}};_0x561069(++_0x412efd);}(_0x34e8,0x12c));var _0x834e=function(_0x4dea49,_0x3cda76){_0x4dea49=_0x4dea49-0x0;var _0x1c01d1=_0x34e8[_0x4dea49];return _0x1c01d1;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 83cd3a1..d1653e2 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 _0x24b4=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSetting','options','raw','where','attributes','include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x2f48d2,_0x58a805){var _0x23e033=function(_0x28a89a){while(--_0x28a89a){_0x2f48d2['push'](_0x2f48d2['shift']());}};_0x23e033(++_0x58a805);}(_0x24b4,0x1d6));var _0x424b=function(_0x2ddf2e,_0x4e0ec4){_0x2ddf2e=_0x2ddf2e-0x0;var _0x4f26d3=_0x24b4[_0x2ddf2e];return _0x4f26d3;};'use strict';var _=require(_0x424b('0x0'));var util=require('util');var moment=require(_0x424b('0x1'));var BPromise=require(_0x424b('0x2'));var rs=require(_0x424b('0x3'));var fs=require('fs');var Redis=require(_0x424b('0x4'));var db=require(_0x424b('0x5'))['db'];var utils=require(_0x424b('0x6'));var logger=require(_0x424b('0x7'))(_0x424b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x424b('0x9')][_0x424b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26c621,_0x4a8d23,_0x42183b){return new BPromise(function(_0x6cb66c,_0x12ba33){return client[_0x424b('0xb')](_0x26c621,_0x42183b)[_0x424b('0xc')](function(_0x8be776){logger[_0x424b('0xd')](_0x424b('0xe'),_0x4a8d23,_0x424b('0xf'));logger['debug'](_0x424b('0x10'),_0x4a8d23,'request\x20sent',JSON['stringify'](_0x8be776));if(_0x8be776['error']){if(_0x8be776[_0x424b('0x11')][_0x424b('0x12')]===0x1f4){logger[_0x424b('0x11')](_0x424b('0xe'),_0x4a8d23,_0x8be776[_0x424b('0x11')][_0x424b('0x13')]);return _0x12ba33(_0x8be776[_0x424b('0x11')]['message']);}logger['error'](_0x424b('0xe'),_0x4a8d23,_0x8be776[_0x424b('0x11')]['message']);return _0x6cb66c(_0x8be776[_0x424b('0x11')]['message']);}else{logger[_0x424b('0xd')]('Setting,\x20%s,\x20%s',_0x4a8d23,_0x424b('0xf'));_0x6cb66c(_0x8be776['result'][_0x424b('0x13')]);}})[_0x424b('0x14')](function(_0x4d1ba2){logger['error']('Setting,\x20%s,\x20%s',_0x4a8d23,_0x4d1ba2);_0x12ba33(_0x4d1ba2);});});}exports[_0x424b('0x15')]=function(_0xad0992){var _0x59329c=this;return new Promise(function(_0x589a42,_0x3ac741){return db['Setting']['find']({'raw':_0xad0992[_0x424b('0x16')]?_0xad0992['options'][_0x424b('0x17')]===undefined?!![]:![]:!![],'where':_0xad0992[_0x424b('0x16')]?_0xad0992[_0x424b('0x16')][_0x424b('0x18')]||null:null,'attributes':_0xad0992['options']?_0xad0992[_0x424b('0x16')][_0x424b('0x19')]||null:null,'include':_0xad0992[_0x424b('0x16')]?_0xad0992[_0x424b('0x16')][_0x424b('0x1a')]?_[_0x424b('0x1b')](_0xad0992['options'][_0x424b('0x1a')],function(_0x462ed2){return{'model':db[_0x462ed2[_0x424b('0x1c')]],'as':_0x462ed2['as'],'attributes':_0x462ed2[_0x424b('0x19')],'include':_0x462ed2[_0x424b('0x1a')]?_[_0x424b('0x1b')](_0x462ed2[_0x424b('0x1a')],function(_0x58f362){return{'model':db[_0x58f362[_0x424b('0x1c')]],'as':_0x58f362['as'],'attributes':_0x58f362['attributes'],'include':_0x58f362['include']?_[_0x424b('0x1b')](_0x58f362['include'],function(_0x364b69){return{'model':db[_0x364b69[_0x424b('0x1c')]],'as':_0x364b69['as'],'attributes':_0x364b69['attributes']};}):[]};}):[]};}):[]:[]})[_0x424b('0xc')](function(_0x5f079a){logger[_0x424b('0xd')](_0x424b('0x15'),_0xad0992);logger['debug'](_0x424b('0x15'),_0xad0992,JSON[_0x424b('0x1d')](_0x5f079a));_0x589a42(_0x5f079a);})[_0x424b('0x14')](function(_0x21281f){logger[_0x424b('0x11')](_0x424b('0x15'),_0x21281f[_0x424b('0x13')],_0xad0992);_0x3ac741(_0x59329c[_0x424b('0x11')](0x1f4,_0x21281f[_0x424b('0x13')]));});});}; \ No newline at end of file +var _0x7001=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','Setting','options','where','attributes','include','model','map','ShowSetting','lodash','util'];(function(_0x5c41fd,_0xf1ae4c){var _0x12641f=function(_0x42d2dc){while(--_0x42d2dc){_0x5c41fd['push'](_0x5c41fd['shift']());}};_0x12641f(++_0xf1ae4c);}(_0x7001,0x1cf));var _0x1700=function(_0x293e45,_0x559614){_0x293e45=_0x293e45-0x0;var _0x4df8d8=_0x7001[_0x293e45];return _0x4df8d8;};'use strict';var _=require(_0x1700('0x0'));var util=require(_0x1700('0x1'));var moment=require('moment');var BPromise=require(_0x1700('0x2'));var rs=require(_0x1700('0x3'));var fs=require('fs');var Redis=require(_0x1700('0x4'));var db=require(_0x1700('0x5'))['db'];var utils=require(_0x1700('0x6'));var logger=require(_0x1700('0x7'))(_0x1700('0x8'));var config=require('../../config/environment');var jayson=require(_0x1700('0x9'));var client=jayson['client'][_0x1700('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c205,_0x4bab84,_0x41db7e){return new BPromise(function(_0x38e7df,_0x128add){return client['request'](_0x52c205,_0x41db7e)[_0x1700('0xb')](function(_0x54aab4){logger[_0x1700('0xc')](_0x1700('0xd'),_0x4bab84,'request\x20sent');logger[_0x1700('0xe')](_0x1700('0xf'),_0x4bab84,'request\x20sent',JSON[_0x1700('0x10')](_0x54aab4));if(_0x54aab4['error']){if(_0x54aab4['error'][_0x1700('0x11')]===0x1f4){logger[_0x1700('0x12')](_0x1700('0xd'),_0x4bab84,_0x54aab4[_0x1700('0x12')][_0x1700('0x13')]);return _0x128add(_0x54aab4[_0x1700('0x12')]['message']);}logger[_0x1700('0x12')](_0x1700('0xd'),_0x4bab84,_0x54aab4[_0x1700('0x12')][_0x1700('0x13')]);return _0x38e7df(_0x54aab4[_0x1700('0x12')][_0x1700('0x13')]);}else{logger[_0x1700('0xc')]('Setting,\x20%s,\x20%s',_0x4bab84,_0x1700('0x14'));_0x38e7df(_0x54aab4[_0x1700('0x15')]['message']);}})[_0x1700('0x16')](function(_0x21af56){logger[_0x1700('0x12')](_0x1700('0xd'),_0x4bab84,_0x21af56);_0x128add(_0x21af56);});});}exports['ShowSetting']=function(_0x35a1c1){var _0x341bd0=this;return new Promise(function(_0x565952,_0x38537d){return db[_0x1700('0x17')]['find']({'raw':_0x35a1c1[_0x1700('0x18')]?_0x35a1c1[_0x1700('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x35a1c1[_0x1700('0x18')]?_0x35a1c1[_0x1700('0x18')][_0x1700('0x19')]||null:null,'attributes':_0x35a1c1[_0x1700('0x18')]?_0x35a1c1[_0x1700('0x18')][_0x1700('0x1a')]||null:null,'include':_0x35a1c1[_0x1700('0x18')]?_0x35a1c1['options']['include']?_['map'](_0x35a1c1[_0x1700('0x18')][_0x1700('0x1b')],function(_0x5e40c5){return{'model':db[_0x5e40c5[_0x1700('0x1c')]],'as':_0x5e40c5['as'],'attributes':_0x5e40c5[_0x1700('0x1a')],'include':_0x5e40c5[_0x1700('0x1b')]?_[_0x1700('0x1d')](_0x5e40c5[_0x1700('0x1b')],function(_0xf4a662){return{'model':db[_0xf4a662[_0x1700('0x1c')]],'as':_0xf4a662['as'],'attributes':_0xf4a662[_0x1700('0x1a')],'include':_0xf4a662['include']?_[_0x1700('0x1d')](_0xf4a662[_0x1700('0x1b')],function(_0x40057b){return{'model':db[_0x40057b['model']],'as':_0x40057b['as'],'attributes':_0x40057b[_0x1700('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x366ca6){logger[_0x1700('0xc')](_0x1700('0x1e'),_0x35a1c1);logger[_0x1700('0xe')](_0x1700('0x1e'),_0x35a1c1,JSON[_0x1700('0x10')](_0x366ca6));_0x565952(_0x366ca6);})[_0x1700('0x16')](function(_0x4e372a){logger['error'](_0x1700('0x1e'),_0x4e372a[_0x1700('0x13')],_0x35a1c1);_0x38537d(_0x341bd0['error'](0x1f4,_0x4e372a[_0x1700('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d3e55ff..0448b4d 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 _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x49435f,_0x4df1ee){var _0x1cdcde=function(_0x54c2cb){while(--_0x54c2cb){_0x49435f['push'](_0x49435f['shift']());}};_0x1cdcde(++_0x4df1ee);}(_0x6aa7,0x178));var _0x76aa=function(_0x5c4c92,_0x44be30){_0x5c4c92=_0x5c4c92-0x0;var _0x21df3c=_0x6aa7[_0x5c4c92];return _0x21df3c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file +var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x28f180,_0xf9fedd){var _0x1dd9fe=function(_0x32c456){while(--_0x32c456){_0x28f180['push'](_0x28f180['shift']());}};_0x1dd9fe(++_0xf9fedd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x44f91e,_0x47e2eb){_0x44f91e=_0x44f91e-0x0;var _0x33a0bd=_0x7fbe[_0x44f91e];return _0x33a0bd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 23aec56..bb5d494 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 _0xdd63=['connectel','plivo','clickatell','bandwidth','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','ENUM','twilio','skebby'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd63,0x1b2));var _0x3dd6=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xdd63[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x3dd6('0x0'));var rs=require('randomstring');module[_0x3dd6('0x1')]={'name':{'type':Sequelize[_0x3dd6('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x3dd6('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3dd6('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3dd6('0x4')](_0x3dd6('0x5'),_0x3dd6('0x6'),_0x3dd6('0x7'),'clicksend',_0x3dd6('0x8'),_0x3dd6('0x9'),_0x3dd6('0xa'),'csc','infobip',_0x3dd6('0xb'))},'accountSid':{'type':Sequelize[_0x3dd6('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x3dd6('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x3dd6('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x3dd6('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3dd6('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3dd6('0xc')],'defaultValue':function(){return _0x3dd6('0xd');}},'notificationSound':{'type':Sequelize[_0x3dd6('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3dd6('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3dd6('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3dd6('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x3dd6('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3dd6('0xf')],'comment':_0x3dd6('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3dd6('0x11'),'set':function(_0xd9b8ee){if(!_0xd9b8ee)this[_0x3dd6('0x12')](_0x3dd6('0x13'),null);this[_0x3dd6('0x12')](_0x3dd6('0x14'),_0xd9b8ee);}}}; \ No newline at end of file +var _0x8f25=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT'];(function(_0xad1f10,_0x21255c){var _0x363c1e=function(_0x76d32e){while(--_0x76d32e){_0xad1f10['push'](_0xad1f10['shift']());}};_0x363c1e(++_0x21255c);}(_0x8f25,0x7f));var _0x58f2=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x8f25[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0x58f2('0x0'));var rs=require('randomstring');module[_0x58f2('0x1')]={'name':{'type':Sequelize[_0x58f2('0x2')],'unique':_0x58f2('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x58f2('0x2')],'defaultValue':function(){return rs[_0x58f2('0x4')]();}},'phone':{'type':Sequelize[_0x58f2('0x2')]},'type':{'type':Sequelize[_0x58f2('0x5')](_0x58f2('0x6'),_0x58f2('0x7'),_0x58f2('0x8'),'clicksend',_0x58f2('0x9'),_0x58f2('0xa'),_0x58f2('0xb'),_0x58f2('0xc'),_0x58f2('0xd'),_0x58f2('0xe'))},'accountSid':{'type':Sequelize[_0x58f2('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x58f2('0x2')]},'smsMethod':{'type':Sequelize[_0x58f2('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x58f2('0x2')]},'password':{'type':Sequelize[_0x58f2('0x2')]},'apiKey':{'type':Sequelize[_0x58f2('0x2')]},'applicationId':{'type':Sequelize[_0x58f2('0x2')]},'accountId':{'type':Sequelize[_0x58f2('0x2')]},'senderString':{'type':Sequelize[_0x58f2('0x2')]},'deliveryReport':{'type':Sequelize[_0x58f2('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x58f2('0x2')]},'notificationTemplate':{'type':Sequelize[_0x58f2('0x10')],'defaultValue':function(){return _0x58f2('0x11');}},'notificationSound':{'type':Sequelize[_0x58f2('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x58f2('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x58f2('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x58f2('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x58f2('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x58f2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x58f2('0x12')],'comment':_0x58f2('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x58f2('0xf')],'defaultValue':![],'comment':_0x58f2('0x14'),'set':function(_0x432f75){if(!_0x432f75)this[_0x58f2('0x15')](_0x58f2('0x16'),null);this['setDataValue'](_0x58f2('0x17'),_0x432f75);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 84337b0..af466a5 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 _0xe6c7=['DESC','list','contact','SmsInteraction','spread','created','unmanaged','SmsMessage','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','addApplications','sequelize','Transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','fullname','internal','Tag','tag','isNil','to\x20is\x20mandatory','List','out','Messages','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','clickatell','bandwidth','intelepeer','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','then','info','debug','request\x20sent','stringify','error','message','SmsAccount,\x20%s,\x20%s','result','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','filters','model','fields','attributes','nolimit','limit','order','sort','pick','where','merge','options','SmsAccount','includeAll','include','rows','catch','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','length','hasOwnProperty','filter','findAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','priority','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','text','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts'];(function(_0x112dbe,_0x2c403a){var _0x418f91=function(_0x55057e){while(--_0x55057e){_0x112dbe['push'](_0x112dbe['shift']());}};_0x418f91(++_0x2c403a);}(_0xe6c7,0x127));var _0x7e6c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xe6c7[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e6c('0x0'));var zipdir=require(_0x7e6c('0x1'));var jsonpatch=require(_0x7e6c('0x2'));var rp=require('request-promise');var moment=require(_0x7e6c('0x3'));var BPromise=require(_0x7e6c('0x4'));var Mustache=require('mustache');var util=require(_0x7e6c('0x5'));var path=require(_0x7e6c('0x6'));var sox=require('sox');var csv=require(_0x7e6c('0x7'));var ejs=require(_0x7e6c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e6c('0x9'));var squel=require(_0x7e6c('0xa'));var crypto=require(_0x7e6c('0xb'));var jsforce=require(_0x7e6c('0xc'));var deskjs=require(_0x7e6c('0xd'));var toCsv=require(_0x7e6c('0x7'));var querystring=require('querystring');var Papa=require(_0x7e6c('0xe'));var Redis=require(_0x7e6c('0xf'));var authService=require(_0x7e6c('0x10'));var qs=require(_0x7e6c('0x11'));var as=require(_0x7e6c('0x12'));var hardwareService=require(_0x7e6c('0x13'));var logger=require('../../config/logger')(_0x7e6c('0x14'));var utils=require(_0x7e6c('0x15'));var config=require(_0x7e6c('0x16'));var licenseUtil=require(_0x7e6c('0x17'));var db=require('../../mysqldb')['db'];config[_0x7e6c('0x18')]=_[_0x7e6c('0x19')](config[_0x7e6c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e6c('0x1a'))(new Redis(config[_0x7e6c('0x18')]));require('./smsAccount.socket')[_0x7e6c('0x1b')](socket);var jayson=require(_0x7e6c('0x1c'));var client=jayson[_0x7e6c('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c34a2,_0xca7d9c,_0x2e9a4c,_0x15e013){return new BPromise(function(_0x843786,_0x406abf){var _0x19624a=_0x15e013||client;return _0x19624a['request'](_0x3c34a2,_0x2e9a4c)[_0x7e6c('0x1e')](function(_0x20eef2){logger[_0x7e6c('0x1f')]('SmsAccount,\x20%s,\x20%s',_0xca7d9c,'request\x20sent');logger[_0x7e6c('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xca7d9c,_0x7e6c('0x21'),JSON[_0x7e6c('0x22')](_0x20eef2));if(_0x20eef2[_0x7e6c('0x23')]){if(_0x20eef2[_0x7e6c('0x23')]['code']===0x1f4){logger[_0x7e6c('0x23')]('SmsAccount,\x20%s,\x20%s',_0xca7d9c,_0x20eef2[_0x7e6c('0x23')][_0x7e6c('0x24')]);return _0x406abf(_0x20eef2[_0x7e6c('0x23')]['message']);}logger[_0x7e6c('0x23')](_0x7e6c('0x25'),_0xca7d9c,_0x20eef2[_0x7e6c('0x23')][_0x7e6c('0x24')]);return _0x843786(_0x20eef2[_0x7e6c('0x23')][_0x7e6c('0x24')]);}else{logger['info'](_0x7e6c('0x25'),_0xca7d9c,_0x7e6c('0x21'));_0x843786(_0x20eef2[_0x7e6c('0x26')][_0x7e6c('0x24')]);}})['catch'](function(_0x340a47){logger[_0x7e6c('0x23')](_0x7e6c('0x25'),_0xca7d9c,_0x340a47);_0x406abf(_0x340a47);});});}function respondWithStatusCode(_0x76c75f,_0x3a6878){_0x3a6878=_0x3a6878||0xcc;return function(_0x52fe04){if(_0x52fe04){return _0x76c75f[_0x7e6c('0x27')](_0x3a6878);}return _0x76c75f['status'](_0x3a6878)[_0x7e6c('0x28')]();};}function respondWithResult(_0xbb8a3e,_0x5d492b){_0x5d492b=_0x5d492b||0xc8;return function(_0x33c537){if(_0x33c537){return _0xbb8a3e[_0x7e6c('0x29')](_0x5d492b)['json'](_0x33c537);}};}function respondWithFilteredResult(_0x30fd13,_0x21aaf6){return function(_0x50dff1){if(_0x50dff1){var _0x798ab2=typeof _0x21aaf6[_0x7e6c('0x2a')]===_0x7e6c('0x2b')&&typeof _0x21aaf6['limit']==='undefined';var _0x584268=_0x50dff1[_0x7e6c('0x2c')];var _0x5e00c0=_0x798ab2?0x0:_0x21aaf6[_0x7e6c('0x2a')];var _0x15396e=_0x798ab2?_0x50dff1['count']:_0x21aaf6[_0x7e6c('0x2a')]+_0x21aaf6['limit'];var _0x318c21;if(_0x15396e>=_0x584268){_0x15396e=_0x584268;_0x318c21=0xc8;}else{_0x318c21=0xce;}_0x30fd13[_0x7e6c('0x29')](_0x318c21);return _0x30fd13[_0x7e6c('0x2d')](_0x7e6c('0x2e'),_0x5e00c0+'-'+_0x15396e+'/'+_0x584268)[_0x7e6c('0x2f')](_0x50dff1);}return null;};}function patchUpdates(_0x2c7e00){return function(_0x503dba){try{jsonpatch[_0x7e6c('0x30')](_0x503dba,_0x2c7e00,!![]);}catch(_0x16bbad){return BPromise['reject'](_0x16bbad);}return _0x503dba[_0x7e6c('0x31')]();};}function saveUpdates(_0x3156e9,_0xaff28d){return function(_0x3e57b9){if(_0x3e57b9){return _0x3e57b9[_0x7e6c('0x32')](_0x3156e9)[_0x7e6c('0x1e')](function(_0x49a191){return _0x49a191;});}return null;};}function removeEntity(_0x4fdd2b,_0x222057){return function(_0x427214){if(_0x427214){return _0x427214[_0x7e6c('0x33')]()[_0x7e6c('0x1e')](function(){var _0x2921b7=_0x427214[_0x7e6c('0x34')]({'plain':!![]});var _0x2db81c=_0x7e6c('0x35');return db[_0x7e6c('0x36')][_0x7e6c('0x33')]({'where':{'type':_0x2db81c,'resourceId':_0x2921b7['id']}})[_0x7e6c('0x1e')](function(){return _0x427214;});})[_0x7e6c('0x1e')](function(){_0x4fdd2b[_0x7e6c('0x29')](0xcc)[_0x7e6c('0x28')]();});}};}function handleEntityNotFound(_0x24f5e3,_0x5093a0){return function(_0x447b87){if(!_0x447b87){_0x24f5e3[_0x7e6c('0x27')](0x194);}return _0x447b87;};}function handleError(_0x28bf3a,_0x4b2b62){_0x4b2b62=_0x4b2b62||0x1f4;return function(_0x255984){logger[_0x7e6c('0x23')](_0x255984[_0x7e6c('0x37')]);if(_0x255984[_0x7e6c('0x38')]){delete _0x255984['name'];}_0x28bf3a[_0x7e6c('0x29')](_0x4b2b62)[_0x7e6c('0x39')](_0x255984);};}exports[_0x7e6c('0x3a')]=function(_0x26d010,_0x591ac3){var _0x392264={'include':[{'model':db[_0x7e6c('0x3b')],'as':_0x7e6c('0x3c')}]},_0x30c775={},_0x24c850={'count':0x0,'rows':[]};var _0x9d6825=_['map'](db['SmsAccount'][_0x7e6c('0x3d')],function(_0x34f0ea){return{'name':_0x34f0ea[_0x7e6c('0x3e')],'type':_0x34f0ea[_0x7e6c('0x3f')][_0x7e6c('0x40')]};});_0x30c775['model']=_[_0x7e6c('0x41')](_0x9d6825,_0x7e6c('0x38'));_0x30c775[_0x7e6c('0x42')]=_['keys'](_0x26d010[_0x7e6c('0x42')]);_0x30c775[_0x7e6c('0x43')]=_['intersection'](_0x30c775[_0x7e6c('0x44')],_0x30c775[_0x7e6c('0x42')]);_0x392264['attributes']=_['intersection'](_0x30c775['model'],qs[_0x7e6c('0x45')](_0x26d010['query']['fields']));_0x392264[_0x7e6c('0x46')]=_0x392264[_0x7e6c('0x46')]['length']?_0x392264[_0x7e6c('0x46')]:_0x30c775[_0x7e6c('0x44')];if(!_0x26d010[_0x7e6c('0x42')]['hasOwnProperty'](_0x7e6c('0x47'))){_0x392264[_0x7e6c('0x48')]=qs[_0x7e6c('0x48')](_0x26d010[_0x7e6c('0x42')]['limit']);_0x392264[_0x7e6c('0x2a')]=qs['offset'](_0x26d010[_0x7e6c('0x42')][_0x7e6c('0x2a')]);}_0x392264[_0x7e6c('0x49')]=qs[_0x7e6c('0x4a')](_0x26d010['query']['sort']);_0x392264['where']=qs[_0x7e6c('0x43')](_[_0x7e6c('0x4b')](_0x26d010[_0x7e6c('0x42')],_0x30c775[_0x7e6c('0x43')]),_0x9d6825);if(_0x26d010[_0x7e6c('0x42')]['filter']){_0x392264[_0x7e6c('0x4c')]=_[_0x7e6c('0x4d')](_0x392264[_0x7e6c('0x4c')],{'$or':_['map'](_0x9d6825,function(_0x42d3d0){if(_0x42d3d0[_0x7e6c('0x3f')]!=='VIRTUAL'){var _0x40093d={};_0x40093d[_0x42d3d0[_0x7e6c('0x38')]]={'$like':'%'+_0x26d010[_0x7e6c('0x42')]['filter']+'%'};return _0x40093d;}})});}_0x392264=_[_0x7e6c('0x4d')]({},_0x392264,_0x26d010[_0x7e6c('0x4e')]);var _0x4b3cf9={'where':_0x392264[_0x7e6c('0x4c')]};return db[_0x7e6c('0x4f')][_0x7e6c('0x2c')](_0x4b3cf9)[_0x7e6c('0x1e')](function(_0x18e62e){_0x24c850['count']=_0x18e62e;if(_0x26d010[_0x7e6c('0x42')][_0x7e6c('0x50')]){_0x392264[_0x7e6c('0x51')]=[{'all':!![]}];}return db[_0x7e6c('0x4f')]['findAll'](_0x392264);})[_0x7e6c('0x1e')](function(_0x4d86ee){_0x24c850[_0x7e6c('0x52')]=_0x4d86ee;return _0x24c850;})['then'](respondWithFilteredResult(_0x591ac3,_0x392264))[_0x7e6c('0x53')](handleError(_0x591ac3,null));};exports['show']=function(_0x271cae,_0x14bf9b){var _0xb5ac37={'raw':![],'where':{'id':_0x271cae[_0x7e6c('0x54')]['id']},'include':[{'model':db[_0x7e6c('0x3b')],'as':_0x7e6c('0x3c')}]},_0x19aeb7={};_0x19aeb7['model']=_[_0x7e6c('0x55')](db['SmsAccount'][_0x7e6c('0x3d')]);_0x19aeb7[_0x7e6c('0x42')]=_[_0x7e6c('0x55')](_0x271cae[_0x7e6c('0x42')]);_0x19aeb7[_0x7e6c('0x43')]=_['intersection'](_0x19aeb7[_0x7e6c('0x44')],_0x19aeb7[_0x7e6c('0x42')]);_0xb5ac37['attributes']=_[_0x7e6c('0x56')](_0x19aeb7[_0x7e6c('0x44')],qs[_0x7e6c('0x45')](_0x271cae[_0x7e6c('0x42')][_0x7e6c('0x45')]));_0xb5ac37[_0x7e6c('0x46')]=_0xb5ac37[_0x7e6c('0x46')]['length']?_0xb5ac37[_0x7e6c('0x46')]:_0x19aeb7[_0x7e6c('0x44')];if(_0x271cae[_0x7e6c('0x42')][_0x7e6c('0x50')]){_0xb5ac37[_0x7e6c('0x51')]=[{'all':!![]}];}_0xb5ac37=_[_0x7e6c('0x4d')]({},_0xb5ac37,_0x271cae[_0x7e6c('0x4e')]);return db[_0x7e6c('0x4f')][_0x7e6c('0x57')](_0xb5ac37)[_0x7e6c('0x1e')](handleEntityNotFound(_0x14bf9b,null))[_0x7e6c('0x1e')](respondWithResult(_0x14bf9b,null))[_0x7e6c('0x53')](handleError(_0x14bf9b,null));};exports[_0x7e6c('0x58')]=function(_0xbae8f8,_0x35efde){return db[_0x7e6c('0x4f')][_0x7e6c('0x58')](_0xbae8f8[_0x7e6c('0x59')],{})[_0x7e6c('0x1e')](function(_0x2ad9e1){var _0x579f84=_0xbae8f8[_0x7e6c('0x5a')][_0x7e6c('0x34')]({'plain':!![]});if(!_0x579f84)throw new Error(_0x7e6c('0x5b'));if(_0x579f84[_0x7e6c('0x5c')]===_0x7e6c('0x5a')){var _0x20e872=_0x2ad9e1[_0x7e6c('0x34')]({'plain':!![]});var _0x4240a6=_0x7e6c('0x35');return db[_0x7e6c('0x5d')][_0x7e6c('0x57')]({'where':{'name':_0x4240a6,'userProfileId':_0x579f84[_0x7e6c('0x5e')]},'raw':!![]})[_0x7e6c('0x1e')](function(_0x55fc8e){if(_0x55fc8e&&_0x55fc8e[_0x7e6c('0x5f')]===0x0){return db[_0x7e6c('0x36')][_0x7e6c('0x58')]({'name':_0x20e872[_0x7e6c('0x38')],'resourceId':_0x20e872['id'],'type':_0x55fc8e[_0x7e6c('0x38')],'sectionId':_0x55fc8e['id']},{})[_0x7e6c('0x1e')](function(){return _0x2ad9e1;});}else{return _0x2ad9e1;}})[_0x7e6c('0x53')](function(_0x2b8c6e){logger[_0x7e6c('0x23')](_0x7e6c('0x60'),_0x2b8c6e);throw _0x2b8c6e;});}return _0x2ad9e1;})[_0x7e6c('0x1e')](respondWithResult(_0x35efde,0xc9))['catch'](handleError(_0x35efde,null));};exports[_0x7e6c('0x32')]=function(_0x523432,_0x54bc0d){if(_0x523432[_0x7e6c('0x59')]['id']){delete _0x523432[_0x7e6c('0x59')]['id'];}return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x523432[_0x7e6c('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x7e6c('0x3c')}]})[_0x7e6c('0x1e')](handleEntityNotFound(_0x54bc0d,null))[_0x7e6c('0x1e')](saveUpdates(_0x523432[_0x7e6c('0x59')],null))['then'](respondWithResult(_0x54bc0d,null))[_0x7e6c('0x53')](handleError(_0x54bc0d,null));};exports[_0x7e6c('0x33')]=function(_0x4db859,_0x15c9da){return db['SmsAccount'][_0x7e6c('0x57')]({'where':{'id':_0x4db859['params']['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x15c9da,null))[_0x7e6c('0x1e')](removeEntity(_0x15c9da,null))['catch'](handleError(_0x15c9da,null));};exports[_0x7e6c('0x61')]=function(_0x54f13d,_0xe2a859){return db[_0x7e6c('0x4f')][_0x7e6c('0x61')]()[_0x7e6c('0x1e')](respondWithResult(_0xe2a859,null))[_0x7e6c('0x53')](handleError(_0xe2a859,null));};exports[_0x7e6c('0x62')]=function(_0x3d8b80,_0x3f0975,_0x442513){if(_0x3d8b80[_0x7e6c('0x59')]['id']){delete _0x3d8b80['body']['id'];}return db[_0x7e6c('0x4f')]['find']({'where':{'id':_0x3d8b80[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x3f0975,null))['then'](function(_0x1398de){if(_0x1398de){_0x3d8b80[_0x7e6c('0x59')][_0x7e6c('0x63')]=_0x1398de['id'];return db[_0x7e6c('0x64')][_0x7e6c('0x58')](_0x3d8b80[_0x7e6c('0x59')]);}})['then'](respondWithResult(_0x3f0975,null))[_0x7e6c('0x53')](handleError(_0x3f0975,null));};exports[_0x7e6c('0x65')]=function(_0x468825,_0x5e0f55,_0x23e292){var _0x473d18={'raw':![],'where':{}};var _0x3fb0c5={};var _0x5cb943={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7e6c('0x66')]({'where':{'id':_0x468825[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x5e0f55,null))[_0x7e6c('0x1e')](function(_0x4d655a){if(_0x4d655a){_0x3fb0c5[_0x7e6c('0x44')]=_[_0x7e6c('0x55')](db[_0x7e6c('0x64')]['rawAttributes']);_0x3fb0c5[_0x7e6c('0x42')]=_[_0x7e6c('0x55')](_0x468825[_0x7e6c('0x42')]);_0x3fb0c5['filters']=_[_0x7e6c('0x56')](_0x3fb0c5[_0x7e6c('0x44')],_0x3fb0c5['query']);_0x473d18[_0x7e6c('0x46')]=_[_0x7e6c('0x56')](_0x3fb0c5[_0x7e6c('0x44')],qs[_0x7e6c('0x45')](_0x468825[_0x7e6c('0x42')][_0x7e6c('0x45')]));_0x473d18[_0x7e6c('0x46')]=_0x473d18['attributes'][_0x7e6c('0x67')]?_0x473d18[_0x7e6c('0x46')]:_0x3fb0c5[_0x7e6c('0x44')];if(!_0x468825[_0x7e6c('0x42')][_0x7e6c('0x68')](_0x7e6c('0x47'))){_0x473d18[_0x7e6c('0x48')]=qs['limit'](_0x468825[_0x7e6c('0x42')][_0x7e6c('0x48')]);_0x473d18[_0x7e6c('0x2a')]=qs[_0x7e6c('0x2a')](_0x468825[_0x7e6c('0x42')]['offset']);}_0x473d18[_0x7e6c('0x49')]=qs['sort'](_0x468825['query'][_0x7e6c('0x4a')]);_0x473d18[_0x7e6c('0x4c')]=qs[_0x7e6c('0x43')](_[_0x7e6c('0x4b')](_0x468825[_0x7e6c('0x42')],_0x3fb0c5[_0x7e6c('0x43')]));_0x473d18[_0x7e6c('0x4c')][_0x7e6c('0x63')]=_0x4d655a['id'];if(_0x468825[_0x7e6c('0x42')]['filter']){_0x473d18[_0x7e6c('0x4c')]=_[_0x7e6c('0x4d')](_0x473d18['where'],{'$or':_[_0x7e6c('0x41')](_0x473d18['attributes'],function(_0xf7fde8){var _0x44cefa={};_0x44cefa[_0xf7fde8]={'$like':'%'+_0x468825[_0x7e6c('0x42')][_0x7e6c('0x69')]+'%'};return _0x44cefa;})});}_0x473d18=_[_0x7e6c('0x4d')]({},_0x473d18,_0x468825[_0x7e6c('0x4e')]);return db[_0x7e6c('0x64')]['count']({'where':_0x473d18[_0x7e6c('0x4c')]})[_0x7e6c('0x1e')](function(_0x6bec93){_0x5cb943[_0x7e6c('0x2c')]=_0x6bec93;if(_0x468825[_0x7e6c('0x42')]['includeAll']){_0x473d18[_0x7e6c('0x51')]=[{'all':!![]}];}return db[_0x7e6c('0x64')][_0x7e6c('0x6a')](_0x473d18);})[_0x7e6c('0x1e')](function(_0x1f14cb){_0x5cb943[_0x7e6c('0x52')]=_0x1f14cb;return _0x5cb943;});}})[_0x7e6c('0x1e')](respondWithFilteredResult(_0x5e0f55,_0x473d18))[_0x7e6c('0x53')](handleError(_0x5e0f55,null));};exports['removeDispositions']=function(_0x339235,_0x4e277e,_0x5c7561){return db[_0x7e6c('0x4f')]['find']({'where':{'id':_0x339235['params']['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x4e277e,null))[_0x7e6c('0x1e')](function(_0x3a5857){if(_0x3a5857){return _0x3a5857[_0x7e6c('0x6b')](_0x339235[_0x7e6c('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x4e277e,null))[_0x7e6c('0x53')](handleError(_0x4e277e,null));};exports['addAnswer']=function(_0x5163ca,_0x84b1ce,_0x5b807d){if(_0x5163ca['body']['id']){delete _0x5163ca[_0x7e6c('0x59')]['id'];}return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x5163ca[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x84b1ce,null))['then'](function(_0x24158d){if(_0x24158d){_0x5163ca['body'][_0x7e6c('0x63')]=_0x24158d['id'];return db[_0x7e6c('0x6c')][_0x7e6c('0x58')](_0x5163ca[_0x7e6c('0x59')]);}})[_0x7e6c('0x1e')](respondWithResult(_0x84b1ce,null))[_0x7e6c('0x53')](handleError(_0x84b1ce,null));};exports[_0x7e6c('0x6d')]=function(_0x16749e,_0x4b7275,_0x472bd2){var _0x190419={'raw':![],'where':{}};var _0x4b0a2d={};var _0x1debc8={'count':0x0,'rows':[]};return db[_0x7e6c('0x4f')][_0x7e6c('0x66')]({'where':{'id':_0x16749e['params']['id']}})['then'](handleEntityNotFound(_0x4b7275,null))[_0x7e6c('0x1e')](function(_0x595d93){if(_0x595d93){_0x4b0a2d['model']=_[_0x7e6c('0x55')](db[_0x7e6c('0x6c')][_0x7e6c('0x3d')]);_0x4b0a2d[_0x7e6c('0x42')]=_[_0x7e6c('0x55')](_0x16749e['query']);_0x4b0a2d[_0x7e6c('0x43')]=_[_0x7e6c('0x56')](_0x4b0a2d['model'],_0x4b0a2d[_0x7e6c('0x42')]);_0x190419[_0x7e6c('0x46')]=_[_0x7e6c('0x56')](_0x4b0a2d['model'],qs[_0x7e6c('0x45')](_0x16749e[_0x7e6c('0x42')][_0x7e6c('0x45')]));_0x190419['attributes']=_0x190419[_0x7e6c('0x46')][_0x7e6c('0x67')]?_0x190419['attributes']:_0x4b0a2d['model'];if(!_0x16749e[_0x7e6c('0x42')]['hasOwnProperty']('nolimit')){_0x190419[_0x7e6c('0x48')]=qs[_0x7e6c('0x48')](_0x16749e[_0x7e6c('0x42')]['limit']);_0x190419[_0x7e6c('0x2a')]=qs[_0x7e6c('0x2a')](_0x16749e[_0x7e6c('0x42')][_0x7e6c('0x2a')]);}_0x190419[_0x7e6c('0x49')]=qs[_0x7e6c('0x4a')](_0x16749e['query'][_0x7e6c('0x4a')]);_0x190419[_0x7e6c('0x4c')]=qs[_0x7e6c('0x43')](_[_0x7e6c('0x4b')](_0x16749e[_0x7e6c('0x42')],_0x4b0a2d[_0x7e6c('0x43')]));_0x190419['where'][_0x7e6c('0x63')]=_0x595d93['id'];if(_0x16749e[_0x7e6c('0x42')]['filter']){_0x190419[_0x7e6c('0x4c')]=_[_0x7e6c('0x4d')](_0x190419[_0x7e6c('0x4c')],{'$or':_[_0x7e6c('0x41')](_0x190419[_0x7e6c('0x46')],function(_0x4cd9a6){var _0x298541={};_0x298541[_0x4cd9a6]={'$like':'%'+_0x16749e[_0x7e6c('0x42')][_0x7e6c('0x69')]+'%'};return _0x298541;})});}_0x190419=_[_0x7e6c('0x4d')]({},_0x190419,_0x16749e['options']);return db['CannedAnswer'][_0x7e6c('0x2c')]({'where':_0x190419[_0x7e6c('0x4c')]})['then'](function(_0x8c5543){_0x1debc8['count']=_0x8c5543;if(_0x16749e['query']['includeAll']){_0x190419[_0x7e6c('0x51')]=[{'all':!![]}];}return db[_0x7e6c('0x6c')][_0x7e6c('0x6a')](_0x190419);})[_0x7e6c('0x1e')](function(_0x4b4413){_0x1debc8[_0x7e6c('0x52')]=_0x4b4413;return _0x1debc8;});}})[_0x7e6c('0x1e')](respondWithFilteredResult(_0x4b7275,_0x190419))[_0x7e6c('0x53')](handleError(_0x4b7275,null));};exports[_0x7e6c('0x6e')]=function(_0x4eba09,_0x487dad,_0x3ca014){return db['SmsAccount'][_0x7e6c('0x57')]({'where':{'id':_0x4eba09[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x487dad,null))[_0x7e6c('0x1e')](function(_0x5258da){if(_0x5258da){return _0x5258da[_0x7e6c('0x6e')](_0x4eba09[_0x7e6c('0x42')][_0x7e6c('0x6f')]);}})['then'](respondWithStatusCode(_0x487dad,null))[_0x7e6c('0x53')](handleError(_0x487dad,null));};exports[_0x7e6c('0x70')]=function(_0x5c0c2f,_0x3112c1,_0x39c675){var _0x396da8={'channel':_0x7e6c('0x71')};var _0x77f009=[];var _0x34d047=[];var _0x4d501e={};return db['SmsAccount'][_0x7e6c('0x57')]({'where':{'id':_0x5c0c2f[_0x7e6c('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x3112c1,null))[_0x7e6c('0x1e')](function(_0x54596f){_0x396da8[_0x7e6c('0x72')]=_0x54596f;_0x396da8[_0x7e6c('0x73')]=_[_0x7e6c('0x74')](_0x54596f['Applications'],[_0x7e6c('0x75')],[_0x7e6c('0x76')]);if(_0x396da8[_0x7e6c('0x72')][_0x7e6c('0x77')]){delete _0x396da8[_0x7e6c('0x72')][_0x7e6c('0x77')];}return db[_0x7e6c('0x78')][_0x7e6c('0x61')]();})['then'](function(_0x578b2a){if(!_0x578b2a){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))](_0x7e6c('0x7b'));}_0x77f009=_['difference'](_[_0x7e6c('0x55')](_0x578b2a),[_0x7e6c('0x7c'),_0x7e6c('0x7d')]);_0x34d047=_[_0x7e6c('0x7e')](_['keys'](_0x578b2a),[_0x7e6c('0x7c'),'updatedAt',_0x7e6c('0x7f'),_0x7e6c('0x80')]);_0x396da8[_0x7e6c('0x59')]={'mapKey':_0x7e6c('0x81')};if(_0x396da8['account'][_0x7e6c('0x3f')]){switch(_0x396da8[_0x7e6c('0x72')][_0x7e6c('0x3f')]){case _0x7e6c('0x82'):_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x84')];_0x396da8['body'][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')]['Body'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x86')];break;case _0x7e6c('0x87'):_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]='+'+_0x5c0c2f[_0x7e6c('0x59')]['sender'];_0x396da8[_0x7e6c('0x59')]['body']=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x88')];break;case'connectel':_0x396da8['body'][_0x7e6c('0x83')]=_0x5c0c2f['body']['from'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x24')];break;case _0x7e6c('0x89'):_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')]['from'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x59')];_0x396da8[_0x7e6c('0x59')]['messageId']=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x8a')];break;case _0x7e6c('0x8b'):_0x396da8[_0x7e6c('0x59')]['from']=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x84')];_0x396da8['body'][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x8c')];_0x396da8['body'][_0x7e6c('0x85')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x8d')];break;case _0x7e6c('0x8e'):_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]='+'+_0x5c0c2f['body'][_0x7e6c('0x8f')][0x0][_0x7e6c('0x83')];_0x396da8['body'][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x8f')][0x0][_0x7e6c('0x88')];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')]=_0x5c0c2f['body'][_0x7e6c('0x8f')][0x0][_0x7e6c('0x85')];break;case _0x7e6c('0x90'):_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')]['originatingAddress'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x91')][_0x7e6c('0x24')];break;case'clickatell':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x92')];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x88')];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x93')];break;case'bandwidth':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')]=_0x5c0c2f[_0x7e6c('0x59')][0x0]['message']['id'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')][0x0][_0x7e6c('0x24')][_0x7e6c('0x83')];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f['body'][0x0][_0x7e6c('0x24')][_0x7e6c('0x88')];break;case'intelepeer':_0x396da8['body'][_0x7e6c('0x83')]=_0x5c0c2f[_0x7e6c('0x59')]['from'];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')]=_0x5c0c2f[_0x7e6c('0x59')][_0x7e6c('0x24')];_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')]=_0x5c0c2f[_0x7e6c('0x59')]['refid'];break;}}if(_0x396da8['body']['id']){delete _0x396da8[_0x7e6c('0x59')]['id'];}if(_['isNil'](_0x396da8['body'][_0x7e6c('0x83')])){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))](_0x7e6c('0x94'));}if(_['isNil'](_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')])||_0x396da8[_0x7e6c('0x59')]['body']===''){throw new db[(_0x7e6c('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x396da8[_0x7e6c('0x59')]['mapKey'])){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))](_0x7e6c('0x95')+_0x34d047);}if(!_[_0x7e6c('0x96')](_0x34d047,_0x396da8['body'][_0x7e6c('0x97')])){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))](_0x7e6c('0x98')+_0x34d047);}_0x4d501e[_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x97')]]=_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')];return db[_0x7e6c('0x99')][_0x7e6c('0x57')]({'where':{'id':_0x396da8['account']['ListId']},'include':[{'model':db[_0x7e6c('0x78')],'as':_0x7e6c('0x9a'),'where':_0x4d501e,'limit':0x1,'order':[['updatedAt',_0x7e6c('0x9b')]]}]});})[_0x7e6c('0x1e')](handleEntityNotFound(_0x3112c1,null))[_0x7e6c('0x1e')](function(_0x230a71){if(_0x230a71){_0x396da8[_0x7e6c('0x9c')]=_['omit'](_0x230a71,[_0x7e6c('0x9a')]);if(_0x230a71[_0x7e6c('0x9a')][_0x7e6c('0x67')]){return _0x230a71[_0x7e6c('0x9a')][0x0];}var _0x2ee370=_[_0x7e6c('0x19')](_0x396da8[_0x7e6c('0x59')],{'firstName':_0x396da8['body'][_0x7e6c('0x83')],'ListId':_0x230a71['id']});_0x2ee370[_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x97')]]=_0x396da8['body']['from'];return db[_0x7e6c('0x78')][_0x7e6c('0x58')](_0x2ee370,{'fields':_0x77f009,'raw':!![]});}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x3112c1,null))[_0x7e6c('0x1e')](function(_0x5cb526){if(_0x5cb526){_0x396da8[_0x7e6c('0x9d')]=_0x5cb526;var _0xbacd84={'ContactId':_0x5cb526['id'],'phone':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')],'SmsAccountId':_0x5c0c2f[_0x7e6c('0x54')]['id']};var _0x30a5bd={'ContactId':_0x5cb526['id'],'SmsAccountId':_0x5c0c2f['params']['id'],'closed':![]};return db['SmsInteraction'][_0x7e6c('0x57')]({'where':_0x30a5bd})[_0x7e6c('0x1e')](function(_0x4fc49f){if(_0x4fc49f){return[_0x4fc49f,![]];}return db[_0x7e6c('0x9e')][_0x7e6c('0x58')](_0xbacd84)[_0x7e6c('0x1e')](function(_0x502a6b){return[_0x502a6b,!![]];});});}})[_0x7e6c('0x9f')](function(_0x18591c,_0x3e96b3){_0x396da8['interaction']=_0x18591c[_0x7e6c('0x34')]({'plain':!![]});_0x396da8['interaction'][_0x7e6c('0xa0')]=![];if(_0x3e96b3){if(_0x396da8[_0x7e6c('0x72')]['autoclose']){_0x396da8['applications']['push']({'id':0x0,'priority':_0x396da8['applications'][_0x7e6c('0x67')]+0x1,'app':'close','appdata':_0x7e6c('0xa1'),'interval':'*,*,*,*'});}_0x396da8['interaction'][_0x7e6c('0xa0')]=!![];}return db[_0x7e6c('0xa2')][_0x7e6c('0x58')]({'phone':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x83')],'messageId':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x85')],'body':_0x396da8[_0x7e6c('0x59')][_0x7e6c('0x59')],'SmsAccountId':_0x5c0c2f[_0x7e6c('0x54')]['id'],'SmsInteractionId':_0x18591c['id'],'direction':'in','ContactId':_0x18591c[_0x7e6c('0xa3')],'AttachmentId':_0x396da8['body'][_0x7e6c('0xa4')]});})['then'](function(_0x58385b){_0x396da8[_0x7e6c('0x24')]=_0x58385b;if(_0x396da8[_0x7e6c('0xa5')][_0x7e6c('0xa6')]){return db['User'][_0x7e6c('0x57')]({'attributes':['id',_0x7e6c('0x38')],'where':{'id':_0x396da8[_0x7e6c('0xa5')][_0x7e6c('0xa6')]}})[_0x7e6c('0x1e')](function(_0x31aaaf){if(_0x31aaaf){_0x396da8[_0x7e6c('0x73')][_0x7e6c('0xa7')]({'id':0x0,'priority':0x0,'app':_0x7e6c('0xa8'),'appdata':_0x31aaaf['name']+','+(_0x396da8['account'][_0x7e6c('0xa9')]||0xa),'interval':_0x7e6c('0xaa')});}return respondWithRpcPromise(_0x7e6c('0xab'),_0x7e6c('0xac'),_0x396da8);});}return respondWithRpcPromise(_0x7e6c('0xab'),_0x7e6c('0xac'),_0x396da8);})[_0x7e6c('0x1e')](function(_0x3860cc){if(_0x3860cc){var _0x47b4d3=0xc8;var _0x2df7fe='receiveMessage';logger[_0x7e6c('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2df7fe,_0x47b4d3,_0x7e6c('0xad'));logger[_0x7e6c('0x20')](_0x7e6c('0xae'),_0x2df7fe,_0x47b4d3,'entity\x20found',JSON[_0x7e6c('0x22')](_0x3860cc));if(_0x396da8['account'][_0x7e6c('0x3f')]===_0x7e6c('0x82')){return _0x3112c1['status'](_0x47b4d3)[_0x7e6c('0x2d')]('Content-Type',_0x7e6c('0xaf'))[_0x7e6c('0x39')]('\x0a');}else{return _0x3112c1[_0x7e6c('0x29')](_0x47b4d3)[_0x7e6c('0x2f')](_0x3860cc);}}})[_0x7e6c('0x53')](handleError(_0x3112c1,null));};exports[_0x7e6c('0xb0')]=function(_0x2c39aa,_0x12e433){var _0x2379b2=_0x2c39aa['params']['id'];var _0x4d5992=_0x2c39aa[_0x7e6c('0x59')];var _0x21569b=0xc8;var _0x29b902=null;return db[_0x7e6c('0xb1')]['transaction']({'isolationLevel':db[_0x7e6c('0xb1')][_0x7e6c('0xb2')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x185d7a){return db['SmsAccount']['findOne']({'where':{'id':_0x2379b2},'transaction':_0x185d7a})['then'](function(_0x315ce0){if(_0x315ce0){return db[_0x7e6c('0xb3')]['destroy']({'where':{'SmsAccountId':_0x2379b2},'transaction':_0x185d7a})[_0x7e6c('0x1e')](function(){var _0x3f7493=_['map'](_0x4d5992,function(_0x427f5c){_0x427f5c[_0x7e6c('0x63')]=_0x2379b2;return _0x427f5c;});return db[_0x7e6c('0xb3')][_0x7e6c('0xb4')](_0x3f7493,{'transaction':_0x185d7a});});}else{_0x21569b=0x194;_0x29b902=[];}});})[_0x7e6c('0x1e')](function(){if(_0x21569b!==0x194){return db[_0x7e6c('0xb3')][_0x7e6c('0xb5')]({'where':{'SmsAccountId':_0x2379b2},'order':'priority'})[_0x7e6c('0x1e')](function(_0x3167d2){_0x29b902=_0x3167d2;});}})[_0x7e6c('0x53')](function(_0x4ecfb9){_0x21569b=0x1f4;logger['error'](_0x4ecfb9[_0x7e6c('0x37')]);if(_0x4ecfb9['name']){delete _0x4ecfb9[_0x7e6c('0x38')];}_0x29b902=_0x4ecfb9;})['finally'](function(){if(_0x29b902===null){_0x12e433['sendStatus'](_0x21569b);}else{if(_0x21569b===0x1f4){_0x12e433['status'](_0x21569b)[_0x7e6c('0x39')](_0x29b902);}else{_0x12e433[_0x7e6c('0x29')](_0x21569b)[_0x7e6c('0x2f')](_0x29b902);}}});};exports[_0x7e6c('0xb6')]=function(_0x3f4d8,_0xa7c928,_0x5dcc90){var _0x5c0e88={};var _0x353b56={};var _0x80c909;var _0x1a4712;return db[_0x7e6c('0x4f')]['findOne']({'where':{'id':_0x3f4d8[_0x7e6c('0x54')]['id']}})['then'](handleEntityNotFound(_0xa7c928,null))[_0x7e6c('0x1e')](function(_0x3b1f21){if(_0x3b1f21){_0x80c909=_0x3b1f21;_0x353b56['model']=_[_0x7e6c('0x55')](db[_0x7e6c('0xb3')][_0x7e6c('0x3d')]);_0x353b56[_0x7e6c('0x42')]=_[_0x7e6c('0x55')](_0x3f4d8[_0x7e6c('0x42')]);_0x353b56[_0x7e6c('0x43')]=_[_0x7e6c('0x56')](_0x353b56[_0x7e6c('0x44')],_0x353b56[_0x7e6c('0x42')]);_0x5c0e88[_0x7e6c('0x46')]=_[_0x7e6c('0x56')](_0x353b56[_0x7e6c('0x44')],qs[_0x7e6c('0x45')](_0x3f4d8['query']['fields']));_0x5c0e88[_0x7e6c('0x46')]=_0x5c0e88['attributes'][_0x7e6c('0x67')]?_0x5c0e88[_0x7e6c('0x46')]:_0x353b56[_0x7e6c('0x44')];_0x5c0e88[_0x7e6c('0x49')]=qs[_0x7e6c('0x4a')](_0x3f4d8['query']['sort']);_0x5c0e88[_0x7e6c('0x4c')]=qs['filters'](_[_0x7e6c('0x4b')](_0x3f4d8['query'],_0x353b56[_0x7e6c('0x43')]));if(_0x3f4d8[_0x7e6c('0x42')][_0x7e6c('0x69')]){_0x5c0e88['where']=_[_0x7e6c('0x4d')](_0x5c0e88[_0x7e6c('0x4c')],{'$or':_[_0x7e6c('0x41')](_0x5c0e88[_0x7e6c('0x46')],function(_0x56b478){var _0x13687f={};_0x13687f[_0x56b478]={'$like':'%'+_0x3f4d8[_0x7e6c('0x42')][_0x7e6c('0x69')]+'%'};return _0x13687f;})});}_0x5c0e88=_['merge']({},_0x5c0e88,_0x3f4d8[_0x7e6c('0x4e')]);return _0x80c909['getApplications'](_0x5c0e88);}})[_0x7e6c('0x1e')](function(_0x570cb0){if(_0x570cb0){_0x1a4712=_0x570cb0['length'];if(!_0x3f4d8[_0x7e6c('0x42')]['hasOwnProperty'](_0x7e6c('0x47'))){_0x5c0e88['limit']=qs[_0x7e6c('0x48')](_0x3f4d8[_0x7e6c('0x42')][_0x7e6c('0x48')]);_0x5c0e88['offset']=qs[_0x7e6c('0x2a')](_0x3f4d8[_0x7e6c('0x42')][_0x7e6c('0x2a')]);}return _0x80c909[_0x7e6c('0xb6')](_0x5c0e88);}})[_0x7e6c('0x1e')](function(_0x4d8712){if(_0x4d8712){return _0x4d8712?{'count':_0x1a4712,'rows':_0x4d8712}:null;}})[_0x7e6c('0x1e')](respondWithResult(_0xa7c928,null))['catch'](handleError(_0xa7c928,null));};exports[_0x7e6c('0xb7')]=function(_0x20faef,_0x7028c2,_0x18ed5d){var _0xa3bc5b={'raw':![],'where':{}};var _0x4ade6d={};var _0x313ec7={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7e6c('0x66')]({'where':{'id':_0x20faef[_0x7e6c('0x54')]['id']}})['then'](handleEntityNotFound(_0x7028c2,null))[_0x7e6c('0x1e')](function(_0x3b707d){if(_0x3b707d){_0x4ade6d[_0x7e6c('0x44')]=_[_0x7e6c('0x55')](db[_0x7e6c('0x9e')][_0x7e6c('0x3d')]);_0x4ade6d[_0x7e6c('0x42')]=_['keys'](_0x20faef['query']);_0x4ade6d[_0x7e6c('0x43')]=_[_0x7e6c('0x56')](_0x4ade6d[_0x7e6c('0x44')],_0x4ade6d[_0x7e6c('0x42')]);_0xa3bc5b[_0x7e6c('0x46')]=_[_0x7e6c('0x56')](_0x4ade6d['model'],qs['fields'](_0x20faef['query'][_0x7e6c('0x45')]));_0xa3bc5b['attributes']=_0xa3bc5b['attributes'][_0x7e6c('0x67')]?_0xa3bc5b[_0x7e6c('0x46')]:_0x4ade6d[_0x7e6c('0x44')];if(!_0x20faef['query']['hasOwnProperty']('nolimit')){_0xa3bc5b[_0x7e6c('0x48')]=qs['limit'](_0x20faef[_0x7e6c('0x42')]['limit']);_0xa3bc5b['offset']=qs[_0x7e6c('0x2a')](_0x20faef[_0x7e6c('0x42')][_0x7e6c('0x2a')]);}_0xa3bc5b['order']=qs[_0x7e6c('0x4a')](_0x20faef['query']['sort']);_0xa3bc5b['where']=qs[_0x7e6c('0x43')](_['pick'](_0x20faef[_0x7e6c('0x42')],_0x4ade6d[_0x7e6c('0x43')]));_0xa3bc5b['where'][_0x7e6c('0x63')]=_0x3b707d['id'];if(_0x20faef[_0x7e6c('0x42')][_0x7e6c('0x69')]){_0xa3bc5b[_0x7e6c('0x4c')]=_[_0x7e6c('0x4d')](_0xa3bc5b[_0x7e6c('0x4c')],{'$or':_[_0x7e6c('0x41')](_0xa3bc5b[_0x7e6c('0x46')],function(_0x1a2dd2){var _0x577c74={};_0x577c74[_0x1a2dd2]={'$like':'%'+_0x20faef['query'][_0x7e6c('0x69')]+'%'};return _0x577c74;})});}_0xa3bc5b=_['merge']({},_0xa3bc5b,_0x20faef[_0x7e6c('0x4e')]);return db['SmsInteraction'][_0x7e6c('0x2c')]({'where':_0xa3bc5b[_0x7e6c('0x4c')]})[_0x7e6c('0x1e')](function(_0x2cfa78){_0x313ec7[_0x7e6c('0x2c')]=_0x2cfa78;if(_0x20faef[_0x7e6c('0x42')][_0x7e6c('0x50')]){_0xa3bc5b[_0x7e6c('0x51')]=[{'model':db[_0x7e6c('0x78')],'as':_0x7e6c('0xb8'),'required':![]},{'model':db[_0x7e6c('0xb9')],'as':'Owner','attributes':[_0x7e6c('0x38'),_0x7e6c('0xba'),_0x7e6c('0xbb')],'required':![]},{'model':db[_0x7e6c('0xbc')],'as':'Tags','attributes':['id',_0x7e6c('0x38'),'color'],'where':_0x20faef[_0x7e6c('0x42')][_0x7e6c('0xbd')]?{'id':_0x20faef[_0x7e6c('0x42')][_0x7e6c('0xbd')]}:undefined,'required':_0x20faef[_0x7e6c('0x42')][_0x7e6c('0xbd')]?!![]:![]}];}return db[_0x7e6c('0x9e')][_0x7e6c('0x6a')](_0xa3bc5b);})['then'](function(_0xe2b65f){_0x313ec7['rows']=_0xe2b65f;return _0x313ec7;});}})[_0x7e6c('0x1e')](respondWithFilteredResult(_0x7028c2,_0xa3bc5b))[_0x7e6c('0x53')](handleError(_0x7028c2,null));};exports[_0x7e6c('0x39')]=function(_0x5ecec1,_0x88f8dc,_0x2a4e48){var _0x32c6ef,_0x1f43e8,_0x259938;if(_[_0x7e6c('0xbe')](_0x5ecec1[_0x7e6c('0x59')][_0x7e6c('0x59')])||_0x5ecec1['body'][_0x7e6c('0x59')]===''){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7e6c('0xbe')](_0x5ecec1[_0x7e6c('0x59')]['to'])){throw new db[(_0x7e6c('0x79'))][(_0x7e6c('0x7a'))](_0x7e6c('0xbf'));}_0x32c6ef=_0x5ecec1[_0x7e6c('0x59')]['to'];return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x5ecec1[_0x7e6c('0x54')]['id']},'include':[{'model':db[_0x7e6c('0x99')],'as':_0x7e6c('0xc0'),'include':[{'model':db[_0x7e6c('0x78')],'as':_0x7e6c('0x9a'),'where':{'mobile':_0x32c6ef},'limit':0x1,'order':[[_0x7e6c('0x7d'),_0x7e6c('0x9b')]]}]}]})[_0x7e6c('0x1e')](handleEntityNotFound(_0x88f8dc,null))[_0x7e6c('0x1e')](function(_0x526780){if(_0x526780&&_0x526780[_0x7e6c('0xc0')]){_0x1f43e8=_0x526780['get']({'plain':!![]});if(_0x1f43e8['List']&&_0x1f43e8['List'][_0x7e6c('0x9a')][_0x7e6c('0x67')]){return _0x1f43e8[_0x7e6c('0xc0')]['Contacts'][0x0];}return db[_0x7e6c('0x78')]['create'](_['defaults'](_0x5ecec1['body'],{'firstName':_0x32c6ef,'mobile':_0x32c6ef,'phone':_0x32c6ef,'ListId':_0x1f43e8['ListId']}));}})['then'](handleEntityNotFound(_0x88f8dc,null))['then'](function(_0x4ccfef){if(_0x4ccfef){_0x259938=_0x4ccfef;return db[_0x7e6c('0x9e')]['find']({'where':{'ContactId':_0x259938['id'],'closed':![],'SmsAccountId':_0x1f43e8['id']}})[_0x7e6c('0x1e')](function(_0x4ab783){if(_0x4ab783){return[_0x4ab783,![]];}return db[_0x7e6c('0x9e')][_0x7e6c('0x58')]({'UserId':_0x5ecec1[_0x7e6c('0x5a')]['id'],'ContactId':_0x259938['id'],'SmsAccountId':_0x1f43e8['id'],'phone':_0x32c6ef,'firstMsgDirection':_0x7e6c('0xc1'),'Messages':[_['merge'](_0x5ecec1[_0x7e6c('0x59')],{'read':![],'body':_0x5ecec1[_0x7e6c('0x59')][_0x7e6c('0x59')],'phone':_0x32c6ef,'SmsAccountId':_0x1f43e8['id'],'UserId':_0x5ecec1[_0x7e6c('0x5a')]['id'],'ContactId':_0x259938['id']})]},{'include':[{'model':db[_0x7e6c('0xa2')],'as':_0x7e6c('0xc2')}]})['then'](function(_0x5f28c0){return[_0x5f28c0,!![]];});});}})[_0x7e6c('0x9f')](function(_0x1ad7cc,_0x175f5b){if(_0x175f5b){return _0x1ad7cc;}return db[_0x7e6c('0xa2')][_0x7e6c('0x58')](_[_0x7e6c('0x4d')](_0x5ecec1[_0x7e6c('0x59')],{'read':![],'body':_0x5ecec1[_0x7e6c('0x59')][_0x7e6c('0x59')],'phone':_0x32c6ef,'SmsAccountId':_0x1f43e8['id'],'SmsInteractionId':_0x1ad7cc['id'],'UserId':_0x5ecec1['user']['id'],'ContactId':_0x259938['id']}))['then'](function(_0x50d9ef){_0x1ad7cc['dataValues'][_0x7e6c('0xc2')]=[];_0x1ad7cc[_0x7e6c('0xc3')][_0x7e6c('0xc2')][_0x7e6c('0xc4')](_0x50d9ef[_0x7e6c('0xc3')]);return _0x1ad7cc;});})[_0x7e6c('0x1e')](respondWithResult(_0x88f8dc,null))['catch'](handleError(_0x88f8dc,null));};exports[_0x7e6c('0x29')]=function(_0x4c5540,_0x5a26c2,_0x3ae806){if(_0x4c5540[_0x7e6c('0x59')]['id']){delete _0x4c5540[_0x7e6c('0x59')]['id'];}var _0x374188,_0x13905e,_0x1a0a7d;return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x4c5540[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x5a26c2,null))[_0x7e6c('0x1e')](function(_0x4a6f2c){if(_0x4a6f2c){_0x1a0a7d=_0x4a6f2c;logger[_0x7e6c('0x20')](_0x7e6c('0xc5'),_0x7e6c('0x29'),'received\x20delivery\x20report\x20from',_0x4a6f2c[_0x7e6c('0x3f')],util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));switch(_0x4a6f2c[_0x7e6c('0x3f')]){case _0x7e6c('0x87'):if(_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xc7')]&&_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x29')]){_0x13905e=_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x29')];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xc7')]}});}break;case _0x7e6c('0xc8'):if(_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xc9')]&&_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xca')]){_0x13905e=_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xca')];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xc9')]}});}break;case'clicksend':if(_0x4c5540[_0x7e6c('0x59')]['message_id']&&_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xcb')]){_0x13905e=_0x4c5540[_0x7e6c('0x59')]['status_code'];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x8a')]}});}break;case _0x7e6c('0x8e'):var _0x14eea8=_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x8f')][0x0];if(_0x14eea8[_0x7e6c('0x85')]&&_0x14eea8[_0x7e6c('0x29')][_0x7e6c('0xcc')]==='DELIVERED'){_0x13905e=_0x14eea8['status'][_0x7e6c('0xcc')];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x14eea8[_0x7e6c('0x85')]}});}break;case _0x7e6c('0xcd'):if(_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x85')]&&_0x4c5540[_0x7e6c('0x59')]['status']){_0x13905e=_0x4c5540[_0x7e6c('0x59')]['status'];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x4c5540[_0x7e6c('0x59')]['messageId']}});}break;case _0x7e6c('0xce'):if(_0x4c5540[_0x7e6c('0x59')][0x0][_0x7e6c('0x24')]['id']){_0x13905e=_0x4c5540['body'][0x0][_0x7e6c('0x3f')];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x4c5540[_0x7e6c('0x59')][0x0][_0x7e6c('0x24')]['id']}});}break;case _0x7e6c('0xcf'):if(_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0xd0')]&&_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x29')]){_0x13905e=_0x4c5540[_0x7e6c('0x59')]['status'];return db[_0x7e6c('0xa2')]['find']({'where':{'messageId':_0x4c5540['body'][_0x7e6c('0xd0')]}});}break;}}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x5a26c2,null))[_0x7e6c('0x1e')](function(_0xe00b3e){if(_0xe00b3e){_0x374188=_0xe00b3e;switch(_0x1a0a7d[_0x7e6c('0x3f')]){case _0x7e6c('0x87'):if(_0x13905e==='DELIVERED'){return _0x374188[_0x7e6c('0x32')]({'read':!![]});}else{logger[_0x7e6c('0x23')](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0x87'),util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0xc8'):if(_0x13905e==='1'){return _0x374188['update']({'read':!![]});}else{logger[_0x7e6c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7e6c('0x29'),'skebby',util[_0x7e6c('0xc6')](_0x4c5540['body'],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0x89'):if(!_0x4c5540[_0x7e6c('0x59')]['error_code']&&_0x13905e>=0xc8&&_0x13905e<=0xce){return _0x374188[_0x7e6c('0x32')]({'read':!![]});}else{logger[_0x7e6c('0x23')](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0x89'),util['inspect'](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0x8e'):var _0x1ad63b=_0x4c5540[_0x7e6c('0x59')][_0x7e6c('0x8f')][0x0];if(_0x1ad63b[_0x7e6c('0x29')][_0x7e6c('0xcc')]==='DELIVERED'){return _0x374188[_0x7e6c('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7e6c('0x29'),_0x7e6c('0x8e'),util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0xcd'):if(_0x13905e==_0x7e6c('0xd1')||_0x13905e==_0x7e6c('0xd2')){return _0x374188['update']({'read':!![]});}else{logger[_0x7e6c('0x23')](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0xcd'),util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0xce'):if(_0x13905e==_0x7e6c('0xd3')){return _0x374188[_0x7e6c('0x32')]({'read':!![]});}else{logger['error'](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0xce'),util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7e6c('0xcf'):if(_0x13905e===_0x7e6c('0xd4')||_0x13905e==='ACCEPTD'){return _0x374188[_0x7e6c('0x32')]({'read':!![]});}else{logger[_0x7e6c('0x23')](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0xcf'),util[_0x7e6c('0xc6')](_0x4c5540[_0x7e6c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x374188;}})[_0x7e6c('0x1e')](respondWithResult(_0x5a26c2,null))[_0x7e6c('0x53')](handleError(_0x5a26c2,null));};exports[_0x7e6c('0xd5')]=function(_0x579dd2,_0x1b88a7,_0x220da4){var _0x27950e,_0x5c2a4e,_0x316e9b;return db[_0x7e6c('0x4f')]['find']({'where':{'id':_0x579dd2[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x1b88a7,null))[_0x7e6c('0x1e')](function(_0x3232b5){if(_0x3232b5){_0x316e9b=_0x3232b5;logger[_0x7e6c('0x20')](_0x7e6c('0xc5'),_0x7e6c('0x29'),_0x7e6c('0xd6'),_0x3232b5[_0x7e6c('0x3f')],util[_0x7e6c('0xc6')](_0x579dd2['query'],{'showHidden':![],'depth':null}));switch(_0x3232b5[_0x7e6c('0x3f')]){case _0x7e6c('0x90'):if(_0x579dd2[_0x7e6c('0x42')][_0x7e6c('0xd7')]&&_0x579dd2['query'][_0x7e6c('0xd8')]){_0x5c2a4e=_0x579dd2['query'][_0x7e6c('0xd8')];return db[_0x7e6c('0xa2')][_0x7e6c('0x57')]({'where':{'messageId':_0x579dd2[_0x7e6c('0x42')][_0x7e6c('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x1b88a7,null))[_0x7e6c('0x1e')](function(_0x42613e){if(_0x42613e){_0x27950e=_0x42613e;switch(_0x316e9b['type']){case _0x7e6c('0x90'):if(_0x5c2a4e==='2'||_0x5c2a4e==='6'){return _0x27950e['update']({'read':!![]});}else{logger[_0x7e6c('0x23')](_0x7e6c('0xc5'),'status',_0x7e6c('0x90'),util[_0x7e6c('0xc6')](_0x579dd2[_0x7e6c('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x27950e;}})[_0x7e6c('0x1e')](respondWithResult(_0x1b88a7,null))[_0x7e6c('0x53')](handleError(_0x1b88a7,null));};exports['addAgents']=function(_0x3f3337,_0x325e4b,_0x209228){return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x3f3337[_0x7e6c('0x54')]['id']}})['then'](handleEntityNotFound(_0x325e4b,null))[_0x7e6c('0x1e')](function(_0x22bcac){if(_0x22bcac){return _0x22bcac[_0x7e6c('0xd9')](_0x3f3337['body']['ids'],_[_0x7e6c('0xda')](_0x3f3337[_0x7e6c('0x59')],['ids','id'])||{})['spread'](function(_0x36d531){for(var _0x25112c=0x0;_0x25112c<_0x3f3337['body'][_0x7e6c('0x6f')]['length'];_0x25112c+=0x1){socket[_0x7e6c('0xdb')](_0x7e6c('0xdc'),{'UserId':Number(_0x3f3337['body'][_0x7e6c('0x6f')][_0x25112c]),'SmsAccountId':Number(_0x3f3337['params']['id'])});}return _0x36d531;});}})[_0x7e6c('0x1e')](respondWithResult(_0x325e4b,null))[_0x7e6c('0x53')](handleError(_0x325e4b,null));};exports[_0x7e6c('0xdd')]=function(_0x34f197,_0x2fdbef,_0x4fc536){return db[_0x7e6c('0x4f')][_0x7e6c('0x57')]({'where':{'id':_0x34f197[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x2fdbef,null))[_0x7e6c('0x1e')](function(_0x19c59e){if(_0x19c59e){return _0x19c59e[_0x7e6c('0xdd')](_0x34f197['query']['ids'])[_0x7e6c('0x1e')](function(){if(_[_0x7e6c('0xde')](_0x34f197[_0x7e6c('0x42')][_0x7e6c('0x6f')])){for(var _0x267a13=0x0;_0x267a13<_0x34f197[_0x7e6c('0x42')][_0x7e6c('0x6f')][_0x7e6c('0x67')];_0x267a13+=0x1){socket[_0x7e6c('0xdb')](_0x7e6c('0xdf'),{'UserId':Number(_0x34f197['query'][_0x7e6c('0x6f')][_0x267a13]),'SmsAccountId':Number(_0x34f197[_0x7e6c('0x54')]['id'])});}}else{socket[_0x7e6c('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x34f197['query'][_0x7e6c('0x6f')]),'SmsAccountId':Number(_0x34f197[_0x7e6c('0x54')]['id'])});}});}})[_0x7e6c('0x1e')](respondWithStatusCode(_0x2fdbef,null))['catch'](handleError(_0x2fdbef,null));};exports['getAgents']=function(_0x598073,_0x1466f0,_0x25392d){var _0x724071={};var _0xb87429={};var _0x54ab39;var _0x4ca0f9;return db[_0x7e6c('0x4f')]['findOne']({'where':{'id':_0x598073[_0x7e6c('0x54')]['id']}})[_0x7e6c('0x1e')](handleEntityNotFound(_0x1466f0,null))[_0x7e6c('0x1e')](function(_0x5c48d1){if(_0x5c48d1){_0x54ab39=_0x5c48d1;_0xb87429['model']=_[_0x7e6c('0x55')](db['User'][_0x7e6c('0x3d')]);_0xb87429[_0x7e6c('0x42')]=_[_0x7e6c('0x55')](_0x598073[_0x7e6c('0x42')]);_0xb87429[_0x7e6c('0x43')]=_['intersection'](_0xb87429[_0x7e6c('0x44')],_0xb87429[_0x7e6c('0x42')]);_0x724071['attributes']=_[_0x7e6c('0x56')](_0xb87429[_0x7e6c('0x44')],qs[_0x7e6c('0x45')](_0x598073[_0x7e6c('0x42')]['fields']));_0x724071[_0x7e6c('0x46')]=_0x724071[_0x7e6c('0x46')][_0x7e6c('0x67')]?_0x724071[_0x7e6c('0x46')]:_0xb87429['model'];_0x724071[_0x7e6c('0x49')]=qs['sort'](_0x598073[_0x7e6c('0x42')][_0x7e6c('0x4a')]);_0x724071['where']=qs[_0x7e6c('0x43')](_[_0x7e6c('0x4b')](_0x598073[_0x7e6c('0x42')],_0xb87429['filters']));if(_0x598073['query'][_0x7e6c('0x69')]){_0x724071['where']=_['merge'](_0x724071[_0x7e6c('0x4c')],{'$or':_[_0x7e6c('0x41')](_0x724071[_0x7e6c('0x46')],function(_0x18b87a){var _0x42222a={};_0x42222a[_0x18b87a]={'$like':'%'+_0x598073['query'][_0x7e6c('0x69')]+'%'};return _0x42222a;})});}_0x724071=_[_0x7e6c('0x4d')]({},_0x724071,_0x598073[_0x7e6c('0x4e')]);return _0x54ab39[_0x7e6c('0xe0')](_0x724071);}})[_0x7e6c('0x1e')](function(_0x28c232){if(_0x28c232){_0x4ca0f9=_0x28c232['length'];if(!_0x598073[_0x7e6c('0x42')][_0x7e6c('0x68')](_0x7e6c('0x47'))){_0x724071[_0x7e6c('0x48')]=qs[_0x7e6c('0x48')](_0x598073[_0x7e6c('0x42')][_0x7e6c('0x48')]);_0x724071[_0x7e6c('0x2a')]=qs['offset'](_0x598073[_0x7e6c('0x42')][_0x7e6c('0x2a')]);}return _0x54ab39['getAgents'](_0x724071);}})['then'](function(_0x2e76f8){if(_0x2e76f8){return _0x2e76f8?{'count':_0x4ca0f9,'rows':_0x2e76f8}:null;}})[_0x7e6c('0x1e')](respondWithResult(_0x1466f0,null))[_0x7e6c('0x53')](handleError(_0x1466f0,null));}; \ No newline at end of file +var _0x4d8b=['client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','get','SmsAccounts','end','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','findAll','rows','show','keys','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','UserProfileResource','update','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','order','sort','ids','getAnswers','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','message_id','plivo','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','text','replyMessageId','refid','from\x20is\x20mandatory','isNil','mapKey','includes','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','created','autoclose','applications','push','unmanaged','*,*,*,*','ContactId','interaction','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','addApplications','sequelize','transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','ACCEPTD','intelepeer','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','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','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise'];(function(_0x4e2a9d,_0x5dbc2e){var _0x317909=function(_0x51981f){while(--_0x51981f){_0x4e2a9d['push'](_0x4e2a9d['shift']());}};_0x317909(++_0x5dbc2e);}(_0x4d8b,0xc1));var _0xb4d8=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x4d8b[_0x12ca5f];return _0xfc3ae9;};'use strict';var emlformat=require(_0xb4d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4d8('0x1'));var jsonpatch=require(_0xb4d8('0x2'));var rp=require(_0xb4d8('0x3'));var moment=require(_0xb4d8('0x4'));var BPromise=require(_0xb4d8('0x5'));var Mustache=require('mustache');var util=require(_0xb4d8('0x6'));var path=require(_0xb4d8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb4d8('0x8'));var fs=require('fs');var fs_extra=require(_0xb4d8('0x9'));var _=require(_0xb4d8('0xa'));var squel=require(_0xb4d8('0xb'));var crypto=require(_0xb4d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb4d8('0xd'));var toCsv=require(_0xb4d8('0xe'));var querystring=require(_0xb4d8('0xf'));var Papa=require('papaparse');var Redis=require(_0xb4d8('0x10'));var authService=require(_0xb4d8('0x11'));var qs=require(_0xb4d8('0x12'));var as=require(_0xb4d8('0x13'));var hardwareService=require(_0xb4d8('0x14'));var logger=require('../../config/logger')(_0xb4d8('0x15'));var utils=require(_0xb4d8('0x16'));var config=require(_0xb4d8('0x17'));var licenseUtil=require(_0xb4d8('0x18'));var db=require(_0xb4d8('0x19'))['db'];config[_0xb4d8('0x1a')]=_[_0xb4d8('0x1b')](config[_0xb4d8('0x1a')],{'host':_0xb4d8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4d8('0x1a')]));require(_0xb4d8('0x1d'))[_0xb4d8('0x1e')](socket);var jayson=require(_0xb4d8('0x1f'));var client=jayson[_0xb4d8('0x20')][_0xb4d8('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x548417,_0x4e627f,_0x4fe67d,_0x23ff9a){return new BPromise(function(_0x4406f6,_0x7d81a0){var _0x46d830=_0x23ff9a||client;return _0x46d830[_0xb4d8('0x22')](_0x548417,_0x4fe67d)[_0xb4d8('0x23')](function(_0x5b9810){logger[_0xb4d8('0x24')](_0xb4d8('0x25'),_0x4e627f,'request\x20sent');logger[_0xb4d8('0x26')](_0xb4d8('0x27'),_0x4e627f,_0xb4d8('0x28'),JSON[_0xb4d8('0x29')](_0x5b9810));if(_0x5b9810[_0xb4d8('0x2a')]){if(_0x5b9810[_0xb4d8('0x2a')]['code']===0x1f4){logger[_0xb4d8('0x2a')](_0xb4d8('0x25'),_0x4e627f,_0x5b9810[_0xb4d8('0x2a')][_0xb4d8('0x2b')]);return _0x7d81a0(_0x5b9810[_0xb4d8('0x2a')][_0xb4d8('0x2b')]);}logger['error'](_0xb4d8('0x25'),_0x4e627f,_0x5b9810[_0xb4d8('0x2a')]['message']);return _0x4406f6(_0x5b9810['error'][_0xb4d8('0x2b')]);}else{logger['info'](_0xb4d8('0x25'),_0x4e627f,_0xb4d8('0x28'));_0x4406f6(_0x5b9810[_0xb4d8('0x2c')]['message']);}})[_0xb4d8('0x2d')](function(_0x244610){logger['error'](_0xb4d8('0x25'),_0x4e627f,_0x244610);_0x7d81a0(_0x244610);});});}function respondWithStatusCode(_0x42398e,_0x223120){_0x223120=_0x223120||0xcc;return function(_0x205449){if(_0x205449){return _0x42398e[_0xb4d8('0x2e')](_0x223120);}return _0x42398e[_0xb4d8('0x2f')](_0x223120)['end']();};}function respondWithResult(_0x551129,_0x1469d6){_0x1469d6=_0x1469d6||0xc8;return function(_0x510ac4){if(_0x510ac4){return _0x551129[_0xb4d8('0x2f')](_0x1469d6)['json'](_0x510ac4);}};}function respondWithFilteredResult(_0x35b2ce,_0xb1943d){return function(_0x4509ef){if(_0x4509ef){var _0x3498e1=typeof _0xb1943d[_0xb4d8('0x30')]===_0xb4d8('0x31')&&typeof _0xb1943d[_0xb4d8('0x32')]===_0xb4d8('0x31');var _0x4abc2e=_0x4509ef[_0xb4d8('0x33')];var _0x360237=_0x3498e1?0x0:_0xb1943d[_0xb4d8('0x30')];var _0x1b153c=_0x3498e1?_0x4509ef['count']:_0xb1943d['offset']+_0xb1943d[_0xb4d8('0x32')];var _0x4a6c65;if(_0x1b153c>=_0x4abc2e){_0x1b153c=_0x4abc2e;_0x4a6c65=0xc8;}else{_0x4a6c65=0xce;}_0x35b2ce[_0xb4d8('0x2f')](_0x4a6c65);return _0x35b2ce['set'](_0xb4d8('0x34'),_0x360237+'-'+_0x1b153c+'/'+_0x4abc2e)[_0xb4d8('0x35')](_0x4509ef);}return null;};}function patchUpdates(_0x38d7d5){return function(_0x260a50){try{jsonpatch[_0xb4d8('0x36')](_0x260a50,_0x38d7d5,!![]);}catch(_0x3947cf){return BPromise['reject'](_0x3947cf);}return _0x260a50[_0xb4d8('0x37')]();};}function saveUpdates(_0x50dafc,_0x7f0185){return function(_0x40dc0b){if(_0x40dc0b){return _0x40dc0b['update'](_0x50dafc)[_0xb4d8('0x23')](function(_0x43e187){return _0x43e187;});}return null;};}function removeEntity(_0x3f811f,_0x3a6658){return function(_0x3c910a){if(_0x3c910a){return _0x3c910a[_0xb4d8('0x38')]()[_0xb4d8('0x23')](function(){var _0x2edb95=_0x3c910a[_0xb4d8('0x39')]({'plain':!![]});var _0x48ca10=_0xb4d8('0x3a');return db['UserProfileResource'][_0xb4d8('0x38')]({'where':{'type':_0x48ca10,'resourceId':_0x2edb95['id']}})['then'](function(){return _0x3c910a;});})[_0xb4d8('0x23')](function(){_0x3f811f[_0xb4d8('0x2f')](0xcc)[_0xb4d8('0x3b')]();});}};}function handleEntityNotFound(_0x22e83d,_0x26bf32){return function(_0x3a35e9){if(!_0x3a35e9){_0x22e83d[_0xb4d8('0x2e')](0x194);}return _0x3a35e9;};}function handleError(_0x389c22,_0x5c7dca){_0x5c7dca=_0x5c7dca||0x1f4;return function(_0x3230ef){logger[_0xb4d8('0x2a')](_0x3230ef['stack']);if(_0x3230ef['name']){delete _0x3230ef[_0xb4d8('0x3c')];}_0x389c22['status'](_0x5c7dca)[_0xb4d8('0x3d')](_0x3230ef);};}exports[_0xb4d8('0x3e')]=function(_0x4fb380,_0x194b30){var _0x394bac={'include':[{'model':db[_0xb4d8('0x3f')],'as':_0xb4d8('0x40')}]},_0x153182={},_0x27bb8e={'count':0x0,'rows':[]};var _0x56c39f=_['map'](db[_0xb4d8('0x41')][_0xb4d8('0x42')],function(_0x3f8bae){return{'name':_0x3f8bae[_0xb4d8('0x43')],'type':_0x3f8bae[_0xb4d8('0x44')]['key']};});_0x153182['model']=_[_0xb4d8('0x45')](_0x56c39f,_0xb4d8('0x3c'));_0x153182[_0xb4d8('0x46')]=_['keys'](_0x4fb380[_0xb4d8('0x46')]);_0x153182[_0xb4d8('0x47')]=_[_0xb4d8('0x48')](_0x153182[_0xb4d8('0x49')],_0x153182[_0xb4d8('0x46')]);_0x394bac[_0xb4d8('0x4a')]=_[_0xb4d8('0x48')](_0x153182['model'],qs[_0xb4d8('0x4b')](_0x4fb380['query'][_0xb4d8('0x4b')]));_0x394bac[_0xb4d8('0x4a')]=_0x394bac['attributes'][_0xb4d8('0x4c')]?_0x394bac['attributes']:_0x153182[_0xb4d8('0x49')];if(!_0x4fb380['query'][_0xb4d8('0x4d')](_0xb4d8('0x4e'))){_0x394bac[_0xb4d8('0x32')]=qs['limit'](_0x4fb380[_0xb4d8('0x46')]['limit']);_0x394bac['offset']=qs[_0xb4d8('0x30')](_0x4fb380['query'][_0xb4d8('0x30')]);}_0x394bac['order']=qs['sort'](_0x4fb380[_0xb4d8('0x46')]['sort']);_0x394bac[_0xb4d8('0x4f')]=qs[_0xb4d8('0x47')](_[_0xb4d8('0x50')](_0x4fb380[_0xb4d8('0x46')],_0x153182['filters']),_0x56c39f);if(_0x4fb380[_0xb4d8('0x46')][_0xb4d8('0x51')]){_0x394bac[_0xb4d8('0x4f')]=_['merge'](_0x394bac[_0xb4d8('0x4f')],{'$or':_[_0xb4d8('0x45')](_0x56c39f,function(_0x3d3da4){if(_0x3d3da4[_0xb4d8('0x44')]!=='VIRTUAL'){var _0x1f7a69={};_0x1f7a69[_0x3d3da4['name']]={'$like':'%'+_0x4fb380[_0xb4d8('0x46')][_0xb4d8('0x51')]+'%'};return _0x1f7a69;}})});}_0x394bac=_[_0xb4d8('0x52')]({},_0x394bac,_0x4fb380[_0xb4d8('0x53')]);var _0x173185={'where':_0x394bac[_0xb4d8('0x4f')]};return db[_0xb4d8('0x41')][_0xb4d8('0x33')](_0x173185)['then'](function(_0x523d5b){_0x27bb8e['count']=_0x523d5b;if(_0x4fb380[_0xb4d8('0x46')]['includeAll']){_0x394bac['include']=[{'all':!![]}];}return db[_0xb4d8('0x41')][_0xb4d8('0x54')](_0x394bac);})[_0xb4d8('0x23')](function(_0x483e99){_0x27bb8e[_0xb4d8('0x55')]=_0x483e99;return _0x27bb8e;})[_0xb4d8('0x23')](respondWithFilteredResult(_0x194b30,_0x394bac))[_0xb4d8('0x2d')](handleError(_0x194b30,null));};exports[_0xb4d8('0x56')]=function(_0x4a8e44,_0x519553){var _0x71ce79={'raw':![],'where':{'id':_0x4a8e44['params']['id']},'include':[{'model':db[_0xb4d8('0x3f')],'as':'mandatoryDispositionPause'}]},_0x179b0e={};_0x179b0e[_0xb4d8('0x49')]=_[_0xb4d8('0x57')](db[_0xb4d8('0x41')]['rawAttributes']);_0x179b0e[_0xb4d8('0x46')]=_[_0xb4d8('0x57')](_0x4a8e44['query']);_0x179b0e['filters']=_[_0xb4d8('0x48')](_0x179b0e[_0xb4d8('0x49')],_0x179b0e[_0xb4d8('0x46')]);_0x71ce79['attributes']=_[_0xb4d8('0x48')](_0x179b0e['model'],qs[_0xb4d8('0x4b')](_0x4a8e44[_0xb4d8('0x46')][_0xb4d8('0x4b')]));_0x71ce79['attributes']=_0x71ce79['attributes'][_0xb4d8('0x4c')]?_0x71ce79[_0xb4d8('0x4a')]:_0x179b0e[_0xb4d8('0x49')];if(_0x4a8e44[_0xb4d8('0x46')][_0xb4d8('0x58')]){_0x71ce79[_0xb4d8('0x59')]=[{'all':!![]}];}_0x71ce79=_['merge']({},_0x71ce79,_0x4a8e44[_0xb4d8('0x53')]);return db[_0xb4d8('0x41')]['find'](_0x71ce79)['then'](handleEntityNotFound(_0x519553,null))[_0xb4d8('0x23')](respondWithResult(_0x519553,null))[_0xb4d8('0x2d')](handleError(_0x519553,null));};exports[_0xb4d8('0x5a')]=function(_0x1c7681,_0x1b8191){return db[_0xb4d8('0x41')][_0xb4d8('0x5a')](_0x1c7681[_0xb4d8('0x5b')],{})[_0xb4d8('0x23')](function(_0x5196f9){var _0x3192e5=_0x1c7681['user'][_0xb4d8('0x39')]({'plain':!![]});if(!_0x3192e5)throw new Error(_0xb4d8('0x5c'));if(_0x3192e5['role']===_0xb4d8('0x5d')){var _0x57f544=_0x5196f9[_0xb4d8('0x39')]({'plain':!![]});var _0x5d59e7='SmsAccounts';return db['UserProfileSection'][_0xb4d8('0x5e')]({'where':{'name':_0x5d59e7,'userProfileId':_0x3192e5['userProfileId']},'raw':!![]})['then'](function(_0x546ab1){if(_0x546ab1&&_0x546ab1['autoAssociation']===0x0){return db[_0xb4d8('0x5f')][_0xb4d8('0x5a')]({'name':_0x57f544[_0xb4d8('0x3c')],'resourceId':_0x57f544['id'],'type':_0x546ab1[_0xb4d8('0x3c')],'sectionId':_0x546ab1['id']},{})['then'](function(){return _0x5196f9;});}else{return _0x5196f9;}})[_0xb4d8('0x2d')](function(_0x4a1656){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a1656);throw _0x4a1656;});}return _0x5196f9;})[_0xb4d8('0x23')](respondWithResult(_0x1b8191,0xc9))[_0xb4d8('0x2d')](handleError(_0x1b8191,null));};exports[_0xb4d8('0x60')]=function(_0x36ce6e,_0x853bc1){if(_0x36ce6e[_0xb4d8('0x5b')]['id']){delete _0x36ce6e[_0xb4d8('0x5b')]['id'];}return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x36ce6e[_0xb4d8('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0xb4d8('0x40')}]})[_0xb4d8('0x23')](handleEntityNotFound(_0x853bc1,null))[_0xb4d8('0x23')](saveUpdates(_0x36ce6e[_0xb4d8('0x5b')],null))[_0xb4d8('0x23')](respondWithResult(_0x853bc1,null))['catch'](handleError(_0x853bc1,null));};exports[_0xb4d8('0x38')]=function(_0x22a9d5,_0x494435){return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x22a9d5[_0xb4d8('0x61')]['id']}})['then'](handleEntityNotFound(_0x494435,null))[_0xb4d8('0x23')](removeEntity(_0x494435,null))[_0xb4d8('0x2d')](handleError(_0x494435,null));};exports[_0xb4d8('0x62')]=function(_0x32a549,_0x2081dc){return db[_0xb4d8('0x41')][_0xb4d8('0x62')]()[_0xb4d8('0x23')](respondWithResult(_0x2081dc,null))[_0xb4d8('0x2d')](handleError(_0x2081dc,null));};exports[_0xb4d8('0x63')]=function(_0x2cad23,_0x4536fe,_0x3b8c21){if(_0x2cad23['body']['id']){delete _0x2cad23['body']['id'];}return db[_0xb4d8('0x41')]['find']({'where':{'id':_0x2cad23['params']['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x4536fe,null))['then'](function(_0xc402b8){if(_0xc402b8){_0x2cad23['body'][_0xb4d8('0x64')]=_0xc402b8['id'];return db[_0xb4d8('0x65')][_0xb4d8('0x5a')](_0x2cad23[_0xb4d8('0x5b')]);}})['then'](respondWithResult(_0x4536fe,null))[_0xb4d8('0x2d')](handleError(_0x4536fe,null));};exports[_0xb4d8('0x66')]=function(_0x1447e7,_0x3dce41,_0x1fe56d){var _0x322ed6={'raw':![],'where':{}};var _0x1f31fc={};var _0x8c4273={'count':0x0,'rows':[]};return db[_0xb4d8('0x41')][_0xb4d8('0x67')]({'where':{'id':_0x1447e7[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x3dce41,null))['then'](function(_0x5eb540){if(_0x5eb540){_0x1f31fc[_0xb4d8('0x49')]=_[_0xb4d8('0x57')](db['Disposition']['rawAttributes']);_0x1f31fc['query']=_[_0xb4d8('0x57')](_0x1447e7[_0xb4d8('0x46')]);_0x1f31fc[_0xb4d8('0x47')]=_['intersection'](_0x1f31fc[_0xb4d8('0x49')],_0x1f31fc[_0xb4d8('0x46')]);_0x322ed6['attributes']=_[_0xb4d8('0x48')](_0x1f31fc[_0xb4d8('0x49')],qs[_0xb4d8('0x4b')](_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x4b')]));_0x322ed6['attributes']=_0x322ed6[_0xb4d8('0x4a')][_0xb4d8('0x4c')]?_0x322ed6[_0xb4d8('0x4a')]:_0x1f31fc['model'];if(!_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x4d')](_0xb4d8('0x4e'))){_0x322ed6[_0xb4d8('0x32')]=qs['limit'](_0x1447e7['query'][_0xb4d8('0x32')]);_0x322ed6['offset']=qs[_0xb4d8('0x30')](_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x30')]);}_0x322ed6[_0xb4d8('0x68')]=qs[_0xb4d8('0x69')](_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x69')]);_0x322ed6[_0xb4d8('0x4f')]=qs[_0xb4d8('0x47')](_[_0xb4d8('0x50')](_0x1447e7[_0xb4d8('0x46')],_0x1f31fc[_0xb4d8('0x47')]));_0x322ed6[_0xb4d8('0x4f')][_0xb4d8('0x64')]=_0x5eb540['id'];if(_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x51')]){_0x322ed6[_0xb4d8('0x4f')]=_[_0xb4d8('0x52')](_0x322ed6[_0xb4d8('0x4f')],{'$or':_[_0xb4d8('0x45')](_0x322ed6['attributes'],function(_0x58a93d){var _0x2b6a0d={};_0x2b6a0d[_0x58a93d]={'$like':'%'+_0x1447e7[_0xb4d8('0x46')]['filter']+'%'};return _0x2b6a0d;})});}_0x322ed6=_['merge']({},_0x322ed6,_0x1447e7['options']);return db[_0xb4d8('0x65')][_0xb4d8('0x33')]({'where':_0x322ed6[_0xb4d8('0x4f')]})[_0xb4d8('0x23')](function(_0x35f4c6){_0x8c4273[_0xb4d8('0x33')]=_0x35f4c6;if(_0x1447e7[_0xb4d8('0x46')][_0xb4d8('0x58')]){_0x322ed6[_0xb4d8('0x59')]=[{'all':!![]}];}return db[_0xb4d8('0x65')]['findAll'](_0x322ed6);})[_0xb4d8('0x23')](function(_0x3d233d){_0x8c4273[_0xb4d8('0x55')]=_0x3d233d;return _0x8c4273;});}})[_0xb4d8('0x23')](respondWithFilteredResult(_0x3dce41,_0x322ed6))[_0xb4d8('0x2d')](handleError(_0x3dce41,null));};exports['removeDispositions']=function(_0x5ad716,_0x301dae,_0x185713){return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x5ad716['params']['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x301dae,null))[_0xb4d8('0x23')](function(_0x51d174){if(_0x51d174){return _0x51d174['removeDispositions'](_0x5ad716[_0xb4d8('0x46')][_0xb4d8('0x6a')]);}})[_0xb4d8('0x23')](respondWithStatusCode(_0x301dae,null))[_0xb4d8('0x2d')](handleError(_0x301dae,null));};exports['addAnswer']=function(_0x31e968,_0x37bbcf,_0x3a5d70){if(_0x31e968[_0xb4d8('0x5b')]['id']){delete _0x31e968[_0xb4d8('0x5b')]['id'];}return db['SmsAccount'][_0xb4d8('0x5e')]({'where':{'id':_0x31e968[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x37bbcf,null))[_0xb4d8('0x23')](function(_0x159769){if(_0x159769){_0x31e968[_0xb4d8('0x5b')][_0xb4d8('0x64')]=_0x159769['id'];return db['CannedAnswer'][_0xb4d8('0x5a')](_0x31e968['body']);}})[_0xb4d8('0x23')](respondWithResult(_0x37bbcf,null))[_0xb4d8('0x2d')](handleError(_0x37bbcf,null));};exports[_0xb4d8('0x6b')]=function(_0x532569,_0x53ec3f,_0x2b74be){var _0x2951cd={'raw':![],'where':{}};var _0x1856b4={};var _0x2c782f={'count':0x0,'rows':[]};return db[_0xb4d8('0x41')][_0xb4d8('0x67')]({'where':{'id':_0x532569[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x53ec3f,null))[_0xb4d8('0x23')](function(_0x2e88d2){if(_0x2e88d2){_0x1856b4[_0xb4d8('0x49')]=_['keys'](db[_0xb4d8('0x6c')][_0xb4d8('0x42')]);_0x1856b4[_0xb4d8('0x46')]=_[_0xb4d8('0x57')](_0x532569[_0xb4d8('0x46')]);_0x1856b4[_0xb4d8('0x47')]=_[_0xb4d8('0x48')](_0x1856b4['model'],_0x1856b4[_0xb4d8('0x46')]);_0x2951cd[_0xb4d8('0x4a')]=_[_0xb4d8('0x48')](_0x1856b4[_0xb4d8('0x49')],qs['fields'](_0x532569[_0xb4d8('0x46')][_0xb4d8('0x4b')]));_0x2951cd[_0xb4d8('0x4a')]=_0x2951cd[_0xb4d8('0x4a')][_0xb4d8('0x4c')]?_0x2951cd[_0xb4d8('0x4a')]:_0x1856b4['model'];if(!_0x532569[_0xb4d8('0x46')]['hasOwnProperty']('nolimit')){_0x2951cd['limit']=qs['limit'](_0x532569[_0xb4d8('0x46')][_0xb4d8('0x32')]);_0x2951cd[_0xb4d8('0x30')]=qs[_0xb4d8('0x30')](_0x532569[_0xb4d8('0x46')][_0xb4d8('0x30')]);}_0x2951cd['order']=qs[_0xb4d8('0x69')](_0x532569['query']['sort']);_0x2951cd[_0xb4d8('0x4f')]=qs[_0xb4d8('0x47')](_[_0xb4d8('0x50')](_0x532569[_0xb4d8('0x46')],_0x1856b4[_0xb4d8('0x47')]));_0x2951cd['where'][_0xb4d8('0x64')]=_0x2e88d2['id'];if(_0x532569['query'][_0xb4d8('0x51')]){_0x2951cd[_0xb4d8('0x4f')]=_[_0xb4d8('0x52')](_0x2951cd[_0xb4d8('0x4f')],{'$or':_[_0xb4d8('0x45')](_0x2951cd[_0xb4d8('0x4a')],function(_0x5cedd4){var _0xf30fe={};_0xf30fe[_0x5cedd4]={'$like':'%'+_0x532569[_0xb4d8('0x46')][_0xb4d8('0x51')]+'%'};return _0xf30fe;})});}_0x2951cd=_[_0xb4d8('0x52')]({},_0x2951cd,_0x532569[_0xb4d8('0x53')]);return db['CannedAnswer'][_0xb4d8('0x33')]({'where':_0x2951cd[_0xb4d8('0x4f')]})[_0xb4d8('0x23')](function(_0x24c857){_0x2c782f[_0xb4d8('0x33')]=_0x24c857;if(_0x532569[_0xb4d8('0x46')][_0xb4d8('0x58')]){_0x2951cd[_0xb4d8('0x59')]=[{'all':!![]}];}return db[_0xb4d8('0x6c')][_0xb4d8('0x54')](_0x2951cd);})[_0xb4d8('0x23')](function(_0x155bd3){_0x2c782f['rows']=_0x155bd3;return _0x2c782f;});}})[_0xb4d8('0x23')](respondWithFilteredResult(_0x53ec3f,_0x2951cd))['catch'](handleError(_0x53ec3f,null));};exports[_0xb4d8('0x6d')]=function(_0x280c12,_0x4a72d4,_0x46d56f){return db['SmsAccount'][_0xb4d8('0x5e')]({'where':{'id':_0x280c12[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x4a72d4,null))[_0xb4d8('0x23')](function(_0x48ff95){if(_0x48ff95){return _0x48ff95['removeAnswers'](_0x280c12['query'][_0xb4d8('0x6a')]);}})[_0xb4d8('0x23')](respondWithStatusCode(_0x4a72d4,null))[_0xb4d8('0x2d')](handleError(_0x4a72d4,null));};exports['notify']=function(_0x31eafb,_0x36ea3c,_0x2edfab){var _0xd948ad={'channel':_0xb4d8('0x6e')};var _0xee8a25=[];var _0x28589d=[];var _0x5d0aeb={};return db['SmsAccount'][_0xb4d8('0x5e')]({'where':{'id':_0x31eafb[_0xb4d8('0x61')]['id']},'include':[{'model':db[_0xb4d8('0x6f')],'as':_0xb4d8('0x70')}]})[_0xb4d8('0x23')](handleEntityNotFound(_0x36ea3c,null))['then'](function(_0x3b62ee){_0xd948ad[_0xb4d8('0x71')]=_0x3b62ee;_0xd948ad['applications']=_[_0xb4d8('0x72')](_0x3b62ee['Applications'],['priority'],[_0xb4d8('0x73')]);if(_0xd948ad[_0xb4d8('0x71')][_0xb4d8('0x70')]){delete _0xd948ad[_0xb4d8('0x71')]['Applications'];}return db[_0xb4d8('0x74')]['describe']();})[_0xb4d8('0x23')](function(_0x36a24f){if(!_0x36a24f){throw new db[(_0xb4d8('0x75'))][(_0xb4d8('0x76'))](_0xb4d8('0x77'));}_0xee8a25=_['difference'](_[_0xb4d8('0x57')](_0x36a24f),['createdAt',_0xb4d8('0x78')]);_0x28589d=_[_0xb4d8('0x79')](_[_0xb4d8('0x57')](_0x36a24f),[_0xb4d8('0x7a'),_0xb4d8('0x78'),_0xb4d8('0x7b'),'ListId']);_0xd948ad['body']={'mapKey':_0xb4d8('0x7c')};if(_0xd948ad['account']['type']){switch(_0xd948ad[_0xb4d8('0x71')][_0xb4d8('0x44')]){case _0xb4d8('0x7d'):_0xd948ad['body'][_0xb4d8('0x7e')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x7f')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x80')];_0xd948ad['body'][_0xb4d8('0x81')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x82')];break;case _0xb4d8('0x83'):_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]='+'+_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x84')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')]['text'];break;case _0xb4d8('0x85'):_0xd948ad[_0xb4d8('0x5b')]['from']=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x7e')];_0xd948ad['body'][_0xb4d8('0x5b')]=_0x31eafb['body'][_0xb4d8('0x2b')];break;case'clicksend':_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]=_0x31eafb['body']['from'];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x5b')];_0xd948ad['body']['messageId']=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x86')];break;case _0xb4d8('0x87'):_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]=_0x31eafb['body'][_0xb4d8('0x7f')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x88')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x81')]=_0x31eafb[_0xb4d8('0x5b')]['MessageUUID'];break;case _0xb4d8('0x89'):_0xd948ad[_0xb4d8('0x5b')]['from']='+'+_0x31eafb['body'][_0xb4d8('0x8a')][0x0][_0xb4d8('0x7e')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')]['results'][0x0]['text'];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x81')]=_0x31eafb['body'][_0xb4d8('0x8a')][0x0][_0xb4d8('0x81')];break;case _0xb4d8('0x8b'):_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]=_0x31eafb['body'][_0xb4d8('0x8c')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')]['segmentedMessage'][_0xb4d8('0x2b')];break;case _0xb4d8('0x8d'):_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x8e')];_0xd948ad[_0xb4d8('0x5b')]['body']=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x8f')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x81')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x90')];break;case'bandwidth':_0xd948ad['body'][_0xb4d8('0x81')]=_0x31eafb[_0xb4d8('0x5b')][0x0][_0xb4d8('0x2b')]['id'];_0xd948ad[_0xb4d8('0x5b')]['from']=_0x31eafb[_0xb4d8('0x5b')][0x0][_0xb4d8('0x2b')][_0xb4d8('0x7e')];_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')][0x0][_0xb4d8('0x2b')][_0xb4d8('0x8f')];break;case'intelepeer':_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x7e')];_0xd948ad['body'][_0xb4d8('0x5b')]=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x2b')];_0xd948ad[_0xb4d8('0x5b')]['messageId']=_0x31eafb[_0xb4d8('0x5b')][_0xb4d8('0x91')];break;}}if(_0xd948ad[_0xb4d8('0x5b')]['id']){delete _0xd948ad['body']['id'];}if(_['isNil'](_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')])){throw new db[(_0xb4d8('0x75'))][(_0xb4d8('0x76'))](_0xb4d8('0x92'));}if(_[_0xb4d8('0x93')](_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')])||_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')]===''){throw new db[(_0xb4d8('0x75'))][(_0xb4d8('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb4d8('0x93')](_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x94')])){throw new db['Sequelize'][(_0xb4d8('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28589d);}if(!_[_0xb4d8('0x95')](_0x28589d,_0xd948ad[_0xb4d8('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0xb4d8('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28589d);}_0x5d0aeb[_0xd948ad[_0xb4d8('0x5b')]['mapKey']]=_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')];return db['CmList'][_0xb4d8('0x5e')]({'where':{'id':_0xd948ad[_0xb4d8('0x71')][_0xb4d8('0x96')]},'include':[{'model':db[_0xb4d8('0x74')],'as':_0xb4d8('0x97'),'where':_0x5d0aeb,'limit':0x1,'order':[[_0xb4d8('0x78'),_0xb4d8('0x98')]]}]});})[_0xb4d8('0x23')](handleEntityNotFound(_0x36ea3c,null))[_0xb4d8('0x23')](function(_0x55518a){if(_0x55518a){_0xd948ad[_0xb4d8('0x99')]=_[_0xb4d8('0x9a')](_0x55518a,[_0xb4d8('0x97')]);if(_0x55518a['Contacts'][_0xb4d8('0x4c')]){return _0x55518a[_0xb4d8('0x97')][0x0];}var _0x4e0ced=_[_0xb4d8('0x1b')](_0xd948ad[_0xb4d8('0x5b')],{'firstName':_0xd948ad['body'][_0xb4d8('0x7e')],'ListId':_0x55518a['id']});_0x4e0ced[_0xd948ad[_0xb4d8('0x5b')]['mapKey']]=_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')];return db[_0xb4d8('0x74')]['create'](_0x4e0ced,{'fields':_0xee8a25,'raw':!![]});}})[_0xb4d8('0x23')](handleEntityNotFound(_0x36ea3c,null))[_0xb4d8('0x23')](function(_0x28bd33){if(_0x28bd33){_0xd948ad[_0xb4d8('0x9b')]=_0x28bd33;var _0x2bde82={'ContactId':_0x28bd33['id'],'phone':_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x7e')],'SmsAccountId':_0x31eafb[_0xb4d8('0x61')]['id']};var _0x3426f8={'ContactId':_0x28bd33['id'],'SmsAccountId':_0x31eafb['params']['id'],'closed':![]};return db[_0xb4d8('0x9c')][_0xb4d8('0x5e')]({'where':_0x3426f8})[_0xb4d8('0x23')](function(_0x199faa){if(_0x199faa){return[_0x199faa,![]];}return db[_0xb4d8('0x9c')][_0xb4d8('0x5a')](_0x2bde82)[_0xb4d8('0x23')](function(_0x317700){return[_0x317700,!![]];});});}})['spread'](function(_0x3ea322,_0x4f71f9){_0xd948ad['interaction']=_0x3ea322[_0xb4d8('0x39')]({'plain':!![]});_0xd948ad['interaction'][_0xb4d8('0x9d')]=![];if(_0x4f71f9){if(_0xd948ad[_0xb4d8('0x71')][_0xb4d8('0x9e')]){_0xd948ad[_0xb4d8('0x9f')][_0xb4d8('0xa0')]({'id':0x0,'priority':_0xd948ad[_0xb4d8('0x9f')]['length']+0x1,'app':'close','appdata':_0xb4d8('0xa1'),'interval':_0xb4d8('0xa2')});}_0xd948ad['interaction']['created']=!![];}return db['SmsMessage'][_0xb4d8('0x5a')]({'phone':_0xd948ad['body']['from'],'messageId':_0xd948ad[_0xb4d8('0x5b')]['messageId'],'body':_0xd948ad[_0xb4d8('0x5b')][_0xb4d8('0x5b')],'SmsAccountId':_0x31eafb['params']['id'],'SmsInteractionId':_0x3ea322['id'],'direction':'in','ContactId':_0x3ea322[_0xb4d8('0xa3')],'AttachmentId':_0xd948ad[_0xb4d8('0x5b')]['AttachmentId']});})[_0xb4d8('0x23')](function(_0xf72414){_0xd948ad['message']=_0xf72414;if(_0xd948ad[_0xb4d8('0xa4')][_0xb4d8('0xa5')]){return db[_0xb4d8('0xa6')][_0xb4d8('0x5e')]({'attributes':['id',_0xb4d8('0x3c')],'where':{'id':_0xd948ad[_0xb4d8('0xa4')]['UserId']}})[_0xb4d8('0x23')](function(_0x277e41){if(_0x277e41){_0xd948ad[_0xb4d8('0x9f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb4d8('0xa7'),'appdata':_0x277e41['name']+','+(_0xd948ad['account'][_0xb4d8('0xa8')]||0xa),'interval':_0xb4d8('0xa2')});}return respondWithRpcPromise(_0xb4d8('0xa9'),_0xb4d8('0xaa'),_0xd948ad);});}return respondWithRpcPromise(_0xb4d8('0xa9'),_0xb4d8('0xaa'),_0xd948ad);})[_0xb4d8('0x23')](function(_0x202e41){if(_0x202e41){var _0x33d3ec=0xc8;var _0x5b6926=_0xb4d8('0xab');logger[_0xb4d8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5b6926,_0x33d3ec,'entity\x20found');logger[_0xb4d8('0x26')](_0xb4d8('0xac'),_0x5b6926,_0x33d3ec,_0xb4d8('0xad'),JSON[_0xb4d8('0x29')](_0x202e41));if(_0xd948ad[_0xb4d8('0x71')][_0xb4d8('0x44')]===_0xb4d8('0x7d')){return _0x36ea3c[_0xb4d8('0x2f')](_0x33d3ec)[_0xb4d8('0xae')](_0xb4d8('0xaf'),_0xb4d8('0xb0'))[_0xb4d8('0x3d')]('\x0a');}else{return _0x36ea3c['status'](_0x33d3ec)[_0xb4d8('0x35')](_0x202e41);}}})[_0xb4d8('0x2d')](handleError(_0x36ea3c,null));};exports[_0xb4d8('0xb1')]=function(_0x349847,_0x20cc29){var _0xa89483=_0x349847[_0xb4d8('0x61')]['id'];var _0x2c9c42=_0x349847['body'];var _0x4b2ac3=0xc8;var _0x2ab6a6=null;return db[_0xb4d8('0xb2')][_0xb4d8('0xb3')]({'isolationLevel':db[_0xb4d8('0xb2')]['Transaction'][_0xb4d8('0xb4')]['READ_COMMITTED']},function(_0x192a58){return db[_0xb4d8('0x41')]['findOne']({'where':{'id':_0xa89483},'transaction':_0x192a58})[_0xb4d8('0x23')](function(_0x5bc148){if(_0x5bc148){return db['SmsApplication'][_0xb4d8('0x38')]({'where':{'SmsAccountId':_0xa89483},'transaction':_0x192a58})['then'](function(){var _0x35ea11=_[_0xb4d8('0x45')](_0x2c9c42,function(_0x3afe10){_0x3afe10['SmsAccountId']=_0xa89483;return _0x3afe10;});return db[_0xb4d8('0x6f')]['bulkCreate'](_0x35ea11,{'transaction':_0x192a58});});}else{_0x4b2ac3=0x194;_0x2ab6a6=[];}});})[_0xb4d8('0x23')](function(){if(_0x4b2ac3!==0x194){return db[_0xb4d8('0x6f')][_0xb4d8('0xb5')]({'where':{'SmsAccountId':_0xa89483},'order':'priority'})[_0xb4d8('0x23')](function(_0x4e397b){_0x2ab6a6=_0x4e397b;});}})[_0xb4d8('0x2d')](function(_0x38c41f){_0x4b2ac3=0x1f4;logger[_0xb4d8('0x2a')](_0x38c41f[_0xb4d8('0xb6')]);if(_0x38c41f['name']){delete _0x38c41f['name'];}_0x2ab6a6=_0x38c41f;})[_0xb4d8('0xb7')](function(){if(_0x2ab6a6===null){_0x20cc29['sendStatus'](_0x4b2ac3);}else{if(_0x4b2ac3===0x1f4){_0x20cc29[_0xb4d8('0x2f')](_0x4b2ac3)['send'](_0x2ab6a6);}else{_0x20cc29[_0xb4d8('0x2f')](_0x4b2ac3)[_0xb4d8('0x35')](_0x2ab6a6);}}});};exports[_0xb4d8('0xb8')]=function(_0x13d5d7,_0x135d03,_0x2dbaa4){var _0x1c0cbc={};var _0x1988da={};var _0x2d210e;var _0x3506bf;return db['SmsAccount'][_0xb4d8('0x67')]({'where':{'id':_0x13d5d7['params']['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x135d03,null))[_0xb4d8('0x23')](function(_0x256a58){if(_0x256a58){_0x2d210e=_0x256a58;_0x1988da[_0xb4d8('0x49')]=_[_0xb4d8('0x57')](db[_0xb4d8('0x6f')][_0xb4d8('0x42')]);_0x1988da[_0xb4d8('0x46')]=_[_0xb4d8('0x57')](_0x13d5d7['query']);_0x1988da[_0xb4d8('0x47')]=_[_0xb4d8('0x48')](_0x1988da[_0xb4d8('0x49')],_0x1988da[_0xb4d8('0x46')]);_0x1c0cbc[_0xb4d8('0x4a')]=_[_0xb4d8('0x48')](_0x1988da[_0xb4d8('0x49')],qs[_0xb4d8('0x4b')](_0x13d5d7['query'][_0xb4d8('0x4b')]));_0x1c0cbc[_0xb4d8('0x4a')]=_0x1c0cbc[_0xb4d8('0x4a')][_0xb4d8('0x4c')]?_0x1c0cbc[_0xb4d8('0x4a')]:_0x1988da[_0xb4d8('0x49')];_0x1c0cbc['order']=qs[_0xb4d8('0x69')](_0x13d5d7[_0xb4d8('0x46')]['sort']);_0x1c0cbc['where']=qs[_0xb4d8('0x47')](_[_0xb4d8('0x50')](_0x13d5d7[_0xb4d8('0x46')],_0x1988da[_0xb4d8('0x47')]));if(_0x13d5d7['query'][_0xb4d8('0x51')]){_0x1c0cbc['where']=_[_0xb4d8('0x52')](_0x1c0cbc['where'],{'$or':_[_0xb4d8('0x45')](_0x1c0cbc[_0xb4d8('0x4a')],function(_0x381223){var _0x24eb19={};_0x24eb19[_0x381223]={'$like':'%'+_0x13d5d7['query'][_0xb4d8('0x51')]+'%'};return _0x24eb19;})});}_0x1c0cbc=_[_0xb4d8('0x52')]({},_0x1c0cbc,_0x13d5d7[_0xb4d8('0x53')]);return _0x2d210e[_0xb4d8('0xb8')](_0x1c0cbc);}})[_0xb4d8('0x23')](function(_0x545889){if(_0x545889){_0x3506bf=_0x545889[_0xb4d8('0x4c')];if(!_0x13d5d7['query'][_0xb4d8('0x4d')](_0xb4d8('0x4e'))){_0x1c0cbc[_0xb4d8('0x32')]=qs['limit'](_0x13d5d7[_0xb4d8('0x46')][_0xb4d8('0x32')]);_0x1c0cbc['offset']=qs['offset'](_0x13d5d7[_0xb4d8('0x46')][_0xb4d8('0x30')]);}return _0x2d210e[_0xb4d8('0xb8')](_0x1c0cbc);}})[_0xb4d8('0x23')](function(_0xd8189b){if(_0xd8189b){return _0xd8189b?{'count':_0x3506bf,'rows':_0xd8189b}:null;}})['then'](respondWithResult(_0x135d03,null))[_0xb4d8('0x2d')](handleError(_0x135d03,null));};exports[_0xb4d8('0xb9')]=function(_0x161c51,_0x28f563,_0x38a310){var _0x322742={'raw':![],'where':{}};var _0xaaa958={};var _0x2779ad={'count':0x0,'rows':[]};return db[_0xb4d8('0x41')][_0xb4d8('0x67')]({'where':{'id':_0x161c51[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x28f563,null))[_0xb4d8('0x23')](function(_0x238b19){if(_0x238b19){_0xaaa958[_0xb4d8('0x49')]=_[_0xb4d8('0x57')](db[_0xb4d8('0x9c')][_0xb4d8('0x42')]);_0xaaa958['query']=_[_0xb4d8('0x57')](_0x161c51[_0xb4d8('0x46')]);_0xaaa958[_0xb4d8('0x47')]=_[_0xb4d8('0x48')](_0xaaa958[_0xb4d8('0x49')],_0xaaa958[_0xb4d8('0x46')]);_0x322742[_0xb4d8('0x4a')]=_[_0xb4d8('0x48')](_0xaaa958[_0xb4d8('0x49')],qs[_0xb4d8('0x4b')](_0x161c51[_0xb4d8('0x46')][_0xb4d8('0x4b')]));_0x322742[_0xb4d8('0x4a')]=_0x322742[_0xb4d8('0x4a')]['length']?_0x322742[_0xb4d8('0x4a')]:_0xaaa958['model'];if(!_0x161c51[_0xb4d8('0x46')][_0xb4d8('0x4d')](_0xb4d8('0x4e'))){_0x322742[_0xb4d8('0x32')]=qs[_0xb4d8('0x32')](_0x161c51[_0xb4d8('0x46')][_0xb4d8('0x32')]);_0x322742[_0xb4d8('0x30')]=qs[_0xb4d8('0x30')](_0x161c51[_0xb4d8('0x46')]['offset']);}_0x322742[_0xb4d8('0x68')]=qs[_0xb4d8('0x69')](_0x161c51[_0xb4d8('0x46')][_0xb4d8('0x69')]);_0x322742[_0xb4d8('0x4f')]=qs['filters'](_[_0xb4d8('0x50')](_0x161c51[_0xb4d8('0x46')],_0xaaa958['filters']));_0x322742[_0xb4d8('0x4f')][_0xb4d8('0x64')]=_0x238b19['id'];if(_0x161c51[_0xb4d8('0x46')][_0xb4d8('0x51')]){_0x322742[_0xb4d8('0x4f')]=_[_0xb4d8('0x52')](_0x322742['where'],{'$or':_[_0xb4d8('0x45')](_0x322742['attributes'],function(_0x22da55){var _0x57b1f2={};_0x57b1f2[_0x22da55]={'$like':'%'+_0x161c51[_0xb4d8('0x46')]['filter']+'%'};return _0x57b1f2;})});}_0x322742=_[_0xb4d8('0x52')]({},_0x322742,_0x161c51[_0xb4d8('0x53')]);return db[_0xb4d8('0x9c')][_0xb4d8('0x33')]({'where':_0x322742[_0xb4d8('0x4f')]})[_0xb4d8('0x23')](function(_0x38d460){_0x2779ad[_0xb4d8('0x33')]=_0x38d460;if(_0x161c51['query'][_0xb4d8('0x58')]){_0x322742[_0xb4d8('0x59')]=[{'model':db['CmContact'],'as':_0xb4d8('0xba'),'required':![]},{'model':db[_0xb4d8('0xa6')],'as':'Owner','attributes':[_0xb4d8('0x3c'),_0xb4d8('0xbb'),'internal'],'required':![]},{'model':db[_0xb4d8('0xbc')],'as':_0xb4d8('0xbd'),'attributes':['id',_0xb4d8('0x3c'),_0xb4d8('0xbe')],'where':_0x161c51[_0xb4d8('0x46')][_0xb4d8('0xbf')]?{'id':_0x161c51[_0xb4d8('0x46')][_0xb4d8('0xbf')]}:undefined,'required':_0x161c51[_0xb4d8('0x46')][_0xb4d8('0xbf')]?!![]:![]}];}return db['SmsInteraction'][_0xb4d8('0x54')](_0x322742);})[_0xb4d8('0x23')](function(_0x5ec9eb){_0x2779ad[_0xb4d8('0x55')]=_0x5ec9eb;return _0x2779ad;});}})[_0xb4d8('0x23')](respondWithFilteredResult(_0x28f563,_0x322742))[_0xb4d8('0x2d')](handleError(_0x28f563,null));};exports[_0xb4d8('0x3d')]=function(_0x1d1da8,_0x6abf99,_0x1336e9){var _0x566c9f,_0x5a436c,_0x4357f9;if(_[_0xb4d8('0x93')](_0x1d1da8[_0xb4d8('0x5b')][_0xb4d8('0x5b')])||_0x1d1da8[_0xb4d8('0x5b')][_0xb4d8('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0xb4d8('0xc0'));}if(_[_0xb4d8('0x93')](_0x1d1da8[_0xb4d8('0x5b')]['to'])){throw new db[(_0xb4d8('0x75'))][(_0xb4d8('0x76'))](_0xb4d8('0xc1'));}_0x566c9f=_0x1d1da8[_0xb4d8('0x5b')]['to'];return db[_0xb4d8('0x41')]['find']({'where':{'id':_0x1d1da8['params']['id']},'include':[{'model':db[_0xb4d8('0xc2')],'as':_0xb4d8('0xc3'),'include':[{'model':db[_0xb4d8('0x74')],'as':_0xb4d8('0x97'),'where':{'mobile':_0x566c9f},'limit':0x1,'order':[[_0xb4d8('0x78'),_0xb4d8('0x98')]]}]}]})[_0xb4d8('0x23')](handleEntityNotFound(_0x6abf99,null))[_0xb4d8('0x23')](function(_0x3f12d4){if(_0x3f12d4&&_0x3f12d4[_0xb4d8('0xc3')]){_0x5a436c=_0x3f12d4['get']({'plain':!![]});if(_0x5a436c[_0xb4d8('0xc3')]&&_0x5a436c['List']['Contacts'][_0xb4d8('0x4c')]){return _0x5a436c[_0xb4d8('0xc3')][_0xb4d8('0x97')][0x0];}return db[_0xb4d8('0x74')][_0xb4d8('0x5a')](_['defaults'](_0x1d1da8['body'],{'firstName':_0x566c9f,'mobile':_0x566c9f,'phone':_0x566c9f,'ListId':_0x5a436c['ListId']}));}})[_0xb4d8('0x23')](handleEntityNotFound(_0x6abf99,null))[_0xb4d8('0x23')](function(_0x1fc8b5){if(_0x1fc8b5){_0x4357f9=_0x1fc8b5;return db[_0xb4d8('0x9c')][_0xb4d8('0x5e')]({'where':{'ContactId':_0x4357f9['id'],'closed':![],'SmsAccountId':_0x5a436c['id']}})[_0xb4d8('0x23')](function(_0x3a91dc){if(_0x3a91dc){return[_0x3a91dc,![]];}return db[_0xb4d8('0x9c')][_0xb4d8('0x5a')]({'UserId':_0x1d1da8[_0xb4d8('0x5d')]['id'],'ContactId':_0x4357f9['id'],'SmsAccountId':_0x5a436c['id'],'phone':_0x566c9f,'firstMsgDirection':'out','Messages':[_[_0xb4d8('0x52')](_0x1d1da8[_0xb4d8('0x5b')],{'read':![],'body':_0x1d1da8[_0xb4d8('0x5b')][_0xb4d8('0x5b')],'phone':_0x566c9f,'SmsAccountId':_0x5a436c['id'],'UserId':_0x1d1da8[_0xb4d8('0x5d')]['id'],'ContactId':_0x4357f9['id']})]},{'include':[{'model':db[_0xb4d8('0xc4')],'as':_0xb4d8('0xc5')}]})[_0xb4d8('0x23')](function(_0x34879c){return[_0x34879c,!![]];});});}})[_0xb4d8('0xc6')](function(_0x3ed5bb,_0xeaab9e){if(_0xeaab9e){return _0x3ed5bb;}return db[_0xb4d8('0xc4')][_0xb4d8('0x5a')](_['merge'](_0x1d1da8['body'],{'read':![],'body':_0x1d1da8[_0xb4d8('0x5b')][_0xb4d8('0x5b')],'phone':_0x566c9f,'SmsAccountId':_0x5a436c['id'],'SmsInteractionId':_0x3ed5bb['id'],'UserId':_0x1d1da8[_0xb4d8('0x5d')]['id'],'ContactId':_0x4357f9['id']}))['then'](function(_0x2c3eb2){_0x3ed5bb['dataValues'][_0xb4d8('0xc5')]=[];_0x3ed5bb[_0xb4d8('0xc7')][_0xb4d8('0xc5')][_0xb4d8('0xa0')](_0x2c3eb2[_0xb4d8('0xc7')]);return _0x3ed5bb;});})['then'](respondWithResult(_0x6abf99,null))[_0xb4d8('0x2d')](handleError(_0x6abf99,null));};exports[_0xb4d8('0x2f')]=function(_0x21f79b,_0x2cb971,_0x23e423){if(_0x21f79b[_0xb4d8('0x5b')]['id']){delete _0x21f79b[_0xb4d8('0x5b')]['id'];}var _0x411c22,_0x244463,_0x1cfd66;return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x21f79b[_0xb4d8('0x61')]['id']}})['then'](handleEntityNotFound(_0x2cb971,null))[_0xb4d8('0x23')](function(_0x1cd47f){if(_0x1cd47f){_0x1cfd66=_0x1cd47f;logger[_0xb4d8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xb4d8('0xc8'),_0x1cd47f[_0xb4d8('0x44')],util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1cd47f['type']){case'skebby':if(_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0xca')]&&_0x21f79b['body'][_0xb4d8('0x2f')]){_0x244463=_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x2f')];return db[_0xb4d8('0xc4')][_0xb4d8('0x5e')]({'where':{'messageId':_0x21f79b['body']['skebby_dispatch_id']}});}break;case _0xb4d8('0x85'):if(_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0xcb')]&&_0x21f79b['body'][_0xb4d8('0xcc')]){_0x244463=_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0xcc')];return db[_0xb4d8('0xc4')][_0xb4d8('0x5e')]({'where':{'messageId':_0x21f79b[_0xb4d8('0x5b')]['requestid']}});}break;case _0xb4d8('0xcd'):if(_0x21f79b['body'][_0xb4d8('0x86')]&&_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0xce')]){_0x244463=_0x21f79b['body'][_0xb4d8('0xce')];return db[_0xb4d8('0xc4')]['find']({'where':{'messageId':_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x86')]}});}break;case'infobip':var _0x30a76d=_0x21f79b['body'][_0xb4d8('0x8a')][0x0];if(_0x30a76d[_0xb4d8('0x81')]&&_0x30a76d['status'][_0xb4d8('0xcf')]===_0xb4d8('0xd0')){_0x244463=_0x30a76d['status'][_0xb4d8('0xcf')];return db[_0xb4d8('0xc4')][_0xb4d8('0x5e')]({'where':{'messageId':_0x30a76d[_0xb4d8('0x81')]}});}break;case _0xb4d8('0x8d'):if(_0x21f79b[_0xb4d8('0x5b')]['messageId']&&_0x21f79b['body']['status']){_0x244463=_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x2f')];return db[_0xb4d8('0xc4')][_0xb4d8('0x5e')]({'where':{'messageId':_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x81')]}});}break;case _0xb4d8('0xd1'):if(_0x21f79b[_0xb4d8('0x5b')][0x0][_0xb4d8('0x2b')]['id']){_0x244463=_0x21f79b[_0xb4d8('0x5b')][0x0][_0xb4d8('0x44')];return db[_0xb4d8('0xc4')][_0xb4d8('0x5e')]({'where':{'messageId':_0x21f79b[_0xb4d8('0x5b')][0x0][_0xb4d8('0x2b')]['id']}});}break;case'intelepeer':if(_0x21f79b['body']['redif']&&_0x21f79b['body'][_0xb4d8('0x2f')]){_0x244463=_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x2f')];return db['SmsMessage'][_0xb4d8('0x5e')]({'where':{'messageId':_0x21f79b['body'][_0xb4d8('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x2cb971,null))[_0xb4d8('0x23')](function(_0x488ed7){if(_0x488ed7){_0x411c22=_0x488ed7;switch(_0x1cfd66[_0xb4d8('0x44')]){case'skebby':if(_0x244463===_0xb4d8('0xd0')){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb4d8('0x2f'),_0xb4d8('0x83'),util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb4d8('0x85'):if(_0x244463==='1'){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')](_0xb4d8('0x27'),_0xb4d8('0x2f'),_0xb4d8('0x83'),util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb4d8('0xcd'):if(!_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0xd3')]&&_0x244463>=0xc8&&_0x244463<=0xce){return _0x411c22['update']({'read':!![]});}else{logger[_0xb4d8('0x2a')](_0xb4d8('0x27'),'status','clicksend',util['inspect'](_0x21f79b['body'],{'showHidden':![],'depth':null}));}break;case _0xb4d8('0x89'):var _0x1194a1=_0x21f79b[_0xb4d8('0x5b')][_0xb4d8('0x8a')][0x0];if(_0x1194a1[_0xb4d8('0x2f')][_0xb4d8('0xcf')]===_0xb4d8('0xd0')){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')](_0xb4d8('0x27'),_0xb4d8('0x2f'),_0xb4d8('0x89'),util[_0xb4d8('0xc9')](_0x21f79b['body'],{'showHidden':![],'depth':null}));}break;case _0xb4d8('0x8d'):if(_0x244463==_0xb4d8('0xd4')||_0x244463=='RECEIVED_BY_RECIPIENT'){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')](_0xb4d8('0x27'),_0xb4d8('0x2f'),_0xb4d8('0x8d'),util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb4d8('0xd1'):if(_0x244463=='message-delivered'){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xb4d8('0xd1'),util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x244463==='DELIVRD'||_0x244463===_0xb4d8('0xd5')){return _0x411c22[_0xb4d8('0x60')]({'read':!![]});}else{logger[_0xb4d8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb4d8('0x2f'),_0xb4d8('0xd6'),util[_0xb4d8('0xc9')](_0x21f79b[_0xb4d8('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x411c22;}})[_0xb4d8('0x23')](respondWithResult(_0x2cb971,null))[_0xb4d8('0x2d')](handleError(_0x2cb971,null));};exports[_0xb4d8('0xd7')]=function(_0x509bdd,_0x3310da,_0x370008){var _0x9a13e1,_0x29cae1,_0x19097b;return db['SmsAccount'][_0xb4d8('0x5e')]({'where':{'id':_0x509bdd['params']['id']}})['then'](handleEntityNotFound(_0x3310da,null))[_0xb4d8('0x23')](function(_0x4ce590){if(_0x4ce590){_0x19097b=_0x4ce590;logger[_0xb4d8('0x26')](_0xb4d8('0x27'),_0xb4d8('0x2f'),_0xb4d8('0xc8'),_0x4ce590[_0xb4d8('0x44')],util['inspect'](_0x509bdd[_0xb4d8('0x46')],{'showHidden':![],'depth':null}));switch(_0x4ce590['type']){case _0xb4d8('0x8b'):if(_0x509bdd[_0xb4d8('0x46')][_0xb4d8('0xd8')]&&_0x509bdd[_0xb4d8('0x46')][_0xb4d8('0xd9')]){_0x29cae1=_0x509bdd[_0xb4d8('0x46')]['state'];return db[_0xb4d8('0xc4')]['find']({'where':{'messageId':_0x509bdd[_0xb4d8('0x46')][_0xb4d8('0xd8')]}});}break;}}})[_0xb4d8('0x23')](handleEntityNotFound(_0x3310da,null))[_0xb4d8('0x23')](function(_0x31972a){if(_0x31972a){_0x9a13e1=_0x31972a;switch(_0x19097b[_0xb4d8('0x44')]){case _0xb4d8('0x8b'):if(_0x29cae1==='2'||_0x29cae1==='6'){return _0x9a13e1[_0xb4d8('0x60')]({'read':!![]});}else{logger['error'](_0xb4d8('0x27'),_0xb4d8('0x2f'),'csc',util[_0xb4d8('0xc9')](_0x509bdd['query'],{'showHidden':![],'depth':null}));};break;}return _0x9a13e1;}})[_0xb4d8('0x23')](respondWithResult(_0x3310da,null))[_0xb4d8('0x2d')](handleError(_0x3310da,null));};exports[_0xb4d8('0xda')]=function(_0x5ee08d,_0x1e4519,_0x1cbce3){return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x5ee08d[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x1e4519,null))['then'](function(_0x20f536){if(_0x20f536){return _0x20f536[_0xb4d8('0xda')](_0x5ee08d[_0xb4d8('0x5b')]['ids'],_[_0xb4d8('0x9a')](_0x5ee08d[_0xb4d8('0x5b')],['ids','id'])||{})[_0xb4d8('0xc6')](function(_0x4ec2c4){for(var _0x3162d2=0x0;_0x3162d2<_0x5ee08d[_0xb4d8('0x5b')][_0xb4d8('0x6a')][_0xb4d8('0x4c')];_0x3162d2+=0x1){socket['emit'](_0xb4d8('0xdb'),{'UserId':Number(_0x5ee08d[_0xb4d8('0x5b')][_0xb4d8('0x6a')][_0x3162d2]),'SmsAccountId':Number(_0x5ee08d[_0xb4d8('0x61')]['id'])});}return _0x4ec2c4;});}})['then'](respondWithResult(_0x1e4519,null))[_0xb4d8('0x2d')](handleError(_0x1e4519,null));};exports[_0xb4d8('0xdc')]=function(_0x1b0ca6,_0x10f8f1,_0x48cf58){return db[_0xb4d8('0x41')][_0xb4d8('0x5e')]({'where':{'id':_0x1b0ca6[_0xb4d8('0x61')]['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x10f8f1,null))[_0xb4d8('0x23')](function(_0x46a16d){if(_0x46a16d){return _0x46a16d[_0xb4d8('0xdc')](_0x1b0ca6[_0xb4d8('0x46')][_0xb4d8('0x6a')])[_0xb4d8('0x23')](function(){if(_[_0xb4d8('0xdd')](_0x1b0ca6[_0xb4d8('0x46')][_0xb4d8('0x6a')])){for(var _0x506753=0x0;_0x506753<_0x1b0ca6[_0xb4d8('0x46')][_0xb4d8('0x6a')][_0xb4d8('0x4c')];_0x506753+=0x1){socket['emit'](_0xb4d8('0xde'),{'UserId':Number(_0x1b0ca6['query'][_0xb4d8('0x6a')][_0x506753]),'SmsAccountId':Number(_0x1b0ca6[_0xb4d8('0x61')]['id'])});}}else{socket[_0xb4d8('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x1b0ca6[_0xb4d8('0x46')]['ids']),'SmsAccountId':Number(_0x1b0ca6[_0xb4d8('0x61')]['id'])});}});}})[_0xb4d8('0x23')](respondWithStatusCode(_0x10f8f1,null))['catch'](handleError(_0x10f8f1,null));};exports[_0xb4d8('0xe0')]=function(_0x363683,_0x510216,_0x14805e){var _0x2a5a0c={};var _0x228e14={};var _0x53293a;var _0x271c7f;return db[_0xb4d8('0x41')]['findOne']({'where':{'id':_0x363683['params']['id']}})[_0xb4d8('0x23')](handleEntityNotFound(_0x510216,null))[_0xb4d8('0x23')](function(_0x56ba41){if(_0x56ba41){_0x53293a=_0x56ba41;_0x228e14[_0xb4d8('0x49')]=_[_0xb4d8('0x57')](db['User'][_0xb4d8('0x42')]);_0x228e14[_0xb4d8('0x46')]=_[_0xb4d8('0x57')](_0x363683['query']);_0x228e14[_0xb4d8('0x47')]=_[_0xb4d8('0x48')](_0x228e14[_0xb4d8('0x49')],_0x228e14['query']);_0x2a5a0c[_0xb4d8('0x4a')]=_[_0xb4d8('0x48')](_0x228e14[_0xb4d8('0x49')],qs[_0xb4d8('0x4b')](_0x363683['query'][_0xb4d8('0x4b')]));_0x2a5a0c['attributes']=_0x2a5a0c[_0xb4d8('0x4a')]['length']?_0x2a5a0c[_0xb4d8('0x4a')]:_0x228e14[_0xb4d8('0x49')];_0x2a5a0c[_0xb4d8('0x68')]=qs[_0xb4d8('0x69')](_0x363683[_0xb4d8('0x46')][_0xb4d8('0x69')]);_0x2a5a0c[_0xb4d8('0x4f')]=qs[_0xb4d8('0x47')](_['pick'](_0x363683[_0xb4d8('0x46')],_0x228e14[_0xb4d8('0x47')]));if(_0x363683[_0xb4d8('0x46')][_0xb4d8('0x51')]){_0x2a5a0c[_0xb4d8('0x4f')]=_[_0xb4d8('0x52')](_0x2a5a0c[_0xb4d8('0x4f')],{'$or':_[_0xb4d8('0x45')](_0x2a5a0c[_0xb4d8('0x4a')],function(_0x1d39e1){var _0x8b140d={};_0x8b140d[_0x1d39e1]={'$like':'%'+_0x363683['query'][_0xb4d8('0x51')]+'%'};return _0x8b140d;})});}_0x2a5a0c=_[_0xb4d8('0x52')]({},_0x2a5a0c,_0x363683['options']);return _0x53293a[_0xb4d8('0xe0')](_0x2a5a0c);}})['then'](function(_0x133be3){if(_0x133be3){_0x271c7f=_0x133be3[_0xb4d8('0x4c')];if(!_0x363683['query']['hasOwnProperty']('nolimit')){_0x2a5a0c[_0xb4d8('0x32')]=qs[_0xb4d8('0x32')](_0x363683[_0xb4d8('0x46')][_0xb4d8('0x32')]);_0x2a5a0c[_0xb4d8('0x30')]=qs[_0xb4d8('0x30')](_0x363683[_0xb4d8('0x46')][_0xb4d8('0x30')]);}return _0x53293a[_0xb4d8('0xe0')](_0x2a5a0c);}})['then'](function(_0xb919f1){if(_0xb919f1){return _0xb919f1?{'count':_0x271c7f,'rows':_0xb919f1}:null;}})[_0xb4d8('0x23')](respondWithResult(_0x510216,null))[_0xb4d8('0x2d')](handleError(_0x510216,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 5179fd7..931903d 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 _0xead6=['hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit'];(function(_0x5ce2eb,_0x44997a){var _0xce9335=function(_0x1d66f2){while(--_0x1d66f2){_0x5ce2eb['push'](_0x5ce2eb['shift']());}};_0xce9335(++_0x44997a);}(_0xead6,0xa4));var _0x6ead=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xead6[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x6ead('0x0'));var SmsAccount=require(_0x6ead('0x1'))['db'][_0x6ead('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6ead('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ead('0x4'),'afterDestroy':_0x6ead('0x5')};function emitEvent(_0x1bce91){return function(_0x112422,_0x5e509d,_0x1a87b9){SmsAccountEvents[_0x6ead('0x6')](_0x1bce91+':'+_0x112422['id'],_0x112422);SmsAccountEvents[_0x6ead('0x6')](_0x1bce91,_0x112422);_0x1a87b9(null);};}for(var e in events){if(events[_0x6ead('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x6ead('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xb258=['hook','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x15e791,_0x524007){var _0x175c6a=function(_0x3425fb){while(--_0x3425fb){_0x15e791['push'](_0x15e791['shift']());}};_0x175c6a(++_0x524007);}(_0xb258,0xe9));var _0x8b25=function(_0x5f1127,_0x34e6ea){_0x5f1127=_0x5f1127-0x0;var _0x260152=_0xb258[_0x5f1127];return _0x260152;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x8b25('0x0'))['db'][_0x8b25('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8b25('0x2')](0x0);var events={'afterCreate':_0x8b25('0x3'),'afterUpdate':_0x8b25('0x4'),'afterDestroy':_0x8b25('0x5')};function emitEvent(_0x585eb8){return function(_0xb17fa3,_0xd0afbb,_0x4c3104){SmsAccountEvents[_0x8b25('0x6')](_0x585eb8+':'+_0xb17fa3['id'],_0xb17fa3);SmsAccountEvents['emit'](_0x585eb8,_0xb17fa3);_0x4c3104(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x8b25('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 617201f..5017b7e 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 _0x3c84=['define','SmsAccount','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x5e7e92,_0xdb0f1){var _0x412746=function(_0x1872fa){while(--_0x1872fa){_0x5e7e92['push'](_0x5e7e92['shift']());}};_0x412746(++_0xdb0f1);}(_0x3c84,0xff));var _0x43c8=function(_0xed6a56,_0x395016){_0xed6a56=_0xed6a56-0x0;var _0x30e9df=_0x3c84[_0xed6a56];return _0x30e9df;};'use strict';var _=require(_0x43c8('0x0'));var util=require(_0x43c8('0x1'));var logger=require('../../config/logger')(_0x43c8('0x2'));var moment=require(_0x43c8('0x3'));var BPromise=require(_0x43c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x43c8('0x5'));var config=require(_0x43c8('0x6'));var attributes=require(_0x43c8('0x7'));module[_0x43c8('0x8')]=function(_0x2f1804,_0x4a0654){return _0x2f1804[_0x43c8('0x9')](_0x43c8('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7adb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0xc27714,_0x162dc7){var _0x198c4c=function(_0x2762a9){while(--_0x2762a9){_0xc27714['push'](_0xc27714['shift']());}};_0x198c4c(++_0x162dc7);}(_0x7adb,0x193));var _0xb7ad=function(_0x1ab921,_0x1dbec7){_0x1ab921=_0x1ab921-0x0;var _0x515864=_0x7adb[_0x1ab921];return _0x515864;};'use strict';var _=require(_0xb7ad('0x0'));var util=require(_0xb7ad('0x1'));var logger=require(_0xb7ad('0x2'))(_0xb7ad('0x3'));var moment=require(_0xb7ad('0x4'));var BPromise=require(_0xb7ad('0x5'));var rp=require(_0xb7ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7ad('0x7'));var config=require(_0xb7ad('0x8'));var attributes=require(_0xb7ad('0x9'));module[_0xb7ad('0xa')]=function(_0xbd16e4,_0x32a73c){return _0xbd16e4[_0xb7ad('0xb')](_0xb7ad('0xc'),attributes,{'tableName':_0xb7ad('0xd'),'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 d9e1f5d..e0db8b4 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 _0x6103=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','ShowSmsAccount','SmsAccount','find','options','raw','include','map','attributes','moment','bluebird','randomstring','../../mysqldb'];(function(_0x228a7e,_0x1aa45a){var _0x3edad9=function(_0x28d790){while(--_0x28d790){_0x228a7e['push'](_0x228a7e['shift']());}};_0x3edad9(++_0x1aa45a);}(_0x6103,0x1d8));var _0x3610=function(_0x2547df,_0x4a7a81){_0x2547df=_0x2547df-0x0;var _0x621fcb=_0x6103[_0x2547df];return _0x621fcb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3610('0x0'));var BPromise=require(_0x3610('0x1'));var rs=require(_0x3610('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3610('0x3'))['db'];var utils=require(_0x3610('0x4'));var logger=require(_0x3610('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3610('0x6'));var client=jayson[_0x3610('0x7')][_0x3610('0x8')]({'port':0x232a});config[_0x3610('0x9')]=_[_0x3610('0xa')](config[_0x3610('0x9')],{'host':_0x3610('0xb'),'port':0x18eb});var socket=require(_0x3610('0xc'))(new Redis(config[_0x3610('0x9')]));require(_0x3610('0xd'))[_0x3610('0xe')](socket);function respondWithRpcPromise(_0x4f773d,_0x3fbfe4,_0x482875){return new BPromise(function(_0x3015d6,_0x498698){return client[_0x3610('0xf')](_0x4f773d,_0x482875)[_0x3610('0x10')](function(_0x2f71f0){logger[_0x3610('0x11')]('SmsAccount,\x20%s,\x20%s',_0x3fbfe4,_0x3610('0x12'));logger[_0x3610('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fbfe4,_0x3610('0x12'),JSON[_0x3610('0x14')](_0x2f71f0));if(_0x2f71f0[_0x3610('0x15')]){if(_0x2f71f0[_0x3610('0x15')][_0x3610('0x16')]===0x1f4){logger[_0x3610('0x15')]('SmsAccount,\x20%s,\x20%s',_0x3fbfe4,_0x2f71f0[_0x3610('0x15')]['message']);return _0x498698(_0x2f71f0[_0x3610('0x15')][_0x3610('0x17')]);}logger[_0x3610('0x15')](_0x3610('0x18'),_0x3fbfe4,_0x2f71f0['error']['message']);return _0x3015d6(_0x2f71f0[_0x3610('0x15')][_0x3610('0x17')]);}else{logger[_0x3610('0x11')]('SmsAccount,\x20%s,\x20%s',_0x3fbfe4,_0x3610('0x12'));_0x3015d6(_0x2f71f0[_0x3610('0x19')]['message']);}})['catch'](function(_0x1c5779){logger[_0x3610('0x15')]('SmsAccount,\x20%s,\x20%s',_0x3fbfe4,_0x1c5779);_0x498698(_0x1c5779);});});}exports[_0x3610('0x1a')]=function(_0x3546e7){var _0x2b7ffb=this;return new Promise(function(_0xb54ca4,_0x33e627){return db[_0x3610('0x1b')][_0x3610('0x1c')]({'raw':_0x3546e7['options']?_0x3546e7[_0x3610('0x1d')][_0x3610('0x1e')]===undefined?!![]:![]:!![],'where':_0x3546e7[_0x3610('0x1d')]?_0x3546e7[_0x3610('0x1d')]['where']||null:null,'attributes':_0x3546e7[_0x3610('0x1d')]?_0x3546e7[_0x3610('0x1d')]['attributes']||null:null,'include':_0x3546e7[_0x3610('0x1d')]?_0x3546e7['options'][_0x3610('0x1f')]?_[_0x3610('0x20')](_0x3546e7[_0x3610('0x1d')][_0x3610('0x1f')],function(_0x130383){return{'model':db[_0x130383['model']],'as':_0x130383['as'],'attributes':_0x130383[_0x3610('0x21')],'include':_0x130383[_0x3610('0x1f')]?_[_0x3610('0x20')](_0x130383['include'],function(_0x299598){return{'model':db[_0x299598['model']],'as':_0x299598['as'],'attributes':_0x299598[_0x3610('0x21')],'include':_0x299598[_0x3610('0x1f')]?_[_0x3610('0x20')](_0x299598['include'],function(_0x3f778c){return{'model':db[_0x3f778c['model']],'as':_0x3f778c['as'],'attributes':_0x3f778c[_0x3610('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3610('0x10')](function(_0x2f1aaf){logger[_0x3610('0x11')](_0x3610('0x1a'),_0x3546e7);logger[_0x3610('0x13')]('ShowSmsAccount',_0x3546e7,JSON[_0x3610('0x14')](_0x2f1aaf));_0xb54ca4(_0x2f1aaf);})['catch'](function(_0x1c12c0){logger[_0x3610('0x15')](_0x3610('0x1a'),_0x1c12c0[_0x3610('0x17')],_0x3546e7);_0x33e627(_0x2b7ffb['error'](0x1f4,_0x1c12c0[_0x3610('0x17')]));});});}; \ No newline at end of file +var _0xa661=['http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','find','options','raw','where','include','map','model','attributes','ShowSmsAccount','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1748ca,_0x531605){var _0x330d39=function(_0x4cc874){while(--_0x4cc874){_0x1748ca['push'](_0x1748ca['shift']());}};_0x330d39(++_0x531605);}(_0xa661,0x1cb));var _0x1a66=function(_0x4ba8c3,_0x33c457){_0x4ba8c3=_0x4ba8c3-0x0;var _0xf65364=_0xa661[_0x4ba8c3];return _0xf65364;};'use strict';var _=require('lodash');var util=require(_0x1a66('0x0'));var moment=require(_0x1a66('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a66('0x2'));var db=require(_0x1a66('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a66('0x4'))(_0x1a66('0x5'));var config=require(_0x1a66('0x6'));var jayson=require(_0x1a66('0x7'));var client=jayson[_0x1a66('0x8')][_0x1a66('0x9')]({'port':0x232a});config[_0x1a66('0xa')]=_[_0x1a66('0xb')](config[_0x1a66('0xa')],{'host':_0x1a66('0xc'),'port':0x18eb});var socket=require(_0x1a66('0xd'))(new Redis(config[_0x1a66('0xa')]));require(_0x1a66('0xe'))['register'](socket);function respondWithRpcPromise(_0x1e7632,_0x39efaa,_0x573798){return new BPromise(function(_0x3a70b2,_0x1422ef){return client[_0x1a66('0xf')](_0x1e7632,_0x573798)[_0x1a66('0x10')](function(_0x44d3fe){logger[_0x1a66('0x11')](_0x1a66('0x12'),_0x39efaa,_0x1a66('0x13'));logger[_0x1a66('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x39efaa,'request\x20sent',JSON[_0x1a66('0x15')](_0x44d3fe));if(_0x44d3fe[_0x1a66('0x16')]){if(_0x44d3fe[_0x1a66('0x16')][_0x1a66('0x17')]===0x1f4){logger[_0x1a66('0x16')]('SmsAccount,\x20%s,\x20%s',_0x39efaa,_0x44d3fe['error'][_0x1a66('0x18')]);return _0x1422ef(_0x44d3fe[_0x1a66('0x16')][_0x1a66('0x18')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x39efaa,_0x44d3fe[_0x1a66('0x16')][_0x1a66('0x18')]);return _0x3a70b2(_0x44d3fe[_0x1a66('0x16')][_0x1a66('0x18')]);}else{logger[_0x1a66('0x11')]('SmsAccount,\x20%s,\x20%s',_0x39efaa,_0x1a66('0x13'));_0x3a70b2(_0x44d3fe[_0x1a66('0x19')][_0x1a66('0x18')]);}})[_0x1a66('0x1a')](function(_0xcd8adc){logger[_0x1a66('0x16')](_0x1a66('0x12'),_0x39efaa,_0xcd8adc);_0x1422ef(_0xcd8adc);});});}exports['ShowSmsAccount']=function(_0x1ebec7){var _0x29665d=this;return new Promise(function(_0x3e12c8,_0x6aca07){return db['SmsAccount'][_0x1a66('0x1b')]({'raw':_0x1ebec7[_0x1a66('0x1c')]?_0x1ebec7['options'][_0x1a66('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ebec7['options']?_0x1ebec7['options'][_0x1a66('0x1e')]||null:null,'attributes':_0x1ebec7[_0x1a66('0x1c')]?_0x1ebec7['options']['attributes']||null:null,'include':_0x1ebec7[_0x1a66('0x1c')]?_0x1ebec7[_0x1a66('0x1c')][_0x1a66('0x1f')]?_[_0x1a66('0x20')](_0x1ebec7[_0x1a66('0x1c')][_0x1a66('0x1f')],function(_0x67a197){return{'model':db[_0x67a197[_0x1a66('0x21')]],'as':_0x67a197['as'],'attributes':_0x67a197[_0x1a66('0x22')],'include':_0x67a197[_0x1a66('0x1f')]?_['map'](_0x67a197[_0x1a66('0x1f')],function(_0x538ec1){return{'model':db[_0x538ec1['model']],'as':_0x538ec1['as'],'attributes':_0x538ec1['attributes'],'include':_0x538ec1[_0x1a66('0x1f')]?_['map'](_0x538ec1[_0x1a66('0x1f')],function(_0x1aa201){return{'model':db[_0x1aa201[_0x1a66('0x21')]],'as':_0x1aa201['as'],'attributes':_0x1aa201[_0x1a66('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1a66('0x10')](function(_0x2f9cf6){logger['info'](_0x1a66('0x23'),_0x1ebec7);logger['debug'](_0x1a66('0x23'),_0x1ebec7,JSON['stringify'](_0x2f9cf6));_0x3e12c8(_0x2f9cf6);})[_0x1a66('0x1a')](function(_0x9ac7b2){logger[_0x1a66('0x16')](_0x1a66('0x23'),_0x9ac7b2[_0x1a66('0x18')],_0x1ebec7);_0x6aca07(_0x29665d['error'](0x1f4,_0x9ac7b2[_0x1a66('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index cf0ec86..328f438 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 6be78c5..fd1ccaa 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_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('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/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 2246c78..a1db718 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 _0x1a63=['STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1a63,0x16e));var _0x31a6=function(_0x4f75e7,_0x2651cb){_0x4f75e7=_0x4f75e7-0x0;var _0x546307=_0x1a63[_0x4f75e7];return _0x546307;};'use strict';var Sequelize=require(_0x31a6('0x0'));module['exports']={'priority':{'type':Sequelize[_0x31a6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x31a6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x31a6('0x2')]},'interval':{'type':Sequelize[_0x31a6('0x2')],'defaultValue':_0x31a6('0x3')}}; \ No newline at end of file +var _0xb606=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x3fe06f,_0x3e0806){var _0x127a39=function(_0x2ac058){while(--_0x2ac058){_0x3fe06f['push'](_0x3fe06f['shift']());}};_0x127a39(++_0x3e0806);}(_0xb606,0x98));var _0x6b60=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xb606[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x6b60('0x0'));module[_0x6b60('0x1')]={'priority':{'type':Sequelize[_0x6b60('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6b60('0x3')],'allowNull':![],'defaultValue':_0x6b60('0x4')},'appdata':{'type':Sequelize[_0x6b60('0x5')]()},'description':{'type':Sequelize[_0x6b60('0x3')]},'interval':{'type':Sequelize[_0x6b60('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index d44f30a..7eeba91 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 _0x578c=['to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','SmsApplication','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1377d4,_0x276669){var _0x2ae133=function(_0x2528a8){while(--_0x2528a8){_0x1377d4['push'](_0x1377d4['shift']());}};_0x2ae133(++_0x276669);}(_0x578c,0x89));var _0xc578=function(_0xad0584,_0xe86479){_0xad0584=_0xad0584-0x0;var _0x302c46=_0x578c[_0xad0584];return _0x302c46;};'use strict';var emlformat=require(_0xc578('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc578('0x1'));var jsonpatch=require(_0xc578('0x2'));var rp=require('request-promise');var moment=require(_0xc578('0x3'));var BPromise=require(_0xc578('0x4'));var Mustache=require(_0xc578('0x5'));var util=require(_0xc578('0x6'));var path=require(_0xc578('0x7'));var sox=require(_0xc578('0x8'));var csv=require(_0xc578('0x9'));var ejs=require(_0xc578('0xa'));var fs=require('fs');var fs_extra=require(_0xc578('0xb'));var _=require('lodash');var squel=require(_0xc578('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc578('0xd'));var toCsv=require(_0xc578('0x9'));var querystring=require(_0xc578('0xe'));var Papa=require(_0xc578('0xf'));var Redis=require('ioredis');var authService=require(_0xc578('0x10'));var qs=require(_0xc578('0x11'));var as=require(_0xc578('0x12'));var hardwareService=require(_0xc578('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc578('0x14'));var config=require(_0xc578('0x15'));var licenseUtil=require(_0xc578('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c6118,_0x302b84){_0x302b84=_0x302b84||0xcc;return function(_0x23f1e7){if(_0x23f1e7){return _0x3c6118[_0xc578('0x17')](_0x302b84);}return _0x3c6118[_0xc578('0x18')](_0x302b84)[_0xc578('0x19')]();};}function respondWithResult(_0x17a056,_0x328314){_0x328314=_0x328314||0xc8;return function(_0x586d15){if(_0x586d15){return _0x17a056[_0xc578('0x18')](_0x328314)[_0xc578('0x1a')](_0x586d15);}};}function respondWithFilteredResult(_0x26618d,_0x585072){return function(_0x45aca7){if(_0x45aca7){var _0x654d0f=typeof _0x585072[_0xc578('0x1b')]===_0xc578('0x1c')&&typeof _0x585072[_0xc578('0x1d')]==='undefined';var _0x4ca399=_0x45aca7[_0xc578('0x1e')];var _0x1f9594=_0x654d0f?0x0:_0x585072[_0xc578('0x1b')];var _0x31f5e9=_0x654d0f?_0x45aca7[_0xc578('0x1e')]:_0x585072[_0xc578('0x1b')]+_0x585072[_0xc578('0x1d')];var _0x19713b;if(_0x31f5e9>=_0x4ca399){_0x31f5e9=_0x4ca399;_0x19713b=0xc8;}else{_0x19713b=0xce;}_0x26618d['status'](_0x19713b);return _0x26618d[_0xc578('0x1f')](_0xc578('0x20'),_0x1f9594+'-'+_0x31f5e9+'/'+_0x4ca399)[_0xc578('0x1a')](_0x45aca7);}return null;};}function patchUpdates(_0x494ce3){return function(_0xa29c6b){try{jsonpatch['apply'](_0xa29c6b,_0x494ce3,!![]);}catch(_0x160eb7){return BPromise[_0xc578('0x21')](_0x160eb7);}return _0xa29c6b[_0xc578('0x22')]();};}function saveUpdates(_0x21fc50,_0x546a48){return function(_0x5748db){if(_0x5748db){return _0x5748db[_0xc578('0x23')](_0x21fc50)[_0xc578('0x24')](function(_0x4c2da5){return _0x4c2da5;});}return null;};}function removeEntity(_0x59638f,_0x3e5ffc){return function(_0x317357){if(_0x317357){return _0x317357[_0xc578('0x25')]()[_0xc578('0x24')](function(){_0x59638f[_0xc578('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c658,_0x270f3e){return function(_0x371f74){if(!_0x371f74){_0x16c658[_0xc578('0x17')](0x194);}return _0x371f74;};}function handleError(_0x3f40f6,_0x36a18d){_0x36a18d=_0x36a18d||0x1f4;return function(_0x32ea13){logger[_0xc578('0x26')](_0x32ea13['stack']);if(_0x32ea13['name']){delete _0x32ea13[_0xc578('0x27')];}_0x3f40f6[_0xc578('0x18')](_0x36a18d)[_0xc578('0x28')](_0x32ea13);};}exports['index']=function(_0x11dfad,_0x3bb96e){var _0x827edb={},_0x246f4d={},_0x47b99c={'count':0x0,'rows':[]};var _0x565ac6=_['map'](db[_0xc578('0x29')][_0xc578('0x2a')],function(_0x1b35b1){return{'name':_0x1b35b1[_0xc578('0x2b')],'type':_0x1b35b1[_0xc578('0x2c')][_0xc578('0x2d')]};});_0x246f4d['model']=_[_0xc578('0x2e')](_0x565ac6,_0xc578('0x27'));_0x246f4d[_0xc578('0x2f')]=_[_0xc578('0x30')](_0x11dfad[_0xc578('0x2f')]);_0x246f4d[_0xc578('0x31')]=_[_0xc578('0x32')](_0x246f4d[_0xc578('0x33')],_0x246f4d[_0xc578('0x2f')]);_0x827edb[_0xc578('0x34')]=_[_0xc578('0x32')](_0x246f4d[_0xc578('0x33')],qs[_0xc578('0x35')](_0x11dfad[_0xc578('0x2f')]['fields']));_0x827edb['attributes']=_0x827edb[_0xc578('0x34')][_0xc578('0x36')]?_0x827edb[_0xc578('0x34')]:_0x246f4d[_0xc578('0x33')];if(!_0x11dfad[_0xc578('0x2f')]['hasOwnProperty'](_0xc578('0x37'))){_0x827edb[_0xc578('0x1d')]=qs[_0xc578('0x1d')](_0x11dfad[_0xc578('0x2f')]['limit']);_0x827edb[_0xc578('0x1b')]=qs[_0xc578('0x1b')](_0x11dfad[_0xc578('0x2f')][_0xc578('0x1b')]);}_0x827edb['order']=qs[_0xc578('0x38')](_0x11dfad[_0xc578('0x2f')]['sort']);_0x827edb[_0xc578('0x39')]=qs[_0xc578('0x31')](_[_0xc578('0x3a')](_0x11dfad[_0xc578('0x2f')],_0x246f4d[_0xc578('0x31')]),_0x565ac6);if(_0x11dfad[_0xc578('0x2f')]['filter']){_0x827edb['where']=_[_0xc578('0x3b')](_0x827edb[_0xc578('0x39')],{'$or':_[_0xc578('0x2e')](_0x565ac6,function(_0x5b3329){if(_0x5b3329[_0xc578('0x2c')]!==_0xc578('0x3c')){var _0x45ffcb={};_0x45ffcb[_0x5b3329[_0xc578('0x27')]]={'$like':'%'+_0x11dfad[_0xc578('0x2f')][_0xc578('0x3d')]+'%'};return _0x45ffcb;}})});}_0x827edb=_[_0xc578('0x3b')]({},_0x827edb,_0x11dfad[_0xc578('0x3e')]);var _0x348965={'where':_0x827edb[_0xc578('0x39')]};return db['SmsApplication'][_0xc578('0x1e')](_0x348965)['then'](function(_0x298072){_0x47b99c[_0xc578('0x1e')]=_0x298072;if(_0x11dfad[_0xc578('0x2f')][_0xc578('0x3f')]){_0x827edb[_0xc578('0x40')]=[{'all':!![]}];}return db[_0xc578('0x29')][_0xc578('0x41')](_0x827edb);})[_0xc578('0x24')](function(_0x507f8d){_0x47b99c[_0xc578('0x42')]=_0x507f8d;return _0x47b99c;})['then'](respondWithFilteredResult(_0x3bb96e,_0x827edb))[_0xc578('0x43')](handleError(_0x3bb96e,null));};exports[_0xc578('0x44')]=function(_0x3c76ae,_0x4a56c8){var _0x37b575={'raw':!![],'where':{'id':_0x3c76ae['params']['id']}},_0x507660={};_0x507660[_0xc578('0x33')]=_[_0xc578('0x30')](db['SmsApplication'][_0xc578('0x2a')]);_0x507660[_0xc578('0x2f')]=_[_0xc578('0x30')](_0x3c76ae[_0xc578('0x2f')]);_0x507660[_0xc578('0x31')]=_['intersection'](_0x507660[_0xc578('0x33')],_0x507660[_0xc578('0x2f')]);_0x37b575['attributes']=_['intersection'](_0x507660[_0xc578('0x33')],qs[_0xc578('0x35')](_0x3c76ae[_0xc578('0x2f')][_0xc578('0x35')]));_0x37b575[_0xc578('0x34')]=_0x37b575['attributes'][_0xc578('0x36')]?_0x37b575[_0xc578('0x34')]:_0x507660['model'];if(_0x3c76ae[_0xc578('0x2f')][_0xc578('0x3f')]){_0x37b575[_0xc578('0x40')]=[{'all':!![]}];}_0x37b575=_['merge']({},_0x37b575,_0x3c76ae['options']);return db['SmsApplication'][_0xc578('0x45')](_0x37b575)[_0xc578('0x24')](handleEntityNotFound(_0x4a56c8,null))[_0xc578('0x24')](respondWithResult(_0x4a56c8,null))[_0xc578('0x43')](handleError(_0x4a56c8,null));};exports[_0xc578('0x46')]=function(_0xe52b52,_0x431294){return db[_0xc578('0x29')][_0xc578('0x46')](_0xe52b52[_0xc578('0x47')],{})[_0xc578('0x24')](respondWithResult(_0x431294,0xc9))['catch'](handleError(_0x431294,null));};exports[_0xc578('0x23')]=function(_0x55de94,_0x469f71){if(_0x55de94[_0xc578('0x47')]['id']){delete _0x55de94[_0xc578('0x47')]['id'];}return db[_0xc578('0x29')][_0xc578('0x45')]({'where':{'id':_0x55de94[_0xc578('0x48')]['id']}})[_0xc578('0x24')](handleEntityNotFound(_0x469f71,null))['then'](saveUpdates(_0x55de94[_0xc578('0x47')],null))['then'](respondWithResult(_0x469f71,null))[_0xc578('0x43')](handleError(_0x469f71,null));};exports['destroy']=function(_0xa2ccf7,_0x10234f){return db[_0xc578('0x29')][_0xc578('0x45')]({'where':{'id':_0xa2ccf7[_0xc578('0x48')]['id']}})[_0xc578('0x24')](handleEntityNotFound(_0x10234f,null))[_0xc578('0x24')](removeEntity(_0x10234f,null))['catch'](handleError(_0x10234f,null));}; \ No newline at end of file +var _0xcbaf=['findAll','rows','show','params','rawAttributes','length','find','create','body','catch','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1b0b72,_0x46aef0){var _0x18c545=function(_0x3b35ef){while(--_0x3b35ef){_0x1b0b72['push'](_0x1b0b72['shift']());}};_0x18c545(++_0x46aef0);}(_0xcbaf,0xa0));var _0xfcba=function(_0x206cfc,_0x40c54f){_0x206cfc=_0x206cfc-0x0;var _0x35fb28=_0xcbaf[_0x206cfc];return _0x35fb28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcba('0x0'));var rp=require('request-promise');var moment=require(_0xfcba('0x1'));var BPromise=require(_0xfcba('0x2'));var Mustache=require(_0xfcba('0x3'));var util=require(_0xfcba('0x4'));var path=require('path');var sox=require(_0xfcba('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcba('0x6'));var squel=require(_0xfcba('0x7'));var crypto=require(_0xfcba('0x8'));var jsforce=require(_0xfcba('0x9'));var deskjs=require(_0xfcba('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfcba('0xb'));var Papa=require(_0xfcba('0xc'));var Redis=require(_0xfcba('0xd'));var authService=require(_0xfcba('0xe'));var qs=require(_0xfcba('0xf'));var as=require(_0xfcba('0x10'));var hardwareService=require(_0xfcba('0x11'));var logger=require(_0xfcba('0x12'))('api');var utils=require(_0xfcba('0x13'));var config=require(_0xfcba('0x14'));var licenseUtil=require(_0xfcba('0x15'));var db=require(_0xfcba('0x16'))['db'];function respondWithStatusCode(_0x2504be,_0x453fe5){_0x453fe5=_0x453fe5||0xcc;return function(_0x568892){if(_0x568892){return _0x2504be[_0xfcba('0x17')](_0x453fe5);}return _0x2504be['status'](_0x453fe5)[_0xfcba('0x18')]();};}function respondWithResult(_0x41456f,_0x37f83e){_0x37f83e=_0x37f83e||0xc8;return function(_0x4b58b2){if(_0x4b58b2){return _0x41456f[_0xfcba('0x19')](_0x37f83e)[_0xfcba('0x1a')](_0x4b58b2);}};}function respondWithFilteredResult(_0x20c75a,_0x57af23){return function(_0xffd192){if(_0xffd192){var _0x276ee3=typeof _0x57af23[_0xfcba('0x1b')]===_0xfcba('0x1c')&&typeof _0x57af23[_0xfcba('0x1d')]==='undefined';var _0x590c13=_0xffd192[_0xfcba('0x1e')];var _0x58b004=_0x276ee3?0x0:_0x57af23[_0xfcba('0x1b')];var _0x35a050=_0x276ee3?_0xffd192[_0xfcba('0x1e')]:_0x57af23[_0xfcba('0x1b')]+_0x57af23[_0xfcba('0x1d')];var _0x2b0fcf;if(_0x35a050>=_0x590c13){_0x35a050=_0x590c13;_0x2b0fcf=0xc8;}else{_0x2b0fcf=0xce;}_0x20c75a[_0xfcba('0x19')](_0x2b0fcf);return _0x20c75a[_0xfcba('0x1f')](_0xfcba('0x20'),_0x58b004+'-'+_0x35a050+'/'+_0x590c13)[_0xfcba('0x1a')](_0xffd192);}return null;};}function patchUpdates(_0x1f6d4a){return function(_0x51c2c3){try{jsonpatch['apply'](_0x51c2c3,_0x1f6d4a,!![]);}catch(_0x182b47){return BPromise[_0xfcba('0x21')](_0x182b47);}return _0x51c2c3[_0xfcba('0x22')]();};}function saveUpdates(_0x1f345b,_0x4f279c){return function(_0x8413b3){if(_0x8413b3){return _0x8413b3[_0xfcba('0x23')](_0x1f345b)[_0xfcba('0x24')](function(_0x382a39){return _0x382a39;});}return null;};}function removeEntity(_0x42d9d8,_0x1b413a){return function(_0x3ddd22){if(_0x3ddd22){return _0x3ddd22[_0xfcba('0x25')]()[_0xfcba('0x24')](function(){_0x42d9d8[_0xfcba('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ac01,_0x43c1b0){return function(_0x57d8db){if(!_0x57d8db){_0x23ac01[_0xfcba('0x17')](0x194);}return _0x57d8db;};}function handleError(_0x46f256,_0x2f93a5){_0x2f93a5=_0x2f93a5||0x1f4;return function(_0x3a78c0){logger[_0xfcba('0x26')](_0x3a78c0[_0xfcba('0x27')]);if(_0x3a78c0[_0xfcba('0x28')]){delete _0x3a78c0[_0xfcba('0x28')];}_0x46f256[_0xfcba('0x19')](_0x2f93a5)[_0xfcba('0x29')](_0x3a78c0);};}exports[_0xfcba('0x2a')]=function(_0x3cf16c,_0x2e5349){var _0x4499a6={},_0x398cc7={},_0x2eefa2={'count':0x0,'rows':[]};var _0xd0e260=_['map'](db[_0xfcba('0x2b')]['rawAttributes'],function(_0x32cc74){return{'name':_0x32cc74[_0xfcba('0x2c')],'type':_0x32cc74[_0xfcba('0x2d')][_0xfcba('0x2e')]};});_0x398cc7[_0xfcba('0x2f')]=_[_0xfcba('0x30')](_0xd0e260,_0xfcba('0x28'));_0x398cc7[_0xfcba('0x31')]=_[_0xfcba('0x32')](_0x3cf16c[_0xfcba('0x31')]);_0x398cc7[_0xfcba('0x33')]=_[_0xfcba('0x34')](_0x398cc7[_0xfcba('0x2f')],_0x398cc7[_0xfcba('0x31')]);_0x4499a6['attributes']=_['intersection'](_0x398cc7[_0xfcba('0x2f')],qs[_0xfcba('0x35')](_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x35')]));_0x4499a6['attributes']=_0x4499a6['attributes']['length']?_0x4499a6[_0xfcba('0x36')]:_0x398cc7[_0xfcba('0x2f')];if(!_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x37')]('nolimit')){_0x4499a6['limit']=qs[_0xfcba('0x1d')](_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x1d')]);_0x4499a6['offset']=qs['offset'](_0x3cf16c[_0xfcba('0x31')]['offset']);}_0x4499a6[_0xfcba('0x38')]=qs[_0xfcba('0x39')](_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x39')]);_0x4499a6[_0xfcba('0x3a')]=qs[_0xfcba('0x33')](_[_0xfcba('0x3b')](_0x3cf16c['query'],_0x398cc7[_0xfcba('0x33')]),_0xd0e260);if(_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x3c')]){_0x4499a6[_0xfcba('0x3a')]=_[_0xfcba('0x3d')](_0x4499a6['where'],{'$or':_[_0xfcba('0x30')](_0xd0e260,function(_0x278bb1){if(_0x278bb1[_0xfcba('0x2d')]!==_0xfcba('0x3e')){var _0x82b740={};_0x82b740[_0x278bb1[_0xfcba('0x28')]]={'$like':'%'+_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x3c')]+'%'};return _0x82b740;}})});}_0x4499a6=_[_0xfcba('0x3d')]({},_0x4499a6,_0x3cf16c[_0xfcba('0x3f')]);var _0x2f093f={'where':_0x4499a6[_0xfcba('0x3a')]};return db[_0xfcba('0x2b')][_0xfcba('0x1e')](_0x2f093f)[_0xfcba('0x24')](function(_0x4687d1){_0x2eefa2[_0xfcba('0x1e')]=_0x4687d1;if(_0x3cf16c[_0xfcba('0x31')][_0xfcba('0x40')]){_0x4499a6['include']=[{'all':!![]}];}return db[_0xfcba('0x2b')][_0xfcba('0x41')](_0x4499a6);})[_0xfcba('0x24')](function(_0x3d4443){_0x2eefa2[_0xfcba('0x42')]=_0x3d4443;return _0x2eefa2;})[_0xfcba('0x24')](respondWithFilteredResult(_0x2e5349,_0x4499a6))['catch'](handleError(_0x2e5349,null));};exports[_0xfcba('0x43')]=function(_0x31eb28,_0x57f2e8){var _0x403d9a={'raw':!![],'where':{'id':_0x31eb28[_0xfcba('0x44')]['id']}},_0x3e75c0={};_0x3e75c0[_0xfcba('0x2f')]=_[_0xfcba('0x32')](db[_0xfcba('0x2b')][_0xfcba('0x45')]);_0x3e75c0[_0xfcba('0x31')]=_[_0xfcba('0x32')](_0x31eb28['query']);_0x3e75c0[_0xfcba('0x33')]=_[_0xfcba('0x34')](_0x3e75c0['model'],_0x3e75c0[_0xfcba('0x31')]);_0x403d9a[_0xfcba('0x36')]=_['intersection'](_0x3e75c0[_0xfcba('0x2f')],qs['fields'](_0x31eb28[_0xfcba('0x31')][_0xfcba('0x35')]));_0x403d9a['attributes']=_0x403d9a[_0xfcba('0x36')][_0xfcba('0x46')]?_0x403d9a['attributes']:_0x3e75c0[_0xfcba('0x2f')];if(_0x31eb28['query']['includeAll']){_0x403d9a['include']=[{'all':!![]}];}_0x403d9a=_[_0xfcba('0x3d')]({},_0x403d9a,_0x31eb28['options']);return db[_0xfcba('0x2b')][_0xfcba('0x47')](_0x403d9a)['then'](handleEntityNotFound(_0x57f2e8,null))[_0xfcba('0x24')](respondWithResult(_0x57f2e8,null))['catch'](handleError(_0x57f2e8,null));};exports[_0xfcba('0x48')]=function(_0x33ddc8,_0x2dff73){return db[_0xfcba('0x2b')][_0xfcba('0x48')](_0x33ddc8[_0xfcba('0x49')],{})[_0xfcba('0x24')](respondWithResult(_0x2dff73,0xc9))[_0xfcba('0x4a')](handleError(_0x2dff73,null));};exports[_0xfcba('0x23')]=function(_0x3ac651,_0x331903){if(_0x3ac651[_0xfcba('0x49')]['id']){delete _0x3ac651['body']['id'];}return db[_0xfcba('0x2b')]['find']({'where':{'id':_0x3ac651[_0xfcba('0x44')]['id']}})['then'](handleEntityNotFound(_0x331903,null))[_0xfcba('0x24')](saveUpdates(_0x3ac651[_0xfcba('0x49')],null))[_0xfcba('0x24')](respondWithResult(_0x331903,null))[_0xfcba('0x4a')](handleError(_0x331903,null));};exports[_0xfcba('0x25')]=function(_0x2ff604,_0x34bb95){return db[_0xfcba('0x2b')]['find']({'where':{'id':_0x2ff604[_0xfcba('0x44')]['id']}})[_0xfcba('0x24')](handleEntityNotFound(_0x34bb95,null))[_0xfcba('0x24')](removeEntity(_0x34bb95,null))[_0xfcba('0x4a')](handleError(_0x34bb95,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a5d58ff..13941a0 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 _0x2f54=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x2f54,0xa6));var _0x42f5=function(_0x279c80,_0x3c9692){_0x279c80=_0x279c80-0x0;var _0x4e1f5c=_0x2f54[_0x279c80];return _0x4e1f5c;};'use strict';var _=require('lodash');var util=require(_0x42f5('0x0'));var logger=require('../../config/logger')(_0x42f5('0x1'));var moment=require('moment');var BPromise=require(_0x42f5('0x2'));var rp=require(_0x42f5('0x3'));var fs=require('fs');var path=require(_0x42f5('0x4'));var rimraf=require(_0x42f5('0x5'));var config=require(_0x42f5('0x6'));var attributes=require(_0x42f5('0x7'));module['exports']=function(_0x2d76c1,_0x3990c0){return _0x2d76c1[_0x42f5('0x8')](_0x42f5('0x9'),attributes,{'tableName':_0x42f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42f5('0xb'),'collate':_0x42f5('0xc')});}; \ No newline at end of file +var _0x0c9c=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0c9c,0x188));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc0c9('0x0'));var util=require(_0xc0c9('0x1'));var logger=require(_0xc0c9('0x2'))(_0xc0c9('0x3'));var moment=require('moment');var BPromise=require(_0xc0c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0c9('0x5'));var rimraf=require(_0xc0c9('0x6'));var config=require(_0xc0c9('0x7'));var attributes=require(_0xc0c9('0x8'));module[_0xc0c9('0x9')]=function(_0x46f5be,_0x439963){return _0x46f5be[_0xc0c9('0xa')](_0xc0c9('0xb'),attributes,{'tableName':_0xc0c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0c9('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 13f24d4..c756c48 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 _0xc0d7=['rpc','../../config/environment','jayson/promise','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b9c29,_0x46c107){var _0xfacb34=function(_0x120a6a){while(--_0x120a6a){_0x4b9c29['push'](_0x4b9c29['shift']());}};_0xfacb34(++_0x46c107);}(_0xc0d7,0x7f));var _0x7c0d=function(_0xfa0442,_0x58d343){_0xfa0442=_0xfa0442-0x0;var _0x4ed54f=_0xc0d7[_0xfa0442];return _0x4ed54f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7c0d('0x0'));var rs=require(_0x7c0d('0x1'));var fs=require('fs');var Redis=require(_0x7c0d('0x2'));var db=require(_0x7c0d('0x3'))['db'];var utils=require(_0x7c0d('0x4'));var logger=require(_0x7c0d('0x5'))(_0x7c0d('0x6'));var config=require(_0x7c0d('0x7'));var jayson=require(_0x7c0d('0x8'));var client=jayson['client'][_0x7c0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14f205,_0x22101d,_0x3ffcff){return new BPromise(function(_0x5e6d16,_0x35c579){return client[_0x7c0d('0xa')](_0x14f205,_0x3ffcff)[_0x7c0d('0xb')](function(_0xfd38a0){logger['info'](_0x7c0d('0xc'),_0x22101d,_0x7c0d('0xd'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x22101d,_0x7c0d('0xd'),JSON[_0x7c0d('0xe')](_0xfd38a0));if(_0xfd38a0['error']){if(_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x10')]===0x1f4){logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);return _0x35c579(_0xfd38a0['error'][_0x7c0d('0x11')]);}logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);return _0x5e6d16(_0xfd38a0[_0x7c0d('0xf')][_0x7c0d('0x11')]);}else{logger[_0x7c0d('0x12')]('SmsApplication,\x20%s,\x20%s',_0x22101d,_0x7c0d('0xd'));_0x5e6d16(_0xfd38a0['result'][_0x7c0d('0x11')]);}})['catch'](function(_0x2a8f3f){logger[_0x7c0d('0xf')](_0x7c0d('0xc'),_0x22101d,_0x2a8f3f);_0x35c579(_0x2a8f3f);});});} \ No newline at end of file +var _0xb1ef=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x45cb31,_0x4dd156){var _0x545a96=function(_0xb98ce4){while(--_0xb98ce4){_0x45cb31['push'](_0x45cb31['shift']());}};_0x545a96(++_0x4dd156);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var moment=require('moment');var BPromise=require(_0xfb1e('0x2'));var rs=require(_0xfb1e('0x3'));var fs=require('fs');var Redis=require(_0xfb1e('0x4'));var db=require(_0xfb1e('0x5'))['db'];var utils=require(_0xfb1e('0x6'));var logger=require(_0xfb1e('0x7'))(_0xfb1e('0x8'));var config=require(_0xfb1e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb1e('0xa')][_0xfb1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1455fa,_0xccf70,_0x502d8e){return new BPromise(function(_0x5eadcc,_0x3c7643){return client[_0xfb1e('0xc')](_0x1455fa,_0x502d8e)[_0xfb1e('0xd')](function(_0x1ac2dd){logger[_0xfb1e('0xe')](_0xfb1e('0xf'),_0xccf70,_0xfb1e('0x10'));logger[_0xfb1e('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xccf70,_0xfb1e('0x10'),JSON[_0xfb1e('0x12')](_0x1ac2dd));if(_0x1ac2dd[_0xfb1e('0x13')]){if(_0x1ac2dd[_0xfb1e('0x13')][_0xfb1e('0x14')]===0x1f4){logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x1ac2dd['error'][_0xfb1e('0x15')]);return _0x3c7643(_0x1ac2dd[_0xfb1e('0x13')]['message']);}logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x1ac2dd[_0xfb1e('0x13')][_0xfb1e('0x15')]);return _0x5eadcc(_0x1ac2dd[_0xfb1e('0x13')]['message']);}else{logger[_0xfb1e('0xe')](_0xfb1e('0xf'),_0xccf70,_0xfb1e('0x10'));_0x5eadcc(_0x1ac2dd[_0xfb1e('0x16')][_0xfb1e('0x15')]);}})['catch'](function(_0x2f3d7e){logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x2f3d7e);_0x3c7643(_0x2f3d7e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 119096c..a55dbe0 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 _0x9ffd=['sms','smsinteraction:addtags','put','smsinteraction:update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x107bbb,_0x20b1f5){var _0x46f16f=function(_0x1ffa05){while(--_0x1ffa05){_0x107bbb['push'](_0x107bbb['shift']());}};_0x46f16f(++_0x20b1f5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x47934b,_0x28dc47){_0x47934b=_0x47934b-0x0;var _0x19dcf3=_0x9ffd[_0x47934b];return _0x19dcf3;};'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['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x12')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router['post']('/:id/messages',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x14')]);router[_0xd9ff('0x12')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),interaction['tracked'](_0xd9ff('0x16'),_0xd9ff('0x17')),controller['addTags']);router[_0xd9ff('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked']('sms',_0xd9ff('0x19')),controller['update']);router[_0xd9ff('0x1a')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),interaction[_0xd9ff('0x1b')](_0xd9ff('0x16'),_0xd9ff('0x1c')),controller[_0xd9ff('0x1d')]);router[_0xd9ff('0x1a')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x1e')]);module[_0xd9ff('0x1f')]=router; \ No newline at end of file +var _0x0713=['put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','smsinteraction:addtags','addTags'];(function(_0x4641d6,_0x5e9a6e){var _0x28d49a=function(_0x297aa0){while(--_0x297aa0){_0x4641d6['push'](_0x4641d6['shift']());}};_0x28d49a(++_0x5e9a6e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/download',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x11')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['post']('/:id/messages',auth[_0x3071('0x9')](),controller['addMessage']);router[_0x3071('0x11')](_0x3071('0x13'),auth['isAuthenticated'](),interaction[_0x3071('0x14')]('sms',_0x3071('0x15')),controller[_0x3071('0x16')]);router[_0x3071('0x17')](_0x3071('0xd'),auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x19')),controller[_0x3071('0x1a')]);router[_0x3071('0x1b')]('/:id',auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x1c')),controller[_0x3071('0x1d')]);router[_0x3071('0x1b')](_0x3071('0x13'),auth[_0x3071('0x9')](),controller['removeTags']);module[_0x3071('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index bffc3dd..a9333dc 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 _0x7266=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x21e757,_0x45ddd7){var _0x4524ad=function(_0x427fc4){while(--_0x427fc4){_0x21e757['push'](_0x21e757['shift']());}};_0x4524ad(++_0x45ddd7);}(_0x7266,0xec));var _0x6726=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x7266[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x6726('0x0'));var moment=require(_0x6726('0x1'));module[_0x6726('0x2')]={'closed':{'type':Sequelize[_0x6726('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6726('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6726('0x5')]},'note':{'type':Sequelize[_0x6726('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x6726('0x6')]('in',_0x6726('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6726('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6726('0x6')]('in',_0x6726('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6726('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6631=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x6631,0x134));var _0x1663=function(_0x1d3837,_0x33e7d1){_0x1d3837=_0x1d3837-0x0;var _0x15ad69=_0x6631[_0x1d3837];return _0x15ad69;};'use strict';var Sequelize=require(_0x1663('0x0'));var moment=require(_0x1663('0x1'));module[_0x1663('0x2')]={'closed':{'type':Sequelize[_0x1663('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1663('0x4')]},'disposition':{'type':Sequelize[_0x1663('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1663('0x5')]},'note':{'type':Sequelize[_0x1663('0x5')]},'phone':{'type':Sequelize[_0x1663('0x5')]},'read1stAt':{'type':Sequelize[_0x1663('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1663('0x6')]('in',_0x1663('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1663('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1663('0x6')]('in',_0x1663('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1663('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 6d9f4a9..cb8e1ea 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 _0xc663=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','error','stack','name','send','Users','map','TagIds','split','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','color','from','tools_tags','field','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','select','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','text','start','Tag','forEach','union','User','buildExpression','body','some','compact','SmsAccountId','createdAt','parse','$gte','$lte','where','null','\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?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','show','rawAttributes','includeAll','merge','options','SmsInteraction','create','params','describe','addMessage','SmsMessage','omit','ids','getMessages','nolimit','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','tmp','format','transcript-%d-%s.zip','fullname','firstName','Messages','direction','secret','SmsAccount','Account','get','Sms','Owner','N.A.','closedAt','disposition','out','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xc663,0xe3));var _0x3c66=function(_0x5012e0,_0x47a186){_0x5012e0=_0x5012e0-0x0;var _0x72706d=_0xc663[_0x5012e0];return _0x72706d;};'use strict';var emlformat=require(_0x3c66('0x0'));var rimraf=require(_0x3c66('0x1'));var zipdir=require(_0x3c66('0x2'));var jsonpatch=require(_0x3c66('0x3'));var rp=require(_0x3c66('0x4'));var moment=require(_0x3c66('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c66('0x6'));var util=require(_0x3c66('0x7'));var path=require('path');var sox=require(_0x3c66('0x8'));var csv=require('to-csv');var ejs=require(_0x3c66('0x9'));var fs=require('fs');var fs_extra=require(_0x3c66('0xa'));var _=require(_0x3c66('0xb'));var squel=require('squel');var crypto=require(_0x3c66('0xc'));var jsforce=require(_0x3c66('0xd'));var deskjs=require(_0x3c66('0xe'));var toCsv=require(_0x3c66('0xf'));var querystring=require(_0x3c66('0x10'));var Papa=require(_0x3c66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3c66('0x12'));var as=require(_0x3c66('0x13'));var pdf=require(_0x3c66('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c66('0x15'))(_0x3c66('0x16'));var utils=require(_0x3c66('0x17'));var config=require(_0x3c66('0x18'));var licenseUtil=require(_0x3c66('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3c66('0x1a')](config['redis'],{'host':_0x3c66('0x1b'),'port':0x18eb});var socket=require(_0x3c66('0x1c'))(new Redis(config[_0x3c66('0x1d')]));require('./smsInteraction.socket')[_0x3c66('0x1e')](socket);function respondWithStatusCode(_0x4b3149,_0x1b452e){_0x1b452e=_0x1b452e||0xcc;return function(_0x3f50a4){if(_0x3f50a4){return _0x4b3149[_0x3c66('0x1f')](_0x1b452e);}return _0x4b3149[_0x3c66('0x20')](_0x1b452e)[_0x3c66('0x21')]();};}function respondWithResult(_0x281779,_0x1ccebb){_0x1ccebb=_0x1ccebb||0xc8;return function(_0x28f30e){if(_0x28f30e){return _0x281779[_0x3c66('0x20')](_0x1ccebb)[_0x3c66('0x22')](_0x28f30e);}};}function respondWithFilteredResult(_0x4bdcd5,_0x517b61){return function(_0x3ded73){if(_0x3ded73){var _0x2bd603=typeof _0x517b61['offset']===_0x3c66('0x23')&&typeof _0x517b61[_0x3c66('0x24')]===_0x3c66('0x23');var _0x4beaa0=_0x3ded73[_0x3c66('0x25')];var _0x4181bb=_0x2bd603?0x0:_0x517b61[_0x3c66('0x26')];var _0x414738=_0x2bd603?_0x3ded73['count']:_0x517b61[_0x3c66('0x26')]+_0x517b61['limit'];var _0x36ea6f;if(_0x414738>=_0x4beaa0){_0x414738=_0x4beaa0;_0x36ea6f=0xc8;}else{_0x36ea6f=0xce;}_0x4bdcd5[_0x3c66('0x20')](_0x36ea6f);return _0x4bdcd5['set'](_0x3c66('0x27'),_0x4181bb+'-'+_0x414738+'/'+_0x4beaa0)['json'](_0x3ded73);}return null;};}function patchUpdates(_0x233287){return function(_0x370264){try{jsonpatch['apply'](_0x370264,_0x233287,!![]);}catch(_0x140c19){return BPromise[_0x3c66('0x28')](_0x140c19);}return _0x370264['save']();};}function saveUpdates(_0x3b46d6,_0x46f194){return function(_0x1903ce){if(_0x1903ce){return _0x1903ce[_0x3c66('0x29')](_0x3b46d6)[_0x3c66('0x2a')](function(_0x1c038c){return _0x1c038c;});}return null;};}function removeEntity(_0x485672,_0x46ebc1){return function(_0x35c224){if(_0x35c224){return _0x35c224[_0x3c66('0x2b')]()[_0x3c66('0x2a')](function(){_0x485672[_0x3c66('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10c2c6,_0x26d8a8){return function(_0x359ab8){if(!_0x359ab8){_0x10c2c6[_0x3c66('0x1f')](0x194);}return _0x359ab8;};}function handleError(_0x3fb1db,_0x1b75c2){_0x1b75c2=_0x1b75c2||0x1f4;return function(_0x9f775f){logger[_0x3c66('0x2c')](_0x9f775f[_0x3c66('0x2d')]);if(_0x9f775f['name']){delete _0x9f775f[_0x3c66('0x2e')];}_0x3fb1db[_0x3c66('0x20')](_0x1b75c2)[_0x3c66('0x2f')](_0x9f775f);};}function getInteractionUsers(_0x217733,_0x332f7c){return new BPromise(function(_0x1a6946,_0x291d6f){try{if(_0x332f7c[_0x217733['id']]){_0x217733[_0x3c66('0x30')]=_[_0x3c66('0x31')](_0x332f7c[_0x217733['id']],function(_0x12bdf2){return{'id':_0x12bdf2['id'],'fullname':_0x12bdf2['fullname']};});}}catch(_0x2c9fb2){_0x291d6f(_0x2c9fb2);}_0x1a6946(_0x217733);});}function getInteractionTags(_0x58549a,_0xd43cb8){return new BPromise(function(_0x2797bc,_0x2e3bb7){try{if(_0x58549a[_0x3c66('0x32')]){_0x58549a['Tags']=[];_0x58549a[_0x3c66('0x32')][_0x3c66('0x33')](',')['forEach'](function(_0x242923){_0x58549a['Tags'][_0x3c66('0x34')](_0xd43cb8[_0x242923]);});}delete _0x58549a[_0x3c66('0x32')];}catch(_0x1d7a11){_0x2e3bb7(_0x1d7a11);}_0x2797bc(_0x58549a);});}function updateSmsInteraction(_0x99a5c9,_0x500288,_0x47af2b){return new BPromise(function(_0x50c1c8,_0x4c5898){return getInteractionUsers(_0x99a5c9,_0x47af2b)[_0x3c66('0x2a')](function(_0x6c7350){return getInteractionTags(_0x6c7350,_0x500288);})['then'](function(_0xe23a0d){return getStateInteraction(_0xe23a0d);})[_0x3c66('0x2a')](function(_0x26f16c){_0x50c1c8(_0x26f16c);})[_0x3c66('0x35')](function(_0x5ce6b4){_0x4c5898(_0x5ce6b4);});});}function getStateInteraction(_0x260d17){return new BPromise(function(_0x4c2283){_0x260d17[_0x3c66('0x36')]=0x0;_0x260d17[_0x3c66('0x37')]=0x0;_0x260d17[_0x3c66('0x38')]=0x0;_0x260d17[_0x3c66('0x39')]=0x0;_0x260d17[_0x3c66('0x3a')]=0x0;if(!_0x260d17[_0x3c66('0x3b')]&&!_0x260d17[_0x3c66('0x3c')]){_0x260d17[_0x3c66('0x36')]+=0x1;}if(!_0x260d17[_0x3c66('0x3b')]&&_0x260d17[_0x3c66('0x3c')]){_0x260d17[_0x3c66('0x37')]+=0x1;if(_0x260d17[_0x3c66('0x36')]){_0x260d17[_0x3c66('0x36')]-=0x1;}}if(_0x260d17[_0x3c66('0x3b')]&&_0x260d17['UserId']){_0x260d17[_0x3c66('0x38')]+=0x1;if(_0x260d17[_0x3c66('0x37')]){_0x260d17[_0x3c66('0x37')]-=0x1;}}if(_0x260d17[_0x3c66('0x3b')]&&!_0x260d17[_0x3c66('0x3c')]){_0x260d17[_0x3c66('0x39')]+=0x1;if(_0x260d17[_0x3c66('0x36')]){_0x260d17['waiting']-=0x1;}}_0x260d17['total']+=0x1;_0x4c2283(_0x260d17);});}exports['index']=function(_0x39b23d,_0xb45680){var _0x2355b4={},_0x495c6a={},_0x5b7b30={'count':0x0,'rows':[]};var _0x1886b4=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x116c1){return{'name':_0x116c1['fieldName'],'type':_0x116c1['type']['key']};});_0x495c6a[_0x3c66('0x3d')]=_[_0x3c66('0x31')](_0x1886b4,_0x3c66('0x2e'));_0x495c6a[_0x3c66('0x3e')]=_[_0x3c66('0x3f')](_0x39b23d[_0x3c66('0x3e')]);_0x495c6a[_0x3c66('0x40')]=_['intersection'](_0x495c6a[_0x3c66('0x3d')],_0x495c6a[_0x3c66('0x3e')]);_0x2355b4[_0x3c66('0x41')]=_[_0x3c66('0x42')](_0x495c6a[_0x3c66('0x3d')],qs[_0x3c66('0x43')](_0x39b23d['query']['fields']));_0x2355b4[_0x3c66('0x41')]=_0x2355b4[_0x3c66('0x41')][_0x3c66('0x44')]?_0x2355b4[_0x3c66('0x41')]:_0x495c6a[_0x3c66('0x3d')];if(!_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x45')]('nolimit')){_0x2355b4[_0x3c66('0x24')]=qs[_0x3c66('0x24')](_0x39b23d['query']['limit']);_0x2355b4[_0x3c66('0x26')]=qs[_0x3c66('0x26')](_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x26')]);}_0x2355b4[_0x3c66('0x46')]=qs[_0x3c66('0x47')](_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x47')]);_0x2355b4['where']=qs[_0x3c66('0x40')](_[_0x3c66('0x48')](_0x39b23d[_0x3c66('0x3e')],_0x495c6a[_0x3c66('0x40')]),_0x1886b4);var _0xf24e0b=[];var _0x2f6801=squel['select']()['field']('id')['field'](_0x3c66('0x2e'))['field'](_0x3c66('0x49'))[_0x3c66('0x4a')](_0x3c66('0x4b'));var _0x201b72=squel['select']()[_0x3c66('0x4c')](_0x3c66('0x4d'))['field'](_0x3c66('0x4e'))[_0x3c66('0x4c')](_0x3c66('0x4f'))[_0x3c66('0x4a')](_0x3c66('0x50'),'ui')['left_join']('users','u',_0x3c66('0x51'));var _0x5d1b09=squel[_0x3c66('0x52')]()[_0x3c66('0x4a')](_0x3c66('0x53'),'i')[_0x3c66('0x54')]('cm_contacts','c',_0x3c66('0x55'))['left_join'](_0x3c66('0x56'),'o',_0x3c66('0x57'))[_0x3c66('0x54')](_0x3c66('0x58'),'a',_0x3c66('0x59'))[_0x3c66('0x54')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x3c66('0x54')](_0x3c66('0x5a'),'it',_0x3c66('0x5b'))[_0x3c66('0x54')]('tools_tags','t',_0x3c66('0x5c'));var _0xa6c1f2=squel['expr']();var _0xe11b=[];var _0xb1372a=squel['expr']();var _0x835c57;if(_0x39b23d['query'][_0x3c66('0x5d')]){_0x835c57=as[_0x3c66('0x5e')](_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x5d')]);var _0x12cc12=_0x835c57[_0x3c66('0x5f')];for(var _0x30d041=0x0;_0x30d041<_0x835c57[_0x3c66('0x60')][_0x3c66('0x44')];_0x30d041++){var _0x3d9dc4=_0x835c57['conditions'][_0x30d041];var _0x12cf9e='i';var _0x437475=_['find'](_0x1886b4,[_0x3c66('0x2e'),_0x3d9dc4['field']]);if(!_0x437475){switch(_0x3d9dc4[_0x3c66('0x4c')]){case'unreadMessages':if(_0x3d9dc4[_0x3c66('0x61')]==0x1){_0x5d1b09[_0x3c66('0x62')]('`'+_0x3d9dc4[_0x3c66('0x4c')]+_0x3c66('0x63'));}else{_0x5d1b09[_0x3c66('0x62')]('`'+_0x3d9dc4['field']+_0x3c66('0x64'));}break;case _0x3c66('0x65'):if(_0x3d9dc4[_0x3c66('0x66')]===_0x3c66('0x67')){if(_0x3d9dc4['value'][_0x3c66('0x33')]('\x20')[_0x3c66('0x44')]>0x1){_0xa6c1f2[_0x12cc12]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3c66('0x68')](_0x3d9dc4['value']),null);}else{var _0x17facf='%'+_0x3d9dc4['value']+'%';_0xa6c1f2[_0x12cc12](_0x3c66('0x69'),_0x17facf,_0x17facf,_0x17facf);}}else{_0x437475=_[_0x3c66('0x6a')](_0x1886b4,[_0x3c66('0x2e'),_0x3c66('0x6b')]);_0x3d9dc4[_0x3c66('0x4c')]='ContactId';_0x521324=as['buildExpression'](_0x12cf9e,_0x437475[_0x3c66('0x6c')],_0x3d9dc4);_0xa6c1f2[_0x12cc12](_0x521324[_0x3c66('0x6d')],_0x521324['value'][_0x3c66('0x6e')],_0x521324['value'][_0x3c66('0x21')]);}break;case _0x3c66('0x6f'):var _0x18d288=_0x3d9dc4['value'][_0x3c66('0x33')](',')['map'](function(_0x3a097f){return Number(_0x3a097f);});_0x18d288[_0x3c66('0x70')](function(_0x3a0105){_0xb1372a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a0105+',%');});_0xe11b=_[_0x3c66('0x71')](_0xe11b,_0x18d288);break;case _0x3c66('0x72'):if(_0x3d9dc4['operator']===_0x3c66('0x67')){_0xa6c1f2[_0x12cc12]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3d9dc4[_0x3c66('0x61')]+'%',null);}else{_0x437475=_[_0x3c66('0x6a')](_0x1886b4,[_0x3c66('0x2e'),_0x3c66('0x3c')]);_0x3d9dc4[_0x3c66('0x4c')]=_0x3c66('0x3c');_0x521324=as[_0x3c66('0x73')](_0x12cf9e,_0x437475[_0x3c66('0x6c')],_0x3d9dc4);_0xa6c1f2[_0x12cc12](_0x521324[_0x3c66('0x6d')],_0x521324[_0x3c66('0x61')][_0x3c66('0x6e')],_0x521324[_0x3c66('0x61')][_0x3c66('0x21')]);}break;case _0x3c66('0x74'):_0x521324=as[_0x3c66('0x73')]('me',null,_0x3d9dc4);_0xa6c1f2[_0x12cc12](_0x521324[_0x3c66('0x6d')],_0x521324['value']['start'],_0x521324['value'][_0x3c66('0x21')]);break;}}else{var _0x521324=as[_0x3c66('0x73')](_0x12cf9e,_0x437475[_0x3c66('0x6c')],_0x3d9dc4);_0xa6c1f2[_0x12cc12](_0x521324[_0x3c66('0x6d')],_0x521324['value'][_0x3c66('0x6e')],_0x521324[_0x3c66('0x61')]['end']);}}}else{var _0x132bb6=_(_0x39b23d[_0x3c66('0x3e')])[_0x3c66('0x3f')]()['map'](function(_0x2ad64a){return _[_0x3c66('0x75')](_0x1886b4,['name',_0x2ad64a])?_0x2ad64a:undefined;})[_0x3c66('0x76')]()['value']();if(!_['isEmpty'](_0x132bb6)){_0x132bb6[_0x3c66('0x70')](function(_0x59f364){if(_0x59f364===_0x3c66('0x77')){_0x5d1b09['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x39b23d[_0x3c66('0x3e')][_0x59f364]));}else if(_0x59f364===_0x3c66('0x78')){var _0x532992=JSON[_0x3c66('0x79')](_0x39b23d['query'][_0x59f364])[_0x3c66('0x7a')];var _0x1bfc36=JSON[_0x3c66('0x79')](_0x39b23d[_0x3c66('0x3e')][_0x59f364])[_0x3c66('0x7b')];_0x5d1b09[_0x3c66('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x532992,_0x1bfc36);}else{if(_0x39b23d['query'][_0x59f364]===_0x3c66('0x7d')){_0x5d1b09[_0x3c66('0x7c')]('i.'+_0x59f364+_0x3c66('0x7e'));}else{_0x5d1b09[_0x3c66('0x7c')]('i.'+_0x59f364+'\x20=\x20?',_0x39b23d[_0x3c66('0x3e')][_0x59f364]);}}});}if(_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x7f')]){if(_0x39b23d['query'][_0x3c66('0x7f')]==0x1){_0x5d1b09[_0x3c66('0x62')](_0x3c66('0x80'));}else{_0x5d1b09[_0x3c66('0x62')](_0x3c66('0x81'));}}if(_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x82')]){_0xe11b=_[_0x3c66('0x83')](_0x39b23d[_0x3c66('0x3e')]['tag'])?_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x82')]:new Array(_0x39b23d['query'][_0x3c66('0x82')]);_0xe11b[_0x3c66('0x70')](function(_0x5d0f72){_0xb1372a['or'](_0x3c66('0x84'),'%,'+_0x5d0f72+',%');});}if(_0x39b23d['query'][_0x3c66('0x85')]){var _0x905cc5=_0x39b23d[_0x3c66('0x3e')]['filter'][_0x3c66('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3c66('0x87')](_0x905cc5)){_0xa6c1f2['or'](_0x3c66('0x88'),_0x905cc5+'%')['or'](_0x3c66('0x89'),_0x905cc5+'%');}else{_0xa6c1f2['or'](_0x3c66('0x8a'),qs[_0x3c66('0x68')](_0x905cc5))['or'](_0x3c66('0x8b'),_0x905cc5+'%');}}}_0x5d1b09[_0x3c66('0x7c')](_0xa6c1f2);_0x5d1b09[_0x3c66('0x8c')](_0x3c66('0x8d'));var _0x296a60={'type':db[_0x3c66('0x8e')][_0x3c66('0x8f')][_0x3c66('0x90')],'raw':!![]};var _0x14d03a=_0x5d1b09['clone']();_0x14d03a[_0x3c66('0x4c')](_0x3c66('0x8d'));_0x14d03a[_0x3c66('0x4c')](_0x3c66('0x91'),_0x3c66('0x92'));if(_0x2355b4['order']){_0x2355b4[_0x3c66('0x46')][_0x3c66('0x70')](function(_0x33655e){var _0x492862=_0x33655e[0x0]===_0x3c66('0x93')?_0x33655e[0x0]:'i.'+_0x33655e[0x0];_0x5d1b09[_0x3c66('0x46')](_0x492862,_0x33655e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3c66('0x94')](_0xe11b)){_0x5d1b09[_0x3c66('0x62')](_0xb1372a);_0x14d03a[_0x3c66('0x7c')](_0x3c66('0x95'),_0xe11b);}BPromise[_0x3c66('0x96')]()[_0x3c66('0x2a')](function(){if(!_0x835c57){if(_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x77')])return;_0x14d03a[_0x3c66('0x7c')](_0x3c66('0x97'));_0x5d1b09[_0x3c66('0x7c')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x39b23d[_0x3c66('0x98')][_0x3c66('0x99')]!==_0x3c66('0x9a'))return;return _0x39b23d[_0x3c66('0x98')][_0x3c66('0x9b')]({'attributes':['id'],'raw':!![]})[_0x3c66('0x2a')](function(_0x406afb){if(_[_0x3c66('0x94')](_0x406afb)){_0x14d03a[_0x3c66('0x7c')](_0x3c66('0x9c'));_0x5d1b09[_0x3c66('0x7c')](_0x3c66('0x9c'));}else{_0x14d03a['where'](_0x3c66('0x9d'),_[_0x3c66('0x31')](_0x406afb,'id'));_0x5d1b09['where'](_0x3c66('0x9d'),_[_0x3c66('0x31')](_0x406afb,'id'));}});})[_0x3c66('0x2a')](function(){if(_0x39b23d[_0x3c66('0x98')]['role']===_0x3c66('0x9a')&&!_0x835c57&&!_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x77')])return[];return db[_0x3c66('0x9e')][_0x3c66('0x3e')](_0x14d03a[_0x3c66('0x9f')](),_0x296a60);})[_0x3c66('0x2a')](function(_0x4f3b12){_0x5b7b30[_0x3c66('0x25')]=_0x4f3b12['length'];if(_0x5b7b30['count']===0x0)return[];return db[_0x3c66('0x9e')][_0x3c66('0x3e')](_0x2f6801[_0x3c66('0x9f')](),_0x296a60)['then'](function(_0xcb83d){_0xf24e0b=_[_0x3c66('0xa0')](_0xcb83d,'id');_0x296a60=_['merge'](_0x296a60,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39b23d[_0x3c66('0x3e')][_0x3c66('0x43')]){_0x2355b4[_0x3c66('0x41')][_0x3c66('0x70')](function(_0xe412e5){_0x5d1b09[_0x3c66('0x4c')]('i.'+_0xe412e5);});}else{_0x5d1b09['field'](_0x3c66('0x91'),'unreadMessages');_0x5d1b09[_0x3c66('0x4c')]('a.key','Account.key');_0x5d1b09['field']('a.mandatoryDisposition',_0x3c66('0xa1'));_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xa2'),'contactName');_0x5d1b09[_0x3c66('0x4c')]('i.*');_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xa3'),_0x3c66('0xa4'));_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xa5'),'Contact.lastName');_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xa6'),_0x3c66('0xa7'));_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xa8'),_0x3c66('0xa9'));_0x5d1b09['field'](_0x3c66('0xaa'),_0x3c66('0xab'));_0x5d1b09[_0x3c66('0x4c')](_0x3c66('0xac'),_0x3c66('0xad'));_0x5d1b09[_0x3c66('0x4c')]('o.fullname','Owner.fullname');_0x5d1b09['field'](_0x3c66('0xae'),'Owner.internal');_0x5d1b09['field'](_0x3c66('0xaf'),_0x3c66('0x32'));}if(_0x2355b4[_0x3c66('0x24')])_0x5d1b09['limit'](_0x2355b4[_0x3c66('0x24')]);if(_0x2355b4[_0x3c66('0x26')])_0x5d1b09[_0x3c66('0x26')](_0x2355b4['offset']);return db[_0x3c66('0x9e')][_0x3c66('0x3e')](_0x5d1b09[_0x3c66('0x9f')](),_0x296a60);})['then'](function(_0x321f41){if(_0x321f41['length']>0x0)_0x201b72[_0x3c66('0x7c')](_0x3c66('0xb0'),_['map'](_0x321f41,'id'));return db['sequelize'][_0x3c66('0x3e')](_0x201b72[_0x3c66('0x9f')](),_0x296a60)['then'](function(_0x2416e8){var _0x3d45d8=_[_0x3c66('0xb1')](_0x2416e8,'SmsInteractionId');var _0x584f34=[];_0x321f41[_0x3c66('0x70')](function(_0x49532d){_0x584f34[_0x3c66('0x34')](updateSmsInteraction(_0x49532d,_0xf24e0b,_0x3d45d8));});return BPromise[_0x3c66('0xb2')](_0x584f34);});});})[_0x3c66('0x2a')](function(_0x1fbd0b){_0x5b7b30['rows']=_0x1fbd0b;return _0x5b7b30;})[_0x3c66('0x2a')](respondWithFilteredResult(_0xb45680,_0x2355b4))[_0x3c66('0x35')](handleError(_0xb45680,null));};exports[_0x3c66('0xb3')]=function(_0x315317,_0x16cb55){var _0x2e5f56={'raw':![],'where':{'id':_0x315317['params']['id']}},_0x4d4174={};_0x4d4174[_0x3c66('0x3d')]=_[_0x3c66('0x3f')](db['SmsInteraction'][_0x3c66('0xb4')]);_0x4d4174[_0x3c66('0x3e')]=_['keys'](_0x315317['query']);_0x4d4174[_0x3c66('0x40')]=_[_0x3c66('0x42')](_0x4d4174[_0x3c66('0x3d')],_0x4d4174['query']);_0x2e5f56[_0x3c66('0x41')]=_[_0x3c66('0x42')](_0x4d4174[_0x3c66('0x3d')],qs['fields'](_0x315317[_0x3c66('0x3e')]['fields']));_0x2e5f56['attributes']=_0x2e5f56['attributes'][_0x3c66('0x44')]?_0x2e5f56[_0x3c66('0x41')]:_0x4d4174['model'];if(_0x315317[_0x3c66('0x3e')][_0x3c66('0xb5')]){_0x2e5f56['include']=[{'all':!![]}];}_0x2e5f56=_[_0x3c66('0xb6')]({},_0x2e5f56,_0x315317[_0x3c66('0xb7')]);return db[_0x3c66('0xb8')][_0x3c66('0x6a')](_0x2e5f56)[_0x3c66('0x2a')](handleEntityNotFound(_0x16cb55,null))[_0x3c66('0x2a')](respondWithResult(_0x16cb55,null))['catch'](handleError(_0x16cb55,null));};exports[_0x3c66('0xb9')]=function(_0x5a0e1d,_0x83df9e){return db[_0x3c66('0xb8')][_0x3c66('0xb9')](_0x5a0e1d['body'],{})['then'](respondWithResult(_0x83df9e,0xc9))[_0x3c66('0x35')](handleError(_0x83df9e,null));};exports[_0x3c66('0x29')]=function(_0xe84237,_0x22c63d){if(_0xe84237[_0x3c66('0x74')]['id']){delete _0xe84237[_0x3c66('0x74')]['id'];}return db[_0x3c66('0xb8')][_0x3c66('0x6a')]({'where':{'id':_0xe84237[_0x3c66('0xba')]['id']}})['then'](handleEntityNotFound(_0x22c63d,null))['then'](saveUpdates(_0xe84237[_0x3c66('0x74')],null))[_0x3c66('0x2a')](respondWithResult(_0x22c63d,null))[_0x3c66('0x35')](handleError(_0x22c63d,null));};exports[_0x3c66('0x2b')]=function(_0x3f745b,_0xfe19e6){return db[_0x3c66('0xb8')][_0x3c66('0x6a')]({'where':{'id':_0x3f745b[_0x3c66('0xba')]['id']}})[_0x3c66('0x2a')](handleEntityNotFound(_0xfe19e6,null))['then'](removeEntity(_0xfe19e6,null))[_0x3c66('0x35')](handleError(_0xfe19e6,null));};exports[_0x3c66('0xbb')]=function(_0x485ff1,_0x222953){return db[_0x3c66('0xb8')][_0x3c66('0xbb')]()[_0x3c66('0x2a')](respondWithResult(_0x222953,null))[_0x3c66('0x35')](handleError(_0x222953,null));};exports[_0x3c66('0xbc')]=function(_0x48ff1a,_0x4643a7,_0x226330){return db[_0x3c66('0xbd')][_0x3c66('0x6a')]({'where':{'id':_0x48ff1a['params']['id']}})[_0x3c66('0x2a')](handleEntityNotFound(_0x4643a7,null))[_0x3c66('0x2a')](function(_0x2ffa5c){if(_0x2ffa5c){return _0x2ffa5c[_0x3c66('0xbc')](_0x48ff1a[_0x3c66('0x74')]['ids'],_[_0x3c66('0xbe')](_0x48ff1a[_0x3c66('0x74')],[_0x3c66('0xbf'),'id'])||{});}})[_0x3c66('0x2a')](respondWithResult(_0x4643a7,null))['catch'](handleError(_0x4643a7,null));};exports[_0x3c66('0xc0')]=function(_0xd45a7f,_0x3b447c,_0x42c830){var _0x1edf40={'raw':![],'where':{}};var _0x3678e9={};var _0x26698d={'count':0x0,'rows':[]};return db[_0x3c66('0xb8')]['findOne']({'where':{'id':_0xd45a7f[_0x3c66('0xba')]['id']}})[_0x3c66('0x2a')](handleEntityNotFound(_0x3b447c,null))[_0x3c66('0x2a')](function(_0x38872f){if(_0x38872f){_0x3678e9[_0x3c66('0x3d')]=_[_0x3c66('0x3f')](db[_0x3c66('0xbd')][_0x3c66('0xb4')]);_0x3678e9[_0x3c66('0x3e')]=_[_0x3c66('0x3f')](_0xd45a7f[_0x3c66('0x3e')]);_0x3678e9[_0x3c66('0x40')]=_[_0x3c66('0x42')](_0x3678e9[_0x3c66('0x3d')],_0x3678e9[_0x3c66('0x3e')]);_0x1edf40[_0x3c66('0x41')]=_[_0x3c66('0x42')](_0x3678e9[_0x3c66('0x3d')],qs[_0x3c66('0x43')](_0xd45a7f[_0x3c66('0x3e')]['fields']));_0x1edf40[_0x3c66('0x41')]=_0x1edf40[_0x3c66('0x41')][_0x3c66('0x44')]?_0x1edf40[_0x3c66('0x41')]:_0x3678e9[_0x3c66('0x3d')];if(!_0xd45a7f[_0x3c66('0x3e')][_0x3c66('0x45')](_0x3c66('0xc1'))){_0x1edf40[_0x3c66('0x24')]=qs[_0x3c66('0x24')](_0xd45a7f['query'][_0x3c66('0x24')]);_0x1edf40[_0x3c66('0x26')]=qs['offset'](_0xd45a7f['query'][_0x3c66('0x26')]);}_0x1edf40['order']=qs['sort'](_0xd45a7f['query']['sort']);_0x1edf40[_0x3c66('0x7c')]=qs[_0x3c66('0x40')](_[_0x3c66('0x48')](_0xd45a7f[_0x3c66('0x3e')],_0x3678e9[_0x3c66('0x40')]));_0x1edf40[_0x3c66('0x7c')][_0x3c66('0xc2')]=_0x38872f['id'];if(_0xd45a7f[_0x3c66('0x3e')]['filter']){_0x1edf40[_0x3c66('0x7c')]=_[_0x3c66('0xb6')](_0x1edf40[_0x3c66('0x7c')],{'$or':_[_0x3c66('0x31')](_0x1edf40[_0x3c66('0x41')],function(_0x14b1e7){var _0x532020={};_0x532020[_0x14b1e7]={'$like':'%'+_0xd45a7f['query']['filter']+'%'};return _0x532020;})});}if(_0xd45a7f[_0x3c66('0x3e')][_0x3c66('0x7a')]){var _0x5c1d0c=_0xd45a7f['query'][_0x3c66('0x7a')][_0x3c66('0x33')](',');var _0x3db6c8={};_0x3db6c8[_0x5c1d0c[0x0]]={'$gte':moment(_0x5c1d0c[0x1])['format'](_0x3c66('0xc3'))};_0x1edf40[_0x3c66('0x7c')]=_[_0x3c66('0xb6')](_0x1edf40[_0x3c66('0x7c')],_0x3db6c8);}_0x1edf40=_['merge']({},_0x1edf40,_0xd45a7f[_0x3c66('0xb7')]);return db[_0x3c66('0xbd')][_0x3c66('0x25')]({'where':_0x1edf40[_0x3c66('0x7c')]})[_0x3c66('0x2a')](function(_0x5226e3){_0x26698d[_0x3c66('0x25')]=_0x5226e3;if(_0xd45a7f[_0x3c66('0x3e')][_0x3c66('0xb5')]){_0x1edf40[_0x3c66('0xc4')]=[{'all':!![]}];}return db[_0x3c66('0xbd')]['findAll'](_0x1edf40);})[_0x3c66('0x2a')](function(_0x4da7b8){_0x26698d[_0x3c66('0xc5')]=_0x4da7b8;return _0x26698d;});}})[_0x3c66('0x2a')](respondWithFilteredResult(_0x3b447c,_0x1edf40))[_0x3c66('0x35')](handleError(_0x3b447c,null));};exports[_0x3c66('0xc6')]=function(_0x3dd147,_0x7866b,_0x2ca8c6){return db[_0x3c66('0xb8')][_0x3c66('0x6a')]({'where':{'id':_0x3dd147[_0x3c66('0xba')]['id']}})[_0x3c66('0x2a')](handleEntityNotFound(_0x7866b,null))['then'](function(_0x2ff7ad){if(_0x2ff7ad){return _0x2ff7ad[_0x3c66('0xc7')](_0x3dd147[_0x3c66('0x74')][_0x3c66('0xbf')],_[_0x3c66('0xbe')](_0x3dd147[_0x3c66('0x74')],[_0x3c66('0xbf'),'id'])||{})[_0x3c66('0xc8')](function(){return db[_0x3c66('0x6f')]['findAll']({'attributes':['id',_0x3c66('0x2e'),_0x3c66('0x49')],'where':{'id':_0x3dd147['body']['ids']}});})['then'](function(_0x5574c5){socket[_0x3c66('0xc9')]('smsInteractionTags:save',{'id':Number(_0x3dd147[_0x3c66('0xba')]['id']),'tags':_0x5574c5||[]});return{'id':Number(_0x3dd147[_0x3c66('0xba')]['id']),'tags':_0x5574c5||[]};});}})[_0x3c66('0x2a')](respondWithResult(_0x7866b,null))['catch'](handleError(_0x7866b,null));};exports[_0x3c66('0xca')]=function(_0x3941b7,_0x3f9a1e,_0x5a11c7){return db[_0x3c66('0xb8')][_0x3c66('0x6a')]({'where':{'id':_0x3941b7['params']['id']}})[_0x3c66('0x2a')](handleEntityNotFound(_0x3f9a1e,null))['then'](function(_0x1f2ba1){if(_0x1f2ba1){return _0x1f2ba1[_0x3c66('0xca')](_0x3941b7[_0x3c66('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x3f9a1e,null))['catch'](handleError(_0x3f9a1e,null));};exports[_0x3c66('0xcb')]=function(_0x449608,_0x26fdc3){var _0x407171=moment()[_0x3c66('0xcc')]()[_0x3c66('0x9f')]();var _0x191257=path[_0x3c66('0xcd')](config[_0x3c66('0xce')],_0x3c66('0xcf'),_0x3c66('0xd0'),_0x3c66('0xd1'));var _0x52ee44=path['join'](config[_0x3c66('0xce')],_0x3c66('0xcf'),_0x3c66('0xd0'),'attachments');var _0x5261eb=path[_0x3c66('0xcd')](_0x191257,_0x407171);var _0xfeb415=util[_0x3c66('0xd2')](_0x3c66('0xd3'),_0x449608[_0x3c66('0xba')]['id'],_0x407171);var _0xb12bcf=path[_0x3c66('0xcd')](_0x191257,_0xfeb415);var _0x3ed709=[];_0x3ed709['push']({'model':db[_0x3c66('0x72')],'as':_0x3c66('0x72'),'attributes':['id',_0x3c66('0xd4')],'raw':!![]});_0x3ed709['push']({'model':db['CmContact'],'as':_0x3c66('0x65'),'attributes':['id',_0x3c66('0xd5'),'lastName'],'raw':!![]});var _0x41c342=[{'model':db['SmsMessage'],'as':_0x3c66('0xd6'),'attributes':['id',_0x3c66('0x74'),_0x3c66('0x78'),_0x3c66('0xd7'),_0x3c66('0xd8'),_0x3c66('0x7f')],'include':_0x3ed709}];_0x41c342[_0x3c66('0x34')]({'model':db[_0x3c66('0xd9')],'as':_0x3c66('0xda'),'attributes':['id',_0x3c66('0x2e')]});_0x41c342[_0x3c66('0x34')]({'model':db[_0x3c66('0x72')],'as':'Owner','attributes':['id',_0x3c66('0xd4')]});return db[_0x3c66('0xb8')]['find']({'where':{'id':_0x449608['params']['id']},'include':_0x41c342})[_0x3c66('0x2a')](handleEntityNotFound(_0x26fdc3,null))[_0x3c66('0x2a')](function(_0x3e1b49){if(_0x3e1b49){var _0x1a853b=_0x3e1b49[_0x3c66('0xdb')]({'plain':!![]});fs['mkdirSync'](_0x5261eb);var _0x4d8a0f={'channel':_0x3c66('0xdc'),'account':_0x1a853b[_0x3c66('0xda')]['name'],'agent':_0x1a853b[_0x3c66('0xdd')]?_0x1a853b[_0x3c66('0xdd')][_0x3c66('0xd4')]:_0x3c66('0xde'),'createdAt':moment(_0x1a853b[_0x3c66('0x78')])[_0x3c66('0xd2')](_0x3c66('0xc3'))[_0x3c66('0x9f')](),'closedAt':_0x1a853b[_0x3c66('0x3b')]?moment(_0x1a853b[_0x3c66('0xdf')])[_0x3c66('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3c66('0x9f')]():'','disposition':_0x1a853b[_0x3c66('0xe0')],'messages':_(_0x1a853b[_0x3c66('0xd6')])[_0x3c66('0x85')]({'secret':![]})['map'](function(_0x1b922f){return{'date':moment(_0x1b922f[_0x3c66('0x78')])[_0x3c66('0xd2')](_0x3c66('0xc3'))[_0x3c66('0x9f')](),'sender':_0x1b922f['direction']===_0x3c66('0xe1')?_0x1b922f[_0x3c66('0x72')]?_0x1b922f[_0x3c66('0x72')][_0x3c66('0xd4')]:_0x3c66('0xe2'):_0x1b922f[_0x3c66('0x65')]['firstName']+(_0x1b922f[_0x3c66('0x65')][_0x3c66('0xe3')]?'\x20'+_0x1b922f[_0x3c66('0x65')][_0x3c66('0xe3')]:''),'body':_0x1b922f[_0x3c66('0x74')],'direction':_0x1b922f[_0x3c66('0xd7')]==='out'?'A':'C','secret':_0x1b922f[_0x3c66('0xd8')],'read':_0x1b922f[_0x3c66('0x7f')]};})[_0x3c66('0x61')]()};return ejs['renderFile'](path[_0x3c66('0xcd')](config[_0x3c66('0xce')],'server',_0x3c66('0xe4'),_0x3c66('0xe5')),{'interaction':_0x4d8a0f})[_0x3c66('0x2a')](function(_0x320216){var _0x1c6737=path[_0x3c66('0xcd')](_0x5261eb,_0x3c66('0xe6')+_0x1a853b['id']+'-'+_0x407171+_0x3c66('0xe7'));var _0x1ee55b={'path':_0x1c6737,'channel':_0x3c66('0xdc'),'interactionId':_0x1a853b['id']};return pdf[_0x3c66('0xe8')](_0x320216,_0x1ee55b);})['then'](function(){return new BPromise(function(_0x3a2641,_0x290e3c){zipdir(_0x5261eb,{'saveTo':_0xb12bcf},function(_0x46c1e6,_0x74af23){if(_0x46c1e6)return _0x290e3c(_0x46c1e6);return _0x3a2641(_0x74af23);});})[_0x3c66('0x2a')](function(){return new BPromise(function(_0x1970b7,_0xdc44e8){rimraf(_0x5261eb,function(_0x582284){if(_0x582284)_0xdc44e8(_0x582284);return _0x1970b7();});});})[_0x3c66('0x2a')](function(){return _0x26fdc3[_0x3c66('0xcb')](_0xb12bcf,_0xfeb415,function(_0x2c53e0){if(_0x2c53e0){console[_0x3c66('0xe9')](_0x3c66('0xea'),_0x2c53e0);}else{fs[_0x3c66('0xeb')](_0xb12bcf);}});});});}else{return _0x26fdc3[_0x3c66('0x1f')](0xc8);}})[_0x3c66('0x35')](handleError(_0x26fdc3,null));}; \ No newline at end of file +var _0x7846=['createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','error','send','Users','map','fullname','Tags','TagIds','split','forEach','push','waiting','unmanaged','total','closed','UserId','talking','answered','index','SmsInteraction','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','from','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','then','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','rows','catch','show','params','includeAll','include','merge','options','create','describe','addMessage','ids','omit','findOne','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','findAll','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','closedAt','System','firstName','lastName','out','renderFile','views','.pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7846,0xf4));var _0x6784=function(_0x4d389d,_0xec145d){_0x4d389d=_0x4d389d-0x0;var _0x22bd25=_0x7846[_0x4d389d];return _0x22bd25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6784('0x0'));var zipdir=require(_0x6784('0x1'));var jsonpatch=require(_0x6784('0x2'));var rp=require(_0x6784('0x3'));var moment=require(_0x6784('0x4'));var BPromise=require(_0x6784('0x5'));var Mustache=require('mustache');var util=require(_0x6784('0x6'));var path=require(_0x6784('0x7'));var sox=require(_0x6784('0x8'));var csv=require(_0x6784('0x9'));var ejs=require(_0x6784('0xa'));var fs=require('fs');var fs_extra=require(_0x6784('0xb'));var _=require(_0x6784('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6784('0xd'));var deskjs=require(_0x6784('0xe'));var toCsv=require(_0x6784('0x9'));var querystring=require(_0x6784('0xf'));var Papa=require(_0x6784('0x10'));var Redis=require(_0x6784('0x11'));var authService=require(_0x6784('0x12'));var qs=require(_0x6784('0x13'));var as=require(_0x6784('0x14'));var pdf=require(_0x6784('0x15'));var hardwareService=require(_0x6784('0x16'));var logger=require(_0x6784('0x17'))(_0x6784('0x18'));var utils=require(_0x6784('0x19'));var config=require(_0x6784('0x1a'));var licenseUtil=require(_0x6784('0x1b'));var db=require('../../mysqldb')['db'];config[_0x6784('0x1c')]=_[_0x6784('0x1d')](config[_0x6784('0x1c')],{'host':_0x6784('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6784('0x1c')]));require(_0x6784('0x1f'))[_0x6784('0x20')](socket);function respondWithStatusCode(_0x2ecec4,_0xef56b5){_0xef56b5=_0xef56b5||0xcc;return function(_0x18929b){if(_0x18929b){return _0x2ecec4[_0x6784('0x21')](_0xef56b5);}return _0x2ecec4[_0x6784('0x22')](_0xef56b5)[_0x6784('0x23')]();};}function respondWithResult(_0x32c7a0,_0x3db21a){_0x3db21a=_0x3db21a||0xc8;return function(_0x5f17ca){if(_0x5f17ca){return _0x32c7a0[_0x6784('0x22')](_0x3db21a)[_0x6784('0x24')](_0x5f17ca);}};}function respondWithFilteredResult(_0x2be16f,_0x2fd8a2){return function(_0x594ce9){if(_0x594ce9){var _0x23f32e=typeof _0x2fd8a2[_0x6784('0x25')]===_0x6784('0x26')&&typeof _0x2fd8a2[_0x6784('0x27')]===_0x6784('0x26');var _0x597ca3=_0x594ce9[_0x6784('0x28')];var _0x475f0f=_0x23f32e?0x0:_0x2fd8a2['offset'];var _0x3f4178=_0x23f32e?_0x594ce9[_0x6784('0x28')]:_0x2fd8a2[_0x6784('0x25')]+_0x2fd8a2[_0x6784('0x27')];var _0x505954;if(_0x3f4178>=_0x597ca3){_0x3f4178=_0x597ca3;_0x505954=0xc8;}else{_0x505954=0xce;}_0x2be16f[_0x6784('0x22')](_0x505954);return _0x2be16f[_0x6784('0x29')]('Content-Range',_0x475f0f+'-'+_0x3f4178+'/'+_0x597ca3)[_0x6784('0x24')](_0x594ce9);}return null;};}function patchUpdates(_0x2d9f7e){return function(_0x1bdc90){try{jsonpatch[_0x6784('0x2a')](_0x1bdc90,_0x2d9f7e,!![]);}catch(_0x3cdfe2){return BPromise[_0x6784('0x2b')](_0x3cdfe2);}return _0x1bdc90['save']();};}function saveUpdates(_0x466331,_0x345df5){return function(_0x37aa8f){if(_0x37aa8f){return _0x37aa8f[_0x6784('0x2c')](_0x466331)['then'](function(_0x13598e){return _0x13598e;});}return null;};}function removeEntity(_0x4a1b2b,_0x52716e){return function(_0x4db985){if(_0x4db985){return _0x4db985[_0x6784('0x2d')]()['then'](function(){_0x4a1b2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc02c,_0x17346b){return function(_0x28012f){if(!_0x28012f){_0x2dc02c[_0x6784('0x21')](0x194);}return _0x28012f;};}function handleError(_0x151340,_0x280b56){_0x280b56=_0x280b56||0x1f4;return function(_0x497fab){logger[_0x6784('0x2e')](_0x497fab['stack']);if(_0x497fab['name']){delete _0x497fab['name'];}_0x151340[_0x6784('0x22')](_0x280b56)[_0x6784('0x2f')](_0x497fab);};}function getInteractionUsers(_0x461057,_0x2036d6){return new BPromise(function(_0x204fba,_0x5e465c){try{if(_0x2036d6[_0x461057['id']]){_0x461057[_0x6784('0x30')]=_[_0x6784('0x31')](_0x2036d6[_0x461057['id']],function(_0x296114){return{'id':_0x296114['id'],'fullname':_0x296114[_0x6784('0x32')]};});}}catch(_0x3a57c6){_0x5e465c(_0x3a57c6);}_0x204fba(_0x461057);});}function getInteractionTags(_0xd9de69,_0x4ac304){return new BPromise(function(_0x3dd59d,_0x5755d6){try{if(_0xd9de69['TagIds']){_0xd9de69[_0x6784('0x33')]=[];_0xd9de69[_0x6784('0x34')][_0x6784('0x35')](',')[_0x6784('0x36')](function(_0x5a7fe5){_0xd9de69[_0x6784('0x33')][_0x6784('0x37')](_0x4ac304[_0x5a7fe5]);});}delete _0xd9de69[_0x6784('0x34')];}catch(_0x15ef7f){_0x5755d6(_0x15ef7f);}_0x3dd59d(_0xd9de69);});}function updateSmsInteraction(_0x2850fb,_0xd4fcda,_0x1e7ab1){return new BPromise(function(_0x67ae4f,_0x50042e){return getInteractionUsers(_0x2850fb,_0x1e7ab1)['then'](function(_0x300b77){return getInteractionTags(_0x300b77,_0xd4fcda);})['then'](function(_0x27ba6d){return getStateInteraction(_0x27ba6d);})['then'](function(_0x7beec9){_0x67ae4f(_0x7beec9);})['catch'](function(_0x351032){_0x50042e(_0x351032);});});}function getStateInteraction(_0x4e59b3){return new BPromise(function(_0x3fc6b7){_0x4e59b3[_0x6784('0x38')]=0x0;_0x4e59b3['talking']=0x0;_0x4e59b3['answered']=0x0;_0x4e59b3[_0x6784('0x39')]=0x0;_0x4e59b3[_0x6784('0x3a')]=0x0;if(!_0x4e59b3[_0x6784('0x3b')]&&!_0x4e59b3['UserId']){_0x4e59b3['waiting']+=0x1;}if(!_0x4e59b3['closed']&&_0x4e59b3[_0x6784('0x3c')]){_0x4e59b3[_0x6784('0x3d')]+=0x1;if(_0x4e59b3[_0x6784('0x38')]){_0x4e59b3[_0x6784('0x38')]-=0x1;}}if(_0x4e59b3[_0x6784('0x3b')]&&_0x4e59b3['UserId']){_0x4e59b3[_0x6784('0x3e')]+=0x1;if(_0x4e59b3[_0x6784('0x3d')]){_0x4e59b3[_0x6784('0x3d')]-=0x1;}}if(_0x4e59b3[_0x6784('0x3b')]&&!_0x4e59b3[_0x6784('0x3c')]){_0x4e59b3[_0x6784('0x39')]+=0x1;if(_0x4e59b3['waiting']){_0x4e59b3[_0x6784('0x38')]-=0x1;}}_0x4e59b3[_0x6784('0x3a')]+=0x1;_0x3fc6b7(_0x4e59b3);});}exports[_0x6784('0x3f')]=function(_0x5f65a9,_0x318939){var _0x185cae={},_0x31bff6={},_0x379cc6={'count':0x0,'rows':[]};var _0x45a477=_[_0x6784('0x31')](db[_0x6784('0x40')][_0x6784('0x41')],function(_0x535b08){return{'name':_0x535b08['fieldName'],'type':_0x535b08[_0x6784('0x42')][_0x6784('0x43')]};});_0x31bff6['model']=_[_0x6784('0x31')](_0x45a477,_0x6784('0x44'));_0x31bff6[_0x6784('0x45')]=_[_0x6784('0x46')](_0x5f65a9[_0x6784('0x45')]);_0x31bff6[_0x6784('0x47')]=_['intersection'](_0x31bff6['model'],_0x31bff6[_0x6784('0x45')]);_0x185cae['attributes']=_[_0x6784('0x48')](_0x31bff6[_0x6784('0x49')],qs[_0x6784('0x4a')](_0x5f65a9['query'][_0x6784('0x4a')]));_0x185cae[_0x6784('0x4b')]=_0x185cae[_0x6784('0x4b')][_0x6784('0x4c')]?_0x185cae['attributes']:_0x31bff6[_0x6784('0x49')];if(!_0x5f65a9['query']['hasOwnProperty'](_0x6784('0x4d'))){_0x185cae[_0x6784('0x27')]=qs['limit'](_0x5f65a9['query'][_0x6784('0x27')]);_0x185cae[_0x6784('0x25')]=qs[_0x6784('0x25')](_0x5f65a9['query'][_0x6784('0x25')]);}_0x185cae[_0x6784('0x4e')]=qs['sort'](_0x5f65a9[_0x6784('0x45')][_0x6784('0x4f')]);_0x185cae[_0x6784('0x50')]=qs['filters'](_[_0x6784('0x51')](_0x5f65a9[_0x6784('0x45')],_0x31bff6[_0x6784('0x47')]),_0x45a477);var _0x285ac0=[];var _0x104967=squel[_0x6784('0x52')]()[_0x6784('0x53')]('id')[_0x6784('0x53')](_0x6784('0x44'))[_0x6784('0x53')]('color')['from'](_0x6784('0x54'));var _0xb040b7=squel[_0x6784('0x52')]()['field'](_0x6784('0x55'))['field'](_0x6784('0x56'))[_0x6784('0x53')]('ui.SmsInteractionId')[_0x6784('0x57')]('user_has_sms_interactions','ui')['left_join'](_0x6784('0x58'),'u',_0x6784('0x59'));var _0x2603f1=squel[_0x6784('0x52')]()['from']('sms_interactions','i')[_0x6784('0x5a')](_0x6784('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6784('0x5a')](_0x6784('0x58'),'o',_0x6784('0x5c'))[_0x6784('0x5a')](_0x6784('0x5d'),'a',_0x6784('0x5e'))[_0x6784('0x5a')](_0x6784('0x5f'),'me',_0x6784('0x60'))[_0x6784('0x5a')](_0x6784('0x61'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x6784('0x5a')](_0x6784('0x54'),'t',_0x6784('0x62'));var _0x38f86a=squel[_0x6784('0x63')]();var _0x49eabc=[];var _0xc49d3e=squel[_0x6784('0x63')]();var _0x4e7749;if(_0x5f65a9[_0x6784('0x45')][_0x6784('0x64')]){_0x4e7749=as[_0x6784('0x65')](_0x5f65a9[_0x6784('0x45')][_0x6784('0x64')]);var _0x176f33=_0x4e7749[_0x6784('0x66')];for(var _0x6add8b=0x0;_0x6add8b<_0x4e7749[_0x6784('0x67')][_0x6784('0x4c')];_0x6add8b++){var _0x28aa6d=_0x4e7749[_0x6784('0x67')][_0x6add8b];var _0x1be4f2='i';var _0x5d227c=_[_0x6784('0x68')](_0x45a477,[_0x6784('0x44'),_0x28aa6d[_0x6784('0x53')]]);if(!_0x5d227c){switch(_0x28aa6d[_0x6784('0x53')]){case _0x6784('0x69'):if(_0x28aa6d['value']==0x1){_0x2603f1['having']('`'+_0x28aa6d['field']+_0x6784('0x6a'));}else{_0x2603f1[_0x6784('0x6b')]('`'+_0x28aa6d[_0x6784('0x53')]+_0x6784('0x6c'));}break;case _0x6784('0x6d'):if(_0x28aa6d[_0x6784('0x6e')]===_0x6784('0x6f')){if(_0x28aa6d[_0x6784('0x70')][_0x6784('0x35')]('\x20')[_0x6784('0x4c')]>0x1){_0x38f86a[_0x176f33](_0x6784('0x71'),qs[_0x6784('0x72')](_0x28aa6d['value']),null);}else{var _0x507bb9='%'+_0x28aa6d[_0x6784('0x70')]+'%';_0x38f86a[_0x176f33]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x507bb9,_0x507bb9,_0x507bb9);}}else{_0x5d227c=_[_0x6784('0x68')](_0x45a477,[_0x6784('0x44'),_0x6784('0x73')]);_0x28aa6d['field']=_0x6784('0x73');_0x331720=as['buildExpression'](_0x1be4f2,_0x5d227c[_0x6784('0x42')],_0x28aa6d);_0x38f86a[_0x176f33](_0x331720[_0x6784('0x74')],_0x331720[_0x6784('0x70')]['start'],_0x331720['value'][_0x6784('0x23')]);}break;case _0x6784('0x75'):var _0x26414c=_0x28aa6d['value'][_0x6784('0x35')](',')[_0x6784('0x31')](function(_0x235498){return Number(_0x235498);});_0x26414c[_0x6784('0x36')](function(_0x46932d){_0xc49d3e['or'](_0x6784('0x76'),'%,'+_0x46932d+',%');});_0x49eabc=_[_0x6784('0x77')](_0x49eabc,_0x26414c);break;case'User':if(_0x28aa6d[_0x6784('0x6e')]===_0x6784('0x6f')){_0x38f86a[_0x176f33](_0x6784('0x78'),'%'+_0x28aa6d['value']+'%',null);}else{_0x5d227c=_['find'](_0x45a477,['name',_0x6784('0x3c')]);_0x28aa6d[_0x6784('0x53')]=_0x6784('0x3c');_0x331720=as[_0x6784('0x79')](_0x1be4f2,_0x5d227c[_0x6784('0x42')],_0x28aa6d);_0x38f86a[_0x176f33](_0x331720[_0x6784('0x74')],_0x331720[_0x6784('0x70')][_0x6784('0x7a')],_0x331720[_0x6784('0x70')][_0x6784('0x23')]);}break;case _0x6784('0x7b'):_0x331720=as['buildExpression']('me',null,_0x28aa6d);_0x38f86a[_0x176f33](_0x331720[_0x6784('0x74')],_0x331720[_0x6784('0x70')][_0x6784('0x7a')],_0x331720['value'][_0x6784('0x23')]);break;}}else{var _0x331720=as[_0x6784('0x79')](_0x1be4f2,_0x5d227c[_0x6784('0x42')],_0x28aa6d);_0x38f86a[_0x176f33](_0x331720[_0x6784('0x74')],_0x331720[_0x6784('0x70')][_0x6784('0x7a')],_0x331720[_0x6784('0x70')][_0x6784('0x23')]);}}}else{var _0x1ecbd2=_(_0x5f65a9[_0x6784('0x45')])[_0x6784('0x46')]()[_0x6784('0x31')](function(_0x3f32d0){return _[_0x6784('0x7c')](_0x45a477,['name',_0x3f32d0])?_0x3f32d0:undefined;})['compact']()[_0x6784('0x70')]();if(!_[_0x6784('0x7d')](_0x1ecbd2)){_0x1ecbd2[_0x6784('0x36')](function(_0x4f0a9b){if(_0x4f0a9b==='SmsAccountId'){_0x2603f1[_0x6784('0x50')](_0x6784('0x7e'),[][_0x6784('0x7f')](_0x5f65a9[_0x6784('0x45')][_0x4f0a9b]));}else if(_0x4f0a9b===_0x6784('0x80')){var _0x2d41d0=JSON['parse'](_0x5f65a9[_0x6784('0x45')][_0x4f0a9b])['$gte'];var _0x58fda0=JSON[_0x6784('0x81')](_0x5f65a9['query'][_0x4f0a9b])[_0x6784('0x82')];_0x2603f1[_0x6784('0x50')](_0x6784('0x83'),_0x2d41d0,_0x58fda0);}else{if(_0x5f65a9[_0x6784('0x45')][_0x4f0a9b]===_0x6784('0x84')){_0x2603f1[_0x6784('0x50')]('i.'+_0x4f0a9b+_0x6784('0x85'));}else{_0x2603f1[_0x6784('0x50')]('i.'+_0x4f0a9b+_0x6784('0x86'),_0x5f65a9[_0x6784('0x45')][_0x4f0a9b]);}}});}if(_0x5f65a9[_0x6784('0x45')][_0x6784('0x87')]){if(_0x5f65a9['query'][_0x6784('0x87')]==0x1){_0x2603f1[_0x6784('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x2603f1['having'](_0x6784('0x88'));}}if(_0x5f65a9[_0x6784('0x45')]['tag']){_0x49eabc=_['isArray'](_0x5f65a9['query']['tag'])?_0x5f65a9[_0x6784('0x45')]['tag']:new Array(_0x5f65a9['query'][_0x6784('0x89')]);_0x49eabc[_0x6784('0x36')](function(_0x331ea6){_0xc49d3e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x331ea6+',%');});}if(_0x5f65a9['query']['filter']){var _0x3caa04=_0x5f65a9[_0x6784('0x45')]['filter'][_0x6784('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6784('0x8b')](_0x3caa04)){_0x38f86a['or'](_0x6784('0x8c'),_0x3caa04+'%')['or'](_0x6784('0x8d'),_0x3caa04+'%');}else{_0x38f86a['or'](_0x6784('0x8e'),qs[_0x6784('0x72')](_0x3caa04))['or'](_0x6784('0x8f'),_0x3caa04+'%');}}}_0x2603f1[_0x6784('0x50')](_0x38f86a);_0x2603f1[_0x6784('0x90')](_0x6784('0x91'));var _0xc5ec5a={'type':db[_0x6784('0x92')][_0x6784('0x93')][_0x6784('0x94')],'raw':!![]};var _0x9741e6=_0x2603f1[_0x6784('0x95')]();_0x9741e6[_0x6784('0x53')](_0x6784('0x91'));_0x9741e6['field'](_0x6784('0x96'),_0x6784('0x69'));if(_0x185cae[_0x6784('0x4e')]){_0x185cae['order'][_0x6784('0x36')](function(_0x49e82a){var _0x34ab6b=_0x49e82a[0x0]==='contactName'?_0x49e82a[0x0]:'i.'+_0x49e82a[0x0];_0x2603f1['order'](_0x34ab6b,_0x49e82a[0x1]===_0x6784('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x49eabc)){_0x2603f1[_0x6784('0x6b')](_0xc49d3e);_0x9741e6[_0x6784('0x50')]('t.id\x20IN\x20?',_0x49eabc);}BPromise['resolve']()[_0x6784('0x98')](function(){if(!_0x4e7749){if(_0x5f65a9['query'][_0x6784('0x99')])return;_0x9741e6[_0x6784('0x50')](_0x6784('0x9a'));_0x2603f1[_0x6784('0x50')](_0x6784('0x9a'));return;}if(_0x5f65a9[_0x6784('0x9b')][_0x6784('0x9c')]!==_0x6784('0x9d'))return;return _0x5f65a9[_0x6784('0x9b')][_0x6784('0x9e')]({'attributes':['id'],'raw':!![]})[_0x6784('0x98')](function(_0x30ef96){if(_[_0x6784('0x7d')](_0x30ef96)){_0x9741e6['where'](_0x6784('0x9f'));_0x2603f1[_0x6784('0x50')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x9741e6[_0x6784('0x50')](_0x6784('0x7e'),_[_0x6784('0x31')](_0x30ef96,'id'));_0x2603f1[_0x6784('0x50')]('i.SmsAccountId\x20IN\x20?',_[_0x6784('0x31')](_0x30ef96,'id'));}});})[_0x6784('0x98')](function(){if(_0x5f65a9[_0x6784('0x9b')][_0x6784('0x9c')]==='agent'&&!_0x4e7749&&!_0x5f65a9['query'][_0x6784('0x99')])return[];return db[_0x6784('0xa0')][_0x6784('0x45')](_0x9741e6[_0x6784('0xa1')](),_0xc5ec5a);})['then'](function(_0x3ee649){_0x379cc6[_0x6784('0x28')]=_0x3ee649[_0x6784('0x4c')];if(_0x379cc6[_0x6784('0x28')]===0x0)return[];return db[_0x6784('0xa0')][_0x6784('0x45')](_0x104967[_0x6784('0xa1')](),_0xc5ec5a)[_0x6784('0x98')](function(_0x56fcc7){_0x285ac0=_[_0x6784('0xa2')](_0x56fcc7,'id');_0xc5ec5a=_['merge'](_0xc5ec5a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5f65a9[_0x6784('0x45')][_0x6784('0x4a')]){_0x185cae[_0x6784('0x4b')][_0x6784('0x36')](function(_0x2ec312){_0x2603f1[_0x6784('0x53')]('i.'+_0x2ec312);});}else{_0x2603f1[_0x6784('0x53')](_0x6784('0x96'),_0x6784('0x69'));_0x2603f1['field'](_0x6784('0xa3'),_0x6784('0xa4'));_0x2603f1[_0x6784('0x53')](_0x6784('0xa5'),_0x6784('0xa6'));_0x2603f1['field'](_0x6784('0xa7'),_0x6784('0xa8'));_0x2603f1[_0x6784('0x53')](_0x6784('0xa9'));_0x2603f1[_0x6784('0x53')]('c.firstName','Contact.firstName');_0x2603f1['field']('c.lastName','Contact.lastName');_0x2603f1[_0x6784('0x53')](_0x6784('0xaa'),_0x6784('0xab'));_0x2603f1['field'](_0x6784('0xac'),_0x6784('0xad'));_0x2603f1[_0x6784('0x53')](_0x6784('0xae'),'Contact.mobile');_0x2603f1[_0x6784('0x53')]('c.fax',_0x6784('0xaf'));_0x2603f1['field'](_0x6784('0xb0'),'Owner.fullname');_0x2603f1[_0x6784('0x53')](_0x6784('0xb1'),'Owner.internal');_0x2603f1['field'](_0x6784('0xb2'),'TagIds');}if(_0x185cae[_0x6784('0x27')])_0x2603f1[_0x6784('0x27')](_0x185cae[_0x6784('0x27')]);if(_0x185cae[_0x6784('0x25')])_0x2603f1[_0x6784('0x25')](_0x185cae['offset']);return db[_0x6784('0xa0')]['query'](_0x2603f1['toString'](),_0xc5ec5a);})[_0x6784('0x98')](function(_0x13bd72){if(_0x13bd72[_0x6784('0x4c')]>0x0)_0xb040b7['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x6784('0x31')](_0x13bd72,'id'));return db[_0x6784('0xa0')][_0x6784('0x45')](_0xb040b7['toString'](),_0xc5ec5a)[_0x6784('0x98')](function(_0x202e46){var _0xfb9da2=_[_0x6784('0xb3')](_0x202e46,_0x6784('0xb4'));var _0xdb7ed7=[];_0x13bd72[_0x6784('0x36')](function(_0xad3cbf){_0xdb7ed7['push'](updateSmsInteraction(_0xad3cbf,_0x285ac0,_0xfb9da2));});return BPromise['all'](_0xdb7ed7);});});})[_0x6784('0x98')](function(_0xa4ed88){_0x379cc6[_0x6784('0xb5')]=_0xa4ed88;return _0x379cc6;})[_0x6784('0x98')](respondWithFilteredResult(_0x318939,_0x185cae))[_0x6784('0xb6')](handleError(_0x318939,null));};exports[_0x6784('0xb7')]=function(_0x1efbeb,_0x55ce85){var _0x43dc80={'raw':![],'where':{'id':_0x1efbeb[_0x6784('0xb8')]['id']}},_0x14ec0a={};_0x14ec0a['model']=_[_0x6784('0x46')](db[_0x6784('0x40')]['rawAttributes']);_0x14ec0a[_0x6784('0x45')]=_[_0x6784('0x46')](_0x1efbeb[_0x6784('0x45')]);_0x14ec0a['filters']=_['intersection'](_0x14ec0a[_0x6784('0x49')],_0x14ec0a[_0x6784('0x45')]);_0x43dc80[_0x6784('0x4b')]=_[_0x6784('0x48')](_0x14ec0a[_0x6784('0x49')],qs[_0x6784('0x4a')](_0x1efbeb['query']['fields']));_0x43dc80[_0x6784('0x4b')]=_0x43dc80[_0x6784('0x4b')]['length']?_0x43dc80[_0x6784('0x4b')]:_0x14ec0a[_0x6784('0x49')];if(_0x1efbeb[_0x6784('0x45')][_0x6784('0xb9')]){_0x43dc80[_0x6784('0xba')]=[{'all':!![]}];}_0x43dc80=_[_0x6784('0xbb')]({},_0x43dc80,_0x1efbeb[_0x6784('0xbc')]);return db[_0x6784('0x40')]['find'](_0x43dc80)['then'](handleEntityNotFound(_0x55ce85,null))[_0x6784('0x98')](respondWithResult(_0x55ce85,null))[_0x6784('0xb6')](handleError(_0x55ce85,null));};exports['create']=function(_0x28215c,_0x12086b){return db[_0x6784('0x40')][_0x6784('0xbd')](_0x28215c['body'],{})[_0x6784('0x98')](respondWithResult(_0x12086b,0xc9))[_0x6784('0xb6')](handleError(_0x12086b,null));};exports[_0x6784('0x2c')]=function(_0x5bac64,_0x4cf425){if(_0x5bac64[_0x6784('0x7b')]['id']){delete _0x5bac64[_0x6784('0x7b')]['id'];}return db[_0x6784('0x40')][_0x6784('0x68')]({'where':{'id':_0x5bac64[_0x6784('0xb8')]['id']}})[_0x6784('0x98')](handleEntityNotFound(_0x4cf425,null))[_0x6784('0x98')](saveUpdates(_0x5bac64[_0x6784('0x7b')],null))[_0x6784('0x98')](respondWithResult(_0x4cf425,null))[_0x6784('0xb6')](handleError(_0x4cf425,null));};exports[_0x6784('0x2d')]=function(_0x1bafc9,_0x449979){return db[_0x6784('0x40')][_0x6784('0x68')]({'where':{'id':_0x1bafc9['params']['id']}})[_0x6784('0x98')](handleEntityNotFound(_0x449979,null))['then'](removeEntity(_0x449979,null))[_0x6784('0xb6')](handleError(_0x449979,null));};exports[_0x6784('0xbe')]=function(_0x2d2f8b,_0xbdf624){return db['SmsInteraction'][_0x6784('0xbe')]()[_0x6784('0x98')](respondWithResult(_0xbdf624,null))[_0x6784('0xb6')](handleError(_0xbdf624,null));};exports['addMessage']=function(_0x368e09,_0x1bf22c,_0x399694){return db['SmsMessage'][_0x6784('0x68')]({'where':{'id':_0x368e09[_0x6784('0xb8')]['id']}})[_0x6784('0x98')](handleEntityNotFound(_0x1bf22c,null))[_0x6784('0x98')](function(_0x47981d){if(_0x47981d){return _0x47981d[_0x6784('0xbf')](_0x368e09[_0x6784('0x7b')][_0x6784('0xc0')],_[_0x6784('0xc1')](_0x368e09[_0x6784('0x7b')],[_0x6784('0xc0'),'id'])||{});}})[_0x6784('0x98')](respondWithResult(_0x1bf22c,null))[_0x6784('0xb6')](handleError(_0x1bf22c,null));};exports['getMessages']=function(_0x294cb4,_0x2e4e15,_0x125a68){var _0x40281c={'raw':![],'where':{}};var _0x1ca968={};var _0x15d409={'count':0x0,'rows':[]};return db[_0x6784('0x40')][_0x6784('0xc2')]({'where':{'id':_0x294cb4['params']['id']}})[_0x6784('0x98')](handleEntityNotFound(_0x2e4e15,null))[_0x6784('0x98')](function(_0x28f4ce){if(_0x28f4ce){_0x1ca968['model']=_[_0x6784('0x46')](db['SmsMessage'][_0x6784('0x41')]);_0x1ca968[_0x6784('0x45')]=_[_0x6784('0x46')](_0x294cb4[_0x6784('0x45')]);_0x1ca968[_0x6784('0x47')]=_['intersection'](_0x1ca968[_0x6784('0x49')],_0x1ca968[_0x6784('0x45')]);_0x40281c[_0x6784('0x4b')]=_['intersection'](_0x1ca968[_0x6784('0x49')],qs['fields'](_0x294cb4[_0x6784('0x45')][_0x6784('0x4a')]));_0x40281c[_0x6784('0x4b')]=_0x40281c[_0x6784('0x4b')]['length']?_0x40281c[_0x6784('0x4b')]:_0x1ca968[_0x6784('0x49')];if(!_0x294cb4[_0x6784('0x45')]['hasOwnProperty']('nolimit')){_0x40281c[_0x6784('0x27')]=qs[_0x6784('0x27')](_0x294cb4['query'][_0x6784('0x27')]);_0x40281c[_0x6784('0x25')]=qs['offset'](_0x294cb4[_0x6784('0x45')]['offset']);}_0x40281c[_0x6784('0x4e')]=qs[_0x6784('0x4f')](_0x294cb4[_0x6784('0x45')][_0x6784('0x4f')]);_0x40281c[_0x6784('0x50')]=qs['filters'](_['pick'](_0x294cb4[_0x6784('0x45')],_0x1ca968[_0x6784('0x47')]));_0x40281c[_0x6784('0x50')][_0x6784('0xb4')]=_0x28f4ce['id'];if(_0x294cb4[_0x6784('0x45')]['filter']){_0x40281c['where']=_[_0x6784('0xbb')](_0x40281c[_0x6784('0x50')],{'$or':_[_0x6784('0x31')](_0x40281c['attributes'],function(_0x37414d){var _0x22c6ba={};_0x22c6ba[_0x37414d]={'$like':'%'+_0x294cb4[_0x6784('0x45')][_0x6784('0xc3')]+'%'};return _0x22c6ba;})});}if(_0x294cb4[_0x6784('0x45')][_0x6784('0xc4')]){var _0x480184=_0x294cb4[_0x6784('0x45')][_0x6784('0xc4')][_0x6784('0x35')](',');var _0x14c82b={};_0x14c82b[_0x480184[0x0]]={'$gte':moment(_0x480184[0x1])[_0x6784('0xc5')](_0x6784('0xc6'))};_0x40281c[_0x6784('0x50')]=_[_0x6784('0xbb')](_0x40281c[_0x6784('0x50')],_0x14c82b);}_0x40281c=_[_0x6784('0xbb')]({},_0x40281c,_0x294cb4['options']);return db[_0x6784('0xc7')][_0x6784('0x28')]({'where':_0x40281c[_0x6784('0x50')]})[_0x6784('0x98')](function(_0x57d9c0){_0x15d409[_0x6784('0x28')]=_0x57d9c0;if(_0x294cb4[_0x6784('0x45')][_0x6784('0xb9')]){_0x40281c[_0x6784('0xba')]=[{'all':!![]}];}return db[_0x6784('0xc7')][_0x6784('0xc8')](_0x40281c);})[_0x6784('0x98')](function(_0x2af2b4){_0x15d409[_0x6784('0xb5')]=_0x2af2b4;return _0x15d409;});}})[_0x6784('0x98')](respondWithFilteredResult(_0x2e4e15,_0x40281c))[_0x6784('0xb6')](handleError(_0x2e4e15,null));};exports[_0x6784('0xc9')]=function(_0x463d2e,_0xaaa16d,_0x2f5946){return db[_0x6784('0x40')][_0x6784('0x68')]({'where':{'id':_0x463d2e['params']['id']}})[_0x6784('0x98')](handleEntityNotFound(_0xaaa16d,null))[_0x6784('0x98')](function(_0x22a665){if(_0x22a665){return _0x22a665[_0x6784('0xca')](_0x463d2e[_0x6784('0x7b')][_0x6784('0xc0')],_['omit'](_0x463d2e[_0x6784('0x7b')],[_0x6784('0xc0'),'id'])||{})[_0x6784('0xcb')](function(){return db[_0x6784('0x75')][_0x6784('0xc8')]({'attributes':['id',_0x6784('0x44'),_0x6784('0xcc')],'where':{'id':_0x463d2e['body']['ids']}});})[_0x6784('0x98')](function(_0x585220){socket[_0x6784('0xcd')](_0x6784('0xce'),{'id':Number(_0x463d2e[_0x6784('0xb8')]['id']),'tags':_0x585220||[]});return{'id':Number(_0x463d2e[_0x6784('0xb8')]['id']),'tags':_0x585220||[]};});}})['then'](respondWithResult(_0xaaa16d,null))[_0x6784('0xb6')](handleError(_0xaaa16d,null));};exports['removeTags']=function(_0x3fee81,_0xf00299,_0x2d6094){return db[_0x6784('0x40')][_0x6784('0x68')]({'where':{'id':_0x3fee81[_0x6784('0xb8')]['id']}})[_0x6784('0x98')](handleEntityNotFound(_0xf00299,null))['then'](function(_0x47bac3){if(_0x47bac3){return _0x47bac3[_0x6784('0xcf')](_0x3fee81[_0x6784('0x45')][_0x6784('0xc0')]);}})['then'](respondWithStatusCode(_0xf00299,null))[_0x6784('0xb6')](handleError(_0xf00299,null));};exports[_0x6784('0xd0')]=function(_0x1201e5,_0x46eb6f){var _0x6a9f38=moment()[_0x6784('0xd1')]()[_0x6784('0xa1')]();var _0x416a59=path[_0x6784('0xd2')](config[_0x6784('0xd3')],_0x6784('0xd4'),_0x6784('0xd5'),_0x6784('0xd6'));var _0x2f49b0=path[_0x6784('0xd2')](config[_0x6784('0xd3')],_0x6784('0xd4'),_0x6784('0xd5'),_0x6784('0xd7'));var _0x4bb4c4=path['join'](_0x416a59,_0x6a9f38);var _0x1f7779=util[_0x6784('0xc5')](_0x6784('0xd8'),_0x1201e5[_0x6784('0xb8')]['id'],_0x6a9f38);var _0x331b5a=path[_0x6784('0xd2')](_0x416a59,_0x1f7779);var _0xc5316=[];_0xc5316['push']({'model':db['User'],'as':_0x6784('0xd9'),'attributes':['id','fullname'],'raw':!![]});_0xc5316[_0x6784('0x37')]({'model':db[_0x6784('0xda')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x1c8026=[{'model':db['SmsMessage'],'as':_0x6784('0xdb'),'attributes':['id',_0x6784('0x7b'),'createdAt',_0x6784('0xdc'),_0x6784('0xdd'),_0x6784('0x87')],'include':_0xc5316}];_0x1c8026[_0x6784('0x37')]({'model':db[_0x6784('0xde')],'as':_0x6784('0xdf'),'attributes':['id',_0x6784('0x44')]});_0x1c8026[_0x6784('0x37')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x6784('0x40')]['find']({'where':{'id':_0x1201e5[_0x6784('0xb8')]['id']},'include':_0x1c8026})['then'](handleEntityNotFound(_0x46eb6f,null))[_0x6784('0x98')](function(_0x16e2b3){if(_0x16e2b3){var _0x3dc993=_0x16e2b3[_0x6784('0xe0')]({'plain':!![]});fs[_0x6784('0xe1')](_0x4bb4c4);var _0x3ffa02={'channel':_0x6784('0xe2'),'account':_0x3dc993['Account']['name'],'agent':_0x3dc993[_0x6784('0xe3')]?_0x3dc993['Owner'][_0x6784('0x32')]:'N.A.','createdAt':moment(_0x3dc993[_0x6784('0x80')])[_0x6784('0xc5')](_0x6784('0xc6'))[_0x6784('0xa1')](),'closedAt':_0x3dc993[_0x6784('0x3b')]?moment(_0x3dc993[_0x6784('0xe4')])[_0x6784('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3dc993['disposition'],'messages':_(_0x3dc993[_0x6784('0xdb')])['filter']({'secret':![]})[_0x6784('0x31')](function(_0x41887e){return{'date':moment(_0x41887e['createdAt'])['format'](_0x6784('0xc6'))[_0x6784('0xa1')](),'sender':_0x41887e['direction']==='out'?_0x41887e[_0x6784('0xd9')]?_0x41887e[_0x6784('0xd9')]['fullname']:_0x6784('0xe5'):_0x41887e[_0x6784('0x6d')][_0x6784('0xe6')]+(_0x41887e[_0x6784('0x6d')][_0x6784('0xe7')]?'\x20'+_0x41887e['Contact'][_0x6784('0xe7')]:''),'body':_0x41887e[_0x6784('0x7b')],'direction':_0x41887e[_0x6784('0xdc')]===_0x6784('0xe8')?'A':'C','secret':_0x41887e[_0x6784('0xdd')],'read':_0x41887e[_0x6784('0x87')]};})['value']()};return ejs[_0x6784('0xe9')](path[_0x6784('0xd2')](config[_0x6784('0xd3')],_0x6784('0xd4'),_0x6784('0xea'),'downloadInteraction.ejs'),{'interaction':_0x3ffa02})[_0x6784('0x98')](function(_0x25b639){var _0x2b5117=path['join'](_0x4bb4c4,'transcript-'+_0x3dc993['id']+'-'+_0x6a9f38+_0x6784('0xeb'));var _0x1a0418={'path':_0x2b5117,'channel':_0x6784('0xe2'),'interactionId':_0x3dc993['id']};return pdf[_0x6784('0xec')](_0x25b639,_0x1a0418);})[_0x6784('0x98')](function(){return new BPromise(function(_0x2bf2a4,_0x381668){zipdir(_0x4bb4c4,{'saveTo':_0x331b5a},function(_0x1fba4d,_0x1ec573){if(_0x1fba4d)return _0x381668(_0x1fba4d);return _0x2bf2a4(_0x1ec573);});})[_0x6784('0x98')](function(){return new BPromise(function(_0xc13e8d,_0x2fd3c3){rimraf(_0x4bb4c4,function(_0x37276e){if(_0x37276e)_0x2fd3c3(_0x37276e);return _0xc13e8d();});});})[_0x6784('0x98')](function(){return _0x46eb6f[_0x6784('0xd0')](_0x331b5a,_0x1f7779,function(_0x407842){if(_0x407842){console[_0x6784('0xed')](_0x6784('0xee'),_0x407842);}else{fs[_0x6784('0xef')](_0x331b5a);}});});});}else{return _0x46eb6f[_0x6784('0x21')](0xc8);}})[_0x6784('0xb6')](handleError(_0x46eb6f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5b7d6ef..fca796c 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 _0x5b12=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x76050b,_0x2709f2){var _0xdf8335=function(_0x45846a){while(--_0x45846a){_0x76050b['push'](_0x76050b['shift']());}};_0xdf8335(++_0x2709f2);}(_0x5b12,0xa3));var _0x25b1=function(_0x134e40,_0xf8e7ff){_0x134e40=_0x134e40-0x0;var _0x394686=_0x5b12[_0x134e40];return _0x394686;};'use strict';var EventEmitter=require(_0x25b1('0x0'));var SmsInteraction=require(_0x25b1('0x1'))['db'][_0x25b1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x25b1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25b1('0x4'),'afterUpdate':_0x25b1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31f3fc){return function(_0x56378e,_0x5248c2,_0x35d90b){_0x56378e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1f715d){_0x56378e[_0x25b1('0x6')](_0x25b1('0x7'),_0x1f715d[_0x25b1('0x8')](function(_0x1ed594){return{'id':_0x1ed594['id']};}));return SmsMessage[_0x25b1('0x9')]({'where':{'SmsInteractionId':_0x56378e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x25b1('0xa')](function(_0x6235e2){_0x56378e['setDataValue'](_0x25b1('0xb'),_0x6235e2[_0x25b1('0xc')]);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc+':'+_0x56378e['id'],_0x56378e);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc,_0x56378e);_0x35d90b(null);})[_0x25b1('0xe')](_0x35d90b(null));};}for(var e in events){if(events[_0x25b1('0xf')](e)){var event=events[e];SmsInteraction[_0x25b1('0x10')](e,emitEvent(event));}}module[_0x25b1('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x28f2=['update','remove','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x28f2,0x193));var _0x228f=function(_0x294511,_0x4598ac){_0x294511=_0x294511-0x0;var _0x447cfc=_0x28f2[_0x294511];return _0x447cfc;};'use strict';var EventEmitter=require(_0x228f('0x0'));var SmsInteraction=require(_0x228f('0x1'))['db'][_0x228f('0x2')];var SmsMessage=require(_0x228f('0x1'))['db'][_0x228f('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x228f('0x4'),'afterUpdate':_0x228f('0x5'),'afterDestroy':_0x228f('0x6')};function emitEvent(_0x4303c3){return function(_0x2bb7d7,_0x3439f5,_0x32c5c3){_0x2bb7d7['getUsers']({'attributes':['id'],'raw':!![]})[_0x228f('0x7')](function(_0x4a4a44){_0x2bb7d7[_0x228f('0x8')](_0x228f('0x9'),_0x4a4a44[_0x228f('0xa')](function(_0x5f406c){return{'id':_0x5f406c['id']};}));return SmsMessage[_0x228f('0xb')]({'where':{'SmsInteractionId':_0x2bb7d7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x212c90){_0x2bb7d7[_0x228f('0x8')]('unreadMessages',_0x212c90[_0x228f('0xc')]);SmsInteractionEvents[_0x228f('0xd')](_0x4303c3+':'+_0x2bb7d7['id'],_0x2bb7d7);SmsInteractionEvents[_0x228f('0xd')](_0x4303c3,_0x2bb7d7);_0x32c5c3(null);})[_0x228f('0xe')](_0x32c5c3(null));};}for(var e in events){if(events[_0x228f('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x228f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 017145b..c230c0d 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 _0xf77e=['exports','define','sms_interactions','changed','closedAt','format','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0x33d982,_0x49c670){var _0x1c599e=function(_0x1653d6){while(--_0x1653d6){_0x33d982['push'](_0x33d982['shift']());}};_0x1c599e(++_0x49c670);}(_0xf77e,0x19c));var _0xef77=function(_0x44d778,_0x32f171){_0x44d778=_0x44d778-0x0;var _0x2bf7ff=_0xf77e[_0x44d778];return _0x2bf7ff;};'use strict';var _=require('lodash');var util=require(_0xef77('0x0'));var logger=require(_0xef77('0x1'))(_0xef77('0x2'));var moment=require(_0xef77('0x3'));var BPromise=require('bluebird');var rp=require(_0xef77('0x4'));var fs=require('fs');var path=require(_0xef77('0x5'));var rimraf=require('rimraf');var config=require(_0xef77('0x6'));var attributes=require(_0xef77('0x7'));module[_0xef77('0x8')]=function(_0x1a3609,_0x3ff255){return _0x1a3609[_0xef77('0x9')]('SmsInteraction',attributes,{'tableName':_0xef77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11d240,_0x437a6f,_0x2d3aa5){if(_0x11d240[_0xef77('0xb')]('closed')){_0x11d240[_0xef77('0xc')]=moment()[_0xef77('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d3aa5(null,_0x11d240);}}});}; \ No newline at end of file +var _0xec62=['bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment'];(function(_0x239cb0,_0x37bbfe){var _0x2c3df1=function(_0x5d076e){while(--_0x5d076e){_0x239cb0['push'](_0x239cb0['shift']());}};_0x2c3df1(++_0x37bbfe);}(_0xec62,0xb2));var _0x2ec6=function(_0x48affa,_0x52ed60){_0x48affa=_0x48affa-0x0;var _0x4ee41d=_0xec62[_0x48affa];return _0x4ee41d;};'use strict';var _=require(_0x2ec6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2ec6('0x1'));var BPromise=require(_0x2ec6('0x2'));var rp=require(_0x2ec6('0x3'));var fs=require('fs');var path=require(_0x2ec6('0x4'));var rimraf=require(_0x2ec6('0x5'));var config=require(_0x2ec6('0x6'));var attributes=require(_0x2ec6('0x7'));module[_0x2ec6('0x8')]=function(_0x1cbeb2,_0x27042d){return _0x1cbeb2[_0x2ec6('0x9')](_0x2ec6('0xa'),attributes,{'tableName':_0x2ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5233e2,_0x2e9a77,_0x25a0b3){if(_0x5233e2['changed']('closed')){_0x5233e2[_0x2ec6('0xc')]=moment()[_0x2ec6('0xd')](_0x2ec6('0xe'));}_0x25a0b3(null,_0x5233e2);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index ca84a2d..84824ba 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 _0xb110=['spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','SmsInteraction','body','options','raw','attributes','UpdateSmsInteraction','addTags','ids','omit'];(function(_0x1cc325,_0x537298){var _0x33d644=function(_0x4cd101){while(--_0x4cd101){_0x1cc325['push'](_0x1cc325['shift']());}};_0x33d644(++_0x537298);}(_0xb110,0x158));var _0x0b11=function(_0x25b134,_0x54d84a){_0x25b134=_0x25b134-0x0;var _0xb7334=_0xb110[_0x25b134];return _0xb7334;};'use strict';var _=require(_0x0b11('0x0'));var util=require('util');var moment=require(_0x0b11('0x1'));var BPromise=require(_0x0b11('0x2'));var rs=require(_0x0b11('0x3'));var fs=require('fs');var Redis=require(_0x0b11('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0b11('0x5'))(_0x0b11('0x6'));var config=require(_0x0b11('0x7'));var jayson=require(_0x0b11('0x8'));var client=jayson[_0x0b11('0x9')][_0x0b11('0xa')]({'port':0x232a});config['redis']=_[_0x0b11('0xb')](config[_0x0b11('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x0b11('0xd')](socket);function respondWithRpcPromise(_0x2d5113,_0x1760a5,_0x44f8a5){return new BPromise(function(_0x86c379,_0x26084d){return client[_0x0b11('0xe')](_0x2d5113,_0x44f8a5)[_0x0b11('0xf')](function(_0x1de107){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1760a5,_0x0b11('0x10'));logger[_0x0b11('0x11')](_0x0b11('0x12'),_0x1760a5,_0x0b11('0x10'),JSON[_0x0b11('0x13')](_0x1de107));if(_0x1de107[_0x0b11('0x14')]){if(_0x1de107[_0x0b11('0x14')][_0x0b11('0x15')]===0x1f4){logger[_0x0b11('0x14')](_0x0b11('0x16'),_0x1760a5,_0x1de107[_0x0b11('0x14')][_0x0b11('0x17')]);return _0x26084d(_0x1de107[_0x0b11('0x14')][_0x0b11('0x17')]);}logger[_0x0b11('0x14')](_0x0b11('0x16'),_0x1760a5,_0x1de107[_0x0b11('0x14')][_0x0b11('0x17')]);return _0x86c379(_0x1de107['error'][_0x0b11('0x17')]);}else{logger[_0x0b11('0x18')](_0x0b11('0x16'),_0x1760a5,_0x0b11('0x10'));_0x86c379(_0x1de107[_0x0b11('0x19')][_0x0b11('0x17')]);}})[_0x0b11('0x1a')](function(_0x477f68){logger[_0x0b11('0x14')](_0x0b11('0x16'),_0x1760a5,_0x477f68);_0x26084d(_0x477f68);});});}exports['UpdateSmsInteraction']=function(_0x2da8d8){var _0x5ba009=this;return new Promise(function(_0x46d134,_0x451a92){return db[_0x0b11('0x1b')]['update'](_0x2da8d8[_0x0b11('0x1c')],{'raw':_0x2da8d8['options']?_0x2da8d8[_0x0b11('0x1d')][_0x0b11('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da8d8[_0x0b11('0x1d')]?_0x2da8d8['options']['where']||null:null,'attributes':_0x2da8d8[_0x0b11('0x1d')]?_0x2da8d8['options'][_0x0b11('0x1f')]||null:null,'limit':_0x2da8d8[_0x0b11('0x1d')]?_0x2da8d8['options']['limit']||null:null})['then'](function(_0x560716){logger[_0x0b11('0x18')](_0x0b11('0x20'),_0x2da8d8);logger[_0x0b11('0x11')](_0x0b11('0x20'),_0x2da8d8,JSON[_0x0b11('0x13')](_0x560716));_0x46d134(_0x560716);})[_0x0b11('0x1a')](function(_0x242f9b){logger[_0x0b11('0x14')](_0x0b11('0x20'),_0x242f9b['message'],_0x2da8d8);_0x451a92(_0x5ba009['error'](0x1f4,_0x242f9b[_0x0b11('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x37636e){return new Promise(function(_0x40cdc2,_0x2b5967){return db['SmsInteraction']['find']({'where':_0x37636e[_0x0b11('0x1d')]?_0x37636e[_0x0b11('0x1d')]['where']||null:null})[_0x0b11('0xf')](function(_0x5b258d){if(_0x5b258d){return _0x5b258d[_0x0b11('0x21')](_0x37636e['body'][_0x0b11('0x22')],_[_0x0b11('0x23')](_0x37636e['body'],[_0x0b11('0x22'),'id'])||{});}})[_0x0b11('0x24')](function(_0x5455a7){logger[_0x0b11('0x18')]('AddTags',_0x37636e);logger[_0x0b11('0x11')](_0x0b11('0x25'),_0x37636e,JSON[_0x0b11('0x13')](_0x5455a7));_0x40cdc2(_0x5455a7);})['catch'](function(_0x5af1c8){logger[_0x0b11('0x14')]('AddTags',_0x5af1c8[_0x0b11('0x17')],_0x37636e);_0x2b5967(_this['error'](0x1f4,_0x5af1c8[_0x0b11('0x17')]));});});}; \ No newline at end of file +var _0x5385=['SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','then','info','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./smsInteraction.socket','register','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5385,0x1e8));var _0x5538=function(_0x51533c,_0x36e0ab){_0x51533c=_0x51533c-0x0;var _0x399d3f=_0x5385[_0x51533c];return _0x399d3f;};'use strict';var _=require(_0x5538('0x0'));var util=require(_0x5538('0x1'));var moment=require(_0x5538('0x2'));var BPromise=require(_0x5538('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5538('0x4'));var db=require(_0x5538('0x5'))['db'];var utils=require(_0x5538('0x6'));var logger=require(_0x5538('0x7'))(_0x5538('0x8'));var config=require(_0x5538('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5538('0xa')]({'port':0x232a});config[_0x5538('0xb')]=_[_0x5538('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5538('0xb')]));require(_0x5538('0xd'))[_0x5538('0xe')](socket);function respondWithRpcPromise(_0x285558,_0x435d94,_0xee21d7){return new BPromise(function(_0x59a2d6,_0x3b31f1){return client[_0x5538('0xf')](_0x285558,_0xee21d7)['then'](function(_0x239e9f){logger['info'](_0x5538('0x10'),_0x435d94,_0x5538('0x11'));logger[_0x5538('0x12')](_0x5538('0x13'),_0x435d94,_0x5538('0x11'),JSON['stringify'](_0x239e9f));if(_0x239e9f[_0x5538('0x14')]){if(_0x239e9f['error'][_0x5538('0x15')]===0x1f4){logger[_0x5538('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x435d94,_0x239e9f[_0x5538('0x14')][_0x5538('0x16')]);return _0x3b31f1(_0x239e9f['error']['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x435d94,_0x239e9f[_0x5538('0x14')][_0x5538('0x16')]);return _0x59a2d6(_0x239e9f[_0x5538('0x14')][_0x5538('0x16')]);}else{logger['info'](_0x5538('0x10'),_0x435d94,'request\x20sent');_0x59a2d6(_0x239e9f[_0x5538('0x17')][_0x5538('0x16')]);}})[_0x5538('0x18')](function(_0x578c2c){logger[_0x5538('0x14')](_0x5538('0x10'),_0x435d94,_0x578c2c);_0x3b31f1(_0x578c2c);});});}exports[_0x5538('0x19')]=function(_0x589912){var _0x2b558a=this;return new Promise(function(_0x58cf6f,_0x5abb98){return db[_0x5538('0x1a')][_0x5538('0x1b')](_0x589912[_0x5538('0x1c')],{'raw':_0x589912[_0x5538('0x1d')]?_0x589912[_0x5538('0x1d')][_0x5538('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x589912[_0x5538('0x1d')]?_0x589912['options']['where']||null:null,'attributes':_0x589912[_0x5538('0x1d')]?_0x589912[_0x5538('0x1d')][_0x5538('0x1f')]||null:null,'limit':_0x589912['options']?_0x589912[_0x5538('0x1d')][_0x5538('0x20')]||null:null})[_0x5538('0x21')](function(_0x3fa12d){logger[_0x5538('0x22')](_0x5538('0x19'),_0x589912);logger[_0x5538('0x12')](_0x5538('0x19'),_0x589912,JSON['stringify'](_0x3fa12d));_0x58cf6f(_0x3fa12d);})['catch'](function(_0x1d1f14){logger[_0x5538('0x14')](_0x5538('0x19'),_0x1d1f14[_0x5538('0x16')],_0x589912);_0x5abb98(_0x2b558a[_0x5538('0x14')](0x1f4,_0x1d1f14[_0x5538('0x16')]));});});};exports[_0x5538('0x23')]=function(_0x48cc4c){return new Promise(function(_0x586ab0,_0x4eb54a){return db[_0x5538('0x1a')][_0x5538('0x24')]({'where':_0x48cc4c[_0x5538('0x1d')]?_0x48cc4c[_0x5538('0x1d')]['where']||null:null})[_0x5538('0x21')](function(_0x767ded){if(_0x767ded){return _0x767ded[_0x5538('0x25')](_0x48cc4c[_0x5538('0x1c')][_0x5538('0x26')],_[_0x5538('0x27')](_0x48cc4c['body'],[_0x5538('0x26'),'id'])||{});}})[_0x5538('0x28')](function(_0x2a58ac){logger[_0x5538('0x22')](_0x5538('0x29'),_0x48cc4c);logger[_0x5538('0x12')](_0x5538('0x29'),_0x48cc4c,JSON['stringify'](_0x2a58ac));_0x586ab0(_0x2a58ac);})[_0x5538('0x18')](function(_0x5b227d){logger[_0x5538('0x14')](_0x5538('0x29'),_0x5b227d[_0x5538('0x16')],_0x48cc4c);_0x4eb54a(_this[_0x5538('0x14')](0x1f4,_0x5b227d[_0x5538('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 5f1679a..7f89c1b 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 _0x6973=['remove','removeListener','register','smsInteraction:','save'];(function(_0x5bac3a,_0x147183){var _0x55ae4f=function(_0x57a2dc){while(--_0x57a2dc){_0x5bac3a['push'](_0x5bac3a['shift']());}};_0x55ae4f(++_0x147183);}(_0x6973,0x1cb));var _0x3697=function(_0x536250,_0x184d11){_0x536250=_0x536250-0x0;var _0x1aaa47=_0x6973[_0x536250];return _0x1aaa47;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x3697('0x0'),_0x3697('0x1'),'update'];function createListener(_0x49e9df,_0x255f2f){return function(_0x2195c6){_0x255f2f['emit'](_0x49e9df,_0x2195c6);};}function removeListener(_0x9cd802,_0x1caede){return function(){SmsInteractionEvents[_0x3697('0x2')](_0x9cd802,_0x1caede);};}exports[_0x3697('0x3')]=function(_0x33d743){for(var _0x10d880=0x0,_0x1a95d3=events['length'];_0x10d880<_0x1a95d3;_0x10d880++){var _0x53b366=events[_0x10d880];var _0x540181=createListener(_0x3697('0x4')+_0x53b366,_0x33d743);SmsInteractionEvents['on'](_0x53b366,_0x540181);}}; \ No newline at end of file +var _0x876b=['removeListener','length','smsInteraction:','./smsInteraction.events','save','update','emit'];(function(_0x1ae8ab,_0x6e5c2a){var _0x1ad705=function(_0x1dfa15){while(--_0x1dfa15){_0x1ae8ab['push'](_0x1ae8ab['shift']());}};_0x1ad705(++_0x6e5c2a);}(_0x876b,0x96));var _0xb876=function(_0xf7e198,_0x127063){_0xf7e198=_0xf7e198-0x0;var _0x47378d=_0x876b[_0xf7e198];return _0x47378d;};'use strict';var SmsInteractionEvents=require(_0xb876('0x0'));var events=[_0xb876('0x1'),'remove',_0xb876('0x2')];function createListener(_0x3b460d,_0x26f211){return function(_0x55146b){_0x26f211[_0xb876('0x3')](_0x3b460d,_0x55146b);};}function removeListener(_0x4d19d7,_0x363dcf){return function(){SmsInteractionEvents[_0xb876('0x4')](_0x4d19d7,_0x363dcf);};}exports['register']=function(_0xc990f5){for(var _0x41cbe9=0x0,_0xa75efc=events[_0xb876('0x5')];_0x41cbe9<_0xa75efc;_0x41cbe9++){var _0x44a7f5=events[_0x41cbe9];var _0x253685=createListener(_0xb876('0x6')+_0x44a7f5,_0xc990f5);SmsInteractionEvents['on'](_0x44a7f5,_0x253685);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2df3a36..9ceda69 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 _0x0454=['/describe','describe','/:id','show','post','tracked','smsmessage:create','create','/:id/status','status','put','update','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index'];(function(_0x508bb3,_0x198bd3){var _0x2986ec=function(_0x1e9b5e){while(--_0x1e9b5e){_0x508bb3['push'](_0x508bb3['shift']());}};_0x2986ec(++_0x198bd3);}(_0x0454,0x10b));var _0x4045=function(_0x3504ac,_0x12ff5c){_0x3504ac=_0x3504ac-0x0;var _0x56ebeb=_0x0454[_0x3504ac];return _0x56ebeb;};'use strict';var multer=require(_0x4045('0x0'));var util=require(_0x4045('0x1'));var path=require('path');var timeout=require(_0x4045('0x2'));var express=require(_0x4045('0x3'));var router=express[_0x4045('0x4')]();var fs_extra=require(_0x4045('0x5'));var auth=require(_0x4045('0x6'));var interaction=require(_0x4045('0x7'));var config=require(_0x4045('0x8'));var controller=require(_0x4045('0x9'));router[_0x4045('0xa')]('/',auth[_0x4045('0xb')](),controller[_0x4045('0xc')]);router[_0x4045('0xa')](_0x4045('0xd'),auth[_0x4045('0xb')](),controller[_0x4045('0xe')]);router[_0x4045('0xa')](_0x4045('0xf'),auth['isAuthenticated'](),controller[_0x4045('0x10')]);router[_0x4045('0x11')]('/',auth[_0x4045('0xb')](),interaction[_0x4045('0x12')]('sms',_0x4045('0x13')),controller[_0x4045('0x14')]);router['post'](_0x4045('0x15'),controller[_0x4045('0x16')]);router[_0x4045('0x17')](_0x4045('0xf'),auth['isAuthenticated'](),controller[_0x4045('0x18')]);router[_0x4045('0x17')]('/:id/accept',auth[_0x4045('0xb')](),controller['accept']);router[_0x4045('0x17')]('/:id/reject',auth[_0x4045('0xb')](),controller[_0x4045('0x19')]);router[_0x4045('0x1a')]('/:id',auth[_0x4045('0xb')](),controller['destroy']);module[_0x4045('0x1b')]=router; \ No newline at end of file +var _0x9d57=['../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms','create','/:id/status','status','put','update','/:id/accept','accept','delete','destroy','util','path','connect-timeout','Router'];(function(_0x23b4fd,_0x5dbe9d){var _0x3c2374=function(_0x4e1836){while(--_0x4e1836){_0x23b4fd['push'](_0x23b4fd['shift']());}};_0x3c2374(++_0x5dbe9d);}(_0x9d57,0xd4));var _0x79d5=function(_0x35124b,_0x5d6083){_0x35124b=_0x35124b-0x0;var _0x310f95=_0x9d57[_0x35124b];return _0x310f95;};'use strict';var multer=require('multer');var util=require(_0x79d5('0x0'));var path=require(_0x79d5('0x1'));var timeout=require(_0x79d5('0x2'));var express=require('express');var router=express[_0x79d5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x79d5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79d5('0x5'));router[_0x79d5('0x6')]('/',auth[_0x79d5('0x7')](),controller[_0x79d5('0x8')]);router[_0x79d5('0x6')](_0x79d5('0x9'),auth['isAuthenticated'](),controller[_0x79d5('0xa')]);router[_0x79d5('0x6')](_0x79d5('0xb'),auth['isAuthenticated'](),controller[_0x79d5('0xc')]);router[_0x79d5('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x79d5('0xe'),'smsmessage:create'),controller[_0x79d5('0xf')]);router['post'](_0x79d5('0x10'),controller[_0x79d5('0x11')]);router[_0x79d5('0x12')]('/:id',auth[_0x79d5('0x7')](),controller[_0x79d5('0x13')]);router[_0x79d5('0x12')](_0x79d5('0x14'),auth[_0x79d5('0x7')](),controller[_0x79d5('0x15')]);router[_0x79d5('0x12')]('/:id/reject',auth[_0x79d5('0x7')](),controller['reject']);router[_0x79d5('0x16')](_0x79d5('0xb'),auth['isAuthenticated'](),controller[_0x79d5('0x17')]);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 3ffd506..9e5e41f 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 _0x433b=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x95ed5c,_0x4624a1){var _0x23af41=function(_0x572657){while(--_0x572657){_0x95ed5c['push'](_0x95ed5c['shift']());}};_0x23af41(++_0x4624a1);}(_0x433b,0x15c));var _0xb433=function(_0x56260c,_0x3594bc){_0x56260c=_0x56260c-0x0;var _0x3293b9=_0x433b[_0x56260c];return _0x3293b9;};'use strict';var Sequelize=require('sequelize');module[_0xb433('0x0')]={'body':{'type':Sequelize[_0xb433('0x1')](_0xb433('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb433('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb433('0x4')]('in',_0xb433('0x5')),'defaultValue':_0xb433('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb433('0x6')](0xbe)},'phone':{'type':Sequelize[_0xb433('0x6')]},'readAt':{'type':Sequelize[_0xb433('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb433('0x6')]},'providerResponse':{'type':Sequelize[_0xb433('0x1')]}}; \ No newline at end of file +var _0xf0cc=['sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x549f86,_0x53e635){var _0x6457c0=function(_0x5d7243){while(--_0x5d7243){_0x549f86['push'](_0x549f86['shift']());}};_0x6457c0(++_0x53e635);}(_0xf0cc,0xf3));var _0xcf0c=function(_0x4ac7b7,_0x2074cf){_0x4ac7b7=_0x4ac7b7-0x0;var _0x5e72aa=_0xf0cc[_0x4ac7b7];return _0x5e72aa;};'use strict';var Sequelize=require(_0xcf0c('0x0'));module[_0xcf0c('0x1')]={'body':{'type':Sequelize[_0xcf0c('0x2')](_0xcf0c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xcf0c('0x4')]('in',_0xcf0c('0x5')),'defaultValue':_0xcf0c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcf0c('0x6')]},'readAt':{'type':Sequelize[_0xcf0c('0x7')]},'secret':{'type':Sequelize[_0xcf0c('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcf0c('0x6')]},'providerResponse':{'type':Sequelize[_0xcf0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index fa29e84..b253610 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 _0x4367=['index','map','SmsMessage','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','destroy','params','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','SmsInteractionId','isNil','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','UserId','User','internal','interface','channel','accept','EventManager','acceptmessage','../../config/logger','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','email','SIP/%s','motionChannel','event','rejectmessage','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','DELIVERED','infobip','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','client','request','then','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','send'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4367,0x1f3));var _0x7436=function(_0x586a6f,_0x3956b4){_0x586a6f=_0x586a6f-0x0;var _0x211598=_0x4367[_0x586a6f];return _0x211598;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7436('0x0'));var zipdir=require(_0x7436('0x1'));var jsonpatch=require(_0x7436('0x2'));var rp=require(_0x7436('0x3'));var moment=require('moment');var BPromise=require(_0x7436('0x4'));var Mustache=require(_0x7436('0x5'));var util=require(_0x7436('0x6'));var path=require(_0x7436('0x7'));var sox=require(_0x7436('0x8'));var csv=require(_0x7436('0x9'));var ejs=require(_0x7436('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7436('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7436('0xc'));var toCsv=require(_0x7436('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7436('0xd'));var authService=require(_0x7436('0xe'));var qs=require(_0x7436('0xf'));var as=require(_0x7436('0x10'));var hardwareService=require(_0x7436('0x11'));var logger=require('../../config/logger')(_0x7436('0x12'));var utils=require(_0x7436('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7436('0x14'))['db'];config[_0x7436('0x15')]=_['defaults'](config[_0x7436('0x15')],{'host':_0x7436('0x16'),'port':0x18eb});var socket=require(_0x7436('0x17'))(new Redis(config[_0x7436('0x15')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x7436('0x18'));var client=jayson['client'][_0x7436('0x19')]({'port':0x232c});var client9002=jayson[_0x7436('0x1a')][_0x7436('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x38181f,_0x51672e,_0x4c0ea8,_0x2893e4){return new BPromise(function(_0x4de05f,_0x3ec95a){var _0xa08d6e=_0x2893e4||client;return _0xa08d6e[_0x7436('0x1b')](_0x38181f,_0x4c0ea8)[_0x7436('0x1c')](function(_0x54ae4c){logger['info']('SmsMessage,\x20%s,\x20%s',_0x51672e,_0x7436('0x1d'));logger[_0x7436('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x51672e,_0x7436('0x1d'),JSON[_0x7436('0x1f')](_0x54ae4c));if(_0x54ae4c['error']){if(_0x54ae4c[_0x7436('0x20')][_0x7436('0x21')]===0x1f4){logger[_0x7436('0x20')](_0x7436('0x22'),_0x51672e,_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);return _0x3ec95a(_0x54ae4c[_0x7436('0x20')]['message']);}logger[_0x7436('0x20')]('SmsMessage,\x20%s,\x20%s',_0x51672e,_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);return _0x4de05f(_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);}else{logger[_0x7436('0x24')](_0x7436('0x22'),_0x51672e,_0x7436('0x1d'));_0x4de05f(_0x54ae4c['result']['message']);}})['catch'](function(_0x5272d8){logger[_0x7436('0x20')](_0x7436('0x22'),_0x51672e,_0x5272d8);_0x3ec95a(_0x5272d8);});});}function respondWithStatusCode(_0x4142d0,_0x176fb0){_0x176fb0=_0x176fb0||0xcc;return function(_0x5c0280){if(_0x5c0280){return _0x4142d0['sendStatus'](_0x176fb0);}return _0x4142d0[_0x7436('0x25')](_0x176fb0)['end']();};}function respondWithResult(_0x1c40d9,_0x10ffc3){_0x10ffc3=_0x10ffc3||0xc8;return function(_0x196e80){if(_0x196e80){return _0x1c40d9[_0x7436('0x25')](_0x10ffc3)[_0x7436('0x26')](_0x196e80);}};}function respondWithFilteredResult(_0x38a086,_0x15b3fe){return function(_0x2cda2a){if(_0x2cda2a){var _0x3fa050=typeof _0x15b3fe['offset']==='undefined'&&typeof _0x15b3fe[_0x7436('0x27')]===_0x7436('0x28');var _0x29a3ea=_0x2cda2a[_0x7436('0x29')];var _0x5b971f=_0x3fa050?0x0:_0x15b3fe[_0x7436('0x2a')];var _0x2e01b9=_0x3fa050?_0x2cda2a['count']:_0x15b3fe[_0x7436('0x2a')]+_0x15b3fe[_0x7436('0x27')];var _0x4afa72;if(_0x2e01b9>=_0x29a3ea){_0x2e01b9=_0x29a3ea;_0x4afa72=0xc8;}else{_0x4afa72=0xce;}_0x38a086['status'](_0x4afa72);return _0x38a086[_0x7436('0x2b')](_0x7436('0x2c'),_0x5b971f+'-'+_0x2e01b9+'/'+_0x29a3ea)[_0x7436('0x26')](_0x2cda2a);}return null;};}function patchUpdates(_0x3a212a){return function(_0x571972){try{jsonpatch[_0x7436('0x2d')](_0x571972,_0x3a212a,!![]);}catch(_0x12a6c4){return BPromise['reject'](_0x12a6c4);}return _0x571972[_0x7436('0x2e')]();};}function saveUpdates(_0x575404,_0x163df8){return function(_0x39d9cb){if(_0x39d9cb){return _0x39d9cb[_0x7436('0x2f')](_0x575404)[_0x7436('0x1c')](function(_0x41be94){return _0x41be94;});}return null;};}function removeEntity(_0x170602,_0x3e330a){return function(_0x611a0b){if(_0x611a0b){return _0x611a0b['destroy']()[_0x7436('0x1c')](function(){_0x170602[_0x7436('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2db4,_0x55ec6d){return function(_0x3c38ad){if(!_0x3c38ad){_0x4c2db4['sendStatus'](0x194);}return _0x3c38ad;};}function handleError(_0x2eee54,_0x45d295){_0x45d295=_0x45d295||0x1f4;return function(_0x287367){logger[_0x7436('0x20')](_0x287367['stack']);if(_0x287367['name']){delete _0x287367['name'];}_0x2eee54[_0x7436('0x25')](_0x45d295)[_0x7436('0x30')](_0x287367);};}exports[_0x7436('0x31')]=function(_0x5f36fa,_0x3f6c47){var _0x344f25={},_0x58210c={},_0x2f1f9a={'count':0x0,'rows':[]};var _0x577f86=_[_0x7436('0x32')](db[_0x7436('0x33')]['rawAttributes'],function(_0x324ed7){return{'name':_0x324ed7['fieldName'],'type':_0x324ed7[_0x7436('0x34')][_0x7436('0x35')]};});_0x58210c[_0x7436('0x36')]=_[_0x7436('0x32')](_0x577f86,_0x7436('0x37'));_0x58210c[_0x7436('0x38')]=_['keys'](_0x5f36fa[_0x7436('0x38')]);_0x58210c[_0x7436('0x39')]=_[_0x7436('0x3a')](_0x58210c[_0x7436('0x36')],_0x58210c[_0x7436('0x38')]);_0x344f25[_0x7436('0x3b')]=_[_0x7436('0x3a')](_0x58210c[_0x7436('0x36')],qs[_0x7436('0x3c')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x3c')]));_0x344f25[_0x7436('0x3b')]=_0x344f25[_0x7436('0x3b')]['length']?_0x344f25['attributes']:_0x58210c['model'];if(!_0x5f36fa[_0x7436('0x38')][_0x7436('0x3d')]('nolimit')){_0x344f25[_0x7436('0x27')]=qs[_0x7436('0x27')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x27')]);_0x344f25['offset']=qs[_0x7436('0x2a')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x2a')]);}_0x344f25[_0x7436('0x3e')]=qs[_0x7436('0x3f')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x3f')]);_0x344f25[_0x7436('0x40')]=qs[_0x7436('0x39')](_[_0x7436('0x41')](_0x5f36fa[_0x7436('0x38')],_0x58210c[_0x7436('0x39')]),_0x577f86);if(_0x5f36fa[_0x7436('0x38')][_0x7436('0x42')]){_0x344f25[_0x7436('0x40')]=_[_0x7436('0x43')](_0x344f25['where'],{'$or':_['map'](_0x577f86,function(_0x2e067e){if(_0x2e067e[_0x7436('0x34')]!==_0x7436('0x44')){var _0x5f1853={};_0x5f1853[_0x2e067e['name']]={'$like':'%'+_0x5f36fa[_0x7436('0x38')][_0x7436('0x42')]+'%'};return _0x5f1853;}})});}_0x344f25=_[_0x7436('0x43')]({},_0x344f25,_0x5f36fa[_0x7436('0x45')]);var _0x3f1f42={'where':_0x344f25[_0x7436('0x40')]};return db[_0x7436('0x33')][_0x7436('0x29')](_0x3f1f42)[_0x7436('0x1c')](function(_0x68c817){_0x2f1f9a[_0x7436('0x29')]=_0x68c817;if(_0x5f36fa[_0x7436('0x38')][_0x7436('0x46')]){_0x344f25[_0x7436('0x47')]=[{'all':!![]}];}return db[_0x7436('0x33')][_0x7436('0x48')](_0x344f25);})['then'](function(_0x487076){_0x2f1f9a['rows']=_0x487076;return _0x2f1f9a;})[_0x7436('0x1c')](respondWithFilteredResult(_0x3f6c47,_0x344f25))[_0x7436('0x49')](handleError(_0x3f6c47,null));};exports[_0x7436('0x4a')]=function(_0x373272,_0x4b64c3){var _0x31b13e={'raw':!![],'where':{'id':_0x373272['params']['id']}},_0x3f66ee={};_0x3f66ee[_0x7436('0x36')]=_['keys'](db[_0x7436('0x33')][_0x7436('0x4b')]);_0x3f66ee[_0x7436('0x38')]=_[_0x7436('0x4c')](_0x373272[_0x7436('0x38')]);_0x3f66ee[_0x7436('0x39')]=_['intersection'](_0x3f66ee[_0x7436('0x36')],_0x3f66ee[_0x7436('0x38')]);_0x31b13e[_0x7436('0x3b')]=_[_0x7436('0x3a')](_0x3f66ee[_0x7436('0x36')],qs[_0x7436('0x3c')](_0x373272[_0x7436('0x38')]['fields']));_0x31b13e[_0x7436('0x3b')]=_0x31b13e[_0x7436('0x3b')]['length']?_0x31b13e['attributes']:_0x3f66ee[_0x7436('0x36')];if(_0x373272[_0x7436('0x38')][_0x7436('0x46')]){_0x31b13e[_0x7436('0x47')]=[{'all':!![]}];}_0x31b13e=_['merge']({},_0x31b13e,_0x373272['options']);return db[_0x7436('0x33')][_0x7436('0x4d')](_0x31b13e)[_0x7436('0x1c')](handleEntityNotFound(_0x4b64c3,null))[_0x7436('0x1c')](respondWithResult(_0x4b64c3,null))[_0x7436('0x49')](handleError(_0x4b64c3,null));};exports[_0x7436('0x4e')]=function(_0x354277,_0x5692f1){return db[_0x7436('0x33')][_0x7436('0x4e')](_0x354277[_0x7436('0x4f')],{})[_0x7436('0x1c')](respondWithResult(_0x5692f1,0xc9))['catch'](handleError(_0x5692f1,null));};exports[_0x7436('0x2f')]=function(_0x591260,_0x29e7ef){if(_0x591260['body']['id']){delete _0x591260['body']['id'];}return db[_0x7436('0x33')]['find']({'where':{'id':_0x591260['params']['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x29e7ef,null))['then'](saveUpdates(_0x591260[_0x7436('0x4f')],null))['then'](respondWithResult(_0x29e7ef,null))[_0x7436('0x49')](handleError(_0x29e7ef,null));};exports[_0x7436('0x50')]=function(_0x21565b,_0x4ec487){return db[_0x7436('0x33')][_0x7436('0x4d')]({'where':{'id':_0x21565b[_0x7436('0x51')]['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x4ec487,null))[_0x7436('0x1c')](removeEntity(_0x4ec487,null))[_0x7436('0x49')](handleError(_0x4ec487,null));};exports[_0x7436('0x52')]=function(_0x205ae5,_0xfd1b85){return db['SmsMessage'][_0x7436('0x52')]()[_0x7436('0x1c')](respondWithResult(_0xfd1b85,null))[_0x7436('0x49')](handleError(_0xfd1b85,null));};var interaction_log=require('../../config/logger')(_0x7436('0x53'));exports['accept']=function(_0x336149,_0xc95c76,_0x231609){var _0xd1da0d={'agent':{},'channel':_0x7436('0x54')};if(_0x336149[_0x7436('0x4f')]['id']){delete _0x336149[_0x7436('0x4f')]['id'];}_0x336149[_0x7436('0x4f')][_0x7436('0x55')]=!![];_0x336149[_0x7436('0x4f')][_0x7436('0x56')]=moment()[_0x7436('0x57')](_0x7436('0x58'));_0x336149['body']['UserId']=_0x336149[_0x7436('0x4f')]['UserId']||_0x336149[_0x7436('0x59')]['id'];_0xd1da0d[_0x7436('0x5a')]['id']=_0x336149[_0x7436('0x4f')]['UserId'];return db[_0x7436('0x33')][_0x7436('0x4d')]({'where':{'id':_0x336149['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc95c76,null))[_0x7436('0x1c')](saveUpdates(_0x336149[_0x7436('0x4f')],null))['then'](function(_0x553ef3){if(_0x553ef3){_0xd1da0d[_0x7436('0x23')]=_0x553ef3[_0x7436('0x5b')]({'plain':!![]});return db['SmsInteraction'][_0x7436('0x4d')]({'where':{'id':_0x553ef3[_0x7436('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0xc95c76,null))[_0x7436('0x1c')](function(_0x58f083){if(_0x58f083){return _0x58f083[_0x7436('0x2f')]({'UserId':_0x336149[_0x7436('0x4f')]['UserId'],'read1stAt':_[_0x7436('0x5d')](_0x58f083['read1stAt'])?moment()[_0x7436('0x57')](_0x7436('0x58')):undefined});}return null;})[_0x7436('0x1c')](function(_0x5c1c64){if(_0x5c1c64){_0xd1da0d['interaction']=_0x5c1c64[_0x7436('0x5b')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x336149[_0x7436('0x59')]['id'],_0x336149[_0x7436('0x59')][_0x7436('0x37')],_0x336149['user'][_0x7436('0x5e')],_0xd1da0d[_0x7436('0x5f')]['id'],_0x336149['body']?JSON['stringify'](_0x336149[_0x7436('0x4f')]):_0x7436('0x60'));return respondWithRpcPromise(_0x7436('0x61'),_0x7436('0x62'),_0xd1da0d);}return null;})['then'](function(_0x5c7252){var _0x2a4dc7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c7252[_0x7436('0x23')][_0x7436('0x63')];return db[_0x7436('0x64')][_0x7436('0x38')](_0x2a4dc7,{'type':db[_0x7436('0x65')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7436('0x1c')](function(_0x5ef84e){return _0x5ef84e;});})[_0x7436('0x1c')](function(_0x11333a){if(_0x11333a){_0xd1da0d[_0x7436('0x23')]['contact']=_0x11333a[0x0];if(!_0x336149[_0x7436('0x4f')][_0x7436('0x66')])return;return db[_0x7436('0x67')][_0x7436('0x4d')]({'where':{'id':_0x336149[_0x7436('0x4f')]['UserId'],'role':_0x7436('0x5a')},'attributes':['id','name','fullname','email',_0x7436('0x68')],'raw':!![]});}return null;})[_0x7436('0x1c')](function(_0x224d4f){if(!_0x224d4f)return null;_0xd1da0d[_0x7436('0x23')][_0x7436('0x5a')]=_0x224d4f;return _0xd1da0d;})[_0x7436('0x1c')](function(_0x39f168){if(_0x39f168){if(_0x336149['body']['manual']){_0xd1da0d[_0x7436('0x23')][_0x7436('0x69')]=util[_0x7436('0x57')]('SIP/%s',_0x336149[_0x7436('0x59')][_0x7436('0x37')]);_0xd1da0d[_0x7436('0x23')]['channel']=_0xd1da0d[_0x7436('0x6a')];_0xd1da0d[_0x7436('0x23')]['motionChannel']=_0xd1da0d[_0x7436('0x6a')];_0xd1da0d[_0x7436('0x23')]['event']=_0x7436('0x6b');return respondWithRpcPromise('EventManager',_0x7436('0x6c'),{'event':_0x7436('0x6d'),'message':_0xd1da0d[_0x7436('0x23')]},client9002)[_0x7436('0x1c')](function(){return _0xd1da0d;});}return _0xd1da0d;}return null;})[_0x7436('0x1c')](respondWithResult(_0xc95c76,null))['catch'](handleError(_0xc95c76,null));};var interaction_log=require(_0x7436('0x6e'))(_0x7436('0x53'));exports[_0x7436('0x6f')]=function(_0x90b616,_0x1f547e,_0x1d4f86){var _0x19df20={'agent':{},'channel':_0x7436('0x54')};if(_0x90b616[_0x7436('0x4f')]['id']){delete _0x90b616['body']['id'];}_0x90b616[_0x7436('0x4f')][_0x7436('0x66')]=_0x90b616['body']['UserId']||_0x90b616[_0x7436('0x59')]['id'];_0x19df20[_0x7436('0x5a')]['id']=_0x90b616[_0x7436('0x4f')][_0x7436('0x66')];return db[_0x7436('0x33')]['find']({'where':{'id':_0x90b616[_0x7436('0x51')]['id'],'UserId':null}})[_0x7436('0x1c')](handleEntityNotFound(_0x1f547e,null))[_0x7436('0x1c')](function(_0x30b594){if(_0x30b594){_0x19df20[_0x7436('0x23')]=_0x30b594[_0x7436('0x5b')]({'plain':!![]});return db[_0x7436('0x70')][_0x7436('0x4d')]({'where':{'id':_0x30b594[_0x7436('0x5c')]}});}return null;})[_0x7436('0x1c')](handleEntityNotFound(_0x1f547e,null))[_0x7436('0x1c')](function(_0x1192ad){if(_0x1192ad){_0x19df20[_0x7436('0x5f')]=_0x1192ad[_0x7436('0x5b')]({'plain':!![]});interaction_log['info'](_0x7436('0x71'),_0x90b616[_0x7436('0x59')]['id'],_0x90b616[_0x7436('0x59')][_0x7436('0x37')],_0x90b616[_0x7436('0x59')][_0x7436('0x5e')],_0x19df20[_0x7436('0x5f')]['id'],_0x90b616['body']?JSON[_0x7436('0x1f')](_0x90b616[_0x7436('0x4f')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x19df20);}return null;})[_0x7436('0x1c')](function(_0x2c1a55){var _0x18b4cf=_0x7436('0x72')+_0x2c1a55[_0x7436('0x23')][_0x7436('0x63')];return db[_0x7436('0x64')][_0x7436('0x38')](_0x18b4cf,{'type':db[_0x7436('0x65')][_0x7436('0x73')][_0x7436('0x74')],'raw':!![]})[_0x7436('0x1c')](function(_0x4528ba){return _0x4528ba;});})['then'](function(_0x20752c){if(_0x20752c){_0x19df20[_0x7436('0x23')][_0x7436('0x75')]=_0x20752c[0x0];if(!_0x90b616[_0x7436('0x4f')][_0x7436('0x66')])return;return db[_0x7436('0x67')][_0x7436('0x4d')]({'where':{'id':_0x90b616[_0x7436('0x4f')][_0x7436('0x66')],'role':'agent'},'attributes':['id',_0x7436('0x37'),'fullname',_0x7436('0x76'),_0x7436('0x68')],'raw':!![]});}return null;})[_0x7436('0x1c')](function(_0x4e033e){if(!_0x4e033e)return null;_0x19df20[_0x7436('0x23')][_0x7436('0x5a')]=_0x4e033e;return _0x19df20;})[_0x7436('0x1c')](function(_0x559183){if(_0x559183){_0x559183['message'][_0x7436('0x69')]=util[_0x7436('0x57')](_0x7436('0x77'),_0x90b616[_0x7436('0x59')]['name']);_0x559183[_0x7436('0x23')]['channel']=_0x19df20[_0x7436('0x6a')];_0x559183['message'][_0x7436('0x78')]=_0x19df20[_0x7436('0x6a')];_0x559183['message'][_0x7436('0x79')]=_0x7436('0x6f');respondWithRpcPromise(_0x7436('0x6c'),_0x7436('0x6c'),{'event':_0x7436('0x7a'),'message':_0x559183[_0x7436('0x23')]},client9002);return _0x19df20;}return null;})[_0x7436('0x1c')](respondWithResult(_0x1f547e,null))[_0x7436('0x49')](handleError(_0x1f547e,null));};exports[_0x7436('0x25')]=function(_0x34239d,_0x59dffb,_0x36db11){if(_0x34239d[_0x7436('0x4f')]['id']){delete _0x34239d[_0x7436('0x4f')]['id'];}var _0x479fd0;return db['SmsMessage'][_0x7436('0x4d')]({'where':{'id':_0x34239d[_0x7436('0x51')]['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x59dffb,null))[_0x7436('0x1c')](function(_0x447c2d){if(_0x447c2d){_0x479fd0=_0x447c2d;return db['SmsAccount'][_0x7436('0x4d')]({'where':{'id':_0x447c2d['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x59dffb,null))[_0x7436('0x1c')](function(_0x57222a){if(_0x57222a){logger['debug'](_0x7436('0x7b'),_0x7436('0x25'),'received\x20delivery\x20report\x20from',_0x57222a[_0x7436('0x34')],util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));switch(_0x57222a[_0x7436('0x34')]){case'twilio':if(_0x34239d[_0x7436('0x4f')]['MessageSid']&&_0x34239d[_0x7436('0x4f')][_0x7436('0x7d')]===_0x479fd0[_0x7436('0x7e')]){return _0x479fd0[_0x7436('0x2f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7436('0x25'),_0x7436('0x7f'),util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));}break;case _0x7436('0x80'):if(_0x34239d[_0x7436('0x4f')][_0x7436('0x81')]&&_0x34239d[_0x7436('0x4f')][_0x7436('0x81')]===_0x479fd0['messageId']&&_['indexOf']([_0x7436('0x82'),_0x7436('0x83')],_0x34239d['body'][_0x7436('0x84')])>=0x0){return _0x479fd0[_0x7436('0x2f')]({'read':!![]});}else{logger['error'](_0x7436('0x85'),_0x7436('0x25'),_0x7436('0x86'),util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x45dc5e=_0x34239d[_0x7436('0x4f')]['results'][0x0];if(_0x45dc5e['status']['groupName']===_0x7436('0x87')){return _0x479fd0['update']({'read':!![]});}else{logger[_0x7436('0x20')](_0x7436('0x85'),_0x7436('0x25'),_0x7436('0x88'),util[_0x7436('0x7c')](_0x34239d['body'],{'showHidden':![],'depth':null}));}break;}return _0x479fd0;}})['then'](respondWithResult(_0x59dffb,null))['catch'](handleError(_0x59dffb,null));}; \ No newline at end of file +var _0x5cc3=['motionChannel','EventManager','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','where','VIRTUAL','options','include','show','params','fields','create','body','find','destroy','describe','sms-interactions','sms','read','UserId','user','get','SmsInteraction','update','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','format','channel','event','accept','acceptmessage','SmsInteractionId','rejectMessage','SIP/%s'];(function(_0x33a3ec,_0x461e4e){var _0x28089f=function(_0x5a5eb7){while(--_0x5a5eb7){_0x33a3ec['push'](_0x33a3ec['shift']());}};_0x28089f(++_0x461e4e);}(_0x5cc3,0x144));var _0x35cc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5cc3[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x35cc('0x0'));var rimraf=require(_0x35cc('0x1'));var zipdir=require(_0x35cc('0x2'));var jsonpatch=require(_0x35cc('0x3'));var rp=require(_0x35cc('0x4'));var moment=require(_0x35cc('0x5'));var BPromise=require(_0x35cc('0x6'));var Mustache=require(_0x35cc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x35cc('0x8'));var csv=require(_0x35cc('0x9'));var ejs=require(_0x35cc('0xa'));var fs=require('fs');var fs_extra=require(_0x35cc('0xb'));var _=require(_0x35cc('0xc'));var squel=require(_0x35cc('0xd'));var crypto=require(_0x35cc('0xe'));var jsforce=require(_0x35cc('0xf'));var deskjs=require(_0x35cc('0x10'));var toCsv=require(_0x35cc('0x9'));var querystring=require(_0x35cc('0x11'));var Papa=require(_0x35cc('0x12'));var Redis=require(_0x35cc('0x13'));var authService=require(_0x35cc('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35cc('0x15'));var logger=require(_0x35cc('0x16'))(_0x35cc('0x17'));var utils=require(_0x35cc('0x18'));var config=require(_0x35cc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x35cc('0x1a'))['db'];config['redis']=_[_0x35cc('0x1b')](config[_0x35cc('0x1c')],{'host':_0x35cc('0x1d'),'port':0x18eb});var socket=require(_0x35cc('0x1e'))(new Redis(config[_0x35cc('0x1c')]));require(_0x35cc('0x1f'))[_0x35cc('0x20')](socket);var jayson=require(_0x35cc('0x21'));var client=jayson['client'][_0x35cc('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x35cc('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2ec817,_0x31dee6,_0x123bfa,_0x2cf1e5){return new BPromise(function(_0x188cf6,_0x1087e8){var _0x3a7dac=_0x2cf1e5||client;return _0x3a7dac[_0x35cc('0x23')](_0x2ec817,_0x123bfa)[_0x35cc('0x24')](function(_0x2817de){logger[_0x35cc('0x25')]('SmsMessage,\x20%s,\x20%s',_0x31dee6,_0x35cc('0x26'));logger[_0x35cc('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31dee6,_0x35cc('0x26'),JSON[_0x35cc('0x28')](_0x2817de));if(_0x2817de['error']){if(_0x2817de[_0x35cc('0x29')][_0x35cc('0x2a')]===0x1f4){logger[_0x35cc('0x29')]('SmsMessage,\x20%s,\x20%s',_0x31dee6,_0x2817de['error'][_0x35cc('0x2b')]);return _0x1087e8(_0x2817de[_0x35cc('0x29')]['message']);}logger[_0x35cc('0x29')](_0x35cc('0x2c'),_0x31dee6,_0x2817de['error'][_0x35cc('0x2b')]);return _0x188cf6(_0x2817de[_0x35cc('0x29')][_0x35cc('0x2b')]);}else{logger[_0x35cc('0x25')](_0x35cc('0x2c'),_0x31dee6,_0x35cc('0x26'));_0x188cf6(_0x2817de[_0x35cc('0x2d')][_0x35cc('0x2b')]);}})[_0x35cc('0x2e')](function(_0x4785e8){logger[_0x35cc('0x29')]('SmsMessage,\x20%s,\x20%s',_0x31dee6,_0x4785e8);_0x1087e8(_0x4785e8);});});}function respondWithStatusCode(_0x5596fa,_0x52b732){_0x52b732=_0x52b732||0xcc;return function(_0x2d355f){if(_0x2d355f){return _0x5596fa[_0x35cc('0x2f')](_0x52b732);}return _0x5596fa[_0x35cc('0x30')](_0x52b732)['end']();};}function respondWithResult(_0x2476f3,_0xb2157f){_0xb2157f=_0xb2157f||0xc8;return function(_0x55dc43){if(_0x55dc43){return _0x2476f3[_0x35cc('0x30')](_0xb2157f)[_0x35cc('0x31')](_0x55dc43);}};}function respondWithFilteredResult(_0x4bf050,_0x346b41){return function(_0x5991f8){if(_0x5991f8){var _0x11356c=typeof _0x346b41[_0x35cc('0x32')]===_0x35cc('0x33')&&typeof _0x346b41[_0x35cc('0x34')]===_0x35cc('0x33');var _0x409029=_0x5991f8['count'];var _0x224276=_0x11356c?0x0:_0x346b41[_0x35cc('0x32')];var _0x18179d=_0x11356c?_0x5991f8[_0x35cc('0x35')]:_0x346b41[_0x35cc('0x32')]+_0x346b41[_0x35cc('0x34')];var _0x394e42;if(_0x18179d>=_0x409029){_0x18179d=_0x409029;_0x394e42=0xc8;}else{_0x394e42=0xce;}_0x4bf050[_0x35cc('0x30')](_0x394e42);return _0x4bf050[_0x35cc('0x36')]('Content-Range',_0x224276+'-'+_0x18179d+'/'+_0x409029)[_0x35cc('0x31')](_0x5991f8);}return null;};}function patchUpdates(_0x4a0563){return function(_0x5f1a4e){try{jsonpatch[_0x35cc('0x37')](_0x5f1a4e,_0x4a0563,!![]);}catch(_0x52a252){return BPromise[_0x35cc('0x38')](_0x52a252);}return _0x5f1a4e[_0x35cc('0x39')]();};}function saveUpdates(_0x9f3317,_0x593109){return function(_0x19743d){if(_0x19743d){return _0x19743d['update'](_0x9f3317)[_0x35cc('0x24')](function(_0x435800){return _0x435800;});}return null;};}function removeEntity(_0x2ba982,_0x497907){return function(_0x39c1b8){if(_0x39c1b8){return _0x39c1b8['destroy']()['then'](function(){_0x2ba982['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee6da,_0x3f3548){return function(_0x192ae4){if(!_0x192ae4){_0x2ee6da[_0x35cc('0x2f')](0x194);}return _0x192ae4;};}function handleError(_0x493d10,_0xf037bc){_0xf037bc=_0xf037bc||0x1f4;return function(_0x13ffcf){logger[_0x35cc('0x29')](_0x13ffcf[_0x35cc('0x3a')]);if(_0x13ffcf[_0x35cc('0x3b')]){delete _0x13ffcf[_0x35cc('0x3b')];}_0x493d10[_0x35cc('0x30')](_0xf037bc)[_0x35cc('0x3c')](_0x13ffcf);};}exports[_0x35cc('0x3d')]=function(_0x34a711,_0x127777){var _0x238c96={},_0x2161a4={},_0x487ca3={'count':0x0,'rows':[]};var _0x416fc0=_[_0x35cc('0x3e')](db[_0x35cc('0x3f')][_0x35cc('0x40')],function(_0x1a4961){return{'name':_0x1a4961[_0x35cc('0x41')],'type':_0x1a4961[_0x35cc('0x42')][_0x35cc('0x43')]};});_0x2161a4[_0x35cc('0x44')]=_[_0x35cc('0x3e')](_0x416fc0,_0x35cc('0x3b'));_0x2161a4['query']=_[_0x35cc('0x45')](_0x34a711['query']);_0x2161a4['filters']=_['intersection'](_0x2161a4[_0x35cc('0x44')],_0x2161a4[_0x35cc('0x46')]);_0x238c96[_0x35cc('0x47')]=_[_0x35cc('0x48')](_0x2161a4[_0x35cc('0x44')],qs['fields'](_0x34a711['query']['fields']));_0x238c96[_0x35cc('0x47')]=_0x238c96[_0x35cc('0x47')][_0x35cc('0x49')]?_0x238c96[_0x35cc('0x47')]:_0x2161a4[_0x35cc('0x44')];if(!_0x34a711[_0x35cc('0x46')][_0x35cc('0x4a')](_0x35cc('0x4b'))){_0x238c96[_0x35cc('0x34')]=qs['limit'](_0x34a711['query'][_0x35cc('0x34')]);_0x238c96[_0x35cc('0x32')]=qs['offset'](_0x34a711['query'][_0x35cc('0x32')]);}_0x238c96[_0x35cc('0x4c')]=qs['sort'](_0x34a711[_0x35cc('0x46')]['sort']);_0x238c96['where']=qs[_0x35cc('0x4d')](_[_0x35cc('0x4e')](_0x34a711[_0x35cc('0x46')],_0x2161a4[_0x35cc('0x4d')]),_0x416fc0);if(_0x34a711[_0x35cc('0x46')][_0x35cc('0x4f')]){_0x238c96['where']=_[_0x35cc('0x50')](_0x238c96[_0x35cc('0x51')],{'$or':_[_0x35cc('0x3e')](_0x416fc0,function(_0x174d37){if(_0x174d37['type']!==_0x35cc('0x52')){var _0x4e5293={};_0x4e5293[_0x174d37[_0x35cc('0x3b')]]={'$like':'%'+_0x34a711[_0x35cc('0x46')][_0x35cc('0x4f')]+'%'};return _0x4e5293;}})});}_0x238c96=_[_0x35cc('0x50')]({},_0x238c96,_0x34a711[_0x35cc('0x53')]);var _0x447b24={'where':_0x238c96[_0x35cc('0x51')]};return db['SmsMessage'][_0x35cc('0x35')](_0x447b24)[_0x35cc('0x24')](function(_0x188eec){_0x487ca3['count']=_0x188eec;if(_0x34a711[_0x35cc('0x46')]['includeAll']){_0x238c96[_0x35cc('0x54')]=[{'all':!![]}];}return db[_0x35cc('0x3f')]['findAll'](_0x238c96);})[_0x35cc('0x24')](function(_0x461e21){_0x487ca3['rows']=_0x461e21;return _0x487ca3;})[_0x35cc('0x24')](respondWithFilteredResult(_0x127777,_0x238c96))[_0x35cc('0x2e')](handleError(_0x127777,null));};exports[_0x35cc('0x55')]=function(_0x4c9248,_0x5cb962){var _0x273470={'raw':!![],'where':{'id':_0x4c9248[_0x35cc('0x56')]['id']}},_0x271e04={};_0x271e04[_0x35cc('0x44')]=_[_0x35cc('0x45')](db[_0x35cc('0x3f')][_0x35cc('0x40')]);_0x271e04[_0x35cc('0x46')]=_[_0x35cc('0x45')](_0x4c9248[_0x35cc('0x46')]);_0x271e04['filters']=_[_0x35cc('0x48')](_0x271e04[_0x35cc('0x44')],_0x271e04[_0x35cc('0x46')]);_0x273470['attributes']=_[_0x35cc('0x48')](_0x271e04[_0x35cc('0x44')],qs[_0x35cc('0x57')](_0x4c9248[_0x35cc('0x46')][_0x35cc('0x57')]));_0x273470['attributes']=_0x273470[_0x35cc('0x47')][_0x35cc('0x49')]?_0x273470[_0x35cc('0x47')]:_0x271e04['model'];if(_0x4c9248[_0x35cc('0x46')]['includeAll']){_0x273470[_0x35cc('0x54')]=[{'all':!![]}];}_0x273470=_[_0x35cc('0x50')]({},_0x273470,_0x4c9248['options']);return db[_0x35cc('0x3f')]['find'](_0x273470)[_0x35cc('0x24')](handleEntityNotFound(_0x5cb962,null))[_0x35cc('0x24')](respondWithResult(_0x5cb962,null))[_0x35cc('0x2e')](handleError(_0x5cb962,null));};exports[_0x35cc('0x58')]=function(_0x2483da,_0x535220){return db[_0x35cc('0x3f')][_0x35cc('0x58')](_0x2483da['body'],{})[_0x35cc('0x24')](respondWithResult(_0x535220,0xc9))[_0x35cc('0x2e')](handleError(_0x535220,null));};exports['update']=function(_0x3c1031,_0x362984){if(_0x3c1031[_0x35cc('0x59')]['id']){delete _0x3c1031[_0x35cc('0x59')]['id'];}return db[_0x35cc('0x3f')][_0x35cc('0x5a')]({'where':{'id':_0x3c1031['params']['id']}})['then'](handleEntityNotFound(_0x362984,null))['then'](saveUpdates(_0x3c1031[_0x35cc('0x59')],null))[_0x35cc('0x24')](respondWithResult(_0x362984,null))['catch'](handleError(_0x362984,null));};exports[_0x35cc('0x5b')]=function(_0xf562eb,_0x3c1e4a){return db[_0x35cc('0x3f')][_0x35cc('0x5a')]({'where':{'id':_0xf562eb[_0x35cc('0x56')]['id']}})[_0x35cc('0x24')](handleEntityNotFound(_0x3c1e4a,null))[_0x35cc('0x24')](removeEntity(_0x3c1e4a,null))[_0x35cc('0x2e')](handleError(_0x3c1e4a,null));};exports[_0x35cc('0x5c')]=function(_0x23e60e,_0x51324b){return db[_0x35cc('0x3f')]['describe']()[_0x35cc('0x24')](respondWithResult(_0x51324b,null))[_0x35cc('0x2e')](handleError(_0x51324b,null));};var interaction_log=require('../../config/logger')(_0x35cc('0x5d'));exports['accept']=function(_0x206782,_0x3fa764,_0x46e715){var _0x2a665d={'agent':{},'channel':_0x35cc('0x5e')};if(_0x206782[_0x35cc('0x59')]['id']){delete _0x206782[_0x35cc('0x59')]['id'];}_0x206782['body'][_0x35cc('0x5f')]=!![];_0x206782[_0x35cc('0x59')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x206782[_0x35cc('0x59')]['UserId']=_0x206782['body'][_0x35cc('0x60')]||_0x206782[_0x35cc('0x61')]['id'];_0x2a665d['agent']['id']=_0x206782[_0x35cc('0x59')][_0x35cc('0x60')];return db['SmsMessage']['find']({'where':{'id':_0x206782[_0x35cc('0x56')]['id'],'UserId':null}})[_0x35cc('0x24')](handleEntityNotFound(_0x3fa764,null))[_0x35cc('0x24')](saveUpdates(_0x206782[_0x35cc('0x59')],null))[_0x35cc('0x24')](function(_0x498b95){if(_0x498b95){_0x2a665d[_0x35cc('0x2b')]=_0x498b95[_0x35cc('0x62')]({'plain':!![]});return db[_0x35cc('0x63')][_0x35cc('0x5a')]({'where':{'id':_0x498b95['SmsInteractionId']}});}return null;})[_0x35cc('0x24')](handleEntityNotFound(_0x3fa764,null))[_0x35cc('0x24')](function(_0x784ea2){if(_0x784ea2){return _0x784ea2[_0x35cc('0x64')]({'UserId':_0x206782[_0x35cc('0x59')][_0x35cc('0x60')],'read1stAt':_['isNil'](_0x784ea2[_0x35cc('0x65')])?moment()['format'](_0x35cc('0x66')):undefined});}return null;})[_0x35cc('0x24')](function(_0xcd7eff){if(_0xcd7eff){_0x2a665d[_0x35cc('0x67')]=_0xcd7eff[_0x35cc('0x62')]({'plain':!![]});interaction_log[_0x35cc('0x25')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x206782[_0x35cc('0x61')]['id'],_0x206782['user'][_0x35cc('0x3b')],_0x206782[_0x35cc('0x61')][_0x35cc('0x68')],_0x2a665d[_0x35cc('0x67')]['id'],_0x206782['body']?JSON[_0x35cc('0x28')](_0x206782['body']):_0x35cc('0x69'));return respondWithRpcPromise(_0x35cc('0x6a'),_0x35cc('0x6b'),_0x2a665d);}return null;})[_0x35cc('0x24')](function(_0x384bc3){var _0x38b780=_0x35cc('0x6c')+_0x384bc3['message'][_0x35cc('0x6d')];return db[_0x35cc('0x6e')][_0x35cc('0x46')](_0x38b780,{'type':db['Sequelize'][_0x35cc('0x6f')][_0x35cc('0x70')],'raw':!![]})['then'](function(_0x5b8e8b){return _0x5b8e8b;});})[_0x35cc('0x24')](function(_0x29402e){if(_0x29402e){_0x2a665d['message'][_0x35cc('0x71')]=_0x29402e[0x0];if(!_0x206782[_0x35cc('0x59')][_0x35cc('0x60')])return;return db[_0x35cc('0x72')][_0x35cc('0x5a')]({'where':{'id':_0x206782[_0x35cc('0x59')][_0x35cc('0x60')],'role':'agent'},'attributes':['id',_0x35cc('0x3b'),_0x35cc('0x73'),_0x35cc('0x74'),_0x35cc('0x75')],'raw':!![]});}return null;})[_0x35cc('0x24')](function(_0x49f4e5){if(!_0x49f4e5)return null;_0x2a665d['message'][_0x35cc('0x76')]=_0x49f4e5;return _0x2a665d;})[_0x35cc('0x24')](function(_0x342bd0){if(_0x342bd0){if(_0x206782[_0x35cc('0x59')][_0x35cc('0x77')]){_0x2a665d['message'][_0x35cc('0x78')]=util[_0x35cc('0x79')]('SIP/%s',_0x206782[_0x35cc('0x61')][_0x35cc('0x3b')]);_0x2a665d[_0x35cc('0x2b')][_0x35cc('0x7a')]=_0x2a665d[_0x35cc('0x7a')];_0x2a665d['message']['motionChannel']=_0x2a665d['channel'];_0x2a665d[_0x35cc('0x2b')][_0x35cc('0x7b')]=_0x35cc('0x7c');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x35cc('0x7d'),'message':_0x2a665d[_0x35cc('0x2b')]},client9002)['then'](function(){return _0x2a665d;});}return _0x2a665d;}return null;})[_0x35cc('0x24')](respondWithResult(_0x3fa764,null))[_0x35cc('0x2e')](handleError(_0x3fa764,null));};var interaction_log=require(_0x35cc('0x16'))('sms-interactions');exports[_0x35cc('0x38')]=function(_0x270edb,_0x4a398c,_0x50ab05){var _0x1267b7={'agent':{},'channel':_0x35cc('0x5e')};if(_0x270edb[_0x35cc('0x59')]['id']){delete _0x270edb['body']['id'];}_0x270edb[_0x35cc('0x59')][_0x35cc('0x60')]=_0x270edb[_0x35cc('0x59')][_0x35cc('0x60')]||_0x270edb[_0x35cc('0x61')]['id'];_0x1267b7[_0x35cc('0x76')]['id']=_0x270edb[_0x35cc('0x59')][_0x35cc('0x60')];return db[_0x35cc('0x3f')][_0x35cc('0x5a')]({'where':{'id':_0x270edb[_0x35cc('0x56')]['id'],'UserId':null}})[_0x35cc('0x24')](handleEntityNotFound(_0x4a398c,null))[_0x35cc('0x24')](function(_0x30900c){if(_0x30900c){_0x1267b7[_0x35cc('0x2b')]=_0x30900c[_0x35cc('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x35cc('0x5a')]({'where':{'id':_0x30900c[_0x35cc('0x7e')]}});}return null;})[_0x35cc('0x24')](handleEntityNotFound(_0x4a398c,null))['then'](function(_0x341e7a){if(_0x341e7a){_0x1267b7[_0x35cc('0x67')]=_0x341e7a[_0x35cc('0x62')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x270edb[_0x35cc('0x61')]['id'],_0x270edb['user'][_0x35cc('0x3b')],_0x270edb[_0x35cc('0x61')][_0x35cc('0x68')],_0x1267b7[_0x35cc('0x67')]['id'],_0x270edb[_0x35cc('0x59')]?JSON[_0x35cc('0x28')](_0x270edb[_0x35cc('0x59')]):'null');return respondWithRpcPromise('RejectMessage',_0x35cc('0x7f'),_0x1267b7);}return null;})['then'](function(_0x1f3f10){var _0x5071ed=_0x35cc('0x6c')+_0x1f3f10[_0x35cc('0x2b')]['ContactId'];return db[_0x35cc('0x6e')]['query'](_0x5071ed,{'type':db['Sequelize']['QueryTypes'][_0x35cc('0x70')],'raw':!![]})[_0x35cc('0x24')](function(_0x5df9a1){return _0x5df9a1;});})['then'](function(_0x1def4c){if(_0x1def4c){_0x1267b7[_0x35cc('0x2b')][_0x35cc('0x71')]=_0x1def4c[0x0];if(!_0x270edb['body']['UserId'])return;return db['User'][_0x35cc('0x5a')]({'where':{'id':_0x270edb['body'][_0x35cc('0x60')],'role':'agent'},'attributes':['id',_0x35cc('0x3b'),_0x35cc('0x73'),_0x35cc('0x74'),'internal'],'raw':!![]});}return null;})[_0x35cc('0x24')](function(_0x246b02){if(!_0x246b02)return null;_0x1267b7['message'][_0x35cc('0x76')]=_0x246b02;return _0x1267b7;})['then'](function(_0x26c167){if(_0x26c167){_0x26c167[_0x35cc('0x2b')][_0x35cc('0x78')]=util[_0x35cc('0x79')](_0x35cc('0x80'),_0x270edb[_0x35cc('0x61')][_0x35cc('0x3b')]);_0x26c167[_0x35cc('0x2b')]['channel']=_0x1267b7[_0x35cc('0x7a')];_0x26c167[_0x35cc('0x2b')][_0x35cc('0x81')]=_0x1267b7[_0x35cc('0x7a')];_0x26c167['message'][_0x35cc('0x7b')]=_0x35cc('0x38');respondWithRpcPromise(_0x35cc('0x82'),'EventManager',{'event':_0x35cc('0x83'),'message':_0x26c167[_0x35cc('0x2b')]},client9002);return _0x1267b7;}return null;})[_0x35cc('0x24')](respondWithResult(_0x4a398c,null))[_0x35cc('0x2e')](handleError(_0x4a398c,null));};exports[_0x35cc('0x30')]=function(_0x153c40,_0x571a7f,_0x1d7807){if(_0x153c40[_0x35cc('0x59')]['id']){delete _0x153c40[_0x35cc('0x59')]['id'];}var _0x29fb40;return db[_0x35cc('0x3f')][_0x35cc('0x5a')]({'where':{'id':_0x153c40[_0x35cc('0x56')]['id']}})['then'](handleEntityNotFound(_0x571a7f,null))[_0x35cc('0x24')](function(_0x24144c){if(_0x24144c){_0x29fb40=_0x24144c;return db[_0x35cc('0x84')][_0x35cc('0x5a')]({'where':{'id':_0x24144c[_0x35cc('0x85')]}});}})[_0x35cc('0x24')](handleEntityNotFound(_0x571a7f,null))[_0x35cc('0x24')](function(_0x323658){if(_0x323658){logger[_0x35cc('0x27')](_0x35cc('0x86'),_0x35cc('0x30'),_0x35cc('0x87'),_0x323658['type'],util[_0x35cc('0x88')](_0x153c40[_0x35cc('0x59')],{'showHidden':![],'depth':null}));switch(_0x323658['type']){case _0x35cc('0x89'):if(_0x153c40['body'][_0x35cc('0x8a')]&&_0x153c40['body'][_0x35cc('0x8a')]===_0x29fb40[_0x35cc('0x8b')]){return _0x29fb40[_0x35cc('0x64')]({'read':!![]});}else{logger[_0x35cc('0x29')](_0x35cc('0x8c'),_0x35cc('0x30'),'twilio',util[_0x35cc('0x88')](_0x153c40['body'],{'showHidden':![],'depth':null}));}break;case _0x35cc('0x8d'):if(_0x153c40[_0x35cc('0x59')][_0x35cc('0x8e')]&&_0x153c40['body'][_0x35cc('0x8e')]===_0x29fb40[_0x35cc('0x8b')]&&_[_0x35cc('0x8f')]([_0x35cc('0x90'),'delivered'],_0x153c40['body'][_0x35cc('0x91')])>=0x0){return _0x29fb40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x35cc('0x92'),util[_0x35cc('0x88')](_0x153c40['body'],{'showHidden':![],'depth':null}));}break;case _0x35cc('0x93'):var _0x5f0571=_0x153c40[_0x35cc('0x59')][_0x35cc('0x94')][0x0];if(_0x5f0571[_0x35cc('0x30')][_0x35cc('0x95')]===_0x35cc('0x96')){return _0x29fb40['update']({'read':!![]});}else{logger[_0x35cc('0x29')](_0x35cc('0x8c'),_0x35cc('0x30'),_0x35cc('0x93'),util['inspect'](_0x153c40[_0x35cc('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x29fb40;}})['then'](respondWithResult(_0x571a7f,null))['catch'](handleError(_0x571a7f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ffdcc9b..3d00fd3 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 _0x7d11=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7d11,0xd5));var _0x17d1=function(_0x8133c7,_0x17e40b){_0x8133c7=_0x8133c7-0x0;var _0x19854f=_0x7d11[_0x8133c7];return _0x19854f;};'use strict';var EventEmitter=require(_0x17d1('0x0'));var SmsMessage=require(_0x17d1('0x1'))['db'][_0x17d1('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x17d1('0x3')](0x0);var events={'afterCreate':_0x17d1('0x4'),'afterUpdate':'update','afterDestroy':_0x17d1('0x5')};function emitEvent(_0x406659){return function(_0xa814a3,_0x237b2f,_0x5a007a){SmsMessageEvents[_0x17d1('0x6')](_0x406659+':'+_0xa814a3['id'],_0xa814a3);SmsMessageEvents[_0x17d1('0x6')](_0x406659,_0xa814a3);_0x5a007a(null);};}for(var e in events){if(events[_0x17d1('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x17d1('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x9ab3=['hasOwnProperty','hook','exports','save','update','remove','emit'];(function(_0x5b3d41,_0x5d3583){var _0x5b8b42=function(_0x558f44){while(--_0x558f44){_0x5b3d41['push'](_0x5b3d41['shift']());}};_0x5b8b42(++_0x5d3583);}(_0x9ab3,0x130));var _0x39ab=function(_0x5535bd,_0x1309f8){_0x5535bd=_0x5535bd-0x0;var _0x6737a0=_0x9ab3[_0x5535bd];return _0x6737a0;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x39ab('0x0'),'afterUpdate':_0x39ab('0x1'),'afterDestroy':_0x39ab('0x2')};function emitEvent(_0x4a1e3c){return function(_0x2c551e,_0x403e42,_0x3e7597){SmsMessageEvents[_0x39ab('0x3')](_0x4a1e3c+':'+_0x2c551e['id'],_0x2c551e);SmsMessageEvents['emit'](_0x4a1e3c,_0x2c551e);_0x3e7597(null);};}for(var e in events){if(events[_0x39ab('0x4')](e)){var event=events[e];SmsMessage[_0x39ab('0x5')](e,emitEvent(event));}}module[_0x39ab('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index a09961f..46bf7e4 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 _0xa4d1=['Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','messages','clickSend','remote','token','authId','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','messageId','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','length','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','bandwidth','%s:%s','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','create','phone','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa4d1,0x1c0));var _0x1a4d=function(_0x1a6f39,_0x5a43ab){_0x1a6f39=_0x1a6f39-0x0;var _0x930e69=_0xa4d1[_0x1a6f39];return _0x930e69;};'use strict';var _=require(_0x1a4d('0x0'));var util=require(_0x1a4d('0x1'));var logger=require(_0x1a4d('0x2'))(_0x1a4d('0x3'));var moment=require(_0x1a4d('0x4'));var BPromise=require(_0x1a4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a4d('0x6'));var rimraf=require(_0x1a4d('0x7'));var config=require(_0x1a4d('0x8'));var attributes=require(_0x1a4d('0x9'));module['exports']=function(_0x4f1b1e,_0x2c323a){return _0x4f1b1e[_0x1a4d('0xa')]('SmsMessage',attributes,{'tableName':_0x1a4d('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x1a4d('0xc'),'fields':[_0x1a4d('0xd')],'type':_0x1a4d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3921e5,_0x595b97,_0x32f0b9){var _0x541cdc=_0x4f1b1e[_0x1a4d('0xf')];var _0x64e803=_0x3921e5[_0x1a4d('0x10')]({'plain':!![]});if(_0x64e803[_0x1a4d('0x11')][_0x1a4d('0x12')]()==='in'||_0x64e803['direction'][_0x1a4d('0x12')]()===_0x1a4d('0x13')&&!_0x64e803['secret']&&!_[_0x1a4d('0x14')](_0x64e803[_0x1a4d('0x15')])&&!_['isNil'](_0x64e803['SmsInteractionId'])){_0x541cdc[_0x1a4d('0x16')]['findOne']({'where':{'id':_0x64e803[_0x1a4d('0x17')]}})[_0x1a4d('0x18')](function(_0x2d7239){if(_0x2d7239){_0x2d7239[_0x1a4d('0x19')]({'lastMsgAt':_0x64e803[_0x1a4d('0x1a')],'lastMsgDirection':_0x64e803[_0x1a4d('0x11')]['toLowerCase']()});}})[_0x1a4d('0x1b')](function(_0x230788){console[_0x1a4d('0x1c')](_0x230788);});}if(_0x64e803[_0x1a4d('0x11')]===_0x1a4d('0x13')&&!_0x64e803[_0x1a4d('0x1d')]){var _0x5ce70c;_0x541cdc[_0x1a4d('0x1e')][_0x1a4d('0x1f')]({'where':{'id':_0x64e803[_0x1a4d('0x20')]},'raw':!![]})['then'](function(_0x3e8ca0){_0x5ce70c=_0x3e8ca0;if(_0x5ce70c&&_0x5ce70c[_0x1a4d('0x21')]){switch(_0x5ce70c[_0x1a4d('0x21')]){case _0x1a4d('0x22'):var _0x29d0d1=require(_0x1a4d('0x22'));if(_0x5ce70c[_0x1a4d('0x23')]&&_0x5ce70c[_0x1a4d('0x24')]&&_0x5ce70c['phone']){var _0x29e135=new _0x29d0d1(_0x5ce70c[_0x1a4d('0x23')],_0x5ce70c[_0x1a4d('0x24')]);_0x29e135['messages'][_0x1a4d('0x25')]({'body':_0x64e803[_0x1a4d('0xd')],'to':_0x64e803[_0x1a4d('0x26')],'from':_0x5ce70c[_0x1a4d('0x26')],'statusCallback':_0x5ce70c['remote']+_0x1a4d('0x27')+_0x64e803['id']+_0x1a4d('0x28')+_0x5ce70c['token']})[_0x1a4d('0x18')](function(_0x1ece13){if(_0x1ece13['sid']){return _0x3921e5[_0x1a4d('0x19')]({'messageId':_0x1ece13[_0x1a4d('0x29')]});}})['catch'](function(_0x459e93){logger['error'](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x22'),util['inspect'](_0x459e93,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x22'),_0x1a4d('0x2c'));}break;case _0x1a4d('0x2d'):var _0x4fa1fc=_0x1a4d('0x2e');if(_0x5ce70c[_0x1a4d('0x2f')]&&_0x5ce70c[_0x1a4d('0x30')]){var _0x17d1bb={'recipient':[_0x64e803['phone']],'message':_0x64e803['body'],'message_type':_0x5ce70c[_0x1a4d('0x31')]};if(_0x5ce70c[_0x1a4d('0x31')]&&_0x5ce70c[_0x1a4d('0x31')]!=='SI'){_0x17d1bb[_0x1a4d('0x32')]=_0x5ce70c[_0x1a4d('0x26')];}var _0x437bbd={'url':_0x4fa1fc+'login?username='+_0x5ce70c[_0x1a4d('0x2f')]+_0x1a4d('0x33')+_0x5ce70c['password'],'method':_0x1a4d('0x34')};rp(_0x437bbd)['then'](function(_0x10df04){var _0x116494=_0x10df04[_0x1a4d('0x35')](';');var _0x1e6a49={'user_key':_0x116494[0x0],'session_key':_0x116494[0x1]};_0x437bbd={'url':_0x4fa1fc+_0x1a4d('0x36'),'method':_0x1a4d('0x37'),'headers':{'user_key':_0x1e6a49[_0x1a4d('0x38')],'Session_key':_0x1e6a49[_0x1a4d('0x39')]},'json':!![],'body':_0x17d1bb};return rp(_0x437bbd);})[_0x1a4d('0x18')](function(_0x44adc8){if(_0x44adc8[_0x1a4d('0x3a')]>=0x1){var _0x392f17={'messageId':_0x44adc8['internal_order_id']};if(_0x5ce70c[_0x1a4d('0x31')]!=='GP'||!_0x5ce70c[_0x1a4d('0x3b')]){_0x392f17['read']=!![];}return _0x3921e5[_0x1a4d('0x19')](_0x392f17);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1a4d('0x2d'),util[_0x1a4d('0x3c')](_0x44adc8,{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x178d87){return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x2d'),util['inspect'](_0x178d87,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x2d'),_0x1a4d('0x3d'));}break;case _0x1a4d('0x3e'):if(_0x5ce70c[_0x1a4d('0x24')]){var _0x597570={'recipient':_0x64e803['phone'],'message':_0x64e803['body'],'sender':_0x5ce70c[_0x1a4d('0x3f')]||_0x5ce70c[_0x1a4d('0x26')],'authorization':_0x5ce70c[_0x1a4d('0x24')]};var _0x595b97={'method':_0x1a4d('0x37'),'uri':_0x1a4d('0x40'),'body':_0x597570,'json':!![]};rp(_0x595b97)['then'](function(_0x496ba1){var _0x53b35a={'messageId':_0x496ba1[_0x1a4d('0x41')]};if(!_0x5ce70c['deliveryReport']){_0x53b35a[_0x1a4d('0x42')]=!![];}return _0x3921e5[_0x1a4d('0x19')](_0x53b35a);})[_0x1a4d('0x1b')](function(_0x59de3c){logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),'connectel',util[_0x1a4d('0x3c')](_0x59de3c,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x3e'),_0x1a4d('0x43'));}break;case _0x1a4d('0x44'):if(_0x5ce70c[_0x1a4d('0x2f')]&&_0x5ce70c[_0x1a4d('0x30')]){var _0x597570={'messages':[{'source':_0x1a4d('0x45'),'to':_0x64e803['phone'],'body':_0x64e803[_0x1a4d('0xd')],'from':_0x5ce70c[_0x1a4d('0x3f')]||_0x5ce70c[_0x1a4d('0x26')]}]};var _0x289bfa=util[_0x1a4d('0x46')]('%s:%s',_0x5ce70c[_0x1a4d('0x2f')],_0x5ce70c[_0x1a4d('0x30')]);var _0x595b97={'method':'POST','uri':_0x1a4d('0x47'),'body':_0x597570,'headers':{'Authorization':util[_0x1a4d('0x46')]('Basic\x20%s',new Buffer(_0x289bfa)[_0x1a4d('0x48')](_0x1a4d('0x49')))},'json':!![]};rp(_0x595b97)[_0x1a4d('0x18')](function(_0x832b3){if(_0x832b3[_0x1a4d('0x4a')]>=0xc8&&_0x832b3[_0x1a4d('0x4a')]<=0xce){if(_0x832b3[_0x1a4d('0x4b')]&&_0x832b3[_0x1a4d('0x4b')]['queued_count']>0x0){var _0x3b4b71=_['head'](_0x832b3[_0x1a4d('0x4b')][_0x1a4d('0x4c')]);var _0xef0601={'messageId':_0x3b4b71['message_id']};if(!_0x5ce70c[_0x1a4d('0x3b')]){_0xef0601['read']=!![];}return _0x3921e5[_0x1a4d('0x19')](_0xef0601);}else{logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x4d'),util['inspect'](_0x832b3,{'showHidden':![],'depth':null}));}}else{logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x4d'),util[_0x1a4d('0x3c')](_0x832b3,{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x2caf4a){logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1a4d('0x4d'),util[_0x1a4d('0x3c')](_0x2caf4a,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x5ce70c['authId']&&_0x5ce70c[_0x1a4d('0x24')]){var _0x597570={'dst':_0x64e803[_0x1a4d('0x26')],'text':_0x64e803[_0x1a4d('0xd')],'src':_0x5ce70c[_0x1a4d('0x3f')]||_0x5ce70c[_0x1a4d('0x26')],'url':_0x5ce70c[_0x1a4d('0x4e')]+_0x1a4d('0x27')+_0x64e803['id']+'/status?token='+_0x5ce70c[_0x1a4d('0x4f')]};var _0x289bfa=util[_0x1a4d('0x46')]('%s:%s',_0x5ce70c[_0x1a4d('0x50')],_0x5ce70c[_0x1a4d('0x24')]);var _0x595b97={'method':'POST','uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x5ce70c[_0x1a4d('0x50')]),'body':_0x597570,'headers':{'Authorization':util[_0x1a4d('0x46')](_0x1a4d('0x51'),new Buffer(_0x289bfa)['toString']('base64'))},'json':!![]};rp(_0x595b97)['then'](function(_0x262684){var _0x27663f={'messageId':_0x262684[_0x1a4d('0x52')][0x0]};return _0x3921e5[_0x1a4d('0x19')](_0x27663f);})[_0x1a4d('0x1b')](function(_0x5a997b){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),'plivo',util[_0x1a4d('0x3c')](_0x5a997b,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x53'),_0x1a4d('0x54'));}break;case _0x1a4d('0x55'):if(_0x5ce70c[_0x1a4d('0x2f')]&&_0x5ce70c[_0x1a4d('0x30')]){if(_0x5ce70c[_0x1a4d('0x56')]){var _0x39d430={'method':'POST','uri':_0x5ce70c[_0x1a4d('0x56')]+_0x1a4d('0x57'),'body':{'username':_0x5ce70c[_0x1a4d('0x2f')],'password':_0x5ce70c['password']},'json':!![]};return rp(_0x39d430)[_0x1a4d('0x18')](function(_0x4b1a50){var _0x52bc6f={'method':_0x1a4d('0x37'),'uri':_0x5ce70c[_0x1a4d('0x56')]+_0x1a4d('0x58'),'body':{'messages':[{'from':_0x5ce70c[_0x1a4d('0x26')],'destinations':[{'to':_0x64e803['phone']}],'text':_0x64e803['body'],'notifyUrl':_0x5ce70c[_0x1a4d('0x4e')]+_0x1a4d('0x27')+_0x64e803['id']+_0x1a4d('0x28')+_0x5ce70c[_0x1a4d('0x4f')],'notifyContentType':_0x1a4d('0x59'),'callbackData':_0x5ce70c[_0x1a4d('0x26')]+';'+_0x64e803[_0x1a4d('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x4b1a50[_0x1a4d('0x4f')]},'json':!![]};return rp(_0x52bc6f)[_0x1a4d('0x18')](function(_0x256b16){if(_0x256b16[_0x1a4d('0x4c')]){var _0x168ebd={'messageId':_0x256b16[_0x1a4d('0x4c')][0x0][_0x1a4d('0x5a')]};if(!_0x5ce70c[_0x1a4d('0x3b')]){_0x168ebd[_0x1a4d('0x42')]=!![];}return _0x3921e5['update'](_0x168ebd);}else{return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),'infobip',util[_0x1a4d('0x3c')](_0x256b16,{'showHidden':![],'depth':null}));}});})[_0x1a4d('0x1b')](function(_0x5cd255){return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x55'),util[_0x1a4d('0x3c')](_0x5cd255,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),'afterCreate',_0x1a4d('0x55'),_0x1a4d('0x5b'));}}else{logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),'infobip',_0x1a4d('0x3d'));}break;case _0x1a4d('0x5c'):var _0x847f84=require(_0x1a4d('0x5d'));if(_0x5ce70c[_0x1a4d('0x5e')]){var _0x75e285={};_0x75e285['login']=_0x5ce70c[_0x1a4d('0x2f')];_0x75e285[_0x1a4d('0x26')]=_0x64e803[_0x1a4d('0x26')];_0x75e285[_0x1a4d('0x32')]=_0x5ce70c[_0x1a4d('0x26')];_0x75e285[_0x1a4d('0x5f')]=_0x64e803[_0x1a4d('0xd')];_0x75e285[_0x1a4d('0x60')]=+new Date();var _0x2659d2='';var _0x7a8130='';var _0x3d2a27=Object[_0x1a4d('0x61')](_0x75e285);_0x3d2a27['sort']();for(var _0x558dde=0x0;_0x558dde<_0x3d2a27[_0x1a4d('0x62')];_0x558dde++){if(_0x2659d2!=''){_0x2659d2+='&';}_0x2659d2+=_0x3d2a27[_0x558dde]+'='+encodeURIComponent(_0x75e285[_0x3d2a27[_0x558dde]]);_0x7a8130+=_0x75e285[_0x3d2a27[_0x558dde]];}_0x7a8130+=_0x5ce70c[_0x1a4d('0x5e')];_0x7a8130=_0x847f84['createHash'](_0x1a4d('0x63'))[_0x1a4d('0x19')](_0x7a8130)[_0x1a4d('0x64')](_0x1a4d('0x65'));if(_0x2659d2!==''){_0x2659d2+='&';}_0x2659d2+=_0x1a4d('0x66')+_0x7a8130;var _0x437bbd={'method':_0x1a4d('0x34'),'uri':_0x5ce70c['baseUrl']+'/external/get/send.php?'+_0x2659d2,'json':!![]};return rp(_0x437bbd)['then'](function(_0x373e31){var _0x32449a=Object[_0x1a4d('0x61')](_0x373e31);if(_0x373e31[_0x32449a[0x0]][_0x1a4d('0x1c')]&&parseInt(_0x373e31[_0x32449a[0x0]]['error'])===0x0){var _0x225728={'messageId':_0x373e31[_0x32449a[0x0]][_0x1a4d('0x67')]};if(!_0x5ce70c[_0x1a4d('0x3b')]){_0x225728['read']=!![];}return _0x3921e5['update'](_0x225728);}else{return logger['error'](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x5c'),util[_0x1a4d('0x3c')](_0x373e31['error'],{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x41afb5){return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),'afterCreate',_0x1a4d('0x5c'),util[_0x1a4d('0x3c')](_0x41afb5,{'showHidden':![],'depth':null}));});}else{logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x5c'),_0x1a4d('0x68'));}break;case _0x1a4d('0x69'):if(_0x5ce70c['apiKey']){var _0x27b537={'method':_0x1a4d('0x37'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x5ce70c[_0x1a4d('0x5e')]},'body':{'content':_0x64e803[_0x1a4d('0xd')],'to':[_0x64e803[_0x1a4d('0x26')]],'from':_0x5ce70c[_0x1a4d('0x26')],'binary':![],'clientMessageId':'uuid','charset':_0x1a4d('0x6a')},'json':!![]};rp(_0x27b537)[_0x1a4d('0x18')](function(_0x300094){if(!_0x300094[_0x1a4d('0x1c')]){var _0x3257ab={'messageId':_0x300094[_0x1a4d('0x4c')][0x0]['apiMessageId']};if(!_0x5ce70c[_0x1a4d('0x3b')]){_0x3257ab[_0x1a4d('0x42')]=!![];}return _0x3921e5['update'](_0x3257ab);}else{return logger['error'](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x69'),util[_0x1a4d('0x3c')](_0x300094[_0x1a4d('0x1c')],{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x37c571){return logger['error'](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x69'),util['inspect'](_0x37c571,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1a4d('0x2a'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x1a4d('0x6b'):if(_0x5ce70c[_0x1a4d('0x2f')]&&_0x5ce70c[_0x1a4d('0x30')]){var _0x289bfa=util[_0x1a4d('0x46')](_0x1a4d('0x6c'),_0x5ce70c[_0x1a4d('0x2f')],_0x5ce70c['password']);var _0x595b97={'method':_0x1a4d('0x37'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x5ce70c[_0x1a4d('0x6d')]+_0x1a4d('0x6e'),'body':{'to':[_0x64e803['phone']],'text':_0x64e803['body'],'from':_0x5ce70c[_0x1a4d('0x26')],'applicationId':_0x5ce70c[_0x1a4d('0x6f')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x289bfa)[_0x1a4d('0x48')](_0x1a4d('0x49')))},'json':!![]};rp(_0x595b97)[_0x1a4d('0x18')](function(_0x4c32f7){if(_0x4c32f7['id']){var _0x13906a={'messageId':_0x4c32f7['id']};return _0x3921e5[_0x1a4d('0x19')](_0x13906a);}else{logger['error'](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x6b'),util[_0x1a4d('0x3c')](_0x4c32f7,{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x148fa){logger[_0x1a4d('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1a4d('0x6b'),util['inspect'](_0x148fa,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a4d('0x2b'),_0x1a4d('0x6b'),_0x1a4d('0x3d'));}break;case _0x1a4d('0x70'):if(_0x5ce70c['apiKey']){var _0x1b0e63={};var _0x437bbd={'method':_0x1a4d('0x37'),'uri':_0x1a4d('0x71'),'headers':{'Authorization':_0x1a4d('0x72')+_0x5ce70c['apiKey'],'Content-Type':_0x1a4d('0x59')},'body':{'from':_0x5ce70c[_0x1a4d('0x26')],'to':_0x64e803[_0x1a4d('0x26')],'text':_0x64e803[_0x1a4d('0xd')]},'json':!![]};return rp(_0x437bbd)[_0x1a4d('0x18')](function(_0x23132e){if(_0x23132e[_0x1a4d('0x73')]==0xca){_0x1b0e63[_0x1a4d('0x74')]=_0x23132e;var _0x1f943f={'method':_0x1a4d('0x37'),'uri':_0x1a4d('0x75'),'headers':{'Authorization':_0x1a4d('0x72')+_0x5ce70c[_0x1a4d('0x5e')],'Content-Type':_0x1a4d('0x59')},'body':{'refid':_0x1b0e63['message'][_0x1a4d('0x76')]},'json':!![]};return rp(_0x1f943f)[_0x1a4d('0x18')](function(_0x10a9ad){_0x1b0e63[_0x1a4d('0x77')]=_0x10a9ad;var _0x3bcb81={'messageId':_0x1b0e63[_0x1a4d('0x74')][_0x1a4d('0x76')],'read':!![]};return _0x3921e5[_0x1a4d('0x19')](_0x3bcb81);});}else{return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x70'),util[_0x1a4d('0x3c')](_0x23132e,{'showHidden':![],'depth':null}));}})[_0x1a4d('0x1b')](function(_0x239c9f){return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),_0x1a4d('0x70'),util[_0x1a4d('0x3c')](_0x239c9f,{'showHidden':![],'depth':null}));});}else{return logger[_0x1a4d('0x1c')](_0x1a4d('0x2a'),_0x1a4d('0x2b'),'intelepeer',_0x1a4d('0x78'));}break;}}})[_0x1a4d('0x79')](function(){_0x32f0b9();});}else{_0x32f0b9();}}},'charset':_0x1a4d('0x7a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x07a0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','findOne','SmsInteractionId','then','update','createdAt','secret','SmsAccountId','type','twilio','authToken','create','phone','remote','/api/sms/messages/','/status?token=','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','split','POST','user_key','session_key','total_sent','deliveryReport','read','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','md5','digest','signature=','GET','baseUrl','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xee9feb,_0x459a14){var _0x34c321=function(_0x5edc6b){while(--_0x5edc6b){_0xee9feb['push'](_0xee9feb['shift']());}};_0x34c321(++_0x459a14);}(_0x07a0,0x151));var _0x007a=function(_0x75c97e,_0x1b6909){_0x75c97e=_0x75c97e-0x0;var _0x52f257=_0x07a0[_0x75c97e];return _0x52f257;};'use strict';var _=require(_0x007a('0x0'));var util=require(_0x007a('0x1'));var logger=require(_0x007a('0x2'))(_0x007a('0x3'));var moment=require(_0x007a('0x4'));var BPromise=require(_0x007a('0x5'));var rp=require(_0x007a('0x6'));var fs=require('fs');var path=require(_0x007a('0x7'));var rimraf=require(_0x007a('0x8'));var config=require(_0x007a('0x9'));var attributes=require('./smsMessage.attributes');module[_0x007a('0xa')]=function(_0x53673f,_0x35b449){return _0x53673f[_0x007a('0xb')](_0x007a('0xc'),attributes,{'tableName':_0x007a('0xd'),'paranoid':![],'indexes':[{'name':_0x007a('0xe'),'fields':[_0x007a('0xe')]},{'name':_0x007a('0xf'),'fields':[_0x007a('0x10')],'type':_0x007a('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ec5bb,_0x354928,_0x22316f){var _0x34f3d5=_0x53673f[_0x007a('0x12')];var _0x221903=_0x4ec5bb[_0x007a('0x13')]({'plain':!![]});if(_0x221903[_0x007a('0x14')][_0x007a('0x15')]()==='in'||_0x221903['direction']['toLowerCase']()==='out'&&!_0x221903['secret']&&!_[_0x007a('0x16')](_0x221903['UserId'])&&!_[_0x007a('0x16')](_0x221903['SmsInteractionId'])){_0x34f3d5['SmsInteraction'][_0x007a('0x17')]({'where':{'id':_0x221903[_0x007a('0x18')]}})[_0x007a('0x19')](function(_0x1cae14){if(_0x1cae14){_0x1cae14[_0x007a('0x1a')]({'lastMsgAt':_0x221903[_0x007a('0x1b')],'lastMsgDirection':_0x221903[_0x007a('0x14')]['toLowerCase']()});}})['catch'](function(_0xe5866e){console['error'](_0xe5866e);});}if(_0x221903[_0x007a('0x14')]==='out'&&!_0x221903[_0x007a('0x1c')]){var _0x186ec0;_0x34f3d5['SmsAccount']['find']({'where':{'id':_0x221903[_0x007a('0x1d')]},'raw':!![]})['then'](function(_0x4b3ebc){_0x186ec0=_0x4b3ebc;if(_0x186ec0&&_0x186ec0['type']){switch(_0x186ec0[_0x007a('0x1e')]){case _0x007a('0x1f'):var _0x2a4fef=require('twilio');if(_0x186ec0['accountSid']&&_0x186ec0[_0x007a('0x20')]&&_0x186ec0['phone']){var _0x355fa6=new _0x2a4fef(_0x186ec0['accountSid'],_0x186ec0[_0x007a('0x20')]);_0x355fa6['messages'][_0x007a('0x21')]({'body':_0x221903[_0x007a('0x10')],'to':_0x221903[_0x007a('0x22')],'from':_0x186ec0['phone'],'statusCallback':_0x186ec0[_0x007a('0x23')]+_0x007a('0x24')+_0x221903['id']+_0x007a('0x25')+_0x186ec0['token']})[_0x007a('0x19')](function(_0x3112b7){if(_0x3112b7[_0x007a('0x26')]){return _0x4ec5bb[_0x007a('0x1a')]({'messageId':_0x3112b7['sid']});}})[_0x007a('0x27')](function(_0x593fc1){logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x1f'),util[_0x007a('0x2b')](_0x593fc1,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')](_0x007a('0x29'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x007a('0x2c'):var _0x457fea=_0x007a('0x2d');if(_0x186ec0[_0x007a('0x2e')]&&_0x186ec0[_0x007a('0x2f')]){var _0x25a424={'recipient':[_0x221903[_0x007a('0x22')]],'message':_0x221903[_0x007a('0x10')],'message_type':_0x186ec0['smsMethod']};if(_0x186ec0['smsMethod']&&_0x186ec0[_0x007a('0x30')]!=='SI'){_0x25a424[_0x007a('0x31')]=_0x186ec0['phone'];}var _0x73baaf={'url':_0x457fea+'login?username='+_0x186ec0[_0x007a('0x2e')]+'&password='+_0x186ec0[_0x007a('0x2f')],'method':'GET'};rp(_0x73baaf)[_0x007a('0x19')](function(_0x5b9ed5){var _0x370949=_0x5b9ed5[_0x007a('0x32')](';');var _0x5508a1={'user_key':_0x370949[0x0],'session_key':_0x370949[0x1]};_0x73baaf={'url':_0x457fea+'sms','method':_0x007a('0x33'),'headers':{'user_key':_0x5508a1[_0x007a('0x34')],'Session_key':_0x5508a1[_0x007a('0x35')]},'json':!![],'body':_0x25a424};return rp(_0x73baaf);})[_0x007a('0x19')](function(_0x4b4592){if(_0x4b4592[_0x007a('0x36')]>=0x1){var _0x4ba370={'messageId':_0x4b4592['internal_order_id']};if(_0x186ec0[_0x007a('0x30')]!=='GP'||!_0x186ec0[_0x007a('0x37')]){_0x4ba370[_0x007a('0x38')]=!![];}return _0x4ec5bb[_0x007a('0x1a')](_0x4ba370);}else{return logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x2c'),util[_0x007a('0x2b')](_0x4b4592,{'showHidden':![],'depth':null}));}})[_0x007a('0x27')](function(_0x183fdd){return logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x2c'),util[_0x007a('0x2b')](_0x183fdd,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x186ec0[_0x007a('0x20')]){var _0x32137d={'recipient':_0x221903[_0x007a('0x22')],'message':_0x221903['body'],'sender':_0x186ec0[_0x007a('0x39')]||_0x186ec0[_0x007a('0x22')],'authorization':_0x186ec0[_0x007a('0x20')]};var _0x354928={'method':_0x007a('0x33'),'uri':_0x007a('0x3a'),'body':_0x32137d,'json':!![]};rp(_0x354928)[_0x007a('0x19')](function(_0xa25f13){var _0x3cc09c={'messageId':_0xa25f13[_0x007a('0x3b')]};if(!_0x186ec0[_0x007a('0x37')]){_0x3cc09c[_0x007a('0x38')]=!![];}return _0x4ec5bb['update'](_0x3cc09c);})[_0x007a('0x27')](function(_0x3fc6bf){logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x007a('0x2a'),_0x007a('0x3c'),util[_0x007a('0x2b')](_0x3fc6bf,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')](_0x007a('0x29'),'afterCreate',_0x007a('0x3c'),_0x007a('0x3d'));}break;case'clicksend':if(_0x186ec0[_0x007a('0x2e')]&&_0x186ec0[_0x007a('0x2f')]){var _0x32137d={'messages':[{'source':_0x007a('0x3e'),'to':_0x221903[_0x007a('0x22')],'body':_0x221903[_0x007a('0x10')],'from':_0x186ec0[_0x007a('0x39')]||_0x186ec0['phone']}]};var _0x8309b4=util[_0x007a('0x3f')](_0x007a('0x40'),_0x186ec0[_0x007a('0x2e')],_0x186ec0[_0x007a('0x2f')]);var _0x354928={'method':_0x007a('0x33'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x32137d,'headers':{'Authorization':util[_0x007a('0x3f')](_0x007a('0x41'),new Buffer(_0x8309b4)[_0x007a('0x42')](_0x007a('0x43')))},'json':!![]};rp(_0x354928)[_0x007a('0x19')](function(_0x18e9d0){if(_0x18e9d0[_0x007a('0x44')]>=0xc8&&_0x18e9d0[_0x007a('0x44')]<=0xce){if(_0x18e9d0['data']&&_0x18e9d0[_0x007a('0x45')][_0x007a('0x46')]>0x0){var _0x522203=_[_0x007a('0x47')](_0x18e9d0[_0x007a('0x45')][_0x007a('0x48')]);var _0x36a148={'messageId':_0x522203['message_id']};if(!_0x186ec0['deliveryReport']){_0x36a148[_0x007a('0x38')]=!![];}return _0x4ec5bb[_0x007a('0x1a')](_0x36a148);}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x49'),util[_0x007a('0x2b')](_0x18e9d0,{'showHidden':![],'depth':null}));}}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x49'),util[_0x007a('0x2b')](_0x18e9d0,{'showHidden':![],'depth':null}));}})[_0x007a('0x27')](function(_0x1c8f73){logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x49'),util[_0x007a('0x2b')](_0x1c8f73,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x007a('0x2a'),_0x007a('0x49'),_0x007a('0x4a'));}break;case _0x007a('0x4b'):if(_0x186ec0[_0x007a('0x4c')]&&_0x186ec0['authToken']){var _0x32137d={'dst':_0x221903[_0x007a('0x22')],'text':_0x221903[_0x007a('0x10')],'src':_0x186ec0[_0x007a('0x39')]||_0x186ec0[_0x007a('0x22')],'url':_0x186ec0[_0x007a('0x23')]+'/api/sms/messages/'+_0x221903['id']+_0x007a('0x25')+_0x186ec0[_0x007a('0x4d')]};var _0x8309b4=util[_0x007a('0x3f')](_0x007a('0x40'),_0x186ec0[_0x007a('0x4c')],_0x186ec0[_0x007a('0x20')]);var _0x354928={'method':_0x007a('0x33'),'uri':util[_0x007a('0x3f')](_0x007a('0x4e'),_0x186ec0[_0x007a('0x4c')]),'body':_0x32137d,'headers':{'Authorization':util[_0x007a('0x3f')](_0x007a('0x41'),new Buffer(_0x8309b4)[_0x007a('0x42')]('base64'))},'json':!![]};rp(_0x354928)[_0x007a('0x19')](function(_0x4cdc9c){var _0x504cf9={'messageId':_0x4cdc9c[_0x007a('0x4f')][0x0]};return _0x4ec5bb[_0x007a('0x1a')](_0x504cf9);})[_0x007a('0x27')](function(_0x2a67be){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x007a('0x2a'),_0x007a('0x4b'),util[_0x007a('0x2b')](_0x2a67be,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x007a('0x4b'),_0x007a('0x50'));}break;case _0x007a('0x51'):if(_0x186ec0[_0x007a('0x2e')]&&_0x186ec0[_0x007a('0x2f')]){if(_0x186ec0['baseUrl']){var _0x5a2c8a={'method':_0x007a('0x33'),'uri':_0x186ec0['baseUrl']+'/auth/1/session','body':{'username':_0x186ec0[_0x007a('0x2e')],'password':_0x186ec0[_0x007a('0x2f')]},'json':!![]};return rp(_0x5a2c8a)[_0x007a('0x19')](function(_0x663ed5){var _0x2bbf01={'method':'POST','uri':_0x186ec0['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x186ec0['phone'],'destinations':[{'to':_0x221903['phone']}],'text':_0x221903[_0x007a('0x10')],'notifyUrl':_0x186ec0[_0x007a('0x23')]+'/api/sms/messages/'+_0x221903['id']+_0x007a('0x25')+_0x186ec0[_0x007a('0x4d')],'notifyContentType':'application/json','callbackData':_0x186ec0[_0x007a('0x22')]+';'+_0x221903[_0x007a('0x10')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x663ed5[_0x007a('0x4d')]},'json':!![]};return rp(_0x2bbf01)[_0x007a('0x19')](function(_0x14203c){if(_0x14203c['messages']){var _0x36cf42={'messageId':_0x14203c[_0x007a('0x48')][0x0][_0x007a('0xe')]};if(!_0x186ec0[_0x007a('0x37')]){_0x36cf42[_0x007a('0x38')]=!![];}return _0x4ec5bb[_0x007a('0x1a')](_0x36cf42);}else{return logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x51'),util[_0x007a('0x2b')](_0x14203c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x801172){return logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x51'),util[_0x007a('0x2b')](_0x801172,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0x007a('0x52'));}}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x51'),_0x007a('0x4a'));}break;case _0x007a('0x53'):var _0x575cfe=require(_0x007a('0x54'));if(_0x186ec0[_0x007a('0x55')]){var _0x50d1ef={};_0x50d1ef['login']=_0x186ec0[_0x007a('0x2e')];_0x50d1ef[_0x007a('0x22')]=_0x221903[_0x007a('0x22')];_0x50d1ef[_0x007a('0x31')]=_0x186ec0[_0x007a('0x22')];_0x50d1ef[_0x007a('0x56')]=_0x221903[_0x007a('0x10')];_0x50d1ef[_0x007a('0x57')]=+new Date();var _0x24b474='';var _0x432917='';var _0x8f70dc=Object[_0x007a('0x58')](_0x50d1ef);_0x8f70dc[_0x007a('0x59')]();for(var _0x2481ab=0x0;_0x2481ab<_0x8f70dc[_0x007a('0x5a')];_0x2481ab++){if(_0x24b474!=''){_0x24b474+='&';}_0x24b474+=_0x8f70dc[_0x2481ab]+'='+encodeURIComponent(_0x50d1ef[_0x8f70dc[_0x2481ab]]);_0x432917+=_0x50d1ef[_0x8f70dc[_0x2481ab]];}_0x432917+=_0x186ec0['apiKey'];_0x432917=_0x575cfe['createHash'](_0x007a('0x5b'))[_0x007a('0x1a')](_0x432917)[_0x007a('0x5c')]('hex');if(_0x24b474!==''){_0x24b474+='&';}_0x24b474+=_0x007a('0x5d')+_0x432917;var _0x73baaf={'method':_0x007a('0x5e'),'uri':_0x186ec0[_0x007a('0x5f')]+'/external/get/send.php?'+_0x24b474,'json':!![]};return rp(_0x73baaf)['then'](function(_0x249bf3){var _0x2099ad=Object[_0x007a('0x58')](_0x249bf3);if(_0x249bf3[_0x2099ad[0x0]][_0x007a('0x28')]&&parseInt(_0x249bf3[_0x2099ad[0x0]]['error'])===0x0){var _0x3516e0={'messageId':_0x249bf3[_0x2099ad[0x0]][_0x007a('0x60')]};if(!_0x186ec0[_0x007a('0x37')]){_0x3516e0[_0x007a('0x38')]=!![];}return _0x4ec5bb[_0x007a('0x1a')](_0x3516e0);}else{return logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x53'),util[_0x007a('0x2b')](_0x249bf3['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c11eb){return logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x53'),util[_0x007a('0x2b')](_0x2c11eb,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x53'),_0x007a('0x61'));}break;case _0x007a('0x62'):if(_0x186ec0[_0x007a('0x55')]){var _0x5b8c0={'method':'POST','uri':_0x007a('0x63'),'headers':{'Authorization':_0x186ec0[_0x007a('0x55')]},'body':{'content':_0x221903[_0x007a('0x10')],'to':[_0x221903[_0x007a('0x22')]],'from':_0x186ec0[_0x007a('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0x007a('0x64')},'json':!![]};rp(_0x5b8c0)[_0x007a('0x19')](function(_0x2fd8c3){if(!_0x2fd8c3[_0x007a('0x28')]){var _0x3b8d4b={'messageId':_0x2fd8c3[_0x007a('0x48')][0x0][_0x007a('0x65')]};if(!_0x186ec0[_0x007a('0x37')]){_0x3b8d4b['read']=!![];}return _0x4ec5bb[_0x007a('0x1a')](_0x3b8d4b);}else{return logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x007a('0x62'),util[_0x007a('0x2b')](_0x2fd8c3[_0x007a('0x28')],{'showHidden':![],'depth':null}));}})[_0x007a('0x27')](function(_0x730efe){return logger[_0x007a('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x007a('0x62'),util[_0x007a('0x2b')](_0x730efe,{'showHidden':![],'depth':null}));});}else{logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x62'),_0x007a('0x61'));}break;case _0x007a('0x66'):if(_0x186ec0['username']&&_0x186ec0['password']){var _0x8309b4=util[_0x007a('0x3f')](_0x007a('0x40'),_0x186ec0[_0x007a('0x2e')],_0x186ec0['password']);var _0x354928={'method':_0x007a('0x33'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x186ec0['accountId']+_0x007a('0x67'),'body':{'to':[_0x221903[_0x007a('0x22')]],'text':_0x221903['body'],'from':_0x186ec0['phone'],'applicationId':_0x186ec0['applicationId']},'headers':{'Authorization':util[_0x007a('0x3f')](_0x007a('0x41'),new Buffer(_0x8309b4)[_0x007a('0x42')](_0x007a('0x43')))},'json':!![]};rp(_0x354928)['then'](function(_0x364351){if(_0x364351['id']){var _0x5af6b3={'messageId':_0x364351['id']};return _0x4ec5bb[_0x007a('0x1a')](_0x5af6b3);}else{logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x66'),util[_0x007a('0x2b')](_0x364351,{'showHidden':![],'depth':null}));}})[_0x007a('0x27')](function(_0x526a68){logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),'bandwidth',util[_0x007a('0x2b')](_0x526a68,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x007a('0x29'),_0x007a('0x2a'),'bandwidth',_0x007a('0x4a'));}break;case _0x007a('0x68'):if(_0x186ec0[_0x007a('0x55')]){var _0x47959c={};var _0x73baaf={'method':_0x007a('0x33'),'uri':_0x007a('0x69'),'headers':{'Authorization':_0x007a('0x6a')+_0x186ec0[_0x007a('0x55')],'Content-Type':_0x007a('0x6b')},'body':{'from':_0x186ec0[_0x007a('0x22')],'to':_0x221903[_0x007a('0x22')],'text':_0x221903[_0x007a('0x10')]},'json':!![]};return rp(_0x73baaf)['then'](function(_0x59fa91){if(_0x59fa91['code']==0xca){_0x47959c['message']=_0x59fa91;var _0x3bc1cb={'method':_0x007a('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x007a('0x6a')+_0x186ec0[_0x007a('0x55')],'Content-Type':_0x007a('0x6b')},'body':{'refid':_0x47959c['message'][_0x007a('0x6c')]},'json':!![]};return rp(_0x3bc1cb)['then'](function(_0x459918){_0x47959c['status']=_0x459918;var _0x4cfab8={'messageId':_0x47959c['message'][_0x007a('0x6c')],'read':!![]};return _0x4ec5bb[_0x007a('0x1a')](_0x4cfab8);});}else{return logger[_0x007a('0x28')](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x68'),util[_0x007a('0x2b')](_0x59fa91,{'showHidden':![],'depth':null}));}})[_0x007a('0x27')](function(_0x30b08a){return logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x68'),util[_0x007a('0x2b')](_0x30b08a,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x007a('0x29'),_0x007a('0x2a'),_0x007a('0x68'),_0x007a('0x6d'));}break;}}})[_0x007a('0x6e')](function(){_0x22316f();});}else{_0x22316f();}}},'charset':_0x007a('0x6f'),'collate':_0x007a('0x70')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f873e86..e77b931 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 _0xacc4=['defaults','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSmsMessage','create','body','options','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x39c6d9,_0x34c096){var _0x29c893=function(_0x1c6be4){while(--_0x1c6be4){_0x39c6d9['push'](_0x39c6d9['shift']());}};_0x29c893(++_0x34c096);}(_0xacc4,0xe5));var _0x4acc=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xacc4[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acc('0x0'));var BPromise=require(_0x4acc('0x1'));var rs=require(_0x4acc('0x2'));var fs=require('fs');var Redis=require(_0x4acc('0x3'));var db=require(_0x4acc('0x4'))['db'];var utils=require(_0x4acc('0x5'));var logger=require(_0x4acc('0x6'))('rpc');var config=require(_0x4acc('0x7'));var jayson=require(_0x4acc('0x8'));var client=jayson[_0x4acc('0x9')]['http']({'port':0x232a});config[_0x4acc('0xa')]=_[_0x4acc('0xb')](config[_0x4acc('0xa')],{'host':_0x4acc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4acc('0xa')]));require(_0x4acc('0xd'))[_0x4acc('0xe')](socket);function respondWithRpcPromise(_0x8b4c3c,_0x40065e,_0x2f13da){return new BPromise(function(_0x32c786,_0x149342){return client[_0x4acc('0xf')](_0x8b4c3c,_0x2f13da)['then'](function(_0x2c0218){logger[_0x4acc('0x10')](_0x4acc('0x11'),_0x40065e,_0x4acc('0x12'));logger[_0x4acc('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x40065e,_0x4acc('0x12'),JSON[_0x4acc('0x14')](_0x2c0218));if(_0x2c0218['error']){if(_0x2c0218[_0x4acc('0x15')][_0x4acc('0x16')]===0x1f4){logger[_0x4acc('0x15')](_0x4acc('0x11'),_0x40065e,_0x2c0218[_0x4acc('0x15')][_0x4acc('0x17')]);return _0x149342(_0x2c0218[_0x4acc('0x15')][_0x4acc('0x17')]);}logger[_0x4acc('0x15')](_0x4acc('0x11'),_0x40065e,_0x2c0218[_0x4acc('0x15')][_0x4acc('0x17')]);return _0x32c786(_0x2c0218[_0x4acc('0x15')][_0x4acc('0x17')]);}else{logger['info'](_0x4acc('0x11'),_0x40065e,_0x4acc('0x12'));_0x32c786(_0x2c0218[_0x4acc('0x18')][_0x4acc('0x17')]);}})['catch'](function(_0x354aed){logger[_0x4acc('0x15')]('SmsMessage,\x20%s,\x20%s',_0x40065e,_0x354aed);_0x149342(_0x354aed);});});}exports[_0x4acc('0x19')]=function(_0x5c746e){var _0x22fa03=this;return new Promise(function(_0x589744,_0x48f285){return db['SmsMessage'][_0x4acc('0x1a')](_0x5c746e[_0x4acc('0x1b')],{'raw':_0x5c746e[_0x4acc('0x1c')]?_0x5c746e['options']['raw']===undefined?!![]:![]:!![]})[_0x4acc('0x1d')](function(_0x156162){logger[_0x4acc('0x10')](_0x4acc('0x19'),_0x5c746e);logger['debug']('CreateSmsMessage',_0x5c746e,JSON[_0x4acc('0x14')](_0x156162));_0x589744(_0x156162);})['catch'](function(_0xcb6b0e){logger[_0x4acc('0x15')](_0x4acc('0x19'),_0xcb6b0e[_0x4acc('0x17')],_0x5c746e);_0x48f285(_0x22fa03[_0x4acc('0x15')](0x1f4,_0xcb6b0e[_0x4acc('0x17')]));});});}; \ No newline at end of file +var _0xd7c9=['SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd7c9,0xe4));var _0x9d7c=function(_0x3711e2,_0x1468e1){_0x3711e2=_0x3711e2-0x0;var _0x18a556=_0xd7c9[_0x3711e2];return _0x18a556;};'use strict';var _=require(_0x9d7c('0x0'));var util=require(_0x9d7c('0x1'));var moment=require(_0x9d7c('0x2'));var BPromise=require(_0x9d7c('0x3'));var rs=require(_0x9d7c('0x4'));var fs=require('fs');var Redis=require(_0x9d7c('0x5'));var db=require(_0x9d7c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d7c('0x7'))(_0x9d7c('0x8'));var config=require(_0x9d7c('0x9'));var jayson=require(_0x9d7c('0xa'));var client=jayson[_0x9d7c('0xb')][_0x9d7c('0xc')]({'port':0x232a});config['redis']=_[_0x9d7c('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9d7c('0xe'))(new Redis(config[_0x9d7c('0xf')]));require(_0x9d7c('0x10'))[_0x9d7c('0x11')](socket);function respondWithRpcPromise(_0x20e0ae,_0x43230d,_0xfb88c8){return new BPromise(function(_0x2165da,_0x5c16d9){return client[_0x9d7c('0x12')](_0x20e0ae,_0xfb88c8)[_0x9d7c('0x13')](function(_0x329f25){logger[_0x9d7c('0x14')](_0x9d7c('0x15'),_0x43230d,_0x9d7c('0x16'));logger['debug'](_0x9d7c('0x17'),_0x43230d,_0x9d7c('0x16'),JSON[_0x9d7c('0x18')](_0x329f25));if(_0x329f25['error']){if(_0x329f25[_0x9d7c('0x19')][_0x9d7c('0x1a')]===0x1f4){logger[_0x9d7c('0x19')](_0x9d7c('0x15'),_0x43230d,_0x329f25[_0x9d7c('0x19')]['message']);return _0x5c16d9(_0x329f25[_0x9d7c('0x19')][_0x9d7c('0x1b')]);}logger[_0x9d7c('0x19')](_0x9d7c('0x15'),_0x43230d,_0x329f25[_0x9d7c('0x19')][_0x9d7c('0x1b')]);return _0x2165da(_0x329f25['error'][_0x9d7c('0x1b')]);}else{logger[_0x9d7c('0x14')](_0x9d7c('0x15'),_0x43230d,'request\x20sent');_0x2165da(_0x329f25[_0x9d7c('0x1c')][_0x9d7c('0x1b')]);}})[_0x9d7c('0x1d')](function(_0x3c6790){logger[_0x9d7c('0x19')](_0x9d7c('0x15'),_0x43230d,_0x3c6790);_0x5c16d9(_0x3c6790);});});}exports[_0x9d7c('0x1e')]=function(_0x413370){var _0x43394b=this;return new Promise(function(_0x33e202,_0x147ad5){return db[_0x9d7c('0x1f')][_0x9d7c('0x20')](_0x413370[_0x9d7c('0x21')],{'raw':_0x413370['options']?_0x413370[_0x9d7c('0x22')][_0x9d7c('0x23')]===undefined?!![]:![]:!![]})[_0x9d7c('0x13')](function(_0x181864){logger['info'](_0x9d7c('0x1e'),_0x413370);logger[_0x9d7c('0x24')]('CreateSmsMessage',_0x413370,JSON[_0x9d7c('0x18')](_0x181864));_0x33e202(_0x181864);})[_0x9d7c('0x1d')](function(_0xa19875){logger[_0x9d7c('0x19')](_0x9d7c('0x1e'),_0xa19875[_0x9d7c('0x1b')],_0x413370);_0x147ad5(_0x43394b[_0x9d7c('0x19')](0x1f4,_0xa19875['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index ce38803..752dfa2 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 _0xc6f7=['./smsMessage.events','save','remove','smsMessage:'];(function(_0x2ffad8,_0x476c31){var _0x6ad33=function(_0x6105e0){while(--_0x6105e0){_0x2ffad8['push'](_0x2ffad8['shift']());}};_0x6ad33(++_0x476c31);}(_0xc6f7,0x114));var _0x7c6f=function(_0xf61c99,_0x1228cd){_0xf61c99=_0xf61c99-0x0;var _0x39e807=_0xc6f7[_0xf61c99];return _0x39e807;};'use strict';var SmsMessageEvents=require(_0x7c6f('0x0'));var events=[_0x7c6f('0x1'),_0x7c6f('0x2'),'update'];function createListener(_0x5ee854,_0x5f0e33){return function(_0x365338){_0x5f0e33['emit'](_0x5ee854,_0x365338);};}function removeListener(_0x3efd4a,_0x9d780b){return function(){SmsMessageEvents['removeListener'](_0x3efd4a,_0x9d780b);};}exports['register']=function(_0x4095d5){for(var _0x138ce5=0x0,_0x3cf2a9=events['length'];_0x138ce5<_0x3cf2a9;_0x138ce5++){var _0x70a378=events[_0x138ce5];var _0x29a5d8=createListener(_0x7c6f('0x3')+_0x70a378,_0x4095d5);SmsMessageEvents['on'](_0x70a378,_0x29a5d8);}}; \ No newline at end of file +var _0x9c0d=['./smsMessage.events','save','remove','update','removeListener','smsMessage:'];(function(_0x3fd28e,_0x4d5e83){var _0x4b62a2=function(_0x17a119){while(--_0x17a119){_0x3fd28e['push'](_0x3fd28e['shift']());}};_0x4b62a2(++_0x4d5e83);}(_0x9c0d,0x120));var _0xd9c0=function(_0x57f435,_0x4e8ada){_0x57f435=_0x57f435-0x0;var _0xcd8938=_0x9c0d[_0x57f435];return _0xcd8938;};'use strict';var SmsMessageEvents=require(_0xd9c0('0x0'));var events=[_0xd9c0('0x1'),_0xd9c0('0x2'),_0xd9c0('0x3')];function createListener(_0x3fc11d,_0x365374){return function(_0x570ab3){_0x365374['emit'](_0x3fc11d,_0x570ab3);};}function removeListener(_0x18cb40,_0x325392){return function(){SmsMessageEvents[_0xd9c0('0x4')](_0x18cb40,_0x325392);};}exports['register']=function(_0x264ee7){for(var _0x1a7f33=0x0,_0x4f7760=events['length'];_0x1a7f33<_0x4f7760;_0x1a7f33++){var _0x2f9045=events[_0x1a7f33];var _0x455435=createListener(_0xd9c0('0x5')+_0x2f9045,_0x264ee7);SmsMessageEvents['on'](_0x2f9045,_0x455435);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c2b9460..f6abe6f 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 _0x9282=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','show','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','/:id','update','delete','destroy','removeTeams'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9282,0xa2));var _0x2928=function(_0x4aa78a,_0x15c09c){_0x4aa78a=_0x4aa78a-0x0;var _0x444b3b=_0x9282[_0x4aa78a];return _0x444b3b;};'use strict';var multer=require('multer');var util=require(_0x2928('0x0'));var path=require('path');var timeout=require(_0x2928('0x1'));var express=require(_0x2928('0x2'));var router=express[_0x2928('0x3')]();var fs_extra=require(_0x2928('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2928('0x5'));var config=require(_0x2928('0x6'));var controller=require(_0x2928('0x7'));router['get']('/',auth[_0x2928('0x8')](),controller[_0x2928('0x9')]);router[_0x2928('0xa')](_0x2928('0xb'),auth[_0x2928('0x8')](),controller[_0x2928('0xc')]);router[_0x2928('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2928('0xd')]);router['get'](_0x2928('0xe'),auth[_0x2928('0x8')](),controller['getMembers']);router[_0x2928('0xa')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x2928('0xa')](_0x2928('0xf'),auth[_0x2928('0x8')](),controller[_0x2928('0x10')]);router[_0x2928('0x11')]('/',auth[_0x2928('0x8')](),controller[_0x2928('0x12')]);router['post'](_0x2928('0x13'),auth['isAuthenticated'](),controller[_0x2928('0x14')]);router[_0x2928('0x11')](_0x2928('0xf'),auth[_0x2928('0x8')](),controller[_0x2928('0x15')]);router['put'](_0x2928('0x16'),auth[_0x2928('0x8')](),controller[_0x2928('0x17')]);router[_0x2928('0x18')]('/:id',auth[_0x2928('0x8')](),controller[_0x2928('0x19')]);router['delete']('/:id/teams',auth[_0x2928('0x8')](),controller[_0x2928('0x1a')]);router['delete'](_0x2928('0xf'),auth[_0x2928('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf6c8=['../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x17a5e7,_0x54ad81){var _0x569528=function(_0x1307d6){while(--_0x1307d6){_0x17a5e7['push'](_0x17a5e7['shift']());}};_0x569528(++_0x54ad81);}(_0xf6c8,0x19e));var _0x8f6c=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xf6c8[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0x8f6c('0x0'));var util=require(_0x8f6c('0x1'));var path=require(_0x8f6c('0x2'));var timeout=require(_0x8f6c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8f6c('0x4'));var auth=require(_0x8f6c('0x5'));var interaction=require(_0x8f6c('0x6'));var config=require(_0x8f6c('0x7'));var controller=require(_0x8f6c('0x8'));router[_0x8f6c('0x9')]('/',auth[_0x8f6c('0xa')](),controller[_0x8f6c('0xb')]);router[_0x8f6c('0x9')](_0x8f6c('0xc'),auth[_0x8f6c('0xa')](),controller['describe']);router['get'](_0x8f6c('0xd'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0xe')]);router['get'](_0x8f6c('0xf'),auth[_0x8f6c('0xa')](),controller['getMembers']);router[_0x8f6c('0x9')](_0x8f6c('0x10'),auth[_0x8f6c('0xa')](),controller['getTeams']);router[_0x8f6c('0x9')](_0x8f6c('0x11'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0x12')]);router[_0x8f6c('0x13')]('/',auth['isAuthenticated'](),controller[_0x8f6c('0x14')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x8f6c('0x15')]);router['post'](_0x8f6c('0x11'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0x16')]);router['put'](_0x8f6c('0xd'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0x17')]);router[_0x8f6c('0x18')](_0x8f6c('0xd'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0x19')]);router[_0x8f6c('0x18')]('/:id/teams',auth[_0x8f6c('0xa')](),controller['removeTeams']);router[_0x8f6c('0x18')](_0x8f6c('0x11'),auth[_0x8f6c('0xa')](),controller[_0x8f6c('0x1a')]);module[_0x8f6c('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 dc0d12c..20deeb8 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 _0x5f80=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x520a18,_0x2e7d0a){var _0x5b0ba6=function(_0x9c9347){while(--_0x9c9347){_0x520a18['push'](_0x520a18['shift']());}};_0x5b0ba6(++_0x2e7d0a);}(_0x5f80,0x11d));var _0x05f8=function(_0x5e2fa5,_0x2e9a38){_0x5e2fa5=_0x5e2fa5-0x0;var _0xc04184=_0x5f80[_0x5e2fa5];return _0xc04184;};'use strict';var Sequelize=require(_0x05f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x05f8('0x1')],'unique':_0x05f8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x05f8('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x05f8('0x3')](_0x05f8('0x4'),_0x05f8('0x5'),_0x05f8('0x6'))}}; \ No newline at end of file +var _0x346a=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x2d224f,_0x4e8572){var _0x5a3ff0=function(_0x50c3ae){while(--_0x50c3ae){_0x2d224f['push'](_0x2d224f['shift']());}};_0x5a3ff0(++_0x4e8572);}(_0x346a,0xf1));var _0xa346=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x346a[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xa346('0x0'));module['exports']={'name':{'type':Sequelize[_0xa346('0x1')],'unique':_0xa346('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa346('0x1')]},'timeout':{'type':Sequelize[_0xa346('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa346('0x4')](_0xa346('0x5'),_0xa346('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d340ea0..a096310 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 _0x8ae2=['findOne','UserSmsQueue','rawAttributes','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','hasOwnProperty','addTeams','Team','Agents','online','voicePause','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','fieldName','key','query','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers'];(function(_0x6b022b,_0x30d607){var _0x146704=function(_0x18a8a6){while(--_0x18a8a6){_0x6b022b['push'](_0x6b022b['shift']());}};_0x146704(++_0x30d607);}(_0x8ae2,0x143));var _0x28ae=function(_0x4aa74f,_0x33bf7d){_0x4aa74f=_0x4aa74f-0x0;var _0x175f8b=_0x8ae2[_0x4aa74f];return _0x175f8b;};'use strict';var emlformat=require(_0x28ae('0x0'));var rimraf=require(_0x28ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28ae('0x2'));var rp=require('request-promise');var moment=require(_0x28ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28ae('0x4'));var util=require(_0x28ae('0x5'));var path=require(_0x28ae('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x28ae('0x7'));var fs=require('fs');var fs_extra=require(_0x28ae('0x8'));var _=require(_0x28ae('0x9'));var squel=require('squel');var crypto=require(_0x28ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x28ae('0xb'));var toCsv=require(_0x28ae('0xc'));var querystring=require(_0x28ae('0xd'));var Papa=require(_0x28ae('0xe'));var Redis=require(_0x28ae('0xf'));var authService=require(_0x28ae('0x10'));var qs=require(_0x28ae('0x11'));var as=require(_0x28ae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28ae('0x13'))(_0x28ae('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x28ae('0x15'))['db'];config[_0x28ae('0x16')]=_[_0x28ae('0x17')](config['redis'],{'host':_0x28ae('0x18'),'port':0x18eb});var socket=require(_0x28ae('0x19'))(new Redis(config['redis']));require(_0x28ae('0x1a'))[_0x28ae('0x1b')](socket);function respondWithStatusCode(_0x522c70,_0x2bfa29){_0x2bfa29=_0x2bfa29||0xcc;return function(_0x5141f5){if(_0x5141f5){return _0x522c70[_0x28ae('0x1c')](_0x2bfa29);}return _0x522c70[_0x28ae('0x1d')](_0x2bfa29)[_0x28ae('0x1e')]();};}function respondWithResult(_0x295f36,_0x56620c){_0x56620c=_0x56620c||0xc8;return function(_0x6ebb5b){if(_0x6ebb5b){return _0x295f36['status'](_0x56620c)[_0x28ae('0x1f')](_0x6ebb5b);}};}function respondWithFilteredResult(_0x4db342,_0x3d12ec){return function(_0x1f0dd3){if(_0x1f0dd3){var _0x1baa41=typeof _0x3d12ec[_0x28ae('0x20')]===_0x28ae('0x21')&&typeof _0x3d12ec[_0x28ae('0x22')]===_0x28ae('0x21');var _0xf11022=_0x1f0dd3[_0x28ae('0x23')];var _0x180c9f=_0x1baa41?0x0:_0x3d12ec['offset'];var _0x530293=_0x1baa41?_0x1f0dd3[_0x28ae('0x23')]:_0x3d12ec[_0x28ae('0x20')]+_0x3d12ec[_0x28ae('0x22')];var _0x489122;if(_0x530293>=_0xf11022){_0x530293=_0xf11022;_0x489122=0xc8;}else{_0x489122=0xce;}_0x4db342[_0x28ae('0x1d')](_0x489122);return _0x4db342[_0x28ae('0x24')](_0x28ae('0x25'),_0x180c9f+'-'+_0x530293+'/'+_0xf11022)['json'](_0x1f0dd3);}return null;};}function patchUpdates(_0x431f63){return function(_0x67d1fd){try{jsonpatch[_0x28ae('0x26')](_0x67d1fd,_0x431f63,!![]);}catch(_0x59a3b0){return BPromise['reject'](_0x59a3b0);}return _0x67d1fd[_0x28ae('0x27')]();};}function saveUpdates(_0x496785,_0x4d2f86){return function(_0x1fc0e0){if(_0x1fc0e0){return _0x1fc0e0['update'](_0x496785)[_0x28ae('0x28')](function(_0x5a775d){return _0x5a775d;});}return null;};}function removeEntity(_0x349ec7,_0x59ec00){return function(_0x1c5222){if(_0x1c5222){return _0x1c5222[_0x28ae('0x29')]()['then'](function(){var _0x365d6b=_0x1c5222[_0x28ae('0x2a')]({'plain':!![]});var _0x665814=_0x28ae('0x2b');return db[_0x28ae('0x2c')]['destroy']({'where':{'type':_0x665814,'resourceId':_0x365d6b['id']}})['then'](function(){return _0x1c5222;});})['then'](function(){_0x349ec7[_0x28ae('0x1d')](0xcc)[_0x28ae('0x1e')]();});}};}function handleEntityNotFound(_0x5708d6,_0x3fc31b){return function(_0x306626){if(!_0x306626){_0x5708d6[_0x28ae('0x1c')](0x194);}return _0x306626;};}function handleError(_0x3904d4,_0x2ef411){_0x2ef411=_0x2ef411||0x1f4;return function(_0x276945){logger[_0x28ae('0x2d')](_0x276945[_0x28ae('0x2e')]);if(_0x276945[_0x28ae('0x2f')]){delete _0x276945[_0x28ae('0x2f')];}_0x3904d4['status'](_0x2ef411)[_0x28ae('0x30')](_0x276945);};}exports[_0x28ae('0x31')]=function(_0x35cf3b,_0xe670fe){var _0x2814f0={},_0x54c7f0={},_0x523b76={'count':0x0,'rows':[]};var _0x2b9707=_[_0x28ae('0x32')](db[_0x28ae('0x33')]['rawAttributes'],function(_0x3e69cf){return{'name':_0x3e69cf[_0x28ae('0x34')],'type':_0x3e69cf['type'][_0x28ae('0x35')]};});_0x54c7f0['model']=_[_0x28ae('0x32')](_0x2b9707,'name');_0x54c7f0[_0x28ae('0x36')]=_['keys'](_0x35cf3b[_0x28ae('0x36')]);_0x54c7f0['filters']=_[_0x28ae('0x37')](_0x54c7f0[_0x28ae('0x38')],_0x54c7f0[_0x28ae('0x36')]);_0x2814f0['attributes']=_['intersection'](_0x54c7f0[_0x28ae('0x38')],qs['fields'](_0x35cf3b['query'][_0x28ae('0x39')]));_0x2814f0[_0x28ae('0x3a')]=_0x2814f0[_0x28ae('0x3a')]['length']?_0x2814f0[_0x28ae('0x3a')]:_0x54c7f0['model'];if(!_0x35cf3b[_0x28ae('0x36')]['hasOwnProperty'](_0x28ae('0x3b'))){_0x2814f0[_0x28ae('0x22')]=qs[_0x28ae('0x22')](_0x35cf3b['query'][_0x28ae('0x22')]);_0x2814f0['offset']=qs['offset'](_0x35cf3b[_0x28ae('0x36')][_0x28ae('0x20')]);}_0x2814f0[_0x28ae('0x3c')]=qs[_0x28ae('0x3d')](_0x35cf3b[_0x28ae('0x36')]['sort']);_0x2814f0[_0x28ae('0x3e')]=qs['filters'](_[_0x28ae('0x3f')](_0x35cf3b[_0x28ae('0x36')],_0x54c7f0[_0x28ae('0x40')]),_0x2b9707);if(_0x35cf3b[_0x28ae('0x36')][_0x28ae('0x41')]){_0x2814f0[_0x28ae('0x3e')]=_[_0x28ae('0x42')](_0x2814f0[_0x28ae('0x3e')],{'$or':_[_0x28ae('0x32')](_0x2b9707,function(_0x1b7c4a){if(_0x1b7c4a['type']!==_0x28ae('0x43')){var _0x11717b={};_0x11717b[_0x1b7c4a[_0x28ae('0x2f')]]={'$like':'%'+_0x35cf3b[_0x28ae('0x36')][_0x28ae('0x41')]+'%'};return _0x11717b;}})});}_0x2814f0=_[_0x28ae('0x42')]({},_0x2814f0,_0x35cf3b[_0x28ae('0x44')]);var _0x5d8f1e={'where':_0x2814f0[_0x28ae('0x3e')]};return db[_0x28ae('0x33')][_0x28ae('0x23')](_0x5d8f1e)[_0x28ae('0x28')](function(_0xef781d){_0x523b76[_0x28ae('0x23')]=_0xef781d;if(_0x35cf3b[_0x28ae('0x36')][_0x28ae('0x45')]){_0x2814f0[_0x28ae('0x46')]=[{'all':!![]}];}return db[_0x28ae('0x33')][_0x28ae('0x47')](_0x2814f0);})[_0x28ae('0x28')](function(_0x233a6c){_0x523b76[_0x28ae('0x48')]=_0x233a6c;return _0x523b76;})[_0x28ae('0x28')](respondWithFilteredResult(_0xe670fe,_0x2814f0))[_0x28ae('0x49')](handleError(_0xe670fe,null));};exports['show']=function(_0x224ac2,_0x52d344){var _0x394ffd={'raw':!![],'where':{'id':_0x224ac2['params']['id']}},_0x141184={};_0x141184[_0x28ae('0x38')]=_['keys'](db[_0x28ae('0x33')]['rawAttributes']);_0x141184[_0x28ae('0x36')]=_[_0x28ae('0x4a')](_0x224ac2[_0x28ae('0x36')]);_0x141184[_0x28ae('0x40')]=_['intersection'](_0x141184[_0x28ae('0x38')],_0x141184['query']);_0x394ffd['attributes']=_['intersection'](_0x141184[_0x28ae('0x38')],qs['fields'](_0x224ac2['query'][_0x28ae('0x39')]));_0x394ffd[_0x28ae('0x3a')]=_0x394ffd[_0x28ae('0x3a')][_0x28ae('0x4b')]?_0x394ffd[_0x28ae('0x3a')]:_0x141184[_0x28ae('0x38')];if(_0x224ac2['query'][_0x28ae('0x45')]){_0x394ffd[_0x28ae('0x46')]=[{'all':!![]}];}_0x394ffd=_[_0x28ae('0x42')]({},_0x394ffd,_0x224ac2[_0x28ae('0x44')]);return db[_0x28ae('0x33')][_0x28ae('0x4c')](_0x394ffd)['then'](handleEntityNotFound(_0x52d344,null))['then'](respondWithResult(_0x52d344,null))['catch'](handleError(_0x52d344,null));};exports[_0x28ae('0x4d')]=function(_0x5c2aa9,_0x54e423){return db['SmsQueue'][_0x28ae('0x4d')](_0x5c2aa9[_0x28ae('0x4e')],{})['then'](function(_0x1633e0){var _0x53fbae=_0x5c2aa9[_0x28ae('0x4f')][_0x28ae('0x2a')]({'plain':!![]});if(!_0x53fbae)throw new Error(_0x28ae('0x50'));if(_0x53fbae[_0x28ae('0x51')]===_0x28ae('0x4f')){var _0xa5b0d5=_0x1633e0['get']({'plain':!![]});var _0x4f066='SmsQueues';return db[_0x28ae('0x52')][_0x28ae('0x4c')]({'where':{'name':_0x4f066,'userProfileId':_0x53fbae['userProfileId']},'raw':!![]})[_0x28ae('0x28')](function(_0x4d46fa){if(_0x4d46fa&&_0x4d46fa[_0x28ae('0x53')]===0x0){return db[_0x28ae('0x2c')][_0x28ae('0x4d')]({'name':_0xa5b0d5['name'],'resourceId':_0xa5b0d5['id'],'type':_0x4d46fa[_0x28ae('0x2f')],'sectionId':_0x4d46fa['id']},{})[_0x28ae('0x28')](function(){return _0x1633e0;});}else{return _0x1633e0;}})[_0x28ae('0x49')](function(_0x2fbcd4){logger['error'](_0x28ae('0x54'),_0x2fbcd4);throw _0x2fbcd4;});}return _0x1633e0;})[_0x28ae('0x28')](respondWithResult(_0x54e423,0xc9))[_0x28ae('0x49')](handleError(_0x54e423,null));};exports['update']=function(_0xdc8b34,_0x47dd0e){if(_0xdc8b34[_0x28ae('0x4e')]['id']){delete _0xdc8b34[_0x28ae('0x4e')]['id'];}return db['SmsQueue'][_0x28ae('0x4c')]({'where':{'id':_0xdc8b34[_0x28ae('0x55')]['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x47dd0e,null))['then'](saveUpdates(_0xdc8b34[_0x28ae('0x4e')],null))[_0x28ae('0x28')](respondWithResult(_0x47dd0e,null))[_0x28ae('0x49')](handleError(_0x47dd0e,null));};exports['destroy']=function(_0x5117f2,_0x40c3a8){return db[_0x28ae('0x33')][_0x28ae('0x4c')]({'where':{'id':_0x5117f2['params']['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x40c3a8,null))[_0x28ae('0x28')](removeEntity(_0x40c3a8,null))['catch'](handleError(_0x40c3a8,null));};exports[_0x28ae('0x56')]=function(_0x2171bb,_0x1483ca){return db['SmsQueue']['describe']()[_0x28ae('0x28')](respondWithResult(_0x1483ca,null))[_0x28ae('0x49')](handleError(_0x1483ca,null));};exports[_0x28ae('0x57')]=function(_0x3bc1f3,_0x36ef4d,_0x4bbfaa){var _0x2d5c51={'raw':!![],'where':{}},_0x2d607a={},_0x1dcfb2;return db['SmsQueue'][_0x28ae('0x58')]({'where':{'id':_0x3bc1f3['params']['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x36ef4d,null))[_0x28ae('0x28')](function(_0x5105a0){if(_0x5105a0){_0x1dcfb2=_0x5105a0[_0x28ae('0x2a')]({'plain':!![]});_0x2d607a[_0x28ae('0x38')]=_[_0x28ae('0x4a')](db[_0x28ae('0x59')][_0x28ae('0x5a')]);_0x2d607a['query']=_[_0x28ae('0x4a')](_0x3bc1f3['query']);_0x2d607a[_0x28ae('0x40')]=_[_0x28ae('0x37')](_0x2d607a[_0x28ae('0x38')],_0x2d607a['query']);_0x2d5c51['attributes']=_['intersection'](_0x2d607a[_0x28ae('0x38')],qs[_0x28ae('0x39')](_0x3bc1f3['query'][_0x28ae('0x39')]));_0x2d5c51[_0x28ae('0x3a')]=_0x2d5c51[_0x28ae('0x3a')][_0x28ae('0x4b')]?_0x2d5c51[_0x28ae('0x3a')]:_0x2d607a[_0x28ae('0x38')];if(!_0x3bc1f3[_0x28ae('0x36')]['hasOwnProperty']('nolimit')){_0x2d5c51[_0x28ae('0x22')]=qs[_0x28ae('0x22')](_0x3bc1f3[_0x28ae('0x36')]['limit']);_0x2d5c51['offset']=qs[_0x28ae('0x20')](_0x3bc1f3[_0x28ae('0x36')]['offset']);}_0x2d5c51[_0x28ae('0x3c')]=qs['sort'](_0x3bc1f3[_0x28ae('0x36')][_0x28ae('0x3d')]);_0x2d5c51[_0x28ae('0x3e')]=qs[_0x28ae('0x40')](_[_0x28ae('0x3f')](_0x3bc1f3['query'],_0x2d607a[_0x28ae('0x40')]));_0x2d5c51['where']['SmsQueueId']=_0x5105a0['id'];if(_0x3bc1f3[_0x28ae('0x36')][_0x28ae('0x41')]){_0x2d5c51['where']=_[_0x28ae('0x42')](_0x2d5c51[_0x28ae('0x3e')],{'$or':_[_0x28ae('0x32')](_0x2d5c51[_0x28ae('0x3a')],function(_0x2e93fd){var _0x41de1f={};_0x41de1f[_0x2e93fd]={'$like':'%'+_0x3bc1f3[_0x28ae('0x36')][_0x28ae('0x41')]+'%'};return _0x41de1f;})});}_0x2d5c51=_[_0x28ae('0x42')]({},_0x2d5c51,_0x3bc1f3[_0x28ae('0x44')]);return db[_0x28ae('0x59')][_0x28ae('0x47')](_0x2d5c51);}})[_0x28ae('0x28')](function(_0x5d2f85){if(_0x5d2f85){return db[_0x28ae('0x5b')][_0x28ae('0x5c')]({'where':{'id':_[_0x28ae('0x32')](_0x5d2f85,'UserId'),'role':_0x28ae('0x5d')},'attributes':['id',_0x28ae('0x2f'),_0x28ae('0x5e'),_0x28ae('0x5f'),_0x28ae('0x60')]});}})[_0x28ae('0x28')](function(_0x6ca8d9){if(_0x6ca8d9){return{'count':_0x6ca8d9[_0x28ae('0x23')],'rows':_[_0x28ae('0x32')](_0x6ca8d9[_0x28ae('0x48')],function(_0x22ab98){return{'membername':_0x22ab98['name'],'UserId':_0x22ab98['id'],'queue_name':_0x1dcfb2[_0x28ae('0x2f')],'SmsQueueId':_0x1dcfb2['id'],'interface':util[_0x28ae('0x61')](_0x28ae('0x62'),'SIP',_0x22ab98[_0x28ae('0x2f')]),'penalty':0x0,'paused':_0x22ab98[_0x28ae('0x5e')],'createdAt':_0x22ab98[_0x28ae('0x60')],'updatedAt':_0x22ab98['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x28ae('0x28')](respondWithFilteredResult(_0x36ef4d,_0x2d5c51))[_0x28ae('0x49')](handleError(_0x36ef4d,null));};exports[_0x28ae('0x63')]=function(_0x3ce562,_0x56e142,_0x2eec6d){var _0x2c7669={};var _0x2c164c={};var _0x394eec;var _0x323d40;return db[_0x28ae('0x33')][_0x28ae('0x58')]({'where':{'id':_0x3ce562['params']['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x56e142,null))[_0x28ae('0x28')](function(_0x2bf1ec){if(_0x2bf1ec){_0x394eec=_0x2bf1ec;_0x2c164c[_0x28ae('0x38')]=_[_0x28ae('0x4a')](db['Team'][_0x28ae('0x5a')]);_0x2c164c[_0x28ae('0x36')]=_['keys'](_0x3ce562[_0x28ae('0x36')]);_0x2c164c['filters']=_[_0x28ae('0x37')](_0x2c164c[_0x28ae('0x38')],_0x2c164c[_0x28ae('0x36')]);_0x2c7669[_0x28ae('0x3a')]=_['intersection'](_0x2c164c[_0x28ae('0x38')],qs[_0x28ae('0x39')](_0x3ce562[_0x28ae('0x36')]['fields']));_0x2c7669['attributes']=_0x2c7669[_0x28ae('0x3a')]['length']?_0x2c7669[_0x28ae('0x3a')]:_0x2c164c[_0x28ae('0x38')];_0x2c7669[_0x28ae('0x3c')]=qs['sort'](_0x3ce562['query']['sort']);_0x2c7669[_0x28ae('0x3e')]=qs[_0x28ae('0x40')](_[_0x28ae('0x3f')](_0x3ce562['query'],_0x2c164c[_0x28ae('0x40')]));if(_0x3ce562['query'][_0x28ae('0x41')]){_0x2c7669['where']=_[_0x28ae('0x42')](_0x2c7669['where'],{'$or':_['map'](_0x2c7669['attributes'],function(_0x3fee4e){var _0x2235fb={};_0x2235fb[_0x3fee4e]={'$like':'%'+_0x3ce562[_0x28ae('0x36')][_0x28ae('0x41')]+'%'};return _0x2235fb;})});}_0x2c7669=_[_0x28ae('0x42')]({},_0x2c7669,_0x3ce562[_0x28ae('0x44')]);return _0x394eec['getTeams'](_0x2c7669);}})['then'](function(_0x2c9a9b){if(_0x2c9a9b){_0x323d40=_0x2c9a9b['length'];if(!_0x3ce562[_0x28ae('0x36')][_0x28ae('0x64')](_0x28ae('0x3b'))){_0x2c7669[_0x28ae('0x22')]=qs[_0x28ae('0x22')](_0x3ce562[_0x28ae('0x36')]['limit']);_0x2c7669[_0x28ae('0x20')]=qs[_0x28ae('0x20')](_0x3ce562[_0x28ae('0x36')]['offset']);}return _0x394eec['getTeams'](_0x2c7669);}})[_0x28ae('0x28')](function(_0x13096b){if(_0x13096b){return _0x13096b?{'count':_0x323d40,'rows':_0x13096b}:null;}})[_0x28ae('0x28')](respondWithResult(_0x56e142,null))[_0x28ae('0x49')](handleError(_0x56e142,null));};exports[_0x28ae('0x65')]=function(_0x4af1aa,_0x3ee52d,_0x2f43bf){var _0x375b55=_0x4af1aa[_0x28ae('0x4e')]['ids'];return db[_0x28ae('0x66')][_0x28ae('0x47')]({'where':{'id':_0x375b55},'attributes':['id'],'include':[{'model':db[_0x28ae('0x5b')],'as':_0x28ae('0x67'),'attributes':['id',_0x28ae('0x2f'),_0x28ae('0x68'),_0x28ae('0x69'),'interface'],'raw':!![]}]})['then'](function(_0x10469e){if(_0x10469e){var _0x4f543a=_[_0x28ae('0x6a')](_0x10469e,function(_0x137b00){var _0x1b3af5=_0x137b00[_0x28ae('0x2a')]({'plain':!![]});return _0x1b3af5[_0x28ae('0x67')];});return db['SmsQueue'][_0x28ae('0x4c')]({'where':{'id':_0x4af1aa[_0x28ae('0x55')]['id']}})[_0x28ae('0x28')](function(_0x10f8bf){return db[_0x28ae('0x6b')]['transaction'](function(_0x4b85ca){return _0x10f8bf[_0x28ae('0x65')](_0x375b55,{'transaction':_0x4b85ca})[_0x28ae('0x28')](function(){return BPromise['each'](_0x4f543a,function(_0x39417c){return db['UserSmsQueue'][_0x28ae('0x6c')]({'where':{'UserId':_0x39417c['id'],'SmsQueueId':_0x4af1aa[_0x28ae('0x55')]['id']},'transaction':_0x4b85ca});});})[_0x28ae('0x28')](function(){_0x4f543a[_0x28ae('0x6d')](function(_0x366041){socket[_0x28ae('0x6e')]('userSmsQueue:save',{'UserId':_0x366041['id'],'SmsQueueId':_0x10f8bf['id']});});});});});}})[_0x28ae('0x28')](respondWithStatusCode(_0x3ee52d,null))[_0x28ae('0x49')](handleError(_0x3ee52d,null));};exports[_0x28ae('0x6f')]=function(_0x403acc,_0x48788f,_0x1d2b62){return db[_0x28ae('0x66')][_0x28ae('0x47')]({'where':{'id':_0x403acc[_0x28ae('0x36')][_0x28ae('0x70')]},'attributes':['id'],'include':[{'model':db[_0x28ae('0x5b')],'as':_0x28ae('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48788f,null))['then'](function(_0x2b124e){var _0x415c79=_[_0x28ae('0x32')](_0x2b124e,'id');var _0x50bb11=[];var _0x37e884=[];var _0x39012d=squel[_0x28ae('0x71')]();_0x39012d[_0x28ae('0x72')](_0x28ae('0x73'))[_0x28ae('0x74')](_0x28ae('0x75'),'tq')[_0x28ae('0x76')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x28ae('0x77'),_0x403acc[_0x28ae('0x55')]['id']);for(var _0x149f3f=0x0;_0x149f3f<_0x2b124e[_0x28ae('0x4b')];_0x149f3f+=0x1){let _0x28efd0=_0x2b124e[_0x149f3f];for(var _0x3874c9=0x0;_0x3874c9<_0x28efd0['Agents'][_0x28ae('0x4b')];_0x3874c9+=0x1){let _0x3f29ad=_0x28efd0[_0x28ae('0x67')][_0x3874c9];var _0xe40a37=_0x39012d['clone']();_0xe40a37['where'](_0x28ae('0x78'),_0x3f29ad['id']);_0x37e884[_0x28ae('0x79')](db['sequelize']['query'](_0xe40a37[_0x28ae('0x7a')](),{'type':db[_0x28ae('0x6b')][_0x28ae('0x7b')]['SELECT']})[_0x28ae('0x28')](function(_0x4a71b3){if(_0x4a71b3['length']===0x1){return _0x3f29ad['id'];}else{var _0x54438e=_['every'](_[_0x28ae('0x32')](_0x4a71b3,_0x28ae('0x7c')),function(_0x4a6c09){return _[_0x28ae('0x7d')](_0x415c79,_0x4a6c09);});if(_0x54438e){return _0x3f29ad['id'];}}}));}}return BPromise['all'](_0x37e884)['then'](function(_0x2a806e){_0x50bb11=_(_0x50bb11)[_0x28ae('0x7e')](_0x2a806e)[_0x28ae('0x7f')]()['value']();return db[_0x28ae('0x33')][_0x28ae('0x4c')]({'where':{'id':_0x403acc[_0x28ae('0x55')]['id']}})[_0x28ae('0x28')](function(_0x3bc4df){return db['sequelize'][_0x28ae('0x80')](function(_0x1ece8d){return _0x3bc4df['removeTeams'](_0x403acc['query']['ids'],{'transaction':_0x1ece8d})[_0x28ae('0x28')](function(){if(!_[_0x28ae('0x81')](_0x50bb11)){return _0x3bc4df[_0x28ae('0x82')](_0x50bb11,{'transaction':_0x1ece8d});}})['then'](function(){_0x50bb11['forEach'](function(_0x1d294d){socket[_0x28ae('0x6e')](_0x28ae('0x83'),{'UserId':_0x1d294d,'SmsQueueId':_0x3bc4df['id']});});});});});});})[_0x28ae('0x28')](respondWithStatusCode(_0x48788f,null))[_0x28ae('0x49')](handleError(_0x48788f,null));};exports[_0x28ae('0x84')]=function(_0x8f2331,_0x2de20f,_0x52fbf3){return db[_0x28ae('0x33')][_0x28ae('0x4c')]({'where':{'id':_0x8f2331[_0x28ae('0x55')]['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x2de20f,null))['then'](function(_0x255808){if(_0x255808){return _0x255808['addAgents'](_0x8f2331['body'][_0x28ae('0x70')],_[_0x28ae('0x85')](_0x8f2331['body'],[_0x28ae('0x70'),'id'])||{})[_0x28ae('0x86')](function(_0x87aa18){for(var _0x27e5be=0x0;_0x27e5be<_0x8f2331[_0x28ae('0x4e')][_0x28ae('0x70')][_0x28ae('0x4b')];_0x27e5be+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x8f2331[_0x28ae('0x4e')][_0x28ae('0x70')][_0x27e5be]),'SmsQueueId':Number(_0x8f2331['params']['id'])});}return _0x87aa18;});}})[_0x28ae('0x28')](respondWithResult(_0x2de20f,null))['catch'](handleError(_0x2de20f,null));};exports[_0x28ae('0x82')]=function(_0x2ed048,_0x2abb3c,_0x146826){return db['SmsQueue']['find']({'where':{'id':_0x2ed048['params']['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x2abb3c,null))[_0x28ae('0x28')](function(_0x353554){if(_0x353554){return _0x353554[_0x28ae('0x82')](_0x2ed048[_0x28ae('0x36')][_0x28ae('0x70')])[_0x28ae('0x28')](function(){if(_[_0x28ae('0x87')](_0x2ed048[_0x28ae('0x36')][_0x28ae('0x70')])){for(var _0x512c4d=0x0;_0x512c4d<_0x2ed048['query']['ids'][_0x28ae('0x4b')];_0x512c4d+=0x1){socket['emit'](_0x28ae('0x83'),{'UserId':Number(_0x2ed048['query'][_0x28ae('0x70')][_0x512c4d]),'SmsQueueId':Number(_0x2ed048[_0x28ae('0x55')]['id'])});}}else{socket[_0x28ae('0x6e')](_0x28ae('0x83'),{'UserId':Number(_0x2ed048[_0x28ae('0x36')]['ids']),'SmsQueueId':Number(_0x2ed048['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2abb3c,null))[_0x28ae('0x49')](handleError(_0x2abb3c,null));};exports[_0x28ae('0x88')]=function(_0x92df64,_0x2b84c3,_0x12407f){var _0x23e424={};var _0x2aed18={};var _0x456ea6;var _0x1cc565;return db[_0x28ae('0x33')][_0x28ae('0x58')]({'where':{'id':_0x92df64[_0x28ae('0x55')]['id']}})[_0x28ae('0x28')](handleEntityNotFound(_0x2b84c3,null))[_0x28ae('0x28')](function(_0x10f30d){if(_0x10f30d){_0x456ea6=_0x10f30d;_0x2aed18['model']=_[_0x28ae('0x4a')](db['User'][_0x28ae('0x5a')]);_0x2aed18[_0x28ae('0x36')]=_[_0x28ae('0x4a')](_0x92df64['query']);_0x2aed18[_0x28ae('0x40')]=_[_0x28ae('0x37')](_0x2aed18[_0x28ae('0x38')],_0x2aed18[_0x28ae('0x36')]);_0x23e424[_0x28ae('0x3a')]=_[_0x28ae('0x37')](_0x2aed18[_0x28ae('0x38')],qs[_0x28ae('0x39')](_0x92df64[_0x28ae('0x36')][_0x28ae('0x39')]));_0x23e424[_0x28ae('0x3a')]=_0x23e424[_0x28ae('0x3a')]['length']?_0x23e424['attributes']:_0x2aed18[_0x28ae('0x38')];_0x23e424['order']=qs[_0x28ae('0x3d')](_0x92df64[_0x28ae('0x36')][_0x28ae('0x3d')]);_0x23e424[_0x28ae('0x3e')]=qs[_0x28ae('0x40')](_[_0x28ae('0x3f')](_0x92df64['query'],_0x2aed18[_0x28ae('0x40')]));if(_0x92df64['query'][_0x28ae('0x41')]){_0x23e424['where']=_['merge'](_0x23e424['where'],{'$or':_[_0x28ae('0x32')](_0x23e424[_0x28ae('0x3a')],function(_0x3ce535){var _0x1c260d={};_0x1c260d[_0x3ce535]={'$like':'%'+_0x92df64['query'][_0x28ae('0x41')]+'%'};return _0x1c260d;})});}_0x23e424=_['merge']({},_0x23e424,_0x92df64[_0x28ae('0x44')]);return _0x456ea6[_0x28ae('0x88')](_0x23e424);}})[_0x28ae('0x28')](function(_0x470670){if(_0x470670){_0x1cc565=_0x470670[_0x28ae('0x4b')];if(!_0x92df64[_0x28ae('0x36')][_0x28ae('0x64')](_0x28ae('0x3b'))){_0x23e424['limit']=qs[_0x28ae('0x22')](_0x92df64['query'][_0x28ae('0x22')]);_0x23e424[_0x28ae('0x20')]=qs[_0x28ae('0x20')](_0x92df64['query'][_0x28ae('0x20')]);}return _0x456ea6[_0x28ae('0x88')](_0x23e424);}})[_0x28ae('0x28')](function(_0x409c51){if(_0x409c51){return _0x409c51?{'count':_0x1cc565,'rows':_0x409c51}:null;}})['then'](respondWithResult(_0x2b84c3,null))[_0x28ae('0x49')](handleError(_0x2b84c3,null));}; \ No newline at end of file +var _0x8970=['Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','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','defaults','redis','localhost','register','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueue','includeAll','findAll','rows','catch','show','fields','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','body','params','describe','getMembers','UserSmsQueue','SmsQueueId','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8970,0xb3));var _0x0897=function(_0x29975e,_0x36e935){_0x29975e=_0x29975e-0x0;var _0x1d78f4=_0x8970[_0x29975e];return _0x1d78f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0897('0x0'));var zipdir=require(_0x0897('0x1'));var jsonpatch=require(_0x0897('0x2'));var rp=require(_0x0897('0x3'));var moment=require(_0x0897('0x4'));var BPromise=require(_0x0897('0x5'));var Mustache=require(_0x0897('0x6'));var util=require('util');var path=require(_0x0897('0x7'));var sox=require(_0x0897('0x8'));var csv=require('to-csv');var ejs=require(_0x0897('0x9'));var fs=require('fs');var fs_extra=require(_0x0897('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0897('0xb'));var deskjs=require(_0x0897('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0897('0xd'));var Redis=require(_0x0897('0xe'));var authService=require(_0x0897('0xf'));var qs=require(_0x0897('0x10'));var as=require(_0x0897('0x11'));var hardwareService=require(_0x0897('0x12'));var logger=require(_0x0897('0x13'))(_0x0897('0x14'));var utils=require(_0x0897('0x15'));var config=require(_0x0897('0x16'));var licenseUtil=require(_0x0897('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0897('0x18')](config[_0x0897('0x19')],{'host':_0x0897('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0897('0x19')]));require('./smsQueue.socket')[_0x0897('0x1b')](socket);function respondWithStatusCode(_0x5b2f9c,_0x2cb030){_0x2cb030=_0x2cb030||0xcc;return function(_0x3c52db){if(_0x3c52db){return _0x5b2f9c['sendStatus'](_0x2cb030);}return _0x5b2f9c[_0x0897('0x1c')](_0x2cb030)['end']();};}function respondWithResult(_0x2200a4,_0x1f52c9){_0x1f52c9=_0x1f52c9||0xc8;return function(_0x1f8fad){if(_0x1f8fad){return _0x2200a4[_0x0897('0x1c')](_0x1f52c9)[_0x0897('0x1d')](_0x1f8fad);}};}function respondWithFilteredResult(_0x412c1b,_0x531652){return function(_0x247c1d){if(_0x247c1d){var _0x240570=typeof _0x531652[_0x0897('0x1e')]===_0x0897('0x1f')&&typeof _0x531652['limit']===_0x0897('0x1f');var _0xd45251=_0x247c1d['count'];var _0x1c096a=_0x240570?0x0:_0x531652[_0x0897('0x1e')];var _0x581c53=_0x240570?_0x247c1d[_0x0897('0x20')]:_0x531652[_0x0897('0x1e')]+_0x531652[_0x0897('0x21')];var _0x439e04;if(_0x581c53>=_0xd45251){_0x581c53=_0xd45251;_0x439e04=0xc8;}else{_0x439e04=0xce;}_0x412c1b['status'](_0x439e04);return _0x412c1b['set'](_0x0897('0x22'),_0x1c096a+'-'+_0x581c53+'/'+_0xd45251)[_0x0897('0x1d')](_0x247c1d);}return null;};}function patchUpdates(_0x5583b9){return function(_0x49b21a){try{jsonpatch['apply'](_0x49b21a,_0x5583b9,!![]);}catch(_0x5d3f7a){return BPromise[_0x0897('0x23')](_0x5d3f7a);}return _0x49b21a[_0x0897('0x24')]();};}function saveUpdates(_0x2424f9,_0x23b337){return function(_0xc03093){if(_0xc03093){return _0xc03093[_0x0897('0x25')](_0x2424f9)[_0x0897('0x26')](function(_0x133f11){return _0x133f11;});}return null;};}function removeEntity(_0x3ec210,_0x39363d){return function(_0x1ddc51){if(_0x1ddc51){return _0x1ddc51[_0x0897('0x27')]()[_0x0897('0x26')](function(){var _0xf4ecad=_0x1ddc51[_0x0897('0x28')]({'plain':!![]});var _0x39f083=_0x0897('0x29');return db[_0x0897('0x2a')][_0x0897('0x27')]({'where':{'type':_0x39f083,'resourceId':_0xf4ecad['id']}})[_0x0897('0x26')](function(){return _0x1ddc51;});})[_0x0897('0x26')](function(){_0x3ec210[_0x0897('0x1c')](0xcc)[_0x0897('0x2b')]();});}};}function handleEntityNotFound(_0x269576,_0x149d28){return function(_0x4c7677){if(!_0x4c7677){_0x269576[_0x0897('0x2c')](0x194);}return _0x4c7677;};}function handleError(_0x197479,_0x589279){_0x589279=_0x589279||0x1f4;return function(_0x5f1b1f){logger[_0x0897('0x2d')](_0x5f1b1f[_0x0897('0x2e')]);if(_0x5f1b1f[_0x0897('0x2f')]){delete _0x5f1b1f[_0x0897('0x2f')];}_0x197479['status'](_0x589279)[_0x0897('0x30')](_0x5f1b1f);};}exports[_0x0897('0x31')]=function(_0x351c1e,_0x1c836c){var _0x36a7d5={},_0x388abb={},_0x50851b={'count':0x0,'rows':[]};var _0x39ba86=_[_0x0897('0x32')](db['SmsQueue'][_0x0897('0x33')],function(_0x40ebc8){return{'name':_0x40ebc8[_0x0897('0x34')],'type':_0x40ebc8[_0x0897('0x35')][_0x0897('0x36')]};});_0x388abb[_0x0897('0x37')]=_[_0x0897('0x32')](_0x39ba86,_0x0897('0x2f'));_0x388abb[_0x0897('0x38')]=_[_0x0897('0x39')](_0x351c1e[_0x0897('0x38')]);_0x388abb[_0x0897('0x3a')]=_['intersection'](_0x388abb[_0x0897('0x37')],_0x388abb[_0x0897('0x38')]);_0x36a7d5[_0x0897('0x3b')]=_[_0x0897('0x3c')](_0x388abb[_0x0897('0x37')],qs['fields'](_0x351c1e[_0x0897('0x38')]['fields']));_0x36a7d5[_0x0897('0x3b')]=_0x36a7d5['attributes'][_0x0897('0x3d')]?_0x36a7d5[_0x0897('0x3b')]:_0x388abb[_0x0897('0x37')];if(!_0x351c1e[_0x0897('0x38')]['hasOwnProperty'](_0x0897('0x3e'))){_0x36a7d5['limit']=qs[_0x0897('0x21')](_0x351c1e['query'][_0x0897('0x21')]);_0x36a7d5[_0x0897('0x1e')]=qs[_0x0897('0x1e')](_0x351c1e[_0x0897('0x38')][_0x0897('0x1e')]);}_0x36a7d5[_0x0897('0x3f')]=qs[_0x0897('0x40')](_0x351c1e[_0x0897('0x38')][_0x0897('0x40')]);_0x36a7d5[_0x0897('0x41')]=qs[_0x0897('0x3a')](_[_0x0897('0x42')](_0x351c1e['query'],_0x388abb['filters']),_0x39ba86);if(_0x351c1e[_0x0897('0x38')][_0x0897('0x43')]){_0x36a7d5['where']=_[_0x0897('0x44')](_0x36a7d5[_0x0897('0x41')],{'$or':_[_0x0897('0x32')](_0x39ba86,function(_0x233026){if(_0x233026[_0x0897('0x35')]!==_0x0897('0x45')){var _0x5ea504={};_0x5ea504[_0x233026[_0x0897('0x2f')]]={'$like':'%'+_0x351c1e[_0x0897('0x38')][_0x0897('0x43')]+'%'};return _0x5ea504;}})});}_0x36a7d5=_[_0x0897('0x44')]({},_0x36a7d5,_0x351c1e[_0x0897('0x46')]);var _0x1d770a={'where':_0x36a7d5['where']};return db[_0x0897('0x47')][_0x0897('0x20')](_0x1d770a)[_0x0897('0x26')](function(_0x51b232){_0x50851b[_0x0897('0x20')]=_0x51b232;if(_0x351c1e['query'][_0x0897('0x48')]){_0x36a7d5['include']=[{'all':!![]}];}return db['SmsQueue'][_0x0897('0x49')](_0x36a7d5);})[_0x0897('0x26')](function(_0x5cbd4d){_0x50851b[_0x0897('0x4a')]=_0x5cbd4d;return _0x50851b;})[_0x0897('0x26')](respondWithFilteredResult(_0x1c836c,_0x36a7d5))[_0x0897('0x4b')](handleError(_0x1c836c,null));};exports[_0x0897('0x4c')]=function(_0x6d89ed,_0x49030f){var _0x1d8d3e={'raw':!![],'where':{'id':_0x6d89ed['params']['id']}},_0x524923={};_0x524923[_0x0897('0x37')]=_[_0x0897('0x39')](db[_0x0897('0x47')]['rawAttributes']);_0x524923[_0x0897('0x38')]=_[_0x0897('0x39')](_0x6d89ed[_0x0897('0x38')]);_0x524923['filters']=_[_0x0897('0x3c')](_0x524923[_0x0897('0x37')],_0x524923[_0x0897('0x38')]);_0x1d8d3e['attributes']=_[_0x0897('0x3c')](_0x524923[_0x0897('0x37')],qs['fields'](_0x6d89ed['query'][_0x0897('0x4d')]));_0x1d8d3e['attributes']=_0x1d8d3e[_0x0897('0x3b')][_0x0897('0x3d')]?_0x1d8d3e[_0x0897('0x3b')]:_0x524923[_0x0897('0x37')];if(_0x6d89ed[_0x0897('0x38')][_0x0897('0x48')]){_0x1d8d3e[_0x0897('0x4e')]=[{'all':!![]}];}_0x1d8d3e=_[_0x0897('0x44')]({},_0x1d8d3e,_0x6d89ed[_0x0897('0x46')]);return db[_0x0897('0x47')][_0x0897('0x4f')](_0x1d8d3e)[_0x0897('0x26')](handleEntityNotFound(_0x49030f,null))[_0x0897('0x26')](respondWithResult(_0x49030f,null))[_0x0897('0x4b')](handleError(_0x49030f,null));};exports[_0x0897('0x50')]=function(_0x53a3b6,_0x558ced){return db[_0x0897('0x47')][_0x0897('0x50')](_0x53a3b6['body'],{})['then'](function(_0x26f268){var _0x303d13=_0x53a3b6['user'][_0x0897('0x28')]({'plain':!![]});if(!_0x303d13)throw new Error(_0x0897('0x51'));if(_0x303d13[_0x0897('0x52')]===_0x0897('0x53')){var _0x274f50=_0x26f268[_0x0897('0x28')]({'plain':!![]});var _0x54d170=_0x0897('0x29');return db['UserProfileSection'][_0x0897('0x4f')]({'where':{'name':_0x54d170,'userProfileId':_0x303d13['userProfileId']},'raw':!![]})[_0x0897('0x26')](function(_0x1f41b6){if(_0x1f41b6&&_0x1f41b6[_0x0897('0x54')]===0x0){return db[_0x0897('0x2a')][_0x0897('0x50')]({'name':_0x274f50[_0x0897('0x2f')],'resourceId':_0x274f50['id'],'type':_0x1f41b6[_0x0897('0x2f')],'sectionId':_0x1f41b6['id']},{})[_0x0897('0x26')](function(){return _0x26f268;});}else{return _0x26f268;}})['catch'](function(_0x11275e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11275e);throw _0x11275e;});}return _0x26f268;})[_0x0897('0x26')](respondWithResult(_0x558ced,0xc9))['catch'](handleError(_0x558ced,null));};exports[_0x0897('0x25')]=function(_0x1cc12f,_0x4e64af){if(_0x1cc12f[_0x0897('0x55')]['id']){delete _0x1cc12f[_0x0897('0x55')]['id'];}return db['SmsQueue'][_0x0897('0x4f')]({'where':{'id':_0x1cc12f['params']['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x4e64af,null))['then'](saveUpdates(_0x1cc12f[_0x0897('0x55')],null))[_0x0897('0x26')](respondWithResult(_0x4e64af,null))[_0x0897('0x4b')](handleError(_0x4e64af,null));};exports[_0x0897('0x27')]=function(_0x836271,_0x48bb28){return db[_0x0897('0x47')][_0x0897('0x4f')]({'where':{'id':_0x836271[_0x0897('0x56')]['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x48bb28,null))[_0x0897('0x26')](removeEntity(_0x48bb28,null))[_0x0897('0x4b')](handleError(_0x48bb28,null));};exports[_0x0897('0x57')]=function(_0x3b70b8,_0x2e41dc){return db['SmsQueue'][_0x0897('0x57')]()[_0x0897('0x26')](respondWithResult(_0x2e41dc,null))[_0x0897('0x4b')](handleError(_0x2e41dc,null));};exports[_0x0897('0x58')]=function(_0x62ad90,_0x39c6af,_0x51d489){var _0x56569c={'raw':!![],'where':{}},_0x39cbb3={},_0x290d33;return db[_0x0897('0x47')]['findOne']({'where':{'id':_0x62ad90[_0x0897('0x56')]['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x39c6af,null))[_0x0897('0x26')](function(_0x4ada48){if(_0x4ada48){_0x290d33=_0x4ada48[_0x0897('0x28')]({'plain':!![]});_0x39cbb3[_0x0897('0x37')]=_['keys'](db[_0x0897('0x59')][_0x0897('0x33')]);_0x39cbb3[_0x0897('0x38')]=_[_0x0897('0x39')](_0x62ad90[_0x0897('0x38')]);_0x39cbb3[_0x0897('0x3a')]=_['intersection'](_0x39cbb3['model'],_0x39cbb3[_0x0897('0x38')]);_0x56569c[_0x0897('0x3b')]=_['intersection'](_0x39cbb3[_0x0897('0x37')],qs[_0x0897('0x4d')](_0x62ad90[_0x0897('0x38')][_0x0897('0x4d')]));_0x56569c[_0x0897('0x3b')]=_0x56569c['attributes'][_0x0897('0x3d')]?_0x56569c[_0x0897('0x3b')]:_0x39cbb3[_0x0897('0x37')];if(!_0x62ad90[_0x0897('0x38')]['hasOwnProperty']('nolimit')){_0x56569c[_0x0897('0x21')]=qs[_0x0897('0x21')](_0x62ad90[_0x0897('0x38')]['limit']);_0x56569c[_0x0897('0x1e')]=qs[_0x0897('0x1e')](_0x62ad90[_0x0897('0x38')][_0x0897('0x1e')]);}_0x56569c[_0x0897('0x3f')]=qs[_0x0897('0x40')](_0x62ad90[_0x0897('0x38')][_0x0897('0x40')]);_0x56569c[_0x0897('0x41')]=qs[_0x0897('0x3a')](_['pick'](_0x62ad90['query'],_0x39cbb3[_0x0897('0x3a')]));_0x56569c[_0x0897('0x41')][_0x0897('0x5a')]=_0x4ada48['id'];if(_0x62ad90['query'][_0x0897('0x43')]){_0x56569c[_0x0897('0x41')]=_[_0x0897('0x44')](_0x56569c[_0x0897('0x41')],{'$or':_[_0x0897('0x32')](_0x56569c[_0x0897('0x3b')],function(_0x1b2378){var _0x3d4396={};_0x3d4396[_0x1b2378]={'$like':'%'+_0x62ad90[_0x0897('0x38')]['filter']+'%'};return _0x3d4396;})});}_0x56569c=_['merge']({},_0x56569c,_0x62ad90[_0x0897('0x46')]);return db[_0x0897('0x59')]['findAll'](_0x56569c);}})['then'](function(_0x1ffa9f){if(_0x1ffa9f){return db[_0x0897('0x5b')]['findAndCountAll']({'where':{'id':_[_0x0897('0x32')](_0x1ffa9f,_0x0897('0x5c')),'role':_0x0897('0x5d')},'attributes':['id',_0x0897('0x2f'),_0x0897('0x5e'),_0x0897('0x5f'),_0x0897('0x60')]});}})[_0x0897('0x26')](function(_0x235d35){if(_0x235d35){return{'count':_0x235d35[_0x0897('0x20')],'rows':_['map'](_0x235d35['rows'],function(_0x1c3cba){return{'membername':_0x1c3cba[_0x0897('0x2f')],'UserId':_0x1c3cba['id'],'queue_name':_0x290d33[_0x0897('0x2f')],'SmsQueueId':_0x290d33['id'],'interface':util[_0x0897('0x61')](_0x0897('0x62'),_0x0897('0x63'),_0x1c3cba[_0x0897('0x2f')]),'penalty':0x0,'paused':_0x1c3cba[_0x0897('0x5e')],'createdAt':_0x1c3cba['createdAt'],'updatedAt':_0x1c3cba[_0x0897('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0897('0x26')](respondWithFilteredResult(_0x39c6af,_0x56569c))[_0x0897('0x4b')](handleError(_0x39c6af,null));};exports[_0x0897('0x64')]=function(_0x3b9388,_0x108536,_0x7d052b){var _0x4f4449={};var _0x28cc9d={};var _0x4cf68b;var _0x58f7e4;return db[_0x0897('0x47')]['findOne']({'where':{'id':_0x3b9388['params']['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x108536,null))[_0x0897('0x26')](function(_0x2a64c3){if(_0x2a64c3){_0x4cf68b=_0x2a64c3;_0x28cc9d['model']=_[_0x0897('0x39')](db[_0x0897('0x65')][_0x0897('0x33')]);_0x28cc9d[_0x0897('0x38')]=_[_0x0897('0x39')](_0x3b9388[_0x0897('0x38')]);_0x28cc9d['filters']=_[_0x0897('0x3c')](_0x28cc9d[_0x0897('0x37')],_0x28cc9d[_0x0897('0x38')]);_0x4f4449[_0x0897('0x3b')]=_[_0x0897('0x3c')](_0x28cc9d[_0x0897('0x37')],qs[_0x0897('0x4d')](_0x3b9388['query'][_0x0897('0x4d')]));_0x4f4449[_0x0897('0x3b')]=_0x4f4449[_0x0897('0x3b')][_0x0897('0x3d')]?_0x4f4449[_0x0897('0x3b')]:_0x28cc9d[_0x0897('0x37')];_0x4f4449[_0x0897('0x3f')]=qs['sort'](_0x3b9388[_0x0897('0x38')][_0x0897('0x40')]);_0x4f4449[_0x0897('0x41')]=qs[_0x0897('0x3a')](_[_0x0897('0x42')](_0x3b9388[_0x0897('0x38')],_0x28cc9d[_0x0897('0x3a')]));if(_0x3b9388[_0x0897('0x38')][_0x0897('0x43')]){_0x4f4449[_0x0897('0x41')]=_[_0x0897('0x44')](_0x4f4449[_0x0897('0x41')],{'$or':_['map'](_0x4f4449[_0x0897('0x3b')],function(_0x1f3e18){var _0x1f631f={};_0x1f631f[_0x1f3e18]={'$like':'%'+_0x3b9388[_0x0897('0x38')][_0x0897('0x43')]+'%'};return _0x1f631f;})});}_0x4f4449=_[_0x0897('0x44')]({},_0x4f4449,_0x3b9388[_0x0897('0x46')]);return _0x4cf68b[_0x0897('0x64')](_0x4f4449);}})[_0x0897('0x26')](function(_0x3eeee9){if(_0x3eeee9){_0x58f7e4=_0x3eeee9[_0x0897('0x3d')];if(!_0x3b9388[_0x0897('0x38')][_0x0897('0x66')](_0x0897('0x3e'))){_0x4f4449['limit']=qs['limit'](_0x3b9388[_0x0897('0x38')][_0x0897('0x21')]);_0x4f4449[_0x0897('0x1e')]=qs[_0x0897('0x1e')](_0x3b9388[_0x0897('0x38')][_0x0897('0x1e')]);}return _0x4cf68b[_0x0897('0x64')](_0x4f4449);}})[_0x0897('0x26')](function(_0x315a0f){if(_0x315a0f){return _0x315a0f?{'count':_0x58f7e4,'rows':_0x315a0f}:null;}})[_0x0897('0x26')](respondWithResult(_0x108536,null))[_0x0897('0x4b')](handleError(_0x108536,null));};exports[_0x0897('0x67')]=function(_0x12b759,_0x4beb48,_0x1982f6){var _0x723120=_0x12b759[_0x0897('0x55')][_0x0897('0x68')];return db[_0x0897('0x65')][_0x0897('0x49')]({'where':{'id':_0x723120},'attributes':['id'],'include':[{'model':db[_0x0897('0x5b')],'as':_0x0897('0x69'),'attributes':['id',_0x0897('0x2f'),'online',_0x0897('0x6a'),'interface'],'raw':!![]}]})[_0x0897('0x26')](function(_0x34c224){if(_0x34c224){var _0x4430b=_[_0x0897('0x6b')](_0x34c224,function(_0x49f324){var _0x1d7b09=_0x49f324[_0x0897('0x28')]({'plain':!![]});return _0x1d7b09[_0x0897('0x69')];});return db[_0x0897('0x47')][_0x0897('0x4f')]({'where':{'id':_0x12b759[_0x0897('0x56')]['id']}})[_0x0897('0x26')](function(_0x2ef479){return db[_0x0897('0x6c')][_0x0897('0x6d')](function(_0x58c6d0){return _0x2ef479[_0x0897('0x67')](_0x723120,{'transaction':_0x58c6d0})[_0x0897('0x26')](function(){return BPromise[_0x0897('0x6e')](_0x4430b,function(_0x4a6834){return db[_0x0897('0x59')][_0x0897('0x6f')]({'where':{'UserId':_0x4a6834['id'],'SmsQueueId':_0x12b759['params']['id']},'transaction':_0x58c6d0});});})[_0x0897('0x26')](function(){_0x4430b[_0x0897('0x70')](function(_0x19a942){socket[_0x0897('0x71')]('userSmsQueue:save',{'UserId':_0x19a942['id'],'SmsQueueId':_0x2ef479['id']});});});});});}})[_0x0897('0x26')](respondWithStatusCode(_0x4beb48,null))[_0x0897('0x4b')](handleError(_0x4beb48,null));};exports[_0x0897('0x72')]=function(_0x3631e2,_0x40af32,_0x5ca017){return db[_0x0897('0x65')][_0x0897('0x49')]({'where':{'id':_0x3631e2[_0x0897('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0897('0x5b')],'as':_0x0897('0x69'),'attributes':['id'],'raw':!![]}]})[_0x0897('0x26')](handleEntityNotFound(_0x40af32,null))[_0x0897('0x26')](function(_0x193016){var _0x1c25cb=_['map'](_0x193016,'id');var _0x552b04=[];var _0x588d1a=[];var _0x33d32f=squel[_0x0897('0x73')]();_0x33d32f[_0x0897('0x74')](_0x0897('0x75'))[_0x0897('0x76')](_0x0897('0x77'),'tq')['join']('user_has_teams','ut',_0x0897('0x78'))['where'](_0x0897('0x79'),_0x3631e2[_0x0897('0x56')]['id']);for(var _0x204d1f=0x0;_0x204d1f<_0x193016['length'];_0x204d1f+=0x1){let _0x51be83=_0x193016[_0x204d1f];for(var _0x5a2609=0x0;_0x5a2609<_0x51be83[_0x0897('0x69')][_0x0897('0x3d')];_0x5a2609+=0x1){let _0x59df43=_0x51be83[_0x0897('0x69')][_0x5a2609];var _0x129444=_0x33d32f[_0x0897('0x7a')]();_0x129444['where'](_0x0897('0x7b'),_0x59df43['id']);_0x588d1a[_0x0897('0x7c')](db['sequelize'][_0x0897('0x38')](_0x129444[_0x0897('0x7d')](),{'type':db[_0x0897('0x6c')]['QueryTypes'][_0x0897('0x7e')]})[_0x0897('0x26')](function(_0x1d310c){if(_0x1d310c['length']===0x1){return _0x59df43['id'];}else{var _0x1f857c=_[_0x0897('0x7f')](_[_0x0897('0x32')](_0x1d310c,_0x0897('0x80')),function(_0x206736){return _['includes'](_0x1c25cb,_0x206736);});if(_0x1f857c){return _0x59df43['id'];}}}));}}return BPromise[_0x0897('0x81')](_0x588d1a)[_0x0897('0x26')](function(_0x363338){_0x552b04=_(_0x552b04)['union'](_0x363338)[_0x0897('0x82')]()[_0x0897('0x83')]();return db[_0x0897('0x47')][_0x0897('0x4f')]({'where':{'id':_0x3631e2[_0x0897('0x56')]['id']}})[_0x0897('0x26')](function(_0x3a4548){return db['sequelize']['transaction'](function(_0x44184e){return _0x3a4548[_0x0897('0x72')](_0x3631e2[_0x0897('0x38')][_0x0897('0x68')],{'transaction':_0x44184e})[_0x0897('0x26')](function(){if(!_[_0x0897('0x84')](_0x552b04)){return _0x3a4548[_0x0897('0x85')](_0x552b04,{'transaction':_0x44184e});}})[_0x0897('0x26')](function(){_0x552b04[_0x0897('0x70')](function(_0x1bfb88){socket[_0x0897('0x71')](_0x0897('0x86'),{'UserId':_0x1bfb88,'SmsQueueId':_0x3a4548['id']});});});});});});})[_0x0897('0x26')](respondWithStatusCode(_0x40af32,null))[_0x0897('0x4b')](handleError(_0x40af32,null));};exports[_0x0897('0x87')]=function(_0x1d9afe,_0x369a71,_0x318e00){return db[_0x0897('0x47')][_0x0897('0x4f')]({'where':{'id':_0x1d9afe['params']['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x369a71,null))['then'](function(_0x523367){if(_0x523367){return _0x523367[_0x0897('0x87')](_0x1d9afe[_0x0897('0x55')][_0x0897('0x68')],_[_0x0897('0x88')](_0x1d9afe[_0x0897('0x55')],[_0x0897('0x68'),'id'])||{})[_0x0897('0x89')](function(_0x52943e){for(var _0x2cef04=0x0;_0x2cef04<_0x1d9afe[_0x0897('0x55')]['ids'][_0x0897('0x3d')];_0x2cef04+=0x1){socket[_0x0897('0x71')](_0x0897('0x8a'),{'UserId':Number(_0x1d9afe['body'][_0x0897('0x68')][_0x2cef04]),'SmsQueueId':Number(_0x1d9afe[_0x0897('0x56')]['id'])});}return _0x52943e;});}})['then'](respondWithResult(_0x369a71,null))[_0x0897('0x4b')](handleError(_0x369a71,null));};exports['removeAgents']=function(_0x552ee1,_0x45e313,_0x149610){return db['SmsQueue'][_0x0897('0x4f')]({'where':{'id':_0x552ee1[_0x0897('0x56')]['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x45e313,null))[_0x0897('0x26')](function(_0x2c71b5){if(_0x2c71b5){return _0x2c71b5[_0x0897('0x85')](_0x552ee1['query'][_0x0897('0x68')])['then'](function(){if(_[_0x0897('0x8b')](_0x552ee1[_0x0897('0x38')]['ids'])){for(var _0x270434=0x0;_0x270434<_0x552ee1[_0x0897('0x38')][_0x0897('0x68')][_0x0897('0x3d')];_0x270434+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x552ee1['query'][_0x0897('0x68')][_0x270434]),'SmsQueueId':Number(_0x552ee1[_0x0897('0x56')]['id'])});}}else{socket[_0x0897('0x71')](_0x0897('0x86'),{'UserId':Number(_0x552ee1[_0x0897('0x38')][_0x0897('0x68')]),'SmsQueueId':Number(_0x552ee1[_0x0897('0x56')]['id'])});}});}})[_0x0897('0x26')](respondWithStatusCode(_0x45e313,null))[_0x0897('0x4b')](handleError(_0x45e313,null));};exports[_0x0897('0x8c')]=function(_0x3ff8b3,_0x3398fa,_0x59a2a4){var _0x105ae6={};var _0x1a43dd={};var _0x5c17aa;var _0x2f47b5;return db['SmsQueue'][_0x0897('0x8d')]({'where':{'id':_0x3ff8b3['params']['id']}})[_0x0897('0x26')](handleEntityNotFound(_0x3398fa,null))[_0x0897('0x26')](function(_0x1ee0df){if(_0x1ee0df){_0x5c17aa=_0x1ee0df;_0x1a43dd[_0x0897('0x37')]=_[_0x0897('0x39')](db[_0x0897('0x5b')][_0x0897('0x33')]);_0x1a43dd[_0x0897('0x38')]=_[_0x0897('0x39')](_0x3ff8b3[_0x0897('0x38')]);_0x1a43dd[_0x0897('0x3a')]=_[_0x0897('0x3c')](_0x1a43dd[_0x0897('0x37')],_0x1a43dd[_0x0897('0x38')]);_0x105ae6[_0x0897('0x3b')]=_['intersection'](_0x1a43dd[_0x0897('0x37')],qs[_0x0897('0x4d')](_0x3ff8b3[_0x0897('0x38')][_0x0897('0x4d')]));_0x105ae6[_0x0897('0x3b')]=_0x105ae6[_0x0897('0x3b')][_0x0897('0x3d')]?_0x105ae6['attributes']:_0x1a43dd['model'];_0x105ae6['order']=qs[_0x0897('0x40')](_0x3ff8b3[_0x0897('0x38')][_0x0897('0x40')]);_0x105ae6[_0x0897('0x41')]=qs[_0x0897('0x3a')](_[_0x0897('0x42')](_0x3ff8b3[_0x0897('0x38')],_0x1a43dd[_0x0897('0x3a')]));if(_0x3ff8b3[_0x0897('0x38')][_0x0897('0x43')]){_0x105ae6[_0x0897('0x41')]=_[_0x0897('0x44')](_0x105ae6[_0x0897('0x41')],{'$or':_['map'](_0x105ae6[_0x0897('0x3b')],function(_0xd8d631){var _0x198bb2={};_0x198bb2[_0xd8d631]={'$like':'%'+_0x3ff8b3['query'][_0x0897('0x43')]+'%'};return _0x198bb2;})});}_0x105ae6=_['merge']({},_0x105ae6,_0x3ff8b3[_0x0897('0x46')]);return _0x5c17aa[_0x0897('0x8c')](_0x105ae6);}})[_0x0897('0x26')](function(_0x167f3c){if(_0x167f3c){_0x2f47b5=_0x167f3c[_0x0897('0x3d')];if(!_0x3ff8b3[_0x0897('0x38')][_0x0897('0x66')](_0x0897('0x3e'))){_0x105ae6[_0x0897('0x21')]=qs[_0x0897('0x21')](_0x3ff8b3['query'][_0x0897('0x21')]);_0x105ae6[_0x0897('0x1e')]=qs[_0x0897('0x1e')](_0x3ff8b3[_0x0897('0x38')][_0x0897('0x1e')]);}return _0x5c17aa[_0x0897('0x8c')](_0x105ae6);}})[_0x0897('0x26')](function(_0x11907d){if(_0x11907d){return _0x11907d?{'count':_0x2f47b5,'rows':_0x11907d}:null;}})['then'](respondWithResult(_0x3398fa,null))[_0x0897('0x4b')](handleError(_0x3398fa,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c0ad89a..e0a0db6 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 _0x07d1=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x28094e,_0x177dea){var _0x391994=function(_0x5a9b1a){while(--_0x5a9b1a){_0x28094e['push'](_0x28094e['shift']());}};_0x391994(++_0x177dea);}(_0x07d1,0x154));var _0x107d=function(_0x147331,_0x3c2a32){_0x147331=_0x147331-0x0;var _0x5524fb=_0x07d1[_0x147331];return _0x5524fb;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x107d('0x0'))['db'][_0x107d('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x107d('0x2')](0x0);var events={'afterCreate':_0x107d('0x3'),'afterUpdate':_0x107d('0x4'),'afterDestroy':_0x107d('0x5')};function emitEvent(_0x5ca3bf){return function(_0x51a071,_0x23c561,_0x59259a){SmsQueueEvents['emit'](_0x5ca3bf+':'+_0x51a071['id'],_0x51a071);SmsQueueEvents[_0x107d('0x6')](_0x5ca3bf,_0x51a071);_0x59259a(null);};}for(var e in events){if(events[_0x107d('0x7')](e)){var event=events[e];SmsQueue[_0x107d('0x8')](e,emitEvent(event));}}module[_0x107d('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xb291=['setMaxListeners','save','remove','emit','hook','events','../../mysqldb'];(function(_0x41d6b5,_0x2bfd77){var _0x2d131f=function(_0x38cae8){while(--_0x38cae8){_0x41d6b5['push'](_0x41d6b5['shift']());}};_0x2d131f(++_0x2bfd77);}(_0xb291,0xde));var _0x1b29=function(_0x1b7bbf,_0x3db8bc){_0x1b7bbf=_0x1b7bbf-0x0;var _0x5243a1=_0xb291[_0x1b7bbf];return _0x5243a1;};'use strict';var EventEmitter=require(_0x1b29('0x0'));var SmsQueue=require(_0x1b29('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1b29('0x2')](0x0);var events={'afterCreate':_0x1b29('0x3'),'afterUpdate':'update','afterDestroy':_0x1b29('0x4')};function emitEvent(_0x588736){return function(_0x281b81,_0x1b18bb,_0x28ebc6){SmsQueueEvents[_0x1b29('0x5')](_0x588736+':'+_0x281b81['id'],_0x281b81);SmsQueueEvents[_0x1b29('0x5')](_0x588736,_0x281b81);_0x28ebc6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1b29('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 9040ad1..9297210 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 _0x27a2=['bluebird','request-promise','path','rimraf','./smsQueue.attributes','define','sms_queues','lodash','../../config/logger','api','moment'];(function(_0x116db7,_0x18284d){var _0x1494c6=function(_0x1fe9fc){while(--_0x1fe9fc){_0x116db7['push'](_0x116db7['shift']());}};_0x1494c6(++_0x18284d);}(_0x27a2,0xac));var _0x227a=function(_0x1d5cbf,_0x5320e5){_0x1d5cbf=_0x1d5cbf-0x0;var _0x47c474=_0x27a2[_0x1d5cbf];return _0x47c474;};'use strict';var _=require(_0x227a('0x0'));var util=require('util');var logger=require(_0x227a('0x1'))(_0x227a('0x2'));var moment=require(_0x227a('0x3'));var BPromise=require(_0x227a('0x4'));var rp=require(_0x227a('0x5'));var fs=require('fs');var path=require(_0x227a('0x6'));var rimraf=require(_0x227a('0x7'));var config=require('../../config/environment');var attributes=require(_0x227a('0x8'));module['exports']=function(_0x20acb4,_0x240002){return _0x20acb4[_0x227a('0x9')]('SmsQueue',attributes,{'tableName':_0x227a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacc5=['SmsQueue','sms_queues','lodash','api','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports'];(function(_0x1cc944,_0x10da7d){var _0x4c457d=function(_0x10922c){while(--_0x10922c){_0x1cc944['push'](_0x1cc944['shift']());}};_0x4c457d(++_0x10da7d);}(_0xacc5,0x188));var _0x5acc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xacc5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x5acc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5acc('0x1'));var moment=require('moment');var BPromise=require(_0x5acc('0x2'));var rp=require(_0x5acc('0x3'));var fs=require('fs');var path=require(_0x5acc('0x4'));var rimraf=require(_0x5acc('0x5'));var config=require('../../config/environment');var attributes=require(_0x5acc('0x6'));module[_0x5acc('0x7')]=function(_0x175a0a,_0x117067){return _0x175a0a['define'](_0x5acc('0x8'),attributes,{'tableName':_0x5acc('0x9'),'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 cef3b76..17f327c 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 _0xa98f=['attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsQueue','findAll','options','raw','where'];(function(_0x32bcc2,_0x59d578){var _0x3c9b0f=function(_0x5730b5){while(--_0x5730b5){_0x32bcc2['push'](_0x32bcc2['shift']());}};_0x3c9b0f(++_0x59d578);}(_0xa98f,0xd5));var _0xfa98=function(_0x2020b6,_0x2ff986){_0x2020b6=_0x2020b6-0x0;var _0x2e0f62=_0xa98f[_0x2020b6];return _0x2e0f62;};'use strict';var _=require(_0xfa98('0x0'));var util=require('util');var moment=require(_0xfa98('0x1'));var BPromise=require(_0xfa98('0x2'));var rs=require(_0xfa98('0x3'));var fs=require('fs');var Redis=require(_0xfa98('0x4'));var db=require(_0xfa98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa98('0x6'))(_0xfa98('0x7'));var config=require(_0xfa98('0x8'));var jayson=require(_0xfa98('0x9'));var client=jayson[_0xfa98('0xa')][_0xfa98('0xb')]({'port':0x232a});config['redis']=_[_0xfa98('0xc')](config['redis'],{'host':_0xfa98('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa98('0xe')]));require(_0xfa98('0xf'))['register'](socket);function respondWithRpcPromise(_0x257f00,_0x43bfe0,_0x3ad665){return new BPromise(function(_0x5e88e4,_0x4ea38d){return client[_0xfa98('0x10')](_0x257f00,_0x3ad665)[_0xfa98('0x11')](function(_0x31b016){logger[_0xfa98('0x12')](_0xfa98('0x13'),_0x43bfe0,_0xfa98('0x14'));logger[_0xfa98('0x15')](_0xfa98('0x16'),_0x43bfe0,_0xfa98('0x14'),JSON[_0xfa98('0x17')](_0x31b016));if(_0x31b016[_0xfa98('0x18')]){if(_0x31b016[_0xfa98('0x18')]['code']===0x1f4){logger[_0xfa98('0x18')](_0xfa98('0x13'),_0x43bfe0,_0x31b016[_0xfa98('0x18')]['message']);return _0x4ea38d(_0x31b016[_0xfa98('0x18')][_0xfa98('0x19')]);}logger[_0xfa98('0x18')](_0xfa98('0x13'),_0x43bfe0,_0x31b016['error'][_0xfa98('0x19')]);return _0x5e88e4(_0x31b016[_0xfa98('0x18')][_0xfa98('0x19')]);}else{logger[_0xfa98('0x12')]('SmsQueue,\x20%s,\x20%s',_0x43bfe0,'request\x20sent');_0x5e88e4(_0x31b016[_0xfa98('0x1a')][_0xfa98('0x19')]);}})[_0xfa98('0x1b')](function(_0x1398c8){logger[_0xfa98('0x18')](_0xfa98('0x13'),_0x43bfe0,_0x1398c8);_0x4ea38d(_0x1398c8);});});}exports['GetSmsQueue']=function(_0x3e3539){var _0x227ea6=this;return new Promise(function(_0x9bb193,_0x57ffe7){return db[_0xfa98('0x1c')][_0xfa98('0x1d')]({'raw':_0x3e3539[_0xfa98('0x1e')]?_0x3e3539[_0xfa98('0x1e')][_0xfa98('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e3539['options']?_0x3e3539[_0xfa98('0x1e')][_0xfa98('0x20')]||null:null,'attributes':_0x3e3539[_0xfa98('0x1e')]?_0x3e3539[_0xfa98('0x1e')][_0xfa98('0x21')]||null:null,'limit':_0x3e3539[_0xfa98('0x1e')]?_0x3e3539[_0xfa98('0x1e')][_0xfa98('0x22')]||null:null,'include':_0x3e3539['options']?_0x3e3539[_0xfa98('0x1e')]['include']?_['map'](_0x3e3539[_0xfa98('0x1e')][_0xfa98('0x23')],function(_0x4ba272){return{'model':db[_0x4ba272['model']],'as':_0x4ba272['as'],'attributes':_0x4ba272[_0xfa98('0x21')],'include':_0x4ba272['include']?_[_0xfa98('0x24')](_0x4ba272['include'],function(_0x55a7a7){return{'model':db[_0x55a7a7[_0xfa98('0x25')]],'as':_0x55a7a7['as'],'attributes':_0x55a7a7[_0xfa98('0x21')],'include':_0x55a7a7[_0xfa98('0x23')]?_[_0xfa98('0x24')](_0x55a7a7['include'],function(_0xaea5a5){return{'model':db[_0xaea5a5[_0xfa98('0x25')]],'as':_0xaea5a5['as'],'attributes':_0xaea5a5[_0xfa98('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfa98('0x11')](function(_0x30789d){logger[_0xfa98('0x12')](_0xfa98('0x26'),_0x3e3539);logger['debug'](_0xfa98('0x26'),_0x3e3539,JSON['stringify'](_0x30789d));_0x9bb193(_0x30789d);})[_0xfa98('0x1b')](function(_0x3e1740){logger[_0xfa98('0x18')](_0xfa98('0x26'),_0x3e1740['message'],_0x3e3539);_0x57ffe7(_0x227ea6[_0xfa98('0x18')](0x1f4,_0x3e1740[_0xfa98('0x19')]));});});};exports[_0xfa98('0x27')]=function(_0x380205){var _0x10c627=this;return new Promise(function(_0x4a82a0,_0x1f1244){return db[_0xfa98('0x1c')][_0xfa98('0x28')]({'raw':_0x380205[_0xfa98('0x1e')]?_0x380205['options'][_0xfa98('0x1f')]===undefined?!![]:![]:!![],'where':_0x380205[_0xfa98('0x1e')]?_0x380205[_0xfa98('0x1e')][_0xfa98('0x20')]||null:null,'attributes':_0x380205[_0xfa98('0x1e')]?_0x380205[_0xfa98('0x1e')][_0xfa98('0x21')]||null:null,'include':_0x380205[_0xfa98('0x1e')]?_0x380205[_0xfa98('0x1e')][_0xfa98('0x23')]?_[_0xfa98('0x24')](_0x380205['options'][_0xfa98('0x23')],function(_0x3d2822){return{'model':db[_0x3d2822[_0xfa98('0x25')]],'as':_0x3d2822['as'],'attributes':_0x3d2822[_0xfa98('0x21')],'include':_0x3d2822['include']?_['map'](_0x3d2822[_0xfa98('0x23')],function(_0x11a974){return{'model':db[_0x11a974[_0xfa98('0x25')]],'as':_0x11a974['as'],'attributes':_0x11a974['attributes'],'include':_0x11a974['include']?_[_0xfa98('0x24')](_0x11a974[_0xfa98('0x23')],function(_0x357c2a){return{'model':db[_0x357c2a[_0xfa98('0x25')]],'as':_0x357c2a['as'],'attributes':_0x357c2a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa98('0x11')](function(_0x34f45b){logger[_0xfa98('0x12')]('ShowSmsQueue',_0x380205);logger[_0xfa98('0x15')](_0xfa98('0x27'),_0x380205,JSON[_0xfa98('0x17')](_0x34f45b));_0x4a82a0(_0x34f45b);})[_0xfa98('0x1b')](function(_0x18aad0){logger[_0xfa98('0x18')](_0xfa98('0x27'),_0x18aad0[_0xfa98('0x19')],_0x380205);_0x1f1244(_0x10c627['error'](0x1f4,_0x18aad0[_0xfa98('0x19')]));});});}; \ No newline at end of file +var _0xc3d9=['request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','SmsQueue','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','catch','ShowSmsQueue','find','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0xc3d9,0x1a0));var _0x9c3d=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xc3d9[_0x587ba2];return _0x50ec73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c3d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c3d('0x1'));var db=require(_0x9c3d('0x2'))['db'];var utils=require(_0x9c3d('0x3'));var logger=require(_0x9c3d('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c3d('0x5'));var client=jayson[_0x9c3d('0x6')]['http']({'port':0x232a});config[_0x9c3d('0x7')]=_[_0x9c3d('0x8')](config['redis'],{'host':_0x9c3d('0x9'),'port':0x18eb});var socket=require(_0x9c3d('0xa'))(new Redis(config['redis']));require(_0x9c3d('0xb'))[_0x9c3d('0xc')](socket);function respondWithRpcPromise(_0x4ffdad,_0x4b4ff8,_0x3e89a0){return new BPromise(function(_0x311d5d,_0x44b456){return client[_0x9c3d('0xd')](_0x4ffdad,_0x3e89a0)[_0x9c3d('0xe')](function(_0x4b1e8f){logger['info'](_0x9c3d('0xf'),_0x4b4ff8,_0x9c3d('0x10'));logger['debug'](_0x9c3d('0x11'),_0x4b4ff8,_0x9c3d('0x10'),JSON[_0x9c3d('0x12')](_0x4b1e8f));if(_0x4b1e8f['error']){if(_0x4b1e8f[_0x9c3d('0x13')][_0x9c3d('0x14')]===0x1f4){logger['error'](_0x9c3d('0xf'),_0x4b4ff8,_0x4b1e8f['error'][_0x9c3d('0x15')]);return _0x44b456(_0x4b1e8f['error'][_0x9c3d('0x15')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x4b4ff8,_0x4b1e8f[_0x9c3d('0x13')][_0x9c3d('0x15')]);return _0x311d5d(_0x4b1e8f['error'][_0x9c3d('0x15')]);}else{logger[_0x9c3d('0x16')](_0x9c3d('0xf'),_0x4b4ff8,_0x9c3d('0x10'));_0x311d5d(_0x4b1e8f['result'][_0x9c3d('0x15')]);}})['catch'](function(_0x54a682){logger[_0x9c3d('0x13')](_0x9c3d('0xf'),_0x4b4ff8,_0x54a682);_0x44b456(_0x54a682);});});}exports['GetSmsQueue']=function(_0x5ef435){var _0x35f27d=this;return new Promise(function(_0x4aab64,_0x4a41fb){return db[_0x9c3d('0x17')]['findAll']({'raw':_0x5ef435['options']?_0x5ef435[_0x9c3d('0x18')][_0x9c3d('0x19')]===undefined?!![]:![]:!![],'where':_0x5ef435[_0x9c3d('0x18')]?_0x5ef435['options'][_0x9c3d('0x1a')]||null:null,'attributes':_0x5ef435[_0x9c3d('0x18')]?_0x5ef435[_0x9c3d('0x18')][_0x9c3d('0x1b')]||null:null,'limit':_0x5ef435[_0x9c3d('0x18')]?_0x5ef435[_0x9c3d('0x18')][_0x9c3d('0x1c')]||null:null,'include':_0x5ef435[_0x9c3d('0x18')]?_0x5ef435[_0x9c3d('0x18')][_0x9c3d('0x1d')]?_[_0x9c3d('0x1e')](_0x5ef435[_0x9c3d('0x18')][_0x9c3d('0x1d')],function(_0x30b135){return{'model':db[_0x30b135[_0x9c3d('0x1f')]],'as':_0x30b135['as'],'attributes':_0x30b135['attributes'],'include':_0x30b135[_0x9c3d('0x1d')]?_[_0x9c3d('0x1e')](_0x30b135[_0x9c3d('0x1d')],function(_0x104517){return{'model':db[_0x104517[_0x9c3d('0x1f')]],'as':_0x104517['as'],'attributes':_0x104517['attributes'],'include':_0x104517[_0x9c3d('0x1d')]?_[_0x9c3d('0x1e')](_0x104517[_0x9c3d('0x1d')],function(_0x51dc61){return{'model':db[_0x51dc61[_0x9c3d('0x1f')]],'as':_0x51dc61['as'],'attributes':_0x51dc61[_0x9c3d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9c3d('0xe')](function(_0x5e4b20){logger['info'](_0x9c3d('0x20'),_0x5ef435);logger['debug'](_0x9c3d('0x20'),_0x5ef435,JSON[_0x9c3d('0x12')](_0x5e4b20));_0x4aab64(_0x5e4b20);})[_0x9c3d('0x21')](function(_0x2fd722){logger[_0x9c3d('0x13')](_0x9c3d('0x20'),_0x2fd722[_0x9c3d('0x15')],_0x5ef435);_0x4a41fb(_0x35f27d[_0x9c3d('0x13')](0x1f4,_0x2fd722['message']));});});};exports[_0x9c3d('0x22')]=function(_0x1ed525){var _0x574b64=this;return new Promise(function(_0x1d43b0,_0x39345e){return db['SmsQueue'][_0x9c3d('0x23')]({'raw':_0x1ed525[_0x9c3d('0x18')]?_0x1ed525[_0x9c3d('0x18')][_0x9c3d('0x19')]===undefined?!![]:![]:!![],'where':_0x1ed525[_0x9c3d('0x18')]?_0x1ed525[_0x9c3d('0x18')][_0x9c3d('0x1a')]||null:null,'attributes':_0x1ed525[_0x9c3d('0x18')]?_0x1ed525['options'][_0x9c3d('0x1b')]||null:null,'include':_0x1ed525[_0x9c3d('0x18')]?_0x1ed525[_0x9c3d('0x18')][_0x9c3d('0x1d')]?_[_0x9c3d('0x1e')](_0x1ed525[_0x9c3d('0x18')][_0x9c3d('0x1d')],function(_0x213d96){return{'model':db[_0x213d96[_0x9c3d('0x1f')]],'as':_0x213d96['as'],'attributes':_0x213d96[_0x9c3d('0x1b')],'include':_0x213d96[_0x9c3d('0x1d')]?_['map'](_0x213d96[_0x9c3d('0x1d')],function(_0x128634){return{'model':db[_0x128634[_0x9c3d('0x1f')]],'as':_0x128634['as'],'attributes':_0x128634[_0x9c3d('0x1b')],'include':_0x128634['include']?_[_0x9c3d('0x1e')](_0x128634[_0x9c3d('0x1d')],function(_0x57f518){return{'model':db[_0x57f518[_0x9c3d('0x1f')]],'as':_0x57f518['as'],'attributes':_0x57f518[_0x9c3d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9c3d('0xe')](function(_0x11736c){logger[_0x9c3d('0x16')]('ShowSmsQueue',_0x1ed525);logger['debug'](_0x9c3d('0x22'),_0x1ed525,JSON[_0x9c3d('0x12')](_0x11736c));_0x1d43b0(_0x11736c);})[_0x9c3d('0x21')](function(_0x1fc82f){logger[_0x9c3d('0x13')](_0x9c3d('0x22'),_0x1fc82f[_0x9c3d('0x15')],_0x1ed525);_0x39345e(_0x574b64[_0x9c3d('0x13')](0x1f4,_0x1fc82f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5569605..a264e5f 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 _0x4bd6=['length','smsQueue:','./smsQueue.events','save','emit','removeListener','register'];(function(_0x462dac,_0x2c86b2){var _0x3b9990=function(_0x28fba1){while(--_0x28fba1){_0x462dac['push'](_0x462dac['shift']());}};_0x3b9990(++_0x2c86b2);}(_0x4bd6,0x144));var _0x64bd=function(_0x53ed7e,_0x33b5ba){_0x53ed7e=_0x53ed7e-0x0;var _0x172a58=_0x4bd6[_0x53ed7e];return _0x172a58;};'use strict';var SmsQueueEvents=require(_0x64bd('0x0'));var events=[_0x64bd('0x1'),'remove','update'];function createListener(_0x36f52a,_0x5ae330){return function(_0x47ff4f){_0x5ae330[_0x64bd('0x2')](_0x36f52a,_0x47ff4f);};}function removeListener(_0x25ed7d,_0x2d95e3){return function(){SmsQueueEvents[_0x64bd('0x3')](_0x25ed7d,_0x2d95e3);};}exports[_0x64bd('0x4')]=function(_0x33bd25){for(var _0x40c2bb=0x0,_0x3db297=events[_0x64bd('0x5')];_0x40c2bb<_0x3db297;_0x40c2bb++){var _0x25436b=events[_0x40c2bb];var _0x5afdc5=createListener(_0x64bd('0x6')+_0x25436b,_0x33bd25);SmsQueueEvents['on'](_0x25436b,_0x5afdc5);}}; \ No newline at end of file +var _0x3f34=['save','remove','update','emit','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0x3f34,0xaf));var _0x43f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f34[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require(_0x43f3('0x0'));var events=[_0x43f3('0x1'),_0x43f3('0x2'),_0x43f3('0x3')];function createListener(_0x877927,_0x8939e5){return function(_0x41319a){_0x8939e5[_0x43f3('0x4')](_0x877927,_0x41319a);};}function removeListener(_0x25eee1,_0x4e5ce3){return function(){SmsQueueEvents[_0x43f3('0x5')](_0x25eee1,_0x4e5ce3);};}exports['register']=function(_0x4ea698){for(var _0x1cf062=0x0,_0x219ad8=events[_0x43f3('0x6')];_0x1cf062<_0x219ad8;_0x1cf062++){var _0x2db5a6=events[_0x1cf062];var _0x562f0b=createListener(_0x43f3('0x7')+_0x2db5a6,_0x4ea698);SmsQueueEvents['on'](_0x2db5a6,_0x562f0b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4104b97..9011984 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 _0x455d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x5176c6,_0x475c3c){var _0x106035=function(_0x6366e7){while(--_0x6366e7){_0x5176c6['push'](_0x5176c6['shift']());}};_0x106035(++_0x475c3c);}(_0x455d,0x190));var _0xd455=function(_0xfd1572,_0x513334){_0xfd1572=_0xfd1572-0x0;var _0x22b0ea=_0x455d[_0xfd1572];return _0x22b0ea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/describe',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['get'](_0xd455('0xc'),auth[_0xd455('0x9')](),controller[_0xd455('0xd')]);router[_0xd455('0xe')]('/',auth['isAuthenticated'](),controller[_0xd455('0xf')]);router[_0xd455('0x10')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);router[_0xd455('0x12')](_0xd455('0xc'),auth[_0xd455('0x9')](),controller[_0xd455('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3988=['isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe'];(function(_0xce6175,_0x2ed97e){var _0x49d4ad=function(_0x33e7f0){while(--_0x33e7f0){_0xce6175['push'](_0xce6175['shift']());}};_0x49d4ad(++_0x2ed97e);}(_0x3988,0x139));var _0x8398=function(_0xa31730,_0x448c88){_0xa31730=_0xa31730-0x0;var _0x50674a=_0x3988[_0xa31730];return _0x50674a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8398('0x0'));var timeout=require(_0x8398('0x1'));var express=require(_0x8398('0x2'));var router=express[_0x8398('0x3')]();var fs_extra=require(_0x8398('0x4'));var auth=require(_0x8398('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8398('0x6'));var controller=require('./smsQueueReport.controller');router[_0x8398('0x7')]('/',auth['isAuthenticated'](),controller[_0x8398('0x8')]);router[_0x8398('0x7')](_0x8398('0x9'),auth[_0x8398('0xa')](),controller[_0x8398('0xb')]);router[_0x8398('0x7')](_0x8398('0xc'),auth[_0x8398('0xa')](),controller[_0x8398('0xd')]);router[_0x8398('0xe')]('/',auth[_0x8398('0xa')](),controller['create']);router['put'](_0x8398('0xc'),auth['isAuthenticated'](),controller[_0x8398('0xf')]);router[_0x8398('0x10')](_0x8398('0xc'),auth[_0x8398('0xa')](),controller[_0x8398('0x11')]);module[_0x8398('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index cd4eb6b..d01f7f8 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 _0xe3be=['STRING','DATE','moment','sequelize','exports'];(function(_0x4bbe2a,_0x385b4f){var _0x1f7adc=function(_0x9f0795){while(--_0x9f0795){_0x4bbe2a['push'](_0x4bbe2a['shift']());}};_0x1f7adc(++_0x385b4f);}(_0xe3be,0x93));var _0xee3b=function(_0xe09759,_0x14f5bb){_0xe09759=_0xe09759-0x0;var _0x36fa33=_0xe3be[_0xe09759];return _0x36fa33;};'use strict';var moment=require(_0xee3b('0x0'));var Sequelize=require(_0xee3b('0x1'));module[_0xee3b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xee3b('0x3')]},'joinAt':{'type':Sequelize[_0xee3b('0x4')]},'leaveAt':{'type':Sequelize[_0xee3b('0x4')]},'acceptAt':{'type':Sequelize[_0xee3b('0x4')]},'exitAt':{'type':Sequelize[_0xee3b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x627a=['STRING','DATE','moment','sequelize'];(function(_0x176143,_0xb9ed04){var _0x5c719c=function(_0x4264e0){while(--_0x4264e0){_0x176143['push'](_0x176143['shift']());}};_0x5c719c(++_0xb9ed04);}(_0x627a,0xae));var _0xa627=function(_0x4767f7,_0x62e847){_0x4767f7=_0x4767f7-0x0;var _0x48a120=_0x627a[_0x4767f7];return _0x48a120;};'use strict';var moment=require(_0xa627('0x0'));var Sequelize=require(_0xa627('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa627('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa627('0x3')]},'leaveAt':{'type':Sequelize[_0xa627('0x3')]},'acceptAt':{'type':Sequelize[_0xa627('0x3')]},'exitAt':{'type':Sequelize[_0xa627('0x3')]},'reason':{'type':Sequelize[_0xa627('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index c5f997e..208d24c 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 _0x7656=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','SmsQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','length','attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','create','body','find'];(function(_0x283d2d,_0x4b25ae){var _0x240e9a=function(_0x1095c0){while(--_0x1095c0){_0x283d2d['push'](_0x283d2d['shift']());}};_0x240e9a(++_0x4b25ae);}(_0x7656,0xdc));var _0x6765=function(_0x55aa20,_0x172708){_0x55aa20=_0x55aa20-0x0;var _0x2375ab=_0x7656[_0x55aa20];return _0x2375ab;};'use strict';var emlformat=require(_0x6765('0x0'));var rimraf=require(_0x6765('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6765('0x2'));var rp=require(_0x6765('0x3'));var moment=require(_0x6765('0x4'));var BPromise=require(_0x6765('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6765('0x6'));var sox=require(_0x6765('0x7'));var csv=require(_0x6765('0x8'));var ejs=require(_0x6765('0x9'));var fs=require('fs');var fs_extra=require(_0x6765('0xa'));var _=require(_0x6765('0xb'));var squel=require(_0x6765('0xc'));var crypto=require('crypto');var jsforce=require(_0x6765('0xd'));var deskjs=require(_0x6765('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6765('0xf'));var Papa=require('papaparse');var Redis=require(_0x6765('0x10'));var authService=require(_0x6765('0x11'));var qs=require(_0x6765('0x12'));var as=require(_0x6765('0x13'));var hardwareService=require(_0x6765('0x14'));var logger=require(_0x6765('0x15'))(_0x6765('0x16'));var utils=require(_0x6765('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6765('0x18'));var db=require(_0x6765('0x19'))['db'];function respondWithStatusCode(_0x58705f,_0x48619a){_0x48619a=_0x48619a||0xcc;return function(_0x24b7ba){if(_0x24b7ba){return _0x58705f['sendStatus'](_0x48619a);}return _0x58705f[_0x6765('0x1a')](_0x48619a)[_0x6765('0x1b')]();};}function respondWithResult(_0x2db542,_0x5602d1){_0x5602d1=_0x5602d1||0xc8;return function(_0x2138ac){if(_0x2138ac){return _0x2db542[_0x6765('0x1a')](_0x5602d1)[_0x6765('0x1c')](_0x2138ac);}};}function respondWithFilteredResult(_0x2b4906,_0x21403c){return function(_0x11298f){if(_0x11298f){var _0x354333=typeof _0x21403c[_0x6765('0x1d')]===_0x6765('0x1e')&&typeof _0x21403c['limit']===_0x6765('0x1e');var _0x315ba6=_0x11298f[_0x6765('0x1f')];var _0xc2310b=_0x354333?0x0:_0x21403c[_0x6765('0x1d')];var _0x34dcc0=_0x354333?_0x11298f[_0x6765('0x1f')]:_0x21403c['offset']+_0x21403c[_0x6765('0x20')];var _0x25930d;if(_0x34dcc0>=_0x315ba6){_0x34dcc0=_0x315ba6;_0x25930d=0xc8;}else{_0x25930d=0xce;}_0x2b4906[_0x6765('0x1a')](_0x25930d);return _0x2b4906[_0x6765('0x21')](_0x6765('0x22'),_0xc2310b+'-'+_0x34dcc0+'/'+_0x315ba6)[_0x6765('0x1c')](_0x11298f);}return null;};}function patchUpdates(_0x5a1921){return function(_0x276ddc){try{jsonpatch[_0x6765('0x23')](_0x276ddc,_0x5a1921,!![]);}catch(_0x47ac10){return BPromise[_0x6765('0x24')](_0x47ac10);}return _0x276ddc['save']();};}function saveUpdates(_0x55ffc1,_0x2cd54e){return function(_0x239663){if(_0x239663){return _0x239663[_0x6765('0x25')](_0x55ffc1)[_0x6765('0x26')](function(_0x2d424f){return _0x2d424f;});}return null;};}function removeEntity(_0x30cbd2,_0x106c28){return function(_0x2a7958){if(_0x2a7958){return _0x2a7958[_0x6765('0x27')]()['then'](function(){_0x30cbd2[_0x6765('0x1a')](0xcc)[_0x6765('0x1b')]();});}};}function handleEntityNotFound(_0x593206,_0x228fe9){return function(_0x90f7e5){if(!_0x90f7e5){_0x593206[_0x6765('0x28')](0x194);}return _0x90f7e5;};}function handleError(_0x1cf560,_0x237fe6){_0x237fe6=_0x237fe6||0x1f4;return function(_0x11d645){logger[_0x6765('0x29')](_0x11d645['stack']);if(_0x11d645[_0x6765('0x2a')]){delete _0x11d645[_0x6765('0x2a')];}_0x1cf560['status'](_0x237fe6)['send'](_0x11d645);};}exports['index']=function(_0xc1afbe,_0x4fce65){var _0x562f3e={},_0x38ee0f={},_0x501225={'count':0x0,'rows':[]};var _0x35790f=_['map'](db[_0x6765('0x2b')][_0x6765('0x2c')],function(_0x3b9e0d){return{'name':_0x3b9e0d[_0x6765('0x2d')],'type':_0x3b9e0d[_0x6765('0x2e')]['key']};});_0x38ee0f[_0x6765('0x2f')]=_[_0x6765('0x30')](_0x35790f,_0x6765('0x2a'));_0x38ee0f[_0x6765('0x31')]=_[_0x6765('0x32')](_0xc1afbe[_0x6765('0x31')]);_0x38ee0f['filters']=_[_0x6765('0x33')](_0x38ee0f[_0x6765('0x2f')],_0x38ee0f[_0x6765('0x31')]);_0x562f3e['attributes']=_[_0x6765('0x33')](_0x38ee0f[_0x6765('0x2f')],qs['fields'](_0xc1afbe[_0x6765('0x31')][_0x6765('0x34')]));_0x562f3e['attributes']=_0x562f3e['attributes'][_0x6765('0x35')]?_0x562f3e[_0x6765('0x36')]:_0x38ee0f['model'];if(!_0xc1afbe[_0x6765('0x31')]['hasOwnProperty'](_0x6765('0x37'))){_0x562f3e[_0x6765('0x20')]=qs['limit'](_0xc1afbe[_0x6765('0x31')][_0x6765('0x20')]);_0x562f3e['offset']=qs[_0x6765('0x1d')](_0xc1afbe[_0x6765('0x31')][_0x6765('0x1d')]);}_0x562f3e[_0x6765('0x38')]=qs['sort'](_0xc1afbe['query'][_0x6765('0x39')]);_0x562f3e[_0x6765('0x3a')]=qs[_0x6765('0x3b')](_['pick'](_0xc1afbe['query'],_0x38ee0f[_0x6765('0x3b')]),_0x35790f);if(_0xc1afbe[_0x6765('0x31')][_0x6765('0x3c')]){_0x562f3e[_0x6765('0x3a')]=_[_0x6765('0x3d')](_0x562f3e[_0x6765('0x3a')],{'$or':_[_0x6765('0x30')](_0x35790f,function(_0x616ddc){if(_0x616ddc[_0x6765('0x2e')]!==_0x6765('0x3e')){var _0x158868={};_0x158868[_0x616ddc[_0x6765('0x2a')]]={'$like':'%'+_0xc1afbe['query'][_0x6765('0x3c')]+'%'};return _0x158868;}})});}_0x562f3e=_[_0x6765('0x3d')]({},_0x562f3e,_0xc1afbe[_0x6765('0x3f')]);var _0x163e9b={'where':_0x562f3e[_0x6765('0x3a')]};return db['SmsQueueReport'][_0x6765('0x1f')](_0x163e9b)[_0x6765('0x26')](function(_0x4ca75d){_0x501225[_0x6765('0x1f')]=_0x4ca75d;if(_0xc1afbe[_0x6765('0x31')][_0x6765('0x40')]){_0x562f3e['include']=[{'all':!![]}];}return db[_0x6765('0x2b')][_0x6765('0x41')](_0x562f3e);})['then'](function(_0x47faa4){_0x501225['rows']=_0x47faa4;return _0x501225;})['then'](respondWithFilteredResult(_0x4fce65,_0x562f3e))[_0x6765('0x42')](handleError(_0x4fce65,null));};exports[_0x6765('0x43')]=function(_0x362a97,_0x43a342){var _0x4f32c2={'raw':!![],'where':{'id':_0x362a97[_0x6765('0x44')]['id']}},_0x133bdc={};_0x133bdc['model']=_[_0x6765('0x32')](db[_0x6765('0x2b')][_0x6765('0x2c')]);_0x133bdc[_0x6765('0x31')]=_[_0x6765('0x32')](_0x362a97[_0x6765('0x31')]);_0x133bdc[_0x6765('0x3b')]=_['intersection'](_0x133bdc['model'],_0x133bdc['query']);_0x4f32c2['attributes']=_[_0x6765('0x33')](_0x133bdc[_0x6765('0x2f')],qs[_0x6765('0x34')](_0x362a97[_0x6765('0x31')][_0x6765('0x34')]));_0x4f32c2['attributes']=_0x4f32c2[_0x6765('0x36')][_0x6765('0x35')]?_0x4f32c2[_0x6765('0x36')]:_0x133bdc[_0x6765('0x2f')];if(_0x362a97[_0x6765('0x31')][_0x6765('0x40')]){_0x4f32c2['include']=[{'all':!![]}];}_0x4f32c2=_['merge']({},_0x4f32c2,_0x362a97[_0x6765('0x3f')]);return db['SmsQueueReport']['find'](_0x4f32c2)[_0x6765('0x26')](handleEntityNotFound(_0x43a342,null))['then'](respondWithResult(_0x43a342,null))[_0x6765('0x42')](handleError(_0x43a342,null));};exports[_0x6765('0x45')]=function(_0x431911,_0x79adc9){return db[_0x6765('0x2b')][_0x6765('0x45')](_0x431911['body'],{})[_0x6765('0x26')](respondWithResult(_0x79adc9,0xc9))[_0x6765('0x42')](handleError(_0x79adc9,null));};exports[_0x6765('0x25')]=function(_0x3413a8,_0x425f72){if(_0x3413a8[_0x6765('0x46')]['id']){delete _0x3413a8['body']['id'];}return db[_0x6765('0x2b')][_0x6765('0x47')]({'where':{'id':_0x3413a8['params']['id']}})[_0x6765('0x26')](handleEntityNotFound(_0x425f72,null))[_0x6765('0x26')](saveUpdates(_0x3413a8['body'],null))[_0x6765('0x26')](respondWithResult(_0x425f72,null))['catch'](handleError(_0x425f72,null));};exports['destroy']=function(_0x168992,_0x3a4011){return db['SmsQueueReport'][_0x6765('0x47')]({'where':{'id':_0x168992['params']['id']}})[_0x6765('0x26')](handleEntityNotFound(_0x3a4011,null))[_0x6765('0x26')](removeEntity(_0x3a4011,null))[_0x6765('0x42')](handleError(_0x3a4011,null));};exports[_0x6765('0x48')]=function(_0x3bbf20,_0x4259c0){return db[_0x6765('0x2b')]['describe']()[_0x6765('0x26')](respondWithResult(_0x4259c0,null))[_0x6765('0x42')](handleError(_0x4259c0,null));}; \ No newline at end of file +var _0x2809=['set','Content-Range','apply','reject','update','then','destroy','stack','name','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','offset'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x2809,0xbb));var _0x9280=function(_0x27a591,_0x24c79b){_0x27a591=_0x27a591-0x0;var _0x2de723=_0x2809[_0x27a591];return _0x2de723;};'use strict';var emlformat=require(_0x9280('0x0'));var rimraf=require(_0x9280('0x1'));var zipdir=require(_0x9280('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9280('0x3'));var moment=require(_0x9280('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9280('0x5'));var util=require(_0x9280('0x6'));var path=require('path');var sox=require(_0x9280('0x7'));var csv=require(_0x9280('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9280('0x9'));var squel=require(_0x9280('0xa'));var crypto=require(_0x9280('0xb'));var jsforce=require(_0x9280('0xc'));var deskjs=require(_0x9280('0xd'));var toCsv=require(_0x9280('0x8'));var querystring=require(_0x9280('0xe'));var Papa=require(_0x9280('0xf'));var Redis=require(_0x9280('0x10'));var authService=require(_0x9280('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9280('0x12'))(_0x9280('0x13'));var utils=require(_0x9280('0x14'));var config=require(_0x9280('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9280('0x16'))['db'];function respondWithStatusCode(_0x538d89,_0x588ce4){_0x588ce4=_0x588ce4||0xcc;return function(_0x2a20ea){if(_0x2a20ea){return _0x538d89[_0x9280('0x17')](_0x588ce4);}return _0x538d89[_0x9280('0x18')](_0x588ce4)[_0x9280('0x19')]();};}function respondWithResult(_0x2e38c0,_0x4c7e98){_0x4c7e98=_0x4c7e98||0xc8;return function(_0x4458e5){if(_0x4458e5){return _0x2e38c0[_0x9280('0x18')](_0x4c7e98)[_0x9280('0x1a')](_0x4458e5);}};}function respondWithFilteredResult(_0x41104a,_0x4f559d){return function(_0x3fad62){if(_0x3fad62){var _0x33fc17=typeof _0x4f559d['offset']==='undefined'&&typeof _0x4f559d[_0x9280('0x1b')]==='undefined';var _0x2d35d8=_0x3fad62['count'];var _0x4c7d06=_0x33fc17?0x0:_0x4f559d[_0x9280('0x1c')];var _0x4d29ca=_0x33fc17?_0x3fad62['count']:_0x4f559d[_0x9280('0x1c')]+_0x4f559d[_0x9280('0x1b')];var _0x2479bd;if(_0x4d29ca>=_0x2d35d8){_0x4d29ca=_0x2d35d8;_0x2479bd=0xc8;}else{_0x2479bd=0xce;}_0x41104a[_0x9280('0x18')](_0x2479bd);return _0x41104a[_0x9280('0x1d')](_0x9280('0x1e'),_0x4c7d06+'-'+_0x4d29ca+'/'+_0x2d35d8)[_0x9280('0x1a')](_0x3fad62);}return null;};}function patchUpdates(_0xcae7c6){return function(_0x49bb66){try{jsonpatch[_0x9280('0x1f')](_0x49bb66,_0xcae7c6,!![]);}catch(_0x52b4b4){return BPromise[_0x9280('0x20')](_0x52b4b4);}return _0x49bb66['save']();};}function saveUpdates(_0x3fa32f,_0xfcdc){return function(_0x286670){if(_0x286670){return _0x286670[_0x9280('0x21')](_0x3fa32f)[_0x9280('0x22')](function(_0x522877){return _0x522877;});}return null;};}function removeEntity(_0x5e761c,_0x2702a4){return function(_0x490b4d){if(_0x490b4d){return _0x490b4d[_0x9280('0x23')]()[_0x9280('0x22')](function(){_0x5e761c[_0x9280('0x18')](0xcc)[_0x9280('0x19')]();});}};}function handleEntityNotFound(_0x215f8d,_0x5d45a8){return function(_0x407085){if(!_0x407085){_0x215f8d[_0x9280('0x17')](0x194);}return _0x407085;};}function handleError(_0x2d8327,_0x419d30){_0x419d30=_0x419d30||0x1f4;return function(_0x10f455){logger['error'](_0x10f455[_0x9280('0x24')]);if(_0x10f455['name']){delete _0x10f455[_0x9280('0x25')];}_0x2d8327[_0x9280('0x18')](_0x419d30)['send'](_0x10f455);};}exports['index']=function(_0x2b37f7,_0x33656c){var _0x71ecc4={},_0x453903={},_0x3ae141={'count':0x0,'rows':[]};var _0xa24ab9=_[_0x9280('0x26')](db[_0x9280('0x27')][_0x9280('0x28')],function(_0x116297){return{'name':_0x116297[_0x9280('0x29')],'type':_0x116297[_0x9280('0x2a')][_0x9280('0x2b')]};});_0x453903[_0x9280('0x2c')]=_[_0x9280('0x26')](_0xa24ab9,_0x9280('0x25'));_0x453903[_0x9280('0x2d')]=_[_0x9280('0x2e')](_0x2b37f7[_0x9280('0x2d')]);_0x453903[_0x9280('0x2f')]=_[_0x9280('0x30')](_0x453903[_0x9280('0x2c')],_0x453903[_0x9280('0x2d')]);_0x71ecc4[_0x9280('0x31')]=_['intersection'](_0x453903[_0x9280('0x2c')],qs[_0x9280('0x32')](_0x2b37f7['query'][_0x9280('0x32')]));_0x71ecc4[_0x9280('0x31')]=_0x71ecc4['attributes']['length']?_0x71ecc4[_0x9280('0x31')]:_0x453903[_0x9280('0x2c')];if(!_0x2b37f7[_0x9280('0x2d')][_0x9280('0x33')](_0x9280('0x34'))){_0x71ecc4[_0x9280('0x1b')]=qs[_0x9280('0x1b')](_0x2b37f7[_0x9280('0x2d')][_0x9280('0x1b')]);_0x71ecc4['offset']=qs[_0x9280('0x1c')](_0x2b37f7[_0x9280('0x2d')][_0x9280('0x1c')]);}_0x71ecc4[_0x9280('0x35')]=qs[_0x9280('0x36')](_0x2b37f7[_0x9280('0x2d')]['sort']);_0x71ecc4['where']=qs[_0x9280('0x2f')](_[_0x9280('0x37')](_0x2b37f7[_0x9280('0x2d')],_0x453903[_0x9280('0x2f')]),_0xa24ab9);if(_0x2b37f7['query'][_0x9280('0x38')]){_0x71ecc4[_0x9280('0x39')]=_['merge'](_0x71ecc4[_0x9280('0x39')],{'$or':_[_0x9280('0x26')](_0xa24ab9,function(_0x5bc04b){if(_0x5bc04b[_0x9280('0x2a')]!==_0x9280('0x3a')){var _0x1b2b2e={};_0x1b2b2e[_0x5bc04b[_0x9280('0x25')]]={'$like':'%'+_0x2b37f7['query']['filter']+'%'};return _0x1b2b2e;}})});}_0x71ecc4=_[_0x9280('0x3b')]({},_0x71ecc4,_0x2b37f7[_0x9280('0x3c')]);var _0x1077f0={'where':_0x71ecc4[_0x9280('0x39')]};return db['SmsQueueReport'][_0x9280('0x3d')](_0x1077f0)['then'](function(_0x43493b){_0x3ae141[_0x9280('0x3d')]=_0x43493b;if(_0x2b37f7[_0x9280('0x2d')]['includeAll']){_0x71ecc4[_0x9280('0x3e')]=[{'all':!![]}];}return db[_0x9280('0x27')][_0x9280('0x3f')](_0x71ecc4);})[_0x9280('0x22')](function(_0xfa20a){_0x3ae141['rows']=_0xfa20a;return _0x3ae141;})[_0x9280('0x22')](respondWithFilteredResult(_0x33656c,_0x71ecc4))[_0x9280('0x40')](handleError(_0x33656c,null));};exports[_0x9280('0x41')]=function(_0x244fa9,_0x2bf005){var _0x5c6af5={'raw':!![],'where':{'id':_0x244fa9[_0x9280('0x42')]['id']}},_0x2db3a0={};_0x2db3a0[_0x9280('0x2c')]=_['keys'](db[_0x9280('0x27')][_0x9280('0x28')]);_0x2db3a0[_0x9280('0x2d')]=_['keys'](_0x244fa9['query']);_0x2db3a0[_0x9280('0x2f')]=_[_0x9280('0x30')](_0x2db3a0['model'],_0x2db3a0[_0x9280('0x2d')]);_0x5c6af5[_0x9280('0x31')]=_[_0x9280('0x30')](_0x2db3a0[_0x9280('0x2c')],qs[_0x9280('0x32')](_0x244fa9[_0x9280('0x2d')]['fields']));_0x5c6af5['attributes']=_0x5c6af5[_0x9280('0x31')][_0x9280('0x43')]?_0x5c6af5['attributes']:_0x2db3a0[_0x9280('0x2c')];if(_0x244fa9['query']['includeAll']){_0x5c6af5[_0x9280('0x3e')]=[{'all':!![]}];}_0x5c6af5=_[_0x9280('0x3b')]({},_0x5c6af5,_0x244fa9['options']);return db[_0x9280('0x27')][_0x9280('0x44')](_0x5c6af5)[_0x9280('0x22')](handleEntityNotFound(_0x2bf005,null))[_0x9280('0x22')](respondWithResult(_0x2bf005,null))['catch'](handleError(_0x2bf005,null));};exports[_0x9280('0x45')]=function(_0x179f35,_0xb07e05){return db['SmsQueueReport']['create'](_0x179f35[_0x9280('0x46')],{})[_0x9280('0x22')](respondWithResult(_0xb07e05,0xc9))['catch'](handleError(_0xb07e05,null));};exports[_0x9280('0x21')]=function(_0x4cd3bb,_0x2a4b72){if(_0x4cd3bb[_0x9280('0x46')]['id']){delete _0x4cd3bb[_0x9280('0x46')]['id'];}return db[_0x9280('0x27')][_0x9280('0x44')]({'where':{'id':_0x4cd3bb[_0x9280('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a4b72,null))[_0x9280('0x22')](saveUpdates(_0x4cd3bb[_0x9280('0x46')],null))[_0x9280('0x22')](respondWithResult(_0x2a4b72,null))[_0x9280('0x40')](handleError(_0x2a4b72,null));};exports[_0x9280('0x23')]=function(_0x4b9dca,_0x4457f4){return db[_0x9280('0x27')]['find']({'where':{'id':_0x4b9dca[_0x9280('0x42')]['id']}})[_0x9280('0x22')](handleEntityNotFound(_0x4457f4,null))[_0x9280('0x22')](removeEntity(_0x4457f4,null))[_0x9280('0x40')](handleError(_0x4457f4,null));};exports[_0x9280('0x47')]=function(_0x212124,_0x2821b7){return db[_0x9280('0x27')][_0x9280('0x47')]()['then'](respondWithResult(_0x2821b7,null))['catch'](handleError(_0x2821b7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c145f66..a11eed7 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2e3f40,_0x47410c){var _0x28abc1=function(_0x472028){while(--_0x472028){_0x2e3f40['push'](_0x2e3f40['shift']());}};_0x28abc1(++_0x47410c);}(_0xe706,0xa3));var _0x6e70=function(_0x29fcaf,_0x20c943){_0x29fcaf=_0x29fcaf-0x0;var _0x4adcb2=_0xe706[_0x29fcaf];return _0x4adcb2;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x241053,_0x560dff){var _0x1f0fb0=function(_0x3ca652){while(--_0x3ca652){_0x241053['push'](_0x241053['shift']());}};_0x1f0fb0(++_0x560dff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index aa719a6..b5c3b3f 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 _0x2944=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','catch','CreateSmsQueueReport','body','options','debug','message','UpdateSmsQueueReport','SmsQueueReport','limit','lodash','util','moment','randomstring'];(function(_0x481291,_0x2dcb38){var _0x26acc1=function(_0x2ba5c9){while(--_0x2ba5c9){_0x481291['push'](_0x481291['shift']());}};_0x26acc1(++_0x2dcb38);}(_0x2944,0x74));var _0x4294=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x2944[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x4294('0x0'));var util=require(_0x4294('0x1'));var moment=require(_0x4294('0x2'));var BPromise=require('bluebird');var rs=require(_0x4294('0x3'));var fs=require('fs');var Redis=require(_0x4294('0x4'));var db=require(_0x4294('0x5'))['db'];var utils=require(_0x4294('0x6'));var logger=require(_0x4294('0x7'))('rpc');var config=require(_0x4294('0x8'));var jayson=require(_0x4294('0x9'));var client=jayson[_0x4294('0xa')][_0x4294('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1014c1,_0xa98130,_0x12c69f){return new BPromise(function(_0x4675fc,_0x5e776d){return client['request'](_0x1014c1,_0x12c69f)[_0x4294('0xc')](function(_0x1f5dde){logger['info'](_0x4294('0xd'),_0xa98130,_0x4294('0xe'));logger['debug'](_0x4294('0xf'),_0xa98130,'request\x20sent',JSON[_0x4294('0x10')](_0x1f5dde));if(_0x1f5dde[_0x4294('0x11')]){if(_0x1f5dde[_0x4294('0x11')][_0x4294('0x12')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0xa98130,_0x1f5dde[_0x4294('0x11')]['message']);return _0x5e776d(_0x1f5dde[_0x4294('0x11')]['message']);}logger[_0x4294('0x11')](_0x4294('0xd'),_0xa98130,_0x1f5dde[_0x4294('0x11')]['message']);return _0x4675fc(_0x1f5dde[_0x4294('0x11')]['message']);}else{logger[_0x4294('0x13')](_0x4294('0xd'),_0xa98130,_0x4294('0xe'));_0x4675fc(_0x1f5dde[_0x4294('0x14')]['message']);}})[_0x4294('0x15')](function(_0x5aca67){logger['error'](_0x4294('0xd'),_0xa98130,_0x5aca67);_0x5e776d(_0x5aca67);});});}exports[_0x4294('0x16')]=function(_0x1c72d5){var _0xad923b=this;return new Promise(function(_0x264a77,_0x2cef28){return db['SmsQueueReport']['create'](_0x1c72d5[_0x4294('0x17')],{'raw':_0x1c72d5[_0x4294('0x18')]?_0x1c72d5[_0x4294('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4294('0xc')](function(_0x133521){logger[_0x4294('0x13')](_0x4294('0x16'),_0x1c72d5);logger[_0x4294('0x19')]('CreateSmsQueueReport',_0x1c72d5,JSON[_0x4294('0x10')](_0x133521));_0x264a77(_0x133521);})['catch'](function(_0x7c6c65){logger[_0x4294('0x11')]('CreateSmsQueueReport',_0x7c6c65[_0x4294('0x1a')],_0x1c72d5);_0x2cef28(_0xad923b[_0x4294('0x11')](0x1f4,_0x7c6c65[_0x4294('0x1a')]));});});};exports[_0x4294('0x1b')]=function(_0x4f972e){var _0x2b8835=this;return new Promise(function(_0x3364bf,_0x3fcb75){return db[_0x4294('0x1c')]['update'](_0x4f972e[_0x4294('0x17')],{'raw':_0x4f972e[_0x4294('0x18')]?_0x4f972e[_0x4294('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f972e['options']?_0x4f972e['options']['where']||null:null,'attributes':_0x4f972e['options']?_0x4f972e[_0x4294('0x18')]['attributes']||null:null,'limit':_0x4f972e[_0x4294('0x18')]?_0x4f972e[_0x4294('0x18')][_0x4294('0x1d')]||null:null})[_0x4294('0xc')](function(_0x1461a9){logger[_0x4294('0x13')](_0x4294('0x1b'),_0x4f972e);logger['debug'](_0x4294('0x1b'),_0x4f972e,JSON[_0x4294('0x10')](_0x1461a9));_0x3364bf(_0x1461a9);})[_0x4294('0x15')](function(_0x563946){logger[_0x4294('0x11')]('UpdateSmsQueueReport',_0x563946[_0x4294('0x1a')],_0x4f972e);_0x3fcb75(_0x2b8835[_0x4294('0x11')](0x1f4,_0x563946[_0x4294('0x1a')]));});});}; \ No newline at end of file +var _0x0f3c=['error','code','message','catch','CreateSmsQueueReport','create','body','options','raw','info','debug','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1bc4c7,_0x1702c1){var _0x1469e2=function(_0x5bda33){while(--_0x5bda33){_0x1bc4c7['push'](_0x1bc4c7['shift']());}};_0x1469e2(++_0x1702c1);}(_0x0f3c,0xcb));var _0xc0f3=function(_0x17fd51,_0xe03d9e){_0x17fd51=_0x17fd51-0x0;var _0x4a7ebd=_0x0f3c[_0x17fd51];return _0x4a7ebd;};'use strict';var _=require(_0xc0f3('0x0'));var util=require('util');var moment=require(_0xc0f3('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0f3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0f3('0x3'))['db'];var utils=require(_0xc0f3('0x4'));var logger=require('../../config/logger')(_0xc0f3('0x5'));var config=require(_0xc0f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc0f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17434c,_0x2747f4,_0x2ac9ec){return new BPromise(function(_0x1fe966,_0x3a96a2){return client[_0xc0f3('0x8')](_0x17434c,_0x2ac9ec)[_0xc0f3('0x9')](function(_0x3be1d2){logger['info'](_0xc0f3('0xa'),_0x2747f4,_0xc0f3('0xb'));logger['debug'](_0xc0f3('0xc'),_0x2747f4,'request\x20sent',JSON[_0xc0f3('0xd')](_0x3be1d2));if(_0x3be1d2[_0xc0f3('0xe')]){if(_0x3be1d2[_0xc0f3('0xe')][_0xc0f3('0xf')]===0x1f4){logger['error'](_0xc0f3('0xa'),_0x2747f4,_0x3be1d2[_0xc0f3('0xe')][_0xc0f3('0x10')]);return _0x3a96a2(_0x3be1d2[_0xc0f3('0xe')][_0xc0f3('0x10')]);}logger[_0xc0f3('0xe')](_0xc0f3('0xa'),_0x2747f4,_0x3be1d2[_0xc0f3('0xe')][_0xc0f3('0x10')]);return _0x1fe966(_0x3be1d2[_0xc0f3('0xe')][_0xc0f3('0x10')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x2747f4,'request\x20sent');_0x1fe966(_0x3be1d2['result']['message']);}})[_0xc0f3('0x11')](function(_0x17eef4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2747f4,_0x17eef4);_0x3a96a2(_0x17eef4);});});}exports[_0xc0f3('0x12')]=function(_0x46e94a){var _0x18e353=this;return new Promise(function(_0x17c417,_0x26647e){return db['SmsQueueReport'][_0xc0f3('0x13')](_0x46e94a[_0xc0f3('0x14')],{'raw':_0x46e94a[_0xc0f3('0x15')]?_0x46e94a[_0xc0f3('0x15')][_0xc0f3('0x16')]===undefined?!![]:![]:!![]})[_0xc0f3('0x9')](function(_0x4f83a7){logger[_0xc0f3('0x17')](_0xc0f3('0x12'),_0x46e94a);logger[_0xc0f3('0x18')](_0xc0f3('0x12'),_0x46e94a,JSON['stringify'](_0x4f83a7));_0x17c417(_0x4f83a7);})[_0xc0f3('0x11')](function(_0x438472){logger[_0xc0f3('0xe')]('CreateSmsQueueReport',_0x438472[_0xc0f3('0x10')],_0x46e94a);_0x26647e(_0x18e353['error'](0x1f4,_0x438472[_0xc0f3('0x10')]));});});};exports[_0xc0f3('0x19')]=function(_0x25bf10){var _0x2b7396=this;return new Promise(function(_0x3aff36,_0x3dd668){return db[_0xc0f3('0x1a')][_0xc0f3('0x1b')](_0x25bf10['body'],{'raw':_0x25bf10[_0xc0f3('0x15')]?_0x25bf10[_0xc0f3('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25bf10[_0xc0f3('0x15')]?_0x25bf10['options'][_0xc0f3('0x1c')]||null:null,'attributes':_0x25bf10[_0xc0f3('0x15')]?_0x25bf10[_0xc0f3('0x15')][_0xc0f3('0x1d')]||null:null,'limit':_0x25bf10[_0xc0f3('0x15')]?_0x25bf10['options'][_0xc0f3('0x1e')]||null:null})[_0xc0f3('0x9')](function(_0x5b2878){logger[_0xc0f3('0x17')](_0xc0f3('0x19'),_0x25bf10);logger['debug'](_0xc0f3('0x19'),_0x25bf10,JSON['stringify'](_0x5b2878));_0x3aff36(_0x5b2878);})[_0xc0f3('0x11')](function(_0x4c4fd7){logger['error'](_0xc0f3('0x19'),_0x4c4fd7[_0xc0f3('0x10')],_0x25bf10);_0x3dd668(_0x2b7396[_0xc0f3('0xe')](0x1f4,_0x4c4fd7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f7cb9aa..3af6c6b 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 _0xb458=['./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3285d4,_0x136036){var _0x5408c9=function(_0x1c1de8){while(--_0x1c1de8){_0x3285d4['push'](_0x3285d4['shift']());}};_0x5408c9(++_0x136036);}(_0xb458,0x103));var _0x8b45=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0xb458[_0x14ec75];return _0x40b9e9;};'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'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xc')]);router['get'](_0x8b45('0xd'),auth[_0x8b45('0xb')](),controller[_0x8b45('0xe')]);router[_0x8b45('0xf')]('/',auth[_0x8b45('0xb')](),controller['create']);router[_0x8b45('0x10')](_0x8b45('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8b45('0xb')](),controller[_0x8b45('0x11')]);module[_0x8b45('0x12')]=router; \ No newline at end of file +var _0xf767=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','put','update','delete','destroy','exports','util','path'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xf767,0x76));var _0x7f76=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xf767[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require(_0x7f76('0x0'));var path=require(_0x7f76('0x1'));var timeout=require(_0x7f76('0x2'));var express=require(_0x7f76('0x3'));var router=express[_0x7f76('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f76('0x5'));var interaction=require(_0x7f76('0x6'));var config=require(_0x7f76('0x7'));var controller=require(_0x7f76('0x8'));router['get']('/',auth[_0x7f76('0x9')](),controller[_0x7f76('0xa')]);router[_0x7f76('0xb')](_0x7f76('0xc'),auth[_0x7f76('0x9')](),controller['describe']);router[_0x7f76('0xb')](_0x7f76('0xd'),auth[_0x7f76('0x9')](),controller[_0x7f76('0xe')]);router['post']('/',auth[_0x7f76('0x9')](),controller['create']);router[_0x7f76('0xf')](_0x7f76('0xd'),auth[_0x7f76('0x9')](),controller[_0x7f76('0x10')]);router[_0x7f76('0x11')](_0x7f76('0xd'),auth['isAuthenticated'](),controller[_0x7f76('0x12')]);module[_0x7f76('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index cece169..f17f602 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3dfd22,_0x5131d3){var _0x55876e=function(_0x10970d){while(--_0x10970d){_0x3dfd22['push'](_0x3dfd22['shift']());}};_0x55876e(++_0x5131d3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xf3cd[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x5a6da9,_0x32df4d){var _0x29d30f=function(_0x2b6742){while(--_0x2b6742){_0x5a6da9['push'](_0x5a6da9['shift']());}};_0x29d30f(++_0x32df4d);}(_0x54ef,0x112));var _0xf54e=function(_0x44dfa5,_0x1b86f1){_0x44dfa5=_0x44dfa5-0x0;var _0x484d1e=_0x54ef[_0x44dfa5];return _0x484d1e;};'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 b74a163..ede5c1c 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 _0xa0d5=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','SmsTransferReport','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa0d5,0x7b));var _0x5a0d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa0d5[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x5a0d('0x0'));var rimraf=require(_0x5a0d('0x1'));var zipdir=require(_0x5a0d('0x2'));var jsonpatch=require(_0x5a0d('0x3'));var rp=require(_0x5a0d('0x4'));var moment=require(_0x5a0d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a0d('0x6'));var util=require('util');var path=require(_0x5a0d('0x7'));var sox=require('sox');var csv=require(_0x5a0d('0x8'));var ejs=require(_0x5a0d('0x9'));var fs=require('fs');var fs_extra=require(_0x5a0d('0xa'));var _=require(_0x5a0d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5a0d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a0d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5a0d('0xe'));var hardwareService=require(_0x5a0d('0xf'));var logger=require('../../config/logger')(_0x5a0d('0x10'));var utils=require('../../config/utils');var config=require(_0x5a0d('0x11'));var licenseUtil=require(_0x5a0d('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f84e,_0x48a8bb){_0x48a8bb=_0x48a8bb||0xcc;return function(_0x5a1530){if(_0x5a1530){return _0x13f84e[_0x5a0d('0x13')](_0x48a8bb);}return _0x13f84e['status'](_0x48a8bb)[_0x5a0d('0x14')]();};}function respondWithResult(_0x348b38,_0x3ddcb8){_0x3ddcb8=_0x3ddcb8||0xc8;return function(_0x594fe2){if(_0x594fe2){return _0x348b38[_0x5a0d('0x15')](_0x3ddcb8)[_0x5a0d('0x16')](_0x594fe2);}};}function respondWithFilteredResult(_0x3c8f77,_0x205472){return function(_0x60630b){if(_0x60630b){var _0x2db644=typeof _0x205472[_0x5a0d('0x17')]===_0x5a0d('0x18')&&typeof _0x205472[_0x5a0d('0x19')]===_0x5a0d('0x18');var _0x20264f=_0x60630b[_0x5a0d('0x1a')];var _0x16cfff=_0x2db644?0x0:_0x205472['offset'];var _0x571c4d=_0x2db644?_0x60630b[_0x5a0d('0x1a')]:_0x205472[_0x5a0d('0x17')]+_0x205472[_0x5a0d('0x19')];var _0x3cc4e6;if(_0x571c4d>=_0x20264f){_0x571c4d=_0x20264f;_0x3cc4e6=0xc8;}else{_0x3cc4e6=0xce;}_0x3c8f77['status'](_0x3cc4e6);return _0x3c8f77[_0x5a0d('0x1b')](_0x5a0d('0x1c'),_0x16cfff+'-'+_0x571c4d+'/'+_0x20264f)[_0x5a0d('0x16')](_0x60630b);}return null;};}function patchUpdates(_0x738eba){return function(_0x58e81e){try{jsonpatch[_0x5a0d('0x1d')](_0x58e81e,_0x738eba,!![]);}catch(_0x584773){return BPromise[_0x5a0d('0x1e')](_0x584773);}return _0x58e81e[_0x5a0d('0x1f')]();};}function saveUpdates(_0x572043,_0x2a0d5f){return function(_0x59490f){if(_0x59490f){return _0x59490f[_0x5a0d('0x20')](_0x572043)['then'](function(_0x49730c){return _0x49730c;});}return null;};}function removeEntity(_0x203bb9,_0x5e26b8){return function(_0x713a6a){if(_0x713a6a){return _0x713a6a[_0x5a0d('0x21')]()[_0x5a0d('0x22')](function(){_0x203bb9[_0x5a0d('0x15')](0xcc)[_0x5a0d('0x14')]();});}};}function handleEntityNotFound(_0x3d4c73,_0x14b202){return function(_0x4b8031){if(!_0x4b8031){_0x3d4c73['sendStatus'](0x194);}return _0x4b8031;};}function handleError(_0x574fd5,_0x4d94eb){_0x4d94eb=_0x4d94eb||0x1f4;return function(_0x4e9dd9){logger[_0x5a0d('0x23')](_0x4e9dd9[_0x5a0d('0x24')]);if(_0x4e9dd9[_0x5a0d('0x25')]){delete _0x4e9dd9[_0x5a0d('0x25')];}_0x574fd5['status'](_0x4d94eb)[_0x5a0d('0x26')](_0x4e9dd9);};}exports[_0x5a0d('0x27')]=function(_0x1dbba2,_0x355054){var _0x17898f={},_0x182efa={},_0x845fd8={'count':0x0,'rows':[]};var _0x2c05ba=_[_0x5a0d('0x28')](db['SmsTransferReport']['rawAttributes'],function(_0x453c00){return{'name':_0x453c00[_0x5a0d('0x29')],'type':_0x453c00[_0x5a0d('0x2a')][_0x5a0d('0x2b')]};});_0x182efa[_0x5a0d('0x2c')]=_[_0x5a0d('0x28')](_0x2c05ba,_0x5a0d('0x25'));_0x182efa[_0x5a0d('0x2d')]=_[_0x5a0d('0x2e')](_0x1dbba2[_0x5a0d('0x2d')]);_0x182efa[_0x5a0d('0x2f')]=_[_0x5a0d('0x30')](_0x182efa[_0x5a0d('0x2c')],_0x182efa[_0x5a0d('0x2d')]);_0x17898f['attributes']=_[_0x5a0d('0x30')](_0x182efa[_0x5a0d('0x2c')],qs[_0x5a0d('0x31')](_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x31')]));_0x17898f[_0x5a0d('0x32')]=_0x17898f['attributes'][_0x5a0d('0x33')]?_0x17898f[_0x5a0d('0x32')]:_0x182efa[_0x5a0d('0x2c')];if(!_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x34')](_0x5a0d('0x35'))){_0x17898f[_0x5a0d('0x19')]=qs['limit'](_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x19')]);_0x17898f[_0x5a0d('0x17')]=qs[_0x5a0d('0x17')](_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x17')]);}_0x17898f['order']=qs[_0x5a0d('0x36')](_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x36')]);_0x17898f['where']=qs['filters'](_[_0x5a0d('0x37')](_0x1dbba2[_0x5a0d('0x2d')],_0x182efa['filters']),_0x2c05ba);if(_0x1dbba2[_0x5a0d('0x2d')][_0x5a0d('0x38')]){_0x17898f['where']=_[_0x5a0d('0x39')](_0x17898f['where'],{'$or':_[_0x5a0d('0x28')](_0x2c05ba,function(_0x29e7e0){if(_0x29e7e0['type']!==_0x5a0d('0x3a')){var _0x3e0a68={};_0x3e0a68[_0x29e7e0[_0x5a0d('0x25')]]={'$like':'%'+_0x1dbba2[_0x5a0d('0x2d')]['filter']+'%'};return _0x3e0a68;}})});}_0x17898f=_['merge']({},_0x17898f,_0x1dbba2[_0x5a0d('0x3b')]);var _0x5548ff={'where':_0x17898f[_0x5a0d('0x3c')]};return db[_0x5a0d('0x3d')][_0x5a0d('0x1a')](_0x5548ff)['then'](function(_0x1d21dd){_0x845fd8['count']=_0x1d21dd;if(_0x1dbba2['query']['includeAll']){_0x17898f[_0x5a0d('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x17898f);})[_0x5a0d('0x22')](function(_0x15c240){_0x845fd8[_0x5a0d('0x3f')]=_0x15c240;return _0x845fd8;})[_0x5a0d('0x22')](respondWithFilteredResult(_0x355054,_0x17898f))[_0x5a0d('0x40')](handleError(_0x355054,null));};exports[_0x5a0d('0x41')]=function(_0x537f19,_0x1dc264){var _0x2638ab={'raw':!![],'where':{'id':_0x537f19[_0x5a0d('0x42')]['id']}},_0x45e1be={};_0x45e1be[_0x5a0d('0x2c')]=_[_0x5a0d('0x2e')](db[_0x5a0d('0x3d')][_0x5a0d('0x43')]);_0x45e1be[_0x5a0d('0x2d')]=_[_0x5a0d('0x2e')](_0x537f19['query']);_0x45e1be[_0x5a0d('0x2f')]=_[_0x5a0d('0x30')](_0x45e1be['model'],_0x45e1be[_0x5a0d('0x2d')]);_0x2638ab[_0x5a0d('0x32')]=_[_0x5a0d('0x30')](_0x45e1be[_0x5a0d('0x2c')],qs['fields'](_0x537f19[_0x5a0d('0x2d')]['fields']));_0x2638ab[_0x5a0d('0x32')]=_0x2638ab[_0x5a0d('0x32')][_0x5a0d('0x33')]?_0x2638ab[_0x5a0d('0x32')]:_0x45e1be[_0x5a0d('0x2c')];if(_0x537f19['query']['includeAll']){_0x2638ab[_0x5a0d('0x3e')]=[{'all':!![]}];}_0x2638ab=_[_0x5a0d('0x39')]({},_0x2638ab,_0x537f19['options']);return db[_0x5a0d('0x3d')][_0x5a0d('0x44')](_0x2638ab)['then'](handleEntityNotFound(_0x1dc264,null))[_0x5a0d('0x22')](respondWithResult(_0x1dc264,null))[_0x5a0d('0x40')](handleError(_0x1dc264,null));};exports['create']=function(_0x3b6f76,_0x6396f2){return db['SmsTransferReport'][_0x5a0d('0x45')](_0x3b6f76[_0x5a0d('0x46')],{})[_0x5a0d('0x22')](respondWithResult(_0x6396f2,0xc9))[_0x5a0d('0x40')](handleError(_0x6396f2,null));};exports[_0x5a0d('0x20')]=function(_0x589801,_0x10c600){if(_0x589801[_0x5a0d('0x46')]['id']){delete _0x589801['body']['id'];}return db['SmsTransferReport'][_0x5a0d('0x44')]({'where':{'id':_0x589801['params']['id']}})[_0x5a0d('0x22')](handleEntityNotFound(_0x10c600,null))[_0x5a0d('0x22')](saveUpdates(_0x589801[_0x5a0d('0x46')],null))[_0x5a0d('0x22')](respondWithResult(_0x10c600,null))[_0x5a0d('0x40')](handleError(_0x10c600,null));};exports['destroy']=function(_0x30e5fe,_0x2b7fb4){return db[_0x5a0d('0x3d')][_0x5a0d('0x44')]({'where':{'id':_0x30e5fe['params']['id']}})['then'](handleEntityNotFound(_0x2b7fb4,null))[_0x5a0d('0x22')](removeEntity(_0x2b7fb4,null))[_0x5a0d('0x40')](handleError(_0x2b7fb4,null));};exports[_0x5a0d('0x47')]=function(_0x1885bb,_0x3a0172){return db[_0x5a0d('0x3d')][_0x5a0d('0x47')]()[_0x5a0d('0x22')](respondWithResult(_0x3a0172,null))[_0x5a0d('0x40')](handleError(_0x3a0172,null));}; \ No newline at end of file +var _0x3bd8=['mustache','util','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','apply','reject','save','update','then','stack','name','send','index','map','SmsTransferReport','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','options','count','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','destroy','describe','rimraf','zip-dir','request-promise','bluebird'];(function(_0x593862,_0x2ce13e){var _0x132d05=function(_0x250c5e){while(--_0x250c5e){_0x593862['push'](_0x593862['shift']());}};_0x132d05(++_0x2ce13e);}(_0x3bd8,0x1c3));var _0x83bd=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0x3bd8[_0x1f7996];return _0x584609;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83bd('0x0'));var zipdir=require(_0x83bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83bd('0x2'));var moment=require('moment');var BPromise=require(_0x83bd('0x3'));var Mustache=require(_0x83bd('0x4'));var util=require(_0x83bd('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x83bd('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x83bd('0x7'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83bd('0x8'));var Redis=require(_0x83bd('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x83bd('0xa'));var as=require(_0x83bd('0xb'));var hardwareService=require(_0x83bd('0xc'));var logger=require(_0x83bd('0xd'))(_0x83bd('0xe'));var utils=require('../../config/utils');var config=require(_0x83bd('0xf'));var licenseUtil=require(_0x83bd('0x10'));var db=require(_0x83bd('0x11'))['db'];function respondWithStatusCode(_0x29cb9f,_0xeef7d2){_0xeef7d2=_0xeef7d2||0xcc;return function(_0x40d733){if(_0x40d733){return _0x29cb9f[_0x83bd('0x12')](_0xeef7d2);}return _0x29cb9f['status'](_0xeef7d2)[_0x83bd('0x13')]();};}function respondWithResult(_0x4df8c6,_0x52bf39){_0x52bf39=_0x52bf39||0xc8;return function(_0x554ac1){if(_0x554ac1){return _0x4df8c6[_0x83bd('0x14')](_0x52bf39)[_0x83bd('0x15')](_0x554ac1);}};}function respondWithFilteredResult(_0x3db66e,_0x1acf1c){return function(_0x410d69){if(_0x410d69){var _0x4b09d9=typeof _0x1acf1c[_0x83bd('0x16')]===_0x83bd('0x17')&&typeof _0x1acf1c[_0x83bd('0x18')]===_0x83bd('0x17');var _0x5db702=_0x410d69['count'];var _0x569e3e=_0x4b09d9?0x0:_0x1acf1c[_0x83bd('0x16')];var _0x3f3f21=_0x4b09d9?_0x410d69['count']:_0x1acf1c[_0x83bd('0x16')]+_0x1acf1c[_0x83bd('0x18')];var _0x1ccc3c;if(_0x3f3f21>=_0x5db702){_0x3f3f21=_0x5db702;_0x1ccc3c=0xc8;}else{_0x1ccc3c=0xce;}_0x3db66e[_0x83bd('0x14')](_0x1ccc3c);return _0x3db66e['set']('Content-Range',_0x569e3e+'-'+_0x3f3f21+'/'+_0x5db702)[_0x83bd('0x15')](_0x410d69);}return null;};}function patchUpdates(_0x46ff1b){return function(_0x2fb8a4){try{jsonpatch[_0x83bd('0x19')](_0x2fb8a4,_0x46ff1b,!![]);}catch(_0x54737e){return BPromise[_0x83bd('0x1a')](_0x54737e);}return _0x2fb8a4[_0x83bd('0x1b')]();};}function saveUpdates(_0x288b31,_0x2e768b){return function(_0x1f314a){if(_0x1f314a){return _0x1f314a[_0x83bd('0x1c')](_0x288b31)[_0x83bd('0x1d')](function(_0x5a06e5){return _0x5a06e5;});}return null;};}function removeEntity(_0x63fe87,_0x19a55b){return function(_0x924b68){if(_0x924b68){return _0x924b68['destroy']()['then'](function(){_0x63fe87[_0x83bd('0x14')](0xcc)[_0x83bd('0x13')]();});}};}function handleEntityNotFound(_0x3c340d,_0x3981c2){return function(_0x595153){if(!_0x595153){_0x3c340d[_0x83bd('0x12')](0x194);}return _0x595153;};}function handleError(_0x32bcd6,_0x198863){_0x198863=_0x198863||0x1f4;return function(_0x35ffaa){logger['error'](_0x35ffaa[_0x83bd('0x1e')]);if(_0x35ffaa[_0x83bd('0x1f')]){delete _0x35ffaa['name'];}_0x32bcd6['status'](_0x198863)[_0x83bd('0x20')](_0x35ffaa);};}exports[_0x83bd('0x21')]=function(_0x2708d3,_0x3645d0){var _0x2c1247={},_0x52f078={},_0x11fa72={'count':0x0,'rows':[]};var _0x18f514=_[_0x83bd('0x22')](db[_0x83bd('0x23')]['rawAttributes'],function(_0x12e7ba){return{'name':_0x12e7ba[_0x83bd('0x24')],'type':_0x12e7ba[_0x83bd('0x25')]['key']};});_0x52f078['model']=_[_0x83bd('0x22')](_0x18f514,_0x83bd('0x1f'));_0x52f078[_0x83bd('0x26')]=_['keys'](_0x2708d3['query']);_0x52f078[_0x83bd('0x27')]=_[_0x83bd('0x28')](_0x52f078[_0x83bd('0x29')],_0x52f078[_0x83bd('0x26')]);_0x2c1247[_0x83bd('0x2a')]=_[_0x83bd('0x28')](_0x52f078['model'],qs[_0x83bd('0x2b')](_0x2708d3[_0x83bd('0x26')][_0x83bd('0x2b')]));_0x2c1247[_0x83bd('0x2a')]=_0x2c1247[_0x83bd('0x2a')]['length']?_0x2c1247['attributes']:_0x52f078[_0x83bd('0x29')];if(!_0x2708d3[_0x83bd('0x26')]['hasOwnProperty'](_0x83bd('0x2c'))){_0x2c1247[_0x83bd('0x18')]=qs[_0x83bd('0x18')](_0x2708d3[_0x83bd('0x26')]['limit']);_0x2c1247[_0x83bd('0x16')]=qs[_0x83bd('0x16')](_0x2708d3[_0x83bd('0x26')][_0x83bd('0x16')]);}_0x2c1247[_0x83bd('0x2d')]=qs[_0x83bd('0x2e')](_0x2708d3[_0x83bd('0x26')][_0x83bd('0x2e')]);_0x2c1247[_0x83bd('0x2f')]=qs['filters'](_[_0x83bd('0x30')](_0x2708d3[_0x83bd('0x26')],_0x52f078['filters']),_0x18f514);if(_0x2708d3['query']['filter']){_0x2c1247[_0x83bd('0x2f')]=_[_0x83bd('0x31')](_0x2c1247['where'],{'$or':_[_0x83bd('0x22')](_0x18f514,function(_0x49646b){if(_0x49646b[_0x83bd('0x25')]!=='VIRTUAL'){var _0x4c588e={};_0x4c588e[_0x49646b[_0x83bd('0x1f')]]={'$like':'%'+_0x2708d3['query']['filter']+'%'};return _0x4c588e;}})});}_0x2c1247=_[_0x83bd('0x31')]({},_0x2c1247,_0x2708d3[_0x83bd('0x32')]);var _0x1e033f={'where':_0x2c1247[_0x83bd('0x2f')]};return db['SmsTransferReport'][_0x83bd('0x33')](_0x1e033f)[_0x83bd('0x1d')](function(_0x448a80){_0x11fa72[_0x83bd('0x33')]=_0x448a80;if(_0x2708d3[_0x83bd('0x26')][_0x83bd('0x34')]){_0x2c1247[_0x83bd('0x35')]=[{'all':!![]}];}return db[_0x83bd('0x23')][_0x83bd('0x36')](_0x2c1247);})[_0x83bd('0x1d')](function(_0x5eddb1){_0x11fa72['rows']=_0x5eddb1;return _0x11fa72;})['then'](respondWithFilteredResult(_0x3645d0,_0x2c1247))['catch'](handleError(_0x3645d0,null));};exports[_0x83bd('0x37')]=function(_0x5863a6,_0x5e5dfe){var _0x500f1f={'raw':!![],'where':{'id':_0x5863a6[_0x83bd('0x38')]['id']}},_0x1f0828={};_0x1f0828[_0x83bd('0x29')]=_[_0x83bd('0x39')](db['SmsTransferReport'][_0x83bd('0x3a')]);_0x1f0828[_0x83bd('0x26')]=_[_0x83bd('0x39')](_0x5863a6[_0x83bd('0x26')]);_0x1f0828[_0x83bd('0x27')]=_[_0x83bd('0x28')](_0x1f0828[_0x83bd('0x29')],_0x1f0828[_0x83bd('0x26')]);_0x500f1f[_0x83bd('0x2a')]=_[_0x83bd('0x28')](_0x1f0828['model'],qs[_0x83bd('0x2b')](_0x5863a6[_0x83bd('0x26')]['fields']));_0x500f1f[_0x83bd('0x2a')]=_0x500f1f[_0x83bd('0x2a')]['length']?_0x500f1f[_0x83bd('0x2a')]:_0x1f0828[_0x83bd('0x29')];if(_0x5863a6[_0x83bd('0x26')][_0x83bd('0x34')]){_0x500f1f[_0x83bd('0x35')]=[{'all':!![]}];}_0x500f1f=_[_0x83bd('0x31')]({},_0x500f1f,_0x5863a6['options']);return db[_0x83bd('0x23')][_0x83bd('0x3b')](_0x500f1f)[_0x83bd('0x1d')](handleEntityNotFound(_0x5e5dfe,null))[_0x83bd('0x1d')](respondWithResult(_0x5e5dfe,null))[_0x83bd('0x3c')](handleError(_0x5e5dfe,null));};exports['create']=function(_0x221a80,_0x1f1bda){return db[_0x83bd('0x23')][_0x83bd('0x3d')](_0x221a80['body'],{})[_0x83bd('0x1d')](respondWithResult(_0x1f1bda,0xc9))[_0x83bd('0x3c')](handleError(_0x1f1bda,null));};exports['update']=function(_0x2b6d71,_0x3efa0b){if(_0x2b6d71[_0x83bd('0x3e')]['id']){delete _0x2b6d71[_0x83bd('0x3e')]['id'];}return db['SmsTransferReport'][_0x83bd('0x3b')]({'where':{'id':_0x2b6d71[_0x83bd('0x38')]['id']}})[_0x83bd('0x1d')](handleEntityNotFound(_0x3efa0b,null))[_0x83bd('0x1d')](saveUpdates(_0x2b6d71[_0x83bd('0x3e')],null))[_0x83bd('0x1d')](respondWithResult(_0x3efa0b,null))[_0x83bd('0x3c')](handleError(_0x3efa0b,null));};exports[_0x83bd('0x3f')]=function(_0x155244,_0x94a981){return db['SmsTransferReport'][_0x83bd('0x3b')]({'where':{'id':_0x155244['params']['id']}})[_0x83bd('0x1d')](handleEntityNotFound(_0x94a981,null))[_0x83bd('0x1d')](removeEntity(_0x94a981,null))[_0x83bd('0x3c')](handleError(_0x94a981,null));};exports[_0x83bd('0x40')]=function(_0x1ad26e,_0x2b7c88){return db[_0x83bd('0x23')][_0x83bd('0x40')]()[_0x83bd('0x1d')](respondWithResult(_0x2b7c88,null))['catch'](handleError(_0x2b7c88,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a199c76..596bfac 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 _0xa496=['api','moment','bluebird','path','rimraf','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xa496,0x1b7));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a49('0x0'))(_0x6a49('0x1'));var moment=require(_0x6a49('0x2'));var BPromise=require(_0x6a49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a49('0x4'));var rimraf=require(_0x6a49('0x5'));var config=require(_0x6a49('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x6a49('0x7')]=function(_0x23e9f2,_0x5afde1){return _0x23e9f2['define'](_0x6a49('0x8'),attributes,{'tableName':_0x6a49('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6a49('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3b4=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xa3b4,0x130));var _0x4a3b=function(_0x292991,_0x2bada3){_0x292991=_0x292991-0x0;var _0x5e855c=_0xa3b4[_0x292991];return _0x5e855c;};'use strict';var _=require('lodash');var util=require(_0x4a3b('0x0'));var logger=require(_0x4a3b('0x1'))(_0x4a3b('0x2'));var moment=require(_0x4a3b('0x3'));var BPromise=require(_0x4a3b('0x4'));var rp=require(_0x4a3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a3b('0x6'));var attributes=require(_0x4a3b('0x7'));module[_0x4a3b('0x8')]=function(_0x3acfed,_0x4b6b77){return _0x3acfed[_0x4a3b('0x9')](_0x4a3b('0xa'),attributes,{'tableName':_0x4a3b('0xb'),'paranoid':![],'indexes':[{'name':_0x4a3b('0xc'),'fields':[_0x4a3b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 1fafa64..065a8f9 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 _0x3edc=['request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xd3a9d2,_0x196bde){var _0x19e0f0=function(_0x5a12fd){while(--_0x5a12fd){_0xd3a9d2['push'](_0xd3a9d2['shift']());}};_0x19e0f0(++_0x196bde);}(_0x3edc,0x1ae));var _0xc3ed=function(_0xadf368,_0x5a5863){_0xadf368=_0xadf368-0x0;var _0x41a61e=_0x3edc[_0xadf368];return _0x41a61e;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var moment=require(_0xc3ed('0x2'));var BPromise=require(_0xc3ed('0x3'));var rs=require(_0xc3ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3ed('0x6'))(_0xc3ed('0x7'));var config=require(_0xc3ed('0x8'));var jayson=require(_0xc3ed('0x9'));var client=jayson[_0xc3ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b28d4,_0x323058,_0x14d194){return new BPromise(function(_0x2f28ce,_0x13999f){return client[_0xc3ed('0xb')](_0x1b28d4,_0x14d194)['then'](function(_0x81590e){logger[_0xc3ed('0xc')](_0xc3ed('0xd'),_0x323058,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'),JSON[_0xc3ed('0xf')](_0x81590e));if(_0x81590e[_0xc3ed('0x10')]){if(_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x11')]===0x1f4){logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x13999f(_0x81590e[_0xc3ed('0x10')]['message']);}logger[_0xc3ed('0x10')](_0xc3ed('0xd'),_0x323058,_0x81590e[_0xc3ed('0x10')][_0xc3ed('0x12')]);return _0x2f28ce(_0x81590e['error']['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x323058,_0xc3ed('0xe'));_0x2f28ce(_0x81590e[_0xc3ed('0x13')]['message']);}})[_0xc3ed('0x14')](function(_0x15eb2e){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x323058,_0x15eb2e);_0x13999f(_0x15eb2e);});});} \ No newline at end of file +var _0x49c4=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x4da49c,_0xedaafa){var _0x4e60ac=function(_0x269633){while(--_0x269633){_0x4da49c['push'](_0x4da49c['shift']());}};_0x4e60ac(++_0xedaafa);}(_0x49c4,0x9b));var _0x449c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x49c4[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var moment=require(_0x449c('0x1'));var BPromise=require(_0x449c('0x2'));var rs=require(_0x449c('0x3'));var fs=require('fs');var Redis=require(_0x449c('0x4'));var db=require(_0x449c('0x5'))['db'];var utils=require(_0x449c('0x6'));var logger=require(_0x449c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x449c('0x8'));var client=jayson[_0x449c('0x9')][_0x449c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db09a,_0x3e7c19,_0x43cb0e){return new BPromise(function(_0x3e6354,_0x6d76d1){return client[_0x449c('0xb')](_0x2db09a,_0x43cb0e)[_0x449c('0xc')](function(_0x32f061){logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));logger[_0x449c('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3e7c19,'request\x20sent',JSON[_0x449c('0x11')](_0x32f061));if(_0x32f061[_0x449c('0x12')]){if(_0x32f061['error']['code']===0x1f4){logger['error'](_0x449c('0xe'),_0x3e7c19,_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);return _0x6d76d1(_0x32f061[_0x449c('0x12')]['message']);}logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x32f061[_0x449c('0x12')]['message']);return _0x3e6354(_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);}else{logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));_0x3e6354(_0x32f061[_0x449c('0x14')][_0x449c('0x13')]);}})[_0x449c('0x15')](function(_0x132a5b){logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x132a5b);_0x6d76d1(_0x132a5b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 559f899..4a8c16e 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 _0x8616=['extname','now','post','single','file','create','put','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','%s-%s%s'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0x8616,0x153));var _0x6861=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x8616[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x6861('0x0'));var util=require(_0x6861('0x1'));var path=require('path');var timeout=require(_0x6861('0x2'));var express=require('express');var router=express[_0x6861('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6861('0x4'));var interaction=require(_0x6861('0x5'));var config=require(_0x6861('0x6'));var controller=require(_0x6861('0x7'));router[_0x6861('0x8')]('/',auth[_0x6861('0x9')](),controller[_0x6861('0xa')]);router[_0x6861('0x8')](_0x6861('0xb'),auth[_0x6861('0x9')](),controller[_0x6861('0xc')]);router[_0x6861('0x8')](_0x6861('0xd'),auth[_0x6861('0x9')](),controller[_0x6861('0xe')]);var upload=multer({'storage':multer[_0x6861('0xf')]({'destination':function(_0x279ddb,_0x4487a9,_0x5bd999){_0x5bd999(null,path[_0x6861('0x10')](config[_0x6861('0x11')],'server/files/sounds/original/'));},'filename':function(_0x3ac9b3,_0x4d22cb,_0x181f6a){_0x4d22cb[_0x6861('0x12')]=_0x4d22cb[_0x6861('0x12')][_0x6861('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x181f6a(null,util['format'](_0x6861('0x14'),path['basename'](_0x4d22cb['originalname'],path[_0x6861('0x15')](_0x4d22cb[_0x6861('0x12')])),Date[_0x6861('0x16')](),path['extname'](_0x4d22cb[_0x6861('0x12')])));}})});router[_0x6861('0x17')]('/',upload[_0x6861('0x18')](_0x6861('0x19')),controller[_0x6861('0x1a')]);router[_0x6861('0x1b')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6861('0x1c')](_0x6861('0xb'),auth[_0x6861('0x9')](),controller[_0x6861('0x1c')]);module[_0x6861('0x1d')]=router; \ No newline at end of file +var _0xcd5f=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','post','single','create','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x137dc0,_0x39c68f){var _0x3d8702=function(_0x12828f){while(--_0x12828f){_0x137dc0['push'](_0x137dc0['shift']());}};_0x3d8702(++_0x39c68f);}(_0xcd5f,0x11c));var _0xfcd5=function(_0x802dec,_0x156e43){_0x802dec=_0x802dec-0x0;var _0x54631f=_0xcd5f[_0x802dec];return _0x54631f;};'use strict';var multer=require(_0xfcd5('0x0'));var util=require(_0xfcd5('0x1'));var path=require(_0xfcd5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcd5('0x3')]();var fs_extra=require(_0xfcd5('0x4'));var auth=require(_0xfcd5('0x5'));var interaction=require(_0xfcd5('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xfcd5('0x7')]('/',auth[_0xfcd5('0x8')](),controller[_0xfcd5('0x9')]);router[_0xfcd5('0x7')](_0xfcd5('0xa'),auth[_0xfcd5('0x8')](),controller[_0xfcd5('0xb')]);router[_0xfcd5('0x7')](_0xfcd5('0xc'),auth[_0xfcd5('0x8')](),controller[_0xfcd5('0xd')]);var upload=multer({'storage':multer[_0xfcd5('0xe')]({'destination':function(_0x4d8b70,_0xf4666d,_0x54bdfc){_0x54bdfc(null,path[_0xfcd5('0xf')](config[_0xfcd5('0x10')],_0xfcd5('0x11')));},'filename':function(_0x12ee6e,_0xfddbd0,_0x19542a){_0xfddbd0['originalname']=_0xfddbd0[_0xfcd5('0x12')][_0xfcd5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x19542a(null,util['format'](_0xfcd5('0x14'),path['basename'](_0xfddbd0[_0xfcd5('0x12')],path[_0xfcd5('0x15')](_0xfddbd0[_0xfcd5('0x12')])),Date[_0xfcd5('0x16')](),path[_0xfcd5('0x15')](_0xfddbd0[_0xfcd5('0x12')])));}})});router[_0xfcd5('0x17')]('/',upload[_0xfcd5('0x18')]('file'),controller[_0xfcd5('0x19')]);router['put'](_0xfcd5('0xa'),auth[_0xfcd5('0x8')](),controller[_0xfcd5('0x1a')]);router[_0xfcd5('0x1b')](_0xfcd5('0xa'),auth[_0xfcd5('0x8')](),controller[_0xfcd5('0x1b')]);module[_0xfcd5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index bcd3fef..76f6993 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 _0x2b3e=['exports','name','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x9684ae,_0x134461){var _0x6842aa=function(_0x514b2b){while(--_0x514b2b){_0x9684ae['push'](_0x9684ae['shift']());}};_0x6842aa(++_0x134461);}(_0x2b3e,0x1e9));var _0xe2b3=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x2b3e[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0xe2b3('0x0'));module[_0xe2b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe2b3('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe2b3('0x3')]},'display_name':{'type':Sequelize[_0xe2b3('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xe2b3('0x3')]},'original_duration':{'type':Sequelize[_0xe2b3('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe2b3('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe2b3('0x6')]},'converted_format':{'type':Sequelize[_0xe2b3('0x3')]},'converted_duration':{'type':Sequelize[_0xe2b3('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xe2b3('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x009f=['name','STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x12faa4,_0x208ca9){var _0x556fab=function(_0x53e124){while(--_0x53e124){_0x12faa4['push'](_0x12faa4['shift']());}};_0x556fab(++_0x208ca9);}(_0x009f,0x147));var _0xf009=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0x009f[_0x19babd];return _0x314eaf;};'use strict';var Sequelize=require(_0xf009('0x0'));module[_0xf009('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf009('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf009('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf009('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xf009('0x4')]},'original_sampleCount':{'type':Sequelize[_0xf009('0x5')]},'original_channelCount':{'type':Sequelize[_0xf009('0x6')]},'original_bitRate':{'type':Sequelize[_0xf009('0x5')]},'original_sampleRate':{'type':Sequelize[_0xf009('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xf009('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf009('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf009('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index f7079a8..ae7f960 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 _0xc949=['description','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','map','Sound','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','join','format','%s.%s','file','extname','originalname','filename','substring','wav','basename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','error','unlinkSync','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xd501b,_0x570d56){var _0x26a42a=function(_0x10a148){while(--_0x10a148){_0xd501b['push'](_0xd501b['shift']());}};_0x26a42a(++_0x570d56);}(_0xc949,0x1ea));var _0x9c94=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xc949[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require(_0x9c94('0x1'));var zipdir=require(_0x9c94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require(_0x9c94('0x5'));var Mustache=require(_0x9c94('0x6'));var util=require('util');var path=require(_0x9c94('0x7'));var sox=require(_0x9c94('0x8'));var csv=require(_0x9c94('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require(_0x9c94('0xb'));var squel=require('squel');var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x9'));var querystring=require(_0x9c94('0xf'));var Papa=require('papaparse');var Redis=require(_0x9c94('0x10'));var authService=require(_0x9c94('0x11'));var qs=require(_0x9c94('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x13'));var logger=require(_0x9c94('0x14'))(_0x9c94('0x15'));var utils=require(_0x9c94('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9c94('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c9135,_0x4476fc){_0x4476fc=_0x4476fc||0xcc;return function(_0x2b72b3){if(_0x2b72b3){return _0x1c9135[_0x9c94('0x18')](_0x4476fc);}return _0x1c9135[_0x9c94('0x19')](_0x4476fc)[_0x9c94('0x1a')]();};}function respondWithResult(_0x4c7b7f,_0x23200b){_0x23200b=_0x23200b||0xc8;return function(_0x34cbbb){if(_0x34cbbb){return _0x4c7b7f['status'](_0x23200b)[_0x9c94('0x1b')](_0x34cbbb);}};}function respondWithFilteredResult(_0x20ea7d,_0x2e6f11){return function(_0x4f958b){if(_0x4f958b){var _0x4911db=typeof _0x2e6f11[_0x9c94('0x1c')]===_0x9c94('0x1d')&&typeof _0x2e6f11[_0x9c94('0x1e')]===_0x9c94('0x1d');var _0x5184d8=_0x4f958b[_0x9c94('0x1f')];var _0x5939ba=_0x4911db?0x0:_0x2e6f11[_0x9c94('0x1c')];var _0x474e55=_0x4911db?_0x4f958b[_0x9c94('0x1f')]:_0x2e6f11['offset']+_0x2e6f11[_0x9c94('0x1e')];var _0x43ef95;if(_0x474e55>=_0x5184d8){_0x474e55=_0x5184d8;_0x43ef95=0xc8;}else{_0x43ef95=0xce;}_0x20ea7d['status'](_0x43ef95);return _0x20ea7d[_0x9c94('0x20')](_0x9c94('0x21'),_0x5939ba+'-'+_0x474e55+'/'+_0x5184d8)['json'](_0x4f958b);}return null;};}function patchUpdates(_0x45be22){return function(_0x5aee69){try{jsonpatch[_0x9c94('0x22')](_0x5aee69,_0x45be22,!![]);}catch(_0x1a0768){return BPromise[_0x9c94('0x23')](_0x1a0768);}return _0x5aee69[_0x9c94('0x24')]();};}function saveUpdates(_0x329d80,_0x2a2ff9){return function(_0xf51fc4){if(_0xf51fc4){return _0xf51fc4[_0x9c94('0x25')](_0x329d80)[_0x9c94('0x26')](function(_0x1b0dff){return _0x1b0dff;});}return null;};}function removeEntity(_0x3aecf4,_0x49987b){return function(_0x425e0d){if(_0x425e0d){return _0x425e0d[_0x9c94('0x27')]()['then'](function(){var _0x3d1f37=_0x425e0d[_0x9c94('0x28')]({'plain':!![]});var _0x12550a=_0x9c94('0x29');return db[_0x9c94('0x2a')]['destroy']({'where':{'type':_0x12550a,'resourceId':_0x3d1f37['id']}})['then'](function(){return _0x425e0d;});})[_0x9c94('0x26')](function(){_0x3aecf4['status'](0xcc)[_0x9c94('0x1a')]();});}};}function handleEntityNotFound(_0x56c03f,_0x50de1b){return function(_0x62d0ad){if(!_0x62d0ad){_0x56c03f[_0x9c94('0x18')](0x194);}return _0x62d0ad;};}function handleError(_0x39540c,_0x3d006d){_0x3d006d=_0x3d006d||0x1f4;return function(_0x1be615){logger['error'](_0x1be615[_0x9c94('0x2b')]);if(_0x1be615[_0x9c94('0x2c')]){delete _0x1be615['name'];}_0x39540c[_0x9c94('0x19')](_0x3d006d)[_0x9c94('0x2d')](_0x1be615);};}exports['index']=function(_0x429395,_0x1a0318){var _0x87894b={},_0x21f025={},_0x1dc617={'count':0x0,'rows':[]};var _0x4fac27=_[_0x9c94('0x2e')](db[_0x9c94('0x2f')][_0x9c94('0x30')],function(_0x3acc52){return{'name':_0x3acc52['fieldName'],'type':_0x3acc52[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x21f025[_0x9c94('0x33')]=_[_0x9c94('0x2e')](_0x4fac27,_0x9c94('0x2c'));_0x21f025[_0x9c94('0x34')]=_['keys'](_0x429395[_0x9c94('0x34')]);_0x21f025[_0x9c94('0x35')]=_['intersection'](_0x21f025['model'],_0x21f025[_0x9c94('0x34')]);_0x87894b[_0x9c94('0x36')]=_[_0x9c94('0x37')](_0x21f025[_0x9c94('0x33')],qs[_0x9c94('0x38')](_0x429395[_0x9c94('0x34')][_0x9c94('0x38')]));_0x87894b[_0x9c94('0x36')]=_0x87894b[_0x9c94('0x36')]['length']?_0x87894b[_0x9c94('0x36')]:_0x21f025[_0x9c94('0x33')];if(!_0x429395[_0x9c94('0x34')]['hasOwnProperty'](_0x9c94('0x39'))){_0x87894b[_0x9c94('0x1e')]=qs[_0x9c94('0x1e')](_0x429395[_0x9c94('0x34')][_0x9c94('0x1e')]);_0x87894b['offset']=qs[_0x9c94('0x1c')](_0x429395[_0x9c94('0x34')][_0x9c94('0x1c')]);}_0x87894b[_0x9c94('0x3a')]=qs[_0x9c94('0x3b')](_0x429395[_0x9c94('0x34')][_0x9c94('0x3b')]);_0x87894b[_0x9c94('0x3c')]=qs[_0x9c94('0x35')](_[_0x9c94('0x3d')](_0x429395[_0x9c94('0x34')],_0x21f025[_0x9c94('0x35')]),_0x4fac27);if(_0x429395[_0x9c94('0x34')][_0x9c94('0x3e')]){_0x87894b[_0x9c94('0x3c')]=_[_0x9c94('0x3f')](_0x87894b['where'],{'$or':_[_0x9c94('0x2e')](_0x4fac27,function(_0x3ce0b5){if(_0x3ce0b5[_0x9c94('0x31')]!==_0x9c94('0x40')){var _0xc27366={};_0xc27366[_0x3ce0b5[_0x9c94('0x2c')]]={'$like':'%'+_0x429395[_0x9c94('0x34')]['filter']+'%'};return _0xc27366;}})});}_0x87894b=_[_0x9c94('0x3f')]({},_0x87894b,_0x429395[_0x9c94('0x41')]);var _0x1985a9={'where':_0x87894b[_0x9c94('0x3c')]};return db['Sound']['count'](_0x1985a9)[_0x9c94('0x26')](function(_0x4da77c){_0x1dc617[_0x9c94('0x1f')]=_0x4da77c;if(_0x429395['query'][_0x9c94('0x42')]){_0x87894b['include']=[{'all':!![]}];}return db['Sound'][_0x9c94('0x43')](_0x87894b);})[_0x9c94('0x26')](function(_0x37cead){_0x1dc617[_0x9c94('0x44')]=_0x37cead;return _0x1dc617;})[_0x9c94('0x26')](respondWithFilteredResult(_0x1a0318,_0x87894b))[_0x9c94('0x45')](handleError(_0x1a0318,null));};exports[_0x9c94('0x46')]=function(_0x3f28ac,_0xaca0e2){var _0x42b9ac={'raw':!![],'where':{'id':_0x3f28ac[_0x9c94('0x47')]['id']}},_0xe8c7={};_0xe8c7[_0x9c94('0x33')]=_['keys'](db[_0x9c94('0x2f')][_0x9c94('0x30')]);_0xe8c7['query']=_['keys'](_0x3f28ac[_0x9c94('0x34')]);_0xe8c7['filters']=_[_0x9c94('0x37')](_0xe8c7[_0x9c94('0x33')],_0xe8c7[_0x9c94('0x34')]);_0x42b9ac[_0x9c94('0x36')]=_[_0x9c94('0x37')](_0xe8c7['model'],qs[_0x9c94('0x38')](_0x3f28ac['query'][_0x9c94('0x38')]));_0x42b9ac[_0x9c94('0x36')]=_0x42b9ac[_0x9c94('0x36')][_0x9c94('0x48')]?_0x42b9ac['attributes']:_0xe8c7['model'];if(_0x3f28ac['query']['includeAll']){_0x42b9ac[_0x9c94('0x49')]=[{'all':!![]}];}_0x42b9ac=_['merge']({},_0x42b9ac,_0x3f28ac[_0x9c94('0x41')]);return db['Sound'][_0x9c94('0x4a')](_0x42b9ac)['then'](handleEntityNotFound(_0xaca0e2,null))[_0x9c94('0x26')](respondWithResult(_0xaca0e2,null))['catch'](handleError(_0xaca0e2,null));};exports[_0x9c94('0x4b')]=function(_0x10f8a2,_0x3fe96c,_0x3c224c){return db['Sound']['find']({'where':{'id':_0x10f8a2['params']['id']},'attributes':[_0x9c94('0x2c'),_0x9c94('0x4c'),_0x9c94('0x4d')],'raw':!![]})[_0x9c94('0x26')](handleEntityNotFound(_0x3fe96c,null))['then'](function(_0x5bdc2c){if(_0x5bdc2c){if(!fs[_0x9c94('0x4e')](path['join'](config[_0x9c94('0x4f')],_0x9c94('0x50'),_0x5bdc2c['save_name']+'.'+_0x5bdc2c[_0x9c94('0x4d')]))){throw new db['Sequelize'][(_0x9c94('0x51'))]('Sound\x20not\x20found');}return _0x3fe96c['download'](path[_0x9c94('0x52')](config[_0x9c94('0x4f')],_0x9c94('0x50'),util[_0x9c94('0x53')]('%s.%s',_0x5bdc2c['save_name'],_0x5bdc2c['converted_format'])),util[_0x9c94('0x53')](_0x9c94('0x54'),_0x5bdc2c[_0x9c94('0x2c')],_0x5bdc2c[_0x9c94('0x4d')]));}return null;})['catch'](handleError(_0x3fe96c,null));};exports['create']=function(_0x3d61e3,_0x5db2f4,_0x3c63cf){var _0x4abf57={'name':path['basename'](_0x3d61e3[_0x9c94('0x55')]['originalname'],path[_0x9c94('0x56')](_0x3d61e3[_0x9c94('0x55')][_0x9c94('0x57')])),'save_name':path['basename'](_0x3d61e3[_0x9c94('0x55')][_0x9c94('0x58')],path[_0x9c94('0x56')](_0x3d61e3[_0x9c94('0x55')][_0x9c94('0x58')])),'original_format':path[_0x9c94('0x56')](_0x3d61e3[_0x9c94('0x55')]['originalname'])[_0x9c94('0x59')](0x1),'converted_format':_0x9c94('0x5a')};var _0xdb151a=path['join'](config[_0x9c94('0x4f')],'server/files/sounds/original',_0x3d61e3[_0x9c94('0x55')]['filename']);var _0x3dda1f=path['join'](config[_0x9c94('0x4f')],_0x9c94('0x50'),util['format']('%s.%s',path[_0x9c94('0x5b')](_0x3d61e3[_0x9c94('0x55')][_0x9c94('0x58')],path['extname'](_0x3d61e3['file']['filename'])),_0x4abf57[_0x9c94('0x4d')]));logger[_0x9c94('0x5c')](_0x9c94('0x5d'),_0xdb151a);logger[_0x9c94('0x5c')](_0x9c94('0x5e'),_0x3dda1f);try{fs['chmodSync'](_0xdb151a,parseInt('0777',0x8));var _0x1a40d0=sox[_0x9c94('0x5f')](_0xdb151a,_0x3dda1f,{'sampleRate':0x1f40,'format':_0x9c94('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1a40d0['on'](_0x9c94('0x60'),function(_0x631039){fs[_0x9c94('0x61')](_0xdb151a);_0x5db2f4['status'](0x1f4)[_0x9c94('0x2d')](_0x631039);});_0x1a40d0['on']('src',function(_0x65c994){_0x4abf57[_0x9c94('0x62')]=isNaN(_0x65c994[_0x9c94('0x63')])?null:_0x65c994[_0x9c94('0x63')]*0x3e8;_0x4abf57['original_sampleCount']=isNaN(_0x65c994['sampleCount'])?null:_0x65c994[_0x9c94('0x64')];_0x4abf57[_0x9c94('0x65')]=isNaN(_0x65c994[_0x9c94('0x66')])?null:_0x65c994[_0x9c94('0x66')];_0x4abf57[_0x9c94('0x67')]=isNaN(_0x65c994[_0x9c94('0x68')])?null:_0x65c994[_0x9c94('0x68')];_0x4abf57[_0x9c94('0x69')]=isNaN(_0x65c994[_0x9c94('0x6a')])?null:_0x65c994[_0x9c94('0x6a')];});_0x1a40d0['on'](_0x9c94('0x6b'),function(_0xe23060){_0x4abf57[_0x9c94('0x6c')]=isNaN(_0xe23060[_0x9c94('0x63')])?null:_0xe23060[_0x9c94('0x63')]*0x3e8;_0x4abf57[_0x9c94('0x6d')]=isNaN(_0xe23060[_0x9c94('0x64')])?null:_0xe23060['sampleCount'];_0x4abf57['converted_channelCount']=isNaN(_0xe23060[_0x9c94('0x66')])?null:_0xe23060[_0x9c94('0x66')];_0x4abf57[_0x9c94('0x6e')]=isNaN(_0xe23060[_0x9c94('0x68')])?null:_0xe23060['bitRate'];_0x4abf57[_0x9c94('0x6f')]=isNaN(_0xe23060[_0x9c94('0x6a')])?null:_0xe23060[_0x9c94('0x6a')];});_0x1a40d0['on'](_0x9c94('0x1a'),function(){fs[_0x9c94('0x70')](_0x3dda1f,parseInt('0777',0x8));return db['Sound'][_0x9c94('0x71')](_0x4abf57)[_0x9c94('0x26')](function(_0x3ff413){var _0x368b66={'role':_0x3d61e3['body'][_0x9c94('0x72')],'userProfileId':_0x3d61e3[_0x9c94('0x73')][_0x9c94('0x74')]};if(!_0x368b66)throw new Error(_0x9c94('0x75'));if(_0x368b66['role']==='user'){var _0xcbcad7=_0x3ff413['get']({'plain':!![]});return db['UserProfileSection'][_0x9c94('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x368b66[_0x9c94('0x74')]},'raw':!![]})[_0x9c94('0x26')](function(_0x20d8da){if(_0x20d8da&&_0x20d8da[_0x9c94('0x76')]===0x0){return db[_0x9c94('0x2a')][_0x9c94('0x71')]({'name':_0xcbcad7[_0x9c94('0x2c')],'resourceId':_0xcbcad7['id'],'type':_0x20d8da[_0x9c94('0x2c')],'sectionId':_0x20d8da['id']},{})[_0x9c94('0x26')](function(){return _0x3ff413;});}else{return _0x3ff413;}})[_0x9c94('0x45')](function(_0x514378){logger['error'](_0x9c94('0x77'),_0x514378);throw _0x514378;});}return _0x3ff413;})[_0x9c94('0x26')](respondWithResult(_0x5db2f4,null))[_0x9c94('0x45')](handleError(_0x5db2f4,null));});_0x1a40d0['start']();}catch(_0x2088a5){_0x5db2f4['status'](0x1f4)[_0x9c94('0x2d')](_0x2088a5);}};exports['update']=function(_0x4ba9a0,_0x5b4625,_0x1825fa){return db[_0x9c94('0x2f')][_0x9c94('0x4a')]({'where':{'id':_0x4ba9a0[_0x9c94('0x47')]['id']}})[_0x9c94('0x26')](handleEntityNotFound(_0x5b4625,null))[_0x9c94('0x26')](saveUpdates(_[_0x9c94('0x3d')](_0x4ba9a0[_0x9c94('0x73')],[_0x9c94('0x2c'),_0x9c94('0x78')]),null))[_0x9c94('0x26')](respondWithResult(_0x5b4625,null))[_0x9c94('0x45')](handleError(_0x5b4625,null));};exports['delete']=function(_0x3a5c50,_0x5493ca,_0x5ac525){return db[_0x9c94('0x2f')][_0x9c94('0x4a')]({'where':{'id':_0x3a5c50[_0x9c94('0x47')]['id']}})['then'](function(_0x2ce887){if(_0x2ce887){return _0x2ce887[_0x9c94('0x27')]();}})[_0x9c94('0x26')](function(_0x354a98){var _0x4dc76f=path['join'](config[_0x9c94('0x4f')],'server/files/sounds/original',util[_0x9c94('0x53')](_0x9c94('0x54'),_0x354a98['save_name'],_0x354a98[_0x9c94('0x79')]));var _0x188972=path[_0x9c94('0x52')](config['root'],_0x9c94('0x50'),util[_0x9c94('0x53')](_0x9c94('0x54'),_0x354a98[_0x9c94('0x4c')],_0x354a98[_0x9c94('0x4d')]));fs[_0x9c94('0x61')](_0x4dc76f);fs[_0x9c94('0x61')](_0x188972);return _0x354a98;})[_0x9c94('0x26')](function(_0x3cbff4){if(_0x3cbff4){return _0x5493ca[_0x9c94('0x19')](0xcc)[_0x9c94('0x1a')]();}})[_0x9c94('0x26')](handleEntityNotFound(_0x5493ca,null))[_0x9c94('0x45')](handleError(_0x5493ca,null));}; \ No newline at end of file +var _0xbaf2=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','Sound','fields','include','find','download','params','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map'];(function(_0x5d0ef0,_0x1afa61){var _0x4d1913=function(_0x491be4){while(--_0x491be4){_0x5d0ef0['push'](_0x5d0ef0['shift']());}};_0x4d1913(++_0x1afa61);}(_0xbaf2,0x1e8));var _0x2baf=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbaf2[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x2baf('0x0'));var rimraf=require(_0x2baf('0x1'));var zipdir=require(_0x2baf('0x2'));var jsonpatch=require(_0x2baf('0x3'));var rp=require(_0x2baf('0x4'));var moment=require('moment');var BPromise=require(_0x2baf('0x5'));var Mustache=require(_0x2baf('0x6'));var util=require(_0x2baf('0x7'));var path=require(_0x2baf('0x8'));var sox=require(_0x2baf('0x9'));var csv=require('to-csv');var ejs=require(_0x2baf('0xa'));var fs=require('fs');var fs_extra=require(_0x2baf('0xb'));var _=require(_0x2baf('0xc'));var squel=require(_0x2baf('0xd'));var crypto=require(_0x2baf('0xe'));var jsforce=require(_0x2baf('0xf'));var deskjs=require(_0x2baf('0x10'));var toCsv=require(_0x2baf('0x11'));var querystring=require('querystring');var Papa=require(_0x2baf('0x12'));var Redis=require(_0x2baf('0x13'));var authService=require(_0x2baf('0x14'));var qs=require(_0x2baf('0x15'));var as=require(_0x2baf('0x16'));var hardwareService=require(_0x2baf('0x17'));var logger=require(_0x2baf('0x18'))(_0x2baf('0x19'));var utils=require(_0x2baf('0x1a'));var config=require(_0x2baf('0x1b'));var licenseUtil=require(_0x2baf('0x1c'));var db=require(_0x2baf('0x1d'))['db'];function respondWithStatusCode(_0x5e0cd0,_0x49f5dc){_0x49f5dc=_0x49f5dc||0xcc;return function(_0x3787b0){if(_0x3787b0){return _0x5e0cd0[_0x2baf('0x1e')](_0x49f5dc);}return _0x5e0cd0['status'](_0x49f5dc)[_0x2baf('0x1f')]();};}function respondWithResult(_0x52dbf6,_0x51312d){_0x51312d=_0x51312d||0xc8;return function(_0x27567a){if(_0x27567a){return _0x52dbf6[_0x2baf('0x20')](_0x51312d)[_0x2baf('0x21')](_0x27567a);}};}function respondWithFilteredResult(_0x428b42,_0x321ed7){return function(_0x3437aa){if(_0x3437aa){var _0x28dd25=typeof _0x321ed7[_0x2baf('0x22')]==='undefined'&&typeof _0x321ed7['limit']==='undefined';var _0x448a5c=_0x3437aa[_0x2baf('0x23')];var _0x5621b0=_0x28dd25?0x0:_0x321ed7[_0x2baf('0x22')];var _0x1995e6=_0x28dd25?_0x3437aa[_0x2baf('0x23')]:_0x321ed7['offset']+_0x321ed7['limit'];var _0x3f1ca;if(_0x1995e6>=_0x448a5c){_0x1995e6=_0x448a5c;_0x3f1ca=0xc8;}else{_0x3f1ca=0xce;}_0x428b42[_0x2baf('0x20')](_0x3f1ca);return _0x428b42['set']('Content-Range',_0x5621b0+'-'+_0x1995e6+'/'+_0x448a5c)[_0x2baf('0x21')](_0x3437aa);}return null;};}function patchUpdates(_0x13a28c){return function(_0x527c3b){try{jsonpatch[_0x2baf('0x24')](_0x527c3b,_0x13a28c,!![]);}catch(_0x92180f){return BPromise['reject'](_0x92180f);}return _0x527c3b[_0x2baf('0x25')]();};}function saveUpdates(_0x189c7d,_0x3790fe){return function(_0x33e11f){if(_0x33e11f){return _0x33e11f[_0x2baf('0x26')](_0x189c7d)[_0x2baf('0x27')](function(_0x2c36a1){return _0x2c36a1;});}return null;};}function removeEntity(_0x85cf49,_0x4369ae){return function(_0x276883){if(_0x276883){return _0x276883[_0x2baf('0x28')]()[_0x2baf('0x27')](function(){var _0x199d91=_0x276883['get']({'plain':!![]});var _0x3194b8='Sounds';return db[_0x2baf('0x29')]['destroy']({'where':{'type':_0x3194b8,'resourceId':_0x199d91['id']}})[_0x2baf('0x27')](function(){return _0x276883;});})[_0x2baf('0x27')](function(){_0x85cf49[_0x2baf('0x20')](0xcc)[_0x2baf('0x1f')]();});}};}function handleEntityNotFound(_0x570686,_0x4aec2f){return function(_0x50a8a8){if(!_0x50a8a8){_0x570686[_0x2baf('0x1e')](0x194);}return _0x50a8a8;};}function handleError(_0x9e196,_0xf89f31){_0xf89f31=_0xf89f31||0x1f4;return function(_0x23c482){logger[_0x2baf('0x2a')](_0x23c482[_0x2baf('0x2b')]);if(_0x23c482[_0x2baf('0x2c')]){delete _0x23c482['name'];}_0x9e196[_0x2baf('0x20')](_0xf89f31)[_0x2baf('0x2d')](_0x23c482);};}exports[_0x2baf('0x2e')]=function(_0x4d6da1,_0x4dfdad){var _0x34358a={},_0x2fbb9e={},_0x4ce689={'count':0x0,'rows':[]};var _0x89bdee=_[_0x2baf('0x2f')](db['Sound'][_0x2baf('0x30')],function(_0x246f28){return{'name':_0x246f28[_0x2baf('0x31')],'type':_0x246f28[_0x2baf('0x32')][_0x2baf('0x33')]};});_0x2fbb9e[_0x2baf('0x34')]=_['map'](_0x89bdee,_0x2baf('0x2c'));_0x2fbb9e[_0x2baf('0x35')]=_[_0x2baf('0x36')](_0x4d6da1[_0x2baf('0x35')]);_0x2fbb9e[_0x2baf('0x37')]=_[_0x2baf('0x38')](_0x2fbb9e['model'],_0x2fbb9e[_0x2baf('0x35')]);_0x34358a[_0x2baf('0x39')]=_[_0x2baf('0x38')](_0x2fbb9e[_0x2baf('0x34')],qs['fields'](_0x4d6da1['query']['fields']));_0x34358a[_0x2baf('0x39')]=_0x34358a[_0x2baf('0x39')][_0x2baf('0x3a')]?_0x34358a[_0x2baf('0x39')]:_0x2fbb9e[_0x2baf('0x34')];if(!_0x4d6da1['query']['hasOwnProperty'](_0x2baf('0x3b'))){_0x34358a[_0x2baf('0x3c')]=qs[_0x2baf('0x3c')](_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x3c')]);_0x34358a[_0x2baf('0x22')]=qs[_0x2baf('0x22')](_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x22')]);}_0x34358a[_0x2baf('0x3d')]=qs[_0x2baf('0x3e')](_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x3e')]);_0x34358a[_0x2baf('0x3f')]=qs[_0x2baf('0x37')](_[_0x2baf('0x40')](_0x4d6da1[_0x2baf('0x35')],_0x2fbb9e[_0x2baf('0x37')]),_0x89bdee);if(_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x41')]){_0x34358a[_0x2baf('0x3f')]=_[_0x2baf('0x42')](_0x34358a[_0x2baf('0x3f')],{'$or':_[_0x2baf('0x2f')](_0x89bdee,function(_0xd6ea79){if(_0xd6ea79[_0x2baf('0x32')]!==_0x2baf('0x43')){var _0x583592={};_0x583592[_0xd6ea79[_0x2baf('0x2c')]]={'$like':'%'+_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x41')]+'%'};return _0x583592;}})});}_0x34358a=_['merge']({},_0x34358a,_0x4d6da1[_0x2baf('0x44')]);var _0x5f4281={'where':_0x34358a[_0x2baf('0x3f')]};return db['Sound'][_0x2baf('0x23')](_0x5f4281)[_0x2baf('0x27')](function(_0x145af9){_0x4ce689[_0x2baf('0x23')]=_0x145af9;if(_0x4d6da1[_0x2baf('0x35')][_0x2baf('0x45')]){_0x34358a['include']=[{'all':!![]}];}return db['Sound']['findAll'](_0x34358a);})[_0x2baf('0x27')](function(_0x168913){_0x4ce689[_0x2baf('0x46')]=_0x168913;return _0x4ce689;})['then'](respondWithFilteredResult(_0x4dfdad,_0x34358a))[_0x2baf('0x47')](handleError(_0x4dfdad,null));};exports[_0x2baf('0x48')]=function(_0x5603f1,_0x177b39){var _0x5765b2={'raw':!![],'where':{'id':_0x5603f1['params']['id']}},_0x44c877={};_0x44c877[_0x2baf('0x34')]=_[_0x2baf('0x36')](db[_0x2baf('0x49')]['rawAttributes']);_0x44c877[_0x2baf('0x35')]=_['keys'](_0x5603f1[_0x2baf('0x35')]);_0x44c877[_0x2baf('0x37')]=_[_0x2baf('0x38')](_0x44c877[_0x2baf('0x34')],_0x44c877['query']);_0x5765b2['attributes']=_['intersection'](_0x44c877[_0x2baf('0x34')],qs[_0x2baf('0x4a')](_0x5603f1[_0x2baf('0x35')][_0x2baf('0x4a')]));_0x5765b2[_0x2baf('0x39')]=_0x5765b2['attributes'][_0x2baf('0x3a')]?_0x5765b2[_0x2baf('0x39')]:_0x44c877[_0x2baf('0x34')];if(_0x5603f1[_0x2baf('0x35')][_0x2baf('0x45')]){_0x5765b2[_0x2baf('0x4b')]=[{'all':!![]}];}_0x5765b2=_[_0x2baf('0x42')]({},_0x5765b2,_0x5603f1[_0x2baf('0x44')]);return db[_0x2baf('0x49')][_0x2baf('0x4c')](_0x5765b2)['then'](handleEntityNotFound(_0x177b39,null))[_0x2baf('0x27')](respondWithResult(_0x177b39,null))[_0x2baf('0x47')](handleError(_0x177b39,null));};exports[_0x2baf('0x4d')]=function(_0x1ae3d7,_0x4db8a8,_0x44b4bb){return db[_0x2baf('0x49')][_0x2baf('0x4c')]({'where':{'id':_0x1ae3d7[_0x2baf('0x4e')]['id']},'attributes':[_0x2baf('0x2c'),_0x2baf('0x4f'),'converted_format'],'raw':!![]})[_0x2baf('0x27')](handleEntityNotFound(_0x4db8a8,null))[_0x2baf('0x27')](function(_0x38ea9c){if(_0x38ea9c){if(!fs[_0x2baf('0x50')](path[_0x2baf('0x51')](config[_0x2baf('0x52')],_0x2baf('0x53'),_0x38ea9c[_0x2baf('0x4f')]+'.'+_0x38ea9c[_0x2baf('0x54')]))){throw new db[(_0x2baf('0x55'))][(_0x2baf('0x56'))](_0x2baf('0x57'));}return _0x4db8a8[_0x2baf('0x4d')](path[_0x2baf('0x51')](config[_0x2baf('0x52')],_0x2baf('0x53'),util[_0x2baf('0x58')](_0x2baf('0x59'),_0x38ea9c[_0x2baf('0x4f')],_0x38ea9c['converted_format'])),util[_0x2baf('0x58')]('%s.%s',_0x38ea9c[_0x2baf('0x2c')],_0x38ea9c[_0x2baf('0x54')]));}return null;})[_0x2baf('0x47')](handleError(_0x4db8a8,null));};exports[_0x2baf('0x5a')]=function(_0x2e151a,_0x2cbe6d,_0x45c803){var _0x2835a9={'name':path['basename'](_0x2e151a[_0x2baf('0x5b')][_0x2baf('0x5c')],path[_0x2baf('0x5d')](_0x2e151a['file'][_0x2baf('0x5c')])),'save_name':path[_0x2baf('0x5e')](_0x2e151a[_0x2baf('0x5b')][_0x2baf('0x5f')],path[_0x2baf('0x5d')](_0x2e151a[_0x2baf('0x5b')][_0x2baf('0x5f')])),'original_format':path[_0x2baf('0x5d')](_0x2e151a[_0x2baf('0x5b')][_0x2baf('0x5c')])[_0x2baf('0x60')](0x1),'converted_format':_0x2baf('0x61')};var _0x3dd68d=path['join'](config[_0x2baf('0x52')],_0x2baf('0x62'),_0x2e151a['file'][_0x2baf('0x5f')]);var _0x563910=path[_0x2baf('0x51')](config['root'],_0x2baf('0x53'),util[_0x2baf('0x58')](_0x2baf('0x59'),path[_0x2baf('0x5e')](_0x2e151a[_0x2baf('0x5b')]['filename'],path[_0x2baf('0x5d')](_0x2e151a[_0x2baf('0x5b')][_0x2baf('0x5f')])),_0x2835a9[_0x2baf('0x54')]));logger[_0x2baf('0x63')]('Sound\x20upload\x20filepath:\x20%s',_0x3dd68d);logger['info'](_0x2baf('0x64'),_0x563910);try{fs[_0x2baf('0x65')](_0x3dd68d,parseInt(_0x2baf('0x66'),0x8));var _0x205ccc=sox[_0x2baf('0x67')](_0x3dd68d,_0x563910,{'sampleRate':0x1f40,'format':_0x2baf('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x205ccc['on'](_0x2baf('0x2a'),function(_0x1b7ce8){fs[_0x2baf('0x68')](_0x3dd68d);_0x2cbe6d[_0x2baf('0x20')](0x1f4)[_0x2baf('0x2d')](_0x1b7ce8);});_0x205ccc['on'](_0x2baf('0x69'),function(_0x3ff300){_0x2835a9[_0x2baf('0x6a')]=isNaN(_0x3ff300[_0x2baf('0x6b')])?null:_0x3ff300['duration']*0x3e8;_0x2835a9[_0x2baf('0x6c')]=isNaN(_0x3ff300[_0x2baf('0x6d')])?null:_0x3ff300[_0x2baf('0x6d')];_0x2835a9[_0x2baf('0x6e')]=isNaN(_0x3ff300['channelCount'])?null:_0x3ff300[_0x2baf('0x6f')];_0x2835a9['original_bitRate']=isNaN(_0x3ff300['bitRate'])?null:_0x3ff300['bitRate'];_0x2835a9[_0x2baf('0x70')]=isNaN(_0x3ff300[_0x2baf('0x71')])?null:_0x3ff300[_0x2baf('0x71')];});_0x205ccc['on'](_0x2baf('0x72'),function(_0x57adc3){_0x2835a9[_0x2baf('0x73')]=isNaN(_0x57adc3[_0x2baf('0x6b')])?null:_0x57adc3['duration']*0x3e8;_0x2835a9[_0x2baf('0x74')]=isNaN(_0x57adc3[_0x2baf('0x6d')])?null:_0x57adc3['sampleCount'];_0x2835a9[_0x2baf('0x75')]=isNaN(_0x57adc3[_0x2baf('0x6f')])?null:_0x57adc3[_0x2baf('0x6f')];_0x2835a9[_0x2baf('0x76')]=isNaN(_0x57adc3[_0x2baf('0x77')])?null:_0x57adc3[_0x2baf('0x77')];_0x2835a9[_0x2baf('0x78')]=isNaN(_0x57adc3[_0x2baf('0x71')])?null:_0x57adc3[_0x2baf('0x71')];});_0x205ccc['on'](_0x2baf('0x1f'),function(){fs[_0x2baf('0x65')](_0x563910,parseInt(_0x2baf('0x66'),0x8));return db[_0x2baf('0x49')][_0x2baf('0x5a')](_0x2835a9)['then'](function(_0x32cd86){var _0x17408a={'role':_0x2e151a[_0x2baf('0x79')][_0x2baf('0x7a')],'userProfileId':_0x2e151a[_0x2baf('0x79')][_0x2baf('0x7b')]};if(!_0x17408a)throw new Error(_0x2baf('0x7c'));if(_0x17408a['role']===_0x2baf('0x7d')){var _0x47ff04=_0x32cd86['get']({'plain':!![]});return db[_0x2baf('0x7e')][_0x2baf('0x4c')]({'where':{'name':_0x2baf('0x7f'),'userProfileId':_0x17408a[_0x2baf('0x7b')]},'raw':!![]})['then'](function(_0x2dd281){if(_0x2dd281&&_0x2dd281[_0x2baf('0x80')]===0x0){return db['UserProfileResource'][_0x2baf('0x5a')]({'name':_0x47ff04[_0x2baf('0x2c')],'resourceId':_0x47ff04['id'],'type':_0x2dd281['name'],'sectionId':_0x2dd281['id']},{})[_0x2baf('0x27')](function(){return _0x32cd86;});}else{return _0x32cd86;}})[_0x2baf('0x47')](function(_0x5f4b8e){logger[_0x2baf('0x2a')](_0x2baf('0x81'),_0x5f4b8e);throw _0x5f4b8e;});}return _0x32cd86;})[_0x2baf('0x27')](respondWithResult(_0x2cbe6d,null))[_0x2baf('0x47')](handleError(_0x2cbe6d,null));});_0x205ccc[_0x2baf('0x82')]();}catch(_0x41daba){_0x2cbe6d[_0x2baf('0x20')](0x1f4)[_0x2baf('0x2d')](_0x41daba);}};exports[_0x2baf('0x26')]=function(_0x209c82,_0x4c694b,_0x22bf01){return db[_0x2baf('0x49')]['find']({'where':{'id':_0x209c82['params']['id']}})['then'](handleEntityNotFound(_0x4c694b,null))['then'](saveUpdates(_[_0x2baf('0x40')](_0x209c82[_0x2baf('0x79')],[_0x2baf('0x2c'),_0x2baf('0x83')]),null))['then'](respondWithResult(_0x4c694b,null))[_0x2baf('0x47')](handleError(_0x4c694b,null));};exports[_0x2baf('0x84')]=function(_0x18f472,_0x3dbc03,_0x492cf7){return db['Sound'][_0x2baf('0x4c')]({'where':{'id':_0x18f472[_0x2baf('0x4e')]['id']}})[_0x2baf('0x27')](function(_0x3e2f02){if(_0x3e2f02){return _0x3e2f02[_0x2baf('0x28')]();}})[_0x2baf('0x27')](function(_0x542819){var _0x3be593=path['join'](config[_0x2baf('0x52')],'server/files/sounds/original',util[_0x2baf('0x58')](_0x2baf('0x59'),_0x542819[_0x2baf('0x4f')],_0x542819[_0x2baf('0x85')]));var _0x681a8d=path[_0x2baf('0x51')](config[_0x2baf('0x52')],_0x2baf('0x53'),util[_0x2baf('0x58')](_0x2baf('0x59'),_0x542819[_0x2baf('0x4f')],_0x542819[_0x2baf('0x54')]));fs['unlinkSync'](_0x3be593);fs[_0x2baf('0x68')](_0x681a8d);return _0x542819;})['then'](function(_0x19dd62){if(_0x19dd62){return _0x3dbc03['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x3dbc03,null))[_0x2baf('0x47')](handleError(_0x3dbc03,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 944b923..5b1af7d 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 _0x06c4=['./sound.attributes','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0x06c4,0x1b1));var _0x406c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06c4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x406c('0x0'));var util=require(_0x406c('0x1'));var logger=require(_0x406c('0x2'))(_0x406c('0x3'));var moment=require(_0x406c('0x4'));var BPromise=require(_0x406c('0x5'));var rp=require(_0x406c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x406c('0x7'));module[_0x406c('0x8')]=function(_0x2b8b17,_0x5da049){return _0x2b8b17['define'](_0x406c('0x9'),attributes,{'tableName':_0x406c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbd51,0x178));var _0x1bd5=function(_0x13cec9,_0x1b6d2c){_0x13cec9=_0x13cec9-0x0;var _0x12f2eb=_0xbd51[_0x13cec9];return _0x12f2eb;};'use strict';var _=require('lodash');var util=require(_0x1bd5('0x0'));var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require(_0x1bd5('0x5'));var fs=require('fs');var path=require(_0x1bd5('0x6'));var rimraf=require('rimraf');var config=require(_0x1bd5('0x7'));var attributes=require(_0x1bd5('0x8'));module[_0x1bd5('0x9')]=function(_0x48c807,_0x4bcf3e){return _0x48c807[_0x1bd5('0xa')](_0x1bd5('0xb'),attributes,{'tableName':_0x1bd5('0xc'),'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 0672d65..003c880 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 _0xfe15=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','include','map','model','attributes','debug','util','moment','bluebird'];(function(_0x2bd34b,_0x386a38){var _0xc84fb=function(_0x2f3346){while(--_0x2f3346){_0x2bd34b['push'](_0x2bd34b['shift']());}};_0xc84fb(++_0x386a38);}(_0xfe15,0x189));var _0x5fe1=function(_0xb373c6,_0x352111){_0xb373c6=_0xb373c6-0x0;var _0x423dcb=_0xfe15[_0xb373c6];return _0x423dcb;};'use strict';var _=require('lodash');var util=require(_0x5fe1('0x0'));var moment=require(_0x5fe1('0x1'));var BPromise=require(_0x5fe1('0x2'));var rs=require(_0x5fe1('0x3'));var fs=require('fs');var Redis=require(_0x5fe1('0x4'));var db=require(_0x5fe1('0x5'))['db'];var utils=require(_0x5fe1('0x6'));var logger=require(_0x5fe1('0x7'))(_0x5fe1('0x8'));var config=require('../../config/environment');var jayson=require(_0x5fe1('0x9'));var client=jayson[_0x5fe1('0xa')][_0x5fe1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c8010,_0x40fcfd,_0x3cb89a){return new BPromise(function(_0x5f55b4,_0x951c7c){return client['request'](_0x3c8010,_0x3cb89a)[_0x5fe1('0xc')](function(_0x5366b9){logger[_0x5fe1('0xd')](_0x5fe1('0xe'),_0x40fcfd,_0x5fe1('0xf'));logger['debug'](_0x5fe1('0x10'),_0x40fcfd,'request\x20sent',JSON[_0x5fe1('0x11')](_0x5366b9));if(_0x5366b9['error']){if(_0x5366b9[_0x5fe1('0x12')][_0x5fe1('0x13')]===0x1f4){logger['error'](_0x5fe1('0xe'),_0x40fcfd,_0x5366b9[_0x5fe1('0x12')][_0x5fe1('0x14')]);return _0x951c7c(_0x5366b9['error']['message']);}logger['error'](_0x5fe1('0xe'),_0x40fcfd,_0x5366b9[_0x5fe1('0x12')][_0x5fe1('0x14')]);return _0x5f55b4(_0x5366b9[_0x5fe1('0x12')][_0x5fe1('0x14')]);}else{logger['info'](_0x5fe1('0xe'),_0x40fcfd,_0x5fe1('0xf'));_0x5f55b4(_0x5366b9[_0x5fe1('0x15')][_0x5fe1('0x14')]);}})[_0x5fe1('0x16')](function(_0xc84f0c){logger[_0x5fe1('0x12')](_0x5fe1('0xe'),_0x40fcfd,_0xc84f0c);_0x951c7c(_0xc84f0c);});});}exports[_0x5fe1('0x17')]=function(_0x5d0e3f){var _0x3c9725=this;return new Promise(function(_0x20160c,_0x5b3a34){return db[_0x5fe1('0x18')][_0x5fe1('0x19')]({'raw':_0x5d0e3f[_0x5fe1('0x1a')]?_0x5d0e3f['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d0e3f[_0x5fe1('0x1a')]?_0x5d0e3f['options'][_0x5fe1('0x1b')]||null:null,'attributes':_0x5d0e3f['options']?_0x5d0e3f[_0x5fe1('0x1a')]['attributes']||null:null,'include':_0x5d0e3f[_0x5fe1('0x1a')]?_0x5d0e3f[_0x5fe1('0x1a')][_0x5fe1('0x1c')]?_[_0x5fe1('0x1d')](_0x5d0e3f[_0x5fe1('0x1a')][_0x5fe1('0x1c')],function(_0x151e59){return{'model':db[_0x151e59['model']],'as':_0x151e59['as'],'attributes':_0x151e59['attributes'],'include':_0x151e59[_0x5fe1('0x1c')]?_[_0x5fe1('0x1d')](_0x151e59[_0x5fe1('0x1c')],function(_0x1f9529){return{'model':db[_0x1f9529[_0x5fe1('0x1e')]],'as':_0x1f9529['as'],'attributes':_0x1f9529['attributes'],'include':_0x1f9529[_0x5fe1('0x1c')]?_[_0x5fe1('0x1d')](_0x1f9529[_0x5fe1('0x1c')],function(_0xa5316b){return{'model':db[_0xa5316b[_0x5fe1('0x1e')]],'as':_0xa5316b['as'],'attributes':_0xa5316b[_0x5fe1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5fe1('0xc')](function(_0x3c9a4a){logger[_0x5fe1('0xd')](_0x5fe1('0x17'),_0x5d0e3f);logger[_0x5fe1('0x20')]('ShowSound',_0x5d0e3f,JSON[_0x5fe1('0x11')](_0x3c9a4a));_0x20160c(_0x3c9a4a);})['catch'](function(_0x1d254a){logger[_0x5fe1('0x12')](_0x5fe1('0x17'),_0x1d254a[_0x5fe1('0x14')],_0x5d0e3f);_0x5b3a34(_0x3c9725[_0x5fe1('0x12')](0x1f4,_0x1d254a[_0x5fe1('0x14')]));});});}; \ No newline at end of file +var _0x91a3=['include','model','map','ShowSound','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Sound','find','options','raw','where','attributes'];(function(_0xc0e886,_0x82fc99){var _0x3b2a2e=function(_0x4345b5){while(--_0x4345b5){_0xc0e886['push'](_0xc0e886['shift']());}};_0x3b2a2e(++_0x82fc99);}(_0x91a3,0x17b));var _0x391a=function(_0x275693,_0x4aba00){_0x275693=_0x275693-0x0;var _0x52bd6a=_0x91a3[_0x275693];return _0x52bd6a;};'use strict';var _=require(_0x391a('0x0'));var util=require(_0x391a('0x1'));var moment=require(_0x391a('0x2'));var BPromise=require(_0x391a('0x3'));var rs=require(_0x391a('0x4'));var fs=require('fs');var Redis=require(_0x391a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x391a('0x6'))(_0x391a('0x7'));var config=require(_0x391a('0x8'));var jayson=require(_0x391a('0x9'));var client=jayson[_0x391a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c52c6,_0x38aa11,_0xac0bad){return new BPromise(function(_0x3077ca,_0x3ec428){return client[_0x391a('0xb')](_0x2c52c6,_0xac0bad)[_0x391a('0xc')](function(_0x62672f){logger[_0x391a('0xd')](_0x391a('0xe'),_0x38aa11,_0x391a('0xf'));logger[_0x391a('0x10')](_0x391a('0x11'),_0x38aa11,'request\x20sent',JSON['stringify'](_0x62672f));if(_0x62672f['error']){if(_0x62672f[_0x391a('0x12')][_0x391a('0x13')]===0x1f4){logger[_0x391a('0x12')](_0x391a('0xe'),_0x38aa11,_0x62672f['error']['message']);return _0x3ec428(_0x62672f[_0x391a('0x12')][_0x391a('0x14')]);}logger['error'](_0x391a('0xe'),_0x38aa11,_0x62672f[_0x391a('0x12')][_0x391a('0x14')]);return _0x3077ca(_0x62672f[_0x391a('0x12')][_0x391a('0x14')]);}else{logger[_0x391a('0xd')](_0x391a('0xe'),_0x38aa11,_0x391a('0xf'));_0x3077ca(_0x62672f[_0x391a('0x15')][_0x391a('0x14')]);}})[_0x391a('0x16')](function(_0x4c2ba2){logger['error'](_0x391a('0xe'),_0x38aa11,_0x4c2ba2);_0x3ec428(_0x4c2ba2);});});}exports['ShowSound']=function(_0x2b6cd9){var _0x4079cb=this;return new Promise(function(_0x53933b,_0x4d90c0){return db[_0x391a('0x17')][_0x391a('0x18')]({'raw':_0x2b6cd9[_0x391a('0x19')]?_0x2b6cd9[_0x391a('0x19')][_0x391a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b6cd9[_0x391a('0x19')]?_0x2b6cd9[_0x391a('0x19')][_0x391a('0x1b')]||null:null,'attributes':_0x2b6cd9['options']?_0x2b6cd9[_0x391a('0x19')][_0x391a('0x1c')]||null:null,'include':_0x2b6cd9[_0x391a('0x19')]?_0x2b6cd9['options'][_0x391a('0x1d')]?_['map'](_0x2b6cd9[_0x391a('0x19')][_0x391a('0x1d')],function(_0x1944b1){return{'model':db[_0x1944b1[_0x391a('0x1e')]],'as':_0x1944b1['as'],'attributes':_0x1944b1[_0x391a('0x1c')],'include':_0x1944b1[_0x391a('0x1d')]?_['map'](_0x1944b1[_0x391a('0x1d')],function(_0x497365){return{'model':db[_0x497365['model']],'as':_0x497365['as'],'attributes':_0x497365[_0x391a('0x1c')],'include':_0x497365[_0x391a('0x1d')]?_[_0x391a('0x1f')](_0x497365[_0x391a('0x1d')],function(_0x4be672){return{'model':db[_0x4be672[_0x391a('0x1e')]],'as':_0x4be672['as'],'attributes':_0x4be672[_0x391a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x391a('0xc')](function(_0x334bbc){logger[_0x391a('0xd')](_0x391a('0x20'),_0x2b6cd9);logger[_0x391a('0x10')](_0x391a('0x20'),_0x2b6cd9,JSON[_0x391a('0x21')](_0x334bbc));_0x53933b(_0x334bbc);})[_0x391a('0x16')](function(_0x19f6ba){logger[_0x391a('0x12')](_0x391a('0x20'),_0x19f6ba[_0x391a('0x14')],_0x2b6cd9);_0x4d90c0(_0x4079cb['error'](0x1f4,_0x19f6ba[_0x391a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 010f9ff..c0fe0e5 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3f4b7d,_0x76a726){var _0x28ac2e=function(_0x38a7c2){while(--_0x38a7c2){_0x3f4b7d['push'](_0x3f4b7d['shift']());}};_0x28ac2e(++_0x76a726);}(_0xac4a,0x13f));var _0xaac4=function(_0x34e183,_0x1fda99){_0x34e183=_0x34e183-0x0;var _0x5b4ac2=_0xac4a[_0x34e183];return _0x5b4ac2;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x109498,_0x303436){var _0x443a5e=function(_0x496f86){while(--_0x496f86){_0x109498['push'](_0x109498['shift']());}};_0x443a5e(++_0x303436);}(_0x757a,0xde));var _0xa757=function(_0x554866,_0x30f037){_0x554866=_0x554866-0x0;var _0x29ce6d=_0x757a[_0x554866];return _0x29ce6d;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1aa019b..7b36fcc 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 _0x3171=['ENUM','sequelize','exports','STRING','TEXT','medium'];(function(_0x276de9,_0x2c2f75){var _0xbac321=function(_0x3ebcfd){while(--_0x3ebcfd){_0x276de9['push'](_0x276de9['shift']());}};_0xbac321(++_0x2c2f75);}(_0x3171,0x8b));var _0x1317=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x3171[_0xbeb808];return _0x5d6909;};'use strict';var Sequelize=require(_0x1317('0x0'));module[_0x1317('0x1')]={'uniqueid':{'type':Sequelize[_0x1317('0x2')]},'body':{'type':Sequelize[_0x1317('0x3')](_0x1317('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x1317('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x1317('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa349=['TEXT','medium','ENUM','out','exports'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xa349,0x8b));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9a34('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9a34('0x1')](_0x9a34('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x9a34('0x3')]('in',_0x9a34('0x4')),'defaultValue':_0x9a34('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9a34('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c8d8bd5..4ec89bc 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 _0xdc9c=['intersection','fields','length','hasOwnProperty','where','filters','pick','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','create','body','find','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','keys','query','attributes'];(function(_0x47b388,_0x1e042c){var _0x431fc6=function(_0x573e9b){while(--_0x573e9b){_0x47b388['push'](_0x47b388['shift']());}};_0x431fc6(++_0x1e042c);}(_0xdc9c,0xe2));var _0xcdc9=function(_0x5c3699,_0x258c24){_0x5c3699=_0x5c3699-0x0;var _0x6c318c=_0xdc9c[_0x5c3699];return _0x6c318c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdc9('0x0'));var rp=require('request-promise');var moment=require(_0xcdc9('0x1'));var BPromise=require(_0xcdc9('0x2'));var Mustache=require(_0xcdc9('0x3'));var util=require(_0xcdc9('0x4'));var path=require('path');var sox=require(_0xcdc9('0x5'));var csv=require('to-csv');var ejs=require(_0xcdc9('0x6'));var fs=require('fs');var fs_extra=require(_0xcdc9('0x7'));var _=require(_0xcdc9('0x8'));var squel=require(_0xcdc9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcdc9('0xa'));var Papa=require(_0xcdc9('0xb'));var Redis=require(_0xcdc9('0xc'));var authService=require(_0xcdc9('0xd'));var qs=require(_0xcdc9('0xe'));var as=require(_0xcdc9('0xf'));var hardwareService=require(_0xcdc9('0x10'));var logger=require(_0xcdc9('0x11'))(_0xcdc9('0x12'));var utils=require('../../config/utils');var config=require(_0xcdc9('0x13'));var licenseUtil=require(_0xcdc9('0x14'));var db=require(_0xcdc9('0x15'))['db'];function respondWithStatusCode(_0x55d625,_0x255532){_0x255532=_0x255532||0xcc;return function(_0x11f0e2){if(_0x11f0e2){return _0x55d625[_0xcdc9('0x16')](_0x255532);}return _0x55d625[_0xcdc9('0x17')](_0x255532)[_0xcdc9('0x18')]();};}function respondWithResult(_0x1df9a8,_0x2559dd){_0x2559dd=_0x2559dd||0xc8;return function(_0x397d1e){if(_0x397d1e){return _0x1df9a8[_0xcdc9('0x17')](_0x2559dd)[_0xcdc9('0x19')](_0x397d1e);}};}function respondWithFilteredResult(_0x1df8e6,_0x35303a){return function(_0x100f89){if(_0x100f89){var _0x385770=typeof _0x35303a[_0xcdc9('0x1a')]==='undefined'&&typeof _0x35303a[_0xcdc9('0x1b')]===_0xcdc9('0x1c');var _0x5683c4=_0x100f89[_0xcdc9('0x1d')];var _0x19d34c=_0x385770?0x0:_0x35303a[_0xcdc9('0x1a')];var _0x4ff036=_0x385770?_0x100f89[_0xcdc9('0x1d')]:_0x35303a[_0xcdc9('0x1a')]+_0x35303a[_0xcdc9('0x1b')];var _0x32ca6c;if(_0x4ff036>=_0x5683c4){_0x4ff036=_0x5683c4;_0x32ca6c=0xc8;}else{_0x32ca6c=0xce;}_0x1df8e6[_0xcdc9('0x17')](_0x32ca6c);return _0x1df8e6[_0xcdc9('0x1e')](_0xcdc9('0x1f'),_0x19d34c+'-'+_0x4ff036+'/'+_0x5683c4)[_0xcdc9('0x19')](_0x100f89);}return null;};}function patchUpdates(_0x22a5fe){return function(_0x1809a1){try{jsonpatch[_0xcdc9('0x20')](_0x1809a1,_0x22a5fe,!![]);}catch(_0xd23138){return BPromise[_0xcdc9('0x21')](_0xd23138);}return _0x1809a1[_0xcdc9('0x22')]();};}function saveUpdates(_0x2bffed,_0x1c718a){return function(_0x59cd18){if(_0x59cd18){return _0x59cd18[_0xcdc9('0x23')](_0x2bffed)['then'](function(_0x2c7227){return _0x2c7227;});}return null;};}function removeEntity(_0x2cb3d0,_0x2938cc){return function(_0x23b771){if(_0x23b771){return _0x23b771[_0xcdc9('0x24')]()['then'](function(){_0x2cb3d0[_0xcdc9('0x17')](0xcc)[_0xcdc9('0x18')]();});}};}function handleEntityNotFound(_0x3865be,_0x47b226){return function(_0x2c565c){if(!_0x2c565c){_0x3865be[_0xcdc9('0x16')](0x194);}return _0x2c565c;};}function handleError(_0xe6eab3,_0xad920){_0xad920=_0xad920||0x1f4;return function(_0x187352){logger['error'](_0x187352[_0xcdc9('0x25')]);if(_0x187352[_0xcdc9('0x26')]){delete _0x187352[_0xcdc9('0x26')];}_0xe6eab3[_0xcdc9('0x17')](_0xad920)[_0xcdc9('0x27')](_0x187352);};}exports[_0xcdc9('0x28')]=function(_0x2d8c91,_0x1c75e5){var _0xdead1={},_0x12443f={},_0x464058={'count':0x0,'rows':[]};var _0x502abe=_[_0xcdc9('0x29')](db[_0xcdc9('0x2a')][_0xcdc9('0x2b')],function(_0x1c834d){return{'name':_0x1c834d['fieldName'],'type':_0x1c834d[_0xcdc9('0x2c')][_0xcdc9('0x2d')]};});_0x12443f[_0xcdc9('0x2e')]=_[_0xcdc9('0x29')](_0x502abe,_0xcdc9('0x26'));_0x12443f['query']=_[_0xcdc9('0x2f')](_0x2d8c91[_0xcdc9('0x30')]);_0x12443f['filters']=_['intersection'](_0x12443f[_0xcdc9('0x2e')],_0x12443f['query']);_0xdead1[_0xcdc9('0x31')]=_[_0xcdc9('0x32')](_0x12443f['model'],qs[_0xcdc9('0x33')](_0x2d8c91[_0xcdc9('0x30')][_0xcdc9('0x33')]));_0xdead1[_0xcdc9('0x31')]=_0xdead1[_0xcdc9('0x31')][_0xcdc9('0x34')]?_0xdead1[_0xcdc9('0x31')]:_0x12443f[_0xcdc9('0x2e')];if(!_0x2d8c91[_0xcdc9('0x30')][_0xcdc9('0x35')]('nolimit')){_0xdead1[_0xcdc9('0x1b')]=qs[_0xcdc9('0x1b')](_0x2d8c91[_0xcdc9('0x30')][_0xcdc9('0x1b')]);_0xdead1['offset']=qs[_0xcdc9('0x1a')](_0x2d8c91['query']['offset']);}_0xdead1['order']=qs['sort'](_0x2d8c91[_0xcdc9('0x30')]['sort']);_0xdead1[_0xcdc9('0x36')]=qs[_0xcdc9('0x37')](_[_0xcdc9('0x38')](_0x2d8c91[_0xcdc9('0x30')],_0x12443f[_0xcdc9('0x37')]),_0x502abe);if(_0x2d8c91[_0xcdc9('0x30')]['filter']){_0xdead1['where']=_[_0xcdc9('0x39')](_0xdead1[_0xcdc9('0x36')],{'$or':_[_0xcdc9('0x29')](_0x502abe,function(_0x5db3ab){if(_0x5db3ab[_0xcdc9('0x2c')]!==_0xcdc9('0x3a')){var _0x11935e={};_0x11935e[_0x5db3ab['name']]={'$like':'%'+_0x2d8c91[_0xcdc9('0x30')]['filter']+'%'};return _0x11935e;}})});}_0xdead1=_[_0xcdc9('0x39')]({},_0xdead1,_0x2d8c91[_0xcdc9('0x3b')]);var _0x426c72={'where':_0xdead1[_0xcdc9('0x36')]};return db[_0xcdc9('0x2a')][_0xcdc9('0x1d')](_0x426c72)[_0xcdc9('0x3c')](function(_0x27f438){_0x464058['count']=_0x27f438;if(_0x2d8c91[_0xcdc9('0x30')]['includeAll']){_0xdead1[_0xcdc9('0x3d')]=[{'all':!![]}];}return db[_0xcdc9('0x2a')][_0xcdc9('0x3e')](_0xdead1);})['then'](function(_0x30e353){_0x464058[_0xcdc9('0x3f')]=_0x30e353;return _0x464058;})[_0xcdc9('0x3c')](respondWithFilteredResult(_0x1c75e5,_0xdead1))[_0xcdc9('0x40')](handleError(_0x1c75e5,null));};exports['show']=function(_0x20eae4,_0x13e4cf){var _0x311157={'raw':!![],'where':{'id':_0x20eae4[_0xcdc9('0x41')]['id']}},_0x5c7d01={};_0x5c7d01[_0xcdc9('0x2e')]=_[_0xcdc9('0x2f')](db[_0xcdc9('0x2a')][_0xcdc9('0x2b')]);_0x5c7d01['query']=_[_0xcdc9('0x2f')](_0x20eae4['query']);_0x5c7d01['filters']=_[_0xcdc9('0x32')](_0x5c7d01['model'],_0x5c7d01[_0xcdc9('0x30')]);_0x311157[_0xcdc9('0x31')]=_[_0xcdc9('0x32')](_0x5c7d01[_0xcdc9('0x2e')],qs[_0xcdc9('0x33')](_0x20eae4[_0xcdc9('0x30')][_0xcdc9('0x33')]));_0x311157['attributes']=_0x311157[_0xcdc9('0x31')][_0xcdc9('0x34')]?_0x311157[_0xcdc9('0x31')]:_0x5c7d01[_0xcdc9('0x2e')];if(_0x20eae4[_0xcdc9('0x30')]['includeAll']){_0x311157[_0xcdc9('0x3d')]=[{'all':!![]}];}_0x311157=_['merge']({},_0x311157,_0x20eae4[_0xcdc9('0x3b')]);return db[_0xcdc9('0x2a')]['find'](_0x311157)[_0xcdc9('0x3c')](handleEntityNotFound(_0x13e4cf,null))[_0xcdc9('0x3c')](respondWithResult(_0x13e4cf,null))[_0xcdc9('0x40')](handleError(_0x13e4cf,null));};exports[_0xcdc9('0x42')]=function(_0x1c3c6e,_0x33590d){return db[_0xcdc9('0x2a')]['create'](_0x1c3c6e[_0xcdc9('0x43')],{})[_0xcdc9('0x3c')](respondWithResult(_0x33590d,0xc9))['catch'](handleError(_0x33590d,null));};exports[_0xcdc9('0x23')]=function(_0x40f6ba,_0x14b274){if(_0x40f6ba[_0xcdc9('0x43')]['id']){delete _0x40f6ba[_0xcdc9('0x43')]['id'];}return db['SquareMessage'][_0xcdc9('0x44')]({'where':{'id':_0x40f6ba[_0xcdc9('0x41')]['id']}})[_0xcdc9('0x3c')](handleEntityNotFound(_0x14b274,null))[_0xcdc9('0x3c')](saveUpdates(_0x40f6ba[_0xcdc9('0x43')],null))[_0xcdc9('0x3c')](respondWithResult(_0x14b274,null))[_0xcdc9('0x40')](handleError(_0x14b274,null));};exports[_0xcdc9('0x24')]=function(_0x526ea6,_0x341c99){return db[_0xcdc9('0x2a')][_0xcdc9('0x44')]({'where':{'id':_0x526ea6[_0xcdc9('0x41')]['id']}})[_0xcdc9('0x3c')](handleEntityNotFound(_0x341c99,null))['then'](removeEntity(_0x341c99,null))[_0xcdc9('0x40')](handleError(_0x341c99,null));}; \ No newline at end of file +var _0x7677=['index','map','SquareMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','findAll','rows','catch','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x3cd3b5,_0x4b5130){var _0x4e58ff=function(_0x28b050){while(--_0x28b050){_0x3cd3b5['push'](_0x3cd3b5['shift']());}};_0x4e58ff(++_0x4b5130);}(_0x7677,0x18f));var _0x7767=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7677[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x7767('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7767('0x1'));var jsonpatch=require(_0x7767('0x2'));var rp=require(_0x7767('0x3'));var moment=require('moment');var BPromise=require(_0x7767('0x4'));var Mustache=require(_0x7767('0x5'));var util=require(_0x7767('0x6'));var path=require(_0x7767('0x7'));var sox=require(_0x7767('0x8'));var csv=require(_0x7767('0x9'));var ejs=require(_0x7767('0xa'));var fs=require('fs');var fs_extra=require(_0x7767('0xb'));var _=require('lodash');var squel=require(_0x7767('0xc'));var crypto=require(_0x7767('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7767('0xe'));var toCsv=require(_0x7767('0x9'));var querystring=require(_0x7767('0xf'));var Papa=require(_0x7767('0x10'));var Redis=require('ioredis');var authService=require(_0x7767('0x11'));var qs=require(_0x7767('0x12'));var as=require(_0x7767('0x13'));var hardwareService=require(_0x7767('0x14'));var logger=require('../../config/logger')(_0x7767('0x15'));var utils=require(_0x7767('0x16'));var config=require(_0x7767('0x17'));var licenseUtil=require(_0x7767('0x18'));var db=require(_0x7767('0x19'))['db'];function respondWithStatusCode(_0x5acc56,_0x44cf00){_0x44cf00=_0x44cf00||0xcc;return function(_0x4d39c8){if(_0x4d39c8){return _0x5acc56[_0x7767('0x1a')](_0x44cf00);}return _0x5acc56['status'](_0x44cf00)[_0x7767('0x1b')]();};}function respondWithResult(_0x52e5a7,_0x31f283){_0x31f283=_0x31f283||0xc8;return function(_0x5331e0){if(_0x5331e0){return _0x52e5a7['status'](_0x31f283)[_0x7767('0x1c')](_0x5331e0);}};}function respondWithFilteredResult(_0x9d3fcf,_0x290009){return function(_0x1d53ac){if(_0x1d53ac){var _0x46b644=typeof _0x290009[_0x7767('0x1d')]===_0x7767('0x1e')&&typeof _0x290009[_0x7767('0x1f')]===_0x7767('0x1e');var _0x3352e3=_0x1d53ac[_0x7767('0x20')];var _0x59d9f6=_0x46b644?0x0:_0x290009[_0x7767('0x1d')];var _0xf24fb8=_0x46b644?_0x1d53ac[_0x7767('0x20')]:_0x290009[_0x7767('0x1d')]+_0x290009[_0x7767('0x1f')];var _0x2fc806;if(_0xf24fb8>=_0x3352e3){_0xf24fb8=_0x3352e3;_0x2fc806=0xc8;}else{_0x2fc806=0xce;}_0x9d3fcf[_0x7767('0x21')](_0x2fc806);return _0x9d3fcf[_0x7767('0x22')](_0x7767('0x23'),_0x59d9f6+'-'+_0xf24fb8+'/'+_0x3352e3)['json'](_0x1d53ac);}return null;};}function patchUpdates(_0x25cf6f){return function(_0x3e7744){try{jsonpatch['apply'](_0x3e7744,_0x25cf6f,!![]);}catch(_0x3fae2f){return BPromise[_0x7767('0x24')](_0x3fae2f);}return _0x3e7744[_0x7767('0x25')]();};}function saveUpdates(_0x4e729e,_0x34bb6c){return function(_0x2cada7){if(_0x2cada7){return _0x2cada7[_0x7767('0x26')](_0x4e729e)['then'](function(_0x56cfa5){return _0x56cfa5;});}return null;};}function removeEntity(_0x275985,_0x164a31){return function(_0x27bc09){if(_0x27bc09){return _0x27bc09[_0x7767('0x27')]()[_0x7767('0x28')](function(){_0x275985['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a1307,_0x5e23c1){return function(_0x20d0e1){if(!_0x20d0e1){_0x1a1307[_0x7767('0x1a')](0x194);}return _0x20d0e1;};}function handleError(_0x459023,_0x26495b){_0x26495b=_0x26495b||0x1f4;return function(_0x546c98){logger[_0x7767('0x29')](_0x546c98[_0x7767('0x2a')]);if(_0x546c98[_0x7767('0x2b')]){delete _0x546c98[_0x7767('0x2b')];}_0x459023[_0x7767('0x21')](_0x26495b)[_0x7767('0x2c')](_0x546c98);};}exports[_0x7767('0x2d')]=function(_0x41f984,_0x5a7987){var _0x352e3f={},_0x5a3dbb={},_0x54eb04={'count':0x0,'rows':[]};var _0x111f19=_[_0x7767('0x2e')](db[_0x7767('0x2f')][_0x7767('0x30')],function(_0x461d39){return{'name':_0x461d39['fieldName'],'type':_0x461d39['type']['key']};});_0x5a3dbb[_0x7767('0x31')]=_['map'](_0x111f19,_0x7767('0x2b'));_0x5a3dbb[_0x7767('0x32')]=_[_0x7767('0x33')](_0x41f984[_0x7767('0x32')]);_0x5a3dbb[_0x7767('0x34')]=_[_0x7767('0x35')](_0x5a3dbb[_0x7767('0x31')],_0x5a3dbb[_0x7767('0x32')]);_0x352e3f[_0x7767('0x36')]=_[_0x7767('0x35')](_0x5a3dbb[_0x7767('0x31')],qs[_0x7767('0x37')](_0x41f984[_0x7767('0x32')][_0x7767('0x37')]));_0x352e3f['attributes']=_0x352e3f[_0x7767('0x36')][_0x7767('0x38')]?_0x352e3f[_0x7767('0x36')]:_0x5a3dbb[_0x7767('0x31')];if(!_0x41f984[_0x7767('0x32')][_0x7767('0x39')](_0x7767('0x3a'))){_0x352e3f['limit']=qs[_0x7767('0x1f')](_0x41f984[_0x7767('0x32')][_0x7767('0x1f')]);_0x352e3f[_0x7767('0x1d')]=qs[_0x7767('0x1d')](_0x41f984['query']['offset']);}_0x352e3f['order']=qs[_0x7767('0x3b')](_0x41f984['query'][_0x7767('0x3b')]);_0x352e3f[_0x7767('0x3c')]=qs[_0x7767('0x34')](_[_0x7767('0x3d')](_0x41f984[_0x7767('0x32')],_0x5a3dbb[_0x7767('0x34')]),_0x111f19);if(_0x41f984['query'][_0x7767('0x3e')]){_0x352e3f[_0x7767('0x3c')]=_[_0x7767('0x3f')](_0x352e3f['where'],{'$or':_[_0x7767('0x2e')](_0x111f19,function(_0x59d850){if(_0x59d850[_0x7767('0x40')]!=='VIRTUAL'){var _0x34dcd8={};_0x34dcd8[_0x59d850[_0x7767('0x2b')]]={'$like':'%'+_0x41f984[_0x7767('0x32')][_0x7767('0x3e')]+'%'};return _0x34dcd8;}})});}_0x352e3f=_[_0x7767('0x3f')]({},_0x352e3f,_0x41f984[_0x7767('0x41')]);var _0x4e144d={'where':_0x352e3f[_0x7767('0x3c')]};return db[_0x7767('0x2f')]['count'](_0x4e144d)[_0x7767('0x28')](function(_0x42bf38){_0x54eb04[_0x7767('0x20')]=_0x42bf38;if(_0x41f984[_0x7767('0x32')]['includeAll']){_0x352e3f['include']=[{'all':!![]}];}return db[_0x7767('0x2f')][_0x7767('0x42')](_0x352e3f);})[_0x7767('0x28')](function(_0x22f823){_0x54eb04[_0x7767('0x43')]=_0x22f823;return _0x54eb04;})[_0x7767('0x28')](respondWithFilteredResult(_0x5a7987,_0x352e3f))[_0x7767('0x44')](handleError(_0x5a7987,null));};exports['show']=function(_0x5b0502,_0x4ef0a9){var _0x3b177c={'raw':!![],'where':{'id':_0x5b0502['params']['id']}},_0x4c2158={};_0x4c2158['model']=_[_0x7767('0x33')](db[_0x7767('0x2f')][_0x7767('0x30')]);_0x4c2158[_0x7767('0x32')]=_[_0x7767('0x33')](_0x5b0502[_0x7767('0x32')]);_0x4c2158[_0x7767('0x34')]=_[_0x7767('0x35')](_0x4c2158[_0x7767('0x31')],_0x4c2158[_0x7767('0x32')]);_0x3b177c['attributes']=_[_0x7767('0x35')](_0x4c2158[_0x7767('0x31')],qs['fields'](_0x5b0502['query'][_0x7767('0x37')]));_0x3b177c['attributes']=_0x3b177c[_0x7767('0x36')][_0x7767('0x38')]?_0x3b177c['attributes']:_0x4c2158['model'];if(_0x5b0502[_0x7767('0x32')]['includeAll']){_0x3b177c[_0x7767('0x45')]=[{'all':!![]}];}_0x3b177c=_[_0x7767('0x3f')]({},_0x3b177c,_0x5b0502['options']);return db[_0x7767('0x2f')][_0x7767('0x46')](_0x3b177c)[_0x7767('0x28')](handleEntityNotFound(_0x4ef0a9,null))[_0x7767('0x28')](respondWithResult(_0x4ef0a9,null))[_0x7767('0x44')](handleError(_0x4ef0a9,null));};exports[_0x7767('0x47')]=function(_0x539d00,_0x1baf9d){return db[_0x7767('0x2f')][_0x7767('0x47')](_0x539d00['body'],{})[_0x7767('0x28')](respondWithResult(_0x1baf9d,0xc9))['catch'](handleError(_0x1baf9d,null));};exports[_0x7767('0x26')]=function(_0x29560e,_0x3cdbdf){if(_0x29560e[_0x7767('0x48')]['id']){delete _0x29560e['body']['id'];}return db[_0x7767('0x2f')][_0x7767('0x46')]({'where':{'id':_0x29560e[_0x7767('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cdbdf,null))[_0x7767('0x28')](saveUpdates(_0x29560e['body'],null))[_0x7767('0x28')](respondWithResult(_0x3cdbdf,null))[_0x7767('0x44')](handleError(_0x3cdbdf,null));};exports[_0x7767('0x27')]=function(_0xcd6da7,_0x50f2ad){return db['SquareMessage'][_0x7767('0x46')]({'where':{'id':_0xcd6da7['params']['id']}})['then'](handleEntityNotFound(_0x50f2ad,null))['then'](removeEntity(_0x50f2ad,null))[_0x7767('0x44')](handleError(_0x50f2ad,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2516db1..db24a72 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 _0xeedc=['api','bluebird','request-promise','rimraf','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger'];(function(_0x5e89e0,_0x1cf6a7){var _0x427b4b=function(_0x5a3062){while(--_0x5a3062){_0x5e89e0['push'](_0x5e89e0['shift']());}};_0x427b4b(++_0x1cf6a7);}(_0xeedc,0x76));var _0xceed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeedc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xceed('0x0'));var util=require(_0xceed('0x1'));var logger=require(_0xceed('0x2'))(_0xceed('0x3'));var moment=require('moment');var BPromise=require(_0xceed('0x4'));var rp=require(_0xceed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xceed('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xceed('0x7')]=function(_0x2577fc,_0x152b0b){return _0x2577fc[_0xceed('0x8')](_0xceed('0x9'),attributes,{'tableName':_0xceed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde03=['request-promise','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api','bluebird'];(function(_0x556b19,_0x1b28c9){var _0x3bf797=function(_0x161f78){while(--_0x161f78){_0x556b19['push'](_0x556b19['shift']());}};_0x3bf797(++_0x1b28c9);}(_0xde03,0xc3));var _0x3de0=function(_0x1ac884,_0x2a9ca3){_0x1ac884=_0x1ac884-0x0;var _0xf31ac3=_0xde03[_0x1ac884];return _0xf31ac3;};'use strict';var _=require(_0x3de0('0x0'));var util=require(_0x3de0('0x1'));var logger=require(_0x3de0('0x2'))(_0x3de0('0x3'));var moment=require('moment');var BPromise=require(_0x3de0('0x4'));var rp=require(_0x3de0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3de0('0x6'));module[_0x3de0('0x7')]=function(_0x598ee1,_0x51a982){return _0x598ee1[_0x3de0('0x8')]('SquareMessage',attributes,{'tableName':_0x3de0('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 e8d4859..cb8fc34 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 _0x614e=['client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateSquareMessage','SquareMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x614e,0xac));var _0xe614=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x614e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe614('0x0'));var util=require(_0xe614('0x1'));var moment=require(_0xe614('0x2'));var BPromise=require(_0xe614('0x3'));var rs=require(_0xe614('0x4'));var fs=require('fs');var Redis=require(_0xe614('0x5'));var db=require(_0xe614('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe614('0x7'));var config=require(_0xe614('0x8'));var jayson=require(_0xe614('0x9'));var client=jayson[_0xe614('0xa')][_0xe614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35372a,_0x2b769b,_0x238313){return new BPromise(function(_0xd0646a,_0x4993d4){return client[_0xe614('0xc')](_0x35372a,_0x238313)[_0xe614('0xd')](function(_0x2c147e){logger[_0xe614('0xe')](_0xe614('0xf'),_0x2b769b,_0xe614('0x10'));logger['debug'](_0xe614('0x11'),_0x2b769b,_0xe614('0x10'),JSON[_0xe614('0x12')](_0x2c147e));if(_0x2c147e[_0xe614('0x13')]){if(_0x2c147e[_0xe614('0x13')]['code']===0x1f4){logger[_0xe614('0x13')](_0xe614('0xf'),_0x2b769b,_0x2c147e[_0xe614('0x13')][_0xe614('0x14')]);return _0x4993d4(_0x2c147e[_0xe614('0x13')]['message']);}logger[_0xe614('0x13')]('SquareMessage,\x20%s,\x20%s',_0x2b769b,_0x2c147e['error'][_0xe614('0x14')]);return _0xd0646a(_0x2c147e['error']['message']);}else{logger[_0xe614('0xe')](_0xe614('0xf'),_0x2b769b,'request\x20sent');_0xd0646a(_0x2c147e['result'][_0xe614('0x14')]);}})['catch'](function(_0x149429){logger[_0xe614('0x13')](_0xe614('0xf'),_0x2b769b,_0x149429);_0x4993d4(_0x149429);});});}exports[_0xe614('0x15')]=function(_0x5908df){var _0x5b57a4=this;return new Promise(function(_0x4ca49d,_0x3a5e55){return db[_0xe614('0x16')][_0xe614('0x17')](_0x5908df['body'],{'raw':_0x5908df[_0xe614('0x18')]?_0x5908df[_0xe614('0x18')][_0xe614('0x19')]===undefined?!![]:![]:!![]})[_0xe614('0xd')](function(_0x1bec7d){logger[_0xe614('0xe')](_0xe614('0x15'),_0x5908df);logger['debug']('CreateSquareMessage',_0x5908df,JSON[_0xe614('0x12')](_0x1bec7d));_0x4ca49d(_0x1bec7d);})['catch'](function(_0x17aef1){logger[_0xe614('0x13')]('CreateSquareMessage',_0x17aef1[_0xe614('0x14')],_0x5908df);_0x3a5e55(_0x5b57a4[_0xe614('0x13')](0x1f4,_0x17aef1[_0xe614('0x14')]));});});}; \ No newline at end of file +var _0x094c=['debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x094c,0x144));var _0xc094=function(_0x504582,_0x5b3965){_0x504582=_0x504582-0x0;var _0x43c6ce=_0x094c[_0x504582];return _0x43c6ce;};'use strict';var _=require('lodash');var util=require(_0xc094('0x0'));var moment=require(_0xc094('0x1'));var BPromise=require(_0xc094('0x2'));var rs=require(_0xc094('0x3'));var fs=require('fs');var Redis=require(_0xc094('0x4'));var db=require(_0xc094('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc094('0x6'))(_0xc094('0x7'));var config=require(_0xc094('0x8'));var jayson=require(_0xc094('0x9'));var client=jayson[_0xc094('0xa')][_0xc094('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332f62,_0x16e310,_0x50618e){return new BPromise(function(_0x53e288,_0x5917a3){return client[_0xc094('0xc')](_0x332f62,_0x50618e)[_0xc094('0xd')](function(_0x249fe3){logger[_0xc094('0xe')](_0xc094('0xf'),_0x16e310,_0xc094('0x10'));logger[_0xc094('0x11')](_0xc094('0x12'),_0x16e310,_0xc094('0x10'),JSON[_0xc094('0x13')](_0x249fe3));if(_0x249fe3[_0xc094('0x14')]){if(_0x249fe3[_0xc094('0x14')][_0xc094('0x15')]===0x1f4){logger[_0xc094('0x14')]('SquareMessage,\x20%s,\x20%s',_0x16e310,_0x249fe3[_0xc094('0x14')][_0xc094('0x16')]);return _0x5917a3(_0x249fe3[_0xc094('0x14')][_0xc094('0x16')]);}logger[_0xc094('0x14')](_0xc094('0xf'),_0x16e310,_0x249fe3['error'][_0xc094('0x16')]);return _0x53e288(_0x249fe3[_0xc094('0x14')]['message']);}else{logger[_0xc094('0xe')](_0xc094('0xf'),_0x16e310,_0xc094('0x10'));_0x53e288(_0x249fe3[_0xc094('0x17')][_0xc094('0x16')]);}})[_0xc094('0x18')](function(_0x101277){logger['error'](_0xc094('0xf'),_0x16e310,_0x101277);_0x5917a3(_0x101277);});});}exports[_0xc094('0x19')]=function(_0x4c5d23){var _0x589da8=this;return new Promise(function(_0x5d81a2,_0x460f79){return db[_0xc094('0x1a')][_0xc094('0x1b')](_0x4c5d23[_0xc094('0x1c')],{'raw':_0x4c5d23[_0xc094('0x1d')]?_0x4c5d23[_0xc094('0x1d')][_0xc094('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4935f2){logger['info']('CreateSquareMessage',_0x4c5d23);logger[_0xc094('0x11')](_0xc094('0x19'),_0x4c5d23,JSON[_0xc094('0x13')](_0x4935f2));_0x5d81a2(_0x4935f2);})[_0xc094('0x18')](function(_0x342f8a){logger[_0xc094('0x14')]('CreateSquareMessage',_0x342f8a['message'],_0x4c5d23);_0x460f79(_0x589da8[_0xc094('0x14')](0x1f4,_0x342f8a[_0xc094('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 75bbb71..5c6200f 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 _0xa8ef=['test','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','/:id/test','15s'];(function(_0x32841f,_0x6505ef){var _0x41e407=function(_0x414fa3){while(--_0x414fa3){_0x32841f['push'](_0x32841f['shift']());}};_0x41e407(++_0x6505ef);}(_0xa8ef,0x14b));var _0xfa8e=function(_0x5d8e5b,_0x190e27){_0x5d8e5b=_0x5d8e5b-0x0;var _0x3a1544=_0xa8ef[_0x5d8e5b];return _0x3a1544;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa8e('0x0'));var timeout=require(_0xfa8e('0x1'));var express=require(_0xfa8e('0x2'));var router=express[_0xfa8e('0x3')]();var fs_extra=require(_0xfa8e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xfa8e('0x5')]('/',auth[_0xfa8e('0x6')](),controller['index']);router[_0xfa8e('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfa8e('0x5')](_0xfa8e('0x7'),auth[_0xfa8e('0x6')](),timeout(_0xfa8e('0x8')),controller[_0xfa8e('0x9')]);router[_0xfa8e('0xa')]('/',auth[_0xfa8e('0x6')](),controller[_0xfa8e('0xb')]);router[_0xfa8e('0xc')](_0xfa8e('0xd'),auth[_0xfa8e('0x6')](),controller[_0xfa8e('0xe')]);router['delete'](_0xfa8e('0xd'),auth['isAuthenticated'](),controller[_0xfa8e('0xf')]);module[_0xfa8e('0x10')]=router; \ No newline at end of file +var _0x98aa=['get','show','/:id/test','isAuthenticated','15s','test','post','create','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x98aa,0x12b));var _0xa98a=function(_0x2c7443,_0x33b2d6){_0x2c7443=_0x2c7443-0x0;var _0x51a9c1=_0x98aa[_0x2c7443];return _0x51a9c1;};'use strict';var multer=require('multer');var util=require(_0xa98a('0x0'));var path=require(_0xa98a('0x1'));var timeout=require('connect-timeout');var express=require(_0xa98a('0x2'));var router=express['Router']();var fs_extra=require(_0xa98a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa98a('0x4'));var controller=require('./squareOdbc.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa98a('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xa98a('0x6')]);router[_0xa98a('0x5')](_0xa98a('0x7'),auth[_0xa98a('0x8')](),timeout(_0xa98a('0x9')),controller[_0xa98a('0xa')]);router[_0xa98a('0xb')]('/',auth[_0xa98a('0x8')](),controller[_0xa98a('0xc')]);router[_0xa98a('0xd')](_0xa98a('0xe'),auth[_0xa98a('0x8')](),controller[_0xa98a('0xf')]);router[_0xa98a('0x10')](_0xa98a('0xe'),auth[_0xa98a('0x8')](),controller[_0xa98a('0x11')]);module[_0xa98a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 6a069fb..c6df881 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 _0x871d=['sequelize','STRING'];(function(_0x43fd0c,_0xea9b14){var _0x4d5437=function(_0xd567e2){while(--_0xd567e2){_0x43fd0c['push'](_0x43fd0c['shift']());}};_0x4d5437(++_0xea9b14);}(_0x871d,0x186));var _0xd871=function(_0x4c82a5,_0x29c7d0){_0x4c82a5=_0x4c82a5-0x0;var _0x576c12=_0x871d[_0x4c82a5];return _0x576c12;};'use strict';var Sequelize=require(_0xd871('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd871('0x1')]}}; \ No newline at end of file +var _0x1f41=['STRING','name','sequelize','exports'];(function(_0x185c91,_0xdef3ce){var _0xa42a1d=function(_0x29d0e3){while(--_0x29d0e3){_0x185c91['push'](_0x185c91['shift']());}};_0xa42a1d(++_0xdef3ce);}(_0x1f41,0x18a));var _0x11f4=function(_0x23a571,_0x1cf730){_0x23a571=_0x23a571-0x0;var _0x5e0e70=_0x1f41[_0x23a571];return _0x5e0e70;};'use strict';var Sequelize=require(_0x11f4('0x0'));module[_0x11f4('0x1')]={'name':{'type':Sequelize[_0x11f4('0x2')],'unique':_0x11f4('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b126621..5a60ff7 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 _0x99fa=['rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','error','name','send','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll'];(function(_0x3fe127,_0x9870e4){var _0x38de0e=function(_0x455be2){while(--_0x455be2){_0x3fe127['push'](_0x3fe127['shift']());}};_0x38de0e(++_0x9870e4);}(_0x99fa,0x1a0));var _0xa99f=function(_0x4d5308,_0x268d72){_0x4d5308=_0x4d5308-0x0;var _0x56635a=_0x99fa[_0x4d5308];return _0x56635a;};'use strict';var emlformat=require(_0xa99f('0x0'));var rimraf=require(_0xa99f('0x1'));var zipdir=require(_0xa99f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa99f('0x3'));var BPromise=require(_0xa99f('0x4'));var Mustache=require(_0xa99f('0x5'));var util=require('util');var path=require(_0xa99f('0x6'));var sox=require(_0xa99f('0x7'));var csv=require('to-csv');var ejs=require(_0xa99f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa99f('0x9'));var squel=require(_0xa99f('0xa'));var crypto=require(_0xa99f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa99f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa99f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa99f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa99f('0xf'))(_0xa99f('0x10'));var utils=require('../../config/utils');var config=require(_0xa99f('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2ebc,_0x5a5f9e){_0x5a5f9e=_0x5a5f9e||0xcc;return function(_0x420a60){if(_0x420a60){return _0x1c2ebc[_0xa99f('0x12')](_0x5a5f9e);}return _0x1c2ebc[_0xa99f('0x13')](_0x5a5f9e)[_0xa99f('0x14')]();};}function respondWithResult(_0x39f152,_0x44e06a){_0x44e06a=_0x44e06a||0xc8;return function(_0x45c837){if(_0x45c837){return _0x39f152[_0xa99f('0x13')](_0x44e06a)[_0xa99f('0x15')](_0x45c837);}};}function respondWithFilteredResult(_0x5624b6,_0x5df717){return function(_0x189545){if(_0x189545){var _0x14039a=typeof _0x5df717[_0xa99f('0x16')]===_0xa99f('0x17')&&typeof _0x5df717[_0xa99f('0x18')]===_0xa99f('0x17');var _0x15c0e7=_0x189545['count'];var _0x36e06b=_0x14039a?0x0:_0x5df717[_0xa99f('0x16')];var _0x29f8f5=_0x14039a?_0x189545[_0xa99f('0x19')]:_0x5df717[_0xa99f('0x16')]+_0x5df717[_0xa99f('0x18')];var _0x1c961c;if(_0x29f8f5>=_0x15c0e7){_0x29f8f5=_0x15c0e7;_0x1c961c=0xc8;}else{_0x1c961c=0xce;}_0x5624b6[_0xa99f('0x13')](_0x1c961c);return _0x5624b6['set'](_0xa99f('0x1a'),_0x36e06b+'-'+_0x29f8f5+'/'+_0x15c0e7)[_0xa99f('0x15')](_0x189545);}return null;};}function patchUpdates(_0x4f1bf1){return function(_0x378c6e){try{jsonpatch[_0xa99f('0x1b')](_0x378c6e,_0x4f1bf1,!![]);}catch(_0x38dde6){return BPromise[_0xa99f('0x1c')](_0x38dde6);}return _0x378c6e[_0xa99f('0x1d')]();};}function saveUpdates(_0xe02b6,_0x5ce522){return function(_0x58f381){if(_0x58f381){return _0x58f381[_0xa99f('0x1e')](_0xe02b6)[_0xa99f('0x1f')](function(_0x3b4003){return _0x3b4003;});}return null;};}function removeEntity(_0x45660e,_0x1ab304){return function(_0x5c89d1){if(_0x5c89d1){return _0x5c89d1['destroy']()[_0xa99f('0x1f')](function(){var _0xbc10cf=_0x5c89d1[_0xa99f('0x20')]({'plain':!![]});var _0x30fa20=_0xa99f('0x21');return db[_0xa99f('0x22')]['destroy']({'where':{'type':_0x30fa20,'resourceId':_0xbc10cf['id']}})['then'](function(){return _0x5c89d1;});})[_0xa99f('0x1f')](function(){_0x45660e[_0xa99f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42cc84,_0x34ea0e){return function(_0x3c0607){if(!_0x3c0607){_0x42cc84[_0xa99f('0x12')](0x194);}return _0x3c0607;};}function handleError(_0x258795,_0x5e363a){_0x5e363a=_0x5e363a||0x1f4;return function(_0x326338){logger[_0xa99f('0x23')](_0x326338['stack']);if(_0x326338[_0xa99f('0x24')]){delete _0x326338[_0xa99f('0x24')];}_0x258795[_0xa99f('0x13')](_0x5e363a)[_0xa99f('0x25')](_0x326338);};}exports[_0xa99f('0x26')]=function(_0x35b4b5,_0x14886b){var _0x5f1970={},_0x5c7147={},_0x446983={'count':0x0,'rows':[]};var _0xb51188=_['map'](db['SquareOdbc'][_0xa99f('0x27')],function(_0x36a344){return{'name':_0x36a344[_0xa99f('0x28')],'type':_0x36a344['type']['key']};});_0x5c7147[_0xa99f('0x29')]=_[_0xa99f('0x2a')](_0xb51188,_0xa99f('0x24'));_0x5c7147['query']=_[_0xa99f('0x2b')](_0x35b4b5[_0xa99f('0x2c')]);_0x5c7147[_0xa99f('0x2d')]=_['intersection'](_0x5c7147[_0xa99f('0x29')],_0x5c7147[_0xa99f('0x2c')]);_0x5f1970['attributes']=_[_0xa99f('0x2e')](_0x5c7147[_0xa99f('0x29')],qs[_0xa99f('0x2f')](_0x35b4b5['query'][_0xa99f('0x2f')]));_0x5f1970[_0xa99f('0x30')]=_0x5f1970[_0xa99f('0x30')][_0xa99f('0x31')]?_0x5f1970[_0xa99f('0x30')]:_0x5c7147[_0xa99f('0x29')];if(!_0x35b4b5[_0xa99f('0x2c')]['hasOwnProperty'](_0xa99f('0x32'))){_0x5f1970[_0xa99f('0x18')]=qs['limit'](_0x35b4b5[_0xa99f('0x2c')][_0xa99f('0x18')]);_0x5f1970[_0xa99f('0x16')]=qs[_0xa99f('0x16')](_0x35b4b5[_0xa99f('0x2c')][_0xa99f('0x16')]);}_0x5f1970[_0xa99f('0x33')]=qs[_0xa99f('0x34')](_0x35b4b5[_0xa99f('0x2c')][_0xa99f('0x34')]);_0x5f1970[_0xa99f('0x35')]=qs[_0xa99f('0x2d')](_[_0xa99f('0x36')](_0x35b4b5[_0xa99f('0x2c')],_0x5c7147[_0xa99f('0x2d')]),_0xb51188);if(_0x35b4b5[_0xa99f('0x2c')]['filter']){_0x5f1970['where']=_[_0xa99f('0x37')](_0x5f1970[_0xa99f('0x35')],{'$or':_[_0xa99f('0x2a')](_0xb51188,function(_0x383c62){if(_0x383c62[_0xa99f('0x38')]!==_0xa99f('0x39')){var _0x2e276c={};_0x2e276c[_0x383c62['name']]={'$like':'%'+_0x35b4b5[_0xa99f('0x2c')][_0xa99f('0x3a')]+'%'};return _0x2e276c;}})});}_0x5f1970=_[_0xa99f('0x37')]({},_0x5f1970,_0x35b4b5[_0xa99f('0x3b')]);var _0x4cd955={'where':_0x5f1970[_0xa99f('0x35')]};return db[_0xa99f('0x3c')][_0xa99f('0x19')](_0x4cd955)[_0xa99f('0x1f')](function(_0x312f46){_0x446983[_0xa99f('0x19')]=_0x312f46;if(_0x35b4b5[_0xa99f('0x2c')][_0xa99f('0x3d')]){_0x5f1970[_0xa99f('0x3e')]=[{'all':!![]}];}return db[_0xa99f('0x3c')][_0xa99f('0x3f')](_0x5f1970);})['then'](function(_0x151c66){_0x446983[_0xa99f('0x40')]=_0x151c66;return _0x446983;})[_0xa99f('0x1f')](respondWithFilteredResult(_0x14886b,_0x5f1970))[_0xa99f('0x41')](handleError(_0x14886b,null));};exports[_0xa99f('0x42')]=function(_0x531b10,_0x52acff){var _0x3509e1={'raw':!![],'where':{'id':_0x531b10[_0xa99f('0x43')]['id']}},_0x529991={};_0x529991[_0xa99f('0x29')]=_[_0xa99f('0x2b')](db[_0xa99f('0x3c')][_0xa99f('0x27')]);_0x529991[_0xa99f('0x2c')]=_[_0xa99f('0x2b')](_0x531b10[_0xa99f('0x2c')]);_0x529991[_0xa99f('0x2d')]=_[_0xa99f('0x2e')](_0x529991[_0xa99f('0x29')],_0x529991['query']);_0x3509e1[_0xa99f('0x30')]=_[_0xa99f('0x2e')](_0x529991['model'],qs['fields'](_0x531b10['query'][_0xa99f('0x2f')]));_0x3509e1[_0xa99f('0x30')]=_0x3509e1[_0xa99f('0x30')][_0xa99f('0x31')]?_0x3509e1[_0xa99f('0x30')]:_0x529991[_0xa99f('0x29')];if(_0x531b10[_0xa99f('0x2c')]['includeAll']){_0x3509e1[_0xa99f('0x3e')]=[{'all':!![]}];}_0x3509e1=_[_0xa99f('0x37')]({},_0x3509e1,_0x531b10[_0xa99f('0x3b')]);return db[_0xa99f('0x3c')][_0xa99f('0x44')](_0x3509e1)[_0xa99f('0x1f')](handleEntityNotFound(_0x52acff,null))['then'](respondWithResult(_0x52acff,null))[_0xa99f('0x41')](handleError(_0x52acff,null));};exports[_0xa99f('0x45')]=function(_0x89bde,_0x270fb5){return db['SquareOdbc'][_0xa99f('0x45')](_0x89bde[_0xa99f('0x46')],{})[_0xa99f('0x1f')](function(_0x3e2cee){var _0x3e393f=_0x89bde['user'][_0xa99f('0x20')]({'plain':!![]});if(!_0x3e393f)throw new Error(_0xa99f('0x47'));if(_0x3e393f[_0xa99f('0x48')]==='user'){var _0x2f9bcb=_0x3e2cee[_0xa99f('0x20')]({'plain':!![]});var _0x47a7f7=_0xa99f('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x47a7f7,'userProfileId':_0x3e393f[_0xa99f('0x49')]},'raw':!![]})[_0xa99f('0x1f')](function(_0x4470d4){if(_0x4470d4&&_0x4470d4['autoAssociation']===0x0){return db[_0xa99f('0x22')][_0xa99f('0x45')]({'name':_0x2f9bcb['name'],'resourceId':_0x2f9bcb['id'],'type':_0x4470d4[_0xa99f('0x24')],'sectionId':_0x4470d4['id']},{})['then'](function(){return _0x3e2cee;});}else{return _0x3e2cee;}})[_0xa99f('0x41')](function(_0xcd4744){logger['error'](_0xa99f('0x4a'),_0xcd4744);throw _0xcd4744;});}return _0x3e2cee;})[_0xa99f('0x1f')](respondWithResult(_0x270fb5,0xc9))[_0xa99f('0x41')](handleError(_0x270fb5,null));};exports[_0xa99f('0x1e')]=function(_0x9fa647,_0x13afe6){if(_0x9fa647[_0xa99f('0x46')]['id']){delete _0x9fa647[_0xa99f('0x46')]['id'];}return db[_0xa99f('0x3c')][_0xa99f('0x44')]({'where':{'id':_0x9fa647[_0xa99f('0x43')]['id']}})[_0xa99f('0x1f')](handleEntityNotFound(_0x13afe6,null))['then'](saveUpdates(_0x9fa647[_0xa99f('0x46')],null))[_0xa99f('0x1f')](respondWithResult(_0x13afe6,null))['catch'](handleError(_0x13afe6,null));};exports[_0xa99f('0x4b')]=function(_0x5bd866,_0x1fd432){return db[_0xa99f('0x3c')]['find']({'where':{'id':_0x5bd866[_0xa99f('0x43')]['id']}})[_0xa99f('0x1f')](handleEntityNotFound(_0x1fd432,null))[_0xa99f('0x1f')](removeEntity(_0x1fd432,null))[_0xa99f('0x41')](handleError(_0x1fd432,null));};exports[_0xa99f('0x4c')]=function(_0x37eda6,_0x48dc87,_0x51b842){var _0x3dfef1;return db[_0xa99f('0x3c')]['find']({'where':{'id':_0x37eda6[_0xa99f('0x43')]['id']},'attributes':['id',_0xa99f('0x4d')]})[_0xa99f('0x1f')](handleEntityNotFound(_0x48dc87,null))[_0xa99f('0x1f')](function(_0x2ecab3){if(_0x2ecab3){var _0x54b47c=require(_0xa99f('0x4e'))();_0x54b47c[_0xa99f('0x4f')](_0x2ecab3[_0xa99f('0x4d')]);_0x54b47c['closeSync']();return _0x2ecab3;}})[_0xa99f('0x1f')](respondWithResult(_0x48dc87,null))[_0xa99f('0x41')](handleError(_0x48dc87,null));}; \ No newline at end of file +var _0x09ac=['map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','name','send','index'];(function(_0x221373,_0x15ba77){var _0x28ad50=function(_0x37e061){while(--_0x37e061){_0x221373['push'](_0x221373['shift']());}};_0x28ad50(++_0x15ba77);}(_0x09ac,0x11c));var _0xc09a=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0x09ac[_0x3b085];return _0x476a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc09a('0x0'));var zipdir=require(_0xc09a('0x1'));var jsonpatch=require(_0xc09a('0x2'));var rp=require('request-promise');var moment=require(_0xc09a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc09a('0x4'));var util=require(_0xc09a('0x5'));var path=require(_0xc09a('0x6'));var sox=require(_0xc09a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc09a('0x8'));var _=require(_0xc09a('0x9'));var squel=require(_0xc09a('0xa'));var crypto=require('crypto');var jsforce=require(_0xc09a('0xb'));var deskjs=require(_0xc09a('0xc'));var toCsv=require(_0xc09a('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc09a('0xe'));var qs=require(_0xc09a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc09a('0x10'));var config=require(_0xc09a('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xc09a('0x12'))['db'];function respondWithStatusCode(_0x17428e,_0x592a1c){_0x592a1c=_0x592a1c||0xcc;return function(_0x3e1a3e){if(_0x3e1a3e){return _0x17428e['sendStatus'](_0x592a1c);}return _0x17428e[_0xc09a('0x13')](_0x592a1c)[_0xc09a('0x14')]();};}function respondWithResult(_0x3f3c70,_0x1414e9){_0x1414e9=_0x1414e9||0xc8;return function(_0x502b18){if(_0x502b18){return _0x3f3c70[_0xc09a('0x13')](_0x1414e9)[_0xc09a('0x15')](_0x502b18);}};}function respondWithFilteredResult(_0x15a45c,_0x1e5429){return function(_0x507b62){if(_0x507b62){var _0x42da7c=typeof _0x1e5429['offset']==='undefined'&&typeof _0x1e5429[_0xc09a('0x16')]===_0xc09a('0x17');var _0x221296=_0x507b62[_0xc09a('0x18')];var _0x2e2e18=_0x42da7c?0x0:_0x1e5429[_0xc09a('0x19')];var _0x56552c=_0x42da7c?_0x507b62[_0xc09a('0x18')]:_0x1e5429['offset']+_0x1e5429[_0xc09a('0x16')];var _0x163731;if(_0x56552c>=_0x221296){_0x56552c=_0x221296;_0x163731=0xc8;}else{_0x163731=0xce;}_0x15a45c[_0xc09a('0x13')](_0x163731);return _0x15a45c[_0xc09a('0x1a')]('Content-Range',_0x2e2e18+'-'+_0x56552c+'/'+_0x221296)[_0xc09a('0x15')](_0x507b62);}return null;};}function patchUpdates(_0x3bbaba){return function(_0x4d2081){try{jsonpatch[_0xc09a('0x1b')](_0x4d2081,_0x3bbaba,!![]);}catch(_0x3f75ce){return BPromise[_0xc09a('0x1c')](_0x3f75ce);}return _0x4d2081[_0xc09a('0x1d')]();};}function saveUpdates(_0x16c15d,_0x30f28e){return function(_0x56f8cc){if(_0x56f8cc){return _0x56f8cc['update'](_0x16c15d)[_0xc09a('0x1e')](function(_0x53b9f1){return _0x53b9f1;});}return null;};}function removeEntity(_0x2545b3,_0x16b933){return function(_0x1dc967){if(_0x1dc967){return _0x1dc967[_0xc09a('0x1f')]()[_0xc09a('0x1e')](function(){var _0x36a092=_0x1dc967[_0xc09a('0x20')]({'plain':!![]});var _0x56f3aa=_0xc09a('0x21');return db[_0xc09a('0x22')]['destroy']({'where':{'type':_0x56f3aa,'resourceId':_0x36a092['id']}})['then'](function(){return _0x1dc967;});})[_0xc09a('0x1e')](function(){_0x2545b3['status'](0xcc)[_0xc09a('0x14')]();});}};}function handleEntityNotFound(_0x2217f4,_0x17554c){return function(_0x6fd4e){if(!_0x6fd4e){_0x2217f4[_0xc09a('0x23')](0x194);}return _0x6fd4e;};}function handleError(_0x4f8c71,_0x3f8993){_0x3f8993=_0x3f8993||0x1f4;return function(_0x257624){logger[_0xc09a('0x24')](_0x257624['stack']);if(_0x257624[_0xc09a('0x25')]){delete _0x257624['name'];}_0x4f8c71[_0xc09a('0x13')](_0x3f8993)[_0xc09a('0x26')](_0x257624);};}exports[_0xc09a('0x27')]=function(_0x4e28fd,_0x2ffdef){var _0x540617={},_0x350d89={},_0x185950={'count':0x0,'rows':[]};var _0xa703cb=_[_0xc09a('0x28')](db[_0xc09a('0x29')][_0xc09a('0x2a')],function(_0x4965db){return{'name':_0x4965db[_0xc09a('0x2b')],'type':_0x4965db[_0xc09a('0x2c')][_0xc09a('0x2d')]};});_0x350d89[_0xc09a('0x2e')]=_['map'](_0xa703cb,_0xc09a('0x25'));_0x350d89['query']=_[_0xc09a('0x2f')](_0x4e28fd[_0xc09a('0x30')]);_0x350d89[_0xc09a('0x31')]=_['intersection'](_0x350d89['model'],_0x350d89[_0xc09a('0x30')]);_0x540617[_0xc09a('0x32')]=_[_0xc09a('0x33')](_0x350d89[_0xc09a('0x2e')],qs['fields'](_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x34')]));_0x540617[_0xc09a('0x32')]=_0x540617[_0xc09a('0x32')]['length']?_0x540617[_0xc09a('0x32')]:_0x350d89[_0xc09a('0x2e')];if(!_0x4e28fd['query'][_0xc09a('0x35')](_0xc09a('0x36'))){_0x540617['limit']=qs['limit'](_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x16')]);_0x540617[_0xc09a('0x19')]=qs[_0xc09a('0x19')](_0x4e28fd[_0xc09a('0x30')]['offset']);}_0x540617['order']=qs[_0xc09a('0x37')](_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x37')]);_0x540617[_0xc09a('0x38')]=qs[_0xc09a('0x31')](_[_0xc09a('0x39')](_0x4e28fd[_0xc09a('0x30')],_0x350d89[_0xc09a('0x31')]),_0xa703cb);if(_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x3a')]){_0x540617[_0xc09a('0x38')]=_['merge'](_0x540617[_0xc09a('0x38')],{'$or':_[_0xc09a('0x28')](_0xa703cb,function(_0x2bb3e4){if(_0x2bb3e4[_0xc09a('0x2c')]!=='VIRTUAL'){var _0x514ee6={};_0x514ee6[_0x2bb3e4[_0xc09a('0x25')]]={'$like':'%'+_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x3a')]+'%'};return _0x514ee6;}})});}_0x540617=_[_0xc09a('0x3b')]({},_0x540617,_0x4e28fd[_0xc09a('0x3c')]);var _0x5e87cc={'where':_0x540617[_0xc09a('0x38')]};return db[_0xc09a('0x29')][_0xc09a('0x18')](_0x5e87cc)[_0xc09a('0x1e')](function(_0x3d3959){_0x185950[_0xc09a('0x18')]=_0x3d3959;if(_0x4e28fd[_0xc09a('0x30')][_0xc09a('0x3d')]){_0x540617[_0xc09a('0x3e')]=[{'all':!![]}];}return db[_0xc09a('0x29')][_0xc09a('0x3f')](_0x540617);})[_0xc09a('0x1e')](function(_0x30b447){_0x185950[_0xc09a('0x40')]=_0x30b447;return _0x185950;})[_0xc09a('0x1e')](respondWithFilteredResult(_0x2ffdef,_0x540617))[_0xc09a('0x41')](handleError(_0x2ffdef,null));};exports['show']=function(_0x21ae9b,_0xd713cd){var _0xc68d2d={'raw':!![],'where':{'id':_0x21ae9b[_0xc09a('0x42')]['id']}},_0x2db249={};_0x2db249['model']=_[_0xc09a('0x2f')](db[_0xc09a('0x29')][_0xc09a('0x2a')]);_0x2db249[_0xc09a('0x30')]=_['keys'](_0x21ae9b[_0xc09a('0x30')]);_0x2db249[_0xc09a('0x31')]=_['intersection'](_0x2db249[_0xc09a('0x2e')],_0x2db249['query']);_0xc68d2d[_0xc09a('0x32')]=_[_0xc09a('0x33')](_0x2db249[_0xc09a('0x2e')],qs[_0xc09a('0x34')](_0x21ae9b['query'][_0xc09a('0x34')]));_0xc68d2d['attributes']=_0xc68d2d['attributes'][_0xc09a('0x43')]?_0xc68d2d[_0xc09a('0x32')]:_0x2db249['model'];if(_0x21ae9b['query']['includeAll']){_0xc68d2d['include']=[{'all':!![]}];}_0xc68d2d=_[_0xc09a('0x3b')]({},_0xc68d2d,_0x21ae9b[_0xc09a('0x3c')]);return db['SquareOdbc'][_0xc09a('0x44')](_0xc68d2d)[_0xc09a('0x1e')](handleEntityNotFound(_0xd713cd,null))[_0xc09a('0x1e')](respondWithResult(_0xd713cd,null))[_0xc09a('0x41')](handleError(_0xd713cd,null));};exports[_0xc09a('0x45')]=function(_0xc1f943,_0x9e55ed){return db[_0xc09a('0x29')]['create'](_0xc1f943[_0xc09a('0x46')],{})[_0xc09a('0x1e')](function(_0x26c584){var _0x37c6da=_0xc1f943['user'][_0xc09a('0x20')]({'plain':!![]});if(!_0x37c6da)throw new Error(_0xc09a('0x47'));if(_0x37c6da[_0xc09a('0x48')]===_0xc09a('0x49')){var _0x13c919=_0x26c584[_0xc09a('0x20')]({'plain':!![]});var _0x20520b='ODBC';return db[_0xc09a('0x4a')][_0xc09a('0x44')]({'where':{'name':_0x20520b,'userProfileId':_0x37c6da['userProfileId']},'raw':!![]})[_0xc09a('0x1e')](function(_0x10c549){if(_0x10c549&&_0x10c549[_0xc09a('0x4b')]===0x0){return db[_0xc09a('0x22')][_0xc09a('0x45')]({'name':_0x13c919[_0xc09a('0x25')],'resourceId':_0x13c919['id'],'type':_0x10c549['name'],'sectionId':_0x10c549['id']},{})[_0xc09a('0x1e')](function(){return _0x26c584;});}else{return _0x26c584;}})[_0xc09a('0x41')](function(_0x38d9d6){logger[_0xc09a('0x24')](_0xc09a('0x4c'),_0x38d9d6);throw _0x38d9d6;});}return _0x26c584;})[_0xc09a('0x1e')](respondWithResult(_0x9e55ed,0xc9))[_0xc09a('0x41')](handleError(_0x9e55ed,null));};exports[_0xc09a('0x4d')]=function(_0x48ed7c,_0xff3514){if(_0x48ed7c[_0xc09a('0x46')]['id']){delete _0x48ed7c[_0xc09a('0x46')]['id'];}return db['SquareOdbc'][_0xc09a('0x44')]({'where':{'id':_0x48ed7c[_0xc09a('0x42')]['id']}})[_0xc09a('0x1e')](handleEntityNotFound(_0xff3514,null))[_0xc09a('0x1e')](saveUpdates(_0x48ed7c['body'],null))[_0xc09a('0x1e')](respondWithResult(_0xff3514,null))[_0xc09a('0x41')](handleError(_0xff3514,null));};exports[_0xc09a('0x1f')]=function(_0x35c5e9,_0x289723){return db[_0xc09a('0x29')][_0xc09a('0x44')]({'where':{'id':_0x35c5e9[_0xc09a('0x42')]['id']}})[_0xc09a('0x1e')](handleEntityNotFound(_0x289723,null))['then'](removeEntity(_0x289723,null))['catch'](handleError(_0x289723,null));};exports[_0xc09a('0x4e')]=function(_0x514df6,_0x28d0d3,_0x32e234){var _0x3fb826;return db[_0xc09a('0x29')][_0xc09a('0x44')]({'where':{'id':_0x514df6['params']['id']},'attributes':['id',_0xc09a('0x4f')]})['then'](handleEntityNotFound(_0x28d0d3,null))[_0xc09a('0x1e')](function(_0x19bc0b){if(_0x19bc0b){var _0x2a8c00=require(_0xc09a('0x50'))();_0x2a8c00['openSync'](_0x19bc0b[_0xc09a('0x4f')]);_0x2a8c00['closeSync']();return _0x19bc0b;}})[_0xc09a('0x1e')](respondWithResult(_0x28d0d3,null))['catch'](handleError(_0x28d0d3,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 3266cce..969386c 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 _0xf30e=['./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0xf30e,0x16c));var _0xef30=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0xf30e[_0x10f68e];return _0x4c8372;};'use strict';var _=require(_0xef30('0x0'));var util=require(_0xef30('0x1'));var logger=require(_0xef30('0x2'))('api');var moment=require(_0xef30('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xef30('0x4'));var config=require(_0xef30('0x5'));var attributes=require(_0xef30('0x6'));module[_0xef30('0x7')]=function(_0x1be09c,_0x871f9b){return _0x1be09c['define'](_0xef30('0x8'),attributes,{'tableName':_0xef30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa032=['SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x5c3056,_0x4b5bca){var _0x2d3393=function(_0x28612d){while(--_0x28612d){_0x5c3056['push'](_0x5c3056['shift']());}};_0x2d3393(++_0x4b5bca);}(_0xa032,0xb6));var _0x2a03=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xa032[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x2a03('0x0'));var util=require(_0x2a03('0x1'));var logger=require(_0x2a03('0x2'))('api');var moment=require(_0x2a03('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a03('0x4'));var fs=require('fs');var path=require(_0x2a03('0x5'));var rimraf=require('rimraf');var config=require(_0x2a03('0x6'));var attributes=require(_0x2a03('0x7'));module[_0x2a03('0x8')]=function(_0x225441,_0x1e49aa){return _0x225441[_0x2a03('0x9')](_0x2a03('0xa'),attributes,{'tableName':_0x2a03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index e954431..2444194 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 _0x3a6d=['client','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','code','error','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6a27db,_0x2731a7){var _0xd814f5=function(_0x19d645){while(--_0x19d645){_0x6a27db['push'](_0x6a27db['shift']());}};_0xd814f5(++_0x2731a7);}(_0x3a6d,0xd0));var _0xd3a6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3a6d[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require(_0xd3a6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3a6('0x3'))['db'];var utils=require(_0xd3a6('0x4'));var logger=require(_0xd3a6('0x5'))(_0xd3a6('0x6'));var config=require(_0xd3a6('0x7'));var jayson=require(_0xd3a6('0x8'));var client=jayson[_0xd3a6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279575,_0x4c0625,_0x2f5496){return new BPromise(function(_0x366e5b,_0x5927be){return client[_0xd3a6('0xa')](_0x279575,_0x2f5496)['then'](function(_0x33b38c){logger['info'](_0xd3a6('0xb'),_0x4c0625,_0xd3a6('0xc'));logger[_0xd3a6('0xd')](_0xd3a6('0xe'),_0x4c0625,_0xd3a6('0xc'),JSON['stringify'](_0x33b38c));if(_0x33b38c['error']){if(_0x33b38c['error'][_0xd3a6('0xf')]===0x1f4){logger[_0xd3a6('0x10')](_0xd3a6('0xb'),_0x4c0625,_0x33b38c[_0xd3a6('0x10')][_0xd3a6('0x11')]);return _0x5927be(_0x33b38c[_0xd3a6('0x10')][_0xd3a6('0x11')]);}logger[_0xd3a6('0x10')](_0xd3a6('0xb'),_0x4c0625,_0x33b38c['error'][_0xd3a6('0x11')]);return _0x366e5b(_0x33b38c['error'][_0xd3a6('0x11')]);}else{logger[_0xd3a6('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x4c0625,_0xd3a6('0xc'));_0x366e5b(_0x33b38c['result'][_0xd3a6('0x11')]);}})[_0xd3a6('0x13')](function(_0x4092e5){logger[_0xd3a6('0x10')](_0xd3a6('0xb'),_0x4c0625,_0x4092e5);_0x5927be(_0x4092e5);});});}exports[_0xd3a6('0x14')]=function(_0x3be20f){var _0x17a26c=this;return new Promise(function(_0x17191d,_0xa0d96c){return db[_0xd3a6('0x15')][_0xd3a6('0x16')]({'raw':_0x3be20f[_0xd3a6('0x17')]?_0x3be20f['options'][_0xd3a6('0x18')]===undefined?!![]:![]:!![],'where':_0x3be20f[_0xd3a6('0x17')]?_0x3be20f[_0xd3a6('0x17')][_0xd3a6('0x19')]||null:null,'attributes':_0x3be20f[_0xd3a6('0x17')]?_0x3be20f[_0xd3a6('0x17')][_0xd3a6('0x1a')]||null:null,'include':_0x3be20f['options']?_0x3be20f[_0xd3a6('0x17')][_0xd3a6('0x1b')]?_[_0xd3a6('0x1c')](_0x3be20f[_0xd3a6('0x17')]['include'],function(_0xa140da){return{'model':db[_0xa140da[_0xd3a6('0x1d')]],'as':_0xa140da['as'],'attributes':_0xa140da['attributes'],'include':_0xa140da['include']?_[_0xd3a6('0x1c')](_0xa140da[_0xd3a6('0x1b')],function(_0x40ee9c){return{'model':db[_0x40ee9c[_0xd3a6('0x1d')]],'as':_0x40ee9c['as'],'attributes':_0x40ee9c[_0xd3a6('0x1a')],'include':_0x40ee9c[_0xd3a6('0x1b')]?_['map'](_0x40ee9c[_0xd3a6('0x1b')],function(_0x1c572a){return{'model':db[_0x1c572a[_0xd3a6('0x1d')]],'as':_0x1c572a['as'],'attributes':_0x1c572a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x29bc80){logger[_0xd3a6('0x12')](_0xd3a6('0x14'),_0x3be20f);logger[_0xd3a6('0xd')](_0xd3a6('0x14'),_0x3be20f,JSON[_0xd3a6('0x1e')](_0x29bc80));_0x17191d(_0x29bc80);})['catch'](function(_0x47f420){logger['error']('ShowSquareOdbc',_0x47f420[_0xd3a6('0x11')],_0x3be20f);_0xa0d96c(_0x17a26c[_0xd3a6('0x10')](0x1f4,_0x47f420[_0xd3a6('0x11')]));});});}; \ No newline at end of file +var _0x5c64=['SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x12078a,_0x486458){var _0x2fe1b8=function(_0x12d897){while(--_0x12d897){_0x12078a['push'](_0x12078a['shift']());}};_0x2fe1b8(++_0x486458);}(_0x5c64,0x118));var _0x45c6=function(_0x4faeb5,_0x313718){_0x4faeb5=_0x4faeb5-0x0;var _0x50565f=_0x5c64[_0x4faeb5];return _0x50565f;};'use strict';var _=require(_0x45c6('0x0'));var util=require(_0x45c6('0x1'));var moment=require(_0x45c6('0x2'));var BPromise=require(_0x45c6('0x3'));var rs=require(_0x45c6('0x4'));var fs=require('fs');var Redis=require(_0x45c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x45c6('0x6'));var logger=require(_0x45c6('0x7'))(_0x45c6('0x8'));var config=require(_0x45c6('0x9'));var jayson=require(_0x45c6('0xa'));var client=jayson[_0x45c6('0xb')][_0x45c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b21df,_0xc55fdf,_0x27ec8d){return new BPromise(function(_0x564b51,_0x4195c3){return client[_0x45c6('0xd')](_0x5b21df,_0x27ec8d)[_0x45c6('0xe')](function(_0x3fc7e3){logger[_0x45c6('0xf')]('SquareOdbc,\x20%s,\x20%s',_0xc55fdf,_0x45c6('0x10'));logger['debug'](_0x45c6('0x11'),_0xc55fdf,'request\x20sent',JSON[_0x45c6('0x12')](_0x3fc7e3));if(_0x3fc7e3['error']){if(_0x3fc7e3[_0x45c6('0x13')]['code']===0x1f4){logger[_0x45c6('0x13')](_0x45c6('0x14'),_0xc55fdf,_0x3fc7e3[_0x45c6('0x13')]['message']);return _0x4195c3(_0x3fc7e3['error']['message']);}logger[_0x45c6('0x13')](_0x45c6('0x14'),_0xc55fdf,_0x3fc7e3['error'][_0x45c6('0x15')]);return _0x564b51(_0x3fc7e3[_0x45c6('0x13')][_0x45c6('0x15')]);}else{logger[_0x45c6('0xf')](_0x45c6('0x14'),_0xc55fdf,_0x45c6('0x10'));_0x564b51(_0x3fc7e3[_0x45c6('0x16')]['message']);}})[_0x45c6('0x17')](function(_0x40a8b3){logger['error'](_0x45c6('0x14'),_0xc55fdf,_0x40a8b3);_0x4195c3(_0x40a8b3);});});}exports[_0x45c6('0x18')]=function(_0x56fb27){var _0xb40d8f=this;return new Promise(function(_0x3e9a62,_0x317b93){return db['SquareOdbc'][_0x45c6('0x19')]({'raw':_0x56fb27[_0x45c6('0x1a')]?_0x56fb27[_0x45c6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x56fb27[_0x45c6('0x1a')]?_0x56fb27[_0x45c6('0x1a')][_0x45c6('0x1b')]||null:null,'attributes':_0x56fb27['options']?_0x56fb27[_0x45c6('0x1a')][_0x45c6('0x1c')]||null:null,'include':_0x56fb27['options']?_0x56fb27[_0x45c6('0x1a')][_0x45c6('0x1d')]?_[_0x45c6('0x1e')](_0x56fb27[_0x45c6('0x1a')][_0x45c6('0x1d')],function(_0x7b3b5c){return{'model':db[_0x7b3b5c['model']],'as':_0x7b3b5c['as'],'attributes':_0x7b3b5c['attributes'],'include':_0x7b3b5c[_0x45c6('0x1d')]?_[_0x45c6('0x1e')](_0x7b3b5c['include'],function(_0x50550f){return{'model':db[_0x50550f['model']],'as':_0x50550f['as'],'attributes':_0x50550f[_0x45c6('0x1c')],'include':_0x50550f[_0x45c6('0x1d')]?_[_0x45c6('0x1e')](_0x50550f[_0x45c6('0x1d')],function(_0x171933){return{'model':db[_0x171933[_0x45c6('0x1f')]],'as':_0x171933['as'],'attributes':_0x171933[_0x45c6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x45c6('0xe')](function(_0x18288e){logger[_0x45c6('0xf')]('ShowSquareOdbc',_0x56fb27);logger[_0x45c6('0x20')](_0x45c6('0x18'),_0x56fb27,JSON[_0x45c6('0x12')](_0x18288e));_0x3e9a62(_0x18288e);})['catch'](function(_0x14b40c){logger[_0x45c6('0x13')]('ShowSquareOdbc',_0x14b40c[_0x45c6('0x15')],_0x56fb27);_0x317b93(_0xb40d8f[_0x45c6('0x13')](0x1f4,_0x14b40c['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 440d69e..6fb3bf7 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/users','getUsers','create','post','addUsers','update','delete','removeUsers','exports','multer','util'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xdb28,0x106));var _0x8db2=function(_0x35d08c,_0x5dae18){_0x35d08c=_0x35d08c-0x0;var _0x4b63c4=_0xdb28[_0x35d08c];return _0x4b63c4;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./squareProject.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['put'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);router[_0x8db2('0x13')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x8db2('0x13')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x14')]);module[_0x8db2('0x15')]=router; \ No newline at end of file +var _0x0f97=['../../components/interaction/service','../../config/environment','./squareProject.controller','index','get','/:id','isAuthenticated','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x42f8ac,_0x4de22a){var _0x1907d0=function(_0x35ef9f){while(--_0x35ef9f){_0x42f8ac['push'](_0x42f8ac['shift']());}};_0x1907d0(++_0x4de22a);}(_0x0f97,0x196));var _0x70f9=function(_0x123824,_0x52a5c7){_0x123824=_0x123824-0x0;var _0x1421eb=_0x0f97[_0x123824];return _0x1421eb;};'use strict';var multer=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var timeout=require(_0x70f9('0x3'));var express=require(_0x70f9('0x4'));var router=express[_0x70f9('0x5')]();var fs_extra=require(_0x70f9('0x6'));var auth=require(_0x70f9('0x7'));var interaction=require(_0x70f9('0x8'));var config=require(_0x70f9('0x9'));var controller=require(_0x70f9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x70f9('0xb')]);router[_0x70f9('0xc')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller['show']);router['get'](_0x70f9('0xf'),auth[_0x70f9('0xe')](),controller[_0x70f9('0x10')]);router[_0x70f9('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/users',auth[_0x70f9('0xe')](),controller[_0x70f9('0x12')]);router[_0x70f9('0x13')](_0x70f9('0xd'),auth['isAuthenticated'](),controller[_0x70f9('0x14')]);router[_0x70f9('0x15')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller[_0x70f9('0x16')]);router['delete'](_0x70f9('0xf'),auth['isAuthenticated'](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1c98c7b..517c329 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 _0x1e2f=['sequelize','exports','STRING','name','TEXT','getDataValue','preproduction','utf8','BLOB','long','production','toString','DATE'];(function(_0x374787,_0x5855ad){var _0x8f3230=function(_0x2cbc24){while(--_0x2cbc24){_0x374787['push'](_0x374787['shift']());}};_0x8f3230(++_0x5855ad);}(_0x1e2f,0x1ee));var _0xf1e2=function(_0x32c790,_0x1c116d){_0x32c790=_0x32c790-0x0;var _0x593c05=_0x1e2f[_0x32c790];return _0x593c05;};'use strict';var Sequelize=require(_0xf1e2('0x0'));module[_0xf1e2('0x1')]={'name':{'type':Sequelize[_0xf1e2('0x2')],'unique':_0xf1e2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf1e2('0x2')]},'notes':{'type':Sequelize[_0xf1e2('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xf1e2('0x5')](_0xf1e2('0x6'))){return this[_0xf1e2('0x5')](_0xf1e2('0x6'))['toString'](_0xf1e2('0x7'));}}},'production':{'type':Sequelize[_0xf1e2('0x8')](_0xf1e2('0x9')),'get':function(){if(this[_0xf1e2('0x5')]('production')){return this['getDataValue'](_0xf1e2('0xa'))[_0xf1e2('0xb')](_0xf1e2('0x7'));}}},'savedAt':{'type':Sequelize[_0xf1e2('0xc')]},'publishedAt':{'type':Sequelize[_0xf1e2('0xc')]}}; \ No newline at end of file +var _0xcc4d=['getDataValue','preproduction','toString','long','production','DATE','sequelize','exports','STRING','TEXT','BLOB'];(function(_0x3507b5,_0x1ee543){var _0x2ab7f8=function(_0x1024a7){while(--_0x1024a7){_0x3507b5['push'](_0x3507b5['shift']());}};_0x2ab7f8(++_0x1ee543);}(_0xcc4d,0x103));var _0xdcc4=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xcc4d[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xdcc4('0x0'));module[_0xdcc4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xdcc4('0x2')]},'notes':{'type':Sequelize[_0xdcc4('0x3')]},'preproduction':{'type':Sequelize[_0xdcc4('0x4')]('long'),'get':function(){if(this[_0xdcc4('0x5')](_0xdcc4('0x6'))){return this[_0xdcc4('0x5')](_0xdcc4('0x6'))[_0xdcc4('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xdcc4('0x8')),'get':function(){if(this[_0xdcc4('0x5')](_0xdcc4('0x9'))){return this['getDataValue'](_0xdcc4('0x9'))[_0xdcc4('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0xdcc4('0xa')]},'publishedAt':{'type':Sequelize[_0xdcc4('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index dc14568..5092c91 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 _0x9582=['offset','set','Content-Range','then','destroy','get','UserProfileResource','publish','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','catch','params','keys','find','create','body','user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','agi','stringify','production','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','sort','nolimit','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count'];(function(_0x3286d5,_0x122e8f){var _0x53beb2=function(_0x307f57){while(--_0x307f57){_0x3286d5['push'](_0x3286d5['shift']());}};_0x53beb2(++_0x122e8f);}(_0x9582,0x95));var _0x2958=function(_0x16aa36,_0x49855c){_0x16aa36=_0x16aa36-0x0;var _0x2c5dca=_0x9582[_0x16aa36];return _0x2c5dca;};'use strict';var _=require(_0x2958('0x0'));var Redis=require(_0x2958('0x1'));var qs=require(_0x2958('0x2'));var logger=require(_0x2958('0x3'))(_0x2958('0x4'));var config=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];config[_0x2958('0x6')]=_[_0x2958('0x7')](config[_0x2958('0x6')],{'host':_0x2958('0x8'),'port':0x18eb});var socket=require(_0x2958('0x9'))(new Redis(config[_0x2958('0x6')]));require(_0x2958('0xa'))[_0x2958('0xb')](socket);function respondWithStatusCode(_0xa385ec,_0x2e571b){_0x2e571b=_0x2e571b||0xcc;return function(_0x56ca85){if(_0x56ca85){return _0xa385ec['sendStatus'](_0x2e571b);}return _0xa385ec[_0x2958('0xc')](_0x2e571b)['end']();};}function respondWithResult(_0x10db1e,_0x51e460){_0x51e460=_0x51e460||0xc8;return function(_0x44cccc){if(_0x44cccc){return _0x10db1e['status'](_0x51e460)[_0x2958('0xd')](_0x44cccc);}};}function respondWithFilteredResult(_0x29776c,_0x12f0b0){return function(_0x117ff0){if(_0x117ff0){var _0x11ec8d=typeof _0x12f0b0['offset']===_0x2958('0xe')&&typeof _0x12f0b0[_0x2958('0xf')]===_0x2958('0xe');var _0x20e06a=_0x117ff0[_0x2958('0x10')];var _0x29c794=_0x11ec8d?0x0:_0x12f0b0[_0x2958('0x11')];var _0x250d47=_0x11ec8d?_0x117ff0['count']:_0x12f0b0[_0x2958('0x11')]+_0x12f0b0[_0x2958('0xf')];var _0x4f2a1b;if(_0x250d47>=_0x20e06a){_0x250d47=_0x20e06a;_0x4f2a1b=0xc8;}else{_0x4f2a1b=0xce;}_0x29776c['status'](_0x4f2a1b);return _0x29776c[_0x2958('0x12')](_0x2958('0x13'),_0x29c794+'-'+_0x250d47+'/'+_0x20e06a)['json'](_0x117ff0);}return null;};}function saveUpdates(_0x3bef50){return function(_0x544563){if(_0x544563){return _0x544563['update'](_0x3bef50)[_0x2958('0x14')](function(_0x55779b){return _0x55779b;});}return null;};}function removeEntity(_0x55e261){return function(_0x54ef76){if(_0x54ef76){return _0x54ef76[_0x2958('0x15')]()[_0x2958('0x14')](function(){var _0x310d07=_0x54ef76[_0x2958('0x16')]({'plain':!![]});var _0x27599c='SquareProjects';return db[_0x2958('0x17')][_0x2958('0x15')]({'where':{'type':_0x27599c,'resourceId':_0x310d07['id']}})[_0x2958('0x14')](function(){return _0x54ef76;});})['then'](function(){var _0x1e77eb=new Redis(config['redis']);_0x1e77eb[_0x2958('0x18')]('agi',JSON['stringify']({'id':_0x54ef76['id'],'deleted':!![]}));})[_0x2958('0x14')](function(){_0x55e261[_0x2958('0xc')](0xcc)[_0x2958('0x19')]();});}};}function handleEntityNotFound(_0x26c5a5){return function(_0x2202f8){if(!_0x2202f8){_0x26c5a5[_0x2958('0x1a')](0x194);}return _0x2202f8;};}function handleError(_0x3f8641,_0x2b9818){_0x2b9818=_0x2b9818||0x1f4;return function(_0x330763){logger[_0x2958('0x1b')](_0x330763[_0x2958('0x1c')]);if(_0x330763[_0x2958('0x1d')]){delete _0x330763[_0x2958('0x1d')];}_0x3f8641[_0x2958('0xc')](_0x2b9818)[_0x2958('0x1e')](_0x330763);};}exports['index']=function(_0x574df5,_0x3c1155){var _0x33c5b0={},_0x28c1f5={},_0x43cf73={'count':0x0,'rows':[]};var _0x52bd32=_[_0x2958('0x1f')](db['SquareProject'][_0x2958('0x20')],function(_0x40adce){return{'name':_0x40adce[_0x2958('0x21')],'type':_0x40adce[_0x2958('0x22')][_0x2958('0x23')]};});_0x28c1f5[_0x2958('0x24')]=_[_0x2958('0x1f')](_0x52bd32,'name');_0x28c1f5[_0x2958('0x25')]=_['keys'](_0x574df5['query']);_0x28c1f5[_0x2958('0x26')]=_[_0x2958('0x27')](_0x28c1f5[_0x2958('0x24')],_0x28c1f5[_0x2958('0x25')]);_0x33c5b0[_0x2958('0x28')]=_[_0x2958('0x27')](_0x28c1f5[_0x2958('0x24')],qs[_0x2958('0x29')](_0x574df5['query'][_0x2958('0x29')]));_0x33c5b0[_0x2958('0x28')]=_0x33c5b0['attributes'][_0x2958('0x2a')]?_0x33c5b0['attributes']:_0x28c1f5[_0x2958('0x24')];if(!_0x574df5['query'][_0x2958('0x2b')]('nolimit')){_0x33c5b0[_0x2958('0xf')]=qs[_0x2958('0xf')](_0x574df5[_0x2958('0x25')][_0x2958('0xf')]);_0x33c5b0[_0x2958('0x11')]=qs[_0x2958('0x11')](_0x574df5[_0x2958('0x25')][_0x2958('0x11')]);}_0x33c5b0[_0x2958('0x2c')]=qs['sort'](_0x574df5[_0x2958('0x25')]['sort']);_0x33c5b0[_0x2958('0x2d')]=qs['filters'](_[_0x2958('0x2e')](_0x574df5[_0x2958('0x25')],_0x28c1f5[_0x2958('0x26')]),_0x52bd32);if(_0x574df5[_0x2958('0x25')][_0x2958('0x2f')]){_0x33c5b0[_0x2958('0x2d')]=_[_0x2958('0x30')](_0x33c5b0[_0x2958('0x2d')],{'$or':_[_0x2958('0x1f')](_0x52bd32,function(_0xc4a303){if(_0xc4a303[_0x2958('0x22')]!==_0x2958('0x31')){var _0x3ccd1d={};_0x3ccd1d[_0xc4a303['name']]={'$like':'%'+_0x574df5[_0x2958('0x25')][_0x2958('0x2f')]+'%'};return _0x3ccd1d;}})});}_0x33c5b0=_[_0x2958('0x30')]({},_0x33c5b0,_0x574df5[_0x2958('0x32')]);var _0x4e0db4={'where':_0x33c5b0[_0x2958('0x2d')]};return db[_0x2958('0x33')][_0x2958('0x10')](_0x4e0db4)[_0x2958('0x14')](function(_0x337bcc){_0x43cf73[_0x2958('0x10')]=_0x337bcc;if(_0x574df5[_0x2958('0x25')][_0x2958('0x34')]){_0x33c5b0[_0x2958('0x35')]=[{'all':!![]}];}return db[_0x2958('0x33')][_0x2958('0x36')](_0x33c5b0);})[_0x2958('0x14')](function(_0x319243){_0x43cf73['rows']=_0x319243;return _0x43cf73;})[_0x2958('0x14')](respondWithFilteredResult(_0x3c1155,_0x33c5b0))[_0x2958('0x37')](handleError(_0x3c1155,null));};exports['show']=function(_0x4fe061,_0x1394ed){var _0x265055={'raw':![],'where':{'id':_0x4fe061[_0x2958('0x38')]['id']}},_0xab188={};_0xab188[_0x2958('0x24')]=_[_0x2958('0x39')](db[_0x2958('0x33')][_0x2958('0x20')]);_0xab188[_0x2958('0x25')]=_[_0x2958('0x39')](_0x4fe061[_0x2958('0x25')]);_0xab188[_0x2958('0x26')]=_[_0x2958('0x27')](_0xab188['model'],_0xab188[_0x2958('0x25')]);_0x265055[_0x2958('0x28')]=_[_0x2958('0x27')](_0xab188[_0x2958('0x24')],qs['fields'](_0x4fe061[_0x2958('0x25')]['fields']));_0x265055['attributes']=_0x265055[_0x2958('0x28')][_0x2958('0x2a')]?_0x265055[_0x2958('0x28')]:_0xab188[_0x2958('0x24')];if(_0x4fe061[_0x2958('0x25')][_0x2958('0x34')]){_0x265055['include']=[{'all':!![]}];}_0x265055=_[_0x2958('0x30')]({},_0x265055,_0x4fe061['options']);return db['SquareProject'][_0x2958('0x3a')](_0x265055)['then'](handleEntityNotFound(_0x1394ed,null))[_0x2958('0x14')](respondWithResult(_0x1394ed,null))[_0x2958('0x37')](handleError(_0x1394ed,null));};exports[_0x2958('0x3b')]=function(_0x29641d,_0x921c72){return db[_0x2958('0x33')][_0x2958('0x3b')](_0x29641d[_0x2958('0x3c')],{})['then'](function(_0x1c1597){var _0x1012c5=_0x29641d[_0x2958('0x3d')][_0x2958('0x16')]({'plain':!![]});if(!_0x1012c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1012c5[_0x2958('0x3e')]===_0x2958('0x3d')){var _0x4a51b1=_0x1c1597[_0x2958('0x16')]({'plain':!![]});var _0x682c14=_0x2958('0x3f');return db[_0x2958('0x40')][_0x2958('0x3a')]({'where':{'name':_0x682c14,'userProfileId':_0x1012c5[_0x2958('0x41')]},'raw':!![]})['then'](function(_0x1fff2a){if(_0x1fff2a&&_0x1fff2a[_0x2958('0x42')]===0x0){return db[_0x2958('0x17')][_0x2958('0x3b')]({'name':_0x4a51b1[_0x2958('0x1d')],'resourceId':_0x4a51b1['id'],'type':_0x1fff2a[_0x2958('0x1d')],'sectionId':_0x1fff2a['id']},{})[_0x2958('0x14')](function(){return _0x1c1597;});}else{return _0x1c1597;}})[_0x2958('0x37')](function(_0x2e0fc7){logger[_0x2958('0x1b')](_0x2958('0x43'),_0x2e0fc7);throw _0x2e0fc7;});}return _0x1c1597;})[_0x2958('0x14')](respondWithResult(_0x921c72,0xc9))[_0x2958('0x37')](handleError(_0x921c72,null));};exports[_0x2958('0x44')]=function(_0x1bb780,_0xfce675){if(_0x1bb780[_0x2958('0x3c')]['id']){delete _0x1bb780['body']['id'];}return db[_0x2958('0x33')]['find']({'where':{'id':_0x1bb780[_0x2958('0x38')]['id']}})[_0x2958('0x14')](handleEntityNotFound(_0xfce675,null))[_0x2958('0x14')](saveUpdates(_0x1bb780['body'],null))['then'](function(_0x39cc25){if(!_0x39cc25)return;var _0x394c29=_0x39cc25[_0x2958('0x16')]({'plain':!![]});return _0x394c29;})['then'](function(_0x524562){var _0x3acbe1=new Redis(config[_0x2958('0x6')]);_0x3acbe1[_0x2958('0x18')](_0x2958('0x45'),JSON[_0x2958('0x46')](_[_0x2958('0x2e')](_0x524562,['id',_0x2958('0x1d'),_0x2958('0x47')])));return _0x524562;})[_0x2958('0x14')](respondWithResult(_0xfce675,null))['catch'](handleError(_0xfce675,null));};exports[_0x2958('0x15')]=function(_0x384037,_0x5671d1){return db[_0x2958('0x33')][_0x2958('0x3a')]({'where':{'id':_0x384037[_0x2958('0x38')]['id']}})[_0x2958('0x14')](handleEntityNotFound(_0x5671d1,null))[_0x2958('0x14')](removeEntity(_0x5671d1,null))[_0x2958('0x37')](handleError(_0x5671d1,null));};exports['addUsers']=function(_0x436f47,_0xcf8e36){return db[_0x2958('0x33')]['find']({'where':{'id':_0x436f47['params']['id']}})[_0x2958('0x14')](handleEntityNotFound(_0xcf8e36,null))['then'](function(_0x799c6f){if(_0x799c6f){return _0x799c6f['addUsers'](_0x436f47[_0x2958('0x3c')][_0x2958('0x48')],_[_0x2958('0x49')](_0x436f47[_0x2958('0x3c')],[_0x2958('0x48'),'id'])||{});}})['then'](respondWithResult(_0xcf8e36,null))['catch'](handleError(_0xcf8e36,null));};exports[_0x2958('0x4a')]=function(_0x3e11eb,_0xfa171d){return db['SquareProject']['find']({'where':{'id':_0x3e11eb[_0x2958('0x38')]['id']}})[_0x2958('0x14')](handleEntityNotFound(_0xfa171d,null))[_0x2958('0x14')](function(_0x3212c5){if(_0x3212c5){return _0x3212c5[_0x2958('0x4a')](_0x3e11eb[_0x2958('0x25')][_0x2958('0x48')])[_0x2958('0x14')](function(){if(_[_0x2958('0x4b')](_0x3e11eb[_0x2958('0x25')][_0x2958('0x48')])){for(var _0x2bef16=0x0;_0x2bef16<_0x3e11eb[_0x2958('0x25')]['ids'][_0x2958('0x2a')];_0x2bef16+=0x1){socket[_0x2958('0x4c')](_0x2958('0x4d'),{'UserId':Number(_0x3e11eb[_0x2958('0x25')][_0x2958('0x48')][_0x2bef16]),'SquareProjectId':Number(_0x3e11eb[_0x2958('0x38')]['id'])});}}else{socket[_0x2958('0x4c')](_0x2958('0x4d'),{'UserId':Number(_0x3e11eb[_0x2958('0x25')]['ids']),'SquareProjectId':Number(_0x3e11eb[_0x2958('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0xfa171d,null))[_0x2958('0x37')](handleError(_0xfa171d,null));};exports[_0x2958('0x4e')]=function(_0x31a596,_0x4a86a5){var _0x510672={};var _0x49fed2={};var _0x24bd78;var _0x41d2ef;return db[_0x2958('0x33')][_0x2958('0x4f')]({'where':{'id':_0x31a596[_0x2958('0x38')]['id']}})[_0x2958('0x14')](handleEntityNotFound(_0x4a86a5,null))[_0x2958('0x14')](function(_0x13f850){if(_0x13f850){_0x24bd78=_0x13f850;_0x49fed2['model']=_['keys'](db[_0x2958('0x50')][_0x2958('0x20')]);_0x49fed2[_0x2958('0x25')]=_[_0x2958('0x39')](_0x31a596['query']);_0x49fed2[_0x2958('0x26')]=_[_0x2958('0x27')](_0x49fed2[_0x2958('0x24')],_0x49fed2[_0x2958('0x25')]);_0x510672['attributes']=_['intersection'](_0x49fed2['model'],qs['fields'](_0x31a596[_0x2958('0x25')][_0x2958('0x29')]));_0x510672['attributes']=_0x510672[_0x2958('0x28')][_0x2958('0x2a')]?_0x510672[_0x2958('0x28')]:_0x49fed2[_0x2958('0x24')];_0x510672[_0x2958('0x2c')]=qs[_0x2958('0x51')](_0x31a596['query'][_0x2958('0x51')]);_0x510672[_0x2958('0x2d')]=qs[_0x2958('0x26')](_['pick'](_0x31a596[_0x2958('0x25')],_0x49fed2['filters']));if(_0x31a596['query']['filter']){_0x510672['where']=_[_0x2958('0x30')](_0x510672['where'],{'$or':_[_0x2958('0x1f')](_0x510672[_0x2958('0x28')],function(_0x39a95d){var _0x41ead9={};_0x41ead9[_0x39a95d]={'$like':'%'+_0x31a596[_0x2958('0x25')][_0x2958('0x2f')]+'%'};return _0x41ead9;})});}_0x510672=_['merge']({},_0x510672,_0x31a596[_0x2958('0x32')]);return _0x24bd78[_0x2958('0x4e')](_0x510672);}})[_0x2958('0x14')](function(_0x23148d){if(_0x23148d){_0x41d2ef=_0x23148d[_0x2958('0x2a')];if(!_0x31a596[_0x2958('0x25')][_0x2958('0x2b')](_0x2958('0x52'))){_0x510672[_0x2958('0xf')]=qs[_0x2958('0xf')](_0x31a596[_0x2958('0x25')][_0x2958('0xf')]);_0x510672[_0x2958('0x11')]=qs[_0x2958('0x11')](_0x31a596[_0x2958('0x25')][_0x2958('0x11')]);}return _0x24bd78[_0x2958('0x4e')](_0x510672);}})[_0x2958('0x14')](function(_0x100d49){if(_0x100d49){return _0x100d49?{'count':_0x41d2ef,'rows':_0x100d49}:null;}})[_0x2958('0x14')](respondWithResult(_0x4a86a5,null))[_0x2958('0x37')](handleError(_0x4a86a5,null));}; \ No newline at end of file +var _0x4c60=['include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','localhost','socket.io-emitter','redis','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','agi','stringify','name','send','index','map','SquareProject','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options'];(function(_0x1fb68f,_0x3ca8d6){var _0x4b46cd=function(_0x4a1b31){while(--_0x4a1b31){_0x1fb68f['push'](_0x1fb68f['shift']());}};_0x4b46cd(++_0x3ca8d6);}(_0x4c60,0xc1));var _0x04c6=function(_0x57d979,_0x135e67){_0x57d979=_0x57d979-0x0;var _0x1f0747=_0x4c60[_0x57d979];return _0x1f0747;};'use strict';var _=require(_0x04c6('0x0'));var Redis=require(_0x04c6('0x1'));var qs=require(_0x04c6('0x2'));var logger=require(_0x04c6('0x3'))('api');var config=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x04c6('0x5'),'port':0x18eb});var socket=require(_0x04c6('0x6'))(new Redis(config[_0x04c6('0x7')]));require(_0x04c6('0x8'))[_0x04c6('0x9')](socket);function respondWithStatusCode(_0x39be2d,_0x8f9b13){_0x8f9b13=_0x8f9b13||0xcc;return function(_0x530a48){if(_0x530a48){return _0x39be2d[_0x04c6('0xa')](_0x8f9b13);}return _0x39be2d[_0x04c6('0xb')](_0x8f9b13)[_0x04c6('0xc')]();};}function respondWithResult(_0x30b901,_0x52a9af){_0x52a9af=_0x52a9af||0xc8;return function(_0x59a98c){if(_0x59a98c){return _0x30b901['status'](_0x52a9af)[_0x04c6('0xd')](_0x59a98c);}};}function respondWithFilteredResult(_0x5584cd,_0x15d31a){return function(_0x2772fa){if(_0x2772fa){var _0x5236c8=typeof _0x15d31a[_0x04c6('0xe')]===_0x04c6('0xf')&&typeof _0x15d31a[_0x04c6('0x10')]===_0x04c6('0xf');var _0x52cdcf=_0x2772fa[_0x04c6('0x11')];var _0x453342=_0x5236c8?0x0:_0x15d31a[_0x04c6('0xe')];var _0x56422a=_0x5236c8?_0x2772fa[_0x04c6('0x11')]:_0x15d31a[_0x04c6('0xe')]+_0x15d31a[_0x04c6('0x10')];var _0x3e80a6;if(_0x56422a>=_0x52cdcf){_0x56422a=_0x52cdcf;_0x3e80a6=0xc8;}else{_0x3e80a6=0xce;}_0x5584cd[_0x04c6('0xb')](_0x3e80a6);return _0x5584cd[_0x04c6('0x12')](_0x04c6('0x13'),_0x453342+'-'+_0x56422a+'/'+_0x52cdcf)[_0x04c6('0xd')](_0x2772fa);}return null;};}function saveUpdates(_0x5a5a66){return function(_0x31edf9){if(_0x31edf9){return _0x31edf9[_0x04c6('0x14')](_0x5a5a66)[_0x04c6('0x15')](function(_0x2bc754){return _0x2bc754;});}return null;};}function removeEntity(_0x43596a){return function(_0xfb4db5){if(_0xfb4db5){return _0xfb4db5[_0x04c6('0x16')]()[_0x04c6('0x15')](function(){var _0x47f400=_0xfb4db5[_0x04c6('0x17')]({'plain':!![]});var _0x13e472=_0x04c6('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x13e472,'resourceId':_0x47f400['id']}})['then'](function(){return _0xfb4db5;});})[_0x04c6('0x15')](function(){var _0xb997e0=new Redis(config['redis']);_0xb997e0['publish'](_0x04c6('0x19'),JSON[_0x04c6('0x1a')]({'id':_0xfb4db5['id'],'deleted':!![]}));})[_0x04c6('0x15')](function(){_0x43596a['status'](0xcc)[_0x04c6('0xc')]();});}};}function handleEntityNotFound(_0x13f2dc){return function(_0x9d41f8){if(!_0x9d41f8){_0x13f2dc['sendStatus'](0x194);}return _0x9d41f8;};}function handleError(_0x2d3277,_0x41e29f){_0x41e29f=_0x41e29f||0x1f4;return function(_0x562491){logger['error'](_0x562491['stack']);if(_0x562491[_0x04c6('0x1b')]){delete _0x562491[_0x04c6('0x1b')];}_0x2d3277[_0x04c6('0xb')](_0x41e29f)[_0x04c6('0x1c')](_0x562491);};}exports[_0x04c6('0x1d')]=function(_0x52e5f5,_0x562952){var _0x383435={},_0x2ab1d2={},_0x9acfa={'count':0x0,'rows':[]};var _0x3233d7=_[_0x04c6('0x1e')](db[_0x04c6('0x1f')]['rawAttributes'],function(_0x1d0d3f){return{'name':_0x1d0d3f[_0x04c6('0x20')],'type':_0x1d0d3f['type'][_0x04c6('0x21')]};});_0x2ab1d2[_0x04c6('0x22')]=_['map'](_0x3233d7,'name');_0x2ab1d2[_0x04c6('0x23')]=_[_0x04c6('0x24')](_0x52e5f5[_0x04c6('0x23')]);_0x2ab1d2[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x2ab1d2[_0x04c6('0x22')],_0x2ab1d2['query']);_0x383435['attributes']=_['intersection'](_0x2ab1d2[_0x04c6('0x22')],qs['fields'](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x27')]));_0x383435['attributes']=_0x383435[_0x04c6('0x28')][_0x04c6('0x29')]?_0x383435[_0x04c6('0x28')]:_0x2ab1d2[_0x04c6('0x22')];if(!_0x52e5f5['query'][_0x04c6('0x2a')](_0x04c6('0x2b'))){_0x383435[_0x04c6('0x10')]=qs[_0x04c6('0x10')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x10')]);_0x383435[_0x04c6('0xe')]=qs[_0x04c6('0xe')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0xe')]);}_0x383435[_0x04c6('0x2c')]=qs[_0x04c6('0x2d')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x2d')]);_0x383435[_0x04c6('0x2e')]=qs['filters'](_[_0x04c6('0x2f')](_0x52e5f5[_0x04c6('0x23')],_0x2ab1d2[_0x04c6('0x25')]),_0x3233d7);if(_0x52e5f5[_0x04c6('0x23')]['filter']){_0x383435[_0x04c6('0x2e')]=_[_0x04c6('0x30')](_0x383435['where'],{'$or':_['map'](_0x3233d7,function(_0x4aac49){if(_0x4aac49[_0x04c6('0x31')]!==_0x04c6('0x32')){var _0x4f9a6c={};_0x4f9a6c[_0x4aac49[_0x04c6('0x1b')]]={'$like':'%'+_0x52e5f5['query'][_0x04c6('0x33')]+'%'};return _0x4f9a6c;}})});}_0x383435=_[_0x04c6('0x30')]({},_0x383435,_0x52e5f5[_0x04c6('0x34')]);var _0x2b28cd={'where':_0x383435['where']};return db['SquareProject'][_0x04c6('0x11')](_0x2b28cd)[_0x04c6('0x15')](function(_0x50041f){_0x9acfa[_0x04c6('0x11')]=_0x50041f;if(_0x52e5f5['query']['includeAll']){_0x383435[_0x04c6('0x35')]=[{'all':!![]}];}return db['SquareProject'][_0x04c6('0x36')](_0x383435);})[_0x04c6('0x15')](function(_0x59ca18){_0x9acfa[_0x04c6('0x37')]=_0x59ca18;return _0x9acfa;})['then'](respondWithFilteredResult(_0x562952,_0x383435))[_0x04c6('0x38')](handleError(_0x562952,null));};exports[_0x04c6('0x39')]=function(_0x2d83eb,_0x120238){var _0x679718={'raw':![],'where':{'id':_0x2d83eb[_0x04c6('0x3a')]['id']}},_0x57ed53={};_0x57ed53['model']=_[_0x04c6('0x24')](db['SquareProject'][_0x04c6('0x3b')]);_0x57ed53[_0x04c6('0x23')]=_[_0x04c6('0x24')](_0x2d83eb[_0x04c6('0x23')]);_0x57ed53[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x57ed53[_0x04c6('0x22')],_0x57ed53['query']);_0x679718[_0x04c6('0x28')]=_['intersection'](_0x57ed53[_0x04c6('0x22')],qs['fields'](_0x2d83eb['query'][_0x04c6('0x27')]));_0x679718['attributes']=_0x679718[_0x04c6('0x28')][_0x04c6('0x29')]?_0x679718[_0x04c6('0x28')]:_0x57ed53['model'];if(_0x2d83eb[_0x04c6('0x23')][_0x04c6('0x3c')]){_0x679718[_0x04c6('0x35')]=[{'all':!![]}];}_0x679718=_[_0x04c6('0x30')]({},_0x679718,_0x2d83eb[_0x04c6('0x34')]);return db[_0x04c6('0x1f')][_0x04c6('0x3d')](_0x679718)['then'](handleEntityNotFound(_0x120238,null))['then'](respondWithResult(_0x120238,null))[_0x04c6('0x38')](handleError(_0x120238,null));};exports[_0x04c6('0x3e')]=function(_0x417cb7,_0x5d6726){return db[_0x04c6('0x1f')][_0x04c6('0x3e')](_0x417cb7[_0x04c6('0x3f')],{})['then'](function(_0x4c9942){var _0x56c7e6=_0x417cb7[_0x04c6('0x40')][_0x04c6('0x17')]({'plain':!![]});if(!_0x56c7e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56c7e6[_0x04c6('0x41')]===_0x04c6('0x40')){var _0x2bd045=_0x4c9942['get']({'plain':!![]});var _0x392983=_0x04c6('0x18');return db['UserProfileSection'][_0x04c6('0x3d')]({'where':{'name':_0x392983,'userProfileId':_0x56c7e6[_0x04c6('0x42')]},'raw':!![]})[_0x04c6('0x15')](function(_0xee2822){if(_0xee2822&&_0xee2822['autoAssociation']===0x0){return db[_0x04c6('0x43')][_0x04c6('0x3e')]({'name':_0x2bd045[_0x04c6('0x1b')],'resourceId':_0x2bd045['id'],'type':_0xee2822[_0x04c6('0x1b')],'sectionId':_0xee2822['id']},{})['then'](function(){return _0x4c9942;});}else{return _0x4c9942;}})[_0x04c6('0x38')](function(_0x17824f){logger[_0x04c6('0x44')](_0x04c6('0x45'),_0x17824f);throw _0x17824f;});}return _0x4c9942;})['then'](respondWithResult(_0x5d6726,0xc9))[_0x04c6('0x38')](handleError(_0x5d6726,null));};exports[_0x04c6('0x14')]=function(_0x15ec61,_0x489361){if(_0x15ec61[_0x04c6('0x3f')]['id']){delete _0x15ec61[_0x04c6('0x3f')]['id'];}return db[_0x04c6('0x1f')][_0x04c6('0x3d')]({'where':{'id':_0x15ec61[_0x04c6('0x3a')]['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x15')](saveUpdates(_0x15ec61[_0x04c6('0x3f')],null))[_0x04c6('0x15')](function(_0x12f2c6){if(!_0x12f2c6)return;var _0x27e805=_0x12f2c6[_0x04c6('0x17')]({'plain':!![]});return _0x27e805;})[_0x04c6('0x15')](function(_0x54e577){var _0x3a80f6=new Redis(config[_0x04c6('0x7')]);_0x3a80f6[_0x04c6('0x46')](_0x04c6('0x19'),JSON[_0x04c6('0x1a')](_['pick'](_0x54e577,['id',_0x04c6('0x1b'),_0x04c6('0x47')])));return _0x54e577;})[_0x04c6('0x15')](respondWithResult(_0x489361,null))[_0x04c6('0x38')](handleError(_0x489361,null));};exports[_0x04c6('0x16')]=function(_0x45fbd5,_0x111364){return db[_0x04c6('0x1f')][_0x04c6('0x3d')]({'where':{'id':_0x45fbd5[_0x04c6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x111364,null))['then'](removeEntity(_0x111364,null))['catch'](handleError(_0x111364,null));};exports['addUsers']=function(_0x3be262,_0x4dce86){return db[_0x04c6('0x1f')]['find']({'where':{'id':_0x3be262[_0x04c6('0x3a')]['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x4dce86,null))['then'](function(_0x4dd6bb){if(_0x4dd6bb){return _0x4dd6bb[_0x04c6('0x48')](_0x3be262[_0x04c6('0x3f')][_0x04c6('0x49')],_[_0x04c6('0x4a')](_0x3be262['body'],[_0x04c6('0x49'),'id'])||{});}})[_0x04c6('0x15')](respondWithResult(_0x4dce86,null))[_0x04c6('0x38')](handleError(_0x4dce86,null));};exports[_0x04c6('0x4b')]=function(_0x24c5be,_0x29c72f){return db[_0x04c6('0x1f')]['find']({'where':{'id':_0x24c5be[_0x04c6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x29c72f,null))[_0x04c6('0x15')](function(_0x3bbd8b){if(_0x3bbd8b){return _0x3bbd8b['removeUsers'](_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')])[_0x04c6('0x15')](function(){if(_[_0x04c6('0x4c')](_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')])){for(var _0xf073a8=0x0;_0xf073a8<_0x24c5be[_0x04c6('0x23')]['ids'][_0x04c6('0x29')];_0xf073a8+=0x1){socket['emit'](_0x04c6('0x4d'),{'UserId':Number(_0x24c5be[_0x04c6('0x23')]['ids'][_0xf073a8]),'SquareProjectId':Number(_0x24c5be['params']['id'])});}}else{socket[_0x04c6('0x4e')]('userSquareProject:remove',{'UserId':Number(_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')]),'SquareProjectId':Number(_0x24c5be['params']['id'])});}});}})[_0x04c6('0x15')](respondWithStatusCode(_0x29c72f,null))[_0x04c6('0x38')](handleError(_0x29c72f,null));};exports[_0x04c6('0x4f')]=function(_0x1cc1a1,_0x2be139){var _0xd12535={};var _0x3e5a53={};var _0x35ca98;var _0x243bc4;return db[_0x04c6('0x1f')][_0x04c6('0x50')]({'where':{'id':_0x1cc1a1['params']['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x2be139,null))[_0x04c6('0x15')](function(_0x289612){if(_0x289612){_0x35ca98=_0x289612;_0x3e5a53[_0x04c6('0x22')]=_['keys'](db[_0x04c6('0x51')][_0x04c6('0x3b')]);_0x3e5a53[_0x04c6('0x23')]=_['keys'](_0x1cc1a1['query']);_0x3e5a53[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x3e5a53[_0x04c6('0x22')],_0x3e5a53[_0x04c6('0x23')]);_0xd12535[_0x04c6('0x28')]=_[_0x04c6('0x26')](_0x3e5a53['model'],qs[_0x04c6('0x27')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x27')]));_0xd12535['attributes']=_0xd12535['attributes'][_0x04c6('0x29')]?_0xd12535[_0x04c6('0x28')]:_0x3e5a53[_0x04c6('0x22')];_0xd12535[_0x04c6('0x2c')]=qs['sort'](_0x1cc1a1[_0x04c6('0x23')]['sort']);_0xd12535['where']=qs[_0x04c6('0x25')](_[_0x04c6('0x2f')](_0x1cc1a1[_0x04c6('0x23')],_0x3e5a53[_0x04c6('0x25')]));if(_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x33')]){_0xd12535[_0x04c6('0x2e')]=_['merge'](_0xd12535[_0x04c6('0x2e')],{'$or':_[_0x04c6('0x1e')](_0xd12535[_0x04c6('0x28')],function(_0x329c82){var _0x1c2e79={};_0x1c2e79[_0x329c82]={'$like':'%'+_0x1cc1a1['query']['filter']+'%'};return _0x1c2e79;})});}_0xd12535=_[_0x04c6('0x30')]({},_0xd12535,_0x1cc1a1[_0x04c6('0x34')]);return _0x35ca98[_0x04c6('0x4f')](_0xd12535);}})['then'](function(_0x38bd2e){if(_0x38bd2e){_0x243bc4=_0x38bd2e[_0x04c6('0x29')];if(!_0x1cc1a1['query'][_0x04c6('0x2a')](_0x04c6('0x2b'))){_0xd12535[_0x04c6('0x10')]=qs[_0x04c6('0x10')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x10')]);_0xd12535[_0x04c6('0xe')]=qs[_0x04c6('0xe')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0xe')]);}return _0x35ca98[_0x04c6('0x4f')](_0xd12535);}})[_0x04c6('0x15')](function(_0x38900b){if(_0x38900b){return _0x38900b?{'count':_0x243bc4,'rows':_0x38900b}:null;}})['then'](respondWithResult(_0x2be139,null))[_0x04c6('0x38')](handleError(_0x2be139,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cc1a99f..4cf054a 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 _0xe7e5=['exports','SquareProject','setMaxListeners','save','update','emit','hook'];(function(_0x26b2b0,_0x3b5795){var _0x56b527=function(_0x1f9bed){while(--_0x1f9bed){_0x26b2b0['push'](_0x26b2b0['shift']());}};_0x56b527(++_0x3b5795);}(_0xe7e5,0x94));var _0x5e7e=function(_0x1728ca,_0x16c3af){_0x1728ca=_0x1728ca-0x0;var _0x1c99ed=_0xe7e5[_0x1728ca];return _0x1c99ed;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x5e7e('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5e7e('0x1')](0x0);var events={'afterCreate':_0x5e7e('0x2'),'afterUpdate':_0x5e7e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1bd75e){return function(_0x5517a6,_0x2cb5b3,_0x46242d){SquareProjectEvents[_0x5e7e('0x4')](_0x1bd75e+':'+_0x5517a6['id'],_0x5517a6);SquareProjectEvents['emit'](_0x1bd75e,_0x5517a6);_0x46242d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x5e7e('0x5')](e,emitEvent(event));}}module[_0x5e7e('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x2227=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2a2d16,_0x1af8e3){var _0xf54559=function(_0x1da48e){while(--_0x1da48e){_0x2a2d16['push'](_0x2a2d16['shift']());}};_0xf54559(++_0x1af8e3);}(_0x2227,0x103));var _0x7222=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x2227[_0x12d6c2];return _0x1c9825;};'use strict';var EventEmitter=require(_0x7222('0x0'));var SquareProject=require(_0x7222('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7222('0x2'),'afterUpdate':_0x7222('0x3'),'afterDestroy':'remove'};function emitEvent(_0x433a39){return function(_0x500e49,_0x532b3d,_0x5497b5){SquareProjectEvents['emit'](_0x433a39+':'+_0x500e49['id'],_0x500e49);SquareProjectEvents[_0x7222('0x4')](_0x433a39,_0x500e49);_0x5497b5(null);};}for(var e in events){if(events[_0x7222('0x5')](e)){var event=events[e];SquareProject[_0x7222('0x6')](e,emitEvent(event));}}module[_0x7222('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index ef7c108..6c60446 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 _0x6a59=['bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','moment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6a59,0x128));var _0x96a5=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x6a59[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x96a5('0x0'));var util=require(_0x96a5('0x1'));var logger=require(_0x96a5('0x2'))('api');var moment=require(_0x96a5('0x3'));var BPromise=require(_0x96a5('0x4'));var rp=require(_0x96a5('0x5'));var fs=require('fs');var path=require(_0x96a5('0x6'));var rimraf=require(_0x96a5('0x7'));var config=require(_0x96a5('0x8'));var attributes=require(_0x96a5('0x9'));module[_0x96a5('0xa')]=function(_0x4ba8f8,_0x134a9e){return _0x4ba8f8[_0x96a5('0xb')](_0x96a5('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc82936,_0x5c064a,_0x15f07c){if(_0xc82936['changed'](_0x96a5('0xd'))){_0xc82936[_0x96a5('0xe')]=moment()[_0x96a5('0xf')](_0x96a5('0x10'));}if(_0xc82936[_0x96a5('0x11')](_0x96a5('0x12'))){_0xc82936[_0x96a5('0x13')]=moment()[_0x96a5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x15f07c(null,_0xc82936);}}});}; \ No newline at end of file +var _0xa785=['changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0xa785,0x138));var _0x5a78=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xa785[_0x39780c];return _0x53c19b;};'use strict';var _=require(_0x5a78('0x0'));var util=require(_0x5a78('0x1'));var logger=require(_0x5a78('0x2'))(_0x5a78('0x3'));var moment=require(_0x5a78('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a78('0x5'));var fs=require('fs');var path=require(_0x5a78('0x6'));var rimraf=require(_0x5a78('0x7'));var config=require(_0x5a78('0x8'));var attributes=require(_0x5a78('0x9'));module[_0x5a78('0xa')]=function(_0x44d645,_0x3596b8){return _0x44d645['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f2e77,_0x5edea3,_0x35110c){if(_0x1f2e77[_0x5a78('0xb')](_0x5a78('0xc'))){_0x1f2e77[_0x5a78('0xd')]=moment()['format'](_0x5a78('0xe'));}if(_0x1f2e77[_0x5a78('0xb')](_0x5a78('0xf'))){_0x1f2e77['publishedAt']=moment()[_0x5a78('0x10')](_0x5a78('0xe'));}_0x35110c(null,_0x1f2e77);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 34ffc96..b7f4370 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 _0x3190=['error','message','ShowSquareProject','find','info','catch','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','include','map','model','then','debug','stringify'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3190,0x18e));var _0x0319=function(_0x2c4558,_0xdde7c8){_0x2c4558=_0x2c4558-0x0;var _0x1c75df=_0x3190[_0x2c4558];return _0x1c75df;};'use strict';var _=require('lodash');var Redis=require(_0x0319('0x0'));var db=require(_0x0319('0x1'))['db'];var logger=require(_0x0319('0x2'))(_0x0319('0x3'));var config=require('../../config/environment');config[_0x0319('0x4')]=_[_0x0319('0x5')](config[_0x0319('0x4')],{'host':_0x0319('0x6'),'port':0x18eb});var socket=require(_0x0319('0x7'))(new Redis(config[_0x0319('0x4')]));require(_0x0319('0x8'))[_0x0319('0x9')](socket);exports[_0x0319('0xa')]=function(_0x1ff18f){var _0x20e31a=this;return new Promise(function(_0x3ebc34,_0x4e58a3){return db[_0x0319('0xb')]['findAll']({'raw':_0x1ff18f[_0x0319('0xc')]?_0x1ff18f['options'][_0x0319('0xd')]===undefined?!![]:![]:!![],'where':_0x1ff18f[_0x0319('0xc')]?_0x1ff18f[_0x0319('0xc')][_0x0319('0xe')]||null:null,'attributes':_0x1ff18f[_0x0319('0xc')]?_0x1ff18f[_0x0319('0xc')][_0x0319('0xf')]||null:null,'limit':_0x1ff18f[_0x0319('0xc')]?_0x1ff18f['options']['limit']||null:null,'include':_0x1ff18f['options']?_0x1ff18f[_0x0319('0xc')][_0x0319('0x10')]?_[_0x0319('0x11')](_0x1ff18f[_0x0319('0xc')][_0x0319('0x10')],function(_0x18b52e){return{'model':db[_0x18b52e['model']],'as':_0x18b52e['as'],'attributes':_0x18b52e[_0x0319('0xf')],'include':_0x18b52e[_0x0319('0x10')]?_['map'](_0x18b52e[_0x0319('0x10')],function(_0xb6f692){return{'model':db[_0xb6f692['model']],'as':_0xb6f692['as'],'attributes':_0xb6f692[_0x0319('0xf')],'include':_0xb6f692[_0x0319('0x10')]?_[_0x0319('0x11')](_0xb6f692[_0x0319('0x10')],function(_0x3d577e){return{'model':db[_0x3d577e[_0x0319('0x12')]],'as':_0x3d577e['as'],'attributes':_0x3d577e[_0x0319('0xf')]};}):[]};}):[]};}):[]:[]})[_0x0319('0x13')](function(_0x24da6d){logger['info'](_0x0319('0xa'),_0x1ff18f);logger[_0x0319('0x14')]('GetSquareProjects',_0x1ff18f,JSON[_0x0319('0x15')](_0x24da6d));_0x3ebc34(_0x24da6d);})['catch'](function(_0x4e5e32){logger[_0x0319('0x16')](_0x0319('0xa'),_0x4e5e32[_0x0319('0x17')],_0x1ff18f);_0x4e58a3(_0x20e31a[_0x0319('0x16')](0x1f4,_0x4e5e32[_0x0319('0x17')]));});});};exports[_0x0319('0x18')]=function(_0x5b6812){var _0x40b258=this;return new Promise(function(_0x3ac6d7,_0x21faa1){return db[_0x0319('0xb')][_0x0319('0x19')]({'raw':_0x5b6812[_0x0319('0xc')]?_0x5b6812[_0x0319('0xc')][_0x0319('0xd')]===undefined?!![]:![]:!![],'where':_0x5b6812[_0x0319('0xc')]?_0x5b6812[_0x0319('0xc')][_0x0319('0xe')]||null:null,'attributes':_0x5b6812['options']?_0x5b6812['options']['attributes']||null:null,'include':_0x5b6812['options']?_0x5b6812[_0x0319('0xc')]['include']?_[_0x0319('0x11')](_0x5b6812[_0x0319('0xc')][_0x0319('0x10')],function(_0x3c5a08){return{'model':db[_0x3c5a08['model']],'as':_0x3c5a08['as'],'attributes':_0x3c5a08[_0x0319('0xf')],'include':_0x3c5a08[_0x0319('0x10')]?_[_0x0319('0x11')](_0x3c5a08[_0x0319('0x10')],function(_0x30367f){return{'model':db[_0x30367f['model']],'as':_0x30367f['as'],'attributes':_0x30367f[_0x0319('0xf')],'include':_0x30367f[_0x0319('0x10')]?_[_0x0319('0x11')](_0x30367f[_0x0319('0x10')],function(_0x3e5942){return{'model':db[_0x3e5942[_0x0319('0x12')]],'as':_0x3e5942['as'],'attributes':_0x3e5942[_0x0319('0xf')]};}):[]};}):[]};}):[]:[]})[_0x0319('0x13')](function(_0x5a8efb){logger[_0x0319('0x1a')]('ShowSquareProject',_0x5b6812);logger[_0x0319('0x14')]('ShowSquareProject',_0x5b6812,JSON[_0x0319('0x15')](_0x5a8efb));_0x3ac6d7(_0x5a8efb);})[_0x0319('0x1b')](function(_0x3601ce){logger[_0x0319('0x16')](_0x0319('0x18'),_0x3601ce['message'],_0x5b6812);_0x21faa1(_0x40b258['error'](0x1f4,_0x3601ce['message']));});});}; \ No newline at end of file +var _0x8f1e=['error','message','find','raw','where','debug','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','options','attributes','limit','include','map','model','then','stringify','catch'];(function(_0x26bca0,_0x4f282b){var _0x27e849=function(_0x3b0ac8){while(--_0x3b0ac8){_0x26bca0['push'](_0x26bca0['shift']());}};_0x27e849(++_0x4f282b);}(_0x8f1e,0x77));var _0xe8f1=function(_0x5bdbfd,_0x3aaf24){_0x5bdbfd=_0x5bdbfd-0x0;var _0x5711c0=_0x8f1e[_0x5bdbfd];return _0x5711c0;};'use strict';var _=require(_0xe8f1('0x0'));var Redis=require(_0xe8f1('0x1'));var db=require(_0xe8f1('0x2'))['db'];var logger=require(_0xe8f1('0x3'))(_0xe8f1('0x4'));var config=require('../../config/environment');config[_0xe8f1('0x5')]=_[_0xe8f1('0x6')](config[_0xe8f1('0x5')],{'host':_0xe8f1('0x7'),'port':0x18eb});var socket=require(_0xe8f1('0x8'))(new Redis(config[_0xe8f1('0x5')]));require('./squareProject.socket')[_0xe8f1('0x9')](socket);exports[_0xe8f1('0xa')]=function(_0x34cdcc){var _0x4cd6f1=this;return new Promise(function(_0x327ca0,_0x5447bc){return db[_0xe8f1('0xb')]['findAll']({'raw':_0x34cdcc[_0xe8f1('0xc')]?_0x34cdcc[_0xe8f1('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x34cdcc[_0xe8f1('0xc')]?_0x34cdcc[_0xe8f1('0xc')]['where']||null:null,'attributes':_0x34cdcc[_0xe8f1('0xc')]?_0x34cdcc['options'][_0xe8f1('0xd')]||null:null,'limit':_0x34cdcc[_0xe8f1('0xc')]?_0x34cdcc[_0xe8f1('0xc')][_0xe8f1('0xe')]||null:null,'include':_0x34cdcc[_0xe8f1('0xc')]?_0x34cdcc['options'][_0xe8f1('0xf')]?_[_0xe8f1('0x10')](_0x34cdcc['options'][_0xe8f1('0xf')],function(_0x4b4d91){return{'model':db[_0x4b4d91[_0xe8f1('0x11')]],'as':_0x4b4d91['as'],'attributes':_0x4b4d91[_0xe8f1('0xd')],'include':_0x4b4d91[_0xe8f1('0xf')]?_[_0xe8f1('0x10')](_0x4b4d91['include'],function(_0x283aa0){return{'model':db[_0x283aa0[_0xe8f1('0x11')]],'as':_0x283aa0['as'],'attributes':_0x283aa0['attributes'],'include':_0x283aa0[_0xe8f1('0xf')]?_[_0xe8f1('0x10')](_0x283aa0[_0xe8f1('0xf')],function(_0x943237){return{'model':db[_0x943237['model']],'as':_0x943237['as'],'attributes':_0x943237[_0xe8f1('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe8f1('0x12')](function(_0x19dc23){logger['info'](_0xe8f1('0xa'),_0x34cdcc);logger['debug'](_0xe8f1('0xa'),_0x34cdcc,JSON[_0xe8f1('0x13')](_0x19dc23));_0x327ca0(_0x19dc23);})[_0xe8f1('0x14')](function(_0x28002e){logger[_0xe8f1('0x15')](_0xe8f1('0xa'),_0x28002e['message'],_0x34cdcc);_0x5447bc(_0x4cd6f1['error'](0x1f4,_0x28002e[_0xe8f1('0x16')]));});});};exports['ShowSquareProject']=function(_0xd25952){var _0x189274=this;return new Promise(function(_0x399c16,_0x155e81){return db[_0xe8f1('0xb')][_0xe8f1('0x17')]({'raw':_0xd25952[_0xe8f1('0xc')]?_0xd25952[_0xe8f1('0xc')][_0xe8f1('0x18')]===undefined?!![]:![]:!![],'where':_0xd25952[_0xe8f1('0xc')]?_0xd25952['options'][_0xe8f1('0x19')]||null:null,'attributes':_0xd25952[_0xe8f1('0xc')]?_0xd25952[_0xe8f1('0xc')][_0xe8f1('0xd')]||null:null,'include':_0xd25952[_0xe8f1('0xc')]?_0xd25952[_0xe8f1('0xc')][_0xe8f1('0xf')]?_[_0xe8f1('0x10')](_0xd25952['options'][_0xe8f1('0xf')],function(_0x132e8e){return{'model':db[_0x132e8e['model']],'as':_0x132e8e['as'],'attributes':_0x132e8e['attributes'],'include':_0x132e8e[_0xe8f1('0xf')]?_[_0xe8f1('0x10')](_0x132e8e[_0xe8f1('0xf')],function(_0x47b605){return{'model':db[_0x47b605[_0xe8f1('0x11')]],'as':_0x47b605['as'],'attributes':_0x47b605[_0xe8f1('0xd')],'include':_0x47b605['include']?_[_0xe8f1('0x10')](_0x47b605[_0xe8f1('0xf')],function(_0x4fe470){return{'model':db[_0x4fe470[_0xe8f1('0x11')]],'as':_0x4fe470['as'],'attributes':_0x4fe470[_0xe8f1('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1680fe){logger['info']('ShowSquareProject',_0xd25952);logger[_0xe8f1('0x1a')](_0xe8f1('0x1b'),_0xd25952,JSON[_0xe8f1('0x13')](_0x1680fe));_0x399c16(_0x1680fe);})[_0xe8f1('0x14')](function(_0x339709){logger[_0xe8f1('0x15')](_0xe8f1('0x1b'),_0x339709[_0xe8f1('0x16')],_0xd25952);_0x155e81(_0x189274[_0xe8f1('0x15')](0x1f4,_0x339709['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 673db6a..fb3ff67 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 _0xb4cc=['remove','update','emit','squareProject:','./squareProject.events','save'];(function(_0x38e777,_0x148610){var _0x2c3a27=function(_0x364f80){while(--_0x364f80){_0x38e777['push'](_0x38e777['shift']());}};_0x2c3a27(++_0x148610);}(_0xb4cc,0x1de));var _0xcb4c=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xb4cc[_0x312abc];return _0x314298;};'use strict';var SquareProjectEvents=require(_0xcb4c('0x0'));var events=[_0xcb4c('0x1'),_0xcb4c('0x2'),_0xcb4c('0x3')];function createListener(_0x4dc318,_0x1d331f){return function(_0x5a3cf){_0x1d331f[_0xcb4c('0x4')](_0x4dc318,_0x5a3cf);};}function removeListener(_0x2c8886,_0x47c82e){return function(){SquareProjectEvents['removeListener'](_0x2c8886,_0x47c82e);};}exports['register']=function(_0x1c7458){for(var _0x56bd88=0x0,_0x382f9d=events['length'];_0x56bd88<_0x382f9d;_0x56bd88++){var _0x1bf549=events[_0x56bd88];var _0x2ef595=createListener(_0xcb4c('0x5')+_0x1bf549,_0x1c7458);SquareProjectEvents['on'](_0x1bf549,_0x2ef595);}}; \ No newline at end of file +var _0x6b74=['register','length','squareProject:','./squareProject.events','remove','emit','removeListener'];(function(_0x10d92e,_0x4803fd){var _0x5e95f2=function(_0x4dede1){while(--_0x4dede1){_0x10d92e['push'](_0x10d92e['shift']());}};_0x5e95f2(++_0x4803fd);}(_0x6b74,0x1ed));var _0x46b7=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x6b74[_0x43a5c7];return _0x3b12a2;};'use strict';var SquareProjectEvents=require(_0x46b7('0x0'));var events=['save',_0x46b7('0x1'),'update'];function createListener(_0x17b1df,_0x44e931){return function(_0x18e925){_0x44e931[_0x46b7('0x2')](_0x17b1df,_0x18e925);};}function removeListener(_0x5d3fce,_0x3a72d6){return function(){SquareProjectEvents[_0x46b7('0x3')](_0x5d3fce,_0x3a72d6);};}exports[_0x46b7('0x4')]=function(_0x445922){for(var _0x25d1ab=0x0,_0x530dae=events[_0x46b7('0x5')];_0x25d1ab<_0x530dae;_0x25d1ab++){var _0x4f2dec=events[_0x25d1ab];var _0x302fd5=createListener(_0x46b7('0x6')+_0x4f2dec,_0x445922);SquareProjectEvents['on'](_0x4f2dec,_0x302fd5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b056c6d..0e48eb7 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x2de019,_0x3251a9){var _0x15dd02=function(_0x4a2e43){while(--_0x4a2e43){_0x2de019['push'](_0x2de019['shift']());}};_0x15dd02(++_0x3251a9);}(_0x7a54,0x106));var _0x47a5=function(_0x4edb79,_0x74b48d){_0x4edb79=_0x4edb79-0x0;var _0x26b50e=_0x7a54[_0x4edb79];return _0x26b50e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x3dcc03,_0x395089){var _0x28c333=function(_0x3a6bc5){while(--_0x3a6bc5){_0x3dcc03['push'](_0x3dcc03['shift']());}};_0x28c333(++_0x395089);}(_0x814b,0x1a2));var _0xb814=function(_0x466f51,_0x1393ed){_0x466f51=_0x466f51-0x0;var _0x2db305=_0x814b[_0x466f51];return _0x2db305;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('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 dff8fd0..679d36f 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 _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x1a92c2,_0x5e9ca1){var _0x1bfcb3=function(_0xa692dc){while(--_0xa692dc){_0x1a92c2['push'](_0x1a92c2['shift']());}};_0x1bfcb3(++_0x5e9ca1);}(_0x5fd1,0x155));var _0x15fd=function(_0x4b521b,_0x384b05){_0x4b521b=_0x4b521b-0x0;var _0x4fd529=_0x5fd1[_0x4b521b];return _0x4fd529;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}}; \ No newline at end of file +var _0xdc97=['savePath','substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x436bef,_0x4810ce){_0x436bef=_0x436bef-0x0;var _0x3917c4=_0xdc97[_0x436bef];return _0x3917c4;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'uniqueid':{'type':Sequelize[_0x7dc9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7dc9('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7dc9('0x2')]},'priority':{'type':Sequelize[_0x7dc9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7dc9('0x2')]},'projectName':{'type':Sequelize[_0x7dc9('0x2')]},'saveName':{'type':Sequelize[_0x7dc9('0x2')]},'filename':{'type':Sequelize[_0x7dc9('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7dc9('0x3')],'get':function(){var _0x4f91c7='';var _0x4b3229=this[_0x7dc9('0x4')](_0x7dc9('0x5'));if(_0x4b3229){_0x4f91c7=_0x4b3229[_0x7dc9('0x6')](_0x4b3229[_0x7dc9('0x7')]('.'));}return _0x4f91c7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index cff70c6..cb8be3d 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 _0x89d7=['recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','message','send','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','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','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','count','limit','Content-Range','json','apply','update','destroy','then','end','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets'];(function(_0x5ded99,_0x1d29f7){var _0x34ffd4=function(_0x36640f){while(--_0x36640f){_0x5ded99['push'](_0x5ded99['shift']());}};_0x34ffd4(++_0x1d29f7);}(_0x89d7,0xd0));var _0x789d=function(_0x5e02fd,_0x9f186e){_0x5e02fd=_0x5e02fd-0x0;var _0x543f4f=_0x89d7[_0x5e02fd];return _0x543f4f;};'use strict';var emlformat=require(_0x789d('0x0'));var rimraf=require(_0x789d('0x1'));var zipdir=require(_0x789d('0x2'));var jsonpatch=require(_0x789d('0x3'));var rp=require(_0x789d('0x4'));var moment=require(_0x789d('0x5'));var BPromise=require(_0x789d('0x6'));var Mustache=require(_0x789d('0x7'));var util=require(_0x789d('0x8'));var path=require(_0x789d('0x9'));var sox=require(_0x789d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x789d('0xb'));var _=require(_0x789d('0xc'));var squel=require('squel');var crypto=require(_0x789d('0xd'));var jsforce=require(_0x789d('0xe'));var deskjs=require(_0x789d('0xf'));var toCsv=require(_0x789d('0x10'));var querystring=require(_0x789d('0x11'));var Papa=require(_0x789d('0x12'));var Redis=require(_0x789d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x789d('0x14'));var hardwareService=require(_0x789d('0x15'));var logger=require(_0x789d('0x16'))(_0x789d('0x17'));var utils=require(_0x789d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x789d('0x19'));var db=require(_0x789d('0x1a'))['db'];function respondWithStatusCode(_0x314be6,_0x20db2b){_0x20db2b=_0x20db2b||0xcc;return function(_0x7a05ae){if(_0x7a05ae){return _0x314be6[_0x789d('0x1b')](_0x20db2b);}return _0x314be6[_0x789d('0x1c')](_0x20db2b)['end']();};}function respondWithResult(_0x19f01c,_0x599222){_0x599222=_0x599222||0xc8;return function(_0x36947d){if(_0x36947d){return _0x19f01c[_0x789d('0x1c')](_0x599222)['json'](_0x36947d);}};}function respondWithFilteredResult(_0x14eeba,_0x1c22e9){return function(_0x4f6017){if(_0x4f6017){var _0x55f332=typeof _0x1c22e9['offset']===_0x789d('0x1d')&&typeof _0x1c22e9['limit']===_0x789d('0x1d');var _0x1cee1c=_0x4f6017['count'];var _0x1f5470=_0x55f332?0x0:_0x1c22e9[_0x789d('0x1e')];var _0x1295ee=_0x55f332?_0x4f6017[_0x789d('0x1f')]:_0x1c22e9[_0x789d('0x1e')]+_0x1c22e9[_0x789d('0x20')];var _0xd2ab;if(_0x1295ee>=_0x1cee1c){_0x1295ee=_0x1cee1c;_0xd2ab=0xc8;}else{_0xd2ab=0xce;}_0x14eeba[_0x789d('0x1c')](_0xd2ab);return _0x14eeba['set'](_0x789d('0x21'),_0x1f5470+'-'+_0x1295ee+'/'+_0x1cee1c)[_0x789d('0x22')](_0x4f6017);}return null;};}function patchUpdates(_0x165e27){return function(_0x1172c7){try{jsonpatch[_0x789d('0x23')](_0x1172c7,_0x165e27,!![]);}catch(_0x14675a){return BPromise['reject'](_0x14675a);}return _0x1172c7['save']();};}function saveUpdates(_0xe94fba,_0x36eec9){return function(_0x5674d1){if(_0x5674d1){return _0x5674d1[_0x789d('0x24')](_0xe94fba)['then'](function(_0x3ada12){return _0x3ada12;});}return null;};}function removeEntity(_0x440972,_0x47ff7e){return function(_0x5ec0e0){if(_0x5ec0e0){return _0x5ec0e0[_0x789d('0x25')]()[_0x789d('0x26')](function(){_0x440972[_0x789d('0x1c')](0xcc)[_0x789d('0x27')]();});}};}function handleEntityNotFound(_0x114553,_0x237ada){return function(_0x2c606a){if(!_0x2c606a){_0x114553['sendStatus'](0x194);}return _0x2c606a;};}function handleError(_0x4e73dc,_0x170046){_0x170046=_0x170046||0x1f4;return function(_0x54eefc){logger['error'](_0x54eefc[_0x789d('0x28')]);if(_0x54eefc[_0x789d('0x29')]){delete _0x54eefc[_0x789d('0x29')];}_0x4e73dc[_0x789d('0x1c')](_0x170046)['send'](_0x54eefc);};}exports[_0x789d('0x2a')]=function(_0x3c3d7e,_0x5dc5a6){var _0x329a3a={},_0x297711={},_0x31ee40={'count':0x0,'rows':[]};var _0x562bbd=_[_0x789d('0x2b')](db[_0x789d('0x2c')][_0x789d('0x2d')],function(_0x48d171){return{'name':_0x48d171[_0x789d('0x2e')],'type':_0x48d171[_0x789d('0x2f')][_0x789d('0x30')]};});_0x297711[_0x789d('0x31')]=_[_0x789d('0x2b')](_0x562bbd,_0x789d('0x29'));_0x297711[_0x789d('0x32')]=_[_0x789d('0x33')](_0x3c3d7e[_0x789d('0x32')]);_0x297711[_0x789d('0x34')]=_[_0x789d('0x35')](_0x297711[_0x789d('0x31')],_0x297711[_0x789d('0x32')]);_0x329a3a['attributes']=_['intersection'](_0x297711[_0x789d('0x31')],qs[_0x789d('0x36')](_0x3c3d7e[_0x789d('0x32')][_0x789d('0x36')]));_0x329a3a[_0x789d('0x37')]=_0x329a3a['attributes']['length']?_0x329a3a[_0x789d('0x37')]:_0x297711[_0x789d('0x31')];if(!_0x3c3d7e[_0x789d('0x32')][_0x789d('0x38')](_0x789d('0x39'))){_0x329a3a[_0x789d('0x20')]=qs[_0x789d('0x20')](_0x3c3d7e[_0x789d('0x32')][_0x789d('0x20')]);_0x329a3a[_0x789d('0x1e')]=qs[_0x789d('0x1e')](_0x3c3d7e['query']['offset']);}_0x329a3a[_0x789d('0x3a')]=qs[_0x789d('0x3b')](_0x3c3d7e[_0x789d('0x32')][_0x789d('0x3b')]);_0x329a3a[_0x789d('0x3c')]=qs[_0x789d('0x34')](_[_0x789d('0x3d')](_0x3c3d7e['query'],_0x297711[_0x789d('0x34')]),_0x562bbd);if(_0x3c3d7e[_0x789d('0x32')][_0x789d('0x3e')]){_0x329a3a[_0x789d('0x3c')]=_['merge'](_0x329a3a[_0x789d('0x3c')],{'$or':_['map'](_0x562bbd,function(_0x474252){if(_0x474252[_0x789d('0x2f')]!=='VIRTUAL'){var _0x4c3cfd={};_0x4c3cfd[_0x474252[_0x789d('0x29')]]={'$like':'%'+_0x3c3d7e['query'][_0x789d('0x3e')]+'%'};return _0x4c3cfd;}})});}_0x329a3a=_[_0x789d('0x3f')]({},_0x329a3a,_0x3c3d7e[_0x789d('0x40')]);var _0x4a4e09={'where':_0x329a3a[_0x789d('0x3c')]};return db[_0x789d('0x2c')][_0x789d('0x1f')](_0x4a4e09)[_0x789d('0x26')](function(_0x3d7e4e){_0x31ee40['count']=_0x3d7e4e;if(_0x3c3d7e['query'][_0x789d('0x41')]){_0x329a3a['include']=[{'all':!![]}];}return db[_0x789d('0x2c')][_0x789d('0x42')](_0x329a3a);})[_0x789d('0x26')](function(_0x1e9426){_0x31ee40[_0x789d('0x43')]=_0x1e9426;return _0x31ee40;})[_0x789d('0x26')](respondWithFilteredResult(_0x5dc5a6,_0x329a3a))[_0x789d('0x44')](handleError(_0x5dc5a6,null));};exports[_0x789d('0x45')]=function(_0x51d8ca,_0x1f415a){var _0x1c12b6={'raw':!![],'where':{'id':_0x51d8ca[_0x789d('0x46')]['id']}},_0x4e97f0={};_0x4e97f0[_0x789d('0x31')]=_[_0x789d('0x33')](db[_0x789d('0x2c')][_0x789d('0x2d')]);_0x4e97f0['query']=_['keys'](_0x51d8ca[_0x789d('0x32')]);_0x4e97f0['filters']=_[_0x789d('0x35')](_0x4e97f0[_0x789d('0x31')],_0x4e97f0['query']);_0x1c12b6[_0x789d('0x37')]=_['intersection'](_0x4e97f0[_0x789d('0x31')],qs['fields'](_0x51d8ca[_0x789d('0x32')]['fields']));_0x1c12b6[_0x789d('0x37')]=_0x1c12b6['attributes']['length']?_0x1c12b6[_0x789d('0x37')]:_0x4e97f0[_0x789d('0x31')];if(_0x51d8ca['query'][_0x789d('0x41')]){_0x1c12b6[_0x789d('0x47')]=[{'all':!![]}];}_0x1c12b6=_['merge']({},_0x1c12b6,_0x51d8ca[_0x789d('0x40')]);return db[_0x789d('0x2c')]['find'](_0x1c12b6)['then'](handleEntityNotFound(_0x1f415a,null))[_0x789d('0x26')](respondWithResult(_0x1f415a,null))[_0x789d('0x44')](handleError(_0x1f415a,null));};exports['create']=function(_0x33c1d4,_0x264330){return db[_0x789d('0x2c')][_0x789d('0x48')](_0x33c1d4['body'],{})[_0x789d('0x26')](respondWithResult(_0x264330,0xc9))[_0x789d('0x44')](handleError(_0x264330,null));};exports[_0x789d('0x24')]=function(_0x444628,_0x1dbf8f){if(_0x444628[_0x789d('0x49')]['id']){delete _0x444628[_0x789d('0x49')]['id'];}return db[_0x789d('0x2c')][_0x789d('0x4a')]({'where':{'id':_0x444628[_0x789d('0x46')]['id']}})[_0x789d('0x26')](handleEntityNotFound(_0x1dbf8f,null))[_0x789d('0x26')](saveUpdates(_0x444628[_0x789d('0x49')],null))[_0x789d('0x26')](respondWithResult(_0x1dbf8f,null))[_0x789d('0x44')](handleError(_0x1dbf8f,null));};exports['download']=function(_0x48b810,_0x49836c,_0x5b72bc){var _0x4ac85d=require(_0x789d('0x4b'));var _0x2ecfbf=![];var _0x5a2ef0={};if(_0x48b810[_0x789d('0x32')][_0x789d('0x2f')]&&_0x48b810[_0x789d('0x32')][_0x789d('0x2f')]===_0x789d('0x4c')){_0x5a2ef0[_0x789d('0x4c')]=_0x48b810[_0x789d('0x46')]['id'];}else{_0x5a2ef0['id']=_0x48b810['params']['id'];}return db[_0x789d('0x2c')][_0x789d('0x4a')]({'where':_0x5a2ef0,'attributes':['id',_0x789d('0x4d'),_0x789d('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x49836c,null))[_0x789d('0x26')](function(_0x4c04a5){if(_0x4c04a5){var _0xa2f3e=_0x4c04a5[_0x789d('0x4d')];var _0x44dd53=util[_0x789d('0x4f')]('%s.cypher',_0xa2f3e);if(fs[_0x789d('0x50')](_0x44dd53)){_0x2ecfbf=!![];return _0x4ac85d[_0x789d('0x51')](_0x44dd53,_0xa2f3e,config[_0x789d('0x52')][_0x789d('0x53')])[_0x789d('0x26')](function(){return _0x4c04a5;});}return _0x4c04a5;}})[_0x789d('0x26')](function(_0xa10328){if(_0xa10328){var _0x1b05b7=_0xa10328[_0x789d('0x4d')];if(!fs['existsSync'](_0x1b05b7)){throw new db[(_0x789d('0x54'))][(_0x789d('0x55'))](_0x789d('0x56'));}if(_0xa10328[_0x789d('0x4e')]){return _0x49836c[_0x789d('0x57')](_0x1b05b7,_0xa10328[_0x789d('0x4e')]+path['extname'](_0x1b05b7),function(){if(_0x2ecfbf){fs[_0x789d('0x58')](_0x1b05b7);}});}else{return _0x49836c[_0x789d('0x57')](_0x1b05b7,function(_0xaa6cfa){if(_0x2ecfbf){fs[_0x789d('0x58')](_0x1b05b7);}});}}})[_0x789d('0x44')](function(_0x525d6f){if(_0x525d6f[_0x789d('0x59')]==='SquareRecording\x20not\x20found'){_0x49836c[_0x789d('0x1c')](0x194)[_0x789d('0x5a')]('Not\x20found');}else{return handleError(_0x49836c,null);}});};exports[_0x789d('0x25')]=function(_0xcbc56b,_0x5bed4e){return db[_0x789d('0x2c')][_0x789d('0x4a')]({'where':{'id':_0xcbc56b['params']['id']}})[_0x789d('0x26')](function(_0x4a5a03){if(_[_0x789d('0x5b')](_0x4a5a03)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4a5a03;})['then'](function(_0x22b00d){var _0x58cd08=_0x22b00d[_0x789d('0x4d')];logger[_0x789d('0x5c')](_0x789d('0x5d'),_0x58cd08);if(!_['isNil'](_0x22b00d['savePath'])&&fs[_0x789d('0x50')](_0x58cd08)){logger['info']('File:\x20\x22'+_0x58cd08+_0x789d('0x5e'));fs[_0x789d('0x5f')](_0x58cd08);}_0x58cd08=_0x58cd08+'.cypher';if(!_[_0x789d('0x5b')](_0x22b00d[_0x789d('0x4d')])&&fs[_0x789d('0x50')](_0x58cd08)){logger[_0x789d('0x5c')](_0x789d('0x60')+_0x58cd08+_0x789d('0x5e'));fs['unlinkSync'](_0x58cd08);}return _0x22b00d;})[_0x789d('0x26')](function(_0x551766){if(!_0x551766)throw new InternalError();return _0x551766['destroy']();})[_0x789d('0x26')](function(){_0x5bed4e[_0x789d('0x1c')](0xcc)['end']();})[_0x789d('0x44')](handleError(_0x5bed4e,null));}; \ No newline at end of file +var _0x9367=['find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','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','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','rows','catch','show','params','includeAll'];(function(_0x55f03a,_0x22516e){var _0x4574b7=function(_0x4dcf82){while(--_0x4dcf82){_0x55f03a['push'](_0x55f03a['shift']());}};_0x4574b7(++_0x22516e);}(_0x9367,0x18e));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7936('0x0'));var rimraf=require(_0x7936('0x1'));var zipdir=require(_0x7936('0x2'));var jsonpatch=require(_0x7936('0x3'));var rp=require(_0x7936('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7936('0x5'));var path=require(_0x7936('0x6'));var sox=require(_0x7936('0x7'));var csv=require('to-csv');var ejs=require(_0x7936('0x8'));var fs=require('fs');var fs_extra=require(_0x7936('0x9'));var _=require(_0x7936('0xa'));var squel=require('squel');var crypto=require(_0x7936('0xb'));var jsforce=require(_0x7936('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7936('0xd'));var querystring=require(_0x7936('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7936('0xf'));var qs=require(_0x7936('0x10'));var as=require(_0x7936('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7936('0x12'));var config=require(_0x7936('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7936('0x14'))['db'];function respondWithStatusCode(_0x39caf9,_0x337d0b){_0x337d0b=_0x337d0b||0xcc;return function(_0x4731b4){if(_0x4731b4){return _0x39caf9[_0x7936('0x15')](_0x337d0b);}return _0x39caf9[_0x7936('0x16')](_0x337d0b)[_0x7936('0x17')]();};}function respondWithResult(_0x4d27eb,_0x1caf9f){_0x1caf9f=_0x1caf9f||0xc8;return function(_0x2a4bc8){if(_0x2a4bc8){return _0x4d27eb['status'](_0x1caf9f)[_0x7936('0x18')](_0x2a4bc8);}};}function respondWithFilteredResult(_0x573e9a,_0xd62e41){return function(_0x51e3d5){if(_0x51e3d5){var _0x5dd838=typeof _0xd62e41[_0x7936('0x19')]===_0x7936('0x1a')&&typeof _0xd62e41[_0x7936('0x1b')]===_0x7936('0x1a');var _0x152d36=_0x51e3d5[_0x7936('0x1c')];var _0x10e0a0=_0x5dd838?0x0:_0xd62e41[_0x7936('0x19')];var _0x4d1d23=_0x5dd838?_0x51e3d5[_0x7936('0x1c')]:_0xd62e41[_0x7936('0x19')]+_0xd62e41[_0x7936('0x1b')];var _0x39e936;if(_0x4d1d23>=_0x152d36){_0x4d1d23=_0x152d36;_0x39e936=0xc8;}else{_0x39e936=0xce;}_0x573e9a['status'](_0x39e936);return _0x573e9a[_0x7936('0x1d')](_0x7936('0x1e'),_0x10e0a0+'-'+_0x4d1d23+'/'+_0x152d36)['json'](_0x51e3d5);}return null;};}function patchUpdates(_0x1b1bcb){return function(_0x229731){try{jsonpatch[_0x7936('0x1f')](_0x229731,_0x1b1bcb,!![]);}catch(_0x262e27){return BPromise['reject'](_0x262e27);}return _0x229731[_0x7936('0x20')]();};}function saveUpdates(_0xc36a3c,_0x38fc48){return function(_0x3a172d){if(_0x3a172d){return _0x3a172d['update'](_0xc36a3c)['then'](function(_0x3c92a8){return _0x3c92a8;});}return null;};}function removeEntity(_0x36a2e8,_0x6c0cbc){return function(_0x42a01b){if(_0x42a01b){return _0x42a01b[_0x7936('0x21')]()[_0x7936('0x22')](function(){_0x36a2e8['status'](0xcc)[_0x7936('0x17')]();});}};}function handleEntityNotFound(_0x1fe566,_0x2a2b9){return function(_0x404314){if(!_0x404314){_0x1fe566[_0x7936('0x15')](0x194);}return _0x404314;};}function handleError(_0x2bdd9f,_0x475d5d){_0x475d5d=_0x475d5d||0x1f4;return function(_0x13581e){logger[_0x7936('0x23')](_0x13581e[_0x7936('0x24')]);if(_0x13581e[_0x7936('0x25')]){delete _0x13581e['name'];}_0x2bdd9f['status'](_0x475d5d)[_0x7936('0x26')](_0x13581e);};}exports[_0x7936('0x27')]=function(_0x1b2c1d,_0x19da3b){var _0x469bda={},_0xf6b4a6={},_0x7d8e47={'count':0x0,'rows':[]};var _0x2c7c2b=_['map'](db[_0x7936('0x28')][_0x7936('0x29')],function(_0x410302){return{'name':_0x410302[_0x7936('0x2a')],'type':_0x410302[_0x7936('0x2b')][_0x7936('0x2c')]};});_0xf6b4a6['model']=_['map'](_0x2c7c2b,'name');_0xf6b4a6[_0x7936('0x2d')]=_[_0x7936('0x2e')](_0x1b2c1d['query']);_0xf6b4a6[_0x7936('0x2f')]=_[_0x7936('0x30')](_0xf6b4a6['model'],_0xf6b4a6['query']);_0x469bda[_0x7936('0x31')]=_['intersection'](_0xf6b4a6[_0x7936('0x32')],qs[_0x7936('0x33')](_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x33')]));_0x469bda[_0x7936('0x31')]=_0x469bda['attributes'][_0x7936('0x34')]?_0x469bda[_0x7936('0x31')]:_0xf6b4a6[_0x7936('0x32')];if(!_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x35')]('nolimit')){_0x469bda[_0x7936('0x1b')]=qs[_0x7936('0x1b')](_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x1b')]);_0x469bda[_0x7936('0x19')]=qs[_0x7936('0x19')](_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x19')]);}_0x469bda[_0x7936('0x36')]=qs['sort'](_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x37')]);_0x469bda[_0x7936('0x38')]=qs[_0x7936('0x2f')](_['pick'](_0x1b2c1d['query'],_0xf6b4a6['filters']),_0x2c7c2b);if(_0x1b2c1d['query'][_0x7936('0x39')]){_0x469bda[_0x7936('0x38')]=_[_0x7936('0x3a')](_0x469bda[_0x7936('0x38')],{'$or':_[_0x7936('0x3b')](_0x2c7c2b,function(_0x1f3324){if(_0x1f3324[_0x7936('0x2b')]!==_0x7936('0x3c')){var _0x1828c2={};_0x1828c2[_0x1f3324[_0x7936('0x25')]]={'$like':'%'+_0x1b2c1d[_0x7936('0x2d')][_0x7936('0x39')]+'%'};return _0x1828c2;}})});}_0x469bda=_['merge']({},_0x469bda,_0x1b2c1d[_0x7936('0x3d')]);var _0x55083d={'where':_0x469bda[_0x7936('0x38')]};return db[_0x7936('0x28')][_0x7936('0x1c')](_0x55083d)[_0x7936('0x22')](function(_0x5d626e){_0x7d8e47[_0x7936('0x1c')]=_0x5d626e;if(_0x1b2c1d[_0x7936('0x2d')]['includeAll']){_0x469bda['include']=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x469bda);})[_0x7936('0x22')](function(_0x127baf){_0x7d8e47[_0x7936('0x3e')]=_0x127baf;return _0x7d8e47;})['then'](respondWithFilteredResult(_0x19da3b,_0x469bda))[_0x7936('0x3f')](handleError(_0x19da3b,null));};exports[_0x7936('0x40')]=function(_0xe139bf,_0x4247cc){var _0x1e51c9={'raw':!![],'where':{'id':_0xe139bf[_0x7936('0x41')]['id']}},_0x5b2cb7={};_0x5b2cb7[_0x7936('0x32')]=_[_0x7936('0x2e')](db['SquareRecording'][_0x7936('0x29')]);_0x5b2cb7[_0x7936('0x2d')]=_[_0x7936('0x2e')](_0xe139bf[_0x7936('0x2d')]);_0x5b2cb7[_0x7936('0x2f')]=_[_0x7936('0x30')](_0x5b2cb7[_0x7936('0x32')],_0x5b2cb7[_0x7936('0x2d')]);_0x1e51c9[_0x7936('0x31')]=_['intersection'](_0x5b2cb7[_0x7936('0x32')],qs[_0x7936('0x33')](_0xe139bf['query'][_0x7936('0x33')]));_0x1e51c9[_0x7936('0x31')]=_0x1e51c9[_0x7936('0x31')]['length']?_0x1e51c9['attributes']:_0x5b2cb7['model'];if(_0xe139bf['query'][_0x7936('0x42')]){_0x1e51c9['include']=[{'all':!![]}];}_0x1e51c9=_[_0x7936('0x3a')]({},_0x1e51c9,_0xe139bf[_0x7936('0x3d')]);return db[_0x7936('0x28')][_0x7936('0x43')](_0x1e51c9)[_0x7936('0x22')](handleEntityNotFound(_0x4247cc,null))[_0x7936('0x22')](respondWithResult(_0x4247cc,null))[_0x7936('0x3f')](handleError(_0x4247cc,null));};exports[_0x7936('0x44')]=function(_0x11beea,_0x4b7537){return db[_0x7936('0x28')][_0x7936('0x44')](_0x11beea[_0x7936('0x45')],{})[_0x7936('0x22')](respondWithResult(_0x4b7537,0xc9))[_0x7936('0x3f')](handleError(_0x4b7537,null));};exports['update']=function(_0x255c5a,_0x5f15b8){if(_0x255c5a[_0x7936('0x45')]['id']){delete _0x255c5a[_0x7936('0x45')]['id'];}return db[_0x7936('0x28')][_0x7936('0x43')]({'where':{'id':_0x255c5a[_0x7936('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f15b8,null))['then'](saveUpdates(_0x255c5a[_0x7936('0x45')],null))[_0x7936('0x22')](respondWithResult(_0x5f15b8,null))[_0x7936('0x3f')](handleError(_0x5f15b8,null));};exports[_0x7936('0x46')]=function(_0x408ca5,_0x3ef7d5,_0x28f32c){var _0x25192a=require(_0x7936('0x47'));var _0x58e283=![];var _0x357e8e={};if(_0x408ca5['query'][_0x7936('0x2b')]&&_0x408ca5[_0x7936('0x2d')][_0x7936('0x2b')]===_0x7936('0x48')){_0x357e8e[_0x7936('0x48')]=_0x408ca5[_0x7936('0x41')]['id'];}else{_0x357e8e['id']=_0x408ca5['params']['id'];}return db['SquareRecording']['find']({'where':_0x357e8e,'attributes':['id','savePath',_0x7936('0x49')],'raw':!![]})[_0x7936('0x22')](handleEntityNotFound(_0x3ef7d5,null))[_0x7936('0x22')](function(_0x55b687){if(_0x55b687){var _0x2b5c10=_0x55b687[_0x7936('0x4a')];var _0x40db86=util['format'](_0x7936('0x4b'),_0x2b5c10);if(fs[_0x7936('0x4c')](_0x40db86)){_0x58e283=!![];return _0x25192a[_0x7936('0x4d')](_0x40db86,_0x2b5c10,config[_0x7936('0x4e')][_0x7936('0x4f')])[_0x7936('0x22')](function(){return _0x55b687;});}return _0x55b687;}})[_0x7936('0x22')](function(_0x1d2c8e){if(_0x1d2c8e){var _0xdcce9a=_0x1d2c8e[_0x7936('0x4a')];if(!fs[_0x7936('0x4c')](_0xdcce9a)){throw new db[(_0x7936('0x50'))][(_0x7936('0x51'))](_0x7936('0x52'));}if(_0x1d2c8e[_0x7936('0x49')]){return _0x3ef7d5[_0x7936('0x46')](_0xdcce9a,_0x1d2c8e[_0x7936('0x49')]+path[_0x7936('0x53')](_0xdcce9a),function(){if(_0x58e283){fs[_0x7936('0x54')](_0xdcce9a);}});}else{return _0x3ef7d5['download'](_0xdcce9a,function(_0x56c6ba){if(_0x58e283){fs[_0x7936('0x54')](_0xdcce9a);}});}}})['catch'](function(_0x4d998e){if(_0x4d998e[_0x7936('0x55')]===_0x7936('0x52')){_0x3ef7d5[_0x7936('0x16')](0x194)[_0x7936('0x26')](_0x7936('0x56'));}else{return handleError(_0x3ef7d5,null);}});};exports[_0x7936('0x21')]=function(_0x592d02,_0x1c188d){return db[_0x7936('0x28')][_0x7936('0x43')]({'where':{'id':_0x592d02[_0x7936('0x41')]['id']}})[_0x7936('0x22')](function(_0x58b7a6){if(_[_0x7936('0x57')](_0x58b7a6)){throw new ReferenceError(_0x7936('0x58'));}return _0x58b7a6;})['then'](function(_0x2b9121){var _0x46449d=_0x2b9121[_0x7936('0x4a')];logger[_0x7936('0x59')]('cancellazione\x20fisica\x20documento\x20%s',_0x46449d);if(!_['isNil'](_0x2b9121['savePath'])&&fs['existsSync'](_0x46449d)){logger[_0x7936('0x59')](_0x7936('0x5a')+_0x46449d+_0x7936('0x5b'));fs[_0x7936('0x5c')](_0x46449d);}_0x46449d=_0x46449d+'.cypher';if(!_[_0x7936('0x57')](_0x2b9121[_0x7936('0x4a')])&&fs[_0x7936('0x4c')](_0x46449d)){logger['info'](_0x7936('0x5a')+_0x46449d+_0x7936('0x5b'));fs[_0x7936('0x5c')](_0x46449d);}return _0x2b9121;})[_0x7936('0x22')](function(_0x5b1c6b){if(!_0x5b1c6b)throw new InternalError();return _0x5b1c6b[_0x7936('0x21')]();})[_0x7936('0x22')](function(){_0x1c188d[_0x7936('0x16')](0xcc)[_0x7936('0x17')]();})['catch'](handleError(_0x1c188d,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index de85b40..667d948 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 _0x014c=['api','moment','bluebird','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','util'];(function(_0x231397,_0x45ad7c){var _0x586b4b=function(_0x83a579){while(--_0x83a579){_0x231397['push'](_0x231397['shift']());}};_0x586b4b(++_0x45ad7c);}(_0x014c,0x17b));var _0xc014=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x014c[_0x153e7d];return _0x3c22dd;};'use strict';var _=require('lodash');var util=require(_0xc014('0x0'));var logger=require('../../config/logger')(_0xc014('0x1'));var moment=require(_0xc014('0x2'));var BPromise=require(_0xc014('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc014('0x4'));var config=require(_0xc014('0x5'));var attributes=require(_0xc014('0x6'));module[_0xc014('0x7')]=function(_0x10f3cb,_0x5138a8){return _0x10f3cb[_0xc014('0x8')](_0xc014('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed7=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','util','../../config/logger','api','request-promise'];(function(_0x12ca7a,_0x3295bf){var _0x2249df=function(_0x48b046){while(--_0x48b046){_0x12ca7a['push'](_0x12ca7a['shift']());}};_0x2249df(++_0x3295bf);}(_0x8ed7,0x8b));var _0x78ed=function(_0x502b93,_0x25b04b){_0x502b93=_0x502b93-0x0;var _0x337691=_0x8ed7[_0x502b93];return _0x337691;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var logger=require(_0x78ed('0x1'))(_0x78ed('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78ed('0x3'));var fs=require('fs');var path=require(_0x78ed('0x4'));var rimraf=require(_0x78ed('0x5'));var config=require(_0x78ed('0x6'));var attributes=require(_0x78ed('0x7'));module[_0x78ed('0x8')]=function(_0x3d8efa,_0x42094f){return _0x3d8efa[_0x78ed('0x9')]('SquareRecording',attributes,{'tableName':_0x78ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index a9b8630..9609068 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 _0x6b54=['error','code','SquareRecording,\x20%s,\x20%s','message','result','SquareRecording','create','body','options','raw','then','CreateSquareRecording','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33e54b,_0x2e3d9c){var _0x3e0ca0=function(_0x2918ac){while(--_0x2918ac){_0x33e54b['push'](_0x33e54b['shift']());}};_0x3e0ca0(++_0x2e3d9c);}(_0x6b54,0xbb));var _0x46b5=function(_0x4b92b9,_0x1bd47d){_0x4b92b9=_0x4b92b9-0x0;var _0x157b9d=_0x6b54[_0x4b92b9];return _0x157b9d;};'use strict';var _=require(_0x46b5('0x0'));var util=require('util');var moment=require(_0x46b5('0x1'));var BPromise=require(_0x46b5('0x2'));var rs=require(_0x46b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46b5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46b5('0x5'))(_0x46b5('0x6'));var config=require(_0x46b5('0x7'));var jayson=require(_0x46b5('0x8'));var client=jayson[_0x46b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6f79,_0x5dbaf8,_0x26e845){return new BPromise(function(_0x50ea3b,_0x40639a){return client[_0x46b5('0xa')](_0x1f6f79,_0x26e845)['then'](function(_0x46f0a8){logger[_0x46b5('0xb')]('SquareRecording,\x20%s,\x20%s',_0x5dbaf8,'request\x20sent');logger[_0x46b5('0xc')](_0x46b5('0xd'),_0x5dbaf8,_0x46b5('0xe'),JSON[_0x46b5('0xf')](_0x46f0a8));if(_0x46f0a8[_0x46b5('0x10')]){if(_0x46f0a8[_0x46b5('0x10')][_0x46b5('0x11')]===0x1f4){logger[_0x46b5('0x10')](_0x46b5('0x12'),_0x5dbaf8,_0x46f0a8[_0x46b5('0x10')][_0x46b5('0x13')]);return _0x40639a(_0x46f0a8[_0x46b5('0x10')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x5dbaf8,_0x46f0a8['error'][_0x46b5('0x13')]);return _0x50ea3b(_0x46f0a8[_0x46b5('0x10')]['message']);}else{logger['info'](_0x46b5('0x12'),_0x5dbaf8,_0x46b5('0xe'));_0x50ea3b(_0x46f0a8[_0x46b5('0x14')]['message']);}})['catch'](function(_0x362073){logger['error']('SquareRecording,\x20%s,\x20%s',_0x5dbaf8,_0x362073);_0x40639a(_0x362073);});});}exports['CreateSquareRecording']=function(_0x15b62c){var _0x3dc27e=this;return new Promise(function(_0x539c81,_0x592ede){return db[_0x46b5('0x15')][_0x46b5('0x16')](_0x15b62c[_0x46b5('0x17')],{'raw':_0x15b62c[_0x46b5('0x18')]?_0x15b62c[_0x46b5('0x18')][_0x46b5('0x19')]===undefined?!![]:![]:!![]})[_0x46b5('0x1a')](function(_0x6126c1){logger[_0x46b5('0xb')](_0x46b5('0x1b'),_0x15b62c);logger[_0x46b5('0xc')](_0x46b5('0x1b'),_0x15b62c,JSON[_0x46b5('0xf')](_0x6126c1));_0x539c81(_0x6126c1);})[_0x46b5('0x1c')](function(_0x7635fd){logger[_0x46b5('0x10')](_0x46b5('0x1b'),_0x7635fd[_0x46b5('0x13')],_0x15b62c);_0x592ede(_0x3dc27e[_0x46b5('0x10')](0x1f4,_0x7635fd[_0x46b5('0x13')]));});});}; \ No newline at end of file +var _0x88e7=['options','raw','CreateSquareRecording','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareRecording','create','body'];(function(_0xa09f16,_0x22677c){var _0x2eb39e=function(_0x585ae0){while(--_0x585ae0){_0xa09f16['push'](_0xa09f16['shift']());}};_0x2eb39e(++_0x22677c);}(_0x88e7,0x1bd));var _0x788e=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x88e7[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0x788e('0x0'));var util=require('util');var moment=require(_0x788e('0x1'));var BPromise=require(_0x788e('0x2'));var rs=require(_0x788e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x788e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x788e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x788e('0x6'));var client=jayson[_0x788e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca2e1,_0x43c997,_0x45b0ea){return new BPromise(function(_0x396602,_0x57ccc8){return client[_0x788e('0x8')](_0x5ca2e1,_0x45b0ea)[_0x788e('0x9')](function(_0x2dad7f){logger[_0x788e('0xa')](_0x788e('0xb'),_0x43c997,_0x788e('0xc'));logger[_0x788e('0xd')](_0x788e('0xe'),_0x43c997,'request\x20sent',JSON[_0x788e('0xf')](_0x2dad7f));if(_0x2dad7f[_0x788e('0x10')]){if(_0x2dad7f[_0x788e('0x10')][_0x788e('0x11')]===0x1f4){logger[_0x788e('0x10')](_0x788e('0xb'),_0x43c997,_0x2dad7f[_0x788e('0x10')]['message']);return _0x57ccc8(_0x2dad7f[_0x788e('0x10')][_0x788e('0x12')]);}logger[_0x788e('0x10')]('SquareRecording,\x20%s,\x20%s',_0x43c997,_0x2dad7f[_0x788e('0x10')]['message']);return _0x396602(_0x2dad7f[_0x788e('0x10')][_0x788e('0x12')]);}else{logger[_0x788e('0xa')]('SquareRecording,\x20%s,\x20%s',_0x43c997,_0x788e('0xc'));_0x396602(_0x2dad7f['result'][_0x788e('0x12')]);}})[_0x788e('0x13')](function(_0x48f31f){logger['error'](_0x788e('0xb'),_0x43c997,_0x48f31f);_0x57ccc8(_0x48f31f);});});}exports['CreateSquareRecording']=function(_0x4b545a){var _0xef04c=this;return new Promise(function(_0x49324f,_0x1901ca){return db[_0x788e('0x14')][_0x788e('0x15')](_0x4b545a[_0x788e('0x16')],{'raw':_0x4b545a[_0x788e('0x17')]?_0x4b545a[_0x788e('0x17')][_0x788e('0x18')]===undefined?!![]:![]:!![]})[_0x788e('0x9')](function(_0x1e3332){logger[_0x788e('0xa')](_0x788e('0x19'),_0x4b545a);logger[_0x788e('0xd')](_0x788e('0x19'),_0x4b545a,JSON['stringify'](_0x1e3332));_0x49324f(_0x1e3332);})[_0x788e('0x13')](function(_0xb32579){logger['error']('CreateSquareRecording',_0xb32579[_0x788e('0x12')],_0x4b545a);_0x1901ca(_0xef04c[_0x788e('0x10')](0x1f4,_0xb32579['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 74e9fb1..45a5100 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x264d8a,_0x48b5c8){var _0x3e0507=function(_0x125285){while(--_0x125285){_0x264d8a['push'](_0x264d8a['shift']());}};_0x3e0507(++_0x48b5c8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x3d61c5,_0x1cff1d){var _0x80223f=function(_0x39a462){while(--_0x39a462){_0x3d61c5['push'](_0x3d61c5['shift']());}};_0x80223f(++_0x1cff1d);}(_0xe706,0xa3));var _0x6e70=function(_0x1ad992,_0x5ddc63){_0x1ad992=_0x1ad992-0x0;var _0x535234=_0xe706[_0x1ad992];return _0x535234;};'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 38a4788..44fae33 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 _0x515a=['STRING','DATE','BOOLEAN','exports'];(function(_0x37b1bd,_0x11b705){var _0x502ce9=function(_0x41025f){while(--_0x41025f){_0x37b1bd['push'](_0x37b1bd['shift']());}};_0x502ce9(++_0x11b705);}(_0x515a,0xbb));var _0xa515=function(_0x58f641,_0x17987f){_0x58f641=_0x58f641-0x0;var _0x402896=_0x515a[_0x58f641];return _0x402896;};'use strict';var Sequelize=require('sequelize');module[_0xa515('0x0')]={'network':{'type':Sequelize[_0xa515('0x1')]},'network_script':{'type':Sequelize[_0xa515('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa515('0x1')]},'type':{'type':Sequelize[_0xa515('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xa515('0x1')]},'callerid':{'type':Sequelize[_0xa515('0x1')]},'calleridname':{'type':Sequelize[_0xa515('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa515('0x1')]},'callington':{'type':Sequelize[_0xa515('0x1')]},'callingtns':{'type':Sequelize[_0xa515('0x1')]},'dnid':{'type':Sequelize[_0xa515('0x1')]},'rdnis':{'type':Sequelize[_0xa515('0x1')]},'context':{'type':Sequelize[_0xa515('0x1')]},'extension':{'type':Sequelize[_0xa515('0x1')]},'priority':{'type':Sequelize[_0xa515('0x1')]},'enhanced':{'type':Sequelize[_0xa515('0x1')]},'accountcode':{'type':Sequelize[_0xa515('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xa515('0x1')]},'joinAt':{'type':Sequelize[_0xa515('0x2')]},'leaveAt':{'type':Sequelize[_0xa515('0x2')]},'bot':{'type':Sequelize[_0xa515('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7208=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x58b3ca,_0x4183bc){var _0x1dfab9=function(_0xa24c69){while(--_0xa24c69){_0x58b3ca['push'](_0x58b3ca['shift']());}};_0x1dfab9(++_0x4183bc);}(_0x7208,0x16b));var _0x8720=function(_0x7cff95,_0xff5df5){_0x7cff95=_0x7cff95-0x0;var _0x1de48b=_0x7208[_0x7cff95];return _0x1de48b;};'use strict';var Sequelize=require(_0x8720('0x0'));module['exports']={'network':{'type':Sequelize[_0x8720('0x1')]},'network_script':{'type':Sequelize[_0x8720('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8720('0x1')]},'language':{'type':Sequelize[_0x8720('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x8720('0x1')]},'callerid':{'type':Sequelize[_0x8720('0x1')]},'calleridname':{'type':Sequelize[_0x8720('0x1')]},'callingpres':{'type':Sequelize[_0x8720('0x1')]},'callingani2':{'type':Sequelize[_0x8720('0x1')]},'callington':{'type':Sequelize[_0x8720('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x8720('0x1')]},'context':{'type':Sequelize[_0x8720('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8720('0x1')]},'enhanced':{'type':Sequelize[_0x8720('0x1')]},'accountcode':{'type':Sequelize[_0x8720('0x1')]},'threadid':{'type':Sequelize[_0x8720('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8720('0x2')]},'bot':{'type':Sequelize[_0x8720('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d740454..7739791 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 _0xfd11=['includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','status','end','json','offset','undefined','count','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport'];(function(_0x4f0c88,_0x4b3a7f){var _0x152ee9=function(_0x1e5d84){while(--_0x1e5d84){_0x4f0c88['push'](_0x4f0c88['shift']());}};_0x152ee9(++_0x4b3a7f);}(_0xfd11,0x1b5));var _0x1fd1=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xfd11[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require(_0x1fd1('0x0'));var rimraf=require(_0x1fd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fd1('0x2'));var rp=require(_0x1fd1('0x3'));var moment=require(_0x1fd1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fd1('0x5'));var path=require(_0x1fd1('0x6'));var sox=require(_0x1fd1('0x7'));var csv=require(_0x1fd1('0x8'));var ejs=require(_0x1fd1('0x9'));var fs=require('fs');var fs_extra=require(_0x1fd1('0xa'));var _=require('lodash');var squel=require(_0x1fd1('0xb'));var crypto=require('crypto');var jsforce=require(_0x1fd1('0xc'));var deskjs=require(_0x1fd1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1fd1('0xe'));var Papa=require('papaparse');var Redis=require(_0x1fd1('0xf'));var authService=require(_0x1fd1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1fd1('0x11'));var hardwareService=require(_0x1fd1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1fd1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38897b,_0x29a384){_0x29a384=_0x29a384||0xcc;return function(_0x176775){if(_0x176775){return _0x38897b['sendStatus'](_0x29a384);}return _0x38897b[_0x1fd1('0x14')](_0x29a384)[_0x1fd1('0x15')]();};}function respondWithResult(_0xd74584,_0x2cd2df){_0x2cd2df=_0x2cd2df||0xc8;return function(_0x54f613){if(_0x54f613){return _0xd74584[_0x1fd1('0x14')](_0x2cd2df)[_0x1fd1('0x16')](_0x54f613);}};}function respondWithFilteredResult(_0x325c62,_0x3c84a7){return function(_0x1cb726){if(_0x1cb726){var _0x2c16fd=typeof _0x3c84a7[_0x1fd1('0x17')]===_0x1fd1('0x18')&&typeof _0x3c84a7['limit']===_0x1fd1('0x18');var _0xca4901=_0x1cb726['count'];var _0x174952=_0x2c16fd?0x0:_0x3c84a7[_0x1fd1('0x17')];var _0x5abd0c=_0x2c16fd?_0x1cb726[_0x1fd1('0x19')]:_0x3c84a7[_0x1fd1('0x17')]+_0x3c84a7['limit'];var _0x530729;if(_0x5abd0c>=_0xca4901){_0x5abd0c=_0xca4901;_0x530729=0xc8;}else{_0x530729=0xce;}_0x325c62['status'](_0x530729);return _0x325c62['set']('Content-Range',_0x174952+'-'+_0x5abd0c+'/'+_0xca4901)['json'](_0x1cb726);}return null;};}function patchUpdates(_0x56a41d){return function(_0x1f8aac){try{jsonpatch[_0x1fd1('0x1a')](_0x1f8aac,_0x56a41d,!![]);}catch(_0x4c9ee5){return BPromise[_0x1fd1('0x1b')](_0x4c9ee5);}return _0x1f8aac[_0x1fd1('0x1c')]();};}function saveUpdates(_0x1e0b00,_0x6efab){return function(_0x47b141){if(_0x47b141){return _0x47b141['update'](_0x1e0b00)[_0x1fd1('0x1d')](function(_0x254f68){return _0x254f68;});}return null;};}function removeEntity(_0x45ea4e,_0xae5435){return function(_0x5a820c){if(_0x5a820c){return _0x5a820c[_0x1fd1('0x1e')]()[_0x1fd1('0x1d')](function(){_0x45ea4e[_0x1fd1('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1741c3,_0x24d102){return function(_0x3849c9){if(!_0x3849c9){_0x1741c3[_0x1fd1('0x1f')](0x194);}return _0x3849c9;};}function handleError(_0x2195f6,_0x1fc2b6){_0x1fc2b6=_0x1fc2b6||0x1f4;return function(_0x319eda){logger[_0x1fd1('0x20')](_0x319eda[_0x1fd1('0x21')]);if(_0x319eda[_0x1fd1('0x22')]){delete _0x319eda[_0x1fd1('0x22')];}_0x2195f6[_0x1fd1('0x14')](_0x1fc2b6)[_0x1fd1('0x23')](_0x319eda);};}exports['index']=function(_0x3cacf3,_0x463739){var _0x9a0430={},_0x1f6059={},_0x1704d2={'count':0x0,'rows':[]};var _0x5a5540=_['map'](db['SquareReport'][_0x1fd1('0x24')],function(_0x12f74c){return{'name':_0x12f74c[_0x1fd1('0x25')],'type':_0x12f74c[_0x1fd1('0x26')][_0x1fd1('0x27')]};});_0x1f6059[_0x1fd1('0x28')]=_[_0x1fd1('0x29')](_0x5a5540,_0x1fd1('0x22'));_0x1f6059[_0x1fd1('0x2a')]=_[_0x1fd1('0x2b')](_0x3cacf3[_0x1fd1('0x2a')]);_0x1f6059[_0x1fd1('0x2c')]=_[_0x1fd1('0x2d')](_0x1f6059['model'],_0x1f6059[_0x1fd1('0x2a')]);_0x9a0430[_0x1fd1('0x2e')]=_[_0x1fd1('0x2d')](_0x1f6059[_0x1fd1('0x28')],qs[_0x1fd1('0x2f')](_0x3cacf3[_0x1fd1('0x2a')]['fields']));_0x9a0430[_0x1fd1('0x2e')]=_0x9a0430[_0x1fd1('0x2e')][_0x1fd1('0x30')]?_0x9a0430[_0x1fd1('0x2e')]:_0x1f6059[_0x1fd1('0x28')];if(!_0x3cacf3[_0x1fd1('0x2a')]['hasOwnProperty'](_0x1fd1('0x31'))){_0x9a0430[_0x1fd1('0x32')]=qs[_0x1fd1('0x32')](_0x3cacf3['query']['limit']);_0x9a0430[_0x1fd1('0x17')]=qs[_0x1fd1('0x17')](_0x3cacf3[_0x1fd1('0x2a')][_0x1fd1('0x17')]);}_0x9a0430[_0x1fd1('0x33')]=qs[_0x1fd1('0x34')](_0x3cacf3[_0x1fd1('0x2a')][_0x1fd1('0x34')]);_0x9a0430[_0x1fd1('0x35')]=qs[_0x1fd1('0x2c')](_[_0x1fd1('0x36')](_0x3cacf3[_0x1fd1('0x2a')],_0x1f6059[_0x1fd1('0x2c')]),_0x5a5540);if(_0x3cacf3['query'][_0x1fd1('0x37')]){_0x9a0430[_0x1fd1('0x35')]=_[_0x1fd1('0x38')](_0x9a0430[_0x1fd1('0x35')],{'$or':_[_0x1fd1('0x29')](_0x5a5540,function(_0x11bcdf){if(_0x11bcdf[_0x1fd1('0x26')]!==_0x1fd1('0x39')){var _0x57f8d9={};_0x57f8d9[_0x11bcdf[_0x1fd1('0x22')]]={'$like':'%'+_0x3cacf3[_0x1fd1('0x2a')]['filter']+'%'};return _0x57f8d9;}})});}_0x9a0430=_['merge']({},_0x9a0430,_0x3cacf3[_0x1fd1('0x3a')]);var _0x5b6b30={'where':_0x9a0430[_0x1fd1('0x35')]};return db[_0x1fd1('0x3b')][_0x1fd1('0x19')](_0x5b6b30)[_0x1fd1('0x1d')](function(_0xd005ff){_0x1704d2[_0x1fd1('0x19')]=_0xd005ff;if(_0x3cacf3[_0x1fd1('0x2a')][_0x1fd1('0x3c')]){_0x9a0430['include']=[{'all':!![]}];}return db[_0x1fd1('0x3b')][_0x1fd1('0x3d')](_0x9a0430);})[_0x1fd1('0x1d')](function(_0x152012){_0x1704d2[_0x1fd1('0x3e')]=_0x152012;return _0x1704d2;})['then'](respondWithFilteredResult(_0x463739,_0x9a0430))['catch'](handleError(_0x463739,null));};exports[_0x1fd1('0x3f')]=function(_0x4d2964,_0x2c03a5){var _0x500f95={'raw':!![],'where':{'id':_0x4d2964['params']['id']}},_0x2ab190={};_0x2ab190[_0x1fd1('0x28')]=_['keys'](db['SquareReport'][_0x1fd1('0x24')]);_0x2ab190[_0x1fd1('0x2a')]=_['keys'](_0x4d2964['query']);_0x2ab190[_0x1fd1('0x2c')]=_[_0x1fd1('0x2d')](_0x2ab190[_0x1fd1('0x28')],_0x2ab190[_0x1fd1('0x2a')]);_0x500f95[_0x1fd1('0x2e')]=_[_0x1fd1('0x2d')](_0x2ab190[_0x1fd1('0x28')],qs[_0x1fd1('0x2f')](_0x4d2964[_0x1fd1('0x2a')]['fields']));_0x500f95['attributes']=_0x500f95[_0x1fd1('0x2e')]['length']?_0x500f95[_0x1fd1('0x2e')]:_0x2ab190[_0x1fd1('0x28')];if(_0x4d2964[_0x1fd1('0x2a')][_0x1fd1('0x3c')]){_0x500f95[_0x1fd1('0x40')]=[{'all':!![]}];}_0x500f95=_[_0x1fd1('0x38')]({},_0x500f95,_0x4d2964[_0x1fd1('0x3a')]);return db['SquareReport'][_0x1fd1('0x41')](_0x500f95)[_0x1fd1('0x1d')](handleEntityNotFound(_0x2c03a5,null))[_0x1fd1('0x1d')](respondWithResult(_0x2c03a5,null))[_0x1fd1('0x42')](handleError(_0x2c03a5,null));};exports[_0x1fd1('0x43')]=function(_0xacf84f,_0x263a54){return db[_0x1fd1('0x3b')]['create'](_0xacf84f[_0x1fd1('0x44')],{})[_0x1fd1('0x1d')](respondWithResult(_0x263a54,0xc9))['catch'](handleError(_0x263a54,null));};exports['update']=function(_0x563d73,_0x3b2feb){if(_0x563d73[_0x1fd1('0x44')]['id']){delete _0x563d73[_0x1fd1('0x44')]['id'];}return db['SquareReport'][_0x1fd1('0x41')]({'where':{'id':_0x563d73[_0x1fd1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b2feb,null))[_0x1fd1('0x1d')](saveUpdates(_0x563d73[_0x1fd1('0x44')],null))[_0x1fd1('0x1d')](respondWithResult(_0x3b2feb,null))[_0x1fd1('0x42')](handleError(_0x3b2feb,null));};exports[_0x1fd1('0x1e')]=function(_0x34b927,_0x5d041a){return db[_0x1fd1('0x3b')][_0x1fd1('0x41')]({'where':{'id':_0x34b927[_0x1fd1('0x45')]['id']}})[_0x1fd1('0x1d')](handleEntityNotFound(_0x5d041a,null))[_0x1fd1('0x1d')](removeEntity(_0x5d041a,null))[_0x1fd1('0x42')](handleError(_0x5d041a,null));};exports[_0x1fd1('0x46')]=function(_0x43d27c,_0x447c28){return db[_0x1fd1('0x3b')][_0x1fd1('0x46')]()[_0x1fd1('0x1d')](respondWithResult(_0x447c28,null))[_0x1fd1('0x42')](handleError(_0x447c28,null));}; \ No newline at end of file +var _0x6b3e=['catch','params','keys','options','create','body','find','describe','rimraf','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows'];(function(_0x42bcf3,_0x3481cd){var _0x19dbfd=function(_0x599f69){while(--_0x599f69){_0x42bcf3['push'](_0x42bcf3['shift']());}};_0x19dbfd(++_0x3481cd);}(_0x6b3e,0xec));var _0xe6b3=function(_0x4d6304,_0x28c334){_0x4d6304=_0x4d6304-0x0;var _0x472f80=_0x6b3e[_0x4d6304];return _0x472f80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6b3('0x1'));var rp=require(_0xe6b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe6b3('0x3'));var util=require(_0xe6b3('0x4'));var path=require(_0xe6b3('0x5'));var sox=require(_0xe6b3('0x6'));var csv=require(_0xe6b3('0x7'));var ejs=require(_0xe6b3('0x8'));var fs=require('fs');var fs_extra=require(_0xe6b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe6b3('0xa'));var jsforce=require(_0xe6b3('0xb'));var deskjs=require(_0xe6b3('0xc'));var toCsv=require(_0xe6b3('0x7'));var querystring=require('querystring');var Papa=require(_0xe6b3('0xd'));var Redis=require(_0xe6b3('0xe'));var authService=require(_0xe6b3('0xf'));var qs=require(_0xe6b3('0x10'));var as=require(_0xe6b3('0x11'));var hardwareService=require(_0xe6b3('0x12'));var logger=require(_0xe6b3('0x13'))(_0xe6b3('0x14'));var utils=require(_0xe6b3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe6b3('0x16'));var db=require(_0xe6b3('0x17'))['db'];function respondWithStatusCode(_0x5eae50,_0x363f99){_0x363f99=_0x363f99||0xcc;return function(_0x28ffc5){if(_0x28ffc5){return _0x5eae50[_0xe6b3('0x18')](_0x363f99);}return _0x5eae50[_0xe6b3('0x19')](_0x363f99)[_0xe6b3('0x1a')]();};}function respondWithResult(_0x2a474e,_0xfa211f){_0xfa211f=_0xfa211f||0xc8;return function(_0x8b81b8){if(_0x8b81b8){return _0x2a474e[_0xe6b3('0x19')](_0xfa211f)[_0xe6b3('0x1b')](_0x8b81b8);}};}function respondWithFilteredResult(_0x229be0,_0x343a7e){return function(_0xb00a9f){if(_0xb00a9f){var _0x4b41ac=typeof _0x343a7e[_0xe6b3('0x1c')]===_0xe6b3('0x1d')&&typeof _0x343a7e[_0xe6b3('0x1e')]===_0xe6b3('0x1d');var _0x134441=_0xb00a9f['count'];var _0x46ed2d=_0x4b41ac?0x0:_0x343a7e[_0xe6b3('0x1c')];var _0x27df1b=_0x4b41ac?_0xb00a9f[_0xe6b3('0x1f')]:_0x343a7e[_0xe6b3('0x1c')]+_0x343a7e[_0xe6b3('0x1e')];var _0x130430;if(_0x27df1b>=_0x134441){_0x27df1b=_0x134441;_0x130430=0xc8;}else{_0x130430=0xce;}_0x229be0['status'](_0x130430);return _0x229be0[_0xe6b3('0x20')](_0xe6b3('0x21'),_0x46ed2d+'-'+_0x27df1b+'/'+_0x134441)['json'](_0xb00a9f);}return null;};}function patchUpdates(_0x160d34){return function(_0x191982){try{jsonpatch['apply'](_0x191982,_0x160d34,!![]);}catch(_0xb5b778){return BPromise[_0xe6b3('0x22')](_0xb5b778);}return _0x191982[_0xe6b3('0x23')]();};}function saveUpdates(_0x577ee1,_0x3be84d){return function(_0x37602c){if(_0x37602c){return _0x37602c[_0xe6b3('0x24')](_0x577ee1)[_0xe6b3('0x25')](function(_0x4e8003){return _0x4e8003;});}return null;};}function removeEntity(_0x4c5500,_0x8e309e){return function(_0x4bdc21){if(_0x4bdc21){return _0x4bdc21[_0xe6b3('0x26')]()['then'](function(){_0x4c5500['status'](0xcc)[_0xe6b3('0x1a')]();});}};}function handleEntityNotFound(_0x15e238,_0x853a81){return function(_0x380457){if(!_0x380457){_0x15e238['sendStatus'](0x194);}return _0x380457;};}function handleError(_0x397466,_0x4345c6){_0x4345c6=_0x4345c6||0x1f4;return function(_0xf88151){logger[_0xe6b3('0x27')](_0xf88151[_0xe6b3('0x28')]);if(_0xf88151[_0xe6b3('0x29')]){delete _0xf88151[_0xe6b3('0x29')];}_0x397466['status'](_0x4345c6)[_0xe6b3('0x2a')](_0xf88151);};}exports[_0xe6b3('0x2b')]=function(_0x216ec2,_0x479d87){var _0x202c59={},_0x16bdb2={},_0x44e8b4={'count':0x0,'rows':[]};var _0xb102a6=_['map'](db[_0xe6b3('0x2c')][_0xe6b3('0x2d')],function(_0x4f05a3){return{'name':_0x4f05a3[_0xe6b3('0x2e')],'type':_0x4f05a3[_0xe6b3('0x2f')][_0xe6b3('0x30')]};});_0x16bdb2[_0xe6b3('0x31')]=_[_0xe6b3('0x32')](_0xb102a6,_0xe6b3('0x29'));_0x16bdb2[_0xe6b3('0x33')]=_['keys'](_0x216ec2['query']);_0x16bdb2[_0xe6b3('0x34')]=_[_0xe6b3('0x35')](_0x16bdb2[_0xe6b3('0x31')],_0x16bdb2[_0xe6b3('0x33')]);_0x202c59[_0xe6b3('0x36')]=_[_0xe6b3('0x35')](_0x16bdb2[_0xe6b3('0x31')],qs[_0xe6b3('0x37')](_0x216ec2[_0xe6b3('0x33')][_0xe6b3('0x37')]));_0x202c59[_0xe6b3('0x36')]=_0x202c59[_0xe6b3('0x36')][_0xe6b3('0x38')]?_0x202c59[_0xe6b3('0x36')]:_0x16bdb2[_0xe6b3('0x31')];if(!_0x216ec2[_0xe6b3('0x33')]['hasOwnProperty'](_0xe6b3('0x39'))){_0x202c59[_0xe6b3('0x1e')]=qs[_0xe6b3('0x1e')](_0x216ec2['query']['limit']);_0x202c59[_0xe6b3('0x1c')]=qs['offset'](_0x216ec2[_0xe6b3('0x33')]['offset']);}_0x202c59[_0xe6b3('0x3a')]=qs['sort'](_0x216ec2[_0xe6b3('0x33')][_0xe6b3('0x3b')]);_0x202c59['where']=qs[_0xe6b3('0x34')](_[_0xe6b3('0x3c')](_0x216ec2[_0xe6b3('0x33')],_0x16bdb2['filters']),_0xb102a6);if(_0x216ec2['query'][_0xe6b3('0x3d')]){_0x202c59['where']=_['merge'](_0x202c59[_0xe6b3('0x3e')],{'$or':_[_0xe6b3('0x32')](_0xb102a6,function(_0x4b80a4){if(_0x4b80a4[_0xe6b3('0x2f')]!==_0xe6b3('0x3f')){var _0x2f94b7={};_0x2f94b7[_0x4b80a4[_0xe6b3('0x29')]]={'$like':'%'+_0x216ec2[_0xe6b3('0x33')][_0xe6b3('0x3d')]+'%'};return _0x2f94b7;}})});}_0x202c59=_[_0xe6b3('0x40')]({},_0x202c59,_0x216ec2['options']);var _0x5c3bab={'where':_0x202c59[_0xe6b3('0x3e')]};return db[_0xe6b3('0x2c')][_0xe6b3('0x1f')](_0x5c3bab)[_0xe6b3('0x25')](function(_0x2b3ad7){_0x44e8b4[_0xe6b3('0x1f')]=_0x2b3ad7;if(_0x216ec2[_0xe6b3('0x33')][_0xe6b3('0x41')]){_0x202c59['include']=[{'all':!![]}];}return db[_0xe6b3('0x2c')][_0xe6b3('0x42')](_0x202c59);})[_0xe6b3('0x25')](function(_0x4518d3){_0x44e8b4[_0xe6b3('0x43')]=_0x4518d3;return _0x44e8b4;})[_0xe6b3('0x25')](respondWithFilteredResult(_0x479d87,_0x202c59))[_0xe6b3('0x44')](handleError(_0x479d87,null));};exports['show']=function(_0x57efa1,_0x2b4ddd){var _0x25ab90={'raw':!![],'where':{'id':_0x57efa1[_0xe6b3('0x45')]['id']}},_0x458d05={};_0x458d05[_0xe6b3('0x31')]=_[_0xe6b3('0x46')](db[_0xe6b3('0x2c')][_0xe6b3('0x2d')]);_0x458d05[_0xe6b3('0x33')]=_[_0xe6b3('0x46')](_0x57efa1[_0xe6b3('0x33')]);_0x458d05[_0xe6b3('0x34')]=_[_0xe6b3('0x35')](_0x458d05[_0xe6b3('0x31')],_0x458d05['query']);_0x25ab90[_0xe6b3('0x36')]=_[_0xe6b3('0x35')](_0x458d05[_0xe6b3('0x31')],qs[_0xe6b3('0x37')](_0x57efa1[_0xe6b3('0x33')]['fields']));_0x25ab90['attributes']=_0x25ab90['attributes'][_0xe6b3('0x38')]?_0x25ab90[_0xe6b3('0x36')]:_0x458d05['model'];if(_0x57efa1[_0xe6b3('0x33')][_0xe6b3('0x41')]){_0x25ab90['include']=[{'all':!![]}];}_0x25ab90=_['merge']({},_0x25ab90,_0x57efa1[_0xe6b3('0x47')]);return db[_0xe6b3('0x2c')]['find'](_0x25ab90)[_0xe6b3('0x25')](handleEntityNotFound(_0x2b4ddd,null))[_0xe6b3('0x25')](respondWithResult(_0x2b4ddd,null))[_0xe6b3('0x44')](handleError(_0x2b4ddd,null));};exports[_0xe6b3('0x48')]=function(_0xbce878,_0x247d62){return db[_0xe6b3('0x2c')][_0xe6b3('0x48')](_0xbce878[_0xe6b3('0x49')],{})['then'](respondWithResult(_0x247d62,0xc9))['catch'](handleError(_0x247d62,null));};exports['update']=function(_0x744f59,_0x41de13){if(_0x744f59[_0xe6b3('0x49')]['id']){delete _0x744f59[_0xe6b3('0x49')]['id'];}return db[_0xe6b3('0x2c')]['find']({'where':{'id':_0x744f59[_0xe6b3('0x45')]['id']}})[_0xe6b3('0x25')](handleEntityNotFound(_0x41de13,null))[_0xe6b3('0x25')](saveUpdates(_0x744f59[_0xe6b3('0x49')],null))[_0xe6b3('0x25')](respondWithResult(_0x41de13,null))[_0xe6b3('0x44')](handleError(_0x41de13,null));};exports['destroy']=function(_0x5c3837,_0x1cc3bd){return db[_0xe6b3('0x2c')][_0xe6b3('0x4a')]({'where':{'id':_0x5c3837[_0xe6b3('0x45')]['id']}})[_0xe6b3('0x25')](handleEntityNotFound(_0x1cc3bd,null))['then'](removeEntity(_0x1cc3bd,null))[_0xe6b3('0x44')](handleError(_0x1cc3bd,null));};exports['describe']=function(_0x5cbcdf,_0x1a5975){return db[_0xe6b3('0x2c')][_0xe6b3('0x4b')]()[_0xe6b3('0x25')](respondWithResult(_0x1a5975,null))[_0xe6b3('0x44')](handleError(_0x1a5975,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 61e3fab..389ca7b 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 _0xc840=['exports','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x26462e,_0x416ff7){var _0x31c3f0=function(_0xd387ea){while(--_0xd387ea){_0x26462e['push'](_0x26462e['shift']());}};_0x31c3f0(++_0x416ff7);}(_0xc840,0x92));var _0x0c84=function(_0x1d61ab,_0x53d954){_0x1d61ab=_0x1d61ab-0x0;var _0x229a24=_0xc840[_0x1d61ab];return _0x229a24;};'use strict';var _=require(_0x0c84('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c84('0x1'));var moment=require(_0x0c84('0x2'));var BPromise=require(_0x0c84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c84('0x4'));var rimraf=require(_0x0c84('0x5'));var config=require(_0x0c84('0x6'));var attributes=require(_0x0c84('0x7'));module[_0x0c84('0x8')]=function(_0x200589,_0x472ace){return _0x200589['define'](_0x0c84('0x9'),attributes,{'tableName':_0x0c84('0xa'),'paranoid':![],'indexes':[{'name':_0x0c84('0xb'),'fields':['uniqueid',_0x0c84('0xc')]},{'name':_0x0c84('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x05fa=['api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x05fa,0x11e));var _0xa05f=function(_0x5edf61,_0x4cedec){_0x5edf61=_0x5edf61-0x0;var _0x396335=_0x05fa[_0x5edf61];return _0x396335;};'use strict';var _=require(_0xa05f('0x0'));var util=require('util');var logger=require(_0xa05f('0x1'))(_0xa05f('0x2'));var moment=require(_0xa05f('0x3'));var BPromise=require(_0xa05f('0x4'));var rp=require(_0xa05f('0x5'));var fs=require('fs');var path=require(_0xa05f('0x6'));var rimraf=require('rimraf');var config=require(_0xa05f('0x7'));var attributes=require(_0xa05f('0x8'));module['exports']=function(_0x1bffc5,_0x2bfcb1){return _0x1bffc5[_0xa05f('0x9')](_0xa05f('0xa'),attributes,{'tableName':_0xa05f('0xb'),'paranoid':![],'indexes':[{'name':_0xa05f('0xc'),'fields':[_0xa05f('0xd'),_0xa05f('0xe')]},{'name':_0xa05f('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 7686645..b11cbdb 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 _0xe0eb=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','options','raw','then','info','UpdateSquareReport','update','body','where','limit','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','request','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1e2cd9,_0x30dd29){var _0x399960=function(_0x10e6df){while(--_0x10e6df){_0x1e2cd9['push'](_0x1e2cd9['shift']());}};_0x399960(++_0x30dd29);}(_0xe0eb,0xba));var _0xbe0e=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0xe0eb[_0x37d0bc];return _0x170e60;};'use strict';var _=require('lodash');var util=require(_0xbe0e('0x0'));var moment=require(_0xbe0e('0x1'));var BPromise=require(_0xbe0e('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('../../config/logger')(_0xbe0e('0x3'));var config=require(_0xbe0e('0x4'));var jayson=require(_0xbe0e('0x5'));var client=jayson[_0xbe0e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x587070,_0x298596,_0x218c92){return new BPromise(function(_0xd83e74,_0x2572a9){return client[_0xbe0e('0x7')](_0x587070,_0x218c92)['then'](function(_0x3e8efb){logger['info'](_0xbe0e('0x8'),_0x298596,_0xbe0e('0x9'));logger[_0xbe0e('0xa')](_0xbe0e('0xb'),_0x298596,'request\x20sent',JSON[_0xbe0e('0xc')](_0x3e8efb));if(_0x3e8efb[_0xbe0e('0xd')]){if(_0x3e8efb[_0xbe0e('0xd')][_0xbe0e('0xe')]===0x1f4){logger[_0xbe0e('0xd')](_0xbe0e('0x8'),_0x298596,_0x3e8efb[_0xbe0e('0xd')]['message']);return _0x2572a9(_0x3e8efb[_0xbe0e('0xd')][_0xbe0e('0xf')]);}logger[_0xbe0e('0xd')](_0xbe0e('0x8'),_0x298596,_0x3e8efb[_0xbe0e('0xd')][_0xbe0e('0xf')]);return _0xd83e74(_0x3e8efb[_0xbe0e('0xd')][_0xbe0e('0xf')]);}else{logger['info'](_0xbe0e('0x8'),_0x298596,_0xbe0e('0x9'));_0xd83e74(_0x3e8efb['result'][_0xbe0e('0xf')]);}})[_0xbe0e('0x10')](function(_0x237f48){logger['error'](_0xbe0e('0x8'),_0x298596,_0x237f48);_0x2572a9(_0x237f48);});});}exports[_0xbe0e('0x11')]=function(_0x2158e9){var _0x483586=this;return new Promise(function(_0x34a9b5,_0x56c14e){return db[_0xbe0e('0x12')]['create'](_0x2158e9['body'],{'raw':_0x2158e9[_0xbe0e('0x13')]?_0x2158e9[_0xbe0e('0x13')][_0xbe0e('0x14')]===undefined?!![]:![]:!![]})[_0xbe0e('0x15')](function(_0x524f98){logger[_0xbe0e('0x16')](_0xbe0e('0x11'),_0x2158e9);logger[_0xbe0e('0xa')](_0xbe0e('0x11'),_0x2158e9,JSON[_0xbe0e('0xc')](_0x524f98));_0x34a9b5(_0x524f98);})['catch'](function(_0x179bfb){logger[_0xbe0e('0xd')](_0xbe0e('0x11'),_0x179bfb[_0xbe0e('0xf')],_0x2158e9);_0x56c14e(_0x483586[_0xbe0e('0xd')](0x1f4,_0x179bfb[_0xbe0e('0xf')]));});});};exports[_0xbe0e('0x17')]=function(_0x384460){var _0x3a2b6d=this;return new Promise(function(_0xe67266,_0x4a7e9d){return db[_0xbe0e('0x12')][_0xbe0e('0x18')](_0x384460[_0xbe0e('0x19')],{'raw':_0x384460[_0xbe0e('0x13')]?_0x384460[_0xbe0e('0x13')][_0xbe0e('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x384460['options']?_0x384460[_0xbe0e('0x13')][_0xbe0e('0x1a')]||null:null,'attributes':_0x384460[_0xbe0e('0x13')]?_0x384460['options']['attributes']||null:null,'limit':_0x384460['options']?_0x384460[_0xbe0e('0x13')][_0xbe0e('0x1b')]||null:null})['then'](function(_0x2aea8e){logger[_0xbe0e('0x16')](_0xbe0e('0x17'),_0x384460);logger[_0xbe0e('0xa')](_0xbe0e('0x17'),_0x384460,JSON[_0xbe0e('0xc')](_0x2aea8e));_0xe67266(_0x2aea8e);})['catch'](function(_0x1e6f2a){logger['error'](_0xbe0e('0x17'),_0x1e6f2a[_0xbe0e('0xf')],_0x384460);_0x4a7e9d(_0x3a2b6d[_0xbe0e('0xd')](0x1f4,_0x1e6f2a[_0xbe0e('0xf')]));});});}; \ No newline at end of file +var _0xf608=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x4039a2,_0x133aff){var _0x127bc5=function(_0x5ca8d7){while(--_0x5ca8d7){_0x4039a2['push'](_0x4039a2['shift']());}};_0x127bc5(++_0x133aff);}(_0xf608,0xc4));var _0x8f60=function(_0x194cb5,_0x479e8a){_0x194cb5=_0x194cb5-0x0;var _0x55db4b=_0xf608[_0x194cb5];return _0x55db4b;};'use strict';var _=require(_0x8f60('0x0'));var util=require(_0x8f60('0x1'));var moment=require('moment');var BPromise=require(_0x8f60('0x2'));var rs=require(_0x8f60('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f60('0x4'))['db'];var utils=require(_0x8f60('0x5'));var logger=require(_0x8f60('0x6'))(_0x8f60('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f60('0x8'));var client=jayson[_0x8f60('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x535b0b,_0x358dcb,_0x47ebdc){return new BPromise(function(_0xf79aab,_0x103f7c){return client[_0x8f60('0xa')](_0x535b0b,_0x47ebdc)[_0x8f60('0xb')](function(_0x2aa3f7){logger[_0x8f60('0xc')]('SquareReport,\x20%s,\x20%s',_0x358dcb,_0x8f60('0xd'));logger[_0x8f60('0xe')](_0x8f60('0xf'),_0x358dcb,_0x8f60('0xd'),JSON[_0x8f60('0x10')](_0x2aa3f7));if(_0x2aa3f7['error']){if(_0x2aa3f7[_0x8f60('0x11')]['code']===0x1f4){logger[_0x8f60('0x11')](_0x8f60('0x12'),_0x358dcb,_0x2aa3f7[_0x8f60('0x11')][_0x8f60('0x13')]);return _0x103f7c(_0x2aa3f7[_0x8f60('0x11')]['message']);}logger[_0x8f60('0x11')](_0x8f60('0x12'),_0x358dcb,_0x2aa3f7[_0x8f60('0x11')][_0x8f60('0x13')]);return _0xf79aab(_0x2aa3f7[_0x8f60('0x11')][_0x8f60('0x13')]);}else{logger[_0x8f60('0xc')]('SquareReport,\x20%s,\x20%s',_0x358dcb,'request\x20sent');_0xf79aab(_0x2aa3f7['result'][_0x8f60('0x13')]);}})[_0x8f60('0x14')](function(_0x2632ee){logger['error']('SquareReport,\x20%s,\x20%s',_0x358dcb,_0x2632ee);_0x103f7c(_0x2632ee);});});}exports[_0x8f60('0x15')]=function(_0x401800){var _0x5dfefe=this;return new Promise(function(_0x4ed06f,_0x5ea375){return db[_0x8f60('0x16')][_0x8f60('0x17')](_0x401800[_0x8f60('0x18')],{'raw':_0x401800[_0x8f60('0x19')]?_0x401800[_0x8f60('0x19')][_0x8f60('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5db1d6){logger['info'](_0x8f60('0x15'),_0x401800);logger[_0x8f60('0xe')](_0x8f60('0x15'),_0x401800,JSON[_0x8f60('0x10')](_0x5db1d6));_0x4ed06f(_0x5db1d6);})[_0x8f60('0x14')](function(_0x4615c4){logger[_0x8f60('0x11')](_0x8f60('0x15'),_0x4615c4[_0x8f60('0x13')],_0x401800);_0x5ea375(_0x5dfefe[_0x8f60('0x11')](0x1f4,_0x4615c4[_0x8f60('0x13')]));});});};exports[_0x8f60('0x1b')]=function(_0x2941b3){var _0x21fe5f=this;return new Promise(function(_0x355788,_0x275dcb){return db['SquareReport']['update'](_0x2941b3[_0x8f60('0x18')],{'raw':_0x2941b3[_0x8f60('0x19')]?_0x2941b3[_0x8f60('0x19')][_0x8f60('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2941b3[_0x8f60('0x19')]?_0x2941b3['options'][_0x8f60('0x1c')]||null:null,'attributes':_0x2941b3[_0x8f60('0x19')]?_0x2941b3['options'][_0x8f60('0x1d')]||null:null,'limit':_0x2941b3['options']?_0x2941b3['options']['limit']||null:null})[_0x8f60('0xb')](function(_0x257111){logger[_0x8f60('0xc')]('UpdateSquareReport',_0x2941b3);logger['debug'](_0x8f60('0x1b'),_0x2941b3,JSON[_0x8f60('0x10')](_0x257111));_0x355788(_0x257111);})[_0x8f60('0x14')](function(_0x45b3cc){logger['error'](_0x8f60('0x1b'),_0x45b3cc['message'],_0x2941b3);_0x275dcb(_0x21fe5f[_0x8f60('0x11')](0x1f4,_0x45b3cc[_0x8f60('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 3b3f90b..55c1afd 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 _0xd87e=['./squareReportDetail.controller','index','get','/describe','/:id','isAuthenticated','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x415979,_0x318a9b){var _0x284a90=function(_0x3709fe){while(--_0x3709fe){_0x415979['push'](_0x415979['shift']());}};_0x284a90(++_0x318a9b);}(_0xd87e,0xc8));var _0xed87=function(_0x4e76d8,_0x85e650){_0x4e76d8=_0x4e76d8-0x0;var _0x340fb6=_0xd87e[_0x4e76d8];return _0x340fb6;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require(_0xed87('0x2'));var timeout=require(_0xed87('0x3'));var express=require(_0xed87('0x4'));var router=express[_0xed87('0x5')]();var fs_extra=require(_0xed87('0x6'));var auth=require(_0xed87('0x7'));var interaction=require(_0xed87('0x8'));var config=require(_0xed87('0x9'));var controller=require(_0xed87('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xed87('0xb')]);router[_0xed87('0xc')](_0xed87('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xed87('0xc')](_0xed87('0xe'),auth[_0xed87('0xf')](),controller[_0xed87('0x10')]);router[_0xed87('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xed87('0xe'),auth[_0xed87('0xf')](),controller[_0xed87('0x12')]);router['delete'](_0xed87('0xe'),auth[_0xed87('0xf')](),controller[_0xed87('0x13')]);module[_0xed87('0x14')]=router; \ No newline at end of file +var _0x460c=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','delete','destroy','exports'];(function(_0x5d7043,_0x4b36e8){var _0x261214=function(_0x5e136e){while(--_0x5e136e){_0x5d7043['push'](_0x5d7043['shift']());}};_0x261214(++_0x4b36e8);}(_0x460c,0x104));var _0xc460=function(_0x43bb45,_0x5521d6){_0x43bb45=_0x43bb45-0x0;var _0x421d03=_0x460c[_0x43bb45];return _0x421d03;};'use strict';var multer=require('multer');var util=require(_0xc460('0x0'));var path=require(_0xc460('0x1'));var timeout=require(_0xc460('0x2'));var express=require(_0xc460('0x3'));var router=express[_0xc460('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc460('0x5'));var interaction=require(_0xc460('0x6'));var config=require('../../config/environment');var controller=require(_0xc460('0x7'));router[_0xc460('0x8')]('/',auth[_0xc460('0x9')](),controller[_0xc460('0xa')]);router['get'](_0xc460('0xb'),auth[_0xc460('0x9')](),controller[_0xc460('0xc')]);router[_0xc460('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc460('0xd')]);router[_0xc460('0xe')]('/',auth[_0xc460('0x9')](),controller['create']);router[_0xc460('0xf')](_0xc460('0x10'),auth[_0xc460('0x9')](),controller['update']);router[_0xc460('0x11')]('/:id',auth[_0xc460('0x9')](),controller[_0xc460('0x12')]);module[_0xc460('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5a6d882..7701ec6 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 _0xac53=['TEXT','exports','STRING'];(function(_0x1a2c51,_0x37321b){var _0x4a13c8=function(_0xfa22db){while(--_0xfa22db){_0x1a2c51['push'](_0x1a2c51['shift']());}};_0x4a13c8(++_0x37321b);}(_0xac53,0xf4));var _0x3ac5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac53[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3ac5('0x0')]={'uniqueid':{'type':Sequelize[_0x3ac5('0x1')]},'node':{'type':Sequelize[_0x3ac5('0x1')]},'application':{'type':Sequelize[_0x3ac5('0x1')]},'data':{'type':Sequelize[_0x3ac5('0x2')]},'project_name':{'type':Sequelize[_0x3ac5('0x1')]},'callerid':{'type':Sequelize[_0x3ac5('0x1')]}}; \ No newline at end of file +var _0x2583=['STRING','exports'];(function(_0x562459,_0x4c6ca7){var _0x26d455=function(_0x58f4bd){while(--_0x58f4bd){_0x562459['push'](_0x562459['shift']());}};_0x26d455(++_0x4c6ca7);}(_0x2583,0xbb));var _0x3258=function(_0x6986d2,_0x455b36){_0x6986d2=_0x6986d2-0x0;var _0x43a9e8=_0x2583[_0x6986d2];return _0x43a9e8;};'use strict';var Sequelize=require('sequelize');module[_0x3258('0x0')]={'uniqueid':{'type':Sequelize[_0x3258('0x1')]},'node':{'type':Sequelize[_0x3258('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3258('0x1')]},'callerid':{'type':Sequelize[_0x3258('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 50cdf3a..5222a3f 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 _0xe05a=['create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','then','destroy','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','filters','options','find','catch'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0xe05a,0x185));var _0xae05=function(_0x41bec4,_0x38ef7e){_0x41bec4=_0x41bec4-0x0;var _0x58a3d0=_0xe05a[_0x41bec4];return _0x58a3d0;};'use strict';var emlformat=require(_0xae05('0x0'));var rimraf=require(_0xae05('0x1'));var zipdir=require(_0xae05('0x2'));var jsonpatch=require(_0xae05('0x3'));var rp=require(_0xae05('0x4'));var moment=require(_0xae05('0x5'));var BPromise=require(_0xae05('0x6'));var Mustache=require('mustache');var util=require(_0xae05('0x7'));var path=require(_0xae05('0x8'));var sox=require('sox');var csv=require(_0xae05('0x9'));var ejs=require(_0xae05('0xa'));var fs=require('fs');var fs_extra=require(_0xae05('0xb'));var _=require(_0xae05('0xc'));var squel=require('squel');var crypto=require(_0xae05('0xd'));var jsforce=require(_0xae05('0xe'));var deskjs=require(_0xae05('0xf'));var toCsv=require(_0xae05('0x9'));var querystring=require(_0xae05('0x10'));var Papa=require(_0xae05('0x11'));var Redis=require(_0xae05('0x12'));var authService=require(_0xae05('0x13'));var qs=require(_0xae05('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae05('0x15'));var logger=require(_0xae05('0x16'))(_0xae05('0x17'));var utils=require(_0xae05('0x18'));var config=require(_0xae05('0x19'));var licenseUtil=require(_0xae05('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbaca8d,_0x27b6f8){_0x27b6f8=_0x27b6f8||0xcc;return function(_0x548dea){if(_0x548dea){return _0xbaca8d['sendStatus'](_0x27b6f8);}return _0xbaca8d[_0xae05('0x1b')](_0x27b6f8)[_0xae05('0x1c')]();};}function respondWithResult(_0x4636dc,_0x349bc9){_0x349bc9=_0x349bc9||0xc8;return function(_0x2b47d6){if(_0x2b47d6){return _0x4636dc['status'](_0x349bc9)[_0xae05('0x1d')](_0x2b47d6);}};}function respondWithFilteredResult(_0x3bfd0f,_0x4c2962){return function(_0x567b03){if(_0x567b03){var _0x5c26ad=typeof _0x4c2962['offset']===_0xae05('0x1e')&&typeof _0x4c2962['limit']===_0xae05('0x1e');var _0x1c3956=_0x567b03['count'];var _0x5e7c1f=_0x5c26ad?0x0:_0x4c2962[_0xae05('0x1f')];var _0x524c9d=_0x5c26ad?_0x567b03[_0xae05('0x20')]:_0x4c2962['offset']+_0x4c2962[_0xae05('0x21')];var _0x3c92f1;if(_0x524c9d>=_0x1c3956){_0x524c9d=_0x1c3956;_0x3c92f1=0xc8;}else{_0x3c92f1=0xce;}_0x3bfd0f[_0xae05('0x1b')](_0x3c92f1);return _0x3bfd0f[_0xae05('0x22')](_0xae05('0x23'),_0x5e7c1f+'-'+_0x524c9d+'/'+_0x1c3956)[_0xae05('0x1d')](_0x567b03);}return null;};}function patchUpdates(_0x5f2748){return function(_0x45aa5c){try{jsonpatch[_0xae05('0x24')](_0x45aa5c,_0x5f2748,!![]);}catch(_0x3d7bae){return BPromise['reject'](_0x3d7bae);}return _0x45aa5c[_0xae05('0x25')]();};}function saveUpdates(_0x13abe6,_0x3e9dd1){return function(_0x8727f6){if(_0x8727f6){return _0x8727f6['update'](_0x13abe6)[_0xae05('0x26')](function(_0x5ed0df){return _0x5ed0df;});}return null;};}function removeEntity(_0x40cf51,_0x5da8dc){return function(_0x49f9bd){if(_0x49f9bd){return _0x49f9bd[_0xae05('0x27')]()['then'](function(){_0x40cf51[_0xae05('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3544f5,_0x3f7410){return function(_0x1a0387){if(!_0x1a0387){_0x3544f5['sendStatus'](0x194);}return _0x1a0387;};}function handleError(_0x500c82,_0x86dd4f){_0x86dd4f=_0x86dd4f||0x1f4;return function(_0x2552d5){logger['error'](_0x2552d5['stack']);if(_0x2552d5[_0xae05('0x28')]){delete _0x2552d5[_0xae05('0x28')];}_0x500c82[_0xae05('0x1b')](_0x86dd4f)[_0xae05('0x29')](_0x2552d5);};}exports[_0xae05('0x2a')]=function(_0x6594b,_0x3c120c){var _0x11852f={},_0x3192fb={},_0x32becb={'count':0x0,'rows':[]};var _0x5873f9=_[_0xae05('0x2b')](db[_0xae05('0x2c')][_0xae05('0x2d')],function(_0x4c9f4a){return{'name':_0x4c9f4a[_0xae05('0x2e')],'type':_0x4c9f4a[_0xae05('0x2f')][_0xae05('0x30')]};});_0x3192fb[_0xae05('0x31')]=_[_0xae05('0x2b')](_0x5873f9,_0xae05('0x28'));_0x3192fb[_0xae05('0x32')]=_[_0xae05('0x33')](_0x6594b[_0xae05('0x32')]);_0x3192fb['filters']=_[_0xae05('0x34')](_0x3192fb[_0xae05('0x31')],_0x3192fb[_0xae05('0x32')]);_0x11852f[_0xae05('0x35')]=_[_0xae05('0x34')](_0x3192fb[_0xae05('0x31')],qs[_0xae05('0x36')](_0x6594b[_0xae05('0x32')][_0xae05('0x36')]));_0x11852f[_0xae05('0x35')]=_0x11852f[_0xae05('0x35')]['length']?_0x11852f['attributes']:_0x3192fb['model'];if(!_0x6594b[_0xae05('0x32')][_0xae05('0x37')](_0xae05('0x38'))){_0x11852f[_0xae05('0x21')]=qs[_0xae05('0x21')](_0x6594b['query'][_0xae05('0x21')]);_0x11852f[_0xae05('0x1f')]=qs[_0xae05('0x1f')](_0x6594b[_0xae05('0x32')][_0xae05('0x1f')]);}_0x11852f[_0xae05('0x39')]=qs[_0xae05('0x3a')](_0x6594b[_0xae05('0x32')]['sort']);_0x11852f[_0xae05('0x3b')]=qs['filters'](_[_0xae05('0x3c')](_0x6594b[_0xae05('0x32')],_0x3192fb['filters']),_0x5873f9);if(_0x6594b[_0xae05('0x32')][_0xae05('0x3d')]){_0x11852f[_0xae05('0x3b')]=_['merge'](_0x11852f[_0xae05('0x3b')],{'$or':_[_0xae05('0x2b')](_0x5873f9,function(_0x5e12b0){if(_0x5e12b0[_0xae05('0x2f')]!==_0xae05('0x3e')){var _0x21a2e1={};_0x21a2e1[_0x5e12b0[_0xae05('0x28')]]={'$like':'%'+_0x6594b['query'][_0xae05('0x3d')]+'%'};return _0x21a2e1;}})});}_0x11852f=_[_0xae05('0x3f')]({},_0x11852f,_0x6594b['options']);var _0x21abd9={'where':_0x11852f[_0xae05('0x3b')]};return db['SquareDetailsReport'][_0xae05('0x20')](_0x21abd9)['then'](function(_0x182bbc){_0x32becb['count']=_0x182bbc;if(_0x6594b[_0xae05('0x32')][_0xae05('0x40')]){_0x11852f[_0xae05('0x41')]=[{'all':!![]}];}return db[_0xae05('0x2c')][_0xae05('0x42')](_0x11852f);})[_0xae05('0x26')](function(_0x35b948){_0x32becb['rows']=_0x35b948;return _0x32becb;})[_0xae05('0x26')](respondWithFilteredResult(_0x3c120c,_0x11852f))['catch'](handleError(_0x3c120c,null));};exports[_0xae05('0x43')]=function(_0x4af6e2,_0x418832){var _0x54adaa={'raw':!![],'where':{'id':_0x4af6e2[_0xae05('0x44')]['id']}},_0x332875={};_0x332875[_0xae05('0x31')]=_[_0xae05('0x33')](db[_0xae05('0x2c')][_0xae05('0x2d')]);_0x332875[_0xae05('0x32')]=_[_0xae05('0x33')](_0x4af6e2['query']);_0x332875[_0xae05('0x45')]=_[_0xae05('0x34')](_0x332875[_0xae05('0x31')],_0x332875[_0xae05('0x32')]);_0x54adaa[_0xae05('0x35')]=_[_0xae05('0x34')](_0x332875[_0xae05('0x31')],qs[_0xae05('0x36')](_0x4af6e2['query']['fields']));_0x54adaa['attributes']=_0x54adaa[_0xae05('0x35')]['length']?_0x54adaa[_0xae05('0x35')]:_0x332875[_0xae05('0x31')];if(_0x4af6e2[_0xae05('0x32')][_0xae05('0x40')]){_0x54adaa[_0xae05('0x41')]=[{'all':!![]}];}_0x54adaa=_[_0xae05('0x3f')]({},_0x54adaa,_0x4af6e2[_0xae05('0x46')]);return db[_0xae05('0x2c')][_0xae05('0x47')](_0x54adaa)[_0xae05('0x26')](handleEntityNotFound(_0x418832,null))['then'](respondWithResult(_0x418832,null))[_0xae05('0x48')](handleError(_0x418832,null));};exports[_0xae05('0x49')]=function(_0x30b523,_0x550970){return db[_0xae05('0x2c')]['create'](_0x30b523[_0xae05('0x4a')],{})[_0xae05('0x26')](respondWithResult(_0x550970,0xc9))[_0xae05('0x48')](handleError(_0x550970,null));};exports[_0xae05('0x4b')]=function(_0x45d8db,_0x2ed380){if(_0x45d8db[_0xae05('0x4a')]['id']){delete _0x45d8db[_0xae05('0x4a')]['id'];}return db[_0xae05('0x2c')][_0xae05('0x47')]({'where':{'id':_0x45d8db[_0xae05('0x44')]['id']}})[_0xae05('0x26')](handleEntityNotFound(_0x2ed380,null))[_0xae05('0x26')](saveUpdates(_0x45d8db['body'],null))[_0xae05('0x26')](respondWithResult(_0x2ed380,null))['catch'](handleError(_0x2ed380,null));};exports[_0xae05('0x27')]=function(_0xc7b762,_0x2cc06c){return db['SquareDetailsReport'][_0xae05('0x47')]({'where':{'id':_0xc7b762['params']['id']}})[_0xae05('0x26')](handleEntityNotFound(_0x2cc06c,null))[_0xae05('0x26')](removeEntity(_0x2cc06c,null))[_0xae05('0x48')](handleError(_0x2cc06c,null));};exports[_0xae05('0x4c')]=function(_0xd00d20,_0x382dc7){return db[_0xae05('0x2c')][_0xae05('0x4c')]()[_0xae05('0x26')](respondWithResult(_0x382dc7,null))[_0xae05('0x48')](handleError(_0x382dc7,null));}; \ No newline at end of file +var _0xa9c9=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','rows','show','keys','include','find','create','catch','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x466390,_0x56d3d3){var _0x14df5a=function(_0x216bff){while(--_0x216bff){_0x466390['push'](_0x466390['shift']());}};_0x14df5a(++_0x56d3d3);}(_0xa9c9,0xae));var _0x9a9c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa9c9[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x9a9c('0x0'));var rimraf=require(_0x9a9c('0x1'));var zipdir=require(_0x9a9c('0x2'));var jsonpatch=require(_0x9a9c('0x3'));var rp=require(_0x9a9c('0x4'));var moment=require(_0x9a9c('0x5'));var BPromise=require(_0x9a9c('0x6'));var Mustache=require(_0x9a9c('0x7'));var util=require('util');var path=require(_0x9a9c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a9c('0x9'));var fs=require('fs');var fs_extra=require(_0x9a9c('0xa'));var _=require(_0x9a9c('0xb'));var squel=require(_0x9a9c('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a9c('0xd'));var deskjs=require(_0x9a9c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a9c('0xf'));var Redis=require('ioredis');var authService=require(_0x9a9c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9a9c('0x11'));var hardwareService=require(_0x9a9c('0x12'));var logger=require(_0x9a9c('0x13'))(_0x9a9c('0x14'));var utils=require(_0x9a9c('0x15'));var config=require(_0x9a9c('0x16'));var licenseUtil=require(_0x9a9c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fb438,_0x48a0f5){_0x48a0f5=_0x48a0f5||0xcc;return function(_0x50fe02){if(_0x50fe02){return _0x1fb438['sendStatus'](_0x48a0f5);}return _0x1fb438[_0x9a9c('0x18')](_0x48a0f5)[_0x9a9c('0x19')]();};}function respondWithResult(_0x1066db,_0x885964){_0x885964=_0x885964||0xc8;return function(_0x30e89f){if(_0x30e89f){return _0x1066db[_0x9a9c('0x18')](_0x885964)[_0x9a9c('0x1a')](_0x30e89f);}};}function respondWithFilteredResult(_0x3455bf,_0x3396d1){return function(_0x5c2bbe){if(_0x5c2bbe){var _0x18491c=typeof _0x3396d1[_0x9a9c('0x1b')]===_0x9a9c('0x1c')&&typeof _0x3396d1['limit']===_0x9a9c('0x1c');var _0x5de352=_0x5c2bbe[_0x9a9c('0x1d')];var _0x15744d=_0x18491c?0x0:_0x3396d1['offset'];var _0x256826=_0x18491c?_0x5c2bbe['count']:_0x3396d1[_0x9a9c('0x1b')]+_0x3396d1[_0x9a9c('0x1e')];var _0x2e92dc;if(_0x256826>=_0x5de352){_0x256826=_0x5de352;_0x2e92dc=0xc8;}else{_0x2e92dc=0xce;}_0x3455bf['status'](_0x2e92dc);return _0x3455bf[_0x9a9c('0x1f')](_0x9a9c('0x20'),_0x15744d+'-'+_0x256826+'/'+_0x5de352)[_0x9a9c('0x1a')](_0x5c2bbe);}return null;};}function patchUpdates(_0xdef2aa){return function(_0x4115ce){try{jsonpatch[_0x9a9c('0x21')](_0x4115ce,_0xdef2aa,!![]);}catch(_0x22c533){return BPromise[_0x9a9c('0x22')](_0x22c533);}return _0x4115ce[_0x9a9c('0x23')]();};}function saveUpdates(_0x394b75,_0x31b9d0){return function(_0xb2a509){if(_0xb2a509){return _0xb2a509[_0x9a9c('0x24')](_0x394b75)['then'](function(_0x1ed4c8){return _0x1ed4c8;});}return null;};}function removeEntity(_0x51b646,_0x5b5051){return function(_0x307321){if(_0x307321){return _0x307321['destroy']()[_0x9a9c('0x25')](function(){_0x51b646[_0x9a9c('0x18')](0xcc)[_0x9a9c('0x19')]();});}};}function handleEntityNotFound(_0x37edca,_0x20d141){return function(_0x2a7261){if(!_0x2a7261){_0x37edca[_0x9a9c('0x26')](0x194);}return _0x2a7261;};}function handleError(_0x20ea66,_0x3f0c2c){_0x3f0c2c=_0x3f0c2c||0x1f4;return function(_0x51f79b){logger[_0x9a9c('0x27')](_0x51f79b[_0x9a9c('0x28')]);if(_0x51f79b[_0x9a9c('0x29')]){delete _0x51f79b[_0x9a9c('0x29')];}_0x20ea66['status'](_0x3f0c2c)[_0x9a9c('0x2a')](_0x51f79b);};}exports[_0x9a9c('0x2b')]=function(_0x433264,_0x26d746){var _0x2b3fd0={},_0x12919a={},_0x4a0c3e={'count':0x0,'rows':[]};var _0x4e4dfc=_['map'](db['SquareDetailsReport'][_0x9a9c('0x2c')],function(_0x38cb5f){return{'name':_0x38cb5f['fieldName'],'type':_0x38cb5f[_0x9a9c('0x2d')]['key']};});_0x12919a[_0x9a9c('0x2e')]=_[_0x9a9c('0x2f')](_0x4e4dfc,_0x9a9c('0x29'));_0x12919a[_0x9a9c('0x30')]=_['keys'](_0x433264[_0x9a9c('0x30')]);_0x12919a['filters']=_[_0x9a9c('0x31')](_0x12919a['model'],_0x12919a[_0x9a9c('0x30')]);_0x2b3fd0['attributes']=_[_0x9a9c('0x31')](_0x12919a[_0x9a9c('0x2e')],qs[_0x9a9c('0x32')](_0x433264['query'][_0x9a9c('0x32')]));_0x2b3fd0[_0x9a9c('0x33')]=_0x2b3fd0[_0x9a9c('0x33')][_0x9a9c('0x34')]?_0x2b3fd0['attributes']:_0x12919a[_0x9a9c('0x2e')];if(!_0x433264[_0x9a9c('0x30')][_0x9a9c('0x35')]('nolimit')){_0x2b3fd0[_0x9a9c('0x1e')]=qs[_0x9a9c('0x1e')](_0x433264[_0x9a9c('0x30')]['limit']);_0x2b3fd0[_0x9a9c('0x1b')]=qs[_0x9a9c('0x1b')](_0x433264[_0x9a9c('0x30')][_0x9a9c('0x1b')]);}_0x2b3fd0[_0x9a9c('0x36')]=qs[_0x9a9c('0x37')](_0x433264['query']['sort']);_0x2b3fd0[_0x9a9c('0x38')]=qs[_0x9a9c('0x39')](_[_0x9a9c('0x3a')](_0x433264[_0x9a9c('0x30')],_0x12919a[_0x9a9c('0x39')]),_0x4e4dfc);if(_0x433264['query'][_0x9a9c('0x3b')]){_0x2b3fd0[_0x9a9c('0x38')]=_[_0x9a9c('0x3c')](_0x2b3fd0['where'],{'$or':_[_0x9a9c('0x2f')](_0x4e4dfc,function(_0x2f0bf4){if(_0x2f0bf4[_0x9a9c('0x2d')]!==_0x9a9c('0x3d')){var _0x4d628b={};_0x4d628b[_0x2f0bf4[_0x9a9c('0x29')]]={'$like':'%'+_0x433264[_0x9a9c('0x30')][_0x9a9c('0x3b')]+'%'};return _0x4d628b;}})});}_0x2b3fd0=_[_0x9a9c('0x3c')]({},_0x2b3fd0,_0x433264[_0x9a9c('0x3e')]);var _0x1452c7={'where':_0x2b3fd0[_0x9a9c('0x38')]};return db[_0x9a9c('0x3f')]['count'](_0x1452c7)['then'](function(_0x137da6){_0x4a0c3e[_0x9a9c('0x1d')]=_0x137da6;if(_0x433264[_0x9a9c('0x30')][_0x9a9c('0x40')]){_0x2b3fd0['include']=[{'all':!![]}];}return db[_0x9a9c('0x3f')]['findAll'](_0x2b3fd0);})[_0x9a9c('0x25')](function(_0x1f0f98){_0x4a0c3e[_0x9a9c('0x41')]=_0x1f0f98;return _0x4a0c3e;})[_0x9a9c('0x25')](respondWithFilteredResult(_0x26d746,_0x2b3fd0))['catch'](handleError(_0x26d746,null));};exports[_0x9a9c('0x42')]=function(_0x51c973,_0x10794c){var _0xceefdb={'raw':!![],'where':{'id':_0x51c973['params']['id']}},_0x2a45de={};_0x2a45de[_0x9a9c('0x2e')]=_['keys'](db[_0x9a9c('0x3f')][_0x9a9c('0x2c')]);_0x2a45de['query']=_[_0x9a9c('0x43')](_0x51c973[_0x9a9c('0x30')]);_0x2a45de[_0x9a9c('0x39')]=_[_0x9a9c('0x31')](_0x2a45de[_0x9a9c('0x2e')],_0x2a45de[_0x9a9c('0x30')]);_0xceefdb[_0x9a9c('0x33')]=_[_0x9a9c('0x31')](_0x2a45de[_0x9a9c('0x2e')],qs[_0x9a9c('0x32')](_0x51c973['query']['fields']));_0xceefdb[_0x9a9c('0x33')]=_0xceefdb[_0x9a9c('0x33')]['length']?_0xceefdb['attributes']:_0x2a45de[_0x9a9c('0x2e')];if(_0x51c973[_0x9a9c('0x30')][_0x9a9c('0x40')]){_0xceefdb[_0x9a9c('0x44')]=[{'all':!![]}];}_0xceefdb=_[_0x9a9c('0x3c')]({},_0xceefdb,_0x51c973[_0x9a9c('0x3e')]);return db['SquareDetailsReport'][_0x9a9c('0x45')](_0xceefdb)['then'](handleEntityNotFound(_0x10794c,null))['then'](respondWithResult(_0x10794c,null))['catch'](handleError(_0x10794c,null));};exports[_0x9a9c('0x46')]=function(_0x16407c,_0x14467e){return db[_0x9a9c('0x3f')][_0x9a9c('0x46')](_0x16407c['body'],{})[_0x9a9c('0x25')](respondWithResult(_0x14467e,0xc9))[_0x9a9c('0x47')](handleError(_0x14467e,null));};exports[_0x9a9c('0x24')]=function(_0x3dae3d,_0x373a0a){if(_0x3dae3d['body']['id']){delete _0x3dae3d[_0x9a9c('0x48')]['id'];}return db[_0x9a9c('0x3f')][_0x9a9c('0x45')]({'where':{'id':_0x3dae3d[_0x9a9c('0x49')]['id']}})[_0x9a9c('0x25')](handleEntityNotFound(_0x373a0a,null))[_0x9a9c('0x25')](saveUpdates(_0x3dae3d[_0x9a9c('0x48')],null))[_0x9a9c('0x25')](respondWithResult(_0x373a0a,null))['catch'](handleError(_0x373a0a,null));};exports[_0x9a9c('0x4a')]=function(_0x4183ea,_0x144497){return db['SquareDetailsReport'][_0x9a9c('0x45')]({'where':{'id':_0x4183ea[_0x9a9c('0x49')]['id']}})[_0x9a9c('0x25')](handleEntityNotFound(_0x144497,null))[_0x9a9c('0x25')](removeEntity(_0x144497,null))['catch'](handleError(_0x144497,null));};exports['describe']=function(_0x57f37c,_0x4f9d47){return db[_0x9a9c('0x3f')][_0x9a9c('0x4b')]()['then'](respondWithResult(_0x4f9d47,null))[_0x9a9c('0x47')](handleError(_0x4f9d47,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b6e370c..c31b452 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 _0x1306=['path','rimraf','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x1306,0x1a8));var _0x6130=function(_0x36e49e,_0x427f49){_0x36e49e=_0x36e49e-0x0;var _0x1e2192=_0x1306[_0x36e49e];return _0x1e2192;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require('bluebird');var rp=require(_0x6130('0x5'));var fs=require('fs');var path=require(_0x6130('0x6'));var rimraf=require(_0x6130('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x13bd34,_0x37a7ed){return _0x13bd34[_0x6130('0x8')](_0x6130('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['define','report_square_details','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x9d1102,_0x5c55c9){var _0x2c668e=function(_0x4ed3ba){while(--_0x4ed3ba){_0x9d1102['push'](_0x9d1102['shift']());}};_0x2c668e(++_0x5c55c9);}(_0x70e0,0xb6));var _0x070e=function(_0x22b5e5,_0x241fcb){_0x22b5e5=_0x22b5e5-0x0;var _0x55164d=_0x70e0[_0x22b5e5];return _0x55164d;};'use strict';var _=require('lodash');var util=require(_0x070e('0x0'));var logger=require('../../config/logger')(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require(_0x070e('0x7'));var attributes=require(_0x070e('0x8'));module[_0x070e('0x9')]=function(_0x21273b,_0x2e1ff8){return _0x21273b[_0x070e('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x070e('0xb'),'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 0cc4437..83d66d4 100644 --- a/server/api/squareReportDetail/squareReportDetail.rpc.js +++ b/server/api/squareReportDetail/squareReportDetail.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab40=['create','body','options','then','CreateSquareDetailsReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','SquareDetailsReport'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xab40,0xcd));var _0x0ab4=function(_0x1cb132,_0xddc1e2){_0x1cb132=_0x1cb132-0x0;var _0x47a3d4=_0xab40[_0x1cb132];return _0x47a3d4;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['CreateSquareDetailsReport']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')](_0x17422f[_0x0ab4('0x15')],{'raw':_0x17422f[_0x0ab4('0x16')]?_0x17422f['options']['raw']===undefined?!![]:![]:!![]})[_0x0ab4('0x17')](function(_0x5b1ed5){logger[_0x0ab4('0x8')](_0x0ab4('0x18'),_0x17422f);logger['debug'](_0x0ab4('0x18'),_0x17422f,JSON[_0x0ab4('0xd')](_0x5b1ed5));_0x2f50d2(_0x5b1ed5);})[_0x0ab4('0x12')](function(_0x1d5c14){logger[_0x0ab4('0xf')]('CreateSquareDetailsReport',_0x1d5c14['message'],_0x17422f);_0x53723c(_0x30d5df[_0x0ab4('0xf')](0x1f4,_0x1d5c14[_0x0ab4('0x10')]));});});}; \ No newline at end of file +var _0x056b=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5301ec,_0x34357f){var _0x53a156=function(_0x45a445){while(--_0x45a445){_0x5301ec['push'](_0x5301ec['shift']());}};_0x53a156(++_0x34357f);}(_0x056b,0xb6));var _0xb056=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x056b[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateSquareDetailsReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateSquareDetailsReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 11dca86..96d4ee4 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 _0x20a9=['./system.controller','get','isAuthenticated','/process/:pid/kill','express','Router','../../components/auth/service'];(function(_0x4f4236,_0x1a4a8b){var _0x19eac9=function(_0x4ab071){while(--_0x4ab071){_0x4f4236['push'](_0x4f4236['shift']());}};_0x19eac9(++_0x1a4a8b);}(_0x20a9,0x89));var _0x920a=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x20a9[_0x2067e9];return _0x280ce4;};'use strict';var express=require(_0x920a('0x0'));var router=express[_0x920a('0x1')]();var auth=require(_0x920a('0x2'));var controller=require(_0x920a('0x3'));router[_0x920a('0x4')]('/',auth[_0x920a('0x5')](),controller['index']);router[_0x920a('0x4')](_0x920a('0x6'),auth['isAuthenticated'](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0x5471=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x5471,0x90));var _0x1547=function(_0xf41a81,_0x51b336){_0xf41a81=_0xf41a81-0x0;var _0x15da35=_0x5471[_0xf41a81];return _0x15da35;};'use strict';var express=require(_0x1547('0x0'));var router=express[_0x1547('0x1')]();var auth=require(_0x1547('0x2'));var controller=require(_0x1547('0x3'));router[_0x1547('0x4')]('/',auth[_0x1547('0x5')](),controller['index']);router[_0x1547('0x4')](_0x1547('0x6'),auth[_0x1547('0x5')](),controller[_0x1547('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 83d0a7c..0b4e0fe 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 _0xdb21=['SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x2d6485,_0x4c1f06){var _0x1ee83e=function(_0x7d6888){while(--_0x7d6888){_0x2d6485['push'](_0x2d6485['shift']());}};_0x1ee83e(++_0x4c1f06);}(_0xdb21,0x135));var _0x1db2=function(_0x3f097c,_0x32f99f){_0x3f097c=_0x3f097c-0x0;var _0x524678=_0xdb21[_0x3f097c];return _0x524678;};'use strict';var info=require(_0x1db2('0x0'));var exec=require(_0x1db2('0x1'))[_0x1db2('0x2')];var logger=require(_0x1db2('0x3'))(_0x1db2('0x4'));var util=require(_0x1db2('0x5'));var BPromise=require(_0x1db2('0x6'));var _=require(_0x1db2('0x7'));function handleError(_0x4102c4,_0x54a04e,_0x3b16c7){_0x54a04e=_0x54a04e||0x1f4;return function(_0x4ad7d8){logger['error'](_0x1db2('0x8'),_0x3b16c7,_0x54a04e,util[_0x1db2('0x9')](_0x4ad7d8,{'showHidden':![],'depth':null}));delete _0x4ad7d8[_0x1db2('0xa')];_0x4102c4[_0x1db2('0xb')](_0x54a04e)[_0x1db2('0xc')](_0x4ad7d8);};}exports[_0x1db2('0xd')]=function(_0x43c896,_0x2202fa){return info[_0x1db2('0xe')]()[_0x1db2('0xf')](function(_0x6bb76d){return _0x2202fa['status'](0xc8)[_0x1db2('0x10')](_0x6bb76d);})[_0x1db2('0x11')](function(_0x38fc86){return _0x2202fa['status'](0x1f4)['json'](_0x38fc86);});};exports[_0x1db2('0x12')]=function(_0x4d3257,_0x1013d0){var _0x3886e9=[_0x1db2('0x13')];return new BPromise(function(_0x1911b2,_0x835dee){return exec(util[_0x1db2('0x14')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4d3257[_0x1db2('0x15')][_0x1db2('0x16')]),function(_0x16f639,_0x15dd95,_0x118312){if(_0x16f639){return _0x835dee(_0x16f639);}return _0x1911b2(_0x15dd95);});})[_0x1db2('0xf')](function(_0x470dbd){var _0x57d7c1=![];var _0xfb9645=_0x470dbd['split'](/\n/);for(var _0x300ac4=0x0,_0x233d76=_0x3886e9[_0x1db2('0x17')];_0x300ac4<_0x233d76,_0x57d7c1===![];_0x300ac4+=0x1){if(_0x470dbd[_0x1db2('0x18')](_0x3886e9[_0x300ac4])>=0x0){_0x57d7c1=!![];}}if(!_0x57d7c1){throw new Error(util[_0x1db2('0x14')](_0x1db2('0x19'),_0x4d3257[_0x1db2('0x15')][_0x1db2('0x16')]));}process[_0x1db2('0x1a')](_0x4d3257[_0x1db2('0x15')][_0x1db2('0x16')],_0x1db2('0x1b'));return _0x1013d0[_0x1db2('0xb')](0xc8)[_0x1db2('0x10')]({'message':util[_0x1db2('0x14')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x4d3257[_0x1db2('0x15')][_0x1db2('0x16')])});})[_0x1db2('0x11')](handleError(_0x1013d0,null,'killProcess'));}; \ No newline at end of file +var _0xe5d6=['format','params','pid','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','json','systeminformation','child_process','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','getAllData','catch','killProcess','components/import/cm'];(function(_0x4d5eec,_0xd03084){var _0x3528ae=function(_0x193cfb){while(--_0x193cfb){_0x4d5eec['push'](_0x4d5eec['shift']());}};_0x3528ae(++_0xd03084);}(_0xe5d6,0x1a2));var _0x6e5d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe5d6[_0x56482c];return _0x5aae7a;};'use strict';var info=require(_0x6e5d('0x0'));var exec=require(_0x6e5d('0x1'))[_0x6e5d('0x2')];var logger=require(_0x6e5d('0x3'))('api');var util=require(_0x6e5d('0x4'));var BPromise=require(_0x6e5d('0x5'));var _=require('lodash');function handleError(_0x4db2c3,_0x7bc7e6,_0x406202){_0x7bc7e6=_0x7bc7e6||0x1f4;return function(_0x18e841){logger[_0x6e5d('0x6')](_0x6e5d('0x7'),_0x406202,_0x7bc7e6,util[_0x6e5d('0x8')](_0x18e841,{'showHidden':![],'depth':null}));delete _0x18e841['name'];_0x4db2c3[_0x6e5d('0x9')](_0x7bc7e6)['send'](_0x18e841);};}exports['index']=function(_0x5a8837,_0x8d1f2f){return info[_0x6e5d('0xa')]()['then'](function(_0x504483){return _0x8d1f2f[_0x6e5d('0x9')](0xc8)['json'](_0x504483);})[_0x6e5d('0xb')](function(_0x2b8a07){return _0x8d1f2f[_0x6e5d('0x9')](0x1f4)['json'](_0x2b8a07);});};exports[_0x6e5d('0xc')]=function(_0x150a21,_0x4d1c66){var _0x391f0b=[_0x6e5d('0xd')];return new BPromise(function(_0x497772,_0x5784e3){return exec(util[_0x6e5d('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x150a21[_0x6e5d('0xf')][_0x6e5d('0x10')]),function(_0x27ea86,_0x3e71b9,_0x543136){if(_0x27ea86){return _0x5784e3(_0x27ea86);}return _0x497772(_0x3e71b9);});})[_0x6e5d('0x11')](function(_0x5a34f6){var _0x3dc0e2=![];var _0x1998b5=_0x5a34f6[_0x6e5d('0x12')](/\n/);for(var _0x206522=0x0,_0x17c7dc=_0x391f0b[_0x6e5d('0x13')];_0x206522<_0x17c7dc,_0x3dc0e2===![];_0x206522+=0x1){if(_0x5a34f6['indexOf'](_0x391f0b[_0x206522])>=0x0){_0x3dc0e2=!![];}}if(!_0x3dc0e2){throw new Error(util['format'](_0x6e5d('0x14'),_0x150a21[_0x6e5d('0xf')]['pid']));}process[_0x6e5d('0x15')](_0x150a21[_0x6e5d('0xf')][_0x6e5d('0x10')],_0x6e5d('0x16'));return _0x4d1c66['status'](0xc8)[_0x6e5d('0x17')]({'message':util[_0x6e5d('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x150a21[_0x6e5d('0xf')]['pid'])});})[_0x6e5d('0xb')](handleError(_0x4d1c66,null,_0x6e5d('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c895e1e..4bc6c13 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 _0x9fd4=['isAuthenticated','show','post','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x2246fb,_0x5f3c23){var _0x9fd1c3=function(_0x46166f){while(--_0x46166f){_0x2246fb['push'](_0x2246fb['shift']());}};_0x9fd1c3(++_0x5f3c23);}(_0x9fd4,0x125));var _0x49fd=function(_0x36b886,_0x349b28){_0x36b886=_0x36b886-0x0;var _0x51d44b=_0x9fd4[_0x36b886];return _0x51d44b;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x49fd('0x3'));var router=express[_0x49fd('0x4')]();var fs_extra=require(_0x49fd('0x5'));var auth=require(_0x49fd('0x6'));var interaction=require(_0x49fd('0x7'));var config=require(_0x49fd('0x8'));var controller=require('./tag.controller');router[_0x49fd('0x9')]('/',auth['isAuthenticated'](),controller[_0x49fd('0xa')]);router['get']('/:id',auth[_0x49fd('0xb')](),controller[_0x49fd('0xc')]);router[_0x49fd('0xd')]('/',auth[_0x49fd('0xb')](),controller['create']);router[_0x49fd('0xe')](_0x49fd('0xf'),auth[_0x49fd('0xb')](),controller[_0x49fd('0x10')]);router['delete'](_0x49fd('0xf'),auth[_0x49fd('0xb')](),controller[_0x49fd('0x11')]);module[_0x49fd('0x12')]=router; \ No newline at end of file +var _0x9bd7=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x9bd7,0x106));var _0x79bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9bd7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var path=require(_0x79bd('0x2'));var timeout=require(_0x79bd('0x3'));var express=require(_0x79bd('0x4'));var router=express[_0x79bd('0x5')]();var fs_extra=require(_0x79bd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x79bd('0x7'));var config=require(_0x79bd('0x8'));var controller=require('./tag.controller');router[_0x79bd('0x9')]('/',auth[_0x79bd('0xa')](),controller[_0x79bd('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x79bd('0xc')]);router[_0x79bd('0xd')]('/',auth[_0x79bd('0xa')](),controller[_0x79bd('0xe')]);router['put'](_0x79bd('0xf'),auth[_0x79bd('0xa')](),controller[_0x79bd('0x10')]);router[_0x79bd('0x11')](_0x79bd('0xf'),auth[_0x79bd('0xa')](),controller['destroy']);module[_0x79bd('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f0c22e6..d9b4a7d 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 _0x5d86=['STRING','sequelize','exports'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x5d86,0x76));var _0x65d8=function(_0x51c4f3,_0x1ce048){_0x51c4f3=_0x51c4f3-0x0;var _0x2d46be=_0x5d86[_0x51c4f3];return _0x2d46be;};'use strict';var Sequelize=require(_0x65d8('0x0'));module[_0x65d8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x65d8('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x65d8('0x2')]}}; \ No newline at end of file +var _0xe211=['STRING','#0091EA'];(function(_0x473fd9,_0x1cee3f){var _0x4ee9fe=function(_0x43337b){while(--_0x43337b){_0x473fd9['push'](_0x473fd9['shift']());}};_0x4ee9fe(++_0x1cee3f);}(_0xe211,0x166));var _0x1e21=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe211[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1e21('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1e21('0x0')],'defaultValue':_0x1e21('0x1')},'description':{'type':Sequelize[_0x1e21('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 32b0e6f..3e15180 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 _0x0b78=['model','map','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','type','key'];(function(_0x153a6c,_0x2c6554){var _0x5112be=function(_0x34cd7a){while(--_0x34cd7a){_0x153a6c['push'](_0x153a6c['shift']());}};_0x5112be(++_0x2c6554);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x80b7('0x0'));var rimraf=require(_0x80b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80b7('0x2'));var rp=require(_0x80b7('0x3'));var moment=require('moment');var BPromise=require(_0x80b7('0x4'));var Mustache=require('mustache');var util=require(_0x80b7('0x5'));var path=require(_0x80b7('0x6'));var sox=require(_0x80b7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80b7('0x8'));var _=require('lodash');var squel=require(_0x80b7('0x9'));var crypto=require(_0x80b7('0xa'));var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x80b7('0xd'));var Papa=require(_0x80b7('0xe'));var Redis=require(_0x80b7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80b7('0x11'));var logger=require(_0x80b7('0x12'))(_0x80b7('0x13'));var utils=require(_0x80b7('0x14'));var config=require(_0x80b7('0x15'));var licenseUtil=require(_0x80b7('0x16'));var db=require(_0x80b7('0x17'))['db'];function respondWithStatusCode(_0x145241,_0x323d06){_0x323d06=_0x323d06||0xcc;return function(_0x366e34){if(_0x366e34){return _0x145241[_0x80b7('0x18')](_0x323d06);}return _0x145241['status'](_0x323d06)[_0x80b7('0x19')]();};}function respondWithResult(_0x401ad3,_0x527c5b){_0x527c5b=_0x527c5b||0xc8;return function(_0x2ee168){if(_0x2ee168){return _0x401ad3[_0x80b7('0x1a')](_0x527c5b)['json'](_0x2ee168);}};}function respondWithFilteredResult(_0x46822c,_0x3b6b13){return function(_0x21ea65){if(_0x21ea65){var _0x2c0c4e=typeof _0x3b6b13[_0x80b7('0x1b')]===_0x80b7('0x1c')&&typeof _0x3b6b13[_0x80b7('0x1d')]===_0x80b7('0x1c');var _0x2d4008=_0x21ea65[_0x80b7('0x1e')];var _0x4c12b1=_0x2c0c4e?0x0:_0x3b6b13[_0x80b7('0x1b')];var _0x1d62ed=_0x2c0c4e?_0x21ea65[_0x80b7('0x1e')]:_0x3b6b13[_0x80b7('0x1b')]+_0x3b6b13['limit'];var _0x48c356;if(_0x1d62ed>=_0x2d4008){_0x1d62ed=_0x2d4008;_0x48c356=0xc8;}else{_0x48c356=0xce;}_0x46822c[_0x80b7('0x1a')](_0x48c356);return _0x46822c[_0x80b7('0x1f')](_0x80b7('0x20'),_0x4c12b1+'-'+_0x1d62ed+'/'+_0x2d4008)[_0x80b7('0x21')](_0x21ea65);}return null;};}function patchUpdates(_0x574e5c){return function(_0x4f6eec){try{jsonpatch[_0x80b7('0x22')](_0x4f6eec,_0x574e5c,!![]);}catch(_0x3aed77){return BPromise[_0x80b7('0x23')](_0x3aed77);}return _0x4f6eec[_0x80b7('0x24')]();};}function saveUpdates(_0x527d0f,_0x18d407){return function(_0x4c3bed){if(_0x4c3bed){return _0x4c3bed['update'](_0x527d0f)[_0x80b7('0x25')](function(_0xdab5e0){return _0xdab5e0;});}return null;};}function removeEntity(_0x65d31d,_0x155c00){return function(_0x3f3aa5){if(_0x3f3aa5){return _0x3f3aa5[_0x80b7('0x26')]()[_0x80b7('0x25')](function(){var _0x8fa95e=_0x3f3aa5[_0x80b7('0x27')]({'plain':!![]});var _0x1e751a=_0x80b7('0x28');return db[_0x80b7('0x29')][_0x80b7('0x26')]({'where':{'type':_0x1e751a,'resourceId':_0x8fa95e['id']}})[_0x80b7('0x25')](function(){return _0x3f3aa5;});})[_0x80b7('0x25')](function(){_0x65d31d['status'](0xcc)[_0x80b7('0x19')]();});}};}function handleEntityNotFound(_0x1661be,_0x5e3f6f){return function(_0x370bfb){if(!_0x370bfb){_0x1661be[_0x80b7('0x18')](0x194);}return _0x370bfb;};}function handleError(_0x17d845,_0x5497e2){_0x5497e2=_0x5497e2||0x1f4;return function(_0x1b7715){logger[_0x80b7('0x2a')](_0x1b7715[_0x80b7('0x2b')]);if(_0x1b7715[_0x80b7('0x2c')]){delete _0x1b7715[_0x80b7('0x2c')];}_0x17d845[_0x80b7('0x1a')](_0x5497e2)[_0x80b7('0x2d')](_0x1b7715);};}exports[_0x80b7('0x2e')]=function(_0x3fbdf3,_0x940c7a){var _0x3fb3da={},_0x44c3ec={},_0xf35e83={'count':0x0,'rows':[]};var _0x4ae8ad=_['map'](db[_0x80b7('0x2f')][_0x80b7('0x30')],function(_0x4fa26a){return{'name':_0x4fa26a['fieldName'],'type':_0x4fa26a[_0x80b7('0x31')][_0x80b7('0x32')]};});_0x44c3ec[_0x80b7('0x33')]=_[_0x80b7('0x34')](_0x4ae8ad,_0x80b7('0x2c'));_0x44c3ec[_0x80b7('0x35')]=_['keys'](_0x3fbdf3[_0x80b7('0x35')]);_0x44c3ec[_0x80b7('0x36')]=_[_0x80b7('0x37')](_0x44c3ec[_0x80b7('0x33')],_0x44c3ec['query']);_0x3fb3da[_0x80b7('0x38')]=_[_0x80b7('0x37')](_0x44c3ec['model'],qs[_0x80b7('0x39')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x39')]));_0x3fb3da[_0x80b7('0x38')]=_0x3fb3da[_0x80b7('0x38')][_0x80b7('0x3a')]?_0x3fb3da[_0x80b7('0x38')]:_0x44c3ec[_0x80b7('0x33')];if(!_0x3fbdf3['query']['hasOwnProperty']('nolimit')){_0x3fb3da[_0x80b7('0x1d')]=qs[_0x80b7('0x1d')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x1d')]);_0x3fb3da[_0x80b7('0x1b')]=qs[_0x80b7('0x1b')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x1b')]);}_0x3fb3da['order']=qs[_0x80b7('0x3b')](_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x3b')]);_0x3fb3da[_0x80b7('0x3c')]=qs[_0x80b7('0x36')](_[_0x80b7('0x3d')](_0x3fbdf3['query'],_0x44c3ec[_0x80b7('0x36')]),_0x4ae8ad);if(_0x3fbdf3['query'][_0x80b7('0x3e')]){_0x3fb3da[_0x80b7('0x3c')]=_['merge'](_0x3fb3da['where'],{'$or':_[_0x80b7('0x34')](_0x4ae8ad,function(_0x5e21eb){if(_0x5e21eb['type']!==_0x80b7('0x3f')){var _0x2f3b26={};_0x2f3b26[_0x5e21eb['name']]={'$like':'%'+_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x3e')]+'%'};return _0x2f3b26;}})});}_0x3fb3da=_['merge']({},_0x3fb3da,_0x3fbdf3['options']);var _0x2fdd6d={'where':_0x3fb3da[_0x80b7('0x3c')]};return db[_0x80b7('0x2f')][_0x80b7('0x1e')](_0x2fdd6d)[_0x80b7('0x25')](function(_0x21d4f2){_0xf35e83['count']=_0x21d4f2;if(_0x3fbdf3[_0x80b7('0x35')][_0x80b7('0x40')]){_0x3fb3da[_0x80b7('0x41')]=[{'all':!![]}];}return db[_0x80b7('0x2f')]['findAll'](_0x3fb3da);})[_0x80b7('0x25')](function(_0x5741ec){_0xf35e83[_0x80b7('0x42')]=_0x5741ec;return _0xf35e83;})[_0x80b7('0x25')](respondWithFilteredResult(_0x940c7a,_0x3fb3da))[_0x80b7('0x43')](handleError(_0x940c7a,null));};exports[_0x80b7('0x44')]=function(_0x132a0d,_0x3be2eb){var _0x3e77e4={'raw':!![],'where':{'id':_0x132a0d[_0x80b7('0x45')]['id']}},_0x39cd2c={};_0x39cd2c[_0x80b7('0x33')]=_[_0x80b7('0x46')](db[_0x80b7('0x2f')][_0x80b7('0x30')]);_0x39cd2c['query']=_[_0x80b7('0x46')](_0x132a0d[_0x80b7('0x35')]);_0x39cd2c['filters']=_[_0x80b7('0x37')](_0x39cd2c['model'],_0x39cd2c['query']);_0x3e77e4[_0x80b7('0x38')]=_['intersection'](_0x39cd2c['model'],qs[_0x80b7('0x39')](_0x132a0d[_0x80b7('0x35')]['fields']));_0x3e77e4[_0x80b7('0x38')]=_0x3e77e4[_0x80b7('0x38')][_0x80b7('0x3a')]?_0x3e77e4['attributes']:_0x39cd2c[_0x80b7('0x33')];if(_0x132a0d[_0x80b7('0x35')][_0x80b7('0x40')]){_0x3e77e4[_0x80b7('0x41')]=[{'all':!![]}];}_0x3e77e4=_['merge']({},_0x3e77e4,_0x132a0d['options']);return db['Tag'][_0x80b7('0x47')](_0x3e77e4)[_0x80b7('0x25')](handleEntityNotFound(_0x3be2eb,null))[_0x80b7('0x25')](respondWithResult(_0x3be2eb,null))[_0x80b7('0x43')](handleError(_0x3be2eb,null));};exports[_0x80b7('0x48')]=function(_0x44b23d,_0x398925){return db[_0x80b7('0x2f')]['create'](_0x44b23d['body'],{})[_0x80b7('0x25')](function(_0x13ebaa){var _0x3d01c6=_0x44b23d[_0x80b7('0x49')][_0x80b7('0x27')]({'plain':!![]});if(!_0x3d01c6)throw new Error(_0x80b7('0x4a'));if(_0x3d01c6['role']===_0x80b7('0x49')){var _0x36e5a5=_0x13ebaa['get']({'plain':!![]});var _0x12dc7b=_0x80b7('0x28');return db[_0x80b7('0x4b')]['find']({'where':{'name':_0x12dc7b,'userProfileId':_0x3d01c6['userProfileId']},'raw':!![]})[_0x80b7('0x25')](function(_0x66202){if(_0x66202&&_0x66202[_0x80b7('0x4c')]===0x0){return db[_0x80b7('0x29')][_0x80b7('0x48')]({'name':_0x36e5a5[_0x80b7('0x2c')],'resourceId':_0x36e5a5['id'],'type':_0x66202['name'],'sectionId':_0x66202['id']},{})[_0x80b7('0x25')](function(){return _0x13ebaa;});}else{return _0x13ebaa;}})[_0x80b7('0x43')](function(_0xeece0a){logger[_0x80b7('0x2a')](_0x80b7('0x4d'),_0xeece0a);throw _0xeece0a;});}return _0x13ebaa;})['then'](respondWithResult(_0x398925,0xc9))['catch'](handleError(_0x398925,null));};exports[_0x80b7('0x4e')]=function(_0x2129d3,_0x274708){if(_0x2129d3['body']['id']){delete _0x2129d3[_0x80b7('0x4f')]['id'];}return db['Tag'][_0x80b7('0x47')]({'where':{'id':_0x2129d3[_0x80b7('0x45')]['id']}})[_0x80b7('0x25')](handleEntityNotFound(_0x274708,null))[_0x80b7('0x25')](saveUpdates(_0x2129d3[_0x80b7('0x4f')],null))[_0x80b7('0x25')](respondWithResult(_0x274708,null))[_0x80b7('0x43')](handleError(_0x274708,null));};exports[_0x80b7('0x26')]=function(_0x43ea4f,_0x4f2588){return db[_0x80b7('0x2f')][_0x80b7('0x47')]({'where':{'id':_0x43ea4f[_0x80b7('0x45')]['id']}})[_0x80b7('0x25')](handleEntityNotFound(_0x4f2588,null))['then'](removeEntity(_0x4f2588,null))[_0x80b7('0x43')](handleError(_0x4f2588,null));}; \ No newline at end of file +var _0x85b5=['save','then','get','Tags','UserProfileResource','destroy','sendStatus','error','stack','send','map','Tag','rawAttributes','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject'];(function(_0x37eb2d,_0x26ed2c){var _0x168bb2=function(_0x589264){while(--_0x589264){_0x37eb2d['push'](_0x37eb2d['shift']());}};_0x168bb2(++_0x26ed2c);}(_0x85b5,0x7f));var _0x585b=function(_0x4898a0,_0x5a1263){_0x4898a0=_0x4898a0-0x0;var _0x112e2f=_0x85b5[_0x4898a0];return _0x112e2f;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){var _0x10dd42=_0x1c8a7b[_0x585b('0x21')]({'plain':!![]});var _0x428a9a=_0x585b('0x22');return db[_0x585b('0x23')][_0x585b('0x24')]({'where':{'type':_0x428a9a,'resourceId':_0x10dd42['id']}})[_0x585b('0x20')](function(){return _0x1c8a7b;});})[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x35075c,_0x11dc56){return function(_0x476ed9){if(!_0x476ed9){_0x35075c[_0x585b('0x25')](0x194);}return _0x476ed9;};}function handleError(_0x554099,_0x2f848c){_0x2f848c=_0x2f848c||0x1f4;return function(_0x205ffe){logger[_0x585b('0x26')](_0x205ffe[_0x585b('0x27')]);if(_0x205ffe['name']){delete _0x205ffe['name'];}_0x554099[_0x585b('0x15')](_0x2f848c)[_0x585b('0x28')](_0x205ffe);};}exports['index']=function(_0x2ce768,_0x112fb5){var _0x5c9249={},_0x47020d={},_0x3e700a={'count':0x0,'rows':[]};var _0x2ab871=_[_0x585b('0x29')](db[_0x585b('0x2a')][_0x585b('0x2b')],function(_0x227149){return{'name':_0x227149[_0x585b('0x2c')],'type':_0x227149[_0x585b('0x2d')][_0x585b('0x2e')]};});_0x47020d['model']=_[_0x585b('0x29')](_0x2ab871,_0x585b('0x2f'));_0x47020d[_0x585b('0x30')]=_['keys'](_0x2ce768[_0x585b('0x30')]);_0x47020d[_0x585b('0x31')]=_[_0x585b('0x32')](_0x47020d['model'],_0x47020d[_0x585b('0x30')]);_0x5c9249[_0x585b('0x33')]=_[_0x585b('0x32')](_0x47020d[_0x585b('0x34')],qs['fields'](_0x2ce768['query'][_0x585b('0x35')]));_0x5c9249[_0x585b('0x33')]=_0x5c9249[_0x585b('0x33')][_0x585b('0x36')]?_0x5c9249[_0x585b('0x33')]:_0x47020d['model'];if(!_0x2ce768[_0x585b('0x30')][_0x585b('0x37')](_0x585b('0x38'))){_0x5c9249[_0x585b('0x1b')]=qs[_0x585b('0x1b')](_0x2ce768['query']['limit']);_0x5c9249['offset']=qs[_0x585b('0x1a')](_0x2ce768[_0x585b('0x30')][_0x585b('0x1a')]);}_0x5c9249[_0x585b('0x39')]=qs[_0x585b('0x3a')](_0x2ce768[_0x585b('0x30')][_0x585b('0x3a')]);_0x5c9249[_0x585b('0x3b')]=qs[_0x585b('0x31')](_['pick'](_0x2ce768[_0x585b('0x30')],_0x47020d[_0x585b('0x31')]),_0x2ab871);if(_0x2ce768['query'][_0x585b('0x3c')]){_0x5c9249[_0x585b('0x3b')]=_[_0x585b('0x3d')](_0x5c9249[_0x585b('0x3b')],{'$or':_[_0x585b('0x29')](_0x2ab871,function(_0x12f7b1){if(_0x12f7b1['type']!==_0x585b('0x3e')){var _0x3c10b2={};_0x3c10b2[_0x12f7b1[_0x585b('0x2f')]]={'$like':'%'+_0x2ce768[_0x585b('0x30')][_0x585b('0x3c')]+'%'};return _0x3c10b2;}})});}_0x5c9249=_[_0x585b('0x3d')]({},_0x5c9249,_0x2ce768[_0x585b('0x3f')]);var _0xc543ca={'where':_0x5c9249['where']};return db[_0x585b('0x2a')][_0x585b('0x19')](_0xc543ca)[_0x585b('0x20')](function(_0x4c5a14){_0x3e700a[_0x585b('0x19')]=_0x4c5a14;if(_0x2ce768[_0x585b('0x30')][_0x585b('0x40')]){_0x5c9249['include']=[{'all':!![]}];}return db[_0x585b('0x2a')][_0x585b('0x41')](_0x5c9249);})['then'](function(_0x4edd57){_0x3e700a[_0x585b('0x42')]=_0x4edd57;return _0x3e700a;})['then'](respondWithFilteredResult(_0x112fb5,_0x5c9249))[_0x585b('0x43')](handleError(_0x112fb5,null));};exports['show']=function(_0x207d79,_0x33380b){var _0x5e989e={'raw':!![],'where':{'id':_0x207d79['params']['id']}},_0xa26652={};_0xa26652['model']=_['keys'](db[_0x585b('0x2a')]['rawAttributes']);_0xa26652[_0x585b('0x30')]=_[_0x585b('0x44')](_0x207d79['query']);_0xa26652[_0x585b('0x31')]=_[_0x585b('0x32')](_0xa26652[_0x585b('0x34')],_0xa26652['query']);_0x5e989e['attributes']=_['intersection'](_0xa26652[_0x585b('0x34')],qs[_0x585b('0x35')](_0x207d79[_0x585b('0x30')][_0x585b('0x35')]));_0x5e989e['attributes']=_0x5e989e[_0x585b('0x33')][_0x585b('0x36')]?_0x5e989e[_0x585b('0x33')]:_0xa26652[_0x585b('0x34')];if(_0x207d79['query'][_0x585b('0x40')]){_0x5e989e[_0x585b('0x45')]=[{'all':!![]}];}_0x5e989e=_[_0x585b('0x3d')]({},_0x5e989e,_0x207d79[_0x585b('0x3f')]);return db[_0x585b('0x2a')]['find'](_0x5e989e)['then'](handleEntityNotFound(_0x33380b,null))['then'](respondWithResult(_0x33380b,null))[_0x585b('0x43')](handleError(_0x33380b,null));};exports['create']=function(_0x1f8ae0,_0x54ab6f){return db['Tag']['create'](_0x1f8ae0[_0x585b('0x46')],{})[_0x585b('0x20')](function(_0x47c349){var _0x5116a8=_0x1f8ae0[_0x585b('0x47')][_0x585b('0x21')]({'plain':!![]});if(!_0x5116a8)throw new Error(_0x585b('0x48'));if(_0x5116a8['role']===_0x585b('0x47')){var _0x4ca120=_0x47c349[_0x585b('0x21')]({'plain':!![]});var _0x5f31cb=_0x585b('0x22');return db['UserProfileSection'][_0x585b('0x49')]({'where':{'name':_0x5f31cb,'userProfileId':_0x5116a8['userProfileId']},'raw':!![]})[_0x585b('0x20')](function(_0x259dac){if(_0x259dac&&_0x259dac[_0x585b('0x4a')]===0x0){return db[_0x585b('0x23')][_0x585b('0x4b')]({'name':_0x4ca120['name'],'resourceId':_0x4ca120['id'],'type':_0x259dac[_0x585b('0x2f')],'sectionId':_0x259dac['id']},{})[_0x585b('0x20')](function(){return _0x47c349;});}else{return _0x47c349;}})[_0x585b('0x43')](function(_0x2d0f60){logger[_0x585b('0x26')](_0x585b('0x4c'),_0x2d0f60);throw _0x2d0f60;});}return _0x47c349;})['then'](respondWithResult(_0x54ab6f,0xc9))[_0x585b('0x43')](handleError(_0x54ab6f,null));};exports[_0x585b('0x4d')]=function(_0x14a30b,_0x2f0741){if(_0x14a30b['body']['id']){delete _0x14a30b[_0x585b('0x46')]['id'];}return db[_0x585b('0x2a')][_0x585b('0x49')]({'where':{'id':_0x14a30b['params']['id']}})['then'](handleEntityNotFound(_0x2f0741,null))['then'](saveUpdates(_0x14a30b['body'],null))['then'](respondWithResult(_0x2f0741,null))['catch'](handleError(_0x2f0741,null));};exports[_0x585b('0x24')]=function(_0x39f29e,_0x102733){return db['Tag'][_0x585b('0x49')]({'where':{'id':_0x39f29e[_0x585b('0x4e')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x102733,null))[_0x585b('0x20')](removeEntity(_0x102733,null))['catch'](handleError(_0x102733,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 1c40f5b..f738790 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 _0x2b37=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','Tag'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x2b37,0xea));var _0x72b3=function(_0x38d825,_0x357fd6){_0x38d825=_0x38d825-0x0;var _0xc39a03=_0x2b37[_0x38d825];return _0xc39a03;};'use strict';var _=require('lodash');var util=require(_0x72b3('0x0'));var logger=require(_0x72b3('0x1'))('api');var moment=require(_0x72b3('0x2'));var BPromise=require('bluebird');var rp=require(_0x72b3('0x3'));var fs=require('fs');var path=require(_0x72b3('0x4'));var rimraf=require(_0x72b3('0x5'));var config=require(_0x72b3('0x6'));var attributes=require('./tag.attributes');module['exports']=function(_0x927f25,_0x2a2ae4){return _0x927f25[_0x72b3('0x7')](_0x72b3('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a6d=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','tools_tags'];(function(_0x321dd1,_0x59f678){var _0x30520a=function(_0x5f3433){while(--_0x5f3433){_0x321dd1['push'](_0x321dd1['shift']());}};_0x30520a(++_0x59f678);}(_0x0a6d,0xd1));var _0xd0a6=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0a6d[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xd0a6('0x0'));var util=require(_0xd0a6('0x1'));var logger=require('../../config/logger')(_0xd0a6('0x2'));var moment=require(_0xd0a6('0x3'));var BPromise=require(_0xd0a6('0x4'));var rp=require(_0xd0a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0a6('0x6'));var config=require(_0xd0a6('0x7'));var attributes=require(_0xd0a6('0x8'));module[_0xd0a6('0x9')]=function(_0x1f22f0,_0x58d7cb){return _0x1f22f0['define']('Tag',attributes,{'tableName':_0xd0a6('0xa'),'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 6ca61df..9b9283b 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3416f3,_0x13f25e){var _0x311047=function(_0x4f5241){while(--_0x4f5241){_0x3416f3['push'](_0x3416f3['shift']());}};_0x311047(++_0x13f25e);}(_0xac9d,0x14d));var _0xdac9=function(_0x5c1b05,_0x213768){_0x5c1b05=_0x5c1b05-0x0;var _0x1a65e7=_0xac9d[_0x5c1b05];return _0x1a65e7;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file +var _0x24cd=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3aac10,_0x33082f){var _0xf0bfcf=function(_0x4e7c5b){while(--_0x4e7c5b){_0x3aac10['push'](_0x3aac10['shift']());}};_0xf0bfcf(++_0x33082f);}(_0x24cd,0x83));var _0xd24c=function(_0x474d08,_0x24e234){_0x474d08=_0x474d08-0x0;var _0x52a609=_0x24cd[_0x474d08];return _0x52a609;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var moment=require('moment');var BPromise=require(_0xd24c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd24c('0x3'));var db=require(_0xd24c('0x4'))['db'];var utils=require(_0xd24c('0x5'));var logger=require('../../config/logger')(_0xd24c('0x6'));var config=require(_0xd24c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd24c('0x8')][_0xd24c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a432a,_0x95eb94,_0x3d4d20){return new BPromise(function(_0x411706,_0x3df525){return client[_0xd24c('0xa')](_0x2a432a,_0x3d4d20)['then'](function(_0x4c4455){logger[_0xd24c('0xb')](_0xd24c('0xc'),_0x95eb94,_0xd24c('0xd'));logger[_0xd24c('0xe')](_0xd24c('0xf'),_0x95eb94,_0xd24c('0xd'),JSON[_0xd24c('0x10')](_0x4c4455));if(_0x4c4455[_0xd24c('0x11')]){if(_0x4c4455['error'][_0xd24c('0x12')]===0x1f4){logger[_0xd24c('0x11')]('Tag,\x20%s,\x20%s',_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x3df525(_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);}logger[_0xd24c('0x11')](_0xd24c('0xc'),_0x95eb94,_0x4c4455[_0xd24c('0x11')][_0xd24c('0x13')]);return _0x411706(_0x4c4455['error'][_0xd24c('0x13')]);}else{logger[_0xd24c('0xb')]('Tag,\x20%s,\x20%s',_0x95eb94,_0xd24c('0xd'));_0x411706(_0x4c4455[_0xd24c('0x14')][_0xd24c('0x13')]);}})[_0xd24c('0x15')](function(_0x509992){logger['error'](_0xd24c('0xc'),_0x95eb94,_0x509992);_0x3df525(_0x509992);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index d0d9c4e..576f054 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 f9448e3..8206735 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 _0x2032=['name','exports','STRING'];(function(_0x506f18,_0x4109b2){var _0x398e93=function(_0x321594){while(--_0x321594){_0x506f18['push'](_0x506f18['shift']());}};_0x398e93(++_0x4109b2);}(_0x2032,0xd9));var _0x2203=function(_0x5186c7,_0x16fcb3){_0x5186c7=_0x5186c7-0x0;var _0x5cea03=_0x2032[_0x5186c7];return _0x5cea03;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x38d8fe,_0x4b2060){var _0x1f52c6=function(_0x40c33e){while(--_0x40c33e){_0x38d8fe['push'](_0x38d8fe['shift']());}};_0x1f52c6(++_0x4b2060);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index fbc97a8..8ad5676 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 _0xc08c=['intersection','attributes','fields','query','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','UserId','Sequelize','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','Teams','send','getQueues','findOne','channel','ValidationError','capitalize','toLowerCase','Queue','pick','Queues','addQueues','isValidChannel','Unknown\x20channel','ids','remove','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','online','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','voicePause','all','spread','removeAgents','UserVoicePrefix','getAgents','rawAttributes','hasOwnProperty','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','stack','name','index','Team','fieldName','type','model','map','keys','filters'];(function(_0xd99a75,_0x455205){var _0x73bdfb=function(_0xf5540b){while(--_0xf5540b){_0xd99a75['push'](_0xd99a75['shift']());}};_0x73bdfb(++_0x455205);}(_0xc08c,0xfa));var _0xcc08=function(_0x4a2b3c,_0xc69f59){_0x4a2b3c=_0x4a2b3c-0x0;var _0x4b081b=_0xc08c[_0x4a2b3c];return _0x4b081b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc08('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc08('0x1'));var BPromise=require(_0xcc08('0x2'));var Mustache=require(_0xcc08('0x3'));var util=require('util');var path=require(_0xcc08('0x4'));var sox=require(_0xcc08('0x5'));var csv=require(_0xcc08('0x6'));var ejs=require(_0xcc08('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc08('0x8'));var squel=require(_0xcc08('0x9'));var crypto=require(_0xcc08('0xa'));var jsforce=require(_0xcc08('0xb'));var deskjs=require(_0xcc08('0xc'));var toCsv=require(_0xcc08('0x6'));var querystring=require(_0xcc08('0xd'));var Papa=require(_0xcc08('0xe'));var Redis=require(_0xcc08('0xf'));var authService=require(_0xcc08('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcc08('0x11'));var hardwareService=require(_0xcc08('0x12'));var logger=require('../../config/logger')(_0xcc08('0x13'));var utils=require(_0xcc08('0x14'));var config=require(_0xcc08('0x15'));var licenseUtil=require(_0xcc08('0x16'));var db=require(_0xcc08('0x17'))['db'];config[_0xcc08('0x18')]=_[_0xcc08('0x19')](config[_0xcc08('0x18')],{'host':_0xcc08('0x1a'),'port':0x18eb});var socket=require(_0xcc08('0x1b'))(new Redis(config[_0xcc08('0x18')]));require(_0xcc08('0x1c'))['register'](socket);function respondWithStatusCode(_0xf55b10,_0x8f3794){_0x8f3794=_0x8f3794||0xcc;return function(_0x5a4440){if(_0x5a4440){return _0xf55b10[_0xcc08('0x1d')](_0x8f3794);}return _0xf55b10[_0xcc08('0x1e')](_0x8f3794)[_0xcc08('0x1f')]();};}function respondWithResult(_0xa02861,_0x102fc0){_0x102fc0=_0x102fc0||0xc8;return function(_0x13bc27){if(_0x13bc27){return _0xa02861[_0xcc08('0x1e')](_0x102fc0)[_0xcc08('0x20')](_0x13bc27);}};}function respondWithFilteredResult(_0x18452f,_0x15b387){return function(_0x40c59e){if(_0x40c59e){var _0x214cbb=typeof _0x15b387[_0xcc08('0x21')]==='undefined'&&typeof _0x15b387['limit']==='undefined';var _0x317181=_0x40c59e[_0xcc08('0x22')];var _0x2ce954=_0x214cbb?0x0:_0x15b387['offset'];var _0xdfac3b=_0x214cbb?_0x40c59e[_0xcc08('0x22')]:_0x15b387[_0xcc08('0x21')]+_0x15b387[_0xcc08('0x23')];var _0x51511e;if(_0xdfac3b>=_0x317181){_0xdfac3b=_0x317181;_0x51511e=0xc8;}else{_0x51511e=0xce;}_0x18452f[_0xcc08('0x1e')](_0x51511e);return _0x18452f[_0xcc08('0x24')](_0xcc08('0x25'),_0x2ce954+'-'+_0xdfac3b+'/'+_0x317181)[_0xcc08('0x20')](_0x40c59e);}return null;};}function patchUpdates(_0x148a97){return function(_0xe1b7f6){try{jsonpatch[_0xcc08('0x26')](_0xe1b7f6,_0x148a97,!![]);}catch(_0x2c2289){return BPromise[_0xcc08('0x27')](_0x2c2289);}return _0xe1b7f6['save']();};}function saveUpdates(_0x4cb519,_0x55e2b5){return function(_0x373a3e){if(_0x373a3e){return _0x373a3e[_0xcc08('0x28')](_0x4cb519)[_0xcc08('0x29')](function(_0xe1a2d){return _0xe1a2d;});}return null;};}function handleEntityNotFound(_0x12f044,_0x17166f){return function(_0xb2dbba){if(!_0xb2dbba){_0x12f044['sendStatus'](0x194);}return _0xb2dbba;};}function handleError(_0x2240e5,_0x6bf771){_0x6bf771=_0x6bf771||0x1f4;return function(_0x426a9e){logger['error'](_0x426a9e[_0xcc08('0x2a')]);if(_0x426a9e[_0xcc08('0x2b')]){delete _0x426a9e[_0xcc08('0x2b')];}_0x2240e5['status'](_0x6bf771)['send'](_0x426a9e);};}exports[_0xcc08('0x2c')]=function(_0x2a8dbb,_0x44e942){var _0x12c873={},_0x40f040={},_0x239aea={'count':0x0,'rows':[]};var _0x3f02a6=_['map'](db[_0xcc08('0x2d')]['rawAttributes'],function(_0x2b6a11){return{'name':_0x2b6a11[_0xcc08('0x2e')],'type':_0x2b6a11[_0xcc08('0x2f')]['key']};});_0x40f040[_0xcc08('0x30')]=_[_0xcc08('0x31')](_0x3f02a6,_0xcc08('0x2b'));_0x40f040['query']=_[_0xcc08('0x32')](_0x2a8dbb['query']);_0x40f040[_0xcc08('0x33')]=_[_0xcc08('0x34')](_0x40f040[_0xcc08('0x30')],_0x40f040['query']);_0x12c873[_0xcc08('0x35')]=_[_0xcc08('0x34')](_0x40f040['model'],qs[_0xcc08('0x36')](_0x2a8dbb[_0xcc08('0x37')][_0xcc08('0x36')]));_0x12c873[_0xcc08('0x35')]=_0x12c873[_0xcc08('0x35')][_0xcc08('0x38')]?_0x12c873['attributes']:_0x40f040['model'];if(!_0x2a8dbb['query']['hasOwnProperty'](_0xcc08('0x39'))){_0x12c873[_0xcc08('0x23')]=qs[_0xcc08('0x23')](_0x2a8dbb['query'][_0xcc08('0x23')]);_0x12c873[_0xcc08('0x21')]=qs['offset'](_0x2a8dbb[_0xcc08('0x37')][_0xcc08('0x21')]);}_0x12c873[_0xcc08('0x3a')]=qs[_0xcc08('0x3b')](_0x2a8dbb[_0xcc08('0x37')][_0xcc08('0x3b')]);_0x12c873[_0xcc08('0x3c')]=qs[_0xcc08('0x33')](_['pick'](_0x2a8dbb[_0xcc08('0x37')],_0x40f040[_0xcc08('0x33')]),_0x3f02a6);if(_0x2a8dbb['query'][_0xcc08('0x3d')]){_0x12c873[_0xcc08('0x3c')]=_[_0xcc08('0x3e')](_0x12c873[_0xcc08('0x3c')],{'$or':_[_0xcc08('0x31')](_0x3f02a6,function(_0x134e32){if(_0x134e32[_0xcc08('0x2f')]!==_0xcc08('0x3f')){var _0x290c48={};_0x290c48[_0x134e32[_0xcc08('0x2b')]]={'$like':'%'+_0x2a8dbb[_0xcc08('0x37')][_0xcc08('0x3d')]+'%'};return _0x290c48;}})});}_0x12c873=_[_0xcc08('0x3e')]({},_0x12c873,_0x2a8dbb['options']);var _0x36fc61={'where':_0x12c873[_0xcc08('0x3c')]};return db['Team'][_0xcc08('0x22')](_0x36fc61)['then'](function(_0x26eeaa){_0x239aea[_0xcc08('0x22')]=_0x26eeaa;if(_0x2a8dbb[_0xcc08('0x37')][_0xcc08('0x40')]){_0x12c873[_0xcc08('0x41')]=[{'all':!![]}];}return db[_0xcc08('0x2d')][_0xcc08('0x42')](_0x12c873);})['then'](function(_0x2c3e2a){_0x239aea['rows']=_0x2c3e2a;return _0x239aea;})[_0xcc08('0x29')](respondWithFilteredResult(_0x44e942,_0x12c873))[_0xcc08('0x43')](handleError(_0x44e942,null));};exports[_0xcc08('0x44')]=function(_0x37b653,_0x13bbee){var _0x1cbb05={'raw':![],'where':{'id':_0x37b653[_0xcc08('0x45')]['id']}},_0x5ba948={};_0x5ba948[_0xcc08('0x30')]=_[_0xcc08('0x32')](db[_0xcc08('0x2d')]['rawAttributes']);_0x5ba948[_0xcc08('0x37')]=_['keys'](_0x37b653[_0xcc08('0x37')]);_0x5ba948[_0xcc08('0x33')]=_[_0xcc08('0x34')](_0x5ba948['model'],_0x5ba948['query']);_0x1cbb05[_0xcc08('0x35')]=_['intersection'](_0x5ba948['model'],qs[_0xcc08('0x36')](_0x37b653['query'][_0xcc08('0x36')]));_0x1cbb05[_0xcc08('0x35')]=_0x1cbb05[_0xcc08('0x35')][_0xcc08('0x38')]?_0x1cbb05[_0xcc08('0x35')]:_0x5ba948[_0xcc08('0x30')];if(_0x37b653[_0xcc08('0x37')]['includeAll']){_0x1cbb05[_0xcc08('0x41')]=[{'all':!![]}];}_0x1cbb05=_[_0xcc08('0x3e')]({},_0x1cbb05,_0x37b653[_0xcc08('0x46')]);return db[_0xcc08('0x2d')][_0xcc08('0x47')](_0x1cbb05)['then'](handleEntityNotFound(_0x13bbee,null))[_0xcc08('0x29')](respondWithResult(_0x13bbee,null))[_0xcc08('0x43')](handleError(_0x13bbee,null));};exports[_0xcc08('0x48')]=function(_0xf4a440,_0x2b0d98){return db[_0xcc08('0x2d')][_0xcc08('0x48')](_0xf4a440[_0xcc08('0x49')],{})[_0xcc08('0x29')](function(_0x1d8510){var _0x48761c=_0xf4a440[_0xcc08('0x4a')][_0xcc08('0x4b')]({'plain':!![]});if(!_0x48761c)throw new Error(_0xcc08('0x4c'));if(_0x48761c[_0xcc08('0x4d')]===_0xcc08('0x4a')){var _0x2585b8=_0x1d8510[_0xcc08('0x4b')]({'plain':!![]});var _0x3706bc='Teams';return db[_0xcc08('0x4e')][_0xcc08('0x47')]({'where':{'name':_0x3706bc,'userProfileId':_0x48761c[_0xcc08('0x4f')]},'raw':!![]})[_0xcc08('0x29')](function(_0xb50ed9){if(_0xb50ed9&&_0xb50ed9[_0xcc08('0x50')]===0x0){return db[_0xcc08('0x51')][_0xcc08('0x48')]({'name':_0x2585b8[_0xcc08('0x2b')],'resourceId':_0x2585b8['id'],'type':_0xb50ed9[_0xcc08('0x2b')],'sectionId':_0xb50ed9['id']},{})[_0xcc08('0x29')](function(){return _0x1d8510;});}else{return _0x1d8510;}})[_0xcc08('0x43')](function(_0x48c4af){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48c4af);throw _0x48c4af;});}return _0x1d8510;})['then'](respondWithResult(_0x2b0d98,0xc9))[_0xcc08('0x43')](handleError(_0x2b0d98,null));};exports[_0xcc08('0x28')]=function(_0x1738bb,_0x15e7c3){if(_0x1738bb[_0xcc08('0x49')]['id']){delete _0x1738bb['body']['id'];}return db[_0xcc08('0x2d')]['find']({'where':{'id':_0x1738bb[_0xcc08('0x45')]['id']}})['then'](handleEntityNotFound(_0x15e7c3,null))[_0xcc08('0x29')](saveUpdates(_0x1738bb[_0xcc08('0x49')],null))[_0xcc08('0x29')](respondWithResult(_0x15e7c3,null))[_0xcc08('0x43')](handleError(_0x15e7c3,null));};exports[_0xcc08('0x52')]=function(_0x1f71dd,_0x26405f){var _0xcb1fb3=_0x1f71dd[_0xcc08('0x45')]['id'];var _0x16e7b3=[];return db[_0xcc08('0x53')][_0xcc08('0x54')](function(_0x2d6984){var _0x22fd26=_0xcc08('0x55')+_0xcb1fb3;return db['sequelize'][_0xcc08('0x37')](_0x22fd26,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2d6984})[_0xcc08('0x29')](function(_0x2cb14a){_0x16e7b3=_[_0xcc08('0x31')](_0x2cb14a,function(_0x211193){return Number(_0x211193[_0xcc08('0x56')]);});})[_0xcc08('0x29')](function(){var _0x229e40='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0xcb1fb3;return db[_0xcc08('0x53')]['query'](_0x229e40,{'type':db[_0xcc08('0x57')]['QueryTypes'][_0xcc08('0x58')],'raw':!![],'transaction':_0x2d6984});})['then'](function(_0x4ff546){var _0x1339f7=_[_0xcc08('0x31')](_0x4ff546,function(_0xa35f8b){return Number(_0xa35f8b[_0xcc08('0x59')]);});return db[_0xcc08('0x5a')][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'VoiceQueueId':{'$in':_0x1339f7}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){var _0x128642=_0xcc08('0x5b')+_0xcb1fb3;return db[_0xcc08('0x53')]['query'](_0x128642,{'type':db[_0xcc08('0x57')][_0xcc08('0x5c')][_0xcc08('0x58')],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x1cfd27){var _0x1c132f=_[_0xcc08('0x31')](_0x1cfd27,function(_0x131445){return Number(_0x131445[_0xcc08('0x5d')]);});return db[_0xcc08('0x5e')][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'MailQueueId':{'$in':_0x1c132f}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){var _0x59e101=_0xcc08('0x5f')+_0xcb1fb3;return db[_0xcc08('0x53')][_0xcc08('0x37')](_0x59e101,{'type':db[_0xcc08('0x57')][_0xcc08('0x5c')]['SELECT'],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x59f823){var _0x30739a=_[_0xcc08('0x31')](_0x59f823,function(_0x426694){return Number(_0x426694[_0xcc08('0x60')]);});return db[_0xcc08('0x61')][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'SmsQueueId':{'$in':_0x30739a}},'transaction':_0x2d6984});})['then'](function(){var _0x48e3da='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xcb1fb3;return db[_0xcc08('0x53')][_0xcc08('0x37')](_0x48e3da,{'type':db[_0xcc08('0x57')]['QueryTypes'][_0xcc08('0x58')],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x527996){var _0x2c8e43=_[_0xcc08('0x31')](_0x527996,function(_0x54642e){return Number(_0x54642e['ChatQueueId']);});return db['UserChatQueue'][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'ChatQueueId':{'$in':_0x2c8e43}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){var _0xae7b12=_0xcc08('0x62')+_0xcb1fb3;return db['sequelize'][_0xcc08('0x37')](_0xae7b12,{'type':db[_0xcc08('0x57')][_0xcc08('0x5c')][_0xcc08('0x58')],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x28dd31){var _0x1a0eff=_[_0xcc08('0x31')](_0x28dd31,function(_0x277d64){return Number(_0x277d64['FaxQueueId']);});return db[_0xcc08('0x63')][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'FaxQueueId':{'$in':_0x1a0eff}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){var _0x29e27a=_0xcc08('0x64')+_0xcb1fb3;return db['sequelize'][_0xcc08('0x37')](_0x29e27a,{'type':db['Sequelize'][_0xcc08('0x5c')]['SELECT'],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x18b914){var _0x140580=_['map'](_0x18b914,function(_0x3aac33){return Number(_0x3aac33[_0xcc08('0x65')]);});return db[_0xcc08('0x66')][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'OpenchannelQueueId':{'$in':_0x140580}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){var _0x25c17d=_0xcc08('0x67')+_0xcb1fb3;return db[_0xcc08('0x53')][_0xcc08('0x37')](_0x25c17d,{'type':db[_0xcc08('0x57')][_0xcc08('0x5c')][_0xcc08('0x58')],'raw':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x59a354){var _0x2dc195=_['map'](_0x59a354,function(_0x3346d9){return Number(_0x3346d9[_0xcc08('0x68')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x16e7b3},'WhatsappQueueId':{'$in':_0x2dc195}},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){return db[_0xcc08('0x69')][_0xcc08('0x47')]({'where':{'TeamId':_0xcb1fb3}});})[_0xcc08('0x29')](function(_0x4630cf){if(_0x4630cf===null){return;}return db['UserVoicePrefix'][_0xcc08('0x52')]({'where':{'UserId':{'$in':_0x16e7b3},'VoicePrefixId':_0x4630cf[_0xcc08('0x6a')]},'transaction':_0x2d6984});})[_0xcc08('0x29')](function(){return db[_0xcc08('0x2d')]['destroy']({'where':{'id':_0xcb1fb3},'cascade':!![],'transaction':_0x2d6984});})[_0xcc08('0x29')](function(_0x1d852e){if(_0x1d852e===0x0){_0x26405f[_0xcc08('0x1d')](0x194);}else{return db['UserProfileResource'][_0xcc08('0x52')]({'where':{'type':_0xcc08('0x6b'),'resourceId':_0xcb1fb3},'cascade':!![],'transaction':_0x2d6984})[_0xcc08('0x29')](function(){_0x26405f[_0xcc08('0x1e')](0xcc)[_0xcc08('0x1f')]();});}})[_0xcc08('0x43')](function(_0x1ea669){_0x26405f[_0xcc08('0x1e')](0x1f4)[_0xcc08('0x6c')](_0x1ea669);});});};exports[_0xcc08('0x6d')]=function(_0x30d9cf,_0x15aef3,_0xc1a72c){return db[_0xcc08('0x2d')][_0xcc08('0x6e')]({'where':{'id':_0x30d9cf['params']['id']}})[_0xcc08('0x29')](handleEntityNotFound(_0x15aef3,null))[_0xcc08('0x29')](function(_0x5c0156){if(!_0x30d9cf[_0xcc08('0x37')]['channel']||!utils['isValidChannel'](_0x30d9cf[_0xcc08('0x37')][_0xcc08('0x6f')])){throw new db[(_0xcc08('0x57'))][(_0xcc08('0x70'))]('Unknown\x20channel');}var _0x3842b3={};var _0x182f76={};_0x182f76[_0xcc08('0x30')]=_[_0xcc08('0x32')](db[_[_0xcc08('0x71')](_0x30d9cf[_0xcc08('0x37')][_0xcc08('0x6f')][_0xcc08('0x72')]())+_0xcc08('0x73')]['rawAttributes']);_0x182f76['query']=_[_0xcc08('0x32')](_0x30d9cf[_0xcc08('0x37')]);_0x182f76['filters']=_['intersection'](_0x182f76[_0xcc08('0x30')],_0x182f76[_0xcc08('0x37')]);_0x3842b3[_0xcc08('0x35')]=_['intersection'](_0x182f76[_0xcc08('0x30')],qs[_0xcc08('0x36')](_0x30d9cf[_0xcc08('0x37')][_0xcc08('0x36')]));_0x3842b3[_0xcc08('0x35')]=_0x3842b3[_0xcc08('0x35')][_0xcc08('0x38')]?_0x3842b3[_0xcc08('0x35')]:_0x182f76[_0xcc08('0x30')];_0x3842b3[_0xcc08('0x23')]=qs[_0xcc08('0x23')](_0x30d9cf['query']['limit']);_0x3842b3['offset']=qs['offset'](_0x30d9cf[_0xcc08('0x37')][_0xcc08('0x21')]);_0x3842b3[_0xcc08('0x3a')]=qs[_0xcc08('0x3b')](_0x30d9cf[_0xcc08('0x37')]['sort']);_0x3842b3[_0xcc08('0x3c')]=qs[_0xcc08('0x33')](_[_0xcc08('0x74')](_0x30d9cf['query'],_0x182f76['filters']));_0x3842b3=_['merge']({},_0x3842b3,_0x30d9cf[_0xcc08('0x46')]);return _0x5c0156[_0xcc08('0x4b')+_[_0xcc08('0x71')](_0x30d9cf['query'][_0xcc08('0x6f')]['toLowerCase']())+_0xcc08('0x75')](_0x3842b3);})[_0xcc08('0x29')](respondWithResult(_0x15aef3,null))[_0xcc08('0x43')](handleError(_0x15aef3,null));};exports[_0xcc08('0x76')]=function(_0x108283,_0x130731,_0xc8ec11){return db[_0xcc08('0x2d')][_0xcc08('0x6e')]({'where':{'id':_0x108283[_0xcc08('0x45')]['id']}})[_0xcc08('0x29')](function(_0x3f7a9b){if(_0x3f7a9b){if(!_0x108283[_0xcc08('0x49')][_0xcc08('0x6f')]||!utils[_0xcc08('0x77')](_0x108283[_0xcc08('0x49')][_0xcc08('0x6f')])){throw new db[(_0xcc08('0x57'))]['ValidationError'](_0xcc08('0x78'));}return _0x3f7a9b['add'+_[_0xcc08('0x71')](_0x108283[_0xcc08('0x49')][_0xcc08('0x6f')][_0xcc08('0x72')]())+'Queues'](_0x108283[_0xcc08('0x49')][_0xcc08('0x79')]);}return null;})['then'](handleEntityNotFound(_0x130731,null))[_0xcc08('0x29')](respondWithStatusCode(_0x130731,null))[_0xcc08('0x43')](handleError(_0x130731,null));};exports['removeQueues']=function(_0x19aa15,_0x3c8e4b,_0x437417){return db[_0xcc08('0x2d')][_0xcc08('0x6e')]({'where':{'id':_0x19aa15['params']['id']}})[_0xcc08('0x29')](function(_0x199444){if(_0x199444){if(!_0x19aa15[_0xcc08('0x37')][_0xcc08('0x6f')]||!utils[_0xcc08('0x77')](_0x19aa15[_0xcc08('0x37')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xcc08('0x78'));}return _0x199444[_0xcc08('0x7a')+_[_0xcc08('0x71')](_0x19aa15[_0xcc08('0x37')]['channel'][_0xcc08('0x72')]())+_0xcc08('0x75')](_0x19aa15[_0xcc08('0x37')]['ids']);}return null;})['then'](handleEntityNotFound(_0x3c8e4b,null))[_0xcc08('0x29')](respondWithStatusCode(_0x3c8e4b,null))['catch'](handleError(_0x3c8e4b,null));};exports[_0xcc08('0x7b')]=function(_0x55369c,_0xdcfb46){var _0x446f2e=_[_0xcc08('0x7c')](_0x55369c[_0xcc08('0x49')][_0xcc08('0x79')])?_0x55369c[_0xcc08('0x49')][_0xcc08('0x79')]:[_0x55369c[_0xcc08('0x49')]['ids']];var _0x2b7120=_0x55369c[_0xcc08('0x45')]['id'];return db[_0xcc08('0x2d')][_0xcc08('0x47')]({'where':{'id':_0x2b7120}})[_0xcc08('0x29')](handleEntityNotFound(_0xdcfb46,null))[_0xcc08('0x29')](function(_0x48fd90){if(_0x48fd90){var _0x25f1c0=[_0xcc08('0x7d'),'Chat',_0xcc08('0x7e'),_0xcc08('0x7f'),'Fax',_0xcc08('0x80'),_0xcc08('0x81')];return db[_0xcc08('0x53')][_0xcc08('0x54')](function(_0x5b7db1){var _0x2ed8ba=_['map'](_0x25f1c0,function(_0xeae6ba){var _0x26fb17={'attributes':['id',_0xcc08('0x2b')]};if(_0xeae6ba===_0xcc08('0x7d')){_0x26fb17[_0xcc08('0x82')]={'attributes':['penalty']};}return _0x48fd90[_0xcc08('0x4b')+_0xeae6ba+_0xcc08('0x75')](_0x26fb17)['then'](function(_0x3dc9ee){var _0x283f05=_[_0xcc08('0x31')](_0x3dc9ee,function(_0x267f91){var _0x310f93=_['map'](_0x446f2e,function(_0x1b4f65){var _0x4198f1={'where':{'UserId':_0x1b4f65,[_0xeae6ba+_0xcc08('0x83')]:_0x267f91['id']},'transaction':_0x5b7db1};if(_0xeae6ba===_0xcc08('0x7d')){_0x4198f1[_0xcc08('0x19')]={'penalty':_0x267f91[_0xcc08('0x84')][_0xcc08('0x85')]};}return db[_0xcc08('0x86')+_0xeae6ba+_0xcc08('0x73')][_0xcc08('0x87')](_0x4198f1)[_0xcc08('0x29')](function(){socket[_0xcc08('0x88')](_0xcc08('0x4a')+_0xeae6ba+'Queue:save',{'UserId':_0x1b4f65,[_0xeae6ba+'QueueId']:_0x267f91['id']});if(_0xeae6ba!==_0xcc08('0x7d')){return;}return db['User'][_0xcc08('0x42')]({'where':{'id':_0x446f2e,'online':0x1},'attributes':['id',_0xcc08('0x2b'),_0xcc08('0x89'),'voicePause',_0xcc08('0x8a')],'raw':!![]})['then'](function(_0x46bddc){var _0x587afc=_[_0xcc08('0x31')](_0x46bddc,function(_0x239bf1){return db[_0xcc08('0x8b')][_0xcc08('0x8c')]({'membername':_0x239bf1[_0xcc08('0x2b')],'UserId':_0x239bf1['id'],'queue_name':_0x267f91[_0xcc08('0x2b')],'VoiceQueueId':_0x267f91['id'],'interface':_[_0xcc08('0x8d')](_0x239bf1[_0xcc08('0x8a')])?util['format'](_0xcc08('0x8e'),_0x239bf1[_0xcc08('0x2b')]):_0x239bf1[_0xcc08('0x8a')],'paused':_0x239bf1[_0xcc08('0x8f')]||![],'penalty':_0x267f91[_0xcc08('0x84')][_0xcc08('0x85')]},{'transaction':_0x5b7db1});});return Promise[_0xcc08('0x90')](_0x587afc);});});});return Promise[_0xcc08('0x90')](_0x310f93);});return Promise['all'](_0x283f05);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2b7120}})[_0xcc08('0x29')](function(_0x12a707){if(_0x12a707){var _0x50d231=_['map'](_0x446f2e,function(_0x857bb4){db['UserVoicePrefix']['upsert']({'UserId':_0x857bb4,'VoicePrefixId':_0x12a707[_0xcc08('0x6a')]});});return Promise[_0xcc08('0x90')](_0x50d231);}});});});return Promise['all'](_0x2ed8ba)[_0xcc08('0x29')](function(){return _0x48fd90[_0xcc08('0x7b')](_0x446f2e,{'transaction':_0x5b7db1})[_0xcc08('0x91')](function(_0xeefa2c){return _0xeefa2c;});});});}})[_0xcc08('0x29')](respondWithResult(_0xdcfb46,null))[_0xcc08('0x43')](handleError(_0xdcfb46,null));};exports[_0xcc08('0x92')]=function(_0x3c3b86,_0x43c066){var _0x568ca1=_[_0xcc08('0x7c')](_0x3c3b86['query'][_0xcc08('0x79')])?_0x3c3b86[_0xcc08('0x37')][_0xcc08('0x79')]:[_0x3c3b86[_0xcc08('0x37')][_0xcc08('0x79')]];var _0x46c019=_0x3c3b86[_0xcc08('0x45')]['id'];return db[_0xcc08('0x2d')]['find']({'where':{'id':_0x46c019}})[_0xcc08('0x29')](handleEntityNotFound(_0x43c066,null))[_0xcc08('0x29')](function(_0x2e78e5){if(_0x2e78e5){var _0x4e501d=[_0xcc08('0x7d'),'Chat','Mail','Sms','Fax','Openchannel',_0xcc08('0x81')];return db[_0xcc08('0x53')][_0xcc08('0x54')](function(_0x22f4b6){var _0x17017f=_['map'](_0x4e501d,function(_0x156425){var _0x419884={'attributes':['id',_0xcc08('0x2b')]};return _0x2e78e5[_0xcc08('0x4b')+_0x156425+_0xcc08('0x75')](_0x419884)[_0xcc08('0x29')](function(_0x43b299){var _0x40ee83=_[_0xcc08('0x31')](_0x43b299,function(_0x4b53a8){return _0x4b53a8[_0xcc08('0x92')](_0x568ca1,{'transaction':_0x22f4b6})['then'](function(){var _0x265f36=_['map'](_0x568ca1,function(_0x5e642f){socket[_0xcc08('0x88')](_0xcc08('0x4a')+_0x156425+'Queue:remove',{'UserId':Number(_0x5e642f),[_0x156425+_0xcc08('0x83')]:_0x4b53a8['id']});if(_0x156425!==_0xcc08('0x7d')){return;}return db[_0xcc08('0x8b')][_0xcc08('0x52')]({'where':{'VoiceQueueId':_0x4b53a8['id'],'UserId':_0x5e642f},'transaction':_0x22f4b6});});return Promise['all'](_0x265f36);});});return Promise['all'](_0x40ee83);});});return Promise[_0xcc08('0x90')](_0x17017f)['then'](function(){return _0x2e78e5[_0xcc08('0x92')](_0x568ca1,{'transaction':_0x22f4b6});})['then'](function(){return db[_0xcc08('0x69')]['findOne']({'where':{'teamId':_0x46c019}})[_0xcc08('0x29')](function(_0x371e28){if(_0x371e28){var _0xb03487=_[_0xcc08('0x31')](_0x568ca1,function(_0x2e2cc0){db[_0xcc08('0x93')][_0xcc08('0x52')]({'where':{'UserId':_0x2e2cc0,'VoicePrefixId':_0x371e28[_0xcc08('0x6a')]}});});return Promise['all'](_0xb03487);}});});});}})[_0xcc08('0x29')](respondWithStatusCode(_0x43c066,null))['catch'](handleError(_0x43c066,null));};exports[_0xcc08('0x94')]=function(_0x55d1cb,_0x2b8dee,_0x18b615){var _0x56ccb7={};var _0x429030={};var _0x56c533;var _0x41f2e5;return db[_0xcc08('0x2d')][_0xcc08('0x6e')]({'where':{'id':_0x55d1cb['params']['id']}})[_0xcc08('0x29')](handleEntityNotFound(_0x2b8dee,null))[_0xcc08('0x29')](function(_0xeee713){if(_0xeee713){_0x56c533=_0xeee713;_0x429030[_0xcc08('0x30')]=_['keys'](db[_0xcc08('0x86')][_0xcc08('0x95')]);_0x429030[_0xcc08('0x37')]=_[_0xcc08('0x32')](_0x55d1cb['query']);_0x429030[_0xcc08('0x33')]=_['intersection'](_0x429030[_0xcc08('0x30')],_0x429030[_0xcc08('0x37')]);_0x56ccb7[_0xcc08('0x35')]=_[_0xcc08('0x34')](_0x429030[_0xcc08('0x30')],qs['fields'](_0x55d1cb[_0xcc08('0x37')][_0xcc08('0x36')]));_0x56ccb7[_0xcc08('0x35')]=_0x56ccb7[_0xcc08('0x35')]['length']?_0x56ccb7[_0xcc08('0x35')]:_0x429030[_0xcc08('0x30')];_0x56ccb7[_0xcc08('0x3a')]=qs[_0xcc08('0x3b')](_0x55d1cb['query']['sort']);_0x56ccb7[_0xcc08('0x3c')]=qs['filters'](_['pick'](_0x55d1cb[_0xcc08('0x37')],_0x429030['filters']));if(_0x55d1cb[_0xcc08('0x37')][_0xcc08('0x3d')]){_0x56ccb7[_0xcc08('0x3c')]=_['merge'](_0x56ccb7[_0xcc08('0x3c')],{'$or':_[_0xcc08('0x31')](_0x56ccb7['attributes'],function(_0x5360cf){var _0x25a6c7={};_0x25a6c7[_0x5360cf]={'$like':'%'+_0x55d1cb[_0xcc08('0x37')][_0xcc08('0x3d')]+'%'};return _0x25a6c7;})});}_0x56ccb7=_[_0xcc08('0x3e')]({},_0x56ccb7,_0x55d1cb[_0xcc08('0x46')]);return _0x56c533[_0xcc08('0x94')](_0x56ccb7);}})['then'](function(_0x2900bc){if(_0x2900bc){_0x41f2e5=_0x2900bc[_0xcc08('0x38')];if(!_0x55d1cb['query'][_0xcc08('0x96')]('nolimit')){_0x56ccb7[_0xcc08('0x23')]=qs[_0xcc08('0x23')](_0x55d1cb['query'][_0xcc08('0x23')]);_0x56ccb7[_0xcc08('0x21')]=qs[_0xcc08('0x21')](_0x55d1cb['query'][_0xcc08('0x21')]);}return _0x56c533[_0xcc08('0x94')](_0x56ccb7);}})[_0xcc08('0x29')](function(_0x3f6c28){if(_0x3f6c28){return _0x3f6c28?{'count':_0x41f2e5,'rows':_0x3f6c28}:null;}})[_0xcc08('0x29')](respondWithResult(_0x2b8dee,null))[_0xcc08('0x43')](handleError(_0x2b8dee,null));}; \ No newline at end of file +var _0x4f84=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','catch','error','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','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','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','send','getQueues','findOne','channel','capitalize','toLowerCase','Queue','Queues','addQueues','Unknown\x20channel','ids','removeQueues','ValidationError','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','QueueId','penalty','User','findOrCreate','emit','user','online','voicePause','upsert','isNil','format','SIP/%s','interface','all','Queue:remove','UserVoiceQueueRt','removeAgents','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','index','map','Team','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x4f84,0x193));var _0x44f8=function(_0x248dc8,_0x10c027){_0x248dc8=_0x248dc8-0x0;var _0x15aaee=_0x4f84[_0x248dc8];return _0x15aaee;};'use strict';var emlformat=require(_0x44f8('0x0'));var rimraf=require(_0x44f8('0x1'));var zipdir=require(_0x44f8('0x2'));var jsonpatch=require(_0x44f8('0x3'));var rp=require(_0x44f8('0x4'));var moment=require(_0x44f8('0x5'));var BPromise=require(_0x44f8('0x6'));var Mustache=require(_0x44f8('0x7'));var util=require(_0x44f8('0x8'));var path=require(_0x44f8('0x9'));var sox=require(_0x44f8('0xa'));var csv=require(_0x44f8('0xb'));var ejs=require(_0x44f8('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44f8('0xd'));var squel=require('squel');var crypto=require(_0x44f8('0xe'));var jsforce=require(_0x44f8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44f8('0x10'));var Papa=require('papaparse');var Redis=require(_0x44f8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x44f8('0x12'));var as=require(_0x44f8('0x13'));var hardwareService=require(_0x44f8('0x14'));var logger=require('../../config/logger')(_0x44f8('0x15'));var utils=require(_0x44f8('0x16'));var config=require(_0x44f8('0x17'));var licenseUtil=require(_0x44f8('0x18'));var db=require(_0x44f8('0x19'))['db'];config[_0x44f8('0x1a')]=_[_0x44f8('0x1b')](config[_0x44f8('0x1a')],{'host':_0x44f8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44f8('0x1d'))[_0x44f8('0x1e')](socket);function respondWithStatusCode(_0x26a153,_0x139336){_0x139336=_0x139336||0xcc;return function(_0xbce9f7){if(_0xbce9f7){return _0x26a153[_0x44f8('0x1f')](_0x139336);}return _0x26a153['status'](_0x139336)[_0x44f8('0x20')]();};}function respondWithResult(_0x1c5dc1,_0x4b3bb0){_0x4b3bb0=_0x4b3bb0||0xc8;return function(_0x4e100b){if(_0x4e100b){return _0x1c5dc1[_0x44f8('0x21')](_0x4b3bb0)[_0x44f8('0x22')](_0x4e100b);}};}function respondWithFilteredResult(_0x34e93c,_0x125ac2){return function(_0x55660d){if(_0x55660d){var _0x41ec7d=typeof _0x125ac2[_0x44f8('0x23')]===_0x44f8('0x24')&&typeof _0x125ac2[_0x44f8('0x25')]===_0x44f8('0x24');var _0x33ebd8=_0x55660d[_0x44f8('0x26')];var _0x50cd97=_0x41ec7d?0x0:_0x125ac2[_0x44f8('0x23')];var _0x111acb=_0x41ec7d?_0x55660d[_0x44f8('0x26')]:_0x125ac2[_0x44f8('0x23')]+_0x125ac2[_0x44f8('0x25')];var _0x357bed;if(_0x111acb>=_0x33ebd8){_0x111acb=_0x33ebd8;_0x357bed=0xc8;}else{_0x357bed=0xce;}_0x34e93c[_0x44f8('0x21')](_0x357bed);return _0x34e93c[_0x44f8('0x27')](_0x44f8('0x28'),_0x50cd97+'-'+_0x111acb+'/'+_0x33ebd8)[_0x44f8('0x22')](_0x55660d);}return null;};}function patchUpdates(_0x214c23){return function(_0x54f70c){try{jsonpatch[_0x44f8('0x29')](_0x54f70c,_0x214c23,!![]);}catch(_0x53b50c){return BPromise[_0x44f8('0x2a')](_0x53b50c);}return _0x54f70c[_0x44f8('0x2b')]();};}function saveUpdates(_0x3a89bc,_0x46c2f0){return function(_0x22f1c6){if(_0x22f1c6){return _0x22f1c6['update'](_0x3a89bc)[_0x44f8('0x2c')](function(_0x504918){return _0x504918;});}return null;};}function handleEntityNotFound(_0x23e8c6,_0x412e76){return function(_0x57e68b){if(!_0x57e68b){_0x23e8c6[_0x44f8('0x1f')](0x194);}return _0x57e68b;};}function handleError(_0x2b459e,_0x40c4a9){_0x40c4a9=_0x40c4a9||0x1f4;return function(_0x1a39a5){logger['error'](_0x1a39a5[_0x44f8('0x2d')]);if(_0x1a39a5['name']){delete _0x1a39a5['name'];}_0x2b459e[_0x44f8('0x21')](_0x40c4a9)['send'](_0x1a39a5);};}exports[_0x44f8('0x2e')]=function(_0x56bca5,_0x2b2049){var _0x17b8c9={},_0x2b2a3f={},_0x363f15={'count':0x0,'rows':[]};var _0x464c3e=_[_0x44f8('0x2f')](db[_0x44f8('0x30')][_0x44f8('0x31')],function(_0x322818){return{'name':_0x322818[_0x44f8('0x32')],'type':_0x322818[_0x44f8('0x33')]['key']};});_0x2b2a3f['model']=_[_0x44f8('0x2f')](_0x464c3e,_0x44f8('0x34'));_0x2b2a3f[_0x44f8('0x35')]=_[_0x44f8('0x36')](_0x56bca5[_0x44f8('0x35')]);_0x2b2a3f[_0x44f8('0x37')]=_['intersection'](_0x2b2a3f[_0x44f8('0x38')],_0x2b2a3f['query']);_0x17b8c9[_0x44f8('0x39')]=_[_0x44f8('0x3a')](_0x2b2a3f[_0x44f8('0x38')],qs[_0x44f8('0x3b')](_0x56bca5['query'][_0x44f8('0x3b')]));_0x17b8c9[_0x44f8('0x39')]=_0x17b8c9[_0x44f8('0x39')][_0x44f8('0x3c')]?_0x17b8c9['attributes']:_0x2b2a3f[_0x44f8('0x38')];if(!_0x56bca5[_0x44f8('0x35')][_0x44f8('0x3d')]('nolimit')){_0x17b8c9[_0x44f8('0x25')]=qs['limit'](_0x56bca5['query']['limit']);_0x17b8c9[_0x44f8('0x23')]=qs[_0x44f8('0x23')](_0x56bca5[_0x44f8('0x35')][_0x44f8('0x23')]);}_0x17b8c9[_0x44f8('0x3e')]=qs[_0x44f8('0x3f')](_0x56bca5['query'][_0x44f8('0x3f')]);_0x17b8c9[_0x44f8('0x40')]=qs['filters'](_[_0x44f8('0x41')](_0x56bca5[_0x44f8('0x35')],_0x2b2a3f['filters']),_0x464c3e);if(_0x56bca5['query'][_0x44f8('0x42')]){_0x17b8c9['where']=_[_0x44f8('0x43')](_0x17b8c9['where'],{'$or':_[_0x44f8('0x2f')](_0x464c3e,function(_0x455cbf){if(_0x455cbf[_0x44f8('0x33')]!==_0x44f8('0x44')){var _0x48e04a={};_0x48e04a[_0x455cbf[_0x44f8('0x34')]]={'$like':'%'+_0x56bca5[_0x44f8('0x35')][_0x44f8('0x42')]+'%'};return _0x48e04a;}})});}_0x17b8c9=_[_0x44f8('0x43')]({},_0x17b8c9,_0x56bca5[_0x44f8('0x45')]);var _0x401de3={'where':_0x17b8c9[_0x44f8('0x40')]};return db[_0x44f8('0x30')]['count'](_0x401de3)[_0x44f8('0x2c')](function(_0x385c43){_0x363f15[_0x44f8('0x26')]=_0x385c43;if(_0x56bca5[_0x44f8('0x35')][_0x44f8('0x46')]){_0x17b8c9[_0x44f8('0x47')]=[{'all':!![]}];}return db[_0x44f8('0x30')][_0x44f8('0x48')](_0x17b8c9);})[_0x44f8('0x2c')](function(_0x6847cc){_0x363f15[_0x44f8('0x49')]=_0x6847cc;return _0x363f15;})[_0x44f8('0x2c')](respondWithFilteredResult(_0x2b2049,_0x17b8c9))['catch'](handleError(_0x2b2049,null));};exports[_0x44f8('0x4a')]=function(_0x13f98f,_0x18a5cd){var _0x4a2252={'raw':![],'where':{'id':_0x13f98f[_0x44f8('0x4b')]['id']}},_0x22c9b8={};_0x22c9b8['model']=_[_0x44f8('0x36')](db[_0x44f8('0x30')][_0x44f8('0x31')]);_0x22c9b8[_0x44f8('0x35')]=_['keys'](_0x13f98f['query']);_0x22c9b8[_0x44f8('0x37')]=_[_0x44f8('0x3a')](_0x22c9b8['model'],_0x22c9b8['query']);_0x4a2252[_0x44f8('0x39')]=_[_0x44f8('0x3a')](_0x22c9b8[_0x44f8('0x38')],qs[_0x44f8('0x3b')](_0x13f98f[_0x44f8('0x35')]['fields']));_0x4a2252[_0x44f8('0x39')]=_0x4a2252['attributes'][_0x44f8('0x3c')]?_0x4a2252[_0x44f8('0x39')]:_0x22c9b8[_0x44f8('0x38')];if(_0x13f98f['query'][_0x44f8('0x46')]){_0x4a2252[_0x44f8('0x47')]=[{'all':!![]}];}_0x4a2252=_[_0x44f8('0x43')]({},_0x4a2252,_0x13f98f['options']);return db['Team'][_0x44f8('0x4c')](_0x4a2252)[_0x44f8('0x2c')](handleEntityNotFound(_0x18a5cd,null))[_0x44f8('0x2c')](respondWithResult(_0x18a5cd,null))['catch'](handleError(_0x18a5cd,null));};exports[_0x44f8('0x4d')]=function(_0x52bc9a,_0x2aec8b){return db['Team'][_0x44f8('0x4d')](_0x52bc9a[_0x44f8('0x4e')],{})[_0x44f8('0x2c')](function(_0x3d80fc){var _0x28e356=_0x52bc9a['user'][_0x44f8('0x4f')]({'plain':!![]});if(!_0x28e356)throw new Error(_0x44f8('0x50'));if(_0x28e356[_0x44f8('0x51')]==='user'){var _0x4de442=_0x3d80fc[_0x44f8('0x4f')]({'plain':!![]});var _0x10071d=_0x44f8('0x52');return db[_0x44f8('0x53')]['find']({'where':{'name':_0x10071d,'userProfileId':_0x28e356[_0x44f8('0x54')]},'raw':!![]})[_0x44f8('0x2c')](function(_0x19d7eb){if(_0x19d7eb&&_0x19d7eb[_0x44f8('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4de442[_0x44f8('0x34')],'resourceId':_0x4de442['id'],'type':_0x19d7eb[_0x44f8('0x34')],'sectionId':_0x19d7eb['id']},{})[_0x44f8('0x2c')](function(){return _0x3d80fc;});}else{return _0x3d80fc;}})[_0x44f8('0x56')](function(_0x301a12){logger[_0x44f8('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x301a12);throw _0x301a12;});}return _0x3d80fc;})[_0x44f8('0x2c')](respondWithResult(_0x2aec8b,0xc9))[_0x44f8('0x56')](handleError(_0x2aec8b,null));};exports['update']=function(_0x350dc6,_0x2989f1){if(_0x350dc6[_0x44f8('0x4e')]['id']){delete _0x350dc6['body']['id'];}return db[_0x44f8('0x30')][_0x44f8('0x4c')]({'where':{'id':_0x350dc6[_0x44f8('0x4b')]['id']}})[_0x44f8('0x2c')](handleEntityNotFound(_0x2989f1,null))[_0x44f8('0x2c')](saveUpdates(_0x350dc6[_0x44f8('0x4e')],null))[_0x44f8('0x2c')](respondWithResult(_0x2989f1,null))['catch'](handleError(_0x2989f1,null));};exports[_0x44f8('0x58')]=function(_0x45cffc,_0x4ce760){var _0x59e90c=_0x45cffc['params']['id'];var _0x28f04f=[];return db[_0x44f8('0x59')]['transaction'](function(_0x326b9d){var _0x2fc4e8=_0x44f8('0x5a')+_0x59e90c;return db[_0x44f8('0x59')]['query'](_0x2fc4e8,{'type':db[_0x44f8('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x326b9d})[_0x44f8('0x2c')](function(_0x5f4d6b){_0x28f04f=_[_0x44f8('0x2f')](_0x5f4d6b,function(_0x3a0329){return Number(_0x3a0329[_0x44f8('0x5c')]);});})[_0x44f8('0x2c')](function(){var _0x817326=_0x44f8('0x5d')+_0x59e90c;return db[_0x44f8('0x59')]['query'](_0x817326,{'type':db[_0x44f8('0x5b')][_0x44f8('0x5e')]['SELECT'],'raw':!![],'transaction':_0x326b9d});})['then'](function(_0x399ab7){var _0x4d430b=_[_0x44f8('0x2f')](_0x399ab7,function(_0x25aada){return Number(_0x25aada['VoiceQueueId']);});return db[_0x44f8('0x5f')][_0x44f8('0x58')]({'where':{'UserId':{'$in':_0x28f04f},'VoiceQueueId':{'$in':_0x4d430b}},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){var _0x3bc488=_0x44f8('0x60')+_0x59e90c;return db[_0x44f8('0x59')][_0x44f8('0x35')](_0x3bc488,{'type':db[_0x44f8('0x5b')][_0x44f8('0x5e')][_0x44f8('0x61')],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x50b69a){var _0xe03ae2=_[_0x44f8('0x2f')](_0x50b69a,function(_0xcc28d9){return Number(_0xcc28d9[_0x44f8('0x62')]);});return db[_0x44f8('0x63')][_0x44f8('0x58')]({'where':{'UserId':{'$in':_0x28f04f},'MailQueueId':{'$in':_0xe03ae2}},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){var _0x58cb0f='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x59e90c;return db[_0x44f8('0x59')][_0x44f8('0x35')](_0x58cb0f,{'type':db['Sequelize'][_0x44f8('0x5e')][_0x44f8('0x61')],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x8568b1){var _0x20b474=_['map'](_0x8568b1,function(_0xcbfbf4){return Number(_0xcbfbf4['SmsQueueId']);});return db[_0x44f8('0x64')][_0x44f8('0x58')]({'where':{'UserId':{'$in':_0x28f04f},'SmsQueueId':{'$in':_0x20b474}},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){var _0xac192d=_0x44f8('0x65')+_0x59e90c;return db[_0x44f8('0x59')][_0x44f8('0x35')](_0xac192d,{'type':db['Sequelize'][_0x44f8('0x5e')][_0x44f8('0x61')],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x39498d){var _0x36c208=_[_0x44f8('0x2f')](_0x39498d,function(_0x3e0afd){return Number(_0x3e0afd[_0x44f8('0x66')]);});return db[_0x44f8('0x67')][_0x44f8('0x58')]({'where':{'UserId':{'$in':_0x28f04f},'ChatQueueId':{'$in':_0x36c208}},'transaction':_0x326b9d});})['then'](function(){var _0x16ca2a=_0x44f8('0x68')+_0x59e90c;return db[_0x44f8('0x59')][_0x44f8('0x35')](_0x16ca2a,{'type':db[_0x44f8('0x5b')][_0x44f8('0x5e')]['SELECT'],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x207384){var _0x37a80d=_[_0x44f8('0x2f')](_0x207384,function(_0x3e5d6d){return Number(_0x3e5d6d['FaxQueueId']);});return db[_0x44f8('0x69')]['destroy']({'where':{'UserId':{'$in':_0x28f04f},'FaxQueueId':{'$in':_0x37a80d}},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){var _0x214a7a='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x59e90c;return db[_0x44f8('0x59')][_0x44f8('0x35')](_0x214a7a,{'type':db[_0x44f8('0x5b')]['QueryTypes'][_0x44f8('0x61')],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0xe079ee){var _0x3cf3e4=_[_0x44f8('0x2f')](_0xe079ee,function(_0x4867a5){return Number(_0x4867a5[_0x44f8('0x6a')]);});return db[_0x44f8('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x28f04f},'OpenchannelQueueId':{'$in':_0x3cf3e4}},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){var _0x3c8865=_0x44f8('0x6c')+_0x59e90c;return db[_0x44f8('0x59')]['query'](_0x3c8865,{'type':db[_0x44f8('0x5b')][_0x44f8('0x5e')][_0x44f8('0x61')],'raw':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x22d699){var _0xd724c6=_['map'](_0x22d699,function(_0x56ab2d){return Number(_0x56ab2d['WhatsappQueueId']);});return db[_0x44f8('0x6d')][_0x44f8('0x58')]({'where':{'UserId':{'$in':_0x28f04f},'WhatsappQueueId':{'$in':_0xd724c6}},'transaction':_0x326b9d});})['then'](function(){return db[_0x44f8('0x6e')][_0x44f8('0x4c')]({'where':{'TeamId':_0x59e90c}});})[_0x44f8('0x2c')](function(_0x1503ed){if(_0x1503ed===null){return;}return db[_0x44f8('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x28f04f},'VoicePrefixId':_0x1503ed[_0x44f8('0x70')]},'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(){return db[_0x44f8('0x30')][_0x44f8('0x58')]({'where':{'id':_0x59e90c},'cascade':!![],'transaction':_0x326b9d});})[_0x44f8('0x2c')](function(_0x22effb){if(_0x22effb===0x0){_0x4ce760[_0x44f8('0x1f')](0x194);}else{return db[_0x44f8('0x71')][_0x44f8('0x58')]({'where':{'type':_0x44f8('0x52'),'resourceId':_0x59e90c},'cascade':!![],'transaction':_0x326b9d})[_0x44f8('0x2c')](function(){_0x4ce760[_0x44f8('0x21')](0xcc)[_0x44f8('0x20')]();});}})[_0x44f8('0x56')](function(_0x4cc486){_0x4ce760[_0x44f8('0x21')](0x1f4)[_0x44f8('0x72')](_0x4cc486);});});};exports[_0x44f8('0x73')]=function(_0x2c41c2,_0x5f2749,_0x5db0cd){return db[_0x44f8('0x30')][_0x44f8('0x74')]({'where':{'id':_0x2c41c2[_0x44f8('0x4b')]['id']}})[_0x44f8('0x2c')](handleEntityNotFound(_0x5f2749,null))[_0x44f8('0x2c')](function(_0x3570fd){if(!_0x2c41c2[_0x44f8('0x35')][_0x44f8('0x75')]||!utils['isValidChannel'](_0x2c41c2[_0x44f8('0x35')][_0x44f8('0x75')])){throw new db[(_0x44f8('0x5b'))]['ValidationError']('Unknown\x20channel');}var _0x3aa9e0={};var _0x21d77b={};_0x21d77b[_0x44f8('0x38')]=_['keys'](db[_[_0x44f8('0x76')](_0x2c41c2[_0x44f8('0x35')][_0x44f8('0x75')][_0x44f8('0x77')]())+_0x44f8('0x78')][_0x44f8('0x31')]);_0x21d77b[_0x44f8('0x35')]=_[_0x44f8('0x36')](_0x2c41c2[_0x44f8('0x35')]);_0x21d77b[_0x44f8('0x37')]=_[_0x44f8('0x3a')](_0x21d77b[_0x44f8('0x38')],_0x21d77b['query']);_0x3aa9e0['attributes']=_['intersection'](_0x21d77b[_0x44f8('0x38')],qs[_0x44f8('0x3b')](_0x2c41c2['query'][_0x44f8('0x3b')]));_0x3aa9e0[_0x44f8('0x39')]=_0x3aa9e0[_0x44f8('0x39')]['length']?_0x3aa9e0['attributes']:_0x21d77b[_0x44f8('0x38')];_0x3aa9e0['limit']=qs['limit'](_0x2c41c2['query'][_0x44f8('0x25')]);_0x3aa9e0['offset']=qs[_0x44f8('0x23')](_0x2c41c2['query'][_0x44f8('0x23')]);_0x3aa9e0[_0x44f8('0x3e')]=qs[_0x44f8('0x3f')](_0x2c41c2['query'][_0x44f8('0x3f')]);_0x3aa9e0[_0x44f8('0x40')]=qs[_0x44f8('0x37')](_['pick'](_0x2c41c2[_0x44f8('0x35')],_0x21d77b[_0x44f8('0x37')]));_0x3aa9e0=_[_0x44f8('0x43')]({},_0x3aa9e0,_0x2c41c2['options']);return _0x3570fd[_0x44f8('0x4f')+_[_0x44f8('0x76')](_0x2c41c2[_0x44f8('0x35')][_0x44f8('0x75')]['toLowerCase']())+_0x44f8('0x79')](_0x3aa9e0);})[_0x44f8('0x2c')](respondWithResult(_0x5f2749,null))[_0x44f8('0x56')](handleError(_0x5f2749,null));};exports[_0x44f8('0x7a')]=function(_0x2dacd2,_0x2f0828,_0xdb162a){return db[_0x44f8('0x30')]['findOne']({'where':{'id':_0x2dacd2[_0x44f8('0x4b')]['id']}})[_0x44f8('0x2c')](function(_0x122237){if(_0x122237){if(!_0x2dacd2[_0x44f8('0x4e')][_0x44f8('0x75')]||!utils['isValidChannel'](_0x2dacd2[_0x44f8('0x4e')][_0x44f8('0x75')])){throw new db['Sequelize']['ValidationError'](_0x44f8('0x7b'));}return _0x122237['add'+_[_0x44f8('0x76')](_0x2dacd2['body'][_0x44f8('0x75')]['toLowerCase']())+_0x44f8('0x79')](_0x2dacd2[_0x44f8('0x4e')][_0x44f8('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x2f0828,null))['then'](respondWithStatusCode(_0x2f0828,null))['catch'](handleError(_0x2f0828,null));};exports[_0x44f8('0x7d')]=function(_0x2260db,_0x4048e0,_0x3c72b1){return db['Team'][_0x44f8('0x74')]({'where':{'id':_0x2260db[_0x44f8('0x4b')]['id']}})[_0x44f8('0x2c')](function(_0x409aff){if(_0x409aff){if(!_0x2260db[_0x44f8('0x35')][_0x44f8('0x75')]||!utils['isValidChannel'](_0x2260db[_0x44f8('0x35')][_0x44f8('0x75')])){throw new db[(_0x44f8('0x5b'))][(_0x44f8('0x7e'))](_0x44f8('0x7b'));}return _0x409aff[_0x44f8('0x7f')+_[_0x44f8('0x76')](_0x2260db[_0x44f8('0x35')][_0x44f8('0x75')]['toLowerCase']())+_0x44f8('0x79')](_0x2260db[_0x44f8('0x35')][_0x44f8('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x4048e0,null))[_0x44f8('0x2c')](respondWithStatusCode(_0x4048e0,null))[_0x44f8('0x56')](handleError(_0x4048e0,null));};exports[_0x44f8('0x80')]=function(_0x2d00bc,_0x46ea65){var _0x4d6ef3=_['isArray'](_0x2d00bc[_0x44f8('0x4e')][_0x44f8('0x7c')])?_0x2d00bc[_0x44f8('0x4e')][_0x44f8('0x7c')]:[_0x2d00bc['body'][_0x44f8('0x7c')]];var _0x481d28=_0x2d00bc['params']['id'];return db[_0x44f8('0x30')][_0x44f8('0x4c')]({'where':{'id':_0x481d28}})[_0x44f8('0x2c')](handleEntityNotFound(_0x46ea65,null))[_0x44f8('0x2c')](function(_0x457e7a){if(_0x457e7a){var _0xe8558c=['Voice',_0x44f8('0x81'),_0x44f8('0x82'),_0x44f8('0x83'),_0x44f8('0x84'),_0x44f8('0x85'),_0x44f8('0x86')];return db['sequelize'][_0x44f8('0x87')](function(_0x1c449d){var _0x5a1ed2=_[_0x44f8('0x2f')](_0xe8558c,function(_0x33fb14){var _0x3399f1={'attributes':['id',_0x44f8('0x34')]};if(_0x33fb14===_0x44f8('0x88')){_0x3399f1[_0x44f8('0x89')]={'attributes':['penalty']};}return _0x457e7a['get'+_0x33fb14+'Queues'](_0x3399f1)[_0x44f8('0x2c')](function(_0x54ce35){var _0x2b2d8b=_['map'](_0x54ce35,function(_0x2e878f){var _0x3b1990=_[_0x44f8('0x2f')](_0x4d6ef3,function(_0xcf2033){var _0x435bed={'where':{'UserId':_0xcf2033,[_0x33fb14+_0x44f8('0x8a')]:_0x2e878f['id']},'transaction':_0x1c449d};if(_0x33fb14===_0x44f8('0x88')){_0x435bed[_0x44f8('0x1b')]={'penalty':_0x2e878f['TeamVoiceQueue'][_0x44f8('0x8b')]};}return db[_0x44f8('0x8c')+_0x33fb14+_0x44f8('0x78')][_0x44f8('0x8d')](_0x435bed)[_0x44f8('0x2c')](function(){socket[_0x44f8('0x8e')](_0x44f8('0x8f')+_0x33fb14+'Queue:save',{'UserId':_0xcf2033,[_0x33fb14+_0x44f8('0x8a')]:_0x2e878f['id']});if(_0x33fb14!=='Voice'){return;}return db[_0x44f8('0x8c')][_0x44f8('0x48')]({'where':{'id':_0x4d6ef3,'online':0x1},'attributes':['id',_0x44f8('0x34'),_0x44f8('0x90'),_0x44f8('0x91'),'interface'],'raw':!![]})['then'](function(_0x483988){var _0xc3f2ac=_[_0x44f8('0x2f')](_0x483988,function(_0x57a931){return db['UserVoiceQueueRt'][_0x44f8('0x92')]({'membername':_0x57a931['name'],'UserId':_0x57a931['id'],'queue_name':_0x2e878f['name'],'VoiceQueueId':_0x2e878f['id'],'interface':_[_0x44f8('0x93')](_0x57a931['interface'])?util[_0x44f8('0x94')](_0x44f8('0x95'),_0x57a931[_0x44f8('0x34')]):_0x57a931[_0x44f8('0x96')],'paused':_0x57a931[_0x44f8('0x91')]||![],'penalty':_0x2e878f['TeamVoiceQueue'][_0x44f8('0x8b')]},{'transaction':_0x1c449d});});return Promise[_0x44f8('0x97')](_0xc3f2ac);});});});return Promise[_0x44f8('0x97')](_0x3b1990);});return Promise[_0x44f8('0x97')](_0x2b2d8b);})['then'](function(){return db[_0x44f8('0x6e')][_0x44f8('0x74')]({'where':{'teamId':_0x481d28}})[_0x44f8('0x2c')](function(_0x3b82eb){if(_0x3b82eb){var _0x1dfb8e=_[_0x44f8('0x2f')](_0x4d6ef3,function(_0x5cad00){db[_0x44f8('0x6f')][_0x44f8('0x92')]({'UserId':_0x5cad00,'VoicePrefixId':_0x3b82eb[_0x44f8('0x70')]});});return Promise[_0x44f8('0x97')](_0x1dfb8e);}});});});return Promise[_0x44f8('0x97')](_0x5a1ed2)['then'](function(){return _0x457e7a[_0x44f8('0x80')](_0x4d6ef3,{'transaction':_0x1c449d})['spread'](function(_0x5a92b4){return _0x5a92b4;});});});}})[_0x44f8('0x2c')](respondWithResult(_0x46ea65,null))[_0x44f8('0x56')](handleError(_0x46ea65,null));};exports['removeAgents']=function(_0x424689,_0x45d857){var _0x58d551=_['isArray'](_0x424689[_0x44f8('0x35')]['ids'])?_0x424689[_0x44f8('0x35')][_0x44f8('0x7c')]:[_0x424689[_0x44f8('0x35')][_0x44f8('0x7c')]];var _0x23a313=_0x424689['params']['id'];return db[_0x44f8('0x30')][_0x44f8('0x4c')]({'where':{'id':_0x23a313}})[_0x44f8('0x2c')](handleEntityNotFound(_0x45d857,null))[_0x44f8('0x2c')](function(_0x5eeb17){if(_0x5eeb17){var _0xdb33f1=['Voice',_0x44f8('0x81'),_0x44f8('0x82'),_0x44f8('0x83'),_0x44f8('0x84'),_0x44f8('0x85'),_0x44f8('0x86')];return db[_0x44f8('0x59')][_0x44f8('0x87')](function(_0x3c60db){var _0x20c370=_[_0x44f8('0x2f')](_0xdb33f1,function(_0x533a8e){var _0x5412b5={'attributes':['id',_0x44f8('0x34')]};return _0x5eeb17[_0x44f8('0x4f')+_0x533a8e+_0x44f8('0x79')](_0x5412b5)[_0x44f8('0x2c')](function(_0x394908){var _0x431165=_[_0x44f8('0x2f')](_0x394908,function(_0x447de0){return _0x447de0['removeAgents'](_0x58d551,{'transaction':_0x3c60db})[_0x44f8('0x2c')](function(){var _0x4b3239=_[_0x44f8('0x2f')](_0x58d551,function(_0x5f45b0){socket[_0x44f8('0x8e')]('user'+_0x533a8e+_0x44f8('0x98'),{'UserId':Number(_0x5f45b0),[_0x533a8e+'QueueId']:_0x447de0['id']});if(_0x533a8e!=='Voice'){return;}return db[_0x44f8('0x99')]['destroy']({'where':{'VoiceQueueId':_0x447de0['id'],'UserId':_0x5f45b0},'transaction':_0x3c60db});});return Promise[_0x44f8('0x97')](_0x4b3239);});});return Promise['all'](_0x431165);});});return Promise['all'](_0x20c370)[_0x44f8('0x2c')](function(){return _0x5eeb17[_0x44f8('0x9a')](_0x58d551,{'transaction':_0x3c60db});})['then'](function(){return db['TeamVoicePrefix'][_0x44f8('0x74')]({'where':{'teamId':_0x23a313}})[_0x44f8('0x2c')](function(_0x4ecb2b){if(_0x4ecb2b){var _0x85eb1f=_['map'](_0x58d551,function(_0x47f2c4){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x47f2c4,'VoicePrefixId':_0x4ecb2b[_0x44f8('0x70')]}});});return Promise[_0x44f8('0x97')](_0x85eb1f);}});});});}})[_0x44f8('0x2c')](respondWithStatusCode(_0x45d857,null))[_0x44f8('0x56')](handleError(_0x45d857,null));};exports['getAgents']=function(_0x4dc38b,_0x515817,_0x479516){var _0x48c3e1={};var _0x5d2155={};var _0x3a6f6a;var _0x9fdf2b;return db['Team'][_0x44f8('0x74')]({'where':{'id':_0x4dc38b[_0x44f8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x515817,null))[_0x44f8('0x2c')](function(_0x3ca5f3){if(_0x3ca5f3){_0x3a6f6a=_0x3ca5f3;_0x5d2155[_0x44f8('0x38')]=_[_0x44f8('0x36')](db[_0x44f8('0x8c')]['rawAttributes']);_0x5d2155[_0x44f8('0x35')]=_[_0x44f8('0x36')](_0x4dc38b[_0x44f8('0x35')]);_0x5d2155[_0x44f8('0x37')]=_['intersection'](_0x5d2155[_0x44f8('0x38')],_0x5d2155[_0x44f8('0x35')]);_0x48c3e1['attributes']=_[_0x44f8('0x3a')](_0x5d2155[_0x44f8('0x38')],qs[_0x44f8('0x3b')](_0x4dc38b[_0x44f8('0x35')][_0x44f8('0x3b')]));_0x48c3e1[_0x44f8('0x39')]=_0x48c3e1[_0x44f8('0x39')][_0x44f8('0x3c')]?_0x48c3e1['attributes']:_0x5d2155['model'];_0x48c3e1['order']=qs[_0x44f8('0x3f')](_0x4dc38b['query'][_0x44f8('0x3f')]);_0x48c3e1[_0x44f8('0x40')]=qs[_0x44f8('0x37')](_[_0x44f8('0x41')](_0x4dc38b[_0x44f8('0x35')],_0x5d2155['filters']));if(_0x4dc38b[_0x44f8('0x35')][_0x44f8('0x42')]){_0x48c3e1[_0x44f8('0x40')]=_[_0x44f8('0x43')](_0x48c3e1[_0x44f8('0x40')],{'$or':_[_0x44f8('0x2f')](_0x48c3e1[_0x44f8('0x39')],function(_0xf1862){var _0x34f569={};_0x34f569[_0xf1862]={'$like':'%'+_0x4dc38b[_0x44f8('0x35')]['filter']+'%'};return _0x34f569;})});}_0x48c3e1=_[_0x44f8('0x43')]({},_0x48c3e1,_0x4dc38b[_0x44f8('0x45')]);return _0x3a6f6a[_0x44f8('0x9b')](_0x48c3e1);}})[_0x44f8('0x2c')](function(_0xa3a863){if(_0xa3a863){_0x9fdf2b=_0xa3a863[_0x44f8('0x3c')];if(!_0x4dc38b['query'][_0x44f8('0x3d')](_0x44f8('0x9c'))){_0x48c3e1[_0x44f8('0x25')]=qs[_0x44f8('0x25')](_0x4dc38b[_0x44f8('0x35')]['limit']);_0x48c3e1[_0x44f8('0x23')]=qs[_0x44f8('0x23')](_0x4dc38b[_0x44f8('0x35')][_0x44f8('0x23')]);}return _0x3a6f6a[_0x44f8('0x9b')](_0x48c3e1);}})[_0x44f8('0x2c')](function(_0x5b948f){if(_0x5b948f){return _0x5b948f?{'count':_0x9fdf2b,'rows':_0x5b948f}:null;}})[_0x44f8('0x2c')](respondWithResult(_0x515817,null))[_0x44f8('0x56')](handleError(_0x515817,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a619a4f..6ec95ee 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 _0xde00=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x326193,_0x5bad0d){var _0x2949e1=function(_0x2bc7e0){while(--_0x2bc7e0){_0x326193['push'](_0x326193['shift']());}};_0x2949e1(++_0x5bad0d);}(_0xde00,0x1b3));var _0x0de0=function(_0x33d431,_0xf591fb){_0x33d431=_0x33d431-0x0;var _0xad1bc8=_0xde00[_0x33d431];return _0xad1bc8;};'use strict';var EventEmitter=require(_0x0de0('0x0'));var Team=require(_0x0de0('0x1'))['db'][_0x0de0('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x0de0('0x3')](0x0);var events={'afterCreate':_0x0de0('0x4'),'afterUpdate':_0x0de0('0x5'),'afterDestroy':_0x0de0('0x6')};function emitEvent(_0x29c35e){return function(_0xffb9f7,_0xefda60,_0x551cb3){TeamEvents[_0x0de0('0x7')](_0x29c35e+':'+_0xffb9f7['id'],_0xffb9f7);TeamEvents[_0x0de0('0x7')](_0x29c35e,_0xffb9f7);_0x551cb3(null);};}for(var e in events){if(events[_0x0de0('0x8')](e)){var event=events[e];Team[_0x0de0('0x9')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x77af=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x14fe58,_0x44383d){var _0x9d61f6=function(_0x14e0f3){while(--_0x14e0f3){_0x14fe58['push'](_0x14fe58['shift']());}};_0x9d61f6(++_0x44383d);}(_0x77af,0x110));var _0xf77a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x77af[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xf77a('0x0'));var Team=require(_0xf77a('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xf77a('0x2')](0x0);var events={'afterCreate':_0xf77a('0x3'),'afterUpdate':_0xf77a('0x4'),'afterDestroy':_0xf77a('0x5')};function emitEvent(_0x26a2bf){return function(_0x26e9ac,_0x342fb9,_0x3546a8){TeamEvents[_0xf77a('0x6')](_0x26a2bf+':'+_0x26e9ac['id'],_0x26e9ac);TeamEvents['emit'](_0x26a2bf,_0x26e9ac);_0x3546a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xf77a('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6680718..f2cfb09 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 _0xebd6=['define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','map','all','lodash','./team.attributes','Queues','then','setDataValue','catch','exports'];(function(_0x9d6272,_0x11e0ac){var _0x23bdeb=function(_0x401455){while(--_0x401455){_0x9d6272['push'](_0x9d6272['shift']());}};_0x23bdeb(++_0x11e0ac);}(_0xebd6,0x103));var _0x6ebd=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xebd6[_0x616290];return _0x453879;};'use strict';var _=require(_0x6ebd('0x0'));var attributes=require(_0x6ebd('0x1'));function getQueuesByChannel(_0xeadb6e,_0x5f07d2){var _0x207366='get'+_0x5f07d2+_0x6ebd('0x2');return _0xeadb6e[_0x207366]()[_0x6ebd('0x3')](function(_0x554728){return _['map'](_0x554728,function(_0x259d5c){_0x259d5c[_0x6ebd('0x4')]('channel',_0x5f07d2);return _0x259d5c;});})[_0x6ebd('0x5')](function(_0x18fced){throw _0x18fced;});}module[_0x6ebd('0x6')]=function(_0x347b7d){return _0x347b7d[_0x6ebd('0x7')](_0x6ebd('0x8'),attributes,{'tableName':_0x6ebd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x39f71c=this;var _0x1d70a6=[_0x6ebd('0xa'),_0x6ebd('0xb'),_0x6ebd('0xc'),_0x6ebd('0xd'),_0x6ebd('0xe'),'Voice',_0x6ebd('0xf')];return Promise[_0x6ebd('0x10')]()[_0x6ebd('0x3')](function(){var _0x1f2dc0=_[_0x6ebd('0x11')](_0x1d70a6,function(_0x5f129c){return getQueuesByChannel(_0x39f71c,_0x5f129c);});return Promise[_0x6ebd('0x12')](_0x1f2dc0);})['catch'](function(_0x29625f){throw _0x29625f;});}}});}; \ No newline at end of file +var _0xa965=['then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Voice','resolve','lodash','./team.attributes','get','Queues'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa965,0xe6));var _0x5a96=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0xa965[_0x5a1cc9];return _0x471761;};'use strict';var _=require(_0x5a96('0x0'));var attributes=require(_0x5a96('0x1'));function getQueuesByChannel(_0x5cfefb,_0x334943){var _0x456158=_0x5a96('0x2')+_0x334943+_0x5a96('0x3');return _0x5cfefb[_0x456158]()[_0x5a96('0x4')](function(_0x3085f7){return _[_0x5a96('0x5')](_0x3085f7,function(_0x101cb1){_0x101cb1[_0x5a96('0x6')](_0x5a96('0x7'),_0x334943);return _0x101cb1;});})[_0x5a96('0x8')](function(_0x116d71){throw _0x116d71;});}module[_0x5a96('0x9')]=function(_0x5dba51){return _0x5dba51[_0x5a96('0xa')](_0x5a96('0xb'),attributes,{'tableName':_0x5a96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1f5844=this;var _0x29eafa=[_0x5a96('0xd'),_0x5a96('0xe'),_0x5a96('0xf'),'Openchannel','Sms',_0x5a96('0x10'),'Whatsapp'];return Promise[_0x5a96('0x11')]()[_0x5a96('0x4')](function(){var _0x1957db=_['map'](_0x29eafa,function(_0x56de22){return getQueuesByChannel(_0x1f5844,_0x56de22);});return Promise['all'](_0x1957db);})[_0x5a96('0x8')](function(_0x2255a0){throw _0x2255a0;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 35bd640..322fd0f 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 _0x7a55=['../../config/environment','client','redis','socket.io-emitter','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a55,0x10a));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require(_0x57a5('0x1'));var moment=require(_0x57a5('0x2'));var BPromise=require(_0x57a5('0x3'));var rs=require(_0x57a5('0x4'));var fs=require('fs');var Redis=require(_0x57a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x57a5('0x6'));var logger=require(_0x57a5('0x7'))(_0x57a5('0x8'));var config=require(_0x57a5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x57a5('0xa')]['http']({'port':0x232a});config[_0x57a5('0xb')]=_['defaults'](config[_0x57a5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x57a5('0xc'))(new Redis(config[_0x57a5('0xb')]));require(_0x57a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x2168d9,_0x4a1d89,_0x743c84){return new BPromise(function(_0x4e728,_0x107a74){return client[_0x57a5('0xe')](_0x2168d9,_0x743c84)['then'](function(_0x4f5436){logger[_0x57a5('0xf')](_0x57a5('0x10'),_0x4a1d89,_0x57a5('0x11'));logger[_0x57a5('0x12')](_0x57a5('0x13'),_0x4a1d89,'request\x20sent',JSON[_0x57a5('0x14')](_0x4f5436));if(_0x4f5436[_0x57a5('0x15')]){if(_0x4f5436[_0x57a5('0x15')][_0x57a5('0x16')]===0x1f4){logger[_0x57a5('0x15')](_0x57a5('0x10'),_0x4a1d89,_0x4f5436[_0x57a5('0x15')][_0x57a5('0x17')]);return _0x107a74(_0x4f5436[_0x57a5('0x15')][_0x57a5('0x17')]);}logger['error']('Team,\x20%s,\x20%s',_0x4a1d89,_0x4f5436[_0x57a5('0x15')]['message']);return _0x4e728(_0x4f5436['error'][_0x57a5('0x17')]);}else{logger[_0x57a5('0xf')]('Team,\x20%s,\x20%s',_0x4a1d89,_0x57a5('0x11'));_0x4e728(_0x4f5436[_0x57a5('0x18')][_0x57a5('0x17')]);}})['catch'](function(_0x29079c){logger[_0x57a5('0x15')]('Team,\x20%s,\x20%s',_0x4a1d89,_0x29079c);_0x107a74(_0x29079c);});});} \ No newline at end of file +var _0x2308=['rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x4f69a4,_0x195038){var _0x3c074f=function(_0x47b431){while(--_0x47b431){_0x4f69a4['push'](_0x4f69a4['shift']());}};_0x3c074f(++_0x195038);}(_0x2308,0x193));var _0x8230=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x2308[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x8230('0x0'));var util=require(_0x8230('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8230('0x2'));var fs=require('fs');var Redis=require(_0x8230('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8230('0x4'))(_0x8230('0x5'));var config=require(_0x8230('0x6'));var jayson=require(_0x8230('0x7'));var client=jayson['client'][_0x8230('0x8')]({'port':0x232a});config[_0x8230('0x9')]=_['defaults'](config[_0x8230('0x9')],{'host':_0x8230('0xa'),'port':0x18eb});var socket=require(_0x8230('0xb'))(new Redis(config[_0x8230('0x9')]));require(_0x8230('0xc'))[_0x8230('0xd')](socket);function respondWithRpcPromise(_0x30297e,_0x336982,_0x7b2549){return new BPromise(function(_0x53e377,_0x39aaf8){return client[_0x8230('0xe')](_0x30297e,_0x7b2549)[_0x8230('0xf')](function(_0x18f6ae){logger['info'](_0x8230('0x10'),_0x336982,_0x8230('0x11'));logger['debug'](_0x8230('0x12'),_0x336982,_0x8230('0x11'),JSON[_0x8230('0x13')](_0x18f6ae));if(_0x18f6ae[_0x8230('0x14')]){if(_0x18f6ae['error'][_0x8230('0x15')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x336982,_0x18f6ae[_0x8230('0x14')][_0x8230('0x16')]);return _0x39aaf8(_0x18f6ae[_0x8230('0x14')][_0x8230('0x16')]);}logger[_0x8230('0x14')](_0x8230('0x10'),_0x336982,_0x18f6ae[_0x8230('0x14')]['message']);return _0x53e377(_0x18f6ae[_0x8230('0x14')][_0x8230('0x16')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x336982,'request\x20sent');_0x53e377(_0x18f6ae['result'][_0x8230('0x16')]);}})[_0x8230('0x17')](function(_0xab8702){logger[_0x8230('0x14')]('Team,\x20%s,\x20%s',_0x336982,_0xab8702);_0x39aaf8(_0xab8702);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4248115..9d151f9 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 _0xdbc7=['update','emit','removeListener','register','length','./team.events','save','remove'];(function(_0x31f38d,_0x489f01){var _0x253a5d=function(_0x282bdd){while(--_0x282bdd){_0x31f38d['push'](_0x31f38d['shift']());}};_0x253a5d(++_0x489f01);}(_0xdbc7,0x1c5));var _0x7dbc=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xdbc7[_0x8b8564];return _0x360c61;};'use strict';var TeamEvents=require(_0x7dbc('0x0'));var events=[_0x7dbc('0x1'),_0x7dbc('0x2'),_0x7dbc('0x3')];function createListener(_0xf736ff,_0x57bca2){return function(_0x42121f){_0x57bca2[_0x7dbc('0x4')](_0xf736ff,_0x42121f);};}function removeListener(_0x43f504,_0x1e0d86){return function(){TeamEvents[_0x7dbc('0x5')](_0x43f504,_0x1e0d86);};}exports[_0x7dbc('0x6')]=function(_0x321f4c){for(var _0x147978=0x0,_0x22b6dd=events[_0x7dbc('0x7')];_0x147978<_0x22b6dd;_0x147978++){var _0x1f994b=events[_0x147978];var _0x23edac=createListener('team:'+_0x1f994b,_0x321f4c);TeamEvents['on'](_0x1f994b,_0x23edac);}}; \ No newline at end of file +var _0x56fc=['update','emit','removeListener','register','length','team:','./team.events','remove'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x56fc,0x13e));var _0xc56f=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x56fc[_0x42245d];return _0x4b211a;};'use strict';var TeamEvents=require(_0xc56f('0x0'));var events=['save',_0xc56f('0x1'),_0xc56f('0x2')];function createListener(_0x2fe616,_0x2eaef7){return function(_0x2c2077){_0x2eaef7[_0xc56f('0x3')](_0x2fe616,_0x2c2077);};}function removeListener(_0x4e3a6b,_0x2284f9){return function(){TeamEvents[_0xc56f('0x4')](_0x4e3a6b,_0x2284f9);};}exports[_0xc56f('0x5')]=function(_0x2d65c6){for(var _0x2bccdd=0x0,_0x4e2ffa=events[_0xc56f('0x6')];_0x2bccdd<_0x4e2ffa;_0x2bccdd++){var _0x12e9ba=events[_0x2bccdd];var _0x53ed7d=createListener(_0xc56f('0x7')+_0x12e9ba,_0x2d65c6);TeamEvents['on'](_0x12e9ba,_0x53ed7d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 32430f8..c4b249f 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 _0xb7d1=['INTEGER','sequelize','exports'];(function(_0x5675b8,_0x4b7997){var _0x3de7d9=function(_0x31b13c){while(--_0x31b13c){_0x5675b8['push'](_0x5675b8['shift']());}};_0x3de7d9(++_0x4b7997);}(_0xb7d1,0x79));var _0x1b7d=function(_0x568971,_0x1da1d5){_0x568971=_0x568971-0x0;var _0x32cf07=_0xb7d1[_0x568971];return _0x32cf07;};'use strict';var Sequelize=require(_0x1b7d('0x0'));module[_0x1b7d('0x1')]={'TeamId':{'type':Sequelize[_0x1b7d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1b7d('0x2')]}}; \ No newline at end of file +var _0x323f=['exports','INTEGER'];(function(_0x660bf7,_0x18d86a){var _0x46dbbe=function(_0x3b35e3){while(--_0x3b35e3){_0x660bf7['push'](_0x660bf7['shift']());}};_0x46dbbe(++_0x18d86a);}(_0x323f,0xde));var _0xf323=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x323f[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf323('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index df8b0bd..e40363d 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 _0x92d7=['team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0xbb907f,_0x2f8893){var _0x5f283f=function(_0x19243a){while(--_0x19243a){_0xbb907f['push'](_0xbb907f['shift']());}};_0x5f283f(++_0x2f8893);}(_0x92d7,0x17b));var _0x792d=function(_0x36665b,_0x5eb174){_0x36665b=_0x36665b-0x0;var _0x130718=_0x92d7[_0x36665b];return _0x130718;};'use strict';var _=require(_0x792d('0x0'));var util=require('util');var logger=require(_0x792d('0x1'))(_0x792d('0x2'));var moment=require(_0x792d('0x3'));var BPromise=require(_0x792d('0x4'));var rp=require(_0x792d('0x5'));var fs=require('fs');var path=require(_0x792d('0x6'));var rimraf=require(_0x792d('0x7'));var config=require(_0x792d('0x8'));var attributes=require(_0x792d('0x9'));module[_0x792d('0xa')]=function(_0x54374f,_0x3e95c4){return _0x54374f[_0x792d('0xb')](_0x792d('0xc'),attributes,{'tableName':_0x792d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad13=['exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x86d177,_0x2190aa){var _0x431f6e=function(_0x42b64d){while(--_0x42b64d){_0x86d177['push'](_0x86d177['shift']());}};_0x431f6e(++_0x2190aa);}(_0xad13,0x79));var _0x3ad1=function(_0x4fe777,_0x40dec8){_0x4fe777=_0x4fe777-0x0;var _0x2a3437=_0xad13[_0x4fe777];return _0x2a3437;};'use strict';var _=require(_0x3ad1('0x0'));var util=require('util');var logger=require(_0x3ad1('0x1'))(_0x3ad1('0x2'));var moment=require(_0x3ad1('0x3'));var BPromise=require(_0x3ad1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ad1('0x5'));var rimraf=require(_0x3ad1('0x6'));var config=require(_0x3ad1('0x7'));var attributes=require(_0x3ad1('0x8'));module[_0x3ad1('0x9')]=function(_0x416e30,_0x42ab5c){return _0x416e30[_0x3ad1('0xa')](_0x3ad1('0xb'),attributes,{'tableName':_0x3ad1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 9fa405c..06b3c39 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d28fb,_0x836241){var _0x21a96b=function(_0x54728f){while(--_0x54728f){_0x4d28fb['push'](_0x4d28fb['shift']());}};_0x21a96b(++_0x836241);}(_0xe706,0xa3));var _0x6e70=function(_0x10a8d8,_0x28f292){_0x10a8d8=_0x10a8d8-0x0;var _0x3b2b79=_0xe706[_0x10a8d8];return _0x3b2b79;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a8ba3,_0x241a7c){var _0xabbf58=function(_0x5108e2){while(--_0x5108e2){_0x4a8ba3['push'](_0x4a8ba3['shift']());}};_0xabbf58(++_0x241a7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0xcb91[_0x1cb0b4];return _0x525b60;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d859bd3..188c08e 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 _0x6c70=['exports'];(function(_0x26a19f,_0x353729){var _0x19c7c1=function(_0x4414f5){while(--_0x4414f5){_0x26a19f['push'](_0x26a19f['shift']());}};_0x19c7c1(++_0x353729);}(_0x6c70,0x1f0));var _0x06c7=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x6c70[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require('sequelize');module[_0x06c7('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c0c=['sequelize','exports','INTEGER'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x3c0c,0x162));var _0xc3c0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3c0c[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xc3c0('0x0'));module[_0xc3c0('0x1')]={'penalty':{'type':Sequelize[_0xc3c0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index dfa1ff0..e7b130a 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 _0xd04b=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd04b,0x145));var _0xbd04=function(_0x5c6726,_0x56521d){_0x5c6726=_0x5c6726-0x0;var _0x1564f1=_0xd04b[_0x5c6726];return _0x1564f1;};'use strict';var _=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var logger=require(_0xbd04('0x2'))('api');var moment=require(_0xbd04('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd04('0x4'));var fs=require('fs');var path=require(_0xbd04('0x5'));var rimraf=require(_0xbd04('0x6'));var config=require(_0xbd04('0x7'));var attributes=require(_0xbd04('0x8'));module[_0xbd04('0x9')]=function(_0x11d6ce,_0x2d8811){return _0x11d6ce[_0xbd04('0xa')](_0xbd04('0xb'),attributes,{'tableName':_0xbd04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09dd=['exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09dd,0x81));var _0xd09d=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0x09dd[_0x32f05c];return _0x4307ed;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require(_0xd09d('0x9'));var attributes=require(_0xd09d('0xa'));module[_0xd09d('0xb')]=function(_0x3410c4,_0x2034af){return _0x3410c4['define'](_0xd09d('0xc'),attributes,{'tableName':_0xd09d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1b02b02..d65aef2 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 _0x4814=['http','request','info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x599528,_0x1aecab){var _0xffa44e=function(_0x464303){while(--_0x464303){_0x599528['push'](_0x599528['shift']());}};_0xffa44e(++_0x1aecab);}(_0x4814,0xde));var _0x4481=function(_0x269e12,_0x590953){_0x269e12=_0x269e12-0x0;var _0x400d6e=_0x4814[_0x269e12];return _0x400d6e;};'use strict';var _=require(_0x4481('0x0'));var util=require(_0x4481('0x1'));var moment=require(_0x4481('0x2'));var BPromise=require('bluebird');var rs=require(_0x4481('0x3'));var fs=require('fs');var Redis=require(_0x4481('0x4'));var db=require(_0x4481('0x5'))['db'];var utils=require(_0x4481('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4481('0x7'));var jayson=require(_0x4481('0x8'));var client=jayson['client'][_0x4481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x136ddf,_0x3f505f,_0x15c99a){return new BPromise(function(_0x31ab8c,_0xd1a6ef){return client[_0x4481('0xa')](_0x136ddf,_0x15c99a)['then'](function(_0x1fa3f7){logger[_0x4481('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3f505f,_0x4481('0xc'));logger[_0x4481('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3f505f,_0x4481('0xc'),JSON[_0x4481('0xe')](_0x1fa3f7));if(_0x1fa3f7[_0x4481('0xf')]){if(_0x1fa3f7[_0x4481('0xf')][_0x4481('0x10')]===0x1f4){logger[_0x4481('0xf')](_0x4481('0x11'),_0x3f505f,_0x1fa3f7[_0x4481('0xf')]['message']);return _0xd1a6ef(_0x1fa3f7['error'][_0x4481('0x12')]);}logger[_0x4481('0xf')](_0x4481('0x11'),_0x3f505f,_0x1fa3f7[_0x4481('0xf')][_0x4481('0x12')]);return _0x31ab8c(_0x1fa3f7['error'][_0x4481('0x12')]);}else{logger['info'](_0x4481('0x11'),_0x3f505f,'request\x20sent');_0x31ab8c(_0x1fa3f7[_0x4481('0x13')][_0x4481('0x12')]);}})[_0x4481('0x14')](function(_0x45450f){logger[_0x4481('0xf')](_0x4481('0x11'),_0x3f505f,_0x45450f);_0xd1a6ef(_0x45450f);});});} \ No newline at end of file +var _0x34ec=['stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3d0f6e,_0x4e6073){var _0x5be963=function(_0x59f02e){while(--_0x59f02e){_0x3d0f6e['push'](_0x3d0f6e['shift']());}};_0x5be963(++_0x4e6073);}(_0x34ec,0x180));var _0xc34e=function(_0x3d6ea2,_0x540398){_0x3d6ea2=_0x3d6ea2-0x0;var _0x1cc376=_0x34ec[_0x3d6ea2];return _0x1cc376;};'use strict';var _=require(_0xc34e('0x0'));var util=require('util');var moment=require(_0xc34e('0x1'));var BPromise=require(_0xc34e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc34e('0x3'));var db=require(_0xc34e('0x4'))['db'];var utils=require(_0xc34e('0x5'));var logger=require(_0xc34e('0x6'))(_0xc34e('0x7'));var config=require('../../config/environment');var jayson=require(_0xc34e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f193d,_0x295ac0,_0x13a2d2){return new BPromise(function(_0x21ee8b,_0x2fc582){return client[_0xc34e('0x9')](_0x3f193d,_0x13a2d2)['then'](function(_0x2ce096){logger[_0xc34e('0xa')](_0xc34e('0xb'),_0x295ac0,_0xc34e('0xc'));logger[_0xc34e('0xd')](_0xc34e('0xe'),_0x295ac0,_0xc34e('0xc'),JSON[_0xc34e('0xf')](_0x2ce096));if(_0x2ce096[_0xc34e('0x10')]){if(_0x2ce096[_0xc34e('0x10')][_0xc34e('0x11')]===0x1f4){logger['error'](_0xc34e('0xb'),_0x295ac0,_0x2ce096[_0xc34e('0x10')]['message']);return _0x2fc582(_0x2ce096['error'][_0xc34e('0x12')]);}logger[_0xc34e('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x295ac0,_0x2ce096['error']['message']);return _0x21ee8b(_0x2ce096['error'][_0xc34e('0x12')]);}else{logger[_0xc34e('0xa')](_0xc34e('0xb'),_0x295ac0,_0xc34e('0xc'));_0x21ee8b(_0x2ce096[_0xc34e('0x13')][_0xc34e('0x12')]);}})[_0xc34e('0x14')](function(_0x926745){logger['error'](_0xc34e('0xb'),_0x295ac0,_0x926745);_0x2fc582(_0x926745);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9b277f1..f3b2cce 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 _0xad5f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xad5f,0x1a8));var _0xfad5=function(_0x1c29b3,_0x442dd4){_0x1c29b3=_0x1c29b3-0x0;var _0x6485da=_0xad5f[_0x1c29b3];return _0x6485da;};'use strict';var multer=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var path=require(_0xfad5('0x2'));var timeout=require(_0xfad5('0x3'));var express=require(_0xfad5('0x4'));var router=express[_0xfad5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfad5('0x6'));var interaction=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var controller=require(_0xfad5('0x9'));router[_0xfad5('0xa')]('/',auth[_0xfad5('0xb')](),controller[_0xfad5('0xc')]);router['get'](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0xe')]);router[_0xfad5('0xf')]('/',auth['isAuthenticated'](),controller[_0xfad5('0x10')]);router[_0xfad5('0x11')](_0xfad5('0xd'),auth[_0xfad5('0xb')](),controller[_0xfad5('0x12')]);router[_0xfad5('0x13')](_0xfad5('0xd'),auth['isAuthenticated'](),controller[_0xfad5('0x14')]);module[_0xfad5('0x15')]=router; \ No newline at end of file +var _0xeda7=['/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0x331615,_0x13aebd){var _0x4ba773=function(_0x577243){while(--_0x577243){_0x331615['push'](_0x331615['shift']());}};_0x4ba773(++_0x13aebd);}(_0xeda7,0x196));var _0x7eda=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xeda7[_0xd0b415];return _0x2bdf2c;};'use strict';var multer=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var path=require(_0x7eda('0x2'));var timeout=require(_0x7eda('0x3'));var express=require(_0x7eda('0x4'));var router=express[_0x7eda('0x5')]();var fs_extra=require(_0x7eda('0x6'));var auth=require(_0x7eda('0x7'));var interaction=require(_0x7eda('0x8'));var config=require(_0x7eda('0x9'));var controller=require(_0x7eda('0xa'));router[_0x7eda('0xb')]('/',auth[_0x7eda('0xc')](),controller[_0x7eda('0xd')]);router[_0x7eda('0xb')](_0x7eda('0xe'),auth[_0x7eda('0xc')](),controller[_0x7eda('0xf')]);router[_0x7eda('0x10')]('/',auth[_0x7eda('0xc')](),controller['create']);router[_0x7eda('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7eda('0x12')]);router[_0x7eda('0x13')](_0x7eda('0xe'),auth[_0x7eda('0xc')](),controller['destroy']);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 3d37ffd..d23d93c 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 _0x0397=['exports','STRING','sequelize'];(function(_0x538a4a,_0x1a1316){var _0x158c6b=function(_0x30ef4a){while(--_0x30ef4a){_0x538a4a['push'](_0x538a4a['shift']());}};_0x158c6b(++_0x1a1316);}(_0x0397,0xb0));var _0x7039=function(_0x2cba09,_0x23ee85){_0x2cba09=_0x2cba09-0x0;var _0x10d084=_0x0397[_0x2cba09];return _0x10d084;};'use strict';var Sequelize=require(_0x7039('0x0'));module[_0x7039('0x1')]={'name':{'type':Sequelize[_0x7039('0x2')]},'description':{'type':Sequelize[_0x7039('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd56c=['exports','STRING'];(function(_0x4d2ca0,_0x4382de){var _0xc5d27b=function(_0x158db9){while(--_0x158db9){_0x4d2ca0['push'](_0x4d2ca0['shift']());}};_0xc5d27b(++_0x4382de);}(_0xd56c,0x116));var _0xcd56=function(_0x30bc39,_0x2260c6){_0x30bc39=_0x30bc39-0x0;var _0x1d6dde=_0xd56c[_0x30bc39];return _0x1d6dde;};'use strict';var Sequelize=require('sequelize');module[_0xcd56('0x0')]={'name':{'type':Sequelize[_0xcd56('0x1')]},'description':{'type':Sequelize[_0xcd56('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3bf4ebf..6562984 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 _0xa5de=['filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x46385b,_0x551346){var _0x2de0dd=function(_0x4b1799){while(--_0x4b1799){_0x46385b['push'](_0x46385b['shift']());}};_0x2de0dd(++_0x551346);}(_0xa5de,0xbd));var _0xea5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5de[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xea5d('0x1'));var moment=require(_0xea5d('0x2'));var BPromise=require(_0xea5d('0x3'));var Mustache=require(_0xea5d('0x4'));var util=require(_0xea5d('0x5'));var path=require(_0xea5d('0x6'));var sox=require(_0xea5d('0x7'));var csv=require(_0xea5d('0x8'));var ejs=require(_0xea5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea5d('0xa'));var squel=require(_0xea5d('0xb'));var crypto=require(_0xea5d('0xc'));var jsforce=require(_0xea5d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea5d('0xe'));var Redis=require(_0xea5d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xea5d('0x10'));var as=require(_0xea5d('0x11'));var hardwareService=require(_0xea5d('0x12'));var logger=require(_0xea5d('0x13'))(_0xea5d('0x14'));var utils=require(_0xea5d('0x15'));var config=require(_0xea5d('0x16'));var licenseUtil=require(_0xea5d('0x17'));var db=require(_0xea5d('0x18'))['db'];function respondWithStatusCode(_0x5e3165,_0x291644){_0x291644=_0x291644||0xcc;return function(_0x38a96b){if(_0x38a96b){return _0x5e3165[_0xea5d('0x19')](_0x291644);}return _0x5e3165['status'](_0x291644)[_0xea5d('0x1a')]();};}function respondWithResult(_0x188050,_0xb4212){_0xb4212=_0xb4212||0xc8;return function(_0x55aac9){if(_0x55aac9){return _0x188050[_0xea5d('0x1b')](_0xb4212)['json'](_0x55aac9);}};}function respondWithFilteredResult(_0x2949b9,_0x22d1d2){return function(_0x1f97fe){if(_0x1f97fe){var _0x516ec4=typeof _0x22d1d2[_0xea5d('0x1c')]===_0xea5d('0x1d')&&typeof _0x22d1d2[_0xea5d('0x1e')]==='undefined';var _0x210537=_0x1f97fe[_0xea5d('0x1f')];var _0x3c3527=_0x516ec4?0x0:_0x22d1d2[_0xea5d('0x1c')];var _0x45d007=_0x516ec4?_0x1f97fe['count']:_0x22d1d2[_0xea5d('0x1c')]+_0x22d1d2['limit'];var _0x26835c;if(_0x45d007>=_0x210537){_0x45d007=_0x210537;_0x26835c=0xc8;}else{_0x26835c=0xce;}_0x2949b9['status'](_0x26835c);return _0x2949b9[_0xea5d('0x20')](_0xea5d('0x21'),_0x3c3527+'-'+_0x45d007+'/'+_0x210537)[_0xea5d('0x22')](_0x1f97fe);}return null;};}function patchUpdates(_0x2f0079){return function(_0x3507cd){try{jsonpatch[_0xea5d('0x23')](_0x3507cd,_0x2f0079,!![]);}catch(_0x1315d3){return BPromise[_0xea5d('0x24')](_0x1315d3);}return _0x3507cd['save']();};}function saveUpdates(_0x10a0e7,_0x59a937){return function(_0x9e1ddc){if(_0x9e1ddc){return _0x9e1ddc[_0xea5d('0x25')](_0x10a0e7)[_0xea5d('0x26')](function(_0x3ab5dd){return _0x3ab5dd;});}return null;};}function removeEntity(_0x1c667c,_0x1caf81){return function(_0x343538){if(_0x343538){return _0x343538[_0xea5d('0x27')]()[_0xea5d('0x26')](function(){var _0x509254=_0x343538[_0xea5d('0x28')]({'plain':!![]});var _0x2469ee=_0xea5d('0x29');return db[_0xea5d('0x2a')][_0xea5d('0x27')]({'where':{'type':_0x2469ee,'resourceId':_0x509254['id']}})['then'](function(){return _0x343538;});})[_0xea5d('0x26')](function(){_0x1c667c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c3f3,_0x47fe8c){return function(_0x43383f){if(!_0x43383f){_0x18c3f3[_0xea5d('0x19')](0x194);}return _0x43383f;};}function handleError(_0x54625e,_0x3cb10b){_0x3cb10b=_0x3cb10b||0x1f4;return function(_0x3c010d){logger[_0xea5d('0x2b')](_0x3c010d[_0xea5d('0x2c')]);if(_0x3c010d['name']){delete _0x3c010d[_0xea5d('0x2d')];}_0x54625e[_0xea5d('0x1b')](_0x3cb10b)[_0xea5d('0x2e')](_0x3c010d);};}exports[_0xea5d('0x2f')]=function(_0x39f53e,_0x37c433){var _0x29c26a={},_0x3d5246={},_0x12a343={'count':0x0,'rows':[]};var _0x16d5cc=_[_0xea5d('0x30')](db[_0xea5d('0x31')][_0xea5d('0x32')],function(_0x1dc689){return{'name':_0x1dc689[_0xea5d('0x33')],'type':_0x1dc689['type'][_0xea5d('0x34')]};});_0x3d5246[_0xea5d('0x35')]=_[_0xea5d('0x30')](_0x16d5cc,_0xea5d('0x2d'));_0x3d5246[_0xea5d('0x36')]=_[_0xea5d('0x37')](_0x39f53e['query']);_0x3d5246['filters']=_[_0xea5d('0x38')](_0x3d5246[_0xea5d('0x35')],_0x3d5246[_0xea5d('0x36')]);_0x29c26a[_0xea5d('0x39')]=_[_0xea5d('0x38')](_0x3d5246[_0xea5d('0x35')],qs[_0xea5d('0x3a')](_0x39f53e[_0xea5d('0x36')]['fields']));_0x29c26a[_0xea5d('0x39')]=_0x29c26a['attributes'][_0xea5d('0x3b')]?_0x29c26a[_0xea5d('0x39')]:_0x3d5246['model'];if(!_0x39f53e['query'][_0xea5d('0x3c')](_0xea5d('0x3d'))){_0x29c26a[_0xea5d('0x1e')]=qs[_0xea5d('0x1e')](_0x39f53e[_0xea5d('0x36')][_0xea5d('0x1e')]);_0x29c26a[_0xea5d('0x1c')]=qs[_0xea5d('0x1c')](_0x39f53e[_0xea5d('0x36')]['offset']);}_0x29c26a[_0xea5d('0x3e')]=qs[_0xea5d('0x3f')](_0x39f53e['query'][_0xea5d('0x3f')]);_0x29c26a[_0xea5d('0x40')]=qs['filters'](_[_0xea5d('0x41')](_0x39f53e[_0xea5d('0x36')],_0x3d5246[_0xea5d('0x42')]),_0x16d5cc);if(_0x39f53e[_0xea5d('0x36')][_0xea5d('0x43')]){_0x29c26a[_0xea5d('0x40')]=_[_0xea5d('0x44')](_0x29c26a[_0xea5d('0x40')],{'$or':_['map'](_0x16d5cc,function(_0x1eaad1){if(_0x1eaad1['type']!==_0xea5d('0x45')){var _0x469e11={};_0x469e11[_0x1eaad1[_0xea5d('0x2d')]]={'$like':'%'+_0x39f53e['query'][_0xea5d('0x43')]+'%'};return _0x469e11;}})});}_0x29c26a=_[_0xea5d('0x44')]({},_0x29c26a,_0x39f53e[_0xea5d('0x46')]);var _0x3c4905={'where':_0x29c26a[_0xea5d('0x40')]};return db[_0xea5d('0x31')][_0xea5d('0x1f')](_0x3c4905)[_0xea5d('0x26')](function(_0x3fe323){_0x12a343[_0xea5d('0x1f')]=_0x3fe323;if(_0x39f53e['query'][_0xea5d('0x47')]){_0x29c26a[_0xea5d('0x48')]=[{'all':!![]}];}return db['Template'][_0xea5d('0x49')](_0x29c26a);})[_0xea5d('0x26')](function(_0x357fcd){_0x12a343[_0xea5d('0x4a')]=_0x357fcd;return _0x12a343;})[_0xea5d('0x26')](respondWithFilteredResult(_0x37c433,_0x29c26a))[_0xea5d('0x4b')](handleError(_0x37c433,null));};exports[_0xea5d('0x4c')]=function(_0x1a9771,_0x14ca7a){var _0x396449={'raw':!![],'where':{'id':_0x1a9771[_0xea5d('0x4d')]['id']}},_0x494347={};_0x494347[_0xea5d('0x35')]=_[_0xea5d('0x37')](db[_0xea5d('0x31')]['rawAttributes']);_0x494347[_0xea5d('0x36')]=_[_0xea5d('0x37')](_0x1a9771['query']);_0x494347['filters']=_['intersection'](_0x494347[_0xea5d('0x35')],_0x494347[_0xea5d('0x36')]);_0x396449[_0xea5d('0x39')]=_['intersection'](_0x494347['model'],qs[_0xea5d('0x3a')](_0x1a9771[_0xea5d('0x36')]['fields']));_0x396449['attributes']=_0x396449[_0xea5d('0x39')][_0xea5d('0x3b')]?_0x396449[_0xea5d('0x39')]:_0x494347['model'];if(_0x1a9771[_0xea5d('0x36')][_0xea5d('0x47')]){_0x396449[_0xea5d('0x48')]=[{'all':!![]}];}_0x396449=_['merge']({},_0x396449,_0x1a9771[_0xea5d('0x46')]);return db[_0xea5d('0x31')]['find'](_0x396449)[_0xea5d('0x26')](handleEntityNotFound(_0x14ca7a,null))[_0xea5d('0x26')](respondWithResult(_0x14ca7a,null))[_0xea5d('0x4b')](handleError(_0x14ca7a,null));};exports[_0xea5d('0x4e')]=function(_0x3573a9,_0x4a2f74){return db[_0xea5d('0x31')][_0xea5d('0x4e')](_0x3573a9['body'],{})[_0xea5d('0x26')](function(_0x53c713){var _0x415c13=_0x3573a9[_0xea5d('0x4f')][_0xea5d('0x28')]({'plain':!![]});if(!_0x415c13)throw new Error(_0xea5d('0x50'));if(_0x415c13['role']===_0xea5d('0x4f')){var _0x497b1e=_0x53c713[_0xea5d('0x28')]({'plain':!![]});var _0x24e9b1=_0xea5d('0x29');return db['UserProfileSection'][_0xea5d('0x51')]({'where':{'name':_0x24e9b1,'userProfileId':_0x415c13[_0xea5d('0x52')]},'raw':!![]})[_0xea5d('0x26')](function(_0x5d2aee){if(_0x5d2aee&&_0x5d2aee['autoAssociation']===0x0){return db['UserProfileResource'][_0xea5d('0x4e')]({'name':_0x497b1e[_0xea5d('0x2d')],'resourceId':_0x497b1e['id'],'type':_0x5d2aee[_0xea5d('0x2d')],'sectionId':_0x5d2aee['id']},{})['then'](function(){return _0x53c713;});}else{return _0x53c713;}})[_0xea5d('0x4b')](function(_0x40957a){logger['error'](_0xea5d('0x53'),_0x40957a);throw _0x40957a;});}return _0x53c713;})['then'](respondWithResult(_0x4a2f74,0xc9))[_0xea5d('0x4b')](handleError(_0x4a2f74,null));};exports[_0xea5d('0x25')]=function(_0x39ff40,_0x503cd8){if(_0x39ff40[_0xea5d('0x54')]['id']){delete _0x39ff40[_0xea5d('0x54')]['id'];}return db[_0xea5d('0x31')]['find']({'where':{'id':_0x39ff40['params']['id']}})[_0xea5d('0x26')](handleEntityNotFound(_0x503cd8,null))[_0xea5d('0x26')](saveUpdates(_0x39ff40[_0xea5d('0x54')],null))[_0xea5d('0x26')](respondWithResult(_0x503cd8,null))[_0xea5d('0x4b')](handleError(_0x503cd8,null));};exports[_0xea5d('0x27')]=function(_0x21b187,_0x1f701a){return db['Template'][_0xea5d('0x51')]({'where':{'id':_0x21b187[_0xea5d('0x4d')]['id']}})[_0xea5d('0x26')](handleEntityNotFound(_0x1f701a,null))[_0xea5d('0x26')](removeEntity(_0x1f701a,null))[_0xea5d('0x4b')](handleError(_0x1f701a,null));}; \ No newline at end of file +var _0xe136=['../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','Templates','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Template','count','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe136,0x13e));var _0x6e13=function(_0x1504c1,_0x239016){_0x1504c1=_0x1504c1-0x0;var _0x376a2a=_0xe136[_0x1504c1];return _0x376a2a;};'use strict';var emlformat=require(_0x6e13('0x0'));var rimraf=require(_0x6e13('0x1'));var zipdir=require(_0x6e13('0x2'));var jsonpatch=require(_0x6e13('0x3'));var rp=require(_0x6e13('0x4'));var moment=require(_0x6e13('0x5'));var BPromise=require(_0x6e13('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e13('0x7'));var sox=require(_0x6e13('0x8'));var csv=require(_0x6e13('0x9'));var ejs=require(_0x6e13('0xa'));var fs=require('fs');var fs_extra=require(_0x6e13('0xb'));var _=require(_0x6e13('0xc'));var squel=require(_0x6e13('0xd'));var crypto=require(_0x6e13('0xe'));var jsforce=require(_0x6e13('0xf'));var deskjs=require(_0x6e13('0x10'));var toCsv=require(_0x6e13('0x9'));var querystring=require(_0x6e13('0x11'));var Papa=require(_0x6e13('0x12'));var Redis=require('ioredis');var authService=require(_0x6e13('0x13'));var qs=require(_0x6e13('0x14'));var as=require(_0x6e13('0x15'));var hardwareService=require(_0x6e13('0x16'));var logger=require(_0x6e13('0x17'))(_0x6e13('0x18'));var utils=require(_0x6e13('0x19'));var config=require(_0x6e13('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219a8e,_0x574ce9){_0x574ce9=_0x574ce9||0xcc;return function(_0x3deda3){if(_0x3deda3){return _0x219a8e[_0x6e13('0x1b')](_0x574ce9);}return _0x219a8e[_0x6e13('0x1c')](_0x574ce9)[_0x6e13('0x1d')]();};}function respondWithResult(_0x468368,_0x346ff4){_0x346ff4=_0x346ff4||0xc8;return function(_0x5e863f){if(_0x5e863f){return _0x468368[_0x6e13('0x1c')](_0x346ff4)[_0x6e13('0x1e')](_0x5e863f);}};}function respondWithFilteredResult(_0x1606f4,_0x542447){return function(_0x4701a2){if(_0x4701a2){var _0x274e9d=typeof _0x542447[_0x6e13('0x1f')]===_0x6e13('0x20')&&typeof _0x542447[_0x6e13('0x21')]===_0x6e13('0x20');var _0x16df36=_0x4701a2['count'];var _0x477a2c=_0x274e9d?0x0:_0x542447[_0x6e13('0x1f')];var _0x5c8e9f=_0x274e9d?_0x4701a2['count']:_0x542447[_0x6e13('0x1f')]+_0x542447[_0x6e13('0x21')];var _0x22c1ba;if(_0x5c8e9f>=_0x16df36){_0x5c8e9f=_0x16df36;_0x22c1ba=0xc8;}else{_0x22c1ba=0xce;}_0x1606f4[_0x6e13('0x1c')](_0x22c1ba);return _0x1606f4[_0x6e13('0x22')]('Content-Range',_0x477a2c+'-'+_0x5c8e9f+'/'+_0x16df36)[_0x6e13('0x1e')](_0x4701a2);}return null;};}function patchUpdates(_0x3a06d2){return function(_0x3bb6b1){try{jsonpatch[_0x6e13('0x23')](_0x3bb6b1,_0x3a06d2,!![]);}catch(_0x464126){return BPromise[_0x6e13('0x24')](_0x464126);}return _0x3bb6b1[_0x6e13('0x25')]();};}function saveUpdates(_0x3ec8c4,_0x2462dd){return function(_0x4cdaf4){if(_0x4cdaf4){return _0x4cdaf4[_0x6e13('0x26')](_0x3ec8c4)[_0x6e13('0x27')](function(_0x58f278){return _0x58f278;});}return null;};}function removeEntity(_0x1025ff,_0x556c0b){return function(_0xe607c5){if(_0xe607c5){return _0xe607c5[_0x6e13('0x28')]()[_0x6e13('0x27')](function(){var _0x17fc61=_0xe607c5[_0x6e13('0x29')]({'plain':!![]});var _0x30c574=_0x6e13('0x2a');return db['UserProfileResource'][_0x6e13('0x28')]({'where':{'type':_0x30c574,'resourceId':_0x17fc61['id']}})['then'](function(){return _0xe607c5;});})['then'](function(){_0x1025ff[_0x6e13('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47600b,_0x2ca93e){return function(_0x37f36c){if(!_0x37f36c){_0x47600b['sendStatus'](0x194);}return _0x37f36c;};}function handleError(_0x8c2ee,_0x5c7a95){_0x5c7a95=_0x5c7a95||0x1f4;return function(_0x27f2a1){logger[_0x6e13('0x2b')](_0x27f2a1[_0x6e13('0x2c')]);if(_0x27f2a1['name']){delete _0x27f2a1[_0x6e13('0x2d')];}_0x8c2ee['status'](_0x5c7a95)[_0x6e13('0x2e')](_0x27f2a1);};}exports['index']=function(_0x14f861,_0x4dfbda){var _0x5414a5={},_0x128df1={},_0xbb73ec={'count':0x0,'rows':[]};var _0x1c8015=_['map'](db['Template'][_0x6e13('0x2f')],function(_0x5d5be8){return{'name':_0x5d5be8['fieldName'],'type':_0x5d5be8[_0x6e13('0x30')][_0x6e13('0x31')]};});_0x128df1[_0x6e13('0x32')]=_[_0x6e13('0x33')](_0x1c8015,'name');_0x128df1[_0x6e13('0x34')]=_[_0x6e13('0x35')](_0x14f861[_0x6e13('0x34')]);_0x128df1[_0x6e13('0x36')]=_['intersection'](_0x128df1[_0x6e13('0x32')],_0x128df1[_0x6e13('0x34')]);_0x5414a5[_0x6e13('0x37')]=_[_0x6e13('0x38')](_0x128df1[_0x6e13('0x32')],qs[_0x6e13('0x39')](_0x14f861[_0x6e13('0x34')]['fields']));_0x5414a5[_0x6e13('0x37')]=_0x5414a5[_0x6e13('0x37')][_0x6e13('0x3a')]?_0x5414a5['attributes']:_0x128df1[_0x6e13('0x32')];if(!_0x14f861[_0x6e13('0x34')][_0x6e13('0x3b')](_0x6e13('0x3c'))){_0x5414a5[_0x6e13('0x21')]=qs[_0x6e13('0x21')](_0x14f861[_0x6e13('0x34')][_0x6e13('0x21')]);_0x5414a5[_0x6e13('0x1f')]=qs[_0x6e13('0x1f')](_0x14f861[_0x6e13('0x34')]['offset']);}_0x5414a5[_0x6e13('0x3d')]=qs[_0x6e13('0x3e')](_0x14f861['query']['sort']);_0x5414a5[_0x6e13('0x3f')]=qs[_0x6e13('0x36')](_[_0x6e13('0x40')](_0x14f861['query'],_0x128df1[_0x6e13('0x36')]),_0x1c8015);if(_0x14f861[_0x6e13('0x34')]['filter']){_0x5414a5[_0x6e13('0x3f')]=_[_0x6e13('0x41')](_0x5414a5['where'],{'$or':_[_0x6e13('0x33')](_0x1c8015,function(_0x509cbb){if(_0x509cbb[_0x6e13('0x30')]!==_0x6e13('0x42')){var _0x168ad2={};_0x168ad2[_0x509cbb[_0x6e13('0x2d')]]={'$like':'%'+_0x14f861['query'][_0x6e13('0x43')]+'%'};return _0x168ad2;}})});}_0x5414a5=_[_0x6e13('0x41')]({},_0x5414a5,_0x14f861[_0x6e13('0x44')]);var _0x4b8468={'where':_0x5414a5['where']};return db[_0x6e13('0x45')][_0x6e13('0x46')](_0x4b8468)['then'](function(_0x27f67c){_0xbb73ec[_0x6e13('0x46')]=_0x27f67c;if(_0x14f861['query']['includeAll']){_0x5414a5[_0x6e13('0x47')]=[{'all':!![]}];}return db[_0x6e13('0x45')][_0x6e13('0x48')](_0x5414a5);})[_0x6e13('0x27')](function(_0x7585ca){_0xbb73ec['rows']=_0x7585ca;return _0xbb73ec;})[_0x6e13('0x27')](respondWithFilteredResult(_0x4dfbda,_0x5414a5))[_0x6e13('0x49')](handleError(_0x4dfbda,null));};exports['show']=function(_0x4e5978,_0x31a88b){var _0x1e1eb8={'raw':!![],'where':{'id':_0x4e5978[_0x6e13('0x4a')]['id']}},_0x4bd8b3={};_0x4bd8b3[_0x6e13('0x32')]=_[_0x6e13('0x35')](db[_0x6e13('0x45')]['rawAttributes']);_0x4bd8b3['query']=_['keys'](_0x4e5978[_0x6e13('0x34')]);_0x4bd8b3[_0x6e13('0x36')]=_[_0x6e13('0x38')](_0x4bd8b3[_0x6e13('0x32')],_0x4bd8b3[_0x6e13('0x34')]);_0x1e1eb8[_0x6e13('0x37')]=_[_0x6e13('0x38')](_0x4bd8b3[_0x6e13('0x32')],qs[_0x6e13('0x39')](_0x4e5978[_0x6e13('0x34')][_0x6e13('0x39')]));_0x1e1eb8[_0x6e13('0x37')]=_0x1e1eb8[_0x6e13('0x37')][_0x6e13('0x3a')]?_0x1e1eb8[_0x6e13('0x37')]:_0x4bd8b3[_0x6e13('0x32')];if(_0x4e5978[_0x6e13('0x34')]['includeAll']){_0x1e1eb8['include']=[{'all':!![]}];}_0x1e1eb8=_[_0x6e13('0x41')]({},_0x1e1eb8,_0x4e5978[_0x6e13('0x44')]);return db['Template']['find'](_0x1e1eb8)['then'](handleEntityNotFound(_0x31a88b,null))['then'](respondWithResult(_0x31a88b,null))[_0x6e13('0x49')](handleError(_0x31a88b,null));};exports['create']=function(_0x20fd2f,_0xa28f69){return db[_0x6e13('0x45')][_0x6e13('0x4b')](_0x20fd2f[_0x6e13('0x4c')],{})['then'](function(_0x51633c){var _0x417a8f=_0x20fd2f[_0x6e13('0x4d')]['get']({'plain':!![]});if(!_0x417a8f)throw new Error(_0x6e13('0x4e'));if(_0x417a8f[_0x6e13('0x4f')]===_0x6e13('0x4d')){var _0x5cb9ed=_0x51633c[_0x6e13('0x29')]({'plain':!![]});var _0xfc80d4=_0x6e13('0x2a');return db[_0x6e13('0x50')][_0x6e13('0x51')]({'where':{'name':_0xfc80d4,'userProfileId':_0x417a8f[_0x6e13('0x52')]},'raw':!![]})[_0x6e13('0x27')](function(_0x586cb7){if(_0x586cb7&&_0x586cb7[_0x6e13('0x53')]===0x0){return db[_0x6e13('0x54')][_0x6e13('0x4b')]({'name':_0x5cb9ed['name'],'resourceId':_0x5cb9ed['id'],'type':_0x586cb7[_0x6e13('0x2d')],'sectionId':_0x586cb7['id']},{})[_0x6e13('0x27')](function(){return _0x51633c;});}else{return _0x51633c;}})['catch'](function(_0x2de01b){logger['error'](_0x6e13('0x55'),_0x2de01b);throw _0x2de01b;});}return _0x51633c;})[_0x6e13('0x27')](respondWithResult(_0xa28f69,0xc9))[_0x6e13('0x49')](handleError(_0xa28f69,null));};exports[_0x6e13('0x26')]=function(_0x26ff79,_0x4b1a36){if(_0x26ff79[_0x6e13('0x4c')]['id']){delete _0x26ff79[_0x6e13('0x4c')]['id'];}return db[_0x6e13('0x45')][_0x6e13('0x51')]({'where':{'id':_0x26ff79['params']['id']}})[_0x6e13('0x27')](handleEntityNotFound(_0x4b1a36,null))[_0x6e13('0x27')](saveUpdates(_0x26ff79['body'],null))[_0x6e13('0x27')](respondWithResult(_0x4b1a36,null))[_0x6e13('0x49')](handleError(_0x4b1a36,null));};exports[_0x6e13('0x28')]=function(_0x4970f6,_0x4771c0){return db[_0x6e13('0x45')][_0x6e13('0x51')]({'where':{'id':_0x4970f6[_0x6e13('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4771c0,null))[_0x6e13('0x27')](removeEntity(_0x4771c0,null))['catch'](handleError(_0x4771c0,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 7e3b69c..58fea78 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 _0xbd0f=['api','moment','bluebird','request-promise','path','rimraf','exports','define','Template','lodash','util','../../config/logger'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xbd0f,0x129));var _0xfbd0=function(_0x57df88,_0x30797a){_0x57df88=_0x57df88-0x0;var _0x11a2cb=_0xbd0f[_0x57df88];return _0x11a2cb;};'use strict';var _=require(_0xfbd0('0x0'));var util=require(_0xfbd0('0x1'));var logger=require(_0xfbd0('0x2'))(_0xfbd0('0x3'));var moment=require(_0xfbd0('0x4'));var BPromise=require(_0xfbd0('0x5'));var rp=require(_0xfbd0('0x6'));var fs=require('fs');var path=require(_0xfbd0('0x7'));var rimraf=require(_0xfbd0('0x8'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0xfbd0('0x9')]=function(_0x395186,_0x500fea){return _0x395186[_0xfbd0('0xa')](_0xfbd0('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f20=['moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template','lodash','util','api'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x2f20,0xe1));var _0x02f2=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x2f20[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x02f2('0x0'));var util=require(_0x02f2('0x1'));var logger=require('../../config/logger')(_0x02f2('0x2'));var moment=require(_0x02f2('0x3'));var BPromise=require(_0x02f2('0x4'));var rp=require(_0x02f2('0x5'));var fs=require('fs');var path=require(_0x02f2('0x6'));var rimraf=require(_0x02f2('0x7'));var config=require('../../config/environment');var attributes=require(_0x02f2('0x8'));module[_0x02f2('0x9')]=function(_0x13b7d5,_0x51a26d){return _0x13b7d5[_0x02f2('0xa')](_0x02f2('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 083dde0..07a8433 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 _0x77ff=['findAll','options','raw','attributes','limit','map','include','model','GetTemplate','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','Template'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x77ff,0x168));var _0xf77f=function(_0x13ff4f,_0x4defc2){_0x13ff4f=_0x13ff4f-0x0;var _0xd04dee=_0x77ff[_0x13ff4f];return _0xd04dee;};'use strict';var _=require('lodash');var util=require(_0xf77f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf77f('0x1'))['db'];var utils=require(_0xf77f('0x2'));var logger=require(_0xf77f('0x3'))('rpc');var config=require(_0xf77f('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf77f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4f689e,_0x594382,_0x9df472){return new BPromise(function(_0x120174,_0x39b60b){return client['request'](_0x4f689e,_0x9df472)[_0xf77f('0x6')](function(_0xc9bcf7){logger['info'](_0xf77f('0x7'),_0x594382,_0xf77f('0x8'));logger[_0xf77f('0x9')](_0xf77f('0xa'),_0x594382,_0xf77f('0x8'),JSON[_0xf77f('0xb')](_0xc9bcf7));if(_0xc9bcf7[_0xf77f('0xc')]){if(_0xc9bcf7['error']['code']===0x1f4){logger[_0xf77f('0xc')](_0xf77f('0x7'),_0x594382,_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);return _0x39b60b(_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);}logger['error'](_0xf77f('0x7'),_0x594382,_0xc9bcf7['error']['message']);return _0x120174(_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);}else{logger[_0xf77f('0xe')](_0xf77f('0x7'),_0x594382,_0xf77f('0x8'));_0x120174(_0xc9bcf7[_0xf77f('0xf')][_0xf77f('0xd')]);}})[_0xf77f('0x10')](function(_0x350b1b){logger['error'](_0xf77f('0x7'),_0x594382,_0x350b1b);_0x39b60b(_0x350b1b);});});}exports['GetTemplate']=function(_0x2c8447){var _0x384b4a=this;return new Promise(function(_0x11aa2f,_0x7f137){return db[_0xf77f('0x11')][_0xf77f('0x12')]({'raw':_0x2c8447[_0xf77f('0x13')]?_0x2c8447[_0xf77f('0x13')][_0xf77f('0x14')]===undefined?!![]:![]:!![],'where':_0x2c8447[_0xf77f('0x13')]?_0x2c8447[_0xf77f('0x13')]['where']||null:null,'attributes':_0x2c8447['options']?_0x2c8447['options'][_0xf77f('0x15')]||null:null,'limit':_0x2c8447[_0xf77f('0x13')]?_0x2c8447['options'][_0xf77f('0x16')]||null:null,'include':_0x2c8447['options']?_0x2c8447[_0xf77f('0x13')]['include']?_[_0xf77f('0x17')](_0x2c8447[_0xf77f('0x13')][_0xf77f('0x18')],function(_0x16527a){return{'model':db[_0x16527a[_0xf77f('0x19')]],'as':_0x16527a['as'],'attributes':_0x16527a[_0xf77f('0x15')],'include':_0x16527a['include']?_[_0xf77f('0x17')](_0x16527a[_0xf77f('0x18')],function(_0x427c55){return{'model':db[_0x427c55['model']],'as':_0x427c55['as'],'attributes':_0x427c55[_0xf77f('0x15')],'include':_0x427c55['include']?_[_0xf77f('0x17')](_0x427c55['include'],function(_0x5aab21){return{'model':db[_0x5aab21['model']],'as':_0x5aab21['as'],'attributes':_0x5aab21['attributes']};}):[]};}):[]};}):[]:[]})[_0xf77f('0x6')](function(_0x20780e){logger['info'](_0xf77f('0x1a'),_0x2c8447);logger[_0xf77f('0x9')]('GetTemplate',_0x2c8447,JSON['stringify'](_0x20780e));_0x11aa2f(_0x20780e);})[_0xf77f('0x10')](function(_0x492cd2){logger[_0xf77f('0xc')]('GetTemplate',_0x492cd2[_0xf77f('0xd')],_0x2c8447);_0x7f137(_0x384b4a[_0xf77f('0xc')](0x1f4,_0x492cd2[_0xf77f('0xd')]));});});}; \ No newline at end of file +var _0xcf71=['info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','GetTemplate','Template','findAll','options','where','attributes','limit','include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xcf71,0x13e));var _0x1cf7=function(_0x1198a7,_0x58ca47){_0x1198a7=_0x1198a7-0x0;var _0x34e937=_0xcf71[_0x1198a7];return _0x34e937;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var moment=require(_0x1cf7('0x2'));var BPromise=require(_0x1cf7('0x3'));var rs=require(_0x1cf7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cf7('0x5'))['db'];var utils=require(_0x1cf7('0x6'));var logger=require(_0x1cf7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1cf7('0x8'));var client=jayson[_0x1cf7('0x9')][_0x1cf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39d303,_0x5bfc56,_0x2d84f4){return new BPromise(function(_0x43f82f,_0x1e4377){return client['request'](_0x39d303,_0x2d84f4)[_0x1cf7('0xb')](function(_0x493aae){logger[_0x1cf7('0xc')](_0x1cf7('0xd'),_0x5bfc56,'request\x20sent');logger[_0x1cf7('0xe')](_0x1cf7('0xf'),_0x5bfc56,'request\x20sent',JSON['stringify'](_0x493aae));if(_0x493aae[_0x1cf7('0x10')]){if(_0x493aae[_0x1cf7('0x10')][_0x1cf7('0x11')]===0x1f4){logger[_0x1cf7('0x10')](_0x1cf7('0xd'),_0x5bfc56,_0x493aae[_0x1cf7('0x10')][_0x1cf7('0x12')]);return _0x1e4377(_0x493aae[_0x1cf7('0x10')][_0x1cf7('0x12')]);}logger[_0x1cf7('0x10')]('Template,\x20%s,\x20%s',_0x5bfc56,_0x493aae[_0x1cf7('0x10')][_0x1cf7('0x12')]);return _0x43f82f(_0x493aae[_0x1cf7('0x10')]['message']);}else{logger[_0x1cf7('0xc')](_0x1cf7('0xd'),_0x5bfc56,_0x1cf7('0x13'));_0x43f82f(_0x493aae[_0x1cf7('0x14')]['message']);}})['catch'](function(_0x53f7ab){logger[_0x1cf7('0x10')](_0x1cf7('0xd'),_0x5bfc56,_0x53f7ab);_0x1e4377(_0x53f7ab);});});}exports[_0x1cf7('0x15')]=function(_0x364bfe){var _0x553b9b=this;return new Promise(function(_0x667160,_0x109fae){return db[_0x1cf7('0x16')][_0x1cf7('0x17')]({'raw':_0x364bfe[_0x1cf7('0x18')]?_0x364bfe[_0x1cf7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x364bfe[_0x1cf7('0x18')]?_0x364bfe['options'][_0x1cf7('0x19')]||null:null,'attributes':_0x364bfe[_0x1cf7('0x18')]?_0x364bfe[_0x1cf7('0x18')][_0x1cf7('0x1a')]||null:null,'limit':_0x364bfe[_0x1cf7('0x18')]?_0x364bfe['options'][_0x1cf7('0x1b')]||null:null,'include':_0x364bfe['options']?_0x364bfe[_0x1cf7('0x18')]['include']?_['map'](_0x364bfe['options'][_0x1cf7('0x1c')],function(_0x552314){return{'model':db[_0x552314[_0x1cf7('0x1d')]],'as':_0x552314['as'],'attributes':_0x552314[_0x1cf7('0x1a')],'include':_0x552314[_0x1cf7('0x1c')]?_['map'](_0x552314[_0x1cf7('0x1c')],function(_0x4ce4f1){return{'model':db[_0x4ce4f1[_0x1cf7('0x1d')]],'as':_0x4ce4f1['as'],'attributes':_0x4ce4f1[_0x1cf7('0x1a')],'include':_0x4ce4f1[_0x1cf7('0x1c')]?_[_0x1cf7('0x1e')](_0x4ce4f1['include'],function(_0x194506){return{'model':db[_0x194506[_0x1cf7('0x1d')]],'as':_0x194506['as'],'attributes':_0x194506[_0x1cf7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1cf7('0xb')](function(_0x318956){logger[_0x1cf7('0xc')](_0x1cf7('0x15'),_0x364bfe);logger[_0x1cf7('0xe')](_0x1cf7('0x15'),_0x364bfe,JSON[_0x1cf7('0x1f')](_0x318956));_0x667160(_0x318956);})[_0x1cf7('0x20')](function(_0x15caca){logger[_0x1cf7('0x10')]('GetTemplate',_0x15caca[_0x1cf7('0x12')],_0x364bfe);_0x109fae(_0x553b9b[_0x1cf7('0x10')](0x1f4,_0x15caca['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 296f65c..232793e 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 _0xc04a=['/:id','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','addAllCondition','addAnyCondition','/:id/actions','put'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xac04('0x0'));var util=require('util');var path=require(_0xac04('0x1'));var timeout=require('connect-timeout');var express=require(_0xac04('0x2'));var router=express[_0xac04('0x3')]();var fs_extra=require(_0xac04('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac04('0x5'));var config=require(_0xac04('0x6'));var controller=require(_0xac04('0x7'));router[_0xac04('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xac04('0x9')](),controller[_0xac04('0xa')]);router[_0xac04('0x8')](_0xac04('0xb'),auth[_0xac04('0x9')](),controller[_0xac04('0xc')]);router[_0xac04('0x8')](_0xac04('0xd'),auth[_0xac04('0x9')](),controller['getAnyConditions']);router[_0xac04('0x8')]('/:id/actions',auth[_0xac04('0x9')](),controller[_0xac04('0xe')]);router[_0xac04('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/all_conditions',auth[_0xac04('0x9')](),controller[_0xac04('0x10')]);router[_0xac04('0xf')]('/:id/any_conditions',auth[_0xac04('0x9')](),controller[_0xac04('0x11')]);router['post'](_0xac04('0x12'),auth[_0xac04('0x9')](),controller['addAction']);router[_0xac04('0x13')](_0xac04('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xac04('0x15')]('/:id',auth[_0xac04('0x9')](),controller['destroy']);module[_0xac04('0x16')]=router; \ No newline at end of file +var _0x10d6=['show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','addAllCondition','addAnyCondition','addAction','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated'];(function(_0x2c6082,_0x1fab7e){var _0x392dbb=function(_0x19c8c6){while(--_0x19c8c6){_0x2c6082['push'](_0x2c6082['shift']());}};_0x392dbb(++_0x1fab7e);}(_0x10d6,0x145));var _0x610d=function(_0xd002c,_0x1d09d3){_0xd002c=_0xd002c-0x0;var _0x59c130=_0x10d6[_0xd002c];return _0x59c130;};'use strict';var multer=require('multer');var util=require(_0x610d('0x0'));var path=require(_0x610d('0x1'));var timeout=require(_0x610d('0x2'));var express=require('express');var router=express[_0x610d('0x3')]();var fs_extra=require(_0x610d('0x4'));var auth=require(_0x610d('0x5'));var interaction=require(_0x610d('0x6'));var config=require(_0x610d('0x7'));var controller=require(_0x610d('0x8'));router[_0x610d('0x9')]('/',auth['isAuthenticated'](),controller[_0x610d('0xa')]);router[_0x610d('0x9')](_0x610d('0xb'),auth[_0x610d('0xc')](),controller[_0x610d('0xd')]);router[_0x610d('0x9')](_0x610d('0xe'),auth[_0x610d('0xc')](),controller[_0x610d('0xf')]);router[_0x610d('0x9')](_0x610d('0x10'),auth[_0x610d('0xc')](),controller[_0x610d('0x11')]);router[_0x610d('0x9')]('/:id/actions',auth[_0x610d('0xc')](),controller[_0x610d('0x12')]);router['post']('/',auth[_0x610d('0xc')](),controller[_0x610d('0x13')]);router['post'](_0x610d('0xe'),auth[_0x610d('0xc')](),controller[_0x610d('0x14')]);router['post'](_0x610d('0x10'),auth[_0x610d('0xc')](),controller[_0x610d('0x15')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0x610d('0x16')]);router[_0x610d('0x17')](_0x610d('0xb'),auth['isAuthenticated'](),controller[_0x610d('0x18')]);router['delete'](_0x610d('0xb'),auth[_0x610d('0xc')](),controller[_0x610d('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 6b8d48c..7f22be9 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 _0xd07b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xd07b,0xfc));var _0xbd07=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd07b[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xbd07('0x0'));module[_0xbd07('0x1')]={'name':{'type':Sequelize[_0xbd07('0x2')]},'channel':{'type':Sequelize[_0xbd07('0x2')]},'description':{'type':Sequelize[_0xbd07('0x2')]},'status':{'type':Sequelize[_0xbd07('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9147=['exports','STRING','BOOLEAN','sequelize'];(function(_0x13459e,_0x566bab){var _0x372e16=function(_0x597e56){while(--_0x597e56){_0x13459e['push'](_0x13459e['shift']());}};_0x372e16(++_0x566bab);}(_0x9147,0x7f));var _0x7914=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9147[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7914('0x0'));module[_0x7914('0x1')]={'name':{'type':Sequelize[_0x7914('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7914('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 f442cc2..b5214ef 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 _0xa793=['include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','addAction','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys'];(function(_0x5aa2bd,_0x5c445b){var _0x52bcba=function(_0x4acf1f){while(--_0x4acf1f){_0x5aa2bd['push'](_0x5aa2bd['shift']());}};_0x52bcba(++_0x5c445b);}(_0xa793,0xd9));var _0x3a79=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xa793[_0x5d6c3e];return _0x44ecb7;};'use strict';var emlformat=require(_0x3a79('0x0'));var rimraf=require(_0x3a79('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a79('0x2'));var moment=require(_0x3a79('0x3'));var BPromise=require(_0x3a79('0x4'));var Mustache=require(_0x3a79('0x5'));var util=require('util');var path=require(_0x3a79('0x6'));var sox=require(_0x3a79('0x7'));var csv=require(_0x3a79('0x8'));var ejs=require(_0x3a79('0x9'));var fs=require('fs');var fs_extra=require(_0x3a79('0xa'));var _=require(_0x3a79('0xb'));var squel=require(_0x3a79('0xc'));var crypto=require(_0x3a79('0xd'));var jsforce=require(_0x3a79('0xe'));var deskjs=require(_0x3a79('0xf'));var toCsv=require(_0x3a79('0x8'));var querystring=require(_0x3a79('0x10'));var Papa=require(_0x3a79('0x11'));var Redis=require(_0x3a79('0x12'));var authService=require(_0x3a79('0x13'));var qs=require(_0x3a79('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a79('0x15'))(_0x3a79('0x16'));var utils=require(_0x3a79('0x17'));var config=require(_0x3a79('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a79('0x19'))['db'];function respondWithStatusCode(_0x2c787a,_0x3c2c40){_0x3c2c40=_0x3c2c40||0xcc;return function(_0x56c8ea){if(_0x56c8ea){return _0x2c787a[_0x3a79('0x1a')](_0x3c2c40);}return _0x2c787a[_0x3a79('0x1b')](_0x3c2c40)[_0x3a79('0x1c')]();};}function respondWithResult(_0x4dd8d3,_0x3279bb){_0x3279bb=_0x3279bb||0xc8;return function(_0x18af05){if(_0x18af05){return _0x4dd8d3[_0x3a79('0x1b')](_0x3279bb)[_0x3a79('0x1d')](_0x18af05);}};}function respondWithFilteredResult(_0x303b5d,_0x35f4dd){return function(_0x2594af){if(_0x2594af){var _0x1e81f8=typeof _0x35f4dd[_0x3a79('0x1e')]===_0x3a79('0x1f')&&typeof _0x35f4dd['limit']===_0x3a79('0x1f');var _0x6cdacb=_0x2594af[_0x3a79('0x20')];var _0x259ce4=_0x1e81f8?0x0:_0x35f4dd[_0x3a79('0x1e')];var _0x201d69=_0x1e81f8?_0x2594af[_0x3a79('0x20')]:_0x35f4dd[_0x3a79('0x1e')]+_0x35f4dd[_0x3a79('0x21')];var _0x2dc84a;if(_0x201d69>=_0x6cdacb){_0x201d69=_0x6cdacb;_0x2dc84a=0xc8;}else{_0x2dc84a=0xce;}_0x303b5d[_0x3a79('0x1b')](_0x2dc84a);return _0x303b5d[_0x3a79('0x22')](_0x3a79('0x23'),_0x259ce4+'-'+_0x201d69+'/'+_0x6cdacb)[_0x3a79('0x1d')](_0x2594af);}return null;};}function patchUpdates(_0x61998b){return function(_0x52fea9){try{jsonpatch[_0x3a79('0x24')](_0x52fea9,_0x61998b,!![]);}catch(_0x499547){return BPromise['reject'](_0x499547);}return _0x52fea9[_0x3a79('0x25')]();};}function saveUpdates(_0x35b992,_0x5699e5){return function(_0x239fa8){if(_0x239fa8){return _0x239fa8[_0x3a79('0x26')](_0x35b992)[_0x3a79('0x27')](function(_0x5de951){return _0x5de951;});}return null;};}function removeEntity(_0x1f2d56,_0x4227a7){return function(_0x469d8a){if(_0x469d8a){return _0x469d8a['destroy']()[_0x3a79('0x27')](function(){var _0x28a2b7=_0x469d8a[_0x3a79('0x28')]({'plain':!![]});var _0x1a3a06=_0x3a79('0x29');return db[_0x3a79('0x2a')]['destroy']({'where':{'type':_0x1a3a06,'resourceId':_0x28a2b7['id']}})[_0x3a79('0x27')](function(){return _0x469d8a;});})[_0x3a79('0x27')](function(){_0x1f2d56[_0x3a79('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af717,_0x283287){return function(_0x3d33ab){if(!_0x3d33ab){_0x4af717[_0x3a79('0x1a')](0x194);}return _0x3d33ab;};}function handleError(_0x17edff,_0x46036b){_0x46036b=_0x46036b||0x1f4;return function(_0x37bd1b){logger[_0x3a79('0x2b')](_0x37bd1b[_0x3a79('0x2c')]);if(_0x37bd1b[_0x3a79('0x2d')]){delete _0x37bd1b[_0x3a79('0x2d')];}_0x17edff['status'](_0x46036b)[_0x3a79('0x2e')](_0x37bd1b);};}exports[_0x3a79('0x2f')]=function(_0x59a912,_0x5afd36){var _0x53f11b={},_0xb45e26={},_0x3df6b3={'count':0x0,'rows':[]};var _0x6989f=_[_0x3a79('0x30')](db[_0x3a79('0x31')][_0x3a79('0x32')],function(_0x2ba1eb){return{'name':_0x2ba1eb[_0x3a79('0x33')],'type':_0x2ba1eb[_0x3a79('0x34')][_0x3a79('0x35')]};});_0xb45e26[_0x3a79('0x36')]=_[_0x3a79('0x30')](_0x6989f,_0x3a79('0x2d'));_0xb45e26[_0x3a79('0x37')]=_['keys'](_0x59a912[_0x3a79('0x37')]);_0xb45e26[_0x3a79('0x38')]=_[_0x3a79('0x39')](_0xb45e26['model'],_0xb45e26[_0x3a79('0x37')]);_0x53f11b[_0x3a79('0x3a')]=_[_0x3a79('0x39')](_0xb45e26[_0x3a79('0x36')],qs[_0x3a79('0x3b')](_0x59a912[_0x3a79('0x37')][_0x3a79('0x3b')]));_0x53f11b['attributes']=_0x53f11b[_0x3a79('0x3a')][_0x3a79('0x3c')]?_0x53f11b[_0x3a79('0x3a')]:_0xb45e26[_0x3a79('0x36')];if(!_0x59a912[_0x3a79('0x37')][_0x3a79('0x3d')](_0x3a79('0x3e'))){_0x53f11b[_0x3a79('0x21')]=qs[_0x3a79('0x21')](_0x59a912[_0x3a79('0x37')][_0x3a79('0x21')]);_0x53f11b[_0x3a79('0x1e')]=qs[_0x3a79('0x1e')](_0x59a912['query'][_0x3a79('0x1e')]);}_0x53f11b[_0x3a79('0x3f')]=qs['sort'](_0x59a912[_0x3a79('0x37')][_0x3a79('0x40')]);_0x53f11b[_0x3a79('0x41')]=qs[_0x3a79('0x38')](_[_0x3a79('0x42')](_0x59a912[_0x3a79('0x37')],_0xb45e26[_0x3a79('0x38')]),_0x6989f);if(_0x59a912[_0x3a79('0x37')][_0x3a79('0x43')]){_0x53f11b[_0x3a79('0x41')]=_[_0x3a79('0x44')](_0x53f11b[_0x3a79('0x41')],{'$or':_[_0x3a79('0x30')](_0x6989f,function(_0x2501b5){if(_0x2501b5[_0x3a79('0x34')]!==_0x3a79('0x45')){var _0x4c1e18={};_0x4c1e18[_0x2501b5[_0x3a79('0x2d')]]={'$like':'%'+_0x59a912[_0x3a79('0x37')]['filter']+'%'};return _0x4c1e18;}})});}_0x53f11b=_[_0x3a79('0x44')]({},_0x53f11b,_0x59a912[_0x3a79('0x46')]);var _0x3cb4fc={'where':_0x53f11b[_0x3a79('0x41')]};return db[_0x3a79('0x31')][_0x3a79('0x20')](_0x3cb4fc)[_0x3a79('0x27')](function(_0x2a252d){_0x3df6b3[_0x3a79('0x20')]=_0x2a252d;if(_0x59a912[_0x3a79('0x37')][_0x3a79('0x47')]){_0x53f11b['include']=[{'all':!![]}];}return db['Trigger'][_0x3a79('0x48')](_0x53f11b);})[_0x3a79('0x27')](function(_0x1ec1aa){_0x3df6b3[_0x3a79('0x49')]=_0x1ec1aa;return _0x3df6b3;})[_0x3a79('0x27')](respondWithFilteredResult(_0x5afd36,_0x53f11b))[_0x3a79('0x4a')](handleError(_0x5afd36,null));};exports[_0x3a79('0x4b')]=function(_0x487b23,_0x25a539){var _0x509a87={'raw':![],'where':{'id':_0x487b23['params']['id']}},_0x303a82={};_0x303a82[_0x3a79('0x36')]=_[_0x3a79('0x4c')](db[_0x3a79('0x31')][_0x3a79('0x32')]);_0x303a82['query']=_[_0x3a79('0x4c')](_0x487b23['query']);_0x303a82[_0x3a79('0x38')]=_[_0x3a79('0x39')](_0x303a82[_0x3a79('0x36')],_0x303a82[_0x3a79('0x37')]);_0x509a87[_0x3a79('0x3a')]=_[_0x3a79('0x39')](_0x303a82['model'],qs[_0x3a79('0x3b')](_0x487b23['query']['fields']));_0x509a87[_0x3a79('0x3a')]=_0x509a87[_0x3a79('0x3a')][_0x3a79('0x3c')]?_0x509a87[_0x3a79('0x3a')]:_0x303a82[_0x3a79('0x36')];if(_0x487b23['query']['includeAll']){_0x509a87[_0x3a79('0x4d')]=[{'all':!![]}];}_0x509a87=_[_0x3a79('0x44')]({},_0x509a87,_0x487b23[_0x3a79('0x46')]);return db[_0x3a79('0x31')][_0x3a79('0x4e')](_0x509a87)['then'](handleEntityNotFound(_0x25a539,null))[_0x3a79('0x27')](respondWithResult(_0x25a539,null))[_0x3a79('0x4a')](handleError(_0x25a539,null));};exports[_0x3a79('0x4f')]=function(_0x1d871e,_0x28398e){return db[_0x3a79('0x31')]['create'](_0x1d871e[_0x3a79('0x50')],{})[_0x3a79('0x27')](function(_0x5a96be){var _0x375a6d=_0x1d871e[_0x3a79('0x51')][_0x3a79('0x28')]({'plain':!![]});if(!_0x375a6d)throw new Error(_0x3a79('0x52'));if(_0x375a6d[_0x3a79('0x53')]===_0x3a79('0x51')){var _0x4da52c=_0x5a96be[_0x3a79('0x28')]({'plain':!![]});var _0x104ac6=_0x3a79('0x29');return db[_0x3a79('0x54')][_0x3a79('0x4e')]({'where':{'name':_0x104ac6,'userProfileId':_0x375a6d[_0x3a79('0x55')]},'raw':!![]})['then'](function(_0x58c779){if(_0x58c779&&_0x58c779['autoAssociation']===0x0){return db[_0x3a79('0x2a')][_0x3a79('0x4f')]({'name':_0x4da52c[_0x3a79('0x2d')],'resourceId':_0x4da52c['id'],'type':_0x58c779['name'],'sectionId':_0x58c779['id']},{})[_0x3a79('0x27')](function(){return _0x5a96be;});}else{return _0x5a96be;}})['catch'](function(_0x5a6469){logger[_0x3a79('0x2b')](_0x3a79('0x56'),_0x5a6469);throw _0x5a6469;});}return _0x5a96be;})[_0x3a79('0x27')](respondWithResult(_0x28398e,0xc9))[_0x3a79('0x4a')](handleError(_0x28398e,null));};exports['update']=function(_0x23cd66,_0x742dad){if(_0x23cd66[_0x3a79('0x50')]['id']){delete _0x23cd66[_0x3a79('0x50')]['id'];}return db[_0x3a79('0x31')]['find']({'where':{'id':_0x23cd66['params']['id']}})[_0x3a79('0x27')](handleEntityNotFound(_0x742dad,null))[_0x3a79('0x27')](saveUpdates(_0x23cd66[_0x3a79('0x50')],null))['then'](respondWithResult(_0x742dad,null))[_0x3a79('0x4a')](handleError(_0x742dad,null));};exports['destroy']=function(_0x37e9e9,_0x22e8ec){return db['Trigger'][_0x3a79('0x4e')]({'where':{'id':_0x37e9e9['params']['id']}})['then'](handleEntityNotFound(_0x22e8ec,null))[_0x3a79('0x27')](removeEntity(_0x22e8ec,null))[_0x3a79('0x4a')](handleError(_0x22e8ec,null));};exports[_0x3a79('0x57')]=function(_0x1731fe,_0x5b7f00,_0x4f3aa0){if(_0x1731fe[_0x3a79('0x50')]['id']){delete _0x1731fe[_0x3a79('0x50')]['id'];}return db[_0x3a79('0x31')][_0x3a79('0x4e')]({'where':{'id':_0x1731fe[_0x3a79('0x58')]['id']}})[_0x3a79('0x27')](handleEntityNotFound(_0x5b7f00,null))[_0x3a79('0x27')](function(_0x152c53){if(_0x152c53){_0x1731fe['body'][_0x3a79('0x59')]=_0x152c53['id'];return db[_0x3a79('0x5a')][_0x3a79('0x4f')](_0x1731fe[_0x3a79('0x50')]);}})[_0x3a79('0x27')](respondWithResult(_0x5b7f00,null))[_0x3a79('0x4a')](handleError(_0x5b7f00,null));};exports[_0x3a79('0x5b')]=function(_0x3aaf85,_0x1df832,_0x4364d3){if(_0x3aaf85[_0x3a79('0x50')]['id']){delete _0x3aaf85['body']['id'];}return db[_0x3a79('0x31')][_0x3a79('0x4e')]({'where':{'id':_0x3aaf85[_0x3a79('0x58')]['id']}})[_0x3a79('0x27')](handleEntityNotFound(_0x1df832,null))[_0x3a79('0x27')](function(_0x310161){if(_0x310161){_0x3aaf85[_0x3a79('0x50')][_0x3a79('0x5c')]=_0x310161['id'];return db[_0x3a79('0x5a')]['create'](_0x3aaf85['body']);}})['then'](respondWithResult(_0x1df832,null))[_0x3a79('0x4a')](handleError(_0x1df832,null));};exports[_0x3a79('0x5d')]=function(_0x3b4688,_0x392e2e,_0x1f04ee){var _0x3a8580={};var _0x106e46={};var _0x55a449;var _0x536106;return db['Trigger'][_0x3a79('0x5e')]({'where':{'id':_0x3b4688[_0x3a79('0x58')]['id']}})['then'](handleEntityNotFound(_0x392e2e,null))['then'](function(_0x1f215b){if(_0x1f215b){_0x55a449=_0x1f215b;_0x106e46[_0x3a79('0x36')]=_[_0x3a79('0x4c')](db[_0x3a79('0x5a')][_0x3a79('0x32')]);_0x106e46[_0x3a79('0x37')]=_['keys'](_0x3b4688['query']);_0x106e46[_0x3a79('0x38')]=_['intersection'](_0x106e46[_0x3a79('0x36')],_0x106e46[_0x3a79('0x37')]);_0x3a8580[_0x3a79('0x3a')]=_[_0x3a79('0x39')](_0x106e46[_0x3a79('0x36')],qs[_0x3a79('0x3b')](_0x3b4688[_0x3a79('0x37')][_0x3a79('0x3b')]));_0x3a8580[_0x3a79('0x3a')]=_0x3a8580['attributes'][_0x3a79('0x3c')]?_0x3a8580['attributes']:_0x106e46[_0x3a79('0x36')];_0x3a8580[_0x3a79('0x3f')]=qs[_0x3a79('0x40')](_0x3b4688['query'][_0x3a79('0x40')]);_0x3a8580['where']=qs[_0x3a79('0x38')](_['pick'](_0x3b4688[_0x3a79('0x37')],_0x106e46['filters']));if(_0x3b4688[_0x3a79('0x37')]['filter']){_0x3a8580[_0x3a79('0x41')]=_[_0x3a79('0x44')](_0x3a8580[_0x3a79('0x41')],{'$or':_[_0x3a79('0x30')](_0x3a8580['attributes'],function(_0x442cde){var _0x12784e={};_0x12784e[_0x442cde]={'$like':'%'+_0x3b4688[_0x3a79('0x37')][_0x3a79('0x43')]+'%'};return _0x12784e;})});}_0x3a8580=_[_0x3a79('0x44')]({},_0x3a8580,_0x3b4688[_0x3a79('0x46')]);return _0x55a449[_0x3a79('0x5d')](_0x3a8580);}})[_0x3a79('0x27')](function(_0x457ff3){if(_0x457ff3){_0x536106=_0x457ff3[_0x3a79('0x3c')];if(!_0x3b4688['query'][_0x3a79('0x3d')]('nolimit')){_0x3a8580[_0x3a79('0x21')]=qs['limit'](_0x3b4688['query'][_0x3a79('0x21')]);_0x3a8580[_0x3a79('0x1e')]=qs[_0x3a79('0x1e')](_0x3b4688[_0x3a79('0x37')][_0x3a79('0x1e')]);}return _0x55a449[_0x3a79('0x5d')](_0x3a8580);}})[_0x3a79('0x27')](function(_0x198058){if(_0x198058){return _0x198058?{'count':_0x536106,'rows':_0x198058}:null;}})['then'](respondWithResult(_0x392e2e,null))[_0x3a79('0x4a')](handleError(_0x392e2e,null));};exports['getAnyConditions']=function(_0x3459a1,_0xe74689,_0x220e9b){var _0x128b34={};var _0x4b566a={};var _0x790a8;var _0x1ff6d3;return db[_0x3a79('0x31')]['findOne']({'where':{'id':_0x3459a1[_0x3a79('0x58')]['id']}})[_0x3a79('0x27')](handleEntityNotFound(_0xe74689,null))['then'](function(_0x2f5002){if(_0x2f5002){_0x790a8=_0x2f5002;_0x4b566a[_0x3a79('0x36')]=_[_0x3a79('0x4c')](db[_0x3a79('0x5a')][_0x3a79('0x32')]);_0x4b566a[_0x3a79('0x37')]=_[_0x3a79('0x4c')](_0x3459a1['query']);_0x4b566a['filters']=_[_0x3a79('0x39')](_0x4b566a[_0x3a79('0x36')],_0x4b566a[_0x3a79('0x37')]);_0x128b34['attributes']=_[_0x3a79('0x39')](_0x4b566a[_0x3a79('0x36')],qs[_0x3a79('0x3b')](_0x3459a1[_0x3a79('0x37')]['fields']));_0x128b34['attributes']=_0x128b34['attributes'][_0x3a79('0x3c')]?_0x128b34[_0x3a79('0x3a')]:_0x4b566a[_0x3a79('0x36')];_0x128b34['order']=qs[_0x3a79('0x40')](_0x3459a1[_0x3a79('0x37')][_0x3a79('0x40')]);_0x128b34['where']=qs[_0x3a79('0x38')](_[_0x3a79('0x42')](_0x3459a1[_0x3a79('0x37')],_0x4b566a[_0x3a79('0x38')]));if(_0x3459a1[_0x3a79('0x37')]['filter']){_0x128b34[_0x3a79('0x41')]=_[_0x3a79('0x44')](_0x128b34[_0x3a79('0x41')],{'$or':_['map'](_0x128b34[_0x3a79('0x3a')],function(_0x32a2f6){var _0x1d4284={};_0x1d4284[_0x32a2f6]={'$like':'%'+_0x3459a1[_0x3a79('0x37')]['filter']+'%'};return _0x1d4284;})});}_0x128b34=_[_0x3a79('0x44')]({},_0x128b34,_0x3459a1[_0x3a79('0x46')]);return _0x790a8['getAnyConditions'](_0x128b34);}})[_0x3a79('0x27')](function(_0x2d9fa3){if(_0x2d9fa3){_0x1ff6d3=_0x2d9fa3[_0x3a79('0x3c')];if(!_0x3459a1[_0x3a79('0x37')]['hasOwnProperty'](_0x3a79('0x3e'))){_0x128b34[_0x3a79('0x21')]=qs[_0x3a79('0x21')](_0x3459a1[_0x3a79('0x37')][_0x3a79('0x21')]);_0x128b34[_0x3a79('0x1e')]=qs[_0x3a79('0x1e')](_0x3459a1[_0x3a79('0x37')][_0x3a79('0x1e')]);}return _0x790a8['getAnyConditions'](_0x128b34);}})[_0x3a79('0x27')](function(_0x5600e5){if(_0x5600e5){return _0x5600e5?{'count':_0x1ff6d3,'rows':_0x5600e5}:null;}})[_0x3a79('0x27')](respondWithResult(_0xe74689,null))[_0x3a79('0x4a')](handleError(_0xe74689,null));};exports[_0x3a79('0x5f')]=function(_0x2f6c54,_0x1c400f,_0x1baee5){if(_0x2f6c54[_0x3a79('0x50')]['id']){delete _0x2f6c54[_0x3a79('0x50')]['id'];}return db[_0x3a79('0x31')]['find']({'where':{'id':_0x2f6c54[_0x3a79('0x58')]['id']}})[_0x3a79('0x27')](handleEntityNotFound(_0x1c400f,null))['then'](function(_0x5e5425){if(_0x5e5425){_0x2f6c54[_0x3a79('0x50')]['TriggerId']=_0x5e5425['id'];return db[_0x3a79('0x60')][_0x3a79('0x4f')](_0x2f6c54[_0x3a79('0x50')]);}})[_0x3a79('0x27')](respondWithResult(_0x1c400f,null))['catch'](handleError(_0x1c400f,null));};exports[_0x3a79('0x61')]=function(_0x4a95d5,_0x260a3e,_0x1e4137){var _0x5f4c1b={};var _0xe4fb57={};var _0x11020c;var _0x5754f3;return db['Trigger'][_0x3a79('0x5e')]({'where':{'id':_0x4a95d5[_0x3a79('0x58')]['id']}})['then'](handleEntityNotFound(_0x260a3e,null))[_0x3a79('0x27')](function(_0x171012){if(_0x171012){_0x11020c=_0x171012;_0xe4fb57['model']=_['keys'](db[_0x3a79('0x60')][_0x3a79('0x32')]);_0xe4fb57['query']=_[_0x3a79('0x4c')](_0x4a95d5[_0x3a79('0x37')]);_0xe4fb57[_0x3a79('0x38')]=_['intersection'](_0xe4fb57['model'],_0xe4fb57[_0x3a79('0x37')]);_0x5f4c1b['attributes']=_[_0x3a79('0x39')](_0xe4fb57[_0x3a79('0x36')],qs[_0x3a79('0x3b')](_0x4a95d5[_0x3a79('0x37')][_0x3a79('0x3b')]));_0x5f4c1b[_0x3a79('0x3a')]=_0x5f4c1b[_0x3a79('0x3a')][_0x3a79('0x3c')]?_0x5f4c1b[_0x3a79('0x3a')]:_0xe4fb57['model'];_0x5f4c1b[_0x3a79('0x3f')]=qs[_0x3a79('0x40')](_0x4a95d5['query']['sort']);_0x5f4c1b['where']=qs[_0x3a79('0x38')](_[_0x3a79('0x42')](_0x4a95d5[_0x3a79('0x37')],_0xe4fb57[_0x3a79('0x38')]));if(_0x4a95d5['query']['filter']){_0x5f4c1b['where']=_[_0x3a79('0x44')](_0x5f4c1b[_0x3a79('0x41')],{'$or':_['map'](_0x5f4c1b[_0x3a79('0x3a')],function(_0x58d71e){var _0x2fff4a={};_0x2fff4a[_0x58d71e]={'$like':'%'+_0x4a95d5[_0x3a79('0x37')]['filter']+'%'};return _0x2fff4a;})});}_0x5f4c1b=_[_0x3a79('0x44')]({},_0x5f4c1b,_0x4a95d5[_0x3a79('0x46')]);return _0x11020c[_0x3a79('0x61')](_0x5f4c1b);}})[_0x3a79('0x27')](function(_0x404237){if(_0x404237){_0x5754f3=_0x404237[_0x3a79('0x3c')];if(!_0x4a95d5[_0x3a79('0x37')]['hasOwnProperty'](_0x3a79('0x3e'))){_0x5f4c1b[_0x3a79('0x21')]=qs[_0x3a79('0x21')](_0x4a95d5[_0x3a79('0x37')][_0x3a79('0x21')]);_0x5f4c1b[_0x3a79('0x1e')]=qs[_0x3a79('0x1e')](_0x4a95d5[_0x3a79('0x37')]['offset']);}return _0x11020c[_0x3a79('0x61')](_0x5f4c1b);}})[_0x3a79('0x27')](function(_0x3e4413){if(_0x3e4413){return _0x3e4413?{'count':_0x5754f3,'rows':_0x3e4413}:null;}})['then'](respondWithResult(_0x260a3e,null))[_0x3a79('0x4a')](handleError(_0x260a3e,null));}; \ No newline at end of file +var _0xf412=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','destroy','end','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','addAllCondition','TriggerAllId','Condition','getAllConditions','getAnyConditions','findOne','hasOwnProperty','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x15bf5b,_0x4c08a9){var _0x2de1be=function(_0x474b37){while(--_0x474b37){_0x15bf5b['push'](_0x15bf5b['shift']());}};_0x2de1be(++_0x4c08a9);}(_0xf412,0x171));var _0x2f41=function(_0x533437,_0x4d59d1){_0x533437=_0x533437-0x0;var _0x53f4ce=_0xf412[_0x533437];return _0x53f4ce;};'use strict';var emlformat=require(_0x2f41('0x0'));var rimraf=require(_0x2f41('0x1'));var zipdir=require(_0x2f41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f41('0x3'));var moment=require(_0x2f41('0x4'));var BPromise=require(_0x2f41('0x5'));var Mustache=require('mustache');var util=require(_0x2f41('0x6'));var path=require('path');var sox=require(_0x2f41('0x7'));var csv=require(_0x2f41('0x8'));var ejs=require(_0x2f41('0x9'));var fs=require('fs');var fs_extra=require(_0x2f41('0xa'));var _=require(_0x2f41('0xb'));var squel=require(_0x2f41('0xc'));var crypto=require(_0x2f41('0xd'));var jsforce=require(_0x2f41('0xe'));var deskjs=require(_0x2f41('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2f41('0x10'));var Papa=require(_0x2f41('0x11'));var Redis=require(_0x2f41('0x12'));var authService=require(_0x2f41('0x13'));var qs=require(_0x2f41('0x14'));var as=require(_0x2f41('0x15'));var hardwareService=require(_0x2f41('0x16'));var logger=require(_0x2f41('0x17'))('api');var utils=require(_0x2f41('0x18'));var config=require(_0x2f41('0x19'));var licenseUtil=require(_0x2f41('0x1a'));var db=require(_0x2f41('0x1b'))['db'];function respondWithStatusCode(_0x1c2310,_0x263fa9){_0x263fa9=_0x263fa9||0xcc;return function(_0x50397c){if(_0x50397c){return _0x1c2310[_0x2f41('0x1c')](_0x263fa9);}return _0x1c2310[_0x2f41('0x1d')](_0x263fa9)['end']();};}function respondWithResult(_0x5222ca,_0x416908){_0x416908=_0x416908||0xc8;return function(_0x3a10dc){if(_0x3a10dc){return _0x5222ca[_0x2f41('0x1d')](_0x416908)['json'](_0x3a10dc);}};}function respondWithFilteredResult(_0x113f9f,_0x3262b6){return function(_0x48c2cb){if(_0x48c2cb){var _0x385ecd=typeof _0x3262b6[_0x2f41('0x1e')]===_0x2f41('0x1f')&&typeof _0x3262b6[_0x2f41('0x20')]===_0x2f41('0x1f');var _0x1dd6d1=_0x48c2cb[_0x2f41('0x21')];var _0x4363dd=_0x385ecd?0x0:_0x3262b6[_0x2f41('0x1e')];var _0x436d68=_0x385ecd?_0x48c2cb['count']:_0x3262b6[_0x2f41('0x1e')]+_0x3262b6[_0x2f41('0x20')];var _0x54b4d5;if(_0x436d68>=_0x1dd6d1){_0x436d68=_0x1dd6d1;_0x54b4d5=0xc8;}else{_0x54b4d5=0xce;}_0x113f9f[_0x2f41('0x1d')](_0x54b4d5);return _0x113f9f[_0x2f41('0x22')](_0x2f41('0x23'),_0x4363dd+'-'+_0x436d68+'/'+_0x1dd6d1)[_0x2f41('0x24')](_0x48c2cb);}return null;};}function patchUpdates(_0xd10024){return function(_0x1ee093){try{jsonpatch[_0x2f41('0x25')](_0x1ee093,_0xd10024,!![]);}catch(_0x26fae7){return BPromise[_0x2f41('0x26')](_0x26fae7);}return _0x1ee093[_0x2f41('0x27')]();};}function saveUpdates(_0xc7fec8,_0x4135f1){return function(_0x516037){if(_0x516037){return _0x516037[_0x2f41('0x28')](_0xc7fec8)[_0x2f41('0x29')](function(_0x1643f9){return _0x1643f9;});}return null;};}function removeEntity(_0x278353,_0x4e89bb){return function(_0xe86706){if(_0xe86706){return _0xe86706['destroy']()[_0x2f41('0x29')](function(){var _0xb631a5=_0xe86706[_0x2f41('0x2a')]({'plain':!![]});var _0x33f9c2=_0x2f41('0x2b');return db['UserProfileResource'][_0x2f41('0x2c')]({'where':{'type':_0x33f9c2,'resourceId':_0xb631a5['id']}})[_0x2f41('0x29')](function(){return _0xe86706;});})[_0x2f41('0x29')](function(){_0x278353[_0x2f41('0x1d')](0xcc)[_0x2f41('0x2d')]();});}};}function handleEntityNotFound(_0x406618,_0x33797b){return function(_0x86b2ad){if(!_0x86b2ad){_0x406618[_0x2f41('0x1c')](0x194);}return _0x86b2ad;};}function handleError(_0x31c082,_0x218486){_0x218486=_0x218486||0x1f4;return function(_0x58e211){logger[_0x2f41('0x2e')](_0x58e211[_0x2f41('0x2f')]);if(_0x58e211[_0x2f41('0x30')]){delete _0x58e211[_0x2f41('0x30')];}_0x31c082[_0x2f41('0x1d')](_0x218486)[_0x2f41('0x31')](_0x58e211);};}exports[_0x2f41('0x32')]=function(_0x2dc129,_0x29c822){var _0xeb86e={},_0x5904c5={},_0x197fbf={'count':0x0,'rows':[]};var _0x5271d9=_[_0x2f41('0x33')](db[_0x2f41('0x34')][_0x2f41('0x35')],function(_0x4d0b9a){return{'name':_0x4d0b9a[_0x2f41('0x36')],'type':_0x4d0b9a[_0x2f41('0x37')]['key']};});_0x5904c5[_0x2f41('0x38')]=_['map'](_0x5271d9,'name');_0x5904c5[_0x2f41('0x39')]=_['keys'](_0x2dc129[_0x2f41('0x39')]);_0x5904c5['filters']=_[_0x2f41('0x3a')](_0x5904c5[_0x2f41('0x38')],_0x5904c5[_0x2f41('0x39')]);_0xeb86e[_0x2f41('0x3b')]=_[_0x2f41('0x3a')](_0x5904c5[_0x2f41('0x38')],qs[_0x2f41('0x3c')](_0x2dc129['query'][_0x2f41('0x3c')]));_0xeb86e[_0x2f41('0x3b')]=_0xeb86e[_0x2f41('0x3b')][_0x2f41('0x3d')]?_0xeb86e[_0x2f41('0x3b')]:_0x5904c5[_0x2f41('0x38')];if(!_0x2dc129[_0x2f41('0x39')]['hasOwnProperty'](_0x2f41('0x3e'))){_0xeb86e[_0x2f41('0x20')]=qs['limit'](_0x2dc129[_0x2f41('0x39')]['limit']);_0xeb86e[_0x2f41('0x1e')]=qs[_0x2f41('0x1e')](_0x2dc129[_0x2f41('0x39')][_0x2f41('0x1e')]);}_0xeb86e[_0x2f41('0x3f')]=qs[_0x2f41('0x40')](_0x2dc129[_0x2f41('0x39')]['sort']);_0xeb86e[_0x2f41('0x41')]=qs[_0x2f41('0x42')](_[_0x2f41('0x43')](_0x2dc129['query'],_0x5904c5[_0x2f41('0x42')]),_0x5271d9);if(_0x2dc129[_0x2f41('0x39')][_0x2f41('0x44')]){_0xeb86e[_0x2f41('0x41')]=_[_0x2f41('0x45')](_0xeb86e[_0x2f41('0x41')],{'$or':_['map'](_0x5271d9,function(_0x3c168c){if(_0x3c168c['type']!=='VIRTUAL'){var _0x11b24b={};_0x11b24b[_0x3c168c[_0x2f41('0x30')]]={'$like':'%'+_0x2dc129[_0x2f41('0x39')][_0x2f41('0x44')]+'%'};return _0x11b24b;}})});}_0xeb86e=_[_0x2f41('0x45')]({},_0xeb86e,_0x2dc129['options']);var _0x25554c={'where':_0xeb86e[_0x2f41('0x41')]};return db[_0x2f41('0x34')][_0x2f41('0x21')](_0x25554c)[_0x2f41('0x29')](function(_0x574126){_0x197fbf[_0x2f41('0x21')]=_0x574126;if(_0x2dc129[_0x2f41('0x39')][_0x2f41('0x46')]){_0xeb86e[_0x2f41('0x47')]=[{'all':!![]}];}return db['Trigger'][_0x2f41('0x48')](_0xeb86e);})[_0x2f41('0x29')](function(_0x31a696){_0x197fbf['rows']=_0x31a696;return _0x197fbf;})[_0x2f41('0x29')](respondWithFilteredResult(_0x29c822,_0xeb86e))['catch'](handleError(_0x29c822,null));};exports[_0x2f41('0x49')]=function(_0x45ce60,_0x2fa949){var _0xb3df36={'raw':![],'where':{'id':_0x45ce60[_0x2f41('0x4a')]['id']}},_0x482b80={};_0x482b80[_0x2f41('0x38')]=_['keys'](db['Trigger'][_0x2f41('0x35')]);_0x482b80['query']=_[_0x2f41('0x4b')](_0x45ce60[_0x2f41('0x39')]);_0x482b80[_0x2f41('0x42')]=_['intersection'](_0x482b80[_0x2f41('0x38')],_0x482b80[_0x2f41('0x39')]);_0xb3df36['attributes']=_['intersection'](_0x482b80['model'],qs[_0x2f41('0x3c')](_0x45ce60[_0x2f41('0x39')][_0x2f41('0x3c')]));_0xb3df36['attributes']=_0xb3df36[_0x2f41('0x3b')]['length']?_0xb3df36['attributes']:_0x482b80[_0x2f41('0x38')];if(_0x45ce60[_0x2f41('0x39')][_0x2f41('0x46')]){_0xb3df36[_0x2f41('0x47')]=[{'all':!![]}];}_0xb3df36=_[_0x2f41('0x45')]({},_0xb3df36,_0x45ce60['options']);return db[_0x2f41('0x34')][_0x2f41('0x4c')](_0xb3df36)[_0x2f41('0x29')](handleEntityNotFound(_0x2fa949,null))['then'](respondWithResult(_0x2fa949,null))[_0x2f41('0x4d')](handleError(_0x2fa949,null));};exports[_0x2f41('0x4e')]=function(_0x10a8f9,_0x1157bd){return db[_0x2f41('0x34')][_0x2f41('0x4e')](_0x10a8f9[_0x2f41('0x4f')],{})[_0x2f41('0x29')](function(_0x276360){var _0x576fed=_0x10a8f9[_0x2f41('0x50')]['get']({'plain':!![]});if(!_0x576fed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x576fed[_0x2f41('0x51')]===_0x2f41('0x50')){var _0xa0197c=_0x276360['get']({'plain':!![]});var _0x3f01a8=_0x2f41('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x3f01a8,'userProfileId':_0x576fed[_0x2f41('0x52')]},'raw':!![]})[_0x2f41('0x29')](function(_0x43d2d8){if(_0x43d2d8&&_0x43d2d8[_0x2f41('0x53')]===0x0){return db[_0x2f41('0x54')][_0x2f41('0x4e')]({'name':_0xa0197c[_0x2f41('0x30')],'resourceId':_0xa0197c['id'],'type':_0x43d2d8[_0x2f41('0x30')],'sectionId':_0x43d2d8['id']},{})[_0x2f41('0x29')](function(){return _0x276360;});}else{return _0x276360;}})[_0x2f41('0x4d')](function(_0x2e743f){logger[_0x2f41('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e743f);throw _0x2e743f;});}return _0x276360;})[_0x2f41('0x29')](respondWithResult(_0x1157bd,0xc9))[_0x2f41('0x4d')](handleError(_0x1157bd,null));};exports[_0x2f41('0x28')]=function(_0x4e3943,_0x15fbd8){if(_0x4e3943[_0x2f41('0x4f')]['id']){delete _0x4e3943[_0x2f41('0x4f')]['id'];}return db[_0x2f41('0x34')]['find']({'where':{'id':_0x4e3943[_0x2f41('0x4a')]['id']}})[_0x2f41('0x29')](handleEntityNotFound(_0x15fbd8,null))[_0x2f41('0x29')](saveUpdates(_0x4e3943[_0x2f41('0x4f')],null))[_0x2f41('0x29')](respondWithResult(_0x15fbd8,null))[_0x2f41('0x4d')](handleError(_0x15fbd8,null));};exports[_0x2f41('0x2c')]=function(_0x13a9b9,_0xbd1792){return db['Trigger'][_0x2f41('0x4c')]({'where':{'id':_0x13a9b9[_0x2f41('0x4a')]['id']}})[_0x2f41('0x29')](handleEntityNotFound(_0xbd1792,null))[_0x2f41('0x29')](removeEntity(_0xbd1792,null))['catch'](handleError(_0xbd1792,null));};exports[_0x2f41('0x55')]=function(_0x25888c,_0x200268,_0x488eae){if(_0x25888c[_0x2f41('0x4f')]['id']){delete _0x25888c[_0x2f41('0x4f')]['id'];}return db[_0x2f41('0x34')][_0x2f41('0x4c')]({'where':{'id':_0x25888c[_0x2f41('0x4a')]['id']}})[_0x2f41('0x29')](handleEntityNotFound(_0x200268,null))[_0x2f41('0x29')](function(_0x5ccf57){if(_0x5ccf57){_0x25888c[_0x2f41('0x4f')][_0x2f41('0x56')]=_0x5ccf57['id'];return db[_0x2f41('0x57')][_0x2f41('0x4e')](_0x25888c[_0x2f41('0x4f')]);}})['then'](respondWithResult(_0x200268,null))[_0x2f41('0x4d')](handleError(_0x200268,null));};exports['addAnyCondition']=function(_0x97cf36,_0x14be5b,_0x36125f){if(_0x97cf36[_0x2f41('0x4f')]['id']){delete _0x97cf36['body']['id'];}return db['Trigger'][_0x2f41('0x4c')]({'where':{'id':_0x97cf36[_0x2f41('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14be5b,null))[_0x2f41('0x29')](function(_0x5e9b14){if(_0x5e9b14){_0x97cf36[_0x2f41('0x4f')]['TriggerAnyId']=_0x5e9b14['id'];return db['Condition'][_0x2f41('0x4e')](_0x97cf36['body']);}})['then'](respondWithResult(_0x14be5b,null))[_0x2f41('0x4d')](handleError(_0x14be5b,null));};exports[_0x2f41('0x58')]=function(_0xe3c2c2,_0x561967,_0x43e162){var _0xb90a8d={};var _0x5c8642={};var _0xc6b596;var _0x3e055a;return db['Trigger']['findOne']({'where':{'id':_0xe3c2c2['params']['id']}})['then'](handleEntityNotFound(_0x561967,null))[_0x2f41('0x29')](function(_0xeefd8b){if(_0xeefd8b){_0xc6b596=_0xeefd8b;_0x5c8642[_0x2f41('0x38')]=_[_0x2f41('0x4b')](db['Condition'][_0x2f41('0x35')]);_0x5c8642[_0x2f41('0x39')]=_[_0x2f41('0x4b')](_0xe3c2c2[_0x2f41('0x39')]);_0x5c8642[_0x2f41('0x42')]=_[_0x2f41('0x3a')](_0x5c8642[_0x2f41('0x38')],_0x5c8642['query']);_0xb90a8d[_0x2f41('0x3b')]=_[_0x2f41('0x3a')](_0x5c8642['model'],qs[_0x2f41('0x3c')](_0xe3c2c2[_0x2f41('0x39')][_0x2f41('0x3c')]));_0xb90a8d['attributes']=_0xb90a8d[_0x2f41('0x3b')]['length']?_0xb90a8d[_0x2f41('0x3b')]:_0x5c8642['model'];_0xb90a8d[_0x2f41('0x3f')]=qs[_0x2f41('0x40')](_0xe3c2c2[_0x2f41('0x39')][_0x2f41('0x40')]);_0xb90a8d[_0x2f41('0x41')]=qs[_0x2f41('0x42')](_[_0x2f41('0x43')](_0xe3c2c2['query'],_0x5c8642[_0x2f41('0x42')]));if(_0xe3c2c2[_0x2f41('0x39')][_0x2f41('0x44')]){_0xb90a8d[_0x2f41('0x41')]=_['merge'](_0xb90a8d[_0x2f41('0x41')],{'$or':_['map'](_0xb90a8d[_0x2f41('0x3b')],function(_0x126daa){var _0x1c9c0f={};_0x1c9c0f[_0x126daa]={'$like':'%'+_0xe3c2c2[_0x2f41('0x39')][_0x2f41('0x44')]+'%'};return _0x1c9c0f;})});}_0xb90a8d=_[_0x2f41('0x45')]({},_0xb90a8d,_0xe3c2c2['options']);return _0xc6b596[_0x2f41('0x58')](_0xb90a8d);}})['then'](function(_0x463f73){if(_0x463f73){_0x3e055a=_0x463f73[_0x2f41('0x3d')];if(!_0xe3c2c2['query']['hasOwnProperty'](_0x2f41('0x3e'))){_0xb90a8d['limit']=qs[_0x2f41('0x20')](_0xe3c2c2[_0x2f41('0x39')][_0x2f41('0x20')]);_0xb90a8d['offset']=qs[_0x2f41('0x1e')](_0xe3c2c2[_0x2f41('0x39')]['offset']);}return _0xc6b596[_0x2f41('0x58')](_0xb90a8d);}})[_0x2f41('0x29')](function(_0x51ee49){if(_0x51ee49){return _0x51ee49?{'count':_0x3e055a,'rows':_0x51ee49}:null;}})[_0x2f41('0x29')](respondWithResult(_0x561967,null))[_0x2f41('0x4d')](handleError(_0x561967,null));};exports[_0x2f41('0x59')]=function(_0x444498,_0x216c15,_0x5e0b11){var _0x1223a8={};var _0x311e31={};var _0x301d52;var _0x2faf43;return db[_0x2f41('0x34')][_0x2f41('0x5a')]({'where':{'id':_0x444498['params']['id']}})[_0x2f41('0x29')](handleEntityNotFound(_0x216c15,null))[_0x2f41('0x29')](function(_0x31cce8){if(_0x31cce8){_0x301d52=_0x31cce8;_0x311e31[_0x2f41('0x38')]=_[_0x2f41('0x4b')](db[_0x2f41('0x57')][_0x2f41('0x35')]);_0x311e31[_0x2f41('0x39')]=_[_0x2f41('0x4b')](_0x444498['query']);_0x311e31[_0x2f41('0x42')]=_[_0x2f41('0x3a')](_0x311e31['model'],_0x311e31[_0x2f41('0x39')]);_0x1223a8[_0x2f41('0x3b')]=_[_0x2f41('0x3a')](_0x311e31['model'],qs[_0x2f41('0x3c')](_0x444498[_0x2f41('0x39')][_0x2f41('0x3c')]));_0x1223a8['attributes']=_0x1223a8['attributes'][_0x2f41('0x3d')]?_0x1223a8[_0x2f41('0x3b')]:_0x311e31['model'];_0x1223a8['order']=qs[_0x2f41('0x40')](_0x444498[_0x2f41('0x39')]['sort']);_0x1223a8[_0x2f41('0x41')]=qs[_0x2f41('0x42')](_[_0x2f41('0x43')](_0x444498['query'],_0x311e31[_0x2f41('0x42')]));if(_0x444498[_0x2f41('0x39')][_0x2f41('0x44')]){_0x1223a8[_0x2f41('0x41')]=_[_0x2f41('0x45')](_0x1223a8[_0x2f41('0x41')],{'$or':_[_0x2f41('0x33')](_0x1223a8['attributes'],function(_0x517d3a){var _0x4d699c={};_0x4d699c[_0x517d3a]={'$like':'%'+_0x444498[_0x2f41('0x39')]['filter']+'%'};return _0x4d699c;})});}_0x1223a8=_[_0x2f41('0x45')]({},_0x1223a8,_0x444498['options']);return _0x301d52[_0x2f41('0x59')](_0x1223a8);}})[_0x2f41('0x29')](function(_0x5a91cd){if(_0x5a91cd){_0x2faf43=_0x5a91cd[_0x2f41('0x3d')];if(!_0x444498[_0x2f41('0x39')][_0x2f41('0x5b')]('nolimit')){_0x1223a8['limit']=qs[_0x2f41('0x20')](_0x444498[_0x2f41('0x39')][_0x2f41('0x20')]);_0x1223a8['offset']=qs[_0x2f41('0x1e')](_0x444498[_0x2f41('0x39')][_0x2f41('0x1e')]);}return _0x301d52[_0x2f41('0x59')](_0x1223a8);}})[_0x2f41('0x29')](function(_0x5ce6b8){if(_0x5ce6b8){return _0x5ce6b8?{'count':_0x2faf43,'rows':_0x5ce6b8}:null;}})[_0x2f41('0x29')](respondWithResult(_0x216c15,null))['catch'](handleError(_0x216c15,null));};exports[_0x2f41('0x5c')]=function(_0x1c45fc,_0x3badd5,_0x793260){if(_0x1c45fc['body']['id']){delete _0x1c45fc[_0x2f41('0x4f')]['id'];}return db[_0x2f41('0x34')]['find']({'where':{'id':_0x1c45fc[_0x2f41('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3badd5,null))[_0x2f41('0x29')](function(_0x2bac1b){if(_0x2bac1b){_0x1c45fc[_0x2f41('0x4f')][_0x2f41('0x5d')]=_0x2bac1b['id'];return db['Action']['create'](_0x1c45fc['body']);}})[_0x2f41('0x29')](respondWithResult(_0x3badd5,null))[_0x2f41('0x4d')](handleError(_0x3badd5,null));};exports[_0x2f41('0x5e')]=function(_0x3f0704,_0x12c8ef,_0x5af1b5){var _0x64ed61={};var _0x448bfd={};var _0x58bbfe;var _0x470c03;return db[_0x2f41('0x34')][_0x2f41('0x5a')]({'where':{'id':_0x3f0704['params']['id']}})[_0x2f41('0x29')](handleEntityNotFound(_0x12c8ef,null))[_0x2f41('0x29')](function(_0x4c4639){if(_0x4c4639){_0x58bbfe=_0x4c4639;_0x448bfd['model']=_['keys'](db[_0x2f41('0x5f')]['rawAttributes']);_0x448bfd[_0x2f41('0x39')]=_[_0x2f41('0x4b')](_0x3f0704[_0x2f41('0x39')]);_0x448bfd[_0x2f41('0x42')]=_[_0x2f41('0x3a')](_0x448bfd[_0x2f41('0x38')],_0x448bfd[_0x2f41('0x39')]);_0x64ed61[_0x2f41('0x3b')]=_[_0x2f41('0x3a')](_0x448bfd[_0x2f41('0x38')],qs[_0x2f41('0x3c')](_0x3f0704[_0x2f41('0x39')][_0x2f41('0x3c')]));_0x64ed61[_0x2f41('0x3b')]=_0x64ed61[_0x2f41('0x3b')]['length']?_0x64ed61['attributes']:_0x448bfd[_0x2f41('0x38')];_0x64ed61['order']=qs[_0x2f41('0x40')](_0x3f0704[_0x2f41('0x39')]['sort']);_0x64ed61['where']=qs[_0x2f41('0x42')](_[_0x2f41('0x43')](_0x3f0704[_0x2f41('0x39')],_0x448bfd['filters']));if(_0x3f0704['query'][_0x2f41('0x44')]){_0x64ed61['where']=_[_0x2f41('0x45')](_0x64ed61[_0x2f41('0x41')],{'$or':_[_0x2f41('0x33')](_0x64ed61[_0x2f41('0x3b')],function(_0x3b9c10){var _0x1ceb85={};_0x1ceb85[_0x3b9c10]={'$like':'%'+_0x3f0704[_0x2f41('0x39')][_0x2f41('0x44')]+'%'};return _0x1ceb85;})});}_0x64ed61=_[_0x2f41('0x45')]({},_0x64ed61,_0x3f0704['options']);return _0x58bbfe[_0x2f41('0x5e')](_0x64ed61);}})[_0x2f41('0x29')](function(_0x489562){if(_0x489562){_0x470c03=_0x489562['length'];if(!_0x3f0704[_0x2f41('0x39')]['hasOwnProperty'](_0x2f41('0x3e'))){_0x64ed61[_0x2f41('0x20')]=qs[_0x2f41('0x20')](_0x3f0704[_0x2f41('0x39')]['limit']);_0x64ed61[_0x2f41('0x1e')]=qs[_0x2f41('0x1e')](_0x3f0704['query'][_0x2f41('0x1e')]);}return _0x58bbfe[_0x2f41('0x5e')](_0x64ed61);}})[_0x2f41('0x29')](function(_0x18b81c){if(_0x18b81c){return _0x18b81c?{'count':_0x470c03,'rows':_0x18b81c}:null;}})[_0x2f41('0x29')](respondWithResult(_0x12c8ef,null))['catch'](handleError(_0x12c8ef,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 581b4dc..f7cf874 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 _0x5c4a=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x55c2d9,_0x18ae5a){var _0x41fa7a=function(_0x4e5d36){while(--_0x4e5d36){_0x55c2d9['push'](_0x55c2d9['shift']());}};_0x41fa7a(++_0x18ae5a);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x556f50,_0x33e59f){_0x556f50=_0x556f50-0x0;var _0x32dbae=_0x5c4a[_0x556f50];return _0x32dbae;};'use strict';var _=require('lodash');var util=require(_0xa5c4('0x0'));var logger=require(_0xa5c4('0x1'))('api');var moment=require(_0xa5c4('0x2'));var BPromise=require(_0xa5c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5c4('0x4'));var rimraf=require(_0xa5c4('0x5'));var config=require(_0xa5c4('0x6'));var attributes=require(_0xa5c4('0x7'));module[_0xa5c4('0x8')]=function(_0x49af82,_0x2410cf){return _0x49af82[_0xa5c4('0x9')](_0xa5c4('0xa'),attributes,{'tableName':_0xa5c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60c2=['define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x35af9f,_0x4d91db){var _0x1cc253=function(_0x3526cf){while(--_0x3526cf){_0x35af9f['push'](_0x35af9f['shift']());}};_0x1cc253(++_0x4d91db);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var logger=require(_0x260c('0x1'))(_0x260c('0x2'));var moment=require(_0x260c('0x3'));var BPromise=require(_0x260c('0x4'));var rp=require(_0x260c('0x5'));var fs=require('fs');var path=require(_0x260c('0x6'));var rimraf=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var attributes=require(_0x260c('0x9'));module[_0x260c('0xa')]=function(_0x13c7d0,_0x558b0c){return _0x13c7d0[_0x260c('0xb')](_0x260c('0xc'),attributes,{'tableName':_0x260c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 48112dc..f40129b 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 _0x322b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','ShowTrigger','find','where','model','lodash','util','moment'];(function(_0x34a8d1,_0x1fd5d6){var _0x417103=function(_0x1fad44){while(--_0x1fad44){_0x34a8d1['push'](_0x34a8d1['shift']());}};_0x417103(++_0x1fd5d6);}(_0x322b,0x107));var _0xb322=function(_0x28887d,_0x1247e6){_0x28887d=_0x28887d-0x0;var _0x29762b=_0x322b[_0x28887d];return _0x29762b;};'use strict';var _=require(_0xb322('0x0'));var util=require(_0xb322('0x1'));var moment=require(_0xb322('0x2'));var BPromise=require(_0xb322('0x3'));var rs=require(_0xb322('0x4'));var fs=require('fs');var Redis=require(_0xb322('0x5'));var db=require(_0xb322('0x6'))['db'];var utils=require(_0xb322('0x7'));var logger=require(_0xb322('0x8'))(_0xb322('0x9'));var config=require(_0xb322('0xa'));var jayson=require(_0xb322('0xb'));var client=jayson[_0xb322('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55d043,_0x513338,_0x3970c9){return new BPromise(function(_0x10fb8d,_0x286d3c){return client[_0xb322('0xd')](_0x55d043,_0x3970c9)[_0xb322('0xe')](function(_0xbfbad6){logger[_0xb322('0xf')](_0xb322('0x10'),_0x513338,_0xb322('0x11'));logger[_0xb322('0x12')](_0xb322('0x13'),_0x513338,_0xb322('0x11'),JSON[_0xb322('0x14')](_0xbfbad6));if(_0xbfbad6[_0xb322('0x15')]){if(_0xbfbad6[_0xb322('0x15')][_0xb322('0x16')]===0x1f4){logger[_0xb322('0x15')](_0xb322('0x10'),_0x513338,_0xbfbad6[_0xb322('0x15')]['message']);return _0x286d3c(_0xbfbad6[_0xb322('0x15')][_0xb322('0x17')]);}logger[_0xb322('0x15')]('Trigger,\x20%s,\x20%s',_0x513338,_0xbfbad6[_0xb322('0x15')][_0xb322('0x17')]);return _0x10fb8d(_0xbfbad6[_0xb322('0x15')]['message']);}else{logger['info'](_0xb322('0x10'),_0x513338,_0xb322('0x11'));_0x10fb8d(_0xbfbad6['result'][_0xb322('0x17')]);}})[_0xb322('0x18')](function(_0x320566){logger['error']('Trigger,\x20%s,\x20%s',_0x513338,_0x320566);_0x286d3c(_0x320566);});});}exports[_0xb322('0x19')]=function(_0x16263c){var _0x2c6cbf=this;return new Promise(function(_0x558251,_0x532e67){return db[_0xb322('0x1a')][_0xb322('0x1b')]({'raw':_0x16263c[_0xb322('0x1c')]?_0x16263c['options'][_0xb322('0x1d')]===undefined?!![]:![]:!![],'where':_0x16263c[_0xb322('0x1c')]?_0x16263c[_0xb322('0x1c')]['where']||null:null,'attributes':_0x16263c[_0xb322('0x1c')]?_0x16263c[_0xb322('0x1c')][_0xb322('0x1e')]||null:null,'limit':_0x16263c['options']?_0x16263c['options'][_0xb322('0x1f')]||null:null,'include':_0x16263c[_0xb322('0x1c')]?_0x16263c[_0xb322('0x1c')][_0xb322('0x20')]?_[_0xb322('0x21')](_0x16263c['options'][_0xb322('0x20')],function(_0xfb3b75){return{'model':db[_0xfb3b75['model']],'as':_0xfb3b75['as'],'attributes':_0xfb3b75[_0xb322('0x1e')],'include':_0xfb3b75['include']?_[_0xb322('0x21')](_0xfb3b75[_0xb322('0x20')],function(_0x4ed52e){return{'model':db[_0x4ed52e['model']],'as':_0x4ed52e['as'],'attributes':_0x4ed52e[_0xb322('0x1e')],'include':_0x4ed52e[_0xb322('0x20')]?_[_0xb322('0x21')](_0x4ed52e[_0xb322('0x20')],function(_0xb7e950){return{'model':db[_0xb7e950['model']],'as':_0xb7e950['as'],'attributes':_0xb7e950[_0xb322('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb322('0xe')](function(_0x3026f7){logger['info'](_0xb322('0x19'),_0x16263c);logger[_0xb322('0x12')]('GetTrigger',_0x16263c,JSON['stringify'](_0x3026f7));_0x558251(_0x3026f7);})[_0xb322('0x18')](function(_0x1219d3){logger[_0xb322('0x15')](_0xb322('0x19'),_0x1219d3[_0xb322('0x17')],_0x16263c);_0x532e67(_0x2c6cbf[_0xb322('0x15')](0x1f4,_0x1219d3[_0xb322('0x17')]));});});};exports[_0xb322('0x22')]=function(_0x2e604b){var _0x1d0789=this;return new Promise(function(_0x167809,_0x4e89ae){return db['Trigger'][_0xb322('0x23')]({'raw':_0x2e604b[_0xb322('0x1c')]?_0x2e604b[_0xb322('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2e604b[_0xb322('0x1c')]?_0x2e604b[_0xb322('0x1c')][_0xb322('0x24')]||null:null,'attributes':_0x2e604b[_0xb322('0x1c')]?_0x2e604b['options'][_0xb322('0x1e')]||null:null,'include':_0x2e604b[_0xb322('0x1c')]?_0x2e604b[_0xb322('0x1c')][_0xb322('0x20')]?_[_0xb322('0x21')](_0x2e604b[_0xb322('0x1c')][_0xb322('0x20')],function(_0x16aa5b){return{'model':db[_0x16aa5b[_0xb322('0x25')]],'as':_0x16aa5b['as'],'attributes':_0x16aa5b[_0xb322('0x1e')],'include':_0x16aa5b[_0xb322('0x20')]?_[_0xb322('0x21')](_0x16aa5b[_0xb322('0x20')],function(_0x4553c2){return{'model':db[_0x4553c2[_0xb322('0x25')]],'as':_0x4553c2['as'],'attributes':_0x4553c2[_0xb322('0x1e')],'include':_0x4553c2['include']?_[_0xb322('0x21')](_0x4553c2[_0xb322('0x20')],function(_0x31dafd){return{'model':db[_0x31dafd[_0xb322('0x25')]],'as':_0x31dafd['as'],'attributes':_0x31dafd[_0xb322('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb322('0xe')](function(_0x2ce920){logger[_0xb322('0xf')](_0xb322('0x22'),_0x2e604b);logger[_0xb322('0x12')]('ShowTrigger',_0x2e604b,JSON[_0xb322('0x14')](_0x2ce920));_0x167809(_0x2ce920);})['catch'](function(_0x3b62d5){logger[_0xb322('0x15')](_0xb322('0x22'),_0x3b62d5[_0xb322('0x17')],_0x2e604b);_0x4e89ae(_0x1d0789[_0xb322('0x15')](0x1f4,_0x3b62d5[_0xb322('0x17')]));});});}; \ No newline at end of file +var _0x0595=['message','info','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x7f4677,_0x256476){var _0x44188c=function(_0xd4f905){while(--_0xd4f905){_0x7f4677['push'](_0x7f4677['shift']());}};_0x44188c(++_0x256476);}(_0x0595,0x1c9));var _0x5059=function(_0x233c30,_0x17daca){_0x233c30=_0x233c30-0x0;var _0x1ffe54=_0x0595[_0x233c30];return _0x1ffe54;};'use strict';var _=require('lodash');var util=require(_0x5059('0x0'));var moment=require(_0x5059('0x1'));var BPromise=require(_0x5059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5059('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5059('0x4'));var logger=require(_0x5059('0x5'))(_0x5059('0x6'));var config=require(_0x5059('0x7'));var jayson=require(_0x5059('0x8'));var client=jayson[_0x5059('0x9')][_0x5059('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55b1cb,_0x558161,_0xfd4b29){return new BPromise(function(_0x38ef65,_0x40a663){return client[_0x5059('0xb')](_0x55b1cb,_0xfd4b29)[_0x5059('0xc')](function(_0x401830){logger['info'](_0x5059('0xd'),_0x558161,'request\x20sent');logger[_0x5059('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x558161,_0x5059('0xf'),JSON[_0x5059('0x10')](_0x401830));if(_0x401830[_0x5059('0x11')]){if(_0x401830[_0x5059('0x11')][_0x5059('0x12')]===0x1f4){logger[_0x5059('0x11')](_0x5059('0xd'),_0x558161,_0x401830[_0x5059('0x11')]['message']);return _0x40a663(_0x401830[_0x5059('0x11')][_0x5059('0x13')]);}logger[_0x5059('0x11')]('Trigger,\x20%s,\x20%s',_0x558161,_0x401830['error']['message']);return _0x38ef65(_0x401830[_0x5059('0x11')][_0x5059('0x13')]);}else{logger[_0x5059('0x14')](_0x5059('0xd'),_0x558161,_0x5059('0xf'));_0x38ef65(_0x401830[_0x5059('0x15')][_0x5059('0x13')]);}})[_0x5059('0x16')](function(_0xb6e935){logger[_0x5059('0x11')]('Trigger,\x20%s,\x20%s',_0x558161,_0xb6e935);_0x40a663(_0xb6e935);});});}exports[_0x5059('0x17')]=function(_0x43d4b2){var _0x59d78b=this;return new Promise(function(_0xf645bb,_0x488687){return db['Trigger'][_0x5059('0x18')]({'raw':_0x43d4b2[_0x5059('0x19')]?_0x43d4b2[_0x5059('0x19')][_0x5059('0x1a')]===undefined?!![]:![]:!![],'where':_0x43d4b2[_0x5059('0x19')]?_0x43d4b2['options'][_0x5059('0x1b')]||null:null,'attributes':_0x43d4b2[_0x5059('0x19')]?_0x43d4b2[_0x5059('0x19')][_0x5059('0x1c')]||null:null,'limit':_0x43d4b2[_0x5059('0x19')]?_0x43d4b2[_0x5059('0x19')][_0x5059('0x1d')]||null:null,'include':_0x43d4b2[_0x5059('0x19')]?_0x43d4b2['options'][_0x5059('0x1e')]?_[_0x5059('0x1f')](_0x43d4b2[_0x5059('0x19')][_0x5059('0x1e')],function(_0x15a449){return{'model':db[_0x15a449[_0x5059('0x20')]],'as':_0x15a449['as'],'attributes':_0x15a449[_0x5059('0x1c')],'include':_0x15a449[_0x5059('0x1e')]?_['map'](_0x15a449[_0x5059('0x1e')],function(_0x241c86){return{'model':db[_0x241c86[_0x5059('0x20')]],'as':_0x241c86['as'],'attributes':_0x241c86[_0x5059('0x1c')],'include':_0x241c86[_0x5059('0x1e')]?_[_0x5059('0x1f')](_0x241c86[_0x5059('0x1e')],function(_0xd254de){return{'model':db[_0xd254de[_0x5059('0x20')]],'as':_0xd254de['as'],'attributes':_0xd254de['attributes']};}):[]};}):[]};}):[]:[]})[_0x5059('0xc')](function(_0x1e186c){logger[_0x5059('0x14')]('GetTrigger',_0x43d4b2);logger[_0x5059('0xe')](_0x5059('0x17'),_0x43d4b2,JSON[_0x5059('0x10')](_0x1e186c));_0xf645bb(_0x1e186c);})['catch'](function(_0x1d517f){logger[_0x5059('0x11')](_0x5059('0x17'),_0x1d517f['message'],_0x43d4b2);_0x488687(_0x59d78b[_0x5059('0x11')](0x1f4,_0x1d517f['message']));});});};exports[_0x5059('0x21')]=function(_0x7b2d27){var _0x1ecc60=this;return new Promise(function(_0x13e46c,_0xa9fae9){return db['Trigger']['find']({'raw':_0x7b2d27[_0x5059('0x19')]?_0x7b2d27[_0x5059('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x7b2d27[_0x5059('0x19')]?_0x7b2d27[_0x5059('0x19')]['where']||null:null,'attributes':_0x7b2d27[_0x5059('0x19')]?_0x7b2d27['options'][_0x5059('0x1c')]||null:null,'include':_0x7b2d27[_0x5059('0x19')]?_0x7b2d27[_0x5059('0x19')][_0x5059('0x1e')]?_['map'](_0x7b2d27['options'][_0x5059('0x1e')],function(_0x3e33b5){return{'model':db[_0x3e33b5[_0x5059('0x20')]],'as':_0x3e33b5['as'],'attributes':_0x3e33b5[_0x5059('0x1c')],'include':_0x3e33b5[_0x5059('0x1e')]?_[_0x5059('0x1f')](_0x3e33b5[_0x5059('0x1e')],function(_0x2042a0){return{'model':db[_0x2042a0[_0x5059('0x20')]],'as':_0x2042a0['as'],'attributes':_0x2042a0[_0x5059('0x1c')],'include':_0x2042a0[_0x5059('0x1e')]?_['map'](_0x2042a0[_0x5059('0x1e')],function(_0x5c8d9f){return{'model':db[_0x5c8d9f[_0x5059('0x20')]],'as':_0x5c8d9f['as'],'attributes':_0x5c8d9f[_0x5059('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5059('0xc')](function(_0x303593){logger[_0x5059('0x14')](_0x5059('0x21'),_0x7b2d27);logger[_0x5059('0xe')](_0x5059('0x21'),_0x7b2d27,JSON[_0x5059('0x10')](_0x303593));_0x13e46c(_0x303593);})[_0x5059('0x16')](function(_0x72aef){logger[_0x5059('0x11')]('ShowTrigger',_0x72aef[_0x5059('0x13')],_0x7b2d27);_0xa9fae9(_0x1ecc60[_0x5059('0x11')](0x1f4,_0x72aef['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 3902e9c..db38270 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 _0x15de=['/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index'];(function(_0x5103d7,_0x27eda1){var _0x32f85a=function(_0x2a796){while(--_0x2a796){_0x5103d7['push'](_0x5103d7['shift']());}};_0x32f85a(++_0x27eda1);}(_0x15de,0x106));var _0xe15d=function(_0x7642c,_0x2ec4b0){_0x7642c=_0x7642c-0x0;var _0x5412fd=_0x15de[_0x7642c];return _0x5412fd;};'use strict';var multer=require(_0xe15d('0x0'));var util=require(_0xe15d('0x1'));var path=require(_0xe15d('0x2'));var timeout=require(_0xe15d('0x3'));var express=require(_0xe15d('0x4'));var router=express['Router']();var fs_extra=require(_0xe15d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe15d('0x6'));var config=require(_0xe15d('0x7'));var controller=require(_0xe15d('0x8'));router['get']('/',auth[_0xe15d('0x9')](),controller[_0xe15d('0xa')]);router['get'](_0xe15d('0xb'),auth[_0xe15d('0x9')](),controller[_0xe15d('0xc')]);router[_0xe15d('0xd')](_0xe15d('0xe'),auth[_0xe15d('0x9')](),controller[_0xe15d('0xf')]);router[_0xe15d('0xd')]('/',auth['isAuthenticated'](),controller[_0xe15d('0x10')]);router[_0xe15d('0x11')](_0xe15d('0xb'),auth[_0xe15d('0x9')](),controller[_0xe15d('0x12')]);router[_0xe15d('0x13')]('/:id',auth[_0xe15d('0x9')](),controller[_0xe15d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x020e=['isAuthenticated','show','clone','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x020e,0x154));var _0xe020=function(_0x1c2399,_0x48d096){_0x1c2399=_0x1c2399-0x0;var _0x430f8b=_0x020e[_0x1c2399];return _0x430f8b;};'use strict';var multer=require(_0xe020('0x0'));var util=require(_0xe020('0x1'));var path=require(_0xe020('0x2'));var timeout=require(_0xe020('0x3'));var express=require(_0xe020('0x4'));var router=express[_0xe020('0x5')]();var fs_extra=require(_0xe020('0x6'));var auth=require(_0xe020('0x7'));var interaction=require(_0xe020('0x8'));var config=require(_0xe020('0x9'));var controller=require(_0xe020('0xa'));router[_0xe020('0xb')]('/',auth[_0xe020('0xc')](),controller['index']);router[_0xe020('0xb')]('/:id',auth[_0xe020('0xc')](),controller[_0xe020('0xd')]);router['post']('/:id/clone',auth[_0xe020('0xc')](),controller[_0xe020('0xe')]);router[_0xe020('0xf')]('/',auth[_0xe020('0xc')](),controller[_0xe020('0x10')]);router[_0xe020('0x11')](_0xe020('0x12'),auth[_0xe020('0xc')](),controller['update']);router[_0xe020('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe020('0x14')]);module[_0xe020('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0925ff0..0626045 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 _0xa35c=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse','originate','uas','pai','fingerprint','active','passive','update,nonat','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN'];(function(_0x5347eb,_0x1f2626){var _0x498609=function(_0x16bf5b){while(--_0x16bf5b){_0x5347eb['push'](_0x5347eb['shift']());}};_0x498609(++_0x1f2626);}(_0xa35c,0xcf));var _0xca35=function(_0x3b56c3,_0x57b66c){_0x3b56c3=_0x3b56c3-0x0;var _0x3f5ae3=_0xa35c[_0x3b56c3];return _0x3f5ae3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xca35('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x2'),_0xca35('0x3'),_0xca35('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xca35('0x0')],'allowNull':![],'defaultValue':_0xca35('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xca35('0x6'),'ALLOWED_PASSED_SCREEN',_0xca35('0x7'),_0xca35('0x8'),_0xca35('0x9'),'PROHIB_PASSED_SCREEN',_0xca35('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0xca35('0x0')]},'permit':{'type':Sequelize[_0xca35('0x0')]},'secret':{'type':Sequelize[_0xca35('0x0')]},'md5secret':{'type':Sequelize[_0xca35('0x0')]},'remotesecret':{'type':Sequelize[_0xca35('0x0')]},'transport':{'type':Sequelize[_0xca35('0x0')],'defaultValue':'udp','set':function(_0x566ee7){this[_0xca35('0xb')](_0xca35('0xc'),_0x566ee7?_0x566ee7[_0xca35('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xca35('0xc'))?this[_0xca35('0xe')]('transport')[_0xca35('0xf')](','):null;},'comment':_0xca35('0x10')},'dtmfmode':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x11'),_0xca35('0x12'),_0xca35('0x13'),_0xca35('0x14'),_0xca35('0x15')),'defaultValue':_0xca35('0x11')},'directmedia':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no','nonat',_0xca35('0x17'),_0xca35('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xca35('0x0')]},'directmediadeny':{'type':Sequelize[_0xca35('0x0')]},'nat':{'type':Sequelize[_0xca35('0x0')],'defaultValue':_0xca35('0x19'),'set':function(_0x2618d6){this[_0xca35('0xb')](_0xca35('0x1a'),_0x2618d6?_0x2618d6[_0xca35('0xd')](','):null);},'get':function(){return this[_0xca35('0xe')](_0xca35('0x1a'))?this['getDataValue']('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xca35('0x0')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xca35('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xca35('0x0')],'defaultValue':_0xca35('0x1b')},'allow':{'type':Sequelize[_0xca35('0x0')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x531c4f){this['setDataValue'](_0xca35('0x1c'),_0x531c4f?_0x531c4f['join'](';'):_0xca35('0x1d'));},'get':function(){return this['getDataValue'](_0xca35('0x1c'))?this['getDataValue'](_0xca35('0x1c'))[_0xca35('0xf')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no')},'insecure':{'type':Sequelize[_0xca35('0x0')],'defaultValue':'port,invite','set':function(_0x42897e){this[_0xca35('0xb')]('insecure',_0x42897e?_0x42897e[_0xca35('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xca35('0x1e'))?this[_0xca35('0xe')](_0xca35('0x1e'))[_0xca35('0xf')](','):null;},'comment':_0xca35('0x1f')},'trustrpid':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no',_0xca35('0x20'))},'promiscredir':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no')},'accountcode':{'type':Sequelize[_0xca35('0x21')](0xb)},'setvar':{'type':Sequelize[_0xca35('0x0')]},'callerid':{'type':Sequelize[_0xca35('0x0')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xca35('0x0')]},'callcounter':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no'),'defaultValue':_0xca35('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xca35('0x1')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xca35('0x0')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xca35('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xca35('0x1')]('yes','no')},'mailbox':{'type':Sequelize[_0xca35('0x0')]},'session_timers':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x22'),_0xca35('0x23'),_0xca35('0x24'))},'session_expires':{'type':Sequelize[_0xca35('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xca35('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xca35('0x1')]('uac',_0xca35('0x25')),'defaultValue':_0xca35('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0xca35('0x0')]},'regexten':{'type':Sequelize[_0xca35('0x0')]},'fromdomain':{'type':Sequelize[_0xca35('0x0')]},'fromuser':{'type':Sequelize[_0xca35('0x0')]},'port':{'type':Sequelize[_0xca35('0x21')](0x5)},'qualify':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no'),'defaultValue':_0xca35('0x16')},'keepalive':{'type':Sequelize[_0xca35('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xca35('0x0')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xca35('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xca35('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no',_0xca35('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca35('0x0')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xca35('0x21')](0xb)},'timerb':{'type':Sequelize[_0xca35('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xca35('0x0')]},'contactdeny':{'type':Sequelize[_0xca35('0x0')]},'contactacl':{'type':Sequelize[_0xca35('0x0')]},'unsolicited_mailbox':{'type':Sequelize[_0xca35('0x0')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xca35('0x21')](0xb)},'encryption':{'type':Sequelize[_0xca35('0x1')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xca35('0x1')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no',_0xca35('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xca35('0x0')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xca35('0x0')]},'dtlssetup':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x28'),_0xca35('0x29'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca35('0x0')]},'usereqphone':{'type':Sequelize['ENUM'](_0xca35('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xca35('0x0')]},'call_limit':{'type':Sequelize[_0xca35('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no')},'vmexten':{'type':Sequelize[_0xca35('0x0')]},'mohinterpret':{'type':Sequelize[_0xca35('0x0')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xca35('0x0')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xca35('0x1')](_0xca35('0x16'),'no','nonat',_0xca35('0x17'),_0xca35('0x2a')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xca35('0x0')]},'otherFields':{'type':Sequelize[_0xca35('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xca35('0x0')],'defaultValue':'no'}}; \ No newline at end of file +var _0x2c6d=['all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','rfc2833','info','shortinfo','inband','auto','yes','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x3a9468,_0x2b6266){var _0x1d2345=function(_0x499728){while(--_0x499728){_0x3a9468['push'](_0x3a9468['shift']());}};_0x1d2345(++_0x2b6266);}(_0x2c6d,0x1c8));var _0xd2c6=function(_0x5c8af4,_0x5537fb){_0x5c8af4=_0x5c8af4-0x0;var _0x424e19=_0x2c6d[_0x5c8af4];return _0x424e19;};'use strict';var Sequelize=require(_0xd2c6('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2c6('0x1')],'allowNull':![],'unique':_0xd2c6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x4'),_0xd2c6('0x5'),_0xd2c6('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xd2c6('0x1')],'allowNull':![],'defaultValue':_0xd2c6('0x7')},'callingpres':{'type':Sequelize[_0xd2c6('0x3')]('ALLOWED_NOT_SCREENED',_0xd2c6('0x8'),_0xd2c6('0x9'),_0xd2c6('0xa'),_0xd2c6('0xb'),_0xd2c6('0xc'),_0xd2c6('0xd'),_0xd2c6('0xe'))},'deny':{'type':Sequelize[_0xd2c6('0x1')]},'permit':{'type':Sequelize[_0xd2c6('0x1')]},'secret':{'type':Sequelize[_0xd2c6('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd2c6('0x1')],'defaultValue':_0xd2c6('0xf'),'set':function(_0x187be0){this[_0xd2c6('0x10')](_0xd2c6('0x11'),_0x187be0?_0x187be0[_0xd2c6('0x12')](','):null);},'get':function(){return this[_0xd2c6('0x13')](_0xd2c6('0x11'))?this['getDataValue'](_0xd2c6('0x11'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x14'),_0xd2c6('0x15'),_0xd2c6('0x16'),_0xd2c6('0x17'),_0xd2c6('0x18')),'defaultValue':_0xd2c6('0x14')},'directmedia':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xd2c6('0x1a'),'set':function(_0x55e952){this[_0xd2c6('0x10')](_0xd2c6('0x1b'),_0x55e952?_0x55e952[_0xd2c6('0x12')](','):null);},'get':function(){return this[_0xd2c6('0x13')](_0xd2c6('0x1b'))?this[_0xd2c6('0x13')](_0xd2c6('0x1b'))[_0xd2c6('0x1c')](','):null;},'comment':_0xd2c6('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd2c6('0x1')]},'pickupgroup':{'type':Sequelize[_0xd2c6('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xd2c6('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd2c6('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd2c6('0x1')],'defaultValue':_0xd2c6('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd2c6('0x1f'),'set':function(_0x23ca8a){this[_0xd2c6('0x10')]('allow',_0x23ca8a?_0x23ca8a[_0xd2c6('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xd2c6('0x20'))?this[_0xd2c6('0x13')]('allow')[_0xd2c6('0x1c')](';'):null;},'comment':_0xd2c6('0x21')},'autoframing':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'insecure':{'type':Sequelize[_0xd2c6('0x1')],'defaultValue':_0xd2c6('0x22'),'set':function(_0x1795ef){this[_0xd2c6('0x10')]('insecure',_0x1795ef?_0x1795ef[_0xd2c6('0x12')](','):null);},'get':function(){return this[_0xd2c6('0x13')](_0xd2c6('0x23'))?this[_0xd2c6('0x13')](_0xd2c6('0x23'))[_0xd2c6('0x1c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd2c6('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no',_0xd2c6('0x24'))},'promiscredir':{'type':Sequelize[_0xd2c6('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'accountcode':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'setvar':{'type':Sequelize[_0xd2c6('0x1')]},'callerid':{'type':Sequelize[_0xd2c6('0x1')],'defaultValue':_0xd2c6('0x26')},'amaflags':{'type':Sequelize[_0xd2c6('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xd2c6('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xd2c6('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xd2c6('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd2c6('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xd2c6('0x1')]},'videosupport':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no',_0xd2c6('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xd2c6('0x28'),_0xd2c6('0x29'),'originate')},'session_expires':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x2a'),_0xd2c6('0x2b')),'defaultValue':_0xd2c6('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xd2c6('0x1')]},'regexten':{'type':Sequelize[_0xd2c6('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xd2c6('0x1')]},'port':{'type':Sequelize[_0xd2c6('0x25')](0x5)},'qualify':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no'),'defaultValue':_0xd2c6('0x19')},'keepalive':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xd2c6('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xd2c6('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xd2c6('0x1')]},'timert1':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'timerb':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xd2c6('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xd2c6('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xd2c6('0x1')]},'use_q850_reason':{'type':Sequelize[_0xd2c6('0x1')]},'maxforwards':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xd2c6('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd2c6('0x19'),'no')},'force_avp':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'icesupport':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no',_0xd2c6('0x2d'),_0xd2c6('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xd2c6('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xd2c6('0x1')]},'dtlscipher':{'type':Sequelize[_0xd2c6('0x1')]},'dtlscafile':{'type':Sequelize[_0xd2c6('0x1')]},'dtlscapath':{'type':Sequelize[_0xd2c6('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd2c6('0x2f'),_0xd2c6('0x30'),_0xd2c6('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd2c6('0x1')]},'usereqphone':{'type':Sequelize[_0xd2c6('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd2c6('0x1')]},'call_limit':{'type':Sequelize[_0xd2c6('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd2c6('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no')},'vmexten':{'type':Sequelize[_0xd2c6('0x1')]},'mohinterpret':{'type':Sequelize[_0xd2c6('0x1')]},'mohsuggest':{'type':Sequelize[_0xd2c6('0x1')]},'parkinglot':{'type':Sequelize[_0xd2c6('0x1')]},'description':{'type':Sequelize[_0xd2c6('0x1')]},'host':{'type':Sequelize[_0xd2c6('0x1')],'defaultValue':_0xd2c6('0x32')},'canreinvite':{'type':Sequelize[_0xd2c6('0x3')](_0xd2c6('0x19'),'no',_0xd2c6('0x33'),_0xd2c6('0x34'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd2c6('0x1')]},'otherFields':{'type':Sequelize[_0xd2c6('0x1')]},'active':{'type':Sequelize[_0xd2c6('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd2c6('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 6030055..dca7dcb 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 _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x32c161,_0x3e1f13){var _0x14996f=function(_0xf7c354){while(--_0xf7c354){_0x32c161['push'](_0x32c161['shift']());}};_0x14996f(++_0x3e1f13);}(_0xdace,0xc5));var _0xedac=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xdace[_0x484c03];return _0x294127;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x353bbe,_0x160113){var _0x32eab7=function(_0x4c97bc){while(--_0x4c97bc){_0x353bbe['push'](_0x353bbe['shift']());}};_0x32eab7(++_0x160113);}(_0xb821,0xa7));var _0x1b82=function(_0x48a48e,_0x5d5885){_0x48a48e=_0x48a48e-0x0;var _0x22dc5d=_0xb821[_0x48a48e];return _0x22dc5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index c8dc44b..5e0b5bf 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 _0x688b=['define','Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x688b,0xb8));var _0xb688=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x688b[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xb688('0x0'));var util=require(_0xb688('0x1'));var logger=require(_0xb688('0x2'))(_0xb688('0x3'));var moment=require(_0xb688('0x4'));var BPromise=require(_0xb688('0x5'));var rp=require(_0xb688('0x6'));var fs=require('fs');var path=require(_0xb688('0x7'));var rimraf=require(_0xb688('0x8'));var config=require(_0xb688('0x9'));var attributes=require(_0xb688('0xa'));module[_0xb688('0xb')]=function(_0x3c0527,_0xdeda55){return _0x3c0527[_0xb688('0xc')](_0xb688('0xd'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6acb=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x359173,_0x2ff2d9){var _0x1236b4=function(_0x5200ad){while(--_0x5200ad){_0x359173['push'](_0x359173['shift']());}};_0x1236b4(++_0x2ff2d9);}(_0x6acb,0x17a));var _0xb6ac=function(_0x4e8401,_0x51b328){_0x4e8401=_0x4e8401-0x0;var _0x17269f=_0x6acb[_0x4e8401];return _0x17269f;};'use strict';var _=require('lodash');var util=require(_0xb6ac('0x0'));var logger=require(_0xb6ac('0x1'))(_0xb6ac('0x2'));var moment=require(_0xb6ac('0x3'));var BPromise=require(_0xb6ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb6ac('0x5'));var config=require(_0xb6ac('0x6'));var attributes=require(_0xb6ac('0x7'));module[_0xb6ac('0x8')]=function(_0x46e021,_0x1ea54c){return _0x46e021[_0xb6ac('0x9')](_0xb6ac('0xa'),attributes,{'tableName':_0xb6ac('0xb'),'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 3c075d5..daa535b 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 _0x3c77=['debug','stringify','error','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowTrunk','find','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x4717d5,_0x42bd16){var _0xd067b7=function(_0x3dce34){while(--_0x3dce34){_0x4717d5['push'](_0x4717d5['shift']());}};_0xd067b7(++_0x42bd16);}(_0x3c77,0xb4));var _0x73c7=function(_0x29bc28,_0x4d139e){_0x29bc28=_0x29bc28-0x0;var _0x4a7251=_0x3c77[_0x29bc28];return _0x4a7251;};'use strict';var _=require('lodash');var util=require(_0x73c7('0x0'));var moment=require(_0x73c7('0x1'));var BPromise=require(_0x73c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x73c7('0x4'))(_0x73c7('0x5'));var config=require(_0x73c7('0x6'));var jayson=require(_0x73c7('0x7'));var client=jayson['client'][_0x73c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58d54a,_0x4a3024,_0x3d93b1){return new BPromise(function(_0x3484c1,_0x163479){return client['request'](_0x58d54a,_0x3d93b1)['then'](function(_0x84754c){logger[_0x73c7('0x9')](_0x73c7('0xa'),_0x4a3024,_0x73c7('0xb'));logger[_0x73c7('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4a3024,_0x73c7('0xb'),JSON[_0x73c7('0xd')](_0x84754c));if(_0x84754c[_0x73c7('0xe')]){if(_0x84754c[_0x73c7('0xe')]['code']===0x1f4){logger[_0x73c7('0xe')]('Trunk,\x20%s,\x20%s',_0x4a3024,_0x84754c[_0x73c7('0xe')][_0x73c7('0xf')]);return _0x163479(_0x84754c[_0x73c7('0xe')]['message']);}logger[_0x73c7('0xe')](_0x73c7('0xa'),_0x4a3024,_0x84754c[_0x73c7('0xe')][_0x73c7('0xf')]);return _0x3484c1(_0x84754c[_0x73c7('0xe')][_0x73c7('0xf')]);}else{logger[_0x73c7('0x9')]('Trunk,\x20%s,\x20%s',_0x4a3024,_0x73c7('0xb'));_0x3484c1(_0x84754c[_0x73c7('0x10')]['message']);}})['catch'](function(_0x97c52b){logger['error'](_0x73c7('0xa'),_0x4a3024,_0x97c52b);_0x163479(_0x97c52b);});});}exports[_0x73c7('0x11')]=function(_0x14c9ef){var _0x3d8d49=this;return new Promise(function(_0x3b5813,_0x53a7e4){return db[_0x73c7('0x12')][_0x73c7('0x13')]({'raw':_0x14c9ef[_0x73c7('0x14')]?_0x14c9ef['options'][_0x73c7('0x15')]===undefined?!![]:![]:!![],'where':_0x14c9ef[_0x73c7('0x14')]?_0x14c9ef[_0x73c7('0x14')][_0x73c7('0x16')]||null:null,'attributes':_0x14c9ef['options']?_0x14c9ef[_0x73c7('0x14')][_0x73c7('0x17')]||null:null,'limit':_0x14c9ef[_0x73c7('0x14')]?_0x14c9ef[_0x73c7('0x14')][_0x73c7('0x18')]||null:null,'include':_0x14c9ef[_0x73c7('0x14')]?_0x14c9ef[_0x73c7('0x14')][_0x73c7('0x19')]?_[_0x73c7('0x1a')](_0x14c9ef[_0x73c7('0x14')][_0x73c7('0x19')],function(_0x54fc7f){return{'model':db[_0x54fc7f[_0x73c7('0x1b')]],'as':_0x54fc7f['as'],'attributes':_0x54fc7f[_0x73c7('0x17')],'include':_0x54fc7f[_0x73c7('0x19')]?_['map'](_0x54fc7f['include'],function(_0x1946a7){return{'model':db[_0x1946a7[_0x73c7('0x1b')]],'as':_0x1946a7['as'],'attributes':_0x1946a7[_0x73c7('0x17')],'include':_0x1946a7['include']?_[_0x73c7('0x1a')](_0x1946a7['include'],function(_0x275bc8){return{'model':db[_0x275bc8[_0x73c7('0x1b')]],'as':_0x275bc8['as'],'attributes':_0x275bc8[_0x73c7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x73c7('0x1c')](function(_0x39de3e){logger[_0x73c7('0x9')](_0x73c7('0x11'),_0x14c9ef);logger[_0x73c7('0xc')](_0x73c7('0x11'),_0x14c9ef,JSON[_0x73c7('0xd')](_0x39de3e));_0x3b5813(_0x39de3e);})[_0x73c7('0x1d')](function(_0x13ac92){logger['error'](_0x73c7('0x11'),_0x13ac92['message'],_0x14c9ef);_0x53a7e4(_0x3d8d49['error'](0x1f4,_0x13ac92[_0x73c7('0xf')]));});});};exports[_0x73c7('0x1e')]=function(_0x2394a0){var _0x589573=this;return new Promise(function(_0x4220d8,_0x3b89ae){return db['Trunk'][_0x73c7('0x1f')]({'raw':_0x2394a0[_0x73c7('0x14')]?_0x2394a0[_0x73c7('0x14')][_0x73c7('0x15')]===undefined?!![]:![]:!![],'where':_0x2394a0[_0x73c7('0x14')]?_0x2394a0[_0x73c7('0x14')][_0x73c7('0x16')]||null:null,'attributes':_0x2394a0[_0x73c7('0x14')]?_0x2394a0['options'][_0x73c7('0x17')]||null:null,'include':_0x2394a0[_0x73c7('0x14')]?_0x2394a0['options'][_0x73c7('0x19')]?_[_0x73c7('0x1a')](_0x2394a0['options']['include'],function(_0xf7986a){return{'model':db[_0xf7986a[_0x73c7('0x1b')]],'as':_0xf7986a['as'],'attributes':_0xf7986a['attributes'],'include':_0xf7986a[_0x73c7('0x19')]?_[_0x73c7('0x1a')](_0xf7986a[_0x73c7('0x19')],function(_0x1d86a6){return{'model':db[_0x1d86a6[_0x73c7('0x1b')]],'as':_0x1d86a6['as'],'attributes':_0x1d86a6[_0x73c7('0x17')],'include':_0x1d86a6[_0x73c7('0x19')]?_[_0x73c7('0x1a')](_0x1d86a6[_0x73c7('0x19')],function(_0x2f4124){return{'model':db[_0x2f4124['model']],'as':_0x2f4124['as'],'attributes':_0x2f4124[_0x73c7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x73c7('0x1c')](function(_0x3def2c){logger[_0x73c7('0x9')](_0x73c7('0x1e'),_0x2394a0);logger['debug']('ShowTrunk',_0x2394a0,JSON[_0x73c7('0xd')](_0x3def2c));_0x4220d8(_0x3def2c);})[_0x73c7('0x1d')](function(_0x38b6cf){logger[_0x73c7('0xe')](_0x73c7('0x1e'),_0x38b6cf[_0x73c7('0xf')],_0x2394a0);_0x3b89ae(_0x589573[_0x73c7('0xe')](0x1f4,_0x38b6cf[_0x73c7('0xf')]));});});}; \ No newline at end of file +var _0x14d6=['client','http','request','then','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21483b,_0x5b3af9){var _0x23a4ee=function(_0x102ecf){while(--_0x102ecf){_0x21483b['push'](_0x21483b['shift']());}};_0x23a4ee(++_0x5b3af9);}(_0x14d6,0x18d));var _0x614d=function(_0x391e19,_0x5b8ab7){_0x391e19=_0x391e19-0x0;var _0x39e2f9=_0x14d6[_0x391e19];return _0x39e2f9;};'use strict';var _=require(_0x614d('0x0'));var util=require(_0x614d('0x1'));var moment=require(_0x614d('0x2'));var BPromise=require('bluebird');var rs=require(_0x614d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x614d('0x4'))['db'];var utils=require(_0x614d('0x5'));var logger=require(_0x614d('0x6'))(_0x614d('0x7'));var config=require(_0x614d('0x8'));var jayson=require(_0x614d('0x9'));var client=jayson[_0x614d('0xa')][_0x614d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eac13,_0x1ddef4,_0x408d42){return new BPromise(function(_0x4169cc,_0x4408d3){return client[_0x614d('0xc')](_0x5eac13,_0x408d42)[_0x614d('0xd')](function(_0x473f25){logger['info']('Trunk,\x20%s,\x20%s',_0x1ddef4,_0x614d('0xe'));logger[_0x614d('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1ddef4,'request\x20sent',JSON[_0x614d('0x10')](_0x473f25));if(_0x473f25[_0x614d('0x11')]){if(_0x473f25['error'][_0x614d('0x12')]===0x1f4){logger[_0x614d('0x11')](_0x614d('0x13'),_0x1ddef4,_0x473f25[_0x614d('0x11')][_0x614d('0x14')]);return _0x4408d3(_0x473f25[_0x614d('0x11')]['message']);}logger[_0x614d('0x11')](_0x614d('0x13'),_0x1ddef4,_0x473f25[_0x614d('0x11')][_0x614d('0x14')]);return _0x4169cc(_0x473f25[_0x614d('0x11')]['message']);}else{logger[_0x614d('0x15')](_0x614d('0x13'),_0x1ddef4,'request\x20sent');_0x4169cc(_0x473f25[_0x614d('0x16')]['message']);}})[_0x614d('0x17')](function(_0x289a6d){logger[_0x614d('0x11')](_0x614d('0x13'),_0x1ddef4,_0x289a6d);_0x4408d3(_0x289a6d);});});}exports[_0x614d('0x18')]=function(_0x3e12c8){var _0x575b92=this;return new Promise(function(_0x7351b3,_0x4e51c1){return db[_0x614d('0x19')][_0x614d('0x1a')]({'raw':_0x3e12c8[_0x614d('0x1b')]?_0x3e12c8[_0x614d('0x1b')][_0x614d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e12c8[_0x614d('0x1b')]?_0x3e12c8[_0x614d('0x1b')][_0x614d('0x1d')]||null:null,'attributes':_0x3e12c8[_0x614d('0x1b')]?_0x3e12c8[_0x614d('0x1b')][_0x614d('0x1e')]||null:null,'limit':_0x3e12c8[_0x614d('0x1b')]?_0x3e12c8[_0x614d('0x1b')][_0x614d('0x1f')]||null:null,'include':_0x3e12c8[_0x614d('0x1b')]?_0x3e12c8[_0x614d('0x1b')][_0x614d('0x20')]?_[_0x614d('0x21')](_0x3e12c8[_0x614d('0x1b')][_0x614d('0x20')],function(_0x44dfd5){return{'model':db[_0x44dfd5[_0x614d('0x22')]],'as':_0x44dfd5['as'],'attributes':_0x44dfd5[_0x614d('0x1e')],'include':_0x44dfd5[_0x614d('0x20')]?_[_0x614d('0x21')](_0x44dfd5['include'],function(_0x1db22a){return{'model':db[_0x1db22a[_0x614d('0x22')]],'as':_0x1db22a['as'],'attributes':_0x1db22a['attributes'],'include':_0x1db22a[_0x614d('0x20')]?_[_0x614d('0x21')](_0x1db22a[_0x614d('0x20')],function(_0x47fd08){return{'model':db[_0x47fd08['model']],'as':_0x47fd08['as'],'attributes':_0x47fd08['attributes']};}):[]};}):[]};}):[]:[]})[_0x614d('0xd')](function(_0xd4b884){logger[_0x614d('0x15')](_0x614d('0x18'),_0x3e12c8);logger[_0x614d('0xf')](_0x614d('0x18'),_0x3e12c8,JSON['stringify'](_0xd4b884));_0x7351b3(_0xd4b884);})[_0x614d('0x17')](function(_0x3836d7){logger[_0x614d('0x11')](_0x614d('0x18'),_0x3836d7[_0x614d('0x14')],_0x3e12c8);_0x4e51c1(_0x575b92[_0x614d('0x11')](0x1f4,_0x3836d7[_0x614d('0x14')]));});});};exports[_0x614d('0x23')]=function(_0x482322){var _0x151e28=this;return new Promise(function(_0x84b14d,_0x1f8ee7){return db['Trunk'][_0x614d('0x24')]({'raw':_0x482322['options']?_0x482322[_0x614d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x482322[_0x614d('0x1b')]?_0x482322[_0x614d('0x1b')][_0x614d('0x1d')]||null:null,'attributes':_0x482322['options']?_0x482322['options']['attributes']||null:null,'include':_0x482322[_0x614d('0x1b')]?_0x482322['options'][_0x614d('0x20')]?_[_0x614d('0x21')](_0x482322['options']['include'],function(_0x511ca1){return{'model':db[_0x511ca1[_0x614d('0x22')]],'as':_0x511ca1['as'],'attributes':_0x511ca1[_0x614d('0x1e')],'include':_0x511ca1[_0x614d('0x20')]?_[_0x614d('0x21')](_0x511ca1[_0x614d('0x20')],function(_0x49cefe){return{'model':db[_0x49cefe[_0x614d('0x22')]],'as':_0x49cefe['as'],'attributes':_0x49cefe[_0x614d('0x1e')],'include':_0x49cefe['include']?_[_0x614d('0x21')](_0x49cefe[_0x614d('0x20')],function(_0x7f5e8){return{'model':db[_0x7f5e8['model']],'as':_0x7f5e8['as'],'attributes':_0x7f5e8[_0x614d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x614d('0xd')](function(_0x5647b8){logger[_0x614d('0x15')](_0x614d('0x23'),_0x482322);logger['debug'](_0x614d('0x23'),_0x482322,JSON[_0x614d('0x10')](_0x5647b8));_0x84b14d(_0x5647b8);})[_0x614d('0x17')](function(_0x1540ba){logger[_0x614d('0x11')](_0x614d('0x23'),_0x1540ba[_0x614d('0x14')],_0x482322);_0x1f8ee7(_0x151e28[_0x614d('0x11')](0x1f4,_0x1540ba[_0x614d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c5ca426..a39bf6f 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d66=['put','isAuthenticated','update','exports','express','../../components/auth/service','./user-setting.controller'];(function(_0x25b268,_0x58f9f6){var _0x9659c1=function(_0x1ceed8){while(--_0x1ceed8){_0x25b268['push'](_0x25b268['shift']());}};_0x9659c1(++_0x58f9f6);}(_0x8d66,0x12a));var _0x68d6=function(_0x51f41d,_0x16af10){_0x51f41d=_0x51f41d-0x0;var _0x4b2a15=_0x8d66[_0x51f41d];return _0x4b2a15;};'use strict';var express=require(_0x68d6('0x0'));var router=express['Router']();var auth=require(_0x68d6('0x1'));var controller=require(_0x68d6('0x2'));router[_0x68d6('0x3')]('/:id',auth[_0x68d6('0x4')](),controller[_0x68d6('0x5')]);module[_0x68d6('0x6')]=router; \ No newline at end of file +var _0x9d69=['isAuthenticated','exports','express','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x5d11fa,_0x5ed6e9){var _0x3fe458=function(_0x45bfb9){while(--_0x45bfb9){_0x5d11fa['push'](_0x5d11fa['shift']());}};_0x3fe458(++_0x5ed6e9);}(_0x9d69,0x8e));var _0x99d6=function(_0xc0fb6a,_0x4e931b){_0xc0fb6a=_0xc0fb6a-0x0;var _0x3ff7e6=_0x9d69[_0xc0fb6a];return _0x3ff7e6;};'use strict';var express=require(_0x99d6('0x0'));var router=express['Router']();var auth=require(_0x99d6('0x1'));var controller=require(_0x99d6('0x2'));router[_0x99d6('0x3')](_0x99d6('0x4'),auth[_0x99d6('0x5')](),controller['update']);module[_0x99d6('0x6')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index de406ef..9094a5d 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64e6=['ENUM','BOOLEAN','TEXT','INTEGER','UserId','sequelize','error','warning','info','debug','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x64e6,0xb5));var _0x664e=function(_0x23d117,_0x1ce266){_0x23d117=_0x23d117-0x0;var _0x400434=_0x64e6[_0x23d117];return _0x400434;};'use strict';var Sequelize=require(_0x664e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x664e('0x1'),_0x664e('0x2'),_0x664e('0x3'),_0x664e('0x4')];module[_0x664e('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x664e('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x664e('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x664e('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x664e('0x9')],'unique':_0x664e('0xa')}}; \ No newline at end of file +var _0xec06=['INTEGER','UserId','sequelize','error','warning','debug','exports','TEXT','DATE'];(function(_0x29a55b,_0x5a7089){var _0xa84685=function(_0x2ae897){while(--_0x2ae897){_0x29a55b['push'](_0x29a55b['shift']());}};_0xa84685(++_0x5a7089);}(_0xec06,0x13d));var _0x6ec0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xec06[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6ec0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x6ec0('0x1'),_0x6ec0('0x2'),'info',_0x6ec0('0x3')];module[_0x6ec0('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x6ec0('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x6ec0('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x6ec0('0x7')],'unique':_0x6ec0('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 2c7995f..c4301b2 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd847=['./user-setting.socket','register','status','json','update','sendStatus','error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','then','catch','lodash','ioredis','../../config/logger','api','socket.io-emitter','redis'];(function(_0x262bbe,_0xa1aa68){var _0x39310f=function(_0x3274de){while(--_0x3274de){_0x262bbe['push'](_0x262bbe['shift']());}};_0x39310f(++_0xa1aa68);}(_0xd847,0x18a));var _0x7d84=function(_0x4b2a90,_0xba32e6){_0x4b2a90=_0x4b2a90-0x0;var _0x1cea31=_0xd847[_0x4b2a90];return _0x1cea31;};'use strict';var _=require(_0x7d84('0x0'));var Redis=require(_0x7d84('0x1'));var logger=require(_0x7d84('0x2'))(_0x7d84('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x7d84('0x4'))(new Redis(config[_0x7d84('0x5')]));require(_0x7d84('0x6'))[_0x7d84('0x7')](socket);config[_0x7d84('0x5')]=_['defaults'](config[_0x7d84('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3c57cd,_0x20ce63){_0x20ce63=_0x20ce63||0xc8;return function(_0x1d6297){if(_0x1d6297){return _0x3c57cd[_0x7d84('0x8')](_0x20ce63)[_0x7d84('0x9')](_0x1d6297);}};}function saveUpdates(_0x31ec83){return function(_0x5d7fda){if(_0x5d7fda){return _0x5d7fda[_0x7d84('0xa')](_0x31ec83)['then'](function(_0x4a9dc7){return _0x4a9dc7;});}return null;};}function handleEntityNotFound(_0x11c4ec){return function(_0x2156a9){if(!_0x2156a9){_0x11c4ec[_0x7d84('0xb')](0x194);}return _0x2156a9;};}function handleError(_0x27aa7a,_0x45261e){_0x45261e=_0x45261e||0x1f4;return function(_0x2a0e6d){logger[_0x7d84('0xc')](_0x2a0e6d[_0x7d84('0xd')]);if(_0x2a0e6d[_0x7d84('0xe')]){delete _0x2a0e6d[_0x7d84('0xe')];}_0x27aa7a[_0x7d84('0x8')](_0x45261e)[_0x7d84('0xf')](_0x2a0e6d);};}exports[_0x7d84('0xa')]=function(_0x245dd6,_0xc47a80){if(_0x245dd6[_0x7d84('0x10')][_0x7d84('0x11')]!==_0x7d84('0x12'))throw new Error(_0x7d84('0x13'));if(isNaN(Number(_0x245dd6[_0x7d84('0x14')]['id'])))throw new Error(_0x7d84('0x15'));return db['UserSetting'][_0x7d84('0x16')]({'where':{'id':_0x245dd6[_0x7d84('0x14')]['id']}})['then'](handleEntityNotFound(_0xc47a80,null))['then'](saveUpdates(_0x245dd6['body'],null))[_0x7d84('0x17')](respondWithResult(_0xc47a80,null))[_0x7d84('0x18')](handleError(_0xc47a80,null));}; \ No newline at end of file +var _0x9de3=['lodash','../../config/logger','api','../../config/environment','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','status','update','then','sendStatus','error','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body'];(function(_0x4409eb,_0x4589ee){var _0x3b7010=function(_0x14c49){while(--_0x14c49){_0x4409eb['push'](_0x4409eb['shift']());}};_0x3b7010(++_0x4589ee);}(_0x9de3,0xea));var _0x39de=function(_0x5ac7c7,_0x52f2c8){_0x5ac7c7=_0x5ac7c7-0x0;var _0x3840c6=_0x9de3[_0x5ac7c7];return _0x3840c6;};'use strict';var _=require(_0x39de('0x0'));var Redis=require('ioredis');var logger=require(_0x39de('0x1'))(_0x39de('0x2'));var config=require(_0x39de('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x39de('0x4'))(new Redis(config['redis']));require(_0x39de('0x5'))[_0x39de('0x6')](socket);config[_0x39de('0x7')]=_[_0x39de('0x8')](config['redis'],{'host':_0x39de('0x9'),'port':0x18eb});function respondWithResult(_0x185872,_0x3ed6a1){_0x3ed6a1=_0x3ed6a1||0xc8;return function(_0x87049c){if(_0x87049c){return _0x185872[_0x39de('0xa')](_0x3ed6a1)['json'](_0x87049c);}};}function saveUpdates(_0x4e7204){return function(_0x5d9240){if(_0x5d9240){return _0x5d9240[_0x39de('0xb')](_0x4e7204)[_0x39de('0xc')](function(_0x3e92d9){return _0x3e92d9;});}return null;};}function handleEntityNotFound(_0x3185dc){return function(_0x4450ec){if(!_0x4450ec){_0x3185dc[_0x39de('0xd')](0x194);}return _0x4450ec;};}function handleError(_0x431b4a,_0x1cc2b4){_0x1cc2b4=_0x1cc2b4||0x1f4;return function(_0x4f92a1){logger[_0x39de('0xe')](_0x4f92a1['stack']);if(_0x4f92a1['name']){delete _0x4f92a1[_0x39de('0xf')];}_0x431b4a[_0x39de('0xa')](_0x1cc2b4)[_0x39de('0x10')](_0x4f92a1);};}exports['update']=function(_0x1c60af,_0x236b14){if(_0x1c60af[_0x39de('0x11')][_0x39de('0x12')]!==_0x39de('0x13'))throw new Error(_0x39de('0x14'));if(isNaN(Number(_0x1c60af[_0x39de('0x15')]['id'])))throw new Error(_0x39de('0x16'));return db[_0x39de('0x17')][_0x39de('0x18')]({'where':{'id':_0x1c60af['params']['id']}})[_0x39de('0xc')](handleEntityNotFound(_0x236b14,null))[_0x39de('0xc')](saveUpdates(_0x1c60af[_0x39de('0x19')],null))[_0x39de('0xc')](respondWithResult(_0x236b14,null))['catch'](handleError(_0x236b14,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index c91d5bf..40ea568 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dee=['../../mysqldb','UserSetting','save','update','emit','exports','events'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x7dee,0x15d));var _0xe7de=function(_0x249678,_0x14c270){_0x249678=_0x249678-0x0;var _0x4160c1=_0x7dee[_0x249678];return _0x4160c1;};'use strict';var EventEmitter=require(_0xe7de('0x0'));var UserSetting=require(_0xe7de('0x1'))['db'][_0xe7de('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7de('0x3'),'afterUpdate':_0xe7de('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6571c1){return function(_0x1f4b9e,_0x341c1a,_0x341cf8){UserSettingEvents[_0xe7de('0x5')](_0x6571c1+':'+_0x1f4b9e['id'],_0x1f4b9e);UserSettingEvents[_0xe7de('0x5')](_0x6571c1,_0x1f4b9e);_0x341cf8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xe7de('0x6')]=UserSettingEvents; \ No newline at end of file +var _0x36e6=['update','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3f0ee9,_0x3576ad){var _0x305bb1=function(_0x50e1d1){while(--_0x50e1d1){_0x3f0ee9['push'](_0x3f0ee9['shift']());}};_0x305bb1(++_0x3576ad);}(_0x36e6,0xac));var _0x636e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x36e6[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x636e('0x0'));var UserSetting=require(_0x636e('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x636e('0x2')](0x0);var events={'afterCreate':_0x636e('0x3'),'afterUpdate':_0x636e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e4275){return function(_0x599f47,_0x4617ab,_0x5eab20){UserSettingEvents[_0x636e('0x5')](_0x1e4275+':'+_0x599f47['id'],_0x599f47);UserSettingEvents[_0x636e('0x5')](_0x1e4275,_0x599f47);_0x5eab20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x636e('0x6')](e,emitEvent(event));}}module[_0x636e('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index e903e35..e1c0810 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd110=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings'];(function(_0x4806f4,_0x1f0f9f){var _0x3e45c5=function(_0x59b0a3){while(--_0x59b0a3){_0x4806f4['push'](_0x4806f4['shift']());}};_0x3e45c5(++_0x1f0f9f);}(_0xd110,0x1e8));var _0x0d11=function(_0x12e488,_0x525479){_0x12e488=_0x12e488-0x0;var _0x396902=_0xd110[_0x12e488];return _0x396902;};'use strict';var attributes=require(_0x0d11('0x0'));module[_0x0d11('0x1')]=function(_0x13a9c0){return _0x13a9c0['define'](_0x0d11('0x2'),attributes,{'tableName':_0x0d11('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db155){if(!_0x2db155[_0x0d11('0x4')])_0x2db155[_0x0d11('0x5')]=null;else if(_0x2db155[_0x0d11('0x5')]===null)_0x2db155[_0x0d11('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x081e=['exports','define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x85058d,_0x1dd142){var _0x4ddade=function(_0x10475b){while(--_0x10475b){_0x85058d['push'](_0x85058d['shift']());}};_0x4ddade(++_0x1dd142);}(_0x081e,0xc5));var _0xe081=function(_0x1649af,_0x9522f8){_0x1649af=_0x1649af-0x0;var _0x28359a=_0x081e[_0x1649af];return _0x28359a;};'use strict';var attributes=require(_0xe081('0x0'));module[_0xe081('0x1')]=function(_0x526a85){return _0x526a85[_0xe081('0x2')]('UserSetting',attributes,{'tableName':_0xe081('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a48ae){if(!_0x3a48ae[_0xe081('0x4')])_0x3a48ae[_0xe081('0x5')]=null;else if(_0x3a48ae[_0xe081('0x5')]===null)_0x3a48ae[_0xe081('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 6c28a2d..07e6eae 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c8a=['remove','update','emit','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x9c8a,0xbc));var _0xa9c8=function(_0x2b0c12,_0x1539ef){_0x2b0c12=_0x2b0c12-0x0;var _0x390736=_0x9c8a[_0x2b0c12];return _0x390736;};'use strict';var UserSettingEvents=require(_0xa9c8('0x0'));var events=[_0xa9c8('0x1'),_0xa9c8('0x2'),_0xa9c8('0x3')];function createListener(_0x11ddca,_0x415094){return function(_0x52f5e1){_0x415094[_0xa9c8('0x4')](_0x11ddca,_0x52f5e1);if(_0x11ddca==='user-setting:update'){_0x415094[_0xa9c8('0x4')](_0xa9c8('0x5')+_0x52f5e1[_0xa9c8('0x6')],_0x52f5e1);}};}exports[_0xa9c8('0x7')]=function(_0x32ac30){for(var _0x38ff3d=0x0,_0x497877=events[_0xa9c8('0x8')];_0x38ff3d<_0x497877;_0x38ff3d++){var _0x27ca51=events[_0x38ff3d];var _0x5adf8e=createListener(_0xa9c8('0x9')+_0x27ca51,_0x32ac30);UserSettingEvents['on'](_0x27ca51,_0x5adf8e);}}; \ No newline at end of file +var _0x8842=['user-setting:','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length'];(function(_0xca259a,_0x315e30){var _0x43dc10=function(_0x13893f){while(--_0x13893f){_0xca259a['push'](_0xca259a['shift']());}};_0x43dc10(++_0x315e30);}(_0x8842,0x83));var _0x2884=function(_0x50f298,_0x15ec50){_0x50f298=_0x50f298-0x0;var _0xa1ab2=_0x8842[_0x50f298];return _0xa1ab2;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x2884('0x0'),_0x2884('0x1'),_0x2884('0x2')];function createListener(_0x160e86,_0x47f669){return function(_0x487724){_0x47f669[_0x2884('0x3')](_0x160e86,_0x487724);if(_0x160e86===_0x2884('0x4')){_0x47f669[_0x2884('0x3')](_0x2884('0x5')+_0x487724[_0x2884('0x6')],_0x487724);}};}exports[_0x2884('0x7')]=function(_0x10ed40){for(var _0x1c64ae=0x0,_0x5c21ac=events[_0x2884('0x8')];_0x1c64ae<_0x5c21ac;_0x1c64ae++){var _0x37fb21=events[_0x1c64ae];var _0x5daf20=createListener(_0x2884('0x9')+_0x37fb21,_0x10ed40);UserSettingEvents['on'](_0x37fb21,_0x5daf20);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 70a0c1f..438a195 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 _0xab1a=['/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','post','/:id/contacts','/:id/queues','addQueues','join','root','server/files/images/','format','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','/:id/whatsapp_accounts','put','update','changePassword','delete','removeTeams','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami'];(function(_0x3c3984,_0x86b37c){var _0x3290ec=function(_0xa445e9){while(--_0xa445e9){_0x3c3984['push'](_0x3c3984['shift']());}};_0x3290ec(++_0x86b37c);}(_0xab1a,0x14c));var _0xaab1=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0xab1a[_0x2307fa];return _0x496486;};'use strict';var multer=require(_0xaab1('0x0'));var util=require(_0xaab1('0x1'));var path=require(_0xaab1('0x2'));var timeout=require(_0xaab1('0x3'));var express=require(_0xaab1('0x4'));var router=express['Router']();var fs_extra=require(_0xaab1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaab1('0x6'));var config=require(_0xaab1('0x7'));var controller=require(_0xaab1('0x8'));router[_0xaab1('0x9')]('/',auth['isAuthenticated'](),controller[_0xaab1('0xa')]);router['get'](_0xaab1('0xb'),auth[_0xaab1('0xc')](),controller[_0xaab1('0xd')]);router[_0xaab1('0x9')](_0xaab1('0xe'),auth['isAuthenticated'](),controller[_0xaab1('0xf')]);router[_0xaab1('0x9')](_0xaab1('0x10'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x11')]);router[_0xaab1('0x9')](_0xaab1('0x12'),auth['isAuthenticated'](),controller['show']);router['get'](_0xaab1('0x13'),controller[_0xaab1('0x14')]);router['get'](_0xaab1('0x15'),auth['isAuthenticated'](),controller[_0xaab1('0x16')]);router[_0xaab1('0x9')]('/:id/contacts',auth[_0xaab1('0xc')](),controller['getContacts']);router[_0xaab1('0x9')]('/:id/queues',auth[_0xaab1('0xc')](),controller['getQueues']);router[_0xaab1('0x9')](_0xaab1('0x17'),auth['isAuthenticated'](),controller[_0xaab1('0x18')]);router[_0xaab1('0x9')](_0xaab1('0x19'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x1a')]);router[_0xaab1('0x9')](_0xaab1('0x1b'),auth['isAuthenticated'](),controller[_0xaab1('0x1c')]);router[_0xaab1('0x9')](_0xaab1('0x1d'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x1e')]);router[_0xaab1('0x9')](_0xaab1('0x1f'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x20')]);router[_0xaab1('0x9')](_0xaab1('0x21'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x22')]);router[_0xaab1('0x9')](_0xaab1('0x23'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x24')]);router[_0xaab1('0x9')](_0xaab1('0x25'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x26')]);router[_0xaab1('0x9')](_0xaab1('0x27'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x28')]);router[_0xaab1('0x9')](_0xaab1('0x29'),auth[_0xaab1('0xc')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0xaab1('0xc')](),controller[_0xaab1('0x2a')]);router['get'](_0xaab1('0x2b'),auth['isAuthenticated'](),controller[_0xaab1('0x2c')]);router[_0xaab1('0x9')](_0xaab1('0x2d'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x2e')]);router[_0xaab1('0x9')](_0xaab1('0x2f'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x30')]);router[_0xaab1('0x9')](_0xaab1('0x31'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x32')]);router[_0xaab1('0x9')](_0xaab1('0x33'),auth[_0xaab1('0xc')](),controller['getMailAccounts']);router['get'](_0xaab1('0x34'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x35')]);router[_0xaab1('0x9')](_0xaab1('0x36'),auth['isAuthenticated'](),controller[_0xaab1('0x37')]);router[_0xaab1('0x9')](_0xaab1('0x38'),auth[_0xaab1('0xc')](),controller['getChatWebsites']);router[_0xaab1('0x9')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0xaab1('0x9')](_0xaab1('0x39'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x3a')]);router[_0xaab1('0x9')](_0xaab1('0x3b'),auth[_0xaab1('0xc')](),controller['getScheduledCalls']);router[_0xaab1('0x9')](_0xaab1('0x3c'),auth[_0xaab1('0xc')](),controller['getApiKey']);router[_0xaab1('0x3d')](_0xaab1('0x3e'),auth[_0xaab1('0xc')](),controller['addContacts']);router['post']('/',auth[_0xaab1('0xc')](),controller['create']);router[_0xaab1('0x3d')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0xaab1('0x3d')](_0xaab1('0x3f'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xdeec6,_0x994b23,_0x10178e){_0x10178e(null,path[_0xaab1('0x41')](config[_0xaab1('0x42')],_0xaab1('0x43')));},'filename':function(_0x42df3d,_0x53c4bd,_0x2d63b8){_0x2d63b8(null,util[_0xaab1('0x44')]('%s-%s',Date[_0xaab1('0x45')](),_0x53c4bd[_0xaab1('0x46')]));}})});router[_0xaab1('0x3d')](_0xaab1('0x13'),upload[_0xaab1('0x47')](_0xaab1('0x48')),controller[_0xaab1('0x49')]);router[_0xaab1('0x3d')](_0xaab1('0x4a'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x4b')]);router[_0xaab1('0x3d')](_0xaab1('0x4c'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x4d')]);router[_0xaab1('0x3d')](_0xaab1('0x4e'),auth['isAuthenticated'](),controller['pause']);router[_0xaab1('0x3d')](_0xaab1('0x4f'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x50')]);router[_0xaab1('0x3d')](_0xaab1('0x51'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x52')]);router[_0xaab1('0x3d')](_0xaab1('0x53'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x54')]);router[_0xaab1('0x3d')](_0xaab1('0x55'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x56')]);router[_0xaab1('0x3d')](_0xaab1('0x57'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x58')]);router[_0xaab1('0x3d')](_0xaab1('0x59'),auth['isAuthenticated'](),controller[_0xaab1('0x5a')]);router[_0xaab1('0x3d')](_0xaab1('0x5b'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x5c')]);router[_0xaab1('0x3d')]('/:id/whatsapp_interactions',auth[_0xaab1('0xc')](),controller[_0xaab1('0x5d')]);router[_0xaab1('0x3d')](_0xaab1('0x31'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x5e')]);router[_0xaab1('0x3d')](_0xaab1('0x33'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x5f')]);router[_0xaab1('0x3d')](_0xaab1('0x34'),auth['isAuthenticated'](),controller[_0xaab1('0x60')]);router[_0xaab1('0x3d')](_0xaab1('0x36'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0xaab1('0x3d')](_0xaab1('0x38'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x61')]);router['post'](_0xaab1('0x62'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xaab1('0x3d')](_0xaab1('0x39'),auth[_0xaab1('0xc')](),controller['addSquareProjects']);router['post'](_0xaab1('0x3c'),auth[_0xaab1('0xc')](),controller['createApiKey']);router[_0xaab1('0x63')]('/:id',auth[_0xaab1('0xc')](),controller[_0xaab1('0x64')]);router['put']('/:id/password',auth[_0xaab1('0xc')](),controller[_0xaab1('0x65')]);router[_0xaab1('0x66')]('/:id/queues',auth[_0xaab1('0xc')](),controller['removeQueues']);router[_0xaab1('0x66')](_0xaab1('0x51'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x67')]);router[_0xaab1('0x66')](_0xaab1('0x12'),auth[_0xaab1('0xc')](),controller['destroy']);router[_0xaab1('0x66')]('/:id/chat_interactions',auth[_0xaab1('0xc')](),controller['removeChatInteractions']);router['delete'](_0xaab1('0x55'),auth['isAuthenticated'](),controller[_0xaab1('0x68')]);router[_0xaab1('0x66')](_0xaab1('0x57'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x69')]);router[_0xaab1('0x66')](_0xaab1('0x59'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x6a')]);router[_0xaab1('0x66')](_0xaab1('0x5b'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x6b')]);router[_0xaab1('0x66')](_0xaab1('0x6c'),auth['isAuthenticated'](),controller[_0xaab1('0x6d')]);router[_0xaab1('0x66')]('/:id/fax_accounts',auth[_0xaab1('0xc')](),controller[_0xaab1('0x6e')]);router[_0xaab1('0x66')](_0xaab1('0x33'),auth['isAuthenticated'](),controller[_0xaab1('0x6f')]);router['delete'](_0xaab1('0x34'),auth['isAuthenticated'](),controller[_0xaab1('0x70')]);router[_0xaab1('0x66')](_0xaab1('0x36'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x71')]);router['delete'](_0xaab1('0x38'),auth['isAuthenticated'](),controller[_0xaab1('0x72')]);router[_0xaab1('0x66')](_0xaab1('0x62'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0xaab1('0x39'),auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete'](_0xaab1('0x3c'),auth[_0xaab1('0xc')](),controller[_0xaab1('0x73')]);module['exports']=router; \ No newline at end of file +var _0x629e=['/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','logout','/:id/pause','pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','/:id/sms_accounts','/:id/square_projects','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions'];(function(_0x56cdac,_0x146c2f){var _0x23dfa1=function(_0x22e3b5){while(--_0x22e3b5){_0x56cdac['push'](_0x56cdac['shift']());}};_0x23dfa1(++_0x146c2f);}(_0x629e,0x144));var _0xe629=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x629e[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0xe629('0x0'));var path=require(_0xe629('0x1'));var timeout=require(_0xe629('0x2'));var express=require(_0xe629('0x3'));var router=express[_0xe629('0x4')]();var fs_extra=require(_0xe629('0x5'));var auth=require(_0xe629('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe629('0x7'));var controller=require(_0xe629('0x8'));router[_0xe629('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe629('0x9')](_0xe629('0xa'),auth[_0xe629('0xb')](),controller['describe']);router[_0xe629('0x9')](_0xe629('0xc'),auth[_0xe629('0xb')](),controller['whoami']);router[_0xe629('0x9')](_0xe629('0xd'),auth[_0xe629('0xb')](),controller[_0xe629('0xe')]);router[_0xe629('0x9')](_0xe629('0xf'),auth[_0xe629('0xb')](),controller[_0xe629('0x10')]);router['get'](_0xe629('0x11'),controller[_0xe629('0x12')]);router['get'](_0xe629('0x13'),auth[_0xe629('0xb')](),controller[_0xe629('0x14')]);router[_0xe629('0x9')](_0xe629('0x15'),auth['isAuthenticated'](),controller[_0xe629('0x16')]);router[_0xe629('0x9')]('/:id/queues',auth['isAuthenticated'](),controller[_0xe629('0x17')]);router[_0xe629('0x9')]('/:id/queues_rt',auth[_0xe629('0xb')](),controller[_0xe629('0x18')]);router[_0xe629('0x9')](_0xe629('0x19'),auth['isAuthenticated'](),controller[_0xe629('0x1a')]);router[_0xe629('0x9')](_0xe629('0x1b'),auth['isAuthenticated'](),controller['getRecordings']);router['get'](_0xe629('0x1c'),auth['isAuthenticated'](),controller[_0xe629('0x1d')]);router[_0xe629('0x9')](_0xe629('0x1e'),auth[_0xe629('0xb')](),controller['getChatInteractions']);router[_0xe629('0x9')](_0xe629('0x1f'),auth['isAuthenticated'](),controller[_0xe629('0x20')]);router['get'](_0xe629('0x21'),auth[_0xe629('0xb')](),controller[_0xe629('0x22')]);router['get'](_0xe629('0x23'),auth[_0xe629('0xb')](),controller['getSmsInteractions']);router[_0xe629('0x9')](_0xe629('0x24'),auth[_0xe629('0xb')](),controller[_0xe629('0x25')]);router['get']('/:id/whatsapp/interactions',auth[_0xe629('0xb')](),controller[_0xe629('0x26')]);router[_0xe629('0x9')](_0xe629('0x27'),auth[_0xe629('0xb')](),controller['getTeams']);router[_0xe629('0x9')](_0xe629('0x28'),auth[_0xe629('0xb')](),controller[_0xe629('0x29')]);router[_0xe629('0x9')](_0xe629('0x2a'),auth[_0xe629('0xb')](),controller['getAgents']);router[_0xe629('0x9')](_0xe629('0x2b'),auth[_0xe629('0xb')](),controller[_0xe629('0x2c')]);router[_0xe629('0x9')](_0xe629('0x2d'),auth['isAuthenticated'](),controller[_0xe629('0x2e')]);router[_0xe629('0x9')](_0xe629('0x2f'),auth['isAuthenticated'](),controller[_0xe629('0x30')]);router['get'](_0xe629('0x31'),auth['isAuthenticated'](),controller[_0xe629('0x32')]);router['get']('/:id/sms_accounts',auth[_0xe629('0xb')](),controller[_0xe629('0x33')]);router[_0xe629('0x9')](_0xe629('0x34'),auth[_0xe629('0xb')](),controller[_0xe629('0x35')]);router[_0xe629('0x9')](_0xe629('0x36'),auth[_0xe629('0xb')](),controller[_0xe629('0x37')]);router[_0xe629('0x9')]('/:id/square_projects',auth[_0xe629('0xb')](),controller[_0xe629('0x38')]);router[_0xe629('0x9')](_0xe629('0x39'),auth[_0xe629('0xb')](),controller[_0xe629('0x3a')]);router[_0xe629('0x9')]('/:id/api_key',auth[_0xe629('0xb')](),controller[_0xe629('0x3b')]);router['post']('/:id/contacts',auth[_0xe629('0xb')](),controller['addContacts']);router[_0xe629('0x3c')]('/',auth[_0xe629('0xb')](),controller['create']);router[_0xe629('0x3c')](_0xe629('0x3d'),auth[_0xe629('0xb')](),controller[_0xe629('0x3e')]);router[_0xe629('0x3c')]('/:id/queues',auth[_0xe629('0xb')](),controller[_0xe629('0x3f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c9e5f,_0x42efc5,_0x300848){_0x300848(null,path[_0xe629('0x40')](config[_0xe629('0x41')],_0xe629('0x42')));},'filename':function(_0x27c9b6,_0x5b5735,_0x1059bf){_0x1059bf(null,util[_0xe629('0x43')](_0xe629('0x44'),Date[_0xe629('0x45')](),_0x5b5735[_0xe629('0x46')]));}})});router[_0xe629('0x3c')](_0xe629('0x11'),upload[_0xe629('0x47')](_0xe629('0x48')),controller[_0xe629('0x49')]);router['post'](_0xe629('0x4a'),auth[_0xe629('0xb')](),controller['login']);router[_0xe629('0x3c')]('/:id/logout',auth[_0xe629('0xb')](),controller[_0xe629('0x4b')]);router['post'](_0xe629('0x4c'),auth['isAuthenticated'](),controller[_0xe629('0x4d')]);router['post'](_0xe629('0x4e'),auth[_0xe629('0xb')](),controller[_0xe629('0x4f')]);router['post'](_0xe629('0x27'),auth[_0xe629('0xb')](),controller['addTeams']);router[_0xe629('0x3c')]('/:id/chat_interactions',auth[_0xe629('0xb')](),controller[_0xe629('0x50')]);router[_0xe629('0x3c')](_0xe629('0x51'),auth[_0xe629('0xb')](),controller[_0xe629('0x52')]);router[_0xe629('0x3c')](_0xe629('0x53'),auth[_0xe629('0xb')](),controller[_0xe629('0x54')]);router['post'](_0xe629('0x55'),auth[_0xe629('0xb')](),controller[_0xe629('0x56')]);router[_0xe629('0x3c')](_0xe629('0x57'),auth['isAuthenticated'](),controller[_0xe629('0x58')]);router[_0xe629('0x3c')](_0xe629('0x59'),auth['isAuthenticated'](),controller[_0xe629('0x5a')]);router['post'](_0xe629('0x2d'),auth['isAuthenticated'](),controller[_0xe629('0x5b')]);router[_0xe629('0x3c')](_0xe629('0x2f'),auth['isAuthenticated'](),controller[_0xe629('0x5c')]);router[_0xe629('0x3c')]('/:id/openchannel_accounts',auth[_0xe629('0xb')](),controller[_0xe629('0x5d')]);router[_0xe629('0x3c')]('/:id/sms_accounts',auth[_0xe629('0xb')](),controller['addSmsAccounts']);router[_0xe629('0x3c')](_0xe629('0x34'),auth[_0xe629('0xb')](),controller[_0xe629('0x5e')]);router[_0xe629('0x3c')](_0xe629('0x36'),auth[_0xe629('0xb')](),controller[_0xe629('0x5f')]);router[_0xe629('0x3c')]('/:id/square_projects',auth[_0xe629('0xb')](),controller[_0xe629('0x60')]);router['post'](_0xe629('0x61'),auth[_0xe629('0xb')](),controller[_0xe629('0x62')]);router['put'](_0xe629('0xf'),auth[_0xe629('0xb')](),controller[_0xe629('0x63')]);router[_0xe629('0x64')](_0xe629('0x65'),auth[_0xe629('0xb')](),controller[_0xe629('0x66')]);router[_0xe629('0x67')](_0xe629('0x68'),auth[_0xe629('0xb')](),controller[_0xe629('0x69')]);router['delete'](_0xe629('0x27'),auth[_0xe629('0xb')](),controller[_0xe629('0x6a')]);router[_0xe629('0x67')](_0xe629('0xf'),auth['isAuthenticated'](),controller[_0xe629('0x6b')]);router[_0xe629('0x67')](_0xe629('0x6c'),auth['isAuthenticated'](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0xe629('0xb')](),controller[_0xe629('0x6d')]);router['delete']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xe629('0x6e')]);router['delete'](_0xe629('0x55'),auth[_0xe629('0xb')](),controller[_0xe629('0x6f')]);router[_0xe629('0x67')](_0xe629('0x57'),auth['isAuthenticated'](),controller[_0xe629('0x70')]);router[_0xe629('0x67')](_0xe629('0x59'),auth[_0xe629('0xb')](),controller[_0xe629('0x71')]);router[_0xe629('0x67')](_0xe629('0x2d'),auth[_0xe629('0xb')](),controller['removeFaxAccounts']);router[_0xe629('0x67')](_0xe629('0x2f'),auth[_0xe629('0xb')](),controller['removeMailAccounts']);router[_0xe629('0x67')](_0xe629('0x31'),auth[_0xe629('0xb')](),controller[_0xe629('0x72')]);router['delete'](_0xe629('0x73'),auth[_0xe629('0xb')](),controller['removeSmsAccounts']);router[_0xe629('0x67')](_0xe629('0x34'),auth[_0xe629('0xb')](),controller['removeChatWebsites']);router[_0xe629('0x67')](_0xe629('0x36'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0xe629('0x74'),auth['isAuthenticated'](),controller[_0xe629('0x75')]);router[_0xe629('0x67')]('/:id/api_key',auth[_0xe629('0xb')](),controller[_0xe629('0x76')]);module[_0xe629('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 0eb3bf0..997e681 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 _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x16991c,_0x577041){var _0x14111a=function(_0x4727c2){while(--_0x4727c2){_0x16991c['push'](_0x16991c['shift']());}};_0x14111a(++_0x577041);}(_0xe706,0xa3));var _0x6e70=function(_0x2612dd,_0x1b3ed){_0x2612dd=_0x2612dd-0x0;var _0x15af02=_0xe706[_0x2612dd];return _0x15af02;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 95d7915..0f821cc 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 _0xbe66=['generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','teams','inbound','flatten','lower','col','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','pause','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','client','http','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','update','emit','destroy','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','map','value','includes','find','name','User','rawAttributes','type','password','getOptions','where','query','include','userSetting','true','UserSetting','push','findAll','rows','openTabs','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','model','differenceBy','keys','salt','intersection','attributes','fields','length','includeAll','merge','options','chat','body','params','describe','addContacts','ids','omit','internal','Setting','findById','validatePasswordPattern','max','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','isNil','from','mailbox','VoiceMail','permissions','101','103','113','107','108','109','100','111','create','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','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','isEmpty','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','oldPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','VoiceQueue','interface','format','penalty','upsert','removeQueues','isArray','Queue:remove','voice','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','filters','order','sort','getContacts','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','getQueues','Queue','pick','get','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','UserId','VoiceRecording','getScreenRecordings','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','LOGININPAUSE','resolve','QueuePause','PAUSE','updateAttributes','SIP/%s','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','UserVoicePrefix','VoicePrefixId','getLists','CmList','getAgents','send','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','addFaxInteractions','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','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','Contact','dialActive','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0xbe66,0x1c0));var _0x6be6=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xbe66[_0x5037ab];return _0x512adb;};'use strict';var moment=require(_0x6be6('0x0'));var util=require('util');var path=require(_0x6be6('0x1'));var fs=require('fs');var _=require(_0x6be6('0x2'));var squel=require(_0x6be6('0x3'));var jayson=require(_0x6be6('0x4'));var Redis=require(_0x6be6('0x5'));var authService=require(_0x6be6('0x6'));var qs=require(_0x6be6('0x7'));var logger=require(_0x6be6('0x8'))(_0x6be6('0x9'));var utils=require(_0x6be6('0xa'));var config=require(_0x6be6('0xb'));var licenseUtil=require(_0x6be6('0xc'));var APIBadRequestError=require(_0x6be6('0xd'))[_0x6be6('0xe')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x6be6('0xd'))['handleError'];var db=require(_0x6be6('0xf'))['db'];var socket=require(_0x6be6('0x10'))(new Redis(config['redis']));require(_0x6be6('0x11'))[_0x6be6('0x12')](socket);config[_0x6be6('0x13')]=_[_0x6be6('0x14')](config[_0x6be6('0x13')],{'host':_0x6be6('0x15'),'port':0x18eb});var amiClient=jayson[_0x6be6('0x16')][_0x6be6('0x17')]({'port':0x232a});var values;function respondWithRpcPromise(_0x1ea1bd,_0x113b5a,_0x2cb3a5,_0x11a114){return new Promise(function(_0x7e8c96,_0x21dfef){var _0x4a05d2=_0x11a114||amiClient;return _0x4a05d2['request'](_0x1ea1bd,_0x2cb3a5)[_0x6be6('0x18')](function(_0x5506bc){logger[_0x6be6('0x19')](_0x6be6('0x1a'),_0x113b5a,_0x6be6('0x1b'));logger[_0x6be6('0x1c')](_0x6be6('0x1d'),_0x113b5a,_0x6be6('0x1b'),JSON[_0x6be6('0x1e')](_0x5506bc));if(_0x5506bc['error']){if(_0x5506bc[_0x6be6('0x1f')][_0x6be6('0x20')]===0x1f4){logger['error'](_0x6be6('0x1a'),_0x113b5a,_0x5506bc[_0x6be6('0x1f')]['message']);return _0x21dfef(_0x5506bc[_0x6be6('0x1f')][_0x6be6('0x21')]);}logger[_0x6be6('0x1f')](_0x6be6('0x1a'),_0x113b5a,_0x5506bc[_0x6be6('0x1f')][_0x6be6('0x21')]);return _0x7e8c96(_0x5506bc['error'][_0x6be6('0x21')]);}else{logger[_0x6be6('0x19')](_0x6be6('0x1a'),_0x113b5a,_0x6be6('0x1b'));_0x7e8c96(_0x5506bc['result'][_0x6be6('0x21')]);}})['catch'](function(_0x41639f){logger[_0x6be6('0x1f')](_0x6be6('0x1a'),_0x113b5a,_0x41639f);_0x21dfef(_0x41639f);});});}function respondWithStatusCode(_0x434f09,_0x5c4f34){_0x5c4f34=_0x5c4f34||0xcc;return function(_0x327781){if(_0x327781){return _0x434f09[_0x6be6('0x22')](_0x5c4f34);}return _0x434f09['status'](_0x5c4f34)[_0x6be6('0x23')]();};}function respondWithResult(_0x338db7,_0x4a735e){_0x4a735e=_0x4a735e||0xc8;return function(_0x5a1980){if(_0x5a1980){return _0x338db7[_0x6be6('0x24')](_0x4a735e)[_0x6be6('0x25')](_0x5a1980);}};}function respondWithFilteredResult(_0x1ef0f6,_0x3644f5){return function(_0x474004){if(_0x474004){var _0xbdc3f9=typeof _0x3644f5[_0x6be6('0x26')]==='undefined'&&typeof _0x3644f5[_0x6be6('0x27')]===_0x6be6('0x28');var _0x1ca827=_0x474004[_0x6be6('0x29')];var _0x509d7b=_0xbdc3f9?0x0:_0x3644f5[_0x6be6('0x26')];var _0x137d34=_0xbdc3f9?_0x474004[_0x6be6('0x29')]:_0x3644f5[_0x6be6('0x26')]+_0x3644f5[_0x6be6('0x27')];var _0x1024ef;if(_0x137d34>=_0x1ca827){_0x137d34=_0x1ca827;_0x1024ef=0xc8;}else{_0x1024ef=0xce;}_0x1ef0f6['status'](_0x1024ef);return _0x1ef0f6['set'](_0x6be6('0x2a'),_0x509d7b+'-'+_0x137d34+'/'+_0x1ca827)[_0x6be6('0x25')](_0x474004);}return null;};}function saveUpdates(_0x37b2e5){return function(_0x5b9f79){if(_0x5b9f79){return _0x5b9f79[_0x6be6('0x2b')](_0x37b2e5)['then'](function(_0x482efd){socket[_0x6be6('0x2c')]('userNotification:recalc:'+_0x482efd['id'],{});return _0x482efd;});}return null;};}function removeEntity(_0x2e02fa){return function(_0x52756a){if(_0x52756a){return _0x52756a[_0x6be6('0x2d')]()[_0x6be6('0x18')](function(){var _0x2cfc10=_0x52756a['get']({'plain':!![]});if(_0x2cfc10[_0x6be6('0x2e')]===_0x6be6('0x2f'))return;var _0x5992d8=[{'name':_0x6be6('0x30'),'value':_0x6be6('0x31'),'ignore':!![]},{'name':_0x6be6('0x32'),'value':_0x6be6('0x33'),'ignore':![]},{'name':_0x6be6('0x34'),'value':_0x6be6('0x35'),'ignore':![]}];var _0x583b18=_(_0x5992d8)[_0x6be6('0x36')]('ignore')[_0x6be6('0x37')]('value')[_0x6be6('0x38')]();if(_[_0x6be6('0x39')](_0x583b18,_0x2cfc10[_0x6be6('0x2e')])){return;}var _0x574775=_[_0x6be6('0x3a')](_0x5992d8,[_0x6be6('0x38'),_0x2cfc10[_0x6be6('0x2e')]])[_0x6be6('0x3b')];return db['UserProfileResource'][_0x6be6('0x2d')]({'where':{'type':_0x574775,'resourceId':_0x2cfc10['id']}})[_0x6be6('0x18')](function(){return _0x52756a;});})['then'](function(){_0x2e02fa[_0x6be6('0x24')](0xcc)[_0x6be6('0x23')]();});}};}function handleEntityNotFound(_0x23c1a9){return function(_0x1e1306){if(!_0x1e1306){_0x23c1a9[_0x6be6('0x22')](0x194);}return _0x1e1306;};}function handleError(_0x5ef0ac,_0x171b07){_0x171b07=_0x171b07||0x1f4;return function(_0x2eab57){logger['error'](_0x2eab57['stack']);if(_0x2eab57[_0x6be6('0x3b')]){delete _0x2eab57[_0x6be6('0x3b')];}_0x5ef0ac['status'](_0x171b07)['send'](_0x2eab57);};}exports['index']=function(_0x1f74e2,_0x30937d){var _0xe24bbf={},_0x7e479c={'count':0x0,'rows':[]};var _0x568686=_(db[_0x6be6('0x3c')][_0x6be6('0x3d')])[_0x6be6('0x37')](function(_0x2d21b3){return{'name':_0x2d21b3['fieldName'],'type':_0x2d21b3[_0x6be6('0x3e')]['key']};})['filter'](function(_0x3bf763){return!_['includes']([_0x6be6('0x3f'),'salt'],_0x3bf763['name']);})['value']();_0xe24bbf=qs[_0x6be6('0x40')](_0x568686,_0x1f74e2);var _0x2d827={'where':_0xe24bbf[_0x6be6('0x41')]};return db[_0x6be6('0x3c')][_0x6be6('0x29')](_0x2d827)[_0x6be6('0x18')](function(_0x4f5b72){_0x7e479c[_0x6be6('0x29')]=_0x4f5b72;if(_0x1f74e2[_0x6be6('0x42')]['includeAll']){_0xe24bbf[_0x6be6('0x43')]=[{'all':!![]}];}if(_0x1f74e2[_0x6be6('0x42')][_0x6be6('0x44')]===_0x6be6('0x45')){_0xe24bbf[_0x6be6('0x43')]=[{'model':db[_0x6be6('0x46')],'as':_0x6be6('0x44')}];}if(!_[_0x6be6('0x39')](_0xe24bbf['attributes'],'id')){_0xe24bbf['attributes'][_0x6be6('0x47')]('id');}return db[_0x6be6('0x3c')][_0x6be6('0x48')](_0xe24bbf);})[_0x6be6('0x18')](function(_0x1c7591){_0x7e479c[_0x6be6('0x49')]=_0x1c7591;if(_0x1f74e2[_0x6be6('0x42')][_0x6be6('0x4a')]==='true'){var _0xb64c29=[];for(var _0x36aed7=0x0;_0x36aed7<_0x7e479c[_0x6be6('0x49')]['length'];_0x36aed7++){_0xb64c29[_0x6be6('0x47')](get_open_tabs('chat',_0x7e479c[_0x6be6('0x49')][_0x36aed7][_0x6be6('0x4b')]));_0xb64c29['push'](get_open_tabs(_0x6be6('0x4c'),_0x7e479c[_0x6be6('0x49')][_0x36aed7]['dataValues']));_0xb64c29[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4d'),_0x7e479c[_0x6be6('0x49')][_0x36aed7]['dataValues']));_0xb64c29['push'](get_open_tabs(_0x6be6('0x4e'),_0x7e479c[_0x6be6('0x49')][_0x36aed7][_0x6be6('0x4b')]));_0xb64c29[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4f'),_0x7e479c[_0x6be6('0x49')][_0x36aed7]['dataValues']));_0xb64c29[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x50'),_0x7e479c[_0x6be6('0x49')][_0x36aed7][_0x6be6('0x4b')]));}return Promise[_0x6be6('0x51')](_0xb64c29)[_0x6be6('0x18')](function(){return _0x7e479c;});}else{return _0x7e479c;}})[_0x6be6('0x18')](respondWithFilteredResult(_0x30937d,_0xe24bbf))[_0x6be6('0x52')](handleError(_0x30937d,null));};exports[_0x6be6('0x53')]=function(_0x11488a,_0x4db0a8){var _0x3ff4bd={'raw':![],'where':{'id':_0x11488a['params']['id']}},_0x383976={};_0x383976[_0x6be6('0x54')]=_[_0x6be6('0x55')](_[_0x6be6('0x56')](db[_0x6be6('0x3c')]['rawAttributes']),[_0x6be6('0x3f'),_0x6be6('0x57')]);_0x383976[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x11488a['query']);_0x383976['filters']=_[_0x6be6('0x58')](_0x383976[_0x6be6('0x54')],_0x383976[_0x6be6('0x42')]);_0x3ff4bd[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x383976[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x11488a['query'][_0x6be6('0x5a')]));_0x3ff4bd['attributes']=_0x3ff4bd[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x3ff4bd[_0x6be6('0x59')]:_0x383976['model'];if(_0x11488a['query'][_0x6be6('0x5c')]){_0x3ff4bd[_0x6be6('0x43')]=[{'all':!![]}];}if(_0x11488a[_0x6be6('0x42')][_0x6be6('0x44')]==='true'){_0x3ff4bd[_0x6be6('0x43')]=[{'model':db[_0x6be6('0x46')],'as':'userSetting'}];}_0x3ff4bd=_[_0x6be6('0x5d')]({},_0x3ff4bd,_0x11488a[_0x6be6('0x5e')]);if(!_[_0x6be6('0x39')](_0x3ff4bd[_0x6be6('0x59')],'id')){_0x3ff4bd[_0x6be6('0x59')][_0x6be6('0x47')]('id');}return db[_0x6be6('0x3c')]['find'](_0x3ff4bd)[_0x6be6('0x18')](handleEntityNotFound(_0x4db0a8,null))[_0x6be6('0x18')](function(_0xa0ebc5){var _0x4a3b70=[];values=_0xa0ebc5;if(_0x11488a[_0x6be6('0x42')][_0x6be6('0x4a')]===_0x6be6('0x45')){_0x4a3b70[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x5f'),_0xa0ebc5['dataValues']));_0x4a3b70[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4c'),_0xa0ebc5[_0x6be6('0x4b')]));_0x4a3b70[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4f'),_0xa0ebc5['dataValues']));_0x4a3b70['push'](get_open_tabs(_0x6be6('0x50'),_0xa0ebc5[_0x6be6('0x4b')]));_0x4a3b70[_0x6be6('0x47')](get_open_tabs('fax',_0xa0ebc5[_0x6be6('0x4b')]));_0x4a3b70[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4e'),_0xa0ebc5[_0x6be6('0x4b')]));return Promise[_0x6be6('0x51')](_0x4a3b70);}else{return values;}})[_0x6be6('0x18')](function(){return values;})[_0x6be6('0x18')](respondWithResult(_0x4db0a8,null))[_0x6be6('0x52')](handleError(_0x4db0a8,null));};exports[_0x6be6('0x2b')]=function(_0x375702,_0x39e426){if(_0x375702[_0x6be6('0x60')]['id']){delete _0x375702[_0x6be6('0x60')]['id'];}delete _0x375702['body']['role'];return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x375702[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x39e426,null))[_0x6be6('0x18')](saveUpdates(_0x375702['body'],null))[_0x6be6('0x18')](respondWithResult(_0x39e426,null))[_0x6be6('0x52')](handleError(_0x39e426,null));};exports[_0x6be6('0x62')]=function(_0x3c49c4,_0x54d4f3){return db[_0x6be6('0x3c')][_0x6be6('0x62')]()['then'](respondWithResult(_0x54d4f3,null))['catch'](handleError(_0x54d4f3,null));};exports[_0x6be6('0x63')]=function(_0x2ad395,_0x13e885){return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x2ad395['params']['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x13e885,null))['then'](function(_0x8571d4){if(_0x8571d4){return _0x8571d4[_0x6be6('0x63')](_0x2ad395['body'][_0x6be6('0x64')],_[_0x6be6('0x65')](_0x2ad395[_0x6be6('0x60')],[_0x6be6('0x64'),'id'])||{});}})['then'](respondWithResult(_0x13e885,null))[_0x6be6('0x52')](handleError(_0x13e885,null));};function validateUser(_0x26751a){return new Promise(function(_0x23275d,_0x5e61aa){if(_0x26751a[_0x6be6('0x66')])return _0x23275d(_0x26751a);return db[_0x6be6('0x67')][_0x6be6('0x68')](0x1)[_0x6be6('0x18')](function(_0x15d9be){if(_0x15d9be['securePassword'])authService[_0x6be6('0x69')](_0x26751a['password']);db['User'][_0x6be6('0x6a')](_0x6be6('0x66'))['then'](function(_0x391f19){if(_['isNil'](_0x391f19)){_0x26751a[_0x6be6('0x66')]=_0x15d9be[_0x6be6('0x6b')]||0x1;return;}if(_['isNil'](_0x15d9be[_0x6be6('0x6b')])||_0x15d9be[_0x6be6('0x6b')]===_0x391f19){_0x26751a[_0x6be6('0x66')]=_0x391f19+0x1;return;}if(_0x15d9be[_0x6be6('0x6b')]>_0x391f19){_0x26751a[_0x6be6('0x66')]=_0x15d9be[_0x6be6('0x6b')];return;}return db[_0x6be6('0x6c')][_0x6be6('0x42')](_0x6be6('0x6d'),{'type':db[_0x6be6('0x6c')][_0x6be6('0x6e')][_0x6be6('0x6f')]})[_0x6be6('0x18')](function(_0x7a1ef6){if(_0x7a1ef6&&_0x7a1ef6[_0x6be6('0x5b')]){for(var _0x4767e0=0x0,_0x19c80e=_0x7a1ef6[_0x6be6('0x5b')];_0x4767e0<_0x19c80e&&_[_0x6be6('0x70')](_0x26751a['internal']);_0x4767e0++){if(_0x15d9be[_0x6be6('0x6b')]<=_0x7a1ef6[_0x4767e0][_0x6be6('0x71')]){_0x26751a[_0x6be6('0x66')]=_0x7a1ef6[_0x4767e0][_0x6be6('0x71')];}else if(_0x15d9be[_0x6be6('0x6b')]>_0x7a1ef6[_0x4767e0][_0x6be6('0x71')]&&_0x15d9be['min_internal']<=_0x7a1ef6[_0x4767e0]['to']){_0x26751a['internal']=_0x15d9be['min_internal'];}}}if(_[_0x6be6('0x70')](_0x26751a[_0x6be6('0x66')])){_0x26751a['internal']=_0x391f19+0x1;}return _0x23275d(_0x26751a);});});})[_0x6be6('0x52')](function(_0x1833a4){_0x5e61aa(_0x1833a4);});});}function updateUser(_0x272a8b){return new Promise(function(_0x31540f,_0x4e597b){try{if(_0x272a8b['voicemail']){_0x272a8b[_0x6be6('0x72')]=_0x272a8b[_0x6be6('0x66')];_0x272a8b[_0x6be6('0x73')]={'mailbox':_0x272a8b['internal'],'password':_0x272a8b['password'],'fullname':_0x272a8b['fullname'],'email':_0x272a8b['email']};}if(_0x272a8b['role']==='agent'){if(!_0x272a8b[_0x6be6('0x74')])_0x272a8b[_0x6be6('0x74')]=[_0x6be6('0x75'),'102',_0x6be6('0x76'),_0x6be6('0x77'),'110','104','105','106',_0x6be6('0x78'),_0x6be6('0x79'),_0x6be6('0x7a'),_0x6be6('0x7b'),_0x6be6('0x7c'),'114','115'];}_0x31540f(_0x272a8b);}catch(_0x45f366){_0x4e597b(_0x45f366);}});}exports[_0x6be6('0x7d')]=function(_0x32fd41,_0x2be62c){if(_0x32fd41[_0x6be6('0x31')][_0x6be6('0x2e')]===_0x6be6('0x33'))throw new Error(_0x6be6('0x7e'));if(_0x32fd41[_0x6be6('0x60')]['role']===_0x6be6('0x31')&&_0x32fd41[_0x6be6('0x31')][_0x6be6('0x2e')]!==_0x6be6('0x2f')){throw new Error(_0x6be6('0x7f'));}if(_0x32fd41[_0x6be6('0x60')][_0x6be6('0x2e')]==='admin'&&_0x32fd41['user'][_0x6be6('0x2e')]!=='admin'){throw new Error(_0x6be6('0x80'));}return licenseUtil['checkUserLimits']([_0x32fd41[_0x6be6('0x60')]])[_0x6be6('0x18')](function(){return validateUser(_0x32fd41[_0x6be6('0x60')]);})[_0x6be6('0x18')](function(_0x5e65c5){return updateUser(_0x5e65c5)['then'](function(_0x57c605){if(_0x57c605[_0x6be6('0x2e')]===_0x6be6('0x2f')){_0x57c605[_0x6be6('0x81')]=_0x32fd41[_0x6be6('0x31')][_0x6be6('0x81')];delete _0x57c605[_0x6be6('0x82')];}return _0x57c605;});})[_0x6be6('0x18')](function(_0xd54987){return db[_0x6be6('0x3c')][_0x6be6('0x7d')](_0xd54987,{'include':[{'model':db[_0x6be6('0x73')],'as':_0x6be6('0x73')}]});})['then'](function(_0x4f174c){if(_0x32fd41[_0x6be6('0x60')][_0x6be6('0x2e')]===_0x6be6('0x31'))return _0x4f174c;if(_0x32fd41[_0x6be6('0x31')][_0x6be6('0x2e')]!==_0x6be6('0x31'))return _0x4f174c;return db[_0x6be6('0x83')][_0x6be6('0x3a')]({'where':{'name':_0x4f174c[_0x6be6('0x2e')]==='agent'?_0x6be6('0x32'):_0x6be6('0x34'),'userProfileId':_0x32fd41[_0x6be6('0x31')]['userProfileId']},'raw':!![]})['then'](function(_0x4f90d6){if(!_0x4f90d6||_0x4f90d6[_0x6be6('0x84')]!=0x0)return _0x4f174c;return db[_0x6be6('0x85')]['create']({'name':_0x4f174c[_0x6be6('0x3b')],'resourceId':_0x4f174c['id'],'type':_0x4f90d6[_0x6be6('0x3b')],'sectionId':_0x4f90d6['id']},{})['then'](function(){return _0x4f174c;});})[_0x6be6('0x52')](function(_0x2588f0){logger[_0x6be6('0x1f')](_0x6be6('0x86'),_0x2588f0);throw _0x2588f0;});})[_0x6be6('0x18')](respondWithResult(_0x2be62c,0xc9))[_0x6be6('0x52')](handleError(_0x2be62c,null));};exports[_0x6be6('0x87')]=function(_0x10fb0f,_0x2a1bd2){var _0x1f5674=_0x10fb0f['body'];var _0x1a6950=[];if(_0x10fb0f[_0x6be6('0x31')]['role']===_0x6be6('0x33'))throw new Error(_0x6be6('0x7e'));if(_[_0x6be6('0x88')](_0x1f5674,['role','user'])&&_0x10fb0f['user'][_0x6be6('0x2e')]!==_0x6be6('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6be6('0x88')](_0x1f5674,[_0x6be6('0x2e'),_0x6be6('0x2f')])&&_0x10fb0f[_0x6be6('0x31')][_0x6be6('0x2e')]!==_0x6be6('0x2f')){throw new Error(_0x6be6('0x89'));}return licenseUtil[_0x6be6('0x8a')](_0x1f5674)['then'](function(){return validateUser(_0x1f5674[0x0]);})[_0x6be6('0x18')](function(){for(var _0x280654=0x1;_0x280654<_0x1f5674[_0x6be6('0x5b')];_0x280654++){var _0x25d6e1=_0x1f5674[_0x280654-0x1][_0x6be6('0x66')];if(!_0x1f5674[_0x280654][_0x6be6('0x66')])_0x1f5674[_0x280654]['internal']=_0x25d6e1+0x1;_0x1a6950[_0x6be6('0x47')](validateUser(_0x1f5674[_0x280654]));}return Promise[_0x6be6('0x51')](_0x1a6950);})[_0x6be6('0x18')](function(){_0x1a6950=[];for(var _0x3f5674=0x0;_0x3f5674<_0x1f5674['length'];_0x3f5674++){_0x1a6950['push'](updateUser(_0x1f5674[_0x3f5674]));}return Promise['all'](_0x1a6950);})[_0x6be6('0x18')](function(){_0x1a6950=_0x1f5674[_0x6be6('0x37')](function(_0x1a75f0){return db[_0x6be6('0x3c')][_0x6be6('0x7d')](_0x1a75f0,{'include':[{'model':db[_0x6be6('0x73')],'as':_0x6be6('0x73')}]})[_0x6be6('0x18')](function(_0x2a1e6b){_0x1a75f0['id']=_0x2a1e6b['id'];return _0x1a75f0;});});return Promise['all'](_0x1a6950);})[_0x6be6('0x18')](function(_0xb46dbd){if(_0x10fb0f['body'][_0x6be6('0x2e')]===_0x6be6('0x31'))return _0xb46dbd;if(_0x10fb0f[_0x6be6('0x31')]['role']!==_0x6be6('0x31'))return _0xb46dbd;var _0xb2699a=_[_0x6be6('0x88')](_0xb46dbd,function(_0x125a5d){return _0x125a5d[_0x6be6('0x2e')]==='agent'||_0x125a5d[_0x6be6('0x2e')]===_0x6be6('0x35');});if(!_0xb2699a)return _0xb46dbd;return db[_0x6be6('0x83')][_0x6be6('0x48')]({'where':{'name':{'$or':[_0x6be6('0x32'),_0x6be6('0x34')]},'userProfileId':_0x10fb0f['user']['userProfileId']},'raw':!![]})[_0x6be6('0x18')](function(_0x16f510){if(_[_0x6be6('0x8b')](_0x16f510)||!_[_0x6be6('0x88')](_0x16f510,[_0x6be6('0x84'),0x0]))return _0xb46dbd;_0x1a6950=[];var _0x32b67c=_(_0x16f510)[_0x6be6('0x37')](function(_0x49962e){if(_0x49962e['autoAssociation']===0x1)return;return _0x49962e[_0x6be6('0x3b')]===_0x6be6('0x32')?'agent':_0x6be6('0x35');})['compact']()[_0x6be6('0x38')]();for(var _0xb6fbca=0x0;_0xb6fbca<_0xb46dbd[_0x6be6('0x5b')];_0xb6fbca++){if(!_[_0x6be6('0x39')](_0x32b67c,_0xb46dbd[_0xb6fbca][_0x6be6('0x2e')]))return;var _0x5954cd=_0xb46dbd[_0xb6fbca]['role']===_0x6be6('0x33')?_0x6be6('0x32'):_0x6be6('0x34');_0x1a6950[_0x6be6('0x47')](db[_0x6be6('0x85')][_0x6be6('0x7d')]({'name':_0xb46dbd[_0xb6fbca][_0x6be6('0x3b')],'resourceId':_0xb46dbd[_0xb6fbca]['id'],'type':_0x5954cd,'sectionId':_['find'](_0x16f510,[_0x6be6('0x3b'),_0x5954cd])['id']},{}));}return Promise[_0x6be6('0x51')](_0x1a6950);});})['then'](respondWithResult(_0x2a1bd2,0xc9))['catch'](handleError(_0x2a1bd2,null));};exports[_0x6be6('0x8c')]=function(_0x491fc3,_0x394eca){if(_0x491fc3[_0x6be6('0x60')]['id']){delete _0x491fc3[_0x6be6('0x60')]['id'];}return db[_0x6be6('0x3c')]['find']({'where':{'id':_0x491fc3[_0x6be6('0x61')]['id']}})['then'](function(_0x493863){if(!_0x493863)return null;if(_0x493863['id']===_0x491fc3[_0x6be6('0x31')]['id']){if(!_0x491fc3['body']['oldPassword']||!_0x491fc3[_0x6be6('0x60')][_0x6be6('0x8d')]){throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))](_0x6be6('0x90'));}if(!_0x493863['authenticate'](_0x491fc3[_0x6be6('0x60')]['oldPassword'])){throw new db[(_0x6be6('0x8e'))]['ValidationError'](_0x6be6('0x91'));}if(_0x491fc3[_0x6be6('0x60')][_0x6be6('0x92')]===_0x491fc3[_0x6be6('0x60')][_0x6be6('0x8d')]){throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x491fc3['user'][_0x6be6('0x2e')]===_0x6be6('0x2f')){if(!_0x491fc3[_0x6be6('0x60')]['newPassword']){throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))](_0x6be6('0x93'));}}else if(_0x491fc3[_0x6be6('0x31')][_0x6be6('0x2e')]==='user'){if(!_0x491fc3['body'][_0x6be6('0x8d')]){throw new db['Sequelize'][(_0x6be6('0x8f'))](_0x6be6('0x93'));}if(_0x493863[_0x6be6('0x2e')]!==_0x6be6('0x33')){throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))](_0x6be6('0x7e'));}}else{throw new db['Sequelize'][(_0x6be6('0x8f'))](_0x6be6('0x7e'));}return _0x493863;})['then'](handleEntityNotFound(_0x394eca,null))[_0x6be6('0x18')](function(_0x386de0){return db['Setting'][_0x6be6('0x94')]({'attributes':['id',_0x6be6('0x95'),_0x6be6('0x96'),_0x6be6('0x97')]})[_0x6be6('0x18')](function(_0x4db9e1){if(_0x4db9e1[_0x6be6('0x95')])authService[_0x6be6('0x69')](_0x491fc3[_0x6be6('0x60')][_0x6be6('0x8d')]);if(!_0x4db9e1[_0x6be6('0x96')]||!_0x386de0[_0x6be6('0x98')])return _0x386de0;authService[_0x6be6('0x99')](_0x491fc3[_0x6be6('0x60')][_0x6be6('0x8d')],_0x386de0[_0x6be6('0x98')],_0x4db9e1[_0x6be6('0x97')]);return _0x386de0;})[_0x6be6('0x18')](saveUpdates({'password':_0x491fc3[_0x6be6('0x60')]['newPassword'],'passwordResetAt':_0x491fc3[_0x6be6('0x31')]['id']==_0x491fc3[_0x6be6('0x61')]['id']?moment():null,'previousPasswords':authService[_0x6be6('0x9a')](_0x491fc3[_0x6be6('0x60')][_0x6be6('0x8d')],_0x386de0['previousPasswords'])},null));})['then'](respondWithResult(_0x394eca,null))[_0x6be6('0x52')](handleError(_0x394eca,null));};exports[_0x6be6('0x9b')]=function(_0x532b51,_0x280a0c){var _0x3d1b91=_0x532b51[_0x6be6('0x60')][_0x6be6('0x9c')];return db['User'][_0x6be6('0x3a')]({'where':{'id':_0x532b51['params']['id']},'attributes':['id','name','role',_0x6be6('0x9d'),_0x6be6('0x9e'),_0x6be6('0x9f'),'interface']})[_0x6be6('0x18')](handleEntityNotFound(_0x280a0c,null))['then'](function(_0x17cf92){if(_0x17cf92){if(!utils[_0x6be6('0xa0')](_0x3d1b91)){throw new db[(_0x6be6('0x8e'))]['ValidationError'](_0x6be6('0xa1'));}return _0x17cf92['add'+_[_0x6be6('0xa2')](_0x3d1b91[_0x6be6('0xa3')]())+_0x6be6('0xa4')](_0x532b51['body']['ids'],{'penalty':_0x532b51[_0x6be6('0x60')]['penalty']||0x0})[_0x6be6('0xa5')](function(_0x1165da){for(var _0x525cc2=0x0;_0x525cc2<_0x532b51[_0x6be6('0x60')]['ids'][_0x6be6('0x5b')];_0x525cc2+=0x1){var _0x1daa44={'UserId':Number(_0x532b51[_0x6be6('0x61')]['id'])};_0x1daa44[_[_0x6be6('0xa2')](_0x3d1b91[_0x6be6('0xa3')]())+_0x6be6('0xa6')]=Number(_0x532b51[_0x6be6('0x60')][_0x6be6('0x64')][_0x525cc2]);socket[_0x6be6('0x2c')](_0x6be6('0x31')+_[_0x6be6('0xa2')](_0x3d1b91[_0x6be6('0xa3')]())+_0x6be6('0xa7'),_0x1daa44);}return _0x1165da;})['then'](function(){if(_0x3d1b91==='voice'){return db[_0x6be6('0xa8')]['findAll']({'where':{'id':_0x532b51[_0x6be6('0x60')]['ids']||[]},'raw':!![],'attributes':['id',_0x6be6('0x3b')]});}})['then'](function(_0x2e0eaa){var _0x25aace=_0x17cf92['get']({'plain':!![]});var _0x3f4b1a=[];if(_0x3d1b91==='voice'&&_0x25aace[_0x6be6('0x2e')]==='agent'&&_0x25aace[_0x6be6('0x9d')]){for(let _0x1e18d7=0x0;_0x1e18d7<_0x2e0eaa[_0x6be6('0x5b')];_0x1e18d7+=0x1){_0x3f4b1a[_0x6be6('0x47')]({'membername':_0x25aace['name'],'UserId':_0x25aace['id'],'queue_name':_0x2e0eaa[_0x1e18d7][_0x6be6('0x3b')],'VoiceQueueId':_0x2e0eaa[_0x1e18d7]['id'],'interface':_[_0x6be6('0x70')](_0x25aace[_0x6be6('0xa9')])?util[_0x6be6('0xaa')]('SIP/%s',_0x25aace['name']):_0x25aace[_0x6be6('0xa9')],'paused':_0x25aace[_0x6be6('0x9f')]||![],'penalty':_0x532b51[_0x6be6('0x60')][_0x6be6('0xab')]||0x0});}return Promise[_0x6be6('0x51')](_0x3f4b1a['map'](function(_0x27cc19){return db['UserVoiceQueueRt'][_0x6be6('0xac')](_0x27cc19);}));}return _0x17cf92;});}})[_0x6be6('0x18')](respondWithStatusCode(_0x280a0c,null))[_0x6be6('0x52')](handleError(_0x280a0c,null));};exports[_0x6be6('0xad')]=function(_0x3cc4fe,_0x4b3383){var _0x1c4cb3,_0xa15f7c;return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x3cc4fe[_0x6be6('0x61')]['id']},'attributes':['id',_0x6be6('0x3b'),_0x6be6('0x2e')]})[_0x6be6('0x18')](handleEntityNotFound(_0x4b3383,null))[_0x6be6('0x18')](function(_0x3d926b){if(_0x3d926b){_0x1c4cb3=_0x3d926b;if(!_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')]||!utils[_0x6be6('0xa0')](_0x3cc4fe[_0x6be6('0x42')]['channel'])){throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))](_0x6be6('0xa1'));}return _0x3d926b['remove'+_[_0x6be6('0xa2')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')][_0x6be6('0xa3')]())+'Queues'](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x64')]);}})[_0x6be6('0x18')](function(_0x4f2e84){if(_[_0x6be6('0xae')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x64')])){for(var _0x1d0cf0=0x0;_0x1d0cf0<_0x3cc4fe[_0x6be6('0x42')]['ids'][_0x6be6('0x5b')];_0x1d0cf0+=0x1){_0xa15f7c={'UserId':Number(_0x3cc4fe['params']['id'])};_0xa15f7c[_[_0x6be6('0xa2')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')]['toLowerCase']())+_0x6be6('0xa6')]=Number(_0x3cc4fe['query'][_0x6be6('0x64')][_0x1d0cf0]);socket[_0x6be6('0x2c')]('user'+_[_0x6be6('0xa2')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')][_0x6be6('0xa3')]())+_0x6be6('0xaf'),_0xa15f7c);}}else{_0xa15f7c={'UserId':Number(_0x3cc4fe['params']['id'])};_0xa15f7c[_[_0x6be6('0xa2')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')]['toLowerCase']())+_0x6be6('0xa6')]=Number(_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x64')]);socket[_0x6be6('0x2c')](_0x6be6('0x31')+_[_0x6be6('0xa2')](_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x9c')][_0x6be6('0xa3')]())+'Queue:remove',_0xa15f7c);}return _0x4f2e84;})['then'](function(){if(_0x3cc4fe['query']['channel']===_0x6be6('0xb0')){return db['UserVoiceQueueRt'][_0x6be6('0x2d')]({'where':{'UserId':_0x3cc4fe[_0x6be6('0x61')]['id'],'VoiceQueueId':_0x3cc4fe[_0x6be6('0x42')][_0x6be6('0x64')]},'individualHooks':!![]})['then'](function(){return _0x1c4cb3;});}return _0x1c4cb3;})['then'](respondWithStatusCode(_0x4b3383,null))[_0x6be6('0x52')](handleError(_0x4b3383,null));};exports['addAvatar']=function(_0x751071,_0x4e046e){_0x751071['body'][_0x6be6('0xb1')]=_0x751071[_0x6be6('0xb2')][_0x6be6('0xb3')];return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x751071[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0x4e046e,null))[_0x6be6('0x18')](saveUpdates(_0x751071['body'],null))['then'](respondWithResult(_0x4e046e,null))[_0x6be6('0x52')](handleError(_0x4e046e,null));};exports[_0x6be6('0xb4')]=function(_0x4a370e,_0x2e6a62){var _0x96b254=path[_0x6be6('0xb5')](config['root'],_0x6be6('0xb6'));return db[_0x6be6('0x3c')]['find']({'where':{'id':_0x4a370e[_0x6be6('0x61')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x2e6a62,null))[_0x6be6('0x18')](function(_0x5dc75e){if(_0x5dc75e){if(_[_0x6be6('0x70')](_0x5dc75e[_0x6be6('0xb1')])){return _0x2e6a62[_0x6be6('0xb7')](_0x96b254);}else{if(!fs[_0x6be6('0xb8')](path[_0x6be6('0xb5')](config[_0x6be6('0xb9')],'server/files/images/',_0x5dc75e[_0x6be6('0xb1')]))){return _0x2e6a62[_0x6be6('0xb7')](_0x96b254);}return _0x2e6a62[_0x6be6('0xb7')](path[_0x6be6('0xb5')](config['root'],_0x6be6('0xba'),_0x5dc75e[_0x6be6('0xb1')]));}}})[_0x6be6('0x52')](handleError(_0x2e6a62,null));};exports[_0x6be6('0xbb')]=function(_0x40d481,_0x2748eb){return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x40d481[_0x6be6('0x61')]['id']},'attributes':['id']})[_0x6be6('0x18')](handleEntityNotFound(_0x2748eb,null))[_0x6be6('0x18')](function(_0x565326){var _0x5eee88=[];values=_0x565326[_0x6be6('0x4b')];_0x5eee88[_0x6be6('0x47')](get_open_tabs('chat',_0x565326['dataValues']));_0x5eee88[_0x6be6('0x47')](get_open_tabs('sms',_0x565326['dataValues']));_0x5eee88[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4f'),_0x565326[_0x6be6('0x4b')]));_0x5eee88[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x50'),_0x565326[_0x6be6('0x4b')]));_0x5eee88[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4d'),_0x565326[_0x6be6('0x4b')]));_0x5eee88[_0x6be6('0x47')](get_open_tabs(_0x6be6('0x4e'),_0x565326[_0x6be6('0x4b')]));return Promise['all'](_0x5eee88);})['then'](function(_0xa63053){if(_0xa63053){var _0x2091ab=_[_0x6be6('0x37')](values['ChatOpenTabs'],function(_0x51c5d1){return{'channel':_0x6be6('0xbc'),'id':_0x51c5d1['id'],'createdAt':_0x51c5d1['createdAt']};});var _0x4e2b33=_[_0x6be6('0x37')](values[_0x6be6('0xbd')],function(_0x1188a8){return{'channel':_0x6be6('0xbe'),'id':_0x1188a8['id'],'createdAt':_0x1188a8[_0x6be6('0xbf')]};});var _0x2808c7=_['map'](values[_0x6be6('0xc0')],function(_0x7c4774){return{'channel':_0x6be6('0xc1'),'id':_0x7c4774['id'],'createdAt':_0x7c4774[_0x6be6('0xbf')]};});var _0x2aeba7=_[_0x6be6('0x37')](values['MailOpenTabs'],function(_0x2117cf){return{'channel':_0x6be6('0xc2'),'id':_0x2117cf['id'],'createdAt':_0x2117cf[_0x6be6('0xbf')]};});var _0x2e2883=_[_0x6be6('0x37')](values[_0x6be6('0xc3')],function(_0x580b7f){return{'channel':_0x6be6('0xc4'),'id':_0x580b7f['id'],'createdAt':_0x580b7f[_0x6be6('0xbf')]};});var _0x94fdbc=_['map'](values[_0x6be6('0xc5')],function(_0x268238){return{'channel':_0x6be6('0xc6'),'id':_0x268238['id'],'createdAt':_0x268238[_0x6be6('0xbf')]};});var _0x5269a3=_[_0x6be6('0xc7')](_0x2091ab,_0x4e2b33,_0x2808c7,_0x2aeba7,_0x2e2883,_0x94fdbc);var _0x4c22ce={'count':_0x5269a3[_0x6be6('0x5b')],'rows':_0x5269a3};return _0x4c22ce;}else return null;})[_0x6be6('0x18')](respondWithResult(_0x2748eb,null))[_0x6be6('0x52')](handleError(_0x2748eb,null));};exports['getContacts']=function(_0x3f0dae,_0x3f1271){var _0x32b82a={};var _0x15d9f1={};var _0xa14568;var _0x5203ad;return db[_0x6be6('0x3c')]['findOne']({'where':{'id':_0x3f0dae['params']['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x3f1271,null))[_0x6be6('0x18')](function(_0x4b86b2){if(_0x4b86b2){_0xa14568=_0x4b86b2;_0x15d9f1[_0x6be6('0x54')]=_[_0x6be6('0x56')](db['CmContact'][_0x6be6('0x3d')]);_0x15d9f1[_0x6be6('0x42')]=_['keys'](_0x3f0dae[_0x6be6('0x42')]);_0x15d9f1[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x15d9f1[_0x6be6('0x54')],_0x15d9f1[_0x6be6('0x42')]);_0x32b82a[_0x6be6('0x59')]=_['intersection'](_0x15d9f1[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x3f0dae['query']['fields']));_0x32b82a[_0x6be6('0x59')]=_0x32b82a[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x32b82a['attributes']:_0x15d9f1[_0x6be6('0x54')];_0x32b82a[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x3f0dae['query']['sort']);_0x32b82a[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_['pick'](_0x3f0dae[_0x6be6('0x42')],_0x15d9f1[_0x6be6('0xc8')]));if(_0x3f0dae[_0x6be6('0x42')]['filter']){_0x32b82a['where']=_['merge'](_0x32b82a[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x32b82a[_0x6be6('0x59')],function(_0x314401){var _0x54d92a={};_0x54d92a[_0x314401]={'$like':'%'+_0x3f0dae[_0x6be6('0x42')]['filter']+'%'};return _0x54d92a;})});}_0x32b82a=_[_0x6be6('0x5d')]({},_0x32b82a,_0x3f0dae[_0x6be6('0x5e')]);return _0xa14568[_0x6be6('0xcb')](_0x32b82a);}})[_0x6be6('0x18')](function(_0x2cb3b4){if(_0x2cb3b4){_0x5203ad=_0x2cb3b4['length'];if(_0x3f0dae['query']['hasOwnProperty'](_0x6be6('0x5c'))){_0x32b82a[_0x6be6('0x43')]=[{'model':db['CmList'],'as':_0x6be6('0xcc'),'required':![]},{'model':db[_0x6be6('0xcd')],'as':_0x6be6('0xce'),'attributes':['id',_0x6be6('0x3b'),_0x6be6('0xcf')],'where':_0x3f0dae[_0x6be6('0x42')][_0x6be6('0xd0')]?{'id':_0x3f0dae[_0x6be6('0x42')][_0x6be6('0xd0')]}:undefined,'required':_0x3f0dae[_0x6be6('0x42')][_0x6be6('0xd0')]?!![]:![]}];}if(!_0x3f0dae[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x32b82a[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x3f0dae[_0x6be6('0x42')]['limit']);_0x32b82a[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x3f0dae[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0xa14568[_0x6be6('0xcb')](_0x32b82a);}})['then'](function(_0x5167b3){if(_0x5167b3){return _0x5167b3?{'count':_0x5203ad,'rows':_0x5167b3}:null;}})[_0x6be6('0x18')](respondWithResult(_0x3f1271,null))[_0x6be6('0x52')](handleError(_0x3f1271,null));};exports[_0x6be6('0xd3')]=function(_0x18c830,_0x5c49eb){var _0x5b8030;var _0x146338={};var _0xe8bd64;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x18c830['params']['id']},'attributes':['id',_0x6be6('0x3b'),_0x6be6('0x2e')]})[_0x6be6('0x18')](handleEntityNotFound(_0x5c49eb,null))[_0x6be6('0x18')](function(_0x3ea8d8){if(!utils[_0x6be6('0xa0')](_0x18c830[_0x6be6('0x42')][_0x6be6('0x9c')])){throw new db['Sequelize'][(_0x6be6('0x8f'))]('Unknown\x20channel');}_0x5b8030=_0x3ea8d8;var _0x57fec0={};_0x57fec0[_0x6be6('0x54')]=_[_0x6be6('0x56')](db[_[_0x6be6('0xa2')](_0x18c830['query'][_0x6be6('0x9c')])+_0x6be6('0xd4')][_0x6be6('0x3d')]);_0x57fec0[_0x6be6('0x42')]=_['keys'](_0x18c830['query']);_0x57fec0[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x57fec0[_0x6be6('0x54')],_0x57fec0[_0x6be6('0x42')]);_0x146338[_0x6be6('0x59')]=_['intersection'](_0x57fec0[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x18c830['query'][_0x6be6('0x5a')]));_0x146338['attributes']=_0x146338['attributes'][_0x6be6('0x5b')]?_0x146338['attributes']:_0x57fec0[_0x6be6('0x54')];_0x146338[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x18c830[_0x6be6('0x42')][_0x6be6('0xca')]);_0x146338[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x18c830[_0x6be6('0x42')],_0x57fec0['filters']));if(_0x18c830[_0x6be6('0x42')][_0x6be6('0x36')]){_0x146338[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x146338[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x146338[_0x6be6('0x59')],function(_0x44c096){var _0x3def21={};_0x3def21[_0x44c096]={'$like':'%'+_0x18c830['query'][_0x6be6('0x36')]+'%'};return _0x3def21;})});}_0x146338=_[_0x6be6('0x5d')]({},_0x146338,_0x18c830['options']);switch(_0x5b8030[_0x6be6('0x2e')]){case'admin':return db[_['capitalize'](_0x18c830['query'][_0x6be6('0x9c')])+_0x6be6('0xd4')]['findAll'](_0x146338);case _0x6be6('0x31'):case _0x6be6('0x33'):return _0x5b8030['get'+_[_0x6be6('0xa2')](_0x18c830['query'][_0x6be6('0x9c')])+_0x6be6('0xa4')](_0x146338);default:throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))]('Unknown\x20role');}})['then'](function(_0x5cc700){_0xe8bd64=_0x5cc700[_0x6be6('0x5b')];if(!_0x18c830[_0x6be6('0x42')][_0x6be6('0xd1')]('nolimit')){_0x146338[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x18c830[_0x6be6('0x42')]['limit']);_0x146338['offset']=qs[_0x6be6('0x26')](_0x18c830['query'][_0x6be6('0x26')]);}switch(_0x5b8030[_0x6be6('0x2e')]){case'admin':return db[_['capitalize'](_0x18c830[_0x6be6('0x42')]['channel'])+_0x6be6('0xd4')][_0x6be6('0x48')](_0x146338);case _0x6be6('0x31'):case _0x6be6('0x33'):return _0x5b8030[_0x6be6('0xd6')+_[_0x6be6('0xa2')](_0x18c830['query']['channel'])+_0x6be6('0xa4')](_0x146338);}})[_0x6be6('0x18')](function(_0x2cf24b){return{'count':_0xe8bd64,'rows':_0x2cf24b};})['then'](respondWithResult(_0x5c49eb,null))['catch'](handleError(_0x5c49eb,null));};exports[_0x6be6('0xd7')]=function(_0x552fa6,_0xbd81fd){var _0x281ec4={};var _0x40d76d={};var _0x4bd6fe;var _0x381737;return db[_0x6be6('0x3c')]['findOne']({'where':{'id':_0x552fa6[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0xbd81fd,null))['then'](function(_0x180c28){if(_0x180c28){_0x4bd6fe=_0x180c28;_0x40d76d[_0x6be6('0x54')]=_['keys'](db[_0x6be6('0xd8')][_0x6be6('0x3d')]);_0x40d76d[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x552fa6[_0x6be6('0x42')]);_0x40d76d[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x40d76d['model'],_0x40d76d[_0x6be6('0x42')]);_0x281ec4['attributes']=_[_0x6be6('0x58')](_0x40d76d[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x552fa6[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x281ec4[_0x6be6('0x59')]=_0x281ec4['attributes']['length']?_0x281ec4['attributes']:_0x40d76d[_0x6be6('0x54')];_0x281ec4[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x552fa6['query'][_0x6be6('0xca')]);_0x281ec4['where']=qs['filters'](_[_0x6be6('0xd5')](_0x552fa6[_0x6be6('0x42')],_0x40d76d[_0x6be6('0xc8')]));if(_0x552fa6[_0x6be6('0x42')]['filter']){_0x281ec4[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x281ec4[_0x6be6('0x41')],{'$or':_['map'](_0x281ec4[_0x6be6('0x59')],function(_0x3716ed){var _0x4d0d8f={};_0x4d0d8f[_0x3716ed]={'$like':'%'+_0x552fa6[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x4d0d8f;})});}_0x281ec4=_[_0x6be6('0x5d')]({},_0x281ec4,_0x552fa6[_0x6be6('0x5e')]);return _0x4bd6fe['getVoiceQueuesRt'](_0x281ec4);}})[_0x6be6('0x18')](function(_0x6dc3a2){if(_0x6dc3a2){_0x381737=_0x6dc3a2[_0x6be6('0x5b')];if(!_0x552fa6[_0x6be6('0x42')][_0x6be6('0xd1')]('nolimit')){_0x281ec4[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x552fa6['query']['limit']);_0x281ec4[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x552fa6[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0x4bd6fe[_0x6be6('0xd7')](_0x281ec4);}})['then'](function(_0x13ddaa){if(_0x13ddaa){return _0x13ddaa?{'count':_0x381737,'rows':_0x13ddaa}:null;}})['then'](respondWithResult(_0xbd81fd,null))[_0x6be6('0x52')](handleError(_0xbd81fd,null));};exports[_0x6be6('0xd9')]=function(_0x4322fd,_0x4a296b){var _0x19515c={};var _0x14e106={};var _0x5163fd;var _0x38be15;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x4322fd[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0x4a296b,null))['then'](function(_0x398e42){if(_0x398e42){_0x5163fd=_0x398e42;_0x14e106['model']=_[_0x6be6('0x56')](db[_0x6be6('0xda')][_0x6be6('0x3d')]);_0x14e106[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x4322fd['query']);_0x14e106[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x14e106[_0x6be6('0x54')],_0x14e106['query']);_0x19515c[_0x6be6('0x59')]=_['intersection'](_0x14e106[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x4322fd['query'][_0x6be6('0x5a')]));_0x19515c[_0x6be6('0x59')]=_0x19515c[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x19515c['attributes']:_0x14e106[_0x6be6('0x54')];_0x19515c[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x4322fd[_0x6be6('0x42')]['sort']);_0x19515c[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x4322fd[_0x6be6('0x42')],_0x14e106[_0x6be6('0xc8')]));if(_0x4322fd[_0x6be6('0x42')][_0x6be6('0x36')]){_0x19515c['where']=_[_0x6be6('0x5d')](_0x19515c['where'],{'$or':_[_0x6be6('0x37')](_0x19515c[_0x6be6('0x59')],function(_0x39e6b3){var _0x40fca0={};_0x40fca0[_0x39e6b3]={'$like':'%'+_0x4322fd['query'][_0x6be6('0x36')]+'%'};return _0x40fca0;})});}_0x19515c=_['merge']({},_0x19515c,_0x4322fd[_0x6be6('0x5e')]);return _0x5163fd[_0x6be6('0xd9')](_0x19515c);}})[_0x6be6('0x18')](function(_0x4bb0ec){if(_0x4bb0ec){_0x38be15=_0x4bb0ec[_0x6be6('0x5b')];if(!_0x4322fd[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x19515c[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x4322fd[_0x6be6('0x42')]['limit']);_0x19515c[_0x6be6('0x26')]=qs['offset'](_0x4322fd['query'][_0x6be6('0x26')]);}return _0x5163fd[_0x6be6('0xd9')](_0x19515c);}})[_0x6be6('0x18')](function(_0x10ee99){if(_0x10ee99){return _0x10ee99?{'count':_0x38be15,'rows':_0x10ee99}:null;}})['then'](respondWithResult(_0x4a296b,null))[_0x6be6('0x52')](handleError(_0x4a296b,null));};exports['getRecordings']=function(_0xb1f237,_0x3e4572){var _0x1b08f6={'raw':!![],'where':{}};var _0x42cd70={};var _0x446978={'count':0x0,'rows':[]};return db['User'][_0x6be6('0x94')]({'where':{'id':_0xb1f237[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e4572,null))[_0x6be6('0x18')](function(_0x459ed7){if(_0x459ed7){_0x42cd70[_0x6be6('0x54')]=_['keys'](db['VoiceRecording'][_0x6be6('0x3d')]);_0x42cd70[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0xb1f237[_0x6be6('0x42')]);_0x42cd70[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x42cd70['model'],_0x42cd70[_0x6be6('0x42')]);_0x1b08f6[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x42cd70[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0xb1f237[_0x6be6('0x42')]['fields']));_0x1b08f6['attributes']=_0x1b08f6[_0x6be6('0x59')]['length']?_0x1b08f6[_0x6be6('0x59')]:_0x42cd70[_0x6be6('0x54')];if(!_0xb1f237[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x1b08f6[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0xb1f237['query'][_0x6be6('0x27')]);_0x1b08f6[_0x6be6('0x26')]=qs['offset'](_0xb1f237[_0x6be6('0x42')][_0x6be6('0x26')]);}_0x1b08f6[_0x6be6('0xc9')]=qs['sort'](_0xb1f237['query'][_0x6be6('0xca')]);_0x1b08f6[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0xb1f237[_0x6be6('0x42')],_0x42cd70['filters']));_0x1b08f6[_0x6be6('0x41')][_0x6be6('0xdb')]=_0x459ed7['id'];if(_0xb1f237[_0x6be6('0x42')]['filter']){_0x1b08f6[_0x6be6('0x41')]=_['merge'](_0x1b08f6['where'],{'$or':_[_0x6be6('0x37')](_0x1b08f6[_0x6be6('0x59')],function(_0x1cd27c){var _0x2bad86={};_0x2bad86[_0x1cd27c]={'$like':'%'+_0xb1f237['query'][_0x6be6('0x36')]+'%'};return _0x2bad86;})});}_0x1b08f6=_[_0x6be6('0x5d')]({},_0x1b08f6,_0xb1f237[_0x6be6('0x5e')]);return db[_0x6be6('0xdc')][_0x6be6('0x29')]({'where':_0x1b08f6[_0x6be6('0x41')]})['then'](function(_0x4a97a){_0x446978[_0x6be6('0x29')]=_0x4a97a;if(_0xb1f237[_0x6be6('0x42')][_0x6be6('0x5c')]){_0x1b08f6[_0x6be6('0x43')]=[{'all':!![]}];}return db[_0x6be6('0xdc')][_0x6be6('0x48')](_0x1b08f6);})[_0x6be6('0x18')](function(_0x3c61f7){_0x446978[_0x6be6('0x49')]=_0x3c61f7;return _0x446978;});}})['then'](respondWithFilteredResult(_0x3e4572,_0x1b08f6))[_0x6be6('0x52')](handleError(_0x3e4572,null));};exports[_0x6be6('0xdd')]=function(_0x64b044,_0x394850){var _0x27780a={'raw':!![],'where':{}};var _0x1241fb={};var _0x3288cc={'count':0x0,'rows':[]};return db[_0x6be6('0x3c')]['findOne']({'where':{'id':_0x64b044['params']['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x394850,null))[_0x6be6('0x18')](function(_0x447720){if(_0x447720){_0x1241fb[_0x6be6('0x54')]=_[_0x6be6('0x56')](db['ScreenRecording']['rawAttributes']);_0x1241fb['query']=_[_0x6be6('0x56')](_0x64b044[_0x6be6('0x42')]);_0x1241fb[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x1241fb['model'],_0x1241fb[_0x6be6('0x42')]);_0x27780a[_0x6be6('0x59')]=_['intersection'](_0x1241fb['model'],qs[_0x6be6('0x5a')](_0x64b044[_0x6be6('0x42')]['fields']));_0x27780a['attributes']=_0x27780a[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x27780a[_0x6be6('0x59')]:_0x1241fb[_0x6be6('0x54')];if(!_0x64b044['query']['hasOwnProperty'](_0x6be6('0xd2'))){_0x27780a[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x64b044[_0x6be6('0x42')][_0x6be6('0x27')]);_0x27780a[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x64b044[_0x6be6('0x42')][_0x6be6('0x26')]);}_0x27780a[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x64b044[_0x6be6('0x42')][_0x6be6('0xca')]);_0x27780a[_0x6be6('0x41')]=qs['filters'](_[_0x6be6('0xd5')](_0x64b044[_0x6be6('0x42')],_0x1241fb[_0x6be6('0xc8')]));_0x27780a[_0x6be6('0x41')][_0x6be6('0xdb')]=_0x447720['id'];if(_0x64b044[_0x6be6('0x42')][_0x6be6('0x36')]){_0x27780a[_0x6be6('0x41')]=_['merge'](_0x27780a[_0x6be6('0x41')],{'$or':_['map'](_0x27780a[_0x6be6('0x59')],function(_0x558398){var _0x1176dc={};_0x1176dc[_0x558398]={'$like':'%'+_0x64b044[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x1176dc;})});}_0x27780a=_[_0x6be6('0x5d')]({},_0x27780a,_0x64b044['options']);return db['ScreenRecording'][_0x6be6('0x29')]({'where':_0x27780a[_0x6be6('0x41')]})[_0x6be6('0x18')](function(_0x5d273f){_0x3288cc[_0x6be6('0x29')]=_0x5d273f;if(_0x64b044[_0x6be6('0x42')]['includeAll']){_0x27780a['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x6be6('0x48')](_0x27780a);})[_0x6be6('0x18')](function(_0x58fcba){_0x3288cc[_0x6be6('0x49')]=_0x58fcba;return _0x3288cc;});}})['then'](respondWithFilteredResult(_0x394850,_0x27780a))[_0x6be6('0x52')](handleError(_0x394850,null));};exports[_0x6be6('0xde')]=function(_0x4d7e82,_0x33bb22){var _0x5e8f58={};var _0x374be5={};var _0x59dee4;var _0x4e4449;return db['User'][_0x6be6('0x94')]({'where':{'id':_0x4d7e82['params']['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x33bb22,null))[_0x6be6('0x18')](function(_0x354b90){if(_0x354b90){_0x59dee4=_0x354b90;_0x374be5['model']=_['keys'](db[_0x6be6('0xdf')][_0x6be6('0x3d')]);_0x374be5[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x4d7e82['query']);_0x374be5[_0x6be6('0xc8')]=_['intersection'](_0x374be5[_0x6be6('0x54')],_0x374be5[_0x6be6('0x42')]);_0x5e8f58[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x374be5[_0x6be6('0x54')],qs['fields'](_0x4d7e82['query'][_0x6be6('0x5a')]));_0x5e8f58[_0x6be6('0x59')]=_0x5e8f58[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x5e8f58['attributes']:_0x374be5[_0x6be6('0x54')];_0x5e8f58[_0x6be6('0xc9')]=qs['sort'](_0x4d7e82[_0x6be6('0x42')][_0x6be6('0xca')]);_0x5e8f58[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x4d7e82[_0x6be6('0x42')],_0x374be5['filters']));if(_0x4d7e82['query']['filter']){_0x5e8f58['where']=_[_0x6be6('0x5d')](_0x5e8f58['where'],{'$or':_[_0x6be6('0x37')](_0x5e8f58[_0x6be6('0x59')],function(_0x25f88c){var _0x1eeb2c={};_0x1eeb2c[_0x25f88c]={'$like':'%'+_0x4d7e82[_0x6be6('0x42')]['filter']+'%'};return _0x1eeb2c;})});}_0x5e8f58=_[_0x6be6('0x5d')]({},_0x5e8f58,_0x4d7e82['options']);return _0x59dee4[_0x6be6('0xde')](_0x5e8f58);}})[_0x6be6('0x18')](function(_0x45ae4c){if(_0x45ae4c){_0x4e4449=_0x45ae4c[_0x6be6('0x5b')];if(!_0x4d7e82['query'][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x5e8f58[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x4d7e82['query'][_0x6be6('0x27')]);_0x5e8f58['offset']=qs['offset'](_0x4d7e82[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0x59dee4[_0x6be6('0xde')](_0x5e8f58);}})[_0x6be6('0x18')](function(_0x31e5a9){if(_0x31e5a9){return _0x31e5a9?{'count':_0x4e4449,'rows':_0x31e5a9}:null;}})[_0x6be6('0x18')](respondWithResult(_0x33bb22,null))[_0x6be6('0x52')](handleError(_0x33bb22,null));};exports[_0x6be6('0xe0')]=function(_0x49b576,_0x235258){var _0x347ca0={};var _0xf4f938={};var _0x33bb69;var _0x19e3e8;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x49b576[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0x235258,null))[_0x6be6('0x18')](function(_0x592bd1){if(_0x592bd1){_0x33bb69=_0x592bd1;_0xf4f938[_0x6be6('0x54')]=_[_0x6be6('0x56')](db[_0x6be6('0xe1')]['rawAttributes']);_0xf4f938['query']=_[_0x6be6('0x56')](_0x49b576[_0x6be6('0x42')]);_0xf4f938[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0xf4f938[_0x6be6('0x54')],_0xf4f938[_0x6be6('0x42')]);_0x347ca0[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0xf4f938[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x49b576[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x347ca0[_0x6be6('0x59')]=_0x347ca0['attributes']['length']?_0x347ca0['attributes']:_0xf4f938[_0x6be6('0x54')];_0x347ca0[_0x6be6('0xc9')]=qs['sort'](_0x49b576[_0x6be6('0x42')][_0x6be6('0xca')]);_0x347ca0[_0x6be6('0x41')]=qs['filters'](_[_0x6be6('0xd5')](_0x49b576[_0x6be6('0x42')],_0xf4f938['filters']));if(_0x49b576['query']['filter']){_0x347ca0['where']=_[_0x6be6('0x5d')](_0x347ca0[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x347ca0[_0x6be6('0x59')],function(_0x55573c){var _0x228cb0={};_0x228cb0[_0x55573c]={'$like':'%'+_0x49b576[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x228cb0;})});}_0x347ca0=_[_0x6be6('0x5d')]({},_0x347ca0,_0x49b576[_0x6be6('0x5e')]);return _0x33bb69[_0x6be6('0xe0')](_0x347ca0);}})[_0x6be6('0x18')](function(_0x77f814){if(_0x77f814){_0x19e3e8=_0x77f814[_0x6be6('0x5b')];if(!_0x49b576[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x347ca0[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x49b576['query']['limit']);_0x347ca0['offset']=qs[_0x6be6('0x26')](_0x49b576[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0x33bb69[_0x6be6('0xe0')](_0x347ca0);}})['then'](function(_0x5ed773){if(_0x5ed773){return _0x5ed773?{'count':_0x19e3e8,'rows':_0x5ed773}:null;}})[_0x6be6('0x18')](respondWithResult(_0x235258,null))[_0x6be6('0x52')](handleError(_0x235258,null));};exports['getMailInteractions']=function(_0x39c242,_0x3b375d){var _0x5052ce={'raw':!![],'where':{}};var _0x12a03e={};var _0x4b946d={'count':0x0,'rows':[]};return db['User'][_0x6be6('0x94')]({'where':{'id':_0x39c242[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0x3b375d,null))[_0x6be6('0x18')](function(_0x124fad){if(_0x124fad){_0x12a03e[_0x6be6('0x54')]=_['keys'](db[_0x6be6('0xe2')][_0x6be6('0x3d')]);_0x12a03e[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x39c242[_0x6be6('0x42')]);_0x12a03e[_0x6be6('0xc8')]=_['intersection'](_0x12a03e[_0x6be6('0x54')],_0x12a03e[_0x6be6('0x42')]);_0x5052ce[_0x6be6('0x59')]=_['intersection'](_0x12a03e[_0x6be6('0x54')],qs['fields'](_0x39c242[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x5052ce[_0x6be6('0x59')]=_0x5052ce[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x5052ce['attributes']:_0x12a03e[_0x6be6('0x54')];if(!_0x39c242[_0x6be6('0x42')][_0x6be6('0xd1')]('nolimit')){_0x5052ce[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x39c242['query']['limit']);_0x5052ce[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x39c242['query'][_0x6be6('0x26')]);}_0x5052ce[_0x6be6('0xc9')]=qs['sort'](_0x39c242[_0x6be6('0x42')][_0x6be6('0xca')]);_0x5052ce[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x39c242[_0x6be6('0x42')],_0x12a03e[_0x6be6('0xc8')]));_0x5052ce['where'][_0x6be6('0xdb')]=_0x124fad['id'];if(_0x39c242[_0x6be6('0x42')]['filter']){_0x5052ce[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x5052ce['where'],{'$or':_[_0x6be6('0x37')](_0x5052ce[_0x6be6('0x59')],function(_0x363771){var _0x3ac28c={};_0x3ac28c[_0x363771]={'$like':'%'+_0x39c242[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x3ac28c;})});}_0x5052ce=_[_0x6be6('0x5d')]({},_0x5052ce,_0x39c242[_0x6be6('0x5e')]);return db[_0x6be6('0xe2')][_0x6be6('0x29')]({'where':_0x5052ce[_0x6be6('0x41')]})[_0x6be6('0x18')](function(_0x8cffb8){_0x4b946d[_0x6be6('0x29')]=_0x8cffb8;if(_0x39c242[_0x6be6('0x42')][_0x6be6('0x5c')]){_0x5052ce[_0x6be6('0x43')]=[{'all':!![]}];}return db[_0x6be6('0xe2')][_0x6be6('0x48')](_0x5052ce);})[_0x6be6('0x18')](function(_0x1b5778){_0x4b946d[_0x6be6('0x49')]=_0x1b5778;return _0x4b946d;});}})[_0x6be6('0x18')](respondWithFilteredResult(_0x3b375d,_0x5052ce))['catch'](handleError(_0x3b375d,null));};exports[_0x6be6('0xe3')]=function(_0x1a49ed,_0x4f7383){var _0x2f5fc0={};var _0x3532a={};var _0xbfe564;var _0x5923b3;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x1a49ed[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x4f7383,null))[_0x6be6('0x18')](function(_0x172970){if(_0x172970){_0xbfe564=_0x172970;_0x3532a['model']=_[_0x6be6('0x56')](db[_0x6be6('0xe4')]['rawAttributes']);_0x3532a['query']=_[_0x6be6('0x56')](_0x1a49ed[_0x6be6('0x42')]);_0x3532a['filters']=_['intersection'](_0x3532a[_0x6be6('0x54')],_0x3532a['query']);_0x2f5fc0[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x3532a[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x1a49ed['query'][_0x6be6('0x5a')]));_0x2f5fc0[_0x6be6('0x59')]=_0x2f5fc0[_0x6be6('0x59')]['length']?_0x2f5fc0[_0x6be6('0x59')]:_0x3532a['model'];_0x2f5fc0[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x1a49ed[_0x6be6('0x42')][_0x6be6('0xca')]);_0x2f5fc0['where']=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x1a49ed[_0x6be6('0x42')],_0x3532a[_0x6be6('0xc8')]));if(_0x1a49ed[_0x6be6('0x42')][_0x6be6('0x36')]){_0x2f5fc0[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x2f5fc0[_0x6be6('0x41')],{'$or':_['map'](_0x2f5fc0['attributes'],function(_0x43baf1){var _0x37daa6={};_0x37daa6[_0x43baf1]={'$like':'%'+_0x1a49ed[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x37daa6;})});}_0x2f5fc0=_[_0x6be6('0x5d')]({},_0x2f5fc0,_0x1a49ed[_0x6be6('0x5e')]);return _0xbfe564['getSmsInteractions'](_0x2f5fc0);}})[_0x6be6('0x18')](function(_0x3d4c2d){if(_0x3d4c2d){_0x5923b3=_0x3d4c2d[_0x6be6('0x5b')];if(!_0x1a49ed[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x2f5fc0[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x1a49ed[_0x6be6('0x42')][_0x6be6('0x27')]);_0x2f5fc0[_0x6be6('0x26')]=qs['offset'](_0x1a49ed[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0xbfe564[_0x6be6('0xe3')](_0x2f5fc0);}})[_0x6be6('0x18')](function(_0x56ec43){if(_0x56ec43){return _0x56ec43?{'count':_0x5923b3,'rows':_0x56ec43}:null;}})[_0x6be6('0x18')](respondWithResult(_0x4f7383,null))[_0x6be6('0x52')](handleError(_0x4f7383,null));};exports[_0x6be6('0xe5')]=function(_0x246dd6,_0x3bf99f){var _0x2b6b5a={};var _0x1b8acd={};var _0x3dba23;var _0x548f0c;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x246dd6['params']['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x3bf99f,null))['then'](function(_0x4b2e67){if(_0x4b2e67){_0x3dba23=_0x4b2e67;_0x1b8acd[_0x6be6('0x54')]=_[_0x6be6('0x56')](db['FaxInteraction'][_0x6be6('0x3d')]);_0x1b8acd[_0x6be6('0x42')]=_['keys'](_0x246dd6[_0x6be6('0x42')]);_0x1b8acd[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x1b8acd[_0x6be6('0x54')],_0x1b8acd[_0x6be6('0x42')]);_0x2b6b5a[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x1b8acd['model'],qs[_0x6be6('0x5a')](_0x246dd6[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x2b6b5a['attributes']=_0x2b6b5a[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x2b6b5a[_0x6be6('0x59')]:_0x1b8acd[_0x6be6('0x54')];_0x2b6b5a[_0x6be6('0xc9')]=qs['sort'](_0x246dd6['query'][_0x6be6('0xca')]);_0x2b6b5a[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x246dd6[_0x6be6('0x42')],_0x1b8acd[_0x6be6('0xc8')]));if(_0x246dd6['query']['filter']){_0x2b6b5a[_0x6be6('0x41')]=_['merge'](_0x2b6b5a[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x2b6b5a['attributes'],function(_0x105620){var _0x50be48={};_0x50be48[_0x105620]={'$like':'%'+_0x246dd6[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x50be48;})});}_0x2b6b5a=_[_0x6be6('0x5d')]({},_0x2b6b5a,_0x246dd6[_0x6be6('0x5e')]);return _0x3dba23[_0x6be6('0xe5')](_0x2b6b5a);}})['then'](function(_0x32cf2b){if(_0x32cf2b){_0x548f0c=_0x32cf2b[_0x6be6('0x5b')];if(!_0x246dd6[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x2b6b5a[_0x6be6('0x27')]=qs['limit'](_0x246dd6['query']['limit']);_0x2b6b5a[_0x6be6('0x26')]=qs['offset'](_0x246dd6[_0x6be6('0x42')][_0x6be6('0x26')]);}return _0x3dba23['getFaxInteractions'](_0x2b6b5a);}})['then'](function(_0x1b6444){if(_0x1b6444){return _0x1b6444?{'count':_0x548f0c,'rows':_0x1b6444}:null;}})[_0x6be6('0x18')](respondWithResult(_0x3bf99f,null))[_0x6be6('0x52')](handleError(_0x3bf99f,null));};exports[_0x6be6('0xe6')]=function(_0x1ec494,_0x346e40){var _0x227af9={};var _0x53213c={};var _0x10e4e1;var _0x2c33d2;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x1ec494[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x346e40,null))[_0x6be6('0x18')](function(_0x596dd6){if(_0x596dd6){_0x10e4e1=_0x596dd6;_0x53213c[_0x6be6('0x54')]=_[_0x6be6('0x56')](db[_0x6be6('0xe7')][_0x6be6('0x3d')]);_0x53213c[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x1ec494['query']);_0x53213c[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x53213c[_0x6be6('0x54')],_0x53213c[_0x6be6('0x42')]);_0x227af9[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x53213c[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x1ec494[_0x6be6('0x42')]['fields']));_0x227af9[_0x6be6('0x59')]=_0x227af9[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x227af9[_0x6be6('0x59')]:_0x53213c[_0x6be6('0x54')];_0x227af9[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x1ec494['query']['sort']);_0x227af9[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_['pick'](_0x1ec494[_0x6be6('0x42')],_0x53213c['filters']));if(_0x1ec494[_0x6be6('0x42')][_0x6be6('0x36')]){_0x227af9[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x227af9[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x227af9[_0x6be6('0x59')],function(_0x200da4){var _0x218f86={};_0x218f86[_0x200da4]={'$like':'%'+_0x1ec494[_0x6be6('0x42')]['filter']+'%'};return _0x218f86;})});}_0x227af9=_[_0x6be6('0x5d')]({},_0x227af9,_0x1ec494[_0x6be6('0x5e')]);return _0x10e4e1[_0x6be6('0xe6')](_0x227af9);}})['then'](function(_0x1ed236){if(_0x1ed236){_0x2c33d2=_0x1ed236[_0x6be6('0x5b')];if(!_0x1ec494[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x227af9[_0x6be6('0x27')]=qs['limit'](_0x1ec494['query'][_0x6be6('0x27')]);_0x227af9[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x1ec494['query']['offset']);}return _0x10e4e1['getWhatsappInteractions'](_0x227af9);}})[_0x6be6('0x18')](function(_0x887e8b){if(_0x887e8b){return _0x887e8b?{'count':_0x2c33d2,'rows':_0x887e8b}:null;}})[_0x6be6('0x18')](respondWithResult(_0x346e40,null))[_0x6be6('0x52')](handleError(_0x346e40,null));};exports[_0x6be6('0xe8')]=function(_0x736a40,_0x13aaca,_0x591856){var _0x42d7fa;var _0x46f456;var _0x4b6a7d;var _0x29e855=!_[_0x6be6('0x70')](_0x736a40['params']['id'])?_0x736a40[_0x6be6('0x61')]['id']:!_[_0x6be6('0x70')](_0x736a40['user']['id'])?_0x736a40[_0x6be6('0x31')]['id']:null;return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x29e855,'role':{'$or':[_0x6be6('0x2f'),_0x6be6('0x31'),_0x6be6('0x33')]}},'attributes':['id',_0x6be6('0x3b'),_0x6be6('0xe9'),_0x6be6('0xea'),_0x6be6('0x2e'),_0x6be6('0x66'),_0x6be6('0x9e')]})[_0x6be6('0x18')](function(_0x113d14){if(_0x113d14){if(_0x113d14[_0x6be6('0x2e')]===_0x6be6('0x33')){_0x42d7fa=_0x113d14;if(_0x736a40['body']['interface']){_0x4b6a7d=util[_0x6be6('0xaa')](_0x6be6('0xeb'),_0x42d7fa[_0x736a40[_0x6be6('0x60')][_0x6be6('0xa9')]]);}else if(_0x736a40['body'][_0x6be6('0xec')]){_0x4b6a7d=util[_0x6be6('0xaa')]('SIP/%s',_0x736a40['body'][_0x6be6('0xec')]);}else{_0x4b6a7d=util[_0x6be6('0xaa')]('SIP/%s',_0x42d7fa[_0x6be6('0x3b')]);}socket['to'](util[_0x6be6('0xaa')](_0x6be6('0xed'),_0x42d7fa[_0x6be6('0x3b')]))[_0x6be6('0x2c')](_0x6be6('0xee'),{'user':{'id':_0x42d7fa['id'],'name':_0x42d7fa['name']},'ip':_0x736a40[_0x6be6('0xef')][_0x6be6('0xf0')]||_0x736a40[_0x6be6('0xf1')][_0x6be6('0xf2')]||_0x736a40[_0x6be6('0xf3')]['remoteAddress']||_0x736a40[_0x6be6('0xf1')]['socket']['remoteAddress']});return db[_0x6be6('0xd8')][_0x6be6('0x2d')]({'where':{'membername':_0x42d7fa[_0x6be6('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x6be6('0x8e'))][(_0x6be6('0x8f'))](_0x6be6('0xf4'));}})['then'](function(){if(_0x42d7fa){return _0x42d7fa[_0x6be6('0xf5')]({'raw':!![]});}})['then'](function(_0x4f25db){if(_0x42d7fa){if(_0x4f25db){_0x46f456=_0x4f25db;if(_0x46f456[_0x6be6('0x5b')]){var _0x29d83e=_0x46f456['map'](function(_0x364668){var _0x37af13={'membername':_0x42d7fa[_0x6be6('0x3b')],'UserId':_0x42d7fa['id'],'queue_name':_0x364668['name'],'VoiceQueueId':_0x364668['id'],'interface':_0x4b6a7d,'paused':_0x42d7fa['loginInPause']||![],'penalty':_0x364668['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x6be6('0xac')](_0x37af13);});return Promise['all'](_0x29d83e);}}}})[_0x6be6('0x18')](function(){if(_0x42d7fa){return db[_0x6be6('0xf6')][_0x6be6('0x48')]({'where':{'membername':_0x42d7fa[_0x6be6('0x3b')],'exitAt':null}});}})[_0x6be6('0x18')](function(_0x10d2a9){if(_0x42d7fa){var _0x187452=[];_0x10d2a9[_0x6be6('0xf7')](function(_0x1c9f21){_0x187452[_0x6be6('0x47')](_0x1c9f21[_0x6be6('0x2b')]({'exitAt':moment()['format'](_0x6be6('0xf8'))}));});return Promise['all'](_0x187452);}})['then'](function(){if(_0x42d7fa){var _0x2e402f=[];var _0x351d39=[];var _0x296d4a=utils[_0x6be6('0xf9')]();var _0x3f14e4={'membername':_0x42d7fa['name'],'interface':_0x4b6a7d,'enterAt':moment()[_0x6be6('0xaa')](_0x6be6('0xf8')),'role':_0x42d7fa['role'],'internal':_0x42d7fa[_0x6be6('0x66')]};_0x296d4a[_0x6be6('0xf7')](function(_0x30ab64){_0x2e402f[_0x6be6('0x47')](_[_0x6be6('0x5d')]({'channel':_0x30ab64,'type':_0x6be6('0xfa'),'data1':_0x736a40[_0x6be6('0x60')][_0x6be6('0xfb')],'data2':_0x4b6a7d},_0x3f14e4));if(_0x42d7fa[_0x6be6('0x9e')]){_0x351d39[_0x6be6('0x47')](_[_0x6be6('0x5d')]({'channel':_0x30ab64,'type':'PAUSE','data1':_0x6be6('0xfc')},_0x3f14e4));}});return db[_0x6be6('0xf6')][_0x6be6('0x87')](_0x2e402f[_0x6be6('0xc7')](_0x351d39),{'individualHooks':!![]});}})[_0x6be6('0x18')](function(){if(_0x42d7fa){return _0x42d7fa[_0x6be6('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x6be6('0xf8')),'voicePause':_0x42d7fa[_0x6be6('0x9e')]||![],'mailPause':_0x42d7fa['loginInPause']||![],'chatPause':_0x42d7fa[_0x6be6('0x9e')]||![],'faxPause':_0x42d7fa[_0x6be6('0x9e')]||![],'smsPause':_0x42d7fa[_0x6be6('0x9e')]||![],'openchannelPause':_0x42d7fa['loginInPause']||![],'whatsappPause':_0x42d7fa[_0x6be6('0x9e')]||![],'pauseType':_0x42d7fa[_0x6be6('0x9e')]?_0x6be6('0xfc'):null,'interface':_0x4b6a7d,'lastPauseAt':moment()[_0x6be6('0xaa')](_0x6be6('0xf8'))});}})['then'](function(_0x169f8c){if(_0x736a40['isMiddleware']){return _0x591856();}else{return Promise[_0x6be6('0xfd')](_0x169f8c)[_0x6be6('0x18')](respondWithResult(_0x13aaca,null));}})[_0x6be6('0x52')](handleError(_0x13aaca,null));};exports['logout']=function(_0x1171ee,_0x18098f){var _0x3b326c;return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x1171ee[_0x6be6('0x61')]['id'],'role':_0x6be6('0x33')},'attributes':['id',_0x6be6('0x3b'),_0x6be6('0x2e')]})['then'](handleEntityNotFound(_0x18098f,null))[_0x6be6('0x18')](function(_0x58f3d2){if(_0x58f3d2){_0x3b326c=_0x58f3d2;return db[_0x6be6('0xd8')][_0x6be6('0x2d')]({'where':{'membername':_0x3b326c['name']},'individualHooks':!![]});}})[_0x6be6('0x18')](function(){return db['MemberReport'][_0x6be6('0x48')]({'where':{'membername':_0x3b326c[_0x6be6('0x3b')],'exitAt':null}});})['then'](function(_0x25aaad){var _0xef83c1=[];_0x25aaad[_0x6be6('0xf7')](function(_0x5b379c){_0xef83c1[_0x6be6('0x47')](_0x5b379c['update']({'exitAt':moment()[_0x6be6('0xaa')](_0x6be6('0xf8'))}));});return Promise['all'](_0xef83c1);})[_0x6be6('0x18')](function(){return _0x3b326c['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6be6('0x18')](respondWithResult(_0x18098f,null))[_0x6be6('0x52')](handleError(_0x18098f,null));};exports['pause']=function(_0x27ce8f,_0x4026d8){var _0x4532ba;return db[_0x6be6('0xd8')][_0x6be6('0x2b')]({'paused':0x1},{'where':{'UserId':_0x27ce8f[_0x6be6('0x61')]['id']},'individualHooks':!![]})[_0x6be6('0x18')](function(){return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x27ce8f[_0x6be6('0x61')]['id'],'role':'agent'},'attributes':['id',_0x6be6('0x3b'),_0x6be6('0x2e'),_0x6be6('0x66'),'interface',_0x6be6('0x9d')]});})['then'](handleEntityNotFound(_0x4026d8,null))[_0x6be6('0x18')](function(_0x4e4132){if(_0x4e4132){_0x4532ba=_0x4e4132;return respondWithRpcPromise(_0x6be6('0xfe'),'pause',{'id':_0x4532ba['id'],'name':_0x4532ba[_0x6be6('0x3b')],'pause':!![]});}})[_0x6be6('0x18')](function(){if(_0x4532ba){return db['MemberReport'][_0x6be6('0x48')]({'where':{'membername':_0x4532ba[_0x6be6('0x3b')],'type':_0x6be6('0xff'),'exitAt':null}});}})[_0x6be6('0x18')](function(_0x52f0ee){if(_0x52f0ee[_0x6be6('0x5b')]){var _0xf4e526=moment()[_0x6be6('0xaa')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x322fae=0x0,_0x2e78c5=_0x52f0ee[_0x6be6('0x5b')];_0x322fae<_0x2e78c5;_0x322fae++){_0x52f0ee[_0x322fae][_0x6be6('0x100')]({'exitAt':_0xf4e526});}}})[_0x6be6('0x18')](function(){var _0x22b110=[];var _0x5b11a6=utils[_0x6be6('0xf9')]();_0x5b11a6[_0x6be6('0xf7')](function(_0x1aeb57){_0x22b110[_0x6be6('0x47')]({'channel':_0x1aeb57,'membername':_0x4532ba[_0x6be6('0x3b')],'interface':_['isNil'](_0x4532ba[_0x6be6('0xa9')])?util['format'](_0x6be6('0x101'),_0x4532ba[_0x6be6('0x3b')]):_0x4532ba[_0x6be6('0xa9')],'type':_0x6be6('0xff'),'enterAt':moment()[_0x6be6('0xaa')](_0x6be6('0xf8')),'data1':_0x27ce8f['body']['type']||_0x6be6('0x102'),'role':_0x4532ba['role'],'internal':_0x4532ba[_0x6be6('0x66')]});});return db[_0x6be6('0xf6')][_0x6be6('0x87')](_0x22b110,{'individualHooks':!![]});})['then'](function(){return _0x4532ba['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x27ce8f[_0x6be6('0x60')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x6be6('0xaa')](_0x6be6('0xf8'))});})[_0x6be6('0x18')](respondWithResult(_0x4026d8,null))['catch'](handleError(_0x4026d8,null));};exports[_0x6be6('0x103')]=function(_0x5723ee,_0x17c5e7){if(_0x5723ee[_0x6be6('0x60')][_0x6be6('0x9c')]&&!utils[_0x6be6('0xa0')](_0x5723ee[_0x6be6('0x60')]['channel'])){throw new APIBadRequestError(util[_0x6be6('0xaa')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x5723ee['body'][_0x6be6('0x9c')]));}return db[_0x6be6('0x3c')][_0x6be6('0x3a')]({'where':{'id':_0x5723ee['params']['id']},'attributes':['id','name',_0x6be6('0x2e'),'internal',_0x6be6('0xa9'),_0x6be6('0x9d'),_0x6be6('0x9f'),'mailPause',_0x6be6('0x104'),_0x6be6('0x105'),_0x6be6('0x106'),_0x6be6('0x107'),_0x6be6('0x108'),_0x6be6('0x109'),_0x6be6('0x10a')]})['then'](function(_0x50622c){if(!_0x50622c){throw new APINotFoundError(util['format'](_0x6be6('0x10b'),_0x5723ee['params']['id']));}return _0x50622c[_0x6be6('0x103')](_0x5723ee[_0x6be6('0x60')][_0x6be6('0x9c')]);})[_0x6be6('0x18')](respondWithResult(_0x17c5e7,null))[_0x6be6('0x52')](APIHandleError(_0x17c5e7));};exports[_0x6be6('0x10c')]=function(_0x163935,_0x28de2f){var _0x4d82ff={};var _0x5072f8={};var _0x720245;var _0x157d81;return db[_0x6be6('0x3c')]['findOne']({'where':{'id':_0x163935[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x28de2f,null))[_0x6be6('0x18')](function(_0x50e5db){if(_0x50e5db){_0x720245=_0x50e5db;_0x5072f8[_0x6be6('0x54')]=_[_0x6be6('0x56')](db[_0x6be6('0x10d')][_0x6be6('0x3d')]);_0x5072f8[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x163935[_0x6be6('0x42')]);_0x5072f8[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x5072f8[_0x6be6('0x54')],_0x5072f8['query']);_0x4d82ff[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x5072f8['model'],qs['fields'](_0x163935[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x4d82ff[_0x6be6('0x59')]=_0x4d82ff['attributes'][_0x6be6('0x5b')]?_0x4d82ff[_0x6be6('0x59')]:_0x5072f8[_0x6be6('0x54')];_0x4d82ff[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x163935[_0x6be6('0x42')][_0x6be6('0xca')]);_0x4d82ff[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x163935['query'],_0x5072f8[_0x6be6('0xc8')]));if(_0x163935[_0x6be6('0x42')][_0x6be6('0x36')]){_0x4d82ff[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x4d82ff[_0x6be6('0x41')],{'$or':_['map'](_0x4d82ff['attributes'],function(_0x344ea8){var _0x560c27={};_0x560c27[_0x344ea8]={'$like':'%'+_0x163935[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x560c27;})});}_0x4d82ff=_['merge']({},_0x4d82ff,_0x163935[_0x6be6('0x5e')]);return _0x720245[_0x6be6('0x10c')](_0x4d82ff);}})[_0x6be6('0x18')](function(_0x55c4a7){if(_0x55c4a7){_0x157d81=_0x55c4a7[_0x6be6('0x5b')];if(!_0x163935[_0x6be6('0x42')][_0x6be6('0xd1')]('nolimit')){_0x4d82ff[_0x6be6('0x27')]=qs[_0x6be6('0x27')](_0x163935['query'][_0x6be6('0x27')]);_0x4d82ff[_0x6be6('0x26')]=qs['offset'](_0x163935['query'][_0x6be6('0x26')]);}return _0x720245['getTeams'](_0x4d82ff);}})[_0x6be6('0x18')](function(_0x178aea){if(_0x178aea){return _0x178aea?{'count':_0x157d81,'rows':_0x178aea}:null;}})['then'](respondWithResult(_0x28de2f,null))[_0x6be6('0x52')](handleError(_0x28de2f,null));};exports['addTeams']=function(_0x138870,_0x459c06){var _0x45b605=_0x138870[_0x6be6('0x61')]['id'];var _0x5d3556=_0x138870[_0x6be6('0x60')]?_0x138870['body'][_0x6be6('0x64')]:null;var _0x3dda8b=[];return Promise[_0x6be6('0xfd')]()[_0x6be6('0x18')](function(){if(!_0x5d3556)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x6be6('0x18')](function(){return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x45b605}});})['then'](function(_0x35da4f){if(!_0x35da4f)throw new APINotFoundError(util[_0x6be6('0xaa')](_0x6be6('0x10b'),_0x138870[_0x6be6('0x61')]['id']));return db[_0x6be6('0x6c')]['transaction'](function(_0x6c7ad8){return _0x35da4f[_0x6be6('0x10e')](_0x5d3556,{'transaction':_0x6c7ad8})[_0x6be6('0x18')](function(){return db[_0x6be6('0x10d')]['findAll']({'where':{'id':{'$in':_0x5d3556}}});})[_0x6be6('0x18')](function(_0x4bcf33){var _0x1bf325=_[_0x6be6('0x37')](_0x4bcf33,function(_0x543a1d){return _0x543a1d[_0x6be6('0x10f')]();});return Promise[_0x6be6('0x51')](_0x1bf325);})[_0x6be6('0x18')](function(_0x12d477){_0x3dda8b=_[_0x6be6('0x110')](_0x12d477);var _0x32747=_[_0x6be6('0x37')](_0x3dda8b,function(_0x44a1d1){return _0x44a1d1[_0x6be6('0x111')](_0x35da4f['id'],{'transaction':_0x6c7ad8});});return Promise[_0x6be6('0x51')](_0x32747);})[_0x6be6('0x18')](function(){if(!_0x35da4f[_0x6be6('0x9d')])return;var _0x3c6f00=_[_0x6be6('0x36')](_0x3dda8b,function(_0x2437bd){return _0x2437bd[_0x6be6('0x112')](_0x6be6('0x9c'))===_0x6be6('0x113');});var _0x2b8c29=_[_0x6be6('0x37')](_0x3c6f00,function(_0x5cc081){return db['UserVoiceQueueRt'][_0x6be6('0xac')]({'membername':_0x35da4f[_0x6be6('0x3b')],'UserId':_0x35da4f['id'],'queue_name':_0x5cc081[_0x6be6('0x3b')],'VoiceQueueId':_0x5cc081['id'],'interface':_[_0x6be6('0x70')](_0x35da4f[_0x6be6('0xa9')])?util[_0x6be6('0xaa')](_0x6be6('0x101'),_0x35da4f['name']):_0x35da4f[_0x6be6('0xa9')],'paused':_0x35da4f['voicePause']||![],'penalty':_0x35da4f[_0x6be6('0xab')]},{'transaction':_0x6c7ad8});});return Promise['all'](_0x2b8c29);})[_0x6be6('0x18')](function(){return db[_0x6be6('0x114')][_0x6be6('0x48')]({'where':{'teamId':{'$in':_0x5d3556}}});})[_0x6be6('0x18')](function(_0x3a8959){var _0x2c761f=_[_0x6be6('0x37')](_0x3a8959,function(_0x546fbc){return db['UserVoicePrefix'][_0x6be6('0x7d')]({'UserId':_0x35da4f['id'],'VoicePrefixId':_0x546fbc['VoicePrefixId']},{'transaction':_0x6c7ad8});});return Promise[_0x6be6('0x51')](_0x2c761f);});});})[_0x6be6('0x18')](function(){for(var _0x5df737=0x0;_0x5df737<_0x3dda8b[_0x6be6('0x5b')];_0x5df737++){var _0x36a594=_0x3dda8b[_0x5df737][_0x6be6('0x112')](_0x6be6('0x9c'));var _0x27b669=_0x36a594+_0x6be6('0xa6');socket[_0x6be6('0x2c')](_0x6be6('0x31')+_0x36a594+_0x6be6('0xa7'),{'UserId':_0x45b605,['queueField']:_0x3dda8b[_0x5df737]['id']});}})[_0x6be6('0x18')](respondWithStatusCode(_0x459c06,null))[_0x6be6('0x52')](APIHandleError(_0x459c06));};exports['removeTeams']=function(_0x138fbe,_0x3163d7){var _0x309825=_0x138fbe[_0x6be6('0x61')]['id'];var _0x4d4952=null;if(_0x138fbe[_0x6be6('0x42')][_0x6be6('0x64')]){_0x4d4952=_[_0x6be6('0xae')](_0x138fbe['query'][_0x6be6('0x64')])?_0x138fbe['query'][_0x6be6('0x64')]:[_0x138fbe[_0x6be6('0x42')][_0x6be6('0x64')]];}var _0x53c8f0=[];return Promise[_0x6be6('0xfd')]()[_0x6be6('0x18')](function(){if(!_0x4d4952)throw new APIBadRequestError(_0x6be6('0x115'));})['then'](function(){return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x309825}});})[_0x6be6('0x18')](function(_0x201df4){if(!_0x201df4)throw new APINotFoundError(util[_0x6be6('0xaa')](_0x6be6('0x10b'),_0x138fbe[_0x6be6('0x61')]['id']));return db['sequelize']['transaction'](function(_0x3862f5){return _0x201df4['removeTeams'](_0x4d4952,{'transaction':_0x3862f5})['then'](function(){return db[_0x6be6('0x10d')][_0x6be6('0x48')]({'where':{'id':{'$in':_0x4d4952}}});})['then'](function(_0x3a0b78){var _0x2c748c=_['map'](_0x3a0b78,function(_0x2b2b9a){return _0x2b2b9a[_0x6be6('0x10f')]();});return Promise[_0x6be6('0x51')](_0x2c748c);})[_0x6be6('0x18')](function(_0x3e717d){_0x53c8f0=_[_0x6be6('0x110')](_0x3e717d);var _0x2348fc=_['map'](_0x53c8f0,function(_0x1967c7){return _0x1967c7[_0x6be6('0x116')](_0x201df4['id'],{'transaction':_0x3862f5});});return Promise[_0x6be6('0x51')](_0x2348fc);})[_0x6be6('0x18')](function(){if(!_0x201df4[_0x6be6('0x9d')])return;var _0x5c4c25=_[_0x6be6('0x36')](_0x53c8f0,function(_0x219ee6){return _0x219ee6['getDataValue']('channel')===_0x6be6('0x113');});var _0x590494=_[_0x6be6('0x37')](_0x5c4c25,function(_0x452859){return db[_0x6be6('0xd8')]['destroy']({'where':{'VoiceQueueId':_0x452859['id'],'UserId':_0x201df4['id']},'transaction':_0x3862f5});});return Promise['all'](_0x590494);})[_0x6be6('0x18')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x4d4952}}});})[_0x6be6('0x18')](function(_0x303351){var _0x2739bb=_[_0x6be6('0x37')](_0x303351,function(_0x324951){return db[_0x6be6('0x117')][_0x6be6('0x2d')]({'where':{'UserId':_0x201df4['id'],'VoicePrefixId':_0x324951[_0x6be6('0x118')]}},{'transaction':_0x3862f5});});return Promise[_0x6be6('0x51')](_0x2739bb);});});})[_0x6be6('0x18')](function(){for(var _0x1d2199=0x0;_0x1d2199<_0x53c8f0['length'];_0x1d2199++){var _0x17baf7=_0x53c8f0[_0x1d2199][_0x6be6('0x112')](_0x6be6('0x9c'));var _0x10ab28=_0x17baf7+_0x6be6('0xa6');socket[_0x6be6('0x2c')](_0x6be6('0x31')+_0x17baf7+_0x6be6('0xaf'),{'UserId':_0x309825,['queueField']:_0x53c8f0[_0x1d2199]['id']});}})[_0x6be6('0x18')](respondWithStatusCode(_0x3163d7,null))[_0x6be6('0x52')](APIHandleError(_0x3163d7));};exports[_0x6be6('0x119')]=function(_0x340ce7,_0xa2f7be){var _0x42a31e={};var _0x525a8b={};var _0x1b7719;var _0x1b1903;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x340ce7[_0x6be6('0x61')]['id']}})['then'](handleEntityNotFound(_0xa2f7be,null))['then'](function(_0x43e1b6){if(_0x43e1b6){_0x1b7719=_0x43e1b6;_0x525a8b[_0x6be6('0x54')]=_[_0x6be6('0x56')](db[_0x6be6('0x11a')]['rawAttributes']);_0x525a8b[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x340ce7[_0x6be6('0x42')]);_0x525a8b[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x525a8b[_0x6be6('0x54')],_0x525a8b['query']);_0x42a31e[_0x6be6('0x59')]=_[_0x6be6('0x58')](_0x525a8b['model'],qs[_0x6be6('0x5a')](_0x340ce7[_0x6be6('0x42')][_0x6be6('0x5a')]));_0x42a31e[_0x6be6('0x59')]=_0x42a31e['attributes'][_0x6be6('0x5b')]?_0x42a31e['attributes']:_0x525a8b['model'];_0x42a31e[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x340ce7[_0x6be6('0x42')][_0x6be6('0xca')]);_0x42a31e[_0x6be6('0x41')]=qs['filters'](_[_0x6be6('0xd5')](_0x340ce7[_0x6be6('0x42')],_0x525a8b[_0x6be6('0xc8')]));if(_0x340ce7[_0x6be6('0x42')]['filter']){_0x42a31e[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x42a31e[_0x6be6('0x41')],{'$or':_[_0x6be6('0x37')](_0x42a31e[_0x6be6('0x59')],function(_0x1a613c){var _0x17ca83={};_0x17ca83[_0x1a613c]={'$like':'%'+_0x340ce7[_0x6be6('0x42')][_0x6be6('0x36')]+'%'};return _0x17ca83;})});}_0x42a31e=_['merge']({},_0x42a31e,_0x340ce7[_0x6be6('0x5e')]);return _0x1b7719['getLists'](_0x42a31e);}})[_0x6be6('0x18')](function(_0x3aae43){if(_0x3aae43){_0x1b1903=_0x3aae43[_0x6be6('0x5b')];if(!_0x340ce7[_0x6be6('0x42')][_0x6be6('0xd1')](_0x6be6('0xd2'))){_0x42a31e['limit']=qs[_0x6be6('0x27')](_0x340ce7[_0x6be6('0x42')][_0x6be6('0x27')]);_0x42a31e[_0x6be6('0x26')]=qs[_0x6be6('0x26')](_0x340ce7['query'][_0x6be6('0x26')]);}return _0x1b7719[_0x6be6('0x119')](_0x42a31e);}})[_0x6be6('0x18')](function(_0x138a8e){if(_0x138a8e){return _0x138a8e?{'count':_0x1b1903,'rows':_0x138a8e}:null;}})[_0x6be6('0x18')](respondWithResult(_0xa2f7be,null))[_0x6be6('0x52')](handleError(_0xa2f7be,null));};exports[_0x6be6('0x11b')]=function(_0x585260,_0x24ede3){var _0x52ff6e={};var _0x1aff0b={};var _0x4b347f;return db[_0x6be6('0x3c')][_0x6be6('0x94')]({'where':{'id':_0x585260[_0x6be6('0x61')]['id']}})[_0x6be6('0x18')](handleEntityNotFound(_0x24ede3,null))[_0x6be6('0x18')](function(_0x1271ff){if(_0x1271ff){_0x4b347f=_0x1271ff;_0x1aff0b[_0x6be6('0x54')]=_['keys'](db[_0x6be6('0x3c')][_0x6be6('0x3d')]);_0x1aff0b[_0x6be6('0x42')]=_[_0x6be6('0x56')](_0x585260[_0x6be6('0x42')]);_0x1aff0b[_0x6be6('0xc8')]=_[_0x6be6('0x58')](_0x1aff0b[_0x6be6('0x54')],_0x1aff0b[_0x6be6('0x42')]);_0x52ff6e['attributes']=_['intersection'](_0x1aff0b[_0x6be6('0x54')],qs[_0x6be6('0x5a')](_0x585260[_0x6be6('0x42')]['fields']));_0x52ff6e[_0x6be6('0x59')]=_0x52ff6e[_0x6be6('0x59')][_0x6be6('0x5b')]?_0x52ff6e[_0x6be6('0x59')]:_0x1aff0b[_0x6be6('0x54')];_0x52ff6e[_0x6be6('0xc9')]=qs[_0x6be6('0xca')](_0x585260[_0x6be6('0x42')][_0x6be6('0xca')]);_0x52ff6e[_0x6be6('0x41')]=qs[_0x6be6('0xc8')](_[_0x6be6('0xd5')](_0x585260[_0x6be6('0x42')],_0x1aff0b[_0x6be6('0xc8')]));if(_0x585260[_0x6be6('0x42')][_0x6be6('0x36')]){_0x52ff6e[_0x6be6('0x41')]=_[_0x6be6('0x5d')](_0x52ff6e['where'],{'$or':_[_0x6be6('0x37')](_0x52ff6e[_0x6be6('0x59')],function(_0x5a4afd){var _0x107b24={};_0x107b24[_0x5a4afd]={'$like':'%'+_0x585260[_0x6be6('0x42')]['filter']+'%'};return _0x107b24;})});}_0x52ff6e[_0x6be6('0x54')]=db[_0x6be6('0x3c')];_0x52ff6e['as']=_0x6be6('0x32');_0x52ff6e=_[_0x6be6('0x5d')]({},_0x52ff6e,_0x585260['options']);return _0x4b347f[_0x6be6('0xf5')]({'include':[_0x52ff6e]});}})[_0x6be6('0x18')](function(_0x3359ec){if(_0x3359ec){var _0x3491c8={},_0xa772c0=[];for(var _0xbc2b4d=0x0;_0xbc2b4d<_0x3359ec[_0x6be6('0x5b')];_0xbc2b4d+=0x1){for(var _0x171a6e=0x0,_0x1eecfa;_0x171a6e<_0x3359ec[_0xbc2b4d]['Agents'][_0x6be6('0x5b')];_0x171a6e+=0x1){_0x1eecfa=_0x3359ec[_0xbc2b4d]['Agents'][_0x171a6e]['get']({'plain':!![]});_0x3491c8[_0x1eecfa['id']]=_0x1eecfa;}}_0x3491c8=_['values'](_0x3491c8);for(var _0xe0e54a=qs[_0x6be6('0x26')](_0x585260['query'][_0x6be6('0x26')]);_0xe0e54a<_0x3491c8[_0x6be6('0x5b')]&&_0xa772c0[_0x6be6('0x5b')]=_0x2e6a84){_0x213d29=_0x2e6a84;_0x17fb98=0xc8;}else{_0x17fb98=0xce;}_0x1e759e[_0x0d20('0x1e')](_0x17fb98);return _0x1e759e[_0x0d20('0x25')](_0x0d20('0x26'),_0x37a62a+'-'+_0x213d29+'/'+_0x2e6a84)[_0x0d20('0x20')](_0x1ec638);}return null;};}function saveUpdates(_0x4e9761){return function(_0x4621e7){if(_0x4621e7){return _0x4621e7[_0x0d20('0x27')](_0x4e9761)[_0x0d20('0x28')](function(_0x38a08c){socket[_0x0d20('0x29')](_0x0d20('0x2a')+_0x38a08c['id'],{});return _0x38a08c;});}return null;};}function removeEntity(_0x3d17cc){return function(_0x310804){if(_0x310804){return _0x310804[_0x0d20('0x2b')]()[_0x0d20('0x28')](function(){var _0x52df59=_0x310804[_0x0d20('0x2c')]({'plain':!![]});if(_0x52df59[_0x0d20('0x2d')]==='admin')return;var _0x35cf47=[{'name':_0x0d20('0x2e'),'value':_0x0d20('0x2f'),'ignore':!![]},{'name':_0x0d20('0x30'),'value':_0x0d20('0x31'),'ignore':![]},{'name':_0x0d20('0x32'),'value':'telephone','ignore':![]}];var _0x2d4cda=_(_0x35cf47)['filter']('ignore')['map'](_0x0d20('0x33'))[_0x0d20('0x33')]();if(_[_0x0d20('0x34')](_0x2d4cda,_0x52df59[_0x0d20('0x2d')])){return;}var _0x5612ff=_[_0x0d20('0x35')](_0x35cf47,[_0x0d20('0x33'),_0x52df59['role']])['name'];return db['UserProfileResource'][_0x0d20('0x2b')]({'where':{'type':_0x5612ff,'resourceId':_0x52df59['id']}})[_0x0d20('0x28')](function(){return _0x310804;});})[_0x0d20('0x28')](function(){_0x3d17cc[_0x0d20('0x1e')](0xcc)[_0x0d20('0x1f')]();});}};}function handleEntityNotFound(_0x4a157e){return function(_0x5baa56){if(!_0x5baa56){_0x4a157e[_0x0d20('0x1d')](0x194);}return _0x5baa56;};}function handleError(_0x38186e,_0x3fa12b){_0x3fa12b=_0x3fa12b||0x1f4;return function(_0x2438b9){logger['error'](_0x2438b9[_0x0d20('0x36')]);if(_0x2438b9[_0x0d20('0x37')]){delete _0x2438b9[_0x0d20('0x37')];}_0x38186e[_0x0d20('0x1e')](_0x3fa12b)[_0x0d20('0x38')](_0x2438b9);};}exports[_0x0d20('0x39')]=function(_0xcbcdf0,_0x1778b1){var _0x2f712f={},_0x10c7f6={'count':0x0,'rows':[]};var _0x238e27=_(db[_0x0d20('0x3a')]['rawAttributes'])[_0x0d20('0x3b')](function(_0x4bbf0d){return{'name':_0x4bbf0d[_0x0d20('0x3c')],'type':_0x4bbf0d[_0x0d20('0x3d')][_0x0d20('0x3e')]};})[_0x0d20('0x3f')](function(_0x4a074c){return!_['includes']([_0x0d20('0x40'),_0x0d20('0x41')],_0x4a074c[_0x0d20('0x37')]);})[_0x0d20('0x33')]();_0x2f712f=qs[_0x0d20('0x42')](_0x238e27,_0xcbcdf0);var _0x5bff28={'where':_0x2f712f[_0x0d20('0x43')]};return db[_0x0d20('0x3a')][_0x0d20('0x24')](_0x5bff28)[_0x0d20('0x28')](function(_0x4fb959){_0x10c7f6[_0x0d20('0x24')]=_0x4fb959;if(_0xcbcdf0['query'][_0x0d20('0x44')]){_0x2f712f['include']=[{'all':!![]}];}if(_0xcbcdf0['query']['userSetting']===_0x0d20('0x45')){_0x2f712f[_0x0d20('0x46')]=[{'model':db[_0x0d20('0x47')],'as':_0x0d20('0x48')}];}if(!_[_0x0d20('0x34')](_0x2f712f['attributes'],'id')){_0x2f712f[_0x0d20('0x49')][_0x0d20('0x4a')]('id');}return db[_0x0d20('0x3a')]['findAll'](_0x2f712f);})[_0x0d20('0x28')](function(_0x1bf47c){_0x10c7f6[_0x0d20('0x4b')]=_0x1bf47c;if(_0xcbcdf0['query'][_0x0d20('0x4c')]===_0x0d20('0x45')){var _0x516226=[];for(var _0x20cca2=0x0;_0x20cca2<_0x10c7f6[_0x0d20('0x4b')][_0x0d20('0x4d')];_0x20cca2++){_0x516226[_0x0d20('0x4a')](get_open_tabs('chat',_0x10c7f6[_0x0d20('0x4b')][_0x20cca2]['dataValues']));_0x516226['push'](get_open_tabs(_0x0d20('0x4e'),_0x10c7f6[_0x0d20('0x4b')][_0x20cca2][_0x0d20('0x4f')]));_0x516226[_0x0d20('0x4a')](get_open_tabs('fax',_0x10c7f6['rows'][_0x20cca2]['dataValues']));_0x516226['push'](get_open_tabs(_0x0d20('0x50'),_0x10c7f6[_0x0d20('0x4b')][_0x20cca2][_0x0d20('0x4f')]));_0x516226[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x51'),_0x10c7f6['rows'][_0x20cca2]['dataValues']));_0x516226[_0x0d20('0x4a')](get_open_tabs('whatsapp',_0x10c7f6[_0x0d20('0x4b')][_0x20cca2][_0x0d20('0x4f')]));}return Promise[_0x0d20('0x52')](_0x516226)[_0x0d20('0x28')](function(){return _0x10c7f6;});}else{return _0x10c7f6;}})[_0x0d20('0x28')](respondWithFilteredResult(_0x1778b1,_0x2f712f))[_0x0d20('0x53')](handleError(_0x1778b1,null));};exports['show']=function(_0x5c6285,_0x13aabc){var _0x4d2349={'raw':![],'where':{'id':_0x5c6285[_0x0d20('0x54')]['id']}},_0x206271={};_0x206271[_0x0d20('0x55')]=_['differenceBy'](_['keys'](db[_0x0d20('0x3a')]['rawAttributes']),[_0x0d20('0x40'),_0x0d20('0x41')]);_0x206271['query']=_[_0x0d20('0x56')](_0x5c6285['query']);_0x206271['filters']=_[_0x0d20('0x57')](_0x206271['model'],_0x206271[_0x0d20('0x58')]);_0x4d2349[_0x0d20('0x49')]=_['intersection'](_0x206271[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x5c6285[_0x0d20('0x58')][_0x0d20('0x59')]));_0x4d2349[_0x0d20('0x49')]=_0x4d2349[_0x0d20('0x49')]['length']?_0x4d2349[_0x0d20('0x49')]:_0x206271['model'];if(_0x5c6285['query']['includeAll']){_0x4d2349[_0x0d20('0x46')]=[{'all':!![]}];}if(_0x5c6285[_0x0d20('0x58')][_0x0d20('0x48')]===_0x0d20('0x45')){_0x4d2349[_0x0d20('0x46')]=[{'model':db[_0x0d20('0x47')],'as':'userSetting'}];}_0x4d2349=_[_0x0d20('0x5a')]({},_0x4d2349,_0x5c6285['options']);if(!_[_0x0d20('0x34')](_0x4d2349[_0x0d20('0x49')],'id')){_0x4d2349[_0x0d20('0x49')][_0x0d20('0x4a')]('id');}return db['User'][_0x0d20('0x35')](_0x4d2349)[_0x0d20('0x28')](handleEntityNotFound(_0x13aabc,null))[_0x0d20('0x28')](function(_0x22ef89){var _0x2ed7a3=[];values=_0x22ef89;if(_0x5c6285[_0x0d20('0x58')][_0x0d20('0x4c')]===_0x0d20('0x45')){_0x2ed7a3[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x5b'),_0x22ef89[_0x0d20('0x4f')]));_0x2ed7a3['push'](get_open_tabs(_0x0d20('0x4e'),_0x22ef89['dataValues']));_0x2ed7a3[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x51'),_0x22ef89[_0x0d20('0x4f')]));_0x2ed7a3[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x5c'),_0x22ef89['dataValues']));_0x2ed7a3[_0x0d20('0x4a')](get_open_tabs('fax',_0x22ef89[_0x0d20('0x4f')]));_0x2ed7a3[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x50'),_0x22ef89['dataValues']));return Promise[_0x0d20('0x52')](_0x2ed7a3);}else{return values;}})[_0x0d20('0x28')](function(){return values;})[_0x0d20('0x28')](respondWithResult(_0x13aabc,null))[_0x0d20('0x53')](handleError(_0x13aabc,null));};exports['update']=function(_0x62d7c4,_0x6a71a0){if(_0x62d7c4[_0x0d20('0x5d')]['id']){delete _0x62d7c4['body']['id'];}delete _0x62d7c4[_0x0d20('0x5d')][_0x0d20('0x2d')];return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x62d7c4[_0x0d20('0x54')]['id']}})['then'](handleEntityNotFound(_0x6a71a0,null))[_0x0d20('0x28')](saveUpdates(_0x62d7c4[_0x0d20('0x5d')],null))[_0x0d20('0x28')](respondWithResult(_0x6a71a0,null))[_0x0d20('0x53')](handleError(_0x6a71a0,null));};exports[_0x0d20('0x5e')]=function(_0x5ac1af,_0x38b52f){return db[_0x0d20('0x3a')][_0x0d20('0x5e')]()['then'](respondWithResult(_0x38b52f,null))[_0x0d20('0x53')](handleError(_0x38b52f,null));};exports[_0x0d20('0x5f')]=function(_0x5ea1f7,_0x39c90d){return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x5ea1f7[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x39c90d,null))[_0x0d20('0x28')](function(_0x4ba889){if(_0x4ba889){return _0x4ba889['addContacts'](_0x5ea1f7[_0x0d20('0x5d')]['ids'],_[_0x0d20('0x60')](_0x5ea1f7['body'],[_0x0d20('0x61'),'id'])||{});}})[_0x0d20('0x28')](respondWithResult(_0x39c90d,null))[_0x0d20('0x53')](handleError(_0x39c90d,null));};function validateUser(_0xb5498c){return new Promise(function(_0xeecaba,_0x30c6bc){if(_0xb5498c['internal'])return _0xeecaba(_0xb5498c);return db[_0x0d20('0x62')][_0x0d20('0x63')](0x1)[_0x0d20('0x28')](function(_0x5d292c){if(_0x5d292c[_0x0d20('0x64')])authService[_0x0d20('0x65')](_0xb5498c[_0x0d20('0x40')]);db[_0x0d20('0x3a')][_0x0d20('0x66')](_0x0d20('0x67'))[_0x0d20('0x28')](function(_0x2a294c){if(_[_0x0d20('0x68')](_0x2a294c)){_0xb5498c[_0x0d20('0x67')]=_0x5d292c['min_internal']||0x1;return;}if(_[_0x0d20('0x68')](_0x5d292c['min_internal'])||_0x5d292c[_0x0d20('0x69')]===_0x2a294c){_0xb5498c['internal']=_0x2a294c+0x1;return;}if(_0x5d292c[_0x0d20('0x69')]>_0x2a294c){_0xb5498c['internal']=_0x5d292c[_0x0d20('0x69')];return;}return db[_0x0d20('0x6a')][_0x0d20('0x58')](_0x0d20('0x6b'),{'type':db[_0x0d20('0x6a')]['QueryTypes'][_0x0d20('0x6c')]})['then'](function(_0x1920ad){if(_0x1920ad&&_0x1920ad[_0x0d20('0x4d')]){for(var _0x8ef756=0x0,_0xe45b5=_0x1920ad[_0x0d20('0x4d')];_0x8ef756<_0xe45b5&&_[_0x0d20('0x68')](_0xb5498c[_0x0d20('0x67')]);_0x8ef756++){if(_0x5d292c['min_internal']<=_0x1920ad[_0x8ef756][_0x0d20('0x6d')]){_0xb5498c[_0x0d20('0x67')]=_0x1920ad[_0x8ef756][_0x0d20('0x6d')];}else if(_0x5d292c[_0x0d20('0x69')]>_0x1920ad[_0x8ef756][_0x0d20('0x6d')]&&_0x5d292c[_0x0d20('0x69')]<=_0x1920ad[_0x8ef756]['to']){_0xb5498c['internal']=_0x5d292c[_0x0d20('0x69')];}}}if(_[_0x0d20('0x68')](_0xb5498c[_0x0d20('0x67')])){_0xb5498c[_0x0d20('0x67')]=_0x2a294c+0x1;}return _0xeecaba(_0xb5498c);});});})[_0x0d20('0x53')](function(_0xf70b80){_0x30c6bc(_0xf70b80);});});}function updateUser(_0x1d0ac9){return new Promise(function(_0x1aa146,_0xb591c4){try{if(_0x1d0ac9['voicemail']){_0x1d0ac9[_0x0d20('0x6e')]=_0x1d0ac9[_0x0d20('0x67')];_0x1d0ac9[_0x0d20('0x6f')]={'mailbox':_0x1d0ac9[_0x0d20('0x67')],'password':_0x1d0ac9[_0x0d20('0x40')],'fullname':_0x1d0ac9[_0x0d20('0x70')],'email':_0x1d0ac9['email']};}if(_0x1d0ac9[_0x0d20('0x2d')]===_0x0d20('0x31')){if(!_0x1d0ac9['permissions'])_0x1d0ac9[_0x0d20('0x71')]=[_0x0d20('0x72'),'102',_0x0d20('0x73'),_0x0d20('0x74'),'110',_0x0d20('0x75'),_0x0d20('0x76'),_0x0d20('0x77'),'107','108',_0x0d20('0x78'),_0x0d20('0x79'),_0x0d20('0x7a'),_0x0d20('0x7b'),_0x0d20('0x7c')];}_0x1aa146(_0x1d0ac9);}catch(_0x33cc90){_0xb591c4(_0x33cc90);}});}exports[_0x0d20('0x7d')]=function(_0x46054d,_0x1e9c5c){if(_0x46054d[_0x0d20('0x2f')][_0x0d20('0x2d')]==='agent')throw new Error('Unauthorized');if(_0x46054d[_0x0d20('0x5d')]['role']===_0x0d20('0x2f')&&_0x46054d[_0x0d20('0x2f')][_0x0d20('0x2d')]!==_0x0d20('0x7e')){throw new Error(_0x0d20('0x7f'));}if(_0x46054d[_0x0d20('0x5d')][_0x0d20('0x2d')]===_0x0d20('0x7e')&&_0x46054d[_0x0d20('0x2f')]['role']!=='admin'){throw new Error(_0x0d20('0x80'));}return licenseUtil[_0x0d20('0x81')]([_0x46054d[_0x0d20('0x5d')]])[_0x0d20('0x28')](function(){return validateUser(_0x46054d[_0x0d20('0x5d')]);})[_0x0d20('0x28')](function(_0x4e6309){return updateUser(_0x4e6309)[_0x0d20('0x28')](function(_0x3396cd){if(_0x3396cd[_0x0d20('0x2d')]==='admin'){_0x3396cd[_0x0d20('0x82')]=_0x46054d[_0x0d20('0x2f')]['settingsEnabled'];delete _0x3396cd[_0x0d20('0x83')];}return _0x3396cd;});})[_0x0d20('0x28')](function(_0x2cb3b4){return db['User'][_0x0d20('0x7d')](_0x2cb3b4,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x0d20('0x28')](function(_0x1f69f4){if(_0x46054d[_0x0d20('0x5d')][_0x0d20('0x2d')]===_0x0d20('0x2f'))return _0x1f69f4;if(_0x46054d[_0x0d20('0x2f')][_0x0d20('0x2d')]!==_0x0d20('0x2f'))return _0x1f69f4;return db['UserProfileSection']['find']({'where':{'name':_0x1f69f4[_0x0d20('0x2d')]===_0x0d20('0x31')?'Agents':_0x0d20('0x32'),'userProfileId':_0x46054d['user'][_0x0d20('0x83')]},'raw':!![]})[_0x0d20('0x28')](function(_0x3b145a){if(!_0x3b145a||_0x3b145a[_0x0d20('0x84')]!=0x0)return _0x1f69f4;return db[_0x0d20('0x85')]['create']({'name':_0x1f69f4[_0x0d20('0x37')],'resourceId':_0x1f69f4['id'],'type':_0x3b145a[_0x0d20('0x37')],'sectionId':_0x3b145a['id']},{})[_0x0d20('0x28')](function(){return _0x1f69f4;});})['catch'](function(_0x1a619f){logger[_0x0d20('0x17')](_0x0d20('0x86'),_0x1a619f);throw _0x1a619f;});})['then'](respondWithResult(_0x1e9c5c,0xc9))[_0x0d20('0x53')](handleError(_0x1e9c5c,null));};exports[_0x0d20('0x87')]=function(_0x2f5c75,_0x15e9c9){var _0x1cb134=_0x2f5c75['body'];var _0x560655=[];if(_0x2f5c75['user'][_0x0d20('0x2d')]==='agent')throw new Error(_0x0d20('0x88'));if(_[_0x0d20('0x89')](_0x1cb134,[_0x0d20('0x2d'),_0x0d20('0x2f')])&&_0x2f5c75[_0x0d20('0x2f')][_0x0d20('0x2d')]!==_0x0d20('0x7e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x0d20('0x89')](_0x1cb134,[_0x0d20('0x2d'),'admin'])&&_0x2f5c75['user']['role']!==_0x0d20('0x7e')){throw new Error(_0x0d20('0x8a'));}return licenseUtil[_0x0d20('0x81')](_0x1cb134)[_0x0d20('0x28')](function(){return validateUser(_0x1cb134[0x0]);})[_0x0d20('0x28')](function(){for(var _0x29e82b=0x1;_0x29e82b<_0x1cb134[_0x0d20('0x4d')];_0x29e82b++){var _0xede406=_0x1cb134[_0x29e82b-0x1][_0x0d20('0x67')];if(!_0x1cb134[_0x29e82b]['internal'])_0x1cb134[_0x29e82b][_0x0d20('0x67')]=_0xede406+0x1;_0x560655[_0x0d20('0x4a')](validateUser(_0x1cb134[_0x29e82b]));}return Promise[_0x0d20('0x52')](_0x560655);})[_0x0d20('0x28')](function(){_0x560655=[];for(var _0x2cca04=0x0;_0x2cca04<_0x1cb134[_0x0d20('0x4d')];_0x2cca04++){_0x560655['push'](updateUser(_0x1cb134[_0x2cca04]));}return Promise['all'](_0x560655);})[_0x0d20('0x28')](function(){_0x560655=_0x1cb134[_0x0d20('0x3b')](function(_0x135e6d){return db[_0x0d20('0x3a')]['create'](_0x135e6d,{'include':[{'model':db['VoiceMail'],'as':_0x0d20('0x6f')}]})[_0x0d20('0x28')](function(_0x291277){_0x135e6d['id']=_0x291277['id'];return _0x135e6d;});});return Promise['all'](_0x560655);})[_0x0d20('0x28')](function(_0x2c55b7){if(_0x2f5c75[_0x0d20('0x5d')]['role']==='user')return _0x2c55b7;if(_0x2f5c75[_0x0d20('0x2f')][_0x0d20('0x2d')]!==_0x0d20('0x2f'))return _0x2c55b7;var _0x20da6d=_['some'](_0x2c55b7,function(_0x171144){return _0x171144[_0x0d20('0x2d')]===_0x0d20('0x31')||_0x171144[_0x0d20('0x2d')]===_0x0d20('0x8b');});if(!_0x20da6d)return _0x2c55b7;return db['UserProfileSection'][_0x0d20('0x8c')]({'where':{'name':{'$or':[_0x0d20('0x30'),_0x0d20('0x32')]},'userProfileId':_0x2f5c75['user']['userProfileId']},'raw':!![]})[_0x0d20('0x28')](function(_0x4ebf66){if(_[_0x0d20('0x8d')](_0x4ebf66)||!_[_0x0d20('0x89')](_0x4ebf66,['autoAssociation',0x0]))return _0x2c55b7;_0x560655=[];var _0x116cfe=_(_0x4ebf66)[_0x0d20('0x3b')](function(_0x204c4e){if(_0x204c4e[_0x0d20('0x84')]===0x1)return;return _0x204c4e[_0x0d20('0x37')]===_0x0d20('0x30')?_0x0d20('0x31'):_0x0d20('0x8b');})[_0x0d20('0x8e')]()['value']();for(var _0x3fd459=0x0;_0x3fd459<_0x2c55b7[_0x0d20('0x4d')];_0x3fd459++){if(!_['includes'](_0x116cfe,_0x2c55b7[_0x3fd459][_0x0d20('0x2d')]))return;var _0x221aa1=_0x2c55b7[_0x3fd459][_0x0d20('0x2d')]===_0x0d20('0x31')?_0x0d20('0x30'):'Telephones';_0x560655[_0x0d20('0x4a')](db[_0x0d20('0x85')]['create']({'name':_0x2c55b7[_0x3fd459][_0x0d20('0x37')],'resourceId':_0x2c55b7[_0x3fd459]['id'],'type':_0x221aa1,'sectionId':_['find'](_0x4ebf66,[_0x0d20('0x37'),_0x221aa1])['id']},{}));}return Promise[_0x0d20('0x52')](_0x560655);});})[_0x0d20('0x28')](respondWithResult(_0x15e9c9,0xc9))[_0x0d20('0x53')](handleError(_0x15e9c9,null));};exports[_0x0d20('0x8f')]=function(_0x14945f,_0x5ab86b){if(_0x14945f['body']['id']){delete _0x14945f['body']['id'];}return db[_0x0d20('0x3a')]['find']({'where':{'id':_0x14945f['params']['id']}})[_0x0d20('0x28')](function(_0x5b9ba0){if(!_0x5b9ba0)return null;if(_0x5b9ba0['id']===_0x14945f[_0x0d20('0x2f')]['id']){if(!_0x14945f[_0x0d20('0x5d')][_0x0d20('0x90')]||!_0x14945f[_0x0d20('0x5d')][_0x0d20('0x91')]){throw new db['Sequelize'][(_0x0d20('0x92'))](_0x0d20('0x93'));}if(!_0x5b9ba0[_0x0d20('0x94')](_0x14945f[_0x0d20('0x5d')][_0x0d20('0x90')])){throw new db['Sequelize'][(_0x0d20('0x92'))](_0x0d20('0x95'));}if(_0x14945f[_0x0d20('0x5d')][_0x0d20('0x90')]===_0x14945f[_0x0d20('0x5d')]['newPassword']){throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))](_0x0d20('0x97'));}}else if(_0x14945f[_0x0d20('0x2f')][_0x0d20('0x2d')]===_0x0d20('0x7e')){if(!_0x14945f[_0x0d20('0x5d')]['newPassword']){throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))](_0x0d20('0x98'));}}else if(_0x14945f['user'][_0x0d20('0x2d')]===_0x0d20('0x2f')){if(!_0x14945f[_0x0d20('0x5d')][_0x0d20('0x91')]){throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))](_0x0d20('0x98'));}if(_0x5b9ba0[_0x0d20('0x2d')]!==_0x0d20('0x31')){throw new db[(_0x0d20('0x96'))]['ValidationError'](_0x0d20('0x88'));}}else{throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))]('Unauthorized');}return _0x5b9ba0;})[_0x0d20('0x28')](handleEntityNotFound(_0x5ab86b,null))[_0x0d20('0x28')](function(_0x388881){return db[_0x0d20('0x62')][_0x0d20('0x99')]({'attributes':['id',_0x0d20('0x64'),_0x0d20('0x9a'),_0x0d20('0x9b')]})[_0x0d20('0x28')](function(_0x43c05d){if(_0x43c05d['securePassword'])authService[_0x0d20('0x65')](_0x14945f['body'][_0x0d20('0x91')]);if(!_0x43c05d['enforcePasswordHistory']||!_0x388881[_0x0d20('0x9c')])return _0x388881;authService[_0x0d20('0x9d')](_0x14945f[_0x0d20('0x5d')][_0x0d20('0x91')],_0x388881[_0x0d20('0x9c')],_0x43c05d[_0x0d20('0x9b')]);return _0x388881;})[_0x0d20('0x28')](saveUpdates({'password':_0x14945f[_0x0d20('0x5d')][_0x0d20('0x91')],'passwordResetAt':_0x14945f[_0x0d20('0x2f')]['id']==_0x14945f[_0x0d20('0x54')]['id']?moment():null,'previousPasswords':authService[_0x0d20('0x9e')](_0x14945f[_0x0d20('0x5d')][_0x0d20('0x91')],_0x388881[_0x0d20('0x9c')])},null));})['then'](respondWithResult(_0x5ab86b,null))[_0x0d20('0x53')](handleError(_0x5ab86b,null));};exports[_0x0d20('0x9f')]=function(_0xf81bba,_0x102caf){var _0x3bb6bc=_0xf81bba[_0x0d20('0x5d')][_0x0d20('0xa0')];return db['User'][_0x0d20('0x35')]({'where':{'id':_0xf81bba[_0x0d20('0x54')]['id']},'attributes':['id',_0x0d20('0x37'),'role','online',_0x0d20('0xa1'),'voicePause',_0x0d20('0xa2')]})[_0x0d20('0x28')](handleEntityNotFound(_0x102caf,null))[_0x0d20('0x28')](function(_0x1de218){if(_0x1de218){if(!utils['isValidChannel'](_0x3bb6bc)){throw new db['Sequelize'][(_0x0d20('0x92'))]('Unknown\x20channel');}return _0x1de218[_0x0d20('0xa3')+_[_0x0d20('0xa4')](_0x3bb6bc['toLowerCase']())+'Queues'](_0xf81bba[_0x0d20('0x5d')][_0x0d20('0x61')],{'penalty':_0xf81bba[_0x0d20('0x5d')]['penalty']||0x0})[_0x0d20('0xa5')](function(_0x18ea51){for(var _0x1c6ceb=0x0;_0x1c6ceb<_0xf81bba[_0x0d20('0x5d')][_0x0d20('0x61')][_0x0d20('0x4d')];_0x1c6ceb+=0x1){var _0xff925b={'UserId':Number(_0xf81bba['params']['id'])};_0xff925b[_[_0x0d20('0xa4')](_0x3bb6bc['toLowerCase']())+_0x0d20('0xa6')]=Number(_0xf81bba[_0x0d20('0x5d')][_0x0d20('0x61')][_0x1c6ceb]);socket[_0x0d20('0x29')](_0x0d20('0x2f')+_[_0x0d20('0xa4')](_0x3bb6bc[_0x0d20('0xa7')]())+'Queue:save',_0xff925b);}return _0x18ea51;})[_0x0d20('0x28')](function(){if(_0x3bb6bc===_0x0d20('0xa8')){return db[_0x0d20('0xa9')][_0x0d20('0x8c')]({'where':{'id':_0xf81bba[_0x0d20('0x5d')][_0x0d20('0x61')]||[]},'raw':!![],'attributes':['id',_0x0d20('0x37')]});}})[_0x0d20('0x28')](function(_0x310056){var _0x45c5a5=_0x1de218[_0x0d20('0x2c')]({'plain':!![]});var _0x2f7148=[];if(_0x3bb6bc===_0x0d20('0xa8')&&_0x45c5a5[_0x0d20('0x2d')]===_0x0d20('0x31')&&_0x45c5a5['online']){for(let _0x523601=0x0;_0x523601<_0x310056[_0x0d20('0x4d')];_0x523601+=0x1){_0x2f7148['push']({'membername':_0x45c5a5[_0x0d20('0x37')],'UserId':_0x45c5a5['id'],'queue_name':_0x310056[_0x523601][_0x0d20('0x37')],'VoiceQueueId':_0x310056[_0x523601]['id'],'interface':_[_0x0d20('0x68')](_0x45c5a5['interface'])?util[_0x0d20('0xaa')]('SIP/%s',_0x45c5a5[_0x0d20('0x37')]):_0x45c5a5[_0x0d20('0xa2')],'paused':_0x45c5a5['voicePause']||![],'penalty':_0xf81bba[_0x0d20('0x5d')]['penalty']||0x0});}return Promise[_0x0d20('0x52')](_0x2f7148[_0x0d20('0x3b')](function(_0x546e8){return db[_0x0d20('0xab')][_0x0d20('0xac')](_0x546e8);}));}return _0x1de218;});}})[_0x0d20('0x28')](respondWithStatusCode(_0x102caf,null))[_0x0d20('0x53')](handleError(_0x102caf,null));};exports[_0x0d20('0xad')]=function(_0x40d2df,_0x23bf8a){var _0x40f7c3,_0x37629e;return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x40d2df['params']['id']},'attributes':['id',_0x0d20('0x37'),_0x0d20('0x2d')]})[_0x0d20('0x28')](handleEntityNotFound(_0x23bf8a,null))['then'](function(_0x3ecb61){if(_0x3ecb61){_0x40f7c3=_0x3ecb61;if(!_0x40d2df[_0x0d20('0x58')][_0x0d20('0xa0')]||!utils[_0x0d20('0xae')](_0x40d2df[_0x0d20('0x58')]['channel'])){throw new db[(_0x0d20('0x96'))]['ValidationError'](_0x0d20('0xaf'));}return _0x3ecb61[_0x0d20('0xb0')+_['capitalize'](_0x40d2df[_0x0d20('0x58')][_0x0d20('0xa0')][_0x0d20('0xa7')]())+_0x0d20('0xb1')](_0x40d2df['query'][_0x0d20('0x61')]);}})[_0x0d20('0x28')](function(_0xd2a813){if(_[_0x0d20('0xb2')](_0x40d2df[_0x0d20('0x58')]['ids'])){for(var _0x1b0714=0x0;_0x1b0714<_0x40d2df[_0x0d20('0x58')][_0x0d20('0x61')][_0x0d20('0x4d')];_0x1b0714+=0x1){_0x37629e={'UserId':Number(_0x40d2df[_0x0d20('0x54')]['id'])};_0x37629e[_['capitalize'](_0x40d2df[_0x0d20('0x58')]['channel']['toLowerCase']())+'QueueId']=Number(_0x40d2df[_0x0d20('0x58')][_0x0d20('0x61')][_0x1b0714]);socket[_0x0d20('0x29')](_0x0d20('0x2f')+_[_0x0d20('0xa4')](_0x40d2df[_0x0d20('0x58')][_0x0d20('0xa0')][_0x0d20('0xa7')]())+_0x0d20('0xb3'),_0x37629e);}}else{_0x37629e={'UserId':Number(_0x40d2df['params']['id'])};_0x37629e[_['capitalize'](_0x40d2df[_0x0d20('0x58')][_0x0d20('0xa0')][_0x0d20('0xa7')]())+_0x0d20('0xa6')]=Number(_0x40d2df[_0x0d20('0x58')][_0x0d20('0x61')]);socket['emit'](_0x0d20('0x2f')+_['capitalize'](_0x40d2df[_0x0d20('0x58')]['channel'][_0x0d20('0xa7')]())+_0x0d20('0xb3'),_0x37629e);}return _0xd2a813;})['then'](function(){if(_0x40d2df[_0x0d20('0x58')]['channel']===_0x0d20('0xa8')){return db[_0x0d20('0xab')][_0x0d20('0x2b')]({'where':{'UserId':_0x40d2df[_0x0d20('0x54')]['id'],'VoiceQueueId':_0x40d2df[_0x0d20('0x58')][_0x0d20('0x61')]},'individualHooks':!![]})[_0x0d20('0x28')](function(){return _0x40f7c3;});}return _0x40f7c3;})[_0x0d20('0x28')](respondWithStatusCode(_0x23bf8a,null))[_0x0d20('0x53')](handleError(_0x23bf8a,null));};exports[_0x0d20('0xb4')]=function(_0x19e101,_0x14aa02){_0x19e101[_0x0d20('0x5d')][_0x0d20('0xb5')]=_0x19e101[_0x0d20('0xb6')][_0x0d20('0xb7')];return db['User']['find']({'where':{'id':_0x19e101[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x14aa02,null))[_0x0d20('0x28')](saveUpdates(_0x19e101[_0x0d20('0x5d')],null))[_0x0d20('0x28')](respondWithResult(_0x14aa02,null))[_0x0d20('0x53')](handleError(_0x14aa02,null));};exports[_0x0d20('0xb8')]=function(_0x4d62d4,_0x4fe05b){var _0x3ec0a3=path['join'](config[_0x0d20('0xb9')],_0x0d20('0xba'));return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x4d62d4[_0x0d20('0x54')]['id']},'attributes':['id',_0x0d20('0xb5')],'raw':!![]})[_0x0d20('0x28')](handleEntityNotFound(_0x4fe05b,null))['then'](function(_0x2ae26a){if(_0x2ae26a){if(_[_0x0d20('0x68')](_0x2ae26a[_0x0d20('0xb5')])){return _0x4fe05b[_0x0d20('0xbb')](_0x3ec0a3);}else{if(!fs['existsSync'](path['join'](config[_0x0d20('0xb9')],_0x0d20('0xbc'),_0x2ae26a['userpic']))){return _0x4fe05b[_0x0d20('0xbb')](_0x3ec0a3);}return _0x4fe05b['download'](path[_0x0d20('0xbd')](config[_0x0d20('0xb9')],_0x0d20('0xbc'),_0x2ae26a[_0x0d20('0xb5')]));}}})[_0x0d20('0x53')](handleError(_0x4fe05b,null));};exports[_0x0d20('0xbe')]=function(_0x17f504,_0x1da9e5){return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x17f504[_0x0d20('0x54')]['id']},'attributes':['id']})[_0x0d20('0x28')](handleEntityNotFound(_0x1da9e5,null))[_0x0d20('0x28')](function(_0x560802){var _0x49110a=[];values=_0x560802[_0x0d20('0x4f')];_0x49110a[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x5b'),_0x560802[_0x0d20('0x4f')]));_0x49110a[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x4e'),_0x560802[_0x0d20('0x4f')]));_0x49110a['push'](get_open_tabs('openchannel',_0x560802[_0x0d20('0x4f')]));_0x49110a[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x5c'),_0x560802[_0x0d20('0x4f')]));_0x49110a[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0xbf'),_0x560802[_0x0d20('0x4f')]));_0x49110a[_0x0d20('0x4a')](get_open_tabs(_0x0d20('0x50'),_0x560802[_0x0d20('0x4f')]));return Promise['all'](_0x49110a);})[_0x0d20('0x28')](function(_0x1bbb53){if(_0x1bbb53){var _0x22aba4=_[_0x0d20('0x3b')](values['ChatOpenTabs'],function(_0x35e37c){return{'channel':'CHAT','id':_0x35e37c['id'],'createdAt':_0x35e37c[_0x0d20('0xc0')]};});var _0x20c06d=_['map'](values[_0x0d20('0xc1')],function(_0x26eb76){return{'channel':_0x0d20('0xc2'),'id':_0x26eb76['id'],'createdAt':_0x26eb76[_0x0d20('0xc0')]};});var _0x3ffc43=_['map'](values[_0x0d20('0xc3')],function(_0x20bd44){return{'channel':_0x0d20('0xc4'),'id':_0x20bd44['id'],'createdAt':_0x20bd44[_0x0d20('0xc0')]};});var _0x4f846a=_[_0x0d20('0x3b')](values['MailOpenTabs'],function(_0x188ccd){return{'channel':_0x0d20('0xc5'),'id':_0x188ccd['id'],'createdAt':_0x188ccd['createdAt']};});var _0x28703a=_[_0x0d20('0x3b')](values['SmsOpenTabs'],function(_0x17ce70){return{'channel':_0x0d20('0xc6'),'id':_0x17ce70['id'],'createdAt':_0x17ce70[_0x0d20('0xc0')]};});var _0x43dda7=_[_0x0d20('0x3b')](values[_0x0d20('0xc7')],function(_0x8a95fe){return{'channel':'WHATSAPP','id':_0x8a95fe['id'],'createdAt':_0x8a95fe['createdAt']};});var _0x37fe09=_[_0x0d20('0xc8')](_0x22aba4,_0x20c06d,_0x3ffc43,_0x4f846a,_0x28703a,_0x43dda7);var _0x470f9a={'count':_0x37fe09[_0x0d20('0x4d')],'rows':_0x37fe09};return _0x470f9a;}else return null;})[_0x0d20('0x28')](respondWithResult(_0x1da9e5,null))[_0x0d20('0x53')](handleError(_0x1da9e5,null));};exports[_0x0d20('0xc9')]=function(_0x31b10c,_0x5e6a20){var _0x36567a={};var _0x32bff1={};var _0x3d895a;var _0x456117;return db['User'][_0x0d20('0x99')]({'where':{'id':_0x31b10c[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x5e6a20,null))['then'](function(_0x191634){if(_0x191634){_0x3d895a=_0x191634;_0x32bff1[_0x0d20('0x55')]=_['keys'](db['CmContact']['rawAttributes']);_0x32bff1[_0x0d20('0x58')]=_['keys'](_0x31b10c[_0x0d20('0x58')]);_0x32bff1[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x32bff1[_0x0d20('0x55')],_0x32bff1[_0x0d20('0x58')]);_0x36567a[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x32bff1['model'],qs[_0x0d20('0x59')](_0x31b10c[_0x0d20('0x58')]['fields']));_0x36567a[_0x0d20('0x49')]=_0x36567a[_0x0d20('0x49')]['length']?_0x36567a['attributes']:_0x32bff1[_0x0d20('0x55')];_0x36567a[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x31b10c['query'][_0x0d20('0xcc')]);_0x36567a['where']=qs['filters'](_[_0x0d20('0xcd')](_0x31b10c[_0x0d20('0x58')],_0x32bff1['filters']));if(_0x31b10c[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x36567a[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x36567a[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x36567a[_0x0d20('0x49')],function(_0x5f267c){var _0x29cc2e={};_0x29cc2e[_0x5f267c]={'$like':'%'+_0x31b10c[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x29cc2e;})});}_0x36567a=_['merge']({},_0x36567a,_0x31b10c[_0x0d20('0xce')]);return _0x3d895a['getContacts'](_0x36567a);}})[_0x0d20('0x28')](function(_0x56b07a){if(_0x56b07a){_0x456117=_0x56b07a[_0x0d20('0x4d')];if(_0x31b10c[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0x44'))){_0x36567a[_0x0d20('0x46')]=[{'model':db[_0x0d20('0xd0')],'as':_0x0d20('0xd1'),'required':![]},{'model':db[_0x0d20('0xd2')],'as':'Tags','attributes':['id',_0x0d20('0x37'),_0x0d20('0xd3')],'where':_0x31b10c['query'][_0x0d20('0xd4')]?{'id':_0x31b10c[_0x0d20('0x58')][_0x0d20('0xd4')]}:undefined,'required':_0x31b10c['query'][_0x0d20('0xd4')]?!![]:![]}];}if(!_0x31b10c[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x36567a[_0x0d20('0x22')]=qs['limit'](_0x31b10c[_0x0d20('0x58')]['limit']);_0x36567a[_0x0d20('0x23')]=qs['offset'](_0x31b10c[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x3d895a[_0x0d20('0xc9')](_0x36567a);}})['then'](function(_0x6716e7){if(_0x6716e7){return _0x6716e7?{'count':_0x456117,'rows':_0x6716e7}:null;}})[_0x0d20('0x28')](respondWithResult(_0x5e6a20,null))[_0x0d20('0x53')](handleError(_0x5e6a20,null));};exports[_0x0d20('0xd6')]=function(_0x4e3593,_0x48274c){var _0x169721;var _0x194c9a={};var _0x233ffc;return db[_0x0d20('0x3a')]['findOne']({'where':{'id':_0x4e3593[_0x0d20('0x54')]['id']},'attributes':['id',_0x0d20('0x37'),_0x0d20('0x2d')]})[_0x0d20('0x28')](handleEntityNotFound(_0x48274c,null))[_0x0d20('0x28')](function(_0x10a66d){if(!utils[_0x0d20('0xae')](_0x4e3593[_0x0d20('0x58')][_0x0d20('0xa0')])){throw new db[(_0x0d20('0x96'))]['ValidationError'](_0x0d20('0xaf'));}_0x169721=_0x10a66d;var _0x5d54d4={};_0x5d54d4['model']=_[_0x0d20('0x56')](db[_['capitalize'](_0x4e3593[_0x0d20('0x58')][_0x0d20('0xa0')])+_0x0d20('0xd7')][_0x0d20('0xd8')]);_0x5d54d4[_0x0d20('0x58')]=_['keys'](_0x4e3593[_0x0d20('0x58')]);_0x5d54d4[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x5d54d4['model'],_0x5d54d4[_0x0d20('0x58')]);_0x194c9a['attributes']=_['intersection'](_0x5d54d4[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x4e3593[_0x0d20('0x58')]['fields']));_0x194c9a[_0x0d20('0x49')]=_0x194c9a['attributes'][_0x0d20('0x4d')]?_0x194c9a[_0x0d20('0x49')]:_0x5d54d4[_0x0d20('0x55')];_0x194c9a[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x4e3593['query'][_0x0d20('0xcc')]);_0x194c9a[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x4e3593[_0x0d20('0x58')],_0x5d54d4[_0x0d20('0xca')]));if(_0x4e3593[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x194c9a[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x194c9a[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x194c9a['attributes'],function(_0x16e2fe){var _0x866816={};_0x866816[_0x16e2fe]={'$like':'%'+_0x4e3593[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x866816;})});}_0x194c9a=_['merge']({},_0x194c9a,_0x4e3593[_0x0d20('0xce')]);switch(_0x169721[_0x0d20('0x2d')]){case _0x0d20('0x7e'):return db[_['capitalize'](_0x4e3593[_0x0d20('0x58')][_0x0d20('0xa0')])+_0x0d20('0xd7')]['findAll'](_0x194c9a);case _0x0d20('0x2f'):case _0x0d20('0x31'):return _0x169721[_0x0d20('0x2c')+_[_0x0d20('0xa4')](_0x4e3593['query'][_0x0d20('0xa0')])+'Queues'](_0x194c9a);default:throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))](_0x0d20('0xd9'));}})[_0x0d20('0x28')](function(_0x536d93){_0x233ffc=_0x536d93[_0x0d20('0x4d')];if(!_0x4e3593['query'][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x194c9a['limit']=qs[_0x0d20('0x22')](_0x4e3593[_0x0d20('0x58')][_0x0d20('0x22')]);_0x194c9a['offset']=qs[_0x0d20('0x23')](_0x4e3593[_0x0d20('0x58')][_0x0d20('0x23')]);}switch(_0x169721['role']){case _0x0d20('0x7e'):return db[_[_0x0d20('0xa4')](_0x4e3593[_0x0d20('0x58')][_0x0d20('0xa0')])+'Queue'][_0x0d20('0x8c')](_0x194c9a);case _0x0d20('0x2f'):case _0x0d20('0x31'):return _0x169721[_0x0d20('0x2c')+_['capitalize'](_0x4e3593[_0x0d20('0x58')]['channel'])+_0x0d20('0xb1')](_0x194c9a);}})['then'](function(_0x1fac95){return{'count':_0x233ffc,'rows':_0x1fac95};})[_0x0d20('0x28')](respondWithResult(_0x48274c,null))['catch'](handleError(_0x48274c,null));};exports[_0x0d20('0xda')]=function(_0x5c76b9,_0x4a7c7d){var _0x3833d4={};var _0x9c647e={};var _0x4cf91c;var _0x5c9b79;return db['User'][_0x0d20('0x99')]({'where':{'id':_0x5c76b9[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x4a7c7d,null))[_0x0d20('0x28')](function(_0x69bb3e){if(_0x69bb3e){_0x4cf91c=_0x69bb3e;_0x9c647e[_0x0d20('0x55')]=_['keys'](db['UserVoiceQueueRt'][_0x0d20('0xd8')]);_0x9c647e['query']=_['keys'](_0x5c76b9[_0x0d20('0x58')]);_0x9c647e[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x9c647e['model'],_0x9c647e[_0x0d20('0x58')]);_0x3833d4[_0x0d20('0x49')]=_['intersection'](_0x9c647e[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x5c76b9[_0x0d20('0x58')][_0x0d20('0x59')]));_0x3833d4[_0x0d20('0x49')]=_0x3833d4[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x3833d4[_0x0d20('0x49')]:_0x9c647e[_0x0d20('0x55')];_0x3833d4[_0x0d20('0xcb')]=qs['sort'](_0x5c76b9[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x3833d4['where']=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x5c76b9[_0x0d20('0x58')],_0x9c647e[_0x0d20('0xca')]));if(_0x5c76b9[_0x0d20('0x58')]['filter']){_0x3833d4[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x3833d4[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x3833d4[_0x0d20('0x49')],function(_0x1fd4f6){var _0x126b6b={};_0x126b6b[_0x1fd4f6]={'$like':'%'+_0x5c76b9[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x126b6b;})});}_0x3833d4=_[_0x0d20('0x5a')]({},_0x3833d4,_0x5c76b9[_0x0d20('0xce')]);return _0x4cf91c[_0x0d20('0xda')](_0x3833d4);}})[_0x0d20('0x28')](function(_0x52ebe8){if(_0x52ebe8){_0x5c9b79=_0x52ebe8['length'];if(!_0x5c76b9[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x3833d4[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x5c76b9[_0x0d20('0x58')]['limit']);_0x3833d4[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x5c76b9[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x4cf91c[_0x0d20('0xda')](_0x3833d4);}})['then'](function(_0x2adccc){if(_0x2adccc){return _0x2adccc?{'count':_0x5c9b79,'rows':_0x2adccc}:null;}})[_0x0d20('0x28')](respondWithResult(_0x4a7c7d,null))[_0x0d20('0x53')](handleError(_0x4a7c7d,null));};exports[_0x0d20('0xdb')]=function(_0x1e4ba0,_0x26fc7e){var _0x73d2ed={};var _0x5b5181={};var _0x235e39;var _0x465981;return db['User'][_0x0d20('0x99')]({'where':{'id':_0x1e4ba0[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x26fc7e,null))['then'](function(_0x45ca19){if(_0x45ca19){_0x235e39=_0x45ca19;_0x5b5181['model']=_['keys'](db[_0x0d20('0xdc')][_0x0d20('0xd8')]);_0x5b5181[_0x0d20('0x58')]=_['keys'](_0x1e4ba0['query']);_0x5b5181[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x5b5181['model'],_0x5b5181[_0x0d20('0x58')]);_0x73d2ed['attributes']=_[_0x0d20('0x57')](_0x5b5181[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x1e4ba0[_0x0d20('0x58')][_0x0d20('0x59')]));_0x73d2ed[_0x0d20('0x49')]=_0x73d2ed[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x73d2ed[_0x0d20('0x49')]:_0x5b5181[_0x0d20('0x55')];_0x73d2ed[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x1e4ba0[_0x0d20('0x58')]['sort']);_0x73d2ed[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x1e4ba0[_0x0d20('0x58')],_0x5b5181[_0x0d20('0xca')]));if(_0x1e4ba0[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x73d2ed[_0x0d20('0x43')]=_['merge'](_0x73d2ed[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x73d2ed['attributes'],function(_0x365a68){var _0x420eb1={};_0x420eb1[_0x365a68]={'$like':'%'+_0x1e4ba0[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x420eb1;})});}_0x73d2ed=_[_0x0d20('0x5a')]({},_0x73d2ed,_0x1e4ba0[_0x0d20('0xce')]);return _0x235e39[_0x0d20('0xdb')](_0x73d2ed);}})[_0x0d20('0x28')](function(_0x4cd787){if(_0x4cd787){_0x465981=_0x4cd787[_0x0d20('0x4d')];if(!_0x1e4ba0[_0x0d20('0x58')]['hasOwnProperty'](_0x0d20('0xd5'))){_0x73d2ed[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x1e4ba0[_0x0d20('0x58')][_0x0d20('0x22')]);_0x73d2ed[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x1e4ba0['query'][_0x0d20('0x23')]);}return _0x235e39[_0x0d20('0xdb')](_0x73d2ed);}})['then'](function(_0x276aef){if(_0x276aef){return _0x276aef?{'count':_0x465981,'rows':_0x276aef}:null;}})[_0x0d20('0x28')](respondWithResult(_0x26fc7e,null))['catch'](handleError(_0x26fc7e,null));};exports[_0x0d20('0xdd')]=function(_0x12110a,_0x2b369c){var _0x8dee2b={'raw':!![],'where':{}};var _0x522007={};var _0x594419={'count':0x0,'rows':[]};return db[_0x0d20('0x3a')]['findOne']({'where':{'id':_0x12110a[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x2b369c,null))['then'](function(_0x1ad2f9){if(_0x1ad2f9){_0x522007[_0x0d20('0x55')]=_['keys'](db[_0x0d20('0xde')][_0x0d20('0xd8')]);_0x522007[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x12110a[_0x0d20('0x58')]);_0x522007[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x522007[_0x0d20('0x55')],_0x522007[_0x0d20('0x58')]);_0x8dee2b[_0x0d20('0x49')]=_['intersection'](_0x522007['model'],qs[_0x0d20('0x59')](_0x12110a[_0x0d20('0x58')][_0x0d20('0x59')]));_0x8dee2b[_0x0d20('0x49')]=_0x8dee2b[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x8dee2b['attributes']:_0x522007[_0x0d20('0x55')];if(!_0x12110a[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x8dee2b[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x12110a['query'][_0x0d20('0x22')]);_0x8dee2b[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x12110a[_0x0d20('0x58')][_0x0d20('0x23')]);}_0x8dee2b[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x12110a[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x8dee2b['where']=qs['filters'](_['pick'](_0x12110a[_0x0d20('0x58')],_0x522007[_0x0d20('0xca')]));_0x8dee2b[_0x0d20('0x43')]['UserId']=_0x1ad2f9['id'];if(_0x12110a[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x8dee2b[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x8dee2b[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x8dee2b['attributes'],function(_0x2b79de){var _0x136bf5={};_0x136bf5[_0x2b79de]={'$like':'%'+_0x12110a[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x136bf5;})});}_0x8dee2b=_[_0x0d20('0x5a')]({},_0x8dee2b,_0x12110a['options']);return db[_0x0d20('0xde')][_0x0d20('0x24')]({'where':_0x8dee2b['where']})[_0x0d20('0x28')](function(_0x1caa77){_0x594419['count']=_0x1caa77;if(_0x12110a['query'][_0x0d20('0x44')]){_0x8dee2b['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x0d20('0x8c')](_0x8dee2b);})[_0x0d20('0x28')](function(_0x240ace){_0x594419['rows']=_0x240ace;return _0x594419;});}})['then'](respondWithFilteredResult(_0x2b369c,_0x8dee2b))['catch'](handleError(_0x2b369c,null));};exports[_0x0d20('0xdf')]=function(_0x7b1b8e,_0x2d063b){var _0x4a3fad={'raw':!![],'where':{}};var _0x4213c5={};var _0x171e96={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x7b1b8e['params']['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x2d063b,null))[_0x0d20('0x28')](function(_0x56e7b3){if(_0x56e7b3){_0x4213c5[_0x0d20('0x55')]=_['keys'](db[_0x0d20('0xe0')][_0x0d20('0xd8')]);_0x4213c5[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x7b1b8e[_0x0d20('0x58')]);_0x4213c5[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x4213c5[_0x0d20('0x55')],_0x4213c5[_0x0d20('0x58')]);_0x4a3fad[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x4213c5[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0x59')]));_0x4a3fad['attributes']=_0x4a3fad[_0x0d20('0x49')]['length']?_0x4a3fad[_0x0d20('0x49')]:_0x4213c5[_0x0d20('0x55')];if(!_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x4a3fad['limit']=qs['limit'](_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0x22')]);_0x4a3fad[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0x23')]);}_0x4a3fad[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x4a3fad[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x7b1b8e[_0x0d20('0x58')],_0x4213c5['filters']));_0x4a3fad[_0x0d20('0x43')]['UserId']=_0x56e7b3['id'];if(_0x7b1b8e['query'][_0x0d20('0x3f')]){_0x4a3fad[_0x0d20('0x43')]=_['merge'](_0x4a3fad[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x4a3fad[_0x0d20('0x49')],function(_0x5b25ed){var _0x20d48e={};_0x20d48e[_0x5b25ed]={'$like':'%'+_0x7b1b8e[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x20d48e;})});}_0x4a3fad=_['merge']({},_0x4a3fad,_0x7b1b8e[_0x0d20('0xce')]);return db['ScreenRecording']['count']({'where':_0x4a3fad['where']})[_0x0d20('0x28')](function(_0x9a203a){_0x171e96['count']=_0x9a203a;if(_0x7b1b8e[_0x0d20('0x58')]['includeAll']){_0x4a3fad['include']=[{'all':!![]}];}return db[_0x0d20('0xe0')][_0x0d20('0x8c')](_0x4a3fad);})[_0x0d20('0x28')](function(_0x508edd){_0x171e96[_0x0d20('0x4b')]=_0x508edd;return _0x171e96;});}})[_0x0d20('0x28')](respondWithFilteredResult(_0x2d063b,_0x4a3fad))[_0x0d20('0x53')](handleError(_0x2d063b,null));};exports[_0x0d20('0xe1')]=function(_0x5b7eb6,_0x45ab28){var _0x43bcbd={};var _0x383ac0={};var _0x30b31d;var _0x4f447a;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x5b7eb6[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x45ab28,null))['then'](function(_0x4293da){if(_0x4293da){_0x30b31d=_0x4293da;_0x383ac0[_0x0d20('0x55')]=_[_0x0d20('0x56')](db[_0x0d20('0xe2')][_0x0d20('0xd8')]);_0x383ac0[_0x0d20('0x58')]=_['keys'](_0x5b7eb6[_0x0d20('0x58')]);_0x383ac0['filters']=_[_0x0d20('0x57')](_0x383ac0[_0x0d20('0x55')],_0x383ac0[_0x0d20('0x58')]);_0x43bcbd[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x383ac0['model'],qs[_0x0d20('0x59')](_0x5b7eb6[_0x0d20('0x58')][_0x0d20('0x59')]));_0x43bcbd[_0x0d20('0x49')]=_0x43bcbd[_0x0d20('0x49')]['length']?_0x43bcbd[_0x0d20('0x49')]:_0x383ac0[_0x0d20('0x55')];_0x43bcbd['order']=qs[_0x0d20('0xcc')](_0x5b7eb6[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x43bcbd['where']=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x5b7eb6[_0x0d20('0x58')],_0x383ac0[_0x0d20('0xca')]));if(_0x5b7eb6[_0x0d20('0x58')]['filter']){_0x43bcbd[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x43bcbd[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x43bcbd[_0x0d20('0x49')],function(_0x41deb8){var _0x18d080={};_0x18d080[_0x41deb8]={'$like':'%'+_0x5b7eb6['query'][_0x0d20('0x3f')]+'%'};return _0x18d080;})});}_0x43bcbd=_['merge']({},_0x43bcbd,_0x5b7eb6[_0x0d20('0xce')]);return _0x30b31d[_0x0d20('0xe1')](_0x43bcbd);}})[_0x0d20('0x28')](function(_0x47531a){if(_0x47531a){_0x4f447a=_0x47531a['length'];if(!_0x5b7eb6[_0x0d20('0x58')]['hasOwnProperty'](_0x0d20('0xd5'))){_0x43bcbd['limit']=qs[_0x0d20('0x22')](_0x5b7eb6[_0x0d20('0x58')][_0x0d20('0x22')]);_0x43bcbd[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x5b7eb6[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x30b31d['getChatInteractions'](_0x43bcbd);}})['then'](function(_0x2d4f9d){if(_0x2d4f9d){return _0x2d4f9d?{'count':_0x4f447a,'rows':_0x2d4f9d}:null;}})[_0x0d20('0x28')](respondWithResult(_0x45ab28,null))[_0x0d20('0x53')](handleError(_0x45ab28,null));};exports[_0x0d20('0xe3')]=function(_0x2e09ae,_0x590b19){var _0x528c8f={};var _0x62f4cf={};var _0x3f23ee;var _0x36c7a5;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x2e09ae[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x590b19,null))[_0x0d20('0x28')](function(_0x37d8f0){if(_0x37d8f0){_0x3f23ee=_0x37d8f0;_0x62f4cf['model']=_[_0x0d20('0x56')](db[_0x0d20('0xe4')][_0x0d20('0xd8')]);_0x62f4cf[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x2e09ae[_0x0d20('0x58')]);_0x62f4cf[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x62f4cf['model'],_0x62f4cf[_0x0d20('0x58')]);_0x528c8f[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x62f4cf[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x2e09ae[_0x0d20('0x58')][_0x0d20('0x59')]));_0x528c8f[_0x0d20('0x49')]=_0x528c8f[_0x0d20('0x49')]['length']?_0x528c8f[_0x0d20('0x49')]:_0x62f4cf[_0x0d20('0x55')];_0x528c8f[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x2e09ae['query'][_0x0d20('0xcc')]);_0x528c8f[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x2e09ae[_0x0d20('0x58')],_0x62f4cf[_0x0d20('0xca')]));if(_0x2e09ae[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x528c8f[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x528c8f[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x528c8f[_0x0d20('0x49')],function(_0xb014f8){var _0x46d594={};_0x46d594[_0xb014f8]={'$like':'%'+_0x2e09ae[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x46d594;})});}_0x528c8f=_[_0x0d20('0x5a')]({},_0x528c8f,_0x2e09ae['options']);return _0x3f23ee[_0x0d20('0xe3')](_0x528c8f);}})[_0x0d20('0x28')](function(_0x555767){if(_0x555767){_0x36c7a5=_0x555767[_0x0d20('0x4d')];if(!_0x2e09ae['query'][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x528c8f[_0x0d20('0x22')]=qs['limit'](_0x2e09ae['query'][_0x0d20('0x22')]);_0x528c8f[_0x0d20('0x23')]=qs['offset'](_0x2e09ae[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x3f23ee[_0x0d20('0xe3')](_0x528c8f);}})[_0x0d20('0x28')](function(_0x4c7115){if(_0x4c7115){return _0x4c7115?{'count':_0x36c7a5,'rows':_0x4c7115}:null;}})[_0x0d20('0x28')](respondWithResult(_0x590b19,null))[_0x0d20('0x53')](handleError(_0x590b19,null));};exports[_0x0d20('0xe5')]=function(_0x2fceb0,_0x58d9bb){var _0x16f485={'raw':!![],'where':{}};var _0x504e9a={};var _0x327179={'count':0x0,'rows':[]};return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x2fceb0[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x58d9bb,null))[_0x0d20('0x28')](function(_0x2533e2){if(_0x2533e2){_0x504e9a[_0x0d20('0x55')]=_['keys'](db[_0x0d20('0xe6')][_0x0d20('0xd8')]);_0x504e9a['query']=_[_0x0d20('0x56')](_0x2fceb0[_0x0d20('0x58')]);_0x504e9a[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x504e9a[_0x0d20('0x55')],_0x504e9a[_0x0d20('0x58')]);_0x16f485['attributes']=_['intersection'](_0x504e9a[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x2fceb0[_0x0d20('0x58')]['fields']));_0x16f485[_0x0d20('0x49')]=_0x16f485[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x16f485['attributes']:_0x504e9a[_0x0d20('0x55')];if(!_0x2fceb0[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x16f485[_0x0d20('0x22')]=qs['limit'](_0x2fceb0[_0x0d20('0x58')][_0x0d20('0x22')]);_0x16f485[_0x0d20('0x23')]=qs[_0x0d20('0x23')](_0x2fceb0[_0x0d20('0x58')][_0x0d20('0x23')]);}_0x16f485[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x2fceb0[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x16f485[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x2fceb0[_0x0d20('0x58')],_0x504e9a[_0x0d20('0xca')]));_0x16f485[_0x0d20('0x43')][_0x0d20('0xe7')]=_0x2533e2['id'];if(_0x2fceb0['query'][_0x0d20('0x3f')]){_0x16f485[_0x0d20('0x43')]=_['merge'](_0x16f485[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x16f485[_0x0d20('0x49')],function(_0x41fc1c){var _0x39b3a5={};_0x39b3a5[_0x41fc1c]={'$like':'%'+_0x2fceb0[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x39b3a5;})});}_0x16f485=_[_0x0d20('0x5a')]({},_0x16f485,_0x2fceb0[_0x0d20('0xce')]);return db['MailInteraction'][_0x0d20('0x24')]({'where':_0x16f485[_0x0d20('0x43')]})[_0x0d20('0x28')](function(_0x416859){_0x327179[_0x0d20('0x24')]=_0x416859;if(_0x2fceb0['query'][_0x0d20('0x44')]){_0x16f485['include']=[{'all':!![]}];}return db[_0x0d20('0xe6')][_0x0d20('0x8c')](_0x16f485);})[_0x0d20('0x28')](function(_0x2c930d){_0x327179[_0x0d20('0x4b')]=_0x2c930d;return _0x327179;});}})['then'](respondWithFilteredResult(_0x58d9bb,_0x16f485))[_0x0d20('0x53')](handleError(_0x58d9bb,null));};exports[_0x0d20('0xe8')]=function(_0x100a09,_0x4d1c51){var _0x1457aa={};var _0xd96518={};var _0x2c7344;var _0x27c9a4;return db['User'][_0x0d20('0x99')]({'where':{'id':_0x100a09[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x4d1c51,null))[_0x0d20('0x28')](function(_0x425ba7){if(_0x425ba7){_0x2c7344=_0x425ba7;_0xd96518[_0x0d20('0x55')]=_['keys'](db[_0x0d20('0xe9')][_0x0d20('0xd8')]);_0xd96518[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x100a09[_0x0d20('0x58')]);_0xd96518['filters']=_[_0x0d20('0x57')](_0xd96518[_0x0d20('0x55')],_0xd96518[_0x0d20('0x58')]);_0x1457aa[_0x0d20('0x49')]=_['intersection'](_0xd96518[_0x0d20('0x55')],qs['fields'](_0x100a09[_0x0d20('0x58')][_0x0d20('0x59')]));_0x1457aa['attributes']=_0x1457aa[_0x0d20('0x49')]['length']?_0x1457aa[_0x0d20('0x49')]:_0xd96518['model'];_0x1457aa[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x100a09['query'][_0x0d20('0xcc')]);_0x1457aa[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x100a09[_0x0d20('0x58')],_0xd96518[_0x0d20('0xca')]));if(_0x100a09[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x1457aa['where']=_['merge'](_0x1457aa['where'],{'$or':_[_0x0d20('0x3b')](_0x1457aa['attributes'],function(_0x56a20e){var _0x52fcdc={};_0x52fcdc[_0x56a20e]={'$like':'%'+_0x100a09[_0x0d20('0x58')]['filter']+'%'};return _0x52fcdc;})});}_0x1457aa=_[_0x0d20('0x5a')]({},_0x1457aa,_0x100a09[_0x0d20('0xce')]);return _0x2c7344['getSmsInteractions'](_0x1457aa);}})[_0x0d20('0x28')](function(_0x4a84e0){if(_0x4a84e0){_0x27c9a4=_0x4a84e0['length'];if(!_0x100a09['query']['hasOwnProperty'](_0x0d20('0xd5'))){_0x1457aa['limit']=qs[_0x0d20('0x22')](_0x100a09[_0x0d20('0x58')]['limit']);_0x1457aa[_0x0d20('0x23')]=qs['offset'](_0x100a09['query'][_0x0d20('0x23')]);}return _0x2c7344[_0x0d20('0xe8')](_0x1457aa);}})[_0x0d20('0x28')](function(_0x192a66){if(_0x192a66){return _0x192a66?{'count':_0x27c9a4,'rows':_0x192a66}:null;}})['then'](respondWithResult(_0x4d1c51,null))[_0x0d20('0x53')](handleError(_0x4d1c51,null));};exports[_0x0d20('0xea')]=function(_0x247eac,_0x3cf4c9){var _0x3c9409={};var _0x20ae0e={};var _0x5514da;var _0x4cb954;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x247eac[_0x0d20('0x54')]['id']}})['then'](handleEntityNotFound(_0x3cf4c9,null))['then'](function(_0x1a7ad4){if(_0x1a7ad4){_0x5514da=_0x1a7ad4;_0x20ae0e[_0x0d20('0x55')]=_[_0x0d20('0x56')](db['FaxInteraction'][_0x0d20('0xd8')]);_0x20ae0e['query']=_[_0x0d20('0x56')](_0x247eac[_0x0d20('0x58')]);_0x20ae0e[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x20ae0e['model'],_0x20ae0e[_0x0d20('0x58')]);_0x3c9409[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x20ae0e[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x247eac[_0x0d20('0x58')][_0x0d20('0x59')]));_0x3c9409['attributes']=_0x3c9409['attributes'][_0x0d20('0x4d')]?_0x3c9409[_0x0d20('0x49')]:_0x20ae0e['model'];_0x3c9409[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x247eac[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x3c9409[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x247eac[_0x0d20('0x58')],_0x20ae0e[_0x0d20('0xca')]));if(_0x247eac[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x3c9409[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x3c9409[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x3c9409['attributes'],function(_0x25fd34){var _0x9e5294={};_0x9e5294[_0x25fd34]={'$like':'%'+_0x247eac[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x9e5294;})});}_0x3c9409=_[_0x0d20('0x5a')]({},_0x3c9409,_0x247eac[_0x0d20('0xce')]);return _0x5514da[_0x0d20('0xea')](_0x3c9409);}})[_0x0d20('0x28')](function(_0x2f90ac){if(_0x2f90ac){_0x4cb954=_0x2f90ac[_0x0d20('0x4d')];if(!_0x247eac[_0x0d20('0x58')]['hasOwnProperty'](_0x0d20('0xd5'))){_0x3c9409[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x247eac['query']['limit']);_0x3c9409[_0x0d20('0x23')]=qs['offset'](_0x247eac[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x5514da[_0x0d20('0xea')](_0x3c9409);}})[_0x0d20('0x28')](function(_0x246052){if(_0x246052){return _0x246052?{'count':_0x4cb954,'rows':_0x246052}:null;}})['then'](respondWithResult(_0x3cf4c9,null))[_0x0d20('0x53')](handleError(_0x3cf4c9,null));};exports[_0x0d20('0xeb')]=function(_0x47c6cb,_0x18ebaf){var _0x1bb60c={};var _0x294ede={};var _0x56330c;var _0x5094f2;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x47c6cb[_0x0d20('0x54')]['id']}})['then'](handleEntityNotFound(_0x18ebaf,null))[_0x0d20('0x28')](function(_0x38529a){if(_0x38529a){_0x56330c=_0x38529a;_0x294ede[_0x0d20('0x55')]=_[_0x0d20('0x56')](db['WhatsappInteraction'][_0x0d20('0xd8')]);_0x294ede['query']=_[_0x0d20('0x56')](_0x47c6cb[_0x0d20('0x58')]);_0x294ede[_0x0d20('0xca')]=_['intersection'](_0x294ede[_0x0d20('0x55')],_0x294ede[_0x0d20('0x58')]);_0x1bb60c[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x294ede[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x47c6cb[_0x0d20('0x58')][_0x0d20('0x59')]));_0x1bb60c[_0x0d20('0x49')]=_0x1bb60c['attributes'][_0x0d20('0x4d')]?_0x1bb60c['attributes']:_0x294ede[_0x0d20('0x55')];_0x1bb60c[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x47c6cb[_0x0d20('0x58')]['sort']);_0x1bb60c[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x47c6cb[_0x0d20('0x58')],_0x294ede[_0x0d20('0xca')]));if(_0x47c6cb[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x1bb60c[_0x0d20('0x43')]=_['merge'](_0x1bb60c[_0x0d20('0x43')],{'$or':_['map'](_0x1bb60c[_0x0d20('0x49')],function(_0x39e7d5){var _0x39b9e4={};_0x39b9e4[_0x39e7d5]={'$like':'%'+_0x47c6cb[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x39b9e4;})});}_0x1bb60c=_[_0x0d20('0x5a')]({},_0x1bb60c,_0x47c6cb[_0x0d20('0xce')]);return _0x56330c[_0x0d20('0xeb')](_0x1bb60c);}})[_0x0d20('0x28')](function(_0x33fb5a){if(_0x33fb5a){_0x5094f2=_0x33fb5a[_0x0d20('0x4d')];if(!_0x47c6cb[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x1bb60c[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x47c6cb['query'][_0x0d20('0x22')]);_0x1bb60c['offset']=qs['offset'](_0x47c6cb[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x56330c[_0x0d20('0xeb')](_0x1bb60c);}})[_0x0d20('0x28')](function(_0x30fdce){if(_0x30fdce){return _0x30fdce?{'count':_0x5094f2,'rows':_0x30fdce}:null;}})[_0x0d20('0x28')](respondWithResult(_0x18ebaf,null))[_0x0d20('0x53')](handleError(_0x18ebaf,null));};exports[_0x0d20('0xec')]=function(_0x5c73ec,_0x59ef77,_0xa739b2){var _0x8fd6a9;var _0x4691b2;var _0x42d124;var _0x45afb0=!_[_0x0d20('0x68')](_0x5c73ec[_0x0d20('0x54')]['id'])?_0x5c73ec[_0x0d20('0x54')]['id']:!_[_0x0d20('0x68')](_0x5c73ec[_0x0d20('0x2f')]['id'])?_0x5c73ec['user']['id']:null;return db[_0x0d20('0x3a')]['find']({'where':{'id':_0x45afb0,'role':{'$or':['admin',_0x0d20('0x2f'),'agent']}},'attributes':['id',_0x0d20('0x37'),'phone','mobile',_0x0d20('0x2d'),_0x0d20('0x67'),_0x0d20('0xa1')]})[_0x0d20('0x28')](function(_0xb905f){if(_0xb905f){if(_0xb905f[_0x0d20('0x2d')]===_0x0d20('0x31')){_0x8fd6a9=_0xb905f;if(_0x5c73ec[_0x0d20('0x5d')][_0x0d20('0xa2')]){_0x42d124=util[_0x0d20('0xaa')](_0x0d20('0xed'),_0x8fd6a9[_0x5c73ec[_0x0d20('0x5d')][_0x0d20('0xa2')]]);}else if(_0x5c73ec[_0x0d20('0x5d')][_0x0d20('0xee')]){_0x42d124=util[_0x0d20('0xaa')](_0x0d20('0xef'),_0x5c73ec[_0x0d20('0x5d')]['intrf']);}else{_0x42d124=util[_0x0d20('0xaa')]('SIP/%s',_0x8fd6a9[_0x0d20('0x37')]);}socket['to'](util['format']('user:%s',_0x8fd6a9[_0x0d20('0x37')]))[_0x0d20('0x29')]('user:forcelogout',{'user':{'id':_0x8fd6a9['id'],'name':_0x8fd6a9[_0x0d20('0x37')]},'ip':_0x5c73ec['headers'][_0x0d20('0xf0')]||_0x5c73ec['connection']['remoteAddress']||_0x5c73ec[_0x0d20('0xf1')][_0x0d20('0xf2')]||_0x5c73ec[_0x0d20('0xf3')]['socket']['remoteAddress']});return db[_0x0d20('0xab')][_0x0d20('0x2b')]({'where':{'membername':_0x8fd6a9[_0x0d20('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x0d20('0x96'))][(_0x0d20('0x92'))](_0x0d20('0xf4'));}})[_0x0d20('0x28')](function(){if(_0x8fd6a9){return _0x8fd6a9[_0x0d20('0xf5')]({'raw':!![]});}})['then'](function(_0x17a6ed){if(_0x8fd6a9){if(_0x17a6ed){_0x4691b2=_0x17a6ed;if(_0x4691b2['length']){var _0x53d719=_0x4691b2[_0x0d20('0x3b')](function(_0x1ee608){var _0x5f066e={'membername':_0x8fd6a9[_0x0d20('0x37')],'UserId':_0x8fd6a9['id'],'queue_name':_0x1ee608[_0x0d20('0x37')],'VoiceQueueId':_0x1ee608['id'],'interface':_0x42d124,'paused':_0x8fd6a9['loginInPause']||![],'penalty':_0x1ee608[_0x0d20('0xf6')]||0x0};return db[_0x0d20('0xab')][_0x0d20('0xac')](_0x5f066e);});return Promise[_0x0d20('0x52')](_0x53d719);}}}})[_0x0d20('0x28')](function(){if(_0x8fd6a9){return db[_0x0d20('0xf7')][_0x0d20('0x8c')]({'where':{'membername':_0x8fd6a9['name'],'exitAt':null}});}})['then'](function(_0x2baae5){if(_0x8fd6a9){var _0x5cdc51=[];_0x2baae5[_0x0d20('0xf8')](function(_0x28da28){_0x5cdc51[_0x0d20('0x4a')](_0x28da28[_0x0d20('0x27')]({'exitAt':moment()['format'](_0x0d20('0xf9'))}));});return Promise[_0x0d20('0x52')](_0x5cdc51);}})[_0x0d20('0x28')](function(){if(_0x8fd6a9){var _0x2851ca=[];var _0x44ac2c=[];var _0x285b2d=utils[_0x0d20('0xfa')]();var _0x3a7208={'membername':_0x8fd6a9[_0x0d20('0x37')],'interface':_0x42d124,'enterAt':moment()[_0x0d20('0xaa')](_0x0d20('0xf9')),'role':_0x8fd6a9[_0x0d20('0x2d')],'internal':_0x8fd6a9[_0x0d20('0x67')]};_0x285b2d[_0x0d20('0xf8')](function(_0xa52013){_0x2851ca[_0x0d20('0x4a')](_[_0x0d20('0x5a')]({'channel':_0xa52013,'type':_0x0d20('0xfb'),'data1':_0x5c73ec[_0x0d20('0x5d')][_0x0d20('0xfc')],'data2':_0x42d124},_0x3a7208));if(_0x8fd6a9['loginInPause']){_0x44ac2c['push'](_[_0x0d20('0x5a')]({'channel':_0xa52013,'type':_0x0d20('0xfd'),'data1':'LOGININPAUSE'},_0x3a7208));}});return db[_0x0d20('0xf7')][_0x0d20('0x87')](_0x2851ca['concat'](_0x44ac2c),{'individualHooks':!![]});}})['then'](function(){if(_0x8fd6a9){return _0x8fd6a9[_0x0d20('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0x0d20('0xf9')),'voicePause':_0x8fd6a9['loginInPause']||![],'mailPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'chatPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'faxPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'smsPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'openchannelPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'whatsappPause':_0x8fd6a9[_0x0d20('0xa1')]||![],'pauseType':_0x8fd6a9['loginInPause']?_0x0d20('0xfe'):null,'interface':_0x42d124,'lastPauseAt':moment()[_0x0d20('0xaa')](_0x0d20('0xf9'))});}})['then'](function(_0x533448){if(_0x5c73ec['isMiddleware']){return _0xa739b2();}else{return Promise[_0x0d20('0xff')](_0x533448)[_0x0d20('0x28')](respondWithResult(_0x59ef77,null));}})[_0x0d20('0x53')](handleError(_0x59ef77,null));};exports[_0x0d20('0x100')]=function(_0x1d8a07,_0x436a49){var _0x13e790;return db[_0x0d20('0x3a')][_0x0d20('0x35')]({'where':{'id':_0x1d8a07['params']['id'],'role':'agent'},'attributes':['id','name','role']})[_0x0d20('0x28')](handleEntityNotFound(_0x436a49,null))[_0x0d20('0x28')](function(_0x3d0cc2){if(_0x3d0cc2){_0x13e790=_0x3d0cc2;return db[_0x0d20('0xab')][_0x0d20('0x2b')]({'where':{'membername':_0x13e790[_0x0d20('0x37')]},'individualHooks':!![]});}})[_0x0d20('0x28')](function(){return db[_0x0d20('0xf7')]['findAll']({'where':{'membername':_0x13e790['name'],'exitAt':null}});})[_0x0d20('0x28')](function(_0x153e47){var _0x3cc2f4=[];_0x153e47[_0x0d20('0xf8')](function(_0x2d739d){_0x3cc2f4['push'](_0x2d739d[_0x0d20('0x27')]({'exitAt':moment()['format'](_0x0d20('0xf9'))}));});return Promise[_0x0d20('0x52')](_0x3cc2f4);})['then'](function(){return _0x13e790[_0x0d20('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0d20('0x28')](respondWithResult(_0x436a49,null))[_0x0d20('0x53')](handleError(_0x436a49,null));};exports[_0x0d20('0x101')]=function(_0x45fa82,_0xb15d9a){var _0x29391f;return db[_0x0d20('0xab')][_0x0d20('0x27')]({'paused':0x1},{'where':{'UserId':_0x45fa82['params']['id']},'individualHooks':!![]})[_0x0d20('0x28')](function(){return db[_0x0d20('0x3a')]['find']({'where':{'id':_0x45fa82[_0x0d20('0x54')]['id'],'role':_0x0d20('0x31')},'attributes':['id',_0x0d20('0x37'),_0x0d20('0x2d'),'internal',_0x0d20('0xa2'),_0x0d20('0x102')]});})[_0x0d20('0x28')](handleEntityNotFound(_0xb15d9a,null))[_0x0d20('0x28')](function(_0x1e78b7){if(_0x1e78b7){_0x29391f=_0x1e78b7;return respondWithRpcPromise(_0x0d20('0x103'),_0x0d20('0x101'),{'id':_0x29391f['id'],'name':_0x29391f[_0x0d20('0x37')],'pause':!![]});}})[_0x0d20('0x28')](function(){if(_0x29391f){return db[_0x0d20('0xf7')][_0x0d20('0x8c')]({'where':{'membername':_0x29391f[_0x0d20('0x37')],'type':'PAUSE','exitAt':null}});}})[_0x0d20('0x28')](function(_0x128c29){if(_0x128c29[_0x0d20('0x4d')]){var _0x3ca6d3=moment()[_0x0d20('0xaa')](_0x0d20('0xf9'));for(var _0x53bdb0=0x0,_0x75c144=_0x128c29[_0x0d20('0x4d')];_0x53bdb0<_0x75c144;_0x53bdb0++){_0x128c29[_0x53bdb0][_0x0d20('0x104')]({'exitAt':_0x3ca6d3});}}})['then'](function(){var _0x267661=[];var _0x4e5be4=utils[_0x0d20('0xfa')]();_0x4e5be4[_0x0d20('0xf8')](function(_0x172a34){_0x267661['push']({'channel':_0x172a34,'membername':_0x29391f['name'],'interface':_[_0x0d20('0x68')](_0x29391f[_0x0d20('0xa2')])?util[_0x0d20('0xaa')](_0x0d20('0xef'),_0x29391f[_0x0d20('0x37')]):_0x29391f['interface'],'type':_0x0d20('0xfd'),'enterAt':moment()[_0x0d20('0xaa')](_0x0d20('0xf9')),'data1':_0x45fa82['body'][_0x0d20('0x3d')]||_0x0d20('0x105'),'role':_0x29391f[_0x0d20('0x2d')],'internal':_0x29391f['internal']});});return db['MemberReport'][_0x0d20('0x87')](_0x267661,{'individualHooks':!![]});})[_0x0d20('0x28')](function(){return _0x29391f[_0x0d20('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x45fa82[_0x0d20('0x5d')][_0x0d20('0x3d')]||_0x0d20('0x105'),'lastPauseAt':moment()[_0x0d20('0xaa')](_0x0d20('0xf9'))});})[_0x0d20('0x28')](respondWithResult(_0xb15d9a,null))['catch'](handleError(_0xb15d9a,null));};exports[_0x0d20('0x106')]=function(_0x2dc364,_0x326343){if(_0x2dc364[_0x0d20('0x5d')][_0x0d20('0xa0')]&&!utils[_0x0d20('0xae')](_0x2dc364[_0x0d20('0x5d')][_0x0d20('0xa0')])){throw new APIBadRequestError(util['format'](_0x0d20('0x107'),_0x2dc364[_0x0d20('0x5d')][_0x0d20('0xa0')]));}return db[_0x0d20('0x3a')]['find']({'where':{'id':_0x2dc364[_0x0d20('0x54')]['id']},'attributes':['id',_0x0d20('0x37'),_0x0d20('0x2d'),_0x0d20('0x67'),'interface',_0x0d20('0x102'),_0x0d20('0x108'),_0x0d20('0x109'),_0x0d20('0x10a'),_0x0d20('0x10b'),_0x0d20('0x10c'),_0x0d20('0x10d'),_0x0d20('0x10e'),'pauseType',_0x0d20('0x10f')]})['then'](function(_0x5560e5){if(!_0x5560e5){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x2dc364[_0x0d20('0x54')]['id']));}return _0x5560e5['unpause'](_0x2dc364[_0x0d20('0x5d')][_0x0d20('0xa0')]);})[_0x0d20('0x28')](respondWithResult(_0x326343,null))[_0x0d20('0x53')](APIHandleError(_0x326343));};exports['getTeams']=function(_0x145e75,_0xc6de46){var _0x97b1a9={};var _0x5956dd={};var _0x1fd175;var _0x31a9f8;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x145e75[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0xc6de46,null))[_0x0d20('0x28')](function(_0x2aa53e){if(_0x2aa53e){_0x1fd175=_0x2aa53e;_0x5956dd[_0x0d20('0x55')]=_[_0x0d20('0x56')](db[_0x0d20('0x110')][_0x0d20('0xd8')]);_0x5956dd[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x145e75['query']);_0x5956dd[_0x0d20('0xca')]=_['intersection'](_0x5956dd[_0x0d20('0x55')],_0x5956dd['query']);_0x97b1a9['attributes']=_[_0x0d20('0x57')](_0x5956dd[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x145e75[_0x0d20('0x58')][_0x0d20('0x59')]));_0x97b1a9[_0x0d20('0x49')]=_0x97b1a9[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x97b1a9[_0x0d20('0x49')]:_0x5956dd[_0x0d20('0x55')];_0x97b1a9[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x145e75[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x97b1a9['where']=qs[_0x0d20('0xca')](_['pick'](_0x145e75[_0x0d20('0x58')],_0x5956dd[_0x0d20('0xca')]));if(_0x145e75[_0x0d20('0x58')]['filter']){_0x97b1a9[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x97b1a9[_0x0d20('0x43')],{'$or':_[_0x0d20('0x3b')](_0x97b1a9[_0x0d20('0x49')],function(_0x350c49){var _0x3a86fa={};_0x3a86fa[_0x350c49]={'$like':'%'+_0x145e75[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x3a86fa;})});}_0x97b1a9=_['merge']({},_0x97b1a9,_0x145e75[_0x0d20('0xce')]);return _0x1fd175['getTeams'](_0x97b1a9);}})[_0x0d20('0x28')](function(_0x50999f){if(_0x50999f){_0x31a9f8=_0x50999f[_0x0d20('0x4d')];if(!_0x145e75[_0x0d20('0x58')][_0x0d20('0xcf')](_0x0d20('0xd5'))){_0x97b1a9[_0x0d20('0x22')]=qs[_0x0d20('0x22')](_0x145e75[_0x0d20('0x58')][_0x0d20('0x22')]);_0x97b1a9['offset']=qs['offset'](_0x145e75[_0x0d20('0x58')][_0x0d20('0x23')]);}return _0x1fd175[_0x0d20('0x111')](_0x97b1a9);}})[_0x0d20('0x28')](function(_0x1e5a25){if(_0x1e5a25){return _0x1e5a25?{'count':_0x31a9f8,'rows':_0x1e5a25}:null;}})['then'](respondWithResult(_0xc6de46,null))[_0x0d20('0x53')](handleError(_0xc6de46,null));};exports[_0x0d20('0x112')]=function(_0x3973e2,_0x3f32a4){var _0x2fde27=_0x3973e2['params']['id'];var _0x2c5ac9=_0x3973e2[_0x0d20('0x5d')]?_0x3973e2[_0x0d20('0x5d')][_0x0d20('0x61')]:null;var _0x45d064=[];return Promise[_0x0d20('0xff')]()['then'](function(){if(!_0x2c5ac9)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x0d20('0x28')](function(){return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x2fde27}});})[_0x0d20('0x28')](function(_0x4e826a){if(!_0x4e826a)throw new APINotFoundError(util[_0x0d20('0xaa')](_0x0d20('0x113'),_0x3973e2[_0x0d20('0x54')]['id']));return db[_0x0d20('0x6a')][_0x0d20('0x114')](function(_0x35e307){return _0x4e826a[_0x0d20('0x112')](_0x2c5ac9,{'transaction':_0x35e307})[_0x0d20('0x28')](function(){return db['Team'][_0x0d20('0x8c')]({'where':{'id':{'$in':_0x2c5ac9}}});})[_0x0d20('0x28')](function(_0x5f4208){var _0x38cffd=_['map'](_0x5f4208,function(_0x34e3ba){return _0x34e3ba[_0x0d20('0x115')]();});return Promise[_0x0d20('0x52')](_0x38cffd);})['then'](function(_0x34897b){_0x45d064=_[_0x0d20('0x116')](_0x34897b);var _0x39643e=_['map'](_0x45d064,function(_0x2db574){return _0x2db574[_0x0d20('0x117')](_0x4e826a['id'],{'transaction':_0x35e307});});return Promise[_0x0d20('0x52')](_0x39643e);})[_0x0d20('0x28')](function(){if(!_0x4e826a['online'])return;var _0x5245da=_[_0x0d20('0x3f')](_0x45d064,function(_0x22fe6a){return _0x22fe6a[_0x0d20('0x118')](_0x0d20('0xa0'))===_0x0d20('0x119');});var _0x3958f3=_[_0x0d20('0x3b')](_0x5245da,function(_0x54922d){return db['UserVoiceQueueRt'][_0x0d20('0xac')]({'membername':_0x4e826a['name'],'UserId':_0x4e826a['id'],'queue_name':_0x54922d[_0x0d20('0x37')],'VoiceQueueId':_0x54922d['id'],'interface':_[_0x0d20('0x68')](_0x4e826a['interface'])?util[_0x0d20('0xaa')](_0x0d20('0xef'),_0x4e826a[_0x0d20('0x37')]):_0x4e826a['interface'],'paused':_0x4e826a['voicePause']||![],'penalty':_0x4e826a['penalty']},{'transaction':_0x35e307});});return Promise[_0x0d20('0x52')](_0x3958f3);})['then'](function(){return db[_0x0d20('0x11a')][_0x0d20('0x8c')]({'where':{'teamId':{'$in':_0x2c5ac9}}});})[_0x0d20('0x28')](function(_0x3b3f85){var _0x48bec5=_['map'](_0x3b3f85,function(_0x38bb8c){return db[_0x0d20('0x11b')][_0x0d20('0x7d')]({'UserId':_0x4e826a['id'],'VoicePrefixId':_0x38bb8c[_0x0d20('0x11c')]},{'transaction':_0x35e307});});return Promise['all'](_0x48bec5);});});})[_0x0d20('0x28')](function(){for(var _0xc10895=0x0;_0xc10895<_0x45d064[_0x0d20('0x4d')];_0xc10895++){var _0x3edf26=_0x45d064[_0xc10895]['getDataValue'](_0x0d20('0xa0'));var _0x50f667=_0x3edf26+'QueueId';socket[_0x0d20('0x29')]('user'+_0x3edf26+_0x0d20('0x11d'),{'UserId':_0x2fde27,['queueField']:_0x45d064[_0xc10895]['id']});}})['then'](respondWithStatusCode(_0x3f32a4,null))['catch'](APIHandleError(_0x3f32a4));};exports[_0x0d20('0x11e')]=function(_0x269e19,_0x2c519e){var _0x2c1c8b=_0x269e19[_0x0d20('0x54')]['id'];var _0x47b441=null;if(_0x269e19['query'][_0x0d20('0x61')]){_0x47b441=_[_0x0d20('0xb2')](_0x269e19[_0x0d20('0x58')][_0x0d20('0x61')])?_0x269e19[_0x0d20('0x58')][_0x0d20('0x61')]:[_0x269e19['query']['ids']];}var _0x621c07=[];return Promise['resolve']()[_0x0d20('0x28')](function(){if(!_0x47b441)throw new APIBadRequestError(_0x0d20('0x11f'));})[_0x0d20('0x28')](function(){return db['User'][_0x0d20('0x99')]({'where':{'id':_0x2c1c8b}});})[_0x0d20('0x28')](function(_0x506fd2){if(!_0x506fd2)throw new APINotFoundError(util[_0x0d20('0xaa')](_0x0d20('0x113'),_0x269e19[_0x0d20('0x54')]['id']));return db[_0x0d20('0x6a')][_0x0d20('0x114')](function(_0x2dc078){return _0x506fd2[_0x0d20('0x11e')](_0x47b441,{'transaction':_0x2dc078})[_0x0d20('0x28')](function(){return db[_0x0d20('0x110')]['findAll']({'where':{'id':{'$in':_0x47b441}}});})[_0x0d20('0x28')](function(_0x3f0cbc){var _0x2f3c9e=_[_0x0d20('0x3b')](_0x3f0cbc,function(_0x163eff){return _0x163eff[_0x0d20('0x115')]();});return Promise[_0x0d20('0x52')](_0x2f3c9e);})[_0x0d20('0x28')](function(_0x50d433){_0x621c07=_[_0x0d20('0x116')](_0x50d433);var _0xdb0d79=_[_0x0d20('0x3b')](_0x621c07,function(_0x1942f7){return _0x1942f7[_0x0d20('0x120')](_0x506fd2['id'],{'transaction':_0x2dc078});});return Promise[_0x0d20('0x52')](_0xdb0d79);})['then'](function(){if(!_0x506fd2[_0x0d20('0x102')])return;var _0x3ac4f9=_[_0x0d20('0x3f')](_0x621c07,function(_0x1535ee){return _0x1535ee[_0x0d20('0x118')](_0x0d20('0xa0'))===_0x0d20('0x119');});var _0x278f60=_[_0x0d20('0x3b')](_0x3ac4f9,function(_0x20c3a3){return db[_0x0d20('0xab')][_0x0d20('0x2b')]({'where':{'VoiceQueueId':_0x20c3a3['id'],'UserId':_0x506fd2['id']},'transaction':_0x2dc078});});return Promise['all'](_0x278f60);})[_0x0d20('0x28')](function(){return db[_0x0d20('0x11a')]['findAll']({'where':{'teamId':{'$in':_0x47b441}}});})['then'](function(_0x1d0834){var _0x32fad2=_[_0x0d20('0x3b')](_0x1d0834,function(_0x627f66){return db[_0x0d20('0x11b')][_0x0d20('0x2b')]({'where':{'UserId':_0x506fd2['id'],'VoicePrefixId':_0x627f66[_0x0d20('0x11c')]}},{'transaction':_0x2dc078});});return Promise[_0x0d20('0x52')](_0x32fad2);});});})['then'](function(){for(var _0x166d6f=0x0;_0x166d6f<_0x621c07[_0x0d20('0x4d')];_0x166d6f++){var _0x13d0bb=_0x621c07[_0x166d6f]['getDataValue'](_0x0d20('0xa0'));var _0x11f627=_0x13d0bb+'QueueId';socket[_0x0d20('0x29')](_0x0d20('0x2f')+_0x13d0bb+_0x0d20('0xb3'),{'UserId':_0x2c1c8b,['queueField']:_0x621c07[_0x166d6f]['id']});}})[_0x0d20('0x28')](respondWithStatusCode(_0x2c519e,null))[_0x0d20('0x53')](APIHandleError(_0x2c519e));};exports['getLists']=function(_0x45c94f,_0x22a671){var _0x490241={};var _0x71e3a0={};var _0x5388b5;var _0x7f48c1;return db['User'][_0x0d20('0x99')]({'where':{'id':_0x45c94f[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x22a671,null))[_0x0d20('0x28')](function(_0x33be34){if(_0x33be34){_0x5388b5=_0x33be34;_0x71e3a0[_0x0d20('0x55')]=_[_0x0d20('0x56')](db[_0x0d20('0xd0')][_0x0d20('0xd8')]);_0x71e3a0[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x45c94f['query']);_0x71e3a0[_0x0d20('0xca')]=_[_0x0d20('0x57')](_0x71e3a0[_0x0d20('0x55')],_0x71e3a0[_0x0d20('0x58')]);_0x490241['attributes']=_[_0x0d20('0x57')](_0x71e3a0['model'],qs[_0x0d20('0x59')](_0x45c94f[_0x0d20('0x58')][_0x0d20('0x59')]));_0x490241[_0x0d20('0x49')]=_0x490241[_0x0d20('0x49')][_0x0d20('0x4d')]?_0x490241[_0x0d20('0x49')]:_0x71e3a0[_0x0d20('0x55')];_0x490241['order']=qs[_0x0d20('0xcc')](_0x45c94f[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x490241[_0x0d20('0x43')]=qs[_0x0d20('0xca')](_[_0x0d20('0xcd')](_0x45c94f[_0x0d20('0x58')],_0x71e3a0[_0x0d20('0xca')]));if(_0x45c94f[_0x0d20('0x58')][_0x0d20('0x3f')]){_0x490241[_0x0d20('0x43')]=_['merge'](_0x490241['where'],{'$or':_['map'](_0x490241['attributes'],function(_0x9f5d7){var _0x822609={};_0x822609[_0x9f5d7]={'$like':'%'+_0x45c94f[_0x0d20('0x58')][_0x0d20('0x3f')]+'%'};return _0x822609;})});}_0x490241=_[_0x0d20('0x5a')]({},_0x490241,_0x45c94f[_0x0d20('0xce')]);return _0x5388b5[_0x0d20('0x121')](_0x490241);}})[_0x0d20('0x28')](function(_0x51a3c2){if(_0x51a3c2){_0x7f48c1=_0x51a3c2['length'];if(!_0x45c94f[_0x0d20('0x58')][_0x0d20('0xcf')]('nolimit')){_0x490241[_0x0d20('0x22')]=qs['limit'](_0x45c94f['query'][_0x0d20('0x22')]);_0x490241[_0x0d20('0x23')]=qs['offset'](_0x45c94f[_0x0d20('0x58')]['offset']);}return _0x5388b5[_0x0d20('0x121')](_0x490241);}})['then'](function(_0x337601){if(_0x337601){return _0x337601?{'count':_0x7f48c1,'rows':_0x337601}:null;}})[_0x0d20('0x28')](respondWithResult(_0x22a671,null))['catch'](handleError(_0x22a671,null));};exports['getAgents']=function(_0x14d02f,_0x3f036d){var _0x4bc173={};var _0x1edc7d={};var _0x5e8f98;return db[_0x0d20('0x3a')][_0x0d20('0x99')]({'where':{'id':_0x14d02f[_0x0d20('0x54')]['id']}})[_0x0d20('0x28')](handleEntityNotFound(_0x3f036d,null))[_0x0d20('0x28')](function(_0x10f1a5){if(_0x10f1a5){_0x5e8f98=_0x10f1a5;_0x1edc7d[_0x0d20('0x55')]=_[_0x0d20('0x56')](db['User']['rawAttributes']);_0x1edc7d[_0x0d20('0x58')]=_[_0x0d20('0x56')](_0x14d02f[_0x0d20('0x58')]);_0x1edc7d['filters']=_[_0x0d20('0x57')](_0x1edc7d['model'],_0x1edc7d['query']);_0x4bc173[_0x0d20('0x49')]=_[_0x0d20('0x57')](_0x1edc7d[_0x0d20('0x55')],qs[_0x0d20('0x59')](_0x14d02f[_0x0d20('0x58')][_0x0d20('0x59')]));_0x4bc173['attributes']=_0x4bc173['attributes'][_0x0d20('0x4d')]?_0x4bc173[_0x0d20('0x49')]:_0x1edc7d[_0x0d20('0x55')];_0x4bc173[_0x0d20('0xcb')]=qs[_0x0d20('0xcc')](_0x14d02f[_0x0d20('0x58')][_0x0d20('0xcc')]);_0x4bc173[_0x0d20('0x43')]=qs['filters'](_[_0x0d20('0xcd')](_0x14d02f['query'],_0x1edc7d[_0x0d20('0xca')]));if(_0x14d02f['query']['filter']){_0x4bc173[_0x0d20('0x43')]=_[_0x0d20('0x5a')](_0x4bc173['where'],{'$or':_[_0x0d20('0x3b')](_0x4bc173[_0x0d20('0x49')],function(_0x3a54cf){var _0x2b0a8b={};_0x2b0a8b[_0x3a54cf]={'$like':'%'+_0x14d02f['query']['filter']+'%'};return _0x2b0a8b;})});}_0x4bc173[_0x0d20('0x55')]=db[_0x0d20('0x3a')];_0x4bc173['as']=_0x0d20('0x30');_0x4bc173=_[_0x0d20('0x5a')]({},_0x4bc173,_0x14d02f['options']);return _0x5e8f98[_0x0d20('0xf5')]({'include':[_0x4bc173]});}})[_0x0d20('0x28')](function(_0x490167){if(_0x490167){var _0x22780b={},_0x3b4da7=[];for(var _0x118341=0x0;_0x118341<_0x490167[_0x0d20('0x4d')];_0x118341+=0x1){for(var _0x5d0635=0x0,_0x20cdec;_0x5d0635<_0x490167[_0x118341][_0x0d20('0x30')][_0x0d20('0x4d')];_0x5d0635+=0x1){_0x20cdec=_0x490167[_0x118341][_0x0d20('0x30')][_0x5d0635][_0x0d20('0x2c')]({'plain':!![]});_0x22780b[_0x20cdec['id']]=_0x20cdec;}}_0x22780b=_['values'](_0x22780b);for(var _0x4dce6c=qs[_0x0d20('0x23')](_0x14d02f[_0x0d20('0x58')][_0x0d20('0x23')]);_0x4dce6c<_0x22780b[_0x0d20('0x4d')]&&_0x3b4da7['length']=_0x4ae90f[_0x968e('0x47')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x968e('0x12')](function(){if(_0x21fa6d){return db[_0x968e('0x3e')][_0x968e('0x3f')]({'where':{'membername':_0x21fa6d[_0x968e('0x1c')]},'individualHooks':!![]});}})['then'](function(){if(_0x21fa6d){return _0x21fa6d[_0x968e('0x48')]({'raw':!![]});}})[_0x968e('0x12')](function(_0x452956){if(_0x21fa6d){if(_0x452956){var _0x23d6d4=[];_0x1fc516=_0x452956;if(_0x1fc516['length']){for(var _0x24f89a=0x0;_0x24f89a<_0x1fc516[_0x968e('0x25')];_0x24f89a++){_0x23d6d4[_0x968e('0x28')](db[_0x968e('0x3e')][_0x968e('0x49')]({'membername':_0x21fa6d[_0x968e('0x1c')],'UserId':_0x21fa6d['id'],'queue_name':_0x1fc516[_0x24f89a][_0x968e('0x1c')],'VoiceQueueId':_0x1fc516[_0x24f89a]['id'],'interface':_0x3dc1e8,'paused':_0x21fa6d[_0x968e('0x4a')]||![],'penalty':_0x1fc516[_0x24f89a][_0x968e('0x4b')]||0x0}));}return BPromise[_0x968e('0x40')](_0x23d6d4);}}}})['then'](function(){if(_0x21fa6d){return db['MemberReport'][_0x968e('0xb')]({'where':{'membername':_0x21fa6d['name'],'exitAt':null}});}})[_0x968e('0x12')](function(_0x2435a4){if(_0x21fa6d){if(_0x2435a4&&_0x2435a4[_0x968e('0x25')]){var _0x3cb7b5=[];_0x2435a4[_0x968e('0x27')](function(_0x13deb7){_0x3cb7b5[_0x968e('0x28')](_0x13deb7['update']({'exitAt':moment()[_0x968e('0x23')](_0x968e('0x24'))}));});return BPromise[_0x968e('0x40')](_0x3cb7b5);}}})[_0x968e('0x12')](function(){if(_0x21fa6d){var _0x496423=[];var _0x4224f8=[];var _0x2d6323=utils[_0x968e('0x4c')]();var _0x9c7aa9={'membername':_0x21fa6d[_0x968e('0x1c')],'interface':_0x3dc1e8,'enterAt':moment()[_0x968e('0x23')](_0x968e('0x24')),'role':_0x21fa6d[_0x968e('0x1d')],'internal':_0x21fa6d[_0x968e('0x1e')]};_0x2d6323[_0x968e('0x27')](function(_0x309eb3){_0x496423[_0x968e('0x28')](_[_0x968e('0x4d')]({'channel':_0x309eb3,'type':_0x968e('0x4e'),'data1':_0x968e('0x4f'),'data2':_0x3dc1e8},_0x9c7aa9));if(_0x21fa6d[_0x968e('0x4a')]){_0x4224f8[_0x968e('0x28')](_[_0x968e('0x4d')]({'channel':_0x309eb3,'type':_0x968e('0x22'),'data1':'LOGININPAUSE'},_0x9c7aa9));}});return db[_0x968e('0x21')][_0x968e('0x2c')](_0x496423['concat'](_0x4224f8),{'individualHooks':!![]});}})[_0x968e('0x12')](function(){if(_0x21fa6d){return _0x21fa6d[_0x968e('0x20')]({'online':!![],'lastLoginAt':moment()[_0x968e('0x23')](_0x968e('0x24')),'voicePause':_0x21fa6d[_0x968e('0x4a')]||![],'mailPause':_0x21fa6d[_0x968e('0x4a')]||![],'chatPause':_0x21fa6d[_0x968e('0x4a')]||![],'faxPause':_0x21fa6d[_0x968e('0x4a')]||![],'smsPause':_0x21fa6d[_0x968e('0x4a')]||![],'openchannelPause':_0x21fa6d['loginInPause']||![],'pauseType':_0x21fa6d[_0x968e('0x4a')]?_0x968e('0x50'):null,'lastPauseAt':moment()[_0x968e('0x23')](_0x968e('0x24')),'interface':_0x3dc1e8});}})[_0x968e('0x12')](function(_0xfa7dae){_0x1e5ba5(_0xfa7dae);})['catch'](function(_0x13f237){_0x3009b0(_0x54bb34[_0x968e('0x17')](0x1f4,_0x13f237[_0x968e('0x18')]));});});}; \ No newline at end of file +var _0x374f=['pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','system','LogoutUser','length','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','destroy','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','User','findAll','options','where','attributes','include','map','model','info','debug','catch','error','GetUser','message','ShowUser','find','raw','then','stringify','name','internal','UserVoiceQueueRt','update','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','DEFAULT\x20PAUSE','role','MemberReport','bulkCreate','type','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','interface','online','mailPause','chatPause','faxPause','openchannelPause','whatsappPause'];(function(_0x2713e0,_0x16fbf9){var _0x3ce6d7=function(_0x577ed3){while(--_0x577ed3){_0x2713e0['push'](_0x2713e0['shift']());}};_0x3ce6d7(++_0x16fbf9);}(_0x374f,0x175));var _0xf374=function(_0x4f5c28,_0x47188b){_0x4f5c28=_0x4f5c28-0x0;var _0x45cc6f=_0x374f[_0x4f5c28];return _0x45cc6f;};'use strict';var _=require('lodash');var util=require(_0xf374('0x0'));var moment=require(_0xf374('0x1'));var BPromise=require(_0xf374('0x2'));var Redis=require(_0xf374('0x3'));var db=require(_0xf374('0x4'))['db'];var utils=require(_0xf374('0x5'));var logger=require('../../config/logger')(_0xf374('0x6'));var config=require(_0xf374('0x7'));config[_0xf374('0x8')]=_[_0xf374('0x9')](config[_0xf374('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf374('0xa'))(new Redis(config['redis']));require('./user.socket')[_0xf374('0xb')](socket);exports['GetUser']=function(_0x49b2bd){var _0x2306ef=this;return new Promise(function(_0x2d8259,_0x16c301){return db[_0xf374('0xc')][_0xf374('0xd')]({'raw':_0x49b2bd[_0xf374('0xe')]?_0x49b2bd['options']['raw']===undefined?!![]:![]:!![],'where':_0x49b2bd['options']?_0x49b2bd[_0xf374('0xe')][_0xf374('0xf')]||null:null,'attributes':_0x49b2bd['options']?_0x49b2bd[_0xf374('0xe')][_0xf374('0x10')]||null:null,'limit':_0x49b2bd[_0xf374('0xe')]?_0x49b2bd[_0xf374('0xe')]['limit']||null:null,'include':_0x49b2bd[_0xf374('0xe')]?_0x49b2bd[_0xf374('0xe')][_0xf374('0x11')]?_[_0xf374('0x12')](_0x49b2bd[_0xf374('0xe')][_0xf374('0x11')],function(_0x4b3ebd){return{'model':db[_0x4b3ebd[_0xf374('0x13')]],'as':_0x4b3ebd['as'],'attributes':_0x4b3ebd[_0xf374('0x10')],'include':_0x4b3ebd[_0xf374('0x11')]?_['map'](_0x4b3ebd['include'],function(_0x3e2c50){return{'model':db[_0x3e2c50[_0xf374('0x13')]],'as':_0x3e2c50['as'],'attributes':_0x3e2c50[_0xf374('0x10')],'include':_0x3e2c50[_0xf374('0x11')]?_['map'](_0x3e2c50[_0xf374('0x11')],function(_0x27abb4){return{'model':db[_0x27abb4['model']],'as':_0x27abb4['as'],'attributes':_0x27abb4[_0xf374('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38b4bf){logger[_0xf374('0x14')]('GetUser',_0x49b2bd);logger[_0xf374('0x15')]('GetUser',_0x49b2bd,JSON['stringify'](_0x38b4bf));_0x2d8259(_0x38b4bf);})[_0xf374('0x16')](function(_0x4ec231){logger[_0xf374('0x17')](_0xf374('0x18'),_0x4ec231[_0xf374('0x19')],_0x49b2bd);_0x16c301(_0x2306ef[_0xf374('0x17')](0x1f4,_0x4ec231['message']));});});};exports[_0xf374('0x1a')]=function(_0x593f99){var _0x598dcf=this;return new Promise(function(_0x333416,_0x26ab41){return db[_0xf374('0xc')][_0xf374('0x1b')]({'raw':_0x593f99['options']?_0x593f99[_0xf374('0xe')][_0xf374('0x1c')]===undefined?!![]:![]:!![],'where':_0x593f99[_0xf374('0xe')]?_0x593f99['options']['where']||null:null,'attributes':_0x593f99['options']?_0x593f99[_0xf374('0xe')][_0xf374('0x10')]||null:null,'include':_0x593f99[_0xf374('0xe')]?_0x593f99['options']['include']?_[_0xf374('0x12')](_0x593f99[_0xf374('0xe')]['include'],function(_0x119f1d){return{'model':db[_0x119f1d['model']],'as':_0x119f1d['as'],'attributes':_0x119f1d[_0xf374('0x10')],'include':_0x119f1d['include']?_[_0xf374('0x12')](_0x119f1d[_0xf374('0x11')],function(_0x36e6f2){return{'model':db[_0x36e6f2[_0xf374('0x13')]],'as':_0x36e6f2['as'],'attributes':_0x36e6f2[_0xf374('0x10')],'include':_0x36e6f2['include']?_[_0xf374('0x12')](_0x36e6f2[_0xf374('0x11')],function(_0x1e934b){return{'model':db[_0x1e934b[_0xf374('0x13')]],'as':_0x1e934b['as'],'attributes':_0x1e934b[_0xf374('0x10')]};}):[]};}):[]};}):[]:[]})[_0xf374('0x1d')](function(_0x2b44ca){logger[_0xf374('0x14')](_0xf374('0x1a'),_0x593f99);logger['debug'](_0xf374('0x1a'),_0x593f99,JSON[_0xf374('0x1e')](_0x2b44ca));_0x333416(_0x2b44ca);})['catch'](function(_0x5bcb05){logger['error'](_0xf374('0x1a'),_0x5bcb05[_0xf374('0x19')],_0x593f99);_0x26ab41(_0x598dcf[_0xf374('0x17')](0x1f4,_0x5bcb05['message']));});});};exports['PauseUser']=function(_0x975b99){var _0x4f1bf9=this;return new Promise(function(_0x4d54df,_0x49ad2c){var _0x4bd428;return db['User'][_0xf374('0x1b')]({'where':_0x975b99[_0xf374('0xe')][_0xf374('0xf')]||{},'attributes':['id',_0xf374('0x1f'),'role',_0xf374('0x20'),'interface']})[_0xf374('0x1d')](function(_0xf46a22){if(_0xf46a22){_0x4bd428=_0xf46a22;return db[_0xf374('0x21')][_0xf374('0x22')]({'paused':0x1},{'where':{'UserId':_0x4bd428['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4bd428){return db['MemberReport'][_0xf374('0xd')]({'where':{'membername':_0x4bd428[_0xf374('0x1f')],'type':_0xf374('0x23'),'exitAt':null}});}})[_0xf374('0x1d')](function(_0x3f3d4f){if(_0x4bd428){if(_0x3f3d4f&&_0x3f3d4f['length']){var _0x45b50e=moment()[_0xf374('0x24')](_0xf374('0x25'));for(var _0x450bc4=0x0,_0x38d7ef=_0x3f3d4f['length'];_0x450bc4<_0x38d7ef;_0x450bc4++){_0x3f3d4f[_0x450bc4][_0xf374('0x26')]({'exitAt':_0x45b50e});}}}})[_0xf374('0x1d')](function(){if(_0x4bd428){var _0x42ef4e=[];var _0x4a648c=utils[_0xf374('0x27')]();_0x4a648c[_0xf374('0x28')](function(_0x2a4890){_0x42ef4e[_0xf374('0x29')]({'channel':_0x2a4890,'membername':_0x4bd428[_0xf374('0x1f')],'interface':_[_0xf374('0x2a')](_0x4bd428['interface'])?util[_0xf374('0x24')](_0xf374('0x2b'),_0x4bd428['name']):_0x4bd428['interface'],'type':_0xf374('0x23'),'enterAt':moment()[_0xf374('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x975b99[_0xf374('0x2c')]['type']||_0xf374('0x2d'),'role':_0x4bd428[_0xf374('0x2e')],'internal':_0x4bd428[_0xf374('0x20')],'uniqueid':_0x975b99[_0xf374('0x2c')]['uniqueid']||null});});return db[_0xf374('0x2f')][_0xf374('0x30')](_0x42ef4e,{'individualHooks':!![]});}})[_0xf374('0x1d')](function(){if(_0x4bd428){return _0x4bd428[_0xf374('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x975b99[_0xf374('0x2c')][_0xf374('0x31')]||_0xf374('0x2d'),'lastPauseAt':moment()[_0xf374('0x24')](_0xf374('0x25'))});}})[_0xf374('0x1d')](function(_0x273c0b){_0x4d54df(_0x273c0b);})[_0xf374('0x16')](function(_0x267cc9){_0x49ad2c(_0x4f1bf9[_0xf374('0x17')](0x1f4,_0x267cc9[_0xf374('0x19')]));});});};exports[_0xf374('0x32')]=function(_0x41a14e){var _0xded39d=this;return new Promise(function(_0x4d0f38,_0x1ccd65){if(_0x41a14e[_0xf374('0x2c')][_0xf374('0x33')]&&!utils[_0xf374('0x34')](_0x41a14e['body'][_0xf374('0x33')])){throw new Error(util[_0xf374('0x24')](_0xf374('0x35'),_0x41a14e[_0xf374('0x2c')][_0xf374('0x33')]));}return db['User'][_0xf374('0x36')]({'where':_0x41a14e[_0xf374('0xe')]['where']||{},'attributes':['id','name','role',_0xf374('0x20'),_0xf374('0x37'),_0xf374('0x38'),'voicePause',_0xf374('0x39'),_0xf374('0x3a'),_0xf374('0x3b'),_0xf374('0x3c'),'smsPause',_0xf374('0x3d'),_0xf374('0x3e'),_0xf374('0x3f')]})['then'](function(_0x549d34){if(!_0x549d34){throw new Error(util[_0xf374('0x24')](_0xf374('0x40'),_0x41a14e[_0xf374('0x41')]['id']));}return _0x549d34[_0xf374('0x42')](_0x41a14e[_0xf374('0x2c')][_0xf374('0x33')],_0xf374('0x43'));})[_0xf374('0x1d')](function(_0x401782){_0x4d0f38(_0x401782);})[_0xf374('0x16')](function(_0x3c6c49){_0x1ccd65(_0xded39d[_0xf374('0x17')](0x1f4,_0x3c6c49[_0xf374('0x19')]));});});};exports[_0xf374('0x44')]=function(_0x2bd35e){var _0x50dee8=this;return new Promise(function(_0x4b3c3b,_0x3b464a){var _0x1f5a63;return db['User'][_0xf374('0x36')]({'where':_0x2bd35e[_0xf374('0xe')]['where']||{},'attributes':['id',_0xf374('0x1f')]})[_0xf374('0x1d')](function(_0x109c63){if(_0x109c63){_0x1f5a63=_0x109c63;return db[_0xf374('0x21')]['destroy']({'where':{'membername':_0x1f5a63[_0xf374('0x1f')]},'individualHooks':!![]});}})[_0xf374('0x1d')](function(){if(_0x1f5a63){return db[_0xf374('0x2f')][_0xf374('0xd')]({'where':{'membername':_0x1f5a63[_0xf374('0x1f')],'exitAt':null}});}})[_0xf374('0x1d')](function(_0x4bcbce){if(_0x1f5a63){if(_0x4bcbce&&_0x4bcbce[_0xf374('0x45')]){var _0x53c9f2=[];_0x4bcbce[_0xf374('0x28')](function(_0x23d8b1){_0x53c9f2[_0xf374('0x29')](_0x23d8b1[_0xf374('0x22')]({'exitAt':moment()[_0xf374('0x24')](_0xf374('0x25'))}));});return BPromise['all'](_0x53c9f2);}}})[_0xf374('0x1d')](function(){if(_0x1f5a63){return _0x1f5a63[_0xf374('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf374('0x1d')](function(_0x403e80){_0x4b3c3b(_0x403e80);})[_0xf374('0x16')](function(_0x34c5f4){_0x3b464a(_0x50dee8[_0xf374('0x17')](0x1f4,_0x34c5f4[_0xf374('0x19')]));});});};exports[_0xf374('0x46')]=function(_0x3448df){var _0x18187f=this;return new Promise(function(_0x141882,_0x4c91e4){var _0x1a1546;var _0x4a8126;var _0x4a9f31;var _0x28beea;return db['User']['findOne']({'where':_0x3448df[_0xf374('0xe')][_0xf374('0xf')]||{},'attributes':['id','name',_0xf374('0x2e'),_0xf374('0x47'),_0xf374('0x48'),_0xf374('0x20'),_0xf374('0x49'),_0xf374('0x37')]})[_0xf374('0x1d')](function(_0x11e969){if(_0x11e969){_0x1a1546=_0x11e969;_0x28beea=_0x3448df[_0xf374('0x2c')][_0xf374('0x37')]?_0x3448df[_0xf374('0x2c')][_0xf374('0x37')]:util[_0xf374('0x24')](_0xf374('0x2b'),_0x1a1546[_0xf374('0x1f')]);return db[_0xf374('0xc')][_0xf374('0x4a')]({'where':{'role':_0xf374('0x4b'),'online':!![],'id':{'$ne':_0x1a1546['id']}}});}})['then'](function(_0x30380d){if(_0x30380d){_0x4a9f31=_0x30380d;return require(_0xf374('0x4c'))['getLicense']();}})[_0xf374('0x1d')](function(_0x3dc612){if(_0x3dc612&&_0x3dc612['agents']&&_0x4a9f31>=_0x3dc612[_0xf374('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xf374('0x1d')](function(){if(_0x1a1546){return db[_0xf374('0x21')][_0xf374('0x4e')]({'where':{'membername':_0x1a1546[_0xf374('0x1f')]},'individualHooks':!![]});}})[_0xf374('0x1d')](function(){if(_0x1a1546){return _0x1a1546['getVoiceQueues']({'raw':!![]});}})[_0xf374('0x1d')](function(_0x21b941){if(_0x1a1546){if(_0x21b941){var _0x58b7bd=[];_0x4a8126=_0x21b941;if(_0x4a8126[_0xf374('0x45')]){for(var _0x2bf170=0x0;_0x2bf170<_0x4a8126['length'];_0x2bf170++){_0x58b7bd[_0xf374('0x29')](db['UserVoiceQueueRt'][_0xf374('0x4f')]({'membername':_0x1a1546[_0xf374('0x1f')],'UserId':_0x1a1546['id'],'queue_name':_0x4a8126[_0x2bf170][_0xf374('0x1f')],'VoiceQueueId':_0x4a8126[_0x2bf170]['id'],'interface':_0x28beea,'paused':_0x1a1546[_0xf374('0x49')]||![],'penalty':_0x4a8126[_0x2bf170][_0xf374('0x50')]||0x0}));}return BPromise[_0xf374('0x51')](_0x58b7bd);}}}})[_0xf374('0x1d')](function(){if(_0x1a1546){return db[_0xf374('0x2f')][_0xf374('0xd')]({'where':{'membername':_0x1a1546['name'],'exitAt':null}});}})[_0xf374('0x1d')](function(_0x137bdb){if(_0x1a1546){if(_0x137bdb&&_0x137bdb['length']){var _0x50125e=[];_0x137bdb['forEach'](function(_0x1795ab){_0x50125e[_0xf374('0x29')](_0x1795ab[_0xf374('0x22')]({'exitAt':moment()[_0xf374('0x24')](_0xf374('0x25'))}));});return BPromise[_0xf374('0x51')](_0x50125e);}}})[_0xf374('0x1d')](function(){if(_0x1a1546){var _0x450ce7=[];var _0x9373e5=[];var _0x21e477=utils[_0xf374('0x27')]();var _0x11ce04={'membername':_0x1a1546[_0xf374('0x1f')],'interface':_0x28beea,'enterAt':moment()[_0xf374('0x24')](_0xf374('0x25')),'role':_0x1a1546['role'],'internal':_0x1a1546[_0xf374('0x20')]};_0x21e477[_0xf374('0x28')](function(_0xc8a714){_0x450ce7[_0xf374('0x29')](_[_0xf374('0x52')]({'channel':_0xc8a714,'type':_0xf374('0x53'),'data1':_0xf374('0x54'),'data2':_0x28beea},_0x11ce04));if(_0x1a1546[_0xf374('0x49')]){_0x9373e5[_0xf374('0x29')](_[_0xf374('0x52')]({'channel':_0xc8a714,'type':'PAUSE','data1':_0xf374('0x55')},_0x11ce04));}});return db[_0xf374('0x2f')][_0xf374('0x30')](_0x450ce7[_0xf374('0x56')](_0x9373e5),{'individualHooks':!![]});}})[_0xf374('0x1d')](function(){if(_0x1a1546){return _0x1a1546['update']({'online':!![],'lastLoginAt':moment()[_0xf374('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1a1546['loginInPause']||![],'mailPause':_0x1a1546[_0xf374('0x49')]||![],'chatPause':_0x1a1546['loginInPause']||![],'faxPause':_0x1a1546[_0xf374('0x49')]||![],'smsPause':_0x1a1546[_0xf374('0x49')]||![],'openchannelPause':_0x1a1546['loginInPause']||![],'pauseType':_0x1a1546[_0xf374('0x49')]?_0xf374('0x55'):null,'lastPauseAt':moment()[_0xf374('0x24')](_0xf374('0x25')),'interface':_0x28beea});}})[_0xf374('0x1d')](function(_0x4e93f2){_0x141882(_0x4e93f2);})[_0xf374('0x16')](function(_0x3a402b){_0x4c91e4(_0x18187f[_0xf374('0x17')](0x1f4,_0x3a402b[_0xf374('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index ab6d987..ffa971c 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 _0x1096=['save','remove','emit','removeListener','register','length','user:','./user.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1096,0x16f));var _0x6109=function(_0x19acf5,_0x351de0){_0x19acf5=_0x19acf5-0x0;var _0x19b431=_0x1096[_0x19acf5];return _0x19b431;};'use strict';var UserEvents=require(_0x6109('0x0'));var events=[_0x6109('0x1'),_0x6109('0x2'),'update'];function createListener(_0xbb8915,_0x2c734){return function(_0xb6280e){_0x2c734[_0x6109('0x3')](_0xbb8915,_0xb6280e);};}function removeListener(_0x1ab645,_0x536b3f){return function(){UserEvents[_0x6109('0x4')](_0x1ab645,_0x536b3f);};}exports[_0x6109('0x5')]=function(_0xd5a9b8){for(var _0x4a6c0c=0x0,_0x2f0fbd=events[_0x6109('0x6')];_0x4a6c0c<_0x2f0fbd;_0x4a6c0c++){var _0x5ecdca=events[_0x4a6c0c];var _0x298c93=createListener(_0x6109('0x7')+_0x5ecdca,_0xd5a9b8);UserEvents['on'](_0x5ecdca,_0x298c93);}}; \ No newline at end of file +var _0x8ad0=['register','user:','remove','update','emit'];(function(_0x57d628,_0xda6747){var _0x2f8486=function(_0x5f2cba){while(--_0x5f2cba){_0x57d628['push'](_0x57d628['shift']());}};_0x2f8486(++_0xda6747);}(_0x8ad0,0x110));var _0x08ad=function(_0x5d57a9,_0x1df648){_0x5d57a9=_0x5d57a9-0x0;var _0x4727e0=_0x8ad0[_0x5d57a9];return _0x4727e0;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x08ad('0x0'),_0x08ad('0x1')];function createListener(_0x11def0,_0x5bbb2f){return function(_0x25ebd0){_0x5bbb2f[_0x08ad('0x2')](_0x11def0,_0x25ebd0);};}function removeListener(_0x137957,_0x4643ef){return function(){UserEvents['removeListener'](_0x137957,_0x4643ef);};}exports[_0x08ad('0x3')]=function(_0x1005b1){for(var _0x7060d7=0x0,_0x42381c=events['length'];_0x7060d7<_0x42381c;_0x7060d7++){var _0x2a3be6=events[_0x7060d7];var _0x23365a=createListener(_0x08ad('0x4')+_0x2a3be6,_0x1005b1);UserEvents['on'](_0x2a3be6,_0x23365a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index db9d349..3eef676 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xbc28d2,_0x196d2e){var _0x5bf946=function(_0x5f3d93){while(--_0x5f3d93){_0xbc28d2['push'](_0xbc28d2['shift']());}};_0x5bf946(++_0x196d2e);}(_0x70e0,0x17b));var _0x070e=function(_0x52f220,_0x4f4990){_0x52f220=_0x52f220-0x0;var _0x6adfc6=_0x70e0[_0x52f220];return _0x6adfc6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1b8c0d,_0x2ce03e){var _0xf3eb61=function(_0x4d5717){while(--_0x4d5717){_0x1b8c0d['push'](_0x1b8c0d['shift']());}};_0xf3eb61(++_0x2ce03e);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index a5833c5..8250579 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 _0x49b7=['INTEGER','sequelize'];(function(_0x25c7d8,_0x8263fa){var _0x99ee23=function(_0x4e1c25){while(--_0x4e1c25){_0x25c7d8['push'](_0x25c7d8['shift']());}};_0x99ee23(++_0x8263fa);}(_0x49b7,0x73));var _0x749b=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x49b7[_0x4bc4c8];return _0x3bb121;};'use strict';var Sequelize=require(_0x749b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x749b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9374=['exports','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9374,0x1ac));var _0x4937=function(_0xd7d9ee,_0x5cc4e0){_0xd7d9ee=_0xd7d9ee-0x0;var _0xbd7dc=_0x9374[_0xd7d9ee];return _0xbd7dc;};'use strict';var Sequelize=require('sequelize');module[_0x4937('0x0')]={'penalty':{'type':Sequelize[_0x4937('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index ccd0522..8c38339 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 _0x7c9d=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x5037a3,_0x4642ce){var _0x1f4a2b=function(_0x18b35e){while(--_0x18b35e){_0x5037a3['push'](_0x5037a3['shift']());}};_0x1f4a2b(++_0x4642ce);}(_0x7c9d,0xe2));var _0xd7c9=function(_0x39ef32,_0x1cf951){_0x39ef32=_0x39ef32-0x0;var _0xf4bcdc=_0x7c9d[_0x39ef32];return _0xf4bcdc;};'use strict';var _=require(_0xd7c9('0x0'));var util=require(_0xd7c9('0x1'));var logger=require(_0xd7c9('0x2'))(_0xd7c9('0x3'));var moment=require(_0xd7c9('0x4'));var BPromise=require(_0xd7c9('0x5'));var rp=require(_0xd7c9('0x6'));var fs=require('fs');var path=require(_0xd7c9('0x7'));var rimraf=require(_0xd7c9('0x8'));var config=require(_0xd7c9('0x9'));var attributes=require(_0xd7c9('0xa'));module[_0xd7c9('0xb')]=function(_0x3286c1,_0x2f9159){return _0x3286c1[_0xd7c9('0xc')](_0xd7c9('0xd'),attributes,{'tableName':_0xd7c9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x903d=['request-promise','path','rimraf','./userChatQueue.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x903d,0x192));var _0xd903=function(_0x24867a,_0x236ca9){_0x24867a=_0x24867a-0x0;var _0x502d35=_0x903d[_0x24867a];return _0x502d35;};'use strict';var _=require(_0xd903('0x0'));var util=require(_0xd903('0x1'));var logger=require(_0xd903('0x2'))('api');var moment=require(_0xd903('0x3'));var BPromise=require(_0xd903('0x4'));var rp=require(_0xd903('0x5'));var fs=require('fs');var path=require(_0xd903('0x6'));var rimraf=require(_0xd903('0x7'));var config=require('../../config/environment');var attributes=require(_0xd903('0x8'));module[_0xd903('0x9')]=function(_0x5aba7b,_0x24ed94){return _0x5aba7b[_0xd903('0xa')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','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 7b26a22..afcd3c0 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 _0x993f=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4706f1,_0x1c2484){var _0x2b70be=function(_0x4373a3){while(--_0x4373a3){_0x4706f1['push'](_0x4706f1['shift']());}};_0x2b70be(++_0x1c2484);}(_0x993f,0x1c1));var _0xf993=function(_0x304560,_0x245348){_0x304560=_0x304560-0x0;var _0x43cb8d=_0x993f[_0x304560];return _0x43cb8d;};'use strict';var _=require(_0xf993('0x0'));var util=require(_0xf993('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf993('0x2'));var db=require(_0xf993('0x3'))['db'];var utils=require(_0xf993('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf993('0x5'));var jayson=require(_0xf993('0x6'));var client=jayson[_0xf993('0x7')][_0xf993('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf2ac8a,_0x4a81fc,_0x801a4a){return new BPromise(function(_0x47f6df,_0x3c9150){return client[_0xf993('0x9')](_0xf2ac8a,_0x801a4a)[_0xf993('0xa')](function(_0x1229ca){logger['info'](_0xf993('0xb'),_0x4a81fc,_0xf993('0xc'));logger['debug'](_0xf993('0xd'),_0x4a81fc,_0xf993('0xc'),JSON[_0xf993('0xe')](_0x1229ca));if(_0x1229ca[_0xf993('0xf')]){if(_0x1229ca[_0xf993('0xf')][_0xf993('0x10')]===0x1f4){logger[_0xf993('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x4a81fc,_0x1229ca[_0xf993('0xf')][_0xf993('0x11')]);return _0x3c9150(_0x1229ca[_0xf993('0xf')][_0xf993('0x11')]);}logger[_0xf993('0xf')](_0xf993('0xb'),_0x4a81fc,_0x1229ca[_0xf993('0xf')][_0xf993('0x11')]);return _0x47f6df(_0x1229ca[_0xf993('0xf')]['message']);}else{logger[_0xf993('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x4a81fc,'request\x20sent');_0x47f6df(_0x1229ca[_0xf993('0x13')]['message']);}})[_0xf993('0x14')](function(_0x819fc2){logger[_0xf993('0xf')](_0xf993('0xb'),_0x4a81fc,_0x819fc2);_0x3c9150(_0x819fc2);});});} \ No newline at end of file +var _0xb801=['error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x467b6b,_0x2dd887){var _0x3ae317=function(_0x250c33){while(--_0x250c33){_0x467b6b['push'](_0x467b6b['shift']());}};_0x3ae317(++_0x2dd887);}(_0xb801,0x1a8));var _0x1b80=function(_0x4285b7,_0x11f7fb){_0x4285b7=_0x4285b7-0x0;var _0x8cb0=_0xb801[_0x4285b7];return _0x8cb0;};'use strict';var _=require(_0x1b80('0x0'));var util=require('util');var moment=require(_0x1b80('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b80('0x2'));var fs=require('fs');var Redis=require(_0x1b80('0x3'));var db=require(_0x1b80('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b80('0x5'))(_0x1b80('0x6'));var config=require(_0x1b80('0x7'));var jayson=require(_0x1b80('0x8'));var client=jayson[_0x1b80('0x9')][_0x1b80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab6e4,_0x59af39,_0x1bbd60){return new BPromise(function(_0x241488,_0x1bd2ee){return client[_0x1b80('0xb')](_0x5ab6e4,_0x1bbd60)['then'](function(_0x407867){logger[_0x1b80('0xc')](_0x1b80('0xd'),_0x59af39,'request\x20sent');logger['debug'](_0x1b80('0xe'),_0x59af39,_0x1b80('0xf'),JSON[_0x1b80('0x10')](_0x407867));if(_0x407867['error']){if(_0x407867[_0x1b80('0x11')][_0x1b80('0x12')]===0x1f4){logger[_0x1b80('0x11')](_0x1b80('0xd'),_0x59af39,_0x407867['error'][_0x1b80('0x13')]);return _0x1bd2ee(_0x407867['error'][_0x1b80('0x13')]);}logger[_0x1b80('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x59af39,_0x407867[_0x1b80('0x11')][_0x1b80('0x13')]);return _0x241488(_0x407867['error'][_0x1b80('0x13')]);}else{logger[_0x1b80('0xc')](_0x1b80('0xd'),_0x59af39,_0x1b80('0xf'));_0x241488(_0x407867['result'][_0x1b80('0x13')]);}})[_0x1b80('0x14')](function(_0x4697e0){logger[_0x1b80('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x59af39,_0x4697e0);_0x1bd2ee(_0x4697e0);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ae6be5b..0c2c920 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x16bc92,_0x1b0935){var _0x27a2d2=function(_0x334beb){while(--_0x334beb){_0x16bc92['push'](_0x16bc92['shift']());}};_0x27a2d2(++_0x1b0935);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1b6b4f,_0xf2095){var _0x54bb8d=function(_0x225806){while(--_0x225806){_0x1b6b4f['push'](_0x1b6b4f['shift']());}};_0x54bb8d(++_0xf2095);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 07a2000..49e1598 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 _0x0691=['exports','INTEGER','sequelize'];(function(_0x30861a,_0x337deb){var _0xa37ad6=function(_0x4dad90){while(--_0x4dad90){_0x30861a['push'](_0x30861a['shift']());}};_0xa37ad6(++_0x337deb);}(_0x0691,0xaa));var _0x1069=function(_0x224a05,_0x259861){_0x224a05=_0x224a05-0x0;var _0x1b7d2e=_0x0691[_0x224a05];return _0x1b7d2e;};'use strict';var Sequelize=require(_0x1069('0x0'));module[_0x1069('0x1')]={'penalty':{'type':Sequelize[_0x1069('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1069('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6488=['exports','INTEGER','STRING','sequelize'];(function(_0x4e9bdd,_0x415f08){var _0x2bab4f=function(_0x24a41a){while(--_0x24a41a){_0x4e9bdd['push'](_0x4e9bdd['shift']());}};_0x2bab4f(++_0x415f08);}(_0x6488,0x7f));var _0x8648=function(_0x259ce8,_0x798276){_0x259ce8=_0x259ce8-0x0;var _0x5ef5c2=_0x6488[_0x259ce8];return _0x5ef5c2;};'use strict';var Sequelize=require(_0x8648('0x0'));module[_0x8648('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8648('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8648('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index c29d8fc..b5cf5f7 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 _0xeac6=['api','moment','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0xeac6,0xda));var _0x6eac=function(_0x39af95,_0x4a309a){_0x39af95=_0x39af95-0x0;var _0x275e9f=_0xeac6[_0x39af95];return _0x275e9f;};'use strict';var _=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var logger=require(_0x6eac('0x2'))(_0x6eac('0x3'));var moment=require(_0x6eac('0x4'));var BPromise=require('bluebird');var rp=require(_0x6eac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6eac('0x6'));var config=require(_0x6eac('0x7'));var attributes=require(_0x6eac('0x8'));module[_0x6eac('0x9')]=function(_0x25412f,_0x2d51a2){return _0x25412f[_0x6eac('0xa')](_0x6eac('0xb'),attributes,{'tableName':_0x6eac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x131c=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1df795,_0x318d77){var _0xd2672d=function(_0x2fac30){while(--_0x2fac30){_0x1df795['push'](_0x1df795['shift']());}};_0xd2672d(++_0x318d77);}(_0x131c,0xe2));var _0xc131=function(_0x1a54ac,_0x1b295e){_0x1a54ac=_0x1a54ac-0x0;var _0x218eac=_0x131c[_0x1a54ac];return _0x218eac;};'use strict';var _=require(_0xc131('0x0'));var util=require('util');var logger=require(_0xc131('0x1'))('api');var moment=require(_0xc131('0x2'));var BPromise=require(_0xc131('0x3'));var rp=require(_0xc131('0x4'));var fs=require('fs');var path=require(_0xc131('0x5'));var rimraf=require(_0xc131('0x6'));var config=require(_0xc131('0x7'));var attributes=require(_0xc131('0x8'));module[_0xc131('0x9')]=function(_0x336f12,_0x519710){return _0x336f12['define'](_0xc131('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 979d871..9c708af 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 _0x0c4e=['stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0x0c4e,0xa0));var _0xe0c4=function(_0x500e68,_0x3eb541){_0x500e68=_0x500e68-0x0;var _0x13297c=_0x0c4e[_0x500e68];return _0x13297c;};'use strict';var _=require('lodash');var util=require(_0xe0c4('0x0'));var moment=require(_0xe0c4('0x1'));var BPromise=require(_0xe0c4('0x2'));var rs=require(_0xe0c4('0x3'));var fs=require('fs');var Redis=require(_0xe0c4('0x4'));var db=require(_0xe0c4('0x5'))['db'];var utils=require(_0xe0c4('0x6'));var logger=require(_0xe0c4('0x7'))(_0xe0c4('0x8'));var config=require(_0xe0c4('0x9'));var jayson=require(_0xe0c4('0xa'));var client=jayson[_0xe0c4('0xb')][_0xe0c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e8ccb,_0x52cab9,_0x24556a){return new BPromise(function(_0x3494bb,_0x5ae8b5){return client['request'](_0x1e8ccb,_0x24556a)['then'](function(_0x2458f6){logger[_0xe0c4('0xd')](_0xe0c4('0xe'),_0x52cab9,_0xe0c4('0xf'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x52cab9,_0xe0c4('0xf'),JSON[_0xe0c4('0x10')](_0x2458f6));if(_0x2458f6['error']){if(_0x2458f6['error'][_0xe0c4('0x11')]===0x1f4){logger[_0xe0c4('0x12')](_0xe0c4('0xe'),_0x52cab9,_0x2458f6[_0xe0c4('0x12')][_0xe0c4('0x13')]);return _0x5ae8b5(_0x2458f6[_0xe0c4('0x12')][_0xe0c4('0x13')]);}logger['error'](_0xe0c4('0xe'),_0x52cab9,_0x2458f6[_0xe0c4('0x12')][_0xe0c4('0x13')]);return _0x3494bb(_0x2458f6['error'][_0xe0c4('0x13')]);}else{logger[_0xe0c4('0xd')](_0xe0c4('0xe'),_0x52cab9,'request\x20sent');_0x3494bb(_0x2458f6[_0xe0c4('0x14')][_0xe0c4('0x13')]);}})[_0xe0c4('0x15')](function(_0x51f79c){logger[_0xe0c4('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x52cab9,_0x51f79c);_0x5ae8b5(_0x51f79c);});});} \ No newline at end of file +var _0x6fe2=['UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0x6fe2,0x65));var _0x26fe=function(_0x4d682b,_0xcea52f){_0x4d682b=_0x4d682b-0x0;var _0x91172b=_0x6fe2[_0x4d682b];return _0x91172b;};'use strict';var _=require(_0x26fe('0x0'));var util=require('util');var moment=require(_0x26fe('0x1'));var BPromise=require(_0x26fe('0x2'));var rs=require(_0x26fe('0x3'));var fs=require('fs');var Redis=require(_0x26fe('0x4'));var db=require(_0x26fe('0x5'))['db'];var utils=require(_0x26fe('0x6'));var logger=require(_0x26fe('0x7'))(_0x26fe('0x8'));var config=require(_0x26fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x26fe('0xa')][_0x26fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a12e,_0x226e76,_0x392d5b){return new BPromise(function(_0x1395a6,_0x1d4f43){return client['request'](_0x22a12e,_0x392d5b)[_0x26fe('0xc')](function(_0xf0b458){logger[_0x26fe('0xd')](_0x26fe('0xe'),_0x226e76,'request\x20sent');logger[_0x26fe('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x226e76,_0x26fe('0x10'),JSON[_0x26fe('0x11')](_0xf0b458));if(_0xf0b458['error']){if(_0xf0b458[_0x26fe('0x12')][_0x26fe('0x13')]===0x1f4){logger[_0x26fe('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x226e76,_0xf0b458['error'][_0x26fe('0x14')]);return _0x1d4f43(_0xf0b458[_0x26fe('0x12')]['message']);}logger[_0x26fe('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x226e76,_0xf0b458[_0x26fe('0x12')]['message']);return _0x1395a6(_0xf0b458[_0x26fe('0x12')]['message']);}else{logger[_0x26fe('0xd')](_0x26fe('0xe'),_0x226e76,_0x26fe('0x10'));_0x1395a6(_0xf0b458[_0x26fe('0x15')][_0x26fe('0x14')]);}})[_0x26fe('0x16')](function(_0x3cadbd){logger[_0x26fe('0x12')](_0x26fe('0xe'),_0x226e76,_0x3cadbd);_0x1d4f43(_0x3cadbd);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ce3b53b..0a025e0 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35bad0,_0x21927d){var _0x4fe50f=function(_0x1873df){while(--_0x1873df){_0x35bad0['push'](_0x35bad0['shift']());}};_0x4fe50f(++_0x21927d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x6c1959,_0x2eea5f){var _0x553d6c=function(_0x104844){while(--_0x104844){_0x6c1959['push'](_0x6c1959['shift']());}};_0x553d6c(++_0x2eea5f);}(_0xe706,0xa3));var _0x6e70=function(_0x46b295,_0x554b00){_0x46b295=_0x46b295-0x0;var _0x1c4c10=_0xe706[_0x46b295];return _0x1c4c10;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ff7f2b6..43e703f 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 _0xa54c=['exports'];(function(_0x368f87,_0x53eecb){var _0x4b503e=function(_0x313ce8){while(--_0x313ce8){_0x368f87['push'](_0x368f87['shift']());}};_0x4b503e(++_0x53eecb);}(_0xa54c,0xee));var _0xca54=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0xa54c[_0x2a7b8e];return _0x29b5c8;};'use strict';var Sequelize=require('sequelize');module[_0xca54('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a5c=['exports','INTEGER','sequelize'];(function(_0x17c098,_0x20093b){var _0x1bd33d=function(_0x51c9ce){while(--_0x51c9ce){_0x17c098['push'](_0x17c098['shift']());}};_0x1bd33d(++_0x20093b);}(_0x3a5c,0x7d));var _0xc3a5=function(_0x594497,_0x3a4774){_0x594497=_0x594497-0x0;var _0x58a661=_0x3a5c[_0x594497];return _0x58a661;};'use strict';var Sequelize=require(_0xc3a5('0x0'));module[_0xc3a5('0x1')]={'penalty':{'type':Sequelize[_0xc3a5('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 0ee9ce4..ef54a5e 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 _0x8d30=['request-promise','path','rimraf','./userMailQueue.attributes','define','UserMailQueue','lodash','moment','bluebird'];(function(_0x1b3f0c,_0x486f57){var _0x4974d5=function(_0x1bfccb){while(--_0x1bfccb){_0x1b3f0c['push'](_0x1b3f0c['shift']());}};_0x4974d5(++_0x486f57);}(_0x8d30,0x96));var _0x08d3=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x8d30[_0x5ad771];return _0x5b5dce;};'use strict';var _=require(_0x08d3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x08d3('0x1'));var BPromise=require(_0x08d3('0x2'));var rp=require(_0x08d3('0x3'));var fs=require('fs');var path=require(_0x08d3('0x4'));var rimraf=require(_0x08d3('0x5'));var config=require('../../config/environment');var attributes=require(_0x08d3('0x6'));module['exports']=function(_0x1d1a80,_0x141454){return _0x1d1a80[_0x08d3('0x7')](_0x08d3('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cf0=['./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3605b9,_0x2cea1b){var _0x520cfa=function(_0x3b957c){while(--_0x3b957c){_0x3605b9['push'](_0x3605b9['shift']());}};_0x520cfa(++_0x2cea1b);}(_0x8cf0,0x10c));var _0x08cf=function(_0x4c74fd,_0x31372f){_0x4c74fd=_0x4c74fd-0x0;var _0x4f66c3=_0x8cf0[_0x4c74fd];return _0x4f66c3;};'use strict';var _=require(_0x08cf('0x0'));var util=require(_0x08cf('0x1'));var logger=require(_0x08cf('0x2'))('api');var moment=require(_0x08cf('0x3'));var BPromise=require(_0x08cf('0x4'));var rp=require(_0x08cf('0x5'));var fs=require('fs');var path=require(_0x08cf('0x6'));var rimraf=require('rimraf');var config=require(_0x08cf('0x7'));var attributes=require(_0x08cf('0x8'));module[_0x08cf('0x9')]=function(_0x33ea42,_0x39b2b3){return _0x33ea42[_0x08cf('0xa')](_0x08cf('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 61aad84..6874f31 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(_0x18ec3f,_0x7c819e){var _0x2dbfec=function(_0x2d3011){while(--_0x2d3011){_0x18ec3f['push'](_0x18ec3f['shift']());}};_0x2dbfec(++_0x7c819e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4b84[_0x5bd426];return _0x23a7eb;};'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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x479f4a,_0x19fa9b){var _0x19f9b2=function(_0x2c9425){while(--_0x2c9425){_0x479f4a['push'](_0x479f4a['shift']());}};_0x19f9b2(++_0x19fa9b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x461c9e,_0x9a67cd){_0x461c9e=_0x461c9e-0x0;var _0x144e35=_0x7fbe[_0x461c9e];return _0x144e35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c0676ae..54ef87e 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 _0x46d1=['path','connect-timeout','express','Router','post','sendUserNotification','exports','multer'];(function(_0xdcbb1f,_0x3cce47){var _0x5bb968=function(_0x1521e6){while(--_0x1521e6){_0xdcbb1f['push'](_0xdcbb1f['shift']());}};_0x5bb968(++_0x3cce47);}(_0x46d1,0x8f));var _0x146d=function(_0x9e81e6,_0x3b2d70){_0x9e81e6=_0x9e81e6-0x0;var _0x385237=_0x46d1[_0x9e81e6];return _0x385237;};'use strict';var multer=require(_0x146d('0x0'));var util=require('util');var path=require(_0x146d('0x1'));var timeout=require(_0x146d('0x2'));var express=require(_0x146d('0x3'));var router=express[_0x146d('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('./userNotification.controller');router[_0x146d('0x5')]('/',auth['isAuthenticated'](),controller[_0x146d('0x6')]);module[_0x146d('0x7')]=router; \ No newline at end of file +var _0xa1bc=['../../config/environment','./userNotification.controller','post','sendUserNotification','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x294f3d,_0x1b0f82){var _0x2c8f6c=function(_0x2303e6){while(--_0x2303e6){_0x294f3d['push'](_0x294f3d['shift']());}};_0x2c8f6c(++_0x1b0f82);}(_0xa1bc,0x102));var _0xca1b=function(_0x3d2d60,_0x521111){_0x3d2d60=_0x3d2d60-0x0;var _0x1902e6=_0xa1bc[_0x3d2d60];return _0x1902e6;};'use strict';var multer=require('multer');var util=require(_0xca1b('0x0'));var path=require(_0xca1b('0x1'));var timeout=require(_0xca1b('0x2'));var express=require(_0xca1b('0x3'));var router=express['Router']();var fs_extra=require(_0xca1b('0x4'));var auth=require(_0xca1b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca1b('0x6'));var controller=require(_0xca1b('0x7'));router[_0xca1b('0x8')]('/',auth['isAuthenticated'](),controller[_0xca1b('0x9')]);module[_0xca1b('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 69463c8..e4d0973 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 _0xa0a8=['TEXT','STRING','BOOLEAN','exports'];(function(_0x2d9c6c,_0x3e9369){var _0x2e5602=function(_0x4d8dcd){while(--_0x4d8dcd){_0x2d9c6c['push'](_0x2d9c6c['shift']());}};_0x2e5602(++_0x3e9369);}(_0xa0a8,0x93));var _0x8a0a=function(_0x2335d6,_0x3e3fc4){_0x2335d6=_0x2335d6-0x0;var _0x5c4938=_0xa0a8[_0x2335d6];return _0x5c4938;};'use strict';var Sequelize=require('sequelize');module[_0x8a0a('0x0')]={'body':{'type':Sequelize[_0x8a0a('0x1')]},'senderName':{'type':Sequelize[_0x8a0a('0x2')]},'recipientsId':{'type':Sequelize[_0x8a0a('0x1')]},'recipientsDescription':{'type':Sequelize[_0x8a0a('0x2')]},'beep':{'type':Sequelize[_0x8a0a('0x3')]}}; \ No newline at end of file +var _0xfbf5=['STRING','TEXT','BOOLEAN','exports'];(function(_0x246194,_0x27cdd9){var _0x4fed0e=function(_0x5a92bc){while(--_0x5a92bc){_0x246194['push'](_0x246194['shift']());}};_0x4fed0e(++_0x27cdd9);}(_0xfbf5,0x11b));var _0x5fbf=function(_0x12cfaa,_0x3902fe){_0x12cfaa=_0x12cfaa-0x0;var _0x3e90a4=_0xfbf5[_0x12cfaa];return _0x3e90a4;};'use strict';var Sequelize=require('sequelize');module[_0x5fbf('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x5fbf('0x1')]},'recipientsId':{'type':Sequelize[_0x5fbf('0x2')]},'recipientsDescription':{'type':Sequelize[_0x5fbf('0x1')]},'beep':{'type':Sequelize[_0x5fbf('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8671104..4de3954 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 _0x252c=['status','end','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','queue','push','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','json','undefined','limit','offset','Content-Range','reject','save','then','destroy'];(function(_0x45154c,_0x1eca31){var _0x2513bc=function(_0x35a79b){while(--_0x35a79b){_0x45154c['push'](_0x45154c['shift']());}};_0x2513bc(++_0x1eca31);}(_0x252c,0x1bd));var _0xc252=function(_0x1e0237,_0x5456bd){_0x1e0237=_0x1e0237-0x0;var _0x2a68fa=_0x252c[_0x1e0237];return _0x2a68fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc252('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc252('0x1'));var moment=require(_0xc252('0x2'));var BPromise=require(_0xc252('0x3'));var Mustache=require(_0xc252('0x4'));var util=require(_0xc252('0x5'));var path=require(_0xc252('0x6'));var sox=require(_0xc252('0x7'));var csv=require('to-csv');var ejs=require(_0xc252('0x8'));var fs=require('fs');var fs_extra=require(_0xc252('0x9'));var _=require(_0xc252('0xa'));var squel=require(_0xc252('0xb'));var crypto=require(_0xc252('0xc'));var jsforce=require(_0xc252('0xd'));var deskjs=require(_0xc252('0xe'));var toCsv=require(_0xc252('0xf'));var querystring=require('querystring');var Papa=require(_0xc252('0x10'));var Redis=require(_0xc252('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc252('0x12'));var as=require(_0xc252('0x13'));var hardwareService=require(_0xc252('0x14'));var logger=require(_0xc252('0x15'))(_0xc252('0x16'));var utils=require(_0xc252('0x17'));var config=require(_0xc252('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc252('0x19'))['db'];config[_0xc252('0x1a')]=_[_0xc252('0x1b')](config[_0xc252('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc252('0x1c'))(new Redis(config[_0xc252('0x1a')]));require('./userNotification.socket')[_0xc252('0x1d')](socket);function respondWithStatusCode(_0x3196f9,_0x57e473){_0x57e473=_0x57e473||0xcc;return function(_0x1f0760){if(_0x1f0760){return _0x3196f9[_0xc252('0x1e')](_0x57e473);}return _0x3196f9['status'](_0x57e473)['end']();};}function respondWithResult(_0x24f8dd,_0xfa249){_0xfa249=_0xfa249||0xc8;return function(_0x4f427e){if(_0x4f427e){return _0x24f8dd['status'](_0xfa249)[_0xc252('0x1f')](_0x4f427e);}};}function respondWithFilteredResult(_0x108b2f,_0x4ebe4b){return function(_0x3c3848){if(_0x3c3848){var _0x51d321=typeof _0x4ebe4b['offset']===_0xc252('0x20')&&typeof _0x4ebe4b[_0xc252('0x21')]==='undefined';var _0x3a4dd7=_0x3c3848['count'];var _0x3a9ff5=_0x51d321?0x0:_0x4ebe4b[_0xc252('0x22')];var _0x2382b8=_0x51d321?_0x3c3848['count']:_0x4ebe4b[_0xc252('0x22')]+_0x4ebe4b[_0xc252('0x21')];var _0x5ea71d;if(_0x2382b8>=_0x3a4dd7){_0x2382b8=_0x3a4dd7;_0x5ea71d=0xc8;}else{_0x5ea71d=0xce;}_0x108b2f['status'](_0x5ea71d);return _0x108b2f['set'](_0xc252('0x23'),_0x3a9ff5+'-'+_0x2382b8+'/'+_0x3a4dd7)[_0xc252('0x1f')](_0x3c3848);}return null;};}function patchUpdates(_0x526ed0){return function(_0xba103){try{jsonpatch['apply'](_0xba103,_0x526ed0,!![]);}catch(_0x39afa4){return BPromise[_0xc252('0x24')](_0x39afa4);}return _0xba103[_0xc252('0x25')]();};}function saveUpdates(_0x1e3b3d,_0x1dc6f4){return function(_0x53bbdf){if(_0x53bbdf){return _0x53bbdf['update'](_0x1e3b3d)[_0xc252('0x26')](function(_0x49e2cc){return _0x49e2cc;});}return null;};}function removeEntity(_0x556ef5,_0x4e9c80){return function(_0x2a66a7){if(_0x2a66a7){return _0x2a66a7[_0xc252('0x27')]()['then'](function(){_0x556ef5[_0xc252('0x28')](0xcc)[_0xc252('0x29')]();});}};}function handleEntityNotFound(_0x2df12f,_0x2c3146){return function(_0x4c9de2){if(!_0x4c9de2){_0x2df12f[_0xc252('0x1e')](0x194);}return _0x4c9de2;};}function handleError(_0x2b0c92,_0x185ede){_0x185ede=_0x185ede||0x1f4;return function(_0x2868d5){logger[_0xc252('0x2a')](_0x2868d5['stack']);if(_0x2868d5[_0xc252('0x2b')]){delete _0x2868d5[_0xc252('0x2b')];}_0x2b0c92[_0xc252('0x28')](_0x185ede)[_0xc252('0x2c')](_0x2868d5);};}exports[_0xc252('0x2d')]=function(_0x4bd662,_0x37ce10,_0xcbc64f){if(!_0x4bd662[_0xc252('0x2e')][_0xc252('0x2f')](_0xc252('0x30'))&&!_0x4bd662[_0xc252('0x2e')]['hasOwnProperty'](_0xc252('0x31'))){throw new db['Sequelize'][(_0xc252('0x32'))](_0xc252('0x33'));}else{if(_0x4bd662[_0xc252('0x2e')][_0xc252('0x2f')]('TemplateId')&&!_0x4bd662[_0xc252('0x2e')][_0xc252('0x2f')](_0xc252('0x34'))){throw new db[(_0xc252('0x35'))][(_0xc252('0x32'))](_0xc252('0x36'));}if(!_0x4bd662[_0xc252('0x2e')]['hasOwnProperty'](_0xc252('0x37'))){throw new db['Sequelize'][(_0xc252('0x32'))](_0xc252('0x38'));}else{try{var _0x12957e=JSON[_0xc252('0x39')](_0x4bd662[_0xc252('0x2e')][_0xc252('0x37')]);}catch(_0x2c0c57){logger[_0xc252('0x2a')](_0x2c0c57);throw new db['Sequelize']['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x1fa04c=[_0xc252('0x3a'),_0xc252('0x3b'),_0xc252('0x3c'),_0xc252('0x3d'),_0xc252('0x3e'),_0xc252('0x3f'),_0xc252('0x40'),'team',_0xc252('0x41')];if(_['some'](_0x12957e,function(_0x337a12){return!_[_0xc252('0x42')](_0x1fa04c,_0x337a12[_0xc252('0x43')][_0xc252('0x44')]());})){throw new db[(_0xc252('0x35'))][(_0xc252('0x32'))](_0xc252('0x45'));}}}var _0x172f16={};_0x172f16[_0xc252('0x46')]=_0x4bd662['body'][_0xc252('0x2f')]('senderName')?_0x4bd662['body'][_0xc252('0x46')]:_0x4bd662['user'][_0xc252('0x47')];_0x172f16[_0xc252('0x48')]=_[_0xc252('0x49')](_0x4bd662[_0xc252('0x2e')][_0xc252('0x48')])?null:_0x4bd662[_0xc252('0x2e')]['recipientsDescription'];_0x172f16[_0xc252('0x4a')]=_0x4bd662['body'][_0xc252('0x4a')]||![];_0x172f16[_0xc252('0x4b')]=_0x4bd662[_0xc252('0x41')]['id'];return getContent(_0x4bd662[_0xc252('0x2e')])['then'](function(_0x1ac1e5){_0x172f16['body']=_0x1ac1e5;return getRecipients(_0x12957e);})[_0xc252('0x26')](function(_0x129693){_0x172f16['recipientsId']=_['sortBy'](_0x129693)[_0xc252('0x4c')](',');return db[_0xc252('0x4d')][_0xc252('0x4e')](function(_0x417c88){return db[_0xc252('0x4f')][_0xc252('0x50')](_0x172f16,{'raw':!![],'transaction':_0x417c88})[_0xc252('0x26')](function(_0x1b99fa){var _0x38b9b5={'sender':_0x172f16[_0xc252('0x46')],'description':_0x172f16['recipientsDescription'],'content':_0x172f16[_0xc252('0x2e')],'beep':_0x172f16[_0xc252('0x4a')]};_0x129693[_0xc252('0x51')](function(_0x1daa96){_0x38b9b5[_0xc252('0x52')]=_0x1daa96;socket['emit'](_0xc252('0x53'),_0x38b9b5);});return _0x1b99fa;});});})[_0xc252('0x26')](respondWithResult(_0x37ce10,0xc9))[_0xc252('0x54')](handleError(_0x37ce10,null));};function getContent(_0x585af9){return new BPromise(function(_0x2feac9,_0x3e6e15){if(_0x585af9['text']){_0x2feac9(_0x585af9[_0xc252('0x30')]);return;}return db[_0xc252('0x55')][_0xc252('0x56')]({'attributes':['html'],'where':{'id':_0x585af9[_0xc252('0x31')]},'raw':!![]})[_0xc252('0x26')](function(_0x4f6bab){if(!_0x4f6bab)throw new db[(_0xc252('0x35'))]['ValidationError'](_0xc252('0x57'));var _0x14d93b=Mustache[_0xc252('0x58')](_0x4f6bab[_0xc252('0x59')],_0x585af9[_0xc252('0x34')]);_0x2feac9(_0x14d93b);})[_0xc252('0x54')](function(_0x56f524){_0x3e6e15(_0x56f524);});});}function getRecipients(_0x31c5bb){return new BPromise(function(_0x4a6236,_0x2afc2f){var _0x40565d=[];var _0x1a5f15=[];_0x31c5bb[_0xc252('0x51')](function(_0x40f294){var _0x3dadbb=_[_0xc252('0x5a')](_0x40f294['model']['toLowerCase']());if(_0x3dadbb===_0xc252('0x5b')){_0x40565d=_[_0xc252('0x5c')](_0x40565d,_0x40f294[_0xc252('0x5d')]);}else{if(_['includes'](_0x3dadbb,_0xc252('0x5e')))_0x3dadbb=_0x3dadbb['replace'](_0xc252('0x5e'),'Queue');_0x40f294[_0xc252('0x5d')][_0xc252('0x51')](function(_0x47f79e){_0x1a5f15[_0xc252('0x5f')](getAgents(_0x3dadbb,_0x47f79e));});}});return BPromise['all'](_0x1a5f15)[_0xc252('0x26')](function(_0x4e39d8){_0x40565d=_[_0xc252('0x5c')](_0x40565d,_['flatten'](_0x4e39d8));_0x4a6236(_0x40565d);})['catch'](function(_0x403eb2){_0x2afc2f(_0x403eb2);});});}function getAgents(_0x294fb2,_0xd3448b){return new BPromise(function(_0x5c4879,_0x5f5d98){return db[_0x294fb2]['findOne']({'where':{'id':_0xd3448b}})[_0xc252('0x26')](function(_0x524c66){return _0x524c66[_0xc252('0x60')]({'attributes':['id'],'raw':!![]})[_0xc252('0x26')](function(_0x52dcf4){var _0x291cc9=_['map'](_0x52dcf4,'id');_0x5c4879(_0x291cc9);});})[_0xc252('0x54')](function(_0x251440){_0x5f5d98(_0x251440);});});} \ No newline at end of file +var _0xd0de=['model','Sequelize','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','recipientsId','sortBy','join','sequelize','transaction','UserNotification','beep','forEach','emit','userNotification:send','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','toLowerCase','union','ids','includes','queue','replace','Queue','all','findOne','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','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','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','error','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some'];(function(_0x377c60,_0x47b09d){var _0x1446fb=function(_0xb92389){while(--_0xb92389){_0x377c60['push'](_0x377c60['shift']());}};_0x1446fb(++_0x47b09d);}(_0xd0de,0x1a0));var _0xed0d=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xd0de[_0x3e21f4];return _0x40fc49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed0d('0x0'));var zipdir=require(_0xed0d('0x1'));var jsonpatch=require(_0xed0d('0x2'));var rp=require(_0xed0d('0x3'));var moment=require(_0xed0d('0x4'));var BPromise=require(_0xed0d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xed0d('0x6'));var sox=require(_0xed0d('0x7'));var csv=require(_0xed0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed0d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed0d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed0d('0x8'));var querystring=require(_0xed0d('0xb'));var Papa=require(_0xed0d('0xc'));var Redis=require(_0xed0d('0xd'));var authService=require(_0xed0d('0xe'));var qs=require(_0xed0d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed0d('0x10'));var logger=require(_0xed0d('0x11'))(_0xed0d('0x12'));var utils=require('../../config/utils');var config=require(_0xed0d('0x13'));var licenseUtil=require(_0xed0d('0x14'));var db=require(_0xed0d('0x15'))['db'];config[_0xed0d('0x16')]=_[_0xed0d('0x17')](config[_0xed0d('0x16')],{'host':_0xed0d('0x18'),'port':0x18eb});var socket=require(_0xed0d('0x19'))(new Redis(config['redis']));require(_0xed0d('0x1a'))[_0xed0d('0x1b')](socket);function respondWithStatusCode(_0x5dc287,_0x43bfe8){_0x43bfe8=_0x43bfe8||0xcc;return function(_0x3f2c49){if(_0x3f2c49){return _0x5dc287[_0xed0d('0x1c')](_0x43bfe8);}return _0x5dc287[_0xed0d('0x1d')](_0x43bfe8)[_0xed0d('0x1e')]();};}function respondWithResult(_0x3a1179,_0x3c5ee3){_0x3c5ee3=_0x3c5ee3||0xc8;return function(_0x3ca18e){if(_0x3ca18e){return _0x3a1179[_0xed0d('0x1d')](_0x3c5ee3)[_0xed0d('0x1f')](_0x3ca18e);}};}function respondWithFilteredResult(_0x30e92a,_0x230223){return function(_0x59874e){if(_0x59874e){var _0x2db81c=typeof _0x230223[_0xed0d('0x20')]===_0xed0d('0x21')&&typeof _0x230223['limit']===_0xed0d('0x21');var _0x1bdff0=_0x59874e[_0xed0d('0x22')];var _0x3561e5=_0x2db81c?0x0:_0x230223[_0xed0d('0x20')];var _0x154569=_0x2db81c?_0x59874e[_0xed0d('0x22')]:_0x230223[_0xed0d('0x20')]+_0x230223[_0xed0d('0x23')];var _0x7cae69;if(_0x154569>=_0x1bdff0){_0x154569=_0x1bdff0;_0x7cae69=0xc8;}else{_0x7cae69=0xce;}_0x30e92a['status'](_0x7cae69);return _0x30e92a['set'](_0xed0d('0x24'),_0x3561e5+'-'+_0x154569+'/'+_0x1bdff0)['json'](_0x59874e);}return null;};}function patchUpdates(_0x12a22b){return function(_0x52db09){try{jsonpatch['apply'](_0x52db09,_0x12a22b,!![]);}catch(_0x26118e){return BPromise[_0xed0d('0x25')](_0x26118e);}return _0x52db09[_0xed0d('0x26')]();};}function saveUpdates(_0x51dbb1,_0x2cf6c3){return function(_0x158197){if(_0x158197){return _0x158197[_0xed0d('0x27')](_0x51dbb1)[_0xed0d('0x28')](function(_0x5d5d2d){return _0x5d5d2d;});}return null;};}function removeEntity(_0x5dbd2e,_0x241634){return function(_0x35179b){if(_0x35179b){return _0x35179b['destroy']()[_0xed0d('0x28')](function(){_0x5dbd2e[_0xed0d('0x1d')](0xcc)[_0xed0d('0x1e')]();});}};}function handleEntityNotFound(_0x1e154b,_0x4c3090){return function(_0x29bbe3){if(!_0x29bbe3){_0x1e154b['sendStatus'](0x194);}return _0x29bbe3;};}function handleError(_0x58d851,_0x5f44fa){_0x5f44fa=_0x5f44fa||0x1f4;return function(_0x19fe63){logger['error'](_0x19fe63[_0xed0d('0x29')]);if(_0x19fe63[_0xed0d('0x2a')]){delete _0x19fe63[_0xed0d('0x2a')];}_0x58d851['status'](_0x5f44fa)[_0xed0d('0x2b')](_0x19fe63);};}exports[_0xed0d('0x2c')]=function(_0x171083,_0x46d013,_0x54c16f){if(!_0x171083[_0xed0d('0x2d')][_0xed0d('0x2e')](_0xed0d('0x2f'))&&!_0x171083['body'][_0xed0d('0x2e')](_0xed0d('0x30'))){throw new db['Sequelize']['ValidationError'](_0xed0d('0x31'));}else{if(_0x171083['body']['hasOwnProperty']('TemplateId')&&!_0x171083[_0xed0d('0x2d')][_0xed0d('0x2e')](_0xed0d('0x32'))){throw new db['Sequelize'][(_0xed0d('0x33'))](_0xed0d('0x34'));}if(!_0x171083[_0xed0d('0x2d')][_0xed0d('0x2e')](_0xed0d('0x35'))){throw new db['Sequelize'][(_0xed0d('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x40a9a4=JSON['parse'](_0x171083[_0xed0d('0x2d')][_0xed0d('0x35')]);}catch(_0x12d787){logger[_0xed0d('0x36')](_0x12d787);throw new db['Sequelize'][(_0xed0d('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x536934=['chatqueue',_0xed0d('0x37'),_0xed0d('0x38'),_0xed0d('0x39'),_0xed0d('0x3a'),_0xed0d('0x3b'),_0xed0d('0x3c'),_0xed0d('0x3d'),_0xed0d('0x3e')];if(_[_0xed0d('0x3f')](_0x40a9a4,function(_0x27a8b3){return!_['includes'](_0x536934,_0x27a8b3[_0xed0d('0x40')]['toLowerCase']());})){throw new db[(_0xed0d('0x41'))][(_0xed0d('0x33'))](_0xed0d('0x42'));}}}var _0x972f78={};_0x972f78['senderName']=_0x171083[_0xed0d('0x2d')]['hasOwnProperty'](_0xed0d('0x43'))?_0x171083['body'][_0xed0d('0x43')]:_0x171083[_0xed0d('0x3e')][_0xed0d('0x44')];_0x972f78[_0xed0d('0x45')]=_[_0xed0d('0x46')](_0x171083['body']['recipientsDescription'])?null:_0x171083['body']['recipientsDescription'];_0x972f78['beep']=_0x171083['body']['beep']||![];_0x972f78['SenderId']=_0x171083[_0xed0d('0x3e')]['id'];return getContent(_0x171083['body'])[_0xed0d('0x28')](function(_0x11a098){_0x972f78[_0xed0d('0x2d')]=_0x11a098;return getRecipients(_0x40a9a4);})['then'](function(_0x494ec7){_0x972f78[_0xed0d('0x47')]=_[_0xed0d('0x48')](_0x494ec7)[_0xed0d('0x49')](',');return db[_0xed0d('0x4a')][_0xed0d('0x4b')](function(_0xb0f727){return db[_0xed0d('0x4c')]['create'](_0x972f78,{'raw':!![],'transaction':_0xb0f727})[_0xed0d('0x28')](function(_0x4fddc0){var _0x559b68={'sender':_0x972f78[_0xed0d('0x43')],'description':_0x972f78[_0xed0d('0x45')],'content':_0x972f78[_0xed0d('0x2d')],'beep':_0x972f78[_0xed0d('0x4d')]};_0x494ec7[_0xed0d('0x4e')](function(_0x51f0fc){_0x559b68['recipient']=_0x51f0fc;socket[_0xed0d('0x4f')](_0xed0d('0x50'),_0x559b68);});return _0x4fddc0;});});})[_0xed0d('0x28')](respondWithResult(_0x46d013,0xc9))['catch'](handleError(_0x46d013,null));};function getContent(_0x5d89e3){return new BPromise(function(_0x3a0e6e,_0x4fb47e){if(_0x5d89e3['text']){_0x3a0e6e(_0x5d89e3['text']);return;}return db[_0xed0d('0x51')]['findOne']({'attributes':['html'],'where':{'id':_0x5d89e3[_0xed0d('0x30')]},'raw':!![]})[_0xed0d('0x28')](function(_0x23d8da){if(!_0x23d8da)throw new db['Sequelize']['ValidationError'](_0xed0d('0x52'));var _0x9aba35=Mustache[_0xed0d('0x53')](_0x23d8da[_0xed0d('0x54')],_0x5d89e3['view']);_0x3a0e6e(_0x9aba35);})[_0xed0d('0x55')](function(_0x2c8788){_0x4fb47e(_0x2c8788);});});}function getRecipients(_0x4a159c){return new BPromise(function(_0x49ce17,_0x33246b){var _0x7f5184=[];var _0x441a45=[];_0x4a159c[_0xed0d('0x4e')](function(_0x40b406){var _0x3cb5da=_['startCase'](_0x40b406[_0xed0d('0x40')][_0xed0d('0x56')]());if(_0x3cb5da==='User'){_0x7f5184=_[_0xed0d('0x57')](_0x7f5184,_0x40b406[_0xed0d('0x58')]);}else{if(_[_0xed0d('0x59')](_0x3cb5da,_0xed0d('0x5a')))_0x3cb5da=_0x3cb5da[_0xed0d('0x5b')](_0xed0d('0x5a'),_0xed0d('0x5c'));_0x40b406['ids'][_0xed0d('0x4e')](function(_0x3805d7){_0x441a45['push'](getAgents(_0x3cb5da,_0x3805d7));});}});return BPromise[_0xed0d('0x5d')](_0x441a45)['then'](function(_0xc86852){_0x7f5184=_[_0xed0d('0x57')](_0x7f5184,_['flatten'](_0xc86852));_0x49ce17(_0x7f5184);})[_0xed0d('0x55')](function(_0x136fe4){_0x33246b(_0x136fe4);});});}function getAgents(_0x202ed4,_0x15dad1){return new BPromise(function(_0x8a16bf,_0x18ab0f){return db[_0x202ed4][_0xed0d('0x5e')]({'where':{'id':_0x15dad1}})[_0xed0d('0x28')](function(_0x5b1b9){return _0x5b1b9[_0xed0d('0x5f')]({'attributes':['id'],'raw':!![]})[_0xed0d('0x28')](function(_0x14d234){var _0x24e74e=_['map'](_0x14d234,'id');_0x8a16bf(_0x24e74e);});})[_0xed0d('0x55')](function(_0x117197){_0x18ab0f(_0x117197);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 28aa105..cb0cc6a 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 _0x6d14=['hook','exports','events','../../mysqldb','UserNotification','update','remove','hasOwnProperty'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x6d14,0xda));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x46d1('0x0'));var UserNotification=require(_0x46d1('0x1'))['db'][_0x46d1('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x46d1('0x3'),'afterDestroy':_0x46d1('0x4')};function emitEvent(_0x51355b){return function(_0x2c5980,_0x3323ab,_0x553626){UserNotificationEvents['emit'](_0x51355b+':'+_0x2c5980['id'],_0x2c5980);UserNotificationEvents['emit'](_0x51355b,_0x2c5980);_0x553626(null);};}for(var e in events){if(events[_0x46d1('0x5')](e)){var event=events[e];UserNotification[_0x46d1('0x6')](e,emitEvent(event));}}module[_0x46d1('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xc789=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x48ac09,_0x807bfd){var _0x4976ca=function(_0x397594){while(--_0x397594){_0x48ac09['push'](_0x48ac09['shift']());}};_0x4976ca(++_0x807bfd);}(_0xc789,0x112));var _0x9c78=function(_0x527660,_0x5a15fe){_0x527660=_0x527660-0x0;var _0x2e1784=_0xc789[_0x527660];return _0x2e1784;};'use strict';var EventEmitter=require(_0x9c78('0x0'));var UserNotification=require(_0x9c78('0x1'))['db'][_0x9c78('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9c78('0x3')](0x0);var events={'afterCreate':_0x9c78('0x4'),'afterUpdate':_0x9c78('0x5'),'afterDestroy':_0x9c78('0x6')};function emitEvent(_0x175bd8){return function(_0x31c477,_0x485875,_0x5487c7){UserNotificationEvents[_0x9c78('0x7')](_0x175bd8+':'+_0x31c477['id'],_0x31c477);UserNotificationEvents['emit'](_0x175bd8,_0x31c477);_0x5487c7(null);};}for(var e in events){if(events[_0x9c78('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9c78('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5b85f13..8b3eb43 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 _0x1333=['api','moment','bluebird','path','rimraf','./userNotification.attributes','define','UserNotification','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0xb1de2d,_0x122dcc){var _0x1cdfaf=function(_0x560cd1){while(--_0x560cd1){_0xb1de2d['push'](_0xb1de2d['shift']());}};_0x1cdfaf(++_0x122dcc);}(_0x1333,0x82));var _0x3133=function(_0x59fd7e,_0x1df171){_0x59fd7e=_0x59fd7e-0x0;var _0x4579a2=_0x1333[_0x59fd7e];return _0x4579a2;};'use strict';var _=require(_0x3133('0x0'));var util=require('util');var logger=require(_0x3133('0x1'))(_0x3133('0x2'));var moment=require(_0x3133('0x3'));var BPromise=require(_0x3133('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3133('0x5'));var rimraf=require(_0x3133('0x6'));var config=require('../../config/environment');var attributes=require(_0x3133('0x7'));module['exports']=function(_0x3d8b50,_0xb00fab){return _0x3d8b50[_0x3133('0x8')](_0x3133('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3133('0xa')});}; \ No newline at end of file +var _0x22ea=['./userNotification.attributes','exports','define','userNotifications','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b9500,_0x599006){var _0x4c3b03=function(_0x13ae96){while(--_0x13ae96){_0x4b9500['push'](_0x4b9500['shift']());}};_0x4c3b03(++_0x599006);}(_0x22ea,0x18a));var _0xa22e=function(_0x1d3275,_0x402bbf){_0x1d3275=_0x1d3275-0x0;var _0x356dca=_0x22ea[_0x1d3275];return _0x356dca;};'use strict';var _=require('lodash');var util=require(_0xa22e('0x0'));var logger=require(_0xa22e('0x1'))(_0xa22e('0x2'));var moment=require(_0xa22e('0x3'));var BPromise=require(_0xa22e('0x4'));var rp=require(_0xa22e('0x5'));var fs=require('fs');var path=require(_0xa22e('0x6'));var rimraf=require(_0xa22e('0x7'));var config=require(_0xa22e('0x8'));var attributes=require(_0xa22e('0x9'));module[_0xa22e('0xa')]=function(_0x26c085,_0x5c3a68){return _0x26c085[_0xa22e('0xb')]('UserNotification',attributes,{'tableName':_0xa22e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 e297a86..83cda82 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 _0x2cdb=['message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28eff0,_0x22d0a0){var _0x172726=function(_0x266e80){while(--_0x266e80){_0x28eff0['push'](_0x28eff0['shift']());}};_0x172726(++_0x22d0a0);}(_0x2cdb,0xea));var _0xb2cd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2cdb[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xb2cd('0x0'));var moment=require(_0xb2cd('0x1'));var BPromise=require(_0xb2cd('0x2'));var rs=require(_0xb2cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2cd('0x4'))['db'];var utils=require(_0xb2cd('0x5'));var logger=require(_0xb2cd('0x6'))(_0xb2cd('0x7'));var config=require(_0xb2cd('0x8'));var jayson=require(_0xb2cd('0x9'));var client=jayson[_0xb2cd('0xa')][_0xb2cd('0xb')]({'port':0x232a});config[_0xb2cd('0xc')]=_[_0xb2cd('0xd')](config[_0xb2cd('0xc')],{'host':_0xb2cd('0xe'),'port':0x18eb});var socket=require(_0xb2cd('0xf'))(new Redis(config[_0xb2cd('0xc')]));require(_0xb2cd('0x10'))['register'](socket);function respondWithRpcPromise(_0x194c65,_0x2be44c,_0x17a7cb){return new BPromise(function(_0x38e5da,_0x1d4e93){return client[_0xb2cd('0x11')](_0x194c65,_0x17a7cb)[_0xb2cd('0x12')](function(_0x31e360){logger[_0xb2cd('0x13')](_0xb2cd('0x14'),_0x2be44c,_0xb2cd('0x15'));logger[_0xb2cd('0x16')](_0xb2cd('0x17'),_0x2be44c,_0xb2cd('0x15'),JSON[_0xb2cd('0x18')](_0x31e360));if(_0x31e360[_0xb2cd('0x19')]){if(_0x31e360[_0xb2cd('0x19')][_0xb2cd('0x1a')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x2be44c,_0x31e360['error']['message']);return _0x1d4e93(_0x31e360['error'][_0xb2cd('0x1b')]);}logger[_0xb2cd('0x19')](_0xb2cd('0x14'),_0x2be44c,_0x31e360['error'][_0xb2cd('0x1b')]);return _0x38e5da(_0x31e360[_0xb2cd('0x19')][_0xb2cd('0x1b')]);}else{logger[_0xb2cd('0x13')](_0xb2cd('0x14'),_0x2be44c,_0xb2cd('0x15'));_0x38e5da(_0x31e360[_0xb2cd('0x1c')]['message']);}})['catch'](function(_0x4bdc27){logger['error'](_0xb2cd('0x14'),_0x2be44c,_0x4bdc27);_0x1d4e93(_0x4bdc27);});});} \ No newline at end of file +var _0x9f6e=['info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then'];(function(_0xfa8168,_0x4d9ab6){var _0x400268=function(_0x5aab2){while(--_0x5aab2){_0xfa8168['push'](_0xfa8168['shift']());}};_0x400268(++_0x4d9ab6);}(_0x9f6e,0x1cb));var _0xe9f6=function(_0x5eef18,_0x4407db){_0x5eef18=_0x5eef18-0x0;var _0x24e14a=_0x9f6e[_0x5eef18];return _0x24e14a;};'use strict';var _=require(_0xe9f6('0x0'));var util=require(_0xe9f6('0x1'));var moment=require(_0xe9f6('0x2'));var BPromise=require(_0xe9f6('0x3'));var rs=require(_0xe9f6('0x4'));var fs=require('fs');var Redis=require(_0xe9f6('0x5'));var db=require(_0xe9f6('0x6'))['db'];var utils=require(_0xe9f6('0x7'));var logger=require(_0xe9f6('0x8'))(_0xe9f6('0x9'));var config=require(_0xe9f6('0xa'));var jayson=require(_0xe9f6('0xb'));var client=jayson[_0xe9f6('0xc')][_0xe9f6('0xd')]({'port':0x232a});config[_0xe9f6('0xe')]=_['defaults'](config[_0xe9f6('0xe')],{'host':_0xe9f6('0xf'),'port':0x18eb});var socket=require(_0xe9f6('0x10'))(new Redis(config[_0xe9f6('0xe')]));require(_0xe9f6('0x11'))[_0xe9f6('0x12')](socket);function respondWithRpcPromise(_0x1e320e,_0x26d02a,_0x5d91e8){return new BPromise(function(_0x1c8907,_0x20f15d){return client[_0xe9f6('0x13')](_0x1e320e,_0x5d91e8)[_0xe9f6('0x14')](function(_0x2e4993){logger[_0xe9f6('0x15')](_0xe9f6('0x16'),_0x26d02a,_0xe9f6('0x17'));logger[_0xe9f6('0x18')](_0xe9f6('0x19'),_0x26d02a,'request\x20sent',JSON[_0xe9f6('0x1a')](_0x2e4993));if(_0x2e4993['error']){if(_0x2e4993[_0xe9f6('0x1b')][_0xe9f6('0x1c')]===0x1f4){logger[_0xe9f6('0x1b')](_0xe9f6('0x16'),_0x26d02a,_0x2e4993['error'][_0xe9f6('0x1d')]);return _0x20f15d(_0x2e4993[_0xe9f6('0x1b')]['message']);}logger['error'](_0xe9f6('0x16'),_0x26d02a,_0x2e4993['error'][_0xe9f6('0x1d')]);return _0x1c8907(_0x2e4993[_0xe9f6('0x1b')][_0xe9f6('0x1d')]);}else{logger[_0xe9f6('0x15')](_0xe9f6('0x16'),_0x26d02a,_0xe9f6('0x17'));_0x1c8907(_0x2e4993['result']['message']);}})['catch'](function(_0x3db698){logger['error']('UserNotification,\x20%s,\x20%s',_0x26d02a,_0x3db698);_0x20f15d(_0x3db698);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index c5c35ac..85d375d 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 _0x9f48=['./userNotification.events','save','remove','update','emit','register','length','userNotification:'];(function(_0x374db1,_0xed6c7d){var _0x40ff4d=function(_0x1dbfb2){while(--_0x1dbfb2){_0x374db1['push'](_0x374db1['shift']());}};_0x40ff4d(++_0xed6c7d);}(_0x9f48,0x168));var _0x89f4=function(_0x22b2e9,_0x33b1f0){_0x22b2e9=_0x22b2e9-0x0;var _0x4a4811=_0x9f48[_0x22b2e9];return _0x4a4811;};'use strict';var UserNotificationEvents=require(_0x89f4('0x0'));var events=[_0x89f4('0x1'),_0x89f4('0x2'),_0x89f4('0x3')];function createListener(_0x3bc3fa,_0x4258d7){return function(_0x470581){_0x4258d7[_0x89f4('0x4')](_0x3bc3fa,_0x470581);};}function removeListener(_0x360005,_0x4e44e7){return function(){UserNotificationEvents['removeListener'](_0x360005,_0x4e44e7);};}exports[_0x89f4('0x5')]=function(_0x27053c){for(var _0x5eb7dd=0x0,_0x2c905e=events[_0x89f4('0x6')];_0x5eb7dd<_0x2c905e;_0x5eb7dd++){var _0x177942=events[_0x5eb7dd];var _0x8b06d5=createListener(_0x89f4('0x7')+_0x177942,_0x27053c);UserNotificationEvents['on'](_0x177942,_0x8b06d5);}}; \ No newline at end of file +var _0x4aec=['./userNotification.events','save','remove','emit','register','length','userNotification:'];(function(_0x309149,_0x52ba75){var _0x12f959=function(_0x3f81a3){while(--_0x3f81a3){_0x309149['push'](_0x309149['shift']());}};_0x12f959(++_0x52ba75);}(_0x4aec,0xa1));var _0xc4ae=function(_0x3c6254,_0x48dc41){_0x3c6254=_0x3c6254-0x0;var _0x1006ad=_0x4aec[_0x3c6254];return _0x1006ad;};'use strict';var UserNotificationEvents=require(_0xc4ae('0x0'));var events=[_0xc4ae('0x1'),_0xc4ae('0x2'),'update'];function createListener(_0xd9aa25,_0x231c5e){return function(_0x3dd09b){_0x231c5e[_0xc4ae('0x3')](_0xd9aa25,_0x3dd09b);};}function removeListener(_0x42eb74,_0x286153){return function(){UserNotificationEvents['removeListener'](_0x42eb74,_0x286153);};}exports[_0xc4ae('0x4')]=function(_0x5d79ff){for(var _0x1d4937=0x0,_0x3dead0=events[_0xc4ae('0x5')];_0x1d4937<_0x3dead0;_0x1d4937++){var _0x46f6e1=events[_0x1d4937];var _0x28b035=createListener(_0xc4ae('0x6')+_0x46f6e1,_0x5d79ff);UserNotificationEvents['on'](_0x46f6e1,_0x28b035);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b92a3fc..a76eb9a 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x493ca4,_0x3abe20){var _0x379cdd=function(_0x405f6b){while(--_0x405f6b){_0x493ca4['push'](_0x493ca4['shift']());}};_0x379cdd(++_0x3abe20);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x399106,_0x2467ee){var _0x4bbca9=function(_0x399e3a){while(--_0x399e3a){_0x399106['push'](_0x399106['shift']());}};_0x4bbca9(++_0x2467ee);}(_0xedd9,0xfc));var _0x9edd=function(_0x36061b,_0x28c065){_0x36061b=_0x36061b-0x0;var _0xe4fb91=_0xedd9[_0x36061b];return _0xe4fb91;};'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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 425c218..9006424 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 _0xfcfc=['INTEGER','exports'];(function(_0x35c2b2,_0x5c996c){var _0x278307=function(_0x3f0a07){while(--_0x3f0a07){_0x35c2b2['push'](_0x35c2b2['shift']());}};_0x278307(++_0x5c996c);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x3a906e,_0x5111f6){_0x3a906e=_0x3a906e-0x0;var _0x5dd5b4=_0xfcfc[_0x3a906e];return _0x5dd5b4;};'use strict';var Sequelize=require('sequelize');module[_0xcfcf('0x0')]={'penalty':{'type':Sequelize[_0xcfcf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 87d7638..a61ae30 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 _0x919e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x919e,0x68));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe919('0x0'));var util=require('util');var logger=require(_0xe919('0x1'))(_0xe919('0x2'));var moment=require(_0xe919('0x3'));var BPromise=require(_0xe919('0x4'));var rp=require(_0xe919('0x5'));var fs=require('fs');var path=require(_0xe919('0x6'));var rimraf=require(_0xe919('0x7'));var config=require(_0xe919('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xe919('0x9')]=function(_0x22e576,_0xc0e30b){return _0x22e576[_0xe919('0xa')](_0xe919('0xb'),attributes,{'tableName':_0xe919('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7262=['rimraf','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x158a9e,_0x23f8f2){var _0x2c6be8=function(_0x14ca02){while(--_0x14ca02){_0x158a9e['push'](_0x158a9e['shift']());}};_0x2c6be8(++_0x23f8f2);}(_0x7262,0x11c));var _0x2726=function(_0x5c0128,_0x5a35be){_0x5c0128=_0x5c0128-0x0;var _0x5a2750=_0x7262[_0x5c0128];return _0x5a2750;};'use strict';var _=require(_0x2726('0x0'));var util=require(_0x2726('0x1'));var logger=require(_0x2726('0x2'))(_0x2726('0x3'));var moment=require(_0x2726('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2726('0x5'));var rimraf=require(_0x2726('0x6'));var config=require('../../config/environment');var attributes=require(_0x2726('0x7'));module['exports']=function(_0x57bd49,_0x39c9f1){return _0x57bd49[_0x2726('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0x2726('0x9'),'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 8dab842..83a1962 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 _0x5aaa=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x5d5b69,_0x1111ab){var _0xf82413=function(_0x3a1f48){while(--_0x3a1f48){_0x5d5b69['push'](_0x5d5b69['shift']());}};_0xf82413(++_0x1111ab);}(_0x5aaa,0x134));var _0xa5aa=function(_0x137bfc,_0x3004c0){_0x137bfc=_0x137bfc-0x0;var _0x324326=_0x5aaa[_0x137bfc];return _0x324326;};'use strict';var _=require(_0xa5aa('0x0'));var util=require(_0xa5aa('0x1'));var moment=require(_0xa5aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5aa('0x3'));var db=require(_0xa5aa('0x4'))['db'];var utils=require(_0xa5aa('0x5'));var logger=require(_0xa5aa('0x6'))(_0xa5aa('0x7'));var config=require(_0xa5aa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa5aa('0x9')][_0xa5aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2024fd,_0x37066b,_0x404033){return new BPromise(function(_0x108e7f,_0x7a6dc8){return client['request'](_0x2024fd,_0x404033)[_0xa5aa('0xb')](function(_0x40c94d){logger[_0xa5aa('0xc')](_0xa5aa('0xd'),_0x37066b,_0xa5aa('0xe'));logger[_0xa5aa('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x37066b,_0xa5aa('0xe'),JSON['stringify'](_0x40c94d));if(_0x40c94d[_0xa5aa('0x10')]){if(_0x40c94d['error'][_0xa5aa('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x37066b,_0x40c94d[_0xa5aa('0x10')][_0xa5aa('0x12')]);return _0x7a6dc8(_0x40c94d[_0xa5aa('0x10')][_0xa5aa('0x12')]);}logger['error'](_0xa5aa('0xd'),_0x37066b,_0x40c94d['error'][_0xa5aa('0x12')]);return _0x108e7f(_0x40c94d['error'][_0xa5aa('0x12')]);}else{logger[_0xa5aa('0xc')](_0xa5aa('0xd'),_0x37066b,'request\x20sent');_0x108e7f(_0x40c94d[_0xa5aa('0x13')][_0xa5aa('0x12')]);}})['catch'](function(_0xf037a0){logger['error'](_0xa5aa('0xd'),_0x37066b,_0xf037a0);_0x7a6dc8(_0xf037a0);});});} \ No newline at end of file +var _0x0b80=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x29f57b,_0x3b47d3){var _0x586591=function(_0x4f99f7){while(--_0x4f99f7){_0x29f57b['push'](_0x29f57b['shift']());}};_0x586591(++_0x3b47d3);}(_0x0b80,0xb9));var _0x00b8=function(_0x2a6e0a,_0x3412a7){_0x2a6e0a=_0x2a6e0a-0x0;var _0x55a1fa=_0x0b80[_0x2a6e0a];return _0x55a1fa;};'use strict';var _=require(_0x00b8('0x0'));var util=require('util');var moment=require(_0x00b8('0x1'));var BPromise=require(_0x00b8('0x2'));var rs=require(_0x00b8('0x3'));var fs=require('fs');var Redis=require(_0x00b8('0x4'));var db=require(_0x00b8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x00b8('0x6'))(_0x00b8('0x7'));var config=require(_0x00b8('0x8'));var jayson=require(_0x00b8('0x9'));var client=jayson[_0x00b8('0xa')][_0x00b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x142d59,_0x26a576,_0x185f30){return new BPromise(function(_0x4e169c,_0x1dd40e){return client['request'](_0x142d59,_0x185f30)[_0x00b8('0xc')](function(_0x112f9e){logger[_0x00b8('0xd')](_0x00b8('0xe'),_0x26a576,'request\x20sent');logger[_0x00b8('0xf')](_0x00b8('0x10'),_0x26a576,_0x00b8('0x11'),JSON[_0x00b8('0x12')](_0x112f9e));if(_0x112f9e[_0x00b8('0x13')]){if(_0x112f9e[_0x00b8('0x13')][_0x00b8('0x14')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x26a576,_0x112f9e[_0x00b8('0x13')][_0x00b8('0x15')]);return _0x1dd40e(_0x112f9e[_0x00b8('0x13')][_0x00b8('0x15')]);}logger[_0x00b8('0x13')](_0x00b8('0xe'),_0x26a576,_0x112f9e['error']['message']);return _0x4e169c(_0x112f9e[_0x00b8('0x13')]['message']);}else{logger[_0x00b8('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x26a576,'request\x20sent');_0x4e169c(_0x112f9e[_0x00b8('0x16')][_0x00b8('0x15')]);}})[_0x00b8('0x17')](function(_0x2b069a){logger[_0x00b8('0x13')](_0x00b8('0xe'),_0x26a576,_0x2b069a);_0x1dd40e(_0x2b069a);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 18ad640..9d69f8e 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 _0xd0e0=['getResources','post','create','clone','addSections','put','update','delete','/:id/sections','removeSections','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','/:id','show','getSections','/:id/resources'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd0e0,0xa7));var _0x0d0e=function(_0x567d4d,_0x22373e){_0x567d4d=_0x567d4d-0x0;var _0x431321=_0xd0e0[_0x567d4d];return _0x431321;};'use strict';var multer=require(_0x0d0e('0x0'));var util=require('util');var path=require(_0x0d0e('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d0e('0x2'));var router=express[_0x0d0e('0x3')]();var fs_extra=require(_0x0d0e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0d0e('0x5'));var config=require(_0x0d0e('0x6'));var controller=require(_0x0d0e('0x7'));router[_0x0d0e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0d0e('0x9'),auth[_0x0d0e('0xa')](),controller['describe']);router['get'](_0x0d0e('0xb'),auth['isAuthenticated'](),controller[_0x0d0e('0xc')]);router[_0x0d0e('0x8')]('/:id/sections',auth[_0x0d0e('0xa')](),controller[_0x0d0e('0xd')]);router[_0x0d0e('0x8')](_0x0d0e('0xe'),auth[_0x0d0e('0xa')](),controller[_0x0d0e('0xf')]);router[_0x0d0e('0x10')]('/',auth[_0x0d0e('0xa')](),controller[_0x0d0e('0x11')]);router[_0x0d0e('0x10')]('/:id/clone',auth[_0x0d0e('0xa')](),controller[_0x0d0e('0x12')]);router['post']('/:id/sections',auth[_0x0d0e('0xa')](),controller[_0x0d0e('0x13')]);router[_0x0d0e('0x10')](_0x0d0e('0xe'),auth[_0x0d0e('0xa')](),controller['addResources']);router[_0x0d0e('0x14')](_0x0d0e('0xb'),auth[_0x0d0e('0xa')](),controller[_0x0d0e('0x15')]);router[_0x0d0e('0x16')](_0x0d0e('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x0d0e('0x16')](_0x0d0e('0x17'),auth[_0x0d0e('0xa')](),controller[_0x0d0e('0x18')]);router[_0x0d0e('0x16')](_0x0d0e('0xe'),auth[_0x0d0e('0xa')](),controller['removeResources']);module[_0x0d0e('0x19')]=router; \ No newline at end of file +var _0xe10c=['clone','post','/:id/sections','addSections','addResources','/:id','update','delete','destroy','removeResources','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','show','getSections','/:id/resources','getResources'];(function(_0x158667,_0x591bfe){var _0x4e8d8b=function(_0x35e8e5){while(--_0x35e8e5){_0x158667['push'](_0x158667['shift']());}};_0x4e8d8b(++_0x591bfe);}(_0xe10c,0x1f0));var _0xce10=function(_0x5428a7,_0x306714){_0x5428a7=_0x5428a7-0x0;var _0x4692a4=_0xe10c[_0x5428a7];return _0x4692a4;};'use strict';var multer=require(_0xce10('0x0'));var util=require(_0xce10('0x1'));var path=require('path');var timeout=require(_0xce10('0x2'));var express=require(_0xce10('0x3'));var router=express['Router']();var fs_extra=require(_0xce10('0x4'));var auth=require(_0xce10('0x5'));var interaction=require(_0xce10('0x6'));var config=require(_0xce10('0x7'));var controller=require(_0xce10('0x8'));router[_0xce10('0x9')]('/',auth[_0xce10('0xa')](),controller[_0xce10('0xb')]);router['get'](_0xce10('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xce10('0x9')]('/:id',auth[_0xce10('0xa')](),controller[_0xce10('0xd')]);router[_0xce10('0x9')]('/:id/sections',auth[_0xce10('0xa')](),controller[_0xce10('0xe')]);router[_0xce10('0x9')](_0xce10('0xf'),auth[_0xce10('0xa')](),controller[_0xce10('0x10')]);router['post']('/',auth[_0xce10('0xa')](),controller['create']);router['post']('/:id/clone',auth[_0xce10('0xa')](),controller[_0xce10('0x11')]);router[_0xce10('0x12')](_0xce10('0x13'),auth[_0xce10('0xa')](),controller[_0xce10('0x14')]);router[_0xce10('0x12')]('/:id/resources',auth['isAuthenticated'](),controller[_0xce10('0x15')]);router['put'](_0xce10('0x16'),auth['isAuthenticated'](),controller[_0xce10('0x17')]);router[_0xce10('0x18')](_0xce10('0x16'),auth[_0xce10('0xa')](),controller[_0xce10('0x19')]);router[_0xce10('0x18')](_0xce10('0x13'),auth[_0xce10('0xa')](),controller['removeSections']);router['delete'](_0xce10('0xf'),auth['isAuthenticated'](),controller[_0xce10('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e055d89..84421f1 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 _0x6e4b=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x1ebf60,_0x360c21){var _0x45f012=function(_0x42b128){while(--_0x42b128){_0x1ebf60['push'](_0x1ebf60['shift']());}};_0x45f012(++_0x360c21);}(_0x6e4b,0x1c2));var _0xb6e4=function(_0x15c93e,_0x53cd56){_0x15c93e=_0x15c93e-0x0;var _0x4c7bfc=_0x6e4b[_0x15c93e];return _0x4c7bfc;};'use strict';var Sequelize=require('sequelize');module[_0xb6e4('0x0')]={'name':{'type':Sequelize[_0xb6e4('0x1')],'allowNull':![],'unique':_0xb6e4('0x2')},'crudPermissions':{'type':Sequelize[_0xb6e4('0x1')],'set':function(_0x132f70){this[_0xb6e4('0x3')](_0xb6e4('0x4'),_0x132f70?_0x132f70[_0xb6e4('0x5')](''):[]);},'get':function(){return this[_0xb6e4('0x6')](_0xb6e4('0x4'))?this['getDataValue'](_0xb6e4('0x4'))[_0xb6e4('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb6e4('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb6e4('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb6e4('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb6e4('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb6e4('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6dcc=['name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','exports','STRING'];(function(_0xcf16b0,_0x4ffa4c){var _0x5562f0=function(_0x465643){while(--_0x465643){_0xcf16b0['push'](_0xcf16b0['shift']());}};_0x5562f0(++_0x4ffa4c);}(_0x6dcc,0x6e));var _0xc6dc=function(_0x119b4b,_0x322a87){_0x119b4b=_0x119b4b-0x0;var _0x2ca4d5=_0x6dcc[_0x119b4b];return _0x2ca4d5;};'use strict';var Sequelize=require('sequelize');module[_0xc6dc('0x0')]={'name':{'type':Sequelize[_0xc6dc('0x1')],'allowNull':![],'unique':_0xc6dc('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x803a3a){this[_0xc6dc('0x3')](_0xc6dc('0x4'),_0x803a3a?_0x803a3a[_0xc6dc('0x5')](''):[]);},'get':function(){return this[_0xc6dc('0x6')](_0xc6dc('0x4'))?this[_0xc6dc('0x6')](_0xc6dc('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc6dc('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc6dc('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 369034f..3f15629 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 _0x9f37=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','keys','length','include','find','catch','create','body','clone','get','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','omit','userProfileId','Resources','sectionId','UserProfileResource','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto'];(function(_0x48587d,_0x508986){var _0x5816ed=function(_0x40c2d4){while(--_0x40c2d4){_0x48587d['push'](_0x48587d['shift']());}};_0x5816ed(++_0x508986);}(_0x9f37,0xd1));var _0x79f3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9f37[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x79f3('0x0'));var rimraf=require(_0x79f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79f3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x79f3('0x3'));var Mustache=require(_0x79f3('0x4'));var util=require(_0x79f3('0x5'));var path=require('path');var sox=require(_0x79f3('0x6'));var csv=require(_0x79f3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79f3('0x8'));var squel=require(_0x79f3('0x9'));var crypto=require(_0x79f3('0xa'));var jsforce=require(_0x79f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x79f3('0x7'));var querystring=require(_0x79f3('0xc'));var Papa=require('papaparse');var Redis=require(_0x79f3('0xd'));var authService=require(_0x79f3('0xe'));var qs=require(_0x79f3('0xf'));var as=require(_0x79f3('0x10'));var hardwareService=require(_0x79f3('0x11'));var logger=require('../../config/logger')(_0x79f3('0x12'));var utils=require(_0x79f3('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x79f3('0x14'))['db'];config[_0x79f3('0x15')]=_[_0x79f3('0x16')](config[_0x79f3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x79f3('0x17'))(new Redis(config[_0x79f3('0x15')]));require(_0x79f3('0x18'))[_0x79f3('0x19')](socket);function respondWithStatusCode(_0x84df8b,_0x42d4d1){_0x42d4d1=_0x42d4d1||0xcc;return function(_0x5a79eb){if(_0x5a79eb){return _0x84df8b['sendStatus'](_0x42d4d1);}return _0x84df8b[_0x79f3('0x1a')](_0x42d4d1)[_0x79f3('0x1b')]();};}function respondWithResult(_0x5268ed,_0x359fe8){_0x359fe8=_0x359fe8||0xc8;return function(_0x2e3e5b){if(_0x2e3e5b){return _0x5268ed[_0x79f3('0x1a')](_0x359fe8)[_0x79f3('0x1c')](_0x2e3e5b);}};}function respondWithFilteredResult(_0x51685f,_0x31e411){return function(_0x897f98){if(_0x897f98){var _0x2179d0=typeof _0x31e411[_0x79f3('0x1d')]===_0x79f3('0x1e')&&typeof _0x31e411[_0x79f3('0x1f')]===_0x79f3('0x1e');var _0x4064b5=_0x897f98[_0x79f3('0x20')];var _0x423850=_0x2179d0?0x0:_0x31e411[_0x79f3('0x1d')];var _0x346701=_0x2179d0?_0x897f98[_0x79f3('0x20')]:_0x31e411[_0x79f3('0x1d')]+_0x31e411[_0x79f3('0x1f')];var _0xb2a79e;if(_0x346701>=_0x4064b5){_0x346701=_0x4064b5;_0xb2a79e=0xc8;}else{_0xb2a79e=0xce;}_0x51685f[_0x79f3('0x1a')](_0xb2a79e);return _0x51685f[_0x79f3('0x21')](_0x79f3('0x22'),_0x423850+'-'+_0x346701+'/'+_0x4064b5)[_0x79f3('0x1c')](_0x897f98);}return null;};}function patchUpdates(_0x274c29){return function(_0x297e50){try{jsonpatch[_0x79f3('0x23')](_0x297e50,_0x274c29,!![]);}catch(_0x36da47){return BPromise[_0x79f3('0x24')](_0x36da47);}return _0x297e50['save']();};}function saveUpdates(_0xc2122,_0x508966){return function(_0x2b6ced){if(_0x2b6ced){return _0x2b6ced[_0x79f3('0x25')](_0xc2122)[_0x79f3('0x26')](function(_0x595846){return _0x595846;});}return null;};}function removeEntity(_0x4a9518,_0x1e8010){return function(_0x142cfa){if(_0x142cfa){return _0x142cfa[_0x79f3('0x27')]()[_0x79f3('0x26')](function(){_0x4a9518[_0x79f3('0x1a')](0xcc)[_0x79f3('0x1b')]();});}};}function handleEntityNotFound(_0x5d7954,_0x31efe8){return function(_0x30b394){if(!_0x30b394){_0x5d7954['sendStatus'](0x194);}return _0x30b394;};}function handleError(_0x398e7e,_0x201235){_0x201235=_0x201235||0x1f4;return function(_0x39ab86){logger['error'](_0x39ab86['stack']);if(_0x39ab86[_0x79f3('0x28')]){delete _0x39ab86[_0x79f3('0x28')];}_0x398e7e[_0x79f3('0x1a')](_0x201235)[_0x79f3('0x29')](_0x39ab86);};}exports[_0x79f3('0x2a')]=function(_0x69d14f,_0x3db9cd){var _0x250a48={},_0x3b30ce={},_0x20e018={'count':0x0,'rows':[]};var _0x2011e8=_[_0x79f3('0x2b')](db[_0x79f3('0x2c')][_0x79f3('0x2d')],function(_0x53ecba){return{'name':_0x53ecba[_0x79f3('0x2e')],'type':_0x53ecba[_0x79f3('0x2f')][_0x79f3('0x30')]};});_0x3b30ce[_0x79f3('0x31')]=_[_0x79f3('0x2b')](_0x2011e8,_0x79f3('0x28'));_0x3b30ce['query']=_['keys'](_0x69d14f[_0x79f3('0x32')]);_0x3b30ce['filters']=_[_0x79f3('0x33')](_0x3b30ce[_0x79f3('0x31')],_0x3b30ce[_0x79f3('0x32')]);_0x250a48['attributes']=_[_0x79f3('0x33')](_0x3b30ce[_0x79f3('0x31')],qs[_0x79f3('0x34')](_0x69d14f['query'][_0x79f3('0x34')]));_0x250a48['attributes']=_0x250a48[_0x79f3('0x35')]['length']?_0x250a48[_0x79f3('0x35')]:_0x3b30ce[_0x79f3('0x31')];if(!_0x69d14f[_0x79f3('0x32')][_0x79f3('0x36')](_0x79f3('0x37'))){_0x250a48['limit']=qs[_0x79f3('0x1f')](_0x69d14f[_0x79f3('0x32')][_0x79f3('0x1f')]);_0x250a48['offset']=qs['offset'](_0x69d14f[_0x79f3('0x32')][_0x79f3('0x1d')]);}_0x250a48['order']=qs[_0x79f3('0x38')](_0x69d14f[_0x79f3('0x32')]['sort']);_0x250a48[_0x79f3('0x39')]=qs['filters'](_[_0x79f3('0x3a')](_0x69d14f[_0x79f3('0x32')],_0x3b30ce[_0x79f3('0x3b')]),_0x2011e8);if(_0x69d14f[_0x79f3('0x32')]['filter']){_0x250a48[_0x79f3('0x39')]=_['merge'](_0x250a48[_0x79f3('0x39')],{'$or':_[_0x79f3('0x2b')](_0x2011e8,function(_0x5bc78b){if(_0x5bc78b[_0x79f3('0x2f')]!==_0x79f3('0x3c')){var _0x57f0ba={};_0x57f0ba[_0x5bc78b[_0x79f3('0x28')]]={'$like':'%'+_0x69d14f[_0x79f3('0x32')][_0x79f3('0x3d')]+'%'};return _0x57f0ba;}})});}_0x250a48=_[_0x79f3('0x3e')]({},_0x250a48,_0x69d14f[_0x79f3('0x3f')]);var _0x1dd453={'where':_0x250a48['where']};return db[_0x79f3('0x2c')][_0x79f3('0x20')](_0x1dd453)[_0x79f3('0x26')](function(_0x1dc223){_0x20e018['count']=_0x1dc223;if(_0x69d14f['query'][_0x79f3('0x40')]){_0x250a48['include']=[{'all':!![]}];}return db[_0x79f3('0x2c')][_0x79f3('0x41')](_0x250a48);})[_0x79f3('0x26')](function(_0x39d473){_0x20e018[_0x79f3('0x42')]=_0x39d473;return _0x20e018;})[_0x79f3('0x26')](respondWithFilteredResult(_0x3db9cd,_0x250a48))['catch'](handleError(_0x3db9cd,null));};exports[_0x79f3('0x43')]=function(_0x3a89e0,_0x56c691){var _0x45cbf1={'raw':![],'where':{'id':_0x3a89e0[_0x79f3('0x44')]['id']}},_0x4d247f={};_0x4d247f[_0x79f3('0x31')]=_['keys'](db[_0x79f3('0x2c')][_0x79f3('0x2d')]);_0x4d247f[_0x79f3('0x32')]=_[_0x79f3('0x45')](_0x3a89e0[_0x79f3('0x32')]);_0x4d247f[_0x79f3('0x3b')]=_[_0x79f3('0x33')](_0x4d247f['model'],_0x4d247f[_0x79f3('0x32')]);_0x45cbf1[_0x79f3('0x35')]=_['intersection'](_0x4d247f[_0x79f3('0x31')],qs[_0x79f3('0x34')](_0x3a89e0[_0x79f3('0x32')][_0x79f3('0x34')]));_0x45cbf1[_0x79f3('0x35')]=_0x45cbf1[_0x79f3('0x35')][_0x79f3('0x46')]?_0x45cbf1['attributes']:_0x4d247f[_0x79f3('0x31')];if(_0x3a89e0['query'][_0x79f3('0x40')]){_0x45cbf1[_0x79f3('0x47')]=[{'all':!![]}];}_0x45cbf1=_[_0x79f3('0x3e')]({},_0x45cbf1,_0x3a89e0[_0x79f3('0x3f')]);return db[_0x79f3('0x2c')][_0x79f3('0x48')](_0x45cbf1)[_0x79f3('0x26')](handleEntityNotFound(_0x56c691,null))[_0x79f3('0x26')](respondWithResult(_0x56c691,null))[_0x79f3('0x49')](handleError(_0x56c691,null));};exports[_0x79f3('0x4a')]=function(_0x3797fb,_0x51a6ae){return db[_0x79f3('0x2c')][_0x79f3('0x4a')](_0x3797fb[_0x79f3('0x4b')],{})['then'](respondWithResult(_0x51a6ae,0xc9))[_0x79f3('0x49')](handleError(_0x51a6ae,null));};exports[_0x79f3('0x4c')]=function(_0x823ede,_0xac6a09){var _0x37b396={'where':{'id':_0x823ede[_0x79f3('0x44')]['id']}},_0x321fa8={};_0x321fa8[_0x79f3('0x31')]=_[_0x79f3('0x45')](db[_0x79f3('0x2c')]['rawAttributes']);_0x37b396[_0x79f3('0x35')]=_[_0x79f3('0x33')](_0x321fa8[_0x79f3('0x31')],qs[_0x79f3('0x34')](_0x823ede[_0x79f3('0x32')][_0x79f3('0x34')]));_0x37b396[_0x79f3('0x35')]=_0x37b396[_0x79f3('0x35')][_0x79f3('0x46')]?_0x37b396[_0x79f3('0x35')]:_0x321fa8[_0x79f3('0x31')];if(_0x823ede[_0x79f3('0x32')][_0x79f3('0x40')]){_0x37b396[_0x79f3('0x47')]=[{'all':!![]}];}_0x37b396=_[_0x79f3('0x3e')]({},_0x37b396,_0x823ede[_0x79f3('0x3f')]);return db[_0x79f3('0x2c')][_0x79f3('0x48')](_0x37b396)[_0x79f3('0x26')](handleEntityNotFound(_0xac6a09,null))[_0x79f3('0x26')](function(_0x2921f3){if(_0x2921f3){var _0x44afb8=_0x2921f3[_0x79f3('0x4d')]({'plain':!![]});_0x44afb8=qs['omit'](_0x44afb8,['id',_0x79f3('0x4e'),'updatedAt','crudPermissions']);_0x823ede[_0x79f3('0x4b')]=_['omit'](_0x823ede[_0x79f3('0x4b')],['id',_0x79f3('0x4e'),_0x79f3('0x4f')]);return db[_0x79f3('0x50')][_0x79f3('0x51')](function(_0xaa0417){return db['UserProfile'][_0x79f3('0x4a')](_[_0x79f3('0x3e')](_0x44afb8,_0x823ede[_0x79f3('0x4b')]),{'include':_0x823ede[_0x79f3('0x32')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xaa0417})[_0x79f3('0x26')](function(_0x85cbbb){var _0x20b1bc=_0x85cbbb[_0x79f3('0x4d')]({'plain':!![]});return db[_0x79f3('0x52')][_0x79f3('0x41')]({'where':{'userProfileId':_0x823ede[_0x79f3('0x44')]['id']},'raw':!![]})[_0x79f3('0x26')](function(_0x63aaf0){if(_0x63aaf0){return BPromise[_0x79f3('0x53')](_0x63aaf0,function(_0x3e39f9){return new BPromise(function(_0x3513bd,_0x5c753d){if(_0x3e39f9['autoAssociation']===null||_0x3e39f9[_0x79f3('0x54')]===0x1)_0x3513bd(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3e39f9['id']},'raw':!![]})[_0x79f3('0x26')](function(_0xfa2147){var _0x38cf53=_[_0x79f3('0x2b')](_0xfa2147,function(_0x1a884d){return qs[_0x79f3('0x55')](_0x1a884d,['id',_0x79f3('0x4e'),_0x79f3('0x4f'),'sectionId']);});_0x3513bd(_0x38cf53);})[_0x79f3('0x49')](function(_0x222077){_0x5c753d(_0x222077);});})[_0x79f3('0x26')](function(_0x4bae55){var _0x303629=qs[_0x79f3('0x55')](_0x3e39f9,['id',_0x79f3('0x4e'),_0x79f3('0x4f')]);_0x303629[_0x79f3('0x56')]=_0x20b1bc['id'];if(_0x4bae55)_0x303629[_0x79f3('0x57')]=_0x4bae55;return _0x303629;})[_0x79f3('0x26')](function(_0x328af4){return db[_0x79f3('0x52')]['create'](_0x328af4,{'include':[{'model':db['UserProfileResource'],'as':_0x79f3('0x57')}],'raw':!![],'transaction':_0xaa0417});});})[_0x79f3('0x26')](function(){return _0x20b1bc;});}});});});}})[_0x79f3('0x26')](respondWithResult(_0xac6a09,0xc9))[_0x79f3('0x49')](handleError(_0xac6a09,null));};exports['update']=function(_0x28f1db,_0x5a12f3){if(_0x28f1db[_0x79f3('0x4b')]['id']){delete _0x28f1db['body']['id'];}return db['UserProfile'][_0x79f3('0x48')]({'where':{'id':_0x28f1db[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](handleEntityNotFound(_0x5a12f3,null))[_0x79f3('0x26')](saveUpdates(_0x28f1db[_0x79f3('0x4b')],null))[_0x79f3('0x26')](respondWithResult(_0x5a12f3,null))['catch'](handleError(_0x5a12f3,null));};exports[_0x79f3('0x27')]=function(_0x1ebc6a,_0x1d463e){return db[_0x79f3('0x2c')][_0x79f3('0x48')]({'where':{'id':_0x1ebc6a[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](handleEntityNotFound(_0x1d463e,null))[_0x79f3('0x26')](removeEntity(_0x1d463e,null))['catch'](handleError(_0x1d463e,null));};exports['describe']=function(_0x3e1c0f,_0x5b7a2d){return db['UserProfile']['describe']()[_0x79f3('0x26')](respondWithResult(_0x5b7a2d,null))[_0x79f3('0x49')](handleError(_0x5b7a2d,null));};exports['addSections']=function(_0x44f55a,_0x576a43){var _0x3e3754=_0x44f55a[_0x79f3('0x4b')];return db['UserProfile'][_0x79f3('0x48')]({'where':{'id':_0x44f55a[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](handleEntityNotFound(_0x576a43,null))[_0x79f3('0x26')](function(_0x33ea04){if(_0x33ea04){return db[_0x79f3('0x50')][_0x79f3('0x51')](function(_0x1cca8f){return db[_0x79f3('0x52')][_0x79f3('0x27')]({'where':{'userProfileId':_0x44f55a[_0x79f3('0x44')]['id'],'sectionId':_[_0x79f3('0x2b')](_0x3e3754,function(_0x2f1534){return _0x2f1534[_0x79f3('0x58')];})},'transaction':_0x1cca8f})[_0x79f3('0x26')](function(){var _0x268442=_[_0x79f3('0x2b')](_0x3e3754,function(_0x5ca108){_0x5ca108['userProfileId']=_0x44f55a['params']['id'];return _0x5ca108;});var _0x24fc58=[];return BPromise['each'](_0x268442,function(_0x2e1bcf){return db[_0x79f3('0x52')][_0x79f3('0x4a')](_0x2e1bcf,{'include':[{'model':db[_0x79f3('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x1cca8f})['then'](function(_0xd63dcd){_0x24fc58[_0x79f3('0x5a')](_0xd63dcd[_0x79f3('0x4d')]({'plain':!![]}));});})[_0x79f3('0x26')](function(){return _0x24fc58;});});});}})[_0x79f3('0x26')](function(_0x9e6048){return _0x9e6048;})[_0x79f3('0x26')](respondWithResult(_0x576a43,null))[_0x79f3('0x49')](handleError(_0x576a43,null));};exports[_0x79f3('0x5b')]=function(_0x31fc69,_0x1a24ac){var _0x1665e5;return db[_0x79f3('0x2c')][_0x79f3('0x48')]({'where':{'id':_0x31fc69[_0x79f3('0x44')]['id']},'attributes':['id','name']})[_0x79f3('0x26')](handleEntityNotFound(_0x1a24ac,null))[_0x79f3('0x26')](function(_0x293e15){if(_0x293e15){_0x1665e5=_0x293e15;return db[_0x79f3('0x52')][_0x79f3('0x27')]({'where':{'userProfileId':_0x31fc69[_0x79f3('0x44')]['id'],'sectionId':_0x31fc69[_0x79f3('0x32')][_0x79f3('0x5c')]}});}})[_0x79f3('0x26')](function(){return _0x1665e5;})[_0x79f3('0x26')](respondWithStatusCode(_0x1a24ac,null))['catch'](handleError(_0x1a24ac,null));};exports[_0x79f3('0x5d')]=function(_0x438366,_0x2a83b9){var _0x44c3fe=[];var _0x5f3f4c=[];return db[_0x79f3('0x52')][_0x79f3('0x41')]({'where':{'userProfileId':_0x438366['params']['id']},'raw':!![]})[_0x79f3('0x26')](function(_0x4532bc){_0x44c3fe=_['filter'](_0x4532bc,function(_0x1585de){return _0x1585de[_0x79f3('0x5e')]===0x1||_['includes']([0x3eb,0x709],_0x1585de['sectionId']);});if(!_[_0x79f3('0x5f')](_0x44c3fe)){return _[_0x79f3('0x2b')](_0x44c3fe,function(_0x22be37){return _0x22be37[_0x79f3('0x58')];});}else{return;}})[_0x79f3('0x26')](function(_0x5e5ab7){if(_0x5e5ab7)_0x5f3f4c=_0x5e5ab7;if(_[_0x79f3('0x60')](_0x5f3f4c,0x64)){var _0x58c671=_[_0x79f3('0x48')](_0x44c3fe,{'sectionId':0x64});return hasDefaultDashboard(_0x58c671)[_0x79f3('0x26')](function(_0x54c09a){return _[_0x79f3('0x2b')](_0x44c3fe,function(_0x2cad2f){if(_0x2cad2f['sectionId']===0x64){_0x2cad2f[_0x79f3('0x61')]=_0x54c09a;}return _0x2cad2f;});});}else{return;}})[_0x79f3('0x26')](function(_0x52013c){if(_0x52013c)_0x44c3fe=_0x52013c;if(_[_0x79f3('0x60')](_0x5f3f4c,0x3eb)){var _0x35b46d=_['find'](_0x44c3fe,{'sectionId':0x3eb});return getCustomDashboards(_0x35b46d)[_0x79f3('0x26')](function(_0x232198){return _[_0x79f3('0x2b')](_0x44c3fe,function(_0x39459f){if(_0x35b46d[_0x79f3('0x5e')]){if(_0x39459f[_0x79f3('0x58')]===0x3eb){_0x39459f[_0x79f3('0x61')]=_0x232198;}}else{if(_0x39459f['sectionId']===0x64){_0x39459f[_0x79f3('0x61')]=_0x232198;}}return _0x39459f;});});}else{return;}})['then'](function(_0x4e24fb){if(_0x4e24fb)_0x44c3fe=_0x4e24fb;if(_[_0x79f3('0x60')](_0x5f3f4c,0x709)){var _0x40dac5=_[_0x79f3('0x48')](_0x44c3fe,{'sectionId':0x709});return getPlugins(_0x40dac5)[_0x79f3('0x26')](function(_0x4e0ec5){if(_0x40dac5['enabled']){return _[_0x79f3('0x2b')](_0x44c3fe,function(_0x15a170){if(_0x15a170[_0x79f3('0x58')]===0x709){_0x15a170[_0x79f3('0x61')]=_0x4e0ec5;}return _0x15a170;});}else{var _0x51bca9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4e0ec5};var _0xccf95=_[_0x79f3('0x2b')](_0x44c3fe);_0xccf95[_0x79f3('0x5a')](_0x51bca9);return _0xccf95;}});}else{return;}})[_0x79f3('0x26')](function(_0x11a6b4){if(_0x11a6b4)_0x44c3fe=_0x11a6b4;return _[_0x79f3('0x3d')](_0x44c3fe,[_0x79f3('0x5e'),0x1]);})[_0x79f3('0x26')](respondWithResult(_0x2a83b9,null))[_0x79f3('0x49')](handleError(_0x2a83b9,null));};function hasDefaultDashboard(_0x1af9db){var _0x36c25e=[0x65];return new BPromise(function(_0xb6ba9c,_0x54262e){try{if(_0x1af9db[_0x79f3('0x54')]){_0xb6ba9c(_0x36c25e);}else{return db[_0x79f3('0x59')][_0x79f3('0x62')]({'where':{'sectionId':_0x1af9db['id']},'raw':!![]})['then'](function(_0x135606){_0x135606?_0xb6ba9c(_0x36c25e):_0xb6ba9c();});}}catch(_0x7b7929){_0x54262e(_0x7b7929);}});}function getCustomDashboards(_0x50496c){var _0x573bd4=[];return new BPromise(function(_0x5434d5,_0x2c764a){try{if(_0x50496c[_0x79f3('0x54')]){return db[_0x79f3('0x63')]['findAll']({'raw':!![]})[_0x79f3('0x26')](function(_0x5c3b5f){_0x5c3b5f['forEach'](function(_0x3a6777){_0x573bd4[_0x79f3('0x5a')](_0x3a6777['id']+0x1869f);});_0x5434d5(_0x573bd4);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x50496c['id']},'raw':!![]})[_0x79f3('0x26')](function(_0x1528f9){_0x1528f9[_0x79f3('0x64')](function(_0x19cc2){_0x573bd4[_0x79f3('0x5a')](_0x19cc2[_0x79f3('0x65')]+0x1869f);});_0x5434d5(_0x573bd4);});}}catch(_0x313d32){_0x2c764a(_0x313d32);}});}function getPlugins(_0x1b121f){var _0x2b7398=[];return new BPromise(function(_0x277e29,_0x28e792){try{if(_0x1b121f['autoAssociation']){return db[_0x79f3('0x66')][_0x79f3('0x41')]({'raw':!![]})[_0x79f3('0x26')](function(_0x4e982d){_0x4e982d[_0x79f3('0x64')](function(_0x4b32a1){_0x2b7398['push'](_0x4b32a1['id']+0x15b38);});_0x277e29(_0x2b7398);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1b121f['id']},'raw':!![]})[_0x79f3('0x26')](function(_0x50e797){_0x50e797[_0x79f3('0x64')](function(_0x5362ee){_0x2b7398[_0x79f3('0x5a')](_0x5362ee['resourceId']+0x15b38);});_0x277e29(_0x2b7398);});}}catch(_0x4db12a){_0x28e792(_0x4db12a);}});}exports[_0x79f3('0x67')]=function(_0x2d082c,_0x30ba6d){return db[_0x79f3('0x2c')]['find']({'where':{'id':_0x2d082c[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](handleEntityNotFound(_0x30ba6d,null))[_0x79f3('0x26')](function(_0x35cfb0){if(_0x35cfb0){return db[_0x79f3('0x50')][_0x79f3('0x51')](function(_0xe190cf){return db[_0x79f3('0x52')]['findAll']({'where':{'userProfileId':_0x2d082c[_0x79f3('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x79f3('0x26')](function(_0x2fa783){if(_0x2fa783){return db[_0x79f3('0x52')][_0x79f3('0x27')]({'where':{'userProfileId':_0x2d082c[_0x79f3('0x44')]['id'],'id':_['map'](_0x2fa783,function(_0x7d444e){return _0x7d444e['id'];})},'transaction':_0xe190cf});}})['then'](function(_0xcc7d68){var _0xd2c1b5=_[_0x79f3('0x2b')](_0x2d082c[_0x79f3('0x4b')],function(_0x28f7f8){_0x28f7f8['userProfileId']=_0x2d082c[_0x79f3('0x44')]['id'];return _0x28f7f8;});return db['UserProfileSection'][_0x79f3('0x68')](_0xd2c1b5,{'raw':!![],'transaction':_0xe190cf});})[_0x79f3('0x26')](function(_0x4cf6b3){var _0x536380=_[_0x79f3('0x3d')](_[_0x79f3('0x2b')](_0x4cf6b3,function(_0x171dfd){return _0x171dfd['get']({'plain':!![]});}),{'includeAll':![]});if(_0x536380){return db['UserProfileSection'][_0x79f3('0x41')]({'where':{'userProfileId':_0x2d082c['params']['id'],'sectionId':_[_0x79f3('0x2b')](_0x536380,function(_0x4d50ab){return _0x4d50ab['sectionId'];})},'attributes':['id',_0x79f3('0x58')],'raw':!![]})[_0x79f3('0x26')](function(_0x489fce){var _0x4d4298=_[_0x79f3('0x2b')](_0x2d082c[_0x79f3('0x4b')],function(_0x378a5f){_0x378a5f['userProfileId']=_0x2d082c[_0x79f3('0x44')]['id'];return _0x378a5f;});return db[_0x79f3('0x59')][_0x79f3('0x68')](_0x4d4298,{'raw':!![],'transaction':_0xe190cf});});}})[_0x79f3('0x49')](handleError(_0x30ba6d,null));});}})[_0x79f3('0x26')](function(_0x32837f){var _0x5662fb=_[_0x79f3('0x2b')](_0x32837f,function(_0x3b96d0){return _0x3b96d0[_0x79f3('0x4d')]({'plain':!![]});});})[_0x79f3('0x26')](respondWithResult(_0x30ba6d,null))['catch'](handleError(_0x30ba6d,null));};exports[_0x79f3('0x69')]=function(_0x548422,_0x3fcb0f,_0xbd1cad){return db[_0x79f3('0x2c')]['find']({'where':{'id':_0x548422[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](handleEntityNotFound(_0x3fcb0f,null))[_0x79f3('0x26')](function(_0x2e5307){if(_0x2e5307){return _0x2e5307['removeResources'](_0x548422[_0x79f3('0x32')][_0x79f3('0x5c')]);}})[_0x79f3('0x26')](respondWithStatusCode(_0x3fcb0f,null))['catch'](handleError(_0x3fcb0f,null));};exports[_0x79f3('0x6a')]=function(_0x22b4f5,_0x3ccaf7){var _0x5b2a18={};if(!_0x22b4f5[_0x79f3('0x32')][_0x79f3('0x6b')])throw new Error(_0x79f3('0x6c'));if(!_0x22b4f5[_0x79f3('0x32')][_0x79f3('0x36')](_0x79f3('0x37'))){_0x5b2a18['limit']=qs[_0x79f3('0x1f')](_0x22b4f5['query'][_0x79f3('0x1f')]);_0x5b2a18[_0x79f3('0x1d')]=qs[_0x79f3('0x1d')](_0x22b4f5[_0x79f3('0x32')][_0x79f3('0x1d')]);}return db[_0x79f3('0x2c')][_0x79f3('0x48')]({'where':{'id':_0x22b4f5[_0x79f3('0x44')]['id']}})[_0x79f3('0x26')](function(_0x345206){if(!_0x345206)throw new Error(_0x79f3('0x6d')+_0x22b4f5['params']['id']);return db[_0x79f3('0x2c')][_0x79f3('0x6a')](_0x22b4f5);})['then'](respondWithFilteredResult(_0x3ccaf7,_0x5b2a18))[_0x79f3('0x49')](handleError(_0x3ccaf7,null));}; \ No newline at end of file +var _0x72a1=['bulkCreate','removeResources','getResources','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','each','autoAssociation','findAll','sectionId','Resources','UserProfileSection','UserProfileResource','sequelize','ids','getSections','isEmpty','includes','subsections','enabled','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','userProfileId'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x72a1,0x1ce));var _0x172a=function(_0x335c1b,_0x200d2b){_0x335c1b=_0x335c1b-0x0;var _0x5355b9=_0x72a1[_0x335c1b];return _0x5355b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x172a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x172a('0x1'));var rp=require('request-promise');var moment=require(_0x172a('0x2'));var BPromise=require(_0x172a('0x3'));var Mustache=require(_0x172a('0x4'));var util=require('util');var path=require(_0x172a('0x5'));var sox=require('sox');var csv=require(_0x172a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x172a('0x7'));var _=require('lodash');var squel=require(_0x172a('0x8'));var crypto=require(_0x172a('0x9'));var jsforce=require(_0x172a('0xa'));var deskjs=require(_0x172a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x172a('0xc'));var Papa=require('papaparse');var Redis=require(_0x172a('0xd'));var authService=require(_0x172a('0xe'));var qs=require(_0x172a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x172a('0x10'));var logger=require(_0x172a('0x11'))(_0x172a('0x12'));var utils=require(_0x172a('0x13'));var config=require(_0x172a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x172a('0x15'))['db'];config[_0x172a('0x16')]=_[_0x172a('0x17')](config[_0x172a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x172a('0x18'))(new Redis(config[_0x172a('0x16')]));require(_0x172a('0x19'))['register'](socket);function respondWithStatusCode(_0x27c548,_0x2a2648){_0x2a2648=_0x2a2648||0xcc;return function(_0x570fa8){if(_0x570fa8){return _0x27c548[_0x172a('0x1a')](_0x2a2648);}return _0x27c548['status'](_0x2a2648)[_0x172a('0x1b')]();};}function respondWithResult(_0x100d2b,_0x584117){_0x584117=_0x584117||0xc8;return function(_0x3823fa){if(_0x3823fa){return _0x100d2b['status'](_0x584117)[_0x172a('0x1c')](_0x3823fa);}};}function respondWithFilteredResult(_0x3cd44f,_0x31c425){return function(_0x5ad6ec){if(_0x5ad6ec){var _0x159f29=typeof _0x31c425[_0x172a('0x1d')]===_0x172a('0x1e')&&typeof _0x31c425[_0x172a('0x1f')]===_0x172a('0x1e');var _0x222584=_0x5ad6ec[_0x172a('0x20')];var _0x25172a=_0x159f29?0x0:_0x31c425['offset'];var _0x4e4d94=_0x159f29?_0x5ad6ec[_0x172a('0x20')]:_0x31c425[_0x172a('0x1d')]+_0x31c425[_0x172a('0x1f')];var _0x406dd8;if(_0x4e4d94>=_0x222584){_0x4e4d94=_0x222584;_0x406dd8=0xc8;}else{_0x406dd8=0xce;}_0x3cd44f[_0x172a('0x21')](_0x406dd8);return _0x3cd44f[_0x172a('0x22')](_0x172a('0x23'),_0x25172a+'-'+_0x4e4d94+'/'+_0x222584)[_0x172a('0x1c')](_0x5ad6ec);}return null;};}function patchUpdates(_0x47cbfd){return function(_0x553721){try{jsonpatch[_0x172a('0x24')](_0x553721,_0x47cbfd,!![]);}catch(_0xb44494){return BPromise[_0x172a('0x25')](_0xb44494);}return _0x553721[_0x172a('0x26')]();};}function saveUpdates(_0x5a9beb,_0x593ac2){return function(_0x415bcd){if(_0x415bcd){return _0x415bcd[_0x172a('0x27')](_0x5a9beb)[_0x172a('0x28')](function(_0x52a9df){return _0x52a9df;});}return null;};}function removeEntity(_0x5cbc26,_0x526636){return function(_0x3a01ef){if(_0x3a01ef){return _0x3a01ef[_0x172a('0x29')]()[_0x172a('0x28')](function(){_0x5cbc26[_0x172a('0x21')](0xcc)[_0x172a('0x1b')]();});}};}function handleEntityNotFound(_0x9b2fac,_0x45a671){return function(_0xf6086){if(!_0xf6086){_0x9b2fac[_0x172a('0x1a')](0x194);}return _0xf6086;};}function handleError(_0x21b004,_0x409728){_0x409728=_0x409728||0x1f4;return function(_0x3b13bf){logger[_0x172a('0x2a')](_0x3b13bf[_0x172a('0x2b')]);if(_0x3b13bf['name']){delete _0x3b13bf[_0x172a('0x2c')];}_0x21b004[_0x172a('0x21')](_0x409728)[_0x172a('0x2d')](_0x3b13bf);};}exports[_0x172a('0x2e')]=function(_0x4fd2d0,_0x5b61be){var _0x585b09={},_0x473ca2={},_0x876b16={'count':0x0,'rows':[]};var _0x569e25=_['map'](db[_0x172a('0x2f')][_0x172a('0x30')],function(_0x199316){return{'name':_0x199316[_0x172a('0x31')],'type':_0x199316[_0x172a('0x32')][_0x172a('0x33')]};});_0x473ca2[_0x172a('0x34')]=_[_0x172a('0x35')](_0x569e25,_0x172a('0x2c'));_0x473ca2[_0x172a('0x36')]=_[_0x172a('0x37')](_0x4fd2d0[_0x172a('0x36')]);_0x473ca2[_0x172a('0x38')]=_[_0x172a('0x39')](_0x473ca2[_0x172a('0x34')],_0x473ca2[_0x172a('0x36')]);_0x585b09['attributes']=_['intersection'](_0x473ca2[_0x172a('0x34')],qs[_0x172a('0x3a')](_0x4fd2d0[_0x172a('0x36')][_0x172a('0x3a')]));_0x585b09['attributes']=_0x585b09[_0x172a('0x3b')][_0x172a('0x3c')]?_0x585b09[_0x172a('0x3b')]:_0x473ca2['model'];if(!_0x4fd2d0['query']['hasOwnProperty'](_0x172a('0x3d'))){_0x585b09[_0x172a('0x1f')]=qs[_0x172a('0x1f')](_0x4fd2d0['query'][_0x172a('0x1f')]);_0x585b09[_0x172a('0x1d')]=qs['offset'](_0x4fd2d0[_0x172a('0x36')][_0x172a('0x1d')]);}_0x585b09[_0x172a('0x3e')]=qs[_0x172a('0x3f')](_0x4fd2d0[_0x172a('0x36')]['sort']);_0x585b09[_0x172a('0x40')]=qs['filters'](_[_0x172a('0x41')](_0x4fd2d0[_0x172a('0x36')],_0x473ca2[_0x172a('0x38')]),_0x569e25);if(_0x4fd2d0[_0x172a('0x36')][_0x172a('0x42')]){_0x585b09[_0x172a('0x40')]=_[_0x172a('0x43')](_0x585b09[_0x172a('0x40')],{'$or':_[_0x172a('0x35')](_0x569e25,function(_0x511509){if(_0x511509[_0x172a('0x32')]!==_0x172a('0x44')){var _0x3819f6={};_0x3819f6[_0x511509[_0x172a('0x2c')]]={'$like':'%'+_0x4fd2d0[_0x172a('0x36')][_0x172a('0x42')]+'%'};return _0x3819f6;}})});}_0x585b09=_[_0x172a('0x43')]({},_0x585b09,_0x4fd2d0[_0x172a('0x45')]);var _0x1da47a={'where':_0x585b09['where']};return db[_0x172a('0x2f')][_0x172a('0x20')](_0x1da47a)['then'](function(_0x7fdf7d){_0x876b16['count']=_0x7fdf7d;if(_0x4fd2d0['query']['includeAll']){_0x585b09[_0x172a('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x585b09);})['then'](function(_0x14b060){_0x876b16[_0x172a('0x47')]=_0x14b060;return _0x876b16;})[_0x172a('0x28')](respondWithFilteredResult(_0x5b61be,_0x585b09))['catch'](handleError(_0x5b61be,null));};exports[_0x172a('0x48')]=function(_0x2f791c,_0x21f896){var _0x4039fb={'raw':![],'where':{'id':_0x2f791c[_0x172a('0x49')]['id']}},_0x5214b9={};_0x5214b9[_0x172a('0x34')]=_[_0x172a('0x37')](db['UserProfile'][_0x172a('0x30')]);_0x5214b9[_0x172a('0x36')]=_[_0x172a('0x37')](_0x2f791c[_0x172a('0x36')]);_0x5214b9[_0x172a('0x38')]=_[_0x172a('0x39')](_0x5214b9[_0x172a('0x34')],_0x5214b9[_0x172a('0x36')]);_0x4039fb[_0x172a('0x3b')]=_[_0x172a('0x39')](_0x5214b9[_0x172a('0x34')],qs[_0x172a('0x3a')](_0x2f791c[_0x172a('0x36')]['fields']));_0x4039fb[_0x172a('0x3b')]=_0x4039fb[_0x172a('0x3b')][_0x172a('0x3c')]?_0x4039fb['attributes']:_0x5214b9[_0x172a('0x34')];if(_0x2f791c['query'][_0x172a('0x4a')]){_0x4039fb[_0x172a('0x46')]=[{'all':!![]}];}_0x4039fb=_[_0x172a('0x43')]({},_0x4039fb,_0x2f791c[_0x172a('0x45')]);return db[_0x172a('0x2f')][_0x172a('0x4b')](_0x4039fb)[_0x172a('0x28')](handleEntityNotFound(_0x21f896,null))['then'](respondWithResult(_0x21f896,null))[_0x172a('0x4c')](handleError(_0x21f896,null));};exports[_0x172a('0x4d')]=function(_0x3394f9,_0x52fa39){return db[_0x172a('0x2f')][_0x172a('0x4d')](_0x3394f9['body'],{})[_0x172a('0x28')](respondWithResult(_0x52fa39,0xc9))[_0x172a('0x4c')](handleError(_0x52fa39,null));};exports[_0x172a('0x4e')]=function(_0x38be9b,_0x1cd3a0){var _0x4b2cee={'where':{'id':_0x38be9b[_0x172a('0x49')]['id']}},_0x2bbe93={};_0x2bbe93[_0x172a('0x34')]=_[_0x172a('0x37')](db[_0x172a('0x2f')]['rawAttributes']);_0x4b2cee[_0x172a('0x3b')]=_[_0x172a('0x39')](_0x2bbe93[_0x172a('0x34')],qs[_0x172a('0x3a')](_0x38be9b[_0x172a('0x36')][_0x172a('0x3a')]));_0x4b2cee[_0x172a('0x3b')]=_0x4b2cee[_0x172a('0x3b')][_0x172a('0x3c')]?_0x4b2cee[_0x172a('0x3b')]:_0x2bbe93[_0x172a('0x34')];if(_0x38be9b['query']['includeAll']){_0x4b2cee[_0x172a('0x46')]=[{'all':!![]}];}_0x4b2cee=_[_0x172a('0x43')]({},_0x4b2cee,_0x38be9b[_0x172a('0x45')]);return db[_0x172a('0x2f')][_0x172a('0x4b')](_0x4b2cee)[_0x172a('0x28')](handleEntityNotFound(_0x1cd3a0,null))[_0x172a('0x28')](function(_0x4bf02a){if(_0x4bf02a){var _0x201a9c=_0x4bf02a[_0x172a('0x4f')]({'plain':!![]});_0x201a9c=qs[_0x172a('0x50')](_0x201a9c,['id',_0x172a('0x51'),_0x172a('0x52'),_0x172a('0x53')]);_0x38be9b[_0x172a('0x54')]=_[_0x172a('0x50')](_0x38be9b[_0x172a('0x54')],['id','createdAt','updatedAt']);return db['sequelize'][_0x172a('0x55')](function(_0x5523b0){return db[_0x172a('0x2f')][_0x172a('0x4d')](_[_0x172a('0x43')](_0x201a9c,_0x38be9b[_0x172a('0x54')]),{'include':_0x38be9b[_0x172a('0x36')][_0x172a('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x5523b0})[_0x172a('0x28')](function(_0x3e2128){var _0x5bead3=_0x3e2128['get']({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x38be9b[_0x172a('0x49')]['id']},'raw':!![]})[_0x172a('0x28')](function(_0x1f0184){if(_0x1f0184){return BPromise[_0x172a('0x56')](_0x1f0184,function(_0x1f3004){return new BPromise(function(_0xd8f8f1,_0x4697df){if(_0x1f3004[_0x172a('0x57')]===null||_0x1f3004[_0x172a('0x57')]===0x1)_0xd8f8f1(null);return db['UserProfileResource'][_0x172a('0x58')]({'where':{'sectionId':_0x1f3004['id']},'raw':!![]})[_0x172a('0x28')](function(_0x34ae8d){var _0x65f70=_[_0x172a('0x35')](_0x34ae8d,function(_0x214b90){return qs['omit'](_0x214b90,['id',_0x172a('0x51'),_0x172a('0x52'),_0x172a('0x59')]);});_0xd8f8f1(_0x65f70);})[_0x172a('0x4c')](function(_0x22396a){_0x4697df(_0x22396a);});})[_0x172a('0x28')](function(_0x4a2302){var _0x3cf4ef=qs[_0x172a('0x50')](_0x1f3004,['id','createdAt',_0x172a('0x52')]);_0x3cf4ef['userProfileId']=_0x5bead3['id'];if(_0x4a2302)_0x3cf4ef[_0x172a('0x5a')]=_0x4a2302;return _0x3cf4ef;})[_0x172a('0x28')](function(_0x4e906a){return db[_0x172a('0x5b')][_0x172a('0x4d')](_0x4e906a,{'include':[{'model':db[_0x172a('0x5c')],'as':_0x172a('0x5a')}],'raw':!![],'transaction':_0x5523b0});});})[_0x172a('0x28')](function(){return _0x5bead3;});}});});});}})[_0x172a('0x28')](respondWithResult(_0x1cd3a0,0xc9))['catch'](handleError(_0x1cd3a0,null));};exports[_0x172a('0x27')]=function(_0x391df0,_0x5a286c){if(_0x391df0[_0x172a('0x54')]['id']){delete _0x391df0['body']['id'];}return db['UserProfile'][_0x172a('0x4b')]({'where':{'id':_0x391df0[_0x172a('0x49')]['id']}})[_0x172a('0x28')](handleEntityNotFound(_0x5a286c,null))[_0x172a('0x28')](saveUpdates(_0x391df0[_0x172a('0x54')],null))[_0x172a('0x28')](respondWithResult(_0x5a286c,null))['catch'](handleError(_0x5a286c,null));};exports[_0x172a('0x29')]=function(_0xc163aa,_0x9beabb){return db[_0x172a('0x2f')]['find']({'where':{'id':_0xc163aa[_0x172a('0x49')]['id']}})[_0x172a('0x28')](handleEntityNotFound(_0x9beabb,null))[_0x172a('0x28')](removeEntity(_0x9beabb,null))[_0x172a('0x4c')](handleError(_0x9beabb,null));};exports['describe']=function(_0x871187,_0x50e1b9){return db[_0x172a('0x2f')]['describe']()[_0x172a('0x28')](respondWithResult(_0x50e1b9,null))[_0x172a('0x4c')](handleError(_0x50e1b9,null));};exports['addSections']=function(_0x2f11ba,_0x53d86a){var _0x559c4c=_0x2f11ba[_0x172a('0x54')];return db['UserProfile']['find']({'where':{'id':_0x2f11ba[_0x172a('0x49')]['id']}})[_0x172a('0x28')](handleEntityNotFound(_0x53d86a,null))['then'](function(_0x434e8a){if(_0x434e8a){return db[_0x172a('0x5d')][_0x172a('0x55')](function(_0x257916){return db[_0x172a('0x5b')][_0x172a('0x29')]({'where':{'userProfileId':_0x2f11ba['params']['id'],'sectionId':_[_0x172a('0x35')](_0x559c4c,function(_0x27455f){return _0x27455f[_0x172a('0x59')];})},'transaction':_0x257916})[_0x172a('0x28')](function(){var _0x4db30a=_[_0x172a('0x35')](_0x559c4c,function(_0x458016){_0x458016['userProfileId']=_0x2f11ba[_0x172a('0x49')]['id'];return _0x458016;});var _0x264ada=[];return BPromise[_0x172a('0x56')](_0x4db30a,function(_0x2d002e){return db[_0x172a('0x5b')]['create'](_0x2d002e,{'include':[{'model':db[_0x172a('0x5c')],'as':_0x172a('0x5a')}],'raw':!![],'transaction':_0x257916})[_0x172a('0x28')](function(_0xb98064){_0x264ada['push'](_0xb98064['get']({'plain':!![]}));});})[_0x172a('0x28')](function(){return _0x264ada;});});});}})[_0x172a('0x28')](function(_0x3b1c33){return _0x3b1c33;})[_0x172a('0x28')](respondWithResult(_0x53d86a,null))[_0x172a('0x4c')](handleError(_0x53d86a,null));};exports['removeSections']=function(_0x1a7908,_0x55c791){var _0xf0a3bd;return db[_0x172a('0x2f')][_0x172a('0x4b')]({'where':{'id':_0x1a7908[_0x172a('0x49')]['id']},'attributes':['id',_0x172a('0x2c')]})['then'](handleEntityNotFound(_0x55c791,null))[_0x172a('0x28')](function(_0x4db17f){if(_0x4db17f){_0xf0a3bd=_0x4db17f;return db[_0x172a('0x5b')][_0x172a('0x29')]({'where':{'userProfileId':_0x1a7908[_0x172a('0x49')]['id'],'sectionId':_0x1a7908[_0x172a('0x36')][_0x172a('0x5e')]}});}})[_0x172a('0x28')](function(){return _0xf0a3bd;})[_0x172a('0x28')](respondWithStatusCode(_0x55c791,null))[_0x172a('0x4c')](handleError(_0x55c791,null));};exports[_0x172a('0x5f')]=function(_0x538fd3,_0x314f38){var _0x1008c7=[];var _0x343423=[];return db[_0x172a('0x5b')][_0x172a('0x58')]({'where':{'userProfileId':_0x538fd3['params']['id']},'raw':!![]})[_0x172a('0x28')](function(_0x1c0f41){_0x1008c7=_[_0x172a('0x42')](_0x1c0f41,function(_0x41d8ba){return _0x41d8ba['enabled']===0x1||_['includes']([0x3eb,0x709],_0x41d8ba[_0x172a('0x59')]);});if(!_[_0x172a('0x60')](_0x1008c7)){return _[_0x172a('0x35')](_0x1008c7,function(_0x295687){return _0x295687[_0x172a('0x59')];});}else{return;}})[_0x172a('0x28')](function(_0xd677b8){if(_0xd677b8)_0x343423=_0xd677b8;if(_[_0x172a('0x61')](_0x343423,0x64)){var _0x2f1e36=_[_0x172a('0x4b')](_0x1008c7,{'sectionId':0x64});return hasDefaultDashboard(_0x2f1e36)[_0x172a('0x28')](function(_0xa04423){return _[_0x172a('0x35')](_0x1008c7,function(_0x288324){if(_0x288324[_0x172a('0x59')]===0x64){_0x288324[_0x172a('0x62')]=_0xa04423;}return _0x288324;});});}else{return;}})[_0x172a('0x28')](function(_0x19377b){if(_0x19377b)_0x1008c7=_0x19377b;if(_['includes'](_0x343423,0x3eb)){var _0xfb0e2b=_[_0x172a('0x4b')](_0x1008c7,{'sectionId':0x3eb});return getCustomDashboards(_0xfb0e2b)['then'](function(_0x43d99d){return _[_0x172a('0x35')](_0x1008c7,function(_0x33ee9a){if(_0xfb0e2b[_0x172a('0x63')]){if(_0x33ee9a[_0x172a('0x59')]===0x3eb){_0x33ee9a[_0x172a('0x62')]=_0x43d99d;}}else{if(_0x33ee9a[_0x172a('0x59')]===0x64){_0x33ee9a[_0x172a('0x62')]=_0x43d99d;}}return _0x33ee9a;});});}else{return;}})[_0x172a('0x28')](function(_0x2f3b07){if(_0x2f3b07)_0x1008c7=_0x2f3b07;if(_[_0x172a('0x61')](_0x343423,0x709)){var _0x870c39=_[_0x172a('0x4b')](_0x1008c7,{'sectionId':0x709});return getPlugins(_0x870c39)[_0x172a('0x28')](function(_0x452e14){if(_0x870c39[_0x172a('0x63')]){return _[_0x172a('0x35')](_0x1008c7,function(_0x27f420){if(_0x27f420[_0x172a('0x59')]===0x709){_0x27f420[_0x172a('0x62')]=_0x452e14;}return _0x27f420;});}else{var _0x50da32={'sectionId':0x76c,'enabled':0x1,'subsections':_0x452e14};var _0x408944=_[_0x172a('0x35')](_0x1008c7);_0x408944[_0x172a('0x64')](_0x50da32);return _0x408944;}});}else{return;}})['then'](function(_0x305ef7){if(_0x305ef7)_0x1008c7=_0x305ef7;return _[_0x172a('0x42')](_0x1008c7,[_0x172a('0x63'),0x1]);})[_0x172a('0x28')](respondWithResult(_0x314f38,null))[_0x172a('0x4c')](handleError(_0x314f38,null));};function hasDefaultDashboard(_0x1e0659){var _0x5ad543=[0x65];return new BPromise(function(_0x2c4198,_0x11f905){try{if(_0x1e0659[_0x172a('0x57')]){_0x2c4198(_0x5ad543);}else{return db['UserProfileResource'][_0x172a('0x65')]({'where':{'sectionId':_0x1e0659['id']},'raw':!![]})[_0x172a('0x28')](function(_0x1368e7){_0x1368e7?_0x2c4198(_0x5ad543):_0x2c4198();});}}catch(_0x1a5fd4){_0x11f905(_0x1a5fd4);}});}function getCustomDashboards(_0x35923e){var _0x3fe0e9=[];return new BPromise(function(_0xf732aa,_0x414c91){try{if(_0x35923e[_0x172a('0x57')]){return db[_0x172a('0x66')][_0x172a('0x58')]({'raw':!![]})[_0x172a('0x28')](function(_0x3ccaee){_0x3ccaee[_0x172a('0x67')](function(_0x1b0286){_0x3fe0e9[_0x172a('0x64')](_0x1b0286['id']+0x1869f);});_0xf732aa(_0x3fe0e9);});}else{return db['UserProfileResource'][_0x172a('0x58')]({'where':{'sectionId':_0x35923e['id']},'raw':!![]})['then'](function(_0x407165){_0x407165['forEach'](function(_0x2887d6){_0x3fe0e9[_0x172a('0x64')](_0x2887d6[_0x172a('0x68')]+0x1869f);});_0xf732aa(_0x3fe0e9);});}}catch(_0x13af22){_0x414c91(_0x13af22);}});}function getPlugins(_0x14d9ee){var _0x4047c0=[];return new BPromise(function(_0x8facf7,_0x397a3e){try{if(_0x14d9ee[_0x172a('0x57')]){return db[_0x172a('0x69')][_0x172a('0x58')]({'raw':!![]})[_0x172a('0x28')](function(_0x5960ed){_0x5960ed[_0x172a('0x67')](function(_0x1c9bb5){_0x4047c0['push'](_0x1c9bb5['id']+0x15b38);});_0x8facf7(_0x4047c0);});}else{return db[_0x172a('0x5c')]['findAll']({'where':{'sectionId':_0x14d9ee['id']},'raw':!![]})['then'](function(_0x506fbc){_0x506fbc[_0x172a('0x67')](function(_0x3bc50c){_0x4047c0[_0x172a('0x64')](_0x3bc50c[_0x172a('0x68')]+0x15b38);});_0x8facf7(_0x4047c0);});}}catch(_0x33bacf){_0x397a3e(_0x33bacf);}});}exports[_0x172a('0x6a')]=function(_0x3ad3fb,_0x9f9ffd){return db[_0x172a('0x2f')]['find']({'where':{'id':_0x3ad3fb[_0x172a('0x49')]['id']}})['then'](handleEntityNotFound(_0x9f9ffd,null))[_0x172a('0x28')](function(_0x39e654){if(_0x39e654){return db[_0x172a('0x5d')][_0x172a('0x55')](function(_0x208bbe){return db[_0x172a('0x5b')][_0x172a('0x58')]({'where':{'userProfileId':_0x3ad3fb[_0x172a('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x172a('0x28')](function(_0x41bb68){if(_0x41bb68){return db['UserProfileSection'][_0x172a('0x29')]({'where':{'userProfileId':_0x3ad3fb[_0x172a('0x49')]['id'],'id':_['map'](_0x41bb68,function(_0x33c2f6){return _0x33c2f6['id'];})},'transaction':_0x208bbe});}})[_0x172a('0x28')](function(_0x475672){var _0x56ed9f=_[_0x172a('0x35')](_0x3ad3fb[_0x172a('0x54')],function(_0xf7b9eb){_0xf7b9eb[_0x172a('0x6b')]=_0x3ad3fb[_0x172a('0x49')]['id'];return _0xf7b9eb;});return db[_0x172a('0x5b')][_0x172a('0x6c')](_0x56ed9f,{'raw':!![],'transaction':_0x208bbe});})['then'](function(_0x496dd9){var _0x27da2b=_['filter'](_['map'](_0x496dd9,function(_0x3cb4a1){return _0x3cb4a1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x27da2b){return db[_0x172a('0x5b')][_0x172a('0x58')]({'where':{'userProfileId':_0x3ad3fb[_0x172a('0x49')]['id'],'sectionId':_[_0x172a('0x35')](_0x27da2b,function(_0x37d119){return _0x37d119[_0x172a('0x59')];})},'attributes':['id',_0x172a('0x59')],'raw':!![]})[_0x172a('0x28')](function(_0x1b5cc2){var _0x276ede=_[_0x172a('0x35')](_0x3ad3fb[_0x172a('0x54')],function(_0xd534){_0xd534[_0x172a('0x6b')]=_0x3ad3fb['params']['id'];return _0xd534;});return db[_0x172a('0x5c')][_0x172a('0x6c')](_0x276ede,{'raw':!![],'transaction':_0x208bbe});});}})[_0x172a('0x4c')](handleError(_0x9f9ffd,null));});}})[_0x172a('0x28')](function(_0x219216){var _0x25093c=_[_0x172a('0x35')](_0x219216,function(_0x2720b8){return _0x2720b8[_0x172a('0x4f')]({'plain':!![]});});})[_0x172a('0x28')](respondWithResult(_0x9f9ffd,null))[_0x172a('0x4c')](handleError(_0x9f9ffd,null));};exports[_0x172a('0x6d')]=function(_0x40059e,_0x2c3825,_0x4616dd){return db['UserProfile'][_0x172a('0x4b')]({'where':{'id':_0x40059e['params']['id']}})[_0x172a('0x28')](handleEntityNotFound(_0x2c3825,null))['then'](function(_0x132317){if(_0x132317){return _0x132317['removeResources'](_0x40059e[_0x172a('0x36')][_0x172a('0x5e')]);}})[_0x172a('0x28')](respondWithStatusCode(_0x2c3825,null))[_0x172a('0x4c')](handleError(_0x2c3825,null));};exports[_0x172a('0x6e')]=function(_0x428941,_0x43bc59){var _0x57c7d9={};if(!_0x428941[_0x172a('0x36')][_0x172a('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x428941[_0x172a('0x36')][_0x172a('0x70')](_0x172a('0x3d'))){_0x57c7d9['limit']=qs[_0x172a('0x1f')](_0x428941[_0x172a('0x36')][_0x172a('0x1f')]);_0x57c7d9[_0x172a('0x1d')]=qs['offset'](_0x428941[_0x172a('0x36')][_0x172a('0x1d')]);}return db[_0x172a('0x2f')][_0x172a('0x4b')]({'where':{'id':_0x428941[_0x172a('0x49')]['id']}})['then'](function(_0x25414d){if(!_0x25414d)throw new Error(_0x172a('0x71')+_0x428941[_0x172a('0x49')]['id']);return db[_0x172a('0x2f')][_0x172a('0x6e')](_0x428941);})[_0x172a('0x28')](respondWithFilteredResult(_0x43bc59,_0x57c7d9))[_0x172a('0x4c')](handleError(_0x43bc59,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8fafd79..b54cc5a 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 _0x341c=['update','remove','emit','hasOwnProperty','hook','exports','events','UserProfile','save'];(function(_0x20ab74,_0xd9c900){var _0x1e704a=function(_0x388336){while(--_0x388336){_0x20ab74['push'](_0x20ab74['shift']());}};_0x1e704a(++_0xd9c900);}(_0x341c,0xcc));var _0xc341=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x341c[_0x2f3ecd];return _0xffdc44;};'use strict';var EventEmitter=require(_0xc341('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xc341('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc341('0x2'),'afterUpdate':_0xc341('0x3'),'afterDestroy':_0xc341('0x4')};function emitEvent(_0x40d92f){return function(_0x4c74c5,_0x3e07f8,_0x3ab689){UserProfileEvents[_0xc341('0x5')](_0x40d92f+':'+_0x4c74c5['id'],_0x4c74c5);UserProfileEvents['emit'](_0x40d92f,_0x4c74c5);_0x3ab689(null);};}for(var e in events){if(events[_0xc341('0x6')](e)){var event=events[e];UserProfile[_0xc341('0x7')](e,emitEvent(event));}}module[_0xc341('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x1298=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x1298,0x19e));var _0x8129=function(_0x885bc3,_0x1ed6d6){_0x885bc3=_0x885bc3-0x0;var _0x57fab0=_0x1298[_0x885bc3];return _0x57fab0;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8129('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8129('0x1')](0x0);var events={'afterCreate':_0x8129('0x2'),'afterUpdate':_0x8129('0x3'),'afterDestroy':_0x8129('0x4')};function emitEvent(_0x6031b2){return function(_0x31d02a,_0x39e214,_0x4fbaf9){UserProfileEvents[_0x8129('0x5')](_0x6031b2+':'+_0x31d02a['id'],_0x31d02a);UserProfileEvents[_0x8129('0x5')](_0x6031b2,_0x31d02a);_0x4fbaf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x8129('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index e5dd114..f57b03f 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 _0x53a8=['UserProfileResource','then','resourceId','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','CmContact','ListId','companies','CmCompany','globalcustomfields','chatqueues','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','type','outbound','musiconholds','VoiceMusicOnHold','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','Interval','Pause','sounds','Sound','Tag','templates','Template','triggers','Trigger','Variable','Plugin','extractedreports','AnalyticExtractedReport','Reports','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','ignore','union','find','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','default','reportId','DefaultReports','custom','CustomReports','count','ids','customSorting','extraQueryConditions','include','Tags','color','ThroughTags','tag','rows','openTabs','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','filter','field','value','associatedResources','map','catch','model','findAll','resolve'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x53a8,0xae));var _0x853a=function(_0x4e317f,_0x464c25){_0x4e317f=_0x4e317f-0x0;var _0x7066c7=_0x53a8[_0x4e317f];return _0x7066c7;};'use strict';var _=require(_0x853a('0x0'));var attributes=require(_0x853a('0x1'));var qs=require(_0x853a('0x2'));var squel=require(_0x853a('0x3'));module['exports']=function(_0x37a892){var _0x4e5236=_0x37a892['models'];function _0x4891c9(_0x15d32a,_0x4b2cc2){return new Promise(function(_0x22af7e,_0x113933){if(!_0x4b2cc2)return _0x22af7e(null);var _0x5c41b5=_0x4b2cc2[_0x853a('0x4')]?{[_0x4b2cc2[_0x853a('0x4')][_0x853a('0x5')]]:_0x4b2cc2[_0x853a('0x4')][_0x853a('0x6')]}:undefined;return _0x4e5236[_0x15d32a]['findAll']({'where':_0x5c41b5,'raw':!![]})['then'](function(_0x4c7a6c){_0x4b2cc2[_0x853a('0x7')]=_[_0x853a('0x8')](_0x4c7a6c,'id');_0x22af7e(_0x4b2cc2);})[_0x853a('0x9')](function(_0x1e6d03){_0x113933(_0x1e6d03);});});}function _0x35ea27(_0xae7550,_0x37f669){return new Promise(function(_0x115083,_0x247edc){var _0x4b3783=_0xae7550[_0x853a('0x4')]?{[_0xae7550['filter']['field']]:_0xae7550[_0x853a('0x4')][_0x853a('0x6')]}:undefined;return _0x4e5236[_0xae7550[_0x853a('0xa')]][_0x853a('0xb')]({'where':_0x4b3783,'raw':!![]})['then'](function(_0x2814ff){_0x37f669[_0x853a('0x7')]=_[_0x853a('0x8')](_0x2814ff,function(_0x296690){return _0x296690['name'];});_0x115083(_0x37f669);})['catch'](function(_0x389d5b){_0x247edc(_0x389d5b);});});}function _0x417067(_0x172c6c,_0xf2fc71,_0x2ed575){if(!_0xf2fc71)return Promise[_0x853a('0xc')](null);return new Promise(function(_0x239814,_0x2f59d0){return _0x4e5236[_0x853a('0xd')][_0x853a('0xb')]({'where':{'sectionId':_0xf2fc71['id']},'raw':!![]})[_0x853a('0xe')](function(_0x44fdd0){if(_0x172c6c[_0x853a('0x5')]&&_0x172c6c[_0x853a('0x5')]!=='id'){_0xf2fc71[_0x853a('0x7')]=_[_0x853a('0x8')](_0x44fdd0,function(_0x16c7ef){return _0x16c7ef[_0x172c6c[_0x853a('0x5')]];});}else{if(_0x2ed575==='AnalyticExtractedReport'){_0xf2fc71[_0x853a('0x7')]=_['map'](_0x44fdd0,function(_0x2ea0b5){return{'id':_0x2ea0b5['resourceId'],'type':_0x2ea0b5['type']};});}else{_0xf2fc71[_0x853a('0x7')]=_[_0x853a('0x8')](_0x44fdd0,function(_0x155c34){return _0x155c34[_0x853a('0xf')];});}}_0x239814(_0xf2fc71);})[_0x853a('0x9')](function(_0x453a16){_0x2f59d0(_0x453a16);});});}function _0x2cbe5a(_0x23a758,_0x42fe48){var _0x233926={'parentSections':[]};switch(_0x23a758['toLowerCase']()){case _0x853a('0x10'):_0x233926[_0x853a('0x11')]=_0x853a('0x12');break;case _0x853a('0x13'):_0x233926[_0x853a('0x11')]='SquareOdbc';break;case'squarerecordings':_0x233926[_0x853a('0x11')]=_0x853a('0x14');_0x233926[_0x853a('0x15')]=[{'name':_0x853a('0x16'),'field':_0x853a('0x17'),'foreignKey':_0x853a('0x18')}];break;case _0x853a('0x19'):_0x233926[_0x853a('0x11')]=_0x853a('0x1a');break;case'contacts':_0x233926[_0x853a('0x11')]=_0x853a('0x1b');_0x233926[_0x853a('0x15')]=[{'name':'Lists','field':'id','foreignKey':_0x853a('0x1c')}];break;case'lists':_0x233926[_0x853a('0x11')]='CmList';break;case _0x853a('0x1d'):_0x233926[_0x853a('0x11')]=_0x853a('0x1e');break;case _0x853a('0x1f'):_0x233926[_0x853a('0x11')]='CmCustomField';break;case _0x853a('0x20'):_0x233926[_0x853a('0x11')]='ChatQueue';break;case _0x853a('0x21'):_0x233926[_0x853a('0x11')]='ChatWebsite';break;case _0x853a('0x22'):_0x233926[_0x853a('0x11')]='FaxQueue';break;case _0x853a('0x23'):_0x233926[_0x853a('0x11')]=_0x853a('0x24');break;case _0x853a('0x25'):case _0x853a('0x26'):case _0x853a('0x27'):_0x233926[_0x853a('0x11')]=_0x853a('0x28');break;case _0x853a('0x29'):_0x233926[_0x853a('0x11')]=_0x853a('0x2a');break;case _0x853a('0x2b'):_0x233926[_0x853a('0x11')]=_0x853a('0x2c');break;case _0x853a('0x2d'):_0x233926[_0x853a('0x11')]=_0x853a('0x2e');_0x233926['parentSections']=[{'name':_0x853a('0x2f'),'field':_0x853a('0x17'),'foreignKey':_0x853a('0x30'),'model':_0x853a('0x31'),'filter':{'field':'role','value':[_0x853a('0x32')]}},{'name':_0x853a('0x33'),'field':'name','foreignKey':_0x853a('0x30'),'model':_0x853a('0x31'),'filter':{'field':_0x853a('0x34'),'value':[_0x853a('0x35')]}},{'name':_0x853a('0x36'),'field':_0x853a('0x17'),'foreignKey':_0x853a('0x37'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x853a('0x38')]}},{'name':_0x853a('0x39'),'field':_0x853a('0x17'),'foreignKey':_0x853a('0x37'),'model':_0x853a('0x3a'),'filter':{'field':_0x853a('0x3b'),'value':[_0x853a('0x3c')]}}];break;case _0x853a('0x3d'):_0x233926['childModel']=_0x853a('0x3e');break;case'chanspies':_0x233926[_0x853a('0x11')]='VoiceChanSpy';break;case'voiceprefixes':_0x233926['childModel']='VoicePrefix';break;case _0x853a('0x3f'):_0x233926[_0x853a('0x11')]='Campaign';break;case _0x853a('0x40'):_0x233926[_0x853a('0x11')]='MailQueue';break;case _0x853a('0x41'):_0x233926[_0x853a('0x11')]=_0x853a('0x42');break;case _0x853a('0x43'):_0x233926[_0x853a('0x11')]=_0x853a('0x44');break;case _0x853a('0x45'):_0x233926[_0x853a('0x11')]=_0x853a('0x46');break;case _0x853a('0x47'):_0x233926[_0x853a('0x11')]=_0x853a('0x48');break;case _0x853a('0x49'):_0x233926[_0x853a('0x11')]=_0x853a('0x4a');break;case _0x853a('0x4b'):_0x233926[_0x853a('0x11')]=_0x853a('0x4c');break;case _0x853a('0x4d'):_0x233926[_0x853a('0x11')]=_0x853a('0x4e');break;case _0x853a('0x4f'):_0x233926[_0x853a('0x11')]='WhatsappAccount';break;case _0x853a('0x50'):_0x233926[_0x853a('0x11')]=_0x853a('0x51');break;case _0x853a('0x52'):case _0x853a('0x53'):_0x233926[_0x853a('0x11')]=_0x853a('0x3a');if(_0x42fe48){_0x233926[_0x853a('0x15')]=[{'name':_0x853a('0x36')},{'name':_0x853a('0x39')}];}break;case _0x853a('0x54'):case'agents':case _0x853a('0x55'):_0x233926[_0x853a('0x11')]='User';if(_0x42fe48){_0x233926[_0x853a('0x15')]=[{'name':_0x853a('0x56'),'filter':{'field':_0x853a('0x34'),'value':[_0x853a('0x57'),_0x853a('0x58')]},'ignore':!![]},{'name':_0x853a('0x2f')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x233926[_0x853a('0x11')]=_0x853a('0x59');break;case _0x853a('0x5a'):_0x233926['childModel']=_0x853a('0x5b');break;case _0x853a('0x5c'):_0x233926[_0x853a('0x11')]=_0x853a('0x5d');break;case'sugarcrmaccounts':_0x233926['childModel']='SugarcrmAccount';break;case _0x853a('0x5e'):_0x233926[_0x853a('0x11')]='DeskAccount';break;case'zohoaccounts':_0x233926[_0x853a('0x11')]=_0x853a('0x5f');break;case _0x853a('0x60'):_0x233926[_0x853a('0x11')]=_0x853a('0x31');break;case'cannedanswers':_0x233926['childModel']='CannedAnswer';break;case _0x853a('0x61'):_0x233926['childModel']=_0x853a('0x62');break;case _0x853a('0x63'):_0x233926[_0x853a('0x11')]='Dashboard';break;case _0x853a('0x64'):_0x233926['childModel']=_0x853a('0x65');break;case'pauses':_0x233926[_0x853a('0x11')]=_0x853a('0x66');break;case'scheduler':_0x233926[_0x853a('0x11')]='Schedule';break;case _0x853a('0x67'):_0x233926[_0x853a('0x11')]=_0x853a('0x68');break;case'tags':_0x233926[_0x853a('0x11')]=_0x853a('0x69');break;case _0x853a('0x6a'):_0x233926[_0x853a('0x11')]=_0x853a('0x6b');break;case _0x853a('0x6c'):_0x233926[_0x853a('0x11')]=_0x853a('0x6d');break;case'trunks':_0x233926[_0x853a('0x11')]='Trunk';break;case'variables':_0x233926[_0x853a('0x11')]=_0x853a('0x6e');break;case'plugins':_0x233926[_0x853a('0x11')]=_0x853a('0x6f');break;case _0x853a('0x70'):_0x233926[_0x853a('0x11')]=_0x853a('0x71');_0x233926[_0x853a('0x15')]=[{'name':_0x853a('0x72'),'field':'id','foreignKey':'reportId'}];break;case _0x853a('0x73'):_0x233926[_0x853a('0x11')]=_0x853a('0x74');break;}return _0x233926;}function _0x3f4769(_0x3bffad,_0x1797a6){var _0x221520=_0x3bffad['charAt'](0x0)[_0x853a('0x75')]()+_0x3bffad[_0x853a('0x76')](0x1);var _0x5ed5f6={'type':_0x4e5236[_0x853a('0x77')][_0x853a('0x78')][_0x853a('0x79')],'raw':!![]};return new Promise(function(_0xe8cc70,_0xd44897){var _0x4e219f=squel['select']()[_0x853a('0x5')](_0x853a('0x7a')+_0x221520+_0x853a('0x7b'),'id')[_0x853a('0x5')](_0x853a('0x7c'))['from'](_0x853a('0x7d')+_0x3bffad+_0x853a('0x7e'),'ui')[_0x853a('0x7f')](_0x853a('0x80'),_0x1797a6['id']);return _0x4e5236[_0x853a('0x81')][_0x853a('0x82')](_0x4e219f[_0x853a('0x83')](),_0x5ed5f6)[_0x853a('0xe')](function(_0x565d11){_0x1797a6[_0x221520+_0x853a('0x84')]=_0x565d11;_0xe8cc70(_0x565d11);})[_0x853a('0x9')](function(_0x4f3f35){_0xd44897(_0x4f3f35);});});}return _0x37a892[_0x853a('0x85')](_0x853a('0x86'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4db983){var _0x404b4b={'raw':_0x4db983['query'][_0x853a('0x87')],'where':{}};var _0x2f4f83={};var _0x1a1434={'count':0x0,'rows':[]};var _0x4a00ce=_0x4db983[_0x853a('0x82')][_0x853a('0x88')];var _0x17e60f=_0x4db983[_0x853a('0x82')][_0x853a('0x89')]||![];var _0x451a8c=_0x2cbe5a(_0x4a00ce,_0x17e60f);if(!_0x451a8c['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x4a00ce+'\x27');var _0x567caf=[{'name':_0x4a00ce}];if(!_[_0x853a('0x8a')](_0x451a8c[_0x853a('0x15')]))_0x567caf=_0x451a8c['parentSections'];var _0x589867=[];for(var _0x3cc821=0x0;_0x3cc821<_0x567caf[_0x853a('0x8b')];_0x3cc821++){_0x589867[_0x853a('0x8c')](_0x4e5236[_0x853a('0x8d')]['find']({'where':{'userProfileId':_0x4db983['params']['id'],'name':_0x567caf[_0x3cc821]['name']},'raw':!![]}));}return Promise['all'](_0x589867)['then'](function(_0x1867e5){var _0x3f43cc=_[_0x853a('0x4')](_0x1867e5,function(_0x4ed5d2){return _0x4ed5d2?_0x4ed5d2:undefined;});var _0x1e1669=_['filter'](_0x567caf,[_0x853a('0x8e'),!![]]);var _0x39f106=_[_0x853a('0x8a')](_0x3f43cc)&&_['isEmpty'](_0x1e1669)?null:_[_0x853a('0x8f')](_0x1e1669,_0x3f43cc);if(!_0x39f106)return null;var _0x24661c=[];for(var _0x15c0a2=0x0;_0x15c0a2<_0x39f106[_0x853a('0x8b')];_0x15c0a2++){var _0x1b39f5=_[_0x853a('0x90')](_0x567caf,function(_0x584f26){return _0x39f106[_0x15c0a2]?_0x584f26['name']===_0x39f106[_0x15c0a2][_0x853a('0x17')]:null;});if(_0x1b39f5){if(_0x39f106[_0x15c0a2][_0x853a('0x8e')]){_0x24661c['push'](_0x4891c9(_0x451a8c['childModel'],_0x39f106[_0x15c0a2]));}else{if(!_0x39f106[_0x15c0a2][_0x853a('0x91')]){_0x24661c[_0x853a('0x8c')](_0x417067(_0x1b39f5,_0x39f106[_0x15c0a2],_0x451a8c[_0x853a('0x11')]));}else{if(_0x1b39f5['model']){_0x24661c['push'](_0x35ea27(_0x1b39f5,_0x39f106[_0x15c0a2]));}}}}}return Promise[_0x853a('0x92')](_0x24661c);})[_0x853a('0xe')](function(_0x13beac){var _0x473175=_0x13beac;var _0x510991=null;if(_0x473175){_0x510991=_0x473175[_0x853a('0x8b')]===0x1?_0x473175[0x0]:null;}if(!_0x510991&&!_0x473175)return _0x1a1434;var _0x22aa6f=_0x4e5236[_0x451a8c[_0x853a('0x11')]][_0x853a('0x93')];_0x2f4f83[_0x853a('0xa')]=_[_0x853a('0x94')](_0x22aa6f);_0x2f4f83[_0x853a('0x82')]=_[_0x853a('0x94')](_0x4db983[_0x853a('0x82')]);_0x2f4f83[_0x853a('0x95')]=_[_0x853a('0x96')](_0x2f4f83[_0x853a('0xa')],_0x2f4f83['query']);_0x404b4b[_0x853a('0x97')]=_[_0x853a('0x96')](_0x2f4f83[_0x853a('0xa')],qs[_0x853a('0x98')](_0x4db983[_0x853a('0x82')]['fields']));_0x404b4b[_0x853a('0x97')]=_0x404b4b['attributes'][_0x853a('0x8b')]?_0x404b4b[_0x853a('0x97')]:_0x2f4f83['model'];if(!_0x4db983[_0x853a('0x82')]['hasOwnProperty'](_0x853a('0x99'))){_0x404b4b[_0x853a('0x9a')]=qs[_0x853a('0x9a')](_0x4db983[_0x853a('0x82')]['limit']);_0x404b4b['offset']=qs['offset'](_0x4db983[_0x853a('0x82')]['offset']);}_0x404b4b[_0x853a('0x9b')]=qs[_0x853a('0x9c')](_0x4db983[_0x853a('0x82')][_0x853a('0x9c')]);_0x404b4b[_0x853a('0x7f')]=qs[_0x853a('0x95')](_['pick'](_0x4db983[_0x853a('0x82')],_0x2f4f83['filters']));if(_0x4db983[_0x853a('0x82')][_0x853a('0x4')]){_0x404b4b[_0x853a('0x7f')]=_[_0x853a('0x9d')](_0x404b4b[_0x853a('0x7f')],{'$or':_[_0x853a('0x8')](_0x22aa6f,function(_0x12d2b5){if(_0x12d2b5[_0x853a('0x3b')][_0x853a('0x9e')]!==_0x853a('0x9f')){var _0x1e024d={};_0x1e024d[_0x12d2b5[_0x853a('0x5')]]={'$like':'%'+_0x4db983[_0x853a('0x82')]['filter']+'%'};return _0x1e024d;}})});}var _0x145a19=[];var _0x2052ef=null;var _0x15a9ef={};if(_0x510991){_0x2052ef=_[_0x853a('0x90')](_0x567caf,[_0x853a('0x17'),_0x510991[_0x853a('0x17')]]);if(_0x2052ef[_0x853a('0x5')]){_0x15a9ef={};if(_0x451a8c[_0x853a('0x11')]===_0x853a('0x71')){_0x15a9ef[_0x2052ef['foreignKey']]=_[_0x853a('0x8')](_0x510991['associatedResources'],'id');}else{_0x15a9ef[_0x2052ef[_0x853a('0xa0')]]=_0x510991[_0x853a('0x7')];}_0x145a19['push'](_0x15a9ef);}else{_0x404b4b[_0x853a('0x7f')]['id']=_0x510991[_0x853a('0x7')];}}else{for(var _0x189d02=0x0;_0x189d02<_0x473175['length'];_0x189d02++){_0x2052ef=_[_0x853a('0x90')](_0x567caf,[_0x853a('0x17'),_0x473175[_0x189d02][_0x853a('0x17')]]);if(_0x2052ef[_0x853a('0x5')]){_0x15a9ef={};_0x15a9ef[_0x2052ef['foreignKey']]=_0x473175[_0x189d02][_0x853a('0x7')];_0x145a19[_0x853a('0x8c')](_0x15a9ef);}else{if(!_0x404b4b[_0x853a('0x7f')]['id'])_0x404b4b[_0x853a('0x7f')]['id']=[];_0x473175[_0x189d02][_0x853a('0x7')][_0x853a('0xa1')](function(_0x126a5e){_0x404b4b[_0x853a('0x7f')]['id']['push'](_0x126a5e);});}}}if(!_[_0x853a('0x8a')](_0x145a19)){_0x404b4b[_0x853a('0x7f')]=_['merge'](_0x404b4b[_0x853a('0x7f')],{'$and':{'$or':_0x145a19}});}_0x404b4b=_['merge']({},_0x404b4b,_0x4db983[_0x853a('0xa2')]);if(_0x510991&&!_0x510991[_0x853a('0x91')]&&_0x451a8c[_0x853a('0x11')]===_0x853a('0x71')){if(_0x4db983['query'][_0x853a('0xa3')]){_0x404b4b['include']=[{'all':!![]}];}return _0x4e5236[_0x451a8c[_0x853a('0x11')]][_0x853a('0xb')](_0x404b4b)['then'](function(_0x4d3f1e){var _0x47c16b=[];_0x4d3f1e[_0x853a('0xa1')](function(_0x4f17d6){var _0x54c894;switch(_0x4f17d6['reportType']){case _0x853a('0xa4'):_0x54c894=_['find'](_0x510991['associatedResources'],function(_0x4f1aa0){return _0x4f1aa0['id']===_0x4f17d6[_0x853a('0xa5')]&&_0x4f1aa0[_0x853a('0x3b')]===_0x853a('0xa6');});break;case _0x853a('0xa7'):_0x54c894=_[_0x853a('0x90')](_0x510991[_0x853a('0x7')],function(_0x56f8ff){return _0x56f8ff['id']===_0x4f17d6[_0x853a('0xa5')]&&_0x56f8ff[_0x853a('0x3b')]===_0x853a('0xa8');});break;}if(_0x54c894)_0x47c16b[_0x853a('0x8c')](_0x4f17d6);});_0x1a1434[_0x853a('0xa9')]=_0x47c16b[_0x853a('0x8b')];_0x1a1434['rows']=_0x47c16b;return _0x1a1434;});}else{if(!_[_0x853a('0x8a')](_0x4db983['query'][_0x853a('0xaa')])){_0x404b4b[_0x853a('0x7f')]['id']=_0x404b4b[_0x853a('0x7f')]['id']?_[_0x853a('0x96')](_0x404b4b[_0x853a('0x7f')]['id'],_0x4db983['query'][_0x853a('0xaa')]):_0x4db983[_0x853a('0x82')][_0x853a('0xaa')];if(_0x4db983['query'][_0x853a('0xab')]){_0x404b4b[_0x853a('0x9b')]=_0x4db983[_0x853a('0x82')][_0x853a('0xab')];}}if(_0x4db983['query'][_0x853a('0xac')]){_0x404b4b[_0x853a('0x7f')]=_[_0x853a('0x9d')](_0x404b4b[_0x853a('0x7f')],{'$and':_0x4db983[_0x853a('0x82')][_0x853a('0xac')]});}return _0x4e5236[_0x451a8c['childModel']][_0x853a('0xa9')]({'where':_0x404b4b['where']})['then'](function(_0xee5697){_0x1a1434[_0x853a('0xa9')]=_0xee5697;if(_0x4db983[_0x853a('0x82')][_0x853a('0xa3')]){if(_0x451a8c[_0x853a('0x11')]==='CmContact'){_0x404b4b[_0x853a('0xad')]=[{'model':_0x4e5236[_0x853a('0x69')],'as':_0x853a('0xae'),'attributes':['id',_0x853a('0x17'),_0x853a('0xaf')],'required':_0x4db983['query']['tag']?!![]:![]},{'model':_0x4e5236[_0x853a('0x69')],'as':_0x853a('0xb0'),'attributes':['id',_0x853a('0x17'),_0x853a('0xaf')],'through':_0x4db983[_0x853a('0x82')]['tag']?{'attributes':[],'where':{'TagId':_0x4db983['query'][_0x853a('0xb1')]||undefined}}:{},'required':_0x4db983[_0x853a('0x82')][_0x853a('0xb1')]?!![]:![]}];}else{_0x404b4b[_0x853a('0xad')]=[{'all':!![]}];}}return _0x4e5236[_0x451a8c[_0x853a('0x11')]][_0x853a('0xb')](_0x404b4b);})[_0x853a('0xe')](function(_0x349a68){_0x1a1434[_0x853a('0xb2')]=_0x349a68;if(_0x4a00ce===_0x853a('0x2f')&&_0x4db983[_0x853a('0x82')][_0x853a('0xb3')]==='true'){var _0x219ea5=[];for(var _0xa042f1=0x0;_0xa042f1<_0x1a1434[_0x853a('0xb2')]['length'];_0xa042f1++){_0x219ea5[_0x853a('0x8c')](_0x3f4769(_0x853a('0xb4'),_0x1a1434[_0x853a('0xb2')][_0xa042f1]['dataValues']));_0x219ea5[_0x853a('0x8c')](_0x3f4769(_0x853a('0xb5'),_0x1a1434[_0x853a('0xb2')][_0xa042f1][_0x853a('0xb6')]));_0x219ea5[_0x853a('0x8c')](_0x3f4769(_0x853a('0xb7'),_0x1a1434['rows'][_0xa042f1][_0x853a('0xb6')]));_0x219ea5[_0x853a('0x8c')](_0x3f4769(_0x853a('0xb8'),_0x1a1434[_0x853a('0xb2')][_0xa042f1][_0x853a('0xb6')]));_0x219ea5['push'](_0x3f4769(_0x853a('0xb9'),_0x1a1434[_0x853a('0xb2')][_0xa042f1][_0x853a('0xb6')]));_0x219ea5[_0x853a('0x8c')](_0x3f4769(_0x853a('0xba'),_0x1a1434[_0x853a('0xb2')][_0xa042f1][_0x853a('0xb6')]));}return Promise['all'](_0x219ea5)[_0x853a('0xe')](function(){return _0x1a1434;});}return _0x1a1434;});}});}}});}; \ No newline at end of file +var _0x44fa=['WhatsappAccount','teams','Team','queuecampaigns','VoiceQueues','agents','telephones','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Dashboard','pauses','Pause','sounds','tags','Tag','Template','triggers','Trigger','Trunk','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','OpenTabs','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','sort','filters','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','contacts','CmContact','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','name','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x44fa,0x1eb));var _0xa44f=function(_0xc277c7,_0x2b03a9){_0xc277c7=_0xc277c7-0x0;var _0x13863f=_0x44fa[_0xc277c7];return _0x13863f;};'use strict';var _=require(_0xa44f('0x0'));var attributes=require(_0xa44f('0x1'));var qs=require(_0xa44f('0x2'));var squel=require(_0xa44f('0x3'));module['exports']=function(_0x201f9e){var _0x76bc6a=_0x201f9e[_0xa44f('0x4')];function _0x4d47a9(_0x1bc574,_0xe986ac){return new Promise(function(_0x2f208d,_0x3d6252){if(!_0xe986ac)return _0x2f208d(null);var _0x41f9b4=_0xe986ac[_0xa44f('0x5')]?{[_0xe986ac[_0xa44f('0x5')][_0xa44f('0x6')]]:_0xe986ac[_0xa44f('0x5')][_0xa44f('0x7')]}:undefined;return _0x76bc6a[_0x1bc574][_0xa44f('0x8')]({'where':_0x41f9b4,'raw':!![]})[_0xa44f('0x9')](function(_0x11dbd8){_0xe986ac['associatedResources']=_[_0xa44f('0xa')](_0x11dbd8,'id');_0x2f208d(_0xe986ac);})[_0xa44f('0xb')](function(_0x53fd6a){_0x3d6252(_0x53fd6a);});});}function _0x537cd4(_0x2172e5,_0x4acb8a){return new Promise(function(_0x2ac21b,_0x73f94d){var _0x43ba53=_0x2172e5['filter']?{[_0x2172e5[_0xa44f('0x5')][_0xa44f('0x6')]]:_0x2172e5['filter']['value']}:undefined;return _0x76bc6a[_0x2172e5[_0xa44f('0xc')]][_0xa44f('0x8')]({'where':_0x43ba53,'raw':!![]})['then'](function(_0x4c58b3){_0x4acb8a[_0xa44f('0xd')]=_[_0xa44f('0xa')](_0x4c58b3,function(_0x29a86d){return _0x29a86d['name'];});_0x2ac21b(_0x4acb8a);})[_0xa44f('0xb')](function(_0x46ef68){_0x73f94d(_0x46ef68);});});}function _0x363f23(_0x5b8362,_0x12a6c5,_0x2b6954){if(!_0x12a6c5)return Promise[_0xa44f('0xe')](null);return new Promise(function(_0x5ac389,_0x35376f){return _0x76bc6a[_0xa44f('0xf')]['findAll']({'where':{'sectionId':_0x12a6c5['id']},'raw':!![]})[_0xa44f('0x9')](function(_0x3f0b75){if(_0x5b8362[_0xa44f('0x6')]&&_0x5b8362[_0xa44f('0x6')]!=='id'){_0x12a6c5[_0xa44f('0xd')]=_[_0xa44f('0xa')](_0x3f0b75,function(_0x2fdcfa){return _0x2fdcfa[_0x5b8362[_0xa44f('0x6')]];});}else{if(_0x2b6954===_0xa44f('0x10')){_0x12a6c5[_0xa44f('0xd')]=_[_0xa44f('0xa')](_0x3f0b75,function(_0x4594fc){return{'id':_0x4594fc['resourceId'],'type':_0x4594fc[_0xa44f('0x11')]};});}else{_0x12a6c5[_0xa44f('0xd')]=_[_0xa44f('0xa')](_0x3f0b75,function(_0x47aff8){return _0x47aff8[_0xa44f('0x12')];});}}_0x5ac389(_0x12a6c5);})[_0xa44f('0xb')](function(_0x483bda){_0x35376f(_0x483bda);});});}function _0x251a9f(_0x47e99d,_0x21c50f){var _0x1bc806={'parentSections':[]};switch(_0x47e99d['toLowerCase']()){case _0xa44f('0x13'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x15');break;case'odbc':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x16');break;case _0xa44f('0x17'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x18');_0x1bc806[_0xa44f('0x19')]=[{'name':_0xa44f('0x1a'),'field':'name','foreignKey':_0xa44f('0x1b')}];break;case'projects':_0x1bc806['childModel']='JscriptyProject';break;case _0xa44f('0x1c'):_0x1bc806['childModel']=_0xa44f('0x1d');_0x1bc806['parentSections']=[{'name':_0xa44f('0x1e'),'field':'id','foreignKey':_0xa44f('0x1f')}];break;case'lists':_0x1bc806['childModel']='CmList';break;case _0xa44f('0x20'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x21');break;case _0xa44f('0x22'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x23');break;case'chatqueues':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x24');break;case'chatwebsites':_0x1bc806['childModel']=_0xa44f('0x25');break;case'faxqueues':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x26');break;case'faxaccounts':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x27');break;case _0xa44f('0x28'):case _0xa44f('0x29'):case _0xa44f('0x2a'):_0x1bc806[_0xa44f('0x14')]='VoiceExtension';break;case _0xa44f('0x2b'):_0x1bc806['childModel']='VoiceContext';break;case _0xa44f('0x2c'):_0x1bc806[_0xa44f('0x14')]='VoiceMail';break;case _0xa44f('0x2d'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x2e');_0x1bc806[_0xa44f('0x19')]=[{'name':_0xa44f('0x2f'),'field':'name','foreignKey':_0xa44f('0x30'),'model':_0xa44f('0x31'),'filter':{'field':_0xa44f('0x32'),'value':[_0xa44f('0x33')]}},{'name':'Telephones','field':_0xa44f('0x34'),'foreignKey':_0xa44f('0x30'),'model':_0xa44f('0x31'),'filter':{'field':_0xa44f('0x32'),'value':[_0xa44f('0x35')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0xa44f('0x36'),'filter':{'field':'type','value':[_0xa44f('0x37')]}},{'name':_0xa44f('0x38'),'field':_0xa44f('0x34'),'foreignKey':_0xa44f('0x39'),'model':_0xa44f('0x36'),'filter':{'field':_0xa44f('0x11'),'value':[_0xa44f('0x3a')]}}];break;case _0xa44f('0x3b'):_0x1bc806['childModel']=_0xa44f('0x3c');break;case _0xa44f('0x3d'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x3e');break;case _0xa44f('0x3f'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x40');break;case _0xa44f('0x41'):_0x1bc806[_0xa44f('0x14')]='Campaign';break;case _0xa44f('0x42'):_0x1bc806['childModel']=_0xa44f('0x43');break;case _0xa44f('0x44'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x45');break;case _0xa44f('0x46'):_0x1bc806[_0xa44f('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x47');break;case _0xa44f('0x48'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x49');break;case _0xa44f('0x4a'):_0x1bc806[_0xa44f('0x14')]='SmsQueue';break;case _0xa44f('0x4b'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x4c');break;case _0xa44f('0x4d'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x4e');break;case'whatsappaccounts':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x4f');break;case _0xa44f('0x50'):_0x1bc806['childModel']=_0xa44f('0x51');break;case'voicequeues':case _0xa44f('0x52'):_0x1bc806['childModel']=_0xa44f('0x36');if(_0x21c50f){_0x1bc806['parentSections']=[{'name':_0xa44f('0x53')},{'name':_0xa44f('0x38')}];}break;case'users':case _0xa44f('0x54'):case _0xa44f('0x55'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x31');if(_0x21c50f){_0x1bc806['parentSections']=[{'name':'Users','filter':{'field':_0xa44f('0x32'),'value':[_0xa44f('0x56'),_0xa44f('0x57')]},'ignore':!![]},{'name':_0xa44f('0x2f')},{'name':_0xa44f('0x58')}];}break;case _0xa44f('0x59'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x5a');break;case _0xa44f('0x5b'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x5c');break;case'freshdeskaccounts':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x5d');break;case _0xa44f('0x5e'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x5f');break;case'deskaccounts':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x60');break;case'zohoaccounts':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x61');break;case _0xa44f('0x62'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x31');break;case _0xa44f('0x63'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x64');break;case _0xa44f('0x65'):_0x1bc806[_0xa44f('0x14')]='Disposition';break;case'customdashboards':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x66');break;case'intervals':_0x1bc806['childModel']='Interval';break;case _0xa44f('0x67'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x68');break;case'scheduler':_0x1bc806['childModel']='Schedule';break;case _0xa44f('0x69'):_0x1bc806['childModel']='Sound';break;case _0xa44f('0x6a'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x6b');break;case'templates':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x6c');break;case _0xa44f('0x6d'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x6e');break;case'trunks':_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x6f');break;case _0xa44f('0x70'):_0x1bc806['childModel']='Variable';break;case _0xa44f('0x71'):_0x1bc806[_0xa44f('0x14')]='Plugin';break;case _0xa44f('0x72'):_0x1bc806['childModel']=_0xa44f('0x10');_0x1bc806[_0xa44f('0x19')]=[{'name':_0xa44f('0x73'),'field':'id','foreignKey':_0xa44f('0x74')}];break;case _0xa44f('0x75'):_0x1bc806[_0xa44f('0x14')]=_0xa44f('0x76');break;}return _0x1bc806;}function _0x1cfbe7(_0x2e9e56,_0x577810){var _0x34332b=_0x2e9e56[_0xa44f('0x77')](0x0)[_0xa44f('0x78')]()+_0x2e9e56[_0xa44f('0x79')](0x1);var _0x38357f={'type':_0x76bc6a[_0xa44f('0x7a')][_0xa44f('0x7b')][_0xa44f('0x7c')],'raw':!![]};return new Promise(function(_0x3a4072,_0x1d0d17){var _0x4737c6=squel[_0xa44f('0x7d')]()[_0xa44f('0x6')](_0xa44f('0x7e')+_0x34332b+_0xa44f('0x7f'),'id')[_0xa44f('0x6')](_0xa44f('0x80'))[_0xa44f('0x81')](_0xa44f('0x82')+_0x2e9e56+_0xa44f('0x83'),'ui')[_0xa44f('0x84')]('ui.UserId\x20=\x20?',_0x577810['id']);return _0x76bc6a[_0xa44f('0x85')][_0xa44f('0x86')](_0x4737c6['toString'](),_0x38357f)[_0xa44f('0x9')](function(_0x2be5db){_0x577810[_0x34332b+_0xa44f('0x87')]=_0x2be5db;_0x3a4072(_0x2be5db);})[_0xa44f('0xb')](function(_0x30ff3a){_0x1d0d17(_0x30ff3a);});});}return _0x201f9e['define'](_0xa44f('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1c74dc){var _0x155fee={'raw':_0x1c74dc[_0xa44f('0x86')]['raw'],'where':{}};var _0x325962={};var _0x508e7e={'count':0x0,'rows':[]};var _0x53574a=_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x89')];var _0x217fca=_0x1c74dc['query'][_0xa44f('0x8a')]||![];var _0x4af194=_0x251a9f(_0x53574a,_0x217fca);if(!_0x4af194[_0xa44f('0x14')])throw new Error(_0xa44f('0x8b')+_0x53574a+'\x27');var _0x5d60bc=[{'name':_0x53574a}];if(!_[_0xa44f('0x8c')](_0x4af194[_0xa44f('0x19')]))_0x5d60bc=_0x4af194[_0xa44f('0x19')];var _0x47e934=[];for(var _0x168ed4=0x0;_0x168ed4<_0x5d60bc[_0xa44f('0x8d')];_0x168ed4++){_0x47e934[_0xa44f('0x8e')](_0x76bc6a[_0xa44f('0x8f')][_0xa44f('0x90')]({'where':{'userProfileId':_0x1c74dc[_0xa44f('0x91')]['id'],'name':_0x5d60bc[_0x168ed4][_0xa44f('0x34')]},'raw':!![]}));}return Promise[_0xa44f('0x92')](_0x47e934)[_0xa44f('0x9')](function(_0x484de0){var _0x47667c=_[_0xa44f('0x5')](_0x484de0,function(_0x3dd745){return _0x3dd745?_0x3dd745:undefined;});var _0x3f3a63=_[_0xa44f('0x5')](_0x5d60bc,[_0xa44f('0x93'),!![]]);var _0x422e31=_[_0xa44f('0x8c')](_0x47667c)&&_[_0xa44f('0x8c')](_0x3f3a63)?null:_['union'](_0x3f3a63,_0x47667c);if(!_0x422e31)return null;var _0xfa4b84=[];for(var _0x83afd3=0x0;_0x83afd3<_0x422e31['length'];_0x83afd3++){var _0x3794d2=_[_0xa44f('0x90')](_0x5d60bc,function(_0x43102d){return _0x422e31[_0x83afd3]?_0x43102d[_0xa44f('0x34')]===_0x422e31[_0x83afd3][_0xa44f('0x34')]:null;});if(_0x3794d2){if(_0x422e31[_0x83afd3][_0xa44f('0x93')]){_0xfa4b84['push'](_0x4d47a9(_0x4af194['childModel'],_0x422e31[_0x83afd3]));}else{if(!_0x422e31[_0x83afd3][_0xa44f('0x94')]){_0xfa4b84[_0xa44f('0x8e')](_0x363f23(_0x3794d2,_0x422e31[_0x83afd3],_0x4af194['childModel']));}else{if(_0x3794d2['model']){_0xfa4b84['push'](_0x537cd4(_0x3794d2,_0x422e31[_0x83afd3]));}}}}}return Promise[_0xa44f('0x92')](_0xfa4b84);})['then'](function(_0x2ec796){var _0x5a1962=_0x2ec796;var _0x27bc53=null;if(_0x5a1962){_0x27bc53=_0x5a1962[_0xa44f('0x8d')]===0x1?_0x5a1962[0x0]:null;}if(!_0x27bc53&&!_0x5a1962)return _0x508e7e;var _0x21e9c3=_0x76bc6a[_0x4af194[_0xa44f('0x14')]][_0xa44f('0x95')];_0x325962[_0xa44f('0xc')]=_[_0xa44f('0x96')](_0x21e9c3);_0x325962[_0xa44f('0x86')]=_[_0xa44f('0x96')](_0x1c74dc[_0xa44f('0x86')]);_0x325962['filters']=_[_0xa44f('0x97')](_0x325962[_0xa44f('0xc')],_0x325962[_0xa44f('0x86')]);_0x155fee[_0xa44f('0x98')]=_[_0xa44f('0x97')](_0x325962[_0xa44f('0xc')],qs[_0xa44f('0x99')](_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x99')]));_0x155fee[_0xa44f('0x98')]=_0x155fee[_0xa44f('0x98')][_0xa44f('0x8d')]?_0x155fee['attributes']:_0x325962['model'];if(!_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x9a')]('nolimit')){_0x155fee[_0xa44f('0x9b')]=qs[_0xa44f('0x9b')](_0x1c74dc['query'][_0xa44f('0x9b')]);_0x155fee[_0xa44f('0x9c')]=qs[_0xa44f('0x9c')](_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x9c')]);}_0x155fee['order']=qs[_0xa44f('0x9d')](_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x9d')]);_0x155fee['where']=qs[_0xa44f('0x9e')](_[_0xa44f('0x9f')](_0x1c74dc[_0xa44f('0x86')],_0x325962['filters']));if(_0x1c74dc[_0xa44f('0x86')]['filter']){_0x155fee['where']=_['merge'](_0x155fee['where'],{'$or':_[_0xa44f('0xa')](_0x21e9c3,function(_0x55bbb7){if(_0x55bbb7[_0xa44f('0x11')][_0xa44f('0xa0')]!==_0xa44f('0xa1')){var _0x9ab41e={};_0x9ab41e[_0x55bbb7[_0xa44f('0x6')]]={'$like':'%'+_0x1c74dc[_0xa44f('0x86')][_0xa44f('0x5')]+'%'};return _0x9ab41e;}})});}var _0x589b16=[];var _0x50d2f7=null;var _0x3f9aa8={};if(_0x27bc53){_0x50d2f7=_[_0xa44f('0x90')](_0x5d60bc,[_0xa44f('0x34'),_0x27bc53[_0xa44f('0x34')]]);if(_0x50d2f7[_0xa44f('0x6')]){_0x3f9aa8={};if(_0x4af194[_0xa44f('0x14')]===_0xa44f('0x10')){_0x3f9aa8[_0x50d2f7['foreignKey']]=_[_0xa44f('0xa')](_0x27bc53[_0xa44f('0xd')],'id');}else{_0x3f9aa8[_0x50d2f7[_0xa44f('0xa2')]]=_0x27bc53['associatedResources'];}_0x589b16[_0xa44f('0x8e')](_0x3f9aa8);}else{_0x155fee['where']['id']=_0x27bc53[_0xa44f('0xd')];}}else{for(var _0x180263=0x0;_0x180263<_0x5a1962[_0xa44f('0x8d')];_0x180263++){_0x50d2f7=_['find'](_0x5d60bc,['name',_0x5a1962[_0x180263][_0xa44f('0x34')]]);if(_0x50d2f7[_0xa44f('0x6')]){_0x3f9aa8={};_0x3f9aa8[_0x50d2f7[_0xa44f('0xa2')]]=_0x5a1962[_0x180263][_0xa44f('0xd')];_0x589b16['push'](_0x3f9aa8);}else{if(!_0x155fee[_0xa44f('0x84')]['id'])_0x155fee[_0xa44f('0x84')]['id']=[];_0x5a1962[_0x180263][_0xa44f('0xd')][_0xa44f('0xa3')](function(_0x541bb2){_0x155fee[_0xa44f('0x84')]['id'][_0xa44f('0x8e')](_0x541bb2);});}}}if(!_['isEmpty'](_0x589b16)){_0x155fee['where']=_[_0xa44f('0xa4')](_0x155fee[_0xa44f('0x84')],{'$and':{'$or':_0x589b16}});}_0x155fee=_[_0xa44f('0xa4')]({},_0x155fee,_0x1c74dc[_0xa44f('0xa5')]);if(_0x27bc53&&!_0x27bc53[_0xa44f('0x94')]&&_0x4af194[_0xa44f('0x14')]===_0xa44f('0x10')){if(_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xa6')]){_0x155fee[_0xa44f('0xa7')]=[{'all':!![]}];}return _0x76bc6a[_0x4af194[_0xa44f('0x14')]][_0xa44f('0x8')](_0x155fee)[_0xa44f('0x9')](function(_0x114d7c){var _0x58e46e=[];_0x114d7c['forEach'](function(_0x38f2f1){var _0x3b5fd0;switch(_0x38f2f1[_0xa44f('0xa8')]){case _0xa44f('0xa9'):_0x3b5fd0=_['find'](_0x27bc53['associatedResources'],function(_0x3cd473){return _0x3cd473['id']===_0x38f2f1[_0xa44f('0x74')]&&_0x3cd473[_0xa44f('0x11')]==='DefaultReports';});break;case _0xa44f('0xaa'):_0x3b5fd0=_[_0xa44f('0x90')](_0x27bc53['associatedResources'],function(_0x4c30ed){return _0x4c30ed['id']===_0x38f2f1[_0xa44f('0x74')]&&_0x4c30ed[_0xa44f('0x11')]===_0xa44f('0xab');});break;}if(_0x3b5fd0)_0x58e46e['push'](_0x38f2f1);});_0x508e7e[_0xa44f('0xac')]=_0x58e46e[_0xa44f('0x8d')];_0x508e7e[_0xa44f('0xad')]=_0x58e46e;return _0x508e7e;});}else{if(!_['isEmpty'](_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xae')])){_0x155fee[_0xa44f('0x84')]['id']=_0x155fee[_0xa44f('0x84')]['id']?_[_0xa44f('0x97')](_0x155fee[_0xa44f('0x84')]['id'],_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xae')]):_0x1c74dc[_0xa44f('0x86')]['ids'];if(_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xaf')]){_0x155fee[_0xa44f('0xb0')]=_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xaf')];}}if(_0x1c74dc['query'][_0xa44f('0xb1')]){_0x155fee[_0xa44f('0x84')]=_['merge'](_0x155fee[_0xa44f('0x84')],{'$and':_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xb1')]});}return _0x76bc6a[_0x4af194[_0xa44f('0x14')]]['count']({'where':_0x155fee[_0xa44f('0x84')]})[_0xa44f('0x9')](function(_0x3c4fc4){_0x508e7e[_0xa44f('0xac')]=_0x3c4fc4;if(_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xa6')]){if(_0x4af194[_0xa44f('0x14')]===_0xa44f('0x1d')){_0x155fee[_0xa44f('0xa7')]=[{'model':_0x76bc6a['Tag'],'as':_0xa44f('0xb2'),'attributes':['id',_0xa44f('0x34'),'color'],'required':_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xb3')]?!![]:![]},{'model':_0x76bc6a[_0xa44f('0x6b')],'as':_0xa44f('0xb4'),'attributes':['id',_0xa44f('0x34'),'color'],'through':_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xb3')]?{'attributes':[],'where':{'TagId':_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xb3')]||undefined}}:{},'required':_0x1c74dc['query'][_0xa44f('0xb3')]?!![]:![]}];}else{_0x155fee[_0xa44f('0xa7')]=[{'all':!![]}];}}return _0x76bc6a[_0x4af194['childModel']]['findAll'](_0x155fee);})[_0xa44f('0x9')](function(_0x157722){_0x508e7e['rows']=_0x157722;if(_0x53574a==='Agents'&&_0x1c74dc[_0xa44f('0x86')][_0xa44f('0xb5')]===_0xa44f('0xb6')){var _0x36611b=[];for(var _0x4368ce=0x0;_0x4368ce<_0x508e7e[_0xa44f('0xad')][_0xa44f('0x8d')];_0x4368ce++){_0x36611b[_0xa44f('0x8e')](_0x1cfbe7(_0xa44f('0xb7'),_0x508e7e[_0xa44f('0xad')][_0x4368ce][_0xa44f('0xb8')]));_0x36611b['push'](_0x1cfbe7(_0xa44f('0xb9'),_0x508e7e[_0xa44f('0xad')][_0x4368ce][_0xa44f('0xb8')]));_0x36611b[_0xa44f('0x8e')](_0x1cfbe7(_0xa44f('0xba'),_0x508e7e[_0xa44f('0xad')][_0x4368ce]['dataValues']));_0x36611b[_0xa44f('0x8e')](_0x1cfbe7(_0xa44f('0xbb'),_0x508e7e[_0xa44f('0xad')][_0x4368ce][_0xa44f('0xb8')]));_0x36611b[_0xa44f('0x8e')](_0x1cfbe7(_0xa44f('0xbc'),_0x508e7e[_0xa44f('0xad')][_0x4368ce][_0xa44f('0xb8')]));_0x36611b[_0xa44f('0x8e')](_0x1cfbe7(_0xa44f('0xbd'),_0x508e7e['rows'][_0x4368ce]['dataValues']));}return Promise[_0xa44f('0x92')](_0x36611b)[_0xa44f('0x9')](function(){return _0x508e7e;});}return _0x508e7e;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b56aa72..782e63f 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 _0x04cc=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4b5e98,_0x194e55){var _0x387590=function(_0x5cace1){while(--_0x5cace1){_0x4b5e98['push'](_0x4b5e98['shift']());}};_0x387590(++_0x194e55);}(_0x04cc,0x11a));var _0xc04c=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0x04cc[_0x18a577];return _0x1cb0c7;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var moment=require(_0xc04c('0x2'));var BPromise=require(_0xc04c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc04c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc04c('0x5'))(_0xc04c('0x6'));var config=require(_0xc04c('0x7'));var jayson=require(_0xc04c('0x8'));var client=jayson[_0xc04c('0x9')][_0xc04c('0xa')]({'port':0x232a});config[_0xc04c('0xb')]=_['defaults'](config[_0xc04c('0xb')],{'host':_0xc04c('0xc'),'port':0x18eb});var socket=require(_0xc04c('0xd'))(new Redis(config[_0xc04c('0xb')]));require(_0xc04c('0xe'))[_0xc04c('0xf')](socket);function respondWithRpcPromise(_0x1c363d,_0x1b6102,_0x4dcea5){return new BPromise(function(_0x4c6e10,_0x1e7ced){return client[_0xc04c('0x10')](_0x1c363d,_0x4dcea5)[_0xc04c('0x11')](function(_0x188bb7){logger[_0xc04c('0x12')](_0xc04c('0x13'),_0x1b6102,_0xc04c('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1b6102,_0xc04c('0x14'),JSON['stringify'](_0x188bb7));if(_0x188bb7[_0xc04c('0x15')]){if(_0x188bb7[_0xc04c('0x15')][_0xc04c('0x16')]===0x1f4){logger[_0xc04c('0x15')]('UserProfile,\x20%s,\x20%s',_0x1b6102,_0x188bb7[_0xc04c('0x15')][_0xc04c('0x17')]);return _0x1e7ced(_0x188bb7[_0xc04c('0x15')][_0xc04c('0x17')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x1b6102,_0x188bb7['error'][_0xc04c('0x17')]);return _0x4c6e10(_0x188bb7[_0xc04c('0x15')]['message']);}else{logger[_0xc04c('0x12')]('UserProfile,\x20%s,\x20%s',_0x1b6102,_0xc04c('0x14'));_0x4c6e10(_0x188bb7[_0xc04c('0x18')]['message']);}})[_0xc04c('0x19')](function(_0x8daa87){logger[_0xc04c('0x15')](_0xc04c('0x13'),_0x1b6102,_0x8daa87);_0x1e7ced(_0x8daa87);});});} \ No newline at end of file +var _0x27f3=['debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s'];(function(_0x24de3f,_0x6f5a96){var _0x2c061f=function(_0x41868d){while(--_0x41868d){_0x24de3f['push'](_0x24de3f['shift']());}};_0x2c061f(++_0x6f5a96);}(_0x27f3,0x1e9));var _0x327f=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x27f3[_0xc8a11];return _0x55a500;};'use strict';var _=require(_0x327f('0x0'));var util=require(_0x327f('0x1'));var moment=require('moment');var BPromise=require(_0x327f('0x2'));var rs=require(_0x327f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x327f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x327f('0x5'))(_0x327f('0x6'));var config=require(_0x327f('0x7'));var jayson=require(_0x327f('0x8'));var client=jayson[_0x327f('0x9')][_0x327f('0xa')]({'port':0x232a});config[_0x327f('0xb')]=_[_0x327f('0xc')](config['redis'],{'host':_0x327f('0xd'),'port':0x18eb});var socket=require(_0x327f('0xe'))(new Redis(config[_0x327f('0xb')]));require(_0x327f('0xf'))[_0x327f('0x10')](socket);function respondWithRpcPromise(_0x18c142,_0x501f8b,_0x25295d){return new BPromise(function(_0x119120,_0x434e5a){return client[_0x327f('0x11')](_0x18c142,_0x25295d)[_0x327f('0x12')](function(_0xb2fd19){logger[_0x327f('0x13')](_0x327f('0x14'),_0x501f8b,'request\x20sent');logger[_0x327f('0x15')](_0x327f('0x16'),_0x501f8b,_0x327f('0x17'),JSON[_0x327f('0x18')](_0xb2fd19));if(_0xb2fd19[_0x327f('0x19')]){if(_0xb2fd19[_0x327f('0x19')][_0x327f('0x1a')]===0x1f4){logger[_0x327f('0x19')]('UserProfile,\x20%s,\x20%s',_0x501f8b,_0xb2fd19['error'][_0x327f('0x1b')]);return _0x434e5a(_0xb2fd19[_0x327f('0x19')][_0x327f('0x1b')]);}logger[_0x327f('0x19')](_0x327f('0x14'),_0x501f8b,_0xb2fd19[_0x327f('0x19')][_0x327f('0x1b')]);return _0x119120(_0xb2fd19[_0x327f('0x19')][_0x327f('0x1b')]);}else{logger[_0x327f('0x13')](_0x327f('0x14'),_0x501f8b,'request\x20sent');_0x119120(_0xb2fd19[_0x327f('0x1c')][_0x327f('0x1b')]);}})[_0x327f('0x1d')](function(_0x26a217){logger[_0x327f('0x19')](_0x327f('0x14'),_0x501f8b,_0x26a217);_0x434e5a(_0x26a217);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 272a8e6..c6c9bba 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 _0xf912=['register','length','userProfile:','remove','update','emit','removeListener'];(function(_0x4f38e5,_0x3b958e){var _0xea1def=function(_0x4f2c8d){while(--_0x4f2c8d){_0x4f38e5['push'](_0x4f38e5['shift']());}};_0xea1def(++_0x3b958e);}(_0xf912,0x1a0));var _0x2f91=function(_0x1f4e75,_0x2520a1){_0x1f4e75=_0x1f4e75-0x0;var _0x31103a=_0xf912[_0x1f4e75];return _0x31103a;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x2f91('0x0'),_0x2f91('0x1')];function createListener(_0x549953,_0x7999d7){return function(_0x4eafdb){_0x7999d7[_0x2f91('0x2')](_0x549953,_0x4eafdb);};}function removeListener(_0x32dc3e,_0x5e4775){return function(){UserProfileEvents[_0x2f91('0x3')](_0x32dc3e,_0x5e4775);};}exports[_0x2f91('0x4')]=function(_0x1d13c1){for(var _0x1b62d3=0x0,_0x2525f4=events[_0x2f91('0x5')];_0x1b62d3<_0x2525f4;_0x1b62d3++){var _0x101745=events[_0x1b62d3];var _0x2f77c3=createListener(_0x2f91('0x6')+_0x101745,_0x1d13c1);UserProfileEvents['on'](_0x101745,_0x2f77c3);}}; \ No newline at end of file +var _0x6806=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4a035e,_0x25afea){var _0x31212f=function(_0x41888a){while(--_0x41888a){_0x4a035e['push'](_0x4a035e['shift']());}};_0x31212f(++_0x25afea);}(_0x6806,0xd0));var _0x6680=function(_0x1213c8,_0x1a177a){_0x1213c8=_0x1213c8-0x0;var _0x4c3001=_0x6806[_0x1213c8];return _0x4c3001;};'use strict';var UserProfileEvents=require(_0x6680('0x0'));var events=[_0x6680('0x1'),_0x6680('0x2'),_0x6680('0x3')];function createListener(_0x5b03d7,_0x59e264){return function(_0x35772){_0x59e264[_0x6680('0x4')](_0x5b03d7,_0x35772);};}function removeListener(_0xf3900e,_0xb86b8f){return function(){UserProfileEvents[_0x6680('0x5')](_0xf3900e,_0xb86b8f);};}exports[_0x6680('0x6')]=function(_0x313926){for(var _0x4daf6a=0x0,_0xc87e63=events[_0x6680('0x7')];_0x4daf6a<_0xc87e63;_0x4daf6a++){var _0x573a75=events[_0x4daf6a];var _0x57ae59=createListener(_0x6680('0x8')+_0x573a75,_0x313926);UserProfileEvents['on'](_0x573a75,_0x57ae59);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2a540a3..168f88e 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 _0x64f0=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfileResource.controller','get','isAuthenticated','describe','/:id','post','create'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x64f0,0x15a));var _0x064f=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0x64f0[_0x5090d4];return _0x56c310;};'use strict';var multer=require(_0x064f('0x0'));var util=require(_0x064f('0x1'));var path=require(_0x064f('0x2'));var timeout=require(_0x064f('0x3'));var express=require(_0x064f('0x4'));var router=express[_0x064f('0x5')]();var fs_extra=require(_0x064f('0x6'));var auth=require(_0x064f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x064f('0x8'));router[_0x064f('0x9')]('/',auth[_0x064f('0xa')](),controller['index']);router[_0x064f('0x9')]('/describe',auth[_0x064f('0xa')](),controller[_0x064f('0xb')]);router[_0x064f('0x9')](_0x064f('0xc'),auth[_0x064f('0xa')](),controller['show']);router[_0x064f('0xd')]('/',auth['isAuthenticated'](),controller[_0x064f('0xe')]);router[_0x064f('0xf')](_0x064f('0xc'),auth['isAuthenticated'](),controller[_0x064f('0x10')]);router['delete'](_0x064f('0xc'),auth[_0x064f('0xa')](),controller[_0x064f('0x11')]);module[_0x064f('0x12')]=router; \ No newline at end of file +var _0x8f49=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','post','update','destroy','exports','multer','path'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x8f49,0x166));var _0x98f4=function(_0x58b70f,_0x5e9371){_0x58b70f=_0x58b70f-0x0;var _0x494fa2=_0x8f49[_0x58b70f];return _0x494fa2;};'use strict';var multer=require(_0x98f4('0x0'));var util=require('util');var path=require(_0x98f4('0x1'));var timeout=require(_0x98f4('0x2'));var express=require(_0x98f4('0x3'));var router=express[_0x98f4('0x4')]();var fs_extra=require(_0x98f4('0x5'));var auth=require(_0x98f4('0x6'));var interaction=require(_0x98f4('0x7'));var config=require('../../config/environment');var controller=require(_0x98f4('0x8'));router[_0x98f4('0x9')]('/',auth[_0x98f4('0xa')](),controller[_0x98f4('0xb')]);router[_0x98f4('0x9')](_0x98f4('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x98f4('0xd'),auth[_0x98f4('0xa')](),controller['show']);router[_0x98f4('0xe')]('/',auth[_0x98f4('0xa')](),controller['create']);router['put'](_0x98f4('0xd'),auth[_0x98f4('0xa')](),controller[_0x98f4('0xf')]);router['delete'](_0x98f4('0xd'),auth['isAuthenticated'](),controller[_0x98f4('0x10')]);module[_0x98f4('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e47df73..7c89e97 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 _0xd61d=['sequelize','exports','INTEGER','STRING'];(function(_0x3f82e9,_0x40d690){var _0x46b35f=function(_0x131540){while(--_0x131540){_0x3f82e9['push'](_0x3f82e9['shift']());}};_0x46b35f(++_0x40d690);}(_0xd61d,0x1f4));var _0xdd61=function(_0x26dd5a,_0x10545d){_0x26dd5a=_0x26dd5a-0x0;var _0x486a8e=_0xd61d[_0x26dd5a];return _0x486a8e;};'use strict';var Sequelize=require(_0xdd61('0x0'));module[_0xdd61('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xdd61('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdd61('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x7b4e=['exports','INTEGER','STRING','sequelize'];(function(_0x549cba,_0x328974){var _0x27e43b=function(_0x3f4d10){while(--_0x3f4d10){_0x549cba['push'](_0x549cba['shift']());}};_0x27e43b(++_0x328974);}(_0x7b4e,0x143));var _0xe7b4=function(_0x2bda0c,_0x2f1627){_0x2bda0c=_0x2bda0c-0x0;var _0xf67b5=_0x7b4e[_0x2bda0c];return _0xf67b5;};'use strict';var Sequelize=require(_0xe7b4('0x0'));module[_0xe7b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe7b4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe7b4('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 316b3f6..72fa39d 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 _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9536,0x179));var _0x6953=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x9536[_0x44c935];return _0x465bee;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file +var _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0xe12f5d,_0x37f834){var _0x43b106=function(_0x25f31c){while(--_0x25f31c){_0xe12f5d['push'](_0xe12f5d['shift']());}};_0x43b106(++_0x37f834);}(_0xd943,0x15d));var _0x3d94=function(_0x193f0b,_0x50be32){_0x193f0b=_0x193f0b-0x0;var _0x3b7467=_0xd943[_0x193f0b];return _0x3b7467;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 436ed25..d6cf867 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 _0x774e=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','user_profile_has_resources','resourceId','sectionId','../../config/logger','bluebird'];(function(_0x5499ce,_0x3908fe){var _0xb9a0c2=function(_0x261d0b){while(--_0x261d0b){_0x5499ce['push'](_0x5499ce['shift']());}};_0xb9a0c2(++_0x3908fe);}(_0x774e,0x1e2));var _0xe774=function(_0x20eabf,_0x36df69){_0x20eabf=_0x20eabf-0x0;var _0x1dd04a=_0x774e[_0x20eabf];return _0x1dd04a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe774('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe774('0x1'));var rp=require(_0xe774('0x2'));var fs=require('fs');var path=require(_0xe774('0x3'));var rimraf=require(_0xe774('0x4'));var config=require(_0xe774('0x5'));var attributes=require(_0xe774('0x6'));module['exports']=function(_0x2f3143,_0x1c36b8){return _0x2f3143[_0xe774('0x7')]('UserProfileResource',attributes,{'tableName':_0xe774('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xe774('0x9'),_0xe774('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccb5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash'];(function(_0xa4a2e5,_0x4e99fa){var _0x57b422=function(_0x47558d){while(--_0x47558d){_0xa4a2e5['push'](_0xa4a2e5['shift']());}};_0x57b422(++_0x4e99fa);}(_0xccb5,0x68));var _0x5ccb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xccb5[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5ccb('0x0'));var util=require('util');var logger=require(_0x5ccb('0x1'))(_0x5ccb('0x2'));var moment=require(_0x5ccb('0x3'));var BPromise=require(_0x5ccb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ccb('0x5'));var rimraf=require(_0x5ccb('0x6'));var config=require(_0x5ccb('0x7'));var attributes=require(_0x5ccb('0x8'));module[_0x5ccb('0x9')]=function(_0x372a87,_0x1ec294){return _0x372a87[_0x5ccb('0xa')](_0x5ccb('0xb'),attributes,{'tableName':_0x5ccb('0xc'),'paranoid':![],'indexes':[{'name':_0x5ccb('0xd'),'fields':['resourceId',_0x5ccb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 49da32b..0295a57 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 _0x4640=['client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4640,0x114));var _0x0464=function(_0x4143d4,_0x5ba08b){_0x4143d4=_0x4143d4-0x0;var _0x167785=_0x4640[_0x4143d4];return _0x167785;};'use strict';var _=require(_0x0464('0x0'));var util=require(_0x0464('0x1'));var moment=require(_0x0464('0x2'));var BPromise=require(_0x0464('0x3'));var rs=require(_0x0464('0x4'));var fs=require('fs');var Redis=require(_0x0464('0x5'));var db=require(_0x0464('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0464('0x7'));var config=require(_0x0464('0x8'));var jayson=require(_0x0464('0x9'));var client=jayson[_0x0464('0xa')][_0x0464('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10c5d4,_0x576226,_0x2934bc){return new BPromise(function(_0x3c3bf3,_0x4ea1cc){return client[_0x0464('0xc')](_0x10c5d4,_0x2934bc)[_0x0464('0xd')](function(_0x488c27){logger[_0x0464('0xe')](_0x0464('0xf'),_0x576226,_0x0464('0x10'));logger['debug'](_0x0464('0x11'),_0x576226,_0x0464('0x10'),JSON[_0x0464('0x12')](_0x488c27));if(_0x488c27[_0x0464('0x13')]){if(_0x488c27[_0x0464('0x13')]['code']===0x1f4){logger[_0x0464('0x13')](_0x0464('0xf'),_0x576226,_0x488c27['error']['message']);return _0x4ea1cc(_0x488c27[_0x0464('0x13')][_0x0464('0x14')]);}logger[_0x0464('0x13')](_0x0464('0xf'),_0x576226,_0x488c27[_0x0464('0x13')][_0x0464('0x14')]);return _0x3c3bf3(_0x488c27[_0x0464('0x13')][_0x0464('0x14')]);}else{logger[_0x0464('0xe')](_0x0464('0xf'),_0x576226,_0x0464('0x10'));_0x3c3bf3(_0x488c27['result'][_0x0464('0x14')]);}})[_0x0464('0x15')](function(_0x401509){logger[_0x0464('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x576226,_0x401509);_0x4ea1cc(_0x401509);});});} \ No newline at end of file +var _0x73e9=['client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x33b880,_0xa71851){var _0x2390b0=function(_0x2cad49){while(--_0x2cad49){_0x33b880['push'](_0x33b880['shift']());}};_0x2390b0(++_0xa71851);}(_0x73e9,0x132));var _0x973e=function(_0x170d16,_0x443724){_0x170d16=_0x170d16-0x0;var _0x1bf864=_0x73e9[_0x170d16];return _0x1bf864;};'use strict';var _=require(_0x973e('0x0'));var util=require('util');var moment=require(_0x973e('0x1'));var BPromise=require(_0x973e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x973e('0x3'));var db=require(_0x973e('0x4'))['db'];var utils=require(_0x973e('0x5'));var logger=require(_0x973e('0x6'))(_0x973e('0x7'));var config=require(_0x973e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x973e('0x9')][_0x973e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d930c,_0x2f5b09,_0x23b239){return new BPromise(function(_0x2e2288,_0x2a7116){return client['request'](_0x5d930c,_0x23b239)[_0x973e('0xb')](function(_0x2e282c){logger[_0x973e('0xc')](_0x973e('0xd'),_0x2f5b09,_0x973e('0xe'));logger[_0x973e('0xf')](_0x973e('0x10'),_0x2f5b09,_0x973e('0xe'),JSON[_0x973e('0x11')](_0x2e282c));if(_0x2e282c['error']){if(_0x2e282c[_0x973e('0x12')][_0x973e('0x13')]===0x1f4){logger[_0x973e('0x12')](_0x973e('0xd'),_0x2f5b09,_0x2e282c[_0x973e('0x12')]['message']);return _0x2a7116(_0x2e282c[_0x973e('0x12')][_0x973e('0x14')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2f5b09,_0x2e282c[_0x973e('0x12')][_0x973e('0x14')]);return _0x2e2288(_0x2e282c[_0x973e('0x12')][_0x973e('0x14')]);}else{logger[_0x973e('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x2f5b09,'request\x20sent');_0x2e2288(_0x2e282c['result'][_0x973e('0x14')]);}})['catch'](function(_0xc3c32a){logger[_0x973e('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2f5b09,_0xc3c32a);_0x2a7116(_0xc3c32a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e4bd801..8fdaca0 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 _0x2812=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e9bed,_0xde4f27){var _0x28f831=function(_0x200a21){while(--_0x200a21){_0x3e9bed['push'](_0x3e9bed['shift']());}};_0x28f831(++_0xde4f27);}(_0x2812,0x74));var _0x2281=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x2812[_0x462fe4];return _0x82b23a;};'use strict';var multer=require(_0x2281('0x0'));var util=require(_0x2281('0x1'));var path=require(_0x2281('0x2'));var timeout=require(_0x2281('0x3'));var express=require('express');var router=express[_0x2281('0x4')]();var fs_extra=require(_0x2281('0x5'));var auth=require(_0x2281('0x6'));var interaction=require(_0x2281('0x7'));var config=require(_0x2281('0x8'));var controller=require(_0x2281('0x9'));router[_0x2281('0xa')]('/',auth['isAuthenticated'](),controller[_0x2281('0xb')]);router[_0x2281('0xa')](_0x2281('0xc'),auth[_0x2281('0xd')](),controller['describe']);router[_0x2281('0xa')](_0x2281('0xe'),auth[_0x2281('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2281('0xf')]);router['put'](_0x2281('0xe'),auth[_0x2281('0xd')](),controller[_0x2281('0x10')]);router[_0x2281('0x11')](_0x2281('0xe'),auth[_0x2281('0xd')](),controller[_0x2281('0x12')]);module[_0x2281('0x13')]=router; \ No newline at end of file +var _0x7a8d=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','create','destroy'];(function(_0x205e56,_0x366e77){var _0x489d5d=function(_0x130a84){while(--_0x130a84){_0x205e56['push'](_0x205e56['shift']());}};_0x489d5d(++_0x366e77);}(_0x7a8d,0x131));var _0xd7a8=function(_0x3766e0,_0x1cd50e){_0x3766e0=_0x3766e0-0x0;var _0x516338=_0x7a8d[_0x3766e0];return _0x516338;};'use strict';var multer=require('multer');var util=require(_0xd7a8('0x0'));var path=require(_0xd7a8('0x1'));var timeout=require(_0xd7a8('0x2'));var express=require(_0xd7a8('0x3'));var router=express['Router']();var fs_extra=require(_0xd7a8('0x4'));var auth=require(_0xd7a8('0x5'));var interaction=require(_0xd7a8('0x6'));var config=require(_0xd7a8('0x7'));var controller=require(_0xd7a8('0x8'));router[_0xd7a8('0x9')]('/',auth[_0xd7a8('0xa')](),controller[_0xd7a8('0xb')]);router[_0xd7a8('0x9')]('/describe',auth[_0xd7a8('0xa')](),controller[_0xd7a8('0xc')]);router['get'](_0xd7a8('0xd'),auth[_0xd7a8('0xa')](),controller[_0xd7a8('0xe')]);router[_0xd7a8('0xf')]('/',auth[_0xd7a8('0xa')](),controller[_0xd7a8('0x10')]);router['put'](_0xd7a8('0xd'),auth[_0xd7a8('0xa')](),controller['update']);router['delete'](_0xd7a8('0xd'),auth[_0xd7a8('0xa')](),controller[_0xd7a8('0x11')]);module[_0xd7a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4544777..5e685a5 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 _0xa30a=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa30('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa30('0x2')],'set':function(_0x2a9b06){this[_0xaa30('0x5')](_0xaa30('0x6'),_0x2a9b06?_0x2a9b06['join'](''):[]);},'get':function(){return this[_0xaa30('0x7')]('crudPermissions')?this[_0xaa30('0x7')](_0xaa30('0x6'))[_0xaa30('0x8')](''):[];}}}; \ No newline at end of file +var _0xea28=['crudPermissions','join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x5bacdf,_0x3d75d2){var _0x338436=function(_0x1332f3){while(--_0x1332f3){_0x5bacdf['push'](_0x5bacdf['shift']());}};_0x338436(++_0x3d75d2);}(_0xea28,0x13a));var _0x8ea2=function(_0x5c3ce0,_0x1f56eb){_0x5c3ce0=_0x5c3ce0-0x0;var _0x41a26e=_0xea28[_0x5c3ce0];return _0x41a26e;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x8ea2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8ea2('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8ea2('0x2')],'set':function(_0x4b7cda){this[_0x8ea2('0x5')](_0x8ea2('0x6'),_0x4b7cda?_0x4b7cda[_0x8ea2('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0x8ea2('0x6'))?this[_0x8ea2('0x8')](_0x8ea2('0x6'))[_0x8ea2('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 4a9878f..aa91d57 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 _0x371b=['intersection','fields','length','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','map','UserProfileSection','fieldName','type','key','model','query','keys'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x371b,0x105));var _0xb371=function(_0x95ad05,_0x3cadb6){_0x95ad05=_0x95ad05-0x0;var _0x2d79f4=_0x371b[_0x95ad05];return _0x2d79f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb371('0x0'));var zipdir=require(_0xb371('0x1'));var jsonpatch=require(_0xb371('0x2'));var rp=require(_0xb371('0x3'));var moment=require('moment');var BPromise=require(_0xb371('0x4'));var Mustache=require(_0xb371('0x5'));var util=require('util');var path=require(_0xb371('0x6'));var sox=require(_0xb371('0x7'));var csv=require(_0xb371('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb371('0x9'));var _=require(_0xb371('0xa'));var squel=require(_0xb371('0xb'));var crypto=require(_0xb371('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb371('0xd'));var toCsv=require(_0xb371('0x8'));var querystring=require(_0xb371('0xe'));var Papa=require(_0xb371('0xf'));var Redis=require(_0xb371('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb371('0x11'));var as=require(_0xb371('0x12'));var hardwareService=require(_0xb371('0x13'));var logger=require(_0xb371('0x14'))(_0xb371('0x15'));var utils=require(_0xb371('0x16'));var config=require(_0xb371('0x17'));var licenseUtil=require(_0xb371('0x18'));var db=require(_0xb371('0x19'))['db'];function respondWithStatusCode(_0x245256,_0x1f3a92){_0x1f3a92=_0x1f3a92||0xcc;return function(_0x19dea1){if(_0x19dea1){return _0x245256[_0xb371('0x1a')](_0x1f3a92);}return _0x245256['status'](_0x1f3a92)[_0xb371('0x1b')]();};}function respondWithResult(_0x36ddd9,_0x6d299b){_0x6d299b=_0x6d299b||0xc8;return function(_0x23cdb2){if(_0x23cdb2){return _0x36ddd9[_0xb371('0x1c')](_0x6d299b)[_0xb371('0x1d')](_0x23cdb2);}};}function respondWithFilteredResult(_0x39ddd0,_0x5193cb){return function(_0xb1d3f0){if(_0xb1d3f0){var _0x4e9919=typeof _0x5193cb[_0xb371('0x1e')]===_0xb371('0x1f')&&typeof _0x5193cb[_0xb371('0x20')]===_0xb371('0x1f');var _0x2593f0=_0xb1d3f0['count'];var _0x325cb2=_0x4e9919?0x0:_0x5193cb[_0xb371('0x1e')];var _0x30c601=_0x4e9919?_0xb1d3f0['count']:_0x5193cb['offset']+_0x5193cb[_0xb371('0x20')];var _0x649de1;if(_0x30c601>=_0x2593f0){_0x30c601=_0x2593f0;_0x649de1=0xc8;}else{_0x649de1=0xce;}_0x39ddd0['status'](_0x649de1);return _0x39ddd0[_0xb371('0x21')](_0xb371('0x22'),_0x325cb2+'-'+_0x30c601+'/'+_0x2593f0)[_0xb371('0x1d')](_0xb1d3f0);}return null;};}function patchUpdates(_0x2e532f){return function(_0x3d08d7){try{jsonpatch[_0xb371('0x23')](_0x3d08d7,_0x2e532f,!![]);}catch(_0x9c442c){return BPromise[_0xb371('0x24')](_0x9c442c);}return _0x3d08d7[_0xb371('0x25')]();};}function saveUpdates(_0x5383c6,_0x1b725e){return function(_0x149933){if(_0x149933){return _0x149933[_0xb371('0x26')](_0x5383c6)[_0xb371('0x27')](function(_0x879e8c){return _0x879e8c;});}return null;};}function removeEntity(_0x3ca932,_0x1eb51b){return function(_0x1e2adb){if(_0x1e2adb){return _0x1e2adb['destroy']()[_0xb371('0x27')](function(){_0x3ca932[_0xb371('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e996,_0x500e77){return function(_0x4992b3){if(!_0x4992b3){_0x41e996[_0xb371('0x1a')](0x194);}return _0x4992b3;};}function handleError(_0x63ea39,_0x5228e9){_0x5228e9=_0x5228e9||0x1f4;return function(_0x21e361){logger[_0xb371('0x28')](_0x21e361['stack']);if(_0x21e361[_0xb371('0x29')]){delete _0x21e361[_0xb371('0x29')];}_0x63ea39[_0xb371('0x1c')](_0x5228e9)[_0xb371('0x2a')](_0x21e361);};}exports['index']=function(_0x2eeed3,_0x5474ac){var _0x403e45={},_0x40a191={},_0x42f220={'count':0x0,'rows':[]};var _0x590133=_[_0xb371('0x2b')](db[_0xb371('0x2c')]['rawAttributes'],function(_0x381306){return{'name':_0x381306[_0xb371('0x2d')],'type':_0x381306[_0xb371('0x2e')][_0xb371('0x2f')]};});_0x40a191[_0xb371('0x30')]=_['map'](_0x590133,_0xb371('0x29'));_0x40a191[_0xb371('0x31')]=_[_0xb371('0x32')](_0x2eeed3[_0xb371('0x31')]);_0x40a191['filters']=_[_0xb371('0x33')](_0x40a191[_0xb371('0x30')],_0x40a191[_0xb371('0x31')]);_0x403e45['attributes']=_['intersection'](_0x40a191[_0xb371('0x30')],qs[_0xb371('0x34')](_0x2eeed3[_0xb371('0x31')][_0xb371('0x34')]));_0x403e45['attributes']=_0x403e45['attributes'][_0xb371('0x35')]?_0x403e45[_0xb371('0x36')]:_0x40a191[_0xb371('0x30')];if(!_0x2eeed3[_0xb371('0x31')]['hasOwnProperty'](_0xb371('0x37'))){_0x403e45[_0xb371('0x20')]=qs['limit'](_0x2eeed3['query'][_0xb371('0x20')]);_0x403e45['offset']=qs[_0xb371('0x1e')](_0x2eeed3['query']['offset']);}_0x403e45[_0xb371('0x38')]=qs[_0xb371('0x39')](_0x2eeed3[_0xb371('0x31')][_0xb371('0x39')]);_0x403e45[_0xb371('0x3a')]=qs[_0xb371('0x3b')](_[_0xb371('0x3c')](_0x2eeed3[_0xb371('0x31')],_0x40a191[_0xb371('0x3b')]),_0x590133);if(_0x2eeed3[_0xb371('0x31')]['filter']){_0x403e45[_0xb371('0x3a')]=_[_0xb371('0x3d')](_0x403e45['where'],{'$or':_[_0xb371('0x2b')](_0x590133,function(_0x2419ea){if(_0x2419ea[_0xb371('0x2e')]!==_0xb371('0x3e')){var _0x2c9882={};_0x2c9882[_0x2419ea[_0xb371('0x29')]]={'$like':'%'+_0x2eeed3[_0xb371('0x31')][_0xb371('0x3f')]+'%'};return _0x2c9882;}})});}_0x403e45=_[_0xb371('0x3d')]({},_0x403e45,_0x2eeed3[_0xb371('0x40')]);var _0x4cda46={'where':_0x403e45['where']};return db[_0xb371('0x2c')][_0xb371('0x41')](_0x4cda46)[_0xb371('0x27')](function(_0x3e001b){_0x42f220[_0xb371('0x41')]=_0x3e001b;if(_0x2eeed3[_0xb371('0x31')]['includeAll']){_0x403e45[_0xb371('0x42')]=[{'all':!![]}];}return db[_0xb371('0x2c')][_0xb371('0x43')](_0x403e45);})[_0xb371('0x27')](function(_0x3fbcd1){_0x42f220[_0xb371('0x44')]=_0x3fbcd1;return _0x42f220;})['then'](respondWithFilteredResult(_0x5474ac,_0x403e45))[_0xb371('0x45')](handleError(_0x5474ac,null));};exports['show']=function(_0x551947,_0x3adb7f){var _0x4a7620={'raw':![],'where':{'id':_0x551947['params']['id']}},_0x160028={};_0x160028[_0xb371('0x30')]=_[_0xb371('0x32')](db[_0xb371('0x2c')][_0xb371('0x46')]);_0x160028[_0xb371('0x31')]=_[_0xb371('0x32')](_0x551947[_0xb371('0x31')]);_0x160028[_0xb371('0x3b')]=_[_0xb371('0x33')](_0x160028[_0xb371('0x30')],_0x160028[_0xb371('0x31')]);_0x4a7620[_0xb371('0x36')]=_[_0xb371('0x33')](_0x160028[_0xb371('0x30')],qs['fields'](_0x551947['query'][_0xb371('0x34')]));_0x4a7620['attributes']=_0x4a7620[_0xb371('0x36')]['length']?_0x4a7620[_0xb371('0x36')]:_0x160028['model'];if(_0x551947[_0xb371('0x31')][_0xb371('0x47')]){_0x4a7620[_0xb371('0x42')]=[{'all':!![]}];}_0x4a7620=_[_0xb371('0x3d')]({},_0x4a7620,_0x551947[_0xb371('0x40')]);return db[_0xb371('0x2c')][_0xb371('0x48')](_0x4a7620)[_0xb371('0x27')](handleEntityNotFound(_0x3adb7f,null))[_0xb371('0x27')](respondWithResult(_0x3adb7f,null))[_0xb371('0x45')](handleError(_0x3adb7f,null));};exports[_0xb371('0x49')]=function(_0x2e502e,_0x3323ab){return db[_0xb371('0x2c')][_0xb371('0x49')](_0x2e502e['body'],{})[_0xb371('0x27')](respondWithResult(_0x3323ab,0xc9))['catch'](handleError(_0x3323ab,null));};exports[_0xb371('0x26')]=function(_0x12b451,_0x43b498){if(_0x12b451[_0xb371('0x4a')]['id']){delete _0x12b451[_0xb371('0x4a')]['id'];}return db['UserProfileSection'][_0xb371('0x48')]({'where':{'id':_0x12b451[_0xb371('0x4b')]['id']}})[_0xb371('0x27')](handleEntityNotFound(_0x43b498,null))[_0xb371('0x27')](saveUpdates(_0x12b451[_0xb371('0x4a')],null))[_0xb371('0x27')](respondWithResult(_0x43b498,null))['catch'](handleError(_0x43b498,null));};exports[_0xb371('0x4c')]=function(_0x1878fd,_0xe342e1){return db[_0xb371('0x2c')][_0xb371('0x48')]({'where':{'id':_0x1878fd[_0xb371('0x4b')]['id']}})[_0xb371('0x27')](handleEntityNotFound(_0xe342e1,null))['then'](removeEntity(_0xe342e1,null))[_0xb371('0x45')](handleError(_0xe342e1,null));};exports[_0xb371('0x4d')]=function(_0x22adbb,_0xba83ba){return db[_0xb371('0x2c')][_0xb371('0x4d')]()[_0xb371('0x27')](respondWithResult(_0xba83ba,null))['catch'](handleError(_0xba83ba,null));}; \ No newline at end of file +var _0x1e48=['UserProfileSection','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','index'];(function(_0x836cb7,_0x6ccac){var _0x3591a4=function(_0x17939c){while(--_0x17939c){_0x836cb7['push'](_0x836cb7['shift']());}};_0x3591a4(++_0x6ccac);}(_0x1e48,0xb7));var _0x81e4=function(_0x28c1c0,_0x2398aa){_0x28c1c0=_0x28c1c0-0x0;var _0x2ff1e3=_0x1e48[_0x28c1c0];return _0x2ff1e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81e4('0x0'));var zipdir=require(_0x81e4('0x1'));var jsonpatch=require(_0x81e4('0x2'));var rp=require(_0x81e4('0x3'));var moment=require(_0x81e4('0x4'));var BPromise=require(_0x81e4('0x5'));var Mustache=require('mustache');var util=require(_0x81e4('0x6'));var path=require(_0x81e4('0x7'));var sox=require(_0x81e4('0x8'));var csv=require('to-csv');var ejs=require(_0x81e4('0x9'));var fs=require('fs');var fs_extra=require(_0x81e4('0xa'));var _=require(_0x81e4('0xb'));var squel=require(_0x81e4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x81e4('0xd'));var Papa=require(_0x81e4('0xe'));var Redis=require(_0x81e4('0xf'));var authService=require(_0x81e4('0x10'));var qs=require(_0x81e4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81e4('0x12'));var logger=require(_0x81e4('0x13'))(_0x81e4('0x14'));var utils=require(_0x81e4('0x15'));var config=require(_0x81e4('0x16'));var licenseUtil=require(_0x81e4('0x17'));var db=require(_0x81e4('0x18'))['db'];function respondWithStatusCode(_0x5270cf,_0x2ebed4){_0x2ebed4=_0x2ebed4||0xcc;return function(_0x445b35){if(_0x445b35){return _0x5270cf[_0x81e4('0x19')](_0x2ebed4);}return _0x5270cf[_0x81e4('0x1a')](_0x2ebed4)['end']();};}function respondWithResult(_0x439deb,_0x182e1c){_0x182e1c=_0x182e1c||0xc8;return function(_0x42b779){if(_0x42b779){return _0x439deb[_0x81e4('0x1a')](_0x182e1c)[_0x81e4('0x1b')](_0x42b779);}};}function respondWithFilteredResult(_0x17fab9,_0x519a5d){return function(_0x4a0af0){if(_0x4a0af0){var _0x58453b=typeof _0x519a5d[_0x81e4('0x1c')]===_0x81e4('0x1d')&&typeof _0x519a5d[_0x81e4('0x1e')]===_0x81e4('0x1d');var _0x3fd755=_0x4a0af0[_0x81e4('0x1f')];var _0x317b32=_0x58453b?0x0:_0x519a5d[_0x81e4('0x1c')];var _0xaa6875=_0x58453b?_0x4a0af0[_0x81e4('0x1f')]:_0x519a5d[_0x81e4('0x1c')]+_0x519a5d['limit'];var _0x40d2b2;if(_0xaa6875>=_0x3fd755){_0xaa6875=_0x3fd755;_0x40d2b2=0xc8;}else{_0x40d2b2=0xce;}_0x17fab9[_0x81e4('0x1a')](_0x40d2b2);return _0x17fab9[_0x81e4('0x20')]('Content-Range',_0x317b32+'-'+_0xaa6875+'/'+_0x3fd755)['json'](_0x4a0af0);}return null;};}function patchUpdates(_0x6dd9f5){return function(_0x1f3767){try{jsonpatch[_0x81e4('0x21')](_0x1f3767,_0x6dd9f5,!![]);}catch(_0x227392){return BPromise['reject'](_0x227392);}return _0x1f3767[_0x81e4('0x22')]();};}function saveUpdates(_0x5aa4ab,_0x3253f7){return function(_0x10b1fb){if(_0x10b1fb){return _0x10b1fb[_0x81e4('0x23')](_0x5aa4ab)['then'](function(_0x24ac3c){return _0x24ac3c;});}return null;};}function removeEntity(_0xdc7d82,_0x175eae){return function(_0x4978dc){if(_0x4978dc){return _0x4978dc[_0x81e4('0x24')]()[_0x81e4('0x25')](function(){_0xdc7d82[_0x81e4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8df954,_0x1124e4){return function(_0x17c7aa){if(!_0x17c7aa){_0x8df954[_0x81e4('0x19')](0x194);}return _0x17c7aa;};}function handleError(_0x5a1614,_0x183010){_0x183010=_0x183010||0x1f4;return function(_0x565594){logger[_0x81e4('0x26')](_0x565594[_0x81e4('0x27')]);if(_0x565594[_0x81e4('0x28')]){delete _0x565594[_0x81e4('0x28')];}_0x5a1614[_0x81e4('0x1a')](_0x183010)['send'](_0x565594);};}exports[_0x81e4('0x29')]=function(_0x3760ce,_0x928e1){var _0x24fdf6={},_0x5af461={},_0x1bd294={'count':0x0,'rows':[]};var _0x3c3cfe=_['map'](db[_0x81e4('0x2a')][_0x81e4('0x2b')],function(_0x1591f1){return{'name':_0x1591f1[_0x81e4('0x2c')],'type':_0x1591f1[_0x81e4('0x2d')]['key']};});_0x5af461[_0x81e4('0x2e')]=_[_0x81e4('0x2f')](_0x3c3cfe,_0x81e4('0x28'));_0x5af461[_0x81e4('0x30')]=_[_0x81e4('0x31')](_0x3760ce['query']);_0x5af461[_0x81e4('0x32')]=_[_0x81e4('0x33')](_0x5af461[_0x81e4('0x2e')],_0x5af461['query']);_0x24fdf6[_0x81e4('0x34')]=_['intersection'](_0x5af461[_0x81e4('0x2e')],qs[_0x81e4('0x35')](_0x3760ce['query']['fields']));_0x24fdf6['attributes']=_0x24fdf6[_0x81e4('0x34')]['length']?_0x24fdf6[_0x81e4('0x34')]:_0x5af461[_0x81e4('0x2e')];if(!_0x3760ce['query'][_0x81e4('0x36')](_0x81e4('0x37'))){_0x24fdf6[_0x81e4('0x1e')]=qs[_0x81e4('0x1e')](_0x3760ce[_0x81e4('0x30')][_0x81e4('0x1e')]);_0x24fdf6[_0x81e4('0x1c')]=qs[_0x81e4('0x1c')](_0x3760ce[_0x81e4('0x30')][_0x81e4('0x1c')]);}_0x24fdf6[_0x81e4('0x38')]=qs[_0x81e4('0x39')](_0x3760ce[_0x81e4('0x30')][_0x81e4('0x39')]);_0x24fdf6['where']=qs[_0x81e4('0x32')](_[_0x81e4('0x3a')](_0x3760ce[_0x81e4('0x30')],_0x5af461[_0x81e4('0x32')]),_0x3c3cfe);if(_0x3760ce[_0x81e4('0x30')][_0x81e4('0x3b')]){_0x24fdf6[_0x81e4('0x3c')]=_['merge'](_0x24fdf6[_0x81e4('0x3c')],{'$or':_['map'](_0x3c3cfe,function(_0x434f3d){if(_0x434f3d[_0x81e4('0x2d')]!==_0x81e4('0x3d')){var _0x379278={};_0x379278[_0x434f3d['name']]={'$like':'%'+_0x3760ce[_0x81e4('0x30')]['filter']+'%'};return _0x379278;}})});}_0x24fdf6=_[_0x81e4('0x3e')]({},_0x24fdf6,_0x3760ce['options']);var _0x21b656={'where':_0x24fdf6[_0x81e4('0x3c')]};return db[_0x81e4('0x2a')]['count'](_0x21b656)[_0x81e4('0x25')](function(_0x1d2870){_0x1bd294['count']=_0x1d2870;if(_0x3760ce[_0x81e4('0x30')][_0x81e4('0x3f')]){_0x24fdf6[_0x81e4('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0x81e4('0x41')](_0x24fdf6);})['then'](function(_0x3c3c71){_0x1bd294[_0x81e4('0x42')]=_0x3c3c71;return _0x1bd294;})[_0x81e4('0x25')](respondWithFilteredResult(_0x928e1,_0x24fdf6))[_0x81e4('0x43')](handleError(_0x928e1,null));};exports[_0x81e4('0x44')]=function(_0x448be8,_0x404892){var _0x2de0cf={'raw':![],'where':{'id':_0x448be8[_0x81e4('0x45')]['id']}},_0x3142da={};_0x3142da[_0x81e4('0x2e')]=_[_0x81e4('0x31')](db[_0x81e4('0x2a')]['rawAttributes']);_0x3142da[_0x81e4('0x30')]=_['keys'](_0x448be8[_0x81e4('0x30')]);_0x3142da[_0x81e4('0x32')]=_[_0x81e4('0x33')](_0x3142da[_0x81e4('0x2e')],_0x3142da['query']);_0x2de0cf[_0x81e4('0x34')]=_['intersection'](_0x3142da[_0x81e4('0x2e')],qs[_0x81e4('0x35')](_0x448be8['query'][_0x81e4('0x35')]));_0x2de0cf['attributes']=_0x2de0cf[_0x81e4('0x34')][_0x81e4('0x46')]?_0x2de0cf[_0x81e4('0x34')]:_0x3142da[_0x81e4('0x2e')];if(_0x448be8[_0x81e4('0x30')]['includeAll']){_0x2de0cf[_0x81e4('0x40')]=[{'all':!![]}];}_0x2de0cf=_[_0x81e4('0x3e')]({},_0x2de0cf,_0x448be8['options']);return db['UserProfileSection'][_0x81e4('0x47')](_0x2de0cf)[_0x81e4('0x25')](handleEntityNotFound(_0x404892,null))['then'](respondWithResult(_0x404892,null))[_0x81e4('0x43')](handleError(_0x404892,null));};exports[_0x81e4('0x48')]=function(_0x20e6e1,_0x3e69e3){return db['UserProfileSection'][_0x81e4('0x48')](_0x20e6e1[_0x81e4('0x49')],{})[_0x81e4('0x25')](respondWithResult(_0x3e69e3,0xc9))['catch'](handleError(_0x3e69e3,null));};exports['update']=function(_0x2f9ef7,_0x1dc889){if(_0x2f9ef7[_0x81e4('0x49')]['id']){delete _0x2f9ef7[_0x81e4('0x49')]['id'];}return db[_0x81e4('0x2a')][_0x81e4('0x47')]({'where':{'id':_0x2f9ef7['params']['id']}})['then'](handleEntityNotFound(_0x1dc889,null))[_0x81e4('0x25')](saveUpdates(_0x2f9ef7['body'],null))[_0x81e4('0x25')](respondWithResult(_0x1dc889,null))[_0x81e4('0x43')](handleError(_0x1dc889,null));};exports[_0x81e4('0x24')]=function(_0x23bb3f,_0x22e39d){return db[_0x81e4('0x2a')]['find']({'where':{'id':_0x23bb3f[_0x81e4('0x45')]['id']}})[_0x81e4('0x25')](handleEntityNotFound(_0x22e39d,null))[_0x81e4('0x25')](removeEntity(_0x22e39d,null))[_0x81e4('0x43')](handleError(_0x22e39d,null));};exports[_0x81e4('0x4a')]=function(_0x400d6c,_0x1024e2){return db['UserProfileSection'][_0x81e4('0x4a')]()['then'](respondWithResult(_0x1024e2,null))[_0x81e4('0x43')](handleError(_0x1024e2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cdbb78e..a34de02 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 _0xde7e=['exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x5b924a,_0x557cdf){var _0x47286a=function(_0x15d22d){while(--_0x15d22d){_0x5b924a['push'](_0x5b924a['shift']());}};_0x47286a(++_0x557cdf);}(_0xde7e,0x18d));var _0xede7=function(_0x1ac6ac,_0x35708c){_0x1ac6ac=_0x1ac6ac-0x0;var _0x36c106=_0xde7e[_0x1ac6ac];return _0x36c106;};'use strict';var _=require(_0xede7('0x0'));var util=require(_0xede7('0x1'));var logger=require(_0xede7('0x2'))(_0xede7('0x3'));var moment=require(_0xede7('0x4'));var BPromise=require(_0xede7('0x5'));var rp=require(_0xede7('0x6'));var fs=require('fs');var path=require(_0xede7('0x7'));var rimraf=require(_0xede7('0x8'));var config=require(_0xede7('0x9'));var attributes=require(_0xede7('0xa'));module[_0xede7('0xb')]=function(_0x5957d1,_0x1b99b9){return _0x5957d1[_0xede7('0xc')](_0xede7('0xd'),attributes,{'tableName':_0xede7('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xede7('0xf'),_0xede7('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x48a0=['util','../../config/logger','api','moment','bluebird','rimraf','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash'];(function(_0x1fd2f3,_0x5c6583){var _0x5c41cd=function(_0x47c75c){while(--_0x47c75c){_0x1fd2f3['push'](_0x1fd2f3['shift']());}};_0x5c41cd(++_0x5c6583);}(_0x48a0,0x1e3));var _0x048a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x48a0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x048a('0x0'));var util=require(_0x048a('0x1'));var logger=require(_0x048a('0x2'))(_0x048a('0x3'));var moment=require(_0x048a('0x4'));var BPromise=require(_0x048a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x048a('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x40ba00,_0x5b7ca2){return _0x40ba00['define'](_0x048a('0x7'),attributes,{'tableName':_0x048a('0x8'),'paranoid':![],'indexes':[{'name':_0x048a('0x9'),'fields':['sectionId',_0x048a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 70ba957..282f053 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 _0x0d45=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','ioredis'];(function(_0x448bbf,_0x146fef){var _0xfc7d4a=function(_0x4dfdb7){while(--_0x4dfdb7){_0x448bbf['push'](_0x448bbf['shift']());}};_0xfc7d4a(++_0x146fef);}(_0x0d45,0x153));var _0x50d4=function(_0x115bc7,_0x3d96d1){_0x115bc7=_0x115bc7-0x0;var _0x171cd8=_0x0d45[_0x115bc7];return _0x171cd8;};'use strict';var _=require(_0x50d4('0x0'));var util=require(_0x50d4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50d4('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50d4('0x3'))(_0x50d4('0x4'));var config=require(_0x50d4('0x5'));var jayson=require(_0x50d4('0x6'));var client=jayson[_0x50d4('0x7')][_0x50d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41465e,_0x13633e,_0x1f9576){return new BPromise(function(_0x6b43a3,_0x44b3ae){return client[_0x50d4('0x9')](_0x41465e,_0x1f9576)[_0x50d4('0xa')](function(_0x4d94bb){logger[_0x50d4('0xb')](_0x50d4('0xc'),_0x13633e,_0x50d4('0xd'));logger['debug'](_0x50d4('0xe'),_0x13633e,'request\x20sent',JSON['stringify'](_0x4d94bb));if(_0x4d94bb['error']){if(_0x4d94bb[_0x50d4('0xf')][_0x50d4('0x10')]===0x1f4){logger[_0x50d4('0xf')](_0x50d4('0xc'),_0x13633e,_0x4d94bb[_0x50d4('0xf')][_0x50d4('0x11')]);return _0x44b3ae(_0x4d94bb[_0x50d4('0xf')][_0x50d4('0x11')]);}logger[_0x50d4('0xf')](_0x50d4('0xc'),_0x13633e,_0x4d94bb[_0x50d4('0xf')][_0x50d4('0x11')]);return _0x6b43a3(_0x4d94bb['error']['message']);}else{logger[_0x50d4('0xb')](_0x50d4('0xc'),_0x13633e,_0x50d4('0xd'));_0x6b43a3(_0x4d94bb[_0x50d4('0x12')]['message']);}})['catch'](function(_0x56f374){logger[_0x50d4('0xf')](_0x50d4('0xc'),_0x13633e,_0x56f374);_0x44b3ae(_0x56f374);});});} \ No newline at end of file +var _0x30e2=['error','code','UserProfileSection,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5c9355,_0x3d0880){var _0x227c02=function(_0x269ccd){while(--_0x269ccd){_0x5c9355['push'](_0x5c9355['shift']());}};_0x227c02(++_0x3d0880);}(_0x30e2,0x6f));var _0x230e=function(_0x309957,_0x1bc114){_0x309957=_0x309957-0x0;var _0x1c37ec=_0x30e2[_0x309957];return _0x1c37ec;};'use strict';var _=require('lodash');var util=require(_0x230e('0x0'));var moment=require('moment');var BPromise=require(_0x230e('0x1'));var rs=require(_0x230e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x230e('0x3'))['db'];var utils=require(_0x230e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x230e('0x5'));var jayson=require(_0x230e('0x6'));var client=jayson[_0x230e('0x7')][_0x230e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a8dda,_0x196b63,_0x532c0f){return new BPromise(function(_0x448526,_0x495a1c){return client[_0x230e('0x9')](_0x5a8dda,_0x532c0f)[_0x230e('0xa')](function(_0x5b8341){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x196b63,'request\x20sent');logger[_0x230e('0xb')](_0x230e('0xc'),_0x196b63,_0x230e('0xd'),JSON[_0x230e('0xe')](_0x5b8341));if(_0x5b8341['error']){if(_0x5b8341[_0x230e('0xf')][_0x230e('0x10')]===0x1f4){logger['error'](_0x230e('0x11'),_0x196b63,_0x5b8341[_0x230e('0xf')][_0x230e('0x12')]);return _0x495a1c(_0x5b8341[_0x230e('0xf')][_0x230e('0x12')]);}logger[_0x230e('0xf')](_0x230e('0x11'),_0x196b63,_0x5b8341[_0x230e('0xf')][_0x230e('0x12')]);return _0x448526(_0x5b8341[_0x230e('0xf')][_0x230e('0x12')]);}else{logger[_0x230e('0x13')](_0x230e('0x11'),_0x196b63,_0x230e('0xd'));_0x448526(_0x5b8341['result'][_0x230e('0x12')]);}})[_0x230e('0x14')](function(_0x106788){logger['error'](_0x230e('0x11'),_0x196b63,_0x106788);_0x495a1c(_0x106788);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d71375c..7fd3eea 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x243caf,_0x237fab){var _0x44799f=function(_0x3e9df4){while(--_0x3e9df4){_0x243caf['push'](_0x243caf['shift']());}};_0x44799f(++_0x237fab);}(_0xe706,0xa3));var _0x6e70=function(_0x23f19e,_0x4d583b){_0x23f19e=_0x23f19e-0x0;var _0x2a95d4=_0xe706[_0x23f19e];return _0x2a95d4;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x43514e,_0x34e593){var _0x37a2ae=function(_0x80a6c1){while(--_0x80a6c1){_0x43514e['push'](_0x43514e['shift']());}};_0x37a2ae(++_0x34e593);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0xcb91[_0x3792e6];return _0x441e44;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4b3e932..3727395 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 _0x2b2f=['INTEGER','sequelize'];(function(_0x399a9a,_0x21749b){var _0x1c8673=function(_0x593a43){while(--_0x593a43){_0x399a9a['push'](_0x399a9a['shift']());}};_0x1c8673(++_0x21749b);}(_0x2b2f,0x137));var _0xf2b2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2b2f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf2b2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf2b2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b19=['exports','INTEGER','sequelize'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9b19,0x7d));var _0x99b1=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0x9b19[_0x146837];return _0x3d7e60;};'use strict';var Sequelize=require(_0x99b1('0x0'));module[_0x99b1('0x1')]={'penalty':{'type':Sequelize[_0x99b1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 3a266af..5579f02 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 _0xd481=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xd481,0x1e4));var _0x1d48=function(_0x4408dd,_0x1eb9ea){_0x4408dd=_0x4408dd-0x0;var _0x3f5d20=_0xd481[_0x4408dd];return _0x3f5d20;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e4b=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','../../config/environment'];(function(_0x51816c,_0x25e62a){var _0x150a29=function(_0xd04f2a){while(--_0xd04f2a){_0x51816c['push'](_0x51816c['shift']());}};_0x150a29(++_0x25e62a);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x20f877,_0x5c32af){_0x20f877=_0x20f877-0x0;var _0x5de151=_0x0e4b[_0x20f877];return _0x5de151;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var logger=require(_0xb0e4('0x2'))('api');var moment=require(_0xb0e4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module['exports']=function(_0x45bdf2,_0x3b56c3){return _0x45bdf2[_0xb0e4('0x6')](_0xb0e4('0x7'),attributes,{'tableName':_0xb0e4('0x8'),'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 e34961a..f3700af 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 _0xd6ad=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x118389,_0x4c0821){var _0x367275=function(_0x329ddd){while(--_0x329ddd){_0x118389['push'](_0x118389['shift']());}};_0x367275(++_0x4c0821);}(_0xd6ad,0x125));var _0xdd6a=function(_0x28278f,_0x574b0d){_0x28278f=_0x28278f-0x0;var _0x3d9f74=_0xd6ad[_0x28278f];return _0x3d9f74;};'use strict';var _=require(_0xdd6a('0x0'));var util=require(_0xdd6a('0x1'));var moment=require(_0xdd6a('0x2'));var BPromise=require(_0xdd6a('0x3'));var rs=require(_0xdd6a('0x4'));var fs=require('fs');var Redis=require(_0xdd6a('0x5'));var db=require(_0xdd6a('0x6'))['db'];var utils=require(_0xdd6a('0x7'));var logger=require(_0xdd6a('0x8'))(_0xdd6a('0x9'));var config=require(_0xdd6a('0xa'));var jayson=require(_0xdd6a('0xb'));var client=jayson['client'][_0xdd6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26dcd5,_0x8f61f8,_0x853295){return new BPromise(function(_0x74641c,_0x354bcf){return client[_0xdd6a('0xd')](_0x26dcd5,_0x853295)[_0xdd6a('0xe')](function(_0x57eb5b){logger['info'](_0xdd6a('0xf'),_0x8f61f8,'request\x20sent');logger[_0xdd6a('0x10')](_0xdd6a('0x11'),_0x8f61f8,_0xdd6a('0x12'),JSON[_0xdd6a('0x13')](_0x57eb5b));if(_0x57eb5b[_0xdd6a('0x14')]){if(_0x57eb5b[_0xdd6a('0x14')][_0xdd6a('0x15')]===0x1f4){logger[_0xdd6a('0x14')](_0xdd6a('0xf'),_0x8f61f8,_0x57eb5b[_0xdd6a('0x14')][_0xdd6a('0x16')]);return _0x354bcf(_0x57eb5b['error'][_0xdd6a('0x16')]);}logger[_0xdd6a('0x14')](_0xdd6a('0xf'),_0x8f61f8,_0x57eb5b[_0xdd6a('0x14')]['message']);return _0x74641c(_0x57eb5b[_0xdd6a('0x14')][_0xdd6a('0x16')]);}else{logger[_0xdd6a('0x17')](_0xdd6a('0xf'),_0x8f61f8,_0xdd6a('0x12'));_0x74641c(_0x57eb5b['result'][_0xdd6a('0x16')]);}})[_0xdd6a('0x18')](function(_0x188431){logger['error'](_0xdd6a('0xf'),_0x8f61f8,_0x188431);_0x354bcf(_0x188431);});});} \ No newline at end of file +var _0x8da3=['jayson/promise','client','then','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4a1347,_0x47a012){var _0x40c48c=function(_0x55956e){while(--_0x55956e){_0x4a1347['push'](_0x4a1347['shift']());}};_0x40c48c(++_0x47a012);}(_0x8da3,0xc5));var _0x38da=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x8da3[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x38da('0x0'));var util=require(_0x38da('0x1'));var moment=require(_0x38da('0x2'));var BPromise=require(_0x38da('0x3'));var rs=require(_0x38da('0x4'));var fs=require('fs');var Redis=require(_0x38da('0x5'));var db=require(_0x38da('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x38da('0x7'))(_0x38da('0x8'));var config=require(_0x38da('0x9'));var jayson=require(_0x38da('0xa'));var client=jayson[_0x38da('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b1120,_0x3b882d,_0x3fb0ee){return new BPromise(function(_0x39664a,_0x1db61d){return client['request'](_0x4b1120,_0x3fb0ee)[_0x38da('0xc')](function(_0x34cbdd){logger[_0x38da('0xd')](_0x38da('0xe'),_0x3b882d,'request\x20sent');logger[_0x38da('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3b882d,_0x38da('0x10'),JSON[_0x38da('0x11')](_0x34cbdd));if(_0x34cbdd[_0x38da('0x12')]){if(_0x34cbdd[_0x38da('0x12')][_0x38da('0x13')]===0x1f4){logger[_0x38da('0x12')](_0x38da('0xe'),_0x3b882d,_0x34cbdd[_0x38da('0x12')][_0x38da('0x14')]);return _0x1db61d(_0x34cbdd[_0x38da('0x12')][_0x38da('0x14')]);}logger[_0x38da('0x12')](_0x38da('0xe'),_0x3b882d,_0x34cbdd['error'][_0x38da('0x14')]);return _0x39664a(_0x34cbdd[_0x38da('0x12')][_0x38da('0x14')]);}else{logger[_0x38da('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x3b882d,_0x38da('0x10'));_0x39664a(_0x34cbdd[_0x38da('0x15')][_0x38da('0x14')]);}})[_0x38da('0x16')](function(_0x1da77b){logger[_0x38da('0x12')](_0x38da('0xe'),_0x3b882d,_0x1da77b);_0x1db61d(_0x1da77b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f9a920f..5f13145 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 _0xb5f0=['sequelize','INTEGER'];(function(_0x330bb0,_0x236133){var _0x4aa462=function(_0x1e96b2){while(--_0x1e96b2){_0x330bb0['push'](_0x330bb0['shift']());}};_0x4aa462(++_0x236133);}(_0xb5f0,0x15e));var _0x0b5f=function(_0x526e5f,_0x57bd2f){_0x526e5f=_0x526e5f-0x0;var _0x4a83c6=_0xb5f0[_0x526e5f];return _0x4a83c6;};'use strict';var Sequelize=require(_0x0b5f('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x0b5f('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x0b5f('0x1')]}}; \ No newline at end of file +var _0x64e8=['sequelize','exports','INTEGER'];(function(_0x1b99c1,_0x458b7f){var _0x2aa03f=function(_0x1be3ad){while(--_0x1be3ad){_0x1b99c1['push'](_0x1b99c1['shift']());}};_0x2aa03f(++_0x458b7f);}(_0x64e8,0x123));var _0x864e=function(_0x433115,_0x2ba527){_0x433115=_0x433115-0x0;var _0x5ed457=_0x64e8[_0x433115];return _0x5ed457;};'use strict';var Sequelize=require(_0x864e('0x0'));module[_0x864e('0x1')]={'UserId':{'type':Sequelize[_0x864e('0x2')]},'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 98786bc..dcb6bff 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(_0x35690b,_0x44bdbf){var _0x22ef5b=function(_0x25a374){while(--_0x25a374){_0x35690b['push'](_0x35690b['shift']());}};_0x22ef5b(++_0x44bdbf);}(_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':'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(_0x47b7af,_0x24a670){var _0x1db708=function(_0x5608da){while(--_0x5608da){_0x47b7af['push'](_0x47b7af['shift']());}};_0x1db708(++_0x24a670);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 e534cc6..b8eb6a4 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x99d37,_0x4e7974){var _0x2db098=function(_0x1ebfa2){while(--_0x1ebfa2){_0x99d37['push'](_0x99d37['shift']());}};_0x2db098(++_0x4e7974);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1a9782,_0x15760c){var _0x58b4d0=function(_0x531d10){while(--_0x531d10){_0x1a9782['push'](_0x1a9782['shift']());}};_0x58b4d0(++_0x15760c);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index cfa9491..75f3924 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 _0x5991=['exports','INTEGER','sequelize'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x5991,0x1f4));var _0x1599=function(_0x52f26c,_0x18247e){_0x52f26c=_0x52f26c-0x0;var _0xff777f=_0x5991[_0x52f26c];return _0xff777f;};'use strict';var Sequelize=require(_0x1599('0x0'));module[_0x1599('0x1')]={'penalty':{'type':Sequelize[_0x1599('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xacbd=['sequelize','INTEGER'];(function(_0x5e80fb,_0x8f0875){var _0x172130=function(_0x282bb2){while(--_0x282bb2){_0x5e80fb['push'](_0x5e80fb['shift']());}};_0x172130(++_0x8f0875);}(_0xacbd,0x8a));var _0xdacb=function(_0x1cc4c8,_0x40b9c3){_0x1cc4c8=_0x1cc4c8-0x0;var _0x5a936b=_0xacbd[_0x1cc4c8];return _0x5a936b;};'use strict';var Sequelize=require(_0xdacb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdacb('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 6062705..5add55c 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 _0x2dfa=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x2dfa,0x87));var _0xa2df=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2dfa[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa2df('0x0'));var util=require(_0xa2df('0x1'));var logger=require(_0xa2df('0x2'))(_0xa2df('0x3'));var moment=require(_0xa2df('0x4'));var BPromise=require(_0xa2df('0x5'));var rp=require(_0xa2df('0x6'));var fs=require('fs');var path=require(_0xa2df('0x7'));var rimraf=require(_0xa2df('0x8'));var config=require(_0xa2df('0x9'));var attributes=require(_0xa2df('0xa'));module[_0xa2df('0xb')]=function(_0x3a9aed,_0x19ebd6){return _0x3a9aed['define'](_0xa2df('0xc'),attributes,{'tableName':_0xa2df('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9ec=['user_has_voice_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x3c7ec3,_0x2a5636){var _0x4fb873=function(_0x411ebb){while(--_0x411ebb){_0x3c7ec3['push'](_0x3c7ec3['shift']());}};_0x4fb873(++_0x2a5636);}(_0xc9ec,0x6d));var _0xcc9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xc9ec[_0x25bea7];return _0x175952;};'use strict';var _=require(_0xcc9e('0x0'));var util=require(_0xcc9e('0x1'));var logger=require(_0xcc9e('0x2'))('api');var moment=require(_0xcc9e('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc9e('0x4'));var fs=require('fs');var path=require(_0xcc9e('0x5'));var rimraf=require(_0xcc9e('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc9e('0x7'));module[_0xcc9e('0x8')]=function(_0x201fd1,_0x569be5){return _0x201fd1[_0xcc9e('0x9')](_0xcc9e('0xa'),attributes,{'tableName':_0xcc9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index b397941..b5b2d79 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 _0x9d52=['then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x186680,_0x4ba94c){var _0x49606a=function(_0x2bfd17){while(--_0x2bfd17){_0x186680['push'](_0x186680['shift']());}};_0x49606a(++_0x4ba94c);}(_0x9d52,0x16a));var _0x29d5=function(_0x8e74c4,_0x4c3b72){_0x8e74c4=_0x8e74c4-0x0;var _0x50e53f=_0x9d52[_0x8e74c4];return _0x50e53f;};'use strict';var _=require('lodash');var util=require(_0x29d5('0x0'));var moment=require(_0x29d5('0x1'));var BPromise=require(_0x29d5('0x2'));var rs=require(_0x29d5('0x3'));var fs=require('fs');var Redis=require(_0x29d5('0x4'));var db=require(_0x29d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29d5('0x6'))(_0x29d5('0x7'));var config=require(_0x29d5('0x8'));var jayson=require(_0x29d5('0x9'));var client=jayson[_0x29d5('0xa')][_0x29d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54db59,_0x3a3b3c,_0x152081){return new BPromise(function(_0x183a8a,_0x1fcab0){return client['request'](_0x54db59,_0x152081)[_0x29d5('0xc')](function(_0x1a8931){logger['info'](_0x29d5('0xd'),_0x3a3b3c,_0x29d5('0xe'));logger[_0x29d5('0xf')](_0x29d5('0x10'),_0x3a3b3c,'request\x20sent',JSON[_0x29d5('0x11')](_0x1a8931));if(_0x1a8931['error']){if(_0x1a8931['error'][_0x29d5('0x12')]===0x1f4){logger['error'](_0x29d5('0xd'),_0x3a3b3c,_0x1a8931[_0x29d5('0x13')][_0x29d5('0x14')]);return _0x1fcab0(_0x1a8931[_0x29d5('0x13')][_0x29d5('0x14')]);}logger[_0x29d5('0x13')](_0x29d5('0xd'),_0x3a3b3c,_0x1a8931['error'][_0x29d5('0x14')]);return _0x183a8a(_0x1a8931[_0x29d5('0x13')][_0x29d5('0x14')]);}else{logger['info'](_0x29d5('0xd'),_0x3a3b3c,_0x29d5('0xe'));_0x183a8a(_0x1a8931[_0x29d5('0x15')][_0x29d5('0x14')]);}})['catch'](function(_0x5060e4){logger[_0x29d5('0x13')](_0x29d5('0xd'),_0x3a3b3c,_0x5060e4);_0x1fcab0(_0x5060e4);});});} \ No newline at end of file +var _0x05b8=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x05b8,0x125));var _0x805b=function(_0x33207a,_0x580a6c){_0x33207a=_0x33207a-0x0;var _0x373e20=_0x05b8[_0x33207a];return _0x373e20;};'use strict';var _=require('lodash');var util=require(_0x805b('0x0'));var moment=require(_0x805b('0x1'));var BPromise=require(_0x805b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x805b('0x3'))['db'];var utils=require(_0x805b('0x4'));var logger=require(_0x805b('0x5'))(_0x805b('0x6'));var config=require('../../config/environment');var jayson=require(_0x805b('0x7'));var client=jayson[_0x805b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab4c3,_0x478ce1,_0x5ffe83){return new BPromise(function(_0x163812,_0x186901){return client[_0x805b('0x9')](_0x5ab4c3,_0x5ffe83)[_0x805b('0xa')](function(_0x504b9c){logger[_0x805b('0xb')](_0x805b('0xc'),_0x478ce1,_0x805b('0xd'));logger[_0x805b('0xe')](_0x805b('0xf'),_0x478ce1,_0x805b('0xd'),JSON['stringify'](_0x504b9c));if(_0x504b9c[_0x805b('0x10')]){if(_0x504b9c[_0x805b('0x10')][_0x805b('0x11')]===0x1f4){logger['error'](_0x805b('0xc'),_0x478ce1,_0x504b9c['error']['message']);return _0x186901(_0x504b9c['error'][_0x805b('0x12')]);}logger[_0x805b('0x10')](_0x805b('0xc'),_0x478ce1,_0x504b9c[_0x805b('0x10')]['message']);return _0x163812(_0x504b9c['error'][_0x805b('0x12')]);}else{logger[_0x805b('0xb')](_0x805b('0xc'),_0x478ce1,'request\x20sent');_0x163812(_0x504b9c[_0x805b('0x13')][_0x805b('0x12')]);}})[_0x805b('0x14')](function(_0x23b656){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x478ce1,_0x23b656);_0x186901(_0x23b656);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 04f00f2..e56cf60 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xbf6478,_0x1a6d9f){var _0x24eccd=function(_0x121d33){while(--_0x121d33){_0xbf6478['push'](_0xbf6478['shift']());}};_0x24eccd(++_0x1a6d9f);}(_0xe706,0xa3));var _0x6e70=function(_0x1d9bc1,_0x52f0a6){_0x1d9bc1=_0x1d9bc1-0x0;var _0x540128=_0xe706[_0x1d9bc1];return _0x540128;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x234c69,_0x3c830f){var _0x7a982a=function(_0x46d5d5){while(--_0x46d5d5){_0x234c69['push'](_0x234c69['shift']());}};_0x7a982a(++_0x3c830f);}(_0x70e0,0x17b));var _0x070e=function(_0x2e56e2,_0x55ee95){_0x2e56e2=_0x2e56e2-0x0;var _0x344280=_0x70e0[_0x2e56e2];return _0x344280;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 0dabd14..8fa372c 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 _0xe7cd=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xe7cd,0xaa));var _0xde7c=function(_0x47f888,_0x29272b){_0x47f888=_0x47f888-0x0;var _0xab2886=_0xe7cd[_0x47f888];return _0xab2886;};'use strict';var Sequelize=require(_0xde7c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xde7c('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xde7c('0x2')},'membername':{'type':Sequelize[_0xde7c('0x3')],'allowNull':![],'comment':_0xde7c('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xde7c('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xde7c('0x2')},'VoiceQueueId':{'type':Sequelize[_0xde7c('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde7c('0x4'),'comment':_0xde7c('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xde7c('0x2')},'paused':{'type':Sequelize[_0xde7c('0x1')](0xb),'defaultValue':0x0,'comment':_0xde7c('0x2')}}; \ No newline at end of file +var _0xfcf0=['sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x3bc731,_0x803712){var _0x1d24a3=function(_0x4a9d41){while(--_0x4a9d41){_0x3bc731['push'](_0x3bc731['shift']());}};_0x1d24a3(++_0x803712);}(_0xfcf0,0xe4));var _0x0fcf=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0xfcf0[_0x35a140];return _0x30ab82;};'use strict';var Sequelize=require(_0x0fcf('0x0'));module[_0x0fcf('0x1')]={'uniqueid':{'type':Sequelize[_0x0fcf('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![],'comment':_0x0fcf('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![],'unique':_0x0fcf('0x5'),'comment':_0x0fcf('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0fcf('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![],'unique':_0x0fcf('0x5'),'comment':_0x0fcf('0x4')},'penalty':{'type':Sequelize[_0x0fcf('0x2')](0xb),'defaultValue':0x0,'comment':_0x0fcf('0x4')},'paused':{'type':Sequelize[_0x0fcf('0x2')](0xb),'defaultValue':0x0,'comment':_0x0fcf('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9c0f387..fa2aae3 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 _0xb95b=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','save','update','remove','emit'];(function(_0x5899f6,_0x1cdb9a){var _0x2e19fd=function(_0x3990fe){while(--_0x3990fe){_0x5899f6['push'](_0x5899f6['shift']());}};_0x2e19fd(++_0x1cdb9a);}(_0xb95b,0x1a9));var _0xbb95=function(_0x3d613e,_0x511d0c){_0x3d613e=_0x3d613e-0x0;var _0x411507=_0xb95b[_0x3d613e];return _0x411507;};'use strict';var EventEmitter=require(_0xbb95('0x0'));var UserVoiceQueueRt=require(_0xbb95('0x1'))['db'][_0xbb95('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb95('0x3'),'afterUpdate':_0xbb95('0x4'),'afterDestroy':_0xbb95('0x5')};function emitEvent(_0x5817ad){return function(_0x5877e3,_0x426769,_0x197653){UserVoiceQueueRtEvents[_0xbb95('0x6')](_0x5817ad+':'+_0x5877e3['id'],_0x5877e3);UserVoiceQueueRtEvents['emit'](_0x5817ad,_0x5877e3);_0x197653(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xbb95('0x7')](e,emitEvent(event));}}module[_0xbb95('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1b0e=['remove','emit','hook','exports','events','UserVoiceQueueRt','setMaxListeners','update'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x1b0e,0xec));var _0xe1b0=function(_0x3bd065,_0x5b608e){_0x3bd065=_0x3bd065-0x0;var _0x27fe93=_0x1b0e[_0x3bd065];return _0x27fe93;};'use strict';var EventEmitter=require(_0xe1b0('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xe1b0('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe1b0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe1b0('0x3'),'afterDestroy':_0xe1b0('0x4')};function emitEvent(_0xad3e54){return function(_0x4e6862,_0x38426a,_0x3b4ca6){UserVoiceQueueRtEvents[_0xe1b0('0x5')](_0xad3e54+':'+_0x4e6862['id'],_0x4e6862);UserVoiceQueueRtEvents['emit'](_0xad3e54,_0x4e6862);_0x3b4ca6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xe1b0('0x6')](e,emitEvent(event));}}module[_0xe1b0('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 750d3cb..a2eb858 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 _0x0d95=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xf74f46,_0x1a49d4){var _0x5ea729=function(_0x73e853){while(--_0x73e853){_0xf74f46['push'](_0xf74f46['shift']());}};_0x5ea729(++_0x1a49d4);}(_0x0d95,0x1d9));var _0x50d9=function(_0x24292f,_0xd4411a){_0x24292f=_0x24292f-0x0;var _0x30a0a3=_0x0d95[_0x24292f];return _0x30a0a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x50d9('0x0'))(_0x50d9('0x1'));var moment=require(_0x50d9('0x2'));var BPromise=require(_0x50d9('0x3'));var rp=require(_0x50d9('0x4'));var fs=require('fs');var path=require(_0x50d9('0x5'));var rimraf=require(_0x50d9('0x6'));var config=require(_0x50d9('0x7'));var attributes=require(_0x50d9('0x8'));module[_0x50d9('0x9')]=function(_0x356189,_0x16eb39){return _0x356189[_0x50d9('0xa')](_0x50d9('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb159=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','lodash'];(function(_0x43371b,_0x1cb4cf){var _0x19cd26=function(_0x5f43bf){while(--_0x5f43bf){_0x43371b['push'](_0x43371b['shift']());}};_0x19cd26(++_0x1cb4cf);}(_0xb159,0xe6));var _0x9b15=function(_0x3b3a5,_0x37441f){_0x3b3a5=_0x3b3a5-0x0;var _0x8ba7f5=_0xb159[_0x3b3a5];return _0x8ba7f5;};'use strict';var _=require(_0x9b15('0x0'));var util=require(_0x9b15('0x1'));var logger=require(_0x9b15('0x2'))('api');var moment=require(_0x9b15('0x3'));var BPromise=require(_0x9b15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b15('0x5'));var rimraf=require(_0x9b15('0x6'));var config=require(_0x9b15('0x7'));var attributes=require(_0x9b15('0x8'));module[_0x9b15('0x9')]=function(_0x215c8b,_0x59cccd){return _0x215c8b[_0x9b15('0xa')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 98a1437..08dbd10 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 _0x4dd8=['result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x42ae09,_0x1e5ab){var _0x324af5=function(_0x51b8c8){while(--_0x51b8c8){_0x42ae09['push'](_0x42ae09['shift']());}};_0x324af5(++_0x1e5ab);}(_0x4dd8,0x16c));var _0x84dd=function(_0x39ad57,_0x5df240){_0x39ad57=_0x39ad57-0x0;var _0x2ad3e1=_0x4dd8[_0x39ad57];return _0x2ad3e1;};'use strict';var _=require(_0x84dd('0x0'));var util=require(_0x84dd('0x1'));var moment=require(_0x84dd('0x2'));var BPromise=require(_0x84dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84dd('0x4'));var db=require(_0x84dd('0x5'))['db'];var utils=require(_0x84dd('0x6'));var logger=require(_0x84dd('0x7'))('rpc');var config=require(_0x84dd('0x8'));var jayson=require(_0x84dd('0x9'));var client=jayson['client'][_0x84dd('0xa')]({'port':0x232a});config[_0x84dd('0xb')]=_[_0x84dd('0xc')](config[_0x84dd('0xb')],{'host':_0x84dd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84dd('0xb')]));require(_0x84dd('0xe'))['register'](socket);function respondWithRpcPromise(_0x359229,_0x455111,_0x2e36f1){return new BPromise(function(_0x61b55e,_0x413ca7){return client[_0x84dd('0xf')](_0x359229,_0x2e36f1)[_0x84dd('0x10')](function(_0x24c281){logger[_0x84dd('0x11')](_0x84dd('0x12'),_0x455111,_0x84dd('0x13'));logger[_0x84dd('0x14')](_0x84dd('0x15'),_0x455111,_0x84dd('0x13'),JSON[_0x84dd('0x16')](_0x24c281));if(_0x24c281[_0x84dd('0x17')]){if(_0x24c281[_0x84dd('0x17')][_0x84dd('0x18')]===0x1f4){logger[_0x84dd('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x455111,_0x24c281[_0x84dd('0x17')][_0x84dd('0x19')]);return _0x413ca7(_0x24c281[_0x84dd('0x17')][_0x84dd('0x19')]);}logger[_0x84dd('0x17')](_0x84dd('0x12'),_0x455111,_0x24c281[_0x84dd('0x17')][_0x84dd('0x19')]);return _0x61b55e(_0x24c281[_0x84dd('0x17')][_0x84dd('0x19')]);}else{logger[_0x84dd('0x11')](_0x84dd('0x12'),_0x455111,_0x84dd('0x13'));_0x61b55e(_0x24c281[_0x84dd('0x1a')]['message']);}})[_0x84dd('0x1b')](function(_0x1ce01d){logger['error'](_0x84dd('0x12'),_0x455111,_0x1ce01d);_0x413ca7(_0x1ce01d);});});}exports[_0x84dd('0x1c')]=function(_0x1caf28){var _0x1b6982=this;return new Promise(function(_0x5848fa,_0xd2a4c){return db[_0x84dd('0x1d')][_0x84dd('0x1e')]({'raw':_0x1caf28[_0x84dd('0x1f')]?_0x1caf28[_0x84dd('0x1f')][_0x84dd('0x20')]===undefined?!![]:![]:!![],'where':_0x1caf28[_0x84dd('0x1f')]?_0x1caf28['options'][_0x84dd('0x21')]||null:null,'attributes':[[db[_0x84dd('0x22')]['fn'](_0x84dd('0x23'),db['sequelize']['fn']('IF',db[_0x84dd('0x22')][_0x84dd('0x24')](_0x84dd('0x25')))),_0x84dd('0x26')]]})[_0x84dd('0x10')](function(_0x2ab384){logger['info'](_0x84dd('0x1c'),_0x1caf28);logger[_0x84dd('0x14')](_0x84dd('0x1c'),_0x1caf28,JSON[_0x84dd('0x16')](_0x2ab384));_0x5848fa(_0x2ab384);})[_0x84dd('0x1b')](function(_0x2b2f46){logger['error'](_0x84dd('0x1c'),_0x2b2f46['message'],_0x1caf28);_0xd2a4c(_0x1b6982['error'](0x1f4,_0x2b2f46[_0x84dd('0x19')]));});});}; \ No newline at end of file +var _0xf78f=['sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xf78f,0x1b3));var _0xff78=function(_0x28af2d,_0x1c1a47){_0x28af2d=_0x28af2d-0x0;var _0x1ed354=_0xf78f[_0x28af2d];return _0x1ed354;};'use strict';var _=require(_0xff78('0x0'));var util=require(_0xff78('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff78('0x2'));var fs=require('fs');var Redis=require(_0xff78('0x3'));var db=require(_0xff78('0x4'))['db'];var utils=require(_0xff78('0x5'));var logger=require(_0xff78('0x6'))(_0xff78('0x7'));var config=require(_0xff78('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xff78('0x9')][_0xff78('0xa')]({'port':0x232a});config[_0xff78('0xb')]=_['defaults'](config[_0xff78('0xb')],{'host':_0xff78('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff78('0xb')]));require(_0xff78('0xd'))[_0xff78('0xe')](socket);function respondWithRpcPromise(_0x2be93c,_0x15030f,_0x48fe0c){return new BPromise(function(_0x192fab,_0x5caa7d){return client[_0xff78('0xf')](_0x2be93c,_0x48fe0c)[_0xff78('0x10')](function(_0x2a4169){logger[_0xff78('0x11')](_0xff78('0x12'),_0x15030f,_0xff78('0x13'));logger[_0xff78('0x14')](_0xff78('0x15'),_0x15030f,'request\x20sent',JSON['stringify'](_0x2a4169));if(_0x2a4169[_0xff78('0x16')]){if(_0x2a4169[_0xff78('0x16')][_0xff78('0x17')]===0x1f4){logger[_0xff78('0x16')](_0xff78('0x12'),_0x15030f,_0x2a4169[_0xff78('0x16')][_0xff78('0x18')]);return _0x5caa7d(_0x2a4169[_0xff78('0x16')][_0xff78('0x18')]);}logger[_0xff78('0x16')](_0xff78('0x12'),_0x15030f,_0x2a4169['error'][_0xff78('0x18')]);return _0x192fab(_0x2a4169[_0xff78('0x16')]['message']);}else{logger['info'](_0xff78('0x12'),_0x15030f,_0xff78('0x13'));_0x192fab(_0x2a4169[_0xff78('0x19')][_0xff78('0x18')]);}})[_0xff78('0x1a')](function(_0x52c3bf){logger[_0xff78('0x16')](_0xff78('0x12'),_0x15030f,_0x52c3bf);_0x5caa7d(_0x52c3bf);});});}exports[_0xff78('0x1b')]=function(_0x3a00ca){var _0x5548e3=this;return new Promise(function(_0x511389,_0x201622){return db[_0xff78('0x1c')][_0xff78('0x1d')]({'raw':_0x3a00ca[_0xff78('0x1e')]?_0x3a00ca['options'][_0xff78('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a00ca[_0xff78('0x1e')]?_0x3a00ca[_0xff78('0x1e')][_0xff78('0x20')]||null:null,'attributes':[[db[_0xff78('0x21')]['fn'](_0xff78('0x22'),db[_0xff78('0x21')]['fn']('IF',db[_0xff78('0x21')][_0xff78('0x23')](_0xff78('0x24')))),_0xff78('0x25')]]})[_0xff78('0x10')](function(_0x484f25){logger[_0xff78('0x11')](_0xff78('0x1b'),_0x3a00ca);logger[_0xff78('0x14')]('GetVoiceQueueRtPauses',_0x3a00ca,JSON[_0xff78('0x26')](_0x484f25));_0x511389(_0x484f25);})[_0xff78('0x1a')](function(_0x925042){logger[_0xff78('0x16')]('GetVoiceQueueRtPauses',_0x925042['message'],_0x3a00ca);_0x201622(_0x5548e3[_0xff78('0x16')](0x1f4,_0x925042[_0xff78('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 42990b3..896707c 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 _0xcbd3=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','register'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x1a1acc,_0x468990){_0x1a1acc=_0x1a1acc-0x0;var _0x169f7b=_0xcbd3[_0x1a1acc];return _0x169f7b;};'use strict';var UserVoiceQueueRtEvents=require(_0x3cbd('0x0'));var events=[_0x3cbd('0x1'),_0x3cbd('0x2'),_0x3cbd('0x3')];function createListener(_0x3dc6fa,_0x2f631d){return function(_0x1092bc){_0x2f631d[_0x3cbd('0x4')](_0x3dc6fa,_0x1092bc);};}function removeListener(_0x2f4854,_0x32a914){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2f4854,_0x32a914);};}exports[_0x3cbd('0x5')]=function(_0x2f2631){for(var _0x525b74=0x0,_0x372e19=events['length'];_0x525b74<_0x372e19;_0x525b74++){var _0x25420f=events[_0x525b74];var _0x4c1a53=createListener(_0x3cbd('0x6')+_0x25420f,_0x2f2631);UserVoiceQueueRtEvents['on'](_0x25420f,_0x4c1a53);}}; \ No newline at end of file +var _0x4da5=['update','emit','removeListener','length','userVoiceQueueRt:','save','remove'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0x4da5,0x1b7));var _0x54da=function(_0x1be939,_0x175723){_0x1be939=_0x1be939-0x0;var _0x5e3891=_0x4da5[_0x1be939];return _0x5e3891;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x54da('0x0'),_0x54da('0x1'),_0x54da('0x2')];function createListener(_0x4f4293,_0x3281bc){return function(_0x4cdd6e){_0x3281bc[_0x54da('0x3')](_0x4f4293,_0x4cdd6e);};}function removeListener(_0x3b7cdc,_0x2ed041){return function(){UserVoiceQueueRtEvents[_0x54da('0x4')](_0x3b7cdc,_0x2ed041);};}exports['register']=function(_0x200b6c){for(var _0xf6aaf3=0x0,_0x259062=events[_0x54da('0x5')];_0xf6aaf3<_0x259062;_0xf6aaf3++){var _0x2fe7cc=events[_0xf6aaf3];var _0x30c17d=createListener(_0x54da('0x6')+_0x2fe7cc,_0x200b6c);UserVoiceQueueRtEvents['on'](_0x2fe7cc,_0x30c17d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 02c327a..921758f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1d5d4a,_0x44102d){var _0x348926=function(_0x89c20d){while(--_0x89c20d){_0x1d5d4a['push'](_0x1d5d4a['shift']());}};_0x348926(++_0x44102d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x27b2b1,_0x23466d){var _0x44640e=function(_0x4e9adc){while(--_0x4e9adc){_0x27b2b1['push'](_0x27b2b1['shift']());}};_0x44640e(++_0x23466d);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 3716143..9984a6d 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 _0x2fa9=['exports','sequelize'];(function(_0x36c30e,_0x42128d){var _0x413aeb=function(_0x52e005){while(--_0x52e005){_0x36c30e['push'](_0x36c30e['shift']());}};_0x413aeb(++_0x42128d);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x3ed137,_0xa061){_0x3ed137=_0x3ed137-0x0;var _0x3c8b55=_0x2fa9[_0x3ed137];return _0x3c8b55;};'use strict';var Sequelize=require(_0x92fa('0x0'));module[_0x92fa('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6eeb=['INTEGER','exports'];(function(_0x23dba1,_0x1da069){var _0x240079=function(_0x2c20c2){while(--_0x2c20c2){_0x23dba1['push'](_0x23dba1['shift']());}};_0x240079(++_0x1da069);}(_0x6eeb,0x1a9));var _0xb6ee=function(_0x3ffadf,_0x47c3b1){_0x3ffadf=_0x3ffadf-0x0;var _0x46223d=_0x6eeb[_0x3ffadf];return _0x46223d;};'use strict';var Sequelize=require('sequelize');module[_0xb6ee('0x0')]={'penalty':{'type':Sequelize[_0xb6ee('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 96de5d5..3c3a431 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 _0xf69b=['user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xf69b,0x85));var _0xbf69=function(_0xdc71d3,_0x23722c){_0xdc71d3=_0xdc71d3-0x0;var _0xd9cac8=_0xf69b[_0xdc71d3];return _0xd9cac8;};'use strict';var _=require(_0xbf69('0x0'));var util=require(_0xbf69('0x1'));var logger=require(_0xbf69('0x2'))('api');var moment=require(_0xbf69('0x3'));var BPromise=require(_0xbf69('0x4'));var rp=require(_0xbf69('0x5'));var fs=require('fs');var path=require(_0xbf69('0x6'));var rimraf=require('rimraf');var config=require(_0xbf69('0x7'));var attributes=require(_0xbf69('0x8'));module['exports']=function(_0x47a922,_0x147e68){return _0x47a922[_0xbf69('0x9')](_0xbf69('0xa'),attributes,{'tableName':_0xbf69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6fc=['define','UserWhatsappQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports'];(function(_0x232720,_0x1d25fb){var _0x97e211=function(_0x2a9663){while(--_0x2a9663){_0x232720['push'](_0x232720['shift']());}};_0x97e211(++_0x1d25fb);}(_0xf6fc,0x1ee));var _0xcf6f=function(_0x1c1e24,_0x3ea622){_0x1c1e24=_0x1c1e24-0x0;var _0x3fd561=_0xf6fc[_0x1c1e24];return _0x3fd561;};'use strict';var _=require('lodash');var util=require(_0xcf6f('0x0'));var logger=require(_0xcf6f('0x1'))(_0xcf6f('0x2'));var moment=require(_0xcf6f('0x3'));var BPromise=require(_0xcf6f('0x4'));var rp=require(_0xcf6f('0x5'));var fs=require('fs');var path=require(_0xcf6f('0x6'));var rimraf=require(_0xcf6f('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf6f('0x8'));module[_0xcf6f('0x9')]=function(_0x2193ac,_0x3dcc2e){return _0x2193ac[_0xcf6f('0xa')](_0xcf6f('0xb'),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 256a888..df27b25 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 _0xfd5f=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xfd5f,0xce));var _0xffd5=function(_0x58db5c,_0x35b44a){_0x58db5c=_0x58db5c-0x0;var _0x2dc618=_0xfd5f[_0x58db5c];return _0x2dc618;};'use strict';var _=require(_0xffd5('0x0'));var util=require(_0xffd5('0x1'));var moment=require('moment');var BPromise=require(_0xffd5('0x2'));var rs=require(_0xffd5('0x3'));var fs=require('fs');var Redis=require(_0xffd5('0x4'));var db=require(_0xffd5('0x5'))['db'];var utils=require(_0xffd5('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xffd5('0x7'));var client=jayson[_0xffd5('0x8')][_0xffd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ea74,_0x5b892b,_0x2b9d77){return new BPromise(function(_0x1df8e6,_0x5cba30){return client[_0xffd5('0xa')](_0x29ea74,_0x2b9d77)[_0xffd5('0xb')](function(_0x33fef){logger[_0xffd5('0xc')](_0xffd5('0xd'),_0x5b892b,'request\x20sent');logger['debug'](_0xffd5('0xe'),_0x5b892b,_0xffd5('0xf'),JSON['stringify'](_0x33fef));if(_0x33fef['error']){if(_0x33fef['error'][_0xffd5('0x10')]===0x1f4){logger['error'](_0xffd5('0xd'),_0x5b892b,_0x33fef[_0xffd5('0x11')][_0xffd5('0x12')]);return _0x5cba30(_0x33fef[_0xffd5('0x11')][_0xffd5('0x12')]);}logger[_0xffd5('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5b892b,_0x33fef[_0xffd5('0x11')][_0xffd5('0x12')]);return _0x1df8e6(_0x33fef[_0xffd5('0x11')][_0xffd5('0x12')]);}else{logger['info'](_0xffd5('0xd'),_0x5b892b,_0xffd5('0xf'));_0x1df8e6(_0x33fef['result']['message']);}})[_0xffd5('0x13')](function(_0x2a713e){logger[_0xffd5('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5b892b,_0x2a713e);_0x5cba30(_0x2a713e);});});} \ No newline at end of file +var _0xa10e=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug'];(function(_0x5843a4,_0x5299c7){var _0x2242a3=function(_0x337f22){while(--_0x337f22){_0x5843a4['push'](_0x5843a4['shift']());}};_0x2242a3(++_0x5299c7);}(_0xa10e,0x193));var _0xea10=function(_0x3374b0,_0x3cc015){_0x3374b0=_0x3374b0-0x0;var _0x11fac4=_0xa10e[_0x3374b0];return _0x11fac4;};'use strict';var _=require(_0xea10('0x0'));var util=require(_0xea10('0x1'));var moment=require(_0xea10('0x2'));var BPromise=require(_0xea10('0x3'));var rs=require(_0xea10('0x4'));var fs=require('fs');var Redis=require(_0xea10('0x5'));var db=require(_0xea10('0x6'))['db'];var utils=require(_0xea10('0x7'));var logger=require(_0xea10('0x8'))(_0xea10('0x9'));var config=require('../../config/environment');var jayson=require(_0xea10('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5611,_0x569cc9,_0x5a8689){return new BPromise(function(_0x1f1217,_0x4f86b5){return client[_0xea10('0xb')](_0x1c5611,_0x5a8689)[_0xea10('0xc')](function(_0x1f2d45){logger['info'](_0xea10('0xd'),_0x569cc9,'request\x20sent');logger[_0xea10('0xe')](_0xea10('0xf'),_0x569cc9,_0xea10('0x10'),JSON[_0xea10('0x11')](_0x1f2d45));if(_0x1f2d45[_0xea10('0x12')]){if(_0x1f2d45[_0xea10('0x12')]['code']===0x1f4){logger[_0xea10('0x12')](_0xea10('0xd'),_0x569cc9,_0x1f2d45[_0xea10('0x12')][_0xea10('0x13')]);return _0x4f86b5(_0x1f2d45['error']['message']);}logger[_0xea10('0x12')](_0xea10('0xd'),_0x569cc9,_0x1f2d45[_0xea10('0x12')][_0xea10('0x13')]);return _0x1f1217(_0x1f2d45['error'][_0xea10('0x13')]);}else{logger['info'](_0xea10('0xd'),_0x569cc9,'request\x20sent');_0x1f1217(_0x1f2d45[_0xea10('0x14')][_0xea10('0x13')]);}})[_0xea10('0x15')](function(_0x304796){logger[_0xea10('0x12')](_0xea10('0xd'),_0x569cc9,_0x304796);_0x4f86b5(_0x304796);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 50a22c5..d7366d9 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 _0xc5c7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','create','update','destroy','util'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x2f2aa9,_0x510e8a){_0x2f2aa9=_0x2f2aa9-0x0;var _0xdbe390=_0xc5c7[_0x2f2aa9];return _0xdbe390;};'use strict';var multer=require('multer');var util=require(_0x7c5c('0x0'));var path=require(_0x7c5c('0x1'));var timeout=require(_0x7c5c('0x2'));var express=require(_0x7c5c('0x3'));var router=express[_0x7c5c('0x4')]();var fs_extra=require(_0x7c5c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c5c('0x6'));var config=require(_0x7c5c('0x7'));var controller=require(_0x7c5c('0x8'));router[_0x7c5c('0x9')]('/',auth[_0x7c5c('0xa')](),controller['index']);router['get'](_0x7c5c('0xb'),auth['isAuthenticated'](),controller[_0x7c5c('0xc')]);router['post']('/',auth[_0x7c5c('0xa')](),controller[_0x7c5c('0xd')]);router['put']('/:id',auth[_0x7c5c('0xa')](),controller[_0x7c5c('0xe')]);router['delete'](_0x7c5c('0xb'),auth['isAuthenticated'](),controller[_0x7c5c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0531=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','multer','util','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0531,0xde));var _0x1053=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x0531[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1053('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1053('0x3'));var interaction=require(_0x1053('0x4'));var config=require(_0x1053('0x5'));var controller=require(_0x1053('0x6'));router[_0x1053('0x7')]('/',auth[_0x1053('0x8')](),controller[_0x1053('0x9')]);router[_0x1053('0x7')](_0x1053('0xa'),auth[_0x1053('0x8')](),controller['show']);router[_0x1053('0xb')]('/',auth[_0x1053('0x8')](),controller[_0x1053('0xc')]);router['put'](_0x1053('0xa'),auth[_0x1053('0x8')](),controller[_0x1053('0xd')]);router['delete']('/:id',auth[_0x1053('0x8')](),controller[_0x1053('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 7102d81..0cc04d6 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 _0x43fd=['exports','STRING'];(function(_0x1aa16e,_0x5927d4){var _0x1519e3=function(_0x38b150){while(--_0x38b150){_0x1aa16e['push'](_0x1aa16e['shift']());}};_0x1519e3(++_0x5927d4);}(_0x43fd,0x1ec));var _0xd43f=function(_0x52f2c2,_0x4b87e3){_0x52f2c2=_0x52f2c2-0x0;var _0x2bf50c=_0x43fd[_0x52f2c2];return _0x2bf50c;};'use strict';var Sequelize=require('sequelize');module[_0xd43f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd43f('0x1')]}}; \ No newline at end of file +var _0x903b=['STRING'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x903b,0x104));var _0xb903=function(_0x9ce28e,_0x3fe813){_0x9ce28e=_0x9ce28e-0x0;var _0x4fa723=_0x903b[_0x9ce28e];return _0x4fa723;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb903('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3d44450..2a1825d 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 _0x59ee=['set','reject','update','then','destroy','error','name','Variable','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Variables','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x55d1b0,_0x46fb94){var _0x17c5f7=function(_0x5e2bb5){while(--_0x5e2bb5){_0x55d1b0['push'](_0x55d1b0['shift']());}};_0x17c5f7(++_0x46fb94);}(_0x59ee,0x84));var _0xe59e=function(_0x89ee68,_0x18ca4d){_0x89ee68=_0x89ee68-0x0;var _0x1dfd3b=_0x59ee[_0x89ee68];return _0x1dfd3b;};'use strict';var emlformat=require(_0xe59e('0x0'));var rimraf=require(_0xe59e('0x1'));var zipdir=require(_0xe59e('0x2'));var jsonpatch=require(_0xe59e('0x3'));var rp=require(_0xe59e('0x4'));var moment=require(_0xe59e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe59e('0x6'));var path=require(_0xe59e('0x7'));var sox=require('sox');var csv=require(_0xe59e('0x8'));var ejs=require(_0xe59e('0x9'));var fs=require('fs');var fs_extra=require(_0xe59e('0xa'));var _=require(_0xe59e('0xb'));var squel=require(_0xe59e('0xc'));var crypto=require(_0xe59e('0xd'));var jsforce=require(_0xe59e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe59e('0xf'));var Papa=require(_0xe59e('0x10'));var Redis=require(_0xe59e('0x11'));var authService=require(_0xe59e('0x12'));var qs=require(_0xe59e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe59e('0x14'))(_0xe59e('0x15'));var utils=require(_0xe59e('0x16'));var config=require(_0xe59e('0x17'));var licenseUtil=require(_0xe59e('0x18'));var db=require(_0xe59e('0x19'))['db'];function respondWithStatusCode(_0x1013ae,_0x5e564f){_0x5e564f=_0x5e564f||0xcc;return function(_0x1c82f8){if(_0x1c82f8){return _0x1013ae[_0xe59e('0x1a')](_0x5e564f);}return _0x1013ae[_0xe59e('0x1b')](_0x5e564f)[_0xe59e('0x1c')]();};}function respondWithResult(_0x448395,_0x3d13a3){_0x3d13a3=_0x3d13a3||0xc8;return function(_0x2c0275){if(_0x2c0275){return _0x448395[_0xe59e('0x1b')](_0x3d13a3)[_0xe59e('0x1d')](_0x2c0275);}};}function respondWithFilteredResult(_0x4334b3,_0x47e89b){return function(_0x49c646){if(_0x49c646){var _0x3159d0=typeof _0x47e89b['offset']===_0xe59e('0x1e')&&typeof _0x47e89b[_0xe59e('0x1f')]==='undefined';var _0x5244ea=_0x49c646[_0xe59e('0x20')];var _0x32812c=_0x3159d0?0x0:_0x47e89b['offset'];var _0x3069a0=_0x3159d0?_0x49c646['count']:_0x47e89b[_0xe59e('0x21')]+_0x47e89b['limit'];var _0x1aaf42;if(_0x3069a0>=_0x5244ea){_0x3069a0=_0x5244ea;_0x1aaf42=0xc8;}else{_0x1aaf42=0xce;}_0x4334b3[_0xe59e('0x1b')](_0x1aaf42);return _0x4334b3[_0xe59e('0x22')]('Content-Range',_0x32812c+'-'+_0x3069a0+'/'+_0x5244ea)[_0xe59e('0x1d')](_0x49c646);}return null;};}function patchUpdates(_0xe8aa4f){return function(_0x8adc26){try{jsonpatch['apply'](_0x8adc26,_0xe8aa4f,!![]);}catch(_0x18f6d9){return BPromise[_0xe59e('0x23')](_0x18f6d9);}return _0x8adc26['save']();};}function saveUpdates(_0x140797,_0x166b2a){return function(_0x4bf9d6){if(_0x4bf9d6){return _0x4bf9d6[_0xe59e('0x24')](_0x140797)[_0xe59e('0x25')](function(_0x4a79dd){return _0x4a79dd;});}return null;};}function removeEntity(_0x27216e,_0x551bec){return function(_0x19109e){if(_0x19109e){return _0x19109e['destroy']()[_0xe59e('0x25')](function(){var _0x5277b6=_0x19109e['get']({'plain':!![]});var _0xaf66ad='Variables';return db['UserProfileResource'][_0xe59e('0x26')]({'where':{'type':_0xaf66ad,'resourceId':_0x5277b6['id']}})[_0xe59e('0x25')](function(){return _0x19109e;});})['then'](function(){_0x27216e['status'](0xcc)[_0xe59e('0x1c')]();});}};}function handleEntityNotFound(_0x43e1ce,_0x4fca09){return function(_0x4c9d9d){if(!_0x4c9d9d){_0x43e1ce['sendStatus'](0x194);}return _0x4c9d9d;};}function handleError(_0x28c4a5,_0x19a7f1){_0x19a7f1=_0x19a7f1||0x1f4;return function(_0x15bfe3){logger[_0xe59e('0x27')](_0x15bfe3['stack']);if(_0x15bfe3[_0xe59e('0x28')]){delete _0x15bfe3[_0xe59e('0x28')];}_0x28c4a5[_0xe59e('0x1b')](_0x19a7f1)['send'](_0x15bfe3);};}exports['index']=function(_0x53d816,_0x59bd4e){var _0x179c33={},_0x1cdc37={},_0x354f6a={'count':0x0,'rows':[]};var _0x478c9e=_['map'](db[_0xe59e('0x29')][_0xe59e('0x2a')],function(_0x1c97ab){return{'name':_0x1c97ab[_0xe59e('0x2b')],'type':_0x1c97ab[_0xe59e('0x2c')][_0xe59e('0x2d')]};});_0x1cdc37['model']=_[_0xe59e('0x2e')](_0x478c9e,_0xe59e('0x28'));_0x1cdc37[_0xe59e('0x2f')]=_[_0xe59e('0x30')](_0x53d816[_0xe59e('0x2f')]);_0x1cdc37[_0xe59e('0x31')]=_[_0xe59e('0x32')](_0x1cdc37[_0xe59e('0x33')],_0x1cdc37['query']);_0x179c33['attributes']=_[_0xe59e('0x32')](_0x1cdc37[_0xe59e('0x33')],qs['fields'](_0x53d816['query'][_0xe59e('0x34')]));_0x179c33['attributes']=_0x179c33['attributes'][_0xe59e('0x35')]?_0x179c33[_0xe59e('0x36')]:_0x1cdc37['model'];if(!_0x53d816[_0xe59e('0x2f')][_0xe59e('0x37')](_0xe59e('0x38'))){_0x179c33['limit']=qs[_0xe59e('0x1f')](_0x53d816[_0xe59e('0x2f')][_0xe59e('0x1f')]);_0x179c33[_0xe59e('0x21')]=qs[_0xe59e('0x21')](_0x53d816[_0xe59e('0x2f')][_0xe59e('0x21')]);}_0x179c33[_0xe59e('0x39')]=qs['sort'](_0x53d816[_0xe59e('0x2f')][_0xe59e('0x3a')]);_0x179c33[_0xe59e('0x3b')]=qs[_0xe59e('0x31')](_[_0xe59e('0x3c')](_0x53d816[_0xe59e('0x2f')],_0x1cdc37[_0xe59e('0x31')]),_0x478c9e);if(_0x53d816['query'][_0xe59e('0x3d')]){_0x179c33[_0xe59e('0x3b')]=_['merge'](_0x179c33[_0xe59e('0x3b')],{'$or':_[_0xe59e('0x2e')](_0x478c9e,function(_0x18eceb){if(_0x18eceb[_0xe59e('0x2c')]!==_0xe59e('0x3e')){var _0x47747f={};_0x47747f[_0x18eceb[_0xe59e('0x28')]]={'$like':'%'+_0x53d816['query']['filter']+'%'};return _0x47747f;}})});}_0x179c33=_[_0xe59e('0x3f')]({},_0x179c33,_0x53d816[_0xe59e('0x40')]);var _0x5c841d={'where':_0x179c33[_0xe59e('0x3b')]};return db[_0xe59e('0x29')][_0xe59e('0x20')](_0x5c841d)[_0xe59e('0x25')](function(_0x15eaa0){_0x354f6a[_0xe59e('0x20')]=_0x15eaa0;if(_0x53d816[_0xe59e('0x2f')][_0xe59e('0x41')]){_0x179c33['include']=[{'all':!![]}];}return db[_0xe59e('0x29')][_0xe59e('0x42')](_0x179c33);})[_0xe59e('0x25')](function(_0x23bd07){_0x354f6a[_0xe59e('0x43')]=_0x23bd07;return _0x354f6a;})[_0xe59e('0x25')](respondWithFilteredResult(_0x59bd4e,_0x179c33))[_0xe59e('0x44')](handleError(_0x59bd4e,null));};exports[_0xe59e('0x45')]=function(_0x5cca40,_0x8dd9c9){var _0x26ac31={'raw':!![],'where':{'id':_0x5cca40['params']['id']}},_0x265cba={};_0x265cba[_0xe59e('0x33')]=_[_0xe59e('0x30')](db[_0xe59e('0x29')][_0xe59e('0x2a')]);_0x265cba['query']=_[_0xe59e('0x30')](_0x5cca40[_0xe59e('0x2f')]);_0x265cba[_0xe59e('0x31')]=_[_0xe59e('0x32')](_0x265cba[_0xe59e('0x33')],_0x265cba[_0xe59e('0x2f')]);_0x26ac31[_0xe59e('0x36')]=_[_0xe59e('0x32')](_0x265cba[_0xe59e('0x33')],qs[_0xe59e('0x34')](_0x5cca40[_0xe59e('0x2f')]['fields']));_0x26ac31['attributes']=_0x26ac31[_0xe59e('0x36')]['length']?_0x26ac31['attributes']:_0x265cba[_0xe59e('0x33')];if(_0x5cca40[_0xe59e('0x2f')][_0xe59e('0x41')]){_0x26ac31[_0xe59e('0x46')]=[{'all':!![]}];}_0x26ac31=_[_0xe59e('0x3f')]({},_0x26ac31,_0x5cca40[_0xe59e('0x40')]);return db[_0xe59e('0x29')][_0xe59e('0x47')](_0x26ac31)[_0xe59e('0x25')](handleEntityNotFound(_0x8dd9c9,null))[_0xe59e('0x25')](respondWithResult(_0x8dd9c9,null))[_0xe59e('0x44')](handleError(_0x8dd9c9,null));};exports['create']=function(_0x58ad55,_0x514e65){return db[_0xe59e('0x29')][_0xe59e('0x48')](_0x58ad55['body'],{})[_0xe59e('0x25')](function(_0x4c11d9){var _0xd684d8=_0x58ad55[_0xe59e('0x49')]['get']({'plain':!![]});if(!_0xd684d8)throw new Error(_0xe59e('0x4a'));if(_0xd684d8[_0xe59e('0x4b')]==='user'){var _0x5b3db0=_0x4c11d9[_0xe59e('0x4c')]({'plain':!![]});var _0x3d56ba=_0xe59e('0x4d');return db[_0xe59e('0x4e')][_0xe59e('0x47')]({'where':{'name':_0x3d56ba,'userProfileId':_0xd684d8['userProfileId']},'raw':!![]})[_0xe59e('0x25')](function(_0x58919c){if(_0x58919c&&_0x58919c[_0xe59e('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b3db0[_0xe59e('0x28')],'resourceId':_0x5b3db0['id'],'type':_0x58919c[_0xe59e('0x28')],'sectionId':_0x58919c['id']},{})[_0xe59e('0x25')](function(){return _0x4c11d9;});}else{return _0x4c11d9;}})[_0xe59e('0x44')](function(_0x36effc){logger['error'](_0xe59e('0x50'),_0x36effc);throw _0x36effc;});}return _0x4c11d9;})['then'](respondWithResult(_0x514e65,0xc9))[_0xe59e('0x44')](handleError(_0x514e65,null));};exports['update']=function(_0x20e003,_0x4c6494){if(_0x20e003[_0xe59e('0x51')]['id']){delete _0x20e003[_0xe59e('0x51')]['id'];}return db[_0xe59e('0x29')][_0xe59e('0x47')]({'where':{'id':_0x20e003[_0xe59e('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c6494,null))[_0xe59e('0x25')](saveUpdates(_0x20e003[_0xe59e('0x51')],null))[_0xe59e('0x25')](respondWithResult(_0x4c6494,null))[_0xe59e('0x44')](handleError(_0x4c6494,null));};exports[_0xe59e('0x26')]=function(_0x5ef811,_0x11ba4d){return db['Variable'][_0xe59e('0x47')]({'where':{'id':_0x5ef811[_0xe59e('0x52')]['id']}})[_0xe59e('0x25')](handleEntityNotFound(_0x11ba4d,null))[_0xe59e('0x25')](removeEntity(_0x11ba4d,null))['catch'](handleError(_0x11ba4d,null));}; \ No newline at end of file +var _0x5270=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','get','Variables','then','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Variable','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy'];(function(_0x41fe75,_0x43bb5e){var _0x5e2145=function(_0x4831e3){while(--_0x4831e3){_0x41fe75['push'](_0x41fe75['shift']());}};_0x5e2145(++_0x43bb5e);}(_0x5270,0xa2));var _0x0527=function(_0x502aa0,_0x4a4b2c){_0x502aa0=_0x502aa0-0x0;var _0x547431=_0x5270[_0x502aa0];return _0x547431;};'use strict';var emlformat=require(_0x0527('0x0'));var rimraf=require(_0x0527('0x1'));var zipdir=require(_0x0527('0x2'));var jsonpatch=require(_0x0527('0x3'));var rp=require(_0x0527('0x4'));var moment=require(_0x0527('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0527('0x6'));var util=require('util');var path=require(_0x0527('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0527('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0527('0x9'));var squel=require(_0x0527('0xa'));var crypto=require(_0x0527('0xb'));var jsforce=require(_0x0527('0xc'));var deskjs=require(_0x0527('0xd'));var toCsv=require(_0x0527('0xe'));var querystring=require('querystring');var Papa=require(_0x0527('0xf'));var Redis=require(_0x0527('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0527('0x11'));var as=require(_0x0527('0x12'));var hardwareService=require(_0x0527('0x13'));var logger=require(_0x0527('0x14'))(_0x0527('0x15'));var utils=require(_0x0527('0x16'));var config=require(_0x0527('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42d4a2,_0x52bae3){_0x52bae3=_0x52bae3||0xcc;return function(_0x248df5){if(_0x248df5){return _0x42d4a2[_0x0527('0x18')](_0x52bae3);}return _0x42d4a2[_0x0527('0x19')](_0x52bae3)[_0x0527('0x1a')]();};}function respondWithResult(_0x402f69,_0x12c8ea){_0x12c8ea=_0x12c8ea||0xc8;return function(_0x2539cf){if(_0x2539cf){return _0x402f69[_0x0527('0x19')](_0x12c8ea)[_0x0527('0x1b')](_0x2539cf);}};}function respondWithFilteredResult(_0x3d651a,_0x528aaf){return function(_0x51f6b1){if(_0x51f6b1){var _0x4dbe92=typeof _0x528aaf[_0x0527('0x1c')]==='undefined'&&typeof _0x528aaf[_0x0527('0x1d')]===_0x0527('0x1e');var _0x3716ee=_0x51f6b1[_0x0527('0x1f')];var _0x54a82d=_0x4dbe92?0x0:_0x528aaf[_0x0527('0x1c')];var _0x45b273=_0x4dbe92?_0x51f6b1['count']:_0x528aaf[_0x0527('0x1c')]+_0x528aaf[_0x0527('0x1d')];var _0x59fe9b;if(_0x45b273>=_0x3716ee){_0x45b273=_0x3716ee;_0x59fe9b=0xc8;}else{_0x59fe9b=0xce;}_0x3d651a[_0x0527('0x19')](_0x59fe9b);return _0x3d651a[_0x0527('0x20')](_0x0527('0x21'),_0x54a82d+'-'+_0x45b273+'/'+_0x3716ee)['json'](_0x51f6b1);}return null;};}function patchUpdates(_0x4687d0){return function(_0x2b32ef){try{jsonpatch[_0x0527('0x22')](_0x2b32ef,_0x4687d0,!![]);}catch(_0x120c3d){return BPromise['reject'](_0x120c3d);}return _0x2b32ef[_0x0527('0x23')]();};}function saveUpdates(_0x2ea547,_0x4e3e1c){return function(_0x4a8f37){if(_0x4a8f37){return _0x4a8f37['update'](_0x2ea547)['then'](function(_0x25720a){return _0x25720a;});}return null;};}function removeEntity(_0x456dd3,_0x48201c){return function(_0x51f7df){if(_0x51f7df){return _0x51f7df['destroy']()['then'](function(){var _0x4779f4=_0x51f7df[_0x0527('0x24')]({'plain':!![]});var _0x21f05c=_0x0527('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x21f05c,'resourceId':_0x4779f4['id']}})[_0x0527('0x26')](function(){return _0x51f7df;});})[_0x0527('0x26')](function(){_0x456dd3['status'](0xcc)[_0x0527('0x1a')]();});}};}function handleEntityNotFound(_0x36aab0,_0x165d47){return function(_0xe36cfd){if(!_0xe36cfd){_0x36aab0[_0x0527('0x18')](0x194);}return _0xe36cfd;};}function handleError(_0x10718d,_0x30f9d0){_0x30f9d0=_0x30f9d0||0x1f4;return function(_0x40e16f){logger[_0x0527('0x27')](_0x40e16f[_0x0527('0x28')]);if(_0x40e16f[_0x0527('0x29')]){delete _0x40e16f[_0x0527('0x29')];}_0x10718d[_0x0527('0x19')](_0x30f9d0)['send'](_0x40e16f);};}exports[_0x0527('0x2a')]=function(_0x3f3686,_0x2efbe7){var _0x385b37={},_0x545de8={},_0x3287fb={'count':0x0,'rows':[]};var _0x285037=_[_0x0527('0x2b')](db['Variable']['rawAttributes'],function(_0xb9861f){return{'name':_0xb9861f[_0x0527('0x2c')],'type':_0xb9861f[_0x0527('0x2d')]['key']};});_0x545de8[_0x0527('0x2e')]=_[_0x0527('0x2b')](_0x285037,'name');_0x545de8[_0x0527('0x2f')]=_[_0x0527('0x30')](_0x3f3686[_0x0527('0x2f')]);_0x545de8[_0x0527('0x31')]=_[_0x0527('0x32')](_0x545de8[_0x0527('0x2e')],_0x545de8[_0x0527('0x2f')]);_0x385b37[_0x0527('0x33')]=_['intersection'](_0x545de8[_0x0527('0x2e')],qs[_0x0527('0x34')](_0x3f3686[_0x0527('0x2f')][_0x0527('0x34')]));_0x385b37[_0x0527('0x33')]=_0x385b37[_0x0527('0x33')][_0x0527('0x35')]?_0x385b37['attributes']:_0x545de8[_0x0527('0x2e')];if(!_0x3f3686[_0x0527('0x2f')]['hasOwnProperty'](_0x0527('0x36'))){_0x385b37[_0x0527('0x1d')]=qs[_0x0527('0x1d')](_0x3f3686[_0x0527('0x2f')][_0x0527('0x1d')]);_0x385b37[_0x0527('0x1c')]=qs[_0x0527('0x1c')](_0x3f3686[_0x0527('0x2f')]['offset']);}_0x385b37[_0x0527('0x37')]=qs[_0x0527('0x38')](_0x3f3686[_0x0527('0x2f')]['sort']);_0x385b37[_0x0527('0x39')]=qs[_0x0527('0x31')](_['pick'](_0x3f3686[_0x0527('0x2f')],_0x545de8['filters']),_0x285037);if(_0x3f3686['query'][_0x0527('0x3a')]){_0x385b37[_0x0527('0x39')]=_[_0x0527('0x3b')](_0x385b37[_0x0527('0x39')],{'$or':_[_0x0527('0x2b')](_0x285037,function(_0x52848e){if(_0x52848e['type']!==_0x0527('0x3c')){var _0x3adf27={};_0x3adf27[_0x52848e[_0x0527('0x29')]]={'$like':'%'+_0x3f3686[_0x0527('0x2f')][_0x0527('0x3a')]+'%'};return _0x3adf27;}})});}_0x385b37=_[_0x0527('0x3b')]({},_0x385b37,_0x3f3686[_0x0527('0x3d')]);var _0x5ac9ae={'where':_0x385b37[_0x0527('0x39')]};return db[_0x0527('0x3e')]['count'](_0x5ac9ae)['then'](function(_0x2a9b4f){_0x3287fb[_0x0527('0x1f')]=_0x2a9b4f;if(_0x3f3686[_0x0527('0x2f')]['includeAll']){_0x385b37[_0x0527('0x3f')]=[{'all':!![]}];}return db[_0x0527('0x3e')][_0x0527('0x40')](_0x385b37);})['then'](function(_0x1026da){_0x3287fb[_0x0527('0x41')]=_0x1026da;return _0x3287fb;})['then'](respondWithFilteredResult(_0x2efbe7,_0x385b37))['catch'](handleError(_0x2efbe7,null));};exports[_0x0527('0x42')]=function(_0x4ed0a1,_0x5456ef){var _0x5c24f5={'raw':!![],'where':{'id':_0x4ed0a1[_0x0527('0x43')]['id']}},_0x34d078={};_0x34d078[_0x0527('0x2e')]=_[_0x0527('0x30')](db[_0x0527('0x3e')][_0x0527('0x44')]);_0x34d078[_0x0527('0x2f')]=_[_0x0527('0x30')](_0x4ed0a1[_0x0527('0x2f')]);_0x34d078[_0x0527('0x31')]=_[_0x0527('0x32')](_0x34d078['model'],_0x34d078[_0x0527('0x2f')]);_0x5c24f5['attributes']=_[_0x0527('0x32')](_0x34d078['model'],qs[_0x0527('0x34')](_0x4ed0a1[_0x0527('0x2f')][_0x0527('0x34')]));_0x5c24f5['attributes']=_0x5c24f5['attributes']['length']?_0x5c24f5[_0x0527('0x33')]:_0x34d078['model'];if(_0x4ed0a1[_0x0527('0x2f')][_0x0527('0x45')]){_0x5c24f5['include']=[{'all':!![]}];}_0x5c24f5=_[_0x0527('0x3b')]({},_0x5c24f5,_0x4ed0a1[_0x0527('0x3d')]);return db[_0x0527('0x3e')]['find'](_0x5c24f5)[_0x0527('0x26')](handleEntityNotFound(_0x5456ef,null))[_0x0527('0x26')](respondWithResult(_0x5456ef,null))[_0x0527('0x46')](handleError(_0x5456ef,null));};exports[_0x0527('0x47')]=function(_0x4578be,_0x22650a){return db[_0x0527('0x3e')][_0x0527('0x47')](_0x4578be['body'],{})[_0x0527('0x26')](function(_0x44baf1){var _0x3efdd0=_0x4578be[_0x0527('0x48')][_0x0527('0x24')]({'plain':!![]});if(!_0x3efdd0)throw new Error(_0x0527('0x49'));if(_0x3efdd0[_0x0527('0x4a')]==='user'){var _0x2b0e68=_0x44baf1[_0x0527('0x24')]({'plain':!![]});var _0x50d155=_0x0527('0x25');return db[_0x0527('0x4b')][_0x0527('0x4c')]({'where':{'name':_0x50d155,'userProfileId':_0x3efdd0['userProfileId']},'raw':!![]})[_0x0527('0x26')](function(_0x2cc2d9){if(_0x2cc2d9&&_0x2cc2d9['autoAssociation']===0x0){return db['UserProfileResource'][_0x0527('0x47')]({'name':_0x2b0e68['name'],'resourceId':_0x2b0e68['id'],'type':_0x2cc2d9[_0x0527('0x29')],'sectionId':_0x2cc2d9['id']},{})[_0x0527('0x26')](function(){return _0x44baf1;});}else{return _0x44baf1;}})[_0x0527('0x46')](function(_0x1c89e4){logger[_0x0527('0x27')](_0x0527('0x4d'),_0x1c89e4);throw _0x1c89e4;});}return _0x44baf1;})['then'](respondWithResult(_0x22650a,0xc9))[_0x0527('0x46')](handleError(_0x22650a,null));};exports[_0x0527('0x4e')]=function(_0x40695d,_0x16c4f3){if(_0x40695d[_0x0527('0x4f')]['id']){delete _0x40695d[_0x0527('0x4f')]['id'];}return db[_0x0527('0x3e')][_0x0527('0x4c')]({'where':{'id':_0x40695d[_0x0527('0x43')]['id']}})['then'](handleEntityNotFound(_0x16c4f3,null))[_0x0527('0x26')](saveUpdates(_0x40695d[_0x0527('0x4f')],null))[_0x0527('0x26')](respondWithResult(_0x16c4f3,null))['catch'](handleError(_0x16c4f3,null));};exports[_0x0527('0x50')]=function(_0x49d921,_0x3b61bb){return db[_0x0527('0x3e')][_0x0527('0x4c')]({'where':{'id':_0x49d921['params']['id']}})['then'](handleEntityNotFound(_0x3b61bb,null))['then'](removeEntity(_0x3b61bb,null))[_0x0527('0x46')](handleError(_0x3b61bb,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ec35fbe..e2e1ed4 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 _0xc136=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x356a1e,_0xd237be){var _0x24e362=function(_0x4a1525){while(--_0x4a1525){_0x356a1e['push'](_0x356a1e['shift']());}};_0x24e362(++_0xd237be);}(_0xc136,0xfc));var _0x6c13=function(_0xfaca6e,_0x338348){_0xfaca6e=_0xfaca6e-0x0;var _0x56dc50=_0xc136[_0xfaca6e];return _0x56dc50;};'use strict';var _=require(_0x6c13('0x0'));var util=require('util');var logger=require(_0x6c13('0x1'))(_0x6c13('0x2'));var moment=require(_0x6c13('0x3'));var BPromise=require(_0x6c13('0x4'));var rp=require(_0x6c13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c13('0x6'));var config=require(_0x6c13('0x7'));var attributes=require(_0x6c13('0x8'));module[_0x6c13('0x9')]=function(_0x25ff40,_0x2ff501){return _0x25ff40[_0x6c13('0xa')](_0x6c13('0xb'),attributes,{'tableName':_0x6c13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8da0=['define','Variable','tools_variables','lodash','util','../../config/logger','moment','path','exports'];(function(_0xa1dc2c,_0x6d230d){var _0x4caf06=function(_0x107e1c){while(--_0x107e1c){_0xa1dc2c['push'](_0xa1dc2c['shift']());}};_0x4caf06(++_0x6d230d);}(_0x8da0,0x135));var _0x08da=function(_0x3b7c4c,_0x3280fc){_0x3b7c4c=_0x3b7c4c-0x0;var _0x5952ef=_0x8da0[_0x3b7c4c];return _0x5952ef;};'use strict';var _=require(_0x08da('0x0'));var util=require(_0x08da('0x1'));var logger=require(_0x08da('0x2'))('api');var moment=require(_0x08da('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08da('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x08da('0x5')]=function(_0x8fd120,_0x7fecda){return _0x8fd120[_0x08da('0x6')](_0x08da('0x7'),attributes,{'tableName':_0x08da('0x8'),'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 a3b605e..1cc7813 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x405d75,_0x4aa7f3){var _0x58a95d=function(_0x5568d4){while(--_0x5568d4){_0x405d75['push'](_0x405d75['shift']());}};_0x58a95d(++_0x4aa7f3);}(_0xf494,0x1c6));var _0x4f49=function(_0x44709b,_0x1cfbf1){_0x44709b=_0x44709b-0x0;var _0x47cd92=_0xf494[_0x44709b];return _0x47cd92;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x2e44e6,_0x3781b9){var _0x2bf74e=function(_0x27c27d){while(--_0x27c27d){_0x2e44e6['push'](_0x2e44e6['shift']());}};_0x2bf74e(++_0x3781b9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 07bb256..2650be4 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 _0xb699=['/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset','reset','/pull','canUpdate','pull','/restart','restart'];(function(_0x79ffad,_0x67abb3){var _0x3cffc6=function(_0x35b6a2){while(--_0x35b6a2){_0x79ffad['push'](_0x79ffad['shift']());}};_0x3cffc6(++_0x67abb3);}(_0xb699,0x16b));var _0x9b69=function(_0x3ea91b,_0x48cf46){_0x3ea91b=_0x3ea91b-0x0;var _0x424dea=_0xb699[_0x3ea91b];return _0x424dea;};'use strict';var express=require('express');var router=express[_0x9b69('0x0')]();var auth=require(_0x9b69('0x1'));var controller=require(_0x9b69('0x2'));router[_0x9b69('0x3')]('/',controller[_0x9b69('0x4')]);router['get'](_0x9b69('0x5'),auth[_0x9b69('0x6')](),auth['canUpdate'](),controller[_0x9b69('0x7')]);router[_0x9b69('0x3')](_0x9b69('0x8'),auth[_0x9b69('0x6')](),auth['canUpdate'](),controller[_0x9b69('0x9')]);router[_0x9b69('0x3')](_0x9b69('0xa'),auth[_0x9b69('0x6')](),auth[_0x9b69('0xb')](),controller[_0x9b69('0xc')]);router[_0x9b69('0x3')](_0x9b69('0xd'),auth['isAuthenticated'](),controller[_0x9b69('0xe')]);router[_0x9b69('0x3')](_0x9b69('0xf'),controller[_0x9b69('0x10')]);module[_0x9b69('0x11')]=router; \ No newline at end of file +var _0x8cf2=['../../components/auth/service','./version.controller','get','fetch','canUpdate','reset','/pull','isAuthenticated','pull','/migrations','migrations','exports'];(function(_0x5508d9,_0x2a6dcc){var _0x2dada6=function(_0x3a528c){while(--_0x3a528c){_0x5508d9['push'](_0x5508d9['shift']());}};_0x2dada6(++_0x2a6dcc);}(_0x8cf2,0x1a4));var _0x28cf=function(_0x4a2057,_0x87087){_0x4a2057=_0x4a2057-0x0;var _0x33b8d7=_0x8cf2[_0x4a2057];return _0x33b8d7;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x28cf('0x0'));var controller=require(_0x28cf('0x1'));router['get']('/',controller['index']);router[_0x28cf('0x2')]('/fetch',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x28cf('0x3')]);router[_0x28cf('0x2')]('/reset',auth['isAuthenticated'](),auth[_0x28cf('0x4')](),controller[_0x28cf('0x5')]);router[_0x28cf('0x2')](_0x28cf('0x6'),auth[_0x28cf('0x7')](),auth['canUpdate'](),controller[_0x28cf('0x8')]);router['get']('/restart',auth[_0x28cf('0x7')](),controller['restart']);router['get'](_0x28cf('0x9'),controller[_0x28cf('0xa')]);module[_0x28cf('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 458d6fc..9088e5a 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 _0xd06b=['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','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports','query','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','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','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd06b,0xec));var _0xbd06=function(_0x238ee9,_0x5cbb29){_0x238ee9=_0x238ee9-0x0;var _0x47e856=_0xd06b[_0x238ee9];return _0x47e856;};'use strict';var Umzug=require(_0xbd06('0x0'));var path=require(_0xbd06('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xbd06('0x2'))(module,_0xbd06('0x3'));var compareVersions=require(_0xbd06('0x4'));var exec=require(_0xbd06('0x5'))[_0xbd06('0x6')];var db=require(_0xbd06('0x7'))['db'];var config=require(_0xbd06('0x8'));var pm2=require(_0xbd06('0x9'));var logger=require(_0xbd06('0xa'))('update');var git=require('simple-git')(config[_0xbd06('0xb')]);exports[_0xbd06('0xc')]=function(_0x107e99,_0x5a7b87){var _0x599c3b={'current':module[_0xbd06('0xd')][_0xbd06('0x3')],'phonebar':0x2};if(_0x107e99[_0xbd06('0xe')]&&_0x107e99[_0xbd06('0xe')]['latest']){return git[_0xbd06('0xf')]()[_0xbd06('0x10')](function(_0x573070,_0x1371df){_0x599c3b['latest']=(_0x573070?module[_0xbd06('0xd')][_0xbd06('0x3')]:_0x1371df['latest'])||_0xbd06('0x11');return _0x5a7b87[_0xbd06('0x12')](0xc8)['json'](_0x599c3b);});}else{return _0x5a7b87[_0xbd06('0x12')](0xc8)[_0xbd06('0x13')](_0x599c3b);}};exports[_0xbd06('0xf')]=function(_0xeca51c,_0x275f73){return git[_0xbd06('0xf')](['origin',_0xbd06('0x14')],function(_0x3dd066){if(_0x3dd066){logger[_0xbd06('0x15')](_0x3dd066);return _0x275f73['status'](0x1f4)[_0xbd06('0x13')](_0x3dd066);}logger['info'](_0xbd06('0x16'));return _0x275f73['status'](0xc8)[_0xbd06('0x13')]({'output':_0xbd06('0x17')});});};exports[_0xbd06('0x18')]=function(_0x5dce68,_0x4f971a){return git['reset']([_0xbd06('0x19'),_0xbd06('0x1a')],function(_0x57ff08){if(_0x57ff08){logger[_0xbd06('0x15')](_0x57ff08);return _0x4f971a['status'](0x1f4)['json'](_0x57ff08);}logger[_0xbd06('0x1b')](_0xbd06('0x1c'));return _0x4f971a[_0xbd06('0x12')](0xc8)['json']({'output':_0xbd06('0x1d')});});};exports[_0xbd06('0x1e')]=function(_0x3c5c9d,_0x5aef1e){exec(_0xbd06('0x1f'),function(_0x504047,_0x258e34,_0x26d4a5){logger[_0xbd06('0x1b')](_0x258e34);logger[_0xbd06('0x1b')](_0x26d4a5);if(_0x504047){logger[_0xbd06('0x15')](_0x504047);return _0x5aef1e[_0xbd06('0x12')](0x1f4)[_0xbd06('0x13')](_0x504047);}return _0x5aef1e[_0xbd06('0x12')](0xc8)[_0xbd06('0x13')]({'output':_0x258e34});});};exports['restart']=function(_0x49d5e1,_0x198afe){return pm2[_0xbd06('0x20')]('motion2')[_0xbd06('0x21')](function(_0x3fbd54){logger[_0xbd06('0x1b')](_0xbd06('0x22'),_0x3fbd54);return _0x198afe[_0xbd06('0x12')](0xc8)[_0xbd06('0x13')]({'output':_0xbd06('0x23')});})['catch'](function(_0x9f4f5){logger[_0xbd06('0x15')](_0x9f4f5);return _0x198afe[_0xbd06('0x12')](0x1f4)['json'](_0x9f4f5);});};exports[_0xbd06('0x24')]=function(_0x4886ac,_0x541388){var _0xd74dd4=fs[_0xbd06('0x25')](path[_0xbd06('0x26')](config[_0xbd06('0xb')],_0xbd06('0x27'),'migrations'));var _0x581ce2=[];for(var _0x204e9c=0x0;_0x204e9c<_0xd74dd4[_0xbd06('0x28')];_0x204e9c++){var _0x4d9a42=_0xd74dd4[_0x204e9c][_0xbd06('0x29')](_0xbd06('0x2a'),'');if(compareVersions(module['exports'][_0xbd06('0x3')],_0x4d9a42)===-0x1){_0x581ce2[_0xbd06('0x2b')](_0x4d9a42);}}if(_0x581ce2[_0xbd06('0x28')]){var _0x393125=_0x581ce2[_0xbd06('0x2c')](compareVersions);var _0x35c4ba=new Umzug({'storage':_0xbd06('0x2d'),'storageOptions':{'model':db[_0xbd06('0x2e')],'modelName':_0xbd06('0x2e'),'columnName':_0xbd06('0x3')},'migrations':{'params':[db[_0xbd06('0x2d')][_0xbd06('0x2f')](),db[_0xbd06('0x2d')][_0xbd06('0x30')],function(){throw new Error(_0xbd06('0x31'));}],'path':path[_0xbd06('0x26')](config[_0xbd06('0xb')],_0xbd06('0x27'),'migrations'),'pattern':/\.js$/}});_0x35c4ba['up']({'migrations':_[_0xbd06('0x32')](_0x393125,function(_0xdafd8f){return _0xdafd8f+'.js';})})[_0xbd06('0x21')](function(){return _0x541388[_0xbd06('0x12')](0xc8)[_0xbd06('0x13')]({'output':_0xbd06('0x33')+module[_0xbd06('0xd')]['version']+_0xbd06('0x34')+_[_0xbd06('0x35')](_0x393125),'migrations':_[_0xbd06('0x26')](_0x393125)});})[_0xbd06('0x36')](function(_0x2186b1){if(_0x2186b1 instanceof db[_0xbd06('0x2d')][_0xbd06('0x37')]){return _0x541388['status'](0xc8)['json']({'output':_0xbd06('0x38')});}else{return _0x541388['status'](0x1f4)['json'](_0x2186b1);}});}else{return _0x541388[_0xbd06('0x12')](0xc8)[_0xbd06('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xbbfa=['.js','push','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','tags','latest','2.0.0','json','status','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbfa,0xde));var _0xabbf=function(_0x122ca8,_0x49391a){_0x122ca8=_0x122ca8-0x0;var _0x59ecd3=_0xbbfa[_0x122ca8];return _0x59ecd3;};'use strict';var Umzug=require(_0xabbf('0x0'));var path=require(_0xabbf('0x1'));var fs=require('fs');var _=require(_0xabbf('0x2'));var pkginfo=require(_0xabbf('0x3'))(module,_0xabbf('0x4'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0xabbf('0x5')];var db=require(_0xabbf('0x6'))['db'];var config=require(_0xabbf('0x7'));var pm2=require(_0xabbf('0x8'));var logger=require('../../config/logger')(_0xabbf('0x9'));var git=require('simple-git')(config[_0xabbf('0xa')]);exports[_0xabbf('0xb')]=function(_0xa8ee7,_0x90441d){var _0x33b61f={'current':module[_0xabbf('0xc')][_0xabbf('0x4')],'phonebar':0x2};if(_0xa8ee7[_0xabbf('0xd')]&&_0xa8ee7[_0xabbf('0xd')]['latest']){return git['fetch']()[_0xabbf('0xe')](function(_0x4b1a4a,_0x4377e5){_0x33b61f[_0xabbf('0xf')]=(_0x4b1a4a?module['exports'][_0xabbf('0x4')]:_0x4377e5[_0xabbf('0xf')])||_0xabbf('0x10');return _0x90441d['status'](0xc8)[_0xabbf('0x11')](_0x33b61f);});}else{return _0x90441d[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')](_0x33b61f);}};exports['fetch']=function(_0x1075c6,_0x1479c2){return git['fetch']([_0xabbf('0x13'),'master'],function(_0x8db74){if(_0x8db74){logger[_0xabbf('0x14')](_0x8db74);return _0x1479c2[_0xabbf('0x12')](0x1f4)['json'](_0x8db74);}logger[_0xabbf('0x15')](_0xabbf('0x16'));return _0x1479c2['status'](0xc8)[_0xabbf('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xabbf('0x17')]=function(_0x2ecf44,_0x3cdbf1){return git[_0xabbf('0x17')]([_0xabbf('0x18'),_0xabbf('0x19')],function(_0x264b5a){if(_0x264b5a){logger[_0xabbf('0x14')](_0x264b5a);return _0x3cdbf1[_0xabbf('0x12')](0x1f4)[_0xabbf('0x11')](_0x264b5a);}logger[_0xabbf('0x15')](_0xabbf('0x1a'));return _0x3cdbf1[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')]({'output':_0xabbf('0x1b')});});};exports[_0xabbf('0x1c')]=function(_0x2140d0,_0x3d4028){exec(_0xabbf('0x1d'),function(_0x2c936a,_0x532e1c,_0x5f3207){logger[_0xabbf('0x15')](_0x532e1c);logger['info'](_0x5f3207);if(_0x2c936a){logger[_0xabbf('0x14')](_0x2c936a);return _0x3d4028[_0xabbf('0x12')](0x1f4)[_0xabbf('0x11')](_0x2c936a);}return _0x3d4028['status'](0xc8)['json']({'output':_0x532e1c});});};exports[_0xabbf('0x1e')]=function(_0x17ded1,_0x58c521){return pm2[_0xabbf('0x1e')]('motion2')[_0xabbf('0x1f')](function(_0x205544){logger[_0xabbf('0x15')](_0xabbf('0x20'),_0x205544);return _0x58c521[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')]({'output':_0xabbf('0x21')});})['catch'](function(_0xfd25c){logger['error'](_0xfd25c);return _0x58c521[_0xabbf('0x12')](0x1f4)[_0xabbf('0x11')](_0xfd25c);});};exports[_0xabbf('0x22')]=function(_0x38a176,_0x259bf8){var _0x5d48be=fs[_0xabbf('0x23')](path['join'](config[_0xabbf('0xa')],_0xabbf('0x24'),_0xabbf('0x22')));var _0x30797e=[];for(var _0x32547b=0x0;_0x32547b<_0x5d48be[_0xabbf('0x25')];_0x32547b++){var _0x273f48=_0x5d48be[_0x32547b]['replace'](_0xabbf('0x26'),'');if(compareVersions(module[_0xabbf('0xc')][_0xabbf('0x4')],_0x273f48)===-0x1){_0x30797e[_0xabbf('0x27')](_0x273f48);}}if(_0x30797e['length']){var _0x387e1e=_0x30797e[_0xabbf('0x28')](compareVersions);var _0x3a12bd=new Umzug({'storage':_0xabbf('0x29'),'storageOptions':{'model':db[_0xabbf('0x2a')],'modelName':_0xabbf('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0xabbf('0x29')]['getQueryInterface'](),db[_0xabbf('0x29')][_0xabbf('0x2b')],function(){throw new Error(_0xabbf('0x2c'));}],'path':path[_0xabbf('0x2d')](config['root'],'server',_0xabbf('0x22')),'pattern':/\.js$/}});_0x3a12bd['up']({'migrations':_[_0xabbf('0x2e')](_0x387e1e,function(_0x3d154e){return _0x3d154e+'.js';})})[_0xabbf('0x1f')](function(){return _0x259bf8[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')]({'output':_0xabbf('0x2f')+module[_0xabbf('0xc')][_0xabbf('0x4')]+_0xabbf('0x30')+_[_0xabbf('0x31')](_0x387e1e),'migrations':_['join'](_0x387e1e)});})[_0xabbf('0x32')](function(_0x48f457){if(_0x48f457 instanceof db[_0xabbf('0x29')]['UniqueConstraintError']){return _0x259bf8[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x259bf8[_0xabbf('0x12')](0x1f4)['json'](_0x48f457);}});}else{return _0x259bf8[_0xabbf('0x12')](0xc8)[_0xabbf('0x11')]({'output':_0xabbf('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c40af17..a409e0f 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 _0x7486=['express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','index','get','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7486,0x1dd));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6748('0x0'));var util=require(_0x6748('0x1'));var path=require(_0x6748('0x2'));var timeout=require('connect-timeout');var express=require(_0x6748('0x3'));var router=express[_0x6748('0x4')]();var fs_extra=require(_0x6748('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6748('0x6'));var config=require('../../config/environment');var controller=require(_0x6748('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6748('0x8')]);router[_0x6748('0x9')]('/describe',auth[_0x6748('0xa')](),controller[_0x6748('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6748('0xc')]);router['post']('/',auth[_0x6748('0xa')](),controller[_0x6748('0xd')]);router[_0x6748('0xe')](_0x6748('0xf'),auth[_0x6748('0xa')](),controller[_0x6748('0x10')]);router[_0x6748('0x11')](_0x6748('0xf'),auth[_0x6748('0xa')](),controller[_0x6748('0x12')]);module[_0x6748('0x13')]=router; \ No newline at end of file +var _0x85ba=['show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x85ba,0x116));var _0xa85b=function(_0x4be083,_0x3393b8){_0x4be083=_0x4be083-0x0;var _0x12494d=_0x85ba[_0x4be083];return _0x12494d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa85b('0x0'));var timeout=require(_0xa85b('0x1'));var express=require(_0xa85b('0x2'));var router=express[_0xa85b('0x3')]();var fs_extra=require(_0xa85b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa85b('0x5'));router[_0xa85b('0x6')]('/',auth[_0xa85b('0x7')](),controller['index']);router[_0xa85b('0x6')](_0xa85b('0x8'),auth['isAuthenticated'](),controller[_0xa85b('0x9')]);router[_0xa85b('0x6')]('/:id',auth[_0xa85b('0x7')](),controller[_0xa85b('0xa')]);router[_0xa85b('0xb')]('/',auth['isAuthenticated'](),controller[_0xa85b('0xc')]);router[_0xa85b('0xd')](_0xa85b('0xe'),auth['isAuthenticated'](),controller[_0xa85b('0xf')]);router['delete'](_0xa85b('0xe'),auth['isAuthenticated'](),controller[_0xa85b('0x10')]);module[_0xa85b('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index f8252a9..d4b63c9 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 _0xb6a6=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x549ed9,_0x2429fb){var _0x2e5b3a=function(_0x30496b){while(--_0x30496b){_0x549ed9['push'](_0x549ed9['shift']());}};_0x2e5b3a(++_0x2429fb);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x564a0d,_0x4c4e5d){_0x564a0d=_0x564a0d-0x0;var _0x8f04a5=_0xb6a6[_0x564a0d];return _0x8f04a5;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6b6a('0x2')]},'calleridname':{'type':Sequelize[_0x6b6a('0x2')]},'queue':{'type':Sequelize[_0x6b6a('0x2')]},'interface':{'type':Sequelize[_0x6b6a('0x2')]},'membername':{'type':Sequelize[_0x6b6a('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x6b6a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x6b6a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x6b6a('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x6b6a('0x4')]},'agentcomplete':{'type':Sequelize[_0x6b6a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6b6a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6b6a('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6b6a('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x6b6a('0x2')]},'channel':{'type':Sequelize[_0x6b6a('0x2')]},'channelstate':{'type':Sequelize[_0x6b6a('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6b6a('0x2')]},'language':{'type':Sequelize[_0x6b6a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6b6a('0x2')]},'priority':{'type':Sequelize[_0x6b6a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6b6a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x6b6a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6b6a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6b6a('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6b6a('0x2')]},'destaccountcode':{'type':Sequelize[_0x6b6a('0x2')]},'destcontext':{'type':Sequelize[_0x6b6a('0x2')]},'destexten':{'type':Sequelize[_0x6b6a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6b6a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6b6a('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x6b6a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6b6a('0x2')],'comment':_0x6b6a('0x6')},'transferexten':{'type':Sequelize[_0x6b6a('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6b6a('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d21=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5f87ca,_0x2a9df1){var _0x3e9786=function(_0x28f41e){while(--_0x28f41e){_0x5f87ca['push'](_0x5f87ca['shift']());}};_0x3e9786(++_0x2a9df1);}(_0x1d21,0x158));var _0x11d2=function(_0x2418e0,_0x7215b0){_0x2418e0=_0x2418e0-0x0;var _0x55ffbf=_0x1d21[_0x2418e0];return _0x55ffbf;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'type':{'type':Sequelize[_0x11d2('0x2')]},'uniqueid':{'type':Sequelize[_0x11d2('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x11d2('0x2')]},'queue':{'type':Sequelize[_0x11d2('0x2')]},'interface':{'type':Sequelize[_0x11d2('0x2')]},'membername':{'type':Sequelize[_0x11d2('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x11d2('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x11d2('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x11d2('0x3')]},'agentdumpAt':{'type':Sequelize[_0x11d2('0x3')]},'holdtime':{'type':Sequelize[_0x11d2('0x4')]},'agentcomplete':{'type':Sequelize[_0x11d2('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x11d2('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x11d2('0x4')]},'agentacw':{'type':Sequelize[_0x11d2('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x11d2('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x11d2('0x2')]},'channelstate':{'type':Sequelize[_0x11d2('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x11d2('0x2')]},'connectedlinename':{'type':Sequelize[_0x11d2('0x2')]},'language':{'type':Sequelize[_0x11d2('0x2')]},'accountcode':{'type':Sequelize[_0x11d2('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x11d2('0x2')]},'destchannel':{'type':Sequelize[_0x11d2('0x2')]},'destchannelstate':{'type':Sequelize[_0x11d2('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x11d2('0x2')]},'destcalleridname':{'type':Sequelize[_0x11d2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x11d2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x11d2('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x11d2('0x2')]},'destcontext':{'type':Sequelize[_0x11d2('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x11d2('0x2')]},'destuniqueid':{'type':Sequelize[_0x11d2('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x11d2('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x11d2('0x2')]},'transfer':{'type':Sequelize[_0x11d2('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x11d2('0x2')],'comment':_0x11d2('0x6')},'transferexten':{'type':Sequelize[_0x11d2('0x2')]},'transferuniqueid':{'type':Sequelize[_0x11d2('0x2')]},'agententerreason':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index d389ef1..9698eb9 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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 59ccbbf..523a2f4 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 _0xac95=['define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xac95,0xa8));var _0x5ac9=function(_0x3d5af9,_0x13ecb3){_0x3d5af9=_0x3d5af9-0x0;var _0x434463=_0xac95[_0x3d5af9];return _0x434463;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var logger=require(_0x5ac9('0x2'))(_0x5ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ac9('0x4'));var fs=require('fs');var path=require(_0x5ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x5ac9('0x6'));var attributes=require(_0x5ac9('0x7'));module['exports']=function(_0x1dc09a,_0x2bb4da){return _0x1dc09a[_0x5ac9('0x8')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5ac9('0x9'),_0x5ac9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ef3=['destuniqueid','lodash','util','api','moment','bluebird','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid'];(function(_0x219ac2,_0x2b0f4e){var _0x585d12=function(_0x44b730){while(--_0x44b730){_0x219ac2['push'](_0x219ac2['shift']());}};_0x585d12(++_0x2b0f4e);}(_0x1ef3,0x69));var _0x31ef=function(_0x4136c6,_0x2ed2fe){_0x4136c6=_0x4136c6-0x0;var _0x305aa1=_0x1ef3[_0x4136c6];return _0x305aa1;};'use strict';var _=require(_0x31ef('0x0'));var util=require(_0x31ef('0x1'));var logger=require('../../config/logger')(_0x31ef('0x2'));var moment=require(_0x31ef('0x3'));var BPromise=require(_0x31ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ef('0x5'));var rimraf=require(_0x31ef('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ef('0x7'));module[_0x31ef('0x8')]=function(_0x81db4,_0x454b60){return _0x81db4[_0x31ef('0x9')](_0x31ef('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x31ef('0xb'),_0x31ef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8d74537..2cfe3c1 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 _0x3830=['../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','options','raw','update','body','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x44c440,_0x53a4d0){var _0x1e4871=function(_0x15c5cf){while(--_0x15c5cf){_0x44c440['push'](_0x44c440['shift']());}};_0x1e4871(++_0x53a4d0);}(_0x3830,0xc9));var _0x0383=function(_0x282320,_0x379ad6){_0x282320=_0x282320-0x0;var _0x271d54=_0x3830[_0x282320];return _0x271d54;};'use strict';var _=require(_0x0383('0x0'));var util=require(_0x0383('0x1'));var moment=require(_0x0383('0x2'));var BPromise=require(_0x0383('0x3'));var rs=require(_0x0383('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0383('0x5'))['db'];var utils=require(_0x0383('0x6'));var logger=require(_0x0383('0x7'))(_0x0383('0x8'));var config=require(_0x0383('0x9'));var jayson=require(_0x0383('0xa'));var client=jayson[_0x0383('0xb')][_0x0383('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8c342b,_0x757063,_0xaf588a){return new BPromise(function(_0x533b22,_0x4cdfa3){return client[_0x0383('0xd')](_0x8c342b,_0xaf588a)[_0x0383('0xe')](function(_0x29b75b){logger['info'](_0x0383('0xf'),_0x757063,_0x0383('0x10'));logger[_0x0383('0x11')](_0x0383('0x12'),_0x757063,_0x0383('0x10'),JSON[_0x0383('0x13')](_0x29b75b));if(_0x29b75b[_0x0383('0x14')]){if(_0x29b75b[_0x0383('0x14')]['code']===0x1f4){logger[_0x0383('0x14')](_0x0383('0xf'),_0x757063,_0x29b75b[_0x0383('0x14')]['message']);return _0x4cdfa3(_0x29b75b[_0x0383('0x14')][_0x0383('0x15')]);}logger[_0x0383('0x14')](_0x0383('0xf'),_0x757063,_0x29b75b[_0x0383('0x14')]['message']);return _0x533b22(_0x29b75b[_0x0383('0x14')][_0x0383('0x15')]);}else{logger[_0x0383('0x16')](_0x0383('0xf'),_0x757063,_0x0383('0x10'));_0x533b22(_0x29b75b[_0x0383('0x17')][_0x0383('0x15')]);}})[_0x0383('0x18')](function(_0x450067){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x757063,_0x450067);_0x4cdfa3(_0x450067);});});}exports[_0x0383('0x19')]=function(_0x1db31b){var _0x1a1a40=this;return new Promise(function(_0x17891d,_0x2d17a0){return db[_0x0383('0x1a')]['create'](_0x1db31b['body'],{'raw':_0x1db31b[_0x0383('0x1b')]?_0x1db31b[_0x0383('0x1b')][_0x0383('0x1c')]===undefined?!![]:![]:!![]})[_0x0383('0xe')](function(_0x14084e){logger[_0x0383('0x16')](_0x0383('0x19'),_0x1db31b);logger[_0x0383('0x11')](_0x0383('0x19'),_0x1db31b,JSON[_0x0383('0x13')](_0x14084e));_0x17891d(_0x14084e);})[_0x0383('0x18')](function(_0x1415a8){logger[_0x0383('0x14')](_0x0383('0x19'),_0x1415a8[_0x0383('0x15')],_0x1db31b);_0x2d17a0(_0x1a1a40['error'](0x1f4,_0x1415a8[_0x0383('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x50b9bb){var _0x5b051a=this;return new Promise(function(_0xc04374,_0x2b2484){return db[_0x0383('0x1a')][_0x0383('0x1d')](_0x50b9bb[_0x0383('0x1e')],{'raw':_0x50b9bb[_0x0383('0x1b')]?_0x50b9bb['options'][_0x0383('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b9bb[_0x0383('0x1b')]?_0x50b9bb['options'][_0x0383('0x1f')]||null:null,'attributes':_0x50b9bb[_0x0383('0x1b')]?_0x50b9bb[_0x0383('0x1b')][_0x0383('0x20')]||null:null,'limit':_0x50b9bb[_0x0383('0x1b')]?_0x50b9bb[_0x0383('0x1b')][_0x0383('0x21')]||null:null})[_0x0383('0xe')](function(_0x5e1c36){logger[_0x0383('0x16')](_0x0383('0x22'),_0x50b9bb);logger['debug'](_0x0383('0x22'),_0x50b9bb,JSON[_0x0383('0x13')](_0x5e1c36));_0xc04374(_0x5e1c36);})[_0x0383('0x18')](function(_0x40e787){logger['error'](_0x0383('0x22'),_0x40e787[_0x0383('0x15')],_0x50b9bb);_0x2b2484(_0x5b051a[_0x0383('0x14')](0x1f4,_0x40e787[_0x0383('0x15')]));});});}; \ No newline at end of file +var _0x6b06=['result','CreateVoiceAgentReport','create','body','options','raw','then','debug','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x5da4ec,_0x5d7bf0){var _0x5076af=function(_0x54f950){while(--_0x54f950){_0x5da4ec['push'](_0x5da4ec['shift']());}};_0x5076af(++_0x5d7bf0);}(_0x6b06,0x105));var _0x66b0=function(_0x102d03,_0x5ac00e){_0x102d03=_0x102d03-0x0;var _0xcb5b4e=_0x6b06[_0x102d03];return _0xcb5b4e;};'use strict';var _=require(_0x66b0('0x0'));var util=require('util');var moment=require(_0x66b0('0x1'));var BPromise=require(_0x66b0('0x2'));var rs=require(_0x66b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66b0('0x4'))['db'];var utils=require(_0x66b0('0x5'));var logger=require(_0x66b0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x66b0('0x7'));var client=jayson['client'][_0x66b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x559681,_0x5e9655,_0x539308){return new BPromise(function(_0x37a4ac,_0x1a3d17){return client[_0x66b0('0x9')](_0x559681,_0x539308)['then'](function(_0x27152a){logger[_0x66b0('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x5e9655,_0x66b0('0xb'));logger['debug'](_0x66b0('0xc'),_0x5e9655,_0x66b0('0xb'),JSON[_0x66b0('0xd')](_0x27152a));if(_0x27152a[_0x66b0('0xe')]){if(_0x27152a[_0x66b0('0xe')][_0x66b0('0xf')]===0x1f4){logger[_0x66b0('0xe')](_0x66b0('0x10'),_0x5e9655,_0x27152a[_0x66b0('0xe')][_0x66b0('0x11')]);return _0x1a3d17(_0x27152a['error'][_0x66b0('0x11')]);}logger[_0x66b0('0xe')](_0x66b0('0x10'),_0x5e9655,_0x27152a[_0x66b0('0xe')][_0x66b0('0x11')]);return _0x37a4ac(_0x27152a[_0x66b0('0xe')][_0x66b0('0x11')]);}else{logger['info'](_0x66b0('0x10'),_0x5e9655,'request\x20sent');_0x37a4ac(_0x27152a[_0x66b0('0x12')]['message']);}})['catch'](function(_0x454c6f){logger[_0x66b0('0xe')](_0x66b0('0x10'),_0x5e9655,_0x454c6f);_0x1a3d17(_0x454c6f);});});}exports[_0x66b0('0x13')]=function(_0xc94a2d){var _0x54815a=this;return new Promise(function(_0x440304,_0x5e700c){return db['VoiceAgentReport'][_0x66b0('0x14')](_0xc94a2d[_0x66b0('0x15')],{'raw':_0xc94a2d[_0x66b0('0x16')]?_0xc94a2d[_0x66b0('0x16')][_0x66b0('0x17')]===undefined?!![]:![]:!![]})[_0x66b0('0x18')](function(_0x22c0d5){logger[_0x66b0('0xa')](_0x66b0('0x13'),_0xc94a2d);logger[_0x66b0('0x19')](_0x66b0('0x13'),_0xc94a2d,JSON[_0x66b0('0xd')](_0x22c0d5));_0x440304(_0x22c0d5);})['catch'](function(_0x3f96c5){logger[_0x66b0('0xe')](_0x66b0('0x13'),_0x3f96c5['message'],_0xc94a2d);_0x5e700c(_0x54815a[_0x66b0('0xe')](0x1f4,_0x3f96c5['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x147da2){var _0x3c41d9=this;return new Promise(function(_0x58e562,_0x65ec31){return db['VoiceAgentReport'][_0x66b0('0x1a')](_0x147da2[_0x66b0('0x15')],{'raw':_0x147da2[_0x66b0('0x16')]?_0x147da2['options'][_0x66b0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x147da2['options']?_0x147da2['options'][_0x66b0('0x1b')]||null:null,'attributes':_0x147da2[_0x66b0('0x16')]?_0x147da2[_0x66b0('0x16')][_0x66b0('0x1c')]||null:null,'limit':_0x147da2[_0x66b0('0x16')]?_0x147da2['options'][_0x66b0('0x1d')]||null:null})[_0x66b0('0x18')](function(_0x1f799c){logger['info'](_0x66b0('0x1e'),_0x147da2);logger['debug'](_0x66b0('0x1e'),_0x147da2,JSON['stringify'](_0x1f799c));_0x58e562(_0x1f799c);})['catch'](function(_0x57e262){logger[_0x66b0('0xe')](_0x66b0('0x1e'),_0x57e262[_0x66b0('0x11')],_0x147da2);_0x65ec31(_0x3c41d9['error'](0x1f4,_0x57e262[_0x66b0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e57ce31..682b6fc 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 _0x29d4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','exports','multer','path','connect-timeout'];(function(_0x422002,_0xb378bb){var _0x95c154=function(_0xc6431a){while(--_0xc6431a){_0x422002['push'](_0x422002['shift']());}};_0x95c154(++_0xb378bb);}(_0x29d4,0x1a1));var _0x429d=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x29d4[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),auth['isAuthenticated'](),controller[_0x429d('0xd')]);router['get'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0xf')]);router['post']('/',auth[_0x429d('0xa')](),controller[_0x429d('0x10')]);router['put'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x11')]);router['delete'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x12')]);module[_0x429d('0x13')]=router; \ No newline at end of file +var _0x57d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x57d4,0x78));var _0x457d=function(_0x49f08e,_0x1f6b6c){_0x49f08e=_0x49f08e-0x0;var _0x2350ae=_0x57d4[_0x49f08e];return _0x2350ae;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),auth[_0x457d('0xb')](),controller['describe']);router['get'](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x457d('0x10')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x11')]);router[_0x457d('0x12')](_0x457d('0xe'),auth[_0x457d('0xb')](),controller[_0x457d('0x13')]);module[_0x457d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 17e5495..520c915 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 _0x4273=['exports','STRING','inbound','internal','outbound','TEXT','DATE','INTEGER','sequelize'];(function(_0x44029c,_0x426690){var _0x547fa1=function(_0x37b1f9){while(--_0x37b1f9){_0x44029c['push'](_0x44029c['shift']());}};_0x547fa1(++_0x426690);}(_0x4273,0xc5));var _0x3427=function(_0x2ac3a5,_0x188408){_0x2ac3a5=_0x2ac3a5-0x0;var _0x30d8f1=_0x4273[_0x2ac3a5];return _0x30d8f1;};'use strict';var Sequelize=require(_0x3427('0x0'));module[_0x3427('0x1')]={'uniqueid':{'type':Sequelize[_0x3427('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3427('0x3'),_0x3427('0x4'),_0x3427('0x5'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3427('0x2')]},'source':{'type':Sequelize[_0x3427('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x3427('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3427('0x2')]},'destinationchannel':{'type':Sequelize[_0x3427('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x3427('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3427('0x7')]},'endtime':{'type':Sequelize[_0x3427('0x7')]},'duration':{'type':Sequelize[_0x3427('0x8')]},'billableseconds':{'type':Sequelize[_0x3427('0x8')]},'mohtime':{'type':Sequelize[_0x3427('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3427('0x2')]},'amaflags':{'type':Sequelize[_0x3427('0x2')]},'userfield':{'type':Sequelize[_0x3427('0x2')]},'userDisposition':{'type':Sequelize[_0x3427('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x3427('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x3427('0x2')]},'note':{'type':Sequelize[_0x3427('0x2')]},'prefix':{'type':Sequelize[_0x3427('0x2')]},'routeid':{'type':Sequelize[_0x3427('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a7b=['inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x4a7b,0x81));var _0xb4a7=function(_0x2f9433,_0x31fd77){_0x2f9433=_0x2f9433-0x0;var _0x33ad2f=_0x4a7b[_0x2f9433];return _0x33ad2f;};'use strict';var Sequelize=require(_0xb4a7('0x0'));module[_0xb4a7('0x1')]={'uniqueid':{'type':Sequelize[_0xb4a7('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb4a7('0x3'),_0xb4a7('0x4'),_0xb4a7('0x5'),_0xb4a7('0x6'),_0xb4a7('0x7'),_0xb4a7('0x8'))},'tag':{'type':Sequelize[_0xb4a7('0x2')]},'accountcode':{'type':Sequelize[_0xb4a7('0x2')]},'source':{'type':Sequelize[_0xb4a7('0x2')]},'destination':{'type':Sequelize[_0xb4a7('0x2')]},'destinationcontext':{'type':Sequelize[_0xb4a7('0x2')]},'callerid':{'type':Sequelize[_0xb4a7('0x2')]},'channel':{'type':Sequelize[_0xb4a7('0x2')]},'destinationchannel':{'type':Sequelize[_0xb4a7('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xb4a7('0x9')]},'starttime':{'type':Sequelize[_0xb4a7('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb4a7('0xa')]},'endtime':{'type':Sequelize[_0xb4a7('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xb4a7('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb4a7('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb4a7('0x2')]},'userDisposition':{'type':Sequelize[_0xb4a7('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xb4a7('0x2')]},'note':{'type':Sequelize[_0xb4a7('0x2')]},'prefix':{'type':Sequelize[_0xb4a7('0x2')]},'routeid':{'type':Sequelize[_0xb4a7('0xb')]},'sipcallid':{'type':Sequelize[_0xb4a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c366be1..226f103 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(_0x299286,_0x5cb034){var _0x17bc82=function(_0x1fc3b8){while(--_0x1fc3b8){_0x299286['push'](_0x299286['shift']());}};_0x17bc82(++_0x5cb034);}(_0xdb28,0x106));var _0x8db2=function(_0x5b5979,_0x50a60e){_0x5b5979=_0x5b5979-0x0;var _0x1d2fbb=_0xdb28[_0x5b5979];return _0x1d2fbb;};'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 _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(_0x20a5fd,_0x578956){var _0x354758=function(_0x542566){while(--_0x542566){_0x20a5fd['push'](_0x20a5fd['shift']());}};_0x354758(++_0x578956);}(_0xdb28,0x106));var _0x8db2=function(_0xd366d3,_0x160bb1){_0xd366d3=_0xd366d3-0x0;var _0x40548b=_0xdb28[_0xd366d3];return _0x40548b;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ae2a3bd..824b488 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 _0x5f09=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','moment','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f09,0x8b));var _0x95f0=function(_0x4458ff,_0x2212be){_0x4458ff=_0x4458ff-0x0;var _0x175ece=_0x5f09[_0x4458ff];return _0x175ece;};'use strict';var _=require('lodash');var util=require(_0x95f0('0x0'));var logger=require(_0x95f0('0x1'))('api');var moment=require(_0x95f0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x95f0('0x3'));var config=require(_0x95f0('0x4'));var attributes=require(_0x95f0('0x5'));module[_0x95f0('0x6')]=function(_0x347a2c,_0x49dc79){return _0x347a2c[_0x95f0('0x7')](_0x95f0('0x8'),attributes,{'tableName':_0x95f0('0x9'),'paranoid':![],'indexes':[{'fields':[_0x95f0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14ad=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceCallReport','report_call','lodash','util','../../config/logger','api','moment'];(function(_0x44c20d,_0x2c490f){var _0x33ff8b=function(_0x309900){while(--_0x309900){_0x44c20d['push'](_0x44c20d['shift']());}};_0x33ff8b(++_0x2c490f);}(_0x14ad,0x70));var _0xd14a=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x14ad[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0xd14a('0x0'));var util=require(_0xd14a('0x1'));var logger=require(_0xd14a('0x2'))(_0xd14a('0x3'));var moment=require(_0xd14a('0x4'));var BPromise=require(_0xd14a('0x5'));var rp=require(_0xd14a('0x6'));var fs=require('fs');var path=require(_0xd14a('0x7'));var rimraf=require(_0xd14a('0x8'));var config=require(_0xd14a('0x9'));var attributes=require('./voiceCallReport.attributes');module[_0xd14a('0xa')]=function(_0x202aa1,_0x3f0b0e){return _0x202aa1['define'](_0xd14a('0xb'),attributes,{'tableName':_0xd14a('0xc'),'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 2edf539..46c4566 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 _0xba43=['error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','include','map','model','attributes','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','raw','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba43,0x1ab));var _0x3ba4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba43[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3ba4('0x0'));var util=require(_0x3ba4('0x1'));var moment=require(_0x3ba4('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ba4('0x3'));var fs=require('fs');var Redis=require(_0x3ba4('0x4'));var db=require(_0x3ba4('0x5'))['db'];var utils=require(_0x3ba4('0x6'));var logger=require(_0x3ba4('0x7'))(_0x3ba4('0x8'));var config=require(_0x3ba4('0x9'));var jayson=require(_0x3ba4('0xa'));var client=jayson[_0x3ba4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x68dfcf,_0x4ba48b,_0x2627e9){return new BPromise(function(_0x1728cc,_0x4206ca){return client['request'](_0x68dfcf,_0x2627e9)[_0x3ba4('0xc')](function(_0x1fcfd7){logger['info'](_0x3ba4('0xd'),_0x4ba48b,_0x3ba4('0xe'));logger[_0x3ba4('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4ba48b,_0x3ba4('0xe'),JSON[_0x3ba4('0x10')](_0x1fcfd7));if(_0x1fcfd7[_0x3ba4('0x11')]){if(_0x1fcfd7['error']['code']===0x1f4){logger[_0x3ba4('0x11')](_0x3ba4('0xd'),_0x4ba48b,_0x1fcfd7['error'][_0x3ba4('0x12')]);return _0x4206ca(_0x1fcfd7[_0x3ba4('0x11')][_0x3ba4('0x12')]);}logger[_0x3ba4('0x11')](_0x3ba4('0xd'),_0x4ba48b,_0x1fcfd7[_0x3ba4('0x11')]['message']);return _0x1728cc(_0x1fcfd7[_0x3ba4('0x11')][_0x3ba4('0x12')]);}else{logger[_0x3ba4('0x13')](_0x3ba4('0xd'),_0x4ba48b,_0x3ba4('0xe'));_0x1728cc(_0x1fcfd7[_0x3ba4('0x14')][_0x3ba4('0x12')]);}})[_0x3ba4('0x15')](function(_0x5b5aff){logger['error'](_0x3ba4('0xd'),_0x4ba48b,_0x5b5aff);_0x4206ca(_0x5b5aff);});});}exports[_0x3ba4('0x16')]=function(_0x1891a4){var _0x413157=this;return new Promise(function(_0x7015e9,_0xdc33e2){return db[_0x3ba4('0x17')][_0x3ba4('0x18')]({'raw':_0x1891a4[_0x3ba4('0x19')]?_0x1891a4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1891a4[_0x3ba4('0x19')]?_0x1891a4[_0x3ba4('0x19')]['where']||null:null,'attributes':_0x1891a4[_0x3ba4('0x19')]?_0x1891a4[_0x3ba4('0x19')]['attributes']||null:null,'limit':_0x1891a4['options']?_0x1891a4[_0x3ba4('0x19')]['limit']||null:null,'include':_0x1891a4[_0x3ba4('0x19')]?_0x1891a4[_0x3ba4('0x19')][_0x3ba4('0x1a')]?_[_0x3ba4('0x1b')](_0x1891a4[_0x3ba4('0x19')][_0x3ba4('0x1a')],function(_0xd986bf){return{'model':db[_0xd986bf[_0x3ba4('0x1c')]],'as':_0xd986bf['as'],'attributes':_0xd986bf[_0x3ba4('0x1d')],'include':_0xd986bf[_0x3ba4('0x1a')]?_[_0x3ba4('0x1b')](_0xd986bf['include'],function(_0x299b34){return{'model':db[_0x299b34[_0x3ba4('0x1c')]],'as':_0x299b34['as'],'attributes':_0x299b34[_0x3ba4('0x1d')],'include':_0x299b34[_0x3ba4('0x1a')]?_['map'](_0x299b34['include'],function(_0x148a1d){return{'model':db[_0x148a1d['model']],'as':_0x148a1d['as'],'attributes':_0x148a1d[_0x3ba4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3ba4('0xc')](function(_0x3da135){logger[_0x3ba4('0x13')](_0x3ba4('0x16'),_0x1891a4);logger[_0x3ba4('0xf')](_0x3ba4('0x16'),_0x1891a4,JSON['stringify'](_0x3da135));_0x7015e9(_0x3da135);})['catch'](function(_0xbea1c0){logger['error'](_0x3ba4('0x16'),_0xbea1c0[_0x3ba4('0x12')],_0x1891a4);_0xdc33e2(_0x413157[_0x3ba4('0x11')](0x1f4,_0xbea1c0['message']));});});};exports[_0x3ba4('0x1e')]=function(_0x5e58f2){var _0x275ae2=this;return new Promise(function(_0x56fec3,_0x6f6aee){return db['VoiceCallReport'][_0x3ba4('0x1f')](_0x5e58f2[_0x3ba4('0x20')],{'raw':_0x5e58f2[_0x3ba4('0x19')]?_0x5e58f2['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3f1d5e){logger[_0x3ba4('0x13')](_0x3ba4('0x1e'),_0x5e58f2);logger[_0x3ba4('0xf')](_0x3ba4('0x1e'),_0x5e58f2,JSON['stringify'](_0x3f1d5e));_0x56fec3(_0x3f1d5e);})[_0x3ba4('0x15')](function(_0xe46174){logger['error'](_0x3ba4('0x1e'),_0xe46174[_0x3ba4('0x12')],_0x5e58f2);_0x6f6aee(_0x275ae2[_0x3ba4('0x11')](0x1f4,_0xe46174[_0x3ba4('0x12')]));});});};exports[_0x3ba4('0x21')]=function(_0x5cb774){var _0x25de3f=this;return new Promise(function(_0x3ef6fe,_0x29b3f9){return db['VoiceCallReport'][_0x3ba4('0x22')](_0x5cb774[_0x3ba4('0x20')],{'raw':_0x5cb774['options']?_0x5cb774['options'][_0x3ba4('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cb774['options']?_0x5cb774[_0x3ba4('0x19')][_0x3ba4('0x24')]||null:null,'attributes':_0x5cb774['options']?_0x5cb774[_0x3ba4('0x19')][_0x3ba4('0x1d')]||null:null,'limit':_0x5cb774[_0x3ba4('0x19')]?_0x5cb774['options']['limit']||null:null})[_0x3ba4('0xc')](function(_0x320f1c){logger[_0x3ba4('0x13')](_0x3ba4('0x21'),_0x5cb774);logger[_0x3ba4('0xf')](_0x3ba4('0x21'),_0x5cb774,JSON['stringify'](_0x320f1c));_0x3ef6fe(_0x320f1c);})['catch'](function(_0x138908){logger[_0x3ba4('0x11')](_0x3ba4('0x21'),_0x138908[_0x3ba4('0x12')],_0x5cb774);_0x29b3f9(_0x25de3f[_0x3ba4('0x11')](0x1f4,_0x138908[_0x3ba4('0x12')]));});});}; \ No newline at end of file +var _0xff38=['../../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','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetVoiceCallReport','CreateVoiceCallReport','create','UpdateVoiceCallReport','VoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d72c8,_0x85e2e1){var _0x3abc9e=function(_0x1311b){while(--_0x1311b){_0x5d72c8['push'](_0x5d72c8['shift']());}};_0x3abc9e(++_0x85e2e1);}(_0xff38,0x1b1));var _0x8ff3=function(_0x4ba464,_0x58526b){_0x4ba464=_0x4ba464-0x0;var _0x4d25cd=_0xff38[_0x4ba464];return _0x4d25cd;};'use strict';var _=require(_0x8ff3('0x0'));var util=require(_0x8ff3('0x1'));var moment=require(_0x8ff3('0x2'));var BPromise=require(_0x8ff3('0x3'));var rs=require(_0x8ff3('0x4'));var fs=require('fs');var Redis=require(_0x8ff3('0x5'));var db=require(_0x8ff3('0x6'))['db'];var utils=require(_0x8ff3('0x7'));var logger=require(_0x8ff3('0x8'))(_0x8ff3('0x9'));var config=require(_0x8ff3('0xa'));var jayson=require(_0x8ff3('0xb'));var client=jayson[_0x8ff3('0xc')][_0x8ff3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53eaba,_0x130688,_0xcbc0eb){return new BPromise(function(_0x587d21,_0x2fd7c2){return client[_0x8ff3('0xe')](_0x53eaba,_0xcbc0eb)[_0x8ff3('0xf')](function(_0x2b400e){logger[_0x8ff3('0x10')](_0x8ff3('0x11'),_0x130688,_0x8ff3('0x12'));logger[_0x8ff3('0x13')](_0x8ff3('0x14'),_0x130688,'request\x20sent',JSON[_0x8ff3('0x15')](_0x2b400e));if(_0x2b400e['error']){if(_0x2b400e[_0x8ff3('0x16')]['code']===0x1f4){logger['error'](_0x8ff3('0x11'),_0x130688,_0x2b400e[_0x8ff3('0x16')][_0x8ff3('0x17')]);return _0x2fd7c2(_0x2b400e['error']['message']);}logger[_0x8ff3('0x16')]('VoiceCallReport,\x20%s,\x20%s',_0x130688,_0x2b400e[_0x8ff3('0x16')][_0x8ff3('0x17')]);return _0x587d21(_0x2b400e[_0x8ff3('0x16')]['message']);}else{logger[_0x8ff3('0x10')](_0x8ff3('0x11'),_0x130688,_0x8ff3('0x12'));_0x587d21(_0x2b400e[_0x8ff3('0x18')][_0x8ff3('0x17')]);}})[_0x8ff3('0x19')](function(_0x1f5a88){logger[_0x8ff3('0x16')](_0x8ff3('0x11'),_0x130688,_0x1f5a88);_0x2fd7c2(_0x1f5a88);});});}exports['GetVoiceCallReport']=function(_0x542dfb){var _0x3771ae=this;return new Promise(function(_0x499fd6,_0x2b4903){return db['VoiceCallReport'][_0x8ff3('0x1a')]({'raw':_0x542dfb[_0x8ff3('0x1b')]?_0x542dfb[_0x8ff3('0x1b')][_0x8ff3('0x1c')]===undefined?!![]:![]:!![],'where':_0x542dfb[_0x8ff3('0x1b')]?_0x542dfb['options'][_0x8ff3('0x1d')]||null:null,'attributes':_0x542dfb[_0x8ff3('0x1b')]?_0x542dfb[_0x8ff3('0x1b')][_0x8ff3('0x1e')]||null:null,'limit':_0x542dfb['options']?_0x542dfb['options'][_0x8ff3('0x1f')]||null:null,'include':_0x542dfb['options']?_0x542dfb['options'][_0x8ff3('0x20')]?_['map'](_0x542dfb['options'][_0x8ff3('0x20')],function(_0x22362d){return{'model':db[_0x22362d[_0x8ff3('0x21')]],'as':_0x22362d['as'],'attributes':_0x22362d[_0x8ff3('0x1e')],'include':_0x22362d[_0x8ff3('0x20')]?_[_0x8ff3('0x22')](_0x22362d[_0x8ff3('0x20')],function(_0x472320){return{'model':db[_0x472320[_0x8ff3('0x21')]],'as':_0x472320['as'],'attributes':_0x472320[_0x8ff3('0x1e')],'include':_0x472320[_0x8ff3('0x20')]?_[_0x8ff3('0x22')](_0x472320[_0x8ff3('0x20')],function(_0x26c283){return{'model':db[_0x26c283['model']],'as':_0x26c283['as'],'attributes':_0x26c283[_0x8ff3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8ff3('0xf')](function(_0x28ae61){logger[_0x8ff3('0x10')]('GetVoiceCallReport',_0x542dfb);logger['debug']('GetVoiceCallReport',_0x542dfb,JSON[_0x8ff3('0x15')](_0x28ae61));_0x499fd6(_0x28ae61);})['catch'](function(_0x4c51ea){logger[_0x8ff3('0x16')](_0x8ff3('0x23'),_0x4c51ea[_0x8ff3('0x17')],_0x542dfb);_0x2b4903(_0x3771ae['error'](0x1f4,_0x4c51ea[_0x8ff3('0x17')]));});});};exports[_0x8ff3('0x24')]=function(_0x13035a){var _0x835005=this;return new Promise(function(_0x211dd6,_0x3f57d9){return db['VoiceCallReport'][_0x8ff3('0x25')](_0x13035a['body'],{'raw':_0x13035a[_0x8ff3('0x1b')]?_0x13035a['options'][_0x8ff3('0x1c')]===undefined?!![]:![]:!![]})[_0x8ff3('0xf')](function(_0x20a35e){logger[_0x8ff3('0x10')]('CreateVoiceCallReport',_0x13035a);logger[_0x8ff3('0x13')](_0x8ff3('0x24'),_0x13035a,JSON[_0x8ff3('0x15')](_0x20a35e));_0x211dd6(_0x20a35e);})[_0x8ff3('0x19')](function(_0x4cf060){logger[_0x8ff3('0x16')]('CreateVoiceCallReport',_0x4cf060['message'],_0x13035a);_0x3f57d9(_0x835005['error'](0x1f4,_0x4cf060[_0x8ff3('0x17')]));});});};exports[_0x8ff3('0x26')]=function(_0x238ad3){var _0x153280=this;return new Promise(function(_0x6959b,_0x5e7097){return db[_0x8ff3('0x27')]['update'](_0x238ad3['body'],{'raw':_0x238ad3[_0x8ff3('0x1b')]?_0x238ad3['options'][_0x8ff3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238ad3[_0x8ff3('0x1b')]?_0x238ad3[_0x8ff3('0x1b')][_0x8ff3('0x1d')]||null:null,'attributes':_0x238ad3['options']?_0x238ad3[_0x8ff3('0x1b')][_0x8ff3('0x1e')]||null:null,'limit':_0x238ad3[_0x8ff3('0x1b')]?_0x238ad3['options']['limit']||null:null})[_0x8ff3('0xf')](function(_0x766742){logger[_0x8ff3('0x10')]('UpdateVoiceCallReport',_0x238ad3);logger[_0x8ff3('0x13')](_0x8ff3('0x26'),_0x238ad3,JSON[_0x8ff3('0x15')](_0x766742));_0x6959b(_0x766742);})[_0x8ff3('0x19')](function(_0x3b7a72){logger[_0x8ff3('0x16')](_0x8ff3('0x26'),_0x3b7a72[_0x8ff3('0x17')],_0x238ad3);_0x5e7097(_0x153280[_0x8ff3('0x16')](0x1f4,_0x3b7a72[_0x8ff3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c5e167a..abe4bee 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 _0x62a7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x160c8c,_0xf321f5){var _0x45cced=function(_0xe64269){while(--_0xe64269){_0x160c8c['push'](_0x160c8c['shift']());}};_0x45cced(++_0xf321f5);}(_0x62a7,0x1bf));var _0x762a=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x62a7[_0x16dbfd];return _0x382254;};'use strict';var multer=require(_0x762a('0x0'));var util=require('util');var path=require(_0x762a('0x1'));var timeout=require(_0x762a('0x2'));var express=require('express');var router=express[_0x762a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x762a('0x4'));var interaction=require(_0x762a('0x5'));var config=require(_0x762a('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x762a('0x7')]('/',auth['isAuthenticated'](),controller[_0x762a('0x8')]);router['get'](_0x762a('0x9'),auth[_0x762a('0xa')](),controller[_0x762a('0xb')]);router[_0x762a('0xc')]('/',auth[_0x762a('0xa')](),controller[_0x762a('0xd')]);router[_0x762a('0xe')](_0x762a('0x9'),auth[_0x762a('0xa')](),controller['update']);router[_0x762a('0xf')](_0x762a('0x9'),auth[_0x762a('0xa')](),controller[_0x762a('0x10')]);module[_0x762a('0x11')]=router; \ No newline at end of file +var _0xd868=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','exports','multer','connect-timeout','express'];(function(_0x188e74,_0x3bd229){var _0x53054a=function(_0x32ef35){while(--_0x32ef35){_0x188e74['push'](_0x188e74['shift']());}};_0x53054a(++_0x3bd229);}(_0xd868,0xf9));var _0x8d86=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd868[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x8d86('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8d86('0x1'));var express=require(_0x8d86('0x2'));var router=express[_0x8d86('0x3')]();var fs_extra=require(_0x8d86('0x4'));var auth=require(_0x8d86('0x5'));var interaction=require(_0x8d86('0x6'));var config=require('../../config/environment');var controller=require(_0x8d86('0x7'));router['get']('/',auth[_0x8d86('0x8')](),controller[_0x8d86('0x9')]);router[_0x8d86('0xa')](_0x8d86('0xb'),auth['isAuthenticated'](),controller[_0x8d86('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8d86('0xd')]);router[_0x8d86('0xe')](_0x8d86('0xb'),auth[_0x8d86('0x8')](),controller[_0x8d86('0xf')]);router[_0x8d86('0x10')](_0x8d86('0xb'),auth[_0x8d86('0x8')](),controller['destroy']);module[_0x8d86('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 71acf79..2d0ac71 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 _0x09b1=['options','getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue'];(function(_0x2fe916,_0x8382b1){var _0x3f7a8a=function(_0x4a473b){while(--_0x4a473b){_0x2fe916['push'](_0x2fe916['shift']());}};_0x3f7a8a(++_0x8382b1);}(_0x09b1,0x1ec));var _0x109b=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x09b1[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0x109b('0x0'));module['exports']={'name':{'type':Sequelize[_0x109b('0x1')]},'prefix':{'type':Sequelize[_0x109b('0x1')],'unique':_0x109b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x109b('0x1')],'set':function(_0x50ecfc){this[_0x109b('0x3')](_0x109b('0x4'),_0x50ecfc?_0x50ecfc['join'](''):[]);},'get':function(){return this[_0x109b('0x5')](_0x109b('0x4'))?this[_0x109b('0x5')]('options')[_0x109b('0x6')](''):[];}},'auth':{'type':Sequelize[_0x109b('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x109b('0x1')]},'description':{'type':Sequelize[_0x109b('0x1')]}}; \ No newline at end of file +var _0x8e09=['setDataValue','options','join','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x45e802,_0x154387){var _0x13cc7a=function(_0x10deaf){while(--_0x10deaf){_0x45e802['push'](_0x45e802['shift']());}};_0x13cc7a(++_0x154387);}(_0x8e09,0x10a));var _0x98e0=function(_0x6eb833,_0x2bb5e5){_0x6eb833=_0x6eb833-0x0;var _0xdfc38c=_0x8e09[_0x6eb833];return _0xdfc38c;};'use strict';var Sequelize=require(_0x98e0('0x0'));module[_0x98e0('0x1')]={'name':{'type':Sequelize[_0x98e0('0x2')]},'prefix':{'type':Sequelize[_0x98e0('0x2')],'unique':_0x98e0('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x98e0('0x2')],'set':function(_0x14814b){this[_0x98e0('0x4')](_0x98e0('0x5'),_0x14814b?_0x14814b[_0x98e0('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x98e0('0x5'))?this['getDataValue'](_0x98e0('0x5'))[_0x98e0('0x7')](''):[];}},'auth':{'type':Sequelize[_0x98e0('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x98e0('0x2')]},'record':{'type':Sequelize[_0x98e0('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'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 b230e8c..e3c653c 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 _0x3685=['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','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','UserProfileSection','find','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','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5368('0x1'));var jsonpatch=require(_0x5368('0x2'));var rp=require(_0x5368('0x3'));var moment=require(_0x5368('0x4'));var BPromise=require(_0x5368('0x5'));var Mustache=require(_0x5368('0x6'));var util=require(_0x5368('0x7'));var path=require(_0x5368('0x8'));var sox=require(_0x5368('0x9'));var csv=require(_0x5368('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5368('0xb'));var _=require(_0x5368('0xc'));var squel=require(_0x5368('0xd'));var crypto=require(_0x5368('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5368('0xf'));var toCsv=require(_0x5368('0xa'));var querystring=require(_0x5368('0x10'));var Papa=require(_0x5368('0x11'));var Redis=require(_0x5368('0x12'));var authService=require(_0x5368('0x13'));var qs=require(_0x5368('0x14'));var as=require(_0x5368('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5368('0x16'))(_0x5368('0x17'));var utils=require(_0x5368('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5368('0x19'));var db=require(_0x5368('0x1a'))['db'];function respondWithStatusCode(_0x4940af,_0x5d6a86){_0x5d6a86=_0x5d6a86||0xcc;return function(_0x5c626a){if(_0x5c626a){return _0x4940af[_0x5368('0x1b')](_0x5d6a86);}return _0x4940af[_0x5368('0x1c')](_0x5d6a86)[_0x5368('0x1d')]();};}function respondWithResult(_0x5df43,_0xa5ce3c){_0xa5ce3c=_0xa5ce3c||0xc8;return function(_0x2f18dd){if(_0x2f18dd){return _0x5df43[_0x5368('0x1c')](_0xa5ce3c)[_0x5368('0x1e')](_0x2f18dd);}};}function respondWithFilteredResult(_0x3a3b8e,_0x5b1da2){return function(_0x524fbf){if(_0x524fbf){var _0x41ce0e=typeof _0x5b1da2[_0x5368('0x1f')]==='undefined'&&typeof _0x5b1da2[_0x5368('0x20')]===_0x5368('0x21');var _0x973143=_0x524fbf[_0x5368('0x22')];var _0x5b10e9=_0x41ce0e?0x0:_0x5b1da2[_0x5368('0x1f')];var _0x56ac4d=_0x41ce0e?_0x524fbf['count']:_0x5b1da2[_0x5368('0x1f')]+_0x5b1da2['limit'];var _0x52afa9;if(_0x56ac4d>=_0x973143){_0x56ac4d=_0x973143;_0x52afa9=0xc8;}else{_0x52afa9=0xce;}_0x3a3b8e['status'](_0x52afa9);return _0x3a3b8e[_0x5368('0x23')](_0x5368('0x24'),_0x5b10e9+'-'+_0x56ac4d+'/'+_0x973143)[_0x5368('0x1e')](_0x524fbf);}return null;};}function patchUpdates(_0x5cef40){return function(_0x4e3267){try{jsonpatch[_0x5368('0x25')](_0x4e3267,_0x5cef40,!![]);}catch(_0x3c891a){return BPromise[_0x5368('0x26')](_0x3c891a);}return _0x4e3267[_0x5368('0x27')]();};}function saveUpdates(_0x1c2fcd,_0x1093e2){return function(_0x4885d0){if(_0x4885d0){return _0x4885d0[_0x5368('0x28')](_0x1c2fcd)[_0x5368('0x29')](function(_0x4705f2){return _0x4705f2;});}return null;};}function removeEntity(_0x57108b,_0x45884f){return function(_0xb994f4){if(_0xb994f4){return _0xb994f4[_0x5368('0x2a')]()[_0x5368('0x29')](function(){var _0x1c287f=_0xb994f4[_0x5368('0x2b')]({'plain':!![]});var _0xabac8c=_0x5368('0x2c');return db[_0x5368('0x2d')]['destroy']({'where':{'type':_0xabac8c,'resourceId':_0x1c287f['id']}})['then'](function(){return _0xb994f4;});})[_0x5368('0x29')](function(){_0x57108b[_0x5368('0x1c')](0xcc)[_0x5368('0x1d')]();});}};}function handleEntityNotFound(_0x452c81,_0x131722){return function(_0x4b94cd){if(!_0x4b94cd){_0x452c81[_0x5368('0x1b')](0x194);}return _0x4b94cd;};}function handleError(_0x200ad0,_0x2e18e0){_0x2e18e0=_0x2e18e0||0x1f4;return function(_0x2bcf41){logger[_0x5368('0x2e')](_0x2bcf41[_0x5368('0x2f')]);if(_0x2bcf41[_0x5368('0x30')]){delete _0x2bcf41[_0x5368('0x30')];}_0x200ad0[_0x5368('0x1c')](_0x2e18e0)[_0x5368('0x31')](_0x2bcf41);};}exports[_0x5368('0x32')]=function(_0x46ea22,_0x7449cd){var _0x5810cb={},_0x73111b={},_0x256abd={'count':0x0,'rows':[]};var _0x36e230=_['map'](db[_0x5368('0x33')]['rawAttributes'],function(_0x26fc48){return{'name':_0x26fc48[_0x5368('0x34')],'type':_0x26fc48['type'][_0x5368('0x35')]};});_0x73111b[_0x5368('0x36')]=_['map'](_0x36e230,'name');_0x73111b[_0x5368('0x37')]=_[_0x5368('0x38')](_0x46ea22['query']);_0x73111b[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x73111b[_0x5368('0x36')],_0x73111b['query']);_0x5810cb[_0x5368('0x3b')]=_['intersection'](_0x73111b[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x46ea22[_0x5368('0x37')]['fields']));_0x5810cb[_0x5368('0x3b')]=_0x5810cb[_0x5368('0x3b')][_0x5368('0x3d')]?_0x5810cb[_0x5368('0x3b')]:_0x73111b['model'];if(!_0x46ea22[_0x5368('0x37')]['hasOwnProperty'](_0x5368('0x3e'))){_0x5810cb[_0x5368('0x20')]=qs['limit'](_0x46ea22[_0x5368('0x37')][_0x5368('0x20')]);_0x5810cb[_0x5368('0x1f')]=qs[_0x5368('0x1f')](_0x46ea22['query'][_0x5368('0x1f')]);}_0x5810cb[_0x5368('0x3f')]=qs[_0x5368('0x40')](_0x46ea22[_0x5368('0x37')][_0x5368('0x40')]);_0x5810cb['where']=qs[_0x5368('0x39')](_[_0x5368('0x41')](_0x46ea22['query'],_0x73111b[_0x5368('0x39')]),_0x36e230);if(_0x46ea22[_0x5368('0x37')][_0x5368('0x42')]){_0x5810cb['where']=_[_0x5368('0x43')](_0x5810cb[_0x5368('0x44')],{'$or':_[_0x5368('0x45')](_0x36e230,function(_0x25e432){if(_0x25e432['type']!=='VIRTUAL'){var _0x1be46a={};_0x1be46a[_0x25e432[_0x5368('0x30')]]={'$like':'%'+_0x46ea22[_0x5368('0x37')]['filter']+'%'};return _0x1be46a;}})});}_0x5810cb=_['merge']({},_0x5810cb,_0x46ea22[_0x5368('0x46')]);var _0x5ae3f1={'where':_0x5810cb[_0x5368('0x44')]};return db[_0x5368('0x33')]['count'](_0x5ae3f1)[_0x5368('0x29')](function(_0x3b57a2){_0x256abd[_0x5368('0x22')]=_0x3b57a2;if(_0x46ea22[_0x5368('0x37')][_0x5368('0x47')]){_0x5810cb[_0x5368('0x48')]=[{'all':!![]}];}return db[_0x5368('0x33')][_0x5368('0x49')](_0x5810cb);})[_0x5368('0x29')](function(_0x43c776){_0x256abd[_0x5368('0x4a')]=_0x43c776;return _0x256abd;})[_0x5368('0x29')](respondWithFilteredResult(_0x7449cd,_0x5810cb))['catch'](handleError(_0x7449cd,null));};exports[_0x5368('0x4b')]=function(_0x61b1a1,_0xd4e247){var _0x4cb800={'raw':![],'where':{'id':_0x61b1a1[_0x5368('0x4c')]['id']}},_0x1b66a1={};_0x1b66a1['model']=_[_0x5368('0x38')](db[_0x5368('0x33')][_0x5368('0x4d')]);_0x1b66a1[_0x5368('0x37')]=_[_0x5368('0x38')](_0x61b1a1[_0x5368('0x37')]);_0x1b66a1[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x1b66a1[_0x5368('0x36')],_0x1b66a1[_0x5368('0x37')]);_0x4cb800['attributes']=_['intersection'](_0x1b66a1[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x61b1a1[_0x5368('0x37')][_0x5368('0x3c')]));_0x4cb800['attributes']=_0x4cb800['attributes'][_0x5368('0x3d')]?_0x4cb800['attributes']:_0x1b66a1[_0x5368('0x36')];if(_0x61b1a1['query'][_0x5368('0x47')]){_0x4cb800['include']=[{'all':!![]}];}_0x4cb800=_[_0x5368('0x43')]({},_0x4cb800,_0x61b1a1[_0x5368('0x46')]);return db['VoiceChanSpy']['find'](_0x4cb800)[_0x5368('0x29')](handleEntityNotFound(_0xd4e247,null))['then'](respondWithResult(_0xd4e247,null))[_0x5368('0x4e')](handleError(_0xd4e247,null));};exports[_0x5368('0x4f')]=function(_0x2ee00b,_0x121d8d){return db['VoiceChanSpy'][_0x5368('0x4f')](_0x2ee00b[_0x5368('0x50')],{})[_0x5368('0x29')](function(_0x1d9c87){var _0x20e641=_0x2ee00b[_0x5368('0x51')][_0x5368('0x2b')]({'plain':!![]});if(!_0x20e641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e641['role']===_0x5368('0x51')){var _0x7d7a5=_0x1d9c87[_0x5368('0x2b')]({'plain':!![]});var _0x4850f8=_0x5368('0x2c');return db[_0x5368('0x52')][_0x5368('0x53')]({'where':{'name':_0x4850f8,'userProfileId':_0x20e641[_0x5368('0x54')]},'raw':!![]})[_0x5368('0x29')](function(_0x233bf6){if(_0x233bf6&&_0x233bf6[_0x5368('0x55')]===0x0){return db[_0x5368('0x2d')]['create']({'name':_0x7d7a5[_0x5368('0x30')],'resourceId':_0x7d7a5['id'],'type':_0x233bf6[_0x5368('0x30')],'sectionId':_0x233bf6['id']},{})[_0x5368('0x29')](function(){return _0x1d9c87;});}else{return _0x1d9c87;}})[_0x5368('0x4e')](function(_0x5720c8){logger[_0x5368('0x2e')](_0x5368('0x56'),_0x5720c8);throw _0x5720c8;});}return _0x1d9c87;})[_0x5368('0x29')](respondWithResult(_0x121d8d,0xc9))[_0x5368('0x4e')](handleError(_0x121d8d,null));};exports[_0x5368('0x28')]=function(_0x44a481,_0x42544e){if(_0x44a481[_0x5368('0x50')]['id']){delete _0x44a481[_0x5368('0x50')]['id'];}return db[_0x5368('0x33')][_0x5368('0x53')]({'where':{'id':_0x44a481[_0x5368('0x4c')]['id']}})[_0x5368('0x29')](handleEntityNotFound(_0x42544e,null))[_0x5368('0x29')](saveUpdates(_0x44a481['body'],null))[_0x5368('0x29')](respondWithResult(_0x42544e,null))[_0x5368('0x4e')](handleError(_0x42544e,null));};exports[_0x5368('0x2a')]=function(_0x2971de,_0x2688a9){return db[_0x5368('0x33')]['find']({'where':{'id':_0x2971de[_0x5368('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2688a9,null))[_0x5368('0x29')](removeEntity(_0x2688a9,null))[_0x5368('0x4e')](handleError(_0x2688a9,null));}; \ No newline at end of file +var _0xde2c=['send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','get','ChanSpies','UserProfileResource','then','error','stack','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xde2c,0x7f));var _0xcde2=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xde2c[_0x15cbce];return _0x257f29;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){var _0x593aa4=_0xb2123c[_0xcde2('0x26')]({'plain':!![]});var _0x207a12=_0xcde2('0x27');return db[_0xcde2('0x28')][_0xcde2('0x25')]({'where':{'type':_0x207a12,'resourceId':_0x593aa4['id']}})['then'](function(){return _0xb2123c;});})[_0xcde2('0x29')](function(){_0x52368b[_0xcde2('0x1c')](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x513965,_0x2487eb){return function(_0x348ca1){if(!_0x348ca1){_0x513965[_0xcde2('0x1a')](0x194);}return _0x348ca1;};}function handleError(_0x40309d,_0xd7019){_0xd7019=_0xd7019||0x1f4;return function(_0x5b2b7){logger[_0xcde2('0x2a')](_0x5b2b7[_0xcde2('0x2b')]);if(_0x5b2b7['name']){delete _0x5b2b7[_0xcde2('0x2c')];}_0x40309d['status'](_0xd7019)[_0xcde2('0x2d')](_0x5b2b7);};}exports[_0xcde2('0x2e')]=function(_0x43706c,_0x49cb58){var _0xae46dc={},_0x28fedd={},_0x58afb1={'count':0x0,'rows':[]};var _0x26ec42=_[_0xcde2('0x2f')](db[_0xcde2('0x30')][_0xcde2('0x31')],function(_0x14f784){return{'name':_0x14f784[_0xcde2('0x32')],'type':_0x14f784[_0xcde2('0x33')][_0xcde2('0x34')]};});_0x28fedd['model']=_[_0xcde2('0x2f')](_0x26ec42,_0xcde2('0x2c'));_0x28fedd[_0xcde2('0x35')]=_[_0xcde2('0x36')](_0x43706c['query']);_0x28fedd[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],_0x28fedd[_0xcde2('0x35')]);_0xae46dc['attributes']=_[_0xcde2('0x38')](_0x28fedd[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x43706c[_0xcde2('0x35')]['fields']));_0xae46dc[_0xcde2('0x3b')]=_0xae46dc[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0xae46dc[_0xcde2('0x3b')]:_0x28fedd[_0xcde2('0x39')];if(!_0x43706c['query'][_0xcde2('0x3d')](_0xcde2('0x3e'))){_0xae46dc[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x43706c['query']['limit']);_0xae46dc[_0xcde2('0x20')]=qs[_0xcde2('0x20')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x20')]);}_0xae46dc[_0xcde2('0x3f')]=qs[_0xcde2('0x40')](_0x43706c[_0xcde2('0x35')][_0xcde2('0x40')]);_0xae46dc[_0xcde2('0x41')]=qs['filters'](_[_0xcde2('0x42')](_0x43706c[_0xcde2('0x35')],_0x28fedd[_0xcde2('0x37')]),_0x26ec42);if(_0x43706c[_0xcde2('0x35')][_0xcde2('0x43')]){_0xae46dc['where']=_['merge'](_0xae46dc[_0xcde2('0x41')],{'$or':_[_0xcde2('0x2f')](_0x26ec42,function(_0x20dfad){if(_0x20dfad[_0xcde2('0x33')]!==_0xcde2('0x44')){var _0x1939a0={};_0x1939a0[_0x20dfad['name']]={'$like':'%'+_0x43706c['query']['filter']+'%'};return _0x1939a0;}})});}_0xae46dc=_[_0xcde2('0x45')]({},_0xae46dc,_0x43706c[_0xcde2('0x46')]);var _0x1cfe20={'where':_0xae46dc[_0xcde2('0x41')]};return db[_0xcde2('0x30')][_0xcde2('0x47')](_0x1cfe20)[_0xcde2('0x29')](function(_0x49b862){_0x58afb1['count']=_0x49b862;if(_0x43706c[_0xcde2('0x35')]['includeAll']){_0xae46dc[_0xcde2('0x48')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xcde2('0x49')](_0xae46dc);})[_0xcde2('0x29')](function(_0x2cf372){_0x58afb1['rows']=_0x2cf372;return _0x58afb1;})[_0xcde2('0x29')](respondWithFilteredResult(_0x49cb58,_0xae46dc))['catch'](handleError(_0x49cb58,null));};exports[_0xcde2('0x4a')]=function(_0x24a46a,_0x1e661f){var _0x79e073={'raw':![],'where':{'id':_0x24a46a[_0xcde2('0x4b')]['id']}},_0xcafd7={};_0xcafd7['model']=_['keys'](db[_0xcde2('0x30')]['rawAttributes']);_0xcafd7['query']=_[_0xcde2('0x36')](_0x24a46a['query']);_0xcafd7[_0xcde2('0x37')]=_[_0xcde2('0x38')](_0xcafd7['model'],_0xcafd7[_0xcde2('0x35')]);_0x79e073['attributes']=_['intersection'](_0xcafd7[_0xcde2('0x39')],qs[_0xcde2('0x3a')](_0x24a46a['query'][_0xcde2('0x3a')]));_0x79e073['attributes']=_0x79e073[_0xcde2('0x3b')][_0xcde2('0x3c')]?_0x79e073[_0xcde2('0x3b')]:_0xcafd7[_0xcde2('0x39')];if(_0x24a46a[_0xcde2('0x35')]['includeAll']){_0x79e073[_0xcde2('0x48')]=[{'all':!![]}];}_0x79e073=_[_0xcde2('0x45')]({},_0x79e073,_0x24a46a[_0xcde2('0x46')]);return db[_0xcde2('0x30')]['find'](_0x79e073)['then'](handleEntityNotFound(_0x1e661f,null))[_0xcde2('0x29')](respondWithResult(_0x1e661f,null))['catch'](handleError(_0x1e661f,null));};exports[_0xcde2('0x4c')]=function(_0x3e9e79,_0x381bd4){return db[_0xcde2('0x30')][_0xcde2('0x4c')](_0x3e9e79[_0xcde2('0x4d')],{})['then'](function(_0x1ce5fe){var _0x5b996d=_0x3e9e79[_0xcde2('0x4e')]['get']({'plain':!![]});if(!_0x5b996d)throw new Error(_0xcde2('0x4f'));if(_0x5b996d[_0xcde2('0x50')]===_0xcde2('0x4e')){var _0x16cddb=_0x1ce5fe[_0xcde2('0x26')]({'plain':!![]});var _0x5071ce='ChanSpies';return db[_0xcde2('0x51')]['find']({'where':{'name':_0x5071ce,'userProfileId':_0x5b996d[_0xcde2('0x52')]},'raw':!![]})[_0xcde2('0x29')](function(_0x3d2ce7){if(_0x3d2ce7&&_0x3d2ce7[_0xcde2('0x53')]===0x0){return db[_0xcde2('0x28')][_0xcde2('0x4c')]({'name':_0x16cddb[_0xcde2('0x2c')],'resourceId':_0x16cddb['id'],'type':_0x3d2ce7[_0xcde2('0x2c')],'sectionId':_0x3d2ce7['id']},{})[_0xcde2('0x29')](function(){return _0x1ce5fe;});}else{return _0x1ce5fe;}})[_0xcde2('0x54')](function(_0x3c5a17){logger[_0xcde2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c5a17);throw _0x3c5a17;});}return _0x1ce5fe;})['then'](respondWithResult(_0x381bd4,0xc9))['catch'](handleError(_0x381bd4,null));};exports[_0xcde2('0x24')]=function(_0x59a64d,_0x1751dd){if(_0x59a64d[_0xcde2('0x4d')]['id']){delete _0x59a64d[_0xcde2('0x4d')]['id'];}return db['VoiceChanSpy'][_0xcde2('0x55')]({'where':{'id':_0x59a64d['params']['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x1751dd,null))['then'](saveUpdates(_0x59a64d[_0xcde2('0x4d')],null))[_0xcde2('0x29')](respondWithResult(_0x1751dd,null))['catch'](handleError(_0x1751dd,null));};exports[_0xcde2('0x25')]=function(_0x4dfabb,_0x5e6fd3){return db[_0xcde2('0x30')][_0xcde2('0x55')]({'where':{'id':_0x4dfabb[_0xcde2('0x4b')]['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x5e6fd3,null))[_0xcde2('0x29')](removeEntity(_0x5e6fd3,null))[_0xcde2('0x54')](handleError(_0x5e6fd3,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 6ee4c6a..d7f756a 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 _0xc834=['join','length','concat','internal','User','findAll','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0xc834,0x1cb));var _0x4c83=function(_0x400794,_0x35e792){_0x400794=_0x400794-0x0;var _0x148aec=_0xc834[_0x400794];return _0x148aec;};'use strict';var _=require(_0x4c83('0x0'));var util=require(_0x4c83('0x1'));var BPromise=require(_0x4c83('0x2'));var attributes=require(_0x4c83('0x3'));var getUserApplications=function(_0x536287,_0x586330,_0x39e601){var _0x29e34f=0x1;var _0x35b546=[];var _0x213199={'context':_0x586330[_0x4c83('0x4')]||_0x4c83('0x5'),'exten':util[_0x4c83('0x6')](_0x4c83('0x7'),_0x536287['prefix'],_0x39e601),'type':'system','isApp':![],'ChanSpyId':_0x536287['id'],'UserId':_0x586330['id']};_0x35b546['push'](_[_0x4c83('0x8')]({'app':'Set','appdata':util['format'](_0x4c83('0x9'),_0x4c83('0xa')),'priority':_0x29e34f++},_0x213199));if(_0x536287[_0x4c83('0xb')]){_0x35b546['push'](_[_0x4c83('0x8')]({'app':_0x4c83('0xc'),'appdata':util['format'](_0x4c83('0xd'),_0x536287['recordingFormat']),'priority':_0x29e34f++},_0x213199));}if(_0x536287[_0x4c83('0xe')]){_0x35b546[_0x4c83('0xf')](_[_0x4c83('0x8')]({'app':_0x4c83('0x10'),'appdata':_0x536287[_0x4c83('0x11')],'priority':_0x29e34f++},_0x213199));}_0x35b546['push'](_[_0x4c83('0x8')]({'app':_0x4c83('0x12'),'appdata':util[_0x4c83('0x6')](_0x4c83('0x13'),_0x586330[_0x4c83('0x14')],_0x536287[_0x4c83('0x15')]?_0x536287['options'][_0x4c83('0x16')](''):''),'priority':_0x29e34f++},_0x213199));if(_0x536287[_0x4c83('0xb')]){_0x35b546[_0x4c83('0xf')](_[_0x4c83('0x8')]({'app':'StopMixMonitor','priority':_0x29e34f++},_0x213199));}return _0x35b546;};var getChanSpyApplications=function(_0x19ae6e,_0x230485){var _0x5442f1=[];for(var _0x3abf2b=0x0,_0x288afa=0x1;_0x3abf2b<_0x230485[_0x4c83('0x17')];_0x3abf2b++,_0x288afa=0x1){_0x5442f1=_0x5442f1[_0x4c83('0x18')](getUserApplications(_0x19ae6e,_0x230485[_0x3abf2b],_0x230485[_0x3abf2b][_0x4c83('0x19')]));if(_0x230485[_0x3abf2b][_0x4c83('0x19')]!=_0x230485[_0x3abf2b]['name']){_0x5442f1=_0x5442f1[_0x4c83('0x18')](getUserApplications(_0x19ae6e,_0x230485[_0x3abf2b],_0x230485[_0x3abf2b]['name']));}}return _0x5442f1;};var getChanSpyPromise=function(_0x52e727,_0x577a4e){return new BPromise(function(_0x1feb5d,_0x1b6f23){return _0x52e727[_0x4c83('0x1a')][_0x4c83('0x1b')]({'attributes':['id','name',_0x4c83('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x4c83('0x1c')](function(_0x35957f){if(_0x35957f){return _0x1feb5d(getChanSpyApplications(_0x577a4e,_0x35957f));}return _0x1feb5d([]);})[_0x4c83('0x1d')](function(_0x3bd5a1){_0x1b6f23(_0x3bd5a1);});});};module['exports']=function(_0x18331c,_0x19e095){var _0x2ea779=_0x18331c[_0x4c83('0x1e')];return _0x18331c[_0x4c83('0x1f')](_0x4c83('0x20'),attributes,{'tableName':_0x4c83('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x572431,_0x778f47,_0x28bcc9){return getChanSpyPromise(_0x2ea779,_0x572431)[_0x4c83('0x1c')](function(_0x5a71ba){if(_0x5a71ba&&_0x5a71ba['length']){return _0x2ea779[_0x4c83('0x22')][_0x4c83('0x23')](_0x5a71ba);}})[_0x4c83('0x1c')](function(){_0x28bcc9();})['catch'](function(_0x4bd2d4){_0x28bcc9(_0x4bd2d4);});},'afterUpdate':function(_0x352b98,_0xdf4306,_0x9622c4){return _0x2ea779['VoiceExtension'][_0x4c83('0x24')]({'where':{'ChanSpyId':_0x352b98['id']}})[_0x4c83('0x1c')](function(){return getChanSpyPromise(_0x2ea779,_0x352b98);})[_0x4c83('0x1c')](function(_0x11c504){if(_0x11c504&&_0x11c504[_0x4c83('0x17')]){return _0x2ea779[_0x4c83('0x22')][_0x4c83('0x23')](_0x11c504);}})['then'](function(){_0x9622c4();})['catch'](function(_0x1dac1d){_0x9622c4(_0x1dac1d);});},'afterDestroy':function(_0x45c41d,_0x1dc4d2,_0x19bee9){return _0x2ea779[_0x4c83('0x22')][_0x4c83('0x24')]({'where':{'ChanSpyId':_0x45c41d['id']}})[_0x4c83('0x1c')](function(){_0x19bee9();})[_0x4c83('0x1d')](function(_0xb53af9){_0x19bee9(_0xb53af9);});}}});}; \ No newline at end of file +var _0x4c6a=['auth','password','merge','ChanSpy','SIP/%s,%s','name','options','length','concat','internal','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','destroy','VoiceExtension','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4c6a,0x1de));var _0xa4c6=function(_0x35f164,_0x58ce88){_0x35f164=_0x35f164-0x0;var _0xda66e3=_0x4c6a[_0x35f164];return _0xda66e3;};'use strict';var _=require(_0xa4c6('0x0'));var util=require('util');var BPromise=require(_0xa4c6('0x1'));var attributes=require(_0xa4c6('0x2'));var getUserApplications=function(_0x121be5,_0x59b192,_0x195812){var _0x29139a=0x1;var _0x5b7a78=[];var _0x34e345={'context':_0x59b192[_0xa4c6('0x3')]||'from-sip','exten':util[_0xa4c6('0x4')](_0xa4c6('0x5'),_0x121be5[_0xa4c6('0x6')],_0x195812),'type':_0xa4c6('0x7'),'isApp':![],'ChanSpyId':_0x121be5['id'],'UserId':_0x59b192['id']};_0x5b7a78[_0xa4c6('0x8')](_['merge']({'app':_0xa4c6('0x9'),'appdata':util['format'](_0xa4c6('0xa'),_0xa4c6('0xb')),'priority':_0x29139a++},_0x34e345));if(_0x121be5[_0xa4c6('0xc')]){_0x5b7a78[_0xa4c6('0x8')](_['merge']({'app':_0xa4c6('0xd'),'appdata':util['format'](_0xa4c6('0xe'),_0x121be5[_0xa4c6('0xf')]),'priority':_0x29139a++},_0x34e345));}if(_0x121be5[_0xa4c6('0x10')]){_0x5b7a78[_0xa4c6('0x8')](_['merge']({'app':'Authenticate','appdata':_0x121be5[_0xa4c6('0x11')],'priority':_0x29139a++},_0x34e345));}_0x5b7a78[_0xa4c6('0x8')](_[_0xa4c6('0x12')]({'app':_0xa4c6('0x13'),'appdata':util[_0xa4c6('0x4')](_0xa4c6('0x14'),_0x59b192[_0xa4c6('0x15')],_0x121be5['options']?_0x121be5[_0xa4c6('0x16')]['join'](''):''),'priority':_0x29139a++},_0x34e345));if(_0x121be5['record']){_0x5b7a78[_0xa4c6('0x8')](_[_0xa4c6('0x12')]({'app':'StopMixMonitor','priority':_0x29139a++},_0x34e345));}return _0x5b7a78;};var getChanSpyApplications=function(_0x254f9d,_0x433df4){var _0x5ac353=[];for(var _0x1ef31e=0x0,_0xb4a163=0x1;_0x1ef31e<_0x433df4[_0xa4c6('0x17')];_0x1ef31e++,_0xb4a163=0x1){_0x5ac353=_0x5ac353[_0xa4c6('0x18')](getUserApplications(_0x254f9d,_0x433df4[_0x1ef31e],_0x433df4[_0x1ef31e][_0xa4c6('0x19')]));if(_0x433df4[_0x1ef31e][_0xa4c6('0x19')]!=_0x433df4[_0x1ef31e]['name']){_0x5ac353=_0x5ac353['concat'](getUserApplications(_0x254f9d,_0x433df4[_0x1ef31e],_0x433df4[_0x1ef31e]['name']));}}return _0x5ac353;};var getChanSpyPromise=function(_0x532f51,_0x3f4bcc){return new BPromise(function(_0x132cdb,_0x2973ae){return _0x532f51['User'][_0xa4c6('0x1a')]({'attributes':['id',_0xa4c6('0x15'),_0xa4c6('0x19')],'where':{'role':_0xa4c6('0x1b'),'chanspy':!![]},'raw':!![]})[_0xa4c6('0x1c')](function(_0x1d65fb){if(_0x1d65fb){return _0x132cdb(getChanSpyApplications(_0x3f4bcc,_0x1d65fb));}return _0x132cdb([]);})[_0xa4c6('0x1d')](function(_0x46110e){_0x2973ae(_0x46110e);});});};module[_0xa4c6('0x1e')]=function(_0x247193,_0x35e819){var _0x95b57c=_0x247193[_0xa4c6('0x1f')];return _0x247193[_0xa4c6('0x20')](_0xa4c6('0x21'),attributes,{'tableName':_0xa4c6('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5538d9,_0xb1d430,_0x58f935){return getChanSpyPromise(_0x95b57c,_0x5538d9)[_0xa4c6('0x1c')](function(_0x51ea14){if(_0x51ea14&&_0x51ea14['length']){return _0x95b57c['VoiceExtension'][_0xa4c6('0x23')](_0x51ea14);}})[_0xa4c6('0x1c')](function(){_0x58f935();})[_0xa4c6('0x1d')](function(_0x24b534){_0x58f935(_0x24b534);});},'afterUpdate':function(_0x63ba7a,_0x51fc1c,_0x197b61){return _0x95b57c['VoiceExtension'][_0xa4c6('0x24')]({'where':{'ChanSpyId':_0x63ba7a['id']}})[_0xa4c6('0x1c')](function(){return getChanSpyPromise(_0x95b57c,_0x63ba7a);})[_0xa4c6('0x1c')](function(_0x3fb3a7){if(_0x3fb3a7&&_0x3fb3a7[_0xa4c6('0x17')]){return _0x95b57c[_0xa4c6('0x25')][_0xa4c6('0x23')](_0x3fb3a7);}})[_0xa4c6('0x1c')](function(){_0x197b61();})[_0xa4c6('0x1d')](function(_0x591dd4){_0x197b61(_0x591dd4);});},'afterDestroy':function(_0x4b29eb,_0x3a2f93,_0x5334f3){return _0x95b57c[_0xa4c6('0x25')]['destroy']({'where':{'ChanSpyId':_0x4b29eb['id']}})['then'](function(){_0x5334f3();})[_0xa4c6('0x1d')](function(_0x24b151){_0x5334f3(_0x24b151);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2ee2d33..15b7349 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 _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6953,0x91));var _0x3695=function(_0x16bdaf,_0x27cd42){_0x16bdaf=_0x16bdaf-0x0;var _0x4abfac=_0x6953[_0x16bdaf];return _0x4abfac;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0xac4a=['VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xac4a,0x13f));var _0xaac4=function(_0x432e74,_0x4e36cc){_0x432e74=_0x432e74-0x0;var _0x3f8558=_0xac4a[_0x432e74];return _0x3f8558;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f19ecff..65a0c50 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 _0x0c7a=['create','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x0c7a,0xc5));var _0xa0c7=function(_0x49cd69,_0x77b78){_0x49cd69=_0x49cd69-0x0;var _0x56a789=_0x0c7a[_0x49cd69];return _0x56a789;};'use strict';var multer=require(_0xa0c7('0x0'));var util=require(_0xa0c7('0x1'));var path=require('path');var timeout=require(_0xa0c7('0x2'));var express=require('express');var router=express[_0xa0c7('0x3')]();var fs_extra=require(_0xa0c7('0x4'));var auth=require(_0xa0c7('0x5'));var interaction=require(_0xa0c7('0x6'));var config=require(_0xa0c7('0x7'));var controller=require('./voiceContext.controller');router[_0xa0c7('0x8')]('/',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xa')]);router[_0xa0c7('0x8')](_0xa0c7('0xb'),auth[_0xa0c7('0x9')](),controller['show']);router[_0xa0c7('0xc')]('/',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xd')]);router['put'](_0xa0c7('0xb'),auth[_0xa0c7('0x9')](),controller['update']);router['delete'](_0xa0c7('0xb'),auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xe')]);module['exports']=router; \ No newline at end of file +var _0xc854=['isAuthenticated','index','/:id','show','post','put','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xb6ec3a,_0x593b04){var _0x25e693=function(_0xbbf8c4){while(--_0xbbf8c4){_0xb6ec3a['push'](_0xb6ec3a['shift']());}};_0x25e693(++_0x593b04);}(_0xc854,0x142));var _0x4c85=function(_0x1a3ca2,_0xe144e7){_0x1a3ca2=_0x1a3ca2-0x0;var _0x30ea08=_0xc854[_0x1a3ca2];return _0x30ea08;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4c85('0x0'));var express=require(_0x4c85('0x1'));var router=express[_0x4c85('0x2')]();var fs_extra=require(_0x4c85('0x3'));var auth=require(_0x4c85('0x4'));var interaction=require(_0x4c85('0x5'));var config=require(_0x4c85('0x6'));var controller=require('./voiceContext.controller');router[_0x4c85('0x7')]('/',auth[_0x4c85('0x8')](),controller[_0x4c85('0x9')]);router[_0x4c85('0x7')](_0x4c85('0xa'),auth[_0x4c85('0x8')](),controller[_0x4c85('0xb')]);router[_0x4c85('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c85('0xd')](_0x4c85('0xa'),auth[_0x4c85('0x8')](),controller['update']);router['delete'](_0x4c85('0xa'),auth[_0x4c85('0x8')](),controller[_0x4c85('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index ae92890..eccbca1 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 _0x0143=['exports','STRING','BOOLEAN','sequelize'];(function(_0x17bd45,_0x8f22f6){var _0x47c622=function(_0x55e4ee){while(--_0x55e4ee){_0x17bd45['push'](_0x17bd45['shift']());}};_0x47c622(++_0x8f22f6);}(_0x0143,0x113));var _0x3014=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0143[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x3014('0x0'));module[_0x3014('0x1')]={'name':{'type':Sequelize[_0x3014('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x3014('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3014('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c87=['BOOLEAN','sequelize','name','STRING'];(function(_0x1c3b39,_0x1f690b){var _0x2f72d6=function(_0x14c29a){while(--_0x14c29a){_0x1c3b39['push'](_0x1c3b39['shift']());}};_0x2f72d6(++_0x1f690b);}(_0x5c87,0x11d));var _0x75c8=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x5c87[_0x2053ea];return _0x2232c4;};'use strict';var Sequelize=require(_0x75c8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x75c8('0x1')},'description':{'type':Sequelize[_0x75c8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x75c8('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index b203d5c..61470af 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 _0xcd2f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','keys','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','findAll','join','writeFileSync','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','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','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','destroy','get','Contexts','UserProfileResource','end','stack','name','send','index','VoiceContext','fieldName','key','model','map','query','filters'];(function(_0x460e20,_0x3ff2d0){var _0x4088a4=function(_0x460092){while(--_0x460092){_0x460e20['push'](_0x460e20['shift']());}};_0x4088a4(++_0x3ff2d0);}(_0xcd2f,0x164));var _0xfcd2=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xcd2f[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0xfcd2('0x0'));var rimraf=require(_0xfcd2('0x1'));var zipdir=require(_0xfcd2('0x2'));var jsonpatch=require(_0xfcd2('0x3'));var rp=require('request-promise');var moment=require(_0xfcd2('0x4'));var BPromise=require(_0xfcd2('0x5'));var Mustache=require(_0xfcd2('0x6'));var util=require(_0xfcd2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfcd2('0x8'));var ejs=require(_0xfcd2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfcd2('0xb'));var deskjs=require(_0xfcd2('0xc'));var toCsv=require(_0xfcd2('0x8'));var querystring=require('querystring');var Papa=require(_0xfcd2('0xd'));var Redis=require(_0xfcd2('0xe'));var authService=require(_0xfcd2('0xf'));var qs=require(_0xfcd2('0x10'));var as=require(_0xfcd2('0x11'));var hardwareService=require(_0xfcd2('0x12'));var logger=require(_0xfcd2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xfcd2('0x14'));var licenseUtil=require(_0xfcd2('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfcd2('0x16'));var client=jayson[_0xfcd2('0x17')][_0xfcd2('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3bd66f,_0x362c5f,_0x3a19cb,_0x202698){return new BPromise(function(_0xaac8f5,_0xa7338f){var _0x4d32df=_0x202698||client;return _0x4d32df[_0xfcd2('0x19')](_0x3bd66f,_0x3a19cb)[_0xfcd2('0x1a')](function(_0x4ba949){logger[_0xfcd2('0x1b')](_0xfcd2('0x1c'),_0x362c5f,_0xfcd2('0x1d'));logger[_0xfcd2('0x1e')](_0xfcd2('0x1f'),_0x362c5f,_0xfcd2('0x1d'),JSON[_0xfcd2('0x20')](_0x4ba949));if(_0x4ba949[_0xfcd2('0x21')]){if(_0x4ba949[_0xfcd2('0x21')][_0xfcd2('0x22')]===0x1f4){logger[_0xfcd2('0x21')](_0xfcd2('0x1c'),_0x362c5f,_0x4ba949['error'][_0xfcd2('0x23')]);return _0xa7338f(_0x4ba949[_0xfcd2('0x21')][_0xfcd2('0x23')]);}logger[_0xfcd2('0x21')](_0xfcd2('0x1c'),_0x362c5f,_0x4ba949[_0xfcd2('0x21')]['message']);return _0xaac8f5(_0x4ba949['error'][_0xfcd2('0x23')]);}else{logger['info'](_0xfcd2('0x1c'),_0x362c5f,'request\x20sent');_0xaac8f5(_0x4ba949[_0xfcd2('0x24')][_0xfcd2('0x23')]);}})[_0xfcd2('0x25')](function(_0x2dfdba){logger[_0xfcd2('0x21')](_0xfcd2('0x1c'),_0x362c5f,_0x2dfdba);_0xa7338f(_0x2dfdba);});});}function respondWithStatusCode(_0x455fe6,_0x178179){_0x178179=_0x178179||0xcc;return function(_0x4d7791){if(_0x4d7791){return _0x455fe6[_0xfcd2('0x26')](_0x178179);}return _0x455fe6[_0xfcd2('0x27')](_0x178179)['end']();};}function respondWithResult(_0x28abc7,_0x32e345){_0x32e345=_0x32e345||0xc8;return function(_0x415d19){if(_0x415d19){return _0x28abc7['status'](_0x32e345)[_0xfcd2('0x28')](_0x415d19);}};}function respondWithFilteredResult(_0x495e8a,_0x39473f){return function(_0x53df0a){if(_0x53df0a){var _0x18313b=typeof _0x39473f[_0xfcd2('0x29')]===_0xfcd2('0x2a')&&typeof _0x39473f[_0xfcd2('0x2b')]===_0xfcd2('0x2a');var _0x10ab3a=_0x53df0a['count'];var _0x15c23d=_0x18313b?0x0:_0x39473f[_0xfcd2('0x29')];var _0x3eb13a=_0x18313b?_0x53df0a[_0xfcd2('0x2c')]:_0x39473f['offset']+_0x39473f[_0xfcd2('0x2b')];var _0x257c72;if(_0x3eb13a>=_0x10ab3a){_0x3eb13a=_0x10ab3a;_0x257c72=0xc8;}else{_0x257c72=0xce;}_0x495e8a['status'](_0x257c72);return _0x495e8a[_0xfcd2('0x2d')]('Content-Range',_0x15c23d+'-'+_0x3eb13a+'/'+_0x10ab3a)[_0xfcd2('0x28')](_0x53df0a);}return null;};}function patchUpdates(_0x5ad373){return function(_0x2f2aac){try{jsonpatch[_0xfcd2('0x2e')](_0x2f2aac,_0x5ad373,!![]);}catch(_0x1e5c04){return BPromise[_0xfcd2('0x2f')](_0x1e5c04);}return _0x2f2aac['save']();};}function saveUpdates(_0x4aa1f9,_0x84a0db){return function(_0x39b5eb){if(_0x39b5eb){return _0x39b5eb['update'](_0x4aa1f9)[_0xfcd2('0x1a')](function(_0x355ca4){return _0x355ca4;});}return null;};}function removeEntity(_0x2fe2b5,_0x292add){return function(_0x40ba85){if(_0x40ba85){return _0x40ba85[_0xfcd2('0x30')]()[_0xfcd2('0x1a')](function(){var _0x51b864=_0x40ba85[_0xfcd2('0x31')]({'plain':!![]});var _0x5effc3=_0xfcd2('0x32');return db[_0xfcd2('0x33')]['destroy']({'where':{'type':_0x5effc3,'resourceId':_0x51b864['id']}})[_0xfcd2('0x1a')](function(){return _0x40ba85;});})[_0xfcd2('0x1a')](function(){_0x2fe2b5['status'](0xcc)[_0xfcd2('0x34')]();});}};}function handleEntityNotFound(_0x13d200,_0x3efc27){return function(_0x9609b4){if(!_0x9609b4){_0x13d200[_0xfcd2('0x26')](0x194);}return _0x9609b4;};}function handleError(_0x1dbea8,_0x3c8fb3){_0x3c8fb3=_0x3c8fb3||0x1f4;return function(_0x40e5bd){logger[_0xfcd2('0x21')](_0x40e5bd[_0xfcd2('0x35')]);if(_0x40e5bd[_0xfcd2('0x36')]){delete _0x40e5bd['name'];}_0x1dbea8[_0xfcd2('0x27')](_0x3c8fb3)[_0xfcd2('0x37')](_0x40e5bd);};}exports[_0xfcd2('0x38')]=function(_0x14b3f4,_0x57dca2){var _0x321ed1={},_0x83ce10={},_0x3b5d87={'count':0x0,'rows':[]};var _0x237cbc=_['map'](db[_0xfcd2('0x39')]['rawAttributes'],function(_0x59ee90){return{'name':_0x59ee90[_0xfcd2('0x3a')],'type':_0x59ee90['type'][_0xfcd2('0x3b')]};});_0x83ce10[_0xfcd2('0x3c')]=_[_0xfcd2('0x3d')](_0x237cbc,'name');_0x83ce10[_0xfcd2('0x3e')]=_['keys'](_0x14b3f4[_0xfcd2('0x3e')]);_0x83ce10[_0xfcd2('0x3f')]=_[_0xfcd2('0x40')](_0x83ce10[_0xfcd2('0x3c')],_0x83ce10['query']);_0x321ed1[_0xfcd2('0x41')]=_[_0xfcd2('0x40')](_0x83ce10[_0xfcd2('0x3c')],qs[_0xfcd2('0x42')](_0x14b3f4[_0xfcd2('0x3e')]['fields']));_0x321ed1[_0xfcd2('0x41')]=_0x321ed1[_0xfcd2('0x41')][_0xfcd2('0x43')]?_0x321ed1['attributes']:_0x83ce10['model'];if(!_0x14b3f4[_0xfcd2('0x3e')][_0xfcd2('0x44')](_0xfcd2('0x45'))){_0x321ed1[_0xfcd2('0x2b')]=qs['limit'](_0x14b3f4[_0xfcd2('0x3e')]['limit']);_0x321ed1[_0xfcd2('0x29')]=qs['offset'](_0x14b3f4[_0xfcd2('0x3e')][_0xfcd2('0x29')]);}_0x321ed1[_0xfcd2('0x46')]=qs[_0xfcd2('0x47')](_0x14b3f4[_0xfcd2('0x3e')][_0xfcd2('0x47')]);_0x321ed1[_0xfcd2('0x48')]=qs[_0xfcd2('0x3f')](_[_0xfcd2('0x49')](_0x14b3f4[_0xfcd2('0x3e')],_0x83ce10[_0xfcd2('0x3f')]),_0x237cbc);if(_0x14b3f4['query'][_0xfcd2('0x4a')]){_0x321ed1[_0xfcd2('0x48')]=_[_0xfcd2('0x4b')](_0x321ed1[_0xfcd2('0x48')],{'$or':_[_0xfcd2('0x3d')](_0x237cbc,function(_0x36bdb5){if(_0x36bdb5[_0xfcd2('0x4c')]!==_0xfcd2('0x4d')){var _0x3c4f4a={};_0x3c4f4a[_0x36bdb5[_0xfcd2('0x36')]]={'$like':'%'+_0x14b3f4[_0xfcd2('0x3e')][_0xfcd2('0x4a')]+'%'};return _0x3c4f4a;}})});}_0x321ed1=_[_0xfcd2('0x4b')]({},_0x321ed1,_0x14b3f4[_0xfcd2('0x4e')]);var _0x5d3e97={'where':_0x321ed1[_0xfcd2('0x48')]};return db[_0xfcd2('0x39')][_0xfcd2('0x2c')](_0x5d3e97)[_0xfcd2('0x1a')](function(_0x5cd5fc){_0x3b5d87[_0xfcd2('0x2c')]=_0x5cd5fc;if(_0x14b3f4[_0xfcd2('0x3e')][_0xfcd2('0x4f')]){_0x321ed1[_0xfcd2('0x50')]=[{'all':!![]}];}return db[_0xfcd2('0x39')]['findAll'](_0x321ed1);})[_0xfcd2('0x1a')](function(_0x636766){_0x3b5d87['rows']=_0x636766;return _0x3b5d87;})[_0xfcd2('0x1a')](respondWithFilteredResult(_0x57dca2,_0x321ed1))[_0xfcd2('0x25')](handleError(_0x57dca2,null));};exports[_0xfcd2('0x51')]=function(_0x7ab078,_0x11ca3f){var _0x4fea21={'raw':![],'where':{'id':_0x7ab078[_0xfcd2('0x52')]['id']}},_0x28423c={};_0x28423c[_0xfcd2('0x3c')]=_[_0xfcd2('0x53')](db[_0xfcd2('0x39')]['rawAttributes']);_0x28423c[_0xfcd2('0x3e')]=_['keys'](_0x7ab078['query']);_0x28423c[_0xfcd2('0x3f')]=_[_0xfcd2('0x40')](_0x28423c['model'],_0x28423c['query']);_0x4fea21[_0xfcd2('0x41')]=_['intersection'](_0x28423c[_0xfcd2('0x3c')],qs[_0xfcd2('0x42')](_0x7ab078[_0xfcd2('0x3e')]['fields']));_0x4fea21[_0xfcd2('0x41')]=_0x4fea21[_0xfcd2('0x41')]['length']?_0x4fea21['attributes']:_0x28423c[_0xfcd2('0x3c')];if(_0x7ab078[_0xfcd2('0x3e')][_0xfcd2('0x4f')]){_0x4fea21[_0xfcd2('0x50')]=[{'all':!![]}];}_0x4fea21=_[_0xfcd2('0x4b')]({},_0x4fea21,_0x7ab078[_0xfcd2('0x4e')]);return db['VoiceContext'][_0xfcd2('0x54')](_0x4fea21)[_0xfcd2('0x1a')](handleEntityNotFound(_0x11ca3f,null))[_0xfcd2('0x1a')](respondWithResult(_0x11ca3f,null))[_0xfcd2('0x25')](handleError(_0x11ca3f,null));};exports[_0xfcd2('0x55')]=function(_0x57da9d,_0x362306,_0x35858f){var _0x1933e0;return db['VoiceContext'][_0xfcd2('0x55')](_0x57da9d['body'],{'raw':!![]})[_0xfcd2('0x1a')](function(_0x106704){_0x1933e0=_0x106704;return db[_0xfcd2('0x39')]['findAll']({'raw':!![]});})[_0xfcd2('0x1a')](function(_0x3f507b){var _0x54b1b8=fs[_0xfcd2('0x56')](path['join'](config[_0xfcd2('0x57')],_0xfcd2('0x58')),_0xfcd2('0x59'));var _0x12de3f=ejs[_0xfcd2('0x5a')](_0x54b1b8,{'contexts':_0x3f507b||[]});fs['writeFileSync'](_0xfcd2('0x5b'),_0x12de3f);})[_0xfcd2('0x1a')](function(){return respondWithRpcPromise('Reload',_0xfcd2('0x55'),{'module':'chan_sip.so'});})[_0xfcd2('0x1a')](function(){var _0x7f598d=_0x57da9d['user'][_0xfcd2('0x31')]({'plain':!![]});if(!_0x7f598d)throw new Error(_0xfcd2('0x5c'));if(_0x7f598d[_0xfcd2('0x5d')]===_0xfcd2('0x5e')){var _0x1e319f=_0x1933e0[_0xfcd2('0x31')]({'plain':!![]});return db[_0xfcd2('0x5f')][_0xfcd2('0x54')]({'where':{'name':_0xfcd2('0x32'),'userProfileId':_0x7f598d[_0xfcd2('0x60')]},'raw':!![]})[_0xfcd2('0x1a')](function(_0x240737){if(_0x240737&&_0x240737['autoAssociation']===0x0){return db[_0xfcd2('0x33')][_0xfcd2('0x55')]({'name':_0x1e319f['name'],'resourceId':_0x1e319f['id'],'type':_0x240737[_0xfcd2('0x36')],'sectionId':_0x240737['id']},{})[_0xfcd2('0x1a')](function(){return _0x1933e0;});}else{return _0x1933e0;}})[_0xfcd2('0x25')](function(_0x22cfbe){logger[_0xfcd2('0x21')](_0xfcd2('0x61'),_0x22cfbe);throw _0x22cfbe;});}return _0x1933e0;})[_0xfcd2('0x1a')](respondWithResult(_0x362306,0xc9))[_0xfcd2('0x25')](handleError(_0x362306,null));};exports[_0xfcd2('0x62')]=function(_0x111184,_0x343d4e,_0x479f2d){var _0x55bd82;return db[_0xfcd2('0x39')][_0xfcd2('0x54')]({'where':{'id':_0x111184[_0xfcd2('0x52')]['id']}})[_0xfcd2('0x1a')](handleEntityNotFound(_0x343d4e,null))[_0xfcd2('0x1a')](saveUpdates(_0x111184[_0xfcd2('0x63')],null))['then'](function(_0x457908){if(_0x457908){_0x55bd82=_0x457908;return db[_0xfcd2('0x39')][_0xfcd2('0x64')]({'raw':!![]});}})[_0xfcd2('0x1a')](function(_0x4c17b5){var _0x37aa99=fs[_0xfcd2('0x56')](path[_0xfcd2('0x65')](config[_0xfcd2('0x57')],_0xfcd2('0x58')),_0xfcd2('0x59'));var _0x56d7d2=ejs['render'](_0x37aa99,{'contexts':_0x4c17b5||[]});fs[_0xfcd2('0x66')](_0xfcd2('0x5b'),_0x56d7d2);})[_0xfcd2('0x1a')](function(){return respondWithRpcPromise(_0xfcd2('0x67'),_0xfcd2('0x62'),{'module':_0xfcd2('0x68')});})['then'](function(){return _0x55bd82;})[_0xfcd2('0x1a')](respondWithResult(_0x343d4e,null))[_0xfcd2('0x25')](handleError(_0x343d4e,null));};exports[_0xfcd2('0x30')]=function(_0x56a429,_0x8bc865,_0x29dc2a){var _0xed8e95;return db[_0xfcd2('0x39')]['find']({'where':{'id':_0x56a429['params']['id']}})['then'](handleEntityNotFound(_0x8bc865,null))[_0xfcd2('0x1a')](removeEntity(_0x8bc865,null))[_0xfcd2('0x1a')](function(){return db[_0xfcd2('0x39')]['findAll']({'raw':!![]});})[_0xfcd2('0x1a')](function(_0x6260b0){var _0x5cfa83=fs[_0xfcd2('0x56')](path[_0xfcd2('0x65')](config['root'],_0xfcd2('0x58')),_0xfcd2('0x59'));var _0xc678f9=ejs[_0xfcd2('0x5a')](_0x5cfa83,{'contexts':_0x6260b0});fs[_0xfcd2('0x66')](_0xfcd2('0x5b'),_0xc678f9);return respondWithRpcPromise('Reload',_0xfcd2('0x30'),{'module':_0xfcd2('0x68')});})[_0xfcd2('0x25')](handleError(_0x8bc865,null));}; \ No newline at end of file +var _0x1211=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','status','end','json','offset','undefined','count','limit','set','apply','save','update','get','Contexts','destroy','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','root','server/files/templates/context.ejs','utf8','render','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','readFileSync','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','join','eml-format','rimraf','zip-dir','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x4bbacb,_0x187b7b){var _0x1b7aa7=function(_0x4aa130){while(--_0x4aa130){_0x4bbacb['push'](_0x4bbacb['shift']());}};_0x1b7aa7(++_0x187b7b);}(_0x1211,0x1e9));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x1121('0x0'));var rimraf=require(_0x1121('0x1'));var zipdir=require(_0x1121('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1121('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1121('0x4'));var util=require('util');var path=require(_0x1121('0x5'));var sox=require('sox');var csv=require(_0x1121('0x6'));var ejs=require(_0x1121('0x7'));var fs=require('fs');var fs_extra=require(_0x1121('0x8'));var _=require(_0x1121('0x9'));var squel=require('squel');var crypto=require(_0x1121('0xa'));var jsforce=require(_0x1121('0xb'));var deskjs=require(_0x1121('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1121('0xd'));var Papa=require(_0x1121('0xe'));var Redis=require('ioredis');var authService=require(_0x1121('0xf'));var qs=require(_0x1121('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1121('0x11'));var logger=require(_0x1121('0x12'))(_0x1121('0x13'));var utils=require(_0x1121('0x14'));var config=require(_0x1121('0x15'));var licenseUtil=require(_0x1121('0x16'));var db=require(_0x1121('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1121('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x37908b,_0x55c458,_0x2424ff,_0x1ea81a){return new BPromise(function(_0x25deaf,_0x6d895b){var _0x1188d0=_0x1ea81a||client;return _0x1188d0['request'](_0x37908b,_0x2424ff)[_0x1121('0x19')](function(_0x1e5604){logger['info'](_0x1121('0x1a'),_0x55c458,_0x1121('0x1b'));logger[_0x1121('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x55c458,_0x1121('0x1b'),JSON[_0x1121('0x1d')](_0x1e5604));if(_0x1e5604[_0x1121('0x1e')]){if(_0x1e5604[_0x1121('0x1e')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x55c458,_0x1e5604[_0x1121('0x1e')][_0x1121('0x1f')]);return _0x6d895b(_0x1e5604[_0x1121('0x1e')][_0x1121('0x1f')]);}logger[_0x1121('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x55c458,_0x1e5604[_0x1121('0x1e')][_0x1121('0x1f')]);return _0x25deaf(_0x1e5604[_0x1121('0x1e')][_0x1121('0x1f')]);}else{logger[_0x1121('0x20')]('VoiceContext,\x20%s,\x20%s',_0x55c458,'request\x20sent');_0x25deaf(_0x1e5604['result'][_0x1121('0x1f')]);}})[_0x1121('0x21')](function(_0x4a8477){logger[_0x1121('0x1e')](_0x1121('0x1a'),_0x55c458,_0x4a8477);_0x6d895b(_0x4a8477);});});}function respondWithStatusCode(_0x486c74,_0x5da104){_0x5da104=_0x5da104||0xcc;return function(_0x4ae437){if(_0x4ae437){return _0x486c74['sendStatus'](_0x5da104);}return _0x486c74[_0x1121('0x22')](_0x5da104)[_0x1121('0x23')]();};}function respondWithResult(_0x2ed7a6,_0x4ba042){_0x4ba042=_0x4ba042||0xc8;return function(_0x41487d){if(_0x41487d){return _0x2ed7a6[_0x1121('0x22')](_0x4ba042)[_0x1121('0x24')](_0x41487d);}};}function respondWithFilteredResult(_0x4c487f,_0x4177c0){return function(_0x47a9ac){if(_0x47a9ac){var _0x1fe3bc=typeof _0x4177c0[_0x1121('0x25')]===_0x1121('0x26')&&typeof _0x4177c0['limit']===_0x1121('0x26');var _0x5c2f3e=_0x47a9ac['count'];var _0x3868d5=_0x1fe3bc?0x0:_0x4177c0[_0x1121('0x25')];var _0xa674c9=_0x1fe3bc?_0x47a9ac[_0x1121('0x27')]:_0x4177c0[_0x1121('0x25')]+_0x4177c0[_0x1121('0x28')];var _0x79d819;if(_0xa674c9>=_0x5c2f3e){_0xa674c9=_0x5c2f3e;_0x79d819=0xc8;}else{_0x79d819=0xce;}_0x4c487f[_0x1121('0x22')](_0x79d819);return _0x4c487f[_0x1121('0x29')]('Content-Range',_0x3868d5+'-'+_0xa674c9+'/'+_0x5c2f3e)[_0x1121('0x24')](_0x47a9ac);}return null;};}function patchUpdates(_0x6cbda7){return function(_0x451bde){try{jsonpatch[_0x1121('0x2a')](_0x451bde,_0x6cbda7,!![]);}catch(_0x5141d6){return BPromise['reject'](_0x5141d6);}return _0x451bde[_0x1121('0x2b')]();};}function saveUpdates(_0xec3f7a,_0x2052e3){return function(_0x390dd6){if(_0x390dd6){return _0x390dd6[_0x1121('0x2c')](_0xec3f7a)['then'](function(_0xf5f7b0){return _0xf5f7b0;});}return null;};}function removeEntity(_0xb5058a,_0x4ee733){return function(_0x317888){if(_0x317888){return _0x317888['destroy']()['then'](function(){var _0x50dd62=_0x317888[_0x1121('0x2d')]({'plain':!![]});var _0x11aa54=_0x1121('0x2e');return db['UserProfileResource'][_0x1121('0x2f')]({'where':{'type':_0x11aa54,'resourceId':_0x50dd62['id']}})[_0x1121('0x19')](function(){return _0x317888;});})[_0x1121('0x19')](function(){_0xb5058a[_0x1121('0x22')](0xcc)[_0x1121('0x23')]();});}};}function handleEntityNotFound(_0x22d3f1,_0x407c14){return function(_0x43c205){if(!_0x43c205){_0x22d3f1[_0x1121('0x30')](0x194);}return _0x43c205;};}function handleError(_0x126966,_0x5a7139){_0x5a7139=_0x5a7139||0x1f4;return function(_0x20943d){logger[_0x1121('0x1e')](_0x20943d[_0x1121('0x31')]);if(_0x20943d[_0x1121('0x32')]){delete _0x20943d['name'];}_0x126966['status'](_0x5a7139)[_0x1121('0x33')](_0x20943d);};}exports[_0x1121('0x34')]=function(_0x47bc4e,_0x301277){var _0x34f94a={},_0x4814c4={},_0xf85053={'count':0x0,'rows':[]};var _0x3e016d=_[_0x1121('0x35')](db[_0x1121('0x36')][_0x1121('0x37')],function(_0x4aa293){return{'name':_0x4aa293[_0x1121('0x38')],'type':_0x4aa293[_0x1121('0x39')][_0x1121('0x3a')]};});_0x4814c4[_0x1121('0x3b')]=_[_0x1121('0x35')](_0x3e016d,_0x1121('0x32'));_0x4814c4[_0x1121('0x3c')]=_[_0x1121('0x3d')](_0x47bc4e[_0x1121('0x3c')]);_0x4814c4['filters']=_[_0x1121('0x3e')](_0x4814c4[_0x1121('0x3b')],_0x4814c4[_0x1121('0x3c')]);_0x34f94a[_0x1121('0x3f')]=_[_0x1121('0x3e')](_0x4814c4[_0x1121('0x3b')],qs['fields'](_0x47bc4e[_0x1121('0x3c')][_0x1121('0x40')]));_0x34f94a[_0x1121('0x3f')]=_0x34f94a[_0x1121('0x3f')]['length']?_0x34f94a['attributes']:_0x4814c4[_0x1121('0x3b')];if(!_0x47bc4e[_0x1121('0x3c')]['hasOwnProperty'](_0x1121('0x41'))){_0x34f94a[_0x1121('0x28')]=qs[_0x1121('0x28')](_0x47bc4e[_0x1121('0x3c')][_0x1121('0x28')]);_0x34f94a['offset']=qs[_0x1121('0x25')](_0x47bc4e[_0x1121('0x3c')][_0x1121('0x25')]);}_0x34f94a[_0x1121('0x42')]=qs['sort'](_0x47bc4e[_0x1121('0x3c')][_0x1121('0x43')]);_0x34f94a[_0x1121('0x44')]=qs[_0x1121('0x45')](_[_0x1121('0x46')](_0x47bc4e[_0x1121('0x3c')],_0x4814c4[_0x1121('0x45')]),_0x3e016d);if(_0x47bc4e[_0x1121('0x3c')][_0x1121('0x47')]){_0x34f94a[_0x1121('0x44')]=_[_0x1121('0x48')](_0x34f94a[_0x1121('0x44')],{'$or':_['map'](_0x3e016d,function(_0x2b59aa){if(_0x2b59aa[_0x1121('0x39')]!==_0x1121('0x49')){var _0x1da418={};_0x1da418[_0x2b59aa[_0x1121('0x32')]]={'$like':'%'+_0x47bc4e[_0x1121('0x3c')]['filter']+'%'};return _0x1da418;}})});}_0x34f94a=_['merge']({},_0x34f94a,_0x47bc4e[_0x1121('0x4a')]);var _0x1acd98={'where':_0x34f94a[_0x1121('0x44')]};return db[_0x1121('0x36')]['count'](_0x1acd98)['then'](function(_0x50a879){_0xf85053[_0x1121('0x27')]=_0x50a879;if(_0x47bc4e[_0x1121('0x3c')][_0x1121('0x4b')]){_0x34f94a[_0x1121('0x4c')]=[{'all':!![]}];}return db[_0x1121('0x36')][_0x1121('0x4d')](_0x34f94a);})[_0x1121('0x19')](function(_0x4bbfd5){_0xf85053[_0x1121('0x4e')]=_0x4bbfd5;return _0xf85053;})['then'](respondWithFilteredResult(_0x301277,_0x34f94a))['catch'](handleError(_0x301277,null));};exports[_0x1121('0x4f')]=function(_0x551e5c,_0x505838){var _0x22c04b={'raw':![],'where':{'id':_0x551e5c[_0x1121('0x50')]['id']}},_0x33ada8={};_0x33ada8[_0x1121('0x3b')]=_[_0x1121('0x3d')](db[_0x1121('0x36')]['rawAttributes']);_0x33ada8[_0x1121('0x3c')]=_['keys'](_0x551e5c['query']);_0x33ada8[_0x1121('0x45')]=_[_0x1121('0x3e')](_0x33ada8['model'],_0x33ada8[_0x1121('0x3c')]);_0x22c04b[_0x1121('0x3f')]=_[_0x1121('0x3e')](_0x33ada8[_0x1121('0x3b')],qs[_0x1121('0x40')](_0x551e5c['query']['fields']));_0x22c04b[_0x1121('0x3f')]=_0x22c04b[_0x1121('0x3f')][_0x1121('0x51')]?_0x22c04b['attributes']:_0x33ada8[_0x1121('0x3b')];if(_0x551e5c[_0x1121('0x3c')][_0x1121('0x4b')]){_0x22c04b[_0x1121('0x4c')]=[{'all':!![]}];}_0x22c04b=_[_0x1121('0x48')]({},_0x22c04b,_0x551e5c['options']);return db[_0x1121('0x36')]['find'](_0x22c04b)[_0x1121('0x19')](handleEntityNotFound(_0x505838,null))['then'](respondWithResult(_0x505838,null))[_0x1121('0x21')](handleError(_0x505838,null));};exports[_0x1121('0x52')]=function(_0x313400,_0x1a2997,_0x4a6d92){var _0x4cd30e;return db[_0x1121('0x36')][_0x1121('0x52')](_0x313400[_0x1121('0x53')],{'raw':!![]})[_0x1121('0x19')](function(_0x2a3c58){_0x4cd30e=_0x2a3c58;return db[_0x1121('0x36')][_0x1121('0x4d')]({'raw':!![]});})[_0x1121('0x19')](function(_0x1d8846){var _0x240fe0=fs['readFileSync'](path['join'](config[_0x1121('0x54')],_0x1121('0x55')),_0x1121('0x56'));var _0x2b90ba=ejs[_0x1121('0x57')](_0x240fe0,{'contexts':_0x1d8846||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2b90ba);})[_0x1121('0x19')](function(){return respondWithRpcPromise('Reload',_0x1121('0x52'),{'module':_0x1121('0x58')});})[_0x1121('0x19')](function(){var _0x37d18c=_0x313400[_0x1121('0x59')]['get']({'plain':!![]});if(!_0x37d18c)throw new Error(_0x1121('0x5a'));if(_0x37d18c[_0x1121('0x5b')]===_0x1121('0x59')){var _0x2f8f86=_0x4cd30e['get']({'plain':!![]});return db[_0x1121('0x5c')][_0x1121('0x5d')]({'where':{'name':'Contexts','userProfileId':_0x37d18c['userProfileId']},'raw':!![]})[_0x1121('0x19')](function(_0x4df0ca){if(_0x4df0ca&&_0x4df0ca[_0x1121('0x5e')]===0x0){return db[_0x1121('0x5f')]['create']({'name':_0x2f8f86['name'],'resourceId':_0x2f8f86['id'],'type':_0x4df0ca['name'],'sectionId':_0x4df0ca['id']},{})[_0x1121('0x19')](function(){return _0x4cd30e;});}else{return _0x4cd30e;}})['catch'](function(_0x45e2be){logger[_0x1121('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45e2be);throw _0x45e2be;});}return _0x4cd30e;})[_0x1121('0x19')](respondWithResult(_0x1a2997,0xc9))['catch'](handleError(_0x1a2997,null));};exports['update']=function(_0x4831f7,_0x2890ef,_0x1b61cb){var _0x192c3f;return db[_0x1121('0x36')][_0x1121('0x5d')]({'where':{'id':_0x4831f7[_0x1121('0x50')]['id']}})[_0x1121('0x19')](handleEntityNotFound(_0x2890ef,null))['then'](saveUpdates(_0x4831f7[_0x1121('0x53')],null))[_0x1121('0x19')](function(_0x546b3c){if(_0x546b3c){_0x192c3f=_0x546b3c;return db[_0x1121('0x36')][_0x1121('0x4d')]({'raw':!![]});}})['then'](function(_0x30a278){var _0x2c2584=fs[_0x1121('0x60')](path['join'](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x586fee=ejs['render'](_0x2c2584,{'contexts':_0x30a278||[]});fs[_0x1121('0x61')](_0x1121('0x62'),_0x586fee);})[_0x1121('0x19')](function(){return respondWithRpcPromise(_0x1121('0x63'),'update',{'module':_0x1121('0x58')});})[_0x1121('0x19')](function(){return _0x192c3f;})[_0x1121('0x19')](respondWithResult(_0x2890ef,null))[_0x1121('0x21')](handleError(_0x2890ef,null));};exports[_0x1121('0x2f')]=function(_0x5b239c,_0x5ade47,_0x2686a1){var _0x4a030e;return db[_0x1121('0x36')][_0x1121('0x5d')]({'where':{'id':_0x5b239c[_0x1121('0x50')]['id']}})[_0x1121('0x19')](handleEntityNotFound(_0x5ade47,null))[_0x1121('0x19')](removeEntity(_0x5ade47,null))[_0x1121('0x19')](function(){return db[_0x1121('0x36')][_0x1121('0x4d')]({'raw':!![]});})[_0x1121('0x19')](function(_0x205ada){var _0x4894dc=fs['readFileSync'](path[_0x1121('0x64')](config[_0x1121('0x54')],_0x1121('0x55')),'utf8');var _0x8d4f79=ejs['render'](_0x4894dc,{'contexts':_0x205ada});fs[_0x1121('0x61')](_0x1121('0x62'),_0x8d4f79);return respondWithRpcPromise(_0x1121('0x63'),_0x1121('0x2f'),{'module':_0x1121('0x58')});})[_0x1121('0x21')](handleError(_0x5ade47,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index fa84fc9..594353c 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 _0xbd87=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext'];(function(_0x236654,_0x16e44f){var _0x27653b=function(_0x2d227c){while(--_0x2d227c){_0x236654['push'](_0x236654['shift']());}};_0x27653b(++_0x16e44f);}(_0xbd87,0x84));var _0x7bd8=function(_0x419dd8,_0x3aef16){_0x419dd8=_0x419dd8-0x0;var _0x4d7983=_0xbd87[_0x419dd8];return _0x4d7983;};'use strict';var _=require('lodash');var util=require(_0x7bd8('0x0'));var logger=require(_0x7bd8('0x1'))(_0x7bd8('0x2'));var moment=require(_0x7bd8('0x3'));var BPromise=require(_0x7bd8('0x4'));var rp=require(_0x7bd8('0x5'));var fs=require('fs');var path=require(_0x7bd8('0x6'));var rimraf=require(_0x7bd8('0x7'));var config=require(_0x7bd8('0x8'));var attributes=require(_0x7bd8('0x9'));module['exports']=function(_0x26e25c,_0x5b8a91){return _0x26e25c[_0x7bd8('0xa')](_0x7bd8('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dcb=['moment','bluebird','request-promise','exports','define','VoiceContext','util','../../config/logger'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x9dcb,0x96));var _0xb9dc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9dcb[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xb9dc('0x0'));var logger=require(_0xb9dc('0x1'))('api');var moment=require(_0xb9dc('0x2'));var BPromise=require(_0xb9dc('0x3'));var rp=require(_0xb9dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xb9dc('0x5')]=function(_0x54aaad,_0x35f887){return _0x54aaad[_0xb9dc('0x6')](_0xb9dc('0x7'),attributes,{'tableName':'voice_contexts','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 16321bc..fef8502 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 _0x48b2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x1ae5b0,_0x21b9b6){var _0x2e4495=function(_0x3d20f1){while(--_0x3d20f1){_0x1ae5b0['push'](_0x1ae5b0['shift']());}};_0x2e4495(++_0x21b9b6);}(_0x48b2,0x176));var _0x248b=function(_0x2d4373,_0x1ff2d0){_0x2d4373=_0x2d4373-0x0;var _0x2c130e=_0x48b2[_0x2d4373];return _0x2c130e;};'use strict';var _=require(_0x248b('0x0'));var util=require(_0x248b('0x1'));var moment=require(_0x248b('0x2'));var BPromise=require(_0x248b('0x3'));var rs=require(_0x248b('0x4'));var fs=require('fs');var Redis=require(_0x248b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x248b('0x6'));var logger=require('../../config/logger')(_0x248b('0x7'));var config=require(_0x248b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x248b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5189bb,_0x14fc46,_0x109fd7){return new BPromise(function(_0xa580ff,_0x376960){return client[_0x248b('0xa')](_0x5189bb,_0x109fd7)[_0x248b('0xb')](function(_0x5be12f){logger['info'](_0x248b('0xc'),_0x14fc46,'request\x20sent');logger[_0x248b('0xd')](_0x248b('0xe'),_0x14fc46,'request\x20sent',JSON[_0x248b('0xf')](_0x5be12f));if(_0x5be12f[_0x248b('0x10')]){if(_0x5be12f['error'][_0x248b('0x11')]===0x1f4){logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f['error']['message']);return _0x376960(_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);}logger[_0x248b('0x10')](_0x248b('0xc'),_0x14fc46,_0x5be12f[_0x248b('0x10')][_0x248b('0x12')]);return _0xa580ff(_0x5be12f[_0x248b('0x10')]['message']);}else{logger['info'](_0x248b('0xc'),_0x14fc46,_0x248b('0x13'));_0xa580ff(_0x5be12f['result'][_0x248b('0x12')]);}})[_0x248b('0x14')](function(_0x304dba){logger[_0x248b('0x10')]('VoiceContext,\x20%s,\x20%s',_0x14fc46,_0x304dba);_0x376960(_0x304dba);});});} \ No newline at end of file +var _0x8863=['catch','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x33f5a8,_0x1dbf01){var _0x1fce91=function(_0x2ab6e2){while(--_0x2ab6e2){_0x33f5a8['push'](_0x33f5a8['shift']());}};_0x1fce91(++_0x1dbf01);}(_0x8863,0x1b6));var _0x3886=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x8863[_0x492221];return _0x398bf9;};'use strict';var _=require('lodash');var util=require(_0x3886('0x0'));var moment=require(_0x3886('0x1'));var BPromise=require(_0x3886('0x2'));var rs=require(_0x3886('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3886('0x4'));var config=require(_0x3886('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3886('0x6')][_0x3886('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x566503,_0x25d62e,_0x6edf8a){return new BPromise(function(_0x3a7943,_0x2718ec){return client['request'](_0x566503,_0x6edf8a)[_0x3886('0x8')](function(_0x2dbdc1){logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,_0x3886('0xb'));logger['debug'](_0x3886('0xc'),_0x25d62e,_0x3886('0xb'),JSON[_0x3886('0xd')](_0x2dbdc1));if(_0x2dbdc1['error']){if(_0x2dbdc1['error'][_0x3886('0xe')]===0x1f4){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x2718ec(_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);}logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x3a7943(_0x2dbdc1[_0x3886('0xf')]['message']);}else{logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,'request\x20sent');_0x3a7943(_0x2dbdc1[_0x3886('0x11')]['message']);}})[_0x3886('0x12')](function(_0xdbb8c){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0xdbb8c);_0x2718ec(_0xdbb8c);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 43ebbbb..11ddb41 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 _0xf72b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','path'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xf72b,0x1d9));var _0xbf72=function(_0x1b22c5,_0x1ffe6d){_0x1b22c5=_0x1b22c5-0x0;var _0x264088=_0xf72b[_0x1b22c5];return _0x264088;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['post']('/',auth[_0xbf72('0x9')](),controller[_0xbf72('0xe')]);router['put'](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xf')]);router[_0xbf72('0x10')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x11')]);module[_0xbf72('0x12')]=router; \ No newline at end of file +var _0xb646=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x16b2cd,_0x22bbf1){var _0x39cfc4=function(_0x14c628){while(--_0x14c628){_0x16b2cd['push'](_0x16b2cd['shift']());}};_0x39cfc4(++_0x22bbf1);}(_0xb646,0xae));var _0x6b64=function(_0x4d38c5,_0x9a8222){_0x4d38c5=_0x4d38c5-0x0;var _0x349d9b=_0xb646[_0x4d38c5];return _0x349d9b;};'use strict';var multer=require(_0x6b64('0x0'));var util=require(_0x6b64('0x1'));var path=require('path');var timeout=require(_0x6b64('0x2'));var express=require(_0x6b64('0x3'));var router=express[_0x6b64('0x4')]();var fs_extra=require(_0x6b64('0x5'));var auth=require(_0x6b64('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b64('0x7'));router[_0x6b64('0x8')]('/',auth[_0x6b64('0x9')](),controller[_0x6b64('0xa')]);router[_0x6b64('0x8')](_0x6b64('0xb'),auth[_0x6b64('0x9')](),controller[_0x6b64('0xc')]);router[_0x6b64('0x8')](_0x6b64('0xd'),auth[_0x6b64('0x9')](),controller[_0x6b64('0xe')]);router[_0x6b64('0xf')]('/',auth[_0x6b64('0x9')](),controller[_0x6b64('0x10')]);router[_0x6b64('0x11')](_0x6b64('0xd'),auth[_0x6b64('0x9')](),controller['update']);router[_0x6b64('0x12')](_0x6b64('0xd'),auth[_0x6b64('0x9')](),controller[_0x6b64('0x13')]);module[_0x6b64('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 21cc8bb..a094d20 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 _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x9f62,0x154));var _0x29f6=function(_0x270401,_0x4fa45e){_0x270401=_0x270401-0x0;var _0x43be4d=_0x9f62[_0x270401];return _0x43be4d;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3e74,0x175));var _0x43e7=function(_0x499267,_0x41bfd8){_0x499267=_0x499267-0x0;var _0x4220d5=_0x3e74[_0x499267];return _0x4220d5;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 598db87..3173b9e 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 _0x5b0b=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','map','VoiceDialReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox'];(function(_0x27cae4,_0x1fe454){var _0x468f66=function(_0x299ed4){while(--_0x299ed4){_0x27cae4['push'](_0x27cae4['shift']());}};_0x468f66(++_0x1fe454);}(_0x5b0b,0x11b));var _0xb5b0=function(_0x5a06e2,_0x25c279){_0x5a06e2=_0x5a06e2-0x0;var _0x1782cc=_0x5b0b[_0x5a06e2];return _0x1782cc;};'use strict';var emlformat=require(_0xb5b0('0x0'));var rimraf=require(_0xb5b0('0x1'));var zipdir=require(_0xb5b0('0x2'));var jsonpatch=require(_0xb5b0('0x3'));var rp=require('request-promise');var moment=require(_0xb5b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb5b0('0x5'));var util=require(_0xb5b0('0x6'));var path=require(_0xb5b0('0x7'));var sox=require(_0xb5b0('0x8'));var csv=require(_0xb5b0('0x9'));var ejs=require(_0xb5b0('0xa'));var fs=require('fs');var fs_extra=require(_0xb5b0('0xb'));var _=require(_0xb5b0('0xc'));var squel=require('squel');var crypto=require(_0xb5b0('0xd'));var jsforce=require(_0xb5b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5b0('0x9'));var querystring=require('querystring');var Papa=require(_0xb5b0('0xf'));var Redis=require(_0xb5b0('0x10'));var authService=require(_0xb5b0('0x11'));var qs=require(_0xb5b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5b0('0x13'))(_0xb5b0('0x14'));var utils=require(_0xb5b0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb5b0('0x16'));var db=require(_0xb5b0('0x17'))['db'];function respondWithStatusCode(_0x45d8f4,_0x3b0ccb){_0x3b0ccb=_0x3b0ccb||0xcc;return function(_0x578e31){if(_0x578e31){return _0x45d8f4[_0xb5b0('0x18')](_0x3b0ccb);}return _0x45d8f4[_0xb5b0('0x19')](_0x3b0ccb)['end']();};}function respondWithResult(_0x48483a,_0x6f9054){_0x6f9054=_0x6f9054||0xc8;return function(_0x159212){if(_0x159212){return _0x48483a[_0xb5b0('0x19')](_0x6f9054)[_0xb5b0('0x1a')](_0x159212);}};}function respondWithFilteredResult(_0x57f0ff,_0x387cd2){return function(_0x4c0cf3){if(_0x4c0cf3){var _0x2c48dc=typeof _0x387cd2[_0xb5b0('0x1b')]===_0xb5b0('0x1c')&&typeof _0x387cd2[_0xb5b0('0x1d')]==='undefined';var _0x58633b=_0x4c0cf3['count'];var _0x47efbe=_0x2c48dc?0x0:_0x387cd2[_0xb5b0('0x1b')];var _0x21be54=_0x2c48dc?_0x4c0cf3[_0xb5b0('0x1e')]:_0x387cd2[_0xb5b0('0x1b')]+_0x387cd2[_0xb5b0('0x1d')];var _0x282973;if(_0x21be54>=_0x58633b){_0x21be54=_0x58633b;_0x282973=0xc8;}else{_0x282973=0xce;}_0x57f0ff['status'](_0x282973);return _0x57f0ff[_0xb5b0('0x1f')]('Content-Range',_0x47efbe+'-'+_0x21be54+'/'+_0x58633b)[_0xb5b0('0x1a')](_0x4c0cf3);}return null;};}function patchUpdates(_0x1f0e6d){return function(_0xf87717){try{jsonpatch[_0xb5b0('0x20')](_0xf87717,_0x1f0e6d,!![]);}catch(_0x1561a2){return BPromise[_0xb5b0('0x21')](_0x1561a2);}return _0xf87717['save']();};}function saveUpdates(_0x403b0a,_0x364ac6){return function(_0x1d997f){if(_0x1d997f){return _0x1d997f[_0xb5b0('0x22')](_0x403b0a)[_0xb5b0('0x23')](function(_0x29d3e5){return _0x29d3e5;});}return null;};}function removeEntity(_0x584fc7,_0x135ecd){return function(_0x3437ec){if(_0x3437ec){return _0x3437ec[_0xb5b0('0x24')]()[_0xb5b0('0x23')](function(){_0x584fc7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba968,_0x181ab5){return function(_0x79efd0){if(!_0x79efd0){_0x3ba968[_0xb5b0('0x18')](0x194);}return _0x79efd0;};}function handleError(_0x248203,_0x5bd236){_0x5bd236=_0x5bd236||0x1f4;return function(_0x1efb1a){logger[_0xb5b0('0x25')](_0x1efb1a[_0xb5b0('0x26')]);if(_0x1efb1a[_0xb5b0('0x27')]){delete _0x1efb1a[_0xb5b0('0x27')];}_0x248203[_0xb5b0('0x19')](_0x5bd236)['send'](_0x1efb1a);};}exports['index']=function(_0x8127de,_0x22c198){var _0x363e06={},_0x156f41={},_0x140da8={'count':0x0,'rows':[]};var _0x188ade=_[_0xb5b0('0x28')](db[_0xb5b0('0x29')][_0xb5b0('0x2a')],function(_0x4559c5){return{'name':_0x4559c5['fieldName'],'type':_0x4559c5[_0xb5b0('0x2b')][_0xb5b0('0x2c')]};});_0x156f41['model']=_[_0xb5b0('0x28')](_0x188ade,_0xb5b0('0x27'));_0x156f41[_0xb5b0('0x2d')]=_[_0xb5b0('0x2e')](_0x8127de[_0xb5b0('0x2d')]);_0x156f41[_0xb5b0('0x2f')]=_[_0xb5b0('0x30')](_0x156f41[_0xb5b0('0x31')],_0x156f41[_0xb5b0('0x2d')]);_0x363e06[_0xb5b0('0x32')]=_[_0xb5b0('0x30')](_0x156f41['model'],qs[_0xb5b0('0x33')](_0x8127de['query'][_0xb5b0('0x33')]));_0x363e06[_0xb5b0('0x32')]=_0x363e06[_0xb5b0('0x32')][_0xb5b0('0x34')]?_0x363e06[_0xb5b0('0x32')]:_0x156f41['model'];if(!_0x8127de['query'][_0xb5b0('0x35')](_0xb5b0('0x36'))){_0x363e06[_0xb5b0('0x1d')]=qs[_0xb5b0('0x1d')](_0x8127de[_0xb5b0('0x2d')][_0xb5b0('0x1d')]);_0x363e06[_0xb5b0('0x1b')]=qs[_0xb5b0('0x1b')](_0x8127de[_0xb5b0('0x2d')][_0xb5b0('0x1b')]);}_0x363e06[_0xb5b0('0x37')]=qs[_0xb5b0('0x38')](_0x8127de[_0xb5b0('0x2d')][_0xb5b0('0x38')]);_0x363e06[_0xb5b0('0x39')]=qs[_0xb5b0('0x2f')](_['pick'](_0x8127de[_0xb5b0('0x2d')],_0x156f41['filters']),_0x188ade);if(_0x8127de[_0xb5b0('0x2d')][_0xb5b0('0x3a')]){_0x363e06['where']=_[_0xb5b0('0x3b')](_0x363e06['where'],{'$or':_['map'](_0x188ade,function(_0x539517){if(_0x539517[_0xb5b0('0x2b')]!==_0xb5b0('0x3c')){var _0x4b46b7={};_0x4b46b7[_0x539517['name']]={'$like':'%'+_0x8127de[_0xb5b0('0x2d')]['filter']+'%'};return _0x4b46b7;}})});}_0x363e06=_[_0xb5b0('0x3b')]({},_0x363e06,_0x8127de[_0xb5b0('0x3d')]);var _0x3e069a={'where':_0x363e06[_0xb5b0('0x39')]};return db[_0xb5b0('0x29')][_0xb5b0('0x1e')](_0x3e069a)[_0xb5b0('0x23')](function(_0xca3281){_0x140da8['count']=_0xca3281;if(_0x8127de[_0xb5b0('0x2d')][_0xb5b0('0x3e')]){_0x363e06['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xb5b0('0x3f')](_0x363e06);})[_0xb5b0('0x23')](function(_0x563fb6){_0x140da8[_0xb5b0('0x40')]=_0x563fb6;return _0x140da8;})[_0xb5b0('0x23')](respondWithFilteredResult(_0x22c198,_0x363e06))[_0xb5b0('0x41')](handleError(_0x22c198,null));};exports[_0xb5b0('0x42')]=function(_0x44c88b,_0x3e3bbd){var _0x26b6e4={'raw':!![],'where':{'id':_0x44c88b[_0xb5b0('0x43')]['id']}},_0xd1ba81={};_0xd1ba81[_0xb5b0('0x31')]=_[_0xb5b0('0x2e')](db[_0xb5b0('0x29')][_0xb5b0('0x2a')]);_0xd1ba81['query']=_[_0xb5b0('0x2e')](_0x44c88b[_0xb5b0('0x2d')]);_0xd1ba81[_0xb5b0('0x2f')]=_[_0xb5b0('0x30')](_0xd1ba81[_0xb5b0('0x31')],_0xd1ba81[_0xb5b0('0x2d')]);_0x26b6e4[_0xb5b0('0x32')]=_[_0xb5b0('0x30')](_0xd1ba81[_0xb5b0('0x31')],qs['fields'](_0x44c88b[_0xb5b0('0x2d')][_0xb5b0('0x33')]));_0x26b6e4[_0xb5b0('0x32')]=_0x26b6e4[_0xb5b0('0x32')][_0xb5b0('0x34')]?_0x26b6e4[_0xb5b0('0x32')]:_0xd1ba81['model'];if(_0x44c88b['query']['includeAll']){_0x26b6e4[_0xb5b0('0x44')]=[{'all':!![]}];}_0x26b6e4=_[_0xb5b0('0x3b')]({},_0x26b6e4,_0x44c88b[_0xb5b0('0x3d')]);return db['VoiceDialReport']['find'](_0x26b6e4)[_0xb5b0('0x23')](handleEntityNotFound(_0x3e3bbd,null))[_0xb5b0('0x23')](respondWithResult(_0x3e3bbd,null))[_0xb5b0('0x41')](handleError(_0x3e3bbd,null));};exports[_0xb5b0('0x45')]=function(_0x5c21b0,_0x4498bf){return db['VoiceDialReport'][_0xb5b0('0x45')](_0x5c21b0[_0xb5b0('0x46')],{})[_0xb5b0('0x23')](respondWithResult(_0x4498bf,0xc9))['catch'](handleError(_0x4498bf,null));};exports[_0xb5b0('0x22')]=function(_0x49b038,_0x5a46a0){if(_0x49b038[_0xb5b0('0x46')]['id']){delete _0x49b038[_0xb5b0('0x46')]['id'];}return db[_0xb5b0('0x29')][_0xb5b0('0x47')]({'where':{'id':_0x49b038[_0xb5b0('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a46a0,null))[_0xb5b0('0x23')](saveUpdates(_0x49b038[_0xb5b0('0x46')],null))['then'](respondWithResult(_0x5a46a0,null))[_0xb5b0('0x41')](handleError(_0x5a46a0,null));};exports[_0xb5b0('0x24')]=function(_0x2f1afa,_0x5dd8c7){return db['VoiceDialReport'][_0xb5b0('0x47')]({'where':{'id':_0x2f1afa[_0xb5b0('0x43')]['id']}})[_0xb5b0('0x23')](handleEntityNotFound(_0x5dd8c7,null))['then'](removeEntity(_0x5dd8c7,null))[_0xb5b0('0x41')](handleError(_0x5dd8c7,null));};exports[_0xb5b0('0x48')]=function(_0x23d232,_0x284f18){return db['VoiceDialReport']['describe']()[_0xb5b0('0x23')](respondWithResult(_0x284f18,null))[_0xb5b0('0x41')](handleError(_0x284f18,null));}; \ No newline at end of file +var _0x17d4=['undefined','count','set','Content-Range','json','save','update','then','error','name','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset'];(function(_0x1f1f8d,_0x19b006){var _0xd9c0a2=function(_0x8cb292){while(--_0x8cb292){_0x1f1f8d['push'](_0x1f1f8d['shift']());}};_0xd9c0a2(++_0x19b006);}(_0x17d4,0x77));var _0x417d=function(_0x5b1003,_0x4bfeb9){_0x5b1003=_0x5b1003-0x0;var _0x4a3ca8=_0x17d4[_0x5b1003];return _0x4a3ca8;};'use strict';var emlformat=require(_0x417d('0x0'));var rimraf=require(_0x417d('0x1'));var zipdir=require(_0x417d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x417d('0x3'));var moment=require('moment');var BPromise=require(_0x417d('0x4'));var Mustache=require('mustache');var util=require(_0x417d('0x5'));var path=require(_0x417d('0x6'));var sox=require(_0x417d('0x7'));var csv=require('to-csv');var ejs=require(_0x417d('0x8'));var fs=require('fs');var fs_extra=require(_0x417d('0x9'));var _=require(_0x417d('0xa'));var squel=require(_0x417d('0xb'));var crypto=require(_0x417d('0xc'));var jsforce=require(_0x417d('0xd'));var deskjs=require(_0x417d('0xe'));var toCsv=require(_0x417d('0xf'));var querystring=require(_0x417d('0x10'));var Papa=require(_0x417d('0x11'));var Redis=require(_0x417d('0x12'));var authService=require(_0x417d('0x13'));var qs=require(_0x417d('0x14'));var as=require(_0x417d('0x15'));var hardwareService=require(_0x417d('0x16'));var logger=require(_0x417d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x417d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x417d('0x19'))['db'];function respondWithStatusCode(_0x38caa4,_0x46a0e1){_0x46a0e1=_0x46a0e1||0xcc;return function(_0x18e2e8){if(_0x18e2e8){return _0x38caa4['sendStatus'](_0x46a0e1);}return _0x38caa4[_0x417d('0x1a')](_0x46a0e1)[_0x417d('0x1b')]();};}function respondWithResult(_0x253d1e,_0x21c9c5){_0x21c9c5=_0x21c9c5||0xc8;return function(_0x271f2c){if(_0x271f2c){return _0x253d1e['status'](_0x21c9c5)['json'](_0x271f2c);}};}function respondWithFilteredResult(_0x3d711f,_0x3a15f3){return function(_0x1d3e4e){if(_0x1d3e4e){var _0x113839=typeof _0x3a15f3[_0x417d('0x1c')]==='undefined'&&typeof _0x3a15f3['limit']===_0x417d('0x1d');var _0x4c80fd=_0x1d3e4e[_0x417d('0x1e')];var _0x2abf92=_0x113839?0x0:_0x3a15f3['offset'];var _0x350294=_0x113839?_0x1d3e4e['count']:_0x3a15f3['offset']+_0x3a15f3['limit'];var _0x2db9e8;if(_0x350294>=_0x4c80fd){_0x350294=_0x4c80fd;_0x2db9e8=0xc8;}else{_0x2db9e8=0xce;}_0x3d711f[_0x417d('0x1a')](_0x2db9e8);return _0x3d711f[_0x417d('0x1f')](_0x417d('0x20'),_0x2abf92+'-'+_0x350294+'/'+_0x4c80fd)[_0x417d('0x21')](_0x1d3e4e);}return null;};}function patchUpdates(_0x4baf56){return function(_0xad40){try{jsonpatch['apply'](_0xad40,_0x4baf56,!![]);}catch(_0x4d400e){return BPromise['reject'](_0x4d400e);}return _0xad40[_0x417d('0x22')]();};}function saveUpdates(_0x2d7ade,_0x296326){return function(_0xb8b58e){if(_0xb8b58e){return _0xb8b58e[_0x417d('0x23')](_0x2d7ade)[_0x417d('0x24')](function(_0x488ebd){return _0x488ebd;});}return null;};}function removeEntity(_0x316ffa,_0x5ef586){return function(_0x312658){if(_0x312658){return _0x312658['destroy']()['then'](function(){_0x316ffa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47df35,_0x1573b1){return function(_0x4d0b4d){if(!_0x4d0b4d){_0x47df35['sendStatus'](0x194);}return _0x4d0b4d;};}function handleError(_0x329e13,_0x23d638){_0x23d638=_0x23d638||0x1f4;return function(_0x450ee5){logger[_0x417d('0x25')](_0x450ee5['stack']);if(_0x450ee5['name']){delete _0x450ee5[_0x417d('0x26')];}_0x329e13[_0x417d('0x1a')](_0x23d638)['send'](_0x450ee5);};}exports['index']=function(_0x5a6327,_0x2df633){var _0x50a9da={},_0x2ca63b={},_0x3de3c3={'count':0x0,'rows':[]};var _0x534422=_['map'](db[_0x417d('0x27')][_0x417d('0x28')],function(_0x408537){return{'name':_0x408537[_0x417d('0x29')],'type':_0x408537[_0x417d('0x2a')][_0x417d('0x2b')]};});_0x2ca63b[_0x417d('0x2c')]=_[_0x417d('0x2d')](_0x534422,_0x417d('0x26'));_0x2ca63b[_0x417d('0x2e')]=_[_0x417d('0x2f')](_0x5a6327[_0x417d('0x2e')]);_0x2ca63b[_0x417d('0x30')]=_[_0x417d('0x31')](_0x2ca63b[_0x417d('0x2c')],_0x2ca63b['query']);_0x50a9da[_0x417d('0x32')]=_[_0x417d('0x31')](_0x2ca63b[_0x417d('0x2c')],qs['fields'](_0x5a6327[_0x417d('0x2e')][_0x417d('0x33')]));_0x50a9da[_0x417d('0x32')]=_0x50a9da[_0x417d('0x32')][_0x417d('0x34')]?_0x50a9da[_0x417d('0x32')]:_0x2ca63b[_0x417d('0x2c')];if(!_0x5a6327['query'][_0x417d('0x35')](_0x417d('0x36'))){_0x50a9da['limit']=qs[_0x417d('0x37')](_0x5a6327[_0x417d('0x2e')][_0x417d('0x37')]);_0x50a9da[_0x417d('0x1c')]=qs[_0x417d('0x1c')](_0x5a6327['query'][_0x417d('0x1c')]);}_0x50a9da['order']=qs['sort'](_0x5a6327['query'][_0x417d('0x38')]);_0x50a9da[_0x417d('0x39')]=qs[_0x417d('0x30')](_[_0x417d('0x3a')](_0x5a6327['query'],_0x2ca63b[_0x417d('0x30')]),_0x534422);if(_0x5a6327[_0x417d('0x2e')][_0x417d('0x3b')]){_0x50a9da[_0x417d('0x39')]=_[_0x417d('0x3c')](_0x50a9da[_0x417d('0x39')],{'$or':_[_0x417d('0x2d')](_0x534422,function(_0x5cd3ae){if(_0x5cd3ae[_0x417d('0x2a')]!==_0x417d('0x3d')){var _0x2aba58={};_0x2aba58[_0x5cd3ae['name']]={'$like':'%'+_0x5a6327[_0x417d('0x2e')][_0x417d('0x3b')]+'%'};return _0x2aba58;}})});}_0x50a9da=_[_0x417d('0x3c')]({},_0x50a9da,_0x5a6327[_0x417d('0x3e')]);var _0x358354={'where':_0x50a9da[_0x417d('0x39')]};return db[_0x417d('0x27')][_0x417d('0x1e')](_0x358354)[_0x417d('0x24')](function(_0x4746ad){_0x3de3c3[_0x417d('0x1e')]=_0x4746ad;if(_0x5a6327[_0x417d('0x2e')][_0x417d('0x3f')]){_0x50a9da[_0x417d('0x40')]=[{'all':!![]}];}return db[_0x417d('0x27')]['findAll'](_0x50a9da);})['then'](function(_0x31ecb2){_0x3de3c3[_0x417d('0x41')]=_0x31ecb2;return _0x3de3c3;})[_0x417d('0x24')](respondWithFilteredResult(_0x2df633,_0x50a9da))[_0x417d('0x42')](handleError(_0x2df633,null));};exports[_0x417d('0x43')]=function(_0x1e0fab,_0x1d125b){var _0x2f10d6={'raw':!![],'where':{'id':_0x1e0fab[_0x417d('0x44')]['id']}},_0x2cc76c={};_0x2cc76c['model']=_[_0x417d('0x2f')](db[_0x417d('0x27')][_0x417d('0x28')]);_0x2cc76c[_0x417d('0x2e')]=_[_0x417d('0x2f')](_0x1e0fab['query']);_0x2cc76c[_0x417d('0x30')]=_[_0x417d('0x31')](_0x2cc76c[_0x417d('0x2c')],_0x2cc76c[_0x417d('0x2e')]);_0x2f10d6[_0x417d('0x32')]=_[_0x417d('0x31')](_0x2cc76c[_0x417d('0x2c')],qs[_0x417d('0x33')](_0x1e0fab['query'][_0x417d('0x33')]));_0x2f10d6[_0x417d('0x32')]=_0x2f10d6['attributes'][_0x417d('0x34')]?_0x2f10d6[_0x417d('0x32')]:_0x2cc76c[_0x417d('0x2c')];if(_0x1e0fab[_0x417d('0x2e')]['includeAll']){_0x2f10d6[_0x417d('0x40')]=[{'all':!![]}];}_0x2f10d6=_[_0x417d('0x3c')]({},_0x2f10d6,_0x1e0fab['options']);return db['VoiceDialReport'][_0x417d('0x45')](_0x2f10d6)[_0x417d('0x24')](handleEntityNotFound(_0x1d125b,null))[_0x417d('0x24')](respondWithResult(_0x1d125b,null))[_0x417d('0x42')](handleError(_0x1d125b,null));};exports['create']=function(_0x1832e0,_0x33515){return db['VoiceDialReport'][_0x417d('0x46')](_0x1832e0['body'],{})[_0x417d('0x24')](respondWithResult(_0x33515,0xc9))[_0x417d('0x42')](handleError(_0x33515,null));};exports[_0x417d('0x23')]=function(_0x1736db,_0x462b15){if(_0x1736db[_0x417d('0x47')]['id']){delete _0x1736db[_0x417d('0x47')]['id'];}return db[_0x417d('0x27')][_0x417d('0x45')]({'where':{'id':_0x1736db['params']['id']}})[_0x417d('0x24')](handleEntityNotFound(_0x462b15,null))[_0x417d('0x24')](saveUpdates(_0x1736db[_0x417d('0x47')],null))[_0x417d('0x24')](respondWithResult(_0x462b15,null))['catch'](handleError(_0x462b15,null));};exports[_0x417d('0x48')]=function(_0x62e486,_0x490219){return db[_0x417d('0x27')][_0x417d('0x45')]({'where':{'id':_0x62e486[_0x417d('0x44')]['id']}})['then'](handleEntityNotFound(_0x490219,null))[_0x417d('0x24')](removeEntity(_0x490219,null))[_0x417d('0x42')](handleError(_0x490219,null));};exports[_0x417d('0x49')]=function(_0x796275,_0x137b85){return db[_0x417d('0x27')][_0x417d('0x49')]()[_0x417d('0x24')](respondWithResult(_0x137b85,null))['catch'](handleError(_0x137b85,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b55a0a7..fa73d74 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 _0x84cf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_dial','uniqueid','lodash','../../config/logger','api'];(function(_0x4c199d,_0x579b01){var _0x17dce2=function(_0x4720d4){while(--_0x4720d4){_0x4c199d['push'](_0x4c199d['shift']());}};_0x17dce2(++_0x579b01);}(_0x84cf,0x176));var _0xf84c=function(_0x11fb0f,_0x293d75){_0x11fb0f=_0x11fb0f-0x0;var _0x1d704b=_0x84cf[_0x11fb0f];return _0x1d704b;};'use strict';var _=require(_0xf84c('0x0'));var util=require('util');var logger=require(_0xf84c('0x1'))(_0xf84c('0x2'));var moment=require(_0xf84c('0x3'));var BPromise=require(_0xf84c('0x4'));var rp=require(_0xf84c('0x5'));var fs=require('fs');var path=require(_0xf84c('0x6'));var rimraf=require(_0xf84c('0x7'));var config=require(_0xf84c('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0xf84c('0x9')]=function(_0x1520f0,_0x43af8c){return _0x1520f0[_0xf84c('0xa')]('VoiceDialReport',attributes,{'tableName':_0xf84c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xf84c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbebf=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api'];(function(_0x43e885,_0x5700f1){var _0x18df65=function(_0x258935){while(--_0x258935){_0x43e885['push'](_0x43e885['shift']());}};_0x18df65(++_0x5700f1);}(_0xbebf,0xf9));var _0xfbeb=function(_0x45449b,_0x4a9d2d){_0x45449b=_0x45449b-0x0;var _0x528930=_0xbebf[_0x45449b];return _0x528930;};'use strict';var _=require(_0xfbeb('0x0'));var util=require('util');var logger=require(_0xfbeb('0x1'))(_0xfbeb('0x2'));var moment=require(_0xfbeb('0x3'));var BPromise=require(_0xfbeb('0x4'));var rp=require(_0xfbeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbeb('0x6'));var config=require(_0xfbeb('0x7'));var attributes=require(_0xfbeb('0x8'));module[_0xfbeb('0x9')]=function(_0x138ded,_0x519f0e){return _0x138ded[_0xfbeb('0xa')](_0xfbeb('0xb'),attributes,{'tableName':_0xfbeb('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfbeb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index b73c93b..d9f7d5f 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 _0xb88d=['error','code','message','VoiceDialReport,\x20%s,\x20%s','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','update','body','where','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x22f653,_0x38d432){var _0xadff4f=function(_0x301d4b){while(--_0x301d4b){_0x22f653['push'](_0x22f653['shift']());}};_0xadff4f(++_0x38d432);}(_0xb88d,0x1ef));var _0xdb88=function(_0xcd69e2,_0x234c50){_0xcd69e2=_0xcd69e2-0x0;var _0x46e2d5=_0xb88d[_0xcd69e2];return _0x46e2d5;};'use strict';var _=require(_0xdb88('0x0'));var util=require(_0xdb88('0x1'));var moment=require(_0xdb88('0x2'));var BPromise=require(_0xdb88('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb88('0x5'));var logger=require('../../config/logger')(_0xdb88('0x6'));var config=require(_0xdb88('0x7'));var jayson=require(_0xdb88('0x8'));var client=jayson[_0xdb88('0x9')][_0xdb88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2196f6,_0x2d1ed8,_0x17e4d0){return new BPromise(function(_0x4cb9ca,_0x59ee40){return client[_0xdb88('0xb')](_0x2196f6,_0x17e4d0)[_0xdb88('0xc')](function(_0x1c25a4){logger[_0xdb88('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x2d1ed8,_0xdb88('0xe'));logger[_0xdb88('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2d1ed8,_0xdb88('0xe'),JSON[_0xdb88('0x10')](_0x1c25a4));if(_0x1c25a4['error']){if(_0x1c25a4[_0xdb88('0x11')][_0xdb88('0x12')]===0x1f4){logger[_0xdb88('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2d1ed8,_0x1c25a4['error'][_0xdb88('0x13')]);return _0x59ee40(_0x1c25a4[_0xdb88('0x11')][_0xdb88('0x13')]);}logger[_0xdb88('0x11')](_0xdb88('0x14'),_0x2d1ed8,_0x1c25a4[_0xdb88('0x11')][_0xdb88('0x13')]);return _0x4cb9ca(_0x1c25a4[_0xdb88('0x11')][_0xdb88('0x13')]);}else{logger[_0xdb88('0xd')](_0xdb88('0x14'),_0x2d1ed8,'request\x20sent');_0x4cb9ca(_0x1c25a4['result'][_0xdb88('0x13')]);}})[_0xdb88('0x15')](function(_0x16c6d1){logger[_0xdb88('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2d1ed8,_0x16c6d1);_0x59ee40(_0x16c6d1);});});}exports[_0xdb88('0x16')]=function(_0x2fb342){var _0x1d35fa=this;return new Promise(function(_0x1fc1ea,_0x4f96fd){return db[_0xdb88('0x17')][_0xdb88('0x18')](_0x2fb342['body'],{'raw':_0x2fb342[_0xdb88('0x19')]?_0x2fb342[_0xdb88('0x19')][_0xdb88('0x1a')]===undefined?!![]:![]:!![]})[_0xdb88('0xc')](function(_0x1945e9){logger[_0xdb88('0xd')](_0xdb88('0x16'),_0x2fb342);logger[_0xdb88('0xf')](_0xdb88('0x16'),_0x2fb342,JSON['stringify'](_0x1945e9));_0x1fc1ea(_0x1945e9);})['catch'](function(_0x29ce94){logger[_0xdb88('0x11')](_0xdb88('0x16'),_0x29ce94[_0xdb88('0x13')],_0x2fb342);_0x4f96fd(_0x1d35fa[_0xdb88('0x11')](0x1f4,_0x29ce94[_0xdb88('0x13')]));});});};exports[_0xdb88('0x1b')]=function(_0x4df012){var _0x557bb6=this;return new Promise(function(_0x34e4c9,_0x527d79){return db['VoiceDialReport'][_0xdb88('0x1c')](_0x4df012[_0xdb88('0x1d')],{'raw':_0x4df012[_0xdb88('0x19')]?_0x4df012[_0xdb88('0x19')][_0xdb88('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4df012[_0xdb88('0x19')]?_0x4df012[_0xdb88('0x19')][_0xdb88('0x1e')]||null:null,'attributes':_0x4df012[_0xdb88('0x19')]?_0x4df012['options'][_0xdb88('0x1f')]||null:null,'limit':_0x4df012[_0xdb88('0x19')]?_0x4df012[_0xdb88('0x19')]['limit']||null:null})[_0xdb88('0xc')](function(_0x340aeb){logger[_0xdb88('0xd')](_0xdb88('0x1b'),_0x4df012);logger[_0xdb88('0xf')](_0xdb88('0x1b'),_0x4df012,JSON[_0xdb88('0x10')](_0x340aeb));_0x34e4c9(_0x340aeb);})[_0xdb88('0x15')](function(_0x376007){logger[_0xdb88('0x11')](_0xdb88('0x1b'),_0x376007[_0xdb88('0x13')],_0x4df012);_0x527d79(_0x557bb6['error'](0x1f4,_0x376007[_0xdb88('0x13')]));});});}; \ No newline at end of file +var _0x16f5=['debug','update','body','where','attributes','limit','UpdateVoiceDialReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw'];(function(_0x2db5f2,_0x244403){var _0x230c2f=function(_0x5eae55){while(--_0x5eae55){_0x2db5f2['push'](_0x2db5f2['shift']());}};_0x230c2f(++_0x244403);}(_0x16f5,0xd3));var _0x516f=function(_0x4939fa,_0x4b37bd){_0x4939fa=_0x4939fa-0x0;var _0x511ca4=_0x16f5[_0x4939fa];return _0x511ca4;};'use strict';var _=require(_0x516f('0x0'));var util=require(_0x516f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x516f('0x2'));var fs=require('fs');var Redis=require(_0x516f('0x3'));var db=require(_0x516f('0x4'))['db'];var utils=require(_0x516f('0x5'));var logger=require(_0x516f('0x6'))(_0x516f('0x7'));var config=require('../../config/environment');var jayson=require(_0x516f('0x8'));var client=jayson[_0x516f('0x9')][_0x516f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52cca0,_0x119583,_0x4e3678){return new BPromise(function(_0x32f429,_0x536c29){return client[_0x516f('0xb')](_0x52cca0,_0x4e3678)[_0x516f('0xc')](function(_0x59dd16){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x119583,_0x516f('0xd'));logger['debug'](_0x516f('0xe'),_0x119583,_0x516f('0xd'),JSON[_0x516f('0xf')](_0x59dd16));if(_0x59dd16['error']){if(_0x59dd16[_0x516f('0x10')][_0x516f('0x11')]===0x1f4){logger[_0x516f('0x10')](_0x516f('0x12'),_0x119583,_0x59dd16[_0x516f('0x10')][_0x516f('0x13')]);return _0x536c29(_0x59dd16[_0x516f('0x10')][_0x516f('0x13')]);}logger[_0x516f('0x10')](_0x516f('0x12'),_0x119583,_0x59dd16[_0x516f('0x10')][_0x516f('0x13')]);return _0x32f429(_0x59dd16[_0x516f('0x10')]['message']);}else{logger[_0x516f('0x14')](_0x516f('0x12'),_0x119583,_0x516f('0xd'));_0x32f429(_0x59dd16[_0x516f('0x15')][_0x516f('0x13')]);}})[_0x516f('0x16')](function(_0x1664b6){logger[_0x516f('0x10')](_0x516f('0x12'),_0x119583,_0x1664b6);_0x536c29(_0x1664b6);});});}exports[_0x516f('0x17')]=function(_0x5a4a0d){var _0x84af17=this;return new Promise(function(_0x243cb5,_0x4ff6f7){return db[_0x516f('0x18')]['create'](_0x5a4a0d['body'],{'raw':_0x5a4a0d[_0x516f('0x19')]?_0x5a4a0d['options'][_0x516f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x34e33a){logger[_0x516f('0x14')]('CreateVoiceDialReport',_0x5a4a0d);logger[_0x516f('0x1b')]('CreateVoiceDialReport',_0x5a4a0d,JSON[_0x516f('0xf')](_0x34e33a));_0x243cb5(_0x34e33a);})[_0x516f('0x16')](function(_0x43d252){logger[_0x516f('0x10')]('CreateVoiceDialReport',_0x43d252[_0x516f('0x13')],_0x5a4a0d);_0x4ff6f7(_0x84af17[_0x516f('0x10')](0x1f4,_0x43d252['message']));});});};exports['UpdateVoiceDialReport']=function(_0x4ae2a3){var _0x356382=this;return new Promise(function(_0x127ee0,_0x5c894a){return db['VoiceDialReport'][_0x516f('0x1c')](_0x4ae2a3[_0x516f('0x1d')],{'raw':_0x4ae2a3[_0x516f('0x19')]?_0x4ae2a3[_0x516f('0x19')][_0x516f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ae2a3[_0x516f('0x19')]?_0x4ae2a3['options'][_0x516f('0x1e')]||null:null,'attributes':_0x4ae2a3[_0x516f('0x19')]?_0x4ae2a3[_0x516f('0x19')][_0x516f('0x1f')]||null:null,'limit':_0x4ae2a3[_0x516f('0x19')]?_0x4ae2a3[_0x516f('0x19')][_0x516f('0x20')]||null:null})[_0x516f('0xc')](function(_0x2384e1){logger[_0x516f('0x14')](_0x516f('0x21'),_0x4ae2a3);logger[_0x516f('0x1b')](_0x516f('0x21'),_0x4ae2a3,JSON[_0x516f('0xf')](_0x2384e1));_0x127ee0(_0x2384e1);})[_0x516f('0x16')](function(_0x218ddb){logger[_0x516f('0x10')](_0x516f('0x21'),_0x218ddb[_0x516f('0x13')],_0x4ae2a3);_0x5c894a(_0x356382[_0x516f('0x10')](0x1f4,_0x218ddb[_0x516f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 64ab8b1..3855b18 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 _0x95ca=['fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','show','post','isAuthenticated','create','/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x95ca,0x1aa));var _0xa95c=function(_0x3c2517,_0x4b2789){_0x3c2517=_0x3c2517-0x0;var _0x5eb729=_0x95ca[_0x3c2517];return _0x5eb729;};'use strict';var multer=require(_0xa95c('0x0'));var util=require(_0xa95c('0x1'));var path=require(_0xa95c('0x2'));var timeout=require(_0xa95c('0x3'));var express=require(_0xa95c('0x4'));var router=express[_0xa95c('0x5')]();var fs_extra=require(_0xa95c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa95c('0x7'));var config=require(_0xa95c('0x8'));var controller=require(_0xa95c('0x9'));router[_0xa95c('0xa')]('/',auth['isAuthenticated'](),controller[_0xa95c('0xb')]);router[_0xa95c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa95c('0xc')]);router[_0xa95c('0xd')]('/',auth[_0xa95c('0xe')](),controller[_0xa95c('0xf')]);router[_0xa95c('0xd')](_0xa95c('0x10'),auth[_0xa95c('0xe')](),controller[_0xa95c('0x11')]);router[_0xa95c('0x12')](_0xa95c('0x13'),auth['isAuthenticated'](),controller[_0xa95c('0x14')]);router[_0xa95c('0x15')](_0xa95c('0x13'),auth[_0xa95c('0xe')](),controller[_0xa95c('0x16')]);module[_0xa95c('0x17')]=router; \ No newline at end of file +var _0x8898=['update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put'];(function(_0x1c57a5,_0x433064){var _0x3dadb9=function(_0x5cf957){while(--_0x5cf957){_0x1c57a5['push'](_0x1c57a5['shift']());}};_0x3dadb9(++_0x433064);}(_0x8898,0xfe));var _0x8889=function(_0xfe2bb1,_0x382a19){_0xfe2bb1=_0xfe2bb1-0x0;var _0x1fd1e6=_0x8898[_0xfe2bb1];return _0x1fd1e6;};'use strict';var multer=require(_0x8889('0x0'));var util=require(_0x8889('0x1'));var path=require(_0x8889('0x2'));var timeout=require(_0x8889('0x3'));var express=require('express');var router=express[_0x8889('0x4')]();var fs_extra=require(_0x8889('0x5'));var auth=require(_0x8889('0x6'));var interaction=require(_0x8889('0x7'));var config=require(_0x8889('0x8'));var controller=require(_0x8889('0x9'));router[_0x8889('0xa')]('/',auth[_0x8889('0xb')](),controller[_0x8889('0xc')]);router['get'](_0x8889('0xd'),auth[_0x8889('0xb')](),controller['show']);router[_0x8889('0xe')]('/',auth['isAuthenticated'](),controller[_0x8889('0xf')]);router[_0x8889('0xe')](_0x8889('0x10'),auth['isAuthenticated'](),controller[_0x8889('0x11')]);router[_0x8889('0x12')](_0x8889('0xd'),auth[_0x8889('0xb')](),controller[_0x8889('0x13')]);router['delete']('/:id',auth[_0x8889('0xb')](),controller['destroy']);module[_0x8889('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 16f946f..8bd7330 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 _0x24be=['BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','outbound','inbound-fax','outbound-fax','system','any'];(function(_0x1143b6,_0x3989c2){var _0x66bbd6=function(_0x1f7432){while(--_0x1f7432){_0x1143b6['push'](_0x1143b6['shift']());}};_0x66bbd6(++_0x3989c2);}(_0x24be,0xf4));var _0xe24b=function(_0x3b38e3,_0x17873a){_0x3b38e3=_0x3b38e3-0x0;var _0x3ff42b=_0x24be[_0x3b38e3];return _0x3ff42b;};'use strict';var Sequelize=require(_0xe24b('0x0'));module[_0xe24b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe24b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe24b('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe24b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xe24b('0x2')},'tag':{'type':Sequelize[_0xe24b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe24b('0x4')},'appdata':{'type':Sequelize[_0xe24b('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe24b('0x5')]('inbound',_0xe24b('0x6'),'internal',_0xe24b('0x7'),_0xe24b('0x8'),_0xe24b('0x9'),_0xe24b('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xe24b('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xe24b('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe24b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xe24b('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xe24b('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe24b('0xc')],'get':function(_0x2f5a3f){return this[_0xe24b('0xd')](_0xe24b('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xc404=['exports','STRING','compositeIndex','inbound','internal','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue'];(function(_0x5600e4,_0x425fc7){var _0x2d4082=function(_0x5aaee4){while(--_0x5aaee4){_0x5600e4['push'](_0x5600e4['shift']());}};_0x2d4082(++_0x425fc7);}(_0xc404,0x193));var _0x4c40=function(_0x19c2e0,_0x43d508){_0x19c2e0=_0x19c2e0-0x0;var _0x3d49ec=_0xc404[_0x19c2e0];return _0x3d49ec;};'use strict';var Sequelize=require('sequelize');module[_0x4c40('0x0')]={'context':{'type':Sequelize[_0x4c40('0x1')],'allowNull':![],'unique':_0x4c40('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4c40('0x1')],'allowNull':![],'unique':_0x4c40('0x2')},'priority':{'type':Sequelize[_0x4c40('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4c40('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4c40('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4c40('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x4c40('0x3'),'outbound',_0x4c40('0x4'),'inbound-fax','outbound-fax',_0x4c40('0x5'),_0x4c40('0x6')),'allowNull':![]},'description':{'type':Sequelize[_0x4c40('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c40('0x7')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4c40('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4c40('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x4c40('0x8')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4c40('0x9')]},'recordingFormat':{'type':Sequelize[_0x4c40('0x1')],'defaultValue':_0x4c40('0xa')},'answer':{'type':Sequelize[_0x4c40('0x8')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4c40('0xb')],'get':function(_0x5afeed){return this[_0x4c40('0xc')]('exten');}},'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 ad65485..950f380 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 _0xe8a8=['catch','show','params','keys','fields','includeAll','body','outbound','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','cast(priority\x20as\x20unsigned)','sendStatus','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','end','status','json','offset','undefined','count','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','findAll'];(function(_0x2bcd17,_0x435260){var _0x1b6dd1=function(_0x55a299){while(--_0x55a299){_0x2bcd17['push'](_0x2bcd17['shift']());}};_0x1b6dd1(++_0x435260);}(_0xe8a8,0x1d7));var _0x8e8a=function(_0x428761,_0x24666d){_0x428761=_0x428761-0x0;var _0x10fea4=_0xe8a8[_0x428761];return _0x10fea4;};'use strict';var _=require('lodash');var Redis=require(_0x8e8a('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x8e8a('0x1'))(_0x8e8a('0x2'));var config=require(_0x8e8a('0x3'));var db=require(_0x8e8a('0x4'))['db'];config[_0x8e8a('0x5')]=_[_0x8e8a('0x6')](config['redis'],{'host':_0x8e8a('0x7'),'port':0x18eb});var socket=require(_0x8e8a('0x8'))(new Redis(config[_0x8e8a('0x5')]));require(_0x8e8a('0x9'))[_0x8e8a('0xa')](socket);function respondWithStatusCode(_0x38eaa8,_0x57b1e8){_0x57b1e8=_0x57b1e8||0xcc;return function(_0x4f6dc9){if(_0x4f6dc9){return _0x38eaa8['sendStatus'](_0x57b1e8);}return _0x38eaa8['status'](_0x57b1e8)[_0x8e8a('0xb')]();};}function respondWithResult(_0x1cdae9,_0x2831d7){_0x2831d7=_0x2831d7||0xc8;return function(_0x17cd1a){if(_0x17cd1a){return _0x1cdae9[_0x8e8a('0xc')](_0x2831d7)[_0x8e8a('0xd')](_0x17cd1a);}};}function respondWithFilteredResult(_0x6f4c95,_0x9f7e63){return function(_0x1eb2e1){if(_0x1eb2e1){var _0x4bcb45=typeof _0x9f7e63[_0x8e8a('0xe')]===_0x8e8a('0xf')&&typeof _0x9f7e63['limit']===_0x8e8a('0xf');var _0x3ade71=_0x1eb2e1['count'];var _0x51b3db=_0x4bcb45?0x0:_0x9f7e63['offset'];var _0xa85eb9=_0x4bcb45?_0x1eb2e1[_0x8e8a('0x10')]:_0x9f7e63[_0x8e8a('0xe')]+_0x9f7e63['limit'];var _0x4e4124;if(_0xa85eb9>=_0x3ade71){_0xa85eb9=_0x3ade71;_0x4e4124=0xc8;}else{_0x4e4124=0xce;}_0x6f4c95['status'](_0x4e4124);return _0x6f4c95['set']('Content-Range',_0x51b3db+'-'+_0xa85eb9+'/'+_0x3ade71)[_0x8e8a('0xd')](_0x1eb2e1);}return null;};}function removeEntity(_0x182f73){return function(_0x965eb){if(_0x965eb){return _0x965eb[_0x8e8a('0x11')]()[_0x8e8a('0x12')](function(){var _0x11ffd0=_0x965eb[_0x8e8a('0x13')]({'plain':!![]});var _0x3a4d47=[{'name':_0x8e8a('0x14'),'value':_0x8e8a('0x15'),'ignore':![]},{'name':_0x8e8a('0x16'),'value':'outbound','ignore':![]},{'name':_0x8e8a('0x17'),'value':_0x8e8a('0x18'),'ignore':![]}];var _0x4ecc9d=_(_0x3a4d47)[_0x8e8a('0x19')](_0x8e8a('0x1a'))[_0x8e8a('0x1b')](_0x8e8a('0x1c'))[_0x8e8a('0x1c')]();if(_[_0x8e8a('0x1d')](_0x4ecc9d,_0x11ffd0[_0x8e8a('0x1e')])){return;}var _0x5768f1=_[_0x8e8a('0x1f')](_0x3a4d47,['value',_0x11ffd0[_0x8e8a('0x1e')]])['name'];return db[_0x8e8a('0x20')]['destroy']({'where':{'type':_0x5768f1,'resourceId':_0x11ffd0['id']}})[_0x8e8a('0x12')](function(){return _0x965eb;});})[_0x8e8a('0x12')](function(){_0x182f73['status'](0xcc)[_0x8e8a('0xb')]();});}};}function handleEntityNotFound(_0x4545d0){return function(_0x28b273){if(!_0x28b273){_0x4545d0['sendStatus'](0x194);}return _0x28b273;};}function handleError(_0xfca60b,_0x3a09fa){_0x3a09fa=_0x3a09fa||0x1f4;return function(_0x596a2d){logger[_0x8e8a('0x21')](_0x596a2d[_0x8e8a('0x22')]);if(_0x596a2d[_0x8e8a('0x23')]){delete _0x596a2d['name'];}_0xfca60b['status'](_0x3a09fa)['send'](_0x596a2d);};}exports['index']=function(_0x471437,_0x1037c2){var _0x11fd8b={},_0x395f68={},_0x36b06f={'count':0x0,'rows':[]};var _0x36ac7d=_[_0x8e8a('0x1b')](db[_0x8e8a('0x24')][_0x8e8a('0x25')],function(_0x195f7f){return{'name':_0x195f7f[_0x8e8a('0x26')],'type':_0x195f7f[_0x8e8a('0x1e')][_0x8e8a('0x27')]};});_0x395f68[_0x8e8a('0x28')]=_[_0x8e8a('0x1b')](_0x36ac7d,_0x8e8a('0x23'));_0x395f68[_0x8e8a('0x29')]=_['keys'](_0x471437[_0x8e8a('0x29')]);_0x395f68[_0x8e8a('0x2a')]=_[_0x8e8a('0x2b')](_0x395f68[_0x8e8a('0x28')],_0x395f68[_0x8e8a('0x29')]);_0x11fd8b[_0x8e8a('0x2c')]=_[_0x8e8a('0x2b')](_0x395f68['model'],qs['fields'](_0x471437['query']['fields']));_0x11fd8b['attributes']=_0x11fd8b[_0x8e8a('0x2c')][_0x8e8a('0x2d')]?_0x11fd8b[_0x8e8a('0x2c')]:_0x395f68[_0x8e8a('0x28')];if(!_0x471437['query'][_0x8e8a('0x2e')](_0x8e8a('0x2f'))){_0x11fd8b[_0x8e8a('0x30')]=qs['limit'](_0x471437[_0x8e8a('0x29')]['limit']);_0x11fd8b[_0x8e8a('0xe')]=qs['offset'](_0x471437[_0x8e8a('0x29')][_0x8e8a('0xe')]);}_0x11fd8b[_0x8e8a('0x31')]=qs[_0x8e8a('0x32')](_0x471437[_0x8e8a('0x29')][_0x8e8a('0x32')]);_0x11fd8b[_0x8e8a('0x33')]=qs[_0x8e8a('0x2a')](_[_0x8e8a('0x34')](_0x471437['query'],_0x395f68[_0x8e8a('0x2a')]),_0x36ac7d);if(_0x471437[_0x8e8a('0x29')][_0x8e8a('0x19')]){_0x11fd8b[_0x8e8a('0x33')]=_[_0x8e8a('0x35')](_0x11fd8b[_0x8e8a('0x33')],{'$or':_[_0x8e8a('0x1b')](_0x36ac7d,function(_0x5f4948){if(_0x5f4948['type']!==_0x8e8a('0x36')){var _0xd0b422={};_0xd0b422[_0x5f4948['name']]={'$like':'%'+_0x471437[_0x8e8a('0x29')][_0x8e8a('0x19')]+'%'};return _0xd0b422;}})});}_0x11fd8b=_['merge']({},_0x11fd8b,_0x471437[_0x8e8a('0x37')]);var _0x19a55d={'where':_0x11fd8b[_0x8e8a('0x33')]};return db['VoiceExtension'][_0x8e8a('0x10')](_0x19a55d)[_0x8e8a('0x12')](function(_0x170a3f){_0x36b06f[_0x8e8a('0x10')]=_0x170a3f;if(_0x471437[_0x8e8a('0x29')]['includeAll']){_0x11fd8b['include']=[{'all':!![]}];}return db[_0x8e8a('0x24')][_0x8e8a('0x38')](_0x11fd8b);})[_0x8e8a('0x12')](function(_0xcd7db6){_0x36b06f['rows']=_0xcd7db6;return _0x36b06f;})[_0x8e8a('0x12')](respondWithFilteredResult(_0x1037c2,_0x11fd8b))[_0x8e8a('0x39')](handleError(_0x1037c2,null));};exports[_0x8e8a('0x3a')]=function(_0x57324c,_0x3bf538){var _0x44f8ff={'raw':![],'where':{'id':_0x57324c[_0x8e8a('0x3b')]['id']}},_0x41f426={};_0x41f426[_0x8e8a('0x28')]=_[_0x8e8a('0x3c')](db['VoiceExtension'][_0x8e8a('0x25')]);_0x41f426[_0x8e8a('0x29')]=_['keys'](_0x57324c['query']);_0x41f426[_0x8e8a('0x2a')]=_[_0x8e8a('0x2b')](_0x41f426[_0x8e8a('0x28')],_0x41f426[_0x8e8a('0x29')]);_0x44f8ff['attributes']=_[_0x8e8a('0x2b')](_0x41f426[_0x8e8a('0x28')],qs[_0x8e8a('0x3d')](_0x57324c[_0x8e8a('0x29')][_0x8e8a('0x3d')]));_0x44f8ff[_0x8e8a('0x2c')]=_0x44f8ff[_0x8e8a('0x2c')]['length']?_0x44f8ff[_0x8e8a('0x2c')]:_0x41f426['model'];if(_0x57324c['query'][_0x8e8a('0x3e')]){_0x44f8ff['include']=[{'all':!![]}];}_0x44f8ff=_[_0x8e8a('0x35')]({},_0x44f8ff,_0x57324c[_0x8e8a('0x37')]);return db['VoiceExtension'][_0x8e8a('0x1f')](_0x44f8ff)[_0x8e8a('0x12')](handleEntityNotFound(_0x3bf538,null))[_0x8e8a('0x12')](respondWithResult(_0x3bf538,null))[_0x8e8a('0x39')](handleError(_0x3bf538,null));};exports[_0x8e8a('0x11')]=function(_0x4b6f9e,_0x8721f0){return db[_0x8e8a('0x24')][_0x8e8a('0x1f')]({'where':{'id':_0x4b6f9e['params']['id']}})[_0x8e8a('0x12')](handleEntityNotFound(_0x8721f0,null))[_0x8e8a('0x12')](removeEntity(_0x8721f0,null))[_0x8e8a('0x39')](handleError(_0x8721f0,null));};exports['create']=function(_0x41d844,_0xcbd7ef){if(_0x41d844[_0x8e8a('0x3f')][_0x8e8a('0x1e')]===_0x8e8a('0x40')&&!_['startsWith'](_0x41d844[_0x8e8a('0x3f')]['exten'],'_')){_0x41d844[_0x8e8a('0x3f')][_0x8e8a('0x41')]='_'[_0x8e8a('0x42')](_0x41d844[_0x8e8a('0x3f')][_0x8e8a('0x41')]);}return db[_0x8e8a('0x24')]['create'](_0x41d844[_0x8e8a('0x3f')],{'raw':![]})[_0x8e8a('0x12')](function(_0x390ce0){var _0x2cc3c3=_0x41d844['user'][_0x8e8a('0x13')]({'plain':!![]});if(!_0x2cc3c3)throw new Error(_0x8e8a('0x43'));if(_0x2cc3c3['role']===_0x8e8a('0x44')){var _0x380d5e=_0x390ce0[_0x8e8a('0x13')]({'plain':!![]});var _0x1d8a9f=[{'name':_0x8e8a('0x14'),'value':_0x8e8a('0x15')},{'name':_0x8e8a('0x16'),'value':_0x8e8a('0x40')},{'name':_0x8e8a('0x17'),'value':_0x8e8a('0x18')}];var _0x264ab9=_[_0x8e8a('0x1f')](_0x1d8a9f,[_0x8e8a('0x1c'),_0x380d5e[_0x8e8a('0x1e')]])['name'];return db[_0x8e8a('0x45')][_0x8e8a('0x1f')]({'where':{'name':_0x264ab9,'userProfileId':_0x2cc3c3[_0x8e8a('0x46')]},'raw':!![]})[_0x8e8a('0x12')](function(_0x508d7a){if(_0x508d7a&&_0x508d7a[_0x8e8a('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x380d5e[_0x8e8a('0x23')],'resourceId':_0x380d5e['id'],'type':_0x508d7a[_0x8e8a('0x23')],'sectionId':_0x508d7a['id']},{})[_0x8e8a('0x12')](function(){return _0x390ce0;});}else{return _0x390ce0;}})[_0x8e8a('0x39')](function(_0x5d92a4){logger[_0x8e8a('0x21')](_0x8e8a('0x48'),_0x5d92a4);throw _0x5d92a4;});}return _0x390ce0;})[_0x8e8a('0x12')](respondWithResult(_0xcbd7ef,0xc9))[_0x8e8a('0x39')](handleError(_0xcbd7ef,null));};exports[_0x8e8a('0x49')]=function(_0x190ea9,_0x59efc4){if(_0x190ea9[_0x8e8a('0x3f')]['id']){delete _0x190ea9[_0x8e8a('0x3f')]['id'];}return db['VoiceExtension'][_0x8e8a('0x1f')]({'where':{'id':_0x190ea9['params']['id']}})[_0x8e8a('0x12')](handleEntityNotFound(_0x59efc4,null))['then'](function(_0x2b4774){if(_0x2b4774){return db['VoiceExtension']['update'](_[_0x8e8a('0x34')](_0x190ea9[_0x8e8a('0x3f')],[_0x8e8a('0x41'),_0x8e8a('0x4a'),'description',_0x8e8a('0x4b'),_0x8e8a('0x4c'),'mandatoryDisposition','alias']),{'where':{'context':_0x2b4774[_0x8e8a('0x4a')],'exten':_0x2b4774[_0x8e8a('0x41')]},'individualHooks':!![]})[_0x8e8a('0x12')](function(_0x4432a8){return _0x4432a8;});}return null;})[_0x8e8a('0x12')](respondWithStatusCode(_0x59efc4,null))[_0x8e8a('0x39')](handleError(_0x59efc4,null));};exports[_0x8e8a('0x4d')]=function(_0x234f94,_0x562baa){var _0x48ba88=_0x234f94['params']['id'];var _0x2e8ae4=_0x234f94[_0x8e8a('0x3f')];var _0xa421f7=0xc8;var _0x54351f=null;return db['sequelize'][_0x8e8a('0x4e')]({'isolationLevel':db[_0x8e8a('0x4f')]['Transaction'][_0x8e8a('0x50')][_0x8e8a('0x51')]},function(_0x309dfd){return db[_0x8e8a('0x24')][_0x8e8a('0x52')]({'where':{'id':_0x48ba88},'transaction':_0x309dfd})[_0x8e8a('0x12')](function(_0x52d965){if(_0x52d965){return db[_0x8e8a('0x24')][_0x8e8a('0x11')]({'where':{'VoiceExtensionId':_0x48ba88},'transaction':_0x309dfd})[_0x8e8a('0x12')](function(){var _0x3f5b14=_[_0x8e8a('0x1b')](_0x2e8ae4,function(_0x2021e5){_0x2021e5[_0x8e8a('0x53')]=_0x48ba88;_0x2021e5[_0x8e8a('0x54')]=!![];return _0x2021e5;});return _0x52d965[_0x8e8a('0x55')](_0x3f5b14);})[_0x8e8a('0x12')](function(_0x483762){return db[_0x8e8a('0x24')]['bulkCreate'](_0x483762,{'transaction':_0x309dfd});});}else{_0xa421f7=0x194;_0x54351f=[];}});})[_0x8e8a('0x12')](function(){if(_0xa421f7!==0x194){return db[_0x8e8a('0x24')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x48ba88},'order':_0x8e8a('0x56')})[_0x8e8a('0x12')](function(_0x196a29){_0x54351f=_0x196a29;});}})[_0x8e8a('0x39')](function(_0x31725d){_0xa421f7=0x1f4;logger['error'](_0x31725d['stack']);if(_0x31725d[_0x8e8a('0x23')]){delete _0x31725d[_0x8e8a('0x23')];}_0x54351f=_0x31725d;})['finally'](function(){if(_0x54351f===null){_0x562baa[_0x8e8a('0x57')](_0xa421f7);}else{if(_0xa421f7===0x1f4){_0x562baa['status'](_0xa421f7)['send'](_0x54351f);}else{_0x562baa['status'](_0xa421f7)[_0x8e8a('0xd')](_0x54351f);}}});}; \ No newline at end of file +var _0xcf65=['api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','limit','undefined','count','offset','Content-Range','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','fields','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','sequelize','transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','finally','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x29969b,_0x2982c4){var _0x16bdad=function(_0x4ad3b5){while(--_0x4ad3b5){_0x29969b['push'](_0x29969b['shift']());}};_0x16bdad(++_0x2982c4);}(_0xcf65,0xb1));var _0x5cf6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xcf65[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var Redis=require(_0x5cf6('0x0'));var qs=require(_0x5cf6('0x1'));var logger=require(_0x5cf6('0x2'))(_0x5cf6('0x3'));var config=require(_0x5cf6('0x4'));var db=require('../../mysqldb')['db'];config[_0x5cf6('0x5')]=_['defaults'](config['redis'],{'host':_0x5cf6('0x6'),'port':0x18eb});var socket=require(_0x5cf6('0x7'))(new Redis(config[_0x5cf6('0x5')]));require(_0x5cf6('0x8'))[_0x5cf6('0x9')](socket);function respondWithStatusCode(_0x1538d6,_0x3f561f){_0x3f561f=_0x3f561f||0xcc;return function(_0x2bde9b){if(_0x2bde9b){return _0x1538d6['sendStatus'](_0x3f561f);}return _0x1538d6[_0x5cf6('0xa')](_0x3f561f)['end']();};}function respondWithResult(_0x42c136,_0xcf7979){_0xcf7979=_0xcf7979||0xc8;return function(_0x5b291c){if(_0x5b291c){return _0x42c136[_0x5cf6('0xa')](_0xcf7979)[_0x5cf6('0xb')](_0x5b291c);}};}function respondWithFilteredResult(_0x53699e,_0xc642d1){return function(_0x49e998){if(_0x49e998){var _0x31db9f=typeof _0xc642d1['offset']==='undefined'&&typeof _0xc642d1[_0x5cf6('0xc')]===_0x5cf6('0xd');var _0x45ac69=_0x49e998[_0x5cf6('0xe')];var _0x50d561=_0x31db9f?0x0:_0xc642d1[_0x5cf6('0xf')];var _0x52dc74=_0x31db9f?_0x49e998[_0x5cf6('0xe')]:_0xc642d1[_0x5cf6('0xf')]+_0xc642d1['limit'];var _0x28af92;if(_0x52dc74>=_0x45ac69){_0x52dc74=_0x45ac69;_0x28af92=0xc8;}else{_0x28af92=0xce;}_0x53699e[_0x5cf6('0xa')](_0x28af92);return _0x53699e['set'](_0x5cf6('0x10'),_0x50d561+'-'+_0x52dc74+'/'+_0x45ac69)['json'](_0x49e998);}return null;};}function removeEntity(_0x104218){return function(_0x6134fd){if(_0x6134fd){return _0x6134fd[_0x5cf6('0x11')]()[_0x5cf6('0x12')](function(){var _0x4ec823=_0x6134fd[_0x5cf6('0x13')]({'plain':!![]});var _0x541b89=[{'name':_0x5cf6('0x14'),'value':_0x5cf6('0x15'),'ignore':![]},{'name':'OutboundRoutes','value':_0x5cf6('0x16'),'ignore':![]},{'name':_0x5cf6('0x17'),'value':_0x5cf6('0x18'),'ignore':![]}];var _0x538a70=_(_0x541b89)[_0x5cf6('0x19')]('ignore')['map'](_0x5cf6('0x1a'))[_0x5cf6('0x1a')]();if(_[_0x5cf6('0x1b')](_0x538a70,_0x4ec823[_0x5cf6('0x1c')])){return;}var _0x24d94e=_[_0x5cf6('0x1d')](_0x541b89,[_0x5cf6('0x1a'),_0x4ec823['type']])[_0x5cf6('0x1e')];return db[_0x5cf6('0x1f')][_0x5cf6('0x11')]({'where':{'type':_0x24d94e,'resourceId':_0x4ec823['id']}})[_0x5cf6('0x12')](function(){return _0x6134fd;});})[_0x5cf6('0x12')](function(){_0x104218[_0x5cf6('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5897a7){return function(_0x56b176){if(!_0x56b176){_0x5897a7[_0x5cf6('0x20')](0x194);}return _0x56b176;};}function handleError(_0x2c5cba,_0x1d049f){_0x1d049f=_0x1d049f||0x1f4;return function(_0x98656b){logger[_0x5cf6('0x21')](_0x98656b[_0x5cf6('0x22')]);if(_0x98656b[_0x5cf6('0x1e')]){delete _0x98656b[_0x5cf6('0x1e')];}_0x2c5cba[_0x5cf6('0xa')](_0x1d049f)[_0x5cf6('0x23')](_0x98656b);};}exports['index']=function(_0x3d3616,_0x19d832){var _0xc159e4={},_0x2b3801={},_0x5ec923={'count':0x0,'rows':[]};var _0x477c92=_[_0x5cf6('0x24')](db[_0x5cf6('0x25')][_0x5cf6('0x26')],function(_0x5b6cb0){return{'name':_0x5b6cb0[_0x5cf6('0x27')],'type':_0x5b6cb0['type'][_0x5cf6('0x28')]};});_0x2b3801[_0x5cf6('0x29')]=_[_0x5cf6('0x24')](_0x477c92,_0x5cf6('0x1e'));_0x2b3801[_0x5cf6('0x2a')]=_[_0x5cf6('0x2b')](_0x3d3616[_0x5cf6('0x2a')]);_0x2b3801['filters']=_[_0x5cf6('0x2c')](_0x2b3801[_0x5cf6('0x29')],_0x2b3801[_0x5cf6('0x2a')]);_0xc159e4['attributes']=_[_0x5cf6('0x2c')](_0x2b3801['model'],qs['fields'](_0x3d3616[_0x5cf6('0x2a')]['fields']));_0xc159e4[_0x5cf6('0x2d')]=_0xc159e4[_0x5cf6('0x2d')][_0x5cf6('0x2e')]?_0xc159e4[_0x5cf6('0x2d')]:_0x2b3801['model'];if(!_0x3d3616[_0x5cf6('0x2a')][_0x5cf6('0x2f')](_0x5cf6('0x30'))){_0xc159e4['limit']=qs[_0x5cf6('0xc')](_0x3d3616['query']['limit']);_0xc159e4['offset']=qs['offset'](_0x3d3616[_0x5cf6('0x2a')]['offset']);}_0xc159e4[_0x5cf6('0x31')]=qs[_0x5cf6('0x32')](_0x3d3616[_0x5cf6('0x2a')]['sort']);_0xc159e4[_0x5cf6('0x33')]=qs[_0x5cf6('0x34')](_[_0x5cf6('0x35')](_0x3d3616['query'],_0x2b3801[_0x5cf6('0x34')]),_0x477c92);if(_0x3d3616[_0x5cf6('0x2a')][_0x5cf6('0x19')]){_0xc159e4[_0x5cf6('0x33')]=_['merge'](_0xc159e4[_0x5cf6('0x33')],{'$or':_['map'](_0x477c92,function(_0x42258b){if(_0x42258b[_0x5cf6('0x1c')]!==_0x5cf6('0x36')){var _0x49c924={};_0x49c924[_0x42258b[_0x5cf6('0x1e')]]={'$like':'%'+_0x3d3616[_0x5cf6('0x2a')][_0x5cf6('0x19')]+'%'};return _0x49c924;}})});}_0xc159e4=_[_0x5cf6('0x37')]({},_0xc159e4,_0x3d3616[_0x5cf6('0x38')]);var _0x20a203={'where':_0xc159e4[_0x5cf6('0x33')]};return db[_0x5cf6('0x25')][_0x5cf6('0xe')](_0x20a203)[_0x5cf6('0x12')](function(_0xf0092){_0x5ec923[_0x5cf6('0xe')]=_0xf0092;if(_0x3d3616[_0x5cf6('0x2a')][_0x5cf6('0x39')]){_0xc159e4['include']=[{'all':!![]}];}return db[_0x5cf6('0x25')][_0x5cf6('0x3a')](_0xc159e4);})[_0x5cf6('0x12')](function(_0x21278e){_0x5ec923[_0x5cf6('0x3b')]=_0x21278e;return _0x5ec923;})[_0x5cf6('0x12')](respondWithFilteredResult(_0x19d832,_0xc159e4))[_0x5cf6('0x3c')](handleError(_0x19d832,null));};exports[_0x5cf6('0x3d')]=function(_0x1d6ffd,_0x7b2d93){var _0x345e89={'raw':![],'where':{'id':_0x1d6ffd[_0x5cf6('0x3e')]['id']}},_0x1f3314={};_0x1f3314[_0x5cf6('0x29')]=_['keys'](db[_0x5cf6('0x25')]['rawAttributes']);_0x1f3314[_0x5cf6('0x2a')]=_[_0x5cf6('0x2b')](_0x1d6ffd[_0x5cf6('0x2a')]);_0x1f3314['filters']=_[_0x5cf6('0x2c')](_0x1f3314[_0x5cf6('0x29')],_0x1f3314[_0x5cf6('0x2a')]);_0x345e89[_0x5cf6('0x2d')]=_[_0x5cf6('0x2c')](_0x1f3314['model'],qs[_0x5cf6('0x3f')](_0x1d6ffd[_0x5cf6('0x2a')][_0x5cf6('0x3f')]));_0x345e89[_0x5cf6('0x2d')]=_0x345e89[_0x5cf6('0x2d')][_0x5cf6('0x2e')]?_0x345e89[_0x5cf6('0x2d')]:_0x1f3314[_0x5cf6('0x29')];if(_0x1d6ffd[_0x5cf6('0x2a')]['includeAll']){_0x345e89['include']=[{'all':!![]}];}_0x345e89=_[_0x5cf6('0x37')]({},_0x345e89,_0x1d6ffd[_0x5cf6('0x38')]);return db[_0x5cf6('0x25')][_0x5cf6('0x1d')](_0x345e89)[_0x5cf6('0x12')](handleEntityNotFound(_0x7b2d93,null))['then'](respondWithResult(_0x7b2d93,null))['catch'](handleError(_0x7b2d93,null));};exports['destroy']=function(_0x116f76,_0x344c5c){return db[_0x5cf6('0x25')][_0x5cf6('0x1d')]({'where':{'id':_0x116f76[_0x5cf6('0x3e')]['id']}})[_0x5cf6('0x12')](handleEntityNotFound(_0x344c5c,null))[_0x5cf6('0x12')](removeEntity(_0x344c5c,null))[_0x5cf6('0x3c')](handleError(_0x344c5c,null));};exports[_0x5cf6('0x40')]=function(_0x229e8e,_0x2dde25){if(_0x229e8e[_0x5cf6('0x41')][_0x5cf6('0x1c')]==='outbound'&&!_[_0x5cf6('0x42')](_0x229e8e[_0x5cf6('0x41')][_0x5cf6('0x43')],'_')){_0x229e8e['body']['exten']='_'['concat'](_0x229e8e[_0x5cf6('0x41')][_0x5cf6('0x43')]);}return db[_0x5cf6('0x25')][_0x5cf6('0x40')](_0x229e8e[_0x5cf6('0x41')],{'raw':![]})['then'](function(_0x14867e){var _0x4003e7=_0x229e8e[_0x5cf6('0x44')][_0x5cf6('0x13')]({'plain':!![]});if(!_0x4003e7)throw new Error(_0x5cf6('0x45'));if(_0x4003e7[_0x5cf6('0x46')]===_0x5cf6('0x44')){var _0x220eba=_0x14867e['get']({'plain':!![]});var _0x1a1d4f=[{'name':_0x5cf6('0x14'),'value':_0x5cf6('0x15')},{'name':_0x5cf6('0x47'),'value':'outbound'},{'name':_0x5cf6('0x17'),'value':'internal'}];var _0x1696b3=_[_0x5cf6('0x1d')](_0x1a1d4f,['value',_0x220eba[_0x5cf6('0x1c')]])['name'];return db['UserProfileSection'][_0x5cf6('0x1d')]({'where':{'name':_0x1696b3,'userProfileId':_0x4003e7[_0x5cf6('0x48')]},'raw':!![]})[_0x5cf6('0x12')](function(_0x51e613){if(_0x51e613&&_0x51e613[_0x5cf6('0x49')]===0x0){return db['UserProfileResource'][_0x5cf6('0x40')]({'name':_0x220eba['name'],'resourceId':_0x220eba['id'],'type':_0x51e613[_0x5cf6('0x1e')],'sectionId':_0x51e613['id']},{})['then'](function(){return _0x14867e;});}else{return _0x14867e;}})[_0x5cf6('0x3c')](function(_0x564e79){logger[_0x5cf6('0x21')](_0x5cf6('0x4a'),_0x564e79);throw _0x564e79;});}return _0x14867e;})[_0x5cf6('0x12')](respondWithResult(_0x2dde25,0xc9))[_0x5cf6('0x3c')](handleError(_0x2dde25,null));};exports['update']=function(_0x3dee93,_0x421e15){if(_0x3dee93[_0x5cf6('0x41')]['id']){delete _0x3dee93['body']['id'];}return db[_0x5cf6('0x25')][_0x5cf6('0x1d')]({'where':{'id':_0x3dee93['params']['id']}})[_0x5cf6('0x12')](handleEntityNotFound(_0x421e15,null))['then'](function(_0x16098f){if(_0x16098f){return db[_0x5cf6('0x25')][_0x5cf6('0x4b')](_[_0x5cf6('0x35')](_0x3dee93[_0x5cf6('0x41')],['exten','context',_0x5cf6('0x4c'),_0x5cf6('0x4d'),_0x5cf6('0x4e'),_0x5cf6('0x4f'),'alias']),{'where':{'context':_0x16098f[_0x5cf6('0x50')],'exten':_0x16098f[_0x5cf6('0x43')]},'individualHooks':!![]})[_0x5cf6('0x12')](function(_0x436be3){return _0x436be3;});}return null;})[_0x5cf6('0x12')](respondWithStatusCode(_0x421e15,null))[_0x5cf6('0x3c')](handleError(_0x421e15,null));};exports['addApplications']=function(_0x35af92,_0x4a0a0d){var _0x1f0a38=_0x35af92['params']['id'];var _0x1cb6d9=_0x35af92[_0x5cf6('0x41')];var _0x42c945=0xc8;var _0x447d4f=null;return db[_0x5cf6('0x51')][_0x5cf6('0x52')]({'isolationLevel':db[_0x5cf6('0x51')]['Transaction']['ISOLATION_LEVELS'][_0x5cf6('0x53')]},function(_0x444fe2){return db['VoiceExtension'][_0x5cf6('0x54')]({'where':{'id':_0x1f0a38},'transaction':_0x444fe2})[_0x5cf6('0x12')](function(_0x4087eb){if(_0x4087eb){return db['VoiceExtension'][_0x5cf6('0x11')]({'where':{'VoiceExtensionId':_0x1f0a38},'transaction':_0x444fe2})[_0x5cf6('0x12')](function(){var _0x55d553=_[_0x5cf6('0x24')](_0x1cb6d9,function(_0x5f5c16){_0x5f5c16[_0x5cf6('0x55')]=_0x1f0a38;_0x5f5c16[_0x5cf6('0x56')]=!![];return _0x5f5c16;});return _0x4087eb[_0x5cf6('0x57')](_0x55d553);})[_0x5cf6('0x12')](function(_0x57388f){return db[_0x5cf6('0x25')]['bulkCreate'](_0x57388f,{'transaction':_0x444fe2});});}else{_0x42c945=0x194;_0x447d4f=[];}});})['then'](function(){if(_0x42c945!==0x194){return db['VoiceExtension'][_0x5cf6('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1f0a38},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x3c9534){_0x447d4f=_0x3c9534;});}})['catch'](function(_0x586aaf){_0x42c945=0x1f4;logger[_0x5cf6('0x21')](_0x586aaf[_0x5cf6('0x22')]);if(_0x586aaf[_0x5cf6('0x1e')]){delete _0x586aaf[_0x5cf6('0x1e')];}_0x447d4f=_0x586aaf;})[_0x5cf6('0x59')](function(){if(_0x447d4f===null){_0x4a0a0d[_0x5cf6('0x20')](_0x42c945);}else{if(_0x42c945===0x1f4){_0x4a0a0d[_0x5cf6('0xa')](_0x42c945)[_0x5cf6('0x23')](_0x447d4f);}else{_0x4a0a0d[_0x5cf6('0xa')](_0x42c945)['json'](_0x447d4f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 11f2d29..faf8f66 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 _0xefef=['VoiceExtension','save','update','remove','hook','exports','events'];(function(_0x20259c,_0xe43fb2){var _0x4d988e=function(_0x2097b9){while(--_0x2097b9){_0x20259c['push'](_0x20259c['shift']());}};_0x4d988e(++_0xe43fb2);}(_0xefef,0x1e2));var _0xfefe=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xefef[_0x3b90ab];return _0x206e92;};'use strict';var EventEmitter=require(_0xfefe('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xfefe('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfefe('0x2'),'afterUpdate':_0xfefe('0x3'),'afterDestroy':_0xfefe('0x4')};function emitEvent(_0x4a8269){return function(_0x5e1fdb,_0x15ceb6,_0x56d311){VoiceExtensionEvents['emit'](_0x4a8269+':'+_0x5e1fdb['id'],_0x5e1fdb);VoiceExtensionEvents['emit'](_0x4a8269,_0x5e1fdb);_0x56d311(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xfefe('0x5')](e,emitEvent(event));}}module[_0xfefe('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0xefaa=['save','remove','emit','hasOwnProperty','events','VoiceExtension','setMaxListeners'];(function(_0x20b1ff,_0x210fa0){var _0x34b503=function(_0x5eeef4){while(--_0x5eeef4){_0x20b1ff['push'](_0x20b1ff['shift']());}};_0x34b503(++_0x210fa0);}(_0xefaa,0x13f));var _0xaefa=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xefaa[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require(_0xaefa('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xaefa('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xaefa('0x2')](0x0);var events={'afterCreate':_0xaefa('0x3'),'afterUpdate':'update','afterDestroy':_0xaefa('0x4')};function emitEvent(_0x5b52fc){return function(_0x47ec34,_0x4ad082,_0x3b752f){VoiceExtensionEvents['emit'](_0x5b52fc+':'+_0x47ec34['id'],_0x47ec34);VoiceExtensionEvents[_0xaefa('0x5')](_0x5b52fc,_0x47ec34);_0x3b752f(null);};}for(var e in events){if(events[_0xaefa('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 70bdadf..72d643b 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 _0xc0e1=['alias','NoOp','No\x20alias\x20set','push','inbound','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','split','length','name','trunk','phone','prefix','${EXTEN}','SIP','join','param','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','filter','toLowerCase','tag','CDR(tag)=','intervals','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','catch','define','VoiceExtension','voice_extensions','get','last','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten'];(function(_0xf4c952,_0x5a3e7c){var _0x262fb2=function(_0x443903){while(--_0x443903){_0xf4c952['push'](_0xf4c952['shift']());}};_0x262fb2(++_0x5a3e7c);}(_0xc0e1,0x147));var _0x1c0e=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0xc0e1[_0x82140];return _0x2b15a6;};'use strict';var _=require(_0x1c0e('0x0'));var attributes=require(_0x1c0e('0x1'));module[_0x1c0e('0x2')]=function(_0x5cbf58){var _0x3b4725=_0x5cbf58[_0x1c0e('0x3')];function _0x286c95(_0x2150a5){var _0x157736=0x2;var _0x42606e=[{'type':_0x2150a5[_0x1c0e('0x4')],'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x6')+_0x2150a5[_0x1c0e('0x4')],'context':_0x2150a5[_0x1c0e('0x7')],'exten':_0x2150a5[_0x1c0e('0x8')],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']},{'type':_0x2150a5[_0x1c0e('0x4')],'app':_0x2150a5[_0x1c0e('0x9')]?'Set':_0x1c0e('0xa'),'appdata':_0x2150a5[_0x1c0e('0x9')]?'CDR(routeAlias)='+_0x2150a5['alias']:_0x1c0e('0xb'),'context':_0x2150a5[_0x1c0e('0x7')],'exten':_0x2150a5[_0x1c0e('0x8')],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']}];if(_0x2150a5['type']==='inbound'){_0x42606e[_0x1c0e('0xc')]({'type':_0x1c0e('0xd'),'app':_0x1c0e('0x5'),'appdata':'CDR(routeid)='+_0x2150a5['id'],'context':_0x2150a5['context'],'exten':_0x2150a5['exten'],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']});}_0x42606e['push']({'type':_0x2150a5[_0x1c0e('0x4')],'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0xe'),'context':_0x2150a5[_0x1c0e('0x7')],'exten':_0x2150a5[_0x1c0e('0x8')],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']},{'type':_0x2150a5[_0x1c0e('0x4')],'app':_0x1c0e('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2150a5['context'],'exten':_0x2150a5[_0x1c0e('0x8')],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']},{'type':_0x2150a5['type'],'app':_0x1c0e('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2150a5[_0x1c0e('0x7')],'exten':_0x2150a5[_0x1c0e('0x8')],'priority':_0x157736++,'VoiceExtensionId':_0x2150a5['id']});return _0x42606e;}function _0x449c7d(_0x2b2fa6){var _0x20fb5b=0x2;var _0x3b0f76=[{'type':_0x1c0e('0xf'),'app':'Set','appdata':_0x1c0e('0x10'),'context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x2b2fa6[_0x1c0e('0x9')]?'Set':_0x1c0e('0xa'),'appdata':_0x2b2fa6[_0x1c0e('0x9')]?'CDR(routeAlias)='+_0x2b2fa6[_0x1c0e('0x9')]:_0x1c0e('0xb'),'context':_0x2b2fa6['context'],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x11')+(_0x2b2fa6[_0x1c0e('0x12')]?_0x1c0e('0x13')+_0x2b2fa6[_0x1c0e('0x12')]+'}':'${EXTEN}'),'context':_0x2b2fa6['context'],'exten':_0x2b2fa6['exten'],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x14')+_0x2b2fa6['id'],'context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6['exten'],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x15'),'appdata':_0x1c0e('0x16')+(_0x20fb5b+0x2)+'):Goto('+(_0x20fb5b+0x1)+')','context':_0x2b2fa6['context'],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':_0x2b2fa6['cutdigits']?_0x1c0e('0x17')+_0x2b2fa6[_0x1c0e('0x12')]+'}':_0x1c0e('0x18'),'context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6['exten'],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2b2fa6['context'],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':'outbound','app':_0x1c0e('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x19'),'context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x2b2fa6['id'],'context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']}];if(_0x2b2fa6[_0x1c0e('0x1a')]('recordingFormat')&&_0x2b2fa6[_0x1c0e('0x1b')]!==_0x1c0e('0x1c')){_0x3b0f76['push']({'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6['exten'],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']},{'type':_0x1c0e('0xf'),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x1d')+_0x2b2fa6[_0x1c0e('0x1b')]||'wav','context':_0x2b2fa6[_0x1c0e('0x7')],'exten':_0x2b2fa6[_0x1c0e('0x8')],'priority':_0x20fb5b++,'VoiceExtensionId':_0x2b2fa6['id']});}return _0x3b0f76;}function _0x4f65b7(_0x5ed582,_0x4bd77c){var _0x3adbcb=[{'name':'trunk','param':0x0},{'name':_0x1c0e('0x1e'),'param':0x1},{'name':_0x1c0e('0x1f'),'param':0x2},{'name':_0x1c0e('0x20'),'param':0x3}];var _0x5abaa1={};var _0x19840f=_0x4bd77c[_0x1c0e('0x21')](',');var _0x681f32=[];for(var _0x464905=0x0;_0x464905<_0x3adbcb[_0x1c0e('0x22')];_0x464905++){switch(_0x3adbcb[_0x464905][_0x1c0e('0x23')]){case'trunk':_0x5abaa1[_0x1c0e('0x24')]=_0x19840f[_0x3adbcb[_0x464905]['param']][_0x1c0e('0x21')]('/')[0x1];_0x5abaa1[_0x1c0e('0x25')]=_0x19840f[_0x3adbcb[_0x464905]['param']]['split']('/')[0x2];_0x5abaa1[_0x1c0e('0x26')]=_0x5abaa1[_0x1c0e('0x25')]?_0x5abaa1[_0x1c0e('0x25')]['split']('$')[0x0]:undefined;_0x5abaa1['phone']=_0x5ed582['cutdigits']?(_0x5abaa1[_0x1c0e('0x26')]||'')+_0x1c0e('0x13')+_0x5ed582[_0x1c0e('0x12')]+'}':(_0x5abaa1[_0x1c0e('0x26')]||'')+_0x1c0e('0x27');_0x681f32[_0x3adbcb[_0x464905]['param']]=[_0x1c0e('0x28'),_0x5abaa1[_0x1c0e('0x24')],_0x5abaa1[_0x1c0e('0x25')]][_0x1c0e('0x29')]('/');break;case _0x1c0e('0x1f'):_0x5abaa1[_0x1c0e('0x1f')]=_0x19840f[_0x3adbcb[_0x464905][_0x1c0e('0x2a')]];if(_0x5ed582[_0x1c0e('0x1b')]!==_0x1c0e('0x1c')){if(_0x5abaa1[_0x1c0e('0x1f')][_0x1c0e('0x2b')](_0x1c0e('0x2c'))<0x0){_0x5abaa1[_0x1c0e('0x1f')]+=_0x1c0e('0x2c');}}else{_0x5abaa1[_0x1c0e('0x1f')]=_0x5abaa1[_0x1c0e('0x1f')][_0x1c0e('0x2d')](_0x1c0e('0x2c'),'');}_0x681f32[_0x3adbcb[_0x464905][_0x1c0e('0x2a')]]=_0x5abaa1[_0x1c0e('0x1f')];break;default:_0x681f32[_0x3adbcb[_0x464905][_0x1c0e('0x2a')]]=_0x19840f[_0x3adbcb[_0x464905]['param']];}}return _0x681f32[_0x1c0e('0x29')](',');}function _0x6a10fb(_0xac4a5b,_0x413b26,_0x226544){return new Promise(function(_0x55a112,_0x3f0931){var _0x5b5b1d=[];if(_[_0x1c0e('0x2e')](_0x413b26))return _0x55a112(_0x5b5b1d);_0x3b4725[_0x1c0e('0x2f')][_0x1c0e('0x30')]({'attributes':['id',_0x1c0e('0x31'),_0x1c0e('0x32')],'raw':!![]})['then'](function(_0x5f522d){for(var _0x39fda0=0x0,_0x452f47=0x0;_0x39fda0<_0x413b26[_0x1c0e('0x22')];_0x39fda0++,_0x452f47=0x0){var _0x111ca8=_0x413b26[_0x39fda0];var _0x1e012d=[];var _0x4097c2=[];delete _0x111ca8['id'];if(_0x111ca8['interval']!==_0x1c0e('0x33')){_0x111ca8['intervals']=[_0x111ca8[_0x1c0e('0x31')]];}else{_0x111ca8['intervals']=_0x111ca8[_0x1c0e('0x32')]?_['map'](_[_0x1c0e('0x34')](_0x5f522d,{'IntervalId':_0x111ca8[_0x1c0e('0x32')]}),_0x1c0e('0x31')):[];}_0x111ca8[_0x1c0e('0x7')]=_0xac4a5b[_0x1c0e('0x7')];_0x111ca8['exten']=_0xac4a5b[_0x1c0e('0x8')];if(_0x111ca8['type'])_0x111ca8[_0x1c0e('0x4')]=_0x111ca8[_0x1c0e('0x4')][_0x1c0e('0x35')]();if(_0xac4a5b[_0x1c0e('0x4')]===_0x1c0e('0xf')){if(_0x111ca8[_0x1c0e('0x1a')](_0x1c0e('0x36'))&&_0x111ca8[_0x1c0e('0x36')]&&_0x111ca8[_0x1c0e('0x36')]!=='--'){_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8['type'][_0x1c0e('0x35')](),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x37')+_0x111ca8[_0x1c0e('0x36')],'context':_0xac4a5b[_0x1c0e('0x7')],'exten':_0xac4a5b[_0x1c0e('0x8')],'priority':_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});}_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8[_0x1c0e('0x4')]['toLowerCase'](),'app':_0x1c0e('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x111ca8['callerID']?_0x1c0e('0x39')+_0x111ca8[_0x1c0e('0x3a')]+')':_0x1c0e('0x3b')),'context':_0xac4a5b[_0x1c0e('0x7')],'exten':_0xac4a5b[_0x1c0e('0x8')],'priority':_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});}else{if(_0x111ca8[_0x1c0e('0x1a')](_0x1c0e('0x3c'))){if([_0x1c0e('0x3d'),'playback'][_0x1c0e('0x3e')](_0x111ca8[_0x1c0e('0x3f')][_0x1c0e('0x35')]())&&_0x111ca8[_0x1c0e('0x40')]!==_0x1c0e('0x41')){if(_0x111ca8[_0x1c0e('0x3c')]){_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8[_0x1c0e('0x4')]['toLowerCase'](),'app':_0x1c0e('0x15'),'appdata':_0x1c0e('0x42'),'context':_0xac4a5b['context'],'exten':_0xac4a5b[_0x1c0e('0x8')],'priority':_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8[_0x1c0e('0x4')][_0x1c0e('0x35')](),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x43'),'context':_0xac4a5b[_0x1c0e('0x7')],'exten':_0xac4a5b[_0x1c0e('0x8')],'priority':_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});}else{_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8[_0x1c0e('0x4')][_0x1c0e('0x35')](),'app':'ExecIf','appdata':_0x1c0e('0x44'),'context':_0xac4a5b[_0x1c0e('0x7')],'exten':_0xac4a5b[_0x1c0e('0x8')],'priority':_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});_0x1e012d[_0x1c0e('0xc')]({'type':_0x111ca8[_0x1c0e('0x4')][_0x1c0e('0x35')](),'app':_0x1c0e('0x5'),'appdata':_0x1c0e('0x45'),'context':_0xac4a5b[_0x1c0e('0x7')],'exten':_0xac4a5b['exten'],'priority':_0x111ca8[_0x1c0e('0x38')]['length']+_0x226544+_0x452f47++,'VoiceExtensionId':_0xac4a5b['id']});}}}}for(var _0x10ad63=0x0;_0x10ad63<_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')];_0x10ad63++){var _0x3916b1=_0x226544+_0x111ca8['intervals'][_0x1c0e('0x22')];var _0x222c5c=_0x10ad63===_0x111ca8[_0x1c0e('0x38')][_0x1c0e('0x22')]-0x1?_0x226544+_0x1e012d['length']+_0x4097c2[_0x1c0e('0x22')]+0x2:_0x226544+_0x10ad63+0x1;_0x1e012d[_0x1c0e('0x46')](_0x10ad63,0x0,{'type':_0xac4a5b['type'],'app':_0x1c0e('0x47'),'appdata':_0x111ca8[_0x1c0e('0x38')][_0x10ad63]+'?'+_0xac4a5b[_0x1c0e('0x7')]+_0x1c0e('0x48')+_0x3916b1+':'+_0xac4a5b['context']+_0x1c0e('0x48')+_0x222c5c,'exten':_0xac4a5b[_0x1c0e('0x8')],'context':_0xac4a5b[_0x1c0e('0x7')],'priority':_0x226544+_0x10ad63,'VoiceExtensionId':_0xac4a5b['id']});}if(_0x111ca8[_0x1c0e('0x40')]===_0x1c0e('0x49'))_0x111ca8[_0x1c0e('0x4a')]=_0x4f65b7(_0xac4a5b,_0x111ca8[_0x1c0e('0x4a')]);_0x111ca8[_0x1c0e('0x4b')]=_0x1e012d['length']?_['last'](_0x1e012d)['priority']+0x1:_0x226544;_0x5b5b1d=_['concat'](_0x5b5b1d,_0x1e012d,[_0x111ca8],_0x4097c2);_0x226544=_['last'](_0x5b5b1d)[_0x1c0e('0x4b')]+0x1;}return _0x55a112(_0x5b5b1d);})[_0x1c0e('0x4c')](function(_0x502214){_0x3f0931(_0x502214);});});}return _0x5cbf58[_0x1c0e('0x4d')](_0x1c0e('0x4e'),attributes,{'tableName':_0x1c0e('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2b1b26){var _0x1cc1d6=this[_0x1c0e('0x50')]({'plain':!![]});var _0x5782f9=_0x1cc1d6[_0x1c0e('0x4')]===_0x1c0e('0xf')?_0x449c7d(_0x1cc1d6):_0x286c95(_0x1cc1d6);return _0x6a10fb(_0x1cc1d6,_0x2b1b26,_[_0x1c0e('0x51')](_0x5782f9)[_0x1c0e('0x4b')]+0x1)['then'](function(_0x55d57e){var _0x4f529b=_[_0x1c0e('0x52')](_0x5782f9,_0x55d57e);_0x4f529b[_0x1c0e('0xc')]({'type':_0x1cc1d6[_0x1c0e('0x4')],'app':_0x1c0e('0x53'),'exten':_0x1cc1d6[_0x1c0e('0x8')],'context':_0x1cc1d6['context'],'priority':_[_0x1c0e('0x51')](_0x4f529b)[_0x1c0e('0x4b')]+0x1,'VoiceExtensionId':_0x1cc1d6['id']});return _0x4f529b;});}}});}; \ No newline at end of file +var _0xea89=['XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','exten','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','options','url','split','length','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','intervals','map','filter','tag','toLowerCase','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom'];(function(_0x1baf8e,_0x497643){var _0x573b33=function(_0x3cb560){while(--_0x3cb560){_0x1baf8e['push'](_0x1baf8e['shift']());}};_0x573b33(++_0x497643);}(_0xea89,0x1e2));var _0x9ea8=function(_0x509a7f,_0x21a3c1){_0x509a7f=_0x509a7f-0x0;var _0x347b21=_0xea89[_0x509a7f];return _0x347b21;};'use strict';var _=require(_0x9ea8('0x0'));var attributes=require(_0x9ea8('0x1'));module[_0x9ea8('0x2')]=function(_0x39bad4){var _0x25f235=_0x39bad4['models'];function _0x41e322(_0x520915){var _0x226d05=0x2;var _0x5af295=[{'type':_0x520915[_0x9ea8('0x3')],'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x5')+_0x520915[_0x9ea8('0x3')],'context':_0x520915[_0x9ea8('0x6')],'exten':_0x520915[_0x9ea8('0x7')],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']},{'type':_0x520915[_0x9ea8('0x3')],'app':_0x520915['alias']?_0x9ea8('0x4'):_0x9ea8('0x8'),'appdata':_0x520915['alias']?_0x9ea8('0x9')+_0x520915[_0x9ea8('0xa')]:_0x9ea8('0xb'),'context':_0x520915['context'],'exten':_0x520915[_0x9ea8('0x7')],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']}];if(_0x520915[_0x9ea8('0x3')]===_0x9ea8('0xc')){_0x5af295[_0x9ea8('0xd')]({'type':_0x9ea8('0xc'),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0xe')+_0x520915['id'],'context':_0x520915['context'],'exten':_0x520915[_0x9ea8('0x7')],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']});}_0x5af295[_0x9ea8('0xd')]({'type':_0x520915[_0x9ea8('0x3')],'app':'Set','appdata':_0x9ea8('0xf'),'context':_0x520915[_0x9ea8('0x6')],'exten':_0x520915[_0x9ea8('0x7')],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']},{'type':_0x520915[_0x9ea8('0x3')],'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x10'),'context':_0x520915[_0x9ea8('0x6')],'exten':_0x520915['exten'],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']},{'type':_0x520915[_0x9ea8('0x3')],'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x11'),'context':_0x520915['context'],'exten':_0x520915[_0x9ea8('0x7')],'priority':_0x226d05++,'VoiceExtensionId':_0x520915['id']});return _0x5af295;}function _0x558869(_0xe55ad9){var _0x26de62=0x2;var _0x46c41c=[{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x13'),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9['exten'],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0xe55ad9[_0x9ea8('0xa')]?_0x9ea8('0x4'):_0x9ea8('0x8'),'appdata':_0xe55ad9[_0x9ea8('0xa')]?_0x9ea8('0x9')+_0xe55ad9[_0x9ea8('0xa')]:_0x9ea8('0xb'),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':'Set','appdata':_0x9ea8('0x14')+(_0xe55ad9['cutdigits']?_0x9ea8('0x15')+_0xe55ad9[_0x9ea8('0x16')]+'}':_0x9ea8('0x17')),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':'outbound','app':_0x9ea8('0x4'),'appdata':_0x9ea8('0xe')+_0xe55ad9['id'],'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x18'),'appdata':_0x9ea8('0x19')+(_0x26de62+0x2)+'):Goto('+(_0x26de62+0x1)+')','context':_0xe55ad9['context'],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':'Set','appdata':_0xe55ad9[_0x9ea8('0x16')]?_0x9ea8('0x1a')+_0xe55ad9[_0x9ea8('0x16')]+'}':'CDR(prefix)=noprefix','context':_0xe55ad9['context'],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0xf'),'context':_0xe55ad9['context'],'exten':_0xe55ad9['exten'],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x10'),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':'Set','appdata':_0x9ea8('0x11'),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x1b')+_0xe55ad9['id'],'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']}];if(_0xe55ad9[_0x9ea8('0x1c')](_0x9ea8('0x1d'))&&_0xe55ad9[_0x9ea8('0x1d')]!==_0x9ea8('0x1e')){_0x46c41c['push']({'type':'outbound','app':_0x9ea8('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']},{'type':_0x9ea8('0x12'),'app':_0x9ea8('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xe55ad9[_0x9ea8('0x1d')]||_0x9ea8('0x1f'),'context':_0xe55ad9[_0x9ea8('0x6')],'exten':_0xe55ad9[_0x9ea8('0x7')],'priority':_0x26de62++,'VoiceExtensionId':_0xe55ad9['id']});}return _0x46c41c;}function _0x2d3903(_0x3c0299,_0x5d55d5){var _0x580b23=[{'name':_0x9ea8('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x9ea8('0x21'),'param':0x2},{'name':_0x9ea8('0x22'),'param':0x3}];var _0x33cc11={};var _0x5c610e=_0x5d55d5[_0x9ea8('0x23')](',');var _0x55c521=[];for(var _0x3b1622=0x0;_0x3b1622<_0x580b23[_0x9ea8('0x24')];_0x3b1622++){switch(_0x580b23[_0x3b1622][_0x9ea8('0x25')]){case _0x9ea8('0x20'):_0x33cc11[_0x9ea8('0x20')]=_0x5c610e[_0x580b23[_0x3b1622][_0x9ea8('0x26')]][_0x9ea8('0x23')]('/')[0x1];_0x33cc11[_0x9ea8('0x27')]=_0x5c610e[_0x580b23[_0x3b1622][_0x9ea8('0x26')]][_0x9ea8('0x23')]('/')[0x2];_0x33cc11[_0x9ea8('0x28')]=_0x33cc11[_0x9ea8('0x27')]?_0x33cc11[_0x9ea8('0x27')]['split']('$')[0x0]:undefined;_0x33cc11[_0x9ea8('0x27')]=_0x3c0299[_0x9ea8('0x16')]?(_0x33cc11[_0x9ea8('0x28')]||'')+'${EXTEN:'+_0x3c0299['cutdigits']+'}':(_0x33cc11[_0x9ea8('0x28')]||'')+'${EXTEN}';_0x55c521[_0x580b23[_0x3b1622][_0x9ea8('0x26')]]=['SIP',_0x33cc11[_0x9ea8('0x20')],_0x33cc11[_0x9ea8('0x27')]][_0x9ea8('0x29')]('/');break;case _0x9ea8('0x21'):_0x33cc11[_0x9ea8('0x21')]=_0x5c610e[_0x580b23[_0x3b1622]['param']];if(_0x3c0299[_0x9ea8('0x1d')]!==_0x9ea8('0x1e')){if(_0x33cc11[_0x9ea8('0x21')][_0x9ea8('0x2a')](_0x9ea8('0x2b'))<0x0){_0x33cc11[_0x9ea8('0x21')]+=_0x9ea8('0x2b');}}else{_0x33cc11['options']=_0x33cc11[_0x9ea8('0x21')]['replace'](_0x9ea8('0x2b'),'');}_0x55c521[_0x580b23[_0x3b1622][_0x9ea8('0x26')]]=_0x33cc11[_0x9ea8('0x21')];break;default:_0x55c521[_0x580b23[_0x3b1622][_0x9ea8('0x26')]]=_0x5c610e[_0x580b23[_0x3b1622][_0x9ea8('0x26')]];}}return _0x55c521[_0x9ea8('0x29')](',');}function _0x30218d(_0x1e27cf,_0x4a8501,_0x288797){return new Promise(function(_0x5ddc3e,_0x5a1f5b){var _0x45a599=[];if(_['isEmpty'](_0x4a8501))return _0x5ddc3e(_0x45a599);_0x25f235[_0x9ea8('0x2c')][_0x9ea8('0x2d')]({'attributes':['id',_0x9ea8('0x2e'),_0x9ea8('0x2f')],'raw':!![]})[_0x9ea8('0x30')](function(_0x12a03c){for(var _0x310513=0x0,_0x3c1f7a=0x0;_0x310513<_0x4a8501[_0x9ea8('0x24')];_0x310513++,_0x3c1f7a=0x0){var _0x1aa2c0=_0x4a8501[_0x310513];var _0x4a3e41=[];var _0xdb87ce=[];delete _0x1aa2c0['id'];if(_0x1aa2c0[_0x9ea8('0x2e')]!=='*,*,*,*'){_0x1aa2c0[_0x9ea8('0x31')]=[_0x1aa2c0[_0x9ea8('0x2e')]];}else{_0x1aa2c0[_0x9ea8('0x31')]=_0x1aa2c0[_0x9ea8('0x2f')]?_[_0x9ea8('0x32')](_[_0x9ea8('0x33')](_0x12a03c,{'IntervalId':_0x1aa2c0[_0x9ea8('0x2f')]}),_0x9ea8('0x2e')):[];}_0x1aa2c0['context']=_0x1e27cf[_0x9ea8('0x6')];_0x1aa2c0[_0x9ea8('0x7')]=_0x1e27cf[_0x9ea8('0x7')];if(_0x1aa2c0['type'])_0x1aa2c0['type']=_0x1aa2c0[_0x9ea8('0x3')]['toLowerCase']();if(_0x1e27cf[_0x9ea8('0x3')]==='outbound'){if(_0x1aa2c0[_0x9ea8('0x1c')](_0x9ea8('0x34'))&&_0x1aa2c0[_0x9ea8('0x34')]&&_0x1aa2c0[_0x9ea8('0x34')]!=='--'){_0x4a3e41[_0x9ea8('0xd')]({'type':_0x1aa2c0[_0x9ea8('0x3')][_0x9ea8('0x35')](),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x36')+_0x1aa2c0[_0x9ea8('0x34')],'context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf[_0x9ea8('0x7')],'priority':_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')]+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});}_0x4a3e41[_0x9ea8('0xd')]({'type':_0x1aa2c0['type']['toLowerCase'](),'app':_0x9ea8('0x18'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1aa2c0['callerID']?_0x9ea8('0x37')+_0x1aa2c0[_0x9ea8('0x38')]+')':_0x9ea8('0x39')),'context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf[_0x9ea8('0x7')],'priority':_0x1aa2c0[_0x9ea8('0x31')]['length']+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});}else{if(_0x1aa2c0[_0x9ea8('0x1c')](_0x9ea8('0x3a'))){if([_0x9ea8('0x3b'),_0x9ea8('0x3c')][_0x9ea8('0x3d')](_0x1aa2c0[_0x9ea8('0x3e')][_0x9ea8('0x35')]())&&_0x1aa2c0['appType']!==_0x9ea8('0x3f')){if(_0x1aa2c0['answer']){_0x4a3e41[_0x9ea8('0xd')]({'type':_0x1aa2c0[_0x9ea8('0x3')]['toLowerCase'](),'app':_0x9ea8('0x18'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf[_0x9ea8('0x7')],'priority':_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')]+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});_0x4a3e41[_0x9ea8('0xd')]({'type':_0x1aa2c0['type'][_0x9ea8('0x35')](),'app':'Set','appdata':_0x9ea8('0x40'),'context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf[_0x9ea8('0x7')],'priority':_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')]+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});}else{_0x4a3e41[_0x9ea8('0xd')]({'type':_0x1aa2c0[_0x9ea8('0x3')]['toLowerCase'](),'app':_0x9ea8('0x18'),'appdata':_0x9ea8('0x41'),'context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf[_0x9ea8('0x7')],'priority':_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')]+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});_0x4a3e41['push']({'type':_0x1aa2c0[_0x9ea8('0x3')][_0x9ea8('0x35')](),'app':_0x9ea8('0x4'),'appdata':_0x9ea8('0x42'),'context':_0x1e27cf[_0x9ea8('0x6')],'exten':_0x1e27cf['exten'],'priority':_0x1aa2c0[_0x9ea8('0x31')]['length']+_0x288797+_0x3c1f7a++,'VoiceExtensionId':_0x1e27cf['id']});}}}}for(var _0x7bd7d4=0x0;_0x7bd7d4<_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')];_0x7bd7d4++){var _0x7691fb=_0x288797+_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')];var _0x4f7b2f=_0x7bd7d4===_0x1aa2c0[_0x9ea8('0x31')][_0x9ea8('0x24')]-0x1?_0x288797+_0x4a3e41[_0x9ea8('0x24')]+_0xdb87ce[_0x9ea8('0x24')]+0x2:_0x288797+_0x7bd7d4+0x1;_0x4a3e41[_0x9ea8('0x43')](_0x7bd7d4,0x0,{'type':_0x1e27cf[_0x9ea8('0x3')],'app':'GotoIfTime','appdata':_0x1aa2c0[_0x9ea8('0x31')][_0x7bd7d4]+'?'+_0x1e27cf[_0x9ea8('0x6')]+_0x9ea8('0x44')+_0x7691fb+':'+_0x1e27cf[_0x9ea8('0x6')]+_0x9ea8('0x44')+_0x4f7b2f,'exten':_0x1e27cf[_0x9ea8('0x7')],'context':_0x1e27cf[_0x9ea8('0x6')],'priority':_0x288797+_0x7bd7d4,'VoiceExtensionId':_0x1e27cf['id']});}if(_0x1aa2c0['appType']==='outboundDial')_0x1aa2c0['appdata']=_0x2d3903(_0x1e27cf,_0x1aa2c0[_0x9ea8('0x45')]);_0x1aa2c0[_0x9ea8('0x46')]=_0x4a3e41['length']?_[_0x9ea8('0x47')](_0x4a3e41)[_0x9ea8('0x46')]+0x1:_0x288797;_0x45a599=_[_0x9ea8('0x48')](_0x45a599,_0x4a3e41,[_0x1aa2c0],_0xdb87ce);_0x288797=_[_0x9ea8('0x47')](_0x45a599)[_0x9ea8('0x46')]+0x1;}return _0x5ddc3e(_0x45a599);})[_0x9ea8('0x49')](function(_0x5335c3){_0x5a1f5b(_0x5335c3);});});}return _0x39bad4[_0x9ea8('0x4a')](_0x9ea8('0x4b'),attributes,{'tableName':_0x9ea8('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x433af5){var _0x24f7c2=this['get']({'plain':!![]});var _0xded096=_0x24f7c2[_0x9ea8('0x3')]==='outbound'?_0x558869(_0x24f7c2):_0x41e322(_0x24f7c2);return _0x30218d(_0x24f7c2,_0x433af5,_[_0x9ea8('0x47')](_0xded096)['priority']+0x1)[_0x9ea8('0x30')](function(_0x36e895){var _0x14145a=_[_0x9ea8('0x48')](_0xded096,_0x36e895);_0x14145a['push']({'type':_0x24f7c2['type'],'app':_0x9ea8('0x4d'),'exten':_0x24f7c2['exten'],'context':_0x24f7c2[_0x9ea8('0x6')],'priority':_[_0x9ea8('0x47')](_0x14145a)[_0x9ea8('0x46')]+0x1,'VoiceExtensionId':_0x24f7c2['id']});return _0x14145a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 7b45aa4..c04c04a 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 _0x0f9f=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent'];(function(_0x57b2dd,_0x10d625){var _0x35d904=function(_0x2a98ea){while(--_0x2a98ea){_0x57b2dd['push'](_0x57b2dd['shift']());}};_0x35d904(++_0x10d625);}(_0x0f9f,0xae));var _0xf0f9=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x0f9f[_0x51d129];return _0x44c377;};'use strict';var _=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var moment=require(_0xf0f9('0x2'));var BPromise=require(_0xf0f9('0x3'));var rs=require(_0xf0f9('0x4'));var fs=require('fs');var Redis=require(_0xf0f9('0x5'));var db=require(_0xf0f9('0x6'))['db'];var utils=require(_0xf0f9('0x7'));var logger=require(_0xf0f9('0x8'))(_0xf0f9('0x9'));var config=require(_0xf0f9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf0f9('0xb')][_0xf0f9('0xc')]({'port':0x232a});config['redis']=_[_0xf0f9('0xd')](config[_0xf0f9('0xe')],{'host':_0xf0f9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0f9('0xe')]));require(_0xf0f9('0x10'))['register'](socket);function respondWithRpcPromise(_0x3261bc,_0x3b3721,_0x3368ee){return new BPromise(function(_0x3be7af,_0x2f446e){return client[_0xf0f9('0x11')](_0x3261bc,_0x3368ee)[_0xf0f9('0x12')](function(_0x161816){logger['info'](_0xf0f9('0x13'),_0x3b3721,_0xf0f9('0x14'));logger[_0xf0f9('0x15')](_0xf0f9('0x16'),_0x3b3721,'request\x20sent',JSON[_0xf0f9('0x17')](_0x161816));if(_0x161816[_0xf0f9('0x18')]){if(_0x161816['error'][_0xf0f9('0x19')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x3b3721,_0x161816[_0xf0f9('0x18')]['message']);return _0x2f446e(_0x161816[_0xf0f9('0x18')]['message']);}logger[_0xf0f9('0x18')](_0xf0f9('0x13'),_0x3b3721,_0x161816[_0xf0f9('0x18')][_0xf0f9('0x1a')]);return _0x3be7af(_0x161816[_0xf0f9('0x18')][_0xf0f9('0x1a')]);}else{logger[_0xf0f9('0x1b')]('VoiceExtension,\x20%s,\x20%s',_0x3b3721,_0xf0f9('0x14'));_0x3be7af(_0x161816[_0xf0f9('0x1c')][_0xf0f9('0x1a')]);}})[_0xf0f9('0x1d')](function(_0x3dc0e3){logger[_0xf0f9('0x18')](_0xf0f9('0x13'),_0x3b3721,_0x3dc0e3);_0x2f446e(_0x3dc0e3);});});}exports[_0xf0f9('0x1e')]=function(_0x5ebbe9){var _0x1fb2de=this;return new Promise(function(_0x5c2ce0,_0x3664ff){return db['VoiceExtension'][_0xf0f9('0x1f')]({'raw':_0x5ebbe9[_0xf0f9('0x20')]?_0x5ebbe9[_0xf0f9('0x20')][_0xf0f9('0x21')]===undefined?!![]:![]:!![],'where':_0x5ebbe9[_0xf0f9('0x20')]?_0x5ebbe9[_0xf0f9('0x20')]['where']||null:null,'attributes':_0x5ebbe9[_0xf0f9('0x20')]?_0x5ebbe9['options'][_0xf0f9('0x22')]||null:null,'limit':_0x5ebbe9[_0xf0f9('0x20')]?_0x5ebbe9['options'][_0xf0f9('0x23')]||null:null,'include':_0x5ebbe9[_0xf0f9('0x20')]?_0x5ebbe9['options'][_0xf0f9('0x24')]?_[_0xf0f9('0x25')](_0x5ebbe9[_0xf0f9('0x20')][_0xf0f9('0x24')],function(_0x3ce34a){return{'model':db[_0x3ce34a[_0xf0f9('0x26')]],'as':_0x3ce34a['as'],'attributes':_0x3ce34a['attributes'],'include':_0x3ce34a[_0xf0f9('0x24')]?_['map'](_0x3ce34a[_0xf0f9('0x24')],function(_0x2e3fbc){return{'model':db[_0x2e3fbc[_0xf0f9('0x26')]],'as':_0x2e3fbc['as'],'attributes':_0x2e3fbc[_0xf0f9('0x22')],'include':_0x2e3fbc['include']?_[_0xf0f9('0x25')](_0x2e3fbc[_0xf0f9('0x24')],function(_0x477eb0){return{'model':db[_0x477eb0['model']],'as':_0x477eb0['as'],'attributes':_0x477eb0[_0xf0f9('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf0f9('0x12')](function(_0x5957b1){logger[_0xf0f9('0x1b')]('GetVoiceExtension',_0x5ebbe9);logger[_0xf0f9('0x15')](_0xf0f9('0x1e'),_0x5ebbe9,JSON[_0xf0f9('0x17')](_0x5957b1));_0x5c2ce0(_0x5957b1);})[_0xf0f9('0x1d')](function(_0x1f0c1f){logger[_0xf0f9('0x18')](_0xf0f9('0x1e'),_0x1f0c1f[_0xf0f9('0x1a')],_0x5ebbe9);_0x3664ff(_0x1fb2de[_0xf0f9('0x18')](0x1f4,_0x1f0c1f[_0xf0f9('0x1a')]));});});}; \ No newline at end of file +var _0x9f02=['then','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','where','limit','include','map','model','attributes'];(function(_0x245cb5,_0x40cf07){var _0x105c02=function(_0x1b7490){while(--_0x1b7490){_0x245cb5['push'](_0x245cb5['shift']());}};_0x105c02(++_0x40cf07);}(_0x9f02,0x68));var _0x29f0=function(_0x369b30,_0x216d91){_0x369b30=_0x369b30-0x0;var _0x3b3c72=_0x9f02[_0x369b30];return _0x3b3c72;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['VoiceExtension'][_0x29f0('0x18')]({'raw':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1a')]||null:null,'attributes':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')]['attributes']||null:null,'limit':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1b')]||null:null,'include':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1c')],function(_0x2012c3){return{'model':db[_0x2012c3[_0x29f0('0x1e')]],'as':_0x2012c3['as'],'attributes':_0x2012c3['attributes'],'include':_0x2012c3[_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0x2012c3['include'],function(_0x5afe68){return{'model':db[_0x5afe68[_0x29f0('0x1e')]],'as':_0x5afe68['as'],'attributes':_0x5afe68[_0x29f0('0x1f')],'include':_0x5afe68['include']?_[_0x29f0('0x1d')](_0x5afe68[_0x29f0('0x1c')],function(_0x115996){return{'model':db[_0x115996['model']],'as':_0x115996['as'],'attributes':_0x115996['attributes']};}):[]};}):[]};}):[]:[]})[_0x29f0('0x20')](function(_0x3dc23b){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger[_0x29f0('0x21')]('GetVoiceExtension',_0xf7da2e,JSON[_0x29f0('0x10')](_0x3dc23b));_0x5a4579(_0x3dc23b);})[_0x29f0('0x16')](function(_0x1fcdfa){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x1fcdfa[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x1fcdfa['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 39d2349..9c940b5 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 _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3ee8e,_0x7b7547){var _0x3ef9b7=function(_0x274fee){while(--_0x274fee){_0x3ee8e['push'](_0x3ee8e['shift']());}};_0x3ef9b7(++_0x7b7547);}(_0xf494,0x1c6));var _0x4f49=function(_0x2c5ebc,_0x5a7e55){_0x2c5ebc=_0x2c5ebc-0x0;var _0x3b58eb=_0xf494[_0x2c5ebc];return _0x3b58eb;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x8b1a3f,_0x100c8e){var _0x562d83=function(_0x4f24df){while(--_0x4f24df){_0x8b1a3f['push'](_0x8b1a3f['shift']());}};_0x562d83(++_0x100c8e);}(_0xabce,0x103));var _0xeabc=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xabce[_0x4709c0];return _0x13348b;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2aba98a..9f6eb52 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 _0x9a5a=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','getMessages'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9a5a,0x194));var _0xa9a5=function(_0x5b91f5,_0x1fe6f7){_0x5b91f5=_0x5b91f5-0x0;var _0x99ea8f=_0x9a5a[_0x5b91f5];return _0x99ea8f;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')]('/',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0x12')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller['update']);router['delete']('/:id',auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x13')]);module[_0xa9a5('0x14')]=router; \ No newline at end of file +var _0x9536=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','create','put','update','delete','exports','multer'];(function(_0x43660e,_0x3ae6d5){var _0x5d7694=function(_0x520edb){while(--_0x520edb){_0x43660e['push'](_0x43660e['shift']());}};_0x5d7694(++_0x3ae6d5);}(_0x9536,0x179));var _0x6953=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x9536[_0x1fb4e1];return _0x22d1b0;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0x10')]);router[_0x6953('0x11')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0x12')]);router[_0x6953('0x13')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller['destroy']);module[_0x6953('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 64ab5ea..4ad4baf 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 _0xfd7b=['sequelize','STRING','contest_mailbox','email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20'];(function(_0x4a2d88,_0x28a1e2){var _0x152a2e=function(_0x4e9670){while(--_0x4e9670){_0x4a2d88['push'](_0x4a2d88['shift']());}};_0x152a2e(++_0x28a1e2);}(_0xfd7b,0x15f));var _0xbfd7=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xfd7b[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xbfd7('0x1')]},'context':{'type':Sequelize[_0xbfd7('0x1')],'defaultValue':'from-voicemail','unique':_0xbfd7('0x2')},'mailbox':{'type':Sequelize[_0xbfd7('0x1')],'defaultValue':'','allowNull':![],'unique':_0xbfd7('0x2')},'password':{'type':Sequelize[_0xbfd7('0x1')]},'fullname':{'type':Sequelize[_0xbfd7('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5ebc7b){this['setDataValue'](_0xbfd7('0x3'),typeof _0x5ebc7b==='string'&&_0x5ebc7b[_0xbfd7('0x4')]()?_0x5ebc7b[_0xbfd7('0x4')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xbfd7('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xbfd7('0x6'),'no'),'defaultValue':_0xbfd7('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0xbfd7('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xbfd7('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xbfd7('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':_0xbfd7('0x6'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xbfd7('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbfd7('0x5')](_0xbfd7('0x6'),'no'),'defaultValue':_0xbfd7('0x6'),'allowNull':![]},'stamp':{'type':_0xbfd7('0x8')},'emailsubject':{'type':Sequelize[_0xbfd7('0x1')]},'emailbody':{'type':Sequelize[_0xbfd7('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbfd7('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbfd7('0xa')](_0xbfd7('0xb'))+_0xbfd7('0xc')+this[_0xbfd7('0xa')]('mailbox');}}}; \ No newline at end of file +var _0x23b7=['STRING','from-voicemail','contest_mailbox','email','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','exports'];(function(_0x1cea7e,_0x4e9be8){var _0xdb85fa=function(_0x356113){while(--_0x356113){_0x1cea7e['push'](_0x1cea7e['shift']());}};_0xdb85fa(++_0x4e9be8);}(_0x23b7,0x141));var _0x723b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23b7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x723b('0x0')]={'customer_id':{'type':Sequelize[_0x723b('0x1')]},'context':{'type':Sequelize[_0x723b('0x1')],'defaultValue':_0x723b('0x2'),'unique':_0x723b('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x723b('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x723b('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1bf418){this['setDataValue'](_0x723b('0x4'),typeof _0x1bf418==='string'&&_0x1bf418['trim']()?_0x1bf418['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x723b('0x1')],'defaultValue':_0x723b('0x5')},'attach':{'type':Sequelize[_0x723b('0x6')]('yes','no'),'defaultValue':_0x723b('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x723b('0x6')]('yes','no'),'defaultValue':_0x723b('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x723b('0x1')]},'callback':{'type':Sequelize[_0x723b('0x1')]},'review':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x723b('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':_0x723b('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x723b('0x6')](_0x723b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x723b('0x6')]('yes','no'),'defaultValue':_0x723b('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x723b('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x723b('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x723b('0xa')],'get':function(){return this[_0x723b('0xb')]('fullname')+_0x723b('0xc')+this[_0x723b('0xb')](_0x723b('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 508ef8b..c00f32c 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 _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xcf66,0x71));var _0x6cf6=function(_0x571ab5,_0x59c4d7){_0x571ab5=_0x571ab5-0x0;var _0x5496dc=_0xcf66[_0x571ab5];return _0x5496dc;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file +var _0x6cb4=['bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','options','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','getMessages','findOne','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x6cb4,0xff));var _0x46cb=function(_0x539e4e,_0x4d6c7f){_0x539e4e=_0x539e4e-0x0;var _0x3a74c6=_0x6cb4[_0x539e4e];return _0x3a74c6;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];function respondWithStatusCode(_0x323ac2,_0x1058a8){_0x1058a8=_0x1058a8||0xcc;return function(_0xf22158){if(_0xf22158){return _0x323ac2['sendStatus'](_0x1058a8);}return _0x323ac2[_0x46cb('0x18')](_0x1058a8)[_0x46cb('0x19')]();};}function respondWithResult(_0x2a1f9d,_0x3c0071){_0x3c0071=_0x3c0071||0xc8;return function(_0x1f7150){if(_0x1f7150){return _0x2a1f9d[_0x46cb('0x18')](_0x3c0071)[_0x46cb('0x1a')](_0x1f7150);}};}function respondWithFilteredResult(_0x3c396b,_0x37d368){return function(_0x41e398){if(_0x41e398){var _0x136215=typeof _0x37d368['offset']===_0x46cb('0x1b')&&typeof _0x37d368['limit']===_0x46cb('0x1b');var _0x4ab22b=_0x41e398['count'];var _0x4e3454=_0x136215?0x0:_0x37d368[_0x46cb('0x1c')];var _0x1f2891=_0x136215?_0x41e398[_0x46cb('0x1d')]:_0x37d368[_0x46cb('0x1c')]+_0x37d368[_0x46cb('0x1e')];var _0x26e38d;if(_0x1f2891>=_0x4ab22b){_0x1f2891=_0x4ab22b;_0x26e38d=0xc8;}else{_0x26e38d=0xce;}_0x3c396b[_0x46cb('0x18')](_0x26e38d);return _0x3c396b[_0x46cb('0x1f')](_0x46cb('0x20'),_0x4e3454+'-'+_0x1f2891+'/'+_0x4ab22b)[_0x46cb('0x1a')](_0x41e398);}return null;};}function patchUpdates(_0x149483){return function(_0x46e541){try{jsonpatch[_0x46cb('0x21')](_0x46e541,_0x149483,!![]);}catch(_0x2f438b){return BPromise[_0x46cb('0x22')](_0x2f438b);}return _0x46e541[_0x46cb('0x23')]();};}function saveUpdates(_0x7084b2,_0x1fb467){return function(_0x41ecd2){if(_0x41ecd2){return _0x41ecd2[_0x46cb('0x24')](_0x7084b2)[_0x46cb('0x25')](function(_0x1e9e38){return _0x1e9e38;});}return null;};}function removeEntity(_0x309e4b,_0xadcad6){return function(_0x40e0e5){if(_0x40e0e5){return _0x40e0e5['destroy']()['then'](function(){var _0x6588f3=_0x40e0e5[_0x46cb('0x26')]({'plain':!![]});var _0x2711ac=_0x46cb('0x27');return db[_0x46cb('0x28')]['destroy']({'where':{'type':_0x2711ac,'resourceId':_0x6588f3['id']}})[_0x46cb('0x25')](function(){return _0x40e0e5;});})['then'](function(){_0x309e4b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x180ce1,_0x119bf6){return function(_0x2242e7){if(!_0x2242e7){_0x180ce1[_0x46cb('0x29')](0x194);}return _0x2242e7;};}function handleError(_0x7cd177,_0x33218b){_0x33218b=_0x33218b||0x1f4;return function(_0x378dc7){logger[_0x46cb('0x2a')](_0x378dc7[_0x46cb('0x2b')]);if(_0x378dc7[_0x46cb('0x2c')]){delete _0x378dc7[_0x46cb('0x2c')];}_0x7cd177['status'](_0x33218b)[_0x46cb('0x2d')](_0x378dc7);};}exports[_0x46cb('0x2e')]=function(_0x4c73bd,_0x49e0bc){var _0x15f5cf={},_0x5cbb22={},_0x27c22d={'count':0x0,'rows':[]};var _0x6f7953=_[_0x46cb('0x2f')](db[_0x46cb('0x30')][_0x46cb('0x31')],function(_0x33c248){return{'name':_0x33c248['fieldName'],'type':_0x33c248[_0x46cb('0x32')]['key']};});_0x5cbb22[_0x46cb('0x33')]=_[_0x46cb('0x2f')](_0x6f7953,'name');_0x5cbb22[_0x46cb('0x34')]=_[_0x46cb('0x35')](_0x4c73bd[_0x46cb('0x34')]);_0x5cbb22[_0x46cb('0x36')]=_[_0x46cb('0x37')](_0x5cbb22['model'],_0x5cbb22[_0x46cb('0x34')]);_0x15f5cf['attributes']=_[_0x46cb('0x37')](_0x5cbb22[_0x46cb('0x33')],qs[_0x46cb('0x38')](_0x4c73bd['query'][_0x46cb('0x38')]));_0x15f5cf[_0x46cb('0x39')]=_0x15f5cf['attributes'][_0x46cb('0x3a')]?_0x15f5cf[_0x46cb('0x39')]:_0x5cbb22[_0x46cb('0x33')];if(!_0x4c73bd[_0x46cb('0x34')][_0x46cb('0x3b')](_0x46cb('0x3c'))){_0x15f5cf[_0x46cb('0x1e')]=qs[_0x46cb('0x1e')](_0x4c73bd[_0x46cb('0x34')][_0x46cb('0x1e')]);_0x15f5cf[_0x46cb('0x1c')]=qs['offset'](_0x4c73bd['query']['offset']);}_0x15f5cf[_0x46cb('0x3d')]=qs[_0x46cb('0x3e')](_0x4c73bd[_0x46cb('0x34')][_0x46cb('0x3e')]);_0x15f5cf[_0x46cb('0x3f')]=qs[_0x46cb('0x36')](_['pick'](_0x4c73bd[_0x46cb('0x34')],_0x5cbb22['filters']),_0x6f7953);if(_0x4c73bd['query'][_0x46cb('0x40')]){_0x15f5cf['where']=_['merge'](_0x15f5cf[_0x46cb('0x3f')],{'$or':_['map'](_0x6f7953,function(_0x5cf8be){if(_0x5cf8be[_0x46cb('0x32')]!==_0x46cb('0x41')){var _0x4680bc={};_0x4680bc[_0x5cf8be[_0x46cb('0x2c')]]={'$like':'%'+_0x4c73bd[_0x46cb('0x34')][_0x46cb('0x40')]+'%'};return _0x4680bc;}})});}_0x15f5cf=_[_0x46cb('0x42')]({},_0x15f5cf,_0x4c73bd['options']);var _0x358ed4={'where':_0x15f5cf['where']};return db[_0x46cb('0x30')]['count'](_0x358ed4)[_0x46cb('0x25')](function(_0x2fbad9){_0x27c22d[_0x46cb('0x1d')]=_0x2fbad9;if(_0x4c73bd['query'][_0x46cb('0x43')]){_0x15f5cf[_0x46cb('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0x46cb('0x45')](_0x15f5cf);})[_0x46cb('0x25')](function(_0x1f67af){_0x27c22d[_0x46cb('0x46')]=_0x1f67af;return _0x27c22d;})[_0x46cb('0x25')](respondWithFilteredResult(_0x49e0bc,_0x15f5cf))['catch'](handleError(_0x49e0bc,null));};exports['show']=function(_0x10bada,_0x4c8ac3){var _0x1a9959={'raw':!![],'where':{'id':_0x10bada['params']['id']}},_0x41f76c={};_0x41f76c[_0x46cb('0x33')]=_[_0x46cb('0x35')](db[_0x46cb('0x30')]['rawAttributes']);_0x41f76c['query']=_['keys'](_0x10bada['query']);_0x41f76c[_0x46cb('0x36')]=_[_0x46cb('0x37')](_0x41f76c[_0x46cb('0x33')],_0x41f76c[_0x46cb('0x34')]);_0x1a9959[_0x46cb('0x39')]=_['intersection'](_0x41f76c['model'],qs[_0x46cb('0x38')](_0x10bada[_0x46cb('0x34')]['fields']));_0x1a9959[_0x46cb('0x39')]=_0x1a9959[_0x46cb('0x39')][_0x46cb('0x3a')]?_0x1a9959[_0x46cb('0x39')]:_0x41f76c[_0x46cb('0x33')];if(_0x10bada[_0x46cb('0x34')][_0x46cb('0x43')]){_0x1a9959['include']=[{'all':!![]}];}_0x1a9959=_['merge']({},_0x1a9959,_0x10bada[_0x46cb('0x47')]);return db['VoiceMail'][_0x46cb('0x48')](_0x1a9959)[_0x46cb('0x25')](handleEntityNotFound(_0x4c8ac3,null))[_0x46cb('0x25')](respondWithResult(_0x4c8ac3,null))['catch'](handleError(_0x4c8ac3,null));};exports[_0x46cb('0x49')]=function(_0x5c1665,_0x5c02c9){return db[_0x46cb('0x30')][_0x46cb('0x49')](_0x5c1665[_0x46cb('0x4a')],{})[_0x46cb('0x25')](function(_0x1b2072){var _0x26adb4=_0x5c1665[_0x46cb('0x4b')]['get']({'plain':!![]});if(!_0x26adb4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26adb4[_0x46cb('0x4c')]===_0x46cb('0x4b')){var _0x52e479=_0x1b2072[_0x46cb('0x26')]({'plain':!![]});var _0x33ab2e=_0x46cb('0x27');return db[_0x46cb('0x4d')][_0x46cb('0x48')]({'where':{'name':_0x33ab2e,'userProfileId':_0x26adb4['userProfileId']},'raw':!![]})[_0x46cb('0x25')](function(_0x202910){if(_0x202910&&_0x202910[_0x46cb('0x4e')]===0x0){return db['UserProfileResource'][_0x46cb('0x49')]({'name':_0x52e479['name'],'resourceId':_0x52e479['id'],'type':_0x202910['name'],'sectionId':_0x202910['id']},{})[_0x46cb('0x25')](function(){return _0x1b2072;});}else{return _0x1b2072;}})[_0x46cb('0x4f')](function(_0x2fe0b1){logger[_0x46cb('0x2a')](_0x46cb('0x50'),_0x2fe0b1);throw _0x2fe0b1;});}return _0x1b2072;})['then'](respondWithResult(_0x5c02c9,0xc9))[_0x46cb('0x4f')](handleError(_0x5c02c9,null));};exports[_0x46cb('0x24')]=function(_0x5701c0,_0x51a103){if(_0x5701c0[_0x46cb('0x4a')]['id']){delete _0x5701c0[_0x46cb('0x4a')]['id'];}return db[_0x46cb('0x30')]['find']({'where':{'id':_0x5701c0[_0x46cb('0x51')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x51a103,null))[_0x46cb('0x25')](saveUpdates(_0x5701c0[_0x46cb('0x4a')],null))[_0x46cb('0x25')](respondWithResult(_0x51a103,null))[_0x46cb('0x4f')](handleError(_0x51a103,null));};exports[_0x46cb('0x52')]=function(_0x287147,_0x2ba8b5){return db['VoiceMail'][_0x46cb('0x48')]({'where':{'id':_0x287147['params']['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x2ba8b5,null))[_0x46cb('0x25')](removeEntity(_0x2ba8b5,null))[_0x46cb('0x4f')](handleError(_0x2ba8b5,null));};exports[_0x46cb('0x53')]=function(_0x532aa2,_0x67fb77,_0x13d25f){return db[_0x46cb('0x30')][_0x46cb('0x54')]({'where':{'id':_0x532aa2[_0x46cb('0x51')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x67fb77,null))[_0x46cb('0x25')](function(_0x2e55f4){var _0x57c29b;var _0x4a0606={},_0x5a4b11={};_0x5a4b11['model']=_[_0x46cb('0x35')](db[_0x46cb('0x55')]['rawAttributes']);_0x5a4b11[_0x46cb('0x34')]=_[_0x46cb('0x35')](_0x532aa2[_0x46cb('0x34')]);_0x5a4b11['filters']=_['intersection'](_0x5a4b11[_0x46cb('0x33')],_0x5a4b11['query']);_0x4a0606[_0x46cb('0x39')]=_[_0x46cb('0x37')](_0x5a4b11[_0x46cb('0x33')],qs[_0x46cb('0x38')](_0x532aa2[_0x46cb('0x34')][_0x46cb('0x38')]));_0x4a0606[_0x46cb('0x39')]=_0x4a0606[_0x46cb('0x39')][_0x46cb('0x3a')]?_0x4a0606[_0x46cb('0x39')]:_0x5a4b11[_0x46cb('0x33')];if(!_0x532aa2[_0x46cb('0x34')][_0x46cb('0x3b')]('nolimit')){_0x4a0606[_0x46cb('0x1e')]=qs['limit'](_0x532aa2[_0x46cb('0x34')][_0x46cb('0x1e')]);_0x4a0606[_0x46cb('0x1c')]=qs[_0x46cb('0x1c')](_0x532aa2[_0x46cb('0x34')][_0x46cb('0x1c')]);}_0x4a0606[_0x46cb('0x3d')]=qs['sort'](_0x532aa2[_0x46cb('0x34')][_0x46cb('0x3e')]);_0x4a0606[_0x46cb('0x3f')]=qs[_0x46cb('0x36')](_['pick'](_0x532aa2[_0x46cb('0x34')],_0x5a4b11[_0x46cb('0x36')]));if(_0x532aa2[_0x46cb('0x34')][_0x46cb('0x40')]){_0x4a0606[_0x46cb('0x3f')]=_['merge'](_0x4a0606[_0x46cb('0x3f')],{'$or':_[_0x46cb('0x2f')](_0x4a0606[_0x46cb('0x39')],function(_0x2625e4){var _0x38b4a6={};_0x38b4a6[_0x2625e4]={'$like':'%'+_0x532aa2[_0x46cb('0x34')][_0x46cb('0x40')]+'%'};return _0x38b4a6;})});}_0x4a0606[_0x46cb('0x3f')]=_['merge'](_0x4a0606['where'],{'mailboxuser':_0x2e55f4['mailbox']});_0x4a0606=_[_0x46cb('0x42')]({},_0x4a0606,_0x532aa2[_0x46cb('0x47')]);return db[_0x46cb('0x55')][_0x46cb('0x56')](_0x4a0606)[_0x46cb('0x25')](respondWithFilteredResult(_0x67fb77,_0x4a0606));})[_0x46cb('0x4f')](handleError(_0x67fb77,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 77816eb..58bf6e9 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 _0xd431=['mailbox_context','mailbox','context','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','VoiceMail','voice_voicemail'];(function(_0x263e17,_0x244755){var _0x3c1b7f=function(_0xcab000){while(--_0xcab000){_0x263e17['push'](_0x263e17['shift']());}};_0x3c1b7f(++_0x244755);}(_0xd431,0x6b));var _0x1d43=function(_0x237ead,_0x1869d8){_0x237ead=_0x237ead-0x0;var _0x3f78bf=_0xd431[_0x237ead];return _0x3f78bf;};'use strict';var _=require('lodash');var util=require(_0x1d43('0x0'));var logger=require(_0x1d43('0x1'))(_0x1d43('0x2'));var moment=require('moment');var BPromise=require(_0x1d43('0x3'));var rp=require(_0x1d43('0x4'));var fs=require('fs');var path=require(_0x1d43('0x5'));var rimraf=require(_0x1d43('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d43('0x7'));module['exports']=function(_0x41516e,_0x314c39){return _0x41516e['define'](_0x1d43('0x8'),attributes,{'tableName':_0x1d43('0x9'),'paranoid':![],'indexes':[{'name':_0x1d43('0xa'),'fields':[_0x1d43('0xb'),_0x1d43('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4016=['exports','define','voice_voicemail','mailbox_context','mailbox','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x4016,0x1a9));var _0x6401=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4016[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6401('0x0'));var util=require('util');var logger=require(_0x6401('0x1'))(_0x6401('0x2'));var moment=require(_0x6401('0x3'));var BPromise=require(_0x6401('0x4'));var rp=require(_0x6401('0x5'));var fs=require('fs');var path=require(_0x6401('0x6'));var rimraf=require('rimraf');var config=require(_0x6401('0x7'));var attributes=require(_0x6401('0x8'));module[_0x6401('0x9')]=function(_0x194ee5,_0x1b75cb){return _0x194ee5[_0x6401('0xa')]('VoiceMail',attributes,{'tableName':_0x6401('0xb'),'paranoid':![],'indexes':[{'name':_0x6401('0xc'),'fields':[_0x6401('0xd'),'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 ce391a4..9d3144e 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 _0x96d4=['request\x20sent','stringify','code','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','http','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96d4,0xa8));var _0x496d=function(_0x36d22e,_0x6fc190){_0x36d22e=_0x36d22e-0x0;var _0x4fbd6a=_0x96d4[_0x36d22e];return _0x4fbd6a;};'use strict';var _=require('lodash');var util=require(_0x496d('0x0'));var moment=require(_0x496d('0x1'));var BPromise=require(_0x496d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x496d('0x3'));var db=require(_0x496d('0x4'))['db'];var utils=require(_0x496d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x496d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1aff37,_0x465b42,_0x2c0477){return new BPromise(function(_0x27daeb,_0xfc5663){return client['request'](_0x1aff37,_0x2c0477)[_0x496d('0x7')](function(_0x341a4b){logger[_0x496d('0x8')](_0x496d('0x9'),_0x465b42,'request\x20sent');logger[_0x496d('0xa')](_0x496d('0xb'),_0x465b42,_0x496d('0xc'),JSON[_0x496d('0xd')](_0x341a4b));if(_0x341a4b['error']){if(_0x341a4b['error'][_0x496d('0xe')]===0x1f4){logger['error'](_0x496d('0x9'),_0x465b42,_0x341a4b['error']['message']);return _0xfc5663(_0x341a4b[_0x496d('0xf')][_0x496d('0x10')]);}logger['error'](_0x496d('0x9'),_0x465b42,_0x341a4b[_0x496d('0xf')][_0x496d('0x10')]);return _0x27daeb(_0x341a4b[_0x496d('0xf')][_0x496d('0x10')]);}else{logger[_0x496d('0x8')](_0x496d('0x9'),_0x465b42,_0x496d('0xc'));_0x27daeb(_0x341a4b[_0x496d('0x11')][_0x496d('0x10')]);}})['catch'](function(_0x403b01){logger[_0x496d('0xf')]('VoiceMail,\x20%s,\x20%s',_0x465b42,_0x403b01);_0xfc5663(_0x403b01);});});} \ No newline at end of file +var _0x1699=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29db71,_0x306de1){var _0x2c8a07=function(_0x38f0f9){while(--_0x38f0f9){_0x29db71['push'](_0x29db71['shift']());}};_0x2c8a07(++_0x306de1);}(_0x1699,0x156));var _0x9169=function(_0x1d98da,_0x532964){_0x1d98da=_0x1d98da-0x0;var _0x2a56f2=_0x1699[_0x1d98da];return _0x2a56f2;};'use strict';var _=require('lodash');var util=require(_0x9169('0x0'));var moment=require(_0x9169('0x1'));var BPromise=require(_0x9169('0x2'));var rs=require(_0x9169('0x3'));var fs=require('fs');var Redis=require(_0x9169('0x4'));var db=require(_0x9169('0x5'))['db'];var utils=require(_0x9169('0x6'));var logger=require(_0x9169('0x7'))('rpc');var config=require(_0x9169('0x8'));var jayson=require(_0x9169('0x9'));var client=jayson[_0x9169('0xa')][_0x9169('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42799b,_0x33e6ad,_0x91d580){return new BPromise(function(_0x649905,_0x5ef3ce){return client[_0x9169('0xc')](_0x42799b,_0x91d580)[_0x9169('0xd')](function(_0x3be408){logger[_0x9169('0xe')](_0x9169('0xf'),_0x33e6ad,_0x9169('0x10'));logger[_0x9169('0x11')](_0x9169('0x12'),_0x33e6ad,_0x9169('0x10'),JSON[_0x9169('0x13')](_0x3be408));if(_0x3be408[_0x9169('0x14')]){if(_0x3be408[_0x9169('0x14')]['code']===0x1f4){logger[_0x9169('0x14')](_0x9169('0xf'),_0x33e6ad,_0x3be408['error'][_0x9169('0x15')]);return _0x5ef3ce(_0x3be408[_0x9169('0x14')][_0x9169('0x15')]);}logger[_0x9169('0x14')]('VoiceMail,\x20%s,\x20%s',_0x33e6ad,_0x3be408[_0x9169('0x14')][_0x9169('0x15')]);return _0x649905(_0x3be408[_0x9169('0x14')][_0x9169('0x15')]);}else{logger[_0x9169('0xe')](_0x9169('0xf'),_0x33e6ad,'request\x20sent');_0x649905(_0x3be408[_0x9169('0x16')][_0x9169('0x15')]);}})[_0x9169('0x17')](function(_0x4dcf00){logger[_0x9169('0x14')](_0x9169('0xf'),_0x33e6ad,_0x4dcf00);_0x5ef3ce(_0x4dcf00);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 26f6e69..646f180 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 _0xa7e5=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','create'];(function(_0x4036ea,_0x229268){var _0x38e2c2=function(_0x21df2b){while(--_0x21df2b){_0x4036ea['push'](_0x4036ea['shift']());}};_0x38e2c2(++_0x229268);}(_0xa7e5,0xeb));var _0x5a7e=function(_0x4e543e,_0x2012e5){_0x4e543e=_0x4e543e-0x0;var _0x326c8f=_0xa7e5[_0x4e543e];return _0x326c8f;};'use strict';var multer=require(_0x5a7e('0x0'));var util=require(_0x5a7e('0x1'));var path=require('path');var timeout=require(_0x5a7e('0x2'));var express=require(_0x5a7e('0x3'));var router=express[_0x5a7e('0x4')]();var fs_extra=require(_0x5a7e('0x5'));var auth=require(_0x5a7e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5a7e('0x7'));var controller=require(_0x5a7e('0x8'));router['get']('/',auth[_0x5a7e('0x9')](),controller[_0x5a7e('0xa')]);router[_0x5a7e('0xb')](_0x5a7e('0xc'),auth[_0x5a7e('0x9')](),controller['show']);router['get'](_0x5a7e('0xd'),auth[_0x5a7e('0x9')](),controller[_0x5a7e('0xe')]);router[_0x5a7e('0xf')]('/',auth[_0x5a7e('0x9')](),controller[_0x5a7e('0x10')]);router[_0x5a7e('0x11')](_0x5a7e('0xc'),auth[_0x5a7e('0x9')](),controller[_0x5a7e('0x12')]);router[_0x5a7e('0x13')](_0x5a7e('0xc'),auth[_0x5a7e('0x9')](),controller['destroy']);module[_0x5a7e('0x14')]=router; \ No newline at end of file +var _0xf9f6=['index','/:id','download','post','create','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0xf9f6,0xcf));var _0x6f9f=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xf9f6[_0x1780f8];return _0x33a410;};'use strict';var multer=require(_0x6f9f('0x0'));var util=require(_0x6f9f('0x1'));var path=require(_0x6f9f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f9f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f9f('0x4'));var interaction=require(_0x6f9f('0x5'));var config=require(_0x6f9f('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x6f9f('0x7')]('/',auth[_0x6f9f('0x8')](),controller[_0x6f9f('0x9')]);router[_0x6f9f('0x7')](_0x6f9f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6f9f('0x7')]('/:id/download',auth[_0x6f9f('0x8')](),controller[_0x6f9f('0xb')]);router[_0x6f9f('0xc')]('/',auth[_0x6f9f('0x8')](),controller[_0x6f9f('0xd')]);router[_0x6f9f('0xe')]('/:id',auth[_0x6f9f('0x8')](),controller[_0x6f9f('0xf')]);router[_0x6f9f('0x10')]('/:id',auth[_0x6f9f('0x8')](),controller['destroy']);module[_0x6f9f('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 2dd2189..322a733 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 _0x4c87=['exports','VIRTUAL','STRING','BLOB','long','TIMESTAMP','literal','sequelize'];(function(_0x4f34b5,_0x3e072e){var _0x5c8d95=function(_0x41b74a){while(--_0x41b74a){_0x4f34b5['push'](_0x4f34b5['shift']());}};_0x5c8d95(++_0x3e072e);}(_0x4c87,0xe7));var _0x74c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4c87[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x74c8('0x0'));module[_0x74c8('0x1')]={'name':{'type':Sequelize[_0x74c8('0x2')],'get':function(_0x371e4f){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x74c8('0x4')](_0x74c8('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x74c8('0x3')],'defaultValue':''},'stamp':{'type':_0x74c8('0x6'),'defaultValue':Sequelize[_0x74c8('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xf544=['exports','VIRTUAL','getDataValue','INTEGER','STRING','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf544,0x104));var _0x4f54=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xf544[_0x2842b4];return _0x2b9521;};'use strict';var Sequelize=require(_0x4f54('0x0'));module[_0x4f54('0x1')]={'name':{'type':Sequelize[_0x4f54('0x2')],'get':function(_0x5c44b5){return this[_0x4f54('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x4f54('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x4f54('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x4f54('0x6'),'defaultValue':Sequelize[_0x4f54('0x7')](_0x4f54('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 45a7fcc..949c55f 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 _0xe23c=['audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','update','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found'];(function(_0x283098,_0x449bc9){var _0x59d087=function(_0x52b601){while(--_0x52b601){_0x283098['push'](_0x283098['shift']());}};_0x59d087(++_0x449bc9);}(_0xe23c,0xaa));var _0xce23=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xe23c[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0xce23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce23('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce23('0x2'));var moment=require(_0xce23('0x3'));var BPromise=require(_0xce23('0x4'));var Mustache=require(_0xce23('0x5'));var util=require(_0xce23('0x6'));var path=require(_0xce23('0x7'));var sox=require(_0xce23('0x8'));var csv=require('to-csv');var ejs=require(_0xce23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce23('0xa'));var squel=require(_0xce23('0xb'));var crypto=require('crypto');var jsforce=require(_0xce23('0xc'));var deskjs=require(_0xce23('0xd'));var toCsv=require('to-csv');var querystring=require(_0xce23('0xe'));var Papa=require(_0xce23('0xf'));var Redis=require(_0xce23('0x10'));var authService=require(_0xce23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce23('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce23('0x13'))(_0xce23('0x14'));var utils=require('../../config/utils');var config=require(_0xce23('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x325e07,_0x57f51e){_0x57f51e=_0x57f51e||0xcc;return function(_0x2dba38){if(_0x2dba38){return _0x325e07[_0xce23('0x16')](_0x57f51e);}return _0x325e07[_0xce23('0x17')](_0x57f51e)[_0xce23('0x18')]();};}function respondWithResult(_0x417b2e,_0xe221eb){_0xe221eb=_0xe221eb||0xc8;return function(_0x5b0ca4){if(_0x5b0ca4){return _0x417b2e['status'](_0xe221eb)['json'](_0x5b0ca4);}};}function respondWithFilteredResult(_0x4c45a9,_0x1a4f22){return function(_0x424404){if(_0x424404){var _0x1647c4=typeof _0x1a4f22[_0xce23('0x19')]===_0xce23('0x1a')&&typeof _0x1a4f22[_0xce23('0x1b')]==='undefined';var _0x3368c6=_0x424404[_0xce23('0x1c')];var _0x2019a3=_0x1647c4?0x0:_0x1a4f22['offset'];var _0x56fc36=_0x1647c4?_0x424404[_0xce23('0x1c')]:_0x1a4f22[_0xce23('0x19')]+_0x1a4f22['limit'];var _0x20959a;if(_0x56fc36>=_0x3368c6){_0x56fc36=_0x3368c6;_0x20959a=0xc8;}else{_0x20959a=0xce;}_0x4c45a9[_0xce23('0x17')](_0x20959a);return _0x4c45a9[_0xce23('0x1d')](_0xce23('0x1e'),_0x2019a3+'-'+_0x56fc36+'/'+_0x3368c6)[_0xce23('0x1f')](_0x424404);}return null;};}function patchUpdates(_0x44d223){return function(_0xaaf154){try{jsonpatch['apply'](_0xaaf154,_0x44d223,!![]);}catch(_0x58733b){return BPromise[_0xce23('0x20')](_0x58733b);}return _0xaaf154[_0xce23('0x21')]();};}function saveUpdates(_0x4797d2,_0x13a852){return function(_0x5bf3fb){if(_0x5bf3fb){return _0x5bf3fb['update'](_0x4797d2)[_0xce23('0x22')](function(_0x34a6da){return _0x34a6da;});}return null;};}function removeEntity(_0xed08a6,_0x11221d){return function(_0x100794){if(_0x100794){return _0x100794[_0xce23('0x23')]()['then'](function(){_0xed08a6['status'](0xcc)[_0xce23('0x18')]();});}};}function handleEntityNotFound(_0x5a1724,_0x36ba59){return function(_0x499989){if(!_0x499989){_0x5a1724[_0xce23('0x16')](0x194);}return _0x499989;};}function handleError(_0x3188e2,_0x1f5f48){_0x1f5f48=_0x1f5f48||0x1f4;return function(_0x2d311e){logger[_0xce23('0x24')](_0x2d311e[_0xce23('0x25')]);if(_0x2d311e['name']){delete _0x2d311e[_0xce23('0x26')];}_0x3188e2['status'](_0x1f5f48)[_0xce23('0x27')](_0x2d311e);};}exports[_0xce23('0x28')]=function(_0x581d2e,_0x6d4ade){var _0x50f244={},_0x4d3ef5={},_0x3af086={'count':0x0,'rows':[]};var _0x1346a1=_[_0xce23('0x29')](db[_0xce23('0x2a')][_0xce23('0x2b')],function(_0x3188f7){return{'name':_0x3188f7[_0xce23('0x2c')],'type':_0x3188f7[_0xce23('0x2d')][_0xce23('0x2e')]};});_0x4d3ef5[_0xce23('0x2f')]=_[_0xce23('0x30')](_['map'](_0x1346a1,_0xce23('0x26')),['name']);_0x4d3ef5['query']=_['keys'](_0x581d2e[_0xce23('0x31')]);_0x4d3ef5[_0xce23('0x32')]=_[_0xce23('0x33')](_0x4d3ef5[_0xce23('0x2f')],_0x4d3ef5[_0xce23('0x31')]);_0x50f244[_0xce23('0x34')]=_[_0xce23('0x33')](_0x4d3ef5[_0xce23('0x2f')],qs[_0xce23('0x35')](_0x581d2e[_0xce23('0x31')][_0xce23('0x35')]));_0x50f244[_0xce23('0x34')]=_0x50f244['attributes']['length']?_0x50f244['attributes']:_0x4d3ef5[_0xce23('0x2f')];if(!_0x581d2e[_0xce23('0x31')]['hasOwnProperty']('nolimit')){_0x50f244[_0xce23('0x1b')]=qs[_0xce23('0x1b')](_0x581d2e[_0xce23('0x31')][_0xce23('0x1b')]);_0x50f244['offset']=qs[_0xce23('0x19')](_0x581d2e['query'][_0xce23('0x19')]);}_0x50f244[_0xce23('0x36')]=qs[_0xce23('0x37')](_0x581d2e[_0xce23('0x31')][_0xce23('0x37')]);_0x50f244[_0xce23('0x38')]=qs[_0xce23('0x32')](_[_0xce23('0x39')](_0x581d2e[_0xce23('0x31')],_0x4d3ef5[_0xce23('0x32')]),_0x1346a1);if(_0x581d2e[_0xce23('0x31')][_0xce23('0x3a')]){_0x50f244[_0xce23('0x38')]=_['merge'](_0x50f244[_0xce23('0x38')],{'$or':_[_0xce23('0x29')](_0x1346a1,function(_0x228f93){if(_0x228f93['type']!==_0xce23('0x3b')){var _0x8b1f4e={};_0x8b1f4e[_0x228f93[_0xce23('0x26')]]={'$like':'%'+_0x581d2e[_0xce23('0x31')][_0xce23('0x3a')]+'%'};return _0x8b1f4e;}})});}_0x50f244=_[_0xce23('0x3c')]({},_0x50f244,_0x581d2e[_0xce23('0x3d')]);var _0x3f5400={'where':_0x50f244[_0xce23('0x38')]};return db[_0xce23('0x2a')]['count'](_0x3f5400)[_0xce23('0x22')](function(_0x75b963){_0x3af086['count']=_0x75b963;if(_0x581d2e[_0xce23('0x31')][_0xce23('0x3e')]){_0x50f244[_0xce23('0x3f')]=[{'all':!![]}];}return db[_0xce23('0x2a')][_0xce23('0x40')](_0x50f244);})[_0xce23('0x22')](function(_0x1fe817){_0x3af086['rows']=_0x1fe817;return _0x3af086;})[_0xce23('0x22')](respondWithFilteredResult(_0x6d4ade,_0x50f244))[_0xce23('0x41')](handleError(_0x6d4ade,null));};exports[_0xce23('0x42')]=function(_0x12a212,_0x735706){var _0x2a7024={'raw':!![],'where':{'id':_0x12a212[_0xce23('0x43')]['id']}},_0x2cf06e={};_0x2cf06e[_0xce23('0x2f')]=_[_0xce23('0x44')](db[_0xce23('0x2a')]['rawAttributes']);_0x2cf06e[_0xce23('0x31')]=_[_0xce23('0x44')](_0x12a212[_0xce23('0x31')]);_0x2cf06e[_0xce23('0x32')]=_[_0xce23('0x33')](_0x2cf06e[_0xce23('0x2f')],_0x2cf06e[_0xce23('0x31')]);_0x2a7024[_0xce23('0x34')]=_[_0xce23('0x33')](_0x2cf06e[_0xce23('0x2f')],qs[_0xce23('0x35')](_0x12a212['query'][_0xce23('0x35')]));_0x2a7024[_0xce23('0x34')]=_0x2a7024[_0xce23('0x34')]['length']?_0x2a7024[_0xce23('0x34')]:_0x2cf06e[_0xce23('0x2f')];if(_0x12a212[_0xce23('0x31')]['includeAll']){_0x2a7024[_0xce23('0x3f')]=[{'all':!![]}];}_0x2a7024=_[_0xce23('0x3c')]({},_0x2a7024,_0x12a212[_0xce23('0x3d')]);return db['VoiceMailMessage']['find'](_0x2a7024)[_0xce23('0x22')](handleEntityNotFound(_0x735706,null))['then'](respondWithResult(_0x735706,null))[_0xce23('0x41')](handleError(_0x735706,null));};exports[_0xce23('0x45')]=function(_0x1a253f,_0x3aa348){return db[_0xce23('0x2a')][_0xce23('0x45')](_0x1a253f[_0xce23('0x46')],{})[_0xce23('0x22')](respondWithResult(_0x3aa348,0xc9))[_0xce23('0x41')](handleError(_0x3aa348,null));};exports[_0xce23('0x47')]=function(_0x476a39,_0x2cab93){if(_0x476a39[_0xce23('0x46')]['id']){delete _0x476a39[_0xce23('0x46')]['id'];}return db['VoiceMailMessage'][_0xce23('0x48')]({'where':{'id':_0x476a39[_0xce23('0x43')]['id']}})[_0xce23('0x22')](handleEntityNotFound(_0x2cab93,null))[_0xce23('0x22')](saveUpdates(_0x476a39[_0xce23('0x46')],null))[_0xce23('0x22')](respondWithResult(_0x2cab93,null))[_0xce23('0x41')](handleError(_0x2cab93,null));};exports['destroy']=function(_0x5a4a57,_0xc01c25){return db['VoiceMailMessage'][_0xce23('0x48')]({'where':{'id':_0x5a4a57[_0xce23('0x43')]['id']}})[_0xce23('0x22')](handleEntityNotFound(_0xc01c25,null))[_0xce23('0x22')](removeEntity(_0xc01c25,null))[_0xce23('0x41')](handleError(_0xc01c25,null));};exports[_0xce23('0x49')]=function(_0x1acd79,_0x428adf,_0x49853a){return db[_0xce23('0x2a')][_0xce23('0x48')]({'where':{'id':_0x1acd79['params']['id']},'attributes':['id',_0xce23('0x4a'),_0xce23('0x4b')]})[_0xce23('0x22')](handleEntityNotFound(_0x428adf,null))[_0xce23('0x22')](function(_0x34ddc2){if(_0x34ddc2){if(!_0x34ddc2[_0xce23('0x4a')]){throw new db[(_0xce23('0x4c'))][(_0xce23('0x4d'))](_0xce23('0x4e'));}var _0x15cde8={'Content-Type':_0xce23('0x4f'),'Content-Disposition':_0xce23('0x50')};if(_0x34ddc2[_0xce23('0x4b')]){_0x15cde8['Content-Disposition']=_0xce23('0x51')+_0x34ddc2['msg_id']+_0xce23('0x52');}_0x428adf[_0xce23('0x1d')](_0x15cde8);return _0x428adf[_0xce23('0x27')](new Buffer(_0x34ddc2[_0xce23('0x4a')]));}})[_0xce23('0x41')](handleError(_0x428adf,null));}; \ No newline at end of file +var _0x116e=['findAll','rows','catch','show','params','length','VoiceMailMessage','find','create','body','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','attachment;\x20filename=\x22','.wav\x22','set','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','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','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x8c8896,_0x5723a8){var _0x2d2793=function(_0x494b4d){while(--_0x494b4d){_0x8c8896['push'](_0x8c8896['shift']());}};_0x2d2793(++_0x5723a8);}(_0x116e,0x1bb));var _0xe116=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x116e[_0x836465];return _0x2150ea;};'use strict';var emlformat=require(_0xe116('0x0'));var rimraf=require(_0xe116('0x1'));var zipdir=require(_0xe116('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe116('0x3'));var moment=require(_0xe116('0x4'));var BPromise=require(_0xe116('0x5'));var Mustache=require('mustache');var util=require(_0xe116('0x6'));var path=require(_0xe116('0x7'));var sox=require(_0xe116('0x8'));var csv=require('to-csv');var ejs=require(_0xe116('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe116('0xa'));var squel=require(_0xe116('0xb'));var crypto=require('crypto');var jsforce=require(_0xe116('0xc'));var deskjs=require(_0xe116('0xd'));var toCsv=require(_0xe116('0xe'));var querystring=require(_0xe116('0xf'));var Papa=require('papaparse');var Redis=require(_0xe116('0x10'));var authService=require(_0xe116('0x11'));var qs=require(_0xe116('0x12'));var as=require(_0xe116('0x13'));var hardwareService=require(_0xe116('0x14'));var logger=require(_0xe116('0x15'))('api');var utils=require(_0xe116('0x16'));var config=require(_0xe116('0x17'));var licenseUtil=require(_0xe116('0x18'));var db=require(_0xe116('0x19'))['db'];function respondWithStatusCode(_0xab351a,_0x488531){_0x488531=_0x488531||0xcc;return function(_0x47e25d){if(_0x47e25d){return _0xab351a[_0xe116('0x1a')](_0x488531);}return _0xab351a[_0xe116('0x1b')](_0x488531)[_0xe116('0x1c')]();};}function respondWithResult(_0x179777,_0x5b3427){_0x5b3427=_0x5b3427||0xc8;return function(_0x122669){if(_0x122669){return _0x179777[_0xe116('0x1b')](_0x5b3427)[_0xe116('0x1d')](_0x122669);}};}function respondWithFilteredResult(_0x4121ce,_0x193cf8){return function(_0x79208a){if(_0x79208a){var _0x4fde39=typeof _0x193cf8[_0xe116('0x1e')]===_0xe116('0x1f')&&typeof _0x193cf8[_0xe116('0x20')]===_0xe116('0x1f');var _0x419c28=_0x79208a[_0xe116('0x21')];var _0x3d4e92=_0x4fde39?0x0:_0x193cf8[_0xe116('0x1e')];var _0x9bc6ab=_0x4fde39?_0x79208a[_0xe116('0x21')]:_0x193cf8[_0xe116('0x1e')]+_0x193cf8['limit'];var _0x491f69;if(_0x9bc6ab>=_0x419c28){_0x9bc6ab=_0x419c28;_0x491f69=0xc8;}else{_0x491f69=0xce;}_0x4121ce['status'](_0x491f69);return _0x4121ce['set'](_0xe116('0x22'),_0x3d4e92+'-'+_0x9bc6ab+'/'+_0x419c28)[_0xe116('0x1d')](_0x79208a);}return null;};}function patchUpdates(_0x1c4b2d){return function(_0x3a1cb6){try{jsonpatch[_0xe116('0x23')](_0x3a1cb6,_0x1c4b2d,!![]);}catch(_0x4c15de){return BPromise[_0xe116('0x24')](_0x4c15de);}return _0x3a1cb6[_0xe116('0x25')]();};}function saveUpdates(_0x26b350,_0x53ab6f){return function(_0x340a76){if(_0x340a76){return _0x340a76[_0xe116('0x26')](_0x26b350)[_0xe116('0x27')](function(_0x318009){return _0x318009;});}return null;};}function removeEntity(_0x33fecb,_0xafd4a9){return function(_0xcf4f23){if(_0xcf4f23){return _0xcf4f23[_0xe116('0x28')]()[_0xe116('0x27')](function(){_0x33fecb[_0xe116('0x1b')](0xcc)[_0xe116('0x1c')]();});}};}function handleEntityNotFound(_0x58a4ae,_0x209a44){return function(_0x46fd9f){if(!_0x46fd9f){_0x58a4ae[_0xe116('0x1a')](0x194);}return _0x46fd9f;};}function handleError(_0x345a17,_0x2ec6ad){_0x2ec6ad=_0x2ec6ad||0x1f4;return function(_0x1f4d3a){logger['error'](_0x1f4d3a[_0xe116('0x29')]);if(_0x1f4d3a['name']){delete _0x1f4d3a[_0xe116('0x2a')];}_0x345a17[_0xe116('0x1b')](_0x2ec6ad)['send'](_0x1f4d3a);};}exports[_0xe116('0x2b')]=function(_0x235432,_0x308109){var _0x2e0d30={},_0x34812b={},_0x1b7c8b={'count':0x0,'rows':[]};var _0x173b15=_[_0xe116('0x2c')](db['VoiceMailMessage'][_0xe116('0x2d')],function(_0x3b5c84){return{'name':_0x3b5c84[_0xe116('0x2e')],'type':_0x3b5c84[_0xe116('0x2f')]['key']};});_0x34812b[_0xe116('0x30')]=_[_0xe116('0x31')](_[_0xe116('0x2c')](_0x173b15,_0xe116('0x2a')),[_0xe116('0x2a')]);_0x34812b[_0xe116('0x32')]=_[_0xe116('0x33')](_0x235432[_0xe116('0x32')]);_0x34812b['filters']=_[_0xe116('0x34')](_0x34812b[_0xe116('0x30')],_0x34812b[_0xe116('0x32')]);_0x2e0d30[_0xe116('0x35')]=_[_0xe116('0x34')](_0x34812b[_0xe116('0x30')],qs['fields'](_0x235432['query'][_0xe116('0x36')]));_0x2e0d30[_0xe116('0x35')]=_0x2e0d30['attributes']['length']?_0x2e0d30['attributes']:_0x34812b[_0xe116('0x30')];if(!_0x235432['query'][_0xe116('0x37')](_0xe116('0x38'))){_0x2e0d30['limit']=qs['limit'](_0x235432[_0xe116('0x32')][_0xe116('0x20')]);_0x2e0d30['offset']=qs[_0xe116('0x1e')](_0x235432[_0xe116('0x32')][_0xe116('0x1e')]);}_0x2e0d30[_0xe116('0x39')]=qs[_0xe116('0x3a')](_0x235432['query'][_0xe116('0x3a')]);_0x2e0d30[_0xe116('0x3b')]=qs[_0xe116('0x3c')](_['pick'](_0x235432[_0xe116('0x32')],_0x34812b['filters']),_0x173b15);if(_0x235432[_0xe116('0x32')][_0xe116('0x3d')]){_0x2e0d30[_0xe116('0x3b')]=_[_0xe116('0x3e')](_0x2e0d30[_0xe116('0x3b')],{'$or':_[_0xe116('0x2c')](_0x173b15,function(_0x485ec0){if(_0x485ec0[_0xe116('0x2f')]!==_0xe116('0x3f')){var _0x234763={};_0x234763[_0x485ec0['name']]={'$like':'%'+_0x235432[_0xe116('0x32')]['filter']+'%'};return _0x234763;}})});}_0x2e0d30=_[_0xe116('0x3e')]({},_0x2e0d30,_0x235432[_0xe116('0x40')]);var _0xbb8402={'where':_0x2e0d30[_0xe116('0x3b')]};return db['VoiceMailMessage'][_0xe116('0x21')](_0xbb8402)[_0xe116('0x27')](function(_0x62ff3c){_0x1b7c8b[_0xe116('0x21')]=_0x62ff3c;if(_0x235432['query'][_0xe116('0x41')]){_0x2e0d30[_0xe116('0x42')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xe116('0x43')](_0x2e0d30);})[_0xe116('0x27')](function(_0x597cb4){_0x1b7c8b[_0xe116('0x44')]=_0x597cb4;return _0x1b7c8b;})[_0xe116('0x27')](respondWithFilteredResult(_0x308109,_0x2e0d30))[_0xe116('0x45')](handleError(_0x308109,null));};exports[_0xe116('0x46')]=function(_0x2c2051,_0x130ede){var _0x5a4feb={'raw':!![],'where':{'id':_0x2c2051[_0xe116('0x47')]['id']}},_0xff346={};_0xff346['model']=_['keys'](db['VoiceMailMessage'][_0xe116('0x2d')]);_0xff346['query']=_['keys'](_0x2c2051[_0xe116('0x32')]);_0xff346[_0xe116('0x3c')]=_[_0xe116('0x34')](_0xff346['model'],_0xff346[_0xe116('0x32')]);_0x5a4feb['attributes']=_[_0xe116('0x34')](_0xff346['model'],qs[_0xe116('0x36')](_0x2c2051[_0xe116('0x32')][_0xe116('0x36')]));_0x5a4feb[_0xe116('0x35')]=_0x5a4feb[_0xe116('0x35')][_0xe116('0x48')]?_0x5a4feb['attributes']:_0xff346[_0xe116('0x30')];if(_0x2c2051[_0xe116('0x32')][_0xe116('0x41')]){_0x5a4feb[_0xe116('0x42')]=[{'all':!![]}];}_0x5a4feb=_[_0xe116('0x3e')]({},_0x5a4feb,_0x2c2051[_0xe116('0x40')]);return db[_0xe116('0x49')][_0xe116('0x4a')](_0x5a4feb)[_0xe116('0x27')](handleEntityNotFound(_0x130ede,null))[_0xe116('0x27')](respondWithResult(_0x130ede,null))['catch'](handleError(_0x130ede,null));};exports['create']=function(_0x1b3f40,_0x41238d){return db[_0xe116('0x49')][_0xe116('0x4b')](_0x1b3f40[_0xe116('0x4c')],{})[_0xe116('0x27')](respondWithResult(_0x41238d,0xc9))['catch'](handleError(_0x41238d,null));};exports[_0xe116('0x26')]=function(_0x391f6c,_0x34e636){if(_0x391f6c['body']['id']){delete _0x391f6c[_0xe116('0x4c')]['id'];}return db[_0xe116('0x49')]['find']({'where':{'id':_0x391f6c[_0xe116('0x47')]['id']}})[_0xe116('0x27')](handleEntityNotFound(_0x34e636,null))[_0xe116('0x27')](saveUpdates(_0x391f6c[_0xe116('0x4c')],null))[_0xe116('0x27')](respondWithResult(_0x34e636,null))[_0xe116('0x45')](handleError(_0x34e636,null));};exports[_0xe116('0x28')]=function(_0x2218e6,_0x14b90f){return db[_0xe116('0x49')][_0xe116('0x4a')]({'where':{'id':_0x2218e6[_0xe116('0x47')]['id']}})['then'](handleEntityNotFound(_0x14b90f,null))[_0xe116('0x27')](removeEntity(_0x14b90f,null))['catch'](handleError(_0x14b90f,null));};exports['download']=function(_0x542c20,_0x3b5ba4,_0x307cb1){return db[_0xe116('0x49')][_0xe116('0x4a')]({'where':{'id':_0x542c20[_0xe116('0x47')]['id']},'attributes':['id',_0xe116('0x4d'),_0xe116('0x4e')]})[_0xe116('0x27')](handleEntityNotFound(_0x3b5ba4,null))[_0xe116('0x27')](function(_0x37713e){if(_0x37713e){if(!_0x37713e[_0xe116('0x4d')]){throw new db['Sequelize'][(_0xe116('0x4f'))](_0xe116('0x50'));}var _0x1905f1={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x37713e[_0xe116('0x4e')]){_0x1905f1['Content-Disposition']=_0xe116('0x51')+_0x37713e[_0xe116('0x4e')]+_0xe116('0x52');}_0x3b5ba4[_0xe116('0x53')](_0x1905f1);return _0x3b5ba4[_0xe116('0x54')](new Buffer(_0x37713e['recording']));}})[_0xe116('0x45')](handleError(_0x3b5ba4,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b8f8190..6a643f6 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 _0xbe43=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','lodash','util','../../config/logger','api'];(function(_0x3b519b,_0xface10){var _0x446007=function(_0x1c5b91){while(--_0x1c5b91){_0x3b519b['push'](_0x3b519b['shift']());}};_0x446007(++_0xface10);}(_0xbe43,0x1d0));var _0x3be4=function(_0x303a71,_0x468494){_0x303a71=_0x303a71-0x0;var _0x201721=_0xbe43[_0x303a71];return _0x201721;};'use strict';var _=require(_0x3be4('0x0'));var util=require(_0x3be4('0x1'));var logger=require(_0x3be4('0x2'))(_0x3be4('0x3'));var moment=require(_0x3be4('0x4'));var BPromise=require(_0x3be4('0x5'));var rp=require(_0x3be4('0x6'));var fs=require('fs');var path=require(_0x3be4('0x7'));var rimraf=require(_0x3be4('0x8'));var config=require(_0x3be4('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x3be4('0xa')]=function(_0xb47a42,_0x3facc3){return _0xb47a42[_0x3be4('0xb')](_0x3be4('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x5956=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5956,0xb9));var _0x6595=function(_0x17eb1d,_0x4d1e48){_0x17eb1d=_0x17eb1d-0x0;var _0x2ea7a2=_0x5956[_0x17eb1d];return _0x2ea7a2;};'use strict';var _=require(_0x6595('0x0'));var util=require('util');var logger=require(_0x6595('0x1'))(_0x6595('0x2'));var moment=require(_0x6595('0x3'));var BPromise=require(_0x6595('0x4'));var rp=require(_0x6595('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6595('0x6'));var attributes=require(_0x6595('0x7'));module[_0x6595('0x8')]=function(_0x49af7a,_0x510572){return _0x49af7a[_0x6595('0x9')](_0x6595('0xa'),attributes,{'tableName':_0x6595('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x6595('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 7784956..299add2 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 _0x439c=['message','result','catch','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x26c956,_0x47a262){var _0x1d523b=function(_0x1e882a){while(--_0x1e882a){_0x26c956['push'](_0x26c956['shift']());}};_0x1d523b(++_0x47a262);}(_0x439c,0x129));var _0xc439=function(_0x35775f,_0x330d69){_0x35775f=_0x35775f-0x0;var _0x4bdfa9=_0x439c[_0x35775f];return _0x4bdfa9;};'use strict';var _=require('lodash');var util=require(_0xc439('0x0'));var moment=require(_0xc439('0x1'));var BPromise=require('bluebird');var rs=require(_0xc439('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc439('0x3'));var config=require(_0xc439('0x4'));var jayson=require(_0xc439('0x5'));var client=jayson[_0xc439('0x6')][_0xc439('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x991229,_0x39a8fb,_0x41e104){return new BPromise(function(_0x51860,_0x8d7609){return client[_0xc439('0x8')](_0x991229,_0x41e104)[_0xc439('0x9')](function(_0x303698){logger[_0xc439('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x39a8fb,_0xc439('0xb'));logger[_0xc439('0xc')](_0xc439('0xd'),_0x39a8fb,'request\x20sent',JSON[_0xc439('0xe')](_0x303698));if(_0x303698['error']){if(_0x303698[_0xc439('0xf')][_0xc439('0x10')]===0x1f4){logger[_0xc439('0xf')](_0xc439('0x11'),_0x39a8fb,_0x303698[_0xc439('0xf')]['message']);return _0x8d7609(_0x303698['error']['message']);}logger[_0xc439('0xf')](_0xc439('0x11'),_0x39a8fb,_0x303698[_0xc439('0xf')]['message']);return _0x51860(_0x303698[_0xc439('0xf')][_0xc439('0x12')]);}else{logger[_0xc439('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x39a8fb,_0xc439('0xb'));_0x51860(_0x303698[_0xc439('0x13')][_0xc439('0x12')]);}})[_0xc439('0x14')](function(_0x2c721d){logger[_0xc439('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x39a8fb,_0x2c721d);_0x8d7609(_0x2c721d);});});} \ No newline at end of file +var _0xc763=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x1d2021,_0x8a1309){var _0x446c41=function(_0xde6fc2){while(--_0xde6fc2){_0x1d2021['push'](_0x1d2021['shift']());}};_0x446c41(++_0x8a1309);}(_0xc763,0x88));var _0x3c76=function(_0x1da453,_0x47c651){_0x1da453=_0x1da453-0x0;var _0xdc5d52=_0xc763[_0x1da453];return _0xdc5d52;};'use strict';var _=require('lodash');var util=require(_0x3c76('0x0'));var moment=require(_0x3c76('0x1'));var BPromise=require(_0x3c76('0x2'));var rs=require(_0x3c76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c76('0x4'))['db'];var utils=require(_0x3c76('0x5'));var logger=require(_0x3c76('0x6'))(_0x3c76('0x7'));var config=require(_0x3c76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3c76('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1363cb,_0x2b4264,_0x30e010){return new BPromise(function(_0x12068b,_0x15334e){return client[_0x3c76('0xa')](_0x1363cb,_0x30e010)['then'](function(_0x1b527d){logger[_0x3c76('0xb')](_0x3c76('0xc'),_0x2b4264,'request\x20sent');logger[_0x3c76('0xd')](_0x3c76('0xe'),_0x2b4264,_0x3c76('0xf'),JSON['stringify'](_0x1b527d));if(_0x1b527d[_0x3c76('0x10')]){if(_0x1b527d[_0x3c76('0x10')][_0x3c76('0x11')]===0x1f4){logger['error'](_0x3c76('0xc'),_0x2b4264,_0x1b527d[_0x3c76('0x10')][_0x3c76('0x12')]);return _0x15334e(_0x1b527d[_0x3c76('0x10')][_0x3c76('0x12')]);}logger['error'](_0x3c76('0xc'),_0x2b4264,_0x1b527d[_0x3c76('0x10')][_0x3c76('0x12')]);return _0x12068b(_0x1b527d[_0x3c76('0x10')][_0x3c76('0x12')]);}else{logger[_0x3c76('0xb')](_0x3c76('0xc'),_0x2b4264,_0x3c76('0xf'));_0x12068b(_0x1b527d['result']['message']);}})[_0x3c76('0x13')](function(_0x45501e){logger[_0x3c76('0x10')](_0x3c76('0xc'),_0x2b4264,_0x45501e);_0x15334e(_0x45501e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index e3f1e4c..acccf66 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 _0x654a=['/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','post','create','addSound','put','/:id','update','delete','destroy'];(function(_0x51bdda,_0x5666ca){var _0x998aab=function(_0x3f4029){while(--_0x3f4029){_0x51bdda['push'](_0x51bdda['shift']());}};_0x998aab(++_0x5666ca);}(_0x654a,0xd2));var _0xa654=function(_0x20cc2a,_0x26da27){_0x20cc2a=_0x20cc2a-0x0;var _0x433e78=_0x654a[_0x20cc2a];return _0x433e78;};'use strict';var multer=require(_0xa654('0x0'));var util=require(_0xa654('0x1'));var path=require('path');var timeout=require(_0xa654('0x2'));var express=require('express');var router=express[_0xa654('0x3')]();var fs_extra=require(_0xa654('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa654('0x5'));var config=require('../../config/environment');var controller=require(_0xa654('0x6'));router[_0xa654('0x7')]('/',auth[_0xa654('0x8')](),controller[_0xa654('0x9')]);router[_0xa654('0x7')]('/:id',auth[_0xa654('0x8')](),controller[_0xa654('0xa')]);router[_0xa654('0x7')](_0xa654('0xb'),auth[_0xa654('0x8')](),controller['getSounds']);router[_0xa654('0xc')]('/',auth[_0xa654('0x8')](),controller[_0xa654('0xd')]);router[_0xa654('0xc')](_0xa654('0xb'),auth[_0xa654('0x8')](),controller[_0xa654('0xe')]);router[_0xa654('0xf')](_0xa654('0x10'),auth[_0xa654('0x8')](),controller[_0xa654('0x11')]);router[_0xa654('0x12')](_0xa654('0x10'),auth[_0xa654('0x8')](),controller[_0xa654('0x13')]);router[_0xa654('0x12')](_0xa654('0x14'),auth[_0xa654('0x8')](),controller[_0xa654('0x15')]);module[_0xa654('0x16')]=router; \ No newline at end of file +var _0x89b2=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','create','post','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x34ea79,_0x3d5636){var _0x2edfde=function(_0x93be98){while(--_0x93be98){_0x34ea79['push'](_0x34ea79['shift']());}};_0x2edfde(++_0x3d5636);}(_0x89b2,0xc7));var _0x289b=function(_0x35e6ca,_0x54939f){_0x35e6ca=_0x35e6ca-0x0;var _0x239e43=_0x89b2[_0x35e6ca];return _0x239e43;};'use strict';var multer=require(_0x289b('0x0'));var util=require(_0x289b('0x1'));var path=require('path');var timeout=require(_0x289b('0x2'));var express=require(_0x289b('0x3'));var router=express['Router']();var fs_extra=require(_0x289b('0x4'));var auth=require(_0x289b('0x5'));var interaction=require(_0x289b('0x6'));var config=require(_0x289b('0x7'));var controller=require(_0x289b('0x8'));router[_0x289b('0x9')]('/',auth[_0x289b('0xa')](),controller['index']);router['get'](_0x289b('0xb'),auth[_0x289b('0xa')](),controller[_0x289b('0xc')]);router[_0x289b('0x9')](_0x289b('0xd'),auth[_0x289b('0xa')](),controller[_0x289b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x289b('0xf')]);router[_0x289b('0x10')]('/:id/sounds',auth[_0x289b('0xa')](),controller[_0x289b('0x11')]);router[_0x289b('0x12')](_0x289b('0xb'),auth[_0x289b('0xa')](),controller[_0x289b('0x13')]);router['delete'](_0x289b('0xb'),auth[_0x289b('0xa')](),controller[_0x289b('0x14')]);router[_0x289b('0x15')](_0x289b('0x16'),auth[_0x289b('0xa')](),controller[_0x289b('0x17')]);module[_0x289b('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1f293a5..832988f 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 _0xc8f5=['mp3','files','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','mp3nb','quietmp3nb','quietmp3'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xc8f5,0x10a));var _0x5c8f=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0xc8f5[_0x3b3750];return _0x1b9e8b;};'use strict';var Sequelize=require(_0x5c8f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0x5c8f('0x1'),_0x5c8f('0x2'),_0x5c8f('0x3'),_0x5c8f('0x4')),'allowNull':!![],'defaultValue':_0x5c8f('0x5')},'directory':{'type':Sequelize[_0x5c8f('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0x5c8f('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5c8f('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5c8f('0x6')],'allowNull':!![],'defaultValue':_0x5c8f('0x7')},'format':{'type':Sequelize[_0x5c8f('0x6')],'allowNull':!![]},'stamp':{'type':_0x5c8f('0x8')},'defaultEntry':{'type':Sequelize[_0x5c8f('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c76=['mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3'];(function(_0x3a3e9f,_0x229a93){var _0x10c965=function(_0x175419){while(--_0x175419){_0x3a3e9f['push'](_0x3a3e9f['shift']());}};_0x10c965(++_0x229a93);}(_0x5c76,0x1ef));var _0x65c7=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x5c76[_0x11155f];return _0xd07e48;};'use strict';var Sequelize=require(_0x65c7('0x0'));module[_0x65c7('0x1')]={'name':{'type':Sequelize[_0x65c7('0x2')],'allowNull':![],'unique':_0x65c7('0x3')},'mode':{'type':Sequelize[_0x65c7('0x4')](_0x65c7('0x5'),_0x65c7('0x6'),_0x65c7('0x7'),'quietmp3nb',_0x65c7('0x8'),_0x65c7('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x65c7('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x65c7('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x65c7('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x65c7('0x2')],'allowNull':!![],'defaultValue':_0x65c7('0xa')},'format':{'type':Sequelize[_0x65c7('0x2')],'allowNull':!![]},'stamp':{'type':_0x65c7('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 7381d96..2f10e41 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 _0x0490=['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/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','then','MusicOnHolds','UserProfileResource','destroy','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','catch','keys','fields','include','body','find','params','create','sequelize','transaction','mode','directory','join','root','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','server/files/moh','symlinkSync','removeSound','findOne','id2','pick','nolimit','eml-format'];(function(_0x3d8121,_0x49fc1a){var _0x41acb1=function(_0x45eb17){while(--_0x45eb17){_0x3d8121['push'](_0x3d8121['shift']());}};_0x41acb1(++_0x49fc1a);}(_0x0490,0x1c3));var _0x0049=function(_0x17cdcb,_0x20108e){_0x17cdcb=_0x17cdcb-0x0;var _0xf31dc0=_0x0490[_0x17cdcb];return _0xf31dc0;};'use strict';var emlformat=require(_0x0049('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0049('0x1'));var jsonpatch=require(_0x0049('0x2'));var rp=require(_0x0049('0x3'));var moment=require(_0x0049('0x4'));var BPromise=require(_0x0049('0x5'));var Mustache=require(_0x0049('0x6'));var util=require(_0x0049('0x7'));var path=require(_0x0049('0x8'));var sox=require(_0x0049('0x9'));var csv=require(_0x0049('0xa'));var ejs=require(_0x0049('0xb'));var fs=require('fs');var fs_extra=require(_0x0049('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0049('0xd'));var jsforce=require(_0x0049('0xe'));var deskjs=require(_0x0049('0xf'));var toCsv=require(_0x0049('0xa'));var querystring=require('querystring');var Papa=require(_0x0049('0x10'));var Redis=require(_0x0049('0x11'));var authService=require(_0x0049('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0049('0x13'));var hardwareService=require(_0x0049('0x14'));var logger=require('../../config/logger')(_0x0049('0x15'));var utils=require('../../config/utils');var config=require(_0x0049('0x16'));var licenseUtil=require(_0x0049('0x17'));var db=require(_0x0049('0x18'))['db'];function respondWithStatusCode(_0x2ed610,_0x3b9511){_0x3b9511=_0x3b9511||0xcc;return function(_0x20719a){if(_0x20719a){return _0x2ed610[_0x0049('0x19')](_0x3b9511);}return _0x2ed610[_0x0049('0x1a')](_0x3b9511)[_0x0049('0x1b')]();};}function respondWithResult(_0x69dc02,_0x1a98cc){_0x1a98cc=_0x1a98cc||0xc8;return function(_0x4a3342){if(_0x4a3342){return _0x69dc02[_0x0049('0x1a')](_0x1a98cc)['json'](_0x4a3342);}};}function respondWithFilteredResult(_0xa70127,_0x5277e3){return function(_0x66f88e){if(_0x66f88e){var _0x360673=typeof _0x5277e3[_0x0049('0x1c')]===_0x0049('0x1d')&&typeof _0x5277e3['limit']===_0x0049('0x1d');var _0x2a9b36=_0x66f88e['count'];var _0x2b0b3d=_0x360673?0x0:_0x5277e3[_0x0049('0x1c')];var _0x4bebb0=_0x360673?_0x66f88e['count']:_0x5277e3[_0x0049('0x1c')]+_0x5277e3[_0x0049('0x1e')];var _0x23f121;if(_0x4bebb0>=_0x2a9b36){_0x4bebb0=_0x2a9b36;_0x23f121=0xc8;}else{_0x23f121=0xce;}_0xa70127['status'](_0x23f121);return _0xa70127[_0x0049('0x1f')](_0x0049('0x20'),_0x2b0b3d+'-'+_0x4bebb0+'/'+_0x2a9b36)['json'](_0x66f88e);}return null;};}function patchUpdates(_0x1ee538){return function(_0x4c8a73){try{jsonpatch[_0x0049('0x21')](_0x4c8a73,_0x1ee538,!![]);}catch(_0x202d6e){return BPromise[_0x0049('0x22')](_0x202d6e);}return _0x4c8a73[_0x0049('0x23')]();};}function saveUpdates(_0x236b38,_0x566b30){return function(_0xe9c151){if(_0xe9c151){return _0xe9c151['update'](_0x236b38)[_0x0049('0x24')](function(_0x3ef9d0){return _0x3ef9d0;});}return null;};}function removeEntity(_0x27339d,_0x179681){return function(_0x41d917){if(_0x41d917){return _0x41d917['destroy']()[_0x0049('0x24')](function(){var _0x47ee52=_0x41d917['get']({'plain':!![]});var _0x43304b=_0x0049('0x25');return db[_0x0049('0x26')][_0x0049('0x27')]({'where':{'type':_0x43304b,'resourceId':_0x47ee52['id']}})[_0x0049('0x24')](function(){return _0x41d917;});})[_0x0049('0x24')](function(){_0x27339d[_0x0049('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4592b5,_0x334828){return function(_0x365946){if(!_0x365946){_0x4592b5[_0x0049('0x19')](0x194);}return _0x365946;};}function handleError(_0x39f957,_0x26856f){_0x26856f=_0x26856f||0x1f4;return function(_0x316ab0){logger['error'](_0x316ab0['stack']);if(_0x316ab0[_0x0049('0x28')]){delete _0x316ab0['name'];}_0x39f957[_0x0049('0x1a')](_0x26856f)['send'](_0x316ab0);};}exports[_0x0049('0x29')]=function(_0x117ffd,_0x471852){var _0x85eae3={},_0x6a0e91={},_0x5834e3={'count':0x0,'rows':[]};var _0x1e2bdb=_[_0x0049('0x2a')](db[_0x0049('0x2b')][_0x0049('0x2c')],function(_0x1f3176){return{'name':_0x1f3176[_0x0049('0x2d')],'type':_0x1f3176[_0x0049('0x2e')][_0x0049('0x2f')]};});_0x6a0e91['model']=_['map'](_0x1e2bdb,'name');_0x6a0e91[_0x0049('0x30')]=_['keys'](_0x117ffd[_0x0049('0x30')]);_0x6a0e91[_0x0049('0x31')]=_[_0x0049('0x32')](_0x6a0e91[_0x0049('0x33')],_0x6a0e91[_0x0049('0x30')]);_0x85eae3[_0x0049('0x34')]=_[_0x0049('0x32')](_0x6a0e91['model'],qs['fields'](_0x117ffd[_0x0049('0x30')]['fields']));_0x85eae3[_0x0049('0x34')]=_0x85eae3[_0x0049('0x34')][_0x0049('0x35')]?_0x85eae3['attributes']:_0x6a0e91[_0x0049('0x33')];if(!_0x117ffd[_0x0049('0x30')][_0x0049('0x36')]('nolimit')){_0x85eae3['limit']=qs[_0x0049('0x1e')](_0x117ffd[_0x0049('0x30')]['limit']);_0x85eae3[_0x0049('0x1c')]=qs[_0x0049('0x1c')](_0x117ffd[_0x0049('0x30')][_0x0049('0x1c')]);}_0x85eae3[_0x0049('0x37')]=qs[_0x0049('0x38')](_0x117ffd[_0x0049('0x30')]['sort']);delete _0x117ffd['query'][_0x0049('0x38')];_0x85eae3[_0x0049('0x39')]=qs[_0x0049('0x31')](_['pick'](_0x117ffd[_0x0049('0x30')],_0x6a0e91[_0x0049('0x31')]),_0x1e2bdb);if(_0x117ffd[_0x0049('0x30')][_0x0049('0x3a')]){_0x85eae3[_0x0049('0x39')]=_[_0x0049('0x3b')](_0x85eae3[_0x0049('0x39')],{'$or':_['map'](_0x1e2bdb,function(_0xc6490e){if(_0xc6490e[_0x0049('0x2e')]!==_0x0049('0x3c')){var _0x45beca={};_0x45beca[_0xc6490e[_0x0049('0x28')]]={'$like':'%'+_0x117ffd[_0x0049('0x30')][_0x0049('0x3a')]+'%'};return _0x45beca;}})});}_0x85eae3=_[_0x0049('0x3b')]({},_0x85eae3,_0x117ffd[_0x0049('0x3d')]);var _0x2255f4={'where':_0x85eae3[_0x0049('0x39')]};return db['VoiceMusicOnHold'][_0x0049('0x3e')](_0x2255f4)[_0x0049('0x24')](function(_0x892776){_0x5834e3[_0x0049('0x3e')]=_0x892776;if(_0x117ffd[_0x0049('0x30')][_0x0049('0x3f')]){_0x85eae3['include']=[{'all':!![]}];}return db[_0x0049('0x2b')][_0x0049('0x40')](_0x85eae3);})[_0x0049('0x24')](function(_0x357c79){_0x5834e3['rows']=_0x357c79;return _0x5834e3;})[_0x0049('0x24')](respondWithFilteredResult(_0x471852,_0x85eae3))[_0x0049('0x41')](handleError(_0x471852,null));};exports['show']=function(_0x545f2a,_0x3f4bbf){var _0x523a1e={'raw':![],'where':{'id':_0x545f2a['params']['id']}},_0xae9ba0={};_0xae9ba0[_0x0049('0x33')]=_[_0x0049('0x42')](db[_0x0049('0x2b')][_0x0049('0x2c')]);_0xae9ba0[_0x0049('0x30')]=_[_0x0049('0x42')](_0x545f2a[_0x0049('0x30')]);_0xae9ba0[_0x0049('0x31')]=_['intersection'](_0xae9ba0[_0x0049('0x33')],_0xae9ba0[_0x0049('0x30')]);_0x523a1e[_0x0049('0x34')]=_[_0x0049('0x32')](_0xae9ba0['model'],qs[_0x0049('0x43')](_0x545f2a['query'][_0x0049('0x43')]));_0x523a1e[_0x0049('0x34')]=_0x523a1e['attributes'][_0x0049('0x35')]?_0x523a1e[_0x0049('0x34')]:_0xae9ba0['model'];if(_0x545f2a['query']['includeAll']){_0x523a1e[_0x0049('0x44')]=[{'all':!![]}];}_0x523a1e=_[_0x0049('0x3b')]({},_0x523a1e,_0x545f2a[_0x0049('0x3d')]);return db[_0x0049('0x2b')]['find'](_0x523a1e)['then'](handleEntityNotFound(_0x3f4bbf,null))[_0x0049('0x24')](respondWithResult(_0x3f4bbf,null))['catch'](handleError(_0x3f4bbf,null));};exports['update']=function(_0x3aa490,_0x55e45e){if(_0x3aa490[_0x0049('0x45')]['id']){delete _0x3aa490[_0x0049('0x45')]['id'];}return db['VoiceMusicOnHold'][_0x0049('0x46')]({'where':{'id':_0x3aa490[_0x0049('0x47')]['id']}})[_0x0049('0x24')](handleEntityNotFound(_0x55e45e,null))[_0x0049('0x24')](saveUpdates(_0x3aa490['body'],null))[_0x0049('0x24')](respondWithResult(_0x55e45e,null))[_0x0049('0x41')](handleError(_0x55e45e,null));};exports[_0x0049('0x48')]=function(_0x402535,_0x3bff80,_0x1ec1ed){return db[_0x0049('0x49')][_0x0049('0x4a')](function(_0x426205){if(_0x402535['body'][_0x0049('0x4b')]==='files'){_0x402535[_0x0049('0x45')][_0x0049('0x4c')]=path[_0x0049('0x4d')](config[_0x0049('0x4e')],'server/files/moh',_0x402535[_0x0049('0x45')]['name']);}return db[_0x0049('0x2b')][_0x0049('0x48')](_0x402535[_0x0049('0x45')],{'transaction':_0x426205})[_0x0049('0x24')](function(_0x35354f){if(_0x402535[_0x0049('0x45')][_0x0049('0x4b')]==='files'){fs[_0x0049('0x4f')](_0x35354f[_0x0049('0x4c')],parseInt(_0x0049('0x50'),0x8));}var _0x1343c3=_0x402535[_0x0049('0x51')][_0x0049('0x52')]({'plain':!![]});if(!_0x1343c3)throw new Error(_0x0049('0x53'));if(_0x1343c3[_0x0049('0x54')]===_0x0049('0x51')){var _0x4d68d4=_0x35354f[_0x0049('0x52')]({'plain':!![]});return db[_0x0049('0x55')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1343c3[_0x0049('0x56')]},'raw':!![]})['then'](function(_0x4850a8){if(_0x4850a8&&_0x4850a8[_0x0049('0x57')]===0x0){return db['UserProfileResource'][_0x0049('0x48')]({'name':_0x4d68d4['name'],'resourceId':_0x4d68d4['id'],'type':_0x4850a8[_0x0049('0x28')],'sectionId':_0x4850a8['id']},{})[_0x0049('0x24')](function(){return _0x35354f;});}else{return _0x35354f;}})[_0x0049('0x41')](function(_0x2a78e3){logger[_0x0049('0x58')](_0x0049('0x59'),_0x2a78e3);});}return _0x35354f;});})['then'](respondWithResult(_0x3bff80,0xc9))[_0x0049('0x41')](handleError(_0x3bff80,null));};exports[_0x0049('0x27')]=function(_0x344e3c,_0x11bba6,_0x4914e4){var _0x18e3a3;return db['VoiceMusicOnHold'][_0x0049('0x46')]({'where':{'id':_0x344e3c[_0x0049('0x47')]['id']}})[_0x0049('0x24')](function(_0x51ee10){if(_0x51ee10){return db[_0x0049('0x49')]['transaction'](function(_0x57e601){return _0x51ee10[_0x0049('0x27')]({'transaction':_0x57e601,'raw':!![]})['then'](function(_0x3909cf){if(_0x3909cf[_0x0049('0x4c')]){fs[_0x0049('0x5a')](_0x3909cf[_0x0049('0x4c')])[_0x0049('0x5b')](function(_0x219eb0){fs[_0x0049('0x5c')](path[_0x0049('0x4d')](_0x3909cf[_0x0049('0x4c')],_0x219eb0));});fs[_0x0049('0x5d')](_0x3909cf[_0x0049('0x4c')]);}return _0x3909cf;});})[_0x0049('0x41')](function(_0x21f335){throw new db[(_0x0049('0x5e'))][(_0x0049('0x5f'))](_0x21f335[_0x0049('0x60')]);});}})['then'](handleEntityNotFound(_0x11bba6,null))[_0x0049('0x24')](removeEntity(_0x11bba6,null))[_0x0049('0x41')](handleError(_0x11bba6,null));};exports[_0x0049('0x61')]=function(_0x50f559,_0x464e79,_0x57e83d){return db[_0x0049('0x49')][_0x0049('0x4a')](function(_0x154ae4){var _0x8e1465;return db[_0x0049('0x2b')][_0x0049('0x46')]({'where':{'id':_0x50f559[_0x0049('0x47')]['id']}})[_0x0049('0x24')](function(_0x2d804e){if(_0x2d804e){_0x8e1465=_0x2d804e;return _0x2d804e[_0x0049('0x61')](_0x50f559[_0x0049('0x45')]['id'],{'transaction':_0x154ae4});}})[_0x0049('0x24')](function(_0x2a1a60){if(_0x2a1a60){return db[_0x0049('0x62')]['findOne']({'where':{'id':_0x50f559[_0x0049('0x45')]['id']},'attributes':['id',_0x0049('0x28'),_0x0049('0x63'),_0x0049('0x64'),_0x0049('0x65')],'raw':!![]});}})[_0x0049('0x24')](function(_0x59b179){if(_0x59b179){var _0x21babf=path[_0x0049('0x4d')](config[_0x0049('0x4e')],_0x0049('0x66'),util[_0x0049('0x67')](_0x0049('0x68'),path[_0x0049('0x69')](_0x59b179[_0x0049('0x63')],path['extname'](_0x59b179[_0x0049('0x63')])),_0x59b179[_0x0049('0x64')]));var _0x11ac59=path['join'](config[_0x0049('0x4e')],_0x0049('0x6a'),_0x8e1465[_0x0049('0x28')],util[_0x0049('0x67')]('%s.%s',_0x59b179[_0x0049('0x28')],_0x59b179[_0x0049('0x64')]));fs[_0x0049('0x6b')](_0x21babf,_0x11ac59);return _0x59b179;}})[_0x0049('0x41')](function(_0x24e7db){throw new db[(_0x0049('0x5e'))][(_0x0049('0x5f'))](_0x24e7db[_0x0049('0x60')]);});})['then'](handleEntityNotFound(_0x464e79,null))['then'](respondWithResult(_0x464e79,0xc9))[_0x0049('0x41')](handleError(_0x464e79,null));};exports[_0x0049('0x6c')]=function(_0x597a3f,_0x2945ca,_0x39e288){return db[_0x0049('0x49')][_0x0049('0x4a')](function(_0x1340de){var _0x42dd43;return db[_0x0049('0x2b')][_0x0049('0x6d')]({'where':{'id':_0x597a3f['params']['id']}})[_0x0049('0x24')](handleEntityNotFound(_0x2945ca,null))[_0x0049('0x24')](function(_0x29e260){if(_0x29e260){_0x42dd43=_0x29e260;return _0x29e260['removeSound'](_0x597a3f['params'][_0x0049('0x6e')]);}})[_0x0049('0x24')](function(_0xc16739){if(_0xc16739){return db['Sound'][_0x0049('0x6d')]({'where':{'id':_0x597a3f['params'][_0x0049('0x6e')]},'attributes':['id','name','save_name',_0x0049('0x64'),_0x0049('0x65')],'raw':!![]});}})[_0x0049('0x24')](function(_0x2f7dd1){if(_0x2f7dd1){fs['unlinkSync'](path['join'](_0x42dd43[_0x0049('0x4c')],util[_0x0049('0x67')](_0x0049('0x68'),_0x2f7dd1['name'],_0x2f7dd1['converted_format'])));return _0x2f7dd1;}})[_0x0049('0x41')](function(_0xbf9bfa){throw new db[(_0x0049('0x5e'))]['ValidationError'](_0xbf9bfa[_0x0049('0x60')]);});})[_0x0049('0x24')](handleEntityNotFound(_0x2945ca,null))['then'](respondWithStatusCode(_0x2945ca,0xcc))[_0x0049('0x41')](handleError(_0x2945ca,null));};exports['getSounds']=function(_0x2a3e99,_0xc12404,_0x39d562){var _0x34a7e5={};var _0x250970={};var _0x37b8a1;var _0x15b4b7;return db['VoiceMusicOnHold'][_0x0049('0x6d')]({'where':{'id':_0x2a3e99[_0x0049('0x47')]['id']}})[_0x0049('0x24')](handleEntityNotFound(_0xc12404,null))[_0x0049('0x24')](function(_0x784536){if(_0x784536){_0x37b8a1=_0x784536;_0x250970[_0x0049('0x33')]=_[_0x0049('0x42')](db[_0x0049('0x62')][_0x0049('0x2c')]);_0x250970[_0x0049('0x30')]=_['keys'](_0x2a3e99[_0x0049('0x30')]);_0x250970[_0x0049('0x31')]=_[_0x0049('0x32')](_0x250970[_0x0049('0x33')],_0x250970['query']);_0x34a7e5[_0x0049('0x34')]=_['intersection'](_0x250970['model'],qs[_0x0049('0x43')](_0x2a3e99[_0x0049('0x30')]['fields']));_0x34a7e5[_0x0049('0x34')]=_0x34a7e5[_0x0049('0x34')][_0x0049('0x35')]?_0x34a7e5[_0x0049('0x34')]:_0x250970[_0x0049('0x33')];_0x34a7e5[_0x0049('0x37')]=qs[_0x0049('0x38')](_0x2a3e99['query'][_0x0049('0x38')]);_0x34a7e5[_0x0049('0x39')]=qs['filters'](_[_0x0049('0x6f')](_0x2a3e99[_0x0049('0x30')],_0x250970['filters']));if(_0x2a3e99[_0x0049('0x30')]['filter']){_0x34a7e5['where']=_['merge'](_0x34a7e5[_0x0049('0x39')],{'$or':_[_0x0049('0x2a')](_0x34a7e5['attributes'],function(_0x43bbc1){var _0x3e2b27={};_0x3e2b27[_0x43bbc1]={'$like':'%'+_0x2a3e99[_0x0049('0x30')][_0x0049('0x3a')]+'%'};return _0x3e2b27;})});}_0x34a7e5=_[_0x0049('0x3b')]({},_0x34a7e5,_0x2a3e99[_0x0049('0x3d')]);return _0x37b8a1['getSounds'](_0x34a7e5);}})[_0x0049('0x24')](function(_0x5c9704){if(_0x5c9704){_0x15b4b7=_0x5c9704['length'];if(!_0x2a3e99[_0x0049('0x30')]['hasOwnProperty'](_0x0049('0x70'))){_0x34a7e5[_0x0049('0x1e')]=qs[_0x0049('0x1e')](_0x2a3e99[_0x0049('0x30')][_0x0049('0x1e')]);_0x34a7e5[_0x0049('0x1c')]=qs[_0x0049('0x1c')](_0x2a3e99[_0x0049('0x30')][_0x0049('0x1c')]);}return _0x37b8a1['getSounds'](_0x34a7e5);}})[_0x0049('0x24')](function(_0x55e042){if(_0x55e042){return _0x55e042?{'count':_0x15b4b7,'rows':_0x55e042}:null;}})['then'](respondWithResult(_0xc12404,null))[_0x0049('0x41')](handleError(_0xc12404,null));}; \ No newline at end of file +var _0xf9ef=['fieldName','type','model','keys','query','intersection','attributes','fields','length','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','VoiceMusicOnHold','findAll','rows','catch','show','params','include','update','body','find','create','sequelize','transaction','files','directory','join','server/files/moh','mode','mkdirSync','0777','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','createdAt','root','server/files/sounds/converted','format','%s.%s','save_name','converted_format','removeSound','id2','getSounds','hasOwnProperty','nolimit','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','get','MusicOnHolds','destroy','stack','name','index','rawAttributes'];(function(_0x3984a6,_0x4adaba){var _0x2cc75f=function(_0x4a3849){while(--_0x4a3849){_0x3984a6['push'](_0x3984a6['shift']());}};_0x2cc75f(++_0x4adaba);}(_0xf9ef,0x126));var _0xff9e=function(_0x3d3673,_0x30b5e5){_0x3d3673=_0x3d3673-0x0;var _0x3c6ed4=_0xf9ef[_0x3d3673];return _0x3c6ed4;};'use strict';var emlformat=require(_0xff9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff9e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff9e('0x2'));var moment=require(_0xff9e('0x3'));var BPromise=require(_0xff9e('0x4'));var Mustache=require(_0xff9e('0x5'));var util=require(_0xff9e('0x6'));var path=require(_0xff9e('0x7'));var sox=require(_0xff9e('0x8'));var csv=require('to-csv');var ejs=require(_0xff9e('0x9'));var fs=require('fs');var fs_extra=require(_0xff9e('0xa'));var _=require(_0xff9e('0xb'));var squel=require(_0xff9e('0xc'));var crypto=require(_0xff9e('0xd'));var jsforce=require(_0xff9e('0xe'));var deskjs=require(_0xff9e('0xf'));var toCsv=require(_0xff9e('0x10'));var querystring=require(_0xff9e('0x11'));var Papa=require('papaparse');var Redis=require(_0xff9e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xff9e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xff9e('0x14'))(_0xff9e('0x15'));var utils=require(_0xff9e('0x16'));var config=require(_0xff9e('0x17'));var licenseUtil=require(_0xff9e('0x18'));var db=require(_0xff9e('0x19'))['db'];function respondWithStatusCode(_0x51cbb6,_0x460517){_0x460517=_0x460517||0xcc;return function(_0x6c8e70){if(_0x6c8e70){return _0x51cbb6[_0xff9e('0x1a')](_0x460517);}return _0x51cbb6[_0xff9e('0x1b')](_0x460517)['end']();};}function respondWithResult(_0x3392ab,_0x3333ac){_0x3333ac=_0x3333ac||0xc8;return function(_0x886651){if(_0x886651){return _0x3392ab[_0xff9e('0x1b')](_0x3333ac)['json'](_0x886651);}};}function respondWithFilteredResult(_0x34f5de,_0x302a6f){return function(_0x1d0c5f){if(_0x1d0c5f){var _0x187822=typeof _0x302a6f[_0xff9e('0x1c')]===_0xff9e('0x1d')&&typeof _0x302a6f[_0xff9e('0x1e')]===_0xff9e('0x1d');var _0x4b9366=_0x1d0c5f[_0xff9e('0x1f')];var _0x30642a=_0x187822?0x0:_0x302a6f[_0xff9e('0x1c')];var _0xddf0df=_0x187822?_0x1d0c5f[_0xff9e('0x1f')]:_0x302a6f[_0xff9e('0x1c')]+_0x302a6f[_0xff9e('0x1e')];var _0x15e6d4;if(_0xddf0df>=_0x4b9366){_0xddf0df=_0x4b9366;_0x15e6d4=0xc8;}else{_0x15e6d4=0xce;}_0x34f5de['status'](_0x15e6d4);return _0x34f5de[_0xff9e('0x20')](_0xff9e('0x21'),_0x30642a+'-'+_0xddf0df+'/'+_0x4b9366)[_0xff9e('0x22')](_0x1d0c5f);}return null;};}function patchUpdates(_0x148cb3){return function(_0x42a8ca){try{jsonpatch['apply'](_0x42a8ca,_0x148cb3,!![]);}catch(_0x30985e){return BPromise[_0xff9e('0x23')](_0x30985e);}return _0x42a8ca[_0xff9e('0x24')]();};}function saveUpdates(_0x9e9ac9,_0x21759b){return function(_0x317f7f){if(_0x317f7f){return _0x317f7f['update'](_0x9e9ac9)[_0xff9e('0x25')](function(_0x180f95){return _0x180f95;});}return null;};}function removeEntity(_0x2045ec,_0x2fad8c){return function(_0x2139d8){if(_0x2139d8){return _0x2139d8['destroy']()[_0xff9e('0x25')](function(){var _0x5569af=_0x2139d8[_0xff9e('0x26')]({'plain':!![]});var _0x3ad9f8=_0xff9e('0x27');return db['UserProfileResource'][_0xff9e('0x28')]({'where':{'type':_0x3ad9f8,'resourceId':_0x5569af['id']}})[_0xff9e('0x25')](function(){return _0x2139d8;});})[_0xff9e('0x25')](function(){_0x2045ec[_0xff9e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x314f84,_0x1a6113){return function(_0x5de76b){if(!_0x5de76b){_0x314f84[_0xff9e('0x1a')](0x194);}return _0x5de76b;};}function handleError(_0x196175,_0x368d04){_0x368d04=_0x368d04||0x1f4;return function(_0x443f22){logger['error'](_0x443f22[_0xff9e('0x29')]);if(_0x443f22[_0xff9e('0x2a')]){delete _0x443f22[_0xff9e('0x2a')];}_0x196175[_0xff9e('0x1b')](_0x368d04)['send'](_0x443f22);};}exports[_0xff9e('0x2b')]=function(_0x34825f,_0x215616){var _0x485b6c={},_0x2b1649={},_0x2706cd={'count':0x0,'rows':[]};var _0x1bbced=_['map'](db['VoiceMusicOnHold'][_0xff9e('0x2c')],function(_0x1c9453){return{'name':_0x1c9453[_0xff9e('0x2d')],'type':_0x1c9453[_0xff9e('0x2e')]['key']};});_0x2b1649[_0xff9e('0x2f')]=_['map'](_0x1bbced,'name');_0x2b1649['query']=_[_0xff9e('0x30')](_0x34825f[_0xff9e('0x31')]);_0x2b1649['filters']=_[_0xff9e('0x32')](_0x2b1649[_0xff9e('0x2f')],_0x2b1649[_0xff9e('0x31')]);_0x485b6c[_0xff9e('0x33')]=_[_0xff9e('0x32')](_0x2b1649['model'],qs['fields'](_0x34825f['query'][_0xff9e('0x34')]));_0x485b6c[_0xff9e('0x33')]=_0x485b6c[_0xff9e('0x33')][_0xff9e('0x35')]?_0x485b6c[_0xff9e('0x33')]:_0x2b1649[_0xff9e('0x2f')];if(!_0x34825f[_0xff9e('0x31')]['hasOwnProperty']('nolimit')){_0x485b6c[_0xff9e('0x1e')]=qs[_0xff9e('0x1e')](_0x34825f[_0xff9e('0x31')][_0xff9e('0x1e')]);_0x485b6c[_0xff9e('0x1c')]=qs['offset'](_0x34825f[_0xff9e('0x31')]['offset']);}_0x485b6c['order']=qs[_0xff9e('0x36')](_0x34825f[_0xff9e('0x31')]['sort']);delete _0x34825f[_0xff9e('0x31')]['sort'];_0x485b6c[_0xff9e('0x37')]=qs[_0xff9e('0x38')](_[_0xff9e('0x39')](_0x34825f[_0xff9e('0x31')],_0x2b1649[_0xff9e('0x38')]),_0x1bbced);if(_0x34825f['query']['filter']){_0x485b6c['where']=_[_0xff9e('0x3a')](_0x485b6c[_0xff9e('0x37')],{'$or':_[_0xff9e('0x3b')](_0x1bbced,function(_0x501979){if(_0x501979['type']!==_0xff9e('0x3c')){var _0x2d686e={};_0x2d686e[_0x501979[_0xff9e('0x2a')]]={'$like':'%'+_0x34825f['query'][_0xff9e('0x3d')]+'%'};return _0x2d686e;}})});}_0x485b6c=_[_0xff9e('0x3a')]({},_0x485b6c,_0x34825f[_0xff9e('0x3e')]);var _0x1ed4b1={'where':_0x485b6c['where']};return db['VoiceMusicOnHold'][_0xff9e('0x1f')](_0x1ed4b1)[_0xff9e('0x25')](function(_0xb8278d){_0x2706cd[_0xff9e('0x1f')]=_0xb8278d;if(_0x34825f[_0xff9e('0x31')][_0xff9e('0x3f')]){_0x485b6c['include']=[{'all':!![]}];}return db[_0xff9e('0x40')][_0xff9e('0x41')](_0x485b6c);})[_0xff9e('0x25')](function(_0x4fabf5){_0x2706cd[_0xff9e('0x42')]=_0x4fabf5;return _0x2706cd;})[_0xff9e('0x25')](respondWithFilteredResult(_0x215616,_0x485b6c))[_0xff9e('0x43')](handleError(_0x215616,null));};exports[_0xff9e('0x44')]=function(_0x5e6e11,_0x52da41){var _0x4b8c4e={'raw':![],'where':{'id':_0x5e6e11[_0xff9e('0x45')]['id']}},_0x508810={};_0x508810[_0xff9e('0x2f')]=_[_0xff9e('0x30')](db['VoiceMusicOnHold']['rawAttributes']);_0x508810[_0xff9e('0x31')]=_[_0xff9e('0x30')](_0x5e6e11['query']);_0x508810['filters']=_['intersection'](_0x508810['model'],_0x508810[_0xff9e('0x31')]);_0x4b8c4e[_0xff9e('0x33')]=_[_0xff9e('0x32')](_0x508810[_0xff9e('0x2f')],qs['fields'](_0x5e6e11[_0xff9e('0x31')]['fields']));_0x4b8c4e[_0xff9e('0x33')]=_0x4b8c4e['attributes']['length']?_0x4b8c4e[_0xff9e('0x33')]:_0x508810[_0xff9e('0x2f')];if(_0x5e6e11['query'][_0xff9e('0x3f')]){_0x4b8c4e[_0xff9e('0x46')]=[{'all':!![]}];}_0x4b8c4e=_[_0xff9e('0x3a')]({},_0x4b8c4e,_0x5e6e11[_0xff9e('0x3e')]);return db[_0xff9e('0x40')]['find'](_0x4b8c4e)[_0xff9e('0x25')](handleEntityNotFound(_0x52da41,null))[_0xff9e('0x25')](respondWithResult(_0x52da41,null))[_0xff9e('0x43')](handleError(_0x52da41,null));};exports[_0xff9e('0x47')]=function(_0x230263,_0x337ec8){if(_0x230263[_0xff9e('0x48')]['id']){delete _0x230263[_0xff9e('0x48')]['id'];}return db[_0xff9e('0x40')][_0xff9e('0x49')]({'where':{'id':_0x230263[_0xff9e('0x45')]['id']}})[_0xff9e('0x25')](handleEntityNotFound(_0x337ec8,null))[_0xff9e('0x25')](saveUpdates(_0x230263[_0xff9e('0x48')],null))[_0xff9e('0x25')](respondWithResult(_0x337ec8,null))[_0xff9e('0x43')](handleError(_0x337ec8,null));};exports[_0xff9e('0x4a')]=function(_0x2dad53,_0x2bcdde,_0x402c40){return db[_0xff9e('0x4b')][_0xff9e('0x4c')](function(_0x4855f5){if(_0x2dad53[_0xff9e('0x48')]['mode']===_0xff9e('0x4d')){_0x2dad53['body'][_0xff9e('0x4e')]=path[_0xff9e('0x4f')](config['root'],_0xff9e('0x50'),_0x2dad53[_0xff9e('0x48')][_0xff9e('0x2a')]);}return db[_0xff9e('0x40')][_0xff9e('0x4a')](_0x2dad53[_0xff9e('0x48')],{'transaction':_0x4855f5})[_0xff9e('0x25')](function(_0x191b46){if(_0x2dad53[_0xff9e('0x48')][_0xff9e('0x51')]===_0xff9e('0x4d')){fs[_0xff9e('0x52')](_0x191b46[_0xff9e('0x4e')],parseInt(_0xff9e('0x53'),0x8));}var _0x19c0ff=_0x2dad53['user'][_0xff9e('0x26')]({'plain':!![]});if(!_0x19c0ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19c0ff[_0xff9e('0x54')]===_0xff9e('0x55')){var _0x345d3e=_0x191b46[_0xff9e('0x26')]({'plain':!![]});return db[_0xff9e('0x56')][_0xff9e('0x49')]({'where':{'name':_0xff9e('0x27'),'userProfileId':_0x19c0ff[_0xff9e('0x57')]},'raw':!![]})[_0xff9e('0x25')](function(_0x3138a9){if(_0x3138a9&&_0x3138a9[_0xff9e('0x58')]===0x0){return db[_0xff9e('0x59')][_0xff9e('0x4a')]({'name':_0x345d3e[_0xff9e('0x2a')],'resourceId':_0x345d3e['id'],'type':_0x3138a9['name'],'sectionId':_0x3138a9['id']},{})[_0xff9e('0x25')](function(){return _0x191b46;});}else{return _0x191b46;}})[_0xff9e('0x43')](function(_0xfd7a94){logger[_0xff9e('0x5a')](_0xff9e('0x5b'),_0xfd7a94);});}return _0x191b46;});})['then'](respondWithResult(_0x2bcdde,0xc9))[_0xff9e('0x43')](handleError(_0x2bcdde,null));};exports[_0xff9e('0x28')]=function(_0x3ee0a4,_0x2a7a64,_0x33bb44){var _0x1cea4a;return db[_0xff9e('0x40')][_0xff9e('0x49')]({'where':{'id':_0x3ee0a4[_0xff9e('0x45')]['id']}})[_0xff9e('0x25')](function(_0x56484c){if(_0x56484c){return db[_0xff9e('0x4b')][_0xff9e('0x4c')](function(_0x3c2cac){return _0x56484c[_0xff9e('0x28')]({'transaction':_0x3c2cac,'raw':!![]})[_0xff9e('0x25')](function(_0x481303){if(_0x481303[_0xff9e('0x4e')]){fs[_0xff9e('0x5c')](_0x481303[_0xff9e('0x4e')])[_0xff9e('0x5d')](function(_0x5ed43e){fs[_0xff9e('0x5e')](path[_0xff9e('0x4f')](_0x481303[_0xff9e('0x4e')],_0x5ed43e));});fs['rmdirSync'](_0x481303[_0xff9e('0x4e')]);}return _0x481303;});})[_0xff9e('0x43')](function(_0x193e38){throw new db[(_0xff9e('0x5f'))][(_0xff9e('0x60'))](_0x193e38[_0xff9e('0x61')]);});}})['then'](handleEntityNotFound(_0x2a7a64,null))[_0xff9e('0x25')](removeEntity(_0x2a7a64,null))['catch'](handleError(_0x2a7a64,null));};exports[_0xff9e('0x62')]=function(_0x517e69,_0x998c54,_0x3313c5){return db[_0xff9e('0x4b')][_0xff9e('0x4c')](function(_0x3260b8){var _0x27b480;return db['VoiceMusicOnHold'][_0xff9e('0x49')]({'where':{'id':_0x517e69[_0xff9e('0x45')]['id']}})[_0xff9e('0x25')](function(_0xca4065){if(_0xca4065){_0x27b480=_0xca4065;return _0xca4065[_0xff9e('0x62')](_0x517e69[_0xff9e('0x48')]['id'],{'transaction':_0x3260b8});}})[_0xff9e('0x25')](function(_0x456617){if(_0x456617){return db[_0xff9e('0x63')][_0xff9e('0x64')]({'where':{'id':_0x517e69[_0xff9e('0x48')]['id']},'attributes':['id',_0xff9e('0x2a'),'save_name','converted_format',_0xff9e('0x65')],'raw':!![]});}})[_0xff9e('0x25')](function(_0x1a4636){if(_0x1a4636){var _0x59e1be=path[_0xff9e('0x4f')](config[_0xff9e('0x66')],_0xff9e('0x67'),util[_0xff9e('0x68')](_0xff9e('0x69'),path['basename'](_0x1a4636[_0xff9e('0x6a')],path['extname'](_0x1a4636[_0xff9e('0x6a')])),_0x1a4636[_0xff9e('0x6b')]));var _0x10fbe6=path[_0xff9e('0x4f')](config['root'],_0xff9e('0x50'),_0x27b480[_0xff9e('0x2a')],util[_0xff9e('0x68')]('%s.%s',_0x1a4636[_0xff9e('0x2a')],_0x1a4636['converted_format']));fs['symlinkSync'](_0x59e1be,_0x10fbe6);return _0x1a4636;}})['catch'](function(_0x4daf77){throw new db[(_0xff9e('0x5f'))][(_0xff9e('0x60'))](_0x4daf77['message']);});})[_0xff9e('0x25')](handleEntityNotFound(_0x998c54,null))[_0xff9e('0x25')](respondWithResult(_0x998c54,0xc9))[_0xff9e('0x43')](handleError(_0x998c54,null));};exports[_0xff9e('0x6c')]=function(_0x4833b6,_0x456742,_0x4e42ad){return db['sequelize'][_0xff9e('0x4c')](function(_0x57ad64){var _0x45bcbd;return db[_0xff9e('0x40')][_0xff9e('0x64')]({'where':{'id':_0x4833b6['params']['id']}})[_0xff9e('0x25')](handleEntityNotFound(_0x456742,null))[_0xff9e('0x25')](function(_0x1b98bb){if(_0x1b98bb){_0x45bcbd=_0x1b98bb;return _0x1b98bb[_0xff9e('0x6c')](_0x4833b6[_0xff9e('0x45')][_0xff9e('0x6d')]);}})[_0xff9e('0x25')](function(_0x1da183){if(_0x1da183){return db['Sound'][_0xff9e('0x64')]({'where':{'id':_0x4833b6[_0xff9e('0x45')][_0xff9e('0x6d')]},'attributes':['id','name','save_name',_0xff9e('0x6b'),_0xff9e('0x65')],'raw':!![]});}})['then'](function(_0x36ed5e){if(_0x36ed5e){fs['unlinkSync'](path['join'](_0x45bcbd[_0xff9e('0x4e')],util[_0xff9e('0x68')](_0xff9e('0x69'),_0x36ed5e['name'],_0x36ed5e[_0xff9e('0x6b')])));return _0x36ed5e;}})[_0xff9e('0x43')](function(_0x4bdff4){throw new db['Sequelize'][(_0xff9e('0x60'))](_0x4bdff4[_0xff9e('0x61')]);});})[_0xff9e('0x25')](handleEntityNotFound(_0x456742,null))[_0xff9e('0x25')](respondWithStatusCode(_0x456742,0xcc))['catch'](handleError(_0x456742,null));};exports[_0xff9e('0x6e')]=function(_0x21fdb6,_0x2ae894,_0x5d0282){var _0x283f6b={};var _0x3e29ff={};var _0x53994e;var _0x172018;return db[_0xff9e('0x40')][_0xff9e('0x64')]({'where':{'id':_0x21fdb6['params']['id']}})['then'](handleEntityNotFound(_0x2ae894,null))[_0xff9e('0x25')](function(_0x110f17){if(_0x110f17){_0x53994e=_0x110f17;_0x3e29ff[_0xff9e('0x2f')]=_['keys'](db['Sound'][_0xff9e('0x2c')]);_0x3e29ff['query']=_[_0xff9e('0x30')](_0x21fdb6[_0xff9e('0x31')]);_0x3e29ff['filters']=_[_0xff9e('0x32')](_0x3e29ff['model'],_0x3e29ff[_0xff9e('0x31')]);_0x283f6b[_0xff9e('0x33')]=_[_0xff9e('0x32')](_0x3e29ff[_0xff9e('0x2f')],qs[_0xff9e('0x34')](_0x21fdb6[_0xff9e('0x31')]['fields']));_0x283f6b[_0xff9e('0x33')]=_0x283f6b[_0xff9e('0x33')][_0xff9e('0x35')]?_0x283f6b[_0xff9e('0x33')]:_0x3e29ff['model'];_0x283f6b['order']=qs[_0xff9e('0x36')](_0x21fdb6[_0xff9e('0x31')][_0xff9e('0x36')]);_0x283f6b[_0xff9e('0x37')]=qs[_0xff9e('0x38')](_[_0xff9e('0x39')](_0x21fdb6['query'],_0x3e29ff[_0xff9e('0x38')]));if(_0x21fdb6['query'][_0xff9e('0x3d')]){_0x283f6b[_0xff9e('0x37')]=_[_0xff9e('0x3a')](_0x283f6b[_0xff9e('0x37')],{'$or':_[_0xff9e('0x3b')](_0x283f6b['attributes'],function(_0x22b2cc){var _0x5dc0ba={};_0x5dc0ba[_0x22b2cc]={'$like':'%'+_0x21fdb6[_0xff9e('0x31')]['filter']+'%'};return _0x5dc0ba;})});}_0x283f6b=_[_0xff9e('0x3a')]({},_0x283f6b,_0x21fdb6[_0xff9e('0x3e')]);return _0x53994e['getSounds'](_0x283f6b);}})['then'](function(_0x5b8d3a){if(_0x5b8d3a){_0x172018=_0x5b8d3a[_0xff9e('0x35')];if(!_0x21fdb6[_0xff9e('0x31')][_0xff9e('0x6f')](_0xff9e('0x70'))){_0x283f6b[_0xff9e('0x1e')]=qs[_0xff9e('0x1e')](_0x21fdb6[_0xff9e('0x31')][_0xff9e('0x1e')]);_0x283f6b[_0xff9e('0x1c')]=qs[_0xff9e('0x1c')](_0x21fdb6[_0xff9e('0x31')][_0xff9e('0x1c')]);}return _0x53994e[_0xff9e('0x6e')](_0x283f6b);}})['then'](function(_0x233788){if(_0x233788){return _0x233788?{'count':_0x172018,'rows':_0x233788}:null;}})['then'](respondWithResult(_0x2ae894,null))[_0xff9e('0x43')](handleError(_0x2ae894,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4dd8cf6..58a6148 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 _0x46b6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x2e5981,_0xe4e846){var _0x6e4fef=function(_0x252b0c){while(--_0x252b0c){_0x2e5981['push'](_0x2e5981['shift']());}};_0x6e4fef(++_0xe4e846);}(_0x46b6,0xb3));var _0x646b=function(_0x47ae8c,_0x25dd29){_0x47ae8c=_0x47ae8c-0x0;var _0x54dd25=_0x46b6[_0x47ae8c];return _0x54dd25;};'use strict';var _=require(_0x646b('0x0'));var util=require(_0x646b('0x1'));var logger=require(_0x646b('0x2'))('api');var moment=require(_0x646b('0x3'));var BPromise=require(_0x646b('0x4'));var rp=require(_0x646b('0x5'));var fs=require('fs');var path=require(_0x646b('0x6'));var rimraf=require(_0x646b('0x7'));var config=require(_0x646b('0x8'));var attributes=require(_0x646b('0x9'));module[_0x646b('0xa')]=function(_0x2fc5c5,_0x6696f9){return _0x2fc5c5[_0x646b('0xb')](_0x646b('0xc'),attributes,{'tableName':_0x646b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5839=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x5839,0x155));var _0x9583=function(_0x1d8e7d,_0x10bce9){_0x1d8e7d=_0x1d8e7d-0x0;var _0x214545=_0x5839[_0x1d8e7d];return _0x214545;};'use strict';var _=require(_0x9583('0x0'));var util=require(_0x9583('0x1'));var logger=require(_0x9583('0x2'))(_0x9583('0x3'));var moment=require(_0x9583('0x4'));var BPromise=require(_0x9583('0x5'));var rp=require(_0x9583('0x6'));var fs=require('fs');var path=require(_0x9583('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9583('0x8'));module['exports']=function(_0x57ea7a,_0xf16e0f){return _0x57ea7a[_0x9583('0x9')](_0x9583('0xa'),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 6af9251..294ea76 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(_0x49f7b8,_0x251e85){var _0x93e57a=function(_0x4638d6){while(--_0x4638d6){_0x49f7b8['push'](_0x49f7b8['shift']());}};_0x93e57a(++_0x251e85);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xcb91[_0x4c4037];return _0x357862;};'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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa65918,_0x1c9d4c){var _0x52abbb=function(_0x63b259){while(--_0x63b259){_0xa65918['push'](_0xa65918['shift']());}};_0x52abbb(++_0x1c9d4c);}(_0x70e0,0x17b));var _0x070e=function(_0xf881f7,_0x647d58){_0xf881f7=_0xf881f7-0x0;var _0x21c927=_0x70e0[_0xf881f7];return _0x21c927;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 083fc49..a8208b3 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 _0x102b=['show','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','/:id/users','removeAgents','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe'];(function(_0x76c32e,_0x4be408){var _0x2f2fc8=function(_0x42c810){while(--_0x42c810){_0x76c32e['push'](_0x76c32e['shift']());}};_0x2f2fc8(++_0x4be408);}(_0x102b,0x1be));var _0xb102=function(_0x4362f4,_0x129236){_0x4362f4=_0x4362f4-0x0;var _0x307e28=_0x102b[_0x4362f4];return _0x307e28;};'use strict';var multer=require('multer');var util=require(_0xb102('0x0'));var path=require('path');var timeout=require(_0xb102('0x1'));var express=require(_0xb102('0x2'));var router=express[_0xb102('0x3')]();var fs_extra=require(_0xb102('0x4'));var auth=require(_0xb102('0x5'));var interaction=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var controller=require(_0xb102('0x8'));router['get']('/',auth[_0xb102('0x9')](),controller[_0xb102('0xa')]);router[_0xb102('0xb')](_0xb102('0xc'),auth[_0xb102('0x9')](),controller['describe']);router[_0xb102('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb102('0xd')]);router['get']('/:id/users',auth[_0xb102('0x9')](),controller[_0xb102('0xe')]);router['get'](_0xb102('0xf'),auth[_0xb102('0x9')](),controller[_0xb102('0x10')]);router[_0xb102('0x11')]('/',auth[_0xb102('0x9')](),controller[_0xb102('0x12')]);router[_0xb102('0x11')]('/:id/users',auth[_0xb102('0x9')](),controller['addAgents']);router[_0xb102('0x11')](_0xb102('0xf'),auth['isAuthenticated'](),controller[_0xb102('0x13')]);router[_0xb102('0x14')]('/:id',auth[_0xb102('0x9')](),controller[_0xb102('0x15')]);router[_0xb102('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb102('0x16')](_0xb102('0x17'),auth[_0xb102('0x9')](),controller[_0xb102('0x18')]);router['delete']('/:id/teams',auth[_0xb102('0x9')](),controller[_0xb102('0x19')]);module[_0xb102('0x1a')]=router; \ No newline at end of file +var _0xdabe=['delete','removeAgents','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','addTeams','put','update'];(function(_0x245e32,_0x26a5d0){var _0x6f9476=function(_0x10ba49){while(--_0x10ba49){_0x245e32['push'](_0x245e32['shift']());}};_0x6f9476(++_0x26a5d0);}(_0xdabe,0x1a8));var _0xedab=function(_0x530f5b,_0x531d65){_0x530f5b=_0x530f5b-0x0;var _0x32f861=_0xdabe[_0x530f5b];return _0x32f861;};'use strict';var multer=require('multer');var util=require(_0xedab('0x0'));var path=require(_0xedab('0x1'));var timeout=require(_0xedab('0x2'));var express=require(_0xedab('0x3'));var router=express[_0xedab('0x4')]();var fs_extra=require(_0xedab('0x5'));var auth=require(_0xedab('0x6'));var interaction=require(_0xedab('0x7'));var config=require('../../config/environment');var controller=require(_0xedab('0x8'));router[_0xedab('0x9')]('/',auth['isAuthenticated'](),controller[_0xedab('0xa')]);router[_0xedab('0x9')](_0xedab('0xb'),auth[_0xedab('0xc')](),controller[_0xedab('0xd')]);router['get']('/:id',auth[_0xedab('0xc')](),controller['show']);router[_0xedab('0x9')](_0xedab('0xe'),auth[_0xedab('0xc')](),controller[_0xedab('0xf')]);router['get'](_0xedab('0x10'),auth['isAuthenticated'](),controller[_0xedab('0x11')]);router['post']('/',auth[_0xedab('0xc')](),controller[_0xedab('0x12')]);router[_0xedab('0x13')](_0xedab('0xe'),auth[_0xedab('0xc')](),controller[_0xedab('0x14')]);router[_0xedab('0x13')]('/:id/teams',auth[_0xedab('0xc')](),controller[_0xedab('0x15')]);router[_0xedab('0x16')]('/:id',auth[_0xedab('0xc')](),controller[_0xedab('0x17')]);router[_0xedab('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xedab('0x18')](_0xedab('0xe'),auth[_0xedab('0xc')](),controller[_0xedab('0x19')]);router[_0xedab('0x18')]('/:id/teams',auth[_0xedab('0xc')](),controller[_0xedab('0x1a')]);module[_0xedab('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 b5ddc53..68b0efa 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 _0xdb66=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x9fcf2f,_0xe87213){var _0x25c013=function(_0x3c8002){while(--_0x3c8002){_0x9fcf2f['push'](_0x9fcf2f['shift']());}};_0x25c013(++_0xe87213);}(_0xdb66,0x156));var _0x6db6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xdb66[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x6db6('0x0'));module[_0x6db6('0x1')]={'name':{'type':Sequelize[_0x6db6('0x2')],'allowNull':![],'unique':_0x6db6('0x3')},'prefix':{'type':Sequelize[_0x6db6('0x4')],'get':function(_0x1cb6bb){return _0x6db6('0x5')+this[_0x6db6('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x6db6('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x6db6('0x7')]}}; \ No newline at end of file +var _0x8b9a=['sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x3ff659,_0x7a2e44){var _0x50f557=function(_0x5b8dce){while(--_0x5b8dce){_0x3ff659['push'](_0x3ff659['shift']());}};_0x50f557(++_0x7a2e44);}(_0x8b9a,0x12c));var _0xa8b9=function(_0x4f2157,_0x2e32af){_0x4f2157=_0x4f2157-0x0;var _0x7927b6=_0x8b9a[_0x4f2157];return _0x7927b6;};'use strict';var Sequelize=require(_0xa8b9('0x0'));module[_0xa8b9('0x1')]={'name':{'type':Sequelize[_0xa8b9('0x2')],'allowNull':![],'unique':_0xa8b9('0x3')},'prefix':{'type':Sequelize[_0xa8b9('0x4')],'get':function(_0x503816){return _0xa8b9('0x5')+this['getDataValue'](_0xa8b9('0x3'))+'-';}},'description':{'type':Sequelize[_0xa8b9('0x2')]},'callerIdAll':{'type':Sequelize[_0xa8b9('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 20fff95..7ae48db 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 _0x351d=['isEmpty','forEach','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','VoicePrefixes','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','VoicePrefix','findAll','catch','show','params','length','merge','options','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','CDR(prefix)=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x351d,0x90));var _0xd351=function(_0x24a31d,_0x2dfb5a){_0x24a31d=_0x24a31d-0x0;var _0x5a7d7d=_0x351d[_0x24a31d];return _0x5a7d7d;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd351('0x13')]=_[_0xd351('0x14')](config[_0xd351('0x13')],{'host':_0xd351('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd351('0x13')]));require(_0xd351('0x16'))['register'](socket);function respondWithStatusCode(_0xc5a145,_0xb106ef){_0xb106ef=_0xb106ef||0xcc;return function(_0x3c2299){if(_0x3c2299){return _0xc5a145[_0xd351('0x17')](_0xb106ef);}return _0xc5a145[_0xd351('0x18')](_0xb106ef)['end']();};}function respondWithResult(_0x9f790f,_0x49d8bb){_0x49d8bb=_0x49d8bb||0xc8;return function(_0x5bdc03){if(_0x5bdc03){return _0x9f790f[_0xd351('0x18')](_0x49d8bb)['json'](_0x5bdc03);}};}function respondWithFilteredResult(_0x21e591,_0x1de35f){return function(_0x4e0164){if(_0x4e0164){var _0x4c6693=typeof _0x1de35f[_0xd351('0x19')]===_0xd351('0x1a')&&typeof _0x1de35f[_0xd351('0x1b')]===_0xd351('0x1a');var _0x51f265=_0x4e0164[_0xd351('0x1c')];var _0x4abbed=_0x4c6693?0x0:_0x1de35f['offset'];var _0x37d3ac=_0x4c6693?_0x4e0164['count']:_0x1de35f[_0xd351('0x19')]+_0x1de35f[_0xd351('0x1b')];var _0x3634c9;if(_0x37d3ac>=_0x51f265){_0x37d3ac=_0x51f265;_0x3634c9=0xc8;}else{_0x3634c9=0xce;}_0x21e591[_0xd351('0x18')](_0x3634c9);return _0x21e591[_0xd351('0x1d')]('Content-Range',_0x4abbed+'-'+_0x37d3ac+'/'+_0x51f265)[_0xd351('0x1e')](_0x4e0164);}return null;};}function patchUpdates(_0xbbc58){return function(_0x241265){try{jsonpatch['apply'](_0x241265,_0xbbc58,!![]);}catch(_0x1ce7f7){return BPromise[_0xd351('0x1f')](_0x1ce7f7);}return _0x241265[_0xd351('0x20')]();};}function saveUpdates(_0x59fb6d,_0x1ce279){return function(_0x34a5cb){if(_0x34a5cb){return _0x34a5cb[_0xd351('0x21')](_0x59fb6d)[_0xd351('0x22')](function(_0x489c9a){return _0x489c9a;});}return null;};}function removeEntity(_0x40f7f3,_0x483c92){return function(_0x358bff){if(_0x358bff){return _0x358bff[_0xd351('0x23')]()['then'](function(){var _0x2648d0=_0x358bff['get']({'plain':!![]});var _0x50d67e=_0xd351('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x50d67e,'resourceId':_0x2648d0['id']}})[_0xd351('0x22')](function(){return _0x358bff;});})['then'](function(){_0x40f7f3[_0xd351('0x18')](0xcc)[_0xd351('0x25')]();});}};}function handleEntityNotFound(_0x407b50,_0x4d3f48){return function(_0x71ce9c){if(!_0x71ce9c){_0x407b50['sendStatus'](0x194);}return _0x71ce9c;};}function handleError(_0x1c826b,_0x50039b){_0x50039b=_0x50039b||0x1f4;return function(_0x5f07b1){logger[_0xd351('0x26')](_0x5f07b1[_0xd351('0x27')]);if(_0x5f07b1[_0xd351('0x28')]){delete _0x5f07b1[_0xd351('0x28')];}_0x1c826b['status'](_0x50039b)[_0xd351('0x29')](_0x5f07b1);};}exports[_0xd351('0x2a')]=function(_0x38023c,_0x41da60){var _0x140591={},_0x205c79={},_0x103a7b={'count':0x0,'rows':[]};var _0x898949=_[_0xd351('0x2b')](db['VoicePrefix'][_0xd351('0x2c')],function(_0x453270){return{'name':_0x453270[_0xd351('0x2d')],'type':_0x453270[_0xd351('0x2e')]['key']};});_0x205c79[_0xd351('0x2f')]=_[_0xd351('0x2b')](_0x898949,_0xd351('0x28'));_0x205c79[_0xd351('0x30')]=_[_0xd351('0x31')](_0x38023c[_0xd351('0x30')]);_0x205c79[_0xd351('0x32')]=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],_0x205c79['query']);_0x140591['attributes']=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x38023c[_0xd351('0x30')][_0xd351('0x34')]));_0x140591[_0xd351('0x35')]=_0x140591['attributes']['length']?_0x140591[_0xd351('0x35')]:_0x205c79['model'];if(!_0x38023c[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x140591[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x38023c[_0xd351('0x30')][_0xd351('0x1b')]);_0x140591[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38023c[_0xd351('0x30')][_0xd351('0x19')]);}_0x140591['order']=qs[_0xd351('0x38')](_0x38023c['query'][_0xd351('0x38')]);_0x140591[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x38023c[_0xd351('0x30')],_0x205c79[_0xd351('0x32')]),_0x898949);if(_0x38023c['query'][_0xd351('0x3b')]){_0x140591[_0xd351('0x39')]=_['merge'](_0x140591[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x898949,function(_0x382f5b){if(_0x382f5b[_0xd351('0x2e')]!==_0xd351('0x3c')){var _0x5cc105={};_0x5cc105[_0x382f5b['name']]={'$like':'%'+_0x38023c[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x5cc105;}})});}_0x140591=_['merge']({},_0x140591,_0x38023c['options']);var _0x16677f={'where':_0x140591[_0xd351('0x39')]};return db['VoicePrefix']['count'](_0x16677f)[_0xd351('0x22')](function(_0x18f9d1){_0x103a7b[_0xd351('0x1c')]=_0x18f9d1;if(_0x38023c[_0xd351('0x30')][_0xd351('0x3d')]){_0x140591[_0xd351('0x3e')]=[{'all':!![]}];}return db[_0xd351('0x3f')][_0xd351('0x40')](_0x140591);})[_0xd351('0x22')](function(_0x553360){_0x103a7b['rows']=_0x553360;return _0x103a7b;})[_0xd351('0x22')](respondWithFilteredResult(_0x41da60,_0x140591))[_0xd351('0x41')](handleError(_0x41da60,null));};exports[_0xd351('0x42')]=function(_0x35f38f,_0x2bdd8f){var _0x4332e7={'raw':![],'where':{'id':_0x35f38f[_0xd351('0x43')]['id']}},_0xeaf4dc={};_0xeaf4dc[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x3f')][_0xd351('0x2c')]);_0xeaf4dc[_0xd351('0x30')]=_[_0xd351('0x31')](_0x35f38f[_0xd351('0x30')]);_0xeaf4dc[_0xd351('0x32')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],_0xeaf4dc[_0xd351('0x30')]);_0x4332e7[_0xd351('0x35')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x35f38f[_0xd351('0x30')][_0xd351('0x34')]));_0x4332e7[_0xd351('0x35')]=_0x4332e7['attributes'][_0xd351('0x44')]?_0x4332e7['attributes']:_0xeaf4dc[_0xd351('0x2f')];if(_0x35f38f[_0xd351('0x30')]['includeAll']){_0x4332e7['include']=[{'all':!![]}];}_0x4332e7=_[_0xd351('0x45')]({},_0x4332e7,_0x35f38f[_0xd351('0x46')]);return db[_0xd351('0x3f')]['find'](_0x4332e7)[_0xd351('0x22')](handleEntityNotFound(_0x2bdd8f,null))[_0xd351('0x22')](respondWithResult(_0x2bdd8f,null))['catch'](handleError(_0x2bdd8f,null));};exports[_0xd351('0x23')]=function(_0x53a2e8,_0x1eb5f3){return db[_0xd351('0x3f')]['find']({'where':{'id':_0x53a2e8['params']['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x1eb5f3,null))['then'](removeEntity(_0x1eb5f3,null))[_0xd351('0x41')](handleError(_0x1eb5f3,null));};exports[_0xd351('0x47')]=function(_0x9f1cd0,_0x4a27e3){return db[_0xd351('0x3f')]['describe']()['then'](respondWithResult(_0x4a27e3,null))['catch'](handleError(_0x4a27e3,null));};exports[_0xd351('0x48')]=function(_0x292af3,_0x334029){var _0x5a2e9b;return db['sequelize'][_0xd351('0x49')](function(_0x42f248){return db['VoicePrefix'][_0xd351('0x48')](_0x292af3[_0xd351('0x4a')],{'transaction':_0x42f248})['then'](function(_0x24ee0f){_0x5a2e9b=_0x24ee0f['get']({'plain':!![]});return db[_0xd351('0x4b')]['find']({'where':{'id':_0x5a2e9b[_0xd351('0x4c')]},'raw':!![]})[_0xd351('0x22')](function(_0x169ab1){return createVoicePrefixExtensions(_0x5a2e9b,_0x169ab1,_0x42f248);});});})[_0xd351('0x22')](function(){var _0xb5f3ee=_0x292af3[_0xd351('0x4d')][_0xd351('0x4e')]({'plain':!![]});if(!_0xb5f3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5f3ee['role']===_0xd351('0x4d')){var _0x624224=_0x5a2e9b;return db['UserProfileSection'][_0xd351('0x4f')]({'where':{'name':_0xd351('0x24'),'userProfileId':_0xb5f3ee[_0xd351('0x50')]},'raw':!![]})['then'](function(_0x169122){if(_0x169122&&_0x169122['autoAssociation']===0x0){return db['UserProfileResource'][_0xd351('0x48')]({'name':_0x624224[_0xd351('0x28')],'resourceId':_0x624224['id'],'type':_0x169122['name'],'sectionId':_0x169122['id']},{})[_0xd351('0x22')](function(){return _0x5a2e9b;});}else{return _0x5a2e9b;}})[_0xd351('0x41')](function(_0x2d9747){logger[_0xd351('0x26')](_0xd351('0x51'),_0x2d9747);throw _0x2d9747;});}return _0x5a2e9b;})[_0xd351('0x22')](respondWithResult(_0x334029,null))['catch'](handleError(_0x334029,null));};function Extension(_0x1e1173,_0x2a7390,_0x36fb5b,_0x8461b){this[_0xd351('0x52')]=_0xd351('0x53');this[_0xd351('0x54')]=_0x1e1173;this['app']=_0x36fb5b;this[_0xd351('0x2e')]='system';this[_0xd351('0x55')]=_0xd351('0x56');this[_0xd351('0x57')]=_0x2a7390;this[_0xd351('0x58')]=_0x8461b;}function createVoicePrefixExtensions(_0x70cdb,_0x4eaf18,_0x413931){return new BPromise(function(_0x4c8038,_0x4685fa){var _0x45bcc7=new Extension(formatPrefixName(_0x70cdb[_0xd351('0x59')]),0x1,_0xd351('0x5a'),_0xd351('0x5b'));_0x45bcc7['VoicePrefixId']=_0x70cdb['id'];return db['VoiceExtension'][_0xd351('0x48')](_0x45bcc7,{'transaction':_0x413931})[_0xd351('0x22')](function(_0x4b9367){var _0x2d2655=_0x4b9367[_0xd351('0x4e')]({'plain':!![]});var _0x2718e9=_['map'](addVoicePrefixExtensions(_0x70cdb,_0x4eaf18),function(_0x2b47ab){_0x2b47ab[_0xd351('0x4c')]=_0x2d2655['id'];_0x2b47ab[_0xd351('0x5c')]=_0x70cdb['id'];return _0x2b47ab;});return db[_0xd351('0x4b')]['bulkCreate'](_0x2718e9,{'transaction':_0x413931})['then'](function(_0x40c78b){if(!_0x40c78b){return _0x4685fa(_0xd351('0x5d'));}else{return _0x4c8038(_0x40c78b);}})[_0xd351('0x41')](function(_0xa000b4){return _0x4685fa(_0xa000b4);});});;});};function addVoicePrefixExtensions(_0x36b38f,_0x3b0993){var _0x2c83fe=[];var _0x5e2e06=formatPrefixName(_0x36b38f[_0xd351('0x59')]);_0x2c83fe['push'](new Extension(_0x5e2e06,0x2,'Set',_0xd351('0x5e')+_0x36b38f[_0xd351('0x28')]));if(_0x36b38f['callerIdAll']){_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,'Set','PREFIX-CALLERIDALL='+_0x36b38f['callerIdAll']));}else{_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,_0xd351('0x5a'),_0xd351('0x60')));}_0x2c83fe['push'](new Extension(_0x5e2e06,0x4,_0xd351('0x61'),_0x3b0993[_0xd351('0x52')]+','+_0xd351('0x62')+(0x8+_0x36b38f[_0xd351('0x28')][_0xd351('0x44')])+'}'+','+0x1));return _0x2c83fe;}function formatPrefixName(_0x475534){var _0x15fcab='_';for(var _0x6bf19c=0x0;_0x6bf19c<_0x475534[_0xd351('0x44')];_0x6bf19c++){if(_0x475534[_0xd351('0x63')](_0x6bf19c)=='-'){_0x15fcab+=_0x475534[_0xd351('0x63')](_0x6bf19c);}else{_0x15fcab+='['+_0x475534['charAt'](_0x6bf19c)+']';}}_0x15fcab+='.';return _0x15fcab;}exports[_0xd351('0x21')]=function(_0x2d59a5,_0x431e91,_0xcc7a10){var _0xf24a29=_0x2d59a5[_0xd351('0x4a')];_0xf24a29['prefix']=_0xd351('0x64')+_0xf24a29[_0xd351('0x28')]+'-';return db['sequelize']['transaction'](function(_0x436e1d){return db[_0xd351('0x3f')][_0xd351('0x21')](_0xf24a29,{'where':{'id':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x23')]({'where':{'VoicePrefixId':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x4f')]({'where':{'id':_0xf24a29['VoiceExtensionId']},'raw':!![]})[_0xd351('0x22')](function(_0x129623){return createVoicePrefixExtensions(_0xf24a29,_0x129623,_0x436e1d);});});});})['then'](function(){return db[_0xd351('0x3f')]['findById'](_0xf24a29['id']);})[_0xd351('0x22')](respondWithResult(_0x431e91,null))['catch'](handleError(_0x431e91,null));};exports[_0xd351('0x65')]=function(_0x406d8a,_0xbd31ca,_0x451445){return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x406d8a[_0xd351('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd31ca,null))[_0xd351('0x22')](function(_0x2558b4){if(_0x2558b4){return _0x2558b4[_0xd351('0x65')](_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')],_['omit'](_0x406d8a[_0xd351('0x4a')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x67')](function(_0x54b38c){for(var _0x38a3ec=0x0;_0x38a3ec<_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0xd351('0x44')];_0x38a3ec+=0x1){socket[_0xd351('0x68')](_0xd351('0x69'),{'UserId':Number(_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0x38a3ec]),'VoicePrefixId':Number(_0x406d8a[_0xd351('0x43')]['id'])});}return _0x54b38c;});}})['then'](respondWithResult(_0xbd31ca,null))[_0xd351('0x41')](handleError(_0xbd31ca,null));};exports[_0xd351('0x6a')]=function(_0x5036e6,_0x44df63,_0x4c1468){return db['VoicePrefix']['find']({'where':{'id':_0x5036e6[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x44df63,null))[_0xd351('0x22')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9[_0xd351('0x6a')](_0x5036e6['query'][_0xd351('0x66')])['then'](function(){if(_[_0xd351('0x6b')](_0x5036e6[_0xd351('0x30')][_0xd351('0x66')])){for(var _0x16dd16=0x0;_0x16dd16<_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0xd351('0x44')];_0x16dd16+=0x1){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0x16dd16]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}}else{socket['emit'](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}});}})[_0xd351('0x22')](respondWithStatusCode(_0x44df63,null))['catch'](handleError(_0x44df63,null));};exports[_0xd351('0x6d')]=function(_0x1e6c85,_0x2adab4,_0x2a1ea4){var _0x4a4b25={};var _0x1fda25={};var _0x36bbee;var _0x48b5ee;return db[_0xd351('0x3f')][_0xd351('0x6e')]({'where':{'id':_0x1e6c85[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x2adab4,null))['then'](function(_0x523895){if(_0x523895){_0x36bbee=_0x523895;_0x1fda25[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x6f')][_0xd351('0x2c')]);_0x1fda25['query']=_[_0xd351('0x31')](_0x1e6c85[_0xd351('0x30')]);_0x1fda25[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1fda25[_0xd351('0x2f')],_0x1fda25['query']);_0x4a4b25[_0xd351('0x35')]=_[_0xd351('0x33')](_0x1fda25['model'],qs[_0xd351('0x34')](_0x1e6c85[_0xd351('0x30')]['fields']));_0x4a4b25[_0xd351('0x35')]=_0x4a4b25['attributes'][_0xd351('0x44')]?_0x4a4b25['attributes']:_0x1fda25[_0xd351('0x2f')];_0x4a4b25[_0xd351('0x70')]=qs[_0xd351('0x38')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x38')]);_0x4a4b25[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x1e6c85[_0xd351('0x30')],_0x1fda25['filters']));if(_0x1e6c85[_0xd351('0x30')][_0xd351('0x3b')]){_0x4a4b25[_0xd351('0x39')]=_[_0xd351('0x45')](_0x4a4b25[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x4a4b25[_0xd351('0x35')],function(_0x54041b){var _0x56458b={};_0x56458b[_0x54041b]={'$like':'%'+_0x1e6c85[_0xd351('0x30')]['filter']+'%'};return _0x56458b;})});}_0x4a4b25=_[_0xd351('0x45')]({},_0x4a4b25,_0x1e6c85[_0xd351('0x46')]);return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x2d5e2b){if(_0x2d5e2b){_0x48b5ee=_0x2d5e2b['length'];if(!_0x1e6c85[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x4a4b25[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x1b')]);_0x4a4b25[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x19')]);}return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x4ddd65){if(_0x4ddd65){return _0x4ddd65?{'count':_0x48b5ee,'rows':_0x4ddd65}:null;}})['then'](respondWithResult(_0x2adab4,null))[_0xd351('0x41')](handleError(_0x2adab4,null));};exports['getTeams']=function(_0x5c202f,_0x426964,_0x4557ed){var _0x3f6826={};var _0x1a5e8e={};var _0x54fc9c;var _0x2443bd;return db['VoicePrefix']['findOne']({'where':{'id':_0x5c202f[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x426964,null))[_0xd351('0x22')](function(_0x15690b){if(_0x15690b){_0x54fc9c=_0x15690b;_0x1a5e8e[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x71')]['rawAttributes']);_0x1a5e8e[_0xd351('0x30')]=_[_0xd351('0x31')](_0x5c202f[_0xd351('0x30')]);_0x1a5e8e[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1a5e8e[_0xd351('0x2f')],_0x1a5e8e['query']);_0x3f6826['attributes']=_[_0xd351('0x33')](_0x1a5e8e['model'],qs[_0xd351('0x34')](_0x5c202f[_0xd351('0x30')]['fields']));_0x3f6826[_0xd351('0x35')]=_0x3f6826[_0xd351('0x35')][_0xd351('0x44')]?_0x3f6826[_0xd351('0x35')]:_0x1a5e8e[_0xd351('0x2f')];_0x3f6826['order']=qs[_0xd351('0x38')](_0x5c202f['query'][_0xd351('0x38')]);_0x3f6826[_0xd351('0x39')]=qs['filters'](_[_0xd351('0x3a')](_0x5c202f[_0xd351('0x30')],_0x1a5e8e[_0xd351('0x32')]));if(_0x5c202f[_0xd351('0x30')]['filter']){_0x3f6826['where']=_['merge'](_0x3f6826[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x3f6826[_0xd351('0x35')],function(_0x40740e){var _0x3606b1={};_0x3606b1[_0x40740e]={'$like':'%'+_0x5c202f[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x3606b1;})});}_0x3f6826=_['merge']({},_0x3f6826,_0x5c202f[_0xd351('0x46')]);return _0x54fc9c['getTeams'](_0x3f6826);}})[_0xd351('0x22')](function(_0x55d564){if(_0x55d564){_0x2443bd=_0x55d564['length'];if(!_0x5c202f[_0xd351('0x30')]['hasOwnProperty'](_0xd351('0x37'))){_0x3f6826[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x5c202f[_0xd351('0x30')][_0xd351('0x1b')]);_0x3f6826[_0xd351('0x19')]=qs['offset'](_0x5c202f['query'][_0xd351('0x19')]);}return _0x54fc9c[_0xd351('0x72')](_0x3f6826);}})['then'](function(_0x3d3cfa){if(_0x3d3cfa){return _0x3d3cfa?{'count':_0x2443bd,'rows':_0x3d3cfa}:null;}})['then'](respondWithResult(_0x426964,null))[_0xd351('0x41')](handleError(_0x426964,null));};exports[_0xd351('0x73')]=function(_0x6fd03b,_0x19d16a,_0x127bf9){var _0x4ab9b9=_0x6fd03b[_0xd351('0x4a')]['ids'];var _0x581e66;return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x4ab9b9},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':'Agents','attributes':['id','name',_0xd351('0x74'),_0xd351('0x75'),_0xd351('0x76')],'raw':!![]}]})[_0xd351('0x22')](function(_0x1ddacf){if(_0x1ddacf){_0x581e66=_0x1ddacf;var _0x4cadbe=_[_0xd351('0x77')](_0x1ddacf,function(_0x269bf6){var _0x3da123=_0x269bf6[_0xd351('0x4e')]({'plain':!![]});return _0x3da123['Agents'];});return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x6fd03b['params']['id']}})[_0xd351('0x22')](function(_0x46745f){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x37d882){return _0x46745f['addTeams'](_0x4ab9b9,{'transaction':_0x37d882})[_0xd351('0x22')](function(){return BPromise[_0xd351('0x79')](_0x581e66,function(_0x5ceda1){return db[_0xd351('0x7a')]['upsert']({'TeamId':_0x5ceda1['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},{'transaction':_0x37d882});});})[_0xd351('0x22')](function(){return BPromise['each'](_0x4cadbe,function(_0x1f0812){return db[_0xd351('0x7b')][_0xd351('0x7c')]({'where':{'UserId':_0x1f0812['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},'transaction':_0x37d882});});})[_0xd351('0x22')](function(){_0x4cadbe['forEach'](function(_0x23b2fe){socket['emit'](_0xd351('0x69'),{'UserId':_0x23b2fe['id'],'VoicePrefixId':_0x46745f['id']});});});});});}})[_0xd351('0x22')](respondWithStatusCode(_0x19d16a,null))[_0xd351('0x41')](handleError(_0x19d16a,null));};exports[_0xd351('0x7d')]=function(_0x160102,_0x24ac40,_0x3b2690){return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x160102['query'][_0xd351('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':_0xd351('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xd351('0x22')](handleEntityNotFound(_0x24ac40,null))['then'](function(_0x280220){var _0x4f8f00=_[_0xd351('0x2b')](_0x280220,'id');var _0x107886=[];var _0x3a3633=[];var _0x403312=squel[_0xd351('0x7f')]();_0x403312['field'](_0xd351('0x80'))[_0xd351('0x81')]('team_has_voice_prefixes','tq')['join'](_0xd351('0x82'),'ut',_0xd351('0x83'))[_0xd351('0x39')](_0xd351('0x84'),_0x160102[_0xd351('0x43')]['id']);for(var _0x1373c0=0x0;_0x1373c0<_0x280220[_0xd351('0x44')];_0x1373c0+=0x1){let _0x78b55c=_0x280220[_0x1373c0];for(var _0x2de03c=0x0;_0x2de03c<_0x78b55c[_0xd351('0x7e')][_0xd351('0x44')];_0x2de03c+=0x1){let _0x6f4c1e=_0x78b55c[_0xd351('0x7e')][_0x2de03c];var _0x56b88b=_0x403312['clone']();_0x56b88b[_0xd351('0x39')]('ut.UserId\x20=\x20?',_0x6f4c1e['id']);_0x3a3633[_0xd351('0x5f')](db[_0xd351('0x78')][_0xd351('0x30')](_0x56b88b[_0xd351('0x85')](),{'type':db[_0xd351('0x78')][_0xd351('0x86')]['SELECT']})[_0xd351('0x22')](function(_0x2725c4){if(_0x2725c4['length']===0x1){return _0x6f4c1e['id'];}else{var _0x31c1dc=_['every'](_['map'](_0x2725c4,_0xd351('0x87')),function(_0x2f188b){return _['includes'](_0x4f8f00,_0x2f188b);});if(_0x31c1dc){return _0x6f4c1e['id'];}}}));}}return BPromise[_0xd351('0x88')](_0x3a3633)[_0xd351('0x22')](function(_0x5126a1){_0x107886=_(_0x107886)[_0xd351('0x89')](_0x5126a1)[_0xd351('0x8a')]()[_0xd351('0x8b')]();return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x160102['params']['id']}})[_0xd351('0x22')](function(_0x1db9db){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x2ef116){return _0x1db9db[_0xd351('0x7d')](_0x160102[_0xd351('0x30')][_0xd351('0x66')],{'transaction':_0x2ef116})[_0xd351('0x22')](function(){if(!_[_0xd351('0x8c')](_0x107886)){return _0x1db9db[_0xd351('0x6a')](_0x107886,{'transaction':_0x2ef116});}})[_0xd351('0x22')](function(){_0x107886[_0xd351('0x8d')](function(_0x585e94){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':_0x585e94,'VoicePrefixId':_0x1db9db['id']});});});});});});})[_0xd351('0x22')](respondWithStatusCode(_0x24ac40,null))[_0xd351('0x41')](handleError(_0x24ac40,null));}; \ No newline at end of file +var _0xe511=['bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','prefix','system-','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','VoicePrefixes','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','query','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','include','findAll','rows','show','params','keys','fields','length','options','catch','destroy','describe','create','sequelize','transaction','body','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe511,0x16f));var _0x1e51=function(_0x1a8f3f,_0x5b5ae4){_0x1a8f3f=_0x1a8f3f-0x0;var _0x4ef636=_0xe511[_0x1a8f3f];return _0x4ef636;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];config[_0x1e51('0x18')]=_['defaults'](config[_0x1e51('0x18')],{'host':_0x1e51('0x19'),'port':0x18eb});var socket=require(_0x1e51('0x1a'))(new Redis(config[_0x1e51('0x18')]));require(_0x1e51('0x1b'))[_0x1e51('0x1c')](socket);function respondWithStatusCode(_0x441c70,_0x467e77){_0x467e77=_0x467e77||0xcc;return function(_0x1cc62a){if(_0x1cc62a){return _0x441c70[_0x1e51('0x1d')](_0x467e77);}return _0x441c70['status'](_0x467e77)[_0x1e51('0x1e')]();};}function respondWithResult(_0x24db4f,_0x4526b4){_0x4526b4=_0x4526b4||0xc8;return function(_0x5857e2){if(_0x5857e2){return _0x24db4f[_0x1e51('0x1f')](_0x4526b4)['json'](_0x5857e2);}};}function respondWithFilteredResult(_0x53d222,_0x1f6f4e){return function(_0x27dcad){if(_0x27dcad){var _0x40ae4c=typeof _0x1f6f4e[_0x1e51('0x20')]===_0x1e51('0x21')&&typeof _0x1f6f4e[_0x1e51('0x22')]==='undefined';var _0x39449b=_0x27dcad['count'];var _0xea581d=_0x40ae4c?0x0:_0x1f6f4e[_0x1e51('0x20')];var _0x309a87=_0x40ae4c?_0x27dcad[_0x1e51('0x23')]:_0x1f6f4e['offset']+_0x1f6f4e['limit'];var _0x4e6a49;if(_0x309a87>=_0x39449b){_0x309a87=_0x39449b;_0x4e6a49=0xc8;}else{_0x4e6a49=0xce;}_0x53d222['status'](_0x4e6a49);return _0x53d222[_0x1e51('0x24')]('Content-Range',_0xea581d+'-'+_0x309a87+'/'+_0x39449b)[_0x1e51('0x25')](_0x27dcad);}return null;};}function patchUpdates(_0x28aacb){return function(_0x415154){try{jsonpatch[_0x1e51('0x26')](_0x415154,_0x28aacb,!![]);}catch(_0x23c85a){return BPromise[_0x1e51('0x27')](_0x23c85a);}return _0x415154[_0x1e51('0x28')]();};}function saveUpdates(_0x461d3d,_0x4bcdd3){return function(_0x4d04c0){if(_0x4d04c0){return _0x4d04c0[_0x1e51('0x29')](_0x461d3d)[_0x1e51('0x2a')](function(_0x2e42b1){return _0x2e42b1;});}return null;};}function removeEntity(_0x1386db,_0x505d79){return function(_0x54d031){if(_0x54d031){return _0x54d031['destroy']()[_0x1e51('0x2a')](function(){var _0x2a1561=_0x54d031[_0x1e51('0x2b')]({'plain':!![]});var _0x5412bc=_0x1e51('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5412bc,'resourceId':_0x2a1561['id']}})[_0x1e51('0x2a')](function(){return _0x54d031;});})['then'](function(){_0x1386db[_0x1e51('0x1f')](0xcc)[_0x1e51('0x1e')]();});}};}function handleEntityNotFound(_0x56722f,_0x3e6ef2){return function(_0x10ee23){if(!_0x10ee23){_0x56722f[_0x1e51('0x1d')](0x194);}return _0x10ee23;};}function handleError(_0x6862d1,_0x52538c){_0x52538c=_0x52538c||0x1f4;return function(_0x4cf046){logger['error'](_0x4cf046[_0x1e51('0x2d')]);if(_0x4cf046[_0x1e51('0x2e')]){delete _0x4cf046[_0x1e51('0x2e')];}_0x6862d1[_0x1e51('0x1f')](_0x52538c)[_0x1e51('0x2f')](_0x4cf046);};}exports[_0x1e51('0x30')]=function(_0x378206,_0x34701c){var _0x31b678={},_0x3167b6={},_0x27b550={'count':0x0,'rows':[]};var _0x54c84e=_[_0x1e51('0x31')](db[_0x1e51('0x32')][_0x1e51('0x33')],function(_0x12da89){return{'name':_0x12da89[_0x1e51('0x34')],'type':_0x12da89['type'][_0x1e51('0x35')]};});_0x3167b6['model']=_[_0x1e51('0x31')](_0x54c84e,_0x1e51('0x2e'));_0x3167b6[_0x1e51('0x36')]=_['keys'](_0x378206[_0x1e51('0x36')]);_0x3167b6['filters']=_[_0x1e51('0x37')](_0x3167b6['model'],_0x3167b6['query']);_0x31b678[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x3167b6[_0x1e51('0x39')],qs['fields'](_0x378206[_0x1e51('0x36')]['fields']));_0x31b678[_0x1e51('0x38')]=_0x31b678[_0x1e51('0x38')]['length']?_0x31b678[_0x1e51('0x38')]:_0x3167b6[_0x1e51('0x39')];if(!_0x378206[_0x1e51('0x36')][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x31b678[_0x1e51('0x22')]=qs['limit'](_0x378206['query'][_0x1e51('0x22')]);_0x31b678['offset']=qs[_0x1e51('0x20')](_0x378206[_0x1e51('0x36')][_0x1e51('0x20')]);}_0x31b678[_0x1e51('0x3c')]=qs[_0x1e51('0x3d')](_0x378206[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x31b678[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x378206[_0x1e51('0x36')],_0x3167b6['filters']),_0x54c84e);if(_0x378206[_0x1e51('0x36')]['filter']){_0x31b678[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x31b678[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x54c84e,function(_0x33e516){if(_0x33e516[_0x1e51('0x42')]!==_0x1e51('0x43')){var _0x27b3fd={};_0x27b3fd[_0x33e516[_0x1e51('0x2e')]]={'$like':'%'+_0x378206[_0x1e51('0x36')][_0x1e51('0x44')]+'%'};return _0x27b3fd;}})});}_0x31b678=_['merge']({},_0x31b678,_0x378206['options']);var _0x13da51={'where':_0x31b678[_0x1e51('0x3e')]};return db[_0x1e51('0x32')][_0x1e51('0x23')](_0x13da51)[_0x1e51('0x2a')](function(_0x1a9e0d){_0x27b550[_0x1e51('0x23')]=_0x1a9e0d;if(_0x378206[_0x1e51('0x36')]['includeAll']){_0x31b678[_0x1e51('0x45')]=[{'all':!![]}];}return db[_0x1e51('0x32')][_0x1e51('0x46')](_0x31b678);})[_0x1e51('0x2a')](function(_0xfd96a0){_0x27b550[_0x1e51('0x47')]=_0xfd96a0;return _0x27b550;})[_0x1e51('0x2a')](respondWithFilteredResult(_0x34701c,_0x31b678))['catch'](handleError(_0x34701c,null));};exports[_0x1e51('0x48')]=function(_0x232789,_0x51296e){var _0xfd6521={'raw':![],'where':{'id':_0x232789[_0x1e51('0x49')]['id']}},_0x38e4a7={};_0x38e4a7['model']=_[_0x1e51('0x4a')](db[_0x1e51('0x32')][_0x1e51('0x33')]);_0x38e4a7[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x232789[_0x1e51('0x36')]);_0x38e4a7[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x38e4a7[_0x1e51('0x39')],_0x38e4a7['query']);_0xfd6521[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x38e4a7['model'],qs[_0x1e51('0x4b')](_0x232789[_0x1e51('0x36')][_0x1e51('0x4b')]));_0xfd6521['attributes']=_0xfd6521[_0x1e51('0x38')][_0x1e51('0x4c')]?_0xfd6521[_0x1e51('0x38')]:_0x38e4a7['model'];if(_0x232789[_0x1e51('0x36')]['includeAll']){_0xfd6521['include']=[{'all':!![]}];}_0xfd6521=_['merge']({},_0xfd6521,_0x232789[_0x1e51('0x4d')]);return db[_0x1e51('0x32')]['find'](_0xfd6521)['then'](handleEntityNotFound(_0x51296e,null))[_0x1e51('0x2a')](respondWithResult(_0x51296e,null))[_0x1e51('0x4e')](handleError(_0x51296e,null));};exports[_0x1e51('0x4f')]=function(_0x233a5a,_0xf3377b){return db[_0x1e51('0x32')]['find']({'where':{'id':_0x233a5a[_0x1e51('0x49')]['id']}})['then'](handleEntityNotFound(_0xf3377b,null))[_0x1e51('0x2a')](removeEntity(_0xf3377b,null))[_0x1e51('0x4e')](handleError(_0xf3377b,null));};exports['describe']=function(_0x5ea040,_0x479fe6){return db[_0x1e51('0x32')][_0x1e51('0x50')]()[_0x1e51('0x2a')](respondWithResult(_0x479fe6,null))['catch'](handleError(_0x479fe6,null));};exports[_0x1e51('0x51')]=function(_0x1fe669,_0x4226da){var _0x2100d4;return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x32fe1f){return db[_0x1e51('0x32')]['create'](_0x1fe669[_0x1e51('0x54')],{'transaction':_0x32fe1f})[_0x1e51('0x2a')](function(_0xeb77ad){_0x2100d4=_0xeb77ad[_0x1e51('0x2b')]({'plain':!![]});return db[_0x1e51('0x55')][_0x1e51('0x56')]({'where':{'id':_0x2100d4['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x4a2c1b){return createVoicePrefixExtensions(_0x2100d4,_0x4a2c1b,_0x32fe1f);});});})['then'](function(){var _0x4807b9=_0x1fe669[_0x1e51('0x57')][_0x1e51('0x2b')]({'plain':!![]});if(!_0x4807b9)throw new Error(_0x1e51('0x58'));if(_0x4807b9['role']===_0x1e51('0x57')){var _0x133576=_0x2100d4;return db[_0x1e51('0x59')]['find']({'where':{'name':_0x1e51('0x2c'),'userProfileId':_0x4807b9[_0x1e51('0x5a')]},'raw':!![]})[_0x1e51('0x2a')](function(_0x570193){if(_0x570193&&_0x570193[_0x1e51('0x5b')]===0x0){return db[_0x1e51('0x5c')][_0x1e51('0x51')]({'name':_0x133576[_0x1e51('0x2e')],'resourceId':_0x133576['id'],'type':_0x570193[_0x1e51('0x2e')],'sectionId':_0x570193['id']},{})[_0x1e51('0x2a')](function(){return _0x2100d4;});}else{return _0x2100d4;}})[_0x1e51('0x4e')](function(_0x607626){logger['error'](_0x1e51('0x5d'),_0x607626);throw _0x607626;});}return _0x2100d4;})[_0x1e51('0x2a')](respondWithResult(_0x4226da,null))['catch'](handleError(_0x4226da,null));};function Extension(_0x5a9d2a,_0x577b19,_0xa39f42,_0x686433){this[_0x1e51('0x5e')]=_0x1e51('0x5f');this[_0x1e51('0x60')]=_0x5a9d2a;this[_0x1e51('0x61')]=_0xa39f42;this[_0x1e51('0x42')]=_0x1e51('0x62');this[_0x1e51('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x577b19;this['appdata']=_0x686433;}function createVoicePrefixExtensions(_0x1d2daf,_0x4048a4,_0x50c202){return new BPromise(function(_0x4e1fa8,_0x1a7297){var _0x114657=new Extension(formatPrefixName(_0x1d2daf['prefix']),0x1,_0x1e51('0x64'),_0x1e51('0x65'));_0x114657[_0x1e51('0x66')]=_0x1d2daf['id'];return db[_0x1e51('0x55')][_0x1e51('0x51')](_0x114657,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x2199e5){var _0x31eae0=_0x2199e5[_0x1e51('0x2b')]({'plain':!![]});var _0x32863f=_['map'](addVoicePrefixExtensions(_0x1d2daf,_0x4048a4),function(_0x178baf){_0x178baf[_0x1e51('0x67')]=_0x31eae0['id'];_0x178baf[_0x1e51('0x66')]=_0x1d2daf['id'];return _0x178baf;});return db[_0x1e51('0x55')][_0x1e51('0x68')](_0x32863f,{'transaction':_0x50c202})[_0x1e51('0x2a')](function(_0x47cc50){if(!_0x47cc50){return _0x1a7297('Extensions\x20creation\x20failed');}else{return _0x4e1fa8(_0x47cc50);}})[_0x1e51('0x4e')](function(_0x1b0459){return _0x1a7297(_0x1b0459);});});;});};function addVoicePrefixExtensions(_0x19ec72,_0x13fb81){var _0x52a439=[];var _0x4bbe62=formatPrefixName(_0x19ec72['prefix']);_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x2,_0x1e51('0x6a'),_0x1e51('0x6b')+_0x19ec72[_0x1e51('0x2e')]));if(_0x19ec72[_0x1e51('0x6c')]){_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x6a'),_0x1e51('0x6d')+_0x19ec72[_0x1e51('0x6c')]));}else{_0x52a439['push'](new Extension(_0x4bbe62,0x3,_0x1e51('0x64'),_0x1e51('0x6e')));}_0x52a439[_0x1e51('0x69')](new Extension(_0x4bbe62,0x4,'goto',_0x13fb81[_0x1e51('0x5e')]+','+_0x1e51('0x6f')+(0x8+_0x19ec72['name']['length'])+'}'+','+0x1));return _0x52a439;}function formatPrefixName(_0x40d5e8){var _0x4d6d41='_';for(var _0x4464bf=0x0;_0x4464bf<_0x40d5e8['length'];_0x4464bf++){if(_0x40d5e8[_0x1e51('0x70')](_0x4464bf)=='-'){_0x4d6d41+=_0x40d5e8[_0x1e51('0x70')](_0x4464bf);}else{_0x4d6d41+='['+_0x40d5e8[_0x1e51('0x70')](_0x4464bf)+']';}}_0x4d6d41+='.';return _0x4d6d41;}exports[_0x1e51('0x29')]=function(_0x5142ed,_0x37f3e6,_0x4c9871){var _0x5eaa16=_0x5142ed[_0x1e51('0x54')];_0x5eaa16[_0x1e51('0x71')]=_0x1e51('0x72')+_0x5eaa16['name']+'-';return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0x15f15b){return db[_0x1e51('0x32')]['update'](_0x5eaa16,{'where':{'id':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x5eaa16['id']},'transaction':_0x15f15b})[_0x1e51('0x2a')](function(){return db['VoiceExtension'][_0x1e51('0x56')]({'where':{'id':_0x5eaa16['VoiceExtensionId']},'raw':!![]})[_0x1e51('0x2a')](function(_0x486508){return createVoicePrefixExtensions(_0x5eaa16,_0x486508,_0x15f15b);});});});})[_0x1e51('0x2a')](function(){return db[_0x1e51('0x32')]['findById'](_0x5eaa16['id']);})[_0x1e51('0x2a')](respondWithResult(_0x37f3e6,null))['catch'](handleError(_0x37f3e6,null));};exports[_0x1e51('0x73')]=function(_0x6dc707,_0x1d2753,_0x18ed16){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x6dc707['params']['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x1d2753,null))['then'](function(_0x5556ad){if(_0x5556ad){return _0x5556ad[_0x1e51('0x73')](_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')],_[_0x1e51('0x75')](_0x6dc707[_0x1e51('0x54')],[_0x1e51('0x74'),'id'])||{})[_0x1e51('0x76')](function(_0x51ef46){for(var _0x39dc12=0x0;_0x39dc12<_0x6dc707[_0x1e51('0x54')][_0x1e51('0x74')]['length'];_0x39dc12+=0x1){socket['emit'](_0x1e51('0x77'),{'UserId':Number(_0x6dc707[_0x1e51('0x54')]['ids'][_0x39dc12]),'VoicePrefixId':Number(_0x6dc707[_0x1e51('0x49')]['id'])});}return _0x51ef46;});}})[_0x1e51('0x2a')](respondWithResult(_0x1d2753,null))['catch'](handleError(_0x1d2753,null));};exports['removeAgents']=function(_0xe96651,_0x49263c,_0x16793c){return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0xe96651[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x49263c,null))['then'](function(_0x4e3460){if(_0x4e3460){return _0x4e3460[_0x1e51('0x78')](_0xe96651[_0x1e51('0x36')]['ids'])[_0x1e51('0x2a')](function(){if(_[_0x1e51('0x79')](_0xe96651['query'][_0x1e51('0x74')])){for(var _0x57ab4a=0x0;_0x57ab4a<_0xe96651[_0x1e51('0x36')]['ids']['length'];_0x57ab4a+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xe96651['query']['ids'][_0x57ab4a]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}}else{socket['emit'](_0x1e51('0x7a'),{'UserId':Number(_0xe96651['query'][_0x1e51('0x74')]),'VoicePrefixId':Number(_0xe96651[_0x1e51('0x49')]['id'])});}});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x49263c,null))['catch'](handleError(_0x49263c,null));};exports[_0x1e51('0x7b')]=function(_0x3ed4b1,_0x4a2b44,_0x2efc56){var _0x49517c={};var _0x101bb9={};var _0x5c4452;var _0x2b4b49;return db[_0x1e51('0x32')][_0x1e51('0x7c')]({'where':{'id':_0x3ed4b1[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x4a2b44,null))[_0x1e51('0x2a')](function(_0x50e359){if(_0x50e359){_0x5c4452=_0x50e359;_0x101bb9[_0x1e51('0x39')]=_['keys'](db[_0x1e51('0x7d')][_0x1e51('0x33')]);_0x101bb9[_0x1e51('0x36')]=_[_0x1e51('0x4a')](_0x3ed4b1['query']);_0x101bb9['filters']=_['intersection'](_0x101bb9[_0x1e51('0x39')],_0x101bb9[_0x1e51('0x36')]);_0x49517c[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x101bb9['model'],qs[_0x1e51('0x4b')](_0x3ed4b1['query'][_0x1e51('0x4b')]));_0x49517c['attributes']=_0x49517c['attributes'][_0x1e51('0x4c')]?_0x49517c[_0x1e51('0x38')]:_0x101bb9['model'];_0x49517c[_0x1e51('0x3c')]=qs['sort'](_0x3ed4b1[_0x1e51('0x36')]['sort']);_0x49517c[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_['pick'](_0x3ed4b1[_0x1e51('0x36')],_0x101bb9['filters']));if(_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x44')]){_0x49517c[_0x1e51('0x3e')]=_[_0x1e51('0x41')](_0x49517c['where'],{'$or':_[_0x1e51('0x31')](_0x49517c[_0x1e51('0x38')],function(_0x4698b1){var _0x4ff0ff={};_0x4ff0ff[_0x4698b1]={'$like':'%'+_0x3ed4b1['query'][_0x1e51('0x44')]+'%'};return _0x4ff0ff;})});}_0x49517c=_[_0x1e51('0x41')]({},_0x49517c,_0x3ed4b1[_0x1e51('0x4d')]);return _0x5c4452['getAgents'](_0x49517c);}})['then'](function(_0x552f34){if(_0x552f34){_0x2b4b49=_0x552f34[_0x1e51('0x4c')];if(!_0x3ed4b1[_0x1e51('0x36')][_0x1e51('0x3a')]('nolimit')){_0x49517c[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x3ed4b1['query'][_0x1e51('0x22')]);_0x49517c[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x3ed4b1['query'][_0x1e51('0x20')]);}return _0x5c4452['getAgents'](_0x49517c);}})[_0x1e51('0x2a')](function(_0x2c84a3){if(_0x2c84a3){return _0x2c84a3?{'count':_0x2b4b49,'rows':_0x2c84a3}:null;}})[_0x1e51('0x2a')](respondWithResult(_0x4a2b44,null))[_0x1e51('0x4e')](handleError(_0x4a2b44,null));};exports[_0x1e51('0x7e')]=function(_0x37a7ef,_0x37f26c,_0xa3225a){var _0x10370b={};var _0x5a6e2f={};var _0x5394e1;var _0x4a5daa;return db[_0x1e51('0x32')]['findOne']({'where':{'id':_0x37a7ef[_0x1e51('0x49')]['id']}})[_0x1e51('0x2a')](handleEntityNotFound(_0x37f26c,null))[_0x1e51('0x2a')](function(_0x3a546f){if(_0x3a546f){_0x5394e1=_0x3a546f;_0x5a6e2f[_0x1e51('0x39')]=_[_0x1e51('0x4a')](db[_0x1e51('0x7f')][_0x1e51('0x33')]);_0x5a6e2f[_0x1e51('0x36')]=_['keys'](_0x37a7ef[_0x1e51('0x36')]);_0x5a6e2f[_0x1e51('0x3f')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],_0x5a6e2f[_0x1e51('0x36')]);_0x10370b[_0x1e51('0x38')]=_[_0x1e51('0x37')](_0x5a6e2f['model'],qs[_0x1e51('0x4b')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x4b')]));_0x10370b[_0x1e51('0x38')]=_0x10370b[_0x1e51('0x38')]['length']?_0x10370b['attributes']:_0x5a6e2f[_0x1e51('0x39')];_0x10370b['order']=qs['sort'](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x3d')]);_0x10370b[_0x1e51('0x3e')]=qs[_0x1e51('0x3f')](_[_0x1e51('0x40')](_0x37a7ef[_0x1e51('0x36')],_0x5a6e2f[_0x1e51('0x3f')]));if(_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x44')]){_0x10370b['where']=_[_0x1e51('0x41')](_0x10370b[_0x1e51('0x3e')],{'$or':_[_0x1e51('0x31')](_0x10370b['attributes'],function(_0x5e3a9a){var _0x121591={};_0x121591[_0x5e3a9a]={'$like':'%'+_0x37a7ef[_0x1e51('0x36')]['filter']+'%'};return _0x121591;})});}_0x10370b=_[_0x1e51('0x41')]({},_0x10370b,_0x37a7ef[_0x1e51('0x4d')]);return _0x5394e1['getTeams'](_0x10370b);}})[_0x1e51('0x2a')](function(_0x30f3f4){if(_0x30f3f4){_0x4a5daa=_0x30f3f4[_0x1e51('0x4c')];if(!_0x37a7ef['query'][_0x1e51('0x3a')](_0x1e51('0x3b'))){_0x10370b[_0x1e51('0x22')]=qs[_0x1e51('0x22')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x22')]);_0x10370b[_0x1e51('0x20')]=qs[_0x1e51('0x20')](_0x37a7ef[_0x1e51('0x36')][_0x1e51('0x20')]);}return _0x5394e1['getTeams'](_0x10370b);}})['then'](function(_0x41147f){if(_0x41147f){return _0x41147f?{'count':_0x4a5daa,'rows':_0x41147f}:null;}})['then'](respondWithResult(_0x37f26c,null))['catch'](handleError(_0x37f26c,null));};exports['addTeams']=function(_0x251595,_0x53dbbb,_0x159c58){var _0x5494ac=_0x251595[_0x1e51('0x54')][_0x1e51('0x74')];var _0x4859cd;return db[_0x1e51('0x7f')]['findAll']({'where':{'id':_0x5494ac},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id','name',_0x1e51('0x81'),_0x1e51('0x82'),'interface'],'raw':!![]}]})['then'](function(_0x4e99dd){if(_0x4e99dd){_0x4859cd=_0x4e99dd;var _0x46bea7=_[_0x1e51('0x83')](_0x4e99dd,function(_0x3cc89b){var _0x543c71=_0x3cc89b['get']({'plain':!![]});return _0x543c71[_0x1e51('0x80')];});return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x251595['params']['id']}})[_0x1e51('0x2a')](function(_0x20bcb6){return db[_0x1e51('0x52')][_0x1e51('0x53')](function(_0xb339a0){return _0x20bcb6[_0x1e51('0x84')](_0x5494ac,{'transaction':_0xb339a0})['then'](function(){return BPromise[_0x1e51('0x85')](_0x4859cd,function(_0x15ca94){return db[_0x1e51('0x86')]['upsert']({'TeamId':_0x15ca94['id'],'VoicePrefixId':_0x251595['params']['id']},{'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){return BPromise['each'](_0x46bea7,function(_0x55c0e9){return db['UserVoicePrefix'][_0x1e51('0x87')]({'where':{'UserId':_0x55c0e9['id'],'VoicePrefixId':_0x251595[_0x1e51('0x49')]['id']},'transaction':_0xb339a0});});})[_0x1e51('0x2a')](function(){_0x46bea7[_0x1e51('0x88')](function(_0x4c5279){socket['emit']('userVoicePrefix:save',{'UserId':_0x4c5279['id'],'VoicePrefixId':_0x20bcb6['id']});});});});});}})[_0x1e51('0x2a')](respondWithStatusCode(_0x53dbbb,null))['catch'](handleError(_0x53dbbb,null));};exports[_0x1e51('0x89')]=function(_0x15ae93,_0x40146c,_0x419043){return db[_0x1e51('0x7f')][_0x1e51('0x46')]({'where':{'id':_0x15ae93[_0x1e51('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1e51('0x7d')],'as':_0x1e51('0x80'),'attributes':['id'],'raw':!![]}]})[_0x1e51('0x2a')](handleEntityNotFound(_0x40146c,null))[_0x1e51('0x2a')](function(_0x478a79){var _0xec29f4=_[_0x1e51('0x31')](_0x478a79,'id');var _0x57c3a2=[];var _0x2b12e9=[];var _0x2ab009=squel[_0x1e51('0x8a')]();_0x2ab009[_0x1e51('0x8b')](_0x1e51('0x8c'))[_0x1e51('0x8d')](_0x1e51('0x8e'),'tq')[_0x1e51('0x8f')](_0x1e51('0x90'),'ut',_0x1e51('0x91'))['where'](_0x1e51('0x92'),_0x15ae93[_0x1e51('0x49')]['id']);for(var _0x42f652=0x0;_0x42f652<_0x478a79[_0x1e51('0x4c')];_0x42f652+=0x1){let _0x131006=_0x478a79[_0x42f652];for(var _0xa5bef1=0x0;_0xa5bef1<_0x131006[_0x1e51('0x80')][_0x1e51('0x4c')];_0xa5bef1+=0x1){let _0x1e1c48=_0x131006[_0x1e51('0x80')][_0xa5bef1];var _0x12d430=_0x2ab009['clone']();_0x12d430[_0x1e51('0x3e')](_0x1e51('0x93'),_0x1e1c48['id']);_0x2b12e9['push'](db['sequelize'][_0x1e51('0x36')](_0x12d430[_0x1e51('0x94')](),{'type':db[_0x1e51('0x52')][_0x1e51('0x95')][_0x1e51('0x96')]})[_0x1e51('0x2a')](function(_0x51114b){if(_0x51114b['length']===0x1){return _0x1e1c48['id'];}else{var _0x290551=_[_0x1e51('0x97')](_['map'](_0x51114b,_0x1e51('0x98')),function(_0x4610e1){return _[_0x1e51('0x99')](_0xec29f4,_0x4610e1);});if(_0x290551){return _0x1e1c48['id'];}}}));}}return BPromise['all'](_0x2b12e9)[_0x1e51('0x2a')](function(_0x304999){_0x57c3a2=_(_0x57c3a2)[_0x1e51('0x9a')](_0x304999)['compact']()[_0x1e51('0x9b')]();return db[_0x1e51('0x32')][_0x1e51('0x56')]({'where':{'id':_0x15ae93[_0x1e51('0x49')]['id']}})['then'](function(_0x2773c3){return db[_0x1e51('0x52')]['transaction'](function(_0x237435){return _0x2773c3[_0x1e51('0x89')](_0x15ae93[_0x1e51('0x36')][_0x1e51('0x74')],{'transaction':_0x237435})['then'](function(){if(!_[_0x1e51('0x9c')](_0x57c3a2)){return _0x2773c3[_0x1e51('0x78')](_0x57c3a2,{'transaction':_0x237435});}})[_0x1e51('0x2a')](function(){_0x57c3a2[_0x1e51('0x88')](function(_0x43b66c){socket['emit'](_0x1e51('0x7a'),{'UserId':_0x43b66c,'VoicePrefixId':_0x2773c3['id']});});});});});});})[_0x1e51('0x2a')](respondWithStatusCode(_0x40146c,null))[_0x1e51('0x4e')](handleError(_0x40146c,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8822be3..a08691d 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 _0x039e=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x039e,0x109));var _0xe039=function(_0x25bd75,_0x667764){_0x25bd75=_0x25bd75-0x0;var _0x595be2=_0x039e[_0x25bd75];return _0x595be2;};'use strict';var EventEmitter=require(_0xe039('0x0'));var VoicePrefix=require(_0xe039('0x1'))['db'][_0xe039('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe039('0x3')](0x0);var events={'afterCreate':_0xe039('0x4'),'afterUpdate':_0xe039('0x5'),'afterDestroy':_0xe039('0x6')};function emitEvent(_0x474934){return function(_0x1786fe,_0x3a35cb,_0x439e01){VoicePrefixEvents[_0xe039('0x7')](_0x474934+':'+_0x1786fe['id'],_0x1786fe);VoicePrefixEvents[_0xe039('0x7')](_0x474934,_0x1786fe);_0x439e01(null);};}for(var e in events){if(events[_0xe039('0x8')](e)){var event=events[e];VoicePrefix[_0xe039('0x9')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x4fdf=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x1a57d6,_0x4e36d6){var _0x2d98f4=function(_0x4e854d){while(--_0x4e854d){_0x1a57d6['push'](_0x1a57d6['shift']());}};_0x2d98f4(++_0x4e36d6);}(_0x4fdf,0x12b));var _0xf4fd=function(_0x13d15b,_0x471073){_0x13d15b=_0x13d15b-0x0;var _0x132e0e=_0x4fdf[_0x13d15b];return _0x132e0e;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xf4fd('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf4fd('0x1'),'afterDestroy':_0xf4fd('0x2')};function emitEvent(_0xae2f9b){return function(_0x5eff05,_0x2f827a,_0x32b4d1){VoicePrefixEvents[_0xf4fd('0x3')](_0xae2f9b+':'+_0x5eff05['id'],_0x5eff05);VoicePrefixEvents[_0xf4fd('0x3')](_0xae2f9b,_0x5eff05);_0x32b4d1(null);};}for(var e in events){if(events[_0xf4fd('0x4')](e)){var event=events[e];VoicePrefix[_0xf4fd('0x5')](e,emitEvent(event));}}module[_0xf4fd('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index dab328b..c8ef5f0 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 _0xacdf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xacdf,0xce));var _0xfacd=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xacdf[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xfacd('0x0'));var util=require(_0xfacd('0x1'));var logger=require(_0xfacd('0x2'))(_0xfacd('0x3'));var moment=require(_0xfacd('0x4'));var BPromise=require(_0xfacd('0x5'));var rp=require(_0xfacd('0x6'));var fs=require('fs');var path=require(_0xfacd('0x7'));var rimraf=require(_0xfacd('0x8'));var config=require(_0xfacd('0x9'));var attributes=require(_0xfacd('0xa'));module[_0xfacd('0xb')]=function(_0x1ef34e,_0x1f6987){return _0x1ef34e[_0xfacd('0xc')](_0xfacd('0xd'),attributes,{'tableName':_0xfacd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x085d=['request-promise','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','../../config/logger','api','moment'];(function(_0xf4dfa4,_0x2f9143){var _0x3a5ac1=function(_0x4a1671){while(--_0x4a1671){_0xf4dfa4['push'](_0xf4dfa4['shift']());}};_0x3a5ac1(++_0x2f9143);}(_0x085d,0x1b4));var _0xd085=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x085d[_0x872b02];return _0x1a6b24;};'use strict';var _=require(_0xd085('0x0'));var util=require('util');var logger=require(_0xd085('0x1'))(_0xd085('0x2'));var moment=require(_0xd085('0x3'));var BPromise=require('bluebird');var rp=require(_0xd085('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd085('0x5'));var attributes=require(_0xd085('0x6'));module[_0xd085('0x7')]=function(_0x255489,_0x4bbb04){return _0x255489[_0xd085('0x8')](_0xd085('0x9'),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 3baa8ad..2a44761 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 _0x9300=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./voicePrefix.socket','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x9300,0x153));var _0x0930=function(_0x3f2cfc,_0x2827b0){_0x3f2cfc=_0x3f2cfc-0x0;var _0x1d1e61=_0x9300[_0x3f2cfc];return _0x1d1e61;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});config[_0x0930('0xa')]=_[_0x0930('0xb')](config[_0x0930('0xa')],{'host':_0x0930('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0930('0xd'))['register'](socket);function respondWithRpcPromise(_0x1abf42,_0x1cc192,_0x5055c7){return new BPromise(function(_0x6db8ef,_0x5ba778){return client['request'](_0x1abf42,_0x5055c7)[_0x0930('0xe')](function(_0x20ab2e){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));logger[_0x0930('0x10')](_0x0930('0x11'),_0x1cc192,_0x0930('0xf'),JSON[_0x0930('0x12')](_0x20ab2e));if(_0x20ab2e[_0x0930('0x13')]){if(_0x20ab2e['error']['code']===0x1f4){logger['error'](_0x0930('0x14'),_0x1cc192,_0x20ab2e['error'][_0x0930('0x15')]);return _0x5ba778(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}logger[_0x0930('0x13')](_0x0930('0x14'),_0x1cc192,_0x20ab2e[_0x0930('0x13')]['message']);return _0x6db8ef(_0x20ab2e[_0x0930('0x13')][_0x0930('0x15')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1cc192,_0x0930('0xf'));_0x6db8ef(_0x20ab2e[_0x0930('0x16')][_0x0930('0x15')]);}})[_0x0930('0x17')](function(_0x2fd170){logger['error'](_0x0930('0x14'),_0x1cc192,_0x2fd170);_0x5ba778(_0x2fd170);});});} \ No newline at end of file +var _0xbd0e=['http','redis','defaults','localhost','socket.io-emitter','register','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5e8edb,_0x1914d4){var _0x1ea9ba=function(_0x366c07){while(--_0x366c07){_0x5e8edb['push'](_0x5e8edb['shift']());}};_0x1ea9ba(++_0x1914d4);}(_0xbd0e,0x187));var _0xebd0=function(_0x5276f1,_0x1fcf3f){_0x5276f1=_0x5276f1-0x0;var _0xa2d451=_0xbd0e[_0x5276f1];return _0xa2d451;};'use strict';var _=require('lodash');var util=require(_0xebd0('0x0'));var moment=require('moment');var BPromise=require(_0xebd0('0x1'));var rs=require(_0xebd0('0x2'));var fs=require('fs');var Redis=require(_0xebd0('0x3'));var db=require(_0xebd0('0x4'))['db'];var utils=require(_0xebd0('0x5'));var logger=require(_0xebd0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xebd0('0x7'));var client=jayson[_0xebd0('0x8')][_0xebd0('0x9')]({'port':0x232a});config[_0xebd0('0xa')]=_[_0xebd0('0xb')](config[_0xebd0('0xa')],{'host':_0xebd0('0xc'),'port':0x18eb});var socket=require(_0xebd0('0xd'))(new Redis(config[_0xebd0('0xa')]));require('./voicePrefix.socket')[_0xebd0('0xe')](socket);function respondWithRpcPromise(_0x474bef,_0x2dbee9,_0x54b2a1){return new BPromise(function(_0xbec226,_0x1346d1){return client['request'](_0x474bef,_0x54b2a1)['then'](function(_0xb15b3e){logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,_0xebd0('0x11'));logger[_0xebd0('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2dbee9,_0xebd0('0x11'),JSON[_0xebd0('0x13')](_0xb15b3e));if(_0xb15b3e[_0xebd0('0x14')]){if(_0xb15b3e['error'][_0xebd0('0x15')]===0x1f4){logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0x1346d1(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0xbec226(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}else{logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,'request\x20sent');_0xbec226(_0xb15b3e[_0xebd0('0x17')][_0xebd0('0x16')]);}})[_0xebd0('0x18')](function(_0x2834ad){logger['error'](_0xebd0('0x10'),_0x2dbee9,_0x2834ad);_0x1346d1(_0x2834ad);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 287ef5c..4d2541f 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 _0xde9d=['./voicePrefix.events','save','remove','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x579042,_0x5a356f){var _0x3546af=function(_0x5a2689){while(--_0x5a2689){_0x579042['push'](_0x579042['shift']());}};_0x3546af(++_0x5a356f);}(_0xde9d,0x156));var _0xdde9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xde9d[_0x19e35c];return _0x3e1fe8;};'use strict';var VoicePrefixEvents=require(_0xdde9('0x0'));var events=[_0xdde9('0x1'),_0xdde9('0x2'),_0xdde9('0x3')];function createListener(_0x20ab4a,_0x49fbbe){return function(_0x2a7fa7){_0x49fbbe[_0xdde9('0x4')](_0x20ab4a,_0x2a7fa7);};}function removeListener(_0x1aebe6,_0x4a5ea5){return function(){VoicePrefixEvents[_0xdde9('0x5')](_0x1aebe6,_0x4a5ea5);};}exports[_0xdde9('0x6')]=function(_0x1ea43e){for(var _0x4c10e9=0x0,_0x289ccb=events[_0xdde9('0x7')];_0x4c10e9<_0x289ccb;_0x4c10e9++){var _0x229168=events[_0x4c10e9];var _0x3be8c1=createListener(_0xdde9('0x8')+_0x229168,_0x1ea43e);VoicePrefixEvents['on'](_0x229168,_0x3be8c1);}}; \ No newline at end of file +var _0x803f=['length','voicePrefix:','./voicePrefix.events','remove','update','emit','register'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x803f,0x64));var _0xf803=function(_0x2806cf,_0x5b6142){_0x2806cf=_0x2806cf-0x0;var _0xc58148=_0x803f[_0x2806cf];return _0xc58148;};'use strict';var VoicePrefixEvents=require(_0xf803('0x0'));var events=['save',_0xf803('0x1'),_0xf803('0x2')];function createListener(_0x4ce875,_0x1a8691){return function(_0x43fb3b){_0x1a8691[_0xf803('0x3')](_0x4ce875,_0x43fb3b);};}function removeListener(_0x6baafe,_0x5c2cd6){return function(){VoicePrefixEvents['removeListener'](_0x6baafe,_0x5c2cd6);};}exports[_0xf803('0x4')]=function(_0x2ba12f){for(var _0x1d3a79=0x0,_0x584b2d=events[_0xf803('0x5')];_0x1d3a79<_0x584b2d;_0x1d3a79++){var _0x47128f=events[_0x1d3a79];var _0x587319=createListener(_0xf803('0x6')+_0x47128f,_0x2ba12f);VoicePrefixEvents['on'](_0x47128f,_0x587319);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c96a2db..484e8b6 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(_0x562f57,_0x476a6d){var _0x5e699f=function(_0x4229cd){while(--_0x4229cd){_0x562f57['push'](_0x562f57['shift']());}};_0x5e699f(++_0x476a6d);}(_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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3eb211,_0x4a2e7f){_0x3eb211=_0x3eb211-0x0;var _0xb32a15=_0xb10b[_0x3eb211];return _0xb32a15;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ccc938c..b3cef03 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 _0xe0c1=['setDataValue','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','type','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','join','split'];(function(_0x33d406,_0x19a3c3){var _0x196d44=function(_0x221959){while(--_0x221959){_0x33d406['push'](_0x33d406['shift']());}};_0x196d44(++_0x19a3c3);}(_0xe0c1,0xcc));var _0x1e0c=function(_0x1d7873,_0x5dbb43){_0x1d7873=_0x1d7873-0x0;var _0x3ba053=_0xe0c1[_0x1d7873];return _0x3ba053;};'use strict';var Sequelize=require('sequelize');module[_0x1e0c('0x0')]={'name':{'type':Sequelize[_0x1e0c('0x1')],'allowNull':![],'unique':_0x1e0c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x4'),_0x1e0c('0x5')),'allowNull':![],'defaultValue':_0x1e0c('0x4')},'musiconhold':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':_0x1e0c('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x1e0c('0x7'),_0x1e0c('0x8'),_0x1e0c('0x9'),'random',_0x1e0c('0xa'),_0x1e0c('0xb'),_0x1e0c('0xc'),_0x1e0c('0xd')),'allowNull':![],'defaultValue':_0x1e0c('0x7'),'set':function(_0x45f0ed){this['setDataValue'](_0x1e0c('0xe'),_0x45f0ed?_0x45f0ed:_0x1e0c('0xa'));},'get':function(){var _0x1e5b48=this['getDataValue'](_0x1e0c('0xf'));var _0x4dc441=this[_0x1e0c('0x10')](_0x1e0c('0x11'));var _0x135354=this[_0x1e0c('0x10')](_0x1e0c('0xe'));if(_0x1e5b48===_0x1e0c('0x4')){return _0x135354;}if(_0x4dc441===_0x1e0c('0x12')&&_0x135354===_0x1e0c('0xa')||_0x4dc441===_0x1e0c('0x12')&&_0x135354===_0x1e0c('0x13')){return _0x135354;}if(_0x4dc441===_0x1e0c('0x14')||_0x4dc441===_0x1e0c('0x15')||_0x4dc441==='power'){return _0x135354;}return null;}},'servicelevel':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1e0c('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1e0c('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':_0x1e0c('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x1e0c('0x17'),'no',_0x1e0c('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x1e0c('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1e0c('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1e0c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x1e0c('0x3')]('yes','no',_0x1e0c('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x1e0c('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1e0c('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1e0c('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1e0c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x1e0c('0x1')]},'queue_quantity2':{'type':Sequelize[_0x1e0c('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x1e0c('0x1')]},'periodic_announce':{'type':Sequelize[_0x1e0c('0x1a')],'set':function(_0x50f7af){this['setDataValue'](_0x1e0c('0x1b'),_0x50f7af?_0x50f7af[_0x1e0c('0x1c')](','):[]);},'get':function(){return this[_0x1e0c('0x10')](_0x1e0c('0x1b'))?this[_0x1e0c('0x10')](_0x1e0c('0x1b'))[_0x1e0c('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':_0x1e0c('0x17'),'set':function(_0x1a10ca){this[_0x1e0c('0x1e')]('joinempty',_0x1a10ca?_0x1a10ca['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x1e0c('0x1f'))?this[_0x1e0c('0x10')]('joinempty')[_0x1e0c('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1fd7f1){this[_0x1e0c('0x1e')](_0x1e0c('0x20'),_0x1fd7f1?_0x1fd7f1[_0x1e0c('0x1c')](','):undefined);},'get':function(){return this[_0x1e0c('0x10')](_0x1e0c('0x20'))?this['getDataValue'](_0x1e0c('0x20'))[_0x1e0c('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1e0c('0x1')]},'description':{'type':Sequelize[_0x1e0c('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x37f07c){this[_0x1e0c('0x1e')](_0x1e0c('0x21'),_0x37f07c);if(_0x37f07c){if(this[_0x1e0c('0x10')](_0x1e0c('0x22'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1e0c('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':0x0,'comment':_0x1e0c('0x24')},'dialMethod':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x25'),_0x1e0c('0x14'),'power',_0x1e0c('0x15'),_0x1e0c('0x12')),'defaultValue':_0x1e0c('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x1e0c('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1e0c('0x27')},'dialLimitQueue':{'type':Sequelize[_0x1e0c('0x16')](0x4)[_0x1e0c('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1e0c('0x28')},'dialPowerLevel':{'type':Sequelize[_0x1e0c('0x29')](0x2)[_0x1e0c('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1e0c('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x1e0c('0x2b')),'defaultValue':'dropRate','comment':_0x1e0c('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1e0c('0x29')](0x2)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1e0c('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1e0c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1e0c('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':_0x1e0c('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x1e0c('0x1')],'comment':_0x1e0c('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'comment':_0x1e0c('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1e0c('0x36')},'dialTimezone':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':_0x1e0c('0x37')},'dialPrefix':{'type':Sequelize[_0x1e0c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1e0c('0x3')](_0x1e0c('0x38'),_0x1e0c('0x39'),_0x1e0c('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1e0c('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x1e0c('0x16')](0x9)[_0x1e0c('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1e0c('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1e0c('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1e0c('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1e0c('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1e0c('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1e0c('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x1e0c('0x16')](0x9)[_0x1e0c('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1e0c('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1e0c('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1e0c('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1e0c('0x16')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1e0c('0x16')](0x5)[_0x1e0c('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1e0c('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1e0c('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x1e0c('0x16')](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1e0c('0x3')]('DESC',_0x1e0c('0x42')),'defaultValue':_0x1e0c('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x1e0c('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1e0c('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1e0c('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1e0c('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e0c('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1e0c('0x16')](0x3)[_0x1e0c('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1e0c('0x16')](0x5)[_0x1e0c('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e0c('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e0c('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':![],'comment':_0x1e0c('0x4c'),'set':function(_0x379365){if(!_0x379365)this[_0x1e0c('0x1e')](_0x1e0c('0x4d'),null);this[_0x1e0c('0x1e')]('mandatoryDisposition',_0x379365);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1e0c('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1e0c('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1e0c('0x23')],'defaultValue':![]}}; \ No newline at end of file +var _0xf2f0=['STRING','name','ENUM','inbound','default','ringall','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','acw','wrapuptime','BOOLEAN','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','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xf2f0,0xe5));var _0x0f2f=function(_0x5eb4cc,_0x15af2d){_0x5eb4cc=_0x5eb4cc-0x0;var _0x5e9e44=_0xf2f0[_0x5eb4cc];return _0x5e9e44;};'use strict';var Sequelize=require(_0x0f2f('0x0'));module[_0x0f2f('0x1')]={'name':{'type':Sequelize[_0x0f2f('0x2')],'allowNull':![],'unique':_0x0f2f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x0f2f('0x5')},'musiconhold':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':_0x0f2f('0x6')},'announce':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0f2f('0x4')]('rr',_0x0f2f('0x7'),'leastrecent','fewestcalls','random','rrmemory',_0x0f2f('0x8'),_0x0f2f('0x9'),_0x0f2f('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x214ba9){this[_0x0f2f('0xb')]('strategy',_0x214ba9?_0x214ba9:_0x0f2f('0xc'));},'get':function(){var _0x2d7655=this[_0x0f2f('0xd')]('type');var _0x347170=this[_0x0f2f('0xd')]('dialMethod');var _0x2299b5=this[_0x0f2f('0xd')]('strategy');if(_0x2d7655===_0x0f2f('0x5')){return _0x2299b5;}if(_0x347170===_0x0f2f('0xe')&&_0x2299b5===_0x0f2f('0xc')||_0x347170==='booked'&&_0x2299b5===_0x0f2f('0xf')){return _0x2299b5;}if(_0x347170===_0x0f2f('0x10')||_0x347170===_0x0f2f('0x11')||_0x347170===_0x0f2f('0x12')){return _0x2299b5;}return null;}},'servicelevel':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0f2f('0x13')](0xb)},'timeout':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0f2f('0x2')]},'weight':{'type':Sequelize[_0x0f2f('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':_0x0f2f('0x14')},'autopause':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no',_0x0f2f('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0f2f('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0f2f('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0f2f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0f2f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':_0x0f2f('0x14')},'announce_holdtime':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no',_0x0f2f('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0f2f('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x0f2f('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0f2f('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0f2f('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0f2f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0f2f('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0f2f('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0f2f('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0f2f('0x2')]},'queue_less_than':{'type':Sequelize[_0x0f2f('0x2')]},'periodic_announce':{'type':Sequelize[_0x0f2f('0x17')],'set':function(_0x5eaad0){this[_0x0f2f('0xb')](_0x0f2f('0x18'),_0x5eaad0?_0x5eaad0[_0x0f2f('0x19')](','):[]);},'get':function(){return this[_0x0f2f('0xd')]('periodic_announce')?this['getDataValue'](_0x0f2f('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':'yes','set':function(_0x257058){this[_0x0f2f('0xb')](_0x0f2f('0x1a'),_0x257058?_0x257058[_0x0f2f('0x19')](','):undefined);},'get':function(){return this[_0x0f2f('0xd')](_0x0f2f('0x1a'))?this[_0x0f2f('0xd')](_0x0f2f('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x41edeb){this[_0x0f2f('0xb')](_0x0f2f('0x1b'),_0x41edeb?_0x41edeb['join'](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x0f2f('0xd')](_0x0f2f('0x1b'))[_0x0f2f('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0f2f('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0f2f('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1707dd){this[_0x0f2f('0xb')](_0x0f2f('0x1d'),_0x1707dd);if(_0x1707dd){if(this[_0x0f2f('0xd')](_0x0f2f('0x1e'))<0x2){this[_0x0f2f('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0f2f('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':0x0,'comment':_0x0f2f('0x20')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x0f2f('0x10'),'power',_0x0f2f('0x11'),_0x0f2f('0xe')),'defaultValue':_0x0f2f('0x10'),'comment':_0x0f2f('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0f2f('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0f2f('0x23')},'dialLimitQueue':{'type':Sequelize[_0x0f2f('0x13')](0x4)[_0x0f2f('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0f2f('0x24')},'dialPowerLevel':{'type':Sequelize[_0x0f2f('0x25')](0x2)[_0x0f2f('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0f2f('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x27'),_0x0f2f('0x28')),'defaultValue':_0x0f2f('0x28'),'comment':_0x0f2f('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0f2f('0x25')](0x2)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0f2f('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x0f2f('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0f2f('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0f2f('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0f2f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':_0x0f2f('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x0f2f('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x0f2f('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'comment':_0x0f2f('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0f2f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x34'),_0x0f2f('0x35'),'onlyIfOpen'),'defaultValue':_0x0f2f('0x34')},'dialAMDActive':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0f2f('0x13')](0x9)[_0x0f2f('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0f2f('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x0f2f('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0f2f('0x13')](0x9)[_0x0f2f('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0f2f('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0f2f('0x13')](0x9)[_0x0f2f('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f2f('0x38')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0f2f('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0f2f('0x13')](0x9)[_0x0f2f('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0f2f('0x13')](0x9)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0f2f('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0f2f('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f2f('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0f2f('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':0x0,'comment':_0x0f2f('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0f2f('0x4')](_0x0f2f('0x3d'),_0x0f2f('0x3e')),'defaultValue':_0x0f2f('0x3d')},'dialQueueProject2':{'type':Sequelize[_0x0f2f('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0f2f('0x3f')},'dialCutDigit':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0f2f('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x43')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0f2f('0x13')](0x5)[_0x0f2f('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x46')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0f2f('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f2f('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f2f('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f2f('0x13')],'allowNull':!![],'comment':_0x0f2f('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':![],'comment':_0x0f2f('0x4c'),'set':function(_0x5b13c4){if(!_0x5b13c4)this[_0x0f2f('0xb')]('mandatoryDispositionPauseId',null);this[_0x0f2f('0xb')]('mandatoryDisposition',_0x5b13c4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0f2f('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x0f2f('0x13')](0x3)[_0x0f2f('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0f2f('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index c710b3c..0eb4a2d 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 _0x6011=['onlyIfOpen','insert','into','cm_hopper','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','filter','options','includeAll','findAll','rows','catch','show','params','keys','length','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','getHoppers','findOne','pick','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','transaction','removeTeams','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)'];(function(_0x327692,_0x2c7567){var _0x1ae0d2=function(_0x2365fe){while(--_0x2365fe){_0x327692['push'](_0x327692['shift']());}};_0x1ae0d2(++_0x2c7567);}(_0x6011,0x196));var _0x1601=function(_0x24febc,_0x133fc8){_0x24febc=_0x24febc-0x0;var _0x379e8a=_0x6011[_0x24febc];return _0x379e8a;};'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(_0x1601('0x0'));var BPromise=require(_0x1601('0x1'));var Mustache=require('mustache');var util=require(_0x1601('0x2'));var path=require(_0x1601('0x3'));var sox=require(_0x1601('0x4'));var csv=require(_0x1601('0x5'));var ejs=require(_0x1601('0x6'));var fs=require('fs');var fs_extra=require(_0x1601('0x7'));var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x5'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1601('0x10'))('api');var utils=require(_0x1601('0x11'));var config=require(_0x1601('0x12'));var licenseUtil=require(_0x1601('0x13'));var db=require(_0x1601('0x14'))['db'];config[_0x1601('0x15')]=_[_0x1601('0x16')](config[_0x1601('0x15')],{'host':_0x1601('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1601('0x15')]));require('./voiceQueue.socket')[_0x1601('0x18')](socket);function respondWithStatusCode(_0x5d642d,_0x2f0837){_0x2f0837=_0x2f0837||0xcc;return function(_0x3b6554){if(_0x3b6554){return _0x5d642d['sendStatus'](_0x2f0837);}return _0x5d642d[_0x1601('0x19')](_0x2f0837)[_0x1601('0x1a')]();};}function respondWithResult(_0x12ddb0,_0x595c96){_0x595c96=_0x595c96||0xc8;return function(_0x508766){if(_0x508766){return _0x12ddb0[_0x1601('0x19')](_0x595c96)[_0x1601('0x1b')](_0x508766);}};}function respondWithFilteredResult(_0x3621e2,_0x42bef2){return function(_0x1d8563){if(_0x1d8563){var _0x302350=typeof _0x42bef2[_0x1601('0x1c')]===_0x1601('0x1d')&&typeof _0x42bef2[_0x1601('0x1e')]==='undefined';var _0x4d077e=_0x1d8563[_0x1601('0x1f')];var _0x1ce486=_0x302350?0x0:_0x42bef2[_0x1601('0x1c')];var _0x5bd8fb=_0x302350?_0x1d8563[_0x1601('0x1f')]:_0x42bef2[_0x1601('0x1c')]+_0x42bef2[_0x1601('0x1e')];var _0x2e2e0d;if(_0x5bd8fb>=_0x4d077e){_0x5bd8fb=_0x4d077e;_0x2e2e0d=0xc8;}else{_0x2e2e0d=0xce;}_0x3621e2[_0x1601('0x19')](_0x2e2e0d);return _0x3621e2['set'](_0x1601('0x20'),_0x1ce486+'-'+_0x5bd8fb+'/'+_0x4d077e)[_0x1601('0x1b')](_0x1d8563);}return null;};}function patchUpdates(_0x220313){return function(_0x4a9e7f){try{jsonpatch[_0x1601('0x21')](_0x4a9e7f,_0x220313,!![]);}catch(_0x330033){return BPromise['reject'](_0x330033);}return _0x4a9e7f[_0x1601('0x22')]();};}function saveUpdates(_0xa8e856,_0x5c9543){return function(_0x5ae062){if(_0x5ae062){return _0x5ae062[_0x1601('0x23')](_0xa8e856)[_0x1601('0x24')](function(_0x34d021){return _0x34d021;});}return null;};}function removeEntity(_0x4919f2,_0x362f51){return function(_0x3810b3){if(_0x3810b3){return _0x3810b3[_0x1601('0x25')]()[_0x1601('0x24')](function(){var _0x296c34=_0x3810b3['get']({'plain':!![]});var _0x4b2f0d=[{'name':_0x1601('0x26'),'value':_0x1601('0x27'),'ignore':![]},{'name':_0x1601('0x28'),'value':'outbound','ignore':![]}];var _0x2b55e1=_(_0x4b2f0d)['filter'](_0x1601('0x29'))[_0x1601('0x2a')](_0x1601('0x2b'))['value']();if(_[_0x1601('0x2c')](_0x2b55e1,_0x296c34[_0x1601('0x2d')])){return;}var _0x33b358=_[_0x1601('0x2e')](_0x4b2f0d,['value',_0x296c34[_0x1601('0x2d')]])[_0x1601('0x2f')];return db[_0x1601('0x30')][_0x1601('0x25')]({'where':{'type':_0x33b358,'resourceId':_0x296c34['id']}})[_0x1601('0x24')](function(){return _0x3810b3;});})[_0x1601('0x24')](function(){_0x4919f2[_0x1601('0x19')](0xcc)[_0x1601('0x1a')]();});}};}function handleEntityNotFound(_0x170bbb,_0x1d782f){return function(_0x104084){if(!_0x104084){_0x170bbb[_0x1601('0x31')](0x194);}return _0x104084;};}function handleError(_0x274da8,_0x4edafe){_0x4edafe=_0x4edafe||0x1f4;return function(_0x3e8fde){logger[_0x1601('0x32')](_0x3e8fde[_0x1601('0x33')]);if(_0x3e8fde[_0x1601('0x2f')]){delete _0x3e8fde[_0x1601('0x2f')];}_0x274da8['status'](_0x4edafe)[_0x1601('0x34')](_0x3e8fde);};}exports[_0x1601('0x35')]=function(_0x5e8775,_0x3ce496){var _0x48c1cf={},_0x3a92d9={},_0x39e89f={'count':0x0,'rows':[]};var _0x4b2f6c=_[_0x1601('0x2a')](db[_0x1601('0x36')][_0x1601('0x37')],function(_0x42b2e7){return{'name':_0x42b2e7[_0x1601('0x38')],'type':_0x42b2e7[_0x1601('0x2d')][_0x1601('0x39')]};});_0x3a92d9['model']=_[_0x1601('0x2a')](_0x4b2f6c,_0x1601('0x2f'));_0x3a92d9['query']=_['keys'](_0x5e8775[_0x1601('0x3a')]);_0x3a92d9[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x3a92d9[_0x1601('0x3d')],_0x3a92d9[_0x1601('0x3a')]);_0x48c1cf[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x3a92d9['model'],qs[_0x1601('0x3f')](_0x5e8775[_0x1601('0x3a')]['fields']));_0x48c1cf['attributes']=_0x48c1cf[_0x1601('0x3e')]['length']?_0x48c1cf['attributes']:_0x3a92d9['model'];if(!_0x5e8775[_0x1601('0x3a')][_0x1601('0x40')](_0x1601('0x41'))){_0x48c1cf[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x5e8775[_0x1601('0x3a')][_0x1601('0x1e')]);_0x48c1cf[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x5e8775[_0x1601('0x3a')][_0x1601('0x1c')]);}_0x48c1cf[_0x1601('0x42')]=qs[_0x1601('0x43')](_0x5e8775['query'][_0x1601('0x43')]);_0x48c1cf['where']=qs['filters'](_['pick'](_0x5e8775[_0x1601('0x3a')],_0x3a92d9[_0x1601('0x3b')]),_0x4b2f6c);if(_0x5e8775[_0x1601('0x3a')]['filter']){_0x48c1cf['where']=_[_0x1601('0x44')](_0x48c1cf[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x4b2f6c,function(_0x52c92a){if(_0x52c92a[_0x1601('0x2d')]!=='VIRTUAL'){var _0x3aba50={};_0x3aba50[_0x52c92a[_0x1601('0x2f')]]={'$like':'%'+_0x5e8775[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x3aba50;}})});}_0x48c1cf=_['merge']({},_0x48c1cf,_0x5e8775[_0x1601('0x47')]);var _0x4abfbe={'where':_0x48c1cf[_0x1601('0x45')]};return db[_0x1601('0x36')]['count'](_0x4abfbe)[_0x1601('0x24')](function(_0x13b0ad){_0x39e89f[_0x1601('0x1f')]=_0x13b0ad;if(_0x5e8775['query'][_0x1601('0x48')]){_0x48c1cf['include']=[{'all':!![]}];}return db[_0x1601('0x36')][_0x1601('0x49')](_0x48c1cf);})[_0x1601('0x24')](function(_0x22556a){_0x39e89f[_0x1601('0x4a')]=_0x22556a;return _0x39e89f;})[_0x1601('0x24')](respondWithFilteredResult(_0x3ce496,_0x48c1cf))[_0x1601('0x4b')](handleError(_0x3ce496,null));};exports[_0x1601('0x4c')]=function(_0xfff66c,_0x4a710f){var _0x143c82={'raw':![],'where':{'id':_0xfff66c[_0x1601('0x4d')]['id']}},_0x4db2b0={};_0x4db2b0[_0x1601('0x3d')]=_['keys'](db[_0x1601('0x36')][_0x1601('0x37')]);_0x4db2b0['query']=_[_0x1601('0x4e')](_0xfff66c[_0x1601('0x3a')]);_0x4db2b0[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x4db2b0[_0x1601('0x3d')],_0x4db2b0[_0x1601('0x3a')]);_0x143c82[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x4db2b0[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0xfff66c['query'][_0x1601('0x3f')]));_0x143c82['attributes']=_0x143c82[_0x1601('0x3e')][_0x1601('0x4f')]?_0x143c82[_0x1601('0x3e')]:_0x4db2b0['model'];if(_0xfff66c['query'][_0x1601('0x48')]){_0x143c82[_0x1601('0x50')]=[{'all':!![]}];}_0x143c82=_['merge']({},_0x143c82,_0xfff66c['options']);return db['VoiceQueue'][_0x1601('0x2e')](_0x143c82)['then'](handleEntityNotFound(_0x4a710f,null))[_0x1601('0x24')](respondWithResult(_0x4a710f,null))[_0x1601('0x4b')](handleError(_0x4a710f,null));};exports[_0x1601('0x51')]=function(_0x39ccd8,_0x4ff1a5){return db['VoiceQueue'][_0x1601('0x51')](_0x39ccd8[_0x1601('0x52')],{})['then'](function(_0x375e8f){var _0x34a432=_0x39ccd8[_0x1601('0x53')][_0x1601('0x54')]({'plain':!![]});if(!_0x34a432)throw new Error(_0x1601('0x55'));if(_0x34a432[_0x1601('0x56')]===_0x1601('0x53')){var _0x5d6a0e=_0x375e8f[_0x1601('0x54')]({'plain':!![]});var _0x476453=[{'name':_0x1601('0x26'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x1601('0x57')}];var _0x20b514=_['find'](_0x476453,[_0x1601('0x2b'),_0x5d6a0e[_0x1601('0x2d')]])[_0x1601('0x2f')];return db[_0x1601('0x58')][_0x1601('0x2e')]({'where':{'name':_0x20b514,'userProfileId':_0x34a432[_0x1601('0x59')]},'raw':!![]})[_0x1601('0x24')](function(_0x22ce7a){if(_0x22ce7a&&_0x22ce7a[_0x1601('0x5a')]===0x0){return db[_0x1601('0x30')][_0x1601('0x51')]({'name':_0x5d6a0e[_0x1601('0x2f')],'resourceId':_0x5d6a0e['id'],'type':_0x22ce7a[_0x1601('0x2f')],'sectionId':_0x22ce7a['id']},{})['then'](function(){return _0x375e8f;});}else{return _0x375e8f;}})[_0x1601('0x4b')](function(_0x15955b){logger['error'](_0x1601('0x5b'),_0x15955b);throw _0x15955b;});}return _0x375e8f;})['then'](respondWithResult(_0x4ff1a5,0xc9))[_0x1601('0x4b')](handleError(_0x4ff1a5,null));};exports['clone']=function(_0x352cc3,_0x32e119){var _0x1865cd={'where':{'id':_0x352cc3[_0x1601('0x4d')]['id']}},_0x54b9ad={};_0x54b9ad[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x36')]['rawAttributes']);_0x1865cd['attributes']=_['intersection'](_0x54b9ad[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0x352cc3['query'][_0x1601('0x3f')]));_0x1865cd[_0x1601('0x3e')]=_0x1865cd[_0x1601('0x3e')][_0x1601('0x4f')]?_0x1865cd[_0x1601('0x3e')]:_0x54b9ad[_0x1601('0x3d')];if(_0x352cc3[_0x1601('0x3a')]['includeAll']){_0x1865cd[_0x1601('0x50')]=[{'all':!![]}];}_0x1865cd=_['merge']({},_0x1865cd,_0x352cc3[_0x1601('0x47')]);return db[_0x1601('0x36')][_0x1601('0x2e')](_0x1865cd)[_0x1601('0x24')](handleEntityNotFound(_0x32e119,null))[_0x1601('0x24')](function(_0xdae12c){if(_0xdae12c){var _0x477f1d=_0xdae12c[_0x1601('0x54')]({'plain':!![]});_0x477f1d=qs[_0x1601('0x5c')](_0x477f1d,['id','createdAt',_0x1601('0x5d')]);_0x352cc3[_0x1601('0x52')]=_[_0x1601('0x5c')](_0x352cc3[_0x1601('0x52')],['id',_0x1601('0x5e'),'updatedAt']);return db[_0x1601('0x36')]['create'](_['merge'](_0x477f1d,_0x352cc3[_0x1601('0x52')]),{'include':_0x352cc3[_0x1601('0x3a')][_0x1601('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x5e7b4a){var _0x29543a=_0x352cc3[_0x1601('0x53')][_0x1601('0x54')]({'plain':!![]});if(!_0x29543a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29543a['role']===_0x1601('0x53')){var _0x3b61f3=_0x5e7b4a[_0x1601('0x54')]({'plain':!![]});var _0x2176d4=[{'name':_0x1601('0x26'),'value':'inbound'},{'name':_0x1601('0x28'),'value':'outbound'}];var _0x26417c=_[_0x1601('0x2e')](_0x2176d4,[_0x1601('0x2b'),_0x3b61f3[_0x1601('0x2d')]])['name'];return db[_0x1601('0x58')]['find']({'where':{'name':_0x26417c,'userProfileId':_0x29543a[_0x1601('0x59')]},'raw':!![]})['then'](function(_0x1b4c62){if(_0x1b4c62&&_0x1b4c62[_0x1601('0x5a')]===0x0){return db[_0x1601('0x30')][_0x1601('0x51')]({'name':_0x3b61f3['name'],'resourceId':_0x3b61f3['id'],'type':_0x1b4c62[_0x1601('0x2f')],'sectionId':_0x1b4c62['id']},{})[_0x1601('0x24')](function(){return _0x5e7b4a;});}else{return _0x5e7b4a;}})['catch'](function(_0x67bc01){logger['error'](_0x1601('0x5b'),_0x67bc01);throw _0x67bc01;});}return _0x5e7b4a;});}})[_0x1601('0x24')](respondWithResult(_0x32e119,0xc9))[_0x1601('0x4b')](handleError(_0x32e119,null));};exports[_0x1601('0x23')]=function(_0x3bd65f,_0xe728f8){if(_0x3bd65f[_0x1601('0x52')]['id']){delete _0x3bd65f[_0x1601('0x52')]['id'];}return db['VoiceQueue'][_0x1601('0x2e')]({'where':{'id':_0x3bd65f[_0x1601('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe728f8,null))[_0x1601('0x24')](saveUpdates(_0x3bd65f[_0x1601('0x52')],null))[_0x1601('0x24')](respondWithResult(_0xe728f8,null))[_0x1601('0x4b')](handleError(_0xe728f8,null));};exports[_0x1601('0x25')]=function(_0x1a84ce,_0x2c5c40){return db[_0x1601('0x36')][_0x1601('0x2e')]({'where':{'id':_0x1a84ce[_0x1601('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c5c40,null))[_0x1601('0x24')](removeEntity(_0x2c5c40,null))[_0x1601('0x4b')](handleError(_0x2c5c40,null));};exports[_0x1601('0x5f')]=function(_0x2820af,_0x408c57,_0x3da5f7){var _0x2f6622={'raw':![],'where':{}};var _0x4067f2={};var _0x31e81a={'count':0x0,'rows':[]};return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x2820af[_0x1601('0x4d')]['id']}})['then'](handleEntityNotFound(_0x408c57,null))[_0x1601('0x24')](function(_0x2f5d24){if(_0x2f5d24){_0x4067f2[_0x1601('0x3d')]=_[_0x1601('0x4e')](db['CmHopper']['rawAttributes']);_0x4067f2['query']=_[_0x1601('0x4e')](_0x2820af['query']);_0x4067f2[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x4067f2['model'],_0x4067f2[_0x1601('0x3a')]);_0x2f6622['attributes']=_[_0x1601('0x3c')](_0x4067f2['model'],qs[_0x1601('0x3f')](_0x2820af['query']['fields']));_0x2f6622[_0x1601('0x3e')]=_0x2f6622[_0x1601('0x3e')][_0x1601('0x4f')]?_0x2f6622['attributes']:_0x4067f2[_0x1601('0x3d')];if(!_0x2820af[_0x1601('0x3a')][_0x1601('0x40')]('nolimit')){_0x2f6622[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x2820af['query'][_0x1601('0x1e')]);_0x2f6622[_0x1601('0x1c')]=qs['offset'](_0x2820af[_0x1601('0x3a')]['offset']);}_0x2f6622[_0x1601('0x42')]=qs['sort'](_0x2820af[_0x1601('0x3a')][_0x1601('0x43')]);_0x2f6622[_0x1601('0x45')]=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x2820af[_0x1601('0x3a')],_0x4067f2[_0x1601('0x3b')]));_0x2f6622['where']['VoiceQueueId']=_0x2f5d24['id'];if(_0x2820af['query'][_0x1601('0x46')]){_0x2f6622[_0x1601('0x45')]=_[_0x1601('0x44')](_0x2f6622[_0x1601('0x45')],{'$or':_['map'](_0x2f6622[_0x1601('0x3e')],function(_0x3b1e4e){var _0x80c923={};_0x80c923[_0x3b1e4e]={'$like':'%'+_0x2820af[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x80c923;})});}_0x2f6622=_[_0x1601('0x44')]({},_0x2f6622,_0x2820af[_0x1601('0x47')]);return db[_0x1601('0x62')][_0x1601('0x1f')]({'where':_0x2f6622[_0x1601('0x45')]})['then'](function(_0xfa8048){_0x31e81a[_0x1601('0x1f')]=_0xfa8048;if(_0x2820af[_0x1601('0x3a')][_0x1601('0x48')]){_0x2f6622[_0x1601('0x50')]=[{'all':!![]}];}return db[_0x1601('0x62')][_0x1601('0x49')](_0x2f6622);})[_0x1601('0x24')](function(_0x16bc8a){_0x31e81a[_0x1601('0x4a')]=_0x16bc8a;return _0x31e81a;});}})[_0x1601('0x24')](respondWithFilteredResult(_0x408c57,_0x2f6622))['catch'](handleError(_0x408c57,null));};exports[_0x1601('0x63')]=function(_0x5aad4c,_0x769dc1,_0x22dd35){var _0x240c6c={'raw':!![],'where':{}};var _0x120114={};var _0x5e4d2c={'count':0x0,'rows':[]};return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x5aad4c[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x769dc1,null))[_0x1601('0x24')](function(_0x3f33b1){if(_0x3f33b1){_0x120114[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x64')][_0x1601('0x37')]);_0x120114[_0x1601('0x3a')]=_[_0x1601('0x4e')](_0x5aad4c[_0x1601('0x3a')]);_0x120114[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x120114[_0x1601('0x3d')],_0x120114[_0x1601('0x3a')]);_0x240c6c[_0x1601('0x3e')]=_['intersection'](_0x120114[_0x1601('0x3d')],qs['fields'](_0x5aad4c[_0x1601('0x3a')][_0x1601('0x3f')]));_0x240c6c[_0x1601('0x3e')]=_0x240c6c[_0x1601('0x3e')][_0x1601('0x4f')]?_0x240c6c[_0x1601('0x3e')]:_0x120114[_0x1601('0x3d')];if(!_0x5aad4c[_0x1601('0x3a')][_0x1601('0x40')](_0x1601('0x41'))){_0x240c6c[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x5aad4c[_0x1601('0x3a')][_0x1601('0x1e')]);_0x240c6c[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x5aad4c[_0x1601('0x3a')][_0x1601('0x1c')]);}_0x240c6c['order']=qs[_0x1601('0x43')](_0x5aad4c[_0x1601('0x3a')][_0x1601('0x43')]);_0x240c6c[_0x1601('0x45')]=qs[_0x1601('0x3b')](_['pick'](_0x5aad4c[_0x1601('0x3a')],_0x120114['filters']));_0x240c6c[_0x1601('0x45')][_0x1601('0x65')]=_0x3f33b1['id'];if(_0x5aad4c[_0x1601('0x3a')][_0x1601('0x46')]){_0x240c6c['where']=_['merge'](_0x240c6c[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x240c6c[_0x1601('0x3e')],function(_0x33acd6){var _0x1a737d={};_0x1a737d[_0x33acd6]={'$like':'%'+_0x5aad4c['query'][_0x1601('0x46')]+'%'};return _0x1a737d;})});}_0x240c6c=_['merge']({},_0x240c6c,_0x5aad4c[_0x1601('0x47')]);return db['CmHopperHistory'][_0x1601('0x1f')]({'where':_0x240c6c[_0x1601('0x45')]})[_0x1601('0x24')](function(_0x788911){_0x5e4d2c['count']=_0x788911;if(_0x5aad4c[_0x1601('0x3a')][_0x1601('0x48')]){_0x240c6c['include']=[{'all':!![]}];}return db[_0x1601('0x64')][_0x1601('0x49')](_0x240c6c);})[_0x1601('0x24')](function(_0x3914b8){_0x5e4d2c[_0x1601('0x4a')]=_0x3914b8;return _0x5e4d2c;});}})[_0x1601('0x24')](respondWithFilteredResult(_0x769dc1,_0x240c6c))[_0x1601('0x4b')](handleError(_0x769dc1,null));};exports['getHopperFinals']=function(_0x37f113,_0x452987,_0x93ec33){var _0x1056f7={'raw':!![],'where':{}};var _0x25f829={};var _0xd0892b={'count':0x0,'rows':[]};return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x37f113[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x452987,null))['then'](function(_0x238e26){if(_0x238e26){_0x25f829[_0x1601('0x3d')]=_[_0x1601('0x4e')](db['CmHopperFinal'][_0x1601('0x37')]);_0x25f829[_0x1601('0x3a')]=_['keys'](_0x37f113[_0x1601('0x3a')]);_0x25f829[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x25f829[_0x1601('0x3d')],_0x25f829['query']);_0x1056f7[_0x1601('0x3e')]=_['intersection'](_0x25f829[_0x1601('0x3d')],qs['fields'](_0x37f113[_0x1601('0x3a')][_0x1601('0x3f')]));_0x1056f7[_0x1601('0x3e')]=_0x1056f7[_0x1601('0x3e')][_0x1601('0x4f')]?_0x1056f7[_0x1601('0x3e')]:_0x25f829[_0x1601('0x3d')];if(!_0x37f113[_0x1601('0x3a')][_0x1601('0x40')](_0x1601('0x41'))){_0x1056f7[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x37f113[_0x1601('0x3a')][_0x1601('0x1e')]);_0x1056f7[_0x1601('0x1c')]=qs['offset'](_0x37f113[_0x1601('0x3a')][_0x1601('0x1c')]);}_0x1056f7[_0x1601('0x42')]=qs['sort'](_0x37f113[_0x1601('0x3a')][_0x1601('0x43')]);_0x1056f7['where']=qs['filters'](_[_0x1601('0x61')](_0x37f113[_0x1601('0x3a')],_0x25f829[_0x1601('0x3b')]));_0x1056f7[_0x1601('0x45')][_0x1601('0x65')]=_0x238e26['id'];if(_0x37f113[_0x1601('0x3a')][_0x1601('0x46')]){_0x1056f7[_0x1601('0x45')]=_[_0x1601('0x44')](_0x1056f7['where'],{'$or':_['map'](_0x1056f7[_0x1601('0x3e')],function(_0x5c564b){var _0x1866b4={};_0x1866b4[_0x5c564b]={'$like':'%'+_0x37f113[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x1866b4;})});}_0x1056f7=_[_0x1601('0x44')]({},_0x1056f7,_0x37f113[_0x1601('0x47')]);return db[_0x1601('0x66')][_0x1601('0x1f')]({'where':_0x1056f7[_0x1601('0x45')]})[_0x1601('0x24')](function(_0x1ad64c){_0xd0892b[_0x1601('0x1f')]=_0x1ad64c;if(_0x37f113[_0x1601('0x3a')][_0x1601('0x48')]){_0x1056f7[_0x1601('0x50')]=[{'all':!![]}];}return db[_0x1601('0x66')][_0x1601('0x49')](_0x1056f7);})[_0x1601('0x24')](function(_0x35cef2){_0xd0892b[_0x1601('0x4a')]=_0x35cef2;return _0xd0892b;});}})[_0x1601('0x24')](respondWithFilteredResult(_0x452987,_0x1056f7))[_0x1601('0x4b')](handleError(_0x452987,null));};exports['getHopperBlacks']=function(_0x2615c7,_0x40e4bc,_0x3cca7c){var _0x2544c9={'raw':!![],'where':{}};var _0x11f5fc={};var _0x45870c={'count':0x0,'rows':[]};return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x2615c7[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x40e4bc,null))[_0x1601('0x24')](function(_0x182d31){if(_0x182d31){_0x11f5fc[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x67')][_0x1601('0x37')]);_0x11f5fc[_0x1601('0x3a')]=_['keys'](_0x2615c7[_0x1601('0x3a')]);_0x11f5fc['filters']=_[_0x1601('0x3c')](_0x11f5fc[_0x1601('0x3d')],_0x11f5fc['query']);_0x2544c9[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x11f5fc[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0x2615c7[_0x1601('0x3a')][_0x1601('0x3f')]));_0x2544c9[_0x1601('0x3e')]=_0x2544c9[_0x1601('0x3e')][_0x1601('0x4f')]?_0x2544c9[_0x1601('0x3e')]:_0x11f5fc[_0x1601('0x3d')];if(!_0x2615c7[_0x1601('0x3a')][_0x1601('0x40')]('nolimit')){_0x2544c9[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x2615c7[_0x1601('0x3a')][_0x1601('0x1e')]);_0x2544c9[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x2615c7[_0x1601('0x3a')]['offset']);}_0x2544c9[_0x1601('0x42')]=qs['sort'](_0x2615c7[_0x1601('0x3a')][_0x1601('0x43')]);_0x2544c9[_0x1601('0x45')]=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x2615c7[_0x1601('0x3a')],_0x11f5fc[_0x1601('0x3b')]));_0x2544c9[_0x1601('0x45')][_0x1601('0x65')]=_0x182d31['id'];if(_0x2615c7['query'][_0x1601('0x46')]){_0x2544c9[_0x1601('0x45')]=_[_0x1601('0x44')](_0x2544c9[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x2544c9['attributes'],function(_0x3ffc87){var _0x2d3beb={};_0x2d3beb[_0x3ffc87]={'$like':'%'+_0x2615c7[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x2d3beb;})});}_0x2544c9=_[_0x1601('0x44')]({},_0x2544c9,_0x2615c7[_0x1601('0x47')]);return db[_0x1601('0x67')][_0x1601('0x1f')]({'where':_0x2544c9[_0x1601('0x45')]})[_0x1601('0x24')](function(_0x3abae7){_0x45870c[_0x1601('0x1f')]=_0x3abae7;if(_0x2615c7['query'][_0x1601('0x48')]){_0x2544c9[_0x1601('0x50')]=[{'all':!![]}];}return db[_0x1601('0x67')]['findAll'](_0x2544c9);})['then'](function(_0x39bf0c){_0x45870c[_0x1601('0x4a')]=_0x39bf0c;return _0x45870c;});}})[_0x1601('0x24')](respondWithFilteredResult(_0x40e4bc,_0x2544c9))[_0x1601('0x4b')](handleError(_0x40e4bc,null));};exports['getTeams']=function(_0x57c997,_0x6cb632,_0x372ed4){var _0x1ce99d={};var _0x2f39b3={};var _0x41047a;var _0x5e06bb;return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x57c997[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x6cb632,null))[_0x1601('0x24')](function(_0x421512){if(_0x421512){_0x41047a=_0x421512;_0x2f39b3['model']=_['keys'](db[_0x1601('0x68')]['rawAttributes']);_0x2f39b3['query']=_[_0x1601('0x4e')](_0x57c997[_0x1601('0x3a')]);_0x2f39b3[_0x1601('0x3b')]=_['intersection'](_0x2f39b3['model'],_0x2f39b3[_0x1601('0x3a')]);_0x1ce99d[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x2f39b3[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0x57c997['query'][_0x1601('0x3f')]));_0x1ce99d[_0x1601('0x3e')]=_0x1ce99d['attributes']['length']?_0x1ce99d[_0x1601('0x3e')]:_0x2f39b3['model'];_0x1ce99d[_0x1601('0x42')]=qs['sort'](_0x57c997[_0x1601('0x3a')][_0x1601('0x43')]);_0x1ce99d['where']=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x57c997[_0x1601('0x3a')],_0x2f39b3['filters']));if(_0x57c997[_0x1601('0x3a')][_0x1601('0x46')]){_0x1ce99d[_0x1601('0x45')]=_[_0x1601('0x44')](_0x1ce99d[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x1ce99d['attributes'],function(_0x2c1188){var _0x55bb8b={};_0x55bb8b[_0x2c1188]={'$like':'%'+_0x57c997[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x55bb8b;})});}_0x1ce99d=_['merge']({},_0x1ce99d,_0x57c997['options']);return _0x41047a[_0x1601('0x69')](_0x1ce99d);}})[_0x1601('0x24')](function(_0x5f2706){if(_0x5f2706){_0x5e06bb=_0x5f2706[_0x1601('0x4f')];if(!_0x57c997[_0x1601('0x3a')][_0x1601('0x40')]('nolimit')){_0x1ce99d['limit']=qs[_0x1601('0x1e')](_0x57c997[_0x1601('0x3a')][_0x1601('0x1e')]);_0x1ce99d['offset']=qs['offset'](_0x57c997[_0x1601('0x3a')]['offset']);}return _0x41047a[_0x1601('0x69')](_0x1ce99d);}})['then'](function(_0x200a31){if(_0x200a31){return _0x200a31?{'count':_0x5e06bb,'rows':_0x200a31}:null;}})[_0x1601('0x24')](respondWithResult(_0x6cb632,null))['catch'](handleError(_0x6cb632,null));};exports[_0x1601('0x6a')]=function(_0x2d8a05,_0x292b1c,_0x105e6e){var _0x7675ac=_0x2d8a05['body']['teams'];var _0x44331a=_[_0x1601('0x2a')](_0x7675ac,'id');return db[_0x1601('0x68')][_0x1601('0x49')]({'where':{'id':_0x44331a},'attributes':['id'],'include':[{'model':db[_0x1601('0x6b')],'as':_0x1601('0x6c'),'attributes':['id',_0x1601('0x2f'),_0x1601('0x6d'),_0x1601('0x6e'),_0x1601('0x6f')],'raw':!![]}]})[_0x1601('0x24')](function(_0x48b6e8){if(_0x48b6e8){var _0x23950a=_[_0x1601('0x70')](_0x48b6e8,function(_0x324bbd){var _0x115d2c=_0x324bbd[_0x1601('0x54')]({'plain':!![]});_0x115d2c[_0x1601('0x6c')][_0x1601('0x71')](function(_0x2788b8){_0x2788b8[_0x1601('0x72')]=_[_0x1601('0x2e')](_0x7675ac,{'id':_0x115d2c['id']})[_0x1601('0x72')];});return _0x115d2c[_0x1601('0x6c')];});return db['VoiceQueue']['find']({'where':{'id':_0x2d8a05[_0x1601('0x4d')]['id']}})['then'](function(_0x4fefaa){return db[_0x1601('0x73')]['transaction'](function(_0x3f4c99){return _0x4fefaa['addTeams'](_0x44331a,{'transaction':_0x3f4c99})[_0x1601('0x24')](function(){return BPromise[_0x1601('0x74')](_0x7675ac,function(_0x5c6cc1){return db[_0x1601('0x75')]['upsert']({'TeamId':_0x5c6cc1['id'],'VoiceQueueId':_0x2d8a05[_0x1601('0x4d')]['id'],'penalty':_0x5c6cc1[_0x1601('0x72')]},{'transaction':_0x3f4c99});});})[_0x1601('0x24')](function(){return BPromise[_0x1601('0x74')](_0x23950a,function(_0x5e9be6){return db['UserVoiceQueue'][_0x1601('0x76')]({'where':{'UserId':_0x5e9be6['id'],'VoiceQueueId':_0x2d8a05[_0x1601('0x4d')]['id']},'defaults':{'penalty':_0x5e9be6[_0x1601('0x72')]},'transaction':_0x3f4c99});});})['then'](function(){return BPromise['each'](_[_0x1601('0x46')](_0x23950a,{'online':!![]}),function(_0x3deced){return db[_0x1601('0x77')][_0x1601('0x78')]({'membername':_0x3deced[_0x1601('0x2f')],'UserId':_0x3deced['id'],'queue_name':_0x4fefaa[_0x1601('0x2f')],'VoiceQueueId':_0x4fefaa['id'],'interface':_[_0x1601('0x79')](_0x3deced['interface'])?util[_0x1601('0x7a')]('SIP/%s',_0x3deced[_0x1601('0x2f')]):_0x3deced['interface'],'paused':_0x3deced[_0x1601('0x6e')]||![],'penalty':_0x3deced[_0x1601('0x72')]},{'transaction':_0x3f4c99});});})[_0x1601('0x24')](function(){_0x23950a[_0x1601('0x71')](function(_0x4d172a){socket[_0x1601('0x7b')](_0x1601('0x7c'),{'UserId':_0x4d172a['id'],'VoiceQueueId':_0x4fefaa['id']});});});});});}})[_0x1601('0x24')](respondWithStatusCode(_0x292b1c,null))[_0x1601('0x4b')](handleError(_0x292b1c,null));};exports['removeTeams']=function(_0x2087f5,_0x4cfde8,_0x4c8609){return db[_0x1601('0x68')][_0x1601('0x49')]({'where':{'id':_0x2087f5[_0x1601('0x3a')][_0x1601('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x1601('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1601('0x24')](handleEntityNotFound(_0x4cfde8,null))['then'](function(_0x1778a8){var _0x598f51=_[_0x1601('0x2a')](_0x1778a8,'id');var _0x56ada4=[];var _0x1c25ce=[];var _0x13177b=squel['select']();_0x13177b[_0x1601('0x7e')](_0x1601('0x7f'))[_0x1601('0x80')](_0x1601('0x81'),'tq')[_0x1601('0x82')](_0x1601('0x83'),'ut',_0x1601('0x84'))[_0x1601('0x45')](_0x1601('0x85'),_0x2087f5[_0x1601('0x4d')]['id']);for(var _0x1f1f29=0x0;_0x1f1f29<_0x1778a8['length'];_0x1f1f29+=0x1){let _0x779d3e=_0x1778a8[_0x1f1f29];for(var _0x5bfe6b=0x0;_0x5bfe6b<_0x779d3e[_0x1601('0x6c')][_0x1601('0x4f')];_0x5bfe6b+=0x1){let _0xe73d6d=_0x779d3e['Agents'][_0x5bfe6b];var _0x2f56a7=_0x13177b[_0x1601('0x86')]();_0x2f56a7['where'](_0x1601('0x87'),_0xe73d6d['id']);_0x1c25ce[_0x1601('0x88')](db[_0x1601('0x73')][_0x1601('0x3a')](_0x2f56a7[_0x1601('0x89')](),{'type':db[_0x1601('0x73')][_0x1601('0x8a')]['SELECT']})[_0x1601('0x24')](function(_0x1d9019){if(_0x1d9019[_0x1601('0x4f')]===0x1){return _0xe73d6d['id'];}else{var _0x962e3c=_[_0x1601('0x8b')](_['map'](_0x1d9019,_0x1601('0x8c')),function(_0x12897c){return _[_0x1601('0x2c')](_0x598f51,_0x12897c);});if(_0x962e3c){return _0xe73d6d['id'];}}}));}}return BPromise[_0x1601('0x8d')](_0x1c25ce)[_0x1601('0x24')](function(_0x4567e8){_0x56ada4=_(_0x56ada4)[_0x1601('0x8e')](_0x4567e8)[_0x1601('0x8f')]()[_0x1601('0x2b')]();return db[_0x1601('0x36')][_0x1601('0x2e')]({'where':{'id':_0x2087f5[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](function(_0x48a9e9){return db['sequelize'][_0x1601('0x90')](function(_0x49ee7e){return _0x48a9e9[_0x1601('0x91')](_0x2087f5['query'][_0x1601('0x7d')],{'transaction':_0x49ee7e})['then'](function(){if(!_['isEmpty'](_0x56ada4)){return _0x48a9e9[_0x1601('0x92')](_0x56ada4,{'transaction':_0x49ee7e})['then'](function(){return db['UserVoiceQueueRt'][_0x1601('0x25')]({'where':{'VoiceQueueId':_0x2087f5[_0x1601('0x4d')]['id'],'UserId':_0x56ada4},'transaction':_0x49ee7e});});}})[_0x1601('0x24')](function(){_0x56ada4['forEach'](function(_0x38818d){socket[_0x1601('0x7b')](_0x1601('0x93'),{'UserId':_0x38818d,'VoiceQueueId':_0x48a9e9['id']});});});});});});})[_0x1601('0x24')](respondWithStatusCode(_0x4cfde8,null))[_0x1601('0x4b')](handleError(_0x4cfde8,null));};exports[_0x1601('0x94')]=function(_0x337615,_0x43abd8,_0x4eaeca){var _0x7bc85d,_0x398970;return db[_0x1601('0x36')]['find']({'where':{'id':_0x337615[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x43abd8,null))[_0x1601('0x24')](function(_0xa1c85f){if(_0xa1c85f){_0x398970=_0xa1c85f;return _0xa1c85f[_0x1601('0x94')](_0x337615[_0x1601('0x52')][_0x1601('0x7d')],_['omit'](_0x337615['body'],[_0x1601('0x7d'),'id'])||{})[_0x1601('0x95')](function(_0x459bb3){for(var _0x29d9a7=0x0;_0x29d9a7<_0x337615['body'][_0x1601('0x7d')][_0x1601('0x4f')];_0x29d9a7+=0x1){socket[_0x1601('0x7b')]('userVoiceQueue:save',{'UserId':Number(_0x337615['body'][_0x1601('0x7d')][_0x29d9a7]),'VoiceQueueId':Number(_0x337615[_0x1601('0x4d')]['id'])});}return _0x459bb3;});}})[_0x1601('0x24')](function(_0x33558a){_0x7bc85d=_0x33558a||[];if(_0x398970){return db[_0x1601('0x6b')][_0x1601('0x49')]({'where':{'id':_0x337615[_0x1601('0x52')][_0x1601('0x7d')]},'attributes':['id','name',_0x1601('0x6d'),_0x1601('0x6e'),_0x1601('0x6f')],'raw':!![]});}})[_0x1601('0x24')](function(_0x1d3b88){if(!_[_0x1601('0x96')](_0x1d3b88)){var _0x2cb575=[];for(var _0x1982b7=0x0;_0x1982b7<_0x1d3b88[_0x1601('0x4f')];_0x1982b7++){if(_0x1d3b88[_0x1982b7][_0x1601('0x6d')]){_0x2cb575[_0x1601('0x88')](db[_0x1601('0x77')][_0x1601('0x78')]({'membername':_0x1d3b88[_0x1982b7][_0x1601('0x2f')],'UserId':_0x1d3b88[_0x1982b7]['id'],'queue_name':_0x398970[_0x1601('0x2f')],'VoiceQueueId':_0x398970['id'],'interface':_[_0x1601('0x79')](_0x1d3b88[_0x1982b7][_0x1601('0x6f')])?util[_0x1601('0x7a')](_0x1601('0x97'),_0x1d3b88[_0x1982b7][_0x1601('0x2f')]):_0x1d3b88[_0x1982b7]['interface'],'paused':_0x1d3b88[_0x1982b7]['voicePause']||![],'penalty':_0x337615[_0x1601('0x52')][_0x1601('0x72')]||0x0}));}}return BPromise[_0x1601('0x8d')](_0x2cb575);}})[_0x1601('0x24')](function(){return _0x7bc85d;})[_0x1601('0x24')](respondWithResult(_0x43abd8,null))['catch'](handleError(_0x43abd8,null));};exports['removeAgents']=function(_0x957499,_0xbb563d,_0x44d180){return db[_0x1601('0x36')]['find']({'where':{'id':_0x957499[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0xbb563d,null))[_0x1601('0x24')](function(_0x523121){if(_0x523121){return _0x523121[_0x1601('0x92')](_0x957499[_0x1601('0x3a')][_0x1601('0x7d')])[_0x1601('0x24')](function(){if(_[_0x1601('0x98')](_0x957499[_0x1601('0x3a')]['ids'])){for(var _0x32a7e4=0x0;_0x32a7e4<_0x957499[_0x1601('0x3a')][_0x1601('0x7d')][_0x1601('0x4f')];_0x32a7e4+=0x1){socket[_0x1601('0x7b')](_0x1601('0x93'),{'UserId':Number(_0x957499[_0x1601('0x3a')][_0x1601('0x7d')][_0x32a7e4]),'VoiceQueueId':Number(_0x957499['params']['id'])});}}else{socket[_0x1601('0x7b')](_0x1601('0x93'),{'UserId':Number(_0x957499[_0x1601('0x3a')][_0x1601('0x7d')]),'VoiceQueueId':Number(_0x957499['params']['id'])});}});}})[_0x1601('0x24')](function(_0x1e8c54){return db['UserVoiceQueueRt'][_0x1601('0x25')]({'where':{'VoiceQueueId':_0x957499[_0x1601('0x4d')]['id'],'UserId':_0x957499[_0x1601('0x3a')][_0x1601('0x7d')]}})[_0x1601('0x24')](function(){return _0x1e8c54;});})[_0x1601('0x24')](respondWithStatusCode(_0xbb563d,null))[_0x1601('0x4b')](handleError(_0xbb563d,null));};exports[_0x1601('0x99')]=function(_0x40a79e,_0x59bf36,_0x46e01d){var _0x46f814={};var _0x59a627={};var _0x578988;var _0x3526b5;return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x40a79e[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x59bf36,null))[_0x1601('0x24')](function(_0x3beea2){if(_0x3beea2){_0x578988=_0x3beea2;_0x59a627[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x6b')]['rawAttributes']);_0x59a627[_0x1601('0x3a')]=_[_0x1601('0x4e')](_0x40a79e[_0x1601('0x3a')]);_0x59a627[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x59a627['model'],_0x59a627[_0x1601('0x3a')]);_0x46f814[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x59a627['model'],qs[_0x1601('0x3f')](_0x40a79e[_0x1601('0x3a')][_0x1601('0x3f')]));_0x46f814[_0x1601('0x3e')]=_0x46f814[_0x1601('0x3e')][_0x1601('0x4f')]?_0x46f814['attributes']:_0x59a627['model'];_0x46f814[_0x1601('0x42')]=qs[_0x1601('0x43')](_0x40a79e[_0x1601('0x3a')][_0x1601('0x43')]);_0x46f814[_0x1601('0x45')]=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x40a79e[_0x1601('0x3a')],_0x59a627['filters']));if(_0x40a79e[_0x1601('0x3a')][_0x1601('0x46')]){_0x46f814[_0x1601('0x45')]=_['merge'](_0x46f814[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x46f814[_0x1601('0x3e')],function(_0x3b7cf6){var _0x41aca0={};_0x41aca0[_0x3b7cf6]={'$like':'%'+_0x40a79e[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x41aca0;})});}_0x46f814=_[_0x1601('0x44')]({},_0x46f814,_0x40a79e[_0x1601('0x47')]);return _0x578988['getAgents'](_0x46f814);}})[_0x1601('0x24')](function(_0x3db58d){if(_0x3db58d){_0x3526b5=_0x3db58d[_0x1601('0x4f')];if(!_0x40a79e['query'][_0x1601('0x40')](_0x1601('0x41'))){_0x46f814['limit']=qs['limit'](_0x40a79e[_0x1601('0x3a')][_0x1601('0x1e')]);_0x46f814['offset']=qs['offset'](_0x40a79e[_0x1601('0x3a')][_0x1601('0x1c')]);}return _0x578988[_0x1601('0x99')](_0x46f814);}})[_0x1601('0x24')](function(_0x17e6f4){if(_0x17e6f4){return _0x17e6f4?{'count':_0x3526b5,'rows':_0x17e6f4}:null;}})['then'](respondWithResult(_0x59bf36,null))['catch'](handleError(_0x59bf36,null));};exports[_0x1601('0x9a')]=function(_0xc02d68,_0x3363a2,_0x5a9bdf){var _0x1f9cd0={};var _0x117277={};var _0xb24a1b;var _0x5b3a34;return db['VoiceQueue']['findOne']({'where':{'id':_0xc02d68[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x3363a2,null))['then'](function(_0x1dd3a4){if(_0x1dd3a4){_0xb24a1b=_0x1dd3a4;_0x117277[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x77')][_0x1601('0x37')]);_0x117277[_0x1601('0x3a')]=_[_0x1601('0x4e')](_0xc02d68['query']);_0x117277[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x117277[_0x1601('0x3d')],_0x117277[_0x1601('0x3a')]);_0x1f9cd0['attributes']=_[_0x1601('0x3c')](_0x117277[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0xc02d68['query'][_0x1601('0x3f')]));_0x1f9cd0[_0x1601('0x3e')]=_0x1f9cd0[_0x1601('0x3e')][_0x1601('0x4f')]?_0x1f9cd0[_0x1601('0x3e')]:_0x117277[_0x1601('0x3d')];_0x1f9cd0[_0x1601('0x42')]=qs['sort'](_0xc02d68['query']['sort']);_0x1f9cd0[_0x1601('0x45')]=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0xc02d68[_0x1601('0x3a')],_0x117277[_0x1601('0x3b')]));if(_0xc02d68[_0x1601('0x3a')][_0x1601('0x46')]){_0x1f9cd0[_0x1601('0x45')]=_[_0x1601('0x44')](_0x1f9cd0[_0x1601('0x45')],{'$or':_['map'](_0x1f9cd0[_0x1601('0x3e')],function(_0x33f18c){var _0x1c26cd={};_0x1c26cd[_0x33f18c]={'$like':'%'+_0xc02d68[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x1c26cd;})});}_0x1f9cd0=_[_0x1601('0x44')]({},_0x1f9cd0,_0xc02d68[_0x1601('0x47')]);return _0xb24a1b[_0x1601('0x9a')](_0x1f9cd0);}})[_0x1601('0x24')](function(_0x4be9cb){if(_0x4be9cb){_0x5b3a34=_0x4be9cb['length'];if(!_0xc02d68['query']['hasOwnProperty']('nolimit')){_0x1f9cd0[_0x1601('0x1e')]=qs['limit'](_0xc02d68['query'][_0x1601('0x1e')]);_0x1f9cd0[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0xc02d68['query'][_0x1601('0x1c')]);}return _0xb24a1b[_0x1601('0x9a')](_0x1f9cd0);}})[_0x1601('0x24')](function(_0x4b6b2b){return _0x4b6b2b?{'count':_0x5b3a34,'rows':_0x4b6b2b}:null;})[_0x1601('0x24')](respondWithResult(_0x3363a2,null))['catch'](handleError(_0x3363a2,null));};exports[_0x1601('0x9b')]=function(_0x274d99,_0x376550,_0x57504b){var _0x250040={};var _0x269a2d={};var _0x45c7cf;var _0x5dc918;return db['VoiceQueue'][_0x1601('0x60')]({'where':{'id':_0x274d99[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x376550,null))[_0x1601('0x24')](function(_0x416754){if(_0x416754){_0x45c7cf=_0x416754;_0x269a2d[_0x1601('0x3d')]=_[_0x1601('0x4e')](db[_0x1601('0x9c')][_0x1601('0x37')]);_0x269a2d['query']=_[_0x1601('0x4e')](_0x274d99[_0x1601('0x3a')]);_0x269a2d[_0x1601('0x3b')]=_[_0x1601('0x3c')](_0x269a2d[_0x1601('0x3d')],_0x269a2d[_0x1601('0x3a')]);_0x250040[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x269a2d[_0x1601('0x3d')],qs[_0x1601('0x3f')](_0x274d99[_0x1601('0x3a')][_0x1601('0x3f')]));_0x250040[_0x1601('0x3e')]=_0x250040[_0x1601('0x3e')][_0x1601('0x4f')]?_0x250040[_0x1601('0x3e')]:_0x269a2d[_0x1601('0x3d')];_0x250040['order']=qs['sort'](_0x274d99[_0x1601('0x3a')][_0x1601('0x43')]);_0x250040['where']=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x274d99[_0x1601('0x3a')],_0x269a2d[_0x1601('0x3b')]));if(_0x274d99[_0x1601('0x3a')][_0x1601('0x46')]){_0x250040[_0x1601('0x45')]=_[_0x1601('0x44')](_0x250040[_0x1601('0x45')],{'$or':_['map'](_0x250040['attributes'],function(_0x39a2f3){var _0x437be2={};_0x437be2[_0x39a2f3]={'$like':'%'+_0x274d99[_0x1601('0x3a')][_0x1601('0x46')]+'%'};return _0x437be2;})});}_0x250040=_[_0x1601('0x44')]({},_0x250040,_0x274d99[_0x1601('0x47')]);return _0x45c7cf[_0x1601('0x9b')](_0x250040);}})['then'](function(_0xac23a8){if(_0xac23a8){_0x5dc918=_0xac23a8[_0x1601('0x4f')];if(!_0x274d99[_0x1601('0x3a')][_0x1601('0x40')]('nolimit')){_0x250040[_0x1601('0x1e')]=qs['limit'](_0x274d99['query'][_0x1601('0x1e')]);_0x250040[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x274d99['query'][_0x1601('0x1c')]);}return _0x45c7cf[_0x1601('0x9b')](_0x250040);}})[_0x1601('0x24')](function(_0x2007ea){if(_0x2007ea){return _0x2007ea?{'count':_0x5dc918,'rows':_0x2007ea}:null;}})[_0x1601('0x24')](respondWithResult(_0x376550,null))['catch'](handleError(_0x376550,null));};exports[_0x1601('0x9d')]=function(_0x3efd9c,_0x2bc222,_0x43bdb6){var _0x1f22b5=moment()[_0x1601('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5805b2,_0x36e239;return db['VoiceQueue'][_0x1601('0x2e')]({'where':{'id':_0x3efd9c[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x2bc222,null))[_0x1601('0x24')](function(_0x122759){if(_0x122759){_0x36e239=_0x122759;return _0x122759[_0x1601('0x9d')](_0x3efd9c[_0x1601('0x52')][_0x1601('0x7d')],_[_0x1601('0x5c')](_0x3efd9c[_0x1601('0x52')],['ids','id'])||{});}return null;})[_0x1601('0x95')](function(_0xc57cac){var _0x5b3943;_0x5805b2=_0xc57cac||[];var _0x92f774=[];if(_0xc57cac){for(var _0x417c5a=0x0;_0x417c5a<_0xc57cac[_0x1601('0x4f')];_0x417c5a+=0x1){var _0x552cd0=_0xc57cac[_0x417c5a][_0x1601('0x54')]({'plain':!![]});_0x36e239[_0x1601('0x9e')]=_0x3efd9c[_0x1601('0x52')][_0x1601('0x9e')]?_0x3efd9c[_0x1601('0x52')][_0x1601('0x9e')]:_0x36e239[_0x1601('0x9e')];switch(_0x36e239['dialCheckDuplicateType']){case _0x1601('0x9f'):_0x5b3943=squel['insert']()['into']('cm_hopper')[_0x1601('0xa0')]([_0x1601('0xa1'),_0x1601('0xa2'),_0x1601('0xa3'),_0x1601('0xa4'),_0x1601('0x65'),'createdAt',_0x1601('0x5d')],squel[_0x1601('0xa5')]()[_0x1601('0x7e')](_0x1601('0xa1'),_0x1601('0xa1'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27',_0x1601('0xa2'))[_0x1601('0x7e')]('id',_0x1601('0xa3'))[_0x1601('0x7e')](_0x552cd0[_0x1601('0xa6')][_0x1601('0x89')](),_0x1601('0xa4'))[_0x1601('0x7e')](_0x3efd9c[_0x1601('0x4d')]['id']['toString'](),_0x1601('0x65'))['field']('\x27'+_0x1f22b5+'\x27',_0x1601('0x5e'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27',_0x1601('0x5d'))[_0x1601('0x80')](_0x1601('0xa7'))[_0x1601('0x45')](_0x1601('0xa8'))[_0x1601('0x45')]('ListId\x20=\x20?',_0x552cd0['CmListId'][_0x1601('0x89')]())[_0x1601('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x1601('0x45')](_0x1601('0xa9'),squel[_0x1601('0xa5')]()[_0x1601('0x7e')](_0x1601('0xaa'))[_0x1601('0x80')](_0x1601('0xab'))[_0x1601('0x45')]('VoiceQueueId\x20=\x20?',_0x3efd9c[_0x1601('0x4d')]['id'][_0x1601('0x89')]()))[_0x1601('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1601('0xa5')]()[_0x1601('0x7e')](_0x1601('0xac'))[_0x1601('0x80')]('cm_hopper')[_0x1601('0x45')](_0x1601('0x85'),_0x3efd9c[_0x1601('0x4d')]['id'][_0x1601('0x89')]())))[_0x1601('0x89')]();break;case _0x1601('0xad'):_0x5b3943=squel[_0x1601('0xae')]()[_0x1601('0xaf')](_0x1601('0xb0'))['fromQuery']([_0x1601('0xa1'),'scheduledAt',_0x1601('0xa3'),_0x1601('0xa4'),'VoiceQueueId',_0x1601('0x5e'),_0x1601('0x5d')],squel[_0x1601('0xa5')]()[_0x1601('0x7e')](_0x1601('0xa1'),_0x1601('0xa1'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27',_0x1601('0xa2'))[_0x1601('0x7e')]('id',_0x1601('0xa3'))[_0x1601('0x7e')](_0x552cd0['CmListId'][_0x1601('0x89')](),_0x1601('0xa4'))['field'](_0x3efd9c[_0x1601('0x4d')]['id'][_0x1601('0x89')](),_0x1601('0x65'))['field']('\x27'+_0x1f22b5+'\x27',_0x1601('0x5e'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27','updatedAt')['from'](_0x1601('0xa7'))['where'](_0x1601('0xa8'))[_0x1601('0x45')](_0x1601('0xb1'),_0x552cd0[_0x1601('0xa6')][_0x1601('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x1601('0xa9'),squel[_0x1601('0xa5')]()[_0x1601('0x7e')]('COALESCE(phone,\x27\x27)')[_0x1601('0x80')](_0x1601('0xb0'))[_0x1601('0x45')]('VoiceQueueId\x20=\x20?',_0x3efd9c['params']['id'][_0x1601('0x89')]())))[_0x1601('0x89')]();break;default:_0x5b3943=squel[_0x1601('0xae')]()['into'](_0x1601('0xb0'))[_0x1601('0xa0')]([_0x1601('0xa1'),'scheduledAt',_0x1601('0xa3'),_0x1601('0xa4'),'VoiceQueueId',_0x1601('0x5e'),_0x1601('0x5d')],squel['select']()[_0x1601('0x7e')]('phone',_0x1601('0xa1'))['field']('\x27'+_0x1f22b5+'\x27','scheduledAt')[_0x1601('0x7e')]('id',_0x1601('0xa3'))[_0x1601('0x7e')](_0x552cd0[_0x1601('0xa6')][_0x1601('0x89')](),_0x1601('0xa4'))[_0x1601('0x7e')](_0x3efd9c[_0x1601('0x4d')]['id'][_0x1601('0x89')](),_0x1601('0x65'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27',_0x1601('0x5e'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27','updatedAt')[_0x1601('0x80')](_0x1601('0xa7'))[_0x1601('0x45')](_0x1601('0xa8'))[_0x1601('0x45')](_0x1601('0xb1'),_0x552cd0[_0x1601('0xa6')][_0x1601('0x89')]())['where'](_0x1601('0xb2')))[_0x1601('0x89')]();}_0x92f774['push'](db[_0x1601('0x73')][_0x1601('0x3a')](_0x5b3943));}return BPromise['all'](_0x92f774);}})[_0x1601('0x24')](function(){var _0x4111ce=[];var _0x137c39=squel['insert']()['into']('cm_hopper_additional_phones')[_0x1601('0xa0')]([_0x1601('0xb3'),'phone',_0x1601('0xb4'),_0x1601('0x5e'),_0x1601('0x5d')],squel[_0x1601('0xa5')]()[_0x1601('0x7e')](_0x1601('0xb5'))['field'](_0x1601('0xb6'))['field']('ci.OrderBy+1')[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27',_0x1601('0x5e'))[_0x1601('0x7e')]('\x27'+_0x1f22b5+'\x27','updatedAt')['from'](_0x1601('0xb7'),'ci')[_0x1601('0x82')](_0x1601('0xb0'),'h',_0x1601('0xb8'))['where'](_0x1601('0xb9'),_0x1f22b5)['where'](_0x1601('0xba'),_0x1601('0xbb')))[_0x1601('0x89')]();_0x4111ce[_0x1601('0x88')](db['sequelize'][_0x1601('0x3a')](_0x137c39));return BPromise[_0x1601('0x8d')](_0x4111ce);})['then'](function(){return _0x5805b2;})['then'](respondWithResult(_0x2bc222,null))[_0x1601('0x4b')](handleError(_0x2bc222,null));};exports[_0x1601('0xbc')]=function(_0x4a2039,_0xc6c834,_0x416714){return db['VoiceQueue'][_0x1601('0x2e')]({'where':{'id':_0x4a2039[_0x1601('0x4d')]['id']}})['then'](handleEntityNotFound(_0xc6c834,null))[_0x1601('0x24')](function(_0x433c84){if(_0x433c84){return _0x433c84['removeLists'](_0x4a2039[_0x1601('0x3a')][_0x1601('0x7d')]);}})[_0x1601('0x24')](function(_0x2fdf89){if(_0x2fdf89){return db[_0x1601('0x62')]['destroy']({'where':{'ListId':_0x4a2039[_0x1601('0x3a')][_0x1601('0x7d')],'VoiceQueueId':_0x4a2039[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](function(){return _0x2fdf89;});}})[_0x1601('0x24')](respondWithStatusCode(_0xc6c834,null))[_0x1601('0x4b')](handleError(_0xc6c834,null));};exports[_0x1601('0xbd')]=function(_0x135f31,_0x730bf2,_0x67f63){var _0x18ce4d={};var _0x28415e={};var _0x466352;var _0x1a1ae0;return db[_0x1601('0x36')][_0x1601('0x60')]({'where':{'id':_0x135f31[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x730bf2,null))[_0x1601('0x24')](function(_0x235be6){if(_0x235be6){_0x466352=_0x235be6;_0x28415e['model']=_[_0x1601('0x4e')](db[_0x1601('0x9c')][_0x1601('0x37')]);_0x28415e['query']=_[_0x1601('0x4e')](_0x135f31['query']);_0x28415e['filters']=_[_0x1601('0x3c')](_0x28415e[_0x1601('0x3d')],_0x28415e[_0x1601('0x3a')]);_0x18ce4d[_0x1601('0x3e')]=_[_0x1601('0x3c')](_0x28415e[_0x1601('0x3d')],qs['fields'](_0x135f31['query'][_0x1601('0x3f')]));_0x18ce4d['attributes']=_0x18ce4d[_0x1601('0x3e')][_0x1601('0x4f')]?_0x18ce4d['attributes']:_0x28415e['model'];_0x18ce4d['order']=qs[_0x1601('0x43')](_0x135f31['query']['sort']);_0x18ce4d[_0x1601('0x45')]=qs[_0x1601('0x3b')](_[_0x1601('0x61')](_0x135f31[_0x1601('0x3a')],_0x28415e['filters']));if(_0x135f31[_0x1601('0x3a')][_0x1601('0x46')]){_0x18ce4d[_0x1601('0x45')]=_[_0x1601('0x44')](_0x18ce4d[_0x1601('0x45')],{'$or':_[_0x1601('0x2a')](_0x18ce4d[_0x1601('0x3e')],function(_0x1471ec){var _0x2ffbb8={};_0x2ffbb8[_0x1471ec]={'$like':'%'+_0x135f31['query'][_0x1601('0x46')]+'%'};return _0x2ffbb8;})});}_0x18ce4d=_[_0x1601('0x44')]({},_0x18ce4d,_0x135f31[_0x1601('0x47')]);return _0x466352[_0x1601('0xbd')](_0x18ce4d);}})[_0x1601('0x24')](function(_0x553ab7){if(_0x553ab7){_0x1a1ae0=_0x553ab7[_0x1601('0x4f')];if(!_0x135f31[_0x1601('0x3a')][_0x1601('0x40')]('nolimit')){_0x18ce4d[_0x1601('0x1e')]=qs[_0x1601('0x1e')](_0x135f31[_0x1601('0x3a')][_0x1601('0x1e')]);_0x18ce4d[_0x1601('0x1c')]=qs['offset'](_0x135f31['query'][_0x1601('0x1c')]);}return _0x466352[_0x1601('0xbd')](_0x18ce4d);}})[_0x1601('0x24')](function(_0xc711df){if(_0xc711df){return _0xc711df?{'count':_0x1a1ae0,'rows':_0xc711df}:null;}})[_0x1601('0x24')](respondWithResult(_0x730bf2,null))['catch'](handleError(_0x730bf2,null));};exports[_0x1601('0xbe')]=function(_0x2a59aa,_0x41a86c,_0x3a75a4){var _0x278a8b,_0xb758d7;return db[_0x1601('0x36')]['find']({'where':{'id':_0x2a59aa[_0x1601('0x4d')]['id']}})['then'](handleEntityNotFound(_0x41a86c,null))[_0x1601('0x24')](function(_0x25ad4a){if(_0x25ad4a){_0xb758d7=_0x25ad4a;return _0x25ad4a['addBlackLists'](_0x2a59aa[_0x1601('0x52')][_0x1601('0x7d')],_[_0x1601('0x5c')](_0x2a59aa[_0x1601('0x52')],['ids','id'])||{});}return null;})[_0x1601('0x95')](function(_0x52ee2e){var _0x28e317;_0x278a8b=_0x52ee2e||[];var _0x112bba=[];if(_0x52ee2e){for(var _0xd8cb7d=0x0;_0xd8cb7d<_0x52ee2e[_0x1601('0x4f')];_0xd8cb7d+=0x1){var _0x221fd0=_0x52ee2e[_0xd8cb7d][_0x1601('0x54')]({'plain':!![]});_0x28e317=squel[_0x1601('0xae')]()[_0x1601('0xaf')]('cm_hopper_black')['fromQuery']([_0x1601('0xa1'),'ContactId','ListId',_0x1601('0x65'),_0x1601('0x5e'),_0x1601('0x5d')],squel[_0x1601('0xa5')]()[_0x1601('0x7e')]('phone',_0x1601('0xa1'))[_0x1601('0x7e')]('id','ContactId')[_0x1601('0x7e')](_0x221fd0[_0x1601('0xa6')][_0x1601('0x89')](),_0x1601('0xa4'))[_0x1601('0x7e')](_0x2a59aa[_0x1601('0x4d')]['id'][_0x1601('0x89')](),_0x1601('0x65'))[_0x1601('0x7e')](_0x1601('0xbf'),'createdAt')[_0x1601('0x7e')](_0x1601('0xbf'),_0x1601('0x5d'))[_0x1601('0x80')](_0x1601('0xa7'))[_0x1601('0x45')]('deletedAt\x20IS\x20NULL')[_0x1601('0x45')](_0x1601('0xb1'),_0x221fd0[_0x1601('0xa6')]['toString']())[_0x1601('0x45')](_0x1601('0xb2')))[_0x1601('0x89')]();_0x112bba['push'](db[_0x1601('0x73')][_0x1601('0x3a')](_0x28e317));}return BPromise[_0x1601('0x8d')](_0x112bba);}})[_0x1601('0x24')](function(){return _0x278a8b;})[_0x1601('0x24')](respondWithResult(_0x41a86c,null))[_0x1601('0x4b')](handleError(_0x41a86c,null));};exports[_0x1601('0xc0')]=function(_0x51b70e,_0x5bb17e,_0x225aa5){return db[_0x1601('0x36')]['find']({'where':{'id':_0x51b70e[_0x1601('0x4d')]['id']}})[_0x1601('0x24')](handleEntityNotFound(_0x5bb17e,null))[_0x1601('0x24')](function(_0x516133){if(_0x516133){return _0x516133[_0x1601('0xc0')](_0x51b70e[_0x1601('0x3a')]['ids']);}})[_0x1601('0x24')](function(_0x330094){if(_0x330094){return db[_0x1601('0x67')][_0x1601('0x25')]({'where':{'ListId':_0x51b70e['query'][_0x1601('0x7d')],'VoiceQueueId':_0x51b70e['params']['id']}})[_0x1601('0x24')](function(){return _0x330094;});}})[_0x1601('0x24')](respondWithStatusCode(_0x5bb17e,null))[_0x1601('0x4b')](handleError(_0x5bb17e,null));}; \ No newline at end of file +var _0x814b=['getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','spread','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','error','stack','name','index','VoiceQueue','rawAttributes','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','intersection','length','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','updatedAt','body','createdAt','role','getHoppers','findOne','CmHopper','pick','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','SIP/%s','forEach','emit','userVoiceQueue:save','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','ids','online','isEmpty','isNil','format','isArray','getAgents'];(function(_0x2404ab,_0x33d1de){var _0x5268b8=function(_0x4b8ac6){while(--_0x4b8ac6){_0x2404ab['push'](_0x2404ab['shift']());}};_0x5268b8(++_0x33d1de);}(_0x814b,0x1a2));var _0xb814=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x814b[_0x4812e0];return _0x252e0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];config[_0xb814('0x1b')]=_[_0xb814('0x1c')](config[_0xb814('0x1b')],{'host':_0xb814('0x1d'),'port':0x18eb});var socket=require(_0xb814('0x1e'))(new Redis(config[_0xb814('0x1b')]));require(_0xb814('0x1f'))[_0xb814('0x20')](socket);function respondWithStatusCode(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xcc;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x21')](_0x44fb96);}return _0x3f4881[_0xb814('0x22')](_0x44fb96)[_0xb814('0x23')]();};}function respondWithResult(_0x45e0d0,_0x265a83){_0x265a83=_0x265a83||0xc8;return function(_0x125ce2){if(_0x125ce2){return _0x45e0d0[_0xb814('0x22')](_0x265a83)[_0xb814('0x24')](_0x125ce2);}};}function respondWithFilteredResult(_0x48c9df,_0x168a48){return function(_0x55ba16){if(_0x55ba16){var _0x270598=typeof _0x168a48[_0xb814('0x25')]==='undefined'&&typeof _0x168a48['limit']==='undefined';var _0x399b43=_0x55ba16['count'];var _0x57c128=_0x270598?0x0:_0x168a48[_0xb814('0x25')];var _0x24211d=_0x270598?_0x55ba16[_0xb814('0x26')]:_0x168a48['offset']+_0x168a48[_0xb814('0x27')];var _0x531032;if(_0x24211d>=_0x399b43){_0x24211d=_0x399b43;_0x531032=0xc8;}else{_0x531032=0xce;}_0x48c9df[_0xb814('0x22')](_0x531032);return _0x48c9df[_0xb814('0x28')](_0xb814('0x29'),_0x57c128+'-'+_0x24211d+'/'+_0x399b43)[_0xb814('0x24')](_0x55ba16);}return null;};}function patchUpdates(_0x27352e){return function(_0x2bd039){try{jsonpatch[_0xb814('0x2a')](_0x2bd039,_0x27352e,!![]);}catch(_0x594470){return BPromise[_0xb814('0x2b')](_0x594470);}return _0x2bd039['save']();};}function saveUpdates(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x2c')](_0x3f81d0)[_0xb814('0x2d')](function(_0xb9e57d){return _0xb9e57d;});}return null;};}function removeEntity(_0x3d836c,_0x5755ea){return function(_0x392222){if(_0x392222){return _0x392222[_0xb814('0x2e')]()[_0xb814('0x2d')](function(){var _0x349394=_0x392222[_0xb814('0x2f')]({'plain':!![]});var _0x1d5965=[{'name':_0xb814('0x30'),'value':_0xb814('0x31'),'ignore':![]},{'name':'QueueCampaigns','value':_0xb814('0x32'),'ignore':![]}];var _0x328a08=_(_0x1d5965)['filter'](_0xb814('0x33'))[_0xb814('0x34')](_0xb814('0x35'))['value']();if(_[_0xb814('0x36')](_0x328a08,_0x349394[_0xb814('0x37')])){return;}var _0x58c3ca=_[_0xb814('0x38')](_0x1d5965,['value',_0x349394[_0xb814('0x37')]])['name'];return db['UserProfileResource'][_0xb814('0x2e')]({'where':{'type':_0x58c3ca,'resourceId':_0x349394['id']}})['then'](function(){return _0x392222;});})[_0xb814('0x2d')](function(){_0x3d836c[_0xb814('0x22')](0xcc)[_0xb814('0x23')]();});}};}function handleEntityNotFound(_0x599f9f,_0x51d5ae){return function(_0x26d3a9){if(!_0x26d3a9){_0x599f9f[_0xb814('0x21')](0x194);}return _0x26d3a9;};}function handleError(_0x523566,_0x2c8943){_0x2c8943=_0x2c8943||0x1f4;return function(_0xe558d5){logger[_0xb814('0x39')](_0xe558d5[_0xb814('0x3a')]);if(_0xe558d5[_0xb814('0x3b')]){delete _0xe558d5[_0xb814('0x3b')];}_0x523566[_0xb814('0x22')](_0x2c8943)['send'](_0xe558d5);};}exports[_0xb814('0x3c')]=function(_0x2263f6,_0x30de5a){var _0x424e2b={},_0x14100d={},_0x4ff31a={'count':0x0,'rows':[]};var _0x16ef82=_['map'](db[_0xb814('0x3d')][_0xb814('0x3e')],function(_0xe0f509){return{'name':_0xe0f509['fieldName'],'type':_0xe0f509[_0xb814('0x37')][_0xb814('0x3f')]};});_0x14100d['model']=_[_0xb814('0x34')](_0x16ef82,_0xb814('0x3b'));_0x14100d[_0xb814('0x40')]=_[_0xb814('0x41')](_0x2263f6[_0xb814('0x40')]);_0x14100d[_0xb814('0x42')]=_['intersection'](_0x14100d[_0xb814('0x43')],_0x14100d['query']);_0x424e2b[_0xb814('0x44')]=_['intersection'](_0x14100d[_0xb814('0x43')],qs['fields'](_0x2263f6[_0xb814('0x40')][_0xb814('0x45')]));_0x424e2b['attributes']=_0x424e2b['attributes']['length']?_0x424e2b['attributes']:_0x14100d[_0xb814('0x43')];if(!_0x2263f6[_0xb814('0x40')][_0xb814('0x46')](_0xb814('0x47'))){_0x424e2b['limit']=qs['limit'](_0x2263f6[_0xb814('0x40')]['limit']);_0x424e2b[_0xb814('0x25')]=qs[_0xb814('0x25')](_0x2263f6[_0xb814('0x40')][_0xb814('0x25')]);}_0x424e2b[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x2263f6[_0xb814('0x40')][_0xb814('0x49')]);_0x424e2b[_0xb814('0x4a')]=qs['filters'](_['pick'](_0x2263f6['query'],_0x14100d[_0xb814('0x42')]),_0x16ef82);if(_0x2263f6['query'][_0xb814('0x4b')]){_0x424e2b['where']=_[_0xb814('0x4c')](_0x424e2b[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x16ef82,function(_0x2e97cc){if(_0x2e97cc['type']!==_0xb814('0x4d')){var _0x15f01a={};_0x15f01a[_0x2e97cc[_0xb814('0x3b')]]={'$like':'%'+_0x2263f6[_0xb814('0x40')][_0xb814('0x4b')]+'%'};return _0x15f01a;}})});}_0x424e2b=_[_0xb814('0x4c')]({},_0x424e2b,_0x2263f6['options']);var _0x69f060={'where':_0x424e2b[_0xb814('0x4a')]};return db[_0xb814('0x3d')][_0xb814('0x26')](_0x69f060)[_0xb814('0x2d')](function(_0x144d37){_0x4ff31a[_0xb814('0x26')]=_0x144d37;if(_0x2263f6['query']['includeAll']){_0x424e2b[_0xb814('0x4e')]=[{'all':!![]}];}return db[_0xb814('0x3d')][_0xb814('0x4f')](_0x424e2b);})[_0xb814('0x2d')](function(_0x43f1b){_0x4ff31a[_0xb814('0x50')]=_0x43f1b;return _0x4ff31a;})[_0xb814('0x2d')](respondWithFilteredResult(_0x30de5a,_0x424e2b))[_0xb814('0x51')](handleError(_0x30de5a,null));};exports[_0xb814('0x52')]=function(_0x344198,_0xe73300){var _0x5c7a49={'raw':![],'where':{'id':_0x344198[_0xb814('0x53')]['id']}},_0x37800a={};_0x37800a['model']=_[_0xb814('0x41')](db['VoiceQueue'][_0xb814('0x3e')]);_0x37800a[_0xb814('0x40')]=_[_0xb814('0x41')](_0x344198[_0xb814('0x40')]);_0x37800a[_0xb814('0x42')]=_[_0xb814('0x54')](_0x37800a[_0xb814('0x43')],_0x37800a[_0xb814('0x40')]);_0x5c7a49[_0xb814('0x44')]=_[_0xb814('0x54')](_0x37800a['model'],qs['fields'](_0x344198[_0xb814('0x40')][_0xb814('0x45')]));_0x5c7a49[_0xb814('0x44')]=_0x5c7a49[_0xb814('0x44')][_0xb814('0x55')]?_0x5c7a49[_0xb814('0x44')]:_0x37800a[_0xb814('0x43')];if(_0x344198['query'][_0xb814('0x56')]){_0x5c7a49[_0xb814('0x4e')]=[{'all':!![]}];}_0x5c7a49=_[_0xb814('0x4c')]({},_0x5c7a49,_0x344198['options']);return db[_0xb814('0x3d')]['find'](_0x5c7a49)[_0xb814('0x2d')](handleEntityNotFound(_0xe73300,null))['then'](respondWithResult(_0xe73300,null))[_0xb814('0x51')](handleError(_0xe73300,null));};exports[_0xb814('0x57')]=function(_0x590c4b,_0x793ea1){return db[_0xb814('0x3d')][_0xb814('0x57')](_0x590c4b['body'],{})[_0xb814('0x2d')](function(_0x5f0e58){var _0x13bdcf=_0x590c4b[_0xb814('0x58')]['get']({'plain':!![]});if(!_0x13bdcf)throw new Error(_0xb814('0x59'));if(_0x13bdcf['role']==='user'){var _0x3b9709=_0x5f0e58[_0xb814('0x2f')]({'plain':!![]});var _0x34935b=[{'name':'VoiceQueues','value':_0xb814('0x31')},{'name':'QueueCampaigns','value':_0xb814('0x32')}];var _0x2174e5=_['find'](_0x34935b,[_0xb814('0x35'),_0x3b9709['type']])[_0xb814('0x3b')];return db[_0xb814('0x5a')][_0xb814('0x38')]({'where':{'name':_0x2174e5,'userProfileId':_0x13bdcf[_0xb814('0x5b')]},'raw':!![]})[_0xb814('0x2d')](function(_0x34acca){if(_0x34acca&&_0x34acca[_0xb814('0x5c')]===0x0){return db[_0xb814('0x5d')]['create']({'name':_0x3b9709[_0xb814('0x3b')],'resourceId':_0x3b9709['id'],'type':_0x34acca[_0xb814('0x3b')],'sectionId':_0x34acca['id']},{})['then'](function(){return _0x5f0e58;});}else{return _0x5f0e58;}})[_0xb814('0x51')](function(_0xe14249){logger['error'](_0xb814('0x5e'),_0xe14249);throw _0xe14249;});}return _0x5f0e58;})['then'](respondWithResult(_0x793ea1,0xc9))['catch'](handleError(_0x793ea1,null));};exports[_0xb814('0x5f')]=function(_0x5257be,_0x3ff213){var _0xd1cd8b={'where':{'id':_0x5257be['params']['id']}},_0x2dec52={};_0x2dec52[_0xb814('0x43')]=_['keys'](db[_0xb814('0x3d')][_0xb814('0x3e')]);_0xd1cd8b[_0xb814('0x44')]=_[_0xb814('0x54')](_0x2dec52[_0xb814('0x43')],qs[_0xb814('0x45')](_0x5257be[_0xb814('0x40')][_0xb814('0x45')]));_0xd1cd8b[_0xb814('0x44')]=_0xd1cd8b['attributes'][_0xb814('0x55')]?_0xd1cd8b[_0xb814('0x44')]:_0x2dec52[_0xb814('0x43')];if(_0x5257be[_0xb814('0x40')][_0xb814('0x56')]){_0xd1cd8b[_0xb814('0x4e')]=[{'all':!![]}];}_0xd1cd8b=_['merge']({},_0xd1cd8b,_0x5257be[_0xb814('0x60')]);return db['VoiceQueue'][_0xb814('0x38')](_0xd1cd8b)[_0xb814('0x2d')](handleEntityNotFound(_0x3ff213,null))[_0xb814('0x2d')](function(_0x4c884c){if(_0x4c884c){var _0x150e73=_0x4c884c['get']({'plain':!![]});_0x150e73=qs[_0xb814('0x61')](_0x150e73,['id','createdAt',_0xb814('0x62')]);_0x5257be[_0xb814('0x63')]=_[_0xb814('0x61')](_0x5257be[_0xb814('0x63')],['id',_0xb814('0x64'),_0xb814('0x62')]);return db[_0xb814('0x3d')]['create'](_[_0xb814('0x4c')](_0x150e73,_0x5257be['body']),{'include':_0x5257be[_0xb814('0x40')][_0xb814('0x56')]?[{'all':!![]}]:undefined})[_0xb814('0x2d')](function(_0x3dcaeb){var _0x19fa45=_0x5257be[_0xb814('0x58')]['get']({'plain':!![]});if(!_0x19fa45)throw new Error(_0xb814('0x59'));if(_0x19fa45[_0xb814('0x65')]==='user'){var _0x3bb2b4=_0x3dcaeb[_0xb814('0x2f')]({'plain':!![]});var _0x263699=[{'name':_0xb814('0x30'),'value':_0xb814('0x31')},{'name':'QueueCampaigns','value':_0xb814('0x32')}];var _0x5e8e8e=_[_0xb814('0x38')](_0x263699,[_0xb814('0x35'),_0x3bb2b4[_0xb814('0x37')]])[_0xb814('0x3b')];return db[_0xb814('0x5a')][_0xb814('0x38')]({'where':{'name':_0x5e8e8e,'userProfileId':_0x19fa45['userProfileId']},'raw':!![]})['then'](function(_0x5d064b){if(_0x5d064b&&_0x5d064b[_0xb814('0x5c')]===0x0){return db['UserProfileResource'][_0xb814('0x57')]({'name':_0x3bb2b4[_0xb814('0x3b')],'resourceId':_0x3bb2b4['id'],'type':_0x5d064b[_0xb814('0x3b')],'sectionId':_0x5d064b['id']},{})['then'](function(){return _0x3dcaeb;});}else{return _0x3dcaeb;}})[_0xb814('0x51')](function(_0x3e5ce8){logger[_0xb814('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e5ce8);throw _0x3e5ce8;});}return _0x3dcaeb;});}})[_0xb814('0x2d')](respondWithResult(_0x3ff213,0xc9))[_0xb814('0x51')](handleError(_0x3ff213,null));};exports[_0xb814('0x2c')]=function(_0x3564e0,_0x555be0){if(_0x3564e0['body']['id']){delete _0x3564e0[_0xb814('0x63')]['id'];}return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x3564e0[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x555be0,null))[_0xb814('0x2d')](saveUpdates(_0x3564e0[_0xb814('0x63')],null))[_0xb814('0x2d')](respondWithResult(_0x555be0,null))[_0xb814('0x51')](handleError(_0x555be0,null));};exports[_0xb814('0x2e')]=function(_0x20bc28,_0x226b0e){return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x20bc28[_0xb814('0x53')]['id']}})['then'](handleEntityNotFound(_0x226b0e,null))[_0xb814('0x2d')](removeEntity(_0x226b0e,null))[_0xb814('0x51')](handleError(_0x226b0e,null));};exports[_0xb814('0x66')]=function(_0x357b90,_0xec821a,_0x283b0f){var _0x525c02={'raw':![],'where':{}};var _0xff4dc2={};var _0x52e1fc={'count':0x0,'rows':[]};return db[_0xb814('0x3d')][_0xb814('0x67')]({'where':{'id':_0x357b90[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0xec821a,null))[_0xb814('0x2d')](function(_0x5ce177){if(_0x5ce177){_0xff4dc2['model']=_[_0xb814('0x41')](db[_0xb814('0x68')][_0xb814('0x3e')]);_0xff4dc2[_0xb814('0x40')]=_['keys'](_0x357b90[_0xb814('0x40')]);_0xff4dc2['filters']=_[_0xb814('0x54')](_0xff4dc2[_0xb814('0x43')],_0xff4dc2['query']);_0x525c02['attributes']=_[_0xb814('0x54')](_0xff4dc2['model'],qs[_0xb814('0x45')](_0x357b90[_0xb814('0x40')][_0xb814('0x45')]));_0x525c02[_0xb814('0x44')]=_0x525c02[_0xb814('0x44')][_0xb814('0x55')]?_0x525c02[_0xb814('0x44')]:_0xff4dc2['model'];if(!_0x357b90[_0xb814('0x40')]['hasOwnProperty'](_0xb814('0x47'))){_0x525c02['limit']=qs[_0xb814('0x27')](_0x357b90[_0xb814('0x40')]['limit']);_0x525c02[_0xb814('0x25')]=qs['offset'](_0x357b90[_0xb814('0x40')][_0xb814('0x25')]);}_0x525c02['order']=qs['sort'](_0x357b90[_0xb814('0x40')][_0xb814('0x49')]);_0x525c02[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x357b90[_0xb814('0x40')],_0xff4dc2[_0xb814('0x42')]));_0x525c02[_0xb814('0x4a')][_0xb814('0x6a')]=_0x5ce177['id'];if(_0x357b90[_0xb814('0x40')]['filter']){_0x525c02['where']=_['merge'](_0x525c02['where'],{'$or':_['map'](_0x525c02[_0xb814('0x44')],function(_0x75a33){var _0x3d87d2={};_0x3d87d2[_0x75a33]={'$like':'%'+_0x357b90['query'][_0xb814('0x4b')]+'%'};return _0x3d87d2;})});}_0x525c02=_[_0xb814('0x4c')]({},_0x525c02,_0x357b90[_0xb814('0x60')]);return db[_0xb814('0x68')][_0xb814('0x26')]({'where':_0x525c02[_0xb814('0x4a')]})[_0xb814('0x2d')](function(_0x1d9f13){_0x52e1fc['count']=_0x1d9f13;if(_0x357b90[_0xb814('0x40')][_0xb814('0x56')]){_0x525c02[_0xb814('0x4e')]=[{'all':!![]}];}return db[_0xb814('0x68')]['findAll'](_0x525c02);})[_0xb814('0x2d')](function(_0x280af5){_0x52e1fc[_0xb814('0x50')]=_0x280af5;return _0x52e1fc;});}})[_0xb814('0x2d')](respondWithFilteredResult(_0xec821a,_0x525c02))[_0xb814('0x51')](handleError(_0xec821a,null));};exports['getHopperHistories']=function(_0x4db6e2,_0x252f9c,_0x57b3f2){var _0x15bf14={'raw':!![],'where':{}};var _0x3882f8={};var _0x592aae={'count':0x0,'rows':[]};return db[_0xb814('0x3d')]['findOne']({'where':{'id':_0x4db6e2[_0xb814('0x53')]['id']}})['then'](handleEntityNotFound(_0x252f9c,null))[_0xb814('0x2d')](function(_0x1aff2b){if(_0x1aff2b){_0x3882f8[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0x6b')][_0xb814('0x3e')]);_0x3882f8[_0xb814('0x40')]=_['keys'](_0x4db6e2['query']);_0x3882f8[_0xb814('0x42')]=_['intersection'](_0x3882f8['model'],_0x3882f8[_0xb814('0x40')]);_0x15bf14[_0xb814('0x44')]=_[_0xb814('0x54')](_0x3882f8['model'],qs[_0xb814('0x45')](_0x4db6e2['query'][_0xb814('0x45')]));_0x15bf14[_0xb814('0x44')]=_0x15bf14[_0xb814('0x44')][_0xb814('0x55')]?_0x15bf14['attributes']:_0x3882f8[_0xb814('0x43')];if(!_0x4db6e2[_0xb814('0x40')][_0xb814('0x46')]('nolimit')){_0x15bf14[_0xb814('0x27')]=qs[_0xb814('0x27')](_0x4db6e2[_0xb814('0x40')]['limit']);_0x15bf14[_0xb814('0x25')]=qs[_0xb814('0x25')](_0x4db6e2[_0xb814('0x40')][_0xb814('0x25')]);}_0x15bf14[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x4db6e2[_0xb814('0x40')][_0xb814('0x49')]);_0x15bf14[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x4db6e2[_0xb814('0x40')],_0x3882f8[_0xb814('0x42')]));_0x15bf14['where']['VoiceQueueId']=_0x1aff2b['id'];if(_0x4db6e2[_0xb814('0x40')]['filter']){_0x15bf14[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x15bf14[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x15bf14[_0xb814('0x44')],function(_0x2f1674){var _0xf0610f={};_0xf0610f[_0x2f1674]={'$like':'%'+_0x4db6e2['query']['filter']+'%'};return _0xf0610f;})});}_0x15bf14=_[_0xb814('0x4c')]({},_0x15bf14,_0x4db6e2['options']);return db[_0xb814('0x6b')][_0xb814('0x26')]({'where':_0x15bf14[_0xb814('0x4a')]})['then'](function(_0x342f2b){_0x592aae[_0xb814('0x26')]=_0x342f2b;if(_0x4db6e2[_0xb814('0x40')][_0xb814('0x56')]){_0x15bf14[_0xb814('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xb814('0x4f')](_0x15bf14);})[_0xb814('0x2d')](function(_0x4ac8c5){_0x592aae[_0xb814('0x50')]=_0x4ac8c5;return _0x592aae;});}})[_0xb814('0x2d')](respondWithFilteredResult(_0x252f9c,_0x15bf14))[_0xb814('0x51')](handleError(_0x252f9c,null));};exports['getHopperFinals']=function(_0x38b48d,_0x46ea9d,_0x5f3b1c){var _0x32562d={'raw':!![],'where':{}};var _0x171f83={};var _0x5b5634={'count':0x0,'rows':[]};return db[_0xb814('0x3d')][_0xb814('0x67')]({'where':{'id':_0x38b48d[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x46ea9d,null))[_0xb814('0x2d')](function(_0x2ee22e){if(_0x2ee22e){_0x171f83[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0x6c')][_0xb814('0x3e')]);_0x171f83[_0xb814('0x40')]=_[_0xb814('0x41')](_0x38b48d['query']);_0x171f83['filters']=_[_0xb814('0x54')](_0x171f83['model'],_0x171f83['query']);_0x32562d[_0xb814('0x44')]=_['intersection'](_0x171f83['model'],qs['fields'](_0x38b48d[_0xb814('0x40')][_0xb814('0x45')]));_0x32562d[_0xb814('0x44')]=_0x32562d['attributes'][_0xb814('0x55')]?_0x32562d['attributes']:_0x171f83[_0xb814('0x43')];if(!_0x38b48d[_0xb814('0x40')]['hasOwnProperty'](_0xb814('0x47'))){_0x32562d['limit']=qs[_0xb814('0x27')](_0x38b48d[_0xb814('0x40')][_0xb814('0x27')]);_0x32562d[_0xb814('0x25')]=qs[_0xb814('0x25')](_0x38b48d[_0xb814('0x40')][_0xb814('0x25')]);}_0x32562d[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x38b48d[_0xb814('0x40')][_0xb814('0x49')]);_0x32562d[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x38b48d[_0xb814('0x40')],_0x171f83['filters']));_0x32562d[_0xb814('0x4a')][_0xb814('0x6a')]=_0x2ee22e['id'];if(_0x38b48d['query'][_0xb814('0x4b')]){_0x32562d[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x32562d['where'],{'$or':_['map'](_0x32562d[_0xb814('0x44')],function(_0x4af71e){var _0x2d40e6={};_0x2d40e6[_0x4af71e]={'$like':'%'+_0x38b48d['query'][_0xb814('0x4b')]+'%'};return _0x2d40e6;})});}_0x32562d=_['merge']({},_0x32562d,_0x38b48d['options']);return db[_0xb814('0x6c')][_0xb814('0x26')]({'where':_0x32562d[_0xb814('0x4a')]})[_0xb814('0x2d')](function(_0x396d76){_0x5b5634[_0xb814('0x26')]=_0x396d76;if(_0x38b48d[_0xb814('0x40')][_0xb814('0x56')]){_0x32562d[_0xb814('0x4e')]=[{'all':!![]}];}return db[_0xb814('0x6c')][_0xb814('0x4f')](_0x32562d);})['then'](function(_0x5bd85){_0x5b5634['rows']=_0x5bd85;return _0x5b5634;});}})[_0xb814('0x2d')](respondWithFilteredResult(_0x46ea9d,_0x32562d))[_0xb814('0x51')](handleError(_0x46ea9d,null));};exports[_0xb814('0x6d')]=function(_0x4fde6a,_0x6e5486,_0x18fb74){var _0x371e92={'raw':!![],'where':{}};var _0x2fbea5={};var _0x290718={'count':0x0,'rows':[]};return db[_0xb814('0x3d')][_0xb814('0x67')]({'where':{'id':_0x4fde6a[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x6e5486,null))[_0xb814('0x2d')](function(_0x3b65c0){if(_0x3b65c0){_0x2fbea5[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0x6e')][_0xb814('0x3e')]);_0x2fbea5['query']=_[_0xb814('0x41')](_0x4fde6a[_0xb814('0x40')]);_0x2fbea5[_0xb814('0x42')]=_['intersection'](_0x2fbea5['model'],_0x2fbea5[_0xb814('0x40')]);_0x371e92['attributes']=_['intersection'](_0x2fbea5['model'],qs['fields'](_0x4fde6a[_0xb814('0x40')][_0xb814('0x45')]));_0x371e92['attributes']=_0x371e92[_0xb814('0x44')][_0xb814('0x55')]?_0x371e92[_0xb814('0x44')]:_0x2fbea5[_0xb814('0x43')];if(!_0x4fde6a[_0xb814('0x40')][_0xb814('0x46')](_0xb814('0x47'))){_0x371e92[_0xb814('0x27')]=qs[_0xb814('0x27')](_0x4fde6a[_0xb814('0x40')][_0xb814('0x27')]);_0x371e92['offset']=qs[_0xb814('0x25')](_0x4fde6a['query'][_0xb814('0x25')]);}_0x371e92[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x4fde6a[_0xb814('0x40')][_0xb814('0x49')]);_0x371e92[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x4fde6a['query'],_0x2fbea5['filters']));_0x371e92['where'][_0xb814('0x6a')]=_0x3b65c0['id'];if(_0x4fde6a[_0xb814('0x40')][_0xb814('0x4b')]){_0x371e92[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x371e92[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x371e92[_0xb814('0x44')],function(_0x41847e){var _0x1a5685={};_0x1a5685[_0x41847e]={'$like':'%'+_0x4fde6a['query']['filter']+'%'};return _0x1a5685;})});}_0x371e92=_[_0xb814('0x4c')]({},_0x371e92,_0x4fde6a[_0xb814('0x60')]);return db[_0xb814('0x6e')][_0xb814('0x26')]({'where':_0x371e92[_0xb814('0x4a')]})[_0xb814('0x2d')](function(_0x48358c){_0x290718[_0xb814('0x26')]=_0x48358c;if(_0x4fde6a['query'][_0xb814('0x56')]){_0x371e92[_0xb814('0x4e')]=[{'all':!![]}];}return db[_0xb814('0x6e')][_0xb814('0x4f')](_0x371e92);})[_0xb814('0x2d')](function(_0x2c2238){_0x290718[_0xb814('0x50')]=_0x2c2238;return _0x290718;});}})['then'](respondWithFilteredResult(_0x6e5486,_0x371e92))[_0xb814('0x51')](handleError(_0x6e5486,null));};exports[_0xb814('0x6f')]=function(_0x1f04eb,_0xb21029,_0x4a1c4e){var _0x17c63b={};var _0x363c9a={};var _0x27bf55;var _0x343384;return db[_0xb814('0x3d')]['findOne']({'where':{'id':_0x1f04eb[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0xb21029,null))[_0xb814('0x2d')](function(_0x561fcc){if(_0x561fcc){_0x27bf55=_0x561fcc;_0x363c9a[_0xb814('0x43')]=_['keys'](db[_0xb814('0x70')]['rawAttributes']);_0x363c9a[_0xb814('0x40')]=_[_0xb814('0x41')](_0x1f04eb[_0xb814('0x40')]);_0x363c9a[_0xb814('0x42')]=_['intersection'](_0x363c9a[_0xb814('0x43')],_0x363c9a[_0xb814('0x40')]);_0x17c63b[_0xb814('0x44')]=_[_0xb814('0x54')](_0x363c9a[_0xb814('0x43')],qs[_0xb814('0x45')](_0x1f04eb[_0xb814('0x40')][_0xb814('0x45')]));_0x17c63b[_0xb814('0x44')]=_0x17c63b[_0xb814('0x44')][_0xb814('0x55')]?_0x17c63b[_0xb814('0x44')]:_0x363c9a[_0xb814('0x43')];_0x17c63b[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x1f04eb['query'][_0xb814('0x49')]);_0x17c63b[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x1f04eb[_0xb814('0x40')],_0x363c9a[_0xb814('0x42')]));if(_0x1f04eb['query'][_0xb814('0x4b')]){_0x17c63b[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x17c63b[_0xb814('0x4a')],{'$or':_['map'](_0x17c63b['attributes'],function(_0x32a260){var _0x1f05c9={};_0x1f05c9[_0x32a260]={'$like':'%'+_0x1f04eb[_0xb814('0x40')][_0xb814('0x4b')]+'%'};return _0x1f05c9;})});}_0x17c63b=_[_0xb814('0x4c')]({},_0x17c63b,_0x1f04eb[_0xb814('0x60')]);return _0x27bf55['getTeams'](_0x17c63b);}})[_0xb814('0x2d')](function(_0x366151){if(_0x366151){_0x343384=_0x366151[_0xb814('0x55')];if(!_0x1f04eb[_0xb814('0x40')]['hasOwnProperty'](_0xb814('0x47'))){_0x17c63b[_0xb814('0x27')]=qs[_0xb814('0x27')](_0x1f04eb[_0xb814('0x40')][_0xb814('0x27')]);_0x17c63b['offset']=qs[_0xb814('0x25')](_0x1f04eb[_0xb814('0x40')][_0xb814('0x25')]);}return _0x27bf55[_0xb814('0x6f')](_0x17c63b);}})[_0xb814('0x2d')](function(_0x355e10){if(_0x355e10){return _0x355e10?{'count':_0x343384,'rows':_0x355e10}:null;}})[_0xb814('0x2d')](respondWithResult(_0xb21029,null))[_0xb814('0x51')](handleError(_0xb21029,null));};exports[_0xb814('0x71')]=function(_0x3e272f,_0x46599e,_0x2bca5c){var _0x109633=_0x3e272f['body']['teams'];var _0x46f245=_[_0xb814('0x34')](_0x109633,'id');return db[_0xb814('0x70')]['findAll']({'where':{'id':_0x46f245},'attributes':['id'],'include':[{'model':db[_0xb814('0x72')],'as':_0xb814('0x73'),'attributes':['id',_0xb814('0x3b'),'online',_0xb814('0x74'),_0xb814('0x75')],'raw':!![]}]})[_0xb814('0x2d')](function(_0x7cda02){if(_0x7cda02){var _0x6ec0f5=_[_0xb814('0x76')](_0x7cda02,function(_0x526ae3){var _0x430141=_0x526ae3['get']({'plain':!![]});_0x430141[_0xb814('0x73')]['forEach'](function(_0x3c6701){_0x3c6701[_0xb814('0x77')]=_[_0xb814('0x38')](_0x109633,{'id':_0x430141['id']})['penalty'];});return _0x430141[_0xb814('0x73')];});return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x3e272f['params']['id']}})[_0xb814('0x2d')](function(_0x5d28cd){return db[_0xb814('0x78')][_0xb814('0x79')](function(_0x3a1839){return _0x5d28cd['addTeams'](_0x46f245,{'transaction':_0x3a1839})[_0xb814('0x2d')](function(){return BPromise[_0xb814('0x7a')](_0x109633,function(_0xc0eb21){return db[_0xb814('0x7b')]['upsert']({'TeamId':_0xc0eb21['id'],'VoiceQueueId':_0x3e272f[_0xb814('0x53')]['id'],'penalty':_0xc0eb21[_0xb814('0x77')]},{'transaction':_0x3a1839});});})[_0xb814('0x2d')](function(){return BPromise[_0xb814('0x7a')](_0x6ec0f5,function(_0x3ea4ed){return db[_0xb814('0x7c')][_0xb814('0x7d')]({'where':{'UserId':_0x3ea4ed['id'],'VoiceQueueId':_0x3e272f[_0xb814('0x53')]['id']},'defaults':{'penalty':_0x3ea4ed[_0xb814('0x77')]},'transaction':_0x3a1839});});})['then'](function(){return BPromise[_0xb814('0x7a')](_[_0xb814('0x4b')](_0x6ec0f5,{'online':!![]}),function(_0x899965){return db['UserVoiceQueueRt'][_0xb814('0x7e')]({'membername':_0x899965['name'],'UserId':_0x899965['id'],'queue_name':_0x5d28cd['name'],'VoiceQueueId':_0x5d28cd['id'],'interface':_['isNil'](_0x899965[_0xb814('0x75')])?util['format'](_0xb814('0x7f'),_0x899965[_0xb814('0x3b')]):_0x899965['interface'],'paused':_0x899965['voicePause']||![],'penalty':_0x899965[_0xb814('0x77')]},{'transaction':_0x3a1839});});})['then'](function(){_0x6ec0f5[_0xb814('0x80')](function(_0x50f72a){socket[_0xb814('0x81')](_0xb814('0x82'),{'UserId':_0x50f72a['id'],'VoiceQueueId':_0x5d28cd['id']});});});});});}})[_0xb814('0x2d')](respondWithStatusCode(_0x46599e,null))['catch'](handleError(_0x46599e,null));};exports['removeTeams']=function(_0x54ab1a,_0x10c136,_0x5018ea){return db['Team'][_0xb814('0x4f')]({'where':{'id':_0x54ab1a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb814('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb814('0x2d')](handleEntityNotFound(_0x10c136,null))[_0xb814('0x2d')](function(_0x4d27b1){var _0x270656=_[_0xb814('0x34')](_0x4d27b1,'id');var _0x22e416=[];var _0x23c32e=[];var _0x165dab=squel[_0xb814('0x83')]();_0x165dab['field'](_0xb814('0x84'))[_0xb814('0x85')](_0xb814('0x86'),'tq')[_0xb814('0x87')]('user_has_teams','ut',_0xb814('0x88'))[_0xb814('0x4a')](_0xb814('0x89'),_0x54ab1a[_0xb814('0x53')]['id']);for(var _0x3d1f3c=0x0;_0x3d1f3c<_0x4d27b1[_0xb814('0x55')];_0x3d1f3c+=0x1){let _0x1f4540=_0x4d27b1[_0x3d1f3c];for(var _0x3ab919=0x0;_0x3ab919<_0x1f4540[_0xb814('0x73')][_0xb814('0x55')];_0x3ab919+=0x1){let _0x47f054=_0x1f4540[_0xb814('0x73')][_0x3ab919];var _0x16122a=_0x165dab['clone']();_0x16122a[_0xb814('0x4a')]('ut.UserId\x20=\x20?',_0x47f054['id']);_0x23c32e[_0xb814('0x8a')](db[_0xb814('0x78')]['query'](_0x16122a[_0xb814('0x8b')](),{'type':db['sequelize'][_0xb814('0x8c')][_0xb814('0x8d')]})[_0xb814('0x2d')](function(_0x115ba9){if(_0x115ba9[_0xb814('0x55')]===0x1){return _0x47f054['id'];}else{var _0x5e43bf=_[_0xb814('0x8e')](_['map'](_0x115ba9,_0xb814('0x8f')),function(_0x24833a){return _[_0xb814('0x36')](_0x270656,_0x24833a);});if(_0x5e43bf){return _0x47f054['id'];}}}));}}return BPromise[_0xb814('0x90')](_0x23c32e)[_0xb814('0x2d')](function(_0x1fd156){_0x22e416=_(_0x22e416)[_0xb814('0x91')](_0x1fd156)[_0xb814('0x92')]()[_0xb814('0x35')]();return db['VoiceQueue'][_0xb814('0x38')]({'where':{'id':_0x54ab1a[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](function(_0x2ba313){return db['sequelize'][_0xb814('0x79')](function(_0x345fea){return _0x2ba313['removeTeams'](_0x54ab1a[_0xb814('0x40')]['ids'],{'transaction':_0x345fea})['then'](function(){if(!_['isEmpty'](_0x22e416)){return _0x2ba313[_0xb814('0x93')](_0x22e416,{'transaction':_0x345fea})[_0xb814('0x2d')](function(){return db[_0xb814('0x94')][_0xb814('0x2e')]({'where':{'VoiceQueueId':_0x54ab1a[_0xb814('0x53')]['id'],'UserId':_0x22e416},'transaction':_0x345fea});});}})['then'](function(){_0x22e416[_0xb814('0x80')](function(_0x30cd8a){socket['emit'](_0xb814('0x95'),{'UserId':_0x30cd8a,'VoiceQueueId':_0x2ba313['id']});});});});});});})['then'](respondWithStatusCode(_0x10c136,null))[_0xb814('0x51')](handleError(_0x10c136,null));};exports[_0xb814('0x96')]=function(_0x3ae679,_0x3f0b58,_0x5b09d8){var _0x44e9df,_0x4f7ce6;return db['VoiceQueue'][_0xb814('0x38')]({'where':{'id':_0x3ae679['params']['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x3f0b58,null))['then'](function(_0x20abd4){if(_0x20abd4){_0x4f7ce6=_0x20abd4;return _0x20abd4[_0xb814('0x96')](_0x3ae679[_0xb814('0x63')][_0xb814('0x97')],_['omit'](_0x3ae679[_0xb814('0x63')],['ids','id'])||{})['spread'](function(_0x37cde3){for(var _0x301453=0x0;_0x301453<_0x3ae679['body'][_0xb814('0x97')][_0xb814('0x55')];_0x301453+=0x1){socket[_0xb814('0x81')](_0xb814('0x82'),{'UserId':Number(_0x3ae679['body'][_0xb814('0x97')][_0x301453]),'VoiceQueueId':Number(_0x3ae679[_0xb814('0x53')]['id'])});}return _0x37cde3;});}})[_0xb814('0x2d')](function(_0xb0bb61){_0x44e9df=_0xb0bb61||[];if(_0x4f7ce6){return db[_0xb814('0x72')][_0xb814('0x4f')]({'where':{'id':_0x3ae679[_0xb814('0x63')][_0xb814('0x97')]},'attributes':['id',_0xb814('0x3b'),_0xb814('0x98'),_0xb814('0x74'),_0xb814('0x75')],'raw':!![]});}})[_0xb814('0x2d')](function(_0x4923ba){if(!_[_0xb814('0x99')](_0x4923ba)){var _0x12d923=[];for(var _0x331759=0x0;_0x331759<_0x4923ba[_0xb814('0x55')];_0x331759++){if(_0x4923ba[_0x331759][_0xb814('0x98')]){_0x12d923[_0xb814('0x8a')](db[_0xb814('0x94')][_0xb814('0x7e')]({'membername':_0x4923ba[_0x331759]['name'],'UserId':_0x4923ba[_0x331759]['id'],'queue_name':_0x4f7ce6[_0xb814('0x3b')],'VoiceQueueId':_0x4f7ce6['id'],'interface':_[_0xb814('0x9a')](_0x4923ba[_0x331759][_0xb814('0x75')])?util[_0xb814('0x9b')](_0xb814('0x7f'),_0x4923ba[_0x331759][_0xb814('0x3b')]):_0x4923ba[_0x331759][_0xb814('0x75')],'paused':_0x4923ba[_0x331759][_0xb814('0x74')]||![],'penalty':_0x3ae679['body'][_0xb814('0x77')]||0x0}));}}return BPromise['all'](_0x12d923);}})['then'](function(){return _0x44e9df;})[_0xb814('0x2d')](respondWithResult(_0x3f0b58,null))['catch'](handleError(_0x3f0b58,null));};exports[_0xb814('0x93')]=function(_0x299092,_0x2daa63,_0x49a4b9){return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x299092[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x2daa63,null))[_0xb814('0x2d')](function(_0x53bc63){if(_0x53bc63){return _0x53bc63[_0xb814('0x93')](_0x299092[_0xb814('0x40')][_0xb814('0x97')])['then'](function(){if(_[_0xb814('0x9c')](_0x299092[_0xb814('0x40')][_0xb814('0x97')])){for(var _0x3c79c5=0x0;_0x3c79c5<_0x299092[_0xb814('0x40')][_0xb814('0x97')]['length'];_0x3c79c5+=0x1){socket[_0xb814('0x81')](_0xb814('0x95'),{'UserId':Number(_0x299092[_0xb814('0x40')]['ids'][_0x3c79c5]),'VoiceQueueId':Number(_0x299092['params']['id'])});}}else{socket[_0xb814('0x81')](_0xb814('0x95'),{'UserId':Number(_0x299092[_0xb814('0x40')][_0xb814('0x97')]),'VoiceQueueId':Number(_0x299092['params']['id'])});}});}})[_0xb814('0x2d')](function(_0x5205d7){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x299092[_0xb814('0x53')]['id'],'UserId':_0x299092[_0xb814('0x40')][_0xb814('0x97')]}})[_0xb814('0x2d')](function(){return _0x5205d7;});})[_0xb814('0x2d')](respondWithStatusCode(_0x2daa63,null))['catch'](handleError(_0x2daa63,null));};exports[_0xb814('0x9d')]=function(_0x3c3e73,_0xdb11c0,_0x15e324){var _0x25fc23={};var _0x40dc1c={};var _0x3d6479;var _0x48729b;return db['VoiceQueue']['findOne']({'where':{'id':_0x3c3e73[_0xb814('0x53')]['id']}})['then'](handleEntityNotFound(_0xdb11c0,null))[_0xb814('0x2d')](function(_0x1f60b3){if(_0x1f60b3){_0x3d6479=_0x1f60b3;_0x40dc1c[_0xb814('0x43')]=_['keys'](db[_0xb814('0x72')][_0xb814('0x3e')]);_0x40dc1c['query']=_[_0xb814('0x41')](_0x3c3e73[_0xb814('0x40')]);_0x40dc1c[_0xb814('0x42')]=_[_0xb814('0x54')](_0x40dc1c[_0xb814('0x43')],_0x40dc1c[_0xb814('0x40')]);_0x25fc23[_0xb814('0x44')]=_[_0xb814('0x54')](_0x40dc1c[_0xb814('0x43')],qs[_0xb814('0x45')](_0x3c3e73['query'][_0xb814('0x45')]));_0x25fc23['attributes']=_0x25fc23[_0xb814('0x44')][_0xb814('0x55')]?_0x25fc23[_0xb814('0x44')]:_0x40dc1c[_0xb814('0x43')];_0x25fc23[_0xb814('0x48')]=qs['sort'](_0x3c3e73[_0xb814('0x40')][_0xb814('0x49')]);_0x25fc23[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x3c3e73[_0xb814('0x40')],_0x40dc1c[_0xb814('0x42')]));if(_0x3c3e73[_0xb814('0x40')][_0xb814('0x4b')]){_0x25fc23[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x25fc23[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x25fc23[_0xb814('0x44')],function(_0x1f48f6){var _0xde7db0={};_0xde7db0[_0x1f48f6]={'$like':'%'+_0x3c3e73[_0xb814('0x40')][_0xb814('0x4b')]+'%'};return _0xde7db0;})});}_0x25fc23=_[_0xb814('0x4c')]({},_0x25fc23,_0x3c3e73[_0xb814('0x60')]);return _0x3d6479['getAgents'](_0x25fc23);}})[_0xb814('0x2d')](function(_0x183fe2){if(_0x183fe2){_0x48729b=_0x183fe2[_0xb814('0x55')];if(!_0x3c3e73[_0xb814('0x40')][_0xb814('0x46')](_0xb814('0x47'))){_0x25fc23['limit']=qs[_0xb814('0x27')](_0x3c3e73[_0xb814('0x40')][_0xb814('0x27')]);_0x25fc23[_0xb814('0x25')]=qs[_0xb814('0x25')](_0x3c3e73[_0xb814('0x40')][_0xb814('0x25')]);}return _0x3d6479[_0xb814('0x9d')](_0x25fc23);}})[_0xb814('0x2d')](function(_0x1691db){if(_0x1691db){return _0x1691db?{'count':_0x48729b,'rows':_0x1691db}:null;}})[_0xb814('0x2d')](respondWithResult(_0xdb11c0,null))[_0xb814('0x51')](handleError(_0xdb11c0,null));};exports[_0xb814('0x9e')]=function(_0x347191,_0x5b59cb,_0x1e3080){var _0x21d422={};var _0x3a63f4={};var _0x17792a;var _0x17676a;return db[_0xb814('0x3d')][_0xb814('0x67')]({'where':{'id':_0x347191[_0xb814('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b59cb,null))['then'](function(_0x1292c1){if(_0x1292c1){_0x17792a=_0x1292c1;_0x3a63f4[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0x94')][_0xb814('0x3e')]);_0x3a63f4['query']=_[_0xb814('0x41')](_0x347191[_0xb814('0x40')]);_0x3a63f4[_0xb814('0x42')]=_[_0xb814('0x54')](_0x3a63f4['model'],_0x3a63f4['query']);_0x21d422[_0xb814('0x44')]=_[_0xb814('0x54')](_0x3a63f4[_0xb814('0x43')],qs['fields'](_0x347191[_0xb814('0x40')][_0xb814('0x45')]));_0x21d422[_0xb814('0x44')]=_0x21d422[_0xb814('0x44')]['length']?_0x21d422['attributes']:_0x3a63f4[_0xb814('0x43')];_0x21d422[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x347191['query']['sort']);_0x21d422['where']=qs['filters'](_[_0xb814('0x69')](_0x347191[_0xb814('0x40')],_0x3a63f4['filters']));if(_0x347191[_0xb814('0x40')][_0xb814('0x4b')]){_0x21d422[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x21d422[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x21d422[_0xb814('0x44')],function(_0x4ddac5){var _0x1740ac={};_0x1740ac[_0x4ddac5]={'$like':'%'+_0x347191[_0xb814('0x40')][_0xb814('0x4b')]+'%'};return _0x1740ac;})});}_0x21d422=_[_0xb814('0x4c')]({},_0x21d422,_0x347191[_0xb814('0x60')]);return _0x17792a[_0xb814('0x9e')](_0x21d422);}})[_0xb814('0x2d')](function(_0x462c70){if(_0x462c70){_0x17676a=_0x462c70[_0xb814('0x55')];if(!_0x347191[_0xb814('0x40')]['hasOwnProperty'](_0xb814('0x47'))){_0x21d422['limit']=qs[_0xb814('0x27')](_0x347191['query']['limit']);_0x21d422[_0xb814('0x25')]=qs['offset'](_0x347191['query'][_0xb814('0x25')]);}return _0x17792a[_0xb814('0x9e')](_0x21d422);}})[_0xb814('0x2d')](function(_0x4bc8aa){return _0x4bc8aa?{'count':_0x17676a,'rows':_0x4bc8aa}:null;})['then'](respondWithResult(_0x5b59cb,null))[_0xb814('0x51')](handleError(_0x5b59cb,null));};exports[_0xb814('0x9f')]=function(_0x488c94,_0x15495c,_0x29bfcf){var _0xae733a={};var _0x3b2707={};var _0x37b356;var _0x47b27c;return db[_0xb814('0x3d')]['findOne']({'where':{'id':_0x488c94[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x15495c,null))[_0xb814('0x2d')](function(_0x30c1b6){if(_0x30c1b6){_0x37b356=_0x30c1b6;_0x3b2707[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0xa0')][_0xb814('0x3e')]);_0x3b2707[_0xb814('0x40')]=_[_0xb814('0x41')](_0x488c94[_0xb814('0x40')]);_0x3b2707['filters']=_[_0xb814('0x54')](_0x3b2707[_0xb814('0x43')],_0x3b2707[_0xb814('0x40')]);_0xae733a[_0xb814('0x44')]=_[_0xb814('0x54')](_0x3b2707[_0xb814('0x43')],qs['fields'](_0x488c94[_0xb814('0x40')]['fields']));_0xae733a[_0xb814('0x44')]=_0xae733a[_0xb814('0x44')][_0xb814('0x55')]?_0xae733a[_0xb814('0x44')]:_0x3b2707[_0xb814('0x43')];_0xae733a[_0xb814('0x48')]=qs['sort'](_0x488c94['query'][_0xb814('0x49')]);_0xae733a[_0xb814('0x4a')]=qs['filters'](_[_0xb814('0x69')](_0x488c94[_0xb814('0x40')],_0x3b2707['filters']));if(_0x488c94[_0xb814('0x40')][_0xb814('0x4b')]){_0xae733a['where']=_[_0xb814('0x4c')](_0xae733a[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0xae733a[_0xb814('0x44')],function(_0x4f0e51){var _0x38e8f8={};_0x38e8f8[_0x4f0e51]={'$like':'%'+_0x488c94['query']['filter']+'%'};return _0x38e8f8;})});}_0xae733a=_[_0xb814('0x4c')]({},_0xae733a,_0x488c94[_0xb814('0x60')]);return _0x37b356[_0xb814('0x9f')](_0xae733a);}})['then'](function(_0x22e421){if(_0x22e421){_0x47b27c=_0x22e421[_0xb814('0x55')];if(!_0x488c94[_0xb814('0x40')][_0xb814('0x46')](_0xb814('0x47'))){_0xae733a['limit']=qs[_0xb814('0x27')](_0x488c94['query'][_0xb814('0x27')]);_0xae733a[_0xb814('0x25')]=qs['offset'](_0x488c94[_0xb814('0x40')][_0xb814('0x25')]);}return _0x37b356['getLists'](_0xae733a);}})[_0xb814('0x2d')](function(_0x5aa664){if(_0x5aa664){return _0x5aa664?{'count':_0x47b27c,'rows':_0x5aa664}:null;}})[_0xb814('0x2d')](respondWithResult(_0x15495c,null))['catch'](handleError(_0x15495c,null));};exports['addLists']=function(_0x5e2e23,_0x60b176,_0x35ebde){var _0x43c470=moment()[_0xb814('0x9b')](_0xb814('0xa1'));var _0x51acee,_0x386af0;return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x5e2e23['params']['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x60b176,null))[_0xb814('0x2d')](function(_0x591839){if(_0x591839){_0x386af0=_0x591839;return _0x591839['addLists'](_0x5e2e23[_0xb814('0x63')][_0xb814('0x97')],_[_0xb814('0x61')](_0x5e2e23[_0xb814('0x63')],[_0xb814('0x97'),'id'])||{});}return null;})['spread'](function(_0x5b96a2){var _0x425759;_0x51acee=_0x5b96a2||[];var _0x54c604=[];if(_0x5b96a2){for(var _0x4d2f97=0x0;_0x4d2f97<_0x5b96a2[_0xb814('0x55')];_0x4d2f97+=0x1){var _0x4120f4=_0x5b96a2[_0x4d2f97][_0xb814('0x2f')]({'plain':!![]});_0x386af0[_0xb814('0xa2')]=_0x5e2e23[_0xb814('0x63')]['dialCheckDuplicateType']?_0x5e2e23[_0xb814('0x63')][_0xb814('0xa2')]:_0x386af0[_0xb814('0xa2')];switch(_0x386af0[_0xb814('0xa2')]){case _0xb814('0xa3'):_0x425759=squel[_0xb814('0xa4')]()[_0xb814('0xa5')](_0xb814('0xa6'))[_0xb814('0xa7')](['phone',_0xb814('0xa8'),_0xb814('0xa9'),_0xb814('0xaa'),'VoiceQueueId','createdAt',_0xb814('0x62')],squel[_0xb814('0x83')]()[_0xb814('0xab')]('phone',_0xb814('0xac'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0xa8'))[_0xb814('0xab')]('id',_0xb814('0xa9'))[_0xb814('0xab')](_0x4120f4[_0xb814('0xad')][_0xb814('0x8b')](),'ListId')[_0xb814('0xab')](_0x5e2e23[_0xb814('0x53')]['id'][_0xb814('0x8b')](),_0xb814('0x6a'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0x64'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27','updatedAt')[_0xb814('0x85')]('cm_contacts')[_0xb814('0x4a')](_0xb814('0xae'))[_0xb814('0x4a')](_0xb814('0xaf'),_0x4120f4[_0xb814('0xad')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xb814('0x4a')](_0xb814('0xb0'),squel[_0xb814('0x83')]()['field'](_0xb814('0xb1'))[_0xb814('0x85')](_0xb814('0xb2'))[_0xb814('0x4a')]('VoiceQueueId\x20=\x20?',_0x5e2e23[_0xb814('0x53')]['id'][_0xb814('0x8b')]()))[_0xb814('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb814('0x83')]()[_0xb814('0xab')]('COALESCE(phone,\x27\x27)')[_0xb814('0x85')]('cm_hopper')[_0xb814('0x4a')](_0xb814('0x89'),_0x5e2e23[_0xb814('0x53')]['id'][_0xb814('0x8b')]())))[_0xb814('0x8b')]();break;case _0xb814('0xb3'):_0x425759=squel[_0xb814('0xa4')]()['into'](_0xb814('0xa6'))[_0xb814('0xa7')]([_0xb814('0xac'),'scheduledAt','ContactId',_0xb814('0xaa'),_0xb814('0x6a'),'createdAt',_0xb814('0x62')],squel[_0xb814('0x83')]()['field'](_0xb814('0xac'),_0xb814('0xac'))['field']('\x27'+_0x43c470+'\x27',_0xb814('0xa8'))[_0xb814('0xab')]('id',_0xb814('0xa9'))['field'](_0x4120f4[_0xb814('0xad')]['toString'](),_0xb814('0xaa'))[_0xb814('0xab')](_0x5e2e23[_0xb814('0x53')]['id'][_0xb814('0x8b')](),_0xb814('0x6a'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0x64'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27','updatedAt')[_0xb814('0x85')](_0xb814('0xb4'))[_0xb814('0x4a')](_0xb814('0xae'))['where'](_0xb814('0xaf'),_0x4120f4[_0xb814('0xad')][_0xb814('0x8b')]())['where'](_0xb814('0xb5'))['where'](_0xb814('0xb0'),squel[_0xb814('0x83')]()[_0xb814('0xab')]('COALESCE(phone,\x27\x27)')['from'](_0xb814('0xa6'))[_0xb814('0x4a')](_0xb814('0x89'),_0x5e2e23[_0xb814('0x53')]['id'][_0xb814('0x8b')]())))[_0xb814('0x8b')]();break;default:_0x425759=squel[_0xb814('0xa4')]()[_0xb814('0xa5')](_0xb814('0xa6'))['fromQuery']([_0xb814('0xac'),'scheduledAt',_0xb814('0xa9'),'ListId',_0xb814('0x6a'),_0xb814('0x64'),'updatedAt'],squel[_0xb814('0x83')]()[_0xb814('0xab')]('phone',_0xb814('0xac'))['field']('\x27'+_0x43c470+'\x27',_0xb814('0xa8'))[_0xb814('0xab')]('id',_0xb814('0xa9'))['field'](_0x4120f4[_0xb814('0xad')]['toString'](),'ListId')[_0xb814('0xab')](_0x5e2e23[_0xb814('0x53')]['id']['toString'](),_0xb814('0x6a'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0x64'))[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0x62'))[_0xb814('0x85')](_0xb814('0xb4'))[_0xb814('0x4a')](_0xb814('0xae'))[_0xb814('0x4a')](_0xb814('0xaf'),_0x4120f4[_0xb814('0xad')]['toString']())[_0xb814('0x4a')](_0xb814('0xb5')))['toString']();}_0x54c604['push'](db[_0xb814('0x78')][_0xb814('0x40')](_0x425759));}return BPromise[_0xb814('0x90')](_0x54c604);}})['then'](function(){var _0x34d76f=[];var _0x9b8876=squel['insert']()[_0xb814('0xa5')](_0xb814('0xb6'))[_0xb814('0xa7')](['CmHopperId',_0xb814('0xac'),'OrderBy',_0xb814('0x64'),'updatedAt'],squel[_0xb814('0x83')]()['field']('h.id')['field']('ci.item')[_0xb814('0xab')]('ci.OrderBy+1')[_0xb814('0xab')]('\x27'+_0x43c470+'\x27',_0xb814('0x64'))['field']('\x27'+_0x43c470+'\x27',_0xb814('0x62'))[_0xb814('0x85')](_0xb814('0xb7'),'ci')['join'](_0xb814('0xa6'),'h','h.ContactId=ci.CmContactId')[_0xb814('0x4a')](_0xb814('0xb8'),_0x43c470)[_0xb814('0x4a')]('ci.ItemClass=?',_0xb814('0xb9')))[_0xb814('0x8b')]();_0x34d76f[_0xb814('0x8a')](db['sequelize'][_0xb814('0x40')](_0x9b8876));return BPromise[_0xb814('0x90')](_0x34d76f);})[_0xb814('0x2d')](function(){return _0x51acee;})[_0xb814('0x2d')](respondWithResult(_0x60b176,null))[_0xb814('0x51')](handleError(_0x60b176,null));};exports[_0xb814('0xba')]=function(_0x1a3b17,_0xb9d890,_0x15074d){return db[_0xb814('0x3d')]['find']({'where':{'id':_0x1a3b17[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0xb9d890,null))[_0xb814('0x2d')](function(_0x296802){if(_0x296802){return _0x296802['removeLists'](_0x1a3b17[_0xb814('0x40')][_0xb814('0x97')]);}})[_0xb814('0x2d')](function(_0x1a6551){if(_0x1a6551){return db[_0xb814('0x68')]['destroy']({'where':{'ListId':_0x1a3b17[_0xb814('0x40')]['ids'],'VoiceQueueId':_0x1a3b17[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](function(){return _0x1a6551;});}})[_0xb814('0x2d')](respondWithStatusCode(_0xb9d890,null))[_0xb814('0x51')](handleError(_0xb9d890,null));};exports[_0xb814('0xbb')]=function(_0x1dd53d,_0x4ec4bb,_0x4ee888){var _0x416291={};var _0x5e57a9={};var _0x316e3b;var _0x2c95bb;return db[_0xb814('0x3d')][_0xb814('0x67')]({'where':{'id':_0x1dd53d[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x4ec4bb,null))[_0xb814('0x2d')](function(_0x22d90c){if(_0x22d90c){_0x316e3b=_0x22d90c;_0x5e57a9[_0xb814('0x43')]=_[_0xb814('0x41')](db[_0xb814('0xa0')][_0xb814('0x3e')]);_0x5e57a9[_0xb814('0x40')]=_[_0xb814('0x41')](_0x1dd53d[_0xb814('0x40')]);_0x5e57a9[_0xb814('0x42')]=_[_0xb814('0x54')](_0x5e57a9[_0xb814('0x43')],_0x5e57a9[_0xb814('0x40')]);_0x416291[_0xb814('0x44')]=_[_0xb814('0x54')](_0x5e57a9['model'],qs['fields'](_0x1dd53d[_0xb814('0x40')][_0xb814('0x45')]));_0x416291[_0xb814('0x44')]=_0x416291[_0xb814('0x44')][_0xb814('0x55')]?_0x416291[_0xb814('0x44')]:_0x5e57a9[_0xb814('0x43')];_0x416291[_0xb814('0x48')]=qs[_0xb814('0x49')](_0x1dd53d['query'][_0xb814('0x49')]);_0x416291[_0xb814('0x4a')]=qs[_0xb814('0x42')](_[_0xb814('0x69')](_0x1dd53d[_0xb814('0x40')],_0x5e57a9[_0xb814('0x42')]));if(_0x1dd53d[_0xb814('0x40')]['filter']){_0x416291[_0xb814('0x4a')]=_[_0xb814('0x4c')](_0x416291[_0xb814('0x4a')],{'$or':_[_0xb814('0x34')](_0x416291[_0xb814('0x44')],function(_0x2ff4e4){var _0x15c2cc={};_0x15c2cc[_0x2ff4e4]={'$like':'%'+_0x1dd53d[_0xb814('0x40')][_0xb814('0x4b')]+'%'};return _0x15c2cc;})});}_0x416291=_['merge']({},_0x416291,_0x1dd53d[_0xb814('0x60')]);return _0x316e3b[_0xb814('0xbb')](_0x416291);}})[_0xb814('0x2d')](function(_0x2eeae2){if(_0x2eeae2){_0x2c95bb=_0x2eeae2[_0xb814('0x55')];if(!_0x1dd53d[_0xb814('0x40')]['hasOwnProperty'](_0xb814('0x47'))){_0x416291[_0xb814('0x27')]=qs['limit'](_0x1dd53d[_0xb814('0x40')][_0xb814('0x27')]);_0x416291[_0xb814('0x25')]=qs[_0xb814('0x25')](_0x1dd53d[_0xb814('0x40')]['offset']);}return _0x316e3b[_0xb814('0xbb')](_0x416291);}})[_0xb814('0x2d')](function(_0x105062){if(_0x105062){return _0x105062?{'count':_0x2c95bb,'rows':_0x105062}:null;}})['then'](respondWithResult(_0x4ec4bb,null))['catch'](handleError(_0x4ec4bb,null));};exports[_0xb814('0xbc')]=function(_0x1715a3,_0x58eeb2,_0x51542d){var _0x2b5c8c,_0x411a0f;return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x1715a3[_0xb814('0x53')]['id']}})['then'](handleEntityNotFound(_0x58eeb2,null))[_0xb814('0x2d')](function(_0x1361f1){if(_0x1361f1){_0x411a0f=_0x1361f1;return _0x1361f1[_0xb814('0xbc')](_0x1715a3[_0xb814('0x63')][_0xb814('0x97')],_[_0xb814('0x61')](_0x1715a3[_0xb814('0x63')],['ids','id'])||{});}return null;})[_0xb814('0xbd')](function(_0x5b4cb5){var _0x5840dd;_0x2b5c8c=_0x5b4cb5||[];var _0x5601df=[];if(_0x5b4cb5){for(var _0x954ec9=0x0;_0x954ec9<_0x5b4cb5['length'];_0x954ec9+=0x1){var _0x1eb9c8=_0x5b4cb5[_0x954ec9]['get']({'plain':!![]});_0x5840dd=squel[_0xb814('0xa4')]()[_0xb814('0xa5')]('cm_hopper_black')['fromQuery']([_0xb814('0xac'),_0xb814('0xa9'),'ListId','VoiceQueueId',_0xb814('0x64'),'updatedAt'],squel[_0xb814('0x83')]()[_0xb814('0xab')]('phone','phone')['field']('id',_0xb814('0xa9'))['field'](_0x1eb9c8[_0xb814('0xad')][_0xb814('0x8b')](),'ListId')['field'](_0x1715a3[_0xb814('0x53')]['id']['toString'](),'VoiceQueueId')[_0xb814('0xab')](_0xb814('0xbe'),_0xb814('0x64'))['field'](_0xb814('0xbe'),'updatedAt')[_0xb814('0x85')](_0xb814('0xb4'))[_0xb814('0x4a')](_0xb814('0xae'))[_0xb814('0x4a')](_0xb814('0xaf'),_0x1eb9c8[_0xb814('0xad')]['toString']())[_0xb814('0x4a')](_0xb814('0xb5')))[_0xb814('0x8b')]();_0x5601df['push'](db[_0xb814('0x78')][_0xb814('0x40')](_0x5840dd));}return BPromise[_0xb814('0x90')](_0x5601df);}})[_0xb814('0x2d')](function(){return _0x2b5c8c;})[_0xb814('0x2d')](respondWithResult(_0x58eeb2,null))[_0xb814('0x51')](handleError(_0x58eeb2,null));};exports[_0xb814('0xbf')]=function(_0x2ec0a2,_0x69b66e,_0xe384ee){return db[_0xb814('0x3d')][_0xb814('0x38')]({'where':{'id':_0x2ec0a2[_0xb814('0x53')]['id']}})[_0xb814('0x2d')](handleEntityNotFound(_0x69b66e,null))[_0xb814('0x2d')](function(_0x264452){if(_0x264452){return _0x264452['removeBlackLists'](_0x2ec0a2[_0xb814('0x40')]['ids']);}})[_0xb814('0x2d')](function(_0x256316){if(_0x256316){return db[_0xb814('0x6e')][_0xb814('0x2e')]({'where':{'ListId':_0x2ec0a2[_0xb814('0x40')][_0xb814('0x97')],'VoiceQueueId':_0x2ec0a2['params']['id']}})[_0xb814('0x2d')](function(){return _0x256316;});}})[_0xb814('0x2d')](respondWithStatusCode(_0x69b66e,null))[_0xb814('0x51')](handleError(_0x69b66e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d93e708..5e7a2ce 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 _0x9313=['VoiceQueue','setMaxListeners','update','remove','hook','exports','events','../../mysqldb'];(function(_0x5ad70c,_0x442c3d){var _0x4b22f1=function(_0x2523f7){while(--_0x2523f7){_0x5ad70c['push'](_0x5ad70c['shift']());}};_0x4b22f1(++_0x442c3d);}(_0x9313,0x1be));var _0x3931=function(_0x475e12,_0x5cb4c6){_0x475e12=_0x475e12-0x0;var _0x5dc482=_0x9313[_0x475e12];return _0x5dc482;};'use strict';var EventEmitter=require(_0x3931('0x0'));var VoiceQueue=require(_0x3931('0x1'))['db'][_0x3931('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3931('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3931('0x4'),'afterDestroy':_0x3931('0x5')};function emitEvent(_0x5ed1fd){return function(_0x189949,_0x69324c,_0xb7f499){VoiceQueueEvents['emit'](_0x5ed1fd+':'+_0x189949['id'],_0x189949);VoiceQueueEvents['emit'](_0x5ed1fd,_0x189949);_0xb7f499(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x3931('0x6')](e,emitEvent(event));}}module[_0x3931('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x107c=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x5a6438,_0x4452f0){var _0xc661aa=function(_0xa9b72){while(--_0xa9b72){_0x5a6438['push'](_0x5a6438['shift']());}};_0xc661aa(++_0x4452f0);}(_0x107c,0xf7));var _0xc107=function(_0x46b8aa,_0x246d21){_0x46b8aa=_0x46b8aa-0x0;var _0x5a3d61=_0x107c[_0x46b8aa];return _0x5a3d61;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xc107('0x0'))['db'][_0xc107('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc107('0x2')](0x0);var events={'afterCreate':_0xc107('0x3'),'afterUpdate':_0xc107('0x4'),'afterDestroy':_0xc107('0x5')};function emitEvent(_0x280c27){return function(_0x449508,_0x6bca57,_0x3cc4c9){VoiceQueueEvents[_0xc107('0x6')](_0x280c27+':'+_0x449508['id'],_0x449508);VoiceQueueEvents[_0xc107('0x6')](_0x280c27,_0x449508);_0x3cc4c9(null);};}for(var e in events){if(events[_0xc107('0x7')](e)){var event=events[e];VoiceQueue[_0xc107('0x8')](e,emitEvent(event));}}module[_0xc107('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 f3ab0d4..12be7b0 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0x55ca,0x126));var _0xa55c=function(_0x129954,_0x17b156){_0x129954=_0x129954-0x0;var _0x2b40f2=_0x55ca[_0x129954];return _0x2b40f2;};'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 +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x180763,_0x4b889d){var _0x991e0c=function(_0x2bef11){while(--_0x2bef11){_0x180763['push'](_0x180763['shift']());}};_0x991e0c(++_0x4b889d);}(_0x3e74,0x175));var _0x43e7=function(_0xd4cee5,_0x45c1d5){_0xd4cee5=_0xd4cee5-0x0;var _0x1f5b68=_0x3e74[_0xd4cee5];return _0x1f5b68;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 236d908..671e8f5 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 _0xfa9f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','include','map','model','attributes','stringify','find','ShowVoiceQueue','lodash','moment'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xfa9f,0x8a));var _0xffa9=function(_0x369289,_0xb779d8){_0x369289=_0x369289-0x0;var _0x1c8ba4=_0xfa9f[_0x369289];return _0x1c8ba4;};'use strict';var _=require(_0xffa9('0x0'));var util=require('util');var moment=require(_0xffa9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffa9('0x2'))['db'];var utils=require(_0xffa9('0x3'));var logger=require(_0xffa9('0x4'))('rpc');var config=require(_0xffa9('0x5'));var jayson=require(_0xffa9('0x6'));var client=jayson[_0xffa9('0x7')]['http']({'port':0x232a});config[_0xffa9('0x8')]=_['defaults'](config[_0xffa9('0x8')],{'host':_0xffa9('0x9'),'port':0x18eb});var socket=require(_0xffa9('0xa'))(new Redis(config['redis']));require(_0xffa9('0xb'))[_0xffa9('0xc')](socket);function respondWithRpcPromise(_0x2df758,_0x4735a7,_0x552943){return new BPromise(function(_0x170577,_0x3f093d){return client[_0xffa9('0xd')](_0x2df758,_0x552943)[_0xffa9('0xe')](function(_0x187dc5){logger[_0xffa9('0xf')](_0xffa9('0x10'),_0x4735a7,_0xffa9('0x11'));logger[_0xffa9('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4735a7,'request\x20sent',JSON['stringify'](_0x187dc5));if(_0x187dc5['error']){if(_0x187dc5[_0xffa9('0x13')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4735a7,_0x187dc5[_0xffa9('0x13')][_0xffa9('0x14')]);return _0x3f093d(_0x187dc5[_0xffa9('0x13')]['message']);}logger['error'](_0xffa9('0x10'),_0x4735a7,_0x187dc5[_0xffa9('0x13')][_0xffa9('0x14')]);return _0x170577(_0x187dc5[_0xffa9('0x13')][_0xffa9('0x14')]);}else{logger[_0xffa9('0xf')](_0xffa9('0x10'),_0x4735a7,_0xffa9('0x11'));_0x170577(_0x187dc5[_0xffa9('0x15')][_0xffa9('0x14')]);}})[_0xffa9('0x16')](function(_0x79f471){logger[_0xffa9('0x13')](_0xffa9('0x10'),_0x4735a7,_0x79f471);_0x3f093d(_0x79f471);});});}exports[_0xffa9('0x17')]=function(_0x162277){var _0x340273=this;return new Promise(function(_0x39ba8b,_0x57690f){return db[_0xffa9('0x18')]['findAll']({'raw':_0x162277[_0xffa9('0x19')]?_0x162277[_0xffa9('0x19')][_0xffa9('0x1a')]===undefined?!![]:![]:!![],'where':_0x162277[_0xffa9('0x19')]?_0x162277[_0xffa9('0x19')][_0xffa9('0x1b')]||null:null,'attributes':_0x162277['options']?_0x162277[_0xffa9('0x19')]['attributes']||null:null,'limit':_0x162277['options']?_0x162277[_0xffa9('0x19')]['limit']||null:null,'include':_0x162277[_0xffa9('0x19')]?_0x162277['options'][_0xffa9('0x1c')]?_[_0xffa9('0x1d')](_0x162277[_0xffa9('0x19')][_0xffa9('0x1c')],function(_0x3ce0b5){return{'model':db[_0x3ce0b5['model']],'as':_0x3ce0b5['as'],'attributes':_0x3ce0b5['attributes'],'include':_0x3ce0b5[_0xffa9('0x1c')]?_[_0xffa9('0x1d')](_0x3ce0b5[_0xffa9('0x1c')],function(_0x1dec24){return{'model':db[_0x1dec24[_0xffa9('0x1e')]],'as':_0x1dec24['as'],'attributes':_0x1dec24[_0xffa9('0x1f')],'include':_0x1dec24[_0xffa9('0x1c')]?_['map'](_0x1dec24[_0xffa9('0x1c')],function(_0x3011c0){return{'model':db[_0x3011c0['model']],'as':_0x3011c0['as'],'attributes':_0x3011c0['attributes']};}):[]};}):[]};}):[]:[]})[_0xffa9('0xe')](function(_0x3382c4){logger[_0xffa9('0xf')]('GetVoiceQueue',_0x162277);logger[_0xffa9('0x12')](_0xffa9('0x17'),_0x162277,JSON[_0xffa9('0x20')](_0x3382c4));_0x39ba8b(_0x3382c4);})[_0xffa9('0x16')](function(_0xe37b6){logger[_0xffa9('0x13')](_0xffa9('0x17'),_0xe37b6[_0xffa9('0x14')],_0x162277);_0x57690f(_0x340273[_0xffa9('0x13')](0x1f4,_0xe37b6[_0xffa9('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x12896a){var _0x5e3493=this;return new Promise(function(_0x29a359,_0x320b73){return db[_0xffa9('0x18')][_0xffa9('0x21')]({'raw':_0x12896a['options']?_0x12896a[_0xffa9('0x19')][_0xffa9('0x1a')]===undefined?!![]:![]:!![],'where':_0x12896a[_0xffa9('0x19')]?_0x12896a[_0xffa9('0x19')][_0xffa9('0x1b')]||null:null,'attributes':_0x12896a[_0xffa9('0x19')]?_0x12896a[_0xffa9('0x19')][_0xffa9('0x1f')]||null:null,'include':_0x12896a[_0xffa9('0x19')]?_0x12896a[_0xffa9('0x19')][_0xffa9('0x1c')]?_[_0xffa9('0x1d')](_0x12896a[_0xffa9('0x19')]['include'],function(_0x444276){return{'model':db[_0x444276[_0xffa9('0x1e')]],'as':_0x444276['as'],'attributes':_0x444276['attributes'],'include':_0x444276[_0xffa9('0x1c')]?_[_0xffa9('0x1d')](_0x444276[_0xffa9('0x1c')],function(_0x3e1d66){return{'model':db[_0x3e1d66[_0xffa9('0x1e')]],'as':_0x3e1d66['as'],'attributes':_0x3e1d66['attributes'],'include':_0x3e1d66[_0xffa9('0x1c')]?_[_0xffa9('0x1d')](_0x3e1d66[_0xffa9('0x1c')],function(_0x493d29){return{'model':db[_0x493d29[_0xffa9('0x1e')]],'as':_0x493d29['as'],'attributes':_0x493d29['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c4d39){logger[_0xffa9('0xf')](_0xffa9('0x22'),_0x12896a);logger[_0xffa9('0x12')](_0xffa9('0x22'),_0x12896a,JSON[_0xffa9('0x20')](_0x2c4d39));_0x29a359(_0x2c4d39);})['catch'](function(_0x1c6d65){logger['error'](_0xffa9('0x22'),_0x1c6d65[_0xffa9('0x14')],_0x12896a);_0x320b73(_0x5e3493['error'](0x1f4,_0x1c6d65[_0xffa9('0x14')]));});});}; \ No newline at end of file +var _0x3e55=['socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','include','map','model','stringify','ShowVoiceQueue','where','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x2ff675,_0x3c2367){var _0x3693dd=function(_0x496f0a){while(--_0x496f0a){_0x2ff675['push'](_0x2ff675['shift']());}};_0x3693dd(++_0x3c2367);}(_0x3e55,0xd3));var _0x53e5=function(_0x2a1357,_0x434b07){_0x2a1357=_0x2a1357-0x0;var _0x15d626=_0x3e55[_0x2a1357];return _0x15d626;};'use strict';var _=require('lodash');var util=require(_0x53e5('0x0'));var moment=require(_0x53e5('0x1'));var BPromise=require(_0x53e5('0x2'));var rs=require(_0x53e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53e5('0x4'))['db'];var utils=require(_0x53e5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x53e5('0x6'));var jayson=require(_0x53e5('0x7'));var client=jayson['client'][_0x53e5('0x8')]({'port':0x232a});config[_0x53e5('0x9')]=_['defaults'](config[_0x53e5('0x9')],{'host':_0x53e5('0xa'),'port':0x18eb});var socket=require(_0x53e5('0xb'))(new Redis(config[_0x53e5('0x9')]));require(_0x53e5('0xc'))[_0x53e5('0xd')](socket);function respondWithRpcPromise(_0x53377a,_0x389bf6,_0x3d5442){return new BPromise(function(_0x5e078c,_0x21160e){return client[_0x53e5('0xe')](_0x53377a,_0x3d5442)[_0x53e5('0xf')](function(_0x57dced){logger['info'](_0x53e5('0x10'),_0x389bf6,_0x53e5('0x11'));logger[_0x53e5('0x12')](_0x53e5('0x13'),_0x389bf6,_0x53e5('0x11'),JSON['stringify'](_0x57dced));if(_0x57dced[_0x53e5('0x14')]){if(_0x57dced[_0x53e5('0x14')][_0x53e5('0x15')]===0x1f4){logger[_0x53e5('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x389bf6,_0x57dced['error'][_0x53e5('0x16')]);return _0x21160e(_0x57dced[_0x53e5('0x14')][_0x53e5('0x16')]);}logger['error'](_0x53e5('0x10'),_0x389bf6,_0x57dced['error'][_0x53e5('0x16')]);return _0x5e078c(_0x57dced[_0x53e5('0x14')][_0x53e5('0x16')]);}else{logger[_0x53e5('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x389bf6,_0x53e5('0x11'));_0x5e078c(_0x57dced['result'][_0x53e5('0x16')]);}})['catch'](function(_0x161b69){logger[_0x53e5('0x14')](_0x53e5('0x10'),_0x389bf6,_0x161b69);_0x21160e(_0x161b69);});});}exports[_0x53e5('0x18')]=function(_0x3ce161){var _0x54813c=this;return new Promise(function(_0x184b4a,_0x4bfb10){return db[_0x53e5('0x19')][_0x53e5('0x1a')]({'raw':_0x3ce161[_0x53e5('0x1b')]?_0x3ce161[_0x53e5('0x1b')][_0x53e5('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ce161[_0x53e5('0x1b')]?_0x3ce161[_0x53e5('0x1b')]['where']||null:null,'attributes':_0x3ce161[_0x53e5('0x1b')]?_0x3ce161[_0x53e5('0x1b')][_0x53e5('0x1d')]||null:null,'limit':_0x3ce161[_0x53e5('0x1b')]?_0x3ce161[_0x53e5('0x1b')]['limit']||null:null,'include':_0x3ce161[_0x53e5('0x1b')]?_0x3ce161[_0x53e5('0x1b')][_0x53e5('0x1e')]?_[_0x53e5('0x1f')](_0x3ce161['options'][_0x53e5('0x1e')],function(_0x1a0e18){return{'model':db[_0x1a0e18['model']],'as':_0x1a0e18['as'],'attributes':_0x1a0e18[_0x53e5('0x1d')],'include':_0x1a0e18[_0x53e5('0x1e')]?_['map'](_0x1a0e18[_0x53e5('0x1e')],function(_0x32ad61){return{'model':db[_0x32ad61[_0x53e5('0x20')]],'as':_0x32ad61['as'],'attributes':_0x32ad61[_0x53e5('0x1d')],'include':_0x32ad61['include']?_[_0x53e5('0x1f')](_0x32ad61[_0x53e5('0x1e')],function(_0x4e915e){return{'model':db[_0x4e915e[_0x53e5('0x20')]],'as':_0x4e915e['as'],'attributes':_0x4e915e[_0x53e5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x53e5('0xf')](function(_0x356a1d){logger[_0x53e5('0x17')](_0x53e5('0x18'),_0x3ce161);logger[_0x53e5('0x12')](_0x53e5('0x18'),_0x3ce161,JSON[_0x53e5('0x21')](_0x356a1d));_0x184b4a(_0x356a1d);})['catch'](function(_0x4a2719){logger[_0x53e5('0x14')](_0x53e5('0x18'),_0x4a2719['message'],_0x3ce161);_0x4bfb10(_0x54813c[_0x53e5('0x14')](0x1f4,_0x4a2719[_0x53e5('0x16')]));});});};exports[_0x53e5('0x22')]=function(_0x14ae7){var _0x137b19=this;return new Promise(function(_0x520b0f,_0x11ba0d){return db['VoiceQueue']['find']({'raw':_0x14ae7[_0x53e5('0x1b')]?_0x14ae7[_0x53e5('0x1b')][_0x53e5('0x1c')]===undefined?!![]:![]:!![],'where':_0x14ae7[_0x53e5('0x1b')]?_0x14ae7['options'][_0x53e5('0x23')]||null:null,'attributes':_0x14ae7[_0x53e5('0x1b')]?_0x14ae7['options'][_0x53e5('0x1d')]||null:null,'include':_0x14ae7[_0x53e5('0x1b')]?_0x14ae7[_0x53e5('0x1b')]['include']?_[_0x53e5('0x1f')](_0x14ae7[_0x53e5('0x1b')][_0x53e5('0x1e')],function(_0x1b311f){return{'model':db[_0x1b311f['model']],'as':_0x1b311f['as'],'attributes':_0x1b311f[_0x53e5('0x1d')],'include':_0x1b311f[_0x53e5('0x1e')]?_['map'](_0x1b311f[_0x53e5('0x1e')],function(_0x4beb0a){return{'model':db[_0x4beb0a[_0x53e5('0x20')]],'as':_0x4beb0a['as'],'attributes':_0x4beb0a[_0x53e5('0x1d')],'include':_0x4beb0a[_0x53e5('0x1e')]?_[_0x53e5('0x1f')](_0x4beb0a[_0x53e5('0x1e')],function(_0x1362bd){return{'model':db[_0x1362bd[_0x53e5('0x20')]],'as':_0x1362bd['as'],'attributes':_0x1362bd[_0x53e5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x53e5('0xf')](function(_0x36a810){logger[_0x53e5('0x17')](_0x53e5('0x22'),_0x14ae7);logger['debug'](_0x53e5('0x22'),_0x14ae7,JSON[_0x53e5('0x21')](_0x36a810));_0x520b0f(_0x36a810);})[_0x53e5('0x24')](function(_0x534f93){logger[_0x53e5('0x14')]('ShowVoiceQueue',_0x534f93[_0x53e5('0x16')],_0x14ae7);_0x11ba0d(_0x137b19['error'](0x1f4,_0x534f93[_0x53e5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7d9d8a4..f7f0881 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 _0x0fd1=['voiceQueue:','remove','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0fd1,0x148));var _0x10fd=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0fd1[_0x487b0c];return _0x1adbdc;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x10fd('0x0'),'update'];function createListener(_0x4133cb,_0x5a779){return function(_0x2c99b3){_0x5a779[_0x10fd('0x1')](_0x4133cb,_0x2c99b3);};}function removeListener(_0x20a514,_0xf4185){return function(){VoiceQueueEvents['removeListener'](_0x20a514,_0xf4185);};}exports['register']=function(_0x65a30d){for(var _0x4002ef=0x0,_0x1a8743=events['length'];_0x4002ef<_0x1a8743;_0x4002ef++){var _0x95b38e=events[_0x4002ef];var _0x3f181e=createListener(_0x10fd('0x2')+_0x95b38e,_0x65a30d);VoiceQueueEvents['on'](_0x95b38e,_0x3f181e);}}; \ No newline at end of file +var _0xebef=['save','remove','emit','length','voiceQueue:','./voiceQueue.events'];(function(_0x4651c8,_0x3e6017){var _0xd982ac=function(_0x168d31){while(--_0x168d31){_0x4651c8['push'](_0x4651c8['shift']());}};_0xd982ac(++_0x3e6017);}(_0xebef,0xef));var _0xfebe=function(_0x1960ab,_0x172ad2){_0x1960ab=_0x1960ab-0x0;var _0x20c547=_0xebef[_0x1960ab];return _0x20c547;};'use strict';var VoiceQueueEvents=require(_0xfebe('0x0'));var events=[_0xfebe('0x1'),_0xfebe('0x2'),'update'];function createListener(_0x5ca7c4,_0x1cca45){return function(_0x158658){_0x1cca45[_0xfebe('0x3')](_0x5ca7c4,_0x158658);};}function removeListener(_0x5cf409,_0x498d2d){return function(){VoiceQueueEvents['removeListener'](_0x5cf409,_0x498d2d);};}exports['register']=function(_0xad3d3e){for(var _0x35e14e=0x0,_0x11b8d1=events[_0xfebe('0x4')];_0x35e14e<_0x11b8d1;_0x35e14e++){var _0x5505e3=events[_0x35e14e];var _0x46c2d0=createListener(_0xfebe('0x5')+_0x5505e3,_0xad3d3e);VoiceQueueEvents['on'](_0x5505e3,_0x46c2d0);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1017b81..c650671 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 _0xcccc=['create','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcccc,0x16d));var _0xcccc=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xcccc[_0x3b90ab];return _0x206e92;};'use strict';var multer=require(_0xcccc('0x0'));var util=require(_0xcccc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcccc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcccc('0x3'));var interaction=require(_0xcccc('0x4'));var config=require('../../config/environment');var controller=require(_0xcccc('0x5'));router[_0xcccc('0x6')]('/',auth['isAuthenticated'](),controller[_0xcccc('0x7')]);router[_0xcccc('0x6')](_0xcccc('0x8'),auth[_0xcccc('0x9')](),controller['describe']);router[_0xcccc('0x6')](_0xcccc('0xa'),auth[_0xcccc('0x9')](),controller[_0xcccc('0xb')]);router[_0xcccc('0x6')](_0xcccc('0xc'),auth[_0xcccc('0x9')](),controller[_0xcccc('0xd')]);router[_0xcccc('0xe')]('/',auth[_0xcccc('0x9')](),controller[_0xcccc('0xf')]);router[_0xcccc('0x10')](_0xcccc('0xc'),auth['isAuthenticated'](),controller[_0xcccc('0x11')]);router['delete']('/:id',auth[_0xcccc('0x9')](),controller[_0xcccc('0x12')]);module[_0xcccc('0x13')]=router; \ No newline at end of file +var _0xe627=['../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe627,0x101));var _0x7e62=function(_0x18236b,_0x1c685f){_0x18236b=_0x18236b-0x0;var _0x5737e6=_0xe627[_0x18236b];return _0x5737e6;};'use strict';var multer=require(_0x7e62('0x0'));var util=require(_0x7e62('0x1'));var path=require(_0x7e62('0x2'));var timeout=require(_0x7e62('0x3'));var express=require(_0x7e62('0x4'));var router=express[_0x7e62('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7e62('0x6'));var interaction=require(_0x7e62('0x7'));var config=require('../../config/environment');var controller=require(_0x7e62('0x8'));router[_0x7e62('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e62('0xa')]);router['get'](_0x7e62('0xb'),auth[_0x7e62('0xc')](),controller['describe']);router[_0x7e62('0x9')](_0x7e62('0xd'),auth[_0x7e62('0xc')](),controller[_0x7e62('0xe')]);router['get'](_0x7e62('0xf'),auth[_0x7e62('0xc')](),controller[_0x7e62('0x10')]);router[_0x7e62('0x11')]('/',auth[_0x7e62('0xc')](),controller[_0x7e62('0x12')]);router[_0x7e62('0x13')](_0x7e62('0xf'),auth[_0x7e62('0xc')](),controller['update']);router[_0x7e62('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7e62('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 e9316bc..46a5cc8 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 _0xbe42=['setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0xa54cd,_0x11a226){var _0x468da0=function(_0x4e6198){while(--_0x4e6198){_0xa54cd['push'](_0xa54cd['shift']());}};_0x468da0(++_0x11a226);}(_0xbe42,0x11d));var _0x2be4=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xbe42[_0x2b91c5];return _0xbd5531;};'use strict';var Sequelize=require(_0x2be4('0x0'));var moment=require(_0x2be4('0x1'));module['exports']={'type':{'type':Sequelize[_0x2be4('0x2')]},'uniqueid':{'type':Sequelize[_0x2be4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2be4('0x2')]},'queue':{'type':Sequelize[_0x2be4('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x2be4('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x2be4('0x3')],'set':function(_0x224694){var _0x7e7e4e=moment(_0x224694);var _0x273c92=moment(this[_0x2be4('0x4')](_0x2be4('0x5')))[_0x2be4('0x6')](_0x2be4('0x7'));var _0x1b5a22=_0x7e7e4e['diff'](_0x273c92,_0x2be4('0x8'));this[_0x2be4('0x9')](_0x2be4('0xa'),_0x224694);this[_0x2be4('0x9')]('holdtime',_0x1b5a22||null);}},'position':{'type':Sequelize[_0x2be4('0xb')]},'count':{'type':Sequelize[_0x2be4('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x2be4('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2be4('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2be4('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x2be4('0x2')],'comment':_0x2be4('0xd')},'originalposition':{'type':Sequelize[_0x2be4('0xb')]},'channel':{'type':Sequelize[_0x2be4('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2be4('0x2')]},'connectedlinename':{'type':Sequelize[_0x2be4('0x2')]},'accountcode':{'type':Sequelize[_0x2be4('0x2')]},'context':{'type':Sequelize[_0x2be4('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x2be4('0x2')]},'holdtime':{'type':Sequelize[_0x2be4('0xb')]},'mohtime':{'type':Sequelize[_0x2be4('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2be4('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2be4('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2be4('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x2be4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2be4('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2be4('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x501e=['seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff'];(function(_0x3f32b3,_0x47191a){var _0xdf0157=function(_0x143f19){while(--_0x143f19){_0x3f32b3['push'](_0x3f32b3['shift']());}};_0xdf0157(++_0x47191a);}(_0x501e,0x124));var _0xe501=function(_0xb0fc08,_0x251d73){_0xb0fc08=_0xb0fc08-0x0;var _0x5a730e=_0x501e[_0xb0fc08];return _0x5a730e;};'use strict';var Sequelize=require(_0xe501('0x0'));var moment=require('moment');module[_0xe501('0x1')]={'type':{'type':Sequelize[_0xe501('0x2')]},'uniqueid':{'type':Sequelize[_0xe501('0x2')]},'calleridnum':{'type':Sequelize[_0xe501('0x2')]},'calleridname':{'type':Sequelize[_0xe501('0x2')]},'queue':{'type':Sequelize[_0xe501('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe501('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xe501('0x3')],'set':function(_0x13b763){var _0x4194c3=moment(_0x13b763);var _0x468526=moment(this[_0xe501('0x4')](_0xe501('0x5')))[_0xe501('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x28045a=_0x4194c3[_0xe501('0x7')](_0x468526,_0xe501('0x8'));this[_0xe501('0x9')](_0xe501('0xa'),_0x13b763);this[_0xe501('0x9')]('holdtime',_0x28045a||null);}},'position':{'type':Sequelize[_0xe501('0xb')]},'count':{'type':Sequelize[_0xe501('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xe501('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe501('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xe501('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe501('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe501('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe501('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xe501('0x2')],'comment':_0xe501('0xd')},'originalposition':{'type':Sequelize[_0xe501('0xb')]},'channel':{'type':Sequelize[_0xe501('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe501('0x2')]},'connectedlinename':{'type':Sequelize[_0xe501('0x2')]},'accountcode':{'type':Sequelize[_0xe501('0x2')]},'context':{'type':Sequelize[_0xe501('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe501('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe501('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe501('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe501('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe501('0x2')],'comment':_0xe501('0xe')},'transferexten':{'type':Sequelize[_0xe501('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe501('0x2')]},'disposition':{'type':Sequelize[_0xe501('0x2')]},'secondDisposition':{'type':Sequelize[_0xe501('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe501('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xe501('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 ae51f1d..0f128df 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 _0xa03d=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','body','params','describe','getVoiceQueuesReport','sort','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','save','update','then','name','send','index','map','VoiceQueueReport','type','key','model'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa03d,0x6c));var _0xda03=function(_0x5a12fd,_0x57b7a9){_0x5a12fd=_0x5a12fd-0x0;var _0xdee5de=_0xa03d[_0x5a12fd];return _0xdee5de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda03('0x0'));var zipdir=require(_0xda03('0x1'));var jsonpatch=require(_0xda03('0x2'));var rp=require(_0xda03('0x3'));var moment=require(_0xda03('0x4'));var BPromise=require(_0xda03('0x5'));var Mustache=require('mustache');var util=require(_0xda03('0x6'));var path=require(_0xda03('0x7'));var sox=require('sox');var csv=require(_0xda03('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda03('0x9'));var _=require('lodash');var squel=require(_0xda03('0xa'));var crypto=require(_0xda03('0xb'));var jsforce=require(_0xda03('0xc'));var deskjs=require(_0xda03('0xd'));var toCsv=require('to-csv');var querystring=require(_0xda03('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xda03('0xf'));var qs=require(_0xda03('0x10'));var as=require(_0xda03('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda03('0x12'))('api');var utils=require(_0xda03('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda03('0x14'))['db'];config[_0xda03('0x15')]=_['defaults'](config[_0xda03('0x15')],{'host':_0xda03('0x16'),'port':0x18eb});var socket=require(_0xda03('0x17'))(new Redis(config[_0xda03('0x15')]));require(_0xda03('0x18'))[_0xda03('0x19')](socket);function respondWithStatusCode(_0x24a772,_0x14ceb5){_0x14ceb5=_0x14ceb5||0xcc;return function(_0x2a5604){if(_0x2a5604){return _0x24a772[_0xda03('0x1a')](_0x14ceb5);}return _0x24a772[_0xda03('0x1b')](_0x14ceb5)[_0xda03('0x1c')]();};}function respondWithResult(_0x55f0be,_0x4dad2e){_0x4dad2e=_0x4dad2e||0xc8;return function(_0x50efe6){if(_0x50efe6){return _0x55f0be[_0xda03('0x1b')](_0x4dad2e)['json'](_0x50efe6);}};}function respondWithFilteredResult(_0x2e38cb,_0x118f45){return function(_0x4bc111){if(_0x4bc111){var _0x902e1b=typeof _0x118f45[_0xda03('0x1d')]===_0xda03('0x1e')&&typeof _0x118f45[_0xda03('0x1f')]===_0xda03('0x1e');var _0x5682c2=_0x4bc111['count'];var _0x1c3030=_0x902e1b?0x0:_0x118f45[_0xda03('0x1d')];var _0x35e76b=_0x902e1b?_0x4bc111['count']:_0x118f45[_0xda03('0x1d')]+_0x118f45[_0xda03('0x1f')];var _0x124224;if(_0x35e76b>=_0x5682c2){_0x35e76b=_0x5682c2;_0x124224=0xc8;}else{_0x124224=0xce;}_0x2e38cb['status'](_0x124224);return _0x2e38cb['set'](_0xda03('0x20'),_0x1c3030+'-'+_0x35e76b+'/'+_0x5682c2)['json'](_0x4bc111);}return null;};}function patchUpdates(_0x4ad20c){return function(_0x1eeb10){try{jsonpatch[_0xda03('0x21')](_0x1eeb10,_0x4ad20c,!![]);}catch(_0x5219a5){return BPromise[_0xda03('0x22')](_0x5219a5);}return _0x1eeb10[_0xda03('0x23')]();};}function saveUpdates(_0x22e46c,_0x13b522){return function(_0x28d1b2){if(_0x28d1b2){return _0x28d1b2[_0xda03('0x24')](_0x22e46c)[_0xda03('0x25')](function(_0x32fa54){return _0x32fa54;});}return null;};}function removeEntity(_0x14bfd4,_0x34eb08){return function(_0x2254d3){if(_0x2254d3){return _0x2254d3['destroy']()[_0xda03('0x25')](function(){_0x14bfd4[_0xda03('0x1b')](0xcc)[_0xda03('0x1c')]();});}};}function handleEntityNotFound(_0x2fd55c,_0x4f912e){return function(_0xa42281){if(!_0xa42281){_0x2fd55c[_0xda03('0x1a')](0x194);}return _0xa42281;};}function handleError(_0x38dc5a,_0x1f9826){_0x1f9826=_0x1f9826||0x1f4;return function(_0x53fbb5){logger['error'](_0x53fbb5['stack']);if(_0x53fbb5[_0xda03('0x26')]){delete _0x53fbb5[_0xda03('0x26')];}_0x38dc5a[_0xda03('0x1b')](_0x1f9826)[_0xda03('0x27')](_0x53fbb5);};}exports[_0xda03('0x28')]=function(_0x101399,_0x34b953){var _0x28d0b2={},_0x1ed820={},_0x3dc176={'count':0x0,'rows':[]};var _0x2d2da7=_[_0xda03('0x29')](db[_0xda03('0x2a')]['rawAttributes'],function(_0x46f08e){return{'name':_0x46f08e['fieldName'],'type':_0x46f08e[_0xda03('0x2b')][_0xda03('0x2c')]};});_0x1ed820[_0xda03('0x2d')]=_[_0xda03('0x29')](_0x2d2da7,_0xda03('0x26'));_0x1ed820[_0xda03('0x2e')]=_[_0xda03('0x2f')](_0x101399[_0xda03('0x2e')]);_0x1ed820[_0xda03('0x30')]=_[_0xda03('0x31')](_0x1ed820[_0xda03('0x2d')],_0x1ed820[_0xda03('0x2e')]);_0x28d0b2[_0xda03('0x32')]=_[_0xda03('0x31')](_0x1ed820['model'],qs['fields'](_0x101399[_0xda03('0x2e')][_0xda03('0x33')]));_0x28d0b2[_0xda03('0x32')]=_0x28d0b2[_0xda03('0x32')][_0xda03('0x34')]?_0x28d0b2[_0xda03('0x32')]:_0x1ed820[_0xda03('0x2d')];if(!_0x101399[_0xda03('0x2e')][_0xda03('0x35')](_0xda03('0x36'))){_0x28d0b2[_0xda03('0x1f')]=qs[_0xda03('0x1f')](_0x101399[_0xda03('0x2e')][_0xda03('0x1f')]);_0x28d0b2[_0xda03('0x1d')]=qs[_0xda03('0x1d')](_0x101399['query'][_0xda03('0x1d')]);}_0x28d0b2[_0xda03('0x37')]=qs['sort'](_0x101399[_0xda03('0x2e')]['sort']);_0x28d0b2[_0xda03('0x38')]=qs['filters'](_[_0xda03('0x39')](_0x101399['query'],_0x1ed820[_0xda03('0x30')]),_0x2d2da7);if(_0x101399[_0xda03('0x2e')][_0xda03('0x3a')]){_0x28d0b2[_0xda03('0x38')]=_[_0xda03('0x3b')](_0x28d0b2[_0xda03('0x38')],{'$or':_[_0xda03('0x29')](_0x2d2da7,function(_0x1d8fdf){if(_0x1d8fdf[_0xda03('0x2b')]!==_0xda03('0x3c')){var _0x1e2634={};_0x1e2634[_0x1d8fdf[_0xda03('0x26')]]={'$like':'%'+_0x101399['query'][_0xda03('0x3a')]+'%'};return _0x1e2634;}})});}_0x28d0b2=_[_0xda03('0x3b')]({},_0x28d0b2,_0x101399['options']);var _0xdbbfe3={'where':_0x28d0b2['where']};return db[_0xda03('0x2a')][_0xda03('0x3d')](_0xdbbfe3)['then'](function(_0x18d8cb){_0x3dc176[_0xda03('0x3d')]=_0x18d8cb;if(_0x101399['query']['includeAll']){_0x28d0b2[_0xda03('0x3e')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xda03('0x3f')](_0x28d0b2);})[_0xda03('0x25')](function(_0x4e4fc6){_0x3dc176[_0xda03('0x40')]=_0x4e4fc6;return _0x3dc176;})[_0xda03('0x25')](respondWithFilteredResult(_0x34b953,_0x28d0b2))[_0xda03('0x41')](handleError(_0x34b953,null));};exports[_0xda03('0x42')]=function(_0x4fc857,_0x39cece){var _0x3a8351={'raw':![],'where':{'id':_0x4fc857['params']['id']}},_0x3dd412={};_0x3dd412['model']=_['keys'](db[_0xda03('0x2a')][_0xda03('0x43')]);_0x3dd412[_0xda03('0x2e')]=_['keys'](_0x4fc857[_0xda03('0x2e')]);_0x3dd412[_0xda03('0x30')]=_[_0xda03('0x31')](_0x3dd412[_0xda03('0x2d')],_0x3dd412[_0xda03('0x2e')]);_0x3a8351[_0xda03('0x32')]=_['intersection'](_0x3dd412[_0xda03('0x2d')],qs['fields'](_0x4fc857[_0xda03('0x2e')][_0xda03('0x33')]));_0x3a8351[_0xda03('0x32')]=_0x3a8351[_0xda03('0x32')][_0xda03('0x34')]?_0x3a8351[_0xda03('0x32')]:_0x3dd412[_0xda03('0x2d')];if(_0x4fc857[_0xda03('0x2e')][_0xda03('0x44')]){_0x3a8351['include']=[{'all':!![]}];}_0x3a8351=_[_0xda03('0x3b')]({},_0x3a8351,_0x4fc857[_0xda03('0x45')]);return db[_0xda03('0x2a')][_0xda03('0x46')](_0x3a8351)[_0xda03('0x25')](handleEntityNotFound(_0x39cece,null))[_0xda03('0x25')](respondWithResult(_0x39cece,null))[_0xda03('0x41')](handleError(_0x39cece,null));};exports[_0xda03('0x47')]=function(_0x9c8cea,_0x377c99){return db[_0xda03('0x2a')]['create'](_0x9c8cea[_0xda03('0x48')],{})[_0xda03('0x25')](respondWithResult(_0x377c99,0xc9))[_0xda03('0x41')](handleError(_0x377c99,null));};exports['update']=function(_0x25b391,_0x5ddb9c){if(_0x25b391[_0xda03('0x48')]['id']){delete _0x25b391['body']['id'];}return db[_0xda03('0x2a')][_0xda03('0x46')]({'where':{'id':_0x25b391['params']['id']}})['then'](handleEntityNotFound(_0x5ddb9c,null))[_0xda03('0x25')](saveUpdates(_0x25b391['body'],null))[_0xda03('0x25')](respondWithResult(_0x5ddb9c,null))[_0xda03('0x41')](handleError(_0x5ddb9c,null));};exports['destroy']=function(_0x52ed5d,_0x3b1505){return db[_0xda03('0x2a')][_0xda03('0x46')]({'where':{'id':_0x52ed5d[_0xda03('0x49')]['id']}})[_0xda03('0x25')](handleEntityNotFound(_0x3b1505,null))[_0xda03('0x25')](removeEntity(_0x3b1505,null))[_0xda03('0x41')](handleError(_0x3b1505,null));};exports[_0xda03('0x4a')]=function(_0x1c8f6c,_0x541110){return db['VoiceQueueReport']['describe']()[_0xda03('0x25')](respondWithResult(_0x541110,null))[_0xda03('0x41')](handleError(_0x541110,null));};exports[_0xda03('0x4b')]=function(_0x1b0a36,_0x4095d0){var _0x72a61f={},_0x308619={},_0x4a986d={'count':0x0,'rows':[]};_0x308619['model']=_[_0xda03('0x2f')](db[_0xda03('0x2a')][_0xda03('0x43')]);_0x308619[_0xda03('0x2e')]=_[_0xda03('0x2f')](_0x1b0a36[_0xda03('0x2e')]);_0x308619[_0xda03('0x30')]=_[_0xda03('0x31')](_0x308619[_0xda03('0x2d')],_0x308619[_0xda03('0x2e')]);_0x72a61f[_0xda03('0x32')]=_[_0xda03('0x31')](_0x308619['model'],qs['fields'](_0x1b0a36[_0xda03('0x2e')][_0xda03('0x33')]));_0x72a61f['attributes']=_0x72a61f['attributes'][_0xda03('0x34')]?_0x72a61f[_0xda03('0x32')]:_0x308619[_0xda03('0x2d')];if(!_0x1b0a36[_0xda03('0x2e')]['hasOwnProperty'](_0xda03('0x36'))){_0x72a61f[_0xda03('0x1f')]=qs['limit'](_0x1b0a36[_0xda03('0x2e')][_0xda03('0x1f')]);_0x72a61f[_0xda03('0x1d')]=qs[_0xda03('0x1d')](_0x1b0a36[_0xda03('0x2e')]['offset']);}_0x72a61f[_0xda03('0x37')]=qs[_0xda03('0x4c')](_0x1b0a36[_0xda03('0x2e')][_0xda03('0x4c')]);_0x72a61f[_0xda03('0x38')]=qs[_0xda03('0x30')](_[_0xda03('0x39')](_0x1b0a36[_0xda03('0x2e')],_0x308619[_0xda03('0x30')]));if(_0x1b0a36[_0xda03('0x2e')][_0xda03('0x3a')]){_0x72a61f[_0xda03('0x38')]=_[_0xda03('0x3b')](_0x72a61f[_0xda03('0x38')],{'$or':_[_0xda03('0x29')](_0x72a61f[_0xda03('0x32')],function(_0x54d92f){var _0x6da307={};_0x6da307[_0x54d92f]={'$like':'%'+_0x1b0a36[_0xda03('0x2e')]['filter']+'%'};return _0x6da307;})});}_0x72a61f=_[_0xda03('0x3b')]({},_0x72a61f,_0x1b0a36[_0xda03('0x45')]);var _0xbaadeb={'where':_0x72a61f[_0xda03('0x38')]};return db[_0xda03('0x2a')][_0xda03('0x3d')](_0xbaadeb)[_0xda03('0x25')](function(_0x23a583){_0x4a986d[_0xda03('0x3d')]=_0x23a583;if(_0x1b0a36[_0xda03('0x2e')]['includeAll']){_0x72a61f[_0xda03('0x3e')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xda03('0x3f')](_0x72a61f);})[_0xda03('0x25')](function(_0xf96d0d){_0x4a986d[_0xda03('0x40')]=_0xf96d0d;return _0x4a986d;})[_0xda03('0x25')](respondWithFilteredResult(_0x4095d0,_0x72a61f,_0xda03('0x4b')))['catch'](handleError(_0x4095d0,null,_0xda03('0x4b')));}; \ No newline at end of file +var _0x730e=['include','VoiceQueueReport','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll'];(function(_0x46db5d,_0x2a35e2){var _0x342e74=function(_0x534915){while(--_0x534915){_0x46db5d['push'](_0x46db5d['shift']());}};_0x342e74(++_0x2a35e2);}(_0x730e,0x64));var _0xe730=function(_0x1b05f4,_0x2a519a){_0x1b05f4=_0x1b05f4-0x0;var _0x16c8eb=_0x730e[_0x1b05f4];return _0x16c8eb;};'use strict';var emlformat=require(_0xe730('0x0'));var rimraf=require(_0xe730('0x1'));var zipdir=require(_0xe730('0x2'));var jsonpatch=require(_0xe730('0x3'));var rp=require('request-promise');var moment=require(_0xe730('0x4'));var BPromise=require(_0xe730('0x5'));var Mustache=require(_0xe730('0x6'));var util=require(_0xe730('0x7'));var path=require(_0xe730('0x8'));var sox=require(_0xe730('0x9'));var csv=require(_0xe730('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe730('0xb'));var _=require(_0xe730('0xc'));var squel=require(_0xe730('0xd'));var crypto=require('crypto');var jsforce=require(_0xe730('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe730('0xa'));var querystring=require(_0xe730('0xf'));var Papa=require(_0xe730('0x10'));var Redis=require(_0xe730('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe730('0x12'));var as=require(_0xe730('0x13'));var hardwareService=require(_0xe730('0x14'));var logger=require('../../config/logger')(_0xe730('0x15'));var utils=require(_0xe730('0x16'));var config=require(_0xe730('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe730('0x18'))['db'];config[_0xe730('0x19')]=_[_0xe730('0x1a')](config['redis'],{'host':_0xe730('0x1b'),'port':0x18eb});var socket=require(_0xe730('0x1c'))(new Redis(config[_0xe730('0x19')]));require(_0xe730('0x1d'))[_0xe730('0x1e')](socket);function respondWithStatusCode(_0x44bbd9,_0x48b74a){_0x48b74a=_0x48b74a||0xcc;return function(_0x383ca9){if(_0x383ca9){return _0x44bbd9[_0xe730('0x1f')](_0x48b74a);}return _0x44bbd9[_0xe730('0x20')](_0x48b74a)[_0xe730('0x21')]();};}function respondWithResult(_0x528d23,_0x445f0f){_0x445f0f=_0x445f0f||0xc8;return function(_0x53f516){if(_0x53f516){return _0x528d23[_0xe730('0x20')](_0x445f0f)[_0xe730('0x22')](_0x53f516);}};}function respondWithFilteredResult(_0x552c27,_0x4d9a43){return function(_0x242284){if(_0x242284){var _0x373820=typeof _0x4d9a43[_0xe730('0x23')]===_0xe730('0x24')&&typeof _0x4d9a43[_0xe730('0x25')]===_0xe730('0x24');var _0x3c7e27=_0x242284['count'];var _0x128498=_0x373820?0x0:_0x4d9a43['offset'];var _0x3aeae3=_0x373820?_0x242284[_0xe730('0x26')]:_0x4d9a43['offset']+_0x4d9a43[_0xe730('0x25')];var _0xeb5110;if(_0x3aeae3>=_0x3c7e27){_0x3aeae3=_0x3c7e27;_0xeb5110=0xc8;}else{_0xeb5110=0xce;}_0x552c27[_0xe730('0x20')](_0xeb5110);return _0x552c27[_0xe730('0x27')](_0xe730('0x28'),_0x128498+'-'+_0x3aeae3+'/'+_0x3c7e27)[_0xe730('0x22')](_0x242284);}return null;};}function patchUpdates(_0x3e9cbf){return function(_0x422041){try{jsonpatch[_0xe730('0x29')](_0x422041,_0x3e9cbf,!![]);}catch(_0x5bfb84){return BPromise[_0xe730('0x2a')](_0x5bfb84);}return _0x422041[_0xe730('0x2b')]();};}function saveUpdates(_0x26581b,_0x477ac1){return function(_0x29ca1f){if(_0x29ca1f){return _0x29ca1f[_0xe730('0x2c')](_0x26581b)[_0xe730('0x2d')](function(_0x2476b3){return _0x2476b3;});}return null;};}function removeEntity(_0x1f691b,_0x3b429c){return function(_0xf4bbc2){if(_0xf4bbc2){return _0xf4bbc2[_0xe730('0x2e')]()[_0xe730('0x2d')](function(){_0x1f691b[_0xe730('0x20')](0xcc)[_0xe730('0x21')]();});}};}function handleEntityNotFound(_0x720b04,_0x47b5df){return function(_0x3efe52){if(!_0x3efe52){_0x720b04[_0xe730('0x1f')](0x194);}return _0x3efe52;};}function handleError(_0x4d5de2,_0x4d638d){_0x4d638d=_0x4d638d||0x1f4;return function(_0x150741){logger[_0xe730('0x2f')](_0x150741['stack']);if(_0x150741[_0xe730('0x30')]){delete _0x150741[_0xe730('0x30')];}_0x4d5de2[_0xe730('0x20')](_0x4d638d)[_0xe730('0x31')](_0x150741);};}exports['index']=function(_0x42a589,_0x197a0c){var _0x26f1ae={},_0x19193d={},_0x4a0efb={'count':0x0,'rows':[]};var _0x114a53=_[_0xe730('0x32')](db['VoiceQueueReport']['rawAttributes'],function(_0x22a11b){return{'name':_0x22a11b['fieldName'],'type':_0x22a11b['type'][_0xe730('0x33')]};});_0x19193d['model']=_[_0xe730('0x32')](_0x114a53,_0xe730('0x30'));_0x19193d[_0xe730('0x34')]=_[_0xe730('0x35')](_0x42a589[_0xe730('0x34')]);_0x19193d[_0xe730('0x36')]=_[_0xe730('0x37')](_0x19193d[_0xe730('0x38')],_0x19193d[_0xe730('0x34')]);_0x26f1ae[_0xe730('0x39')]=_[_0xe730('0x37')](_0x19193d['model'],qs[_0xe730('0x3a')](_0x42a589[_0xe730('0x34')][_0xe730('0x3a')]));_0x26f1ae[_0xe730('0x39')]=_0x26f1ae[_0xe730('0x39')][_0xe730('0x3b')]?_0x26f1ae[_0xe730('0x39')]:_0x19193d['model'];if(!_0x42a589[_0xe730('0x34')][_0xe730('0x3c')]('nolimit')){_0x26f1ae['limit']=qs[_0xe730('0x25')](_0x42a589[_0xe730('0x34')]['limit']);_0x26f1ae[_0xe730('0x23')]=qs['offset'](_0x42a589[_0xe730('0x34')][_0xe730('0x23')]);}_0x26f1ae[_0xe730('0x3d')]=qs[_0xe730('0x3e')](_0x42a589['query']['sort']);_0x26f1ae[_0xe730('0x3f')]=qs['filters'](_[_0xe730('0x40')](_0x42a589[_0xe730('0x34')],_0x19193d[_0xe730('0x36')]),_0x114a53);if(_0x42a589[_0xe730('0x34')][_0xe730('0x41')]){_0x26f1ae[_0xe730('0x3f')]=_[_0xe730('0x42')](_0x26f1ae['where'],{'$or':_['map'](_0x114a53,function(_0x19c231){if(_0x19c231[_0xe730('0x43')]!==_0xe730('0x44')){var _0x41ded2={};_0x41ded2[_0x19c231[_0xe730('0x30')]]={'$like':'%'+_0x42a589[_0xe730('0x34')][_0xe730('0x41')]+'%'};return _0x41ded2;}})});}_0x26f1ae=_['merge']({},_0x26f1ae,_0x42a589['options']);var _0x57c99c={'where':_0x26f1ae[_0xe730('0x3f')]};return db['VoiceQueueReport'][_0xe730('0x26')](_0x57c99c)[_0xe730('0x2d')](function(_0x19e986){_0x4a0efb[_0xe730('0x26')]=_0x19e986;if(_0x42a589['query'][_0xe730('0x45')]){_0x26f1ae[_0xe730('0x46')]=[{'all':!![]}];}return db[_0xe730('0x47')][_0xe730('0x48')](_0x26f1ae);})[_0xe730('0x2d')](function(_0x1a4789){_0x4a0efb[_0xe730('0x49')]=_0x1a4789;return _0x4a0efb;})['then'](respondWithFilteredResult(_0x197a0c,_0x26f1ae))[_0xe730('0x4a')](handleError(_0x197a0c,null));};exports[_0xe730('0x4b')]=function(_0x3d2748,_0x7b5709){var _0x1af763={'raw':![],'where':{'id':_0x3d2748[_0xe730('0x4c')]['id']}},_0x1366c9={};_0x1366c9['model']=_[_0xe730('0x35')](db['VoiceQueueReport'][_0xe730('0x4d')]);_0x1366c9[_0xe730('0x34')]=_[_0xe730('0x35')](_0x3d2748[_0xe730('0x34')]);_0x1366c9['filters']=_[_0xe730('0x37')](_0x1366c9[_0xe730('0x38')],_0x1366c9[_0xe730('0x34')]);_0x1af763['attributes']=_[_0xe730('0x37')](_0x1366c9['model'],qs['fields'](_0x3d2748['query']['fields']));_0x1af763['attributes']=_0x1af763[_0xe730('0x39')][_0xe730('0x3b')]?_0x1af763['attributes']:_0x1366c9['model'];if(_0x3d2748[_0xe730('0x34')]['includeAll']){_0x1af763[_0xe730('0x46')]=[{'all':!![]}];}_0x1af763=_[_0xe730('0x42')]({},_0x1af763,_0x3d2748[_0xe730('0x4e')]);return db['VoiceQueueReport'][_0xe730('0x4f')](_0x1af763)[_0xe730('0x2d')](handleEntityNotFound(_0x7b5709,null))['then'](respondWithResult(_0x7b5709,null))[_0xe730('0x4a')](handleError(_0x7b5709,null));};exports['create']=function(_0x30261f,_0x58366f){return db[_0xe730('0x47')][_0xe730('0x50')](_0x30261f['body'],{})[_0xe730('0x2d')](respondWithResult(_0x58366f,0xc9))[_0xe730('0x4a')](handleError(_0x58366f,null));};exports[_0xe730('0x2c')]=function(_0x57028a,_0x2f46cc){if(_0x57028a['body']['id']){delete _0x57028a[_0xe730('0x51')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x57028a[_0xe730('0x4c')]['id']}})[_0xe730('0x2d')](handleEntityNotFound(_0x2f46cc,null))[_0xe730('0x2d')](saveUpdates(_0x57028a[_0xe730('0x51')],null))[_0xe730('0x2d')](respondWithResult(_0x2f46cc,null))[_0xe730('0x4a')](handleError(_0x2f46cc,null));};exports['destroy']=function(_0x311c90,_0x1a6eab){return db[_0xe730('0x47')][_0xe730('0x4f')]({'where':{'id':_0x311c90[_0xe730('0x4c')]['id']}})[_0xe730('0x2d')](handleEntityNotFound(_0x1a6eab,null))[_0xe730('0x2d')](removeEntity(_0x1a6eab,null))[_0xe730('0x4a')](handleError(_0x1a6eab,null));};exports['describe']=function(_0x3b0019,_0x34f282){return db[_0xe730('0x47')][_0xe730('0x52')]()[_0xe730('0x2d')](respondWithResult(_0x34f282,null))[_0xe730('0x4a')](handleError(_0x34f282,null));};exports[_0xe730('0x53')]=function(_0x22574a,_0x5b9f6f){var _0x1eb910={},_0x2b5402={},_0x1c519a={'count':0x0,'rows':[]};_0x2b5402[_0xe730('0x38')]=_[_0xe730('0x35')](db[_0xe730('0x47')][_0xe730('0x4d')]);_0x2b5402[_0xe730('0x34')]=_[_0xe730('0x35')](_0x22574a[_0xe730('0x34')]);_0x2b5402[_0xe730('0x36')]=_[_0xe730('0x37')](_0x2b5402[_0xe730('0x38')],_0x2b5402[_0xe730('0x34')]);_0x1eb910[_0xe730('0x39')]=_[_0xe730('0x37')](_0x2b5402[_0xe730('0x38')],qs['fields'](_0x22574a['query'][_0xe730('0x3a')]));_0x1eb910[_0xe730('0x39')]=_0x1eb910[_0xe730('0x39')][_0xe730('0x3b')]?_0x1eb910['attributes']:_0x2b5402[_0xe730('0x38')];if(!_0x22574a['query'][_0xe730('0x3c')](_0xe730('0x54'))){_0x1eb910['limit']=qs['limit'](_0x22574a[_0xe730('0x34')]['limit']);_0x1eb910[_0xe730('0x23')]=qs[_0xe730('0x23')](_0x22574a[_0xe730('0x34')][_0xe730('0x23')]);}_0x1eb910[_0xe730('0x3d')]=qs[_0xe730('0x3e')](_0x22574a[_0xe730('0x34')][_0xe730('0x3e')]);_0x1eb910[_0xe730('0x3f')]=qs[_0xe730('0x36')](_['pick'](_0x22574a[_0xe730('0x34')],_0x2b5402[_0xe730('0x36')]));if(_0x22574a['query'][_0xe730('0x41')]){_0x1eb910[_0xe730('0x3f')]=_[_0xe730('0x42')](_0x1eb910[_0xe730('0x3f')],{'$or':_[_0xe730('0x32')](_0x1eb910[_0xe730('0x39')],function(_0x4a6c00){var _0x3103f9={};_0x3103f9[_0x4a6c00]={'$like':'%'+_0x22574a['query'][_0xe730('0x41')]+'%'};return _0x3103f9;})});}_0x1eb910=_[_0xe730('0x42')]({},_0x1eb910,_0x22574a[_0xe730('0x4e')]);var _0x367eed={'where':_0x1eb910[_0xe730('0x3f')]};return db['VoiceQueueReport'][_0xe730('0x26')](_0x367eed)[_0xe730('0x2d')](function(_0x206400){_0x1c519a[_0xe730('0x26')]=_0x206400;if(_0x22574a[_0xe730('0x34')][_0xe730('0x45')]){_0x1eb910['include']=[{'all':!![]}];}return db[_0xe730('0x47')]['findAll'](_0x1eb910);})[_0xe730('0x2d')](function(_0x5e7946){_0x1c519a[_0xe730('0x49')]=_0x5e7946;return _0x1c519a;})[_0xe730('0x2d')](respondWithFilteredResult(_0x5b9f6f,_0x1eb910,'getVoiceQueuesReport'))[_0xe730('0x4a')](handleError(_0x5b9f6f,null,_0xe730('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 277531b..a63907c 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 _0xf68c=['../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xf68c,0x1ca));var _0xcf68=function(_0x5d109a,_0x1e314a){_0x5d109a=_0x5d109a-0x0;var _0x363d16=_0xf68c[_0x5d109a];return _0x363d16;};'use strict';var EventEmitter=require(_0xcf68('0x0'));var VoiceQueueReport=require(_0xcf68('0x1'))['db'][_0xcf68('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xcf68('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcf68('0x4'),'afterDestroy':_0xcf68('0x5')};function emitEvent(_0x1b3311){return function(_0x1bb7c7,_0x1a6346,_0x214b31){VoiceQueueReportEvents[_0xcf68('0x6')](_0x1b3311+':'+_0x1bb7c7['id'],_0x1bb7c7);VoiceQueueReportEvents['emit'](_0x1b3311,_0x1bb7c7);_0x214b31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xcf68('0x7')](e,emitEvent(event));}}module[_0xcf68('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x1673=['emit','hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','save','remove'];(function(_0x3ae9ce,_0x5bed25){var _0x54bad0=function(_0x2ae6fc){while(--_0x2ae6fc){_0x3ae9ce['push'](_0x3ae9ce['shift']());}};_0x54bad0(++_0x5bed25);}(_0x1673,0xf1));var _0x3167=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1673[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x3167('0x0'))['db'][_0x3167('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3167('0x2'),'afterUpdate':'update','afterDestroy':_0x3167('0x3')};function emitEvent(_0x1b0dbf){return function(_0x14bffc,_0x548998,_0x1dd814){VoiceQueueReportEvents[_0x3167('0x4')](_0x1b0dbf+':'+_0x14bffc['id'],_0x14bffc);VoiceQueueReportEvents[_0x3167('0x4')](_0x1b0dbf,_0x14bffc);_0x1dd814(null);};}for(var e in events){if(events[_0x3167('0x5')](e)){var event=events[e];VoiceQueueReport[_0x3167('0x6')](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 1d61f58..e3ea982 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 _0x3c5d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_queue','uniqueid','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c5d,0x82));var _0xd3c5=function(_0x36c752,_0x19c600){_0x36c752=_0x36c752-0x0;var _0x3fa2df=_0x3c5d[_0x36c752];return _0x3fa2df;};'use strict';var _=require('lodash');var util=require(_0xd3c5('0x0'));var logger=require('../../config/logger')(_0xd3c5('0x1'));var moment=require('moment');var BPromise=require(_0xd3c5('0x2'));var rp=require(_0xd3c5('0x3'));var fs=require('fs');var path=require(_0xd3c5('0x4'));var rimraf=require(_0xd3c5('0x5'));var config=require(_0xd3c5('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xd3c5('0x7')]=function(_0x493977,_0x3698e6){return _0x493977[_0xd3c5('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xd3c5('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd3c5('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xead3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x1f1219,_0x2eed3f){var _0x30bbce=function(_0xcb8b57){while(--_0xcb8b57){_0x1f1219['push'](_0x1f1219['shift']());}};_0x30bbce(++_0x2eed3f);}(_0xead3,0xd2));var _0x3ead=function(_0x43afbb,_0x448109){_0x43afbb=_0x43afbb-0x0;var _0xa9ddec=_0xead3[_0x43afbb];return _0xa9ddec;};'use strict';var _=require(_0x3ead('0x0'));var util=require(_0x3ead('0x1'));var logger=require(_0x3ead('0x2'))(_0x3ead('0x3'));var moment=require(_0x3ead('0x4'));var BPromise=require(_0x3ead('0x5'));var rp=require(_0x3ead('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ead('0x7'));var config=require(_0x3ead('0x8'));var attributes=require(_0x3ead('0x9'));module[_0x3ead('0xa')]=function(_0x3f924e,_0x26bf81){return _0x3f924e['define'](_0x3ead('0xb'),attributes,{'tableName':_0x3ead('0xc'),'paranoid':![],'indexes':[{'fields':[_0x3ead('0xd')]},{'fields':[_0x3ead('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index ba4bf8f..2f99004 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 _0x1453=['where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','map','model','include','debug','CreateVoiceQueueReport','create','raw','UpdateVoiceQueueReport','update','body'];(function(_0xf77a5,_0x1f23e8){var _0x5eda71=function(_0x4a43a0){while(--_0x4a43a0){_0xf77a5['push'](_0xf77a5['shift']());}};_0x5eda71(++_0x1f23e8);}(_0x1453,0x1d5));var _0x3145=function(_0x23e094,_0x47cafb){_0x23e094=_0x23e094-0x0;var _0x1ad9e7=_0x1453[_0x23e094];return _0x1ad9e7;};'use strict';var _=require(_0x3145('0x0'));var util=require(_0x3145('0x1'));var moment=require('moment');var BPromise=require(_0x3145('0x2'));var rs=require(_0x3145('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3145('0x4'))['db'];var utils=require(_0x3145('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3145('0x6'));var client=jayson[_0x3145('0x7')]['http']({'port':0x232a});config[_0x3145('0x8')]=_['defaults'](config[_0x3145('0x8')],{'host':_0x3145('0x9'),'port':0x18eb});var socket=require(_0x3145('0xa'))(new Redis(config['redis']));require(_0x3145('0xb'))[_0x3145('0xc')](socket);function respondWithRpcPromise(_0x5b02d9,_0x3249f4,_0x2a0f01){return new BPromise(function(_0x273e8a,_0x35634d){return client[_0x3145('0xd')](_0x5b02d9,_0x2a0f01)[_0x3145('0xe')](function(_0x432f57){logger['info'](_0x3145('0xf'),_0x3249f4,_0x3145('0x10'));logger['debug'](_0x3145('0x11'),_0x3249f4,_0x3145('0x10'),JSON['stringify'](_0x432f57));if(_0x432f57[_0x3145('0x12')]){if(_0x432f57[_0x3145('0x12')]['code']===0x1f4){logger[_0x3145('0x12')](_0x3145('0xf'),_0x3249f4,_0x432f57[_0x3145('0x12')][_0x3145('0x13')]);return _0x35634d(_0x432f57['error']['message']);}logger[_0x3145('0x12')](_0x3145('0xf'),_0x3249f4,_0x432f57['error']['message']);return _0x273e8a(_0x432f57[_0x3145('0x12')][_0x3145('0x13')]);}else{logger[_0x3145('0x14')](_0x3145('0xf'),_0x3249f4,_0x3145('0x10'));_0x273e8a(_0x432f57[_0x3145('0x15')][_0x3145('0x13')]);}})[_0x3145('0x16')](function(_0x24fb12){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3249f4,_0x24fb12);_0x35634d(_0x24fb12);});});}exports[_0x3145('0x17')]=function(_0x36bb8c){var _0x57656f=this;return new Promise(function(_0x114aa1,_0x4c0180){return db[_0x3145('0x18')][_0x3145('0x19')]({'raw':_0x36bb8c[_0x3145('0x1a')]?_0x36bb8c[_0x3145('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x36bb8c[_0x3145('0x1a')]?_0x36bb8c['options']['where']||null:null,'attributes':_0x36bb8c[_0x3145('0x1a')]?_0x36bb8c[_0x3145('0x1a')][_0x3145('0x1b')]||null:null,'limit':_0x36bb8c[_0x3145('0x1a')]?_0x36bb8c[_0x3145('0x1a')]['limit']||null:null,'include':_0x36bb8c[_0x3145('0x1a')]?_0x36bb8c['options']['include']?_[_0x3145('0x1c')](_0x36bb8c[_0x3145('0x1a')]['include'],function(_0x4ad019){return{'model':db[_0x4ad019[_0x3145('0x1d')]],'as':_0x4ad019['as'],'attributes':_0x4ad019[_0x3145('0x1b')],'include':_0x4ad019[_0x3145('0x1e')]?_['map'](_0x4ad019[_0x3145('0x1e')],function(_0x14ef41){return{'model':db[_0x14ef41[_0x3145('0x1d')]],'as':_0x14ef41['as'],'attributes':_0x14ef41[_0x3145('0x1b')],'include':_0x14ef41[_0x3145('0x1e')]?_[_0x3145('0x1c')](_0x14ef41[_0x3145('0x1e')],function(_0x257909){return{'model':db[_0x257909['model']],'as':_0x257909['as'],'attributes':_0x257909[_0x3145('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3145('0xe')](function(_0x44813d){logger['info']('GetVoiceQueueReport',_0x36bb8c);logger[_0x3145('0x1f')]('GetVoiceQueueReport',_0x36bb8c,JSON['stringify'](_0x44813d));_0x114aa1(_0x44813d);})['catch'](function(_0x1be2f3){logger['error'](_0x3145('0x17'),_0x1be2f3[_0x3145('0x13')],_0x36bb8c);_0x4c0180(_0x57656f['error'](0x1f4,_0x1be2f3[_0x3145('0x13')]));});});};exports[_0x3145('0x20')]=function(_0x43540c){var _0x5783d0=this;return new Promise(function(_0x470b2e,_0x26bf9e){return db[_0x3145('0x18')][_0x3145('0x21')](_0x43540c['body'],{'raw':_0x43540c[_0x3145('0x1a')]?_0x43540c[_0x3145('0x1a')][_0x3145('0x22')]===undefined?!![]:![]:!![]})[_0x3145('0xe')](function(_0x1aad2d){logger['info']('CreateVoiceQueueReport',_0x43540c);logger['debug'](_0x3145('0x20'),_0x43540c,JSON['stringify'](_0x1aad2d));_0x470b2e(_0x1aad2d);})[_0x3145('0x16')](function(_0xee56d){logger['error'](_0x3145('0x20'),_0xee56d[_0x3145('0x13')],_0x43540c);_0x26bf9e(_0x5783d0[_0x3145('0x12')](0x1f4,_0xee56d[_0x3145('0x13')]));});});};exports[_0x3145('0x23')]=function(_0x79e3c4){var _0x25a993=this;return new Promise(function(_0x134ab2,_0x14f181){return db[_0x3145('0x18')][_0x3145('0x24')](_0x79e3c4[_0x3145('0x25')],{'raw':_0x79e3c4[_0x3145('0x1a')]?_0x79e3c4['options'][_0x3145('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x79e3c4[_0x3145('0x1a')]?_0x79e3c4[_0x3145('0x1a')][_0x3145('0x26')]||null:null,'attributes':_0x79e3c4[_0x3145('0x1a')]?_0x79e3c4[_0x3145('0x1a')][_0x3145('0x1b')]||null:null,'limit':_0x79e3c4[_0x3145('0x1a')]?_0x79e3c4['options']['limit']||null:null})[_0x3145('0xe')](function(_0x5982d2){logger['info'](_0x3145('0x23'),_0x79e3c4);logger[_0x3145('0x1f')]('UpdateVoiceQueueReport',_0x79e3c4,JSON['stringify'](_0x5982d2));_0x134ab2(_0x5982d2);})[_0x3145('0x16')](function(_0xe7b974){logger[_0x3145('0x12')]('UpdateVoiceQueueReport',_0xe7b974['message'],_0x79e3c4);_0x14f181(_0x25a993['error'](0x1f4,_0xe7b974['message']));});});}; \ No newline at end of file +var _0xc395=['findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','VoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport'];(function(_0x552b03,_0x18622b){var _0x36334c=function(_0x2c006a){while(--_0x2c006a){_0x552b03['push'](_0x552b03['shift']());}};_0x36334c(++_0x18622b);}(_0xc395,0xf6));var _0x5c39=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc395[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x5c39('0x0'));var util=require(_0x5c39('0x1'));var moment=require(_0x5c39('0x2'));var BPromise=require(_0x5c39('0x3'));var rs=require(_0x5c39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c39('0x5'))['db'];var utils=require(_0x5c39('0x6'));var logger=require(_0x5c39('0x7'))(_0x5c39('0x8'));var config=require(_0x5c39('0x9'));var jayson=require(_0x5c39('0xa'));var client=jayson[_0x5c39('0xb')]['http']({'port':0x232a});config[_0x5c39('0xc')]=_[_0x5c39('0xd')](config['redis'],{'host':_0x5c39('0xe'),'port':0x18eb});var socket=require(_0x5c39('0xf'))(new Redis(config['redis']));require(_0x5c39('0x10'))[_0x5c39('0x11')](socket);function respondWithRpcPromise(_0x50414c,_0x571a2a,_0x2febea){return new BPromise(function(_0xb4d636,_0xb8610){return client[_0x5c39('0x12')](_0x50414c,_0x2febea)[_0x5c39('0x13')](function(_0x2ad8df){logger[_0x5c39('0x14')](_0x5c39('0x15'),_0x571a2a,_0x5c39('0x16'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x571a2a,_0x5c39('0x16'),JSON[_0x5c39('0x17')](_0x2ad8df));if(_0x2ad8df[_0x5c39('0x18')]){if(_0x2ad8df[_0x5c39('0x18')][_0x5c39('0x19')]===0x1f4){logger[_0x5c39('0x18')](_0x5c39('0x15'),_0x571a2a,_0x2ad8df[_0x5c39('0x18')][_0x5c39('0x1a')]);return _0xb8610(_0x2ad8df['error'][_0x5c39('0x1a')]);}logger[_0x5c39('0x18')](_0x5c39('0x15'),_0x571a2a,_0x2ad8df['error'][_0x5c39('0x1a')]);return _0xb4d636(_0x2ad8df[_0x5c39('0x18')][_0x5c39('0x1a')]);}else{logger[_0x5c39('0x14')](_0x5c39('0x15'),_0x571a2a,_0x5c39('0x16'));_0xb4d636(_0x2ad8df[_0x5c39('0x1b')]['message']);}})[_0x5c39('0x1c')](function(_0x235281){logger['error'](_0x5c39('0x15'),_0x571a2a,_0x235281);_0xb8610(_0x235281);});});}exports[_0x5c39('0x1d')]=function(_0x2c6bf9){var _0x47489a=this;return new Promise(function(_0x5e6233,_0xe074a4){return db['VoiceQueueReport'][_0x5c39('0x1e')]({'raw':_0x2c6bf9[_0x5c39('0x1f')]?_0x2c6bf9[_0x5c39('0x1f')][_0x5c39('0x20')]===undefined?!![]:![]:!![],'where':_0x2c6bf9[_0x5c39('0x1f')]?_0x2c6bf9['options'][_0x5c39('0x21')]||null:null,'attributes':_0x2c6bf9[_0x5c39('0x1f')]?_0x2c6bf9[_0x5c39('0x1f')][_0x5c39('0x22')]||null:null,'limit':_0x2c6bf9[_0x5c39('0x1f')]?_0x2c6bf9['options'][_0x5c39('0x23')]||null:null,'include':_0x2c6bf9[_0x5c39('0x1f')]?_0x2c6bf9[_0x5c39('0x1f')][_0x5c39('0x24')]?_['map'](_0x2c6bf9['options'][_0x5c39('0x24')],function(_0x236ea1){return{'model':db[_0x236ea1['model']],'as':_0x236ea1['as'],'attributes':_0x236ea1[_0x5c39('0x22')],'include':_0x236ea1[_0x5c39('0x24')]?_[_0x5c39('0x25')](_0x236ea1['include'],function(_0x3888af){return{'model':db[_0x3888af[_0x5c39('0x26')]],'as':_0x3888af['as'],'attributes':_0x3888af[_0x5c39('0x22')],'include':_0x3888af[_0x5c39('0x24')]?_['map'](_0x3888af[_0x5c39('0x24')],function(_0x331eb8){return{'model':db[_0x331eb8[_0x5c39('0x26')]],'as':_0x331eb8['as'],'attributes':_0x331eb8[_0x5c39('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39653c){logger[_0x5c39('0x14')](_0x5c39('0x1d'),_0x2c6bf9);logger[_0x5c39('0x27')]('GetVoiceQueueReport',_0x2c6bf9,JSON[_0x5c39('0x17')](_0x39653c));_0x5e6233(_0x39653c);})[_0x5c39('0x1c')](function(_0x1541bc){logger['error'](_0x5c39('0x1d'),_0x1541bc[_0x5c39('0x1a')],_0x2c6bf9);_0xe074a4(_0x47489a[_0x5c39('0x18')](0x1f4,_0x1541bc[_0x5c39('0x1a')]));});});};exports[_0x5c39('0x28')]=function(_0x12f39a){var _0x1c2deb=this;return new Promise(function(_0x491dd6,_0x4969c6){return db['VoiceQueueReport'][_0x5c39('0x29')](_0x12f39a[_0x5c39('0x2a')],{'raw':_0x12f39a[_0x5c39('0x1f')]?_0x12f39a[_0x5c39('0x1f')][_0x5c39('0x20')]===undefined?!![]:![]:!![]})[_0x5c39('0x13')](function(_0x1e49ce){logger[_0x5c39('0x14')](_0x5c39('0x28'),_0x12f39a);logger[_0x5c39('0x27')](_0x5c39('0x28'),_0x12f39a,JSON[_0x5c39('0x17')](_0x1e49ce));_0x491dd6(_0x1e49ce);})[_0x5c39('0x1c')](function(_0x2c2651){logger[_0x5c39('0x18')](_0x5c39('0x28'),_0x2c2651[_0x5c39('0x1a')],_0x12f39a);_0x4969c6(_0x1c2deb['error'](0x1f4,_0x2c2651[_0x5c39('0x1a')]));});});};exports[_0x5c39('0x2b')]=function(_0x274d7a){var _0x22c288=this;return new Promise(function(_0x1a13b7,_0x402a83){return db[_0x5c39('0x2c')][_0x5c39('0x2d')](_0x274d7a[_0x5c39('0x2a')],{'raw':_0x274d7a['options']?_0x274d7a[_0x5c39('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274d7a[_0x5c39('0x1f')]?_0x274d7a[_0x5c39('0x1f')][_0x5c39('0x21')]||null:null,'attributes':_0x274d7a[_0x5c39('0x1f')]?_0x274d7a['options'][_0x5c39('0x22')]||null:null,'limit':_0x274d7a[_0x5c39('0x1f')]?_0x274d7a[_0x5c39('0x1f')][_0x5c39('0x23')]||null:null})[_0x5c39('0x13')](function(_0x352bd9){logger[_0x5c39('0x14')]('UpdateVoiceQueueReport',_0x274d7a);logger['debug'](_0x5c39('0x2b'),_0x274d7a,JSON['stringify'](_0x352bd9));_0x1a13b7(_0x352bd9);})[_0x5c39('0x1c')](function(_0x1b4060){logger[_0x5c39('0x18')](_0x5c39('0x2b'),_0x1b4060['message'],_0x274d7a);_0x402a83(_0x22c288[_0x5c39('0x18')](0x1f4,_0x1b4060[_0x5c39('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f73f319..ba9e649 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 _0xc4f5=['emit','register','length','save','remove','update'];(function(_0x2c2f35,_0x20cda1){var _0x543b7e=function(_0x3d66b9){while(--_0x3d66b9){_0x2c2f35['push'](_0x2c2f35['shift']());}};_0x543b7e(++_0x20cda1);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xc4f5[_0x1526e1];return _0x249a1e;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x5c4f('0x0'),_0x5c4f('0x1'),_0x5c4f('0x2')];function createListener(_0x515f4c,_0x11c151){return function(_0x221555){_0x11c151[_0x5c4f('0x3')](_0x515f4c,_0x221555);};}function removeListener(_0xfd69b2,_0x2676f7){return function(){VoiceQueueReportEvents['removeListener'](_0xfd69b2,_0x2676f7);};}exports[_0x5c4f('0x4')]=function(_0x299b8b){for(var _0x3fd7bb=0x0,_0x123651=events[_0x5c4f('0x5')];_0x3fd7bb<_0x123651;_0x3fd7bb++){var _0x48f095=events[_0x3fd7bb];var _0x1ec0c8=createListener('voiceQueueReport:'+_0x48f095,_0x299b8b);VoiceQueueReportEvents['on'](_0x48f095,_0x1ec0c8);}}; \ No newline at end of file +var _0x8d37=['remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8d37,0xbc));var _0x78d3=function(_0x503c02,_0x35bb83){_0x503c02=_0x503c02-0x0;var _0x467648=_0x8d37[_0x503c02];return _0x467648;};'use strict';var VoiceQueueReportEvents=require(_0x78d3('0x0'));var events=['save',_0x78d3('0x1'),_0x78d3('0x2')];function createListener(_0xab73ac,_0x2e4525){return function(_0x27aeab){_0x2e4525[_0x78d3('0x3')](_0xab73ac,_0x27aeab);};}function removeListener(_0x17130e,_0x524ca0){return function(){VoiceQueueReportEvents[_0x78d3('0x4')](_0x17130e,_0x524ca0);};}exports[_0x78d3('0x5')]=function(_0x5da972){for(var _0x114e2e=0x0,_0x22de5a=events['length'];_0x114e2e<_0x22de5a;_0x114e2e++){var _0x2a4b3c=events[_0x114e2e];var _0x41c2a4=createListener(_0x78d3('0x6')+_0x2a4b3c,_0x5da972);VoiceQueueReportEvents['on'](_0x2a4b3c,_0x41c2a4);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index a711d54..ead4c79 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 _0x6b98=['index','get','/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','isAuthenticated'];(function(_0x5d6208,_0x19c6de){var _0x11119b=function(_0x2eba64){while(--_0x2eba64){_0x5d6208['push'](_0x5d6208['shift']());}};_0x11119b(++_0x19c6de);}(_0x6b98,0x13a));var _0x86b9=function(_0x505df9,_0x14138e){_0x505df9=_0x505df9-0x0;var _0x1cc025=_0x6b98[_0x505df9];return _0x1cc025;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x86b9('0x0'));var timeout=require(_0x86b9('0x1'));var express=require(_0x86b9('0x2'));var router=express[_0x86b9('0x3')]();var fs_extra=require(_0x86b9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x86b9('0x5')](),controller[_0x86b9('0x6')]);router[_0x86b9('0x7')](_0x86b9('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x86b9('0x9')]('/',auth[_0x86b9('0x5')](),controller[_0x86b9('0xa')]);router[_0x86b9('0xb')](_0x86b9('0x8'),auth['isAuthenticated'](),controller[_0x86b9('0xc')]);router[_0x86b9('0xd')](_0x86b9('0x8'),auth[_0x86b9('0x5')](),controller[_0x86b9('0xe')]);module[_0x86b9('0xf')]=router; \ No newline at end of file +var _0xcdd0=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xcdd0[_0x4d07cc];return _0x42de3b;};'use strict';var multer=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var path=require(_0x0cdd('0x2'));var timeout=require(_0x0cdd('0x3'));var express=require('express');var router=express[_0x0cdd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0cdd('0x5'));var config=require('../../config/environment');var controller=require(_0x0cdd('0x6'));router[_0x0cdd('0x7')]('/',auth[_0x0cdd('0x8')](),controller['index']);router[_0x0cdd('0x7')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xa')]);router[_0x0cdd('0xb')]('/',auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xc')]);router[_0x0cdd('0xd')](_0x0cdd('0x9'),auth[_0x0cdd('0x8')](),controller[_0x0cdd('0xe')]);router[_0x0cdd('0xf')](_0x0cdd('0x9'),auth['isAuthenticated'](),controller[_0x0cdd('0x10')]);module[_0x0cdd('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 9027cb0..68ffbb2 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 _0xdc9e=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xdc9e,0x76));var _0xedc9=function(_0x228a35,_0x533e42){_0x228a35=_0x228a35-0x0;var _0x2fa3c2=_0xdc9e[_0x228a35];return _0x2fa3c2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xedc9('0x0'));module[_0xedc9('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xedc9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xedc9('0x3')],'allowNull':![],'defaultValue':moment()[_0xedc9('0x4')](_0xedc9('0x5'))}}; \ No newline at end of file +var _0x3102=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','exports'];(function(_0x35d0dc,_0x52cfb6){var _0x2b77a3=function(_0xbd910b){while(--_0xbd910b){_0x35d0dc['push'](_0x35d0dc['shift']());}};_0x2b77a3(++_0x52cfb6);}(_0x3102,0x83));var _0x2310=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3102[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2310('0x0')]={'time':{'type':Sequelize[_0x2310('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2310('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2310('0x2')],'allowNull':![],'defaultValue':moment()['format'](_0x2310('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3300e8f..83ea79f 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 _0x320c=['fields','length','attributes','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','VoiceQueuesLog','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x320c,0x139));var _0xc320=function(_0x2a4e33,_0x1b0527){_0x2a4e33=_0x2a4e33-0x0;var _0xf7e3da=_0x320c[_0x2a4e33];return _0xf7e3da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc320('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc320('0x1'));var rp=require('request-promise');var moment=require(_0xc320('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc320('0x3'));var util=require(_0xc320('0x4'));var path=require(_0xc320('0x5'));var sox=require(_0xc320('0x6'));var csv=require(_0xc320('0x7'));var ejs=require(_0xc320('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc320('0x9'));var jsforce=require(_0xc320('0xa'));var deskjs=require(_0xc320('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc320('0xc'));var Papa=require('papaparse');var Redis=require(_0xc320('0xd'));var authService=require(_0xc320('0xe'));var qs=require(_0xc320('0xf'));var as=require(_0xc320('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc320('0x11'))(_0xc320('0x12'));var utils=require(_0xc320('0x13'));var config=require(_0xc320('0x14'));var licenseUtil=require(_0xc320('0x15'));var db=require(_0xc320('0x16'))['db'];function respondWithStatusCode(_0x3e29f0,_0xd6078d){_0xd6078d=_0xd6078d||0xcc;return function(_0x315866){if(_0x315866){return _0x3e29f0[_0xc320('0x17')](_0xd6078d);}return _0x3e29f0[_0xc320('0x18')](_0xd6078d)['end']();};}function respondWithResult(_0x3d0625,_0x5a6be5){_0x5a6be5=_0x5a6be5||0xc8;return function(_0x3e63d4){if(_0x3e63d4){return _0x3d0625['status'](_0x5a6be5)['json'](_0x3e63d4);}};}function respondWithFilteredResult(_0xe8f504,_0x48a0af){return function(_0xfa28bc){if(_0xfa28bc){var _0x53e809=typeof _0x48a0af[_0xc320('0x19')]==='undefined'&&typeof _0x48a0af[_0xc320('0x1a')]===_0xc320('0x1b');var _0xd6fdcf=_0xfa28bc[_0xc320('0x1c')];var _0x4048a3=_0x53e809?0x0:_0x48a0af['offset'];var _0x3b892a=_0x53e809?_0xfa28bc[_0xc320('0x1c')]:_0x48a0af[_0xc320('0x19')]+_0x48a0af[_0xc320('0x1a')];var _0x5889b2;if(_0x3b892a>=_0xd6fdcf){_0x3b892a=_0xd6fdcf;_0x5889b2=0xc8;}else{_0x5889b2=0xce;}_0xe8f504['status'](_0x5889b2);return _0xe8f504[_0xc320('0x1d')](_0xc320('0x1e'),_0x4048a3+'-'+_0x3b892a+'/'+_0xd6fdcf)[_0xc320('0x1f')](_0xfa28bc);}return null;};}function patchUpdates(_0x4e5591){return function(_0xfd163b){try{jsonpatch[_0xc320('0x20')](_0xfd163b,_0x4e5591,!![]);}catch(_0x23cda2){return BPromise[_0xc320('0x21')](_0x23cda2);}return _0xfd163b[_0xc320('0x22')]();};}function saveUpdates(_0x32040b,_0x1eff52){return function(_0x5d8abf){if(_0x5d8abf){return _0x5d8abf[_0xc320('0x23')](_0x32040b)[_0xc320('0x24')](function(_0x5bf1bc){return _0x5bf1bc;});}return null;};}function removeEntity(_0x594953,_0x265ba6){return function(_0x178dee){if(_0x178dee){return _0x178dee[_0xc320('0x25')]()[_0xc320('0x24')](function(){_0x594953[_0xc320('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x298369,_0x301bba){return function(_0x391b25){if(!_0x391b25){_0x298369[_0xc320('0x17')](0x194);}return _0x391b25;};}function handleError(_0xa0cd2e,_0x2631f6){_0x2631f6=_0x2631f6||0x1f4;return function(_0x156387){logger[_0xc320('0x26')](_0x156387['stack']);if(_0x156387[_0xc320('0x27')]){delete _0x156387[_0xc320('0x27')];}_0xa0cd2e['status'](_0x2631f6)[_0xc320('0x28')](_0x156387);};}exports[_0xc320('0x29')]=function(_0x4bded9,_0x154596){var _0x21f439={},_0x36369c={},_0x4629f6={'count':0x0,'rows':[]};var _0x576f79=_['map'](db[_0xc320('0x2a')]['rawAttributes'],function(_0x2f6143){return{'name':_0x2f6143[_0xc320('0x2b')],'type':_0x2f6143[_0xc320('0x2c')][_0xc320('0x2d')]};});_0x36369c[_0xc320('0x2e')]=_[_0xc320('0x2f')](_0x576f79,_0xc320('0x27'));_0x36369c[_0xc320('0x30')]=_[_0xc320('0x31')](_0x4bded9[_0xc320('0x30')]);_0x36369c[_0xc320('0x32')]=_[_0xc320('0x33')](_0x36369c['model'],_0x36369c[_0xc320('0x30')]);_0x21f439['attributes']=_['intersection'](_0x36369c[_0xc320('0x2e')],qs[_0xc320('0x34')](_0x4bded9[_0xc320('0x30')][_0xc320('0x34')]));_0x21f439['attributes']=_0x21f439['attributes'][_0xc320('0x35')]?_0x21f439[_0xc320('0x36')]:_0x36369c['model'];if(!_0x4bded9[_0xc320('0x30')]['hasOwnProperty'](_0xc320('0x37'))){_0x21f439[_0xc320('0x1a')]=qs[_0xc320('0x1a')](_0x4bded9[_0xc320('0x30')][_0xc320('0x1a')]);_0x21f439['offset']=qs[_0xc320('0x19')](_0x4bded9[_0xc320('0x30')][_0xc320('0x19')]);}_0x21f439[_0xc320('0x38')]=qs[_0xc320('0x39')](_0x4bded9[_0xc320('0x30')][_0xc320('0x39')]);_0x21f439['where']=qs[_0xc320('0x32')](_[_0xc320('0x3a')](_0x4bded9[_0xc320('0x30')],_0x36369c[_0xc320('0x32')]),_0x576f79);if(_0x4bded9[_0xc320('0x30')]['filter']){_0x21f439[_0xc320('0x3b')]=_[_0xc320('0x3c')](_0x21f439[_0xc320('0x3b')],{'$or':_['map'](_0x576f79,function(_0x72cd8d){if(_0x72cd8d[_0xc320('0x2c')]!=='VIRTUAL'){var _0x3a8922={};_0x3a8922[_0x72cd8d[_0xc320('0x27')]]={'$like':'%'+_0x4bded9[_0xc320('0x30')][_0xc320('0x3d')]+'%'};return _0x3a8922;}})});}_0x21f439=_['merge']({},_0x21f439,_0x4bded9[_0xc320('0x3e')]);var _0x2593c1={'where':_0x21f439['where']};return db[_0xc320('0x2a')]['count'](_0x2593c1)[_0xc320('0x24')](function(_0x4b1ce3){_0x4629f6[_0xc320('0x1c')]=_0x4b1ce3;if(_0x4bded9[_0xc320('0x30')][_0xc320('0x3f')]){_0x21f439[_0xc320('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xc320('0x41')](_0x21f439);})['then'](function(_0x4dee6c){_0x4629f6[_0xc320('0x42')]=_0x4dee6c;return _0x4629f6;})[_0xc320('0x24')](respondWithFilteredResult(_0x154596,_0x21f439))[_0xc320('0x43')](handleError(_0x154596,null));};exports['show']=function(_0x3dbc29,_0x2b21cb){var _0x5522ec={'raw':!![],'where':{'id':_0x3dbc29[_0xc320('0x44')]['id']}},_0x4ea769={};_0x4ea769['model']=_[_0xc320('0x31')](db[_0xc320('0x2a')][_0xc320('0x45')]);_0x4ea769[_0xc320('0x30')]=_[_0xc320('0x31')](_0x3dbc29[_0xc320('0x30')]);_0x4ea769[_0xc320('0x32')]=_['intersection'](_0x4ea769[_0xc320('0x2e')],_0x4ea769['query']);_0x5522ec[_0xc320('0x36')]=_[_0xc320('0x33')](_0x4ea769[_0xc320('0x2e')],qs[_0xc320('0x34')](_0x3dbc29[_0xc320('0x30')]['fields']));_0x5522ec[_0xc320('0x36')]=_0x5522ec[_0xc320('0x36')]['length']?_0x5522ec[_0xc320('0x36')]:_0x4ea769['model'];if(_0x3dbc29[_0xc320('0x30')][_0xc320('0x3f')]){_0x5522ec[_0xc320('0x40')]=[{'all':!![]}];}_0x5522ec=_[_0xc320('0x3c')]({},_0x5522ec,_0x3dbc29['options']);return db[_0xc320('0x2a')]['find'](_0x5522ec)[_0xc320('0x24')](handleEntityNotFound(_0x2b21cb,null))[_0xc320('0x24')](respondWithResult(_0x2b21cb,null))[_0xc320('0x43')](handleError(_0x2b21cb,null));};exports['create']=function(_0x1cd1d7,_0x343f20){return db['VoiceQueuesLog'][_0xc320('0x46')](_0x1cd1d7['body'],{})[_0xc320('0x24')](respondWithResult(_0x343f20,0xc9))[_0xc320('0x43')](handleError(_0x343f20,null));};exports[_0xc320('0x23')]=function(_0x598038,_0x2753e0){if(_0x598038[_0xc320('0x47')]['id']){delete _0x598038[_0xc320('0x47')]['id'];}return db[_0xc320('0x2a')][_0xc320('0x48')]({'where':{'id':_0x598038['params']['id']}})['then'](handleEntityNotFound(_0x2753e0,null))[_0xc320('0x24')](saveUpdates(_0x598038[_0xc320('0x47')],null))['then'](respondWithResult(_0x2753e0,null))['catch'](handleError(_0x2753e0,null));};exports[_0xc320('0x25')]=function(_0x40e153,_0x2b24b7){return db[_0xc320('0x2a')]['find']({'where':{'id':_0x40e153[_0xc320('0x44')]['id']}})[_0xc320('0x24')](handleEntityNotFound(_0x2b24b7,null))['then'](removeEntity(_0x2b24b7,null))['catch'](handleError(_0x2b24b7,null));}; \ No newline at end of file +var _0xdb1e=['then','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x9ae07c,_0x4cba11){var _0x837b1f=function(_0x4f30a7){while(--_0x4f30a7){_0x9ae07c['push'](_0x9ae07c['shift']());}};_0x837b1f(++_0x4cba11);}(_0xdb1e,0x102));var _0xedb1=function(_0xb912db,_0x5dfdcb){_0xb912db=_0xb912db-0x0;var _0x2aebc2=_0xdb1e[_0xb912db];return _0x2aebc2;};'use strict';var emlformat=require(_0xedb1('0x0'));var rimraf=require(_0xedb1('0x1'));var zipdir=require(_0xedb1('0x2'));var jsonpatch=require(_0xedb1('0x3'));var rp=require(_0xedb1('0x4'));var moment=require(_0xedb1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xedb1('0x6'));var path=require('path');var sox=require(_0xedb1('0x7'));var csv=require('to-csv');var ejs=require(_0xedb1('0x8'));var fs=require('fs');var fs_extra=require(_0xedb1('0x9'));var _=require(_0xedb1('0xa'));var squel=require('squel');var crypto=require(_0xedb1('0xb'));var jsforce=require(_0xedb1('0xc'));var deskjs=require(_0xedb1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xedb1('0xe'));var Papa=require(_0xedb1('0xf'));var Redis=require(_0xedb1('0x10'));var authService=require(_0xedb1('0x11'));var qs=require(_0xedb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xedb1('0x13'))(_0xedb1('0x14'));var utils=require(_0xedb1('0x15'));var config=require(_0xedb1('0x16'));var licenseUtil=require(_0xedb1('0x17'));var db=require(_0xedb1('0x18'))['db'];function respondWithStatusCode(_0x49ab6c,_0x253ee7){_0x253ee7=_0x253ee7||0xcc;return function(_0x117d78){if(_0x117d78){return _0x49ab6c[_0xedb1('0x19')](_0x253ee7);}return _0x49ab6c[_0xedb1('0x1a')](_0x253ee7)[_0xedb1('0x1b')]();};}function respondWithResult(_0x59d39d,_0x3fa835){_0x3fa835=_0x3fa835||0xc8;return function(_0x552bf1){if(_0x552bf1){return _0x59d39d['status'](_0x3fa835)[_0xedb1('0x1c')](_0x552bf1);}};}function respondWithFilteredResult(_0x266ce3,_0x4bf398){return function(_0xa37dc9){if(_0xa37dc9){var _0x4ed491=typeof _0x4bf398[_0xedb1('0x1d')]===_0xedb1('0x1e')&&typeof _0x4bf398[_0xedb1('0x1f')]===_0xedb1('0x1e');var _0x392755=_0xa37dc9[_0xedb1('0x20')];var _0x1282fb=_0x4ed491?0x0:_0x4bf398['offset'];var _0x4a7cba=_0x4ed491?_0xa37dc9[_0xedb1('0x20')]:_0x4bf398[_0xedb1('0x1d')]+_0x4bf398[_0xedb1('0x1f')];var _0x448618;if(_0x4a7cba>=_0x392755){_0x4a7cba=_0x392755;_0x448618=0xc8;}else{_0x448618=0xce;}_0x266ce3[_0xedb1('0x1a')](_0x448618);return _0x266ce3[_0xedb1('0x21')](_0xedb1('0x22'),_0x1282fb+'-'+_0x4a7cba+'/'+_0x392755)[_0xedb1('0x1c')](_0xa37dc9);}return null;};}function patchUpdates(_0x325662){return function(_0x36d537){try{jsonpatch[_0xedb1('0x23')](_0x36d537,_0x325662,!![]);}catch(_0x1a6ec4){return BPromise['reject'](_0x1a6ec4);}return _0x36d537[_0xedb1('0x24')]();};}function saveUpdates(_0x1364e4,_0x8e2707){return function(_0x9aa543){if(_0x9aa543){return _0x9aa543[_0xedb1('0x25')](_0x1364e4)[_0xedb1('0x26')](function(_0x235c48){return _0x235c48;});}return null;};}function removeEntity(_0x4550ff,_0x4d72c9){return function(_0x491753){if(_0x491753){return _0x491753['destroy']()[_0xedb1('0x26')](function(){_0x4550ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x189f8d,_0x45143c){return function(_0x163725){if(!_0x163725){_0x189f8d[_0xedb1('0x19')](0x194);}return _0x163725;};}function handleError(_0x2c8b85,_0x4036f0){_0x4036f0=_0x4036f0||0x1f4;return function(_0xe08255){logger['error'](_0xe08255['stack']);if(_0xe08255['name']){delete _0xe08255['name'];}_0x2c8b85[_0xedb1('0x1a')](_0x4036f0)[_0xedb1('0x27')](_0xe08255);};}exports[_0xedb1('0x28')]=function(_0x2c62ab,_0x1f217f){var _0x4f9c56={},_0x346544={},_0xad5131={'count':0x0,'rows':[]};var _0x36f40f=_['map'](db[_0xedb1('0x29')][_0xedb1('0x2a')],function(_0x4f9ad0){return{'name':_0x4f9ad0[_0xedb1('0x2b')],'type':_0x4f9ad0[_0xedb1('0x2c')][_0xedb1('0x2d')]};});_0x346544[_0xedb1('0x2e')]=_['map'](_0x36f40f,_0xedb1('0x2f'));_0x346544[_0xedb1('0x30')]=_[_0xedb1('0x31')](_0x2c62ab['query']);_0x346544[_0xedb1('0x32')]=_[_0xedb1('0x33')](_0x346544[_0xedb1('0x2e')],_0x346544[_0xedb1('0x30')]);_0x4f9c56['attributes']=_[_0xedb1('0x33')](_0x346544[_0xedb1('0x2e')],qs[_0xedb1('0x34')](_0x2c62ab['query'][_0xedb1('0x34')]));_0x4f9c56[_0xedb1('0x35')]=_0x4f9c56[_0xedb1('0x35')]['length']?_0x4f9c56[_0xedb1('0x35')]:_0x346544['model'];if(!_0x2c62ab['query'][_0xedb1('0x36')](_0xedb1('0x37'))){_0x4f9c56['limit']=qs[_0xedb1('0x1f')](_0x2c62ab[_0xedb1('0x30')]['limit']);_0x4f9c56[_0xedb1('0x1d')]=qs[_0xedb1('0x1d')](_0x2c62ab[_0xedb1('0x30')]['offset']);}_0x4f9c56[_0xedb1('0x38')]=qs[_0xedb1('0x39')](_0x2c62ab[_0xedb1('0x30')][_0xedb1('0x39')]);_0x4f9c56[_0xedb1('0x3a')]=qs[_0xedb1('0x32')](_[_0xedb1('0x3b')](_0x2c62ab[_0xedb1('0x30')],_0x346544[_0xedb1('0x32')]),_0x36f40f);if(_0x2c62ab['query'][_0xedb1('0x3c')]){_0x4f9c56['where']=_['merge'](_0x4f9c56['where'],{'$or':_['map'](_0x36f40f,function(_0x1ebc74){if(_0x1ebc74[_0xedb1('0x2c')]!==_0xedb1('0x3d')){var _0x13b491={};_0x13b491[_0x1ebc74[_0xedb1('0x2f')]]={'$like':'%'+_0x2c62ab['query'][_0xedb1('0x3c')]+'%'};return _0x13b491;}})});}_0x4f9c56=_[_0xedb1('0x3e')]({},_0x4f9c56,_0x2c62ab[_0xedb1('0x3f')]);var _0x47539a={'where':_0x4f9c56[_0xedb1('0x3a')]};return db['VoiceQueuesLog'][_0xedb1('0x20')](_0x47539a)['then'](function(_0x572713){_0xad5131[_0xedb1('0x20')]=_0x572713;if(_0x2c62ab[_0xedb1('0x30')][_0xedb1('0x40')]){_0x4f9c56[_0xedb1('0x41')]=[{'all':!![]}];}return db[_0xedb1('0x29')][_0xedb1('0x42')](_0x4f9c56);})[_0xedb1('0x26')](function(_0x21fd4e){_0xad5131[_0xedb1('0x43')]=_0x21fd4e;return _0xad5131;})[_0xedb1('0x26')](respondWithFilteredResult(_0x1f217f,_0x4f9c56))[_0xedb1('0x44')](handleError(_0x1f217f,null));};exports['show']=function(_0xf961cd,_0x822f49){var _0x2c609b={'raw':!![],'where':{'id':_0xf961cd[_0xedb1('0x45')]['id']}},_0x4cf487={};_0x4cf487[_0xedb1('0x2e')]=_[_0xedb1('0x31')](db[_0xedb1('0x29')][_0xedb1('0x2a')]);_0x4cf487[_0xedb1('0x30')]=_['keys'](_0xf961cd[_0xedb1('0x30')]);_0x4cf487['filters']=_[_0xedb1('0x33')](_0x4cf487[_0xedb1('0x2e')],_0x4cf487[_0xedb1('0x30')]);_0x2c609b[_0xedb1('0x35')]=_[_0xedb1('0x33')](_0x4cf487[_0xedb1('0x2e')],qs['fields'](_0xf961cd[_0xedb1('0x30')][_0xedb1('0x34')]));_0x2c609b['attributes']=_0x2c609b[_0xedb1('0x35')]['length']?_0x2c609b[_0xedb1('0x35')]:_0x4cf487[_0xedb1('0x2e')];if(_0xf961cd['query'][_0xedb1('0x40')]){_0x2c609b[_0xedb1('0x41')]=[{'all':!![]}];}_0x2c609b=_[_0xedb1('0x3e')]({},_0x2c609b,_0xf961cd[_0xedb1('0x3f')]);return db[_0xedb1('0x29')]['find'](_0x2c609b)[_0xedb1('0x26')](handleEntityNotFound(_0x822f49,null))[_0xedb1('0x26')](respondWithResult(_0x822f49,null))[_0xedb1('0x44')](handleError(_0x822f49,null));};exports[_0xedb1('0x46')]=function(_0x4598e2,_0x4b454f){return db['VoiceQueuesLog'][_0xedb1('0x46')](_0x4598e2[_0xedb1('0x47')],{})[_0xedb1('0x26')](respondWithResult(_0x4b454f,0xc9))[_0xedb1('0x44')](handleError(_0x4b454f,null));};exports[_0xedb1('0x25')]=function(_0x423cad,_0x2b2c94){if(_0x423cad[_0xedb1('0x47')]['id']){delete _0x423cad[_0xedb1('0x47')]['id'];}return db['VoiceQueuesLog'][_0xedb1('0x48')]({'where':{'id':_0x423cad[_0xedb1('0x45')]['id']}})[_0xedb1('0x26')](handleEntityNotFound(_0x2b2c94,null))[_0xedb1('0x26')](saveUpdates(_0x423cad[_0xedb1('0x47')],null))[_0xedb1('0x26')](respondWithResult(_0x2b2c94,null))[_0xedb1('0x44')](handleError(_0x2b2c94,null));};exports[_0xedb1('0x49')]=function(_0x5c3ed4,_0x18d391){return db[_0xedb1('0x29')][_0xedb1('0x48')]({'where':{'id':_0x5c3ed4[_0xedb1('0x45')]['id']}})[_0xedb1('0x26')](handleEntityNotFound(_0x18d391,null))[_0xedb1('0x26')](removeEntity(_0x18d391,null))['catch'](handleError(_0x18d391,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b71cf69..2255dd9 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 _0x7c05=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4151e0,_0x315d3d){var _0x4d36b7=function(_0x3629b7){while(--_0x3629b7){_0x4151e0['push'](_0x4151e0['shift']());}};_0x4d36b7(++_0x315d3d);}(_0x7c05,0x171));var _0x57c0=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x7c05[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0x57c0('0x0'));var util=require(_0x57c0('0x1'));var logger=require(_0x57c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x57c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57c0('0x4'));var rimraf=require(_0x57c0('0x5'));var config=require(_0x57c0('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0x57c0('0x7')]=function(_0x178d22,_0x3778bd){return _0x178d22[_0x57c0('0x8')](_0x57c0('0x9'),attributes,{'tableName':_0x57c0('0xa'),'paranoid':![],'indexes':[{'name':_0x57c0('0xb'),'fields':[_0x57c0('0xc'),_0x57c0('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xac72=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','moment','bluebird'];(function(_0x93a00c,_0x137a15){var _0x1bf2d9=function(_0x3f60ad){while(--_0x3f60ad){_0x93a00c['push'](_0x93a00c['shift']());}};_0x1bf2d9(++_0x137a15);}(_0xac72,0x1eb));var _0x2ac7=function(_0x50826f,_0x352547){_0x50826f=_0x50826f-0x0;var _0x26503c=_0xac72[_0x50826f];return _0x26503c;};'use strict';var _=require(_0x2ac7('0x0'));var util=require(_0x2ac7('0x1'));var logger=require(_0x2ac7('0x2'))('api');var moment=require(_0x2ac7('0x3'));var BPromise=require(_0x2ac7('0x4'));var rp=require(_0x2ac7('0x5'));var fs=require('fs');var path=require(_0x2ac7('0x6'));var rimraf=require(_0x2ac7('0x7'));var config=require(_0x2ac7('0x8'));var attributes=require(_0x2ac7('0x9'));module[_0x2ac7('0xa')]=function(_0x2c56b0,_0x28add9){return _0x2c56b0[_0x2ac7('0xb')](_0x2ac7('0xc'),attributes,{'tableName':_0x2ac7('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x2ac7('0xe'),_0x2ac7('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 9810063..18d806f 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 _0x1aee=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x1aee,0x1d0));var _0xe1ae=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x1aee[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0xe1ae('0x0'));var util=require(_0xe1ae('0x1'));var moment=require(_0xe1ae('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1ae('0x3'));var fs=require('fs');var Redis=require(_0xe1ae('0x4'));var db=require(_0xe1ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1ae('0x6'))('rpc');var config=require(_0xe1ae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe1ae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e78b1,_0x3b5079,_0x2f8651){return new BPromise(function(_0x39ab98,_0x40101d){return client['request'](_0x5e78b1,_0x2f8651)['then'](function(_0x1820eb){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3b5079,_0xe1ae('0x9'));logger['debug'](_0xe1ae('0xa'),_0x3b5079,_0xe1ae('0x9'),JSON['stringify'](_0x1820eb));if(_0x1820eb['error']){if(_0x1820eb[_0xe1ae('0xb')][_0xe1ae('0xc')]===0x1f4){logger[_0xe1ae('0xb')](_0xe1ae('0xd'),_0x3b5079,_0x1820eb[_0xe1ae('0xb')][_0xe1ae('0xe')]);return _0x40101d(_0x1820eb['error'][_0xe1ae('0xe')]);}logger['error'](_0xe1ae('0xd'),_0x3b5079,_0x1820eb[_0xe1ae('0xb')][_0xe1ae('0xe')]);return _0x39ab98(_0x1820eb[_0xe1ae('0xb')][_0xe1ae('0xe')]);}else{logger['info'](_0xe1ae('0xd'),_0x3b5079,_0xe1ae('0x9'));_0x39ab98(_0x1820eb[_0xe1ae('0xf')][_0xe1ae('0xe')]);}})['catch'](function(_0x15f8a8){logger[_0xe1ae('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3b5079,_0x15f8a8);_0x40101d(_0x15f8a8);});});} \ No newline at end of file +var _0xff91=['VoiceQueuesLog,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x12b9de,_0x3410d4){var _0x18f5ca=function(_0x186e6c){while(--_0x186e6c){_0x12b9de['push'](_0x12b9de['shift']());}};_0x18f5ca(++_0x3410d4);}(_0xff91,0x1d1));var _0x1ff9=function(_0x64eb12,_0x1f9f43){_0x64eb12=_0x64eb12-0x0;var _0x2a50d5=_0xff91[_0x64eb12];return _0x2a50d5;};'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')]('VoiceQueuesLog,\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')]('VoiceQueuesLog,\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')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5324b1,_0x2c959e);_0x23e68b(_0x2c959e);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c344223..1dcac6f 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 _0xa30a=['isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','destroy','exports','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceRecording.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30a,0x1de));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xaa30('0x0'));var express=require(_0xaa30('0x1'));var router=express['Router']();var fs_extra=require(_0xaa30('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xaa30('0x3'));var config=require('../../config/environment');var controller=require(_0xaa30('0x4'));router[_0xaa30('0x5')]('/',auth[_0xaa30('0x6')](),controller[_0xaa30('0x7')]);router[_0xaa30('0x5')](_0xaa30('0x8'),auth[_0xaa30('0x6')](),controller[_0xaa30('0x9')]);router['get'](_0xaa30('0xa'),auth['isAuthenticated'](),controller[_0xaa30('0xb')]);router[_0xaa30('0x5')](_0xaa30('0xc'),auth[_0xaa30('0x6')](),controller[_0xaa30('0xd')]);router['get']('/:id/downloads',controller[_0xaa30('0xe')]);router[_0xaa30('0x5')](_0xaa30('0xf'),auth[_0xaa30('0x6')](),controller[_0xaa30('0x10')]);router[_0xaa30('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaa30('0x11')](_0xaa30('0xf'),auth[_0xaa30('0x6')](),controller[_0xaa30('0x12')]);router[_0xaa30('0x13')](_0xaa30('0xa'),auth[_0xaa30('0x6')](),controller['update']);router['delete'](_0xaa30('0xa'),auth['isAuthenticated'](),controller[_0xaa30('0x14')]);module[_0xaa30('0x15')]=router; \ No newline at end of file +var _0xeb37=['path','connect-timeout','express','fs-extra','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','downloads','/:id/transcribe','downloadTranscribe','put','update','destroy','multer'];(function(_0x3eae73,_0xdee8b){var _0x201017=function(_0x367d1c){while(--_0x367d1c){_0x3eae73['push'](_0x3eae73['shift']());}};_0x201017(++_0xdee8b);}(_0xeb37,0x17b));var _0x7eb3=function(_0x4d1103,_0xe89732){_0x4d1103=_0x4d1103-0x0;var _0x38f83b=_0xeb37[_0x4d1103];return _0x38f83b;};'use strict';var multer=require(_0x7eb3('0x0'));var util=require('util');var path=require(_0x7eb3('0x1'));var timeout=require(_0x7eb3('0x2'));var express=require(_0x7eb3('0x3'));var router=express['Router']();var fs_extra=require(_0x7eb3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7eb3('0x5'));var controller=require(_0x7eb3('0x6'));router[_0x7eb3('0x7')]('/',auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x9')]);router[_0x7eb3('0x7')](_0x7eb3('0xa'),auth[_0x7eb3('0x8')](),controller['describe']);router[_0x7eb3('0x7')](_0x7eb3('0xb'),auth[_0x7eb3('0x8')](),controller[_0x7eb3('0xc')]);router[_0x7eb3('0x7')](_0x7eb3('0xd'),auth[_0x7eb3('0x8')](),controller['download']);router[_0x7eb3('0x7')]('/:id/downloads',controller[_0x7eb3('0xe')]);router[_0x7eb3('0x7')](_0x7eb3('0xf'),auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x10')]);router['post']('/',auth[_0x7eb3('0x8')](),controller['create']);router['post']('/:id/transcribe',auth[_0x7eb3('0x8')](),controller['runTranscribe']);router[_0x7eb3('0x11')](_0x7eb3('0xb'),auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x12')]);router['delete'](_0x7eb3('0xb'),auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 58f20b1..a07ca17 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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 614e812..76e5542 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 _0xa9db=['Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','secrets','Setting','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','col','token','$and','push','recording','extname','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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)'];(function(_0x5e8906,_0x18f1e7){var _0x3b6622=function(_0x47ca57){while(--_0x47ca57){_0x5e8906['push'](_0x5e8906['shift']());}};_0x3b6622(++_0x18f1e7);}(_0xa9db,0x1ee));var _0xba9d=function(_0x2c9c60,_0x353e42){_0x2c9c60=_0x2c9c60-0x0;var _0x5399e5=_0xa9db[_0x2c9c60];return _0x5399e5;};'use strict';var emlformat=require(_0xba9d('0x0'));var rimraf=require(_0xba9d('0x1'));var zipdir=require(_0xba9d('0x2'));var jsonpatch=require(_0xba9d('0x3'));var rp=require(_0xba9d('0x4'));var moment=require('moment');var BPromise=require(_0xba9d('0x5'));var Mustache=require(_0xba9d('0x6'));var util=require(_0xba9d('0x7'));var path=require(_0xba9d('0x8'));var sox=require(_0xba9d('0x9'));var csv=require(_0xba9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xba9d('0xb'));var crypto=require(_0xba9d('0xc'));var jsforce=require(_0xba9d('0xd'));var deskjs=require(_0xba9d('0xe'));var toCsv=require(_0xba9d('0xa'));var querystring=require(_0xba9d('0xf'));var Papa=require(_0xba9d('0x10'));var AWS=require('aws-sdk');var uuidv4=require(_0xba9d('0x11'));var Redis=require(_0xba9d('0x12'));var authService=require(_0xba9d('0x13'));var qs=require(_0xba9d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba9d('0x15'));var logger=require(_0xba9d('0x16'))(_0xba9d('0x17'));var utils=require(_0xba9d('0x18'));var config=require(_0xba9d('0x19'));var licenseUtil=require(_0xba9d('0x1a'));var db=require(_0xba9d('0x1b'))['db'];function respondWithStatusCode(_0x36227b,_0x27625d){_0x27625d=_0x27625d||0xcc;return function(_0x5921f9){if(_0x5921f9){return _0x36227b[_0xba9d('0x1c')](_0x27625d);}return _0x36227b[_0xba9d('0x1d')](_0x27625d)[_0xba9d('0x1e')]();};}function respondWithResult(_0x86b8fd,_0x4aa223){_0x4aa223=_0x4aa223||0xc8;return function(_0x34eac2){if(_0x34eac2){return _0x86b8fd[_0xba9d('0x1d')](_0x4aa223)['json'](_0x34eac2);}};}function respondWithFilteredResult(_0x4e0734,_0x5ec7ef){return function(_0x48e388){if(_0x48e388){var _0x2a48b7=typeof _0x5ec7ef[_0xba9d('0x1f')]===_0xba9d('0x20')&&typeof _0x5ec7ef[_0xba9d('0x21')]==='undefined';var _0x2f67b5=_0x48e388[_0xba9d('0x22')];var _0x1a7f91=_0x2a48b7?0x0:_0x5ec7ef[_0xba9d('0x1f')];var _0x20531d=_0x2a48b7?_0x48e388[_0xba9d('0x22')]:_0x5ec7ef['offset']+_0x5ec7ef[_0xba9d('0x21')];var _0x7c2438;if(_0x20531d>=_0x2f67b5){_0x20531d=_0x2f67b5;_0x7c2438=0xc8;}else{_0x7c2438=0xce;}_0x4e0734[_0xba9d('0x1d')](_0x7c2438);return _0x4e0734[_0xba9d('0x23')](_0xba9d('0x24'),_0x1a7f91+'-'+_0x20531d+'/'+_0x2f67b5)[_0xba9d('0x25')](_0x48e388);}return null;};}function patchUpdates(_0xeb5aed){return function(_0x29d6c8){try{jsonpatch[_0xba9d('0x26')](_0x29d6c8,_0xeb5aed,!![]);}catch(_0x1f6d87){return BPromise[_0xba9d('0x27')](_0x1f6d87);}return _0x29d6c8['save']();};}function saveUpdates(_0x2ab9ac,_0x4b0d00){return function(_0x9fcf66){if(_0x9fcf66){return _0x9fcf66[_0xba9d('0x28')](_0x2ab9ac)[_0xba9d('0x29')](function(_0x25b37b){return _0x25b37b;});}return null;};}function removeEntity(_0x448596,_0x270a46){return function(_0x3ccbe6){if(_0x3ccbe6){return _0x3ccbe6[_0xba9d('0x2a')]()['then'](function(){_0x448596['status'](0xcc)[_0xba9d('0x1e')]();});}};}function handleEntityNotFound(_0x37c7f0,_0x564a38){return function(_0x11613d){if(!_0x11613d){_0x37c7f0['sendStatus'](0x194);}return _0x11613d;};}function handleError(_0x2414d2,_0x1fb5dd){_0x1fb5dd=_0x1fb5dd||0x1f4;return function(_0x40bd00){logger[_0xba9d('0x2b')](_0x40bd00['stack']);if(_0x40bd00[_0xba9d('0x2c')]){delete _0x40bd00[_0xba9d('0x2c')];}_0x2414d2['status'](_0x1fb5dd)[_0xba9d('0x2d')](_0x40bd00);};}exports['index']=function(_0x2a1d6b,_0x1095e4){var _0x1b94b8={},_0x3106d0={},_0x198f7a={'count':0x0,'rows':[]};var _0x234fcf=_[_0xba9d('0x2e')](db[_0xba9d('0x2f')][_0xba9d('0x30')],function(_0x355e1a){return{'name':_0x355e1a[_0xba9d('0x31')],'type':_0x355e1a[_0xba9d('0x32')][_0xba9d('0x33')]};});_0x3106d0[_0xba9d('0x34')]=_[_0xba9d('0x35')](_[_0xba9d('0x2e')](_0x234fcf,_0xba9d('0x2c')),[_0xba9d('0x36')]);_0x3106d0[_0xba9d('0x37')]=_[_0xba9d('0x38')](_0x2a1d6b['query']);_0x3106d0[_0xba9d('0x39')]=_[_0xba9d('0x3a')](_0x3106d0[_0xba9d('0x34')],_0x3106d0['query']);_0x1b94b8[_0xba9d('0x3b')]=_[_0xba9d('0x3a')](_0x3106d0[_0xba9d('0x34')],qs[_0xba9d('0x3c')](_0x2a1d6b[_0xba9d('0x37')][_0xba9d('0x3c')]));_0x1b94b8[_0xba9d('0x3b')]=_0x1b94b8[_0xba9d('0x3b')][_0xba9d('0x3d')]?_0x1b94b8[_0xba9d('0x3b')]:_0x3106d0['model'];if(!_0x2a1d6b[_0xba9d('0x37')][_0xba9d('0x3e')](_0xba9d('0x3f'))){_0x1b94b8[_0xba9d('0x21')]=qs[_0xba9d('0x21')](_0x2a1d6b['query'][_0xba9d('0x21')]);_0x1b94b8[_0xba9d('0x1f')]=qs[_0xba9d('0x1f')](_0x2a1d6b[_0xba9d('0x37')][_0xba9d('0x1f')]);}_0x1b94b8[_0xba9d('0x40')]=qs[_0xba9d('0x41')](_0x2a1d6b['query'][_0xba9d('0x41')]);_0x1b94b8[_0xba9d('0x42')]=qs[_0xba9d('0x39')](_[_0xba9d('0x43')](_0x2a1d6b[_0xba9d('0x37')],_0x3106d0[_0xba9d('0x39')]),_0x234fcf);if(_0x2a1d6b[_0xba9d('0x37')][_0xba9d('0x44')]){_0x1b94b8[_0xba9d('0x42')]=_[_0xba9d('0x45')](_0x1b94b8[_0xba9d('0x42')],{'$or':_[_0xba9d('0x2e')](_0x234fcf,function(_0xe970a3){if(_0xe970a3[_0xba9d('0x32')]!==_0xba9d('0x46')){var _0x57e394={};_0x57e394[_0xe970a3['name']]={'$like':'%'+_0x2a1d6b[_0xba9d('0x37')]['filter']+'%'};return _0x57e394;}})});}_0x1b94b8=_['merge']({},_0x1b94b8,_0x2a1d6b[_0xba9d('0x47')]);var _0xee2874={'where':_0x1b94b8[_0xba9d('0x42')]};return db[_0xba9d('0x2f')][_0xba9d('0x22')](_0xee2874)[_0xba9d('0x29')](function(_0x33a225){_0x198f7a[_0xba9d('0x22')]=_0x33a225;if(_0x2a1d6b['query'][_0xba9d('0x48')]){_0x1b94b8[_0xba9d('0x49')]=[{'all':!![]}];}return db[_0xba9d('0x2f')][_0xba9d('0x4a')](_0x1b94b8);})[_0xba9d('0x29')](function(_0x2f946c){_0x198f7a['rows']=_0x2f946c;return _0x198f7a;})[_0xba9d('0x29')](respondWithFilteredResult(_0x1095e4,_0x1b94b8))[_0xba9d('0x4b')](handleError(_0x1095e4,null));};exports['show']=function(_0x2550b2,_0x3ef1a2){var _0x198fc5={'raw':![],'where':{'id':_0x2550b2[_0xba9d('0x4c')]['id']}},_0x13ac70={};_0x13ac70[_0xba9d('0x34')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x13ac70['query']=_[_0xba9d('0x38')](_0x2550b2[_0xba9d('0x37')]);_0x13ac70[_0xba9d('0x39')]=_['intersection'](_0x13ac70[_0xba9d('0x34')],_0x13ac70[_0xba9d('0x37')]);_0x198fc5[_0xba9d('0x3b')]=_[_0xba9d('0x3a')](_0x13ac70['model'],qs['fields'](_0x2550b2[_0xba9d('0x37')][_0xba9d('0x3c')]));_0x198fc5[_0xba9d('0x3b')]=_0x198fc5[_0xba9d('0x3b')]['length']?_0x198fc5[_0xba9d('0x3b')]:_0x13ac70[_0xba9d('0x34')];if(_0x2550b2[_0xba9d('0x37')][_0xba9d('0x48')]){_0x198fc5[_0xba9d('0x49')]=[{'all':!![]}];}_0x198fc5=_[_0xba9d('0x45')]({},_0x198fc5,_0x2550b2['options']);return db[_0xba9d('0x2f')][_0xba9d('0x4d')](_0x198fc5)['then'](handleEntityNotFound(_0x3ef1a2,null))['then'](respondWithResult(_0x3ef1a2,null))[_0xba9d('0x4b')](handleError(_0x3ef1a2,null));};exports[_0xba9d('0x4e')]=function(_0x40f44e,_0x5d1737){return db[_0xba9d('0x2f')][_0xba9d('0x4e')](_0x40f44e['body'],{})[_0xba9d('0x29')](respondWithResult(_0x5d1737,0xc9))[_0xba9d('0x4b')](handleError(_0x5d1737,null));};exports[_0xba9d('0x28')]=function(_0x3a4077,_0x3b9aae){if(_0x3a4077[_0xba9d('0x4f')]['id']){delete _0x3a4077[_0xba9d('0x4f')]['id'];}return db['VoiceRecording'][_0xba9d('0x4d')]({'where':{'id':_0x3a4077[_0xba9d('0x4c')]['id']}})[_0xba9d('0x29')](handleEntityNotFound(_0x3b9aae,null))['then'](saveUpdates(_0x3a4077['body'],null))[_0xba9d('0x29')](respondWithResult(_0x3b9aae,null))[_0xba9d('0x4b')](handleError(_0x3b9aae,null));};exports[_0xba9d('0x50')]=function(_0x19fd97,_0x305c57){return db['VoiceRecording'][_0xba9d('0x50')]()[_0xba9d('0x29')](respondWithResult(_0x305c57,null))[_0xba9d('0x4b')](handleError(_0x305c57,null));};exports[_0xba9d('0x51')]=function(_0x152d35,_0x32f2a4,_0x2886ef){var _0x42db11=require(_0xba9d('0x52'));var _0x155d19=![];var _0x4a5948={};if(_0x152d35['query']['type']&&_0x152d35['query'][_0xba9d('0x32')]===_0xba9d('0x53')){_0x4a5948[_0xba9d('0x53')]=_0x152d35[_0xba9d('0x4c')]['id'];}else{_0x4a5948['id']=_0x152d35['params']['id'];}return db[_0xba9d('0x2f')][_0xba9d('0x4d')]({'where':_0x4a5948,'attributes':['id',_0xba9d('0x54')],'raw':!![]})[_0xba9d('0x29')](handleEntityNotFound(_0x32f2a4,null))[_0xba9d('0x29')](function(_0x58bc66){if(_0x58bc66){var _0x16aa16=_0x58bc66[_0xba9d('0x54')];var _0x4b32c3=util[_0xba9d('0x36')](_0xba9d('0x55'),_0x16aa16);if(fs[_0xba9d('0x56')](_0x4b32c3)){_0x155d19=!![];return _0x42db11[_0xba9d('0x57')](_0x4b32c3,_0x16aa16,config['secrets']['recording'])[_0xba9d('0x29')](function(){return _0x58bc66;});}return _0x58bc66;}})[_0xba9d('0x29')](function(_0x102e08){if(_0x102e08){var _0x47c1c4=_0x102e08['value'];if(!fs[_0xba9d('0x56')](_0x47c1c4)){throw new db[(_0xba9d('0x58'))][(_0xba9d('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x102e08[_0xba9d('0x5a')]){return _0x32f2a4[_0xba9d('0x51')](_0x47c1c4,_0x102e08['filename']+path['extname'](_0x47c1c4),function(){if(_0x155d19){fs[_0xba9d('0x5b')](_0x47c1c4);}});}else{return _0x32f2a4[_0xba9d('0x51')](_0x47c1c4,function(_0xaf1df6){if(_0x155d19){fs[_0xba9d('0x5b')](_0x47c1c4);}});}}})[_0xba9d('0x4b')](function(_0x453cc0){if(_0x453cc0[_0xba9d('0x5c')]===_0xba9d('0x5d')){_0x32f2a4['status'](0x194)[_0xba9d('0x2d')]('Not\x20found');}else{return handleError(_0x32f2a4,null);}});};exports[_0xba9d('0x5e')]=function(_0x3871d1,_0x10165e,_0x309c81){var _0x13e78c=require(_0xba9d('0x52'));var _0x13e39a=![];var _0x2a3199={'$and':[db[_0xba9d('0x5f')][_0xba9d('0x42')](db[_0xba9d('0x5f')]['fn'](_0xba9d('0x60'),db[_0xba9d('0x5f')][_0xba9d('0x61')]('uniqueid')),_0x3871d1['query'][_0xba9d('0x62')])]};if(_0x3871d1[_0xba9d('0x37')][_0xba9d('0x32')]&&_0x3871d1['query'][_0xba9d('0x32')]===_0xba9d('0x53')){_0x2a3199[_0xba9d('0x63')][_0xba9d('0x64')]({'uniqueid':_0x3871d1[_0xba9d('0x4c')]['id']});}else{_0x2a3199['$and'][_0xba9d('0x64')]({'id':_0x3871d1[_0xba9d('0x4c')]['id']});}return db[_0xba9d('0x2f')][_0xba9d('0x4d')]({'where':_0x2a3199,'attributes':['id','value'],'raw':!![]})[_0xba9d('0x29')](handleEntityNotFound(_0x10165e,null))[_0xba9d('0x29')](function(_0x501838){if(_0x501838){var _0x4cc1a4=util[_0xba9d('0x36')](_0xba9d('0x55'),_0x501838[_0xba9d('0x54')]);if(fs[_0xba9d('0x56')](_0x4cc1a4)){_0x13e39a=!![];return _0x13e78c[_0xba9d('0x57')](_0x4cc1a4,_0x501838[_0xba9d('0x54')],config['secrets'][_0xba9d('0x65')])[_0xba9d('0x29')](function(){return _0x501838;});}return _0x501838;}})['then'](function(_0x1daa13){if(_0x1daa13){if(!fs[_0xba9d('0x56')](_0x1daa13['value'])){throw new db[(_0xba9d('0x58'))]['ValidationError'](_0xba9d('0x5d'));}if(_0x1daa13[_0xba9d('0x5a')]){return _0x10165e[_0xba9d('0x51')](_0x1daa13[_0xba9d('0x54')],_0x1daa13[_0xba9d('0x5a')]+path[_0xba9d('0x66')](_0x1daa13[_0xba9d('0x54')]),function(){if(_0x13e39a){fs[_0xba9d('0x5b')](_0x1daa13['value']);}});}else{return _0x10165e[_0xba9d('0x51')](_0x1daa13[_0xba9d('0x54')],function(_0x484d62){if(_0x13e39a){fs[_0xba9d('0x5b')](_0x1daa13[_0xba9d('0x54')]);}});}}})[_0xba9d('0x4b')](handleError(_0x10165e,null));};exports[_0xba9d('0x2a')]=function(_0x133a2c,_0x3d3824){return db['VoiceRecording'][_0xba9d('0x4d')]({'where':{'id':_0x133a2c[_0xba9d('0x4c')]['id']}})[_0xba9d('0x29')](function(_0x4c8475){if(_[_0xba9d('0x67')](_0x4c8475)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4c8475;})[_0xba9d('0x29')](function(_0x12fd08){var _0xbdf373=_0x12fd08[_0xba9d('0x54')];logger[_0xba9d('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0xbdf373);if(!_[_0xba9d('0x67')](_0x12fd08['value'])&&fs[_0xba9d('0x56')](_0xbdf373)){logger[_0xba9d('0x68')](_0xba9d('0x69')+_0xbdf373+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0xbdf373);}_0xbdf373=_0xbdf373+'.cypher';if(!_[_0xba9d('0x67')](_0x12fd08[_0xba9d('0x54')])&&fs['existsSync'](_0xbdf373)){logger[_0xba9d('0x68')](_0xba9d('0x69')+_0xbdf373+_0xba9d('0x6a'));fs['unlinkSync'](_0xbdf373);}return _0x12fd08;})[_0xba9d('0x29')](function(_0x15267a){if(!_0x15267a)throw new InternalError();return _0x15267a['destroy']();})[_0xba9d('0x29')](function(){_0x3d3824['status'](0xcc)[_0xba9d('0x1e')]();})[_0xba9d('0x4b')](handleError(_0x3d3824,null));};function getBucketslist(_0x398a9b,_0x33b16f,_0x4d46d3){return new Promise(function(_0x49a4e0,_0xeadd07){var _0x414184=new AWS['S3']({'accessKeyId':_0x33b16f,'secretAccessKey':_0x398a9b,'region':_0x4d46d3});_0x414184['listBuckets']({},function(_0x530ba3,_0x522123){if(_0x530ba3){return _0xeadd07(_0x530ba3);}else{return _0x49a4e0(_0x522123);}});});}function createBucket(_0x5e87e4,_0x1f9d07,_0x17686e,_0x17166c){return new Promise(function(_0x2e11ed,_0x53249c){var _0x5d5072=new AWS['S3']({'accessKeyId':_0x1f9d07,'secretAccessKey':_0x5e87e4,'region':_0x17686e});_0x5d5072['createBucket']({'Bucket':_0x17166c},function(_0x3d48d7,_0x14d9c3){if(_0x3d48d7){return _0x53249c(_0x3d48d7);}else{return _0x2e11ed(_0x14d9c3);}});});}function uploadFile(_0x309b67,_0x1fe05e,_0x2a4a0b,_0x57e894,_0x3cfba5,_0x4a1a45){return new Promise(function(_0x3362f6,_0x3a1b9e){var _0x45b4c4=new AWS['S3']({'accessKeyId':_0x1fe05e,'secretAccessKey':_0x309b67,'region':_0x2a4a0b});_0x45b4c4[_0xba9d('0x6b')]({'Bucket':_0x57e894,'Key':_0x3cfba5,'Body':_0x4a1a45},function(_0x1ca81b,_0x2933e9){if(_0x1ca81b){return _0x3a1b9e(_0x1ca81b);}else{return _0x3362f6(_0x2933e9);}});});}function startTranscribe(_0x1c2f39,_0x18a405,_0x18a840,_0x3a3c48,_0x7f6a06,_0x5e1214){return new Promise(function(_0x11ff74,_0x5a278b){var _0x2a1f69=new AWS[(_0xba9d('0x6c'))]({'accessKeyId':_0x18a405,'secretAccessKey':_0x1c2f39,'region':_0x18a840});_0x2a1f69[_0xba9d('0x6d')]({'TranscriptionJobName':_0x3a3c48,'LanguageCode':_0x7f6a06,'Media':{'MediaFileUri':_0x5e1214}},function(_0x27e353,_0x3d4620){if(_0x27e353){return _0x5a278b(_0x27e353);}else{return _0x11ff74(_0x3d4620);}});});}function transcribe(_0x460114,_0x2126a2,_0x5eeac4,_0x1863e3,_0x42fd60,_0x861920,_0x2b0271){return new Promise(function(_0xd8335,_0x40be22){var _0x28b1c1={};logger[_0xba9d('0x68')](util['format'](_0xba9d('0x6e'),_0x460114,_0x42fd60));return uploadFile(_0x2126a2,_0x5eeac4,_0x1863e3,_0x42fd60,path[_0xba9d('0x6f')](_0x861920),fs[_0xba9d('0x70')](_0x861920))['then'](function(_0x5ef93d){logger[_0xba9d('0x68')](util['format'](_0xba9d('0x71'),_0x460114,_0x42fd60,_0x5ef93d[_0xba9d('0x72')]));_0x28b1c1[_0xba9d('0x73')]=_0x5ef93d['Bucket'];_0x28b1c1[_0xba9d('0x74')]=_0x5ef93d['Location'];logger[_0xba9d('0x68')](util[_0xba9d('0x36')](_0xba9d('0x75'),_0x460114));return startTranscribe(_0x2126a2,_0x5eeac4,_0x1863e3,uuidv4(),_0x2b0271,_0x5ef93d[_0xba9d('0x72')]);})[_0xba9d('0x29')](function(_0x2838ae){logger['info'](util['format'](_0xba9d('0x76'),_0x460114,_0x2838ae[_0xba9d('0x77')][_0xba9d('0x78')]));_0x28b1c1[_0xba9d('0x79')]=_0x2838ae['TranscriptionJob']['TranscriptionJobName'];_0x28b1c1[_0xba9d('0x7a')]=_0x2838ae[_0xba9d('0x77')][_0xba9d('0x7b')];return _0xd8335(_0x28b1c1);})[_0xba9d('0x4b')](function(_0x2fac14){return _0x40be22(_0x2fac14);});});}exports[_0xba9d('0x7c')]=function(_0x26c8d7,_0x2ee3d1,_0x507585){var _0x3b44a9;var _0x3fd99f;var _0x4acf79;var _0x787370=require(_0xba9d('0x52'));return db[_0xba9d('0x2f')]['findOne']({'where':{'id':_0x26c8d7[_0xba9d('0x4c')]['id']}})['then'](function(_0x229c22){if(_0x229c22){var _0x6ce65b=util['format'](_0xba9d('0x55'),_0x229c22[_0xba9d('0x54')]);if(fs[_0xba9d('0x56')](_0x6ce65b)){cypher=!![];return _0x787370[_0xba9d('0x57')](_0x6ce65b,_0x229c22[_0xba9d('0x54')],config[_0xba9d('0x7d')][_0xba9d('0x65')])['then'](function(){return _0x229c22;});}return _0x229c22;}})[_0xba9d('0x29')](function(_0x5c9fc3){if(!_0x5c9fc3){throw new db[(_0xba9d('0x58'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x3fd99f=_0x5c9fc3;return db[_0xba9d('0x7e')][_0xba9d('0x7f')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2ee3d1,null))['then'](function(_0x4fa2ce){if(_0x4fa2ce){_0x3b44a9=_0x4fa2ce;if(!_0x3b44a9[_0xba9d('0x80')]||!_0x3b44a9['transcribeAccountId']||!_0x3b44a9[_0xba9d('0x81')]||!_0x3b44a9[_0xba9d('0x82')]||!_0x3b44a9[_0xba9d('0x73')]){throw new db[(_0xba9d('0x58'))][(_0xba9d('0x59'))](_0xba9d('0x83'));}if(_0x26c8d7[_0xba9d('0x4f')][_0xba9d('0x84')]&&(!_0x3b44a9['sentiment']||!_0x3b44a9[_0xba9d('0x85')]||!_0x3b44a9['sentimentRegion']||!_0x3b44a9['language']||!_0x3b44a9[_0xba9d('0x73')])){throw new db[(_0xba9d('0x58'))]['ValidationError'](_0xba9d('0x86'));}return db['CloudProvider'][_0xba9d('0x7f')]({'where':{'id':_0x3b44a9[_0xba9d('0x87')]}});}})[_0xba9d('0x29')](function(_0x2c433f){if(!_0x2c433f){throw new db[(_0xba9d('0x58'))][(_0xba9d('0x59'))](_0xba9d('0x88'));}if(!_0x2c433f[_0xba9d('0x89')]||!_0x2c433f[_0xba9d('0x8a')]){throw new db[(_0xba9d('0x58'))][(_0xba9d('0x59'))](_0xba9d('0x8b'));}_0x4acf79=_0x2c433f;return getBucketslist(_0x4acf79[_0xba9d('0x89')],_0x4acf79[_0xba9d('0x8a')],_0x3b44a9[_0xba9d('0x81')]);})[_0xba9d('0x29')](function(_0x27f8e2){if(_0x27f8e2&&_0x27f8e2['Buckets']){var _0x3ed539=_[_0xba9d('0x4d')](_0x27f8e2[_0xba9d('0x8c')],function(_0x39e72b){return _0x39e72b[_0xba9d('0x8d')]===_0x3b44a9['bucket'];});if(!_0x3ed539){logger[_0xba9d('0x68')](util['format'](_0xba9d('0x8e'),_0x26c8d7['params']['id'],_0x3b44a9[_0xba9d('0x73')]));return createBucket(_0x4acf79[_0xba9d('0x89')],_0x4acf79['data2'],_0x3b44a9[_0xba9d('0x81')],_0x3b44a9['bucket']);}logger[_0xba9d('0x68')](util[_0xba9d('0x36')](_0xba9d('0x8f'),_0x26c8d7[_0xba9d('0x4c')]['id'],_0x3b44a9[_0xba9d('0x73')]));return;}})['then'](function(_0x296ad1){if(_0x3fd99f[_0xba9d('0x7a')]==='NEW'){return transcribe(_0x26c8d7[_0xba9d('0x4c')]['id'],_0x4acf79[_0xba9d('0x89')],_0x4acf79[_0xba9d('0x8a')],_0x3b44a9[_0xba9d('0x81')],_0x3b44a9[_0xba9d('0x73')],_0x3fd99f[_0xba9d('0x54')],_0x3b44a9[_0xba9d('0x82')]);}else{logger[_0xba9d('0x68')](util[_0xba9d('0x36')](_0xba9d('0x90'),_0x26c8d7[_0xba9d('0x4c')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xba9d('0x29')](function(_0x88ba47){if(_0x88ba47){_0x88ba47['tempSentiment']=_0x26c8d7[_0xba9d('0x4f')]['runSentiment'];return _0x3fd99f[_0xba9d('0x91')](_0x88ba47);}})[_0xba9d('0x29')](respondWithResult(_0x2ee3d1,null))[_0xba9d('0x4b')](handleError(_0x2ee3d1,null));};function writeFile(_0x1687ef,_0x92f834){return new Promise(function(_0x14931a,_0x4a8757){fs[_0xba9d('0x92')](_0x92f834,_0x1687ef,function(_0x1698b4,_0x53a89a){if(_0x1698b4){return _0x4a8757(_0x1698b4);}else{return _0x14931a(_0x53a89a);}});});}exports[_0xba9d('0x93')]=function(_0x52392c,_0x542827,_0x10efeb){return db[_0xba9d('0x2f')][_0xba9d('0x7f')]({'where':{'id':_0x52392c[_0xba9d('0x4c')]['id']}})[_0xba9d('0x29')](handleEntityNotFound(_0x542827))[_0xba9d('0x29')](function(_0x11cb3c){if(_0x11cb3c&&_0x11cb3c[_0xba9d('0x94')]){var _0x4b1895=_0x11cb3c[_0xba9d('0x94')];var _0xf5d49c=config[_0xba9d('0x95')]+_0xba9d('0x96')+_0x11cb3c['id']+_0xba9d('0x97');if(fs['existsSync'](_0xf5d49c)){return _0xf5d49c;}return writeFile(_0x4b1895,_0xf5d49c)[_0xba9d('0x29')](function(){return _0xf5d49c;});}else{throw new db['Sequelize'][(_0xba9d('0x59'))]('Transcript\x20not\x20available');}})[_0xba9d('0x29')](function(_0xb7bc56){return _0x542827[_0xba9d('0x51')](_0xb7bc56);})[_0xba9d('0x4b')](handleError(_0x542827));}; \ No newline at end of file +var _0xee56=['describe','download','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','col','token','push','$and','%s.cypher','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeStatus','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','filters','intersection','attributes','query','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x5d82e6,_0x9eea82){var _0x8a238c=function(_0x5a2ee6){while(--_0x5a2ee6){_0x5d82e6['push'](_0x5d82e6['shift']());}};_0x8a238c(++_0x9eea82);}(_0xee56,0xe0));var _0x6ee5=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xee56[_0xe4d6c6];return _0x3a8935;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ee5('0x0'));var jsonpatch=require(_0x6ee5('0x1'));var rp=require('request-promise');var moment=require(_0x6ee5('0x2'));var BPromise=require(_0x6ee5('0x3'));var Mustache=require(_0x6ee5('0x4'));var util=require(_0x6ee5('0x5'));var path=require(_0x6ee5('0x6'));var sox=require(_0x6ee5('0x7'));var csv=require(_0x6ee5('0x8'));var ejs=require(_0x6ee5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ee5('0xa'));var squel=require('squel');var crypto=require(_0x6ee5('0xb'));var jsforce=require(_0x6ee5('0xc'));var deskjs=require(_0x6ee5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6ee5('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0x6ee5('0xf'));var Redis=require(_0x6ee5('0x10'));var authService=require(_0x6ee5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6ee5('0x12'));var hardwareService=require(_0x6ee5('0x13'));var logger=require(_0x6ee5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6ee5('0x15'));var licenseUtil=require(_0x6ee5('0x16'));var db=require(_0x6ee5('0x17'))['db'];function respondWithStatusCode(_0x460d0a,_0x434074){_0x434074=_0x434074||0xcc;return function(_0x9e665e){if(_0x9e665e){return _0x460d0a[_0x6ee5('0x18')](_0x434074);}return _0x460d0a[_0x6ee5('0x19')](_0x434074)[_0x6ee5('0x1a')]();};}function respondWithResult(_0x4ae014,_0x25f334){_0x25f334=_0x25f334||0xc8;return function(_0x54bcb4){if(_0x54bcb4){return _0x4ae014[_0x6ee5('0x19')](_0x25f334)[_0x6ee5('0x1b')](_0x54bcb4);}};}function respondWithFilteredResult(_0x3b1ddb,_0x4da87b){return function(_0x561703){if(_0x561703){var _0x3d983e=typeof _0x4da87b[_0x6ee5('0x1c')]===_0x6ee5('0x1d')&&typeof _0x4da87b[_0x6ee5('0x1e')]==='undefined';var _0x140050=_0x561703[_0x6ee5('0x1f')];var _0x3d5d84=_0x3d983e?0x0:_0x4da87b[_0x6ee5('0x1c')];var _0x180af3=_0x3d983e?_0x561703[_0x6ee5('0x1f')]:_0x4da87b[_0x6ee5('0x1c')]+_0x4da87b['limit'];var _0x297cfe;if(_0x180af3>=_0x140050){_0x180af3=_0x140050;_0x297cfe=0xc8;}else{_0x297cfe=0xce;}_0x3b1ddb[_0x6ee5('0x19')](_0x297cfe);return _0x3b1ddb['set'](_0x6ee5('0x20'),_0x3d5d84+'-'+_0x180af3+'/'+_0x140050)['json'](_0x561703);}return null;};}function patchUpdates(_0x12c95f){return function(_0xd136fb){try{jsonpatch['apply'](_0xd136fb,_0x12c95f,!![]);}catch(_0x444357){return BPromise[_0x6ee5('0x21')](_0x444357);}return _0xd136fb[_0x6ee5('0x22')]();};}function saveUpdates(_0x3216ed,_0x45bcce){return function(_0x59ddb7){if(_0x59ddb7){return _0x59ddb7[_0x6ee5('0x23')](_0x3216ed)[_0x6ee5('0x24')](function(_0x3af1ed){return _0x3af1ed;});}return null;};}function removeEntity(_0x3b9c3c,_0x1c244c){return function(_0x3976e6){if(_0x3976e6){return _0x3976e6[_0x6ee5('0x25')]()['then'](function(){_0x3b9c3c[_0x6ee5('0x19')](0xcc)[_0x6ee5('0x1a')]();});}};}function handleEntityNotFound(_0x2e1f01,_0x20fc2c){return function(_0x461d9c){if(!_0x461d9c){_0x2e1f01[_0x6ee5('0x18')](0x194);}return _0x461d9c;};}function handleError(_0x437ffb,_0x232c17){_0x232c17=_0x232c17||0x1f4;return function(_0x11613e){logger['error'](_0x11613e[_0x6ee5('0x26')]);if(_0x11613e[_0x6ee5('0x27')]){delete _0x11613e[_0x6ee5('0x27')];}_0x437ffb['status'](_0x232c17)[_0x6ee5('0x28')](_0x11613e);};}exports[_0x6ee5('0x29')]=function(_0x3d7f16,_0x1c52fa){var _0xe55360={},_0x335f7e={},_0x74bb57={'count':0x0,'rows':[]};var _0xbfa413=_['map'](db[_0x6ee5('0x2a')][_0x6ee5('0x2b')],function(_0x58b8dc){return{'name':_0x58b8dc[_0x6ee5('0x2c')],'type':_0x58b8dc[_0x6ee5('0x2d')][_0x6ee5('0x2e')]};});_0x335f7e[_0x6ee5('0x2f')]=_[_0x6ee5('0x30')](_[_0x6ee5('0x31')](_0xbfa413,'name'),[_0x6ee5('0x32')]);_0x335f7e['query']=_['keys'](_0x3d7f16['query']);_0x335f7e[_0x6ee5('0x33')]=_[_0x6ee5('0x34')](_0x335f7e[_0x6ee5('0x2f')],_0x335f7e['query']);_0xe55360[_0x6ee5('0x35')]=_[_0x6ee5('0x34')](_0x335f7e[_0x6ee5('0x2f')],qs['fields'](_0x3d7f16[_0x6ee5('0x36')][_0x6ee5('0x37')]));_0xe55360[_0x6ee5('0x35')]=_0xe55360['attributes'][_0x6ee5('0x38')]?_0xe55360[_0x6ee5('0x35')]:_0x335f7e[_0x6ee5('0x2f')];if(!_0x3d7f16[_0x6ee5('0x36')]['hasOwnProperty'](_0x6ee5('0x39'))){_0xe55360['limit']=qs['limit'](_0x3d7f16[_0x6ee5('0x36')][_0x6ee5('0x1e')]);_0xe55360[_0x6ee5('0x1c')]=qs[_0x6ee5('0x1c')](_0x3d7f16[_0x6ee5('0x36')][_0x6ee5('0x1c')]);}_0xe55360[_0x6ee5('0x3a')]=qs['sort'](_0x3d7f16[_0x6ee5('0x36')]['sort']);_0xe55360[_0x6ee5('0x3b')]=qs[_0x6ee5('0x33')](_[_0x6ee5('0x3c')](_0x3d7f16[_0x6ee5('0x36')],_0x335f7e[_0x6ee5('0x33')]),_0xbfa413);if(_0x3d7f16['query'][_0x6ee5('0x3d')]){_0xe55360[_0x6ee5('0x3b')]=_[_0x6ee5('0x3e')](_0xe55360[_0x6ee5('0x3b')],{'$or':_[_0x6ee5('0x31')](_0xbfa413,function(_0x4420cc){if(_0x4420cc[_0x6ee5('0x2d')]!==_0x6ee5('0x3f')){var _0x4bd685={};_0x4bd685[_0x4420cc[_0x6ee5('0x27')]]={'$like':'%'+_0x3d7f16[_0x6ee5('0x36')][_0x6ee5('0x3d')]+'%'};return _0x4bd685;}})});}_0xe55360=_[_0x6ee5('0x3e')]({},_0xe55360,_0x3d7f16[_0x6ee5('0x40')]);var _0x5b54c8={'where':_0xe55360[_0x6ee5('0x3b')]};return db[_0x6ee5('0x2a')][_0x6ee5('0x1f')](_0x5b54c8)[_0x6ee5('0x24')](function(_0x3182da){_0x74bb57[_0x6ee5('0x1f')]=_0x3182da;if(_0x3d7f16[_0x6ee5('0x36')][_0x6ee5('0x41')]){_0xe55360[_0x6ee5('0x42')]=[{'all':!![]}];}return db[_0x6ee5('0x2a')][_0x6ee5('0x43')](_0xe55360);})[_0x6ee5('0x24')](function(_0xf51f45){_0x74bb57[_0x6ee5('0x44')]=_0xf51f45;return _0x74bb57;})[_0x6ee5('0x24')](respondWithFilteredResult(_0x1c52fa,_0xe55360))['catch'](handleError(_0x1c52fa,null));};exports[_0x6ee5('0x45')]=function(_0x3174e0,_0x29220a){var _0x1a0a1f={'raw':![],'where':{'id':_0x3174e0[_0x6ee5('0x46')]['id']}},_0x191fd6={};_0x191fd6[_0x6ee5('0x2f')]=_[_0x6ee5('0x47')](db[_0x6ee5('0x2a')][_0x6ee5('0x2b')]);_0x191fd6['query']=_['keys'](_0x3174e0[_0x6ee5('0x36')]);_0x191fd6[_0x6ee5('0x33')]=_[_0x6ee5('0x34')](_0x191fd6[_0x6ee5('0x2f')],_0x191fd6[_0x6ee5('0x36')]);_0x1a0a1f[_0x6ee5('0x35')]=_[_0x6ee5('0x34')](_0x191fd6['model'],qs[_0x6ee5('0x37')](_0x3174e0[_0x6ee5('0x36')][_0x6ee5('0x37')]));_0x1a0a1f['attributes']=_0x1a0a1f[_0x6ee5('0x35')][_0x6ee5('0x38')]?_0x1a0a1f[_0x6ee5('0x35')]:_0x191fd6[_0x6ee5('0x2f')];if(_0x3174e0['query'][_0x6ee5('0x41')]){_0x1a0a1f[_0x6ee5('0x42')]=[{'all':!![]}];}_0x1a0a1f=_['merge']({},_0x1a0a1f,_0x3174e0[_0x6ee5('0x40')]);return db[_0x6ee5('0x2a')][_0x6ee5('0x48')](_0x1a0a1f)[_0x6ee5('0x24')](handleEntityNotFound(_0x29220a,null))[_0x6ee5('0x24')](respondWithResult(_0x29220a,null))[_0x6ee5('0x49')](handleError(_0x29220a,null));};exports[_0x6ee5('0x4a')]=function(_0x2e39bf,_0x17aa05){return db['VoiceRecording'][_0x6ee5('0x4a')](_0x2e39bf['body'],{})['then'](respondWithResult(_0x17aa05,0xc9))['catch'](handleError(_0x17aa05,null));};exports['update']=function(_0x571749,_0x5d5d19){if(_0x571749[_0x6ee5('0x4b')]['id']){delete _0x571749[_0x6ee5('0x4b')]['id'];}return db[_0x6ee5('0x2a')][_0x6ee5('0x48')]({'where':{'id':_0x571749[_0x6ee5('0x46')]['id']}})[_0x6ee5('0x24')](handleEntityNotFound(_0x5d5d19,null))[_0x6ee5('0x24')](saveUpdates(_0x571749[_0x6ee5('0x4b')],null))[_0x6ee5('0x24')](respondWithResult(_0x5d5d19,null))[_0x6ee5('0x49')](handleError(_0x5d5d19,null));};exports[_0x6ee5('0x4c')]=function(_0x350c1a,_0x299a68){return db[_0x6ee5('0x2a')][_0x6ee5('0x4c')]()['then'](respondWithResult(_0x299a68,null))['catch'](handleError(_0x299a68,null));};exports[_0x6ee5('0x4d')]=function(_0x2ccb59,_0x69f07b,_0x42d9a8){var _0x94845c=require('../../components/encryptor');var _0x1909c4=![];var _0x30e72d={};if(_0x2ccb59[_0x6ee5('0x36')][_0x6ee5('0x2d')]&&_0x2ccb59[_0x6ee5('0x36')][_0x6ee5('0x2d')]==='uniqueid'){_0x30e72d[_0x6ee5('0x4e')]=_0x2ccb59[_0x6ee5('0x46')]['id'];}else{_0x30e72d['id']=_0x2ccb59[_0x6ee5('0x46')]['id'];}return db[_0x6ee5('0x2a')][_0x6ee5('0x48')]({'where':_0x30e72d,'attributes':['id',_0x6ee5('0x4f')],'raw':!![]})[_0x6ee5('0x24')](handleEntityNotFound(_0x69f07b,null))['then'](function(_0x2f3128){if(_0x2f3128){var _0x3d27ea=_0x2f3128[_0x6ee5('0x4f')];var _0x47beb6=util['format']('%s.cypher',_0x3d27ea);if(fs[_0x6ee5('0x50')](_0x47beb6)){_0x1909c4=!![];return _0x94845c[_0x6ee5('0x51')](_0x47beb6,_0x3d27ea,config[_0x6ee5('0x52')][_0x6ee5('0x53')])[_0x6ee5('0x24')](function(){return _0x2f3128;});}return _0x2f3128;}})[_0x6ee5('0x24')](function(_0xcf49fc){if(_0xcf49fc){var _0x405ecd=_0xcf49fc[_0x6ee5('0x4f')];if(!fs[_0x6ee5('0x50')](_0x405ecd)){throw new db[(_0x6ee5('0x54'))][(_0x6ee5('0x55'))](_0x6ee5('0x56'));}if(_0xcf49fc['filename']){return _0x69f07b[_0x6ee5('0x4d')](_0x405ecd,_0xcf49fc[_0x6ee5('0x57')]+path[_0x6ee5('0x58')](_0x405ecd),function(){if(_0x1909c4){fs[_0x6ee5('0x59')](_0x405ecd);}});}else{return _0x69f07b['download'](_0x405ecd,function(_0x31a4b5){if(_0x1909c4){fs[_0x6ee5('0x59')](_0x405ecd);}});}}})['catch'](function(_0x5b770a){if(_0x5b770a[_0x6ee5('0x5a')]===_0x6ee5('0x56')){_0x69f07b[_0x6ee5('0x19')](0x194)['send'](_0x6ee5('0x5b'));}else{return handleError(_0x69f07b,null);}});};exports[_0x6ee5('0x5c')]=function(_0x202f8c,_0x5d9900,_0x2faabc){var _0x83e106=require(_0x6ee5('0x5d'));var _0x29443b=![];var _0x3224cb={'$and':[db[_0x6ee5('0x5e')][_0x6ee5('0x3b')](db['sequelize']['fn']('MD5',db['sequelize'][_0x6ee5('0x5f')](_0x6ee5('0x4e'))),_0x202f8c[_0x6ee5('0x36')][_0x6ee5('0x60')])]};if(_0x202f8c[_0x6ee5('0x36')][_0x6ee5('0x2d')]&&_0x202f8c[_0x6ee5('0x36')][_0x6ee5('0x2d')]==='uniqueid'){_0x3224cb['$and'][_0x6ee5('0x61')]({'uniqueid':_0x202f8c[_0x6ee5('0x46')]['id']});}else{_0x3224cb[_0x6ee5('0x62')][_0x6ee5('0x61')]({'id':_0x202f8c['params']['id']});}return db[_0x6ee5('0x2a')][_0x6ee5('0x48')]({'where':_0x3224cb,'attributes':['id',_0x6ee5('0x4f')],'raw':!![]})[_0x6ee5('0x24')](handleEntityNotFound(_0x5d9900,null))[_0x6ee5('0x24')](function(_0xca09b4){if(_0xca09b4){var _0x5cf97e=util[_0x6ee5('0x32')](_0x6ee5('0x63'),_0xca09b4[_0x6ee5('0x4f')]);if(fs['existsSync'](_0x5cf97e)){_0x29443b=!![];return _0x83e106[_0x6ee5('0x51')](_0x5cf97e,_0xca09b4[_0x6ee5('0x4f')],config[_0x6ee5('0x52')][_0x6ee5('0x53')])[_0x6ee5('0x24')](function(){return _0xca09b4;});}return _0xca09b4;}})[_0x6ee5('0x24')](function(_0x2931de){if(_0x2931de){if(!fs[_0x6ee5('0x50')](_0x2931de[_0x6ee5('0x4f')])){throw new db[(_0x6ee5('0x54'))][(_0x6ee5('0x55'))](_0x6ee5('0x56'));}if(_0x2931de[_0x6ee5('0x57')]){return _0x5d9900[_0x6ee5('0x4d')](_0x2931de[_0x6ee5('0x4f')],_0x2931de['filename']+path['extname'](_0x2931de[_0x6ee5('0x4f')]),function(){if(_0x29443b){fs[_0x6ee5('0x59')](_0x2931de[_0x6ee5('0x4f')]);}});}else{return _0x5d9900[_0x6ee5('0x4d')](_0x2931de[_0x6ee5('0x4f')],function(_0x379bb7){if(_0x29443b){fs[_0x6ee5('0x59')](_0x2931de[_0x6ee5('0x4f')]);}});}}})[_0x6ee5('0x49')](handleError(_0x5d9900,null));};exports['destroy']=function(_0x49c571,_0x3c0821){return db[_0x6ee5('0x2a')][_0x6ee5('0x48')]({'where':{'id':_0x49c571[_0x6ee5('0x46')]['id']}})['then'](function(_0x5a9e38){if(_['isNil'](_0x5a9e38)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5a9e38;})[_0x6ee5('0x24')](function(_0x536110){var _0xbd294c=_0x536110['value'];logger['info'](_0x6ee5('0x64'),_0xbd294c);if(!_['isNil'](_0x536110[_0x6ee5('0x4f')])&&fs[_0x6ee5('0x50')](_0xbd294c)){logger[_0x6ee5('0x65')]('File:\x20\x22'+_0xbd294c+_0x6ee5('0x66'));fs[_0x6ee5('0x67')](_0xbd294c);}_0xbd294c=_0xbd294c+_0x6ee5('0x68');if(!_[_0x6ee5('0x69')](_0x536110[_0x6ee5('0x4f')])&&fs[_0x6ee5('0x50')](_0xbd294c)){logger[_0x6ee5('0x65')](_0x6ee5('0x6a')+_0xbd294c+_0x6ee5('0x66'));fs[_0x6ee5('0x67')](_0xbd294c);}return _0x536110;})[_0x6ee5('0x24')](function(_0x4b19b4){if(!_0x4b19b4)throw new InternalError();return _0x4b19b4[_0x6ee5('0x25')]();})['then'](function(){_0x3c0821[_0x6ee5('0x19')](0xcc)['end']();})[_0x6ee5('0x49')](handleError(_0x3c0821,null));};function getBucketslist(_0x2854cd,_0x53fc0d,_0x567e2){return new Promise(function(_0x460a3c,_0x228a90){var _0x586ab7=new AWS['S3']({'accessKeyId':_0x53fc0d,'secretAccessKey':_0x2854cd,'region':_0x567e2});_0x586ab7[_0x6ee5('0x6b')]({},function(_0x5bc8d9,_0x1131b5){if(_0x5bc8d9){return _0x228a90(_0x5bc8d9);}else{return _0x460a3c(_0x1131b5);}});});}function createBucket(_0x490da7,_0x1b6e20,_0x3837c8,_0xa9b527){return new Promise(function(_0x4910d0,_0x2a7ae8){var _0x16986f=new AWS['S3']({'accessKeyId':_0x1b6e20,'secretAccessKey':_0x490da7,'region':_0x3837c8});_0x16986f['createBucket']({'Bucket':_0xa9b527},function(_0x312c10,_0x5bcbe6){if(_0x312c10){return _0x2a7ae8(_0x312c10);}else{return _0x4910d0(_0x5bcbe6);}});});}function uploadFile(_0x377ec7,_0x51f52c,_0x1ad188,_0x5714a4,_0x48e2de,_0x1083b0){return new Promise(function(_0x3de376,_0x2ab596){var _0x2ad9b2=new AWS['S3']({'accessKeyId':_0x51f52c,'secretAccessKey':_0x377ec7,'region':_0x1ad188});_0x2ad9b2[_0x6ee5('0x6c')]({'Bucket':_0x5714a4,'Key':_0x48e2de,'Body':_0x1083b0},function(_0x5d50bd,_0x6091f2){if(_0x5d50bd){return _0x2ab596(_0x5d50bd);}else{return _0x3de376(_0x6091f2);}});});}function startTranscribe(_0x4d2e7e,_0xe53409,_0x128b8e,_0x1b1b68,_0x3af192,_0x37b7a2){return new Promise(function(_0x7a21c1,_0x8bd281){var _0x38c278=new AWS[(_0x6ee5('0x6d'))]({'accessKeyId':_0xe53409,'secretAccessKey':_0x4d2e7e,'region':_0x128b8e});_0x38c278[_0x6ee5('0x6e')]({'TranscriptionJobName':_0x1b1b68,'LanguageCode':_0x3af192,'Media':{'MediaFileUri':_0x37b7a2}},function(_0x14653c,_0x2512cb){if(_0x14653c){return _0x8bd281(_0x14653c);}else{return _0x7a21c1(_0x2512cb);}});});}function transcribe(_0x27e345,_0x2f3116,_0x765e74,_0x1f2b8d,_0x86b174,_0xcc7b28,_0x364fd1){return new Promise(function(_0x513949,_0x1c2a48){var _0x52f6c2={};logger[_0x6ee5('0x65')](util[_0x6ee5('0x32')](_0x6ee5('0x6f'),_0x27e345,_0x86b174));return uploadFile(_0x2f3116,_0x765e74,_0x1f2b8d,_0x86b174,path[_0x6ee5('0x70')](_0xcc7b28),fs[_0x6ee5('0x71')](_0xcc7b28))['then'](function(_0x195f75){logger[_0x6ee5('0x65')](util['format'](_0x6ee5('0x72'),_0x27e345,_0x86b174,_0x195f75['Location']));_0x52f6c2[_0x6ee5('0x73')]=_0x195f75['Bucket'];_0x52f6c2[_0x6ee5('0x74')]=_0x195f75['Location'];logger['info'](util[_0x6ee5('0x32')](_0x6ee5('0x75'),_0x27e345));return startTranscribe(_0x2f3116,_0x765e74,_0x1f2b8d,uuidv4(),_0x364fd1,_0x195f75[_0x6ee5('0x76')]);})['then'](function(_0xc5c2c9){logger[_0x6ee5('0x65')](util[_0x6ee5('0x32')](_0x6ee5('0x77'),_0x27e345,_0xc5c2c9['TranscriptionJob'][_0x6ee5('0x78')]));_0x52f6c2['transcribeName']=_0xc5c2c9['TranscriptionJob']['TranscriptionJobName'];_0x52f6c2[_0x6ee5('0x79')]=_0xc5c2c9[_0x6ee5('0x7a')][_0x6ee5('0x7b')];return _0x513949(_0x52f6c2);})[_0x6ee5('0x49')](function(_0x518ece){return _0x1c2a48(_0x518ece);});});}exports[_0x6ee5('0x7c')]=function(_0x2bc980,_0x4476bc,_0x1c1f6a){var _0x491c58;var _0x510814;var _0x23a2ea;var _0x1d5e9e=require(_0x6ee5('0x5d'));return db[_0x6ee5('0x2a')][_0x6ee5('0x7d')]({'where':{'id':_0x2bc980['params']['id']}})[_0x6ee5('0x24')](function(_0xa92129){if(_0xa92129){var _0x3956f0=util['format'](_0x6ee5('0x63'),_0xa92129[_0x6ee5('0x4f')]);if(fs[_0x6ee5('0x50')](_0x3956f0)){cypher=!![];return _0x1d5e9e['decryptFile'](_0x3956f0,_0xa92129[_0x6ee5('0x4f')],config[_0x6ee5('0x52')]['recording'])[_0x6ee5('0x24')](function(){return _0xa92129;});}return _0xa92129;}})[_0x6ee5('0x24')](function(_0x5316dd){if(!_0x5316dd){throw new db[(_0x6ee5('0x54'))][(_0x6ee5('0x55'))](_0x6ee5('0x7e'));}_0x510814=_0x5316dd;return db['Setting'][_0x6ee5('0x7d')]({'where':{'id':0x1}});})[_0x6ee5('0x24')](handleEntityNotFound(_0x4476bc,null))[_0x6ee5('0x24')](function(_0x4a2403){if(_0x4a2403){_0x491c58=_0x4a2403;if(!_0x491c58[_0x6ee5('0x7f')]||!_0x491c58[_0x6ee5('0x80')]||!_0x491c58['transcribeRegion']||!_0x491c58['language']||!_0x491c58['bucket']){throw new db[(_0x6ee5('0x54'))][(_0x6ee5('0x55'))]('Transcribe\x20not\x20configured');}if(_0x2bc980[_0x6ee5('0x4b')][_0x6ee5('0x81')]&&(!_0x491c58[_0x6ee5('0x82')]||!_0x491c58[_0x6ee5('0x83')]||!_0x491c58[_0x6ee5('0x84')]||!_0x491c58[_0x6ee5('0x85')]||!_0x491c58[_0x6ee5('0x73')])){throw new db[(_0x6ee5('0x54'))]['ValidationError'](_0x6ee5('0x86'));}return db[_0x6ee5('0x87')][_0x6ee5('0x7d')]({'where':{'id':_0x491c58['transcribeAccountId']}});}})[_0x6ee5('0x24')](function(_0x1423e4){if(!_0x1423e4){throw new db[(_0x6ee5('0x54'))][(_0x6ee5('0x55'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1423e4[_0x6ee5('0x88')]||!_0x1423e4[_0x6ee5('0x89')]){throw new db['Sequelize'][(_0x6ee5('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x23a2ea=_0x1423e4;return getBucketslist(_0x23a2ea[_0x6ee5('0x88')],_0x23a2ea[_0x6ee5('0x89')],_0x491c58[_0x6ee5('0x8a')]);})[_0x6ee5('0x24')](function(_0x48f3e5){if(_0x48f3e5&&_0x48f3e5[_0x6ee5('0x8b')]){var _0x1e0953=_['find'](_0x48f3e5[_0x6ee5('0x8b')],function(_0x576e51){return _0x576e51['Name']===_0x491c58[_0x6ee5('0x73')];});if(!_0x1e0953){logger[_0x6ee5('0x65')](util[_0x6ee5('0x32')](_0x6ee5('0x8c'),_0x2bc980[_0x6ee5('0x46')]['id'],_0x491c58[_0x6ee5('0x73')]));return createBucket(_0x23a2ea[_0x6ee5('0x88')],_0x23a2ea['data2'],_0x491c58[_0x6ee5('0x8a')],_0x491c58[_0x6ee5('0x73')]);}logger[_0x6ee5('0x65')](util[_0x6ee5('0x32')](_0x6ee5('0x8d'),_0x2bc980[_0x6ee5('0x46')]['id'],_0x491c58[_0x6ee5('0x73')]));return;}})[_0x6ee5('0x24')](function(_0x47a8d3){if(_0x510814[_0x6ee5('0x79')]===_0x6ee5('0x8e')){return transcribe(_0x2bc980[_0x6ee5('0x46')]['id'],_0x23a2ea[_0x6ee5('0x88')],_0x23a2ea['data2'],_0x491c58[_0x6ee5('0x8a')],_0x491c58[_0x6ee5('0x73')],_0x510814[_0x6ee5('0x4f')],_0x491c58[_0x6ee5('0x85')]);}else{logger[_0x6ee5('0x65')](util[_0x6ee5('0x32')](_0x6ee5('0x8f'),_0x2bc980[_0x6ee5('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x6ee5('0x24')](function(_0x10636a){if(_0x10636a){_0x10636a['tempSentiment']=_0x2bc980['body']['runSentiment'];return _0x510814['updateAttributes'](_0x10636a);}})[_0x6ee5('0x24')](respondWithResult(_0x4476bc,null))['catch'](handleError(_0x4476bc,null));};function writeFile(_0x4ed878,_0x34c134){return new Promise(function(_0x3b1c18,_0x3f173f){fs[_0x6ee5('0x90')](_0x34c134,_0x4ed878,function(_0x141a2c,_0x144a37){if(_0x141a2c){return _0x3f173f(_0x141a2c);}else{return _0x3b1c18(_0x144a37);}});});}exports[_0x6ee5('0x91')]=function(_0x1013b9,_0x58e21f,_0x1a0c3f){return db['VoiceRecording']['findOne']({'where':{'id':_0x1013b9[_0x6ee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x58e21f))[_0x6ee5('0x24')](function(_0x2fc8da){if(_0x2fc8da&&_0x2fc8da['fileText']){var _0x181524=_0x2fc8da[_0x6ee5('0x92')];var _0x4700d5=config['root']+_0x6ee5('0x93')+_0x2fc8da['id']+_0x6ee5('0x94');if(fs[_0x6ee5('0x50')](_0x4700d5)){return _0x4700d5;}return writeFile(_0x181524,_0x4700d5)[_0x6ee5('0x24')](function(){return _0x4700d5;});}else{throw new db[(_0x6ee5('0x54'))]['ValidationError'](_0x6ee5('0x95'));}})[_0x6ee5('0x24')](function(_0x4475bf){return _0x58e21f['download'](_0x4475bf);})['catch'](handleError(_0x58e21f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index ffdbd85..03e1cbb 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 _0x96c7=['moment','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x96c7,0x1a1));var _0x796c=function(_0x231e7c,_0x22bb4b){_0x231e7c=_0x231e7c-0x0;var _0x292777=_0x96c7[_0x231e7c];return _0x292777;};'use strict';var _=require(_0x796c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x796c('0x1'));var BPromise=require('bluebird');var rp=require(_0x796c('0x2'));var fs=require('fs');var path=require(_0x796c('0x3'));var rimraf=require(_0x796c('0x4'));var config=require(_0x796c('0x5'));var attributes=require(_0x796c('0x6'));module[_0x796c('0x7')]=function(_0x5d14c3,_0x151fd3){return _0x5d14c3[_0x796c('0x8')](_0x796c('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x796c('0xa'),'fields':[_0x796c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c4b=['define','VoiceRecording','voice_recordings','uniqueid','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6c4b,0x9e));var _0xb6c4=function(_0x1b596f,_0x1d0814){_0x1b596f=_0x1b596f-0x0;var _0x48c840=_0x6c4b[_0x1b596f];return _0x48c840;};'use strict';var _=require(_0xb6c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6c4('0x1'));var moment=require(_0xb6c4('0x2'));var BPromise=require(_0xb6c4('0x3'));var rp=require(_0xb6c4('0x4'));var fs=require('fs');var path=require(_0xb6c4('0x5'));var rimraf=require('rimraf');var config=require(_0xb6c4('0x6'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x152e43,_0x3eb1cd){return _0x152e43[_0xb6c4('0x7')](_0xb6c4('0x8'),attributes,{'tableName':_0xb6c4('0x9'),'paranoid':![],'indexes':[{'name':_0xb6c4('0xa'),'fields':[_0xb6c4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index acf67b2..f8a6316 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 _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3979e6,_0xffbb97){var _0x36e7b2=function(_0x695e51){while(--_0x695e51){_0x3979e6['push'](_0x3979e6['shift']());}};_0x36e7b2(++_0xffbb97);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file +var _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x396883,_0x5851ff){var _0x3b64d4=function(_0x3f271f){while(--_0x3f271f){_0x396883['push'](_0x396883['shift']());}};_0x3b64d4(++_0x5851ff);}(_0x4975,0x86));var _0x5497=function(_0x3fd941,_0x437716){_0x3fd941=_0x3fd941-0x0;var _0x1e4153=_0x4975[_0x3fd941];return _0x1e4153;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a7b67d1..7f58dbd 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 _0xce72=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x554a48,_0x3b0b29){var _0x4cd1dc=function(_0x420dff){while(--_0x420dff){_0x554a48['push'](_0x554a48['shift']());}};_0x4cd1dc(++_0x3b0b29);}(_0xce72,0x1bc));var _0x2ce7=function(_0x2917eb,_0x4fe90e){_0x2917eb=_0x2917eb-0x0;var _0x29a645=_0xce72[_0x2917eb];return _0x29a645;};'use strict';var multer=require(_0x2ce7('0x0'));var util=require(_0x2ce7('0x1'));var path=require(_0x2ce7('0x2'));var timeout=require(_0x2ce7('0x3'));var express=require(_0x2ce7('0x4'));var router=express[_0x2ce7('0x5')]();var fs_extra=require(_0x2ce7('0x6'));var auth=require(_0x2ce7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2ce7('0x8'));var controller=require(_0x2ce7('0x9'));router['get']('/',auth[_0x2ce7('0xa')](),controller[_0x2ce7('0xb')]);router[_0x2ce7('0xc')](_0x2ce7('0xd'),auth[_0x2ce7('0xa')](),controller[_0x2ce7('0xe')]);router['get'](_0x2ce7('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2ce7('0x10')]('/',auth[_0x2ce7('0xa')](),controller[_0x2ce7('0x11')]);router[_0x2ce7('0x12')]('/:id',auth[_0x2ce7('0xa')](),controller[_0x2ce7('0x13')]);router[_0x2ce7('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2ce7('0x15')]=router; \ No newline at end of file +var _0x310a=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x310a,0xe1));var _0xa310=function(_0x37d228,_0x46b069){_0x37d228=_0x37d228-0x0;var _0x1cf3a4=_0x310a[_0x37d228];return _0x1cf3a4;};'use strict';var multer=require('multer');var util=require(_0xa310('0x0'));var path=require(_0xa310('0x1'));var timeout=require(_0xa310('0x2'));var express=require(_0xa310('0x3'));var router=express['Router']();var fs_extra=require(_0xa310('0x4'));var auth=require(_0xa310('0x5'));var interaction=require(_0xa310('0x6'));var config=require(_0xa310('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xa310('0x8')]('/',auth[_0xa310('0x9')](),controller[_0xa310('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa310('0xb')]);router[_0xa310('0x8')](_0xa310('0xc'),auth[_0xa310('0x9')](),controller[_0xa310('0xd')]);router[_0xa310('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa310('0xf')](_0xa310('0xc'),auth[_0xa310('0x9')](),controller[_0xa310('0x10')]);router[_0xa310('0x11')](_0xa310('0xc'),auth[_0xa310('0x9')](),controller[_0xa310('0x12')]);module[_0xa310('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1ab3579..2852171 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 _0xa8ea=['exports','ENUM','blind','attended','STRING','Yes','moment'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0xa8ea,0xd8));var _0xaa8e=function(_0x43600e,_0x37ec91){_0x43600e=_0x43600e-0x0;var _0x31f1a3=_0xa8ea[_0x43600e];return _0x31f1a3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaa8e('0x0'));module[_0xaa8e('0x1')]={'type':{'type':Sequelize[_0xaa8e('0x2')](_0xaa8e('0x3'),_0xaa8e('0x4'))},'result':{'type':Sequelize[_0xaa8e('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xaa8e('0x5')]},'transferercalleridname':{'type':Sequelize[_0xaa8e('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xaa8e('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xaa8e('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xaa8e('0x5')]},'transferercontext':{'type':Sequelize[_0xaa8e('0x5')]},'transfererexten':{'type':Sequelize[_0xaa8e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xaa8e('0x5')]},'transfereechannel':{'type':Sequelize[_0xaa8e('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xaa8e('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xaa8e('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xaa8e('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xaa8e('0x5')]},'transfereeexten':{'type':Sequelize[_0xaa8e('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xaa8e('0x5')]},'isexternal':{'type':Sequelize[_0xaa8e('0x2')](_0xaa8e('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xaa8e('0x5')]}}; \ No newline at end of file +var _0x046a=['ENUM','blind','attended','STRING','Yes','sequelize','moment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x046a,0x1d5));var _0xa046=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x046a[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require(_0xa046('0x0'));var moment=require(_0xa046('0x1'));module[_0xa046('0x2')]={'type':{'type':Sequelize[_0xa046('0x3')](_0xa046('0x4'),_0xa046('0x5'))},'result':{'type':Sequelize[_0xa046('0x6')]},'transfererchannel':{'type':Sequelize[_0xa046('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xa046('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xa046('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0xa046('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xa046('0x6')]},'transferercontext':{'type':Sequelize[_0xa046('0x6')]},'transfererexten':{'type':Sequelize[_0xa046('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xa046('0x6')]},'transfereechannel':{'type':Sequelize[_0xa046('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xa046('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa046('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa046('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xa046('0x6')]},'transfereecontext':{'type':Sequelize[_0xa046('0x6')]},'transfereeexten':{'type':Sequelize[_0xa046('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xa046('0x6')]},'isexternal':{'type':Sequelize[_0xa046('0x3')](_0xa046('0x7'),'No')},'context':{'type':Sequelize[_0xa046('0x6')]},'extension':{'type':Sequelize[_0xa046('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c97c0a8..9c0b8fc 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 _0x77ce=['order','sort','where','pick','filter','merge','options','then','count','include','findAll','catch','show','params','intersection','length','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','update','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x548618,_0x189fe2){var _0x2352bf=function(_0x32d8e8){while(--_0x32d8e8){_0x548618['push'](_0x548618['shift']());}};_0x2352bf(++_0x189fe2);}(_0x77ce,0xfc));var _0xe77c=function(_0x22c1e1,_0x35e245){_0x22c1e1=_0x22c1e1-0x0;var _0x95c41d=_0x77ce[_0x22c1e1];return _0x95c41d;};'use strict';var emlformat=require(_0xe77c('0x0'));var rimraf=require(_0xe77c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe77c('0x2'));var rp=require('request-promise');var moment=require(_0xe77c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe77c('0x4'));var util=require(_0xe77c('0x5'));var path=require(_0xe77c('0x6'));var sox=require(_0xe77c('0x7'));var csv=require(_0xe77c('0x8'));var ejs=require(_0xe77c('0x9'));var fs=require('fs');var fs_extra=require(_0xe77c('0xa'));var _=require(_0xe77c('0xb'));var squel=require(_0xe77c('0xc'));var crypto=require(_0xe77c('0xd'));var jsforce=require(_0xe77c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe77c('0x8'));var querystring=require(_0xe77c('0xf'));var Papa=require(_0xe77c('0x10'));var Redis=require(_0xe77c('0x11'));var authService=require(_0xe77c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe77c('0x13'));var hardwareService=require(_0xe77c('0x14'));var logger=require(_0xe77c('0x15'))(_0xe77c('0x16'));var utils=require('../../config/utils');var config=require(_0xe77c('0x17'));var licenseUtil=require(_0xe77c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d9f4,_0x1407dc){_0x1407dc=_0x1407dc||0xcc;return function(_0x1f93c8){if(_0x1f93c8){return _0x59d9f4[_0xe77c('0x19')](_0x1407dc);}return _0x59d9f4[_0xe77c('0x1a')](_0x1407dc)['end']();};}function respondWithResult(_0x56863f,_0x2735db){_0x2735db=_0x2735db||0xc8;return function(_0x597f1c){if(_0x597f1c){return _0x56863f[_0xe77c('0x1a')](_0x2735db)['json'](_0x597f1c);}};}function respondWithFilteredResult(_0x5ed221,_0x253091){return function(_0x49cbf5){if(_0x49cbf5){var _0x1324ba=typeof _0x253091[_0xe77c('0x1b')]===_0xe77c('0x1c')&&typeof _0x253091[_0xe77c('0x1d')]==='undefined';var _0x2314db=_0x49cbf5['count'];var _0x1ada4e=_0x1324ba?0x0:_0x253091[_0xe77c('0x1b')];var _0x3cf59f=_0x1324ba?_0x49cbf5['count']:_0x253091[_0xe77c('0x1b')]+_0x253091[_0xe77c('0x1d')];var _0x181817;if(_0x3cf59f>=_0x2314db){_0x3cf59f=_0x2314db;_0x181817=0xc8;}else{_0x181817=0xce;}_0x5ed221[_0xe77c('0x1a')](_0x181817);return _0x5ed221[_0xe77c('0x1e')](_0xe77c('0x1f'),_0x1ada4e+'-'+_0x3cf59f+'/'+_0x2314db)[_0xe77c('0x20')](_0x49cbf5);}return null;};}function patchUpdates(_0x259025){return function(_0x19f9cb){try{jsonpatch['apply'](_0x19f9cb,_0x259025,!![]);}catch(_0x209822){return BPromise[_0xe77c('0x21')](_0x209822);}return _0x19f9cb[_0xe77c('0x22')]();};}function saveUpdates(_0x445f16,_0x4a14b1){return function(_0x1723fe){if(_0x1723fe){return _0x1723fe[_0xe77c('0x23')](_0x445f16)['then'](function(_0x43b3e8){return _0x43b3e8;});}return null;};}function removeEntity(_0x2baf92,_0x5693cd){return function(_0xd1d865){if(_0xd1d865){return _0xd1d865['destroy']()['then'](function(){_0x2baf92[_0xe77c('0x1a')](0xcc)[_0xe77c('0x24')]();});}};}function handleEntityNotFound(_0x1e5825,_0x19481e){return function(_0x50ad2a){if(!_0x50ad2a){_0x1e5825[_0xe77c('0x19')](0x194);}return _0x50ad2a;};}function handleError(_0x138b24,_0x3e42cf){_0x3e42cf=_0x3e42cf||0x1f4;return function(_0x7e035c){logger[_0xe77c('0x25')](_0x7e035c[_0xe77c('0x26')]);if(_0x7e035c['name']){delete _0x7e035c[_0xe77c('0x27')];}_0x138b24[_0xe77c('0x1a')](_0x3e42cf)[_0xe77c('0x28')](_0x7e035c);};}exports[_0xe77c('0x29')]=function(_0x3c3430,_0x24d4d2){var _0x161720={},_0x43fe0d={},_0x3d1f3d={'count':0x0,'rows':[]};var _0x4748b5=_[_0xe77c('0x2a')](db[_0xe77c('0x2b')][_0xe77c('0x2c')],function(_0x39ac98){return{'name':_0x39ac98[_0xe77c('0x2d')],'type':_0x39ac98[_0xe77c('0x2e')][_0xe77c('0x2f')]};});_0x43fe0d['model']=_['map'](_0x4748b5,_0xe77c('0x27'));_0x43fe0d[_0xe77c('0x30')]=_[_0xe77c('0x31')](_0x3c3430[_0xe77c('0x30')]);_0x43fe0d[_0xe77c('0x32')]=_['intersection'](_0x43fe0d[_0xe77c('0x33')],_0x43fe0d[_0xe77c('0x30')]);_0x161720[_0xe77c('0x34')]=_['intersection'](_0x43fe0d[_0xe77c('0x33')],qs[_0xe77c('0x35')](_0x3c3430['query'][_0xe77c('0x35')]));_0x161720[_0xe77c('0x34')]=_0x161720['attributes']['length']?_0x161720[_0xe77c('0x34')]:_0x43fe0d[_0xe77c('0x33')];if(!_0x3c3430[_0xe77c('0x30')][_0xe77c('0x36')](_0xe77c('0x37'))){_0x161720[_0xe77c('0x1d')]=qs[_0xe77c('0x1d')](_0x3c3430[_0xe77c('0x30')]['limit']);_0x161720[_0xe77c('0x1b')]=qs[_0xe77c('0x1b')](_0x3c3430[_0xe77c('0x30')][_0xe77c('0x1b')]);}_0x161720[_0xe77c('0x38')]=qs['sort'](_0x3c3430[_0xe77c('0x30')][_0xe77c('0x39')]);_0x161720[_0xe77c('0x3a')]=qs[_0xe77c('0x32')](_[_0xe77c('0x3b')](_0x3c3430[_0xe77c('0x30')],_0x43fe0d[_0xe77c('0x32')]),_0x4748b5);if(_0x3c3430[_0xe77c('0x30')][_0xe77c('0x3c')]){_0x161720['where']=_[_0xe77c('0x3d')](_0x161720[_0xe77c('0x3a')],{'$or':_[_0xe77c('0x2a')](_0x4748b5,function(_0x2b9ad4){if(_0x2b9ad4[_0xe77c('0x2e')]!=='VIRTUAL'){var _0x10d75d={};_0x10d75d[_0x2b9ad4[_0xe77c('0x27')]]={'$like':'%'+_0x3c3430[_0xe77c('0x30')][_0xe77c('0x3c')]+'%'};return _0x10d75d;}})});}_0x161720=_[_0xe77c('0x3d')]({},_0x161720,_0x3c3430[_0xe77c('0x3e')]);var _0x3d0678={'where':_0x161720[_0xe77c('0x3a')]};return db['VoiceTransferReport']['count'](_0x3d0678)[_0xe77c('0x3f')](function(_0x1048a9){_0x3d1f3d[_0xe77c('0x40')]=_0x1048a9;if(_0x3c3430[_0xe77c('0x30')]['includeAll']){_0x161720[_0xe77c('0x41')]=[{'all':!![]}];}return db[_0xe77c('0x2b')][_0xe77c('0x42')](_0x161720);})[_0xe77c('0x3f')](function(_0x4702ac){_0x3d1f3d['rows']=_0x4702ac;return _0x3d1f3d;})[_0xe77c('0x3f')](respondWithFilteredResult(_0x24d4d2,_0x161720))[_0xe77c('0x43')](handleError(_0x24d4d2,null));};exports[_0xe77c('0x44')]=function(_0x48159b,_0x4725f7){var _0x17bfa8={'raw':!![],'where':{'id':_0x48159b[_0xe77c('0x45')]['id']}},_0x249db4={};_0x249db4[_0xe77c('0x33')]=_['keys'](db[_0xe77c('0x2b')]['rawAttributes']);_0x249db4[_0xe77c('0x30')]=_[_0xe77c('0x31')](_0x48159b[_0xe77c('0x30')]);_0x249db4[_0xe77c('0x32')]=_[_0xe77c('0x46')](_0x249db4['model'],_0x249db4[_0xe77c('0x30')]);_0x17bfa8['attributes']=_[_0xe77c('0x46')](_0x249db4[_0xe77c('0x33')],qs['fields'](_0x48159b['query'][_0xe77c('0x35')]));_0x17bfa8[_0xe77c('0x34')]=_0x17bfa8['attributes'][_0xe77c('0x47')]?_0x17bfa8[_0xe77c('0x34')]:_0x249db4[_0xe77c('0x33')];if(_0x48159b[_0xe77c('0x30')]['includeAll']){_0x17bfa8[_0xe77c('0x41')]=[{'all':!![]}];}_0x17bfa8=_[_0xe77c('0x3d')]({},_0x17bfa8,_0x48159b[_0xe77c('0x3e')]);return db['VoiceTransferReport']['find'](_0x17bfa8)['then'](handleEntityNotFound(_0x4725f7,null))[_0xe77c('0x3f')](respondWithResult(_0x4725f7,null))['catch'](handleError(_0x4725f7,null));};exports['create']=function(_0x397547,_0x20c7ba){return db[_0xe77c('0x2b')][_0xe77c('0x48')](_0x397547[_0xe77c('0x49')],{})[_0xe77c('0x3f')](respondWithResult(_0x20c7ba,0xc9))[_0xe77c('0x43')](handleError(_0x20c7ba,null));};exports[_0xe77c('0x23')]=function(_0x1192c2,_0x3aa1ab){if(_0x1192c2[_0xe77c('0x49')]['id']){delete _0x1192c2[_0xe77c('0x49')]['id'];}return db[_0xe77c('0x2b')][_0xe77c('0x4a')]({'where':{'id':_0x1192c2['params']['id']}})[_0xe77c('0x3f')](handleEntityNotFound(_0x3aa1ab,null))[_0xe77c('0x3f')](saveUpdates(_0x1192c2[_0xe77c('0x49')],null))[_0xe77c('0x3f')](respondWithResult(_0x3aa1ab,null))[_0xe77c('0x43')](handleError(_0x3aa1ab,null));};exports[_0xe77c('0x4b')]=function(_0x42e8fb,_0x1b7f48){return db[_0xe77c('0x2b')][_0xe77c('0x4a')]({'where':{'id':_0x42e8fb[_0xe77c('0x45')]['id']}})[_0xe77c('0x3f')](handleEntityNotFound(_0x1b7f48,null))[_0xe77c('0x3f')](removeEntity(_0x1b7f48,null))[_0xe77c('0x43')](handleError(_0x1b7f48,null));};exports['describe']=function(_0x376be9,_0x29504c){return db['VoiceTransferReport'][_0xe77c('0x4c')]()['then'](respondWithResult(_0x29504c,null))[_0xe77c('0x43')](handleError(_0x29504c,null));}; \ No newline at end of file +var _0xbde4=['findAll','rows','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','VoiceTransferReport','includeAll'];(function(_0x7256b9,_0x56b44d){var _0x4d912e=function(_0x230fee){while(--_0x230fee){_0x7256b9['push'](_0x7256b9['shift']());}};_0x4d912e(++_0x56b44d);}(_0xbde4,0x131));var _0x4bde=function(_0x599055,_0x29cf60){_0x599055=_0x599055-0x0;var _0x312b22=_0xbde4[_0x599055];return _0x312b22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4bde('0x0'));var jsonpatch=require(_0x4bde('0x1'));var rp=require(_0x4bde('0x2'));var moment=require(_0x4bde('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4bde('0x4'));var util=require(_0x4bde('0x5'));var path=require(_0x4bde('0x6'));var sox=require(_0x4bde('0x7'));var csv=require(_0x4bde('0x8'));var ejs=require(_0x4bde('0x9'));var fs=require('fs');var fs_extra=require(_0x4bde('0xa'));var _=require(_0x4bde('0xb'));var squel=require(_0x4bde('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4bde('0xd'));var toCsv=require(_0x4bde('0x8'));var querystring=require(_0x4bde('0xe'));var Papa=require('papaparse');var Redis=require(_0x4bde('0xf'));var authService=require(_0x4bde('0x10'));var qs=require(_0x4bde('0x11'));var as=require(_0x4bde('0x12'));var hardwareService=require(_0x4bde('0x13'));var logger=require(_0x4bde('0x14'))(_0x4bde('0x15'));var utils=require(_0x4bde('0x16'));var config=require(_0x4bde('0x17'));var licenseUtil=require(_0x4bde('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112a77,_0x22eb09){_0x22eb09=_0x22eb09||0xcc;return function(_0x2445d0){if(_0x2445d0){return _0x112a77[_0x4bde('0x19')](_0x22eb09);}return _0x112a77[_0x4bde('0x1a')](_0x22eb09)[_0x4bde('0x1b')]();};}function respondWithResult(_0x108ff9,_0x33aa93){_0x33aa93=_0x33aa93||0xc8;return function(_0x382bd4){if(_0x382bd4){return _0x108ff9[_0x4bde('0x1a')](_0x33aa93)[_0x4bde('0x1c')](_0x382bd4);}};}function respondWithFilteredResult(_0x3eae83,_0x2d86d8){return function(_0x24b4ea){if(_0x24b4ea){var _0x250044=typeof _0x2d86d8[_0x4bde('0x1d')]===_0x4bde('0x1e')&&typeof _0x2d86d8['limit']==='undefined';var _0x378938=_0x24b4ea['count'];var _0x3f536c=_0x250044?0x0:_0x2d86d8[_0x4bde('0x1d')];var _0x4612fc=_0x250044?_0x24b4ea[_0x4bde('0x1f')]:_0x2d86d8['offset']+_0x2d86d8['limit'];var _0x1647bd;if(_0x4612fc>=_0x378938){_0x4612fc=_0x378938;_0x1647bd=0xc8;}else{_0x1647bd=0xce;}_0x3eae83[_0x4bde('0x1a')](_0x1647bd);return _0x3eae83[_0x4bde('0x20')]('Content-Range',_0x3f536c+'-'+_0x4612fc+'/'+_0x378938)[_0x4bde('0x1c')](_0x24b4ea);}return null;};}function patchUpdates(_0x1cca73){return function(_0x19d745){try{jsonpatch[_0x4bde('0x21')](_0x19d745,_0x1cca73,!![]);}catch(_0x3be4a5){return BPromise[_0x4bde('0x22')](_0x3be4a5);}return _0x19d745[_0x4bde('0x23')]();};}function saveUpdates(_0x373f59,_0x4dbc7a){return function(_0x5f3bc1){if(_0x5f3bc1){return _0x5f3bc1[_0x4bde('0x24')](_0x373f59)[_0x4bde('0x25')](function(_0x2ef74f){return _0x2ef74f;});}return null;};}function removeEntity(_0x106f12,_0x4f7f97){return function(_0xca411d){if(_0xca411d){return _0xca411d[_0x4bde('0x26')]()[_0x4bde('0x25')](function(){_0x106f12[_0x4bde('0x1a')](0xcc)[_0x4bde('0x1b')]();});}};}function handleEntityNotFound(_0x5cd1f6,_0x42df0d){return function(_0x551a7d){if(!_0x551a7d){_0x5cd1f6[_0x4bde('0x19')](0x194);}return _0x551a7d;};}function handleError(_0x41d1b5,_0xc088da){_0xc088da=_0xc088da||0x1f4;return function(_0x13e0c7){logger[_0x4bde('0x27')](_0x13e0c7[_0x4bde('0x28')]);if(_0x13e0c7[_0x4bde('0x29')]){delete _0x13e0c7['name'];}_0x41d1b5[_0x4bde('0x1a')](_0xc088da)[_0x4bde('0x2a')](_0x13e0c7);};}exports[_0x4bde('0x2b')]=function(_0x1922f7,_0x369435){var _0x48784e={},_0x3a5818={},_0x4f8ae8={'count':0x0,'rows':[]};var _0x5815b2=_[_0x4bde('0x2c')](db['VoiceTransferReport']['rawAttributes'],function(_0x4772d6){return{'name':_0x4772d6[_0x4bde('0x2d')],'type':_0x4772d6[_0x4bde('0x2e')]['key']};});_0x3a5818[_0x4bde('0x2f')]=_[_0x4bde('0x2c')](_0x5815b2,_0x4bde('0x29'));_0x3a5818[_0x4bde('0x30')]=_[_0x4bde('0x31')](_0x1922f7['query']);_0x3a5818[_0x4bde('0x32')]=_[_0x4bde('0x33')](_0x3a5818['model'],_0x3a5818['query']);_0x48784e[_0x4bde('0x34')]=_[_0x4bde('0x33')](_0x3a5818[_0x4bde('0x2f')],qs[_0x4bde('0x35')](_0x1922f7[_0x4bde('0x30')][_0x4bde('0x35')]));_0x48784e[_0x4bde('0x34')]=_0x48784e[_0x4bde('0x34')][_0x4bde('0x36')]?_0x48784e['attributes']:_0x3a5818['model'];if(!_0x1922f7['query'][_0x4bde('0x37')]('nolimit')){_0x48784e[_0x4bde('0x38')]=qs[_0x4bde('0x38')](_0x1922f7[_0x4bde('0x30')]['limit']);_0x48784e[_0x4bde('0x1d')]=qs['offset'](_0x1922f7[_0x4bde('0x30')][_0x4bde('0x1d')]);}_0x48784e['order']=qs[_0x4bde('0x39')](_0x1922f7['query'][_0x4bde('0x39')]);_0x48784e[_0x4bde('0x3a')]=qs[_0x4bde('0x32')](_[_0x4bde('0x3b')](_0x1922f7[_0x4bde('0x30')],_0x3a5818[_0x4bde('0x32')]),_0x5815b2);if(_0x1922f7['query'][_0x4bde('0x3c')]){_0x48784e[_0x4bde('0x3a')]=_['merge'](_0x48784e[_0x4bde('0x3a')],{'$or':_['map'](_0x5815b2,function(_0x495473){if(_0x495473['type']!=='VIRTUAL'){var _0x16eb94={};_0x16eb94[_0x495473['name']]={'$like':'%'+_0x1922f7[_0x4bde('0x30')][_0x4bde('0x3c')]+'%'};return _0x16eb94;}})});}_0x48784e=_[_0x4bde('0x3d')]({},_0x48784e,_0x1922f7[_0x4bde('0x3e')]);var _0x5122ef={'where':_0x48784e[_0x4bde('0x3a')]};return db[_0x4bde('0x3f')][_0x4bde('0x1f')](_0x5122ef)[_0x4bde('0x25')](function(_0x31279a){_0x4f8ae8[_0x4bde('0x1f')]=_0x31279a;if(_0x1922f7[_0x4bde('0x30')][_0x4bde('0x40')]){_0x48784e['include']=[{'all':!![]}];}return db[_0x4bde('0x3f')][_0x4bde('0x41')](_0x48784e);})[_0x4bde('0x25')](function(_0x1758d7){_0x4f8ae8[_0x4bde('0x42')]=_0x1758d7;return _0x4f8ae8;})[_0x4bde('0x25')](respondWithFilteredResult(_0x369435,_0x48784e))[_0x4bde('0x43')](handleError(_0x369435,null));};exports[_0x4bde('0x44')]=function(_0x472f37,_0x192e0d){var _0x2acbce={'raw':!![],'where':{'id':_0x472f37[_0x4bde('0x45')]['id']}},_0x21a9ea={};_0x21a9ea[_0x4bde('0x2f')]=_['keys'](db[_0x4bde('0x3f')]['rawAttributes']);_0x21a9ea[_0x4bde('0x30')]=_[_0x4bde('0x31')](_0x472f37['query']);_0x21a9ea[_0x4bde('0x32')]=_[_0x4bde('0x33')](_0x21a9ea[_0x4bde('0x2f')],_0x21a9ea[_0x4bde('0x30')]);_0x2acbce[_0x4bde('0x34')]=_['intersection'](_0x21a9ea[_0x4bde('0x2f')],qs['fields'](_0x472f37[_0x4bde('0x30')][_0x4bde('0x35')]));_0x2acbce[_0x4bde('0x34')]=_0x2acbce[_0x4bde('0x34')][_0x4bde('0x36')]?_0x2acbce[_0x4bde('0x34')]:_0x21a9ea[_0x4bde('0x2f')];if(_0x472f37['query'][_0x4bde('0x40')]){_0x2acbce['include']=[{'all':!![]}];}_0x2acbce=_[_0x4bde('0x3d')]({},_0x2acbce,_0x472f37[_0x4bde('0x3e')]);return db[_0x4bde('0x3f')][_0x4bde('0x46')](_0x2acbce)[_0x4bde('0x25')](handleEntityNotFound(_0x192e0d,null))['then'](respondWithResult(_0x192e0d,null))[_0x4bde('0x43')](handleError(_0x192e0d,null));};exports[_0x4bde('0x47')]=function(_0x1224ad,_0x1a9a75){return db[_0x4bde('0x3f')][_0x4bde('0x47')](_0x1224ad[_0x4bde('0x48')],{})[_0x4bde('0x25')](respondWithResult(_0x1a9a75,0xc9))['catch'](handleError(_0x1a9a75,null));};exports[_0x4bde('0x24')]=function(_0x724da0,_0x5f04e4){if(_0x724da0[_0x4bde('0x48')]['id']){delete _0x724da0[_0x4bde('0x48')]['id'];}return db[_0x4bde('0x3f')][_0x4bde('0x46')]({'where':{'id':_0x724da0[_0x4bde('0x45')]['id']}})[_0x4bde('0x25')](handleEntityNotFound(_0x5f04e4,null))[_0x4bde('0x25')](saveUpdates(_0x724da0[_0x4bde('0x48')],null))[_0x4bde('0x25')](respondWithResult(_0x5f04e4,null))['catch'](handleError(_0x5f04e4,null));};exports[_0x4bde('0x26')]=function(_0x3c2206,_0x55b581){return db[_0x4bde('0x3f')][_0x4bde('0x46')]({'where':{'id':_0x3c2206[_0x4bde('0x45')]['id']}})[_0x4bde('0x25')](handleEntityNotFound(_0x55b581,null))[_0x4bde('0x25')](removeEntity(_0x55b581,null))['catch'](handleError(_0x55b581,null));};exports[_0x4bde('0x49')]=function(_0x1d2cfe,_0x57166a){return db['VoiceTransferReport'][_0x4bde('0x49')]()[_0x4bde('0x25')](respondWithResult(_0x57166a,null))[_0x4bde('0x43')](handleError(_0x57166a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index e4d5647..3188a35 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 _0x74b9=['util','../../config/logger','moment','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x74b9,0x1eb));var _0x974b=function(_0x323419,_0x397e65){_0x323419=_0x323419-0x0;var _0x3757fc=_0x74b9[_0x323419];return _0x3757fc;};'use strict';var _=require(_0x974b('0x0'));var util=require(_0x974b('0x1'));var logger=require(_0x974b('0x2'))('api');var moment=require(_0x974b('0x3'));var BPromise=require('bluebird');var rp=require(_0x974b('0x4'));var fs=require('fs');var path=require(_0x974b('0x5'));var rimraf=require('rimraf');var config=require(_0x974b('0x6'));var attributes=require(_0x974b('0x7'));module[_0x974b('0x8')]=function(_0x5c91d8,_0xe4dd64){return _0x5c91d8[_0x974b('0x9')](_0x974b('0xa'),attributes,{'tableName':_0x974b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa071=['define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x46b49a,_0x34d290){var _0x41ec40=function(_0x5632b0){while(--_0x5632b0){_0x46b49a['push'](_0x46b49a['shift']());}};_0x41ec40(++_0x34d290);}(_0xa071,0x19b));var _0x1a07=function(_0x303b13,_0x19e1b7){_0x303b13=_0x303b13-0x0;var _0x4a1f35=_0xa071[_0x303b13];return _0x4a1f35;};'use strict';var _=require('lodash');var util=require(_0x1a07('0x0'));var logger=require(_0x1a07('0x1'))('api');var moment=require(_0x1a07('0x2'));var BPromise=require(_0x1a07('0x3'));var rp=require(_0x1a07('0x4'));var fs=require('fs');var path=require(_0x1a07('0x5'));var rimraf=require(_0x1a07('0x6'));var config=require(_0x1a07('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x1a07('0x8')]=function(_0x4e0165,_0x1a2c88){return _0x4e0165[_0x1a07('0x9')]('VoiceTransferReport',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 2a8de85..d254b36 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 _0x619e=['body','options','raw','debug','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0xcc6ab6,_0x5db2d8){var _0x1648db=function(_0x3b122a){while(--_0x3b122a){_0xcc6ab6['push'](_0xcc6ab6['shift']());}};_0x1648db(++_0x5db2d8);}(_0x619e,0x13c));var _0xe619=function(_0x31bcbe,_0x4ce65b){_0x31bcbe=_0x31bcbe-0x0;var _0x485320=_0x619e[_0x31bcbe];return _0x485320;};'use strict';var _=require(_0xe619('0x0'));var util=require(_0xe619('0x1'));var moment=require(_0xe619('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe619('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe619('0x4'))(_0xe619('0x5'));var config=require('../../config/environment');var jayson=require(_0xe619('0x6'));var client=jayson['client'][_0xe619('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2953f4,_0x25d67b,_0x33fbd8){return new BPromise(function(_0x36b0eb,_0x1da271){return client[_0xe619('0x8')](_0x2953f4,_0x33fbd8)[_0xe619('0x9')](function(_0x4bcd55){logger[_0xe619('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x25d67b,_0xe619('0xb'));logger['debug'](_0xe619('0xc'),_0x25d67b,_0xe619('0xb'),JSON[_0xe619('0xd')](_0x4bcd55));if(_0x4bcd55[_0xe619('0xe')]){if(_0x4bcd55[_0xe619('0xe')][_0xe619('0xf')]===0x1f4){logger[_0xe619('0xe')](_0xe619('0x10'),_0x25d67b,_0x4bcd55[_0xe619('0xe')][_0xe619('0x11')]);return _0x1da271(_0x4bcd55[_0xe619('0xe')][_0xe619('0x11')]);}logger[_0xe619('0xe')](_0xe619('0x10'),_0x25d67b,_0x4bcd55[_0xe619('0xe')][_0xe619('0x11')]);return _0x36b0eb(_0x4bcd55['error'][_0xe619('0x11')]);}else{logger['info'](_0xe619('0x10'),_0x25d67b,'request\x20sent');_0x36b0eb(_0x4bcd55[_0xe619('0x12')]['message']);}})['catch'](function(_0x109408){logger['error'](_0xe619('0x10'),_0x25d67b,_0x109408);_0x1da271(_0x109408);});});}exports[_0xe619('0x13')]=function(_0x194acf){var _0x4c56e2=this;return new Promise(function(_0x5f1c96,_0x3267ca){return db[_0xe619('0x14')][_0xe619('0x15')](_0x194acf[_0xe619('0x16')],{'raw':_0x194acf['options']?_0x194acf[_0xe619('0x17')][_0xe619('0x18')]===undefined?!![]:![]:!![]})[_0xe619('0x9')](function(_0x335ce4){logger[_0xe619('0xa')](_0xe619('0x13'),_0x194acf);logger[_0xe619('0x19')](_0xe619('0x13'),_0x194acf,JSON['stringify'](_0x335ce4));_0x5f1c96(_0x335ce4);})['catch'](function(_0x3dd799){logger[_0xe619('0xe')]('CreateVoiceTransferReport',_0x3dd799[_0xe619('0x11')],_0x194acf);_0x3267ca(_0x4c56e2[_0xe619('0xe')](0x1f4,_0x3dd799[_0xe619('0x11')]));});});}; \ No newline at end of file +var _0x386f=['message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31a0a3,_0x2fecfe){var _0x3f0960=function(_0x494633){while(--_0x494633){_0x31a0a3['push'](_0x31a0a3['shift']());}};_0x3f0960(++_0x2fecfe);}(_0x386f,0x17f));var _0xf386=function(_0x4c8554,_0x3ec57d){_0x4c8554=_0x4c8554-0x0;var _0x95d82f=_0x386f[_0x4c8554];return _0x95d82f;};'use strict';var _=require(_0xf386('0x0'));var util=require(_0xf386('0x1'));var moment=require(_0xf386('0x2'));var BPromise=require(_0xf386('0x3'));var rs=require(_0xf386('0x4'));var fs=require('fs');var Redis=require(_0xf386('0x5'));var db=require(_0xf386('0x6'))['db'];var utils=require(_0xf386('0x7'));var logger=require(_0xf386('0x8'))(_0xf386('0x9'));var config=require(_0xf386('0xa'));var jayson=require(_0xf386('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1efdc2,_0x4b3d25,_0x5b6120){return new BPromise(function(_0x5573d3,_0x57f723){return client[_0xf386('0xc')](_0x1efdc2,_0x5b6120)[_0xf386('0xd')](function(_0x580538){logger['info'](_0xf386('0xe'),_0x4b3d25,_0xf386('0xf'));logger['debug'](_0xf386('0x10'),_0x4b3d25,_0xf386('0xf'),JSON[_0xf386('0x11')](_0x580538));if(_0x580538['error']){if(_0x580538[_0xf386('0x12')][_0xf386('0x13')]===0x1f4){logger[_0xf386('0x12')](_0xf386('0xe'),_0x4b3d25,_0x580538[_0xf386('0x12')][_0xf386('0x14')]);return _0x57f723(_0x580538[_0xf386('0x12')][_0xf386('0x14')]);}logger['error'](_0xf386('0xe'),_0x4b3d25,_0x580538[_0xf386('0x12')][_0xf386('0x14')]);return _0x5573d3(_0x580538['error'][_0xf386('0x14')]);}else{logger[_0xf386('0x15')](_0xf386('0xe'),_0x4b3d25,_0xf386('0xf'));_0x5573d3(_0x580538[_0xf386('0x16')][_0xf386('0x14')]);}})['catch'](function(_0x5c25a9){logger[_0xf386('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b3d25,_0x5c25a9);_0x57f723(_0x5c25a9);});});}exports[_0xf386('0x17')]=function(_0x1c8f1c){var _0x4cf588=this;return new Promise(function(_0x58a765,_0x3f0689){return db[_0xf386('0x18')][_0xf386('0x19')](_0x1c8f1c[_0xf386('0x1a')],{'raw':_0x1c8f1c[_0xf386('0x1b')]?_0x1c8f1c[_0xf386('0x1b')][_0xf386('0x1c')]===undefined?!![]:![]:!![]})[_0xf386('0xd')](function(_0x29d156){logger[_0xf386('0x15')](_0xf386('0x17'),_0x1c8f1c);logger[_0xf386('0x1d')](_0xf386('0x17'),_0x1c8f1c,JSON[_0xf386('0x11')](_0x29d156));_0x58a765(_0x29d156);})[_0xf386('0x1e')](function(_0x3d0bb5){logger['error'](_0xf386('0x17'),_0x3d0bb5[_0xf386('0x14')],_0x1c8f1c);_0x3f0689(_0x4cf588[_0xf386('0x12')](0x1f4,_0x3d0bb5['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index a99cd9c..d38d15d 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 _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x181fcc,_0x5dc5c1){var _0x566074=function(_0xe75c32){while(--_0xe75c32){_0x181fcc['push'](_0x181fcc['shift']());}};_0x566074(++_0x5dc5c1);}(_0xf109,0xce));var _0x9f10=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf109[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x37c456,_0x4ca448){var _0x4e6752=function(_0x1e42d4){while(--_0x1e42d4){_0x37c456['push'](_0x37c456['shift']());}};_0x4e6752(++_0x4ca448);}(_0x5b02,0xe9));var _0x25b0=function(_0x4902e7,_0x1eab2d){_0x4902e7=_0x4902e7-0x0;var _0x536cab=_0x5b02[_0x4902e7];return _0x536cab;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8e82c82..b8f2a2b 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 _0xa902=['webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','message','result','catch','findOne','agent','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','body','validate','json','userId','callNumber','callerId','callbackUrl','format','user:%s','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20fired:','calls','VoiceChannels','all','filter','conference','conference\x20fired:','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','../../config/logger'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa902,0x8d));var _0x2a90=function(_0x2a22e7,_0x2666fe){_0x2a22e7=_0x2a22e7-0x0;var _0x2f8ecf=_0xa902[_0x2a22e7];return _0x2f8ecf;};'use strict';var path=require(_0x2a90('0x0'));var fs=require('fs');var _=require(_0x2a90('0x1'));var db=require(_0x2a90('0x2'))['db'];var config=require(_0x2a90('0x3'));var util=require(_0x2a90('0x4'));var BPromise=require('bluebird');var jayson=require(_0x2a90('0x5'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require(_0x2a90('0x6'))(_0x2a90('0x7'));var Redis=require(_0x2a90('0x8'));config[_0x2a90('0x9')]=_[_0x2a90('0xa')](config[_0x2a90('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2a90('0xb'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'callNumber':{'type':_0x2a90('0xe'),'required':[!![],_0x2a90('0xf')]},'callerId':{'type':_0x2a90('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2a90('0xd')]},'sessionId':{'type':'string','required':[!![],_0x2a90('0x10')]},'transferNumber':{'type':'string','required':[!![],_0x2a90('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2a90('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2a90('0xc'),'required':[!![],_0x2a90('0xd')]}});function emit(_0x312782,_0x25bd0e,_0x3200b4){logger[_0x2a90('0x12')](_0x312782,_0x25bd0e,JSON[_0x2a90('0x13')](_0x3200b4));io['to'](_0x312782)[_0x2a90('0x14')](_0x25bd0e,_0x3200b4);}function handleError(_0x43eea5){return function(_0x5c3e4b){console[_0x2a90('0x15')](_0x2a90('0x16'),_0x5c3e4b,_0x5c3e4b instanceof RangeError);logger[_0x2a90('0x17')](_0x5c3e4b['stack']);if(_0x5c3e4b instanceof RangeError){if(_0x5c3e4b[_0x2a90('0x18')]){delete _0x5c3e4b[_0x2a90('0x18')];}_0x43eea5[_0x2a90('0x19')](0x194)[_0x2a90('0x1a')](_0x5c3e4b);}else{if(_0x5c3e4b[_0x2a90('0x18')]){delete _0x5c3e4b[_0x2a90('0x18')];}_0x43eea5[_0x2a90('0x19')](0x1f4)[_0x2a90('0x1a')](_0x5c3e4b);}};}function checkError(){return function(_0xf97adb){if(!_0xf97adb){throw new RangeError(_0x2a90('0x1b'));}return _0xf97adb;};}function respondWithRpcPromise(_0x1340b9,_0x3ba52a){return new BPromise(function(_0x4fdd62,_0x3da7d0){var _0x217873=amiClient;return _0x217873[_0x2a90('0x1c')](_0x1340b9,_0x3ba52a)[_0x2a90('0x1d')](function(_0x5912fd){if(_0x5912fd[_0x2a90('0x17')]){if(_0x5912fd[_0x2a90('0x17')]['code']===0x1f4){return _0x3da7d0(_0x5912fd[_0x2a90('0x17')][_0x2a90('0x1e')]);}return _0x4fdd62(_0x5912fd[_0x2a90('0x17')][_0x2a90('0x1e')]);}else{_0x4fdd62(_0x5912fd[_0x2a90('0x1f')]);}})[_0x2a90('0x20')](function(_0x29ed73){_0x3da7d0(_0x29ed73);});});}function getAgent(_0x24a6d3){return db['User'][_0x2a90('0x21')]({'where':{'id':_0x24a6d3,'role':_0x2a90('0x22')}})[_0x2a90('0x1d')](checkError());}function getAgentCheckSession(_0x40c61a,_0x8544e5){return new BPromise(function(_0x5208d8,_0x5a51f7){var _0x293765=respondWithRpcPromise('VoiceChannels');var _0x53391e=getAgent(_0x40c61a);Promise['all']([_0x293765,_0x53391e])[_0x2a90('0x1d')](function(_0x3c78f5){var _0x595638=_0x3c78f5[0x0];var _0x5bd700=_0x3c78f5[0x1];var _0x1add9a=_['filter'](_0x595638[_0x2a90('0x23')],function(_0x6892e1){return _0x6892e1[_0x2a90('0x24')]==_0x5bd700['id']&&_0x6892e1[_0x2a90('0x25')]==_0x8544e5;});if(_0x1add9a[_0x2a90('0x26')]==0x1){_0x5208d8(_0x5bd700);}else{_0x5a51f7(new RangeError(_0x2a90('0x27')+_0x8544e5+_0x2a90('0x28')));}});});}exports['originate']=function(_0x427918,_0x22b1f3){logger[_0x2a90('0x12')]('originate\x20fired:',_0x427918[_0x2a90('0x29')]);var _0x425d03=originateValidation[_0x2a90('0x2a')](_0x427918[_0x2a90('0x29')]);if(_0x425d03['length']>0x0){return _0x22b1f3[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x425d03);}var _0xee69e4=_0x427918[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x431942=_0x427918['body'][_0x2a90('0x2d')];var _0xe649cf=_0x427918[_0x2a90('0x29')][_0x2a90('0x2e')];var _0x58a86d=_0x427918[_0x2a90('0x29')][_0x2a90('0x2f')];return getAgent(_0xee69e4)['then'](function(_0x3e5002){logger[_0x2a90('0x12')]('entityFound:',_0x3e5002['name']);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x3e5002[_0x2a90('0x18')]),'webbar:originate',{'callNumber':_0x431942,'callerId':_0xe649cf,'callbackUrl':_0x58a86d});return _0x22b1f3[_0x2a90('0x19')](0xc8)['json']({'error':![],'message':_0x2a90('0x32')});})['catch'](handleError(_0x22b1f3));};exports[_0x2a90('0x33')]=function(_0x5e79ca,_0x5322dc){logger[_0x2a90('0x12')]('hangup\x20fired:',_0x5e79ca[_0x2a90('0x29')]);var _0x97448=hangupValidation[_0x2a90('0x2a')](_0x5e79ca['body']);if(_0x97448[_0x2a90('0x26')]>0x0){return _0x5322dc[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x97448);}var _0x4eb7d9=_0x5e79ca[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x1a9c04=_0x5e79ca['body'][_0x2a90('0x25')];return getAgent(_0x4eb7d9)[_0x2a90('0x1d')](function(_0x504643){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x504643[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x504643[_0x2a90('0x18')]),_0x2a90('0x35'),{'sessionId':_0x1a9c04});return _0x5322dc[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x36')});})[_0x2a90('0x20')](handleError(_0x5322dc));};exports[_0x2a90('0x37')]=function(_0x319610,_0x18a6ea){logger['info'](_0x2a90('0x38'),_0x319610[_0x2a90('0x29')]);var _0x528b41=answerValidation[_0x2a90('0x2a')](_0x319610[_0x2a90('0x29')]);if(_0x528b41[_0x2a90('0x26')]>0x0){return _0x18a6ea[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x528b41);}var _0x54b290=_0x319610[_0x2a90('0x29')]['userId'];var _0x4566a6=_0x319610['body'][_0x2a90('0x25')];return getAgent(_0x54b290)[_0x2a90('0x1d')](function(_0x2d29b8){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x2d29b8[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')]('user:%s',_0x2d29b8['name']),_0x2a90('0x39'),{'sessionId':_0x4566a6});return _0x18a6ea[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x3a')});})[_0x2a90('0x20')](handleError(_0x18a6ea));};exports[_0x2a90('0x3b')]=function(_0x654803,_0x1fb729){logger['info'](_0x2a90('0x3c'),_0x654803['body']);var _0x3e0380=holdValidation[_0x2a90('0x2a')](_0x654803['body']);if(_0x3e0380[_0x2a90('0x26')]>0x0){return _0x1fb729[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x3e0380);}var _0x1d55db=_0x654803[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x3ad6c2=_0x654803['body']['sessionId'];return getAgent(_0x1d55db)[_0x2a90('0x1d')](function(_0x2611d0){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x2611d0[_0x2a90('0x18')]);emit(util['format']('user:%s',_0x2611d0[_0x2a90('0x18')]),_0x2a90('0x3d'),{'sessionId':_0x3ad6c2});return _0x1fb729['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x2a90('0x20')](handleError(_0x1fb729));};exports['unhold']=function(_0x370da3,_0x3dfe72){logger[_0x2a90('0x12')](_0x2a90('0x3e'),_0x370da3[_0x2a90('0x29')]);var _0x3ade08=unholdValidation['validate'](_0x370da3[_0x2a90('0x29')]);if(_0x3ade08[_0x2a90('0x26')]>0x0){return _0x3dfe72['status'](0x190)[_0x2a90('0x2b')](_0x3ade08);}var _0x4d1303=_0x370da3['body'][_0x2a90('0x2c')];var _0xe47c6b=_0x370da3['body']['sessionId'];return getAgent(_0x4d1303)[_0x2a90('0x1d')](function(_0x5951eb){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x5951eb['name']);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x5951eb[_0x2a90('0x18')]),'webbar:unhold',{'sessionId':_0xe47c6b});return _0x3dfe72[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x3dfe72));};exports[_0x2a90('0x3f')]=function(_0x2172d4,_0x58f859){logger[_0x2a90('0x12')]('calls\x20fired:',_0x58f859[_0x2a90('0x29')]);var _0x5ab061=callsValidation[_0x2a90('0x2a')](_0x2172d4[_0x2a90('0x29')]);if(_0x5ab061[_0x2a90('0x26')]>0x0){return _0x58f859['status'](0x190)['json'](_0x5ab061);}var _0x5a4515=_0x2172d4[_0x2a90('0x29')][_0x2a90('0x2c')];var _0x3793e5=respondWithRpcPromise(_0x2a90('0x40'));var _0x2e5762=getAgent(_0x5a4515);return Promise[_0x2a90('0x41')]([_0x3793e5,_0x2e5762])[_0x2a90('0x1d')](function(_0x37f34b){var _0x69c213=_0x37f34b[0x0];var _0x4f4dc6=_0x37f34b[0x1];var _0x18bb86=_[_0x2a90('0x42')](_0x69c213[_0x2a90('0x23')],function(_0x4d36f8){return _0x4d36f8['UserId']==_0x4f4dc6['id'];});return _0x58f859['status'](0xc8)[_0x2a90('0x2b')]({'count':_0x18bb86[_0x2a90('0x26')],'rows':_0x18bb86});})[_0x2a90('0x20')](handleError(_0x58f859));};exports[_0x2a90('0x43')]=function(_0x325a3d,_0x2d1223){logger[_0x2a90('0x12')](_0x2a90('0x44'),_0x325a3d[_0x2a90('0x29')]);var _0x1de2ec=conferenceValidation[_0x2a90('0x2a')](_0x325a3d[_0x2a90('0x29')]);if(_0x1de2ec[_0x2a90('0x26')]>0x0){return _0x2d1223[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x1de2ec);}var _0x3742e8=_0x325a3d['body'][_0x2a90('0x2c')];return getAgent(_0x3742e8)['then'](function(_0x281aa0){logger[_0x2a90('0x12')](_0x2a90('0x34'),_0x281aa0[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')](_0x2a90('0x31'),_0x281aa0[_0x2a90('0x18')]),'webbar:conference');return _0x2d1223[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x45')});})['catch'](handleError(_0x2d1223));};exports[_0x2a90('0x46')]=function(_0x3aa0d5,_0x35c007){logger[_0x2a90('0x12')]('transfer\x20fired:',_0x3aa0d5[_0x2a90('0x29')]);var _0x49687f=transferValidation[_0x2a90('0x2a')](_0x3aa0d5[_0x2a90('0x29')]);if(_0x49687f[_0x2a90('0x26')]>0x0){return _0x35c007[_0x2a90('0x19')](0x190)[_0x2a90('0x2b')](_0x49687f);}var _0xbe1fdb=_0x3aa0d5['body'][_0x2a90('0x2c')];var _0x2347b6=_0x3aa0d5[_0x2a90('0x29')][_0x2a90('0x25')];var _0x1f8788=_0x3aa0d5[_0x2a90('0x29')][_0x2a90('0x47')];return getAgent(_0xbe1fdb)[_0x2a90('0x1d')](function(_0x1ccf69){logger['info'](_0x2a90('0x34'),_0x1ccf69[_0x2a90('0x18')]);emit(util[_0x2a90('0x30')]('user:%s',_0x1ccf69[_0x2a90('0x18')]),_0x2a90('0x48'),{'sessionId':_0x2347b6,'transferNumber':_0x1f8788});return _0x35c007[_0x2a90('0x19')](0xc8)[_0x2a90('0x2b')]({'error':![],'message':_0x2a90('0x49')});})['catch'](handleError(_0x35c007));}; \ No newline at end of file +var _0x9b9b=['rows','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','user:%s','webbar:originate','json','originate\x20executed!','catch','hangup\x20fired:','entityFound:','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','all','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','stringify','log','handleError:','stack','name','status','send','NotFound','request','error','code','message','findOne','agent','then','VoiceChannels','filter'];(function(_0x1f0257,_0x369724){var _0x1246a4=function(_0x57b9ec){while(--_0x57b9ec){_0x1f0257['push'](_0x1f0257['shift']());}};_0x1246a4(++_0x369724);}(_0x9b9b,0x114));var _0xb9b9=function(_0x31a4fd,_0x4e25ab){_0x31a4fd=_0x31a4fd-0x0;var _0x529fb2=_0x9b9b[_0x31a4fd];return _0x529fb2;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xb9b9('0x0'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var jayson=require(_0xb9b9('0x3'));var amiClient=jayson[_0xb9b9('0x4')][_0xb9b9('0x5')]({'port':0x232a});var logger=require(_0xb9b9('0x6'))(_0xb9b9('0x7'));var Redis=require(_0xb9b9('0x8'));config[_0xb9b9('0x9')]=_[_0xb9b9('0xa')](config[_0xb9b9('0x9')],{'host':_0xb9b9('0xb'),'port':0x18eb});var io=require(_0xb9b9('0xc'))(new Redis(config[_0xb9b9('0x9')]));var Schema=require(_0xb9b9('0xd'));var originateValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xb9b9('0xf')]},'callerId':{'type':_0xb9b9('0x10')},'callbackUrl':{'type':_0xb9b9('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb9b9('0x11')]},'sessionId':{'type':_0xb9b9('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb9b9('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],_0xb9b9('0x11')]},'sessionId':{'type':_0xb9b9('0x10'),'required':[!![],_0xb9b9('0x12')]},'transferNumber':{'type':_0xb9b9('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb9b9('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb9b9('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],_0xb9b9('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xb9b9('0xe'),'required':[!![],_0xb9b9('0x11')]}});function emit(_0x3fd09c,_0x42a55f,_0x2b2e3d){logger['info'](_0x3fd09c,_0x42a55f,JSON[_0xb9b9('0x13')](_0x2b2e3d));io['to'](_0x3fd09c)['emit'](_0x42a55f,_0x2b2e3d);}function handleError(_0x403a5b){return function(_0x3e6d23){console[_0xb9b9('0x14')](_0xb9b9('0x15'),_0x3e6d23,_0x3e6d23 instanceof RangeError);logger['error'](_0x3e6d23[_0xb9b9('0x16')]);if(_0x3e6d23 instanceof RangeError){if(_0x3e6d23[_0xb9b9('0x17')]){delete _0x3e6d23[_0xb9b9('0x17')];}_0x403a5b[_0xb9b9('0x18')](0x194)[_0xb9b9('0x19')](_0x3e6d23);}else{if(_0x3e6d23[_0xb9b9('0x17')]){delete _0x3e6d23[_0xb9b9('0x17')];}_0x403a5b[_0xb9b9('0x18')](0x1f4)[_0xb9b9('0x19')](_0x3e6d23);}};}function checkError(){return function(_0x47d3e3){if(!_0x47d3e3){throw new RangeError(_0xb9b9('0x1a'));}return _0x47d3e3;};}function respondWithRpcPromise(_0x1246b9,_0x1554d0){return new BPromise(function(_0x4e33a0,_0x10b7e1){var _0xe1e1d7=amiClient;return _0xe1e1d7[_0xb9b9('0x1b')](_0x1246b9,_0x1554d0)['then'](function(_0x9898bc){if(_0x9898bc[_0xb9b9('0x1c')]){if(_0x9898bc['error'][_0xb9b9('0x1d')]===0x1f4){return _0x10b7e1(_0x9898bc[_0xb9b9('0x1c')][_0xb9b9('0x1e')]);}return _0x4e33a0(_0x9898bc[_0xb9b9('0x1c')][_0xb9b9('0x1e')]);}else{_0x4e33a0(_0x9898bc['result']);}})['catch'](function(_0x33ab82){_0x10b7e1(_0x33ab82);});});}function getAgent(_0x426f2c){return db['User'][_0xb9b9('0x1f')]({'where':{'id':_0x426f2c,'role':_0xb9b9('0x20')}})[_0xb9b9('0x21')](checkError());}function getAgentCheckSession(_0x21f68f,_0x125f6c){return new BPromise(function(_0x54bf18,_0x388042){var _0x554850=respondWithRpcPromise(_0xb9b9('0x22'));var _0xe28f3c=getAgent(_0x21f68f);Promise['all']([_0x554850,_0xe28f3c])[_0xb9b9('0x21')](function(_0x31b509){var _0x17a6f6=_0x31b509[0x0];var _0x5eb860=_0x31b509[0x1];var _0x16df87=_[_0xb9b9('0x23')](_0x17a6f6[_0xb9b9('0x24')],function(_0x300453){return _0x300453['UserId']==_0x5eb860['id']&&_0x300453[_0xb9b9('0x25')]==_0x125f6c;});if(_0x16df87[_0xb9b9('0x26')]==0x1){_0x54bf18(_0x5eb860);}else{_0x388042(new RangeError('sessionId\x20'+_0x125f6c+_0xb9b9('0x27')));}});});}exports[_0xb9b9('0x28')]=function(_0x247e8d,_0xc47845){logger['info'](_0xb9b9('0x29'),_0x247e8d[_0xb9b9('0x2a')]);var _0x28e2da=originateValidation[_0xb9b9('0xd')](_0x247e8d['body']);if(_0x28e2da[_0xb9b9('0x26')]>0x0){return _0xc47845[_0xb9b9('0x18')](0x190)['json'](_0x28e2da);}var _0x126fe2=_0x247e8d[_0xb9b9('0x2a')][_0xb9b9('0x2b')];var _0xa680b5=_0x247e8d[_0xb9b9('0x2a')][_0xb9b9('0x2c')];var _0x5e10c9=_0x247e8d[_0xb9b9('0x2a')][_0xb9b9('0x2d')];var _0x48bcd2=_0x247e8d[_0xb9b9('0x2a')][_0xb9b9('0x2e')];return getAgent(_0x126fe2)[_0xb9b9('0x21')](function(_0x5837c0){logger[_0xb9b9('0x2f')]('entityFound:',_0x5837c0[_0xb9b9('0x17')]);emit(util['format'](_0xb9b9('0x30'),_0x5837c0[_0xb9b9('0x17')]),_0xb9b9('0x31'),{'callNumber':_0xa680b5,'callerId':_0x5e10c9,'callbackUrl':_0x48bcd2});return _0xc47845[_0xb9b9('0x18')](0xc8)[_0xb9b9('0x32')]({'error':![],'message':_0xb9b9('0x33')});})[_0xb9b9('0x34')](handleError(_0xc47845));};exports['hangup']=function(_0x57396a,_0xb54d68){logger[_0xb9b9('0x2f')](_0xb9b9('0x35'),_0x57396a['body']);var _0x29c60f=hangupValidation['validate'](_0x57396a[_0xb9b9('0x2a')]);if(_0x29c60f[_0xb9b9('0x26')]>0x0){return _0xb54d68[_0xb9b9('0x18')](0x190)[_0xb9b9('0x32')](_0x29c60f);}var _0x46abe7=_0x57396a[_0xb9b9('0x2a')][_0xb9b9('0x2b')];var _0x1eb1b4=_0x57396a[_0xb9b9('0x2a')][_0xb9b9('0x25')];return getAgent(_0x46abe7)['then'](function(_0xf484fd){logger[_0xb9b9('0x2f')](_0xb9b9('0x36'),_0xf484fd[_0xb9b9('0x17')]);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0xf484fd[_0xb9b9('0x17')]),_0xb9b9('0x38'),{'sessionId':_0x1eb1b4});return _0xb54d68[_0xb9b9('0x18')](0xc8)[_0xb9b9('0x32')]({'error':![],'message':'hangup\x20executed!'});})[_0xb9b9('0x34')](handleError(_0xb54d68));};exports[_0xb9b9('0x39')]=function(_0x21307e,_0x386a6c){logger['info'](_0xb9b9('0x3a'),_0x21307e['body']);var _0x5b439e=answerValidation[_0xb9b9('0xd')](_0x21307e[_0xb9b9('0x2a')]);if(_0x5b439e['length']>0x0){return _0x386a6c['status'](0x190)[_0xb9b9('0x32')](_0x5b439e);}var _0x1a5888=_0x21307e[_0xb9b9('0x2a')][_0xb9b9('0x2b')];var _0x493786=_0x21307e[_0xb9b9('0x2a')][_0xb9b9('0x25')];return getAgent(_0x1a5888)[_0xb9b9('0x21')](function(_0x53483d){logger['info'](_0xb9b9('0x36'),_0x53483d['name']);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0x53483d[_0xb9b9('0x17')]),_0xb9b9('0x3b'),{'sessionId':_0x493786});return _0x386a6c['status'](0xc8)[_0xb9b9('0x32')]({'error':![],'message':_0xb9b9('0x3c')});})[_0xb9b9('0x34')](handleError(_0x386a6c));};exports[_0xb9b9('0x3d')]=function(_0x2af5bf,_0x2bdbb5){logger[_0xb9b9('0x2f')](_0xb9b9('0x3e'),_0x2af5bf[_0xb9b9('0x2a')]);var _0x2fe8e2=holdValidation[_0xb9b9('0xd')](_0x2af5bf[_0xb9b9('0x2a')]);if(_0x2fe8e2['length']>0x0){return _0x2bdbb5[_0xb9b9('0x18')](0x190)['json'](_0x2fe8e2);}var _0x8254f9=_0x2af5bf[_0xb9b9('0x2a')][_0xb9b9('0x2b')];var _0x1ad24d=_0x2af5bf['body'][_0xb9b9('0x25')];return getAgent(_0x8254f9)['then'](function(_0x2b3e22){logger[_0xb9b9('0x2f')](_0xb9b9('0x36'),_0x2b3e22[_0xb9b9('0x17')]);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0x2b3e22[_0xb9b9('0x17')]),_0xb9b9('0x3f'),{'sessionId':_0x1ad24d});return _0x2bdbb5[_0xb9b9('0x18')](0xc8)[_0xb9b9('0x32')]({'error':![],'message':_0xb9b9('0x40')});})['catch'](handleError(_0x2bdbb5));};exports['unhold']=function(_0x4da7d8,_0x124b54){logger['info'](_0xb9b9('0x41'),_0x4da7d8[_0xb9b9('0x2a')]);var _0x3a9d1b=unholdValidation[_0xb9b9('0xd')](_0x4da7d8['body']);if(_0x3a9d1b[_0xb9b9('0x26')]>0x0){return _0x124b54[_0xb9b9('0x18')](0x190)['json'](_0x3a9d1b);}var _0x27a9ed=_0x4da7d8[_0xb9b9('0x2a')]['userId'];var _0x50f2e0=_0x4da7d8[_0xb9b9('0x2a')][_0xb9b9('0x25')];return getAgent(_0x27a9ed)[_0xb9b9('0x21')](function(_0x4d5116){logger[_0xb9b9('0x2f')](_0xb9b9('0x36'),_0x4d5116['name']);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0x4d5116[_0xb9b9('0x17')]),_0xb9b9('0x42'),{'sessionId':_0x50f2e0});return _0x124b54['status'](0xc8)[_0xb9b9('0x32')]({'error':![],'message':_0xb9b9('0x43')});})[_0xb9b9('0x34')](handleError(_0x124b54));};exports['calls']=function(_0x190e09,_0x2e6db1){logger[_0xb9b9('0x2f')](_0xb9b9('0x44'),_0x2e6db1[_0xb9b9('0x2a')]);var _0x49956d=callsValidation['validate'](_0x190e09[_0xb9b9('0x2a')]);if(_0x49956d[_0xb9b9('0x26')]>0x0){return _0x2e6db1[_0xb9b9('0x18')](0x190)[_0xb9b9('0x32')](_0x49956d);}var _0x3331f0=_0x190e09['body'][_0xb9b9('0x2b')];var _0x30e19e=respondWithRpcPromise(_0xb9b9('0x22'));var _0x340c73=getAgent(_0x3331f0);return Promise[_0xb9b9('0x45')]([_0x30e19e,_0x340c73])['then'](function(_0x3741c1){var _0x2da6ad=_0x3741c1[0x0];var _0x1a34b6=_0x3741c1[0x1];var _0x1e38f5=_['filter'](_0x2da6ad[_0xb9b9('0x24')],function(_0x5c9d1d){return _0x5c9d1d[_0xb9b9('0x46')]==_0x1a34b6['id'];});return _0x2e6db1[_0xb9b9('0x18')](0xc8)[_0xb9b9('0x32')]({'count':_0x1e38f5[_0xb9b9('0x26')],'rows':_0x1e38f5});})[_0xb9b9('0x34')](handleError(_0x2e6db1));};exports[_0xb9b9('0x47')]=function(_0x1f19b2,_0x24ae48){logger[_0xb9b9('0x2f')](_0xb9b9('0x48'),_0x1f19b2['body']);var _0xac7b51=conferenceValidation[_0xb9b9('0xd')](_0x1f19b2[_0xb9b9('0x2a')]);if(_0xac7b51['length']>0x0){return _0x24ae48[_0xb9b9('0x18')](0x190)[_0xb9b9('0x32')](_0xac7b51);}var _0x412a7b=_0x1f19b2[_0xb9b9('0x2a')][_0xb9b9('0x2b')];return getAgent(_0x412a7b)[_0xb9b9('0x21')](function(_0x564008){logger[_0xb9b9('0x2f')](_0xb9b9('0x36'),_0x564008[_0xb9b9('0x17')]);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0x564008[_0xb9b9('0x17')]),_0xb9b9('0x49'));return _0x24ae48[_0xb9b9('0x18')](0xc8)['json']({'error':![],'message':_0xb9b9('0x4a')});})[_0xb9b9('0x34')](handleError(_0x24ae48));};exports[_0xb9b9('0x4b')]=function(_0x5823ac,_0x3c2830){logger[_0xb9b9('0x2f')]('transfer\x20fired:',_0x5823ac[_0xb9b9('0x2a')]);var _0x35c05b=transferValidation[_0xb9b9('0xd')](_0x5823ac[_0xb9b9('0x2a')]);if(_0x35c05b[_0xb9b9('0x26')]>0x0){return _0x3c2830[_0xb9b9('0x18')](0x190)['json'](_0x35c05b);}var _0x2be3c7=_0x5823ac[_0xb9b9('0x2a')][_0xb9b9('0x2b')];var _0x21ed42=_0x5823ac[_0xb9b9('0x2a')]['sessionId'];var _0x4a7536=_0x5823ac[_0xb9b9('0x2a')][_0xb9b9('0x4c')];return getAgent(_0x2be3c7)[_0xb9b9('0x21')](function(_0x53159a){logger[_0xb9b9('0x2f')]('entityFound:',_0x53159a[_0xb9b9('0x17')]);emit(util[_0xb9b9('0x37')](_0xb9b9('0x30'),_0x53159a[_0xb9b9('0x17')]),_0xb9b9('0x4d'),{'sessionId':_0x21ed42,'transferNumber':_0x4a7536});return _0x3c2830[_0xb9b9('0x18')](0xc8)[_0xb9b9('0x32')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x3c2830));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index c036ce3..22ed736 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 _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x31c3d5,_0x40a38c){var _0x5424ba=function(_0x15b7fa){while(--_0x15b7fa){_0x31c3d5['push'](_0x31c3d5['shift']());}};_0x5424ba(++_0x40a38c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5560bd,_0x34c646){_0x5560bd=_0x5560bd-0x0;var _0x2df13b=_0xc6ac[_0x5560bd];return _0x2df13b;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router; \ No newline at end of file +var _0x8952=['getAgents','/:id/applications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers'];(function(_0x47dcc8,_0x5219f1){var _0x317188=function(_0x51e61b){while(--_0x51e61b){_0x47dcc8['push'](_0x47dcc8['shift']());}};_0x317188(++_0x5219f1);}(_0x8952,0x17e));var _0x2895=function(_0x3e7acc,_0x574a7b){_0x3e7acc=_0x3e7acc-0x0;var _0x1b81bc=_0x8952[_0x3e7acc];return _0x1b81bc;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./whatsappAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/users',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getApplications']);router['post']('/',auth[_0x2895('0x9')](),controller[_0x2895('0x10')]);router['post'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x17')]);router[_0x2895('0x13')](_0x2895('0xf'),auth[_0x2895('0x9')](),controller[_0x2895('0x18')]);router[_0x2895('0x13')](_0x2895('0x19'),controller[_0x2895('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x1c')](_0x2895('0xc'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller['removeDispositions']);router[_0x2895('0x1e')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller['removeAnswers']);router['delete'](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7dd68c9..cbc53f9 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 _0xdc16=['exports','name','STRING','ENUM','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x43a52e,_0x17ab60){var _0x232572=function(_0x1c6491){while(--_0x1c6491){_0x43a52e['push'](_0x43a52e['shift']());}};_0x232572(++_0x17ab60);}(_0xdc16,0x1b8));var _0x6dc1=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xdc16[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0x6dc1('0x0'));var rs=require(_0x6dc1('0x1'));module[_0x6dc1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6dc1('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x6dc1('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x6dc1('0x4')]},'type':{'type':Sequelize[_0x6dc1('0x5')]('twilio',_0x6dc1('0x6'))},'accountSid':{'type':Sequelize[_0x6dc1('0x4')]},'baseUrl':{'type':Sequelize[_0x6dc1('0x4')]},'authToken':{'type':Sequelize[_0x6dc1('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6dc1('0x7');}},'notificationSound':{'type':Sequelize[_0x6dc1('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6dc1('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dc1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dc1('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6dc1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dc1('0x9')],'comment':_0x6dc1('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x6dc1('0x8')],'defaultValue':![],'comment':_0x6dc1('0xb'),'set':function(_0x1966a6){if(!_0x1966a6){this['setDataValue'](_0x6dc1('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0x1966a6);}},'description':{'type':Sequelize[_0x6dc1('0x4')]}}; \ No newline at end of file +var _0x48c4=['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','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','sinch'];(function(_0x270876,_0x50516b){var _0x1bc190=function(_0x555995){while(--_0x555995){_0x270876['push'](_0x270876['shift']());}};_0x1bc190(++_0x50516b);}(_0x48c4,0xbb));var _0x448c=function(_0x4d0af7,_0xc4c42){_0x4d0af7=_0x4d0af7-0x0;var _0x2164cf=_0x48c4[_0x4d0af7];return _0x2164cf;};'use strict';var Sequelize=require(_0x448c('0x0'));var rs=require(_0x448c('0x1'));module[_0x448c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x448c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x448c('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x448c('0x4')],'defaultValue':function(){return rs[_0x448c('0x5')]();}},'phone':{'type':Sequelize[_0x448c('0x4')]},'type':{'type':Sequelize['ENUM'](_0x448c('0x6'),_0x448c('0x7'))},'accountSid':{'type':Sequelize[_0x448c('0x4')]},'baseUrl':{'type':Sequelize[_0x448c('0x4')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x448c('0x8')],'defaultValue':function(){return _0x448c('0x9');}},'notificationSound':{'type':Sequelize[_0x448c('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x448c('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x448c('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x448c('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x448c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x448c('0xb')],'comment':_0x448c('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2422ca){if(!_0x2422ca){this[_0x448c('0xd')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x448c('0xe'),_0x2422ca);}},'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 0e79272..5934bb0 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 _0xbcdf=['WhatsappAccountId','Disposition','getDispositions','findOne','include','rows','removeDispositions','ids','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','MessageSid','notifications','messageId','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','WhatsappInteraction','interaction','push','unmanaged','*,*,*,*','created','ContactId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','message','WhatsappAccount,\x20%s,\x20%s','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','WhatsappAccount','includeAll','findAll','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0x1533f7,_0x1a338a){var _0x38e1f9=function(_0xbbaa34){while(--_0xbbaa34){_0x1533f7['push'](_0x1533f7['shift']());}};_0x38e1f9(++_0x1a338a);}(_0xbcdf,0x1d1));var _0xfbcd=function(_0x3ffd40,_0x4c65b8){_0x3ffd40=_0x3ffd40-0x0;var _0x14309d=_0xbcdf[_0x3ffd40];return _0x14309d;};'use strict';var emlformat=require(_0xfbcd('0x0'));var rimraf=require(_0xfbcd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfbcd('0x2'));var rp=require(_0xfbcd('0x3'));var moment=require(_0xfbcd('0x4'));var BPromise=require(_0xfbcd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfbcd('0x6'));var csv=require('to-csv');var ejs=require(_0xfbcd('0x7'));var fs=require('fs');var fs_extra=require(_0xfbcd('0x8'));var _=require('lodash');var squel=require(_0xfbcd('0x9'));var crypto=require(_0xfbcd('0xa'));var jsforce=require(_0xfbcd('0xb'));var deskjs=require(_0xfbcd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfbcd('0xd'));var Redis=require(_0xfbcd('0xe'));var authService=require(_0xfbcd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfbcd('0x10'));var hardwareService=require(_0xfbcd('0x11'));var logger=require(_0xfbcd('0x12'))(_0xfbcd('0x13'));var utils=require(_0xfbcd('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfbcd('0x15'))['db'];config[_0xfbcd('0x16')]=_[_0xfbcd('0x17')](config[_0xfbcd('0x16')],{'host':_0xfbcd('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbcd('0x16')]));require(_0xfbcd('0x19'))[_0xfbcd('0x1a')](socket);var jayson=require(_0xfbcd('0x1b'));var client=jayson[_0xfbcd('0x1c')]['http']({'port':0x232c});function respondWithRpcPromise(_0x459dfe,_0x3fced5,_0x334df8,_0x24873d){return new BPromise(function(_0x1b4508,_0x3899f0){var _0x4cf68c=_0x24873d||client;return _0x4cf68c['request'](_0x459dfe,_0x334df8)[_0xfbcd('0x1d')](function(_0x21ca1f){logger[_0xfbcd('0x1e')]('WhatsappAccount,\x20%s,\x20%s',_0x3fced5,_0xfbcd('0x1f'));logger[_0xfbcd('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3fced5,_0xfbcd('0x1f'),JSON[_0xfbcd('0x21')](_0x21ca1f));if(_0x21ca1f['error']){if(_0x21ca1f['error']['code']===0x1f4){logger[_0xfbcd('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x3fced5,_0x21ca1f[_0xfbcd('0x22')][_0xfbcd('0x23')]);return _0x3899f0(_0x21ca1f[_0xfbcd('0x22')][_0xfbcd('0x23')]);}logger[_0xfbcd('0x22')](_0xfbcd('0x24'),_0x3fced5,_0x21ca1f[_0xfbcd('0x22')][_0xfbcd('0x23')]);return _0x1b4508(_0x21ca1f['error'][_0xfbcd('0x23')]);}else{logger[_0xfbcd('0x1e')](_0xfbcd('0x24'),_0x3fced5,_0xfbcd('0x1f'));_0x1b4508(_0x21ca1f['result'][_0xfbcd('0x23')]);}})[_0xfbcd('0x25')](function(_0x19a3a9){logger[_0xfbcd('0x22')](_0xfbcd('0x24'),_0x3fced5,_0x19a3a9);_0x3899f0(_0x19a3a9);});});}function respondWithStatusCode(_0x26a3d4,_0x3e2b79){_0x3e2b79=_0x3e2b79||0xcc;return function(_0x45de79){if(_0x45de79){return _0x26a3d4['sendStatus'](_0x3e2b79);}return _0x26a3d4[_0xfbcd('0x26')](_0x3e2b79)[_0xfbcd('0x27')]();};}function respondWithResult(_0x2e6122,_0x337f1a){_0x337f1a=_0x337f1a||0xc8;return function(_0x18543d){if(_0x18543d){return _0x2e6122[_0xfbcd('0x26')](_0x337f1a)[_0xfbcd('0x28')](_0x18543d);}};}function respondWithFilteredResult(_0x3fea9e,_0x52bcd4){return function(_0x4e97b9){if(_0x4e97b9){var _0x11494e=typeof _0x52bcd4[_0xfbcd('0x29')]==='undefined'&&typeof _0x52bcd4[_0xfbcd('0x2a')]===_0xfbcd('0x2b');var _0x2c4210=_0x4e97b9[_0xfbcd('0x2c')];var _0x55b986=_0x11494e?0x0:_0x52bcd4[_0xfbcd('0x29')];var _0x318d47=_0x11494e?_0x4e97b9[_0xfbcd('0x2c')]:_0x52bcd4[_0xfbcd('0x29')]+_0x52bcd4['limit'];var _0x500561;if(_0x318d47>=_0x2c4210){_0x318d47=_0x2c4210;_0x500561=0xc8;}else{_0x500561=0xce;}_0x3fea9e[_0xfbcd('0x26')](_0x500561);return _0x3fea9e['set'](_0xfbcd('0x2d'),_0x55b986+'-'+_0x318d47+'/'+_0x2c4210)[_0xfbcd('0x28')](_0x4e97b9);}return null;};}function patchUpdates(_0xcfbf23){return function(_0x2a25bd){try{jsonpatch[_0xfbcd('0x2e')](_0x2a25bd,_0xcfbf23,!![]);}catch(_0x1c7632){return BPromise[_0xfbcd('0x2f')](_0x1c7632);}return _0x2a25bd['save']();};}function saveUpdates(_0x25d528,_0x1a6cec){return function(_0x49fb57){if(_0x49fb57){return _0x49fb57[_0xfbcd('0x30')](_0x25d528)[_0xfbcd('0x1d')](function(_0x33b070){return _0x33b070;});}return null;};}function removeEntity(_0x5cd1db,_0x1b11da){return function(_0x849339){if(_0x849339){return _0x849339[_0xfbcd('0x31')]()[_0xfbcd('0x1d')](function(){var _0x44ee86=_0x849339[_0xfbcd('0x32')]({'plain':!![]});var _0xf5861=_0xfbcd('0x33');return db[_0xfbcd('0x34')]['destroy']({'where':{'type':_0xf5861,'resourceId':_0x44ee86['id']}})['then'](function(){return _0x849339;});})[_0xfbcd('0x1d')](function(){_0x5cd1db[_0xfbcd('0x26')](0xcc)[_0xfbcd('0x27')]();});}};}function handleEntityNotFound(_0x33f907,_0x510ae8){return function(_0x2fb19f){if(!_0x2fb19f){_0x33f907[_0xfbcd('0x35')](0x194);}return _0x2fb19f;};}function handleError(_0x5d5849,_0x48fa88){_0x48fa88=_0x48fa88||0x1f4;return function(_0x3e624c){logger[_0xfbcd('0x22')](_0x3e624c[_0xfbcd('0x36')]);if(_0x3e624c[_0xfbcd('0x37')]){delete _0x3e624c[_0xfbcd('0x37')];}_0x5d5849[_0xfbcd('0x26')](_0x48fa88)[_0xfbcd('0x38')](_0x3e624c);};}exports[_0xfbcd('0x39')]=function(_0x19dc55,_0x13b0e6){var _0x4c0f53={'include':[{'model':db[_0xfbcd('0x3a')],'as':_0xfbcd('0x3b')}]},_0x40c08d={},_0x4c2024={'count':0x0,'rows':[]};var _0x5cbb09=_[_0xfbcd('0x3c')](db['WhatsappAccount'][_0xfbcd('0x3d')],function(_0x39dbba){return{'name':_0x39dbba['fieldName'],'type':_0x39dbba[_0xfbcd('0x3e')][_0xfbcd('0x3f')]};});_0x40c08d[_0xfbcd('0x40')]=_[_0xfbcd('0x3c')](_0x5cbb09,'name');_0x40c08d[_0xfbcd('0x41')]=_['keys'](_0x19dc55[_0xfbcd('0x41')]);_0x40c08d[_0xfbcd('0x42')]=_[_0xfbcd('0x43')](_0x40c08d[_0xfbcd('0x40')],_0x40c08d['query']);_0x4c0f53[_0xfbcd('0x44')]=_['intersection'](_0x40c08d[_0xfbcd('0x40')],qs[_0xfbcd('0x45')](_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x45')]));_0x4c0f53[_0xfbcd('0x44')]=_0x4c0f53[_0xfbcd('0x44')]['length']?_0x4c0f53[_0xfbcd('0x44')]:_0x40c08d[_0xfbcd('0x40')];if(!_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x46')](_0xfbcd('0x47'))){_0x4c0f53[_0xfbcd('0x2a')]=qs[_0xfbcd('0x2a')](_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x2a')]);_0x4c0f53['offset']=qs['offset'](_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x29')]);}_0x4c0f53[_0xfbcd('0x48')]=qs[_0xfbcd('0x49')](_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x49')]);_0x4c0f53['where']=qs['filters'](_[_0xfbcd('0x4a')](_0x19dc55[_0xfbcd('0x41')],_0x40c08d[_0xfbcd('0x42')]),_0x5cbb09);if(_0x19dc55[_0xfbcd('0x41')][_0xfbcd('0x4b')]){_0x4c0f53[_0xfbcd('0x4c')]=_[_0xfbcd('0x4d')](_0x4c0f53[_0xfbcd('0x4c')],{'$or':_['map'](_0x5cbb09,function(_0x300d44){if(_0x300d44[_0xfbcd('0x3e')]!=='VIRTUAL'){var _0x568706={};_0x568706[_0x300d44[_0xfbcd('0x37')]]={'$like':'%'+_0x19dc55[_0xfbcd('0x41')]['filter']+'%'};return _0x568706;}})});}_0x4c0f53=_[_0xfbcd('0x4d')]({},_0x4c0f53,_0x19dc55[_0xfbcd('0x4e')]);var _0x261ffa={'where':_0x4c0f53[_0xfbcd('0x4c')]};return db[_0xfbcd('0x4f')][_0xfbcd('0x2c')](_0x261ffa)[_0xfbcd('0x1d')](function(_0x449038){_0x4c2024[_0xfbcd('0x2c')]=_0x449038;if(_0x19dc55['query'][_0xfbcd('0x50')]){_0x4c0f53['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xfbcd('0x51')](_0x4c0f53);})[_0xfbcd('0x1d')](function(_0xea79fd){_0x4c2024['rows']=_0xea79fd;return _0x4c2024;})['then'](respondWithFilteredResult(_0x13b0e6,_0x4c0f53))[_0xfbcd('0x25')](handleError(_0x13b0e6,null));};exports['show']=function(_0x17d23d,_0xebe9f4){var _0x5f437b={'raw':![],'where':{'id':_0x17d23d[_0xfbcd('0x52')]['id']},'include':[{'model':db[_0xfbcd('0x3a')],'as':_0xfbcd('0x3b')}]},_0xc15006={};_0xc15006[_0xfbcd('0x40')]=_[_0xfbcd('0x53')](db[_0xfbcd('0x4f')][_0xfbcd('0x3d')]);_0xc15006['query']=_['keys'](_0x17d23d[_0xfbcd('0x41')]);_0xc15006[_0xfbcd('0x42')]=_[_0xfbcd('0x43')](_0xc15006['model'],_0xc15006[_0xfbcd('0x41')]);_0x5f437b['attributes']=_[_0xfbcd('0x43')](_0xc15006['model'],qs[_0xfbcd('0x45')](_0x17d23d['query'][_0xfbcd('0x45')]));_0x5f437b[_0xfbcd('0x44')]=_0x5f437b[_0xfbcd('0x44')][_0xfbcd('0x54')]?_0x5f437b['attributes']:_0xc15006[_0xfbcd('0x40')];if(_0x17d23d[_0xfbcd('0x41')][_0xfbcd('0x50')]){_0x5f437b['include']=[{'all':!![]}];}_0x5f437b=_[_0xfbcd('0x4d')]({},_0x5f437b,_0x17d23d[_0xfbcd('0x4e')]);return db[_0xfbcd('0x4f')][_0xfbcd('0x55')](_0x5f437b)[_0xfbcd('0x1d')](handleEntityNotFound(_0xebe9f4,null))['then'](respondWithResult(_0xebe9f4,null))[_0xfbcd('0x25')](handleError(_0xebe9f4,null));};exports[_0xfbcd('0x56')]=function(_0x5a0dd9,_0xecefa5){return db[_0xfbcd('0x4f')][_0xfbcd('0x56')](_0x5a0dd9[_0xfbcd('0x57')],{})[_0xfbcd('0x1d')](function(_0x57ff9b){var _0x1b93f0=_0x5a0dd9[_0xfbcd('0x58')][_0xfbcd('0x32')]({'plain':!![]});if(!_0x1b93f0)throw new Error(_0xfbcd('0x59'));if(_0x1b93f0[_0xfbcd('0x5a')]===_0xfbcd('0x58')){var _0x318661=_0x57ff9b[_0xfbcd('0x32')]({'plain':!![]});var _0x54ed79=_0xfbcd('0x33');return db['UserProfileSection']['find']({'where':{'name':_0x54ed79,'userProfileId':_0x1b93f0[_0xfbcd('0x5b')]},'raw':!![]})[_0xfbcd('0x1d')](function(_0x12d037){if(_0x12d037&&_0x12d037[_0xfbcd('0x5c')]===0x0){return db[_0xfbcd('0x34')][_0xfbcd('0x56')]({'name':_0x318661[_0xfbcd('0x37')],'resourceId':_0x318661['id'],'type':_0x12d037['name'],'sectionId':_0x12d037['id']},{})[_0xfbcd('0x1d')](function(){return _0x57ff9b;});}else{return _0x57ff9b;}})[_0xfbcd('0x25')](function(_0x1f49d3){logger['error'](_0xfbcd('0x5d'),_0x1f49d3);throw _0x1f49d3;});}return _0x57ff9b;})[_0xfbcd('0x1d')](respondWithResult(_0xecefa5,0xc9))[_0xfbcd('0x25')](handleError(_0xecefa5,null));};exports[_0xfbcd('0x30')]=function(_0x1161c9,_0x28eab8){if(_0x1161c9['body']['id']){delete _0x1161c9[_0xfbcd('0x57')]['id'];}return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x1161c9[_0xfbcd('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xfbcd('0x1d')](handleEntityNotFound(_0x28eab8,null))[_0xfbcd('0x1d')](saveUpdates(_0x1161c9[_0xfbcd('0x57')],null))[_0xfbcd('0x1d')](respondWithResult(_0x28eab8,null))['catch'](handleError(_0x28eab8,null));};exports[_0xfbcd('0x31')]=function(_0x4b66f0,_0xce4030){return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x4b66f0[_0xfbcd('0x52')]['id']}})['then'](handleEntityNotFound(_0xce4030,null))[_0xfbcd('0x1d')](removeEntity(_0xce4030,null))[_0xfbcd('0x25')](handleError(_0xce4030,null));};exports[_0xfbcd('0x5e')]=function(_0x41ede9,_0x24c86f){return db[_0xfbcd('0x4f')][_0xfbcd('0x5e')]()[_0xfbcd('0x1d')](respondWithResult(_0x24c86f,null))[_0xfbcd('0x25')](handleError(_0x24c86f,null));};exports[_0xfbcd('0x5f')]=function(_0x8e338,_0xd45652,_0x46b969){if(_0x8e338[_0xfbcd('0x57')]['id']){delete _0x8e338['body']['id'];}return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x8e338[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0xd45652,null))[_0xfbcd('0x1d')](function(_0x3008cd){if(_0x3008cd){_0x8e338[_0xfbcd('0x57')][_0xfbcd('0x60')]=_0x3008cd['id'];return db[_0xfbcd('0x61')]['create'](_0x8e338[_0xfbcd('0x57')]);}})['then'](respondWithResult(_0xd45652,null))['catch'](handleError(_0xd45652,null));};exports[_0xfbcd('0x62')]=function(_0xe56a20,_0x1b1415,_0x7ccebe){var _0x2d8c9a={'raw':![],'where':{}};var _0x274c9d={};var _0x4ab941={'count':0x0,'rows':[]};return db[_0xfbcd('0x4f')][_0xfbcd('0x63')]({'where':{'id':_0xe56a20[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x1b1415,null))[_0xfbcd('0x1d')](function(_0x3ede55){if(_0x3ede55){_0x274c9d['model']=_['keys'](db[_0xfbcd('0x61')][_0xfbcd('0x3d')]);_0x274c9d[_0xfbcd('0x41')]=_[_0xfbcd('0x53')](_0xe56a20[_0xfbcd('0x41')]);_0x274c9d[_0xfbcd('0x42')]=_[_0xfbcd('0x43')](_0x274c9d[_0xfbcd('0x40')],_0x274c9d['query']);_0x2d8c9a[_0xfbcd('0x44')]=_[_0xfbcd('0x43')](_0x274c9d[_0xfbcd('0x40')],qs[_0xfbcd('0x45')](_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x45')]));_0x2d8c9a[_0xfbcd('0x44')]=_0x2d8c9a[_0xfbcd('0x44')]['length']?_0x2d8c9a[_0xfbcd('0x44')]:_0x274c9d[_0xfbcd('0x40')];if(!_0xe56a20[_0xfbcd('0x41')]['hasOwnProperty'](_0xfbcd('0x47'))){_0x2d8c9a['limit']=qs[_0xfbcd('0x2a')](_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x2a')]);_0x2d8c9a[_0xfbcd('0x29')]=qs[_0xfbcd('0x29')](_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x29')]);}_0x2d8c9a['order']=qs[_0xfbcd('0x49')](_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x49')]);_0x2d8c9a[_0xfbcd('0x4c')]=qs[_0xfbcd('0x42')](_['pick'](_0xe56a20['query'],_0x274c9d['filters']));_0x2d8c9a[_0xfbcd('0x4c')][_0xfbcd('0x60')]=_0x3ede55['id'];if(_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x4b')]){_0x2d8c9a[_0xfbcd('0x4c')]=_[_0xfbcd('0x4d')](_0x2d8c9a[_0xfbcd('0x4c')],{'$or':_[_0xfbcd('0x3c')](_0x2d8c9a[_0xfbcd('0x44')],function(_0x23d59c){var _0x2693e1={};_0x2693e1[_0x23d59c]={'$like':'%'+_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x4b')]+'%'};return _0x2693e1;})});}_0x2d8c9a=_['merge']({},_0x2d8c9a,_0xe56a20[_0xfbcd('0x4e')]);return db[_0xfbcd('0x61')][_0xfbcd('0x2c')]({'where':_0x2d8c9a['where']})['then'](function(_0xbbfaed){_0x4ab941[_0xfbcd('0x2c')]=_0xbbfaed;if(_0xe56a20[_0xfbcd('0x41')][_0xfbcd('0x50')]){_0x2d8c9a[_0xfbcd('0x64')]=[{'all':!![]}];}return db[_0xfbcd('0x61')]['findAll'](_0x2d8c9a);})[_0xfbcd('0x1d')](function(_0x23a2d5){_0x4ab941[_0xfbcd('0x65')]=_0x23a2d5;return _0x4ab941;});}})['then'](respondWithFilteredResult(_0x1b1415,_0x2d8c9a))['catch'](handleError(_0x1b1415,null));};exports[_0xfbcd('0x66')]=function(_0x39090c,_0x5d566e,_0x1a774a){return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x39090c['params']['id']}})['then'](handleEntityNotFound(_0x5d566e,null))[_0xfbcd('0x1d')](function(_0x5a1a9b){if(_0x5a1a9b){return _0x5a1a9b[_0xfbcd('0x66')](_0x39090c[_0xfbcd('0x41')][_0xfbcd('0x67')]);}})[_0xfbcd('0x1d')](respondWithStatusCode(_0x5d566e,null))[_0xfbcd('0x25')](handleError(_0x5d566e,null));};exports['addAnswer']=function(_0x1b0129,_0x5efb9f,_0x4b0200){if(_0x1b0129[_0xfbcd('0x57')]['id']){delete _0x1b0129[_0xfbcd('0x57')]['id'];}return db['WhatsappAccount'][_0xfbcd('0x55')]({'where':{'id':_0x1b0129['params']['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x5efb9f,null))['then'](function(_0x4b7c1e){if(_0x4b7c1e){_0x1b0129[_0xfbcd('0x57')][_0xfbcd('0x60')]=_0x4b7c1e['id'];return db[_0xfbcd('0x68')][_0xfbcd('0x56')](_0x1b0129[_0xfbcd('0x57')]);}})['then'](respondWithResult(_0x5efb9f,null))[_0xfbcd('0x25')](handleError(_0x5efb9f,null));};exports['getAnswers']=function(_0xfe7033,_0x3f5115,_0x3b2ea0){var _0x419910={'raw':![],'where':{}};var _0x4016ef={};var _0x2e4318={'count':0x0,'rows':[]};return db[_0xfbcd('0x4f')][_0xfbcd('0x63')]({'where':{'id':_0xfe7033[_0xfbcd('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f5115,null))[_0xfbcd('0x1d')](function(_0x469eea){if(_0x469eea){_0x4016ef['model']=_['keys'](db[_0xfbcd('0x68')]['rawAttributes']);_0x4016ef[_0xfbcd('0x41')]=_[_0xfbcd('0x53')](_0xfe7033[_0xfbcd('0x41')]);_0x4016ef['filters']=_['intersection'](_0x4016ef[_0xfbcd('0x40')],_0x4016ef[_0xfbcd('0x41')]);_0x419910['attributes']=_[_0xfbcd('0x43')](_0x4016ef[_0xfbcd('0x40')],qs['fields'](_0xfe7033[_0xfbcd('0x41')][_0xfbcd('0x45')]));_0x419910[_0xfbcd('0x44')]=_0x419910[_0xfbcd('0x44')][_0xfbcd('0x54')]?_0x419910[_0xfbcd('0x44')]:_0x4016ef[_0xfbcd('0x40')];if(!_0xfe7033[_0xfbcd('0x41')]['hasOwnProperty'](_0xfbcd('0x47'))){_0x419910['limit']=qs['limit'](_0xfe7033[_0xfbcd('0x41')][_0xfbcd('0x2a')]);_0x419910[_0xfbcd('0x29')]=qs[_0xfbcd('0x29')](_0xfe7033[_0xfbcd('0x41')]['offset']);}_0x419910['order']=qs[_0xfbcd('0x49')](_0xfe7033[_0xfbcd('0x41')]['sort']);_0x419910[_0xfbcd('0x4c')]=qs['filters'](_[_0xfbcd('0x4a')](_0xfe7033[_0xfbcd('0x41')],_0x4016ef['filters']));_0x419910[_0xfbcd('0x4c')][_0xfbcd('0x60')]=_0x469eea['id'];if(_0xfe7033[_0xfbcd('0x41')][_0xfbcd('0x4b')]){_0x419910[_0xfbcd('0x4c')]=_[_0xfbcd('0x4d')](_0x419910['where'],{'$or':_[_0xfbcd('0x3c')](_0x419910[_0xfbcd('0x44')],function(_0x34dacf){var _0x2b2b8d={};_0x2b2b8d[_0x34dacf]={'$like':'%'+_0xfe7033['query'][_0xfbcd('0x4b')]+'%'};return _0x2b2b8d;})});}_0x419910=_['merge']({},_0x419910,_0xfe7033[_0xfbcd('0x4e')]);return db[_0xfbcd('0x68')][_0xfbcd('0x2c')]({'where':_0x419910[_0xfbcd('0x4c')]})[_0xfbcd('0x1d')](function(_0x14dc86){_0x2e4318[_0xfbcd('0x2c')]=_0x14dc86;if(_0xfe7033[_0xfbcd('0x41')]['includeAll']){_0x419910[_0xfbcd('0x64')]=[{'all':!![]}];}return db[_0xfbcd('0x68')]['findAll'](_0x419910);})[_0xfbcd('0x1d')](function(_0x54e40e){_0x2e4318['rows']=_0x54e40e;return _0x2e4318;});}})[_0xfbcd('0x1d')](respondWithFilteredResult(_0x3f5115,_0x419910))[_0xfbcd('0x25')](handleError(_0x3f5115,null));};exports[_0xfbcd('0x69')]=function(_0x2249e0,_0x9373c8,_0x155c2c){return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x2249e0[_0xfbcd('0x52')]['id']}})['then'](handleEntityNotFound(_0x9373c8,null))[_0xfbcd('0x1d')](function(_0x486996){if(_0x486996){return _0x486996[_0xfbcd('0x69')](_0x2249e0['query'][_0xfbcd('0x67')]);}})['then'](respondWithStatusCode(_0x9373c8,null))['catch'](handleError(_0x9373c8,null));};exports['addAgents']=function(_0x3f5dd6,_0x3f263c,_0x50c2c8){return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x3f5dd6[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x3f263c,null))[_0xfbcd('0x1d')](function(_0x4d4f65){if(_0x4d4f65){return _0x4d4f65[_0xfbcd('0x6a')](_0x3f5dd6['body'][_0xfbcd('0x67')],_[_0xfbcd('0x6b')](_0x3f5dd6[_0xfbcd('0x57')],[_0xfbcd('0x67'),'id'])||{})[_0xfbcd('0x6c')](function(_0x389051){for(var _0x24af08=0x0;_0x24af08<_0x3f5dd6[_0xfbcd('0x57')][_0xfbcd('0x67')][_0xfbcd('0x54')];_0x24af08+=0x1){socket[_0xfbcd('0x6d')](_0xfbcd('0x6e'),{'UserId':Number(_0x3f5dd6['body'][_0xfbcd('0x67')][_0x24af08]),'WhatsappAccountId':Number(_0x3f5dd6[_0xfbcd('0x52')]['id'])});}return _0x389051;});}})['then'](respondWithResult(_0x3f263c,null))[_0xfbcd('0x25')](handleError(_0x3f263c,null));};exports[_0xfbcd('0x6f')]=function(_0x3eb0c2,_0x130868,_0x24b365){return db['WhatsappAccount'][_0xfbcd('0x55')]({'where':{'id':_0x3eb0c2[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x130868,null))[_0xfbcd('0x1d')](function(_0x2c863f){if(_0x2c863f){return _0x2c863f[_0xfbcd('0x6f')](_0x3eb0c2[_0xfbcd('0x41')][_0xfbcd('0x67')])[_0xfbcd('0x1d')](function(){if(_[_0xfbcd('0x70')](_0x3eb0c2['query'][_0xfbcd('0x67')])){for(var _0x5d4f73=0x0;_0x5d4f73<_0x3eb0c2[_0xfbcd('0x41')][_0xfbcd('0x67')][_0xfbcd('0x54')];_0x5d4f73+=0x1){socket[_0xfbcd('0x6d')]('userWhatsappAccount:remove',{'UserId':Number(_0x3eb0c2[_0xfbcd('0x41')][_0xfbcd('0x67')][_0x5d4f73]),'WhatsappAccountId':Number(_0x3eb0c2[_0xfbcd('0x52')]['id'])});}}else{socket[_0xfbcd('0x6d')](_0xfbcd('0x71'),{'UserId':Number(_0x3eb0c2[_0xfbcd('0x41')]['ids']),'WhatsappAccountId':Number(_0x3eb0c2[_0xfbcd('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x130868,null))[_0xfbcd('0x25')](handleError(_0x130868,null));};exports[_0xfbcd('0x72')]=function(_0x41cbf4,_0x5eb333,_0x4d4303){var _0xfcf512={};var _0x372338={};var _0x170fcc;var _0x19a6c2;return db[_0xfbcd('0x4f')][_0xfbcd('0x63')]({'where':{'id':_0x41cbf4[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x5eb333,null))[_0xfbcd('0x1d')](function(_0x1982c4){if(_0x1982c4){_0x170fcc=_0x1982c4;_0x372338[_0xfbcd('0x40')]=_[_0xfbcd('0x53')](db[_0xfbcd('0x73')][_0xfbcd('0x3d')]);_0x372338[_0xfbcd('0x41')]=_['keys'](_0x41cbf4[_0xfbcd('0x41')]);_0x372338['filters']=_[_0xfbcd('0x43')](_0x372338[_0xfbcd('0x40')],_0x372338[_0xfbcd('0x41')]);_0xfcf512[_0xfbcd('0x44')]=_[_0xfbcd('0x43')](_0x372338['model'],qs['fields'](_0x41cbf4[_0xfbcd('0x41')][_0xfbcd('0x45')]));_0xfcf512[_0xfbcd('0x44')]=_0xfcf512['attributes'][_0xfbcd('0x54')]?_0xfcf512[_0xfbcd('0x44')]:_0x372338['model'];_0xfcf512[_0xfbcd('0x48')]=qs['sort'](_0x41cbf4[_0xfbcd('0x41')][_0xfbcd('0x49')]);_0xfcf512[_0xfbcd('0x4c')]=qs['filters'](_[_0xfbcd('0x4a')](_0x41cbf4[_0xfbcd('0x41')],_0x372338[_0xfbcd('0x42')]));if(_0x41cbf4[_0xfbcd('0x41')]['filter']){_0xfcf512[_0xfbcd('0x4c')]=_[_0xfbcd('0x4d')](_0xfcf512['where'],{'$or':_[_0xfbcd('0x3c')](_0xfcf512[_0xfbcd('0x44')],function(_0x170e8e){var _0x477ce4={};_0x477ce4[_0x170e8e]={'$like':'%'+_0x41cbf4[_0xfbcd('0x41')][_0xfbcd('0x4b')]+'%'};return _0x477ce4;})});}_0xfcf512=_[_0xfbcd('0x4d')]({},_0xfcf512,_0x41cbf4[_0xfbcd('0x4e')]);return _0x170fcc[_0xfbcd('0x72')](_0xfcf512);}})[_0xfbcd('0x1d')](function(_0x1f04b2){if(_0x1f04b2){_0x19a6c2=_0x1f04b2[_0xfbcd('0x54')];if(!_0x41cbf4['query'][_0xfbcd('0x46')](_0xfbcd('0x47'))){_0xfcf512[_0xfbcd('0x2a')]=qs['limit'](_0x41cbf4[_0xfbcd('0x41')][_0xfbcd('0x2a')]);_0xfcf512[_0xfbcd('0x29')]=qs['offset'](_0x41cbf4[_0xfbcd('0x41')][_0xfbcd('0x29')]);}return _0x170fcc['getAgents'](_0xfcf512);}})[_0xfbcd('0x1d')](function(_0x4fb2c4){if(_0x4fb2c4){return _0x4fb2c4?{'count':_0x19a6c2,'rows':_0x4fb2c4}:null;}})['then'](respondWithResult(_0x5eb333,null))[_0xfbcd('0x25')](handleError(_0x5eb333,null));};exports[_0xfbcd('0x74')]=function(_0x1e53ba,_0x395561){var _0x11562d=_0x1e53ba[_0xfbcd('0x52')]['id'];var _0x110c52=_0x1e53ba['body'];var _0x48d8e9=0xc8;var _0x5b16a9=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xfbcd('0x75')][_0xfbcd('0x76')][_0xfbcd('0x77')][_0xfbcd('0x78')]},function(_0x32d91d){return db[_0xfbcd('0x4f')][_0xfbcd('0x63')]({'where':{'id':_0x11562d},'transaction':_0x32d91d})[_0xfbcd('0x1d')](function(_0x405ba1){if(_0x405ba1){return db[_0xfbcd('0x79')][_0xfbcd('0x31')]({'where':{'WhatsappAccountId':_0x11562d},'transaction':_0x32d91d})['then'](function(){var _0x4e1a02=_[_0xfbcd('0x3c')](_0x110c52,function(_0x261873){_0x261873['WhatsappAccountId']=_0x11562d;return _0x261873;});return db['WhatsappApplication']['bulkCreate'](_0x4e1a02,{'transaction':_0x32d91d});});}else{_0x48d8e9=0x194;_0x5b16a9=[];}});})[_0xfbcd('0x1d')](function(){if(_0x48d8e9!==0x194){return db['WhatsappApplication'][_0xfbcd('0x7a')]({'where':{'WhatsappAccountId':_0x11562d},'order':_0xfbcd('0x7b')})[_0xfbcd('0x1d')](function(_0x4e725a){_0x5b16a9=_0x4e725a;});}})[_0xfbcd('0x25')](function(_0x56d1cf){_0x48d8e9=0x1f4;logger[_0xfbcd('0x22')](_0x56d1cf[_0xfbcd('0x36')]);if(_0x56d1cf[_0xfbcd('0x37')]){delete _0x56d1cf[_0xfbcd('0x37')];}_0x5b16a9=_0x56d1cf;})[_0xfbcd('0x7c')](function(){if(_0x5b16a9===null){_0x395561[_0xfbcd('0x35')](_0x48d8e9);}else{if(_0x48d8e9===0x1f4){_0x395561['status'](_0x48d8e9)[_0xfbcd('0x38')](_0x5b16a9);}else{_0x395561[_0xfbcd('0x26')](_0x48d8e9)['json'](_0x5b16a9);}}});};exports['getApplications']=function(_0x5b0ea7,_0x14301c,_0x539428){var _0x45767d={};var _0x48c5d1={};var _0x5be125;var _0x5c7c2d;return db[_0xfbcd('0x4f')][_0xfbcd('0x63')]({'where':{'id':_0x5b0ea7[_0xfbcd('0x52')]['id']}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x14301c,null))[_0xfbcd('0x1d')](function(_0x11a8ce){if(_0x11a8ce){_0x5be125=_0x11a8ce;_0x48c5d1[_0xfbcd('0x40')]=_[_0xfbcd('0x53')](db[_0xfbcd('0x79')][_0xfbcd('0x3d')]);_0x48c5d1['query']=_[_0xfbcd('0x53')](_0x5b0ea7['query']);_0x48c5d1['filters']=_[_0xfbcd('0x43')](_0x48c5d1[_0xfbcd('0x40')],_0x48c5d1[_0xfbcd('0x41')]);_0x45767d[_0xfbcd('0x44')]=_['intersection'](_0x48c5d1['model'],qs['fields'](_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x45')]));_0x45767d[_0xfbcd('0x44')]=_0x45767d[_0xfbcd('0x44')][_0xfbcd('0x54')]?_0x45767d[_0xfbcd('0x44')]:_0x48c5d1['model'];_0x45767d[_0xfbcd('0x48')]=qs[_0xfbcd('0x49')](_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x49')]);_0x45767d[_0xfbcd('0x4c')]=qs[_0xfbcd('0x42')](_[_0xfbcd('0x4a')](_0x5b0ea7[_0xfbcd('0x41')],_0x48c5d1[_0xfbcd('0x42')]));if(_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x4b')]){_0x45767d[_0xfbcd('0x4c')]=_[_0xfbcd('0x4d')](_0x45767d[_0xfbcd('0x4c')],{'$or':_[_0xfbcd('0x3c')](_0x45767d[_0xfbcd('0x44')],function(_0x2a09e2){var _0x3866ce={};_0x3866ce[_0x2a09e2]={'$like':'%'+_0x5b0ea7['query'][_0xfbcd('0x4b')]+'%'};return _0x3866ce;})});}_0x45767d=_['merge']({},_0x45767d,_0x5b0ea7[_0xfbcd('0x4e')]);return _0x5be125[_0xfbcd('0x7d')](_0x45767d);}})[_0xfbcd('0x1d')](function(_0x2d78d1){if(_0x2d78d1){_0x5c7c2d=_0x2d78d1[_0xfbcd('0x54')];if(!_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x46')](_0xfbcd('0x47'))){_0x45767d[_0xfbcd('0x2a')]=qs['limit'](_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x2a')]);_0x45767d[_0xfbcd('0x29')]=qs[_0xfbcd('0x29')](_0x5b0ea7[_0xfbcd('0x41')][_0xfbcd('0x29')]);}return _0x5be125[_0xfbcd('0x7d')](_0x45767d);}})['then'](function(_0x3cb5f1){if(_0x3cb5f1){return _0x3cb5f1?{'count':_0x5c7c2d,'rows':_0x3cb5f1}:null;}})['then'](respondWithResult(_0x14301c,null))[_0xfbcd('0x25')](handleError(_0x14301c,null));};exports[_0xfbcd('0x7e')]=function(_0x33beaa,_0x53151d,_0x2b803b){var _0x38094b={'channel':'whatsapp'};var _0x1faf55=[];var _0x50818c=[];var _0x55b5a3={};return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x33beaa[_0xfbcd('0x52')]['id']},'include':[{'model':db[_0xfbcd('0x79')],'as':_0xfbcd('0x7f')}]})[_0xfbcd('0x1d')](handleEntityNotFound(_0x53151d,null))[_0xfbcd('0x1d')](function(_0x24bb4b){_0x38094b['account']=_0x24bb4b;if(_0x38094b[_0xfbcd('0x80')]&&_0x38094b[_0xfbcd('0x80')][_0xfbcd('0x3e')]===_0xfbcd('0x81')&&_0x33beaa[_0xfbcd('0x57')]['statuses']){if(_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x82')][_0xfbcd('0x54')]===0x0)return;if(_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x82')][0x0][_0xfbcd('0x83')]!=='read')return;return db[_0xfbcd('0x84')][_0xfbcd('0x30')]({'read':!![],'readAt':_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x82')][0x0][_0xfbcd('0x85')]},{'where':{'messageId':_0x33beaa[_0xfbcd('0x57')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0xfbcd('0x1d')](function(_0x18ec98){return _0x53151d[_0xfbcd('0x26')](0xc8)[_0xfbcd('0x28')](_0x18ec98);});}_0x38094b[_0xfbcd('0x86')]=_[_0xfbcd('0x87')](_0x24bb4b[_0xfbcd('0x7f')],[_0xfbcd('0x7b')],[_0xfbcd('0x88')]);if(_0x38094b[_0xfbcd('0x80')][_0xfbcd('0x7f')]){delete _0x38094b[_0xfbcd('0x80')][_0xfbcd('0x7f')];}return db[_0xfbcd('0x89')][_0xfbcd('0x5e')]()[_0xfbcd('0x1d')](function(_0x5d4187){if(!_0x5d4187){throw new db[(_0xfbcd('0x8a'))][(_0xfbcd('0x8b'))](_0xfbcd('0x8c'));}_0x1faf55=_[_0xfbcd('0x8d')](_[_0xfbcd('0x53')](_0x5d4187),['createdAt',_0xfbcd('0x8e')]);_0x50818c=_[_0xfbcd('0x8d')](_[_0xfbcd('0x53')](_0x5d4187),['createdAt',_0xfbcd('0x8e'),_0xfbcd('0x8f'),_0xfbcd('0x90')]);_0x38094b[_0xfbcd('0x57')]={'mapKey':_0xfbcd('0x91')};if(_0x38094b[_0xfbcd('0x80')]&&_0x38094b['account'][_0xfbcd('0x3e')]===_0xfbcd('0x92')){_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x93')]=_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x94')]['replace'](_0xfbcd('0x95'),'');_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x57')]=_0x33beaa[_0xfbcd('0x57')]['Body'];_0x38094b[_0xfbcd('0x57')]['messageId']=_0x33beaa['body'][_0xfbcd('0x96')];}if(_0x38094b[_0xfbcd('0x80')]&&_0x38094b['account'][_0xfbcd('0x3e')]===_0xfbcd('0x81')){_0x38094b['body'][_0xfbcd('0x93')]=_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x97')][0x0]['from'];_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x57')]=_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x97')][0x0][_0xfbcd('0x23')][_0xfbcd('0x57')];_0x38094b['body'][_0xfbcd('0x98')]=_0x33beaa[_0xfbcd('0x57')][_0xfbcd('0x97')][0x0][_0xfbcd('0x99')];}if(_0x38094b[_0xfbcd('0x57')]['id']){delete _0x38094b[_0xfbcd('0x57')]['id'];}if(_[_0xfbcd('0x9a')](_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x93')])){throw new db[(_0xfbcd('0x8a'))][(_0xfbcd('0x8b'))](_0xfbcd('0x9b'));}if(_[_0xfbcd('0x9a')](_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x57')])||_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x57')]===''){throw new db[(_0xfbcd('0x8a'))][(_0xfbcd('0x8b'))](_0xfbcd('0x9c'));}if(_[_0xfbcd('0x9a')](_0x38094b['body'][_0xfbcd('0x9d')])){throw new db[(_0xfbcd('0x8a'))]['ValidationError'](_0xfbcd('0x9e')+_0x50818c);}if(!_[_0xfbcd('0x9f')](_0x50818c,_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x9d')])){throw new db['Sequelize'][(_0xfbcd('0x8b'))](_0xfbcd('0xa0')+_0x50818c);}_0x55b5a3[_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x9d')]]=_0x38094b['body'][_0xfbcd('0x93')];return db[_0xfbcd('0xa1')]['find']({'where':{'id':_0x38094b[_0xfbcd('0x80')][_0xfbcd('0x90')]},'include':[{'model':db['CmContact'],'as':_0xfbcd('0xa2'),'where':_0x55b5a3,'limit':0x1,'order':[[_0xfbcd('0x8e'),_0xfbcd('0xa3')]]}]});})['then'](handleEntityNotFound(_0x53151d,null))[_0xfbcd('0x1d')](function(_0x5b5d1d){if(_0x5b5d1d){_0x38094b['list']=_[_0xfbcd('0x6b')](_0x5b5d1d,[_0xfbcd('0xa2')]);if(_0x5b5d1d['Contacts'][_0xfbcd('0x54')]){return _0x5b5d1d[_0xfbcd('0xa2')][0x0];}var _0x2af8d1=_[_0xfbcd('0x17')](_0x38094b[_0xfbcd('0x57')],{'firstName':_0x38094b['body'][_0xfbcd('0x93')],'ListId':_0x5b5d1d['id']});_0x2af8d1[_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x9d')]]=_0x38094b[_0xfbcd('0x57')]['from'];return db[_0xfbcd('0x89')]['create'](_0x2af8d1,{'fields':_0x1faf55,'raw':!![]});}})[_0xfbcd('0x1d')](handleEntityNotFound(_0x53151d,null))[_0xfbcd('0x1d')](function(_0x57677e){if(_0x57677e){_0x38094b[_0xfbcd('0xa4')]=_0x57677e;var _0x1c5795={'ContactId':_0x57677e['id'],'phone':_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x93')],'WhatsappAccountId':_0x33beaa['params']['id']};var _0x5dc3d6={'ContactId':_0x57677e['id'],'WhatsappAccountId':_0x33beaa[_0xfbcd('0x52')]['id'],'closed':![]};return db[_0xfbcd('0xa5')][_0xfbcd('0x55')]({'where':_0x5dc3d6})[_0xfbcd('0x1d')](function(_0x3814cc){if(_0x3814cc){return[_0x3814cc,![]];}return db[_0xfbcd('0xa5')]['create'](_0x1c5795)[_0xfbcd('0x1d')](function(_0x4baf50){return[_0x4baf50,!![]];});});}})[_0xfbcd('0x6c')](function(_0x361072,_0x51eb8b){_0x38094b['interaction']=_0x361072[_0xfbcd('0x32')]({'plain':!![]});_0x38094b[_0xfbcd('0xa6')]['created']=![];if(_0x51eb8b){if(_0x38094b[_0xfbcd('0x80')]['autoclose']){_0x38094b[_0xfbcd('0x86')][_0xfbcd('0xa7')]({'id':0x0,'priority':_0x38094b[_0xfbcd('0x86')][_0xfbcd('0x54')]+0x1,'app':'close','appdata':_0xfbcd('0xa8'),'interval':_0xfbcd('0xa9')});}_0x38094b[_0xfbcd('0xa6')][_0xfbcd('0xaa')]=!![];}return db[_0xfbcd('0x84')][_0xfbcd('0x56')]({'phone':_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x93')],'messageId':_0x38094b[_0xfbcd('0x57')]['messageId'],'body':_0x38094b[_0xfbcd('0x57')][_0xfbcd('0x57')],'WhatsappAccountId':_0x33beaa[_0xfbcd('0x52')]['id'],'WhatsappInteractionId':_0x361072['id'],'direction':'in','ContactId':_0x361072[_0xfbcd('0xab')],'AttachmentId':_0x38094b['body']['AttachmentId']});})[_0xfbcd('0x1d')](function(_0x1860b9){_0x38094b['message']=_0x1860b9;if(_0x38094b[_0xfbcd('0xa6')][_0xfbcd('0xac')]){return db[_0xfbcd('0x73')][_0xfbcd('0x55')]({'attributes':['id',_0xfbcd('0x37')],'where':{'id':_0x38094b[_0xfbcd('0xa6')][_0xfbcd('0xac')]}})[_0xfbcd('0x1d')](function(_0x2a08df){if(_0x2a08df){_0x38094b[_0xfbcd('0x86')][_0xfbcd('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2a08df[_0xfbcd('0x37')]+','+(_0x38094b[_0xfbcd('0x80')][_0xfbcd('0xae')]||0xa),'interval':_0xfbcd('0xa9')});}return respondWithRpcPromise(_0xfbcd('0xaf'),'startRouting',_0x38094b);});}return respondWithRpcPromise('Start',_0xfbcd('0xb0'),_0x38094b);})[_0xfbcd('0x1d')](function(_0x16afaf){if(_0x16afaf){var _0x34f753=0xc8;var _0x5bf744=_0xfbcd('0xb1');logger[_0xfbcd('0x1e')](_0xfbcd('0xb2'),_0x5bf744,_0x34f753,_0xfbcd('0xb3'));logger[_0xfbcd('0x20')](_0xfbcd('0xb4'),_0x5bf744,_0x34f753,_0xfbcd('0xb3'),JSON[_0xfbcd('0x21')](_0x16afaf));if(_0x38094b[_0xfbcd('0x80')]['type']===_0xfbcd('0x92')){return _0x53151d[_0xfbcd('0x26')](_0x34f753)['set']('Content-Type','text/xml')[_0xfbcd('0x38')](_0xfbcd('0xb5'));}else{return _0x53151d[_0xfbcd('0x26')](_0x34f753)['json'](_0x16afaf);}}});})['catch'](handleError(_0x53151d,null));};exports[_0xfbcd('0x38')]=function(_0x23dbd0,_0x36b193,_0x1ed20c){var _0x5cb909,_0x30741e,_0x3a1144;if(_[_0xfbcd('0x9a')](_0x23dbd0[_0xfbcd('0x57')][_0xfbcd('0x57')])||_0x23dbd0[_0xfbcd('0x57')][_0xfbcd('0x57')]===''){throw new db[(_0xfbcd('0x8a'))][(_0xfbcd('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfbcd('0x9a')](_0x23dbd0[_0xfbcd('0x57')]['to'])){throw new db['Sequelize']['ValidationError'](_0xfbcd('0xb6'));}_0x5cb909=_0x23dbd0['body']['to'];return db[_0xfbcd('0x4f')][_0xfbcd('0x55')]({'where':{'id':_0x23dbd0[_0xfbcd('0x52')]['id']},'include':[{'model':db[_0xfbcd('0xa1')],'as':'List','include':[{'model':db[_0xfbcd('0x89')],'as':_0xfbcd('0xa2'),'where':{'mobile':_0x5cb909},'limit':0x1,'order':[['updatedAt',_0xfbcd('0xa3')]]}]}]})[_0xfbcd('0x1d')](handleEntityNotFound(_0x36b193,null))[_0xfbcd('0x1d')](function(_0x3cff8f){if(_0x3cff8f&&_0x3cff8f[_0xfbcd('0xb7')]){_0x30741e=_0x3cff8f[_0xfbcd('0x32')]({'plain':!![]});if(_0x30741e[_0xfbcd('0xb7')]&&_0x30741e[_0xfbcd('0xb7')][_0xfbcd('0xa2')][_0xfbcd('0x54')]){return _0x30741e[_0xfbcd('0xb7')]['Contacts'][0x0];}return db[_0xfbcd('0x89')][_0xfbcd('0x56')](_[_0xfbcd('0x17')](_0x23dbd0[_0xfbcd('0x57')],{'firstName':_0x5cb909,'mobile':_0x5cb909,'phone':_0x5cb909,'ListId':_0x30741e[_0xfbcd('0x90')]}));}})['then'](handleEntityNotFound(_0x36b193,null))[_0xfbcd('0x1d')](function(_0x1539e9){if(_0x1539e9){_0x3a1144=_0x1539e9;return db[_0xfbcd('0xa5')][_0xfbcd('0x55')]({'where':{'ContactId':_0x3a1144['id'],'closed':![],'WhatsappAccountId':_0x30741e['id']}})[_0xfbcd('0x1d')](function(_0x2f1826){if(_0x2f1826){return[_0x2f1826,![]];}return db[_0xfbcd('0xa5')]['create']({'UserId':_0x23dbd0[_0xfbcd('0x58')]['id'],'ContactId':_0x3a1144['id'],'WhatsappAccountId':_0x30741e['id'],'phone':_0x5cb909,'firstMsgDirection':_0xfbcd('0xb8'),'Messages':[_[_0xfbcd('0x4d')](_0x23dbd0[_0xfbcd('0x57')],{'read':![],'body':_0x23dbd0['body'][_0xfbcd('0x57')],'phone':_0x5cb909,'WhatsappAccountId':_0x30741e['id'],'UserId':_0x23dbd0[_0xfbcd('0x58')]['id'],'ContactId':_0x3a1144['id']})]},{'include':[{'model':db[_0xfbcd('0x84')],'as':_0xfbcd('0xb9')}]})[_0xfbcd('0x1d')](function(_0x53e11b){return[_0x53e11b,!![]];});});}})[_0xfbcd('0x6c')](function(_0x313e21,_0x93ebb0){if(_0x93ebb0){return _0x313e21;}return db[_0xfbcd('0x84')][_0xfbcd('0x56')](_[_0xfbcd('0x4d')](_0x23dbd0[_0xfbcd('0x57')],{'read':![],'body':_0x23dbd0[_0xfbcd('0x57')][_0xfbcd('0x57')],'phone':_0x5cb909,'WhatsappAccountId':_0x30741e['id'],'WhatsappInteractionId':_0x313e21['id'],'UserId':_0x23dbd0[_0xfbcd('0x58')]['id'],'ContactId':_0x3a1144['id']}))[_0xfbcd('0x1d')](function(_0x48bb26){_0x313e21['dataValues'][_0xfbcd('0xb9')]=[];_0x313e21[_0xfbcd('0xba')][_0xfbcd('0xb9')]['push'](_0x48bb26[_0xfbcd('0xba')]);return _0x313e21;});})[_0xfbcd('0x1d')](respondWithResult(_0x36b193,null))[_0xfbcd('0x25')](handleError(_0x36b193,null));}; \ No newline at end of file +var _0x118a=['replace','whatsapp:','Body','messageId','notifications','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','findAll','show','params','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','Disposition','getDispositions','findOne','order','WhatsappAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','Sequelize','difference','createdAt','updatedAt','from','From'];(function(_0x145c22,_0x469a7c){var _0x31d82f=function(_0x375790){while(--_0x375790){_0x145c22['push'](_0x145c22['shift']());}};_0x31d82f(++_0x469a7c);}(_0x118a,0xf7));var _0xa118=function(_0x3954c3,_0x468f84){_0x3954c3=_0x3954c3-0x0;var _0x427a9d=_0x118a[_0x3954c3];return _0x427a9d;};'use strict';var emlformat=require(_0xa118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa118('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa118('0x2'));var moment=require(_0xa118('0x3'));var BPromise=require(_0xa118('0x4'));var Mustache=require(_0xa118('0x5'));var util=require(_0xa118('0x6'));var path=require(_0xa118('0x7'));var sox=require(_0xa118('0x8'));var csv=require('to-csv');var ejs=require(_0xa118('0x9'));var fs=require('fs');var fs_extra=require(_0xa118('0xa'));var _=require(_0xa118('0xb'));var squel=require(_0xa118('0xc'));var crypto=require(_0xa118('0xd'));var jsforce=require(_0xa118('0xe'));var deskjs=require(_0xa118('0xf'));var toCsv=require(_0xa118('0x10'));var querystring=require(_0xa118('0x11'));var Papa=require(_0xa118('0x12'));var Redis=require(_0xa118('0x13'));var authService=require(_0xa118('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa118('0x15'))(_0xa118('0x16'));var utils=require(_0xa118('0x17'));var config=require(_0xa118('0x18'));var licenseUtil=require(_0xa118('0x19'));var db=require(_0xa118('0x1a'))['db'];config['redis']=_[_0xa118('0x1b')](config[_0xa118('0x1c')],{'host':_0xa118('0x1d'),'port':0x18eb});var socket=require(_0xa118('0x1e'))(new Redis(config[_0xa118('0x1c')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xa118('0x1f'));var client=jayson['client'][_0xa118('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xe91ebd,_0x31038a,_0x33f8b3,_0x371418){return new BPromise(function(_0x16343b,_0x530ff0){var _0x37f830=_0x371418||client;return _0x37f830[_0xa118('0x21')](_0xe91ebd,_0x33f8b3)[_0xa118('0x22')](function(_0x30e5c8){logger[_0xa118('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x31038a,_0xa118('0x24'));logger[_0xa118('0x25')](_0xa118('0x26'),_0x31038a,_0xa118('0x24'),JSON['stringify'](_0x30e5c8));if(_0x30e5c8[_0xa118('0x27')]){if(_0x30e5c8['error'][_0xa118('0x28')]===0x1f4){logger[_0xa118('0x27')](_0xa118('0x29'),_0x31038a,_0x30e5c8[_0xa118('0x27')][_0xa118('0x2a')]);return _0x530ff0(_0x30e5c8['error']['message']);}logger[_0xa118('0x27')](_0xa118('0x29'),_0x31038a,_0x30e5c8['error'][_0xa118('0x2a')]);return _0x16343b(_0x30e5c8[_0xa118('0x27')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x31038a,_0xa118('0x24'));_0x16343b(_0x30e5c8[_0xa118('0x2b')][_0xa118('0x2a')]);}})[_0xa118('0x2c')](function(_0x50f93b){logger[_0xa118('0x27')](_0xa118('0x29'),_0x31038a,_0x50f93b);_0x530ff0(_0x50f93b);});});}function respondWithStatusCode(_0x20dc39,_0x574a32){_0x574a32=_0x574a32||0xcc;return function(_0x5627f1){if(_0x5627f1){return _0x20dc39[_0xa118('0x2d')](_0x574a32);}return _0x20dc39[_0xa118('0x2e')](_0x574a32)['end']();};}function respondWithResult(_0xcd8d9b,_0x19d881){_0x19d881=_0x19d881||0xc8;return function(_0x316244){if(_0x316244){return _0xcd8d9b[_0xa118('0x2e')](_0x19d881)['json'](_0x316244);}};}function respondWithFilteredResult(_0xca29ea,_0x2a96bd){return function(_0x1a0ae0){if(_0x1a0ae0){var _0x1115b8=typeof _0x2a96bd[_0xa118('0x2f')]==='undefined'&&typeof _0x2a96bd['limit']===_0xa118('0x30');var _0x2703c4=_0x1a0ae0['count'];var _0xe75f2=_0x1115b8?0x0:_0x2a96bd[_0xa118('0x2f')];var _0x537d3f=_0x1115b8?_0x1a0ae0[_0xa118('0x31')]:_0x2a96bd[_0xa118('0x2f')]+_0x2a96bd['limit'];var _0x44449b;if(_0x537d3f>=_0x2703c4){_0x537d3f=_0x2703c4;_0x44449b=0xc8;}else{_0x44449b=0xce;}_0xca29ea[_0xa118('0x2e')](_0x44449b);return _0xca29ea[_0xa118('0x32')](_0xa118('0x33'),_0xe75f2+'-'+_0x537d3f+'/'+_0x2703c4)[_0xa118('0x34')](_0x1a0ae0);}return null;};}function patchUpdates(_0x42a50e){return function(_0x32f502){try{jsonpatch[_0xa118('0x35')](_0x32f502,_0x42a50e,!![]);}catch(_0xc1e23b){return BPromise[_0xa118('0x36')](_0xc1e23b);}return _0x32f502[_0xa118('0x37')]();};}function saveUpdates(_0x365424,_0x431737){return function(_0x5c2bf1){if(_0x5c2bf1){return _0x5c2bf1[_0xa118('0x38')](_0x365424)[_0xa118('0x22')](function(_0x5b3d2d){return _0x5b3d2d;});}return null;};}function removeEntity(_0x1974ee,_0x2ef9d7){return function(_0x41de6a){if(_0x41de6a){return _0x41de6a[_0xa118('0x39')]()[_0xa118('0x22')](function(){var _0x4ddbe8=_0x41de6a['get']({'plain':!![]});var _0x345612=_0xa118('0x3a');return db[_0xa118('0x3b')][_0xa118('0x39')]({'where':{'type':_0x345612,'resourceId':_0x4ddbe8['id']}})[_0xa118('0x22')](function(){return _0x41de6a;});})['then'](function(){_0x1974ee['status'](0xcc)[_0xa118('0x3c')]();});}};}function handleEntityNotFound(_0x3355a2,_0x3a30e5){return function(_0x2c63a4){if(!_0x2c63a4){_0x3355a2[_0xa118('0x2d')](0x194);}return _0x2c63a4;};}function handleError(_0x479a00,_0x5ef294){_0x5ef294=_0x5ef294||0x1f4;return function(_0xd8275d){logger[_0xa118('0x27')](_0xd8275d[_0xa118('0x3d')]);if(_0xd8275d[_0xa118('0x3e')]){delete _0xd8275d[_0xa118('0x3e')];}_0x479a00['status'](_0x5ef294)[_0xa118('0x3f')](_0xd8275d);};}exports['index']=function(_0x3a102a,_0xfc333){var _0x48bf26={'include':[{'model':db[_0xa118('0x40')],'as':_0xa118('0x41')}]},_0x266c3f={},_0x3fa16e={'count':0x0,'rows':[]};var _0x4cd82c=_[_0xa118('0x42')](db[_0xa118('0x43')]['rawAttributes'],function(_0x5f30de){return{'name':_0x5f30de[_0xa118('0x44')],'type':_0x5f30de[_0xa118('0x45')][_0xa118('0x46')]};});_0x266c3f[_0xa118('0x47')]=_[_0xa118('0x42')](_0x4cd82c,_0xa118('0x3e'));_0x266c3f[_0xa118('0x48')]=_[_0xa118('0x49')](_0x3a102a['query']);_0x266c3f['filters']=_[_0xa118('0x4a')](_0x266c3f[_0xa118('0x47')],_0x266c3f[_0xa118('0x48')]);_0x48bf26[_0xa118('0x4b')]=_[_0xa118('0x4a')](_0x266c3f[_0xa118('0x47')],qs[_0xa118('0x4c')](_0x3a102a[_0xa118('0x48')][_0xa118('0x4c')]));_0x48bf26[_0xa118('0x4b')]=_0x48bf26['attributes'][_0xa118('0x4d')]?_0x48bf26['attributes']:_0x266c3f[_0xa118('0x47')];if(!_0x3a102a[_0xa118('0x48')][_0xa118('0x4e')](_0xa118('0x4f'))){_0x48bf26[_0xa118('0x50')]=qs[_0xa118('0x50')](_0x3a102a[_0xa118('0x48')][_0xa118('0x50')]);_0x48bf26[_0xa118('0x2f')]=qs['offset'](_0x3a102a[_0xa118('0x48')][_0xa118('0x2f')]);}_0x48bf26['order']=qs['sort'](_0x3a102a[_0xa118('0x48')][_0xa118('0x51')]);_0x48bf26['where']=qs[_0xa118('0x52')](_[_0xa118('0x53')](_0x3a102a['query'],_0x266c3f['filters']),_0x4cd82c);if(_0x3a102a['query'][_0xa118('0x54')]){_0x48bf26[_0xa118('0x55')]=_[_0xa118('0x56')](_0x48bf26[_0xa118('0x55')],{'$or':_['map'](_0x4cd82c,function(_0x415302){if(_0x415302['type']!==_0xa118('0x57')){var _0x4d4885={};_0x4d4885[_0x415302[_0xa118('0x3e')]]={'$like':'%'+_0x3a102a[_0xa118('0x48')]['filter']+'%'};return _0x4d4885;}})});}_0x48bf26=_[_0xa118('0x56')]({},_0x48bf26,_0x3a102a[_0xa118('0x58')]);var _0x31ec8c={'where':_0x48bf26['where']};return db[_0xa118('0x43')][_0xa118('0x31')](_0x31ec8c)[_0xa118('0x22')](function(_0x4d0c90){_0x3fa16e['count']=_0x4d0c90;if(_0x3a102a['query']['includeAll']){_0x48bf26['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xa118('0x59')](_0x48bf26);})[_0xa118('0x22')](function(_0x198104){_0x3fa16e['rows']=_0x198104;return _0x3fa16e;})[_0xa118('0x22')](respondWithFilteredResult(_0xfc333,_0x48bf26))['catch'](handleError(_0xfc333,null));};exports[_0xa118('0x5a')]=function(_0x183cbe,_0x5b44dc){var _0x43acc8={'raw':![],'where':{'id':_0x183cbe[_0xa118('0x5b')]['id']},'include':[{'model':db[_0xa118('0x40')],'as':_0xa118('0x41')}]},_0x40ce43={};_0x40ce43[_0xa118('0x47')]=_[_0xa118('0x49')](db[_0xa118('0x43')][_0xa118('0x5c')]);_0x40ce43[_0xa118('0x48')]=_[_0xa118('0x49')](_0x183cbe[_0xa118('0x48')]);_0x40ce43[_0xa118('0x52')]=_[_0xa118('0x4a')](_0x40ce43[_0xa118('0x47')],_0x40ce43[_0xa118('0x48')]);_0x43acc8[_0xa118('0x4b')]=_['intersection'](_0x40ce43[_0xa118('0x47')],qs[_0xa118('0x4c')](_0x183cbe['query'][_0xa118('0x4c')]));_0x43acc8['attributes']=_0x43acc8['attributes']['length']?_0x43acc8[_0xa118('0x4b')]:_0x40ce43[_0xa118('0x47')];if(_0x183cbe[_0xa118('0x48')]['includeAll']){_0x43acc8[_0xa118('0x5d')]=[{'all':!![]}];}_0x43acc8=_[_0xa118('0x56')]({},_0x43acc8,_0x183cbe[_0xa118('0x58')]);return db[_0xa118('0x43')]['find'](_0x43acc8)[_0xa118('0x22')](handleEntityNotFound(_0x5b44dc,null))[_0xa118('0x22')](respondWithResult(_0x5b44dc,null))[_0xa118('0x2c')](handleError(_0x5b44dc,null));};exports[_0xa118('0x5e')]=function(_0x4e343b,_0x149f58){return db[_0xa118('0x43')]['create'](_0x4e343b[_0xa118('0x5f')],{})[_0xa118('0x22')](function(_0x6d48d4){var _0x73055a=_0x4e343b[_0xa118('0x60')][_0xa118('0x61')]({'plain':!![]});if(!_0x73055a)throw new Error(_0xa118('0x62'));if(_0x73055a['role']===_0xa118('0x60')){var _0x1fb5b4=_0x6d48d4['get']({'plain':!![]});var _0x48fe5e=_0xa118('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x48fe5e,'userProfileId':_0x73055a[_0xa118('0x63')]},'raw':!![]})[_0xa118('0x22')](function(_0x3e39a8){if(_0x3e39a8&&_0x3e39a8[_0xa118('0x64')]===0x0){return db[_0xa118('0x3b')]['create']({'name':_0x1fb5b4[_0xa118('0x3e')],'resourceId':_0x1fb5b4['id'],'type':_0x3e39a8[_0xa118('0x3e')],'sectionId':_0x3e39a8['id']},{})['then'](function(){return _0x6d48d4;});}else{return _0x6d48d4;}})[_0xa118('0x2c')](function(_0x4e81dc){logger[_0xa118('0x27')](_0xa118('0x65'),_0x4e81dc);throw _0x4e81dc;});}return _0x6d48d4;})['then'](respondWithResult(_0x149f58,0xc9))[_0xa118('0x2c')](handleError(_0x149f58,null));};exports[_0xa118('0x38')]=function(_0x549cff,_0x5da5f8){if(_0x549cff[_0xa118('0x5f')]['id']){delete _0x549cff[_0xa118('0x5f')]['id'];}return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0x549cff[_0xa118('0x5b')]['id']},'include':[{'model':db[_0xa118('0x40')],'as':_0xa118('0x41')}]})[_0xa118('0x22')](handleEntityNotFound(_0x5da5f8,null))[_0xa118('0x22')](saveUpdates(_0x549cff[_0xa118('0x5f')],null))[_0xa118('0x22')](respondWithResult(_0x5da5f8,null))['catch'](handleError(_0x5da5f8,null));};exports[_0xa118('0x39')]=function(_0x2dc821,_0x497ba8){return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0x2dc821[_0xa118('0x5b')]['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x497ba8,null))['then'](removeEntity(_0x497ba8,null))['catch'](handleError(_0x497ba8,null));};exports['describe']=function(_0x33728d,_0x5a3e7f){return db[_0xa118('0x43')][_0xa118('0x67')]()[_0xa118('0x22')](respondWithResult(_0x5a3e7f,null))[_0xa118('0x2c')](handleError(_0x5a3e7f,null));};exports['addDisposition']=function(_0x1be5e7,_0x2e7693,_0x4b0877){if(_0x1be5e7[_0xa118('0x5f')]['id']){delete _0x1be5e7[_0xa118('0x5f')]['id'];}return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0x1be5e7[_0xa118('0x5b')]['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x2e7693,null))[_0xa118('0x22')](function(_0x102f0b){if(_0x102f0b){_0x1be5e7[_0xa118('0x5f')]['WhatsappAccountId']=_0x102f0b['id'];return db[_0xa118('0x68')][_0xa118('0x5e')](_0x1be5e7[_0xa118('0x5f')]);}})['then'](respondWithResult(_0x2e7693,null))[_0xa118('0x2c')](handleError(_0x2e7693,null));};exports[_0xa118('0x69')]=function(_0x318a2f,_0x14dd69,_0x4fdf81){var _0x4cacf7={'raw':![],'where':{}};var _0x503ee8={};var _0x2016eb={'count':0x0,'rows':[]};return db[_0xa118('0x43')][_0xa118('0x6a')]({'where':{'id':_0x318a2f['params']['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x14dd69,null))[_0xa118('0x22')](function(_0x73af48){if(_0x73af48){_0x503ee8[_0xa118('0x47')]=_[_0xa118('0x49')](db[_0xa118('0x68')][_0xa118('0x5c')]);_0x503ee8[_0xa118('0x48')]=_[_0xa118('0x49')](_0x318a2f[_0xa118('0x48')]);_0x503ee8[_0xa118('0x52')]=_[_0xa118('0x4a')](_0x503ee8[_0xa118('0x47')],_0x503ee8[_0xa118('0x48')]);_0x4cacf7[_0xa118('0x4b')]=_['intersection'](_0x503ee8[_0xa118('0x47')],qs[_0xa118('0x4c')](_0x318a2f['query'][_0xa118('0x4c')]));_0x4cacf7[_0xa118('0x4b')]=_0x4cacf7[_0xa118('0x4b')][_0xa118('0x4d')]?_0x4cacf7['attributes']:_0x503ee8[_0xa118('0x47')];if(!_0x318a2f[_0xa118('0x48')][_0xa118('0x4e')](_0xa118('0x4f'))){_0x4cacf7[_0xa118('0x50')]=qs[_0xa118('0x50')](_0x318a2f['query']['limit']);_0x4cacf7[_0xa118('0x2f')]=qs[_0xa118('0x2f')](_0x318a2f[_0xa118('0x48')][_0xa118('0x2f')]);}_0x4cacf7[_0xa118('0x6b')]=qs[_0xa118('0x51')](_0x318a2f[_0xa118('0x48')][_0xa118('0x51')]);_0x4cacf7[_0xa118('0x55')]=qs[_0xa118('0x52')](_[_0xa118('0x53')](_0x318a2f[_0xa118('0x48')],_0x503ee8[_0xa118('0x52')]));_0x4cacf7[_0xa118('0x55')][_0xa118('0x6c')]=_0x73af48['id'];if(_0x318a2f[_0xa118('0x48')][_0xa118('0x54')]){_0x4cacf7[_0xa118('0x55')]=_[_0xa118('0x56')](_0x4cacf7[_0xa118('0x55')],{'$or':_[_0xa118('0x42')](_0x4cacf7[_0xa118('0x4b')],function(_0x47fbf8){var _0x141c49={};_0x141c49[_0x47fbf8]={'$like':'%'+_0x318a2f[_0xa118('0x48')][_0xa118('0x54')]+'%'};return _0x141c49;})});}_0x4cacf7=_['merge']({},_0x4cacf7,_0x318a2f['options']);return db[_0xa118('0x68')][_0xa118('0x31')]({'where':_0x4cacf7['where']})['then'](function(_0x62dc22){_0x2016eb['count']=_0x62dc22;if(_0x318a2f[_0xa118('0x48')][_0xa118('0x6d')]){_0x4cacf7[_0xa118('0x5d')]=[{'all':!![]}];}return db[_0xa118('0x68')][_0xa118('0x59')](_0x4cacf7);})[_0xa118('0x22')](function(_0x2aca44){_0x2016eb['rows']=_0x2aca44;return _0x2016eb;});}})[_0xa118('0x22')](respondWithFilteredResult(_0x14dd69,_0x4cacf7))[_0xa118('0x2c')](handleError(_0x14dd69,null));};exports[_0xa118('0x6e')]=function(_0xa2b11,_0x25bfdc,_0x2fdac5){return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0xa2b11['params']['id']}})['then'](handleEntityNotFound(_0x25bfdc,null))[_0xa118('0x22')](function(_0x21a793){if(_0x21a793){return _0x21a793[_0xa118('0x6e')](_0xa2b11[_0xa118('0x48')][_0xa118('0x6f')]);}})[_0xa118('0x22')](respondWithStatusCode(_0x25bfdc,null))[_0xa118('0x2c')](handleError(_0x25bfdc,null));};exports[_0xa118('0x70')]=function(_0x1ec64b,_0x1ff779,_0xd418b3){if(_0x1ec64b['body']['id']){delete _0x1ec64b[_0xa118('0x5f')]['id'];}return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0x1ec64b[_0xa118('0x5b')]['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x1ff779,null))[_0xa118('0x22')](function(_0x57f836){if(_0x57f836){_0x1ec64b[_0xa118('0x5f')][_0xa118('0x6c')]=_0x57f836['id'];return db[_0xa118('0x71')][_0xa118('0x5e')](_0x1ec64b[_0xa118('0x5f')]);}})[_0xa118('0x22')](respondWithResult(_0x1ff779,null))['catch'](handleError(_0x1ff779,null));};exports[_0xa118('0x72')]=function(_0x2a4d61,_0x27f480,_0x64b898){var _0x3fff62={'raw':![],'where':{}};var _0x57e049={};var _0x2985f2={'count':0x0,'rows':[]};return db[_0xa118('0x43')]['findOne']({'where':{'id':_0x2a4d61[_0xa118('0x5b')]['id']}})['then'](handleEntityNotFound(_0x27f480,null))[_0xa118('0x22')](function(_0x58c985){if(_0x58c985){_0x57e049[_0xa118('0x47')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x57e049[_0xa118('0x48')]=_[_0xa118('0x49')](_0x2a4d61[_0xa118('0x48')]);_0x57e049['filters']=_[_0xa118('0x4a')](_0x57e049[_0xa118('0x47')],_0x57e049[_0xa118('0x48')]);_0x3fff62[_0xa118('0x4b')]=_[_0xa118('0x4a')](_0x57e049[_0xa118('0x47')],qs[_0xa118('0x4c')](_0x2a4d61['query'][_0xa118('0x4c')]));_0x3fff62[_0xa118('0x4b')]=_0x3fff62['attributes'][_0xa118('0x4d')]?_0x3fff62[_0xa118('0x4b')]:_0x57e049['model'];if(!_0x2a4d61[_0xa118('0x48')][_0xa118('0x4e')](_0xa118('0x4f'))){_0x3fff62['limit']=qs['limit'](_0x2a4d61['query']['limit']);_0x3fff62[_0xa118('0x2f')]=qs[_0xa118('0x2f')](_0x2a4d61[_0xa118('0x48')][_0xa118('0x2f')]);}_0x3fff62[_0xa118('0x6b')]=qs[_0xa118('0x51')](_0x2a4d61[_0xa118('0x48')][_0xa118('0x51')]);_0x3fff62[_0xa118('0x55')]=qs['filters'](_[_0xa118('0x53')](_0x2a4d61[_0xa118('0x48')],_0x57e049[_0xa118('0x52')]));_0x3fff62[_0xa118('0x55')]['WhatsappAccountId']=_0x58c985['id'];if(_0x2a4d61['query'][_0xa118('0x54')]){_0x3fff62[_0xa118('0x55')]=_['merge'](_0x3fff62[_0xa118('0x55')],{'$or':_[_0xa118('0x42')](_0x3fff62[_0xa118('0x4b')],function(_0x37d787){var _0x2dfd03={};_0x2dfd03[_0x37d787]={'$like':'%'+_0x2a4d61['query'][_0xa118('0x54')]+'%'};return _0x2dfd03;})});}_0x3fff62=_[_0xa118('0x56')]({},_0x3fff62,_0x2a4d61[_0xa118('0x58')]);return db[_0xa118('0x71')][_0xa118('0x31')]({'where':_0x3fff62[_0xa118('0x55')]})[_0xa118('0x22')](function(_0x56b590){_0x2985f2['count']=_0x56b590;if(_0x2a4d61['query'][_0xa118('0x6d')]){_0x3fff62['include']=[{'all':!![]}];}return db[_0xa118('0x71')]['findAll'](_0x3fff62);})[_0xa118('0x22')](function(_0xb51c6d){_0x2985f2[_0xa118('0x73')]=_0xb51c6d;return _0x2985f2;});}})['then'](respondWithFilteredResult(_0x27f480,_0x3fff62))['catch'](handleError(_0x27f480,null));};exports[_0xa118('0x74')]=function(_0x416160,_0x252676,_0x3e303a){return db['WhatsappAccount']['find']({'where':{'id':_0x416160[_0xa118('0x5b')]['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x252676,null))['then'](function(_0x5584c1){if(_0x5584c1){return _0x5584c1[_0xa118('0x74')](_0x416160[_0xa118('0x48')][_0xa118('0x6f')]);}})[_0xa118('0x22')](respondWithStatusCode(_0x252676,null))[_0xa118('0x2c')](handleError(_0x252676,null));};exports[_0xa118('0x75')]=function(_0x509f8d,_0x3beffd,_0x35537b){return db['WhatsappAccount'][_0xa118('0x66')]({'where':{'id':_0x509f8d[_0xa118('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3beffd,null))[_0xa118('0x22')](function(_0x51a444){if(_0x51a444){return _0x51a444['addAgents'](_0x509f8d[_0xa118('0x5f')][_0xa118('0x6f')],_[_0xa118('0x76')](_0x509f8d['body'],[_0xa118('0x6f'),'id'])||{})[_0xa118('0x77')](function(_0x49e33d){for(var _0x213622=0x0;_0x213622<_0x509f8d[_0xa118('0x5f')][_0xa118('0x6f')]['length'];_0x213622+=0x1){socket['emit'](_0xa118('0x78'),{'UserId':Number(_0x509f8d['body'][_0xa118('0x6f')][_0x213622]),'WhatsappAccountId':Number(_0x509f8d['params']['id'])});}return _0x49e33d;});}})[_0xa118('0x22')](respondWithResult(_0x3beffd,null))[_0xa118('0x2c')](handleError(_0x3beffd,null));};exports[_0xa118('0x79')]=function(_0xa908d0,_0x572f2c,_0x348dee){return db['WhatsappAccount'][_0xa118('0x66')]({'where':{'id':_0xa908d0[_0xa118('0x5b')]['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x572f2c,null))['then'](function(_0x1fae92){if(_0x1fae92){return _0x1fae92[_0xa118('0x79')](_0xa908d0[_0xa118('0x48')][_0xa118('0x6f')])[_0xa118('0x22')](function(){if(_[_0xa118('0x7a')](_0xa908d0[_0xa118('0x48')][_0xa118('0x6f')])){for(var _0x6cb01e=0x0;_0x6cb01e<_0xa908d0[_0xa118('0x48')][_0xa118('0x6f')][_0xa118('0x4d')];_0x6cb01e+=0x1){socket[_0xa118('0x7b')](_0xa118('0x7c'),{'UserId':Number(_0xa908d0[_0xa118('0x48')][_0xa118('0x6f')][_0x6cb01e]),'WhatsappAccountId':Number(_0xa908d0['params']['id'])});}}else{socket['emit'](_0xa118('0x7c'),{'UserId':Number(_0xa908d0[_0xa118('0x48')][_0xa118('0x6f')]),'WhatsappAccountId':Number(_0xa908d0[_0xa118('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x572f2c,null))['catch'](handleError(_0x572f2c,null));};exports[_0xa118('0x7d')]=function(_0x1320d1,_0x5847e4,_0x221329){var _0x479bf6={};var _0x27dc87={};var _0x188fd4;var _0x581ca5;return db['WhatsappAccount'][_0xa118('0x6a')]({'where':{'id':_0x1320d1['params']['id']}})[_0xa118('0x22')](handleEntityNotFound(_0x5847e4,null))[_0xa118('0x22')](function(_0x4ede61){if(_0x4ede61){_0x188fd4=_0x4ede61;_0x27dc87[_0xa118('0x47')]=_[_0xa118('0x49')](db[_0xa118('0x7e')]['rawAttributes']);_0x27dc87[_0xa118('0x48')]=_[_0xa118('0x49')](_0x1320d1[_0xa118('0x48')]);_0x27dc87[_0xa118('0x52')]=_[_0xa118('0x4a')](_0x27dc87[_0xa118('0x47')],_0x27dc87[_0xa118('0x48')]);_0x479bf6['attributes']=_[_0xa118('0x4a')](_0x27dc87[_0xa118('0x47')],qs[_0xa118('0x4c')](_0x1320d1[_0xa118('0x48')]['fields']));_0x479bf6[_0xa118('0x4b')]=_0x479bf6[_0xa118('0x4b')][_0xa118('0x4d')]?_0x479bf6[_0xa118('0x4b')]:_0x27dc87[_0xa118('0x47')];_0x479bf6['order']=qs[_0xa118('0x51')](_0x1320d1['query'][_0xa118('0x51')]);_0x479bf6[_0xa118('0x55')]=qs[_0xa118('0x52')](_[_0xa118('0x53')](_0x1320d1['query'],_0x27dc87[_0xa118('0x52')]));if(_0x1320d1[_0xa118('0x48')][_0xa118('0x54')]){_0x479bf6[_0xa118('0x55')]=_['merge'](_0x479bf6[_0xa118('0x55')],{'$or':_[_0xa118('0x42')](_0x479bf6[_0xa118('0x4b')],function(_0x50dadb){var _0x4c8032={};_0x4c8032[_0x50dadb]={'$like':'%'+_0x1320d1[_0xa118('0x48')][_0xa118('0x54')]+'%'};return _0x4c8032;})});}_0x479bf6=_[_0xa118('0x56')]({},_0x479bf6,_0x1320d1[_0xa118('0x58')]);return _0x188fd4['getAgents'](_0x479bf6);}})['then'](function(_0x5ac2d5){if(_0x5ac2d5){_0x581ca5=_0x5ac2d5[_0xa118('0x4d')];if(!_0x1320d1['query'][_0xa118('0x4e')]('nolimit')){_0x479bf6[_0xa118('0x50')]=qs['limit'](_0x1320d1[_0xa118('0x48')][_0xa118('0x50')]);_0x479bf6['offset']=qs[_0xa118('0x2f')](_0x1320d1['query'][_0xa118('0x2f')]);}return _0x188fd4[_0xa118('0x7d')](_0x479bf6);}})[_0xa118('0x22')](function(_0x32c814){if(_0x32c814){return _0x32c814?{'count':_0x581ca5,'rows':_0x32c814}:null;}})[_0xa118('0x22')](respondWithResult(_0x5847e4,null))[_0xa118('0x2c')](handleError(_0x5847e4,null));};exports[_0xa118('0x7f')]=function(_0x576e8d,_0x124c16){var _0x44d9c0=_0x576e8d[_0xa118('0x5b')]['id'];var _0x2cfbd9=_0x576e8d[_0xa118('0x5f')];var _0x3049a7=0xc8;var _0x4de438=null;return db['sequelize'][_0xa118('0x80')]({'isolationLevel':db[_0xa118('0x81')]['Transaction'][_0xa118('0x82')][_0xa118('0x83')]},function(_0x306ae0){return db['WhatsappAccount'][_0xa118('0x6a')]({'where':{'id':_0x44d9c0},'transaction':_0x306ae0})[_0xa118('0x22')](function(_0x3d39b6){if(_0x3d39b6){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x44d9c0},'transaction':_0x306ae0})[_0xa118('0x22')](function(){var _0x4c8fb4=_[_0xa118('0x42')](_0x2cfbd9,function(_0x37f68a){_0x37f68a[_0xa118('0x6c')]=_0x44d9c0;return _0x37f68a;});return db[_0xa118('0x84')][_0xa118('0x85')](_0x4c8fb4,{'transaction':_0x306ae0});});}else{_0x3049a7=0x194;_0x4de438=[];}});})[_0xa118('0x22')](function(){if(_0x3049a7!==0x194){return db[_0xa118('0x84')][_0xa118('0x86')]({'where':{'WhatsappAccountId':_0x44d9c0},'order':_0xa118('0x87')})[_0xa118('0x22')](function(_0xaa6eeb){_0x4de438=_0xaa6eeb;});}})[_0xa118('0x2c')](function(_0x267b07){_0x3049a7=0x1f4;logger['error'](_0x267b07['stack']);if(_0x267b07['name']){delete _0x267b07[_0xa118('0x3e')];}_0x4de438=_0x267b07;})[_0xa118('0x88')](function(){if(_0x4de438===null){_0x124c16[_0xa118('0x2d')](_0x3049a7);}else{if(_0x3049a7===0x1f4){_0x124c16[_0xa118('0x2e')](_0x3049a7)[_0xa118('0x3f')](_0x4de438);}else{_0x124c16[_0xa118('0x2e')](_0x3049a7)['json'](_0x4de438);}}});};exports[_0xa118('0x89')]=function(_0x3bcebd,_0x5181ca,_0x30f55a){var _0x2244a3={};var _0xcc8bd8={};var _0x2d5954;var _0xc6646e;return db[_0xa118('0x43')]['findOne']({'where':{'id':_0x3bcebd['params']['id']}})['then'](handleEntityNotFound(_0x5181ca,null))[_0xa118('0x22')](function(_0x412e31){if(_0x412e31){_0x2d5954=_0x412e31;_0xcc8bd8['model']=_[_0xa118('0x49')](db[_0xa118('0x84')][_0xa118('0x5c')]);_0xcc8bd8[_0xa118('0x48')]=_[_0xa118('0x49')](_0x3bcebd[_0xa118('0x48')]);_0xcc8bd8['filters']=_['intersection'](_0xcc8bd8[_0xa118('0x47')],_0xcc8bd8['query']);_0x2244a3['attributes']=_[_0xa118('0x4a')](_0xcc8bd8['model'],qs['fields'](_0x3bcebd['query']['fields']));_0x2244a3['attributes']=_0x2244a3['attributes'][_0xa118('0x4d')]?_0x2244a3[_0xa118('0x4b')]:_0xcc8bd8[_0xa118('0x47')];_0x2244a3[_0xa118('0x6b')]=qs[_0xa118('0x51')](_0x3bcebd[_0xa118('0x48')][_0xa118('0x51')]);_0x2244a3['where']=qs[_0xa118('0x52')](_['pick'](_0x3bcebd['query'],_0xcc8bd8[_0xa118('0x52')]));if(_0x3bcebd[_0xa118('0x48')]['filter']){_0x2244a3[_0xa118('0x55')]=_[_0xa118('0x56')](_0x2244a3[_0xa118('0x55')],{'$or':_['map'](_0x2244a3[_0xa118('0x4b')],function(_0x387479){var _0x354aba={};_0x354aba[_0x387479]={'$like':'%'+_0x3bcebd[_0xa118('0x48')][_0xa118('0x54')]+'%'};return _0x354aba;})});}_0x2244a3=_[_0xa118('0x56')]({},_0x2244a3,_0x3bcebd[_0xa118('0x58')]);return _0x2d5954[_0xa118('0x89')](_0x2244a3);}})[_0xa118('0x22')](function(_0x352910){if(_0x352910){_0xc6646e=_0x352910[_0xa118('0x4d')];if(!_0x3bcebd[_0xa118('0x48')]['hasOwnProperty'](_0xa118('0x4f'))){_0x2244a3[_0xa118('0x50')]=qs[_0xa118('0x50')](_0x3bcebd['query'][_0xa118('0x50')]);_0x2244a3[_0xa118('0x2f')]=qs[_0xa118('0x2f')](_0x3bcebd[_0xa118('0x48')][_0xa118('0x2f')]);}return _0x2d5954['getApplications'](_0x2244a3);}})[_0xa118('0x22')](function(_0x4ee984){if(_0x4ee984){return _0x4ee984?{'count':_0xc6646e,'rows':_0x4ee984}:null;}})[_0xa118('0x22')](respondWithResult(_0x5181ca,null))[_0xa118('0x2c')](handleError(_0x5181ca,null));};exports[_0xa118('0x8a')]=function(_0x1000ec,_0x4209ef,_0x3f7ac9){var _0x363a94={'channel':_0xa118('0x8b')};var _0x95647d=[];var _0xae511f=[];var _0x45fdd8={};return db[_0xa118('0x43')][_0xa118('0x66')]({'where':{'id':_0x1000ec[_0xa118('0x5b')]['id']},'include':[{'model':db[_0xa118('0x84')],'as':_0xa118('0x8c')}]})[_0xa118('0x22')](handleEntityNotFound(_0x4209ef,null))[_0xa118('0x22')](function(_0x48ef44){_0x363a94['account']=_0x48ef44;if(_0x363a94[_0xa118('0x8d')]&&_0x363a94[_0xa118('0x8d')]['type']===_0xa118('0x8e')&&_0x1000ec[_0xa118('0x5f')][_0xa118('0x8f')]){if(_0x1000ec[_0xa118('0x5f')][_0xa118('0x8f')]['length']===0x0)return;if(_0x1000ec[_0xa118('0x5f')][_0xa118('0x8f')][0x0][_0xa118('0x90')]!==_0xa118('0x91'))return;return db[_0xa118('0x92')][_0xa118('0x38')]({'read':!![],'readAt':_0x1000ec['body'][_0xa118('0x8f')][0x0][_0xa118('0x93')]},{'where':{'messageId':_0x1000ec[_0xa118('0x5f')]['statuses'][0x0][_0xa118('0x94')]},'individualHooks':!![]})['then'](function(_0x3c2a25){return _0x4209ef[_0xa118('0x2e')](0xc8)[_0xa118('0x34')](_0x3c2a25);});}_0x363a94[_0xa118('0x95')]=_['orderBy'](_0x48ef44['Applications'],[_0xa118('0x87')],[_0xa118('0x96')]);if(_0x363a94[_0xa118('0x8d')]['Applications']){delete _0x363a94[_0xa118('0x8d')][_0xa118('0x8c')];}return db['CmContact']['describe']()[_0xa118('0x22')](function(_0x7d8c4d){if(!_0x7d8c4d){throw new db[(_0xa118('0x97'))]['ValidationError']('no\x20available\x20attributes');}_0x95647d=_[_0xa118('0x98')](_[_0xa118('0x49')](_0x7d8c4d),[_0xa118('0x99'),_0xa118('0x9a')]);_0xae511f=_[_0xa118('0x98')](_[_0xa118('0x49')](_0x7d8c4d),[_0xa118('0x99'),'updatedAt','CompanyId','ListId']);_0x363a94[_0xa118('0x5f')]={'mapKey':'mobile'};if(_0x363a94[_0xa118('0x8d')]&&_0x363a94[_0xa118('0x8d')][_0xa118('0x45')]==='twilio'){_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')]=_0x1000ec['body'][_0xa118('0x9c')][_0xa118('0x9d')](_0xa118('0x9e'),'');_0x363a94[_0xa118('0x5f')][_0xa118('0x5f')]=_0x1000ec[_0xa118('0x5f')][_0xa118('0x9f')];_0x363a94[_0xa118('0x5f')][_0xa118('0xa0')]=_0x1000ec['body']['MessageSid'];}if(_0x363a94[_0xa118('0x8d')]&&_0x363a94[_0xa118('0x8d')][_0xa118('0x45')]===_0xa118('0x8e')){_0x363a94['body'][_0xa118('0x9b')]=_0x1000ec[_0xa118('0x5f')][_0xa118('0xa1')][0x0][_0xa118('0x9b')];_0x363a94[_0xa118('0x5f')][_0xa118('0x5f')]=_0x1000ec[_0xa118('0x5f')][_0xa118('0xa1')][0x0][_0xa118('0x2a')][_0xa118('0x5f')];_0x363a94[_0xa118('0x5f')]['messageId']=_0x1000ec[_0xa118('0x5f')][_0xa118('0xa1')][0x0][_0xa118('0x94')];}if(_0x363a94[_0xa118('0x5f')]['id']){delete _0x363a94[_0xa118('0x5f')]['id'];}if(_['isNil'](_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')])){throw new db[(_0xa118('0x97'))][(_0xa118('0xa2'))](_0xa118('0xa3'));}if(_['isNil'](_0x363a94[_0xa118('0x5f')][_0xa118('0x5f')])||_0x363a94['body']['body']===''){throw new db[(_0xa118('0x97'))][(_0xa118('0xa2'))](_0xa118('0xa4'));}if(_[_0xa118('0xa5')](_0x363a94['body'][_0xa118('0xa6')])){throw new db[(_0xa118('0x97'))][(_0xa118('0xa2'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xae511f);}if(!_[_0xa118('0xa7')](_0xae511f,_0x363a94[_0xa118('0x5f')][_0xa118('0xa6')])){throw new db[(_0xa118('0x97'))]['ValidationError'](_0xa118('0xa8')+_0xae511f);}_0x45fdd8[_0x363a94[_0xa118('0x5f')][_0xa118('0xa6')]]=_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')];return db[_0xa118('0xa9')]['find']({'where':{'id':_0x363a94['account'][_0xa118('0xaa')]},'include':[{'model':db[_0xa118('0xab')],'as':_0xa118('0xac'),'where':_0x45fdd8,'limit':0x1,'order':[[_0xa118('0x9a'),_0xa118('0xad')]]}]});})['then'](handleEntityNotFound(_0x4209ef,null))[_0xa118('0x22')](function(_0x95940){if(_0x95940){_0x363a94[_0xa118('0xae')]=_[_0xa118('0x76')](_0x95940,[_0xa118('0xac')]);if(_0x95940['Contacts'][_0xa118('0x4d')]){return _0x95940['Contacts'][0x0];}var _0x527d19=_[_0xa118('0x1b')](_0x363a94['body'],{'firstName':_0x363a94['body'][_0xa118('0x9b')],'ListId':_0x95940['id']});_0x527d19[_0x363a94[_0xa118('0x5f')][_0xa118('0xa6')]]=_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')];return db[_0xa118('0xab')]['create'](_0x527d19,{'fields':_0x95647d,'raw':!![]});}})[_0xa118('0x22')](handleEntityNotFound(_0x4209ef,null))['then'](function(_0x379fdf){if(_0x379fdf){_0x363a94[_0xa118('0xaf')]=_0x379fdf;var _0x4e0ce7={'ContactId':_0x379fdf['id'],'phone':_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')],'WhatsappAccountId':_0x1000ec['params']['id']};var _0x39871d={'ContactId':_0x379fdf['id'],'WhatsappAccountId':_0x1000ec[_0xa118('0x5b')]['id'],'closed':![]};return db[_0xa118('0xb0')][_0xa118('0x66')]({'where':_0x39871d})[_0xa118('0x22')](function(_0x53426f){if(_0x53426f){return[_0x53426f,![]];}return db[_0xa118('0xb0')]['create'](_0x4e0ce7)[_0xa118('0x22')](function(_0x14551c){return[_0x14551c,!![]];});});}})[_0xa118('0x77')](function(_0xae8a20,_0xd84932){_0x363a94[_0xa118('0xb1')]=_0xae8a20[_0xa118('0x61')]({'plain':!![]});_0x363a94[_0xa118('0xb1')][_0xa118('0xb2')]=![];if(_0xd84932){if(_0x363a94[_0xa118('0x8d')]['autoclose']){_0x363a94['applications'][_0xa118('0xb3')]({'id':0x0,'priority':_0x363a94[_0xa118('0x95')]['length']+0x1,'app':_0xa118('0xb4'),'appdata':_0xa118('0xb5'),'interval':_0xa118('0xb6')});}_0x363a94[_0xa118('0xb1')][_0xa118('0xb2')]=!![];}return db['WhatsappMessage'][_0xa118('0x5e')]({'phone':_0x363a94[_0xa118('0x5f')][_0xa118('0x9b')],'messageId':_0x363a94[_0xa118('0x5f')][_0xa118('0xa0')],'body':_0x363a94[_0xa118('0x5f')][_0xa118('0x5f')],'WhatsappAccountId':_0x1000ec['params']['id'],'WhatsappInteractionId':_0xae8a20['id'],'direction':'in','ContactId':_0xae8a20[_0xa118('0xb7')],'AttachmentId':_0x363a94['body'][_0xa118('0xb8')]});})[_0xa118('0x22')](function(_0xeaa8eb){_0x363a94[_0xa118('0x2a')]=_0xeaa8eb;if(_0x363a94[_0xa118('0xb1')][_0xa118('0xb9')]){return db['User'][_0xa118('0x66')]({'attributes':['id','name'],'where':{'id':_0x363a94[_0xa118('0xb1')][_0xa118('0xb9')]}})['then'](function(_0x16ff88){if(_0x16ff88){_0x363a94[_0xa118('0x95')][_0xa118('0xba')]({'id':0x0,'priority':0x0,'app':_0xa118('0xbb'),'appdata':_0x16ff88[_0xa118('0x3e')]+','+(_0x363a94[_0xa118('0x8d')][_0xa118('0xbc')]||0xa),'interval':_0xa118('0xb6')});}return respondWithRpcPromise(_0xa118('0xbd'),_0xa118('0xbe'),_0x363a94);});}return respondWithRpcPromise(_0xa118('0xbd'),'startRouting',_0x363a94);})[_0xa118('0x22')](function(_0x18d4cb){if(_0x18d4cb){var _0x5b5474=0xc8;var _0x5578c7=_0xa118('0xbf');logger['info'](_0xa118('0x26'),_0x5578c7,_0x5b5474,_0xa118('0xc0'));logger[_0xa118('0x25')](_0xa118('0xc1'),_0x5578c7,_0x5b5474,_0xa118('0xc0'),JSON['stringify'](_0x18d4cb));if(_0x363a94[_0xa118('0x8d')]['type']===_0xa118('0xc2')){return _0x4209ef['status'](_0x5b5474)[_0xa118('0x32')](_0xa118('0xc3'),'text/xml')['send'](_0xa118('0xc4'));}else{return _0x4209ef[_0xa118('0x2e')](_0x5b5474)['json'](_0x18d4cb);}}});})[_0xa118('0x2c')](handleError(_0x4209ef,null));};exports[_0xa118('0x3f')]=function(_0x3291c4,_0x1fe21d,_0x5025fd){var _0x4211bd,_0x777db,_0x2f1eba;if(_[_0xa118('0xa5')](_0x3291c4[_0xa118('0x5f')]['body'])||_0x3291c4['body'][_0xa118('0x5f')]===''){throw new db[(_0xa118('0x97'))][(_0xa118('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa118('0xa5')](_0x3291c4[_0xa118('0x5f')]['to'])){throw new db[(_0xa118('0x97'))][(_0xa118('0xa2'))](_0xa118('0xc5'));}_0x4211bd=_0x3291c4[_0xa118('0x5f')]['to'];return db['WhatsappAccount'][_0xa118('0x66')]({'where':{'id':_0x3291c4['params']['id']},'include':[{'model':db[_0xa118('0xa9')],'as':'List','include':[{'model':db[_0xa118('0xab')],'as':_0xa118('0xac'),'where':{'mobile':_0x4211bd},'limit':0x1,'order':[[_0xa118('0x9a'),'DESC']]}]}]})[_0xa118('0x22')](handleEntityNotFound(_0x1fe21d,null))[_0xa118('0x22')](function(_0x1e09e5){if(_0x1e09e5&&_0x1e09e5['List']){_0x777db=_0x1e09e5[_0xa118('0x61')]({'plain':!![]});if(_0x777db[_0xa118('0xc6')]&&_0x777db[_0xa118('0xc6')]['Contacts'][_0xa118('0x4d')]){return _0x777db['List'][_0xa118('0xac')][0x0];}return db['CmContact']['create'](_[_0xa118('0x1b')](_0x3291c4[_0xa118('0x5f')],{'firstName':_0x4211bd,'mobile':_0x4211bd,'phone':_0x4211bd,'ListId':_0x777db[_0xa118('0xaa')]}));}})[_0xa118('0x22')](handleEntityNotFound(_0x1fe21d,null))['then'](function(_0x8ec348){if(_0x8ec348){_0x2f1eba=_0x8ec348;return db[_0xa118('0xb0')][_0xa118('0x66')]({'where':{'ContactId':_0x2f1eba['id'],'closed':![],'WhatsappAccountId':_0x777db['id']}})[_0xa118('0x22')](function(_0x5d0a65){if(_0x5d0a65){return[_0x5d0a65,![]];}return db[_0xa118('0xb0')]['create']({'UserId':_0x3291c4[_0xa118('0x60')]['id'],'ContactId':_0x2f1eba['id'],'WhatsappAccountId':_0x777db['id'],'phone':_0x4211bd,'firstMsgDirection':_0xa118('0xc7'),'Messages':[_['merge'](_0x3291c4[_0xa118('0x5f')],{'read':![],'body':_0x3291c4[_0xa118('0x5f')][_0xa118('0x5f')],'phone':_0x4211bd,'WhatsappAccountId':_0x777db['id'],'UserId':_0x3291c4['user']['id'],'ContactId':_0x2f1eba['id']})]},{'include':[{'model':db[_0xa118('0x92')],'as':_0xa118('0xc8')}]})[_0xa118('0x22')](function(_0x26c803){return[_0x26c803,!![]];});});}})['spread'](function(_0x4a2488,_0x1607eb){if(_0x1607eb){return _0x4a2488;}return db[_0xa118('0x92')][_0xa118('0x5e')](_['merge'](_0x3291c4[_0xa118('0x5f')],{'read':![],'body':_0x3291c4[_0xa118('0x5f')]['body'],'phone':_0x4211bd,'WhatsappAccountId':_0x777db['id'],'WhatsappInteractionId':_0x4a2488['id'],'UserId':_0x3291c4[_0xa118('0x60')]['id'],'ContactId':_0x2f1eba['id']}))[_0xa118('0x22')](function(_0x2ff33f){_0x4a2488[_0xa118('0xc9')][_0xa118('0xc8')]=[];_0x4a2488[_0xa118('0xc9')][_0xa118('0xc8')][_0xa118('0xb3')](_0x2ff33f['dataValues']);return _0x4a2488;});})[_0xa118('0x22')](respondWithResult(_0x1fe21d,null))[_0xa118('0x2c')](handleError(_0x1fe21d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 1259204..8c870e0 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 _0x6e5f=['hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x6e5f,0x16a));var _0xf6e5=function(_0x4a1b4f,_0x453d83){_0x4a1b4f=_0x4a1b4f-0x0;var _0x525276=_0x6e5f[_0x4a1b4f];return _0x525276;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf6e5('0x0'))['db'][_0xf6e5('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf6e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6e5('0x3'),'afterDestroy':_0xf6e5('0x4')};function emitEvent(_0x41ac72){return function(_0x3f2d83,_0x9deb80,_0x11dfef){WhatsappAccountEvents[_0xf6e5('0x5')](_0x41ac72+':'+_0x3f2d83['id'],_0x3f2d83);WhatsappAccountEvents[_0xf6e5('0x5')](_0x41ac72,_0x3f2d83);_0x11dfef(null);};}for(var e in events){if(events[_0xf6e5('0x6')](e)){var event=events[e];WhatsappAccount[_0xf6e5('0x7')](e,emitEvent(event));}}module[_0xf6e5('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x1d20=['hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1ffffb,_0x3fe3b6){var _0x3a0462=function(_0x1748ef){while(--_0x1748ef){_0x1ffffb['push'](_0x1ffffb['shift']());}};_0x3a0462(++_0x3fe3b6);}(_0x1d20,0xb6));var _0x01d2=function(_0x28a28d,_0x577d43){_0x28a28d=_0x28a28d-0x0;var _0x477ad5=_0x1d20[_0x28a28d];return _0x477ad5;};'use strict';var EventEmitter=require(_0x01d2('0x0'));var WhatsappAccount=require(_0x01d2('0x1'))['db'][_0x01d2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x01d2('0x3')](0x0);var events={'afterCreate':_0x01d2('0x4'),'afterUpdate':'update','afterDestroy':_0x01d2('0x5')};function emitEvent(_0x1c9082){return function(_0x4ffdca,_0xf3db02,_0x266384){WhatsappAccountEvents[_0x01d2('0x6')](_0x1c9082+':'+_0x4ffdca['id'],_0x4ffdca);WhatsappAccountEvents['emit'](_0x1c9082,_0x4ffdca);_0x266384(null);};}for(var e in events){if(events[_0x01d2('0x7')](e)){var event=events[e];WhatsappAccount[_0x01d2('0x8')](e,emitEvent(event));}}module[_0x01d2('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 50836f2..497b9d7 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 _0x2c55=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','lodash','util'];(function(_0x2488e2,_0x401e50){var _0x618395=function(_0x556fb5){while(--_0x556fb5){_0x2488e2['push'](_0x2488e2['shift']());}};_0x618395(++_0x401e50);}(_0x2c55,0x172));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c5('0x0'));var util=require(_0x52c5('0x1'));var logger=require('../../config/logger')(_0x52c5('0x2'));var moment=require(_0x52c5('0x3'));var BPromise=require(_0x52c5('0x4'));var rp=require(_0x52c5('0x5'));var fs=require('fs');var path=require(_0x52c5('0x6'));var rimraf=require(_0x52c5('0x7'));var config=require(_0x52c5('0x8'));var attributes=require(_0x52c5('0x9'));module[_0x52c5('0xa')]=function(_0x2e98e3,_0x21fb3d){return _0x2e98e3['define'](_0x52c5('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb191=['WhatsappAccount','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x188cfe,_0x1037ed){var _0x2f79c1=function(_0x1b916d){while(--_0x1b916d){_0x188cfe['push'](_0x188cfe['shift']());}};_0x2f79c1(++_0x1037ed);}(_0xb191,0x177));var _0x1b19=function(_0x2046a2,_0x18b1d9){_0x2046a2=_0x2046a2-0x0;var _0x36d7c9=_0xb191[_0x2046a2];return _0x36d7c9;};'use strict';var _=require(_0x1b19('0x0'));var util=require('util');var logger=require(_0x1b19('0x1'))('api');var moment=require(_0x1b19('0x2'));var BPromise=require(_0x1b19('0x3'));var rp=require(_0x1b19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b19('0x5'));var config=require(_0x1b19('0x6'));var attributes=require(_0x1b19('0x7'));module[_0x1b19('0x8')]=function(_0x5c6322,_0x6847c6){return _0x5c6322[_0x1b19('0x9')](_0x1b19('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 386d41b..707e0c3 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 _0xe884=['WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount'];(function(_0x3e4db1,_0x385cd6){var _0x33ecd5=function(_0x1213ad){while(--_0x1213ad){_0x3e4db1['push'](_0x3e4db1['shift']());}};_0x33ecd5(++_0x385cd6);}(_0xe884,0x1d3));var _0x4e88=function(_0x172cb9,_0x370a1a){_0x172cb9=_0x172cb9-0x0;var _0x2ac8a1=_0xe884[_0x172cb9];return _0x2ac8a1;};'use strict';var _=require(_0x4e88('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4e88('0x1'));var rs=require(_0x4e88('0x2'));var fs=require('fs');var Redis=require(_0x4e88('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e88('0x4'));var logger=require(_0x4e88('0x5'))(_0x4e88('0x6'));var config=require(_0x4e88('0x7'));var jayson=require(_0x4e88('0x8'));var client=jayson[_0x4e88('0x9')][_0x4e88('0xa')]({'port':0x232a});config['redis']=_[_0x4e88('0xb')](config[_0x4e88('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e88('0xd'))(new Redis(config[_0x4e88('0xc')]));require(_0x4e88('0xe'))['register'](socket);function respondWithRpcPromise(_0x2a30df,_0x4aaf57,_0x577727){return new BPromise(function(_0x517b41,_0x1fc5fc){return client[_0x4e88('0xf')](_0x2a30df,_0x577727)['then'](function(_0x50dca8){logger[_0x4e88('0x10')](_0x4e88('0x11'),_0x4aaf57,_0x4e88('0x12'));logger[_0x4e88('0x13')](_0x4e88('0x14'),_0x4aaf57,_0x4e88('0x12'),JSON['stringify'](_0x50dca8));if(_0x50dca8[_0x4e88('0x15')]){if(_0x50dca8['error'][_0x4e88('0x16')]===0x1f4){logger[_0x4e88('0x15')](_0x4e88('0x11'),_0x4aaf57,_0x50dca8[_0x4e88('0x15')][_0x4e88('0x17')]);return _0x1fc5fc(_0x50dca8[_0x4e88('0x15')][_0x4e88('0x17')]);}logger[_0x4e88('0x15')](_0x4e88('0x11'),_0x4aaf57,_0x50dca8['error']['message']);return _0x517b41(_0x50dca8[_0x4e88('0x15')]['message']);}else{logger[_0x4e88('0x10')](_0x4e88('0x11'),_0x4aaf57,'request\x20sent');_0x517b41(_0x50dca8[_0x4e88('0x18')][_0x4e88('0x17')]);}})[_0x4e88('0x19')](function(_0x333023){logger[_0x4e88('0x15')](_0x4e88('0x11'),_0x4aaf57,_0x333023);_0x1fc5fc(_0x333023);});});}exports[_0x4e88('0x1a')]=function(_0x292e3f){var _0x53b4ed=this;return new Promise(function(_0x33f816,_0x17b334){return db[_0x4e88('0x1b')][_0x4e88('0x1c')]({'raw':_0x292e3f[_0x4e88('0x1d')]?_0x292e3f[_0x4e88('0x1d')][_0x4e88('0x1e')]===undefined?!![]:![]:!![],'where':_0x292e3f[_0x4e88('0x1d')]?_0x292e3f[_0x4e88('0x1d')][_0x4e88('0x1f')]||null:null,'attributes':_0x292e3f[_0x4e88('0x1d')]?_0x292e3f['options'][_0x4e88('0x20')]||null:null,'include':_0x292e3f['options']?_0x292e3f['options'][_0x4e88('0x21')]?_[_0x4e88('0x22')](_0x292e3f['options'][_0x4e88('0x21')],function(_0x7467a6){return{'model':db[_0x7467a6[_0x4e88('0x23')]],'as':_0x7467a6['as'],'attributes':_0x7467a6[_0x4e88('0x20')],'include':_0x7467a6[_0x4e88('0x21')]?_['map'](_0x7467a6[_0x4e88('0x21')],function(_0x105771){return{'model':db[_0x105771[_0x4e88('0x23')]],'as':_0x105771['as'],'attributes':_0x105771['attributes'],'include':_0x105771[_0x4e88('0x21')]?_[_0x4e88('0x22')](_0x105771[_0x4e88('0x21')],function(_0x33c885){return{'model':db[_0x33c885[_0x4e88('0x23')]],'as':_0x33c885['as'],'attributes':_0x33c885['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e88('0x24')](function(_0x9dc1d1){logger[_0x4e88('0x10')](_0x4e88('0x1a'),_0x292e3f);logger[_0x4e88('0x13')](_0x4e88('0x1a'),_0x292e3f,JSON[_0x4e88('0x25')](_0x9dc1d1));_0x33f816(_0x9dc1d1);})[_0x4e88('0x19')](function(_0x5e35a7){logger['error'](_0x4e88('0x1a'),_0x5e35a7[_0x4e88('0x17')],_0x292e3f);_0x17b334(_0x53b4ed[_0x4e88('0x15')](0x1f4,_0x5e35a7[_0x4e88('0x17')]));});});}; \ No newline at end of file +var _0x4be5=['raw','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x23d7ca,_0x25fa63){var _0x1f0071=function(_0x57d0f7){while(--_0x57d0f7){_0x23d7ca['push'](_0x23d7ca['shift']());}};_0x1f0071(++_0x25fa63);}(_0x4be5,0x192));var _0x54be=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x4be5[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x54be('0x0'));var util=require(_0x54be('0x1'));var moment=require(_0x54be('0x2'));var BPromise=require(_0x54be('0x3'));var rs=require(_0x54be('0x4'));var fs=require('fs');var Redis=require(_0x54be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x54be('0x6'));var logger=require('../../config/logger')(_0x54be('0x7'));var config=require(_0x54be('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x54be('0x9')][_0x54be('0xa')]({'port':0x232a});config[_0x54be('0xb')]=_['defaults'](config[_0x54be('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x54be('0xc'))[_0x54be('0xd')](socket);function respondWithRpcPromise(_0x4d8a7d,_0x3a3e25,_0x190060){return new BPromise(function(_0x3943bd,_0x168abc){return client['request'](_0x4d8a7d,_0x190060)[_0x54be('0xe')](function(_0x112f67){logger[_0x54be('0xf')](_0x54be('0x10'),_0x3a3e25,_0x54be('0x11'));logger['debug'](_0x54be('0x12'),_0x3a3e25,'request\x20sent',JSON[_0x54be('0x13')](_0x112f67));if(_0x112f67[_0x54be('0x14')]){if(_0x112f67[_0x54be('0x14')]['code']===0x1f4){logger['error'](_0x54be('0x10'),_0x3a3e25,_0x112f67[_0x54be('0x14')][_0x54be('0x15')]);return _0x168abc(_0x112f67[_0x54be('0x14')][_0x54be('0x15')]);}logger[_0x54be('0x14')](_0x54be('0x10'),_0x3a3e25,_0x112f67['error'][_0x54be('0x15')]);return _0x3943bd(_0x112f67[_0x54be('0x14')]['message']);}else{logger[_0x54be('0xf')](_0x54be('0x10'),_0x3a3e25,_0x54be('0x11'));_0x3943bd(_0x112f67['result'][_0x54be('0x15')]);}})[_0x54be('0x16')](function(_0x49c71f){logger[_0x54be('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x3a3e25,_0x49c71f);_0x168abc(_0x49c71f);});});}exports[_0x54be('0x17')]=function(_0x295e53){var _0x1429a6=this;return new Promise(function(_0x4b707e,_0x52dd3d){return db[_0x54be('0x18')][_0x54be('0x19')]({'raw':_0x295e53[_0x54be('0x1a')]?_0x295e53[_0x54be('0x1a')][_0x54be('0x1b')]===undefined?!![]:![]:!![],'where':_0x295e53[_0x54be('0x1a')]?_0x295e53['options']['where']||null:null,'attributes':_0x295e53[_0x54be('0x1a')]?_0x295e53['options'][_0x54be('0x1c')]||null:null,'include':_0x295e53['options']?_0x295e53['options'][_0x54be('0x1d')]?_['map'](_0x295e53['options'][_0x54be('0x1d')],function(_0x287683){return{'model':db[_0x287683['model']],'as':_0x287683['as'],'attributes':_0x287683['attributes'],'include':_0x287683[_0x54be('0x1d')]?_[_0x54be('0x1e')](_0x287683[_0x54be('0x1d')],function(_0x4e7f4a){return{'model':db[_0x4e7f4a[_0x54be('0x1f')]],'as':_0x4e7f4a['as'],'attributes':_0x4e7f4a['attributes'],'include':_0x4e7f4a[_0x54be('0x1d')]?_[_0x54be('0x1e')](_0x4e7f4a['include'],function(_0x514603){return{'model':db[_0x514603[_0x54be('0x1f')]],'as':_0x514603['as'],'attributes':_0x514603[_0x54be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x54be('0xe')](function(_0x1cdc90){logger[_0x54be('0xf')]('ShowWhatsappAccount',_0x295e53);logger[_0x54be('0x20')](_0x54be('0x17'),_0x295e53,JSON[_0x54be('0x13')](_0x1cdc90));_0x4b707e(_0x1cdc90);})['catch'](function(_0x15cc2d){logger['error'](_0x54be('0x17'),_0x15cc2d['message'],_0x295e53);_0x52dd3d(_0x1429a6['error'](0x1f4,_0x15cc2d[_0x54be('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 30a1b7f..a2024cb 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 _0xccaa=['update','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x418e05,_0x5ea633){var _0x6881f1=function(_0x3f00fb){while(--_0x3f00fb){_0x418e05['push'](_0x418e05['shift']());}};_0x6881f1(++_0x5ea633);}(_0xccaa,0x123));var _0xacca=function(_0xe2b8fc,_0x3ec76a){_0xe2b8fc=_0xe2b8fc-0x0;var _0x1bfefb=_0xccaa[_0xe2b8fc];return _0x1bfefb;};'use strict';var WhatsappAccountEvents=require(_0xacca('0x0'));var events=[_0xacca('0x1'),_0xacca('0x2'),_0xacca('0x3')];function createListener(_0x16c7c9,_0x327c35){return function(_0xffa67c){_0x327c35['emit'](_0x16c7c9,_0xffa67c);};}function removeListener(_0x4202b3,_0x2ff6b0){return function(){WhatsappAccountEvents['removeListener'](_0x4202b3,_0x2ff6b0);};}exports[_0xacca('0x4')]=function(_0x425c5){for(var _0x4f8bad=0x0,_0x36577e=events[_0xacca('0x5')];_0x4f8bad<_0x36577e;_0x4f8bad++){var _0x19d44c=events[_0x4f8bad];var _0x33053a=createListener(_0xacca('0x6')+_0x19d44c,_0x425c5);WhatsappAccountEvents['on'](_0x19d44c,_0x33053a);}}; \ No newline at end of file +var _0x341e=['update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x57a007,_0x5940fa){var _0x35f4c3=function(_0xfe9328){while(--_0xfe9328){_0x57a007['push'](_0x57a007['shift']());}};_0x35f4c3(++_0x5940fa);}(_0x341e,0x7c));var _0xe341=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x341e[_0x59ee6f];return _0x4c0979;};'use strict';var WhatsappAccountEvents=require(_0xe341('0x0'));var events=[_0xe341('0x1'),'remove',_0xe341('0x2')];function createListener(_0x136e16,_0x3f7c6a){return function(_0x294b6f){_0x3f7c6a['emit'](_0x136e16,_0x294b6f);};}function removeListener(_0x147682,_0x5dc641){return function(){WhatsappAccountEvents[_0xe341('0x3')](_0x147682,_0x5dc641);};}exports[_0xe341('0x4')]=function(_0xe593cb){for(var _0x2803b1=0x0,_0x53b055=events[_0xe341('0x5')];_0x2803b1<_0x53b055;_0x2803b1++){var _0x1b96ff=events[_0x2803b1];var _0x147cbf=createListener(_0xe341('0x6')+_0x1b96ff,_0xe593cb);WhatsappAccountEvents['on'](_0x1b96ff,_0x147cbf);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 3ff0f46..2a25509 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 _0x1272=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x17e2e7,_0xe9e1d0){var _0x2ed751=function(_0x4292a4){while(--_0x4292a4){_0x17e2e7['push'](_0x17e2e7['shift']());}};_0x2ed751(++_0xe9e1d0);}(_0x1272,0x175));var _0x2127=function(_0x30a2d6,_0x43201d){_0x30a2d6=_0x30a2d6-0x0;var _0x10bff2=_0x1272[_0x30a2d6];return _0x10bff2;};'use strict';var multer=require(_0x2127('0x0'));var util=require(_0x2127('0x1'));var path=require(_0x2127('0x2'));var timeout=require('connect-timeout');var express=require(_0x2127('0x3'));var router=express[_0x2127('0x4')]();var fs_extra=require(_0x2127('0x5'));var auth=require(_0x2127('0x6'));var interaction=require(_0x2127('0x7'));var config=require(_0x2127('0x8'));var controller=require(_0x2127('0x9'));router[_0x2127('0xa')]('/',auth[_0x2127('0xb')](),controller['index']);router[_0x2127('0xa')](_0x2127('0xc'),auth[_0x2127('0xb')](),controller[_0x2127('0xd')]);router[_0x2127('0xe')]('/',auth[_0x2127('0xb')](),controller[_0x2127('0xf')]);router[_0x2127('0x10')](_0x2127('0xc'),auth[_0x2127('0xb')](),controller[_0x2127('0x11')]);router[_0x2127('0x12')](_0x2127('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2127('0x13')]=router; \ No newline at end of file +var _0x478c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x478c,0xc4));var _0xc478=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x478c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc478('0x0'));var util=require(_0xc478('0x1'));var path=require(_0xc478('0x2'));var timeout=require(_0xc478('0x3'));var express=require(_0xc478('0x4'));var router=express[_0xc478('0x5')]();var fs_extra=require(_0xc478('0x6'));var auth=require(_0xc478('0x7'));var interaction=require(_0xc478('0x8'));var config=require(_0xc478('0x9'));var controller=require(_0xc478('0xa'));router['get']('/',auth[_0xc478('0xb')](),controller[_0xc478('0xc')]);router[_0xc478('0xd')](_0xc478('0xe'),auth[_0xc478('0xb')](),controller[_0xc478('0xf')]);router[_0xc478('0x10')]('/',auth[_0xc478('0xb')](),controller[_0xc478('0x11')]);router['put'](_0xc478('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc478('0x12')]('/:id',auth[_0xc478('0xb')](),controller['destroy']);module[_0xc478('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ae9be11..7418f09 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 _0x71a1=['STRING','*,*,*,*','exports','INTEGER','noop','TEXT'];(function(_0x2dd73c,_0x4b7af0){var _0x23d255=function(_0x353686){while(--_0x353686){_0x2dd73c['push'](_0x2dd73c['shift']());}};_0x23d255(++_0x4b7af0);}(_0x71a1,0xfe));var _0x171a=function(_0x4b20be,_0x131d9d){_0x4b20be=_0x4b20be-0x0;var _0x1402ce=_0x71a1[_0x4b20be];return _0x1402ce;};'use strict';var Sequelize=require('sequelize');module[_0x171a('0x0')]={'priority':{'type':Sequelize[_0x171a('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x171a('0x2')},'appdata':{'type':Sequelize[_0x171a('0x3')]()},'description':{'type':Sequelize[_0x171a('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x171a('0x5')}}; \ No newline at end of file +var _0x40b6=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5dcff6,_0x4a8796){var _0x2699cd=function(_0x36a328){while(--_0x36a328){_0x5dcff6['push'](_0x5dcff6['shift']());}};_0x2699cd(++_0x4a8796);}(_0x40b6,0x15a));var _0x640b=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x40b6[_0x32b30c];return _0xcfc212;};'use strict';var Sequelize=require(_0x640b('0x0'));module[_0x640b('0x1')]={'priority':{'type':Sequelize[_0x640b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x640b('0x3')],'allowNull':![],'defaultValue':_0x640b('0x4')},'appdata':{'type':Sequelize[_0x640b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x640b('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 1ff8668..3646e4a 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 _0x7880=['undefined','status','set','Content-Range','apply','reject','save','then','stack','send','index','WhatsappApplication','rawAttributes','fieldName','key','map','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','show','params','keys','length','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit'];(function(_0x45dc53,_0x488b89){var _0x4a510e=function(_0x1692f5){while(--_0x1692f5){_0x45dc53['push'](_0x45dc53['shift']());}};_0x4a510e(++_0x488b89);}(_0x7880,0x10f));var _0x0788=function(_0x20b1ca,_0xcaa99b){_0x20b1ca=_0x20b1ca-0x0;var _0x13a457=_0x7880[_0x20b1ca];return _0x13a457;};'use strict';var emlformat=require(_0x0788('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0788('0x6'));var sox=require('sox');var csv=require(_0x0788('0x7'));var ejs=require(_0x0788('0x8'));var fs=require('fs');var fs_extra=require(_0x0788('0x9'));var _=require('lodash');var squel=require(_0x0788('0xa'));var crypto=require(_0x0788('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0788('0xc'));var toCsv=require(_0x0788('0x7'));var querystring=require(_0x0788('0xd'));var Papa=require(_0x0788('0xe'));var Redis=require(_0x0788('0xf'));var authService=require(_0x0788('0x10'));var qs=require(_0x0788('0x11'));var as=require(_0x0788('0x12'));var hardwareService=require(_0x0788('0x13'));var logger=require(_0x0788('0x14'))(_0x0788('0x15'));var utils=require('../../config/utils');var config=require(_0x0788('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0788('0x17'))['db'];function respondWithStatusCode(_0x9d3024,_0x107260){_0x107260=_0x107260||0xcc;return function(_0x3e4863){if(_0x3e4863){return _0x9d3024[_0x0788('0x18')](_0x107260);}return _0x9d3024['status'](_0x107260)[_0x0788('0x19')]();};}function respondWithResult(_0x4b379e,_0x3efcc8){_0x3efcc8=_0x3efcc8||0xc8;return function(_0x59b405){if(_0x59b405){return _0x4b379e['status'](_0x3efcc8)[_0x0788('0x1a')](_0x59b405);}};}function respondWithFilteredResult(_0x8a7e08,_0x32eae1){return function(_0x57a803){if(_0x57a803){var _0x12553c=typeof _0x32eae1[_0x0788('0x1b')]==='undefined'&&typeof _0x32eae1[_0x0788('0x1c')]===_0x0788('0x1d');var _0x22b713=_0x57a803['count'];var _0x5e9ea6=_0x12553c?0x0:_0x32eae1[_0x0788('0x1b')];var _0xf82fbc=_0x12553c?_0x57a803['count']:_0x32eae1[_0x0788('0x1b')]+_0x32eae1[_0x0788('0x1c')];var _0x44be88;if(_0xf82fbc>=_0x22b713){_0xf82fbc=_0x22b713;_0x44be88=0xc8;}else{_0x44be88=0xce;}_0x8a7e08[_0x0788('0x1e')](_0x44be88);return _0x8a7e08[_0x0788('0x1f')](_0x0788('0x20'),_0x5e9ea6+'-'+_0xf82fbc+'/'+_0x22b713)[_0x0788('0x1a')](_0x57a803);}return null;};}function patchUpdates(_0x3e383b){return function(_0x494a02){try{jsonpatch[_0x0788('0x21')](_0x494a02,_0x3e383b,!![]);}catch(_0x45097b){return BPromise[_0x0788('0x22')](_0x45097b);}return _0x494a02[_0x0788('0x23')]();};}function saveUpdates(_0x2444fc,_0x467856){return function(_0x291844){if(_0x291844){return _0x291844['update'](_0x2444fc)[_0x0788('0x24')](function(_0x1b373d){return _0x1b373d;});}return null;};}function removeEntity(_0x2525f7,_0xefb51d){return function(_0x5e27a5){if(_0x5e27a5){return _0x5e27a5['destroy']()[_0x0788('0x24')](function(){_0x2525f7[_0x0788('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xac4f64,_0x107b1b){return function(_0x4b99fa){if(!_0x4b99fa){_0xac4f64[_0x0788('0x18')](0x194);}return _0x4b99fa;};}function handleError(_0x2e7874,_0x31fc1d){_0x31fc1d=_0x31fc1d||0x1f4;return function(_0x20da9f){logger['error'](_0x20da9f[_0x0788('0x25')]);if(_0x20da9f['name']){delete _0x20da9f['name'];}_0x2e7874[_0x0788('0x1e')](_0x31fc1d)[_0x0788('0x26')](_0x20da9f);};}exports[_0x0788('0x27')]=function(_0x3aebad,_0x593980){var _0x54878c={},_0x5b3352={},_0x11d0bf={'count':0x0,'rows':[]};var _0x7d76a9=_['map'](db[_0x0788('0x28')][_0x0788('0x29')],function(_0x519fd4){return{'name':_0x519fd4[_0x0788('0x2a')],'type':_0x519fd4['type'][_0x0788('0x2b')]};});_0x5b3352['model']=_[_0x0788('0x2c')](_0x7d76a9,_0x0788('0x2d'));_0x5b3352[_0x0788('0x2e')]=_['keys'](_0x3aebad['query']);_0x5b3352[_0x0788('0x2f')]=_[_0x0788('0x30')](_0x5b3352[_0x0788('0x31')],_0x5b3352['query']);_0x54878c[_0x0788('0x32')]=_['intersection'](_0x5b3352[_0x0788('0x31')],qs[_0x0788('0x33')](_0x3aebad[_0x0788('0x2e')][_0x0788('0x33')]));_0x54878c[_0x0788('0x32')]=_0x54878c[_0x0788('0x32')]['length']?_0x54878c[_0x0788('0x32')]:_0x5b3352[_0x0788('0x31')];if(!_0x3aebad[_0x0788('0x2e')][_0x0788('0x34')](_0x0788('0x35'))){_0x54878c[_0x0788('0x1c')]=qs[_0x0788('0x1c')](_0x3aebad[_0x0788('0x2e')][_0x0788('0x1c')]);_0x54878c[_0x0788('0x1b')]=qs[_0x0788('0x1b')](_0x3aebad['query'][_0x0788('0x1b')]);}_0x54878c[_0x0788('0x36')]=qs[_0x0788('0x37')](_0x3aebad[_0x0788('0x2e')][_0x0788('0x37')]);_0x54878c[_0x0788('0x38')]=qs['filters'](_[_0x0788('0x39')](_0x3aebad['query'],_0x5b3352[_0x0788('0x2f')]),_0x7d76a9);if(_0x3aebad[_0x0788('0x2e')][_0x0788('0x3a')]){_0x54878c['where']=_[_0x0788('0x3b')](_0x54878c[_0x0788('0x38')],{'$or':_['map'](_0x7d76a9,function(_0x14a056){if(_0x14a056[_0x0788('0x3c')]!==_0x0788('0x3d')){var _0x16a56b={};_0x16a56b[_0x14a056[_0x0788('0x2d')]]={'$like':'%'+_0x3aebad[_0x0788('0x2e')][_0x0788('0x3a')]+'%'};return _0x16a56b;}})});}_0x54878c=_[_0x0788('0x3b')]({},_0x54878c,_0x3aebad['options']);var _0x350125={'where':_0x54878c[_0x0788('0x38')]};return db[_0x0788('0x28')][_0x0788('0x3e')](_0x350125)['then'](function(_0x3fb49e){_0x11d0bf[_0x0788('0x3e')]=_0x3fb49e;if(_0x3aebad[_0x0788('0x2e')][_0x0788('0x3f')]){_0x54878c[_0x0788('0x40')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x0788('0x41')](_0x54878c);})['then'](function(_0x45f948){_0x11d0bf['rows']=_0x45f948;return _0x11d0bf;})['then'](respondWithFilteredResult(_0x593980,_0x54878c))['catch'](handleError(_0x593980,null));};exports[_0x0788('0x42')]=function(_0x245a3c,_0x3e16a0){var _0x463b62={'raw':!![],'where':{'id':_0x245a3c[_0x0788('0x43')]['id']}},_0x136e74={};_0x136e74[_0x0788('0x31')]=_[_0x0788('0x44')](db[_0x0788('0x28')][_0x0788('0x29')]);_0x136e74[_0x0788('0x2e')]=_[_0x0788('0x44')](_0x245a3c[_0x0788('0x2e')]);_0x136e74[_0x0788('0x2f')]=_[_0x0788('0x30')](_0x136e74[_0x0788('0x31')],_0x136e74[_0x0788('0x2e')]);_0x463b62[_0x0788('0x32')]=_[_0x0788('0x30')](_0x136e74[_0x0788('0x31')],qs[_0x0788('0x33')](_0x245a3c['query'][_0x0788('0x33')]));_0x463b62[_0x0788('0x32')]=_0x463b62[_0x0788('0x32')][_0x0788('0x45')]?_0x463b62['attributes']:_0x136e74['model'];if(_0x245a3c[_0x0788('0x2e')][_0x0788('0x3f')]){_0x463b62[_0x0788('0x40')]=[{'all':!![]}];}_0x463b62=_[_0x0788('0x3b')]({},_0x463b62,_0x245a3c[_0x0788('0x46')]);return db[_0x0788('0x28')][_0x0788('0x47')](_0x463b62)[_0x0788('0x24')](handleEntityNotFound(_0x3e16a0,null))['then'](respondWithResult(_0x3e16a0,null))[_0x0788('0x48')](handleError(_0x3e16a0,null));};exports[_0x0788('0x49')]=function(_0x31a409,_0x58ea4a){return db['WhatsappApplication'][_0x0788('0x49')](_0x31a409[_0x0788('0x4a')],{})[_0x0788('0x24')](respondWithResult(_0x58ea4a,0xc9))['catch'](handleError(_0x58ea4a,null));};exports['update']=function(_0x450903,_0x20506a){if(_0x450903[_0x0788('0x4a')]['id']){delete _0x450903[_0x0788('0x4a')]['id'];}return db[_0x0788('0x28')]['find']({'where':{'id':_0x450903[_0x0788('0x43')]['id']}})['then'](handleEntityNotFound(_0x20506a,null))[_0x0788('0x24')](saveUpdates(_0x450903[_0x0788('0x4a')],null))[_0x0788('0x24')](respondWithResult(_0x20506a,null))['catch'](handleError(_0x20506a,null));};exports['destroy']=function(_0x2731fd,_0xd5fa9e){return db['WhatsappApplication'][_0x0788('0x47')]({'where':{'id':_0x2731fd['params']['id']}})[_0x0788('0x24')](handleEntityNotFound(_0xd5fa9e,null))[_0x0788('0x24')](removeEntity(_0xd5fa9e,null))[_0x0788('0x48')](handleError(_0xd5fa9e,null));}; \ No newline at end of file +var _0x62f1=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','WhatsappApplication','includeAll','include','rows','show','params','keys','create','body','catch','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto'];(function(_0x2300ac,_0x5d375c){var _0x1c8b3c=function(_0x382f97){while(--_0x382f97){_0x2300ac['push'](_0x2300ac['shift']());}};_0x1c8b3c(++_0x5d375c);}(_0x62f1,0x112));var _0x162f=function(_0x28670c,_0x2a82b2){_0x28670c=_0x28670c-0x0;var _0x406828=_0x62f1[_0x28670c];return _0x406828;};'use strict';var emlformat=require(_0x162f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x162f('0x1'));var jsonpatch=require(_0x162f('0x2'));var rp=require(_0x162f('0x3'));var moment=require(_0x162f('0x4'));var BPromise=require(_0x162f('0x5'));var Mustache=require(_0x162f('0x6'));var util=require(_0x162f('0x7'));var path=require(_0x162f('0x8'));var sox=require(_0x162f('0x9'));var csv=require(_0x162f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x162f('0xb'));var _=require(_0x162f('0xc'));var squel=require('squel');var crypto=require(_0x162f('0xd'));var jsforce=require(_0x162f('0xe'));var deskjs=require(_0x162f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x162f('0x10'));var Papa=require(_0x162f('0x11'));var Redis=require(_0x162f('0x12'));var authService=require(_0x162f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x162f('0x14'));var hardwareService=require(_0x162f('0x15'));var logger=require(_0x162f('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x162f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6ae441,_0x361048){_0x361048=_0x361048||0xcc;return function(_0x4561d2){if(_0x4561d2){return _0x6ae441[_0x162f('0x18')](_0x361048);}return _0x6ae441['status'](_0x361048)[_0x162f('0x19')]();};}function respondWithResult(_0x2bf9f0,_0x3daa69){_0x3daa69=_0x3daa69||0xc8;return function(_0x130db8){if(_0x130db8){return _0x2bf9f0['status'](_0x3daa69)[_0x162f('0x1a')](_0x130db8);}};}function respondWithFilteredResult(_0x4e48e1,_0x250983){return function(_0x2d90ad){if(_0x2d90ad){var _0x40a284=typeof _0x250983[_0x162f('0x1b')]==='undefined'&&typeof _0x250983['limit']===_0x162f('0x1c');var _0xa03e71=_0x2d90ad[_0x162f('0x1d')];var _0x1ee433=_0x40a284?0x0:_0x250983[_0x162f('0x1b')];var _0x750506=_0x40a284?_0x2d90ad[_0x162f('0x1d')]:_0x250983['offset']+_0x250983[_0x162f('0x1e')];var _0x53ac47;if(_0x750506>=_0xa03e71){_0x750506=_0xa03e71;_0x53ac47=0xc8;}else{_0x53ac47=0xce;}_0x4e48e1[_0x162f('0x1f')](_0x53ac47);return _0x4e48e1[_0x162f('0x20')]('Content-Range',_0x1ee433+'-'+_0x750506+'/'+_0xa03e71)[_0x162f('0x1a')](_0x2d90ad);}return null;};}function patchUpdates(_0x236ef5){return function(_0x57796d){try{jsonpatch[_0x162f('0x21')](_0x57796d,_0x236ef5,!![]);}catch(_0x436a5a){return BPromise[_0x162f('0x22')](_0x436a5a);}return _0x57796d[_0x162f('0x23')]();};}function saveUpdates(_0x5dc1a7,_0xdab3e){return function(_0x246aff){if(_0x246aff){return _0x246aff[_0x162f('0x24')](_0x5dc1a7)[_0x162f('0x25')](function(_0x422241){return _0x422241;});}return null;};}function removeEntity(_0x1512b0,_0xbcbe11){return function(_0x331d0d){if(_0x331d0d){return _0x331d0d['destroy']()[_0x162f('0x25')](function(){_0x1512b0[_0x162f('0x1f')](0xcc)[_0x162f('0x19')]();});}};}function handleEntityNotFound(_0x16f5e2,_0x59482e){return function(_0x2fc293){if(!_0x2fc293){_0x16f5e2['sendStatus'](0x194);}return _0x2fc293;};}function handleError(_0x1e25d5,_0x54e4e1){_0x54e4e1=_0x54e4e1||0x1f4;return function(_0x2cd181){logger['error'](_0x2cd181[_0x162f('0x26')]);if(_0x2cd181['name']){delete _0x2cd181[_0x162f('0x27')];}_0x1e25d5[_0x162f('0x1f')](_0x54e4e1)[_0x162f('0x28')](_0x2cd181);};}exports['index']=function(_0x4bb880,_0x4c58ff){var _0x580e13={},_0x3f9247={},_0x1b0f5b={'count':0x0,'rows':[]};var _0x4c4049=_['map'](db['WhatsappApplication'][_0x162f('0x29')],function(_0x5089c7){return{'name':_0x5089c7[_0x162f('0x2a')],'type':_0x5089c7[_0x162f('0x2b')]['key']};});_0x3f9247['model']=_[_0x162f('0x2c')](_0x4c4049,_0x162f('0x27'));_0x3f9247[_0x162f('0x2d')]=_['keys'](_0x4bb880[_0x162f('0x2d')]);_0x3f9247[_0x162f('0x2e')]=_[_0x162f('0x2f')](_0x3f9247[_0x162f('0x30')],_0x3f9247['query']);_0x580e13['attributes']=_[_0x162f('0x2f')](_0x3f9247['model'],qs[_0x162f('0x31')](_0x4bb880['query']['fields']));_0x580e13['attributes']=_0x580e13['attributes'][_0x162f('0x32')]?_0x580e13[_0x162f('0x33')]:_0x3f9247[_0x162f('0x30')];if(!_0x4bb880['query'][_0x162f('0x34')](_0x162f('0x35'))){_0x580e13['limit']=qs[_0x162f('0x1e')](_0x4bb880[_0x162f('0x2d')][_0x162f('0x1e')]);_0x580e13['offset']=qs[_0x162f('0x1b')](_0x4bb880['query'][_0x162f('0x1b')]);}_0x580e13['order']=qs[_0x162f('0x36')](_0x4bb880['query'][_0x162f('0x36')]);_0x580e13[_0x162f('0x37')]=qs['filters'](_[_0x162f('0x38')](_0x4bb880['query'],_0x3f9247[_0x162f('0x2e')]),_0x4c4049);if(_0x4bb880[_0x162f('0x2d')]['filter']){_0x580e13[_0x162f('0x37')]=_['merge'](_0x580e13[_0x162f('0x37')],{'$or':_['map'](_0x4c4049,function(_0x5f4b3f){if(_0x5f4b3f[_0x162f('0x2b')]!==_0x162f('0x39')){var _0x4a328f={};_0x4a328f[_0x5f4b3f[_0x162f('0x27')]]={'$like':'%'+_0x4bb880['query']['filter']+'%'};return _0x4a328f;}})});}_0x580e13=_[_0x162f('0x3a')]({},_0x580e13,_0x4bb880[_0x162f('0x3b')]);var _0x59ca49={'where':_0x580e13[_0x162f('0x37')]};return db[_0x162f('0x3c')][_0x162f('0x1d')](_0x59ca49)[_0x162f('0x25')](function(_0x2fa18e){_0x1b0f5b['count']=_0x2fa18e;if(_0x4bb880[_0x162f('0x2d')][_0x162f('0x3d')]){_0x580e13[_0x162f('0x3e')]=[{'all':!![]}];}return db[_0x162f('0x3c')]['findAll'](_0x580e13);})[_0x162f('0x25')](function(_0x146daa){_0x1b0f5b[_0x162f('0x3f')]=_0x146daa;return _0x1b0f5b;})[_0x162f('0x25')](respondWithFilteredResult(_0x4c58ff,_0x580e13))['catch'](handleError(_0x4c58ff,null));};exports[_0x162f('0x40')]=function(_0xc2143e,_0x52c8c3){var _0x8c8443={'raw':!![],'where':{'id':_0xc2143e[_0x162f('0x41')]['id']}},_0x21dd30={};_0x21dd30[_0x162f('0x30')]=_[_0x162f('0x42')](db[_0x162f('0x3c')][_0x162f('0x29')]);_0x21dd30['query']=_[_0x162f('0x42')](_0xc2143e[_0x162f('0x2d')]);_0x21dd30['filters']=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],_0x21dd30['query']);_0x8c8443[_0x162f('0x33')]=_[_0x162f('0x2f')](_0x21dd30[_0x162f('0x30')],qs[_0x162f('0x31')](_0xc2143e[_0x162f('0x2d')][_0x162f('0x31')]));_0x8c8443[_0x162f('0x33')]=_0x8c8443[_0x162f('0x33')][_0x162f('0x32')]?_0x8c8443[_0x162f('0x33')]:_0x21dd30[_0x162f('0x30')];if(_0xc2143e[_0x162f('0x2d')][_0x162f('0x3d')]){_0x8c8443[_0x162f('0x3e')]=[{'all':!![]}];}_0x8c8443=_['merge']({},_0x8c8443,_0xc2143e[_0x162f('0x3b')]);return db[_0x162f('0x3c')]['find'](_0x8c8443)['then'](handleEntityNotFound(_0x52c8c3,null))[_0x162f('0x25')](respondWithResult(_0x52c8c3,null))['catch'](handleError(_0x52c8c3,null));};exports[_0x162f('0x43')]=function(_0x5d06c1,_0x1e936b){return db['WhatsappApplication'][_0x162f('0x43')](_0x5d06c1[_0x162f('0x44')],{})[_0x162f('0x25')](respondWithResult(_0x1e936b,0xc9))[_0x162f('0x45')](handleError(_0x1e936b,null));};exports[_0x162f('0x24')]=function(_0xf74671,_0x466136){if(_0xf74671[_0x162f('0x44')]['id']){delete _0xf74671[_0x162f('0x44')]['id'];}return db['WhatsappApplication'][_0x162f('0x46')]({'where':{'id':_0xf74671[_0x162f('0x41')]['id']}})['then'](handleEntityNotFound(_0x466136,null))[_0x162f('0x25')](saveUpdates(_0xf74671[_0x162f('0x44')],null))[_0x162f('0x25')](respondWithResult(_0x466136,null))[_0x162f('0x45')](handleError(_0x466136,null));};exports[_0x162f('0x47')]=function(_0x487835,_0x232348){return db[_0x162f('0x3c')][_0x162f('0x46')]({'where':{'id':_0x487835[_0x162f('0x41')]['id']}})[_0x162f('0x25')](handleEntityNotFound(_0x232348,null))['then'](removeEntity(_0x232348,null))['catch'](handleError(_0x232348,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5819f64..36ebf52 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 _0x56a4=['rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path'];(function(_0x13e7c5,_0xb805d8){var _0x325458=function(_0x1cd6cd){while(--_0x1cd6cd){_0x13e7c5['push'](_0x13e7c5['shift']());}};_0x325458(++_0xb805d8);}(_0x56a4,0x11b));var _0x456a=function(_0xf71d98,_0x51e619){_0xf71d98=_0xf71d98-0x0;var _0x3fec71=_0x56a4[_0xf71d98];return _0x3fec71;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('WhatsappApplication',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x456a('0xa'),'collate':_0x456a('0xb')});}; \ No newline at end of file +var _0xf873=['bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf873,0xb2));var _0x3f87=function(_0x103ac9,_0x4f7c7b){_0x103ac9=_0x103ac9-0x0;var _0x1b1366=_0xf873[_0x103ac9];return _0x1b1366;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var fs=require('fs');var path=require(_0x3f87('0x6'));var rimraf=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0x3f87('0x9')]=function(_0x43c8e4,_0x27c03e){return _0x43c8e4['define'](_0x3f87('0xa'),attributes,{'tableName':_0x3f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f87('0xc'),'collate':_0x3f87('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 7774c9a..4bdf237 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x489848,_0x1e11b2){var _0x2a1861=function(_0x2009fd){while(--_0x2009fd){_0x489848['push'](_0x489848['shift']());}};_0x2a1861(++_0x1e11b2);}(_0x4c4e,0x152));var _0xe4c4=function(_0x59f40c,_0xaeda10){_0x59f40c=_0x59f40c-0x0;var _0x107a82=_0x4c4e[_0x59f40c];return _0x107a82;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x394f96,_0x2dd5b){var _0xb04eab=function(_0x3da13e){while(--_0x3da13e){_0x394f96['push'](_0x394f96['shift']());}};_0xb04eab(++_0x2dd5b);}(_0x5fd1,0x155));var _0x15fd=function(_0x18076e,_0x3121f7){_0x18076e=_0x18076e-0x0;var _0x6b6a3d=_0x5fd1[_0x18076e];return _0x6b6a3d;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index b99c5cc..ef73ed4 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 _0x8375=['post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x261bdd,_0x41e0d9){var _0x27d50a=function(_0x47738a){while(--_0x47738a){_0x261bdd['push'](_0x261bdd['shift']());}};_0x27d50a(++_0x41e0d9);}(_0x8375,0xa8));var _0x5837=function(_0xa4fcd0,_0x4c2c93){_0xa4fcd0=_0xa4fcd0-0x0;var _0x235236=_0x8375[_0xa4fcd0];return _0x235236;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var fs_extra=require(_0x5837('0x5'));var auth=require(_0x5837('0x6'));var interaction=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x5837('0x9')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0xb')]);router[_0x5837('0x9')](_0x5837('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x5837('0x9')](_0x5837('0xd'),auth['isAuthenticated'](),controller[_0x5837('0xe')]);router['get'](_0x5837('0xf'),auth[_0x5837('0xa')](),controller[_0x5837('0x10')]);router[_0x5837('0x9')](_0x5837('0x11'),auth[_0x5837('0xa')](),controller['download']);router[_0x5837('0x12')]('/',auth[_0x5837('0xa')](),controller[_0x5837('0x13')]);router[_0x5837('0x12')](_0x5837('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x5837('0x14'),auth[_0x5837('0xa')](),interaction[_0x5837('0x15')](_0x5837('0x16'),_0x5837('0x17')),controller[_0x5837('0x18')]);router[_0x5837('0x19')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked'](_0x5837('0x16'),_0x5837('0x1a')),controller['update']);router[_0x5837('0x1b')](_0x5837('0xd'),auth[_0x5837('0xa')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0x5837('0x1c')]);router[_0x5837('0x1b')](_0x5837('0x14'),auth['isAuthenticated'](),controller[_0x5837('0x1d')]);module[_0x5837('0x1e')]=router; \ No newline at end of file +var _0x187d=['whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','tracked','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags'];(function(_0x341569,_0x1edec3){var _0x2cb5c7=function(_0x50dafc){while(--_0x50dafc){_0x341569['push'](_0x341569['shift']());}};_0x2cb5c7(++_0x1edec3);}(_0x187d,0x93));var _0xd187=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x187d[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0xb')](_0xd187('0x10'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0xb')]('/:id/download',auth[_0xd187('0x9')](),controller[_0xd187('0x12')]);router[_0xd187('0x13')]('/',auth['isAuthenticated'](),controller[_0xd187('0x14')]);router[_0xd187('0x13')](_0xd187('0x10'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);router[_0xd187('0x13')](_0xd187('0x16'),auth[_0xd187('0x9')](),interaction['tracked'](_0xd187('0x17'),_0xd187('0x18')),controller[_0xd187('0x19')]);router[_0xd187('0x1a')]('/:id',auth[_0xd187('0x9')](),interaction['tracked']('whatsapp',_0xd187('0x1b')),controller['update']);router['delete'](_0xd187('0xe'),auth[_0xd187('0x9')](),interaction[_0xd187('0x1c')](_0xd187('0x17'),_0xd187('0x1d')),controller[_0xd187('0x1e')]);router[_0xd187('0x1f')](_0xd187('0x16'),auth[_0xd187('0x9')](),controller[_0xd187('0x20')]);module[_0xd187('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9f8db46..049670f 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 _0x6dc0=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x48e63b,_0x2871ef){var _0x19bf19=function(_0x272e3f){while(--_0x272e3f){_0x48e63b['push'](_0x48e63b['shift']());}};_0x19bf19(++_0x2871ef);}(_0x6dc0,0x18c));var _0x06dc=function(_0x10e74e,_0x1603ae){_0x10e74e=_0x10e74e-0x0;var _0x2198c1=_0x6dc0[_0x10e74e];return _0x2198c1;};'use strict';var Sequelize=require(_0x06dc('0x0'));var moment=require('moment');module[_0x06dc('0x1')]={'closed':{'type':Sequelize[_0x06dc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06dc('0x3')]},'disposition':{'type':Sequelize[_0x06dc('0x4')]},'secondDisposition':{'type':Sequelize[_0x06dc('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x06dc('0x4')]},'read1stAt':{'type':Sequelize[_0x06dc('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x06dc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x06dc('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06dc('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3831=['STRING','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0xd07c63,_0x1c085a){var _0x458c28=function(_0x1eafe1){while(--_0x1eafe1){_0xd07c63['push'](_0xd07c63['shift']());}};_0x458c28(++_0x1c085a);}(_0x3831,0x14c));var _0x1383=function(_0x43b21d,_0x5d5677){_0x43b21d=_0x43b21d-0x0;var _0x1de400=_0x3831[_0x43b21d];return _0x1de400;};'use strict';var Sequelize=require(_0x1383('0x0'));var moment=require('moment');module[_0x1383('0x1')]={'closed':{'type':Sequelize[_0x1383('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1383('0x3')]},'disposition':{'type':Sequelize[_0x1383('0x4')]},'secondDisposition':{'type':Sequelize[_0x1383('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1383('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1383('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1383('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1383('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 67a0f67..1bbf30a 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 _0x77d4=['join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','createdAt','direction','get','mkdirSync','Whatsapp','Account','closedAt','disposition','basename','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','waiting','talking','total','closed','UserId','unmanaged','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','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','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','buildExpression','body','keys','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','isEmpty','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','WhatsappInteraction','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','includeAll','include','options','create','describe','addMessage','WhatsappMessage','params','ids','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','findAll','emit','removeTags','download'];(function(_0x5121e0,_0x295183){var _0x3d1f8f=function(_0x47a613){while(--_0x47a613){_0x5121e0['push'](_0x5121e0['shift']());}};_0x3d1f8f(++_0x295183);}(_0x77d4,0x108));var _0x477d=function(_0x3f8e92,_0x5a20b2){_0x3f8e92=_0x3f8e92-0x0;var _0x5b211b=_0x77d4[_0x3f8e92];return _0x5b211b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x477d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x477d('0x11'))(_0x477d('0x12'));var utils=require('../../config/utils');var config=require(_0x477d('0x13'));var licenseUtil=require(_0x477d('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x477d('0x15')](config[_0x477d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x477d('0x17'))(new Redis(config[_0x477d('0x16')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x38a0a8,_0x4bbfef){_0x4bbfef=_0x4bbfef||0xcc;return function(_0x30481f){if(_0x30481f){return _0x38a0a8[_0x477d('0x18')](_0x4bbfef);}return _0x38a0a8[_0x477d('0x19')](_0x4bbfef)['end']();};}function respondWithResult(_0x116aa7,_0x78d1f2){_0x78d1f2=_0x78d1f2||0xc8;return function(_0x29c6f8){if(_0x29c6f8){return _0x116aa7[_0x477d('0x19')](_0x78d1f2)['json'](_0x29c6f8);}};}function respondWithFilteredResult(_0x28f17a,_0x5d5553){return function(_0x367965){if(_0x367965){var _0x1399d7=typeof _0x5d5553[_0x477d('0x1a')]===_0x477d('0x1b')&&typeof _0x5d5553[_0x477d('0x1c')]===_0x477d('0x1b');var _0x5bea7e=_0x367965[_0x477d('0x1d')];var _0x49c442=_0x1399d7?0x0:_0x5d5553[_0x477d('0x1a')];var _0x24a6d5=_0x1399d7?_0x367965[_0x477d('0x1d')]:_0x5d5553[_0x477d('0x1a')]+_0x5d5553[_0x477d('0x1c')];var _0x3b3cda;if(_0x24a6d5>=_0x5bea7e){_0x24a6d5=_0x5bea7e;_0x3b3cda=0xc8;}else{_0x3b3cda=0xce;}_0x28f17a[_0x477d('0x19')](_0x3b3cda);return _0x28f17a[_0x477d('0x1e')](_0x477d('0x1f'),_0x49c442+'-'+_0x24a6d5+'/'+_0x5bea7e)[_0x477d('0x20')](_0x367965);}return null;};}function patchUpdates(_0x3d2943){return function(_0x3525e8){try{jsonpatch[_0x477d('0x21')](_0x3525e8,_0x3d2943,!![]);}catch(_0x1f3868){return BPromise['reject'](_0x1f3868);}return _0x3525e8[_0x477d('0x22')]();};}function saveUpdates(_0x583444,_0x239b56){return function(_0x2506d8){if(_0x2506d8){return _0x2506d8[_0x477d('0x23')](_0x583444)[_0x477d('0x24')](function(_0x4bb50e){return _0x4bb50e;});}return null;};}function removeEntity(_0xd6dca5,_0x2dfa90){return function(_0x1ca4fe){if(_0x1ca4fe){return _0x1ca4fe['destroy']()['then'](function(){_0xd6dca5[_0x477d('0x19')](0xcc)[_0x477d('0x25')]();});}};}function handleEntityNotFound(_0x386df5,_0x5c8ef1){return function(_0x254141){if(!_0x254141){_0x386df5[_0x477d('0x18')](0x194);}return _0x254141;};}function handleError(_0x74ebb4,_0xe4dd40){_0xe4dd40=_0xe4dd40||0x1f4;return function(_0x37b332){logger['error'](_0x37b332[_0x477d('0x26')]);if(_0x37b332[_0x477d('0x27')]){delete _0x37b332[_0x477d('0x27')];}_0x74ebb4[_0x477d('0x19')](_0xe4dd40)[_0x477d('0x28')](_0x37b332);};}function getInteractionUsers(_0x385eb4,_0x180046){return new BPromise(function(_0x98b5d9,_0x204541){try{if(_0x180046[_0x385eb4['id']]){_0x385eb4[_0x477d('0x29')]=_[_0x477d('0x2a')](_0x180046[_0x385eb4['id']],function(_0x38f37f){return{'id':_0x38f37f['id'],'fullname':_0x38f37f[_0x477d('0x2b')]};});}}catch(_0x2f7851){_0x204541(_0x2f7851);}_0x98b5d9(_0x385eb4);});}function getInteractionTags(_0x16042d,_0x4127c1){return new BPromise(function(_0x9857c2,_0x3a5509){try{if(_0x16042d[_0x477d('0x2c')]){_0x16042d[_0x477d('0x2d')]=[];_0x16042d['TagIds'][_0x477d('0x2e')](',')['forEach'](function(_0x25fd60){_0x16042d[_0x477d('0x2d')][_0x477d('0x2f')](_0x4127c1[_0x25fd60]);});}delete _0x16042d['TagIds'];}catch(_0x117c97){_0x3a5509(_0x117c97);}_0x9857c2(_0x16042d);});}function updateWhatsappInteraction(_0x1201a9,_0x2b2091,_0x3d34e4){return new BPromise(function(_0x249b82,_0x463fca){return getInteractionUsers(_0x1201a9,_0x3d34e4)[_0x477d('0x24')](function(_0xf84c4c){return getInteractionTags(_0xf84c4c,_0x2b2091);})[_0x477d('0x24')](function(_0x6ab99b){return getStateInteraction(_0x6ab99b);})['then'](function(_0x36a247){_0x249b82(_0x36a247);})[_0x477d('0x30')](function(_0xb41cd8){_0x463fca(_0xb41cd8);});});}function getStateInteraction(_0x59e292){return new BPromise(function(_0x50b3f7){_0x59e292[_0x477d('0x31')]=0x0;_0x59e292[_0x477d('0x32')]=0x0;_0x59e292['answered']=0x0;_0x59e292['unmanaged']=0x0;_0x59e292[_0x477d('0x33')]=0x0;if(!_0x59e292[_0x477d('0x34')]&&!_0x59e292[_0x477d('0x35')]){_0x59e292[_0x477d('0x31')]+=0x1;}if(!_0x59e292[_0x477d('0x34')]&&_0x59e292['UserId']){_0x59e292[_0x477d('0x32')]+=0x1;if(_0x59e292['waiting']){_0x59e292[_0x477d('0x31')]-=0x1;}}if(_0x59e292[_0x477d('0x34')]&&_0x59e292[_0x477d('0x35')]){_0x59e292['answered']+=0x1;if(_0x59e292['talking']){_0x59e292[_0x477d('0x32')]-=0x1;}}if(_0x59e292[_0x477d('0x34')]&&!_0x59e292[_0x477d('0x35')]){_0x59e292[_0x477d('0x36')]+=0x1;if(_0x59e292['waiting']){_0x59e292[_0x477d('0x31')]-=0x1;}}_0x59e292[_0x477d('0x33')]+=0x1;_0x50b3f7(_0x59e292);});}exports[_0x477d('0x37')]=function(_0x3b2972,_0x90924){var _0x533974={},_0x472149={},_0x3142d5={'count':0x0,'rows':[]};var _0x4d1c8e=_[_0x477d('0x2a')](db['WhatsappInteraction'][_0x477d('0x38')],function(_0x7a5a47){return{'name':_0x7a5a47[_0x477d('0x39')],'type':_0x7a5a47[_0x477d('0x3a')][_0x477d('0x3b')]};});_0x472149[_0x477d('0x3c')]=_[_0x477d('0x2a')](_0x4d1c8e,_0x477d('0x27'));_0x472149[_0x477d('0x3d')]=_['keys'](_0x3b2972[_0x477d('0x3d')]);_0x472149[_0x477d('0x3e')]=_[_0x477d('0x3f')](_0x472149[_0x477d('0x3c')],_0x472149['query']);_0x533974['attributes']=_[_0x477d('0x3f')](_0x472149[_0x477d('0x3c')],qs['fields'](_0x3b2972[_0x477d('0x3d')]['fields']));_0x533974['attributes']=_0x533974[_0x477d('0x40')][_0x477d('0x41')]?_0x533974[_0x477d('0x40')]:_0x472149[_0x477d('0x3c')];if(!_0x3b2972[_0x477d('0x3d')][_0x477d('0x42')]('nolimit')){_0x533974[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x3b2972[_0x477d('0x3d')][_0x477d('0x1c')]);_0x533974[_0x477d('0x1a')]=qs['offset'](_0x3b2972['query'][_0x477d('0x1a')]);}_0x533974[_0x477d('0x43')]=qs[_0x477d('0x44')](_0x3b2972['query'][_0x477d('0x44')]);_0x533974[_0x477d('0x45')]=qs[_0x477d('0x3e')](_[_0x477d('0x46')](_0x3b2972[_0x477d('0x3d')],_0x472149[_0x477d('0x3e')]),_0x4d1c8e);var _0x13f606=[];var _0x4d4e19=squel[_0x477d('0x47')]()[_0x477d('0x48')]('id')[_0x477d('0x48')](_0x477d('0x27'))[_0x477d('0x48')](_0x477d('0x49'))[_0x477d('0x4a')](_0x477d('0x4b'));var _0x113162=squel[_0x477d('0x47')]()[_0x477d('0x48')](_0x477d('0x4c'))[_0x477d('0x48')](_0x477d('0x4d'))[_0x477d('0x48')]('ui.WhatsappInteractionId')[_0x477d('0x4a')](_0x477d('0x4e'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0xf0f20e=squel[_0x477d('0x47')]()[_0x477d('0x4a')](_0x477d('0x4f'),'i')[_0x477d('0x50')](_0x477d('0x51'),'c',_0x477d('0x52'))[_0x477d('0x50')]('users','o',_0x477d('0x53'))[_0x477d('0x50')](_0x477d('0x54'),'a',_0x477d('0x55'))[_0x477d('0x50')](_0x477d('0x56'),'me',_0x477d('0x57'))[_0x477d('0x50')]('whatsapp_interaction_has_tags','it',_0x477d('0x58'))[_0x477d('0x50')](_0x477d('0x4b'),'t',_0x477d('0x59'));var _0x45cf6d=squel['expr']();var _0x1c496a=[];var _0x215f73=squel[_0x477d('0x5a')]();var _0x239ece;if(_0x3b2972[_0x477d('0x3d')]['search']){_0x239ece=as['parseSearch'](_0x3b2972[_0x477d('0x3d')][_0x477d('0x5b')]);var _0x95f9e0=_0x239ece[_0x477d('0x5c')];for(var _0x2a19c1=0x0;_0x2a19c1<_0x239ece[_0x477d('0x5d')][_0x477d('0x41')];_0x2a19c1++){var _0x39b961=_0x239ece['conditions'][_0x2a19c1];var _0x53aa58='i';var _0x54a32f=_['find'](_0x4d1c8e,['name',_0x39b961[_0x477d('0x48')]]);if(!_0x54a32f){switch(_0x39b961['field']){case _0x477d('0x5e'):if(_0x39b961['value']==0x1){_0xf0f20e[_0x477d('0x5f')]('`'+_0x39b961[_0x477d('0x48')]+'`\x20=\x200');}else{_0xf0f20e[_0x477d('0x5f')]('`'+_0x39b961[_0x477d('0x48')]+_0x477d('0x60'));}break;case _0x477d('0x61'):if(_0x39b961[_0x477d('0x62')]==='$substring'){if(_0x39b961[_0x477d('0x63')][_0x477d('0x2e')]('\x20')['length']>0x1){_0x45cf6d[_0x95f9e0](_0x477d('0x64'),qs[_0x477d('0x65')](_0x39b961[_0x477d('0x63')]),null);}else{var _0x207460='%'+_0x39b961[_0x477d('0x63')]+'%';_0x45cf6d[_0x95f9e0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x207460,_0x207460,_0x207460);}}else{_0x54a32f=_['find'](_0x4d1c8e,[_0x477d('0x27'),_0x477d('0x66')]);_0x39b961['field']=_0x477d('0x66');_0x2e39f7=as['buildExpression'](_0x53aa58,_0x54a32f['type'],_0x39b961);_0x45cf6d[_0x95f9e0](_0x2e39f7[_0x477d('0x67')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x68')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x25')]);}break;case'Tag':var _0x4c17f5=_0x39b961[_0x477d('0x63')][_0x477d('0x2e')](',')[_0x477d('0x2a')](function(_0x2b0b84){return Number(_0x2b0b84);});_0x4c17f5[_0x477d('0x69')](function(_0x40c681){_0x215f73['or'](_0x477d('0x6a'),'%,'+_0x40c681+',%');});_0x1c496a=_[_0x477d('0x6b')](_0x1c496a,_0x4c17f5);break;case _0x477d('0x6c'):if(_0x39b961['operator']==='$substring'){_0x45cf6d[_0x95f9e0](_0x477d('0x6d'),'%'+_0x39b961['value']+'%',null);}else{_0x54a32f=_[_0x477d('0x6e')](_0x4d1c8e,[_0x477d('0x27'),_0x477d('0x35')]);_0x39b961['field']=_0x477d('0x35');_0x2e39f7=as[_0x477d('0x6f')](_0x53aa58,_0x54a32f['type'],_0x39b961);_0x45cf6d[_0x95f9e0](_0x2e39f7[_0x477d('0x67')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x68')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x25')]);}break;case _0x477d('0x70'):_0x2e39f7=as['buildExpression']('me',null,_0x39b961);_0x45cf6d[_0x95f9e0](_0x2e39f7[_0x477d('0x67')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x68')],_0x2e39f7[_0x477d('0x63')]['end']);break;}}else{var _0x2e39f7=as['buildExpression'](_0x53aa58,_0x54a32f[_0x477d('0x3a')],_0x39b961);_0x45cf6d[_0x95f9e0](_0x2e39f7[_0x477d('0x67')],_0x2e39f7['value'][_0x477d('0x68')],_0x2e39f7[_0x477d('0x63')][_0x477d('0x25')]);}}}else{var _0x4980ec=_(_0x3b2972['query'])[_0x477d('0x71')]()[_0x477d('0x2a')](function(_0x439486){return _[_0x477d('0x72')](_0x4d1c8e,['name',_0x439486])?_0x439486:undefined;})[_0x477d('0x73')]()[_0x477d('0x63')]();if(!_['isEmpty'](_0x4980ec)){_0x4980ec[_0x477d('0x69')](function(_0x2aac51){if(_0x2aac51===_0x477d('0x74')){_0xf0f20e['where'](_0x477d('0x75'),[][_0x477d('0x76')](_0x3b2972[_0x477d('0x3d')][_0x2aac51]));}else if(_0x2aac51==='createdAt'){var _0x3b1e4c=JSON[_0x477d('0x77')](_0x3b2972[_0x477d('0x3d')][_0x2aac51])[_0x477d('0x78')];var _0x104dec=JSON[_0x477d('0x77')](_0x3b2972[_0x477d('0x3d')][_0x2aac51])[_0x477d('0x79')];_0xf0f20e[_0x477d('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3b1e4c,_0x104dec);}else{if(_0x3b2972['query'][_0x2aac51]===_0x477d('0x7a')){_0xf0f20e['where']('i.'+_0x2aac51+_0x477d('0x7b'));}else{_0xf0f20e['where']('i.'+_0x2aac51+_0x477d('0x7c'),_0x3b2972['query'][_0x2aac51]);}}});}if(_0x3b2972[_0x477d('0x3d')][_0x477d('0x7d')]){if(_0x3b2972[_0x477d('0x3d')][_0x477d('0x7d')]==0x1){_0xf0f20e['having']('`unreadMessages`\x20=\x200');}else{_0xf0f20e['having']('`unreadMessages`\x20>\x200');}}if(_0x3b2972['query'][_0x477d('0x7e')]){_0x1c496a=_[_0x477d('0x7f')](_0x3b2972[_0x477d('0x3d')][_0x477d('0x7e')])?_0x3b2972[_0x477d('0x3d')][_0x477d('0x7e')]:new Array(_0x3b2972['query'][_0x477d('0x7e')]);_0x1c496a['forEach'](function(_0x579533){_0x215f73['or'](_0x477d('0x6a'),'%,'+_0x579533+',%');});}if(_0x3b2972[_0x477d('0x3d')][_0x477d('0x80')]){var _0xc395cf=_0x3b2972[_0x477d('0x3d')][_0x477d('0x80')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x477d('0x81')](_0xc395cf)){_0x45cf6d['or'](_0x477d('0x82'),_0xc395cf+'%')['or'](_0x477d('0x83'),_0xc395cf+'%');}else{_0x45cf6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xc395cf))['or'](_0x477d('0x84'),_0xc395cf+'%');}}}_0xf0f20e[_0x477d('0x45')](_0x45cf6d);_0xf0f20e[_0x477d('0x85')](_0x477d('0x86'));var _0xaf7a97={'type':db[_0x477d('0x87')][_0x477d('0x88')][_0x477d('0x89')],'raw':!![]};var _0x2a6560=_0xf0f20e['clone']();_0x2a6560[_0x477d('0x48')](_0x477d('0x86'));_0x2a6560['field'](_0x477d('0x8a'),_0x477d('0x5e'));if(_0x533974[_0x477d('0x43')]){_0x533974[_0x477d('0x43')][_0x477d('0x69')](function(_0x5d5dd0){var _0x1c1394=_0x5d5dd0[0x0]==='contactName'?_0x5d5dd0[0x0]:'i.'+_0x5d5dd0[0x0];_0xf0f20e[_0x477d('0x43')](_0x1c1394,_0x5d5dd0[0x1]===_0x477d('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x1c496a)){_0xf0f20e[_0x477d('0x5f')](_0x215f73);_0x2a6560[_0x477d('0x45')]('t.id\x20IN\x20?',_0x1c496a);}BPromise[_0x477d('0x8c')]()[_0x477d('0x24')](function(){if(!_0x239ece){if(_0x3b2972['query'][_0x477d('0x74')])return;_0x2a6560[_0x477d('0x45')](_0x477d('0x8d'));_0xf0f20e[_0x477d('0x45')](_0x477d('0x8d'));return;}if(_0x3b2972[_0x477d('0x8e')][_0x477d('0x8f')]!==_0x477d('0x90'))return;return _0x3b2972[_0x477d('0x8e')][_0x477d('0x91')]({'attributes':['id'],'raw':!![]})[_0x477d('0x24')](function(_0x61e2ac){if(_[_0x477d('0x92')](_0x61e2ac)){_0x2a6560[_0x477d('0x45')](_0x477d('0x93'));_0xf0f20e['where'](_0x477d('0x93'));}else{_0x2a6560['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x477d('0x2a')](_0x61e2ac,'id'));_0xf0f20e[_0x477d('0x45')]('i.WhatsappAccountId\x20IN\x20?',_[_0x477d('0x2a')](_0x61e2ac,'id'));}});})[_0x477d('0x24')](function(){if(_0x3b2972[_0x477d('0x8e')][_0x477d('0x8f')]===_0x477d('0x90')&&!_0x239ece&&!_0x3b2972[_0x477d('0x3d')][_0x477d('0x74')])return[];return db['sequelize'][_0x477d('0x3d')](_0x2a6560[_0x477d('0x94')](),_0xaf7a97);})['then'](function(_0x26256c){_0x3142d5[_0x477d('0x1d')]=_0x26256c[_0x477d('0x41')];if(_0x3142d5[_0x477d('0x1d')]===0x0)return[];return db[_0x477d('0x95')][_0x477d('0x3d')](_0x4d4e19[_0x477d('0x94')](),_0xaf7a97)[_0x477d('0x24')](function(_0xef7df5){_0x13f606=_[_0x477d('0x96')](_0xef7df5,'id');_0xaf7a97=_[_0x477d('0x97')](_0xaf7a97,{'model':db[_0x477d('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b2972[_0x477d('0x3d')][_0x477d('0x99')]){_0x533974[_0x477d('0x40')][_0x477d('0x69')](function(_0x4f1c1c){_0xf0f20e['field']('i.'+_0x4f1c1c);});}else{_0xf0f20e[_0x477d('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xf0f20e['field'](_0x477d('0x9a'),_0x477d('0x9b'));_0xf0f20e['field'](_0x477d('0x9c'),_0x477d('0x9d'));_0xf0f20e[_0x477d('0x48')](_0x477d('0x9e'),_0x477d('0x9f'));_0xf0f20e['field']('i.*');_0xf0f20e[_0x477d('0x48')](_0x477d('0xa0'),_0x477d('0xa1'));_0xf0f20e[_0x477d('0x48')](_0x477d('0xa2'),'Contact.lastName');_0xf0f20e['field']('c.email',_0x477d('0xa3'));_0xf0f20e[_0x477d('0x48')]('c.phone',_0x477d('0xa4'));_0xf0f20e[_0x477d('0x48')](_0x477d('0xa5'),_0x477d('0xa6'));_0xf0f20e[_0x477d('0x48')](_0x477d('0xa7'),_0x477d('0xa8'));_0xf0f20e['field'](_0x477d('0xa9'),'Owner.fullname');_0xf0f20e[_0x477d('0x48')](_0x477d('0xaa'),_0x477d('0xab'));_0xf0f20e[_0x477d('0x48')](_0x477d('0xac'),_0x477d('0x2c'));}if(_0x533974[_0x477d('0x1c')])_0xf0f20e['limit'](_0x533974[_0x477d('0x1c')]);if(_0x533974[_0x477d('0x1a')])_0xf0f20e[_0x477d('0x1a')](_0x533974[_0x477d('0x1a')]);return db['sequelize'][_0x477d('0x3d')](_0xf0f20e['toString'](),_0xaf7a97);})[_0x477d('0x24')](function(_0xeea9bf){if(_0xeea9bf[_0x477d('0x41')]>0x0)_0x113162[_0x477d('0x45')](_0x477d('0xad'),_['map'](_0xeea9bf,'id'));return db[_0x477d('0x95')]['query'](_0x113162[_0x477d('0x94')](),_0xaf7a97)[_0x477d('0x24')](function(_0x245ba9){var _0x59f550=_[_0x477d('0xae')](_0x245ba9,_0x477d('0xaf'));var _0x3e70c7=[];_0xeea9bf[_0x477d('0x69')](function(_0x12acd2){_0x3e70c7[_0x477d('0x2f')](updateWhatsappInteraction(_0x12acd2,_0x13f606,_0x59f550));});return BPromise[_0x477d('0xb0')](_0x3e70c7);});});})[_0x477d('0x24')](function(_0x3f73d3){_0x3142d5[_0x477d('0xb1')]=_0x3f73d3;return _0x3142d5;})[_0x477d('0x24')](respondWithFilteredResult(_0x90924,_0x533974))[_0x477d('0x30')](handleError(_0x90924,null));};exports['show']=function(_0x5eebb8,_0x39dfae){var _0x236526={'raw':![],'where':{'id':_0x5eebb8['params']['id']}},_0x418055={};_0x418055['model']=_['keys'](db['WhatsappInteraction'][_0x477d('0x38')]);_0x418055[_0x477d('0x3d')]=_[_0x477d('0x71')](_0x5eebb8[_0x477d('0x3d')]);_0x418055[_0x477d('0x3e')]=_['intersection'](_0x418055[_0x477d('0x3c')],_0x418055[_0x477d('0x3d')]);_0x236526[_0x477d('0x40')]=_[_0x477d('0x3f')](_0x418055[_0x477d('0x3c')],qs[_0x477d('0x99')](_0x5eebb8['query'][_0x477d('0x99')]));_0x236526[_0x477d('0x40')]=_0x236526[_0x477d('0x40')]['length']?_0x236526[_0x477d('0x40')]:_0x418055[_0x477d('0x3c')];if(_0x5eebb8[_0x477d('0x3d')][_0x477d('0xb2')]){_0x236526[_0x477d('0xb3')]=[{'all':!![]}];}_0x236526=_['merge']({},_0x236526,_0x5eebb8[_0x477d('0xb4')]);return db[_0x477d('0x98')]['find'](_0x236526)[_0x477d('0x24')](handleEntityNotFound(_0x39dfae,null))[_0x477d('0x24')](respondWithResult(_0x39dfae,null))[_0x477d('0x30')](handleError(_0x39dfae,null));};exports[_0x477d('0xb5')]=function(_0x568da5,_0x115911){return db['WhatsappInteraction']['create'](_0x568da5[_0x477d('0x70')],{})[_0x477d('0x24')](respondWithResult(_0x115911,0xc9))['catch'](handleError(_0x115911,null));};exports['update']=function(_0x585f66,_0x3e2e95){if(_0x585f66[_0x477d('0x70')]['id']){delete _0x585f66[_0x477d('0x70')]['id'];}return db[_0x477d('0x98')]['find']({'where':{'id':_0x585f66['params']['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x3e2e95,null))[_0x477d('0x24')](saveUpdates(_0x585f66[_0x477d('0x70')],null))[_0x477d('0x24')](respondWithResult(_0x3e2e95,null))[_0x477d('0x30')](handleError(_0x3e2e95,null));};exports['destroy']=function(_0x110deb,_0x458fa5){return db['WhatsappInteraction']['find']({'where':{'id':_0x110deb['params']['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x458fa5,null))[_0x477d('0x24')](removeEntity(_0x458fa5,null))[_0x477d('0x30')](handleError(_0x458fa5,null));};exports[_0x477d('0xb6')]=function(_0x44c2fa,_0x4187a2){return db[_0x477d('0x98')][_0x477d('0xb6')]()['then'](respondWithResult(_0x4187a2,null))[_0x477d('0x30')](handleError(_0x4187a2,null));};exports[_0x477d('0xb7')]=function(_0x59052e,_0x451e18,_0x1e6db7){return db[_0x477d('0xb8')][_0x477d('0x6e')]({'where':{'id':_0x59052e[_0x477d('0xb9')]['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x451e18,null))[_0x477d('0x24')](function(_0x467fb8){if(_0x467fb8){return _0x467fb8[_0x477d('0xb7')](_0x59052e[_0x477d('0x70')]['ids'],_['omit'](_0x59052e['body'],[_0x477d('0xba'),'id'])||{});}})[_0x477d('0x24')](respondWithResult(_0x451e18,null))[_0x477d('0x30')](handleError(_0x451e18,null));};exports[_0x477d('0xbb')]=function(_0xe829b0,_0x35e47f,_0x584f42){var _0x2c2404={'raw':![],'where':{}};var _0x5051b2={};var _0x3231b0={'count':0x0,'rows':[]};return db[_0x477d('0x98')][_0x477d('0xbc')]({'where':{'id':_0xe829b0['params']['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x35e47f,null))['then'](function(_0x5ab1a8){if(_0x5ab1a8){_0x5051b2['model']=_['keys'](db['WhatsappMessage'][_0x477d('0x38')]);_0x5051b2['query']=_[_0x477d('0x71')](_0xe829b0['query']);_0x5051b2[_0x477d('0x3e')]=_['intersection'](_0x5051b2[_0x477d('0x3c')],_0x5051b2[_0x477d('0x3d')]);_0x2c2404['attributes']=_[_0x477d('0x3f')](_0x5051b2[_0x477d('0x3c')],qs[_0x477d('0x99')](_0xe829b0[_0x477d('0x3d')]['fields']));_0x2c2404[_0x477d('0x40')]=_0x2c2404[_0x477d('0x40')]['length']?_0x2c2404[_0x477d('0x40')]:_0x5051b2[_0x477d('0x3c')];if(!_0xe829b0[_0x477d('0x3d')][_0x477d('0x42')](_0x477d('0xbd'))){_0x2c2404[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0xe829b0[_0x477d('0x3d')][_0x477d('0x1c')]);_0x2c2404[_0x477d('0x1a')]=qs[_0x477d('0x1a')](_0xe829b0[_0x477d('0x3d')][_0x477d('0x1a')]);}_0x2c2404[_0x477d('0x43')]=qs[_0x477d('0x44')](_0xe829b0[_0x477d('0x3d')][_0x477d('0x44')]);_0x2c2404[_0x477d('0x45')]=qs[_0x477d('0x3e')](_['pick'](_0xe829b0['query'],_0x5051b2[_0x477d('0x3e')]));_0x2c2404[_0x477d('0x45')][_0x477d('0xaf')]=_0x5ab1a8['id'];if(_0xe829b0['query']['filter']){_0x2c2404[_0x477d('0x45')]=_[_0x477d('0x97')](_0x2c2404['where'],{'$or':_['map'](_0x2c2404[_0x477d('0x40')],function(_0x29f8c1){var _0xf1686e={};_0xf1686e[_0x29f8c1]={'$like':'%'+_0xe829b0[_0x477d('0x3d')][_0x477d('0x80')]+'%'};return _0xf1686e;})});}if(_0xe829b0[_0x477d('0x3d')][_0x477d('0x78')]){var _0x13967e=_0xe829b0[_0x477d('0x3d')]['$gte'][_0x477d('0x2e')](',');var _0x14f437={};_0x14f437[_0x13967e[0x0]]={'$gte':moment(_0x13967e[0x1])[_0x477d('0xbe')](_0x477d('0xbf'))};_0x2c2404[_0x477d('0x45')]=_['merge'](_0x2c2404[_0x477d('0x45')],_0x14f437);}_0x2c2404=_[_0x477d('0x97')]({},_0x2c2404,_0xe829b0[_0x477d('0xb4')]);return db[_0x477d('0xb8')]['count']({'where':_0x2c2404[_0x477d('0x45')]})[_0x477d('0x24')](function(_0x4c4731){_0x3231b0[_0x477d('0x1d')]=_0x4c4731;if(_0xe829b0['query']['includeAll']){_0x2c2404['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x2c2404);})[_0x477d('0x24')](function(_0x5415b6){_0x3231b0[_0x477d('0xb1')]=_0x5415b6;return _0x3231b0;});}})[_0x477d('0x24')](respondWithFilteredResult(_0x35e47f,_0x2c2404))[_0x477d('0x30')](handleError(_0x35e47f,null));};exports[_0x477d('0xc0')]=function(_0x642e,_0x5afa68,_0x1f2dac){return db[_0x477d('0x98')][_0x477d('0x6e')]({'where':{'id':_0x642e[_0x477d('0xb9')]['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x5afa68,null))[_0x477d('0x24')](function(_0x13d89a){if(_0x13d89a){return _0x13d89a[_0x477d('0xc1')](_0x642e[_0x477d('0x70')][_0x477d('0xba')],_['omit'](_0x642e[_0x477d('0x70')],[_0x477d('0xba'),'id'])||{})[_0x477d('0xc2')](function(){return db[_0x477d('0xc3')][_0x477d('0xc4')]({'attributes':['id',_0x477d('0x27'),'color'],'where':{'id':_0x642e['body'][_0x477d('0xba')]}});})['then'](function(_0x3758a6){socket[_0x477d('0xc5')]('whatsappInteractionTags:save',{'id':Number(_0x642e[_0x477d('0xb9')]['id']),'tags':_0x3758a6||[]});return{'id':Number(_0x642e[_0x477d('0xb9')]['id']),'tags':_0x3758a6||[]};});}})[_0x477d('0x24')](respondWithResult(_0x5afa68,null))['catch'](handleError(_0x5afa68,null));};exports[_0x477d('0xc6')]=function(_0x33359e,_0x24e1cf,_0x121d00){return db[_0x477d('0x98')][_0x477d('0x6e')]({'where':{'id':_0x33359e[_0x477d('0xb9')]['id']}})[_0x477d('0x24')](handleEntityNotFound(_0x24e1cf,null))[_0x477d('0x24')](function(_0x5cc5aa){if(_0x5cc5aa){return _0x5cc5aa[_0x477d('0xc6')](_0x33359e['query'][_0x477d('0xba')]);}})[_0x477d('0x24')](respondWithStatusCode(_0x24e1cf,null))[_0x477d('0x30')](handleError(_0x24e1cf,null));};exports[_0x477d('0xc7')]=function(_0x4996e6,_0x2fba34){var _0x361807=moment()['unix']()[_0x477d('0x94')]();var _0x3a455f=path[_0x477d('0xc8')](config[_0x477d('0xc9')],_0x477d('0xca'),_0x477d('0xcb'),_0x477d('0xcc'));var _0x4220df=path[_0x477d('0xc8')](config['root'],_0x477d('0xca'),_0x477d('0xcb'),_0x477d('0xcd'));var _0x20281a=path[_0x477d('0xc8')](_0x3a455f,_0x361807);var _0x1aac60=util[_0x477d('0xbe')](_0x477d('0xce'),_0x4996e6['params']['id'],_0x361807);var _0x1bdb46=path['join'](_0x3a455f,_0x1aac60);var _0xc1d4bd=[];_0xc1d4bd[_0x477d('0x2f')]({'model':db[_0x477d('0x6c')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xc1d4bd['push']({'model':db[_0x477d('0xcf')],'as':_0x477d('0x61'),'attributes':['id','firstName',_0x477d('0xd0')],'raw':!![]});if(_0x4996e6[_0x477d('0x3d')][_0x477d('0xcd')]){_0xc1d4bd[_0x477d('0x2f')]({'model':db['Attachment'],'as':_0x477d('0xd1'),'raw':!![]});}var _0x3e101f=[{'model':db[_0x477d('0xb8')],'as':_0x477d('0xd2'),'attributes':['id','body',_0x477d('0xd3'),_0x477d('0xd4'),'secret',_0x477d('0x7d')],'include':_0xc1d4bd}];_0x3e101f[_0x477d('0x2f')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x477d('0x27')]});_0x3e101f['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x477d('0x2b')]});return db[_0x477d('0x98')][_0x477d('0x6e')]({'where':{'id':_0x4996e6[_0x477d('0xb9')]['id']},'include':_0x3e101f})['then'](handleEntityNotFound(_0x2fba34,null))[_0x477d('0x24')](function(_0x412878){if(_0x412878){var _0x33d832=_0x412878[_0x477d('0xd5')]({'plain':!![]});fs[_0x477d('0xd6')](_0x20281a);var _0x4cbf2e={'channel':_0x477d('0xd7'),'account':_0x33d832[_0x477d('0xd8')][_0x477d('0x27')],'agent':_0x33d832['Owner']?_0x33d832['Owner']['fullname']:'N.A.','createdAt':moment(_0x33d832[_0x477d('0xd3')])[_0x477d('0xbe')](_0x477d('0xbf'))[_0x477d('0x94')](),'closedAt':_0x33d832[_0x477d('0x34')]?moment(_0x33d832[_0x477d('0xd9')])[_0x477d('0xbe')](_0x477d('0xbf'))[_0x477d('0x94')]():'','disposition':_0x33d832[_0x477d('0xda')],'messages':_(_0x33d832['Messages'])[_0x477d('0x80')]({'secret':![]})[_0x477d('0x2a')](function(_0x5393bd){if(_0x5393bd['Attachment']){var _0x1e4f03=path[_0x477d('0xc8')](_0x4220df,_0x5393bd['Attachment'][_0x477d('0xdb')]);if(fs['existsSync'](_0x1e4f03)){fs[_0x477d('0xdc')](_0x1e4f03)[_0x477d('0xdd')](fs['createWriteStream'](path[_0x477d('0xc8')](_0x20281a,_0x5393bd[_0x477d('0xd1')]['basename'])));}}return{'date':moment(_0x5393bd[_0x477d('0xd3')])[_0x477d('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5393bd[_0x477d('0xd4')]===_0x477d('0xde')?_0x5393bd[_0x477d('0x6c')]?_0x5393bd[_0x477d('0x6c')][_0x477d('0x2b')]:'System':_0x5393bd[_0x477d('0x61')]['firstName']+(_0x5393bd[_0x477d('0x61')][_0x477d('0xd0')]?'\x20'+_0x5393bd[_0x477d('0x61')][_0x477d('0xd0')]:''),'body':_0x5393bd[_0x477d('0xd1')]?_0x5393bd[_0x477d('0xd1')]['basename']:_0x5393bd[_0x477d('0x70')],'direction':_0x5393bd[_0x477d('0xd4')]==='out'?'A':'C','secret':_0x5393bd['secret'],'read':_0x5393bd['read'],'attachment':_0x5393bd[_0x477d('0xd1')]};})['value']()};return ejs[_0x477d('0xdf')](path[_0x477d('0xc8')](config[_0x477d('0xc9')],_0x477d('0xca'),_0x477d('0xe0'),_0x477d('0xe1')),{'interaction':_0x4cbf2e})[_0x477d('0x24')](function(_0x41f06c){var _0x423a45=path['join'](_0x20281a,_0x477d('0xe2')+_0x33d832['id']+'-'+_0x361807+_0x477d('0xe3'));var _0x13e7c8={'path':_0x423a45,'channel':_0x477d('0xd7'),'interactionId':_0x33d832['id']};return pdf[_0x477d('0xe4')](_0x41f06c,_0x13e7c8);})['then'](function(){return new BPromise(function(_0x3de2c5,_0x36ed68){zipdir(_0x20281a,{'saveTo':_0x1bdb46},function(_0x119513,_0x386901){if(_0x119513)return _0x36ed68(_0x119513);return _0x3de2c5(_0x386901);});})[_0x477d('0x24')](function(){return new BPromise(function(_0x24bb45,_0x18f47b){rimraf(_0x20281a,function(_0x51271d){if(_0x51271d)_0x18f47b(_0x51271d);return _0x24bb45();});});})[_0x477d('0x24')](function(){return _0x2fba34[_0x477d('0xc7')](_0x1bdb46,_0x1aac60,function(_0x1f99f5){if(_0x1f99f5){console[_0x477d('0xe5')](_0x477d('0xe6'),_0x1f99f5);}else{fs[_0x477d('0xe7')](_0x1bdb46);}});});});}else{return _0x2fba34[_0x477d('0x18')](0xc8);}})['catch'](handleError(_0x2fba34,null));}; \ No newline at end of file +var _0x66fa=['WhatsappMessage','omit','ids','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','push','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','System','direction','renderFile','views','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','end','error','stack','name','Users','fullname','Tags','TagIds','split','catch','waiting','talking','answered','unmanaged','closed','UserId','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','field','tools_tags','select','u.id','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','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','WhatsappAccountId','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','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','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','rows','params','includeAll','include','merge','options','create','describe','addMessage'];(function(_0x45904a,_0x1c9f4c){var _0x1bb9b6=function(_0x329de5){while(--_0x329de5){_0x45904a['push'](_0x45904a['shift']());}};_0x1bb9b6(++_0x1c9f4c);}(_0x66fa,0x117));var _0xa66f=function(_0x3e055e,_0x307d0e){_0x3e055e=_0x3e055e-0x0;var _0x16050b=_0x66fa[_0x3e055e];return _0x16050b;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3ac0ac,_0x452c37){_0x452c37=_0x452c37||0xcc;return function(_0x267129){if(_0x267129){return _0x3ac0ac[_0xa66f('0x19')](_0x452c37);}return _0x3ac0ac[_0xa66f('0x1a')](_0x452c37)['end']();};}function respondWithResult(_0x5510dc,_0x19b5ac){_0x19b5ac=_0x19b5ac||0xc8;return function(_0x32d338){if(_0x32d338){return _0x5510dc[_0xa66f('0x1a')](_0x19b5ac)[_0xa66f('0x1b')](_0x32d338);}};}function respondWithFilteredResult(_0x5c67f5,_0x1cbe64){return function(_0x55b59d){if(_0x55b59d){var _0x4a28d4=typeof _0x1cbe64[_0xa66f('0x1c')]===_0xa66f('0x1d')&&typeof _0x1cbe64[_0xa66f('0x1e')]===_0xa66f('0x1d');var _0x2c5b76=_0x55b59d[_0xa66f('0x1f')];var _0x251f60=_0x4a28d4?0x0:_0x1cbe64[_0xa66f('0x1c')];var _0x2033a4=_0x4a28d4?_0x55b59d[_0xa66f('0x1f')]:_0x1cbe64[_0xa66f('0x1c')]+_0x1cbe64[_0xa66f('0x1e')];var _0x3c4eb1;if(_0x2033a4>=_0x2c5b76){_0x2033a4=_0x2c5b76;_0x3c4eb1=0xc8;}else{_0x3c4eb1=0xce;}_0x5c67f5[_0xa66f('0x1a')](_0x3c4eb1);return _0x5c67f5[_0xa66f('0x20')]('Content-Range',_0x251f60+'-'+_0x2033a4+'/'+_0x2c5b76)[_0xa66f('0x1b')](_0x55b59d);}return null;};}function patchUpdates(_0xc5c82e){return function(_0x40ee00){try{jsonpatch[_0xa66f('0x21')](_0x40ee00,_0xc5c82e,!![]);}catch(_0x5cbd82){return BPromise[_0xa66f('0x22')](_0x5cbd82);}return _0x40ee00[_0xa66f('0x23')]();};}function saveUpdates(_0x209f4d,_0x16f1fa){return function(_0x502e21){if(_0x502e21){return _0x502e21['update'](_0x209f4d)[_0xa66f('0x24')](function(_0x598942){return _0x598942;});}return null;};}function removeEntity(_0x3a3e4f,_0xc661f2){return function(_0x384164){if(_0x384164){return _0x384164['destroy']()[_0xa66f('0x24')](function(){_0x3a3e4f[_0xa66f('0x1a')](0xcc)[_0xa66f('0x25')]();});}};}function handleEntityNotFound(_0x238eb2,_0x17c103){return function(_0x236046){if(!_0x236046){_0x238eb2[_0xa66f('0x19')](0x194);}return _0x236046;};}function handleError(_0xea2c89,_0x20ee67){_0x20ee67=_0x20ee67||0x1f4;return function(_0x117d03){logger[_0xa66f('0x26')](_0x117d03[_0xa66f('0x27')]);if(_0x117d03[_0xa66f('0x28')]){delete _0x117d03[_0xa66f('0x28')];}_0xea2c89['status'](_0x20ee67)['send'](_0x117d03);};}function getInteractionUsers(_0x38daac,_0x27ceae){return new BPromise(function(_0x55f309,_0x44c79a){try{if(_0x27ceae[_0x38daac['id']]){_0x38daac[_0xa66f('0x29')]=_['map'](_0x27ceae[_0x38daac['id']],function(_0x332e86){return{'id':_0x332e86['id'],'fullname':_0x332e86[_0xa66f('0x2a')]};});}}catch(_0x9d78d5){_0x44c79a(_0x9d78d5);}_0x55f309(_0x38daac);});}function getInteractionTags(_0x2c2ace,_0x395623){return new BPromise(function(_0x548add,_0x1b2c5a){try{if(_0x2c2ace['TagIds']){_0x2c2ace[_0xa66f('0x2b')]=[];_0x2c2ace[_0xa66f('0x2c')][_0xa66f('0x2d')](',')['forEach'](function(_0x2b1a90){_0x2c2ace[_0xa66f('0x2b')]['push'](_0x395623[_0x2b1a90]);});}delete _0x2c2ace[_0xa66f('0x2c')];}catch(_0x35a847){_0x1b2c5a(_0x35a847);}_0x548add(_0x2c2ace);});}function updateWhatsappInteraction(_0xba9457,_0x3e7ac5,_0x10a782){return new BPromise(function(_0x2452d2,_0x25c74c){return getInteractionUsers(_0xba9457,_0x10a782)[_0xa66f('0x24')](function(_0x35ef27){return getInteractionTags(_0x35ef27,_0x3e7ac5);})[_0xa66f('0x24')](function(_0x5b5043){return getStateInteraction(_0x5b5043);})[_0xa66f('0x24')](function(_0x5bf736){_0x2452d2(_0x5bf736);})[_0xa66f('0x2e')](function(_0x46f6cc){_0x25c74c(_0x46f6cc);});});}function getStateInteraction(_0x9c7756){return new BPromise(function(_0x3b9261){_0x9c7756[_0xa66f('0x2f')]=0x0;_0x9c7756[_0xa66f('0x30')]=0x0;_0x9c7756[_0xa66f('0x31')]=0x0;_0x9c7756[_0xa66f('0x32')]=0x0;_0x9c7756['total']=0x0;if(!_0x9c7756[_0xa66f('0x33')]&&!_0x9c7756['UserId']){_0x9c7756[_0xa66f('0x2f')]+=0x1;}if(!_0x9c7756[_0xa66f('0x33')]&&_0x9c7756[_0xa66f('0x34')]){_0x9c7756['talking']+=0x1;if(_0x9c7756['waiting']){_0x9c7756[_0xa66f('0x2f')]-=0x1;}}if(_0x9c7756[_0xa66f('0x33')]&&_0x9c7756[_0xa66f('0x34')]){_0x9c7756[_0xa66f('0x31')]+=0x1;if(_0x9c7756[_0xa66f('0x30')]){_0x9c7756['talking']-=0x1;}}if(_0x9c7756['closed']&&!_0x9c7756['UserId']){_0x9c7756[_0xa66f('0x32')]+=0x1;if(_0x9c7756['waiting']){_0x9c7756['waiting']-=0x1;}}_0x9c7756['total']+=0x1;_0x3b9261(_0x9c7756);});}exports[_0xa66f('0x35')]=function(_0x5051b2,_0x8965d3){var _0x17d942={},_0x23a546={},_0x1647a0={'count':0x0,'rows':[]};var _0xd65c5d=_[_0xa66f('0x36')](db[_0xa66f('0x37')][_0xa66f('0x38')],function(_0x32ba8b){return{'name':_0x32ba8b[_0xa66f('0x39')],'type':_0x32ba8b[_0xa66f('0x3a')][_0xa66f('0x3b')]};});_0x23a546[_0xa66f('0x3c')]=_[_0xa66f('0x36')](_0xd65c5d,'name');_0x23a546[_0xa66f('0x3d')]=_[_0xa66f('0x3e')](_0x5051b2['query']);_0x23a546[_0xa66f('0x3f')]=_['intersection'](_0x23a546[_0xa66f('0x3c')],_0x23a546[_0xa66f('0x3d')]);_0x17d942['attributes']=_[_0xa66f('0x40')](_0x23a546[_0xa66f('0x3c')],qs[_0xa66f('0x41')](_0x5051b2['query'][_0xa66f('0x41')]));_0x17d942['attributes']=_0x17d942[_0xa66f('0x42')][_0xa66f('0x43')]?_0x17d942[_0xa66f('0x42')]:_0x23a546[_0xa66f('0x3c')];if(!_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x44')](_0xa66f('0x45'))){_0x17d942['limit']=qs[_0xa66f('0x1e')](_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x1e')]);_0x17d942[_0xa66f('0x1c')]=qs[_0xa66f('0x1c')](_0x5051b2['query']['offset']);}_0x17d942[_0xa66f('0x46')]=qs[_0xa66f('0x47')](_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x47')]);_0x17d942[_0xa66f('0x48')]=qs[_0xa66f('0x3f')](_['pick'](_0x5051b2[_0xa66f('0x3d')],_0x23a546[_0xa66f('0x3f')]),_0xd65c5d);var _0x3f9cdd=[];var _0x5651e9=squel['select']()[_0xa66f('0x49')]('id')[_0xa66f('0x49')](_0xa66f('0x28'))['field']('color')['from'](_0xa66f('0x4a'));var _0x35e477=squel[_0xa66f('0x4b')]()[_0xa66f('0x49')](_0xa66f('0x4c'))[_0xa66f('0x49')](_0xa66f('0x4d'))[_0xa66f('0x49')]('ui.WhatsappInteractionId')[_0xa66f('0x4e')](_0xa66f('0x4f'),'ui')[_0xa66f('0x50')](_0xa66f('0x51'),'u',_0xa66f('0x52'));var _0x33cdc7=squel['select']()[_0xa66f('0x4e')](_0xa66f('0x53'),'i')[_0xa66f('0x50')](_0xa66f('0x54'),'c',_0xa66f('0x55'))['left_join'](_0xa66f('0x51'),'o','o.id\x20=\x20i.UserId')[_0xa66f('0x50')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0xa66f('0x50')](_0xa66f('0x56'),'me',_0xa66f('0x57'))[_0xa66f('0x50')](_0xa66f('0x58'),'it',_0xa66f('0x59'))['left_join'](_0xa66f('0x4a'),'t',_0xa66f('0x5a'));var _0x1da406=squel[_0xa66f('0x5b')]();var _0x52550c=[];var _0x1a81c4=squel['expr']();var _0x8247aa;if(_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x5c')]){_0x8247aa=as[_0xa66f('0x5d')](_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x5c')]);var _0x44ea10=_0x8247aa['sqlOperator'];for(var _0x2ab3c8=0x0;_0x2ab3c8<_0x8247aa[_0xa66f('0x5e')][_0xa66f('0x43')];_0x2ab3c8++){var _0x2afbcf=_0x8247aa[_0xa66f('0x5e')][_0x2ab3c8];var _0x45989a='i';var _0x495261=_[_0xa66f('0x5f')](_0xd65c5d,[_0xa66f('0x28'),_0x2afbcf['field']]);if(!_0x495261){switch(_0x2afbcf['field']){case _0xa66f('0x60'):if(_0x2afbcf[_0xa66f('0x61')]==0x1){_0x33cdc7[_0xa66f('0x62')]('`'+_0x2afbcf[_0xa66f('0x49')]+_0xa66f('0x63'));}else{_0x33cdc7[_0xa66f('0x62')]('`'+_0x2afbcf[_0xa66f('0x49')]+'`\x20>\x200');}break;case _0xa66f('0x64'):if(_0x2afbcf[_0xa66f('0x65')]===_0xa66f('0x66')){if(_0x2afbcf[_0xa66f('0x61')]['split']('\x20')[_0xa66f('0x43')]>0x1){_0x1da406[_0x44ea10](_0xa66f('0x67'),qs[_0xa66f('0x68')](_0x2afbcf[_0xa66f('0x61')]),null);}else{var _0x19f4b5='%'+_0x2afbcf[_0xa66f('0x61')]+'%';_0x1da406[_0x44ea10]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x19f4b5,_0x19f4b5,_0x19f4b5);}}else{_0x495261=_['find'](_0xd65c5d,[_0xa66f('0x28'),_0xa66f('0x69')]);_0x2afbcf[_0xa66f('0x49')]='ContactId';_0xb9e1b7=as[_0xa66f('0x6a')](_0x45989a,_0x495261[_0xa66f('0x3a')],_0x2afbcf);_0x1da406[_0x44ea10](_0xb9e1b7[_0xa66f('0x6b')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x6c')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x25')]);}break;case _0xa66f('0x6d'):var _0x3b8428=_0x2afbcf['value'][_0xa66f('0x2d')](',')[_0xa66f('0x36')](function(_0x235e4f){return Number(_0x235e4f);});_0x3b8428[_0xa66f('0x6e')](function(_0x4565f5){_0x1a81c4['or'](_0xa66f('0x6f'),'%,'+_0x4565f5+',%');});_0x52550c=_[_0xa66f('0x70')](_0x52550c,_0x3b8428);break;case _0xa66f('0x71'):if(_0x2afbcf['operator']==='$substring'){_0x1da406[_0x44ea10](_0xa66f('0x72'),'%'+_0x2afbcf[_0xa66f('0x61')]+'%',null);}else{_0x495261=_[_0xa66f('0x5f')](_0xd65c5d,[_0xa66f('0x28'),_0xa66f('0x34')]);_0x2afbcf['field']=_0xa66f('0x34');_0xb9e1b7=as['buildExpression'](_0x45989a,_0x495261[_0xa66f('0x3a')],_0x2afbcf);_0x1da406[_0x44ea10](_0xb9e1b7[_0xa66f('0x6b')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x6c')],_0xb9e1b7['value'][_0xa66f('0x25')]);}break;case _0xa66f('0x73'):_0xb9e1b7=as[_0xa66f('0x6a')]('me',null,_0x2afbcf);_0x1da406[_0x44ea10](_0xb9e1b7[_0xa66f('0x6b')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x6c')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x25')]);break;}}else{var _0xb9e1b7=as[_0xa66f('0x6a')](_0x45989a,_0x495261[_0xa66f('0x3a')],_0x2afbcf);_0x1da406[_0x44ea10](_0xb9e1b7[_0xa66f('0x6b')],_0xb9e1b7['value'][_0xa66f('0x6c')],_0xb9e1b7[_0xa66f('0x61')][_0xa66f('0x25')]);}}}else{var _0x29faa9=_(_0x5051b2[_0xa66f('0x3d')])[_0xa66f('0x3e')]()[_0xa66f('0x36')](function(_0x68bd43){return _['some'](_0xd65c5d,[_0xa66f('0x28'),_0x68bd43])?_0x68bd43:undefined;})[_0xa66f('0x74')]()[_0xa66f('0x61')]();if(!_[_0xa66f('0x75')](_0x29faa9)){_0x29faa9[_0xa66f('0x6e')](function(_0x1436f2){if(_0x1436f2===_0xa66f('0x76')){_0x33cdc7[_0xa66f('0x48')]('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x5051b2[_0xa66f('0x3d')][_0x1436f2]));}else if(_0x1436f2===_0xa66f('0x77')){var _0x34a590=JSON['parse'](_0x5051b2['query'][_0x1436f2])[_0xa66f('0x78')];var _0x421290=JSON[_0xa66f('0x79')](_0x5051b2[_0xa66f('0x3d')][_0x1436f2])['$lte'];_0x33cdc7[_0xa66f('0x48')](_0xa66f('0x7a'),_0x34a590,_0x421290);}else{if(_0x5051b2[_0xa66f('0x3d')][_0x1436f2]===_0xa66f('0x7b')){_0x33cdc7[_0xa66f('0x48')]('i.'+_0x1436f2+_0xa66f('0x7c'));}else{_0x33cdc7[_0xa66f('0x48')]('i.'+_0x1436f2+_0xa66f('0x7d'),_0x5051b2['query'][_0x1436f2]);}}});}if(_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x7e')]){if(_0x5051b2['query']['read']==0x1){_0x33cdc7[_0xa66f('0x62')](_0xa66f('0x7f'));}else{_0x33cdc7['having'](_0xa66f('0x80'));}}if(_0x5051b2['query'][_0xa66f('0x81')]){_0x52550c=_['isArray'](_0x5051b2['query']['tag'])?_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x81')]:new Array(_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x81')]);_0x52550c[_0xa66f('0x6e')](function(_0xe4661d){_0x1a81c4['or'](_0xa66f('0x6f'),'%,'+_0xe4661d+',%');});}if(_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x82')]){var _0x17f924=_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x82')][_0xa66f('0x83')]('\x5c','\x5c\x5c')[_0xa66f('0x83')](/'/g,'\x27\x27');if(qs[_0xa66f('0x84')](_0x17f924)){_0x1da406['or'](_0xa66f('0x85'),_0x17f924+'%')['or']('i.phone\x20LIKE\x20?',_0x17f924+'%');}else{_0x1da406['or'](_0xa66f('0x86'),qs['getFullTextValue'](_0x17f924))['or'](_0xa66f('0x87'),_0x17f924+'%');}}}_0x33cdc7['where'](_0x1da406);_0x33cdc7[_0xa66f('0x88')](_0xa66f('0x89'));var _0x2bb4e5={'type':db['Sequelize']['QueryTypes'][_0xa66f('0x8a')],'raw':!![]};var _0x30bbee=_0x33cdc7[_0xa66f('0x8b')]();_0x30bbee[_0xa66f('0x49')](_0xa66f('0x89'));_0x30bbee[_0xa66f('0x49')](_0xa66f('0x8c'),'unreadMessages');if(_0x17d942[_0xa66f('0x46')]){_0x17d942[_0xa66f('0x46')][_0xa66f('0x6e')](function(_0x4426d2){var _0x2fccec=_0x4426d2[0x0]===_0xa66f('0x8d')?_0x4426d2[0x0]:'i.'+_0x4426d2[0x0];_0x33cdc7[_0xa66f('0x46')](_0x2fccec,_0x4426d2[0x1]===_0xa66f('0x8e')?![]:!![]);});}if(!_[_0xa66f('0x75')](_0x52550c)){_0x33cdc7[_0xa66f('0x62')](_0x1a81c4);_0x30bbee[_0xa66f('0x48')](_0xa66f('0x8f'),_0x52550c);}BPromise[_0xa66f('0x90')]()['then'](function(){if(!_0x8247aa){if(_0x5051b2[_0xa66f('0x3d')][_0xa66f('0x76')])return;_0x30bbee[_0xa66f('0x48')](_0xa66f('0x91'));_0x33cdc7[_0xa66f('0x48')](_0xa66f('0x91'));return;}if(_0x5051b2[_0xa66f('0x92')][_0xa66f('0x93')]!==_0xa66f('0x94'))return;return _0x5051b2['user'][_0xa66f('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x57a828){if(_['isEmpty'](_0x57a828)){_0x30bbee[_0xa66f('0x48')]('i.WhatsappAccountId\x20IS\x20NULL');_0x33cdc7[_0xa66f('0x48')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x30bbee[_0xa66f('0x48')](_0xa66f('0x96'),_[_0xa66f('0x36')](_0x57a828,'id'));_0x33cdc7[_0xa66f('0x48')](_0xa66f('0x96'),_[_0xa66f('0x36')](_0x57a828,'id'));}});})['then'](function(){if(_0x5051b2[_0xa66f('0x92')][_0xa66f('0x93')]===_0xa66f('0x94')&&!_0x8247aa&&!_0x5051b2['query'][_0xa66f('0x76')])return[];return db[_0xa66f('0x97')]['query'](_0x30bbee[_0xa66f('0x98')](),_0x2bb4e5);})[_0xa66f('0x24')](function(_0x5ee6d5){_0x1647a0['count']=_0x5ee6d5[_0xa66f('0x43')];if(_0x1647a0[_0xa66f('0x1f')]===0x0)return[];return db[_0xa66f('0x97')][_0xa66f('0x3d')](_0x5651e9[_0xa66f('0x98')](),_0x2bb4e5)['then'](function(_0x3aaf96){_0x3f9cdd=_[_0xa66f('0x99')](_0x3aaf96,'id');_0x2bb4e5=_['merge'](_0x2bb4e5,{'model':db[_0xa66f('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5051b2[_0xa66f('0x3d')]['fields']){_0x17d942[_0xa66f('0x42')][_0xa66f('0x6e')](function(_0x2c4c43){_0x33cdc7[_0xa66f('0x49')]('i.'+_0x2c4c43);});}else{_0x33cdc7[_0xa66f('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x60'));_0x33cdc7[_0xa66f('0x49')](_0xa66f('0x9a'),_0xa66f('0x9b'));_0x33cdc7[_0xa66f('0x49')](_0xa66f('0x9c'),'Account.mandatoryDisposition');_0x33cdc7[_0xa66f('0x49')](_0xa66f('0x9d'),_0xa66f('0x8d'));_0x33cdc7[_0xa66f('0x49')](_0xa66f('0x9e'));_0x33cdc7[_0xa66f('0x49')](_0xa66f('0x9f'),'Contact.firstName');_0x33cdc7['field'](_0xa66f('0xa0'),'Contact.lastName');_0x33cdc7[_0xa66f('0x49')](_0xa66f('0xa1'),'Contact.email');_0x33cdc7[_0xa66f('0x49')](_0xa66f('0xa2'),_0xa66f('0xa3'));_0x33cdc7['field']('c.mobile',_0xa66f('0xa4'));_0x33cdc7['field'](_0xa66f('0xa5'),_0xa66f('0xa6'));_0x33cdc7[_0xa66f('0x49')]('o.fullname',_0xa66f('0xa7'));_0x33cdc7['field'](_0xa66f('0xa8'),_0xa66f('0xa9'));_0x33cdc7[_0xa66f('0x49')](_0xa66f('0xaa'),'TagIds');}if(_0x17d942[_0xa66f('0x1e')])_0x33cdc7[_0xa66f('0x1e')](_0x17d942[_0xa66f('0x1e')]);if(_0x17d942[_0xa66f('0x1c')])_0x33cdc7[_0xa66f('0x1c')](_0x17d942[_0xa66f('0x1c')]);return db['sequelize'][_0xa66f('0x3d')](_0x33cdc7[_0xa66f('0x98')](),_0x2bb4e5);})[_0xa66f('0x24')](function(_0x2a893e){if(_0x2a893e[_0xa66f('0x43')]>0x0)_0x35e477['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0xa66f('0x36')](_0x2a893e,'id'));return db[_0xa66f('0x97')][_0xa66f('0x3d')](_0x35e477[_0xa66f('0x98')](),_0x2bb4e5)[_0xa66f('0x24')](function(_0x3285c6){var _0x21124e=_[_0xa66f('0xab')](_0x3285c6,_0xa66f('0xac'));var _0x1704e3=[];_0x2a893e[_0xa66f('0x6e')](function(_0x3fdabb){_0x1704e3['push'](updateWhatsappInteraction(_0x3fdabb,_0x3f9cdd,_0x21124e));});return BPromise[_0xa66f('0xad')](_0x1704e3);});});})[_0xa66f('0x24')](function(_0x55af2c){_0x1647a0[_0xa66f('0xae')]=_0x55af2c;return _0x1647a0;})[_0xa66f('0x24')](respondWithFilteredResult(_0x8965d3,_0x17d942))[_0xa66f('0x2e')](handleError(_0x8965d3,null));};exports['show']=function(_0x4fe5e1,_0x1de4df){var _0x5f4e48={'raw':![],'where':{'id':_0x4fe5e1[_0xa66f('0xaf')]['id']}},_0x3520e1={};_0x3520e1['model']=_[_0xa66f('0x3e')](db[_0xa66f('0x37')]['rawAttributes']);_0x3520e1[_0xa66f('0x3d')]=_[_0xa66f('0x3e')](_0x4fe5e1[_0xa66f('0x3d')]);_0x3520e1[_0xa66f('0x3f')]=_['intersection'](_0x3520e1['model'],_0x3520e1[_0xa66f('0x3d')]);_0x5f4e48[_0xa66f('0x42')]=_[_0xa66f('0x40')](_0x3520e1[_0xa66f('0x3c')],qs[_0xa66f('0x41')](_0x4fe5e1[_0xa66f('0x3d')][_0xa66f('0x41')]));_0x5f4e48[_0xa66f('0x42')]=_0x5f4e48[_0xa66f('0x42')][_0xa66f('0x43')]?_0x5f4e48['attributes']:_0x3520e1['model'];if(_0x4fe5e1[_0xa66f('0x3d')][_0xa66f('0xb0')]){_0x5f4e48[_0xa66f('0xb1')]=[{'all':!![]}];}_0x5f4e48=_[_0xa66f('0xb2')]({},_0x5f4e48,_0x4fe5e1[_0xa66f('0xb3')]);return db['WhatsappInteraction'][_0xa66f('0x5f')](_0x5f4e48)[_0xa66f('0x24')](handleEntityNotFound(_0x1de4df,null))[_0xa66f('0x24')](respondWithResult(_0x1de4df,null))['catch'](handleError(_0x1de4df,null));};exports['create']=function(_0x4e0c21,_0x22443e){return db['WhatsappInteraction'][_0xa66f('0xb4')](_0x4e0c21[_0xa66f('0x73')],{})[_0xa66f('0x24')](respondWithResult(_0x22443e,0xc9))[_0xa66f('0x2e')](handleError(_0x22443e,null));};exports['update']=function(_0xbf5668,_0x25b0f8){if(_0xbf5668['body']['id']){delete _0xbf5668[_0xa66f('0x73')]['id'];}return db[_0xa66f('0x37')]['find']({'where':{'id':_0xbf5668['params']['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0x25b0f8,null))[_0xa66f('0x24')](saveUpdates(_0xbf5668[_0xa66f('0x73')],null))['then'](respondWithResult(_0x25b0f8,null))['catch'](handleError(_0x25b0f8,null));};exports['destroy']=function(_0x5d4202,_0xb6b51b){return db[_0xa66f('0x37')][_0xa66f('0x5f')]({'where':{'id':_0x5d4202[_0xa66f('0xaf')]['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0xb6b51b,null))[_0xa66f('0x24')](removeEntity(_0xb6b51b,null))['catch'](handleError(_0xb6b51b,null));};exports[_0xa66f('0xb5')]=function(_0x41e8ee,_0x31b0b4){return db[_0xa66f('0x37')]['describe']()['then'](respondWithResult(_0x31b0b4,null))[_0xa66f('0x2e')](handleError(_0x31b0b4,null));};exports[_0xa66f('0xb6')]=function(_0x44e159,_0x1957d4,_0x10e0fd){return db[_0xa66f('0xb7')][_0xa66f('0x5f')]({'where':{'id':_0x44e159[_0xa66f('0xaf')]['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0x1957d4,null))[_0xa66f('0x24')](function(_0x5e0b36){if(_0x5e0b36){return _0x5e0b36['addMessage'](_0x44e159[_0xa66f('0x73')]['ids'],_[_0xa66f('0xb8')](_0x44e159[_0xa66f('0x73')],[_0xa66f('0xb9'),'id'])||{});}})[_0xa66f('0x24')](respondWithResult(_0x1957d4,null))[_0xa66f('0x2e')](handleError(_0x1957d4,null));};exports['getMessages']=function(_0x5bb734,_0x599762,_0x484c8e){var _0x728faa={'raw':![],'where':{}};var _0x4760b3={};var _0x2f1806={'count':0x0,'rows':[]};return db[_0xa66f('0x37')]['findOne']({'where':{'id':_0x5bb734[_0xa66f('0xaf')]['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0x599762,null))['then'](function(_0x348e6b){if(_0x348e6b){_0x4760b3[_0xa66f('0x3c')]=_['keys'](db[_0xa66f('0xb7')][_0xa66f('0x38')]);_0x4760b3['query']=_[_0xa66f('0x3e')](_0x5bb734[_0xa66f('0x3d')]);_0x4760b3[_0xa66f('0x3f')]=_[_0xa66f('0x40')](_0x4760b3[_0xa66f('0x3c')],_0x4760b3[_0xa66f('0x3d')]);_0x728faa[_0xa66f('0x42')]=_[_0xa66f('0x40')](_0x4760b3[_0xa66f('0x3c')],qs[_0xa66f('0x41')](_0x5bb734[_0xa66f('0x3d')]['fields']));_0x728faa['attributes']=_0x728faa[_0xa66f('0x42')][_0xa66f('0x43')]?_0x728faa[_0xa66f('0x42')]:_0x4760b3['model'];if(!_0x5bb734['query'][_0xa66f('0x44')](_0xa66f('0x45'))){_0x728faa[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x5bb734[_0xa66f('0x3d')]['limit']);_0x728faa[_0xa66f('0x1c')]=qs[_0xa66f('0x1c')](_0x5bb734[_0xa66f('0x3d')][_0xa66f('0x1c')]);}_0x728faa['order']=qs[_0xa66f('0x47')](_0x5bb734[_0xa66f('0x3d')]['sort']);_0x728faa[_0xa66f('0x48')]=qs[_0xa66f('0x3f')](_['pick'](_0x5bb734[_0xa66f('0x3d')],_0x4760b3[_0xa66f('0x3f')]));_0x728faa[_0xa66f('0x48')][_0xa66f('0xac')]=_0x348e6b['id'];if(_0x5bb734[_0xa66f('0x3d')][_0xa66f('0x82')]){_0x728faa[_0xa66f('0x48')]=_['merge'](_0x728faa['where'],{'$or':_[_0xa66f('0x36')](_0x728faa[_0xa66f('0x42')],function(_0x2e7c26){var _0x3eea20={};_0x3eea20[_0x2e7c26]={'$like':'%'+_0x5bb734[_0xa66f('0x3d')]['filter']+'%'};return _0x3eea20;})});}if(_0x5bb734[_0xa66f('0x3d')][_0xa66f('0x78')]){var _0x515950=_0x5bb734[_0xa66f('0x3d')]['$gte'][_0xa66f('0x2d')](',');var _0x807b56={};_0x807b56[_0x515950[0x0]]={'$gte':moment(_0x515950[0x1])[_0xa66f('0xba')](_0xa66f('0xbb'))};_0x728faa['where']=_['merge'](_0x728faa['where'],_0x807b56);}_0x728faa=_[_0xa66f('0xb2')]({},_0x728faa,_0x5bb734['options']);return db[_0xa66f('0xb7')]['count']({'where':_0x728faa[_0xa66f('0x48')]})[_0xa66f('0x24')](function(_0x5628b4){_0x2f1806[_0xa66f('0x1f')]=_0x5628b4;if(_0x5bb734[_0xa66f('0x3d')][_0xa66f('0xb0')]){_0x728faa[_0xa66f('0xb1')]=[{'all':!![]}];}return db[_0xa66f('0xb7')][_0xa66f('0xbc')](_0x728faa);})[_0xa66f('0x24')](function(_0x4e6a80){_0x2f1806[_0xa66f('0xae')]=_0x4e6a80;return _0x2f1806;});}})[_0xa66f('0x24')](respondWithFilteredResult(_0x599762,_0x728faa))[_0xa66f('0x2e')](handleError(_0x599762,null));};exports[_0xa66f('0xbd')]=function(_0x2d15f2,_0x993242,_0x5eaf21){return db[_0xa66f('0x37')][_0xa66f('0x5f')]({'where':{'id':_0x2d15f2['params']['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0x993242,null))['then'](function(_0x38ff67){if(_0x38ff67){return _0x38ff67[_0xa66f('0xbe')](_0x2d15f2[_0xa66f('0x73')][_0xa66f('0xb9')],_[_0xa66f('0xb8')](_0x2d15f2['body'],[_0xa66f('0xb9'),'id'])||{})[_0xa66f('0xbf')](function(){return db[_0xa66f('0x6d')][_0xa66f('0xbc')]({'attributes':['id','name','color'],'where':{'id':_0x2d15f2['body'][_0xa66f('0xb9')]}});})[_0xa66f('0x24')](function(_0x4be9ae){socket['emit'](_0xa66f('0xc0'),{'id':Number(_0x2d15f2[_0xa66f('0xaf')]['id']),'tags':_0x4be9ae||[]});return{'id':Number(_0x2d15f2['params']['id']),'tags':_0x4be9ae||[]};});}})[_0xa66f('0x24')](respondWithResult(_0x993242,null))[_0xa66f('0x2e')](handleError(_0x993242,null));};exports[_0xa66f('0xc1')]=function(_0x3366e5,_0x551c09,_0x4c2bf9){return db['WhatsappInteraction'][_0xa66f('0x5f')]({'where':{'id':_0x3366e5[_0xa66f('0xaf')]['id']}})[_0xa66f('0x24')](handleEntityNotFound(_0x551c09,null))[_0xa66f('0x24')](function(_0x377764){if(_0x377764){return _0x377764[_0xa66f('0xc1')](_0x3366e5[_0xa66f('0x3d')][_0xa66f('0xb9')]);}})['then'](respondWithStatusCode(_0x551c09,null))[_0xa66f('0x2e')](handleError(_0x551c09,null));};exports[_0xa66f('0xc2')]=function(_0x262dc8,_0x5a9bd6){var _0x29e4d8=moment()[_0xa66f('0xc3')]()[_0xa66f('0x98')]();var _0x578834=path['join'](config[_0xa66f('0xc4')],_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'));var _0x5cebe0=path[_0xa66f('0xc8')](config[_0xa66f('0xc4')],'server',_0xa66f('0xc6'),'attachments');var _0x3fc9a3=path[_0xa66f('0xc8')](_0x578834,_0x29e4d8);var _0x2087cb=util[_0xa66f('0xba')](_0xa66f('0xc9'),_0x262dc8[_0xa66f('0xaf')]['id'],_0x29e4d8);var _0x241a75=path[_0xa66f('0xc8')](_0x578834,_0x2087cb);var _0x1deff4=[];_0x1deff4[_0xa66f('0xca')]({'model':db[_0xa66f('0x71')],'as':_0xa66f('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x1deff4['push']({'model':db[_0xa66f('0xcb')],'as':_0xa66f('0x64'),'attributes':['id',_0xa66f('0xcc'),_0xa66f('0xcd')],'raw':!![]});if(_0x262dc8[_0xa66f('0x3d')][_0xa66f('0xce')]){_0x1deff4['push']({'model':db[_0xa66f('0xcf')],'as':'Attachment','raw':!![]});}var _0x48c066=[{'model':db[_0xa66f('0xb7')],'as':_0xa66f('0xd0'),'attributes':['id',_0xa66f('0x73'),_0xa66f('0x77'),'direction',_0xa66f('0xd1'),_0xa66f('0x7e')],'include':_0x1deff4}];_0x48c066[_0xa66f('0xca')]({'model':db[_0xa66f('0xd2')],'as':_0xa66f('0xd3'),'attributes':['id','name']});_0x48c066['push']({'model':db[_0xa66f('0x71')],'as':_0xa66f('0xd4'),'attributes':['id',_0xa66f('0x2a')]});return db[_0xa66f('0x37')]['find']({'where':{'id':_0x262dc8[_0xa66f('0xaf')]['id']},'include':_0x48c066})[_0xa66f('0x24')](handleEntityNotFound(_0x5a9bd6,null))[_0xa66f('0x24')](function(_0x34123e){if(_0x34123e){var _0x28d6b7=_0x34123e[_0xa66f('0xd5')]({'plain':!![]});fs[_0xa66f('0xd6')](_0x3fc9a3);var _0x131e6f={'channel':'Whatsapp','account':_0x28d6b7[_0xa66f('0xd3')][_0xa66f('0x28')],'agent':_0x28d6b7['Owner']?_0x28d6b7[_0xa66f('0xd4')][_0xa66f('0x2a')]:_0xa66f('0xd7'),'createdAt':moment(_0x28d6b7[_0xa66f('0x77')])[_0xa66f('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0x98')](),'closedAt':_0x28d6b7[_0xa66f('0x33')]?moment(_0x28d6b7[_0xa66f('0xd8')])[_0xa66f('0xba')](_0xa66f('0xbb'))['toString']():'','disposition':_0x28d6b7[_0xa66f('0xd9')],'messages':_(_0x28d6b7[_0xa66f('0xd0')])['filter']({'secret':![]})[_0xa66f('0x36')](function(_0x3f542a){if(_0x3f542a[_0xa66f('0xcf')]){var _0x31959f=path[_0xa66f('0xc8')](_0x5cebe0,_0x3f542a['Attachment'][_0xa66f('0xda')]);if(fs[_0xa66f('0xdb')](_0x31959f)){fs[_0xa66f('0xdc')](_0x31959f)[_0xa66f('0xdd')](fs['createWriteStream'](path[_0xa66f('0xc8')](_0x3fc9a3,_0x3f542a[_0xa66f('0xcf')]['basename'])));}}return{'date':moment(_0x3f542a[_0xa66f('0x77')])[_0xa66f('0xba')](_0xa66f('0xbb'))[_0xa66f('0x98')](),'sender':_0x3f542a['direction']===_0xa66f('0xde')?_0x3f542a[_0xa66f('0x71')]?_0x3f542a['User'][_0xa66f('0x2a')]:_0xa66f('0xdf'):_0x3f542a[_0xa66f('0x64')]['firstName']+(_0x3f542a[_0xa66f('0x64')][_0xa66f('0xcd')]?'\x20'+_0x3f542a[_0xa66f('0x64')]['lastName']:''),'body':_0x3f542a[_0xa66f('0xcf')]?_0x3f542a[_0xa66f('0xcf')]['basename']:_0x3f542a['body'],'direction':_0x3f542a[_0xa66f('0xe0')]===_0xa66f('0xde')?'A':'C','secret':_0x3f542a['secret'],'read':_0x3f542a[_0xa66f('0x7e')],'attachment':_0x3f542a[_0xa66f('0xcf')]};})[_0xa66f('0x61')]()};return ejs[_0xa66f('0xe1')](path[_0xa66f('0xc8')](config['root'],_0xa66f('0xc5'),_0xa66f('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x131e6f})[_0xa66f('0x24')](function(_0x553165){var _0x506797=path[_0xa66f('0xc8')](_0x3fc9a3,_0xa66f('0xe3')+_0x28d6b7['id']+'-'+_0x29e4d8+'.pdf');var _0x129ebd={'path':_0x506797,'channel':'Whatsapp','interactionId':_0x28d6b7['id']};return pdf[_0xa66f('0xe4')](_0x553165,_0x129ebd);})[_0xa66f('0x24')](function(){return new BPromise(function(_0x49553c,_0x4871d0){zipdir(_0x3fc9a3,{'saveTo':_0x241a75},function(_0x4a99c7,_0x3cb7cb){if(_0x4a99c7)return _0x4871d0(_0x4a99c7);return _0x49553c(_0x3cb7cb);});})[_0xa66f('0x24')](function(){return new BPromise(function(_0x158319,_0x35d346){rimraf(_0x3fc9a3,function(_0x168d31){if(_0x168d31)_0x35d346(_0x168d31);return _0x158319();});});})[_0xa66f('0x24')](function(){return _0x5a9bd6[_0xa66f('0xc2')](_0x241a75,_0x2087cb,function(_0x5a762d){if(_0x5a762d){console['log'](_0xa66f('0xe5'),_0x5a762d);}else{fs[_0xa66f('0xe6')](_0x241a75);}});});});}else{return _0x5a9bd6[_0xa66f('0x19')](0xc8);}})[_0xa66f('0x2e')](handleError(_0x5a9bd6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 989789d..bc8235a 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 _0x0427=['update','remove','getUsers','then','setDataValue','Users','map','findAll','catch','hook','exports','WhatsappInteraction','../../mysqldb','setMaxListeners','save'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0427,0x137));var _0x7042=function(_0x2e1d9e,_0x32e611){_0x2e1d9e=_0x2e1d9e-0x0;var _0x43a597=_0x0427[_0x2e1d9e];return _0x43a597;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x7042('0x0')];var WhatsappMessage=require(_0x7042('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7042('0x2')](0x0);var events={'afterCreate':_0x7042('0x3'),'afterUpdate':_0x7042('0x4'),'afterDestroy':_0x7042('0x5')};function emitEvent(_0xa72963){return function(_0x343a69,_0x2c7c32,_0x53ab81){_0x343a69[_0x7042('0x6')]({'attributes':['id'],'raw':!![]})[_0x7042('0x7')](function(_0x25c552){_0x343a69[_0x7042('0x8')](_0x7042('0x9'),_0x25c552[_0x7042('0xa')](function(_0x40caa9){return{'id':_0x40caa9['id']};}));return WhatsappMessage[_0x7042('0xb')]({'where':{'WhatsappInteractionId':_0x343a69['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7042('0x7')](function(_0x5a29aa){_0x343a69[_0x7042('0x8')]('unreadMessages',_0x5a29aa['length']);WhatsappInteractionEvents['emit'](_0xa72963+':'+_0x343a69['id'],_0x343a69);WhatsappInteractionEvents['emit'](_0xa72963,_0x343a69);_0x53ab81(null);})[_0x7042('0xc')](_0x53ab81(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x7042('0xd')](e,emitEvent(event));}}module[_0x7042('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6584=['findAll','unreadMessages','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x21dd9b,_0x4c7c2a){var _0x141896=function(_0x280072){while(--_0x280072){_0x21dd9b['push'](_0x21dd9b['shift']());}};_0x141896(++_0x4c7c2a);}(_0x6584,0x175));var _0x4658=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x6584[_0x48d6a3];return _0x38bfa0;};'use strict';var EventEmitter=require(_0x4658('0x0'));var WhatsappInteraction=require(_0x4658('0x1'))['db'][_0x4658('0x2')];var WhatsappMessage=require(_0x4658('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4658('0x3')](0x0);var events={'afterCreate':_0x4658('0x4'),'afterUpdate':_0x4658('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53a2eb){return function(_0x15fbf2,_0x126301,_0x253182){_0x15fbf2[_0x4658('0x6')]({'attributes':['id'],'raw':!![]})[_0x4658('0x7')](function(_0x56c592){_0x15fbf2[_0x4658('0x8')](_0x4658('0x9'),_0x56c592[_0x4658('0xa')](function(_0x51d3f4){return{'id':_0x51d3f4['id']};}));return WhatsappMessage[_0x4658('0xb')]({'where':{'WhatsappInteractionId':_0x15fbf2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4658('0x7')](function(_0x570ef0){_0x15fbf2['setDataValue'](_0x4658('0xc'),_0x570ef0['length']);WhatsappInteractionEvents[_0x4658('0xd')](_0x53a2eb+':'+_0x15fbf2['id'],_0x15fbf2);WhatsappInteractionEvents['emit'](_0x53a2eb,_0x15fbf2);_0x253182(null);})[_0x4658('0xe')](_0x253182(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x4658('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 54733e9..e21086d 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 _0x0803=['whatsapp_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0x0803,0xe9));var _0x3080=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0803[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3080('0x0'));var util=require('util');var logger=require(_0x3080('0x1'))('api');var moment=require(_0x3080('0x2'));var BPromise=require(_0x3080('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3080('0x4'));var rimraf=require(_0x3080('0x5'));var config=require('../../config/environment');var attributes=require(_0x3080('0x6'));module[_0x3080('0x7')]=function(_0x49a737,_0x5041a7){return _0x49a737['define'](_0x3080('0x8'),attributes,{'tableName':_0x3080('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5cb7cf,_0x3f577e,_0x338464){if(_0x5cb7cf['changed']('closed')){_0x5cb7cf['closedAt']=moment()['format'](_0x3080('0xa'));}_0x338464(null,_0x5cb7cf);}}});}; \ No newline at end of file +var _0x761c=['../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x480f2c,_0x421a75){var _0x301ad8=function(_0x5ec81b){while(--_0x5ec81b){_0x480f2c['push'](_0x480f2c['shift']());}};_0x301ad8(++_0x421a75);}(_0x761c,0x18a));var _0xc761=function(_0x2f0318,_0xc043cb){_0x2f0318=_0x2f0318-0x0;var _0x82af8b=_0x761c[_0x2f0318];return _0x82af8b;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var logger=require(_0xc761('0x1'))(_0xc761('0x2'));var moment=require('moment');var BPromise=require(_0xc761('0x3'));var rp=require(_0xc761('0x4'));var fs=require('fs');var path=require(_0xc761('0x5'));var rimraf=require('rimraf');var config=require(_0xc761('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0xc761('0x7')]=function(_0x468f51,_0x23ba0b){return _0x468f51[_0xc761('0x8')](_0xc761('0x9'),attributes,{'tableName':_0xc761('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e882,_0x507772,_0x3bdf6f){if(_0x46e882[_0xc761('0xb')](_0xc761('0xc'))){_0x46e882[_0xc761('0xd')]=moment()[_0xc761('0xe')](_0xc761('0xf'));}_0x3bdf6f(null,_0x46e882);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ea0543a..1e72840 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 _0x7490=['socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','where','attributes','AddTagsToWhatsappInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x7490,0x71));var _0x0749=function(_0x23a3e0,_0x190036){_0x23a3e0=_0x23a3e0-0x0;var _0x3d2230=_0x7490[_0x23a3e0];return _0x3d2230;};'use strict';var _=require(_0x0749('0x0'));var util=require(_0x0749('0x1'));var moment=require(_0x0749('0x2'));var BPromise=require(_0x0749('0x3'));var rs=require(_0x0749('0x4'));var fs=require('fs');var Redis=require(_0x0749('0x5'));var db=require(_0x0749('0x6'))['db'];var utils=require(_0x0749('0x7'));var logger=require(_0x0749('0x8'))(_0x0749('0x9'));var config=require('../../config/environment');var jayson=require(_0x0749('0xa'));var client=jayson[_0x0749('0xb')][_0x0749('0xc')]({'port':0x232a});config[_0x0749('0xd')]=_[_0x0749('0xe')](config[_0x0749('0xd')],{'host':_0x0749('0xf'),'port':0x18eb});var socket=require(_0x0749('0x10'))(new Redis(config[_0x0749('0xd')]));require(_0x0749('0x11'))[_0x0749('0x12')](socket);function respondWithRpcPromise(_0x69c49d,_0x42e91a,_0x159131){return new BPromise(function(_0x3e6fe2,_0x994cfc){return client['request'](_0x69c49d,_0x159131)['then'](function(_0x4272d4){logger[_0x0749('0x13')](_0x0749('0x14'),_0x42e91a,'request\x20sent');logger[_0x0749('0x15')](_0x0749('0x16'),_0x42e91a,'request\x20sent',JSON[_0x0749('0x17')](_0x4272d4));if(_0x4272d4['error']){if(_0x4272d4['error']['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x42e91a,_0x4272d4[_0x0749('0x18')][_0x0749('0x19')]);return _0x994cfc(_0x4272d4[_0x0749('0x18')]['message']);}logger[_0x0749('0x18')](_0x0749('0x14'),_0x42e91a,_0x4272d4[_0x0749('0x18')][_0x0749('0x19')]);return _0x3e6fe2(_0x4272d4['error']['message']);}else{logger['info'](_0x0749('0x14'),_0x42e91a,_0x0749('0x1a'));_0x3e6fe2(_0x4272d4[_0x0749('0x1b')]['message']);}})[_0x0749('0x1c')](function(_0x5ddf6c){logger['error'](_0x0749('0x14'),_0x42e91a,_0x5ddf6c);_0x994cfc(_0x5ddf6c);});});}exports[_0x0749('0x1d')]=function(_0x2616f6){var _0x3db969=this;return new Promise(function(_0x47899d,_0xf4eefd){return db[_0x0749('0x1e')]['update'](_0x2616f6[_0x0749('0x1f')],{'raw':_0x2616f6[_0x0749('0x20')]?_0x2616f6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2616f6['options']?_0x2616f6['options'][_0x0749('0x21')]||null:null,'attributes':_0x2616f6[_0x0749('0x20')]?_0x2616f6[_0x0749('0x20')][_0x0749('0x22')]||null:null,'limit':_0x2616f6[_0x0749('0x20')]?_0x2616f6[_0x0749('0x20')]['limit']||null:null})['then'](function(_0x416ac1){logger['info'](_0x0749('0x1d'),_0x2616f6);logger[_0x0749('0x15')](_0x0749('0x1d'),_0x2616f6,JSON['stringify'](_0x416ac1));_0x47899d(_0x416ac1);})[_0x0749('0x1c')](function(_0x518d08){logger[_0x0749('0x18')]('UpdateWhatsappInteraction',_0x518d08['message'],_0x2616f6);_0xf4eefd(_0x3db969[_0x0749('0x18')](0x1f4,_0x518d08[_0x0749('0x19')]));});});};exports[_0x0749('0x23')]=function(_0x2533ea){return new Promise(function(_0x1c0a33,_0x313794){return db['WhatsappInteraction'][_0x0749('0x24')]({'where':_0x2533ea[_0x0749('0x20')]?_0x2533ea[_0x0749('0x20')]['where']||null:null})[_0x0749('0x25')](function(_0x30bf7d){if(_0x30bf7d){return _0x30bf7d[_0x0749('0x26')](_0x2533ea[_0x0749('0x1f')][_0x0749('0x27')],_[_0x0749('0x28')](_0x2533ea['body'],[_0x0749('0x27'),'id'])||{});}})[_0x0749('0x29')](function(_0x1f0b42){logger[_0x0749('0x13')](_0x0749('0x2a'),_0x2533ea);logger[_0x0749('0x15')](_0x0749('0x2a'),_0x2533ea,JSON[_0x0749('0x17')](_0x1f0b42));_0x1c0a33(_0x1f0b42);})['catch'](function(_0x5e8276){logger[_0x0749('0x18')](_0x0749('0x2a'),_0x5e8276[_0x0749('0x19')],_0x2533ea);_0x313794(_this[_0x0749('0x18')](0x1f4,_0x5e8276['message']));});});}; \ No newline at end of file +var _0x79e3=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToWhatsappInteraction','find','omit','ids','spread','AddTags'];(function(_0xc6cd9,_0x24938f){var _0x39ca4b=function(_0x454857){while(--_0x454857){_0xc6cd9['push'](_0xc6cd9['shift']());}};_0x39ca4b(++_0x24938f);}(_0x79e3,0xbe));var _0x379e=function(_0x4ad15a,_0x1acc2c){_0x4ad15a=_0x4ad15a-0x0;var _0x10e07e=_0x79e3[_0x4ad15a];return _0x10e07e;};'use strict';var _=require(_0x379e('0x0'));var util=require(_0x379e('0x1'));var moment=require('moment');var BPromise=require(_0x379e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x379e('0x3'))['db'];var utils=require(_0x379e('0x4'));var logger=require(_0x379e('0x5'))(_0x379e('0x6'));var config=require(_0x379e('0x7'));var jayson=require(_0x379e('0x8'));var client=jayson['client'][_0x379e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x379e('0xa')](socket);function respondWithRpcPromise(_0x93ae8b,_0x5ac022,_0xa06fd9){return new BPromise(function(_0xeb61d8,_0x40c8bf){return client[_0x379e('0xb')](_0x93ae8b,_0xa06fd9)[_0x379e('0xc')](function(_0x41e25e){logger['info'](_0x379e('0xd'),_0x5ac022,_0x379e('0xe'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5ac022,_0x379e('0xe'),JSON[_0x379e('0xf')](_0x41e25e));if(_0x41e25e[_0x379e('0x10')]){if(_0x41e25e['error'][_0x379e('0x11')]===0x1f4){logger['error'](_0x379e('0xd'),_0x5ac022,_0x41e25e[_0x379e('0x10')][_0x379e('0x12')]);return _0x40c8bf(_0x41e25e[_0x379e('0x10')][_0x379e('0x12')]);}logger[_0x379e('0x10')](_0x379e('0xd'),_0x5ac022,_0x41e25e[_0x379e('0x10')][_0x379e('0x12')]);return _0xeb61d8(_0x41e25e[_0x379e('0x10')][_0x379e('0x12')]);}else{logger[_0x379e('0x13')](_0x379e('0xd'),_0x5ac022,_0x379e('0xe'));_0xeb61d8(_0x41e25e[_0x379e('0x14')]['message']);}})[_0x379e('0x15')](function(_0x30b914){logger['error'](_0x379e('0xd'),_0x5ac022,_0x30b914);_0x40c8bf(_0x30b914);});});}exports[_0x379e('0x16')]=function(_0x282ae6){var _0x4035e7=this;return new Promise(function(_0xd49f97,_0x31a20e){return db[_0x379e('0x17')][_0x379e('0x18')](_0x282ae6[_0x379e('0x19')],{'raw':_0x282ae6[_0x379e('0x1a')]?_0x282ae6[_0x379e('0x1a')][_0x379e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x282ae6[_0x379e('0x1a')]?_0x282ae6[_0x379e('0x1a')][_0x379e('0x1c')]||null:null,'attributes':_0x282ae6[_0x379e('0x1a')]?_0x282ae6['options'][_0x379e('0x1d')]||null:null,'limit':_0x282ae6[_0x379e('0x1a')]?_0x282ae6[_0x379e('0x1a')][_0x379e('0x1e')]||null:null})[_0x379e('0xc')](function(_0x14112a){logger[_0x379e('0x13')](_0x379e('0x16'),_0x282ae6);logger[_0x379e('0x1f')](_0x379e('0x16'),_0x282ae6,JSON['stringify'](_0x14112a));_0xd49f97(_0x14112a);})['catch'](function(_0x767e61){logger['error'](_0x379e('0x16'),_0x767e61[_0x379e('0x12')],_0x282ae6);_0x31a20e(_0x4035e7[_0x379e('0x10')](0x1f4,_0x767e61[_0x379e('0x12')]));});});};exports[_0x379e('0x20')]=function(_0x3f3482){return new Promise(function(_0x47a176,_0x4962b4){return db[_0x379e('0x17')][_0x379e('0x21')]({'where':_0x3f3482[_0x379e('0x1a')]?_0x3f3482[_0x379e('0x1a')][_0x379e('0x1c')]||null:null})[_0x379e('0xc')](function(_0x43e173){if(_0x43e173){return _0x43e173['addTags'](_0x3f3482[_0x379e('0x19')]['ids'],_[_0x379e('0x22')](_0x3f3482[_0x379e('0x19')],[_0x379e('0x23'),'id'])||{});}})[_0x379e('0x24')](function(_0x3040bb){logger['info'](_0x379e('0x25'),_0x3f3482);logger[_0x379e('0x1f')](_0x379e('0x25'),_0x3f3482,JSON[_0x379e('0xf')](_0x3040bb));_0x47a176(_0x3040bb);})[_0x379e('0x15')](function(_0x123b5a){logger[_0x379e('0x10')](_0x379e('0x25'),_0x123b5a[_0x379e('0x12')],_0x3f3482);_0x4962b4(_this[_0x379e('0x10')](0x1f4,_0x123b5a[_0x379e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7026908..04b7d72 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 _0xcad3=['removeListener','register','length','./whatsappInteraction.events','remove','update','emit'];(function(_0x700428,_0x4b8500){var _0x19bbc4=function(_0x312b72){while(--_0x312b72){_0x700428['push'](_0x700428['shift']());}};_0x19bbc4(++_0x4b8500);}(_0xcad3,0x114));var _0x3cad=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0xcad3[_0x2351c4];return _0x1dd3f8;};'use strict';var WhatsappInteractionEvents=require(_0x3cad('0x0'));var events=['save',_0x3cad('0x1'),_0x3cad('0x2')];function createListener(_0x265d84,_0x41c2ae){return function(_0x1aa710){_0x41c2ae[_0x3cad('0x3')](_0x265d84,_0x1aa710);};}function removeListener(_0x2f6dcb,_0x1d3833){return function(){WhatsappInteractionEvents[_0x3cad('0x4')](_0x2f6dcb,_0x1d3833);};}exports[_0x3cad('0x5')]=function(_0x1b1c06){for(var _0x3caeef=0x0,_0x111284=events[_0x3cad('0x6')];_0x3caeef<_0x111284;_0x3caeef++){var _0x2c04ea=events[_0x3caeef];var _0x4161ad=createListener('whatsappInteraction:'+_0x2c04ea,_0x1b1c06);WhatsappInteractionEvents['on'](_0x2c04ea,_0x4161ad);}}; \ No newline at end of file +var _0x29f5=['whatsappInteraction:','save','remove','register'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x29f5,0x9d));var _0x529f=function(_0x4233ed,_0x1b7c3f){_0x4233ed=_0x4233ed-0x0;var _0x545b9b=_0x29f5[_0x4233ed];return _0x545b9b;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x529f('0x0'),_0x529f('0x1'),'update'];function createListener(_0x4d5b7e,_0x3afd4a){return function(_0x2bb44d){_0x3afd4a['emit'](_0x4d5b7e,_0x2bb44d);};}function removeListener(_0x40a282,_0xad1744){return function(){WhatsappInteractionEvents['removeListener'](_0x40a282,_0xad1744);};}exports[_0x529f('0x2')]=function(_0x572302){for(var _0x3c92b4=0x0,_0x414177=events['length'];_0x3c92b4<_0x414177;_0x3c92b4++){var _0xb1a7cc=events[_0x3c92b4];var _0x3daa6c=createListener(_0x529f('0x3')+_0xb1a7cc,_0x572302);WhatsappInteractionEvents['on'](_0xb1a7cc,_0x3daa6c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d3c0cb4..b563436 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 _0x0069=['create','/:id/status','status','put','/:id/accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post'];(function(_0x529d4a,_0x16de30){var _0x2d7037=function(_0x314efb){while(--_0x314efb){_0x529d4a['push'](_0x529d4a['shift']());}};_0x2d7037(++_0x16de30);}(_0x0069,0x1b8));var _0x9006=function(_0x1a71ef,_0x31ed01){_0x1a71ef=_0x1a71ef-0x0;var _0x1899f7=_0x0069[_0x1a71ef];return _0x1899f7;};'use strict';var multer=require(_0x9006('0x0'));var util=require(_0x9006('0x1'));var path=require(_0x9006('0x2'));var timeout=require(_0x9006('0x3'));var express=require(_0x9006('0x4'));var router=express['Router']();var fs_extra=require(_0x9006('0x5'));var auth=require(_0x9006('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9006('0x7'));var controller=require(_0x9006('0x8'));router[_0x9006('0x9')]('/',auth['isAuthenticated'](),controller[_0x9006('0xa')]);router[_0x9006('0x9')](_0x9006('0xb'),auth[_0x9006('0xc')](),controller['describe']);router[_0x9006('0x9')](_0x9006('0xd'),auth[_0x9006('0xc')](),controller[_0x9006('0xe')]);router[_0x9006('0xf')]('/',auth[_0x9006('0xc')](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller[_0x9006('0x10')]);router[_0x9006('0xf')](_0x9006('0x11'),controller[_0x9006('0x12')]);router['put'](_0x9006('0xd'),auth[_0x9006('0xc')](),controller['update']);router[_0x9006('0x13')](_0x9006('0x14'),auth[_0x9006('0xc')](),controller['accept']);router[_0x9006('0x13')](_0x9006('0x15'),auth[_0x9006('0xc')](),controller['reject']);router[_0x9006('0x16')](_0x9006('0xd'),auth[_0x9006('0xc')](),controller[_0x9006('0x17')]);module['exports']=router; \ No newline at end of file +var _0xef2b=['reject','delete','destroy','multer','util','path','express','Router','fs-extra','isAuthenticated','index','/describe','describe','get','/:id','post','tracked','whatsapp','whatsappmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x1bb866,_0x4e3236){var _0xfec36c=function(_0x1cadc8){while(--_0x1cadc8){_0x1bb866['push'](_0x1bb866['shift']());}};_0xfec36c(++_0x4e3236);}(_0xef2b,0xc3));var _0xbef2=function(_0x2678f6,_0x440272){_0x2678f6=_0x2678f6-0x0;var _0x309416=_0xef2b[_0x2678f6];return _0x309416;};'use strict';var multer=require(_0xbef2('0x0'));var util=require(_0xbef2('0x1'));var path=require(_0xbef2('0x2'));var timeout=require('connect-timeout');var express=require(_0xbef2('0x3'));var router=express[_0xbef2('0x4')]();var fs_extra=require(_0xbef2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xbef2('0x6')](),controller[_0xbef2('0x7')]);router['get'](_0xbef2('0x8'),auth[_0xbef2('0x6')](),controller[_0xbef2('0x9')]);router[_0xbef2('0xa')](_0xbef2('0xb'),auth[_0xbef2('0x6')](),controller['show']);router[_0xbef2('0xc')]('/',auth[_0xbef2('0x6')](),interaction[_0xbef2('0xd')](_0xbef2('0xe'),_0xbef2('0xf')),controller['create']);router[_0xbef2('0xc')]('/:id/status',controller['status']);router[_0xbef2('0x10')](_0xbef2('0xb'),auth[_0xbef2('0x6')](),controller[_0xbef2('0x11')]);router[_0xbef2('0x10')](_0xbef2('0x12'),auth[_0xbef2('0x6')](),controller[_0xbef2('0x13')]);router[_0xbef2('0x10')](_0xbef2('0x14'),auth['isAuthenticated'](),controller[_0xbef2('0x15')]);router[_0xbef2('0x16')](_0xbef2('0xb'),auth['isAuthenticated'](),controller[_0xbef2('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index c6de7db..31beb76 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 _0x6df0=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x6df0,0x15d));var _0x06df=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x6df0[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0x06df('0x0'));module[_0x06df('0x1')]={'body':{'type':Sequelize[_0x06df('0x2')](_0x06df('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x06df('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x06df('0x5')]('in','out'),'defaultValue':_0x06df('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x06df('0x7')](0xbe)},'phone':{'type':Sequelize[_0x06df('0x7')]},'readAt':{'type':Sequelize[_0x06df('0x8')]},'secret':{'type':Sequelize[_0x06df('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x894b=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x5cb8cc,_0x2d44d8){var _0xd7ceb6=function(_0x4149b5){while(--_0x4149b5){_0x5cb8cc['push'](_0x5cb8cc['shift']());}};_0xd7ceb6(++_0x2d44d8);}(_0x894b,0x18f));var _0xb894=function(_0x18f020,_0x438e3f){_0x18f020=_0x18f020-0x0;var _0x44a72c=_0x894b[_0x18f020];return _0x44a72c;};'use strict';var Sequelize=require('sequelize');module[_0xb894('0x0')]={'body':{'type':Sequelize[_0xb894('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb894('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb894('0x3')]('in',_0xb894('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb894('0x5')](0xbe)},'phone':{'type':Sequelize[_0xb894('0x5')]},'readAt':{'type':Sequelize[_0xb894('0x6')]},'secret':{'type':Sequelize[_0xb894('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb894('0x5')]},'providerResponse':{'type':Sequelize[_0xb894('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b627293..dd1ab85 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 _0x3315=['WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','destroy','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','QueryTypes','SELECT','contact','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus'];(function(_0xeb6f0,_0x42df60){var _0x324d7d=function(_0x462261){while(--_0x462261){_0xeb6f0['push'](_0xeb6f0['shift']());}};_0x324d7d(++_0x42df60);}(_0x3315,0x92));var _0x5331=function(_0x5b0431,_0xc820c3){_0x5b0431=_0x5b0431-0x0;var _0x3fb9b2=_0x3315[_0x5b0431];return _0x3fb9b2;};'use strict';var emlformat=require(_0x5331('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5331('0x1'));var rp=require(_0x5331('0x2'));var moment=require(_0x5331('0x3'));var BPromise=require(_0x5331('0x4'));var Mustache=require(_0x5331('0x5'));var util=require(_0x5331('0x6'));var path=require('path');var sox=require(_0x5331('0x7'));var csv=require(_0x5331('0x8'));var ejs=require(_0x5331('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5331('0xa'));var squel=require(_0x5331('0xb'));var crypto=require(_0x5331('0xc'));var jsforce=require(_0x5331('0xd'));var deskjs=require(_0x5331('0xe'));var toCsv=require(_0x5331('0x8'));var querystring=require(_0x5331('0xf'));var Papa=require(_0x5331('0x10'));var Redis=require(_0x5331('0x11'));var authService=require(_0x5331('0x12'));var qs=require(_0x5331('0x13'));var as=require(_0x5331('0x14'));var hardwareService=require(_0x5331('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5331('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5331('0x17'));var db=require(_0x5331('0x18'))['db'];config[_0x5331('0x19')]=_[_0x5331('0x1a')](config['redis'],{'host':_0x5331('0x1b'),'port':0x18eb});var socket=require(_0x5331('0x1c'))(new Redis(config[_0x5331('0x19')]));require(_0x5331('0x1d'))[_0x5331('0x1e')](socket);var jayson=require(_0x5331('0x1f'));var client=jayson[_0x5331('0x20')][_0x5331('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x5331('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xd153b,_0x16617b,_0x2ffa13,_0x3e8148){return new BPromise(function(_0x46e324,_0x39e1ec){var _0x3166dd=_0x3e8148||client;return _0x3166dd[_0x5331('0x22')](_0xd153b,_0x2ffa13)[_0x5331('0x23')](function(_0x12dc90){logger[_0x5331('0x24')](_0x5331('0x25'),_0x16617b,'request\x20sent');logger['debug'](_0x5331('0x26'),_0x16617b,_0x5331('0x27'),JSON['stringify'](_0x12dc90));if(_0x12dc90['error']){if(_0x12dc90[_0x5331('0x28')][_0x5331('0x29')]===0x1f4){logger[_0x5331('0x28')](_0x5331('0x25'),_0x16617b,_0x12dc90[_0x5331('0x28')][_0x5331('0x2a')]);return _0x39e1ec(_0x12dc90[_0x5331('0x28')][_0x5331('0x2a')]);}logger['error'](_0x5331('0x25'),_0x16617b,_0x12dc90['error']['message']);return _0x46e324(_0x12dc90[_0x5331('0x28')][_0x5331('0x2a')]);}else{logger[_0x5331('0x24')](_0x5331('0x25'),_0x16617b,'request\x20sent');_0x46e324(_0x12dc90['result'][_0x5331('0x2a')]);}})[_0x5331('0x2b')](function(_0x1725c0){logger[_0x5331('0x28')](_0x5331('0x25'),_0x16617b,_0x1725c0);_0x39e1ec(_0x1725c0);});});}function respondWithStatusCode(_0x3ed663,_0x488730){_0x488730=_0x488730||0xcc;return function(_0x2192b8){if(_0x2192b8){return _0x3ed663[_0x5331('0x2c')](_0x488730);}return _0x3ed663[_0x5331('0x2d')](_0x488730)[_0x5331('0x2e')]();};}function respondWithResult(_0x1740f9,_0x205e46){_0x205e46=_0x205e46||0xc8;return function(_0x21d2b0){if(_0x21d2b0){return _0x1740f9['status'](_0x205e46)[_0x5331('0x2f')](_0x21d2b0);}};}function respondWithFilteredResult(_0x270e95,_0x8a3947){return function(_0x1ca191){if(_0x1ca191){var _0x481453=typeof _0x8a3947['offset']===_0x5331('0x30')&&typeof _0x8a3947[_0x5331('0x31')]==='undefined';var _0x358e83=_0x1ca191[_0x5331('0x32')];var _0x398cf1=_0x481453?0x0:_0x8a3947['offset'];var _0x1bfb7e=_0x481453?_0x1ca191[_0x5331('0x32')]:_0x8a3947['offset']+_0x8a3947[_0x5331('0x31')];var _0x52b49f;if(_0x1bfb7e>=_0x358e83){_0x1bfb7e=_0x358e83;_0x52b49f=0xc8;}else{_0x52b49f=0xce;}_0x270e95['status'](_0x52b49f);return _0x270e95['set']('Content-Range',_0x398cf1+'-'+_0x1bfb7e+'/'+_0x358e83)[_0x5331('0x2f')](_0x1ca191);}return null;};}function patchUpdates(_0x42ce19){return function(_0x10325e){try{jsonpatch[_0x5331('0x33')](_0x10325e,_0x42ce19,!![]);}catch(_0x5cff6a){return BPromise[_0x5331('0x34')](_0x5cff6a);}return _0x10325e[_0x5331('0x35')]();};}function saveUpdates(_0x3f91d6,_0x216381){return function(_0x3e5ad4){if(_0x3e5ad4){return _0x3e5ad4[_0x5331('0x36')](_0x3f91d6)['then'](function(_0x1ce58b){return _0x1ce58b;});}return null;};}function removeEntity(_0x924bbe,_0x5a0f36){return function(_0x513145){if(_0x513145){return _0x513145[_0x5331('0x37')]()[_0x5331('0x23')](function(){_0x924bbe[_0x5331('0x2d')](0xcc)[_0x5331('0x2e')]();});}};}function handleEntityNotFound(_0x66ca1e,_0x7bf21){return function(_0x4fa35a){if(!_0x4fa35a){_0x66ca1e[_0x5331('0x2c')](0x194);}return _0x4fa35a;};}function handleError(_0x5100db,_0x4c6fcc){_0x4c6fcc=_0x4c6fcc||0x1f4;return function(_0x2d9b58){logger['error'](_0x2d9b58['stack']);if(_0x2d9b58[_0x5331('0x38')]){delete _0x2d9b58[_0x5331('0x38')];}_0x5100db[_0x5331('0x2d')](_0x4c6fcc)[_0x5331('0x39')](_0x2d9b58);};}exports[_0x5331('0x3a')]=function(_0x1701f9,_0x1f4363){var _0x52d2b8={},_0x20b98a={},_0x4edb4e={'count':0x0,'rows':[]};var _0xdd4cc6=_[_0x5331('0x3b')](db[_0x5331('0x3c')][_0x5331('0x3d')],function(_0x45cecc){return{'name':_0x45cecc['fieldName'],'type':_0x45cecc[_0x5331('0x3e')][_0x5331('0x3f')]};});_0x20b98a[_0x5331('0x40')]=_[_0x5331('0x3b')](_0xdd4cc6,_0x5331('0x38'));_0x20b98a[_0x5331('0x41')]=_[_0x5331('0x42')](_0x1701f9[_0x5331('0x41')]);_0x20b98a[_0x5331('0x43')]=_[_0x5331('0x44')](_0x20b98a[_0x5331('0x40')],_0x20b98a[_0x5331('0x41')]);_0x52d2b8['attributes']=_[_0x5331('0x44')](_0x20b98a[_0x5331('0x40')],qs[_0x5331('0x45')](_0x1701f9[_0x5331('0x41')]['fields']));_0x52d2b8[_0x5331('0x46')]=_0x52d2b8[_0x5331('0x46')][_0x5331('0x47')]?_0x52d2b8['attributes']:_0x20b98a[_0x5331('0x40')];if(!_0x1701f9[_0x5331('0x41')]['hasOwnProperty'](_0x5331('0x48'))){_0x52d2b8[_0x5331('0x31')]=qs['limit'](_0x1701f9['query']['limit']);_0x52d2b8[_0x5331('0x49')]=qs['offset'](_0x1701f9['query'][_0x5331('0x49')]);}_0x52d2b8[_0x5331('0x4a')]=qs['sort'](_0x1701f9[_0x5331('0x41')][_0x5331('0x4b')]);_0x52d2b8['where']=qs[_0x5331('0x43')](_[_0x5331('0x4c')](_0x1701f9[_0x5331('0x41')],_0x20b98a[_0x5331('0x43')]),_0xdd4cc6);if(_0x1701f9[_0x5331('0x41')][_0x5331('0x4d')]){_0x52d2b8[_0x5331('0x4e')]=_[_0x5331('0x4f')](_0x52d2b8['where'],{'$or':_['map'](_0xdd4cc6,function(_0x45804e){if(_0x45804e[_0x5331('0x3e')]!==_0x5331('0x50')){var _0x2266d2={};_0x2266d2[_0x45804e['name']]={'$like':'%'+_0x1701f9[_0x5331('0x41')]['filter']+'%'};return _0x2266d2;}})});}_0x52d2b8=_[_0x5331('0x4f')]({},_0x52d2b8,_0x1701f9[_0x5331('0x51')]);var _0x21315f={'where':_0x52d2b8['where']};return db[_0x5331('0x3c')]['count'](_0x21315f)[_0x5331('0x23')](function(_0x247ecc){_0x4edb4e[_0x5331('0x32')]=_0x247ecc;if(_0x1701f9['query']['includeAll']){_0x52d2b8[_0x5331('0x52')]=[{'all':!![]}];}return db[_0x5331('0x3c')][_0x5331('0x53')](_0x52d2b8);})[_0x5331('0x23')](function(_0x808d1c){_0x4edb4e[_0x5331('0x54')]=_0x808d1c;return _0x4edb4e;})[_0x5331('0x23')](respondWithFilteredResult(_0x1f4363,_0x52d2b8))[_0x5331('0x2b')](handleError(_0x1f4363,null));};exports[_0x5331('0x55')]=function(_0x412fd1,_0x51b9c8){var _0x190387={'raw':!![],'where':{'id':_0x412fd1[_0x5331('0x56')]['id']}},_0x1888f0={};_0x1888f0[_0x5331('0x40')]=_['keys'](db['WhatsappMessage'][_0x5331('0x3d')]);_0x1888f0[_0x5331('0x41')]=_['keys'](_0x412fd1[_0x5331('0x41')]);_0x1888f0[_0x5331('0x43')]=_['intersection'](_0x1888f0[_0x5331('0x40')],_0x1888f0[_0x5331('0x41')]);_0x190387[_0x5331('0x46')]=_[_0x5331('0x44')](_0x1888f0[_0x5331('0x40')],qs[_0x5331('0x45')](_0x412fd1[_0x5331('0x41')][_0x5331('0x45')]));_0x190387[_0x5331('0x46')]=_0x190387['attributes']['length']?_0x190387[_0x5331('0x46')]:_0x1888f0[_0x5331('0x40')];if(_0x412fd1[_0x5331('0x41')][_0x5331('0x57')]){_0x190387[_0x5331('0x52')]=[{'all':!![]}];}_0x190387=_[_0x5331('0x4f')]({},_0x190387,_0x412fd1[_0x5331('0x51')]);return db[_0x5331('0x3c')][_0x5331('0x58')](_0x190387)['then'](handleEntityNotFound(_0x51b9c8,null))['then'](respondWithResult(_0x51b9c8,null))[_0x5331('0x2b')](handleError(_0x51b9c8,null));};exports[_0x5331('0x59')]=function(_0x4db4e4,_0x5a6505){return db['WhatsappMessage'][_0x5331('0x59')](_0x4db4e4['body'],{})[_0x5331('0x23')](respondWithResult(_0x5a6505,0xc9))[_0x5331('0x2b')](handleError(_0x5a6505,null));};exports['update']=function(_0x2c4956,_0x3fec72){if(_0x2c4956[_0x5331('0x5a')]['id']){delete _0x2c4956[_0x5331('0x5a')]['id'];}return db[_0x5331('0x3c')][_0x5331('0x58')]({'where':{'id':_0x2c4956[_0x5331('0x56')]['id']}})[_0x5331('0x23')](handleEntityNotFound(_0x3fec72,null))[_0x5331('0x23')](saveUpdates(_0x2c4956[_0x5331('0x5a')],null))[_0x5331('0x23')](respondWithResult(_0x3fec72,null))[_0x5331('0x2b')](handleError(_0x3fec72,null));};exports[_0x5331('0x37')]=function(_0x17ba9f,_0x566b54){return db['WhatsappMessage'][_0x5331('0x58')]({'where':{'id':_0x17ba9f[_0x5331('0x56')]['id']}})[_0x5331('0x23')](handleEntityNotFound(_0x566b54,null))['then'](removeEntity(_0x566b54,null))['catch'](handleError(_0x566b54,null));};exports[_0x5331('0x5b')]=function(_0x561c03,_0x505b89){return db['WhatsappMessage'][_0x5331('0x5b')]()[_0x5331('0x23')](respondWithResult(_0x505b89,null))['catch'](handleError(_0x505b89,null));};var interaction_log=require(_0x5331('0x5c'))(_0x5331('0x5d'));exports[_0x5331('0x5e')]=function(_0x2dfaa3,_0x14ce02,_0x15b2ac){var _0xdf508b={'agent':{},'channel':_0x5331('0x5f')};if(_0x2dfaa3[_0x5331('0x5a')]['id']){delete _0x2dfaa3[_0x5331('0x5a')]['id'];}_0x2dfaa3[_0x5331('0x5a')]['read']=!![];_0x2dfaa3[_0x5331('0x5a')][_0x5331('0x60')]=moment()[_0x5331('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dfaa3[_0x5331('0x5a')][_0x5331('0x62')]=_0x2dfaa3[_0x5331('0x5a')][_0x5331('0x62')]||_0x2dfaa3[_0x5331('0x63')]['id'];_0xdf508b[_0x5331('0x64')]['id']=_0x2dfaa3[_0x5331('0x5a')]['UserId'];return db[_0x5331('0x3c')][_0x5331('0x58')]({'where':{'id':_0x2dfaa3[_0x5331('0x56')]['id'],'UserId':null}})[_0x5331('0x23')](handleEntityNotFound(_0x14ce02,null))[_0x5331('0x23')](saveUpdates(_0x2dfaa3[_0x5331('0x5a')],null))['then'](function(_0x2d09b6){if(_0x2d09b6){_0xdf508b[_0x5331('0x2a')]=_0x2d09b6[_0x5331('0x65')]({'plain':!![]});return db[_0x5331('0x66')]['find']({'where':{'id':_0x2d09b6[_0x5331('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x14ce02,null))[_0x5331('0x23')](function(_0x27131d){if(_0x27131d){return _0x27131d['update']({'UserId':_0x2dfaa3[_0x5331('0x5a')]['UserId'],'read1stAt':_[_0x5331('0x68')](_0x27131d[_0x5331('0x69')])?moment()[_0x5331('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5331('0x23')](function(_0x2989f7){if(_0x2989f7){_0xdf508b['interaction']=_0x2989f7['get']({'plain':!![]});interaction_log['info'](_0x5331('0x6a'),_0x2dfaa3[_0x5331('0x63')]['id'],_0x2dfaa3[_0x5331('0x63')][_0x5331('0x38')],_0x2dfaa3[_0x5331('0x63')][_0x5331('0x6b')],_0xdf508b['interaction']['id'],_0x2dfaa3[_0x5331('0x5a')]?JSON['stringify'](_0x2dfaa3[_0x5331('0x5a')]):_0x5331('0x6c'));return respondWithRpcPromise(_0x5331('0x6d'),_0x5331('0x6e'),_0xdf508b);}return null;})[_0x5331('0x23')](function(_0x8f3789){var _0x26ce45=_0x5331('0x6f')+_0x8f3789[_0x5331('0x2a')][_0x5331('0x70')];return db[_0x5331('0x71')]['query'](_0x26ce45,{'type':db[_0x5331('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5331('0x23')](function(_0x437334){return _0x437334;});})['then'](function(_0x4909ec){if(_0x4909ec){_0xdf508b[_0x5331('0x2a')]['contact']=_0x4909ec[0x0];if(!_0x2dfaa3[_0x5331('0x5a')][_0x5331('0x62')])return;return db['User'][_0x5331('0x58')]({'where':{'id':_0x2dfaa3[_0x5331('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x5331('0x38'),_0x5331('0x73'),_0x5331('0x74'),_0x5331('0x75')],'raw':!![]});}return null;})[_0x5331('0x23')](function(_0x927f2b){if(!_0x927f2b)return null;_0xdf508b[_0x5331('0x2a')][_0x5331('0x64')]=_0x927f2b;return _0xdf508b;})['then'](function(_0x10d2e8){if(_0x10d2e8){if(_0x2dfaa3[_0x5331('0x5a')]['manual']){_0xdf508b['message']['interface']=util[_0x5331('0x61')](_0x5331('0x76'),_0x2dfaa3[_0x5331('0x63')][_0x5331('0x38')]);_0xdf508b[_0x5331('0x2a')][_0x5331('0x77')]=_0xdf508b[_0x5331('0x77')];_0xdf508b['message'][_0x5331('0x78')]=_0xdf508b['channel'];_0xdf508b[_0x5331('0x2a')][_0x5331('0x79')]='accept';return respondWithRpcPromise(_0x5331('0x7a'),'EventManager',{'event':_0x5331('0x7b'),'message':_0xdf508b[_0x5331('0x2a')]},client9002)[_0x5331('0x23')](function(){return _0xdf508b;});}return _0xdf508b;}return null;})['then'](respondWithResult(_0x14ce02,null))['catch'](handleError(_0x14ce02,null));};var interaction_log=require('../../config/logger')(_0x5331('0x5d'));exports['reject']=function(_0x808242,_0x22d423,_0x1e9509){var _0x51e757={'agent':{},'channel':_0x5331('0x5f')};if(_0x808242[_0x5331('0x5a')]['id']){delete _0x808242['body']['id'];}_0x808242[_0x5331('0x5a')][_0x5331('0x62')]=_0x808242[_0x5331('0x5a')]['UserId']||_0x808242[_0x5331('0x63')]['id'];_0x51e757[_0x5331('0x64')]['id']=_0x808242['body'][_0x5331('0x62')];return db[_0x5331('0x3c')][_0x5331('0x58')]({'where':{'id':_0x808242[_0x5331('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22d423,null))[_0x5331('0x23')](function(_0x26421c){if(_0x26421c){_0x51e757[_0x5331('0x2a')]=_0x26421c[_0x5331('0x65')]({'plain':!![]});return db[_0x5331('0x66')][_0x5331('0x58')]({'where':{'id':_0x26421c[_0x5331('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x22d423,null))[_0x5331('0x23')](function(_0x57b428){if(_0x57b428){_0x51e757[_0x5331('0x7c')]=_0x57b428[_0x5331('0x65')]({'plain':!![]});interaction_log[_0x5331('0x24')](_0x5331('0x7d'),_0x808242[_0x5331('0x63')]['id'],_0x808242[_0x5331('0x63')][_0x5331('0x38')],_0x808242[_0x5331('0x63')]['role'],_0x51e757[_0x5331('0x7c')]['id'],_0x808242[_0x5331('0x5a')]?JSON[_0x5331('0x7e')](_0x808242['body']):'null');return respondWithRpcPromise(_0x5331('0x7f'),_0x5331('0x80'),_0x51e757);}return null;})[_0x5331('0x23')](function(_0x357630){var _0x37e8a5=_0x5331('0x6f')+_0x357630[_0x5331('0x2a')][_0x5331('0x70')];return db[_0x5331('0x71')]['query'](_0x37e8a5,{'type':db[_0x5331('0x72')][_0x5331('0x81')][_0x5331('0x82')],'raw':!![]})[_0x5331('0x23')](function(_0x184c76){return _0x184c76;});})[_0x5331('0x23')](function(_0x167574){if(_0x167574){_0x51e757[_0x5331('0x2a')][_0x5331('0x83')]=_0x167574[0x0];if(!_0x808242['body'][_0x5331('0x62')])return;return db[_0x5331('0x84')]['find']({'where':{'id':_0x808242[_0x5331('0x5a')][_0x5331('0x62')],'role':'agent'},'attributes':['id',_0x5331('0x38'),_0x5331('0x73'),'email',_0x5331('0x75')],'raw':!![]});}return null;})[_0x5331('0x23')](function(_0x30cbe3){if(!_0x30cbe3)return null;_0x51e757['message'][_0x5331('0x64')]=_0x30cbe3;return _0x51e757;})['then'](function(_0x39a89b){if(_0x39a89b){_0x39a89b[_0x5331('0x2a')][_0x5331('0x85')]=util['format'](_0x5331('0x76'),_0x808242[_0x5331('0x63')][_0x5331('0x38')]);_0x39a89b[_0x5331('0x2a')]['channel']=_0x51e757['channel'];_0x39a89b[_0x5331('0x2a')]['motionChannel']=_0x51e757['channel'];_0x39a89b['message'][_0x5331('0x79')]=_0x5331('0x34');respondWithRpcPromise(_0x5331('0x7a'),_0x5331('0x7a'),{'event':_0x5331('0x86'),'message':_0x39a89b['message']},client9002);return _0x51e757;}return null;})[_0x5331('0x23')](respondWithResult(_0x22d423,null))['catch'](handleError(_0x22d423,null));};exports['status']=function(_0x1bf5d6,_0x357013,_0x2626f9){if(_0x1bf5d6[_0x5331('0x5a')]['id']){delete _0x1bf5d6[_0x5331('0x5a')]['id'];}var _0x3c9e2a;return db[_0x5331('0x3c')][_0x5331('0x58')]({'where':{'id':_0x1bf5d6['params']['id']}})[_0x5331('0x23')](handleEntityNotFound(_0x357013,null))[_0x5331('0x23')](function(_0x3ad193){if(_0x3ad193){_0x3c9e2a=_0x3ad193;return db[_0x5331('0x87')][_0x5331('0x58')]({'where':{'id':_0x3ad193[_0x5331('0x88')]}});}})[_0x5331('0x23')](handleEntityNotFound(_0x357013,null))[_0x5331('0x23')](function(_0x15b774){if(_0x15b774){logger[_0x5331('0x89')](_0x5331('0x8a'),_0x5331('0x2d'),_0x5331('0x8b'),_0x15b774[_0x5331('0x3e')],util[_0x5331('0x8c')](_0x1bf5d6[_0x5331('0x5a')],{'showHidden':![],'depth':null}));switch(_0x15b774[_0x5331('0x3e')]){case _0x5331('0x8d'):if(_0x1bf5d6[_0x5331('0x5a')][_0x5331('0x8e')]&&_0x1bf5d6[_0x5331('0x5a')][_0x5331('0x8e')]===_0x3c9e2a['messageId']&&_0x1bf5d6[_0x5331('0x5a')][_0x5331('0x8f')]&&_0x1bf5d6[_0x5331('0x5a')][_0x5331('0x8f')]==='read'){return _0x3c9e2a[_0x5331('0x36')]({'read':!![]});}else{logger[_0x5331('0x28')](_0x5331('0x90'),_0x5331('0x2d'),_0x5331('0x8d'),util[_0x5331('0x8c')](_0x1bf5d6[_0x5331('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x3c9e2a;}})[_0x5331('0x23')](respondWithResult(_0x357013,null))[_0x5331('0x2b')](handleError(_0x357013,null));}; \ No newline at end of file +var _0x5dab=['pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','body','describe','../../config/logger','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','reject','WhatsappInteraction','get','role','RejectMessage','rejectMessage','sequelize','Sequelize','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','http','then','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x54175a,_0x3fa396){var _0x226360=function(_0x17d06d){while(--_0x17d06d){_0x54175a['push'](_0x54175a['shift']());}};_0x226360(++_0x3fa396);}(_0x5dab,0x156));var _0xb5da=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5dab[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xb5da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5da('0x1'));var jsonpatch=require(_0xb5da('0x2'));var rp=require(_0xb5da('0x3'));var moment=require(_0xb5da('0x4'));var BPromise=require(_0xb5da('0x5'));var Mustache=require(_0xb5da('0x6'));var util=require(_0xb5da('0x7'));var path=require(_0xb5da('0x8'));var sox=require(_0xb5da('0x9'));var csv=require(_0xb5da('0xa'));var ejs=require(_0xb5da('0xb'));var fs=require('fs');var fs_extra=require(_0xb5da('0xc'));var _=require(_0xb5da('0xd'));var squel=require('squel');var crypto=require(_0xb5da('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb5da('0xf'));var toCsv=require(_0xb5da('0xa'));var querystring=require(_0xb5da('0x10'));var Papa=require(_0xb5da('0x11'));var Redis=require(_0xb5da('0x12'));var authService=require(_0xb5da('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb5da('0x14'));var hardwareService=require(_0xb5da('0x15'));var logger=require('../../config/logger')(_0xb5da('0x16'));var utils=require(_0xb5da('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb5da('0x18'));var db=require(_0xb5da('0x19'))['db'];config[_0xb5da('0x1a')]=_['defaults'](config[_0xb5da('0x1a')],{'host':_0xb5da('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5da('0x1a')]));require(_0xb5da('0x1c'))[_0xb5da('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb5da('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc35241,_0x57fc49,_0x151e26,_0x33c951){return new BPromise(function(_0x1c93c3,_0xc6adfa){var _0x3a2e80=_0x33c951||client;return _0x3a2e80['request'](_0xc35241,_0x151e26)[_0xb5da('0x1f')](function(_0xcd7ca3){logger['info'](_0xb5da('0x20'),_0x57fc49,'request\x20sent');logger['debug'](_0xb5da('0x21'),_0x57fc49,_0xb5da('0x22'),JSON[_0xb5da('0x23')](_0xcd7ca3));if(_0xcd7ca3[_0xb5da('0x24')]){if(_0xcd7ca3['error']['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x57fc49,_0xcd7ca3[_0xb5da('0x24')]['message']);return _0xc6adfa(_0xcd7ca3[_0xb5da('0x24')]['message']);}logger['error'](_0xb5da('0x20'),_0x57fc49,_0xcd7ca3[_0xb5da('0x24')][_0xb5da('0x25')]);return _0x1c93c3(_0xcd7ca3['error'][_0xb5da('0x25')]);}else{logger[_0xb5da('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x57fc49,_0xb5da('0x22'));_0x1c93c3(_0xcd7ca3[_0xb5da('0x27')][_0xb5da('0x25')]);}})[_0xb5da('0x28')](function(_0x3d954d){logger[_0xb5da('0x24')](_0xb5da('0x20'),_0x57fc49,_0x3d954d);_0xc6adfa(_0x3d954d);});});}function respondWithStatusCode(_0x5409c4,_0x5925d3){_0x5925d3=_0x5925d3||0xcc;return function(_0x23913b){if(_0x23913b){return _0x5409c4['sendStatus'](_0x5925d3);}return _0x5409c4['status'](_0x5925d3)[_0xb5da('0x29')]();};}function respondWithResult(_0xcf7795,_0x50e362){_0x50e362=_0x50e362||0xc8;return function(_0x2e4383){if(_0x2e4383){return _0xcf7795[_0xb5da('0x2a')](_0x50e362)[_0xb5da('0x2b')](_0x2e4383);}};}function respondWithFilteredResult(_0x4fd4b2,_0x413925){return function(_0x13f37c){if(_0x13f37c){var _0x346574=typeof _0x413925[_0xb5da('0x2c')]===_0xb5da('0x2d')&&typeof _0x413925[_0xb5da('0x2e')]==='undefined';var _0x482e43=_0x13f37c[_0xb5da('0x2f')];var _0x2f9dc3=_0x346574?0x0:_0x413925[_0xb5da('0x2c')];var _0x11d17d=_0x346574?_0x13f37c[_0xb5da('0x2f')]:_0x413925[_0xb5da('0x2c')]+_0x413925[_0xb5da('0x2e')];var _0x4d9333;if(_0x11d17d>=_0x482e43){_0x11d17d=_0x482e43;_0x4d9333=0xc8;}else{_0x4d9333=0xce;}_0x4fd4b2[_0xb5da('0x2a')](_0x4d9333);return _0x4fd4b2[_0xb5da('0x30')](_0xb5da('0x31'),_0x2f9dc3+'-'+_0x11d17d+'/'+_0x482e43)['json'](_0x13f37c);}return null;};}function patchUpdates(_0x276ff5){return function(_0x1c6384){try{jsonpatch['apply'](_0x1c6384,_0x276ff5,!![]);}catch(_0x57dc0a){return BPromise['reject'](_0x57dc0a);}return _0x1c6384[_0xb5da('0x32')]();};}function saveUpdates(_0x3c8e28,_0x3d758b){return function(_0x13c42f){if(_0x13c42f){return _0x13c42f[_0xb5da('0x33')](_0x3c8e28)['then'](function(_0x404ad5){return _0x404ad5;});}return null;};}function removeEntity(_0x2aa5fa,_0x1544f4){return function(_0x18ecbd){if(_0x18ecbd){return _0x18ecbd[_0xb5da('0x34')]()[_0xb5da('0x1f')](function(){_0x2aa5fa[_0xb5da('0x2a')](0xcc)[_0xb5da('0x29')]();});}};}function handleEntityNotFound(_0x162eb5,_0x46bf8c){return function(_0x1d7bbb){if(!_0x1d7bbb){_0x162eb5[_0xb5da('0x35')](0x194);}return _0x1d7bbb;};}function handleError(_0x185e72,_0x490124){_0x490124=_0x490124||0x1f4;return function(_0x11ae13){logger[_0xb5da('0x24')](_0x11ae13[_0xb5da('0x36')]);if(_0x11ae13[_0xb5da('0x37')]){delete _0x11ae13['name'];}_0x185e72[_0xb5da('0x2a')](_0x490124)[_0xb5da('0x38')](_0x11ae13);};}exports[_0xb5da('0x39')]=function(_0x328389,_0x3e2e24){var _0x33e41c={},_0xf2dca7={},_0x8d2963={'count':0x0,'rows':[]};var _0x3443d5=_[_0xb5da('0x3a')](db[_0xb5da('0x3b')]['rawAttributes'],function(_0x2115c7){return{'name':_0x2115c7[_0xb5da('0x3c')],'type':_0x2115c7[_0xb5da('0x3d')][_0xb5da('0x3e')]};});_0xf2dca7['model']=_['map'](_0x3443d5,_0xb5da('0x37'));_0xf2dca7[_0xb5da('0x3f')]=_['keys'](_0x328389['query']);_0xf2dca7[_0xb5da('0x40')]=_[_0xb5da('0x41')](_0xf2dca7[_0xb5da('0x42')],_0xf2dca7[_0xb5da('0x3f')]);_0x33e41c[_0xb5da('0x43')]=_[_0xb5da('0x41')](_0xf2dca7[_0xb5da('0x42')],qs['fields'](_0x328389[_0xb5da('0x3f')][_0xb5da('0x44')]));_0x33e41c[_0xb5da('0x43')]=_0x33e41c['attributes'][_0xb5da('0x45')]?_0x33e41c[_0xb5da('0x43')]:_0xf2dca7[_0xb5da('0x42')];if(!_0x328389[_0xb5da('0x3f')][_0xb5da('0x46')](_0xb5da('0x47'))){_0x33e41c[_0xb5da('0x2e')]=qs[_0xb5da('0x2e')](_0x328389[_0xb5da('0x3f')]['limit']);_0x33e41c[_0xb5da('0x2c')]=qs['offset'](_0x328389[_0xb5da('0x3f')][_0xb5da('0x2c')]);}_0x33e41c[_0xb5da('0x48')]=qs[_0xb5da('0x49')](_0x328389[_0xb5da('0x3f')]['sort']);_0x33e41c[_0xb5da('0x4a')]=qs[_0xb5da('0x40')](_[_0xb5da('0x4b')](_0x328389[_0xb5da('0x3f')],_0xf2dca7[_0xb5da('0x40')]),_0x3443d5);if(_0x328389['query'][_0xb5da('0x4c')]){_0x33e41c[_0xb5da('0x4a')]=_[_0xb5da('0x4d')](_0x33e41c[_0xb5da('0x4a')],{'$or':_[_0xb5da('0x3a')](_0x3443d5,function(_0x7ab3ab){if(_0x7ab3ab[_0xb5da('0x3d')]!==_0xb5da('0x4e')){var _0x2d478c={};_0x2d478c[_0x7ab3ab[_0xb5da('0x37')]]={'$like':'%'+_0x328389[_0xb5da('0x3f')][_0xb5da('0x4c')]+'%'};return _0x2d478c;}})});}_0x33e41c=_[_0xb5da('0x4d')]({},_0x33e41c,_0x328389[_0xb5da('0x4f')]);var _0x5ceced={'where':_0x33e41c[_0xb5da('0x4a')]};return db[_0xb5da('0x3b')][_0xb5da('0x2f')](_0x5ceced)[_0xb5da('0x1f')](function(_0x230012){_0x8d2963[_0xb5da('0x2f')]=_0x230012;if(_0x328389[_0xb5da('0x3f')][_0xb5da('0x50')]){_0x33e41c['include']=[{'all':!![]}];}return db[_0xb5da('0x3b')]['findAll'](_0x33e41c);})[_0xb5da('0x1f')](function(_0x38a0c0){_0x8d2963[_0xb5da('0x51')]=_0x38a0c0;return _0x8d2963;})[_0xb5da('0x1f')](respondWithFilteredResult(_0x3e2e24,_0x33e41c))[_0xb5da('0x28')](handleError(_0x3e2e24,null));};exports[_0xb5da('0x52')]=function(_0x4426fe,_0x1ad14f){var _0x41f964={'raw':!![],'where':{'id':_0x4426fe[_0xb5da('0x53')]['id']}},_0x3f5d31={};_0x3f5d31['model']=_['keys'](db[_0xb5da('0x3b')]['rawAttributes']);_0x3f5d31[_0xb5da('0x3f')]=_['keys'](_0x4426fe['query']);_0x3f5d31['filters']=_[_0xb5da('0x41')](_0x3f5d31[_0xb5da('0x42')],_0x3f5d31[_0xb5da('0x3f')]);_0x41f964[_0xb5da('0x43')]=_['intersection'](_0x3f5d31[_0xb5da('0x42')],qs['fields'](_0x4426fe[_0xb5da('0x3f')][_0xb5da('0x44')]));_0x41f964[_0xb5da('0x43')]=_0x41f964[_0xb5da('0x43')][_0xb5da('0x45')]?_0x41f964['attributes']:_0x3f5d31[_0xb5da('0x42')];if(_0x4426fe[_0xb5da('0x3f')]['includeAll']){_0x41f964[_0xb5da('0x54')]=[{'all':!![]}];}_0x41f964=_[_0xb5da('0x4d')]({},_0x41f964,_0x4426fe[_0xb5da('0x4f')]);return db[_0xb5da('0x3b')][_0xb5da('0x55')](_0x41f964)[_0xb5da('0x1f')](handleEntityNotFound(_0x1ad14f,null))[_0xb5da('0x1f')](respondWithResult(_0x1ad14f,null))[_0xb5da('0x28')](handleError(_0x1ad14f,null));};exports['create']=function(_0x342184,_0x28e5cb){return db[_0xb5da('0x3b')]['create'](_0x342184[_0xb5da('0x56')],{})[_0xb5da('0x1f')](respondWithResult(_0x28e5cb,0xc9))[_0xb5da('0x28')](handleError(_0x28e5cb,null));};exports[_0xb5da('0x33')]=function(_0x173f1c,_0x46f1e0){if(_0x173f1c[_0xb5da('0x56')]['id']){delete _0x173f1c[_0xb5da('0x56')]['id'];}return db[_0xb5da('0x3b')][_0xb5da('0x55')]({'where':{'id':_0x173f1c[_0xb5da('0x53')]['id']}})['then'](handleEntityNotFound(_0x46f1e0,null))[_0xb5da('0x1f')](saveUpdates(_0x173f1c[_0xb5da('0x56')],null))['then'](respondWithResult(_0x46f1e0,null))[_0xb5da('0x28')](handleError(_0x46f1e0,null));};exports[_0xb5da('0x34')]=function(_0x71e5ac,_0x242ebc){return db['WhatsappMessage'][_0xb5da('0x55')]({'where':{'id':_0x71e5ac[_0xb5da('0x53')]['id']}})[_0xb5da('0x1f')](handleEntityNotFound(_0x242ebc,null))['then'](removeEntity(_0x242ebc,null))[_0xb5da('0x28')](handleError(_0x242ebc,null));};exports[_0xb5da('0x57')]=function(_0x3d3cff,_0x2fae16){return db[_0xb5da('0x3b')][_0xb5da('0x57')]()['then'](respondWithResult(_0x2fae16,null))[_0xb5da('0x28')](handleError(_0x2fae16,null));};var interaction_log=require(_0xb5da('0x58'))('whatsapp-interactions');exports[_0xb5da('0x59')]=function(_0xe93111,_0x474275,_0x59cbef){var _0x4cf4bb={'agent':{},'channel':_0xb5da('0x5a')};if(_0xe93111[_0xb5da('0x56')]['id']){delete _0xe93111[_0xb5da('0x56')]['id'];}_0xe93111[_0xb5da('0x56')]['read']=!![];_0xe93111['body'][_0xb5da('0x5b')]=moment()[_0xb5da('0x5c')](_0xb5da('0x5d'));_0xe93111['body'][_0xb5da('0x5e')]=_0xe93111[_0xb5da('0x56')]['UserId']||_0xe93111[_0xb5da('0x5f')]['id'];_0x4cf4bb[_0xb5da('0x60')]['id']=_0xe93111['body'][_0xb5da('0x5e')];return db['WhatsappMessage'][_0xb5da('0x55')]({'where':{'id':_0xe93111['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x474275,null))[_0xb5da('0x1f')](saveUpdates(_0xe93111[_0xb5da('0x56')],null))[_0xb5da('0x1f')](function(_0x1d7853){if(_0x1d7853){_0x4cf4bb[_0xb5da('0x25')]=_0x1d7853['get']({'plain':!![]});return db['WhatsappInteraction'][_0xb5da('0x55')]({'where':{'id':_0x1d7853[_0xb5da('0x61')]}});}return null;})[_0xb5da('0x1f')](handleEntityNotFound(_0x474275,null))[_0xb5da('0x1f')](function(_0x57ae98){if(_0x57ae98){return _0x57ae98[_0xb5da('0x33')]({'UserId':_0xe93111[_0xb5da('0x56')][_0xb5da('0x5e')],'read1stAt':_[_0xb5da('0x62')](_0x57ae98[_0xb5da('0x63')])?moment()[_0xb5da('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3f770e){if(_0x3f770e){_0x4cf4bb[_0xb5da('0x64')]=_0x3f770e['get']({'plain':!![]});interaction_log[_0xb5da('0x26')](_0xb5da('0x65'),_0xe93111[_0xb5da('0x5f')]['id'],_0xe93111[_0xb5da('0x5f')][_0xb5da('0x37')],_0xe93111[_0xb5da('0x5f')]['role'],_0x4cf4bb[_0xb5da('0x64')]['id'],_0xe93111[_0xb5da('0x56')]?JSON[_0xb5da('0x23')](_0xe93111['body']):_0xb5da('0x66'));return respondWithRpcPromise(_0xb5da('0x67'),_0xb5da('0x68'),_0x4cf4bb);}return null;})[_0xb5da('0x1f')](function(_0x550264){var _0x547acc=_0xb5da('0x69')+_0x550264[_0xb5da('0x25')][_0xb5da('0x6a')];return db['sequelize'][_0xb5da('0x3f')](_0x547acc,{'type':db['Sequelize'][_0xb5da('0x6b')][_0xb5da('0x6c')],'raw':!![]})[_0xb5da('0x1f')](function(_0x8f93e6){return _0x8f93e6;});})[_0xb5da('0x1f')](function(_0x21d960){if(_0x21d960){_0x4cf4bb[_0xb5da('0x25')][_0xb5da('0x6d')]=_0x21d960[0x0];if(!_0xe93111[_0xb5da('0x56')][_0xb5da('0x5e')])return;return db[_0xb5da('0x6e')]['find']({'where':{'id':_0xe93111[_0xb5da('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xb5da('0x37'),_0xb5da('0x6f'),_0xb5da('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1c1df5){if(!_0x1c1df5)return null;_0x4cf4bb[_0xb5da('0x25')][_0xb5da('0x60')]=_0x1c1df5;return _0x4cf4bb;})[_0xb5da('0x1f')](function(_0x4da79a){if(_0x4da79a){if(_0xe93111[_0xb5da('0x56')][_0xb5da('0x71')]){_0x4cf4bb['message'][_0xb5da('0x72')]=util[_0xb5da('0x5c')](_0xb5da('0x73'),_0xe93111[_0xb5da('0x5f')]['name']);_0x4cf4bb['message'][_0xb5da('0x74')]=_0x4cf4bb[_0xb5da('0x74')];_0x4cf4bb[_0xb5da('0x25')][_0xb5da('0x75')]=_0x4cf4bb[_0xb5da('0x74')];_0x4cf4bb['message'][_0xb5da('0x76')]='accept';return respondWithRpcPromise(_0xb5da('0x77'),'EventManager',{'event':_0xb5da('0x78'),'message':_0x4cf4bb['message']},client9002)[_0xb5da('0x1f')](function(){return _0x4cf4bb;});}return _0x4cf4bb;}return null;})[_0xb5da('0x1f')](respondWithResult(_0x474275,null))[_0xb5da('0x28')](handleError(_0x474275,null));};var interaction_log=require(_0xb5da('0x58'))(_0xb5da('0x79'));exports[_0xb5da('0x7a')]=function(_0x4c1f74,_0x5b1063,_0x2f7a42){var _0x57bdc7={'agent':{},'channel':_0xb5da('0x5a')};if(_0x4c1f74[_0xb5da('0x56')]['id']){delete _0x4c1f74[_0xb5da('0x56')]['id'];}_0x4c1f74['body'][_0xb5da('0x5e')]=_0x4c1f74[_0xb5da('0x56')][_0xb5da('0x5e')]||_0x4c1f74[_0xb5da('0x5f')]['id'];_0x57bdc7['agent']['id']=_0x4c1f74[_0xb5da('0x56')][_0xb5da('0x5e')];return db[_0xb5da('0x3b')]['find']({'where':{'id':_0x4c1f74[_0xb5da('0x53')]['id'],'UserId':null}})[_0xb5da('0x1f')](handleEntityNotFound(_0x5b1063,null))[_0xb5da('0x1f')](function(_0x2a9ea2){if(_0x2a9ea2){_0x57bdc7[_0xb5da('0x25')]=_0x2a9ea2['get']({'plain':!![]});return db[_0xb5da('0x7b')]['find']({'where':{'id':_0x2a9ea2[_0xb5da('0x61')]}});}return null;})[_0xb5da('0x1f')](handleEntityNotFound(_0x5b1063,null))[_0xb5da('0x1f')](function(_0x1ba0b9){if(_0x1ba0b9){_0x57bdc7[_0xb5da('0x64')]=_0x1ba0b9[_0xb5da('0x7c')]({'plain':!![]});interaction_log[_0xb5da('0x26')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c1f74[_0xb5da('0x5f')]['id'],_0x4c1f74['user']['name'],_0x4c1f74['user'][_0xb5da('0x7d')],_0x57bdc7[_0xb5da('0x64')]['id'],_0x4c1f74[_0xb5da('0x56')]?JSON[_0xb5da('0x23')](_0x4c1f74['body']):_0xb5da('0x66'));return respondWithRpcPromise(_0xb5da('0x7e'),_0xb5da('0x7f'),_0x57bdc7);}return null;})[_0xb5da('0x1f')](function(_0x166410){var _0xb7062c=_0xb5da('0x69')+_0x166410['message'][_0xb5da('0x6a')];return db[_0xb5da('0x80')][_0xb5da('0x3f')](_0xb7062c,{'type':db[_0xb5da('0x81')]['QueryTypes'][_0xb5da('0x6c')],'raw':!![]})[_0xb5da('0x1f')](function(_0x1ef4bb){return _0x1ef4bb;});})[_0xb5da('0x1f')](function(_0x19b99d){if(_0x19b99d){_0x57bdc7[_0xb5da('0x25')][_0xb5da('0x6d')]=_0x19b99d[0x0];if(!_0x4c1f74[_0xb5da('0x56')][_0xb5da('0x5e')])return;return db[_0xb5da('0x6e')][_0xb5da('0x55')]({'where':{'id':_0x4c1f74[_0xb5da('0x56')]['UserId'],'role':_0xb5da('0x60')},'attributes':['id',_0xb5da('0x37'),'fullname',_0xb5da('0x70'),'internal'],'raw':!![]});}return null;})[_0xb5da('0x1f')](function(_0x18f046){if(!_0x18f046)return null;_0x57bdc7['message']['agent']=_0x18f046;return _0x57bdc7;})[_0xb5da('0x1f')](function(_0x2858ab){if(_0x2858ab){_0x2858ab['message'][_0xb5da('0x72')]=util[_0xb5da('0x5c')]('SIP/%s',_0x4c1f74['user'][_0xb5da('0x37')]);_0x2858ab['message']['channel']=_0x57bdc7['channel'];_0x2858ab[_0xb5da('0x25')][_0xb5da('0x75')]=_0x57bdc7['channel'];_0x2858ab[_0xb5da('0x25')]['event']=_0xb5da('0x7a');respondWithRpcPromise(_0xb5da('0x77'),_0xb5da('0x77'),{'event':_0xb5da('0x82'),'message':_0x2858ab[_0xb5da('0x25')]},client9002);return _0x57bdc7;}return null;})[_0xb5da('0x1f')](respondWithResult(_0x5b1063,null))[_0xb5da('0x28')](handleError(_0x5b1063,null));};exports[_0xb5da('0x2a')]=function(_0x4392e0,_0x1984ca,_0x2e5639){if(_0x4392e0[_0xb5da('0x56')]['id']){delete _0x4392e0[_0xb5da('0x56')]['id'];}var _0xdaba89;return db['WhatsappMessage'][_0xb5da('0x55')]({'where':{'id':_0x4392e0[_0xb5da('0x53')]['id']}})['then'](handleEntityNotFound(_0x1984ca,null))['then'](function(_0x13600a){if(_0x13600a){_0xdaba89=_0x13600a;return db[_0xb5da('0x83')][_0xb5da('0x55')]({'where':{'id':_0x13600a['WhatsappAccountId']}});}})[_0xb5da('0x1f')](handleEntityNotFound(_0x1984ca,null))['then'](function(_0xb49f65){if(_0xb49f65){logger[_0xb5da('0x84')](_0xb5da('0x85'),_0xb5da('0x2a'),_0xb5da('0x86'),_0xb49f65['type'],util['inspect'](_0x4392e0['body'],{'showHidden':![],'depth':null}));switch(_0xb49f65['type']){case'twilio':if(_0x4392e0[_0xb5da('0x56')]['MessageSid']&&_0x4392e0['body']['MessageSid']===_0xdaba89['messageId']&&_0x4392e0[_0xb5da('0x56')]['MessageStatus']&&_0x4392e0[_0xb5da('0x56')][_0xb5da('0x87')]==='read'){return _0xdaba89[_0xb5da('0x33')]({'read':!![]});}else{logger[_0xb5da('0x24')](_0xb5da('0x88'),'status',_0xb5da('0x89'),util[_0xb5da('0x8a')](_0x4392e0['body'],{'showHidden':![],'depth':null}));}break;}return _0xdaba89;}})['then'](respondWithResult(_0x1984ca,null))[_0xb5da('0x28')](handleError(_0x1984ca,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index be30592..01cb31a 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 _0xe9e8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xe9e8,0x6b));var _0x8e9e=function(_0xd6a330,_0x2fa378){_0xd6a330=_0xd6a330-0x0;var _0x399496=_0xe9e8[_0xd6a330];return _0x399496;};'use strict';var EventEmitter=require(_0x8e9e('0x0'));var WhatsappMessage=require(_0x8e9e('0x1'))['db'][_0x8e9e('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x8e9e('0x3')](0x0);var events={'afterCreate':_0x8e9e('0x4'),'afterUpdate':_0x8e9e('0x5'),'afterDestroy':_0x8e9e('0x6')};function emitEvent(_0x48233f){return function(_0x103d8b,_0x2a1d41,_0x1c09c6){WhatsappMessageEvents['emit'](_0x48233f+':'+_0x103d8b['id'],_0x103d8b);WhatsappMessageEvents[_0x8e9e('0x7')](_0x48233f,_0x103d8b);_0x1c09c6(null);};}for(var e in events){if(events[_0x8e9e('0x8')](e)){var event=events[e];WhatsappMessage[_0x8e9e('0x9')](e,emitEvent(event));}}module[_0x8e9e('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x4ded=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x36848a,_0x35341c){var _0x4218df=function(_0x5e5cdc){while(--_0x5e5cdc){_0x36848a['push'](_0x36848a['shift']());}};_0x4218df(++_0x35341c);}(_0x4ded,0x116));var _0xd4de=function(_0x272396,_0x52aaef){_0x272396=_0x272396-0x0;var _0x224ad4=_0x4ded[_0x272396];return _0x224ad4;};'use strict';var EventEmitter=require(_0xd4de('0x0'));var WhatsappMessage=require(_0xd4de('0x1'))['db'][_0xd4de('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd4de('0x3')](0x0);var events={'afterCreate':_0xd4de('0x4'),'afterUpdate':_0xd4de('0x5'),'afterDestroy':_0xd4de('0x6')};function emitEvent(_0x42f90f){return function(_0x20930f,_0x36d4dd,_0x2e8d86){WhatsappMessageEvents[_0xd4de('0x7')](_0x42f90f+':'+_0x20930f['id'],_0x20930f);WhatsappMessageEvents['emit'](_0x42f90f,_0x20930f);_0x2e8d86(null);};}for(var e in events){if(events[_0xd4de('0x8')](e)){var event=events[e];WhatsappMessage[_0xd4de('0x9')](e,emitEvent(event));}}module[_0xd4de('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index a60a68a..4543e18 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 _0xae8f=['define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports'];(function(_0x5e295c,_0x4a2c73){var _0x5899aa=function(_0x25fecf){while(--_0x25fecf){_0x5e295c['push'](_0x5e295c['shift']());}};_0x5899aa(++_0x4a2c73);}(_0xae8f,0x1f4));var _0xfae8=function(_0x10d341,_0x57ff35){_0x10d341=_0x10d341-0x0;var _0xddc36d=_0xae8f[_0x10d341];return _0xddc36d;};'use strict';var _=require('lodash');var util=require(_0xfae8('0x0'));var logger=require(_0xfae8('0x1'))(_0xfae8('0x2'));var moment=require(_0xfae8('0x3'));var BPromise=require(_0xfae8('0x4'));var rp=require(_0xfae8('0x5'));var fetch=require(_0xfae8('0x6'));var fs=require('fs');var path=require(_0xfae8('0x7'));var rimraf=require(_0xfae8('0x8'));var config=require(_0xfae8('0x9'));var attributes=require(_0xfae8('0xa'));module[_0xfae8('0xb')]=function(_0x3d5d4e,_0x103485){return _0x3d5d4e[_0xfae8('0xc')](_0xfae8('0xd'),attributes,{'tableName':_0xfae8('0xe'),'paranoid':![],'indexes':[{'name':_0xfae8('0xf'),'fields':['messageId']},{'name':_0xfae8('0x10'),'fields':['body'],'type':_0xfae8('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31554b,_0x1a4b57,_0x4216b8){var _0x4303b3=_0x3d5d4e['models'];var _0x44590b=_0x31554b[_0xfae8('0x12')]({'plain':!![]});if(_0x44590b[_0xfae8('0x13')][_0xfae8('0x14')]()==='in'||_0x44590b[_0xfae8('0x13')][_0xfae8('0x14')]()===_0xfae8('0x15')&&!_0x44590b[_0xfae8('0x16')]&&!_[_0xfae8('0x17')](_0x44590b[_0xfae8('0x18')])){_0x4303b3[_0xfae8('0x19')][_0xfae8('0x1a')]({'where':{'id':_0x44590b[_0xfae8('0x1b')]}})[_0xfae8('0x1c')](function(_0x3e6fc4){if(_0x3e6fc4){_0x3e6fc4[_0xfae8('0x1d')]({'lastMsgAt':_0x44590b[_0xfae8('0x1e')],'lastMsgDirection':_0x44590b[_0xfae8('0x13')][_0xfae8('0x14')]()});}})[_0xfae8('0x1f')](function(_0x1d22dc){console[_0xfae8('0x20')](_0x1d22dc);});}if(_0x44590b['direction']===_0xfae8('0x15')&&!_0x44590b['secret']){var _0x4847d0;_0x4303b3[_0xfae8('0x21')][_0xfae8('0x22')]({'where':{'id':_0x44590b[_0xfae8('0x23')]},'raw':!![]})[_0xfae8('0x1c')](function(_0x34a687){_0x4847d0=_0x34a687;if(_0x4847d0&&_0x4847d0[_0xfae8('0x24')]){switch(_0x4847d0[_0xfae8('0x24')]){case _0xfae8('0x25'):var _0x46461b=require(_0xfae8('0x25'));if(_0x4847d0[_0xfae8('0x26')]&&_0x4847d0[_0xfae8('0x27')]&&_0x4847d0[_0xfae8('0x28')]){var _0x385b4b=new _0x46461b(_0x4847d0[_0xfae8('0x26')],_0x4847d0['authToken']);_0x385b4b[_0xfae8('0x29')][_0xfae8('0x2a')]({'body':_0x44590b[_0xfae8('0x2b')],'to':_0xfae8('0x2c')+_0x44590b[_0xfae8('0x28')],'from':_0xfae8('0x2c')+_0x4847d0['phone'],'statusCallback':_0x4847d0['remote']+_0xfae8('0x2d')+_0x44590b['id']+_0xfae8('0x2e')+_0x4847d0[_0xfae8('0x2f')]})[_0xfae8('0x1c')](function(_0x34e7f5){if(_0x34e7f5['sid']){return _0x31554b[_0xfae8('0x1d')]({'messageId':_0x34e7f5[_0xfae8('0x30')]});}})[_0xfae8('0x1f')](function(_0x177a4d){logger[_0xfae8('0x20')](_0xfae8('0x31'),'afterCreate',_0xfae8('0x25'),util[_0xfae8('0x32')](_0x177a4d,{'showHidden':![],'depth':null}));});}else{logger[_0xfae8('0x20')](_0xfae8('0x31'),'afterCreate',_0xfae8('0x25'),_0xfae8('0x33'));}break;case _0xfae8('0x34'):var _0x20619b=_0x4847d0['accountSid'];var _0x213c50=_0x4847d0[_0xfae8('0x27')];var _0x173a88=_0x4847d0[_0xfae8('0x35')]+_0xfae8('0x36')+_0x20619b+'/messages/';var _0x8da8fa={'to':[_0x44590b[_0xfae8('0x28')]],'message':{'type':_0xfae8('0x37'),'text':_0x44590b[_0xfae8('0x2b')]}};var _0x43b05a={'method':_0xfae8('0x38'),'uri':_0x173a88,'headers':{'Authorization':'Bearer\x20'+_0x213c50,'Content-Type':_0xfae8('0x39')},'body':_0x8da8fa,'json':!![]};rp(_0x43b05a)[_0xfae8('0x1c')](function(_0x3d1d31){if(_0x3d1d31[_0xfae8('0x3a')][0x0][_0xfae8('0x3b')]){return _0x31554b[_0xfae8('0x1d')]({'messageId':_0x3d1d31[_0xfae8('0x3a')][0x0]['message_id']});}})[_0xfae8('0x1f')](function(_0x51fd3a){logger['err'](_0xfae8('0x3c'),_0x51fd3a);});break;}}})[_0xfae8('0x3d')](function(){_0x4216b8();});}else{_0x4216b8();}}},'charset':_0xfae8('0x3e'),'collate':_0xfae8('0x3f')});}; \ No newline at end of file +var _0x837e=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update','catch','secret','WhatsappAccount','find','then','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error'];(function(_0x404f66,_0x5a4460){var _0x2483c3=function(_0x501369){while(--_0x501369){_0x404f66['push'](_0x404f66['shift']());}};_0x2483c3(++_0x5a4460);}(_0x837e,0x12b));var _0xe837=function(_0x10189c,_0x37a919){_0x10189c=_0x10189c-0x0;var _0x4d6f0a=_0x837e[_0x10189c];return _0x4d6f0a;};'use strict';var _=require(_0xe837('0x0'));var util=require(_0xe837('0x1'));var logger=require(_0xe837('0x2'))('api');var moment=require(_0xe837('0x3'));var BPromise=require(_0xe837('0x4'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xe837('0x5'));var rimraf=require(_0xe837('0x6'));var config=require(_0xe837('0x7'));var attributes=require(_0xe837('0x8'));module[_0xe837('0x9')]=function(_0x3c65c4,_0x51472f){return _0x3c65c4['define'](_0xe837('0xa'),attributes,{'tableName':_0xe837('0xb'),'paranoid':![],'indexes':[{'name':_0xe837('0xc'),'fields':['messageId']},{'name':_0xe837('0xd'),'fields':[_0xe837('0xe')],'type':_0xe837('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x400efc,_0x494491,_0x5d0408){var _0x323424=_0x3c65c4[_0xe837('0x10')];var _0x3fd9ab=_0x400efc['get']({'plain':!![]});if(_0x3fd9ab[_0xe837('0x11')]['toLowerCase']()==='in'||_0x3fd9ab['direction'][_0xe837('0x12')]()===_0xe837('0x13')&&!_0x3fd9ab['secret']&&!_[_0xe837('0x14')](_0x3fd9ab[_0xe837('0x15')])){_0x323424[_0xe837('0x16')]['findOne']({'where':{'id':_0x3fd9ab[_0xe837('0x17')]}})['then'](function(_0x6c43a9){if(_0x6c43a9){_0x6c43a9[_0xe837('0x18')]({'lastMsgAt':_0x3fd9ab['createdAt'],'lastMsgDirection':_0x3fd9ab[_0xe837('0x11')][_0xe837('0x12')]()});}})[_0xe837('0x19')](function(_0x284153){console['error'](_0x284153);});}if(_0x3fd9ab[_0xe837('0x11')]===_0xe837('0x13')&&!_0x3fd9ab[_0xe837('0x1a')]){var _0x15367a;_0x323424[_0xe837('0x1b')][_0xe837('0x1c')]({'where':{'id':_0x3fd9ab['WhatsappAccountId']},'raw':!![]})[_0xe837('0x1d')](function(_0x37917c){_0x15367a=_0x37917c;if(_0x15367a&&_0x15367a['type']){switch(_0x15367a[_0xe837('0x1e')]){case _0xe837('0x1f'):var _0x73dbef=require(_0xe837('0x1f'));if(_0x15367a[_0xe837('0x20')]&&_0x15367a[_0xe837('0x21')]&&_0x15367a[_0xe837('0x22')]){var _0x56c1c8=new _0x73dbef(_0x15367a[_0xe837('0x20')],_0x15367a[_0xe837('0x21')]);_0x56c1c8[_0xe837('0x23')]['create']({'body':_0x3fd9ab[_0xe837('0xe')],'to':_0xe837('0x24')+_0x3fd9ab['phone'],'from':_0xe837('0x24')+_0x15367a['phone'],'statusCallback':_0x15367a[_0xe837('0x25')]+_0xe837('0x26')+_0x3fd9ab['id']+_0xe837('0x27')+_0x15367a[_0xe837('0x28')]})['then'](function(_0x3fe551){if(_0x3fe551[_0xe837('0x29')]){return _0x400efc[_0xe837('0x18')]({'messageId':_0x3fe551[_0xe837('0x29')]});}})[_0xe837('0x19')](function(_0x3feb71){logger[_0xe837('0x2a')](_0xe837('0x2b'),_0xe837('0x2c'),'twilio',util['inspect'](_0x3feb71,{'showHidden':![],'depth':null}));});}else{logger[_0xe837('0x2a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe837('0x2c'),_0xe837('0x1f'),_0xe837('0x2d'));}break;case _0xe837('0x2e'):var _0x1ac0f8=_0x15367a[_0xe837('0x20')];var _0x475b63=_0x15367a[_0xe837('0x21')];var _0x4d3fde=_0x15367a[_0xe837('0x2f')]+_0xe837('0x30')+_0x1ac0f8+'/messages/';var _0x458703={'to':[_0x3fd9ab['phone']],'message':{'type':_0xe837('0x31'),'text':_0x3fd9ab[_0xe837('0xe')]}};var _0x94f6b3={'method':'POST','uri':_0x4d3fde,'headers':{'Authorization':_0xe837('0x32')+_0x475b63,'Content-Type':_0xe837('0x33')},'body':_0x458703,'json':!![]};rp(_0x94f6b3)['then'](function(_0x9ec9eb){if(_0x9ec9eb[_0xe837('0x34')][0x0]['message_id']){return _0x400efc[_0xe837('0x18')]({'messageId':_0x9ec9eb[_0xe837('0x34')][0x0][_0xe837('0x35')]});}})[_0xe837('0x19')](function(_0x1a3512){logger['err']('WhatsappMessage,\x20%s',_0x1a3512);});break;}}})[_0xe837('0x36')](function(){_0x5d0408();});}else{_0x5d0408();}}},'charset':_0xe837('0x37'),'collate':_0xe837('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f44c248..b07139a 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 _0x61ff=['redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','then','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x61ff,0xd7));var _0xf61f=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x61ff[_0x38ff1e];return _0x3755d4;};'use strict';var _=require('lodash');var util=require(_0xf61f('0x0'));var moment=require('moment');var BPromise=require(_0xf61f('0x1'));var rs=require(_0xf61f('0x2'));var fs=require('fs');var Redis=require(_0xf61f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf61f('0x4'));var logger=require(_0xf61f('0x5'))(_0xf61f('0x6'));var config=require(_0xf61f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf61f('0x8')]({'port':0x232a});config[_0xf61f('0x9')]=_[_0xf61f('0xa')](config[_0xf61f('0x9')],{'host':_0xf61f('0xb'),'port':0x18eb});var socket=require(_0xf61f('0xc'))(new Redis(config['redis']));require(_0xf61f('0xd'))[_0xf61f('0xe')](socket);function respondWithRpcPromise(_0x31c724,_0xc2071d,_0x151372){return new BPromise(function(_0x321667,_0x165fd1){return client['request'](_0x31c724,_0x151372)['then'](function(_0x452db2){logger[_0xf61f('0xf')](_0xf61f('0x10'),_0xc2071d,_0xf61f('0x11'));logger[_0xf61f('0x12')](_0xf61f('0x13'),_0xc2071d,_0xf61f('0x11'),JSON[_0xf61f('0x14')](_0x452db2));if(_0x452db2[_0xf61f('0x15')]){if(_0x452db2[_0xf61f('0x15')][_0xf61f('0x16')]===0x1f4){logger[_0xf61f('0x15')](_0xf61f('0x10'),_0xc2071d,_0x452db2[_0xf61f('0x15')][_0xf61f('0x17')]);return _0x165fd1(_0x452db2[_0xf61f('0x15')]['message']);}logger['error'](_0xf61f('0x10'),_0xc2071d,_0x452db2[_0xf61f('0x15')][_0xf61f('0x17')]);return _0x321667(_0x452db2[_0xf61f('0x15')][_0xf61f('0x17')]);}else{logger[_0xf61f('0xf')](_0xf61f('0x10'),_0xc2071d,'request\x20sent');_0x321667(_0x452db2[_0xf61f('0x18')]['message']);}})[_0xf61f('0x19')](function(_0x2c2942){logger['error'](_0xf61f('0x10'),_0xc2071d,_0x2c2942);_0x165fd1(_0x2c2942);});});}exports[_0xf61f('0x1a')]=function(_0x1beb0e){var _0x25ab17=this;return new Promise(function(_0x2bb741,_0x4bc607){return db[_0xf61f('0x1b')]['create'](_0x1beb0e[_0xf61f('0x1c')],{'raw':_0x1beb0e[_0xf61f('0x1d')]?_0x1beb0e[_0xf61f('0x1d')][_0xf61f('0x1e')]===undefined?!![]:![]:!![]})[_0xf61f('0x1f')](function(_0x21f7de){logger[_0xf61f('0xf')](_0xf61f('0x1a'),_0x1beb0e);logger['debug'](_0xf61f('0x1a'),_0x1beb0e,JSON[_0xf61f('0x14')](_0x21f7de));_0x2bb741(_0x21f7de);})[_0xf61f('0x19')](function(_0x464fb2){logger[_0xf61f('0x15')]('CreateWhatsappMessage',_0x464fb2['message'],_0x1beb0e);_0x4bc607(_0x25ab17[_0xf61f('0x15')](0x1f4,_0x464fb2['message']));});});}; \ No newline at end of file +var _0xac7d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappMessage','create','body','options','raw','then','util','bluebird'];(function(_0x639a25,_0x6038e4){var _0x4be530=function(_0x792140){while(--_0x792140){_0x639a25['push'](_0x639a25['shift']());}};_0x4be530(++_0x6038e4);}(_0xac7d,0x1da));var _0xdac7=function(_0x2a9a20,_0x2a05d2){_0x2a9a20=_0x2a9a20-0x0;var _0x186fe3=_0xac7d[_0x2a9a20];return _0x186fe3;};'use strict';var _=require('lodash');var util=require(_0xdac7('0x0'));var moment=require('moment');var BPromise=require(_0xdac7('0x1'));var rs=require(_0xdac7('0x2'));var fs=require('fs');var Redis=require(_0xdac7('0x3'));var db=require(_0xdac7('0x4'))['db'];var utils=require(_0xdac7('0x5'));var logger=require(_0xdac7('0x6'))(_0xdac7('0x7'));var config=require(_0xdac7('0x8'));var jayson=require(_0xdac7('0x9'));var client=jayson[_0xdac7('0xa')][_0xdac7('0xb')]({'port':0x232a});config[_0xdac7('0xc')]=_[_0xdac7('0xd')](config[_0xdac7('0xc')],{'host':_0xdac7('0xe'),'port':0x18eb});var socket=require(_0xdac7('0xf'))(new Redis(config[_0xdac7('0xc')]));require(_0xdac7('0x10'))[_0xdac7('0x11')](socket);function respondWithRpcPromise(_0xa34947,_0x42802e,_0x2dded3){return new BPromise(function(_0x5a2291,_0xc36715){return client[_0xdac7('0x12')](_0xa34947,_0x2dded3)['then'](function(_0x2a39cb){logger[_0xdac7('0x13')](_0xdac7('0x14'),_0x42802e,_0xdac7('0x15'));logger['debug'](_0xdac7('0x16'),_0x42802e,_0xdac7('0x15'),JSON[_0xdac7('0x17')](_0x2a39cb));if(_0x2a39cb[_0xdac7('0x18')]){if(_0x2a39cb[_0xdac7('0x18')][_0xdac7('0x19')]===0x1f4){logger[_0xdac7('0x18')](_0xdac7('0x14'),_0x42802e,_0x2a39cb[_0xdac7('0x18')][_0xdac7('0x1a')]);return _0xc36715(_0x2a39cb[_0xdac7('0x18')][_0xdac7('0x1a')]);}logger[_0xdac7('0x18')](_0xdac7('0x14'),_0x42802e,_0x2a39cb[_0xdac7('0x18')][_0xdac7('0x1a')]);return _0x5a2291(_0x2a39cb[_0xdac7('0x18')][_0xdac7('0x1a')]);}else{logger['info'](_0xdac7('0x14'),_0x42802e,'request\x20sent');_0x5a2291(_0x2a39cb['result'][_0xdac7('0x1a')]);}})[_0xdac7('0x1b')](function(_0x2f7cb4){logger['error'](_0xdac7('0x14'),_0x42802e,_0x2f7cb4);_0xc36715(_0x2f7cb4);});});}exports[_0xdac7('0x1c')]=function(_0x16fd67){var _0x183807=this;return new Promise(function(_0x7f0e00,_0xf82c46){return db['WhatsappMessage'][_0xdac7('0x1d')](_0x16fd67[_0xdac7('0x1e')],{'raw':_0x16fd67[_0xdac7('0x1f')]?_0x16fd67[_0xdac7('0x1f')][_0xdac7('0x20')]===undefined?!![]:![]:!![]})[_0xdac7('0x21')](function(_0x5312bd){logger[_0xdac7('0x13')](_0xdac7('0x1c'),_0x16fd67);logger['debug'](_0xdac7('0x1c'),_0x16fd67,JSON['stringify'](_0x5312bd));_0x7f0e00(_0x5312bd);})['catch'](function(_0x5bb217){logger[_0xdac7('0x18')](_0xdac7('0x1c'),_0x5bb217['message'],_0x16fd67);_0xf82c46(_0x183807[_0xdac7('0x18')](0x1f4,_0x5bb217['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 58857b7..aaffd98 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 _0x0add=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0x0add,0x161));var _0xd0ad=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x0add[_0xf0bc07];return _0x1c50c2;};'use strict';var WhatsappMessageEvents=require(_0xd0ad('0x0'));var events=[_0xd0ad('0x1'),_0xd0ad('0x2'),_0xd0ad('0x3')];function createListener(_0x519278,_0x3a5e4a){return function(_0x1ef50b){_0x3a5e4a[_0xd0ad('0x4')](_0x519278,_0x1ef50b);};}function removeListener(_0x40732e,_0x37480a){return function(){WhatsappMessageEvents[_0xd0ad('0x5')](_0x40732e,_0x37480a);};}exports[_0xd0ad('0x6')]=function(_0x39588c){for(var _0x658005=0x0,_0x4b68c0=events['length'];_0x658005<_0x4b68c0;_0x658005++){var _0x1d9803=events[_0x658005];var _0x27016a=createListener(_0xd0ad('0x7')+_0x1d9803,_0x39588c);WhatsappMessageEvents['on'](_0x1d9803,_0x27016a);}}; \ No newline at end of file +var _0x3fdf=['update','emit','length','./whatsappMessage.events','save'];(function(_0x3260a6,_0x5cd45d){var _0x50b7a6=function(_0x362833){while(--_0x362833){_0x3260a6['push'](_0x3260a6['shift']());}};_0x50b7a6(++_0x5cd45d);}(_0x3fdf,0x120));var _0xf3fd=function(_0x3a6255,_0x69592f){_0x3a6255=_0x3a6255-0x0;var _0xaf2b15=_0x3fdf[_0x3a6255];return _0xaf2b15;};'use strict';var WhatsappMessageEvents=require(_0xf3fd('0x0'));var events=[_0xf3fd('0x1'),'remove',_0xf3fd('0x2')];function createListener(_0xd46e27,_0x542611){return function(_0x5a288a){_0x542611[_0xf3fd('0x3')](_0xd46e27,_0x5a288a);};}function removeListener(_0x52bb32,_0x96e9c7){return function(){WhatsappMessageEvents['removeListener'](_0x52bb32,_0x96e9c7);};}exports['register']=function(_0x51a8a3){for(var _0x1a5460=0x0,_0x57dc03=events[_0xf3fd('0x4')];_0x1a5460<_0x57dc03;_0x1a5460++){var _0x22aa3b=events[_0x1a5460];var _0x47d3da=createListener('whatsappMessage:'+_0x22aa3b,_0x51a8a3);WhatsappMessageEvents['on'](_0x22aa3b,_0x47d3da);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 7e85a57..d0bfa48 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 _0xfad0=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','create','post'];(function(_0x3763da,_0x58158b){var _0x5d192f=function(_0x329668){while(--_0x329668){_0x3763da['push'](_0x3763da['shift']());}};_0x5d192f(++_0x58158b);}(_0xfad0,0x12a));var _0x0fad=function(_0x5c2c45,_0x1f79d2){_0x5c2c45=_0x5c2c45-0x0;var _0x295a9b=_0xfad0[_0x5c2c45];return _0x295a9b;};'use strict';var multer=require(_0x0fad('0x0'));var util=require(_0x0fad('0x1'));var path=require(_0x0fad('0x2'));var timeout=require(_0x0fad('0x3'));var express=require('express');var router=express[_0x0fad('0x4')]();var fs_extra=require(_0x0fad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fad('0x6'));var config=require(_0x0fad('0x7'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x0fad('0x8')](),controller[_0x0fad('0x9')]);router[_0x0fad('0xa')](_0x0fad('0xb'),auth[_0x0fad('0x8')](),controller[_0x0fad('0xc')]);router[_0x0fad('0xa')](_0x0fad('0xd'),auth[_0x0fad('0x8')](),controller[_0x0fad('0xe')]);router[_0x0fad('0xa')](_0x0fad('0xf'),auth[_0x0fad('0x8')](),controller['getMembers']);router[_0x0fad('0xa')](_0x0fad('0x10'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x11')]);router[_0x0fad('0xa')](_0x0fad('0x12'),auth[_0x0fad('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0fad('0x13')]);router[_0x0fad('0x14')]('/:id/teams',auth[_0x0fad('0x8')](),controller[_0x0fad('0x15')]);router[_0x0fad('0x14')](_0x0fad('0x12'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x16')]);router['put'](_0x0fad('0xd'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x17')]);router[_0x0fad('0x18')](_0x0fad('0xd'),auth[_0x0fad('0x8')](),controller[_0x0fad('0x19')]);router['delete'](_0x0fad('0x10'),auth['isAuthenticated'](),controller[_0x0fad('0x1a')]);router[_0x0fad('0x18')](_0x0fad('0x12'),auth['isAuthenticated'](),controller[_0x0fad('0x1b')]);module[_0x0fad('0x1c')]=router; \ No newline at end of file +var _0xaf52=['fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe','describe','/:id','show','/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express'];(function(_0x167295,_0x555a81){var _0x400be6=function(_0x1edcba){while(--_0x1edcba){_0x167295['push'](_0x167295['shift']());}};_0x400be6(++_0x555a81);}(_0xaf52,0x88));var _0x2af5=function(_0x1a91f0,_0x11e203){_0x1a91f0=_0x1a91f0-0x0;var _0x12f862=_0xaf52[_0x1a91f0];return _0x12f862;};'use strict';var multer=require(_0x2af5('0x0'));var util=require('util');var path=require(_0x2af5('0x1'));var timeout=require(_0x2af5('0x2'));var express=require(_0x2af5('0x3'));var router=express['Router']();var fs_extra=require(_0x2af5('0x4'));var auth=require(_0x2af5('0x5'));var interaction=require(_0x2af5('0x6'));var config=require('../../config/environment');var controller=require(_0x2af5('0x7'));router[_0x2af5('0x8')]('/',auth['isAuthenticated'](),controller[_0x2af5('0x9')]);router[_0x2af5('0x8')](_0x2af5('0xa'),auth['isAuthenticated'](),controller[_0x2af5('0xb')]);router['get'](_0x2af5('0xc'),auth['isAuthenticated'](),controller[_0x2af5('0xd')]);router[_0x2af5('0x8')](_0x2af5('0xe'),auth[_0x2af5('0xf')](),controller[_0x2af5('0x10')]);router[_0x2af5('0x8')](_0x2af5('0x11'),auth[_0x2af5('0xf')](),controller[_0x2af5('0x12')]);router[_0x2af5('0x8')](_0x2af5('0x13'),auth[_0x2af5('0xf')](),controller[_0x2af5('0x14')]);router['post']('/',auth[_0x2af5('0xf')](),controller[_0x2af5('0x15')]);router[_0x2af5('0x16')](_0x2af5('0x11'),auth[_0x2af5('0xf')](),controller['addTeams']);router[_0x2af5('0x16')](_0x2af5('0x13'),auth[_0x2af5('0xf')](),controller['addAgents']);router['put']('/:id',auth[_0x2af5('0xf')](),controller[_0x2af5('0x17')]);router[_0x2af5('0x18')](_0x2af5('0xc'),auth['isAuthenticated'](),controller[_0x2af5('0x19')]);router[_0x2af5('0x18')](_0x2af5('0x11'),auth[_0x2af5('0xf')](),controller[_0x2af5('0x1a')]);router[_0x2af5('0x18')]('/:id/users',auth[_0x2af5('0xf')](),controller[_0x2af5('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 805712a..8ac667b 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 _0xbf1a=['STRING','name','INTEGER','rrmemory','roundrobin','sequelize','exports'];(function(_0x25c062,_0x44dc62){var _0x16c3cd=function(_0x41b7eb){while(--_0x41b7eb){_0x25c062['push'](_0x25c062['shift']());}};_0x16c3cd(++_0x44dc62);}(_0xbf1a,0x7c));var _0xabf1=function(_0x509628,_0x4d0d6b){_0x509628=_0x509628-0x0;var _0x6482c4=_0xbf1a[_0x509628];return _0x6482c4;};'use strict';var Sequelize=require(_0xabf1('0x0'));module[_0xabf1('0x1')]={'name':{'type':Sequelize[_0xabf1('0x2')],'unique':_0xabf1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xabf1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xabf1('0x5'),'beepall',_0xabf1('0x6'))},'description':{'type':Sequelize[_0xabf1('0x2')]}}; \ No newline at end of file +var _0xacb8=['STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x58263d,_0x32ef94){var _0x186a95=function(_0x41798d){while(--_0x41798d){_0x58263d['push'](_0x58263d['shift']());}};_0x186a95(++_0x32ef94);}(_0xacb8,0x119));var _0x8acb=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0xacb8[_0x838813];return _0x2bd32d;};'use strict';var Sequelize=require(_0x8acb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8acb('0x1')],'unique':_0x8acb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8acb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8acb('0x4'),_0x8acb('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x8acb('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7c5efdb..fe2a972 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 _0x0339=['count','set','Content-Range','json','apply','reject','update','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','WhatsappQueue','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','include','rows','catch','show','keys','rawAttributes','intersection','length','includeAll','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','params','describe','getMembers','findOne','order','WhatsappQueueId','findAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','Agents','select','field','tq.TeamId','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','ids','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userWhatsappQueue:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit'];(function(_0x29e722,_0x33e8a7){var _0x5231ca=function(_0xdeada8){while(--_0xdeada8){_0x29e722['push'](_0x29e722['shift']());}};_0x5231ca(++_0x33e8a7);}(_0x0339,0x69));var _0x9033=function(_0x2eb22f,_0x46fb79){_0x2eb22f=_0x2eb22f-0x0;var _0x2b47a2=_0x0339[_0x2eb22f];return _0x2b47a2;};'use strict';var emlformat=require(_0x9033('0x0'));var rimraf=require(_0x9033('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9033('0x2'));var rp=require('request-promise');var moment=require(_0x9033('0x3'));var BPromise=require(_0x9033('0x4'));var Mustache=require('mustache');var util=require(_0x9033('0x5'));var path=require(_0x9033('0x6'));var sox=require(_0x9033('0x7'));var csv=require(_0x9033('0x8'));var ejs=require(_0x9033('0x9'));var fs=require('fs');var fs_extra=require(_0x9033('0xa'));var _=require(_0x9033('0xb'));var squel=require('squel');var crypto=require(_0x9033('0xc'));var jsforce=require(_0x9033('0xd'));var deskjs=require(_0x9033('0xe'));var toCsv=require(_0x9033('0x8'));var querystring=require(_0x9033('0xf'));var Papa=require(_0x9033('0x10'));var Redis=require(_0x9033('0x11'));var authService=require(_0x9033('0x12'));var qs=require(_0x9033('0x13'));var as=require(_0x9033('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9033('0x15'))(_0x9033('0x16'));var utils=require(_0x9033('0x17'));var config=require(_0x9033('0x18'));var licenseUtil=require(_0x9033('0x19'));var db=require(_0x9033('0x1a'))['db'];config['redis']=_[_0x9033('0x1b')](config[_0x9033('0x1c')],{'host':_0x9033('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9033('0x1e'))[_0x9033('0x1f')](socket);function respondWithStatusCode(_0x16e76f,_0x2b042c){_0x2b042c=_0x2b042c||0xcc;return function(_0x2d20fd){if(_0x2d20fd){return _0x16e76f[_0x9033('0x20')](_0x2b042c);}return _0x16e76f[_0x9033('0x21')](_0x2b042c)[_0x9033('0x22')]();};}function respondWithResult(_0x5e05dd,_0x19206b){_0x19206b=_0x19206b||0xc8;return function(_0x5439de){if(_0x5439de){return _0x5e05dd['status'](_0x19206b)['json'](_0x5439de);}};}function respondWithFilteredResult(_0x3701dd,_0x33efd4){return function(_0x287df0){if(_0x287df0){var _0x5637b4=typeof _0x33efd4[_0x9033('0x23')]===_0x9033('0x24')&&typeof _0x33efd4[_0x9033('0x25')]===_0x9033('0x24');var _0x172bb0=_0x287df0[_0x9033('0x26')];var _0x35d703=_0x5637b4?0x0:_0x33efd4[_0x9033('0x23')];var _0x3b67ff=_0x5637b4?_0x287df0[_0x9033('0x26')]:_0x33efd4[_0x9033('0x23')]+_0x33efd4['limit'];var _0x22ee1c;if(_0x3b67ff>=_0x172bb0){_0x3b67ff=_0x172bb0;_0x22ee1c=0xc8;}else{_0x22ee1c=0xce;}_0x3701dd['status'](_0x22ee1c);return _0x3701dd[_0x9033('0x27')](_0x9033('0x28'),_0x35d703+'-'+_0x3b67ff+'/'+_0x172bb0)[_0x9033('0x29')](_0x287df0);}return null;};}function patchUpdates(_0xe8b2b7){return function(_0x1680a8){try{jsonpatch[_0x9033('0x2a')](_0x1680a8,_0xe8b2b7,!![]);}catch(_0x215629){return BPromise[_0x9033('0x2b')](_0x215629);}return _0x1680a8['save']();};}function saveUpdates(_0x12ac12,_0x306a49){return function(_0x81c337){if(_0x81c337){return _0x81c337[_0x9033('0x2c')](_0x12ac12)['then'](function(_0x280d7c){return _0x280d7c;});}return null;};}function removeEntity(_0x450c68,_0x52a080){return function(_0x1ec93d){if(_0x1ec93d){return _0x1ec93d[_0x9033('0x2d')]()[_0x9033('0x2e')](function(){var _0xe6ff56=_0x1ec93d[_0x9033('0x2f')]({'plain':!![]});var _0x2e4fd7=_0x9033('0x30');return db[_0x9033('0x31')]['destroy']({'where':{'type':_0x2e4fd7,'resourceId':_0xe6ff56['id']}})[_0x9033('0x2e')](function(){return _0x1ec93d;});})[_0x9033('0x2e')](function(){_0x450c68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce017,_0x746c4f){return function(_0x458cd0){if(!_0x458cd0){_0x4ce017[_0x9033('0x20')](0x194);}return _0x458cd0;};}function handleError(_0x5eef87,_0x293acf){_0x293acf=_0x293acf||0x1f4;return function(_0x12a269){logger[_0x9033('0x32')](_0x12a269[_0x9033('0x33')]);if(_0x12a269[_0x9033('0x34')]){delete _0x12a269['name'];}_0x5eef87[_0x9033('0x21')](_0x293acf)[_0x9033('0x35')](_0x12a269);};}exports['index']=function(_0x4c4fe8,_0x5de4a4){var _0x71d9ce={},_0x53c20a={},_0x294f85={'count':0x0,'rows':[]};var _0xc1c917=_['map'](db[_0x9033('0x36')]['rawAttributes'],function(_0x385ca4){return{'name':_0x385ca4[_0x9033('0x37')],'type':_0x385ca4[_0x9033('0x38')][_0x9033('0x39')]};});_0x53c20a[_0x9033('0x3a')]=_['map'](_0xc1c917,'name');_0x53c20a[_0x9033('0x3b')]=_['keys'](_0x4c4fe8['query']);_0x53c20a[_0x9033('0x3c')]=_['intersection'](_0x53c20a[_0x9033('0x3a')],_0x53c20a['query']);_0x71d9ce[_0x9033('0x3d')]=_['intersection'](_0x53c20a['model'],qs[_0x9033('0x3e')](_0x4c4fe8['query']['fields']));_0x71d9ce[_0x9033('0x3d')]=_0x71d9ce['attributes']['length']?_0x71d9ce[_0x9033('0x3d')]:_0x53c20a[_0x9033('0x3a')];if(!_0x4c4fe8[_0x9033('0x3b')][_0x9033('0x3f')](_0x9033('0x40'))){_0x71d9ce['limit']=qs[_0x9033('0x25')](_0x4c4fe8[_0x9033('0x3b')][_0x9033('0x25')]);_0x71d9ce['offset']=qs['offset'](_0x4c4fe8[_0x9033('0x3b')][_0x9033('0x23')]);}_0x71d9ce['order']=qs[_0x9033('0x41')](_0x4c4fe8['query']['sort']);_0x71d9ce[_0x9033('0x42')]=qs[_0x9033('0x3c')](_[_0x9033('0x43')](_0x4c4fe8['query'],_0x53c20a['filters']),_0xc1c917);if(_0x4c4fe8[_0x9033('0x3b')][_0x9033('0x44')]){_0x71d9ce[_0x9033('0x42')]=_[_0x9033('0x45')](_0x71d9ce[_0x9033('0x42')],{'$or':_[_0x9033('0x46')](_0xc1c917,function(_0x5329a8){if(_0x5329a8[_0x9033('0x38')]!=='VIRTUAL'){var _0x45ae88={};_0x45ae88[_0x5329a8[_0x9033('0x34')]]={'$like':'%'+_0x4c4fe8[_0x9033('0x3b')]['filter']+'%'};return _0x45ae88;}})});}_0x71d9ce=_[_0x9033('0x45')]({},_0x71d9ce,_0x4c4fe8['options']);var _0xc089c0={'where':_0x71d9ce[_0x9033('0x42')]};return db[_0x9033('0x36')][_0x9033('0x26')](_0xc089c0)['then'](function(_0x40d8ec){_0x294f85[_0x9033('0x26')]=_0x40d8ec;if(_0x4c4fe8[_0x9033('0x3b')]['includeAll']){_0x71d9ce[_0x9033('0x47')]=[{'all':!![]}];}return db[_0x9033('0x36')]['findAll'](_0x71d9ce);})['then'](function(_0x4e1581){_0x294f85[_0x9033('0x48')]=_0x4e1581;return _0x294f85;})[_0x9033('0x2e')](respondWithFilteredResult(_0x5de4a4,_0x71d9ce))[_0x9033('0x49')](handleError(_0x5de4a4,null));};exports[_0x9033('0x4a')]=function(_0x46268a,_0x307293){var _0x1620ad={'raw':!![],'where':{'id':_0x46268a['params']['id']}},_0x8186cf={};_0x8186cf['model']=_[_0x9033('0x4b')](db['WhatsappQueue'][_0x9033('0x4c')]);_0x8186cf[_0x9033('0x3b')]=_[_0x9033('0x4b')](_0x46268a[_0x9033('0x3b')]);_0x8186cf[_0x9033('0x3c')]=_['intersection'](_0x8186cf[_0x9033('0x3a')],_0x8186cf[_0x9033('0x3b')]);_0x1620ad['attributes']=_[_0x9033('0x4d')](_0x8186cf[_0x9033('0x3a')],qs[_0x9033('0x3e')](_0x46268a[_0x9033('0x3b')][_0x9033('0x3e')]));_0x1620ad['attributes']=_0x1620ad[_0x9033('0x3d')][_0x9033('0x4e')]?_0x1620ad[_0x9033('0x3d')]:_0x8186cf[_0x9033('0x3a')];if(_0x46268a[_0x9033('0x3b')][_0x9033('0x4f')]){_0x1620ad[_0x9033('0x47')]=[{'all':!![]}];}_0x1620ad=_[_0x9033('0x45')]({},_0x1620ad,_0x46268a[_0x9033('0x50')]);return db[_0x9033('0x36')][_0x9033('0x51')](_0x1620ad)['then'](handleEntityNotFound(_0x307293,null))[_0x9033('0x2e')](respondWithResult(_0x307293,null))['catch'](handleError(_0x307293,null));};exports['create']=function(_0x3f2b57,_0x1fd342){return db['WhatsappQueue']['create'](_0x3f2b57[_0x9033('0x52')],{})[_0x9033('0x2e')](function(_0x1772ad){var _0x535231=_0x3f2b57['user']['get']({'plain':!![]});if(!_0x535231)throw new Error(_0x9033('0x53'));if(_0x535231['role']===_0x9033('0x54')){var _0x48cde8=_0x1772ad[_0x9033('0x2f')]({'plain':!![]});var _0x266c37=_0x9033('0x30');return db[_0x9033('0x55')]['find']({'where':{'name':_0x266c37,'userProfileId':_0x535231['userProfileId']},'raw':!![]})[_0x9033('0x2e')](function(_0x4aa5f3){if(_0x4aa5f3&&_0x4aa5f3[_0x9033('0x56')]===0x0){return db[_0x9033('0x31')]['create']({'name':_0x48cde8[_0x9033('0x34')],'resourceId':_0x48cde8['id'],'type':_0x4aa5f3[_0x9033('0x34')],'sectionId':_0x4aa5f3['id']},{})['then'](function(){return _0x1772ad;});}else{return _0x1772ad;}})[_0x9033('0x49')](function(_0x340ae0){logger[_0x9033('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x340ae0);throw _0x340ae0;});}return _0x1772ad;})[_0x9033('0x2e')](respondWithResult(_0x1fd342,0xc9))['catch'](handleError(_0x1fd342,null));};exports[_0x9033('0x2c')]=function(_0x56f308,_0x22475b){if(_0x56f308[_0x9033('0x52')]['id']){delete _0x56f308[_0x9033('0x52')]['id'];}return db[_0x9033('0x36')][_0x9033('0x51')]({'where':{'id':_0x56f308[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x22475b,null))[_0x9033('0x2e')](saveUpdates(_0x56f308[_0x9033('0x52')],null))['then'](respondWithResult(_0x22475b,null))[_0x9033('0x49')](handleError(_0x22475b,null));};exports[_0x9033('0x2d')]=function(_0x4ae2d1,_0x3a3f70){return db[_0x9033('0x36')][_0x9033('0x51')]({'where':{'id':_0x4ae2d1[_0x9033('0x57')]['id']}})['then'](handleEntityNotFound(_0x3a3f70,null))[_0x9033('0x2e')](removeEntity(_0x3a3f70,null))[_0x9033('0x49')](handleError(_0x3a3f70,null));};exports[_0x9033('0x58')]=function(_0x3efade,_0x2ee9d3){return db['WhatsappQueue']['describe']()['then'](respondWithResult(_0x2ee9d3,null))[_0x9033('0x49')](handleError(_0x2ee9d3,null));};exports[_0x9033('0x59')]=function(_0x543944,_0x36a00a,_0x182ca7){var _0x5bd8c6={'raw':!![],'where':{}},_0x27bdde={},_0x1e34e3;return db['WhatsappQueue'][_0x9033('0x5a')]({'where':{'id':_0x543944[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x36a00a,null))['then'](function(_0xe03932){if(_0xe03932){_0x1e34e3=_0xe03932[_0x9033('0x2f')]({'plain':!![]});_0x27bdde[_0x9033('0x3a')]=_[_0x9033('0x4b')](db['UserWhatsappQueue'][_0x9033('0x4c')]);_0x27bdde[_0x9033('0x3b')]=_[_0x9033('0x4b')](_0x543944['query']);_0x27bdde['filters']=_[_0x9033('0x4d')](_0x27bdde['model'],_0x27bdde['query']);_0x5bd8c6[_0x9033('0x3d')]=_['intersection'](_0x27bdde[_0x9033('0x3a')],qs[_0x9033('0x3e')](_0x543944[_0x9033('0x3b')][_0x9033('0x3e')]));_0x5bd8c6[_0x9033('0x3d')]=_0x5bd8c6[_0x9033('0x3d')][_0x9033('0x4e')]?_0x5bd8c6['attributes']:_0x27bdde['model'];if(!_0x543944[_0x9033('0x3b')]['hasOwnProperty'](_0x9033('0x40'))){_0x5bd8c6[_0x9033('0x25')]=qs[_0x9033('0x25')](_0x543944[_0x9033('0x3b')]['limit']);_0x5bd8c6[_0x9033('0x23')]=qs[_0x9033('0x23')](_0x543944[_0x9033('0x3b')][_0x9033('0x23')]);}_0x5bd8c6[_0x9033('0x5b')]=qs[_0x9033('0x41')](_0x543944[_0x9033('0x3b')]['sort']);_0x5bd8c6[_0x9033('0x42')]=qs[_0x9033('0x3c')](_[_0x9033('0x43')](_0x543944[_0x9033('0x3b')],_0x27bdde[_0x9033('0x3c')]));_0x5bd8c6['where'][_0x9033('0x5c')]=_0xe03932['id'];if(_0x543944['query'][_0x9033('0x44')]){_0x5bd8c6['where']=_[_0x9033('0x45')](_0x5bd8c6[_0x9033('0x42')],{'$or':_['map'](_0x5bd8c6[_0x9033('0x3d')],function(_0x42a824){var _0x47e827={};_0x47e827[_0x42a824]={'$like':'%'+_0x543944[_0x9033('0x3b')][_0x9033('0x44')]+'%'};return _0x47e827;})});}_0x5bd8c6=_[_0x9033('0x45')]({},_0x5bd8c6,_0x543944[_0x9033('0x50')]);return db['UserWhatsappQueue'][_0x9033('0x5d')](_0x5bd8c6);}})['then'](function(_0x4dd3c6){if(_0x4dd3c6){return db['User']['findAndCountAll']({'where':{'id':_[_0x9033('0x46')](_0x4dd3c6,_0x9033('0x5e')),'role':_0x9033('0x5f')},'attributes':['id',_0x9033('0x34'),_0x9033('0x60'),_0x9033('0x61'),_0x9033('0x62')]});}})[_0x9033('0x2e')](function(_0x50df5c){if(_0x50df5c){return{'count':_0x50df5c[_0x9033('0x26')],'rows':_[_0x9033('0x46')](_0x50df5c[_0x9033('0x48')],function(_0x2a7a78){return{'membername':_0x2a7a78[_0x9033('0x34')],'UserId':_0x2a7a78['id'],'queue_name':_0x1e34e3[_0x9033('0x34')],'WhatsappQueueId':_0x1e34e3['id'],'interface':util['format'](_0x9033('0x63'),_0x9033('0x64'),_0x2a7a78['name']),'penalty':0x0,'paused':_0x2a7a78[_0x9033('0x60')],'createdAt':_0x2a7a78[_0x9033('0x62')],'updatedAt':_0x2a7a78[_0x9033('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36a00a,_0x5bd8c6))[_0x9033('0x49')](handleError(_0x36a00a,null));};exports[_0x9033('0x65')]=function(_0x1fd3ab,_0x299047,_0x428a97){var _0x1ca672={};var _0x167a7f={};var _0x99eec2;var _0x42432e;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1fd3ab[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x299047,null))[_0x9033('0x2e')](function(_0x31d932){if(_0x31d932){_0x99eec2=_0x31d932;_0x167a7f[_0x9033('0x3a')]=_[_0x9033('0x4b')](db[_0x9033('0x66')][_0x9033('0x4c')]);_0x167a7f[_0x9033('0x3b')]=_['keys'](_0x1fd3ab[_0x9033('0x3b')]);_0x167a7f[_0x9033('0x3c')]=_[_0x9033('0x4d')](_0x167a7f[_0x9033('0x3a')],_0x167a7f[_0x9033('0x3b')]);_0x1ca672[_0x9033('0x3d')]=_['intersection'](_0x167a7f['model'],qs['fields'](_0x1fd3ab['query']['fields']));_0x1ca672[_0x9033('0x3d')]=_0x1ca672[_0x9033('0x3d')][_0x9033('0x4e')]?_0x1ca672['attributes']:_0x167a7f['model'];_0x1ca672[_0x9033('0x5b')]=qs['sort'](_0x1fd3ab[_0x9033('0x3b')][_0x9033('0x41')]);_0x1ca672[_0x9033('0x42')]=qs[_0x9033('0x3c')](_[_0x9033('0x43')](_0x1fd3ab[_0x9033('0x3b')],_0x167a7f[_0x9033('0x3c')]));if(_0x1fd3ab[_0x9033('0x3b')][_0x9033('0x44')]){_0x1ca672[_0x9033('0x42')]=_['merge'](_0x1ca672[_0x9033('0x42')],{'$or':_[_0x9033('0x46')](_0x1ca672['attributes'],function(_0x3aeac9){var _0x538fcd={};_0x538fcd[_0x3aeac9]={'$like':'%'+_0x1fd3ab[_0x9033('0x3b')][_0x9033('0x44')]+'%'};return _0x538fcd;})});}_0x1ca672=_[_0x9033('0x45')]({},_0x1ca672,_0x1fd3ab['options']);return _0x99eec2[_0x9033('0x65')](_0x1ca672);}})[_0x9033('0x2e')](function(_0x3e1202){if(_0x3e1202){_0x42432e=_0x3e1202[_0x9033('0x4e')];if(!_0x1fd3ab[_0x9033('0x3b')][_0x9033('0x3f')](_0x9033('0x40'))){_0x1ca672[_0x9033('0x25')]=qs[_0x9033('0x25')](_0x1fd3ab[_0x9033('0x3b')]['limit']);_0x1ca672[_0x9033('0x23')]=qs['offset'](_0x1fd3ab['query'][_0x9033('0x23')]);}return _0x99eec2[_0x9033('0x65')](_0x1ca672);}})[_0x9033('0x2e')](function(_0x4bbb26){if(_0x4bbb26){return _0x4bbb26?{'count':_0x42432e,'rows':_0x4bbb26}:null;}})['then'](respondWithResult(_0x299047,null))['catch'](handleError(_0x299047,null));};exports[_0x9033('0x67')]=function(_0x4f362f,_0x884d5f,_0x24244c){var _0x406d91=_0x4f362f['body']['ids'];return db['Team'][_0x9033('0x5d')]({'where':{'id':_0x406d91},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x9033('0x68'),_0x9033('0x69'),_0x9033('0x6a')],'raw':!![]}]})[_0x9033('0x2e')](function(_0x5cc4bc){if(_0x5cc4bc){var _0x1c226c=_['flatMap'](_0x5cc4bc,function(_0x695a42){var _0x333d4b=_0x695a42[_0x9033('0x2f')]({'plain':!![]});return _0x333d4b['Agents'];});return db[_0x9033('0x36')][_0x9033('0x51')]({'where':{'id':_0x4f362f[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](function(_0x2b835c){return db['sequelize'][_0x9033('0x6b')](function(_0x319c0f){return _0x2b835c[_0x9033('0x67')](_0x406d91,{'transaction':_0x319c0f})['then'](function(){return BPromise[_0x9033('0x6c')](_0x1c226c,function(_0x5982c8){return db['UserWhatsappQueue'][_0x9033('0x6d')]({'where':{'UserId':_0x5982c8['id'],'WhatsappQueueId':_0x4f362f[_0x9033('0x57')]['id']},'transaction':_0x319c0f});});})['then'](function(){_0x1c226c['forEach'](function(_0x4d6562){socket[_0x9033('0x6e')](_0x9033('0x6f'),{'UserId':_0x4d6562['id'],'WhatsappQueueId':_0x2b835c['id']});});});});});}})['then'](respondWithStatusCode(_0x884d5f,null))['catch'](handleError(_0x884d5f,null));};exports[_0x9033('0x70')]=function(_0x4b159f,_0x46cdfa,_0x1d5d6b){return db['Team'][_0x9033('0x5d')]({'where':{'id':_0x4b159f[_0x9033('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9033('0x71'),'attributes':['id'],'raw':!![]}]})[_0x9033('0x2e')](handleEntityNotFound(_0x46cdfa,null))[_0x9033('0x2e')](function(_0x4a7229){var _0x176742=_[_0x9033('0x46')](_0x4a7229,'id');var _0x366de4=[];var _0x4ffc00=[];var _0x413d1c=squel[_0x9033('0x72')]();_0x413d1c[_0x9033('0x73')](_0x9033('0x74'))['from']('team_has_whatsapp_queues','tq')[_0x9033('0x75')](_0x9033('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9033('0x42')](_0x9033('0x77'),_0x4b159f[_0x9033('0x57')]['id']);for(var _0x31acd4=0x0;_0x31acd4<_0x4a7229[_0x9033('0x4e')];_0x31acd4+=0x1){let _0x21f5c6=_0x4a7229[_0x31acd4];for(var _0x432b91=0x0;_0x432b91<_0x21f5c6[_0x9033('0x71')][_0x9033('0x4e')];_0x432b91+=0x1){let _0x3d9be2=_0x21f5c6[_0x9033('0x71')][_0x432b91];var _0x3af492=_0x413d1c[_0x9033('0x78')]();_0x3af492['where'](_0x9033('0x79'),_0x3d9be2['id']);_0x4ffc00[_0x9033('0x7a')](db[_0x9033('0x7b')]['query'](_0x3af492[_0x9033('0x7c')](),{'type':db['sequelize'][_0x9033('0x7d')][_0x9033('0x7e')]})[_0x9033('0x2e')](function(_0x9fae1e){if(_0x9fae1e[_0x9033('0x4e')]===0x1){return _0x3d9be2['id'];}else{var _0x115e9d=_[_0x9033('0x7f')](_[_0x9033('0x46')](_0x9fae1e,_0x9033('0x80')),function(_0x454886){return _[_0x9033('0x81')](_0x176742,_0x454886);});if(_0x115e9d){return _0x3d9be2['id'];}}}));}}return BPromise[_0x9033('0x82')](_0x4ffc00)['then'](function(_0x31d080){_0x366de4=_(_0x366de4)['union'](_0x31d080)[_0x9033('0x83')]()[_0x9033('0x84')]();return db[_0x9033('0x36')]['find']({'where':{'id':_0x4b159f['params']['id']}})[_0x9033('0x2e')](function(_0x3d3646){return db[_0x9033('0x7b')][_0x9033('0x6b')](function(_0x2b5d1f){return _0x3d3646[_0x9033('0x70')](_0x4b159f[_0x9033('0x3b')][_0x9033('0x85')],{'transaction':_0x2b5d1f})[_0x9033('0x2e')](function(){if(!_[_0x9033('0x86')](_0x366de4)){return _0x3d3646[_0x9033('0x87')](_0x366de4,{'transaction':_0x2b5d1f});}})[_0x9033('0x2e')](function(){_0x366de4[_0x9033('0x88')](function(_0x47e753){socket[_0x9033('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x47e753,'WhatsappQueueId':_0x3d3646['id']});});});});});});})[_0x9033('0x2e')](respondWithStatusCode(_0x46cdfa,null))['catch'](handleError(_0x46cdfa,null));};exports[_0x9033('0x89')]=function(_0x1cae27,_0x376301,_0x4a2847){return db[_0x9033('0x36')][_0x9033('0x51')]({'where':{'id':_0x1cae27[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x376301,null))[_0x9033('0x2e')](function(_0x2d86d7){if(_0x2d86d7){return _0x2d86d7[_0x9033('0x89')](_0x1cae27[_0x9033('0x52')][_0x9033('0x85')],_['omit'](_0x1cae27['body'],[_0x9033('0x85'),'id'])||{})[_0x9033('0x8a')](function(_0x2d1f59){for(var _0x5c5891=0x0;_0x5c5891<_0x1cae27[_0x9033('0x52')][_0x9033('0x85')][_0x9033('0x4e')];_0x5c5891+=0x1){socket['emit'](_0x9033('0x6f'),{'UserId':Number(_0x1cae27[_0x9033('0x52')][_0x9033('0x85')][_0x5c5891]),'WhatsappQueueId':Number(_0x1cae27['params']['id'])});}return _0x2d1f59;});}})[_0x9033('0x2e')](respondWithResult(_0x376301,null))['catch'](handleError(_0x376301,null));};exports[_0x9033('0x87')]=function(_0x411537,_0x3b9330,_0x4edfb3){return db['WhatsappQueue'][_0x9033('0x51')]({'where':{'id':_0x411537[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x3b9330,null))[_0x9033('0x2e')](function(_0x27f872){if(_0x27f872){return _0x27f872['removeAgents'](_0x411537[_0x9033('0x3b')][_0x9033('0x85')])[_0x9033('0x2e')](function(){if(_[_0x9033('0x8b')](_0x411537[_0x9033('0x3b')][_0x9033('0x85')])){for(var _0x1372be=0x0;_0x1372be<_0x411537[_0x9033('0x3b')][_0x9033('0x85')]['length'];_0x1372be+=0x1){socket[_0x9033('0x6e')](_0x9033('0x8c'),{'UserId':Number(_0x411537[_0x9033('0x3b')]['ids'][_0x1372be]),'WhatsappQueueId':Number(_0x411537[_0x9033('0x57')]['id'])});}}else{socket[_0x9033('0x6e')](_0x9033('0x8c'),{'UserId':Number(_0x411537[_0x9033('0x3b')][_0x9033('0x85')]),'WhatsappQueueId':Number(_0x411537[_0x9033('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3b9330,null))[_0x9033('0x49')](handleError(_0x3b9330,null));};exports[_0x9033('0x8d')]=function(_0x26ca82,_0x455a70,_0x4769ae){var _0x3cb284={};var _0x5db5fa={};var _0x4c10ea;var _0x87f850;return db['WhatsappQueue']['findOne']({'where':{'id':_0x26ca82[_0x9033('0x57')]['id']}})[_0x9033('0x2e')](handleEntityNotFound(_0x455a70,null))['then'](function(_0xf307e0){if(_0xf307e0){_0x4c10ea=_0xf307e0;_0x5db5fa['model']=_[_0x9033('0x4b')](db[_0x9033('0x8e')][_0x9033('0x4c')]);_0x5db5fa['query']=_[_0x9033('0x4b')](_0x26ca82[_0x9033('0x3b')]);_0x5db5fa[_0x9033('0x3c')]=_[_0x9033('0x4d')](_0x5db5fa[_0x9033('0x3a')],_0x5db5fa[_0x9033('0x3b')]);_0x3cb284['attributes']=_[_0x9033('0x4d')](_0x5db5fa[_0x9033('0x3a')],qs[_0x9033('0x3e')](_0x26ca82['query']['fields']));_0x3cb284['attributes']=_0x3cb284[_0x9033('0x3d')][_0x9033('0x4e')]?_0x3cb284[_0x9033('0x3d')]:_0x5db5fa[_0x9033('0x3a')];_0x3cb284[_0x9033('0x5b')]=qs[_0x9033('0x41')](_0x26ca82[_0x9033('0x3b')]['sort']);_0x3cb284[_0x9033('0x42')]=qs[_0x9033('0x3c')](_[_0x9033('0x43')](_0x26ca82['query'],_0x5db5fa[_0x9033('0x3c')]));if(_0x26ca82[_0x9033('0x3b')][_0x9033('0x44')]){_0x3cb284[_0x9033('0x42')]=_[_0x9033('0x45')](_0x3cb284[_0x9033('0x42')],{'$or':_['map'](_0x3cb284[_0x9033('0x3d')],function(_0x4b4b6a){var _0x5281e7={};_0x5281e7[_0x4b4b6a]={'$like':'%'+_0x26ca82[_0x9033('0x3b')][_0x9033('0x44')]+'%'};return _0x5281e7;})});}_0x3cb284=_[_0x9033('0x45')]({},_0x3cb284,_0x26ca82['options']);return _0x4c10ea['getAgents'](_0x3cb284);}})[_0x9033('0x2e')](function(_0x5d8b45){if(_0x5d8b45){_0x87f850=_0x5d8b45[_0x9033('0x4e')];if(!_0x26ca82[_0x9033('0x3b')][_0x9033('0x3f')](_0x9033('0x40'))){_0x3cb284[_0x9033('0x25')]=qs['limit'](_0x26ca82[_0x9033('0x3b')][_0x9033('0x25')]);_0x3cb284['offset']=qs['offset'](_0x26ca82[_0x9033('0x3b')][_0x9033('0x23')]);}return _0x4c10ea['getAgents'](_0x3cb284);}})['then'](function(_0x13a64d){if(_0x13a64d){return _0x13a64d?{'count':_0x87f850,'rows':_0x13a64d}:null;}})['then'](respondWithResult(_0x455a70,null))['catch'](handleError(_0x455a70,null));}; \ No newline at end of file +var _0x1535=['options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','WhatsappQueueId','filter','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','sequelize','SELECT','every','TeamId','includes','all','union','value','removeTeams','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','error','stack','name','index','map','WhatsappQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','findAll','rows','catch','show','params','include'];(function(_0x36b58f,_0x230c40){var _0x19abf1=function(_0x11bd53){while(--_0x11bd53){_0x36b58f['push'](_0x36b58f['shift']());}};_0x19abf1(++_0x230c40);}(_0x1535,0xcb));var _0x5153=function(_0x51576f,_0x2286f1){_0x51576f=_0x51576f-0x0;var _0x5c65d6=_0x1535[_0x51576f];return _0x5c65d6;};'use strict';var emlformat=require(_0x5153('0x0'));var rimraf=require(_0x5153('0x1'));var zipdir=require(_0x5153('0x2'));var jsonpatch=require(_0x5153('0x3'));var rp=require(_0x5153('0x4'));var moment=require(_0x5153('0x5'));var BPromise=require(_0x5153('0x6'));var Mustache=require(_0x5153('0x7'));var util=require(_0x5153('0x8'));var path=require(_0x5153('0x9'));var sox=require(_0x5153('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5153('0xb'));var _=require(_0x5153('0xc'));var squel=require(_0x5153('0xd'));var crypto=require('crypto');var jsforce=require(_0x5153('0xe'));var deskjs=require(_0x5153('0xf'));var toCsv=require(_0x5153('0x10'));var querystring=require('querystring');var Papa=require(_0x5153('0x11'));var Redis=require(_0x5153('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5153('0x13'));var as=require(_0x5153('0x14'));var hardwareService=require(_0x5153('0x15'));var logger=require(_0x5153('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5153('0x17'));var db=require(_0x5153('0x18'))['db'];config[_0x5153('0x19')]=_[_0x5153('0x1a')](config[_0x5153('0x19')],{'host':_0x5153('0x1b'),'port':0x18eb});var socket=require(_0x5153('0x1c'))(new Redis(config[_0x5153('0x19')]));require('./whatsappQueue.socket')[_0x5153('0x1d')](socket);function respondWithStatusCode(_0xc8a488,_0x28731b){_0x28731b=_0x28731b||0xcc;return function(_0x564bb8){if(_0x564bb8){return _0xc8a488[_0x5153('0x1e')](_0x28731b);}return _0xc8a488[_0x5153('0x1f')](_0x28731b)[_0x5153('0x20')]();};}function respondWithResult(_0x347b4f,_0x4b9497){_0x4b9497=_0x4b9497||0xc8;return function(_0xcdd27b){if(_0xcdd27b){return _0x347b4f[_0x5153('0x1f')](_0x4b9497)[_0x5153('0x21')](_0xcdd27b);}};}function respondWithFilteredResult(_0x53d45c,_0x414502){return function(_0x2dbfb2){if(_0x2dbfb2){var _0x3ecfd2=typeof _0x414502['offset']===_0x5153('0x22')&&typeof _0x414502[_0x5153('0x23')]===_0x5153('0x22');var _0xf26370=_0x2dbfb2[_0x5153('0x24')];var _0x3e8a01=_0x3ecfd2?0x0:_0x414502[_0x5153('0x25')];var _0x309529=_0x3ecfd2?_0x2dbfb2[_0x5153('0x24')]:_0x414502[_0x5153('0x25')]+_0x414502[_0x5153('0x23')];var _0x4280af;if(_0x309529>=_0xf26370){_0x309529=_0xf26370;_0x4280af=0xc8;}else{_0x4280af=0xce;}_0x53d45c[_0x5153('0x1f')](_0x4280af);return _0x53d45c[_0x5153('0x26')](_0x5153('0x27'),_0x3e8a01+'-'+_0x309529+'/'+_0xf26370)['json'](_0x2dbfb2);}return null;};}function patchUpdates(_0x51590f){return function(_0x2e86ce){try{jsonpatch[_0x5153('0x28')](_0x2e86ce,_0x51590f,!![]);}catch(_0x4597d3){return BPromise[_0x5153('0x29')](_0x4597d3);}return _0x2e86ce[_0x5153('0x2a')]();};}function saveUpdates(_0x5a370d,_0x543981){return function(_0x5743ed){if(_0x5743ed){return _0x5743ed[_0x5153('0x2b')](_0x5a370d)[_0x5153('0x2c')](function(_0x47e9b0){return _0x47e9b0;});}return null;};}function removeEntity(_0x56681a,_0x3e39e6){return function(_0xcdd38c){if(_0xcdd38c){return _0xcdd38c[_0x5153('0x2d')]()['then'](function(){var _0x2ed94b=_0xcdd38c[_0x5153('0x2e')]({'plain':!![]});var _0x333155=_0x5153('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x333155,'resourceId':_0x2ed94b['id']}})[_0x5153('0x2c')](function(){return _0xcdd38c;});})[_0x5153('0x2c')](function(){_0x56681a[_0x5153('0x1f')](0xcc)[_0x5153('0x20')]();});}};}function handleEntityNotFound(_0x335ec8,_0x540a98){return function(_0x5dec75){if(!_0x5dec75){_0x335ec8[_0x5153('0x1e')](0x194);}return _0x5dec75;};}function handleError(_0xd2e63a,_0x34d16f){_0x34d16f=_0x34d16f||0x1f4;return function(_0x5b9781){logger[_0x5153('0x30')](_0x5b9781[_0x5153('0x31')]);if(_0x5b9781[_0x5153('0x32')]){delete _0x5b9781[_0x5153('0x32')];}_0xd2e63a['status'](_0x34d16f)['send'](_0x5b9781);};}exports[_0x5153('0x33')]=function(_0x3579c5,_0x385ee5){var _0x21bd3e={},_0x49e930={},_0x4fdd08={'count':0x0,'rows':[]};var _0x52eecb=_[_0x5153('0x34')](db[_0x5153('0x35')][_0x5153('0x36')],function(_0x58f05b){return{'name':_0x58f05b['fieldName'],'type':_0x58f05b[_0x5153('0x37')][_0x5153('0x38')]};});_0x49e930['model']=_[_0x5153('0x34')](_0x52eecb,_0x5153('0x32'));_0x49e930[_0x5153('0x39')]=_[_0x5153('0x3a')](_0x3579c5[_0x5153('0x39')]);_0x49e930[_0x5153('0x3b')]=_[_0x5153('0x3c')](_0x49e930[_0x5153('0x3d')],_0x49e930[_0x5153('0x39')]);_0x21bd3e[_0x5153('0x3e')]=_[_0x5153('0x3c')](_0x49e930['model'],qs[_0x5153('0x3f')](_0x3579c5[_0x5153('0x39')]['fields']));_0x21bd3e[_0x5153('0x3e')]=_0x21bd3e['attributes'][_0x5153('0x40')]?_0x21bd3e['attributes']:_0x49e930[_0x5153('0x3d')];if(!_0x3579c5[_0x5153('0x39')][_0x5153('0x41')](_0x5153('0x42'))){_0x21bd3e[_0x5153('0x23')]=qs[_0x5153('0x23')](_0x3579c5[_0x5153('0x39')][_0x5153('0x23')]);_0x21bd3e[_0x5153('0x25')]=qs[_0x5153('0x25')](_0x3579c5[_0x5153('0x39')][_0x5153('0x25')]);}_0x21bd3e[_0x5153('0x43')]=qs[_0x5153('0x44')](_0x3579c5['query'][_0x5153('0x44')]);_0x21bd3e[_0x5153('0x45')]=qs[_0x5153('0x3b')](_[_0x5153('0x46')](_0x3579c5['query'],_0x49e930[_0x5153('0x3b')]),_0x52eecb);if(_0x3579c5[_0x5153('0x39')]['filter']){_0x21bd3e[_0x5153('0x45')]=_[_0x5153('0x47')](_0x21bd3e[_0x5153('0x45')],{'$or':_['map'](_0x52eecb,function(_0x5b6a40){if(_0x5b6a40[_0x5153('0x37')]!=='VIRTUAL'){var _0xd04713={};_0xd04713[_0x5b6a40[_0x5153('0x32')]]={'$like':'%'+_0x3579c5[_0x5153('0x39')]['filter']+'%'};return _0xd04713;}})});}_0x21bd3e=_['merge']({},_0x21bd3e,_0x3579c5['options']);var _0x47ed8f={'where':_0x21bd3e[_0x5153('0x45')]};return db['WhatsappQueue'][_0x5153('0x24')](_0x47ed8f)['then'](function(_0x5498ae){_0x4fdd08[_0x5153('0x24')]=_0x5498ae;if(_0x3579c5[_0x5153('0x39')][_0x5153('0x48')]){_0x21bd3e['include']=[{'all':!![]}];}return db[_0x5153('0x35')][_0x5153('0x49')](_0x21bd3e);})[_0x5153('0x2c')](function(_0xa6bdf9){_0x4fdd08[_0x5153('0x4a')]=_0xa6bdf9;return _0x4fdd08;})[_0x5153('0x2c')](respondWithFilteredResult(_0x385ee5,_0x21bd3e))[_0x5153('0x4b')](handleError(_0x385ee5,null));};exports[_0x5153('0x4c')]=function(_0x108e40,_0x276426){var _0x38362b={'raw':!![],'where':{'id':_0x108e40[_0x5153('0x4d')]['id']}},_0x15ad08={};_0x15ad08[_0x5153('0x3d')]=_['keys'](db[_0x5153('0x35')][_0x5153('0x36')]);_0x15ad08['query']=_['keys'](_0x108e40[_0x5153('0x39')]);_0x15ad08['filters']=_[_0x5153('0x3c')](_0x15ad08['model'],_0x15ad08[_0x5153('0x39')]);_0x38362b[_0x5153('0x3e')]=_['intersection'](_0x15ad08[_0x5153('0x3d')],qs[_0x5153('0x3f')](_0x108e40[_0x5153('0x39')][_0x5153('0x3f')]));_0x38362b[_0x5153('0x3e')]=_0x38362b[_0x5153('0x3e')][_0x5153('0x40')]?_0x38362b[_0x5153('0x3e')]:_0x15ad08[_0x5153('0x3d')];if(_0x108e40[_0x5153('0x39')][_0x5153('0x48')]){_0x38362b[_0x5153('0x4e')]=[{'all':!![]}];}_0x38362b=_[_0x5153('0x47')]({},_0x38362b,_0x108e40[_0x5153('0x4f')]);return db[_0x5153('0x35')][_0x5153('0x50')](_0x38362b)[_0x5153('0x2c')](handleEntityNotFound(_0x276426,null))[_0x5153('0x2c')](respondWithResult(_0x276426,null))[_0x5153('0x4b')](handleError(_0x276426,null));};exports[_0x5153('0x51')]=function(_0x54e0f8,_0x3eba33){return db[_0x5153('0x35')][_0x5153('0x51')](_0x54e0f8[_0x5153('0x52')],{})[_0x5153('0x2c')](function(_0x47546e){var _0x199973=_0x54e0f8[_0x5153('0x53')][_0x5153('0x2e')]({'plain':!![]});if(!_0x199973)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x199973[_0x5153('0x54')]==='user'){var _0x4aeca2=_0x47546e['get']({'plain':!![]});var _0x2ff745=_0x5153('0x2f');return db[_0x5153('0x55')][_0x5153('0x50')]({'where':{'name':_0x2ff745,'userProfileId':_0x199973[_0x5153('0x56')]},'raw':!![]})['then'](function(_0x56f07c){if(_0x56f07c&&_0x56f07c[_0x5153('0x57')]===0x0){return db[_0x5153('0x58')][_0x5153('0x51')]({'name':_0x4aeca2['name'],'resourceId':_0x4aeca2['id'],'type':_0x56f07c[_0x5153('0x32')],'sectionId':_0x56f07c['id']},{})[_0x5153('0x2c')](function(){return _0x47546e;});}else{return _0x47546e;}})['catch'](function(_0x3fe631){logger[_0x5153('0x30')](_0x5153('0x59'),_0x3fe631);throw _0x3fe631;});}return _0x47546e;})[_0x5153('0x2c')](respondWithResult(_0x3eba33,0xc9))[_0x5153('0x4b')](handleError(_0x3eba33,null));};exports[_0x5153('0x2b')]=function(_0x1b8589,_0x7e5997){if(_0x1b8589['body']['id']){delete _0x1b8589['body']['id'];}return db[_0x5153('0x35')][_0x5153('0x50')]({'where':{'id':_0x1b8589['params']['id']}})[_0x5153('0x2c')](handleEntityNotFound(_0x7e5997,null))['then'](saveUpdates(_0x1b8589['body'],null))[_0x5153('0x2c')](respondWithResult(_0x7e5997,null))['catch'](handleError(_0x7e5997,null));};exports['destroy']=function(_0x24c04b,_0x57be1a){return db[_0x5153('0x35')][_0x5153('0x50')]({'where':{'id':_0x24c04b[_0x5153('0x4d')]['id']}})[_0x5153('0x2c')](handleEntityNotFound(_0x57be1a,null))['then'](removeEntity(_0x57be1a,null))[_0x5153('0x4b')](handleError(_0x57be1a,null));};exports[_0x5153('0x5a')]=function(_0x47d543,_0x3a04eb){return db['WhatsappQueue'][_0x5153('0x5a')]()['then'](respondWithResult(_0x3a04eb,null))['catch'](handleError(_0x3a04eb,null));};exports['getMembers']=function(_0xc773b3,_0x2c4633,_0x190b7f){var _0xdcf433={'raw':!![],'where':{}},_0x2e638c={},_0x2f2b13;return db[_0x5153('0x35')][_0x5153('0x5b')]({'where':{'id':_0xc773b3[_0x5153('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c4633,null))[_0x5153('0x2c')](function(_0x543475){if(_0x543475){_0x2f2b13=_0x543475[_0x5153('0x2e')]({'plain':!![]});_0x2e638c[_0x5153('0x3d')]=_['keys'](db[_0x5153('0x5c')][_0x5153('0x36')]);_0x2e638c[_0x5153('0x39')]=_[_0x5153('0x3a')](_0xc773b3[_0x5153('0x39')]);_0x2e638c[_0x5153('0x3b')]=_[_0x5153('0x3c')](_0x2e638c[_0x5153('0x3d')],_0x2e638c[_0x5153('0x39')]);_0xdcf433[_0x5153('0x3e')]=_[_0x5153('0x3c')](_0x2e638c[_0x5153('0x3d')],qs[_0x5153('0x3f')](_0xc773b3[_0x5153('0x39')][_0x5153('0x3f')]));_0xdcf433[_0x5153('0x3e')]=_0xdcf433['attributes'][_0x5153('0x40')]?_0xdcf433[_0x5153('0x3e')]:_0x2e638c[_0x5153('0x3d')];if(!_0xc773b3[_0x5153('0x39')][_0x5153('0x41')](_0x5153('0x42'))){_0xdcf433[_0x5153('0x23')]=qs[_0x5153('0x23')](_0xc773b3[_0x5153('0x39')][_0x5153('0x23')]);_0xdcf433['offset']=qs['offset'](_0xc773b3[_0x5153('0x39')][_0x5153('0x25')]);}_0xdcf433[_0x5153('0x43')]=qs[_0x5153('0x44')](_0xc773b3[_0x5153('0x39')]['sort']);_0xdcf433[_0x5153('0x45')]=qs[_0x5153('0x3b')](_[_0x5153('0x46')](_0xc773b3[_0x5153('0x39')],_0x2e638c[_0x5153('0x3b')]));_0xdcf433[_0x5153('0x45')][_0x5153('0x5d')]=_0x543475['id'];if(_0xc773b3[_0x5153('0x39')][_0x5153('0x5e')]){_0xdcf433['where']=_['merge'](_0xdcf433[_0x5153('0x45')],{'$or':_[_0x5153('0x34')](_0xdcf433[_0x5153('0x3e')],function(_0x560138){var _0x3c4a56={};_0x3c4a56[_0x560138]={'$like':'%'+_0xc773b3['query']['filter']+'%'};return _0x3c4a56;})});}_0xdcf433=_['merge']({},_0xdcf433,_0xc773b3[_0x5153('0x4f')]);return db['UserWhatsappQueue'][_0x5153('0x49')](_0xdcf433);}})['then'](function(_0x5ee930){if(_0x5ee930){return db[_0x5153('0x5f')][_0x5153('0x60')]({'where':{'id':_[_0x5153('0x34')](_0x5ee930,'UserId'),'role':_0x5153('0x61')},'attributes':['id',_0x5153('0x32'),_0x5153('0x62'),_0x5153('0x63'),_0x5153('0x64')]});}})[_0x5153('0x2c')](function(_0x597d18){if(_0x597d18){return{'count':_0x597d18[_0x5153('0x24')],'rows':_[_0x5153('0x34')](_0x597d18[_0x5153('0x4a')],function(_0x4a2316){return{'membername':_0x4a2316['name'],'UserId':_0x4a2316['id'],'queue_name':_0x2f2b13[_0x5153('0x32')],'WhatsappQueueId':_0x2f2b13['id'],'interface':util[_0x5153('0x65')](_0x5153('0x66'),'SIP',_0x4a2316[_0x5153('0x32')]),'penalty':0x0,'paused':_0x4a2316[_0x5153('0x62')],'createdAt':_0x4a2316['createdAt'],'updatedAt':_0x4a2316[_0x5153('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5153('0x2c')](respondWithFilteredResult(_0x2c4633,_0xdcf433))[_0x5153('0x4b')](handleError(_0x2c4633,null));};exports[_0x5153('0x67')]=function(_0x2c7ed8,_0x4e1566,_0x268ecd){var _0x4818d3={};var _0x1c3bce={};var _0x102563;var _0x46715f;return db['WhatsappQueue'][_0x5153('0x5b')]({'where':{'id':_0x2c7ed8[_0x5153('0x4d')]['id']}})[_0x5153('0x2c')](handleEntityNotFound(_0x4e1566,null))[_0x5153('0x2c')](function(_0x8aba3f){if(_0x8aba3f){_0x102563=_0x8aba3f;_0x1c3bce[_0x5153('0x3d')]=_[_0x5153('0x3a')](db[_0x5153('0x68')]['rawAttributes']);_0x1c3bce[_0x5153('0x39')]=_['keys'](_0x2c7ed8[_0x5153('0x39')]);_0x1c3bce[_0x5153('0x3b')]=_[_0x5153('0x3c')](_0x1c3bce['model'],_0x1c3bce['query']);_0x4818d3[_0x5153('0x3e')]=_[_0x5153('0x3c')](_0x1c3bce['model'],qs[_0x5153('0x3f')](_0x2c7ed8[_0x5153('0x39')][_0x5153('0x3f')]));_0x4818d3[_0x5153('0x3e')]=_0x4818d3[_0x5153('0x3e')][_0x5153('0x40')]?_0x4818d3[_0x5153('0x3e')]:_0x1c3bce[_0x5153('0x3d')];_0x4818d3[_0x5153('0x43')]=qs[_0x5153('0x44')](_0x2c7ed8[_0x5153('0x39')][_0x5153('0x44')]);_0x4818d3['where']=qs[_0x5153('0x3b')](_[_0x5153('0x46')](_0x2c7ed8['query'],_0x1c3bce['filters']));if(_0x2c7ed8['query']['filter']){_0x4818d3[_0x5153('0x45')]=_[_0x5153('0x47')](_0x4818d3[_0x5153('0x45')],{'$or':_['map'](_0x4818d3[_0x5153('0x3e')],function(_0x3c09fd){var _0x25cb0e={};_0x25cb0e[_0x3c09fd]={'$like':'%'+_0x2c7ed8['query']['filter']+'%'};return _0x25cb0e;})});}_0x4818d3=_[_0x5153('0x47')]({},_0x4818d3,_0x2c7ed8['options']);return _0x102563[_0x5153('0x67')](_0x4818d3);}})['then'](function(_0x4d7b62){if(_0x4d7b62){_0x46715f=_0x4d7b62['length'];if(!_0x2c7ed8[_0x5153('0x39')][_0x5153('0x41')](_0x5153('0x42'))){_0x4818d3[_0x5153('0x23')]=qs['limit'](_0x2c7ed8[_0x5153('0x39')][_0x5153('0x23')]);_0x4818d3[_0x5153('0x25')]=qs['offset'](_0x2c7ed8[_0x5153('0x39')][_0x5153('0x25')]);}return _0x102563[_0x5153('0x67')](_0x4818d3);}})[_0x5153('0x2c')](function(_0x2eb46e){if(_0x2eb46e){return _0x2eb46e?{'count':_0x46715f,'rows':_0x2eb46e}:null;}})['then'](respondWithResult(_0x4e1566,null))[_0x5153('0x4b')](handleError(_0x4e1566,null));};exports[_0x5153('0x69')]=function(_0x34236c,_0xf069e3,_0x1f05fc){var _0x5c02ae=_0x34236c[_0x5153('0x52')][_0x5153('0x6a')];return db[_0x5153('0x68')]['findAll']({'where':{'id':_0x5c02ae},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5153('0x6b'),'attributes':['id',_0x5153('0x32'),_0x5153('0x6c'),_0x5153('0x6d'),_0x5153('0x6e')],'raw':!![]}]})[_0x5153('0x2c')](function(_0x326f72){if(_0x326f72){var _0x26fa98=_[_0x5153('0x6f')](_0x326f72,function(_0x4244c1){var _0x2799f5=_0x4244c1[_0x5153('0x2e')]({'plain':!![]});return _0x2799f5[_0x5153('0x6b')];});return db['WhatsappQueue'][_0x5153('0x50')]({'where':{'id':_0x34236c[_0x5153('0x4d')]['id']}})['then'](function(_0x49308f){return db['sequelize'][_0x5153('0x70')](function(_0x35d946){return _0x49308f[_0x5153('0x69')](_0x5c02ae,{'transaction':_0x35d946})[_0x5153('0x2c')](function(){return BPromise[_0x5153('0x71')](_0x26fa98,function(_0x27b0d9){return db[_0x5153('0x5c')][_0x5153('0x72')]({'where':{'UserId':_0x27b0d9['id'],'WhatsappQueueId':_0x34236c[_0x5153('0x4d')]['id']},'transaction':_0x35d946});});})[_0x5153('0x2c')](function(){_0x26fa98[_0x5153('0x73')](function(_0x1d4025){socket[_0x5153('0x74')]('userWhatsappQueue:save',{'UserId':_0x1d4025['id'],'WhatsappQueueId':_0x49308f['id']});});});});});}})[_0x5153('0x2c')](respondWithStatusCode(_0xf069e3,null))[_0x5153('0x4b')](handleError(_0xf069e3,null));};exports['removeTeams']=function(_0x54d79f,_0x2db7e7,_0x429f3d){return db[_0x5153('0x68')][_0x5153('0x49')]({'where':{'id':_0x54d79f['query'][_0x5153('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x5153('0x5f')],'as':_0x5153('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x5153('0x2c')](handleEntityNotFound(_0x2db7e7,null))[_0x5153('0x2c')](function(_0x1f94ef){var _0x2d5b04=_['map'](_0x1f94ef,'id');var _0x3f8331=[];var _0x1ae6ad=[];var _0x3b3ac5=squel[_0x5153('0x75')]();_0x3b3ac5[_0x5153('0x76')](_0x5153('0x77'))['from'](_0x5153('0x78'),'tq')[_0x5153('0x79')](_0x5153('0x7a'),'ut',_0x5153('0x7b'))[_0x5153('0x45')](_0x5153('0x7c'),_0x54d79f[_0x5153('0x4d')]['id']);for(var _0x40a269=0x0;_0x40a269<_0x1f94ef[_0x5153('0x40')];_0x40a269+=0x1){let _0x3096ef=_0x1f94ef[_0x40a269];for(var _0x251999=0x0;_0x251999<_0x3096ef['Agents'][_0x5153('0x40')];_0x251999+=0x1){let _0x1c0761=_0x3096ef[_0x5153('0x6b')][_0x251999];var _0x57a2f2=_0x3b3ac5[_0x5153('0x7d')]();_0x57a2f2[_0x5153('0x45')]('ut.UserId\x20=\x20?',_0x1c0761['id']);_0x1ae6ad['push'](db[_0x5153('0x7e')][_0x5153('0x39')](_0x57a2f2['toString'](),{'type':db[_0x5153('0x7e')]['QueryTypes'][_0x5153('0x7f')]})[_0x5153('0x2c')](function(_0x575a4f){if(_0x575a4f['length']===0x1){return _0x1c0761['id'];}else{var _0xe0b3c5=_[_0x5153('0x80')](_[_0x5153('0x34')](_0x575a4f,_0x5153('0x81')),function(_0x2bcd41){return _[_0x5153('0x82')](_0x2d5b04,_0x2bcd41);});if(_0xe0b3c5){return _0x1c0761['id'];}}}));}}return BPromise[_0x5153('0x83')](_0x1ae6ad)[_0x5153('0x2c')](function(_0x56d207){_0x3f8331=_(_0x3f8331)[_0x5153('0x84')](_0x56d207)['compact']()[_0x5153('0x85')]();return db['WhatsappQueue']['find']({'where':{'id':_0x54d79f[_0x5153('0x4d')]['id']}})[_0x5153('0x2c')](function(_0x4c579b){return db['sequelize'][_0x5153('0x70')](function(_0x41d10e){return _0x4c579b[_0x5153('0x86')](_0x54d79f[_0x5153('0x39')][_0x5153('0x6a')],{'transaction':_0x41d10e})[_0x5153('0x2c')](function(){if(!_['isEmpty'](_0x3f8331)){return _0x4c579b[_0x5153('0x87')](_0x3f8331,{'transaction':_0x41d10e});}})[_0x5153('0x2c')](function(){_0x3f8331[_0x5153('0x73')](function(_0x50f149){socket[_0x5153('0x74')](_0x5153('0x88'),{'UserId':_0x50f149,'WhatsappQueueId':_0x4c579b['id']});});});});});});})[_0x5153('0x2c')](respondWithStatusCode(_0x2db7e7,null))['catch'](handleError(_0x2db7e7,null));};exports[_0x5153('0x89')]=function(_0x4b5001,_0x2ea45e,_0x1fff2c){return db[_0x5153('0x35')][_0x5153('0x50')]({'where':{'id':_0x4b5001[_0x5153('0x4d')]['id']}})[_0x5153('0x2c')](handleEntityNotFound(_0x2ea45e,null))['then'](function(_0x40d12b){if(_0x40d12b){return _0x40d12b['addAgents'](_0x4b5001[_0x5153('0x52')][_0x5153('0x6a')],_[_0x5153('0x8a')](_0x4b5001[_0x5153('0x52')],[_0x5153('0x6a'),'id'])||{})['spread'](function(_0x17775c){for(var _0x2f30c0=0x0;_0x2f30c0<_0x4b5001[_0x5153('0x52')]['ids'][_0x5153('0x40')];_0x2f30c0+=0x1){socket['emit'](_0x5153('0x8b'),{'UserId':Number(_0x4b5001[_0x5153('0x52')][_0x5153('0x6a')][_0x2f30c0]),'WhatsappQueueId':Number(_0x4b5001['params']['id'])});}return _0x17775c;});}})[_0x5153('0x2c')](respondWithResult(_0x2ea45e,null))[_0x5153('0x4b')](handleError(_0x2ea45e,null));};exports['removeAgents']=function(_0x3a058f,_0xb2b730,_0x30e6d9){return db['WhatsappQueue'][_0x5153('0x50')]({'where':{'id':_0x3a058f[_0x5153('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb2b730,null))[_0x5153('0x2c')](function(_0x52bd98){if(_0x52bd98){return _0x52bd98[_0x5153('0x87')](_0x3a058f[_0x5153('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x3a058f['query'][_0x5153('0x6a')])){for(var _0x2fde8d=0x0;_0x2fde8d<_0x3a058f[_0x5153('0x39')][_0x5153('0x6a')]['length'];_0x2fde8d+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x3a058f[_0x5153('0x39')][_0x5153('0x6a')][_0x2fde8d]),'WhatsappQueueId':Number(_0x3a058f['params']['id'])});}}else{socket[_0x5153('0x74')](_0x5153('0x88'),{'UserId':Number(_0x3a058f['query'][_0x5153('0x6a')]),'WhatsappQueueId':Number(_0x3a058f[_0x5153('0x4d')]['id'])});}});}})[_0x5153('0x2c')](respondWithStatusCode(_0xb2b730,null))[_0x5153('0x4b')](handleError(_0xb2b730,null));};exports['getAgents']=function(_0x455a06,_0x3463b8,_0x477c2e){var _0xd15122={};var _0x1f5274={};var _0x2451da;var _0x33f919;return db[_0x5153('0x35')][_0x5153('0x5b')]({'where':{'id':_0x455a06['params']['id']}})['then'](handleEntityNotFound(_0x3463b8,null))[_0x5153('0x2c')](function(_0x307993){if(_0x307993){_0x2451da=_0x307993;_0x1f5274[_0x5153('0x3d')]=_[_0x5153('0x3a')](db[_0x5153('0x5f')][_0x5153('0x36')]);_0x1f5274[_0x5153('0x39')]=_['keys'](_0x455a06[_0x5153('0x39')]);_0x1f5274[_0x5153('0x3b')]=_['intersection'](_0x1f5274[_0x5153('0x3d')],_0x1f5274['query']);_0xd15122['attributes']=_[_0x5153('0x3c')](_0x1f5274[_0x5153('0x3d')],qs[_0x5153('0x3f')](_0x455a06[_0x5153('0x39')][_0x5153('0x3f')]));_0xd15122[_0x5153('0x3e')]=_0xd15122[_0x5153('0x3e')][_0x5153('0x40')]?_0xd15122[_0x5153('0x3e')]:_0x1f5274[_0x5153('0x3d')];_0xd15122['order']=qs[_0x5153('0x44')](_0x455a06[_0x5153('0x39')][_0x5153('0x44')]);_0xd15122[_0x5153('0x45')]=qs[_0x5153('0x3b')](_[_0x5153('0x46')](_0x455a06['query'],_0x1f5274['filters']));if(_0x455a06[_0x5153('0x39')][_0x5153('0x5e')]){_0xd15122[_0x5153('0x45')]=_[_0x5153('0x47')](_0xd15122[_0x5153('0x45')],{'$or':_[_0x5153('0x34')](_0xd15122[_0x5153('0x3e')],function(_0x162315){var _0x594324={};_0x594324[_0x162315]={'$like':'%'+_0x455a06[_0x5153('0x39')][_0x5153('0x5e')]+'%'};return _0x594324;})});}_0xd15122=_['merge']({},_0xd15122,_0x455a06['options']);return _0x2451da[_0x5153('0x8c')](_0xd15122);}})['then'](function(_0x2cb6f0){if(_0x2cb6f0){_0x33f919=_0x2cb6f0[_0x5153('0x40')];if(!_0x455a06[_0x5153('0x39')]['hasOwnProperty']('nolimit')){_0xd15122['limit']=qs[_0x5153('0x23')](_0x455a06[_0x5153('0x39')][_0x5153('0x23')]);_0xd15122[_0x5153('0x25')]=qs['offset'](_0x455a06[_0x5153('0x39')]['offset']);}return _0x2451da[_0x5153('0x8c')](_0xd15122);}})[_0x5153('0x2c')](function(_0x354b5c){if(_0x354b5c){return _0x354b5c?{'count':_0x33f919,'rows':_0x354b5c}:null;}})[_0x5153('0x2c')](respondWithResult(_0x3463b8,null))[_0x5153('0x4b')](handleError(_0x3463b8,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 43a54b4..2711f7d 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 _0xa66e=['exports','WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xa66e,0x159));var _0xea66=function(_0x22d59b,_0x1dc51c){_0x22d59b=_0x22d59b-0x0;var _0x32db80=_0xa66e[_0x22d59b];return _0x32db80;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0xea66('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea66('0x1'),'afterUpdate':_0xea66('0x2'),'afterDestroy':_0xea66('0x3')};function emitEvent(_0x383162){return function(_0x549fce,_0x39b09b,_0x494f41){WhatsappQueueEvents['emit'](_0x383162+':'+_0x549fce['id'],_0x549fce);WhatsappQueueEvents[_0xea66('0x4')](_0x383162,_0x549fce);_0x494f41(null);};}for(var e in events){if(events[_0xea66('0x5')](e)){var event=events[e];WhatsappQueue[_0xea66('0x6')](e,emitEvent(event));}}module[_0xea66('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x011a=['events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x011a,0xa2));var _0xa011=function(_0x174e6d,_0x45f4d1){_0x174e6d=_0x174e6d-0x0;var _0x27a7eb=_0x011a[_0x174e6d];return _0x27a7eb;};'use strict';var EventEmitter=require(_0xa011('0x0'));var WhatsappQueue=require(_0xa011('0x1'))['db'][_0xa011('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa011('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa011('0x4'),'afterDestroy':_0xa011('0x5')};function emitEvent(_0x26a0c6){return function(_0x59b36c,_0x33fe7f,_0x4f02dc){WhatsappQueueEvents[_0xa011('0x6')](_0x26a0c6+':'+_0x59b36c['id'],_0x59b36c);WhatsappQueueEvents[_0xa011('0x6')](_0x26a0c6,_0x59b36c);_0x4f02dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xa011('0x7')](e,emitEvent(event));}}module[_0xa011('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 9816a62..c9f377b 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 _0x18a3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0x18a3,0x14f));var _0x318a=function(_0x1d5cf9,_0x2a2822){_0x1d5cf9=_0x1d5cf9-0x0;var _0x340c86=_0x18a3[_0x1d5cf9];return _0x340c86;};'use strict';var _=require(_0x318a('0x0'));var util=require(_0x318a('0x1'));var logger=require(_0x318a('0x2'))(_0x318a('0x3'));var moment=require(_0x318a('0x4'));var BPromise=require('bluebird');var rp=require(_0x318a('0x5'));var fs=require('fs');var path=require(_0x318a('0x6'));var rimraf=require(_0x318a('0x7'));var config=require(_0x318a('0x8'));var attributes=require(_0x318a('0x9'));module[_0x318a('0xa')]=function(_0xcff2a,_0x50593b){return _0xcff2a[_0x318a('0xb')](_0x318a('0xc'),attributes,{'tableName':_0x318a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf00f=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23c4c4,_0x561569){var _0x425b14=function(_0x27486b){while(--_0x27486b){_0x23c4c4['push'](_0x23c4c4['shift']());}};_0x425b14(++_0x561569);}(_0xf00f,0xa1));var _0xff00=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xf00f[_0xdbd4f7];return _0x5c3f9d;};'use strict';var _=require(_0xff00('0x0'));var util=require(_0xff00('0x1'));var logger=require(_0xff00('0x2'))(_0xff00('0x3'));var moment=require(_0xff00('0x4'));var BPromise=require(_0xff00('0x5'));var rp=require(_0xff00('0x6'));var fs=require('fs');var path=require(_0xff00('0x7'));var rimraf=require(_0xff00('0x8'));var config=require(_0xff00('0x9'));var attributes=require(_0xff00('0xa'));module[_0xff00('0xb')]=function(_0x41a490,_0x2a07ed){return _0x41a490[_0xff00('0xc')](_0xff00('0xd'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 2c6d01e..5c16b85 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 _0xa869=['../../mysqldb','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','include','map','model','attributes','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x59a549,_0x2fe2bb){var _0x12adbe=function(_0x2ccd1e){while(--_0x2ccd1e){_0x59a549['push'](_0x59a549['shift']());}};_0x12adbe(++_0x2fe2bb);}(_0xa869,0x69));var _0x9a86=function(_0x4c8c64,_0x1dfe95){_0x4c8c64=_0x4c8c64-0x0;var _0x56b566=_0xa869[_0x4c8c64];return _0x56b566;};'use strict';var _=require(_0x9a86('0x0'));var util=require(_0x9a86('0x1'));var moment=require(_0x9a86('0x2'));var BPromise=require(_0x9a86('0x3'));var rs=require(_0x9a86('0x4'));var fs=require('fs');var Redis=require(_0x9a86('0x5'));var db=require(_0x9a86('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a86('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9a86('0x8')]({'port':0x232a});config[_0x9a86('0x9')]=_[_0x9a86('0xa')](config[_0x9a86('0x9')],{'host':_0x9a86('0xb'),'port':0x18eb});var socket=require(_0x9a86('0xc'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x9a86('0xd')](socket);function respondWithRpcPromise(_0xceec5a,_0x4ba836,_0x4ea079){return new BPromise(function(_0xc25eae,_0x1b1f36){return client[_0x9a86('0xe')](_0xceec5a,_0x4ea079)['then'](function(_0x15eaf0){logger[_0x9a86('0xf')](_0x9a86('0x10'),_0x4ba836,_0x9a86('0x11'));logger[_0x9a86('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4ba836,'request\x20sent',JSON[_0x9a86('0x13')](_0x15eaf0));if(_0x15eaf0['error']){if(_0x15eaf0[_0x9a86('0x14')][_0x9a86('0x15')]===0x1f4){logger['error'](_0x9a86('0x10'),_0x4ba836,_0x15eaf0[_0x9a86('0x14')][_0x9a86('0x16')]);return _0x1b1f36(_0x15eaf0[_0x9a86('0x14')][_0x9a86('0x16')]);}logger[_0x9a86('0x14')](_0x9a86('0x10'),_0x4ba836,_0x15eaf0[_0x9a86('0x14')][_0x9a86('0x16')]);return _0xc25eae(_0x15eaf0[_0x9a86('0x14')][_0x9a86('0x16')]);}else{logger[_0x9a86('0xf')](_0x9a86('0x10'),_0x4ba836,'request\x20sent');_0xc25eae(_0x15eaf0[_0x9a86('0x17')]['message']);}})[_0x9a86('0x18')](function(_0x46e20d){logger[_0x9a86('0x14')](_0x9a86('0x10'),_0x4ba836,_0x46e20d);_0x1b1f36(_0x46e20d);});});}exports[_0x9a86('0x19')]=function(_0x4c2942){var _0x539d65=this;return new Promise(function(_0x65b149,_0x6d4897){return db[_0x9a86('0x1a')][_0x9a86('0x1b')]({'raw':_0x4c2942[_0x9a86('0x1c')]?_0x4c2942['options'][_0x9a86('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c2942[_0x9a86('0x1c')]?_0x4c2942[_0x9a86('0x1c')][_0x9a86('0x1e')]||null:null,'attributes':_0x4c2942[_0x9a86('0x1c')]?_0x4c2942[_0x9a86('0x1c')]['attributes']||null:null,'limit':_0x4c2942[_0x9a86('0x1c')]?_0x4c2942[_0x9a86('0x1c')]['limit']||null:null,'include':_0x4c2942[_0x9a86('0x1c')]?_0x4c2942[_0x9a86('0x1c')][_0x9a86('0x1f')]?_[_0x9a86('0x20')](_0x4c2942[_0x9a86('0x1c')][_0x9a86('0x1f')],function(_0x23a4e0){return{'model':db[_0x23a4e0[_0x9a86('0x21')]],'as':_0x23a4e0['as'],'attributes':_0x23a4e0[_0x9a86('0x22')],'include':_0x23a4e0['include']?_[_0x9a86('0x20')](_0x23a4e0[_0x9a86('0x1f')],function(_0x7ab81){return{'model':db[_0x7ab81[_0x9a86('0x21')]],'as':_0x7ab81['as'],'attributes':_0x7ab81[_0x9a86('0x22')],'include':_0x7ab81[_0x9a86('0x1f')]?_['map'](_0x7ab81[_0x9a86('0x1f')],function(_0x2b50eb){return{'model':db[_0x2b50eb['model']],'as':_0x2b50eb['as'],'attributes':_0x2b50eb[_0x9a86('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x521eff){logger['info']('GetWhatsappQueue',_0x4c2942);logger['debug'](_0x9a86('0x19'),_0x4c2942,JSON['stringify'](_0x521eff));_0x65b149(_0x521eff);})['catch'](function(_0xf5dee2){logger['error'](_0x9a86('0x19'),_0xf5dee2[_0x9a86('0x16')],_0x4c2942);_0x6d4897(_0x539d65['error'](0x1f4,_0xf5dee2[_0x9a86('0x16')]));});});};exports[_0x9a86('0x23')]=function(_0xd0a531){var _0x3783ae=this;return new Promise(function(_0x3ac430,_0x28a129){return db['WhatsappQueue'][_0x9a86('0x24')]({'raw':_0xd0a531['options']?_0xd0a531[_0x9a86('0x1c')][_0x9a86('0x1d')]===undefined?!![]:![]:!![],'where':_0xd0a531[_0x9a86('0x1c')]?_0xd0a531[_0x9a86('0x1c')][_0x9a86('0x1e')]||null:null,'attributes':_0xd0a531[_0x9a86('0x1c')]?_0xd0a531[_0x9a86('0x1c')][_0x9a86('0x22')]||null:null,'include':_0xd0a531[_0x9a86('0x1c')]?_0xd0a531['options'][_0x9a86('0x1f')]?_['map'](_0xd0a531['options'][_0x9a86('0x1f')],function(_0x59b708){return{'model':db[_0x59b708['model']],'as':_0x59b708['as'],'attributes':_0x59b708[_0x9a86('0x22')],'include':_0x59b708[_0x9a86('0x1f')]?_[_0x9a86('0x20')](_0x59b708[_0x9a86('0x1f')],function(_0xc23d2e){return{'model':db[_0xc23d2e[_0x9a86('0x21')]],'as':_0xc23d2e['as'],'attributes':_0xc23d2e['attributes'],'include':_0xc23d2e['include']?_[_0x9a86('0x20')](_0xc23d2e[_0x9a86('0x1f')],function(_0x4465f3){return{'model':db[_0x4465f3[_0x9a86('0x21')]],'as':_0x4465f3['as'],'attributes':_0x4465f3[_0x9a86('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x252d85){logger[_0x9a86('0xf')](_0x9a86('0x23'),_0xd0a531);logger[_0x9a86('0x12')](_0x9a86('0x23'),_0xd0a531,JSON['stringify'](_0x252d85));_0x3ac430(_0x252d85);})[_0x9a86('0x18')](function(_0x2ed75c){logger['error'](_0x9a86('0x23'),_0x2ed75c[_0x9a86('0x16')],_0xd0a531);_0x28a129(_0x3783ae[_0x9a86('0x14')](0x1f4,_0x2ed75c[_0x9a86('0x16')]));});});}; \ No newline at end of file +var _0x803e=['request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappQueue','options','raw','where','limit','include','map','model','attributes','then','info','GetWhatsappQueue','debug','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','WhatsappQueue,\x20%s,\x20%s'];(function(_0x25125b,_0x4f8230){var _0x2b844d=function(_0x2a3d00){while(--_0x2a3d00){_0x25125b['push'](_0x25125b['shift']());}};_0x2b844d(++_0x4f8230);}(_0x803e,0x187));var _0xe803=function(_0x5b1aed,_0x322c17){_0x5b1aed=_0x5b1aed-0x0;var _0x26add8=_0x803e[_0x5b1aed];return _0x26add8;};'use strict';var _=require(_0xe803('0x0'));var util=require(_0xe803('0x1'));var moment=require(_0xe803('0x2'));var BPromise=require(_0xe803('0x3'));var rs=require(_0xe803('0x4'));var fs=require('fs');var Redis=require(_0xe803('0x5'));var db=require(_0xe803('0x6'))['db'];var utils=require(_0xe803('0x7'));var logger=require(_0xe803('0x8'))(_0xe803('0x9'));var config=require('../../config/environment');var jayson=require(_0xe803('0xa'));var client=jayson['client'][_0xe803('0xb')]({'port':0x232a});config[_0xe803('0xc')]=_['defaults'](config['redis'],{'host':_0xe803('0xd'),'port':0x18eb});var socket=require(_0xe803('0xe'))(new Redis(config['redis']));require(_0xe803('0xf'))[_0xe803('0x10')](socket);function respondWithRpcPromise(_0x55dd5a,_0x3eeb8a,_0x1a8ad4){return new BPromise(function(_0x4bbea3,_0x26e10c){return client[_0xe803('0x11')](_0x55dd5a,_0x1a8ad4)['then'](function(_0x17cbff){logger['info'](_0xe803('0x12'),_0x3eeb8a,_0xe803('0x13'));logger['debug'](_0xe803('0x14'),_0x3eeb8a,'request\x20sent',JSON[_0xe803('0x15')](_0x17cbff));if(_0x17cbff[_0xe803('0x16')]){if(_0x17cbff[_0xe803('0x16')][_0xe803('0x17')]===0x1f4){logger['error'](_0xe803('0x12'),_0x3eeb8a,_0x17cbff[_0xe803('0x16')][_0xe803('0x18')]);return _0x26e10c(_0x17cbff[_0xe803('0x16')][_0xe803('0x18')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x3eeb8a,_0x17cbff['error']['message']);return _0x4bbea3(_0x17cbff['error']['message']);}else{logger['info'](_0xe803('0x12'),_0x3eeb8a,_0xe803('0x13'));_0x4bbea3(_0x17cbff['result']['message']);}})[_0xe803('0x19')](function(_0x402fbb){logger['error'](_0xe803('0x12'),_0x3eeb8a,_0x402fbb);_0x26e10c(_0x402fbb);});});}exports['GetWhatsappQueue']=function(_0x427337){var _0x500404=this;return new Promise(function(_0x354eea,_0x2e1166){return db[_0xe803('0x1a')]['findAll']({'raw':_0x427337[_0xe803('0x1b')]?_0x427337['options'][_0xe803('0x1c')]===undefined?!![]:![]:!![],'where':_0x427337[_0xe803('0x1b')]?_0x427337[_0xe803('0x1b')][_0xe803('0x1d')]||null:null,'attributes':_0x427337[_0xe803('0x1b')]?_0x427337[_0xe803('0x1b')]['attributes']||null:null,'limit':_0x427337[_0xe803('0x1b')]?_0x427337[_0xe803('0x1b')][_0xe803('0x1e')]||null:null,'include':_0x427337['options']?_0x427337['options'][_0xe803('0x1f')]?_[_0xe803('0x20')](_0x427337['options'][_0xe803('0x1f')],function(_0x453fd3){return{'model':db[_0x453fd3[_0xe803('0x21')]],'as':_0x453fd3['as'],'attributes':_0x453fd3[_0xe803('0x22')],'include':_0x453fd3[_0xe803('0x1f')]?_[_0xe803('0x20')](_0x453fd3[_0xe803('0x1f')],function(_0x26c107){return{'model':db[_0x26c107['model']],'as':_0x26c107['as'],'attributes':_0x26c107['attributes'],'include':_0x26c107[_0xe803('0x1f')]?_[_0xe803('0x20')](_0x26c107[_0xe803('0x1f')],function(_0x1902f6){return{'model':db[_0x1902f6[_0xe803('0x21')]],'as':_0x1902f6['as'],'attributes':_0x1902f6[_0xe803('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe803('0x23')](function(_0x237fac){logger[_0xe803('0x24')](_0xe803('0x25'),_0x427337);logger[_0xe803('0x26')](_0xe803('0x25'),_0x427337,JSON[_0xe803('0x15')](_0x237fac));_0x354eea(_0x237fac);})[_0xe803('0x19')](function(_0x5ccac5){logger[_0xe803('0x16')](_0xe803('0x25'),_0x5ccac5[_0xe803('0x18')],_0x427337);_0x2e1166(_0x500404[_0xe803('0x16')](0x1f4,_0x5ccac5[_0xe803('0x18')]));});});};exports[_0xe803('0x27')]=function(_0x45122a){var _0x11e4f2=this;return new Promise(function(_0x5f0b5f,_0x1b6dfe){return db[_0xe803('0x1a')][_0xe803('0x28')]({'raw':_0x45122a[_0xe803('0x1b')]?_0x45122a['options'][_0xe803('0x1c')]===undefined?!![]:![]:!![],'where':_0x45122a['options']?_0x45122a[_0xe803('0x1b')]['where']||null:null,'attributes':_0x45122a['options']?_0x45122a['options'][_0xe803('0x22')]||null:null,'include':_0x45122a['options']?_0x45122a[_0xe803('0x1b')][_0xe803('0x1f')]?_[_0xe803('0x20')](_0x45122a[_0xe803('0x1b')][_0xe803('0x1f')],function(_0x435701){return{'model':db[_0x435701[_0xe803('0x21')]],'as':_0x435701['as'],'attributes':_0x435701[_0xe803('0x22')],'include':_0x435701[_0xe803('0x1f')]?_[_0xe803('0x20')](_0x435701[_0xe803('0x1f')],function(_0x3fe87b){return{'model':db[_0x3fe87b[_0xe803('0x21')]],'as':_0x3fe87b['as'],'attributes':_0x3fe87b['attributes'],'include':_0x3fe87b['include']?_[_0xe803('0x20')](_0x3fe87b['include'],function(_0x3aa994){return{'model':db[_0x3aa994[_0xe803('0x21')]],'as':_0x3aa994['as'],'attributes':_0x3aa994[_0xe803('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe803('0x23')](function(_0x202fb4){logger[_0xe803('0x24')](_0xe803('0x27'),_0x45122a);logger['debug']('ShowWhatsappQueue',_0x45122a,JSON[_0xe803('0x15')](_0x202fb4));_0x5f0b5f(_0x202fb4);})[_0xe803('0x19')](function(_0x669baf){logger[_0xe803('0x16')](_0xe803('0x27'),_0x669baf[_0xe803('0x18')],_0x45122a);_0x1b6dfe(_0x11e4f2[_0xe803('0x16')](0x1f4,_0x669baf['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 8b5ba45..de7cc24 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 _0x6903=['save','update','emit','removeListener','register','./whatsappQueue.events'];(function(_0x2a53ad,_0x234135){var _0x31b3b6=function(_0x141ec6){while(--_0x141ec6){_0x2a53ad['push'](_0x2a53ad['shift']());}};_0x31b3b6(++_0x234135);}(_0x6903,0x19d));var _0x3690=function(_0x2eeeeb,_0x445c7b){_0x2eeeeb=_0x2eeeeb-0x0;var _0x431fab=_0x6903[_0x2eeeeb];return _0x431fab;};'use strict';var WhatsappQueueEvents=require(_0x3690('0x0'));var events=[_0x3690('0x1'),'remove',_0x3690('0x2')];function createListener(_0x30033c,_0x86df95){return function(_0x271444){_0x86df95[_0x3690('0x3')](_0x30033c,_0x271444);};}function removeListener(_0x23b434,_0x550c83){return function(){WhatsappQueueEvents[_0x3690('0x4')](_0x23b434,_0x550c83);};}exports[_0x3690('0x5')]=function(_0x4c385a){for(var _0x250374=0x0,_0x1e8df3=events['length'];_0x250374<_0x1e8df3;_0x250374++){var _0x362141=events[_0x250374];var _0x14023e=createListener('whatsappQueue:'+_0x362141,_0x4c385a);WhatsappQueueEvents['on'](_0x362141,_0x14023e);}}; \ No newline at end of file +var _0xca3c=['register','whatsappQueue:','./whatsappQueue.events','update','emit','removeListener'];(function(_0x392f96,_0x325d67){var _0x5e11d1=function(_0x575b85){while(--_0x575b85){_0x392f96['push'](_0x392f96['shift']());}};_0x5e11d1(++_0x325d67);}(_0xca3c,0x164));var _0xcca3=function(_0x414a11,_0x19717d){_0x414a11=_0x414a11-0x0;var _0x37ce8b=_0xca3c[_0x414a11];return _0x37ce8b;};'use strict';var WhatsappQueueEvents=require(_0xcca3('0x0'));var events=['save','remove',_0xcca3('0x1')];function createListener(_0x48d817,_0x2b55a9){return function(_0x2e64c1){_0x2b55a9[_0xcca3('0x2')](_0x48d817,_0x2e64c1);};}function removeListener(_0x276f7a,_0x27a3bc){return function(){WhatsappQueueEvents[_0xcca3('0x3')](_0x276f7a,_0x27a3bc);};}exports[_0xcca3('0x4')]=function(_0x18baff){for(var _0x1781d7=0x0,_0x3c3a27=events['length'];_0x1781d7<_0x3c3a27;_0x1781d7++){var _0x1b14d1=events[_0x1781d7];var _0x22c8a8=createListener(_0xcca3('0x5')+_0x1b14d1,_0x18baff);WhatsappQueueEvents['on'](_0x1b14d1,_0x22c8a8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 0b47222..45e6333 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 _0xcc91=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','multer','util','connect-timeout'];(function(_0xdea607,_0x51655a){var _0x5169fc=function(_0x410096){while(--_0x410096){_0xdea607['push'](_0xdea607['shift']());}};_0x5169fc(++_0x51655a);}(_0xcc91,0xa8));var _0x1cc9=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0xcc91[_0x15bbf1];return _0x5c4b47;};'use strict';var multer=require(_0x1cc9('0x0'));var util=require(_0x1cc9('0x1'));var path=require('path');var timeout=require(_0x1cc9('0x2'));var express=require('express');var router=express[_0x1cc9('0x3')]();var fs_extra=require(_0x1cc9('0x4'));var auth=require(_0x1cc9('0x5'));var interaction=require(_0x1cc9('0x6'));var config=require('../../config/environment');var controller=require(_0x1cc9('0x7'));router[_0x1cc9('0x8')]('/',auth[_0x1cc9('0x9')](),controller[_0x1cc9('0xa')]);router[_0x1cc9('0x8')](_0x1cc9('0xb'),auth[_0x1cc9('0x9')](),controller['describe']);router[_0x1cc9('0x8')](_0x1cc9('0xc'),auth[_0x1cc9('0x9')](),controller[_0x1cc9('0xd')]);router[_0x1cc9('0xe')]('/',auth[_0x1cc9('0x9')](),controller[_0x1cc9('0xf')]);router[_0x1cc9('0x10')](_0x1cc9('0xc'),auth[_0x1cc9('0x9')](),controller[_0x1cc9('0x11')]);router[_0x1cc9('0x12')](_0x1cc9('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x08b3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','destroy','multer','path'];(function(_0x4716bc,_0x262c9a){var _0x137a82=function(_0x2f0021){while(--_0x2f0021){_0x4716bc['push'](_0x4716bc['shift']());}};_0x137a82(++_0x262c9a);}(_0x08b3,0xe8));var _0x308b=function(_0x8052e6,_0x39dc81){_0x8052e6=_0x8052e6-0x0;var _0x357ed8=_0x08b3[_0x8052e6];return _0x357ed8;};'use strict';var multer=require(_0x308b('0x0'));var util=require('util');var path=require(_0x308b('0x1'));var timeout=require(_0x308b('0x2'));var express=require(_0x308b('0x3'));var router=express[_0x308b('0x4')]();var fs_extra=require(_0x308b('0x5'));var auth=require(_0x308b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x308b('0x7'));var controller=require(_0x308b('0x8'));router[_0x308b('0x9')]('/',auth[_0x308b('0xa')](),controller['index']);router[_0x308b('0x9')](_0x308b('0xb'),auth[_0x308b('0xa')](),controller[_0x308b('0xc')]);router['get'](_0x308b('0xd'),auth['isAuthenticated'](),controller[_0x308b('0xe')]);router[_0x308b('0xf')]('/',auth[_0x308b('0xa')](),controller['create']);router['put']('/:id',auth[_0x308b('0xa')](),controller[_0x308b('0x10')]);router['delete']('/:id',auth[_0x308b('0xa')](),controller[_0x308b('0x11')]);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 47de5ae..d530b63 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5c1351,_0x1adc35){var _0x33f1cf=function(_0x2d1cc4){while(--_0x2d1cc4){_0x5c1351['push'](_0x5c1351['shift']());}};_0x33f1cf(++_0x1adc35);}(_0x7a54,0x106));var _0x47a5=function(_0x4b3f60,_0x23688a){_0x4b3f60=_0x4b3f60-0x0;var _0x15f5f2=_0x7a54[_0x4b3f60];return _0x15f5f2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3f2918,_0xb3cf7a){var _0x532fdc=function(_0x450c02){while(--_0x450c02){_0x3f2918['push'](_0x3f2918['shift']());}};_0x532fdc(++_0xb3cf7a);}(_0x7a54,0x106));var _0x47a5=function(_0x11afaa,_0x24bf9c){_0x11afaa=_0x11afaa-0x0;var _0x5f1884=_0x7a54[_0x11afaa];return _0x5f1884;};'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 b859d7c..ea2f412 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 _0x13f6=['catch','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13f6,0x124));var _0x613f=function(_0x131dfd,_0x3ab09c){_0x131dfd=_0x131dfd-0x0;var _0x213000=_0x13f6[_0x131dfd];return _0x213000;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['index']=function(_0x121241,_0x2551c1){var _0x4c8aa1={},_0x4cff5d={},_0x4f892d={'count':0x0,'rows':[]};var _0x24be7c=_[_0x613f('0x27')](db[_0x613f('0x28')]['rawAttributes'],function(_0x23eda8){return{'name':_0x23eda8[_0x613f('0x29')],'type':_0x23eda8[_0x613f('0x2a')][_0x613f('0x2b')]};});_0x4cff5d['model']=_[_0x613f('0x27')](_0x24be7c,_0x613f('0x25'));_0x4cff5d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x121241[_0x613f('0x2c')]);_0x4cff5d[_0x613f('0x2e')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],_0x4cff5d[_0x613f('0x2c')]);_0x4c8aa1[_0x613f('0x30')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],qs['fields'](_0x121241[_0x613f('0x2c')][_0x613f('0x31')]));_0x4c8aa1[_0x613f('0x30')]=_0x4c8aa1[_0x613f('0x30')][_0x613f('0x32')]?_0x4c8aa1[_0x613f('0x30')]:_0x4cff5d['model'];if(!_0x121241[_0x613f('0x2c')][_0x613f('0x33')](_0x613f('0x34'))){_0x4c8aa1[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x121241['query']['limit']);_0x4c8aa1['offset']=qs[_0x613f('0x1d')](_0x121241[_0x613f('0x2c')][_0x613f('0x1d')]);}_0x4c8aa1[_0x613f('0x35')]=qs['sort'](_0x121241[_0x613f('0x2c')][_0x613f('0x36')]);_0x4c8aa1['where']=qs[_0x613f('0x2e')](_['pick'](_0x121241[_0x613f('0x2c')],_0x4cff5d['filters']),_0x24be7c);if(_0x121241[_0x613f('0x2c')]['filter']){_0x4c8aa1[_0x613f('0x37')]=_[_0x613f('0x38')](_0x4c8aa1[_0x613f('0x37')],{'$or':_['map'](_0x24be7c,function(_0x36eaa0){if(_0x36eaa0[_0x613f('0x2a')]!==_0x613f('0x39')){var _0x2fb3a6={};_0x2fb3a6[_0x36eaa0[_0x613f('0x25')]]={'$like':'%'+_0x121241[_0x613f('0x2c')][_0x613f('0x3a')]+'%'};return _0x2fb3a6;}})});}_0x4c8aa1=_[_0x613f('0x38')]({},_0x4c8aa1,_0x121241[_0x613f('0x3b')]);var _0x3313c1={'where':_0x4c8aa1['where']};return db[_0x613f('0x28')][_0x613f('0x1c')](_0x3313c1)[_0x613f('0x23')](function(_0x1e5af0){_0x4f892d[_0x613f('0x1c')]=_0x1e5af0;if(_0x121241[_0x613f('0x2c')][_0x613f('0x3c')]){_0x4c8aa1['include']=[{'all':!![]}];}return db[_0x613f('0x28')][_0x613f('0x3d')](_0x4c8aa1);})[_0x613f('0x23')](function(_0x3d2d7b){_0x4f892d[_0x613f('0x3e')]=_0x3d2d7b;return _0x4f892d;})[_0x613f('0x23')](respondWithFilteredResult(_0x2551c1,_0x4c8aa1))[_0x613f('0x3f')](handleError(_0x2551c1,null));};exports['show']=function(_0x343a59,_0x18f427){var _0x3bb605={'raw':!![],'where':{'id':_0x343a59[_0x613f('0x40')]['id']}},_0x2f584e={};_0x2f584e[_0x613f('0x2f')]=_[_0x613f('0x2d')](db[_0x613f('0x28')][_0x613f('0x41')]);_0x2f584e[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x343a59[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x2e')]=_['intersection'](_0x2f584e[_0x613f('0x2f')],_0x2f584e[_0x613f('0x2c')]);_0x3bb605[_0x613f('0x30')]=_[_0x613f('0x42')](_0x2f584e['model'],qs[_0x613f('0x31')](_0x343a59[_0x613f('0x2c')][_0x613f('0x31')]));_0x3bb605[_0x613f('0x30')]=_0x3bb605[_0x613f('0x30')][_0x613f('0x32')]?_0x3bb605[_0x613f('0x30')]:_0x2f584e[_0x613f('0x2f')];if(_0x343a59[_0x613f('0x2c')][_0x613f('0x3c')]){_0x3bb605['include']=[{'all':!![]}];}_0x3bb605=_['merge']({},_0x3bb605,_0x343a59[_0x613f('0x3b')]);return db[_0x613f('0x28')]['find'](_0x3bb605)[_0x613f('0x23')](handleEntityNotFound(_0x18f427,null))[_0x613f('0x23')](respondWithResult(_0x18f427,null))[_0x613f('0x3f')](handleError(_0x18f427,null));};exports[_0x613f('0x43')]=function(_0x39b8b2,_0x1c0b07){return db[_0x613f('0x28')][_0x613f('0x43')](_0x39b8b2[_0x613f('0x44')],{})[_0x613f('0x23')](respondWithResult(_0x1c0b07,0xc9))[_0x613f('0x3f')](handleError(_0x1c0b07,null));};exports[_0x613f('0x22')]=function(_0x174e22,_0x17f8e5){if(_0x174e22[_0x613f('0x44')]['id']){delete _0x174e22[_0x613f('0x44')]['id'];}return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x174e22['params']['id']}})['then'](handleEntityNotFound(_0x17f8e5,null))[_0x613f('0x23')](saveUpdates(_0x174e22[_0x613f('0x44')],null))['then'](respondWithResult(_0x17f8e5,null))['catch'](handleError(_0x17f8e5,null));};exports[_0x613f('0x24')]=function(_0x51729a,_0x513bf1){return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x51729a[_0x613f('0x40')]['id']}})['then'](handleEntityNotFound(_0x513bf1,null))[_0x613f('0x23')](removeEntity(_0x513bf1,null))[_0x613f('0x3f')](handleError(_0x513bf1,null));};exports['describe']=function(_0x55e878,_0x1c0c8e){return db[_0x613f('0x28')][_0x613f('0x46')]()[_0x613f('0x23')](respondWithResult(_0x1c0c8e,null))[_0x613f('0x3f')](handleError(_0x1c0c8e,null));}; \ No newline at end of file +var _0x236c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','WhatsappQueueReport','fieldName','key','query','filters','intersection'];(function(_0x41b2ab,_0xcd1095){var _0x93b877=function(_0x206d36){while(--_0x206d36){_0x41b2ab['push'](_0x41b2ab['shift']());}};_0x93b877(++_0xcd1095);}(_0x236c,0x155));var _0xc236=function(_0x908ef4,_0x475e99){_0x908ef4=_0x908ef4-0x0;var _0x1cadc5=_0x236c[_0x908ef4];return _0x1cadc5;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x21fab8[_0xc236('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308cd6,_0x21d78f){return function(_0x356042){if(!_0x356042){_0x308cd6[_0xc236('0x26')](0x194);}return _0x356042;};}function handleError(_0x561da1,_0x42f248){_0x42f248=_0x42f248||0x1f4;return function(_0x5da4b2){logger['error'](_0x5da4b2[_0xc236('0x27')]);if(_0x5da4b2['name']){delete _0x5da4b2[_0xc236('0x28')];}_0x561da1['status'](_0x42f248)[_0xc236('0x29')](_0x5da4b2);};}exports['index']=function(_0x423842,_0x1d144b){var _0x4f5175={},_0x5a61b5={},_0x265c8d={'count':0x0,'rows':[]};var _0x1fd31d=_[_0xc236('0x2a')](db[_0xc236('0x2b')]['rawAttributes'],function(_0x4e3262){return{'name':_0x4e3262[_0xc236('0x2c')],'type':_0x4e3262['type'][_0xc236('0x2d')]};});_0x5a61b5['model']=_[_0xc236('0x2a')](_0x1fd31d,_0xc236('0x28'));_0x5a61b5['query']=_['keys'](_0x423842[_0xc236('0x2e')]);_0x5a61b5[_0xc236('0x2f')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],_0x5a61b5[_0xc236('0x2e')]);_0x4f5175[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x423842['query']['fields']));_0x4f5175['attributes']=_0x4f5175[_0xc236('0x32')][_0xc236('0x34')]?_0x4f5175[_0xc236('0x32')]:_0x5a61b5[_0xc236('0x31')];if(!_0x423842[_0xc236('0x2e')][_0xc236('0x35')](_0xc236('0x36'))){_0x4f5175['limit']=qs[_0xc236('0x37')](_0x423842[_0xc236('0x2e')][_0xc236('0x37')]);_0x4f5175['offset']=qs[_0xc236('0x1a')](_0x423842[_0xc236('0x2e')][_0xc236('0x1a')]);}_0x4f5175[_0xc236('0x38')]=qs['sort'](_0x423842[_0xc236('0x2e')][_0xc236('0x39')]);_0x4f5175[_0xc236('0x3a')]=qs[_0xc236('0x2f')](_[_0xc236('0x3b')](_0x423842[_0xc236('0x2e')],_0x5a61b5[_0xc236('0x2f')]),_0x1fd31d);if(_0x423842[_0xc236('0x2e')][_0xc236('0x3c')]){_0x4f5175[_0xc236('0x3a')]=_[_0xc236('0x3d')](_0x4f5175[_0xc236('0x3a')],{'$or':_[_0xc236('0x2a')](_0x1fd31d,function(_0x237193){if(_0x237193[_0xc236('0x3e')]!==_0xc236('0x3f')){var _0x46db5a={};_0x46db5a[_0x237193['name']]={'$like':'%'+_0x423842['query']['filter']+'%'};return _0x46db5a;}})});}_0x4f5175=_['merge']({},_0x4f5175,_0x423842[_0xc236('0x40')]);var _0x5c4739={'where':_0x4f5175[_0xc236('0x3a')]};return db[_0xc236('0x2b')][_0xc236('0x1c')](_0x5c4739)[_0xc236('0x24')](function(_0xdf7897){_0x265c8d[_0xc236('0x1c')]=_0xdf7897;if(_0x423842[_0xc236('0x2e')][_0xc236('0x41')]){_0x4f5175[_0xc236('0x42')]=[{'all':!![]}];}return db[_0xc236('0x2b')][_0xc236('0x43')](_0x4f5175);})[_0xc236('0x24')](function(_0x3b2f2f){_0x265c8d[_0xc236('0x44')]=_0x3b2f2f;return _0x265c8d;})[_0xc236('0x24')](respondWithFilteredResult(_0x1d144b,_0x4f5175))['catch'](handleError(_0x1d144b,null));};exports[_0xc236('0x45')]=function(_0x24b851,_0x506ba0){var _0xb90a83={'raw':!![],'where':{'id':_0x24b851[_0xc236('0x46')]['id']}},_0x5b0bc5={};_0x5b0bc5['model']=_[_0xc236('0x47')](db[_0xc236('0x2b')][_0xc236('0x48')]);_0x5b0bc5['query']=_[_0xc236('0x47')](_0x24b851[_0xc236('0x2e')]);_0x5b0bc5[_0xc236('0x2f')]=_['intersection'](_0x5b0bc5[_0xc236('0x31')],_0x5b0bc5[_0xc236('0x2e')]);_0xb90a83[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5b0bc5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x24b851['query'][_0xc236('0x33')]));_0xb90a83['attributes']=_0xb90a83[_0xc236('0x32')][_0xc236('0x34')]?_0xb90a83[_0xc236('0x32')]:_0x5b0bc5[_0xc236('0x31')];if(_0x24b851[_0xc236('0x2e')][_0xc236('0x41')]){_0xb90a83[_0xc236('0x42')]=[{'all':!![]}];}_0xb90a83=_['merge']({},_0xb90a83,_0x24b851[_0xc236('0x40')]);return db['WhatsappQueueReport'][_0xc236('0x49')](_0xb90a83)[_0xc236('0x24')](handleEntityNotFound(_0x506ba0,null))['then'](respondWithResult(_0x506ba0,null))[_0xc236('0x4a')](handleError(_0x506ba0,null));};exports[_0xc236('0x4b')]=function(_0x3c1c5c,_0x161890){return db[_0xc236('0x2b')][_0xc236('0x4b')](_0x3c1c5c[_0xc236('0x4c')],{})['then'](respondWithResult(_0x161890,0xc9))['catch'](handleError(_0x161890,null));};exports[_0xc236('0x23')]=function(_0x2afed2,_0x510f7f){if(_0x2afed2[_0xc236('0x4c')]['id']){delete _0x2afed2[_0xc236('0x4c')]['id'];}return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x2afed2[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x510f7f,null))[_0xc236('0x24')](saveUpdates(_0x2afed2[_0xc236('0x4c')],null))[_0xc236('0x24')](respondWithResult(_0x510f7f,null))['catch'](handleError(_0x510f7f,null));};exports[_0xc236('0x25')]=function(_0x307663,_0x41b7d5){return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x307663[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x41b7d5,null))['then'](removeEntity(_0x41b7d5,null))[_0xc236('0x4a')](handleError(_0x41b7d5,null));};exports[_0xc236('0x4d')]=function(_0x17c86b,_0x16ff63){return db['WhatsappQueueReport'][_0xc236('0x4d')]()[_0xc236('0x24')](respondWithResult(_0x16ff63,null))[_0xc236('0x4a')](handleError(_0x16ff63,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 715c53b..360f015 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 _0x3eff=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x4bb3d3,_0x5d5f7c){var _0x29d1a2=function(_0x31ac2b){while(--_0x31ac2b){_0x4bb3d3['push'](_0x4bb3d3['shift']());}};_0x29d1a2(++_0x5d5f7c);}(_0x3eff,0x105));var _0xf3ef=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0x3eff[_0x4529b3];return _0x21e907;};'use strict';var _=require(_0xf3ef('0x0'));var util=require(_0xf3ef('0x1'));var logger=require(_0xf3ef('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf3ef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3ef('0x4'));var rimraf=require(_0xf3ef('0x5'));var config=require(_0xf3ef('0x6'));var attributes=require(_0xf3ef('0x7'));module[_0xf3ef('0x8')]=function(_0x38d975,_0x281647){return _0x38d975[_0xf3ef('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0xf3ef('0xa'),'paranoid':![],'indexes':[{'name':_0xf3ef('0xb'),'fields':[_0xf3ef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2329=['uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','define','report_whatsapp_queue'];(function(_0x336513,_0x3aa6c3){var _0x195682=function(_0xe224b9){while(--_0xe224b9){_0x336513['push'](_0x336513['shift']());}};_0x195682(++_0x3aa6c3);}(_0x2329,0x169));var _0x9232=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2329[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9232('0x0'));var logger=require(_0x9232('0x1'))('api');var moment=require(_0x9232('0x2'));var BPromise=require(_0x9232('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9232('0x4'));var rimraf=require(_0x9232('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0xbf9723,_0x190134){return _0xbf9723[_0x9232('0x6')]('WhatsappQueueReport',attributes,{'tableName':_0x9232('0x7'),'paranoid':![],'indexes':[{'name':_0x9232('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 73c66bb..ee4ac9a 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 _0x0a29=['UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateWhatsappQueueReport','create','body','options','raw','then'];(function(_0x8485ba,_0x3c72d3){var _0x26dca3=function(_0x350110){while(--_0x350110){_0x8485ba['push'](_0x8485ba['shift']());}};_0x26dca3(++_0x3c72d3);}(_0x0a29,0x186));var _0x90a2=function(_0x3e2cfb,_0x7c12c6){_0x3e2cfb=_0x3e2cfb-0x0;var _0x3e4308=_0x0a29[_0x3e2cfb];return _0x3e4308;};'use strict';var _=require(_0x90a2('0x0'));var util=require(_0x90a2('0x1'));var moment=require('moment');var BPromise=require(_0x90a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a2('0x3'));var db=require(_0x90a2('0x4'))['db'];var utils=require(_0x90a2('0x5'));var logger=require('../../config/logger')(_0x90a2('0x6'));var config=require('../../config/environment');var jayson=require(_0x90a2('0x7'));var client=jayson['client'][_0x90a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57f9e7,_0x48a4eb,_0x2e8367){return new BPromise(function(_0x490abb,_0x22d860){return client[_0x90a2('0x9')](_0x57f9e7,_0x2e8367)['then'](function(_0x439e4a){logger[_0x90a2('0xa')](_0x90a2('0xb'),_0x48a4eb,_0x90a2('0xc'));logger[_0x90a2('0xd')](_0x90a2('0xe'),_0x48a4eb,'request\x20sent',JSON[_0x90a2('0xf')](_0x439e4a));if(_0x439e4a['error']){if(_0x439e4a['error'][_0x90a2('0x10')]===0x1f4){logger[_0x90a2('0x11')](_0x90a2('0xb'),_0x48a4eb,_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);return _0x22d860(_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);}logger[_0x90a2('0x11')](_0x90a2('0xb'),_0x48a4eb,_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);return _0x490abb(_0x439e4a[_0x90a2('0x11')]['message']);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x48a4eb,_0x90a2('0xc'));_0x490abb(_0x439e4a[_0x90a2('0x13')]['message']);}})['catch'](function(_0x53d65d){logger['error'](_0x90a2('0xb'),_0x48a4eb,_0x53d65d);_0x22d860(_0x53d65d);});});}exports[_0x90a2('0x14')]=function(_0x558952){var _0x5eed3e=this;return new Promise(function(_0x31dda8,_0x8eeb06){return db['WhatsappQueueReport'][_0x90a2('0x15')](_0x558952[_0x90a2('0x16')],{'raw':_0x558952[_0x90a2('0x17')]?_0x558952[_0x90a2('0x17')][_0x90a2('0x18')]===undefined?!![]:![]:!![]})[_0x90a2('0x19')](function(_0x4a1d8b){logger[_0x90a2('0xa')](_0x90a2('0x14'),_0x558952);logger[_0x90a2('0xd')](_0x90a2('0x14'),_0x558952,JSON[_0x90a2('0xf')](_0x4a1d8b));_0x31dda8(_0x4a1d8b);})['catch'](function(_0x5179b9){logger[_0x90a2('0x11')](_0x90a2('0x14'),_0x5179b9[_0x90a2('0x12')],_0x558952);_0x8eeb06(_0x5eed3e[_0x90a2('0x11')](0x1f4,_0x5179b9[_0x90a2('0x12')]));});});};exports[_0x90a2('0x1a')]=function(_0x2df0a7){var _0x243bc0=this;return new Promise(function(_0x369d88,_0x11c789){return db[_0x90a2('0x1b')][_0x90a2('0x1c')](_0x2df0a7[_0x90a2('0x16')],{'raw':_0x2df0a7[_0x90a2('0x17')]?_0x2df0a7['options'][_0x90a2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2df0a7['options']?_0x2df0a7['options']['where']||null:null,'attributes':_0x2df0a7['options']?_0x2df0a7[_0x90a2('0x17')][_0x90a2('0x1d')]||null:null,'limit':_0x2df0a7[_0x90a2('0x17')]?_0x2df0a7[_0x90a2('0x17')][_0x90a2('0x1e')]||null:null})[_0x90a2('0x19')](function(_0x3a7ef7){logger[_0x90a2('0xa')](_0x90a2('0x1a'),_0x2df0a7);logger[_0x90a2('0xd')](_0x90a2('0x1a'),_0x2df0a7,JSON[_0x90a2('0xf')](_0x3a7ef7));_0x369d88(_0x3a7ef7);})[_0x90a2('0x1f')](function(_0x1e0199){logger[_0x90a2('0x11')](_0x90a2('0x1a'),_0x1e0199[_0x90a2('0x12')],_0x2df0a7);_0x11c789(_0x243bc0[_0x90a2('0x11')](0x1f4,_0x1e0199[_0x90a2('0x12')]));});});}; \ No newline at end of file +var _0xb4db=['catch','WhatsappQueueReport','create','options','raw','CreateWhatsappQueueReport','debug','UpdateWhatsappQueueReport','body','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','info','result'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb4db,0x17e));var _0xbb4d=function(_0x2cd949,_0x4cf780){_0x2cd949=_0x2cd949-0x0;var _0xa66879=_0xb4db[_0x2cd949];return _0xa66879;};'use strict';var _=require(_0xbb4d('0x0'));var util=require(_0xbb4d('0x1'));var moment=require(_0xbb4d('0x2'));var BPromise=require(_0xbb4d('0x3'));var rs=require(_0xbb4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb4d('0x5'))['db'];var utils=require(_0xbb4d('0x6'));var logger=require(_0xbb4d('0x7'))('rpc');var config=require(_0xbb4d('0x8'));var jayson=require(_0xbb4d('0x9'));var client=jayson[_0xbb4d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x231bce,_0x3e9662,_0x35f2cd){return new BPromise(function(_0x5d1018,_0x18b528){return client[_0xbb4d('0xb')](_0x231bce,_0x35f2cd)[_0xbb4d('0xc')](function(_0x488f86){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x3e9662,_0xbb4d('0xd'));logger['debug'](_0xbb4d('0xe'),_0x3e9662,_0xbb4d('0xd'),JSON[_0xbb4d('0xf')](_0x488f86));if(_0x488f86[_0xbb4d('0x10')]){if(_0x488f86[_0xbb4d('0x10')]['code']===0x1f4){logger[_0xbb4d('0x10')](_0xbb4d('0x11'),_0x3e9662,_0x488f86[_0xbb4d('0x10')][_0xbb4d('0x12')]);return _0x18b528(_0x488f86[_0xbb4d('0x10')]['message']);}logger['error'](_0xbb4d('0x11'),_0x3e9662,_0x488f86['error'][_0xbb4d('0x12')]);return _0x5d1018(_0x488f86[_0xbb4d('0x10')]['message']);}else{logger[_0xbb4d('0x13')](_0xbb4d('0x11'),_0x3e9662,_0xbb4d('0xd'));_0x5d1018(_0x488f86[_0xbb4d('0x14')][_0xbb4d('0x12')]);}})[_0xbb4d('0x15')](function(_0x23cf58){logger[_0xbb4d('0x10')](_0xbb4d('0x11'),_0x3e9662,_0x23cf58);_0x18b528(_0x23cf58);});});}exports['CreateWhatsappQueueReport']=function(_0x3dd8fd){var _0xe898d8=this;return new Promise(function(_0x432a99,_0x6a035a){return db[_0xbb4d('0x16')][_0xbb4d('0x17')](_0x3dd8fd['body'],{'raw':_0x3dd8fd[_0xbb4d('0x18')]?_0x3dd8fd[_0xbb4d('0x18')][_0xbb4d('0x19')]===undefined?!![]:![]:!![]})[_0xbb4d('0xc')](function(_0x75d315){logger['info'](_0xbb4d('0x1a'),_0x3dd8fd);logger[_0xbb4d('0x1b')]('CreateWhatsappQueueReport',_0x3dd8fd,JSON[_0xbb4d('0xf')](_0x75d315));_0x432a99(_0x75d315);})[_0xbb4d('0x15')](function(_0x3ed290){logger[_0xbb4d('0x10')](_0xbb4d('0x1a'),_0x3ed290['message'],_0x3dd8fd);_0x6a035a(_0xe898d8[_0xbb4d('0x10')](0x1f4,_0x3ed290[_0xbb4d('0x12')]));});});};exports[_0xbb4d('0x1c')]=function(_0x1300fc){var _0x436f6c=this;return new Promise(function(_0x5e9e38,_0x2784f5){return db['WhatsappQueueReport']['update'](_0x1300fc[_0xbb4d('0x1d')],{'raw':_0x1300fc[_0xbb4d('0x18')]?_0x1300fc[_0xbb4d('0x18')][_0xbb4d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1300fc[_0xbb4d('0x18')]?_0x1300fc[_0xbb4d('0x18')]['where']||null:null,'attributes':_0x1300fc['options']?_0x1300fc[_0xbb4d('0x18')][_0xbb4d('0x1e')]||null:null,'limit':_0x1300fc[_0xbb4d('0x18')]?_0x1300fc['options']['limit']||null:null})[_0xbb4d('0xc')](function(_0x41b8fd){logger[_0xbb4d('0x13')](_0xbb4d('0x1c'),_0x1300fc);logger[_0xbb4d('0x1b')](_0xbb4d('0x1c'),_0x1300fc,JSON['stringify'](_0x41b8fd));_0x5e9e38(_0x41b8fd);})[_0xbb4d('0x15')](function(_0x5736d1){logger[_0xbb4d('0x10')]('UpdateWhatsappQueueReport',_0x5736d1['message'],_0x1300fc);_0x2784f5(_0x436f6c[_0xbb4d('0x10')](0x1f4,_0x5736d1[_0xbb4d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c19d6bc..6df2697 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 _0x1196=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','create'];(function(_0x37935f,_0x271c8c){var _0x98f7b0=function(_0x4895ba){while(--_0x4895ba){_0x37935f['push'](_0x37935f['shift']());}};_0x98f7b0(++_0x271c8c);}(_0x1196,0x1bc));var _0x6119=function(_0x8e2094,_0x455517){_0x8e2094=_0x8e2094-0x0;var _0x2afe6c=_0x1196[_0x8e2094];return _0x2afe6c;};'use strict';var multer=require(_0x6119('0x0'));var util=require(_0x6119('0x1'));var path=require('path');var timeout=require(_0x6119('0x2'));var express=require(_0x6119('0x3'));var router=express[_0x6119('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6119('0x5'));var interaction=require(_0x6119('0x6'));var config=require(_0x6119('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x6119('0x8')]('/',auth['isAuthenticated'](),controller[_0x6119('0x9')]);router[_0x6119('0x8')]('/describe',auth[_0x6119('0xa')](),controller[_0x6119('0xb')]);router['get'](_0x6119('0xc'),auth[_0x6119('0xa')](),controller[_0x6119('0xd')]);router[_0x6119('0xe')]('/',auth[_0x6119('0xa')](),controller[_0x6119('0xf')]);router['put']('/:id',auth[_0x6119('0xa')](),controller[_0x6119('0x10')]);router[_0x6119('0x11')](_0x6119('0xc'),auth[_0x6119('0xa')](),controller[_0x6119('0x12')]);module[_0x6119('0x13')]=router; \ No newline at end of file +var _0x3fe6=['describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','/describe','isAuthenticated'];(function(_0x4f54dc,_0x267c9a){var _0x23331b=function(_0x17588a){while(--_0x17588a){_0x4f54dc['push'](_0x4f54dc['shift']());}};_0x23331b(++_0x267c9a);}(_0x3fe6,0x15d));var _0x63fe=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x3fe6[_0x4e6eb2];return _0x4e0c1c;};'use strict';var multer=require(_0x63fe('0x0'));var util=require(_0x63fe('0x1'));var path=require(_0x63fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x63fe('0x3'));var router=express[_0x63fe('0x4')]();var fs_extra=require(_0x63fe('0x5'));var auth=require(_0x63fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63fe('0x7'));router[_0x63fe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x63fe('0x8')](_0x63fe('0x9'),auth[_0x63fe('0xa')](),controller[_0x63fe('0xb')]);router['get'](_0x63fe('0xc'),auth[_0x63fe('0xa')](),controller[_0x63fe('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x63fe('0xe')]);router[_0x63fe('0xf')]('/:id',auth[_0x63fe('0xa')](),controller[_0x63fe('0x10')]);router[_0x63fe('0x11')]('/:id',auth[_0x63fe('0xa')](),controller[_0x63fe('0x12')]);module[_0x63fe('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 4c918a4..feb2750 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 _0xae87=['account','agent','DATE'];(function(_0x2f8162,_0x1448d1){var _0x546d7b=function(_0x418cf8){while(--_0x418cf8){_0x2f8162['push'](_0x2f8162['shift']());}};_0x546d7b(++_0x1448d1);}(_0xae87,0x1ce));var _0x7ae8=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xae87[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7ae8('0x0'),_0x7ae8('0x1'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7ae8('0x2')]}}; \ No newline at end of file +var _0xf79e=['STRING','ENUM','agent','queue','exports'];(function(_0xe33ed7,_0x294425){var _0x2f6af5=function(_0xf9d402){while(--_0xf9d402){_0xe33ed7['push'](_0xe33ed7['shift']());}};_0x2f6af5(++_0x294425);}(_0xf79e,0x185));var _0xef79=function(_0x58d461,_0x116600){_0x58d461=_0x58d461-0x0;var _0x2bd2b0=_0xf79e[_0x58d461];return _0x2bd2b0;};'use strict';var Sequelize=require('sequelize');module[_0xef79('0x0')]={'uniqueid':{'type':Sequelize[_0xef79('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xef79('0x2')]('account',_0xef79('0x3'),_0xef79('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 5129b4c..315615e 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 _0x108f=['then','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','keys','rawAttributes','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x1da069,_0x566441){var _0x14055f=function(_0x36b54f){while(--_0x36b54f){_0x1da069['push'](_0x1da069['shift']());}};_0x14055f(++_0x566441);}(_0x108f,0xbe));var _0xf108=function(_0x2b442b,_0x334448){_0x2b442b=_0x2b442b-0x0;var _0x2c6585=_0x108f[_0x2b442b];return _0x2c6585;};'use strict';var emlformat=require(_0xf108('0x0'));var rimraf=require(_0xf108('0x1'));var zipdir=require(_0xf108('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf108('0x3'));var BPromise=require(_0xf108('0x4'));var Mustache=require('mustache');var util=require(_0xf108('0x5'));var path=require('path');var sox=require(_0xf108('0x6'));var csv=require(_0xf108('0x7'));var ejs=require(_0xf108('0x8'));var fs=require('fs');var fs_extra=require(_0xf108('0x9'));var _=require('lodash');var squel=require(_0xf108('0xa'));var crypto=require(_0xf108('0xb'));var jsforce=require(_0xf108('0xc'));var deskjs=require(_0xf108('0xd'));var toCsv=require(_0xf108('0x7'));var querystring=require('querystring');var Papa=require(_0xf108('0xe'));var Redis=require(_0xf108('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf108('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf108('0x11'));var utils=require(_0xf108('0x12'));var config=require(_0xf108('0x13'));var licenseUtil=require(_0xf108('0x14'));var db=require(_0xf108('0x15'))['db'];function respondWithStatusCode(_0x319833,_0x272275){_0x272275=_0x272275||0xcc;return function(_0x2573a3){if(_0x2573a3){return _0x319833[_0xf108('0x16')](_0x272275);}return _0x319833[_0xf108('0x17')](_0x272275)['end']();};}function respondWithResult(_0x5a57bf,_0x4e2947){_0x4e2947=_0x4e2947||0xc8;return function(_0x14c749){if(_0x14c749){return _0x5a57bf[_0xf108('0x17')](_0x4e2947)[_0xf108('0x18')](_0x14c749);}};}function respondWithFilteredResult(_0x516045,_0x33bdaa){return function(_0x4e7827){if(_0x4e7827){var _0x1d3582=typeof _0x33bdaa[_0xf108('0x19')]===_0xf108('0x1a')&&typeof _0x33bdaa[_0xf108('0x1b')]===_0xf108('0x1a');var _0x50925b=_0x4e7827[_0xf108('0x1c')];var _0x3e2fe9=_0x1d3582?0x0:_0x33bdaa['offset'];var _0x59c00e=_0x1d3582?_0x4e7827['count']:_0x33bdaa['offset']+_0x33bdaa[_0xf108('0x1b')];var _0x2ef416;if(_0x59c00e>=_0x50925b){_0x59c00e=_0x50925b;_0x2ef416=0xc8;}else{_0x2ef416=0xce;}_0x516045['status'](_0x2ef416);return _0x516045[_0xf108('0x1d')](_0xf108('0x1e'),_0x3e2fe9+'-'+_0x59c00e+'/'+_0x50925b)[_0xf108('0x18')](_0x4e7827);}return null;};}function patchUpdates(_0x413bda){return function(_0x27bac4){try{jsonpatch[_0xf108('0x1f')](_0x27bac4,_0x413bda,!![]);}catch(_0x38c78a){return BPromise[_0xf108('0x20')](_0x38c78a);}return _0x27bac4[_0xf108('0x21')]();};}function saveUpdates(_0x38362c,_0x23b87f){return function(_0x29b5d6){if(_0x29b5d6){return _0x29b5d6[_0xf108('0x22')](_0x38362c)[_0xf108('0x23')](function(_0x489071){return _0x489071;});}return null;};}function removeEntity(_0x4d42e1,_0x1691a0){return function(_0xd1917d){if(_0xd1917d){return _0xd1917d[_0xf108('0x24')]()[_0xf108('0x23')](function(){_0x4d42e1[_0xf108('0x17')](0xcc)[_0xf108('0x25')]();});}};}function handleEntityNotFound(_0x2f663e,_0x1945f2){return function(_0x5cf328){if(!_0x5cf328){_0x2f663e[_0xf108('0x16')](0x194);}return _0x5cf328;};}function handleError(_0x1ed123,_0x344223){_0x344223=_0x344223||0x1f4;return function(_0x526bb7){logger[_0xf108('0x26')](_0x526bb7[_0xf108('0x27')]);if(_0x526bb7[_0xf108('0x28')]){delete _0x526bb7[_0xf108('0x28')];}_0x1ed123[_0xf108('0x17')](_0x344223)[_0xf108('0x29')](_0x526bb7);};}exports[_0xf108('0x2a')]=function(_0x427a85,_0x1d334d){var _0x47d547={},_0xd54ab5={},_0x51df1c={'count':0x0,'rows':[]};var _0x3f4a7b=_[_0xf108('0x2b')](db[_0xf108('0x2c')]['rawAttributes'],function(_0x5e726f){return{'name':_0x5e726f[_0xf108('0x2d')],'type':_0x5e726f['type']['key']};});_0xd54ab5['model']=_[_0xf108('0x2b')](_0x3f4a7b,_0xf108('0x28'));_0xd54ab5[_0xf108('0x2e')]=_['keys'](_0x427a85[_0xf108('0x2e')]);_0xd54ab5[_0xf108('0x2f')]=_[_0xf108('0x30')](_0xd54ab5[_0xf108('0x31')],_0xd54ab5[_0xf108('0x2e')]);_0x47d547[_0xf108('0x32')]=_[_0xf108('0x30')](_0xd54ab5['model'],qs[_0xf108('0x33')](_0x427a85['query'][_0xf108('0x33')]));_0x47d547[_0xf108('0x32')]=_0x47d547['attributes'][_0xf108('0x34')]?_0x47d547['attributes']:_0xd54ab5[_0xf108('0x31')];if(!_0x427a85[_0xf108('0x2e')][_0xf108('0x35')](_0xf108('0x36'))){_0x47d547[_0xf108('0x1b')]=qs[_0xf108('0x1b')](_0x427a85[_0xf108('0x2e')]['limit']);_0x47d547[_0xf108('0x19')]=qs[_0xf108('0x19')](_0x427a85[_0xf108('0x2e')][_0xf108('0x19')]);}_0x47d547['order']=qs[_0xf108('0x37')](_0x427a85['query'][_0xf108('0x37')]);_0x47d547[_0xf108('0x38')]=qs[_0xf108('0x2f')](_[_0xf108('0x39')](_0x427a85['query'],_0xd54ab5[_0xf108('0x2f')]),_0x3f4a7b);if(_0x427a85[_0xf108('0x2e')][_0xf108('0x3a')]){_0x47d547['where']=_[_0xf108('0x3b')](_0x47d547[_0xf108('0x38')],{'$or':_[_0xf108('0x2b')](_0x3f4a7b,function(_0x4dc504){if(_0x4dc504[_0xf108('0x3c')]!=='VIRTUAL'){var _0x110bee={};_0x110bee[_0x4dc504['name']]={'$like':'%'+_0x427a85[_0xf108('0x2e')][_0xf108('0x3a')]+'%'};return _0x110bee;}})});}_0x47d547=_[_0xf108('0x3b')]({},_0x47d547,_0x427a85[_0xf108('0x3d')]);var _0x31bac6={'where':_0x47d547[_0xf108('0x38')]};return db[_0xf108('0x2c')]['count'](_0x31bac6)['then'](function(_0x5565b0){_0x51df1c[_0xf108('0x1c')]=_0x5565b0;if(_0x427a85[_0xf108('0x2e')][_0xf108('0x3e')]){_0x47d547[_0xf108('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xf108('0x40')](_0x47d547);})[_0xf108('0x23')](function(_0xa9aa32){_0x51df1c[_0xf108('0x41')]=_0xa9aa32;return _0x51df1c;})[_0xf108('0x23')](respondWithFilteredResult(_0x1d334d,_0x47d547))['catch'](handleError(_0x1d334d,null));};exports[_0xf108('0x42')]=function(_0x2f54e0,_0x4050d4){var _0x1dbf31={'raw':!![],'where':{'id':_0x2f54e0['params']['id']}},_0x167c35={};_0x167c35[_0xf108('0x31')]=_[_0xf108('0x43')](db['WhatsappTransferReport'][_0xf108('0x44')]);_0x167c35[_0xf108('0x2e')]=_[_0xf108('0x43')](_0x2f54e0['query']);_0x167c35[_0xf108('0x2f')]=_[_0xf108('0x30')](_0x167c35[_0xf108('0x31')],_0x167c35[_0xf108('0x2e')]);_0x1dbf31[_0xf108('0x32')]=_[_0xf108('0x30')](_0x167c35['model'],qs[_0xf108('0x33')](_0x2f54e0[_0xf108('0x2e')][_0xf108('0x33')]));_0x1dbf31[_0xf108('0x32')]=_0x1dbf31[_0xf108('0x32')][_0xf108('0x34')]?_0x1dbf31['attributes']:_0x167c35[_0xf108('0x31')];if(_0x2f54e0[_0xf108('0x2e')][_0xf108('0x3e')]){_0x1dbf31['include']=[{'all':!![]}];}_0x1dbf31=_['merge']({},_0x1dbf31,_0x2f54e0[_0xf108('0x3d')]);return db[_0xf108('0x2c')]['find'](_0x1dbf31)[_0xf108('0x23')](handleEntityNotFound(_0x4050d4,null))[_0xf108('0x23')](respondWithResult(_0x4050d4,null))[_0xf108('0x45')](handleError(_0x4050d4,null));};exports[_0xf108('0x46')]=function(_0x2c6bb3,_0xe0a31c){return db[_0xf108('0x2c')]['create'](_0x2c6bb3[_0xf108('0x47')],{})['then'](respondWithResult(_0xe0a31c,0xc9))[_0xf108('0x45')](handleError(_0xe0a31c,null));};exports[_0xf108('0x22')]=function(_0x392bbb,_0x467c2f){if(_0x392bbb[_0xf108('0x47')]['id']){delete _0x392bbb['body']['id'];}return db['WhatsappTransferReport'][_0xf108('0x48')]({'where':{'id':_0x392bbb[_0xf108('0x49')]['id']}})['then'](handleEntityNotFound(_0x467c2f,null))['then'](saveUpdates(_0x392bbb['body'],null))['then'](respondWithResult(_0x467c2f,null))[_0xf108('0x45')](handleError(_0x467c2f,null));};exports[_0xf108('0x24')]=function(_0x1db8ab,_0x47a406){return db[_0xf108('0x2c')]['find']({'where':{'id':_0x1db8ab[_0xf108('0x49')]['id']}})['then'](handleEntityNotFound(_0x47a406,null))[_0xf108('0x23')](removeEntity(_0x47a406,null))['catch'](handleError(_0x47a406,null));};exports[_0xf108('0x4a')]=function(_0x99dbc5,_0x2d106e){return db[_0xf108('0x2c')][_0xf108('0x4a')]()[_0xf108('0x23')](respondWithResult(_0x2d106e,null))[_0xf108('0x45')](handleError(_0x2d106e,null));}; \ No newline at end of file +var _0xe296=['attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','WhatsappTransferReport','findAll','rows','show','params','rawAttributes','fields','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','fieldName','type','model','query','keys','filters','intersection'];(function(_0x40f98f,_0x3bcd3a){var _0x524783=function(_0x213718){while(--_0x213718){_0x40f98f['push'](_0x40f98f['shift']());}};_0x524783(++_0x3bcd3a);}(_0xe296,0x1d1));var _0x6e29=function(_0x18a4f7,_0x3f915c){_0x18a4f7=_0x18a4f7-0x0;var _0x368cf3=_0xe296[_0x18a4f7];return _0x368cf3;};'use strict';var emlformat=require(_0x6e29('0x0'));var rimraf=require(_0x6e29('0x1'));var zipdir=require(_0x6e29('0x2'));var jsonpatch=require(_0x6e29('0x3'));var rp=require(_0x6e29('0x4'));var moment=require(_0x6e29('0x5'));var BPromise=require(_0x6e29('0x6'));var Mustache=require('mustache');var util=require(_0x6e29('0x7'));var path=require('path');var sox=require(_0x6e29('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e29('0x9'));var _=require(_0x6e29('0xa'));var squel=require(_0x6e29('0xb'));var crypto=require(_0x6e29('0xc'));var jsforce=require(_0x6e29('0xd'));var deskjs=require(_0x6e29('0xe'));var toCsv=require(_0x6e29('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6e29('0x10'));var as=require(_0x6e29('0x11'));var hardwareService=require(_0x6e29('0x12'));var logger=require(_0x6e29('0x13'))(_0x6e29('0x14'));var utils=require('../../config/utils');var config=require(_0x6e29('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5729a4,_0x3f3283){_0x3f3283=_0x3f3283||0xcc;return function(_0x17bf5b){if(_0x17bf5b){return _0x5729a4['sendStatus'](_0x3f3283);}return _0x5729a4[_0x6e29('0x16')](_0x3f3283)[_0x6e29('0x17')]();};}function respondWithResult(_0x2ef4c4,_0x38cda6){_0x38cda6=_0x38cda6||0xc8;return function(_0x42f97b){if(_0x42f97b){return _0x2ef4c4['status'](_0x38cda6)['json'](_0x42f97b);}};}function respondWithFilteredResult(_0x8b4423,_0x48b18c){return function(_0x315270){if(_0x315270){var _0x85f6ae=typeof _0x48b18c[_0x6e29('0x18')]===_0x6e29('0x19')&&typeof _0x48b18c['limit']===_0x6e29('0x19');var _0x38a872=_0x315270[_0x6e29('0x1a')];var _0x3519ed=_0x85f6ae?0x0:_0x48b18c[_0x6e29('0x18')];var _0x2fd515=_0x85f6ae?_0x315270[_0x6e29('0x1a')]:_0x48b18c[_0x6e29('0x18')]+_0x48b18c['limit'];var _0x4578af;if(_0x2fd515>=_0x38a872){_0x2fd515=_0x38a872;_0x4578af=0xc8;}else{_0x4578af=0xce;}_0x8b4423[_0x6e29('0x16')](_0x4578af);return _0x8b4423[_0x6e29('0x1b')](_0x6e29('0x1c'),_0x3519ed+'-'+_0x2fd515+'/'+_0x38a872)[_0x6e29('0x1d')](_0x315270);}return null;};}function patchUpdates(_0x4804fb){return function(_0x35e237){try{jsonpatch[_0x6e29('0x1e')](_0x35e237,_0x4804fb,!![]);}catch(_0x9892ed){return BPromise[_0x6e29('0x1f')](_0x9892ed);}return _0x35e237[_0x6e29('0x20')]();};}function saveUpdates(_0x5f222a,_0x3da8e2){return function(_0x54ad1f){if(_0x54ad1f){return _0x54ad1f['update'](_0x5f222a)[_0x6e29('0x21')](function(_0x1f0e04){return _0x1f0e04;});}return null;};}function removeEntity(_0x2fb417,_0xda9ec5){return function(_0xf128f9){if(_0xf128f9){return _0xf128f9[_0x6e29('0x22')]()['then'](function(){_0x2fb417[_0x6e29('0x16')](0xcc)[_0x6e29('0x17')]();});}};}function handleEntityNotFound(_0x11d50c,_0x9512d2){return function(_0x2b52a8){if(!_0x2b52a8){_0x11d50c[_0x6e29('0x23')](0x194);}return _0x2b52a8;};}function handleError(_0x800381,_0x5900bd){_0x5900bd=_0x5900bd||0x1f4;return function(_0x4961a1){logger['error'](_0x4961a1[_0x6e29('0x24')]);if(_0x4961a1[_0x6e29('0x25')]){delete _0x4961a1['name'];}_0x800381['status'](_0x5900bd)[_0x6e29('0x26')](_0x4961a1);};}exports['index']=function(_0x278cc2,_0x1ad467){var _0x2c2af6={},_0x5b0ce5={},_0x11b648={'count':0x0,'rows':[]};var _0x57e1a=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x266916){return{'name':_0x266916[_0x6e29('0x27')],'type':_0x266916[_0x6e29('0x28')]['key']};});_0x5b0ce5[_0x6e29('0x29')]=_['map'](_0x57e1a,_0x6e29('0x25'));_0x5b0ce5[_0x6e29('0x2a')]=_[_0x6e29('0x2b')](_0x278cc2['query']);_0x5b0ce5[_0x6e29('0x2c')]=_[_0x6e29('0x2d')](_0x5b0ce5[_0x6e29('0x29')],_0x5b0ce5[_0x6e29('0x2a')]);_0x2c2af6[_0x6e29('0x2e')]=_[_0x6e29('0x2d')](_0x5b0ce5[_0x6e29('0x29')],qs['fields'](_0x278cc2[_0x6e29('0x2a')]['fields']));_0x2c2af6['attributes']=_0x2c2af6['attributes']['length']?_0x2c2af6[_0x6e29('0x2e')]:_0x5b0ce5['model'];if(!_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x2f')](_0x6e29('0x30'))){_0x2c2af6[_0x6e29('0x31')]=qs['limit'](_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x31')]);_0x2c2af6[_0x6e29('0x18')]=qs[_0x6e29('0x18')](_0x278cc2['query'][_0x6e29('0x18')]);}_0x2c2af6[_0x6e29('0x32')]=qs['sort'](_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x33')]);_0x2c2af6[_0x6e29('0x34')]=qs['filters'](_[_0x6e29('0x35')](_0x278cc2[_0x6e29('0x2a')],_0x5b0ce5[_0x6e29('0x2c')]),_0x57e1a);if(_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x36')]){_0x2c2af6[_0x6e29('0x34')]=_[_0x6e29('0x37')](_0x2c2af6[_0x6e29('0x34')],{'$or':_['map'](_0x57e1a,function(_0x1352fb){if(_0x1352fb[_0x6e29('0x28')]!==_0x6e29('0x38')){var _0x5cdec7={};_0x5cdec7[_0x1352fb[_0x6e29('0x25')]]={'$like':'%'+_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x36')]+'%'};return _0x5cdec7;}})});}_0x2c2af6=_['merge']({},_0x2c2af6,_0x278cc2['options']);var _0x2070bb={'where':_0x2c2af6[_0x6e29('0x34')]};return db['WhatsappTransferReport'][_0x6e29('0x1a')](_0x2070bb)[_0x6e29('0x21')](function(_0x5bf50c){_0x11b648[_0x6e29('0x1a')]=_0x5bf50c;if(_0x278cc2[_0x6e29('0x2a')][_0x6e29('0x39')]){_0x2c2af6[_0x6e29('0x3a')]=[{'all':!![]}];}return db[_0x6e29('0x3b')][_0x6e29('0x3c')](_0x2c2af6);})['then'](function(_0xf2fab0){_0x11b648[_0x6e29('0x3d')]=_0xf2fab0;return _0x11b648;})[_0x6e29('0x21')](respondWithFilteredResult(_0x1ad467,_0x2c2af6))['catch'](handleError(_0x1ad467,null));};exports[_0x6e29('0x3e')]=function(_0x373171,_0x2ba2e2){var _0x7ac36b={'raw':!![],'where':{'id':_0x373171[_0x6e29('0x3f')]['id']}},_0x2111d0={};_0x2111d0[_0x6e29('0x29')]=_[_0x6e29('0x2b')](db[_0x6e29('0x3b')][_0x6e29('0x40')]);_0x2111d0[_0x6e29('0x2a')]=_[_0x6e29('0x2b')](_0x373171[_0x6e29('0x2a')]);_0x2111d0[_0x6e29('0x2c')]=_['intersection'](_0x2111d0['model'],_0x2111d0['query']);_0x7ac36b[_0x6e29('0x2e')]=_[_0x6e29('0x2d')](_0x2111d0['model'],qs[_0x6e29('0x41')](_0x373171[_0x6e29('0x2a')]['fields']));_0x7ac36b[_0x6e29('0x2e')]=_0x7ac36b[_0x6e29('0x2e')][_0x6e29('0x42')]?_0x7ac36b[_0x6e29('0x2e')]:_0x2111d0[_0x6e29('0x29')];if(_0x373171[_0x6e29('0x2a')]['includeAll']){_0x7ac36b[_0x6e29('0x3a')]=[{'all':!![]}];}_0x7ac36b=_['merge']({},_0x7ac36b,_0x373171['options']);return db[_0x6e29('0x3b')][_0x6e29('0x43')](_0x7ac36b)['then'](handleEntityNotFound(_0x2ba2e2,null))[_0x6e29('0x21')](respondWithResult(_0x2ba2e2,null))[_0x6e29('0x44')](handleError(_0x2ba2e2,null));};exports[_0x6e29('0x45')]=function(_0x4b90f9,_0x36d931){return db[_0x6e29('0x3b')][_0x6e29('0x45')](_0x4b90f9[_0x6e29('0x46')],{})[_0x6e29('0x21')](respondWithResult(_0x36d931,0xc9))[_0x6e29('0x44')](handleError(_0x36d931,null));};exports[_0x6e29('0x47')]=function(_0x5d560a,_0x25a0b7){if(_0x5d560a[_0x6e29('0x46')]['id']){delete _0x5d560a['body']['id'];}return db['WhatsappTransferReport'][_0x6e29('0x43')]({'where':{'id':_0x5d560a['params']['id']}})[_0x6e29('0x21')](handleEntityNotFound(_0x25a0b7,null))['then'](saveUpdates(_0x5d560a[_0x6e29('0x46')],null))[_0x6e29('0x21')](respondWithResult(_0x25a0b7,null))[_0x6e29('0x44')](handleError(_0x25a0b7,null));};exports[_0x6e29('0x22')]=function(_0x435772,_0x5f2f2f){return db[_0x6e29('0x3b')][_0x6e29('0x43')]({'where':{'id':_0x435772[_0x6e29('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5f2f2f,null))[_0x6e29('0x21')](removeEntity(_0x5f2f2f,null))['catch'](handleError(_0x5f2f2f,null));};exports[_0x6e29('0x48')]=function(_0x1a9d55,_0x556166){return db[_0x6e29('0x3b')][_0x6e29('0x48')]()['then'](respondWithResult(_0x556166,null))['catch'](handleError(_0x556166,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 23a644d..04161d5 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 _0x99d3=['./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x99d3,0x191));var _0x399d=function(_0x41c7d0,_0x152317){_0x41c7d0=_0x41c7d0-0x0;var _0xcb8495=_0x99d3[_0x41c7d0];return _0xcb8495;};'use strict';var _=require(_0x399d('0x0'));var util=require('util');var logger=require(_0x399d('0x1'))(_0x399d('0x2'));var moment=require('moment');var BPromise=require(_0x399d('0x3'));var rp=require(_0x399d('0x4'));var fs=require('fs');var path=require(_0x399d('0x5'));var rimraf=require('rimraf');var config=require(_0x399d('0x6'));var attributes=require(_0x399d('0x7'));module[_0x399d('0x8')]=function(_0x390aa2,_0x60cd57){return _0x390aa2[_0x399d('0x9')](_0x399d('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x399d('0xb'),'fields':[_0x399d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07c7=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports'];(function(_0x3785cc,_0x598961){var _0x5d8c25=function(_0xfa21a7){while(--_0xfa21a7){_0x3785cc['push'](_0x3785cc['shift']());}};_0x5d8c25(++_0x598961);}(_0x07c7,0x1f0));var _0x707c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x07c7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x707c('0x0'));var util=require(_0x707c('0x1'));var logger=require(_0x707c('0x2'))('api');var moment=require(_0x707c('0x3'));var BPromise=require('bluebird');var rp=require(_0x707c('0x4'));var fs=require('fs');var path=require(_0x707c('0x5'));var rimraf=require(_0x707c('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x707c('0x7')]=function(_0x3ab2ae,_0x4e4d3c){return _0x3ab2ae[_0x707c('0x8')](_0x707c('0x9'),attributes,{'tableName':_0x707c('0xa'),'paranoid':![],'indexes':[{'name':_0x707c('0xb'),'fields':[_0x707c('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 8414230..d6c903d 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 _0xb6df=['error','code','message','result','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c4373,_0x161b54){var _0x24ff1a=function(_0x3903e1){while(--_0x3903e1){_0x1c4373['push'](_0x1c4373['shift']());}};_0x24ff1a(++_0x161b54);}(_0xb6df,0x134));var _0xfb6d=function(_0x25fe85,_0x21e737){_0x25fe85=_0x25fe85-0x0;var _0x44205c=_0xb6df[_0x25fe85];return _0x44205c;};'use strict';var _=require(_0xfb6d('0x0'));var util=require(_0xfb6d('0x1'));var moment=require(_0xfb6d('0x2'));var BPromise=require(_0xfb6d('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(_0xfb6d('0x4'))(_0xfb6d('0x5'));var config=require(_0xfb6d('0x6'));var jayson=require(_0xfb6d('0x7'));var client=jayson['client'][_0xfb6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11f0a5,_0x54600a,_0x26ba1d){return new BPromise(function(_0x52cc6a,_0x12830e){return client[_0xfb6d('0x9')](_0x11f0a5,_0x26ba1d)['then'](function(_0x4fac58){logger[_0xfb6d('0xa')](_0xfb6d('0xb'),_0x54600a,_0xfb6d('0xc'));logger[_0xfb6d('0xd')](_0xfb6d('0xe'),_0x54600a,_0xfb6d('0xc'),JSON['stringify'](_0x4fac58));if(_0x4fac58['error']){if(_0x4fac58[_0xfb6d('0xf')][_0xfb6d('0x10')]===0x1f4){logger[_0xfb6d('0xf')](_0xfb6d('0xb'),_0x54600a,_0x4fac58[_0xfb6d('0xf')][_0xfb6d('0x11')]);return _0x12830e(_0x4fac58[_0xfb6d('0xf')][_0xfb6d('0x11')]);}logger[_0xfb6d('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x54600a,_0x4fac58[_0xfb6d('0xf')][_0xfb6d('0x11')]);return _0x52cc6a(_0x4fac58[_0xfb6d('0xf')][_0xfb6d('0x11')]);}else{logger[_0xfb6d('0xa')](_0xfb6d('0xb'),_0x54600a,_0xfb6d('0xc'));_0x52cc6a(_0x4fac58[_0xfb6d('0x12')][_0xfb6d('0x11')]);}})['catch'](function(_0x3d7f48){logger[_0xfb6d('0xf')](_0xfb6d('0xb'),_0x54600a,_0x3d7f48);_0x12830e(_0x3d7f48);});});} \ No newline at end of file +var _0xd287=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd287,0x79));var _0x7d28=function(_0x365507,_0x3d4839){_0x365507=_0x365507-0x0;var _0x50805b=_0xd287[_0x365507];return _0x50805b;};'use strict';var _=require(_0x7d28('0x0'));var util=require(_0x7d28('0x1'));var moment=require(_0x7d28('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d28('0x4'))['db'];var utils=require(_0x7d28('0x5'));var logger=require(_0x7d28('0x6'))(_0x7d28('0x7'));var config=require(_0x7d28('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d28('0x9')][_0x7d28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x289b4b,_0x45e497,_0x473f80){return new BPromise(function(_0x2630e7,_0x432cb4){return client[_0x7d28('0xb')](_0x289b4b,_0x473f80)['then'](function(_0x18248f){logger[_0x7d28('0xc')](_0x7d28('0xd'),_0x45e497,_0x7d28('0xe'));logger[_0x7d28('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x45e497,_0x7d28('0xe'),JSON[_0x7d28('0x10')](_0x18248f));if(_0x18248f[_0x7d28('0x11')]){if(_0x18248f[_0x7d28('0x11')]['code']===0x1f4){logger[_0x7d28('0x11')](_0x7d28('0xd'),_0x45e497,_0x18248f[_0x7d28('0x11')]['message']);return _0x432cb4(_0x18248f[_0x7d28('0x11')][_0x7d28('0x12')]);}logger[_0x7d28('0x11')](_0x7d28('0xd'),_0x45e497,_0x18248f[_0x7d28('0x11')][_0x7d28('0x12')]);return _0x2630e7(_0x18248f[_0x7d28('0x11')][_0x7d28('0x12')]);}else{logger[_0x7d28('0xc')](_0x7d28('0xd'),_0x45e497,_0x7d28('0xe'));_0x2630e7(_0x18248f[_0x7d28('0x13')][_0x7d28('0x12')]);}})[_0x7d28('0x14')](function(_0x3ebb80){logger[_0x7d28('0x11')](_0x7d28('0xd'),_0x45e497,_0x3ebb80);_0x432cb4(_0x3ebb80);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index bd67772..f23da6a 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['start','filter','exitCode','number','length','map','name','Online\x20apps:','online','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','info'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0xeec6[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require(_0x6eec('0x0'));var db=require(_0x6eec('0x1'))['db'];var seedDb=require(_0x6eec('0x2'));var checkLicense=require(_0x6eec('0x3'));var rpc=require('./rpc');var config=require(_0x6eec('0x4'));var logger=require(_0x6eec('0x5'))(_0x6eec('0x6'));var pm2=require(_0x6eec('0x7'));var pm2Config=require(_0x6eec('0x8'));var schedule=require(_0x6eec('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x6eec('0xa'));var transcribe=require(_0x6eec('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x6eec('0xc')][_0x6eec('0xd')]()[_0x6eec('0xe')](function(){if(config[_0x6eec('0xf')]){return seedDb['default']();}})[_0x6eec('0xe')](function(){return checkLicense[_0x6eec('0x10')]();})[_0x6eec('0xe')](function(){return rpc['listen']();})['then'](function(_0x5e8aba){logger[_0x6eec('0x11')](_0x5e8aba);return chat[_0x6eec('0x12')]();})['then'](function(){return whatsapp['start']();})[_0x6eec('0xe')](function(){return schedule['start']();})[_0x6eec('0xe')](function(){return transcribe[_0x6eec('0x12')]();})[_0x6eec('0xe')](function(){return provider[_0x6eec('0x12')]();})[_0x6eec('0xe')](function(_0x49fccb){logger[_0x6eec('0x11')](_0x49fccb);return pm2[_0x6eec('0x12')](pm2Config);})[_0x6eec('0xe')](function(_0xc35914){var _0x3d653b=_0xc35914[_0x6eec('0x13')](function(_0x345852){return typeof _0x345852[_0x6eec('0x14')]===_0x6eec('0x15')&&_0x345852[_0x6eec('0x14')]>=0x0;});if(_0x3d653b['length']>0x0){throw new Error(_0x3d653b[_0x6eec('0x16')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x6eec('0x17')](_0x3d653b,function(_0x45aa3f){return'\x22'+_0x45aa3f['pm2_env'][_0x6eec('0x18')]+'\x22';}));}logger[_0x6eec('0x11')](_0x6eec('0x19'),_['map'](_[_0x6eec('0x13')](_0xc35914,{'status':_0x6eec('0x1a')}),_0x6eec('0x18'))[_0x6eec('0x1b')]());logger[_0x6eec('0x11')](_0x6eec('0x1c'),_['map'](_[_0x6eec('0x13')](_0xc35914,function(_0x2f843e){return _0x2f843e[_0x6eec('0x1d')]!==_0x6eec('0x1a');}),_0x6eec('0x18'))[_0x6eec('0x1b')]()||'None');console[_0x6eec('0x1e')](_0x6eec('0x1f'));})[_0x6eec('0x20')](function(_0x27785a){console[_0x6eec('0x1e')](_0x6eec('0x21'),_0x27785a);logger['error'](_0x6eec('0x22'),_0x27785a);process[_0x6eec('0x23')](0x1);});}main(); \ No newline at end of file +var _0x1629=['Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','info','start','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch'];(function(_0x34a97d,_0x1e6e8c){var _0x2466d9=function(_0xb4fede){while(--_0xb4fede){_0x34a97d['push'](_0x34a97d['shift']());}};_0x2466d9(++_0x1e6e8c);}(_0x1629,0x1d8));var _0x9162=function(_0xa320c,_0x17f1d6){_0xa320c=_0xa320c-0x0;var _0x2adc7b=_0x1629[_0xa320c];return _0x2adc7b;};'use strict';var _=require(_0x9162('0x0'));var db=require(_0x9162('0x1'))['db'];var seedDb=require(_0x9162('0x2'));var checkLicense=require(_0x9162('0x3'));var rpc=require('./rpc');var config=require(_0x9162('0x4'));var logger=require('./config/logger')('app');var pm2=require(_0x9162('0x5'));var pm2Config=require(_0x9162('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x9162('0x7'));var transcribe=require(_0x9162('0x8'));var provider=require(_0x9162('0x9'));function main(){return db[_0x9162('0xa')][_0x9162('0xb')]()[_0x9162('0xc')](function(){if(config['seedDB']){return seedDb['default']();}})['then'](function(){return checkLicense[_0x9162('0xd')]();})[_0x9162('0xc')](function(){return rpc[_0x9162('0xe')]();})[_0x9162('0xc')](function(_0x55a3a6){logger[_0x9162('0xf')](_0x55a3a6);return chat[_0x9162('0x10')]();})['then'](function(){return whatsapp[_0x9162('0x10')]();})[_0x9162('0xc')](function(){return schedule['start']();})[_0x9162('0xc')](function(){return transcribe[_0x9162('0x10')]();})[_0x9162('0xc')](function(){return provider[_0x9162('0x10')]();})[_0x9162('0xc')](function(_0x1f7d5b){logger[_0x9162('0xf')](_0x1f7d5b);return pm2[_0x9162('0x10')](pm2Config);})[_0x9162('0xc')](function(_0x4522a2){var _0x22ed5b=_0x4522a2['filter'](function(_0x1bc9aa){return typeof _0x1bc9aa[_0x9162('0x11')]==='number'&&_0x1bc9aa[_0x9162('0x11')]>=0x0;});if(_0x22ed5b[_0x9162('0x12')]>0x0){throw new Error(_0x22ed5b[_0x9162('0x12')]+_0x9162('0x13')+_[_0x9162('0x14')](_0x22ed5b,function(_0xa259c2){return'\x22'+_0xa259c2[_0x9162('0x15')][_0x9162('0x16')]+'\x22';}));}logger[_0x9162('0xf')](_0x9162('0x17'),_['map'](_['filter'](_0x4522a2,{'status':_0x9162('0x18')}),_0x9162('0x16'))[_0x9162('0x19')]());logger['info'](_0x9162('0x1a'),_['map'](_['filter'](_0x4522a2,function(_0x461c97){return _0x461c97[_0x9162('0x1b')]!==_0x9162('0x18');}),_0x9162('0x16'))[_0x9162('0x19')]()||_0x9162('0x1c'));console[_0x9162('0x1d')](_0x9162('0x1e'));})[_0x9162('0x1f')](function(_0x2685fd){console[_0x9162('0x1d')](_0x9162('0x20'),_0x2685fd);logger[_0x9162('0x21')](_0x9162('0x22'),_0x2685fd);process[_0x9162('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 0fe8332..bc278b4 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 _0x6aa7=['smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','User','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','HS512','toString','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','util','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x5ea34a,_0x37381c){_0x5ea34a=_0x5ea34a-0x0;var _0x229b0d=_0x6aa7[_0x5ea34a];return _0x229b0d;};'use strict';var db=require(_0x76aa('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x76aa('0x1'));var licenseUtil=require(_0x76aa('0x2'));var encryptor=require(_0x76aa('0x3'));var _=require(_0x76aa('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x76aa('0x5'));var compose=require(_0x76aa('0x6'));var basicAuth=require(_0x76aa('0x7'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x76aa('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x76aa('0x9')][_0x76aa('0xa')]});var userAttributes=['id',_0x76aa('0xb'),'fullname',_0x76aa('0xc'),_0x76aa('0xd'),_0x76aa('0xe'),'userpic',_0x76aa('0xf'),_0x76aa('0x10'),_0x76aa('0x11'),_0x76aa('0x12'),_0x76aa('0x13'),_0x76aa('0x14'),_0x76aa('0x15'),_0x76aa('0x16'),_0x76aa('0x17'),_0x76aa('0x18'),'lastLoginAt',_0x76aa('0x19'),'crudPermissions',_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d'),_0x76aa('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0x76aa('0x1f'),'phoneBarEnableSettings',_0x76aa('0x20'),_0x76aa('0x21'),'phoneBarRemoteControl',_0x76aa('0x22'),'hotdesk',_0x76aa('0x23'),'userProfileId',_0x76aa('0x24'),_0x76aa('0x25'),_0x76aa('0x26'),_0x76aa('0x27'),_0x76aa('0x28'),_0x76aa('0x29'),'ignorePauseForPreviewCalls','selectRecallMeCampaign',_0x76aa('0x2a'),_0x76aa('0x2b'),_0x76aa('0x2c'),_0x76aa('0x2d'),_0x76aa('0x2e'),_0x76aa('0x2f'),_0x76aa('0x30'),_0x76aa('0x31'),_0x76aa('0x32'),'faxAutoanswerDelay',_0x76aa('0x33'),_0x76aa('0x34')];exports[_0x76aa('0x35')]=function(){return this['isAuthenticated'](!![])[_0x76aa('0x36')](function(_0x189cb6,_0x31252f,_0x2bd2c6){if(_0x189cb6[_0x76aa('0x37')]){_0x2bd2c6();}else{return db[_0x76aa('0x38')][_0x76aa('0x39')]({'where':{'id':_0x189cb6[_0x76aa('0x3a')]['id']},'attributes':['id',_0x76aa('0x3b'),_0x76aa('0x3c')],'raw':!![]})[_0x76aa('0x3d')](function(_0x26b75e){if(_0x26b75e&&_0x26b75e[_0x76aa('0x3b')]){return _0x31252f['status'](_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?0x195:0x193)[_0x76aa('0x3f')]({'message':_0x26b75e[_0x76aa('0x3c')]===_0x76aa('0x3e')?_0x76aa('0x40'):_0x76aa('0x41')});}else{_0x2bd2c6();}})[_0x76aa('0x42')](function(_0xd12a99){_0x2bd2c6(_0xd12a99);});}});};exports[_0x76aa('0x43')]=function isAuthenticated(_0x545b06){return compose()[_0x76aa('0x36')](function(_0x5a8030,_0x994550,_0x365ff8){var _0x2dec94;if(_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')]){if(_[_0x76aa('0x46')](_0x5a8030[_0x76aa('0x44')][_0x76aa('0x45')],_0x76aa('0x47'))){var _0x3ea05a=basicAuth(_0x5a8030);db['User'][_0x76aa('0x48')]({'where':{'name':_0x3ea05a[_0x76aa('0xc')]}})[_0x76aa('0x3d')](function(_0x928ccf){if(!_0x928ccf||!_0x928ccf[_0x76aa('0x49')](_0x3ea05a[_0x76aa('0x4a')])){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x4c')});}_0x5a8030[_0x76aa('0x37')]={'id':_0x928ccf['id']};_0x365ff8();})['catch'](function(_0x2ee338){_0x365ff8(_0x2ee338);});}else if(_['startsWith'](_0x5a8030[_0x76aa('0x44')]['authorization'],_0x76aa('0x4d'))){validateJwt(_0x5a8030,_0x994550,_0x365ff8);}else{if(_0x545b06){_0x365ff8();}else{return _0x994550['status'](0x193)['json']({'message':_0x76aa('0x4e')});}}}else if(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')]){try{var _0x37dfab={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5a8030[_0x76aa('0x4f')][_0x76aa('0x50')],_0x37dfab)[_0x76aa('0x3d')](function(_0x23e2fd){return db[_0x76aa('0x51')]['find']({'where':{'id':_0x23e2fd[_0x76aa('0x52')]}})['then'](function(_0x5086f5){_0x2dec94=_0x5086f5;return db[_0x76aa('0x53')][_0x76aa('0x39')]({'where':{'id':0x1},'attributes':[_0x76aa('0x54'),_0x76aa('0x55')],'raw':!![]});})['then'](function(_0x401c07){if(!_0x2dec94||!_[_0x76aa('0x56')](_0x2dec94[_0x76aa('0x57')],_0x23e2fd['nonce'])){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x58')});}if(_0x2dec94[_0x76aa('0x59')]){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}if(_0x2dec94[_0x76aa('0x5b')]){if(_0x401c07[_0x76aa('0x55')]>0x0){if(moment(_0x2dec94['blockedAt'])[_0x76aa('0x5c')](_0x401c07[_0x76aa('0x55')],_0x76aa('0x5d'))>moment()){return _0x994550[_0x76aa('0x4b')](0x191)[_0x76aa('0x3f')]({'message':_0x76aa('0x5a')});}}else{return _0x994550['status'](0x191)['json']({'message':_0x76aa('0x5a')});}}_0x5a8030[_0x76aa('0x37')]={'id':_0x2dec94['id']};_0x365ff8();});})[_0x76aa('0x42')](function(){return _0x994550[_0x76aa('0x4b')](0x191)['json']({'message':_0x76aa('0x5a')});});}catch(_0x403084){_0x365ff8(_0x403084);}}else if(_0x545b06){_0x365ff8();}else{return _0x994550[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x4e')});}})['use'](function(_0x13dafe,_0x556f59,_0xbb3136){if(_0x13dafe['user']){db['User']['find']({'where':{'id':_0x13dafe[_0x76aa('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5cf314){if(!_0x5cf314){return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5e')});}_0x13dafe[_0x76aa('0x37')]=_0x5cf314;_0xbb3136();})[_0x76aa('0x42')](function(_0x27a52e){_0xbb3136(_0x27a52e);});}else if(_0x545b06){_0xbb3136();}else{return _0x556f59['status'](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x5f')});}});};exports[_0x76aa('0x60')]=function canUpdate(){return compose()[_0x76aa('0x36')](function(_0x3800a4,_0x47a308,_0x2f695c){return licenseUtil[_0x76aa('0x61')]()['then'](function(_0x2d3441){if(_0x2d3441['update']){_0x2f695c();}else{return _0x47a308[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})[_0x76aa('0x42')](function(_0x2d0bc4){_0x2f695c(_0x2d0bc4);});});};exports[_0x76aa('0x63')]=function isWebrtcLicence(){return compose()[_0x76aa('0x36')](function(_0x165858,_0xb8d052,_0x3946bd){return licenseUtil['getLicense']()[_0x76aa('0x3d')](function(_0x4b8f12){if(_0x4b8f12[_0x76aa('0x64')]){_0x3946bd();}else{return _0xb8d052[_0x76aa('0x4b')](0x193)[_0x76aa('0x3f')]({'message':_0x76aa('0x62')});}})['catch'](function(_0x5a3d9c){_0x3946bd(_0x5a3d9c);});});};exports[_0x76aa('0x65')]=function(_0x54b673,_0x8660a4,_0x302a0c){_0x54b673[_0x76aa('0x65')]=!![];return _0x302a0c();};exports[_0x76aa('0x66')]=function signToken(_0x30c577){return signJwt(_0x30c577);};exports[_0x76aa('0x67')]=function(_0x5b567b,_0x564546){if(!_0x5b567b[_0x76aa('0x37')]){return _0x564546[_0x76aa('0x4b')](0x194)[_0x76aa('0x3f')]({'message':_0x76aa('0x68')});}var _0x18c679={'payload':{'id':_0x5b567b[_0x76aa('0x37')]['id'],'role':_0x5b567b['user'][_0x76aa('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x18c679)[_0x76aa('0x3d')](function(_0x26db69){_0x564546['cookie'](_0x76aa('0x69'),_0x26db69);_0x564546['redirect'](_0x76aa('0x6a'));})['catch'](function(_0x339b0d){return _0x564546[_0x76aa('0x4b')](0x1f4)[_0x76aa('0x6b')](_0x339b0d);});};exports[_0x76aa('0x6c')]=function(_0x37a4d9){if(_[_0x76aa('0x6d')](_0x37a4d9[_0x76aa('0x57')])||_['isNil'](_0x37a4d9[_0x76aa('0x6e')])){return null;}else{return createJwt(_0x37a4d9);}};exports['generateApiKey']=function(_0x3ee32){_0x3ee32[_0x76aa('0x57')]=generateNonce();_0x3ee32[_0x76aa('0x6e')]=generateIssuedAt();return createJwt(_0x3ee32);};exports[_0x76aa('0x6f')]=function(_0x3fa7ec,_0x28f8aa){var _0x336024=_0x3fa7ec['query'][_0x76aa('0x50')];if(_0x336024){var _0x281f73={'nonce':_0x28f8aa[_0x76aa('0x57')],'iat':_0x28f8aa[_0x76aa('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x76aa('0x70')]()};return verifyJwt(_0x336024,_0x281f73)[_0x76aa('0x3d')](function(){return generateApiKey(_0x28f8aa);});}else{throw{'message':_0x76aa('0x71')};}};exports[_0x76aa('0x72')]=function(_0x2027f8){var _0xf7732=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf7732['test'](_0x2027f8))throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x76aa('0x75'));return;};exports[_0x76aa('0x76')]=function(_0x3967f3,_0x2fdc4f,_0x37babe){var _0x51893b=encryptor['decryptString'](_0x2fdc4f)[_0x76aa('0x77')](',');for(var _0x3b0d8a=0x0;_0x3b0d8a<_0x37babe;_0x3b0d8a++){if(!_0x51893b[_0x3b0d8a])break;if(_0x3967f3['toLowerCase']()===_0x51893b[_0x3b0d8a][_0x76aa('0x78')]()){var _0x1e6f3c=util['format'](_0x76aa('0x79'),_0x37babe);if(_0x37babe===0x1){_0x1e6f3c=_0x76aa('0x7a');}throw new db[(_0x76aa('0x73'))][(_0x76aa('0x74'))](_0x1e6f3c);}}return;};exports[_0x76aa('0x7b')]=function(_0x1f5010,_0x3376ec){var _0x30573a=_0x3376ec?encryptor[_0x76aa('0x7c')](_0x3376ec)['split'](','):[];if(_0x30573a[_0x76aa('0x7d')]===0x5){_0x30573a['splice'](-0x1,0x1);}_0x30573a[_0x76aa('0x7e')](_0x1f5010);return encryptor[_0x76aa('0x7f')](_0x30573a[_0x76aa('0x80')](','));};function signJwt(_0x16cc85){var _0x343cf1=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x82')],{'context':jwt});var _0x431d1c=_0x16cc85[_0x76aa('0x83')]||config['secrets'][_0x76aa('0xa')];return new BPromise(function(_0x3d4025,_0x5c542b){_0x343cf1(_0x16cc85[_0x76aa('0x84')],_0x431d1c,_0x16cc85[_0x76aa('0x85')])[_0x76aa('0x3d')](function(_0x3d6d10){_0x3d4025(_0x3d6d10);})[_0x76aa('0x42')](function(_0x5546b6){_0x5c542b(_0x5546b6);});});}function verifyJwt(_0x364d05,_0x4d3ad0,_0x35bd2b){var _0x35881c=BPromise[_0x76aa('0x81')](jwt[_0x76aa('0x86')],{'context':jwt});var _0x3a82fe=_0x35bd2b||config[_0x76aa('0x9')][_0x76aa('0xa')];return new BPromise(function(_0x4a37f1,_0x9ea0af){_0x35881c(_0x364d05,_0x3a82fe,_0x4d3ad0)[_0x76aa('0x3d')](function(_0x543c1d){_0x4a37f1(_0x543c1d);})['catch'](function(_0x40429c){_0x9ea0af(_0x40429c);});});}function generateNonce(){return crypto[_0x76aa('0x87')](0x10)['toString'](_0x76aa('0x88'));}function generateIssuedAt(){return Math[_0x76aa('0x89')](Date[_0x76aa('0x8a')]()/0x3e8)['toString']();}function createJwt(_0x446073){var _0x47f733={'payload':{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')]},'options':{'algorithm':_0x76aa('0x8b'),'subject':_0x446073['id'][_0x76aa('0x8c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x47f733)[_0x76aa('0x3d')](function(_0x4dfeb3){return{'iat':_0x446073[_0x76aa('0x6e')],'nonce':_0x446073[_0x76aa('0x57')],'token':_0x4dfeb3};});} \ No newline at end of file +var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x5393ae,_0x4b1665){var _0x212a52=function(_0x5c8b29){while(--_0x5c8b29){_0x5393ae['push'](_0x5393ae['shift']());}};_0x212a52(++_0x4b1665);}(_0xa41a,0x6b));var _0xaa41=function(_0x50782d,_0x46927c){_0x50782d=_0x50782d-0x0;var _0x4e5468=_0xa41a[_0x50782d];return _0x4e5468;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 3d5359f..2d6eaee 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 _0x2414=['base64','crypto','../../config/environment','../../config/logger','secrets','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createReadStream','createDecipher','encryptString','secret','utf8'];(function(_0x3cab9a,_0x824cad){var _0x3007be=function(_0x4bf418){while(--_0x4bf418){_0x3cab9a['push'](_0x3cab9a['shift']());}};_0x3007be(++_0x824cad);}(_0x2414,0xb5));var _0x4241=function(_0x3ede7e,_0xba4cd2){_0x3ede7e=_0x3ede7e-0x0;var _0x644681=_0x2414[_0x3ede7e];return _0x644681;};'use strict';var crypto=require(_0x4241('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x4241('0x1'));var logger=require(_0x4241('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4241('0x3')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x4241('0x4')};if(config['encrypt']&&config[_0x4241('0x5')][_0x4241('0x6')]){var isSupported=isAlgorithmSupported(config[_0x4241('0x5')][_0x4241('0x6')]);if(isSupported){fileOptions[_0x4241('0x6')]=config[_0x4241('0x5')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x4241('0x7')](config['encrypt'][_0x4241('0x6')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x371097){return AES_SUPPORTED_RX[_0x4241('0x8')](_0x371097);}function getSupportedCiphers(){return crypto[_0x4241('0x9')]()[_0x4241('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x29552b){return getSupportedCiphers()[_0x4241('0xb')](_0x29552b)>-0x1;}function combineOptions(_0x245ac7){var _0x12b914={};for(var _0x445b32 in fileOptions){if(fileOptions[_0x4241('0xc')](_0x445b32)){_0x12b914[_0x445b32]=fileOptions[_0x445b32];}}if(_0x245ac7){for(var _0xfbf9ad in _0x245ac7){if(_0x245ac7[_0x4241('0xc')](_0xfbf9ad)){_0x12b914[_0xfbf9ad]=_0x245ac7[_0xfbf9ad];}}}return _0x12b914;}exports[_0x4241('0xd')]=function(_0x461182,_0x1be91c,_0x5dca8c,_0x260042){return new BPromise(function(_0x4affad,_0x3a9e34){_0x260042=combineOptions(_0x260042);var _0x411425=new Buffer(_0x5dca8c);var _0x3941fc=fs['createReadStream'](_0x461182);var _0x1aa3dc=fs[_0x4241('0xe')](_0x1be91c);var _0x33cd73=crypto[_0x4241('0xf')](_0x260042['algorithm'],_0x411425);_0x3941fc['on'](_0x4241('0x10'),function(_0x45013a){var _0xc191eb=new Buffer(_0x33cd73[_0x4241('0x11')](_0x45013a),_0x4241('0x12'));_0x1aa3dc[_0x4241('0x13')](_0xc191eb);});_0x3941fc['on'](_0x4241('0x14'),function(){try{var _0x2ad323=new Buffer(_0x33cd73[_0x4241('0x15')](_0x4241('0x12')),'binary');_0x1aa3dc[_0x4241('0x13')](_0x2ad323);_0x1aa3dc[_0x4241('0x14')]();_0x1aa3dc['on'](_0x4241('0x16'),function(){return _0x4affad(_0x1be91c);});}catch(_0x302c94){fs[_0x4241('0x17')](_0x1be91c);return _0x3a9e34(_0x302c94);}});});};exports['decryptFile']=function(_0x4e54ec,_0x453ac6,_0x38b13b,_0x5ebde0){return new BPromise(function(_0x380912,_0x3cde49){_0x5ebde0=combineOptions(_0x5ebde0);var _0x54afe1=new Buffer(_0x38b13b);var _0x3e0ce9=fs[_0x4241('0x18')](_0x4e54ec);var _0x3437f4=fs[_0x4241('0xe')](_0x453ac6);var _0x56d22c=crypto[_0x4241('0x19')](_0x5ebde0[_0x4241('0x6')],_0x54afe1);_0x3e0ce9['on'](_0x4241('0x10'),function(_0x1a6078){var _0x2a6db6=new Buffer(_0x56d22c[_0x4241('0x11')](_0x1a6078),_0x4241('0x12'));_0x3437f4[_0x4241('0x13')](_0x2a6db6);});_0x3e0ce9['on'](_0x4241('0x14'),function(){try{var _0x44bf5e=new Buffer(_0x56d22c[_0x4241('0x15')](_0x4241('0x12')),_0x4241('0x12'));_0x3437f4['write'](_0x44bf5e);_0x3437f4[_0x4241('0x14')]();_0x3437f4['on'](_0x4241('0x16'),function(){return _0x380912(_0x453ac6);});}catch(_0x149790){fs[_0x4241('0x17')](_0x453ac6);return _0x3cde49(_0x149790);}});});};exports[_0x4241('0x1a')]=function(_0x3e647b,_0x336aba,_0x5bbaf9){var _0x366b6a=_0x5bbaf9||stringOptions['algorithm'];var _0x5a6eb9=_0x336aba||stringOptions[_0x4241('0x1b')];var _0xbb1a12=crypto[_0x4241('0xf')](_0x366b6a,_0x5a6eb9);var _0x165907=_0xbb1a12['update'](_0x3e647b,_0x4241('0x1c'),'base64');_0x165907+=_0xbb1a12[_0x4241('0x15')](_0x4241('0x1d'));return _0x165907;};exports['decryptString']=function(_0x2de34d,_0x4ab00e,_0x32feb6){var _0x55c900=_0x32feb6||stringOptions['algorithm'];var _0x3a081a=_0x4ab00e||stringOptions['secret'];var _0x117e92=crypto[_0x4241('0x19')](_0x55c900,_0x3a081a);var _0x4376e9=_0x117e92['update'](_0x2de34d,_0x4241('0x1d'),_0x4241('0x1c'));_0x4376e9+=_0x117e92[_0x4241('0x15')](_0x4241('0x1c'));return _0x4376e9;}; \ No newline at end of file +var _0x8f03=['data','update','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher'];(function(_0x44557b,_0x1ac43e){var _0x4452f5=function(_0x22f5aa){while(--_0x22f5aa){_0x44557b['push'](_0x44557b['shift']());}};_0x4452f5(++_0x1ac43e);}(_0x8f03,0xdc));var _0x38f0=function(_0x237aab,_0x523604){_0x237aab=_0x237aab-0x0;var _0x55b525=_0x8f03[_0x237aab];return _0x55b525;};'use strict';var crypto=require(_0x38f0('0x0'));var fs=require('fs');var BPromise=require(_0x38f0('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0x38f0('0x2'))(_0x38f0('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x38f0('0x4')]['session'],'algorithm':_0x38f0('0x5')};const fileOptions={'algorithm':_0x38f0('0x6')};if(config[_0x38f0('0x7')]&&config[_0x38f0('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x38f0('0x7')][_0x38f0('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x38f0('0x7')][_0x38f0('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x38f0('0x9')](',\x20');logger[_0x38f0('0xa')](config[_0x38f0('0x7')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x5e68c4){return AES_SUPPORTED_RX[_0x38f0('0xb')](_0x5e68c4);}function getSupportedCiphers(){return crypto[_0x38f0('0xc')]()[_0x38f0('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x16d6c9){return getSupportedCiphers()['indexOf'](_0x16d6c9)>-0x1;}function combineOptions(_0x5b7949){var _0x18816e={};for(var _0x259143 in fileOptions){if(fileOptions[_0x38f0('0xe')](_0x259143)){_0x18816e[_0x259143]=fileOptions[_0x259143];}}if(_0x5b7949){for(var _0x51cae1 in _0x5b7949){if(_0x5b7949['hasOwnProperty'](_0x51cae1)){_0x18816e[_0x51cae1]=_0x5b7949[_0x51cae1];}}}return _0x18816e;}exports[_0x38f0('0xf')]=function(_0x114790,_0x4a1ecf,_0x4b145c,_0x2ca944){return new BPromise(function(_0x2581bd,_0x1e89bd){_0x2ca944=combineOptions(_0x2ca944);var _0x8158bd=new Buffer(_0x4b145c);var _0xbcf9fe=fs['createReadStream'](_0x114790);var _0x48a0dc=fs[_0x38f0('0x10')](_0x4a1ecf);var _0x27dd02=crypto[_0x38f0('0x11')](_0x2ca944[_0x38f0('0x8')],_0x8158bd);_0xbcf9fe['on'](_0x38f0('0x12'),function(_0x5e1445){var _0x5561a9=new Buffer(_0x27dd02[_0x38f0('0x13')](_0x5e1445),_0x38f0('0x14'));_0x48a0dc['write'](_0x5561a9);});_0xbcf9fe['on'](_0x38f0('0x15'),function(){try{var _0x2cd572=new Buffer(_0x27dd02[_0x38f0('0x16')](_0x38f0('0x14')),_0x38f0('0x14'));_0x48a0dc[_0x38f0('0x17')](_0x2cd572);_0x48a0dc[_0x38f0('0x15')]();_0x48a0dc['on'](_0x38f0('0x18'),function(){return _0x2581bd(_0x4a1ecf);});}catch(_0x2e6d55){fs[_0x38f0('0x19')](_0x4a1ecf);return _0x1e89bd(_0x2e6d55);}});});};exports[_0x38f0('0x1a')]=function(_0x2ca0f1,_0x296874,_0x103e71,_0x469e20){return new BPromise(function(_0x388783,_0x201ddc){_0x469e20=combineOptions(_0x469e20);var _0x1d7663=new Buffer(_0x103e71);var _0x316fbd=fs[_0x38f0('0x1b')](_0x2ca0f1);var _0x502b6d=fs[_0x38f0('0x10')](_0x296874);var _0x4e3926=crypto[_0x38f0('0x1c')](_0x469e20[_0x38f0('0x8')],_0x1d7663);_0x316fbd['on'](_0x38f0('0x12'),function(_0x3cc900){var _0x5cfc25=new Buffer(_0x4e3926[_0x38f0('0x13')](_0x3cc900),_0x38f0('0x14'));_0x502b6d['write'](_0x5cfc25);});_0x316fbd['on'](_0x38f0('0x15'),function(){try{var _0x111e0d=new Buffer(_0x4e3926['final'](_0x38f0('0x14')),'binary');_0x502b6d[_0x38f0('0x17')](_0x111e0d);_0x502b6d['end']();_0x502b6d['on'](_0x38f0('0x18'),function(){return _0x388783(_0x296874);});}catch(_0x411212){fs[_0x38f0('0x19')](_0x296874);return _0x201ddc(_0x411212);}});});};exports[_0x38f0('0x1d')]=function(_0x3d09cc,_0x54bbf1,_0xb81089){var _0x1e400a=_0xb81089||stringOptions[_0x38f0('0x8')];var _0x15b928=_0x54bbf1||stringOptions[_0x38f0('0x1e')];var _0x147869=crypto[_0x38f0('0x11')](_0x1e400a,_0x15b928);var _0xb2ac2d=_0x147869[_0x38f0('0x13')](_0x3d09cc,_0x38f0('0x1f'),'base64');_0xb2ac2d+=_0x147869[_0x38f0('0x16')](_0x38f0('0x20'));return _0xb2ac2d;};exports[_0x38f0('0x21')]=function(_0x2487a6,_0x39f410,_0x15c0b){var _0x1e17e3=_0x15c0b||stringOptions[_0x38f0('0x8')];var _0x52a73c=_0x39f410||stringOptions[_0x38f0('0x1e')];var _0x3786c9=crypto[_0x38f0('0x1c')](_0x1e17e3,_0x52a73c);var _0x26a5ae=_0x3786c9[_0x38f0('0x13')](_0x2487a6,_0x38f0('0x20'),_0x38f0('0x1f'));_0x26a5ae+=_0x3786c9[_0x38f0('0x16')](_0x38f0('0x1f'));return _0x26a5ae;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 86584d0..7765029 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 _0x34e9=['path','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','argv','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','mkdirSync','each','%s%d.%s','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally'];(function(_0x28622f,_0x47bab5){var _0x205897=function(_0x5de9cc){while(--_0x5de9cc){_0x28622f['push'](_0x28622f['shift']());}};_0x205897(++_0x47bab5);}(_0x34e9,0xb0));var _0x934e=function(_0xcdf466,_0x49db65){_0xcdf466=_0xcdf466-0x0;var _0x5277da=_0x34e9[_0xcdf466];return _0x5277da;};'use strict';var util=require('util');var path=require(_0x934e('0x0'));var _=require('lodash');var csv=require(_0x934e('0x1'));var fs=require('fs');var BPromise=require(_0x934e('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x934e('0x3'))[_0x934e('0x4')];var logger=require(_0x934e('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x934e('0x6')][0x2]);var QUERY=process[_0x934e('0x6')][0x3];var PATH=process[_0x934e('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1d0e1d,_0x2e4a95){var _0x3c2067={'status':_0x1d0e1d};var _0x11571e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2e4a95){_0x3c2067['savename']=_0x2e4a95;}return db['AnalyticExtractedReport'][_0x934e('0x7')](_0x3c2067,_0x11571e);}function main(){var _0x54c719=0x1388;var _0x1542bc;logger['info'](util['format'](_0x934e('0x8'),EXTRACTED_REPORT_ID,_0x934e('0x9')));return db[_0x934e('0xa')][_0x934e('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x934e('0xc'),_0x934e('0xd')]})[_0x934e('0xe')](function(_0x13a9da){if(_0x13a9da){_0x1542bc=_0x13a9da;_0x54c719=_0x1542bc[_0x934e('0xd')]||0x1388;}})[_0x934e('0xe')](function(){return dbH[_0x934e('0xf')][_0x934e('0x10')](util['format'](_0x934e('0x11'),QUERY),{'type':dbH['sequelize'][_0x934e('0x12')][_0x934e('0x13')]});})[_0x934e('0xe')](function(_0x4442e3){if(!_0x4442e3[0x0][_0x934e('0x14')]){return analyticExtractedReport(_0x934e('0x15'));}var _0x1c92fa=[];var _0x37b137=0x0;if(_0x1542bc[_0x934e('0xc')]){if(_0x4442e3&&_0x4442e3[_0x934e('0x16')]){var _0x5526d5=_['range'](_0x4442e3[0x0]['num']/_0x54c719);var _0x226aa3=Number['isInteger'](_0x4442e3[0x0][_0x934e('0x14')]/_0x54c719)?_0x4442e3[0x0][_0x934e('0x14')]%_0x54c719:0x0;_0x5526d5['forEach'](function(_0x4cb88a){if(_0x4cb88a>0x0){_0x37b137+=_0x54c719;}_0x1c92fa[_0x934e('0x17')](dbH[_0x934e('0xf')][_0x934e('0x10')](util[_0x934e('0x18')](_0x934e('0x19'),QUERY,_0x54c719,_0x37b137),{'type':dbH[_0x934e('0xf')][_0x934e('0x12')][_0x934e('0x13')]}));});if(_0x226aa3>0x0){_0x37b137+=_0x54c719;_0x1c92fa[_0x934e('0x17')](dbH[_0x934e('0xf')][_0x934e('0x10')](util[_0x934e('0x18')](_0x934e('0x19'),QUERY,_0x226aa3,_0x37b137),{'type':dbH[_0x934e('0xf')][_0x934e('0x12')][_0x934e('0x13')]}));}}}else{_0x1c92fa[_0x934e('0x17')](dbH['sequelize'][_0x934e('0x10')](QUERY,{'type':dbH[_0x934e('0xf')][_0x934e('0x12')][_0x934e('0x13')]}));}var _0x584da6=path['dirname'](PATH);var _0x283c6e=path[_0x934e('0x1a')](PATH,_0x934e('0x1b'));var _0x3f8191=_0x1542bc[_0x934e('0xc')]&&_0x1c92fa['length']>0x1;var _0x1e506b=[];if(!fs['existsSync'](path[_0x934e('0x1c')](_0x584da6,_0x283c6e))&&_0x3f8191){fs[_0x934e('0x1d')](path[_0x934e('0x1c')](_0x584da6,_0x283c6e));}return BPromise[_0x934e('0x1e')](_0x1c92fa,function(_0x5e920c){_0x1e506b['push'](_0x5e920c);})['then'](function(){for(var _0x1db426=0x0;_0x1db426<_0x1e506b[_0x934e('0x16')];_0x1db426+=0x1){var _0x484086;var _0x47c564=_0x1e506b[_0x1db426];if(_0x3f8191){_0x484086=path['join'](_0x584da6,_0x283c6e,util[_0x934e('0x18')](_0x934e('0x1f'),_0x283c6e,_0x1db426,'csv'));}else{_0x484086=path[_0x934e('0x1c')](_0x584da6,util[_0x934e('0x18')]('%s.%s',_0x283c6e,'csv'));}fs[_0x934e('0x20')](_0x484086,csv(_0x47c564));}})[_0x934e('0xe')](function(){if(_0x3f8191){return new Promise(function(_0x4945d6){zipdir(path[_0x934e('0x1c')](_0x584da6,_0x283c6e),{'saveTo':path[_0x934e('0x1c')](_0x584da6,util[_0x934e('0x18')](_0x934e('0x21'),_0x283c6e,_0x934e('0x22')))},function(_0x539854,_0x2481a6){rimraf(path[_0x934e('0x1c')](_0x584da6,_0x283c6e),function(){});_0x4945d6(_0x934e('0x23'));});});}})[_0x934e('0xe')](function(){logger[_0x934e('0x24')](util[_0x934e('0x18')](_0x934e('0x25'),EXTRACTED_REPORT_ID,_0x934e('0x9')));return analyticExtractedReport('Completed',_0x3f8191?util[_0x934e('0x18')](_0x934e('0x21'),_0x283c6e,_0x3f8191?_0x934e('0x22'):_0x934e('0x26')):null);});})[_0x934e('0x27')](function(_0x322837){logger['info'](util[_0x934e('0x18')](_0x934e('0x28'),EXTRACTED_REPORT_ID,'CSV'),util[_0x934e('0x29')](_0x322837,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x934e('0x2a'));})[_0x934e('0x2b')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3bc0=['QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','mkdirSync','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','catch','CSV','inspect','Failed','finally','exit','util','path','to-csv','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query'];(function(_0x548d40,_0x246b11){var _0x54c407=function(_0x4f5a80){while(--_0x4f5a80){_0x548d40['push'](_0x548d40['shift']());}};_0x54c407(++_0x246b11);}(_0x3bc0,0x79));var _0x03bc=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x3bc0[_0x1203f];return _0x365f0a;};'use strict';var util=require(_0x03bc('0x0'));var path=require(_0x03bc('0x1'));var _=require('lodash');var csv=require(_0x03bc('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x03bc('0x3'));var rimraf=require(_0x03bc('0x4'));var db=require(_0x03bc('0x5'))['db'];var dbH=require(_0x03bc('0x5'))['dbH'];var logger=require(_0x03bc('0x6'))(_0x03bc('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x03bc('0x8')][0x2]);var QUERY=process[_0x03bc('0x8')][0x3];var PATH=process[_0x03bc('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x15f7fa,_0x4d606a){var _0x131e6a={'status':_0x15f7fa};var _0x2b4557={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d606a){_0x131e6a['savename']=_0x4d606a;}return db['AnalyticExtractedReport'][_0x03bc('0x9')](_0x131e6a,_0x2b4557);}function main(){var _0x2e8ada=0x1388;var _0x430179;logger[_0x03bc('0xa')](util[_0x03bc('0xb')](_0x03bc('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x03bc('0xd')][_0x03bc('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x03bc('0xf'),_0x03bc('0x10')]})[_0x03bc('0x11')](function(_0x43b244){if(_0x43b244){_0x430179=_0x43b244;_0x2e8ada=_0x430179['splitSizeCsv']||0x1388;}})[_0x03bc('0x11')](function(){return dbH[_0x03bc('0x12')][_0x03bc('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x03bc('0x12')][_0x03bc('0x14')][_0x03bc('0x15')]});})[_0x03bc('0x11')](function(_0x511c5c){if(!_0x511c5c[0x0][_0x03bc('0x16')]){return analyticExtractedReport(_0x03bc('0x17'));}var _0x4992df=[];var _0x332454=0x0;if(_0x430179[_0x03bc('0xf')]){if(_0x511c5c&&_0x511c5c[_0x03bc('0x18')]){var _0x19793d=_['range'](_0x511c5c[0x0][_0x03bc('0x16')]/_0x2e8ada);var _0x5c4786=Number[_0x03bc('0x19')](_0x511c5c[0x0][_0x03bc('0x16')]/_0x2e8ada)?_0x511c5c[0x0]['num']%_0x2e8ada:0x0;_0x19793d[_0x03bc('0x1a')](function(_0x172d37){if(_0x172d37>0x0){_0x332454+=_0x2e8ada;}_0x4992df[_0x03bc('0x1b')](dbH['sequelize'][_0x03bc('0x13')](util[_0x03bc('0xb')](_0x03bc('0x1c'),QUERY,_0x2e8ada,_0x332454),{'type':dbH[_0x03bc('0x12')]['QueryTypes'][_0x03bc('0x15')]}));});if(_0x5c4786>0x0){_0x332454+=_0x2e8ada;_0x4992df[_0x03bc('0x1b')](dbH[_0x03bc('0x12')][_0x03bc('0x13')](util[_0x03bc('0xb')](_0x03bc('0x1c'),QUERY,_0x5c4786,_0x332454),{'type':dbH[_0x03bc('0x12')][_0x03bc('0x14')][_0x03bc('0x15')]}));}}}else{_0x4992df['push'](dbH['sequelize'][_0x03bc('0x13')](QUERY,{'type':dbH[_0x03bc('0x12')]['QueryTypes'][_0x03bc('0x15')]}));}var _0x4a4827=path[_0x03bc('0x1d')](PATH);var _0x5d0ae7=path['basename'](PATH,_0x03bc('0x1e'));var _0x46ba0e=_0x430179[_0x03bc('0xf')]&&_0x4992df['length']>0x1;var _0xb7897e=[];if(!fs[_0x03bc('0x1f')](path[_0x03bc('0x20')](_0x4a4827,_0x5d0ae7))&&_0x46ba0e){fs[_0x03bc('0x21')](path[_0x03bc('0x20')](_0x4a4827,_0x5d0ae7));}return BPromise['each'](_0x4992df,function(_0x5b628d){_0xb7897e['push'](_0x5b628d);})[_0x03bc('0x11')](function(){for(var _0x3184a8=0x0;_0x3184a8<_0xb7897e[_0x03bc('0x18')];_0x3184a8+=0x1){var _0x130c88;var _0x42374b=_0xb7897e[_0x3184a8];if(_0x46ba0e){_0x130c88=path['join'](_0x4a4827,_0x5d0ae7,util['format']('%s%d.%s',_0x5d0ae7,_0x3184a8,'csv'));}else{_0x130c88=path[_0x03bc('0x20')](_0x4a4827,util[_0x03bc('0xb')](_0x03bc('0x22'),_0x5d0ae7,'csv'));}fs[_0x03bc('0x23')](_0x130c88,csv(_0x42374b));}})[_0x03bc('0x11')](function(){if(_0x46ba0e){return new Promise(function(_0x4f67c5){zipdir(path[_0x03bc('0x20')](_0x4a4827,_0x5d0ae7),{'saveTo':path['join'](_0x4a4827,util['format'](_0x03bc('0x22'),_0x5d0ae7,_0x03bc('0x24')))},function(_0x2b8a36,_0x3271fc){rimraf(path[_0x03bc('0x20')](_0x4a4827,_0x5d0ae7),function(){});_0x4f67c5(_0x03bc('0x25'));});});}})['then'](function(){logger[_0x03bc('0xa')](util[_0x03bc('0xb')](_0x03bc('0x26'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x03bc('0x27'),_0x46ba0e?util[_0x03bc('0xb')]('%s.%s',_0x5d0ae7,_0x46ba0e?_0x03bc('0x24'):_0x03bc('0x28')):null);});})[_0x03bc('0x29')](function(_0x888c4c){logger['info'](util[_0x03bc('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x03bc('0x2a')),util[_0x03bc('0x2b')](_0x888c4c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x03bc('0x2c'));})[_0x03bc('0x2d')](function(){process[_0x03bc('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index e963f5a..91abcb8 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 _0x9605=['each','createPdfKitDocument','%s%d.%s','pdf','%s.%s','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','catch','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','finish','createPdfFromHTML','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','map','toString','value','fill','auto','push','body','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','before','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','find','split','splitSizePdf','then','range','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','join'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x9605,0x167));var _0x5960=function(_0x3d9f10,_0x1d80be){_0x3d9f10=_0x3d9f10-0x0;var _0x399cce=_0x9605[_0x3d9f10];return _0x399cce;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x5960('0x0'));var moment=require(_0x5960('0x1'));var htmlToPdfmake=require(_0x5960('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x5960('0x3'));var rimraf=require(_0x5960('0x4'));var JSDOM=require(_0x5960('0x5'))[_0x5960('0x6')];var window=new JSDOM('')[_0x5960('0x7')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x5960('0x8'))[_0x5960('0x9')];var logger=require(_0x5960('0xa'))(_0x5960('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x5960('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x5960('0xc')][0x4];var NAME=process[_0x5960('0xc')][0x5];var FORMAT=_0x5960('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x50125e,_0x87772b){var _0x1074e6={'status':_0x50125e};var _0x2c902b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x87772b){_0x1074e6[_0x5960('0xe')]=_0x87772b;}return db[_0x5960('0xf')]['update'](_0x1074e6,_0x2c902b);}function getHeaders(_0x2cc77a){return _['map'](_0x2cc77a,function(_0x5abd51){return{'text':_0x5abd51,'style':_0x5960('0x10')};});}function getRows(_0x120ed9,_0x718d69){return _[_0x5960('0x11')](_0x718d69,function(_0x25e6ad){return _(_0x25e6ad)['pick'](_0x120ed9)[_0x5960('0x11')](function(_0x1bac17){return _0x1bac17?_[_0x5960('0x12')](_0x1bac17):'';})[_0x5960('0x13')]();});}function createTable(_0x186568,_0xa75a73){var _0x4269dc={'widths':_[_0x5960('0x14')](Array(_0x186568['length']),0x91),'heights':function(_0x5ed703){return _0x5ed703===0x0?_0x5960('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x41ab33=getHeaders(_0x186568);_0x4269dc['body'][_0x5960('0x16')](_0x41ab33);var _0x33e7ce=getRows(_0x186568,_0xa75a73);_0x4269dc[_0x5960('0x17')]=_0x4269dc['body'][_0x5960('0x18')](_0x33e7ce);return _0x4269dc;}function createTables(_0x38e287){var _0x29784e=[];var _0xbf856=_[_0x5960('0x19')](Object[_0x5960('0x1a')](_0x38e287[0x0]),0x5);_0xbf856['forEach'](function(_0x505cd6){_0x29784e['push'](createTable(_0x505cd6,_0x38e287));});return _0x29784e;}function getPDFDocDefinition(_0x137ccf){var _0x249b7c=util[_0x5960('0x1b')](_0x5960('0x1c'),NAME,EXTRACTED_REPORT[_0x5960('0x1d')],moment(EXTRACTED_REPORT['startDate'])[_0x5960('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x5960('0x1e')])[_0x5960('0x1b')](FORMAT));var _0x3017e7=[];for(var _0x1ac1ef=0x0;_0x1ac1ef<_0x137ccf[_0x5960('0x1f')];_0x1ac1ef++){var _0x300edb=[];if(_0x1ac1ef===0x0){_0x300edb[_0x5960('0x16')]({'text':_0x249b7c,'style':'header'});}var _0x59c2bd={'table':_0x137ccf[_0x1ac1ef]};if(_0x1ac1ef>0x0){_0x59c2bd['pageBreak']=_0x5960('0x20');_0x59c2bd['margin']=[0x0,0x46,0x0,0x0];}_0x300edb['push'](_0x59c2bd);_0x3017e7[_0x5960('0x16')](_0x300edb);}return{'pageSize':'A4','pageOrientation':_0x5960('0x21'),'content':_0x3017e7,'footer':function(_0x505b7a,_0x1907d2){return{'text':_0x505b7a[_0x5960('0x12')]()+_0x5960('0x22')+_0x1907d2,'style':_0x5960('0x23')};},'defaultStyle':{'font':_0x5960('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5960('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x11a987){var _0x281796=0x1388;var _0x167db2;if(!_0x11a987[0x0][_0x5960('0x26')]){return analyticExtractedReport(_0x5960('0x27'));}return db[_0x5960('0x28')][_0x5960('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5960('0x2a'),_0x5960('0x2b')]})[_0x5960('0x2c')](function(_0x6720ef){if(_0x6720ef){_0x167db2=_0x6720ef;_0x281796=_0x167db2[_0x5960('0x2b')]||0x3e8;}})[_0x5960('0x2c')](function(){var _0x2c6a31=[];var _0x36c416=0x0;if(_0x167db2[_0x5960('0x2a')]){if(_0x11a987&&_0x11a987[_0x5960('0x1f')]){var _0x44396c=_[_0x5960('0x2d')](_0x11a987[0x0][_0x5960('0x26')]/_0x281796);var _0x30d474=Number['isInteger'](_0x11a987[0x0][_0x5960('0x26')]/_0x281796)?_0x11a987[0x0][_0x5960('0x26')]%_0x281796:0x0;_0x44396c[_0x5960('0x2e')](function(_0x1e40bb){if(_0x1e40bb>0x0){_0x36c416+=_0x281796;}_0x2c6a31['push'](dbH['sequelize'][_0x5960('0x2f')](util[_0x5960('0x1b')](_0x5960('0x30'),QUERY,_0x281796,_0x36c416),{'type':dbH[_0x5960('0x31')][_0x5960('0x32')][_0x5960('0x33')]}));});if(_0x30d474>0x0){_0x36c416+=_0x281796;_0x2c6a31[_0x5960('0x16')](dbH[_0x5960('0x31')][_0x5960('0x2f')](util['format'](_0x5960('0x30'),QUERY,_0x30d474,_0x36c416),{'type':dbH[_0x5960('0x31')][_0x5960('0x32')][_0x5960('0x33')]}));}}}else{_0x2c6a31['push'](dbH[_0x5960('0x31')][_0x5960('0x2f')](QUERY,{'type':dbH['sequelize'][_0x5960('0x32')][_0x5960('0x33')]}));}var _0x30995d=path[_0x5960('0x34')](PATH);var _0x52d720=path['basename'](PATH,_0x5960('0x35'));var _0x3c5cb6=_0x167db2[_0x5960('0x2a')]&&_0x2c6a31[_0x5960('0x1f')]>0x1;var _0x4b3f2d=[];if(!fs[_0x5960('0x36')](path[_0x5960('0x37')](_0x30995d,_0x52d720))&&_0x3c5cb6){fs['mkdirSync'](path[_0x5960('0x37')](_0x30995d,_0x52d720));}return BPromise[_0x5960('0x38')](_0x2c6a31,function(_0x3a2392){_0x4b3f2d['push'](_0x3a2392);})['then'](function(){var _0x3f5674=[];for(var _0x3f0bd8=0x0;_0x3f0bd8<_0x4b3f2d[_0x5960('0x1f')];_0x3f0bd8+=0x1){var _0xb7425e=_0x4b3f2d[_0x3f0bd8];var _0x2e28e0=createTables(_['flatten'](_0xb7425e));var _0x19fcb9;var _0x389a11=getPDFDocDefinition(_0x2e28e0);var _0x21b199=getPDFPrinter();var _0x49805e=_0x21b199[_0x5960('0x39')](_0x389a11);if(_0x3c5cb6){_0x19fcb9=path['join'](_0x30995d,_0x52d720,util[_0x5960('0x1b')](_0x5960('0x3a'),_0x52d720,_0x3f0bd8,_0x5960('0x3b')));}else{_0x19fcb9=path[_0x5960('0x37')](_0x30995d,util['format'](_0x5960('0x3c'),_0x52d720,'pdf'));}_0x3f5674[_0x5960('0x16')](writePDFDocument(_0x49805e,_0x19fcb9));}return Promise['all'](_0x3f5674);})[_0x5960('0x2c')](function(){if(_0x3c5cb6){return new Promise(function(_0x1be348){zipdir(path[_0x5960('0x37')](_0x30995d,_0x52d720),{'saveTo':path['join'](_0x30995d,util['format'](_0x5960('0x3c'),_0x52d720,_0x5960('0x3d')))},function(){rimraf(path[_0x5960('0x37')](_0x30995d,_0x52d720),function(){});_0x1be348(_0x5960('0x3e'));});});}})[_0x5960('0x2c')](function(){if(!_0x3c5cb6)return;rimraf(path[_0x5960('0x37')](_0x30995d,_0x52d720),function(){});})[_0x5960('0x2c')](function(){logger[_0x5960('0x3f')](util[_0x5960('0x1b')](_0x5960('0x40'),EXTRACTED_REPORT_ID,_0x5960('0x41')));return analyticExtractedReport(_0x5960('0x42'),_0x3c5cb6?util[_0x5960('0x1b')]('%s.%s',_0x52d720,_0x3c5cb6?_0x5960('0x3d'):_0x5960('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5960('0x3f')](util[_0x5960('0x1b')](_0x5960('0x43'),EXTRACTED_REPORT_ID,_0x5960('0x41')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5960('0x2c')](function(_0x257618){EXTRACTED_REPORT=_0x257618;return dbH[_0x5960('0x31')][_0x5960('0x2f')](util[_0x5960('0x1b')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x5960('0x32')][_0x5960('0x33')]});})[_0x5960('0x2c')](extractReport)[_0x5960('0x44')](function(_0x16e026){logger[_0x5960('0x3f')](util[_0x5960('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5960('0x41')),util['inspect'](_0x16e026,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5960('0x45'));})[_0x5960('0x46')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2eafed=new PdfPrinter({'Arial':{'normal':__dirname+_0x5960('0x47'),'bold':__dirname+_0x5960('0x48'),'italics':__dirname+_0x5960('0x49'),'bolditalics':__dirname+_0x5960('0x4a')}});return _0x2eafed;}function getPDFDocDefinitionFromHTML(_0x43b24c,_0x33c4d5){var _0x3fa402=util[_0x5960('0x1b')]('%s\x20#%d',_0x33c4d5[_0x5960('0x4b')],_0x33c4d5[_0x5960('0x4c')]);var _0x327c0f=moment()[_0x5960('0x1b')](_0x5960('0x4d'))['toString']();var _0x156e15=htmlToPdfmake(_0x43b24c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x156e15],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5960('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5960('0x4e')}},'header':function(){return[{'text':_0x5960('0x4f'),'style':_0x5960('0x50')}];},'footer':function(_0x387457,_0x4094d1){return[{'text':util[_0x5960('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3fa402,_0x387457,_0x4094d1,_0x327c0f),'style':'footer'}];}};}function writePDFDocument(_0x523d2a,_0x4ad65f){return new Promise(function(_0x15cd1f,_0x1ee7bf){var _0x799cfa=_0x523d2a['pipe'](fs['createWriteStream'](_0x4ad65f));_0x799cfa['on'](_0x5960('0x51'),function(){_0x15cd1f('finish');});_0x799cfa['on']('error',function(_0x18f860){_0x1ee7bf(_0x18f860);});_0x523d2a['end']();});}exports[_0x5960('0x52')]=function(_0x1696bc,_0x253eb6){var _0x514638=getPDFPrinter();var _0x1bf147=getPDFDocDefinitionFromHTML(_0x1696bc,_0x253eb6);var _0x2cf0eb=_0x514638['createPdfKitDocument'](_0x1bf147);return writePDFDocument(_0x2cf0eb,_0x253eb6[_0x5960('0x0')])[_0x5960('0x44')](function(_0x4fb0db){throw _0x4fb0db;});}; \ No newline at end of file +var _0xf28c=['dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','forEach','format','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','find','split','splitSizePdf','range','isInteger','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','then','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','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','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','window','../../mysqldb'];(function(_0x472462,_0x48cfcf){var _0x1e8fff=function(_0x5b968d){while(--_0x5b968d){_0x472462['push'](_0x472462['shift']());}};_0x1e8fff(++_0x48cfcf);}(_0xf28c,0x113));var _0xcf28=function(_0x51b4f5,_0x3534e6){_0x51b4f5=_0x51b4f5-0x0;var _0x542942=_0xf28c[_0x51b4f5];return _0x542942;};'use strict';var _=require(_0xcf28('0x0'));var fs=require('fs');var util=require(_0xcf28('0x1'));var path=require(_0xcf28('0x2'));var moment=require(_0xcf28('0x3'));var htmlToPdfmake=require(_0xcf28('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xcf28('0x5'));var rimraf=require(_0xcf28('0x6'));var JSDOM=require(_0xcf28('0x7'))['JSDOM'];var window=new JSDOM('')[_0xcf28('0x8')];var BPromise=require('bluebird');var db=require(_0xcf28('0x9'))['db'];var dbH=require(_0xcf28('0x9'))[_0xcf28('0xa')];var logger=require(_0xcf28('0xb'))(_0xcf28('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xcf28('0xd')][0x2]);var QUERY=process[_0xcf28('0xd')][0x3];var PATH=process[_0xcf28('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xcf28('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4b5266,_0x5a06f9){var _0x31eaa3={'status':_0x4b5266};var _0x3e29d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a06f9){_0x31eaa3[_0xcf28('0xf')]=_0x5a06f9;}return db['AnalyticExtractedReport'][_0xcf28('0x10')](_0x31eaa3,_0x3e29d2);}function getHeaders(_0x54f8d7){return _[_0xcf28('0x11')](_0x54f8d7,function(_0x4c1e88){return{'text':_0x4c1e88,'style':_0xcf28('0x12')};});}function getRows(_0x31ec0a,_0x511499){return _[_0xcf28('0x11')](_0x511499,function(_0x46d12e){return _(_0x46d12e)[_0xcf28('0x13')](_0x31ec0a)[_0xcf28('0x11')](function(_0x2f9cb2){return _0x2f9cb2?_[_0xcf28('0x14')](_0x2f9cb2):'';})[_0xcf28('0x15')]();});}function createTable(_0x119fe2,_0x2e218a){var _0x13afc4={'widths':_[_0xcf28('0x16')](Array(_0x119fe2[_0xcf28('0x17')]),0x91),'heights':function(_0x231049){return _0x231049===0x0?_0xcf28('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x579a63=getHeaders(_0x119fe2);_0x13afc4[_0xcf28('0x19')][_0xcf28('0x1a')](_0x579a63);var _0x15af3f=getRows(_0x119fe2,_0x2e218a);_0x13afc4[_0xcf28('0x19')]=_0x13afc4[_0xcf28('0x19')][_0xcf28('0x1b')](_0x15af3f);return _0x13afc4;}function createTables(_0x1b3e1b){var _0x506164=[];var _0x1cd203=_[_0xcf28('0x1c')](Object['keys'](_0x1b3e1b[0x0]),0x5);_0x1cd203[_0xcf28('0x1d')](function(_0x1e4063){_0x506164[_0xcf28('0x1a')](createTable(_0x1e4063,_0x1b3e1b));});return _0x506164;}function getPDFDocDefinition(_0x3824bd){var _0x487557=util[_0xcf28('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xcf28('0x1f')],moment(EXTRACTED_REPORT[_0xcf28('0x20')])[_0xcf28('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xcf28('0x21')])[_0xcf28('0x1e')](FORMAT));var _0x2d83de=[];for(var _0x1cc451=0x0;_0x1cc451<_0x3824bd['length'];_0x1cc451++){var _0x5d7f3e=[];if(_0x1cc451===0x0){_0x5d7f3e[_0xcf28('0x1a')]({'text':_0x487557,'style':_0xcf28('0x22')});}var _0x356495={'table':_0x3824bd[_0x1cc451]};if(_0x1cc451>0x0){_0x356495[_0xcf28('0x23')]=_0xcf28('0x24');_0x356495[_0xcf28('0x25')]=[0x0,0x46,0x0,0x0];}_0x5d7f3e['push'](_0x356495);_0x2d83de[_0xcf28('0x1a')](_0x5d7f3e);}return{'pageSize':'A4','pageOrientation':_0xcf28('0x26'),'content':_0x2d83de,'footer':function(_0x23bf63,_0x284c36){return{'text':_0x23bf63['toString']()+_0xcf28('0x27')+_0x284c36,'style':_0xcf28('0x28')};},'defaultStyle':{'font':_0xcf28('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcf28('0x2a')},'footer':{'alignment':_0xcf28('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x26db74){var _0x3411be=0x1388;var _0x46b0d7;if(!_0x26db74[0x0]['num']){return analyticExtractedReport('Empty');}return db['Setting'][_0xcf28('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf28('0x2d'),_0xcf28('0x2e')]})['then'](function(_0x411a05){if(_0x411a05){_0x46b0d7=_0x411a05;_0x3411be=_0x46b0d7[_0xcf28('0x2e')]||0x3e8;}})['then'](function(){var _0x4f8b3a=[];var _0x94da8f=0x0;if(_0x46b0d7[_0xcf28('0x2d')]){if(_0x26db74&&_0x26db74[_0xcf28('0x17')]){var _0x5d0160=_[_0xcf28('0x2f')](_0x26db74[0x0]['num']/_0x3411be);var _0x5c17a6=Number[_0xcf28('0x30')](_0x26db74[0x0][_0xcf28('0x31')]/_0x3411be)?_0x26db74[0x0][_0xcf28('0x31')]%_0x3411be:0x0;_0x5d0160[_0xcf28('0x1d')](function(_0x14272){if(_0x14272>0x0){_0x94da8f+=_0x3411be;}_0x4f8b3a[_0xcf28('0x1a')](dbH[_0xcf28('0x32')][_0xcf28('0x33')](util[_0xcf28('0x1e')](_0xcf28('0x34'),QUERY,_0x3411be,_0x94da8f),{'type':dbH[_0xcf28('0x32')]['QueryTypes']['SELECT']}));});if(_0x5c17a6>0x0){_0x94da8f+=_0x3411be;_0x4f8b3a['push'](dbH[_0xcf28('0x32')][_0xcf28('0x33')](util[_0xcf28('0x1e')](_0xcf28('0x34'),QUERY,_0x5c17a6,_0x94da8f),{'type':dbH[_0xcf28('0x32')][_0xcf28('0x35')][_0xcf28('0x36')]}));}}}else{_0x4f8b3a[_0xcf28('0x1a')](dbH[_0xcf28('0x32')][_0xcf28('0x33')](QUERY,{'type':dbH[_0xcf28('0x32')][_0xcf28('0x35')]['SELECT']}));}var _0x2318c0=path[_0xcf28('0x37')](PATH);var _0x51a0a9=path['basename'](PATH,_0xcf28('0x38'));var _0x1dc292=_0x46b0d7[_0xcf28('0x2d')]&&_0x4f8b3a['length']>0x1;var _0x4b219a=[];if(!fs['existsSync'](path['join'](_0x2318c0,_0x51a0a9))&&_0x1dc292){fs[_0xcf28('0x39')](path[_0xcf28('0x3a')](_0x2318c0,_0x51a0a9));}return BPromise[_0xcf28('0x3b')](_0x4f8b3a,function(_0x378ca2){_0x4b219a['push'](_0x378ca2);})['then'](function(){var _0x422b79=[];for(var _0x31026f=0x0;_0x31026f<_0x4b219a[_0xcf28('0x17')];_0x31026f+=0x1){var _0x484771=_0x4b219a[_0x31026f];var _0xa6f74b=createTables(_[_0xcf28('0x3c')](_0x484771));var _0x5d33bd;var _0x676cd3=getPDFDocDefinition(_0xa6f74b);var _0x26c0be=getPDFPrinter();var _0x5e9615=_0x26c0be[_0xcf28('0x3d')](_0x676cd3);if(_0x1dc292){_0x5d33bd=path['join'](_0x2318c0,_0x51a0a9,util[_0xcf28('0x1e')](_0xcf28('0x3e'),_0x51a0a9,_0x31026f,_0xcf28('0x3f')));}else{_0x5d33bd=path['join'](_0x2318c0,util[_0xcf28('0x1e')]('%s.%s',_0x51a0a9,_0xcf28('0x3f')));}_0x422b79[_0xcf28('0x1a')](writePDFDocument(_0x5e9615,_0x5d33bd));}return Promise[_0xcf28('0x40')](_0x422b79);})[_0xcf28('0x41')](function(){if(_0x1dc292){return new Promise(function(_0x1adc23){zipdir(path['join'](_0x2318c0,_0x51a0a9),{'saveTo':path[_0xcf28('0x3a')](_0x2318c0,util[_0xcf28('0x1e')](_0xcf28('0x42'),_0x51a0a9,'zip'))},function(){rimraf(path[_0xcf28('0x3a')](_0x2318c0,_0x51a0a9),function(){});_0x1adc23('zip\x20finished');});});}})['then'](function(){if(!_0x1dc292)return;rimraf(path[_0xcf28('0x3a')](_0x2318c0,_0x51a0a9),function(){});})['then'](function(){logger[_0xcf28('0x43')](util[_0xcf28('0x1e')](_0xcf28('0x44'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xcf28('0x45'),_0x1dc292?util[_0xcf28('0x1e')](_0xcf28('0x42'),_0x51a0a9,_0x1dc292?_0xcf28('0x46'):_0xcf28('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcf28('0x43')](util[_0xcf28('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0xcf28('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4fd39d){EXTRACTED_REPORT=_0x4fd39d;return dbH[_0xcf28('0x32')][_0xcf28('0x33')](util[_0xcf28('0x1e')](_0xcf28('0x48'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xcf28('0x36')]});})[_0xcf28('0x41')](extractReport)[_0xcf28('0x49')](function(_0x11b4bf){logger['info'](util[_0xcf28('0x1e')](_0xcf28('0x4a'),EXTRACTED_REPORT_ID,_0xcf28('0x4b')),util[_0xcf28('0x4c')](_0x11b4bf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf28('0x4d'));})[_0xcf28('0x4e')](function(){process[_0xcf28('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x10b5ec=new PdfPrinter({'Arial':{'normal':__dirname+_0xcf28('0x50'),'bold':__dirname+_0xcf28('0x51'),'italics':__dirname+_0xcf28('0x52'),'bolditalics':__dirname+_0xcf28('0x53')}});return _0x10b5ec;}function getPDFDocDefinitionFromHTML(_0x4ef6c7,_0x209565){var _0x425f05=util[_0xcf28('0x1e')](_0xcf28('0x54'),_0x209565[_0xcf28('0x55')],_0x209565[_0xcf28('0x56')]);var _0x23d643=moment()[_0xcf28('0x1e')](_0xcf28('0x57'))[_0xcf28('0x14')]();var _0x478f32=htmlToPdfmake(_0x4ef6c7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x478f32],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcf28('0x58'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcf28('0x58'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcf28('0x58')}},'header':function(){return[{'text':_0xcf28('0x59'),'style':_0xcf28('0x22')}];},'footer':function(_0x5466a4,_0x1e79f5){return[{'text':util[_0xcf28('0x1e')](_0xcf28('0x5a'),_0x425f05,_0x5466a4,_0x1e79f5,_0x23d643),'style':_0xcf28('0x28')}];}};}function writePDFDocument(_0x20b2e7,_0x43e00e){return new Promise(function(_0x21e50f,_0x4009c4){var _0x359d8e=_0x20b2e7[_0xcf28('0x5b')](fs[_0xcf28('0x5c')](_0x43e00e));_0x359d8e['on']('finish',function(){_0x21e50f('finish');});_0x359d8e['on']('error',function(_0x2f02d1){_0x4009c4(_0x2f02d1);});_0x20b2e7[_0xcf28('0x5d')]();});}exports[_0xcf28('0x5e')]=function(_0x5c22dc,_0x49036f){var _0x135521=getPDFPrinter();var _0x13ee07=getPDFDocDefinitionFromHTML(_0x5c22dc,_0x49036f);var _0x46723b=_0x135521[_0xcf28('0x3d')](_0x13ee07);return writePDFDocument(_0x46723b,_0x49036f[_0xcf28('0x2')])['catch'](function(_0x4db53a){throw _0x4db53a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e1170d6..999fa6d 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 _0x0d8b=['Completed','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','zip','XLSX'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x0d8b,0x1e6));var _0xb0d8=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x0d8b[_0x50bf5a];return _0x4ddc1d;};'use strict';var util=require('util');var path=require(_0xb0d8('0x0'));var _=require(_0xb0d8('0x1'));var fs=require('fs');var json2xls=require(_0xb0d8('0x2'));var BPromise=require(_0xb0d8('0x3'));var zipdir=require(_0xb0d8('0x4'));var rimraf=require(_0xb0d8('0x5'));var db=require(_0xb0d8('0x6'))['db'];var dbH=require('../../mysqldb')[_0xb0d8('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb0d8('0x8')][0x2]);var QUERY=process[_0xb0d8('0x8')][0x3];var PATH=process[_0xb0d8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x243b42,_0x326bad){var _0x24b91d={'status':_0x243b42};var _0x2281e7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x326bad){_0x24b91d[_0xb0d8('0x9')]=_0x326bad;}return db[_0xb0d8('0xa')]['update'](_0x24b91d,_0x2281e7);}function main(){var _0xbcc513=0x1388;var _0x9a776d;logger[_0xb0d8('0xb')](util[_0xb0d8('0xc')](_0xb0d8('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xb0d8('0xe')][_0xb0d8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb0d8('0x10'),_0xb0d8('0x11')]})[_0xb0d8('0x12')](function(_0x1bd3b3){if(_0x1bd3b3){_0x9a776d=_0x1bd3b3;_0xbcc513=_0x9a776d[_0xb0d8('0x11')]||0x1388;}})[_0xb0d8('0x12')](function(){return dbH[_0xb0d8('0x13')][_0xb0d8('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xb0d8('0x15')][_0xb0d8('0x16')]});})[_0xb0d8('0x12')](function(_0x2a7ffa){if(!_0x2a7ffa[0x0][_0xb0d8('0x17')]){return analyticExtractedReport(_0xb0d8('0x18'));}var _0x198645=[];var _0x341678=0x0;if(_0x9a776d[_0xb0d8('0x10')]){if(_0x2a7ffa&&_0x2a7ffa[_0xb0d8('0x19')]){var _0x4c666d=_[_0xb0d8('0x1a')](_0x2a7ffa[0x0][_0xb0d8('0x17')]/_0xbcc513);var _0x3b3695=Number[_0xb0d8('0x1b')](_0x2a7ffa[0x0]['num']/_0xbcc513)?_0x2a7ffa[0x0][_0xb0d8('0x17')]%_0xbcc513:0x0;_0x4c666d[_0xb0d8('0x1c')](function(_0x2c2947){if(_0x2c2947>0x0){_0x341678+=_0xbcc513;}_0x198645['push'](dbH['sequelize']['query'](util['format'](_0xb0d8('0x1d'),QUERY,_0xbcc513,_0x341678),{'type':dbH[_0xb0d8('0x13')][_0xb0d8('0x15')]['SELECT']}));});if(_0x3b3695>0x0){_0x341678+=_0xbcc513;_0x198645['push'](dbH[_0xb0d8('0x13')][_0xb0d8('0x14')](util[_0xb0d8('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3b3695,_0x341678),{'type':dbH[_0xb0d8('0x13')][_0xb0d8('0x15')][_0xb0d8('0x16')]}));}}}else{_0x198645[_0xb0d8('0x1e')](dbH[_0xb0d8('0x13')][_0xb0d8('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xb0d8('0x16')]}));}var _0x14a553=path[_0xb0d8('0x1f')](PATH);var _0x503bdf=path[_0xb0d8('0x20')](PATH,_0xb0d8('0x21'));var _0xf70885=_0x9a776d['split']&&_0x198645[_0xb0d8('0x19')]>0x1;var _0x14cd13=[];if(!fs[_0xb0d8('0x22')](path[_0xb0d8('0x23')](_0x14a553,_0x503bdf))&&_0xf70885){fs[_0xb0d8('0x24')](path[_0xb0d8('0x23')](_0x14a553,_0x503bdf));}return BPromise[_0xb0d8('0x25')](_0x198645,function(_0x42c467){_0x14cd13[_0xb0d8('0x1e')](_0x42c467);})['then'](function(){for(var _0x55eb5c=0x0;_0x55eb5c<_0x14cd13['length'];_0x55eb5c+=0x1){var _0x388f99;var _0xf79261=_0x14cd13[_0x55eb5c];if(_0xf70885){_0x388f99=path[_0xb0d8('0x23')](_0x14a553,_0x503bdf,util[_0xb0d8('0xc')](_0xb0d8('0x26'),_0x503bdf,_0x55eb5c,'xlsx'));}else{_0x388f99=path['join'](_0x14a553,util[_0xb0d8('0xc')](_0xb0d8('0x27'),_0x503bdf,'xlsx'));}fs['writeFileSync'](_0x388f99,json2xls(_0xf79261),'binary');}})['then'](function(){if(_0xf70885){return new Promise(function(_0x40b320){zipdir(path[_0xb0d8('0x23')](_0x14a553,_0x503bdf),{'saveTo':path[_0xb0d8('0x23')](_0x14a553,util[_0xb0d8('0xc')]('%s.%s',_0x503bdf,_0xb0d8('0x28')))},function(_0x2faff1,_0x24f5a3){rimraf(path[_0xb0d8('0x23')](_0x14a553,_0x503bdf),function(){});_0x40b320('zip\x20finished');});});}})[_0xb0d8('0x12')](function(){logger[_0xb0d8('0xb')](util[_0xb0d8('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb0d8('0x29')));return analyticExtractedReport(_0xb0d8('0x2a'),_0xf70885?util['format'](_0xb0d8('0x27'),_0x503bdf,_0xf70885?'zip':_0xb0d8('0x2b')):null);});})[_0xb0d8('0x2c')](function(_0x590871){logger[_0xb0d8('0xb')](util[_0xb0d8('0xc')](_0xb0d8('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x590871,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb0d8('0x2e'));})[_0xb0d8('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3496=['Empty','length','range','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','existsSync','join','mkdirSync','%s%d.%s','binary','zip','info','Completed','%s.%s','xlsx','catch','Failed','finally','exit','util','json2xls','bluebird','../../mysqldb','dbH','../../config/logger','argv','update','format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','QueryTypes','SELECT','num'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3496,0x1a5));var _0x6349=function(_0x42f1f1,_0x35b869){_0x42f1f1=_0x42f1f1-0x0;var _0x3c7439=_0x3496[_0x42f1f1];return _0x3c7439;};'use strict';var util=require(_0x6349('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x6349('0x1'));var BPromise=require(_0x6349('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x6349('0x3'))['db'];var dbH=require('../../mysqldb')[_0x6349('0x4')];var logger=require(_0x6349('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6349('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6349('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xeb3e6b,_0x5b8868){var _0x12591a={'status':_0xeb3e6b};var _0x2cd41a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5b8868){_0x12591a['savename']=_0x5b8868;}return db['AnalyticExtractedReport'][_0x6349('0x7')](_0x12591a,_0x2cd41a);}function main(){var _0x528d8a=0x1388;var _0x5fd816;logger['info'](util[_0x6349('0x8')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6349('0x9')));return db[_0x6349('0xa')][_0x6349('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6349('0xc'),_0x6349('0xd')]})[_0x6349('0xe')](function(_0x2ab6f2){if(_0x2ab6f2){_0x5fd816=_0x2ab6f2;_0x528d8a=_0x5fd816['splitSizeXlsx']||0x1388;}})[_0x6349('0xe')](function(){return dbH[_0x6349('0xf')]['query'](util[_0x6349('0x8')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x6349('0x10')][_0x6349('0x11')]});})['then'](function(_0x3e2ce3){if(!_0x3e2ce3[0x0][_0x6349('0x12')]){return analyticExtractedReport(_0x6349('0x13'));}var _0x27f7e1=[];var _0x333aaa=0x0;if(_0x5fd816[_0x6349('0xc')]){if(_0x3e2ce3&&_0x3e2ce3[_0x6349('0x14')]){var _0x4e20d4=_[_0x6349('0x15')](_0x3e2ce3[0x0][_0x6349('0x12')]/_0x528d8a);var _0x36d5ee=Number['isInteger'](_0x3e2ce3[0x0][_0x6349('0x12')]/_0x528d8a)?_0x3e2ce3[0x0]['num']%_0x528d8a:0x0;_0x4e20d4[_0x6349('0x16')](function(_0x382b63){if(_0x382b63>0x0){_0x333aaa+=_0x528d8a;}_0x27f7e1[_0x6349('0x17')](dbH[_0x6349('0xf')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x528d8a,_0x333aaa),{'type':dbH['sequelize'][_0x6349('0x10')][_0x6349('0x11')]}));});if(_0x36d5ee>0x0){_0x333aaa+=_0x528d8a;_0x27f7e1[_0x6349('0x17')](dbH[_0x6349('0xf')][_0x6349('0x18')](util[_0x6349('0x8')](_0x6349('0x19'),QUERY,_0x36d5ee,_0x333aaa),{'type':dbH[_0x6349('0xf')][_0x6349('0x10')][_0x6349('0x11')]}));}}}else{_0x27f7e1[_0x6349('0x17')](dbH['sequelize'][_0x6349('0x18')](QUERY,{'type':dbH[_0x6349('0xf')][_0x6349('0x10')][_0x6349('0x11')]}));}var _0x489bcb=path['dirname'](PATH);var _0x10e3d2=path['basename'](PATH,'.xlsx');var _0x5b75d5=_0x5fd816[_0x6349('0xc')]&&_0x27f7e1[_0x6349('0x14')]>0x1;var _0x470f28=[];if(!fs[_0x6349('0x1a')](path[_0x6349('0x1b')](_0x489bcb,_0x10e3d2))&&_0x5b75d5){fs[_0x6349('0x1c')](path[_0x6349('0x1b')](_0x489bcb,_0x10e3d2));}return BPromise['each'](_0x27f7e1,function(_0x3e8580){_0x470f28[_0x6349('0x17')](_0x3e8580);})[_0x6349('0xe')](function(){for(var _0x50bae9=0x0;_0x50bae9<_0x470f28['length'];_0x50bae9+=0x1){var _0x59c549;var _0x2ff394=_0x470f28[_0x50bae9];if(_0x5b75d5){_0x59c549=path[_0x6349('0x1b')](_0x489bcb,_0x10e3d2,util[_0x6349('0x8')](_0x6349('0x1d'),_0x10e3d2,_0x50bae9,'xlsx'));}else{_0x59c549=path[_0x6349('0x1b')](_0x489bcb,util[_0x6349('0x8')]('%s.%s',_0x10e3d2,'xlsx'));}fs['writeFileSync'](_0x59c549,json2xls(_0x2ff394),_0x6349('0x1e'));}})['then'](function(){if(_0x5b75d5){return new Promise(function(_0x8c148f){zipdir(path['join'](_0x489bcb,_0x10e3d2),{'saveTo':path[_0x6349('0x1b')](_0x489bcb,util[_0x6349('0x8')]('%s.%s',_0x10e3d2,_0x6349('0x1f')))},function(_0x142539,_0x9cd8d7){rimraf(path[_0x6349('0x1b')](_0x489bcb,_0x10e3d2),function(){});_0x8c148f('zip\x20finished');});});}})['then'](function(){logger[_0x6349('0x20')](util[_0x6349('0x8')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6349('0x9')));return analyticExtractedReport(_0x6349('0x21'),_0x5b75d5?util[_0x6349('0x8')](_0x6349('0x22'),_0x10e3d2,_0x5b75d5?'zip':_0x6349('0x23')):null);});})[_0x6349('0x24')](function(_0x2ae4fe){logger[_0x6349('0x20')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x2ae4fe,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6349('0x25'));})[_0x6349('0x26')](function(){process[_0x6349('0x27')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ccda85b..a00e009 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 _0x38a6=['custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','map','exten','filter','groupBy','queue','playback','extensions','extension','find','push','type','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','priority','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','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app'];(function(_0x266c16,_0xf3947d){var _0x2a8fd0=function(_0x13b990){while(--_0x13b990){_0x266c16['push'](_0x266c16['shift']());}};_0x2a8fd0(++_0xf3947d);}(_0x38a6,0x191));var _0x638a=function(_0x2494c3,_0x563dd9){_0x2494c3=_0x2494c3-0x0;var _0x5b6459=_0x38a6[_0x2494c3];return _0x5b6459;};'use strict';var _=require(_0x638a('0x0'));var util=require('util');function rewrite(_0x28bf82,_0x301a04){var _0x2d2b72=this;return _0x28bf82[_0x638a('0x1')][_0x638a('0x2')][_0x638a('0x3')]({'raw':!![]})[_0x638a('0x4')](function(_0x4aba22){_0x2d2b72[_0x638a('0x5')]=_0x4aba22;return _0x28bf82[_0x638a('0x1')][_0x638a('0x6')][_0x638a('0x3')]({'where':{'IntervalId':_0x301a04['IntervalId']},'raw':!![]});})[_0x638a('0x4')](function(_0x687aed){return _0x28bf82['models'][_0x638a('0x6')][_0x638a('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x638a('0x7')](_0x687aed,_0x638a('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x638a('0x4')](function(_0x568eb5){var _0x1950c9=_['filter'](_0x568eb5,{'priority':'1'});var _0x2e89d2=_[_0x638a('0x9')](_0x568eb5,{'isApp':0x1});var _0x3a7cfd=_[_0x638a('0xa')](_0x2e89d2,_0x638a('0x8'));var _0x37de04=[_0x638a('0xb'),_0x638a('0xc')];var _0x456ab0=[];var _0x5da2a2=[];for(var _0x57e6cf in _0x3a7cfd){if(_0x3a7cfd['hasOwnProperty'](_0x57e6cf)){_0x2d2b72['priority']=0x2;_0x2d2b72[_0x638a('0xd')]=[];_0x2d2b72[_0x638a('0xe')]=_[_0x638a('0xf')](_0x1950c9,{'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')]});_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x3a7cfd[_0x57e6cf][0x0]['type']),'context':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x12')],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72['priority']++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});if(_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')]===_0x638a('0x14')){_0x2d2b72['extensions'][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x16')+_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')],'context':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x12')],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72['priority']++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});}else if(_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')]===_0x638a('0x17')){if(_0x2d2b72['extension']){_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':'CDR(destination)='+(_0x2d2b72[_0x638a('0xe')][_0x638a('0x18')]?_0x638a('0x19')+_0x2d2b72[_0x638a('0xe')]['cutdigits']+'}':_0x638a('0x1a')),'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0]['exten'],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0]['VoiceExtensionId']});}_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':'Set','appdata':_0x638a('0x16')+_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')],'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});var _0x260f1d=_0x2d2b72['priority']++;_0x2d2b72['extensions']['push']({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x1c'),'appdata':_0x638a('0x1d')+(_0x260f1d+0x2)+_0x638a('0x1e')+(_0x260f1d+0x1)+')','context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x260f1d,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});if(_0x2d2b72['extension']){_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':'Set','appdata':_0x2d2b72['extension'][_0x638a('0x18')]?_0x638a('0x1f')+_0x2d2b72[_0x638a('0xe')][_0x638a('0x18')]+'}':_0x638a('0x20'),'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0]['exten'],'priority':_0x2d2b72['priority']++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});}_0x2d2b72['extensions'][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x21')+_0x3a7cfd[_0x57e6cf][0x0]['VoiceExtensionId'],'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72['priority']++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0]['VoiceExtensionId']});if(_0x2d2b72[_0x638a('0xe')]&&_0x2d2b72[_0x638a('0xe')][_0x638a('0x22')](_0x638a('0x23'))&&_0x2d2b72[_0x638a('0xe')][_0x638a('0x23')]!==_0x638a('0x24')){_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x25'),'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0]['VoiceExtensionId']});_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x26')+_0x2d2b72['extension']['recordingFormat']||'wav','context':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x12')],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72['priority']++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});}}_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x27'),'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0]['exten'],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0]['VoiceExtensionId']});_0x2d2b72[_0x638a('0xd')][_0x638a('0x10')]({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':'Set','appdata':_0x638a('0x28'),'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'priority':_0x2d2b72[_0x638a('0x1b')]++,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});for(var _0xbb76f9=0x0,_0xab881a=0x0;_0xbb76f9<_0x3a7cfd[_0x57e6cf][_0x638a('0x29')];_0xbb76f9+=0x1,_0xab881a=0x0){var _0x4f499a=_0x3a7cfd[_0x57e6cf][_0xbb76f9];if(_0x4f499a['type']){_0x4f499a['type']=_0x4f499a[_0x638a('0x11')][_0x638a('0x2a')]();}var _0x158d7b=[];var _0x1a2963=[];delete _0x4f499a['id'];delete _0x4f499a[_0x638a('0x2b')];delete _0x4f499a[_0x638a('0x2c')];var _0x3b1e8c=_0x4f499a[_0x638a('0x2d')]!=='*,*,*,*'?[_0x4f499a[_0x638a('0x2d')]]:_0x4f499a[_0x638a('0x2e')]?_['map'](_[_0x638a('0x9')](_0x2d2b72['intervals'],{'IntervalId':_0x4f499a['IntervalId']}),_0x638a('0x2d')):[];if(_0x4f499a['hasOwnProperty'](_0x638a('0x2f'))){if(_0x4f499a[_0x638a('0x2f')]&&_0x4f499a[_0x638a('0x2f')]!=='--'){_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a[_0x638a('0x11')],'app':_0x638a('0x15'),'appdata':_0x638a('0x30')+_0x4f499a[_0x638a('0x2f')],'context':_0x4f499a['context'],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c['length']+_0x2d2b72[_0x638a('0x1b')]+_0xab881a++,'VoiceExtensionId':_0x4f499a[_0x638a('0x13')]});}}if(_0x4f499a[_0x638a('0x11')]===_0x638a('0x17')&&_0x4f499a['hasOwnProperty'](_0x638a('0x31'))){if(_0x4f499a[_0x638a('0x31')]){_0x158d7b['push']({'type':_0x4f499a[_0x638a('0x11')],'app':'ExecIf','appdata':_0x638a('0x32')+_0x4f499a[_0x638a('0x31')]+')','context':_0x4f499a[_0x638a('0x12')],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c[_0x638a('0x29')]+_0x2d2b72[_0x638a('0x1b')]+_0xab881a++,'VoiceExtensionId':_0x4f499a[_0x638a('0x13')]});}else{_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a[_0x638a('0x11')],'app':_0x638a('0x1c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4f499a[_0x638a('0x12')],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c['length']+_0x2d2b72[_0x638a('0x1b')]+_0xab881a++,'VoiceExtensionId':_0x4f499a[_0x638a('0x13')]});}}if(_0x4f499a['hasOwnProperty'](_0x638a('0x33'))){if(_0x37de04[_0x638a('0x34')](_0x4f499a[_0x638a('0x35')][_0x638a('0x2a')]())>=0x0&&_0x4f499a['appType']!==_0x638a('0x36')){if(_0x4f499a[_0x638a('0x33')]){_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a[_0x638a('0x11')],'app':_0x638a('0x1c'),'appdata':_0x638a('0x37'),'context':_0x4f499a[_0x638a('0x12')],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c['length']+_0x2d2b72[_0x638a('0x1b')]+_0xab881a++,'VoiceExtensionId':_0x4f499a[_0x638a('0x13')]});_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4f499a['context'],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c[_0x638a('0x29')]+_0x2d2b72['priority']+_0xab881a++,'VoiceExtensionId':_0x4f499a['VoiceExtensionId']});}else{_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a['type'],'app':_0x638a('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4f499a['context'],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c[_0x638a('0x29')]+_0x2d2b72[_0x638a('0x1b')]+_0xab881a++,'VoiceExtensionId':_0x4f499a[_0x638a('0x13')]});_0x158d7b[_0x638a('0x10')]({'type':_0x4f499a[_0x638a('0x11')],'app':'Set','appdata':_0x638a('0x38'),'context':_0x4f499a['context'],'exten':_0x4f499a[_0x638a('0x8')],'priority':_0x3b1e8c['length']+_0x2d2b72['priority']+_0xab881a++,'VoiceExtensionId':_0x4f499a['VoiceExtensionId']});}}}for(var _0xd254a1=0x0;_0xd254a1<_0x3b1e8c['length'];_0xd254a1+=0x1){var _0x49f2a7=_0x2d2b72[_0x638a('0x1b')]+_0x3b1e8c[_0x638a('0x29')];var _0xfe7455=_0xd254a1===_0x3b1e8c['length']-0x1?_0x2d2b72[_0x638a('0x1b')]+_0x158d7b[_0x638a('0x29')]+_0x1a2963[_0x638a('0x29')]+0x2:_0x2d2b72[_0x638a('0x1b')]+_0xd254a1+0x1;_0x158d7b[_0x638a('0x39')](_0xd254a1,0x0,{'type':_0x4f499a[_0x638a('0x11')],'app':'GotoIfTime','appdata':_0x3b1e8c[_0xd254a1]+'?'+_0x4f499a[_0x638a('0x12')]+_0x638a('0x3a')+_0x49f2a7+':'+_0x4f499a[_0x638a('0x12')]+_0x638a('0x3a')+_0xfe7455,'exten':_0x4f499a[_0x638a('0x8')],'context':_0x4f499a[_0x638a('0x12')],'priority':_0x2d2b72[_0x638a('0x1b')]+_0xd254a1,'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});}_0x4f499a[_0x638a('0x1b')]=_0x158d7b[_0x638a('0x29')]?_[_0x638a('0x3b')](_0x158d7b)[_0x638a('0x1b')]+0x1:_0x2d2b72['priority'];_0x2d2b72['priority']=(_0x1a2963[_0x638a('0x29')]?_[_0x638a('0x3b')](_0x1a2963)[_0x638a('0x1b')]:_0x4f499a[_0x638a('0x1b')])+0x1;_0x2d2b72[_0x638a('0xd')]=_[_0x638a('0x3c')](_0x2d2b72[_0x638a('0xd')],_0x158d7b,[_0x4f499a],_0x1a2963);}_0x2d2b72[_0x638a('0xd')]['push']({'type':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x11')],'app':_0x638a('0x3d'),'exten':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x8')],'context':_0x3a7cfd[_0x57e6cf][0x0]['context'],'priority':_0x2d2b72[_0x638a('0x1b')],'VoiceExtensionId':_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]});_0x456ab0[_0x638a('0x10')](_0x3a7cfd[_0x57e6cf][0x0][_0x638a('0x13')]);_0x5da2a2=_[_0x638a('0x3c')](_0x5da2a2,_0x2d2b72[_0x638a('0xd')]);}}return _0x28bf82['transaction'](function(_0x2ed7b3){return _0x28bf82[_0x638a('0x1')][_0x638a('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x456ab0}},'transaction':_0x2ed7b3})[_0x638a('0x4')](function(_0x4ec949){return _0x28bf82[_0x638a('0x1')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x5da2a2,_0x638a('0x1b')),{'transaction':_0x2ed7b3});});});})[_0x638a('0x3e')](function(_0x3a4a0a){console[_0x638a('0x3f')](_0x3a4a0a);});}exports[_0x638a('0x40')]=rewrite; \ No newline at end of file +var _0x748f=['CDR(routeid)=','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','Set','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','destroy','catch','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','find','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound'];(function(_0x24df3c,_0x1191ec){var _0x1e8657=function(_0x4cc86e){while(--_0x4cc86e){_0x24df3c['push'](_0x24df3c['shift']());}};_0x1e8657(++_0x1191ec);}(_0x748f,0x70));var _0xf748=function(_0x64a80f,_0x1925e7){_0x64a80f=_0x64a80f-0x0;var _0x2859af=_0x748f[_0x64a80f];return _0x2859af;};'use strict';var _=require('lodash');var util=require(_0xf748('0x0'));function rewrite(_0xa1147c,_0x1e9156){var _0x273e2d=this;return _0xa1147c[_0xf748('0x1')][_0xf748('0x2')][_0xf748('0x3')]({'raw':!![]})[_0xf748('0x4')](function(_0x5c7bc8){_0x273e2d[_0xf748('0x5')]=_0x5c7bc8;return _0xa1147c[_0xf748('0x1')][_0xf748('0x6')][_0xf748('0x3')]({'where':{'IntervalId':_0x1e9156[_0xf748('0x7')]},'raw':!![]});})[_0xf748('0x4')](function(_0x4fddb9){return _0xa1147c[_0xf748('0x1')][_0xf748('0x6')][_0xf748('0x3')]({'where':{'exten':{'$in':_[_0xf748('0x8')](_[_0xf748('0x9')](_0x4fddb9,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x1c1928){var _0x96b899=_[_0xf748('0xa')](_0x1c1928,{'priority':'1'});var _0x2e95be=_['filter'](_0x1c1928,{'isApp':0x1});var _0x3c6365=_[_0xf748('0xb')](_0x2e95be,_0xf748('0xc'));var _0x4a433b=[_0xf748('0xd'),_0xf748('0xe')];var _0x5ef318=[];var _0x3cef7d=[];for(var _0x2b7aff in _0x3c6365){if(_0x3c6365[_0xf748('0xf')](_0x2b7aff)){_0x273e2d[_0xf748('0x10')]=0x2;_0x273e2d[_0xf748('0x11')]=[];_0x273e2d['extension']=_[_0xf748('0x12')](_0x96b899,{'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')]});_0x273e2d['extensions'][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':'Set','appdata':util[_0xf748('0x15')](_0xf748('0x16'),_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')]),'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});if(_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')]===_0xf748('0x19')){_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0]['type'],'app':'Set','appdata':_0xf748('0x1a')+_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')],'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d['priority']++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});}else if(_0x3c6365[_0x2b7aff][0x0]['type']===_0xf748('0x1b')){if(_0x273e2d[_0xf748('0x1c')]){_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':'Set','appdata':_0xf748('0x1d')+(_0x273e2d[_0xf748('0x1c')]['cutdigits']?_0xf748('0x1e')+_0x273e2d['extension'][_0xf748('0x1f')]+'}':'${EXTEN}'),'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0]['exten'],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0]['VoiceExtensionId']});}_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':'CDR(routeid)='+_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')],'context':_0x3c6365[_0x2b7aff][0x0]['context'],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0]['VoiceExtensionId']});var _0x3bae68=_0x273e2d[_0xf748('0x10')]++;_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x21'),'appdata':_0xf748('0x22')+(_0x3bae68+0x2)+_0xf748('0x23')+(_0x3bae68+0x1)+')','context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x3bae68,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});if(_0x273e2d[_0xf748('0x1c')]){_0x273e2d['extensions'][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0]['type'],'app':_0xf748('0x20'),'appdata':_0x273e2d['extension'][_0xf748('0x1f')]?_0xf748('0x24')+_0x273e2d[_0xf748('0x1c')][_0xf748('0x1f')]+'}':'CDR(prefix)=noprefix','context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0]['exten'],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});}_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':_0xf748('0x25')+_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')],'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0]['VoiceExtensionId']});if(_0x273e2d['extension']&&_0x273e2d['extension']['hasOwnProperty'](_0xf748('0x26'))&&_0x273e2d['extension'][_0xf748('0x26')]!=='none'){_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0]['type'],'app':'Set','appdata':_0xf748('0x27'),'context':_0x3c6365[_0x2b7aff][0x0]['context'],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':_0xf748('0x28')+_0x273e2d[_0xf748('0x1c')][_0xf748('0x26')]||_0xf748('0x29'),'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0]['exten'],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});}}_0x273e2d['extensions'][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0]['type'],'app':_0xf748('0x20'),'appdata':_0xf748('0x2a'),'context':_0x3c6365[_0x2b7aff][0x0]['context'],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':'Set','appdata':_0xf748('0x2b'),'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'priority':_0x273e2d[_0xf748('0x10')]++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':_0xf748('0x2c'),'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'exten':_0x3c6365[_0x2b7aff][0x0]['exten'],'priority':_0x273e2d['priority']++,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});for(var _0x56285f=0x0,_0x508d8c=0x0;_0x56285f<_0x3c6365[_0x2b7aff][_0xf748('0x2d')];_0x56285f+=0x1,_0x508d8c=0x0){var _0x5461f3=_0x3c6365[_0x2b7aff][_0x56285f];if(_0x5461f3[_0xf748('0x14')]){_0x5461f3[_0xf748('0x14')]=_0x5461f3[_0xf748('0x14')]['toLowerCase']();}var _0x4c7d69=[];var _0x5821af=[];delete _0x5461f3['id'];delete _0x5461f3[_0xf748('0x2e')];delete _0x5461f3[_0xf748('0x2f')];var _0x55d950=_0x5461f3[_0xf748('0x30')]!==_0xf748('0x31')?[_0x5461f3[_0xf748('0x30')]]:_0x5461f3[_0xf748('0x7')]?_[_0xf748('0x9')](_[_0xf748('0xa')](_0x273e2d[_0xf748('0x5')],{'IntervalId':_0x5461f3[_0xf748('0x7')]}),_0xf748('0x30')):[];if(_0x5461f3['hasOwnProperty'](_0xf748('0x32'))){if(_0x5461f3[_0xf748('0x32')]&&_0x5461f3[_0xf748('0x32')]!=='--'){_0x4c7d69[_0xf748('0x13')]({'type':_0x5461f3['type'],'app':_0xf748('0x20'),'appdata':'CDR(tag)='+_0x5461f3[_0xf748('0x32')],'context':_0x5461f3['context'],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950[_0xf748('0x2d')]+_0x273e2d[_0xf748('0x10')]+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});}}if(_0x5461f3['type']==='outbound'&&_0x5461f3[_0xf748('0xf')](_0xf748('0x33'))){if(_0x5461f3[_0xf748('0x33')]){_0x4c7d69[_0xf748('0x13')]({'type':_0x5461f3['type'],'app':_0xf748('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5461f3[_0xf748('0x33')]+')','context':_0x5461f3[_0xf748('0x17')],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950[_0xf748('0x2d')]+_0x273e2d[_0xf748('0x10')]+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});}else{_0x4c7d69['push']({'type':_0x5461f3['type'],'app':_0xf748('0x21'),'appdata':_0xf748('0x34'),'context':_0x5461f3[_0xf748('0x17')],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950['length']+_0x273e2d[_0xf748('0x10')]+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});}}if(_0x5461f3[_0xf748('0xf')](_0xf748('0x35'))){if(_0x4a433b[_0xf748('0x36')](_0x5461f3['app'][_0xf748('0x37')]())>=0x0&&_0x5461f3[_0xf748('0x38')]!==_0xf748('0x39')){if(_0x5461f3[_0xf748('0x35')]){_0x4c7d69[_0xf748('0x13')]({'type':_0x5461f3[_0xf748('0x14')],'app':_0xf748('0x21'),'appdata':_0xf748('0x3a'),'context':_0x5461f3['context'],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950['length']+_0x273e2d['priority']+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});_0x4c7d69['push']({'type':_0x5461f3[_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':_0xf748('0x3b'),'context':_0x5461f3[_0xf748('0x17')],'exten':_0x5461f3['exten'],'priority':_0x55d950[_0xf748('0x2d')]+_0x273e2d['priority']+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});}else{_0x4c7d69[_0xf748('0x13')]({'type':_0x5461f3[_0xf748('0x14')],'app':_0xf748('0x21'),'appdata':_0xf748('0x3c'),'context':_0x5461f3['context'],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950[_0xf748('0x2d')]+_0x273e2d['priority']+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});_0x4c7d69[_0xf748('0x13')]({'type':_0x5461f3[_0xf748('0x14')],'app':_0xf748('0x20'),'appdata':_0xf748('0x3d'),'context':_0x5461f3[_0xf748('0x17')],'exten':_0x5461f3[_0xf748('0xc')],'priority':_0x55d950['length']+_0x273e2d[_0xf748('0x10')]+_0x508d8c++,'VoiceExtensionId':_0x5461f3[_0xf748('0x18')]});}}}for(var _0x4e9a15=0x0;_0x4e9a15<_0x55d950[_0xf748('0x2d')];_0x4e9a15+=0x1){var _0x3197ec=_0x273e2d[_0xf748('0x10')]+_0x55d950[_0xf748('0x2d')];var _0x1b2446=_0x4e9a15===_0x55d950[_0xf748('0x2d')]-0x1?_0x273e2d[_0xf748('0x10')]+_0x4c7d69[_0xf748('0x2d')]+_0x5821af[_0xf748('0x2d')]+0x2:_0x273e2d[_0xf748('0x10')]+_0x4e9a15+0x1;_0x4c7d69[_0xf748('0x3e')](_0x4e9a15,0x0,{'type':_0x5461f3[_0xf748('0x14')],'app':'GotoIfTime','appdata':_0x55d950[_0x4e9a15]+'?'+_0x5461f3[_0xf748('0x17')]+_0xf748('0x3f')+_0x3197ec+':'+_0x5461f3[_0xf748('0x17')]+_0xf748('0x3f')+_0x1b2446,'exten':_0x5461f3[_0xf748('0xc')],'context':_0x5461f3['context'],'priority':_0x273e2d[_0xf748('0x10')]+_0x4e9a15,'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0]['VoiceExtensionId']});}_0x5461f3[_0xf748('0x10')]=_0x4c7d69['length']?_[_0xf748('0x40')](_0x4c7d69)['priority']+0x1:_0x273e2d[_0xf748('0x10')];_0x273e2d['priority']=(_0x5821af[_0xf748('0x2d')]?_[_0xf748('0x40')](_0x5821af)[_0xf748('0x10')]:_0x5461f3[_0xf748('0x10')])+0x1;_0x273e2d[_0xf748('0x11')]=_['concat'](_0x273e2d['extensions'],_0x4c7d69,[_0x5461f3],_0x5821af);}_0x273e2d[_0xf748('0x11')][_0xf748('0x13')]({'type':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x14')],'app':_0xf748('0x41'),'exten':_0x3c6365[_0x2b7aff][0x0][_0xf748('0xc')],'context':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x17')],'priority':_0x273e2d['priority'],'VoiceExtensionId':_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]});_0x5ef318[_0xf748('0x13')](_0x3c6365[_0x2b7aff][0x0][_0xf748('0x18')]);_0x3cef7d=_['concat'](_0x3cef7d,_0x273e2d['extensions']);}}return _0xa1147c['transaction'](function(_0x52d7e7){return _0xa1147c[_0xf748('0x1')][_0xf748('0x6')][_0xf748('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x5ef318}},'transaction':_0x52d7e7})['then'](function(_0x520ff4){return _0xa1147c[_0xf748('0x1')][_0xf748('0x6')]['bulkCreate'](_['sortBy'](_0x3cef7d,_0xf748('0x10')),{'transaction':_0x52d7e7});});});})[_0xf748('0x43')](function(_0x52e2c2){console['error'](_0x52e2c2);});}exports[_0xf748('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 57c38d3..fa3451c 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 _0x61a4=['ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','Lists','then','get','sequelize','query','onlyIfOpen','VoiceQueueId','all','findAll','BlackLists','Campaign','CmList','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','split','createReadStream','duplicate','CSV\x20parsed\x20correctly!','info','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_hopper','createdAt'];(function(_0xfda19a,_0x1104d8){var _0x425afc=function(_0x5bcaee){while(--_0x5bcaee){_0xfda19a['push'](_0xfda19a['shift']());}};_0x425afc(++_0x1104d8);}(_0x61a4,0x178));var _0x461a=function(_0x53618b,_0x3d170f){_0x53618b=_0x53618b-0x0;var _0x41932b=_0x61a4[_0x53618b];return _0x41932b;};'use strict';var BPromise=require(_0x461a('0x0'));var util=require(_0x461a('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x461a('0x2'));var Redis=require(_0x461a('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x461a('0x4'));var logger=require(_0x461a('0x5'))(_0x461a('0x6'));config[_0x461a('0x7')]=_[_0x461a('0x8')](config[_0x461a('0x7')],{'host':_0x461a('0x9'),'port':0x18eb});var socket=require(_0x461a('0xa'))(new Redis(config[_0x461a('0x7')]));require(_0x461a('0xb'))[_0x461a('0xc')](socket);try{if(!process[_0x461a('0xd')][0x2]||process['argv'][0x2]===_0x461a('0xe')||process['argv'][0x2]===_0x461a('0xf')){throw new Error(_0x461a('0x10'));}var FILEPATH=process[_0x461a('0xd')][0x2];if(!process[_0x461a('0xd')][0x3]||process[_0x461a('0xd')][0x3]===_0x461a('0xe')||process['argv'][0x3]===_0x461a('0xf')||!process[_0x461a('0xd')][0x4]||process[_0x461a('0xd')][0x4]===_0x461a('0xe')||process[_0x461a('0xd')][0x4]===_0x461a('0xf')){throw new Error(_0x461a('0x11'));}var FIELDS=_['zipObject'](process[_0x461a('0xd')][0x3]['split'](','),process[_0x461a('0xd')][0x4]['split'](','));if(!process[_0x461a('0xd')][0x5]||process[_0x461a('0xd')][0x5]==='undefined'||process[_0x461a('0xd')][0x5]===_0x461a('0xf')){throw new Error(_0x461a('0x12'));}var LISTID=process[_0x461a('0xd')][0x5];var COMPANYID=process[_0x461a('0xd')][0x6]&&process['argv'][0x6]!==_0x461a('0xe')&&process['argv'][0x6]!==_0x461a('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x461a('0xd')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x461a('0xd')][0x7]!==_0x461a('0xf')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x461a('0xe')||process[_0x461a('0xd')][0x8]==='null'){throw new Error(_0x461a('0x13'));}var SOCKET_TIMESTAMP=process[_0x461a('0xd')][0x8];}catch(_0x1d689c){logger['error'](_0x1d689c);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(_0x48b0d8,_0x248b92,_0x2fd8de,_0x2c5f4e){var _0xf36097={'message':_0x248b92};_0xf36097[_0x48b0d8]=!![];if(_0x2fd8de){_0xf36097[_0x461a('0x14')]=_0x2fd8de;}if(_0x2c5f4e){_0xf36097[_0x461a('0x15')]=_0x2c5f4e;}return _0xf36097;}function isEmail(_0x4165f4){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))*$/[_0x461a('0x16')](_0x4165f4);}function checkRow(_0x3b5eb6,_0x5cbcdd,_0x1a6e1c){return new BPromise(function(_0x3e6bd3,_0x3422a8){if(_[_0x461a('0x17')](_0x3b5eb6)){return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x461a('0x19'),null,_0x1a6e1c));}if(_0x3b5eb6[_0x461a('0x1a')]&&_0x3b5eb6['errors'][_0x461a('0x1b')]){var _0x173d43=_['map'](_0x3b5eb6[_0x461a('0x1a')],_0x461a('0x1c'))['join'](';');return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x173d43,null,_0x1a6e1c));}var _0x43ed2a={};for(var _0x35b5e2 in FIELDS){if(FIELDS['hasOwnProperty'](_0x35b5e2)&&FIELDS[_0x35b5e2]){_0x43ed2a[_0x35b5e2]=_0x3b5eb6[_0x461a('0x1d')][0x0][FIELDS[_0x35b5e2]]||_0x3b5eb6[_0x461a('0x1d')][0x0]['\ufeff'+FIELDS[_0x35b5e2]];}}if(!_0x43ed2a[_0x461a('0x1e')]){return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x461a('0x1f'),null,_0x1a6e1c));}if(!_0x43ed2a['phone']){return _0x3422a8(handleCheckRowError('error',_0x461a('0x20'),null,_0x1a6e1c));}if(_0x43ed2a[_0x461a('0x21')]){var _0x4192d7=moment(_0x43ed2a['birthDate'],_0x461a('0x22'));if(!_0x4192d7['isValid']()){return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x461a('0x23'),null,_0x1a6e1c));}}if(_0x43ed2a[_0x461a('0x24')]){if(!isEmail(_0x43ed2a[_0x461a('0x24')])){return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x461a('0x25'),null,_0x1a6e1c));}}_0x43ed2a['ListId']=LISTID;_0x43ed2a[_0x461a('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x461a('0x1b')]&&_0x5cbcdd){var _0x5732df={};for(var _0x4741ea=0x0,_0x5c0b6f=DUPLICATES['length'];_0x4741ea<_0x5c0b6f;_0x4741ea+=0x1){_0x5732df[DUPLICATES[_0x4741ea]]=_0x43ed2a[DUPLICATES[_0x4741ea]];}var _0x57558a=_[_0x461a('0x27')](_0x5cbcdd,_0x5732df);if(_0x57558a){return _0x3422a8(handleCheckRowError('duplicate',_0x461a('0x28'),_0x57558a,_0x1a6e1c));}}return db[_0x461a('0x29')][_0x461a('0x2a')](_0x43ed2a,{'raw':!![],'hooks':![],'fields':_[_0x461a('0x2b')](_0x43ed2a)})['then'](function(_0x39e202){if(DUPLICATES&&DUPLICATES[_0x461a('0x1b')]&&_0x5cbcdd){_0x5cbcdd[_0x461a('0x2c')](_[_0x461a('0x2d')](_0x43ed2a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x39e202['id'];return _0x3e6bd3();})[_0x461a('0x2e')](function(_0x521544){return _0x3422a8(handleCheckRowError(_0x461a('0x18'),_0x461a('0x2f')+(_0x521544[_0x461a('0x1c')]||JSON[_0x461a('0x30')](_0x521544)),null,_0x1a6e1c));});});}function checkHopper(){function _0xc29390(){return function(_0xf856d3){logger[_0x461a('0x18')]('cmContact',_0x461a('0x31'),util[_0x461a('0x32')](_0xf856d3,{'showHidden':![],'depth':null}));};}var _0x6cd8ef=function(_0x36505d,_0x283ae5){var _0x18c100=squel[_0x461a('0x33')]()[_0x461a('0x34')]('cm_hopper')[_0x461a('0x35')]([_0x461a('0x36'),_0x461a('0x37'),_0x461a('0x38'),_0x461a('0x39'),_0x283ae5,'createdAt',_0x461a('0x3a')],squel[_0x461a('0x3b')]()[_0x461a('0x3c')](_0x461a('0x36'),'phone')[_0x461a('0x3c')](_0x461a('0x3d'),_0x461a('0x37'))[_0x461a('0x3c')]('id',_0x461a('0x38'))[_0x461a('0x3c')](LISTID['toString'](),_0x461a('0x39'))[_0x461a('0x3c')](_0x36505d['id'][_0x461a('0x3e')](),_0x283ae5)[_0x461a('0x3c')]('NOW()','createdAt')[_0x461a('0x3c')]('NOW()','updatedAt')['from'](_0x461a('0x3f'))['where'](_0x461a('0x40'))[_0x461a('0x41')]('ListId\x20=\x20?',LISTID[_0x461a('0x3e')]())[_0x461a('0x41')](_0x461a('0x42'))[_0x461a('0x41')](_0x461a('0x43'),squel[_0x461a('0x3b')]()[_0x461a('0x3c')]('phone')[_0x461a('0x44')]('cm_hopper')[_0x461a('0x41')](_0x283ae5+_0x461a('0x45'),_0x36505d['id'][_0x461a('0x3e')]())))[_0x461a('0x3e')]();return _0x18c100;};var _0x45b44d=function(_0x4335b4,_0x550fb4){var _0x3415d9=squel['insert']()[_0x461a('0x34')](_0x461a('0x46'))[_0x461a('0x35')]([_0x461a('0x36'),_0x461a('0x37'),_0x461a('0x38'),_0x461a('0x39'),_0x550fb4,_0x461a('0x47'),_0x461a('0x3a')],squel[_0x461a('0x3b')]()[_0x461a('0x3c')](_0x461a('0x36'),_0x461a('0x36'))['field'](_0x461a('0x3d'),_0x461a('0x37'))[_0x461a('0x3c')]('id','ContactId')[_0x461a('0x3c')](LISTID['toString'](),_0x461a('0x39'))[_0x461a('0x3c')](_0x4335b4['id']['toString'](),_0x550fb4)[_0x461a('0x3c')](_0x461a('0x3d'),_0x461a('0x47'))[_0x461a('0x3c')](_0x461a('0x3d'),'updatedAt')[_0x461a('0x44')](_0x461a('0x3f'))[_0x461a('0x41')](_0x461a('0x40'))[_0x461a('0x41')](_0x461a('0x48'),LISTID[_0x461a('0x3e')]())[_0x461a('0x41')](_0x461a('0x49'),squel[_0x461a('0x4a')](hopperContacts))['where'](_0x461a('0x42'))[_0x461a('0x41')](_0x461a('0x43'),squel[_0x461a('0x3b')]()[_0x461a('0x3c')](_0x461a('0x4b'))[_0x461a('0x44')](_0x461a('0x4c'))[_0x461a('0x41')](_0x550fb4+_0x461a('0x45'),_0x4335b4['id'][_0x461a('0x3e')]()))[_0x461a('0x41')](_0x461a('0x43'),squel[_0x461a('0x3b')]()[_0x461a('0x3c')](_0x461a('0x36'))['from']('cm_hopper')[_0x461a('0x41')](_0x550fb4+_0x461a('0x45'),_0x4335b4['id'][_0x461a('0x3e')]())))[_0x461a('0x3e')]();return _0x3415d9;};function _0x48bb82(_0x1b6a37,_0x1ccb49){var _0x2307cd=squel[_0x461a('0x33')]()[_0x461a('0x34')](_0x461a('0x46'))[_0x461a('0x35')]([_0x461a('0x36'),_0x461a('0x37'),_0x461a('0x38'),'ListId',_0x1ccb49,_0x461a('0x47'),_0x461a('0x3a')],squel[_0x461a('0x3b')]()[_0x461a('0x3c')](_0x461a('0x36'),'phone')[_0x461a('0x3c')](_0x461a('0x3d'),'scheduledAt')[_0x461a('0x3c')]('id',_0x461a('0x38'))[_0x461a('0x3c')](LISTID[_0x461a('0x3e')](),_0x461a('0x39'))[_0x461a('0x3c')](_0x1b6a37['id'][_0x461a('0x3e')](),_0x1ccb49)[_0x461a('0x3c')](_0x461a('0x3d'),_0x461a('0x47'))[_0x461a('0x3c')](_0x461a('0x3d'),_0x461a('0x3a'))[_0x461a('0x44')]('cm_contacts')[_0x461a('0x41')](_0x461a('0x40'))[_0x461a('0x41')]('ListId\x20=\x20?',LISTID[_0x461a('0x3e')]())[_0x461a('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x461a('0x42')))[_0x461a('0x3e')]();return _0x2307cd;}function _0x3b9205(_0x4398b5,_0x167f58){var _0x490291=squel[_0x461a('0x33')]()[_0x461a('0x34')](_0x461a('0x4d'))['fromQuery']([_0x461a('0x36'),'ContactId',_0x461a('0x39'),_0x167f58,_0x461a('0x47'),'updatedAt'],squel[_0x461a('0x3b')]()['field'](_0x461a('0x36'),_0x461a('0x36'))[_0x461a('0x3c')]('id',_0x461a('0x38'))[_0x461a('0x3c')](LISTID[_0x461a('0x3e')](),_0x461a('0x39'))[_0x461a('0x3c')](_0x4398b5['id'][_0x461a('0x3e')](),_0x167f58)[_0x461a('0x3c')](_0x461a('0x3d'),_0x461a('0x47'))['field'](_0x461a('0x3d'),_0x461a('0x3a'))['from'](_0x461a('0x3f'))[_0x461a('0x41')]('deletedAt\x20IS\x20NULL')[_0x461a('0x41')](_0x461a('0x48'),LISTID[_0x461a('0x3e')]())[_0x461a('0x41')](_0x461a('0x49'),squel[_0x461a('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x490291;}return db[_0x461a('0x4e')]['findAll']({'where':{'type':_0x461a('0x4f')},'attributes':['id',_0x461a('0x50')],'include':[{'model':db['CmList'],'as':_0x461a('0x51'),'where':{'id':LISTID}}]})[_0x461a('0x52')](function(_0x1a7155){var _0x420831=[];if(_0x1a7155){var _0x22c563;for(var _0x5aa5f2=0x0,_0x5e6f34;_0x5aa5f2<_0x1a7155[_0x461a('0x1b')];_0x5aa5f2+=0x1){_0x5e6f34=_0x1a7155[_0x5aa5f2][_0x461a('0x53')]({'plain':!![]});switch(_0x5e6f34['dialCheckDuplicateType']){case'always':_0x420831['push'](db[_0x461a('0x54')][_0x461a('0x55')](_0x45b44d(_0x5e6f34,'VoiceQueueId'))[_0x461a('0x52')](function(){})[_0x461a('0x2e')](_0xc29390()));break;case _0x461a('0x56'):_0x420831[_0x461a('0x2c')](db[_0x461a('0x54')]['query'](_0x6cd8ef(_0x5e6f34,_0x461a('0x57')))[_0x461a('0x52')](function(){})['catch'](_0xc29390()));break;default:_0x420831[_0x461a('0x2c')](db[_0x461a('0x54')][_0x461a('0x55')](_0x48bb82(_0x5e6f34,_0x461a('0x57')))[_0x461a('0x52')](function(){})[_0x461a('0x2e')](_0xc29390()));}}}return _0x420831;})[_0x461a('0x58')]()[_0x461a('0x52')](function(){return db[_0x461a('0x4e')][_0x461a('0x59')]({'where':{'type':_0x461a('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x461a('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x35a217){var _0x5b493e=[];if(_0x35a217){var _0x2a0b9b;for(var _0x59ec37=0x0,_0x2516b0;_0x59ec37<_0x35a217[_0x461a('0x1b')];_0x59ec37+=0x1){_0x2516b0=_0x35a217[_0x59ec37]['get']({'plain':!![]});_0x5b493e['push'](db['sequelize'][_0x461a('0x55')](_0x3b9205(_0x2516b0,'VoiceQueueId'))[_0x461a('0x52')](function(){})[_0x461a('0x2e')](_0xc29390()));}}return _0x5b493e;})['all']();})['then'](function(){return db[_0x461a('0x5b')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x461a('0x5c')],'as':_0x461a('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x429110){var _0x3bd63c=[];if(_0x429110){for(var _0x3758a4=0x0,_0x3f596d;_0x3758a4<_0x429110[_0x461a('0x1b')];_0x3758a4+=0x1){_0x3f596d=_0x429110[_0x3758a4][_0x461a('0x53')]({'plain':!![]});switch(_0x3f596d['dialCheckDuplicateType']){case _0x461a('0x5d'):_0x3bd63c['push'](db[_0x461a('0x54')][_0x461a('0x55')](_0x45b44d(_0x3f596d,_0x461a('0x5e')))[_0x461a('0x52')](function(){})[_0x461a('0x2e')](_0xc29390()));break;case'onlyIfOpen':_0x3bd63c[_0x461a('0x2c')](db[_0x461a('0x54')]['query'](_0x6cd8ef(_0x3f596d,_0x461a('0x5e')))[_0x461a('0x52')](function(){})['catch'](_0xc29390()));break;default:_0x3bd63c[_0x461a('0x2c')](db[_0x461a('0x54')][_0x461a('0x55')](_0x48bb82(_0x3f596d,'CampaignId'))[_0x461a('0x52')](function(){})['catch'](_0xc29390()));}}}return _0x3bd63c;})['all']();})[_0x461a('0x52')](function(){return db[_0x461a('0x5b')][_0x461a('0x59')]({'attributes':['id'],'include':[{'model':db[_0x461a('0x5c')],'as':_0x461a('0x5a'),'where':{'id':LISTID}}]})[_0x461a('0x52')](function(_0x2588c2){var _0x13a272=[];if(_0x2588c2){for(var _0x2a3a90=0x0,_0x42000f;_0x2a3a90<_0x2588c2[_0x461a('0x1b')];_0x2a3a90+=0x1){_0x42000f=_0x2588c2[_0x2a3a90][_0x461a('0x53')]({'plain':!![]});_0x13a272[_0x461a('0x2c')](db[_0x461a('0x54')][_0x461a('0x55')](_0x3b9205(_0x42000f,'CampaignId'))['then'](function(){})['catch'](_0xc29390()));}}return _0x13a272;})[_0x461a('0x58')]();})[_0x461a('0x2e')](function(_0x4db161){logger['error'](_0x461a('0x5f'),_0x461a('0x60'),_0x4db161[_0x461a('0x1c')]);});}var processPromises=function(_0x2d30a3){return BPromise['all'](promises)[_0x461a('0x52')](function(_0x3a31f5){})[_0x461a('0x2e')](function(_0x4663f2){logger[_0x461a('0x18')](_0x461a('0x61'),JSON[_0x461a('0x30')](_0x4663f2));})[_0x461a('0x62')](function(){socket['emit'](_0x461a('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2d30a3){return _0x2d30a3[_0x461a('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x461a('0x52')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x461a('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x461a('0x65')](FILEPATH);}catch(_0x56f291){logger['error'](_0x461a('0x66'),JSON[_0x461a('0x30')](_0x56f291));}finally{process['exit'](0x0);}});};process['on'](_0x461a('0x67'),function(){logger['info'](_0x461a('0x68'));endCsv();});function main(){return BPromise[_0x461a('0x69')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x461a('0x6a')](',');return db['CmContact'][_0x461a('0x59')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x461a('0x52')](function(_0x26c87d){var _0x43755e=fs[_0x461a('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x43755e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2af709,_0x8158d8){total+=0x1;var _0x3f996b=total;promises[_0x461a('0x2c')](checkRow(_0x2af709,_0x26c87d,_0x3f996b)[_0x461a('0x52')](function(){success+=0x1;})[_0x461a('0x2e')](function(_0x3813bb){if(_0x3813bb['error']){errors+=0x1;delete _0x3813bb[_0x461a('0x18')];}else if(_0x3813bb[_0x461a('0x6c')]){duplicates+=0x1;delete _0x3813bb[_0x461a('0x6c')];}rows['push'](_0x3813bb);}));if(total%0xc8===0x0){_0x8158d8['pause']();return processPromises(_0x8158d8);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x461a('0x6d'));endCsv();});},'error':function(_0x4de975,_0x495e77){logger[_0x461a('0x6e')]('CSV\x20parse\x20error',JSON[_0x461a('0x30')](_0x4de975));endCsv();}});})[_0x461a('0x2e')](function(_0xd2479b){logger[_0x461a('0x18')](_0x461a('0x6f'),JSON[_0x461a('0x30')](_0xd2479b));});}main(); \ No newline at end of file +var _0x0499=['Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','fromQuery','scheduledAt','updatedAt','select','field','NOW()','ContactId','toString','createdAt','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','into','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','findAll','CmList','BlackLists','Campaign','Lists','CampaignId','all','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','parse','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','find','duplicate'];(function(_0x20a0c7,_0x375a18){var _0x5023cb=function(_0x317164){while(--_0x317164){_0x20a0c7['push'](_0x20a0c7['shift']());}};_0x5023cb(++_0x375a18);}(_0x0499,0x182));var _0x9049=function(_0x304e3e,_0x87826a){_0x304e3e=_0x304e3e-0x0;var _0x18e910=_0x0499[_0x304e3e];return _0x18e910;};'use strict';var BPromise=require(_0x9049('0x0'));var util=require(_0x9049('0x1'));var _=require(_0x9049('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x9049('0x3'));var Redis=require(_0x9049('0x4'));var db=require(_0x9049('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x9049('0x6'))('api');config[_0x9049('0x7')]=_[_0x9049('0x8')](config[_0x9049('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x9049('0x9'))(new Redis(config['redis']));require(_0x9049('0xa'))['register'](socket);try{if(!process[_0x9049('0xb')][0x2]||process[_0x9049('0xb')][0x2]===_0x9049('0xc')||process[_0x9049('0xb')][0x2]==='null'){throw new Error(_0x9049('0xd'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x9049('0xb')][0x3]==='undefined'||process['argv'][0x3]===_0x9049('0xe')||!process[_0x9049('0xb')][0x4]||process[_0x9049('0xb')][0x4]===_0x9049('0xc')||process[_0x9049('0xb')][0x4]===_0x9049('0xe')){throw new Error(_0x9049('0xf'));}var FIELDS=_['zipObject'](process[_0x9049('0xb')][0x3][_0x9049('0x10')](','),process[_0x9049('0xb')][0x4][_0x9049('0x10')](','));if(!process['argv'][0x5]||process[_0x9049('0xb')][0x5]===_0x9049('0xc')||process['argv'][0x5]==='null'){throw new Error(_0x9049('0x11'));}var LISTID=process[_0x9049('0xb')][0x5];var COMPANYID=process[_0x9049('0xb')][0x6]&&process['argv'][0x6]!==_0x9049('0xc')&&process[_0x9049('0xb')][0x6]!=='null'?process[_0x9049('0xb')][0x6]:null;var DUPLICATES=process[_0x9049('0xb')][0x7]&&process[_0x9049('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!=='null'?process[_0x9049('0xb')][0x7]:null;if(!process[_0x9049('0xb')][0x8]||process[_0x9049('0xb')][0x8]==='undefined'||process['argv'][0x8]===_0x9049('0xe')){throw new Error(_0x9049('0x12'));}var SOCKET_TIMESTAMP=process[_0x9049('0xb')][0x8];}catch(_0x50095e){logger[_0x9049('0x13')](_0x50095e);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(_0x1121f2,_0x2b5436,_0x52350c,_0x2322ba){var _0x3b09ed={'message':_0x2b5436};_0x3b09ed[_0x1121f2]=!![];if(_0x52350c){_0x3b09ed['contact']=_0x52350c;}if(_0x2322ba){_0x3b09ed[_0x9049('0x14')]=_0x2322ba;}return _0x3b09ed;}function isEmail(_0x39add9){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))*$/[_0x9049('0x15')](_0x39add9);}function checkRow(_0x2c337f,_0x6fb49e,_0x3ec445){return new BPromise(function(_0x1513b2,_0x199665){if(_[_0x9049('0x16')](_0x2c337f)){return _0x199665(handleCheckRowError(_0x9049('0x13'),_0x9049('0x17'),null,_0x3ec445));}if(_0x2c337f[_0x9049('0x18')]&&_0x2c337f[_0x9049('0x18')][_0x9049('0x19')]){var _0xd303f3=_[_0x9049('0x1a')](_0x2c337f[_0x9049('0x18')],_0x9049('0x1b'))[_0x9049('0x1c')](';');return _0x199665(handleCheckRowError(_0x9049('0x13'),_0xd303f3,null,_0x3ec445));}var _0x19a7d2={};for(var _0x32b82a in FIELDS){if(FIELDS[_0x9049('0x1d')](_0x32b82a)&&FIELDS[_0x32b82a]){_0x19a7d2[_0x32b82a]=_0x2c337f['data'][0x0][FIELDS[_0x32b82a]]||_0x2c337f[_0x9049('0x1e')][0x0]['\ufeff'+FIELDS[_0x32b82a]];}}if(!_0x19a7d2[_0x9049('0x1f')]){return _0x199665(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x3ec445));}if(!_0x19a7d2[_0x9049('0x20')]){return _0x199665(handleCheckRowError(_0x9049('0x13'),_0x9049('0x21'),null,_0x3ec445));}if(_0x19a7d2[_0x9049('0x22')]){var _0x299fca=moment(_0x19a7d2[_0x9049('0x22')],_0x9049('0x23'));if(!_0x299fca[_0x9049('0x24')]()){return _0x199665(handleCheckRowError('error',_0x9049('0x25'),null,_0x3ec445));}}if(_0x19a7d2['email']){if(!isEmail(_0x19a7d2[_0x9049('0x26')])){return _0x199665(handleCheckRowError(_0x9049('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x3ec445));}}_0x19a7d2[_0x9049('0x27')]=LISTID;_0x19a7d2['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9049('0x19')]&&_0x6fb49e){var _0x2ff16a={};for(var _0x41e3fe=0x0,_0x221a05=DUPLICATES[_0x9049('0x19')];_0x41e3fe<_0x221a05;_0x41e3fe+=0x1){_0x2ff16a[DUPLICATES[_0x41e3fe]]=_0x19a7d2[DUPLICATES[_0x41e3fe]];}var _0x3bf1b8=_[_0x9049('0x28')](_0x6fb49e,_0x2ff16a);if(_0x3bf1b8){return _0x199665(handleCheckRowError(_0x9049('0x29'),_0x9049('0x2a'),_0x3bf1b8,_0x3ec445));}}return db['CmContact'][_0x9049('0x2b')](_0x19a7d2,{'raw':!![],'hooks':![],'fields':_[_0x9049('0x2c')](_0x19a7d2)})[_0x9049('0x2d')](function(_0x58c1a2){if(DUPLICATES&&DUPLICATES[_0x9049('0x19')]&&_0x6fb49e){_0x6fb49e[_0x9049('0x2e')](_[_0x9049('0x2f')](_0x19a7d2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x58c1a2['id'];return _0x1513b2();})[_0x9049('0x30')](function(_0x39ef4c){return _0x199665(handleCheckRowError(_0x9049('0x13'),_0x9049('0x31')+(_0x39ef4c[_0x9049('0x1b')]||JSON['stringify'](_0x39ef4c)),null,_0x3ec445));});});}function checkHopper(){function _0x3b2802(){return function(_0x4c1524){logger[_0x9049('0x13')](_0x9049('0x32'),_0x9049('0x33'),util[_0x9049('0x34')](_0x4c1524,{'showHidden':![],'depth':null}));};}var _0x21326e=function(_0x51ca62,_0x5bffcd){var _0x57f8de=squel[_0x9049('0x35')]()['into']('cm_hopper')[_0x9049('0x36')]([_0x9049('0x20'),_0x9049('0x37'),'ContactId',_0x9049('0x27'),_0x5bffcd,'createdAt',_0x9049('0x38')],squel[_0x9049('0x39')]()[_0x9049('0x3a')]('phone',_0x9049('0x20'))[_0x9049('0x3a')](_0x9049('0x3b'),'scheduledAt')[_0x9049('0x3a')]('id',_0x9049('0x3c'))['field'](LISTID['toString'](),_0x9049('0x27'))[_0x9049('0x3a')](_0x51ca62['id'][_0x9049('0x3d')](),_0x5bffcd)[_0x9049('0x3a')](_0x9049('0x3b'),_0x9049('0x3e'))[_0x9049('0x3a')]('NOW()',_0x9049('0x38'))[_0x9049('0x3f')]('cm_contacts')[_0x9049('0x40')](_0x9049('0x41'))[_0x9049('0x40')]('ListId\x20=\x20?',LISTID['toString']())[_0x9049('0x40')](_0x9049('0x42'))[_0x9049('0x40')](_0x9049('0x43'),squel[_0x9049('0x39')]()[_0x9049('0x3a')]('phone')[_0x9049('0x3f')](_0x9049('0x44'))[_0x9049('0x40')](_0x5bffcd+'\x20=\x20?',_0x51ca62['id'][_0x9049('0x3d')]())))[_0x9049('0x3d')]();return _0x57f8de;};var _0x2fd9e8=function(_0x413ad9,_0x4bce06){var _0x349ddd=squel[_0x9049('0x35')]()[_0x9049('0x45')](_0x9049('0x44'))[_0x9049('0x36')]([_0x9049('0x20'),_0x9049('0x37'),_0x9049('0x3c'),_0x9049('0x27'),_0x4bce06,'createdAt','updatedAt'],squel['select']()[_0x9049('0x3a')](_0x9049('0x20'),_0x9049('0x20'))[_0x9049('0x3a')]('NOW()',_0x9049('0x37'))[_0x9049('0x3a')]('id',_0x9049('0x3c'))['field'](LISTID[_0x9049('0x3d')](),'ListId')[_0x9049('0x3a')](_0x413ad9['id'][_0x9049('0x3d')](),_0x4bce06)[_0x9049('0x3a')](_0x9049('0x3b'),_0x9049('0x3e'))[_0x9049('0x3a')](_0x9049('0x3b'),'updatedAt')[_0x9049('0x3f')](_0x9049('0x46'))[_0x9049('0x40')](_0x9049('0x41'))[_0x9049('0x40')](_0x9049('0x47'),LISTID[_0x9049('0x3d')]())['where'](_0x9049('0x48'),squel[_0x9049('0x49')](hopperContacts))[_0x9049('0x40')](_0x9049('0x42'))[_0x9049('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9049('0x39')]()[_0x9049('0x3a')]('calleridnum')[_0x9049('0x3f')](_0x9049('0x4a'))[_0x9049('0x40')](_0x4bce06+_0x9049('0x4b'),_0x413ad9['id'][_0x9049('0x3d')]()))[_0x9049('0x40')](_0x9049('0x43'),squel[_0x9049('0x39')]()['field'](_0x9049('0x20'))['from'](_0x9049('0x44'))[_0x9049('0x40')](_0x4bce06+'\x20=\x20?',_0x413ad9['id'][_0x9049('0x3d')]())))['toString']();return _0x349ddd;};function _0x58baa4(_0x447bb6,_0xf5db6a){var _0x11f7f2=squel['insert']()[_0x9049('0x45')]('cm_hopper')[_0x9049('0x36')](['phone',_0x9049('0x37'),_0x9049('0x3c'),'ListId',_0xf5db6a,_0x9049('0x3e'),_0x9049('0x38')],squel[_0x9049('0x39')]()[_0x9049('0x3a')](_0x9049('0x20'),_0x9049('0x20'))['field'](_0x9049('0x3b'),_0x9049('0x37'))['field']('id','ContactId')[_0x9049('0x3a')](LISTID[_0x9049('0x3d')](),'ListId')[_0x9049('0x3a')](_0x447bb6['id']['toString'](),_0xf5db6a)[_0x9049('0x3a')](_0x9049('0x3b'),_0x9049('0x3e'))[_0x9049('0x3a')]('NOW()',_0x9049('0x38'))[_0x9049('0x3f')]('cm_contacts')[_0x9049('0x40')](_0x9049('0x41'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x9049('0x49')](hopperContacts))[_0x9049('0x40')](_0x9049('0x42')))[_0x9049('0x3d')]();return _0x11f7f2;}function _0x14b309(_0x476139,_0x17e726){var _0x5407a0=squel[_0x9049('0x35')]()[_0x9049('0x45')](_0x9049('0x4c'))[_0x9049('0x36')]([_0x9049('0x20'),_0x9049('0x3c'),_0x9049('0x27'),_0x17e726,'createdAt',_0x9049('0x38')],squel[_0x9049('0x39')]()[_0x9049('0x3a')]('phone',_0x9049('0x20'))['field']('id',_0x9049('0x3c'))[_0x9049('0x3a')](LISTID['toString'](),_0x9049('0x27'))[_0x9049('0x3a')](_0x476139['id'][_0x9049('0x3d')](),_0x17e726)['field'](_0x9049('0x3b'),'createdAt')[_0x9049('0x3a')](_0x9049('0x3b'),_0x9049('0x38'))[_0x9049('0x3f')]('cm_contacts')[_0x9049('0x40')](_0x9049('0x41'))[_0x9049('0x40')](_0x9049('0x47'),LISTID[_0x9049('0x3d')]())[_0x9049('0x40')]('id\x20IN\x20?',squel[_0x9049('0x49')](hopperContacts))[_0x9049('0x40')](_0x9049('0x42')))[_0x9049('0x3d')]();return _0x5407a0;}return db[_0x9049('0x4d')]['findAll']({'where':{'type':_0x9049('0x4e')},'attributes':['id',_0x9049('0x4f')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x9049('0x2d')](function(_0x5206a2){var _0x318e30=[];if(_0x5206a2){var _0x2d6ff7;for(var _0x29d697=0x0,_0x17dc1b;_0x29d697<_0x5206a2[_0x9049('0x19')];_0x29d697+=0x1){_0x17dc1b=_0x5206a2[_0x29d697][_0x9049('0x50')]({'plain':!![]});switch(_0x17dc1b[_0x9049('0x4f')]){case _0x9049('0x51'):_0x318e30[_0x9049('0x2e')](db[_0x9049('0x52')][_0x9049('0x53')](_0x2fd9e8(_0x17dc1b,_0x9049('0x54')))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));break;case _0x9049('0x55'):_0x318e30[_0x9049('0x2e')](db[_0x9049('0x52')][_0x9049('0x53')](_0x21326e(_0x17dc1b,_0x9049('0x54')))['then'](function(){})[_0x9049('0x30')](_0x3b2802()));break;default:_0x318e30[_0x9049('0x2e')](db[_0x9049('0x52')][_0x9049('0x53')](_0x58baa4(_0x17dc1b,_0x9049('0x54')))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));}}}return _0x318e30;})['all']()[_0x9049('0x2d')](function(){return db[_0x9049('0x4d')][_0x9049('0x56')]({'where':{'type':_0x9049('0x4e')},'attributes':['id'],'include':[{'model':db[_0x9049('0x57')],'as':_0x9049('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x75c420){var _0x44ce7f=[];if(_0x75c420){var _0x2a67c;for(var _0x61e463=0x0,_0x302dd1;_0x61e463<_0x75c420['length'];_0x61e463+=0x1){_0x302dd1=_0x75c420[_0x61e463][_0x9049('0x50')]({'plain':!![]});_0x44ce7f[_0x9049('0x2e')](db[_0x9049('0x52')][_0x9049('0x53')](_0x14b309(_0x302dd1,_0x9049('0x54')))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));}}return _0x44ce7f;})['all']();})[_0x9049('0x2d')](function(){return db[_0x9049('0x59')][_0x9049('0x56')]({'attributes':['id',_0x9049('0x4f')],'include':[{'model':db[_0x9049('0x57')],'as':_0x9049('0x5a'),'where':{'id':LISTID}}]})[_0x9049('0x2d')](function(_0x3c914b){var _0x126986=[];if(_0x3c914b){for(var _0x1f5a73=0x0,_0x387016;_0x1f5a73<_0x3c914b[_0x9049('0x19')];_0x1f5a73+=0x1){_0x387016=_0x3c914b[_0x1f5a73][_0x9049('0x50')]({'plain':!![]});switch(_0x387016[_0x9049('0x4f')]){case _0x9049('0x51'):_0x126986[_0x9049('0x2e')](db[_0x9049('0x52')][_0x9049('0x53')](_0x2fd9e8(_0x387016,_0x9049('0x5b')))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));break;case _0x9049('0x55'):_0x126986['push'](db[_0x9049('0x52')][_0x9049('0x53')](_0x21326e(_0x387016,'CampaignId'))[_0x9049('0x2d')](function(){})['catch'](_0x3b2802()));break;default:_0x126986[_0x9049('0x2e')](db['sequelize'][_0x9049('0x53')](_0x58baa4(_0x387016,'CampaignId'))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));}}}return _0x126986;})[_0x9049('0x5c')]();})[_0x9049('0x2d')](function(){return db[_0x9049('0x59')][_0x9049('0x56')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x9049('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x26faa7){var _0x332342=[];if(_0x26faa7){for(var _0x221b37=0x0,_0x3b5df1;_0x221b37<_0x26faa7['length'];_0x221b37+=0x1){_0x3b5df1=_0x26faa7[_0x221b37]['get']({'plain':!![]});_0x332342[_0x9049('0x2e')](db['sequelize'][_0x9049('0x53')](_0x14b309(_0x3b5df1,_0x9049('0x5b')))[_0x9049('0x2d')](function(){})[_0x9049('0x30')](_0x3b2802()));}}return _0x332342;})['all']();})['catch'](function(_0x46e002){logger[_0x9049('0x13')](_0x9049('0x5d'),'generalCheckHopper',_0x46e002[_0x9049('0x1b')]);});}var processPromises=function(_0x1285bf){return BPromise['all'](promises)[_0x9049('0x2d')](function(_0x3019e1){})['catch'](function(_0x29aacb){logger[_0x9049('0x13')](_0x9049('0x5e'),JSON[_0x9049('0x5f')](_0x29aacb));})[_0x9049('0x60')](function(){socket[_0x9049('0x61')](_0x9049('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1285bf){return _0x1285bf[_0x9049('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9049('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x9049('0x2d')](function(){socket[_0x9049('0x61')](_0x9049('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2862db){logger[_0x9049('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x2862db));}finally{process[_0x9049('0x64')](0x0);}});};process['on'](_0x9049('0x65'),function(){logger[_0x9049('0x66')](_0x9049('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0x9049('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9049('0x10')](',');return db[_0x9049('0x68')][_0x9049('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x19f0f9){var _0x5a0e39=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9049('0x69')](_0x5a0e39,{'header':!![],'skipEmptyLines':!![],'step':function(_0xad001a,_0x2e6b83){total+=0x1;var _0x3ba71a=total;promises[_0x9049('0x2e')](checkRow(_0xad001a,_0x19f0f9,_0x3ba71a)[_0x9049('0x2d')](function(){success+=0x1;})[_0x9049('0x30')](function(_0x169959){if(_0x169959[_0x9049('0x13')]){errors+=0x1;delete _0x169959[_0x9049('0x13')];}else if(_0x169959[_0x9049('0x29')]){duplicates+=0x1;delete _0x169959[_0x9049('0x29')];}rows[_0x9049('0x2e')](_0x169959);}));if(total%0xc8===0x0){_0x2e6b83['pause']();return processPromises(_0x2e6b83);}},'complete':function(){return processPromises()[_0x9049('0x2d')](function(){logger[_0x9049('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2ea894,_0x40339c){logger[_0x9049('0x66')]('CSV\x20parse\x20error',JSON['stringify'](_0x2ea894));endCsv();}});})['catch'](function(_0x4b9590){logger['error'](_0x9049('0x6a'),JSON[_0x9049('0x5f')](_0x4b9590));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d21fd21..54bc537 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 _0x1144=['rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','split','length','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ListId','createdAt','updatedAt','UserId','recallme','select','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','ContactId','.CmListId','.CmListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','priority','\x22onlyIfOpen\x22','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','query','spread','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','catch','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','main','stringify','send','clone','socket_timestamp','server/files/tmp','includes','header','name','_description','writeFileSync','parse','data'];(function(_0x2065e4,_0x37ba77){var _0x14b625=function(_0x497b40){while(--_0x497b40){_0x2065e4['push'](_0x2065e4['shift']());}};_0x14b625(++_0x37ba77);}(_0x1144,0x1a7));var _0x4114=function(_0x5d9b70,_0x1b26b4){_0x5d9b70=_0x5d9b70-0x0;var _0x226f1e=_0x1144[_0x5d9b70];return _0x226f1e;};'use strict';var fs=require('fs');var path=require(_0x4114('0x0'));var _=require(_0x4114('0x1'));var Papa=require(_0x4114('0x2'));var util=require('util');var BPromise=require(_0x4114('0x3'));var moment=require('moment');var squel=require(_0x4114('0x4'));var Redis=require(_0x4114('0x5'));var db=require(_0x4114('0x6'))['db'];var config=require(_0x4114('0x7'));var shared=require(_0x4114('0x8'));var logger=require(_0x4114('0x9'))('import');config[_0x4114('0xa')]=_[_0x4114('0xb')](config['redis'],{'host':_0x4114('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4114('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x4114('0xd')](_0x4114('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x4114('0xd')](_0x4114('0xe'));function isEmail(_0x32e1c0){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))*$/[_0x4114('0xf')](_0x32e1c0);}function selectNotIn(_0x5b8127,_0x18e282,_0x326a09,_0x597c24,_0x599b7f){return squel['select']()[_0x4114('0x10')]('phone')[_0x4114('0x11')](_0x597c24)['join'](_0x18e282,null,_0x18e282+_0x4114('0x12')+_0x597c24+'.'+_0x326a09)[_0x4114('0x13')](_0x597c24+'.'+_0x326a09+_0x4114('0x14')+_0x5b8127+'.'+_0x326a09)['where'](_0x18e282+_0x4114('0x15')+_0x599b7f['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2f8a37,_0x1e2eb6){promisesAdditionalPhones=[];return db[_0x4114('0x16')][_0x4114('0x17')]({'raw':!![],'attributes':['id',_0x4114('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x4114('0x19')](function(_0x23951b){if(_0x23951b!==null){var _0x561e2f=[];for(var _0x5bd5bd=0x0;_0x5bd5bd<_0x23951b['length'];_0x5bd5bd++){var _0x2c0be3=_0x23951b[_0x5bd5bd];_0x561e2f[_0x4114('0x1a')](insertAdditionalPhones(_0x2c0be3));}}Promise['all'](_0x561e2f)[_0x4114('0x19')](function(){_0x2f8a37({'val':0x1});});});});}function insertAdditionalPhones(_0x2fbfb9){return new Promise(function(_0x2a6ba7,_0xed5b20){var _0x1e0b18=_0x2fbfb9[_0x4114('0x18')];var _0x386062=_0x1e0b18[_0x4114('0x1b')](';');var _0x4c448d=[];orderBy=0x0;for(var _0x5d3353=0x0;_0x5d3353<_0x386062[_0x4114('0x1c')];_0x5d3353++){_0x4c448d[_0x4114('0x1a')](splitAdditionalPhone(_0x2fbfb9['id'],_0x386062[_0x5d3353]));}Promise['all'](_0x4c448d)[_0x4114('0x19')](function(){_0x2a6ba7({'val':_0x386062['length']});});});}function splitAdditionalPhone(_0x2c0743,_0x78db99){return new Promise(function(_0x1ab96a,_0x109c20){var _0x3d3054=_0x78db99[_0x4114('0x1b')](':');var _0x52a117=_0x3d3054[0x0];var _0x2edf66=_0x3d3054[0x1];if(!_[_0x4114('0x1d')](_0x2edf66)){var _0x3667c8=_0x2edf66[_0x4114('0x1b')]('|');var _0xe338fb=[];for(var _0xc740c9=0x0;_0xc740c9<_0x3667c8['length'];_0xc740c9++){if(_0x3667c8[_0xc740c9]!==''){var _0x4b0537=_[_0x4114('0x1e')](promisesAdditionalPhones,{'contactId':_0x2c0743,'phone':_0x3667c8[_0xc740c9]});if(_0x4b0537['length']==0x0){orderBy++;promisesAdditionalPhones[_0x4114('0x1a')]({'contactId':_0x2c0743,'contactTypeId':_0x52a117,'phone':_0x3667c8[_0xc740c9],'orderBy':orderBy});}}}_0x1ab96a({'ok':0x1});}else _0x1ab96a({'res':0x0});});}function createAdditionalPhone(_0x19e5f0,_0x63f902,_0x415c26,_0x4ac114){var _0x50a603='';var _0x19d7d6='';var _0x2c2312=_0x415c26[_0x4114('0x1b')]('§');_0x50a603=_0x2c2312[0x0];if(_0x2c2312[_0x4114('0x1c')]==0x2)_0x19d7d6=_0x2c2312[0x1];return new Promise(function(_0x1fdffd,_0x1c4a07){return db[_0x4114('0x1f')][_0x4114('0x20')]({'where':{'CmContactId':_0x19e5f0,'item':_0x50a603}})[_0x4114('0x19')](function(_0xdef668){if(_0xdef668){return db[_0x4114('0x1f')][_0x4114('0x21')]({'ItemTypeId':_0x63f902,'description':_0x19d7d6,'OrderBy':_0x4ac114},{'where':{'CmContactId':_0x19e5f0,'item':_0x50a603}})[_0x4114('0x19')](function(_0x38ffe8){_0x1fdffd({'res':_0x4114('0x22')});});}else{return db[_0x4114('0x1f')][_0x4114('0x23')]({'CmContactId':_0x19e5f0,'item':_0x50a603,'description':_0x19d7d6,'ItemTypeId':_0x63f902,'OrderBy':_0x4ac114,'ItemClass':_0x4114('0x24')})[_0x4114('0x19')](function(_0x5a1c88){_0x1fdffd({'res':_0x4114('0x25')});});}});});}function insertCmHopper(_0x2cc070,_0x240b62,_0x51bb03,_0x444235,_0x4ff6e6){var _0x5897a9=[_0x4114('0x26'),_0x4114('0x27'),_0x4114('0x28'),_0x4114('0x29'),_0x240b62+'.'+_0x444235,_0x4114('0x2a'),'cm_contacts.updatedAt',_0x4114('0x2b'),_0x4114('0x2c'),'\x22'+_0x4ff6e6+'\x22'];return squel[_0x4114('0x2d')]()[_0x4114('0x2e')](_0x4114('0x2f'))[_0x4114('0x30')]([_0x4114('0x31'),_0x4114('0x32'),'ContactId',_0x4114('0x33'),_0x444235,_0x4114('0x34'),_0x4114('0x35'),'priority',_0x4114('0x36'),_0x4114('0x37')],squel[_0x4114('0x38')]()[_0x4114('0x39')](_0x5897a9)[_0x4114('0x11')](_0x240b62)[_0x4114('0x3a')](_0x4114('0x3b'),null,_0x4114('0x3c')+_0x240b62+'.CmListId')[_0x4114('0x3a')](_0x51bb03,null,_0x51bb03+'.id\x20=\x20'+_0x240b62+'.'+_0x444235)[_0x4114('0x13')](_0x240b62+'.CmListId\x20=\x20?',_0x2cc070)['where'](_0x4114('0x3d'),NOW)['where'](_0x4114('0x3e'),selectNotIn(_0x240b62,_0x51bb03,_0x444235,_0x4114('0x2f'),[_0x4114('0x3f'),'\x22onlyIfOpen\x22']))[_0x4114('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x240b62,_0x51bb03,_0x444235,'cm_hopper',['\x22always\x22'])))[_0x4114('0x40')]();}function insertCmHopperBlack(_0x337830,_0x40d278,_0x42b40b,_0x35ad88){var _0x2ed22e=['cm_contacts.phone',_0x4114('0x28'),_0x4114('0x29'),_0x40d278+'.'+_0x35ad88,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x4114('0x2d')]()[_0x4114('0x2e')](_0x4114('0x41'))[_0x4114('0x30')]([_0x4114('0x31'),_0x4114('0x42'),_0x4114('0x33'),_0x35ad88,_0x4114('0x34'),_0x4114('0x35')],squel[_0x4114('0x38')]()['fields'](_0x2ed22e)['from'](_0x40d278)[_0x4114('0x3a')](_0x4114('0x3b'),null,_0x4114('0x3c')+_0x40d278+_0x4114('0x43'))[_0x4114('0x3a')](_0x42b40b,null,_0x42b40b+_0x4114('0x12')+_0x40d278+'.'+_0x35ad88)[_0x4114('0x13')](_0x40d278+_0x4114('0x44'),_0x337830)[_0x4114('0x13')](_0x4114('0x3d'),NOW)[_0x4114('0x13')](_0x4114('0x3e'),squel[_0x4114('0x38')]()['field'](_0x4114('0x31'))[_0x4114('0x11')](_0x4114('0x41'))[_0x4114('0x13')]('ListId\x20=\x20?',_0x337830)['where'](_0x35ad88+_0x4114('0x14')+_0x40d278+'.'+_0x35ad88)))[_0x4114('0x40')]();}function insertTzCmHopper(_0x5adac5,_0x886a8f,_0xa787b5,_0x7a21d1,_0x13500f,_0x1dde3f){var _0x19ad18=[_0x4114('0x26'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x1dde3f+_0x4114('0x45'),'cm_contacts.id',_0x4114('0x29'),_0x886a8f+'.'+_0x7a21d1,_0x4114('0x2a'),_0x4114('0x46'),_0x4114('0x2b'),_0x4114('0x2c'),'\x22'+_0x13500f+'\x22'];var _0x481062=squel['insert']()['into'](_0x4114('0x2f'))[_0x4114('0x30')](['phone',_0x4114('0x32'),'ContactId',_0x4114('0x33'),_0x7a21d1,_0x4114('0x34'),_0x4114('0x35'),_0x4114('0x47'),_0x4114('0x36'),_0x4114('0x37')],squel['select']()['fields'](_0x19ad18)['from'](_0x886a8f)[_0x4114('0x3a')](_0x4114('0x3b'),null,_0x4114('0x3c')+_0x886a8f+_0x4114('0x43'))['join'](_0xa787b5,null,_0xa787b5+'.id\x20=\x20'+_0x886a8f+'.'+_0x7a21d1)[_0x4114('0x3a')](_0x1dde3f,null,_0x1dde3f+_0x4114('0x12')+_0x886a8f+'.'+_0x7a21d1)[_0x4114('0x13')](_0x886a8f+'.CmListId\x20=\x20?',_0x5adac5)[_0x4114('0x13')](_0x4114('0x3d'),NOW)[_0x4114('0x13')](_0x4114('0x3e'),selectNotIn(_0x886a8f,_0xa787b5,_0x7a21d1,_0x4114('0x2f'),[_0x4114('0x3f'),_0x4114('0x48')]))[_0x4114('0x13')](_0x4114('0x3e'),selectNotIn(_0x886a8f,_0xa787b5,_0x7a21d1,_0x4114('0x2f'),['\x22always\x22'])))['toString']();return _0x481062;}function insertTzCmHopperBlack(_0x29f10c,_0x4e4f50,_0xb53994,_0x29fb9a){var _0x8fe5b3=[_0x4114('0x26'),'cm_contacts.id',_0x4114('0x29'),_0x4e4f50+'.'+_0x29fb9a,_0x4114('0x2a'),'cm_contacts.updatedAt'];return squel[_0x4114('0x2d')]()[_0x4114('0x2e')](_0x4114('0x41'))['fromQuery']([_0x4114('0x31'),'ContactId',_0x4114('0x33'),_0x29fb9a,'createdAt',_0x4114('0x35')],squel['select']()['fields'](_0x8fe5b3)['from'](_0x4e4f50)[_0x4114('0x3a')]('cm_contacts',null,_0x4114('0x3c')+_0x4e4f50+_0x4114('0x43'))[_0x4114('0x3a')](_0xb53994,null,_0xb53994+'.id\x20=\x20'+_0x4e4f50+'.'+_0x29fb9a)[_0x4114('0x13')](_0x4e4f50+_0x4114('0x44'),_0x29f10c)[_0x4114('0x13')](_0x4114('0x3d'),NOW)[_0x4114('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x4114('0x38')]()[_0x4114('0x10')](_0x4114('0x31'))[_0x4114('0x11')](_0x4114('0x41'))[_0x4114('0x13')](_0x4114('0x49'),_0x29f10c)[_0x4114('0x13')](_0x29fb9a+_0x4114('0x14')+_0x4e4f50+'.'+_0x29fb9a)))[_0x4114('0x40')]();}function insertCmHopperAdditionalPhones(_0x435a56){var _0x42ad3c=[_0x4114('0x4a'),_0x4114('0x4b'),_0x4114('0x4c'),_0x4114('0x4d'),_0x4114('0x4e')];return squel[_0x4114('0x2d')]()['into'](_0x4114('0x4f'))['fromQuery'](['CmHopperId','phone',_0x4114('0x50'),_0x4114('0x34'),_0x4114('0x35')],squel[_0x4114('0x38')]()['fields'](_0x42ad3c)[_0x4114('0x11')](_0x4114('0x2f'))[_0x4114('0x3a')](_0x4114('0x3b'),null,_0x4114('0x51'))[_0x4114('0x3a')](_0x4114('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x4114('0x13')](_0x4114('0x53'),_0x435a56)[_0x4114('0x13')](_0x4114('0x3d'),NOW))[_0x4114('0x40')]();}function insertCmContact(_0x522533,_0x2af7d6,_0x368b7a,_0x436b4f){var _0x517cad=_['concat'](_[_0x4114('0x54')](_0x436b4f),['ListId',_0x4114('0x55'),_0x4114('0x34'),_0x4114('0x35')]);return squel[_0x4114('0x2d')]()[_0x4114('0x2e')]('cm_contacts')['fromQuery'](_0x517cad,squel[_0x4114('0x38')]()['fields'](_0x517cad)['from'](_0x2af7d6)['where']('('+_0x368b7a[_0x4114('0x3a')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4114('0x39')](_0x368b7a)[_0x4114('0x11')]('cm_contacts')[_0x4114('0x13')](_0x4114('0x49'),_0x522533)[_0x4114('0x13')]('deletedAt\x20IS\x20NULL'))[_0x4114('0x13')]('id\x20IN\x20?',squel[_0x4114('0x38')]()['field'](_0x4114('0x56'),_0x4114('0x57'))[_0x4114('0x11')](_0x2af7d6)[_0x4114('0x58')](_0x368b7a[_0x4114('0x3a')](','))))[_0x4114('0x40')]();}function handleStop(){logger[_0x4114('0x59')](_0x4114('0x5a'));stopped=!![];}function handleUncaughtException(_0x5e52dc){logger[_0x4114('0x5b')](_0x5e52dc['message']);process[_0x4114('0x5c')](0x1);}function handleError(_0x1399cd,_0x411b68){stats[_0x4114('0x5d')]['push']({'name':_0x411b68[_0x4114('0x5e')],'message':_0x411b68[_0x4114('0x5f')],'row':_0x1399cd});}function handleQuery(_0x43250a){logger[_0x4114('0x59')](_0x43250a);return db[_0x4114('0x60')][_0x4114('0x61')](_0x43250a)[_0x4114('0x62')](function(_0x39c5bb){results[_0x4114('0x1a')](_0x39c5bb);})['catch'](function(_0x291790){logger['error'](_0x291790[_0x4114('0x5f')]);});}function updateTzCampaigns(_0x13094a){return new Promise(function(_0x2ecf7b,_0x49b979){var _0x2fa885=squel['select']()['fields'](['campaigns.id','campaigns.dialTimezone'])['from']('campaigns')[_0x4114('0x3a')](_0x4114('0x63'),null,_0x4114('0x64'))[_0x4114('0x13')](_0x4114('0x65')+_0x13094a);db['sequelize'][_0x4114('0x61')](_0x2fa885['toString']())[_0x4114('0x62')](function(_0x2b23c6){var _0x2eeef6=[];for(var _0x114ca8=0x0;_0x114ca8<_0x2b23c6[_0x4114('0x1c')];_0x114ca8++){_0x2eeef6[_0x4114('0x1a')](getTimezoneData(_0x2b23c6[_0x114ca8],tmp_campaigns));}BPromise[_0x4114('0x66')](_0x2eeef6)[_0x4114('0x19')](function(){_0x2ecf7b({'val':0x1});});})[_0x4114('0x67')](function(_0x9290cf){logger['error'](_0x9290cf[_0x4114('0x5f')]);_0x2ecf7b({'val':0x0});});});}function updateTzVoiceQueues(_0x14f51b){return new Promise(function(_0x343bc8,_0x21f33b){var _0x4e6619=squel['select']()[_0x4114('0x39')]([_0x4114('0x68'),'voice_queues.dialTimezone'])['from'](_0x4114('0x69'))[_0x4114('0x3a')](_0x4114('0x6a'),null,_0x4114('0x6b'))[_0x4114('0x13')](_0x4114('0x6c')+_0x14f51b);db['sequelize']['query'](_0x4e6619[_0x4114('0x40')]())[_0x4114('0x62')](function(_0x59284e){var _0x44017b=[];for(var _0x52e50a=0x0;_0x52e50a<_0x59284e[_0x4114('0x1c')];_0x52e50a++){_0x44017b[_0x4114('0x1a')](getTimezoneData(_0x59284e[_0x52e50a],tmp_voice_queues));}BPromise[_0x4114('0x66')](_0x44017b)['then'](function(){_0x343bc8({'val':0x1});});})[_0x4114('0x67')](function(_0x60be5){logger[_0x4114('0x5b')](_0x60be5['message']);_0x343bc8({'val':0x0});});});}function getTimezoneData(_0x1031bd,_0x277f0e){return new Promise(function(_0x16512d,_0x1109b9){var _0x4ffc2c=shared[_0x4114('0x6d')];var _0x50ff7a=_0x4ffc2c[_0x1031bd[_0x4114('0x6e')]];if(_[_0x4114('0x1d')](_0x50ff7a)){_0x16512d({'ret':0x1});}else{var _0x45aa73=_0x50ff7a['utcOffset'];var _0x8fcd0=squel['insert']()[_0x4114('0x2e')](_0x277f0e)['set']('id',_0x1031bd['id'])[_0x4114('0x6f')](_0x4114('0x70'),_0x45aa73)[_0x4114('0x6f')](_0x4114('0x6e'),_0x1031bd[_0x4114('0x6e')])['toString']();return db['sequelize']['query'](_0x8fcd0)[_0x4114('0x62')](function(_0x1087cc){_0x16512d({'ret':0x1});})[_0x4114('0x67')](function(_0x4f205a){logger[_0x4114('0x5b')](_0x4f205a[_0x4114('0x5f')]);_0x1109b9({'ret':0x1});});}});}function handleTZQuery(_0x210523){logger['info'](_0x210523);return db['sequelize']['query'](_0x210523)['spread'](function(_0x409426){})[_0x4114('0x67')](function(_0x3d9476){logger[_0x4114('0x5b')](_0x3d9476[_0x4114('0x5f')]);});}function main(_0x207cca,_0x48eb07,_0x41c970,_0x2f35d5){logger[_0x4114('0x59')](_0x4114('0x71'),_0x207cca,JSON[_0x4114('0x72')](_0x48eb07));process[_0x4114('0x73')]('start');var _0x186b0c=_0x48eb07['binding'];var _0x2c3fc6=_[_0x4114('0x74')](_0x186b0c);var _0x594004=_0x48eb07[_0x4114('0x75')];var _0x2b8e6f=path[_0x4114('0x3a')](config['root'],_0x4114('0x76'),_0x594004+'.csv');hasTZ=_[_0x4114('0x54')](_0x186b0c)[_0x4114('0x77')](_0x4114('0x6e'));var _0x5d5cc2=_['keys'](_0x186b0c)[_0x4114('0x3a')]();logger['info'](_0x4114('0x78'),_0x5d5cc2);db['ContactItemType'][_0x4114('0x17')]({'raw':!![],'attributes':['id','name']})[_0x4114('0x19')](function(_0x2f6799){for(var _0xb85fe7=0x0;_0xb85fe7<_0x2f6799['length'];_0xb85fe7++){if(_0x2f6799[_0xb85fe7][_0x4114('0x79')]in _0x186b0c){contactItemTypes[_0x4114('0x1a')](_0x2f6799[_0xb85fe7]);delete _0x2c3fc6[_0x2f6799[_0xb85fe7][_0x4114('0x79')]];hasAdditionalPhones=!![];}for(var _0x40973 in _0x186b0c){if(_0x2f6799[_0xb85fe7]['name']+_0x4114('0x7a')===_0x40973){phoneDescriptions[_0x4114('0x1a')]({'itemTypeId':_0x2f6799[_0xb85fe7]['id'],'description':_0x40973});delete _0x2c3fc6[_0x40973];}}}if(hasAdditionalPhones)_0x2c3fc6[_0x4114('0x18')]='';var _0x355839=_[_0x4114('0x54')](_0x2c3fc6)['join']();logger[_0x4114('0x59')](_0x4114('0x78'),_0x355839);fs[_0x4114('0x7b')](_0x2b8e6f,_0x355839+'\x0a');Papa[_0x4114('0x7c')](fs['createReadStream'](_0x207cca),{'header':!![],'skipEmptyLines':!![],'step':function(_0x26abe5,_0x44673a){try{for(var _0x4ed156=0x0,_0x5b1364=[];_0x4ed156<_0x26abe5[_0x4114('0x7d')][_0x4114('0x1c')];_0x4ed156++){stats[_0x4114('0x7e')]+=0x1;if(_0x26abe5[_0x4114('0x5d')][_0x4ed156]){handleError(_0x26abe5[_0x4114('0x7d')][_0x4ed156],_0x26abe5['errors'][_0x4ed156]);}else{var _0xa35226=[];var _0x54d327=[];var _0x56ef57={};for(var _0x697139 in _0x186b0c){let _0x1ce44c=contactItemTypes[_0x4114('0x7f')](_0x3d4111=>_0x3d4111[_0x4114('0x79')]===_0x697139);let _0xbb46d1=contactItemTypes['find'](_0x1c575a=>_0x1c575a[_0x4114('0x79')]+_0x4114('0x7a')===_0x697139);if(_[_0x4114('0x1d')](_0x1ce44c)&&_[_0x4114('0x1d')](_0xbb46d1)){if(_0x186b0c[_0x4114('0x80')](_0x697139)){if(_0x26abe5['data'][_0x4ed156][_0x186b0c[_0x697139]]){var _0x56dc64=_[_0x4114('0x81')](_0x26abe5[_0x4114('0x7d')][_0x4ed156][_0x186b0c[_0x697139]][_0x4114('0x82')](/"/g,'\x27'));switch(_0x697139){case _0x4114('0x32'):var _0x3c7ed4=moment(_0x56dc64,_0x4114('0xe'),!![]);if(_0x3c7ed4['isValid']()){_0x5b1364[_0x4114('0x1a')]('\x22'+_0x56dc64+'\x22');}else{_0xa35226[_0x4114('0x1a')](_0x4114('0x83'));}break;case'priority':var _0x1d2fa8=parseInt(_0x56dc64);_0x56dc64=_[_0x4114('0x84')](_0x1d2fa8)||_0x1d2fa8<0x0||_0x1d2fa8>0x4?_0x2f35d5?0x3:0x2:_0x1d2fa8;_0x5b1364['push']('\x22'+_0x56dc64+'\x22');break;case'UserId':var _0x20986e=parseInt(_0x56dc64);if(_[_0x4114('0x85')](_0x20986e)&&_[_0x4114('0x77')](_0x41c970,_0x20986e)){_0x5b1364[_0x4114('0x1a')]('\x22'+_0x20986e+'\x22');}else{_0xa35226[_0x4114('0x1a')]('agent\x20not\x20exists');}break;case _0x4114('0x86'):if(isEmail(_0x56dc64)){_0x5b1364[_0x4114('0x1a')]('\x22'+_0x56dc64+'\x22');}else{_0xa35226[_0x4114('0x1a')](_0x4114('0x87'));}break;case _0x4114('0x88'):var _0x35314f=moment(_0x56dc64,_0x4114('0x89'),!![]);if(_0x35314f[_0x4114('0x8a')]()){_0x5b1364[_0x4114('0x1a')]('\x22'+_0x56dc64+'\x22');}else{_0xa35226[_0x4114('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x4114('0x6e'):var _0x61703a=shared['timezones'];var _0x28b7aa=_0x61703a[_0x56dc64];if(!_['isNil'](_0x28b7aa)){var _0x58e079=_0x28b7aa[_0x4114('0x8b')];_0x5b1364[_0x4114('0x1a')]('\x22'+_0x56dc64+'\x22');_0x5b1364[_0x4114('0x1a')]('\x22'+_0x58e079+'\x22');}break;default:_0x5b1364[_0x4114('0x1a')]('\x22'+_0x56dc64+'\x22');}}else{switch(_0x697139){case _0x4114('0x8c'):case _0x4114('0x31'):_0xa35226[_0x4114('0x1a')](_0x697139+_0x4114('0x8d'));break;default:_0x5b1364[_0x4114('0x1a')]('\x22\x22');}}}}else{var _0x395712='';if(!_['isNil'](_0x1ce44c)){if(!_0x56ef57[_0x4114('0x80')](_0x1ce44c['id'])){if(!_['isNil'](_0x26abe5[_0x4114('0x7d')][_0x4ed156][_0x186b0c[_0x697139]])){var _0x56dc64=_['trim'](_0x26abe5[_0x4114('0x7d')][_0x4ed156][_0x186b0c[_0x697139]][_0x4114('0x82')](/"/g,'\x27'));var _0x146992=phoneDescriptions[_0x4114('0x7f')](_0x2df527=>_0x2df527[_0x4114('0x8e')]===_0x1ce44c['id']);if(!_[_0x4114('0x1d')](_0x146992)){var _0x484a26=_[_0x4114('0x81')](_0x26abe5['data'][_0x4ed156][_0x186b0c[_0x146992[_0x4114('0x8f')]]][_0x4114('0x82')](/"/g,'\x27'));if(!_['isNil'](_0x484a26))_0x56dc64=_0x56dc64+'§'+_0x484a26;}if(_0x395712=='')_0x395712=_0x56dc64;else _0x395712+='|'+_0x56dc64;}_0x54d327[_0x4114('0x1a')](_0x1ce44c['id']+':'+_0x395712);_0x56ef57[_0x1ce44c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5b1364[_0x4114('0x1a')]('\x22'+_0x54d327[_0x4114('0x3a')](';')+'\x22');}if(_0xa35226[_0x4114('0x1c')]){handleError(_0x26abe5['data'][_0x4ed156],{'code':'SystemRow','message':_0xa35226[_0x4114('0x3a')]()});}else{fs[_0x4114('0x90')](_0x2b8e6f,_0x5b1364[_0x4114('0x3a')]()+'\x0a');}_0x5b1364=[];}if(!(stats[_0x4114('0x7e')]%0xc8)){socket[_0x4114('0x91')](_0x4114('0x92')+_0x594004,stats);stats['errors']=[];}}if(stopped){logger[_0x4114('0x59')](_0x4114('0x93'));_0x44673a[_0x4114('0x94')]();}}catch(_0x2fb21d){handleError(_0x26abe5[_0x4114('0x7d')][_0x4ed156],{'code':'SystemError','message':_0x2fb21d[_0x4114('0x5f')]});logger[_0x4114('0x5b')](_0x4114('0x95'),_0x2fb21d[_0x4114('0x5f')]);}},'complete':function(){try{var _0x11df95=[];var _0x438544=[];var _0xda4378=_0x4114('0x3b');if(_0x48eb07[_0x4114('0x96')]&&_0x48eb07[_0x4114('0x96')][_0x4114('0x1c')]){_0xda4378=_0x4114('0x97')+_0x594004;_0x11df95[_0x4114('0x1a')](_0x4114('0x98')+_0xda4378+_0x4114('0x99'));}tmp_campaigns='campaigns_'+_0x594004;tmp_voice_queues=_0x4114('0x9a')+_0x594004;_0x438544[_0x4114('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x4114('0x9b'));_0x438544[_0x4114('0x1a')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x4114('0x9b'));BPromise[_0x4114('0x9c')](_0x438544,handleTZQuery)['then'](function(_0x5b44cc){updateTzCampaigns(_0x48eb07[_0x4114('0x33')])['then'](function(_0x2603b3){updateTzVoiceQueues(_0x48eb07['ListId'])[_0x4114('0x19')](function(_0x156372){if(hasTZ)_0x355839=_0x355839['replace'](_0x4114('0x6e'),_0x4114('0x9d'));var _0xbf308a=util['format']('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',_0x2b8e6f,_0xda4378,_0x355839,_0x48eb07[_0x4114('0x33')],_0x48eb07[_0x4114('0x55')]||null,NOW,NOW);if(_[_0x4114('0x1d')](_0x186b0c[_0x4114('0x32')])){_0xbf308a+=',\x20scheduledAt\x20=\x20NOW()';}_0x11df95[_0x4114('0x1a')](_0xbf308a);if(_0x48eb07[_0x4114('0x96')]&&_0x48eb07[_0x4114('0x96')][_0x4114('0x1c')]){_0x11df95[_0x4114('0x1a')](insertCmContact(_0x48eb07[_0x4114('0x33')],_0xda4378,_0x48eb07[_0x4114('0x96')],_0x186b0c));_0x11df95[_0x4114('0x1a')](_0x4114('0x9e')+_0xda4378+';');}BPromise['each'](_0x11df95,handleQuery)[_0x4114('0x19')](function(_0x16ddfa){BPromise[_0x4114('0x66')]([handleAdditionalPhones()])[_0x4114('0x19')](function(){_0x11df95=[];for(var _0x4f2111=0x0;_0x4f2111\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','update','create','PHONE','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.phone','insert','ListId','fields','cm_contacts','.CmListId'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xcb60,0x1ea));var _0x0cb6=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0xcb60[_0x40dd56];return _0x4f850f;};'use strict';var fs=require('fs');var path=require(_0x0cb6('0x0'));var _=require(_0x0cb6('0x1'));var Papa=require('papaparse');var util=require(_0x0cb6('0x2'));var BPromise=require(_0x0cb6('0x3'));var moment=require(_0x0cb6('0x4'));var squel=require(_0x0cb6('0x5'));var Redis=require(_0x0cb6('0x6'));var db=require(_0x0cb6('0x7'))['db'];var config=require(_0x0cb6('0x8'));var shared=require(_0x0cb6('0x9'));var logger=require(_0x0cb6('0xa'))(_0x0cb6('0xb'));config[_0x0cb6('0xc')]=_[_0x0cb6('0xd')](config[_0x0cb6('0xc')],{'host':_0x0cb6('0xe'),'port':0x18eb});var socket=require(_0x0cb6('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0cb6('0x10')](_0x0cb6('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0cb6('0x10')](_0x0cb6('0x11'));function isEmail(_0x1752fa){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))*$/[_0x0cb6('0x12')](_0x1752fa);}function selectNotIn(_0x2c3e3b,_0x5aed24,_0x1f16d1,_0x1812b6,_0x4cdaeb){return squel[_0x0cb6('0x13')]()[_0x0cb6('0x14')](_0x0cb6('0x15'))[_0x0cb6('0x16')](_0x1812b6)[_0x0cb6('0x17')](_0x5aed24,null,_0x5aed24+_0x0cb6('0x18')+_0x1812b6+'.'+_0x1f16d1)['where'](_0x1812b6+'.'+_0x1f16d1+'\x20=\x20'+_0x2c3e3b+'.'+_0x1f16d1)[_0x0cb6('0x19')](_0x5aed24+'.dialCheckDuplicateType\x20IN\x20('+_0x4cdaeb[_0x0cb6('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x8912d2,_0x12d318){promisesAdditionalPhones=[];return db[_0x0cb6('0x1a')][_0x0cb6('0x1b')]({'raw':!![],'attributes':['id',_0x0cb6('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x0cb6('0x1d')](function(_0x547f6){if(_0x547f6!==null){var _0x15bded=[];for(var _0x5c637a=0x0;_0x5c637a<_0x547f6[_0x0cb6('0x1e')];_0x5c637a++){var _0x47e5a0=_0x547f6[_0x5c637a];_0x15bded[_0x0cb6('0x1f')](insertAdditionalPhones(_0x47e5a0));}}Promise[_0x0cb6('0x20')](_0x15bded)[_0x0cb6('0x1d')](function(){_0x8912d2({'val':0x1});});});});}function insertAdditionalPhones(_0x382cb0){return new Promise(function(_0x245ac6,_0x1e9491){var _0x1be68d=_0x382cb0['AdditionalPhones'];var _0x4f5c6d=_0x1be68d[_0x0cb6('0x21')](';');var _0x377a4a=[];orderBy=0x0;for(var _0x1b079a=0x0;_0x1b079a<_0x4f5c6d[_0x0cb6('0x1e')];_0x1b079a++){_0x377a4a['push'](splitAdditionalPhone(_0x382cb0['id'],_0x4f5c6d[_0x1b079a]));}Promise[_0x0cb6('0x20')](_0x377a4a)['then'](function(){_0x245ac6({'val':_0x4f5c6d[_0x0cb6('0x1e')]});});});}function splitAdditionalPhone(_0x244694,_0x5a714c){return new Promise(function(_0x4559d2,_0x4ffee5){var _0xbebc09=_0x5a714c[_0x0cb6('0x21')](':');var _0x5245e7=_0xbebc09[0x0];var _0x1cf5a8=_0xbebc09[0x1];if(!_[_0x0cb6('0x22')](_0x1cf5a8)){var _0x56173f=_0x1cf5a8[_0x0cb6('0x21')]('|');var _0x19f5b6=[];for(var _0x39242e=0x0;_0x39242e<_0x56173f[_0x0cb6('0x1e')];_0x39242e++){if(_0x56173f[_0x39242e]!==''){var _0x4a425e=_[_0x0cb6('0x23')](promisesAdditionalPhones,{'contactId':_0x244694,'phone':_0x56173f[_0x39242e]});if(_0x4a425e[_0x0cb6('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x0cb6('0x1f')]({'contactId':_0x244694,'contactTypeId':_0x5245e7,'phone':_0x56173f[_0x39242e],'orderBy':orderBy});}}}_0x4559d2({'ok':0x1});}else _0x4559d2({'res':0x0});});}function createAdditionalPhone(_0x4c8c55,_0x701273,_0x545e6f,_0x43f3ea){var _0x5bd3be='';var _0x1d669a='';var _0x576a12=_0x545e6f[_0x0cb6('0x21')]('§');_0x5bd3be=_0x576a12[0x0];if(_0x576a12['length']==0x2)_0x1d669a=_0x576a12[0x1];return new Promise(function(_0x45702f,_0x374a76){return db[_0x0cb6('0x24')]['findOne']({'where':{'CmContactId':_0x4c8c55,'item':_0x5bd3be}})[_0x0cb6('0x1d')](function(_0x4612b4){if(_0x4612b4){return db[_0x0cb6('0x24')][_0x0cb6('0x25')]({'ItemTypeId':_0x701273,'description':_0x1d669a,'OrderBy':_0x43f3ea},{'where':{'CmContactId':_0x4c8c55,'item':_0x5bd3be}})[_0x0cb6('0x1d')](function(_0x1f3607){_0x45702f({'res':'updated'});});}else{return db[_0x0cb6('0x24')][_0x0cb6('0x26')]({'CmContactId':_0x4c8c55,'item':_0x5bd3be,'description':_0x1d669a,'ItemTypeId':_0x701273,'OrderBy':_0x43f3ea,'ItemClass':_0x0cb6('0x27')})[_0x0cb6('0x1d')](function(_0x4695f4){_0x45702f({'res':'inserted'});});}});});}function insertCmHopper(_0x39551a,_0xc89f4a,_0x52dff9,_0x506178,_0x7c3737){var _0x24ddac=['cm_contacts.phone',_0x0cb6('0x28'),_0x0cb6('0x29'),_0x0cb6('0x2a'),_0xc89f4a+'.'+_0x506178,_0x0cb6('0x2b'),_0x0cb6('0x2c'),_0x0cb6('0x2d'),'cm_contacts.UserId','\x22'+_0x7c3737+'\x22'];return squel['insert']()[_0x0cb6('0x2e')]('cm_hopper')[_0x0cb6('0x2f')]([_0x0cb6('0x15'),_0x0cb6('0x30'),_0x0cb6('0x31'),'ListId',_0x506178,_0x0cb6('0x32'),_0x0cb6('0x33'),_0x0cb6('0x34'),_0x0cb6('0x35'),_0x0cb6('0x36')],squel['select']()['fields'](_0x24ddac)['from'](_0xc89f4a)['join']('cm_contacts',null,_0x0cb6('0x37')+_0xc89f4a+'.CmListId')[_0x0cb6('0x17')](_0x52dff9,null,_0x52dff9+_0x0cb6('0x18')+_0xc89f4a+'.'+_0x506178)[_0x0cb6('0x19')](_0xc89f4a+_0x0cb6('0x38'),_0x39551a)['where'](_0x0cb6('0x39'),NOW)[_0x0cb6('0x19')](_0x0cb6('0x3a'),selectNotIn(_0xc89f4a,_0x52dff9,_0x506178,_0x0cb6('0x3b'),[_0x0cb6('0x3c'),'\x22onlyIfOpen\x22']))[_0x0cb6('0x19')](_0x0cb6('0x3a'),selectNotIn(_0xc89f4a,_0x52dff9,_0x506178,_0x0cb6('0x3b'),[_0x0cb6('0x3c')])))[_0x0cb6('0x3d')]();}function insertCmHopperBlack(_0x326403,_0xaf9d4,_0x39dcc5,_0x2b16e5){var _0x5b8adb=[_0x0cb6('0x3e'),_0x0cb6('0x29'),_0x0cb6('0x2a'),_0xaf9d4+'.'+_0x2b16e5,_0x0cb6('0x2b'),_0x0cb6('0x2c')];return squel[_0x0cb6('0x3f')]()[_0x0cb6('0x2e')]('cm_hopper_black')[_0x0cb6('0x2f')]([_0x0cb6('0x15'),'ContactId',_0x0cb6('0x40'),_0x2b16e5,'createdAt',_0x0cb6('0x33')],squel[_0x0cb6('0x13')]()[_0x0cb6('0x41')](_0x5b8adb)[_0x0cb6('0x16')](_0xaf9d4)['join'](_0x0cb6('0x42'),null,_0x0cb6('0x37')+_0xaf9d4+_0x0cb6('0x43'))[_0x0cb6('0x17')](_0x39dcc5,null,_0x39dcc5+_0x0cb6('0x18')+_0xaf9d4+'.'+_0x2b16e5)[_0x0cb6('0x19')](_0xaf9d4+_0x0cb6('0x38'),_0x326403)['where'](_0x0cb6('0x39'),NOW)[_0x0cb6('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0cb6('0x13')]()[_0x0cb6('0x14')](_0x0cb6('0x15'))[_0x0cb6('0x16')]('cm_hopper_black')[_0x0cb6('0x19')](_0x0cb6('0x44'),_0x326403)['where'](_0x2b16e5+_0x0cb6('0x45')+_0xaf9d4+'.'+_0x2b16e5)))[_0x0cb6('0x3d')]();}function insertTzCmHopper(_0x1ce7bc,_0x1f48a2,_0x355750,_0x4aa7a5,_0x403952,_0x4c7a08){var _0x3b5e39=[_0x0cb6('0x3e'),_0x0cb6('0x46')+_0x4c7a08+'.offset-cm_contacts.utcOffset\x20minute)',_0x0cb6('0x29'),_0x0cb6('0x2a'),_0x1f48a2+'.'+_0x4aa7a5,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x0cb6('0x2d'),_0x0cb6('0x47'),'\x22'+_0x403952+'\x22'];var _0x1c5453=squel[_0x0cb6('0x3f')]()[_0x0cb6('0x2e')](_0x0cb6('0x3b'))[_0x0cb6('0x2f')]([_0x0cb6('0x15'),'scheduledat','ContactId',_0x0cb6('0x40'),_0x4aa7a5,_0x0cb6('0x32'),_0x0cb6('0x33'),_0x0cb6('0x34'),_0x0cb6('0x35'),_0x0cb6('0x36')],squel[_0x0cb6('0x13')]()['fields'](_0x3b5e39)['from'](_0x1f48a2)[_0x0cb6('0x17')](_0x0cb6('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x1f48a2+_0x0cb6('0x43'))[_0x0cb6('0x17')](_0x355750,null,_0x355750+_0x0cb6('0x18')+_0x1f48a2+'.'+_0x4aa7a5)['join'](_0x4c7a08,null,_0x4c7a08+_0x0cb6('0x18')+_0x1f48a2+'.'+_0x4aa7a5)[_0x0cb6('0x19')](_0x1f48a2+_0x0cb6('0x38'),_0x1ce7bc)[_0x0cb6('0x19')](_0x0cb6('0x39'),NOW)['where'](_0x0cb6('0x3a'),selectNotIn(_0x1f48a2,_0x355750,_0x4aa7a5,_0x0cb6('0x3b'),['\x22always\x22',_0x0cb6('0x48')]))[_0x0cb6('0x19')](_0x0cb6('0x3a'),selectNotIn(_0x1f48a2,_0x355750,_0x4aa7a5,_0x0cb6('0x3b'),[_0x0cb6('0x3c')])))[_0x0cb6('0x3d')]();return _0x1c5453;}function insertTzCmHopperBlack(_0x2c3e3c,_0x381d99,_0x33a5e0,_0x54768f){var _0x3087fb=[_0x0cb6('0x3e'),_0x0cb6('0x29'),'cm_contacts.ListId',_0x381d99+'.'+_0x54768f,_0x0cb6('0x2b'),_0x0cb6('0x2c')];return squel[_0x0cb6('0x3f')]()[_0x0cb6('0x2e')](_0x0cb6('0x49'))[_0x0cb6('0x2f')]([_0x0cb6('0x15'),_0x0cb6('0x31'),_0x0cb6('0x40'),_0x54768f,_0x0cb6('0x32'),_0x0cb6('0x33')],squel[_0x0cb6('0x13')]()[_0x0cb6('0x41')](_0x3087fb)[_0x0cb6('0x16')](_0x381d99)[_0x0cb6('0x17')](_0x0cb6('0x42'),null,_0x0cb6('0x37')+_0x381d99+'.CmListId')[_0x0cb6('0x17')](_0x33a5e0,null,_0x33a5e0+_0x0cb6('0x18')+_0x381d99+'.'+_0x54768f)['where'](_0x381d99+'.CmListId\x20=\x20?',_0x2c3e3c)[_0x0cb6('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x0cb6('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0cb6('0x13')]()[_0x0cb6('0x14')](_0x0cb6('0x15'))[_0x0cb6('0x16')](_0x0cb6('0x49'))[_0x0cb6('0x19')]('ListId\x20=\x20?',_0x2c3e3c)['where'](_0x54768f+_0x0cb6('0x45')+_0x381d99+'.'+_0x54768f)))[_0x0cb6('0x3d')]();}function insertCmHopperAdditionalPhones(_0x90d129){var _0x9e15d9=[_0x0cb6('0x4a'),_0x0cb6('0x4b'),_0x0cb6('0x4c'),_0x0cb6('0x4d'),_0x0cb6('0x4e')];return squel[_0x0cb6('0x3f')]()[_0x0cb6('0x2e')](_0x0cb6('0x4f'))['fromQuery'](['CmHopperId','phone',_0x0cb6('0x50'),'createdAt',_0x0cb6('0x33')],squel[_0x0cb6('0x13')]()[_0x0cb6('0x41')](_0x9e15d9)['from'](_0x0cb6('0x3b'))['join']('cm_contacts',null,_0x0cb6('0x51'))[_0x0cb6('0x17')](_0x0cb6('0x52'),null,_0x0cb6('0x53'))[_0x0cb6('0x19')](_0x0cb6('0x54'),_0x90d129)['where']('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x3bf3e3,_0x4634ae,_0x3bff38,_0x482a36){var _0x54ad4b=_[_0x0cb6('0x55')](_[_0x0cb6('0x56')](_0x482a36),['ListId',_0x0cb6('0x57'),_0x0cb6('0x32'),'updatedAt']);return squel['insert']()[_0x0cb6('0x2e')](_0x0cb6('0x42'))[_0x0cb6('0x2f')](_0x54ad4b,squel[_0x0cb6('0x13')]()['fields'](_0x54ad4b)['from'](_0x4634ae)[_0x0cb6('0x19')]('('+_0x3bff38[_0x0cb6('0x17')](',')+_0x0cb6('0x58'),squel['select']()['fields'](_0x3bff38)['from'](_0x0cb6('0x42'))[_0x0cb6('0x19')](_0x0cb6('0x44'),_0x3bf3e3)[_0x0cb6('0x19')]('deletedAt\x20IS\x20NULL'))[_0x0cb6('0x19')](_0x0cb6('0x59'),squel[_0x0cb6('0x13')]()[_0x0cb6('0x14')](_0x0cb6('0x5a'),_0x0cb6('0x5b'))[_0x0cb6('0x16')](_0x4634ae)[_0x0cb6('0x5c')](_0x3bff38[_0x0cb6('0x17')](','))))['toString']();}function handleStop(){logger[_0x0cb6('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x37c9dd){logger['error'](_0x37c9dd['message']);process[_0x0cb6('0x5e')](0x1);}function handleError(_0x111bf0,_0x75816c){stats[_0x0cb6('0x5f')][_0x0cb6('0x1f')]({'name':_0x75816c['code'],'message':_0x75816c[_0x0cb6('0x60')],'row':_0x111bf0});}function handleQuery(_0x44f276){logger['info'](_0x44f276);return db[_0x0cb6('0x61')][_0x0cb6('0x62')](_0x44f276)[_0x0cb6('0x63')](function(_0x2880e5){results['push'](_0x2880e5);})[_0x0cb6('0x64')](function(_0x1d6ff4){logger[_0x0cb6('0x65')](_0x1d6ff4[_0x0cb6('0x60')]);});}function updateTzCampaigns(_0x5b75eb){return new Promise(function(_0x5af7b3,_0x55b8af){var _0x66d483=squel[_0x0cb6('0x13')]()[_0x0cb6('0x41')]([_0x0cb6('0x66'),_0x0cb6('0x67')])[_0x0cb6('0x16')](_0x0cb6('0x68'))[_0x0cb6('0x17')](_0x0cb6('0x69'),null,_0x0cb6('0x6a'))[_0x0cb6('0x19')](_0x0cb6('0x6b')+_0x5b75eb);db[_0x0cb6('0x61')][_0x0cb6('0x62')](_0x66d483[_0x0cb6('0x3d')]())[_0x0cb6('0x63')](function(_0x3d31de){var _0xa9a83e=[];for(var _0x9ee653=0x0;_0x9ee653<_0x3d31de[_0x0cb6('0x1e')];_0x9ee653++){_0xa9a83e[_0x0cb6('0x1f')](getTimezoneData(_0x3d31de[_0x9ee653],tmp_campaigns));}BPromise[_0x0cb6('0x20')](_0xa9a83e)[_0x0cb6('0x1d')](function(){_0x5af7b3({'val':0x1});});})[_0x0cb6('0x64')](function(_0x14c94d){logger[_0x0cb6('0x65')](_0x14c94d[_0x0cb6('0x60')]);_0x5af7b3({'val':0x0});});});}function updateTzVoiceQueues(_0x546978){return new Promise(function(_0x48d433,_0x32c182){var _0x29bcb9=squel[_0x0cb6('0x13')]()[_0x0cb6('0x41')]([_0x0cb6('0x6c'),_0x0cb6('0x6d')])[_0x0cb6('0x16')]('voice_queues')[_0x0cb6('0x17')](_0x0cb6('0x6e'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x0cb6('0x19')]('voice_queues_has_cm_lists.CmListId='+_0x546978);db[_0x0cb6('0x61')]['query'](_0x29bcb9['toString']())[_0x0cb6('0x63')](function(_0x47530f){var _0x574999=[];for(var _0x5f4ef6=0x0;_0x5f4ef6<_0x47530f[_0x0cb6('0x1e')];_0x5f4ef6++){_0x574999[_0x0cb6('0x1f')](getTimezoneData(_0x47530f[_0x5f4ef6],tmp_voice_queues));}BPromise[_0x0cb6('0x20')](_0x574999)[_0x0cb6('0x1d')](function(){_0x48d433({'val':0x1});});})['catch'](function(_0x27aafe){logger[_0x0cb6('0x65')](_0x27aafe[_0x0cb6('0x60')]);_0x48d433({'val':0x0});});});}function getTimezoneData(_0x206d73,_0x15ce12){return new Promise(function(_0x31af6a,_0x43e762){var _0x3bb33b=shared[_0x0cb6('0x6f')];var _0xf269fd=_0x3bb33b[_0x206d73[_0x0cb6('0x70')]];if(_['isNil'](_0xf269fd)){_0x31af6a({'ret':0x1});}else{var _0x126605=_0xf269fd['utcOffset'];var _0x313b14=squel[_0x0cb6('0x3f')]()[_0x0cb6('0x2e')](_0x15ce12)[_0x0cb6('0x71')]('id',_0x206d73['id'])[_0x0cb6('0x71')](_0x0cb6('0x72'),_0x126605)[_0x0cb6('0x71')](_0x0cb6('0x70'),_0x206d73['dialTimezone'])[_0x0cb6('0x3d')]();return db[_0x0cb6('0x61')][_0x0cb6('0x62')](_0x313b14)[_0x0cb6('0x63')](function(_0x243153){_0x31af6a({'ret':0x1});})['catch'](function(_0x1e40c8){logger[_0x0cb6('0x65')](_0x1e40c8[_0x0cb6('0x60')]);_0x43e762({'ret':0x1});});}});}function handleTZQuery(_0x3c0f17){logger[_0x0cb6('0x5d')](_0x3c0f17);return db[_0x0cb6('0x61')][_0x0cb6('0x62')](_0x3c0f17)[_0x0cb6('0x63')](function(_0x49e1ad){})[_0x0cb6('0x64')](function(_0x2d5193){logger[_0x0cb6('0x65')](_0x2d5193[_0x0cb6('0x60')]);});}function main(_0x598621,_0x59d199,_0x584f4f,_0x170fe0){logger[_0x0cb6('0x5d')](_0x0cb6('0x73'),_0x598621,JSON[_0x0cb6('0x74')](_0x59d199));process[_0x0cb6('0x75')](_0x0cb6('0x76'));var _0x54d978=_0x59d199[_0x0cb6('0x77')];var _0x2c64df=_[_0x0cb6('0x78')](_0x54d978);var _0x29cb37=_0x59d199[_0x0cb6('0x79')];var _0x405891=path[_0x0cb6('0x17')](config[_0x0cb6('0x7a')],_0x0cb6('0x7b'),_0x29cb37+_0x0cb6('0x7c'));hasTZ=_[_0x0cb6('0x56')](_0x54d978)[_0x0cb6('0x7d')](_0x0cb6('0x70'));var _0x2353ef=_[_0x0cb6('0x56')](_0x54d978)[_0x0cb6('0x17')]();logger[_0x0cb6('0x5d')](_0x0cb6('0x7e'),_0x2353ef);db[_0x0cb6('0x7f')][_0x0cb6('0x1b')]({'raw':!![],'attributes':['id',_0x0cb6('0x80')]})['then'](function(_0x356758){for(var _0x2ad21e=0x0;_0x2ad21e<_0x356758[_0x0cb6('0x1e')];_0x2ad21e++){if(_0x356758[_0x2ad21e][_0x0cb6('0x80')]in _0x54d978){contactItemTypes[_0x0cb6('0x1f')](_0x356758[_0x2ad21e]);delete _0x2c64df[_0x356758[_0x2ad21e][_0x0cb6('0x80')]];hasAdditionalPhones=!![];}for(var _0x21489d in _0x54d978){if(_0x356758[_0x2ad21e]['name']+_0x0cb6('0x81')===_0x21489d){phoneDescriptions[_0x0cb6('0x1f')]({'itemTypeId':_0x356758[_0x2ad21e]['id'],'description':_0x21489d});delete _0x2c64df[_0x21489d];}}}if(hasAdditionalPhones)_0x2c64df['AdditionalPhones']='';var _0x5db822=_[_0x0cb6('0x56')](_0x2c64df)[_0x0cb6('0x17')]();logger[_0x0cb6('0x5d')](_0x0cb6('0x7e'),_0x5db822);fs[_0x0cb6('0x82')](_0x405891,_0x5db822+'\x0a');Papa[_0x0cb6('0x83')](fs[_0x0cb6('0x84')](_0x598621),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4af857,_0x444b9e){try{for(var _0x20bba0=0x0,_0x153e3d=[];_0x20bba0<_0x4af857[_0x0cb6('0x85')][_0x0cb6('0x1e')];_0x20bba0++){stats[_0x0cb6('0x86')]+=0x1;if(_0x4af857[_0x0cb6('0x5f')][_0x20bba0]){handleError(_0x4af857[_0x0cb6('0x85')][_0x20bba0],_0x4af857[_0x0cb6('0x5f')][_0x20bba0]);}else{var _0x1e3731=[];var _0x23a661=[];var _0x1bfea4={};for(var _0x2a909a in _0x54d978){let _0x29c29f=contactItemTypes[_0x0cb6('0x87')](_0x4bf0c0=>_0x4bf0c0['name']===_0x2a909a);let _0x54e867=contactItemTypes[_0x0cb6('0x87')](_0x1b5ca9=>_0x1b5ca9[_0x0cb6('0x80')]+_0x0cb6('0x81')===_0x2a909a);if(_['isNil'](_0x29c29f)&&_[_0x0cb6('0x22')](_0x54e867)){if(_0x54d978[_0x0cb6('0x88')](_0x2a909a)){if(_0x4af857[_0x0cb6('0x85')][_0x20bba0][_0x54d978[_0x2a909a]]){var _0x3ea21e=_[_0x0cb6('0x89')](_0x4af857['data'][_0x20bba0][_0x54d978[_0x2a909a]][_0x0cb6('0x8a')](/"/g,'\x27'));switch(_0x2a909a){case _0x0cb6('0x30'):var _0x4bbe38=moment(_0x3ea21e,_0x0cb6('0x11'),!![]);if(_0x4bbe38[_0x0cb6('0x8b')]()){_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x3ea21e+'\x22');}else{_0x1e3731[_0x0cb6('0x1f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x11a6d4=parseInt(_0x3ea21e);_0x3ea21e=_[_0x0cb6('0x8c')](_0x11a6d4)||_0x11a6d4<0x0||_0x11a6d4>0x4?_0x170fe0?0x3:0x2:_0x11a6d4;_0x153e3d['push']('\x22'+_0x3ea21e+'\x22');break;case _0x0cb6('0x35'):var _0x53deb0=parseInt(_0x3ea21e);if(_['isNumber'](_0x53deb0)&&_[_0x0cb6('0x7d')](_0x584f4f,_0x53deb0)){_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x53deb0+'\x22');}else{_0x1e3731[_0x0cb6('0x1f')]('agent\x20not\x20exists');}break;case _0x0cb6('0x8d'):if(isEmail(_0x3ea21e)){_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x3ea21e+'\x22');}else{_0x1e3731[_0x0cb6('0x1f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x4e7eca=moment(_0x3ea21e,_0x0cb6('0x8e'),!![]);if(_0x4e7eca[_0x0cb6('0x8b')]()){_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x3ea21e+'\x22');}else{_0x1e3731[_0x0cb6('0x1f')](_0x0cb6('0x8f'));}break;case _0x0cb6('0x70'):var _0x27c8d8=shared['timezones'];var _0x1f2701=_0x27c8d8[_0x3ea21e];if(!_[_0x0cb6('0x22')](_0x1f2701)){var _0x151e25=_0x1f2701['utcOffset'];_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x3ea21e+'\x22');_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x151e25+'\x22');}break;default:_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x3ea21e+'\x22');}}else{switch(_0x2a909a){case _0x0cb6('0x90'):case _0x0cb6('0x15'):_0x1e3731['push'](_0x2a909a+_0x0cb6('0x91'));break;default:_0x153e3d[_0x0cb6('0x1f')]('\x22\x22');}}}}else{var _0x8e1d92='';if(!_['isNil'](_0x29c29f)){if(!_0x1bfea4[_0x0cb6('0x88')](_0x29c29f['id'])){if(!_[_0x0cb6('0x22')](_0x4af857[_0x0cb6('0x85')][_0x20bba0][_0x54d978[_0x2a909a]])){var _0x3ea21e=_[_0x0cb6('0x89')](_0x4af857['data'][_0x20bba0][_0x54d978[_0x2a909a]][_0x0cb6('0x8a')](/"/g,'\x27'));var _0x25f11a=phoneDescriptions['find'](_0x443a59=>_0x443a59[_0x0cb6('0x92')]===_0x29c29f['id']);if(!_['isNil'](_0x25f11a)){var _0x11c582=_[_0x0cb6('0x89')](_0x4af857[_0x0cb6('0x85')][_0x20bba0][_0x54d978[_0x25f11a[_0x0cb6('0x93')]]]['replace'](/"/g,'\x27'));if(!_[_0x0cb6('0x22')](_0x11c582))_0x3ea21e=_0x3ea21e+'§'+_0x11c582;}if(_0x8e1d92=='')_0x8e1d92=_0x3ea21e;else _0x8e1d92+='|'+_0x3ea21e;}_0x23a661[_0x0cb6('0x1f')](_0x29c29f['id']+':'+_0x8e1d92);_0x1bfea4[_0x29c29f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x153e3d[_0x0cb6('0x1f')]('\x22'+_0x23a661[_0x0cb6('0x17')](';')+'\x22');}if(_0x1e3731[_0x0cb6('0x1e')]){handleError(_0x4af857[_0x0cb6('0x85')][_0x20bba0],{'code':'SystemRow','message':_0x1e3731[_0x0cb6('0x17')]()});}else{fs[_0x0cb6('0x94')](_0x405891,_0x153e3d[_0x0cb6('0x17')]()+'\x0a');}_0x153e3d=[];}if(!(stats[_0x0cb6('0x86')]%0xc8)){socket[_0x0cb6('0x95')](_0x0cb6('0x96')+_0x29cb37,stats);stats[_0x0cb6('0x5f')]=[];}}if(stopped){logger[_0x0cb6('0x5d')](_0x0cb6('0x97'));_0x444b9e[_0x0cb6('0x98')]();}}catch(_0x175204){handleError(_0x4af857[_0x0cb6('0x85')][_0x20bba0],{'code':_0x0cb6('0x99'),'message':_0x175204[_0x0cb6('0x60')]});logger[_0x0cb6('0x65')](_0x0cb6('0x9a'),_0x175204[_0x0cb6('0x60')]);}},'complete':function(){try{var _0xe152fd=[];var _0x207573=[];var _0x501645=_0x0cb6('0x42');if(_0x59d199[_0x0cb6('0x9b')]&&_0x59d199['duplicates']['length']){_0x501645=_0x0cb6('0x9c')+_0x29cb37;_0xe152fd[_0x0cb6('0x1f')](_0x0cb6('0x9d')+_0x501645+_0x0cb6('0x9e'));}tmp_campaigns='campaigns_'+_0x29cb37;tmp_voice_queues='voice_queues_'+_0x29cb37;_0x207573[_0x0cb6('0x1f')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x0cb6('0x9f'));_0x207573[_0x0cb6('0x1f')](_0x0cb6('0x9d')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x0cb6('0xa0')](_0x207573,handleTZQuery)['then'](function(_0x2c35f2){updateTzCampaigns(_0x59d199[_0x0cb6('0x40')])[_0x0cb6('0x1d')](function(_0x2d96be){updateTzVoiceQueues(_0x59d199[_0x0cb6('0x40')])[_0x0cb6('0x1d')](function(_0x12c9ab){if(hasTZ)_0x5db822=_0x5db822[_0x0cb6('0x8a')]('dialTimezone',_0x0cb6('0xa1'));var _0x55ad85=util[_0x0cb6('0x10')]('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',_0x405891,_0x501645,_0x5db822,_0x59d199[_0x0cb6('0x40')],_0x59d199['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x54d978[_0x0cb6('0x30')])){_0x55ad85+=',\x20scheduledAt\x20=\x20NOW()';}_0xe152fd['push'](_0x55ad85);if(_0x59d199[_0x0cb6('0x9b')]&&_0x59d199[_0x0cb6('0x9b')][_0x0cb6('0x1e')]){_0xe152fd[_0x0cb6('0x1f')](insertCmContact(_0x59d199['ListId'],_0x501645,_0x59d199[_0x0cb6('0x9b')],_0x54d978));_0xe152fd[_0x0cb6('0x1f')]('DROP\x20TABLE\x20'+_0x501645+';');}BPromise['each'](_0xe152fd,handleQuery)[_0x0cb6('0x1d')](function(_0x484e43){BPromise[_0x0cb6('0x20')]([handleAdditionalPhones()])[_0x0cb6('0x1d')](function(){_0xe152fd=[];for(var _0x4ed3b4=0x0;_0x4ed3b4\x20\x20','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','query','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','findOne','CmContactHasItem','update','updated','create','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper'];(function(_0x33be9d,_0x41618e){var _0x4a9267=function(_0x4f0e70){while(--_0x4f0e70){_0x33be9d['push'](_0x33be9d['shift']());}};_0x4a9267(++_0x41618e);}(_0x9ed4,0x1a7));var _0x49ed=function(_0x5d677f,_0xcc01c4){_0x5d677f=_0x5d677f-0x0;var _0x2293f8=_0x9ed4[_0x5d677f];return _0x2293f8;};'use strict';var fs=require('fs');var path=require(_0x49ed('0x0'));var _=require(_0x49ed('0x1'));var Papa=require(_0x49ed('0x2'));var util=require(_0x49ed('0x3'));var BPromise=require(_0x49ed('0x4'));var moment=require(_0x49ed('0x5'));var squel=require(_0x49ed('0x6'));var Redis=require(_0x49ed('0x7'));var db=require(_0x49ed('0x8'))['db'];var config=require(_0x49ed('0x9'));var logger=require(_0x49ed('0xa'))('import');config[_0x49ed('0xb')]=_[_0x49ed('0xc')](config[_0x49ed('0xb')],{'host':_0x49ed('0xd'),'port':0x18eb});var socket=require(_0x49ed('0xe'))(new Redis(config[_0x49ed('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0x49ed('0xf')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x170656){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))*$/[_0x49ed('0x10')](_0x170656);}function selectNotIn(_0xf61933,_0x405918,_0x2973a1,_0x32c0af,_0x2381f4){return squel[_0x49ed('0x11')]()[_0x49ed('0x12')](_0x49ed('0x13'))[_0x49ed('0x14')](_0x32c0af)[_0x49ed('0x15')](_0x405918,null,_0x405918+_0x49ed('0x16')+_0x32c0af+'.'+_0x2973a1)[_0x49ed('0x17')](_0x32c0af+'.'+_0x2973a1+'\x20=\x20'+_0xf61933+'.'+_0x2973a1)[_0x49ed('0x17')](_0x405918+_0x49ed('0x18')+_0x2381f4[_0x49ed('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38c3f0,_0x4abc23){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x49ed('0x19')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x3b50aa){if(_0x3b50aa!==null){var _0xed3cc1=[];for(var _0x3e78a5=0x0;_0x3e78a5<_0x3b50aa[_0x49ed('0x1a')];_0x3e78a5++){var _0x550afd=_0x3b50aa[_0x3e78a5];if(!_['isNil'](_0x550afd[_0x49ed('0x13')])){if(!_[_0x49ed('0x1b')](_0x550afd[_0x49ed('0x1c')]))_0xed3cc1[_0x49ed('0x1d')](insertAdditionalPhones(_0x550afd));promisesContact[_0x49ed('0x1d')]({'contact':_0x550afd});}}}Promise[_0x49ed('0x1e')](_0xed3cc1)[_0x49ed('0x1f')](function(){_0x38c3f0({'val':0x1});});})[_0x49ed('0x20')](function(_0x42cbbf){logger[_0x49ed('0x21')](_0x42cbbf[_0x49ed('0x22')]);});});}function insertAdditionalPhones(_0x2e5b87){return new Promise(function(_0x496661,_0xd30fb1){var _0x3eeb07=_0x2e5b87[_0x49ed('0x1c')];if(_['isNil'](_0x3eeb07))_0xd30fb1({'val':0x0});else{var _0x313e3b=_0x3eeb07['split'](';');var _0x26809c=[];orderBy=0x0;for(var _0x405b4a=0x0;_0x405b4a<_0x313e3b[_0x49ed('0x1a')];_0x405b4a++){_0x26809c[_0x49ed('0x1d')](splitAdditionalPhone(_0x2e5b87['id'],_0x313e3b[_0x405b4a]));}Promise['all'](_0x26809c)[_0x49ed('0x1f')](function(){_0x496661({'val':_0x313e3b['length']});});}});}function splitAdditionalPhone(_0x42420f,_0x367c34){return new Promise(function(_0x4c9e84,_0x34c176){var _0xd731b3=_0x367c34['split'](':');var _0x20c274=_0xd731b3[0x0];var _0x1dc430=_0xd731b3[0x1];if(_0x1dc430!==''){var _0x38b038=_0x1dc430[_0x49ed('0x23')]('|');var _0x3419d4=[];for(var _0x2c8a68=0x0;_0x2c8a68<_0x38b038['length'];_0x2c8a68++){if(_0x38b038[_0x2c8a68]!==''){var _0x44c3f0=_[_0x49ed('0x24')](promisesAdditionalPhones,{'contactId':_0x42420f,'phone':_0x38b038[_0x2c8a68]});if(_0x44c3f0[_0x49ed('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x49ed('0x1d')]({'contactId':_0x42420f,'contactTypeId':_0x20c274,'phone':_0x38b038[_0x2c8a68],'orderBy':orderBy});}}}_0x4c9e84({'ok':0x1});}else _0x4c9e84({'res':0x0});});}function createAdditionalPhone(_0x5467fa,_0x16bf1d,_0x27bf16,_0x2cea7a){var _0x2b1ba4='';var _0x4d6401='';var _0x21264f=_0x27bf16[_0x49ed('0x23')]('§');_0x2b1ba4=_0x21264f[0x0];if(_0x21264f[_0x49ed('0x1a')]==0x2)_0x4d6401=_0x21264f[0x1];return new Promise(function(_0x40fe59,_0x17970c){return db['CmContactHasItem'][_0x49ed('0x25')]({'where':{'CmContactId':_0x5467fa,'item':_0x2b1ba4}})[_0x49ed('0x1f')](function(_0x32bebf){if(_0x32bebf){return db[_0x49ed('0x26')][_0x49ed('0x27')]({'ItemTypeId':_0x16bf1d,'description':_0x4d6401,'OrderBy':_0x2cea7a},{'where':{'CmContactId':_0x5467fa,'item':_0x2b1ba4}})['then'](function(_0x56016d){_0x40fe59({'res':_0x49ed('0x28')});});}else{return db[_0x49ed('0x26')][_0x49ed('0x29')]({'CmContactId':_0x5467fa,'item':_0x2b1ba4,'ItemTypeId':_0x16bf1d,'description':_0x4d6401,'OrderBy':_0x2cea7a,'ItemClass':'PHONE'})[_0x49ed('0x1f')](function(_0x42eaf4){_0x40fe59({'res':_0x49ed('0x2a')});});}});});}function updateContact(_0x4e5853){return new Promise(function(_0x36cb19,_0x38944d){var _0x3f69ec=_0x4e5853['id'];delete _0x4e5853['id'];return db['CmContact']['update'](_0x4e5853,{'where':{'id':_0x3f69ec}})[_0x49ed('0x1f')](function(_0x35b934){updatedRows+=0x1;return db[_0x49ed('0x2b')][_0x49ed('0x27')]({'phone':_0x4e5853[_0x49ed('0x13')]},{'where':{'ContactId':_0x3f69ec}})[_0x49ed('0x1f')](function(_0x547f7e){_0x36cb19({'ret':'OK'});});});});}function insertCmHopper(_0x355ad4,_0x56bfa9,_0x4e2154,_0x4e2d3f,_0x1dbcb3){var _0x3c015a=['cm_contacts.phone',_0x49ed('0x2c'),_0x49ed('0x2d'),_0x49ed('0x2e'),_0x56bfa9+'.'+_0x4e2d3f,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x49ed('0x2f'),_0x49ed('0x30'),'\x22'+_0x1dbcb3+'\x22'];return squel[_0x49ed('0x31')]()['into'](_0x49ed('0x32'))[_0x49ed('0x33')](['phone',_0x49ed('0x34'),'ContactId',_0x49ed('0x35'),_0x4e2d3f,_0x49ed('0x36'),_0x49ed('0x37'),_0x49ed('0x38'),_0x49ed('0x39'),_0x49ed('0x3a')],squel[_0x49ed('0x11')]()[_0x49ed('0x3b')](_0x3c015a)[_0x49ed('0x14')](_0x56bfa9)[_0x49ed('0x15')](_0x49ed('0x3c'),null,_0x49ed('0x3d')+_0x56bfa9+_0x49ed('0x3e'))[_0x49ed('0x15')](_0x4e2154,null,_0x4e2154+_0x49ed('0x16')+_0x56bfa9+'.'+_0x4e2d3f)['where'](_0x56bfa9+_0x49ed('0x3f'),_0x355ad4)['where'](_0x49ed('0x40'),NOW)[_0x49ed('0x17')](_0x49ed('0x41'),selectNotIn(_0x56bfa9,_0x4e2154,_0x4e2d3f,'cm_hopper',[_0x49ed('0x42'),_0x49ed('0x43')]))[_0x49ed('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x56bfa9,_0x4e2154,_0x4e2d3f,'cm_hopper',[_0x49ed('0x42')])))['toString']();}function insertCmHopperBlack(_0x15244e,_0x329272,_0x3a3f0e,_0x156b8a){var _0x18be2a=[_0x49ed('0x44'),'cm_contacts.id',_0x49ed('0x2e'),_0x329272+'.'+_0x156b8a,_0x49ed('0x45'),'cm_contacts.updatedAt'];return squel[_0x49ed('0x31')]()[_0x49ed('0x46')]('cm_hopper_black')['fromQuery']([_0x49ed('0x13'),_0x49ed('0x47'),_0x49ed('0x35'),_0x156b8a,_0x49ed('0x36'),'updatedAt'],squel[_0x49ed('0x11')]()[_0x49ed('0x3b')](_0x18be2a)['from'](_0x329272)[_0x49ed('0x15')](_0x49ed('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x329272+_0x49ed('0x3e'))[_0x49ed('0x15')](_0x3a3f0e,null,_0x3a3f0e+_0x49ed('0x16')+_0x329272+'.'+_0x156b8a)[_0x49ed('0x17')](_0x329272+_0x49ed('0x3f'),_0x15244e)[_0x49ed('0x17')](_0x49ed('0x40'),NOW)[_0x49ed('0x17')](_0x49ed('0x41'),squel['select']()[_0x49ed('0x12')](_0x49ed('0x13'))[_0x49ed('0x14')](_0x49ed('0x48'))[_0x49ed('0x17')](_0x49ed('0x49'),_0x15244e)[_0x49ed('0x17')](_0x156b8a+'\x20=\x20?',_0x329272+'.'+_0x156b8a)))[_0x49ed('0x4a')]();}function insertCmHopperAdditionalPhones(_0x53002d){var _0x4c9fef=[_0x49ed('0x4b'),_0x49ed('0x4c'),_0x49ed('0x4d'),_0x49ed('0x4e'),'cm_contact_has_items.updatedAt'];return squel[_0x49ed('0x31')]()['into'](_0x49ed('0x4f'))['fromQuery']([_0x49ed('0x50'),'phone',_0x49ed('0x51'),_0x49ed('0x36'),_0x49ed('0x37')],squel[_0x49ed('0x11')]()[_0x49ed('0x3b')](_0x4c9fef)[_0x49ed('0x14')](_0x49ed('0x32'))[_0x49ed('0x15')](_0x49ed('0x3c'),null,_0x49ed('0x52'))[_0x49ed('0x15')](_0x49ed('0x53'),null,_0x49ed('0x54'))[_0x49ed('0x17')](_0x49ed('0x55'),_0x53002d)['where'](_0x49ed('0x40'),NOW))[_0x49ed('0x4a')]();}function insertCmContact(_0xcf7fa1,_0x1c3e55,_0x5067f8,_0x20909f){var _0x2bd2f7=_[_0x49ed('0x56')](_['keys'](_0x20909f),[_0x49ed('0x35'),'CompanyId',_0x49ed('0x36'),_0x49ed('0x37')]);return squel[_0x49ed('0x31')]()[_0x49ed('0x46')](_0x49ed('0x3c'))[_0x49ed('0x33')](_0x2bd2f7,squel[_0x49ed('0x11')]()[_0x49ed('0x3b')](_0x2bd2f7)[_0x49ed('0x14')](_0x1c3e55)[_0x49ed('0x17')]('('+_0x5067f8[_0x49ed('0x15')](',')+_0x49ed('0x57'),squel[_0x49ed('0x11')]()['fields'](_0x5067f8)[_0x49ed('0x14')](_0x49ed('0x3c'))[_0x49ed('0x17')](_0x49ed('0x49'),_0xcf7fa1))[_0x49ed('0x17')](_0x49ed('0x58'),squel[_0x49ed('0x11')]()[_0x49ed('0x12')]('MIN(id)','min_id')['from'](_0x1c3e55)[_0x49ed('0x59')](_0x5067f8[_0x49ed('0x15')](','))))[_0x49ed('0x4a')]();}function handleStop(){logger[_0x49ed('0x5a')](_0x49ed('0x5b'));stopped=!![];}function handleUncaughtException(_0x8ed0b2){logger[_0x49ed('0x21')](_0x8ed0b2[_0x49ed('0x22')]);process[_0x49ed('0x5c')](0x1);}function handleError(_0x4a18e5,_0x24858c){stats['errors'][_0x49ed('0x1d')]({'name':_0x24858c[_0x49ed('0x5d')],'message':_0x24858c['message'],'row':_0x4a18e5});}function handleQuery(_0x114241){logger[_0x49ed('0x5a')](_0x114241);return db[_0x49ed('0x5e')][_0x49ed('0x19')](_0x114241)[_0x49ed('0x5f')](function(_0x23b7c4){results[_0x49ed('0x1d')](_0x23b7c4);})['catch'](function(_0x4f956){logger['error'](_0x4f956[_0x49ed('0x22')]);});}function main(_0x5bd2ff,_0x352c5d,_0x4b7072,_0x5257b0){logger[_0x49ed('0x5a')](_0x49ed('0x60'),_0x5bd2ff,JSON[_0x49ed('0x61')](_0x352c5d));process[_0x49ed('0x62')](_0x49ed('0x63'));var _0x1bde65=_0x352c5d[_0x49ed('0x64')];var _0x12f746=_[_0x49ed('0x65')](_0x1bde65);var _0x5a5a9e=_0x352c5d[_0x49ed('0x66')];var _0x5b868e=path[_0x49ed('0x15')](config[_0x49ed('0x67')],_0x49ed('0x68'),_0x5a5a9e+_0x49ed('0x69'));logger[_0x49ed('0x5a')](_0x49ed('0x6a'),_0x352c5d);db['ContactItemType'][_0x49ed('0x6b')]({'raw':!![],'attributes':['id',_0x49ed('0x6c')]})['then'](function(_0x59cde2){for(var _0x3a8129=0x0;_0x3a8129<_0x59cde2[_0x49ed('0x1a')];_0x3a8129++){if(_0x59cde2[_0x3a8129][_0x49ed('0x6c')]in _0x1bde65){contactItemTypes[_0x49ed('0x1d')](_0x59cde2[_0x3a8129]);delete _0x12f746[_0x59cde2[_0x3a8129][_0x49ed('0x6c')]];hasAdditionalPhones=!![];}for(var _0x23c977 in _0x1bde65){if(_0x59cde2[_0x3a8129][_0x49ed('0x6c')]+'_description'===_0x23c977){phoneDescriptions[_0x49ed('0x1d')]({'itemTypeId':_0x59cde2[_0x3a8129]['id'],'description':_0x23c977});delete _0x12f746[_0x23c977];}}}if(hasAdditionalPhones)_0x12f746[_0x49ed('0x1c')]='';var _0x29eaed=_['keys'](_0x12f746)[_0x49ed('0x15')]();logger[_0x49ed('0x5a')]('header',_0x29eaed);fs[_0x49ed('0x6d')](_0x5b868e,_0x29eaed+'\x0a');Papa[_0x49ed('0x6e')](fs[_0x49ed('0x6f')](_0x5bd2ff),{'header':!![],'skipEmptyLines':!![],'step':function(_0x355b6b,_0x135502){try{for(var _0x1dfbf8=0x0,_0x151955=[];_0x1dfbf8<_0x355b6b[_0x49ed('0x70')][_0x49ed('0x1a')];_0x1dfbf8++){stats[_0x49ed('0x71')]+=0x1;if(_0x355b6b[_0x49ed('0x72')][_0x1dfbf8]){handleError(_0x355b6b[_0x49ed('0x70')][_0x1dfbf8],_0x355b6b[_0x49ed('0x72')][_0x1dfbf8]);}else{var _0x3dd2bf=[];var _0x5406c6=[];var _0x38bfba={};for(var _0x810ec7 in _0x1bde65){let _0x2e11e7=contactItemTypes['find'](_0x5b8f5c=>_0x5b8f5c[_0x49ed('0x6c')]===_0x810ec7);let _0x4ddd5d=contactItemTypes['find'](_0x15162a=>_0x15162a[_0x49ed('0x6c')]+_0x49ed('0x73')===_0x810ec7);if(_['isNil'](_0x2e11e7)&&_[_0x49ed('0x1b')](_0x4ddd5d)){if(_0x1bde65[_0x49ed('0x74')](_0x810ec7)){if(_0x355b6b[_0x49ed('0x70')][_0x1dfbf8][_0x1bde65[_0x810ec7]]){var _0x525e33=_[_0x49ed('0x75')](_0x355b6b[_0x49ed('0x70')][_0x1dfbf8][_0x1bde65[_0x810ec7]][_0x49ed('0x76')](/"/g,'\x27'));switch(_0x810ec7){case _0x49ed('0x34'):var _0x3c90b7=moment(_0x525e33,_0x49ed('0x77'),!![]);if(_0x3c90b7['isValid']()){_0x151955[_0x49ed('0x1d')]('\x22'+_0x525e33+'\x22');}else{_0x3dd2bf[_0x49ed('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x49ed('0x38'):var _0x32725c=parseInt(_0x525e33);_0x525e33=_[_0x49ed('0x78')](_0x32725c)||_0x32725c<0x0||_0x32725c>0x4?_0x5257b0?0x3:0x2:_0x32725c;_0x151955[_0x49ed('0x1d')]('\x22'+_0x525e33+'\x22');break;case _0x49ed('0x39'):var _0x525246=parseInt(_0x525e33);if(_[_0x49ed('0x79')](_0x525246)&&_['includes'](_0x4b7072,_0x525246)){_0x151955['push']('\x22'+_0x525246+'\x22');}else{_0x3dd2bf[_0x49ed('0x1d')](_0x49ed('0x7a'));}break;case _0x49ed('0x7b'):if(isEmail(_0x525e33)){_0x151955[_0x49ed('0x1d')]('\x22'+_0x525e33+'\x22');}else{_0x3dd2bf[_0x49ed('0x1d')](_0x49ed('0x7c'));}break;case _0x49ed('0x7d'):var _0x2b0177=moment(_0x525e33,_0x49ed('0x7e'),!![]);if(_0x2b0177[_0x49ed('0x7f')]()){_0x151955[_0x49ed('0x1d')]('\x22'+_0x525e33+'\x22');}else{_0x3dd2bf['push'](_0x49ed('0x80'));}break;default:_0x151955[_0x49ed('0x1d')]('\x22'+_0x525e33+'\x22');}}else{switch(_0x810ec7){case _0x49ed('0x81'):case _0x49ed('0x13'):_0x3dd2bf[_0x49ed('0x1d')](_0x810ec7+'\x20not\x20specified');break;default:_0x151955[_0x49ed('0x1d')]('\x22\x22');}}}}else{var _0x441016='';if(!_[_0x49ed('0x1b')](_0x2e11e7)){if(!_0x38bfba[_0x49ed('0x74')](_0x2e11e7['id'])){for(var _0x1e1aeb=0x0;_0x1e1aeb<_0x1bde65[_0x810ec7][_0x49ed('0x1a')];_0x1e1aeb++){var _0x525e33=_[_0x49ed('0x75')](_0x355b6b[_0x49ed('0x70')][_0x1dfbf8][_0x1bde65[_0x810ec7][_0x1e1aeb]][_0x49ed('0x76')](/"/g,'\x27'));var _0x47f93e=phoneDescriptions['find'](_0x5db346=>_0x5db346[_0x49ed('0x82')]===_0x2e11e7['id']);if(!_[_0x49ed('0x1b')](_0x47f93e)){var _0x5c3529=_[_0x49ed('0x75')](_0x355b6b[_0x49ed('0x70')][_0x1dfbf8][_0x1bde65[_0x47f93e[_0x49ed('0x83')]][0x0]][_0x49ed('0x76')](/"/g,'\x27'));if(!_['isNil'](_0x5c3529))_0x525e33=_0x525e33+'§'+_0x5c3529;}if(_0x441016=='')_0x441016=_0x525e33;else _0x441016+='|'+_0x525e33;}_0x5406c6['push'](_0x2e11e7['id']+':'+_0x441016);_0x38bfba[_0x2e11e7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x151955['push']('\x22'+_0x5406c6[_0x49ed('0x15')](';')+'\x22');}if(_0x3dd2bf[_0x49ed('0x1a')]){handleError(_0x355b6b[_0x49ed('0x70')][_0x1dfbf8],{'code':'SystemRow','message':_0x3dd2bf[_0x49ed('0x15')]()});}else{fs[_0x49ed('0x84')](_0x5b868e,_0x151955[_0x49ed('0x15')]()+'\x0a');}_0x151955=[];}if(!(stats[_0x49ed('0x71')]%0xc8)){socket[_0x49ed('0x85')](_0x49ed('0x86')+_0x5a5a9e,stats);stats[_0x49ed('0x72')]=[];}}if(stopped){logger['info'](_0x49ed('0x87'));_0x135502[_0x49ed('0x88')]();}}catch(_0x41fee5){handleError(_0x355b6b[_0x49ed('0x70')][_0x1dfbf8],{'code':'SystemError','message':_0x41fee5[_0x49ed('0x22')]});logger[_0x49ed('0x21')](_0x49ed('0x89'),_0x41fee5[_0x49ed('0x22')]);}},'complete':function(){try{var _0x491191=[];var _0x175333=tempTableName;_0x491191['push'](_0x49ed('0x8a')+_0x175333+'\x20LIKE\x20cm_contacts;');logger[_0x49ed('0x5a')](_0x49ed('0x8b'),contactItemTypes[_0x49ed('0x1a')]);var _0x269929=util[_0x49ed('0xf')](_0x49ed('0x8c'),_0x5b868e,_0x175333,_0x29eaed,_0x352c5d[_0x49ed('0x35')],_0x352c5d[_0x49ed('0x8d')]||null,NOW,NOW);if(_[_0x49ed('0x1b')](_0x1bde65[_0x49ed('0x34')])){_0x269929+=_0x49ed('0x8e');}_0x491191[_0x49ed('0x1d')](_0x269929);BPromise[_0x49ed('0x8f')](_0x491191,handleQuery)[_0x49ed('0x1f')](function(_0x363b58){BPromise[_0x49ed('0x1e')]([handleAdditionalPhones()])[_0x49ed('0x1f')](function(){_0x491191=[];for(var _0x29ce1e=0x0;_0x29ce1e\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','query','select\x20*\x20from\x20','length','isNil','push','all','catch','error','message','split','then','filter','CmContactHasItem','findOne','update','inserted','CmHopper','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','fromQuery','createdAt','cm_contacts','field','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','into','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','exit','code','sequelize','spread','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','findAll','name','_description','rows','errors','find','hasOwnProperty','data','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','appendFileSync','emit','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xc3b7,0xb4));var _0x7c3b=function(_0xfcab8a,_0x4e9b7d){_0xfcab8a=_0xfcab8a-0x0;var _0x2f5a98=_0xc3b7[_0xfcab8a];return _0x2f5a98;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x7c3b('0x0'));var Papa=require(_0x7c3b('0x1'));var util=require(_0x7c3b('0x2'));var BPromise=require(_0x7c3b('0x3'));var moment=require(_0x7c3b('0x4'));var squel=require(_0x7c3b('0x5'));var Redis=require(_0x7c3b('0x6'));var db=require(_0x7c3b('0x7'))['db'];var config=require(_0x7c3b('0x8'));var logger=require('../../../config/logger')('import');config[_0x7c3b('0x9')]=_[_0x7c3b('0xa')](config[_0x7c3b('0x9')],{'host':_0x7c3b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c3b('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x7c3b('0xc')](_0x7c3b('0xd'));var tempTableName=_0x7c3b('0xe')+moment()[_0x7c3b('0xc')](_0x7c3b('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x23f373){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))*$/[_0x7c3b('0x10')](_0x23f373);}function selectNotIn(_0xeb699f,_0x220f21,_0x74dc35,_0xf4883f,_0x160e68){return squel[_0x7c3b('0x11')]()['field'](_0x7c3b('0x12'))[_0x7c3b('0x13')](_0xf4883f)['join'](_0x220f21,null,_0x220f21+_0x7c3b('0x14')+_0xf4883f+'.'+_0x74dc35)[_0x7c3b('0x15')](_0xf4883f+'.'+_0x74dc35+_0x7c3b('0x16')+_0xeb699f+'.'+_0x74dc35)['where'](_0x220f21+_0x7c3b('0x17')+_0x160e68[_0x7c3b('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4c5cee,_0x134869){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x7c3b('0x19')](_0x7c3b('0x1a')+tempTableName)['spread'](function(_0x165c69){if(_0x165c69!==null){var _0x128f02=[];for(var _0x42c1f6=0x0;_0x42c1f6<_0x165c69[_0x7c3b('0x1b')];_0x42c1f6++){var _0x1069e0=_0x165c69[_0x42c1f6];if(!_[_0x7c3b('0x1c')](_0x1069e0['phone'])){if(!_[_0x7c3b('0x1c')](_0x1069e0['AdditionalPhones']))_0x128f02[_0x7c3b('0x1d')](insertAdditionalPhones(_0x1069e0));promisesContact['push']({'contact':_0x1069e0});}}}Promise[_0x7c3b('0x1e')](_0x128f02)['then'](function(){_0x4c5cee({'val':0x1});});})[_0x7c3b('0x1f')](function(_0x7ef72d){logger[_0x7c3b('0x20')](_0x7ef72d[_0x7c3b('0x21')]);});});}function insertAdditionalPhones(_0x3a1ce6){return new Promise(function(_0x5a2edd,_0x323012){var _0x3db3f9=_0x3a1ce6['AdditionalPhones'];if(_[_0x7c3b('0x1c')](_0x3db3f9))_0x323012({'val':0x0});else{var _0x558fea=_0x3db3f9[_0x7c3b('0x22')](';');var _0x1f7c1b=[];orderBy=0x0;for(var _0xa2b5a4=0x0;_0xa2b5a4<_0x558fea[_0x7c3b('0x1b')];_0xa2b5a4++){_0x1f7c1b[_0x7c3b('0x1d')](splitAdditionalPhone(_0x3a1ce6['id'],_0x558fea[_0xa2b5a4]));}Promise[_0x7c3b('0x1e')](_0x1f7c1b)[_0x7c3b('0x23')](function(){_0x5a2edd({'val':_0x558fea['length']});});}});}function splitAdditionalPhone(_0x484933,_0x4b60c4){return new Promise(function(_0x2ce419,_0xad6455){var _0x3ddb6d=_0x4b60c4[_0x7c3b('0x22')](':');var _0x2b2606=_0x3ddb6d[0x0];var _0x5c8774=_0x3ddb6d[0x1];if(_0x5c8774!==''){var _0xd39491=_0x5c8774['split']('|');var _0x2e060a=[];for(var _0x94c0af=0x0;_0x94c0af<_0xd39491['length'];_0x94c0af++){if(_0xd39491[_0x94c0af]!==''){var _0x10d549=_[_0x7c3b('0x24')](promisesAdditionalPhones,{'contactId':_0x484933,'phone':_0xd39491[_0x94c0af]});if(_0x10d549[_0x7c3b('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x7c3b('0x1d')]({'contactId':_0x484933,'contactTypeId':_0x2b2606,'phone':_0xd39491[_0x94c0af],'orderBy':orderBy});}}}_0x2ce419({'ok':0x1});}else _0x2ce419({'res':0x0});});}function createAdditionalPhone(_0x5938e0,_0xecb060,_0x4c7590,_0x345eef){var _0x5bf95b='';var _0x130ff0='';var _0x57cf01=_0x4c7590[_0x7c3b('0x22')]('§');_0x5bf95b=_0x57cf01[0x0];if(_0x57cf01[_0x7c3b('0x1b')]==0x2)_0x130ff0=_0x57cf01[0x1];return new Promise(function(_0x581873,_0x2b547d){return db[_0x7c3b('0x25')][_0x7c3b('0x26')]({'where':{'CmContactId':_0x5938e0,'item':_0x5bf95b}})['then'](function(_0x8fab5d){if(_0x8fab5d){return db[_0x7c3b('0x25')][_0x7c3b('0x27')]({'ItemTypeId':_0xecb060,'description':_0x130ff0,'OrderBy':_0x345eef},{'where':{'CmContactId':_0x5938e0,'item':_0x5bf95b}})['then'](function(_0x5ef9ca){_0x581873({'res':'updated'});});}else{return db[_0x7c3b('0x25')]['create']({'CmContactId':_0x5938e0,'item':_0x5bf95b,'ItemTypeId':_0xecb060,'description':_0x130ff0,'OrderBy':_0x345eef,'ItemClass':'PHONE'})[_0x7c3b('0x23')](function(_0x514073){_0x581873({'res':_0x7c3b('0x28')});});}});});}function updateContact(_0x2a5728){return new Promise(function(_0x10cbd5,_0x251aaa){var _0x32723b=_0x2a5728['id'];delete _0x2a5728['id'];return db['CmContact'][_0x7c3b('0x27')](_0x2a5728,{'where':{'id':_0x32723b}})[_0x7c3b('0x23')](function(_0x5e1b76){updatedRows+=0x1;return db[_0x7c3b('0x29')][_0x7c3b('0x27')]({'phone':_0x2a5728['phone']},{'where':{'ContactId':_0x32723b}})['then'](function(_0x5152c8){_0x10cbd5({'ret':'OK'});});});});}function insertCmHopper(_0x1b00d1,_0x31fa43,_0x4f9279,_0x54f602,_0x3432d4){var _0x185662=[_0x7c3b('0x2a'),'cm_contacts.scheduledat','cm_contacts.id',_0x7c3b('0x2b'),_0x31fa43+'.'+_0x54f602,_0x7c3b('0x2c'),_0x7c3b('0x2d'),_0x7c3b('0x2e'),_0x7c3b('0x2f'),'\x22'+_0x3432d4+'\x22'];return squel[_0x7c3b('0x30')]()['into'](_0x7c3b('0x31'))['fromQuery']([_0x7c3b('0x12'),_0x7c3b('0x32'),_0x7c3b('0x33'),_0x7c3b('0x34'),_0x54f602,'createdAt',_0x7c3b('0x35'),_0x7c3b('0x36'),_0x7c3b('0x37'),_0x7c3b('0x38')],squel[_0x7c3b('0x11')]()[_0x7c3b('0x39')](_0x185662)[_0x7c3b('0x13')](_0x31fa43)[_0x7c3b('0x18')]('cm_contacts',null,_0x7c3b('0x3a')+_0x31fa43+_0x7c3b('0x3b'))['join'](_0x4f9279,null,_0x4f9279+'.id\x20=\x20'+_0x31fa43+'.'+_0x54f602)[_0x7c3b('0x15')](_0x31fa43+_0x7c3b('0x3c'),_0x1b00d1)[_0x7c3b('0x15')](_0x7c3b('0x3d'),NOW)[_0x7c3b('0x15')](_0x7c3b('0x3e'),selectNotIn(_0x31fa43,_0x4f9279,_0x54f602,_0x7c3b('0x31'),['\x22always\x22',_0x7c3b('0x3f')]))[_0x7c3b('0x15')](_0x7c3b('0x3e'),selectNotIn(_0x31fa43,_0x4f9279,_0x54f602,_0x7c3b('0x31'),[_0x7c3b('0x40')])))[_0x7c3b('0x41')]();}function insertCmHopperBlack(_0x51f84e,_0x5bb302,_0x3ae86c,_0x2d27a3){var _0x1bd2c8=['cm_contacts.phone','cm_contacts.id',_0x7c3b('0x2b'),_0x5bb302+'.'+_0x2d27a3,_0x7c3b('0x2c'),'cm_contacts.updatedAt'];return squel[_0x7c3b('0x30')]()['into']('cm_hopper_black')[_0x7c3b('0x42')]([_0x7c3b('0x12'),_0x7c3b('0x33'),_0x7c3b('0x34'),_0x2d27a3,_0x7c3b('0x43'),_0x7c3b('0x35')],squel[_0x7c3b('0x11')]()[_0x7c3b('0x39')](_0x1bd2c8)[_0x7c3b('0x13')](_0x5bb302)[_0x7c3b('0x18')](_0x7c3b('0x44'),null,_0x7c3b('0x3a')+_0x5bb302+_0x7c3b('0x3b'))[_0x7c3b('0x18')](_0x3ae86c,null,_0x3ae86c+_0x7c3b('0x14')+_0x5bb302+'.'+_0x2d27a3)[_0x7c3b('0x15')](_0x5bb302+_0x7c3b('0x3c'),_0x51f84e)[_0x7c3b('0x15')](_0x7c3b('0x3d'),NOW)[_0x7c3b('0x15')](_0x7c3b('0x3e'),squel[_0x7c3b('0x11')]()[_0x7c3b('0x45')](_0x7c3b('0x12'))[_0x7c3b('0x13')](_0x7c3b('0x46'))['where'](_0x7c3b('0x47'),_0x51f84e)[_0x7c3b('0x15')](_0x2d27a3+_0x7c3b('0x48'),_0x5bb302+'.'+_0x2d27a3)))[_0x7c3b('0x41')]();}function insertCmHopperAdditionalPhones(_0xac81b8){var _0x52be07=[_0x7c3b('0x49'),_0x7c3b('0x4a'),_0x7c3b('0x4b'),_0x7c3b('0x4c'),_0x7c3b('0x4d')];return squel['insert']()[_0x7c3b('0x4e')]('cm_hopper_additional_phones')['fromQuery']([_0x7c3b('0x4f'),_0x7c3b('0x12'),_0x7c3b('0x50'),_0x7c3b('0x43'),_0x7c3b('0x35')],squel[_0x7c3b('0x11')]()[_0x7c3b('0x39')](_0x52be07)[_0x7c3b('0x13')](_0x7c3b('0x31'))[_0x7c3b('0x18')]('cm_contacts',null,_0x7c3b('0x51'))[_0x7c3b('0x18')](_0x7c3b('0x52'),null,_0x7c3b('0x53'))[_0x7c3b('0x15')](_0x7c3b('0x54'),_0xac81b8)[_0x7c3b('0x15')](_0x7c3b('0x3d'),NOW))[_0x7c3b('0x41')]();}function insertCmContact(_0x1c554b,_0x4dfbc9,_0x34d2b5,_0xcea59){var _0x14d785=_['concat'](_[_0x7c3b('0x55')](_0xcea59),[_0x7c3b('0x34'),_0x7c3b('0x56'),_0x7c3b('0x43'),'updatedAt']);return squel[_0x7c3b('0x30')]()[_0x7c3b('0x4e')]('cm_contacts')[_0x7c3b('0x42')](_0x14d785,squel['select']()[_0x7c3b('0x39')](_0x14d785)[_0x7c3b('0x13')](_0x4dfbc9)[_0x7c3b('0x15')]('('+_0x34d2b5['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x7c3b('0x39')](_0x34d2b5)[_0x7c3b('0x13')]('cm_contacts')['where'](_0x7c3b('0x47'),_0x1c554b))[_0x7c3b('0x15')](_0x7c3b('0x57'),squel['select']()[_0x7c3b('0x45')](_0x7c3b('0x58'),'min_id')[_0x7c3b('0x13')](_0x4dfbc9)['group'](_0x34d2b5[_0x7c3b('0x18')](','))))[_0x7c3b('0x41')]();}function handleStop(){logger[_0x7c3b('0x59')](_0x7c3b('0x5a'));stopped=!![];}function handleUncaughtException(_0x482033){logger[_0x7c3b('0x20')](_0x482033[_0x7c3b('0x21')]);process[_0x7c3b('0x5b')](0x1);}function handleError(_0x1d4d32,_0x2bca8c){stats['errors']['push']({'name':_0x2bca8c[_0x7c3b('0x5c')],'message':_0x2bca8c[_0x7c3b('0x21')],'row':_0x1d4d32});}function handleQuery(_0x45bc41){logger[_0x7c3b('0x59')](_0x45bc41);return db[_0x7c3b('0x5d')][_0x7c3b('0x19')](_0x45bc41)[_0x7c3b('0x5e')](function(_0x220609){results[_0x7c3b('0x1d')](_0x220609);})[_0x7c3b('0x1f')](function(_0x20a2d1){logger[_0x7c3b('0x20')](_0x20a2d1['message']);});}function main(_0x592a6d,_0x43ef6f,_0x537e0c,_0x53cf5d){logger[_0x7c3b('0x59')](_0x7c3b('0x5f'),_0x592a6d,JSON[_0x7c3b('0x60')](_0x43ef6f));process['send'](_0x7c3b('0x61'));var _0x421722=_0x43ef6f[_0x7c3b('0x62')];var _0x115cd1=_[_0x7c3b('0x63')](_0x421722);var _0x4329e4=_0x43ef6f[_0x7c3b('0x64')];var _0x1671cb=path[_0x7c3b('0x18')](config[_0x7c3b('0x65')],_0x7c3b('0x66'),_0x4329e4+'.csv');logger[_0x7c3b('0x59')](_0x7c3b('0x67'),_0x43ef6f);db[_0x7c3b('0x68')][_0x7c3b('0x69')]({'raw':!![],'attributes':['id',_0x7c3b('0x6a')]})[_0x7c3b('0x23')](function(_0x53500e){for(var _0xa0586=0x0;_0xa0586<_0x53500e[_0x7c3b('0x1b')];_0xa0586++){if(_0x53500e[_0xa0586][_0x7c3b('0x6a')]in _0x421722){contactItemTypes['push'](_0x53500e[_0xa0586]);delete _0x115cd1[_0x53500e[_0xa0586][_0x7c3b('0x6a')]];hasAdditionalPhones=!![];}for(var _0x7db036 in _0x421722){if(_0x53500e[_0xa0586]['name']+_0x7c3b('0x6b')===_0x7db036){phoneDescriptions['push']({'itemTypeId':_0x53500e[_0xa0586]['id'],'description':_0x7db036});delete _0x115cd1[_0x7db036];}}}if(hasAdditionalPhones)_0x115cd1['AdditionalPhones']='';var _0x421711=_['keys'](_0x115cd1)[_0x7c3b('0x18')]();logger[_0x7c3b('0x59')]('header',_0x421711);fs['writeFileSync'](_0x1671cb,_0x421711+'\x0a');Papa['parse'](fs['createReadStream'](_0x592a6d),{'header':!![],'skipEmptyLines':!![],'step':function(_0xab72e4,_0x265e18){try{for(var _0xf9de4d=0x0,_0x5f216e=[];_0xf9de4d<_0xab72e4['data'][_0x7c3b('0x1b')];_0xf9de4d++){stats[_0x7c3b('0x6c')]+=0x1;if(_0xab72e4[_0x7c3b('0x6d')][_0xf9de4d]){handleError(_0xab72e4['data'][_0xf9de4d],_0xab72e4['errors'][_0xf9de4d]);}else{var _0x306fc4=[];var _0x10204f=[];var _0x5862c8={};for(var _0x4fef3f in _0x421722){let _0xb73e0b=contactItemTypes[_0x7c3b('0x6e')](_0x448601=>_0x448601['name']===_0x4fef3f);let _0x239bbb=contactItemTypes['find'](_0x33610a=>_0x33610a[_0x7c3b('0x6a')]+_0x7c3b('0x6b')===_0x4fef3f);if(_[_0x7c3b('0x1c')](_0xb73e0b)&&_[_0x7c3b('0x1c')](_0x239bbb)){if(_0x421722[_0x7c3b('0x6f')](_0x4fef3f)){if(_0xab72e4[_0x7c3b('0x70')][_0xf9de4d][_0x421722[_0x4fef3f]]){var _0x767635=_[_0x7c3b('0x71')](_0xab72e4[_0x7c3b('0x70')][_0xf9de4d][_0x421722[_0x4fef3f]][_0x7c3b('0x72')](/"/g,'\x27'));switch(_0x4fef3f){case'scheduledat':var _0x36bded=moment(_0x767635,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x36bded['isValid']()){_0x5f216e['push']('\x22'+_0x767635+'\x22');}else{_0x306fc4[_0x7c3b('0x1d')](_0x7c3b('0x73'));}break;case _0x7c3b('0x36'):var _0x492b2d=parseInt(_0x767635);_0x767635=_[_0x7c3b('0x74')](_0x492b2d)||_0x492b2d<0x0||_0x492b2d>0x4?_0x53cf5d?0x3:0x2:_0x492b2d;_0x5f216e[_0x7c3b('0x1d')]('\x22'+_0x767635+'\x22');break;case'UserId':var _0xcf2f22=parseInt(_0x767635);if(_[_0x7c3b('0x75')](_0xcf2f22)&&_[_0x7c3b('0x76')](_0x537e0c,_0xcf2f22)){_0x5f216e[_0x7c3b('0x1d')]('\x22'+_0xcf2f22+'\x22');}else{_0x306fc4[_0x7c3b('0x1d')](_0x7c3b('0x77'));}break;case _0x7c3b('0x78'):if(isEmail(_0x767635)){_0x5f216e[_0x7c3b('0x1d')]('\x22'+_0x767635+'\x22');}else{_0x306fc4[_0x7c3b('0x1d')]('email\x20wrong\x20format');}break;case _0x7c3b('0x79'):var _0x4bf57d=moment(_0x767635,_0x7c3b('0x7a'),!![]);if(_0x4bf57d[_0x7c3b('0x7b')]()){_0x5f216e[_0x7c3b('0x1d')]('\x22'+_0x767635+'\x22');}else{_0x306fc4[_0x7c3b('0x1d')](_0x7c3b('0x7c'));}break;default:_0x5f216e['push']('\x22'+_0x767635+'\x22');}}else{switch(_0x4fef3f){case _0x7c3b('0x7d'):case _0x7c3b('0x12'):_0x306fc4[_0x7c3b('0x1d')](_0x4fef3f+'\x20not\x20specified');break;default:_0x5f216e[_0x7c3b('0x1d')]('\x22\x22');}}}}else{var _0x47c80e='';if(!_[_0x7c3b('0x1c')](_0xb73e0b)){if(!_0x5862c8[_0x7c3b('0x6f')](_0xb73e0b['id'])){for(var _0x55bd24=0x0;_0x55bd24<_0x421722[_0x4fef3f][_0x7c3b('0x1b')];_0x55bd24++){var _0x767635=_[_0x7c3b('0x71')](_0xab72e4[_0x7c3b('0x70')][_0xf9de4d][_0x421722[_0x4fef3f][_0x55bd24]][_0x7c3b('0x72')](/"/g,'\x27'));var _0x5bb4ed=phoneDescriptions[_0x7c3b('0x6e')](_0x37745d=>_0x37745d[_0x7c3b('0x7e')]===_0xb73e0b['id']);if(!_[_0x7c3b('0x1c')](_0x5bb4ed)){var _0x9b8449=_[_0x7c3b('0x71')](_0xab72e4['data'][_0xf9de4d][_0x421722[_0x5bb4ed[_0x7c3b('0x7f')]][0x0]][_0x7c3b('0x72')](/"/g,'\x27'));if(!_[_0x7c3b('0x1c')](_0x9b8449))_0x767635=_0x767635+'§'+_0x9b8449;}if(_0x47c80e=='')_0x47c80e=_0x767635;else _0x47c80e+='|'+_0x767635;}_0x10204f[_0x7c3b('0x1d')](_0xb73e0b['id']+':'+_0x47c80e);_0x5862c8[_0xb73e0b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5f216e[_0x7c3b('0x1d')]('\x22'+_0x10204f[_0x7c3b('0x18')](';')+'\x22');}if(_0x306fc4[_0x7c3b('0x1b')]){handleError(_0xab72e4[_0x7c3b('0x70')][_0xf9de4d],{'code':'SystemRow','message':_0x306fc4[_0x7c3b('0x18')]()});}else{fs[_0x7c3b('0x80')](_0x1671cb,_0x5f216e[_0x7c3b('0x18')]()+'\x0a');}_0x5f216e=[];}if(!(stats[_0x7c3b('0x6c')]%0xc8)){socket[_0x7c3b('0x81')]('contact:import:'+_0x4329e4,stats);stats[_0x7c3b('0x6d')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x265e18[_0x7c3b('0x82')]();}}catch(_0x4af0dc){handleError(_0xab72e4['data'][_0xf9de4d],{'code':_0x7c3b('0x83'),'message':_0x4af0dc[_0x7c3b('0x21')]});logger[_0x7c3b('0x20')](_0x7c3b('0x84'),_0x4af0dc['message']);}},'complete':function(){try{var _0x38d110=[];var _0x100779=tempTableName;_0x38d110[_0x7c3b('0x1d')](_0x7c3b('0x85')+_0x100779+'\x20LIKE\x20cm_contacts;');logger['info'](_0x7c3b('0x86'),contactItemTypes[_0x7c3b('0x1b')]);var _0x2994c8=util[_0x7c3b('0xc')](_0x7c3b('0x87'),_0x1671cb,_0x100779,_0x421711,_0x43ef6f[_0x7c3b('0x34')],_0x43ef6f[_0x7c3b('0x56')]||null,NOW,NOW);if(_[_0x7c3b('0x1c')](_0x421722[_0x7c3b('0x32')])){_0x2994c8+=_0x7c3b('0x88');}_0x38d110[_0x7c3b('0x1d')](_0x2994c8);BPromise['each'](_0x38d110,handleQuery)[_0x7c3b('0x23')](function(_0x10b32d){BPromise['all']([handleAdditionalPhones()])[_0x7c3b('0x23')](function(){_0x38d110=[];for(var _0x188ec2=0x0;_0x188ec2=_0x582703){return _0x43752e['status'](0x193)[_0x8c45('0x14')]({'message':util[_0x8c45('0xa')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4da364)});}_0x401912();})['catch'](function(_0x5e952e){_0x401912(_0x5e952e);});});}function isUserLimit(){return isLimit(_0x8c45('0x15'),0x1,db[_0x8c45('0x16')],{'where':{'$or':[{'role':_0x8c45('0x17')},{'role':_0x8c45('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x78e0=['createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x7e8c80,_0x402cb1){var _0x3bc133=function(_0x38d249){while(--_0x38d249){_0x7e8c80['push'](_0x7e8c80['shift']());}};_0x3bc133(++_0x402cb1);}(_0x78e0,0x1a2));var _0x078e=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x78e0[_0x813d0a];return _0x241352;};'use strict';var crypto=require('crypto');var util=require(_0x078e('0x0'));var compose=require(_0x078e('0x1'));var db=require(_0x078e('0x2'))['db'];var config=require(_0x078e('0x3'));function getValueFromLicense(_0x25dc8c,_0x34002d){if(_0x25dc8c&&_0x34002d){if(_0x34002d[_0x078e('0x4')]&&_0x34002d[_0x078e('0x5')]){var _0x37975e=_0x34002d[_0x078e('0x4')];var _0x3b26c1=_0x34002d['license'];var _0x15291a=_0x37975e['split']('-')[0x4];var _0x5614c2=_0x37975e[_0x078e('0x6')]('-')[0x0];var _0x42198d=crypto[_0x078e('0x7')](_0x078e('0x8'),util[_0x078e('0x9')](_0x078e('0xa'),_0x15291a,_0x37975e,_0x5614c2));var _0x1b8a19=_0x42198d[_0x078e('0xb')](_0x3b26c1,_0x078e('0xc'),_0x078e('0xd'));_0x1b8a19+=_0x42198d[_0x078e('0xe')](_0x078e('0xd'));var _0x11cf2b=JSON[_0x078e('0xf')](_0x1b8a19);return _0x11cf2b['hasOwnProperty'](_0x25dc8c)?_0x11cf2b[_0x25dc8c]:null;}}return null;}function isLimit(_0x5af793,_0x43eb85,_0x48bd9b,_0x3d9d80){var _0x4e2b0d=_0x43eb85;return compose()[_0x078e('0x10')](function(_0xcf213b,_0x58cad8,_0x38c8b9){return db[_0x078e('0x11')][_0x078e('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x078e('0x13')](function(_0x3e5170){var _0x418c1b=getValueFromLicense(_0x5af793,_0x3e5170);return _0x418c1b?_0x418c1b:_0x4e2b0d;})['then'](function(_0x326072){_0x4e2b0d=_0x326072;return _0x48bd9b['count'](_0x3d9d80);})[_0x078e('0x13')](function(_0x27ec61){if(_0x27ec61>=_0x4e2b0d){return _0x58cad8[_0x078e('0x14')](0x193)['json']({'message':util[_0x078e('0x9')](_0x078e('0x15'),_0x5af793)});}_0x38c8b9();})['catch'](function(_0x4eb856){_0x38c8b9(_0x4eb856);});});}function isUserLimit(){return isLimit(_0x078e('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x078e('0x17')},{'role':_0x078e('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 672afe9..313acb7 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 _0xea0a=['buildExpression','DATE','operator','$between','value','includes','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','utcOffset','format','hours','minutes','seconds','lodash','parseSearch','startsWith','[$or]','[$and]','replace','split','length','shift','forEach','filter','indexOf','map','push'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0xea0a,0xfb));var _0xaea0=function(_0x27d31e,_0x3480c1){_0x27d31e=_0x27d31e-0x0;var _0x518a2a=_0xea0a[_0x27d31e];return _0x518a2a;};'use strict';var _=require(_0xaea0('0x0'));var moment=require('moment');exports[_0xaea0('0x1')]=function(_0x2b39ef){var _0x12909c={'conditions':[]};_0x12909c['sqlOperator']=_[_0xaea0('0x2')](_0x2b39ef,_0xaea0('0x3'))?'or':'and';var _0x22dd9e=_0x2b39ef['replace'](_0xaea0('0x4'),'')[_0xaea0('0x5')]('[$or]','')[_0xaea0('0x6')]('||');for(var _0x362c93=0x0;_0x362c93<_0x22dd9e[_0xaea0('0x7')];_0x362c93++){var _0x402d56=_0x22dd9e[_0x362c93][_0xaea0('0x6')](':=');var _0x287e38=_0x402d56[0x0];var _0x4880e5=_0x402d56['slice'](0x1);_0x4880e5['forEach'](function(_0x174e59){var _0x43b6b1=_0x174e59[_0xaea0('0x6')]('[')[_0xaea0('0x8')]();var _0x2c35f3=_0x174e59['match'](/\[(.*?)\]/g);_0x2c35f3[_0xaea0('0x9')](function(_0xdba8a3){var _0x2e85ce=_0xdba8a3[_0xaea0('0x6')]('[')[_0xaea0('0xa')](function(_0x3c48bc){return _0x3c48bc[_0xaea0('0xb')](']')>-0x1;})[_0xaea0('0xc')](function(_0x2577eb){return _0x2577eb[_0xaea0('0x6')](']')[0x0];})[0x0];_0x12909c['conditions'][_0xaea0('0xd')]({'field':_0x287e38,'operator':_0x43b6b1,'value':_0x2e85ce});});});}return _0x12909c;};exports[_0xaea0('0xe')]=function(_0x4a35ad,_0x37b381,_0x3782c8){var _0x1bb0fe={};if(_0x37b381===_0xaea0('0xf')){if(_0x3782c8[_0xaea0('0x10')]==='$eq'){_0x3782c8[_0xaea0('0x10')]=_0xaea0('0x11');_0x3782c8['value']+=','+_0x3782c8[_0xaea0('0x12')];}else if(_[_0xaea0('0x13')](['$gt',_0xaea0('0x14')],_0x3782c8[_0xaea0('0x10')])){_0x3782c8[_0xaea0('0x12')]=moment(_0x3782c8[_0xaea0('0x12')])[_0xaea0('0x15')](0x1,_0xaea0('0x16'))['format'](_0xaea0('0x17'));}}if(_0x3782c8[_0xaea0('0x18')]){_0x37b381=_0x3782c8[_0xaea0('0x18')];_0x1bb0fe[_0xaea0('0x19')]=_0xaea0('0x1a')+_0x4a35ad+'.'+_0x3782c8[_0xaea0('0x1b')]+'\x20AS\x20'+_0x3782c8[_0xaea0('0x18')]+')\x20'+parseOperator(_0x3782c8[_0xaea0('0x10')]);}else{_0x1bb0fe['text']=_0x4a35ad+'.'+_0x3782c8['field']+'\x20'+parseOperator(_0x3782c8[_0xaea0('0x10')]);}if(_[_0xaea0('0x13')]([_0xaea0('0x1c'),_0xaea0('0x1d')],_0x3782c8[_0xaea0('0x10')]))_0x1bb0fe['text']='('+_0x1bb0fe['text']+_0xaea0('0x1e')+_0x4a35ad+'.'+_0x3782c8[_0xaea0('0x1b')]+_0xaea0('0x1f');_0x1bb0fe[_0xaea0('0x12')]=parseValue(_0x37b381,_0x3782c8[_0xaea0('0x10')],_0x3782c8[_0xaea0('0x12')]);return _0x1bb0fe;};function parseOperator(_0x1162e6){var _0x4a84e3;switch(_0x1162e6){case'$in':_0x4a84e3=_0xaea0('0x20');break;case _0xaea0('0x1d'):_0x4a84e3=_0xaea0('0x21');break;case _0xaea0('0x22'):_0x4a84e3=_0xaea0('0x23');break;case'$ne':_0x4a84e3=_0xaea0('0x24');break;case'$substring':case _0xaea0('0x25'):case _0xaea0('0x26'):_0x4a84e3=_0xaea0('0x27');break;case'$lt':_0x4a84e3=_0xaea0('0x28');break;case _0xaea0('0x29'):_0x4a84e3='>\x20?';break;case _0xaea0('0x14'):_0x4a84e3=_0xaea0('0x2a');break;case _0xaea0('0x2b'):_0x4a84e3='>=\x20?';break;case _0xaea0('0x11'):_0x4a84e3=_0xaea0('0x2c');break;}return _0x4a84e3;}function parseValue(_0x50c02b,_0x1aeab4,_0x13f0c6){var _0x310244={'start':undefined,'end':undefined};switch(_0x1aeab4){case _0xaea0('0x2d'):case _0xaea0('0x1d'):_0x310244[_0xaea0('0x2e')]=_0x13f0c6[_0xaea0('0x6')](',');break;case _0xaea0('0x2f'):_0x310244[_0xaea0('0x2e')]='%'+_0x13f0c6+'%';break;case _0xaea0('0x25'):_0x310244[_0xaea0('0x2e')]=_0x13f0c6+'%';break;case _0xaea0('0x26'):_0x310244['start']='%'+_0x13f0c6;break;case _0xaea0('0x11'):var _0x4941b3=_0x13f0c6[_0xaea0('0x6')](',');var _0x13f0c6=_0x4941b3[_0xaea0('0x8')]();var _0xfc6d1c=_0x4941b3['pop']();if(_0x50c02b===_0xaea0('0xf')){_0x13f0c6=moment(_0x13f0c6)[_0xaea0('0x30')](0x0,!![])[_0xaea0('0x31')]();_0xfc6d1c=moment(_0xfc6d1c)[_0xaea0('0x30')](0x0,!![])[_0xaea0('0x15')](0x17,_0xaea0('0x32'))[_0xaea0('0x15')](0x3b,_0xaea0('0x33'))[_0xaea0('0x15')](0x3b,_0xaea0('0x34'))[_0xaea0('0x31')]();}_0x310244={'start':_0x13f0c6,'end':_0xfc6d1c};break;default:_0x310244[_0xaea0('0x2e')]=_0x13f0c6;break;}return _0x310244;} \ No newline at end of file +var _0x2c19=['<>\x20?','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','pop','utcOffset','hours','minutes','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','match','map','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','IN\x20?'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2c19,0x1da));var _0x92c1=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x2c19[_0xac151d];return _0x111dba;};'use strict';var _=require('lodash');var moment=require(_0x92c1('0x0'));exports[_0x92c1('0x1')]=function(_0x4c1ec9){var _0x43982e={'conditions':[]};_0x43982e[_0x92c1('0x2')]=_[_0x92c1('0x3')](_0x4c1ec9,_0x92c1('0x4'))?'or':_0x92c1('0x5');var _0x5b6106=_0x4c1ec9[_0x92c1('0x6')]('[$and]','')[_0x92c1('0x6')](_0x92c1('0x4'),'')[_0x92c1('0x7')]('||');for(var _0x61252f=0x0;_0x61252f<_0x5b6106[_0x92c1('0x8')];_0x61252f++){var _0x7f54bc=_0x5b6106[_0x61252f]['split'](':=');var _0x44d6d7=_0x7f54bc[0x0];var _0x3c0f42=_0x7f54bc[_0x92c1('0x9')](0x1);_0x3c0f42[_0x92c1('0xa')](function(_0x1c5fb4){var _0x498976=_0x1c5fb4[_0x92c1('0x7')]('[')[_0x92c1('0xb')]();var _0x30bf3d=_0x1c5fb4[_0x92c1('0xc')](/\[(.*?)\]/g);_0x30bf3d[_0x92c1('0xa')](function(_0x3324c4){var _0x1cbe7a=_0x3324c4[_0x92c1('0x7')]('[')['filter'](function(_0x40a51d){return _0x40a51d['indexOf'](']')>-0x1;})[_0x92c1('0xd')](function(_0x34598a){return _0x34598a[_0x92c1('0x7')](']')[0x0];})[0x0];_0x43982e['conditions'][_0x92c1('0xe')]({'field':_0x44d6d7,'operator':_0x498976,'value':_0x1cbe7a});});});}return _0x43982e;};exports[_0x92c1('0xf')]=function(_0x60fc61,_0xa9dcf3,_0x1e72bb){var _0x4aa354={};if(_0xa9dcf3===_0x92c1('0x10')){if(_0x1e72bb['operator']===_0x92c1('0x11')){_0x1e72bb[_0x92c1('0x12')]=_0x92c1('0x13');_0x1e72bb[_0x92c1('0x14')]+=','+_0x1e72bb[_0x92c1('0x14')];}else if(_[_0x92c1('0x15')]([_0x92c1('0x16'),_0x92c1('0x17')],_0x1e72bb[_0x92c1('0x12')])){_0x1e72bb[_0x92c1('0x14')]=moment(_0x1e72bb[_0x92c1('0x14')])[_0x92c1('0x18')](0x1,_0x92c1('0x19'))[_0x92c1('0x1a')](_0x92c1('0x1b'));}}if(_0x1e72bb[_0x92c1('0x1c')]){_0xa9dcf3=_0x1e72bb[_0x92c1('0x1c')];_0x4aa354[_0x92c1('0x1d')]='CAST('+_0x60fc61+'.'+_0x1e72bb[_0x92c1('0x1e')]+_0x92c1('0x1f')+_0x1e72bb[_0x92c1('0x1c')]+')\x20'+parseOperator(_0x1e72bb[_0x92c1('0x12')]);}else{_0x4aa354['text']=_0x60fc61+'.'+_0x1e72bb[_0x92c1('0x1e')]+'\x20'+parseOperator(_0x1e72bb[_0x92c1('0x12')]);}if(_[_0x92c1('0x15')]([_0x92c1('0x20'),_0x92c1('0x21')],_0x1e72bb[_0x92c1('0x12')]))_0x4aa354[_0x92c1('0x1d')]='('+_0x4aa354[_0x92c1('0x1d')]+_0x92c1('0x22')+_0x60fc61+'.'+_0x1e72bb[_0x92c1('0x1e')]+'\x20IS\x20NULL)';_0x4aa354['value']=parseValue(_0xa9dcf3,_0x1e72bb[_0x92c1('0x12')],_0x1e72bb[_0x92c1('0x14')]);return _0x4aa354;};function parseOperator(_0x52e164){var _0x42b96b;switch(_0x52e164){case'$in':_0x42b96b=_0x92c1('0x23');break;case'$notIn':_0x42b96b='NOT\x20IN\x20?';break;case _0x92c1('0x11'):_0x42b96b='=\x20?';break;case _0x92c1('0x20'):_0x42b96b=_0x92c1('0x24');break;case'$substring':case _0x92c1('0x25'):case _0x92c1('0x26'):_0x42b96b=_0x92c1('0x27');break;case'$lt':_0x42b96b=_0x92c1('0x28');break;case _0x92c1('0x16'):_0x42b96b='>\x20?';break;case'$lte':_0x42b96b='<=\x20?';break;case _0x92c1('0x29'):_0x42b96b=_0x92c1('0x2a');break;case'$between':_0x42b96b=_0x92c1('0x2b');break;}return _0x42b96b;}function parseValue(_0x25b0da,_0x42f24b,_0xa181e0){var _0x31c5c7={'start':undefined,'end':undefined};switch(_0x42f24b){case _0x92c1('0x2c'):case'$notIn':_0x31c5c7[_0x92c1('0x2d')]=_0xa181e0[_0x92c1('0x7')](',');break;case _0x92c1('0x2e'):_0x31c5c7[_0x92c1('0x2d')]='%'+_0xa181e0+'%';break;case'$startsWith':_0x31c5c7[_0x92c1('0x2d')]=_0xa181e0+'%';break;case _0x92c1('0x26'):_0x31c5c7[_0x92c1('0x2d')]='%'+_0xa181e0;break;case'$between':var _0x29c508=_0xa181e0[_0x92c1('0x7')](',');var _0xa181e0=_0x29c508[_0x92c1('0xb')]();var _0x25e784=_0x29c508[_0x92c1('0x2f')]();if(_0x25b0da==='DATE'){_0xa181e0=moment(_0xa181e0)[_0x92c1('0x30')](0x0,!![])['format']();_0x25e784=moment(_0x25e784)['utcOffset'](0x0,!![])[_0x92c1('0x18')](0x17,_0x92c1('0x31'))[_0x92c1('0x18')](0x3b,_0x92c1('0x32'))['add'](0x3b,'seconds')[_0x92c1('0x1a')]();}_0x31c5c7={'start':_0xa181e0,'end':_0x25e784};break;default:_0x31c5c7[_0x92c1('0x2d')]=_0xa181e0;break;}return _0x31c5c7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d343007..a7edbe2 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 _0xf072=['DESC','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','pick','filter','object','includes','columns','where','merge','type','lower','col','options','lodash','sequelize','moment','parse','keys','fields','split','filters','forOwn','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','sort','map','cast','priority','substr'];(function(_0x35c4e8,_0x18ff04){var _0x4a958a=function(_0x43b341){while(--_0x43b341){_0x35c4e8['push'](_0x35c4e8['shift']());}};_0x4a958a(++_0x18ff04);}(_0xf072,0x1cf));var _0x2f07=function(_0x1141a2,_0x165358){_0x1141a2=_0x1141a2-0x0;var _0x2098a6=_0xf072[_0x1141a2];return _0x2098a6;};'use strict';var _=require(_0x2f07('0x0'));var sequelize=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f62b0){var _0x3c1c25=['ne'];try{var _0x5f20e3=JSON[_0x2f07('0x3')](_0x4f62b0);var _0x432696=Object[_0x2f07('0x4')](_0x5f20e3)[0x0];return _0x3c1c25['includes'](_0x432696);}catch(_0x1d5a33){return![];}}function getOperatorValue(_0x14d6e6){var _0x3643bb=JSON[_0x2f07('0x3')](_0x14d6e6);var _0x235418=Object[_0x2f07('0x4')](_0x3643bb)[0x0];var _0x33b99c=_0x3643bb[_0x235418];return{['$'+_0x235418]:_0x33b99c};}exports[_0x2f07('0x5')]=function(_0x4746c2){var _0x2e167=null;if(_0x4746c2){_0x2e167=_0x4746c2[_0x2f07('0x6')](',');}return _0x2e167;};exports[_0x2f07('0x7')]=function(_0x1a3848,_0x18fe13){var _0x14e237={};if(!_['isEmpty'](_0x1a3848)){_[_0x2f07('0x8')](_0x1a3848,function(_0x2f464b,_0x1d0812){try{if(_0x18fe13){var _0x3525be=_['find'](_0x18fe13,{'name':_0x1d0812})||{};if(hasSequelizeOperator(_0x2f464b)){_0x14e237[_0x1d0812]=getOperatorValue(_0x2f464b);}else if(_0x3525be['type']===_0x2f07('0x9')&&_[_0x2f07('0xa')](_0x2f464b)){var _0x58549c=JSON[_0x2f07('0x3')](_0x2f464b);var _0x34dbd4={'$gte':moment(moment(_0x58549c[_0x2f07('0xb')])['format'](_0x2f07('0xc')))[_0x2f07('0xd')]()[_0x2f07('0xe')](),'$lte':moment(moment(_0x58549c[_0x2f07('0xf')])[_0x2f07('0xe')](_0x2f07('0xc')))['utc']()[_0x2f07('0x10')](0x1,'s')['format']()};_0x14e237[_0x1d0812]=_0x34dbd4;}else if(_0x3525be[_0x2f07('0x11')]===_0x2f07('0x12')){_0x14e237[_0x1d0812]=_0x2f464b;}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}catch(_0x1a6135){_0x14e237[_0x1d0812]=_0x2f464b[_0x2f07('0x6')](',');}});}return _0x14e237;};exports['limit']=function(_0x15c3dd){_0x15c3dd=parseInt(_0x15c3dd,0xa);if(!_0x15c3dd||_0x15c3dd<0x0){_0x15c3dd=LIMIT_VALUE;}return _0x15c3dd;};exports['offset']=function(_0x3cd3c0){_0x3cd3c0=parseInt(_0x3cd3c0,0xa);if(!_0x3cd3c0||_0x3cd3c0<0x0){_0x3cd3c0=0x0;}return _0x3cd3c0;};exports[_0x2f07('0x14')]=function(_0x119b68){var _0xd944d6,_0x2ef47d=null;if(_0x119b68){_0xd944d6=_0x119b68['split'](',');_0x2ef47d=_[_0x2f07('0x15')](_0xd944d6,function(_0x5a0146){if(_0x5a0146['indexOf']('-')===0x0){return[_0x5a0146==='priority'?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),'unsigned'):_0x5a0146[_0x2f07('0x18')](0x1),_0x2f07('0x19')];}else{return[_0x5a0146===_0x2f07('0x17')?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),_0x2f07('0x1a')):_0x5a0146,_0x2f07('0x1b')];}});}return _0x2ef47d;};exports['omit']=function(_0x111376,_0x113916){if(_['isEmpty'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x13')](_0x111376)){for(var _0x1c9ca1=0x0;_0x1c9ca1<_0x111376['length'];_0x1c9ca1+=0x1){_0x111376[_0x1c9ca1]=this[_0x2f07('0x1c')](_0x111376[_0x1c9ca1],_0x113916);}return _0x111376;}if(!_['isObject'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x1d')](_0x113916)){_0x113916=[_0x113916];}if(!_[_0x2f07('0x13')](_0x113916)){return _0x111376;}for(var _0x27bd72=0x0;_0x27bd72<_0x113916[_0x2f07('0x1e')];_0x27bd72+=0x1){_[_0x2f07('0x1f')](_0x111376,_0x113916[_0x27bd72]);}for(var _0x139ea8 in _0x111376){if(_0x111376[_0x2f07('0x20')](_0x139ea8)){_0x111376[_0x139ea8]=this[_0x2f07('0x1c')](_0x111376[_0x139ea8],_0x113916);}}return _0x111376;};exports[_0x2f07('0x21')]=function(_0x468cd8){return _0x468cd8[_0x2f07('0x22')](RegExp(_0x2f07('0x23')))?!![]:![];};exports['isEmail']=function(_0x1accef){return _0x1accef[_0x2f07('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x2f07('0x24')]=function(_0x571839){var _0x36d4b8=[];_0x571839[_0x2f07('0x6')](/[ ,]+/)[_0x2f07('0x25')](function(_0x5ad0de){_0x5ad0de=_0x5ad0de[_0x2f07('0x26')](/([^:]")"+/g,'$1');_0x5ad0de='+'+_0x5ad0de+'*';var _0x368e3d=/[ `!@#$%^&*()_\-?~]/;if(_0x5ad0de[_0x2f07('0x22')](_0x368e3d))_0x5ad0de='\x22'+_0x5ad0de+'\x22';_0x36d4b8[_0x2f07('0x27')](_0x5ad0de);});return _0x36d4b8[_0x2f07('0x28')]('\x20');};exports[_0x2f07('0x29')]=function(_0x3fed73,_0x5c7593,_0x1decd1){var _0x5b0407={},_0x3496eb={};if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')]){_0x5c7593[_0x2f07('0x2a')]['id']=_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];delete _0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];}_0x5b0407[_0x2f07('0x2c')]=_[_0x2f07('0x15')](_0x3fed73,_0x2f07('0x11'));_0x5b0407[_0x2f07('0x2a')]=_[_0x2f07('0x4')](_0x5c7593[_0x2f07('0x2a')]);_0x5b0407[_0x2f07('0x7')]=_[_0x2f07('0x2d')](_0x5b0407['model'],_0x5b0407['query']);_0x3496eb[_0x2f07('0x2e')]=_[_0x2f07('0x2d')](_0x5b0407[_0x2f07('0x2c')],this['fields'](_0x5c7593['query'][_0x2f07('0x5')]));_0x3496eb['attributes']=_0x3496eb[_0x2f07('0x2e')][_0x2f07('0x1e')]?_0x3496eb[_0x2f07('0x2e')]:_0x5b0407[_0x2f07('0x2c')];if(!_0x5c7593[_0x2f07('0x2a')]['hasOwnProperty'](_0x2f07('0x2f'))){_0x3496eb['limit']=this[_0x2f07('0x30')](_0x5c7593['query'][_0x2f07('0x30')]);_0x3496eb['offset']=this['offset'](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x31')]);}_0x3496eb['order']=this[_0x2f07('0x14')](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x14')]);_0x3496eb['where']=this[_0x2f07('0x7')](_[_0x2f07('0x32')](_0x5c7593[_0x2f07('0x2a')],_0x5b0407[_0x2f07('0x7')]),_0x3fed73);if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x33')]){var _0x1a0ef2=_0x3fed73;var _0x1a9645=_0x5c7593['query'][_0x2f07('0x33')];if(typeof _0x1a9645===_0x2f07('0x34')){_0x1a0ef2=_[_0x2f07('0x33')](_0x3fed73,function(_0x3f1b6b){return _[_0x2f07('0x35')](_0x1a9645[_0x2f07('0x36')],_0x3f1b6b[_0x2f07('0x11')]);});_0x1a9645=_0x1a9645['value'];}_0x3496eb[_0x2f07('0x37')]=_[_0x2f07('0x38')](_0x3496eb[_0x2f07('0x37')],{'$or':_[_0x2f07('0x15')](_0x1a0ef2,function(_0x3db7ad){if(_0x3db7ad[_0x2f07('0x39')]!=='VIRTUAL'){if(_0x1decd1){return sequelize[_0x2f07('0x37')](sequelize['fn'](_0x2f07('0x3a'),sequelize[_0x2f07('0x3b')](_0x3db7ad[_0x2f07('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5c7593['query'][_0x2f07('0x33')]+'%')});}else{var _0x437e94={};_0x437e94[_0x3db7ad[_0x2f07('0x11')]]={'$like':'%'+_0x5c7593[_0x2f07('0x2a')]['filter']+'%'};return _0x437e94;}}})});}_0x3496eb=_[_0x2f07('0x38')]({},_0x3496eb,_0x5c7593[_0x2f07('0x3c')]);return _0x3496eb;}; \ No newline at end of file +var _0x0fda=['name','intersection','attributes','length','nolimit','limit','order','pick','filter','object','includes','columns','where','VIRTUAL','lower','merge','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','type','DATE','format','YYYY-MM-DD','utc','$lte','subtract','isArray','offset','sort','map','priority','cast','col','unsigned','substr','DESC','ASC','isObject','isString','omit','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','query','$id','model'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x428196,_0x148d80){_0x428196=_0x428196-0x0;var _0x2f7ca0=_0x0fda[_0x428196];return _0x2f7ca0;};'use strict';var _=require(_0xa0fd('0x0'));var sequelize=require('sequelize');var moment=require(_0xa0fd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x28e34c){var _0x314a1a=['ne'];try{var _0x2f71f3=JSON[_0xa0fd('0x2')](_0x28e34c);var _0xd8e73a=Object[_0xa0fd('0x3')](_0x2f71f3)[0x0];return _0x314a1a['includes'](_0xd8e73a);}catch(_0x4978fa){return![];}}function getOperatorValue(_0x65fa5d){var _0x4aec58=JSON['parse'](_0x65fa5d);var _0x868183=Object[_0xa0fd('0x3')](_0x4aec58)[0x0];var _0x1aab41=_0x4aec58[_0x868183];return{['$'+_0x868183]:_0x1aab41};}exports[_0xa0fd('0x4')]=function(_0x5d996b){var _0x29da4c=null;if(_0x5d996b){_0x29da4c=_0x5d996b[_0xa0fd('0x5')](',');}return _0x29da4c;};exports[_0xa0fd('0x6')]=function(_0x322a1a,_0x4e1873){var _0x31088d={};if(!_[_0xa0fd('0x7')](_0x322a1a)){_[_0xa0fd('0x8')](_0x322a1a,function(_0x5c1786,_0x4409e4){try{if(_0x4e1873){var _0x332e66=_[_0xa0fd('0x9')](_0x4e1873,{'name':_0x4409e4})||{};if(hasSequelizeOperator(_0x5c1786)){_0x31088d[_0x4409e4]=getOperatorValue(_0x5c1786);}else if(_0x332e66[_0xa0fd('0xa')]===_0xa0fd('0xb')&&_['isPlainObject'](_0x5c1786)){var _0x490112=JSON[_0xa0fd('0x2')](_0x5c1786);var _0x16fe85={'$gte':moment(moment(_0x490112['$gte'])[_0xa0fd('0xc')](_0xa0fd('0xd')))[_0xa0fd('0xe')]()[_0xa0fd('0xc')](),'$lte':moment(moment(_0x490112[_0xa0fd('0xf')])[_0xa0fd('0xc')](_0xa0fd('0xd')))['utc']()[_0xa0fd('0x10')](0x1,'s')[_0xa0fd('0xc')]()};_0x31088d[_0x4409e4]=_0x16fe85;}else if(_0x332e66['name']==='uniqueid'){_0x31088d[_0x4409e4]=_0x5c1786;}else{_0x31088d[_0x4409e4]=_[_0xa0fd('0x11')](_0x5c1786)?_0x5c1786:JSON[_0xa0fd('0x2')](_0x5c1786);}}else{_0x31088d[_0x4409e4]=_['isArray'](_0x5c1786)?_0x5c1786:JSON[_0xa0fd('0x2')](_0x5c1786);}}catch(_0x22a876){_0x31088d[_0x4409e4]=_0x5c1786[_0xa0fd('0x5')](',');}});}return _0x31088d;};exports['limit']=function(_0x50cde2){_0x50cde2=parseInt(_0x50cde2,0xa);if(!_0x50cde2||_0x50cde2<0x0){_0x50cde2=LIMIT_VALUE;}return _0x50cde2;};exports[_0xa0fd('0x12')]=function(_0x558109){_0x558109=parseInt(_0x558109,0xa);if(!_0x558109||_0x558109<0x0){_0x558109=0x0;}return _0x558109;};exports[_0xa0fd('0x13')]=function(_0x2de471){var _0x10f64b,_0x2cf99d=null;if(_0x2de471){_0x10f64b=_0x2de471[_0xa0fd('0x5')](',');_0x2cf99d=_[_0xa0fd('0x14')](_0x10f64b,function(_0x113059){if(_0x113059['indexOf']('-')===0x0){return[_0x113059===_0xa0fd('0x15')?sequelize[_0xa0fd('0x16')](sequelize[_0xa0fd('0x17')](_0xa0fd('0x15')),_0xa0fd('0x18')):_0x113059[_0xa0fd('0x19')](0x1),_0xa0fd('0x1a')];}else{return[_0x113059===_0xa0fd('0x15')?sequelize[_0xa0fd('0x16')](sequelize[_0xa0fd('0x17')](_0xa0fd('0x15')),_0xa0fd('0x18')):_0x113059,_0xa0fd('0x1b')];}});}return _0x2cf99d;};exports['omit']=function(_0x37177b,_0x39d8e5){if(_['isEmpty'](_0x37177b)){return _0x37177b;}if(_[_0xa0fd('0x11')](_0x37177b)){for(var _0x3cd5b0=0x0;_0x3cd5b0<_0x37177b['length'];_0x3cd5b0+=0x1){_0x37177b[_0x3cd5b0]=this['omit'](_0x37177b[_0x3cd5b0],_0x39d8e5);}return _0x37177b;}if(!_[_0xa0fd('0x1c')](_0x37177b)){return _0x37177b;}if(_[_0xa0fd('0x1d')](_0x39d8e5)){_0x39d8e5=[_0x39d8e5];}if(!_['isArray'](_0x39d8e5)){return _0x37177b;}for(var _0x5c70fb=0x0;_0x5c70fb<_0x39d8e5['length'];_0x5c70fb+=0x1){_['unset'](_0x37177b,_0x39d8e5[_0x5c70fb]);}for(var _0x11d7f1 in _0x37177b){if(_0x37177b['hasOwnProperty'](_0x11d7f1)){_0x37177b[_0x11d7f1]=this[_0xa0fd('0x1e')](_0x37177b[_0x11d7f1],_0x39d8e5);}}return _0x37177b;};exports[_0xa0fd('0x1f')]=function(_0x2f5b0d){return _0x2f5b0d['match'](RegExp(_0xa0fd('0x20')))?!![]:![];};exports[_0xa0fd('0x21')]=function(_0x4feb93){return _0x4feb93[_0xa0fd('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xa0fd('0x23')]=function(_0x58ddb3){var _0x366921=[];_0x58ddb3[_0xa0fd('0x5')](/[ ,]+/)[_0xa0fd('0x24')](function(_0x2993aa){_0x2993aa=_0x2993aa['replace'](/([^:]")"+/g,'$1');_0x2993aa='+'+_0x2993aa+'*';var _0x33785f=/[ `!@#$%^&*()_\-?~]/;if(_0x2993aa[_0xa0fd('0x22')](_0x33785f))_0x2993aa='\x22'+_0x2993aa+'\x22';_0x366921['push'](_0x2993aa);});return _0x366921['join']('\x20');};exports['getOptions']=function(_0x1fc249,_0x481271,_0x4bf462){var _0x2c3110={},_0x56f911={};if(_0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')]){_0x481271[_0xa0fd('0x25')]['id']=_0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')];delete _0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')];}_0x2c3110[_0xa0fd('0x27')]=_['map'](_0x1fc249,_0xa0fd('0x28'));_0x2c3110['query']=_[_0xa0fd('0x3')](_0x481271['query']);_0x2c3110['filters']=_[_0xa0fd('0x29')](_0x2c3110['model'],_0x2c3110[_0xa0fd('0x25')]);_0x56f911[_0xa0fd('0x2a')]=_[_0xa0fd('0x29')](_0x2c3110[_0xa0fd('0x27')],this['fields'](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x4')]));_0x56f911[_0xa0fd('0x2a')]=_0x56f911[_0xa0fd('0x2a')][_0xa0fd('0x2b')]?_0x56f911[_0xa0fd('0x2a')]:_0x2c3110[_0xa0fd('0x27')];if(!_0x481271['query']['hasOwnProperty'](_0xa0fd('0x2c'))){_0x56f911[_0xa0fd('0x2d')]=this[_0xa0fd('0x2d')](_0x481271[_0xa0fd('0x25')]['limit']);_0x56f911[_0xa0fd('0x12')]=this[_0xa0fd('0x12')](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x12')]);}_0x56f911[_0xa0fd('0x2e')]=this['sort'](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x13')]);_0x56f911['where']=this['filters'](_[_0xa0fd('0x2f')](_0x481271[_0xa0fd('0x25')],_0x2c3110[_0xa0fd('0x6')]),_0x1fc249);if(_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')]){var _0xbeca16=_0x1fc249;var _0x41b390=_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')];if(typeof _0x41b390===_0xa0fd('0x31')){_0xbeca16=_[_0xa0fd('0x30')](_0x1fc249,function(_0x1c9bba){return _[_0xa0fd('0x32')](_0x41b390[_0xa0fd('0x33')],_0x1c9bba[_0xa0fd('0x28')]);});_0x41b390=_0x41b390['value'];}_0x56f911['where']=_['merge'](_0x56f911[_0xa0fd('0x34')],{'$or':_[_0xa0fd('0x14')](_0xbeca16,function(_0x399eb1){if(_0x399eb1['type']!==_0xa0fd('0x35')){if(_0x4bf462){return sequelize[_0xa0fd('0x34')](sequelize['fn'](_0xa0fd('0x36'),sequelize['col'](_0x399eb1[_0xa0fd('0x28')])),{'$like':sequelize['fn'](_0xa0fd('0x36'),'%'+_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')]+'%')});}else{var _0x2a35fa={};_0x2a35fa[_0x399eb1[_0xa0fd('0x28')]]={'$like':'%'+_0x481271['query'][_0xa0fd('0x30')]+'%'};return _0x2a35fa;}}})});}_0x56f911=_[_0xa0fd('0x37')]({},_0x56f911,_0x481271[_0xa0fd('0x38')]);return _0x56f911;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 6ead9ff..0079649 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91a5=['routealias','pick','value','filterAgentAttributes','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','unknown','unavailable','isNil','voiceStatus','idle','pause','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','*pause','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','includes','busy','resolve','name','fullname','voicePause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','order','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent'];(function(_0xf8ed46,_0x4b44cf){var _0x3c3b24=function(_0x3e9e01){while(--_0x3e9e01){_0xf8ed46['push'](_0xf8ed46['shift']());}};_0x3c3b24(++_0x4b44cf);}(_0x91a5,0xb2));var _0x591a=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x91a5[_0x2f8530];return _0x5e814e;};'use strict';var _=require(_0x591a('0x0'));var jayson=require('jayson/promise');var db=require(_0x591a('0x1'))['db'];var amiClient=jayson[_0x591a('0x2')][_0x591a('0x3')]({'port':0x232a});var routingClient=jayson[_0x591a('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x1f25bc,_0x4ae9dc){var _0x6be714=[_0x1f25bc[_0x591a('0x4')],_0x1f25bc[_0x591a('0x5')],_0x1f25bc[_0x591a('0x6')],_0x1f25bc[_0x591a('0x7')],_0x1f25bc[_0x591a('0x8')],_0x1f25bc['voicePause'],_0x1f25bc[_0x591a('0x9')]];if(!_0x4ae9dc)return _[_0x591a('0xa')](_0x6be714);var _0x384b33=_[_0x591a('0xb')](_0x6be714);return _0x384b33['length']>0x0&&_0x384b33[_0x591a('0xc')]<_0x6be714[_0x591a('0xc')]?!![]:![];}function isIdle(_0x449bb7){return _0x449bb7==='idle'||_0x449bb7===_0x591a('0xd')||_0x449bb7===_0x591a('0xe')||_0x449bb7==='ringing'||_[_0x591a('0xf')](_0x449bb7);}function isAgentIdle(_0x522a5a){if(_0x522a5a[_0x591a('0x10')]!==_0x591a('0x11')&&_0x522a5a['voicePause']){_0x522a5a[_0x591a('0x10')]=_0x591a('0x12');return![];}return _['every']([_0x522a5a[_0x591a('0x13')],_0x522a5a[_0x591a('0x14')],_0x522a5a[_0x591a('0x15')],_0x522a5a['openchannelStatus'],_0x522a5a[_0x591a('0x16')],_0x522a5a[_0x591a('0x10')],_0x522a5a[_0x591a('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})['then'](function(_0x51f17c){if(_0x51f17c[_0x591a('0x18')]){throw new Error(_0x591a('0x19'));}var _0x59c83f=_0x51f17c[_0x591a('0x1a')];return routingClient['request'](_0x591a('0x1b'),{})[_0x591a('0x1c')](function(_0x4099ad){if(_0x4099ad['error']){throw new Error(_0x591a('0x1d'));}var _0x46d4b3=_0x4099ad[_0x591a('0x1a')];return _[_0x591a('0x1e')]({},_0x59c83f,_0x46d4b3);});})['catch'](function(_0x5a03fd){throw _0x5a03fd;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x16c6ce){var _0x242a47=_0x591a('0xd');if(isAgentPaused(_0x16c6ce))_0x242a47=_0x591a('0x12');else if(isAgentPaused(_0x16c6ce,!![]))_0x242a47=_0x591a('0x1f');else if(isAgentIdle(_0x16c6ce))_0x242a47=_0x591a('0x11');else _0x242a47='busy';return _0x242a47;}exports[_0x591a('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x554b7d,_0x2b2029){var _0x51647e=_[_0x591a('0x21')](_0x554b7d)?_0x554b7d:[_0x554b7d];var _0x4c163a=_['startCase'](_0x2b2029)+_0x591a('0x22');var _0x58125e=_[_0x591a('0x23')](_0x51647e,function(_0x35bafb){return db[_0x4c163a][_0x591a('0x24')]({'where':{'id':_0x35bafb}})[_0x591a('0x1c')](function(_0x31b92c){if(!_0x31b92c)return[];return _0x31b92c[_0x591a('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x591a('0x26')](_0x58125e)[_0x591a('0x1c')](function(_0x5df6d8){var _0xe6eee1=_(_0x5df6d8)['flatten']()[_0x591a('0x23')]('id')['uniq']()['value']();return _0xe6eee1;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x25a79e,_0xa801d4,_0x5c8df0){try{if(_0xa801d4[_0x591a('0xc')]>0x0){_0x25a79e=_0x25a79e[_0x591a('0xb')](function(_0x43a450){return _0xa801d4[_0x591a('0x27')](_0x43a450['id']);});}var _0x41b96f=_0x25a79e[_0x591a('0xb')](function(_0x60409){var _0xb6d28f=_0x591a('0x28');if(isAgentIdle(_0x60409)){_0xb6d28f='idle';}return _0xb6d28f===_0x5c8df0;});return _[_0x591a('0x23')](_0x41b96f,'id');}catch(_0xa75c89){throw _0xa75c89;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x33fd43,_0xe3e796,_0x3717c6){return Promise[_0x591a('0x29')]()[_0x591a('0x1c')](function(){if(_0xe3e796[_0x591a('0xc')]>0x0){_0x33fd43=_0x33fd43[_0x591a('0xb')](function(_0x385549){return _0xe3e796[_0x591a('0x27')](_0x385549['id']);});}return _0x33fd43;})[_0x591a('0x1c')](function(){return db['User']['findAll']({'attributes':['id',_0x591a('0x2a'),_0x591a('0x2b'),_0x591a('0x4'),_0x591a('0x5'),_0x591a('0x6'),_0x591a('0x7'),_0x591a('0x8'),_0x591a('0x2c'),_0x591a('0x9'),_0x591a('0x2d')],'where':{'id':{'$in':_[_0x591a('0x23')](_0x33fd43,'id')}},'raw':!![]});})[_0x591a('0x1c')](function(_0x281172){return _0x281172[_0x591a('0x23')](function(_0xe47ef9){var _0x364b83=_[_0x591a('0x2e')](_0x33fd43,['id',_0xe47ef9['id']]);var _0xee8792=filterAgentAttributes(_0x364b83);_[_0x591a('0x1e')](_0xe47ef9,_0xee8792);_0xe47ef9[_0x591a('0x2f')]=getAgentStatus(_0xe47ef9);return _0xe47ef9;});})[_0x591a('0x1c')](function(_0x36752e){var _0x3172d7=sortAgentsByStatus(_0x36752e,_0x3717c6);return _[_0x591a('0x23')](_0x3172d7,'id');})[_0x591a('0x30')](function(_0xb2cb08){throw _0xb2cb08;});}exports[_0x591a('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3b0d2e){var _0x327f1e={'fields':[],'order':null};var _0x2d3725=_0x3b0d2e[_0x591a('0x32')](',');_0x327f1e['fields']=_[_0x591a('0xb')](_0x2d3725,function(_0x45d760){if(!_0x45d760[_0x591a('0x27')](_0x591a('0x2f'))){return!![];}_0x327f1e[_0x591a('0x33')]=_['startsWith'](_0x45d760,'-')?_0x591a('0x34'):_0x591a('0x35');return![];});return _0x327f1e;}exports[_0x591a('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x2f37c7){if(_0x2f37c7['includes'](_0x591a('0x2b'))&&!_0x2f37c7[_0x591a('0x27')](_0x591a('0x37'))){var _0x3ebc2c=_0x2f37c7[_0x591a('0x38')](0x0,_0x2f37c7[_0x591a('0x39')](_0x591a('0x2b')));_0x2f37c7+=','+_0x3ebc2c+_0x591a('0x37');}return _0x2f37c7;}exports[_0x591a('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x56d1bc,_0x317eba){var _0x174dc3=_0x56d1bc[_0x591a('0x3b')](function(_0x525935,_0x494ecf){if(_0x525935[_0x591a('0x2f')]===_0x494ecf[_0x591a('0x2f')]){if(_0x525935[_0x591a('0x2f')]==='pause'){if(_0x317eba===_0x591a('0x34')){return(_0x525935[_0x591a('0x2d')]||'')<(_0x494ecf[_0x591a('0x2d')]||'')||_0x525935['fullname'][_0x591a('0x3c')]()>_0x494ecf[_0x591a('0x2b')][_0x591a('0x3c')]()?0x1:-0x1;}else{return(_0x525935[_0x591a('0x2d')]||'')<(_0x494ecf[_0x591a('0x2d')]||'')||_0x525935[_0x591a('0x2b')][_0x591a('0x3c')]()>_0x494ecf['fullname'][_0x591a('0x3c')]()?-0x1:0x1;}}else{if(_0x317eba===_0x591a('0x34')){return _0x525935[_0x591a('0x2b')][_0x591a('0x3c')]()<_0x494ecf[_0x591a('0x2b')]['toLowerCase']()?0x1:-0x1;}else{return _0x525935[_0x591a('0x2b')][_0x591a('0x3c')]()<_0x494ecf[_0x591a('0x2b')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x317eba===_0x591a('0x34')){return _0x525935[_0x591a('0x2f')]<_0x494ecf[_0x591a('0x2f')]?0x1:-0x1;}else{return _0x525935[_0x591a('0x2f')]<_0x494ecf[_0x591a('0x2f')]?-0x1:0x1;}}});return _0x174dc3;}exports[_0x591a('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x51cdd2){var _0x5bdaae=[_0x591a('0x3e'),_0x591a('0x3f'),_0x591a('0x40'),_0x591a('0x41'),_0x591a('0x2d'),_0x591a('0x41'),'internal',_0x591a('0x42'),_0x591a('0x4'),'openchannelPause',_0x591a('0x6'),_0x591a('0x8'),_0x591a('0x9'),_0x591a('0x5'),'voicePause',_0x591a('0x43'),_0x591a('0x44'),_0x591a('0x45'),_0x591a('0x46'),'whatsappCapacity',_0x591a('0x47'),'chatCurrentCapacity',_0x591a('0x48'),'mailCurrentCapacity','smsCurrentCapacity',_0x591a('0x49'),_0x591a('0x4a'),_0x591a('0x13'),'openchannelStatus',_0x591a('0x15'),_0x591a('0x16'),_0x591a('0x17'),_0x591a('0x14'),_0x591a('0x10'),_0x591a('0x4b'),_0x591a('0x4c'),'mailStatusTime',_0x591a('0x4d'),_0x591a('0x4e'),_0x591a('0x4f'),'voiceStatusTime',_0x591a('0x50'),'destconnectedlinenum',_0x591a('0x51'),_0x591a('0x52'),'phoneBarEnableAutomaticScreenRecording',_0x591a('0x53')];var _0x29c8f3=['chatPause',_0x591a('0x7'),'mailPause','smsPause','whatsappPause','faxPause',_0x591a('0x2c'),_0x591a('0x3f')];var _0x5e2479=_(_0x51cdd2)['omit'](_0x29c8f3)[_0x591a('0x54')](_0x5bdaae)[_0x591a('0x55')]();return _0x5e2479;}exports[_0x591a('0x56')]=filterAgentAttributes; \ No newline at end of file +var _0xda31=['request','Agents','then','result','error','catch','getRealtimeAgents','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','all','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','filter','User','name','fullname','mailPause','find','merge','globalStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pause','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','http','chatPause','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus'];(function(_0x2e0a67,_0x4d594e){var _0x2cf1f5=function(_0x3931e6){while(--_0x3931e6){_0x2e0a67['push'](_0x2e0a67['shift']());}};_0x2cf1f5(++_0x4d594e);}(_0xda31,0x19e));var _0x1da3=function(_0x2d2153,_0x4509d6){_0x2d2153=_0x2d2153-0x0;var _0x20299e=_0xda31[_0x2d2153];return _0x20299e;};'use strict';var _=require('lodash');var jayson=require(_0x1da3('0x0'));var db=require(_0x1da3('0x1'))['db'];var amiClient=jayson['client'][_0x1da3('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x203dc1,_0x3f1187){var _0x3656a1=[_0x203dc1[_0x1da3('0x3')],_0x203dc1[_0x1da3('0x4')],_0x203dc1['mailPause'],_0x203dc1[_0x1da3('0x5')],_0x203dc1[_0x1da3('0x6')],_0x203dc1[_0x1da3('0x7')],_0x203dc1[_0x1da3('0x8')]];if(!_0x3f1187)return _[_0x1da3('0x9')](_0x3656a1);var _0x7fd4ea=_['filter'](_0x3656a1);return _0x7fd4ea['length']>0x0&&_0x7fd4ea['length']<_0x3656a1[_0x1da3('0xa')]?!![]:![];}function isIdle(_0x32a53b){return _0x32a53b===_0x1da3('0xb')||_0x32a53b===_0x1da3('0xc')||_0x32a53b==='unavailable'||_0x32a53b===_0x1da3('0xd')||_['isNil'](_0x32a53b);}function isAgentIdle(_0x3da2ce){if(_0x3da2ce[_0x1da3('0xe')]!==_0x1da3('0xb')&&_0x3da2ce['voicePause']){_0x3da2ce[_0x1da3('0xe')]='pause';return![];}return _[_0x1da3('0x9')]([_0x3da2ce[_0x1da3('0xf')],_0x3da2ce[_0x1da3('0x10')],_0x3da2ce[_0x1da3('0x11')],_0x3da2ce[_0x1da3('0x12')],_0x3da2ce[_0x1da3('0x13')],_0x3da2ce[_0x1da3('0xe')],_0x3da2ce[_0x1da3('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1da3('0x15')](_0x1da3('0x16'),{})[_0x1da3('0x17')](function(_0x18d3eb){if(_0x18d3eb['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x2a79a6=_0x18d3eb[_0x1da3('0x18')];return routingClient['request']('Agents',{})[_0x1da3('0x17')](function(_0x901782){if(_0x901782[_0x1da3('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3cfbcb=_0x901782['result'];return _['merge']({},_0x2a79a6,_0x3cfbcb);});})[_0x1da3('0x1a')](function(_0x113455){throw _0x113455;});}exports[_0x1da3('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x2b7d40){var _0x4a95b9=_0x1da3('0xc');if(isAgentPaused(_0x2b7d40))_0x4a95b9='pause';else if(isAgentPaused(_0x2b7d40,!![]))_0x4a95b9=_0x1da3('0x1c');else if(isAgentIdle(_0x2b7d40))_0x4a95b9='idle';else _0x4a95b9=_0x1da3('0x1d');return _0x4a95b9;}exports[_0x1da3('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x3087fa,_0x1f489b){var _0x3bc14b=_['isArray'](_0x3087fa)?_0x3087fa:[_0x3087fa];var _0x2dc507=_[_0x1da3('0x1f')](_0x1f489b)+_0x1da3('0x20');var _0x7395ad=_[_0x1da3('0x21')](_0x3bc14b,function(_0x3f573b){return db[_0x2dc507][_0x1da3('0x22')]({'where':{'id':_0x3f573b}})[_0x1da3('0x17')](function(_0x1c8fd8){if(!_0x1c8fd8)return[];return _0x1c8fd8['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x1da3('0x23')](_0x7395ad)[_0x1da3('0x17')](function(_0x11b5a7){var _0x52a603=_(_0x11b5a7)['flatten']()[_0x1da3('0x21')]('id')[_0x1da3('0x24')]()[_0x1da3('0x25')]();return _0x52a603;});}exports[_0x1da3('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3c33ea,_0xdec412,_0x32f735){try{if(_0xdec412[_0x1da3('0xa')]>0x0){_0x3c33ea=_0x3c33ea['filter'](function(_0x4bad0c){return _0xdec412[_0x1da3('0x27')](_0x4bad0c['id']);});}var _0x1d9e3f=_0x3c33ea['filter'](function(_0x1811fa){var _0x2ddd32='busy';if(isAgentIdle(_0x1811fa)){_0x2ddd32='idle';}return _0x2ddd32===_0x32f735;});return _[_0x1da3('0x21')](_0x1d9e3f,'id');}catch(_0xa1fc0c){throw _0xa1fc0c;}}exports[_0x1da3('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d6603,_0x17052f,_0x408f30){return Promise['resolve']()[_0x1da3('0x17')](function(){if(_0x17052f[_0x1da3('0xa')]>0x0){_0x1d6603=_0x1d6603[_0x1da3('0x29')](function(_0x4a5140){return _0x17052f[_0x1da3('0x27')](_0x4a5140['id']);});}return _0x1d6603;})['then'](function(){return db[_0x1da3('0x2a')]['findAll']({'attributes':['id',_0x1da3('0x2b'),_0x1da3('0x2c'),_0x1da3('0x3'),'faxPause',_0x1da3('0x2d'),_0x1da3('0x5'),'smsPause','voicePause',_0x1da3('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x1d6603,'id')}},'raw':!![]});})['then'](function(_0x550e5b){return _0x550e5b[_0x1da3('0x21')](function(_0x25291a){var _0x5b5632=_[_0x1da3('0x2e')](_0x1d6603,['id',_0x25291a['id']]);var _0x550f7c=filterAgentAttributes(_0x5b5632);_[_0x1da3('0x2f')](_0x25291a,_0x550f7c);_0x25291a[_0x1da3('0x30')]=getAgentStatus(_0x25291a);return _0x25291a;});})[_0x1da3('0x17')](function(_0x3f0638){var _0x1837eb=sortAgentsByStatus(_0x3f0638,_0x408f30);return _[_0x1da3('0x21')](_0x1837eb,'id');})[_0x1da3('0x1a')](function(_0xea0ce9){throw _0xea0ce9;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4f72ba){var _0x57352d={'fields':[],'order':null};var _0x25bd1b=_0x4f72ba[_0x1da3('0x31')](',');_0x57352d[_0x1da3('0x32')]=_['filter'](_0x25bd1b,function(_0xd62d20){if(!_0xd62d20[_0x1da3('0x27')](_0x1da3('0x30'))){return!![];}_0x57352d['order']=_[_0x1da3('0x33')](_0xd62d20,'-')?_0x1da3('0x34'):_0x1da3('0x35');return![];});return _0x57352d;}exports[_0x1da3('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x50b18e){if(_0x50b18e[_0x1da3('0x27')](_0x1da3('0x2c'))&&!_0x50b18e['includes'](_0x1da3('0x37'))){var _0x28f30b=_0x50b18e[_0x1da3('0x38')](0x0,_0x50b18e[_0x1da3('0x39')](_0x1da3('0x2c')));_0x50b18e+=','+_0x28f30b+'internal';}return _0x50b18e;}exports[_0x1da3('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x4123c4,_0x4e1cbb){var _0x1091bf=_0x4123c4['sort'](function(_0x4079c6,_0x463e1c){if(_0x4079c6[_0x1da3('0x30')]===_0x463e1c[_0x1da3('0x30')]){if(_0x4079c6[_0x1da3('0x30')]===_0x1da3('0x3b')){if(_0x4e1cbb===_0x1da3('0x34')){return(_0x4079c6[_0x1da3('0x3c')]||'')<(_0x463e1c[_0x1da3('0x3c')]||'')||_0x4079c6['fullname'][_0x1da3('0x3d')]()>_0x463e1c[_0x1da3('0x2c')][_0x1da3('0x3d')]()?0x1:-0x1;}else{return(_0x4079c6[_0x1da3('0x3c')]||'')<(_0x463e1c[_0x1da3('0x3c')]||'')||_0x4079c6[_0x1da3('0x2c')][_0x1da3('0x3d')]()>_0x463e1c[_0x1da3('0x2c')][_0x1da3('0x3d')]()?-0x1:0x1;}}else{if(_0x4e1cbb===_0x1da3('0x34')){return _0x4079c6[_0x1da3('0x2c')][_0x1da3('0x3d')]()<_0x463e1c[_0x1da3('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return _0x4079c6[_0x1da3('0x2c')][_0x1da3('0x3d')]()<_0x463e1c[_0x1da3('0x2c')][_0x1da3('0x3d')]()?-0x1:0x1;}}}else{if(_0x4e1cbb===_0x1da3('0x34')){return _0x4079c6[_0x1da3('0x30')]<_0x463e1c[_0x1da3('0x30')]?0x1:-0x1;}else{return _0x4079c6['globalStatus']<_0x463e1c[_0x1da3('0x30')]?-0x1:0x1;}}});return _0x1091bf;}exports[_0x1da3('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x547262){var _0x320cd3=[_0x1da3('0x3f'),_0x1da3('0x40'),_0x1da3('0x41'),_0x1da3('0x42'),_0x1da3('0x3c'),_0x1da3('0x42'),'internal','address',_0x1da3('0x3'),_0x1da3('0x5'),_0x1da3('0x2d'),_0x1da3('0x6'),_0x1da3('0x8'),_0x1da3('0x4'),_0x1da3('0x7'),_0x1da3('0x43'),_0x1da3('0x44'),_0x1da3('0x45'),'smsCapacity',_0x1da3('0x46'),_0x1da3('0x47'),_0x1da3('0x48'),_0x1da3('0x49'),_0x1da3('0x4a'),_0x1da3('0x4b'),_0x1da3('0x4c'),'faxCurrentCapacity',_0x1da3('0xf'),_0x1da3('0x12'),_0x1da3('0x11'),'smsStatus','whatsappStatus',_0x1da3('0x10'),'voiceStatus','chatStatusTime','openchannelStatusTime','mailStatusTime',_0x1da3('0x4d'),_0x1da3('0x4e'),_0x1da3('0x4f'),_0x1da3('0x50'),'queue','destconnectedlinenum',_0x1da3('0x51'),_0x1da3('0x52'),_0x1da3('0x53'),'routealias'];var _0x2cb933=[_0x1da3('0x3'),'openchannelPause','mailPause',_0x1da3('0x6'),'whatsappPause',_0x1da3('0x4'),_0x1da3('0x7'),_0x1da3('0x40')];var _0x324108=_(_0x547262)[_0x1da3('0x54')](_0x2cb933)[_0x1da3('0x55')](_0x320cd3)[_0x1da3('0x25')]();return _0x324108;}exports[_0x1da3('0x56')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index df8aad1..dbfbb63 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x44a9c8,_0x19facb){var _0x3a3d70=function(_0x133828){while(--_0x133828){_0x44a9c8['push'](_0x44a9c8['shift']());}};_0x3a3d70(++_0x19facb);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x34e14d,_0x5dea39){var _0x3d8e08=function(_0x134769){while(--_0x134769){_0x34e14d['push'](_0x34e14d['shift']());}};_0x3d8e08(++_0x5dea39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e671f2c..a8a0cf9 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 _0xd717=['hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','map','join','createHash','update','digest'];(function(_0x43fc19,_0x49f97a){var _0x4e6aa3=function(_0x15a6fa){while(--_0x15a6fa){_0x43fc19['push'](_0x43fc19['shift']());}};_0x4e6aa3(++_0x49f97a);}(_0xd717,0x1df));var _0x7d71=function(_0x4de9ac,_0x16ffc8){_0x4de9ac=_0x4de9ac-0x0;var _0x21c3c5=_0xd717[_0x4de9ac];return _0x21c3c5;};'use strict';var _=require(_0x7d71('0x0'));var os=require('os');var crypto=require(_0x7d71('0x1'));var machine=require(_0x7d71('0x2'));var exec=require(_0x7d71('0x3'))['execSync'];var config=require(_0x7d71('0x4'));function getInterfaces(){var _0x21f6bc=[];var _0x4a79ce=os[_0x7d71('0x5')]();var _0x118e57=_['orderBy'](_[_0x7d71('0x6')](_0x4a79ce));for(var _0x46ad45=0x0;_0x46ad45<_0x118e57[_0x7d71('0x7')];_0x46ad45++){var _0x3e7282=_0x4a79ce[_0x118e57[_0x46ad45]][_0x7d71('0x8')](function(_0x5f5bb2){return _0x5f5bb2[_0x7d71('0x9')]===_0x7d71('0xa')&&_0x5f5bb2[_0x7d71('0xb')]===![];});_0x21f6bc=_0x21f6bc[_0x7d71('0xc')](_0x3e7282);}return _0x21f6bc;}function getFirstInterface(){var _0x339748=_[_0x7d71('0xd')](getInterfaces());return{'macAddress':_0x339748&&_0x339748['mac']?_0x339748[_0x7d71('0xe')]:_0x7d71('0xf'),'ipAddress':_0x339748&&_0x339748[_0x7d71('0x10')]?_0x339748['address']:_0x7d71('0x11')};}exports[_0x7d71('0x12')]=getFirstInterface;function getCPUhash(){var _0x3b02b4=_[_0x7d71('0x13')](os['cpus']()[_0x7d71('0x14')](function(_0x2a6f6d){return _0x2a6f6d['model'];}))[_0x7d71('0x15')](':');return crypto[_0x7d71('0x16')]('md5')[_0x7d71('0x17')](_0x3b02b4)[_0x7d71('0x18')](_0x7d71('0x19'));}exports[_0x7d71('0x1a')]=function(){var _0x72f0e4=os[_0x7d71('0x1b')]();var _0x360e97=/[0-9a-f-]{36}/;if(config[_0x7d71('0x1c')]&&_0x360e97[_0x7d71('0x1d')](config[_0x7d71('0x1c')])){return config[_0x7d71('0x1c')];}else if(_0x72f0e4===_0x7d71('0x1e')){return exec(_0x7d71('0x1f'),{'encoding':_0x7d71('0x20')})[_0x7d71('0x21')]('\x0d\x0a','');}else{var _0x141998=getFirstInterface();var _0x14454d=getCPUhash();var _0x247ef2=_0x14454d+'|'+os[_0x7d71('0x22')]()+'|'+_0x141998['macAddress']+'|'+_0x141998['ipAddress'];var _0x410e63=crypto[_0x7d71('0x16')]('md5')['update'](_0x247ef2)['digest'](_0x7d71('0x19'));return _0x410e63[_0x7d71('0x23')](0x0,0x8)+'-'+_0x410e63[_0x7d71('0x23')](0x8,0xc)+'-'+_0x410e63[_0x7d71('0x23')](0xc,0x10)+'-'+_0x410e63[_0x7d71('0x23')](0x10,0x14)+'-'+_0x410e63[_0x7d71('0x23')](0x14);}}; \ No newline at end of file +var _0xfbb5=['map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','ipAddress','substring','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4','concat','mac','address','getFirstInterface','cpus'];(function(_0x10a32f,_0xdc05f3){var _0xca5235=function(_0x35b02a){while(--_0x35b02a){_0x10a32f['push'](_0x10a32f['shift']());}};_0xca5235(++_0xdc05f3);}(_0xfbb5,0x1b1));var _0x5fbb=function(_0x186036,_0xc5cd68){_0x186036=_0x186036-0x0;var _0x13f42a=_0xfbb5[_0x186036];return _0x13f42a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x5fbb('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x5fbb('0x1'))[_0x5fbb('0x2')];var config=require(_0x5fbb('0x3'));function getInterfaces(){var _0x24c36a=[];var _0x1b3d18=os[_0x5fbb('0x4')]();var _0x3bb0a8=_[_0x5fbb('0x5')](_[_0x5fbb('0x6')](_0x1b3d18));for(var _0x40002c=0x0;_0x40002c<_0x3bb0a8['length'];_0x40002c++){var _0x4613ce=_0x1b3d18[_0x3bb0a8[_0x40002c]][_0x5fbb('0x7')](function(_0x678011){return _0x678011[_0x5fbb('0x8')]===_0x5fbb('0x9')&&_0x678011['internal']===![];});_0x24c36a=_0x24c36a[_0x5fbb('0xa')](_0x4613ce);}return _0x24c36a;}function getFirstInterface(){var _0x4a1216=_['head'](getInterfaces());return{'macAddress':_0x4a1216&&_0x4a1216[_0x5fbb('0xb')]?_0x4a1216['mac']:'00:00:00:00:00:00','ipAddress':_0x4a1216&&_0x4a1216['address']?_0x4a1216[_0x5fbb('0xc')]:'127.0.0.1'};}exports[_0x5fbb('0xd')]=getFirstInterface;function getCPUhash(){var _0x1febca=_[_0x5fbb('0x5')](os[_0x5fbb('0xe')]()[_0x5fbb('0xf')](function(_0x4c6277){return _0x4c6277[_0x5fbb('0x10')];}))[_0x5fbb('0x11')](':');return crypto[_0x5fbb('0x12')](_0x5fbb('0x13'))[_0x5fbb('0x14')](_0x1febca)[_0x5fbb('0x15')](_0x5fbb('0x16'));}exports[_0x5fbb('0x17')]=function(){var _0x29e745=os[_0x5fbb('0x18')]();var _0x33db09=/[0-9a-f-]{36}/;if(config[_0x5fbb('0x19')]&&_0x33db09[_0x5fbb('0x1a')](config['licenseToken'])){return config[_0x5fbb('0x19')];}else if(_0x29e745===_0x5fbb('0x1b')){return exec(_0x5fbb('0x1c'),{'encoding':'utf8'})[_0x5fbb('0x1d')]('\x0d\x0a','');}else{var _0x44639f=getFirstInterface();var _0x5015ab=getCPUhash();var _0x35b78b=_0x5015ab+'|'+os['hostname']()+'|'+_0x44639f['macAddress']+'|'+_0x44639f[_0x5fbb('0x1e')];var _0x370ff9=crypto[_0x5fbb('0x12')](_0x5fbb('0x13'))[_0x5fbb('0x14')](_0x35b78b)[_0x5fbb('0x15')]('hex');return _0x370ff9[_0x5fbb('0x1f')](0x0,0x8)+'-'+_0x370ff9[_0x5fbb('0x1f')](0x8,0xc)+'-'+_0x370ff9[_0x5fbb('0x1f')](0xc,0x10)+'-'+_0x370ff9[_0x5fbb('0x1f')](0x10,0x14)+'-'+_0x370ff9['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 31e9d43..2fbda55 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 _0x2937=['days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff'];(function(_0x35281a,_0x244574){var _0x22c7d3=function(_0x144daf){while(--_0x144daf){_0x35281a['push'](_0x35281a['shift']());}};_0x22c7d3(++_0x244574);}(_0x2937,0xf9));var _0x7293=function(_0x317446,_0x2672b7){_0x317446=_0x317446-0x0;var _0x25d05e=_0x2937[_0x317446];return _0x25d05e;};'use strict';var util=require(_0x7293('0x0'));var moment=require(_0x7293('0x1'));var rp=require('request-promise');var BPromise=require(_0x7293('0x2'));var pkginfo=require(_0x7293('0x3'))(module,_0x7293('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x7293('0x5'));var logger=require(_0x7293('0x6'))(_0x7293('0x7'));var HOST=_0x7293('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3d73bb){return new BPromise(function(_0x7521ef,_0x5981e8){var _0x479cd4=util[_0x7293('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x3d73bb,module[_0x7293('0xa')][_0x7293('0x4')]);if(oldToken){_0x479cd4=util['format'](_0x7293('0xb'),HOST,_0x3d73bb,module['exports'][_0x7293('0x4')],oldToken);}var _0x3e45d3={'uri':_0x479cd4,'method':_0x7293('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x3e45d3)[_0x7293('0xd')](function(_0x16b0d2){_0x7521ef(_0x16b0d2);})[_0x7293('0xe')](function(_0x5cbbc4){_0x5981e8(_0x5cbbc4);});});}function manageLicense(_0x2df935,_0x30bedd){var _0x5d5147=_0x30bedd[_0x7293('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x5d5147['data1']!==_0x2df935&&!_0x5d5147[_0x7293('0x10')]){oldToken=_0x5d5147[_0x7293('0x11')];}httpRequest(_0x2df935)[_0x7293('0xd')](function(_0x21567a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21567a[_0x7293('0x12')]){isOldTokenSent=![];if(!_0x5d5147[_0x7293('0x7')]&&_0x5d5147[_0x7293('0x7')]!=_0x21567a['license']||_0x5d5147[_0x7293('0x7')]&&_0x5d5147[_0x7293('0x10')]){logger['info'](_0x7293('0x13'));}if(_0x5d5147[_0x7293('0x7')]&&!_0x5d5147[_0x7293('0x10')]&&_0x5d5147[_0x7293('0x7')]!=_0x21567a['license']){logger[_0x7293('0x14')](_0x7293('0x15'));}if(_0x5d5147['license']&&!_0x5d5147[_0x7293('0x10')]&&_0x5d5147['license']==_0x21567a['license']){return _0x30bedd;}return _0x30bedd[_0x7293('0x16')]({'data1':_0x2df935,'data2':null,'license':_0x21567a[_0x7293('0x7')]});}else{if(_0x21567a[_0x7293('0x7')]||_0x5d5147[_0x7293('0x7')]){if(!_0x5d5147[_0x7293('0x10')]){if(_0x5d5147[_0x7293('0x11')]==_0x2df935){GRAY_PERIOD_REASON=_0x7293('0x17');logger[_0x7293('0x14')](_0x7293('0x18'));}else{GRAY_PERIOD_REASON=_0x7293('0x19');logger[_0x7293('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5d5147[_0x7293('0x11')],_0x2df935);}logger[_0x7293('0x14')](_0x7293('0x1a'),GRAY_PERIOD_REASON[_0x7293('0x1b')](),moment()[_0x7293('0x9')](_0x7293('0x1c')));return _0x30bedd[_0x7293('0x16')]({'data2':encryptor[_0x7293('0x1d')](moment()[_0x7293('0x9')](_0x7293('0x1c')))});}else{if(moment()[_0x7293('0x1e')](encryptor['decryptString'](_0x5d5147[_0x7293('0x10')]),_0x7293('0x1f'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x7293('0x9')](_0x7293('0x1c')));isOldTokenSent=![];return _0x30bedd[_0x7293('0x16')]({'data1':_0x2df935,'data2':null,'license':null});}}}else{if(_0x5d5147[_0x7293('0x11')]!=_0x2df935){logger[_0x7293('0x14')](_0x7293('0x20'),_0x5d5147['data1'],_0x2df935);return _0x30bedd[_0x7293('0x16')]({'data1':_0x2df935,'data2':null,'license':null});}}}return _0x30bedd;})[_0x7293('0xd')](function(_0x1d2144){_0x30bedd=_0x1d2144;})['catch'](function(_0x230955){logger['error'](_0x230955[_0x7293('0x21')]);})[_0x7293('0x22')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x30bedd);},TIME);});}function defaultLicense(){var _0x2f7dd9=hardware[_0x7293('0x23')]();if(_0x2f7dd9){return db[_0x7293('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2f7dd9}})[_0x7293('0x25')](function(_0x5dc1cb,_0x41e51e){logger[_0x7293('0x14')](_0x7293('0x26'),_0x2f7dd9);manageLicense(_0x2f7dd9,_0x5dc1cb);})['catch'](function(_0x172ac3){logger['error'](_0x172ac3[_0x7293('0x21')]);});}}exports[_0x7293('0x27')]=defaultLicense; \ No newline at end of file +var _0xe178=['license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger'];(function(_0x4fede4,_0x3e446d){var _0x5b22e3=function(_0x31f2ae){while(--_0x31f2ae){_0x4fede4['push'](_0x4fede4['shift']());}};_0x5b22e3(++_0x3e446d);}(_0xe178,0x77));var _0x8e17=function(_0xb5ce97,_0x4cc7e1){_0xb5ce97=_0xb5ce97-0x0;var _0x295f4f=_0xe178[_0xb5ce97];return _0x295f4f;};'use strict';var util=require('util');var moment=require(_0x8e17('0x0'));var rp=require(_0x8e17('0x1'));var BPromise=require(_0x8e17('0x2'));var pkginfo=require('pkginfo')(module,_0x8e17('0x3'));var db=require(_0x8e17('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x8e17('0x5'));var logger=require(_0x8e17('0x6'))(_0x8e17('0x7'));var HOST=_0x8e17('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x226c91){return new BPromise(function(_0x28ed38,_0xfcd6ed){var _0x29bcf5=util['format'](_0x8e17('0x9'),HOST,_0x226c91,module[_0x8e17('0xa')]['version']);if(oldToken){_0x29bcf5=util[_0x8e17('0xb')](_0x8e17('0xc'),HOST,_0x226c91,module['exports'][_0x8e17('0x3')],oldToken);}var _0x2900fa={'uri':_0x29bcf5,'method':_0x8e17('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2900fa)[_0x8e17('0xe')](function(_0x2e4ef4){_0x28ed38(_0x2e4ef4);})[_0x8e17('0xf')](function(_0x20a747){_0xfcd6ed(_0x20a747);});});}function manageLicense(_0x34b751,_0x4478cd){var _0x196620=_0x4478cd['get']({'plain':!![]});if(!isOldTokenSent&&_0x196620['data1']!==_0x34b751&&!_0x196620[_0x8e17('0x10')]){oldToken=_0x196620[_0x8e17('0x11')];}httpRequest(_0x34b751)[_0x8e17('0xe')](function(_0xed3b8b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xed3b8b[_0x8e17('0x12')]){isOldTokenSent=![];if(!_0x196620['license']&&_0x196620[_0x8e17('0x7')]!=_0xed3b8b['license']||_0x196620[_0x8e17('0x7')]&&_0x196620['data2']){logger['info'](_0x8e17('0x13'));}if(_0x196620[_0x8e17('0x7')]&&!_0x196620[_0x8e17('0x10')]&&_0x196620[_0x8e17('0x7')]!=_0xed3b8b[_0x8e17('0x7')]){logger[_0x8e17('0x14')](_0x8e17('0x15'));}if(_0x196620[_0x8e17('0x7')]&&!_0x196620[_0x8e17('0x10')]&&_0x196620[_0x8e17('0x7')]==_0xed3b8b['license']){return _0x4478cd;}return _0x4478cd['update']({'data1':_0x34b751,'data2':null,'license':_0xed3b8b['license']});}else{if(_0xed3b8b['license']||_0x196620['license']){if(!_0x196620['data2']){if(_0x196620[_0x8e17('0x11')]==_0x34b751){GRAY_PERIOD_REASON=_0x8e17('0x16');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x8e17('0x17');logger[_0x8e17('0x14')](_0x8e17('0x18'),_0x196620[_0x8e17('0x11')],_0x34b751);}logger['info'](_0x8e17('0x19'),GRAY_PERIOD_REASON[_0x8e17('0x1a')](),moment()[_0x8e17('0xb')](_0x8e17('0x1b')));return _0x4478cd[_0x8e17('0x1c')]({'data2':encryptor['encryptString'](moment()[_0x8e17('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x8e17('0x1d')](encryptor[_0x8e17('0x1e')](_0x196620[_0x8e17('0x10')]),_0x8e17('0x1f'))>DAYS){logger['info'](_0x8e17('0x20'),moment()[_0x8e17('0xb')](_0x8e17('0x1b')));isOldTokenSent=![];return _0x4478cd['update']({'data1':_0x34b751,'data2':null,'license':null});}}}else{if(_0x196620[_0x8e17('0x11')]!=_0x34b751){logger['info'](_0x8e17('0x18'),_0x196620[_0x8e17('0x11')],_0x34b751);return _0x4478cd[_0x8e17('0x1c')]({'data1':_0x34b751,'data2':null,'license':null});}}}return _0x4478cd;})['then'](function(_0x3a5c31){_0x4478cd=_0x3a5c31;})[_0x8e17('0xf')](function(_0x42b5ac){logger[_0x8e17('0x21')](_0x42b5ac[_0x8e17('0x22')]);})[_0x8e17('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x8e17('0x24')](),_0x4478cd);},TIME);});}function defaultLicense(){var _0x50e094=hardware[_0x8e17('0x24')]();if(_0x50e094){return db[_0x8e17('0x25')][_0x8e17('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x50e094}})[_0x8e17('0x27')](function(_0x5bc8aa,_0xfe84d5){logger[_0x8e17('0x14')](_0x8e17('0x28'),_0x50e094);manageLicense(_0x50e094,_0x5bc8aa);})[_0x8e17('0xf')](function(_0x89e04e){logger[_0x8e17('0x21')](_0x89e04e['message']);});}}exports[_0x8e17('0x29')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b20720d..1142726 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 _0x8ff2=['2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','telephones','forEach','count','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid'];(function(_0x1d6b1b,_0x52bd24){var _0x561e11=function(_0xa1031a){while(--_0xa1031a){_0x1d6b1b['push'](_0x1d6b1b['shift']());}};_0x561e11(++_0x52bd24);}(_0x8ff2,0x17f));var _0x28ff=function(_0x7ca726,_0x24cba2){_0x7ca726=_0x7ca726-0x0;var _0x8cda46=_0x8ff2[_0x7ca726];return _0x8cda46;};'use strict';var util=require(_0x28ff('0x0'));var _=require(_0x28ff('0x1'));var moment=require(_0x28ff('0x2'));var BPromise=require(_0x28ff('0x3'));var hardware=require(_0x28ff('0x4'));var encryptor=require(_0x28ff('0x5'));var db=require(_0x28ff('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x28ff('0x7'),'machineUuid':hardware[_0x28ff('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x28ff('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x28ff('0xa'),'machineUuid':hardware[_0x28ff('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5cb7f8){return new BPromise(function(_0x176a5b,_0x43b731){return db[_0x28ff('0xb')][_0x28ff('0xc')](_[_0x28ff('0xd')](_0x5cb7f8,{'raw':!![],'where':{'id':0x1}}))[_0x28ff('0xe')](function(_0x59c1ef){return checkLicense(_0x59c1ef,null);})[_0x28ff('0xe')](function(_0x4f928d){_0x176a5b(_0x4f928d);return;})[_0x28ff('0xf')](function(_0x2e3795){_0x43b731(_0x2e3795);});});}function checkLicense(_0x3e9910,_0x4f2c8d){if(!_0x3e9910){demoLicense[_0x28ff('0x10')]=_0x3e9910[_0x28ff('0x11')];return demoLicense;}try{var _0x24c411=_0x4f2c8d||_0x3e9910[_0x28ff('0x12')];if(_[_0x28ff('0x13')](_0x24c411)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3eb0ef=_0x3e9910[_0x28ff('0x11')];var _0x5a5f97=_0x3e9910[_0x28ff('0x14')];var _0x43f97b=_0x3eb0ef[_0x28ff('0x15')]('-')[0x4];var _0x1dfa60=_0x3eb0ef[_0x28ff('0x15')]('-')[0x0];var _0x229129=encryptor[_0x28ff('0x16')](_0x24c411,util[_0x28ff('0x17')](_0x28ff('0x18'),_0x43f97b,_0x3eb0ef,_0x1dfa60));var _0x1d58d7=JSON[_0x28ff('0x19')](_0x229129);_0x1d58d7[_0x28ff('0x1a')]=![];_0x1d58d7[_0x28ff('0x10')]=_0x3eb0ef;_0x1d58d7[_0x28ff('0x1b')]=hardware[_0x28ff('0x8')]();if(_0x5a5f97){var _0x33dc8d=encryptor[_0x28ff('0x16')](_0x5a5f97);_0x1d58d7[_0x28ff('0x1c')]=_0x33dc8d;_0x1d58d7[_0x28ff('0x1d')]=moment(_0x33dc8d)['add'](0x7,'days')[_0x28ff('0x17')]();_0x1d58d7['grayReason']=_0x1d58d7[_0x28ff('0x10')]!=_0x1d58d7[_0x28ff('0x1b')]?_0x28ff('0x1e'):_0x28ff('0x1f');}return _0x1d58d7;}catch(_0x2d118){breakingLicense[_0x28ff('0x10')]=_0x3e9910[_0x28ff('0x11')];breakingLicense[_0x28ff('0x20')]=_0x2d118[_0x28ff('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3304ef,_0x232f06){getLicense()['then'](function(_0x593452){return db[_0x28ff('0x21')][_0x28ff('0x22')]({'attributes':[_0x28ff('0x23'),[db[_0x28ff('0x24')]['fn'](_0x28ff('0x25'),db['sequelize'][_0x28ff('0x26')](_0x28ff('0x23'))),'count']],'group':_0x28ff('0x23'),'where':{'role':{'$or':[_0x28ff('0x27'),_0x28ff('0x28'),_0x28ff('0x29')]}},'raw':!![]})[_0x28ff('0xe')](function(_0xd39937){var _0xc8f369={'user':_0x593452[_0x28ff('0x2a')]||0x0,'telephone':_0x593452[_0x28ff('0x2b')]||0x0};_0xd39937[_0x28ff('0x2c')](function(_0x3f079f){var _0x59a109=_0x3f079f[_0x28ff('0x23')]===_0x28ff('0x27')?_0x28ff('0x28'):_0x3f079f['role'];_0xc8f369[_0x59a109]-=_0x3f079f[_0x28ff('0x2d')];if(_0xc8f369[_0x59a109]<0x0)_0xc8f369[_0x59a109]=0x0;});_0x3304ef(_0xc8f369);return;});})[_0x28ff('0xf')](function(_0x3442c3){_0x232f06(_0x3442c3);});});}function checkUserLimits(_0x2ab7f0){return new BPromise(function(_0x1acc96,_0x152abb){getLimits()[_0x28ff('0xe')](function(_0x417b84){var _0x5d89cf=_['pick'](_[_0x28ff('0x2e')](_0x2ab7f0,_0x28ff('0x23')),[_0x28ff('0x27'),_0x28ff('0x28'),'telephone']);var _0x2b249f=(_0x5d89cf['admin']||0x0)+(_0x5d89cf['user']||0x0);var _0x59e19d=_0x5d89cf['telephone']||0x0;if(_0x2b249f>_0x417b84['user'])return _0x152abb(_0x28ff('0x2f'));if(_0x59e19d>_0x417b84[_0x28ff('0x29')])return _0x152abb(_0x28ff('0x30'));return _0x1acc96();})[_0x28ff('0xf')](function(_0x2eb9c7){_0x152abb(_0x2eb9c7);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb875=['../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','split','decryptString','format','parse','demo','gray','days','grayReason','machineUuid','changed','disabled','message','findAll','role','COUNT','sequelize','col','count','admin','user','telephone','users','telephones','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','./hardware'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0xb875,0x84));var _0x5b87=function(_0x4c7b5e,_0x4efbba){_0x4c7b5e=_0x4c7b5e-0x0;var _0x3f7e02=_0xb875[_0x4c7b5e];return _0x3f7e02;};'use strict';var util=require(_0x5b87('0x0'));var _=require(_0x5b87('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x5b87('0x2'));var encryptor=require(_0x5b87('0x3'));var db=require(_0x5b87('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b87('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x5b87('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b87('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5b87('0x7'),'machineUuid':hardware[_0x5b87('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xdafd08){return new BPromise(function(_0x174e86,_0x50d688){return db[_0x5b87('0x8')][_0x5b87('0x9')](_[_0x5b87('0xa')](_0xdafd08,{'raw':!![],'where':{'id':0x1}}))[_0x5b87('0xb')](function(_0x737227){return checkLicense(_0x737227,null);})[_0x5b87('0xb')](function(_0x344547){_0x174e86(_0x344547);return;})[_0x5b87('0xc')](function(_0x25897e){_0x50d688(_0x25897e);});});}function checkLicense(_0x1055d9,_0x2ffd36){if(!_0x1055d9){demoLicense[_0x5b87('0xd')]=_0x1055d9[_0x5b87('0xe')];return demoLicense;}try{var _0x31f9fe=_0x2ffd36||_0x1055d9[_0x5b87('0xf')];if(_['isEmpty'](_0x31f9fe)){throw new Error(_0x5b87('0x10'));}var _0x5b2b2b=_0x1055d9['data1'];var _0x25a12a=_0x1055d9['data2'];var _0x1e59c7=_0x5b2b2b[_0x5b87('0x11')]('-')[0x4];var _0x1e6767=_0x5b2b2b[_0x5b87('0x11')]('-')[0x0];var _0x1f6a2f=encryptor[_0x5b87('0x12')](_0x31f9fe,util[_0x5b87('0x13')]('%s:%s:%s',_0x1e59c7,_0x5b2b2b,_0x1e6767));var _0x48af26=JSON[_0x5b87('0x14')](_0x1f6a2f);_0x48af26[_0x5b87('0x15')]=![];_0x48af26['uuid']=_0x5b2b2b;_0x48af26['machineUuid']=hardware[_0x5b87('0x6')]();if(_0x25a12a){var _0x562626=encryptor['decryptString'](_0x25a12a);_0x48af26[_0x5b87('0x16')]=_0x562626;_0x48af26['deadline']=moment(_0x562626)['add'](0x7,_0x5b87('0x17'))['format']();_0x48af26[_0x5b87('0x18')]=_0x48af26['uuid']!=_0x48af26[_0x5b87('0x19')]?_0x5b87('0x1a'):_0x5b87('0x1b');}return _0x48af26;}catch(_0x144c1c){breakingLicense[_0x5b87('0xd')]=_0x1055d9[_0x5b87('0xe')];breakingLicense['message']=_0x144c1c[_0x5b87('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x144061,_0x1f040f){getLicense()['then'](function(_0x2e7223){return db['User'][_0x5b87('0x1d')]({'attributes':[_0x5b87('0x1e'),[db['sequelize']['fn'](_0x5b87('0x1f'),db[_0x5b87('0x20')][_0x5b87('0x21')](_0x5b87('0x1e'))),_0x5b87('0x22')]],'group':_0x5b87('0x1e'),'where':{'role':{'$or':[_0x5b87('0x23'),_0x5b87('0x24'),_0x5b87('0x25')]}},'raw':!![]})[_0x5b87('0xb')](function(_0x3bd86a){var _0x2a808c={'user':_0x2e7223[_0x5b87('0x26')]||0x0,'telephone':_0x2e7223[_0x5b87('0x27')]||0x0};_0x3bd86a['forEach'](function(_0x2c02b9){var _0x839677=_0x2c02b9[_0x5b87('0x1e')]===_0x5b87('0x23')?_0x5b87('0x24'):_0x2c02b9[_0x5b87('0x1e')];_0x2a808c[_0x839677]-=_0x2c02b9['count'];if(_0x2a808c[_0x839677]<0x0)_0x2a808c[_0x839677]=0x0;});_0x144061(_0x2a808c);return;});})[_0x5b87('0xc')](function(_0x1834e6){_0x1f040f(_0x1834e6);});});}function checkUserLimits(_0x5a8ebc){return new BPromise(function(_0x396dc3,_0x196b84){getLimits()[_0x5b87('0xb')](function(_0x32c9bf){var _0x2c0bf2=_[_0x5b87('0x28')](_[_0x5b87('0x29')](_0x5a8ebc,'role'),[_0x5b87('0x23'),_0x5b87('0x24'),_0x5b87('0x25')]);var _0x27d1fc=(_0x2c0bf2[_0x5b87('0x23')]||0x0)+(_0x2c0bf2[_0x5b87('0x24')]||0x0);var _0x20136a=_0x2c0bf2[_0x5b87('0x25')]||0x0;if(_0x27d1fc>_0x32c9bf['user'])return _0x196b84(_0x5b87('0x2a'));if(_0x20136a>_0x32c9bf[_0x5b87('0x25')])return _0x196b84(_0x5b87('0x2b'));return _0x396dc3();})[_0x5b87('0xc')](function(_0xa53d3d){_0x196b84(_0xa53d3d);});});}module[_0x5b87('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 1c19b00..90af25a 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 _0x8aad=['http://localhost:9000','app-id','exports'];(function(_0x4e7306,_0x51515f){var _0x403bbe=function(_0x311e60){while(--_0x311e60){_0x4e7306['push'](_0x4e7306['shift']());}};_0x403bbe(++_0x51515f);}(_0x8aad,0x146));var _0xd8aa=function(_0x4f6b60,_0x424b2e){_0x4f6b60=_0x4f6b60-0x0;var _0x46fc97=_0x8aad[_0x4f6b60];return _0x46fc97;};'use strict';module[_0xd8aa('0x0')]={'DOMAIN':_0xd8aa('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xd8aa('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x430c=['exports','app-id','secret'];(function(_0x4f5444,_0x10dfb7){var _0x1bbeca=function(_0x10198a){while(--_0x10198a){_0x4f5444['push'](_0x4f5444['shift']());}};_0x1bbeca(++_0x10dfb7);}(_0x430c,0x1a1));var _0xc430=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x430c[_0x482214];return _0x38d0cb;};'use strict';module[_0xc430('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xc430('0x1'),'GOOGLE_SECRET':_0xc430('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ba67cdf..d8a8e64 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d76=['exports','fileLogger'];(function(_0x13ee83,_0x456ca6){var _0x43c870=function(_0x50d6aa){while(--_0x50d6aa){_0x13ee83['push'](_0x13ee83['shift']());}};_0x43c870(++_0x456ca6);}(_0x8d76,0xc7));var _0x68d7=function(_0x262a0b,_0x20d859){_0x262a0b=_0x262a0b-0x0;var _0x15f521=_0x8d76[_0x262a0b];return _0x15f521;};'use strict';var fileLogger=require('../utils/loggers')[_0x68d7('0x0')];module[_0x68d7('0x1')]=fileLogger; \ No newline at end of file +var _0x3a3d=['fileLogger'];(function(_0x52033d,_0x4d9784){var _0x5017eb=function(_0x85fdc2){while(--_0x85fdc2){_0x52033d['push'](_0x52033d['shift']());}};_0x5017eb(++_0x4d9784);}(_0x3a3d,0x98));var _0xd3a3=function(_0x402cbf,_0x513960){_0x402cbf=_0x402cbf-0x0;var _0x2b8537=_0x3a3d[_0x402cbf];return _0x2b8537;};'use strict';var fileLogger=require('../utils/loggers')[_0xd3a3('0x0')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 7f1b5bf..248f041 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 _0x4a69=['join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','xdr','exports','path'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0x4a69,0x149));var _0x94a6=function(_0x11da92,_0x3387b7){_0x11da92=_0x11da92-0x0;var _0x626bff=_0x4a69[_0x11da92];return _0x626bff;};'use strict';var path=require(_0x94a6('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x94a6('0x1')](__dirname,_0x94a6('0x2'))},{'name':'ami','script':path[_0x94a6('0x1')](__dirname,_0x94a6('0x3'))},{'name':_0x94a6('0x4'),'script':path[_0x94a6('0x1')](__dirname,_0x94a6('0x5'))},{'name':'email','script':path[_0x94a6('0x1')](__dirname,_0x94a6('0x6'))},{'name':_0x94a6('0x7'),'script':path[_0x94a6('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0x94a6('0x8'),'script':path[_0x94a6('0x1')](__dirname,'../../services/xdr/index.js')}]};module[_0x94a6('0x9')]=config; \ No newline at end of file +var _0x903d=['../../services/express/index.js','ami','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express'];(function(_0x1eeba7,_0x5e92c6){var _0x4fd013=function(_0x2c1bc5){while(--_0x2c1bc5){_0x1eeba7['push'](_0x1eeba7['shift']());}};_0x4fd013(++_0x5e92c6);}(_0x903d,0x184));var _0xd903=function(_0x383c2,_0xde5e32){_0x383c2=_0x383c2-0x0;var _0x5b3bf7=_0x903d[_0x383c2];return _0x5b3bf7;};'use strict';var path=require(_0xd903('0x0'));var os=require('os');var config={'apps':[{'name':_0xd903('0x1'),'script':path['join'](__dirname,_0xd903('0x2'))},{'name':_0xd903('0x3'),'script':path[_0xd903('0x4')](__dirname,_0xd903('0x5'))},{'name':'agi','script':path['join'](__dirname,_0xd903('0x6'))},{'name':_0xd903('0x7'),'script':path[_0xd903('0x4')](__dirname,_0xd903('0x8'))},{'name':_0xd903('0x9'),'script':path[_0xd903('0x4')](__dirname,_0xd903('0xa'))},{'name':_0xd903('0xb'),'script':path[_0xd903('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0xd903('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 003a93a..c5fef9a 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 _0xb164=['connected','start','disconnect','then','restart','list','describe','delete','dump','pm2','bluebird','./config','connect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb164,0xd9));var _0x4b16=function(_0x392bd4,_0x39b219){_0x392bd4=_0x392bd4-0x0;var _0x4831f9=_0xb164[_0x392bd4];return _0x4831f9;};'use strict';var pm2=require(_0x4b16('0x0'));var BPromise=require(_0x4b16('0x1'));var config=require(_0x4b16('0x2'));function connect(){return new BPromise(function(_0x1da8ca,_0x593c85){return pm2[_0x4b16('0x3')](function(_0x2237cd){if(_0x2237cd){return _0x593c85(_0x2237cd);}return _0x1da8ca(_0x4b16('0x4'));});});};exports[_0x4b16('0x5')]=function(_0x3a15d1){return connect()['then'](function(){return new BPromise(function(_0x298e53,_0x3ca10b){return pm2[_0x4b16('0x5')](_0x3a15d1,function(_0x11dcc3,_0x58b370){if(_0x11dcc3){return _0x3ca10b(_0x11dcc3);}pm2[_0x4b16('0x6')]();return _0x298e53(_0x58b370);});});});};exports['stop']=function(_0x1695fc){return connect()[_0x4b16('0x7')](function(){return new BPromise(function(_0x340be7,_0x2926ad){return pm2['stop'](_0x1695fc,function(_0x157522,_0x10e445){if(_0x157522){return _0x2926ad(_0x157522);}pm2[_0x4b16('0x6')]();return _0x340be7(_0x10e445);});});});};exports[_0x4b16('0x8')]=function(_0x269680){return connect()[_0x4b16('0x7')](function(){return new BPromise(function(_0xd03c07,_0x1aac76){return pm2['restart'](_0x269680,function(_0x1949ae,_0x148199){if(_0x1949ae){return _0x1aac76(_0x1949ae);}pm2[_0x4b16('0x6')]();return _0xd03c07(_0x148199);});});});};exports[_0x4b16('0x9')]=function(){return connect()[_0x4b16('0x7')](function(){return new BPromise(function(_0x12f049,_0x3d740b){return pm2['list'](function(_0xf38153,_0x5ea9ec){if(_0xf38153){return _0x3d740b(_0xf38153);}pm2[_0x4b16('0x6')]();return _0x12f049(_0x5ea9ec);});});});};exports['describe']=function(_0x59c2ab){return connect()['then'](function(){return new BPromise(function(_0x3e71dd,_0x37d1f6){return pm2[_0x4b16('0xa')](_0x59c2ab,function(_0x22f9c7,_0x48aadb){if(_0x22f9c7){return _0x37d1f6(_0x22f9c7);}pm2['disconnect']();return _0x3e71dd(_0x48aadb);});});});};exports[_0x4b16('0xb')]=function(_0x4819b5){return connect()[_0x4b16('0x7')](function(){return new BPromise(function(_0xc980e1,_0x13492d){return pm2['delete'](_0x4819b5,function(_0x3e4e6d,_0x8b02bd){if(_0x3e4e6d){return _0x13492d(_0x3e4e6d);}pm2['disconnect']();return _0xc980e1(_0x8b02bd);});});});};exports[_0x4b16('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0xc5c861,_0xb62dc3){return pm2[_0x4b16('0xc')](function(_0x3dd6d8){if(_0x3dd6d8){return _0xb62dc3(_0x3dd6d8);}return _0xc5c861('saved');});});});}; \ No newline at end of file +var _0x9a90=['describe','delete','dump','saved','bluebird','./config','connect','connected','start','then','disconnect','stop','list'];(function(_0x1ec774,_0x38605f){var _0x8523fa=function(_0x32e410){while(--_0x32e410){_0x1ec774['push'](_0x1ec774['shift']());}};_0x8523fa(++_0x38605f);}(_0x9a90,0x18a));var _0x09a9=function(_0x4291fa,_0xf25351){_0x4291fa=_0x4291fa-0x0;var _0x52266d=_0x9a90[_0x4291fa];return _0x52266d;};'use strict';var pm2=require('pm2');var BPromise=require(_0x09a9('0x0'));var config=require(_0x09a9('0x1'));function connect(){return new BPromise(function(_0x31a2b0,_0x4b340a){return pm2[_0x09a9('0x2')](function(_0x2ce567){if(_0x2ce567){return _0x4b340a(_0x2ce567);}return _0x31a2b0(_0x09a9('0x3'));});});};exports[_0x09a9('0x4')]=function(_0x1b3fa5){return connect()[_0x09a9('0x5')](function(){return new BPromise(function(_0x3bba16,_0x273b){return pm2[_0x09a9('0x4')](_0x1b3fa5,function(_0x33fd06,_0x263668){if(_0x33fd06){return _0x273b(_0x33fd06);}pm2[_0x09a9('0x6')]();return _0x3bba16(_0x263668);});});});};exports['stop']=function(_0x4173ed){return connect()[_0x09a9('0x5')](function(){return new BPromise(function(_0x44d68c,_0x3970b2){return pm2[_0x09a9('0x7')](_0x4173ed,function(_0x385542,_0x16700a){if(_0x385542){return _0x3970b2(_0x385542);}pm2[_0x09a9('0x6')]();return _0x44d68c(_0x16700a);});});});};exports['restart']=function(_0x22969f){return connect()[_0x09a9('0x5')](function(){return new BPromise(function(_0x6b47ff,_0x469511){return pm2['restart'](_0x22969f,function(_0x58dd65,_0x14c68d){if(_0x58dd65){return _0x469511(_0x58dd65);}pm2[_0x09a9('0x6')]();return _0x6b47ff(_0x14c68d);});});});};exports[_0x09a9('0x8')]=function(){return connect()[_0x09a9('0x5')](function(){return new BPromise(function(_0x363b43,_0x12f5b2){return pm2[_0x09a9('0x8')](function(_0x34196e,_0x32308b){if(_0x34196e){return _0x12f5b2(_0x34196e);}pm2[_0x09a9('0x6')]();return _0x363b43(_0x32308b);});});});};exports[_0x09a9('0x9')]=function(_0x3dec93){return connect()['then'](function(){return new BPromise(function(_0x5ea503,_0x376a09){return pm2[_0x09a9('0x9')](_0x3dec93,function(_0x2dfa91,_0x420592){if(_0x2dfa91){return _0x376a09(_0x2dfa91);}pm2[_0x09a9('0x6')]();return _0x5ea503(_0x420592);});});});};exports[_0x09a9('0xa')]=function(_0x5b4a08){return connect()['then'](function(){return new BPromise(function(_0x776bd9,_0x2243c6){return pm2[_0x09a9('0xa')](_0x5b4a08,function(_0x38e574,_0x1aaf6e){if(_0x38e574){return _0x2243c6(_0x38e574);}pm2[_0x09a9('0x6')]();return _0x776bd9(_0x1aaf6e);});});});};exports['dump']=function(){return connect()[_0x09a9('0x5')](function(){return new BPromise(function(_0x1783d4,_0x23ef34){return pm2[_0x09a9('0xb')](function(_0x1a5606){if(_0x1a5606){return _0x23ef34(_0x1a5606);}return _0x1783d4(_0x09a9('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b6de08e..d9f58d3 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 _0xb26d=['chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x18f752,_0x4a5cce){var _0x1de2d4=function(_0x3e24ae){while(--_0x3e24ae){_0x18f752['push'](_0x18f752['shift']());}};_0x1de2d4(++_0x4a5cce);}(_0xb26d,0x1b6));var _0xdb26=function(_0x159169,_0xd5f696){_0x159169=_0x159169-0x0;var _0x6ae840=_0xb26d[_0x159169];return _0x6ae840;};'use strict';var _=require(_0xdb26('0x0'));var moment=require(_0xdb26('0x1'));var Redis=require(_0xdb26('0x2'));var util=require(_0xdb26('0x3'));var config=require(_0xdb26('0x4'));var db=require(_0xdb26('0x5'))['db'];var logger=require(_0xdb26('0x6'))(_0xdb26('0x7'));config[_0xdb26('0x8')]=_[_0xdb26('0x9')](config[_0xdb26('0x8')],{'host':_0xdb26('0xa'),'port':0x18eb});var io=require(_0xdb26('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x430f82=0x0;var _0x382b05=[];return db[_0xdb26('0xc')]['find']({'raw':!![],'attributes':['id',_0xdb26('0xd')],'where':{'id':0x1}})[_0xdb26('0xe')](function(_0x58984d){_0x430f82=_0x58984d[_0xdb26('0xd')];if(_0x430f82){return db[_0xdb26('0xf')][_0xdb26('0x10')]({'raw':!![],'attributes':['id',_0xdb26('0x11')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xdb26('0x12')](_0x58984d[_0xdb26('0xd')],_0xdb26('0x13'))}}});}else{return[];}})[_0xdb26('0xe')](function(_0x4cbc2d){if(_0x4cbc2d&&_0x4cbc2d[_0xdb26('0x14')]){_0x382b05=_[_0xdb26('0x15')](_0x4cbc2d||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x382b05[_0xdb26('0x16')]());return db[_0xdb26('0xf')][_0xdb26('0x17')]({'closeReason':_0xdb26('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xdb26('0x19'))},{'where':{'id':_0x382b05}});}})['then'](function(){if(_0x382b05&&_0x382b05[_0xdb26('0x14')]){logger['info'](_0xdb26('0x1a'),_0x382b05[_0xdb26('0x16')]());for(var _0x21264d=0x0;_0x21264d<_0x382b05[_0xdb26('0x14')];_0x21264d++){io['emit'](_0xdb26('0x1b'),{'id':_0x382b05[_0x21264d],'closed':!![]});}}})[_0xdb26('0x1c')](function(_0x1210ec){logger['error'](_0xdb26('0x1d'),_0x1210ec?util[_0xdb26('0x1e')](_0x1210ec,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x102a=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format'];(function(_0xbbd64e,_0x9f59cf){var _0x2c35ff=function(_0x32b9ea){while(--_0x32b9ea){_0xbbd64e['push'](_0xbbd64e['shift']());}};_0x2c35ff(++_0x9f59cf);}(_0x102a,0x8b));var _0xa102=function(_0x52a2f4,_0x275def){_0x52a2f4=_0x52a2f4-0x0;var _0x4afb09=_0x102a[_0x52a2f4];return _0x4afb09;};'use strict';var _=require(_0xa102('0x0'));var moment=require(_0xa102('0x1'));var Redis=require(_0xa102('0x2'));var util=require(_0xa102('0x3'));var config=require('../../config/environment');var db=require(_0xa102('0x4'))['db'];var logger=require('../logger')(_0xa102('0x5'));config[_0xa102('0x6')]=_[_0xa102('0x7')](config['redis'],{'host':_0xa102('0x8'),'port':0x18eb});var io=require(_0xa102('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x23203a=0x0;var _0x496eed=[];return db['Setting'][_0xa102('0xa')]({'raw':!![],'attributes':['id',_0xa102('0xb')],'where':{'id':0x1}})[_0xa102('0xc')](function(_0x29131d){_0x23203a=_0x29131d['chatTimeout'];if(_0x23203a){return db[_0xa102('0xd')][_0xa102('0xe')]({'raw':!![],'attributes':['id',_0xa102('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa102('0x10')](_0x29131d[_0xa102('0xb')],'minutes')}}});}else{return[];}})[_0xa102('0xc')](function(_0x2d3ce9){if(_0x2d3ce9&&_0x2d3ce9[_0xa102('0x11')]){_0x496eed=_[_0xa102('0x12')](_0x2d3ce9||[],'id');logger[_0xa102('0x13')](_0xa102('0x14'),_0x496eed[_0xa102('0x15')]());return db[_0xa102('0xd')][_0xa102('0x16')]({'closeReason':_0xa102('0x17'),'disposition':_0xa102('0x18'),'closed':!![],'closedAt':moment()[_0xa102('0x19')](_0xa102('0x1a'))},{'where':{'id':_0x496eed}});}})[_0xa102('0xc')](function(){if(_0x496eed&&_0x496eed[_0xa102('0x11')]){logger['info'](_0xa102('0x1b'),_0x496eed[_0xa102('0x15')]());for(var _0x2e901f=0x0;_0x2e901f<_0x496eed[_0xa102('0x11')];_0x2e901f++){io[_0xa102('0x1c')](_0xa102('0x1d'),{'id':_0x496eed[_0x2e901f],'closed':!![]});}}})['catch'](function(_0x32f276){logger['error'](_0xa102('0x1e'),_0x32f276?util[_0xa102('0x1f')](_0x32f276,{'showHidden':![],'depth':null}):'');});}exports[_0xa102('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 6923076..e54daaa 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 _0x4463=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x246279,_0x2d413f){var _0x2ff03c=function(_0x34f0c1){while(--_0x34f0c1){_0x246279['push'](_0x246279['shift']());}};_0x2ff03c(++_0x2d413f);}(_0x4463,0x131));var _0x3446=function(_0x467426,_0x209829){_0x467426=_0x467426-0x0;var _0xfdc47d=_0x4463[_0x467426];return _0xfdc47d;};'use strict';function start(){var _0x388f62=require(_0x3446('0x0'));return _0x388f62[_0x3446('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x62ab=['startAllRefreshIntervals'];(function(_0x3ef915,_0x1d6478){var _0x441d24=function(_0x165c56){while(--_0x165c56){_0x3ef915['push'](_0x3ef915['shift']());}};_0x441d24(++_0x1d6478);}(_0x62ab,0xd0));var _0xb62a=function(_0x2f8cf2,_0x3f4571){_0x2f8cf2=_0x2f8cf2-0x0;var _0xc2eb2b=_0x62ab[_0x2f8cf2];return _0xc2eb2b;};'use strict';function start(){var _0x385c79=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x385c79[_0xb62a('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 03c9e12..c7ec6c8 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 _0x5b9c=['zip','join','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','existsSync','status','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','intersection','difference','exists','stop','delete\x20cron','toRun','length','my\x20id','resolve','cron','active','startAt','endAt','add','start','deleteJob','stop\x20cron','isBetween','update','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','user','bcc','format','subtractNumber','subtractUnit','savename','%s.%s','extname'];(function(_0x252886,_0xce49d1){var _0x5b51ff=function(_0x2a11c3){while(--_0x2a11c3){_0x252886['push'](_0x252886['shift']());}};_0x5b51ff(++_0xce49d1);}(_0x5b9c,0x1a6));var _0xc5b9=function(_0x51b26b,_0x37bcd9){_0x51b26b=_0x51b26b-0x0;var _0x453af2=_0x5b9c[_0x51b26b];return _0x453af2;};'use strict';var fs=require('fs');var util=require(_0xc5b9('0x0'));var path=require(_0xc5b9('0x1'));var _=require(_0xc5b9('0x2'));var moment=require(_0xc5b9('0x3'));var CronJobManager=require(_0xc5b9('0x4'));var jayson=require(_0xc5b9('0x5'));var BPromise=require(_0xc5b9('0x6'));var logger=require(_0xc5b9('0x7'))('schedule');var db=require(_0xc5b9('0x8'))['db'];var analyticCustomReportController=require(_0xc5b9('0x9'));var analyticDefaultReportController=require(_0xc5b9('0xa'));var client=jayson[_0xc5b9('0xb')][_0xc5b9('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x258c2d,_0xf835ee){return function(){logger[_0xc5b9('0xd')](_0xc5b9('0xe'),_0x258c2d[_0xc5b9('0xf')]);var _0xbd9f5a=!![];var _0x27adda=_0x258c2d[_0xc5b9('0x10')][_0xc5b9('0x11')]();var _0xc47827={'account':_0x27adda,'message':{'from':util['format'](_0xc5b9('0x12'),_0x258c2d[_0xc5b9('0x10')][_0xc5b9('0x13')],_0x258c2d[_0xc5b9('0x10')][_0xc5b9('0xf')]||_0x258c2d[_0xc5b9('0x10')]['Smtp'][_0xc5b9('0x14')]),'to':_0x258c2d[_0xc5b9('0xf')],'cc':_0x258c2d['cc'],'bcc':_0x258c2d[_0xc5b9('0x15')],'subject':util[_0xc5b9('0x16')]('Report\x20%s\x20last\x20%s\x20%s',_0xf835ee['name'],_0x258c2d[_0xc5b9('0x17')],_0x258c2d[_0xc5b9('0x18')])}};var _0x24ace5=path['join'](__dirname,'../../files/reports');var _0x167971=_0xf835ee[_0xc5b9('0x19')];var _0x1df153=util[_0xc5b9('0x16')](_0xc5b9('0x1a'),path['basename'](_0xf835ee[_0xc5b9('0x19')],path[_0xc5b9('0x1b')](_0xf835ee[_0xc5b9('0x19')])),_0xc5b9('0x1c'));var _0x1d4e71=path['join'](_0x24ace5,_0x167971);var _0x280e7e=path[_0xc5b9('0x1d')](_0x24ace5,_0x1df153);if(fs['existsSync'](_0x1d4e71)){_0xf835ee['status']='Sent';_0xc47827[_0xc5b9('0x1e')][_0xc5b9('0x1f')]=[{'filename':_0x167971,'path':_0x1d4e71}];_0xc47827[_0xc5b9('0x1e')][_0xc5b9('0x20')]=util[_0xc5b9('0x16')](_0xc5b9('0x21'),JSON[_0xc5b9('0x22')](_0xf835ee,null,0x2));}else if(fs[_0xc5b9('0x23')](_0x280e7e)){_0xf835ee[_0xc5b9('0x24')]=_0xc5b9('0x25');_0xc47827[_0xc5b9('0x1e')][_0xc5b9('0x1f')]=[{'filename':_0x1df153,'path':_0x280e7e}];}else{_0xc47827[_0xc5b9('0x1e')][_0xc5b9('0x20')]=_0xc5b9('0x26');if(!_0x258c2d[_0xc5b9('0x27')]){_0xbd9f5a=![];logger[_0xc5b9('0xd')](_0xc5b9('0x28'));}}if(_0xbd9f5a){return client[_0xc5b9('0x29')](_0xc5b9('0x2a'),_0xc47827)['then'](function(_0x4a9e73){if(_0x4a9e73[_0xc5b9('0x2b')]){return logger[_0xc5b9('0x2b')](_0xc5b9('0x2c'),JSON[_0xc5b9('0x22')](_0x4a9e73));}return logger['info'](_0xc5b9('0x2d'));})['catch'](function(_0xd3566){return logger[_0xc5b9('0x2b')](_0xc5b9('0x2c'),JSON[_0xc5b9('0x22')](_0xd3566));});}};}function handleError(){return function(_0x2bb519){return logger['error'](JSON[_0xc5b9('0x22')](_0x2bb519));};}function handleResult(_0x5e5a8b){return function(_0x14345d){logger[_0xc5b9('0xd')](_0xc5b9('0x2e'),JSON[_0xc5b9('0x22')](_0x14345d));if(_0x5e5a8b[_0xc5b9('0x10')]&&_0x5e5a8b[_0xc5b9('0x10')][_0xc5b9('0x2f')]&&!_['isNil'](_0x5e5a8b[_0xc5b9('0xf')])){setTimeout(handleSendEmail(_0x5e5a8b,_0x14345d),0x3c*0x3e8);}};}function handleJob(_0x3f150e){return function(){try{if(_[_0xc5b9('0x30')](_0x3f150e[_0xc5b9('0x17')])){return logger[_0xc5b9('0xd')](_0xc5b9('0x31'));}if(_[_0xc5b9('0x30')](_0x3f150e[_0xc5b9('0x18')])){return logger[_0xc5b9('0xd')](_0xc5b9('0x32'));}var _0x5ed042={'startDate':moment()[_0xc5b9('0x33')](_0x3f150e[_0xc5b9('0x17')],_0x3f150e[_0xc5b9('0x18')])[_0xc5b9('0x16')](_0xc5b9('0x34')),'endDate':moment()[_0xc5b9('0x16')](_0xc5b9('0x34')),'type':_0xc5b9('0x35'),'output':_0x3f150e[_0xc5b9('0x36')],'name':_0x3f150e[_0xc5b9('0x13')]};if(!_[_0xc5b9('0x30')](_0x3f150e['DefaultReportId'])){logger['info'](_0xc5b9('0x37'),_0x3f150e[_0xc5b9('0x38')]);return analyticDefaultReportController[_0xc5b9('0x39')]({'id':_0x3f150e[_0xc5b9('0x38')]},_0x5ed042)['then'](handleResult(_0x3f150e))[_0xc5b9('0x3a')](handleError());}if(!_[_0xc5b9('0x30')](_0x3f150e[_0xc5b9('0x3b')])){logger[_0xc5b9('0xd')](_0xc5b9('0x3c'),_0x3f150e['CustomReportId']);return analyticCustomReportController[_0xc5b9('0x39')]({'id':_0x3f150e[_0xc5b9('0x3b')]},_0x5ed042)[_0xc5b9('0x3d')](handleResult(_0x3f150e))['catch'](handleError());}}catch(_0x19ee2f){logger[_0xc5b9('0x2b')](JSON[_0xc5b9('0x22')](_0x19ee2f));}return logger['info'](_0xc5b9('0x3e'));};}function getJobs(_0x39a02f){var _0x378b83={};if(_0x39a02f){_0x378b83['id']=_0x39a02f;}return db[_0xc5b9('0x3f')][_0xc5b9('0x40')]({'where':_0x378b83,'include':[{'model':db[_0xc5b9('0x10')],'attributes':['id','name','email'],'include':[{'model':db[_0xc5b9('0x41')],'as':_0xc5b9('0x2f'),'include':[{'model':db[_0xc5b9('0x42')],'as':_0xc5b9('0x42')}]}]}]})[_0xc5b9('0x3d')](function(_0x4ff646){var _0xf72cad=_[_0xc5b9('0x43')](manager['jobs']);var _0x12c298=_[_0xc5b9('0x44')](_0x4ff646,function(_0x467d81){return _0x467d81['id'][_0xc5b9('0x45')]();});var _0x4c2bea=_[_0xc5b9('0x46')](_0x4ff646,function(_0xfaadf9){return _0xfaadf9['id'][_0xc5b9('0x45')]();});var _0x2b65c0=_0x39a02f?_0x12c298:_['difference'](_0x12c298,_0xf72cad);var _0x3b16a0=_[_0xc5b9('0x47')](_0x12c298,_0xf72cad);var _0x3a736e=_[_0xc5b9('0x48')](_0xf72cad,_0x12c298);var _0x47c5d7;var _0x202792;for(_0x47c5d7=0x0;_0x47c5d7<_0x3a736e['length']&&!_0x39a02f;_0x47c5d7+=0x1){_0x202792=_0x3a736e[_0x47c5d7][_0xc5b9('0x45')]();if(manager[_0xc5b9('0x49')](_0x202792)){manager[_0xc5b9('0x4a')](_0x202792);manager['deleteJob'](_0x202792);logger['info'](_0xc5b9('0x4b'),_0x202792);}}logger[_0xc5b9('0xd')](_0xc5b9('0x4c'),JSON['stringify'](_0x2b65c0));for(_0x47c5d7=0x0;_0x47c5d7<_0x2b65c0[_0xc5b9('0x4d')];_0x47c5d7+=0x1){_0x202792=_0x2b65c0[_0x47c5d7]['toString']();logger['info']('index',_0x202792);if(_0x39a02f){logger[_0xc5b9('0xd')](_0xc5b9('0x4e'),_0x39a02f);logger[_0xc5b9('0xd')](JSON['stringify'](_0x4c2bea[_0x202792]));BPromise[_0xc5b9('0x4f')]()[_0xc5b9('0x3d')](handleJob(_0x4c2bea[_0x202792]));logger[_0xc5b9('0xd')]('run\x20job',_0x4c2bea[_0x202792][_0xc5b9('0x13')],_0x4c2bea[_0x202792][_0xc5b9('0x50')]);}else if(_0x4c2bea[_0x202792]['cron']&&_0x4c2bea[_0x202792][_0xc5b9('0x51')]&&moment()['isBetween'](_0x4c2bea[_0x202792][_0xc5b9('0x52')],_0x4c2bea[_0x202792][_0xc5b9('0x53')])){manager[_0xc5b9('0x54')](_0x202792,_0x4c2bea[_0x202792]['cron'],handleJob(_0x4c2bea[_0x202792]));manager[_0xc5b9('0x55')](_0x202792);logger[_0xc5b9('0xd')]('add\x20cron',_0x4c2bea[_0x202792][_0xc5b9('0x13')],_0x4c2bea[_0x202792][_0xc5b9('0x50')]);}else if(manager[_0xc5b9('0x49')](_0x202792)){manager['stop'](_0x202792);manager[_0xc5b9('0x56')](_0x202792);logger[_0xc5b9('0xd')](_0xc5b9('0x57'),_0x4c2bea[_0x202792][_0xc5b9('0x13')],_0x4c2bea[_0x202792][_0xc5b9('0x50')]);}}for(_0x47c5d7=0x0,_0x202792;_0x47c5d7<_0x3b16a0[_0xc5b9('0x4d')]&&!_0x39a02f;_0x47c5d7+=0x1){_0x202792=_0x3b16a0[_0x47c5d7][_0xc5b9('0x45')]();if(manager[_0xc5b9('0x49')](_0x202792)){if(_0x4c2bea[_0x202792][_0xc5b9('0x50')]&&_0x4c2bea[_0x202792][_0xc5b9('0x51')]&&moment()[_0xc5b9('0x58')](_0x4c2bea[_0x202792][_0xc5b9('0x52')],_0x4c2bea[_0x202792]['endAt'])){manager[_0xc5b9('0x59')](_0x202792,_0x4c2bea[_0x202792]['cron'],handleJob(_0x4c2bea[_0x202792]));logger[_0xc5b9('0xd')]('update\x20cron',_0x4c2bea[_0x202792][_0xc5b9('0x13')],_0x4c2bea[_0x202792][_0xc5b9('0x50')]);}else{manager[_0xc5b9('0x4a')](_0x202792);manager[_0xc5b9('0x56')](_0x202792);logger[_0xc5b9('0xd')]('stop\x20cron',_0x4c2bea[_0x202792][_0xc5b9('0x13')],_0x4c2bea[_0x202792][_0xc5b9('0x50')]);}}}})[_0xc5b9('0x3a')](function(_0x42cffe){logger[_0xc5b9('0x2b')](JSON[_0xc5b9('0x22')](_0x42cffe));});}exports['run']=function(_0x49e303){return getJobs(_0x49e303);};exports[_0xc5b9('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5345=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','isNil','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','jobs','map','keyBy','toString','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','add','start','stop\x20cron','isBetween','endAt','update','update\x20cron','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','email','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','savename','basename','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'];(function(_0x465a61,_0x4b9de5){var _0xd8f983=function(_0x366ee6){while(--_0x366ee6){_0x465a61['push'](_0x465a61['shift']());}};_0xd8f983(++_0x4b9de5);}(_0x5345,0x13a));var _0x5534=function(_0x4c29b2,_0x23d107){_0x4c29b2=_0x4c29b2-0x0;var _0x43d0c2=_0x5345[_0x4c29b2];return _0x43d0c2;};'use strict';var fs=require('fs');var util=require(_0x5534('0x0'));var path=require(_0x5534('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x5534('0x2'));var jayson=require(_0x5534('0x3'));var BPromise=require(_0x5534('0x4'));var logger=require(_0x5534('0x5'))(_0x5534('0x6'));var db=require(_0x5534('0x7'))['db'];var analyticCustomReportController=require(_0x5534('0x8'));var analyticDefaultReportController=require(_0x5534('0x9'));var client=jayson['client'][_0x5534('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5d7468,_0x19dcb9){return function(){logger[_0x5534('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5d7468['email']);var _0x33d0ff=!![];var _0x1e986f=_0x5d7468['MailAccount']['getSmtpOptions']();var _0x9fa7be={'account':_0x1e986f,'message':{'from':util[_0x5534('0xc')](_0x5534('0xd'),_0x5d7468[_0x5534('0xe')]['name'],_0x5d7468[_0x5534('0xe')]['email']||_0x5d7468['MailAccount'][_0x5534('0xf')][_0x5534('0x10')]),'to':_0x5d7468[_0x5534('0x11')],'cc':_0x5d7468['cc'],'bcc':_0x5d7468['bcc'],'subject':util[_0x5534('0xc')](_0x5534('0x12'),_0x19dcb9[_0x5534('0x13')],_0x5d7468['subtractNumber'],_0x5d7468[_0x5534('0x14')])}};var _0x57f789=path[_0x5534('0x15')](__dirname,'../../files/reports');var _0x5af1d7=_0x19dcb9[_0x5534('0x16')];var _0xb37bd2=util[_0x5534('0xc')]('%s.%s',path[_0x5534('0x17')](_0x19dcb9[_0x5534('0x16')],path[_0x5534('0x18')](_0x19dcb9['savename'])),_0x5534('0x19'));var _0x3fe0d7=path[_0x5534('0x15')](_0x57f789,_0x5af1d7);var _0x2417c0=path[_0x5534('0x15')](_0x57f789,_0xb37bd2);if(fs[_0x5534('0x1a')](_0x3fe0d7)){_0x19dcb9[_0x5534('0x1b')]=_0x5534('0x1c');_0x9fa7be[_0x5534('0x1d')][_0x5534('0x1e')]=[{'filename':_0x5af1d7,'path':_0x3fe0d7}];_0x9fa7be['message'][_0x5534('0x1f')]=util[_0x5534('0xc')](_0x5534('0x20'),JSON[_0x5534('0x21')](_0x19dcb9,null,0x2));}else if(fs[_0x5534('0x1a')](_0x2417c0)){_0x19dcb9[_0x5534('0x1b')]='Sent';_0x9fa7be[_0x5534('0x1d')][_0x5534('0x1e')]=[{'filename':_0xb37bd2,'path':_0x2417c0}];}else{_0x9fa7be[_0x5534('0x1d')][_0x5534('0x1f')]=_0x5534('0x22');if(!_0x5d7468[_0x5534('0x23')]){_0x33d0ff=![];logger['info'](_0x5534('0x24'));}}if(_0x33d0ff){return client[_0x5534('0x25')](_0x5534('0x26'),_0x9fa7be)[_0x5534('0x27')](function(_0x19dff1){if(_0x19dff1[_0x5534('0x28')]){return logger[_0x5534('0x28')](_0x5534('0x29'),JSON[_0x5534('0x21')](_0x19dff1));}return logger[_0x5534('0xb')](_0x5534('0x2a'));})[_0x5534('0x2b')](function(_0x5a5f0a){return logger['error'](_0x5534('0x29'),JSON[_0x5534('0x21')](_0x5a5f0a));});}};}function handleError(){return function(_0x1fb07e){return logger[_0x5534('0x28')](JSON[_0x5534('0x21')](_0x1fb07e));};}function handleResult(_0x1cba13){return function(_0x4d7d09){logger['info'](_0x5534('0x2c'),JSON[_0x5534('0x21')](_0x4d7d09));if(_0x1cba13[_0x5534('0xe')]&&_0x1cba13['MailAccount'][_0x5534('0xf')]&&!_['isNil'](_0x1cba13[_0x5534('0x11')])){setTimeout(handleSendEmail(_0x1cba13,_0x4d7d09),0x3c*0x3e8);}};}function handleJob(_0xc1fb1a){return function(){try{if(_['isNil'](_0xc1fb1a[_0x5534('0x2d')])){return logger[_0x5534('0xb')](_0x5534('0x2e'));}if(_['isNil'](_0xc1fb1a[_0x5534('0x14')])){return logger[_0x5534('0xb')](_0x5534('0x2f'));}var _0x1107c0={'startDate':moment()[_0x5534('0x30')](_0xc1fb1a['subtractNumber'],_0xc1fb1a[_0x5534('0x14')])['format'](_0x5534('0x31')),'endDate':moment()['format'](_0x5534('0x31')),'type':_0x5534('0x32'),'output':_0xc1fb1a[_0x5534('0x33')],'name':_0xc1fb1a[_0x5534('0x13')]};if(!_[_0x5534('0x34')](_0xc1fb1a['DefaultReportId'])){logger[_0x5534('0xb')](_0x5534('0x35'),_0xc1fb1a[_0x5534('0x36')]);return analyticDefaultReportController[_0x5534('0x37')]({'id':_0xc1fb1a[_0x5534('0x36')]},_0x1107c0)['then'](handleResult(_0xc1fb1a))['catch'](handleError());}if(!_[_0x5534('0x34')](_0xc1fb1a['CustomReportId'])){logger[_0x5534('0xb')](_0x5534('0x38'),_0xc1fb1a[_0x5534('0x39')]);return analyticCustomReportController[_0x5534('0x37')]({'id':_0xc1fb1a[_0x5534('0x39')]},_0x1107c0)[_0x5534('0x27')](handleResult(_0xc1fb1a))['catch'](handleError());}}catch(_0x174c97){logger[_0x5534('0x28')](JSON[_0x5534('0x21')](_0x174c97));}return logger[_0x5534('0xb')](_0x5534('0x3a'));};}function getJobs(_0x36e390){var _0x367d90={};if(_0x36e390){_0x367d90['id']=_0x36e390;}return db[_0x5534('0x3b')]['findAll']({'where':_0x367d90,'include':[{'model':db[_0x5534('0xe')],'attributes':['id',_0x5534('0x13'),_0x5534('0x11')],'include':[{'model':db[_0x5534('0x3c')],'as':_0x5534('0xf'),'include':[{'model':db[_0x5534('0x3d')],'as':_0x5534('0x3d')}]}]}]})[_0x5534('0x27')](function(_0x42a991){var _0x306994=_['keys'](manager[_0x5534('0x3e')]);var _0x534e0b=_[_0x5534('0x3f')](_0x42a991,function(_0x320378){return _0x320378['id']['toString']();});var _0x3443c9=_[_0x5534('0x40')](_0x42a991,function(_0x18a676){return _0x18a676['id'][_0x5534('0x41')]();});var _0x4459bc=_0x36e390?_0x534e0b:_['difference'](_0x534e0b,_0x306994);var _0x419c71=_[_0x5534('0x42')](_0x534e0b,_0x306994);var _0xf0f22a=_['difference'](_0x306994,_0x534e0b);var _0x1e79ad;var _0x3405ec;for(_0x1e79ad=0x0;_0x1e79ad<_0xf0f22a[_0x5534('0x43')]&&!_0x36e390;_0x1e79ad+=0x1){_0x3405ec=_0xf0f22a[_0x1e79ad][_0x5534('0x41')]();if(manager[_0x5534('0x44')](_0x3405ec)){manager[_0x5534('0x45')](_0x3405ec);manager[_0x5534('0x46')](_0x3405ec);logger[_0x5534('0xb')](_0x5534('0x47'),_0x3405ec);}}logger[_0x5534('0xb')](_0x5534('0x48'),JSON[_0x5534('0x21')](_0x4459bc));for(_0x1e79ad=0x0;_0x1e79ad<_0x4459bc[_0x5534('0x43')];_0x1e79ad+=0x1){_0x3405ec=_0x4459bc[_0x1e79ad][_0x5534('0x41')]();logger[_0x5534('0xb')](_0x5534('0x49'),_0x3405ec);if(_0x36e390){logger[_0x5534('0xb')](_0x5534('0x4a'),_0x36e390);logger[_0x5534('0xb')](JSON[_0x5534('0x21')](_0x3443c9[_0x3405ec]));BPromise[_0x5534('0x4b')]()[_0x5534('0x27')](handleJob(_0x3443c9[_0x3405ec]));logger['info'](_0x5534('0x4c'),_0x3443c9[_0x3405ec][_0x5534('0x13')],_0x3443c9[_0x3405ec][_0x5534('0x4d')]);}else if(_0x3443c9[_0x3405ec][_0x5534('0x4d')]&&_0x3443c9[_0x3405ec][_0x5534('0x4e')]&&moment()['isBetween'](_0x3443c9[_0x3405ec]['startAt'],_0x3443c9[_0x3405ec]['endAt'])){manager[_0x5534('0x4f')](_0x3405ec,_0x3443c9[_0x3405ec][_0x5534('0x4d')],handleJob(_0x3443c9[_0x3405ec]));manager[_0x5534('0x50')](_0x3405ec);logger['info']('add\x20cron',_0x3443c9[_0x3405ec]['name'],_0x3443c9[_0x3405ec]['cron']);}else if(manager['exists'](_0x3405ec)){manager[_0x5534('0x45')](_0x3405ec);manager[_0x5534('0x46')](_0x3405ec);logger['info'](_0x5534('0x51'),_0x3443c9[_0x3405ec][_0x5534('0x13')],_0x3443c9[_0x3405ec]['cron']);}}for(_0x1e79ad=0x0,_0x3405ec;_0x1e79ad<_0x419c71[_0x5534('0x43')]&&!_0x36e390;_0x1e79ad+=0x1){_0x3405ec=_0x419c71[_0x1e79ad][_0x5534('0x41')]();if(manager['exists'](_0x3405ec)){if(_0x3443c9[_0x3405ec]['cron']&&_0x3443c9[_0x3405ec][_0x5534('0x4e')]&&moment()[_0x5534('0x52')](_0x3443c9[_0x3405ec]['startAt'],_0x3443c9[_0x3405ec][_0x5534('0x53')])){manager[_0x5534('0x54')](_0x3405ec,_0x3443c9[_0x3405ec][_0x5534('0x4d')],handleJob(_0x3443c9[_0x3405ec]));logger['info'](_0x5534('0x55'),_0x3443c9[_0x3405ec][_0x5534('0x13')],_0x3443c9[_0x3405ec][_0x5534('0x4d')]);}else{manager['stop'](_0x3405ec);manager[_0x5534('0x46')](_0x3405ec);logger[_0x5534('0xb')](_0x5534('0x51'),_0x3443c9[_0x3405ec][_0x5534('0x13')],_0x3443c9[_0x3405ec][_0x5534('0x4d')]);}}}})[_0x5534('0x2b')](function(_0x42ab03){logger[_0x5534('0x28')](JSON[_0x5534('0x21')](_0x42ab03));});}exports[_0x5534('0x56')]=function(_0xb2d3c4){return getJobs(_0xb2d3c4);};exports[_0x5534('0x50')]=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 cfd5993..59e9428 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 _0x590a=['COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','data1','data2','ValidationError','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Neutral','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText'];(function(_0x92ad86,_0x3c09c3){var _0x188fbb=function(_0x3af3fe){while(--_0x3af3fe){_0x92ad86['push'](_0x92ad86['shift']());}};_0x188fbb(++_0x3c09c3);}(_0x590a,0x159));var _0xa590=function(_0x182950,_0x4e1947){_0x182950=_0x182950-0x0;var _0xa92eec=_0x590a[_0x182950];return _0xa92eec;};var _=require('lodash');var AWS=require(_0xa590('0x0'));var rp=require(_0xa590('0x1'));var util=require(_0xa590('0x2'));var BPromise=require(_0xa590('0x3'));var db=require(_0xa590('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x8ee149,_0x26b6d9,_0x2fc2a0,_0x511477){return new Promise(function(_0x20f21b,_0x4c127b){var _0x2dcf20=new AWS[(_0xa590('0x5'))]({'accessKeyId':_0x26b6d9,'secretAccessKey':_0x8ee149,'region':_0x2fc2a0});_0x2dcf20[_0xa590('0x6')]({'TranscriptionJobName':_0x511477},function(_0x27a5fa,_0x5d9565){if(_0x27a5fa){return _0x4c127b(_0x27a5fa);}else{return _0x20f21b(_0x5d9565);}});});}function sentiment(_0x4d840d,_0x13dc7a,_0x486f78,_0x397b6c,_0x3e59f3){return new Promise(function(_0x3d7163,_0x5ad7e3){var _0x42a9e2=new AWS[(_0xa590('0x7'))]({'accessKeyId':_0x13dc7a,'secretAccessKey':_0x4d840d,'region':_0x486f78});_0x42a9e2[_0xa590('0x8')]({'Text':_0x397b6c,'LanguageCode':_0x3e59f3[_0xa590('0x9')](0x0,0x2)},function(_0x43ed55,_0x224ab8){if(_0x43ed55){return _0x5ad7e3(_0x43ed55);}else{return _0x3d7163(_0x224ab8);}});});}function checkTranscribeJob(_0x201863,_0x570b51,_0x5bc467){var _0x252e2b;return new BPromise(function(_0xb67661,_0x5b23a4){logger[_0xa590('0xa')](util['format'](_0xa590('0xb'),_0x201863['id'],_0x201863[_0xa590('0xc')]));return getTranscriptionJob(_0x5bc467['data1'],_0x5bc467['data2'],_0x570b51[_0xa590('0xd')],_0x201863['transcribeName'])[_0xa590('0xe')](function(_0x6ca5c8){logger[_0xa590('0xa')](util[_0xa590('0xf')](_0xa590('0x10'),_0x201863['id'],_0x201863[_0xa590('0xc')],_0x6ca5c8[_0xa590('0x11')][_0xa590('0x12')]));if(!_0x201863[_0xa590('0x13')]){switch(_0x6ca5c8[_0xa590('0x11')][_0xa590('0x12')]){case _0xa590('0x14'):var _0x2161ce={'transcribeStatus':_0x6ca5c8[_0xa590('0x11')][_0xa590('0x12')],'fileUri':_0x6ca5c8[_0xa590('0x11')][_0xa590('0x15')][_0xa590('0x16')]};logger[_0xa590('0xa')](util[_0xa590('0xf')](_0xa590('0x17'),_0x201863['id']));return rp({'uri':_0x6ca5c8[_0xa590('0x11')]['Transcript'][_0xa590('0x16')],'json':!![]})[_0xa590('0xe')](function(_0x47d5f4){logger['info'](util[_0xa590('0xf')](_0xa590('0x18'),_0x201863['id']));if(_0x47d5f4&&_0x47d5f4[_0xa590('0x19')]&&_0x47d5f4[_0xa590('0x19')][_0xa590('0x1a')]&&_0x47d5f4['results'][_0xa590('0x1a')][_0xa590('0x1b')]){_0x2161ce[_0xa590('0x13')]='';for(var _0x257297=0x0;_0x257297<_0x47d5f4[_0xa590('0x19')][_0xa590('0x1a')]['length'];_0x257297++){_0x2161ce[_0xa590('0x13')]+=_0x47d5f4['results'][_0xa590('0x1a')][_0x257297][_0xa590('0x1c')]+'';}}return _0x201863[_0xa590('0x1d')](_0x2161ce);})['then'](function(){logger[_0xa590('0xa')](util[_0xa590('0xf')](_0xa590('0x1e'),_0x201863['id']));if(!_0x201863[_0xa590('0x1f')]){throw new db['Sequelize']['ValidationError'](_0xa590('0x20'));}if(!_0x570b51[_0xa590('0x21')]||!_0x570b51[_0xa590('0x22')]||!_0x570b51[_0xa590('0x23')]||!_0x570b51[_0xa590('0x24')]||!_0x570b51[_0xa590('0x25')]){throw new db[(_0xa590('0x26'))]['ValidationError'](_0xa590('0x27'));}if(!_0x2161ce[_0xa590('0x13')]){throw new Error(_0xa590('0x28'));}if(_0x570b51[_0xa590('0x22')]===_0x5bc467['id']){return _0x5bc467;}else{return db[_0xa590('0x29')][_0xa590('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x5e86e2){if(!_0x5e86e2){throw new db[(_0xa590('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5e86e2[_0xa590('0x2b')]||!_0x5e86e2[_0xa590('0x2c')]){throw new db[(_0xa590('0x26'))][(_0xa590('0x2d'))]('Cloud\x20Provider\x20not\x20configured');}_0x252e2b=_0x5e86e2;logger[_0xa590('0xa')](util[_0xa590('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x201863['id']));return sentiment(_0x252e2b[_0xa590('0x2b')],_0x252e2b[_0xa590('0x2c')],_0x570b51[_0xa590('0x23')],_0x2161ce[_0xa590('0x13')],_0x570b51[_0xa590('0x24')]);})['then'](function(_0x3e88cd){logger['info'](util[_0xa590('0xf')](_0xa590('0x2e'),_0x201863['id']));return _0x201863[_0xa590('0x1d')]({'sentiment':_0x3e88cd[_0xa590('0x2f')],'sPositive':_0x3e88cd['SentimentScore'][_0xa590('0x30')],'sNegative':_0x3e88cd[_0xa590('0x31')][_0xa590('0x32')],'sMixed':_0x3e88cd[_0xa590('0x31')][_0xa590('0x33')],'sNeutral':_0x3e88cd[_0xa590('0x31')]['Neutral']});})[_0xa590('0xe')](function(){logger[_0xa590('0xa')](util[_0xa590('0xf')](_0xa590('0x1e'),_0x201863['id']));_0xb67661();});case _0xa590('0x34'):return _0x201863[_0xa590('0x1d')]({'transcribeStatus':_0xa590('0x34'),'failureReason':_0x6ca5c8[_0xa590('0x11')][_0xa590('0x35')]})[_0xa590('0xe')](function(){logger[_0xa590('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x201863['id']));_0xb67661();});default:logger['info'](util[_0xa590('0xf')](_0xa590('0x36'),_0x201863['id']));break;}}else{return BPromise[_0xa590('0x37')]()[_0xa590('0xe')](function(){if(!_0x201863[_0xa590('0x1f')]){throw new db[(_0xa590('0x26'))]['ValidationError'](_0xa590('0x20'));}if(!_0x570b51[_0xa590('0x21')]||!_0x570b51[_0xa590('0x22')]||!_0x570b51[_0xa590('0x23')]||!_0x570b51[_0xa590('0x24')]||!_0x570b51[_0xa590('0x25')]){throw new db[(_0xa590('0x26'))]['ValidationError'](_0xa590('0x27'));}if(!_0x201863['fileText']){throw new Error(_0xa590('0x28'));}if(_0x570b51[_0xa590('0x22')]===_0x5bc467['id']){return _0x5bc467;}else{return db[_0xa590('0x29')][_0xa590('0x2a')]({'where':{'id':_settings[_0xa590('0x22')]}});}})[_0xa590('0xe')](function(_0x4382df){if(!_0x4382df){throw new db[(_0xa590('0x26'))][(_0xa590('0x2d'))](_0xa590('0x38'));}if(!_0x4382df[_0xa590('0x2b')]||!_0x4382df['data2']){throw new db[(_0xa590('0x26'))][(_0xa590('0x2d'))](_0xa590('0x39'));}_0x252e2b=_0x4382df;logger[_0xa590('0xa')](util[_0xa590('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x201863['id']));return sentiment(_0x252e2b['data1'],_0x252e2b[_0xa590('0x2c')],_0x570b51[_0xa590('0x23')],_0x201863[_0xa590('0x13')],_0x570b51[_0xa590('0x24')]);})['then'](function(_0x732e4f){logger['info'](util[_0xa590('0xf')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x201863['id']));return _0x201863[_0xa590('0x1d')]({'sentiment':_0x732e4f['Sentiment'],'sPositive':_0x732e4f[_0xa590('0x31')]['Positive'],'sNegative':_0x732e4f['SentimentScore'][_0xa590('0x32')],'sMixed':_0x732e4f[_0xa590('0x31')][_0xa590('0x33')],'sNeutral':_0x732e4f[_0xa590('0x31')][_0xa590('0x3a')],'transcribeStatus':_0xa590('0x14')});})['then'](function(){logger['info'](util[_0xa590('0xf')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x201863['id']));_0xb67661();});}})[_0xa590('0x3b')](function(_0x181943){if(_0x181943){if(!_0x181943[_0xa590('0x3c')]||_0x181943[_0xa590('0x3c')]!==_0xa590('0x3d')){logger['error'](util['format'](_0xa590('0x3e'),_0x201863['id']),util[_0xa590('0x3f')](_0x181943,{'showHidden':![],'depth':null}));}}_0xb67661();});});}function checkTranscribe(){var _0x143023;var _0x56e67a;var _0x4745fe;return db['VoiceRecording'][_0xa590('0x40')]({'where':{'transcribeStatus':_0xa590('0x41')}})[_0xa590('0xe')](function(_0x240168){if(!_0x240168||!_0x240168['length']){throw new db[(_0xa590('0x26'))][(_0xa590('0x2d'))]('No\x20transcribe\x20job\x20to\x20check');}_0x143023=_0x240168;return db['Setting'][_0xa590('0x2a')]({'where':{'id':0x1}});})[_0xa590('0xe')](function(_0x6b25a9){if(!_0x6b25a9){throw new db[(_0xa590('0x26'))]['ValidationError'](_0xa590('0x42'));}_0x56e67a=_0x6b25a9;if(!_0x56e67a['transcribe']||!_0x56e67a[_0xa590('0x43')]||!_0x56e67a[_0xa590('0xd')]||!_0x56e67a[_0xa590('0x24')]||!_0x56e67a['bucket']){throw new db[(_0xa590('0x26'))][(_0xa590('0x2d'))](_0xa590('0x44'));}return db[_0xa590('0x29')][_0xa590('0x2a')]({'where':{'id':_0x56e67a[_0xa590('0x43')]}});})[_0xa590('0xe')](function(_0xf3f60e){if(!_0xf3f60e){throw new db[(_0xa590('0x26'))]['ValidationError'](_0xa590('0x38'));}if(!_0xf3f60e[_0xa590('0x2b')]||!_0xf3f60e[_0xa590('0x2c')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x4745fe=_0xf3f60e;var _0x5b92da=[];_0x143023[_0xa590('0x45')](function(_0x2beda3){_0x5b92da[_0xa590('0x46')](checkTranscribeJob(_0x2beda3,_0x56e67a,_0x4745fe));});return BPromise[_0xa590('0x47')](_0x5b92da);})['catch'](function(_0x49e13d){if(_0x49e13d){if(!_0x49e13d[_0xa590('0x3c')]||_0x49e13d[_0xa590('0x3c')]!==_0xa590('0x3d')){logger['error'](util[_0xa590('0x3f')](_0x49e13d,{'showHidden':![],'depth':null}));}}});}exports[_0xa590('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xfc03=['error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','start','lodash','request-promise','util','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Sentiment','SentimentScore','Positive','Negative','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Mixed','Neutral','catch','name','SequelizeValidationError'];(function(_0x4148e0,_0x1e9ceb){var _0x26af68=function(_0x13586f){while(--_0x13586f){_0x4148e0['push'](_0x4148e0['shift']());}};_0x26af68(++_0x1e9ceb);}(_0xfc03,0x16f));var _0x3fc0=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xfc03[_0x26462c];return _0x509a42;};var _=require(_0x3fc0('0x0'));var AWS=require('aws-sdk');var rp=require(_0x3fc0('0x1'));var util=require(_0x3fc0('0x2'));var BPromise=require('bluebird');var db=require(_0x3fc0('0x3'))['db'];var logger=require('../../config/logger')(_0x3fc0('0x4'));function getTranscriptionJob(_0x1eeb62,_0x390f7e,_0x29d814,_0x92a96c){return new Promise(function(_0x389bfb,_0x2b4ef6){var _0xeeb912=new AWS['TranscribeService']({'accessKeyId':_0x390f7e,'secretAccessKey':_0x1eeb62,'region':_0x29d814});_0xeeb912[_0x3fc0('0x5')]({'TranscriptionJobName':_0x92a96c},function(_0x5f52b5,_0x1369ac){if(_0x5f52b5){return _0x2b4ef6(_0x5f52b5);}else{return _0x389bfb(_0x1369ac);}});});}function sentiment(_0x31153a,_0x220a08,_0x392999,_0x5ef417,_0x1ee428){return new Promise(function(_0x929f8f,_0xe9d431){var _0x43faa8=new AWS[(_0x3fc0('0x6'))]({'accessKeyId':_0x220a08,'secretAccessKey':_0x31153a,'region':_0x392999});_0x43faa8['detectSentiment']({'Text':_0x5ef417,'LanguageCode':_0x1ee428[_0x3fc0('0x7')](0x0,0x2)},function(_0x2a7cfa,_0x1ecb57){if(_0x2a7cfa){return _0xe9d431(_0x2a7cfa);}else{return _0x929f8f(_0x1ecb57);}});});}function checkTranscribeJob(_0x5e75e8,_0x1011b7,_0x582e22){var _0x3a4cc0;return new BPromise(function(_0x2ffc6f,_0x5a006b){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')](_0x3fc0('0xa'),_0x5e75e8['id'],_0x5e75e8['transcribeName']));return getTranscriptionJob(_0x582e22[_0x3fc0('0xb')],_0x582e22[_0x3fc0('0xc')],_0x1011b7[_0x3fc0('0xd')],_0x5e75e8[_0x3fc0('0xe')])['then'](function(_0x277dbf){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x5e75e8['id'],_0x5e75e8[_0x3fc0('0xe')],_0x277dbf['TranscriptionJob'][_0x3fc0('0xf')]));if(!_0x5e75e8[_0x3fc0('0x10')]){switch(_0x277dbf['TranscriptionJob'][_0x3fc0('0xf')]){case _0x3fc0('0x11'):var _0x1c33c8={'transcribeStatus':_0x277dbf[_0x3fc0('0x12')][_0x3fc0('0xf')],'fileUri':_0x277dbf[_0x3fc0('0x12')][_0x3fc0('0x13')][_0x3fc0('0x14')]};logger[_0x3fc0('0x8')](util['format'](_0x3fc0('0x15'),_0x5e75e8['id']));return rp({'uri':_0x277dbf[_0x3fc0('0x12')][_0x3fc0('0x13')][_0x3fc0('0x14')],'json':!![]})[_0x3fc0('0x16')](function(_0x448293){logger['info'](util[_0x3fc0('0x9')](_0x3fc0('0x17'),_0x5e75e8['id']));if(_0x448293&&_0x448293[_0x3fc0('0x18')]&&_0x448293[_0x3fc0('0x18')][_0x3fc0('0x19')]&&_0x448293[_0x3fc0('0x18')][_0x3fc0('0x19')][_0x3fc0('0x1a')]){_0x1c33c8[_0x3fc0('0x10')]='';for(var _0x35a3e2=0x0;_0x35a3e2<_0x448293[_0x3fc0('0x18')][_0x3fc0('0x19')][_0x3fc0('0x1a')];_0x35a3e2++){_0x1c33c8[_0x3fc0('0x10')]+=_0x448293[_0x3fc0('0x18')][_0x3fc0('0x19')][_0x35a3e2]['transcript']+'';}}return _0x5e75e8[_0x3fc0('0x1b')](_0x1c33c8);})[_0x3fc0('0x16')](function(){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5e75e8['id']));if(!_0x5e75e8[_0x3fc0('0x1c')]){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x1f'));}if(!_0x1011b7['sentiment']||!_0x1011b7[_0x3fc0('0x20')]||!_0x1011b7[_0x3fc0('0x21')]||!_0x1011b7[_0x3fc0('0x22')]||!_0x1011b7[_0x3fc0('0x23')]){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1c33c8[_0x3fc0('0x10')]){throw new Error(_0x3fc0('0x24'));}if(_0x1011b7[_0x3fc0('0x20')]===_0x582e22['id']){return _0x582e22;}else{return db[_0x3fc0('0x25')][_0x3fc0('0x26')]({'where':{'id':_settings[_0x3fc0('0x20')]}});}})[_0x3fc0('0x16')](function(_0x164a96){if(!_0x164a96){throw new db['Sequelize']['ValidationError'](_0x3fc0('0x27'));}if(!_0x164a96['data1']||!_0x164a96[_0x3fc0('0xc')]){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x28'));}_0x3a4cc0=_0x164a96;logger[_0x3fc0('0x8')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5e75e8['id']));return sentiment(_0x3a4cc0[_0x3fc0('0xb')],_0x3a4cc0[_0x3fc0('0xc')],_0x1011b7[_0x3fc0('0x21')],_0x1c33c8[_0x3fc0('0x10')],_0x1011b7[_0x3fc0('0x22')]);})['then'](function(_0xe1279a){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5e75e8['id']));return _0x5e75e8[_0x3fc0('0x1b')]({'sentiment':_0xe1279a[_0x3fc0('0x29')],'sPositive':_0xe1279a[_0x3fc0('0x2a')][_0x3fc0('0x2b')],'sNegative':_0xe1279a['SentimentScore'][_0x3fc0('0x2c')],'sMixed':_0xe1279a[_0x3fc0('0x2a')]['Mixed'],'sNeutral':_0xe1279a[_0x3fc0('0x2a')]['Neutral']});})[_0x3fc0('0x16')](function(){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')](_0x3fc0('0x2d'),_0x5e75e8['id']));_0x2ffc6f();});case _0x3fc0('0x2e'):return _0x5e75e8[_0x3fc0('0x1b')]({'transcribeStatus':_0x3fc0('0x2e'),'failureReason':_0x277dbf[_0x3fc0('0x12')][_0x3fc0('0x2f')]})[_0x3fc0('0x16')](function(){logger[_0x3fc0('0x8')](util['format'](_0x3fc0('0x2d'),_0x5e75e8['id']));_0x2ffc6f();});default:logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')](_0x3fc0('0x30'),_0x5e75e8['id']));break;}}else{return BPromise[_0x3fc0('0x31')]()[_0x3fc0('0x16')](function(){if(!_0x5e75e8['tempSentiment']){throw new db['Sequelize'][(_0x3fc0('0x1e'))](_0x3fc0('0x1f'));}if(!_0x1011b7[_0x3fc0('0x32')]||!_0x1011b7[_0x3fc0('0x20')]||!_0x1011b7[_0x3fc0('0x21')]||!_0x1011b7['language']||!_0x1011b7['bucket']){throw new db['Sequelize'][(_0x3fc0('0x1e'))](_0x3fc0('0x33'));}if(!_0x5e75e8[_0x3fc0('0x10')]){throw new Error('Transcript\x20not\x20available');}if(_0x1011b7['sentimentAccountId']===_0x582e22['id']){return _0x582e22;}else{return db[_0x3fc0('0x25')][_0x3fc0('0x26')]({'where':{'id':_settings[_0x3fc0('0x20')]}});}})[_0x3fc0('0x16')](function(_0x494c66){if(!_0x494c66){throw new db['Sequelize'][(_0x3fc0('0x1e'))](_0x3fc0('0x27'));}if(!_0x494c66['data1']||!_0x494c66[_0x3fc0('0xc')]){throw new db['Sequelize'][(_0x3fc0('0x1e'))](_0x3fc0('0x28'));}_0x3a4cc0=_0x494c66;logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')](_0x3fc0('0x34'),_0x5e75e8['id']));return sentiment(_0x3a4cc0[_0x3fc0('0xb')],_0x3a4cc0[_0x3fc0('0xc')],_0x1011b7[_0x3fc0('0x21')],_0x5e75e8['fileText'],_0x1011b7[_0x3fc0('0x22')]);})['then'](function(_0xab97ba){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')](_0x3fc0('0x35'),_0x5e75e8['id']));return _0x5e75e8[_0x3fc0('0x1b')]({'sentiment':_0xab97ba['Sentiment'],'sPositive':_0xab97ba[_0x3fc0('0x2a')][_0x3fc0('0x2b')],'sNegative':_0xab97ba[_0x3fc0('0x2a')][_0x3fc0('0x2c')],'sMixed':_0xab97ba['SentimentScore'][_0x3fc0('0x36')],'sNeutral':_0xab97ba['SentimentScore'][_0x3fc0('0x37')],'transcribeStatus':_0x3fc0('0x11')});})[_0x3fc0('0x16')](function(){logger[_0x3fc0('0x8')](util[_0x3fc0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5e75e8['id']));_0x2ffc6f();});}})[_0x3fc0('0x38')](function(_0x398101){if(_0x398101){if(!_0x398101[_0x3fc0('0x39')]||_0x398101['name']!==_0x3fc0('0x3a')){logger[_0x3fc0('0x3b')](util['format'](_0x3fc0('0x3c'),_0x5e75e8['id']),util[_0x3fc0('0x3d')](_0x398101,{'showHidden':![],'depth':null}));}}_0x2ffc6f();});});}function checkTranscribe(){var _0x3b57e1;var _0x51489b;var _0x5e5c73;return db[_0x3fc0('0x3e')][_0x3fc0('0x3f')]({'where':{'transcribeStatus':_0x3fc0('0x40')}})['then'](function(_0x1d6844){if(!_0x1d6844||!_0x1d6844['length']){throw new db[(_0x3fc0('0x1d'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x3b57e1=_0x1d6844;return db['Setting'][_0x3fc0('0x26')]({'where':{'id':0x1}});})[_0x3fc0('0x16')](function(_0x141b4c){if(!_0x141b4c){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x41'));}_0x51489b=_0x141b4c;if(!_0x51489b['transcribe']||!_0x51489b[_0x3fc0('0x42')]||!_0x51489b[_0x3fc0('0xd')]||!_0x51489b['language']||!_0x51489b['bucket']){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x43'));}return db[_0x3fc0('0x25')][_0x3fc0('0x26')]({'where':{'id':_0x51489b[_0x3fc0('0x42')]}});})[_0x3fc0('0x16')](function(_0x2da185){if(!_0x2da185){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x27'));}if(!_0x2da185[_0x3fc0('0xb')]||!_0x2da185['data2']){throw new db[(_0x3fc0('0x1d'))][(_0x3fc0('0x1e'))](_0x3fc0('0x28'));}_0x5e5c73=_0x2da185;var _0x1dfd2c=[];_0x3b57e1[_0x3fc0('0x44')](function(_0x5c6249){_0x1dfd2c[_0x3fc0('0x45')](checkTranscribeJob(_0x5c6249,_0x51489b,_0x5e5c73));});return BPromise['all'](_0x1dfd2c);})[_0x3fc0('0x38')](function(_0xa4864f){if(_0xa4864f){if(!_0xa4864f[_0x3fc0('0x39')]||_0xa4864f[_0x3fc0('0x39')]!=='SequelizeValidationError'){logger[_0x3fc0('0x3b')](util[_0x3fc0('0x3d')](_0xa4864f,{'showHidden':![],'depth':null}));}}});}exports[_0x3fc0('0x46')]=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 2e7d8a7..113a0f0 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 _0x5c1a=['redis','localhost','socket.io-emitter','WhatsappInteraction','hours','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','../logger','schedule'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x5c1a,0x13f));var _0xa5c1=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x5c1a[_0x34df4a];return _0x145c69;};'use strict';var _=require('lodash');var moment=require(_0xa5c1('0x0'));var Redis=require(_0xa5c1('0x1'));var util=require(_0xa5c1('0x2'));var config=require('../../config/environment');var db=require(_0xa5c1('0x3'))['db'];var logger=require(_0xa5c1('0x4'))(_0xa5c1('0x5'));config['redis']=_['defaults'](config[_0xa5c1('0x6')],{'host':_0xa5c1('0x7'),'port':0x18eb});var io=require(_0xa5c1('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x2241f6=[];return db[_0xa5c1('0x9')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xa5c1('0xa'))}}})['then'](function(_0x497bf4){if(_0x497bf4&&_0x497bf4['length']){_0x2241f6=_['map'](_0x497bf4||[],'id');logger[_0xa5c1('0xb')](_0xa5c1('0xc'),_0x2241f6['join']());return db[_0xa5c1('0x9')][_0xa5c1('0xd')]({'closeReason':_0xa5c1('0xe'),'disposition':_0xa5c1('0xf'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2241f6}});}})[_0xa5c1('0x10')](function(){if(_0x2241f6&&_0x2241f6[_0xa5c1('0x11')]){logger[_0xa5c1('0xb')](_0xa5c1('0x12'),_0x2241f6[_0xa5c1('0x13')]());for(var _0x503c9b=0x0;_0x503c9b<_0x2241f6['length'];_0x503c9b++){io['emit'](_0xa5c1('0x14'),{'id':_0x2241f6[_0x503c9b],'closed':!![]});}}})['catch'](function(_0x16e56e){logger[_0xa5c1('0x15')](_0xa5c1('0x16'),_0x16e56e?util[_0xa5c1('0x17')](_0x16e56e,{'showHidden':![],'depth':null}):'');});}exports[_0xa5c1('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3746=['redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','info','join','update','timeout','format','whatsappInteraction:update','error','inspect','start','lodash','moment','util','../../mysqldb','../logger','defaults'];(function(_0x3eede2,_0x6327ac){var _0xb9be5e=function(_0x1897e8){while(--_0x1897e8){_0x3eede2['push'](_0x3eede2['shift']());}};_0xb9be5e(++_0x6327ac);}(_0x3746,0xa9));var _0x6374=function(_0x9ed1ac,_0x47627b){_0x9ed1ac=_0x9ed1ac-0x0;var _0x45dd16=_0x3746[_0x9ed1ac];return _0x45dd16;};'use strict';var _=require(_0x6374('0x0'));var moment=require(_0x6374('0x1'));var Redis=require('ioredis');var util=require(_0x6374('0x2'));var config=require('../../config/environment');var db=require(_0x6374('0x3'))['db'];var logger=require(_0x6374('0x4'))('schedule');config['redis']=_[_0x6374('0x5')](config[_0x6374('0x6')],{'host':_0x6374('0x7'),'port':0x18eb});var io=require(_0x6374('0x8'))(new Redis(config[_0x6374('0x6')]));function closeInteractions(){var _0x46841a=[];return db[_0x6374('0x9')][_0x6374('0xa')]({'raw':!![],'attributes':['id',_0x6374('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6374('0xc')](0x18,'hours')}}})[_0x6374('0xd')](function(_0x5bd695){if(_0x5bd695&&_0x5bd695[_0x6374('0xe')]){_0x46841a=_[_0x6374('0xf')](_0x5bd695||[],'id');logger[_0x6374('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x46841a[_0x6374('0x11')]());return db[_0x6374('0x9')][_0x6374('0x12')]({'closeReason':'system','disposition':_0x6374('0x13'),'closed':!![],'closedAt':moment()[_0x6374('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x46841a}});}})[_0x6374('0xd')](function(){if(_0x46841a&&_0x46841a[_0x6374('0xe')]){logger[_0x6374('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x46841a[_0x6374('0x11')]());for(var _0x397b4c=0x0;_0x397b4c<_0x46841a[_0x6374('0xe')];_0x397b4c++){io['emit'](_0x6374('0x15'),{'id':_0x46841a[_0x397b4c],'closed':!![]});}}})['catch'](function(_0x485331){logger[_0x6374('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x485331?util[_0x6374('0x17')](_0x485331,{'showHidden':![],'depth':null}):'');});}exports[_0x6374('0x18')]=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 9a71d70..4b0679c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1746=['log','finished\x20populating','CmHopper','hopper1','contacts2','hopper2','catch','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','CmContact','destroy','bulkCreate','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1746,0x7e));var _0x6174=function(_0x1244f7,_0x394a71){_0x1244f7=_0x1244f7-0x0;var _0x22ad8b=_0x1746[_0x1244f7];return _0x22ad8b;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6174('0x0')+i,'lastName':_0x6174('0x1')+i,'phone':0xf879fb460+i,'email':_0x6174('0x2')+i+_0x6174('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6174('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6174('0x4')](),'updatedAt':Date[_0x6174('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6174('0x2')+i+_0x6174('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6174('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x6174('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6174('0x4')](),'updatedAt':Date[_0x6174('0x4')]()});}db[_0x6174('0x6')][_0x6174('0x7')]({'where':{}})['then'](function(){return db[_0x6174('0x6')][_0x6174('0x8')](contacts);})[_0x6174('0x9')](function(){console[_0x6174('0xa')](_0x6174('0xb'),'contacts1');return db[_0x6174('0xc')]['destroy']({'where':{}});})[_0x6174('0x9')](function(){return db['CmHopper'][_0x6174('0x8')](hopper);})[_0x6174('0x9')](function(){console[_0x6174('0xa')](_0x6174('0xb'),_0x6174('0xd'));return db[_0x6174('0x6')][_0x6174('0x8')](contacts2);})['then'](function(){console[_0x6174('0xa')](_0x6174('0xb'),_0x6174('0xe'));return db[_0x6174('0xc')]['bulkCreate'](hopper2);})['then'](function(){console['log'](_0x6174('0xb'),_0x6174('0xf'));})[_0x6174('0x10')](function(_0x5d6a43){console[_0x6174('0xa')](_0x5d6a43);}); \ No newline at end of file +var _0x3c7f=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','log','finished\x20populating','contacts1','destroy','CmHopper','contacts2','hopper2','../mysqldb','push'];(function(_0x20eedb,_0x4c5031){var _0x276144=function(_0x1f7735){while(--_0x1f7735){_0x20eedb['push'](_0x20eedb['shift']());}};_0x276144(++_0x4c5031);}(_0x3c7f,0x64));var _0xf3c7=function(_0x4d71d0,_0x34f52f){_0x4d71d0=_0x4d71d0-0x0;var _0x40a5b2=_0x3c7f[_0x4d71d0];return _0x40a5b2;};'use strict';var util=require('util');var db=require(_0xf3c7('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf3c7('0x1')]({'id':i,'firstName':_0xf3c7('0x2')+i,'lastName':_0xf3c7('0x3')+i,'phone':0xf879fb460+i,'email':_0xf3c7('0x4')+i+_0xf3c7('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf3c7('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf3c7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf3c7('0x6')](),'updatedAt':Date[_0xf3c7('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf3c7('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf3c7('0x4')+i+_0xf3c7('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf3c7('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf3c7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf3c7('0x6')](),'updatedAt':Date['now']()});}db[_0xf3c7('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xf3c7('0x7')][_0xf3c7('0x8')](contacts);})[_0xf3c7('0x9')](function(){console[_0xf3c7('0xa')](_0xf3c7('0xb'),_0xf3c7('0xc'));return db['CmHopper'][_0xf3c7('0xd')]({'where':{}});})[_0xf3c7('0x9')](function(){return db[_0xf3c7('0xe')][_0xf3c7('0x8')](hopper);})[_0xf3c7('0x9')](function(){console['log'](_0xf3c7('0xb'),'hopper1');return db[_0xf3c7('0x7')][_0xf3c7('0x8')](contacts2);})[_0xf3c7('0x9')](function(){console[_0xf3c7('0xa')]('finished\x20populating',_0xf3c7('0xf'));return db[_0xf3c7('0xe')][_0xf3c7('0x8')](hopper2);})[_0xf3c7('0x9')](function(){console[_0xf3c7('0xa')](_0xf3c7('0xb'),_0xf3c7('0x10'));})['catch'](function(_0x38ae5c){console['log'](_0x38ae5c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8959b77..152910b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeda1=['wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','User','then','log','add\x20user','catch','util','format','%s%s','agent','%s%s@xcally.com','password','friend','udp'];(function(_0x4fb966,_0x30ec3e){var _0x3f5545=function(_0x19ce50){while(--_0x19ce50){_0x4fb966['push'](_0x4fb966['shift']());}};_0x3f5545(++_0x30ec3e);}(_0xeda1,0x12a));var _0x1eda=function(_0x3e9030,_0x16c384){_0x3e9030=_0x3e9030-0x0;var _0x526b49=_0xeda1[_0x3e9030];return _0x526b49;};'use strict';var util=require(_0x1eda('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x1eda('0x1')](_0x1eda('0x2'),_0x1eda('0x3'),i),'fullname':util[_0x1eda('0x1')](_0x1eda('0x2'),_0x1eda('0x3'),i),'email':util[_0x1eda('0x1')](_0x1eda('0x4'),'agent',i),'role':_0x1eda('0x3'),'password':_0x1eda('0x5'),'internal':0xfa0+i,'type':_0x1eda('0x6'),'transport':[_0x1eda('0x7'),'ws',_0x1eda('0x8')],'disallow':['all'],'allow':[_0x1eda('0x9')],'defaultuser':util[_0x1eda('0x1')]('%s%s',_0x1eda('0x3'),i),'encryption':_0x1eda('0xa'),'avpf':'yes','force_avp':_0x1eda('0xa'),'icesupport':_0x1eda('0xa'),'dtlsenable':_0x1eda('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x1eda('0xb'),'dtlssetup':_0x1eda('0xc'),'callerid':util[_0x1eda('0x1')]('\x22%s\x22\x20<%s>',util[_0x1eda('0x1')](_0x1eda('0x2'),_0x1eda('0x3'),i),0xfa0+i)});}db[_0x1eda('0xd')]['bulkCreate'](users)[_0x1eda('0xe')](function(){console[_0x1eda('0xf')](_0x1eda('0x10'));})[_0x1eda('0x11')](function(_0xfe23ee){console[_0x1eda('0xf')](_0xfe23ee);}); \ No newline at end of file +var _0xb74b=['friend','udp','wss','ulaw','yes','actpass','User','log','add\x20user','catch','util','%s%s','agent','format','password'];(function(_0x402aac,_0x4739f4){var _0x51b8eb=function(_0x25ca2f){while(--_0x25ca2f){_0x402aac['push'](_0x402aac['shift']());}};_0x51b8eb(++_0x4739f4);}(_0xb74b,0xfa));var _0xbb74=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xb74b[_0x33080e];return _0x407395;};'use strict';var util=require(_0xbb74('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xbb74('0x1'),_0xbb74('0x2'),i),'fullname':util[_0xbb74('0x3')](_0xbb74('0x1'),'agent',i),'email':util[_0xbb74('0x3')]('%s%s@xcally.com',_0xbb74('0x2'),i),'role':_0xbb74('0x2'),'password':_0xbb74('0x4'),'internal':0xfa0+i,'type':_0xbb74('0x5'),'transport':[_0xbb74('0x6'),'ws',_0xbb74('0x7')],'disallow':['all'],'allow':[_0xbb74('0x8')],'defaultuser':util['format']('%s%s',_0xbb74('0x2'),i),'encryption':_0xbb74('0x9'),'avpf':_0xbb74('0x9'),'force_avp':_0xbb74('0x9'),'icesupport':_0xbb74('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xbb74('0xa'),'callerid':util[_0xbb74('0x3')]('\x22%s\x22\x20<%s>',util[_0xbb74('0x3')]('%s%s',_0xbb74('0x2'),i),0xfa0+i)});}db[_0xbb74('0xb')]['bulkCreate'](users)['then'](function(){console[_0xbb74('0xc')](_0xbb74('0xd'));})[_0xbb74('0xe')](function(_0x50e939){console[_0xbb74('0xc')](_0x50e939);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 68a9d7d..97978ea 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fea=['getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','voice','fax','sms','openchannel','telephone:%s','campaign:%s:%s','user_has_chat_interactions:remove','leave','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','VoiceQueue','ChatQueue','push','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','voice:inbound','ChatQueues','SmsQueues','MailQueue','OpenchannelQueues','WhatsappQueues','WhatsappQueue','IvrCampaigns'];(function(_0x1fb370,_0xb22186){var _0x14dd39=function(_0x5888c1){while(--_0x5888c1){_0x1fb370['push'](_0x1fb370['shift']());}};_0x14dd39(++_0xb22186);}(_0x7fea,0x149));var _0xa7fe=function(_0x22b18f,_0x265763){_0x22b18f=_0x22b18f-0x0;var _0x1d6b66=_0x7fea[_0x22b18f];return _0x1d6b66;};'use strict';var _=require('lodash');var util=require(_0xa7fe('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0xa7fe('0x1'));var queryQueues={'attributes':['id',_0xa7fe('0x2')],'include':[{'as':_0xa7fe('0x3'),'model':db[_0xa7fe('0x4')],'attributes':['id',_0xa7fe('0x2'),_0xa7fe('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa7fe('0x2')],'where':{'role':_0xa7fe('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa7fe('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0xa7fe('0x2')],'where':{'role':_0xa7fe('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa7fe('0x2'),_0xa7fe('0x8')],'where':{'type':_0xa7fe('0x9')}};function getAssociatedResources(_0x59f799,_0x581469,_0x1db10e){return db[_0xa7fe('0xa')][_0xa7fe('0xb')]({'where':{'name':_0x59f799,'userProfileId':_0x581469},'raw':!![]})[_0xa7fe('0xc')](function(_0x565c34){if(_0x565c34){if(_0x565c34[_0xa7fe('0xd')]){switch(_0x59f799){case _0xa7fe('0xe'):case'ChatQueues':case _0xa7fe('0xf'):case'SmsQueues':case _0xa7fe('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x1db10e][_0xa7fe('0x11')](queryQueues);case _0xa7fe('0x12'):return db[_0x1db10e][_0xa7fe('0x11')](queryTelephones);case _0xa7fe('0x13'):return db[_0x1db10e][_0xa7fe('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x1db10e]['findAll'](queryCampaigns);}}else{return db[_0xa7fe('0x14')][_0xa7fe('0x11')]({'attributes':[_0xa7fe('0x15')],'where':{'sectionId':_0x565c34['id']},'raw':!![]})[_0xa7fe('0xc')](function(_0x34490e){if(_0x34490e){var _0x5df0e3={'where':{'id':_[_0xa7fe('0x16')](_0x34490e,_0xa7fe('0x15'))},'raw':!![]};switch(_0x1db10e){case _0xa7fe('0x4'):_0x5df0e3[_0xa7fe('0x17')][_0xa7fe('0x5')]='telephone';break;case _0xa7fe('0x18'):_0x5df0e3[_0xa7fe('0x17')][_0xa7fe('0x8')]=_0xa7fe('0x9');break;}return db[_0x1db10e][_0xa7fe('0x11')](_0x5df0e3);}else{return[];}});}}else{return[];}})[_0xa7fe('0xc')](function(_0x4f1951){return _0x4f1951;});}function joinOrLeaveQueues(_0x5e769d,_0x5409fe,_0x1a4ddb,_0x3719b1){_0x5e769d[_0x5409fe](util[_0xa7fe('0x19')](_0xa7fe('0x1a'),_0x1a4ddb,_0x3719b1[_0xa7fe('0x2')]));if(_0x3719b1[_0xa7fe('0x3')]){for(var _0x189ada=0x0;_0x189ada<_0x3719b1['Agents'][_0xa7fe('0x1b')];_0x189ada+=0x1){_0x5e769d[_0x5409fe](util[_0xa7fe('0x19')](_0xa7fe('0x1c'),_0x3719b1[_0xa7fe('0x3')][_0x189ada][_0xa7fe('0x2')]));}}}function joinOrLeave(_0x300a91,_0x2bc7fd,_0x1043bf){var _0x4ac7e0;if(_0x300a91[_0xa7fe('0x1d')]['query']['id']){db['User'][_0xa7fe('0x1e')]({'attributes':['id',_0xa7fe('0x2'),_0xa7fe('0x5'),_0xa7fe('0x1f')],'where':{'id':_0x300a91[_0xa7fe('0x1d')]['query']['id']},'include':[{'model':db[_0xa7fe('0x20')],'as':_0xa7fe('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7fe('0x22')],'as':_0xa7fe('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7fe('0x24')],'as':_0xa7fe('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7fe('0x26')],'as':_0xa7fe('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7fe('0x28')],'as':_0xa7fe('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7fe('0x2a')],'as':_0xa7fe('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xa7fe('0xc')](function(_0x42ca9d){if(_0x42ca9d){_0x4ac7e0=_0x42ca9d;_0x300a91[_0x2bc7fd](util[_0xa7fe('0x19')](_0xa7fe('0x1c'),_0x42ca9d[_0xa7fe('0x2')]));var _0xfeb346=[];switch(_0x42ca9d[_0xa7fe('0x5')]){case _0xa7fe('0x2c'):_0x300a91[_0x2bc7fd]('voice:inbound');_0x300a91[_0x2bc7fd](_0xa7fe('0x2d'));if(queryQueues[_0xa7fe('0x2e')]('include')){delete queryQueues['include'];}_0xfeb346['push'](db[_0xa7fe('0x2f')][_0xa7fe('0x11')](queryQueues));_0xfeb346['push'](db[_0xa7fe('0x30')][_0xa7fe('0x11')](queryQueues));_0xfeb346[_0xa7fe('0x31')](db[_0xa7fe('0x32')][_0xa7fe('0x11')](queryQueues));_0xfeb346[_0xa7fe('0x31')](db[_0xa7fe('0x33')][_0xa7fe('0x11')](queryQueues));_0xfeb346[_0xa7fe('0x31')](db['MailQueue'][_0xa7fe('0x11')](queryQueues));_0xfeb346['push'](db[_0xa7fe('0x34')][_0xa7fe('0x11')](queryQueues));_0xfeb346[_0xa7fe('0x31')](db['WhatsappQueue'][_0xa7fe('0x11')](queryQueues));_0xfeb346[_0xa7fe('0x31')](db[_0xa7fe('0x4')][_0xa7fe('0x11')](queryTelephones));_0xfeb346['push'](db[_0xa7fe('0x35')][_0xa7fe('0x11')](queryTrunks));_0xfeb346['push'](db[_0xa7fe('0x18')][_0xa7fe('0x11')](queryCampaigns));_0xfeb346[_0xa7fe('0x31')](db[_0xa7fe('0x4')][_0xa7fe('0x11')](queryAgents));break;case _0xa7fe('0x36'):_0x300a91[_0x2bc7fd](_0xa7fe('0x37'));_0x300a91[_0x2bc7fd](_0xa7fe('0x2d'));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0xe'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x2f')));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x38'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x30')));_0xfeb346['push'](getAssociatedResources('FaxQueues',_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x32')));_0xfeb346['push'](getAssociatedResources(_0xa7fe('0x39'),_0x42ca9d[_0xa7fe('0x1f')],'SmsQueue'));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x10'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x3a')));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x3b'),_0x42ca9d[_0xa7fe('0x1f')],'OpenchannelQueue'));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x3c'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x3d')));_0xfeb346['push'](getAssociatedResources(_0xa7fe('0x12'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x4')));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x13'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x35')));_0xfeb346[_0xa7fe('0x31')](getAssociatedResources(_0xa7fe('0x3e'),_0x42ca9d[_0xa7fe('0x1f')],_0xa7fe('0x18')));_0xfeb346[_0xa7fe('0x31')](db[_0xa7fe('0x4')][_0xa7fe('0x11')](queryAgents));break;case'agent':_0x300a91[_0x2bc7fd]('voice:inbound');_0x300a91[_0x2bc7fd]('voice:outbound');_0xfeb346['push'](_0x42ca9d[_0xa7fe('0x3f')]({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346[_0xa7fe('0x31')](_0x42ca9d[_0xa7fe('0x40')]({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346[_0xa7fe('0x31')](_0x42ca9d[_0xa7fe('0x41')]({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346['push'](_0x42ca9d[_0xa7fe('0x42')]({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346[_0xa7fe('0x31')](_0x42ca9d['getMailQueues']({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346[_0xa7fe('0x31')](_0x42ca9d['getOpenchannelQueues']({'attributes':['id',_0xa7fe('0x2')]}));_0xfeb346[_0xa7fe('0x31')](_0x42ca9d[_0xa7fe('0x43')]({'attributes':['id',_0xa7fe('0x2')]}));break;}return BPromise['all'](_0xfeb346);}})[_0xa7fe('0xc')](function(_0x1d43b0){if(_0x1d43b0&&_0x1d43b0['length']){for(var _0x3cea4c=0x0;_0x3cea4c<_0x1d43b0['length'];_0x3cea4c+=0x1){for(var _0x3f20cc=0x0;_0x3f20cc<_0x1d43b0[_0x3cea4c][_0xa7fe('0x1b')];_0x3f20cc+=0x1){switch(_0x3cea4c){case 0x0:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,_0xa7fe('0x44'),_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x1:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,'chat',_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x2:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,_0xa7fe('0x45'),_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x3:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,_0xa7fe('0x46'),_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x4:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,'mail',_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x5:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,_0xa7fe('0x47'),_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x6:joinOrLeaveQueues(_0x300a91,_0x2bc7fd,'whatsapp',_0x1d43b0[_0x3cea4c][_0x3f20cc]);break;case 0x7:if(_0x4ac7e0[_0xa7fe('0x5')]!=='agent')_0x300a91[_0x2bc7fd](util[_0xa7fe('0x19')](_0xa7fe('0x48'),_0x1d43b0[_0x3cea4c][_0x3f20cc][_0xa7fe('0x2')]));break;case 0x8:if(_0x4ac7e0[_0xa7fe('0x5')]!==_0xa7fe('0x7'))_0x300a91[_0x2bc7fd](util['format']('trunk:%s',_0x1d43b0[_0x3cea4c][_0x3f20cc][_0xa7fe('0x2')]));break;case 0x9:if(_0x4ac7e0[_0xa7fe('0x5')]!==_0xa7fe('0x7'))_0x300a91[_0x2bc7fd](util[_0xa7fe('0x19')](_0xa7fe('0x49'),_0x1d43b0[_0x3cea4c][_0x3f20cc]['type'],_0x1d43b0[_0x3cea4c][_0x3f20cc]['name']));break;case 0xa:_0x300a91[_0x2bc7fd](util[_0xa7fe('0x19')](_0xa7fe('0x1c'),_0x1d43b0[_0x3cea4c][_0x3f20cc]['name']));break;}}}}})[_0xa7fe('0xc')](function(){if(_0x2bc7fd==='leave'){var _0x37d9c3=_[_0xa7fe('0x16')](_0x4ac7e0[_0xa7fe('0x21')],'id');return _0x4ac7e0['removeChatInteractions'](_0x37d9c3)['then'](function(){for(var _0xf74ba8=0x0;_0xf74ba8<_0x37d9c3['length'];_0xf74ba8+=0x1){_0x1043bf['emit'](_0xa7fe('0x4a'),{'ChatInteractionId':Number(_0x37d9c3[_0xf74ba8]),'UserId':Number(_0x4ac7e0['id'])});}});}})[_0xa7fe('0xc')](function(){if(_0x2bc7fd===_0xa7fe('0x4b')){var _0x20a127=_[_0xa7fe('0x16')](_0x4ac7e0['MailInteractions'],'id');return _0x4ac7e0[_0xa7fe('0x4c')](_0x20a127)[_0xa7fe('0xc')](function(){for(var _0x418e7f=0x0;_0x418e7f<_0x20a127[_0xa7fe('0x1b')];_0x418e7f+=0x1){_0x1043bf['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x20a127[_0x418e7f]),'UserId':Number(_0x4ac7e0['id'])});}});}})['then'](function(){if(_0x2bc7fd===_0xa7fe('0x4b')){var _0x51c00e=_[_0xa7fe('0x16')](_0x4ac7e0[_0xa7fe('0x25')],'id');return _0x4ac7e0[_0xa7fe('0x4d')](_0x51c00e)[_0xa7fe('0xc')](function(){for(var _0x30cf2a=0x0;_0x30cf2a<_0x51c00e[_0xa7fe('0x1b')];_0x30cf2a+=0x1){_0x1043bf['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x51c00e[_0x30cf2a]),'UserId':Number(_0x4ac7e0['id'])});}});}})[_0xa7fe('0xc')](function(){if(_0x2bc7fd===_0xa7fe('0x4b')){var _0x110da6=_['map'](_0x4ac7e0[_0xa7fe('0x27')],'id');return _0x4ac7e0[_0xa7fe('0x4e')](_0x110da6)[_0xa7fe('0xc')](function(){for(var _0x5525c4=0x0;_0x5525c4<_0x110da6[_0xa7fe('0x1b')];_0x5525c4+=0x1){_0x1043bf[_0xa7fe('0x4f')](_0xa7fe('0x50'),{'SmsInteractionId':Number(_0x110da6[_0x5525c4]),'UserId':Number(_0x4ac7e0['id'])});}});}})[_0xa7fe('0xc')](function(){if(_0x2bc7fd===_0xa7fe('0x4b')){var _0x3ed6e9=_[_0xa7fe('0x16')](_0x4ac7e0['OpenchannelInteractions'],'id');return _0x4ac7e0[_0xa7fe('0x51')](_0x3ed6e9)['then'](function(){for(var _0x216c56=0x0;_0x216c56<_0x3ed6e9[_0xa7fe('0x1b')];_0x216c56+=0x1){_0x1043bf[_0xa7fe('0x4f')](_0xa7fe('0x52'),{'OpenchannelInteractionId':Number(_0x3ed6e9[_0x216c56]),'UserId':Number(_0x4ac7e0['id'])});}});}})[_0xa7fe('0xc')](function(){if(_0x2bc7fd===_0xa7fe('0x4b')){var _0x20aab4=_[_0xa7fe('0x16')](_0x4ac7e0[_0xa7fe('0x2b')],'id');return _0x4ac7e0[_0xa7fe('0x53')](_0x20aab4)[_0xa7fe('0xc')](function(){for(var _0x3830c6=0x0;_0x3830c6<_0x20aab4[_0xa7fe('0x1b')];_0x3830c6+=0x1){_0x1043bf['emit'](_0xa7fe('0x54'),{'WhatsappInteractionId':Number(_0x20aab4[_0x3830c6]),'UserId':Number(_0x4ac7e0['id'])});}});}})[_0xa7fe('0x55')](function(_0x1ff70a){_0x300a91[_0xa7fe('0x56')](_0x1ff70a);});}}function onDisconnect(_0x14efa2,_0x39a947){joinOrLeave(_0x14efa2,_0xa7fe('0x4b'),_0x39a947);}function onConnect(_0x4d624c){joinOrLeave(_0x4d624c,_0xa7fe('0x57'));}exports['default']=function(_0x803bda){_0x803bda['on'](_0xa7fe('0x58'),function(_0x3ed6db){_0x3ed6db[_0xa7fe('0x59')](0x0);_0x3ed6db[_0xa7fe('0x5a')]=_0x3ed6db['request'][_0xa7fe('0x58')][_0xa7fe('0x5b')]+':'+_0x3ed6db['request'][_0xa7fe('0x58')][_0xa7fe('0x5c')];_0x3ed6db['connectedAt']=new Date();_0x3ed6db[_0xa7fe('0x56')]=function(_0x2d7f0f){console[_0xa7fe('0x56')](_0xa7fe('0x5d')+_0x3ed6db[_0xa7fe('0x5e')]['name']+'['+_0x3ed6db[_0xa7fe('0x5a')]+']',_0x2d7f0f);};_0x3ed6db['on'](_0xa7fe('0x5f'),function(){onDisconnect(_0x3ed6db,_0x803bda);_0x3ed6db[_0xa7fe('0x56')](_0xa7fe('0x60'));});onConnect(_0x3ed6db);_0x3ed6db[_0xa7fe('0x56')](_0xa7fe('0x61'));});}; \ No newline at end of file +var _0x55c1=['default','setMaxListeners','address','request','connection','remotePort','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','name','Agents','User','role','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','ivr','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','include','push','ChatQueue','WhatsappQueue','Trunk','user','VoiceQueue','ChatQueues','FaxQueue','MailQueues','OpenchannelQueue','Campaign','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','fax','sms','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','log','join'];(function(_0x4c08f3,_0x2baa77){var _0x48c37b=function(_0xd5cb22){while(--_0xd5cb22){_0x4c08f3['push'](_0x4c08f3['shift']());}};_0x48c37b(++_0x2baa77);}(_0x55c1,0x1e5));var _0x155c=function(_0x35f2d6,_0x1eacc1){_0x35f2d6=_0x35f2d6-0x0;var _0x33a492=_0x55c1[_0x35f2d6];return _0x33a492;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x155c('0x2')],'include':[{'as':_0x155c('0x3'),'model':db[_0x155c('0x4')],'attributes':['id',_0x155c('0x2'),_0x155c('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x155c('0x2')],'where':{'role':_0x155c('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x155c('0x2')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x155c('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x155c('0x2'),_0x155c('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x5ee4c7,_0x53ec99,_0x330e12){return db[_0x155c('0x9')][_0x155c('0xa')]({'where':{'name':_0x5ee4c7,'userProfileId':_0x53ec99},'raw':!![]})[_0x155c('0xb')](function(_0x4f95f0){if(_0x4f95f0){if(_0x4f95f0[_0x155c('0xc')]){switch(_0x5ee4c7){case _0x155c('0xd'):case'ChatQueues':case _0x155c('0xe'):case _0x155c('0xf'):case'MailQueues':case _0x155c('0x10'):case _0x155c('0x11'):return db[_0x330e12]['findAll'](queryQueues);case _0x155c('0x12'):return db[_0x330e12][_0x155c('0x13')](queryTelephones);case _0x155c('0x14'):return db[_0x330e12]['findAll'](queryTrunks);case _0x155c('0x15'):return db[_0x330e12][_0x155c('0x13')](queryCampaigns);}}else{return db[_0x155c('0x16')][_0x155c('0x13')]({'attributes':[_0x155c('0x17')],'where':{'sectionId':_0x4f95f0['id']},'raw':!![]})['then'](function(_0x2997af){if(_0x2997af){var _0x49f59f={'where':{'id':_['map'](_0x2997af,_0x155c('0x17'))},'raw':!![]};switch(_0x330e12){case'User':_0x49f59f[_0x155c('0x18')][_0x155c('0x5')]=_0x155c('0x6');break;case'Campaign':_0x49f59f[_0x155c('0x18')][_0x155c('0x8')]=_0x155c('0x19');break;}return db[_0x330e12][_0x155c('0x13')](_0x49f59f);}else{return[];}});}}else{return[];}})[_0x155c('0xb')](function(_0xb35014){return _0xb35014;});}function joinOrLeaveQueues(_0xa4c0c,_0x286682,_0x105206,_0x137342){_0xa4c0c[_0x286682](util[_0x155c('0x1a')](_0x155c('0x1b'),_0x105206,_0x137342[_0x155c('0x2')]));if(_0x137342[_0x155c('0x3')]){for(var _0x43b032=0x0;_0x43b032<_0x137342[_0x155c('0x3')][_0x155c('0x1c')];_0x43b032+=0x1){_0xa4c0c[_0x286682](util['format'](_0x155c('0x1d'),_0x137342[_0x155c('0x3')][_0x43b032][_0x155c('0x2')]));}}}function joinOrLeave(_0x305ffc,_0x1006b8,_0x254557){var _0x4b6d0d;if(_0x305ffc['handshake'][_0x155c('0x1e')]['id']){db[_0x155c('0x4')][_0x155c('0x1f')]({'attributes':['id',_0x155c('0x2'),_0x155c('0x5'),_0x155c('0x20')],'where':{'id':_0x305ffc[_0x155c('0x21')][_0x155c('0x1e')]['id']},'include':[{'model':db[_0x155c('0x22')],'as':_0x155c('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x155c('0x24')],'as':_0x155c('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x155c('0x26')],'as':_0x155c('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x155c('0x28')],'as':_0x155c('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x155c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x47c89d){if(_0x47c89d){_0x4b6d0d=_0x47c89d;_0x305ffc[_0x1006b8](util[_0x155c('0x1a')](_0x155c('0x1d'),_0x47c89d[_0x155c('0x2')]));var _0x529c9c=[];switch(_0x47c89d[_0x155c('0x5')]){case _0x155c('0x2b'):_0x305ffc[_0x1006b8](_0x155c('0x2c'));_0x305ffc[_0x1006b8]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x155c('0x2d')];}_0x529c9c[_0x155c('0x2e')](db['VoiceQueue'][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x2f')]['findAll'](queryQueues));_0x529c9c[_0x155c('0x2e')](db['FaxQueue'][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db['SmsQueue'][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db['MailQueue'][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db['OpenchannelQueue'][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x30')][_0x155c('0x13')](queryQueues));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x4')][_0x155c('0x13')](queryTelephones));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x31')][_0x155c('0x13')](queryTrunks));_0x529c9c[_0x155c('0x2e')](db['Campaign'][_0x155c('0x13')](queryCampaigns));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x4')]['findAll'](queryAgents));break;case _0x155c('0x32'):_0x305ffc[_0x1006b8](_0x155c('0x2c'));_0x305ffc[_0x1006b8]('voice:outbound');_0x529c9c['push'](getAssociatedResources(_0x155c('0xd'),_0x47c89d[_0x155c('0x20')],_0x155c('0x33')));_0x529c9c['push'](getAssociatedResources(_0x155c('0x34'),_0x47c89d[_0x155c('0x20')],_0x155c('0x2f')));_0x529c9c['push'](getAssociatedResources(_0x155c('0xe'),_0x47c89d['userProfileId'],_0x155c('0x35')));_0x529c9c[_0x155c('0x2e')](getAssociatedResources(_0x155c('0xf'),_0x47c89d['userProfileId'],'SmsQueue'));_0x529c9c[_0x155c('0x2e')](getAssociatedResources(_0x155c('0x36'),_0x47c89d[_0x155c('0x20')],'MailQueue'));_0x529c9c[_0x155c('0x2e')](getAssociatedResources(_0x155c('0x10'),_0x47c89d[_0x155c('0x20')],_0x155c('0x37')));_0x529c9c[_0x155c('0x2e')](getAssociatedResources('WhatsappQueues',_0x47c89d['userProfileId'],_0x155c('0x30')));_0x529c9c['push'](getAssociatedResources(_0x155c('0x12'),_0x47c89d['userProfileId'],'User'));_0x529c9c[_0x155c('0x2e')](getAssociatedResources(_0x155c('0x14'),_0x47c89d[_0x155c('0x20')],_0x155c('0x31')));_0x529c9c[_0x155c('0x2e')](getAssociatedResources('IvrCampaigns',_0x47c89d[_0x155c('0x20')],_0x155c('0x38')));_0x529c9c[_0x155c('0x2e')](db[_0x155c('0x4')][_0x155c('0x13')](queryAgents));break;case _0x155c('0x7'):_0x305ffc[_0x1006b8](_0x155c('0x2c'));_0x305ffc[_0x1006b8](_0x155c('0x39'));_0x529c9c[_0x155c('0x2e')](_0x47c89d[_0x155c('0x3a')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c['push'](_0x47c89d[_0x155c('0x3b')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c['push'](_0x47c89d[_0x155c('0x3c')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c[_0x155c('0x2e')](_0x47c89d[_0x155c('0x3d')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c[_0x155c('0x2e')](_0x47c89d[_0x155c('0x3e')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c[_0x155c('0x2e')](_0x47c89d[_0x155c('0x3f')]({'attributes':['id',_0x155c('0x2')]}));_0x529c9c[_0x155c('0x2e')](_0x47c89d[_0x155c('0x40')]({'attributes':['id',_0x155c('0x2')]}));break;}return BPromise['all'](_0x529c9c);}})['then'](function(_0x47c8b2){if(_0x47c8b2&&_0x47c8b2['length']){for(var _0x5601ac=0x0;_0x5601ac<_0x47c8b2[_0x155c('0x1c')];_0x5601ac+=0x1){for(var _0x6801ea=0x0;_0x6801ea<_0x47c8b2[_0x5601ac][_0x155c('0x1c')];_0x6801ea+=0x1){switch(_0x5601ac){case 0x0:joinOrLeaveQueues(_0x305ffc,_0x1006b8,'voice',_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x1:joinOrLeaveQueues(_0x305ffc,_0x1006b8,'chat',_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x2:joinOrLeaveQueues(_0x305ffc,_0x1006b8,_0x155c('0x41'),_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x3:joinOrLeaveQueues(_0x305ffc,_0x1006b8,_0x155c('0x42'),_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x4:joinOrLeaveQueues(_0x305ffc,_0x1006b8,'mail',_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x5:joinOrLeaveQueues(_0x305ffc,_0x1006b8,'openchannel',_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x6:joinOrLeaveQueues(_0x305ffc,_0x1006b8,_0x155c('0x43'),_0x47c8b2[_0x5601ac][_0x6801ea]);break;case 0x7:if(_0x4b6d0d['role']!==_0x155c('0x7'))_0x305ffc[_0x1006b8](util['format'](_0x155c('0x44'),_0x47c8b2[_0x5601ac][_0x6801ea]['name']));break;case 0x8:if(_0x4b6d0d['role']!==_0x155c('0x7'))_0x305ffc[_0x1006b8](util[_0x155c('0x1a')](_0x155c('0x45'),_0x47c8b2[_0x5601ac][_0x6801ea]['name']));break;case 0x9:if(_0x4b6d0d[_0x155c('0x5')]!==_0x155c('0x7'))_0x305ffc[_0x1006b8](util[_0x155c('0x1a')](_0x155c('0x46'),_0x47c8b2[_0x5601ac][_0x6801ea][_0x155c('0x8')],_0x47c8b2[_0x5601ac][_0x6801ea][_0x155c('0x2')]));break;case 0xa:_0x305ffc[_0x1006b8](util[_0x155c('0x1a')](_0x155c('0x1d'),_0x47c8b2[_0x5601ac][_0x6801ea][_0x155c('0x2')]));break;}}}}})['then'](function(){if(_0x1006b8===_0x155c('0x47')){var _0x32d1f0=_[_0x155c('0x48')](_0x4b6d0d[_0x155c('0x23')],'id');return _0x4b6d0d[_0x155c('0x49')](_0x32d1f0)['then'](function(){for(var _0x468ad0=0x0;_0x468ad0<_0x32d1f0[_0x155c('0x1c')];_0x468ad0+=0x1){_0x254557[_0x155c('0x4a')](_0x155c('0x4b'),{'ChatInteractionId':Number(_0x32d1f0[_0x468ad0]),'UserId':Number(_0x4b6d0d['id'])});}});}})[_0x155c('0xb')](function(){if(_0x1006b8==='leave'){var _0x5b46bc=_[_0x155c('0x48')](_0x4b6d0d[_0x155c('0x25')],'id');return _0x4b6d0d['removeMailInteractions'](_0x5b46bc)[_0x155c('0xb')](function(){for(var _0x11a461=0x0;_0x11a461<_0x5b46bc['length'];_0x11a461+=0x1){_0x254557[_0x155c('0x4a')](_0x155c('0x4c'),{'MailInteractionId':Number(_0x5b46bc[_0x11a461]),'UserId':Number(_0x4b6d0d['id'])});}});}})[_0x155c('0xb')](function(){if(_0x1006b8===_0x155c('0x47')){var _0x575102=_[_0x155c('0x48')](_0x4b6d0d[_0x155c('0x27')],'id');return _0x4b6d0d[_0x155c('0x4d')](_0x575102)[_0x155c('0xb')](function(){for(var _0x422b90=0x0;_0x422b90<_0x575102[_0x155c('0x1c')];_0x422b90+=0x1){_0x254557['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x575102[_0x422b90]),'UserId':Number(_0x4b6d0d['id'])});}});}})[_0x155c('0xb')](function(){if(_0x1006b8===_0x155c('0x47')){var _0x5e04fc=_[_0x155c('0x48')](_0x4b6d0d['SmsInteractions'],'id');return _0x4b6d0d[_0x155c('0x4e')](_0x5e04fc)[_0x155c('0xb')](function(){for(var _0x239d07=0x0;_0x239d07<_0x5e04fc[_0x155c('0x1c')];_0x239d07+=0x1){_0x254557[_0x155c('0x4a')](_0x155c('0x4f'),{'SmsInteractionId':Number(_0x5e04fc[_0x239d07]),'UserId':Number(_0x4b6d0d['id'])});}});}})['then'](function(){if(_0x1006b8===_0x155c('0x47')){var _0x1dc161=_['map'](_0x4b6d0d['OpenchannelInteractions'],'id');return _0x4b6d0d[_0x155c('0x50')](_0x1dc161)['then'](function(){for(var _0x1c383d=0x0;_0x1c383d<_0x1dc161[_0x155c('0x1c')];_0x1c383d+=0x1){_0x254557['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x1dc161[_0x1c383d]),'UserId':Number(_0x4b6d0d['id'])});}});}})[_0x155c('0xb')](function(){if(_0x1006b8===_0x155c('0x47')){var _0xe32119=_['map'](_0x4b6d0d[_0x155c('0x51')],'id');return _0x4b6d0d[_0x155c('0x52')](_0xe32119)[_0x155c('0xb')](function(){for(var _0x2efa2b=0x0;_0x2efa2b<_0xe32119[_0x155c('0x1c')];_0x2efa2b+=0x1){_0x254557[_0x155c('0x4a')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0xe32119[_0x2efa2b]),'UserId':Number(_0x4b6d0d['id'])});}});}})['catch'](function(_0x365567){_0x305ffc[_0x155c('0x53')](_0x365567);});}}function onDisconnect(_0x421cc8,_0x51a8dc){joinOrLeave(_0x421cc8,_0x155c('0x47'),_0x51a8dc);}function onConnect(_0x412cbd){joinOrLeave(_0x412cbd,_0x155c('0x54'));}exports[_0x155c('0x55')]=function(_0x3c6d72){_0x3c6d72['on']('connection',function(_0x4b5459){_0x4b5459[_0x155c('0x56')](0x0);_0x4b5459[_0x155c('0x57')]=_0x4b5459[_0x155c('0x58')][_0x155c('0x59')]['remoteAddress']+':'+_0x4b5459[_0x155c('0x58')][_0x155c('0x59')][_0x155c('0x5a')];_0x4b5459['connectedAt']=new Date();_0x4b5459[_0x155c('0x53')]=function(_0x58ba18){console[_0x155c('0x53')](_0x155c('0x5b')+_0x4b5459['nsp'][_0x155c('0x2')]+'['+_0x4b5459[_0x155c('0x57')]+']',_0x58ba18);};_0x4b5459['on'](_0x155c('0x5c'),function(){onDisconnect(_0x4b5459,_0x3c6d72);_0x4b5459['log'](_0x155c('0x5d'));});onConnect(_0x4b5459);_0x4b5459[_0x155c('0x53')](_0x155c('0x5e'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index f12949e..0e8bfd6 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 _0xfb9b=['code','catch','channel','motionChannel','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','contact','UserId','undefined','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','SELECT','AfterCreate','closed','changed','substatus','QueryTypes','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error'];(function(_0x54e4e2,_0x531bf0){var _0x57f20d=function(_0x3e0374){while(--_0x3e0374){_0x54e4e2['push'](_0x54e4e2['shift']());}};_0x57f20d(++_0x531bf0);}(_0xfb9b,0x10f));var _0xbfb9=function(_0x43312c,_0x4699b6){_0x43312c=_0x43312c-0x0;var _0x26b8c0=_0xfb9b[_0x43312c];return _0x26b8c0;};'use strict';var util=require(_0xbfb9('0x0'));var db=require(_0xbfb9('0x1'))['db'];var jayson=require(_0xbfb9('0x2'));var logger=require('../logger')(_0xbfb9('0x3'));var client=jayson[_0xbfb9('0x4')][_0xbfb9('0x5')]({'port':0x232a});var triggers=[{'channel':_0xbfb9('0x6'),'model':_0xbfb9('0x7'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0xbfb9('0x7'),'event':_0xbfb9('0xa'),'condition':_0xbfb9('0xb'),'callback':afterUpdate},{'channel':_0xbfb9('0x6'),'model':'ChatMessage','event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xbfb9('0xd'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':_0xbfb9('0xe'),'model':_0xbfb9('0xf'),'event':_0xbfb9('0xa'),'condition':_0xbfb9('0xb'),'callback':afterUpdate},{'channel':_0xbfb9('0xe'),'model':_0xbfb9('0x10'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateMessage},{'channel':_0xbfb9('0x11'),'model':_0xbfb9('0x12'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':_0xbfb9('0x11'),'model':'WhatsappInteraction','event':'afterUpdate','condition':_0xbfb9('0xb'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xbfb9('0x13'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateMessage},{'channel':_0xbfb9('0x14'),'model':_0xbfb9('0x15'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':_0xbfb9('0x14'),'model':_0xbfb9('0x15'),'event':'afterUpdate','condition':_0xbfb9('0xb'),'callback':afterUpdate},{'channel':_0xbfb9('0x14'),'model':'FaxMessage','event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateMessage},{'channel':_0xbfb9('0x16'),'model':_0xbfb9('0x17'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':_0xbfb9('0x16'),'model':'MailInteraction','event':_0xbfb9('0xa'),'condition':_0xbfb9('0xb'),'callback':afterUpdate},{'channel':_0xbfb9('0x16'),'model':_0xbfb9('0x18'),'event':_0xbfb9('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbfb9('0x19'),'model':_0xbfb9('0x1a'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0x9'),'callback':afterCreate},{'channel':_0xbfb9('0x19'),'model':'OpenchannelInteraction','event':_0xbfb9('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xbfb9('0x19'),'model':_0xbfb9('0x1b'),'event':_0xbfb9('0x8'),'condition':_0xbfb9('0xc'),'callback':afterCreateMessage}];function request(_0x3f9671){return client['request'](_0xbfb9('0x1c'),_0x3f9671)[_0xbfb9('0x1d')](function(_0x21731d){logger[_0xbfb9('0x1e')](_0xbfb9('0x1f'),_0xbfb9('0x1c'),_0x21731d);if(_0x21731d[_0xbfb9('0x20')]){if(_0x21731d[_0xbfb9('0x20')][_0xbfb9('0x21')]===0x1f4){logger[_0xbfb9('0x20')](_0xbfb9('0x1f'),_0xbfb9('0x1c'),_0x21731d[_0xbfb9('0x20')]);}}})[_0xbfb9('0x22')](function(_0x20d19f){logger[_0xbfb9('0x20')](_0xbfb9('0x1f'),_0xbfb9('0x1c'),_0x20d19f);});}function afterCreateMessage(_0x2a3eac){return function(_0x54eda3){_0x54eda3=_0x54eda3['get']({'plain':!![]});_0x54eda3[_0xbfb9('0x23')]=_0x2a3eac;_0x54eda3[_0xbfb9('0x24')]=_0x2a3eac;_0x54eda3[_0xbfb9('0x25')]=_0x54eda3[_0xbfb9('0x26')];Promise[_0xbfb9('0x27')]()['then'](function(){if(typeof _0x54eda3[_0xbfb9('0x28')]==='undefined')return null;var _0x4f9fe0=_0xbfb9('0x29')+_0x54eda3[_0xbfb9('0x28')];return db[_0xbfb9('0x2a')][_0xbfb9('0x2b')](_0x4f9fe0,{'type':db[_0xbfb9('0x2c')]['QueryTypes']['SELECT'],'raw':!![]});})[_0xbfb9('0x1d')](function(_0x468cf7){if(_0x468cf7){_0x54eda3[_0xbfb9('0x2d')]=_0x468cf7[0x0];}if(typeof _0x54eda3[_0xbfb9('0x2e')]===_0xbfb9('0x2f'))return;return getAgent(_0x54eda3['UserId']);})['then'](function(_0x829b5f){if(_0x829b5f){_0x54eda3[_0xbfb9('0x30')]=util[_0xbfb9('0x31')](_0xbfb9('0x32'),_0x829b5f[_0xbfb9('0x33')]);_0x54eda3[_0xbfb9('0x34')]=_0x829b5f;_0x54eda3['channel']=_0x2a3eac;return request({'event':_0xbfb9('0x35'),'message':_0x54eda3});}else{return request({'event':_0xbfb9('0x36'),'message':_0x54eda3});}})[_0xbfb9('0x22')](function(_0x1bbc10){logger[_0xbfb9('0x20')]('Trigger,\x20%s',_0xbfb9('0x37'),_0x1bbc10);});};}function afterCreateOfflineMessage(_0x1de2ca){return function(_0x538f1e){_0x538f1e=_0x538f1e[_0xbfb9('0x38')]({'plain':!![]});_0x538f1e['channel']=_0x1de2ca;_0x538f1e['motionChannel']=_0x1de2ca;_0x538f1e[_0xbfb9('0x25')]=_0xbfb9('0x39');return request({'event':_0x538f1e[_0xbfb9('0x25')],'message':_0x538f1e});};}function afterCreate(_0x21f54b,_0x130a64){return function(_0x49b27b){_0x49b27b=_0x49b27b[_0xbfb9('0x38')]({'plain':!![]});_0x49b27b[_0xbfb9('0x23')]=_0x21f54b;_0x49b27b[_0xbfb9('0x24')]=_0x21f54b;_0x49b27b['event']='opened';Promise[_0xbfb9('0x27')]()[_0xbfb9('0x1d')](function(){var _0x5877d9=_0xbfb9('0x29')+_0x49b27b[_0xbfb9('0x28')];return db[_0xbfb9('0x2a')][_0xbfb9('0x2b')](_0x5877d9,{'type':db[_0xbfb9('0x2c')]['QueryTypes'][_0xbfb9('0x3a')],'raw':!![]});})[_0xbfb9('0x1d')](function(_0x431a75){if(_0x431a75){_0x49b27b[_0xbfb9('0x2d')]=_0x431a75[0x0];}if(typeof _0x49b27b[_0xbfb9('0x2e')]===_0xbfb9('0x2f'))return;return getAgent(_0x49b27b[_0xbfb9('0x2e')]);})[_0xbfb9('0x1d')](function(_0x2c8910){if(_0x2c8910){_0x49b27b['interface']=util[_0xbfb9('0x31')](_0xbfb9('0x32'),_0x2c8910[_0xbfb9('0x33')]);_0x49b27b[_0xbfb9('0x34')]=_0x2c8910;}return request({'event':_0x130a64,'message':_0x49b27b});})[_0xbfb9('0x22')](function(_0x4fca78){logger[_0xbfb9('0x20')]('Trigger,\x20%s',_0xbfb9('0x3b'),_0x4fca78);});};}function afterUpdate(_0x529fe5){return function(_0x1b596c){var _0x46e7aa=_0x1b596c['changed'](_0xbfb9('0x3c'))&&_0x1b596c[_0xbfb9('0x3c')];var _0x2d3b7b=_0x1b596c[_0xbfb9('0x3d')](_0xbfb9('0x3e'));if(_0x46e7aa||_0x2d3b7b){var _0x22a3ef=_0x46e7aa?_0xbfb9('0xb'):_0xbfb9('0x3e');var _0x231bc6=_0x1b596c[_0xbfb9('0x38')]({'plain':!![]});_0x231bc6[_0xbfb9('0x23')]=_0x529fe5;_0x231bc6[_0xbfb9('0x24')]=_0x529fe5;_0x231bc6[_0xbfb9('0x25')]=_0x46e7aa?'closed':_0xbfb9('0x3e');var _0x162621=_0xbfb9('0x29')+_0x231bc6[_0xbfb9('0x28')];return db[_0xbfb9('0x2a')][_0xbfb9('0x2b')](_0x162621,{'type':db[_0xbfb9('0x2c')][_0xbfb9('0x3f')][_0xbfb9('0x3a')],'raw':!![]})[_0xbfb9('0x1d')](function(_0x59ca4b){if(_0x59ca4b){_0x231bc6['contact']=_0x59ca4b[0x0];}if(typeof _0x231bc6['UserId']===_0xbfb9('0x2f'))return;return getAgent(_0x231bc6[_0xbfb9('0x2e')]);})[_0xbfb9('0x1d')](function(_0x1b810e){if(_0x1b810e){_0x231bc6['interface']=util['format']('SIP/%s',_0x1b810e['name']);_0x231bc6[_0xbfb9('0x34')]=_0x1b810e;}return request({'event':_0x22a3ef,'message':_0x231bc6});})['catch'](function(_0x3b3f11){logger[_0xbfb9('0x20')](_0xbfb9('0x1f'),_0xbfb9('0x40'),_0x3b3f11);});}};}function getAgent(_0x99cc89){return db[_0xbfb9('0x41')][_0xbfb9('0x42')]({'where':{'id':_0x99cc89},'attributes':['id',_0xbfb9('0x33'),_0xbfb9('0x43'),_0xbfb9('0x44'),'internal'],'raw':!![]})[_0xbfb9('0x1d')](function(_0x4a3985){return _0x4a3985;});}exports[_0xbfb9('0x45')]=function(){for(var _0x4de80d=0x0;_0x4de80d=_0x37070c[_0x8650('0x16')]){throw Error(_0x8650('0x17'));}_0x3e72ca(_0x462721);})['catch'](function(_0x88949d){_0x52ddb4(_0x88949d);});});}; \ No newline at end of file +var _0x20ca=['sms','whatsapp','getChannels','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','voice','mail','chat','fax'];(function(_0x29e3f4,_0x289e06){var _0x37d277=function(_0x57fe71){while(--_0x57fe71){_0x29e3f4['push'](_0x29e3f4['shift']());}};_0x37d277(++_0x289e06);}(_0x20ca,0xcc));var _0xa20c=function(_0x3dcbce,_0x2f76b0){_0x3dcbce=_0x3dcbce-0x0;var _0x32ad25=_0x20ca[_0x3dcbce];return _0x32ad25;};'use strict';var _=require(_0xa20c('0x0'));var BPromise=require('bluebird');var db=require(_0xa20c('0x1'))['db'];var util=require('./license/util');var channels=[_0xa20c('0x2'),_0xa20c('0x3'),_0xa20c('0x4'),_0xa20c('0x5'),_0xa20c('0x6'),_0xa20c('0x7'),'openchannel'];exports[_0xa20c('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x53aed1){_0x53aed1=_0x53aed1['toLowerCase']();return _['includes'](channels,_0x53aed1);};exports[_0xa20c('0x9')]=function(_0x3e6606,_0x269f6f,_0x24d697,_0x2a1322){var _0x3d92d3={'loginAttempts':_0x269f6f,'blocked':_0x24d697};if(!_[_0xa20c('0xa')](_0x2a1322)){_0x3d92d3[_0xa20c('0xb')]=_0x2a1322;}return _0x3e6606[_0xa20c('0xc')](_0x3d92d3);};exports[_0xa20c('0xd')]=function(_0x124d90){return new BPromise(function(_0x27701e,_0x36b45e){var _0x113aa8=0x0;if(_0x124d90[_0xa20c('0xe')]!==_0xa20c('0xf')){_0x27701e(_0x124d90);}db['User'][_0xa20c('0x10')]({'where':{'role':_0xa20c('0xf'),'online':!![],'id':{'$ne':_0x124d90['id']}}})[_0xa20c('0x11')](function(_0x31b50f){_0x113aa8=_0x31b50f;return util[_0xa20c('0xd')]();})[_0xa20c('0x11')](function(_0x3f5985){if(_0x3f5985&&_0x3f5985[_0xa20c('0x12')]&&_0x113aa8>=_0x3f5985[_0xa20c('0x12')]){throw Error(_0xa20c('0x13'));}_0x27701e(_0x124d90);})[_0xa20c('0x14')](function(_0x459ffb){_0x36b45e(_0x459ffb);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index bc745e8..a5ee1e3 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','stack','name','status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x1882d2,_0x285bb5){var _0x557a14=function(_0x45f199){while(--_0x45f199){_0x1882d2['push'](_0x1882d2['shift']());}};_0x557a14(++_0x285bb5);}(_0x5b02,0xe9));var _0x25b0=function(_0xf85478,_0x1dc65f){_0xf85478=_0xf85478-0x0;var _0x427b68=_0x5b02[_0xf85478];return _0x427b68;};'use strict';var util=require(_0x25b0('0x0'));var logger=require(_0x25b0('0x1'))(_0x25b0('0x2'));var APIError=function(_0x1c3295,_0x4ef71c){this['message']=_0x1c3295||_0x25b0('0x3');this['name']=_0x4ef71c||_0x25b0('0x4');util[_0x25b0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x38dc14){this[_0x25b0('0x6')]=_0x38dc14||_0x25b0('0x7');this['name']=_0x25b0('0x7');util[_0x25b0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x49ef3a){this[_0x25b0('0x6')]=_0x49ef3a||'Entity\x20not\x20found';this['name']=_0x25b0('0x8');util[_0x25b0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x358af0){switch(_0x358af0){case'Bad\x20Request':return 0x190;case _0x25b0('0x9'),_0x25b0('0xa'):return 0x193;case _0x25b0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x250d31){return function(_0x2c72f3){logger[_0x25b0('0xb')](_0x2c72f3[_0x25b0('0xc')]);var _0x10c3fb=getStatusCode(_0x2c72f3[_0x25b0('0xd')]);if(_0x2c72f3[_0x25b0('0xd')])delete _0x2c72f3[_0x25b0('0xd')];return _0x250d31[_0x25b0('0xe')](_0x10c3fb)[_0x25b0('0xf')](_0x2c72f3);};}module[_0x25b0('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x878f=['Bad\x20Request','Forbidden','Not\x20Found','error','status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','inherits'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x878f,0x173));var _0xf878=function(_0x255475,_0x2a41c9){_0x255475=_0x255475-0x0;var _0x2f9a65=_0x878f[_0x255475];return _0x2f9a65;};'use strict';var util=require('util');var logger=require(_0xf878('0x0'))(_0xf878('0x1'));var APIError=function(_0x2e1d23,_0x12df2b){this[_0xf878('0x2')]=_0x2e1d23||_0xf878('0x3');this[_0xf878('0x4')]=_0x12df2b||_0xf878('0x5');util[_0xf878('0x6')](APIError,Error);};var APIBadRequestError=function(_0xcf1927){this[_0xf878('0x2')]=_0xcf1927||'Bad\x20Request';this['name']=_0xf878('0x7');util[_0xf878('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x59e564){this['message']=_0x59e564||'Entity\x20not\x20found';this[_0xf878('0x4')]='Not\x20Found';util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x307653){switch(_0x307653){case _0xf878('0x7'):return 0x190;case _0xf878('0x8'),'OutOfInterval':return 0x193;case _0xf878('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x1399a3){return function(_0x531b9c){logger[_0xf878('0xa')](_0x531b9c['stack']);var _0x31d3d2=getStatusCode(_0x531b9c[_0xf878('0x4')]);if(_0x531b9c[_0xf878('0x4')])delete _0x531b9c['name'];return _0x1399a3[_0xf878('0xb')](_0x31d3d2)[_0xf878('0xc')](_0x531b9c);};}module[_0xf878('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7577fa1..6c5ed98 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6cb=['404','status','json','send','exports'];(function(_0x469adf,_0x2ec2b8){var _0x59d41f=function(_0x14d9ae){while(--_0x14d9ae){_0x469adf['push'](_0x469adf['shift']());}};_0x59d41f(++_0x2ec2b8);}(_0xd6cb,0x1cb));var _0xbd6c=function(_0x187dfb,_0x33bfce){_0x187dfb=_0x187dfb-0x0;var _0x1116df=_0xd6cb[_0x187dfb];return _0x1116df;};'use strict';module[_0xbd6c('0x0')][0x194]=function pageNotFound(_0x27ae4e,_0x35ba4a){var _0x148a70=_0xbd6c('0x1');var _0x3ab2ab=0x194;var _0x35376c={'status':_0x3ab2ab};_0x35ba4a[_0xbd6c('0x2')](_0x35376c[_0xbd6c('0x2')]);_0x35ba4a['render'](_0x148a70,{},function(_0x2eb14d,_0x288e61){if(_0x2eb14d){return _0x35ba4a[_0xbd6c('0x2')](_0x35376c[_0xbd6c('0x2')])[_0xbd6c('0x3')](_0x35376c);}_0x35ba4a[_0xbd6c('0x4')](_0x288e61);});}; \ No newline at end of file +var _0xa316=['status','json','send','404'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa316,0x1af));var _0x6a31=function(_0x2f5828,_0x37ae38){_0x2f5828=_0x2f5828-0x0;var _0x59b236=_0xa316[_0x2f5828];return _0x59b236;};'use strict';module['exports'][0x194]=function pageNotFound(_0x53c492,_0x2f7a34){var _0x2f472d=_0x6a31('0x0');var _0x19ae27=0x194;var _0x18e2c1={'status':_0x19ae27};_0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')]);_0x2f7a34['render'](_0x2f472d,{},function(_0x22baee,_0xa0b9e2){if(_0x22baee){return _0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')])[_0x6a31('0x2')](_0x18e2c1);}_0x2f7a34[_0x6a31('0x3')](_0xa0b9e2);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9599d0a..4b66652 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbdc=['OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../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','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','UserMailQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Answers','Interactions','MailApplication','List','TemplateId','mandatoryDispositionPauseId','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','Contact','Interaction','ChatWebsiteId','TagId','ListId','Items','Dispositions','CannedAnswer','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','Tags','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','user_has_chat_websites','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','chat_group_has_users','CmCompany','CompanyId','Phones','CmContactId','CmHopper','ChatInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','Agent','Campaign','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','VoiceMusicOnHold','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','DescriptionId','Subject','SubjectId','Description','Field','VariableId','Subjects','Descriptions','FieldId','SugarcrmAccount','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','Dynamics365Configuration','FromId','SessionId','JscriptyAnswerReport','ProjectId','user_has_teams','team_has_whatsapp_queues','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','Queues','UserProfileSections','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue'];(function(_0x5869f5,_0x176fd5){var _0x6beba1=function(_0x253e04){while(--_0x253e04){_0x5869f5['push'](_0x5869f5['shift']());}};_0x6beba1(++_0x176fd5);}(_0xbbdc,0x1a5));var _0xcbbd=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0xbbdc[_0x2e8418];return _0x548fe6;};'use strict';var config=require(_0xcbbd('0x0'));var Sequelize=require(_0xcbbd('0x1'));var _=require(_0xcbbd('0x2'));var jstz=require(_0xcbbd('0x3'));var timezone=jstz[_0xcbbd('0x4')]();config['sequelize']=_[_0xcbbd('0x5')](config[_0xcbbd('0x1')],{'database':_0xcbbd('0x6'),'username':_0xcbbd('0x7'),'password':_0xcbbd('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xcbbd('0x9'),'dialectOptions':{'charset':_0xcbbd('0xa')},'logging':![],'timezone':timezone[_0xcbbd('0xb')](),'define':{'charset':_0xcbbd('0xc'),'collate':_0xcbbd('0xd')}}});config[_0xcbbd('0xe')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':'motion2','username':_0xcbbd('0x7'),'password':_0xcbbd('0x8'),'options':{'host':_0xcbbd('0xf'),'port':0xcea,'dialect':_0xcbbd('0x9'),'dialectOptions':{'charset':_0xcbbd('0xa')},'logging':![],'timezone':timezone[_0xcbbd('0xb')](),'define':{'charset':_0xcbbd('0xc'),'collate':_0xcbbd('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xcbbd('0x10')],config[_0xcbbd('0x1')][_0xcbbd('0x11')],config[_0xcbbd('0x1')]['password'],config[_0xcbbd('0x1')][_0xcbbd('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcbbd('0xe')][_0xcbbd('0x10')],config[_0xcbbd('0xe')][_0xcbbd('0x11')],config[_0xcbbd('0xe')][_0xcbbd('0x13')],config[_0xcbbd('0xe')]['options'])};db[_0xcbbd('0x14')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x16'));db[_0xcbbd('0x17')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x18'));db['VoiceContext']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x19'));db[_0xcbbd('0x1a')]=db[_0xcbbd('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x1b'));db[_0xcbbd('0x1c')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/voiceQueue/voiceQueue.model');db[_0xcbbd('0x1d')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x1e'));db[_0xcbbd('0x1f')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/voiceMail/voiceMail.model');db[_0xcbbd('0x20')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x21'));db['VoiceCallReport']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x22'));db[_0xcbbd('0x23')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x24'));db[_0xcbbd('0x25')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x26'));db[_0xcbbd('0x27')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x28'));db['MemberReport']=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/memberReport/memberReport.model');db[_0xcbbd('0x29')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x2a'));db[_0xcbbd('0x2b')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x2c'));db[_0xcbbd('0x2d')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x2e'));db[_0xcbbd('0x2f')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x30'));db[_0xcbbd('0x31')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x32'));db['UserMailQueue']=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x33'));db[_0xcbbd('0x34')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x35'));db[_0xcbbd('0x36')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x37'));db[_0xcbbd('0x38')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x39'));db[_0xcbbd('0x3a')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xcbbd('0x3b')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x3c'));db[_0xcbbd('0x3d')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x3e'));db[_0xcbbd('0x3f')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x40'));db[_0xcbbd('0x41')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x42'));db[_0xcbbd('0x43')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x44'));db[_0xcbbd('0x45')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x46'));db[_0xcbbd('0x47')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x48'));db['MailApplication']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x49'));db[_0xcbbd('0x4a')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x4b'));db[_0xcbbd('0x4c')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x4d'));db[_0xcbbd('0x4e')]=db[_0xcbbd('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db[_0xcbbd('0x4f')]=db['sequelize']['import'](_0xcbbd('0x50'));db[_0xcbbd('0x51')]=db['sequelize'][_0xcbbd('0x15')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db['sequelize']['import'](_0xcbbd('0x52'));db[_0xcbbd('0x53')]=db[_0xcbbd('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0xcbbd('0x54')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x55'));db[_0xcbbd('0x56')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x57'));db[_0xcbbd('0x58')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x59'));db[_0xcbbd('0x5a')]=db['sequelize'][_0xcbbd('0x15')]('../api/smsApplication/smsApplication.model');db[_0xcbbd('0x5b')]=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0xcbbd('0x5c')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x5d'));db[_0xcbbd('0x5e')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/smsQueue/smsQueue.model');db[_0xcbbd('0x5f')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x60'));db[_0xcbbd('0x61')]=db[_0xcbbd('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xcbbd('0x62')]=db[_0xcbbd('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xcbbd('0x63')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x64'));db[_0xcbbd('0x65')]=db['sequelize'][_0xcbbd('0x15')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x66'));db[_0xcbbd('0x67')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x68'));db[_0xcbbd('0x69')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x6a'));db[_0xcbbd('0x6b')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x6c'));db[_0xcbbd('0x6d')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x6e'));db[_0xcbbd('0x6f')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x70'));db[_0xcbbd('0x71')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x72'));db[_0xcbbd('0x73')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x74'));db[_0xcbbd('0x75')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x76'));db['CmCompany']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x77'));db[_0xcbbd('0x78')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x79'));db['CmHopper']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x7a'));db[_0xcbbd('0x7b')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x7c'));db[_0xcbbd('0x7d')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x7e'));db[_0xcbbd('0x7f')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x80'));db['ReportAgentPreview']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x81'));db['CmCustomField']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x82'));db[_0xcbbd('0x83')]=db[_0xcbbd('0x1')]['import']('../api/action/action.model');db[_0xcbbd('0x84')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x85'));db['CannedAnswer']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x86'));db[_0xcbbd('0x87')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x88'));db[_0xcbbd('0x89')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/condition/condition.model');db[_0xcbbd('0x8a')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x8b'));db['Pause']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x8c'));db[_0xcbbd('0x8d')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x8e'));db['VoiceQueuesLog']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x8f'));db[_0xcbbd('0x90')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x91'));db['Sound']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x92'));db[_0xcbbd('0x93')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x94'));db[_0xcbbd('0x95')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x96'));db[_0xcbbd('0x97')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x98'));db[_0xcbbd('0x99')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x9a'));db['Trigger']=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/trigger/trigger.model');db[_0xcbbd('0x9b')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/variable/variable.model');db[_0xcbbd('0x9c')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x9d'));db[_0xcbbd('0x9e')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x9f'));db[_0xcbbd('0xa0')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xa1'));db[_0xcbbd('0xa2')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xcbbd('0xa3')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xa4'));db[_0xcbbd('0xa5')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0xcbbd('0xa6')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xa7'));db[_0xcbbd('0xa8')]=db['sequelize']['import'](_0xcbbd('0xa9'));db[_0xcbbd('0xaa')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xab'));db[_0xcbbd('0xac')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xad'));db[_0xcbbd('0xae')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xcbbd('0xaf')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xb0'));db[_0xcbbd('0xb1')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xb2'));db[_0xcbbd('0xb3')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xcbbd('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xcbbd('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xcbbd('0xb4')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xb5'));db[_0xcbbd('0xb6')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xb7'));db[_0xcbbd('0xb8')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xcbbd('0xb9')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xcbbd('0xba')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xbb'));db[_0xcbbd('0xbc')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xcbbd('0xbd')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xbe'));db[_0xcbbd('0xbf')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xc0'));db[_0xcbbd('0xc1')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xcbbd('0xc2')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xc3'));db[_0xcbbd('0xc4')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xc5'));db[_0xcbbd('0xc6')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xc7'));db['ServicenowField']=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xc8'));db[_0xcbbd('0xc9')]=db['sequelize'][_0xcbbd('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xca'));db[_0xcbbd('0xcb')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xcc'));db[_0xcbbd('0xcd')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xce'));db[_0xcbbd('0xcf')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xd0'));db[_0xcbbd('0xd1')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xd2'));db[_0xcbbd('0x9c')]=db['sequelize'][_0xcbbd('0x15')]('../api/integration/integration.model');db[_0xcbbd('0xd3')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xd4'));db[_0xcbbd('0xd5')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xd6'));db[_0xcbbd('0xd7')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xd8'));db['JscriptyAnswerReport']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xd9'));db[_0xcbbd('0xda')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xdb'));db[_0xcbbd('0xdc')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xdd'));db[_0xcbbd('0xde')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xdf'));db[_0xcbbd('0xe0')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xe1'));db[_0xcbbd('0xe2')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xcbbd('0xe3')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xe4'));db[_0xcbbd('0xe5')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/setting/setting.model');db[_0xcbbd('0xe6')]=db['sequelize'][_0xcbbd('0x15')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xe7'));db[_0xcbbd('0xe8')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xe9'));db[_0xcbbd('0xea')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xeb'));db[_0xcbbd('0xec')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xed'));db[_0xcbbd('0xee')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xef'));db['Campaign']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xf0'));db['Migration']=db['sequelize']['import'](_0xcbbd('0xf1'));db[_0xcbbd('0xf2')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xf3'));db[_0xcbbd('0xf4')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0xf5'));db['MailTransferReport']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xf6'));db[_0xcbbd('0xf7')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xcbbd('0xf8')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xcbbd('0xf9')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xfa'));db[_0xcbbd('0xfb')]=db[_0xcbbd('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0xfc'));db[_0xcbbd('0xfd')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xfe'));db['UserProfile']=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0xff'));db[_0xcbbd('0x100')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xcbbd('0x101')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x102'));db[_0xcbbd('0x103')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x104'));db[_0xcbbd('0x105')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x106'));db['WhatsappApplication']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x107'));db[_0xcbbd('0x108')]=db['sequelize'][_0xcbbd('0x15')](_0xcbbd('0x109'));db[_0xcbbd('0x10a')]=db['sequelize'][_0xcbbd('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0xcbbd('0x10b')]=db['sequelize']['import'](_0xcbbd('0x10c'));db[_0xcbbd('0x10d')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x10e'));db['WhatsappQueue']=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x10f'));db['CloudProvider']=db['sequelize']['import'](_0xcbbd('0x110'));db[_0xcbbd('0x111')]=db[_0xcbbd('0x1')]['import'](_0xcbbd('0x112'));db[_0xcbbd('0x113')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x114'));db[_0xcbbd('0x115')]=db[_0xcbbd('0x1')][_0xcbbd('0x15')](_0xcbbd('0x116'));db[_0xcbbd('0x117')]=db[_0xcbbd('0x1')]['import']('../api/user-setting/user-setting.model');db[_0xcbbd('0x14')][_0xcbbd('0x118')](db[_0xcbbd('0x1f')],{'as':'VoiceMail','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x11a')});db['User']['hasOne'](db['UserSetting'],{'as':'userSetting','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x11a')});db['User'][_0xcbbd('0x11b')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db['UserVoiceQueueRt'],{'as':_0xcbbd('0x11c'),'foreignKey':'UserId'});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db[_0xcbbd('0x1a')],{'as':_0xcbbd('0x11d'),'onDelete':_0xcbbd('0x119'),'hooks':!![]});db['User'][_0xcbbd('0x11b')](db[_0xcbbd('0x7d')],{'as':_0xcbbd('0x11e'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db[_0xcbbd('0x7f')],{'as':_0xcbbd('0x11f'),'foreignKey':'UserId'});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db['ReportAgentPreview'],{'as':_0xcbbd('0x120'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db['OpenchannelInteraction'],{'as':_0xcbbd('0x121'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db['User']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db[_0xcbbd('0x122')],{'as':'FaxInteractions','foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db['MailInteraction'],{'as':_0xcbbd('0x123'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db[_0xcbbd('0x108')],{'as':_0xcbbd('0x124'),'foreignKey':'UserId'});db[_0xcbbd('0x14')][_0xcbbd('0x11b')](db[_0xcbbd('0x103')],{'as':_0xcbbd('0x125'),'foreignKey':_0xcbbd('0x126')});db[_0xcbbd('0x14')][_0xcbbd('0x127')](db[_0xcbbd('0x128')],{'as':_0xcbbd('0x128'),'foreignKey':_0xcbbd('0x129')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x73')],{'as':_0xcbbd('0x12b'),'through':'chat_group_has_users'});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x12c'),'through':_0xcbbd('0x12d')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x12e')],{'as':'Lists','through':_0xcbbd('0x12f')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':'user_has_teams'});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x45')],{'as':_0xcbbd('0x123'),'through':_0xcbbd('0x130')});db['User']['belongsToMany'](db['ChatInteraction'],{'as':'ChatInteractions','through':_0xcbbd('0x131')});db['User'][_0xcbbd('0x12a')](db[_0xcbbd('0x122')],{'as':_0xcbbd('0x132'),'through':_0xcbbd('0x133')});db[_0xcbbd('0x14')]['belongsToMany'](db[_0xcbbd('0x5b')],{'as':_0xcbbd('0x134'),'through':_0xcbbd('0x135')});db['User'][_0xcbbd('0x12a')](db[_0xcbbd('0x62')],{'as':_0xcbbd('0x121'),'through':'user_has_openchannel_interactions'});db['User'][_0xcbbd('0x12a')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xcbbd('0x136')});db['User'][_0xcbbd('0x12a')](db[_0xcbbd('0x1c')],{'as':_0xcbbd('0x137'),'through':_0xcbbd('0x2f'),'required':![]});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0xfd')],{'as':'VoicePrefixes','through':_0xcbbd('0x115'),'required':![]});db[_0xcbbd('0x14')]['belongsToMany'](db[_0xcbbd('0x41')],{'as':_0xcbbd('0x138'),'through':_0xcbbd('0x139'),'required':![]});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x71')],{'as':'ChatQueues','through':_0xcbbd('0x31'),'required':![],'hooks':!![]});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x54')],{'as':_0xcbbd('0x13a'),'through':_0xcbbd('0x34'),'required':![]});db['User']['belongsToMany'](db[_0xcbbd('0x5e')],{'as':_0xcbbd('0x13b'),'through':_0xcbbd('0x36'),'required':![]});db['User']['belongsToMany'](db[_0xcbbd('0x65')],{'as':_0xcbbd('0x13c'),'through':_0xcbbd('0x38'),'required':![]});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x13d')],{'as':_0xcbbd('0x13e'),'through':_0xcbbd('0x3a'),'required':![]});db[_0xcbbd('0x14')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0xcbbd('0x14')]['belongsToMany'](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x140'),'through':'user_has_chat_websites'});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x4f')],{'as':_0xcbbd('0x141'),'through':_0xcbbd('0x142')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x3f')],{'as':_0xcbbd('0x143'),'through':_0xcbbd('0x144')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x5f')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User']['belongsToMany'](db[_0xcbbd('0x58')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xcbbd('0x14')]['belongsToMany'](db[_0xcbbd('0x105')],{'as':_0xcbbd('0x145'),'through':_0xcbbd('0x146')});db[_0xcbbd('0x14')][_0xcbbd('0x12a')](db[_0xcbbd('0x147')],{'as':_0xcbbd('0x148'),'through':_0xcbbd('0x149')});db['VoiceChanSpy'][_0xcbbd('0x11b')](db['VoiceExtension'],{'as':_0xcbbd('0x14a'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x14b')});db[_0xcbbd('0x14c')]['hasMany'](db['VoiceExtension'],{'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x1a')]['hasMany'](db[_0xcbbd('0x1a')],{'as':_0xcbbd('0x14d'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xcbbd('0x12a')](db[_0xcbbd('0x14e')],{'as':_0xcbbd('0x14f'),'through':_0xcbbd('0x150')});db[_0xcbbd('0x1c')][_0xcbbd('0x11b')](db[_0xcbbd('0x2d')],{'as':_0xcbbd('0x151'),'foreignKey':'VoiceQueueId'});db[_0xcbbd('0x1c')][_0xcbbd('0x11b')](db['CmHopper'],{'as':_0xcbbd('0x152'),'foreignKey':_0xcbbd('0x153')});db[_0xcbbd('0x1c')]['hasMany'](db[_0xcbbd('0x7d')],{'as':_0xcbbd('0x11e'),'foreignKey':'VoiceQueueId'});db[_0xcbbd('0x1c')][_0xcbbd('0x11b')](db['CmHopperHistory'],{'as':_0xcbbd('0x154'),'foreignKey':'VoiceQueueId'});db[_0xcbbd('0x1c')][_0xcbbd('0x11b')](db['ReportAgentPreview'],{'as':_0xcbbd('0x120'),'foreignKey':_0xcbbd('0x153')});db[_0xcbbd('0x1c')][_0xcbbd('0x11b')](db[_0xcbbd('0x7b')],{'as':_0xcbbd('0x155'),'foreignKey':_0xcbbd('0x153')});db['VoiceQueue'][_0xcbbd('0x11b')](db[_0xcbbd('0xdc')],{'as':_0xcbbd('0x156'),'foreignKey':_0xcbbd('0x153')});db['VoiceQueue'][_0xcbbd('0x127')](db[_0xcbbd('0x29')],{'as':_0xcbbd('0x29'),'foreignKey':_0xcbbd('0x157')});db[_0xcbbd('0x1c')]['belongsTo'](db[_0xcbbd('0x29')],{'as':_0xcbbd('0x158'),'foreignKey':'TrunkBackupId'});db[_0xcbbd('0x1c')]['belongsTo'](db[_0xcbbd('0x8a')],{'as':'Interval','foreignKey':_0xcbbd('0x159')});db['VoiceQueue'][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':_0xcbbd('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xcbbd('0x1c')][_0xcbbd('0x12a')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x15c'),'through':_0xcbbd('0x15d')});db[_0xcbbd('0x1c')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x2f')});db[_0xcbbd('0x1c')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'as':_0xcbbd('0x15f'),'through':_0xcbbd('0x111')});db[_0xcbbd('0x1c')]['belongsToMany'](db['CmList'],{'as':_0xcbbd('0x160'),'through':_0xcbbd('0x161')});db['VoiceRecording'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x14'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x162')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x14'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x1f')][_0xcbbd('0x11b')](db['VoiceMailMessage'],{'as':_0xcbbd('0x163'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x164'),'sourceKey':'mailbox'});db[_0xcbbd('0x20')]['belongsTo'](db[_0xcbbd('0x1f')],{'foreignKey':_0xcbbd('0x164'),'targetKey':'mailbox'});db[_0xcbbd('0x165')][_0xcbbd('0x11b')](db['VoiceQueueReport'],{'as':_0xcbbd('0x166'),'foreignKey':'uniqueid','constraints':![]});db[_0xcbbd('0x165')]['hasMany'](db[_0xcbbd('0x25')],{'as':'AgentReports','foreignKey':_0xcbbd('0x167'),'constraints':![]});db[_0xcbbd('0x165')]['belongsTo'](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x14'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x165')]['belongsTo'](db[_0xcbbd('0x78')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbbd('0x3b')][_0xcbbd('0x127')](db[_0xcbbd('0x3f')],{'as':_0xcbbd('0x3f'),'foreignKey':_0xcbbd('0x168')});db[_0xcbbd('0x3b')][_0xcbbd('0x127')](db[_0xcbbd('0x169')],{'as':'CloudProvider','foreignKey':_0xcbbd('0x16a'),'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x3d')][_0xcbbd('0x127')](db[_0xcbbd('0x3f')],{'as':_0xcbbd('0x3f'),'foreignKey':_0xcbbd('0x168')});db[_0xcbbd('0x3d')][_0xcbbd('0x127')](db[_0xcbbd('0x169')],{'as':_0xcbbd('0x169'),'foreignKey':_0xcbbd('0x16a'),'onDelete':'restrict'});db[_0xcbbd('0x3f')][_0xcbbd('0x118')](db[_0xcbbd('0x3b')],{'as':_0xcbbd('0x16c'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x3f')][_0xcbbd('0x118')](db[_0xcbbd('0x3d')],{'as':_0xcbbd('0x16d'),'onDelete':'cascade'});db[_0xcbbd('0x3f')][_0xcbbd('0x11b')](db[_0xcbbd('0x87')],{'as':'Dispositions','foreignKey':_0xcbbd('0x168'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x3f')][_0xcbbd('0x11b')](db['CannedAnswer'],{'as':_0xcbbd('0x16e'),'foreignKey':'MailAccountId'});db[_0xcbbd('0x3f')]['hasMany'](db[_0xcbbd('0x47')],{'as':_0xcbbd('0x163'),'foreignKey':_0xcbbd('0x168')});db[_0xcbbd('0x3f')][_0xcbbd('0x11b')](db[_0xcbbd('0x45')],{'as':_0xcbbd('0x16f')});db[_0xcbbd('0x3f')][_0xcbbd('0x11b')](db[_0xcbbd('0x170')],{'as':'Applications'});db[_0xcbbd('0x3f')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':'ListId'});db[_0xcbbd('0x3f')][_0xcbbd('0x127')](db[_0xcbbd('0x99')],{'as':_0xcbbd('0x99'),'foreignKey':_0xcbbd('0x172')});db['MailAccount'][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':_0xcbbd('0x15b'),'foreignKey':_0xcbbd('0x173')});db[_0xcbbd('0x3f')][_0xcbbd('0x12a')](db['User'],{'as':'Agents','through':_0xcbbd('0x144')});db[_0xcbbd('0x41')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x139')});db[_0xcbbd('0x41')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':'team_has_mail_queues','as':_0xcbbd('0x15f')});db[_0xcbbd('0x45')][_0xcbbd('0x11b')](db['MailMessage'],{'as':_0xcbbd('0x163'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x174')});db[_0xcbbd('0x45')][_0xcbbd('0x127')](db[_0xcbbd('0x3f')],{'as':_0xcbbd('0x175'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':'Contact','foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x45')][_0xcbbd('0x127')](db['User'],{'as':_0xcbbd('0x177'),'foreignKey':'UserId'});db[_0xcbbd('0x45')]['belongsToMany'](db['Tag'],{'through':_0xcbbd('0x178'),'as':'Tags'});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0xcbbd('0x178'),'as':_0xcbbd('0x179')});db[_0xcbbd('0x45')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x17a'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0xcbbd('0x47')]['hasMany'](db[_0xcbbd('0xf2')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0xcbbd('0x127')](db['User'],{'as':_0xcbbd('0x14')});db[_0xcbbd('0x47')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x17b')});db[_0xcbbd('0x47')][_0xcbbd('0x127')](db[_0xcbbd('0x45')],{'as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x174')});db[_0xcbbd('0x47')][_0xcbbd('0x127')](db[_0xcbbd('0x3f')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x168')});db[_0xcbbd('0x47')]['belongsTo'](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x13f'),'foreignKey':_0xcbbd('0x17d')});db['MailMessage'][_0xcbbd('0x127')](db[_0xcbbd('0x6f')],{'as':_0xcbbd('0x6f'),'foreignKey':'ChatOfflineMessageId'});db[_0xcbbd('0x170')][_0xcbbd('0x127')](db['User'],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x170')][_0xcbbd('0x127')](db[_0xcbbd('0x41')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x170')][_0xcbbd('0x127')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0xcbbd('0x127')](db[_0xcbbd('0x8a')],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x170')][_0xcbbd('0x127')](db[_0xcbbd('0x93')],{'onDelete':'restrict','foreignKey':_0xcbbd('0x17e')});db['MailQueueReport']['belongsTo'](db[_0xcbbd('0x3f')],{});db[_0xcbbd('0x4a')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x4a')]['belongsTo'](db['CmContact'],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x4a')][_0xcbbd('0x127')](db[_0xcbbd('0x45')],{});db['MailQueueReport']['belongsTo'](db[_0xcbbd('0x47')],{});db[_0xcbbd('0x4a')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{});db[_0xcbbd('0x4a')][_0xcbbd('0x127')](db[_0xcbbd('0x41')],{});db[_0xcbbd('0x4c')][_0xcbbd('0x11b')](db['DashboardItem'],{'as':_0xcbbd('0x180'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x4f')][_0xcbbd('0x11b')](db[_0xcbbd('0x87')],{'as':_0xcbbd('0x181'),'foreignKey':'FaxAccountId','onDelete':_0xcbbd('0x119')});db['FaxAccount'][_0xcbbd('0x11b')](db[_0xcbbd('0x182')],{'as':'Answers','foreignKey':_0xcbbd('0x183')});db[_0xcbbd('0x4f')]['hasMany'](db[_0xcbbd('0x122')],{'as':'Interactions'});db[_0xcbbd('0x4f')][_0xcbbd('0x11b')](db[_0xcbbd('0x51')],{'as':'Applications'});db[_0xcbbd('0x4f')][_0xcbbd('0x11b')](db[_0xcbbd('0x1a')],{'as':_0xcbbd('0x184'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x4f')][_0xcbbd('0x11b')](db[_0xcbbd('0x53')],{'as':_0xcbbd('0x163')});db[_0xcbbd('0x4f')][_0xcbbd('0x127')](db['Trunk'],{'as':'Trunk'});db[_0xcbbd('0x4f')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':'ListId'});db[_0xcbbd('0x4f')]['belongsTo'](db[_0xcbbd('0x15a')],{'as':_0xcbbd('0x15b'),'foreignKey':_0xcbbd('0x173')});db['FaxAccount']['belongsToMany'](db[_0xcbbd('0x14')],{'as':'Agents','through':'user_has_fax_accounts'});db['FaxApplication'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x51')][_0xcbbd('0x127')](db[_0xcbbd('0x54')],{'onDelete':'restrict'});db[_0xcbbd('0x51')][_0xcbbd('0x127')](db[_0xcbbd('0x4f')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x51')]['belongsTo'](db[_0xcbbd('0x93')],{'onDelete':'restrict','foreignKey':_0xcbbd('0x17e')});db[_0xcbbd('0x122')][_0xcbbd('0x11b')](db[_0xcbbd('0x53')],{'as':_0xcbbd('0x163'),'onDelete':'cascade','foreignKey':_0xcbbd('0x185')});db[_0xcbbd('0x122')][_0xcbbd('0x127')](db[_0xcbbd('0x4f')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x183')});db[_0xcbbd('0x122')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x122')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x177'),'foreignKey':'UserId'});db[_0xcbbd('0x122')]['belongsToMany'](db['Tag'],{'through':_0xcbbd('0x186'),'as':_0xcbbd('0x187')});db['FaxInteraction'][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':'fax_interaction_has_tags','as':_0xcbbd('0x179')});db['FaxInteraction']['belongsToMany'](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x17a'),'through':'user_has_fax_interactions','foreignKey':_0xcbbd('0x185')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':'cascade','as':_0xcbbd('0x14')});db[_0xcbbd('0x53')][_0xcbbd('0x127')](db[_0xcbbd('0x122')],{'as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x185')});db['FaxMessage'][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x17b')});db['FaxMessage'][_0xcbbd('0x127')](db[_0xcbbd('0xf2')],{'as':_0xcbbd('0xf2'),'foreignKey':_0xcbbd('0x188')});db[_0xcbbd('0x53')]['belongsTo'](db['FaxAccount'],{'as':_0xcbbd('0x175'),'foreignKey':'FaxAccountId'});db[_0xcbbd('0x54')]['belongsToMany'](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x34')});db[_0xcbbd('0x54')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':_0xcbbd('0x189'),'as':_0xcbbd('0x15f')});db[_0xcbbd('0x56')][_0xcbbd('0x127')](db['FaxAccount'],{});db['FaxQueueReport'][_0xcbbd('0x127')](db['CmList'],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db['FaxQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x56')][_0xcbbd('0x127')](db['FaxInteraction'],{});db[_0xcbbd('0x56')]['belongsTo'](db['FaxMessage'],{});db[_0xcbbd('0x56')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{});db[_0xcbbd('0x56')][_0xcbbd('0x127')](db['FaxQueue'],{});db[_0xcbbd('0x58')][_0xcbbd('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcbbd('0x18a'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x58')][_0xcbbd('0x11b')](db['CannedAnswer'],{'as':_0xcbbd('0x16e'),'foreignKey':_0xcbbd('0x18a')});db['SmsAccount']['hasMany'](db['SmsMessage'],{'as':_0xcbbd('0x163'),'foreignKey':_0xcbbd('0x18a')});db[_0xcbbd('0x58')][_0xcbbd('0x11b')](db[_0xcbbd('0x5b')],{'as':_0xcbbd('0x16f')});db[_0xcbbd('0x58')][_0xcbbd('0x11b')](db[_0xcbbd('0x5a')],{'as':_0xcbbd('0x14d')});db[_0xcbbd('0x58')]['belongsTo'](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':'ListId'});db[_0xcbbd('0x58')][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':'mandatoryDispositionPause','foreignKey':_0xcbbd('0x173')});db[_0xcbbd('0x58')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x18b')});db[_0xcbbd('0x5a')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x5a')][_0xcbbd('0x127')](db['SmsQueue'],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x5a')][_0xcbbd('0x127')](db[_0xcbbd('0x58')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x5a')][_0xcbbd('0x127')](db[_0xcbbd('0x8a')],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x5a')][_0xcbbd('0x127')](db['Tag'],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x17e')});db[_0xcbbd('0x5b')][_0xcbbd('0x11b')](db['SmsMessage'],{'as':_0xcbbd('0x163'),'onDelete':'cascade','foreignKey':_0xcbbd('0x18c')});db[_0xcbbd('0x5b')][_0xcbbd('0x127')](db['SmsAccount'],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x18a')});db['SmsInteraction'][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':'ContactId'});db['SmsInteraction'][_0xcbbd('0x127')](db['User'],{'as':'Owner','foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x5b')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x18d'),'as':_0xcbbd('0x187')});db[_0xcbbd('0x5b')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x18d'),'as':_0xcbbd('0x179')});db[_0xcbbd('0x5b')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x17a'),'through':'user_has_sms_interactions','foreignKey':_0xcbbd('0x18c')});db[_0xcbbd('0x5c')]['belongsTo'](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x14')});db[_0xcbbd('0x5c')]['belongsTo'](db[_0xcbbd('0x78')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x17b')});db['SmsMessage'][_0xcbbd('0x127')](db['SmsInteraction'],{'onDelete':'cascade','as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x18c')});db[_0xcbbd('0x5c')][_0xcbbd('0x127')](db[_0xcbbd('0x58')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x18a')});db[_0xcbbd('0x5e')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x36'),'foreignKey':_0xcbbd('0x18e')});db[_0xcbbd('0x5e')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount'][_0xcbbd('0x11b')](db[_0xcbbd('0x87')],{'as':_0xcbbd('0x181'),'foreignKey':_0xcbbd('0x18f'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x5f')][_0xcbbd('0x11b')](db['CannedAnswer'],{'as':_0xcbbd('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0xcbbd('0x5f')][_0xcbbd('0x11b')](db[_0xcbbd('0x62')],{'as':'Interactions','foreignKey':_0xcbbd('0x18f')});db[_0xcbbd('0x5f')][_0xcbbd('0x11b')](db[_0xcbbd('0x63')],{'as':_0xcbbd('0x163'),'foreignKey':_0xcbbd('0x18f')});db[_0xcbbd('0x5f')][_0xcbbd('0x11b')](db[_0xcbbd('0x61')],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xcbbd('0x5f')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x5f')][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':_0xcbbd('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x190')});db[_0xcbbd('0x61')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x61')][_0xcbbd('0x127')](db['OpenchannelQueue'],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x191')});db[_0xcbbd('0x61')][_0xcbbd('0x127')](db[_0xcbbd('0x5f')],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x18f')});db[_0xcbbd('0x61')]['belongsTo'](db['Interval'],{'onDelete':_0xcbbd('0x16b'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x61')]['belongsTo'](db[_0xcbbd('0x93')],{'onDelete':_0xcbbd('0x16b'),'foreignKey':'TagId'});db[_0xcbbd('0x62')][_0xcbbd('0x11b')](db[_0xcbbd('0x63')],{'as':_0xcbbd('0x163'),'onDelete':_0xcbbd('0x119'),'foreignKey':'OpenchannelInteractionId'});db[_0xcbbd('0x62')]['belongsTo'](db[_0xcbbd('0x5f')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x18f')});db[_0xcbbd('0x62')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x62')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x177'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x62')]['belongsToMany'](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x192'),'as':_0xcbbd('0x187')});db[_0xcbbd('0x62')]['belongsToMany'](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x192'),'as':_0xcbbd('0x179')});db[_0xcbbd('0x62')][_0xcbbd('0x12a')](db['User'],{'as':'Users','through':_0xcbbd('0x193'),'foreignKey':_0xcbbd('0x194')});db['OpenchannelMessage'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x14')});db[_0xcbbd('0x63')][_0xcbbd('0x127')](db['CmContact'],{'onDelete':_0xcbbd('0x119'),'as':'Contact'});db[_0xcbbd('0x63')][_0xcbbd('0x127')](db['OpenchannelInteraction'],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x194')});db[_0xcbbd('0x63')][_0xcbbd('0x127')](db[_0xcbbd('0xf2')],{'as':_0xcbbd('0xf2'),'foreignKey':_0xcbbd('0x188')});db['OpenchannelMessage'][_0xcbbd('0x127')](db[_0xcbbd('0x5f')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x38'),'foreignKey':_0xcbbd('0x191')});db[_0xcbbd('0x65')]['belongsToMany'](db[_0xcbbd('0xec')],{'through':'team_has_openchannel_queues','as':_0xcbbd('0x15f')});db[_0xcbbd('0x13f')][_0xcbbd('0x11b')](db[_0xcbbd('0x87')],{'as':'Dispositions','foreignKey':_0xcbbd('0x17d'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x13f')]['hasMany'](db[_0xcbbd('0x182')],{'as':_0xcbbd('0x16e'),'foreignKey':_0xcbbd('0x17d')});db['ChatWebsite'][_0xcbbd('0x11b')](db[_0xcbbd('0x75')],{'as':'ProactiveActions'});db[_0xcbbd('0x13f')][_0xcbbd('0x11b')](db[_0xcbbd('0x6b')],{'as':_0xcbbd('0x16f')});db[_0xcbbd('0x13f')]['hasMany'](db[_0xcbbd('0x69')],{'as':'Applications'});db[_0xcbbd('0x13f')][_0xcbbd('0x11b')](db['ChatMessage'],{'as':'Messages'});db[_0xcbbd('0x13f')]['belongsTo'](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x13f')][_0xcbbd('0x127')](db[_0xcbbd('0x8a')],{'as':_0xcbbd('0x8a'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x13f')][_0xcbbd('0x127')](db[_0xcbbd('0x3f')],{'as':'MailAccount','foreignKey':_0xcbbd('0x168')});db[_0xcbbd('0x13f')][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':_0xcbbd('0x15b'),'foreignKey':_0xcbbd('0x173')});db[_0xcbbd('0x13f')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x195')});db['OpenchannelQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x5f')],{});db[_0xcbbd('0x67')]['belongsTo'](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x67')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0xcbbd('0x67')][_0xcbbd('0x127')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xcbbd('0x127')](db['User'],{});db[_0xcbbd('0x67')][_0xcbbd('0x127')](db[_0xcbbd('0x65')],{});db[_0xcbbd('0x69')][_0xcbbd('0x127')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xcbbd('0x69')][_0xcbbd('0x127')](db[_0xcbbd('0x71')],{'as':_0xcbbd('0x196'),'foreignKey':_0xcbbd('0x197'),'onDelete':'restrict'});db[_0xcbbd('0x69')]['belongsTo'](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x198'),'foreignKey':'ChatWebsiteId','onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x69')][_0xcbbd('0x127')](db[_0xcbbd('0x93')],{'onDelete':'restrict','foreignKey':'TagId'});db['ChatInteraction'][_0xcbbd('0x11b')](db[_0xcbbd('0x6d')],{'as':_0xcbbd('0x163'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x199')});db[_0xcbbd('0x6b')]['belongsTo'](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x17d')});db[_0xcbbd('0x6b')][_0xcbbd('0x127')](db['CmContact'],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x6b')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x177'),'foreignKey':_0xcbbd('0x11a')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0xcbbd('0x19a'),'as':'Tags'});db[_0xcbbd('0x6b')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x19a'),'as':'ThroughTags'});db[_0xcbbd('0x6b')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x17a'),'through':'user_has_chat_interactions','foreignKey':_0xcbbd('0x199')});db[_0xcbbd('0x6d')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x14')});db[_0xcbbd('0x6d')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'onDelete':_0xcbbd('0x119'),'as':'Contact','foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x6d')][_0xcbbd('0x127')](db[_0xcbbd('0x6b')],{'onDelete':'cascade','as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x199')});db[_0xcbbd('0x6d')][_0xcbbd('0x127')](db[_0xcbbd('0xf2')],{'as':_0xcbbd('0xf2'),'foreignKey':_0xcbbd('0x188')});db['ChatMessage'][_0xcbbd('0x127')](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x175'),'foreignKey':'ChatWebsiteId'});db[_0xcbbd('0x6f')][_0xcbbd('0x11b')](db[_0xcbbd('0xf2')],{'as':_0xcbbd('0x19b'),'foreignKey':_0xcbbd('0x19c'),'onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0x6f')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'onDelete':_0xcbbd('0x119'),'as':_0xcbbd('0x17b'),'foreignKey':'ContactId'});db[_0xcbbd('0x6f')]['belongsTo'](db[_0xcbbd('0x13f')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x17d')});db[_0xcbbd('0x71')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':'UserChatQueue','hooks':!![]});db[_0xcbbd('0x71')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':_0xcbbd('0x19d'),'as':_0xcbbd('0x15f')});db[_0xcbbd('0x73')][_0xcbbd('0x11b')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xcbbd('0x19e'),'onDelete':_0xcbbd('0x119')});db['ChatGroup'][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x151'),'through':_0xcbbd('0x19f')});db[_0xcbbd('0x75')]['belongsTo'](db['ChatWebsite'],{'as':_0xcbbd('0x198'),'foreignKey':_0xcbbd('0x17d')});db[_0xcbbd('0x1a0')][_0xcbbd('0x11b')](db['CmContact'],{'as':_0xcbbd('0x12c'),'foreignKey':_0xcbbd('0x1a1')});db['CmContact'][_0xcbbd('0x11b')](db[_0xcbbd('0x97')],{'as':_0xcbbd('0x1a2'),'foreignKey':_0xcbbd('0x1a3')});db['CmContact'][_0xcbbd('0x11b')](db[_0xcbbd('0x1a4')],{'as':_0xcbbd('0x152'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db[_0xcbbd('0x7d')],{'as':'HopperFinals','foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db['CmHopperHistory'],{'as':_0xcbbd('0x154'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db[_0xcbbd('0x120')],{'as':_0xcbbd('0x120'),'foreignKey':'ContactId'});db['CmContact'][_0xcbbd('0x11b')](db[_0xcbbd('0xdc')],{'as':_0xcbbd('0x156'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db[_0xcbbd('0x62')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db['ChatInteraction'],{'as':_0xcbbd('0x1a5'),'foreignKey':_0xcbbd('0x176'),'onDelete':'restrict'});db['CmContact'][_0xcbbd('0x11b')](db[_0xcbbd('0x5b')],{'as':_0xcbbd('0x134'),'foreignKey':_0xcbbd('0x176'),'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db[_0xcbbd('0x122')],{'as':_0xcbbd('0x132'),'foreignKey':'ContactId','onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x78')][_0xcbbd('0x11b')](db[_0xcbbd('0x45')],{'as':'MailInteractions','foreignKey':_0xcbbd('0x176'),'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x78')][_0xcbbd('0x127')](db['CmCompany'],{'as':_0xcbbd('0x1a6'),'foreignKey':_0xcbbd('0x1a1')});db[_0xcbbd('0x78')][_0xcbbd('0x127')](db['CmList'],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f'),'onDelete':'cascade'});db[_0xcbbd('0x78')][_0xcbbd('0x12a')](db['User'],{'as':_0xcbbd('0x17a'),'through':'cm_user_has_contacts'});db[_0xcbbd('0x78')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'as':_0xcbbd('0x187'),'through':_0xcbbd('0x1a7')});db[_0xcbbd('0x78')]['belongsToMany'](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x1a7'),'as':_0xcbbd('0x179')});db['CmHopper'][_0xcbbd('0x11b')](db[_0xcbbd('0x1a8')],{'as':'AdditionalPhones','foreignKey':_0xcbbd('0x1a9')});db[_0xcbbd('0x1a4')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':'Contact','foreignKey':_0xcbbd('0x176'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x1a4')][_0xcbbd('0x127')](db['CmList'],{'as':_0xcbbd('0x171'),'foreignKey':'ListId','onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x1a4')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x1aa'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x1a4')]['belongsTo'](db['VoiceQueue'],{'as':_0xcbbd('0x196'),'foreignKey':_0xcbbd('0x153'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x1a4')]['belongsTo'](db['Campaign'],{'as':_0xcbbd('0x1ab'),'foreignKey':_0xcbbd('0x1ac'),'onDelete':_0xcbbd('0x119')});db['CmHopper'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x177'),'foreignKey':'OwnerId'});db[_0xcbbd('0x7b')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x7b')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':'ListId','onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x7b')][_0xcbbd('0x127')](db[_0xcbbd('0x1c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xcbbd('0x7b')][_0xcbbd('0x127')](db[_0xcbbd('0x1ab')],{'as':_0xcbbd('0x1ab'),'foreignKey':'CampaignId','onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x84')][_0xcbbd('0x11b')](db[_0xcbbd('0x89')],{'as':{'plural':_0xcbbd('0x1ad'),'singular':_0xcbbd('0x1ae')},'foreignKey':_0xcbbd('0x1af'),'onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0x84')][_0xcbbd('0x11b')](db[_0xcbbd('0x89')],{'as':{'plural':_0xcbbd('0x1b0'),'singular':_0xcbbd('0x1b1')},'foreignKey':_0xcbbd('0x1b2'),'onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0x84')][_0xcbbd('0x11b')](db[_0xcbbd('0x83')],{'as':_0xcbbd('0x1b3'),'foreignKey':_0xcbbd('0x1b4'),'onDelete':'cascade','hooks':!![]});db[_0xcbbd('0x87')]['hasMany'](db['Disposition'],{'as':_0xcbbd('0x181'),'foreignKey':_0xcbbd('0x1b5'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x8a')]['hasMany'](db[_0xcbbd('0x8a')],{'as':'Intervals','foreignKey':_0xcbbd('0x159'),'onDelete':_0xcbbd('0x119'),'hooks':!![],'required':![]});db[_0xcbbd('0x8a')][_0xcbbd('0x11b')](db[_0xcbbd('0x1a')],{'as':_0xcbbd('0x11d'),'foreignKey':_0xcbbd('0x159'),'onDelete':'restrict'});db[_0xcbbd('0x8a')][_0xcbbd('0x11b')](db[_0xcbbd('0x170')],{'as':_0xcbbd('0x1b6'),'foreignKey':'IntervalId'});db[_0xcbbd('0x8a')]['hasMany'](db[_0xcbbd('0x69')],{'as':_0xcbbd('0x1b7'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x8a')][_0xcbbd('0x11b')](db[_0xcbbd('0x51')],{'as':_0xcbbd('0x1b8'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x8a')][_0xcbbd('0x11b')](db[_0xcbbd('0x5a')],{'as':_0xcbbd('0x1b9'),'foreignKey':'IntervalId'});db[_0xcbbd('0x90')]['belongsTo'](db[_0xcbbd('0x3f')],{});db[_0xcbbd('0x90')]['belongsTo'](db[_0xcbbd('0xa2')],{'foreignKey':_0xcbbd('0x1ba')});db[_0xcbbd('0x90')][_0xcbbd('0x127')](db['AnalyticCustomReport'],{'foreignKey':_0xcbbd('0x1bb')});db['Sound']['belongsToMany'](db[_0xcbbd('0x1bc')],{'as':'Mohs','through':_0xcbbd('0x150'),'onDelete':_0xcbbd('0x16b')});db['Tag'][_0xcbbd('0x12a')](db[_0xcbbd('0x78')],{'through':_0xcbbd('0x1a7')});db[_0xcbbd('0x93')]['belongsToMany'](db[_0xcbbd('0x6b')],{'through':'chat_interaction_has_tags'});db[_0xcbbd('0x93')]['belongsToMany'](db[_0xcbbd('0x45')],{'through':_0xcbbd('0x178')});db[_0xcbbd('0x93')][_0xcbbd('0x12a')](db[_0xcbbd('0x5b')],{'through':_0xcbbd('0x18d')});db[_0xcbbd('0x93')][_0xcbbd('0x12a')](db['FaxInteraction'],{'through':_0xcbbd('0x186')});db['Tag'][_0xcbbd('0x12a')](db[_0xcbbd('0x62')],{'through':'openchannel_interaction_has_tags'});db[_0xcbbd('0x93')][_0xcbbd('0x12a')](db[_0xcbbd('0x108')],{'through':_0xcbbd('0x1bd')});db[_0xcbbd('0x97')][_0xcbbd('0x127')](db[_0xcbbd('0x95')],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0xcbbd('0x1a8')]['belongsTo'](db[_0xcbbd('0x1a4')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0xcbbd('0x97')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':'CmContactId'});db[_0xcbbd('0x1be')]['hasMany'](db[_0xcbbd('0x89')],{'as':{'plural':_0xcbbd('0x1bf'),'singular':_0xcbbd('0x1c0')},'foreignKey':_0xcbbd('0x1c1'),'onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0x1be')]['hasMany'](db['Condition'],{'as':{'plural':_0xcbbd('0x1c2'),'singular':_0xcbbd('0x1c3')},'foreignKey':_0xcbbd('0x1c4'),'onDelete':'cascade','hooks':!![]});db[_0xcbbd('0x1be')]['hasMany'](db[_0xcbbd('0x83')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0xa0')]['hasMany'](db[_0xcbbd('0xa6')],{'as':_0xcbbd('0x1c5'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xcbbd('0xa2')][_0xcbbd('0x11b')](db[_0xcbbd('0xa6')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':'DefaultReportId'});db[_0xcbbd('0xa5')][_0xcbbd('0x11b')](db[_0xcbbd('0xa6')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0xcbbd('0x127')](db[_0xcbbd('0xa5')],{'foreignKey':_0xcbbd('0x1c6')});db[_0xcbbd('0xaa')][_0xcbbd('0x11b')](db[_0xcbbd('0xac')],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xac')][_0xcbbd('0x11b')](db[_0xcbbd('0xae')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xcbbd('0xac')][_0xcbbd('0x11b')](db[_0xcbbd('0xae')],{'as':'Descriptions','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xac')][_0xcbbd('0x11b')](db[_0xcbbd('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xcbbd('0x127')](db['SalesforceAccount'],{'as':_0xcbbd('0x175'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db[_0xcbbd('0xae')],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xae')]['hasMany'](db[_0xcbbd('0xae')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xae')][_0xcbbd('0x11b')](db[_0xcbbd('0xae')],{'as':_0xcbbd('0x1cd'),'foreignKey':'FieldId'});db[_0xcbbd('0xae')]['belongsTo'](db[_0xcbbd('0x9b')],{'as':'Variable','foreignKey':_0xcbbd('0x1ce')});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xaf')][_0xcbbd('0x11b')](db[_0xcbbd('0xb1')],{'as':_0xcbbd('0x1cf'),'onDelete':'cascade','foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xaf')][_0xcbbd('0x11b')](db[_0xcbbd('0xb1')],{'as':_0xcbbd('0x1d0'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xaf')][_0xcbbd('0x11b')](db[_0xcbbd('0xb1')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1d1')});db['SugarcrmConfiguration'][_0xcbbd('0x127')](db[_0xcbbd('0x1d2')],{'as':_0xcbbd('0x175'),'foreignKey':'AccountId'});db[_0xcbbd('0xb1')][_0xcbbd('0x11b')](db[_0xcbbd('0xb1')],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xb1')][_0xcbbd('0x11b')](db['SugarcrmField'],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db['SugarcrmField'][_0xcbbd('0x11b')](db[_0xcbbd('0xb1')],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db['SugarcrmField'][_0xcbbd('0x127')](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xb3')][_0xcbbd('0x11b')](db[_0xcbbd('0x1d3')],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0x1d3')]['hasMany'](db[_0xcbbd('0x1d4')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration'][_0xcbbd('0x11b')](db[_0xcbbd('0x1d4')],{'as':_0xcbbd('0x1d0'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0x1d3')][_0xcbbd('0x11b')](db[_0xcbbd('0x1d4')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0x1d3')][_0xcbbd('0x127')](db[_0xcbbd('0xb3')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0x1d3')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x1d5')});db[_0xcbbd('0x1d4')][_0xcbbd('0x11b')](db['DeskField'],{'as':_0xcbbd('0x1ca'),'foreignKey':'SubjectId'});db[_0xcbbd('0x1d4')][_0xcbbd('0x11b')](db['DeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['DeskField']['hasMany'](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xcbbd('0x1d4')][_0xcbbd('0x127')](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db['ZohoAccount'][_0xcbbd('0x11b')](db[_0xcbbd('0xb4')],{'as':_0xcbbd('0x1c7'),'onDelete':'cascade','foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xb4')][_0xcbbd('0x11b')](db['ZohoField'],{'as':_0xcbbd('0x1cf'),'onDelete':'cascade','foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xb4')]['hasMany'](db[_0xcbbd('0xb6')],{'as':_0xcbbd('0x1d0'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xb4')][_0xcbbd('0x11b')](db[_0xcbbd('0xb6')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0xb4')][_0xcbbd('0x127')](db[_0xcbbd('0x1d6')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1c8')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xb6')][_0xcbbd('0x11b')](db[_0xcbbd('0xb6')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xb6')][_0xcbbd('0x11b')](db[_0xcbbd('0xb6')],{'as':_0xcbbd('0x1cd'),'foreignKey':'FieldId'});db[_0xcbbd('0xb6')][_0xcbbd('0x127')](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xb8')][_0xcbbd('0x11b')](db[_0xcbbd('0xb9')],{'as':'Configurations','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xb9')]['hasMany'](db[_0xcbbd('0xba')],{'as':'Subjects','foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xb9')][_0xcbbd('0x11b')](db['ZendeskField'],{'as':_0xcbbd('0x1d0'),'foreignKey':_0xcbbd('0x1c9')});db['ZendeskConfiguration'][_0xcbbd('0x11b')](db[_0xcbbd('0xba')],{'as':_0xcbbd('0x1c5'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0xb9')]['belongsTo'](db[_0xcbbd('0xb8')],{'as':'Account','foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xb9')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x1d7')});db[_0xcbbd('0xba')][_0xcbbd('0x11b')](db['ZendeskField'],{'as':_0xcbbd('0x1ca'),'foreignKey':'SubjectId'});db['ZendeskField'][_0xcbbd('0x11b')](db[_0xcbbd('0xba')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db['ZendeskField'][_0xcbbd('0x11b')](db['ZendeskField'],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db['ZendeskField'][_0xcbbd('0x127')](db['Variable'],{'as':'Variable','foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xbc')][_0xcbbd('0x11b')](db['FreshdeskConfiguration'],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xbd')]['hasMany'](db[_0xcbbd('0xbf')],{'as':'Subjects','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xbd')][_0xcbbd('0x11b')](db[_0xcbbd('0xbf')],{'as':_0xcbbd('0x1d0'),'onDelete':_0xcbbd('0x119'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xcbbd('0x11b')](db['FreshdeskField'],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0xbd')][_0xcbbd('0x127')](db[_0xcbbd('0xbc')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xbd')][_0xcbbd('0x12a')](db['Tag'],{'through':_0xcbbd('0x1d8')});db[_0xcbbd('0xbf')]['hasMany'](db[_0xcbbd('0xbf')],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xbf')][_0xcbbd('0x11b')](db[_0xcbbd('0xbf')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xbf')][_0xcbbd('0x11b')](db[_0xcbbd('0xbf')],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db['FreshdeskField']['belongsTo'](db['Variable'],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db['VtigerAccount'][_0xcbbd('0x11b')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xc2')][_0xcbbd('0x11b')](db[_0xcbbd('0xc4')],{'as':_0xcbbd('0x1cf'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xc2')]['hasMany'](db[_0xcbbd('0xc4')],{'as':_0xcbbd('0x1d0'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xcbbd('0x11b')](db[_0xcbbd('0xc4')],{'as':_0xcbbd('0x1c5'),'foreignKey':'FieldId'});db[_0xcbbd('0xc2')]['belongsTo'](db[_0xcbbd('0xc1')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1c8')});db['VtigerField'][_0xcbbd('0x11b')](db[_0xcbbd('0xc4')],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xc4')][_0xcbbd('0x11b')](db['VtigerField'],{'as':'Description','foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xc4')][_0xcbbd('0x11b')](db[_0xcbbd('0xc4')],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0xc4')]['belongsTo'](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xc6')][_0xcbbd('0x11b')](db[_0xcbbd('0x1d9')],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0x1d9')][_0xcbbd('0x11b')](db[_0xcbbd('0x1da')],{'as':'Subjects','foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0x1d9')][_0xcbbd('0x11b')](db[_0xcbbd('0x1da')],{'as':_0xcbbd('0x1d0'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0x1d9')]['hasMany'](db[_0xcbbd('0x1da')],{'as':_0xcbbd('0x1c5'),'foreignKey':_0xcbbd('0x1d1')});db['ServicenowConfiguration'][_0xcbbd('0x127')](db[_0xcbbd('0xc6')],{'as':_0xcbbd('0x175'),'foreignKey':'AccountId'});db[_0xcbbd('0x1da')][_0xcbbd('0x11b')](db['ServicenowField'],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0x1da')]['hasMany'](db[_0xcbbd('0x1da')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0x1da')][_0xcbbd('0x11b')](db[_0xcbbd('0x1da')],{'as':_0xcbbd('0x1cd'),'foreignKey':'FieldId'});db[_0xcbbd('0x1da')][_0xcbbd('0x127')](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xc9')][_0xcbbd('0x11b')](db[_0xcbbd('0x1db')],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xc9')]['belongsTo'](db[_0xcbbd('0x169')],{'as':_0xcbbd('0x169'),'foreignKey':'CloudProviderId'});db[_0xcbbd('0x1db')][_0xcbbd('0x11b')](db[_0xcbbd('0xcb')],{'as':_0xcbbd('0x1cf'),'onDelete':'cascade','foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xcbbd('0x11b')](db[_0xcbbd('0xcb')],{'as':_0xcbbd('0x1d0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0xcbbd('0x11b')](db[_0xcbbd('0xcb')],{'as':_0xcbbd('0x1c5'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0x1db')][_0xcbbd('0x127')](db[_0xcbbd('0xc9')],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1c8')});db['Dynamics365Field'][_0xcbbd('0x11b')](db['Dynamics365Field'],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xcb')]['hasMany'](db[_0xcbbd('0xcb')],{'as':_0xcbbd('0x1cc'),'foreignKey':'DescriptionId'});db[_0xcbbd('0xcb')][_0xcbbd('0x11b')](db[_0xcbbd('0xcb')],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db['Dynamics365Field'][_0xcbbd('0x127')](db[_0xcbbd('0x9b')],{'as':'Variable','foreignKey':_0xcbbd('0x1ce')});db['FreshsalesAccount'][_0xcbbd('0x11b')](db[_0xcbbd('0xcf')],{'as':_0xcbbd('0x1c7'),'onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xcf')]['hasMany'](db[_0xcbbd('0xd1')],{'as':_0xcbbd('0x1cf'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xcf')]['hasMany'](db['FreshsalesField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xcbbd('0xcf')]['hasMany'](db[_0xcbbd('0xd1')],{'as':_0xcbbd('0x1c5'),'foreignKey':'FieldId'});db[_0xcbbd('0xcf')][_0xcbbd('0x127')](db[_0xcbbd('0xcd')],{'as':'Account','foreignKey':_0xcbbd('0x1c8')});db[_0xcbbd('0xd1')][_0xcbbd('0x11b')](db[_0xcbbd('0xd1')],{'as':_0xcbbd('0x1ca'),'foreignKey':_0xcbbd('0x1cb')});db[_0xcbbd('0xd1')][_0xcbbd('0x11b')](db[_0xcbbd('0xd1')],{'as':_0xcbbd('0x1cc'),'foreignKey':_0xcbbd('0x1c9')});db[_0xcbbd('0xd1')][_0xcbbd('0x11b')](db[_0xcbbd('0xd1')],{'as':_0xcbbd('0x1cd'),'foreignKey':_0xcbbd('0x1d1')});db[_0xcbbd('0xd1')]['belongsTo'](db[_0xcbbd('0x9b')],{'as':_0xcbbd('0x9b'),'foreignKey':_0xcbbd('0x1ce')});db[_0xcbbd('0xd5')][_0xcbbd('0x127')](db[_0xcbbd('0x13f')],{});db['ChatQueueReport']['belongsTo'](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0xd5')][_0xcbbd('0x127')](db['CmContact'],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db[_0xcbbd('0xd5')][_0xcbbd('0x127')](db[_0xcbbd('0x6b')],{});db[_0xcbbd('0xd5')]['belongsTo'](db[_0xcbbd('0x6d')],{});db[_0xcbbd('0xd5')]['belongsTo'](db[_0xcbbd('0x14')],{});db[_0xcbbd('0xd5')][_0xcbbd('0x127')](db[_0xcbbd('0x71')],{});db['ChatInternalMessage']['belongsTo'](db[_0xcbbd('0x14')],{'onDelete':'cascade','foreignKey':_0xcbbd('0x1dc')});db[_0xcbbd('0xd7')]['belongsTo'](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x119'),'foreignKey':'ToId'});db[_0xcbbd('0xdc')][_0xcbbd('0x11b')](db[_0xcbbd('0xda')],{'foreignKey':_0xcbbd('0x1dd'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0xdc')]['hasMany'](db[_0xcbbd('0x1de')],{'foreignKey':_0xcbbd('0x1dd'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0xde')][_0xcbbd('0x127')](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0xde')][_0xcbbd('0x127')](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':_0xcbbd('0x176')});db['SmsQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x5b')],{});db[_0xcbbd('0xde')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{});db[_0xcbbd('0xde')][_0xcbbd('0x127')](db['SmsQueue'],{});db['JscriptyProject'][_0xcbbd('0x11b')](db[_0xcbbd('0xdc')],{'foreignKey':_0xcbbd('0x1df')});db['JscriptyProject'][_0xcbbd('0x11b')](db['JscriptyQuestionReport'],{'foreignKey':_0xcbbd('0x1df')});db['JscriptyProject'][_0xcbbd('0x11b')](db[_0xcbbd('0x1de')],{'foreignKey':_0xcbbd('0x1df')});db[_0xcbbd('0x147')]['belongsToMany'](db['User'],{'as':_0xcbbd('0x17a'),'through':_0xcbbd('0x149')});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x1e0')});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db[_0xcbbd('0x1c')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db[_0xcbbd('0x41')],{'through':'team_has_mail_queues','as':_0xcbbd('0x138')});db['Team']['belongsToMany'](db[_0xcbbd('0x71')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db['FaxQueue'],{'through':_0xcbbd('0x189'),'as':_0xcbbd('0x13a')});db[_0xcbbd('0xec')]['belongsToMany'](db[_0xcbbd('0x5e')],{'through':'team_has_sms_queues','as':_0xcbbd('0x13b')});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db[_0xcbbd('0x65')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db['WhatsappQueue'],{'through':_0xcbbd('0x1e1'),'as':_0xcbbd('0x13e')});db[_0xcbbd('0xec')][_0xcbbd('0x12a')](db[_0xcbbd('0xfd')],{'through':'TeamVoicePrefix','as':_0xcbbd('0x1e2')});db['Campaign'][_0xcbbd('0x11b')](db[_0xcbbd('0x1a4')],{'as':'Hoppers','foreignKey':_0xcbbd('0x1ac')});db[_0xcbbd('0x1ab')][_0xcbbd('0x11b')](db[_0xcbbd('0x7d')],{'as':_0xcbbd('0x11e'),'foreignKey':_0xcbbd('0x1ac')});db[_0xcbbd('0x1ab')]['hasMany'](db[_0xcbbd('0x7f')],{'as':_0xcbbd('0x154'),'foreignKey':_0xcbbd('0x1ac')});db[_0xcbbd('0x1ab')][_0xcbbd('0x11b')](db[_0xcbbd('0x7b')],{'as':_0xcbbd('0x155'),'foreignKey':'CampaignId'});db['Campaign'][_0xcbbd('0x127')](db[_0xcbbd('0x29')],{'as':_0xcbbd('0x29'),'foreignKey':'TrunkId'});db[_0xcbbd('0x1ab')]['belongsTo'](db[_0xcbbd('0x29')],{'as':_0xcbbd('0x158'),'foreignKey':'TrunkBackupId'});db[_0xcbbd('0x1ab')][_0xcbbd('0x127')](db[_0xcbbd('0x8a')],{'as':_0xcbbd('0x8a'),'foreignKey':_0xcbbd('0x159')});db[_0xcbbd('0x1ab')]['belongsTo'](db[_0xcbbd('0x147')],{'as':_0xcbbd('0x147'),'foreignKey':_0xcbbd('0x1e3')});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0xcbbd('0x15c'),'through':_0xcbbd('0x1e4')});db[_0xcbbd('0x1ab')][_0xcbbd('0x12a')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x160'),'through':'campaigns_has_cm_blacklists'});db[_0xcbbd('0xf2')][_0xcbbd('0x127')](db[_0xcbbd('0x6f')],{'as':'ChatOfflineMessage','foreignKey':_0xcbbd('0x19c')});db[_0xcbbd('0x1e5')]['belongsTo'](db['MailMessage'],{});db[_0xcbbd('0x1e5')]['belongsTo'](db['MailInteraction'],{});db[_0xcbbd('0x1e5')][_0xcbbd('0x127')](db['MailAccount'],{'foreignKey':_0xcbbd('0x1e6'),'as':_0xcbbd('0x1e7')});db[_0xcbbd('0x1e5')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1e8'),'as':_0xcbbd('0x1e9')});db['MailTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1ea'),'as':_0xcbbd('0x1eb')});db['MailTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x41')],{'foreignKey':_0xcbbd('0x1ec'),'as':_0xcbbd('0x1ed')});db[_0xcbbd('0x1e5')][_0xcbbd('0x127')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xcbbd('0x1ee')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0xcbbd('0xf7')]['belongsTo'](db[_0xcbbd('0x6b')],{});db[_0xcbbd('0xf7')][_0xcbbd('0x127')](db['ChatWebsite'],{'foreignKey':_0xcbbd('0x1ef'),'as':_0xcbbd('0x1e7')});db[_0xcbbd('0xf7')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1e8'),'as':_0xcbbd('0x1e9')});db['ChatTransferReport'][_0xcbbd('0x127')](db['User'],{'foreignKey':'ToUserId','as':_0xcbbd('0x1eb')});db['ChatTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x71')],{'foreignKey':_0xcbbd('0x1f0'),'as':_0xcbbd('0x1ed')});db['ChatTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x13f')],{'foreignKey':_0xcbbd('0x1f1'),'as':'ToAccount'});db['FaxTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x53')],{});db[_0xcbbd('0xf8')][_0xcbbd('0x127')](db[_0xcbbd('0x122')],{});db[_0xcbbd('0xf8')][_0xcbbd('0x127')](db['FaxAccount'],{'foreignKey':_0xcbbd('0x1f2'),'as':'FromAccount'});db[_0xcbbd('0xf8')]['belongsTo'](db[_0xcbbd('0x14')],{'foreignKey':'FromUserId','as':_0xcbbd('0x1e9')});db[_0xcbbd('0xf8')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1ea'),'as':'ToAgent'});db[_0xcbbd('0xf8')][_0xcbbd('0x127')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0xcbbd('0x1ed')});db[_0xcbbd('0xf8')][_0xcbbd('0x127')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0xcbbd('0x1ee')});db['OpenchannelTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x63')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xcbbd('0x62')],{});db[_0xcbbd('0xf9')]['belongsTo'](db[_0xcbbd('0x5f')],{'foreignKey':_0xcbbd('0x1f3'),'as':_0xcbbd('0x1e7')});db[_0xcbbd('0xf9')][_0xcbbd('0x127')](db['User'],{'foreignKey':'FromUserId','as':_0xcbbd('0x1e9')});db[_0xcbbd('0xf9')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1ea'),'as':_0xcbbd('0x1eb')});db[_0xcbbd('0xf9')]['belongsTo'](db[_0xcbbd('0x65')],{'foreignKey':_0xcbbd('0x1f4'),'as':'ToQueue'});db[_0xcbbd('0xf9')][_0xcbbd('0x127')](db['OpenchannelAccount'],{'foreignKey':_0xcbbd('0x1f5'),'as':'ToAccount'});db[_0xcbbd('0xfb')][_0xcbbd('0x127')](db['SmsMessage'],{});db[_0xcbbd('0xfb')][_0xcbbd('0x127')](db[_0xcbbd('0x5b')],{});db['SmsTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x58')],{'foreignKey':_0xcbbd('0x1f6'),'as':_0xcbbd('0x1e7')});db['SmsTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1e8'),'as':_0xcbbd('0x1e9')});db[_0xcbbd('0xfb')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1ea'),'as':_0xcbbd('0x1eb')});db[_0xcbbd('0xfb')][_0xcbbd('0x127')](db[_0xcbbd('0x5e')],{'foreignKey':_0xcbbd('0x1f7'),'as':_0xcbbd('0x1ed')});db[_0xcbbd('0xfb')]['belongsTo'](db[_0xcbbd('0x58')],{'foreignKey':_0xcbbd('0x1f8'),'as':'ToAccount'});db[_0xcbbd('0x12e')][_0xcbbd('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcbbd('0x17f'),'onDelete':'cascade'});db['CmList'][_0xcbbd('0x11b')](db[_0xcbbd('0x1f9')],{'as':'CustomFields','foreignKey':_0xcbbd('0x17f')});db['CmList'][_0xcbbd('0x11b')](db['CmContact'],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xcbbd('0x17f')});db['CmList'][_0xcbbd('0x11b')](db[_0xcbbd('0x7d')],{'as':'HopperFinals','foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x12e')]['hasMany'](db[_0xcbbd('0x7f')],{'as':_0xcbbd('0x11f'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x12e')][_0xcbbd('0x11b')](db[_0xcbbd('0x120')],{'as':_0xcbbd('0x120'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x12e')][_0xcbbd('0x12a')](db[_0xcbbd('0x1c')],{'as':_0xcbbd('0x1fa'),'through':_0xcbbd('0x15d')});db[_0xcbbd('0x12e')][_0xcbbd('0x12a')](db['User'],{'as':'Agents','through':'cm_user_has_lists'});db[_0xcbbd('0xfd')][_0xcbbd('0x11b')](db[_0xcbbd('0x1a')],{'as':_0xcbbd('0x11d'),'onDelete':_0xcbbd('0x119')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':'Agents','through':_0xcbbd('0x115')});db[_0xcbbd('0xfd')][_0xcbbd('0x12a')](db[_0xcbbd('0xec')],{'through':_0xcbbd('0x113'),'as':'Teams'});db[_0xcbbd('0x128')][_0xcbbd('0x11b')](db['User'],{'as':_0xcbbd('0x17a'),'foreignKey':_0xcbbd('0x129')});db[_0xcbbd('0x128')][_0xcbbd('0x11b')](db[_0xcbbd('0x100')],{'as':_0xcbbd('0x1fb'),'foreignKey':_0xcbbd('0x129'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x100')][_0xcbbd('0x11b')](db[_0xcbbd('0x101')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0xcbbd('0x119')});db['WhatsappAccount'][_0xcbbd('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcbbd('0x1fc'),'onDelete':_0xcbbd('0x119')});db[_0xcbbd('0x105')]['hasMany'](db[_0xcbbd('0x182')],{'as':_0xcbbd('0x16e'),'foreignKey':_0xcbbd('0x1fc')});db['WhatsappAccount'][_0xcbbd('0x11b')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xcbbd('0x1fc')});db[_0xcbbd('0x105')]['hasMany'](db[_0xcbbd('0x108')],{'as':'Interactions'});db[_0xcbbd('0x105')]['hasMany'](db[_0xcbbd('0x1fd')],{'as':'Applications'});db[_0xcbbd('0x105')][_0xcbbd('0x127')](db[_0xcbbd('0x12e')],{'as':_0xcbbd('0x171'),'foreignKey':_0xcbbd('0x17f')});db[_0xcbbd('0x105')][_0xcbbd('0x127')](db[_0xcbbd('0x15a')],{'as':'mandatoryDispositionPause','foreignKey':_0xcbbd('0x173')});db[_0xcbbd('0x105')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x15e'),'through':_0xcbbd('0x146')});db['WhatsappApplication'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'onDelete':_0xcbbd('0x16b')});db['WhatsappApplication']['belongsTo'](db['WhatsappQueue'],{'onDelete':_0xcbbd('0x16b')});db['WhatsappApplication']['belongsTo'](db['WhatsappAccount'],{'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x1fd')]['belongsTo'](db[_0xcbbd('0x8a')],{'onDelete':_0xcbbd('0x16b'),'foreignKey':'IntervalId'});db[_0xcbbd('0x1fd')][_0xcbbd('0x127')](db[_0xcbbd('0x93')],{'onDelete':'restrict','foreignKey':_0xcbbd('0x17e')});db[_0xcbbd('0x108')][_0xcbbd('0x11b')](db[_0xcbbd('0x10a')],{'as':'Messages','onDelete':_0xcbbd('0x119'),'foreignKey':_0xcbbd('0x1fe')});db[_0xcbbd('0x108')][_0xcbbd('0x127')](db[_0xcbbd('0x105')],{'as':_0xcbbd('0x175'),'foreignKey':'WhatsappAccountId'});db[_0xcbbd('0x108')][_0xcbbd('0x127')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbbd('0x108')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x177'),'foreignKey':_0xcbbd('0x11a')});db[_0xcbbd('0x108')][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x1bd'),'as':'Tags'});db['WhatsappInteraction'][_0xcbbd('0x12a')](db[_0xcbbd('0x93')],{'through':_0xcbbd('0x1bd'),'as':_0xcbbd('0x179')});db[_0xcbbd('0x108')][_0xcbbd('0x12a')](db['User'],{'as':_0xcbbd('0x17a'),'through':_0xcbbd('0x136'),'foreignKey':_0xcbbd('0x1fe')});db[_0xcbbd('0x10a')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x14')});db['WhatsappMessage']['belongsTo'](db[_0xcbbd('0x78')],{'onDelete':'cascade','as':'Contact'});db[_0xcbbd('0x10a')][_0xcbbd('0x127')](db[_0xcbbd('0x108')],{'onDelete':'cascade','as':_0xcbbd('0x17c'),'foreignKey':_0xcbbd('0x1fe')});db[_0xcbbd('0x10a')][_0xcbbd('0x127')](db['WhatsappAccount'],{'as':_0xcbbd('0x175'),'foreignKey':_0xcbbd('0x1fc')});db['WhatsappQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x105')],{});db[_0xcbbd('0x10b')][_0xcbbd('0x127')](db['CmList'],{'as':_0xcbbd('0x171'),'foreignKey':'ListId'});db['WhatsappQueueReport']['belongsTo'](db[_0xcbbd('0x78')],{'as':_0xcbbd('0x17b'),'foreignKey':'ContactId'});db[_0xcbbd('0x10b')][_0xcbbd('0x127')](db[_0xcbbd('0x108')],{});db[_0xcbbd('0x10b')]['belongsTo'](db[_0xcbbd('0x13d')],{});db['WhatsappQueueReport'][_0xcbbd('0x127')](db[_0xcbbd('0x10a')],{});db[_0xcbbd('0x10b')][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{});db[_0xcbbd('0x10d')][_0xcbbd('0x127')](db[_0xcbbd('0x10a')],{});db[_0xcbbd('0x10d')][_0xcbbd('0x127')](db[_0xcbbd('0x108')],{});db[_0xcbbd('0x10d')][_0xcbbd('0x127')](db[_0xcbbd('0x105')],{'foreignKey':'FromWhatsappAccountId','as':_0xcbbd('0x1e7')});db[_0xcbbd('0x10d')][_0xcbbd('0x127')](db['WhatsappAccount'],{'foreignKey':_0xcbbd('0x1ff'),'as':_0xcbbd('0x1ee')});db['WhatsappTransferReport'][_0xcbbd('0x127')](db[_0xcbbd('0x13d')],{'foreignKey':_0xcbbd('0x200'),'as':_0xcbbd('0x1ed')});db[_0xcbbd('0x10d')]['belongsTo'](db[_0xcbbd('0x14')],{'foreignKey':_0xcbbd('0x1e8'),'as':_0xcbbd('0x1e9')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xcbbd('0x1ea'),'as':_0xcbbd('0x1eb')});db[_0xcbbd('0x13d')][_0xcbbd('0x12a')](db[_0xcbbd('0x14')],{'as':'Agents','through':_0xcbbd('0x3a'),'foreignKey':_0xcbbd('0x201')});db[_0xcbbd('0x13d')][_0xcbbd('0x12a')](db['Team'],{'through':_0xcbbd('0x1e1'),'as':_0xcbbd('0x15f')});db['UserSetting'][_0xcbbd('0x127')](db[_0xcbbd('0x14')],{'as':_0xcbbd('0x202'),'foreignKey':'UserId','onDelete':_0xcbbd('0x119'),'hooks':!![]});db[_0xcbbd('0x169')]['hasOne'](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x169')][_0xcbbd('0x118')](db['MailServerIn'],{'as':_0xcbbd('0x16c'),'onDelete':_0xcbbd('0x16b')});db[_0xcbbd('0x169')][_0xcbbd('0x118')](db[_0xcbbd('0x3d')],{'as':'Smtp','onDelete':_0xcbbd('0x16b')});module[_0xcbbd('0x203')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x48bb=['../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','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','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','UserId','hasOne','userSetting','cascade','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','SmsInteraction','SmsInteractions','WhatsappInteractions','UserNotification','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueue','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Applications','Sounds','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','uniqueid','VoiceAgentReport','AgentReports','Contact','MailServerIn','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','MailAccountId','Interactions','List','ListId','TemplateId','Agents','user_has_mail_accounts','Account','ContactId','mail_interaction_has_tags','ThroughTags','MailInteractionId','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','Dashboard','Items','FaxAccount','CannedAnswer','FaxAccountId','FaxInteractionId','Owner','Tags','Users','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueReport','ChatApplication','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','Attachments','team_has_chat_queues','Members','Phones','CmContactId','HopperHistories','Company','cm_contact_has_tags','CmHopperId','OwnerId','CampaignId','OneAll','OneAny','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','moh_has_sounds','fax_interaction_has_tags','whatsapp_interaction_has_tags','Hopper','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','AnalyticFieldReport','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceField','DescriptionId','FieldId','Subject','Description','Descriptions','Field','DeskConfiguration','VariableId','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowAccount','ChatQueueReport','SessionId','JscriptyQuestionReport','JscriptyAnswerReport','ProjectId','team_has_mail_queues','team_has_fax_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','FromUserId','ToUserId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToQueue','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','Queues','UserProfileSections','UserProfileSection','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','user','exports','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage'];(function(_0x553982,_0x17721f){var _0x2f0882=function(_0x28a7f8){while(--_0x28a7f8){_0x553982['push'](_0x553982['shift']());}};_0x2f0882(++_0x17721f);}(_0x48bb,0x1de));var _0xb48b=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x48bb[_0x311909];return _0x8d3163;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xb48b('0x0'));var jstz=require(_0xb48b('0x1'));var timezone=jstz[_0xb48b('0x2')]();config[_0xb48b('0x3')]=_[_0xb48b('0x4')](config[_0xb48b('0x3')],{'database':_0xb48b('0x5'),'username':_0xb48b('0x6'),'password':_0xb48b('0x7'),'options':{'host':_0xb48b('0x8'),'port':0xcea,'dialect':_0xb48b('0x9'),'dialectOptions':{'charset':_0xb48b('0xa')},'logging':![],'timezone':timezone[_0xb48b('0xb')](),'define':{'charset':_0xb48b('0xc'),'collate':_0xb48b('0xd')}}});config[_0xb48b('0xe')]=_[_0xb48b('0x4')](config[_0xb48b('0xe')],{'database':_0xb48b('0x5'),'username':_0xb48b('0x6'),'password':_0xb48b('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xb48b('0xa')},'logging':![],'timezone':timezone[_0xb48b('0xb')](),'define':{'charset':_0xb48b('0xc'),'collate':_0xb48b('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xb48b('0xf')],config['sequelize'][_0xb48b('0x10')],config[_0xb48b('0x3')]['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb48b('0xe')]['database'],config[_0xb48b('0xe')]['username'],config[_0xb48b('0xe')][_0xb48b('0x11')],config[_0xb48b('0xe')][_0xb48b('0x12')])};db[_0xb48b('0x13')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x15'));db['VoiceChanSpy']=db[_0xb48b('0x3')]['import'](_0xb48b('0x16'));db[_0xb48b('0x17')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x18'));db[_0xb48b('0x19')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x1a'));db[_0xb48b('0x1b')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x1c'));db[_0xb48b('0x1d')]=db[_0xb48b('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xb48b('0x1e')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x1f'));db[_0xb48b('0x20')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x21'));db[_0xb48b('0x22')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x23'));db[_0xb48b('0x24')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x25'));db[_0xb48b('0x26')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x27'));db['VoiceDialReport']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x28'));db['VoiceAgentReport']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x29'));db['VoiceQueueReport']=db[_0xb48b('0x3')]['import'](_0xb48b('0x2a'));db[_0xb48b('0x2b')]=db['sequelize'][_0xb48b('0x14')]('../api/memberReport/memberReport.model');db[_0xb48b('0x2c')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x2d'));db[_0xb48b('0x2e')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x2f'));db[_0xb48b('0x30')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x31'));db[_0xb48b('0x32')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x33'));db['UserChatQueue']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x34'));db[_0xb48b('0x35')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x36'));db[_0xb48b('0x37')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x38'));db[_0xb48b('0x39')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x3a'));db['UserOpenchannelQueue']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x3b'));db[_0xb48b('0x3c')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x3d'));db['MailServerIn']=db[_0xb48b('0x3')]['import'](_0xb48b('0x3e'));db[_0xb48b('0x3f')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x40'));db[_0xb48b('0x41')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x42'));db[_0xb48b('0x43')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x44'));db[_0xb48b('0x45')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x46'));db[_0xb48b('0x47')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0xb48b('0x48')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x49'));db[_0xb48b('0x4a')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x4b'));db[_0xb48b('0x4c')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x4d'));db['Dashboard']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x4e'));db[_0xb48b('0x4f')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x50'));db[_0xb48b('0x51')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x52'));db[_0xb48b('0x53')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x54'));db[_0xb48b('0x55')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/faxMessage/faxMessage.model');db[_0xb48b('0x56')]=db[_0xb48b('0x3')]['import']('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xb48b('0x3')]['import'](_0xb48b('0x57'));db['SmsAccount']=db[_0xb48b('0x3')]['import'](_0xb48b('0x58'));db[_0xb48b('0x59')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x5a'));db[_0xb48b('0x5b')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x5c'));db[_0xb48b('0x5d')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x5e'));db[_0xb48b('0x5f')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x60'));db['OpenchannelApplication']=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize']['import'](_0xb48b('0x61'));db[_0xb48b('0x62')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x63'));db[_0xb48b('0x64')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x65'));db['ChatWebsite']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x66'));db['OpenchannelQueueReport']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x67'));db['ChatApplication']=db[_0xb48b('0x3')]['import']('../api/chatApplication/chatApplication.model');db[_0xb48b('0x68')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0xb48b('0x69')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x6a'));db['ChatOfflineMessage']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x6b'));db['ChatQueue']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x6c'));db[_0xb48b('0x6d')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x6e'));db[_0xb48b('0x6f')]=db['sequelize']['import'](_0xb48b('0x70'));db[_0xb48b('0x71')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/cmCompany/cmCompany.model');db[_0xb48b('0x72')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/cmContact/cmContact.model');db[_0xb48b('0x73')]=db['sequelize']['import'](_0xb48b('0x74'));db[_0xb48b('0x75')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x76'));db[_0xb48b('0x77')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x78'));db[_0xb48b('0x79')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x7a'));db[_0xb48b('0x7b')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x7c'));db[_0xb48b('0x7d')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x7e'));db[_0xb48b('0x7f')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x80'));db[_0xb48b('0x81')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x82'));db['CannedAnswer']=db[_0xb48b('0x3')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xb48b('0x83')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/disposition/disposition.model');db[_0xb48b('0x84')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x85'));db[_0xb48b('0x86')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x87'));db[_0xb48b('0x88')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x89'));db[_0xb48b('0x8a')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x8b'));db[_0xb48b('0x8c')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x8d'));db[_0xb48b('0x8e')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x8f'));db[_0xb48b('0x90')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x91'));db[_0xb48b('0x92')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x93'));db[_0xb48b('0x94')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x95'));db[_0xb48b('0x96')]=db[_0xb48b('0x3')]['import']('../api/cmContactHasItem/cmContactHasItem.model');db[_0xb48b('0x97')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x98'));db[_0xb48b('0x99')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x9a'));db[_0xb48b('0x9b')]=db['sequelize']['import'](_0xb48b('0x9c'));db[_0xb48b('0x9d')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x9e'));db[_0xb48b('0x9f')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xa0'));db['IntegrationReport']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xa1'));db[_0xb48b('0xa2')]=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0xb48b('0xa3')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xa4'));db[_0xb48b('0xa5')]=db[_0xb48b('0x3')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xb48b('0xa6')]=db[_0xb48b('0x3')]['import'](_0xb48b('0xa7'));db['AnalyticFieldReport']=db['sequelize']['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xb48b('0xa8')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xa9'));db[_0xb48b('0xaa')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xab'));db[_0xb48b('0xac')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xad'));db['SalesforceField']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xae'));db[_0xb48b('0xaf')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xb0'));db[_0xb48b('0xb1')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xb2'));db[_0xb48b('0xb3')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xb4'));db[_0xb48b('0xb5')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xb6'));db['DeskConfiguration']=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xb48b('0xb7')]=db[_0xb48b('0x3')]['import'](_0xb48b('0xb8'));db[_0xb48b('0xb9')]=db['sequelize']['import'](_0xb48b('0xba'));db['ZohoConfiguration']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xbb'));db[_0xb48b('0xbc')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xbd'));db['ZendeskAccount']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xbe'));db[_0xb48b('0xbf')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xc0'));db[_0xb48b('0xc1')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xc2'));db[_0xb48b('0xc3')]=db[_0xb48b('0x3')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xb48b('0xc4')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xc5'));db[_0xb48b('0xc6')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xb48b('0xc7')]=db[_0xb48b('0x3')]['import'](_0xb48b('0xc8'));db[_0xb48b('0xc9')]=db['sequelize']['import'](_0xb48b('0xca'));db[_0xb48b('0xcb')]=db['sequelize'][_0xb48b('0x14')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xcc'));db[_0xb48b('0xcd')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xce'));db[_0xb48b('0xcf')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xd0'));db[_0xb48b('0xd1')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xd2'));db[_0xb48b('0xd3')]=db[_0xb48b('0x3')]['import'](_0xb48b('0xd4'));db[_0xb48b('0xd5')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xd6'));db[_0xb48b('0xd7')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xd8'));db[_0xb48b('0xd9')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xda'));db[_0xb48b('0xdb')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xb48b('0x3')]['import'](_0xb48b('0xa0'));db[_0xb48b('0xdc')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/network/network.model');db['ChatQueueReport']=db[_0xb48b('0x3')]['import'](_0xb48b('0xdd'));db[_0xb48b('0xde')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xdf'));db['JscriptyAnswerReport']=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xe0'));db[_0xb48b('0xe1')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xe2'));db[_0xb48b('0xe3')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xe4'));db[_0xb48b('0xe5')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/squareReport/squareReport.model');db[_0xb48b('0xe6')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xe7'));db[_0xb48b('0xe8')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xb48b('0xe9')]=db['sequelize'][_0xb48b('0x14')]('../api/setting/setting.model');db[_0xb48b('0xea')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0xb48b('0xeb')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0xec'));db[_0xb48b('0xed')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/squareRecording/squareRecording.model');db[_0xb48b('0xee')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xef'));db[_0xb48b('0xf0')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf1'));db[_0xb48b('0xf2')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf3'));db[_0xb48b('0xf4')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf5'));db['Migration']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf6'));db[_0xb48b('0xf7')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf8'));db['Plugin']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xf9'));db[_0xb48b('0xfa')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xb48b('0xfb')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xfc'));db[_0xb48b('0xfd')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xb48b('0xfe')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0xff'));db[_0xb48b('0x100')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x101'));db['VoicePrefix']=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x102'));db[_0xb48b('0x103')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x104'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x105'));db['UserNotification']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x106'));db[_0xb48b('0x107')]=db['sequelize']['import'](_0xb48b('0x108'));db[_0xb48b('0x109')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x10a'));db[_0xb48b('0x10b')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x10c'));db[_0xb48b('0x10d')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xb48b('0x10e')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x10f'));db[_0xb48b('0x110')]=db[_0xb48b('0x3')]['import'](_0xb48b('0x111'));db[_0xb48b('0x112')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x113'));db[_0xb48b('0x114')]=db[_0xb48b('0x3')][_0xb48b('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0xb48b('0x115')]=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x116'));db[_0xb48b('0x117')]=db[_0xb48b('0x3')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0xb48b('0x3')][_0xb48b('0x14')](_0xb48b('0x118'));db[_0xb48b('0x119')]=db['sequelize'][_0xb48b('0x14')](_0xb48b('0x11a'));db[_0xb48b('0x13')]['hasOne'](db[_0xb48b('0x22')],{'as':_0xb48b('0x22'),'onDelete':'cascade','foreignKey':_0xb48b('0x11b')});db['User'][_0xb48b('0x11c')](db['UserSetting'],{'as':_0xb48b('0x11d'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')][_0xb48b('0x11f')](db[_0xb48b('0x1e')],{'as':_0xb48b('0x120'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')]['hasMany'](db[_0xb48b('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0xb48b('0x11b')});db['User'][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'as':_0xb48b('0x121'),'onDelete':_0xb48b('0x11e'),'hooks':!![]});db[_0xb48b('0x13')][_0xb48b('0x11f')](db[_0xb48b('0x77')],{'as':_0xb48b('0x122'),'foreignKey':'UserId'});db[_0xb48b('0x13')]['hasMany'](db[_0xb48b('0x79')],{'as':_0xb48b('0x123'),'foreignKey':_0xb48b('0x11b')});db['User'][_0xb48b('0x11f')](db[_0xb48b('0x7b')],{'as':_0xb48b('0x7b'),'foreignKey':_0xb48b('0x11b')});db['User'][_0xb48b('0x11f')](db[_0xb48b('0x124')],{'as':_0xb48b('0x125'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')]['hasMany'](db[_0xb48b('0x68')],{'as':'ChatInteractions','foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')][_0xb48b('0x11f')](db[_0xb48b('0x126')],{'as':_0xb48b('0x127'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')]['hasMany'](db[_0xb48b('0x53')],{'as':'FaxInteractions','foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')][_0xb48b('0x11f')](db[_0xb48b('0x47')],{'as':'MailInteractions','foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x13')][_0xb48b('0x11f')](db['WhatsappInteraction'],{'as':_0xb48b('0x128'),'foreignKey':_0xb48b('0x11b')});db['User'][_0xb48b('0x11f')](db[_0xb48b('0x129')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xb48b('0x13')]['belongsTo'](db[_0xb48b('0x103')],{'as':_0xb48b('0x103'),'foreignKey':_0xb48b('0x12a')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x6d')],{'as':_0xb48b('0x12c'),'through':_0xb48b('0x12d')});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x72')],{'as':_0xb48b('0x12e'),'through':_0xb48b('0x12f')});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x100')],{'as':_0xb48b('0x130'),'through':'cm_user_has_lists'});db['User'][_0xb48b('0x12b')](db['Team'],{'through':_0xb48b('0x131')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x47')],{'as':_0xb48b('0x132'),'through':'user_has_mail_interactions'});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x68')],{'as':_0xb48b('0x133'),'through':'user_has_chat_interactions'});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x53')],{'as':_0xb48b('0x134'),'through':_0xb48b('0x135')});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x126')],{'as':_0xb48b('0x127'),'through':'user_has_sms_interactions'});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x124')],{'as':_0xb48b('0x125'),'through':_0xb48b('0x136')});db['User']['belongsToMany'](db[_0xb48b('0x10b')],{'as':_0xb48b('0x128'),'through':_0xb48b('0x137')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x1d')],{'as':_0xb48b('0x138'),'through':'UserVoiceQueue','required':![]});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x139')],{'as':_0xb48b('0x13a'),'through':_0xb48b('0x13b'),'required':![]});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x43')],{'as':_0xb48b('0x13c'),'through':_0xb48b('0x35'),'required':![]});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x13d')],{'as':_0xb48b('0x13e'),'through':_0xb48b('0x13f'),'required':![],'hooks':!![]});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x56')],{'as':_0xb48b('0x140'),'through':_0xb48b('0x37'),'required':![]});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x5d')],{'as':_0xb48b('0x141'),'through':'UserSmsQueue','required':![]});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x64')],{'as':_0xb48b('0x142'),'through':_0xb48b('0x143'),'required':![]});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x112')],{'as':_0xb48b('0x144'),'through':'UserWhatsappQueue','required':![]});db[_0xb48b('0x13')]['belongsToMany'](db[_0xb48b('0x100')],{'through':_0xb48b('0x145')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x146')],{'as':_0xb48b('0x147'),'through':_0xb48b('0x148')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db['FaxAccount'],{'as':_0xb48b('0x149'),'through':_0xb48b('0x14a')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x41')],{'as':_0xb48b('0x14b'),'through':'user_has_mail_accounts'});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x5f')],{'as':_0xb48b('0x14c'),'through':_0xb48b('0x14d')});db['User'][_0xb48b('0x12b')](db[_0xb48b('0x14e')],{'as':_0xb48b('0x14f'),'through':_0xb48b('0x150')});db[_0xb48b('0x13')][_0xb48b('0x12b')](db[_0xb48b('0x107')],{'as':_0xb48b('0x151'),'through':'user_has_whatsapp_accounts'});db[_0xb48b('0x13')][_0xb48b('0x12b')](db['SquareProject'],{'as':_0xb48b('0x152'),'through':_0xb48b('0x153')});db[_0xb48b('0x154')][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xb48b('0x155')});db['VoiceContext'][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'onDelete':_0xb48b('0x11e')});db['VoiceExtension'][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'as':_0xb48b('0x156'),'onDelete':'cascade'});db[_0xb48b('0x1b')]['belongsToMany'](db['Sound'],{'as':_0xb48b('0x157'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xb48b('0x11f')](db[_0xb48b('0x30')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xb48b('0x11f')](db[_0xb48b('0x73')],{'as':_0xb48b('0x158'),'foreignKey':_0xb48b('0x159')});db[_0xb48b('0x1d')][_0xb48b('0x11f')](db[_0xb48b('0x77')],{'as':_0xb48b('0x122'),'foreignKey':_0xb48b('0x159')});db[_0xb48b('0x1d')][_0xb48b('0x11f')](db[_0xb48b('0x79')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0xb48b('0x1d')][_0xb48b('0x11f')](db[_0xb48b('0x7b')],{'as':_0xb48b('0x7b'),'foreignKey':_0xb48b('0x159')});db[_0xb48b('0x1d')][_0xb48b('0x11f')](db[_0xb48b('0x75')],{'as':_0xb48b('0x15a'),'foreignKey':_0xb48b('0x159')});db[_0xb48b('0x1d')][_0xb48b('0x11f')](db['JscriptySessionReport'],{'as':_0xb48b('0x15b'),'foreignKey':'VoiceQueueId'});db[_0xb48b('0x1d')]['belongsTo'](db[_0xb48b('0x2c')],{'as':'Trunk','foreignKey':_0xb48b('0x15c')});db[_0xb48b('0x1d')][_0xb48b('0x15d')](db[_0xb48b('0x2c')],{'as':_0xb48b('0x15e'),'foreignKey':_0xb48b('0x15f')});db[_0xb48b('0x1d')][_0xb48b('0x15d')](db['Interval'],{'as':_0xb48b('0x86'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x1d')][_0xb48b('0x15d')](db[_0xb48b('0x88')],{'as':_0xb48b('0x161'),'foreignKey':_0xb48b('0x162')});db[_0xb48b('0x1d')][_0xb48b('0x12b')](db[_0xb48b('0x100')],{'as':_0xb48b('0x130'),'through':_0xb48b('0x163')});db[_0xb48b('0x1d')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0xb48b('0xf0')],{'as':_0xb48b('0x164'),'through':'TeamVoiceQueue'});db[_0xb48b('0x1d')][_0xb48b('0x12b')](db['CmList'],{'as':_0xb48b('0x165'),'through':_0xb48b('0x166')});db[_0xb48b('0x1e')]['belongsTo'](db['User'],{'as':_0xb48b('0x13'),'foreignKey':_0xb48b('0x11b')});db['ScreenRecording'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x13'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x22')]['hasMany'](db[_0xb48b('0x24')],{'as':_0xb48b('0x167'),'onDelete':_0xb48b('0x11e'),'foreignKey':'mailboxuser','sourceKey':_0xb48b('0x168')});db['VoiceMailMessage'][_0xb48b('0x15d')](db[_0xb48b('0x22')],{'foreignKey':'mailboxuser','targetKey':_0xb48b('0x168')});db['VoiceCallReport'][_0xb48b('0x11f')](db[_0xb48b('0x169')],{'as':'QueueCalls','foreignKey':_0xb48b('0x16a'),'constraints':![]});db[_0xb48b('0x26')][_0xb48b('0x11f')](db[_0xb48b('0x16b')],{'as':_0xb48b('0x16c'),'foreignKey':_0xb48b('0x16a'),'constraints':![]});db[_0xb48b('0x26')][_0xb48b('0x15d')](db['User'],{'as':'User','foreignKey':_0xb48b('0x11b')});db['VoiceCallReport'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':'ContactId'});db[_0xb48b('0x16e')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'as':_0xb48b('0x41'),'foreignKey':'MailAccountId'});db[_0xb48b('0x16e')][_0xb48b('0x15d')](db['CloudProvider'],{'as':_0xb48b('0x114'),'foreignKey':_0xb48b('0x16f'),'onDelete':_0xb48b('0x170')});db[_0xb48b('0x3f')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xb48b('0x3f')][_0xb48b('0x15d')](db[_0xb48b('0x114')],{'as':'CloudProvider','foreignKey':_0xb48b('0x16f'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db['MailServerIn'],{'as':_0xb48b('0x171'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x41')][_0xb48b('0x11c')](db[_0xb48b('0x3f')],{'as':_0xb48b('0x172'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x41')]['hasMany'](db['Disposition'],{'as':_0xb48b('0x173'),'foreignKey':'MailAccountId','onDelete':_0xb48b('0x11e')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0xb48b('0x174'),'foreignKey':_0xb48b('0x175')});db[_0xb48b('0x41')]['hasMany'](db['MailMessage'],{'as':_0xb48b('0x167'),'foreignKey':_0xb48b('0x175')});db[_0xb48b('0x41')]['hasMany'](db[_0xb48b('0x47')],{'as':_0xb48b('0x176')});db[_0xb48b('0x41')][_0xb48b('0x11f')](db[_0xb48b('0x4a')],{'as':_0xb48b('0x156')});db[_0xb48b('0x41')]['belongsTo'](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x41')][_0xb48b('0x15d')](db[_0xb48b('0x99')],{'as':_0xb48b('0x99'),'foreignKey':_0xb48b('0x179')});db[_0xb48b('0x41')]['belongsTo'](db[_0xb48b('0x88')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x17b')});db[_0xb48b('0x43')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':'UserMailQueue'});db[_0xb48b('0x43')]['belongsToMany'](db[_0xb48b('0xf0')],{'through':'team_has_mail_queues','as':_0xb48b('0x164')});db[_0xb48b('0x47')][_0xb48b('0x11f')](db[_0xb48b('0x48')],{'as':_0xb48b('0x167'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0xb48b('0x47')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x175')});db[_0xb48b('0x47')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':_0xb48b('0x17d')});db['MailInteraction'][_0xb48b('0x15d')](db['User'],{'as':'Owner','foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x47')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x17e'),'as':'Tags'});db[_0xb48b('0x47')][_0xb48b('0x12b')](db['Tag'],{'through':_0xb48b('0x17e'),'as':_0xb48b('0x17f')});db[_0xb48b('0x47')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xb48b('0x180')});db[_0xb48b('0x48')][_0xb48b('0x11f')](db['Attachment'],{'as':'Attachments','onDelete':_0xb48b('0x11e')});db['MailMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x13')});db['MailMessage'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x16d')});db[_0xb48b('0x48')][_0xb48b('0x15d')](db[_0xb48b('0x47')],{'as':_0xb48b('0x181'),'foreignKey':_0xb48b('0x180')});db[_0xb48b('0x48')][_0xb48b('0x15d')](db['MailAccount'],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x175')});db[_0xb48b('0x48')][_0xb48b('0x15d')](db['ChatWebsite'],{'as':_0xb48b('0x146'),'foreignKey':_0xb48b('0x182')});db[_0xb48b('0x48')]['belongsTo'](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0xb48b('0x183')});db[_0xb48b('0x4a')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x4a')][_0xb48b('0x15d')](db[_0xb48b('0x43')],{'onDelete':'restrict'});db['MailApplication'][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x4a')][_0xb48b('0x15d')](db[_0xb48b('0x86')],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x4a')]['belongsTo'](db[_0xb48b('0x92')],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x184')});db[_0xb48b('0x4c')][_0xb48b('0x15d')](db['MailAccount'],{});db[_0xb48b('0x4c')][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x4c')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x4c')][_0xb48b('0x15d')](db[_0xb48b('0x47')],{});db['MailQueueReport']['belongsTo'](db[_0xb48b('0x48')],{});db[_0xb48b('0x4c')]['belongsTo'](db[_0xb48b('0x13')],{});db[_0xb48b('0x4c')]['belongsTo'](db[_0xb48b('0x43')],{});db[_0xb48b('0x185')][_0xb48b('0x11f')](db[_0xb48b('0x4f')],{'as':_0xb48b('0x186'),'onDelete':_0xb48b('0x11e')});db['FaxAccount'][_0xb48b('0x11f')](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x187')][_0xb48b('0x11f')](db[_0xb48b('0x188')],{'as':'Answers','foreignKey':_0xb48b('0x189')});db['FaxAccount'][_0xb48b('0x11f')](db[_0xb48b('0x53')],{'as':'Interactions'});db['FaxAccount'][_0xb48b('0x11f')](db[_0xb48b('0x51')],{'as':_0xb48b('0x156')});db[_0xb48b('0x187')][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'as':'Exntensions','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x187')][_0xb48b('0x11f')](db[_0xb48b('0x55')],{'as':_0xb48b('0x167')});db[_0xb48b('0x187')]['belongsTo'](db[_0xb48b('0x2c')],{'as':_0xb48b('0x2c')});db[_0xb48b('0x187')]['belongsTo'](db['CmList'],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db['FaxAccount']['belongsTo'](db[_0xb48b('0x88')],{'as':_0xb48b('0x161'),'foreignKey':_0xb48b('0x162')});db[_0xb48b('0x187')]['belongsToMany'](db[_0xb48b('0x13')],{'as':'Agents','through':_0xb48b('0x14a')});db[_0xb48b('0x51')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':'restrict'});db[_0xb48b('0x51')][_0xb48b('0x15d')](db[_0xb48b('0x56')],{'onDelete':'restrict'});db[_0xb48b('0x51')][_0xb48b('0x15d')](db[_0xb48b('0x187')],{'onDelete':_0xb48b('0x170')});db['FaxApplication'][_0xb48b('0x15d')](db[_0xb48b('0x92')],{'onDelete':'restrict','foreignKey':_0xb48b('0x184')});db[_0xb48b('0x53')]['hasMany'](db[_0xb48b('0x55')],{'as':_0xb48b('0x167'),'onDelete':'cascade','foreignKey':_0xb48b('0x18a')});db[_0xb48b('0x53')][_0xb48b('0x15d')](db['FaxAccount'],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x189')});db[_0xb48b('0x53')]['belongsTo'](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':'ContactId'});db['FaxInteraction'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18b'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x53')]['belongsToMany'](db[_0xb48b('0x92')],{'through':'fax_interaction_has_tags','as':_0xb48b('0x18c')});db[_0xb48b('0x53')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xb48b('0x53')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18d'),'through':_0xb48b('0x135'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x11e'),'as':'User'});db[_0xb48b('0x55')][_0xb48b('0x15d')](db[_0xb48b('0x53')],{'as':_0xb48b('0x181'),'foreignKey':_0xb48b('0x18a')});db[_0xb48b('0x55')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'onDelete':'cascade','as':_0xb48b('0x16d')});db[_0xb48b('0x55')][_0xb48b('0x15d')](db[_0xb48b('0xf7')],{'as':_0xb48b('0xf7'),'foreignKey':_0xb48b('0x18e')});db['FaxMessage'][_0xb48b('0x15d')](db['FaxAccount'],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x189')});db[_0xb48b('0x56')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':'Agents','through':_0xb48b('0x37')});db['FaxQueue'][_0xb48b('0x12b')](db['Team'],{'through':'team_has_fax_queues','as':_0xb48b('0x164')});db[_0xb48b('0x18f')][_0xb48b('0x15d')](db[_0xb48b('0x187')],{});db[_0xb48b('0x18f')]['belongsTo'](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db['FaxQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x18f')][_0xb48b('0x15d')](db[_0xb48b('0x53')],{});db[_0xb48b('0x18f')]['belongsTo'](db[_0xb48b('0x55')],{});db[_0xb48b('0x18f')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{});db[_0xb48b('0x18f')][_0xb48b('0x15d')](db[_0xb48b('0x56')],{});db[_0xb48b('0x14e')][_0xb48b('0x11f')](db['Disposition'],{'as':_0xb48b('0x173'),'foreignKey':_0xb48b('0x190'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x14e')][_0xb48b('0x11f')](db[_0xb48b('0x188')],{'as':'Answers','foreignKey':_0xb48b('0x190')});db[_0xb48b('0x14e')]['hasMany'](db[_0xb48b('0x5b')],{'as':_0xb48b('0x167'),'foreignKey':_0xb48b('0x190')});db[_0xb48b('0x14e')][_0xb48b('0x11f')](db['SmsInteraction'],{'as':_0xb48b('0x176')});db[_0xb48b('0x14e')][_0xb48b('0x11f')](db[_0xb48b('0x59')],{'as':_0xb48b('0x156')});db['SmsAccount'][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x14e')][_0xb48b('0x15d')](db[_0xb48b('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0xb48b('0x162')});db[_0xb48b('0x14e')]['belongsToMany'](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x150')});db[_0xb48b('0x59')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':'restrict'});db[_0xb48b('0x59')][_0xb48b('0x15d')](db[_0xb48b('0x5d')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x59')][_0xb48b('0x15d')](db[_0xb48b('0x14e')],{'onDelete':_0xb48b('0x170')});db['SmsApplication'][_0xb48b('0x15d')](db[_0xb48b('0x86')],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x59')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xb48b('0x184')});db['SmsInteraction'][_0xb48b('0x11f')](db[_0xb48b('0x5b')],{'as':_0xb48b('0x167'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x191')});db['SmsInteraction'][_0xb48b('0x15d')](db[_0xb48b('0x14e')],{'as':_0xb48b('0x17c'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x126')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18b'),'foreignKey':'UserId'});db['SmsInteraction'][_0xb48b('0x12b')](db['Tag'],{'through':_0xb48b('0x192'),'as':_0xb48b('0x18c')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xb48b('0x17f')});db['SmsInteraction'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18d'),'through':_0xb48b('0x193'),'foreignKey':'SmsInteractionId'});db[_0xb48b('0x5b')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x13')});db[_0xb48b('0x5b')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x16d')});db['SmsMessage'][_0xb48b('0x15d')](db[_0xb48b('0x126')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x181'),'foreignKey':_0xb48b('0x191')});db[_0xb48b('0x5b')][_0xb48b('0x15d')](db[_0xb48b('0x14e')],{'as':'Account','foreignKey':_0xb48b('0x190')});db[_0xb48b('0x5d')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':'Agents','through':_0xb48b('0x39'),'foreignKey':_0xb48b('0x194')});db[_0xb48b('0x5d')]['belongsToMany'](db['Team'],{'through':_0xb48b('0x195'),'as':_0xb48b('0x164')});db[_0xb48b('0x5f')]['hasMany'](db[_0xb48b('0x83')],{'as':'Dispositions','foreignKey':_0xb48b('0x196'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x5f')][_0xb48b('0x11f')](db[_0xb48b('0x188')],{'as':_0xb48b('0x174'),'foreignKey':_0xb48b('0x196')});db[_0xb48b('0x5f')][_0xb48b('0x11f')](db[_0xb48b('0x124')],{'as':_0xb48b('0x176'),'foreignKey':_0xb48b('0x196')});db[_0xb48b('0x5f')][_0xb48b('0x11f')](db[_0xb48b('0x62')],{'as':'Messages','foreignKey':_0xb48b('0x196')});db[_0xb48b('0x5f')][_0xb48b('0x11f')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db[_0xb48b('0x5f')]['belongsTo'](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x5f')][_0xb48b('0x15d')](db[_0xb48b('0x88')],{'as':_0xb48b('0x161'),'foreignKey':_0xb48b('0x162')});db[_0xb48b('0x5f')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x197')][_0xb48b('0x15d')](db['OpenchannelQueue'],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x198')});db[_0xb48b('0x197')][_0xb48b('0x15d')](db[_0xb48b('0x5f')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xb48b('0x197')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xb48b('0x160')});db[_0xb48b('0x197')][_0xb48b('0x15d')](db[_0xb48b('0x92')],{'onDelete':_0xb48b('0x170'),'foreignKey':'TagId'});db['OpenchannelInteraction']['hasMany'](db[_0xb48b('0x62')],{'as':_0xb48b('0x167'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x199')});db['OpenchannelInteraction'][_0xb48b('0x15d')](db[_0xb48b('0x5f')],{'as':'Account','foreignKey':_0xb48b('0x196')});db[_0xb48b('0x124')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x124')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18b'),'foreignKey':_0xb48b('0x11b')});db[_0xb48b('0x124')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':'openchannel_interaction_has_tags','as':_0xb48b('0x18c')});db[_0xb48b('0x124')]['belongsToMany'](db[_0xb48b('0x92')],{'through':_0xb48b('0x19a'),'as':'ThroughTags'});db[_0xb48b('0x124')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':'Users','through':_0xb48b('0x136'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x11e'),'as':'User'});db[_0xb48b('0x62')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x16d')});db[_0xb48b('0x62')][_0xb48b('0x15d')](db[_0xb48b('0x124')],{'onDelete':_0xb48b('0x11e'),'as':'Interaction','foreignKey':_0xb48b('0x199')});db[_0xb48b('0x62')][_0xb48b('0x15d')](db[_0xb48b('0xf7')],{'as':_0xb48b('0xf7'),'foreignKey':_0xb48b('0x18e')});db[_0xb48b('0x62')][_0xb48b('0x15d')](db[_0xb48b('0x5f')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x196')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0xb48b('0x17a'),'through':'UserOpenchannelQueue','foreignKey':_0xb48b('0x198')});db[_0xb48b('0x64')][_0xb48b('0x12b')](db[_0xb48b('0xf0')],{'through':'team_has_openchannel_queues','as':_0xb48b('0x164')});db[_0xb48b('0x146')][_0xb48b('0x11f')](db[_0xb48b('0x83')],{'as':_0xb48b('0x173'),'foreignKey':_0xb48b('0x182'),'onDelete':'cascade'});db[_0xb48b('0x146')][_0xb48b('0x11f')](db[_0xb48b('0x188')],{'as':_0xb48b('0x174'),'foreignKey':_0xb48b('0x182')});db[_0xb48b('0x146')][_0xb48b('0x11f')](db[_0xb48b('0x6f')],{'as':'ProactiveActions'});db[_0xb48b('0x146')][_0xb48b('0x11f')](db[_0xb48b('0x68')],{'as':'Interactions'});db[_0xb48b('0x146')][_0xb48b('0x11f')](db['ChatApplication'],{'as':_0xb48b('0x156')});db[_0xb48b('0x146')]['hasMany'](db[_0xb48b('0x69')],{'as':_0xb48b('0x167')});db['ChatWebsite'][_0xb48b('0x15d')](db['CmList'],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x146')][_0xb48b('0x15d')](db[_0xb48b('0x86')],{'as':'Interval','foreignKey':_0xb48b('0x160')});db[_0xb48b('0x146')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'as':_0xb48b('0x41'),'foreignKey':'MailAccountId'});db[_0xb48b('0x146')][_0xb48b('0x15d')](db[_0xb48b('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0xb48b('0x162')});db[_0xb48b('0x146')]['belongsToMany'](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x148')});db[_0xb48b('0x19b')][_0xb48b('0x15d')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d')});db['OpenchannelQueueReport'][_0xb48b('0x15d')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x62')],{});db[_0xb48b('0x19b')]['belongsTo'](db[_0xb48b('0x13')],{});db[_0xb48b('0x19b')]['belongsTo'](db[_0xb48b('0x64')],{});db[_0xb48b('0x19c')][_0xb48b('0x15d')](db['User'],{'as':_0xb48b('0x19d'),'foreignKey':'UserId','onDelete':_0xb48b('0x170')});db['ChatApplication'][_0xb48b('0x15d')](db[_0xb48b('0x13d')],{'as':_0xb48b('0x19e'),'foreignKey':_0xb48b('0x19f'),'onDelete':_0xb48b('0x170')});db['ChatApplication']['belongsTo'](db[_0xb48b('0x146')],{'as':'Website','foreignKey':_0xb48b('0x182'),'onDelete':_0xb48b('0x170')});db[_0xb48b('0x19c')][_0xb48b('0x15d')](db[_0xb48b('0x92')],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x184')});db[_0xb48b('0x68')]['hasMany'](db[_0xb48b('0x69')],{'as':_0xb48b('0x167'),'onDelete':_0xb48b('0x11e'),'foreignKey':'ChatInteractionId'});db['ChatInteraction']['belongsTo'](db[_0xb48b('0x146')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x182')});db[_0xb48b('0x68')]['belongsTo'](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x68')][_0xb48b('0x15d')](db['User'],{'as':_0xb48b('0x18b'),'foreignKey':'UserId'});db[_0xb48b('0x68')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1a0'),'as':'Tags'});db['ChatInteraction'][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1a0'),'as':_0xb48b('0x17f')});db[_0xb48b('0x68')][_0xb48b('0x12b')](db['User'],{'as':_0xb48b('0x18d'),'through':'user_has_chat_interactions','foreignKey':_0xb48b('0x1a1')});db['ChatMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x13')});db[_0xb48b('0x69')]['belongsTo'](db[_0xb48b('0x72')],{'onDelete':'cascade','as':_0xb48b('0x16d'),'foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x69')]['belongsTo'](db[_0xb48b('0x68')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x181'),'foreignKey':_0xb48b('0x1a1')});db['ChatMessage']['belongsTo'](db[_0xb48b('0xf7')],{'as':_0xb48b('0xf7'),'foreignKey':_0xb48b('0x18e')});db[_0xb48b('0x69')][_0xb48b('0x15d')](db[_0xb48b('0x146')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x182')});db[_0xb48b('0x1a2')]['hasMany'](db[_0xb48b('0xf7')],{'as':_0xb48b('0x1a3'),'foreignKey':_0xb48b('0x183'),'onDelete':_0xb48b('0x11e'),'hooks':!![]});db[_0xb48b('0x1a2')]['belongsTo'](db[_0xb48b('0x72')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x16d'),'foreignKey':'ContactId'});db[_0xb48b('0x1a2')][_0xb48b('0x15d')](db[_0xb48b('0x146')],{'as':'Account','foreignKey':_0xb48b('0x182')});db['ChatQueue'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x13f'),'hooks':!![]});db[_0xb48b('0x13d')][_0xb48b('0x12b')](db['Team'],{'through':_0xb48b('0x1a4'),'as':_0xb48b('0x164')});db[_0xb48b('0x6d')]['hasMany'](db[_0xb48b('0xde')],{'as':_0xb48b('0x167'),'foreignKey':'ChatGroupId','onDelete':_0xb48b('0x11e')});db['ChatGroup'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x1a5'),'through':_0xb48b('0x12d')});db[_0xb48b('0x6f')][_0xb48b('0x15d')](db[_0xb48b('0x146')],{'as':'Website','foreignKey':_0xb48b('0x182')});db[_0xb48b('0x71')][_0xb48b('0x11f')](db[_0xb48b('0x72')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0xb48b('0x11f')](db[_0xb48b('0x96')],{'as':_0xb48b('0x1a6'),'foreignKey':_0xb48b('0x1a7')});db[_0xb48b('0x72')][_0xb48b('0x11f')](db[_0xb48b('0x73')],{'as':_0xb48b('0x158'),'foreignKey':'ContactId'});db[_0xb48b('0x72')]['hasMany'](db[_0xb48b('0x77')],{'as':_0xb48b('0x122'),'foreignKey':'ContactId'});db['CmContact'][_0xb48b('0x11f')](db[_0xb48b('0x79')],{'as':_0xb48b('0x1a8'),'foreignKey':'ContactId'});db[_0xb48b('0x72')][_0xb48b('0x11f')](db[_0xb48b('0x7b')],{'as':_0xb48b('0x7b'),'foreignKey':'ContactId'});db['CmContact'][_0xb48b('0x11f')](db[_0xb48b('0xe1')],{'as':_0xb48b('0x15b'),'foreignKey':_0xb48b('0x17d')});db['CmContact'][_0xb48b('0x11f')](db[_0xb48b('0x124')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xb48b('0x72')][_0xb48b('0x11f')](db[_0xb48b('0x68')],{'as':_0xb48b('0x133'),'foreignKey':_0xb48b('0x17d'),'onDelete':_0xb48b('0x170')});db[_0xb48b('0x72')]['hasMany'](db[_0xb48b('0x126')],{'as':_0xb48b('0x127'),'foreignKey':_0xb48b('0x17d'),'onDelete':_0xb48b('0x170')});db[_0xb48b('0x72')][_0xb48b('0x11f')](db['FaxInteraction'],{'as':_0xb48b('0x134'),'foreignKey':_0xb48b('0x17d'),'onDelete':_0xb48b('0x170')});db[_0xb48b('0x72')]['hasMany'](db[_0xb48b('0x47')],{'as':_0xb48b('0x132'),'foreignKey':'ContactId','onDelete':_0xb48b('0x170')});db[_0xb48b('0x72')][_0xb48b('0x15d')](db[_0xb48b('0x71')],{'as':_0xb48b('0x1a9'),'foreignKey':'CompanyId'});db[_0xb48b('0x72')][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':'List','foreignKey':'ListId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x72')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18d'),'through':_0xb48b('0x12f')});db[_0xb48b('0x72')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'as':_0xb48b('0x18c'),'through':_0xb48b('0x1aa')});db[_0xb48b('0x72')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1aa'),'as':'ThroughTags'});db[_0xb48b('0x73')][_0xb48b('0x11f')](db[_0xb48b('0x97')],{'as':'AdditionalPhones','foreignKey':_0xb48b('0x1ab')});db[_0xb48b('0x73')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d'),'onDelete':_0xb48b('0x11e')});db['CmHopper']['belongsTo'](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x73')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x19d'),'foreignKey':_0xb48b('0x11b')});db['CmHopper'][_0xb48b('0x15d')](db['VoiceQueue'],{'as':_0xb48b('0x19e'),'foreignKey':_0xb48b('0x159'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x73')][_0xb48b('0x15d')](db['Campaign'],{'as':_0xb48b('0xf4'),'foreignKey':'CampaignId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x73')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18b'),'foreignKey':_0xb48b('0x1ac')});db[_0xb48b('0x75')][_0xb48b('0x15d')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x75')][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':'ListId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x75')][_0xb48b('0x15d')](db[_0xb48b('0x1d')],{'as':_0xb48b('0x19e'),'foreignKey':_0xb48b('0x159'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x75')][_0xb48b('0x15d')](db[_0xb48b('0xf4')],{'as':_0xb48b('0xf4'),'foreignKey':_0xb48b('0x1ad'),'onDelete':_0xb48b('0x11e')});db['Automation'][_0xb48b('0x11f')](db[_0xb48b('0x84')],{'as':{'plural':'All','singular':_0xb48b('0x1ae')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0xb48b('0x84')],{'as':{'plural':'Any','singular':_0xb48b('0x1af')},'foreignKey':'AutomationAnyId','onDelete':_0xb48b('0x11e'),'hooks':!![]});db[_0xb48b('0x81')][_0xb48b('0x11f')](db['Action'],{'as':'Actions','foreignKey':_0xb48b('0x1b0'),'onDelete':_0xb48b('0x11e'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xb48b('0x83')],{'as':'Dispositions','foreignKey':_0xb48b('0x1b1'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x86')][_0xb48b('0x11f')](db[_0xb48b('0x86')],{'as':_0xb48b('0x1b2'),'foreignKey':_0xb48b('0x160'),'onDelete':_0xb48b('0x11e'),'hooks':!![],'required':![]});db[_0xb48b('0x86')]['hasMany'](db[_0xb48b('0x19')],{'as':_0xb48b('0x121'),'foreignKey':_0xb48b('0x160'),'onDelete':_0xb48b('0x170')});db['Interval'][_0xb48b('0x11f')](db[_0xb48b('0x4a')],{'as':_0xb48b('0x1b3'),'foreignKey':_0xb48b('0x160')});db['Interval'][_0xb48b('0x11f')](db['ChatApplication'],{'as':_0xb48b('0x1b4'),'foreignKey':'IntervalId'});db[_0xb48b('0x86')][_0xb48b('0x11f')](db[_0xb48b('0x51')],{'as':_0xb48b('0x1b5'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x86')][_0xb48b('0x11f')](db[_0xb48b('0x59')],{'as':_0xb48b('0x1b6'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x8e')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{});db[_0xb48b('0x8e')][_0xb48b('0x15d')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xb48b('0x8e')][_0xb48b('0x15d')](db[_0xb48b('0xa2')],{'foreignKey':_0xb48b('0x1b7')});db[_0xb48b('0x90')][_0xb48b('0x12b')](db[_0xb48b('0x1b')],{'as':_0xb48b('0x1b8'),'through':_0xb48b('0x1b9'),'onDelete':'restrict'});db['Tag']['belongsToMany'](db[_0xb48b('0x72')],{'through':_0xb48b('0x1aa')});db[_0xb48b('0x92')]['belongsToMany'](db[_0xb48b('0x68')],{'through':_0xb48b('0x1a0')});db[_0xb48b('0x92')]['belongsToMany'](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag'][_0xb48b('0x12b')](db[_0xb48b('0x126')],{'through':_0xb48b('0x192')});db[_0xb48b('0x92')][_0xb48b('0x12b')](db[_0xb48b('0x53')],{'through':_0xb48b('0x1ba')});db[_0xb48b('0x92')][_0xb48b('0x12b')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xb48b('0x12b')](db[_0xb48b('0x10b')],{'through':_0xb48b('0x1bb')});db[_0xb48b('0x96')][_0xb48b('0x15d')](db['ContactItemType'],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0xb48b('0x97')]['belongsTo'](db['CmHopper'],{'as':_0xb48b('0x1bc'),'foreignKey':_0xb48b('0x1ab')});db['CmContactHasItem']['belongsTo'](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':'CmContactId'});db[_0xb48b('0x9b')][_0xb48b('0x11f')](db['Condition'],{'as':{'plural':_0xb48b('0x1bd'),'singular':'AllCondition'},'foreignKey':_0xb48b('0x1be'),'onDelete':'cascade','hooks':!![]});db[_0xb48b('0x9b')][_0xb48b('0x11f')](db[_0xb48b('0x84')],{'as':{'plural':_0xb48b('0x1bf'),'singular':_0xb48b('0x1c0')},'foreignKey':_0xb48b('0x1c1'),'onDelete':'cascade','hooks':!![]});db[_0xb48b('0x9b')][_0xb48b('0x11f')](db[_0xb48b('0x7f')],{'as':_0xb48b('0x1c2'),'foreignKey':'TriggerId','onDelete':_0xb48b('0x11e'),'hooks':!![]});db[_0xb48b('0xa2')][_0xb48b('0x11f')](db[_0xb48b('0x1c3')],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1b7'),'hooks':!![]});db[_0xb48b('0xa3')][_0xb48b('0x11f')](db[_0xb48b('0x1c3')],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c5')});db[_0xb48b('0xa6')][_0xb48b('0x11f')](db[_0xb48b('0x1c3')],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c6')});db[_0xb48b('0x1c3')]['belongsTo'](db[_0xb48b('0xa6')],{'foreignKey':_0xb48b('0x1c6')});db[_0xb48b('0xaa')][_0xb48b('0x11f')](db['SalesforceConfiguration'],{'as':_0xb48b('0x1c7'),'onDelete':'cascade','foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xac')]['hasMany'](db['SalesforceField'],{'as':_0xb48b('0x1c9'),'onDelete':'cascade','foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xac')][_0xb48b('0x11f')](db[_0xb48b('0x1cb')],{'as':'Descriptions','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xac')]['hasMany'](db[_0xb48b('0x1cb')],{'as':'Fields','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xac')][_0xb48b('0x15d')](db[_0xb48b('0xaa')],{'as':_0xb48b('0x17c'),'foreignKey':'AccountId'});db[_0xb48b('0x1cb')][_0xb48b('0x11f')](db['SalesforceField'],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0x1cb')][_0xb48b('0x11f')](db[_0xb48b('0x1cb')],{'as':_0xb48b('0x1cf'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0x1cb')][_0xb48b('0x11f')](db['SalesforceField'],{'as':'Field','foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0x1cb')][_0xb48b('0x15d')](db[_0xb48b('0x9d')],{'as':'Variable','foreignKey':'VariableId'});db[_0xb48b('0xaf')][_0xb48b('0x11f')](db[_0xb48b('0xb1')],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xb1')][_0xb48b('0x11f')](db[_0xb48b('0xb3')],{'as':'Subjects','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xb1')][_0xb48b('0x11f')](db[_0xb48b('0xb3')],{'as':_0xb48b('0x1d0'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xb1')]['hasMany'](db[_0xb48b('0xb3')],{'as':'Fields','onDelete':_0xb48b('0x11e'),'foreignKey':'FieldId'});db[_0xb48b('0xb1')]['belongsTo'](db[_0xb48b('0xaf')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xb3')]['hasMany'](db['SugarcrmField'],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xb3')][_0xb48b('0x11f')](db[_0xb48b('0xb3')],{'as':'Description','foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xb3')][_0xb48b('0x11f')](db[_0xb48b('0xb3')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xb3')][_0xb48b('0x15d')](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':'VariableId'});db[_0xb48b('0xb5')]['hasMany'](db[_0xb48b('0x1d2')],{'as':'Configurations','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0x1d2')][_0xb48b('0x11f')](db[_0xb48b('0xb7')],{'as':_0xb48b('0x1c9'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0x1d2')][_0xb48b('0x11f')](db[_0xb48b('0xb7')],{'as':_0xb48b('0x1d0'),'onDelete':'cascade','foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0x1d2')][_0xb48b('0x11f')](db['DeskField'],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':'FieldId'});db[_0xb48b('0x1d2')][_0xb48b('0x15d')](db['DeskAccount'],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0x1d2')]['belongsToMany'](db[_0xb48b('0x92')],{'through':'int_desk_configuration_has_tags'});db[_0xb48b('0xb7')][_0xb48b('0x11f')](db[_0xb48b('0xb7')],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xb7')][_0xb48b('0x11f')](db[_0xb48b('0xb7')],{'as':_0xb48b('0x1cf'),'foreignKey':_0xb48b('0x1cc')});db['DeskField'][_0xb48b('0x11f')](db['DeskField'],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xb7')]['belongsTo'](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':_0xb48b('0x1d3')});db[_0xb48b('0xb9')][_0xb48b('0x11f')](db[_0xb48b('0x1d4')],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db['ZohoConfiguration'][_0xb48b('0x11f')](db[_0xb48b('0xbc')],{'as':_0xb48b('0x1c9'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0x1d4')][_0xb48b('0x11f')](db[_0xb48b('0xbc')],{'as':'Descriptions','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cc')});db['ZohoConfiguration']['hasMany'](db[_0xb48b('0xbc')],{'as':'Fields','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0x1d4')][_0xb48b('0x15d')](db['ZohoAccount'],{'as':_0xb48b('0x17c'),'foreignKey':'AccountId'});db[_0xb48b('0xbc')]['hasMany'](db[_0xb48b('0xbc')],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db['ZohoField'][_0xb48b('0x11f')](db['ZohoField'],{'as':'Description','foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xbc')][_0xb48b('0x11f')](db[_0xb48b('0xbc')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xbc')][_0xb48b('0x15d')](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':_0xb48b('0x1d3')});db[_0xb48b('0x1d5')][_0xb48b('0x11f')](db[_0xb48b('0xbf')],{'as':'Configurations','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xbf')]['hasMany'](db[_0xb48b('0xc1')],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db[_0xb48b('0xc1')],{'as':_0xb48b('0x1d0'),'foreignKey':'DescriptionId'});db[_0xb48b('0xbf')][_0xb48b('0x11f')](db[_0xb48b('0xc1')],{'as':_0xb48b('0x1c4'),'foreignKey':_0xb48b('0x1cd')});db['ZendeskConfiguration'][_0xb48b('0x15d')](db[_0xb48b('0x1d5')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xbf')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1d6')});db[_0xb48b('0xc1')][_0xb48b('0x11f')](db[_0xb48b('0xc1')],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xc1')][_0xb48b('0x11f')](db['ZendeskField'],{'as':_0xb48b('0x1cf'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xc1')]['hasMany'](db[_0xb48b('0xc1')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db['ZendeskField']['belongsTo'](db['Variable'],{'as':_0xb48b('0x9d'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xb48b('0x11f')](db[_0xb48b('0xc4')],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xc4')]['hasMany'](db[_0xb48b('0xc6')],{'as':'Subjects','onDelete':_0xb48b('0x11e'),'foreignKey':'SubjectId'});db[_0xb48b('0xc4')][_0xb48b('0x11f')](db[_0xb48b('0xc6')],{'as':_0xb48b('0x1d0'),'onDelete':'cascade','foreignKey':_0xb48b('0x1cc')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':'FieldId'});db[_0xb48b('0xc4')]['belongsTo'](db[_0xb48b('0xc3')],{'as':'Account','foreignKey':'AccountId'});db[_0xb48b('0xc4')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1d7')});db[_0xb48b('0xc6')][_0xb48b('0x11f')](db[_0xb48b('0xc6')],{'as':_0xb48b('0x1ce'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xb48b('0x11f')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0xb48b('0x11f')](db[_0xb48b('0xc6')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xc6')][_0xb48b('0x15d')](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':_0xb48b('0x1d3')});db[_0xb48b('0xc7')][_0xb48b('0x11f')](db[_0xb48b('0xc9')],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db['VtigerConfiguration'][_0xb48b('0x11f')](db[_0xb48b('0xcb')],{'as':_0xb48b('0x1c9'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xc9')][_0xb48b('0x11f')](db[_0xb48b('0xcb')],{'as':_0xb48b('0x1d0'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xc9')][_0xb48b('0x11f')](db['VtigerField'],{'as':_0xb48b('0x1c4'),'foreignKey':_0xb48b('0x1cd')});db['VtigerConfiguration'][_0xb48b('0x15d')](db[_0xb48b('0xc7')],{'as':_0xb48b('0x17c'),'foreignKey':'AccountId'});db[_0xb48b('0xcb')]['hasMany'](db[_0xb48b('0xcb')],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xcb')][_0xb48b('0x11f')](db[_0xb48b('0xcb')],{'as':_0xb48b('0x1cf'),'foreignKey':_0xb48b('0x1cc')});db['VtigerField'][_0xb48b('0x11f')](db[_0xb48b('0xcb')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xcb')]['belongsTo'](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':'VariableId'});db[_0xb48b('0x1d8')]['hasMany'](db['ServicenowConfiguration'],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':'AccountId'});db[_0xb48b('0xcd')][_0xb48b('0x11f')](db[_0xb48b('0xcf')],{'as':_0xb48b('0x1c9'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xb48b('0x11f')](db[_0xb48b('0xcf')],{'as':'Descriptions','foreignKey':_0xb48b('0x1cc')});db['ServicenowConfiguration'][_0xb48b('0x11f')](db[_0xb48b('0xcf')],{'as':_0xb48b('0x1c4'),'foreignKey':_0xb48b('0x1cd')});db['ServicenowConfiguration']['belongsTo'](db[_0xb48b('0x1d8')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xcf')][_0xb48b('0x11f')](db['ServicenowField'],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xcf')][_0xb48b('0x11f')](db[_0xb48b('0xcf')],{'as':'Description','foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xcf')]['hasMany'](db[_0xb48b('0xcf')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xcf')][_0xb48b('0x15d')](db[_0xb48b('0x9d')],{'as':_0xb48b('0x9d'),'foreignKey':_0xb48b('0x1d3')});db['Dynamics365Account'][_0xb48b('0x11f')](db['Dynamics365Configuration'],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xd1')][_0xb48b('0x15d')](db[_0xb48b('0x114')],{'as':_0xb48b('0x114'),'foreignKey':_0xb48b('0x16f')});db[_0xb48b('0xd3')][_0xb48b('0x11f')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1ca')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0xb48b('0x1d0'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xd3')][_0xb48b('0x11f')](db[_0xb48b('0xd5')],{'as':_0xb48b('0x1c4'),'onDelete':_0xb48b('0x11e'),'foreignKey':'FieldId'});db['Dynamics365Configuration']['belongsTo'](db[_0xb48b('0xd1')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xd5')][_0xb48b('0x11f')](db[_0xb48b('0xd5')],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xd5')][_0xb48b('0x11f')](db['Dynamics365Field'],{'as':_0xb48b('0x1cf'),'foreignKey':'DescriptionId'});db[_0xb48b('0xd5')][_0xb48b('0x11f')](db['Dynamics365Field'],{'as':_0xb48b('0x1d1'),'foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':_0xb48b('0x9d'),'foreignKey':_0xb48b('0x1d3')});db['FreshsalesAccount'][_0xb48b('0x11f')](db['FreshsalesConfiguration'],{'as':_0xb48b('0x1c7'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xd9')]['hasMany'](db[_0xb48b('0xdb')],{'as':_0xb48b('0x1c9'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xd9')][_0xb48b('0x11f')](db['FreshsalesField'],{'as':_0xb48b('0x1d0'),'foreignKey':'DescriptionId'});db[_0xb48b('0xd9')][_0xb48b('0x11f')](db['FreshsalesField'],{'as':_0xb48b('0x1c4'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xd9')][_0xb48b('0x15d')](db[_0xb48b('0xd7')],{'as':_0xb48b('0x17c'),'foreignKey':_0xb48b('0x1c8')});db[_0xb48b('0xdb')]['hasMany'](db['FreshsalesField'],{'as':_0xb48b('0x1ce'),'foreignKey':_0xb48b('0x1ca')});db[_0xb48b('0xdb')]['hasMany'](db[_0xb48b('0xdb')],{'as':'Description','foreignKey':_0xb48b('0x1cc')});db[_0xb48b('0xdb')][_0xb48b('0x11f')](db[_0xb48b('0xdb')],{'as':_0xb48b('0x1d1'),'foreignKey':_0xb48b('0x1cd')});db[_0xb48b('0xdb')][_0xb48b('0x15d')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db[_0xb48b('0x146')],{});db['ChatQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':'List','foreignKey':_0xb48b('0x178')});db[_0xb48b('0x1d9')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':_0xb48b('0x17d')});db[_0xb48b('0x1d9')][_0xb48b('0x15d')](db[_0xb48b('0x68')],{});db[_0xb48b('0x1d9')][_0xb48b('0x15d')](db[_0xb48b('0x69')],{});db[_0xb48b('0x1d9')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{});db[_0xb48b('0x1d9')]['belongsTo'](db[_0xb48b('0x13d')],{});db['ChatInternalMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x11e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x11e'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xb48b('0x11f')](db['JscriptyQuestionReport'],{'foreignKey':_0xb48b('0x1da'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0xe1')][_0xb48b('0x11f')](db['JscriptyAnswerReport'],{'foreignKey':_0xb48b('0x1da'),'onDelete':'cascade'});db[_0xb48b('0xe3')][_0xb48b('0x15d')](db[_0xb48b('0x14e')],{});db[_0xb48b('0xe3')]['belongsTo'](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0xe3')]['belongsTo'](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':'ContactId'});db[_0xb48b('0xe3')]['belongsTo'](db[_0xb48b('0x126')],{});db[_0xb48b('0xe3')][_0xb48b('0x15d')](db[_0xb48b('0x5b')],{});db['SmsQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{});db[_0xb48b('0xe3')][_0xb48b('0x15d')](db[_0xb48b('0x5d')],{});db[_0xb48b('0xe8')]['hasMany'](db[_0xb48b('0xe1')],{'foreignKey':'ProjectId'});db[_0xb48b('0xe8')][_0xb48b('0x11f')](db[_0xb48b('0x1db')],{'foreignKey':'ProjectId'});db[_0xb48b('0xe8')][_0xb48b('0x11f')](db[_0xb48b('0x1dc')],{'foreignKey':_0xb48b('0x1dd')});db['SquareProject'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18d'),'through':_0xb48b('0x153')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x131')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x1d')],{'through':'TeamVoiceQueue','as':_0xb48b('0x138')});db['Team'][_0xb48b('0x12b')](db[_0xb48b('0x43')],{'through':_0xb48b('0x1de'),'as':_0xb48b('0x13c')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x13d')],{'through':_0xb48b('0x1a4'),'as':_0xb48b('0x13e')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x56')],{'through':_0xb48b('0x1df'),'as':'FaxQueues'});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x5d')],{'through':_0xb48b('0x195'),'as':'SmsQueues'});db['Team'][_0xb48b('0x12b')](db[_0xb48b('0x64')],{'through':'team_has_openchannel_queues','as':_0xb48b('0x142')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x112')],{'through':_0xb48b('0x1e0'),'as':_0xb48b('0x144')});db[_0xb48b('0xf0')][_0xb48b('0x12b')](db[_0xb48b('0x139')],{'through':_0xb48b('0x117'),'as':_0xb48b('0x13a')});db[_0xb48b('0xf4')][_0xb48b('0x11f')](db[_0xb48b('0x73')],{'as':_0xb48b('0x158'),'foreignKey':_0xb48b('0x1ad')});db[_0xb48b('0xf4')][_0xb48b('0x11f')](db[_0xb48b('0x77')],{'as':_0xb48b('0x122'),'foreignKey':_0xb48b('0x1ad')});db['Campaign'][_0xb48b('0x11f')](db['CmHopperHistory'],{'as':_0xb48b('0x1a8'),'foreignKey':_0xb48b('0x1ad')});db[_0xb48b('0xf4')][_0xb48b('0x11f')](db[_0xb48b('0x75')],{'as':_0xb48b('0x15a'),'foreignKey':_0xb48b('0x1ad')});db[_0xb48b('0xf4')]['belongsTo'](db[_0xb48b('0x2c')],{'as':_0xb48b('0x2c'),'foreignKey':_0xb48b('0x15c')});db[_0xb48b('0xf4')][_0xb48b('0x15d')](db[_0xb48b('0x2c')],{'as':'TrunkBackup','foreignKey':_0xb48b('0x15f')});db['Campaign'][_0xb48b('0x15d')](db['Interval'],{'as':_0xb48b('0x86'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0xf4')][_0xb48b('0x15d')](db[_0xb48b('0xeb')],{'as':'SquareProject','foreignKey':_0xb48b('0x1e1')});db[_0xb48b('0xf4')][_0xb48b('0x12b')](db[_0xb48b('0x100')],{'as':_0xb48b('0x130'),'through':'campaigns_has_cm_lists'});db[_0xb48b('0xf4')][_0xb48b('0x12b')](db['CmList'],{'as':_0xb48b('0x165'),'through':_0xb48b('0x1e2')});db[_0xb48b('0xf7')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xb48b('0x1a2'),'foreignKey':'ChatOfflineMessageId'});db[_0xb48b('0xfa')][_0xb48b('0x15d')](db[_0xb48b('0x48')],{});db[_0xb48b('0xfa')]['belongsTo'](db[_0xb48b('0x47')],{});db[_0xb48b('0xfa')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'foreignKey':_0xb48b('0x1e3'),'as':_0xb48b('0x1e4')});db[_0xb48b('0xfa')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xb48b('0x1e5')});db[_0xb48b('0xfa')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':'ToUserId','as':_0xb48b('0x1e6')});db['MailTransferReport'][_0xb48b('0x15d')](db[_0xb48b('0x43')],{'foreignKey':_0xb48b('0x1e7'),'as':'ToQueue'});db[_0xb48b('0xfa')][_0xb48b('0x15d')](db[_0xb48b('0x41')],{'foreignKey':_0xb48b('0x1e8'),'as':'ToAccount'});db[_0xb48b('0xfb')][_0xb48b('0x15d')](db['ChatMessage'],{});db[_0xb48b('0xfb')]['belongsTo'](db[_0xb48b('0x68')],{});db[_0xb48b('0xfb')][_0xb48b('0x15d')](db[_0xb48b('0x146')],{'foreignKey':_0xb48b('0x1e9'),'as':_0xb48b('0x1e4')});db[_0xb48b('0xfb')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1ea'),'as':'FromAgent'});db['ChatTransferReport'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1eb'),'as':'ToAgent'});db[_0xb48b('0xfb')][_0xb48b('0x15d')](db['ChatQueue'],{'foreignKey':_0xb48b('0x1ec'),'as':'ToQueue'});db[_0xb48b('0xfb')][_0xb48b('0x15d')](db[_0xb48b('0x146')],{'foreignKey':_0xb48b('0x1ed'),'as':'ToAccount'});db[_0xb48b('0x1ee')][_0xb48b('0x15d')](db['FaxMessage'],{});db[_0xb48b('0x1ee')]['belongsTo'](db[_0xb48b('0x53')],{});db[_0xb48b('0x1ee')][_0xb48b('0x15d')](db[_0xb48b('0x187')],{'foreignKey':_0xb48b('0x1ef'),'as':'FromAccount'});db[_0xb48b('0x1ee')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1ea'),'as':_0xb48b('0x1e5')});db[_0xb48b('0x1ee')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1eb'),'as':_0xb48b('0x1e6')});db[_0xb48b('0x1ee')][_0xb48b('0x15d')](db[_0xb48b('0x56')],{'foreignKey':_0xb48b('0x1f0'),'as':_0xb48b('0x1f1')});db['FaxTransferReport'][_0xb48b('0x15d')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xb48b('0xfd')]['belongsTo'](db[_0xb48b('0x62')],{});db[_0xb48b('0xfd')][_0xb48b('0x15d')](db[_0xb48b('0x124')],{});db[_0xb48b('0xfd')][_0xb48b('0x15d')](db[_0xb48b('0x5f')],{'foreignKey':_0xb48b('0x1f2'),'as':_0xb48b('0x1e4')});db[_0xb48b('0xfd')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1ea'),'as':_0xb48b('0x1e5')});db[_0xb48b('0xfd')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1eb'),'as':_0xb48b('0x1e6')});db[_0xb48b('0xfd')][_0xb48b('0x15d')](db[_0xb48b('0x64')],{'foreignKey':_0xb48b('0x1f3'),'as':_0xb48b('0x1f1')});db['OpenchannelTransferReport']['belongsTo'](db[_0xb48b('0x5f')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xb48b('0xfe')]['belongsTo'](db[_0xb48b('0x5b')],{});db[_0xb48b('0xfe')][_0xb48b('0x15d')](db[_0xb48b('0x126')],{});db[_0xb48b('0xfe')][_0xb48b('0x15d')](db[_0xb48b('0x14e')],{'foreignKey':_0xb48b('0x1f4'),'as':'FromAccount'});db['SmsTransferReport'][_0xb48b('0x15d')](db['User'],{'foreignKey':_0xb48b('0x1ea'),'as':_0xb48b('0x1e5')});db['SmsTransferReport'][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1eb'),'as':_0xb48b('0x1e6')});db[_0xb48b('0xfe')][_0xb48b('0x15d')](db[_0xb48b('0x5d')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xb48b('0xfe')][_0xb48b('0x15d')](db['SmsAccount'],{'foreignKey':_0xb48b('0x1f5'),'as':'ToAccount'});db['CmList'][_0xb48b('0x11f')](db[_0xb48b('0x83')],{'as':_0xb48b('0x173'),'foreignKey':'ListId','onDelete':_0xb48b('0x11e')});db[_0xb48b('0x100')][_0xb48b('0x11f')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xb48b('0x178')});db[_0xb48b('0x100')][_0xb48b('0x11f')](db[_0xb48b('0x72')],{'as':_0xb48b('0x12e'),'onDelete':_0xb48b('0x11e'),'foreignKey':'ListId'});db[_0xb48b('0x100')]['hasMany'](db[_0xb48b('0x77')],{'as':_0xb48b('0x122'),'foreignKey':_0xb48b('0x178')});db['CmList'][_0xb48b('0x11f')](db[_0xb48b('0x79')],{'as':_0xb48b('0x123'),'foreignKey':_0xb48b('0x178')});db['CmList'][_0xb48b('0x11f')](db[_0xb48b('0x7b')],{'as':_0xb48b('0x7b'),'foreignKey':_0xb48b('0x178')});db[_0xb48b('0x100')]['belongsToMany'](db[_0xb48b('0x1d')],{'as':_0xb48b('0x1f6'),'through':_0xb48b('0x163')});db[_0xb48b('0x100')]['belongsToMany'](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x145')});db[_0xb48b('0x139')][_0xb48b('0x11f')](db[_0xb48b('0x19')],{'as':_0xb48b('0x121'),'onDelete':'cascade'});db['VoicePrefix'][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x13b')});db[_0xb48b('0x139')][_0xb48b('0x12b')](db['Team'],{'through':'TeamVoicePrefix','as':_0xb48b('0x164')});db[_0xb48b('0x103')][_0xb48b('0x11f')](db[_0xb48b('0x13')],{'as':'Users','foreignKey':_0xb48b('0x12a')});db[_0xb48b('0x103')][_0xb48b('0x11f')](db['UserProfileSection'],{'as':_0xb48b('0x1f7'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xb48b('0x1f8')][_0xb48b('0x11f')](db[_0xb48b('0x1f9')],{'as':_0xb48b('0x1fa'),'foreignKey':_0xb48b('0x1fb'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x107')][_0xb48b('0x11f')](db[_0xb48b('0x83')],{'as':_0xb48b('0x173'),'foreignKey':_0xb48b('0x1fc'),'onDelete':_0xb48b('0x11e')});db[_0xb48b('0x107')][_0xb48b('0x11f')](db[_0xb48b('0x188')],{'as':'Answers','foreignKey':_0xb48b('0x1fc')});db[_0xb48b('0x107')]['hasMany'](db['WhatsappMessage'],{'as':_0xb48b('0x167'),'foreignKey':_0xb48b('0x1fc')});db[_0xb48b('0x107')][_0xb48b('0x11f')](db[_0xb48b('0x10b')],{'as':'Interactions'});db[_0xb48b('0x107')]['hasMany'](db[_0xb48b('0x109')],{'as':_0xb48b('0x156')});db[_0xb48b('0x107')][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':'ListId'});db[_0xb48b('0x107')][_0xb48b('0x15d')](db['Pause'],{'as':_0xb48b('0x161'),'foreignKey':_0xb48b('0x162')});db[_0xb48b('0x107')]['belongsToMany'](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x1fd')});db[_0xb48b('0x109')]['belongsTo'](db[_0xb48b('0x13')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x109')][_0xb48b('0x15d')](db[_0xb48b('0x112')],{'onDelete':_0xb48b('0x170')});db[_0xb48b('0x109')]['belongsTo'](db[_0xb48b('0x107')],{'onDelete':_0xb48b('0x170')});db['WhatsappApplication'][_0xb48b('0x15d')](db['Interval'],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x160')});db[_0xb48b('0x109')][_0xb48b('0x15d')](db[_0xb48b('0x92')],{'onDelete':_0xb48b('0x170'),'foreignKey':_0xb48b('0x184')});db[_0xb48b('0x10b')][_0xb48b('0x11f')](db['WhatsappMessage'],{'as':_0xb48b('0x167'),'onDelete':_0xb48b('0x11e'),'foreignKey':_0xb48b('0x1fe')});db[_0xb48b('0x10b')][_0xb48b('0x15d')](db[_0xb48b('0x107')],{'as':'Account','foreignKey':_0xb48b('0x1fc')});db[_0xb48b('0x10b')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':_0xb48b('0x16d'),'foreignKey':'ContactId'});db[_0xb48b('0x10b')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x18b'),'foreignKey':'UserId'});db[_0xb48b('0x10b')][_0xb48b('0x12b')](db[_0xb48b('0x92')],{'through':_0xb48b('0x1bb'),'as':_0xb48b('0x18c')});db[_0xb48b('0x10b')]['belongsToMany'](db[_0xb48b('0x92')],{'through':_0xb48b('0x1bb'),'as':'ThroughTags'});db[_0xb48b('0x10b')][_0xb48b('0x12b')](db['User'],{'as':_0xb48b('0x18d'),'through':_0xb48b('0x137'),'foreignKey':_0xb48b('0x1fe')});db[_0xb48b('0x10d')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'as':_0xb48b('0x13')});db[_0xb48b('0x10d')][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x16d')});db['WhatsappMessage'][_0xb48b('0x15d')](db[_0xb48b('0x10b')],{'onDelete':_0xb48b('0x11e'),'as':_0xb48b('0x181'),'foreignKey':_0xb48b('0x1fe')});db[_0xb48b('0x10d')][_0xb48b('0x15d')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xb48b('0x1fc')});db[_0xb48b('0x10e')][_0xb48b('0x15d')](db[_0xb48b('0x107')],{});db['WhatsappQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x100')],{'as':_0xb48b('0x177'),'foreignKey':_0xb48b('0x178')});db['WhatsappQueueReport'][_0xb48b('0x15d')](db[_0xb48b('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xb48b('0x10e')][_0xb48b('0x15d')](db[_0xb48b('0x10b')],{});db[_0xb48b('0x10e')]['belongsTo'](db[_0xb48b('0x112')],{});db[_0xb48b('0x10e')]['belongsTo'](db[_0xb48b('0x10d')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xb48b('0x13')],{});db['WhatsappTransferReport'][_0xb48b('0x15d')](db['WhatsappMessage'],{});db[_0xb48b('0x110')][_0xb48b('0x15d')](db[_0xb48b('0x10b')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xb48b('0x107')],{'foreignKey':'FromWhatsappAccountId','as':_0xb48b('0x1e4')});db[_0xb48b('0x110')]['belongsTo'](db[_0xb48b('0x107')],{'foreignKey':_0xb48b('0x1ff'),'as':'ToAccount'});db[_0xb48b('0x110')][_0xb48b('0x15d')](db['WhatsappQueue'],{'foreignKey':_0xb48b('0x200'),'as':_0xb48b('0x1f1')});db[_0xb48b('0x110')][_0xb48b('0x15d')](db[_0xb48b('0x13')],{'foreignKey':_0xb48b('0x1ea'),'as':_0xb48b('0x1e5')});db[_0xb48b('0x110')][_0xb48b('0x15d')](db['User'],{'foreignKey':'ToUserId','as':_0xb48b('0x1e6')});db[_0xb48b('0x112')][_0xb48b('0x12b')](db[_0xb48b('0x13')],{'as':_0xb48b('0x17a'),'through':_0xb48b('0x3c'),'foreignKey':'WhatsappQueueId'});db[_0xb48b('0x112')][_0xb48b('0x12b')](db['Team'],{'through':_0xb48b('0x1e0'),'as':'Teams'});db[_0xb48b('0x119')][_0xb48b('0x15d')](db['User'],{'as':_0xb48b('0x201'),'foreignKey':_0xb48b('0x11b'),'onDelete':_0xb48b('0x11e'),'hooks':!![]});db[_0xb48b('0x114')]['hasOne'](db[_0xb48b('0xd1')],{'as':'Dynamics365Account','onDelete':_0xb48b('0x170')});db[_0xb48b('0x114')][_0xb48b('0x11c')](db['MailServerIn'],{'as':'Imap','onDelete':_0xb48b('0x170')});db[_0xb48b('0x114')]['hasOne'](db[_0xb48b('0x3f')],{'as':_0xb48b('0x172'),'onDelete':'restrict'});module[_0xb48b('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a9ea651..7f21f5b 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91aa=['/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./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/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/projects','./api/squareRecording','/api/square/messages','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','get','appPath','/index.html','path','express','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x91aa,0x1d8));var _0xa91a=function(_0x28fb17,_0x12d977){_0x28fb17=_0x28fb17-0x0;var _0x26d07d=_0x91aa[_0x28fb17];return _0x26d07d;};'use strict';var path=require(_0xa91a('0x0'));var express=require(_0xa91a('0x1'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0xa91a('0x2')];var clientSideLogs=require('./api/client-side-logs');exports[_0xa91a('0x3')]=function(_0x18ad2f){return setupLoggers(_0x18ad2f)[_0xa91a('0x4')](function(){_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x6'),require(_0xa91a('0x7')));_0x18ad2f['use'](_0xa91a('0x8'),require(_0xa91a('0x9')));_0x18ad2f[_0xa91a('0x5')]('/api/voice/contexts',require('./api/voiceContext'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xa'),require(_0xa91a('0xb')));_0x18ad2f['use']('/api/voice/mohs',require(_0xa91a('0xc')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd'),require(_0xa91a('0xe')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xf'),require(_0xa91a('0x10')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x11'),require(_0xa91a('0x12')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x13'),require('./api/voiceMail'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x14'),require('./api/voiceMailMessage'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x15'),require('./api/voiceCallReport'));_0x18ad2f['use'](_0xa91a('0x16'),require(_0xa91a('0x17')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x18'),require(_0xa91a('0x19')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x1a'),require(_0xa91a('0x1b')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x1c'),require(_0xa91a('0x1d')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x1e'),require(_0xa91a('0x1f')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x20'),require('./api/voiceTransferReport'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x21'),require(_0xa91a('0x22')));_0x18ad2f['use'](_0xa91a('0x23'),require(_0xa91a('0x24')));_0x18ad2f['use']('/api/mail/queues',require('./api/mailQueue'));_0x18ad2f['use'](_0xa91a('0x25'),require('./api/mailSubstatus'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x26'),require(_0xa91a('0x27')));_0x18ad2f['use'](_0xa91a('0x28'),require('./api/mailMessage'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x29'),require(_0xa91a('0x2a')));_0x18ad2f['use'](_0xa91a('0x2b'),require(_0xa91a('0x2c')));_0x18ad2f[_0xa91a('0x5')]('/api/dashboards',require(_0xa91a('0x2d')));_0x18ad2f['use']('/api/dashboards/items',require(_0xa91a('0x2e')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x2f'),require(_0xa91a('0x30')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x31'),require(_0xa91a('0x32')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x33'),require(_0xa91a('0x34')));_0x18ad2f['use'](_0xa91a('0x35'),require(_0xa91a('0x36')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x37'),require('./api/faxQueue'));_0x18ad2f['use'](_0xa91a('0x38'),require(_0xa91a('0x39')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x3a'),require('./api/smsAccount'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x3b'),require('./api/smsApplication'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x3c'),require(_0xa91a('0x3d')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x3e'),require(_0xa91a('0x3f')));_0x18ad2f['use'](_0xa91a('0x40'),require(_0xa91a('0x41')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x42'),require(_0xa91a('0x43')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x44'),require(_0xa91a('0x45')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x46'),require(_0xa91a('0x47')));_0x18ad2f['use'](_0xa91a('0x48'),require(_0xa91a('0x49')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x4a'),require(_0xa91a('0x4b')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x4c'),require(_0xa91a('0x4d')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x4e'),require(_0xa91a('0x4f')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x50'),require(_0xa91a('0x51')));_0x18ad2f['use'](_0xa91a('0x52'),require(_0xa91a('0x53')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x54'),require(_0xa91a('0x55')));_0x18ad2f['use'](_0xa91a('0x56'),require(_0xa91a('0x57')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x58'),require(_0xa91a('0x59')));_0x18ad2f['use'](_0xa91a('0x5a'),require(_0xa91a('0x5b')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x5c'),require(_0xa91a('0x5d')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x5e'),require(_0xa91a('0x5f')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x60'),require(_0xa91a('0x61')));_0x18ad2f[_0xa91a('0x5')]('/api/cm/hopper',require('./api/cmHopper'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x62'),require('./api/cmHopperBlack'));_0x18ad2f['use'](_0xa91a('0x63'),require(_0xa91a('0x64')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x65'),require('./api/cmHopperHistory'));_0x18ad2f[_0xa91a('0x5')]('/api/cm/custom_fields',require(_0xa91a('0x66')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x67'),require(_0xa91a('0x68')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x69'),require(_0xa91a('0x6a')));_0x18ad2f[_0xa91a('0x5')]('/api/canned_answers',require('./api/cannedAnswer'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x6b'),require(_0xa91a('0x6c')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x6d'),require(_0xa91a('0x6e')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x6f'),require(_0xa91a('0x70')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x71'),require('./api/pause'));_0x18ad2f['use'](_0xa91a('0x72'),require(_0xa91a('0x73')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x74'),require(_0xa91a('0x75')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x76'),require(_0xa91a('0x77')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x78'),require(_0xa91a('0x79')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x7a'),require(_0xa91a('0x7b')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x7c'),require('./api/contactItemType'));_0x18ad2f[_0xa91a('0x5')]('/api/cm_contact_has_items',require(_0xa91a('0x7d')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x7e'),require('./api/cmHopperAdditionalPhone'));_0x18ad2f['use'](_0xa91a('0x7f'),require(_0xa91a('0x80')));_0x18ad2f['use'](_0xa91a('0x81'),require(_0xa91a('0x82')));_0x18ad2f[_0xa91a('0x5')]('/api/variables',require('./api/variable'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x83'),require(_0xa91a('0x84')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x85'),require(_0xa91a('0x86')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x87'),require('./api/analyticCustomReport'));_0x18ad2f['use'](_0xa91a('0x88'),require('./api/analyticDefaultReport'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x89'),require(_0xa91a('0x8a')));_0x18ad2f['use'](_0xa91a('0x8b'),require(_0xa91a('0x8c')));_0x18ad2f[_0xa91a('0x5')]('/api/analytics/field_reports',require(_0xa91a('0x8d')));_0x18ad2f[_0xa91a('0x5')]('/api/analytics/tree_reports',require(_0xa91a('0x8e')));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/salesforce/accounts',require(_0xa91a('0x8f')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x90'),require('./api/intSalesforceConfiguration'));_0x18ad2f['use'](_0xa91a('0x91'),require('./api/intSalesforceField'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x92'),require(_0xa91a('0x93')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x94'),require('./api/intSugarcrmConfiguration'));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/sugarcrm/fields',require(_0xa91a('0x95')));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x18ad2f['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x96'),require(_0xa91a('0x97')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x98'),require(_0xa91a('0x99')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x9a'),require(_0xa91a('0x9b')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x9c'),require(_0xa91a('0x9d')));_0x18ad2f['use'](_0xa91a('0x9e'),require(_0xa91a('0x9f')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xa0'),require(_0xa91a('0xa1')));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/zendesk/fields',require(_0xa91a('0xa2')));_0x18ad2f['use'](_0xa91a('0xa3'),require('./api/intFreshdeskAccount'));_0x18ad2f['use'](_0xa91a('0xa4'),require(_0xa91a('0xa5')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xa6'),require(_0xa91a('0xa7')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xa8'),require(_0xa91a('0xa9')));_0x18ad2f['use']('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x18ad2f['use'](_0xa91a('0xaa'),require(_0xa91a('0xab')));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/servicenow/accounts',require(_0xa91a('0xac')));_0x18ad2f[_0xa91a('0x5')]('/api/integrations/servicenow/configurations',require(_0xa91a('0xad')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xae'),require('./api/intServicenowField'));_0x18ad2f['use'](_0xa91a('0xaf'),require(_0xa91a('0xb0')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xb1'),require(_0xa91a('0xb2')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xb3'),require(_0xa91a('0xb4')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xb5'),require(_0xa91a('0xb6')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xb7'),require(_0xa91a('0xb8')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xb9'),require('./api/intFreshsalesField'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xba'),require('./api/network'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xbb'),require(_0xa91a('0xbc')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xbd'),require('./api/chatInternalMessage'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xbe'),require('./api/jscriptyAnswerReport'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xbf'),require(_0xa91a('0xc0')));_0x18ad2f[_0xa91a('0x5')]('/api/jscripty/sessions/reports',require(_0xa91a('0xc1')));_0x18ad2f[_0xa91a('0x5')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xc2'),require(_0xa91a('0xc3')));_0x18ad2f[_0xa91a('0x5')]('/api/square/details/reports',require(_0xa91a('0xc4')));_0x18ad2f['use'](_0xa91a('0xc5'),require(_0xa91a('0xc6')));_0x18ad2f[_0xa91a('0x5')]('/api/settings',require(_0xa91a('0xc7')));_0x18ad2f[_0xa91a('0x5')]('/api/square/odbc',require('./api/squareOdbc'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xc8'),require('./api/squareProject'));_0x18ad2f[_0xa91a('0x5')]('/api/square/recordings',require(_0xa91a('0xc9')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xca'),require('./api/squareMessage'));_0x18ad2f[_0xa91a('0x5')]('/api/teams',require('./api/team'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xcb'),require(_0xa91a('0xcc')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xcd'),require(_0xa91a('0xce')));_0x18ad2f[_0xa91a('0x5')]('/api/migrations',require('./api/migration'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xcf'),require('./api/attachment'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd0'),require(_0xa91a('0xd1')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd2'),require(_0xa91a('0xd3')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd4'),require(_0xa91a('0xd5')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd6'),require('./api/faxTransferReport'));_0x18ad2f['use']('/api/openchannel/reports/transfer',require(_0xa91a('0xd7')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xd8'),require(_0xa91a('0xd9')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xda'),require(_0xa91a('0xdb')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xdc'),require(_0xa91a('0xdd')));_0x18ad2f['use'](_0xa91a('0xde'),require('./api/userProfile'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xdf'),require(_0xa91a('0xe0')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xe1'),require('./api/userProfileResource'));_0x18ad2f['use'](_0xa91a('0xe2'),require('./api/userNotification'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xe3'),require(_0xa91a('0xe4')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xe5'),require(_0xa91a('0xe6')));_0x18ad2f['use'](_0xa91a('0xe7'),require(_0xa91a('0xe8')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xe9'),require(_0xa91a('0xea')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xeb'),require('./api/whatsappQueueReport'));_0x18ad2f['use'](_0xa91a('0xec'),require(_0xa91a('0xed')));_0x18ad2f[_0xa91a('0x5')]('/api/whatsapp/queues',require(_0xa91a('0xee')));_0x18ad2f[_0xa91a('0x5')]('/api/cloudProviders',require(_0xa91a('0xef')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xf0'),require(_0xa91a('0xf1')));_0x18ad2f[_0xa91a('0x5')]('/api/user-settings',require(_0xa91a('0xf2')));_0x18ad2f['use'](_0xa91a('0xf3'),require('./api/authLocal'));_0x18ad2f['use'](_0xa91a('0xf4'),require(_0xa91a('0xf5')));_0x18ad2f[_0xa91a('0x5')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xf6'),require('./api/jira'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xf7'),require(_0xa91a('0xf8')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xf9'),require(_0xa91a('0xfa')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xfb'),require('./api/system'));_0x18ad2f[_0xa91a('0x5')]('/api/pm2',require(_0xa91a('0xfc')));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xfd'),require('./api/webbar'));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xfe'),clientSideLogs);_0x18ad2f[_0xa91a('0x5')](_0xa91a('0xff'),express[_0xa91a('0x100')](path[_0xa91a('0x101')](config[_0xa91a('0x102')],_0xa91a('0xff'))));_0x18ad2f['use'](_0xa91a('0x103'),express[_0xa91a('0x100')](path['join'](config[_0xa91a('0x102')],_0xa91a('0x103'))));_0x18ad2f[_0xa91a('0x5')]('/demo',express[_0xa91a('0x100')](path[_0xa91a('0x101')](config[_0xa91a('0x102')],_0xa91a('0x104'))));_0x18ad2f[_0xa91a('0x5')](_0xa91a('0x105'),express[_0xa91a('0x100')](path[_0xa91a('0x101')](config[_0xa91a('0x102')],'snippet',_0xa91a('0x106'))));_0x18ad2f[_0xa91a('0x5')]('/plugins',express[_0xa91a('0x100')](path['join'](config[_0xa91a('0x102')],_0xa91a('0x107'))));_0x18ad2f[_0xa91a('0x108')](_0xa91a('0x109'))['get'](errors[0x194]);_0x18ad2f[_0xa91a('0x108')]('/*')['get'](function(_0x3b772c,_0x2b3c2f){_0x2b3c2f[_0xa91a('0x10a')](path['resolve'](_0x18ad2f[_0xa91a('0x10b')](_0xa91a('0x10c'))+_0xa91a('0x10d')));});return _0x18ad2f;});}; \ No newline at end of file +var _0xe963=['./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/desk/accounts','./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/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/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/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','join','root','/apidoc','/www','static','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards'];(function(_0x81aa14,_0x283f55){var _0x403a23=function(_0x3d983c){while(--_0x3d983c){_0x81aa14['push'](_0x81aa14['shift']());}};_0x403a23(++_0x283f55);}(_0xe963,0xec));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x3e96('0x0'));var express=require(_0x3e96('0x1'));var errors=require(_0x3e96('0x2'));var config=require(_0x3e96('0x3'));var setupLoggers=require(_0x3e96('0x4'))[_0x3e96('0x5')];var clientSideLogs=require(_0x3e96('0x6'));exports[_0x3e96('0x7')]=function(_0x1dba7d){return setupLoggers(_0x1dba7d)['then'](function(){_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x9'),require(_0x3e96('0xa')));_0x1dba7d[_0x3e96('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x1dba7d[_0x3e96('0x8')]('/api/voice/contexts',require(_0x3e96('0xb')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xc'),require(_0x3e96('0xd')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xe'),require(_0x3e96('0xf')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x10'),require(_0x3e96('0x11')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x12'),require(_0x3e96('0x13')));_0x1dba7d[_0x3e96('0x8')]('/api/screen/recordings',require(_0x3e96('0x14')));_0x1dba7d[_0x3e96('0x8')]('/api/voice/mails',require(_0x3e96('0x15')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x16'),require(_0x3e96('0x17')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x18'),require(_0x3e96('0x19')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x1a'),require(_0x3e96('0x1b')));_0x1dba7d[_0x3e96('0x8')]('/api/voice/agents/reports',require(_0x3e96('0x1c')));_0x1dba7d['use']('/api/voice/queues/reports',require(_0x3e96('0x1d')));_0x1dba7d['use'](_0x3e96('0x1e'),require(_0x3e96('0x1f')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x20'),require(_0x3e96('0x21')));_0x1dba7d['use']('/api/voice/transfers/reports',require(_0x3e96('0x22')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x23'),require('./api/mailServerOut'));_0x1dba7d[_0x3e96('0x8')]('/api/mail/accounts',require(_0x3e96('0x24')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x25'),require('./api/mailQueue'));_0x1dba7d[_0x3e96('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x1dba7d['use'](_0x3e96('0x26'),require(_0x3e96('0x27')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x28'),require(_0x3e96('0x29')));_0x1dba7d[_0x3e96('0x8')]('/api/mail/applications',require('./api/mailApplication'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x2a'),require(_0x3e96('0x2b')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x2c'),require(_0x3e96('0x2d')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x2e'),require(_0x3e96('0x2f')));_0x1dba7d[_0x3e96('0x8')]('/api/fax/accounts',require('./api/faxAccount'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x30'),require(_0x3e96('0x31')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x32'),require(_0x3e96('0x33')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x34'),require(_0x3e96('0x35')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x36'),require(_0x3e96('0x37')));_0x1dba7d[_0x3e96('0x8')]('/api/fax/reports/queue',require(_0x3e96('0x38')));_0x1dba7d['use'](_0x3e96('0x39'),require(_0x3e96('0x3a')));_0x1dba7d['use'](_0x3e96('0x3b'),require(_0x3e96('0x3c')));_0x1dba7d['use'](_0x3e96('0x3d'),require(_0x3e96('0x3e')));_0x1dba7d['use'](_0x3e96('0x3f'),require(_0x3e96('0x40')));_0x1dba7d[_0x3e96('0x8')]('/api/sms/queues',require('./api/smsQueue'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x41'),require(_0x3e96('0x42')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x43'),require(_0x3e96('0x44')));_0x1dba7d['use'](_0x3e96('0x45'),require(_0x3e96('0x46')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x47'),require('./api/openchannelMessage'));_0x1dba7d['use'](_0x3e96('0x48'),require(_0x3e96('0x49')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x4a'),require(_0x3e96('0x4b')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x4c'),require(_0x3e96('0x4d')));_0x1dba7d[_0x3e96('0x8')]('/api/chat/applications',require(_0x3e96('0x4e')));_0x1dba7d['use'](_0x3e96('0x4f'),require('./api/chatInteraction'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x50'),require('./api/chatMessage'));_0x1dba7d[_0x3e96('0x8')]('/api/chat/offline_messages',require(_0x3e96('0x51')));_0x1dba7d[_0x3e96('0x8')]('/api/chat/queues',require(_0x3e96('0x52')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x53'),require(_0x3e96('0x54')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x55'),require(_0x3e96('0x56')));_0x1dba7d[_0x3e96('0x8')]('/api/cm/companies',require('./api/cmCompany'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x57'),require(_0x3e96('0x58')));_0x1dba7d['use']('/api/cm/hopper',require('./api/cmHopper'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x59'),require('./api/cmHopperBlack'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x5a'),require(_0x3e96('0x5b')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x5c'),require(_0x3e96('0x5d')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x5e'),require(_0x3e96('0x5f')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x60'),require(_0x3e96('0x61')));_0x1dba7d['use'](_0x3e96('0x62'),require(_0x3e96('0x63')));_0x1dba7d['use'](_0x3e96('0x64'),require(_0x3e96('0x65')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x66'),require('./api/disposition'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x67'),require('./api/condition'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x68'),require(_0x3e96('0x69')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x6a'),require(_0x3e96('0x6b')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x6c'),require(_0x3e96('0x6d')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x6e'),require('./api/voiceQueuesLog'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x6f'),require(_0x3e96('0x70')));_0x1dba7d['use']('/api/sounds',require(_0x3e96('0x71')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x72'),require('./api/tag'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x73'),require(_0x3e96('0x74')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x75'),require(_0x3e96('0x76')));_0x1dba7d['use'](_0x3e96('0x77'),require(_0x3e96('0x78')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x79'),require(_0x3e96('0x7a')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x7b'),require(_0x3e96('0x7c')));_0x1dba7d['use'](_0x3e96('0x7d'),require(_0x3e96('0x7e')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x7f'),require('./api/integration'));_0x1dba7d['use'](_0x3e96('0x80'),require(_0x3e96('0x81')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x82'),require(_0x3e96('0x83')));_0x1dba7d[_0x3e96('0x8')]('/api/analytics/default_reports',require(_0x3e96('0x84')));_0x1dba7d['use'](_0x3e96('0x85'),require(_0x3e96('0x86')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x87'),require(_0x3e96('0x88')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x89'),require(_0x3e96('0x8a')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x8b'),require(_0x3e96('0x8c')));_0x1dba7d['use']('/api/integrations/salesforce/accounts',require(_0x3e96('0x8d')));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/salesforce/configurations',require(_0x3e96('0x8e')));_0x1dba7d['use'](_0x3e96('0x8f'),require(_0x3e96('0x90')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x91'),require(_0x3e96('0x92')));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x1dba7d['use'](_0x3e96('0x93'),require(_0x3e96('0x94')));_0x1dba7d['use'](_0x3e96('0x95'),require(_0x3e96('0x96')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x97'),require(_0x3e96('0x98')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x99'),require(_0x3e96('0x9a')));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/zoho/configurations',require(_0x3e96('0x9b')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x9c'),require(_0x3e96('0x9d')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x9e'),require(_0x3e96('0x9f')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xa0'),require(_0x3e96('0xa1')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xa2'),require(_0x3e96('0xa3')));_0x1dba7d['use']('/api/integrations/freshdesk/accounts',require(_0x3e96('0xa4')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xa5'),require(_0x3e96('0xa6')));_0x1dba7d['use'](_0x3e96('0xa7'),require(_0x3e96('0xa8')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xa9'),require('./api/intVtigerAccount'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xaa'),require(_0x3e96('0xab')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xac'),require(_0x3e96('0xad')));_0x1dba7d['use'](_0x3e96('0xae'),require(_0x3e96('0xaf')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xb0'),require(_0x3e96('0xb1')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xb2'),require('./api/intServicenowField'));_0x1dba7d['use'](_0x3e96('0xb3'),require(_0x3e96('0xb4')));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/dynamics365/configurations',require(_0x3e96('0xb5')));_0x1dba7d[_0x3e96('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xb6'),require('./api/intFreshsalesAccount'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xb7'),require('./api/intFreshsalesConfiguration'));_0x1dba7d['use'](_0x3e96('0xb8'),require(_0x3e96('0xb9')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xba'),require(_0x3e96('0xbb')));_0x1dba7d['use'](_0x3e96('0xbc'),require(_0x3e96('0xbd')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xbe'),require(_0x3e96('0xbf')));_0x1dba7d['use'](_0x3e96('0xc0'),require('./api/jscriptyAnswerReport'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xc1'),require(_0x3e96('0xc2')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xc3'),require(_0x3e96('0xc4')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xc5'),require(_0x3e96('0xc6')));_0x1dba7d['use']('/api/square/reports',require(_0x3e96('0xc7')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xc8'),require(_0x3e96('0xc9')));_0x1dba7d[_0x3e96('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xca'),require(_0x3e96('0xcb')));_0x1dba7d['use'](_0x3e96('0xcc'),require(_0x3e96('0xcd')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xce'),require(_0x3e96('0xcf')));_0x1dba7d[_0x3e96('0x8')]('/api/square/recordings',require(_0x3e96('0xd0')));_0x1dba7d[_0x3e96('0x8')]('/api/square/messages',require(_0x3e96('0xd1')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xd2'),require(_0x3e96('0xd3')));_0x1dba7d['use'](_0x3e96('0xd4'),require(_0x3e96('0xd5')));_0x1dba7d['use'](_0x3e96('0xd6'),require(_0x3e96('0xd7')));_0x1dba7d[_0x3e96('0x8')]('/api/migrations',require(_0x3e96('0xd8')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xd9'),require(_0x3e96('0xda')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xdb'),require(_0x3e96('0xdc')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xdd'),require(_0x3e96('0xde')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xdf'),require(_0x3e96('0xe0')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xe1'),require(_0x3e96('0xe2')));_0x1dba7d['use'](_0x3e96('0xe3'),require(_0x3e96('0xe4')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xe5'),require('./api/smsTransferReport'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xe6'),require(_0x3e96('0xe7')));_0x1dba7d[_0x3e96('0x8')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x1dba7d['use'](_0x3e96('0xe8'),require(_0x3e96('0xe9')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xea'),require(_0x3e96('0xeb')));_0x1dba7d[_0x3e96('0x8')]('/api/userProfile/resources',require(_0x3e96('0xec')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xed'),require(_0x3e96('0xee')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xef'),require(_0x3e96('0xf0')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xf1'),require('./api/whatsappApplication'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xf2'),require(_0x3e96('0xf3')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xf4'),require('./api/whatsappMessage'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xf5'),require(_0x3e96('0xf6')));_0x1dba7d['use']('/api/whatsapp/reports/transfer',require(_0x3e96('0xf7')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xf8'),require(_0x3e96('0xf9')));_0x1dba7d[_0x3e96('0x8')]('/api/cloudProviders',require(_0x3e96('0xfa')));_0x1dba7d[_0x3e96('0x8')]('/api/realtime',require('./api/realtime'));_0x1dba7d[_0x3e96('0x8')]('/api/user-settings',require('./api/user-setting'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xfb'),require('./api/authLocal'));_0x1dba7d['use'](_0x3e96('0xfc'),require('./api/authGoogle'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xfd'),require(_0x3e96('0xfe')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0xff'),require(_0x3e96('0x100')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x101'),require('./api/rpc'));_0x1dba7d[_0x3e96('0x8')]('/api/version',require(_0x3e96('0x102')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x103'),require(_0x3e96('0x104')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x105'),require('./api/pm2'));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x106'),require(_0x3e96('0x107')));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x108'),clientSideLogs);_0x1dba7d['use']('/apidoc',express['static'](path[_0x3e96('0x109')](config[_0x3e96('0x10a')],_0x3e96('0x10b'))));_0x1dba7d['use'](_0x3e96('0x10c'),express[_0x3e96('0x10d')](path['join'](config[_0x3e96('0x10a')],_0x3e96('0x10c'))));_0x1dba7d['use'](_0x3e96('0x10e'),express[_0x3e96('0x10d')](path[_0x3e96('0x109')](config[_0x3e96('0x10a')],_0x3e96('0x10e'))));_0x1dba7d['use']('/snippet',express['static'](path[_0x3e96('0x109')](config['root'],_0x3e96('0x10f'),_0x3e96('0x110'))));_0x1dba7d[_0x3e96('0x8')](_0x3e96('0x111'),express[_0x3e96('0x10d')](path[_0x3e96('0x109')](config[_0x3e96('0x10a')],_0x3e96('0x112'))));_0x1dba7d[_0x3e96('0x113')](_0x3e96('0x114'))['get'](errors[0x194]);_0x1dba7d[_0x3e96('0x113')]('/*')[_0x3e96('0x115')](function(_0x5378ac,_0x157467){_0x157467['sendFile'](path[_0x3e96('0x116')](_0x1dba7d['get'](_0x3e96('0x117'))+_0x3e96('0x118')));});return _0x1dba7d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 39e9af5..9ca82b1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbbd=['../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../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/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc'];(function(_0x286c17,_0x51742e){var _0x52f89c=function(_0xff55ba){while(--_0xff55ba){_0x286c17['push'](_0x286c17['shift']());}};_0x52f89c(++_0x51742e);}(_0xbbbd,0x86));var _0xdbbb=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbbbd[_0x199572];return _0x13cfa3;};'use strict';var jayson=require(_0xdbbb('0x0'));var _=require(_0xdbbb('0x1'));var config=require(_0xdbbb('0x2'));exports[_0xdbbb('0x3')]=function(){return new Promise(function(_0x364f2b,_0x21cb13){var _0x2f4a15={};_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x5')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x6')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/voiceQueue/voiceQueue.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x7')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x8')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x9')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0xa')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0xb')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0xc')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0xd')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0xe')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0xf')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x10')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x11')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x12')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x13')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x14')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x15')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x16')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x17')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x18')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x19')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/faxMessage/faxMessage.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x1a')));_0x2f4a15=_['merge'](_0x2f4a15,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x1b')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/smsInteraction/smsInteraction.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x1c')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x1d')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x1e')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x1f')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x20')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x21')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x22')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/chatMessage/chatMessage.rpc'));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x23')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x24')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x25')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x26')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x27')));_0x2f4a15=_['merge'](_0x2f4a15,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x28')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x29')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x2a')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x2b')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x2c')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x2d')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x2e')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x2f')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x30')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x31')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x32')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x33')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x34')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x35')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x36')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x37')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x38')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x39')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x3a')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/squareOdbc/squareOdbc.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x3b')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x3c')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/squareMessage/squareMessage.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x3d')));_0x2f4a15=_['merge'](_0x2f4a15,require(_0xdbbb('0x3e')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x3f')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x40')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x41')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x42')));_0x2f4a15=_[_0xdbbb('0x4')](_0x2f4a15,require(_0xdbbb('0x43')));var _0x529f83=jayson[_0xdbbb('0x44')](_0x2f4a15)[_0xdbbb('0x45')]();var _0x179b20=config[_0xdbbb('0x46')][_0xdbbb('0x47')]||config[_0xdbbb('0x47')]+0x1;var _0x2d7d84=config['rpc']['ip']||'localhost';_0x529f83['on']('error',function(_0x2bc5e1){return _0x21cb13(_0x2bc5e1);});_0x529f83[_0xdbbb('0x3')](_0x179b20,_0x2d7d84,function(){console['log'](_0xdbbb('0x48'),_0x2d7d84,_0x179b20);require(_0xdbbb('0x49'))[_0xdbbb('0x4a')]();return _0x364f2b(_0xdbbb('0x4b')+_0x2d7d84+':'+_0x179b20);});});}; \ No newline at end of file +var _0x0b3b=['listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.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/mailInteraction/mailInteraction.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/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','lodash','../config/environment'];(function(_0x899b5d,_0x3ff719){var _0x731d1b=function(_0xafbd13){while(--_0xafbd13){_0x899b5d['push'](_0x899b5d['shift']());}};_0x731d1b(++_0x3ff719);}(_0x0b3b,0xcd));var _0xb0b3=function(_0x47a374,_0x2f612f){_0x47a374=_0x47a374-0x0;var _0x2f60bd=_0x0b3b[_0x47a374];return _0x2f60bd;};'use strict';var jayson=require('jayson/promise');var _=require(_0xb0b3('0x0'));var config=require(_0xb0b3('0x1'));exports[_0xb0b3('0x2')]=function(){return new Promise(function(_0x1ac609,_0x17c1d9){var _0xf01cb7={};_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x4')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x5')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/voiceQueue/voiceQueue.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/voiceRecording/voiceRecording.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x6')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x7')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0xf01cb7=_['merge'](_0xf01cb7,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x8')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x9')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0xa')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0xb')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0xc')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0xd')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0xe')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0xf')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x10')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x11')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0x12')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/faxApplication/faxApplication.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x13')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0x14')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/faxQueue/faxQueue.rpc'));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0x15')));_0xf01cb7=_['merge'](_0xf01cb7,require('../api/smsAccount/smsAccount.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x16')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x17')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x18')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x19')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0x1a')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x1b')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x1c')));_0xf01cb7=_['merge'](_0xf01cb7,require('../api/chatInteraction/chatInteraction.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x1d')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/chatQueue/chatQueue.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x1e')));_0xf01cb7=_['merge'](_0xf01cb7,require('../api/cmHopper/cmHopper.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x1f')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x20')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x21')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x22')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x23')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x24')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x25')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x26')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x27')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x28')));_0xf01cb7=_['merge'](_0xf01cb7,require(_0xb0b3('0x29')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2a')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2b')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2c')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2d')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2e')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x2f')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x30')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x31')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/chatQueueReport/chatQueueReport.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/smsQueueReport/smsQueueReport.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x32')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x33')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x34')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x35')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x36')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x37')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/squareMessage/squareMessage.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x38')));_0xf01cb7=_['merge'](_0xf01cb7,require('../api/attachment/attachment.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x39')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x3a')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x3b')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x3c')));_0xf01cb7=_[_0xb0b3('0x3')](_0xf01cb7,require(_0xb0b3('0x3d')));var _0x10f503=jayson['server'](_0xf01cb7)[_0xb0b3('0x3e')]();var _0x1cf5d2=config[_0xb0b3('0x3f')][_0xb0b3('0x40')]||config['port']+0x1;var _0x31a3c4=config[_0xb0b3('0x3f')]['ip']||_0xb0b3('0x41');_0x10f503['on'](_0xb0b3('0x42'),function(_0x1324db){return _0x17c1d9(_0x1324db);});_0x10f503[_0xb0b3('0x2')](_0x1cf5d2,_0x31a3c4,function(){console['log'](_0xb0b3('0x43'),_0x31a3c4,_0x1cf5d2);require(_0xb0b3('0x44'))['default']();return _0x1ac609('RPC\x20listening\x20on\x20'+_0x31a3c4+':'+_0x1cf5d2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c92c7de..13745f4 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 _0xe5af=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','lodash','events','./reply','./error','call','setEncoding','utf8','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','sendRequest','sync','prototype','answer','getData','beep','format','noop','NO\x20MESSAGE','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0xc74079,_0x3c8634){var _0x375ff5=function(_0x57c6b){while(--_0x57c6b){_0xc74079['push'](_0xc74079['shift']());}};_0x375ff5(++_0x3c8634);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1db863,_0x8f181d){_0x1db863=_0x1db863-0x0;var _0x18b578=_0xe5af[_0x1db863];return _0x18b578;};'use strict';var util=require('util');var _=require(_0xfe5a('0x0'));var EventEmitter=require(_0xfe5a('0x1'))['EventEmitter'];var AGIReply=require(_0xfe5a('0x2'));var AGIError=require(_0xfe5a('0x3'));function AGIChannel(_0x23b7f0){var _0x4adbd1=this,_0x1165e3=new AGIReply(),_0x48e3a7=![],_0x526677={};EventEmitter[_0xfe5a('0x4')](_0x4adbd1);_0x23b7f0[_0xfe5a('0x5')]('utf8');_0x23b7f0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1165e3[_0xfe5a('0x5')](_0xfe5a('0x6'));_0x1165e3['on'](_0xfe5a('0x7'),function(_0x3e683c){for(var _0x5cd100 in _0x3e683c){_0x4adbd1[_0x5cd100]=_0x3e683c[_0x5cd100];}_0x4adbd1[_0xfe5a('0x8')]('ready');});_0x1165e3['on']('line',function(_0x259e8a){if(_0x259e8a[_0xfe5a('0x9')]()=='hangup'){_0x4adbd1[_0xfe5a('0x8')](_0xfe5a('0xa'));return;}if(_0x259e8a[_0xfe5a('0xb')](0x0,0xb)==_0xfe5a('0xc')){_0x48e3a7=!![];}if(_0x48e3a7){_0x526677['rx']+=_0x259e8a+'\x0a';if(_0x259e8a[_0xfe5a('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x48e3a7=![];}}else{_0x526677['rx']=_0x259e8a;}if(_0x48e3a7){return;}if(typeof _0x526677['cb']==_0xfe5a('0xe')){var _0x9d1f4f=_0x526677['rx'][_0xfe5a('0xb')](0x0,0x3),_0x20b206=null,_0x374ded=null;_0x9d1f4f=parseInt(_0x9d1f4f);if(isNaN(_0x9d1f4f)){_0x526677['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x9d1f4f!=0xc8){_0x526677['cb'](null,{'code':_0x9d1f4f,'result':-0x1,'extra':'KO'});return;}_0x20b206=_0x526677['rx'][_0xfe5a('0xb')](0x4)[_0xfe5a('0xf')](_0xfe5a('0x10'),'');if(_0x20b206[_0xfe5a('0x11')]('\x20')!=-0x1){_0x20b206=_0x20b206[_0xfe5a('0x12')](0x0,_0x20b206[_0xfe5a('0x11')]('\x20'));}if(_[_0xfe5a('0x13')](_0x20b206,'-1')){_0x20b206=parseInt(_0x20b206);}_0x374ded=_0x526677['rx'][_0xfe5a('0x14')]('\x20');if(_0x374ded[_0xfe5a('0x15')]==0x3){_0x374ded=_0x374ded[0x2][_0xfe5a('0xb')](0x1,_0x374ded[0x2][_0xfe5a('0x15')]-0x1);}else if(_0x374ded[_0xfe5a('0x15')]>0x3){var _0x22afa7=/\((.+)\)/;var _0x290600=_0x526677['rx'][_0xfe5a('0x16')](_0x22afa7);if(_0x290600){_0x374ded=_0x290600[0x1];}else{_0x374ded=null;}}else{_0x374ded=null;}_0x526677['cb'](null,{'code':_0x9d1f4f,'result':_0x20b206,'extra':_0x374ded});}});_0x23b7f0['on'](_0xfe5a('0x17'),function(_0x5bf597){_0x4adbd1[_0xfe5a('0x8')](_0xfe5a('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x5bf597[_0xfe5a('0x18')]));});_0x23b7f0['on'](_0xfe5a('0x19'),function(){_0x4adbd1[_0xfe5a('0x8')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x23b7f0['on'](_0xfe5a('0x1a'),function(){_0x4adbd1[_0xfe5a('0x8')](_0xfe5a('0x1a'),new AGIError(_0xfe5a('0x1b')));_0x23b7f0[_0xfe5a('0x1c')]();});_0x23b7f0[_0xfe5a('0x1d')](_0x1165e3);this['command']=function(_0x4770bb,_0x592521){var _0x4770bb=_0x4770bb||'',_0x592521=typeof _0x592521==_0xfe5a('0xe')?_0x592521:new Function();_0x526677={'tx':_0x4770bb,'rx':'','cb':_0x592521};_0x23b7f0['write'](_0x4770bb+'\x0a');},this['close']=function(){_0x23b7f0[_0xfe5a('0x1c')]();};}util[_0xfe5a('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xfe5a('0x1f')]=function(_0x26f744){return this['command'][_0xfe5a('0x20')](this,_0x26f744);};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x22')]=function(){return this[_0xfe5a('0x1f')]('ANSWER');};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x23')]=function(_0x24481f,_0x1cd531,_0x36bf20){_0x24481f=_0x24481f===undefined?_0xfe5a('0x24'):_0x24481f;_0x1cd531=_0x1cd531===undefined?'5':_0x1cd531;_0x36bf20=_0x36bf20===undefined?'1':_0x36bf20;return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x24481f,_0x1cd531*0x3e8,_0x36bf20));};AGIChannel['prototype'][_0xfe5a('0x26')]=function(_0x485f9d){_0x485f9d=_0x485f9d||_0xfe5a('0x27');return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')]('VERBOSE\x20\x22%s\x22',_0x485f9d));};AGIChannel['prototype']['exec']=function(_0x32d31e,_0x582f2d){if(_['isArray'](_0x582f2d)){return this['sendRequest'](util[_0xfe5a('0x25')](_0xfe5a('0x28'),_0x32d31e,_0x582f2d[_0xfe5a('0x29')](',')));}return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')](_0xfe5a('0x28'),_0x32d31e,_0x582f2d));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x2a')]=function(_0x414ab8){return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')]('SET\x20CONTEXT\x20%s',_0x414ab8));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x2b')]=function(_0x584de3){return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')](_0xfe5a('0x2c'),_0x584de3));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x2d')]=function(_0x5ed29a){return this['sendRequest'](util[_0xfe5a('0x25')]('SET\x20PRIORITY\x20%s',_0x5ed29a));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0xa')]=function(){return this[_0xfe5a('0x1f')](_0xfe5a('0x2e'));};AGIChannel['prototype'][_0xfe5a('0x2f')]=function(_0x1817fe,_0x2e3a36){var _0x5d4753=_[_0xfe5a('0x30')](_0x2e3a36)||_[_0xfe5a('0x31')](_0x2e3a36)?_0x2e3a36[_0xfe5a('0x32')]():_0x2e3a36;return this[_0xfe5a('0x1f')](util['format'](_0xfe5a('0x33'),_0x1817fe,_0x5d4753?_0x5d4753['toString']()[_0xfe5a('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfe5a('0x21')]['sayNumber']=function(_0x1bd4ef,_0x45e31a){return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')]('SAY\x20NUMBER\x20%s\x20%s',_0x1bd4ef,_0x45e31a));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x34')]=function(_0x188470,_0x560088){return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')](_0xfe5a('0x35'),_0x188470,_0x560088));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x36')]=function(_0x162c48,_0x16bb85){return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')](_0xfe5a('0x37'),_0x162c48,_0x16bb85));};AGIChannel[_0xfe5a('0x21')]['continueAt']=function(_0x355d05,_0x315396,_0x29e2aa){_0x315396=_0x315396||this[_0xfe5a('0x38')];_0x29e2aa=_0x29e2aa||0x1;this[_0xfe5a('0x2a')](_0x355d05);this[_0xfe5a('0x2b')](_0x315396);this[_0xfe5a('0x2d')](_0x29e2aa);return this['noop'](util[_0xfe5a('0x25')](_0xfe5a('0x39'),_0x355d05,_0x315396,_0x29e2aa));};AGIChannel['prototype']['getVariable']=function(_0x252904){return this['sendRequest'](util['format'](_0xfe5a('0x3a'),_0x252904));};AGIChannel[_0xfe5a('0x21')]['recordFile']=function(_0x43c85f,_0x5a9c92,_0x5112a9,_0x1dbb2c,_0x1a92ef,_0x2beb0b){_0x5a9c92=_0x5a9c92||_0xfe5a('0x3b');_0x5112a9=_0x5112a9||'';_0x1dbb2c=_0x1dbb2c===undefined?-0x1:_0x1dbb2c==='-1'?-0x1:_0x1dbb2c*0x3e8;_0x1a92ef=_0x1a92ef===undefined?'':'s='+_0x1a92ef;_0x2beb0b=_0x2beb0b?_0xfe5a('0x3c'):'';return this['sendRequest'](util[_0xfe5a('0x25')](_0xfe5a('0x3d'),_0x43c85f,_0x5a9c92,_0x5112a9,_0x1dbb2c,_0x2beb0b,_0x1a92ef));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x3e')]=function(_0x462ee9,_0x1b0635){_0x1b0635=_0x1b0635||'';return this[_0xfe5a('0x1f')](util[_0xfe5a('0x25')](_0xfe5a('0x3f'),_0x462ee9,_0x1b0635));};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x40')]=function(_0x1c6902){return this[_0xfe5a('0x41')](_0xfe5a('0x42'),_0x1c6902);};AGIChannel['prototype'][_0xfe5a('0x43')]=function(_0x3df23){return this['exec']('WAIT',_0x3df23);};AGIChannel[_0xfe5a('0x21')][_0xfe5a('0x17')]=function(_0x1e9da8,_0x3ccf98){this[_0xfe5a('0x26')](util[_0xfe5a('0x25')](_0xfe5a('0x44'),_0x1e9da8['id'],_0x1e9da8['label'],_0x3ccf98));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfe5a('0x45')]=AGIChannel; \ No newline at end of file +var _0x3274=['SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','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','AGI','wait','WAIT','noop','label','exports','util','events','EventEmitter','./error','setEncoding','utf8','ready','toLowerCase','emit','substring','520-Invalid','search','function','no\x20code','result=','indexOf','substr','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','write','inherits','prototype','sendRequest','sync','getData','beep','format','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','hangup','HANGUP','setVariable','isNumber'];(function(_0x1326bb,_0x51fade){var _0x5482b2=function(_0x22f47c){while(--_0x22f47c){_0x1326bb['push'](_0x1326bb['shift']());}};_0x5482b2(++_0x51fade);}(_0x3274,0x134));var _0x4327=function(_0x3fae61,_0x49473a){_0x3fae61=_0x3fae61-0x0;var _0xbd1eb6=_0x3274[_0x3fae61];return _0xbd1eb6;};'use strict';var util=require(_0x4327('0x0'));var _=require('lodash');var EventEmitter=require(_0x4327('0x1'))[_0x4327('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x4327('0x3'));function AGIChannel(_0x1589c3){var _0x3efddf=this,_0x3f6753=new AGIReply(),_0x169660=![],_0x251a57={};EventEmitter['call'](_0x3efddf);_0x1589c3[_0x4327('0x4')](_0x4327('0x5'));_0x1589c3['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3f6753[_0x4327('0x4')](_0x4327('0x5'));_0x3f6753['on']('headers',function(_0x43b30b){for(var _0x321a83 in _0x43b30b){_0x3efddf[_0x321a83]=_0x43b30b[_0x321a83];}_0x3efddf['emit'](_0x4327('0x6'));});_0x3f6753['on']('line',function(_0x34aaa8){if(_0x34aaa8[_0x4327('0x7')]()=='hangup'){_0x3efddf[_0x4327('0x8')]('hangup');return;}if(_0x34aaa8[_0x4327('0x9')](0x0,0xb)==_0x4327('0xa')){_0x169660=!![];}if(_0x169660){_0x251a57['rx']+=_0x34aaa8+'\x0a';if(_0x34aaa8[_0x4327('0xb')]('520\x20End\x20of\x20proper')!=-0x1){_0x169660=![];}}else{_0x251a57['rx']=_0x34aaa8;}if(_0x169660){return;}if(typeof _0x251a57['cb']==_0x4327('0xc')){var _0x15ccbc=_0x251a57['rx'][_0x4327('0x9')](0x0,0x3),_0x3a40ca=null,_0x51c55d=null;_0x15ccbc=parseInt(_0x15ccbc);if(isNaN(_0x15ccbc)){_0x251a57['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4327('0xd')});return;}if(_0x15ccbc!=0xc8){_0x251a57['cb'](null,{'code':_0x15ccbc,'result':-0x1,'extra':'KO'});return;}_0x3a40ca=_0x251a57['rx'][_0x4327('0x9')](0x4)['replace'](_0x4327('0xe'),'');if(_0x3a40ca[_0x4327('0xf')]('\x20')!=-0x1){_0x3a40ca=_0x3a40ca[_0x4327('0x10')](0x0,_0x3a40ca[_0x4327('0xf')]('\x20'));}if(_['startsWith'](_0x3a40ca,'-1')){_0x3a40ca=parseInt(_0x3a40ca);}_0x51c55d=_0x251a57['rx'][_0x4327('0x11')]('\x20');if(_0x51c55d[_0x4327('0x12')]==0x3){_0x51c55d=_0x51c55d[0x2][_0x4327('0x9')](0x1,_0x51c55d[0x2][_0x4327('0x12')]-0x1);}else if(_0x51c55d[_0x4327('0x12')]>0x3){var _0xe86ae3=/\((.+)\)/;var _0xb668bf=_0x251a57['rx'][_0x4327('0x13')](_0xe86ae3);if(_0xb668bf){_0x51c55d=_0xb668bf[0x1];}else{_0x51c55d=null;}}else{_0x51c55d=null;}_0x251a57['cb'](null,{'code':_0x15ccbc,'result':_0x3a40ca,'extra':_0x51c55d});}});_0x1589c3['on']('error',function(_0x1884eb){_0x3efddf[_0x4327('0x8')](_0x4327('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x1884eb[_0x4327('0x15')]));});_0x1589c3['on'](_0x4327('0x16'),function(){_0x3efddf[_0x4327('0x8')]('close',new AGIError(_0x4327('0x17')));});_0x1589c3['on']('timeout',function(){_0x3efddf[_0x4327('0x8')](_0x4327('0x18'),new AGIError(_0x4327('0x19')));_0x1589c3['destroy']();});_0x1589c3[_0x4327('0x1a')](_0x3f6753);this['command']=function(_0xe4d8d9,_0x408f9a){var _0xe4d8d9=_0xe4d8d9||'',_0x408f9a=typeof _0x408f9a==_0x4327('0xc')?_0x408f9a:new Function();_0x251a57={'tx':_0xe4d8d9,'rx':'','cb':_0x408f9a};_0x1589c3[_0x4327('0x1b')](_0xe4d8d9+'\x0a');},this['close']=function(){_0x1589c3['destroy']();};}util[_0x4327('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x4327('0x1d')][_0x4327('0x1e')]=function(_0x5ddfc0){return this['command'][_0x4327('0x1f')](this,_0x5ddfc0);};AGIChannel['prototype']['answer']=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x4327('0x1d')][_0x4327('0x20')]=function(_0x20af0a,_0x421b84,_0x1966f5){_0x20af0a=_0x20af0a===undefined?_0x4327('0x21'):_0x20af0a;_0x421b84=_0x421b84===undefined?'5':_0x421b84;_0x1966f5=_0x1966f5===undefined?'1':_0x1966f5;return this[_0x4327('0x1e')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20af0a,_0x421b84*0x3e8,_0x1966f5));};AGIChannel[_0x4327('0x1d')]['noop']=function(_0x566dcd){_0x566dcd=_0x566dcd||'NO\x20MESSAGE';return this['sendRequest'](util[_0x4327('0x22')]('VERBOSE\x20\x22%s\x22',_0x566dcd));};AGIChannel[_0x4327('0x1d')][_0x4327('0x23')]=function(_0x1488dd,_0x487200){if(_[_0x4327('0x24')](_0x487200)){return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x25'),_0x1488dd,_0x487200[_0x4327('0x26')](',')));}return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x25'),_0x1488dd,_0x487200));};AGIChannel[_0x4327('0x1d')][_0x4327('0x27')]=function(_0x588e74){return this['sendRequest'](util['format'](_0x4327('0x28'),_0x588e74));};AGIChannel['prototype'][_0x4327('0x29')]=function(_0xb4013f){return this[_0x4327('0x1e')](util['format']('SET\x20EXTENSION\x20%s',_0xb4013f));};AGIChannel[_0x4327('0x1d')][_0x4327('0x2a')]=function(_0x2fecce){return this[_0x4327('0x1e')](util[_0x4327('0x22')]('SET\x20PRIORITY\x20%s',_0x2fecce));};AGIChannel[_0x4327('0x1d')][_0x4327('0x2b')]=function(){return this[_0x4327('0x1e')](_0x4327('0x2c'));};AGIChannel[_0x4327('0x1d')][_0x4327('0x2d')]=function(_0x5ebbd8,_0x2026db){var _0x2a7945=_['isBoolean'](_0x2026db)||_[_0x4327('0x2e')](_0x2026db)?_0x2026db['toString']():_0x2026db;return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x2f'),_0x5ebbd8,_0x2a7945?_0x2a7945[_0x4327('0x30')]()[_0x4327('0x31')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4327('0x1d')]['sayNumber']=function(_0x414b9f,_0x22f142){return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x32'),_0x414b9f,_0x22f142));};AGIChannel[_0x4327('0x1d')][_0x4327('0x33')]=function(_0x1096b9,_0x26e06c){return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x34'),_0x1096b9,_0x26e06c));};AGIChannel['prototype'][_0x4327('0x35')]=function(_0xbe987f,_0x472e25){return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x36'),_0xbe987f,_0x472e25));};AGIChannel[_0x4327('0x1d')][_0x4327('0x37')]=function(_0x300203,_0xde3e27,_0x46c190){_0xde3e27=_0xde3e27||this[_0x4327('0x38')];_0x46c190=_0x46c190||0x1;this[_0x4327('0x27')](_0x300203);this[_0x4327('0x29')](_0xde3e27);this['setPriority'](_0x46c190);return this['noop'](util[_0x4327('0x22')](_0x4327('0x39'),_0x300203,_0xde3e27,_0x46c190));};AGIChannel['prototype'][_0x4327('0x3a')]=function(_0x133896){return this['sendRequest'](util[_0x4327('0x22')]('GET\x20VARIABLE\x20\x22%s\x22',_0x133896));};AGIChannel['prototype'][_0x4327('0x3b')]=function(_0x44b54a,_0x5bf69e,_0x44bb23,_0x20b6e5,_0x22f127,_0x1dfcf9){_0x5bf69e=_0x5bf69e||'wav';_0x44bb23=_0x44bb23||'';_0x20b6e5=_0x20b6e5===undefined?-0x1:_0x20b6e5==='-1'?-0x1:_0x20b6e5*0x3e8;_0x22f127=_0x22f127===undefined?'':'s='+_0x22f127;_0x1dfcf9=_0x1dfcf9?_0x4327('0x3c'):'';return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x3d'),_0x44b54a,_0x5bf69e,_0x44bb23,_0x20b6e5,_0x1dfcf9,_0x22f127));};AGIChannel[_0x4327('0x1d')][_0x4327('0x3e')]=function(_0x6c6a96,_0x34fe94){_0x34fe94=_0x34fe94||'';return this[_0x4327('0x1e')](util[_0x4327('0x22')](_0x4327('0x3f'),_0x6c6a96,_0x34fe94));};AGIChannel[_0x4327('0x1d')][_0x4327('0x40')]=function(_0x2d3659){return this[_0x4327('0x23')](_0x4327('0x41'),_0x2d3659);};AGIChannel['prototype'][_0x4327('0x42')]=function(_0x5aad31){return this[_0x4327('0x23')](_0x4327('0x43'),_0x5aad31);};AGIChannel[_0x4327('0x1d')][_0x4327('0x14')]=function(_0x29389b,_0x3d2550){this[_0x4327('0x44')](util[_0x4327('0x22')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x29389b['id'],_0x29389b[_0x4327('0x45')],_0x3d2550));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4327('0x46')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index bf55aa0..944d6e2 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 _0x447c=['Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x5c3565,_0x580216){var _0x5966bd=function(_0x22531c){while(--_0x22531c){_0x5c3565['push'](_0x5c3565['shift']());}};_0x5966bd(++_0x580216);}(_0x447c,0x177));var _0xc447=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x447c[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xc447('0x0'));var error={'E_AGI_UNDEFINED':_0xc447('0x1'),'E_AGI_ARGUMENT_PORT':_0xc447('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xc447('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xc447('0x4'),'E_AGI_SOCKET_CLOSE':_0xc447('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xc447('0x6'),'E_AGI_COMMAND_EMPTY':_0xc447('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x329f77){var _0x329f77=_0x329f77||null,_0xf92f42=_0xf92f42||[],_0x4f1eaa=0x1,_0xf6a439='';if(!error[_0x329f77]){_0x329f77=_0xc447('0x8');}_0xf92f42[_0xc447('0x9')](error[_0x329f77]);while(arguments[_0x4f1eaa]){_0xf92f42['push'](arguments[_0x4f1eaa]);_0x4f1eaa++;}_0xf6a439=util[_0xc447('0xa')][_0xc447('0xb')](util,_0xf92f42);this[_0xc447('0xc')]=_0xf6a439;this['name']=_0x329f77;}module[_0xc447('0xd')]=AGIError; \ No newline at end of file +var _0x8d63=['format','message','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','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.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x8d63,0x189));var _0x38d6=function(_0x12a0dd,_0x5b24f5){_0x12a0dd=_0x12a0dd-0x0;var _0x32d1e6=_0x8d63[_0x12a0dd];return _0x32d1e6;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x38d6('0x0'),'E_AGI_ARGUMENT_PORT':_0x38d6('0x1'),'E_AGI_SERVER_ERROR':_0x38d6('0x2'),'E_AGI_SERVER_CLOSE':_0x38d6('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x38d6('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x38d6('0x5'),'E_AGI_SOCKET_ERROR':_0x38d6('0x6'),'E_AGI_SOCKET_CLOSE':_0x38d6('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x38d6('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x38d6('0x9'),'E_AGI_IVR_ENTRY':_0x38d6('0xa')};function AGIError(_0x24b441){var _0x24b441=_0x24b441||null,_0x1f1f10=_0x1f1f10||[],_0x5c3366=0x1,_0x3cdfdf='';if(!error[_0x24b441]){_0x24b441=_0x38d6('0xb');}_0x1f1f10['push'](error[_0x24b441]);while(arguments[_0x5c3366]){_0x1f1f10['push'](arguments[_0x5c3366]);_0x5c3366++;}_0x3cdfdf=util[_0x38d6('0xc')]['apply'](util,_0x1f1f10);this[_0x38d6('0xd')]=_0x3cdfdf;this['name']=_0x24b441;}module[_0x38d6('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index cbc249e..3692772 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad88=['./error','redis','defaults','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','exports','lodash','events','EventEmitter','ioredis'];(function(_0x286718,_0x395d85){var _0x2806c8=function(_0x4306a4){while(--_0x4306a4){_0x286718['push'](_0x286718['shift']());}};_0x2806c8(++_0x395d85);}(_0xad88,0x11a));var _0x8ad8=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xad88[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x8ad8('0x0'));var EventEmitter=require(_0x8ad8('0x1'))[_0x8ad8('0x2')];var Redis=require(_0x8ad8('0x3'));var AGIError=require(_0x8ad8('0x4'));var config=require('../../config/environment');config[_0x8ad8('0x5')]=_[_0x8ad8('0x6')](config[_0x8ad8('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8ad8('0x5')]);sub[_0x8ad8('0x7')](_0x8ad8('0x8'),function(_0x464b26){if(_0x464b26)return eventEmitter[_0x8ad8('0x9')](_0x8ad8('0xa'),new AGIError(_0x8ad8('0xb'),_0x464b26));});sub['on']('message',function(_0x28fec8,_0x11d4bd){if(_0x28fec8!==_0x8ad8('0x8'))return;try{var _0x55b501=JSON['parse'](_0x11d4bd);eventEmitter[_0x8ad8('0x9')]('projectUpdate',_0x55b501);}catch(_0x33e39b){eventEmitter[_0x8ad8('0x9')](_0x8ad8('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x33e39b));}});module[_0x8ad8('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xd98e=['lodash','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','localhost','subscribe','E_AGI_SERVER_ERROR','message','agi','emit','error'];(function(_0x35cf25,_0x1d7c48){var _0x3bfa9b=function(_0x4b0f62){while(--_0x4b0f62){_0x35cf25['push'](_0x35cf25['shift']());}};_0x3bfa9b(++_0x1d7c48);}(_0xd98e,0x96));var _0xed98=function(_0x13e9c9,_0x3469ea){_0x13e9c9=_0x13e9c9-0x0;var _0x18490f=_0xd98e[_0x13e9c9];return _0x18490f;};'use strict';var _=require(_0xed98('0x0'));var EventEmitter=require(_0xed98('0x1'))[_0xed98('0x2')];var Redis=require(_0xed98('0x3'));var AGIError=require(_0xed98('0x4'));var config=require(_0xed98('0x5'));config['redis']=_[_0xed98('0x6')](config[_0xed98('0x7')],{'host':_0xed98('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xed98('0x7')]);sub[_0xed98('0x9')]('agi',function(_0x5735a6){if(_0x5735a6)return eventEmitter['emit']('error',new AGIError(_0xed98('0xa'),_0x5735a6));});sub['on'](_0xed98('0xb'),function(_0x3624f0,_0xee207b){if(_0x3624f0!==_0xed98('0xc'))return;try{var _0x197425=JSON['parse'](_0xee207b);eventEmitter[_0xed98('0xd')]('projectUpdate',_0x197425);}catch(_0xf1cb84){eventEmitter['emit'](_0xed98('0xe'),new AGIError('E_AGI_SERVER_ERROR',_0xf1cb84));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 71ce83d..39c4ba8 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 _0x9d8d=['getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','getVertex','traverseBFS','info','stop\x20traverse','length','condition','split','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu'];(function(_0x149ad9,_0x27073e){var _0x296dbb=function(_0x2292ec){while(--_0x2292ec){_0x149ad9['push'](_0x149ad9['shift']());}};_0x296dbb(++_0x27073e);}(_0x9d8d,0x8e));var _0xd9d8=function(_0x167da6,_0x933355){_0x167da6=_0x167da6-0x0;var _0x40977e=_0x9d8d[_0x167da6];return _0x40977e;};'use strict';var _=require('lodash');var logger=require(_0xd9d8('0x0'))(_0xd9d8('0x1'));var verticesWithRetry=[_0xd9d8('0x2'),_0xd9d8('0x3'),_0xd9d8('0x4')];var Graph=function(){this[_0xd9d8('0x5')]={};this[_0xd9d8('0x6')]={};this[_0xd9d8('0x7')]=0x0;};Graph[_0xd9d8('0x8')][_0xd9d8('0x9')]=function(_0x3f787a){this[_0xd9d8('0x5')][_0x3f787a['id']]=_0x3f787a;this[_0xd9d8('0x6')][_0x3f787a['id']]=[];};Graph[_0xd9d8('0x8')][_0xd9d8('0xa')]=function(_0x5c3c33,_0x565281,_0x4f7d11){this[_0xd9d8('0x6')][_0x5c3c33]['push']({'target':_0x565281,'condition':_0x4f7d11});this[_0xd9d8('0x7')]+=0x1;};Graph[_0xd9d8('0x8')][_0xd9d8('0xb')]=function(){return _[_0xd9d8('0xb')](this[_0xd9d8('0x5')]);};Graph[_0xd9d8('0x8')]['relations']=function(){return this[_0xd9d8('0x7')];};Graph[_0xd9d8('0x8')][_0xd9d8('0xc')]=function(_0x488d7d){return this[_0xd9d8('0x5')][_0x488d7d];};Graph[_0xd9d8('0x8')][_0xd9d8('0xd')]=function(_0x1ffc0b,_0x1b1bb1){if(!this[_0xd9d8('0x5')][_0x1ffc0b]){return logger['info']('no\x20vertex\x20found');}var _0x33bc1f=_0x1b1bb1(this[_0xd9d8('0x5')][_0x1ffc0b]);if(!_0x33bc1f){return logger[_0xd9d8('0xe')](_0xd9d8('0xf'));}if(this[_0xd9d8('0x6')][_0x1ffc0b][_0xd9d8('0x10')]===0x0){return logger[_0xd9d8('0xe')]('no\x20edge/s\x20available');}for(var _0x162900=0x0,_0x4f7e83=[],_0x9c127f=![];_0x162900\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','find','handleNotFound','production','initialize'];(function(_0x5440b1,_0x4f3ff3){var _0x20ebd6=function(_0x2d587){while(--_0x2d587){_0x5440b1['push'](_0x5440b1['shift']());}};_0x20ebd6(++_0x4f3ff3);}(_0x69f1,0x14e));var _0x169f=function(_0x382dca,_0x44ddc2){_0x382dca=_0x382dca-0x0;var _0x4cdcf8=_0x69f1[_0x382dca];return _0x4cdcf8;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x169f('0x0'));var config=require(_0x169f('0x1'));var logger=require(_0x169f('0x2'))('agi');var utilLicense=require(_0x169f('0x3'));var rpc=require(_0x169f('0x4'));var Project=require(_0x169f('0x5'));var AGIEmitter=require('./events')[_0x169f('0x6')];var projects=[];config[_0x169f('0x7')]=_[_0x169f('0x8')](config[_0x169f('0x7')],{'ip':_0x169f('0x9'),'port':0x11dd});AGIEmitter['on'](_0x169f('0xa'),projectUpdateHandler);function connectionHandler(_0x38fa39){process[_0x169f('0xb')](function(){syncho(function(){try{setChannelVariables(_0x38fa39);agiHandler(_0x38fa39);}catch(_0x16ffbf){logger[_0x169f('0xc')](_0x16ffbf[_0x169f('0xd')]);}});});}function projectUpdateHandler(_0x50478d){try{var _0x2fa215=_['findIndex'](projects,['id',_0x50478d['id']]);if(_0x2fa215>-0x1){if(_0x50478d[_0x169f('0xe')]===!![]){projects['splice'](_0x2fa215,0x1);}else{projects[_0x2fa215]=_0x50478d;}}else{projects['push'](_0x50478d);}}catch(_0x12c305){logger[_0x169f('0xc')](_0x12c305[_0x169f('0xd')]);}}function listeningHandler(){console[_0x169f('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x169f('0x7')][_0x169f('0x10')]);logger['info'](util['format'](_0x169f('0x11'),config['agi']['ip'],config[_0x169f('0x7')]['port']));}function errorHandler(_0x3ce668){if(_0x3ce668&&_0x3ce668[_0x169f('0x12')]&&_0x3ce668[_0x169f('0x13')]){logger[_0x169f('0xc')](util['format'](_0x169f('0x14'),_0x3ce668['name'],_0x3ce668['message']));}else{logger[_0x169f('0xc')](util[_0x169f('0x15')](_0x169f('0x16'),_0x3ce668['stack']));}}function closeHandler(){logger[_0x169f('0x17')](util[_0x169f('0x15')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x169f('0x18')],this['calleridname'],this[_0x169f('0x19')],this['dnid'],this[_0x169f('0x1a')]));try{createSquareReport(this);}catch(_0x266b9f){logger['error'](_0x266b9f[_0x169f('0xd')]);}}function timeoutHandler(){logger[_0x169f('0x17')](util[_0x169f('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x169f('0x18')],this[_0x169f('0x1b')],this[_0x169f('0x19')],this[_0x169f('0x1c')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x169f('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x169f('0x1b')],this[_0x169f('0x19')],this[_0x169f('0x1c')],this[_0x169f('0x1a')]));this[_0x169f('0x1d')]=!![];}function createSquareReport(_0x99227,_0x2dc69f){rpc[_0x169f('0x1e')](_0x99227)[_0x169f('0x1f')](function(_0xc2dd3f){if(_0x2dc69f){_0x2dc69f(null,_0xc2dd3f);}})[_0x169f('0x20')](function(_0x966a97){if(_0x2dc69f){_0x2dc69f(null,_0x966a97);}});}function setChannelVariables(_0x49d09d){for(var _0x22eac6 in _0x49d09d){if(_0x49d09d['hasOwnProperty'](_0x22eac6)){if(_0x22eac6[_0x169f('0x21')](_0x169f('0x22'))===0x0){_0x49d09d[_0x22eac6[_0x169f('0x23')](0x4)]=_0x49d09d[_0x22eac6];delete _0x49d09d[_0x22eac6];}}}}function agiHandler(_0x38b987){logger[_0x169f('0x24')](_0x169f('0x25'),JSON[_0x169f('0x26')](_0x38b987,null,0x2));logger['info'](util[_0x169f('0x15')](_0x169f('0x27'),_0x38b987[_0x169f('0x18')],_0x38b987[_0x169f('0x1b')],_0x38b987[_0x169f('0x19')],_0x38b987['dnid'],_0x38b987[_0x169f('0x1a')]));_0x38b987['on']('error',errorHandler);_0x38b987['on']('close',closeHandler);_0x38b987['on']('timeout',timeoutHandler);_0x38b987[_0x169f('0x1d')]=![];_0x38b987['on']('hangup',hangupHandler);var _0x1e14d6=_[_0x169f('0x28')](projects,['name',_0x38b987[_0x169f('0x18')]]);if(!_0x1e14d6)return Project[_0x169f('0x29')](_0x38b987);if(!_0x1e14d6[_0x169f('0x2a')])return Project['handleUnpublished'](_0x38b987);return Project[_0x169f('0x2b')](_0x1e14d6,_0x38b987);}function main(){var _0x4c2427;return utilLicense['getLicense']()[_0x169f('0x1f')](function(_0x2019ae){if(!_0x2019ae)return;if(_0x2019ae['voice']){if(_0x2019ae[_0x169f('0x2c')]&&_0x2019ae[_0x169f('0x2c')]>0x0){logger[_0x169f('0x17')](util['format'](_0x169f('0x2d'),_0x2019ae[_0x169f('0x2c')]));_0x4c2427=_0x2019ae['callysquare'];}else{logger[_0x169f('0x17')](_0x169f('0x2e'));}}else{logger[_0x169f('0x17')](_0x169f('0x2f'));_0x4c2427=-0x1;}})[_0x169f('0x1f')](function(){return Project[_0x169f('0x30')]();})[_0x169f('0x1f')](function(_0x2c266a){projects=_0x2c266a;return;})[_0x169f('0x20')](function(_0x22609b){logger['error']('[LICENSE]',_0x22609b['stack']);})[_0x169f('0x31')](function(){var _0x2b0527=require(_0x169f('0x32'))(config['agi'][_0x169f('0x10')],config[_0x169f('0x7')]['ip'],_0x4c2427);_0x2b0527['on'](_0x169f('0xc'),errorHandler);_0x2b0527['on'](_0x169f('0x33'),listeningHandler);_0x2b0527['on'](_0x169f('0x34'),connectionHandler);_0x2b0527['on'](_0x169f('0x35'),closeHandler);});}main(); \ No newline at end of file +var _0x741d=['stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','indexOf','substring','debug','variables','stringify','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','[LICENSE]','finally','./server','connection','close','lodash','syncho','util','agi','../../config/license/util','./rpc','./events','defaults','127.0.0.1','projectUpdate','nextTick','error','deleted','push'];(function(_0x246c76,_0x34fb66){var _0x39e79d=function(_0x2882d7){while(--_0x2882d7){_0x246c76['push'](_0x246c76['shift']());}};_0x39e79d(++_0x34fb66);}(_0x741d,0x142));var _0xd741=function(_0x51a852,_0x17c021){_0x51a852=_0x51a852-0x0;var _0x1284c3=_0x741d[_0x51a852];return _0x1284c3;};'use strict';var _=require(_0xd741('0x0'));var syncho=require(_0xd741('0x1'));var util=require(_0xd741('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xd741('0x3'));var utilLicense=require(_0xd741('0x4'));var rpc=require(_0xd741('0x5'));var Project=require('./project');var AGIEmitter=require(_0xd741('0x6'))['EventEmitter'];var projects=[];config[_0xd741('0x3')]=_[_0xd741('0x7')](config[_0xd741('0x3')],{'ip':_0xd741('0x8'),'port':0x11dd});AGIEmitter['on'](_0xd741('0x9'),projectUpdateHandler);function connectionHandler(_0x39ea38){process[_0xd741('0xa')](function(){syncho(function(){try{setChannelVariables(_0x39ea38);agiHandler(_0x39ea38);}catch(_0x3ca541){logger[_0xd741('0xb')](_0x3ca541['stack']);}});});}function projectUpdateHandler(_0xde20b9){try{var _0x42f648=_['findIndex'](projects,['id',_0xde20b9['id']]);if(_0x42f648>-0x1){if(_0xde20b9[_0xd741('0xc')]===!![]){projects['splice'](_0x42f648,0x1);}else{projects[_0x42f648]=_0xde20b9;}}else{projects[_0xd741('0xd')](_0xde20b9);}}catch(_0x1eca8e){logger[_0xd741('0xb')](_0x1eca8e[_0xd741('0xe')]);}}function listeningHandler(){console['log'](_0xd741('0xf'),config[_0xd741('0x3')][_0xd741('0x10')]);logger[_0xd741('0x11')](util[_0xd741('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xd741('0x3')]['ip'],config[_0xd741('0x3')][_0xd741('0x10')]));}function errorHandler(_0x290b7c){if(_0x290b7c&&_0x290b7c[_0xd741('0x13')]&&_0x290b7c[_0xd741('0x14')]){logger[_0xd741('0xb')](util[_0xd741('0x12')]('[%s]\x20%s',_0x290b7c['name'],_0x290b7c['message']));}else{logger[_0xd741('0xb')](util['format'](_0xd741('0x15'),_0x290b7c[_0xd741('0xe')]));}}function closeHandler(){logger['info'](util[_0xd741('0x12')](_0xd741('0x16'),this['arg_1'],this[_0xd741('0x17')],this[_0xd741('0x18')],this[_0xd741('0x19')],this[_0xd741('0x1a')]));try{createSquareReport(this);}catch(_0x5746fe){logger[_0xd741('0xb')](_0x5746fe[_0xd741('0xe')]);}}function timeoutHandler(){logger[_0xd741('0x11')](util['format'](_0xd741('0x1b'),this[_0xd741('0x1c')],this['calleridname'],this[_0xd741('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xd741('0x11')](util[_0xd741('0x12')](_0xd741('0x1d'),this[_0xd741('0x1c')],this[_0xd741('0x17')],this[_0xd741('0x18')],this[_0xd741('0x19')],this[_0xd741('0x1a')]));this[_0xd741('0x1e')]=!![];}function createSquareReport(_0x42d22f,_0x29c45f){rpc['createSquareReport'](_0x42d22f)[_0xd741('0x1f')](function(_0x374e88){if(_0x29c45f){_0x29c45f(null,_0x374e88);}})['catch'](function(_0x1c69dd){if(_0x29c45f){_0x29c45f(null,_0x1c69dd);}});}function setChannelVariables(_0x16f32c){for(var _0x514432 in _0x16f32c){if(_0x16f32c['hasOwnProperty'](_0x514432)){if(_0x514432[_0xd741('0x20')]('agi_')===0x0){_0x16f32c[_0x514432[_0xd741('0x21')](0x4)]=_0x16f32c[_0x514432];delete _0x16f32c[_0x514432];}}}}function agiHandler(_0x2958b0){logger[_0xd741('0x22')](_0xd741('0x23'),JSON[_0xd741('0x24')](_0x2958b0,null,0x2));logger[_0xd741('0x11')](util[_0xd741('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2958b0[_0xd741('0x1c')],_0x2958b0[_0xd741('0x17')],_0x2958b0['callerid'],_0x2958b0[_0xd741('0x19')],_0x2958b0['uniqueid']));_0x2958b0['on'](_0xd741('0xb'),errorHandler);_0x2958b0['on']('close',closeHandler);_0x2958b0['on'](_0xd741('0x25'),timeoutHandler);_0x2958b0[_0xd741('0x1e')]=![];_0x2958b0['on'](_0xd741('0x26'),hangupHandler);var _0x4f4b53=_[_0xd741('0x27')](projects,[_0xd741('0x13'),_0x2958b0[_0xd741('0x1c')]]);if(!_0x4f4b53)return Project[_0xd741('0x28')](_0x2958b0);if(!_0x4f4b53[_0xd741('0x29')])return Project[_0xd741('0x2a')](_0x2958b0);return Project[_0xd741('0x2b')](_0x4f4b53,_0x2958b0);}function main(){var _0x2f0ffe;return utilLicense[_0xd741('0x2c')]()[_0xd741('0x1f')](function(_0x503a20){if(!_0x503a20)return;if(_0x503a20[_0xd741('0x2d')]){if(_0x503a20[_0xd741('0x2e')]&&_0x503a20[_0xd741('0x2e')]>0x0){logger[_0xd741('0x11')](util[_0xd741('0x12')](_0xd741('0x2f'),_0x503a20[_0xd741('0x2e')]));_0x2f0ffe=_0x503a20['callysquare'];}else{logger[_0xd741('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xd741('0x11')](_0xd741('0x30'));_0x2f0ffe=-0x1;}})[_0xd741('0x1f')](function(){return Project[_0xd741('0x31')]();})[_0xd741('0x1f')](function(_0x4f10ee){projects=_0x4f10ee;return;})[_0xd741('0x32')](function(_0x2d6a0b){logger[_0xd741('0xb')](_0xd741('0x33'),_0x2d6a0b[_0xd741('0xe')]);})[_0xd741('0x34')](function(){var _0x30303f=require(_0xd741('0x35'))(config[_0xd741('0x3')][_0xd741('0x10')],config['agi']['ip'],_0x2f0ffe);_0x30303f['on'](_0xd741('0xb'),errorHandler);_0x30303f['on']('listening',listeningHandler);_0x30303f['on'](_0xd741('0x36'),connectionHandler);_0x30303f['on'](_0xd741('0x37'),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 4a74bf5..0a13127 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 _0xe0e3=['error','result','catch','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x38af4c,_0x15d256){var _0x105c0c=function(_0x4fc645){while(--_0x4fc645){_0x38af4c['push'](_0x38af4c['shift']());}};_0x105c0c(++_0x15d256);}(_0xe0e3,0xfe));var _0x3e0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0e3[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3e0e('0x0'));var jayson=require(_0x3e0e('0x1'));var client=jayson[_0x3e0e('0x2')][_0x3e0e('0x3')]({'port':0x232b});function request(_0x4cd9db,_0x1980b4){return new BPromise(function(_0x30b648,_0x1b9fa3){return client[_0x3e0e('0x4')](_0x4cd9db,_0x1980b4)[_0x3e0e('0x5')](function(_0x20e43c){if(_0x20e43c[_0x3e0e('0x6')]){return _0x1b9fa3(_0x20e43c['error']['message']);}else{return _0x30b648(_0x20e43c[_0x3e0e('0x7')]);}})[_0x3e0e('0x8')](function(_0x3f92fb){return _0x1b9fa3(_0x3f92fb);});});}exports['sendMailMessage']=function(_0x37348b,_0x3da779){return request(_0x3e0e('0x9'),{'account':_0x37348b,'message':_0x3da779});}; \ No newline at end of file +var _0x4b59=['SendMail','bluebird','jayson/promise','client','http','then','error'];(function(_0x3ad0cc,_0x4565ef){var _0x2af3d0=function(_0x1cbb93){while(--_0x1cbb93){_0x3ad0cc['push'](_0x3ad0cc['shift']());}};_0x2af3d0(++_0x4565ef);}(_0x4b59,0x120));var _0x94b5=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x4b59[_0x5a8aa3];return _0x5d0458;};'use strict';var BPromise=require(_0x94b5('0x0'));var jayson=require(_0x94b5('0x1'));var client=jayson[_0x94b5('0x2')][_0x94b5('0x3')]({'port':0x232b});function request(_0x520361,_0x2885fa){return new BPromise(function(_0x5b3dc9,_0xe882e4){return client['request'](_0x520361,_0x2885fa)[_0x94b5('0x4')](function(_0x55351d){if(_0x55351d[_0x94b5('0x5')]){return _0xe882e4(_0x55351d['error']['message']);}else{return _0x5b3dc9(_0x55351d['result']);}})['catch'](function(_0x5847eb){return _0xe882e4(_0x5847eb);});});}exports['sendMailMessage']=function(_0xc1a784,_0x33dc1a){return request(_0x94b5('0x6'),{'account':_0xc1a784,'message':_0x33dc1a});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 6fc5970..dd66c65 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4123=['context','priority','response','result','evtHangup','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','vertex','agicommand\x20not\x20found','continueAt','extension','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','source','value','toJson','production','start','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','clear','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS'];(function(_0x2fb866,_0x59bc0c){var _0x5d310f=function(_0x13bf75){while(--_0x13bf75){_0x2fb866['push'](_0x2fb866['shift']());}};_0x5d310f(++_0x59bc0c);}(_0x4123,0x13d));var _0x3412=function(_0x4b6643,_0x9e4308){_0x4b6643=_0x4b6643-0x0;var _0x3dc376=_0x4123[_0x4b6643];return _0x3dc376;};'use strict';var _=require(_0x3412('0x0'));var moment=require(_0x3412('0x1'));var parser=require('xml2json');var util=require(_0x3412('0x2'));var logger=require(_0x3412('0x3'))('agi');var rpc=require(_0x3412('0x4'));var mailRpc=require(_0x3412('0x5'));var Graph=require(_0x3412('0x6'));var Vertices=require(_0x3412('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3412('0x8')]()['catch'](function(_0x26c0f0){logger[_0x3412('0x9')](_0x3412('0xa'),_0x26c0f0[_0x3412('0xb')]);return[];});}function addVertex(_0x53af63,_0x5d35e7,_0x3110e8){_0x5d35e7[_0x3412('0xc')]=_0x3110e8;if(_0x5d35e7[_0x3412('0xd')](_0x3412('0xe'))){_0x5d35e7[_0x3412('0xf')]=parseInt(_0x5d35e7[_0x3412('0xe')],0xa);}_0x53af63[_0x3412('0x10')](_[_0x3412('0x11')](_0x5d35e7,_0x3412('0x12')));}function initGraph(_0x3f0b2d,_0x5144c8){var _0x2bbff0=new Graph();for(var _0x52d6a7 in _0x3f0b2d){if(_0x3f0b2d[_0x3412('0xd')](_0x52d6a7)){if(_[_0x3412('0x13')](_0x3f0b2d[_0x52d6a7])){for(var _0x308c38=0x0;_0x308c38<_0x3f0b2d[_0x52d6a7][_0x3412('0x14')];_0x308c38+=0x1){addVertex(_0x2bbff0,_0x3f0b2d[_0x52d6a7][_0x308c38],_0x52d6a7);}}else{addVertex(_0x2bbff0,_0x3f0b2d[_0x52d6a7],_0x52d6a7);}}}for(var _0x189256=0x0;_0x189256<_0x5144c8[_0x3412('0x14')];_0x189256+=0x1){if(_0x5144c8[_0x189256]['source']&&_0x5144c8[_0x189256][_0x3412('0x15')]){_0x2bbff0['addEdge'](_0x5144c8[_0x189256][_0x3412('0x16')],_0x5144c8[_0x189256][_0x3412('0x15')],_0x5144c8[_0x189256][_0x3412('0x17')]);}}return _0x2bbff0;}function getRoot(_0x274861){return parser[_0x3412('0x18')](_0x274861,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x19dd11){return util['inspect'](_0x19dd11,{'showHidden':![],'depth':null});}function initialize(_0x5f5b88,_0x5bdee7){var _0x5b364b=getRoot(_0x5f5b88[_0x3412('0x19')]);if(!_0x5b364b||!_0x5b364b[_0x3412('0x1a')])return;var _0x1c69f7,_0x23f921,_0x96e70d;logger[_0x3412('0x1b')](_0x3412('0x1c'),JSON[_0x3412('0x1d')](_0x5b364b,null,0x2));_0x5bdee7[_0x3412('0x1e')]=moment()[_0x3412('0x1f')](_0x3412('0x20'));_0x1c69f7=initGraph(_[_0x3412('0x11')](_0x5b364b,_0x3412('0x12')),_0x5b364b['mxCell']);_0x23f921=new Vertices(_0x5bdee7,rpc,mailRpc);logger['info'](util[_0x3412('0x1f')](_0x3412('0x21'),_0x5bdee7[_0x3412('0x22')],_0x5bdee7[_0x3412('0x23')],_0x5bdee7[_0x3412('0x24')],_0x5bdee7[_0x3412('0x25')],_0x5bdee7[_0x3412('0x26')]));_0x1c69f7['traverseBFS'](_0x5b364b[_0x3412('0x1a')]['id'],function(_0x27028b){try{_0x27028b=_0x23f921[_0x3412('0x27')](_0x27028b);logger['debug']('vertex',JSON[_0x3412('0x1d')](_0x27028b,null,0x2));if(_0x27028b[_0x3412('0xc')]===_0x3412('0x28')){logger[_0x3412('0x29')](_0x3412('0x2a'));_0x5bdee7['context']=_0x27028b['context']||_0x5bdee7[_0x3412('0x2b')];_0x5bdee7['extension']=_0x27028b['extension'];_0x5bdee7[_0x3412('0x2c')]=_0x27028b[_0x3412('0x2c')]?_0x27028b['priority']-0x1:0x1;return null;}else if(_0x27028b&&_0x23f921[_0x27028b[_0x3412('0xc')]]){_0x96e70d=_0x23f921[_0x27028b['agicommand']](_0x27028b);logger[_0x3412('0x29')](_0x3412('0x2d'),JSON[_0x3412('0x1d')](_0x96e70d,null,0x2));if(_0x96e70d&&_0x96e70d['code']===AGI_CODE_SUCCESS&&_0x96e70d[_0x3412('0x2e')]!==AGI_RESULT_ERROR&&!_0x5bdee7[_0x3412('0x2f')]){logger[_0x3412('0x1b')](_0x3412('0x2d'),inspect(_0x96e70d));return _[_0x3412('0x30')](_0x96e70d['result'])?null:_0x96e70d[_0x3412('0x2e')][_0x3412('0x31')]();}else{logger[_0x3412('0x9')]('response',inspect(_0x96e70d));return null;}}else{logger[_0x3412('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x3e576c){logger[_0x3412('0x9')](_0x3e576c['stack']);return null;}});if(_0x5b364b['finally']){logger['info'](util[_0x3412('0x1f')](_0x3412('0x32'),_0x5bdee7[_0x3412('0x22')],_0x5bdee7['calleridname'],_0x5bdee7[_0x3412('0x24')],_0x5bdee7[_0x3412('0x25')],_0x5bdee7[_0x3412('0x26')]));_0x1c69f7['traverseBFS'](_0x5b364b[_0x3412('0x33')]['id'],function(_0x3e0fe9){try{_0x3e0fe9=_0x23f921[_0x3412('0x27')](_0x3e0fe9);logger[_0x3412('0x1b')](_0x3412('0x34'),JSON[_0x3412('0x1d')](_0x3e0fe9,null,0x2));if(_0x3e0fe9&&_0x23f921[_0x3e0fe9['agicommand']]){_0x96e70d=_0x23f921[_0x3e0fe9['agicommand']](_0x3e0fe9);if(_0x96e70d){logger[_0x3412('0x1b')](_0x3412('0x2d'),inspect(_0x96e70d));return _[_0x3412('0x30')](_0x96e70d['result'])?null:_0x96e70d['result'][_0x3412('0x31')]();}else{logger['error'](_0x3412('0x2d'),inspect(_0x96e70d));return null;}}else{logger['error'](_0x3412('0x35'));return null;}}catch(_0xa0c3d){logger['error'](_0xa0c3d[_0x3412('0xb')]);return null;}});}logger['info'](util[_0x3412('0x1f')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5bdee7[_0x3412('0x22')],_0x5bdee7['calleridname'],_0x5bdee7[_0x3412('0x24')],_0x5bdee7['dnid'],_0x5bdee7[_0x3412('0x26')]));logger[_0x3412('0x29')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x5bdee7[_0x3412('0x2b')],_0x5bdee7['extension'],parseInt(_0x5bdee7[_0x3412('0x2c')],0xa)+0x1));_0x5bdee7[_0x3412('0x36')](_0x5bdee7['context'],_0x5bdee7[_0x3412('0x37')],parseInt(_0x5bdee7[_0x3412('0x2c')],0xa)+0x1);_0x5bdee7[_0x3412('0x38')]();}function handleNotFound(_0x13c273){logger[_0x3412('0x9')](util[_0x3412('0x1f')](_0x3412('0x39'),_0x13c273['arg_1']));_0x13c273[_0x3412('0x36')](_0x13c273[_0x3412('0x2b')],_0x13c273[_0x3412('0x37')],parseInt(_0x13c273['priority'],0xa)+0x1);_0x13c273[_0x3412('0x38')]();}function handleUnpublished(_0x50d902){logger[_0x3412('0x9')](util['format'](_0x3412('0x3a'),_0x50d902['arg_1']));_0x50d902['continueAt'](_0x50d902[_0x3412('0x2b')],_0x50d902[_0x3412('0x37')],parseInt(_0x50d902[_0x3412('0x2c')],0xa)+0x1);_0x50d902['close']();}module[_0x3412('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x4b8b=['[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','close','Project\x20%s\x20not\x20published','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','start','clear','vertex','gotoc','context','extension','priority','info','response','result','evtHangup','isUndefined','error','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','traverseBFS','agicommand\x20not\x20found'];(function(_0x212e13,_0x3a6a1c){var _0x49754b=function(_0x1b14f4){while(--_0x1b14f4){_0x212e13['push'](_0x212e13['shift']());}};_0x49754b(++_0x3a6a1c);}(_0x4b8b,0xf9));var _0xb4b8=function(_0x492bfc,_0x57e49a){_0x492bfc=_0x492bfc-0x0;var _0x44af9b=_0x4b8b[_0x492bfc];return _0x44af9b;};'use strict';var _=require('lodash');var moment=require(_0xb4b8('0x0'));var parser=require(_0xb4b8('0x1'));var util=require(_0xb4b8('0x2'));var logger=require(_0xb4b8('0x3'))('agi');var rpc=require(_0xb4b8('0x4'));var mailRpc=require(_0xb4b8('0x5'));var Graph=require(_0xb4b8('0x6'));var Vertices=require(_0xb4b8('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb4b8('0x8')]()[_0xb4b8('0x9')](function(_0xfa0e96){logger['error'](_0xb4b8('0xa'),_0xfa0e96['stack']);return[];});}function addVertex(_0x37051d,_0x519b49,_0x3e3ef4){_0x519b49[_0xb4b8('0xb')]=_0x3e3ef4;if(_0x519b49[_0xb4b8('0xc')]('retry')){_0x519b49[_0xb4b8('0xd')]=parseInt(_0x519b49[_0xb4b8('0xe')],0xa);}_0x37051d['addVertex'](_[_0xb4b8('0xf')](_0x519b49,_0xb4b8('0x10')));}function initGraph(_0x4758aa,_0x522830){var _0x16a61b=new Graph();for(var _0x2c7601 in _0x4758aa){if(_0x4758aa['hasOwnProperty'](_0x2c7601)){if(_[_0xb4b8('0x11')](_0x4758aa[_0x2c7601])){for(var _0x3bbcbb=0x0;_0x3bbcbb<_0x4758aa[_0x2c7601]['length'];_0x3bbcbb+=0x1){addVertex(_0x16a61b,_0x4758aa[_0x2c7601][_0x3bbcbb],_0x2c7601);}}else{addVertex(_0x16a61b,_0x4758aa[_0x2c7601],_0x2c7601);}}}for(var _0x611c4c=0x0;_0x611c4c<_0x522830[_0xb4b8('0x12')];_0x611c4c+=0x1){if(_0x522830[_0x611c4c][_0xb4b8('0x13')]&&_0x522830[_0x611c4c][_0xb4b8('0x14')]){_0x16a61b[_0xb4b8('0x15')](_0x522830[_0x611c4c]['source'],_0x522830[_0x611c4c][_0xb4b8('0x14')],_0x522830[_0x611c4c][_0xb4b8('0x16')]);}}return _0x16a61b;}function getRoot(_0x28f8fc){return parser[_0xb4b8('0x17')](_0x28f8fc,{'object':!![]})[_0xb4b8('0x18')][_0xb4b8('0x19')];}function inspect(_0x1e5eb0){return util[_0xb4b8('0x1a')](_0x1e5eb0,{'showHidden':![],'depth':null});}function initialize(_0x484548,_0x594404){var _0x4b2916=getRoot(_0x484548['production']);if(!_0x4b2916||!_0x4b2916['start'])return;var _0x2a181a,_0x1a9dd7,_0x288435;logger[_0xb4b8('0x1b')]('root',JSON[_0xb4b8('0x1c')](_0x4b2916,null,0x2));_0x594404[_0xb4b8('0x1d')]=moment()[_0xb4b8('0x1e')](_0xb4b8('0x1f'));_0x2a181a=initGraph(_[_0xb4b8('0xf')](_0x4b2916,_0xb4b8('0x10')),_0x4b2916[_0xb4b8('0x10')]);_0x1a9dd7=new Vertices(_0x594404,rpc,mailRpc);logger['info'](util[_0xb4b8('0x1e')](_0xb4b8('0x20'),_0x594404[_0xb4b8('0x21')],_0x594404[_0xb4b8('0x22')],_0x594404[_0xb4b8('0x23')],_0x594404[_0xb4b8('0x24')],_0x594404['uniqueid']));_0x2a181a['traverseBFS'](_0x4b2916[_0xb4b8('0x25')]['id'],function(_0x5aaefb){try{_0x5aaefb=_0x1a9dd7[_0xb4b8('0x26')](_0x5aaefb);logger['debug'](_0xb4b8('0x27'),JSON['stringify'](_0x5aaefb,null,0x2));if(_0x5aaefb[_0xb4b8('0xb')]===_0xb4b8('0x28')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x594404[_0xb4b8('0x29')]=_0x5aaefb[_0xb4b8('0x29')]||_0x594404['context'];_0x594404[_0xb4b8('0x2a')]=_0x5aaefb['extension'];_0x594404['priority']=_0x5aaefb[_0xb4b8('0x2b')]?_0x5aaefb[_0xb4b8('0x2b')]-0x1:0x1;return null;}else if(_0x5aaefb&&_0x1a9dd7[_0x5aaefb[_0xb4b8('0xb')]]){_0x288435=_0x1a9dd7[_0x5aaefb[_0xb4b8('0xb')]](_0x5aaefb);logger[_0xb4b8('0x2c')](_0xb4b8('0x2d'),JSON[_0xb4b8('0x1c')](_0x288435,null,0x2));if(_0x288435&&_0x288435['code']===AGI_CODE_SUCCESS&&_0x288435[_0xb4b8('0x2e')]!==AGI_RESULT_ERROR&&!_0x594404[_0xb4b8('0x2f')]){logger[_0xb4b8('0x1b')](_0xb4b8('0x2d'),inspect(_0x288435));return _[_0xb4b8('0x30')](_0x288435[_0xb4b8('0x2e')])?null:_0x288435[_0xb4b8('0x2e')]['toString']();}else{logger[_0xb4b8('0x31')](_0xb4b8('0x2d'),inspect(_0x288435));return null;}}else{logger[_0xb4b8('0x31')]('agicommand\x20not\x20found');return null;}}catch(_0x57f2b2){logger[_0xb4b8('0x31')](_0x57f2b2[_0xb4b8('0x32')]);return null;}});if(_0x4b2916[_0xb4b8('0x33')]){logger[_0xb4b8('0x2c')](util[_0xb4b8('0x1e')](_0xb4b8('0x34'),_0x594404[_0xb4b8('0x21')],_0x594404[_0xb4b8('0x22')],_0x594404[_0xb4b8('0x23')],_0x594404[_0xb4b8('0x24')],_0x594404[_0xb4b8('0x35')]));_0x2a181a[_0xb4b8('0x36')](_0x4b2916[_0xb4b8('0x33')]['id'],function(_0x4fa699){try{_0x4fa699=_0x1a9dd7['clear'](_0x4fa699);logger['debug'](_0xb4b8('0x27'),JSON[_0xb4b8('0x1c')](_0x4fa699,null,0x2));if(_0x4fa699&&_0x1a9dd7[_0x4fa699['agicommand']]){_0x288435=_0x1a9dd7[_0x4fa699[_0xb4b8('0xb')]](_0x4fa699);if(_0x288435){logger[_0xb4b8('0x1b')](_0xb4b8('0x2d'),inspect(_0x288435));return _[_0xb4b8('0x30')](_0x288435[_0xb4b8('0x2e')])?null:_0x288435[_0xb4b8('0x2e')]['toString']();}else{logger[_0xb4b8('0x31')](_0xb4b8('0x2d'),inspect(_0x288435));return null;}}else{logger[_0xb4b8('0x31')](_0xb4b8('0x37'));return null;}}catch(_0x3ca872){logger[_0xb4b8('0x31')](_0x3ca872['stack']);return null;}});}logger[_0xb4b8('0x2c')](util[_0xb4b8('0x1e')](_0xb4b8('0x38'),_0x594404['arg_1'],_0x594404[_0xb4b8('0x22')],_0x594404['callerid'],_0x594404[_0xb4b8('0x24')],_0x594404[_0xb4b8('0x35')]));logger[_0xb4b8('0x2c')](util[_0xb4b8('0x1e')](_0xb4b8('0x39'),_0x594404[_0xb4b8('0x29')],_0x594404[_0xb4b8('0x2a')],parseInt(_0x594404[_0xb4b8('0x2b')],0xa)+0x1));_0x594404[_0xb4b8('0x3a')](_0x594404[_0xb4b8('0x29')],_0x594404[_0xb4b8('0x2a')],parseInt(_0x594404[_0xb4b8('0x2b')],0xa)+0x1);_0x594404[_0xb4b8('0x3b')]();}function handleNotFound(_0x40fd83){logger[_0xb4b8('0x31')](util['format']('Project\x20%s\x20not\x20found',_0x40fd83[_0xb4b8('0x21')]));_0x40fd83[_0xb4b8('0x3a')](_0x40fd83[_0xb4b8('0x29')],_0x40fd83['extension'],parseInt(_0x40fd83[_0xb4b8('0x2b')],0xa)+0x1);_0x40fd83[_0xb4b8('0x3b')]();}function handleUnpublished(_0x14605b){logger['error'](util[_0xb4b8('0x1e')](_0xb4b8('0x3c'),_0x14605b[_0xb4b8('0x21')]));_0x14605b['continueAt'](_0x14605b['context'],_0x14605b[_0xb4b8('0x2a')],parseInt(_0x14605b['priority'],0xa)+0x1);_0x14605b['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e42dbae..8f9c929 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 _0x1060=['emit','_inBody','line','exports','util','stream','Transform','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim'];(function(_0x2c4055,_0x3167c3){var _0x1a9b44=function(_0x53a6b3){while(--_0x53a6b3){_0x2c4055['push'](_0x2c4055['shift']());}};_0x1a9b44(++_0x3167c3);}(_0x1060,0x147));var _0x0106=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1060[_0x3ff085];return _0x2b68c3;};'use strict';var util=require(_0x0106('0x0'));var Transform=require(_0x0106('0x1'))[_0x0106('0x2')];function AGIReply(_0x46d318){Transform['call'](this,_0x46d318);this[_0x0106('0x3')]='';this['_inBody']=![];}util[_0x0106('0x4')](AGIReply,Transform);AGIReply[_0x0106('0x5')][_0x0106('0x6')]=function(_0x4257c2,_0x5946ad,_0x260c50){var _0xa8504f='\x0a',_0x848c04=['\x0a\x0a',_0x0106('0x7')],_0x2b3b68=-0x1,_0x1951a1=-0x1,_0x2bf569='',_0x319434=0x0,_0x389b9c='',_0xfc294e='';this['_localBuffer']+=_0x4257c2[_0x0106('0x8')]();_0x389b9c=this[_0x0106('0x3')];if(!this['_inBody']){_0x319434=0x0;while(_0x848c04[_0x319434]){while((_0x1951a1=_0x389b9c[_0x0106('0x9')](_0x848c04[_0x319434]))!=-0x1){_0x2bf569=_0x848c04[_0x319434];_0xfc294e=_0x389b9c[_0x0106('0xa')](0x0,_0x1951a1);_0x389b9c=_0x389b9c[_0x0106('0xa')](_0x1951a1+_0x2bf569[_0x0106('0xb')]);var _0x48bf28=_0xfc294e[_0x0106('0xc')](_0xa8504f),_0x35b91a=0x0,_0x311e6d={},_0x5dc6f0='',_0x5efda5='',_0x56f982=-0x1;while(_0x48bf28[_0x35b91a]){_0x56f982=_0x48bf28[_0x35b91a][_0x0106('0x9')](':');if(_0x56f982!=-0x1){_0x5dc6f0=_0x48bf28[_0x35b91a][_0x0106('0xd')](0x0,_0x56f982)[_0x0106('0xe')]();_0x5efda5=_0x48bf28[_0x35b91a][_0x0106('0xd')](_0x56f982+0x1)['trim']();if(_0x5dc6f0[_0x0106('0xb')]>0x0){_0x311e6d[_0x5dc6f0]=_0x5efda5;}}else{}_0x35b91a++;}this[_0x0106('0xf')]('headers',_0x311e6d);this[_0x0106('0x10')]=!![];}_0x319434++;}this[_0x0106('0x3')]=_0x389b9c;}else{while((_0x2b3b68=_0x389b9c[_0x0106('0x9')](_0xa8504f))!=-0x1){_0xfc294e=_0x389b9c[_0x0106('0xa')](0x0,_0x2b3b68);this[_0x0106('0xf')](_0x0106('0x11'),_0xfc294e);_0x389b9c=_0x389b9c[_0x0106('0xa')](_0x2b3b68+_0xa8504f[_0x0106('0xb')]);}this['_localBuffer']=_0x389b9c;}_0x260c50();};module[_0x0106('0x12')]=AGIReply; \ No newline at end of file +var _0xecd2=['length','slice','trim','headers','emit','line','exports','util','stream','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xecd2,0x139));var _0x2ecd=function(_0x1282dc,_0x1f044a){_0x1282dc=_0x1282dc-0x0;var _0x57df69=_0xecd2[_0x1282dc];return _0x57df69;};'use strict';var util=require(_0x2ecd('0x0'));var Transform=require(_0x2ecd('0x1'))['Transform'];function AGIReply(_0x253270){Transform[_0x2ecd('0x2')](this,_0x253270);this[_0x2ecd('0x3')]='';this[_0x2ecd('0x4')]=![];}util[_0x2ecd('0x5')](AGIReply,Transform);AGIReply[_0x2ecd('0x6')][_0x2ecd('0x7')]=function(_0x55c20f,_0x3dd84a,_0x5d22a5){var _0x1c38e7='\x0a',_0x1c010f=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4b6ea3=-0x1,_0x3fb62f=-0x1,_0x396055='',_0x2dc1af=0x0,_0x40aed2='',_0x181574='';this[_0x2ecd('0x3')]+=_0x55c20f[_0x2ecd('0x8')]();_0x40aed2=this[_0x2ecd('0x3')];if(!this[_0x2ecd('0x4')]){_0x2dc1af=0x0;while(_0x1c010f[_0x2dc1af]){while((_0x3fb62f=_0x40aed2[_0x2ecd('0x9')](_0x1c010f[_0x2dc1af]))!=-0x1){_0x396055=_0x1c010f[_0x2dc1af];_0x181574=_0x40aed2['substring'](0x0,_0x3fb62f);_0x40aed2=_0x40aed2[_0x2ecd('0xa')](_0x3fb62f+_0x396055[_0x2ecd('0xb')]);var _0x1aa1e3=_0x181574['split'](_0x1c38e7),_0x321932=0x0,_0x4abfa7={},_0x49c05f='',_0x4b14b4='',_0x26f62a=-0x1;while(_0x1aa1e3[_0x321932]){_0x26f62a=_0x1aa1e3[_0x321932][_0x2ecd('0x9')](':');if(_0x26f62a!=-0x1){_0x49c05f=_0x1aa1e3[_0x321932][_0x2ecd('0xc')](0x0,_0x26f62a)['trim']();_0x4b14b4=_0x1aa1e3[_0x321932][_0x2ecd('0xc')](_0x26f62a+0x1)[_0x2ecd('0xd')]();if(_0x49c05f[_0x2ecd('0xb')]>0x0){_0x4abfa7[_0x49c05f]=_0x4b14b4;}}else{}_0x321932++;}this['emit'](_0x2ecd('0xe'),_0x4abfa7);this[_0x2ecd('0x4')]=!![];}_0x2dc1af++;}this[_0x2ecd('0x3')]=_0x40aed2;}else{while((_0x4b6ea3=_0x40aed2[_0x2ecd('0x9')](_0x1c38e7))!=-0x1){_0x181574=_0x40aed2[_0x2ecd('0xa')](0x0,_0x4b6ea3);this[_0x2ecd('0xf')](_0x2ecd('0x10'),_0x181574);_0x40aed2=_0x40aed2[_0x2ecd('0xa')](_0x4b6ea3+_0x1c38e7[_0x2ecd('0xb')]);}this[_0x2ecd('0x3')]=_0x40aed2;}_0x5d22a5();};module[_0x2ecd('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 78ef017..d3b52db 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 _0xdeb7=['moment','jayson/promise','http','then','error','message','result','getSquareProjects','GetSquareProjects','name','getSquareProject','production','ShowMailAccount','MailServerOut','CloudProvider','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','lodash'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdeb7,0x77));var _0x7deb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdeb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7deb('0x0'));var moment=require(_0x7deb('0x1'));var jayson=require(_0x7deb('0x2'));var client=jayson['client'][_0x7deb('0x3')]({'port':0x2329});function request(_0x161729,_0x6c21e2){return new Promise(function(_0x20de63,_0x307ce7){return client['request'](_0x161729,_0x6c21e2)[_0x7deb('0x4')](function(_0x39505e){if(_0x39505e[_0x7deb('0x5')]){return _0x307ce7(_0x39505e[_0x7deb('0x5')][_0x7deb('0x6')]);}else{return _0x20de63(_0x39505e[_0x7deb('0x7')]);}})['catch'](function(_0xfa72b7){return _0x307ce7(_0xfa72b7);});});}exports[_0x7deb('0x8')]=function(){return request(_0x7deb('0x9'),{'options':{'raw':![],'attributes':['id',_0x7deb('0xa'),'production']}});};exports[_0x7deb('0xb')]=function(_0x5e37c9){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5e37c9},'attributes':[_0x7deb('0xc')]}});};exports['getMailAccountById']=function(_0x3940ec){return request(_0x7deb('0xd'),{'options':{'raw':![],'where':{'id':_0x3940ec},'include':[{'model':_0x7deb('0xe'),'as':'Smtp','include':[{'model':_0x7deb('0xf'),'as':_0x7deb('0xf')}]}],'attributes':['id',_0x7deb('0xa'),_0x7deb('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x1e4622){return request(_0x7deb('0x11'),{'options':{'where':{'id':_0x1e4622},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x12')]=function(_0xdf8efb){return request(_0x7deb('0x13'),{'options':{'where':{'id':_0xdf8efb},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x14')]=function(_0x18957d){return request(_0x7deb('0x15'),{'options':{'where':{'id':_0x18957d},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x16')]=function(_0x1d01bf){return request(_0x7deb('0x17'),{'options':{'where':{'id':_0x1d01bf},'attributes':[_0x7deb('0x18')]}});};exports['getUserById']=function(_0x13831c){return request('ShowUser',{'options':{'where':{'id':_0x13831c},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x19')]=function(_0x5439ac){return request(_0x7deb('0x1a'),{'options':{'where':{'phone':_0x5439ac[_0x7deb('0x1b')]},'attributes':['id']}});};exports[_0x7deb('0x1c')]=function(_0x2670a2){return request(_0x7deb('0x1d'),{'options':{'where':{'id':_0x2670a2},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x1e')]=function(_0x2ab72e){return request(_0x7deb('0x1f'),{'options':{'where':{'id':_0x2ab72e},'attributes':['save_name']}});};exports[_0x7deb('0x20')]=function(_0x262a0d){return request(_0x7deb('0x21'),{'options':{'raw':![],'where':{'id':_0x262a0d},'include':[{'model':_0x7deb('0x22'),'as':_0x7deb('0x23')}]}});};exports[_0x7deb('0x24')]=function(_0x31dd30){return request(_0x7deb('0x25'),{'options':{'where':{'id':_0x31dd30},'attributes':['id','name']}});};exports[_0x7deb('0x26')]=function(_0x2f1e42){return request(_0x7deb('0x27'),{'body':_0x2f1e42});};exports['createSquareDetailsReport']=function(_0x198a66){return request(_0x7deb('0x28'),{'body':_0x198a66});};exports[_0x7deb('0x29')]=function(_0x439493){return request('CreateSquareReport',{'body':_[_0x7deb('0x2a')](_0x439493,{'project_name':_0x439493[_0x7deb('0x2b')],'prev_project_name':_0x439493[_0x7deb('0x2c')]||'','is_subproject':_0x439493[_0x7deb('0x2c')]?!![]:![],'leaveAt':moment()[_0x7deb('0x2d')](_0x7deb('0x2e'))})});};exports[_0x7deb('0x2f')]=function(_0x659b9){return request(_0x7deb('0x30'),{'body':_0x659b9});};exports[_0x7deb('0x31')]=function(_0xe8a2a8){return request(_0x7deb('0x32'),{'body':_0xe8a2a8});};exports[_0x7deb('0x33')]=function(_0x14ec6f){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x14ec6f[_0x7deb('0x1b')],'ListId':_0x14ec6f['ListId']}}})[_0x7deb('0x4')](function(_0x480d7c){if(_0x480d7c){return _0x480d7c;}return request(_0x7deb('0x34'),{'body':_0x14ec6f});});};exports[_0x7deb('0x35')]=function(_0x57a062){return request('ShowPause',{'options':{'where':{'id':_0x57a062},'attributes':[_0x7deb('0xa')]}});};exports[_0x7deb('0x36')]=function(_0x565349,_0x504899){return request(_0x7deb('0x37'),{'body':{'interface':_0x504899},'options':{'where':_0x565349}});};exports[_0x7deb('0x38')]=function(_0x38d307,_0x20a0a8,_0x3a334b){return request(_0x7deb('0x39'),{'body':{'type':_0x20a0a8,'uniqueid':_0x3a334b},'options':{'where':_0x38d307}});};exports[_0x7deb('0x3a')]=function(_0x21c945){return request(_0x7deb('0x3b'),{'body':{},'options':{'where':_0x21c945}});};exports['agentLogout']=function(_0x24c739){return request('LogoutUser',{'body':{},'options':{'where':_0x24c739}});}; \ No newline at end of file +var _0x7e16=['getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','error','message','result','GetSquareProjects','name','production'];(function(_0x133438,_0x38087d){var _0xae397c=function(_0x48c538){while(--_0x48c538){_0x133438['push'](_0x133438['shift']());}};_0xae397c(++_0x38087d);}(_0x7e16,0x16f));var _0x67e1=function(_0x570867,_0xca7274){_0x570867=_0x570867-0x0;var _0x5b2faa=_0x7e16[_0x570867];return _0x5b2faa;};'use strict';var _=require(_0x67e1('0x0'));var moment=require(_0x67e1('0x1'));var jayson=require(_0x67e1('0x2'));var client=jayson[_0x67e1('0x3')]['http']({'port':0x2329});function request(_0x5a484e,_0x190359){return new Promise(function(_0x53bbdf,_0x268f07){return client[_0x67e1('0x4')](_0x5a484e,_0x190359)['then'](function(_0x39b185){if(_0x39b185[_0x67e1('0x5')]){return _0x268f07(_0x39b185[_0x67e1('0x5')][_0x67e1('0x6')]);}else{return _0x53bbdf(_0x39b185[_0x67e1('0x7')]);}})['catch'](function(_0x5cd5f1){return _0x268f07(_0x5cd5f1);});});}exports['getSquareProjects']=function(){return request(_0x67e1('0x8'),{'options':{'raw':![],'attributes':['id',_0x67e1('0x9'),_0x67e1('0xa')]}});};exports[_0x67e1('0xb')]=function(_0x5878f8){return request(_0x67e1('0xc'),{'options':{'raw':![],'where':{'name':_0x5878f8},'attributes':[_0x67e1('0xa')]}});};exports[_0x67e1('0xd')]=function(_0x12eda1){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x12eda1},'include':[{'model':_0x67e1('0xe'),'as':'Smtp','include':[{'model':_0x67e1('0xf'),'as':'CloudProvider'}]}],'attributes':['id','name',_0x67e1('0x10')],'smtp':!![]}});};exports[_0x67e1('0x11')]=function(_0x2d5d8b){return request(_0x67e1('0xc'),{'options':{'where':{'id':_0x2d5d8b},'attributes':['name']}});};exports[_0x67e1('0x12')]=function(_0x13a763){return request(_0x67e1('0x13'),{'options':{'where':{'id':_0x13a763},'attributes':['name']}});};exports[_0x67e1('0x14')]=function(_0x2cb7c1){return request(_0x67e1('0x15'),{'options':{'where':{'id':_0x2cb7c1},'attributes':[_0x67e1('0x9')]}});};exports[_0x67e1('0x16')]=function(_0x45b9df){return request(_0x67e1('0x17'),{'options':{'where':{'id':_0x45b9df},'attributes':[_0x67e1('0x18')]}});};exports[_0x67e1('0x19')]=function(_0x12e7ff){return request('ShowUser',{'options':{'where':{'id':_0x12e7ff},'attributes':[_0x67e1('0x9')]}});};exports[_0x67e1('0x1a')]=function(_0x2c36b8){return request('GetContactByPhone',{'options':{'where':{'phone':_0x2c36b8['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3ee9e3){return request(_0x67e1('0x1b'),{'options':{'where':{'id':_0x3ee9e3},'attributes':[_0x67e1('0x9')]}});};exports[_0x67e1('0x1c')]=function(_0x5d2231){return request(_0x67e1('0x1d'),{'options':{'where':{'id':_0x5d2231},'attributes':[_0x67e1('0x1e')]}});};exports[_0x67e1('0x1f')]=function(_0x2c1dda){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2c1dda},'include':[{'model':_0x67e1('0x20'),'as':_0x67e1('0x21')}]}});};exports[_0x67e1('0x22')]=function(_0x66ad21){return request(_0x67e1('0x23'),{'options':{'where':{'id':_0x66ad21},'attributes':['id',_0x67e1('0x9')]}});};exports[_0x67e1('0x24')]=function(_0x571930){return request(_0x67e1('0x25'),{'body':_0x571930});};exports[_0x67e1('0x26')]=function(_0xa44c7b){return request(_0x67e1('0x27'),{'body':_0xa44c7b});};exports[_0x67e1('0x28')]=function(_0x291282){return request(_0x67e1('0x29'),{'body':_[_0x67e1('0x2a')](_0x291282,{'project_name':_0x291282[_0x67e1('0x2b')],'prev_project_name':_0x291282[_0x67e1('0x2c')]||'','is_subproject':_0x291282['arg_2']?!![]:![],'leaveAt':moment()[_0x67e1('0x2d')](_0x67e1('0x2e'))})});};exports[_0x67e1('0x2f')]=function(_0x5ec98b){return request(_0x67e1('0x30'),{'body':_0x5ec98b});};exports['createSquareMessage']=function(_0x2d19a4){return request(_0x67e1('0x31'),{'body':_0x2d19a4});};exports[_0x67e1('0x32')]=function(_0x544371){return request(_0x67e1('0x33'),{'options':{'raw':![],'where':{'phone':_0x544371['phone'],'ListId':_0x544371[_0x67e1('0x34')]}}})[_0x67e1('0x35')](function(_0x53145d){if(_0x53145d){return _0x53145d;}return request(_0x67e1('0x36'),{'body':_0x544371});});};exports[_0x67e1('0x37')]=function(_0x1bbe01){return request(_0x67e1('0x38'),{'options':{'where':{'id':_0x1bbe01},'attributes':[_0x67e1('0x9')]}});};exports[_0x67e1('0x39')]=function(_0x4b00dc,_0x580bd6){return request('LoginUser',{'body':{'interface':_0x580bd6},'options':{'where':_0x4b00dc}});};exports['agentPause']=function(_0x3a7d56,_0x2f347b,_0x4928b6){return request(_0x67e1('0x3a'),{'body':{'type':_0x2f347b,'uniqueid':_0x4928b6},'options':{'where':_0x3a7d56}});};exports[_0x67e1('0x3b')]=function(_0x370a1d){return request(_0x67e1('0x3c'),{'body':{},'options':{'where':_0x370a1d}});};exports[_0x67e1('0x3d')]=function(_0x271a64){return request(_0x67e1('0x3e'),{'body':{},'options':{'where':_0x271a64}});}; \ 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 99d5fac..2d62235 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 _0xa2c8=['./polly','./lex','exports'];(function(_0x11feae,_0x3b3532){var _0x419229=function(_0x327074){while(--_0x327074){_0x11feae['push'](_0x11feae['shift']());}};_0x419229(++_0x3b3532);}(_0xa2c8,0x99));var _0x8a2c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa2c8[_0x20a584];return _0x4b41a8;};var polly=require(_0x8a2c('0x0'));var lex=require(_0x8a2c('0x1'));module[_0x8a2c('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd046=['exports','./lex'];(function(_0x3381c3,_0x31a53b){var _0x55e123=function(_0x4e785a){while(--_0x4e785a){_0x3381c3['push'](_0x3381c3['shift']());}};_0x55e123(++_0x31a53b);}(_0xd046,0x129));var _0x6d04=function(_0x4902b9,_0x420787){_0x4902b9=_0x4902b9-0x0;var _0x7287f1=_0xd046[_0x4902b9];return _0x7287f1;};var polly=require('./polly');var lex=require(_0x6d04('0x0'));module[_0x6d04('0x1')]={'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 e1c3d35..6dd14be 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 _0x2dae=['./lib/api'];(function(_0x2f870b,_0x3f04f9){var _0x35c0b3=function(_0x132e41){while(--_0x132e41){_0x2f870b['push'](_0x2f870b['shift']());}};_0x35c0b3(++_0x3f04f9);}(_0x2dae,0xc3));var _0xe2da=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x2dae[_0x172ed7];return _0xfa8f61;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ No newline at end of file +var _0xe5b5=['exports','./lib/api'];(function(_0x57370f,_0x55f716){var _0x4b5a2b=function(_0x2bf618){while(--_0x2bf618){_0x57370f['push'](_0x57370f['shift']());}};_0x4b5a2b(++_0x55f716);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xe5b5[_0x13ea00];return _0x1f7347;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ 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 a08e79c..0836784 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(_0x231044,_0x3fe0cb){var _0x38328c=function(_0x211317){while(--_0x211317){_0x231044['push'](_0x231044['shift']());}};_0x38328c(++_0x3fe0cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x9e22d2,_0x516c67){var _0x1ce058=function(_0x1b16b6){while(--_0x1b16b6){_0x9e22d2['push'](_0x9e22d2['shift']());}};_0x1ce058(++_0x516c67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index d921d2e..3f6a062 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 _0x54c4=['exports','./lib/api'];(function(_0x37ee65,_0x14f835){var _0x1c0757=function(_0x56d139){while(--_0x56d139){_0x37ee65['push'](_0x37ee65['shift']());}};_0x1c0757(++_0x14f835);}(_0x54c4,0xf3));var _0x454c=function(_0x5d102a,_0x34f459){_0x5d102a=_0x5d102a-0x0;var _0xcbcefc=_0x54c4[_0x5d102a];return _0xcbcefc;};'use strict';var polly=require(_0x454c('0x0'));module[_0x454c('0x1')]=function(_0x23b137,_0xb21441,_0x3ee24f,_0x17001d,_0x3e9efe,_0x1e7667,_0x2ac0f1){return polly(_0x23b137,_0xb21441,_0x3ee24f,_0x17001d,_0x3e9efe,_0x1e7667,_0x2ac0f1);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x46342a,_0x369371,_0x2ee6bc,_0x430c64,_0x150d8a,_0x3f8805,_0x172576){return polly(_0x46342a,_0x369371,_0x2ee6bc,_0x430c64,_0x150d8a,_0x3f8805,_0x172576);}; \ 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 975d63b..491ab3d 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 _0x0846=['No\x20data\x20response\x20from\x20aws\x20Polly!','text','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x0846,0x17c));var _0x6084=function(_0x14453e,_0x53559b){_0x14453e=_0x14453e-0x0;var _0x21edf0=_0x0846[_0x14453e];return _0x21edf0;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x6084('0x0'));var rs=require(_0x6084('0x1'));var AWS=require(_0x6084('0x2'));function pollyResult(_0x3882e1,_0x5e1800,_0x4e3a85){return new BPromise(function(_0x5e7a28,_0x7521b5){_0x3882e1[_0x6084('0x3')](_0x5e1800,function(_0x4856de,_0x3c2414){if(_0x4856de){_0x7521b5(_0x4856de);}else if(_0x3c2414){if(_0x3c2414['AudioStream']instanceof Buffer){fs[_0x6084('0x4')](_0x4e3a85,_0x3c2414[_0x6084('0x5')],function(_0x26834c){if(_0x26834c){_0x7521b5(_0x26834c);}else{_0x5e7a28();}});}else{_0x7521b5(new Error(_0x6084('0x6')));}}else{_0x7521b5(new Error(_0x6084('0x7')));}});});}module['exports']=function(_0x10b18e,_0x591abf,_0x3a5b20,_0x279a45,_0xc0fe16,_0x24e62e,_0x574157){var _0x273ad4=new AWS['Polly']({'accessKeyId':_0x10b18e,'secretAccessKey':_0x591abf,'region':_0x3a5b20});var _0x2c8bf0={'Text':_0xc0fe16,'TextType':_0x24e62e||_0x6084('0x8'),'OutputFormat':'mp3','VoiceId':_0x279a45};return pollyResult(_0x273ad4,_0x2c8bf0,_0x574157);}; \ No newline at end of file +var _0x37ff=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3'];(function(_0x6b83b1,_0x4b3392){var _0x30cb37=function(_0x550817){while(--_0x550817){_0x6b83b1['push'](_0x6b83b1['shift']());}};_0x30cb37(++_0x4b3392);}(_0x37ff,0x150));var _0xf37f=function(_0xc838b8,_0x2f4309){_0xc838b8=_0xc838b8-0x0;var _0x18c0be=_0x37ff[_0xc838b8];return _0x18c0be;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xf37f('0x0'));function pollyResult(_0x16a57a,_0x377910,_0x550058){return new BPromise(function(_0xed99e0,_0x4395af){_0x16a57a['synthesizeSpeech'](_0x377910,function(_0x448a4b,_0x1d9ce8){if(_0x448a4b){_0x4395af(_0x448a4b);}else if(_0x1d9ce8){if(_0x1d9ce8[_0xf37f('0x1')]instanceof Buffer){fs[_0xf37f('0x2')](_0x550058,_0x1d9ce8['AudioStream'],function(_0x3d2101){if(_0x3d2101){_0x4395af(_0x3d2101);}else{_0xed99e0();}});}else{_0x4395af(new Error(_0xf37f('0x3')));}}else{_0x4395af(new Error(_0xf37f('0x4')));}});});}module['exports']=function(_0x4224ac,_0x32635c,_0xf62d67,_0x1c41e5,_0x5d3e80,_0x525320,_0x3d9585){var _0xca1133=new AWS[(_0xf37f('0x5'))]({'accessKeyId':_0x4224ac,'secretAccessKey':_0x32635c,'region':_0xf62d67});var _0x39ef22={'Text':_0x5d3e80,'TextType':_0x525320||'text','OutputFormat':_0xf37f('0x6'),'VoiceId':_0x1c41e5};return pollyResult(_0xca1133,_0x39ef22,_0x3d9585);}; \ 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 1283a46..b3b313a 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 _0x2bef=['./lib/api'];(function(_0x461bb0,_0x588d9c){var _0x2e8519=function(_0x2d5f48){while(--_0x2d5f48){_0x461bb0['push'](_0x461bb0['shift']());}};_0x2e8519(++_0x588d9c);}(_0x2bef,0x97));var _0xf2be=function(_0x3523ff,_0x4b8413){_0x3523ff=_0x3523ff-0x0;var _0xee01c1=_0x2bef[_0x3523ff];return _0xee01c1;};'use strict';var asr=require(_0xf2be('0x0'));module['exports']=function(_0xd550cf,_0x43ac54,_0x40b131,_0x487dea){return asr(_0xd550cf,_0x43ac54,_0x40b131);}; \ No newline at end of file +var _0xc5e7=['exports','./lib/api'];(function(_0x2bbfe0,_0x2271f9){var _0x4ce935=function(_0x5502e1){while(--_0x5502e1){_0x2bbfe0['push'](_0x2bbfe0['shift']());}};_0x4ce935(++_0x2271f9);}(_0xc5e7,0xa9));var _0x7c5e=function(_0x59c563,_0x31d80d){_0x59c563=_0x59c563-0x0;var _0x7f4a6c=_0xc5e7[_0x59c563];return _0x7f4a6c;};'use strict';var asr=require(_0x7c5e('0x0'));module[_0x7c5e('0x1')]=function(_0x22616f,_0x2338a7,_0x240872,_0xf5aaa7){return asr(_0x22616f,_0x2338a7,_0x240872);}; \ 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 26510c4..40725f6 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 _0x0a9a=['POST','8000','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4f9850,_0x75f147){_0x4f9850=_0x4f9850-0x0;var _0x2aaab2=_0x0a9a[_0x4f9850];return _0x2aaab2;};'use strict';var url=require('url');var BPromise=require(_0xa0a9('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa0a9('0x1')]=function(_0x3cff22,_0x34801b,_0x49162f){return new BPromise(function(_0x4ba993,_0x317a94){var _0x360be5;if(typeof _0x3cff22!=='string'||_0x3cff22[_0xa0a9('0x2')]===0x0){return _0x317a94(_0xa0a9('0x3'));}if(typeof _0x34801b!==_0xa0a9('0x4')||_0x34801b[_0xa0a9('0x2')]===0x0){return _0x317a94('key\x20should\x20be\x20a\x20string');}if(typeof _0x49162f!==_0xa0a9('0x5')&&(typeof _0x49162f!=='string'||_0x49162f[_0xa0a9('0x2')]===0x0)){return _0x317a94(_0xa0a9('0x6'));}try{_0x360be5=fs[_0xa0a9('0x7')](_0x3cff22)[_0xa0a9('0x8')]('base64');}catch(_0x2ba0ac){return _0x317a94(_0x2ba0ac);}return _0x4ba993({'method':_0xa0a9('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x34801b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa0a9('0xa'),'languageCode':_0x49162f},'audio':{'content':_0x360be5}},'json':!![]});});}; \ No newline at end of file +var _0x2904=['bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url'];(function(_0xa083d8,_0x24ab72){var _0x47c285=function(_0xd3b2d1){while(--_0xd3b2d1){_0xa083d8['push'](_0xa083d8['shift']());}};_0x47c285(++_0x24ab72);}(_0x2904,0x137));var _0x4290=function(_0x3ecf96,_0x473afe){_0x3ecf96=_0x3ecf96-0x0;var _0x3c3e5d=_0x2904[_0x3ecf96];return _0x3c3e5d;};'use strict';var url=require(_0x4290('0x0'));var BPromise=require(_0x4290('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4290('0x2')]=function(_0x511133,_0x30c1c2,_0x3d09c0){return new BPromise(function(_0x155538,_0x3d1cdd){var _0x1d9270;if(typeof _0x511133!=='string'||_0x511133[_0x4290('0x3')]===0x0){return _0x3d1cdd(_0x4290('0x4'));}if(typeof _0x30c1c2!==_0x4290('0x5')||_0x30c1c2['length']===0x0){return _0x3d1cdd(_0x4290('0x6'));}if(typeof _0x3d09c0!=='undefined'&&(typeof _0x3d09c0!=='string'||_0x3d09c0[_0x4290('0x3')]===0x0)){return _0x3d1cdd('lang\x20should\x20be\x20a\x20string');}try{_0x1d9270=fs[_0x4290('0x7')](_0x511133)[_0x4290('0x8')]('base64');}catch(_0xca467e){return _0x3d1cdd(_0xca467e);}return _0x155538({'method':_0x4290('0x9'),'uri':host+_0x4290('0xa')+_0x30c1c2,'body':{'config':{'encoding':_0x4290('0xb'),'sampleRateHertz':_0x4290('0xc'),'languageCode':_0x3d09c0},'audio':{'content':_0x1d9270}},'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 16d3a4d..1dacf87 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 _0x6583=['exports','./asr'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6583,0x1c3));var _0x3658=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x6583[_0x2d4421];return _0x2d3b01;};var asr=require(_0x3658('0x0'));module[_0x3658('0x1')]={'asr':asr}; \ No newline at end of file +var _0xcc22=['./asr','exports'];(function(_0x11325f,_0x4dafc9){var _0x13b110=function(_0x1d325d){while(--_0x1d325d){_0x11325f['push'](_0x11325f['shift']());}};_0x13b110(++_0x4dafc9);}(_0xcc22,0x150));var _0x2cc2=function(_0x438e00,_0x2ad474){_0x438e00=_0x438e00-0x0;var _0xd1098=_0xcc22[_0x438e00];return _0xd1098;};var asr=require(_0x2cc2('0x0'));module[_0x2cc2('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 344cfa1..a190e5c 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 _0x6aef=['base64','chmodSync','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','parse\x20response\x20failed:\x0a','lang\x20\x22','goggleTTS\x20path','googleASR','uri','results','map','alternatives','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','model=%s','parse','text','channelData','CustomAction','AudioFromTts','Data','audiofile','bluebird','dialogflow','http','https','path','randomstring','sox','google-tts-api','url','util','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','download\x20error','pipe','end','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','writeFileSync','then','unlink','777','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent'];(function(_0x3a8c93,_0x4ede61){var _0x542151=function(_0x449fd0){while(--_0x449fd0){_0x3a8c93['push'](_0x3a8c93['shift']());}};_0x542151(++_0x4ede61);}(_0x6aef,0x1de));var _0xf6ae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6aef[_0x321bb2];return _0x9c12ed;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xf6ae('0x0'));var dialogflow=require(_0xf6ae('0x1'));var fs=require('fs');var http=require(_0xf6ae('0x2'));var https=require(_0xf6ae('0x3'));var md5=require('md5');var path=require(_0xf6ae('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xf6ae('0x5'));var sox=require(_0xf6ae('0x6'));var tts=require(_0xf6ae('0x7'));var urlParse=require(_0xf6ae('0x8'))['parse'];var util=require(_0xf6ae('0x9'));var aws=require('./aws');var google=require(_0xf6ae('0xa'));var sestek=require(_0xf6ae('0xb'));var tilde=require(_0xf6ae('0xc'));var logger=require('../../../config/logger')(_0xf6ae('0xd'));var ISPEECH_API=_0xf6ae('0xe');function downloadFile(_0x309631,_0x1d41f2){return new BPromise(function(_0x484509,_0x143174){var _0x5844d3=urlParse(_0x309631);var _0x21c48d=_0x5844d3['protocol']===_0xf6ae('0xf')?https:http;var _0x41ead8={'host':_0x5844d3[_0xf6ae('0x10')],'path':_0x5844d3[_0xf6ae('0x4')],'headers':{'user-agent':_0xf6ae('0x11')}};_0x21c48d[_0xf6ae('0x12')](_0x41ead8,function(_0x1aac49){if(_0x1aac49[_0xf6ae('0x13')]!==0xc8){logger[_0xf6ae('0x14')](_0xf6ae('0x15')+_0x309631+_0xf6ae('0x16')+_0x1aac49[_0xf6ae('0x13')]+'\x20('+_0x1aac49[_0xf6ae('0x17')]+')');_0x143174(new Error(_0xf6ae('0x15')+_0x309631+'\x20failed,\x20status\x20code\x20=\x20'+_0x1aac49[_0xf6ae('0x13')]+'\x20('+_0x1aac49[_0xf6ae('0x17')]+')'));return;}var _0x3196ae=fs[_0xf6ae('0x18')](_0x1d41f2);_0x3196ae['on'](_0xf6ae('0x19'),function(){logger[_0xf6ae('0x1a')]('finish\x20download\x20file');_0x3196ae[_0xf6ae('0x1b')](_0x484509);});_0x3196ae['on'](_0xf6ae('0x14'),function(_0x54dca7){fs['unlink'](_0x1d41f2);logger[_0xf6ae('0x14')](_0xf6ae('0x1c'),_0x54dca7);_0x143174(_0x54dca7);});_0x1aac49[_0xf6ae('0x1d')](_0x3196ae);})['on'](_0xf6ae('0x14'),function(_0x1be389){logger[_0xf6ae('0x14')](_0x1be389);_0x143174(_0x1be389);})[_0xf6ae('0x1e')]();});}function uploadFile(_0x4c8cde){return new BPromise(function(_0x2a5faf,_0x2722a4){var _0x5903e5=urlParse(_0x4c8cde);var _0x3912ec=_0x5903e5[_0xf6ae('0x1f')]==='https:'?https:http;var _0x422c37={'host':_0x5903e5[_0xf6ae('0x10')],'path':_0x5903e5[_0xf6ae('0x4')],'headers':{'user-agent':_0xf6ae('0x11')}};_0x3912ec[_0xf6ae('0x12')](_0x422c37,function(_0x122223){if(_0x122223[_0xf6ae('0x13')]!==0xc8){_0x2722a4(new Error(_0xf6ae('0x15')+_0x4c8cde+_0xf6ae('0x16')+_0x122223[_0xf6ae('0x13')]+'\x20('+_0x122223[_0xf6ae('0x17')]+')'));return;}var _0x3fa7a3='';_0x122223['on'](_0xf6ae('0x20'),function(_0x221b23){_0x3fa7a3+=_0x221b23;});_0x122223['on'](_0xf6ae('0x1e'),function(){_0x2a5faf(_0x3fa7a3);});})['on'](_0xf6ae('0x14'),function(_0x516139){_0x2722a4(_0x516139);})['end']();});}function convertFile(_0x69b5e9,_0x297b55){return new BPromise(function(_0x51834e,_0x4c4dbf){var _0x3d0a80=sox[_0xf6ae('0x21')](_0x69b5e9,_0x297b55,{'sampleRate':0x1f40,'format':_0xf6ae('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3d0a80['on']('error',function(_0x382224){logger[_0xf6ae('0x14')](_0xf6ae('0x23'),_0x382224);_0x4c4dbf(_0x382224);});_0x3d0a80['on'](_0xf6ae('0x1e'),function(){logger[_0xf6ae('0x1a')](_0xf6ae('0x24'));_0x51834e();});_0x3d0a80[_0xf6ae('0x25')]();});}function base64Decode(_0x4a4607,_0x2e537c){var _0xa1a936=path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs['generate'](0x4)+_0xf6ae('0x28'));fs[_0xf6ae('0x29')](_0xa1a936,_0x4a4607,'base64');return convertFile(_0xa1a936,_0x2e537c)[_0xf6ae('0x2a')](function(){try{fs[_0xf6ae('0x2b')](_0xa1a936);fs['chmodSync'](_0x2e537c,_0xf6ae('0x2c'));}catch(_0x4cdb10){logger[_0xf6ae('0x14')](_0x4cdb10);}return _0x2e537c['split']('.')[0x0];});}function base64Encode(_0x1240a3){var _0x43b4e4=fs[_0xf6ae('0x2d')](_0x1240a3);return new Buffer(_0x43b4e4)['toString']('base64');}exports['googleCloudTTS']=function(_0x18fb11,_0x4a9943,_0x220468,_0x308882,_0x2bae1a,_0x58201c){var _0x59a799,_0x2603c1;var _0xdbead3=_0xf6ae('0x2e');var _0x6a8140=_0xf6ae('0x2f')+_0x18fb11;var _0x5e151e={};if(_0x4a9943===_0xf6ae('0x30')){_0x5e151e[_0xf6ae('0x31')]={'ssml':_0x220468};}else{_0x5e151e[_0xf6ae('0x31')]={'text':_0x220468};};_0x5e151e['voice']={'languageCode':_0x308882,'ssmlGender':_0x2bae1a};_0x5e151e[_0xf6ae('0x32')]={'audioEncoding':_0xf6ae('0x33'),'sampleRateHertz':0x1f40};var _0x22ba70={'url':_0xdbead3+_0xf6ae('0x34')+_0x6a8140,'method':_0xf6ae('0x35'),'json':!![],'body':_0x5e151e};return rp(_0x22ba70)[_0xf6ae('0x2a')](function(_0x4c17c6){return new BPromise(function(_0x26b497,_0x59c1aa){_0x59a799=path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs[_0xf6ae('0x36')](0x4)+_0xf6ae('0x37'));var _0x42de21=Buffer[_0xf6ae('0x38')](_0x4c17c6[_0xf6ae('0x39')],_0xf6ae('0x3a'));return fs['writeFile'](_0x59a799,_0x42de21,function(_0x54b473){_0x59c1aa(_0x54b473);},function(_0x24529c){fs[_0xf6ae('0x3b')](_0x59a799,_0xf6ae('0x2c'));_0x26b497(_0x24529c);});});})[_0xf6ae('0x2a')](function(_0x43d6b4){_0x2603c1=path['resolve'](__dirname,_0xf6ae('0x27'),rs['generate'](0x4)+_0xf6ae('0x28'));return convertFile(_0x59a799,_0x2603c1);})[_0xf6ae('0x2a')](function(){try{fs[_0xf6ae('0x2b')](_0x59a799);fs[_0xf6ae('0x3b')](_0x2603c1,'777');}catch(_0x23cc44){logger['error'](_0x23cc44);}logger[_0xf6ae('0x1a')]('googleCloudTTS\x20path',_0x2603c1[_0xf6ae('0x3c')]('.')[0x0]);return _0x2603c1[_0xf6ae('0x3c')]('.')[0x0];});};exports[_0xf6ae('0x3d')]=function(_0x893c82,_0x2957f5){var _0x1ea976=_0xf6ae('0x3e');var _0x42de92,_0x3af942;var _0xb1d5b0;var _0x4e869d={'encoding':_0xf6ae('0x3f'),'method':_0xf6ae('0x35'),'timeout':0x2710,'url':_0x1ea976,'headers':{'Content-Type':_0xf6ae('0x40')},'body':_0xf6ae('0x41')+encodeURIComponent(JSON[_0xf6ae('0x42')]([[[_0xf6ae('0x43'),JSON[_0xf6ae('0x42')]([_0x893c82,_0x2957f5||'en',![],_0xf6ae('0x44')]),null,'generic']]]))};return rp(_0x4e869d)[_0xf6ae('0x2a')](function(_0x309b95){try{_0xb1d5b0=eval(_0x309b95['slice'](0x5))[0x0][0x2];}catch(_0x5182a2){throw new Error(_0xf6ae('0x45')+_0x309b95[_0xf6ae('0x20')]);}if(!_0xb1d5b0){if(_0x893c82['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xf6ae('0x46')+_0x2957f5+'\x22\x20might\x20not\x20exist');}}try{_0xb1d5b0=eval(_0xb1d5b0)[0x0];}catch(_0x4a3f5c){throw new Error(_0xf6ae('0x45')+res[_0xf6ae('0x20')]);}const _0x450bd3=_0xb1d5b0;_0x42de92=path[_0xf6ae('0x26')](__dirname,'tmp',rs[_0xf6ae('0x36')](0x4)+_0xf6ae('0x37'));fs[_0xf6ae('0x29')](_0x42de92,_0xb1d5b0,{'encoding':'base64'});_0x3af942=path[_0xf6ae('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x42de92,_0x3af942);})[_0xf6ae('0x2a')](function(){try{fs['unlink'](_0x42de92);fs['chmodSync'](_0x3af942,_0xf6ae('0x2c'));}catch(_0x18fe15){logger[_0xf6ae('0x14')](_0x18fe15);}logger[_0xf6ae('0x1a')](_0xf6ae('0x47'),_0x3af942[_0xf6ae('0x3c')]('.')[0x0]);return _0x3af942[_0xf6ae('0x3c')]('.')[0x0];});};exports[_0xf6ae('0x48')]=function(_0x15d714,_0x12bff1,_0x151801){return google['asr'](_0x15d714,_0x12bff1,_0x151801)[_0xf6ae('0x2a')](function(_0x46608d){logger['info'](_0x46608d[_0xf6ae('0x49')]);return rp(_0x46608d);})['then'](function(_0x27222d){var _0x4827b7='';var _0x55e918=0x0;try{fs['unlink'](_0x15d714);}catch(_0x32b8c8){logger[_0xf6ae('0x14')](_0x32b8c8);}if(_0x27222d&&_0x27222d['results']){_0x4827b7=_0x27222d[_0xf6ae('0x4a')][_0xf6ae('0x4b')](function(_0x4d8608){return _0x4d8608&&_0x4d8608['alternatives'][0x0]&&_0x4d8608[_0xf6ae('0x4c')][0x0]['transcript']?_0x4d8608['alternatives'][0x0]['transcript']:'';})[_0xf6ae('0x4d')]('\x0a');_0x55e918=_0x27222d['results']['map'](function(_0x5b9db4){return _0x5b9db4&&_0x5b9db4[_0xf6ae('0x4c')][0x0]&&_0x5b9db4['alternatives'][0x0][_0xf6ae('0x4e')]?_0x5b9db4[_0xf6ae('0x4c')][0x0][_0xf6ae('0x4e')]:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0x4827b7);logger['info'](_0xf6ae('0x4f'),_0x55e918);return{'transcript':_0x4827b7,'confidence':_0x55e918};})[_0xf6ae('0x50')](function(_0x30963d){logger[_0xf6ae('0x14')](_0xf6ae('0x51'),_0x30963d[_0xf6ae('0x13')],_0x30963d['name'],_0x30963d[_0xf6ae('0x52')]);});};exports['googleDialogflow']=function(_0x442768,_0xc475e1,_0x431f0d,_0x5a3e1c){var _0x2fc487=apiai(_0xc475e1,{'language':_0x5a3e1c||'en'});return _0x2fc487[_0xf6ae('0x53')](_0x431f0d,{'sessionId':md5(_0x442768)})['then'](function(_0xb7ef7c){logger[_0xf6ae('0x1a')](JSON[_0xf6ae('0x42')](_0xb7ef7c));return{'source':_0xb7ef7c['result'][_0xf6ae('0x54')],'resolvedQuery':_0xb7ef7c[_0xf6ae('0x55')][_0xf6ae('0x56')],'action':_0xb7ef7c[_0xf6ae('0x55')][_0xf6ae('0x57')],'actionIncomplete':_0xb7ef7c['result'][_0xf6ae('0x58')],'speech':_0xb7ef7c[_0xf6ae('0x55')][_0xf6ae('0x59')][_0xf6ae('0x5a')],'score':_0xb7ef7c[_0xf6ae('0x55')][_0xf6ae('0x5b')],'statusCode':_0xb7ef7c[_0xf6ae('0x5c')][_0xf6ae('0x5d')],'endConversation':_0xb7ef7c['result'][_0xf6ae('0x5e')][_0xf6ae('0x5f')]||![],'isFallbackIntent':_0xb7ef7c[_0xf6ae('0x55')][_0xf6ae('0x5e')]['isFallbackIntent']};});};exports[_0xf6ae('0x60')]=function(_0x260d3e,_0x20ed0b,_0x33fe50,_0x59d969,_0x3783bf,_0x29f546){var _0x41f340=_0x59d969['replace'](/\\n/g,'\x0a');var _0x1a6cc2={'credentials':{'private_key':_0x41f340,'client_email':_0x33fe50}};var _0x5aaabf=new dialogflow[(_0xf6ae('0x61'))](_0x1a6cc2);var _0x48e76d=_0x5aaabf[_0xf6ae('0x62')](_0x20ed0b,md5(_0x260d3e));var _0x3c02be={'session':_0x48e76d,'queryInput':{'text':{'text':_0x3783bf,'languageCode':_0x29f546}}};return _0x5aaabf[_0xf6ae('0x63')](_0x3c02be)[_0xf6ae('0x2a')](function(_0x55848b){if(_0x55848b&&_0x55848b['length']){logger[_0xf6ae('0x1a')](_0xf6ae('0x64'),JSON[_0xf6ae('0x42')](_0x55848b));var _0x176b0e=_0x55848b[0x0];if(_0x176b0e){var _0x4f1ef0={'action':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x57')],'allRequiredParamsPresent':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x66')],'endConversation':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x67')]&&_0x176b0e['queryResult'][_0xf6ae('0x67')][_0xf6ae('0x68')]?_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x67')]['fields'][_0xf6ae('0x69')][_0xf6ae('0x6a')]:![],'fulfillmentText':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x6b')],'intentName':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x6c')][_0xf6ae('0x6d')],'intentDisplayName':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x6c')][_0xf6ae('0x6e')],'isFallbackIntent':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x6c')]['isFallback'],'languageCode':_0x176b0e[_0xf6ae('0x65')][_0xf6ae('0x6f')],'queryText':_0x176b0e[_0xf6ae('0x65')]['queryText'],'responseId':_0x176b0e[_0xf6ae('0x70')],'score':_0x176b0e['queryResult'][_0xf6ae('0x71')],'speech':_0x176b0e[_0xf6ae('0x65')]['fulfillmentText'],'providerResponse':JSON[_0xf6ae('0x42')](_0x55848b)};return _0x4f1ef0;}}});};exports[_0xf6ae('0x72')]=function(_0x56fdf7,_0x1f221a,_0x35c390,_0x14bd3f){return tilde[_0xf6ae('0x73')](_0x56fdf7,_0x1f221a,_0x35c390,_0x14bd3f)[_0xf6ae('0x2a')](function(_0x56aca1){try{fs[_0xf6ae('0x2b')](_0x56fdf7);}catch(_0xcf53ec){logger['error'](_0xcf53ec);}logger[_0xf6ae('0x1a')](_0xf6ae('0x74'),_0x56aca1[_0xf6ae('0x75')]);logger['info'](_0xf6ae('0x76'),_0x56aca1['confidence']);return _0x56aca1;});};exports[_0xf6ae('0x77')]=function(_0x2a7e2f,_0xb87068,_0x4ad8a6,_0x269971,_0x1bc95e,_0x13b89f){var _0x5423a1=path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs[_0xf6ae('0x36')](0x4)+_0xf6ae('0x37'));var _0x1e6e72;return aws[_0xf6ae('0x78')](_0x2a7e2f,_0xb87068,_0x4ad8a6,_0x269971,_0x1bc95e,_0x13b89f,_0x5423a1)[_0xf6ae('0x2a')](function(){_0x1e6e72=path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs[_0xf6ae('0x36')](0x4)+_0xf6ae('0x28'));return convertFile(_0x5423a1,_0x1e6e72);})[_0xf6ae('0x2a')](function(){try{fs[_0xf6ae('0x2b')](_0x5423a1);fs[_0xf6ae('0x3b')](_0x1e6e72,_0xf6ae('0x2c'));}catch(_0x5947c0){logger[_0xf6ae('0x14')](_0x5947c0);}return _0x1e6e72[_0xf6ae('0x3c')]('.')[0x0];});};exports[_0xf6ae('0x79')]=function(_0x190847,_0x5c31b4,_0x236da6,_0x18eabb,_0x232e3f,_0x1f0fb7){return aws[_0xf6ae('0x7a')](_0x190847,_0x5c31b4,_0x236da6,_0x18eabb,_0x232e3f,_0x1f0fb7)[_0xf6ae('0x2a')](function(_0x5842cd){logger[_0xf6ae('0x1a')](JSON[_0xf6ae('0x42')](_0x5842cd));return _0x5842cd;});};exports[_0xf6ae('0x7b')]=function(_0x152a7b,_0x4ef084,_0x37e7a6,_0x3fbcf1){var _0x242e8a=util[_0xf6ae('0x7c')](_0xf6ae('0x7d'),ISPEECH_API,_0x152a7b,encodeURIComponent(_0x4ef084),_0x37e7a6,_0x3fbcf1);var _0x3f38e8=path[_0xf6ae('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xf6ae('0x37'));var _0x666f0a;return downloadFile(_0x242e8a,_0x3f38e8)[_0xf6ae('0x2a')](function(){_0x666f0a=path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs[_0xf6ae('0x36')](0x4)+_0xf6ae('0x28'));return convertFile(_0x3f38e8,_0x666f0a);})['then'](function(){try{fs['unlink'](_0x3f38e8);fs['chmodSync'](_0x666f0a,_0xf6ae('0x2c'));}catch(_0x22856d){logger['error'](_0x22856d);}return _0x666f0a[_0xf6ae('0x3c')]('.')[0x0];});};exports['ispeechASR']=function(_0x5d3516,_0x28a715,_0x524751,_0x109275){var _0x1b8daa=util[_0xf6ae('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x28a715,_0x524751,base64Encode(_0x5d3516),_0x109275?util[_0xf6ae('0x7c')](_0xf6ae('0x7e'),encodeURIComponent(_0x109275)):'freeform=3');return uploadFile(_0x1b8daa)[_0xf6ae('0x2a')](function(_0x1c27d5){return querystring[_0xf6ae('0x7f')](_0x1c27d5);});};exports['sestekNDA']=function(_0x179fce,_0x18582a){return sestek['nda'](_0x179fce,_0x18582a)[_0xf6ae('0x2a')](function(_0x2281bb){logger[_0xf6ae('0x1a')](JSON['stringify'](_0x2281bb));var _0x40920c={'speech':_0x2281bb[_0xf6ae('0x80')],'action':_0x2281bb[_0xf6ae('0x81')]?_0x2281bb[_0xf6ae('0x81')][_0xf6ae('0x82')]:undefined,'actiondata':_0x2281bb['channelData']?_0x2281bb['channelData']['CustomActionData']:undefined};if(_0x2281bb[_0xf6ae('0x81')]&&_0x2281bb[_0xf6ae('0x81')]['AudioFromTts']){return base64Decode(_0x2281bb['channelData'][_0xf6ae('0x83')][_0xf6ae('0x84')],path[_0xf6ae('0x26')](__dirname,_0xf6ae('0x27'),rs[_0xf6ae('0x36')](0x4)+'.wav'))[_0xf6ae('0x2a')](function(_0x5c1cf7){_0x40920c[_0xf6ae('0x85')]=_0x5c1cf7;return _0x40920c;});}return _0x40920c;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xccbe=['text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','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','model=%s','freeform=3','sestekNDA','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','host','get','data','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3'];(function(_0x409251,_0x40f525){var _0x216f47=function(_0x517895){while(--_0x517895){_0x409251['push'](_0x409251['shift']());}};_0x216f47(++_0x40f525);}(_0xccbe,0x1ec));var _0xeccb=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xccbe[_0x3fb030];return _0xd6899b;};'use strict';var apiai=require(_0xeccb('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xeccb('0x1'));var fs=require('fs');var http=require(_0xeccb('0x2'));var https=require(_0xeccb('0x3'));var md5=require(_0xeccb('0x4'));var path=require(_0xeccb('0x5'));var querystring=require(_0xeccb('0x6'));var rp=require(_0xeccb('0x7'));var rs=require(_0xeccb('0x8'));var sox=require(_0xeccb('0x9'));var tts=require('google-tts-api');var urlParse=require(_0xeccb('0xa'))[_0xeccb('0xb')];var util=require('util');var aws=require('./aws');var google=require(_0xeccb('0xc'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0xeccb('0xd'))(_0xeccb('0xe'));var ISPEECH_API=_0xeccb('0xf');function downloadFile(_0xc9ec4e,_0x3952df){return new BPromise(function(_0x3146fc,_0x64c26a){var _0x54ba82=urlParse(_0xc9ec4e);var _0x38790a=_0x54ba82[_0xeccb('0x10')]===_0xeccb('0x11')?https:http;var _0x2221f8={'host':_0x54ba82['host'],'path':_0x54ba82['path'],'headers':{'user-agent':_0xeccb('0x12')}};_0x38790a['get'](_0x2221f8,function(_0x4599e7){if(_0x4599e7[_0xeccb('0x13')]!==0xc8){logger[_0xeccb('0x14')](_0xeccb('0x15')+_0xc9ec4e+_0xeccb('0x16')+_0x4599e7[_0xeccb('0x13')]+'\x20('+_0x4599e7['statusMessage']+')');_0x64c26a(new Error(_0xeccb('0x15')+_0xc9ec4e+_0xeccb('0x16')+_0x4599e7[_0xeccb('0x13')]+'\x20('+_0x4599e7[_0xeccb('0x17')]+')'));return;}var _0x5cf936=fs[_0xeccb('0x18')](_0x3952df);_0x5cf936['on'](_0xeccb('0x19'),function(){logger[_0xeccb('0x1a')](_0xeccb('0x1b'));_0x5cf936[_0xeccb('0x1c')](_0x3146fc);});_0x5cf936['on'](_0xeccb('0x14'),function(_0x57aee3){fs[_0xeccb('0x1d')](_0x3952df);logger[_0xeccb('0x14')](_0xeccb('0x1e'),_0x57aee3);_0x64c26a(_0x57aee3);});_0x4599e7['pipe'](_0x5cf936);})['on'](_0xeccb('0x14'),function(_0x1fc90f){logger[_0xeccb('0x14')](_0x1fc90f);_0x64c26a(_0x1fc90f);})[_0xeccb('0x1f')]();});}function uploadFile(_0x3d6636){return new BPromise(function(_0x576167,_0x4dcd8c){var _0x321f40=urlParse(_0x3d6636);var _0x1f3881=_0x321f40[_0xeccb('0x10')]===_0xeccb('0x11')?https:http;var _0x3c0602={'host':_0x321f40[_0xeccb('0x20')],'path':_0x321f40[_0xeccb('0x5')],'headers':{'user-agent':_0xeccb('0x12')}};_0x1f3881[_0xeccb('0x21')](_0x3c0602,function(_0x28b5dc){if(_0x28b5dc[_0xeccb('0x13')]!==0xc8){_0x4dcd8c(new Error('request\x20to\x20'+_0x3d6636+'\x20failed,\x20status\x20code\x20=\x20'+_0x28b5dc[_0xeccb('0x13')]+'\x20('+_0x28b5dc[_0xeccb('0x17')]+')'));return;}var _0x204d27='';_0x28b5dc['on'](_0xeccb('0x22'),function(_0x3f4bd6){_0x204d27+=_0x3f4bd6;});_0x28b5dc['on'](_0xeccb('0x1f'),function(){_0x576167(_0x204d27);});})['on']('error',function(_0x4c5cfc){_0x4dcd8c(_0x4c5cfc);})['end']();});}function convertFile(_0x23fc93,_0x946ba9){return new BPromise(function(_0x40ac55,_0x3fb6c9){var _0x3c817a=sox[_0xeccb('0x23')](_0x23fc93,_0x946ba9,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c817a['on'](_0xeccb('0x14'),function(_0x5ae4e3){logger[_0xeccb('0x14')](_0xeccb('0x24'),_0x5ae4e3);_0x3fb6c9(_0x5ae4e3);});_0x3c817a['on'](_0xeccb('0x1f'),function(){logger[_0xeccb('0x1a')](_0xeccb('0x25'));_0x40ac55();});_0x3c817a['start']();});}function base64Decode(_0x5e0a57,_0xa6b1d5){var _0x3b85c2=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x29'));fs[_0xeccb('0x2a')](_0x3b85c2,_0x5e0a57,_0xeccb('0x2b'));return convertFile(_0x3b85c2,_0xa6b1d5)[_0xeccb('0x2c')](function(){try{fs['unlink'](_0x3b85c2);fs[_0xeccb('0x2d')](_0xa6b1d5,_0xeccb('0x2e'));}catch(_0x44129b){logger[_0xeccb('0x14')](_0x44129b);}return _0xa6b1d5[_0xeccb('0x2f')]('.')[0x0];});}function base64Encode(_0x33d5c5){var _0x1b48ad=fs[_0xeccb('0x30')](_0x33d5c5);return new Buffer(_0x1b48ad)['toString'](_0xeccb('0x2b'));}exports['googleCloudTTS']=function(_0x5b80cd,_0x2f8f75,_0x4b62bc,_0x2e3bd6,_0x457070,_0x2e7d8c){var _0x3e004d,_0x535b8d;var _0xd4201f=_0xeccb('0x31');var _0x951e24=_0xeccb('0x32')+_0x5b80cd;var _0x3ba9b4={};if(_0x2f8f75===_0xeccb('0x33')){_0x3ba9b4[_0xeccb('0x34')]={'ssml':_0x4b62bc};}else{_0x3ba9b4[_0xeccb('0x34')]={'text':_0x4b62bc};};_0x3ba9b4[_0xeccb('0x35')]={'languageCode':_0x2e3bd6,'ssmlGender':_0x457070};_0x3ba9b4[_0xeccb('0x36')]={'audioEncoding':_0xeccb('0x37'),'sampleRateHertz':0x1f40};var _0x12febf={'url':_0xd4201f+_0xeccb('0x38')+_0x951e24,'method':_0xeccb('0x39'),'json':!![],'body':_0x3ba9b4};return rp(_0x12febf)['then'](function(_0x154079){return new BPromise(function(_0x2f76ff,_0x20cfc7){_0x3e004d=path['resolve'](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x3a'));var _0x485b0c=Buffer[_0xeccb('0x3b')](_0x154079[_0xeccb('0x3c')],_0xeccb('0x2b'));return fs[_0xeccb('0x3d')](_0x3e004d,_0x485b0c,function(_0x38c166){_0x20cfc7(_0x38c166);},function(_0x3a2294){fs[_0xeccb('0x2d')](_0x3e004d,_0xeccb('0x2e'));_0x2f76ff(_0x3a2294);});});})[_0xeccb('0x2c')](function(_0x533d50){_0x535b8d=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x29'));return convertFile(_0x3e004d,_0x535b8d);})[_0xeccb('0x2c')](function(){try{fs['unlink'](_0x3e004d);fs[_0xeccb('0x2d')](_0x535b8d,_0xeccb('0x2e'));}catch(_0x211282){logger[_0xeccb('0x14')](_0x211282);}logger[_0xeccb('0x1a')](_0xeccb('0x3e'),_0x535b8d[_0xeccb('0x2f')]('.')[0x0]);return _0x535b8d[_0xeccb('0x2f')]('.')[0x0];});};exports[_0xeccb('0x3f')]=function(_0x2666c2,_0x205693){var _0x55dee1=_0xeccb('0x40');var _0x3f1584,_0x488f4c;var _0x3a6bd;var _0x5039ac={'encoding':_0xeccb('0x41'),'method':_0xeccb('0x39'),'timeout':0x2710,'url':_0x55dee1,'headers':{'Content-Type':_0xeccb('0x42')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0xeccb('0x43')]([_0x2666c2,_0x205693||'en',![],_0xeccb('0x44')]),null,'generic']]]))};return rp(_0x5039ac)['then'](function(_0x2b8a90){try{_0x3a6bd=eval(_0x2b8a90[_0xeccb('0x45')](0x5))[0x0][0x2];}catch(_0x2b3c09){throw new Error(_0xeccb('0x46')+_0x2b8a90[_0xeccb('0x22')]);}if(!_0x3a6bd){if(_0x2666c2[_0xeccb('0x47')]>0xc8){throw new Error(_0xeccb('0x48'));}else{throw new Error(_0xeccb('0x49')+_0x205693+_0xeccb('0x4a'));}}try{_0x3a6bd=eval(_0x3a6bd)[0x0];}catch(_0x507769){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x280ec5=_0x3a6bd;_0x3f1584=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x3a'));fs[_0xeccb('0x2a')](_0x3f1584,_0x3a6bd,{'encoding':'base64'});_0x488f4c=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x29'));return convertFile(_0x3f1584,_0x488f4c);})[_0xeccb('0x2c')](function(){try{fs[_0xeccb('0x1d')](_0x3f1584);fs['chmodSync'](_0x488f4c,_0xeccb('0x2e'));}catch(_0x3475dd){logger[_0xeccb('0x14')](_0x3475dd);}logger['info'](_0xeccb('0x4b'),_0x488f4c[_0xeccb('0x2f')]('.')[0x0]);return _0x488f4c['split']('.')[0x0];});};exports['googleASR']=function(_0xaaffe9,_0x52a588,_0x4bd833){return google[_0xeccb('0x4c')](_0xaaffe9,_0x52a588,_0x4bd833)[_0xeccb('0x2c')](function(_0x3017c6){logger[_0xeccb('0x1a')](_0x3017c6[_0xeccb('0x4d')]);return rp(_0x3017c6);})[_0xeccb('0x2c')](function(_0x289fdb){var _0x26afe1='';var _0x405c0d=0x0;try{fs['unlink'](_0xaaffe9);}catch(_0xd60dee){logger[_0xeccb('0x14')](_0xd60dee);}if(_0x289fdb&&_0x289fdb[_0xeccb('0x4e')]){_0x26afe1=_0x289fdb[_0xeccb('0x4e')][_0xeccb('0x4f')](function(_0x3a7a6f){return _0x3a7a6f&&_0x3a7a6f[_0xeccb('0x50')][0x0]&&_0x3a7a6f[_0xeccb('0x50')][0x0]['transcript']?_0x3a7a6f[_0xeccb('0x50')][0x0][_0xeccb('0x51')]:'';})[_0xeccb('0x52')]('\x0a');_0x405c0d=_0x289fdb['results'][_0xeccb('0x4f')](function(_0x409391){return _0x409391&&_0x409391['alternatives'][0x0]&&_0x409391['alternatives'][0x0][_0xeccb('0x53')]?_0x409391[_0xeccb('0x50')][0x0][_0xeccb('0x53')]:0x0;})[_0xeccb('0x52')]('\x0a');}logger[_0xeccb('0x1a')](_0xeccb('0x54'),_0x26afe1);logger['info']('googleASR\x20confidence',_0x405c0d);return{'transcript':_0x26afe1,'confidence':_0x405c0d};})[_0xeccb('0x55')](function(_0x368977){logger['error'](_0xeccb('0x56'),_0x368977[_0xeccb('0x13')],_0x368977[_0xeccb('0x57')],_0x368977['message']);});};exports[_0xeccb('0x58')]=function(_0x3f1a75,_0x4a8667,_0x185ff6,_0x2b6250){var _0x52034a=apiai(_0x4a8667,{'language':_0x2b6250||'en'});return _0x52034a[_0xeccb('0x59')](_0x185ff6,{'sessionId':md5(_0x3f1a75)})[_0xeccb('0x2c')](function(_0x1d2c46){logger['info'](JSON['stringify'](_0x1d2c46));return{'source':_0x1d2c46['result']['source'],'resolvedQuery':_0x1d2c46[_0xeccb('0x5a')][_0xeccb('0x5b')],'action':_0x1d2c46['result'][_0xeccb('0x5c')],'actionIncomplete':_0x1d2c46[_0xeccb('0x5a')][_0xeccb('0x5d')],'speech':_0x1d2c46[_0xeccb('0x5a')]['fulfillment']['speech'],'score':_0x1d2c46[_0xeccb('0x5a')][_0xeccb('0x5e')],'statusCode':_0x1d2c46[_0xeccb('0x5f')][_0xeccb('0x60')],'endConversation':_0x1d2c46[_0xeccb('0x5a')][_0xeccb('0x61')][_0xeccb('0x62')]||![],'isFallbackIntent':_0x1d2c46[_0xeccb('0x5a')][_0xeccb('0x61')][_0xeccb('0x63')]};});};exports[_0xeccb('0x64')]=function(_0x453843,_0x352f2b,_0x11d65a,_0x39de5c,_0x10498c,_0x59ac05){var _0x4ec737=_0x39de5c[_0xeccb('0x65')](/\\n/g,'\x0a');var _0x4258a4={'credentials':{'private_key':_0x4ec737,'client_email':_0x11d65a}};var _0x41262e=new dialogflow['SessionsClient'](_0x4258a4);var _0x519896=_0x41262e[_0xeccb('0x66')](_0x352f2b,md5(_0x453843));var _0x4d4364={'session':_0x519896,'queryInput':{'text':{'text':_0x10498c,'languageCode':_0x59ac05}}};return _0x41262e['detectIntent'](_0x4d4364)['then'](function(_0x49901e){if(_0x49901e&&_0x49901e[_0xeccb('0x47')]){logger[_0xeccb('0x1a')](_0xeccb('0x67'),JSON['stringify'](_0x49901e));var _0x227cf4=_0x49901e[0x0];if(_0x227cf4){var _0x56be9f={'action':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x5c')],'allRequiredParamsPresent':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x69')],'endConversation':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x6a')]&&_0x227cf4[_0xeccb('0x68')]['diagnosticInfo']['fields']?_0x227cf4[_0xeccb('0x68')]['diagnosticInfo'][_0xeccb('0x6b')][_0xeccb('0x6c')][_0xeccb('0x6d')]:![],'fulfillmentText':_0x227cf4['queryResult'][_0xeccb('0x6e')],'intentName':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x6f')][_0xeccb('0x57')],'intentDisplayName':_0x227cf4['queryResult']['intent']['displayName'],'isFallbackIntent':_0x227cf4['queryResult'][_0xeccb('0x6f')][_0xeccb('0x70')],'languageCode':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x71')],'queryText':_0x227cf4[_0xeccb('0x68')]['queryText'],'responseId':_0x227cf4[_0xeccb('0x72')],'score':_0x227cf4[_0xeccb('0x68')][_0xeccb('0x73')],'speech':_0x227cf4[_0xeccb('0x68')]['fulfillmentText'],'providerResponse':JSON[_0xeccb('0x43')](_0x49901e)};return _0x56be9f;}}});};exports[_0xeccb('0x74')]=function(_0xd13b94,_0x597311,_0x3b50de,_0x5b2b87){return tilde[_0xeccb('0x4c')](_0xd13b94,_0x597311,_0x3b50de,_0x5b2b87)[_0xeccb('0x2c')](function(_0x388b60){try{fs['unlink'](_0xd13b94);}catch(_0x532e39){logger[_0xeccb('0x14')](_0x532e39);}logger[_0xeccb('0x1a')](_0xeccb('0x75'),_0x388b60['transcript']);logger[_0xeccb('0x1a')](_0xeccb('0x76'),_0x388b60['confidence']);return _0x388b60;});};exports[_0xeccb('0x77')]=function(_0x14fe31,_0x378a97,_0x536b97,_0x166a91,_0x5a2681,_0x14dbda){var _0x13de37=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x3a'));var _0x123a0f;return aws[_0xeccb('0x78')](_0x14fe31,_0x378a97,_0x536b97,_0x166a91,_0x5a2681,_0x14dbda,_0x13de37)[_0xeccb('0x2c')](function(){_0x123a0f=path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs['generate'](0x4)+_0xeccb('0x29'));return convertFile(_0x13de37,_0x123a0f);})[_0xeccb('0x2c')](function(){try{fs[_0xeccb('0x1d')](_0x13de37);fs[_0xeccb('0x2d')](_0x123a0f,_0xeccb('0x2e'));}catch(_0x479ed4){logger[_0xeccb('0x14')](_0x479ed4);}return _0x123a0f['split']('.')[0x0];});};exports[_0xeccb('0x79')]=function(_0x17233e,_0x49cee1,_0x42201f,_0x527235,_0x2c7337,_0x590be8){return aws[_0xeccb('0x7a')](_0x17233e,_0x49cee1,_0x42201f,_0x527235,_0x2c7337,_0x590be8)[_0xeccb('0x2c')](function(_0x2471e8){logger[_0xeccb('0x1a')](JSON[_0xeccb('0x43')](_0x2471e8));return _0x2471e8;});};exports[_0xeccb('0x7b')]=function(_0x449457,_0x56d638,_0x48c86d,_0x289eae){var _0x47728a=util[_0xeccb('0x7c')](_0xeccb('0x7d'),ISPEECH_API,_0x449457,encodeURIComponent(_0x56d638),_0x48c86d,_0x289eae);var _0x411767=path[_0xeccb('0x26')](__dirname,'tmp',rs[_0xeccb('0x28')](0x4)+_0xeccb('0x3a'));var _0x2d90dc;return downloadFile(_0x47728a,_0x411767)[_0xeccb('0x2c')](function(){_0x2d90dc=path['resolve'](__dirname,'tmp',rs[_0xeccb('0x28')](0x4)+_0xeccb('0x29'));return convertFile(_0x411767,_0x2d90dc);})[_0xeccb('0x2c')](function(){try{fs[_0xeccb('0x1d')](_0x411767);fs[_0xeccb('0x2d')](_0x2d90dc,_0xeccb('0x2e'));}catch(_0x5bcd06){logger[_0xeccb('0x14')](_0x5bcd06);}return _0x2d90dc['split']('.')[0x0];});};exports['ispeechASR']=function(_0xe9b1f3,_0x3c7e1e,_0x4ab637,_0x249732){var _0x20f76e=util[_0xeccb('0x7c')](_0xeccb('0x7e'),ISPEECH_API,_0x3c7e1e,_0x4ab637,base64Encode(_0xe9b1f3),_0x249732?util[_0xeccb('0x7c')](_0xeccb('0x7f'),encodeURIComponent(_0x249732)):_0xeccb('0x80'));return uploadFile(_0x20f76e)[_0xeccb('0x2c')](function(_0x1965b2){return querystring[_0xeccb('0xb')](_0x1965b2);});};exports[_0xeccb('0x81')]=function(_0x2cd39f,_0x3c5207){return sestek['nda'](_0x2cd39f,_0x3c5207)[_0xeccb('0x2c')](function(_0xb8f8dd){logger[_0xeccb('0x1a')](JSON[_0xeccb('0x43')](_0xb8f8dd));var _0x26070f={'speech':_0xb8f8dd[_0xeccb('0x82')],'action':_0xb8f8dd[_0xeccb('0x83')]?_0xb8f8dd[_0xeccb('0x83')]['CustomAction']:undefined,'actiondata':_0xb8f8dd[_0xeccb('0x83')]?_0xb8f8dd['channelData'][_0xeccb('0x84')]:undefined};if(_0xb8f8dd['channelData']&&_0xb8f8dd[_0xeccb('0x83')][_0xeccb('0x85')]){return base64Decode(_0xb8f8dd[_0xeccb('0x83')][_0xeccb('0x85')][_0xeccb('0x86')],path[_0xeccb('0x26')](__dirname,_0xeccb('0x27'),rs[_0xeccb('0x28')](0x4)+_0xeccb('0x29')))[_0xeccb('0x2c')](function(_0x25cc57){_0x26070f[_0xeccb('0x87')]=_0x25cc57;return _0x26070f;});}return _0x26070f;});};exports[_0xeccb('0x88')]=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 00f2adc..627c731 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 _0xd40a=['exports','./nda'];(function(_0x1f16de,_0x548eb9){var _0x36cd80=function(_0x4e1a45){while(--_0x4e1a45){_0x1f16de['push'](_0x1f16de['shift']());}};_0x36cd80(++_0x548eb9);}(_0xd40a,0xbd));var _0xad40=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd40a[_0x20a584];return _0x4b41a8;};var nda=require(_0xad40('0x0'));module[_0xad40('0x1')]={'nda':nda}; \ No newline at end of file +var _0x1657=['exports','./nda'];(function(_0x219107,_0x3529bb){var _0x7e4ca0=function(_0x3f787e){while(--_0x3f787e){_0x219107['push'](_0x219107['shift']());}};_0x7e4ca0(++_0x3529bb);}(_0x1657,0x1d1));var _0x7165=function(_0xdf1f52,_0x246cf6){_0xdf1f52=_0xdf1f52-0x0;var _0x1d1e7f=_0x1657[_0xdf1f52];return _0x1d1e7f;};var nda=require(_0x7165('0x0'));module[_0x7165('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 cf8e49f..1cbe68d 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 _0x8a1b=['request-promise','url','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','text','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify'];(function(_0x2ab90a,_0x975baa){var _0x153e18=function(_0x368aa9){while(--_0x368aa9){_0x2ab90a['push'](_0x2ab90a['shift']());}};_0x153e18(++_0x975baa);}(_0x8a1b,0xf8));var _0xb8a1=function(_0xfc9575,_0x3f95ab){_0xfc9575=_0xfc9575-0x0;var _0x44d5f7=_0x8a1b[_0xfc9575];return _0x44d5f7;};'use strict';var rp=require(_0xb8a1('0x0'));var url=require(_0xb8a1('0x1'));var logger=require('../../../../../config/logger')(_0xb8a1('0x2'));module[_0xb8a1('0x3')]=function(_0x59f68f,_0x4aec5c){var _0x3784e8={'method':_0xb8a1('0x4'),'uri':url[_0xb8a1('0x5')](_0x4aec5c[_0xb8a1('0x6')],_0xb8a1('0x7')),'form':{'grant_type':'password','username':_0x4aec5c[_0xb8a1('0x8')],'password':_0x4aec5c[_0xb8a1('0x9')]},'json':!![]};return rp(_0x3784e8)[_0xb8a1('0xa')](function(_0x3f34e5){var _0x2370d3={'method':'POST','uri':url[_0xb8a1('0x5')](_0x4aec5c['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4aec5c[_0xb8a1('0xb')]||_0xb8a1('0xc'),'channelId':'Nda','conversation':{'id':_0x59f68f[_0xb8a1('0xd')]},'from':{'id':_0x59f68f['callerid'],'name':_0x59f68f[_0xb8a1('0xe')]},'recipient':{'id':_0x59f68f[_0xb8a1('0xf')],'name':_0x59f68f[_0xb8a1('0x10')]},'text':_0x4aec5c[_0xb8a1('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3f34e5[_0xb8a1('0x12')]},'json':!![]};if(_0x4aec5c[_0xb8a1('0x13')]){_0x2370d3[_0xb8a1('0x14')][_0xb8a1('0x15')]['ProjectName']=_0x4aec5c[_0xb8a1('0x13')];}if(_0x4aec5c[_0xb8a1('0x16')]=='1'){_0x2370d3[_0xb8a1('0x14')][_0xb8a1('0x15')][_0xb8a1('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb8a1('0x18')};}if(_0x4aec5c[_0xb8a1('0x19')]){_0x2370d3[_0xb8a1('0x14')][_0xb8a1('0x15')][_0xb8a1('0x1a')]=_0x4aec5c[_0xb8a1('0x19')];if(_0x4aec5c['custom_action_data']){_0x2370d3[_0xb8a1('0x14')][_0xb8a1('0x15')][_0xb8a1('0x1b')]=_0x4aec5c[_0xb8a1('0x1c')];}}logger[_0xb8a1('0x1d')](JSON[_0xb8a1('0x1e')](_0x2370d3));return rp(_0x2370d3);});}; \ No newline at end of file +var _0xcffe=['ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x3ba1bc,_0x236e7c){var _0x2d3e1e=function(_0x34312a){while(--_0x34312a){_0x3ba1bc['push'](_0x3ba1bc['shift']());}};_0x2d3e1e(++_0x236e7c);}(_0xcffe,0x1a1));var _0xecff=function(_0x8b1a5e,_0x2744eb){_0x8b1a5e=_0x8b1a5e-0x0;var _0x1146b1=_0xcffe[_0x8b1a5e];return _0x1146b1;};'use strict';var rp=require(_0xecff('0x0'));var url=require(_0xecff('0x1'));var logger=require(_0xecff('0x2'))(_0xecff('0x3'));module[_0xecff('0x4')]=function(_0x2b364d,_0xfe1d81){var _0x2045b6={'method':_0xecff('0x5'),'uri':url[_0xecff('0x6')](_0xfe1d81['ndauth_url'],'/token'),'form':{'grant_type':_0xecff('0x7'),'username':_0xfe1d81[_0xecff('0x8')],'password':_0xfe1d81[_0xecff('0x7')]},'json':!![]};return rp(_0x2045b6)[_0xecff('0x9')](function(_0x50c98b){var _0x298c19={'method':_0xecff('0x5'),'uri':url['resolve'](_0xfe1d81[_0xecff('0xa')],_0xecff('0xb')),'body':{'type':_0xfe1d81[_0xecff('0xc')]||_0xecff('0xd'),'channelId':_0xecff('0xe'),'conversation':{'id':_0x2b364d['uniqueid']},'from':{'id':_0x2b364d[_0xecff('0xf')],'name':_0x2b364d[_0xecff('0x10')]},'recipient':{'id':_0x2b364d[_0xecff('0x11')],'name':_0x2b364d[_0xecff('0x12')]},'text':_0xfe1d81[_0xecff('0x13')],'channelData':{}},'headers':{'Authorization':_0xecff('0x14')+_0x50c98b[_0xecff('0x15')]},'json':!![]};if(_0xfe1d81[_0xecff('0x16')]){_0x298c19[_0xecff('0x17')][_0xecff('0x18')][_0xecff('0x19')]=_0xfe1d81[_0xecff('0x16')];}if(_0xfe1d81[_0xecff('0x1a')]=='1'){_0x298c19[_0xecff('0x17')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xecff('0x1b')};}if(_0xfe1d81[_0xecff('0x1c')]){_0x298c19['body'][_0xecff('0x18')][_0xecff('0x1d')]=_0xfe1d81[_0xecff('0x1c')];if(_0xfe1d81['custom_action_data']){_0x298c19['body'][_0xecff('0x18')][_0xecff('0x1e')]=_0xfe1d81['custom_action_data'];}}logger[_0xecff('0x1f')](JSON[_0xecff('0x20')](_0x298c19));return rp(_0x298c19);});}; \ 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 aadd1d8..7a5a374 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 _0x5428=['exports','./lib/api'];(function(_0x415db4,_0x5e0b75){var _0x328a9d=function(_0x567118){while(--_0x567118){_0x415db4['push'](_0x415db4['shift']());}};_0x328a9d(++_0x5e0b75);}(_0x5428,0x187));var _0x8542=function(_0x2ff9bd,_0x58e2af){_0x2ff9bd=_0x2ff9bd-0x0;var _0x152e2c=_0x5428[_0x2ff9bd];return _0x152e2c;};'use strict';var asr=require(_0x8542('0x0'));module[_0x8542('0x1')]=function(_0x21b700,_0x835770,_0x305add,_0x399fe2){return asr(_0x21b700,_0x835770,_0x305add,_0x399fe2);}; \ No newline at end of file +var _0x0744=['./lib/api'];(function(_0x326353,_0x47e45d){var _0x34c2e1=function(_0x5756b5){while(--_0x5756b5){_0x326353['push'](_0x326353['shift']());}};_0x34c2e1(++_0x47e45d);}(_0x0744,0xde));var _0x4074=function(_0x4e8db9,_0x15ff81){_0x4e8db9=_0x4e8db9-0x0;var _0x1fc3be=_0x0744[_0x4e8db9];return _0x1fc3be;};'use strict';var asr=require(_0x4074('0x0'));module['exports']=function(_0x5491cd,_0x4aeca7,_0x3261d8,_0x3928b9){return asr(_0x5491cd,_0x4aeca7,_0x3261d8,_0x3928b9);}; \ 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 4d435f8..1ccd397 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 _0x0656=['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','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','info','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','close','bluebird','lodash','moment','../../../../../../config/logger','agi'];(function(_0x47874b,_0x932bcd){var _0x14d9b8=function(_0x5127c7){while(--_0x5127c7){_0x47874b['push'](_0x47874b['shift']());}};_0x14d9b8(++_0x932bcd);}(_0x0656,0x17c));var _0x6065=function(_0x4ffd17,_0x5f0c85){_0x4ffd17=_0x4ffd17-0x0;var _0x1a82e6=_0x0656[_0x4ffd17];return _0x1a82e6;};'use strict';var BPromise=require(_0x6065('0x0'));var _=require(_0x6065('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6065('0x2'));var crypto=require('crypto');var logger=require(_0x6065('0x3'))(_0x6065('0x4'));module[_0x6065('0x5')]=function(_0x8e0c4b,_0x5e6c4c,_0x3104b0,_0x50211c){return new BPromise(function(_0x36a61a,_0x5da79a){logger['info'](_0x6065('0x6'),_0x50211c||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x32c55b=new WebSocket(_0x50211c||_0x6065('0x7'),{'perMessageDeflate':![]});var _0x433753='';var _0x357253='0';var _0x269532='1';var _0x5e025f=_0x6065('0x8');function _0x521c9f(_0x3c12be){var _0x392f2a=crypto[_0x6065('0x9')](_0x6065('0xa'));_0x392f2a[_0x6065('0xb')](_0x3c12be);return _0x392f2a[_0x6065('0xc')]('hex');}function _0x2673c9(){try{logger['info'](_0x6065('0xd'));var _0x4c0647=moment()['unix']();var _0x4610b0=_0x521c9f(_0x4c0647+_0x5e6c4c+_0x3104b0);_0x32c55b[_0x6065('0xe')](JSON[_0x6065('0xf')]({'appID':_0x5e6c4c,'timestamp':_0x4c0647,'appKey':_0x4610b0}));var _0x1beb08=fs['createReadStream'](_0x8e0c4b);_0x1beb08['on'](_0x6065('0x10'),function(_0x4bf351){_0x32c55b['send'](_0x4bf351);});_0x1beb08['on']('close',function(){_0x32c55b[_0x6065('0xe')](_0x6065('0x11'));});}catch(_0x2d5621){logger[_0x6065('0x12')](_0x6065('0x13'),JSON[_0x6065('0xf')](_0x2d5621));_0x32c55b[_0x6065('0x14')]();}}function _0x3b7e85(_0x1d8449){try{if(_0x1d8449){var _0x21a071=JSON['parse'](_0x1d8449);switch(_0x21a071['status']){case 0x0:if(_0x21a071[_0x6065('0x15')]){if(_0x21a071[_0x6065('0x15')]['final']){logger[_0x6065('0x16')]('Tilde\x20ASR\x20hypoteses',JSON[_0x6065('0xf')](_0x21a071[_0x6065('0x15')][_0x6065('0x17')]));_0x433753=_0x21a071[_0x6065('0x15')][_0x6065('0x17')][0x0][_0x6065('0x18')];_0x357253=_0x21a071[_0x6065('0x15')][_0x6065('0x17')][0x0][_0x6065('0x19')];_0x269532='0';_0x5e025f='Success.';_0x32c55b[_0x6065('0x14')]();}}break;case 0x1:logger[_0x6065('0x16')](_0x6065('0x8'));_0x269532='1';_0x5e025f=_0x6065('0x8');break;case 0x2:logger[_0x6065('0x16')](_0x6065('0x1a'));_0x269532='2';_0x5e025f=_0x6065('0x1a');break;case 0x9:logger['info'](_0x6065('0x1b'));_0x269532='9';_0x5e025f='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x6065('0x16')](_0x6065('0x1c'));_0x269532='10';_0x5e025f=_0x6065('0x1c');break;case 0xb:logger[_0x6065('0x16')](_0x6065('0x1d'));_0x269532='11';_0x5e025f=_0x6065('0x1d');}}}catch(_0x4c6c82){logger[_0x6065('0x12')](_0x6065('0x1e'),JSON[_0x6065('0xf')](_0x4c6c82));_0x32c55b[_0x6065('0x14')]();}}function _0x2003f1(){logger['info'](_0x6065('0x1f'));_0x36a61a({'transcript':_0x433753,'confidence':_0x357253,'status':_0x269532,'status_message':_0x5e025f});}function _0xef982a(_0x3b77dd){logger['error'](_0x6065('0x20'));if(!_[_0x6065('0x21')](_0x3b77dd)){logger[_0x6065('0x12')](_['isObject'](_0x3b77dd)?JSON[_0x6065('0xf')](_0x3b77dd):_0x3b77dd);}}_0x32c55b['on']('open',_0x2673c9);_0x32c55b['on']('message',_0x3b7e85);_0x32c55b['on'](_0x6065('0x22'),_0x2003f1);_0x32c55b['on'](_0x6065('0x12'),_0xef982a);});}; \ No newline at end of file +var _0x2ad5=['error','isNil','bluebird','lodash','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.'];(function(_0x6499bf,_0x2ac28b){var _0x3a6007=function(_0x57e797){while(--_0x57e797){_0x6499bf['push'](_0x6499bf['shift']());}};_0x3a6007(++_0x2ac28b);}(_0x2ad5,0x16a));var _0x52ad=function(_0x253777,_0x41c2a2){_0x253777=_0x253777-0x0;var _0x2bc89b=_0x2ad5[_0x253777];return _0x2bc89b;};'use strict';var BPromise=require(_0x52ad('0x0'));var _=require(_0x52ad('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x52ad('0x2'));var crypto=require(_0x52ad('0x3'));var logger=require('../../../../../../config/logger')(_0x52ad('0x4'));module[_0x52ad('0x5')]=function(_0x5779ca,_0x2cfe96,_0x2c685c,_0x229d9b){return new BPromise(function(_0x21a88e,_0x45af95){logger[_0x52ad('0x6')]('Tilde\x20URI',_0x229d9b||_0x52ad('0x7'));var _0x59e91f=new WebSocket(_0x229d9b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x5b755f='';var _0x361292='0';var _0x547a37='1';var _0x537bae='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x145e1f(_0x10b960){var _0x1052e3=crypto[_0x52ad('0x8')](_0x52ad('0x9'));_0x1052e3[_0x52ad('0xa')](_0x10b960);return _0x1052e3[_0x52ad('0xb')](_0x52ad('0xc'));}function _0x374606(){try{logger[_0x52ad('0x6')](_0x52ad('0xd'));var _0x3c9597=moment()['unix']();var _0x23340a=_0x145e1f(_0x3c9597+_0x2cfe96+_0x2c685c);_0x59e91f[_0x52ad('0xe')](JSON[_0x52ad('0xf')]({'appID':_0x2cfe96,'timestamp':_0x3c9597,'appKey':_0x23340a}));var _0x2cc26a=fs[_0x52ad('0x10')](_0x5779ca);_0x2cc26a['on']('data',function(_0x137cd8){_0x59e91f['send'](_0x137cd8);});_0x2cc26a['on'](_0x52ad('0x11'),function(){_0x59e91f[_0x52ad('0xe')](_0x52ad('0x12'));});}catch(_0x8f3ade){logger['error'](_0x52ad('0x13'),JSON[_0x52ad('0xf')](_0x8f3ade));_0x59e91f[_0x52ad('0x14')]();}}function _0x34fba9(_0x3a191e){try{if(_0x3a191e){var _0x239587=JSON['parse'](_0x3a191e);switch(_0x239587[_0x52ad('0x15')]){case 0x0:if(_0x239587[_0x52ad('0x16')]){if(_0x239587[_0x52ad('0x16')][_0x52ad('0x17')]){logger[_0x52ad('0x6')](_0x52ad('0x18'),JSON[_0x52ad('0xf')](_0x239587[_0x52ad('0x16')][_0x52ad('0x19')]));_0x5b755f=_0x239587[_0x52ad('0x16')][_0x52ad('0x19')][0x0][_0x52ad('0x1a')];_0x361292=_0x239587[_0x52ad('0x16')][_0x52ad('0x19')][0x0][_0x52ad('0x1b')];_0x547a37='0';_0x537bae=_0x52ad('0x1c');_0x59e91f[_0x52ad('0x14')]();}}break;case 0x1:logger[_0x52ad('0x6')](_0x52ad('0x1d'));_0x547a37='1';_0x537bae=_0x52ad('0x1d');break;case 0x2:logger[_0x52ad('0x6')](_0x52ad('0x1e'));_0x547a37='2';_0x537bae=_0x52ad('0x1e');break;case 0x9:logger[_0x52ad('0x6')](_0x52ad('0x1f'));_0x547a37='9';_0x537bae=_0x52ad('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0x547a37='10';_0x537bae=_0x52ad('0x20');break;case 0xb:logger[_0x52ad('0x6')](_0x52ad('0x21'));_0x547a37='11';_0x537bae=_0x52ad('0x21');}}}catch(_0x5dcc4e){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x5dcc4e));_0x59e91f['terminate']();}}function _0x2b7d92(){logger[_0x52ad('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x21a88e({'transcript':_0x5b755f,'confidence':_0x361292,'status':_0x547a37,'status_message':_0x537bae});}function _0x42c23f(_0x2a2e42){logger[_0x52ad('0x22')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x52ad('0x23')](_0x2a2e42)){logger[_0x52ad('0x22')](_['isObject'](_0x2a2e42)?JSON[_0x52ad('0xf')](_0x2a2e42):_0x2a2e42);}}_0x59e91f['on']('open',_0x374606);_0x59e91f['on']('message',_0x34fba9);_0x59e91f['on'](_0x52ad('0x11'),_0x2b7d92);_0x59e91f['on'](_0x52ad('0x22'),_0x42c23f);});}; \ 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 d9bf64d..5c9b2de 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 _0x7e7a=['exports'];(function(_0xf65da5,_0x8e3312){var _0x446149=function(_0x3e550d){while(--_0x3e550d){_0xf65da5['push'](_0xf65da5['shift']());}};_0x446149(++_0x8e3312);}(_0x7e7a,0x104));var _0xa7e7=function(_0x45fc4b,_0x5b98ff){_0x45fc4b=_0x45fc4b-0x0;var _0x431312=_0x7e7a[_0x45fc4b];return _0x431312;};var asr=require('./asr');module[_0xa7e7('0x0')]={'asr':asr}; \ No newline at end of file +var _0x7c11=['./asr','exports'];(function(_0x65f9a9,_0x476219){var _0x3afb57=function(_0x50cf82){while(--_0x50cf82){_0x65f9a9['push'](_0x65f9a9['shift']());}};_0x3afb57(++_0x476219);}(_0x7c11,0x1d0));var _0x17c1=function(_0x24f466,_0x52b82b){_0x24f466=_0x24f466-0x0;var _0xdb7559=_0x7c11[_0x24f466];return _0xdb7559;};var asr=require(_0x17c1('0x0'));module[_0x17c1('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 9f5233f..a6fdae2 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x1afb93,_0x44c814){var _0x4f7706=function(_0x40d001){while(--_0x40d001){_0x1afb93['push'](_0x1afb93['shift']());}};_0x4f7706(++_0x44c814);}(_0x34e8,0x12c));var _0x834e=function(_0x5516cd,_0x4edf56){_0x5516cd=_0x5516cd-0x0;var _0x1e73ba=_0x34e8[_0x5516cd];return _0x1e73ba;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index a96d75b..cfa7d27 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 _0x68b7=['no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','recordFile','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','QUEUE','macro','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','random','lastName','isNil','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','stringify','body','render','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','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','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x68b7,0x8c));var _0x768b=function(_0x61fc04,_0x1c734a){_0x61fc04=_0x61fc04-0x0;var _0x42201d=_0x68b7[_0x61fc04];return _0x42201d;};'use strict';var fs=require('fs');var util=require(_0x768b('0x0'));var _=require('lodash');var sh=require(_0x768b('0x1'));var odbc=require(_0x768b('0x2'))();var rs=require(_0x768b('0x3'));var moment=require('moment');var Mustache=require(_0x768b('0x4'));var rp=require(_0x768b('0x5'));var logger=require(_0x768b('0x6'))('agi');var config=require(_0x768b('0x7'));var shared=require(_0x768b('0x8'));var scripts=require(_0x768b('0x9'));var FILES_PATH=_0x768b('0xa');var recursiveMapAttributes=[_0x768b('0xb'),_0x768b('0xc')];var verticesWithRetry=[_0x768b('0xd'),'getdigits',_0x768b('0xe')];var AGIVertices=function(_0x47c2ea,_0x30fccf,_0x192508){this[_0x768b('0xf')]=_0x47c2ea;this[_0x768b('0x10')]=_0x30fccf;this[_0x768b('0x11')]=_0x192508;};AGIVertices[_0x768b('0x12')]['getVariable']=function(_0x3ab8a9,_0x305df8){this['rpc']['getVariableById'](_0x3ab8a9)[_0x768b('0x13')](function(_0x1e26bd){_0x305df8(null,_0x1e26bd?_0x1e26bd[_0x768b('0x14')]:![]);})[_0x768b('0x15')](function(_0x8fa3e6){_0x305df8(_0x8fa3e6);});};AGIVertices[_0x768b('0x12')][_0x768b('0x16')]=function(_0x2ec66c,_0x37a8b5){this['rpc'][_0x768b('0x17')](_0x2ec66c)[_0x768b('0x13')](function(_0x37106d){_0x37a8b5(null,_0x37106d?_0x37106d[_0x768b('0x14')]:![]);})[_0x768b('0x15')](function(_0x50306b){_0x37a8b5(_0x50306b);});};AGIVertices[_0x768b('0x12')][_0x768b('0x18')]=function(_0x25819e,_0x2a8a6e){this[_0x768b('0x10')][_0x768b('0x19')](_0x25819e)[_0x768b('0x13')](function(_0x20312a){_0x2a8a6e(null,_0x20312a?_0x20312a[_0x768b('0x14')]:![]);})[_0x768b('0x15')](function(_0x92160e){_0x2a8a6e(_0x92160e);});};AGIVertices[_0x768b('0x12')]['getSquareOdbc']=function(_0x507bdc,_0x2ce978){this[_0x768b('0x10')]['getSquareOdbcById'](_0x507bdc)[_0x768b('0x13')](function(_0x931aa0){_0x2ce978(null,_0x931aa0?_0x931aa0['dsn']:![]);})[_0x768b('0x15')](function(_0x10c81c){_0x2ce978(_0x10c81c);});};AGIVertices[_0x768b('0x12')][_0x768b('0x1a')]=function(_0xaa1538,_0x4d63a2){this['rpc'][_0x768b('0x1b')](_0xaa1538)[_0x768b('0x13')](function(_0xdc2648){_0x4d63a2(null,_0xdc2648?_0xdc2648[_0x768b('0x14')]:![]);})[_0x768b('0x15')](function(_0x1186ab){_0x4d63a2(_0x1186ab);});};AGIVertices[_0x768b('0x12')][_0x768b('0x1c')]=function(_0x1a1733,_0x2c0048){this[_0x768b('0x10')][_0x768b('0x1d')](_0x1a1733)[_0x768b('0x13')](function(_0x31e087){_0x2c0048(null,_0x31e087?_0x31e087['name']:![]);})[_0x768b('0x15')](function(_0x533665){_0x2c0048(_0x533665);});};AGIVertices['prototype']['getSound']=function(_0x4ce2d4,_0x3d8705){var _0x371eda=this;this['rpc'][_0x768b('0x1e')](_0x4ce2d4)['then'](function(_0x19c0ed){_0x3d8705(null,_0x19c0ed?_0x371eda['getSoundPath'](_0x19c0ed[_0x768b('0x1f')]):![]);})[_0x768b('0x15')](function(_0x194812){_0x3d8705(_0x194812);});};AGIVertices[_0x768b('0x12')]['getMailAccount']=function(_0x49270c,_0x501ec6){this[_0x768b('0x10')][_0x768b('0x20')](_0x49270c)[_0x768b('0x13')](function(_0x3f7aa5){_0x501ec6(null,_0x3f7aa5?_0x3f7aa5:![]);})['catch'](function(_0x42aeb2){_0x501ec6(_0x42aeb2);});};AGIVertices[_0x768b('0x12')]['sendMailMessage']=function(_0x4d7b94,_0xe278d3,_0x3702a2){this['mailRpc'][_0x768b('0x21')](_0x4d7b94,_0xe278d3)[_0x768b('0x13')](function(){_0x3702a2(null);})[_0x768b('0x15')](function(_0x2fe13b){_0x3702a2(_0x2fe13b);});};AGIVertices[_0x768b('0x12')][_0x768b('0x22')]=function(_0x5402e8,_0x61f53f){this[_0x768b('0x10')][_0x768b('0x23')](_0x5402e8)['then'](function(_0x139445){if(_0x139445){if(_0x139445[_0x768b('0x24')]){_0x61f53f(null,[_0x139445[_0x768b('0x25')]]);}else{_0x61f53f(null,_['map'](_0x139445['Intervals'],_0x768b('0x25')));}}else{_0x61f53f(null,![]);}})[_0x768b('0x15')](function(_0x226013){_0x61f53f(_0x226013);});};AGIVertices[_0x768b('0x12')][_0x768b('0x26')]=function(_0x51a49f){return util[_0x768b('0x27')](_0x768b('0x28'),FILES_PATH,_0x51a49f);};AGIVertices[_0x768b('0x12')][_0x768b('0x29')]=function(_0x2ffdcd,_0x3b2089,_0x2886ff){odbc[_0x768b('0x2a')](_0x2ffdcd,function(_0x1edba0){if(_0x1edba0){logger['error'](_0x768b('0x2b'),_0x1edba0);_0x2886ff(_0x1edba0);}else{logger[_0x768b('0x2c')](_0x768b('0x2d'));odbc[_0x768b('0x2e')](_0x3b2089,function(_0x5b3fd3,_0x5405e1){if(_0x5b3fd3){logger[_0x768b('0x2c')](_0x768b('0x2f'),_0x3b2089);_0x2886ff(_0x5b3fd3);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x3b2089);odbc['close'](function(_0x5145c8){if(_0x5145c8){logger[_0x768b('0x30')](_0x768b('0x31'),_0x5145c8);}_0x2886ff(null,_0x5405e1);});}});}});};AGIVertices[_0x768b('0x12')][_0x768b('0x32')]=function(_0x307906,_0x5c4ae9){this[_0x768b('0x10')]['getSmsAccountById'](_0x307906)['then'](function(_0x296deb){_0x5c4ae9(null,_0x296deb?_0x296deb:![]);})[_0x768b('0x15')](function(_0x4111f6){_0x5c4ae9(_0x4111f6);});};AGIVertices[_0x768b('0x12')][_0x768b('0x33')]=function(_0x10af8a,_0x1f5735){this[_0x768b('0x10')]['createSmsMessage'](_0x10af8a)[_0x768b('0x13')](function(_0x3519da){_0x1f5735(null,_0x3519da);})[_0x768b('0x15')](function(_0x22cfe8){_0x1f5735(_0x22cfe8);});};AGIVertices[_0x768b('0x12')]['createSquareDetailsReport']=function(_0x5c9f57,_0x596c61,_0x3af938){this[_0x768b('0x10')][_0x768b('0x34')]({'uniqueid':this[_0x768b('0xf')][_0x768b('0x35')],'node':_0x5c9f57[_0x768b('0x36')],'application':_0x5c9f57[_0x768b('0x37')],'data':_0x596c61||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x768b('0xf')][_0x768b('0x38')]})[_0x768b('0x13')](function(_0x35627f){if(_0x3af938){_0x3af938(null,_0x35627f);}})[_0x768b('0x15')](function(_0x34405e){if(_0x3af938){_0x3af938(_0x34405e);}});};AGIVertices[_0x768b('0x12')]['createSquareRecording']=function(_0x13ca4c,_0x14705f,_0x319790,_0x259518){this[_0x768b('0x10')][_0x768b('0x39')]({'uniqueid':this[_0x768b('0xf')][_0x768b('0x35')],'callerid':this[_0x768b('0xf')][_0x768b('0x38')],'calleridname':this[_0x768b('0xf')][_0x768b('0x3a')],'context':this['channel'][_0x768b('0x3b')],'extension':this[_0x768b('0xf')][_0x768b('0x3c')],'priority':this[_0x768b('0xf')][_0x768b('0x3d')],'accountcode':this[_0x768b('0xf')][_0x768b('0x3e')],'dnid':this[_0x768b('0xf')][_0x768b('0x3f')],'projectName':this[_0x768b('0xf')][_0x768b('0x40')],'saveName':_0x14705f,'filename':_0x13ca4c[_0x768b('0x41')]||_0x14705f,'savePath':_0x319790})[_0x768b('0x13')](function(_0x1e45cf){_0x259518(null,_0x1e45cf);})[_0x768b('0x15')](function(_0x3c9eee){_0x259518(_0x3c9eee);});};AGIVertices['prototype'][_0x768b('0x42')]=function(_0x218e6b,_0xf1423b,_0x40c976,_0x3684e4,_0x21e5dd){this[_0x768b('0x10')]['createSquareMessage']({'uniqueid':this[_0x768b('0xf')]['uniqueid'],'body':_0x218e6b,'direction':_0xf1423b,'providerName':_0x40c976,'providerResponse':_0x3684e4})[_0x768b('0x13')](function(_0x1cd491){if(_0x21e5dd){_0x21e5dd(null,_0x1cd491);}})['catch'](function(_0x7e4aea){if(_0x21e5dd){_0x21e5dd(_0x7e4aea);}});};AGIVertices[_0x768b('0x12')][_0x768b('0x43')]=function(_0x578025,_0x3048f6){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x578025[_0x768b('0x14')])||_['isNil'](_0x578025[_0x768b('0x14')])?'callback_'+Math[_0x768b('0x44')]():_0x578025[_0x768b('0x14')],'lastName':_['isEmpty'](_0x578025[_0x768b('0x45')])||_[_0x768b('0x46')](_0x578025[_0x768b('0x45')])?null:_0x578025['lastName'],'phone':_0x578025[_0x768b('0x47')],'ListId':_0x578025[_0x768b('0x48')],'scheduledat':_0x578025[_0x768b('0x49')],'callbackUniqueid':this[_0x768b('0xf')][_0x768b('0x35')],'tags':_0x768b('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x578025[_0x768b('0x49')][_0x768b('0x4b')](),'priority':_0x578025[_0x768b('0x4c')]})[_0x768b('0x13')](function(_0x247209){_0x3048f6(null,_0x247209);})['catch'](function(_0x2cb0b1){_0x3048f6(_0x2cb0b1);});};AGIVertices[_0x768b('0x12')][_0x768b('0x4d')]=function(_0x24d825,_0x3ff8ea){this['rpc'][_0x768b('0x4e')](_0x24d825)[_0x768b('0x13')](function(_0x33f88f){_0x3ff8ea(null,_0x33f88f?_0x33f88f[_0x768b('0x14')]:![]);})[_0x768b('0x15')](function(_0x2fe5f8){_0x3ff8ea(_0x2fe5f8);});};AGIVertices[_0x768b('0x12')]['agentPause']=function(_0x4fe59a,_0x4767d0,_0x57670a){var _0x3a8cf6={'role':_0x768b('0x4f')};_0x3a8cf6[_0x4fe59a]=this[_0x768b('0xf')][_0x768b('0x38')];this[_0x768b('0x10')][_0x768b('0x50')](_0x3a8cf6,_0x4767d0,this[_0x768b('0xf')][_0x768b('0x35')])[_0x768b('0x13')](function(_0x1869ef){_0x57670a(null,_[_0x768b('0x46')](_0x1869ef)?![]:!![]);})[_0x768b('0x15')](function(_0x41af38){logger[_0x768b('0x30')](_0x41af38);_0x57670a(null,![]);});};AGIVertices[_0x768b('0x12')][_0x768b('0x51')]=function(_0x22dadc,_0xa453a7){var _0x22755d={'role':'agent'};_0x22755d[_0x22dadc]=this['channel'][_0x768b('0x38')];this[_0x768b('0x10')]['agentUnpause'](_0x22755d)['then'](function(_0x336d44){_0xa453a7(null,_[_0x768b('0x46')](_0x336d44)?![]:!![]);})['catch'](function(_0x3ee500){logger[_0x768b('0x30')](_0x3ee500);_0xa453a7(null,![]);});};AGIVertices[_0x768b('0x12')][_0x768b('0x52')]=function(_0x1bf8df,_0x48828a){var _0x9cc133={'role':'agent'};_0x9cc133[_0x1bf8df]=this[_0x768b('0xf')][_0x768b('0x38')];this[_0x768b('0x10')][_0x768b('0x52')](_0x9cc133)[_0x768b('0x13')](function(_0x32f1b1){_0x48828a(null,_[_0x768b('0x46')](_0x32f1b1)?![]:!![]);})[_0x768b('0x15')](function(_0x239bac){logger[_0x768b('0x30')](_0x239bac);_0x48828a(null,![]);});};AGIVertices[_0x768b('0x12')][_0x768b('0x53')]=function(_0x2da6de,_0x19173c){var _0x36c0fe={'role':_0x768b('0x4f')};_0x36c0fe[_0x2da6de]=this[_0x768b('0xf')]['callerid'];var _0x46343e=_0x2da6de!=_0x768b('0x54')?util[_0x768b('0x27')](_0x768b('0x55'),_0x768b('0x56'),this[_0x768b('0xf')][_0x768b('0x38')]):undefined;this[_0x768b('0x10')][_0x768b('0x53')](_0x36c0fe,_0x46343e)[_0x768b('0x13')](function(_0x4c2e9b){_0x19173c(null,_[_0x768b('0x46')](_0x4c2e9b)?![]:!![]);})[_0x768b('0x15')](function(_0x1f6199){logger[_0x768b('0x30')](_0x1f6199);_0x19173c(null,![]);});};AGIVertices['prototype'][_0x768b('0x57')]=function(_0x3d2258,_0x2c2eeb){sh[_0x768b('0x58')](_['trim'](_0x3d2258),function(_0x4145c9,_0x33f247){var _0x154b39=_0x33f247[_0x768b('0x59')](/(\r\n|\n|\r)/gm,'');_0x2c2eeb(null,_0x154b39);});};AGIVertices[_0x768b('0x12')][_0x768b('0x5a')]=function(_0x5c89a1,_0x23b7e3){scripts[_0x768b('0x5a')](_0x5c89a1[_0x768b('0x5b')],_0x5c89a1['google_cloud_tts_text_type']||_0x768b('0x5c'),_0x5c89a1[_0x768b('0x5c')],_0x5c89a1[_0x768b('0x5d')]||_0x768b('0x5e'),_0x5c89a1[_0x768b('0x5f')]||_0x768b('0x60'),_0x5c89a1['audioEncoding']||_0x768b('0x61'))[_0x768b('0x13')](function(_0xf947d7){_0x23b7e3(null,_0xf947d7);})[_0x768b('0x15')](function(_0x437406){_0x23b7e3(_0x437406);});};AGIVertices[_0x768b('0x12')][_0x768b('0x62')]=function(_0x1c9646,_0x9be5f0){scripts['googleTTS'](_0x1c9646[_0x768b('0x5c')],_0x1c9646[_0x768b('0x63')]||'en',0x1)[_0x768b('0x13')](function(_0x55c7be){_0x9be5f0(null,_0x55c7be);})[_0x768b('0x15')](function(_0x99ab58){_0x9be5f0(_0x99ab58);});};AGIVertices['prototype'][_0x768b('0x64')]=function(_0x3d1eea,_0x2c5eaf){var _0x1faa08={'uri':_0x3d1eea[_0x768b('0x65')],'method':_0x3d1eea[_0x768b('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3d1eea[_0x768b('0x67')])===_0x768b('0x68')&&parseInt(_0x3d1eea['timeout'])>=0x1?parseInt(_0x3d1eea[_0x768b('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x768b('0x69')](['POST','PUT'],_0x1faa08[_0x768b('0x66')][_0x768b('0x6a')]())){try{_0x1faa08['body']=_0x3d1eea[_0x768b('0xc')]?JSON[_0x768b('0x6b')](_0x3d1eea['rawBody']):{};}catch(_0x3fcc84){logger[_0x768b('0x30')](_0x768b('0x6c'),_0x3fcc84);}}try{_0x1faa08[_0x768b('0x6d')]=_0x3d1eea[_0x768b('0xb')]?JSON[_0x768b('0x6b')](_0x3d1eea[_0x768b('0xb')]):{};}catch(_0x1abf62){logger['error'](_0x768b('0x6e'),_0x1abf62);}if(_0x3d1eea[_0x768b('0x6f')]){try{var _0xd248e8=require(_0x3d1eea[_0x768b('0x6f')])[_0x768b('0x70')](this,_0x1faa08);_0x1faa08[_0x768b('0x71')]=Mustache['render'](_0x3d1eea[_0x768b('0x65')],_0xd248e8,{},['$$','$$']);if(_0x1faa08[_0x768b('0x6d')]){_0x1faa08[_0x768b('0x6d')]=JSON[_0x768b('0x6b')](Mustache['render'](JSON[_0x768b('0x72')](_0x1faa08[_0x768b('0x6d')]),_0xd248e8,{},['$$','$$']));}if(_0x1faa08[_0x768b('0x73')]){_0x1faa08[_0x768b('0x73')]=JSON['parse'](Mustache[_0x768b('0x74')](JSON[_0x768b('0x72')](_0x1faa08[_0x768b('0x73')]),_0xd248e8,{},['$$','$$']));}}catch(_0x412310){logger[_0x768b('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x412310);}}rp(_0x1faa08)['then'](function(_0x4a5578){var _0x1711a6={'statusCode':_0x4a5578[_0x768b('0x75')]||0xc8,'statusMessage':_0x4a5578[_0x768b('0x76')]||'OK','headers':_0x4a5578[_0x768b('0x6d')]||{},'body':_0x4a5578['body']||{}};_0x2c5eaf(null,_0x1711a6);})[_0x768b('0x15')](function(_0x2503ec){var _0x1bfa5d={'statusCode':_0x2503ec['statusCode']||0x1f4,'statusMessage':_0x2503ec[_0x768b('0x77')]||_0x768b('0x78'),'headers':_0x2503ec[_0x768b('0x79')][_0x768b('0x6d')]||{},'body':_0x2503ec[_0x768b('0x79')][_0x768b('0x73')]||{}};_0x2c5eaf(null,_0x1bfa5d);});};AGIVertices[_0x768b('0x12')][_0x768b('0x7a')]=function(_0x3d9ee2,_0x46e231){scripts['googleDialogflow'](this[_0x768b('0xf')][_0x768b('0x35')],_0x3d9ee2[_0x768b('0x7b')],_0x3d9ee2['text'],_0x3d9ee2[_0x768b('0x7c')]||'en')[_0x768b('0x13')](function(_0x508d8d){_0x46e231(null,_0x508d8d);})[_0x768b('0x15')](function(_0x43b7ca){_0x46e231(_0x43b7ca);});};AGIVertices[_0x768b('0x12')][_0x768b('0x7d')]=function(_0x306171,_0x53665e){scripts[_0x768b('0x7d')](this[_0x768b('0xf')][_0x768b('0x35')],_0x306171[_0x768b('0x7e')],_0x306171[_0x768b('0x7f')],_0x306171[_0x768b('0x80')],_0x306171[_0x768b('0x5c')],_0x306171[_0x768b('0x81')]||'en')[_0x768b('0x13')](function(_0x7908a9){_0x53665e(null,_0x7908a9);})['catch'](function(_0x4f4d9f){_0x53665e(_0x4f4d9f);});};AGIVertices['prototype']['sestekNDA']=function(_0x2cacd1,_0x340408){scripts['sestekNDA'](this[_0x768b('0xf')],_0x2cacd1)[_0x768b('0x13')](function(_0x7fb22b){_0x340408(null,_0x7fb22b);})[_0x768b('0x15')](function(_0x1b50a3){_0x340408(_0x1b50a3);});};AGIVertices[_0x768b('0x12')][_0x768b('0x82')]=function(_0x5218f9,_0x1f0e93){scripts['ispeechTTS'](_0x5218f9['key'],_0x5218f9[_0x768b('0x5c')],_0x5218f9['ispeech_tts_language']||'en-US',_0x5218f9['speed'])[_0x768b('0x13')](function(_0x84f28a){_0x1f0e93(null,_0x84f28a);})['catch'](function(_0x49dab1){_0x1f0e93(_0x49dab1);});};AGIVertices[_0x768b('0x12')][_0x768b('0x83')]=function(_0x3e9efe,_0x1ca3ea,_0x46e52d){scripts[_0x768b('0x83')](_0x1ca3ea,_0x3e9efe['key'],_0x3e9efe['ispeech_asr_language']||_0x768b('0x5e'),this[_0x768b('0x84')](_0x3e9efe['model'])?_0x3e9efe['model']:undefined)['then'](function(_0x27b591){_0x46e52d(null,_0x27b591);})['catch'](function(_0x13878a){_0x46e52d(_0x13878a);});};AGIVertices[_0x768b('0x12')]['awsPolly']=function(_0x201657,_0x4a1eb6){scripts[_0x768b('0x85')](_0x201657[_0x768b('0x86')],_0x201657[_0x768b('0x87')],_0x201657[_0x768b('0x88')],_0x201657['aws_polly_voice']||_0x768b('0x89'),_0x201657[_0x768b('0x5c')],_0x201657['aws_text_type']||'text')[_0x768b('0x13')](function(_0x5d1231){_0x4a1eb6(null,_0x5d1231);})['catch'](function(_0x9765aa){_0x4a1eb6(_0x9765aa);});};AGIVertices[_0x768b('0x12')][_0x768b('0x8a')]=function(_0x1e5d78,_0x58226b){scripts[_0x768b('0x8a')](this['channel'][_0x768b('0x35')],_0x1e5d78[_0x768b('0x86')],_0x1e5d78['aws_secret_access_key'],_0x1e5d78[_0x768b('0x8b')],_0x1e5d78[_0x768b('0x5c')],_0x1e5d78[_0x768b('0x8c')])[_0x768b('0x13')](function(_0x5c3608){_0x58226b(null,_0x5c3608);})[_0x768b('0x15')](function(_0x1e46ac){_0x58226b(_0x1e46ac);});};AGIVertices[_0x768b('0x12')]['googleASR']=function(_0x35956e,_0x4625b0,_0x43d09d){scripts[_0x768b('0x8d')](_0x4625b0,_0x35956e[_0x768b('0x7b')],_0x35956e[_0x768b('0x8e')]||_0x768b('0x5e'))['then'](function(_0x293bc2){_0x43d09d(null,_0x293bc2);})[_0x768b('0x15')](function(_0x44925b){_0x43d09d(_0x44925b);});};AGIVertices[_0x768b('0x12')][_0x768b('0x8f')]=function(_0x1b4507,_0x3a2461,_0x6d3288){scripts[_0x768b('0x8f')](_0x3a2461,_0x1b4507[_0x768b('0x90')],_0x1b4507[_0x768b('0x91')],_0x1b4507[_0x768b('0x71')])[_0x768b('0x13')](function(_0x16cf51){_0x6d3288(null,_0x16cf51);})[_0x768b('0x15')](function(_0x2f2a45){_0x6d3288(_0x2f2a45);});};AGIVertices[_0x768b('0x12')][_0x768b('0x92')]=function(_0x138edc){var _0x292d7e=_[_0x768b('0x69')](verticesWithRetry,_0x138edc['agicommand'])?_0x138edc:_[_0x768b('0x93')](_0x138edc);for(var _0x3fba85 in _0x292d7e){if(_0x292d7e['hasOwnProperty'](_0x3fba85)){if(_0x292d7e[_0x3fba85]&&_[_0x768b('0x94')](_0x292d7e[_0x3fba85])){if(_[_0x768b('0x69')](recursiveMapAttributes,_0x3fba85)){_0x292d7e[_0x3fba85]=this[_0x768b('0x95')](_0x292d7e[_0x3fba85]);}else{_0x292d7e[_0x3fba85]=this['replaceAllVariables'](_0x292d7e[_0x3fba85]);}}}}return _0x292d7e;};AGIVertices[_0x768b('0x12')][_0x768b('0x96')]=function(_0x3ba2fa){for(var _0x131f79 in _0x3ba2fa){if(_0x3ba2fa[_0x768b('0x97')](_0x131f79)){if(_[_0x768b('0x98')](_0x3ba2fa[_0x131f79])){this['recursiveNodeIndex'](_0x3ba2fa[_0x131f79]);}else if(_[_0x768b('0x99')](_0x3ba2fa[_0x131f79])){for(var _0x1d4e43=0x0;_0x1d4e43<_0x3ba2fa[_0x131f79][_0x768b('0x9a')];_0x1d4e43++){this[_0x768b('0x96')](_0x3ba2fa[_0x131f79][_0x1d4e43]);}}else if(_[_0x768b('0x94')](_0x3ba2fa[_0x131f79])){_0x3ba2fa[_0x131f79]=this[_0x768b('0x9b')](_0x3ba2fa[_0x131f79]);}}}};AGIVertices[_0x768b('0x12')]['saveRestApiResult']=function(_0x30d33a,_0x55ba2a){for(var _0x3fcb99 in _0x30d33a){if(_0x30d33a['hasOwnProperty'](_0x3fcb99)){if(_[_0x768b('0x98')](_0x30d33a[_0x3fcb99])){if(!_['isEmpty'](_0x30d33a[_0x3fcb99])){this[_0x768b('0x9c')](_0x30d33a[_0x3fcb99],util[_0x768b('0x27')](_0x768b('0x9d'),_0x55ba2a,_0x3fcb99));}}else if(_[_0x768b('0x99')](_0x30d33a[_0x3fcb99])){for(var _0x51e0ab=0x0;_0x51e0ab<_0x30d33a[_0x3fcb99][_0x768b('0x9a')];_0x51e0ab++){this[_0x768b('0x9c')](_0x30d33a[_0x3fcb99][_0x51e0ab],util[_0x768b('0x27')](_0x768b('0x9d'),_0x55ba2a,_0x3fcb99+'['+_0x51e0ab+']'));}}else{if(!_[_0x768b('0x46')](_0x30d33a[_0x3fcb99])){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0x9d'),_0x55ba2a,_0x3fcb99),_0x30d33a[_0x3fcb99]);}}}}};AGIVertices[_0x768b('0x12')][_0x768b('0x95')]=function(_0x219264){try{var _0x3ec783=JSON[_0x768b('0x6b')](_0x219264);this[_0x768b('0x96')](_0x3ec783);return JSON['stringify'](_0x3ec783);}catch(_0x2abed2){return this[_0x768b('0x9b')](_0x219264);}};AGIVertices[_0x768b('0x12')][_0x768b('0x9b')]=function(_0x285fe2){var _0x1821e4=_0x285fe2[_0x768b('0x9f')]('{');for(var _0x596084=0x1;_0x596084<_0x1821e4[_0x768b('0x9a')];_0x596084+=0x1){var _0x24be86=_0x1821e4[_0x596084][_0x768b('0x9f')]('}');if(_0x24be86[_0x768b('0x9a')]>0x1){_0x285fe2=_0x285fe2[_0x768b('0xa0')]('{'+_0x24be86[0x0]+'}',this[_0x768b('0xf')][_0x768b('0xa1')](_0x24be86[0x0])['extra']||_0x24be86[0x0]);}}if(_0x1821e4['length']===0x1){return _0x285fe2[_0x768b('0x4b')]();}return this[_0x768b('0x9b')](_0x285fe2);};AGIVertices['prototype'][_0x768b('0xa2')]=function(_0x576986,_0xdcaccf){var _0xd37940=this[_0x768b('0xf')][_0x768b('0xa1')](_0x576986);if(_0xd37940['result']===-0x1){return _0xd37940;}logger['info'](util[_0x768b('0x27')](_0x768b('0xa3'),_0xdcaccf,_0xd37940[_0x768b('0xa4')]));return this[_0x768b('0xf')][_0x768b('0x9e')](_0xdcaccf,_0xd37940[_0x768b('0xa4')]);};AGIVertices['prototype']['isConfigured']=function(_0x82d204){return _0x82d204&&_0x82d204!=='0'&&_0x82d204!=='-1'&&_0x82d204!=='';};AGIVertices[_0x768b('0x12')][_0x768b('0xa5')]=function(_0x30fcb2){this['createSquareDetailsReport']['sync'](this,_0x30fcb2,'-');_0x30fcb2[_0x768b('0xa6')]=_0x30fcb2['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x768b('0x12')][_0x768b('0xa7')]=function(_0x2ab7b8){logger['info'](util[_0x768b('0x27')](_0x768b('0xa8'),_0x2ab7b8['label']));if(!this[_0x768b('0x84')](_0x2ab7b8[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xaa'));}var _0x171545='\x22'+_0x2ab7b8[_0x768b('0x5c')]+'\x22';if(this[_0x768b('0x84')](_0x2ab7b8[_0x768b('0x79')])){_0x171545+=','+_0x2ab7b8['options'];}var _0x43424a=this['channel']['exec'](_0x768b('0xab'),_0x171545);if(_0x43424a[_0x768b('0xac')]===-0x1){return _0x43424a;}return this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x171545));};AGIVertices['prototype'][_0x768b('0xad')]=function(_0x2232d5){logger['info'](util['format'](_0x768b('0xae'),_0x2232d5[_0x768b('0x36')]));if(!this['isConfigured'](_0x2232d5[_0x768b('0xaf')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xb0'));}var _0xfe47be=_0x2232d5[_0x768b('0xaf')];if(this['isConfigured'](_0x2232d5[_0x768b('0x79')])){_0xfe47be+=','+_0x2232d5[_0x768b('0x79')];}var _0x1ed254=this[_0x768b('0xf')][_0x768b('0x58')]('MRCPRecog',_0xfe47be);if(_0x1ed254[_0x768b('0xac')]===-0x1){return _0x1ed254;}var _0x35830f=this[_0x768b('0xa2')](_0x768b('0xb1'),_0x768b('0xb2'));if(_0x35830f[_0x768b('0xac')]===-0x1){return _0x35830f;}var _0x3d096d=this[_0x768b('0xa2')]('RECOG_INPUT()',_0x768b('0xb3'));if(_0x3d096d[_0x768b('0xac')]===-0x1){return _0x3d096d;}var _0x3dfce9=this[_0x768b('0xa2')](_0x768b('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x3dfce9[_0x768b('0xac')]===-0x1){return _0x3dfce9;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xb5'),_0xfe47be));};AGIVertices[_0x768b('0x12')][_0x768b('0xb6')]=function(_0x1f9811){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1f9811['label']));return this['channel']['agi']([_0x1f9811[_0x768b('0xb7')],_0x1f9811[_0x768b('0xb8')]]);};AGIVertices[_0x768b('0x12')]['answer']=function(_0xcf9dbe){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xcf9dbe[_0x768b('0x36')]));if(this[_0x768b('0x84')](_0xcf9dbe['timeout'])){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0xb9'),_0xcf9dbe[_0x768b('0x67')]));var _0x32c508=this['channel'][_0x768b('0xba')](_0xcf9dbe[_0x768b('0x67')]);if(_0x32c508['result']===-0x1){return _0x32c508;}}return this['channel'][_0x768b('0xbb')]();};AGIVertices['prototype'][_0x768b('0x4a')]=function(_0x4bde26){logger['info'](util['format'](_0x768b('0xbc'),_0x4bde26[_0x768b('0x36')]));if(!this['isConfigured'](_0x4bde26['list_id'])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x4bde26,_0x768b('0xbd'));}_0x4bde26[_0x768b('0x49')]=moment();if(this[_0x768b('0x84')](_0x4bde26[_0x768b('0xbe')])){_0x4bde26[_0x768b('0x49')]=moment()[_0x768b('0xbf')](_0x4bde26[_0x768b('0xbe')],_0x768b('0xc0'));}if(!this[_0x768b('0x84')](_0x4bde26['callback_priority'])){_0x4bde26[_0x768b('0x4c')]=0x2;}this[_0x768b('0x43')][_0x768b('0x70')](this,_0x4bde26);return this[_0x768b('0xf')][_0x768b('0xa9')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4bde26[_0x768b('0x47')],_0x4bde26['list_id'],_0x4bde26[_0x768b('0x49')]));};AGIVertices['prototype'][_0x768b('0xc1')]=function(_0x441301){logger['info'](util['format'](_0x768b('0xc2'),_0x441301[_0x768b('0x36')]));var _0x5bebca=this[_0x768b('0xf')]['exec'](_0x441301[_0x768b('0xc3')],_0x441301['options']);if(_0x5bebca[_0x768b('0xac')]===-0x1){return _0x5bebca;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xc4'),_0x441301[_0x768b('0xc3')],_0x441301['options']));};AGIVertices[_0x768b('0x12')][_0x768b('0xc5')]=function(_0x372173){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x372173[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x372173[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20text\x20configured');}var _0x279d8a='\x22'+_0x372173[_0x768b('0x5c')]+'\x22';if(this[_0x768b('0x84')](_0x372173[_0x768b('0x79')])){_0x279d8a+=','+_0x372173['options'];}var _0x1ca6a4=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0xab'),_0x279d8a);if(_0x1ca6a4['result']===-0x1){return _0x1ca6a4;}return this['channel'][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xc6'),_0x279d8a));};AGIVertices[_0x768b('0x12')][_0x768b('0xc7')]=function(_0x32f291){logger[_0x768b('0x2c')](util['format'](_0x768b('0xc8'),_0x32f291[_0x768b('0x36')]));if(!this['isConfigured'](_0x32f291[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xaa'));}var _0x40f347='\x22'+_0x32f291[_0x768b('0x5c')]+'\x22';if(this['isConfigured'](_0x32f291['options'])){_0x40f347+=','+_0x32f291['options'];}var _0x50941a=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0xab'),_0x40f347);if(_0x50941a[_0x768b('0xac')]===-0x1){return _0x50941a;}return this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0xc6'),_0x40f347));};AGIVertices[_0x768b('0x12')]['lumenvoxasr']=function(_0x1f2a9d){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1f2a9d[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x1f2a9d[_0x768b('0xaf')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xb0'));}var _0x1cef2b=_0x1f2a9d['grammar'];if(this[_0x768b('0x84')](_0x1f2a9d[_0x768b('0x79')])){_0x1cef2b+=','+_0x1f2a9d[_0x768b('0x79')];}var _0x3696d5=this['channel']['exec']('MRCPRecog',_0x1cef2b);if(_0x3696d5[_0x768b('0xac')]===-0x1){return _0x3696d5;}var _0x24e63b=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x24e63b[_0x768b('0xac')]===-0x1){return _0x24e63b;}var _0x313055=this[_0x768b('0xa2')](_0x768b('0xc9'),_0x768b('0xca'));if(_0x313055[_0x768b('0xac')]===-0x1){return _0x313055;}var _0x4b6eed=this['getAndSetVariable'](_0x768b('0xb4'),_0x768b('0xcb'));if(_0x4b6eed[_0x768b('0xac')]===-0x1){return _0x4b6eed;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xb5'),_0x1cef2b));};AGIVertices[_0x768b('0x12')]['sestekasr']=function(_0x3d4cf4){logger['info'](util[_0x768b('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x3d4cf4[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x3d4cf4['grammar'])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xb0'));}var _0x2e7140=_0x3d4cf4['grammar'];if(this[_0x768b('0x84')](_0x3d4cf4[_0x768b('0x79')])){_0x2e7140+=','+_0x3d4cf4[_0x768b('0x79')];}var _0x21085b=this['channel'][_0x768b('0x58')](_0x768b('0xcc'),_0x2e7140);if(_0x21085b['result']===-0x1){return _0x21085b;}var _0x2ed551=this[_0x768b('0xa2')](_0x768b('0xb1'),_0x768b('0xcd'));if(_0x2ed551[_0x768b('0xac')]===-0x1){return _0x2ed551;}var _0x340f23=this[_0x768b('0xa2')](_0x768b('0xc9'),_0x768b('0xce'));if(_0x340f23[_0x768b('0xac')]===-0x1){return _0x340f23;}var _0x4cc993=this[_0x768b('0xa2')]('RECOG_INSTANCE()',_0x768b('0xcf'));if(_0x4cc993[_0x768b('0xac')]===-0x1){return _0x4cc993;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xb5'),_0x2e7140));};AGIVertices[_0x768b('0x12')]['database']=function(_0x4c5271){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4c5271[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x4c5271[_0x768b('0xd0')])){return this[_0x768b('0xf')]['error'](_0x4c5271,'no\x20database\x20selected');}var _0x5a75d8=this[_0x768b('0xd1')][_0x768b('0x70')](this,_0x4c5271['odbc_id']);if(!_0x5a75d8){return this[_0x768b('0xf')][_0x768b('0x30')](_0x4c5271,_0x768b('0xd2'));}if(!this[_0x768b('0x84')](_0x4c5271['query'])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x4c5271,_0x768b('0xd3'));}var _0x152c0b=_0x4c5271[_0x768b('0x2e')][_0x768b('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x768b('0xf')][_0x768b('0xa9')](util['format']('query:\x20%s',_0x152c0b));var _0x51fc88=this[_0x768b('0x29')]['sync'](this,_0x5a75d8,_0x152c0b);this['createSquareDetailsReport'][_0x768b('0x70')](this,_0x4c5271,_0x152c0b);if(!this[_0x768b('0x84')](_0x4c5271[_0x768b('0xd4')])){return this['channel'][_0x768b('0xa9')](_0x768b('0xd5'));}var _0x5aa0e3=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0x4c5271[_0x768b('0xd4')]);if(!_0x5aa0e3){return this[_0x768b('0xf')]['error'](_0x4c5271,'no\x20variable\x20found');}var _0x56afce=this;_0x51fc88[_0x768b('0xd6')](function(_0x48b998,_0xfbf785){Object[_0x768b('0xd7')](_0x48b998)['forEach'](function(_0x3060ba){_0x56afce['channel']['setVariable'](util[_0x768b('0x27')](_0x768b('0xd8'),_0x5aa0e3,_0xfbf785,_0x3060ba),_0x48b998[_0x3060ba]);});});this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0xd9'),_0x5aa0e3),_0x51fc88[_0x768b('0x9a')]);return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xda'),_0x5aa0e3));};AGIVertices[_0x768b('0x12')][_0x768b('0xdb')]=function(_0x461c59){logger[_0x768b('0xdc')](util[_0x768b('0x27')](_0x768b('0xdd'),_0x461c59[_0x768b('0x36')]));if(!this['isConfigured'](_0x461c59[_0x768b('0xde')])){return this[_0x768b('0xf')]['error'](_0x461c59,_0x768b('0xdf'));}var _0x2bc52c=this['getUser'][_0x768b('0x70')](this,_0x461c59[_0x768b('0xde')]);if(!_0x2bc52c){return this[_0x768b('0xf')]['error'](_0x461c59,_0x768b('0xe0'));}var _0x392bc2=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0xe1'),[util[_0x768b('0x27')]('SIP/%s',_0x2bc52c),_0x461c59[_0x768b('0x67')],_0x461c59[_0x768b('0xe2')],_0x461c59[_0x768b('0x65')]]);if(_0x392bc2[_0x768b('0xac')]===-0x1){return _0x392bc2;}return this[_0x768b('0xf')]['noop'](util['format'](_0x768b('0xe3'),'DIAL'));};AGIVertices[_0x768b('0x12')][_0x768b('0xe4')]=function(_0x5b569f){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0xe5'),_0x5b569f[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x5b569f[_0x768b('0x7b')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xe6'));}if(!this[_0x768b('0x84')](_0x5b569f['text'])){return this['channel'][_0x768b('0xa9')](_0x768b('0xaa'));}this['channel']['bot']=!![];this[_0x768b('0x34')](_0x5b569f);this[_0x768b('0x42')](_0x5b569f['text'],'in','','');this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xe7'),_0x5b569f['text']));var _0x34d49c=this[_0x768b('0x7a')][_0x768b('0x70')](this,_0x5b569f);if(_0x34d49c){for(var _0x4d4499 in _0x34d49c){if(_0x34d49c[_0x768b('0x97')](_0x4d4499)){this['channel']['setVariable'](util[_0x768b('0x27')](_0x768b('0xe8'),_0x4d4499[_0x768b('0x6a')]()),_0x34d49c[_0x4d4499]);}}this[_0x768b('0x42')](_0x34d49c[_0x768b('0xe9')],_0x768b('0xea'),_0x768b('0xe4'),'');return this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0xeb'),_0x34d49c[_0x768b('0xe9')]));}return this[_0x768b('0xf')][_0x768b('0x30')](_0x5b569f,_0x768b('0xec'));};AGIVertices[_0x768b('0x12')][_0x768b('0xed')]=function(_0x2dda4b){logger['info'](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2dda4b[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x2dda4b[_0x768b('0x7e')])){return this['channel'][_0x768b('0xa9')]('no\x20project_id\x20configured');}if(!this[_0x768b('0x84')](_0x2dda4b[_0x768b('0x7f')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xee'));}if(!this[_0x768b('0x84')](_0x2dda4b[_0x768b('0x80')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x2dda4b[_0x768b('0x81')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20anguage\x20configured');}if(!this[_0x768b('0x84')](_0x2dda4b[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xaa'));}this[_0x768b('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x2dda4b);this[_0x768b('0x42')](_0x2dda4b['text'],'in','','');this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x2dda4b[_0x768b('0x5c')]));var _0x5a8e3e=this[_0x768b('0x7d')][_0x768b('0x70')](this,_0x2dda4b);if(_0x5a8e3e){for(var _0x42d395 in _0x5a8e3e){if(_0x5a8e3e[_0x768b('0x97')](_0x42d395)){if(_0x42d395!==_0x768b('0xef')){this[_0x768b('0xf')][_0x768b('0x9e')](util['format']('DIALOGFLOW_%s',_0x42d395['toUpperCase']()),_0x5a8e3e[_0x42d395]);}}}this['createSquareMessage'](_0x5a8e3e[_0x768b('0xe9')],_0x768b('0xea'),_0x768b('0xed'),_0x5a8e3e[_0x768b('0xef')]);return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xf0'),_0x5a8e3e['speech']));}return this['channel']['error'](_0x2dda4b,_0x768b('0xf1'));};AGIVertices[_0x768b('0x12')][_0x768b('0xf2')]=function(_0x52e43f){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0xf3'),_0x52e43f[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x52e43f[_0x768b('0xf4')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xf5'));}if(!this[_0x768b('0x84')](_0x52e43f[_0x768b('0xf6')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xf7'));}if(!this[_0x768b('0x84')](_0x52e43f[_0x768b('0xf8')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xf9'));}if(!this['isConfigured'](_0x52e43f[_0x768b('0xfa')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xaa'));}this[_0x768b('0xf')][_0x768b('0xfb')]=!![];this[_0x768b('0x34')](_0x52e43f);this[_0x768b('0x42')](_0x52e43f[_0x768b('0x5c')],'in','','');this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xfc'),_0x52e43f[_0x768b('0x5c')]));var _0x18f207=this[_0x768b('0xfd')]['sync'](this,_0x52e43f);if(_0x18f207){for(var _0x2ff860 in _0x18f207){if(_0x18f207[_0x768b('0x97')](_0x2ff860)){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0xfe'),_0x2ff860[_0x768b('0x6a')]()),_0x18f207[_0x2ff860]);}}this[_0x768b('0x42')](_0x18f207[_0x768b('0xe9')],_0x768b('0xea'),_0x768b('0xf2'),'');if(_0x18f207[_0x768b('0xff')]){this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x100'),_0x18f207['audiofile']));var _0x47bd9f=this[_0x768b('0xf')][_0x768b('0x101')](_0x18f207[_0x768b('0xff')]);try{fs[_0x768b('0x102')](_0x18f207['audiofile']+_0x768b('0x103'));}catch(_0x32fbff){logger['error'](_0x32fbff);}return _0x47bd9f;}else{return this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')]('SestekNDA\x20Result\x20%s',_0x18f207[_0x768b('0xe9')]));}}return this[_0x768b('0xf')][_0x768b('0x30')](_0x52e43f,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x768b('0x12')]['end']=function(_0x304e33){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x104'),_0x304e33['label']));return this[_0x768b('0xf')]['noop']('end');};AGIVertices[_0x768b('0x12')][_0x768b('0x105')]=function(_0x6f0b95){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x6f0b95['label']));var _0x5d899b='';if(_0x6f0b95[_0x768b('0x106')]){if(!this[_0x768b('0x84')](_0x6f0b95[_0x768b('0x106')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x6f0b95,_0x768b('0x107'));}else{var _0x11734b=parseInt(_0x6f0b95[_0x768b('0x106')],0xa);if(isNaN(_0x11734b)){_0x5d899b=_0x6f0b95['trunk_id'];}else{_0x5d899b=this['getTrunk']['sync'](this,_0x6f0b95['trunk_id']);if(!_0x5d899b){return this[_0x768b('0xf')]['error'](_0x6f0b95,_0x768b('0x108'));}}}}else if(_0x6f0b95['trunk_name']){_0x5d899b=_0x6f0b95[_0x768b('0x109')];}else{return this[_0x768b('0xf')][_0x768b('0x30')](_0x6f0b95,_0x768b('0x107'));}var _0x48a01d=this[_0x768b('0xf')][_0x768b('0x58')]('DIAL',[util[_0x768b('0x27')](_0x768b('0x10a'),_0x5d899b,_0x6f0b95[_0x768b('0x47')]),_0x6f0b95['timeout'],_0x6f0b95[_0x768b('0xe2')],_0x6f0b95[_0x768b('0x65')]]);if(_0x48a01d[_0x768b('0xac')]===-0x1){return _0x48a01d;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xe3'),_0x768b('0xe1')));};AGIVertices[_0x768b('0x12')][_0x768b('0x10b')]=function(_0x501381){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x501381['label']));return this[_0x768b('0xf')][_0x768b('0xa9')]('finally');};AGIVertices[_0x768b('0x12')][_0x768b('0x10c')]=function(_0x3e6d10){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x10d'),_0x3e6d10[_0x768b('0x36')]));if(_0x3e6d10[_0x768b('0xa6')]===0x0){return this[_0x768b('0xa5')](_0x3e6d10);}_0x3e6d10[_0x768b('0xa6')]-=0x1;if(!this['isConfigured'](_0x3e6d10['file_id'])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x3e6d10,_0x768b('0x10e'));}var _0x113b52=this[_0x768b('0x10f')][_0x768b('0x70')](this,_0x3e6d10[_0x768b('0x110')]);if(!_0x113b52){return this[_0x768b('0xf')][_0x768b('0x30')](_0x3e6d10,'no\x20file\x20audio\x20found');}if(!this[_0x768b('0x84')](_0x3e6d10['variable_id'])){return this['channel'][_0x768b('0x30')](_0x768b('0xd5'));}var _0x3a3bd2=this[_0x768b('0xf')]['getData'](_0x113b52,_0x3e6d10['response'],_0x3e6d10[_0x768b('0x111')]);var _0x360403=_0x3a3bd2[_0x768b('0xac')]?_0x3a3bd2[_0x768b('0xac')][_0x768b('0x4b')]():'';logger[_0x768b('0x2c')]('test',JSON[_0x768b('0x72')](_0x3a3bd2));if(_0x3a3bd2['result']===-0x1){this[_0x768b('0x34')][_0x768b('0x70')](this,_0x3e6d10,_0x360403);return _0x3a3bd2;}else if(_0x3a3bd2[_0x768b('0xa4')]===_0x768b('0x67')){_0x3a3bd2['result']=_0x360403[_0x768b('0x9a')]>=parseInt(_0x3e6d10[_0x768b('0x112')])?'x':'i';}else{_0x3a3bd2['result']=_0x360403[_0x768b('0x9a')]>=parseInt(_0x3e6d10[_0x768b('0x112')])&&_0x360403[_0x768b('0x9a')]<=parseInt(_0x3e6d10['maxdigit'])?'x':'i';}var _0x492710=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0x3e6d10['variable_id']);if(!_0x492710){return this['channel'][_0x768b('0x30')](_0x3e6d10,_0x768b('0x113'));}this[_0x768b('0xf')][_0x768b('0x9e')](_0x492710,_0x360403);if(this['isConfigured'](_0x3e6d10[_0x768b('0x114')])){var _0x385261=parseInt(_0x3e6d10[_0x768b('0x114')],0xa);var _0x20ba16=rs[_0x768b('0x115')]({'charset':'*','length':_0x385261});var _0x507b58=_0x360403['length'];if(_0x507b58>0x0){if(_0x507b58>_0x385261){this[_0x768b('0x34')][_0x768b('0x70')](this,_0x3e6d10,_0x3e6d10['hiddendigitspos']===_0x768b('0x116')?_0x20ba16+_0x360403[_0x768b('0x117')](_0x385261):_0x360403[_0x768b('0x117')](0x0,_0x507b58-_0x385261)+_0x20ba16);}else{this[_0x768b('0x34')][_0x768b('0x70')](this,_0x3e6d10,rs[_0x768b('0x115')]({'charset':'*','length':_0x507b58}));}}else{this['createSquareDetailsReport'][_0x768b('0x70')](this,_0x3e6d10,'');}}else{this[_0x768b('0x34')]['sync'](this,_0x3e6d10,_0x360403);}return _0x3a3bd2;};AGIVertices['prototype'][_0x768b('0xe')]=function(_0x3e1ab3){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x118'),_0x3e1ab3['label']));return this[_0x768b('0x10c')](_0x3e1ab3);};AGIVertices['prototype'][_0x768b('0x119')]=function(_0x46b1ca){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x11a'),_0x46b1ca[_0x768b('0x36')]));this['createSquareDetailsReport'][_0x768b('0x70')](this,_0x46b1ca,_0x46b1ca['goalname']);return this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0x11b'),_0x46b1ca[_0x768b('0x11c')]));};AGIVertices[_0x768b('0x12')][_0x768b('0x11d')]=function(_0x2df1eb){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x11e'),_0x2df1eb[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x2df1eb['aws_access_key_id'])||!this['isConfigured'](_0x2df1eb[_0x768b('0x87')])){return this[_0x768b('0xf')]['noop'](_0x768b('0x11f'));}if(!this[_0x768b('0x84')](_0x2df1eb[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20text\x20configured');}this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x120'),_0x2df1eb[_0x768b('0x5c')]));var _0xa53c7e=this[_0x768b('0x85')][_0x768b('0x70')](this,_0x2df1eb);if(_0xa53c7e){this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0x121'),_0xa53c7e));var _0x277d1e=this['channel']['streamFile'](_0xa53c7e);try{fs[_0x768b('0x102')](_0xa53c7e+_0x768b('0x103'));}catch(_0x170ffd){logger[_0x768b('0x30')](_0x170ffd);}return _0x277d1e;}return this[_0x768b('0xf')][_0x768b('0x30')](_0x2df1eb,_0x768b('0x122'));};AGIVertices[_0x768b('0x12')][_0x768b('0x123')]=function(_0x5c2cbe){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x124'),_0x5c2cbe[_0x768b('0x36')]));if(!this['isConfigured'](_0x5c2cbe[_0x768b('0x86')])||!this[_0x768b('0x84')](_0x5c2cbe['aws_secret_access_key'])){return this[_0x768b('0xf')]['noop'](_0x768b('0x11f'));}if(!this[_0x768b('0x84')](_0x5c2cbe[_0x768b('0x8c')])){return this['channel'][_0x768b('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x768b('0x84')](_0x5c2cbe[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20text\x20configured');}this[_0x768b('0xf')][_0x768b('0xfb')]=!![];this[_0x768b('0x34')](_0x5c2cbe);this[_0x768b('0x42')](_0x5c2cbe['text'],'in','','');this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x125'),_0x5c2cbe[_0x768b('0x5c')]));var _0x10c2fc=this[_0x768b('0x8a')][_0x768b('0x70')](this,_0x5c2cbe);if(_0x10c2fc){for(var _0xc27eb1 in _0x10c2fc){if(_0x10c2fc[_0x768b('0x97')](_0xc27eb1)&&_[_0x768b('0x94')](_0x10c2fc[_0xc27eb1])){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0x126'),_0xc27eb1[_0x768b('0x6a')]()),_0x10c2fc[_0xc27eb1]);}}if(_[_0x768b('0x46')](_0x10c2fc[_0x768b('0x77')])){return this[_0x768b('0xf')][_0x768b('0xa9')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x768b('0x42')](_0x10c2fc['message'],_0x768b('0xea'),_0x768b('0x127'),'');return this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x10c2fc[_0x768b('0x77')]));}}return this[_0x768b('0xf')]['error'](_0x5c2cbe,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x768b('0x12')][_0x768b('0x128')]=function(_0x11fbe6){logger['info'](util[_0x768b('0x27')](_0x768b('0x129'),_0x11fbe6[_0x768b('0x36')],_0x11fbe6['timeout']));if(!this[_0x768b('0x84')](_0x11fbe6['key'])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xe6'));}var _0x23acdf=_0x768b('0x12a');var _0x40a8d2=util[_0x768b('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x768b('0x115')](0x4));var _0x277803=util['format']('%s.%s',_0x40a8d2,_0x23acdf);var _0x41e38c=!![];if(_0x11fbe6['beep']==='NOBEEP'){_0x41e38c=![];}var _0x5b65e5=this[_0x768b('0xf')]['recordFile'](_0x40a8d2,_0x23acdf,_0x11fbe6[_0x768b('0x12b')],_0x11fbe6[_0x768b('0x67')],undefined,_0x41e38c);if(_0x5b65e5[_0x768b('0xac')]!==-0x1){this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x12c'),_0x277803));var _0x12d4e8=this[_0x768b('0x8d')][_0x768b('0x70')](this,_0x11fbe6,_0x277803);if(_0x12d4e8){for(var _0x5c1a7d in _0x12d4e8){if(_0x12d4e8[_0x768b('0x97')](_0x5c1a7d)){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0x12d'),_0x5c1a7d[_0x768b('0x6a')]()),_0x12d4e8[_0x5c1a7d]);}}return this['channel'][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x12e'),JSON[_0x768b('0x72')](_0x12d4e8)));}}return _0x5b65e5;};AGIVertices[_0x768b('0x12')][_0x768b('0x12f')]=function(_0x13ff8e){logger['info'](util['format'](_0x768b('0x130'),_0x13ff8e[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x13ff8e[_0x768b('0x90')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x131'));}if(!this[_0x768b('0x84')](_0x13ff8e['appsecret'])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x132'));}var _0x312ecc=_0x768b('0x12a');var _0x3bed34=util[_0x768b('0x27')](_0x768b('0x133'),FILES_PATH,rs[_0x768b('0x115')](0x4));var _0x3a7d97=util[_0x768b('0x27')](_0x768b('0x9d'),_0x3bed34,_0x312ecc);var _0x3a63b0=!![];if(_0x13ff8e['beep']===_0x768b('0x134')){_0x3a63b0=![];}var _0x5a6250=this[_0x768b('0xf')]['recordFile'](_0x3bed34,_0x312ecc,_0x13ff8e[_0x768b('0x12b')],_0x13ff8e[_0x768b('0x67')],undefined,_0x3a63b0);if(_0x5a6250[_0x768b('0xac')]!==-0x1){this['channel'][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x135'),_0x3a7d97));var _0x444083=this[_0x768b('0x8f')][_0x768b('0x70')](this,_0x13ff8e,_0x3a7d97);if(_0x444083){for(var _0x3ed35c in _0x444083){if(_0x444083[_0x768b('0x97')](_0x3ed35c)){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')]('TILDE_ASR_%s',_0x3ed35c[_0x768b('0x6a')]()),_0x444083[_0x3ed35c]);}}return this[_0x768b('0xf')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON['stringify'](_0x444083)));}}return _0x5a6250;};AGIVertices['prototype'][_0x768b('0x136')]=function(_0x25c0a6){logger['info'](util['format'](_0x768b('0x137'),_0x25c0a6[_0x768b('0x36')]));return this[_0x768b('0xf')][_0x768b('0x138')](_0x25c0a6[_0x768b('0x3b')],_0x25c0a6[_0x768b('0x3c')],_0x25c0a6[_0x768b('0x3d')]);};AGIVertices[_0x768b('0x12')][_0x768b('0x139')]=function(_0x220886){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x220886['label']));if(!this[_0x768b('0x84')](_0x220886[_0x768b('0x13a')])){return this['channel'][_0x768b('0x30')](_0x220886,'no\x20condition\x20configured');}try{var _0x12a738=eval(_0x220886[_0x768b('0x13a')])?'true':_0x768b('0x13b');this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')]('EVAL\x20CONDITION\x20%s\x20%s',_0x220886[_0x768b('0x13a')],_0x12a738));return{'code':0xc8,'result':_0x12a738};}catch(_0x1dff55){return{'code':0xc8,'result':_0x768b('0x13b')};}};AGIVertices[_0x768b('0x12')][_0x768b('0x13c')]=function(_0x455782){logger[_0x768b('0x2c')](util['format'](_0x768b('0x13d'),_0x455782[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x455782[_0x768b('0x13e')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x455782,_0x768b('0x13f'));}var _0x1e0ed4=this['getIntervals'][_0x768b('0x70')](this,_0x455782[_0x768b('0x13e')]);if(!_0x1e0ed4){return this[_0x768b('0xf')]['error'](_0x455782,_0x768b('0x140'));}for(var _0x55c5b9=0x0;_0x55c5b9<_0x1e0ed4[_0x768b('0x9a')];_0x55c5b9+=0x1){var _0x4fe676=this[_0x768b('0xf')]['getVariable'](util[_0x768b('0x27')](_0x768b('0x141'),_0x1e0ed4[_0x55c5b9]));if(_0x4fe676[_0x768b('0xac')]===-0x1){return _0x4fe676;}logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x142'),_0x1e0ed4[_0x55c5b9],_0x4fe676[_0x768b('0xa4')]));if(_0x4fe676[_0x768b('0xa4')]==='true'){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('IFTIME\x20%s\x20%s',_0x1e0ed4[_0x55c5b9],_0x768b('0x143')));this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x142'),_0x1e0ed4[_0x55c5b9],_0x768b('0x143')));return{'code':0xc8,'result':_0x768b('0x143')};}else{logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x142'),_0x1e0ed4[_0x55c5b9],_0x768b('0x13b')));this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x142'),_0x1e0ed4[_0x55c5b9],_0x768b('0x13b')));}}return{'code':0xc8,'result':_0x768b('0x13b')};};AGIVertices[_0x768b('0x12')][_0x768b('0x144')]=function(_0x54458f){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x145'),_0x54458f[_0x768b('0x36')]));return this[_0x768b('0xf')]['hangup']();};AGIVertices[_0x768b('0x12')]['ispeechasr']=function(_0x265231){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x146'),_0x265231[_0x768b('0x36')]));if(!this['isConfigured'](_0x265231[_0x768b('0x7b')])){return this['channel'][_0x768b('0xa9')]('no\x20key\x20configured');}var _0x2e5fc6=_0x768b('0x12a');var _0x3eeccc=util[_0x768b('0x27')](_0x768b('0x133'),FILES_PATH,rs['generate'](0x4));var _0x3694ae=util[_0x768b('0x27')](_0x768b('0x9d'),_0x3eeccc,_0x2e5fc6);var _0x457a00=!![];if(_0x265231['beep']===_0x768b('0x134')){_0x457a00=![];}var _0x43e997=this['channel'][_0x768b('0x147')](_0x3eeccc,_0x2e5fc6,_0x265231[_0x768b('0x12b')],_0x265231['timeout'],undefined,_0x457a00);if(_0x43e997[_0x768b('0xac')]!==-0x1){this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0x148'),_0x3694ae));var _0x2583a7=this['ispeechASR'][_0x768b('0x70')](this,_0x265231,_0x3694ae);if(_0x2583a7){for(var _0x253486 in _0x2583a7){if(_0x2583a7[_0x768b('0x97')](_0x253486)){this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')](_0x768b('0x149'),_0x253486[_0x768b('0x6a')]()),_0x2583a7[_0x253486]);}}return this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x14a'),JSON[_0x768b('0x72')](_0x2583a7)));}}return _0x43e997;};AGIVertices[_0x768b('0x12')][_0x768b('0x14b')]=function(_0x474562){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x14c'),_0x474562[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x474562['key'])){return this[_0x768b('0xf')]['noop'](_0x768b('0xe6'));}if(!this['isConfigured'](_0x474562[_0x768b('0x5c')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0xaa'));}this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')](_0x768b('0x14d'),_0x474562[_0x768b('0x5c')]));var _0xe4ff47=this['ispeechTTS'][_0x768b('0x70')](this,_0x474562);if(_0xe4ff47){this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x148'),_0xe4ff47));var _0xfcb793=this[_0x768b('0xf')]['streamFile'](_0xe4ff47,_0x474562[_0x768b('0x12b')]);try{fs[_0x768b('0x102')](_0xe4ff47+_0x768b('0x103'));}catch(_0x205813){logger['error'](_0x205813);}return _0xfcb793;}return this[_0x768b('0xf')][_0x768b('0x30')](_0x474562,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x768b('0x12')][_0x768b('0x14e')]=function(_0x1a90af){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x14f'),_0x1a90af[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x1a90af[_0x768b('0x150')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x1a90af,_0x768b('0x151'));}logger[_0x768b('0x2c')](util['format'](_0x768b('0x152'),this[_0x768b('0xf')][_0x768b('0x38')],_0x1a90af[_0x768b('0x150')]));var _0x37bf11=this[_0x768b('0x53')][_0x768b('0x70')](this,_0x1a90af['findBy']);if(_0x37bf11){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x153'),this['channel'][_0x768b('0x38')],_0x1a90af['findBy']));this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')](_0x768b('0x153'),this[_0x768b('0xf')][_0x768b('0x38')],_0x1a90af[_0x768b('0x150')]));return{'code':0xc8,'result':_0x768b('0x154')};}else{logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x155'),this[_0x768b('0xf')][_0x768b('0x38')],_0x1a90af[_0x768b('0x150')]));this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0x155'),this[_0x768b('0xf')][_0x768b('0x38')],_0x1a90af[_0x768b('0x150')]));return{'code':0xc8,'result':_0x768b('0x156')};}};AGIVertices[_0x768b('0x12')][_0x768b('0x157')]=function(_0x54fbfe){logger[_0x768b('0x2c')](util['format'](_0x768b('0x158'),_0x54fbfe[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x54fbfe[_0x768b('0x150')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x54fbfe,_0x768b('0x151'));}logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x152'),this[_0x768b('0xf')][_0x768b('0x38')],_0x54fbfe['findBy']));var _0x1b71d7=this[_0x768b('0x52')][_0x768b('0x70')](this,_0x54fbfe[_0x768b('0x150')]);if(_0x1b71d7){logger[_0x768b('0x2c')](util['format'](_0x768b('0x153'),this['channel']['callerid'],_0x54fbfe[_0x768b('0x150')]));this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x153'),this[_0x768b('0xf')][_0x768b('0x38')],_0x54fbfe[_0x768b('0x150')]));return{'code':0xc8,'result':_0x768b('0x154')};}else{logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x155'),this['channel'][_0x768b('0x38')],_0x54fbfe[_0x768b('0x150')]));this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x155'),this[_0x768b('0xf')][_0x768b('0x38')],_0x54fbfe[_0x768b('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x768b('0x159')]=function(_0x3f9f79){logger[_0x768b('0x2c')](util['format'](_0x768b('0x15a'),_0x3f9f79['label']));if(!this[_0x768b('0x84')](_0x3f9f79['operation'])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x3f9f79,_0x768b('0x15b'));}this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x15c'),_0x3f9f79[_0x768b('0x15d')]));var _0x34e91d=eval(_0x3f9f79[_0x768b('0x15d')]);if(!this[_0x768b('0x84')](_0x3f9f79[_0x768b('0xd4')])){return this['channel']['noop'](_0x768b('0xd5'));}var _0x1ef4fb=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0x3f9f79['variable_id']);if(!_0x1ef4fb){return this['channel'][_0x768b('0x30')](_0x3f9f79,'no\x20variable\x20found');}if(_[_0x768b('0x99')](_0x34e91d)){var _0x39ae80=this;_0x34e91d['forEach'](function(_0x54ac78,_0x3c5c45){_0x39ae80[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')]('%s[%s]',_0x1ef4fb,_0x3c5c45),_0x54ac78);});return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')]('variable\x20%s[key]\x20set',_0x1ef4fb));}else{return this['channel'][_0x768b('0x9e')](_0x1ef4fb,_0x34e91d);}};AGIVertices['prototype'][_0x768b('0xd')]=function(_0x201696){logger[_0x768b('0x2c')](util['format'](_0x768b('0x15e'),_0x201696[_0x768b('0x36')]));if(_0x201696['retry']===0x0){return this[_0x768b('0xa5')](_0x201696);}_0x201696[_0x768b('0xa6')]-=0x1;if(!this['isConfigured'](_0x201696['file_id'])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x201696,_0x768b('0x10e'));}var _0x400fb3=this[_0x768b('0x10f')][_0x768b('0x70')](this,_0x201696[_0x768b('0x110')]);if(!_0x400fb3){return this[_0x768b('0xf')][_0x768b('0x30')](_0x201696,_0x768b('0x15f'));}var _0x3874dc=this['channel']['getData'](_0x400fb3,_0x201696[_0x768b('0x160')],_0x201696[_0x768b('0x161')]);var _0x486d81=_0x3874dc['result'];if(_0x3874dc['result']===-0x1){this[_0x768b('0x34')][_0x768b('0x70')](this,_0x201696,'-1');return _0x3874dc;}else if(_0x3874dc[_0x768b('0xa4')]===_0x768b('0x67')){_0x3874dc['result']=_0x3874dc[_0x768b('0xac')][_0x768b('0x9a')]>0x0?_0x3874dc[_0x768b('0xac')]:'t';}else if(_['isEmpty'](_0x3874dc[_0x768b('0xac')])){_0x3874dc[_0x768b('0xac')]='#';_0x486d81='#';}if(!this[_0x768b('0x84')](_0x201696['variable_id'])){this['channel'][_0x768b('0xa9')](_0x768b('0xd5'));}else{var _0x29c6ec=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0x201696['variable_id']);if(!_0x29c6ec){return this['channel']['error'](_0x201696,_0x768b('0x113'));}this['channel'][_0x768b('0x9e')](_0x29c6ec,_0x486d81);}this['createSquareDetailsReport'][_0x768b('0x70')](this,_0x201696,_0x486d81);return _0x3874dc;};AGIVertices[_0x768b('0x12')][_0x768b('0xa9')]=function(_0x561b18){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x162'),_0x561b18[_0x768b('0x36')]));return this['channel'][_0x768b('0xa9')](_0x561b18[_0x768b('0x163')]||_0x561b18[_0x768b('0x36')]);};AGIVertices[_0x768b('0x12')][_0x768b('0x164')]=function(_0x108f1c){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x108f1c[_0x768b('0x36')]));if(!this['isConfigured'](_0x108f1c[_0x768b('0x150')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x108f1c,'no\x20find\x20by\x20configured');}logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x152'),this['channel']['callerid'],_0x108f1c[_0x768b('0x150')]));var _0x23a048=this['getPause'][_0x768b('0x70')](this,_0x108f1c[_0x768b('0x165')]);var _0x4ca75a=this['agentPause'][_0x768b('0x70')](this,_0x108f1c[_0x768b('0x150')],_0x23a048);if(_0x4ca75a){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x768b('0x38')],_0x108f1c[_0x768b('0x150')]));this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')](_0x768b('0x153'),this['channel']['callerid'],_0x108f1c[_0x768b('0x150')]));return{'code':0xc8,'result':_0x768b('0x154')};}else{logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x155'),this[_0x768b('0xf')][_0x768b('0x38')],_0x108f1c[_0x768b('0x150')]));this['channel'][_0x768b('0xa9')](util['format'](_0x768b('0x153'),this[_0x768b('0xf')][_0x768b('0x38')],_0x108f1c['findBy']));return{'code':0xc8,'result':_0x768b('0x156')};}};AGIVertices[_0x768b('0x12')][_0x768b('0x166')]=function(_0x5b055c){logger['info'](util[_0x768b('0x27')](_0x768b('0x167'),_0x5b055c[_0x768b('0x36')]));if(!this['isConfigured'](_0x5b055c[_0x768b('0x110')])){return this[_0x768b('0xf')]['error'](_0x5b055c,_0x768b('0x10e'));}var _0x29c665=this[_0x768b('0x10f')][_0x768b('0x70')](this,_0x5b055c[_0x768b('0x110')]);if(!_0x29c665){return this[_0x768b('0xf')]['error'](_0x5b055c,_0x768b('0x15f'));}var _0x498b04=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0x168'),[_0x29c665,_0x5b055c[_0x768b('0xe2')]]);if(_0x498b04['result']===-0x1){return _0x498b04;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xc4'),_0x768b('0x168'),_0x29c665));};AGIVertices[_0x768b('0x12')][_0x768b('0x169')]=function(_0x16ef82){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x16ef82[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x16ef82[_0x768b('0x16a')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x16ef82,_0x768b('0x16b'));}var _0x48c942='';var _0x4ca9c4=parseInt(_0x16ef82[_0x768b('0x16a')],0xa);if(isNaN(_0x4ca9c4)){_0x48c942=_0x16ef82[_0x768b('0x16a')];}else{_0x48c942=this[_0x768b('0x16')][_0x768b('0x70')](this,_0x16ef82['queue_id']);if(!_0x48c942){return this['channel'][_0x768b('0x30')](_0x16ef82,_0x768b('0x16c'));}}var _0x5978e7='';if(this[_0x768b('0x84')](_0x16ef82[_0x768b('0x110')])){var _0x597d6c=this[_0x768b('0x10f')][_0x768b('0x70')](this,_0x16ef82[_0x768b('0x110')]);if(_0x597d6c){_0x5978e7=_0x597d6c;}}this[_0x768b('0x34')]['sync'](this,_0x16ef82,_0x48c942);if(_0x16ef82[_0x768b('0xe2')]['indexOf']('x')<0x0){_0x16ef82[_0x768b('0xe2')]+='x';}if(_0x16ef82[_0x768b('0xe2')]['indexOf']('X')<0x0){_0x16ef82[_0x768b('0xe2')]+='X';}this[_0x768b('0xf')][_0x768b('0x9e')](_0x768b('0x16d'),_0x48c942?_0x48c942['toLowerCase']():'');var _0x38d0e8=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0x16e'),[_0x48c942,_0x16ef82[_0x768b('0xe2')],_0x16ef82[_0x768b('0x65')],_0x5978e7,_0x16ef82[_0x768b('0x67')],_0x16ef82[_0x768b('0xb6')],_0x16ef82[_0x768b('0x16f')],_0x16ef82['gosub'],'',_0x16ef82[_0x768b('0x170')]]);if(_0x38d0e8[_0x768b('0xac')]===-0x1){return _0x38d0e8;}return this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0xc4'),_0x768b('0x16e'),_0x48c942));};AGIVertices[_0x768b('0x12')][_0x768b('0x171')]=function(_0x43163d){logger['info'](util[_0x768b('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x43163d[_0x768b('0x36')]));var _0x333371=_0x43163d[_0x768b('0x172')]||_0x768b('0x12a');var _0x14daa7=util[_0x768b('0x27')](_0x768b('0x173'),this[_0x768b('0xf')][_0x768b('0x35')],rs[_0x768b('0x115')](0x5));var _0x22948b=util[_0x768b('0x27')](_0x768b('0x174'),FILES_PATH,_0x14daa7,_0x333371);var _0x653c5d=util['format'](_0x768b('0x133'),FILES_PATH,_0x14daa7);this['createSquareRecording'][_0x768b('0x70')](this,_0x43163d,_0x14daa7,_0x22948b);this['channel'][_0x768b('0x9e')](_0x768b('0x175'),_0x14daa7);logger[_0x768b('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x653c5d,_0x333371,_0x43163d[_0x768b('0x176')],_0x43163d[_0x768b('0x67')]);return this[_0x768b('0xf')][_0x768b('0x147')](_0x653c5d,_0x333371,_0x43163d[_0x768b('0x176')],_0x43163d[_0x768b('0x67')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x2fb6b0){logger['info'](util['format'](_0x768b('0x177'),_0x2fb6b0[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x2fb6b0[_0x768b('0x65')])){return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x178'));}var _0xa37732=this[_0x768b('0x64')]['sync'](this,_0x2fb6b0);logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x179'),util[_0x768b('0x17a')](_0xa37732,{'showHidden':![],'depth':null})));if(!this[_0x768b('0x84')](_0x2fb6b0['variable_id'])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x9f03fe=this['getVariable'][_0x768b('0x70')](this,_0x2fb6b0[_0x768b('0xd4')]);if(!_0x9f03fe){return this['channel']['error'](_0x2fb6b0,'no\x20variable\x20found');}this[_0x768b('0xf')][_0x768b('0x9e')](util[_0x768b('0x27')]('%s_STATUS_CODE',_0x9f03fe),_0xa37732['statusCode']?_0xa37732[_0x768b('0x75')]:'200');this['channel']['setVariable'](util[_0x768b('0x27')](_0x768b('0x17b'),_0x9f03fe),_0xa37732[_0x768b('0x76')]?_0xa37732[_0x768b('0x76')]:'OK');if(_0xa37732[_0x768b('0x73')]){try{this[_0x768b('0x9c')](_0xa37732[_0x768b('0x73')],_0x9f03fe);}catch(_0x48cb6c){logger[_0x768b('0x30')](util['format'](_0x768b('0x17c'),_0x9f03fe));}}return this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0xda'),_0x9f03fe));};AGIVertices[_0x768b('0x12')][_0x768b('0x17d')]=function(_0x51e7d9){logger[_0x768b('0x2c')](util[_0x768b('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x51e7d9[_0x768b('0x36')]));return this['channel']['sayDigits'](_0x51e7d9['digits']['replace'](/\s+/g,''),_0x51e7d9['escape_digits']);};AGIVertices[_0x768b('0x12')][_0x768b('0x17e')]=function(_0x5a1e24){logger['info'](util['format'](_0x768b('0x17f'),_0x5a1e24[_0x768b('0x36')]));return this[_0x768b('0xf')][_0x768b('0x180')](_0x5a1e24[_0x768b('0x68')][_0x768b('0x59')](/\s+/g,''),_0x5a1e24['escape_digits']);};AGIVertices[_0x768b('0x12')][_0x768b('0x181')]=function(_0x30a6ba){logger['info'](util[_0x768b('0x27')](_0x768b('0x182'),_0x30a6ba[_0x768b('0x36')]));return this[_0x768b('0xf')][_0x768b('0x183')](_0x30a6ba[_0x768b('0x5c')],_0x30a6ba[_0x768b('0x176')]);};AGIVertices[_0x768b('0x12')][_0x768b('0x184')]=function(_0x5bd710){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5bd710[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x5bd710['account_id'])){return this[_0x768b('0xf')]['noop'](_0x768b('0x185'));}var _0x556472=this['getMailAccount'][_0x768b('0x70')](this,_0x5bd710[_0x768b('0x186')]);if(!_0x556472||!_0x556472[_0x768b('0x187')]){return this['channel'][_0x768b('0x30')](_0x5bd710,'no\x20mail\x20account\x20found');}var _0x31993f={'from':util[_0x768b('0x27')](_0x768b('0x188'),_0x556472[_0x768b('0x14')],_0x556472[_0x768b('0x189')]||_0x556472[_0x768b('0x187')][_0x768b('0x18a')]),'to':_0x5bd710['to']||'','cc':_0x5bd710['cc']||'','bcc':_0x5bd710[_0x768b('0x18b')]||'','subject':_0x5bd710[_0x768b('0x18c')],'html':_0x5bd710['text'],'text':_0x5bd710[_0x768b('0x5c')]};if(this[_0x768b('0x84')](_0x5bd710[_0x768b('0x18d')])){}logger[_0x768b('0xdc')](_0x768b('0x18e'),JSON[_0x768b('0x72')](_0x31993f));this[_0x768b('0x34')][_0x768b('0x70')](this,_0x5bd710,_0x5bd710[_0x768b('0x186')]);this['channel'][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x18f'),_0x556472[_0x768b('0x14')]));this[_0x768b('0x21')][_0x768b('0x70')](this,_0x556472['smtpOptions'],_0x31993f);return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x190'));};AGIVertices[_0x768b('0x12')][_0x768b('0x191')]=function(_0x5179dc){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x5179dc['label']));return this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x192'));};AGIVertices[_0x768b('0x12')][_0x768b('0x193')]=function(_0x17319d){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x17319d['label']));if(!this['isConfigured'](_0x17319d[_0x768b('0x194')])){return this['channel']['noop'](_0x768b('0x195'));}var _0x25f478=this[_0x768b('0x32')][_0x768b('0x70')](this,_0x17319d[_0x768b('0x194')]);if(!_0x25f478){return this[_0x768b('0xf')][_0x768b('0x30')](_0x17319d,_0x768b('0x196'));}var _0x3ebc09={'body':_0x17319d[_0x768b('0x197')],'phone':_0x17319d['to']||'','SmsAccountId':_0x25f478['id']};logger['debug'](_0x768b('0x198'),JSON['stringify'](_0x3ebc09));this[_0x768b('0x34')][_0x768b('0x70')](this,_0x17319d,_0x17319d['sms_account_id']);this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')](_0x768b('0x199'),_0x25f478[_0x768b('0x14')]));this[_0x768b('0x33')][_0x768b('0x70')](this,_0x3ebc09);return this[_0x768b('0xf')]['noop'](_0x768b('0x19a'));};AGIVertices[_0x768b('0x12')][_0x768b('0x19b')]=function(_0xb9c2fc){logger[_0x768b('0x2c')](util['format'](_0x768b('0x19c'),_0xb9c2fc[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0xb9c2fc[_0x768b('0xd4')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0xb9c2fc,_0x768b('0x19d'));}var _0x2eeb5d=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0xb9c2fc['variable_id']);if(!_0x2eeb5d){return this['channel'][_0x768b('0x30')](_0xb9c2fc,_0x768b('0x113'));}return this[_0x768b('0xf')]['setVariable'](_0x2eeb5d,_0xb9c2fc[_0x768b('0x19e')]);};AGIVertices[_0x768b('0x12')][_0x768b('0x19f')]=function(_0x3679d8){logger['info'](util[_0x768b('0x27')](_0x768b('0x1a0'),_0x3679d8[_0x768b('0x36')]));this[_0x768b('0xf')][_0x768b('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x3679d8[_0x768b('0xbb')]==='yes'){this[_0x768b('0xf')][_0x768b('0xa9')](_0x768b('0x1a1'));return this['channel']['answer']();}return this[_0x768b('0xf')]['noop'](_0x768b('0x1a2'));};AGIVertices[_0x768b('0x12')][_0x768b('0x1a3')]=function(_0x336b1f){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x1a4'),_0x336b1f['label']));if(!this['isConfigured'](_0x336b1f[_0x768b('0x1a5')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x336b1f,_0x768b('0x1a6'));}var _0x2649c3=this['getSquareProject'][_0x768b('0x70')](this,_0x336b1f['project_id']);if(!this['isConfigured'](_0x2649c3)){return this['channel']['error'](_0x336b1f,util[_0x768b('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x336b1f['project_id']));}if(_0x2649c3===this[_0x768b('0xf')][_0x768b('0x40')]){return this[_0x768b('0xf')][_0x768b('0x30')](_0x336b1f,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x768b('0x34')][_0x768b('0x70')](this,_0x336b1f,_0x2649c3);var _0x430877=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0x1a7'),util[_0x768b('0x27')](_0x768b('0x1a8'),config[_0x768b('0xb6')][_0x768b('0x1a9')]||'127.0.0.1',_0x2649c3,this['channel'][_0x768b('0x40')]));if(_0x430877[_0x768b('0xac')]===-0x1){return _0x430877;}return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xc4'),'AGI',_0x2649c3));};AGIVertices[_0x768b('0x12')][_0x768b('0x1aa')]=function(_0x58a9b5){logger[_0x768b('0x2c')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x58a9b5[_0x768b('0x36')]));var _0x5b7f31=this[_0x768b('0x57')][_0x768b('0x70')](this,_0x58a9b5['command']);this[_0x768b('0x34')][_0x768b('0x70')](this,_0x58a9b5,_0x58a9b5[_0x768b('0xb7')]);if(this['isConfigured'](_0x58a9b5[_0x768b('0xd4')])){var _0x3e1303=this[_0x768b('0xa1')]['sync'](this,_0x58a9b5[_0x768b('0xd4')]);if(_0x3e1303){this[_0x768b('0xf')]['setVariable'](_0x3e1303,_0x5b7f31);return this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x58a9b5[_0x768b('0xb7')],_0x3e1303));}}return this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x1ab'),_0x58a9b5['command']));};AGIVertices[_0x768b('0x12')]['google_cloud_tts']=function(_0x3f97d4){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x1ac'),_0x3f97d4[_0x768b('0x36')]));_0x3f97d4[_0x768b('0x5c')]=_0x3f97d4[_0x768b('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x768b('0x84')](_0x3f97d4[_0x768b('0x5b')])){return this[_0x768b('0xf')]['noop'](_0x768b('0x1ad'));}if(!this['isConfigured'](_0x3f97d4[_0x768b('0x5c')])){return this['channel'][_0x768b('0xa9')](_0x768b('0xaa'));}this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0x1ae'),_0x3f97d4['text']));var _0x2fa285=this[_0x768b('0x5a')][_0x768b('0x70')](this,_0x3f97d4);if(_0x2fa285){this[_0x768b('0xf')][_0x768b('0xa9')](util[_0x768b('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2fa285));var _0xf03015=this[_0x768b('0xf')][_0x768b('0x101')](_0x2fa285);try{fs[_0x768b('0x102')](_0x2fa285+_0x768b('0x103'));}catch(_0x3caa2d){logger[_0x768b('0x30')](_0x3caa2d);}return _0xf03015;}return this[_0x768b('0xf')]['error'](_0x3f97d4,_0x768b('0x1af'));};AGIVertices[_0x768b('0x12')][_0x768b('0x1b0')]=function(_0x55037b){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x1b1'),_0x55037b['label']));_0x55037b['text']=_0x55037b[_0x768b('0x5c')][_0x768b('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x768b('0x84')](_0x55037b['text'])){return this[_0x768b('0xf')][_0x768b('0xa9')]('no\x20text\x20configured');}this[_0x768b('0xf')]['noop'](util[_0x768b('0x27')](_0x768b('0x1b2'),_0x55037b['text']));var _0x34b15f=this[_0x768b('0x62')]['sync'](this,_0x55037b);if(_0x34b15f){this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x1b3'),_0x34b15f));var _0x3246fa=this[_0x768b('0xf')][_0x768b('0x101')](_0x34b15f);try{fs['unlink'](_0x34b15f+_0x768b('0x103'));}catch(_0x5b0d50){logger[_0x768b('0x30')](_0x5b0d50);}return _0x3246fa;}return this[_0x768b('0xf')][_0x768b('0x30')](_0x55037b,_0x768b('0x1b4'));};AGIVertices[_0x768b('0x12')][_0x768b('0x1b5')]=function(_0x194169){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x1b6'),_0x194169[_0x768b('0x36')]));if(!this[_0x768b('0x84')](_0x194169[_0x768b('0x150')])){return this['channel'][_0x768b('0x30')](_0x194169,_0x768b('0x151'));}logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x152'),this[_0x768b('0xf')][_0x768b('0x38')],_0x194169['findBy']));var _0x559893=this[_0x768b('0x51')][_0x768b('0x70')](this,_0x194169['findBy']);if(_0x559893){logger[_0x768b('0x2c')](util[_0x768b('0x27')](_0x768b('0x153'),this['channel']['callerid'],_0x194169[_0x768b('0x150')]));this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x153'),this['channel'][_0x768b('0x38')],_0x194169[_0x768b('0x150')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x768b('0x155'),this[_0x768b('0xf')][_0x768b('0x38')],_0x194169[_0x768b('0x150')]));this[_0x768b('0xf')][_0x768b('0xa9')](util['format'](_0x768b('0x155'),this[_0x768b('0xf')]['callerid'],_0x194169[_0x768b('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x768b('0x12')][_0x768b('0x1b7')]=function(_0x320001){logger['info'](util[_0x768b('0x27')](_0x768b('0x1b8'),_0x320001[_0x768b('0x36')]));var _0x4e9d0c=this[_0x768b('0xf')][_0x768b('0x58')](_0x768b('0x1b9'),[_0x320001[_0x768b('0x1ba')],_0x320001['options']]);if(_0x4e9d0c[_0x768b('0xac')]===-0x1){return _0x4e9d0c;}return this['channel'][_0x768b('0xa9')](util[_0x768b('0x27')](_0x768b('0xc4'),_0x768b('0x1b9'),_0x320001[_0x768b('0x1ba')]));};AGIVertices[_0x768b('0x12')]['vswitch']=function(_0x2a0436){logger[_0x768b('0x2c')](util['format'](_0x768b('0x1bb'),_0x2a0436[_0x768b('0x36')]));if(!this['isConfigured'](_0x2a0436[_0x768b('0xd4')])){return this[_0x768b('0xf')][_0x768b('0x30')](_0x2a0436,'no\x20variable\x20selected');}var _0x4f8b41=this[_0x768b('0xa1')][_0x768b('0x70')](this,_0x2a0436[_0x768b('0xd4')]);if(!_0x4f8b41){return this[_0x768b('0xf')][_0x768b('0x30')](_0x2a0436,_0x768b('0x113'));}var _0x3a40=this[_0x768b('0xf')]['getVariable'](_0x4f8b41);return{'code':0xc8,'result':_0x3a40[_0x768b('0xa4')]?_0x3a40[_0x768b('0xa4')]:'-'};};String[_0x768b('0x12')][_0x768b('0xa0')]=function(_0x887d40,_0x1c4fd4){return this[_0x768b('0x9f')](_0x887d40)['join'](_0x1c4fd4);};module[_0x768b('0x1bc')]=AGIVertices; \ No newline at end of file +var _0x22a4=['exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','name','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','mailRpc','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','priority','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentUnpause','agentLogout','agentLogin','internal','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isArray','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','grammar','no\x20grammar\x20configured','exec','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','out','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','variable_id','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','extension','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','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','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','agentPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','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','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join'];(function(_0x43837e,_0x1117b9){var _0x1a8c4b=function(_0x283931){while(--_0x283931){_0x43837e['push'](_0x43837e['shift']());}};_0x1a8c4b(++_0x1117b9);}(_0x22a4,0x1cb));var _0x422a=function(_0x40e06e,_0x330b9a){_0x40e06e=_0x40e06e-0x0;var _0x382c2b=_0x22a4[_0x40e06e];return _0x382c2b;};'use strict';var fs=require('fs');var util=require(_0x422a('0x0'));var _=require(_0x422a('0x1'));var sh=require(_0x422a('0x2'));var odbc=require(_0x422a('0x3'))();var rs=require(_0x422a('0x4'));var moment=require(_0x422a('0x5'));var Mustache=require(_0x422a('0x6'));var rp=require(_0x422a('0x7'));var logger=require('../../config/logger')(_0x422a('0x8'));var config=require(_0x422a('0x9'));var shared=require(_0x422a('0xa'));var scripts=require(_0x422a('0xb'));var FILES_PATH=_0x422a('0xc');var recursiveMapAttributes=['rawHeaders',_0x422a('0xd')];var verticesWithRetry=[_0x422a('0xe'),_0x422a('0xf'),_0x422a('0x10')];var AGIVertices=function(_0x3f785b,_0x3ad391,_0x317466){this[_0x422a('0x11')]=_0x3f785b;this['rpc']=_0x3ad391;this['mailRpc']=_0x317466;};AGIVertices[_0x422a('0x12')][_0x422a('0x13')]=function(_0x1ce3a7,_0x3261a7){this[_0x422a('0x14')][_0x422a('0x15')](_0x1ce3a7)['then'](function(_0x489953){_0x3261a7(null,_0x489953?_0x489953[_0x422a('0x16')]:![]);})['catch'](function(_0x5a0c59){_0x3261a7(_0x5a0c59);});};AGIVertices['prototype'][_0x422a('0x17')]=function(_0xe43bbf,_0x11af1f){this[_0x422a('0x14')][_0x422a('0x18')](_0xe43bbf)[_0x422a('0x19')](function(_0x3bfb41){_0x11af1f(null,_0x3bfb41?_0x3bfb41[_0x422a('0x16')]:![]);})[_0x422a('0x1a')](function(_0x2ba53b){_0x11af1f(_0x2ba53b);});};AGIVertices[_0x422a('0x12')][_0x422a('0x1b')]=function(_0x39c6a3,_0x3d5033){this[_0x422a('0x14')][_0x422a('0x1c')](_0x39c6a3)[_0x422a('0x19')](function(_0x5e2507){_0x3d5033(null,_0x5e2507?_0x5e2507[_0x422a('0x16')]:![]);})[_0x422a('0x1a')](function(_0x5b29fc){_0x3d5033(_0x5b29fc);});};AGIVertices[_0x422a('0x12')]['getSquareOdbc']=function(_0x552048,_0x3ef74f){this[_0x422a('0x14')][_0x422a('0x1d')](_0x552048)[_0x422a('0x19')](function(_0x194c25){_0x3ef74f(null,_0x194c25?_0x194c25[_0x422a('0x1e')]:![]);})[_0x422a('0x1a')](function(_0x26922a){_0x3ef74f(_0x26922a);});};AGIVertices['prototype'][_0x422a('0x1f')]=function(_0x3284ed,_0x211d93){this[_0x422a('0x14')][_0x422a('0x20')](_0x3284ed)['then'](function(_0x837c81){_0x211d93(null,_0x837c81?_0x837c81[_0x422a('0x16')]:![]);})[_0x422a('0x1a')](function(_0x5e3138){_0x211d93(_0x5e3138);});};AGIVertices[_0x422a('0x12')][_0x422a('0x21')]=function(_0x1fd126,_0xcc5ead){this[_0x422a('0x14')][_0x422a('0x22')](_0x1fd126)[_0x422a('0x19')](function(_0xe39bf5){_0xcc5ead(null,_0xe39bf5?_0xe39bf5['name']:![]);})[_0x422a('0x1a')](function(_0x15d2ab){_0xcc5ead(_0x15d2ab);});};AGIVertices['prototype'][_0x422a('0x23')]=function(_0x49d75f,_0x1b88ae){var _0xad42b4=this;this[_0x422a('0x14')][_0x422a('0x24')](_0x49d75f)['then'](function(_0x3cb362){_0x1b88ae(null,_0x3cb362?_0xad42b4[_0x422a('0x25')](_0x3cb362['save_name']):![]);})['catch'](function(_0x3414ad){_0x1b88ae(_0x3414ad);});};AGIVertices[_0x422a('0x12')]['getMailAccount']=function(_0x494226,_0x4903d1){this['rpc']['getMailAccountById'](_0x494226)[_0x422a('0x19')](function(_0x2fd9f8){_0x4903d1(null,_0x2fd9f8?_0x2fd9f8:![]);})[_0x422a('0x1a')](function(_0x2aaa9c){_0x4903d1(_0x2aaa9c);});};AGIVertices[_0x422a('0x12')]['sendMailMessage']=function(_0x145722,_0x8d8842,_0x1edfe4){this[_0x422a('0x26')][_0x422a('0x27')](_0x145722,_0x8d8842)[_0x422a('0x19')](function(){_0x1edfe4(null);})[_0x422a('0x1a')](function(_0x55dc4c){_0x1edfe4(_0x55dc4c);});};AGIVertices[_0x422a('0x12')][_0x422a('0x28')]=function(_0x3bf7c6,_0x3d650c){this['rpc'][_0x422a('0x29')](_0x3bf7c6)['then'](function(_0x1575db){if(_0x1575db){if(_0x1575db[_0x422a('0x2a')]){_0x3d650c(null,[_0x1575db['interval']]);}else{_0x3d650c(null,_[_0x422a('0x2b')](_0x1575db[_0x422a('0x2c')],'interval'));}}else{_0x3d650c(null,![]);}})[_0x422a('0x1a')](function(_0x2da03a){_0x3d650c(_0x2da03a);});};AGIVertices[_0x422a('0x12')][_0x422a('0x25')]=function(_0x1e2116){return util[_0x422a('0x2d')](_0x422a('0x2e'),FILES_PATH,_0x1e2116);};AGIVertices[_0x422a('0x12')]['getQueryOdbc']=function(_0x56f6fb,_0x36328a,_0xb1b1d8){odbc[_0x422a('0x2f')](_0x56f6fb,function(_0x4beffb){if(_0x4beffb){logger[_0x422a('0x30')](_0x422a('0x31'),_0x4beffb);_0xb1b1d8(_0x4beffb);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x422a('0x32')](_0x36328a,function(_0x5567f8,_0x4095d5){if(_0x5567f8){logger[_0x422a('0x33')](_0x422a('0x34'),_0x36328a);_0xb1b1d8(_0x5567f8);}else{logger['info'](_0x422a('0x35'),_0x36328a);odbc[_0x422a('0x36')](function(_0x3df5ac){if(_0x3df5ac){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3df5ac);}_0xb1b1d8(null,_0x4095d5);});}});}});};AGIVertices[_0x422a('0x12')][_0x422a('0x37')]=function(_0x226638,_0x5b3639){this[_0x422a('0x14')][_0x422a('0x38')](_0x226638)[_0x422a('0x19')](function(_0x4388b6){_0x5b3639(null,_0x4388b6?_0x4388b6:![]);})[_0x422a('0x1a')](function(_0x590c9b){_0x5b3639(_0x590c9b);});};AGIVertices[_0x422a('0x12')][_0x422a('0x39')]=function(_0x411a86,_0x155673){this[_0x422a('0x14')]['createSmsMessage'](_0x411a86)['then'](function(_0x2b700d){_0x155673(null,_0x2b700d);})['catch'](function(_0x4c2e63){_0x155673(_0x4c2e63);});};AGIVertices[_0x422a('0x12')][_0x422a('0x3a')]=function(_0x10302c,_0x474255,_0x1e010c){this[_0x422a('0x14')]['createSquareDetailsReport']({'uniqueid':this[_0x422a('0x11')][_0x422a('0x3b')],'node':_0x10302c[_0x422a('0x3c')],'application':_0x10302c[_0x422a('0x3d')],'data':_0x474255||null,'project_name':this[_0x422a('0x11')][_0x422a('0x3e')],'callerid':this[_0x422a('0x11')]['callerid']})[_0x422a('0x19')](function(_0x337038){if(_0x1e010c){_0x1e010c(null,_0x337038);}})['catch'](function(_0x8e988e){if(_0x1e010c){_0x1e010c(_0x8e988e);}});};AGIVertices[_0x422a('0x12')][_0x422a('0x3f')]=function(_0xc7e33,_0x3387c1,_0x1b2c55,_0x243989){this['rpc'][_0x422a('0x3f')]({'uniqueid':this[_0x422a('0x11')][_0x422a('0x3b')],'callerid':this[_0x422a('0x11')][_0x422a('0x40')],'calleridname':this[_0x422a('0x11')][_0x422a('0x41')],'context':this[_0x422a('0x11')][_0x422a('0x42')],'extension':this[_0x422a('0x11')]['extension'],'priority':this['channel'][_0x422a('0x43')],'accountcode':this[_0x422a('0x11')]['accountcode'],'dnid':this[_0x422a('0x11')][_0x422a('0x44')],'projectName':this[_0x422a('0x11')][_0x422a('0x3e')],'saveName':_0x3387c1,'filename':_0xc7e33[_0x422a('0x45')]||_0x3387c1,'savePath':_0x1b2c55})[_0x422a('0x19')](function(_0x2c8f29){_0x243989(null,_0x2c8f29);})[_0x422a('0x1a')](function(_0x34a739){_0x243989(_0x34a739);});};AGIVertices[_0x422a('0x12')]['createSquareMessage']=function(_0x565c6f,_0xedc7dc,_0x1f5066,_0x553ab8,_0x31da56){this[_0x422a('0x14')][_0x422a('0x46')]({'uniqueid':this[_0x422a('0x11')][_0x422a('0x3b')],'body':_0x565c6f,'direction':_0xedc7dc,'providerName':_0x1f5066,'providerResponse':_0x553ab8})[_0x422a('0x19')](function(_0x3a98cb){if(_0x31da56){_0x31da56(null,_0x3a98cb);}})['catch'](function(_0x399ead){if(_0x31da56){_0x31da56(_0x399ead);}});};AGIVertices[_0x422a('0x12')][_0x422a('0x47')]=function(_0x41deb3,_0x139d54){this[_0x422a('0x14')]['createCmContact']({'firstName':_['isEmpty'](_0x41deb3[_0x422a('0x16')])||_[_0x422a('0x48')](_0x41deb3[_0x422a('0x16')])?_0x422a('0x49')+Math[_0x422a('0x4a')]():_0x41deb3[_0x422a('0x16')],'lastName':_[_0x422a('0x4b')](_0x41deb3[_0x422a('0x4c')])||_[_0x422a('0x48')](_0x41deb3['lastName'])?null:_0x41deb3['lastName'],'phone':_0x41deb3['phone'],'ListId':_0x41deb3[_0x422a('0x4d')],'scheduledat':_0x41deb3[_0x422a('0x4e')],'callbackUniqueid':this[_0x422a('0x11')][_0x422a('0x3b')],'tags':'callback','description':_0x422a('0x4f')+_0x41deb3[_0x422a('0x4e')][_0x422a('0x50')](),'priority':_0x41deb3[_0x422a('0x51')]})[_0x422a('0x19')](function(_0x1f2834){_0x139d54(null,_0x1f2834);})['catch'](function(_0x5d7328){_0x139d54(_0x5d7328);});};AGIVertices[_0x422a('0x12')][_0x422a('0x52')]=function(_0x41d1c5,_0x5f2ea9){this[_0x422a('0x14')]['getPauseById'](_0x41d1c5)[_0x422a('0x19')](function(_0x12df25){_0x5f2ea9(null,_0x12df25?_0x12df25['name']:![]);})['catch'](function(_0x396809){_0x5f2ea9(_0x396809);});};AGIVertices[_0x422a('0x12')]['agentPause']=function(_0x34ebe5,_0x79c401,_0xe46b80){var _0xc006ef={'role':_0x422a('0x53')};_0xc006ef[_0x34ebe5]=this[_0x422a('0x11')][_0x422a('0x40')];this[_0x422a('0x14')]['agentPause'](_0xc006ef,_0x79c401,this['channel'][_0x422a('0x3b')])[_0x422a('0x19')](function(_0x167679){_0xe46b80(null,_[_0x422a('0x48')](_0x167679)?![]:!![]);})[_0x422a('0x1a')](function(_0x5398fd){logger['error'](_0x5398fd);_0xe46b80(null,![]);});};AGIVertices[_0x422a('0x12')][_0x422a('0x54')]=function(_0x197106,_0x39c9f4){var _0x580207={'role':_0x422a('0x53')};_0x580207[_0x197106]=this['channel']['callerid'];this['rpc'][_0x422a('0x54')](_0x580207)[_0x422a('0x19')](function(_0x381cf9){_0x39c9f4(null,_[_0x422a('0x48')](_0x381cf9)?![]:!![]);})['catch'](function(_0x34fcd2){logger[_0x422a('0x30')](_0x34fcd2);_0x39c9f4(null,![]);});};AGIVertices[_0x422a('0x12')][_0x422a('0x55')]=function(_0x333100,_0x21a2c3){var _0x524d68={'role':_0x422a('0x53')};_0x524d68[_0x333100]=this[_0x422a('0x11')][_0x422a('0x40')];this[_0x422a('0x14')][_0x422a('0x55')](_0x524d68)[_0x422a('0x19')](function(_0x5e59b4){_0x21a2c3(null,_['isNil'](_0x5e59b4)?![]:!![]);})[_0x422a('0x1a')](function(_0x27255c){logger[_0x422a('0x30')](_0x27255c);_0x21a2c3(null,![]);});};AGIVertices[_0x422a('0x12')][_0x422a('0x56')]=function(_0x174b1d,_0x381440){var _0x259433={'role':_0x422a('0x53')};_0x259433[_0x174b1d]=this['channel'][_0x422a('0x40')];var _0x1f1935=_0x174b1d!=_0x422a('0x57')?util['format']('%s/%s@from-sip/n','LOCAL',this[_0x422a('0x11')][_0x422a('0x40')]):undefined;this[_0x422a('0x14')][_0x422a('0x56')](_0x259433,_0x1f1935)[_0x422a('0x19')](function(_0x3f8b89){_0x381440(null,_[_0x422a('0x48')](_0x3f8b89)?![]:!![]);})[_0x422a('0x1a')](function(_0x42f08d){logger[_0x422a('0x30')](_0x42f08d);_0x381440(null,![]);});};AGIVertices[_0x422a('0x12')]['shellCommand']=function(_0x38e87a,_0xeaff7){sh['exec'](_[_0x422a('0x58')](_0x38e87a),function(_0x28bbdb,_0x265ea6){var _0x29dbc8=_0x265ea6['replace'](/(\r\n|\n|\r)/gm,'');_0xeaff7(null,_0x29dbc8);});};AGIVertices[_0x422a('0x12')]['googleCloudTTS']=function(_0x24937a,_0x51f204){scripts[_0x422a('0x59')](_0x24937a[_0x422a('0x5a')],_0x24937a[_0x422a('0x5b')]||_0x422a('0x5c'),_0x24937a[_0x422a('0x5c')],_0x24937a[_0x422a('0x5d')]||_0x422a('0x5e'),_0x24937a[_0x422a('0x5f')]||_0x422a('0x60'),_0x24937a[_0x422a('0x61')]||_0x422a('0x62'))[_0x422a('0x19')](function(_0x23d653){_0x51f204(null,_0x23d653);})['catch'](function(_0x506b3b){_0x51f204(_0x506b3b);});};AGIVertices[_0x422a('0x12')][_0x422a('0x63')]=function(_0x4f5acc,_0x5de838){scripts[_0x422a('0x63')](_0x4f5acc[_0x422a('0x5c')],_0x4f5acc[_0x422a('0x64')]||'en',0x1)['then'](function(_0x5c5f67){_0x5de838(null,_0x5c5f67);})[_0x422a('0x1a')](function(_0x53f7bb){_0x5de838(_0x53f7bb);});};AGIVertices['prototype'][_0x422a('0x65')]=function(_0x981bca,_0x2bbcd3){var _0x26d32f={'uri':_0x981bca[_0x422a('0x66')],'method':_0x981bca['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x981bca[_0x422a('0x67')])===_0x422a('0x68')&&parseInt(_0x981bca['timeout'])>=0x1?parseInt(_0x981bca[_0x422a('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x422a('0x69')]([_0x422a('0x6a'),'PUT'],_0x26d32f[_0x422a('0x6b')][_0x422a('0x6c')]())){try{_0x26d32f[_0x422a('0x6d')]=_0x981bca[_0x422a('0xd')]?JSON[_0x422a('0x6e')](_0x981bca[_0x422a('0xd')]):{};}catch(_0x36892f){logger['error'](_0x422a('0x6f'),_0x36892f);}}try{_0x26d32f[_0x422a('0x70')]=_0x981bca[_0x422a('0x71')]?JSON[_0x422a('0x6e')](_0x981bca[_0x422a('0x71')]):{};}catch(_0x5c87f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5c87f);}if(_0x981bca[_0x422a('0x72')]){try{var _0x345444=require(_0x981bca['computedVariables'])[_0x422a('0x73')](this,_0x26d32f);_0x26d32f[_0x422a('0x74')]=Mustache[_0x422a('0x75')](_0x981bca[_0x422a('0x66')],_0x345444,{},['$$','$$']);if(_0x26d32f[_0x422a('0x70')]){_0x26d32f['headers']=JSON['parse'](Mustache['render'](JSON[_0x422a('0x76')](_0x26d32f[_0x422a('0x70')]),_0x345444,{},['$$','$$']));}if(_0x26d32f[_0x422a('0x6d')]){_0x26d32f['body']=JSON[_0x422a('0x6e')](Mustache[_0x422a('0x75')](JSON[_0x422a('0x76')](_0x26d32f['body']),_0x345444,{},['$$','$$']));}}catch(_0x2012ab){logger[_0x422a('0x30')](_0x422a('0x77'),_0x2012ab);}}rp(_0x26d32f)['then'](function(_0xd6fb30){var _0x1ce86c={'statusCode':_0xd6fb30[_0x422a('0x78')]||0xc8,'statusMessage':_0xd6fb30[_0x422a('0x79')]||'OK','headers':_0xd6fb30[_0x422a('0x70')]||{},'body':_0xd6fb30[_0x422a('0x6d')]||{}};_0x2bbcd3(null,_0x1ce86c);})['catch'](function(_0x513626){var _0x58d0fe={'statusCode':_0x513626[_0x422a('0x78')]||0x1f4,'statusMessage':_0x513626['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x513626['options']['headers']||{},'body':_0x513626[_0x422a('0x7a')]['body']||{}};_0x2bbcd3(null,_0x58d0fe);});};AGIVertices[_0x422a('0x12')][_0x422a('0x7b')]=function(_0x1a8c29,_0x1998a7){scripts[_0x422a('0x7b')](this[_0x422a('0x11')][_0x422a('0x3b')],_0x1a8c29[_0x422a('0x7c')],_0x1a8c29[_0x422a('0x5c')],_0x1a8c29[_0x422a('0x7d')]||'en')[_0x422a('0x19')](function(_0x442d96){_0x1998a7(null,_0x442d96);})[_0x422a('0x1a')](function(_0x15ccda){_0x1998a7(_0x15ccda);});};AGIVertices['prototype'][_0x422a('0x7e')]=function(_0x1e86ae,_0x93d934){scripts[_0x422a('0x7e')](this['channel'][_0x422a('0x3b')],_0x1e86ae[_0x422a('0x7f')],_0x1e86ae['client_email'],_0x1e86ae[_0x422a('0x80')],_0x1e86ae[_0x422a('0x5c')],_0x1e86ae['dialogflowV2_language']||'en')[_0x422a('0x19')](function(_0x5d290b){_0x93d934(null,_0x5d290b);})['catch'](function(_0x4ec23f){_0x93d934(_0x4ec23f);});};AGIVertices[_0x422a('0x12')][_0x422a('0x81')]=function(_0x555aa7,_0x383a2c){scripts[_0x422a('0x81')](this[_0x422a('0x11')],_0x555aa7)['then'](function(_0x4f3e56){_0x383a2c(null,_0x4f3e56);})[_0x422a('0x1a')](function(_0x1d1b5e){_0x383a2c(_0x1d1b5e);});};AGIVertices[_0x422a('0x12')][_0x422a('0x82')]=function(_0x450544,_0x21d6cb){scripts['ispeechTTS'](_0x450544[_0x422a('0x7c')],_0x450544[_0x422a('0x5c')],_0x450544[_0x422a('0x83')]||'en-US',_0x450544[_0x422a('0x84')])[_0x422a('0x19')](function(_0x3906f1){_0x21d6cb(null,_0x3906f1);})[_0x422a('0x1a')](function(_0xd9685a){_0x21d6cb(_0xd9685a);});};AGIVertices[_0x422a('0x12')][_0x422a('0x85')]=function(_0x5b3f89,_0x2d28b4,_0x4af932){scripts['ispeechASR'](_0x2d28b4,_0x5b3f89['key'],_0x5b3f89[_0x422a('0x86')]||_0x422a('0x5e'),this[_0x422a('0x87')](_0x5b3f89['model'])?_0x5b3f89[_0x422a('0x88')]:undefined)[_0x422a('0x19')](function(_0x42bec3){_0x4af932(null,_0x42bec3);})['catch'](function(_0x5ebd39){_0x4af932(_0x5ebd39);});};AGIVertices[_0x422a('0x12')][_0x422a('0x89')]=function(_0x2e9c08,_0x1732ff){scripts['awsPolly'](_0x2e9c08[_0x422a('0x8a')],_0x2e9c08[_0x422a('0x8b')],_0x2e9c08[_0x422a('0x8c')],_0x2e9c08[_0x422a('0x8d')]||'Amy',_0x2e9c08[_0x422a('0x5c')],_0x2e9c08[_0x422a('0x8e')]||'text')[_0x422a('0x19')](function(_0x54c5f6){_0x1732ff(null,_0x54c5f6);})[_0x422a('0x1a')](function(_0x30d559){_0x1732ff(_0x30d559);});};AGIVertices[_0x422a('0x12')][_0x422a('0x8f')]=function(_0x297dd8,_0x280b1e){scripts[_0x422a('0x8f')](this[_0x422a('0x11')][_0x422a('0x3b')],_0x297dd8[_0x422a('0x8a')],_0x297dd8[_0x422a('0x8b')],_0x297dd8[_0x422a('0x90')],_0x297dd8['text'],_0x297dd8[_0x422a('0x91')])[_0x422a('0x19')](function(_0x1c0ce1){_0x280b1e(null,_0x1c0ce1);})['catch'](function(_0x376632){_0x280b1e(_0x376632);});};AGIVertices[_0x422a('0x12')][_0x422a('0x92')]=function(_0x4b79a9,_0x15e661,_0x3216ff){scripts[_0x422a('0x92')](_0x15e661,_0x4b79a9[_0x422a('0x7c')],_0x4b79a9[_0x422a('0x93')]||_0x422a('0x5e'))['then'](function(_0x32a03e){_0x3216ff(null,_0x32a03e);})[_0x422a('0x1a')](function(_0x12c454){_0x3216ff(_0x12c454);});};AGIVertices[_0x422a('0x12')]['tildeASR']=function(_0x21cf22,_0x607341,_0x4d2565){scripts[_0x422a('0x94')](_0x607341,_0x21cf22[_0x422a('0x95')],_0x21cf22[_0x422a('0x96')],_0x21cf22[_0x422a('0x74')])[_0x422a('0x19')](function(_0x1c0f3a){_0x4d2565(null,_0x1c0f3a);})['catch'](function(_0x233c81){_0x4d2565(_0x233c81);});};AGIVertices[_0x422a('0x12')][_0x422a('0x97')]=function(_0x33b317){var _0x5b003a=_[_0x422a('0x69')](verticesWithRetry,_0x33b317[_0x422a('0x3d')])?_0x33b317:_[_0x422a('0x98')](_0x33b317);for(var _0x18cc8a in _0x5b003a){if(_0x5b003a[_0x422a('0x99')](_0x18cc8a)){if(_0x5b003a[_0x18cc8a]&&_[_0x422a('0x9a')](_0x5b003a[_0x18cc8a])){if(_['includes'](recursiveMapAttributes,_0x18cc8a)){_0x5b003a[_0x18cc8a]=this[_0x422a('0x9b')](_0x5b003a[_0x18cc8a]);}else{_0x5b003a[_0x18cc8a]=this['replaceAllVariables'](_0x5b003a[_0x18cc8a]);}}}}return _0x5b003a;};AGIVertices[_0x422a('0x12')][_0x422a('0x9c')]=function(_0x1b79f8){for(var _0x3ab2a0 in _0x1b79f8){if(_0x1b79f8[_0x422a('0x99')](_0x3ab2a0)){if(_['isPlainObject'](_0x1b79f8[_0x3ab2a0])){this[_0x422a('0x9c')](_0x1b79f8[_0x3ab2a0]);}else if(_[_0x422a('0x9d')](_0x1b79f8[_0x3ab2a0])){for(var _0x9081a5=0x0;_0x9081a5<_0x1b79f8[_0x3ab2a0]['length'];_0x9081a5++){this[_0x422a('0x9c')](_0x1b79f8[_0x3ab2a0][_0x9081a5]);}}else if(_['isString'](_0x1b79f8[_0x3ab2a0])){_0x1b79f8[_0x3ab2a0]=this[_0x422a('0x9e')](_0x1b79f8[_0x3ab2a0]);}}}};AGIVertices[_0x422a('0x12')][_0x422a('0x9f')]=function(_0x32a935,_0x1c0c21){for(var _0x28f957 in _0x32a935){if(_0x32a935['hasOwnProperty'](_0x28f957)){if(_[_0x422a('0xa0')](_0x32a935[_0x28f957])){if(!_[_0x422a('0x4b')](_0x32a935[_0x28f957])){this[_0x422a('0x9f')](_0x32a935[_0x28f957],util['format'](_0x422a('0xa1'),_0x1c0c21,_0x28f957));}}else if(_['isArray'](_0x32a935[_0x28f957])){for(var _0x1464b8=0x0;_0x1464b8<_0x32a935[_0x28f957]['length'];_0x1464b8++){this[_0x422a('0x9f')](_0x32a935[_0x28f957][_0x1464b8],util[_0x422a('0x2d')]('%s.%s',_0x1c0c21,_0x28f957+'['+_0x1464b8+']'));}}else{if(!_[_0x422a('0x48')](_0x32a935[_0x28f957])){this[_0x422a('0x11')]['setVariable'](util[_0x422a('0x2d')](_0x422a('0xa1'),_0x1c0c21,_0x28f957),_0x32a935[_0x28f957]);}}}}};AGIVertices[_0x422a('0x12')][_0x422a('0x9b')]=function(_0x226606){try{var _0x64ccb9=JSON[_0x422a('0x6e')](_0x226606);this[_0x422a('0x9c')](_0x64ccb9);return JSON[_0x422a('0x76')](_0x64ccb9);}catch(_0x584a40){return this['replaceAllVariables'](_0x226606);}};AGIVertices['prototype'][_0x422a('0x9e')]=function(_0x277019){var _0x3a532c=_0x277019[_0x422a('0xa2')]('{');for(var _0x3b580b=0x1;_0x3b580b<_0x3a532c[_0x422a('0xa3')];_0x3b580b+=0x1){var _0x191c5f=_0x3a532c[_0x3b580b][_0x422a('0xa2')]('}');if(_0x191c5f[_0x422a('0xa3')]>0x1){_0x277019=_0x277019[_0x422a('0xa4')]('{'+_0x191c5f[0x0]+'}',this[_0x422a('0x11')][_0x422a('0x13')](_0x191c5f[0x0])[_0x422a('0xa5')]||_0x191c5f[0x0]);}}if(_0x3a532c[_0x422a('0xa3')]===0x1){return _0x277019[_0x422a('0x50')]();}return this[_0x422a('0x9e')](_0x277019);};AGIVertices[_0x422a('0x12')][_0x422a('0xa6')]=function(_0x2df36d,_0x27b2d0){var _0xf0ca7a=this[_0x422a('0x11')][_0x422a('0x13')](_0x2df36d);if(_0xf0ca7a[_0x422a('0xa7')]===-0x1){return _0xf0ca7a;}logger['info'](util['format'](_0x422a('0xa8'),_0x27b2d0,_0xf0ca7a[_0x422a('0xa5')]));return this['channel'][_0x422a('0xa9')](_0x27b2d0,_0xf0ca7a['extra']);};AGIVertices[_0x422a('0x12')][_0x422a('0x87')]=function(_0x4466bd){return _0x4466bd&&_0x4466bd!=='0'&&_0x4466bd!=='-1'&&_0x4466bd!=='';};AGIVertices[_0x422a('0x12')][_0x422a('0xaa')]=function(_0x49ad65){this[_0x422a('0x3a')][_0x422a('0x73')](this,_0x49ad65,'-');_0x49ad65[_0x422a('0xab')]=_0x49ad65['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x422a('0x12')][_0x422a('0xac')]=function(_0x13ef68){logger['info'](util[_0x422a('0x2d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x13ef68[_0x422a('0x3c')]));if(!this['isConfigured'](_0x13ef68[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xae'));}var _0x1d53fe='\x22'+_0x13ef68[_0x422a('0x5c')]+'\x22';if(this[_0x422a('0x87')](_0x13ef68[_0x422a('0x7a')])){_0x1d53fe+=','+_0x13ef68[_0x422a('0x7a')];}var _0x1dc6a9=this[_0x422a('0x11')]['exec'](_0x422a('0xaf'),_0x1d53fe);if(_0x1dc6a9[_0x422a('0xa7')]===-0x1){return _0x1dc6a9;}return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1d53fe));};AGIVertices['prototype']['mrcprecog']=function(_0x275e98){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x275e98[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x275e98[_0x422a('0xb0')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xb1'));}var _0x495daa=_0x275e98[_0x422a('0xb0')];if(this[_0x422a('0x87')](_0x275e98['options'])){_0x495daa+=','+_0x275e98[_0x422a('0x7a')];}var _0x90b893=this[_0x422a('0x11')][_0x422a('0xb2')]('MRCPRecog',_0x495daa);if(_0x90b893[_0x422a('0xa7')]===-0x1){return _0x90b893;}var _0x1418b9=this[_0x422a('0xa6')](_0x422a('0xb3'),_0x422a('0xb4'));if(_0x1418b9[_0x422a('0xa7')]===-0x1){return _0x1418b9;}var _0x4bb4b1=this['getAndSetVariable']('RECOG_INPUT()',_0x422a('0xb5'));if(_0x4bb4b1[_0x422a('0xa7')]===-0x1){return _0x4bb4b1;}var _0x187268=this[_0x422a('0xa6')]('RECOG_INSTANCE()',_0x422a('0xb6'));if(_0x187268['result']===-0x1){return _0x187268;}return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xb7'),_0x495daa));};AGIVertices[_0x422a('0x12')][_0x422a('0x8')]=function(_0x382585){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xb8'),_0x382585[_0x422a('0x3c')]));return this['channel'][_0x422a('0x8')]([_0x382585[_0x422a('0xb9')],_0x382585['args']]);};AGIVertices['prototype'][_0x422a('0xba')]=function(_0x149629){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xbb'),_0x149629[_0x422a('0x3c')]));if(this[_0x422a('0x87')](_0x149629[_0x422a('0x67')])){logger[_0x422a('0x33')](util['format'](_0x422a('0xbc'),_0x149629['timeout']));var _0x40fa24=this[_0x422a('0x11')][_0x422a('0xbd')](_0x149629[_0x422a('0x67')]);if(_0x40fa24['result']===-0x1){return _0x40fa24;}}return this[_0x422a('0x11')][_0x422a('0xba')]();};AGIVertices[_0x422a('0x12')][_0x422a('0xbe')]=function(_0x328f73){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xbf'),_0x328f73[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x328f73['list_id'])){return this['channel'][_0x422a('0x30')](_0x328f73,_0x422a('0xc0'));}_0x328f73[_0x422a('0x4e')]=moment();if(this[_0x422a('0x87')](_0x328f73[_0x422a('0xc1')])){_0x328f73['scheduledAt']=moment()[_0x422a('0xc2')](_0x328f73[_0x422a('0xc1')],_0x422a('0xc3'));}if(!this[_0x422a('0x87')](_0x328f73[_0x422a('0x51')])){_0x328f73['callback_priority']=0x2;}this['createCmContact'][_0x422a('0x73')](this,_0x328f73);return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xc4'),_0x328f73[_0x422a('0xc5')],_0x328f73[_0x422a('0x4d')],_0x328f73[_0x422a('0x4e')]));};AGIVertices[_0x422a('0x12')]['custom_app']=function(_0x380588){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xc6'),_0x380588['label']));var _0x1389c9=this[_0x422a('0x11')]['exec'](_0x380588[_0x422a('0xc7')],_0x380588['options']);if(_0x1389c9[_0x422a('0xa7')]===-0x1){return _0x1389c9;}return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xc8'),_0x380588[_0x422a('0xc7')],_0x380588['options']));};AGIVertices[_0x422a('0x12')]['lumenvoxtts']=function(_0xa13b4f){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0xa13b4f['label']));if(!this[_0x422a('0x87')](_0xa13b4f[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20text\x20configured');}var _0x18eceb='\x22'+_0xa13b4f[_0x422a('0x5c')]+'\x22';if(this[_0x422a('0x87')](_0xa13b4f[_0x422a('0x7a')])){_0x18eceb+=','+_0xa13b4f[_0x422a('0x7a')];}var _0x336862=this[_0x422a('0x11')][_0x422a('0xb2')](_0x422a('0xaf'),_0x18eceb);if(_0x336862[_0x422a('0xa7')]===-0x1){return _0x336862;}return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xc9'),_0x18eceb));};AGIVertices['prototype'][_0x422a('0xca')]=function(_0x4e7515){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xcb'),_0x4e7515[_0x422a('0x3c')]));if(!this['isConfigured'](_0x4e7515['text'])){return this['channel'][_0x422a('0xad')](_0x422a('0xae'));}var _0x1fc6fa='\x22'+_0x4e7515['text']+'\x22';if(this[_0x422a('0x87')](_0x4e7515[_0x422a('0x7a')])){_0x1fc6fa+=','+_0x4e7515['options'];}var _0x233a59=this[_0x422a('0x11')][_0x422a('0xb2')](_0x422a('0xaf'),_0x1fc6fa);if(_0x233a59[_0x422a('0xa7')]===-0x1){return _0x233a59;}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xc9'),_0x1fc6fa));};AGIVertices[_0x422a('0x12')]['lumenvoxasr']=function(_0x2af271){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2af271[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x2af271[_0x422a('0xb0')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xb1'));}var _0x15a283=_0x2af271[_0x422a('0xb0')];if(this['isConfigured'](_0x2af271['options'])){_0x15a283+=','+_0x2af271['options'];}var _0x15e42c=this[_0x422a('0x11')]['exec'](_0x422a('0xcc'),_0x15a283);if(_0x15e42c['result']===-0x1){return _0x15e42c;}var _0x5e4d28=this[_0x422a('0xa6')](_0x422a('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5e4d28['result']===-0x1){return _0x5e4d28;}var _0x217660=this[_0x422a('0xa6')]('RECOG_INPUT()',_0x422a('0xcd'));if(_0x217660[_0x422a('0xa7')]===-0x1){return _0x217660;}var _0x61c660=this['getAndSetVariable'](_0x422a('0xce'),_0x422a('0xcf'));if(_0x61c660[_0x422a('0xa7')]===-0x1){return _0x61c660;}return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xb7'),_0x15a283));};AGIVertices[_0x422a('0x12')][_0x422a('0xd0')]=function(_0x2fb3a1){logger[_0x422a('0x33')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2fb3a1[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x2fb3a1['grammar'])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xb1'));}var _0x7fa546=_0x2fb3a1[_0x422a('0xb0')];if(this[_0x422a('0x87')](_0x2fb3a1[_0x422a('0x7a')])){_0x7fa546+=','+_0x2fb3a1[_0x422a('0x7a')];}var _0x3f0d=this['channel'][_0x422a('0xb2')](_0x422a('0xcc'),_0x7fa546);if(_0x3f0d[_0x422a('0xa7')]===-0x1){return _0x3f0d;}var _0x4b20b0=this['getAndSetVariable'](_0x422a('0xb3'),'SESTEK_ASR_CONFIDENCE');if(_0x4b20b0['result']===-0x1){return _0x4b20b0;}var _0x142187=this[_0x422a('0xa6')](_0x422a('0xd1'),_0x422a('0xd2'));if(_0x142187[_0x422a('0xa7')]===-0x1){return _0x142187;}var _0x2da370=this[_0x422a('0xa6')]('RECOG_INSTANCE()',_0x422a('0xd3'));if(_0x2da370[_0x422a('0xa7')]===-0x1){return _0x2da370;}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xb7'),_0x7fa546));};AGIVertices[_0x422a('0x12')][_0x422a('0xd4')]=function(_0x5cfffb){logger[_0x422a('0x33')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5cfffb[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x5cfffb[_0x422a('0xd5')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x5cfffb,'no\x20database\x20selected');}var _0x2f20fa=this['getSquareOdbc'][_0x422a('0x73')](this,_0x5cfffb['odbc_id']);if(!_0x2f20fa){return this[_0x422a('0x11')][_0x422a('0x30')](_0x5cfffb,_0x422a('0xd6'));}if(!this[_0x422a('0x87')](_0x5cfffb[_0x422a('0x32')])){return this['channel'][_0x422a('0x30')](_0x5cfffb,'no\x20query\x20configured');}var _0x5c8453=_0x5cfffb[_0x422a('0x32')][_0x422a('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xd8'),_0x5c8453));var _0x515966=this['getQueryOdbc'][_0x422a('0x73')](this,_0x2f20fa,_0x5c8453);this[_0x422a('0x3a')][_0x422a('0x73')](this,_0x5cfffb,_0x5c8453);if(!this[_0x422a('0x87')](_0x5cfffb['variable_id'])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xd9'));}var _0x5fa3b9=this[_0x422a('0x13')]['sync'](this,_0x5cfffb['variable_id']);if(!_0x5fa3b9){return this['channel']['error'](_0x5cfffb,'no\x20variable\x20found');}var _0x31f02e=this;_0x515966[_0x422a('0xda')](function(_0xb94661,_0x3f19e7){Object['keys'](_0xb94661)[_0x422a('0xda')](function(_0x1e1e78){_0x31f02e[_0x422a('0x11')][_0x422a('0xa9')](util['format'](_0x422a('0xdb'),_0x5fa3b9,_0x3f19e7,_0x1e1e78),_0xb94661[_0x1e1e78]);});});this[_0x422a('0x11')][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0xdc'),_0x5fa3b9),_0x515966[_0x422a('0xa3')]);return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xdd'),_0x5fa3b9));};AGIVertices['prototype'][_0x422a('0xde')]=function(_0x22735e){logger[_0x422a('0xdf')](util['format'](_0x422a('0xe0'),_0x22735e[_0x422a('0x3c')]));if(!this['isConfigured'](_0x22735e[_0x422a('0xe1')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x22735e,_0x422a('0xe2'));}var _0x5c2d87=this[_0x422a('0x1f')][_0x422a('0x73')](this,_0x22735e[_0x422a('0xe1')]);if(!_0x5c2d87){return this[_0x422a('0x11')][_0x422a('0x30')](_0x22735e,'no\x20user\x20found');}var _0xbf4ac8=this['channel'][_0x422a('0xb2')]('DIAL',[util['format']('SIP/%s',_0x5c2d87),_0x22735e[_0x422a('0x67')],_0x22735e[_0x422a('0xe3')],_0x22735e['url']]);if(_0xbf4ac8[_0x422a('0xa7')]===-0x1){return _0xbf4ac8;}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xe4'),_0x422a('0xe5')));};AGIVertices[_0x422a('0x12')][_0x422a('0xe6')]=function(_0x229146){logger['info'](util[_0x422a('0x2d')](_0x422a('0xe7'),_0x229146[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x229146[_0x422a('0x7c')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0x422a('0x87')](_0x229146[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xae'));}this['channel']['bot']=!![];this[_0x422a('0x3a')](_0x229146);this[_0x422a('0x46')](_0x229146[_0x422a('0x5c')],'in','','');this[_0x422a('0x11')][_0x422a('0xad')](util['format'](_0x422a('0xe8'),_0x229146[_0x422a('0x5c')]));var _0x1aadba=this['googleDialogflow'][_0x422a('0x73')](this,_0x229146);if(_0x1aadba){for(var _0x263f83 in _0x1aadba){if(_0x1aadba['hasOwnProperty'](_0x263f83)){this[_0x422a('0x11')]['setVariable'](util[_0x422a('0x2d')](_0x422a('0xe9'),_0x263f83['toUpperCase']()),_0x1aadba[_0x263f83]);}}this[_0x422a('0x46')](_0x1aadba[_0x422a('0xea')],'out',_0x422a('0xe6'),'');return this[_0x422a('0x11')][_0x422a('0xad')](util['format'](_0x422a('0xeb'),_0x1aadba[_0x422a('0xea')]));}return this[_0x422a('0x11')]['error'](_0x229146,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x422a('0x12')]['dialogflowV2']=function(_0x502840){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0xec'),_0x502840[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x502840[_0x422a('0x7f')])){return this[_0x422a('0x11')]['noop'](_0x422a('0xed'));}if(!this[_0x422a('0x87')](_0x502840[_0x422a('0xee')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xef'));}if(!this[_0x422a('0x87')](_0x502840[_0x422a('0x80')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xf0'));}if(!this[_0x422a('0x87')](_0x502840[_0x422a('0xf1')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20anguage\x20configured');}if(!this[_0x422a('0x87')](_0x502840[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xae'));}this['channel'][_0x422a('0xf2')]=!![];this[_0x422a('0x3a')](_0x502840);this[_0x422a('0x46')](_0x502840['text'],'in','','');this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xf3'),_0x502840['text']));var _0x13b2e3=this[_0x422a('0x7e')][_0x422a('0x73')](this,_0x502840);if(_0x13b2e3){for(var _0x252683 in _0x13b2e3){if(_0x13b2e3['hasOwnProperty'](_0x252683)){if(_0x252683!=='providerResponse'){this[_0x422a('0x11')][_0x422a('0xa9')](util[_0x422a('0x2d')]('DIALOGFLOW_%s',_0x252683[_0x422a('0x6c')]()),_0x13b2e3[_0x252683]);}}}this[_0x422a('0x46')](_0x13b2e3[_0x422a('0xea')],_0x422a('0xf4'),_0x422a('0xf5'),_0x13b2e3[_0x422a('0xf6')]);return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xf7'),_0x13b2e3['speech']));}return this['channel'][_0x422a('0x30')](_0x502840,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x422a('0x12')]['sesteknda']=function(_0x1e07b3){logger[_0x422a('0x33')](util['format'](_0x422a('0xf8'),_0x1e07b3['label']));if(!this[_0x422a('0x87')](_0x1e07b3[_0x422a('0xf9')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x422a('0x87')](_0x1e07b3[_0x422a('0xfa')])){return this[_0x422a('0x11')]['noop'](_0x422a('0xfb'));}if(!this[_0x422a('0x87')](_0x1e07b3[_0x422a('0xfc')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xfd'));}if(!this[_0x422a('0x87')](_0x1e07b3[_0x422a('0xfe')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xae'));}this[_0x422a('0x11')][_0x422a('0xf2')]=!![];this[_0x422a('0x3a')](_0x1e07b3);this[_0x422a('0x46')](_0x1e07b3[_0x422a('0x5c')],'in','','');this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xff'),_0x1e07b3[_0x422a('0x5c')]));var _0x2e9d95=this[_0x422a('0x81')]['sync'](this,_0x1e07b3);if(_0x2e9d95){for(var _0x491576 in _0x2e9d95){if(_0x2e9d95[_0x422a('0x99')](_0x491576)){this['channel'][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0x100'),_0x491576['toUpperCase']()),_0x2e9d95[_0x491576]);}}this[_0x422a('0x46')](_0x2e9d95[_0x422a('0xea')],_0x422a('0xf4'),_0x422a('0x101'),'');if(_0x2e9d95[_0x422a('0x102')]){this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x103'),_0x2e9d95['audiofile']));var _0x102428=this[_0x422a('0x11')]['streamFile'](_0x2e9d95[_0x422a('0x102')]);try{fs[_0x422a('0x104')](_0x2e9d95[_0x422a('0x102')]+'.wav');}catch(_0x4935a5){logger[_0x422a('0x30')](_0x4935a5);}return _0x102428;}else{return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')]('SestekNDA\x20Result\x20%s',_0x2e9d95[_0x422a('0xea')]));}}return this[_0x422a('0x11')]['error'](_0x1e07b3,_0x422a('0x105'));};AGIVertices[_0x422a('0x12')]['end']=function(_0x578d82){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x106'),_0x578d82[_0x422a('0x3c')]));return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x107'));};AGIVertices[_0x422a('0x12')][_0x422a('0x108')]=function(_0x3f10dc){logger['info'](util[_0x422a('0x2d')](_0x422a('0x109'),_0x3f10dc[_0x422a('0x3c')]));var _0x58c6ed='';if(_0x3f10dc[_0x422a('0x10a')]){if(!this[_0x422a('0x87')](_0x3f10dc[_0x422a('0x10a')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x3f10dc,_0x422a('0x10b'));}else{var _0x293e1a=parseInt(_0x3f10dc[_0x422a('0x10a')],0xa);if(isNaN(_0x293e1a)){_0x58c6ed=_0x3f10dc[_0x422a('0x10a')];}else{_0x58c6ed=this[_0x422a('0x21')][_0x422a('0x73')](this,_0x3f10dc['trunk_id']);if(!_0x58c6ed){return this[_0x422a('0x11')][_0x422a('0x30')](_0x3f10dc,_0x422a('0x10c'));}}}}else if(_0x3f10dc[_0x422a('0x10d')]){_0x58c6ed=_0x3f10dc[_0x422a('0x10d')];}else{return this[_0x422a('0x11')]['error'](_0x3f10dc,_0x422a('0x10b'));}var _0x1d514b=this[_0x422a('0x11')]['exec'](_0x422a('0xe5'),[util[_0x422a('0x2d')]('SIP/%s/%s',_0x58c6ed,_0x3f10dc['phone']),_0x3f10dc[_0x422a('0x67')],_0x3f10dc[_0x422a('0xe3')],_0x3f10dc[_0x422a('0x66')]]);if(_0x1d514b[_0x422a('0xa7')]===-0x1){return _0x1d514b;}return this[_0x422a('0x11')]['noop'](util['format'](_0x422a('0xe4'),_0x422a('0xe5')));};AGIVertices[_0x422a('0x12')][_0x422a('0x10e')]=function(_0x25dd50){logger['info'](util[_0x422a('0x2d')](_0x422a('0x10f'),_0x25dd50[_0x422a('0x3c')]));return this['channel'][_0x422a('0xad')](_0x422a('0x10e'));};AGIVertices[_0x422a('0x12')]['getdigits']=function(_0xb33094){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x110'),_0xb33094['label']));if(_0xb33094[_0x422a('0xab')]===0x0){return this[_0x422a('0xaa')](_0xb33094);}_0xb33094[_0x422a('0xab')]-=0x1;if(!this[_0x422a('0x87')](_0xb33094['file_id'])){return this['channel'][_0x422a('0x30')](_0xb33094,_0x422a('0x111'));}var _0x48fe43=this[_0x422a('0x23')]['sync'](this,_0xb33094['file_id']);if(!_0x48fe43){return this[_0x422a('0x11')][_0x422a('0x30')](_0xb33094,'no\x20file\x20audio\x20found');}if(!this[_0x422a('0x87')](_0xb33094[_0x422a('0x112')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x422a('0xd9'));}var _0x4735a8=this[_0x422a('0x11')][_0x422a('0x113')](_0x48fe43,_0xb33094[_0x422a('0x114')],_0xb33094[_0x422a('0x115')]);var _0x51aca7=_0x4735a8[_0x422a('0xa7')]?_0x4735a8[_0x422a('0xa7')]['toString']():'';logger['info'](_0x422a('0x116'),JSON[_0x422a('0x76')](_0x4735a8));if(_0x4735a8['result']===-0x1){this[_0x422a('0x3a')]['sync'](this,_0xb33094,_0x51aca7);return _0x4735a8;}else if(_0x4735a8[_0x422a('0xa5')]==='timeout'){_0x4735a8[_0x422a('0xa7')]=_0x51aca7[_0x422a('0xa3')]>=parseInt(_0xb33094[_0x422a('0x117')])?'x':'i';}else{_0x4735a8['result']=_0x51aca7[_0x422a('0xa3')]>=parseInt(_0xb33094[_0x422a('0x117')])&&_0x51aca7[_0x422a('0xa3')]<=parseInt(_0xb33094['maxdigit'])?'x':'i';}var _0x142568=this[_0x422a('0x13')][_0x422a('0x73')](this,_0xb33094[_0x422a('0x112')]);if(!_0x142568){return this[_0x422a('0x11')][_0x422a('0x30')](_0xb33094,_0x422a('0x118'));}this[_0x422a('0x11')][_0x422a('0xa9')](_0x142568,_0x51aca7);if(this['isConfigured'](_0xb33094[_0x422a('0x119')])){var _0x29371f=parseInt(_0xb33094[_0x422a('0x119')],0xa);var _0xad4ef7=rs[_0x422a('0x11a')]({'charset':'*','length':_0x29371f});var _0x445e49=_0x51aca7[_0x422a('0xa3')];if(_0x445e49>0x0){if(_0x445e49>_0x29371f){this[_0x422a('0x3a')]['sync'](this,_0xb33094,_0xb33094[_0x422a('0x11b')]==='first'?_0xad4ef7+_0x51aca7[_0x422a('0x11c')](_0x29371f):_0x51aca7[_0x422a('0x11c')](0x0,_0x445e49-_0x29371f)+_0xad4ef7);}else{this['createSquareDetailsReport'][_0x422a('0x73')](this,_0xb33094,rs[_0x422a('0x11a')]({'charset':'*','length':_0x445e49}));}}else{this[_0x422a('0x3a')]['sync'](this,_0xb33094,'');}}else{this[_0x422a('0x3a')][_0x422a('0x73')](this,_0xb33094,_0x51aca7);}return _0x4735a8;};AGIVertices[_0x422a('0x12')][_0x422a('0x10')]=function(_0x29c6ff){logger['info'](util[_0x422a('0x2d')](_0x422a('0x11d'),_0x29c6ff['label']));return this[_0x422a('0xf')](_0x29c6ff);};AGIVertices['prototype']['goal']=function(_0x171e17){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x11e'),_0x171e17[_0x422a('0x3c')]));this['createSquareDetailsReport']['sync'](this,_0x171e17,_0x171e17['goalname']);return this['channel'][_0x422a('0xad')](util['format'](_0x422a('0x11f'),_0x171e17[_0x422a('0x120')]));};AGIVertices[_0x422a('0x12')][_0x422a('0x121')]=function(_0x10fede){logger['info'](util[_0x422a('0x2d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x10fede[_0x422a('0x3c')]));if(!this['isConfigured'](_0x10fede['aws_access_key_id'])||!this['isConfigured'](_0x10fede[_0x422a('0x8b')])){return this['channel'][_0x422a('0xad')](_0x422a('0x122'));}if(!this[_0x422a('0x87')](_0x10fede[_0x422a('0x5c')])){return this[_0x422a('0x11')]['noop']('no\x20text\x20configured');}this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x123'),_0x10fede[_0x422a('0x5c')]));var _0x3d5bed=this[_0x422a('0x89')][_0x422a('0x73')](this,_0x10fede);if(_0x3d5bed){this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')]('aws\x20Polly\x20%s\x20file\x20created',_0x3d5bed));var _0xde6643=this['channel'][_0x422a('0x124')](_0x3d5bed);try{fs[_0x422a('0x104')](_0x3d5bed+_0x422a('0x125'));}catch(_0x5f1da5){logger[_0x422a('0x30')](_0x5f1da5);}return _0xde6643;}return this['channel']['error'](_0x10fede,_0x422a('0x126'));};AGIVertices[_0x422a('0x12')][_0x422a('0x127')]=function(_0x3efe69){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x128'),_0x3efe69[_0x422a('0x3c')]));if(!this['isConfigured'](_0x3efe69[_0x422a('0x8a')])||!this[_0x422a('0x87')](_0x3efe69['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x422a('0x87')](_0x3efe69[_0x422a('0x91')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20bot\x20name\x20configured');}if(!this[_0x422a('0x87')](_0x3efe69['text'])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20text\x20configured');}this[_0x422a('0x11')]['bot']=!![];this[_0x422a('0x3a')](_0x3efe69);this['createSquareMessage'](_0x3efe69[_0x422a('0x5c')],'in','','');this['channel'][_0x422a('0xad')](util['format'](_0x422a('0x129'),_0x3efe69['text']));var _0xed97b5=this[_0x422a('0x8f')][_0x422a('0x73')](this,_0x3efe69);if(_0xed97b5){for(var _0x5922b0 in _0xed97b5){if(_0xed97b5[_0x422a('0x99')](_0x5922b0)&&_[_0x422a('0x9a')](_0xed97b5[_0x5922b0])){this[_0x422a('0x11')][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0x12a'),_0x5922b0['toUpperCase']()),_0xed97b5[_0x5922b0]);}}if(_[_0x422a('0x48')](_0xed97b5[_0x422a('0x12b')])){return this['channel'][_0x422a('0xad')](_0x422a('0x12c'));}else{this[_0x422a('0x46')](_0xed97b5['message'],_0x422a('0xf4'),_0x422a('0x12d'),'');return this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x12e'),_0xed97b5[_0x422a('0x12b')]));}}return this[_0x422a('0x11')][_0x422a('0x30')](_0x3efe69,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x422a('0x12')]['googleasr']=function(_0x47f3a3){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x12f'),_0x47f3a3[_0x422a('0x3c')],_0x47f3a3[_0x422a('0x67')]));if(!this[_0x422a('0x87')](_0x47f3a3[_0x422a('0x7c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x130'));}var _0x33eb9c=_0x422a('0x131');var _0x56a4f4=util[_0x422a('0x2d')](_0x422a('0x132'),FILES_PATH,rs['generate'](0x4));var _0x2082fe=util[_0x422a('0x2d')](_0x422a('0xa1'),_0x56a4f4,_0x33eb9c);var _0x49e818=!![];if(_0x47f3a3[_0x422a('0x133')]==='NOBEEP'){_0x49e818=![];}var _0x38a139=this[_0x422a('0x11')][_0x422a('0x134')](_0x56a4f4,_0x33eb9c,_0x47f3a3[_0x422a('0x135')],_0x47f3a3[_0x422a('0x67')],undefined,_0x49e818);if(_0x38a139[_0x422a('0xa7')]!==-0x1){this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x136'),_0x2082fe));var _0x5bd4bc=this[_0x422a('0x92')]['sync'](this,_0x47f3a3,_0x2082fe);if(_0x5bd4bc){for(var _0x3e4ba6 in _0x5bd4bc){if(_0x5bd4bc[_0x422a('0x99')](_0x3e4ba6)){this['channel'][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0x137'),_0x3e4ba6[_0x422a('0x6c')]()),_0x5bd4bc[_0x3e4ba6]);}}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x138'),JSON[_0x422a('0x76')](_0x5bd4bc)));}}return _0x38a139;};AGIVertices[_0x422a('0x12')][_0x422a('0x139')]=function(_0x12571b){logger[_0x422a('0x33')](util['format'](_0x422a('0x13a'),_0x12571b[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x12571b[_0x422a('0x95')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20appid\x20configured');}if(!this[_0x422a('0x87')](_0x12571b[_0x422a('0x96')])){return this[_0x422a('0x11')]['noop'](_0x422a('0x13b'));}var _0x80b5a7=_0x422a('0x131');var _0x385fbb=util[_0x422a('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x422a('0x11a')](0x4));var _0x156e53=util[_0x422a('0x2d')](_0x422a('0xa1'),_0x385fbb,_0x80b5a7);var _0x235b4f=!![];if(_0x12571b[_0x422a('0x133')]===_0x422a('0x13c')){_0x235b4f=![];}var _0x668113=this['channel'][_0x422a('0x134')](_0x385fbb,_0x80b5a7,_0x12571b[_0x422a('0x135')],_0x12571b[_0x422a('0x67')],undefined,_0x235b4f);if(_0x668113['result']!==-0x1){this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x13d'),_0x156e53));var _0x9f89a9=this['tildeASR'][_0x422a('0x73')](this,_0x12571b,_0x156e53);if(_0x9f89a9){for(var _0x3ee13b in _0x9f89a9){if(_0x9f89a9[_0x422a('0x99')](_0x3ee13b)){this[_0x422a('0x11')]['setVariable'](util[_0x422a('0x2d')](_0x422a('0x13e'),_0x3ee13b[_0x422a('0x6c')]()),_0x9f89a9[_0x3ee13b]);}}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')]('TildeASR\x20Result\x20%s',JSON[_0x422a('0x76')](_0x9f89a9)));}}return _0x668113;};AGIVertices[_0x422a('0x12')][_0x422a('0x13f')]=function(_0x516a2a){logger['info'](util[_0x422a('0x2d')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x516a2a['label']));return this['channel']['continueAt'](_0x516a2a['context'],_0x516a2a[_0x422a('0x140')],_0x516a2a[_0x422a('0x43')]);};AGIVertices[_0x422a('0x12')][_0x422a('0x141')]=function(_0x488825){logger[_0x422a('0x33')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x488825[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x488825[_0x422a('0x142')])){return this[_0x422a('0x11')]['error'](_0x488825,_0x422a('0x143'));}try{var _0x10fbde=eval(_0x488825[_0x422a('0x142')])?_0x422a('0x144'):_0x422a('0x145');this['channel'][_0x422a('0xad')](util['format'](_0x422a('0x146'),_0x488825[_0x422a('0x142')],_0x10fbde));return{'code':0xc8,'result':_0x10fbde};}catch(_0x82f9c6){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x422a('0x12')]['gotoiftime']=function(_0x241d00){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x147'),_0x241d00[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x241d00[_0x422a('0x148')])){return this[_0x422a('0x11')]['error'](_0x241d00,'no\x20interval\x20configured');}var _0x48f852=this['getIntervals'][_0x422a('0x73')](this,_0x241d00['interval_id']);if(!_0x48f852){return this[_0x422a('0x11')]['error'](_0x241d00,'no\x20intervals\x20found');}for(var _0x244d9e=0x0;_0x244d9e<_0x48f852[_0x422a('0xa3')];_0x244d9e+=0x1){var _0x5541f3=this[_0x422a('0x11')][_0x422a('0x13')](util[_0x422a('0x2d')](_0x422a('0x149'),_0x48f852[_0x244d9e]));if(_0x5541f3[_0x422a('0xa7')]===-0x1){return _0x5541f3;}logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x14a'),_0x48f852[_0x244d9e],_0x5541f3[_0x422a('0xa5')]));if(_0x5541f3[_0x422a('0xa5')]===_0x422a('0x144')){logger[_0x422a('0x33')](util['format'](_0x422a('0x14a'),_0x48f852[_0x244d9e],'true'));this['channel']['noop'](util[_0x422a('0x2d')](_0x422a('0x14a'),_0x48f852[_0x244d9e],_0x422a('0x144')));return{'code':0xc8,'result':_0x422a('0x144')};}else{logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x14a'),_0x48f852[_0x244d9e],_0x422a('0x145')));this['channel'][_0x422a('0xad')](util['format']('IFTIME\x20%s\x20%s',_0x48f852[_0x244d9e],_0x422a('0x145')));}}return{'code':0xc8,'result':_0x422a('0x145')};};AGIVertices[_0x422a('0x12')][_0x422a('0x14b')]=function(_0x51a1c5){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x14c'),_0x51a1c5[_0x422a('0x3c')]));return this[_0x422a('0x11')]['hangup']();};AGIVertices[_0x422a('0x12')][_0x422a('0x14d')]=function(_0x327dde){logger[_0x422a('0x33')](util['format'](_0x422a('0x14e'),_0x327dde[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x327dde[_0x422a('0x7c')])){return this['channel']['noop']('no\x20key\x20configured');}var _0x28b4ab=_0x422a('0x131');var _0x15fa4b=util['format'](_0x422a('0x132'),FILES_PATH,rs['generate'](0x4));var _0x4323d5=util[_0x422a('0x2d')](_0x422a('0xa1'),_0x15fa4b,_0x28b4ab);var _0x66ed13=!![];if(_0x327dde['beep']===_0x422a('0x13c')){_0x66ed13=![];}var _0x1def33=this['channel']['recordFile'](_0x15fa4b,_0x28b4ab,_0x327dde['intKey'],_0x327dde[_0x422a('0x67')],undefined,_0x66ed13);if(_0x1def33[_0x422a('0xa7')]!==-0x1){this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x14f'),_0x4323d5));var _0x14def7=this['ispeechASR']['sync'](this,_0x327dde,_0x4323d5);if(_0x14def7){for(var _0x519b4e in _0x14def7){if(_0x14def7['hasOwnProperty'](_0x519b4e)){this[_0x422a('0x11')][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0x150'),_0x519b4e[_0x422a('0x6c')]()),_0x14def7[_0x519b4e]);}}return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')]('IspeechASR\x20Result\x20%s',JSON[_0x422a('0x76')](_0x14def7)));}}return _0x1def33;};AGIVertices['prototype'][_0x422a('0x151')]=function(_0x512de2){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x152'),_0x512de2['label']));if(!this[_0x422a('0x87')](_0x512de2[_0x422a('0x7c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x130'));}if(!this['isConfigured'](_0x512de2[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20text\x20configured');}this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')]('Trying\x20ispeech\x20TTS\x20%s',_0x512de2[_0x422a('0x5c')]));var _0x28f42d=this['ispeechTTS']['sync'](this,_0x512de2);if(_0x28f42d){this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x14f'),_0x28f42d));var _0x45266e=this[_0x422a('0x11')][_0x422a('0x124')](_0x28f42d,_0x512de2[_0x422a('0x135')]);try{fs[_0x422a('0x104')](_0x28f42d+_0x422a('0x125'));}catch(_0x1d3eb4){logger[_0x422a('0x30')](_0x1d3eb4);}return _0x45266e;}return this[_0x422a('0x11')][_0x422a('0x30')](_0x512de2,_0x422a('0x153'));};AGIVertices['prototype'][_0x422a('0x154')]=function(_0x184706){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x155'),_0x184706[_0x422a('0x3c')]));if(!this['isConfigured'](_0x184706[_0x422a('0x156')])){return this['channel'][_0x422a('0x30')](_0x184706,_0x422a('0x157'));}logger[_0x422a('0x33')](util['format'](_0x422a('0x158'),this['channel'][_0x422a('0x40')],_0x184706['findBy']));var _0x3b8af3=this[_0x422a('0x56')][_0x422a('0x73')](this,_0x184706[_0x422a('0x156')]);if(_0x3b8af3){logger['info'](util[_0x422a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x422a('0x40')],_0x184706[_0x422a('0x156')]));this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x159'),this['channel'][_0x422a('0x40')],_0x184706[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15a')};}else{logger[_0x422a('0x33')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x422a('0x40')],_0x184706[_0x422a('0x156')]));this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x15b'),this[_0x422a('0x11')][_0x422a('0x40')],_0x184706['findBy']));return{'code':0xc8,'result':_0x422a('0x15c')};}};AGIVertices[_0x422a('0x12')][_0x422a('0x15d')]=function(_0x90abe3){logger[_0x422a('0x33')](util['format'](_0x422a('0x15e'),_0x90abe3[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x90abe3[_0x422a('0x156')])){return this[_0x422a('0x11')]['error'](_0x90abe3,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x422a('0x11')][_0x422a('0x40')],_0x90abe3['findBy']));var _0x585a3=this[_0x422a('0x55')][_0x422a('0x73')](this,_0x90abe3['findBy']);if(_0x585a3){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x422a('0x11')][_0x422a('0x40')],_0x90abe3['findBy']));this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x422a('0x11')]['callerid'],_0x90abe3[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15a')};}else{logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x15b'),this[_0x422a('0x11')][_0x422a('0x40')],_0x90abe3[_0x422a('0x156')]));this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x15b'),this[_0x422a('0x11')][_0x422a('0x40')],_0x90abe3[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15c')};}};AGIVertices[_0x422a('0x12')][_0x422a('0x15f')]=function(_0x207b07){logger[_0x422a('0x33')](util['format'](_0x422a('0x160'),_0x207b07['label']));if(!this['isConfigured'](_0x207b07[_0x422a('0x161')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x207b07,_0x422a('0x162'));}this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x163'),_0x207b07[_0x422a('0x161')]));var _0xcb0ad2=eval(_0x207b07[_0x422a('0x161')]);if(!this[_0x422a('0x87')](_0x207b07[_0x422a('0x112')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xd9'));}var _0x39a500=this[_0x422a('0x13')]['sync'](this,_0x207b07['variable_id']);if(!_0x39a500){return this['channel'][_0x422a('0x30')](_0x207b07,'no\x20variable\x20found');}if(_[_0x422a('0x9d')](_0xcb0ad2)){var _0x1f1c59=this;_0xcb0ad2[_0x422a('0xda')](function(_0x461c87,_0x198a5c){_0x1f1c59[_0x422a('0x11')][_0x422a('0xa9')](util['format'](_0x422a('0x164'),_0x39a500,_0x198a5c),_0x461c87);});return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')]('variable\x20%s[key]\x20set',_0x39a500));}else{return this[_0x422a('0x11')][_0x422a('0xa9')](_0x39a500,_0xcb0ad2);}};AGIVertices[_0x422a('0x12')][_0x422a('0xe')]=function(_0x3f6e32){logger['info'](util['format'](_0x422a('0x165'),_0x3f6e32['label']));if(_0x3f6e32[_0x422a('0xab')]===0x0){return this[_0x422a('0xaa')](_0x3f6e32);}_0x3f6e32[_0x422a('0xab')]-=0x1;if(!this[_0x422a('0x87')](_0x3f6e32[_0x422a('0x166')])){return this['channel'][_0x422a('0x30')](_0x3f6e32,_0x422a('0x111'));}var _0x360b42=this[_0x422a('0x23')][_0x422a('0x73')](this,_0x3f6e32[_0x422a('0x166')]);if(!_0x360b42){return this[_0x422a('0x11')]['error'](_0x3f6e32,_0x422a('0x167'));}var _0x12e2ea=this[_0x422a('0x11')]['getData'](_0x360b42,_0x3f6e32[_0x422a('0x114')],_0x3f6e32[_0x422a('0x168')]);var _0x2c8afb=_0x12e2ea[_0x422a('0xa7')];if(_0x12e2ea['result']===-0x1){this[_0x422a('0x3a')][_0x422a('0x73')](this,_0x3f6e32,'-1');return _0x12e2ea;}else if(_0x12e2ea[_0x422a('0xa5')]===_0x422a('0x67')){_0x12e2ea[_0x422a('0xa7')]=_0x12e2ea['result'][_0x422a('0xa3')]>0x0?_0x12e2ea[_0x422a('0xa7')]:'t';}else if(_['isEmpty'](_0x12e2ea['result'])){_0x12e2ea[_0x422a('0xa7')]='#';_0x2c8afb='#';}if(!this['isConfigured'](_0x3f6e32['variable_id'])){this[_0x422a('0x11')]['noop'](_0x422a('0xd9'));}else{var _0x3d69ad=this[_0x422a('0x13')][_0x422a('0x73')](this,_0x3f6e32[_0x422a('0x112')]);if(!_0x3d69ad){return this[_0x422a('0x11')][_0x422a('0x30')](_0x3f6e32,_0x422a('0x118'));}this['channel'][_0x422a('0xa9')](_0x3d69ad,_0x2c8afb);}this[_0x422a('0x3a')]['sync'](this,_0x3f6e32,_0x2c8afb);return _0x12e2ea;};AGIVertices[_0x422a('0x12')]['noop']=function(_0x450493){logger['info'](util[_0x422a('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x450493[_0x422a('0x3c')]));return this[_0x422a('0x11')][_0x422a('0xad')](_0x450493[_0x422a('0x169')]||_0x450493[_0x422a('0x3c')]);};AGIVertices[_0x422a('0x12')][_0x422a('0x16a')]=function(_0x10270f){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x16b'),_0x10270f[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x10270f[_0x422a('0x156')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x10270f,_0x422a('0x157'));}logger[_0x422a('0x33')](util[_0x422a('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x422a('0x11')]['callerid'],_0x10270f['findBy']));var _0x3109e6=this['getPause']['sync'](this,_0x10270f['pause_id']);var _0x13bf3c=this[_0x422a('0x16c')][_0x422a('0x73')](this,_0x10270f[_0x422a('0x156')],_0x3109e6);if(_0x13bf3c){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x159'),this[_0x422a('0x11')][_0x422a('0x40')],_0x10270f[_0x422a('0x156')]));this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x159'),this[_0x422a('0x11')][_0x422a('0x40')],_0x10270f[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15a')};}else{logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x15b'),this[_0x422a('0x11')][_0x422a('0x40')],_0x10270f[_0x422a('0x156')]));this['channel'][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x159'),this['channel']['callerid'],_0x10270f['findBy']));return{'code':0xc8,'result':_0x422a('0x15c')};}};AGIVertices[_0x422a('0x12')]['playback']=function(_0x2c1a3a){logger['info'](util[_0x422a('0x2d')](_0x422a('0x16d'),_0x2c1a3a['label']));if(!this[_0x422a('0x87')](_0x2c1a3a[_0x422a('0x166')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x2c1a3a,_0x422a('0x111'));}var _0x20f030=this[_0x422a('0x23')][_0x422a('0x73')](this,_0x2c1a3a[_0x422a('0x166')]);if(!_0x20f030){return this[_0x422a('0x11')][_0x422a('0x30')](_0x2c1a3a,'no\x20file\x20audio\x20found');}var _0x1f431a=this[_0x422a('0x11')][_0x422a('0xb2')]('PLAYBACK',[_0x20f030,_0x2c1a3a[_0x422a('0xe3')]]);if(_0x1f431a['result']===-0x1){return _0x1f431a;}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0xc8'),_0x422a('0x16e'),_0x20f030));};AGIVertices[_0x422a('0x12')][_0x422a('0x16f')]=function(_0x5af47b){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x170'),_0x5af47b['label']));if(!this[_0x422a('0x87')](_0x5af47b[_0x422a('0x171')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x5af47b,_0x422a('0x172'));}var _0x4c0799='';var _0x5755da=parseInt(_0x5af47b['queue_id'],0xa);if(isNaN(_0x5755da)){_0x4c0799=_0x5af47b[_0x422a('0x171')];}else{_0x4c0799=this[_0x422a('0x17')][_0x422a('0x73')](this,_0x5af47b['queue_id']);if(!_0x4c0799){return this[_0x422a('0x11')][_0x422a('0x30')](_0x5af47b,_0x422a('0x173'));}}var _0x228d18='';if(this[_0x422a('0x87')](_0x5af47b['file_id'])){var _0x2d2750=this[_0x422a('0x23')][_0x422a('0x73')](this,_0x5af47b[_0x422a('0x166')]);if(_0x2d2750){_0x228d18=_0x2d2750;}}this[_0x422a('0x3a')][_0x422a('0x73')](this,_0x5af47b,_0x4c0799);if(_0x5af47b[_0x422a('0xe3')][_0x422a('0x174')]('x')<0x0){_0x5af47b[_0x422a('0xe3')]+='x';}if(_0x5af47b[_0x422a('0xe3')]['indexOf']('X')<0x0){_0x5af47b[_0x422a('0xe3')]+='X';}this[_0x422a('0x11')]['setVariable']('XMCS-QUEUE',_0x4c0799?_0x4c0799[_0x422a('0x175')]():'');var _0x477edf=this[_0x422a('0x11')]['exec'](_0x422a('0x176'),[_0x4c0799,_0x5af47b['opts'],_0x5af47b['url'],_0x228d18,_0x5af47b['timeout'],_0x5af47b[_0x422a('0x8')],_0x5af47b['macro'],_0x5af47b[_0x422a('0x177')],'',_0x5af47b[_0x422a('0x178')]]);if(_0x477edf[_0x422a('0xa7')]===-0x1){return _0x477edf;}return this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')]('Executed\x20command\x20%s\x20%s',_0x422a('0x176'),_0x4c0799));};AGIVertices['prototype'][_0x422a('0x179')]=function(_0x1fde0c){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x17a'),_0x1fde0c['label']));var _0x2e9088=_0x1fde0c['recordingFormat']||'wav';var _0x21a351=util[_0x422a('0x2d')](_0x422a('0x17b'),this['channel'][_0x422a('0x3b')],rs['generate'](0x5));var _0x72a0f4=util['format'](_0x422a('0x17c'),FILES_PATH,_0x21a351,_0x2e9088);var _0x2cb0e6=util['format'](_0x422a('0x132'),FILES_PATH,_0x21a351);this[_0x422a('0x3f')][_0x422a('0x73')](this,_0x1fde0c,_0x21a351,_0x72a0f4);this[_0x422a('0x11')][_0x422a('0xa9')](_0x422a('0x17d'),_0x21a351);logger[_0x422a('0x33')](_0x422a('0x17e'),_0x2cb0e6,_0x2e9088,_0x1fde0c['escape_digits'],_0x1fde0c[_0x422a('0x67')]);return this[_0x422a('0x11')][_0x422a('0x134')](_0x2cb0e6,_0x2e9088,_0x1fde0c['escape_digits'],_0x1fde0c[_0x422a('0x67')],undefined,!![]);};AGIVertices[_0x422a('0x12')][_0x422a('0x17f')]=function(_0x524c8f){logger[_0x422a('0x33')](util['format'](_0x422a('0x180'),_0x524c8f[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x524c8f[_0x422a('0x66')])){return this[_0x422a('0x11')]['noop'](_0x422a('0x181'));}var _0x56c65c=this[_0x422a('0x65')][_0x422a('0x73')](this,_0x524c8f);logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x182'),util['inspect'](_0x56c65c,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x524c8f[_0x422a('0x112')])){return this[_0x422a('0x11')][_0x422a('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3f2ba8=this[_0x422a('0x13')][_0x422a('0x73')](this,_0x524c8f[_0x422a('0x112')]);if(!_0x3f2ba8){return this[_0x422a('0x11')][_0x422a('0x30')](_0x524c8f,_0x422a('0x118'));}this[_0x422a('0x11')][_0x422a('0xa9')](util[_0x422a('0x2d')]('%s_STATUS_CODE',_0x3f2ba8),_0x56c65c[_0x422a('0x78')]?_0x56c65c[_0x422a('0x78')]:_0x422a('0x183'));this['channel'][_0x422a('0xa9')](util[_0x422a('0x2d')](_0x422a('0x184'),_0x3f2ba8),_0x56c65c[_0x422a('0x79')]?_0x56c65c['statusMessage']:'OK');if(_0x56c65c[_0x422a('0x6d')]){try{this[_0x422a('0x9f')](_0x56c65c[_0x422a('0x6d')],_0x3f2ba8);}catch(_0x210632){logger[_0x422a('0x30')](util['format'](_0x422a('0x185'),_0x3f2ba8));}}return this[_0x422a('0x11')][_0x422a('0xad')](util['format']('variable\x20%s\x20set',_0x3f2ba8));};AGIVertices[_0x422a('0x12')][_0x422a('0x186')]=function(_0xc24bd){logger['info'](util['format'](_0x422a('0x187'),_0xc24bd[_0x422a('0x3c')]));return this['channel'][_0x422a('0x188')](_0xc24bd[_0x422a('0x189')][_0x422a('0xd7')](/\s+/g,''),_0xc24bd[_0x422a('0x18a')]);};AGIVertices[_0x422a('0x12')][_0x422a('0x18b')]=function(_0x210583){logger[_0x422a('0x33')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x210583['label']));return this[_0x422a('0x11')][_0x422a('0x18c')](_0x210583[_0x422a('0x68')]['replace'](/\s+/g,''),_0x210583['escape_digits']);};AGIVertices[_0x422a('0x12')][_0x422a('0x18d')]=function(_0x57fc19){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x18e'),_0x57fc19[_0x422a('0x3c')]));return this[_0x422a('0x11')]['sayPhonetic'](_0x57fc19[_0x422a('0x5c')],_0x57fc19[_0x422a('0x18a')]);};AGIVertices[_0x422a('0x12')]['sendMail']=function(_0x16081f){logger[_0x422a('0x33')](util['format'](_0x422a('0x18f'),_0x16081f[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x16081f[_0x422a('0x190')])){return this['channel'][_0x422a('0xad')](_0x422a('0x191'));}var _0x1557b0=this['getMailAccount'][_0x422a('0x73')](this,_0x16081f[_0x422a('0x190')]);if(!_0x1557b0||!_0x1557b0['Smtp']){return this[_0x422a('0x11')]['error'](_0x16081f,_0x422a('0x192'));}var _0x325401={'from':util[_0x422a('0x2d')](_0x422a('0x193'),_0x1557b0['name'],_0x1557b0[_0x422a('0x194')]||_0x1557b0[_0x422a('0x195')][_0x422a('0x196')]),'to':_0x16081f['to']||'','cc':_0x16081f['cc']||'','bcc':_0x16081f['bcc']||'','subject':_0x16081f[_0x422a('0x197')],'html':_0x16081f[_0x422a('0x5c')],'text':_0x16081f['text']};if(this['isConfigured'](_0x16081f['template_id'])){}logger[_0x422a('0xdf')](_0x422a('0x198'),JSON[_0x422a('0x76')](_0x325401));this[_0x422a('0x3a')]['sync'](this,_0x16081f,_0x16081f[_0x422a('0x190')]);this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1557b0[_0x422a('0x16')]));this['sendMailMessage'][_0x422a('0x73')](this,_0x1557b0[_0x422a('0x199')],_0x325401);return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x19a'));};AGIVertices['prototype'][_0x422a('0x19b')]=function(_0x3e371e){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x19c'),_0x3e371e[_0x422a('0x3c')]));return this[_0x422a('0x11')][_0x422a('0xad')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x422a('0x12')][_0x422a('0x19d')]=function(_0x2eebe9){logger[_0x422a('0x33')](util['format'](_0x422a('0x19e'),_0x2eebe9[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x2eebe9['sms_account_id'])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x19f'));}var _0x944570=this[_0x422a('0x37')]['sync'](this,_0x2eebe9[_0x422a('0x1a0')]);if(!_0x944570){return this[_0x422a('0x11')][_0x422a('0x30')](_0x2eebe9,'no\x20sms\x20account\x20found');}var _0x38752c={'body':_0x2eebe9[_0x422a('0x1a1')],'phone':_0x2eebe9['to']||'','SmsAccountId':_0x944570['id']};logger[_0x422a('0xdf')](_0x422a('0x1a2'),JSON[_0x422a('0x76')](_0x38752c));this['createSquareDetailsReport'][_0x422a('0x73')](this,_0x2eebe9,_0x2eebe9[_0x422a('0x1a0')]);this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x1a3'),_0x944570['name']));this[_0x422a('0x39')][_0x422a('0x73')](this,_0x38752c);return this[_0x422a('0x11')][_0x422a('0xad')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x422a('0x12')][_0x422a('0x1a4')]=function(_0x21e980){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x1a5'),_0x21e980[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x21e980[_0x422a('0x112')])){return this[_0x422a('0x11')]['error'](_0x21e980,_0x422a('0x1a6'));}var _0x38ef41=this[_0x422a('0x13')][_0x422a('0x73')](this,_0x21e980[_0x422a('0x112')]);if(!_0x38ef41){return this[_0x422a('0x11')][_0x422a('0x30')](_0x21e980,_0x422a('0x118'));}return this[_0x422a('0x11')][_0x422a('0xa9')](_0x38ef41,_0x21e980[_0x422a('0x1a7')]);};AGIVertices['prototype'][_0x422a('0x1a8')]=function(_0xe7f62c){logger['info'](util[_0x422a('0x2d')](_0x422a('0x1a9'),_0xe7f62c[_0x422a('0x3c')]));this[_0x422a('0x11')]['noop'](_0x422a('0x1aa'));if(_0xe7f62c['answer']===_0x422a('0x1ab')){this[_0x422a('0x11')]['noop']('Answer');return this[_0x422a('0x11')][_0x422a('0xba')]();}return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0x1ac'));};AGIVertices[_0x422a('0x12')][_0x422a('0x1ad')]=function(_0x39ec57){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x39ec57['label']));if(!this[_0x422a('0x87')](_0x39ec57[_0x422a('0x1ae')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x39ec57,_0x422a('0x1af'));}var _0x300bbd=this[_0x422a('0x1b')][_0x422a('0x73')](this,_0x39ec57['project_id']);if(!this[_0x422a('0x87')](_0x300bbd)){return this['channel'][_0x422a('0x30')](_0x39ec57,util[_0x422a('0x2d')](_0x422a('0x1b0'),_0x39ec57[_0x422a('0x1ae')]));}if(_0x300bbd===this[_0x422a('0x11')][_0x422a('0x3e')]){return this['channel']['error'](_0x39ec57,_0x422a('0x1b1'));}this['createSquareDetailsReport']['sync'](this,_0x39ec57,_0x300bbd);var _0x18c8a8=this[_0x422a('0x11')][_0x422a('0xb2')](_0x422a('0x1b2'),util[_0x422a('0x2d')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x422a('0x8')][_0x422a('0x1b3')]||_0x422a('0x1b4'),_0x300bbd,this[_0x422a('0x11')][_0x422a('0x3e')]));if(_0x18c8a8[_0x422a('0xa7')]===-0x1){return _0x18c8a8;}return this['channel'][_0x422a('0xad')](util['format']('Executed\x20command\x20%s\x20%s',_0x422a('0x1b2'),_0x300bbd));};AGIVertices[_0x422a('0x12')]['system']=function(_0x107543){logger['info'](util[_0x422a('0x2d')](_0x422a('0x1b5'),_0x107543['label']));var _0x1b84b8=this[_0x422a('0x1b6')][_0x422a('0x73')](this,_0x107543[_0x422a('0xb9')]);this[_0x422a('0x3a')]['sync'](this,_0x107543,_0x107543[_0x422a('0xb9')]);if(this[_0x422a('0x87')](_0x107543[_0x422a('0x112')])){var _0xbeda6d=this['getVariable']['sync'](this,_0x107543[_0x422a('0x112')]);if(_0xbeda6d){this[_0x422a('0x11')][_0x422a('0xa9')](_0xbeda6d,_0x1b84b8);return this[_0x422a('0x11')][_0x422a('0xad')](util['format'](_0x422a('0x1b7'),_0x107543[_0x422a('0xb9')],_0xbeda6d));}}return this[_0x422a('0x11')][_0x422a('0xad')](util['format'](_0x422a('0x1b8'),_0x107543[_0x422a('0xb9')]));};AGIVertices[_0x422a('0x12')][_0x422a('0x1b9')]=function(_0x50cd14){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x50cd14['label']));_0x50cd14[_0x422a('0x5c')]=_0x50cd14[_0x422a('0x5c')][_0x422a('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x50cd14[_0x422a('0x5a')])){return this['channel'][_0x422a('0xad')](_0x422a('0x1ba'));}if(!this[_0x422a('0x87')](_0x50cd14['text'])){return this[_0x422a('0x11')]['noop'](_0x422a('0xae'));}this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x50cd14[_0x422a('0x5c')]));var _0x407ce6=this[_0x422a('0x59')][_0x422a('0x73')](this,_0x50cd14);if(_0x407ce6){this['channel'][_0x422a('0xad')](util['format'](_0x422a('0x1bb'),_0x407ce6));var _0x221b90=this[_0x422a('0x11')][_0x422a('0x124')](_0x407ce6);try{fs[_0x422a('0x104')](_0x407ce6+_0x422a('0x125'));}catch(_0x1ab7be){logger['error'](_0x1ab7be);}return _0x221b90;}return this[_0x422a('0x11')][_0x422a('0x30')](_0x50cd14,_0x422a('0x1bc'));};AGIVertices[_0x422a('0x12')]['tts']=function(_0x164946){logger['info'](util['format'](_0x422a('0x1bd'),_0x164946[_0x422a('0x3c')]));_0x164946[_0x422a('0x5c')]=_0x164946[_0x422a('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x422a('0x87')](_0x164946[_0x422a('0x5c')])){return this[_0x422a('0x11')][_0x422a('0xad')](_0x422a('0xae'));}this[_0x422a('0x11')]['noop'](util[_0x422a('0x2d')](_0x422a('0x1be'),_0x164946[_0x422a('0x5c')]));var _0x5a99e4=this[_0x422a('0x63')][_0x422a('0x73')](this,_0x164946);if(_0x5a99e4){this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0x1bf'),_0x5a99e4));var _0x4980d7=this[_0x422a('0x11')][_0x422a('0x124')](_0x5a99e4);try{fs[_0x422a('0x104')](_0x5a99e4+_0x422a('0x125'));}catch(_0x192b37){logger[_0x422a('0x30')](_0x192b37);}return _0x4980d7;}return this[_0x422a('0x11')][_0x422a('0x30')](_0x164946,_0x422a('0x1c0'));};AGIVertices[_0x422a('0x12')]['unpause']=function(_0x242336){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x1c1'),_0x242336[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x242336[_0x422a('0x156')])){return this['channel'][_0x422a('0x30')](_0x242336,_0x422a('0x157'));}logger[_0x422a('0x33')](util['format'](_0x422a('0x158'),this[_0x422a('0x11')]['callerid'],_0x242336[_0x422a('0x156')]));var _0x572eac=this[_0x422a('0x54')][_0x422a('0x73')](this,_0x242336[_0x422a('0x156')]);if(_0x572eac){logger[_0x422a('0x33')](util[_0x422a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x422a('0x11')][_0x422a('0x40')],_0x242336['findBy']));this[_0x422a('0x11')][_0x422a('0xad')](util['format'](_0x422a('0x159'),this[_0x422a('0x11')][_0x422a('0x40')],_0x242336[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15a')};}else{logger[_0x422a('0x33')](util[_0x422a('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x242336[_0x422a('0x156')]));this['channel']['noop'](util['format'](_0x422a('0x15b'),this[_0x422a('0x11')][_0x422a('0x40')],_0x242336[_0x422a('0x156')]));return{'code':0xc8,'result':_0x422a('0x15c')};}};AGIVertices[_0x422a('0x12')][_0x422a('0x1c2')]=function(_0x81733){logger['info'](util['format'](_0x422a('0x1c3'),_0x81733[_0x422a('0x3c')]));var _0x247673=this[_0x422a('0x11')][_0x422a('0xb2')]('VOICEMAIL',[_0x81733[_0x422a('0x1c4')],_0x81733[_0x422a('0x7a')]]);if(_0x247673['result']===-0x1){return _0x247673;}return this[_0x422a('0x11')][_0x422a('0xad')](util[_0x422a('0x2d')](_0x422a('0xc8'),_0x422a('0x1c5'),_0x81733[_0x422a('0x1c4')]));};AGIVertices[_0x422a('0x12')][_0x422a('0x1c6')]=function(_0x2147c3){logger[_0x422a('0x33')](util[_0x422a('0x2d')](_0x422a('0x1c7'),_0x2147c3[_0x422a('0x3c')]));if(!this[_0x422a('0x87')](_0x2147c3[_0x422a('0x112')])){return this[_0x422a('0x11')][_0x422a('0x30')](_0x2147c3,_0x422a('0x1a6'));}var _0x519a73=this['getVariable'][_0x422a('0x73')](this,_0x2147c3[_0x422a('0x112')]);if(!_0x519a73){return this[_0x422a('0x11')][_0x422a('0x30')](_0x2147c3,_0x422a('0x118'));}var _0x52ad72=this[_0x422a('0x11')][_0x422a('0x13')](_0x519a73);return{'code':0xc8,'result':_0x52ad72[_0x422a('0xa5')]?_0x52ad72[_0x422a('0xa5')]:'-'};};String[_0x422a('0x12')][_0x422a('0xa4')]=function(_0xd1c62,_0x4880d3){return this[_0x422a('0xa2')](_0xd1c62)[_0x422a('0x1c8')](_0x4880d3);};module[_0x422a('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 a6e0e1c..95cdfbf 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 _0xbaac=['timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','finally','[ACW][START]\x20%s','stopAcw','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0xbaac,0x1f0));var _0xcbaa=function(_0x4201ed,_0x45f143){_0x4201ed=_0x4201ed-0x0;var _0x4f51d1=_0xbaac[_0x4201ed];return _0x4f51d1;};'use strict';var util=require(_0xcbaa('0x0'));var _=require(_0xcbaa('0x1'));var moment=require(_0xcbaa('0x2'));var ami=require('../ami');var logger=require(_0xcbaa('0x3'))(_0xcbaa('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xcbaa('0x5'));function Acw(_0x126197){this[_0xcbaa('0x6')]=_0x126197[_0xcbaa('0x6')];this[_0xcbaa('0x7')]=_0x126197[_0xcbaa('0x7')];this[_0xcbaa('0x8')]=_0x126197[_0xcbaa('0x8')];this[_0xcbaa('0x9')]={};ami['on'](_0xcbaa('0xa'),this[_0xcbaa('0xb')][_0xcbaa('0xc')](this));ami['on'](_0xcbaa('0xd'),this[_0xcbaa('0xe')][_0xcbaa('0xc')](this));ami['on'](_0xcbaa('0xf'),this[_0xcbaa('0x10')][_0xcbaa('0xc')](this));ami['on']('agentringnoanswer',this[_0xcbaa('0x11')][_0xcbaa('0xc')](this));ami['on'](_0xcbaa('0x12'),this[_0xcbaa('0x13')][_0xcbaa('0xc')](this));ami['on']('blindtransfer',this[_0xcbaa('0x14')][_0xcbaa('0xc')](this));ami['on'](_0xcbaa('0x15'),this[_0xcbaa('0x16')]['bind'](this));}function getDiff(_0x569815){var _0x214d58=moment()[_0xcbaa('0x17')](0x0);var _0x5b0818=moment(_0x569815)[_0xcbaa('0x17')](0x0);return _0x214d58[_0xcbaa('0x18')](_0x5b0818,_0xcbaa('0x19'));}Acw[_0xcbaa('0x1a')][_0xcbaa('0x1b')]=function(_0xea633f){try{var _0x1e0430=this;var _0x3d8b42=this[_0xcbaa('0x9')][_0xea633f]['interface'];var _0x5d0ed0=this[_0xcbaa('0x9')][_0xea633f][_0xcbaa('0x1c')];var _0x2b5b53=this[_0xcbaa('0x6')][_0x5d0ed0];var _0xef861=![];var _0x1e2888=_0xcbaa('0x1d');if(_0x2b5b53[_0xcbaa('0x1e')]){if(_0x2b5b53[_0xcbaa('0x1f')][_0xcbaa('0x20')]){_0xef861=!![];_0x1e2888=_0x2b5b53[_0xcbaa('0x1f')][_0xcbaa('0x20')];}}ami[_0xcbaa('0x21')]({'action':_0xcbaa('0x22'),'interface':_0x3d8b42,'paused':!![],'reason':_0x1e2888})[_0xcbaa('0x23')](function(_0xd5248f){if(_0x1e0430[_0xcbaa('0x7')][_0x3d8b42]){return RpcUser[_0xcbaa('0x24')](_0x1e0430[_0xcbaa('0x7')][_0x3d8b42]['id'])[_0xcbaa('0x23')](function(_0x1e84d9){if(_0x1e84d9&&!_0x1e84d9[_0xcbaa('0x25')]){logger[_0xcbaa('0x26')]('[%s][START][AGENT:%s][QUEUE:%s]',_0xea633f,_0x3d8b42,_0x5d0ed0);var _0x3a903f=_0x1e0430['channels'][_0xea633f][_0xcbaa('0x27')]&&_0x1e0430[_0xcbaa('0x9')][_0xea633f][_0xcbaa('0x28')]?_0x1e0430[_0xcbaa('0x9')][_0xea633f][_0xcbaa('0x28')]:_0xea633f;return RpcUser[_0xcbaa('0x29')](_0x1e0430[_0xcbaa('0x7')][_0x3d8b42],_0x1e2888,_0x3a903f)[_0xcbaa('0x23')](function(_0x4d42fd){if(!_0xef861){_0x1e0430[_0xcbaa('0x8')][_0x3d8b42]={};logger[_0xcbaa('0x26')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xea633f,_0x1e0430[_0xcbaa('0x6')][_0x5d0ed0]['acwTimeout'],_0x3d8b42,_0x5d0ed0);_0x1e0430[_0xcbaa('0x8')][_0x3d8b42]['timer']=setTimeout(_0x1e0430['stopAcw'][_0xcbaa('0xc')](_0x1e0430,_0x3d8b42),_0x1e0430[_0xcbaa('0x6')][_0x5d0ed0]['acwTimeout']*0x3e8);_0x1e0430[_0xcbaa('0x8')][_0x3d8b42][_0xcbaa('0x2a')]=moment()['format'](_0xcbaa('0x2b'));_0x1e0430[_0xcbaa('0x8')][_0x3d8b42][_0xcbaa('0x2c')]=_0xea633f;_0x1e0430[_0xcbaa('0x8')][_0x3d8b42][_0xcbaa('0x1c')]=_0x5d0ed0;_0x1e0430['timers'][_0x3d8b42][_0xcbaa('0x2d')]=function(){var _0x17dac1=getDiff(_0x1e0430[_0xcbaa('0x8')][_0x3d8b42]['lastPauseAt']);clearTimeout(_0x1e0430[_0xcbaa('0x8')][_0x3d8b42][_0xcbaa('0x2e')]);_0x1e0430['timers'][_0x3d8b42][_0xcbaa('0x2e')]=![];RpcVoiceAgentReport[_0xcbaa('0x2f')]({'acwtime':_0x17dac1},_0x1e0430[_0xcbaa('0x8')][_0x3d8b42][_0xcbaa('0x2c')],_0x3d8b42)[_0xcbaa('0x23')](function(_0x216bd3){logger[_0xcbaa('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0xea633f,_0x17dac1,_0x216bd3);})[_0xcbaa('0x30')](function(_0x57a10a){logger[_0xcbaa('0x31')](_0xcbaa('0x32'),_0xea633f,_0x57a10a);});delete _0x1e0430[_0xcbaa('0x8')][_0x3d8b42];};}});}else{logger['info'](_0xcbaa('0x33'),_0xea633f,_0x3d8b42,_0x5d0ed0);}});}})[_0xcbaa('0x30')](function(_0x26c315){logger[_0xcbaa('0x31')](_0xcbaa('0x34'),_0xea633f,_0x1e0430[_0xcbaa('0x6')][_0x5d0ed0][_0xcbaa('0x35')],_0x3d8b42,_0x5d0ed0);})[_0xcbaa('0x36')](function(){delete _0x1e0430[_0xcbaa('0x9')][_0xea633f];});}catch(_0x3659a9){logger[_0xcbaa('0x31')](_0xcbaa('0x37'),_0x3659a9['message']);}};Acw[_0xcbaa('0x1a')][_0xcbaa('0x38')]=function(_0x3f9f6c){try{var _0x55b4fb=this;if(_0x55b4fb['timers'][_0x3f9f6c]){_0x55b4fb[_0xcbaa('0x8')][_0x3f9f6c]['timer']=![];var _0x2f41dd=_0x55b4fb[_0xcbaa('0x8')][_0x3f9f6c][_0xcbaa('0x2c')];var _0x3195ec=_0x55b4fb[_0xcbaa('0x8')][_0x3f9f6c][_0xcbaa('0x1c')];var _0x20c711=_0x55b4fb[_0xcbaa('0x6')][_0x3195ec]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x2f41dd,_0x3f9f6c);RpcUser[_0xcbaa('0x39')](this[_0xcbaa('0x7')][_0x3f9f6c]);RpcVoiceAgentReport[_0xcbaa('0x2f')]({'acwtime':_0x20c711,'agentacw':!![]},_0x2f41dd,_0x3f9f6c)['then'](function(_0x4b15b1){logger['info'](_0xcbaa('0x3a'),_0x2f41dd,_0x20c711,_0x4b15b1);})[_0xcbaa('0x30')](function(_0x276509){logger[_0xcbaa('0x31')](_0xcbaa('0x32'),_0x2f41dd,_0x276509);});}else{logger[_0xcbaa('0x31')](_0xcbaa('0x3b'),_0x3f9f6c);if(_0x55b4fb[_0xcbaa('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0xcbaa('0x3c')](_0x55b4fb['timers']));}}}catch(_0xb92274){logger[_0xcbaa('0x31')](_0xcbaa('0x3d'),_0xb92274[_0xcbaa('0x3e')]);}};Acw[_0xcbaa('0x1a')][_0xcbaa('0xb')]=function(_0x577285){try{if(this['voiceQueues'][_0x577285[_0xcbaa('0x1c')]]&&(this[_0xcbaa('0x6')][_0x577285[_0xcbaa('0x1c')]][_0xcbaa('0x4')]||this[_0xcbaa('0x6')][_0x577285[_0xcbaa('0x1c')]][_0xcbaa('0x1e')])){if(this['agents'][_0x577285[_0xcbaa('0x3f')]]){this[_0xcbaa('0x9')][_0x577285['uniqueid']]={'queue':_0x577285[_0xcbaa('0x1c')],'interface':_0x577285['interface'],'destlinkedid':_0x577285['destlinkedid']};}}}catch(_0x1df9a4){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1df9a4[_0xcbaa('0x3e')]);}};Acw['prototype'][_0xcbaa('0x16')]=function(_0x46118f){try{if(this[_0xcbaa('0x6')][_0x46118f[_0xcbaa('0x1c')]]&&(this[_0xcbaa('0x6')][_0x46118f[_0xcbaa('0x1c')]][_0xcbaa('0x4')]||this[_0xcbaa('0x6')][_0x46118f[_0xcbaa('0x1c')]][_0xcbaa('0x1e')])){if(this[_0xcbaa('0x7')][_0x46118f[_0xcbaa('0x3f')]]){this[_0xcbaa('0x9')][_0x46118f[_0xcbaa('0x2c')]]={'queue':_0x46118f[_0xcbaa('0x1c')],'interface':_0x46118f[_0xcbaa('0x3f')]};}}}catch(_0x4273c1){logger[_0xcbaa('0x31')](_0xcbaa('0x40'),_0x4273c1[_0xcbaa('0x3e')]);}};Acw['prototype']['syncHangupRequest']=function(_0x47186c){try{if(this[_0xcbaa('0x9')][_0x47186c[_0xcbaa('0x2c')]]&&_[_0xcbaa('0x41')](this[_0xcbaa('0x9')][_0x47186c[_0xcbaa('0x2c')]]['attended'])){logger[_0xcbaa('0x26')](_0xcbaa('0x42'),_0x47186c[_0xcbaa('0x2c')]);this['startAcw'](_0x47186c[_0xcbaa('0x2c')]);}else if(this['channels'][_0x47186c[_0xcbaa('0x43')]]&&_[_0xcbaa('0x41')](this[_0xcbaa('0x9')][_0x47186c[_0xcbaa('0x43')]]['attended'])){logger[_0xcbaa('0x26')](_0xcbaa('0x44'),_0x47186c['linkedid']);this[_0xcbaa('0x1b')](_0x47186c[_0xcbaa('0x43')]);}}catch(_0xcafc54){logger['error']('[ACW][syncHangupRequest]\x20%s',_0xcafc54[_0xcbaa('0x3e')]);}};Acw[_0xcbaa('0x1a')][_0xcbaa('0x10')]=function(_0x587303){try{if(this['channels'][_0x587303[_0xcbaa('0x2c')]]&&this[_0xcbaa('0x9')][_0x587303[_0xcbaa('0x2c')]][_0xcbaa('0x27')]){logger[_0xcbaa('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x587303['uniqueid']);this[_0xcbaa('0x1b')](_0x587303[_0xcbaa('0x2c')]);}else if(this[_0xcbaa('0x9')][_0x587303[_0xcbaa('0x43')]]&&this[_0xcbaa('0x9')][_0x587303[_0xcbaa('0x43')]]['attended']){logger[_0xcbaa('0x26')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x587303[_0xcbaa('0x43')]);this[_0xcbaa('0x1b')](_0x587303[_0xcbaa('0x43')]);}}catch(_0x34d5be){logger[_0xcbaa('0x31')](_0xcbaa('0x45'),_0x34d5be[_0xcbaa('0x3e')]);}};Acw[_0xcbaa('0x1a')]['syncAttendedTransfer']=function(_0x50bb02){try{if(!_['isNil'](this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x46')]])){this['startAcw'](_0x50bb02[_0xcbaa('0x46')]);if(this[_0xcbaa('0x9')][_0x50bb02['secondtransfereruniqueid']]){this['channels'][_0x50bb02[_0xcbaa('0x47')]][_0xcbaa('0x27')]=!![];this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x48')]]=this[_0xcbaa('0x9')][_0x50bb02['secondtransfereruniqueid']];delete this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x47')]];}}else if(!_[_0xcbaa('0x49')](this['channels'][_0x50bb02[_0xcbaa('0x48')]])){this[_0xcbaa('0x1b')](_0x50bb02[_0xcbaa('0x48')]);if(this['channels'][_0x50bb02[_0xcbaa('0x4a')]]){this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x4a')]]['attended']=!![];this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x46')]]=this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x4a')]];delete this[_0xcbaa('0x9')][_0x50bb02[_0xcbaa('0x4a')]];}}}catch(_0x4b3601){logger[_0xcbaa('0x31')](_0xcbaa('0x4b'),_0x4b3601[_0xcbaa('0x3e')]);}};Acw[_0xcbaa('0x1a')][_0xcbaa('0x14')]=function(_0x2ee0b2){try{if(this[_0xcbaa('0x9')][_0x2ee0b2[_0xcbaa('0x4c')]]){logger['info'](_0xcbaa('0x4d'),JSON[_0xcbaa('0x3c')](_0x2ee0b2[_0xcbaa('0x4c')]));this[_0xcbaa('0x1b')](_0x2ee0b2[_0xcbaa('0x4c')]);}else if(this[_0xcbaa('0x9')][_0x2ee0b2[_0xcbaa('0x4e')]]){logger[_0xcbaa('0x26')](_0xcbaa('0x4f'),JSON[_0xcbaa('0x3c')](_0x2ee0b2[_0xcbaa('0x4e')]));this[_0xcbaa('0x1b')](_0x2ee0b2['transfererlinkedid']);}}catch(_0x310f07){logger['error'](_0xcbaa('0x50'),_0x310f07[_0xcbaa('0x3e')]);}};Acw[_0xcbaa('0x1a')][_0xcbaa('0x11')]=function(_0x390113){try{if(this['voiceQueues'][_0x390113['queue']]&&this[_0xcbaa('0x6')][_0x390113[_0xcbaa('0x1c')]]['autopause']===_0xcbaa('0x51')){if(this[_0xcbaa('0x7')][_0x390113[_0xcbaa('0x3f')]]){logger[_0xcbaa('0x26')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x390113[_0xcbaa('0x2c')],_0x390113[_0xcbaa('0x3f')],_0x390113[_0xcbaa('0x1c')]);return RpcUser[_0xcbaa('0x29')](this['agents'][_0x390113[_0xcbaa('0x3f')]],'Auto-Pause',_0x390113[_0xcbaa('0x2c')]);}}}catch(_0x1a5c93){logger[_0xcbaa('0x31')](_0xcbaa('0x52'),_0x1a5c93[_0xcbaa('0x3e')]);}};module[_0xcbaa('0x53')]=Acw; \ No newline at end of file +var _0x0195=['bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect'];(function(_0x2a060e,_0x278992){var _0x4fef48=function(_0x30706c){while(--_0x30706c){_0x2a060e['push'](_0x2a060e['shift']());}};_0x4fef48(++_0x278992);}(_0x0195,0xa1));var _0x5019=function(_0x2cd826,_0x48b4fc){_0x2cd826=_0x2cd826-0x0;var _0x2f6daa=_0x0195[_0x2cd826];return _0x2f6daa;};'use strict';var util=require(_0x5019('0x0'));var _=require(_0x5019('0x1'));var moment=require(_0x5019('0x2'));var ami=require(_0x5019('0x3'));var logger=require(_0x5019('0x4'))(_0x5019('0x5'));var RpcUser=require(_0x5019('0x6'));var RpcVoiceAgentReport=require(_0x5019('0x7'));function Acw(_0x517819){this[_0x5019('0x8')]=_0x517819[_0x5019('0x8')];this[_0x5019('0x9')]=_0x517819[_0x5019('0x9')];this[_0x5019('0xa')]=_0x517819[_0x5019('0xa')];this[_0x5019('0xb')]={};ami['on'](_0x5019('0xc'),this['syncAgentConnect'][_0x5019('0xd')](this));ami['on'](_0x5019('0xe'),this[_0x5019('0xf')][_0x5019('0xd')](this));ami['on'](_0x5019('0x10'),this[_0x5019('0x11')][_0x5019('0xd')](this));ami['on'](_0x5019('0x12'),this['syncAgentRingNoAnswer'][_0x5019('0xd')](this));ami['on'](_0x5019('0x13'),this[_0x5019('0x14')][_0x5019('0xd')](this));ami['on']('blindtransfer',this[_0x5019('0x15')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x5019('0x16')][_0x5019('0xd')](this));}function getDiff(_0x452d16){var _0x52d01f=moment()[_0x5019('0x17')](0x0);var _0x416afb=moment(_0x452d16)[_0x5019('0x17')](0x0);return _0x52d01f[_0x5019('0x18')](_0x416afb,_0x5019('0x19'));}Acw[_0x5019('0x1a')]['startAcw']=function(_0x340624){try{var _0x3d7f61=this;var _0x122cd1=this[_0x5019('0xb')][_0x340624][_0x5019('0x1b')];var _0x3ac935=this[_0x5019('0xb')][_0x340624]['queue'];var _0x1200e5=this[_0x5019('0x8')][_0x3ac935];var _0x4de43d=![];var _0x7567a0=_0x5019('0x1c');if(_0x1200e5[_0x5019('0x1d')]){if(_0x1200e5[_0x5019('0x1e')][_0x5019('0x1f')]){_0x4de43d=!![];_0x7567a0=_0x1200e5[_0x5019('0x1e')][_0x5019('0x1f')];}}ami[_0x5019('0x20')]({'action':_0x5019('0x21'),'interface':_0x122cd1,'paused':!![],'reason':_0x7567a0})[_0x5019('0x22')](function(_0x193b01){if(_0x3d7f61[_0x5019('0x9')][_0x122cd1]){return RpcUser[_0x5019('0x23')](_0x3d7f61[_0x5019('0x9')][_0x122cd1]['id'])[_0x5019('0x22')](function(_0x761172){if(_0x761172&&!_0x761172[_0x5019('0x24')]){logger[_0x5019('0x25')](_0x5019('0x26'),_0x340624,_0x122cd1,_0x3ac935);var _0x262401=_0x3d7f61[_0x5019('0xb')][_0x340624][_0x5019('0x27')]&&_0x3d7f61[_0x5019('0xb')][_0x340624]['destlinkedid']?_0x3d7f61[_0x5019('0xb')][_0x340624][_0x5019('0x28')]:_0x340624;return RpcUser[_0x5019('0x29')](_0x3d7f61[_0x5019('0x9')][_0x122cd1],_0x7567a0,_0x262401)['then'](function(_0x17f36a){if(!_0x4de43d){_0x3d7f61[_0x5019('0xa')][_0x122cd1]={};logger[_0x5019('0x25')](_0x5019('0x2a'),_0x340624,_0x3d7f61[_0x5019('0x8')][_0x3ac935]['acwTimeout'],_0x122cd1,_0x3ac935);_0x3d7f61['timers'][_0x122cd1][_0x5019('0x2b')]=setTimeout(_0x3d7f61[_0x5019('0x2c')][_0x5019('0xd')](_0x3d7f61,_0x122cd1),_0x3d7f61[_0x5019('0x8')][_0x3ac935][_0x5019('0x2d')]*0x3e8);_0x3d7f61['timers'][_0x122cd1][_0x5019('0x2e')]=moment()['format'](_0x5019('0x2f'));_0x3d7f61['timers'][_0x122cd1][_0x5019('0x30')]=_0x340624;_0x3d7f61['timers'][_0x122cd1][_0x5019('0x31')]=_0x3ac935;_0x3d7f61[_0x5019('0xa')][_0x122cd1][_0x5019('0x32')]=function(){var _0x540a55=getDiff(_0x3d7f61['timers'][_0x122cd1][_0x5019('0x2e')]);clearTimeout(_0x3d7f61[_0x5019('0xa')][_0x122cd1][_0x5019('0x2b')]);_0x3d7f61[_0x5019('0xa')][_0x122cd1][_0x5019('0x2b')]=![];RpcVoiceAgentReport[_0x5019('0x33')]({'acwtime':_0x540a55},_0x3d7f61['timers'][_0x122cd1][_0x5019('0x30')],_0x122cd1)[_0x5019('0x22')](function(_0x49ceb8){logger[_0x5019('0x25')](_0x5019('0x34'),_0x340624,_0x540a55,_0x49ceb8);})[_0x5019('0x35')](function(_0x53eb5e){logger[_0x5019('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x340624,_0x53eb5e);});delete _0x3d7f61[_0x5019('0xa')][_0x122cd1];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x340624,_0x122cd1,_0x3ac935);}});}})[_0x5019('0x35')](function(_0x1ae4de){logger[_0x5019('0x36')](_0x5019('0x2a'),_0x340624,_0x3d7f61[_0x5019('0x8')][_0x3ac935][_0x5019('0x2d')],_0x122cd1,_0x3ac935);})['finally'](function(){delete _0x3d7f61[_0x5019('0xb')][_0x340624];});}catch(_0x18604a){logger['error'](_0x5019('0x37'),_0x18604a[_0x5019('0x38')]);}};Acw[_0x5019('0x1a')][_0x5019('0x2c')]=function(_0x483207){try{var _0x2d5635=this;if(_0x2d5635[_0x5019('0xa')][_0x483207]){_0x2d5635[_0x5019('0xa')][_0x483207][_0x5019('0x2b')]=![];var _0x4f0630=_0x2d5635[_0x5019('0xa')][_0x483207]['uniqueid'];var _0x3b6a3c=_0x2d5635['timers'][_0x483207][_0x5019('0x31')];var _0x70286=_0x2d5635['voiceQueues'][_0x3b6a3c][_0x5019('0x2d')];logger['info'](_0x5019('0x39'),_0x4f0630,_0x483207);RpcUser[_0x5019('0x3a')](this[_0x5019('0x9')][_0x483207]);RpcVoiceAgentReport[_0x5019('0x33')]({'acwtime':_0x70286,'agentacw':!![]},_0x4f0630,_0x483207)[_0x5019('0x22')](function(_0x2bb4ba){logger[_0x5019('0x25')](_0x5019('0x34'),_0x4f0630,_0x70286,_0x2bb4ba);})[_0x5019('0x35')](function(_0x427d45){logger[_0x5019('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x4f0630,_0x427d45);});}else{logger[_0x5019('0x36')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x483207);if(_0x2d5635['timers']){logger[_0x5019('0x25')](_0x5019('0x3b'),JSON[_0x5019('0x3c')](_0x2d5635['timers']));}}}catch(_0x2a5ac2){logger[_0x5019('0x36')](_0x5019('0x3d'),_0x2a5ac2['message']);}};Acw[_0x5019('0x1a')][_0x5019('0x3e')]=function(_0x394033){try{if(this[_0x5019('0x8')][_0x394033['queue']]&&(this[_0x5019('0x8')][_0x394033[_0x5019('0x31')]][_0x5019('0x5')]||this[_0x5019('0x8')][_0x394033[_0x5019('0x31')]][_0x5019('0x1d')])){if(this['agents'][_0x394033[_0x5019('0x1b')]]){this[_0x5019('0xb')][_0x394033['uniqueid']]={'queue':_0x394033[_0x5019('0x31')],'interface':_0x394033[_0x5019('0x1b')],'destlinkedid':_0x394033[_0x5019('0x28')]};}}}catch(_0x5a61b8){logger[_0x5019('0x36')](_0x5019('0x3f'),_0x5a61b8[_0x5019('0x38')]);}};Acw[_0x5019('0x1a')][_0x5019('0x16')]=function(_0x5d20ea){try{if(this[_0x5019('0x8')][_0x5d20ea[_0x5019('0x31')]]&&(this[_0x5019('0x8')][_0x5d20ea[_0x5019('0x31')]][_0x5019('0x5')]||this['voiceQueues'][_0x5d20ea['queue']]['mandatoryDisposition'])){if(this[_0x5019('0x9')][_0x5d20ea[_0x5019('0x1b')]]){this[_0x5019('0xb')][_0x5d20ea[_0x5019('0x30')]]={'queue':_0x5d20ea[_0x5019('0x31')],'interface':_0x5d20ea['interface']};}}}catch(_0xa98c2){logger[_0x5019('0x36')](_0x5019('0x40'),_0xa98c2[_0x5019('0x38')]);}};Acw[_0x5019('0x1a')][_0x5019('0xf')]=function(_0x318bf0){try{if(this[_0x5019('0xb')][_0x318bf0[_0x5019('0x30')]]&&_[_0x5019('0x41')](this[_0x5019('0xb')][_0x318bf0[_0x5019('0x30')]][_0x5019('0x27')])){logger[_0x5019('0x25')]('[%s][HANGUP:UNIQUEID]',_0x318bf0[_0x5019('0x30')]);this['startAcw'](_0x318bf0[_0x5019('0x30')]);}else if(this[_0x5019('0xb')][_0x318bf0[_0x5019('0x42')]]&&_[_0x5019('0x41')](this[_0x5019('0xb')][_0x318bf0[_0x5019('0x42')]][_0x5019('0x27')])){logger['info'](_0x5019('0x43'),_0x318bf0['linkedid']);this[_0x5019('0x44')](_0x318bf0[_0x5019('0x42')]);}}catch(_0x590ebc){logger[_0x5019('0x36')](_0x5019('0x45'),_0x590ebc[_0x5019('0x38')]);}};Acw[_0x5019('0x1a')][_0x5019('0x11')]=function(_0x202264){try{if(this[_0x5019('0xb')][_0x202264[_0x5019('0x30')]]&&this[_0x5019('0xb')][_0x202264['uniqueid']][_0x5019('0x27')]){logger[_0x5019('0x25')](_0x5019('0x46'),_0x202264['uniqueid']);this['startAcw'](_0x202264['uniqueid']);}else if(this[_0x5019('0xb')][_0x202264[_0x5019('0x42')]]&&this['channels'][_0x202264[_0x5019('0x42')]]['attended']){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x202264[_0x5019('0x42')]);this[_0x5019('0x44')](_0x202264[_0x5019('0x42')]);}}catch(_0x3bdbc6){logger[_0x5019('0x36')](_0x5019('0x47'),_0x3bdbc6[_0x5019('0x38')]);}};Acw[_0x5019('0x1a')][_0x5019('0x14')]=function(_0x987113){try{if(!_[_0x5019('0x48')](this[_0x5019('0xb')][_0x987113[_0x5019('0x49')]])){this[_0x5019('0x44')](_0x987113[_0x5019('0x49')]);if(this[_0x5019('0xb')][_0x987113[_0x5019('0x4a')]]){this[_0x5019('0xb')][_0x987113['secondtransfereruniqueid']][_0x5019('0x27')]=!![];this['channels'][_0x987113['transfertargetuniqueid']]=this[_0x5019('0xb')][_0x987113[_0x5019('0x4a')]];delete this[_0x5019('0xb')][_0x987113['secondtransfereruniqueid']];}}else if(!_[_0x5019('0x48')](this[_0x5019('0xb')][_0x987113['transfertargetuniqueid']])){this['startAcw'](_0x987113[_0x5019('0x4b')]);if(this[_0x5019('0xb')][_0x987113[_0x5019('0x4c')]]){this[_0x5019('0xb')][_0x987113['origtransfereruniqueid']][_0x5019('0x27')]=!![];this[_0x5019('0xb')][_0x987113['transfereeuniqueid']]=this[_0x5019('0xb')][_0x987113[_0x5019('0x4c')]];delete this[_0x5019('0xb')][_0x987113[_0x5019('0x4c')]];}}}catch(_0x241f61){logger[_0x5019('0x36')]('[ACW][syncAttendedTransfer]\x20%s',_0x241f61['message']);}};Acw[_0x5019('0x1a')]['syncBlindTransfer']=function(_0x2232d6){try{if(this[_0x5019('0xb')][_0x2232d6[_0x5019('0x4d')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x5019('0x3c')](_0x2232d6[_0x5019('0x4d')]));this[_0x5019('0x44')](_0x2232d6[_0x5019('0x4d')]);}else if(this[_0x5019('0xb')][_0x2232d6[_0x5019('0x4e')]]){logger['info'](_0x5019('0x4f'),JSON[_0x5019('0x3c')](_0x2232d6['transfererlinkedid']));this['startAcw'](_0x2232d6[_0x5019('0x4e')]);}}catch(_0x1ab56d){logger[_0x5019('0x36')](_0x5019('0x50'),_0x1ab56d['message']);}};Acw[_0x5019('0x1a')][_0x5019('0x51')]=function(_0x1e52b1){try{if(this[_0x5019('0x8')][_0x1e52b1[_0x5019('0x31')]]&&this[_0x5019('0x8')][_0x1e52b1[_0x5019('0x31')]][_0x5019('0x52')]===_0x5019('0x53')){if(this[_0x5019('0x9')][_0x1e52b1[_0x5019('0x1b')]]){logger[_0x5019('0x25')](_0x5019('0x54'),_0x1e52b1['uniqueid'],_0x1e52b1[_0x5019('0x1b')],_0x1e52b1[_0x5019('0x31')]);return RpcUser[_0x5019('0x29')](this[_0x5019('0x9')][_0x1e52b1[_0x5019('0x1b')]],_0x5019('0x55'),_0x1e52b1[_0x5019('0x30')]);}}}catch(_0x4f8441){logger[_0x5019('0x36')](_0x5019('0x56'),_0x4f8441[_0x5019('0x38')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index cea26dc..8cc75dd 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x2743f5,_0x5b96a1){_0x2743f5=_0x2743f5-0x0;var _0x3c4da6=_0x2032[_0x2743f5];return _0x3c4da6;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _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(_0x59b71b,_0x280249){var _0x4d551d=function(_0x5f50c8){while(--_0x5f50c8){_0x59b71b['push'](_0x59b71b['shift']());}};_0x4d551d(++_0x280249);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 169cfb2..b431815 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 _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x5b6375,_0x563718){var _0x4045b4=function(_0x314db8){while(--_0x314db8){_0x5b6375['push'](_0x5b6375['shift']());}};_0x4045b4(++_0x563718);}(_0xf4eb,0xec));var _0xbf4e=function(_0x7fa13a,_0x3e6005){_0x7fa13a=_0x7fa13a-0x0;var _0x3032dc=_0xf4eb[_0x7fa13a];return _0x3032dc;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 16bc02e..addeea9 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 _0x850b=['\x22%s\x22\x20<%s>','number','substring','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller'];(function(_0x592a04,_0x586afd){var _0x1fcf3d=function(_0x48693e){while(--_0x48693e){_0x592a04['push'](_0x592a04['shift']());}};_0x1fcf3d(++_0x586afd);}(_0x850b,0x1ea));var _0xb850=function(_0x38515b,_0x229ce4){_0x38515b=_0x38515b-0x0;var _0x34ea7b=_0x850b[_0x38515b];return _0x34ea7b;};'use strict';var util=require(_0xb850('0x0'));var _=require(_0xb850('0x1'));var moment=require(_0xb850('0x2'));function checkNameSurname(_0x7428f,_0xe5afe0,_0xf07329){var _0x5644b7='';if(!_[_0xb850('0x3')](_0xe5afe0)&&_0xb850('0x4')===typeof _0xe5afe0){_0x5644b7+=_0xe5afe0;}if(!_[_0xb850('0x3')](_0xf07329)&&_0xb850('0x4')===typeof _0xf07329){_0x5644b7+='\x20'+_0xf07329;}if(_0x5644b7!==''){return _0x5644b7;}return _0x7428f;}function Action(_0x113238,_0x76b95,_0x1c6265){this[_0xb850('0x5')]=_0x113238;this[_0xb850('0x6')]=_0x1c6265||undefined;this[_0xb850('0x7')]=checkNameSurname(_0x76b95[_0xb850('0x8')][_0xb850('0x9')],_0x76b95[_0xb850('0x8')][_0xb850('0xa')],_0x76b95[_0xb850('0x8')]['lastName']);this['number']=_0x76b95[_0xb850('0x9')];this['queue']=_0x113238[_0xb850('0x7')];this[_0xb850('0xb')]=_0x76b95[_0xb850('0xb')]||![];this[_0xb850('0xc')]=_0x113238['type'];this[_0xb850('0xd')]=_0x113238['dialQueueTimeout']||0x3;this[_0xb850('0xe')]=_0x76b95[_0xb850('0xe')];this[_0xb850('0xf')]=_0x76b95[_0xb850('0xf')];this['countcongestionretry']=_0x76b95[_0xb850('0x10')];this[_0xb850('0x11')]=_0x76b95['countnoanswerretry'];this[_0xb850('0x12')]=_0x76b95['countnosuchnumberretry'];this[_0xb850('0x13')]=_0x76b95[_0xb850('0x13')];this[_0xb850('0x14')]=_0x76b95[_0xb850('0x14')];this[_0xb850('0x15')]=_0x76b95[_0xb850('0x15')];this[_0xb850('0x16')]=_0x76b95['countagentrejectretry'];this[_0xb850('0x17')]=_0x76b95[_0xb850('0x17')];this['ListId']=_0x76b95['ListId'];this[_0xb850('0x18')]=_0x76b95['UserId'];this['VoiceQueueId']=_0x76b95[_0xb850('0x19')];this['CampaignId']=_0x76b95['CampaignId'];this[_0xb850('0x1a')]=_0x76b95['id'];this[_0xb850('0x1b')]=_0x76b95['Contact']['firstName']||'';this[_0xb850('0x1c')]=moment()[_0xb850('0x1d')](_0xb850('0x1e'));this[_0xb850('0x1f')]=_0x76b95['callback'];this[_0xb850('0x20')]=_0x76b95[_0xb850('0x20')];this[_0xb850('0x21')]=_0x76b95[_0xb850('0x21')];this[_0xb850('0x22')]=_0x76b95[_0xb850('0x22')];this['originatecalleridnum']='';this[_0xb850('0x23')]='';}Action[_0xb850('0x24')][_0xb850('0x25')]=function(){return util[_0xb850('0x1d')](_0xb850('0x26'),this['name'],this[_0xb850('0x5')]['dialCutDigit']>0x0?this[_0xb850('0x27')][_0xb850('0x28')](this['voiceQueue'][_0xb850('0x29')]):this[_0xb850('0x27')]);};Action[_0xb850('0x24')][_0xb850('0x2a')]=function(){return this['queue'];};module[_0xb850('0x2b')]=Action; \ No newline at end of file +var _0x7524=['countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','isNil','voiceQueue','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x3c5b7f,_0x19ea20){var _0x25e91d=function(_0x294612){while(--_0x294612){_0x3c5b7f['push'](_0x3c5b7f['shift']());}};_0x25e91d(++_0x19ea20);}(_0x7524,0x17d));var _0x4752=function(_0x3413a8,_0x40b341){_0x3413a8=_0x3413a8-0x0;var _0x4de467=_0x7524[_0x3413a8];return _0x4de467;};'use strict';var util=require(_0x4752('0x0'));var _=require(_0x4752('0x1'));var moment=require('moment');function checkNameSurname(_0x42b30c,_0xcff036,_0x1d088d){var _0x3c1df1='';if(!_['isNil'](_0xcff036)&&'string'===typeof _0xcff036){_0x3c1df1+=_0xcff036;}if(!_[_0x4752('0x2')](_0x1d088d)&&'string'===typeof _0x1d088d){_0x3c1df1+='\x20'+_0x1d088d;}if(_0x3c1df1!==''){return _0x3c1df1;}return _0x42b30c;}function Action(_0x163f66,_0x366896,_0x278181){this[_0x4752('0x3')]=_0x163f66;this['uniqueid']=_0x278181||undefined;this[_0x4752('0x4')]=checkNameSurname(_0x366896[_0x4752('0x5')]['phone'],_0x366896[_0x4752('0x5')][_0x4752('0x6')],_0x366896['Contact'][_0x4752('0x7')]);this[_0x4752('0x8')]=_0x366896[_0x4752('0x9')];this['queue']=_0x163f66['name'];this[_0x4752('0xa')]=_0x366896[_0x4752('0xa')]||![];this['type']=_0x163f66[_0x4752('0xb')];this[_0x4752('0xc')]=_0x163f66[_0x4752('0xc')]||0x3;this[_0x4752('0xd')]=_0x366896[_0x4752('0xd')];this[_0x4752('0xe')]=_0x366896[_0x4752('0xe')];this[_0x4752('0xf')]=_0x366896[_0x4752('0xf')];this['countnoanswerretry']=_0x366896[_0x4752('0x10')];this[_0x4752('0x11')]=_0x366896[_0x4752('0x11')];this[_0x4752('0x12')]=_0x366896[_0x4752('0x12')];this[_0x4752('0x13')]=_0x366896[_0x4752('0x13')];this['countmachineretry']=_0x366896[_0x4752('0x14')];this[_0x4752('0x15')]=_0x366896[_0x4752('0x15')];this['ContactId']=_0x366896['ContactId'];this[_0x4752('0x16')]=_0x366896[_0x4752('0x16')];this[_0x4752('0x17')]=_0x366896['UserId'];this['VoiceQueueId']=_0x366896[_0x4752('0x18')];this['CampaignId']=_0x366896['CampaignId'];this[_0x4752('0x19')]=_0x366896['id'];this['ContactFirstName']=_0x366896[_0x4752('0x5')][_0x4752('0x6')]||'';this[_0x4752('0x1a')]=moment()[_0x4752('0x1b')](_0x4752('0x1c'));this[_0x4752('0x1d')]=_0x366896['callback'];this['callbackuniqueid']=_0x366896[_0x4752('0x1e')];this[_0x4752('0x1f')]=_0x366896['callbackat'];this[_0x4752('0x20')]=_0x366896['recallme'];this['originatecalleridnum']='';this[_0x4752('0x21')]='';}Action[_0x4752('0x22')][_0x4752('0x23')]=function(){return util[_0x4752('0x1b')](_0x4752('0x24'),this['name'],this['voiceQueue'][_0x4752('0x25')]>0x0?this['number'][_0x4752('0x26')](this[_0x4752('0x3')]['dialCutDigit']):this[_0x4752('0x8')]);};Action[_0x4752('0x22')]['getQueue']=function(){return this['queue'];};module[_0x4752('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index ce70ea8..808561e 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 _0xb8db=['countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','recallme','ContactId','UserId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x52858d,_0x5cc13b){var _0x464cff=function(_0x257fc6){while(--_0x257fc6){_0x52858d['push'](_0x52858d['shift']());}};_0x464cff(++_0x5cc13b);}(_0xb8db,0x11e));var _0xbb8d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb8db[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xbb8d('0x0'));var _=require(_0xbb8d('0x1'));var moment=require(_0xbb8d('0x2'));function getSeconds(_0x3d4621,_0x43a093){var _0x435a37=moment(_0x3d4621)['milliseconds'](0x0);var _0x5d6560=moment(_0x43a093)['milliseconds'](0x0);return _0x435a37[_0xbb8d('0x3')](_0x5d6560,_0xbb8d('0x4'));}function AgentComplete(_0x56c5c0,_0x352b02){this['state']=0x4;this[_0xbb8d('0x5')]=_0xbb8d('0x6');this[_0xbb8d('0x7')]=_0x56c5c0[_0xbb8d('0x7')];this[_0xbb8d('0x8')]=_0x56c5c0['type'];this[_0xbb8d('0x9')]=_0x56c5c0[_0xbb8d('0x8')]===_0xbb8d('0xa')?'queue':_0x56c5c0[_0xbb8d('0x8')];this[_0xbb8d('0xb')]=_0x56c5c0['countbusyretry'];this[_0xbb8d('0xc')]=_0x56c5c0[_0xbb8d('0xc')];this[_0xbb8d('0xd')]=_0x56c5c0[_0xbb8d('0xd')];this[_0xbb8d('0xe')]=_0x56c5c0[_0xbb8d('0xb')]+_0x56c5c0[_0xbb8d('0xc')]+_0x56c5c0[_0xbb8d('0xd')]+_0x56c5c0[_0xbb8d('0xf')]+_0x56c5c0[_0xbb8d('0x10')]+_0x56c5c0['countabandonedretry']+_0x56c5c0['countmachineretry']+_0x56c5c0[_0xbb8d('0x11')];this[_0xbb8d('0xf')]=_0x56c5c0[_0xbb8d('0xf')];this[_0xbb8d('0x10')]=_0x56c5c0[_0xbb8d('0x10')];this[_0xbb8d('0x12')]=_0x56c5c0[_0xbb8d('0x12')];this[_0xbb8d('0x13')]=_0x56c5c0['countmachineretry'];this['countagentrejectretry']=_0x56c5c0[_0xbb8d('0x11')];this[_0xbb8d('0x14')]=_0x352b02[_0xbb8d('0x14')];this['calleridname']=_0x56c5c0[_0xbb8d('0x15')];this[_0xbb8d('0x16')]=_0x56c5c0['number'];this[_0xbb8d('0x17')]=_0x56c5c0[_0xbb8d('0x17')];this[_0xbb8d('0x18')]=_0x56c5c0[_0xbb8d('0x18')];this['answertime']=_0x56c5c0[_0xbb8d('0x19')];this[_0xbb8d('0x1a')]=moment()[_0xbb8d('0x1b')](_0xbb8d('0x1c'));this[_0xbb8d('0x1d')]=getSeconds(_0x56c5c0['responsetime'],_0x56c5c0[_0xbb8d('0x17')]);this[_0xbb8d('0x1e')]=getSeconds(_0x56c5c0[_0xbb8d('0x19')],_0x56c5c0['responsetime']);this[_0xbb8d('0x1f')]=getSeconds(this[_0xbb8d('0x1a')],_0x56c5c0['answertime']);this[_0xbb8d('0x20')]=_0x352b02[_0xbb8d('0x20')];this[_0xbb8d('0x21')]=_0x352b02[_0xbb8d('0x21')];this['reason']=_0x352b02[_0xbb8d('0x22')];this[_0xbb8d('0x23')]=_0x56c5c0[_0xbb8d('0x23')];this[_0xbb8d('0x24')]=_0x56c5c0[_0xbb8d('0x24')];this['callbackat']=_0x56c5c0['callbackat'];this[_0xbb8d('0x25')]=_0x56c5c0[_0xbb8d('0x25')];this[_0xbb8d('0x26')]=_0x56c5c0['ContactId'];this['ListId']=_0x56c5c0['ListId'];this[_0xbb8d('0x27')]=_0x56c5c0['UserId'];this['VoiceQueueId']=_0x56c5c0['VoiceQueueId'];this['CampaignId']=_0x56c5c0['CampaignId'];this['originatecalleridnum']=_0x56c5c0[_0xbb8d('0x28')]||'';this['originatecalleridname']=_0x56c5c0[_0xbb8d('0x29')]||'';}module[_0xbb8d('0x2a')]=AgentComplete; \ No newline at end of file +var _0x4519=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','responsetime','talktime','membername','reason','callback','callbackuniqueid','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x4519,0x1e6));var _0x9451=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4519[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x9451('0x0'));var _=require(_0x9451('0x1'));var moment=require(_0x9451('0x2'));function getSeconds(_0xd67953,_0x3e3ba1){var _0x117700=moment(_0xd67953)[_0x9451('0x3')](0x0);var _0x25b79a=moment(_0x3e3ba1)[_0x9451('0x3')](0x0);return _0x117700[_0x9451('0x4')](_0x25b79a,_0x9451('0x5'));}function AgentComplete(_0x148540,_0x3bad14){this[_0x9451('0x6')]=0x4;this[_0x9451('0x7')]=_0x9451('0x8');this[_0x9451('0x9')]=_0x148540[_0x9451('0x9')];this[_0x9451('0xa')]=_0x148540[_0x9451('0xa')];this['campaigntype']=_0x148540['type']===_0x9451('0xb')?_0x9451('0xc'):_0x148540[_0x9451('0xa')];this[_0x9451('0xd')]=_0x148540[_0x9451('0xd')];this[_0x9451('0xe')]=_0x148540[_0x9451('0xe')];this[_0x9451('0xf')]=_0x148540[_0x9451('0xf')];this['countglobal']=_0x148540[_0x9451('0xd')]+_0x148540[_0x9451('0xe')]+_0x148540[_0x9451('0xf')]+_0x148540[_0x9451('0x10')]+_0x148540['countdropretry']+_0x148540[_0x9451('0x11')]+_0x148540[_0x9451('0x12')]+_0x148540[_0x9451('0x13')];this[_0x9451('0x10')]=_0x148540[_0x9451('0x10')];this[_0x9451('0x14')]=_0x148540['countdropretry'];this[_0x9451('0x11')]=_0x148540[_0x9451('0x11')];this[_0x9451('0x12')]=_0x148540[_0x9451('0x12')];this['countagentrejectretry']=_0x148540[_0x9451('0x13')];this[_0x9451('0x15')]=_0x3bad14[_0x9451('0x15')];this[_0x9451('0x16')]=_0x148540[_0x9451('0x17')];this[_0x9451('0x18')]=_0x148540[_0x9451('0x19')];this[_0x9451('0x1a')]=_0x148540[_0x9451('0x1a')];this['responsetime']=_0x148540['responsetime'];this['answertime']=_0x148540[_0x9451('0x1b')];this[_0x9451('0x1c')]=moment()['format'](_0x9451('0x1d'));this['ringtime']=getSeconds(_0x148540['responsetime'],_0x148540['starttime']);this[_0x9451('0x1e')]=getSeconds(_0x148540[_0x9451('0x1b')],_0x148540[_0x9451('0x1f')]);this[_0x9451('0x20')]=getSeconds(this[_0x9451('0x1c')],_0x148540[_0x9451('0x1b')]);this[_0x9451('0xc')]=_0x3bad14[_0x9451('0xc')];this[_0x9451('0x21')]=_0x3bad14['membername'];this[_0x9451('0x22')]=_0x3bad14['reason'];this[_0x9451('0x23')]=_0x148540[_0x9451('0x23')];this[_0x9451('0x24')]=_0x148540[_0x9451('0x24')];this['callbackat']=_0x148540['callbackat'];this['recallme']=_0x148540['recallme'];this['ContactId']=_0x148540[_0x9451('0x25')];this[_0x9451('0x26')]=_0x148540['ListId'];this[_0x9451('0x27')]=_0x148540[_0x9451('0x27')];this[_0x9451('0x28')]=_0x148540[_0x9451('0x28')];this[_0x9451('0x29')]=_0x148540[_0x9451('0x29')];this['originatecalleridnum']=_0x148540[_0x9451('0x2a')]||'';this[_0x9451('0x2b')]=_0x148540[_0x9451('0x2b')]||'';}module[_0x9451('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 10da40c..6b622a5 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 _0x31af=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x85b381,_0x1e50ab){var _0x324f2a=function(_0x3dfc3a){while(--_0x3dfc3a){_0x85b381['push'](_0x85b381['shift']());}};_0x324f2a(++_0x1e50ab);}(_0x31af,0xde));var _0xf31a=function(_0x58f6ac,_0xccf6bc){_0x58f6ac=_0x58f6ac-0x0;var _0x36e6a4=_0x31af[_0x58f6ac];return _0x36e6a4;};'use strict';var util=require(_0xf31a('0x0'));var _=require(_0xf31a('0x1'));var moment=require(_0xf31a('0x2'));function getSeconds(_0x4d5e50,_0x5f5639){var _0x4596f6=moment(_0x4d5e50)['milliseconds'](0x0);var _0x3b7976=moment(_0x5f5639)[_0xf31a('0x3')](0x0);return _0x4596f6[_0xf31a('0x4')](_0x3b7976,_0xf31a('0x5'));}function Final(_0x5ad096){this[_0xf31a('0x6')]=_0x5ad096[_0xf31a('0x6')];this[_0xf31a('0x7')]=_0x5ad096[_0xf31a('0x7')];this['type']=_0x5ad096[_0xf31a('0x8')];this[_0xf31a('0x9')]=_0x5ad096[_0xf31a('0x8')]===_0xf31a('0xa')?'queue':_0x5ad096[_0xf31a('0x8')];this[_0xf31a('0xb')]=_0x5ad096[_0xf31a('0xb')];this[_0xf31a('0xc')]=_0x5ad096[_0xf31a('0xc')];this['countnoanswerretry']=_0x5ad096[_0xf31a('0xd')];this[_0xf31a('0xe')]=_0x5ad096[_0xf31a('0xb')]+_0x5ad096[_0xf31a('0xc')]+_0x5ad096['countnoanswerretry']+_0x5ad096[_0xf31a('0xf')]+_0x5ad096[_0xf31a('0x10')]+_0x5ad096['countabandonedretry']+_0x5ad096[_0xf31a('0x11')]+_0x5ad096[_0xf31a('0x12')];this[_0xf31a('0xf')]=_0x5ad096[_0xf31a('0xf')];this[_0xf31a('0x10')]=_0x5ad096[_0xf31a('0x10')];this[_0xf31a('0x13')]=_0x5ad096[_0xf31a('0x13')];this[_0xf31a('0x11')]=_0x5ad096[_0xf31a('0x11')];this[_0xf31a('0x12')]=_0x5ad096[_0xf31a('0x12')];this[_0xf31a('0x14')]=_0x5ad096[_0xf31a('0x14')];this[_0xf31a('0x15')]=_0x5ad096['calleridname'];this[_0xf31a('0x16')]=_0x5ad096[_0xf31a('0x16')];this[_0xf31a('0x17')]=_0x5ad096[_0xf31a('0x17')];this['responsetime']=_0x5ad096[_0xf31a('0x18')];this[_0xf31a('0x19')]=_0x5ad096[_0xf31a('0x18')];this[_0xf31a('0x1a')]=_0x5ad096[_0xf31a('0x1a')]||0x0;this['holdtime']=_0x5ad096[_0xf31a('0x1b')]||0x0;this[_0xf31a('0x1c')]=_0x5ad096['talktime']||0x0;this[_0xf31a('0x1d')]=_0x5ad096[_0xf31a('0x1d')];this['callbackuniqueid']=_0x5ad096[_0xf31a('0x1e')];this[_0xf31a('0x1f')]=_0x5ad096['callbackat'];this['recallme']=_0x5ad096['recallme'];this[_0xf31a('0x20')]=_0x5ad096[_0xf31a('0x20')];this['ListId']=_0x5ad096[_0xf31a('0x21')];this[_0xf31a('0x22')]=_0x5ad096[_0xf31a('0x22')];this[_0xf31a('0x23')]=_0x5ad096['VoiceQueueId'];this['CampaignId']=_0x5ad096[_0xf31a('0x24')];this[_0xf31a('0x25')]=_0x5ad096['originatecalleridnum']||'';this['originatecalleridname']=_0x5ad096['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0xa9b1=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x59b08d,_0x5b7963){var _0x1e2295=function(_0x64f2a2){while(--_0x64f2a2){_0x59b08d['push'](_0x59b08d['shift']());}};_0x1e2295(++_0x5b7963);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1a9b('0x0'));function getSeconds(_0xf563ae,_0x11c1ff){var _0x3f42db=moment(_0xf563ae)[_0x1a9b('0x1')](0x0);var _0x10c90c=moment(_0x11c1ff)['milliseconds'](0x0);return _0x3f42db['diff'](_0x10c90c,'seconds');}function Final(_0x307aba){this[_0x1a9b('0x2')]=_0x307aba[_0x1a9b('0x2')];this[_0x1a9b('0x3')]=_0x307aba[_0x1a9b('0x3')];this[_0x1a9b('0x4')]=_0x307aba[_0x1a9b('0x4')];this[_0x1a9b('0x5')]=_0x307aba[_0x1a9b('0x4')]===_0x1a9b('0x6')?_0x1a9b('0x7'):_0x307aba[_0x1a9b('0x4')];this['countbusyretry']=_0x307aba['countbusyretry'];this[_0x1a9b('0x8')]=_0x307aba[_0x1a9b('0x8')];this[_0x1a9b('0x9')]=_0x307aba['countnoanswerretry'];this['countglobal']=_0x307aba['countbusyretry']+_0x307aba[_0x1a9b('0x8')]+_0x307aba[_0x1a9b('0x9')]+_0x307aba[_0x1a9b('0xa')]+_0x307aba[_0x1a9b('0xb')]+_0x307aba[_0x1a9b('0xc')]+_0x307aba[_0x1a9b('0xd')]+_0x307aba['countagentrejectretry'];this[_0x1a9b('0xa')]=_0x307aba[_0x1a9b('0xa')];this[_0x1a9b('0xb')]=_0x307aba['countdropretry'];this[_0x1a9b('0xc')]=_0x307aba[_0x1a9b('0xc')];this['countmachineretry']=_0x307aba[_0x1a9b('0xd')];this['countagentrejectretry']=_0x307aba[_0x1a9b('0xe')];this[_0x1a9b('0x7')]=_0x307aba[_0x1a9b('0x7')];this[_0x1a9b('0xf')]=_0x307aba[_0x1a9b('0xf')];this[_0x1a9b('0x10')]=_0x307aba[_0x1a9b('0x10')];this[_0x1a9b('0x11')]=_0x307aba[_0x1a9b('0x11')];this[_0x1a9b('0x12')]=_0x307aba['responsetime'];this[_0x1a9b('0x13')]=_0x307aba[_0x1a9b('0x12')];this[_0x1a9b('0x14')]=_0x307aba[_0x1a9b('0x14')]||0x0;this['holdtime']=_0x307aba[_0x1a9b('0x15')]||0x0;this[_0x1a9b('0x16')]=_0x307aba['talktime']||0x0;this[_0x1a9b('0x17')]=_0x307aba[_0x1a9b('0x17')];this[_0x1a9b('0x18')]=_0x307aba[_0x1a9b('0x18')];this[_0x1a9b('0x19')]=_0x307aba['callbackat'];this[_0x1a9b('0x1a')]=_0x307aba[_0x1a9b('0x1a')];this[_0x1a9b('0x1b')]=_0x307aba[_0x1a9b('0x1b')];this[_0x1a9b('0x1c')]=_0x307aba[_0x1a9b('0x1c')];this[_0x1a9b('0x1d')]=_0x307aba['UserId'];this[_0x1a9b('0x1e')]=_0x307aba['VoiceQueueId'];this[_0x1a9b('0x1f')]=_0x307aba[_0x1a9b('0x1f')];this[_0x1a9b('0x20')]=_0x307aba['originatecalleridnum']||'';this[_0x1a9b('0x21')]=_0x307aba[_0x1a9b('0x21')]||'';}module[_0x1a9b('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index fcc096c..2ccbab6 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 _0xc39a=['calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xc39a,0x1d8));var _0xac39=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xc39a[_0x10df18];return _0x1f9a1d;};'use strict';var util=require(_0xac39('0x0'));var _=require('lodash');var moment=require(_0xac39('0x1'));function getSeconds(_0x1ed405,_0x741745){var _0x4646ef=moment(_0x1ed405)[_0xac39('0x2')](0x0);var _0x459b62=moment(_0x741745)[_0xac39('0x2')](0x0);return _0x4646ef[_0xac39('0x3')](_0x459b62,_0xac39('0x4'));}function Hangup(_0x1a866e,_0x2e023a){this[_0xac39('0x5')]=0x4;this[_0xac39('0x6')]='Answer';this['scheduledat']=_0x1a866e[_0xac39('0x7')];this['type']=_0x1a866e['type'];this[_0xac39('0x8')]=_0x1a866e[_0xac39('0x9')]===_0xac39('0xa')?_0xac39('0xb'):_0x1a866e[_0xac39('0x9')];this[_0xac39('0xc')]=_0x1a866e['countbusyretry'];this[_0xac39('0xd')]=_0x1a866e['countcongestionretry'];this[_0xac39('0xe')]=_0x1a866e[_0xac39('0xe')];this[_0xac39('0xf')]=_0x1a866e[_0xac39('0xc')]+_0x1a866e[_0xac39('0xd')]+_0x1a866e[_0xac39('0xe')]+_0x1a866e[_0xac39('0x10')]+_0x1a866e[_0xac39('0x11')]+_0x1a866e[_0xac39('0x12')]+_0x1a866e[_0xac39('0x13')]+_0x1a866e[_0xac39('0x14')];this[_0xac39('0x10')]=_0x1a866e[_0xac39('0x10')];this[_0xac39('0x11')]=_0x1a866e[_0xac39('0x11')];this[_0xac39('0x12')]=_0x1a866e[_0xac39('0x12')];this[_0xac39('0x13')]=_0x1a866e[_0xac39('0x13')];this[_0xac39('0x14')]=_0x1a866e[_0xac39('0x14')];this['uniqueid']=_0x2e023a['uniqueid'];this[_0xac39('0x15')]=_0x1a866e[_0xac39('0x16')];this[_0xac39('0x17')]=_0x1a866e[_0xac39('0x18')];this[_0xac39('0x19')]=_0x1a866e['starttime'];this[_0xac39('0x1a')]=_0x1a866e[_0xac39('0x1a')];this[_0xac39('0x1b')]=moment()[_0xac39('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xac39('0x1d')]=getSeconds(_0x1a866e[_0xac39('0x1a')],_0x1a866e[_0xac39('0x19')]);this[_0xac39('0x1e')]=0x0;this[_0xac39('0x1f')]=getSeconds(this[_0xac39('0x1b')],_0x1a866e[_0xac39('0x1a')]);this[_0xac39('0xb')]=_0x1a866e[_0xac39('0xb')];this[_0xac39('0x20')]=_0xac39('0x21');this[_0xac39('0x22')]=_0x2e023a[_0xac39('0x23')];this[_0xac39('0x24')]=_0x1a866e[_0xac39('0x24')];this[_0xac39('0x25')]=_0x1a866e[_0xac39('0x25')];this[_0xac39('0x26')]=_0x1a866e[_0xac39('0x26')];this['recallme']=_0x1a866e[_0xac39('0x27')];this[_0xac39('0x28')]=_0x1a866e[_0xac39('0x28')];this[_0xac39('0x29')]=_0x1a866e[_0xac39('0x29')];this[_0xac39('0x2a')]=_0x1a866e[_0xac39('0x2a')];this[_0xac39('0x2b')]=_0x1a866e['VoiceQueueId'];this[_0xac39('0x2c')]=_0x1a866e[_0xac39('0x2c')];}module['exports']=Hangup; \ No newline at end of file +var _0x1338=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2dea8f,_0x2cbfc7){var _0x3f939a=function(_0x4bac99){while(--_0x4bac99){_0x2dea8f['push'](_0x2dea8f['shift']());}};_0x3f939a(++_0x2cbfc7);}(_0x1338,0xe9));var _0x8133=function(_0xecd69e,_0x3109c0){_0xecd69e=_0xecd69e-0x0;var _0x5531bf=_0x1338[_0xecd69e];return _0x5531bf;};'use strict';var util=require(_0x8133('0x0'));var _=require(_0x8133('0x1'));var moment=require('moment');function getSeconds(_0xfb39e7,_0x313c1d){var _0x43981d=moment(_0xfb39e7)[_0x8133('0x2')](0x0);var _0x2206d6=moment(_0x313c1d)[_0x8133('0x2')](0x0);return _0x43981d['diff'](_0x2206d6,'seconds');}function Hangup(_0x3d0c20,_0x251595){this[_0x8133('0x3')]=0x4;this[_0x8133('0x4')]='Answer';this[_0x8133('0x5')]=_0x3d0c20['scheduledat'];this[_0x8133('0x6')]=_0x3d0c20[_0x8133('0x6')];this[_0x8133('0x7')]=_0x3d0c20[_0x8133('0x6')]===_0x8133('0x8')?_0x8133('0x9'):_0x3d0c20[_0x8133('0x6')];this[_0x8133('0xa')]=_0x3d0c20[_0x8133('0xa')];this[_0x8133('0xb')]=_0x3d0c20[_0x8133('0xb')];this[_0x8133('0xc')]=_0x3d0c20[_0x8133('0xc')];this[_0x8133('0xd')]=_0x3d0c20[_0x8133('0xa')]+_0x3d0c20[_0x8133('0xb')]+_0x3d0c20[_0x8133('0xc')]+_0x3d0c20[_0x8133('0xe')]+_0x3d0c20[_0x8133('0xf')]+_0x3d0c20[_0x8133('0x10')]+_0x3d0c20[_0x8133('0x11')]+_0x3d0c20['countagentrejectretry'];this[_0x8133('0xe')]=_0x3d0c20['countnosuchnumberretry'];this[_0x8133('0xf')]=_0x3d0c20[_0x8133('0xf')];this[_0x8133('0x10')]=_0x3d0c20['countabandonedretry'];this['countmachineretry']=_0x3d0c20['countmachineretry'];this[_0x8133('0x12')]=_0x3d0c20[_0x8133('0x12')];this[_0x8133('0x13')]=_0x251595['uniqueid'];this['calleridname']=_0x3d0c20[_0x8133('0x14')];this['calleridnum']=_0x3d0c20[_0x8133('0x15')];this[_0x8133('0x16')]=_0x3d0c20[_0x8133('0x16')];this[_0x8133('0x17')]=_0x3d0c20[_0x8133('0x17')];this[_0x8133('0x18')]=moment()[_0x8133('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x3d0c20['responsetime'],_0x3d0c20[_0x8133('0x16')]);this[_0x8133('0x1a')]=0x0;this[_0x8133('0x1b')]=getSeconds(this[_0x8133('0x18')],_0x3d0c20[_0x8133('0x17')]);this[_0x8133('0x9')]=_0x3d0c20[_0x8133('0x9')];this[_0x8133('0x1c')]=_0x8133('0x1d');this[_0x8133('0x1e')]=_0x251595[_0x8133('0x1f')];this[_0x8133('0x20')]=_0x3d0c20[_0x8133('0x20')];this[_0x8133('0x21')]=_0x3d0c20[_0x8133('0x21')];this['callbackat']=_0x3d0c20[_0x8133('0x22')];this['recallme']=_0x3d0c20[_0x8133('0x23')];this[_0x8133('0x24')]=_0x3d0c20['ContactId'];this[_0x8133('0x25')]=_0x3d0c20['ListId'];this[_0x8133('0x26')]=_0x3d0c20[_0x8133('0x26')];this[_0x8133('0x27')]=_0x3d0c20[_0x8133('0x27')];this[_0x8133('0x28')]=_0x3d0c20['CampaignId'];}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 8991b89..b6c6bdc 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 _0x5b18=['countagentrejectretry','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0x5b18,0x199));var _0x85b1=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x5b18[_0x76b00b];return _0xc8e4a;};'use strict';var util=require(_0x85b1('0x0'));var _=require(_0x85b1('0x1'));var moment=require(_0x85b1('0x2'));function getSeconds(_0x142e91,_0x215ab2){var _0x55fcb4=moment(_0x142e91)[_0x85b1('0x3')](0x0);var _0x33a02e=moment(_0x215ab2)['milliseconds'](0x0);return _0x55fcb4[_0x85b1('0x4')](_0x33a02e,_0x85b1('0x5'));}function History(_0x4ba7d7){this[_0x85b1('0x6')]=_0x4ba7d7['uniqueid'];this[_0x85b1('0x7')]=_0x4ba7d7[_0x85b1('0x7')]||undefined;this['type']=_0x4ba7d7[_0x85b1('0x8')];this[_0x85b1('0x9')]=_0x4ba7d7[_0x85b1('0x8')]===_0x85b1('0xa')?_0x85b1('0xb'):_0x4ba7d7[_0x85b1('0x8')];this['countbusyretry']=_0x4ba7d7[_0x85b1('0xc')];this['countcongestionretry']=_0x4ba7d7[_0x85b1('0xd')];this[_0x85b1('0xe')]=_0x4ba7d7[_0x85b1('0xe')];this[_0x85b1('0xf')]=_0x4ba7d7[_0x85b1('0xc')]+_0x4ba7d7['countcongestionretry']+_0x4ba7d7[_0x85b1('0xe')]+_0x4ba7d7[_0x85b1('0x10')]+_0x4ba7d7[_0x85b1('0x11')]+_0x4ba7d7[_0x85b1('0x12')]+_0x4ba7d7[_0x85b1('0x13')]+_0x4ba7d7['countagentrejectretry'];this[_0x85b1('0x10')]=_0x4ba7d7[_0x85b1('0x10')];this[_0x85b1('0x11')]=_0x4ba7d7['countdropretry'];this['countabandonedretry']=_0x4ba7d7[_0x85b1('0x12')];this['countmachineretry']=_0x4ba7d7[_0x85b1('0x13')];this[_0x85b1('0x14')]=_0x4ba7d7['countagentrejectretry'];this['queue']=_0x4ba7d7[_0x85b1('0xb')];this['calleridname']=_0x4ba7d7['name'];this[_0x85b1('0x15')]=_0x4ba7d7[_0x85b1('0x16')];this['starttime']=_0x4ba7d7[_0x85b1('0x17')];this[_0x85b1('0x18')]=_0x4ba7d7['responsetime'];this[_0x85b1('0x19')]=_0x4ba7d7[_0x85b1('0x18')];this[_0x85b1('0x1a')]=getSeconds(_0x4ba7d7['responsetime'],_0x4ba7d7[_0x85b1('0x17')]);this['holdtime']=0x0;this[_0x85b1('0x1b')]=0x0;this[_0x85b1('0x1c')]=_0x4ba7d7[_0x85b1('0x1c')];this[_0x85b1('0x1d')]=_0x4ba7d7[_0x85b1('0x1d')];this[_0x85b1('0x1e')]=_0x4ba7d7[_0x85b1('0x1e')];this[_0x85b1('0x1f')]=_0x4ba7d7[_0x85b1('0x1f')];this[_0x85b1('0x20')]=_0x4ba7d7[_0x85b1('0x20')];this[_0x85b1('0x21')]=_0x4ba7d7['ListId'];this[_0x85b1('0x22')]=_0x4ba7d7['UserId'];this['VoiceQueueId']=_0x4ba7d7['VoiceQueueId'];this[_0x85b1('0x23')]=_0x4ba7d7[_0x85b1('0x23')];this[_0x85b1('0x24')]=_0x4ba7d7[_0x85b1('0x24')]||'';this[_0x85b1('0x25')]=_0x4ba7d7['originatecalleridname']||'';}module[_0x85b1('0x26')]=History; \ No newline at end of file +var _0x4e55=['uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds'];(function(_0x4c3e3b,_0x4f3856){var _0x356785=function(_0x31a61d){while(--_0x31a61d){_0x4c3e3b['push'](_0x4c3e3b['shift']());}};_0x356785(++_0x4f3856);}(_0x4e55,0x12b));var _0x54e5=function(_0x137bdd,_0x43a31f){_0x137bdd=_0x137bdd-0x0;var _0x2656a5=_0x4e55[_0x137bdd];return _0x2656a5;};'use strict';var util=require('util');var _=require(_0x54e5('0x0'));var moment=require(_0x54e5('0x1'));function getSeconds(_0x1e8bdf,_0x3e3819){var _0x4109f5=moment(_0x1e8bdf)[_0x54e5('0x2')](0x0);var _0x15f923=moment(_0x3e3819)[_0x54e5('0x2')](0x0);return _0x4109f5[_0x54e5('0x3')](_0x15f923,_0x54e5('0x4'));}function History(_0x937c){this[_0x54e5('0x5')]=_0x937c[_0x54e5('0x5')];this['scheduledat']=_0x937c[_0x54e5('0x6')]||undefined;this[_0x54e5('0x7')]=_0x937c[_0x54e5('0x7')];this['campaigntype']=_0x937c[_0x54e5('0x7')]===_0x54e5('0x8')?_0x54e5('0x9'):_0x937c[_0x54e5('0x7')];this[_0x54e5('0xa')]=_0x937c['countbusyretry'];this[_0x54e5('0xb')]=_0x937c[_0x54e5('0xb')];this[_0x54e5('0xc')]=_0x937c[_0x54e5('0xc')];this[_0x54e5('0xd')]=_0x937c[_0x54e5('0xa')]+_0x937c[_0x54e5('0xb')]+_0x937c[_0x54e5('0xc')]+_0x937c[_0x54e5('0xe')]+_0x937c[_0x54e5('0xf')]+_0x937c[_0x54e5('0x10')]+_0x937c['countmachineretry']+_0x937c[_0x54e5('0x11')];this['countnosuchnumberretry']=_0x937c[_0x54e5('0xe')];this['countdropretry']=_0x937c[_0x54e5('0xf')];this[_0x54e5('0x10')]=_0x937c['countabandonedretry'];this[_0x54e5('0x12')]=_0x937c[_0x54e5('0x12')];this[_0x54e5('0x11')]=_0x937c[_0x54e5('0x11')];this[_0x54e5('0x9')]=_0x937c[_0x54e5('0x9')];this[_0x54e5('0x13')]=_0x937c['name'];this['calleridnum']=_0x937c[_0x54e5('0x14')];this[_0x54e5('0x15')]=_0x937c[_0x54e5('0x15')];this['responsetime']=_0x937c[_0x54e5('0x16')];this[_0x54e5('0x17')]=_0x937c[_0x54e5('0x16')];this[_0x54e5('0x18')]=getSeconds(_0x937c[_0x54e5('0x16')],_0x937c[_0x54e5('0x15')]);this[_0x54e5('0x19')]=0x0;this[_0x54e5('0x1a')]=0x0;this[_0x54e5('0x1b')]=_0x937c[_0x54e5('0x1b')];this['callbackuniqueid']=_0x937c[_0x54e5('0x1c')];this['callbackat']=_0x937c[_0x54e5('0x1d')];this[_0x54e5('0x1e')]=_0x937c[_0x54e5('0x1e')];this['ContactId']=_0x937c[_0x54e5('0x1f')];this[_0x54e5('0x20')]=_0x937c[_0x54e5('0x20')];this[_0x54e5('0x21')]=_0x937c[_0x54e5('0x21')];this[_0x54e5('0x22')]=_0x937c[_0x54e5('0x22')];this['CampaignId']=_0x937c[_0x54e5('0x23')];this[_0x54e5('0x24')]=_0x937c[_0x54e5('0x24')]||'';this[_0x54e5('0x25')]=_0x937c[_0x54e5('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e7cdc28..7d7a65f 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 _0xa9e0=['reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countbusyretry','countnosuchnumberretry','countdropretry','stateGlobal','rescheduleContact','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','stateinterface','queueBooked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','inspect','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','push','command','iftime\x20%s,%s','timezones','indexOf','true','content','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','syncQueueSummary','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','syncCampaigns','checkIfTime','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','originate','voiceQueue\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','outbound','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','phone','variables','trim','substring','SIP/%s/%s%s','dialCutDigit','from-sip','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','[countReScheduled]\x20','emptyContact','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','RUNNING','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','p\x20=\x20','[abandonmentRate]','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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','seconds','type','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','md5','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','catch','resolve','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','amdstatus','exten','dialAMDActive','value','HANGUP','uniqueid','statedesc','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var ut=require('../preview/util/util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerBooked=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var loggerPredictive=require('../../../config/logger')(_0x0a9e('0x8'));var loggerPredictiveCalls=require(_0x0a9e('0x5'))(_0x0a9e('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x0a9e('0xa'));config['redis']=_['defaults'](config[_0x0a9e('0xb')],{'host':_0x0a9e('0xc'),'port':0x18eb});var io=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xb')]));var cmHopper=require(_0x0a9e('0xe'));var cmHopperHistory=require(_0x0a9e('0xf'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x0a9e('0x10'));var History=require(_0x0a9e('0x11'));var Final=require(_0x0a9e('0x12'));var AgentComplete=require(_0x0a9e('0x13'));var QueueCallerAbandon=require(_0x0a9e('0x14'));var Hangup=require(_0x0a9e('0x15'));var ipAgi=process['env'][_0x0a9e('0x16')]||_0x0a9e('0x17');var strategy={'rrmemory':_0x0a9e('0x18'),'roundrobin':_0x0a9e('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0a9e('0x1a')][_0x0a9e('0x1b')]=function(_0x52a03d){this[_0x0a9e('0x1c')]=this['tail']?this[_0x0a9e('0x1c')]['finally'](_0x52a03d):_0x52a03d();};function Dialer(_0x16033c,_0x12066b){this['sequence']=new Sequence();this[_0x0a9e('0x1d')]=_0x12066b;this['voiceQueues']=_0x16033c[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x16033c[_0x0a9e('0x1f')];this[_0x0a9e('0x20')]=_0x16033c[_0x0a9e('0x20')];this[_0x0a9e('0x21')]=_0x16033c[_0x0a9e('0x21')];this[_0x0a9e('0x22')]=config[_0x0a9e('0x22')]||0x2;this[_0x0a9e('0x23')]={};this[_0x0a9e('0x24')]={};this[_0x0a9e('0x25')]={};this['uniqueId']={};this[_0x0a9e('0x26')]={};this[_0x0a9e('0x27')]={};this['startProgressive']={};this[_0x0a9e('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x0a9e('0x29'),this[_0x0a9e('0x2a')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2c'),this['syncQueueCallerAbandon'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2d'),this[_0x0a9e('0x2e')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2f'),this[_0x0a9e('0x30')][_0x0a9e('0x2b')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x31'),this[_0x0a9e('0x32')][_0x0a9e('0x2b')](this));ami['on']('hangup',this[_0x0a9e('0x33')]['bind'](this));ami['on'](_0x0a9e('0x34'),this['syncNewExten'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x35'),this[_0x0a9e('0x36')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x37'),this[_0x0a9e('0x38')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x39'),this['syncQueueStatusComplete'][_0x0a9e('0x2b')](this));this[_0x0a9e('0x3a')]();this[_0x0a9e('0x3b')]();RpcSetting[_0x0a9e('0x3c')]()['then'](function(_0x15b200){previewRecallmeReminderInterval=_0x15b200[_0x0a9e('0x3d')];});}function isNotNull(_0x1843b2){return _0x1843b2!==null&&!_[_0x0a9e('0x3e')](_0x1843b2);}function checkIsLoggedIn(_0x58b06f,_0x563b45){return function(){if(_0x563b45<=0x0){_0x58b06f[_0x0a9e('0x3f')]=_0x0a9e('0x40');throw _0x58b06f[_0x0a9e('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x426950){return _0x426950;}function checkIsActive(_0x5d1e0e,_0x2407f9){return function(){if(!isActive(_0x2407f9)){_0x5d1e0e[_0x0a9e('0x3f')]=_0x0a9e('0x42');throw _0x5d1e0e[_0x0a9e('0x41')]+_0x0a9e('0x43');}};}function checkInterval(_0x5180f1){return function(){if(!isNotNull(_0x5180f1[_0x0a9e('0x44')])){_0x5180f1[_0x0a9e('0x3f')]=_0x0a9e('0x45');throw _0x5180f1[_0x0a9e('0x41')]+_0x0a9e('0x46');}if(!isNotNull(_0x5180f1[_0x0a9e('0x44')][_0x0a9e('0x47')])){_0x5180f1[_0x0a9e('0x3f')]='INTERVAL_IS_NULL';throw _0x5180f1[_0x0a9e('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0a9e('0x48')](_0x5180f1[_0x0a9e('0x44')][_0x0a9e('0x47')]))){_0x5180f1[_0x0a9e('0x3f')]='INTERVAL_IS_NULL';throw _0x5180f1[_0x0a9e('0x41')]+_0x0a9e('0x46');}};}function msgResponse(_0x1fa90d,_0x15de0e,_0x4853b1){return{'action':_0x1fa90d,'response':_0x15de0e,'message':_0x4853b1,'stack':_0x4853b1};}function myreject(_0x54135e){return function(_0x1e8694){return _0x54135e(msgResponse('[ifTime][Action]',_0x0a9e('0x49'),JSON[_0x0a9e('0x4a')](_0x1e8694)));};}function getSeconds(_0x381c37,_0x1ef87a){var _0x4f41ae=moment(_0x381c37)[_0x0a9e('0x4b')](0x0);var _0x3bfce8=moment(_0x1ef87a)[_0x0a9e('0x4b')](0x0);return _0x4f41ae['diff'](_0x3bfce8,_0x0a9e('0x4c'));}function emit(_0x1a180b,_0x289467,_0x4c1c0e){io['to'](_0x1a180b)['emit'](_0x289467,_0x4c1c0e);}function emitVoiceQueueSummary(_0x11b61d){if(_0x11b61d[_0x0a9e('0x4d')]==='outbound'){var _0x2b814e={'id':_0x11b61d['id'],'name':_0x11b61d[_0x0a9e('0x41')],'strategy':_0x11b61d[_0x0a9e('0x4e')],'answered':_0x11b61d[_0x0a9e('0x4f')],'available':_0x11b61d['available'],'loggedIn':_0x11b61d['loggedIn'],'pTalking':_0x11b61d[_0x0a9e('0x50')],'sumBillable':_0x11b61d[_0x0a9e('0x51')],'sumDuration':_0x11b61d['sumDuration'],'sumHoldTime':_0x11b61d[_0x0a9e('0x52')]||0x0,'talking':_0x11b61d[_0x0a9e('0x53')],'total':_0x11b61d[_0x0a9e('0x54')],'type':_0x11b61d['type'],'unmanaged':_0x11b61d[_0x0a9e('0x55')],'abandoned':_0x11b61d[_0x0a9e('0x56')],'waiting':_0x11b61d[_0x0a9e('0x57')],'loggedInDb':_0x11b61d[_0x0a9e('0x58')],'dialActive':_0x11b61d[_0x0a9e('0x59')],'dialMethod':_0x11b61d[_0x0a9e('0x5a')],'dialOriginateCallerIdName':_0x11b61d[_0x0a9e('0x5b')],'dialOriginateCallerIdNumber':_0x11b61d[_0x0a9e('0x5c')],'dialOriginateTimeout':_0x11b61d[_0x0a9e('0x5d')],'dialPrefix':_0x11b61d[_0x0a9e('0x5e')],'outboundAnswerAgiCallsDay':_0x11b61d[_0x0a9e('0x5f')],'outboundAnswerCallsDay':_0x11b61d[_0x0a9e('0x60')],'outboundBlacklistCallsDay':_0x11b61d[_0x0a9e('0x61')],'outboundBusyCallsDay':_0x11b61d[_0x0a9e('0x62')],'outboundCongestionCallsDay':_0x11b61d[_0x0a9e('0x63')],'outboundDropCallsDayACS':_0x11b61d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x11b61d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x11b61d[_0x0a9e('0x64')],'outboundNoAnswerCallsDay':_0x11b61d[_0x0a9e('0x65')],'outboundNoSuchCallsDay':_0x11b61d[_0x0a9e('0x66')],'outboundOriginateFailureCallsDay':_0x11b61d[_0x0a9e('0x67')],'outboundReCallsDay':_0x11b61d[_0x0a9e('0x68')],'outboundRejectCallsDay':_0x11b61d[_0x0a9e('0x69')],'outboundUnknownCallsDay':_0x11b61d[_0x0a9e('0x6a')],'predictiveIntervalAnsweredCalls':_0x11b61d[_0x0a9e('0x6b')],'predictiveIntervalAvgHoldtime':_0x11b61d[_0x0a9e('0x6c')],'predictiveIntervalAvgTalktime':_0x11b61d[_0x0a9e('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x11b61d[_0x0a9e('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x11b61d[_0x0a9e('0x6f')],'predictiveIntervalErlangCalls':_0x11b61d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x11b61d[_0x0a9e('0x70')],'predictiveIntervalHitRate':_0x11b61d[_0x0a9e('0x71')],'predictiveIntervalMultiplicativeFactor':_0x11b61d[_0x0a9e('0x72')],'predictiveIntervalPauses':_0x11b61d[_0x0a9e('0x73')],'predictiveIntervalAvailable':_0x11b61d[_0x0a9e('0x74')],'predictiveIntervalTotalCalls':_0x11b61d[_0x0a9e('0x75')],'message':_0x11b61d[_0x0a9e('0x3f')],'originated':_0x11b61d[_0x0a9e('0x76')],'erlangCalls':_0x11b61d['erlangCalls'],'erlangCallToSecond':_0x11b61d[_0x0a9e('0x77')],'erlangAbandonmentRate':_0x11b61d['erlangAbandonmentRate'],'erlangBusyFactor':_0x11b61d[_0x0a9e('0x78')],'startPredictive':_0x11b61d[_0x0a9e('0x27')],'startProgressive':_0x11b61d[_0x0a9e('0x79')]};if(_0x11b61d['Trunk']){_0x2b814e[_0x0a9e('0x7a')]={'id':_0x11b61d[_0x0a9e('0x7a')]['id'],'name':_0x11b61d[_0x0a9e('0x7a')][_0x0a9e('0x41')],'active':_0x11b61d[_0x0a9e('0x7a')][_0x0a9e('0x7b')],'callerid':_0x11b61d[_0x0a9e('0x7a')]['callerid']};}if(_0x11b61d[_0x0a9e('0x44')]){_0x2b814e[_0x0a9e('0x44')]={'id':_0x11b61d[_0x0a9e('0x44')]['id'],'name':_0x11b61d[_0x0a9e('0x44')][_0x0a9e('0x41')]};}var _0x992c77=md5(JSON[_0x0a9e('0x4a')](_0x2b814e));if(_0x11b61d[_0x0a9e('0x7c')]!==_0x992c77){_0x11b61d[_0x0a9e('0x7c')]=_0x992c77;emit(util['format'](_0x0a9e('0x7d'),_0x2b814e[_0x0a9e('0x41')]),'voice_queue:save',_0x2b814e);}}}function emitCampaignSummary(_0x4ae14b){if(_0x4ae14b['type']===_0x0a9e('0x7e')){emit(util[_0x0a9e('0x7f')](_0x0a9e('0x80'),_0x4ae14b[_0x0a9e('0x41')]),_0x0a9e('0x81'),_0x4ae14b);}}function checkGetDataPredictive(_0x30decb){if(isNotNull(_0x30decb)&&!_[_0x0a9e('0x48')](_0x30decb)){loggerPredictive[_0x0a9e('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x30decb[_0x0a9e('0x75')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x83'),_0x30decb['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x84'),_0x30decb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x0a9e('0x85'),_0x30decb['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x0a9e('0x82')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x30decb[_0x0a9e('0x6c')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x86'),_0x30decb['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));if(_0x30decb['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x30decb[_0x0a9e('0x6d')])&&_0x30decb[_0x0a9e('0x6d')]>0x0){return!![];}loggerPredictive['info'](_0x0a9e('0x88'));if(!_['isUndefined'](_0x30decb[_0x0a9e('0x6c')])&&_0x30decb['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0a9e('0x82')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x0a9e('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2f7092){return function(_0x65432){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x89'));loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8a'),_0x65432[_0x0a9e('0x8b')]);loggerPredictive[_0x0a9e('0x82')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x65432[_0x0a9e('0x77')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8c'),_0x65432[_0x0a9e('0x8d')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8e'),_0x65432['erlangBusyFactor']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8c'),_0x65432['erlangAbandonmentRate']);loggerPredictive[_0x0a9e('0x82')]('---------------------------');_[_0x0a9e('0x8f')](_0x2f7092,_0x65432);};}function getDiff(_0x5ba1f9){var _0x4b3c1a=moment()['milliseconds'](0x0);var _0x273cb5=moment(_0x5ba1f9)['milliseconds'](0x0);return _0x4b3c1a[_0x0a9e('0x90')](_0x273cb5,_0x0a9e('0x4c'));}function ifInterval(_0x261adb,_0x7be420){if(_[_0x0a9e('0x3e')](_0x7be420)){return![];}return getDiff(_0x7be420)<_0x261adb*0x3c;}function freeVariablesPredictive(_0x26d7db){if(isNotNull(_0x26d7db)){if(!_['isUndefined'](_0x26d7db[_0x0a9e('0x79')])){_0x26d7db['startProgressive']=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],_0x0a9e('0x91'));}if(!_['isUndefined'](_0x26d7db[_0x0a9e('0x27')])){_0x26d7db[_0x0a9e('0x27')]=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0a9e('0x3e')](_0x26d7db[_0x0a9e('0x92')])){clearInterval(_0x26d7db['handlePredictive']);_0x26d7db[_0x0a9e('0x92')]=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],_0x0a9e('0x93'));}}}function erlangb(_0x401837,_0x4d4a35){if(_0x4d4a35===0x0){return 0x0;}var _0x176840=0x1;for(var _0x2937e0=0x1;_0x2937e0<=_0x4d4a35;_0x2937e0+=0x1){_0x176840=0x1+_0x176840*_0x2937e0/_0x401837;}return 0x1/_0x176840;}function isVoiceQueueOutbound(_0x281c7d){return _0x281c7d==='outbound';}function isNotPreview(_0x3528b7){return _0x3528b7!=='preview';}function isCampaignIvr(_0x5211e3){return _0x5211e3===_0x0a9e('0x7e');}function getCallerId(_0x4556c5,_0x9375fb,_0x19c995){if(!_[_0x0a9e('0x3e')](_0x19c995)&&typeof _0x19c995===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x19c995)){if(!_[_0x0a9e('0x3e')](_0x9375fb)&&typeof _0x9375fb===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x9375fb)){return util[_0x0a9e('0x7f')](_0x0a9e('0x95'),_0x9375fb,_0x19c995);}return util[_0x0a9e('0x7f')](_0x0a9e('0x95'),_0x19c995,_0x19c995);}if(!_[_0x0a9e('0x3e')](_0x4556c5)&&typeof _0x4556c5===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x4556c5)){return _0x4556c5;}return _0x0a9e('0x96');}function loggerCatchQueueSummary(_0x5150a4,_0x1b0b98){return function(_0x295763){freeVariablesPredictive(_0x1b0b98);emitVoiceQueueSummary(_0x1b0b98);emitCampaignSummary(_0x1b0b98);loggerSyncQueueSummary[_0x0a9e('0x97')](_0x5150a4,util['inspect'](_0x295763,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1148a1,_0x30944e){return function(_0x4b341d){loggerPredictive[_0x0a9e('0x98')](_0x30944e[_0x0a9e('0x41')],_0x1148a1);loggerPredictive[_0x0a9e('0x98')](_0x4b341d[_0x0a9e('0x99')]);freeVariablesPredictive(_0x30944e);};}function loggerCatch(_0x13b5c0){return function(_0x4a43a8){logger['error'](_0x13b5c0,util['inspect'](_0x4a43a8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x40fb85){return _0x40fb85&&!_[_0x0a9e('0x3e')](_0x40fb85)&&_0x40fb85[_0x0a9e('0x9a')]>0x0;}function decremetOriginate(_0x23a7d3){if(!_[_0x0a9e('0x3e')](_0x23a7d3)&&_0x23a7d3!==null){if(typeof _0x23a7d3[_0x0a9e('0x76')]!==_0x0a9e('0x9b')){if(_0x23a7d3[_0x0a9e('0x76')]>0x0){_0x23a7d3['originated']-=0x1;}else{logger[_0x0a9e('0x98')](_0x0a9e('0x9c'));}}}else{logger[_0x0a9e('0x98')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2bdc44,_0x583b2e,_0x4437ff){if(_0x583b2e>_0x4437ff){for(var _0x44351d=0x0;_0x44351d<_0x583b2e-_0x4437ff;_0x44351d+=0x1){decremetOriginate(_0x2bdc44);}}}function loggerGetContactDialer(_0x4c46c1,_0x2ed01e,_0x75912a){return function(_0x2cc7a7){checkContactLowerLimitOriginate(_0x2ed01e,_0x75912a,0x0);logger[_0x0a9e('0x98')](_0x4c46c1,util['inspect'](_0x2cc7a7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d442c){return function(_0x2e9552){if(isNotNull(_0x2e9552)&&isNotNull(_0x2e9552[0x0])){if(_0x2e9552[0x0][_0x0a9e('0x9d')]>0x0){_0x1d442c[_0x0a9e('0x3f')]='RESCHEDULED_CONTACTS';logger[_0x0a9e('0x82')](_0x0a9e('0x9e')+_0x1d442c[_0x0a9e('0x41')],_0x2e9552[0x0][_0x0a9e('0x9d')],'contacts');}else{_0x1d442c[_0x0a9e('0x3f')]=_0x0a9e('0x9f');logger[_0x0a9e('0x82')](_0x0a9e('0xa0')+_0x1d442c[_0x0a9e('0x41')]);}}};}function notSendMessagesQueue(_0xdb98ca){if(_0xdb98ca[_0x0a9e('0xa1')]){freeVariablesPredictive(_0xdb98ca);if(_0xdb98ca[_0x0a9e('0x76')]===0x0&&_0xdb98ca[_0x0a9e('0x53')]===0x0&&_0xdb98ca[_0x0a9e('0x57')]===0x0&&(_0xdb98ca[_0x0a9e('0x50')]||0x0)===0x0){_0xdb98ca[_0x0a9e('0xa1')]=![];_0xdb98ca[_0x0a9e('0xa2')]=0x0;_0xdb98ca[_0x0a9e('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa3'),_0xdb98ca[_0x0a9e('0x41')],'is\x20not\x20active');}else{_0xdb98ca[_0x0a9e('0x3f')]=_0x0a9e('0xa4');loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa3'),_0xdb98ca['name'],'is\x20disactive');}emitVoiceQueueSummary(_0xdb98ca);}}function notSendMessagesCampaign(_0x7ebea8){if(_0x7ebea8[_0x0a9e('0xa1')]){if(_0x7ebea8['originated']===0x0){_0x7ebea8[_0x0a9e('0xa1')]=![];_0x7ebea8['message']=_0x0a9e('0x42');loggerSyncQueueSummary[_0x0a9e('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x7ebea8[_0x0a9e('0x41')],_0x0a9e('0xa5'));}else{_0x7ebea8[_0x0a9e('0x3f')]=_0x0a9e('0xa4');loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa6'),_0x7ebea8[_0x0a9e('0x41')],'is\x20disactive');}emitCampaignSummary(_0x7ebea8);}}function createObjHistory(_0x2973d3,_0x3ca9b9,_0x45c109,_0x16e5b9,_0x492543){_0x2973d3[_0x0a9e('0x3f')]=_0x45c109;var _0xf0db1=new Action(_0x2973d3,_0x3ca9b9);var _0x4bf3a5=new History(_0xf0db1);_0x4bf3a5[_0x0a9e('0xa7')]=_0x16e5b9;_0x4bf3a5['statedesc']=_0x492543;_0x4bf3a5[_0x0a9e('0xa8')]=_0xf0db1[_0x0a9e('0xa9')];return _0x4bf3a5;}Dialer[_0x0a9e('0x1a')][_0x0a9e('0x3b')]=function(){var _0x5af453=this;setInterval(function(){_0x5af453['clearZombieChannels'](_0x5af453[_0x0a9e('0xaa')],_0x0a9e('0xab'));_0x5af453[_0x0a9e('0xac')](_0x5af453['actions'],_0x0a9e('0xad'));},0x32c8);};Dialer[_0x0a9e('0x1a')]['clearZombieChannels']=function(_0x4e46b2,_0xf0a802){var _0x56acca=this;for(var _0x5ea541 in _0x4e46b2){if(typeof _0x4e46b2[_0x5ea541]!=='undefined'){this[_0x0a9e('0xae')][_0x0a9e('0x1b')](function(){if(!_[_0x0a9e('0xaf')](_0x4e46b2[_0x5ea541])){return ami[_0x0a9e('0xb0')]({'action':_0x0a9e('0xb1'),'channel':_0x4e46b2[_0x5ea541][_0x0a9e('0xb2')]})['catch'](function(_0x5fd5db){if(_0x5fd5db['message']===_0x0a9e('0xb3')){setTimeout(function(){if(_0x4e46b2[_0x5ea541]&&_0x4e46b2[_0x5ea541][_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){_0x56acca[_0x0a9e('0xb4')](_0x56acca['voiceQueues'][_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]]);logger[_0x0a9e('0x98')](_0x0a9e('0xb6'),_0xf0a802,_0x5ea541,_0x4e46b2[_0x5ea541]['queue']);delete _0x4e46b2[_0x5ea541];}if(_0x4e46b2[_0x5ea541]&&_0x4e46b2[_0x5ea541][_0x0a9e('0x4d')]===_0x0a9e('0x7e')){_0x56acca[_0x0a9e('0xb4')](_0x56acca[_0x0a9e('0x1f')][_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]]);logger[_0x0a9e('0x98')](_0x0a9e('0xb7'),_0xf0a802,_0x5ea541,_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]);delete _0x4e46b2[_0x5ea541];}},0x2328);}});}});}}};Dialer['prototype'][_0x0a9e('0xb8')]=function(_0x3325c5){return Promise['resolve']()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xb8')](_0x3325c5))[_0x0a9e('0xba')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x0a9e('0x1a')]['checkIsBlackList']=function(_0x8c8fbe){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperBlack[_0x0a9e('0xbc')](_0x8c8fbe))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xbd')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xbe')]=function(_0x501050,_0x329d88,_0x31d25a){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperAdditionalPhone[_0x0a9e('0xbe')](_0x501050,_0x329d88,_0x31d25a))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xbf')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc0')]=function(_0x31af8c,_0x151956,_0x3754e2){return Promise[_0x0a9e('0xbb')]()['then'](cmHopperAdditionalPhone[_0x0a9e('0xc0')](_0x31af8c,_0x151956,_0x3754e2))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xc1')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc2')]=function(_0x5d9ddb){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperBlack['checkIsBlackListIvr'](_0x5d9ddb))[_0x0a9e('0xba')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc3')]=function(_0x1d93b1){return Promise[_0x0a9e('0xbb')]()['then'](cmHopperHistory[_0x0a9e('0xc4')](_0x1d93b1))['catch'](loggerCatch(_0x0a9e('0xc5')));};Dialer[_0x0a9e('0x1a')]['rescheduleContact']=function(_0x231c6a){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper['rescheduleContact'](_0x231c6a))['catch'](loggerCatch(_0x0a9e('0xc6')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc7')]=function(_0x413190,_0x3f2f40,_0x2450a8){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xc7')](_0x413190,_0x3f2f40,_0x2450a8))['catch'](loggerCatch(_0x0a9e('0xc8')));};Dialer['prototype'][_0x0a9e('0xc9')]=function(_0x2f7791,_0x34e745,_0x28ce92,_0x1b61d5,_0x4e7273){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xc9')](_0x2f7791,_0x34e745,_0x28ce92,_0x1b61d5))[_0x0a9e('0xba')](function(_0x2263f1){_0x4e7273['temp']-=_0x28ce92;_0x4e7273['temp']=_0x4e7273[_0x0a9e('0xca')]>0x0?_0x4e7273['temp']:0x0;loggerCatch(_0x0a9e('0xcb'))(_0x2263f1);});};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xcc')]=function(_0x16313e,_0x2ad54b,_0x213e5d,_0x596312){return Promise['resolve']()[_0x0a9e('0xb9')](cmHopper['getContactDialerIvr'](_0x16313e,_0x2ad54b,_0x213e5d))[_0x0a9e('0xba')](function(_0x5c689c){_0x596312[_0x0a9e('0xca')]-=_0x2ad54b;_0x596312['temp']=_0x596312['temp']>0x0?_0x596312[_0x0a9e('0xca')]:0x0;loggerCatch(_0x0a9e('0xcd'))(_0x5c689c);});};Dialer['prototype'][_0x0a9e('0xce')]=function(_0x17cb30){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](voiceQueueRt[_0x0a9e('0xce')](_0x17cb30))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xcf')]=function(_0x41c8cd){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper['moveContactManagedDialer'](_0x41c8cd))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xd0')));};Dialer['prototype'][_0x0a9e('0xd1')]=function(_0x19fd11){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperHistory[_0x0a9e('0xd1')](_0x19fd11))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xd2')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xb4')]=function(_0x16afb3){if(!_['isUndefined'](_0x16afb3)&&_0x16afb3!==null){if(typeof _0x16afb3[_0x0a9e('0x76')]!==_0x0a9e('0x9b')){if(_0x16afb3[_0x0a9e('0x76')]>0x0){_0x16afb3[_0x0a9e('0x76')]-=0x1;}else{logger[_0x0a9e('0x98')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x0a9e('0xd3'));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xd4')]=function(_0x2fea95,_0x34f7b5){var _0x59e46f=this;return function(_0x1339d0){_0x59e46f[_0x0a9e('0xb4')](_0x34f7b5);logger[_0x0a9e('0x98')](_0x2fea95,util['inspect'](_0x1339d0,{'showHidden':![],'depth':null}));};};Dialer[_0x0a9e('0x1a')]['emptyContact']=function(_0x2144ca,_0x4799d4,_0x25b745){var _0x42b833={'state':0x19,'statedesc':_0x0a9e('0xd5')};this['updateOriginated'](_0x4799d4);this[_0x0a9e('0xd6')](_['merge'](_0x42b833,_[_0x0a9e('0xd7')](_0x25b745,[_0x0a9e('0xd8'),_0x0a9e('0xd9'),_0x0a9e('0xda'),_0x0a9e('0xdb'),_0x0a9e('0xdc')])),_0x0a9e('0xdd'),_0x0a9e('0xde'));logger[_0x0a9e('0x98')](_0x2144ca);};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xdf')]=function(_0xc876d4){return _0xc876d4===_0x0a9e('0xe0');};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xe1')]=function(_0x248368){return!_['isUndefined'](_0x248368)&&_0x248368&&!_['isUndefined'](_0x248368[_0x0a9e('0x41')])&&!_['isUndefined'](_0x248368[_0x0a9e('0x7b')])&&_0x248368[_0x0a9e('0x7b')]&&(this['trunks'][util[_0x0a9e('0x7f')](_0x0a9e('0xe2'),_0x248368[_0x0a9e('0x41')])][_0x0a9e('0xb1')]==='reachable'||this[_0x0a9e('0x21')][util[_0x0a9e('0x7f')](_0x0a9e('0xe2'),_0x248368[_0x0a9e('0x41')])]['status']===_0x0a9e('0xe3'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xd6')]=function(_0x5c838b,_0x2650eb,_0x270df8){this[_0x0a9e('0xd1')](_0x5c838b)['catch'](loggerCatch(_0x2650eb));this[_0x0a9e('0xcf')](_0x5c838b)[_0x0a9e('0xba')](loggerCatch(_0x270df8));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x36')]=function(_0x2394d3){var _0x555780=this;var _0x3211d2=this[_0x0a9e('0xaa')][_0x2394d3['uniqueid']];var _0x3bab3e;if(!_[_0x0a9e('0xaf')](_0x2394d3)&&!_[_0x0a9e('0xaf')](_0x2394d3['variable'])&&!_['isNil'](_0x2394d3['variable'][_0x0a9e('0xe4')])&&_0x2394d3[_0x0a9e('0xe5')]==='xcally-motion-dialer'&&_0x3211d2){if(_0x3211d2[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&this[_0x0a9e('0x1e')][_0x3211d2['queue']][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xe8')){delete this[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x3211d2['queue']][_0x0a9e('0x60')]+=0x1;this['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;_0x3bab3e=new Hangup(_0x3211d2,_0x2394d3);_0x3bab3e[_0x0a9e('0xa7')]=0x12;_0x3bab3e[_0x0a9e('0xea')]=_0x0a9e('0xeb');_0x3bab3e[_0x0a9e('0xec')]='AMD';ami[_0x0a9e('0xed')](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x3bab3e,_0x0a9e('0xf0')));this['saveInDb'](_0x3bab3e,_0x0a9e('0xf1'),_0x0a9e('0xf2'));}if(_0x3211d2[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&this[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xf3')){return new Promise(function(_0x3539b7,_0x57f0ad){delete _0x555780[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];_0x555780[_0x0a9e('0xb4')](_0x555780[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]]);_0x555780[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x60')]+=0x1;_0x555780['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;var _0x1a9ef1=_0x555780['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]];var _0x41e446=new Hangup(_0x3211d2,_0x2394d3);_0x41e446[_0x0a9e('0xa7')]=0x13;_0x41e446[_0x0a9e('0xea')]=_0x0a9e('0xf4');_0x41e446[_0x0a9e('0xec')]=_0x0a9e('0xf5');_0x41e446[_0x0a9e('0xf6')]+=0x1;_0x41e446[_0x0a9e('0xf7')]+=0x1;_0x41e446[_0x0a9e('0xf0')]=!![];ami['emit'](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x41e446,_0x0a9e('0xf0')));_0x555780[_0x0a9e('0xd1')](_0x41e446)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0x41e446['countbusyretry']+_0x41e446[_0x0a9e('0xf9')]+_0x41e446['countnoanswerretry']+_0x41e446['countnosuchnumberretry']+_0x41e446['countdropretry']+_0x41e446[_0x0a9e('0xfa')]+_0x41e446[_0x0a9e('0xf6')]+_0x41e446[_0x0a9e('0xfb')]>=_0x1a9ef1[_0x0a9e('0xfc')]){_0x555780['stateGlobal'](_0x41e446,_0x3539b7,_0x57f0ad,_0x0a9e('0xfd'));}else{if(_0x41e446[_0x0a9e('0xf6')]>=_0x1a9ef1[_0x0a9e('0xfe')]){_0x555780[_0x0a9e('0xff')](_0x41e446,_0x3539b7,_0x57f0ad,_0x0a9e('0x100'));}else{_0x555780['rescheduleContact']({'active':![],'countmachineretry':_0x41e446['countmachineretry'],'scheduledat':moment()[_0x0a9e('0x101')](_0x1a9ef1[_0x0a9e('0x102')],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x41e446[_0x0a9e('0xd8')],'ListId':_0x41e446[_0x0a9e('0xd9')],'VoiceQueueId':_0x41e446['VoiceQueueId']||undefined,'CampaignId':_0x41e446[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));_0x3539b7({'reschedule':0x1});}}});}if(_0x3211d2['type']===_0x0a9e('0x7e')&&this[_0x0a9e('0x1f')][_0x3211d2[_0x0a9e('0xb5')]]['dialAMDActive']&&_0x2394d3['value']==='HANGUP'){delete this[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1f')][_0x3211d2['queue']]);_0x3bab3e=new Hangup(_0x3211d2,_0x2394d3);_0x3bab3e[_0x0a9e('0xa7')]=0x12;_0x3bab3e['statedesc']=_0x0a9e('0xeb');_0x3bab3e[_0x0a9e('0xec')]=_0x0a9e('0xf5');ami['emit'](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x3bab3e,_0x0a9e('0xf0')));this['saveInDb'](_0x3bab3e,_0x0a9e('0x106'),'[syncHangupInAMDIvr]');}if(_0x3211d2[_0x0a9e('0x4d')]==='ivr'&&this[_0x0a9e('0x1f')][_0x3211d2['queue']][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xf3')){return new Promise(function(_0x10ace8,_0x1e306c){delete _0x555780[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];_0x555780['updateOriginated'](_0x555780[_0x0a9e('0x1f')][_0x3211d2[_0x0a9e('0xb5')]]);_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x60')]+=0x1;_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;var _0x16b578=_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]];var _0xf49ed4=new Hangup(_0x3211d2,_0x2394d3);_0xf49ed4[_0x0a9e('0xa7')]=0x13;_0xf49ed4[_0x0a9e('0xea')]=_0x0a9e('0xf4');_0xf49ed4[_0x0a9e('0xec')]=_0x0a9e('0xf5');_0xf49ed4[_0x0a9e('0xf6')]+=0x1;_0xf49ed4[_0x0a9e('0xf7')]+=0x1;_0xf49ed4[_0x0a9e('0xf0')]=!![];ami['emit'](_0x0a9e('0xee'),ut['buildObj'](_0xf49ed4,_0x0a9e('0xf0')));_0x555780[_0x0a9e('0xd1')](_0xf49ed4)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0xf49ed4[_0x0a9e('0x107')]+_0xf49ed4[_0x0a9e('0xf9')]+_0xf49ed4['countnoanswerretry']+_0xf49ed4[_0x0a9e('0x108')]+_0xf49ed4[_0x0a9e('0x109')]+_0xf49ed4[_0x0a9e('0xfa')]+_0xf49ed4['countmachineretry']+_0xf49ed4[_0x0a9e('0xfb')]>=_0x16b578[_0x0a9e('0xfc')]){_0x555780[_0x0a9e('0x10a')](_0xf49ed4,_0x10ace8,_0x1e306c,_0x0a9e('0xfd'));}else{if(_0xf49ed4[_0x0a9e('0xf6')]>=_0x16b578[_0x0a9e('0xfe')]){_0x555780[_0x0a9e('0xff')](_0xf49ed4,_0x10ace8,_0x1e306c,'reason\x2019\x20machine....');}else{_0x555780[_0x0a9e('0x10b')]({'active':![],'countmachineretry':_0xf49ed4[_0x0a9e('0xf6')],'scheduledat':moment()[_0x0a9e('0x101')](_0x16b578[_0x0a9e('0x102')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0xf49ed4['ContactId'],'ListId':_0xf49ed4['ListId'],'VoiceQueueId':_0xf49ed4[_0x0a9e('0xdb')]||undefined,'CampaignId':_0xf49ed4[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));_0x10ace8({'reschedule':0x1});}}});}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x33')]=function(_0x609711){var _0x584854=this[_0x0a9e('0xaa')][_0x609711[_0x0a9e('0xe9')]];var _0x2d8e91;if(_0x584854&&_0x584854[_0x0a9e('0x4d')]===_0x0a9e('0x7e')){delete this[_0x0a9e('0xaa')][_0x609711[_0x0a9e('0xe9')]];this['updateOriginated'](this[_0x0a9e('0x1f')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1f')][_0x584854['queue']][_0x0a9e('0x10c')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);this[_0x0a9e('0xd1')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10d')));this['moveContactManagedDialer'](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10e')));}if(_0x584854&&_0x584854[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&isNotNull(this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x10f')])){delete this[_0x0a9e('0xaa')][_0x609711['uniqueid']];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x584854['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);_0x2d8e91['state']=0x10;_0x2d8e91[_0x0a9e('0xea')]=_0x0a9e('0x110');_0x2d8e91['membername']=_0x0a9e('0x111');this['createHistory'](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x2d8e91)['catch'](loggerCatch(_0x0a9e('0x10e')));}if(_0x584854&&_0x584854[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&!isNotNull(this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x10f')])){delete this['uniqueId'][_0x609711[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x6a')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);_0x2d8e91['state']=0xc;_0x2d8e91['statedesc']=_0x609711[_0x0a9e('0x112')];_0x2d8e91['membername']=_0x0a9e('0x113');this[_0x0a9e('0xd1')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10d')));this[_0x0a9e('0xcf')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x0a9e('0x1a')]['syncAgentComplete']=function(_0x50e32a){var _0x504403=this['uniqueId'][_0x50e32a[_0x0a9e('0xe9')]];if(this['voiceQueues'][_0x50e32a['queue']]){if(_0x504403&&_0x504403[_0x0a9e('0x4d')]!=='ivr'){delete this[_0x0a9e('0xaa')][_0x50e32a[_0x0a9e('0xe9')]];this[_0x0a9e('0x1e')][_0x50e32a['queue']][_0x0a9e('0x60')]+=0x1;var _0x1209c4=new AgentComplete(_0x504403,_0x50e32a);if(_0x50e32a[_0x0a9e('0x114')]==='agent'){_0x1209c4['agiafterat']=this[_0x0a9e('0x1e')][_0x50e32a[_0x0a9e('0xb5')]][_0x0a9e('0x115')]&&this[_0x0a9e('0x1e')][_0x50e32a[_0x0a9e('0xb5')]][_0x0a9e('0x116')]?moment()[_0x0a9e('0x7f')](_0x0a9e('0x104')):undefined;}this[_0x0a9e('0xd1')](_0x1209c4)[_0x0a9e('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x1209c4)['catch'](loggerCatch(_0x0a9e('0x117')));}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x2a')]=function(_0x2d21c7){if(this[_0x0a9e('0x1e')][_0x2d21c7[_0x0a9e('0xb5')]]){if(this[_0x0a9e('0xaa')][_0x2d21c7[_0x0a9e('0xe9')]]&&this['uniqueId'][_0x2d21c7['uniqueid']][_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){this['updateOriginated'](this[_0x0a9e('0x1e')][_0x2d21c7[_0x0a9e('0xb5')]]);this[_0x0a9e('0xaa')][_0x2d21c7[_0x0a9e('0xe9')]][_0x0a9e('0x118')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x119')]=function(_0x400800,_0xbd1af3){this[_0x0a9e('0xd1')](_0x400800)['catch'](loggerCatch(_0x0a9e('0x11a')));if(_0xbd1af3==0x0){this[_0x0a9e('0xcf')](_0x400800)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x11b')));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x11c')]=function(_0x292e67){var _0x23bec3=this[_0x0a9e('0xaa')][_0x292e67[_0x0a9e('0xe9')]];var _0x6b048e=this;var _0x3ba472=![];var _0x4e6eb9;var _0x572a72;if(this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]]){if(_0x23bec3&&_0x23bec3[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){delete this[_0x0a9e('0xaa')][_0x292e67[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]]);_0x23bec3['droptime']=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));var _0x1e9f9f=new QueueCallerAbandon(_0x23bec3,_0x292e67);if(getSeconds(_0x23bec3[_0x0a9e('0x11d')],_0x23bec3[_0x0a9e('0x11e')])>=_0x23bec3[_0x0a9e('0x11f')]){this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x6f')]+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x64')]+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x70')]+=0x1;_0x1e9f9f[_0x0a9e('0xa7')]=0xa;_0x1e9f9f['statedesc']='Drop';_0x1e9f9f[_0x0a9e('0x120')]=_0x0a9e('0x121');_0x1e9f9f['agiafterat']=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x115')]?moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1e9f9f[_0x0a9e('0x109')]+=0x1;_0x1e9f9f['countglobal']+=0x1;_0x4e6eb9=this[_0x0a9e('0x1e')][_0x292e67['queue']][_0x0a9e('0x122')];_0x572a72=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x123')];_0x6b048e[_0x0a9e('0xbe')](_0x1e9f9f,_0x1e9f9f['state'],_0x23bec3[_0x0a9e('0x124')])['then'](function(_0x505ffd){_0x3ba472=_0x505ffd[_0x0a9e('0x125')]==0x1;if(_0x1e9f9f[_0x0a9e('0x109')]>=_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x126')]){_0x6b048e[_0x0a9e('0x119')](_0x1e9f9f,_0x505ffd[_0x0a9e('0x125')]);}else{_0x6b048e[_0x0a9e('0x10b')]({'active':![],'countdropretry':_0x1e9f9f[_0x0a9e('0x109')],'scheduledat':moment()[_0x0a9e('0x101')](_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x122')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x23bec3[_0x0a9e('0xd8')],'ListId':_0x23bec3[_0x0a9e('0xd9')],'VoiceQueueId':_0x23bec3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x23bec3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x127')));var _0x543b30=new History(_0x1e9f9f);_0x543b30[_0x0a9e('0xa7')]=0xa;_0x543b30['statedesc']='Drop';_0x543b30['starttime']=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x543b30[_0x0a9e('0xa8')]=_0x543b30[_0x0a9e('0xa9')];_0x543b30[_0x0a9e('0x128')]=_0x1e9f9f[_0x0a9e('0x128')];_0x543b30[_0x0a9e('0x129')]=_0x1e9f9f[_0x0a9e('0x129')];_0x6b048e[_0x0a9e('0xd1')](_0x543b30)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x12a')));}})[_0x0a9e('0xb9')](function(){if(_0x3ba472)_0x6b048e['swapAdditionalPhones'](_0x1e9f9f,_0x4e6eb9,_0x572a72)[_0x0a9e('0xb9')](function(){return 0x1;});});}else{this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x12b')]+=0x1;_0x1e9f9f['state']=0xb;_0x1e9f9f[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x1e9f9f['dropreason']='CALLEREXIT';_0x1e9f9f[_0x0a9e('0xfa')]+=0x1;_0x1e9f9f[_0x0a9e('0xf7')]+=0x1;_0x4e6eb9=this[_0x0a9e('0x1e')][_0x292e67['queue']]['dialAbandonedRetryFrequency'];_0x572a72=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x123')];_0x6b048e[_0x0a9e('0xbe')](_0x1e9f9f,_0x1e9f9f[_0x0a9e('0xa7')],_0x23bec3[_0x0a9e('0x124')])[_0x0a9e('0xb9')](function(_0x183b9b){if(_0x1e9f9f[_0x0a9e('0xfa')]>=_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x12d')]){_0x6b048e[_0x0a9e('0x119')](_0x1e9f9f,_0x183b9b[_0x0a9e('0x125')]);}else{_0x6b048e[_0x0a9e('0x10b')]({'active':![],'countabandonedretry':_0x1e9f9f[_0x0a9e('0xfa')],'scheduledat':moment()[_0x0a9e('0x101')](_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]]['dialAbandonedRetryFrequency'],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x23bec3[_0x0a9e('0xd8')],'ListId':_0x23bec3[_0x0a9e('0xd9')],'VoiceQueueId':_0x23bec3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x23bec3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x12e')));var _0x3a14d7=new History(_0x1e9f9f);_0x3a14d7[_0x0a9e('0xa7')]=0xb;_0x3a14d7[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x3a14d7[_0x0a9e('0xa9')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));_0x3a14d7['endtime']=_0x3a14d7['starttime'];_0x3a14d7[_0x0a9e('0x128')]=_0x1e9f9f[_0x0a9e('0x128')];_0x3a14d7['calleridnum']=_0x1e9f9f[_0x0a9e('0x129')];_0x6b048e[_0x0a9e('0xd1')](_0x3a14d7)['catch'](loggerCatch(_0x0a9e('0x12f')));}})['then'](function(){if(_0x3ba472)_0x6b048e[_0x0a9e('0xc0')](_0x1e9f9f,_0x4e6eb9,_0x572a72)[_0x0a9e('0xb9')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x0a9e('0x130')]=function(_0x31ab12){if(this['actions'][_0x31ab12[_0x0a9e('0xe9')]]){this[_0x0a9e('0x24')][_0x31ab12['uniqueid']][_0x0a9e('0xb2')]=_0x31ab12[_0x0a9e('0xb2')];}if(this[_0x0a9e('0xaa')][_0x31ab12[_0x0a9e('0xe9')]]){this[_0x0a9e('0xaa')][_0x31ab12[_0x0a9e('0xe9')]]['channel']=_0x31ab12[_0x0a9e('0xb2')];}};Dialer[_0x0a9e('0x1a')]['syncQueueMember']=function(_0x3d63aa){if(strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]===_0x0a9e('0x19')){if(this['actions'][_0x3d63aa['actionid']]&&_['isNil'](this['actions'][_0x3d63aa['actionid']][_0x0a9e('0x132')])&&_0x3d63aa[_0x0a9e('0xb1')]==='1'&&_0x3d63aa['paused']==='0'){if(this['agents'][_0x3d63aa[_0x0a9e('0x133')]]){if(!this['agents'][_0x3d63aa[_0x0a9e('0x133')]][_0x0a9e('0x132')]){this[_0x0a9e('0x20')][_0x3d63aa[_0x0a9e('0x133')]][_0x0a9e('0x132')]=!![];this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0x132')]=!![];this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0x133')]=_0x3d63aa[_0x0a9e('0x133')];}}}}else if((strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]||'rrmemory')===_0x0a9e('0x18')){if(this['actions'][_0x3d63aa[_0x0a9e('0x131')]]){if(this[_0x0a9e('0x20')][_0x3d63aa['stateinterface']]){this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]]['stateinterface']=_0x3d63aa[_0x0a9e('0x133')];if(_['isNil'](this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0xb5')]])){this['queueBooked'][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]=[];}this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]['push'](_[_0x0a9e('0x8f')](_[_0x0a9e('0xd7')](this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]],[_0x0a9e('0x135'),'stateinterface']),{'status':_0x3d63aa[_0x0a9e('0xb1')],'paused':_0x3d63aa['paused']}));}}}};function unlockQueueStatus(_0x5d1159,_0x3a459c){setTimeout(function(){if(_['isUndefined'](_0x5d1159[_0x0a9e('0x136')])){loggerBooked[_0x0a9e('0x98')]('[unlockQueueStatus][undefined]',_0x3a459c);}_0x5d1159[_0x0a9e('0x136')]=!![];loggerBooked[_0x0a9e('0x82')](_0x0a9e('0x137'),_0x3a459c,JSON[_0x0a9e('0x4a')](_[_0x0a9e('0xd7')](_0x5d1159,[_0x0a9e('0x41'),_0x0a9e('0x136')])));},0x1f3);}Dialer[_0x0a9e('0x1a')][_0x0a9e('0x138')]=function(_0x5871d7){var _0x26f1c6=this;var _0x421b6c=_0x26f1c6[_0x0a9e('0x1e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]];if(strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]===_0x0a9e('0x19')){if(this['actions'][_0x5871d7[_0x0a9e('0x131')]]&&this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')]){this[_0x0a9e('0x1d')][_0x0a9e('0x139')](this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x135')],this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')])[_0x0a9e('0xba')](function(_0x14444e){logger[_0x0a9e('0x98')](_0x0a9e('0x13a'),util[_0x0a9e('0x13b')](_0x14444e,{'showHidden':![],'depth':null}));})[_0x0a9e('0x13c')](function(){_0x26f1c6[_0x0a9e('0xb4')](_0x26f1c6[_0x0a9e('0x1e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]);_0x26f1c6[_0x0a9e('0x20')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')]][_0x0a9e('0x132')]=![];delete _0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]];unlockQueueStatus(_0x421b6c);});}else{this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]);this[_0x0a9e('0x10b')]({'active':![],'ContactId':this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xd8')],'ListId':this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xd9')],'VoiceQueueId':this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xdb')]||undefined,'CampaignId':this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x13d')));delete this[_0x0a9e('0x24')][_0x5871d7['actionid']];unlockQueueStatus(_0x421b6c);}}else if((strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]]['queue']][_0x0a9e('0x4e')]]||_0x0a9e('0x18'))===_0x0a9e('0x18')){var _0x1bf053;if(this['actions'][_0x5871d7[_0x0a9e('0x131')]]&&!_[_0x0a9e('0x48')](this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]]['queue']])){if(this[_0x0a9e('0x13e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]){this[_0x0a9e('0x13e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']]['queue']]=this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]?this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]:this['queueBooked'][this['actions'][_0x5871d7[_0x0a9e('0x131')]]['queue']]?this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]['_rr']||0x0:0x0;}this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]['_rr']=this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]];for(var _0x223e19=0x0;_0x223e19=0x0;})[_0x0a9e('0xba')](myreject(_0x1e30bc)));}}else{_0x1ebf20[_0x0a9e('0x150')](ami[_0x0a9e('0xb0')]({'action':'command','command':util[_0x0a9e('0x7f')](_0x0a9e('0x152'),_0x4ad6fc,!_[_0x0a9e('0x3e')](config['timezones'][_0xaa43da])?_0xaa43da:'')})[_0x0a9e('0xb9')](function(_0x4f8949){return _0x4f8949[_0x0a9e('0x156')][_0x0a9e('0x154')](_0x0a9e('0x155'))>=0x0;})['catch'](myreject(_0x1e30bc)));}Promise[_0x0a9e('0x157')](_0x1ebf20)[_0x0a9e('0xb9')](function(_0x310f89){var _0x1ecb3b=_[_0x0a9e('0x158')](_0x310f89);if(_0x1ecb3b){return _0xcdd954(_0x1ecb3b);}else{_0x2bc6a3[_0x0a9e('0x3f')]=_0x5174c5?'GLOBAL_INTERVAL_IS_OVERTIME':_0x0a9e('0x159');return _0x1e30bc(msgResponse(_0x0a9e('0x15a'),_0x0a9e('0x14c'),_0x0a9e('0x15b')+_0x5174c5+'\x20'+_0x2ee2fc+_0x0a9e('0x15c')+util[_0x0a9e('0x13b')](_0x4ad6fc,{'showHidden':![],'depth':null})+_0x0a9e('0x15d')+_0xaa43da));}})[_0x0a9e('0xba')](function(_0x597e99){return _0x1e30bc(msgResponse(_0x0a9e('0x14a'),_0x0a9e('0x14c'),JSON[_0x0a9e('0x4a')](_0x597e99)));});});};Dialer[_0x0a9e('0x1a')]['checkDialMethod']=function(_0x388b9c){var _0x57c3c4=this;return function(){switch(_0x388b9c[_0x0a9e('0x5a')]){case _0x0a9e('0x15e'):freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,0x1);break;case'power':freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,_0x388b9c[_0x0a9e('0x160')]);break;case _0x0a9e('0x8'):_0x57c3c4[_0x0a9e('0x8')](_0x388b9c);break;case'booked':freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,0x1);break;default:freeVariablesPredictive(_0x388b9c);logger[_0x0a9e('0x98')](_0x0a9e('0x161'),_0x388b9c[_0x0a9e('0x41')],_0x0a9e('0x162'));}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x163')]=function(_0x5af336){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0x164')](_0x5af336['id'],previewRecallmeReminderInterval))[_0x0a9e('0xb9')](function(_0x52cdf4){for(var _0x1b6dde=0x0;_0x1b6dde<_0x52cdf4['length'];_0x1b6dde++){var _0x2b8f51=_0x52cdf4[_0x1b6dde][_0x0a9e('0x165')][_0x0a9e('0x41')];if(_0x2b8f51)io['to'](util[_0x0a9e('0x7f')](_0x0a9e('0x166'),_0x2b8f51))[_0x0a9e('0xed')](_0x0a9e('0x167'),{'hopper':_0x52cdf4[_0x1b6dde]});}})['catch'](function(){});};Dialer[_0x0a9e('0x1a')]['launchHandleIvr']=function(_0x382412){var _0x1612d8=this;return function(){_0x1612d8['handleIvr'](_0x382412);};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x168')]=function(_0x46f728){var _0x3b2dd9=this;if(isNotPreview(_0x46f728['dialMethod'])){if(isVoiceQueueOutbound(_0x46f728[_0x0a9e('0x4d')])&&isActive(_0x46f728[_0x0a9e('0x59')])){_0x46f728['sendMessageOneNotActive']=!![];Promise[_0x0a9e('0xbb')]()['then'](checkIsLoggedIn(_0x46f728,_0x46f728['loggedIn']))['then'](checkIsActive(_0x46f728,_0x46f728[_0x0a9e('0x59')]))[_0x0a9e('0xb9')](checkInterval(_0x46f728))['then'](_0x3b2dd9[_0x0a9e('0x147')](_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9['checkIfTime'](_0x46f728[_0x0a9e('0x169')],_0x46f728[_0x0a9e('0x16a')],_0x46f728[_0x0a9e('0x41')],_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9[_0x0a9e('0x14b')](_0x46f728[_0x0a9e('0x44')],_0x46f728[_0x0a9e('0x16a')],_0x46f728['name'],_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9['checkDialMethod'](_0x46f728))[_0x0a9e('0xba')](loggerCatchQueueSummary(_0x0a9e('0x16b'),_0x46f728));}else{notSendMessagesQueue(_0x46f728);}}else{freeVariablesPredictive(_0x46f728);}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x32')]=_[_0x0a9e('0x16c')](function(){var _0x184453=_['filter'](this[_0x0a9e('0x1e')],function(_0x2af0c6){return _0x2af0c6[_0x0a9e('0x16d')];});var _0x53e92b=_[_0x0a9e('0x16e')](this[_0x0a9e('0x20')],function(_0xd886e5){return _0xd886e5[_0x0a9e('0x16f')]&&_0xd886e5[_0x0a9e('0xb1')]===_0x0a9e('0x170');});if(_0x184453[_0x0a9e('0x9a')]>0x0&&_0x53e92b[_0x0a9e('0x9a')]>0x0){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0x164')](_[_0x0a9e('0x171')](_0x184453,'id'),previewRecallmeReminderInterval,_[_0x0a9e('0x171')](_0x53e92b,'id')))[_0x0a9e('0xb9')](function(_0x3e31dc){for(var _0x2efc65=0x0;_0x2efc65<_0x3e31dc['length'];_0x2efc65++){var _0x20ebd0=_0x3e31dc[_0x2efc65][_0x0a9e('0x165')][_0x0a9e('0x41')];if(_0x20ebd0)io['to'](util['format'](_0x0a9e('0x166'),_0x20ebd0))[_0x0a9e('0xed')](_0x0a9e('0x167'),{'hopper':_0x3e31dc[_0x2efc65]});}})[_0x0a9e('0xba')](function(_0x56f175){logger[_0x0a9e('0x98')](_0x0a9e('0x163'),_0x56f175);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x0a9e('0x1a')][_0x0a9e('0x172')]=function(){var _0x4e8eb9=this;var _0x2b263b;for(var _0x1634cc in this[_0x0a9e('0x1f')]){if(typeof this[_0x0a9e('0x1f')][_0x1634cc]!=='undefined'){_0x2b263b=this['campaigns'][_0x1634cc];if(isCampaignIvr(_0x2b263b[_0x0a9e('0x4d')])&&isActive(_0x2b263b[_0x0a9e('0x7b')])){_0x2b263b[_0x0a9e('0xa1')]=!![];Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](checkIsActive(_0x2b263b,_0x2b263b[_0x0a9e('0x7b')]))[_0x0a9e('0xb9')](checkInterval(_0x2b263b))[_0x0a9e('0xb9')](_0x4e8eb9[_0x0a9e('0x147')](_0x2b263b))[_0x0a9e('0xb9')](_0x4e8eb9[_0x0a9e('0x173')](_0x2b263b[_0x0a9e('0x169')],_0x2b263b[_0x0a9e('0x16a')],_0x2b263b[_0x0a9e('0x41')],_0x2b263b))['then'](_0x4e8eb9[_0x0a9e('0x14b')](_0x2b263b[_0x0a9e('0x44')],_0x2b263b[_0x0a9e('0x16a')],_0x2b263b['name'],_0x2b263b))['then'](_0x4e8eb9[_0x0a9e('0x174')](_0x2b263b))['catch'](loggerCatchQueueSummary(_0x0a9e('0x175'),_0x2b263b));}else{notSendMessagesCampaign(_0x2b263b);}}}};function getCallerIdRandom(_0xe81ac2,_0x2e3df6){var _0x12a7e;var _0x56caca;var _0x59ce14;if(_0x2e3df6<=0x0){_0x2e3df6=0x1;}_0x12a7e=new RegExp(_0x0a9e('0x176')+_0x2e3df6+'}$');_0x56caca=Math[_0x0a9e('0x177')](0xa,_0x2e3df6-0x1);_0x59ce14=Math[_0x0a9e('0x177')](0xa,_0x2e3df6)-0x1;return util[_0x0a9e('0x7f')]('%s',_['replace'](_0xe81ac2,_0x12a7e,_[_0x0a9e('0x178')](_0x56caca,_0x59ce14)));}function extractCalleridName(_0xc1811b){var _0xa64f55=_0xc1811b[_0x0a9e('0x179')](/"(.*?)"/);return _0xa64f55?_0xa64f55[0x1]:_0xc1811b;}Dialer[_0x0a9e('0x1a')]['actionOriginate']=function(_0x5cfe15,_0x35b0e6){var _0x3cfcc3=this;var _0x45aa98=uuid['v4']();this[_0x0a9e('0x24')][_0x45aa98]=new Action(_0x5cfe15,_0x35b0e6,_0x45aa98);return new Promise(function(_0x126620,_0x25f447){if(_[_0x0a9e('0x3e')](_0x5cfe15)&&typeof _0x5cfe15!=='object'){return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x14c'),_0x0a9e('0x17b')));}if(_['isUndefined'](_0x35b0e6['phone'])||_0x35b0e6['phone']===null){return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x14c'),'contact\x20is\x20undefine'));}var _0x419d9e={'XMD-CALLERID':_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x17c')](),'XMD-AGI':_0x5cfe15['dialQueueProject']?util['format'](_0x0a9e('0x17d'),ipAgi,_0x5cfe15[_0x0a9e('0x10f')]):_0x0a9e('0x17e'),'XMD-AGIAFTER':_0x5cfe15[_0x0a9e('0x115')]?util['format'](_0x0a9e('0x17d'),ipAgi,_0x5cfe15['dialQueueProject2']):'NONE','XMD-QUEUE':_0x5cfe15[_0x0a9e('0x4d')]==='outbound'?util[_0x0a9e('0x7f')](_0x0a9e('0x17f'),_0x5cfe15[_0x0a9e('0x41')],_0x5cfe15['dialQueueOptions']||'',_0x5cfe15[_0x0a9e('0x116')]?'c':'',_0x5cfe15[_0x0a9e('0x11f')]||0x3):_0x0a9e('0x17e'),'XMD-CONTACTID':_0x35b0e6['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x17c')](),'XMD-AMD':_0x5cfe15[_0x0a9e('0xe6')]?_0x0a9e('0x180'):_0x0a9e('0x17e'),'XMD-DESTINATION':_0x0a9e('0x181')};if(_0x5cfe15['dialAMDActive']){_0x419d9e['XMD-AMDINITIALSILENCE']=_0x5cfe15[_0x0a9e('0x182')]||0x9c4;_0x419d9e[_0x0a9e('0x183')]=_0x5cfe15['dialAMDGreeting']||0x5dc;_0x419d9e['XMD-AMDAFTERGREETINGSILENCE']=_0x5cfe15['dialAMDAfterGreetingSilence']||0x320;_0x419d9e['XMD-AMDTOTALANALYSISTIME']=_0x5cfe15['dialAMDTotalAnalysisTime']||0x1388;_0x419d9e['XMD-AMDMINWORDLENGTH']=_0x5cfe15[_0x0a9e('0x184')]||0x64;_0x419d9e['XMD-AMDBETWEENWORDSSILENCE']=_0x5cfe15[_0x0a9e('0x185')]||0x32;_0x419d9e[_0x0a9e('0x186')]=_0x5cfe15[_0x0a9e('0x187')]||0x3;_0x419d9e[_0x0a9e('0x188')]=_0x5cfe15[_0x0a9e('0x189')]||0x100;_0x419d9e[_0x0a9e('0x18a')]=_0x5cfe15[_0x0a9e('0x18b')]||0x1388;}if(_0x5cfe15['type']===_0x0a9e('0x18c')){_0x419d9e[_0x0a9e('0x18d')]=_0x35b0e6[_0x0a9e('0xdb')];}else{_0x419d9e[_0x0a9e('0x18e')]=_0x35b0e6[_0x0a9e('0xdc')];}for(var _0x3d2589 in _0x35b0e6[_0x0a9e('0x18f')]){if(typeof _0x35b0e6[_0x0a9e('0x18f')][_0x3d2589]!==_0x0a9e('0x9b')){if(isNotNull(_0x35b0e6[_0x0a9e('0x18f')][_0x3d2589])&&_0x3d2589!=='id'&&_0x3d2589!==_0x0a9e('0x190')&&_0x3d2589!=='createdAt'&&_0x3d2589!==_0x0a9e('0x191')){_0x419d9e[util[_0x0a9e('0x7f')]('%s%s',_0x0a9e('0x192'),_['toUpper'](_0x3d2589))]=_0x35b0e6[_0x0a9e('0x18f')][_0x3d2589];}}}var _0x34b3d8=_0x3cfcc3['isTrunkReachable'](_0x5cfe15['Trunk'])?getCallerId(_0x5cfe15[_0x0a9e('0x7a')]['callerid'],_0x5cfe15[_0x0a9e('0x5b')],_0x5cfe15[_0x0a9e('0x193')]>0x0?getCallerIdRandom(_0x5cfe15[_0x0a9e('0x5c')],_0x5cfe15[_0x0a9e('0x193')]):_0x5cfe15[_0x0a9e('0x5c')]):getCallerId(_['isNil'](_0x5cfe15[_0x0a9e('0x194')])?_0x5cfe15['Trunk']['callerid']:_0x5cfe15[_0x0a9e('0x194')][_0x0a9e('0x195')],_0x5cfe15[_0x0a9e('0x5b')],_0x5cfe15[_0x0a9e('0x193')]>0x0?getCallerIdRandom(_0x5cfe15[_0x0a9e('0x5c')],_0x5cfe15['dialRandomLastDigitCallerIdNumber']):_0x5cfe15[_0x0a9e('0x5c')]);if(_0x34b3d8){_0x419d9e[_0x0a9e('0x196')]=_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x197')]=extractCalleridName(_0x34b3d8);_0x419d9e['XMD-ORIGINATECALLERIDNUM']=_0x35b0e6[_0x0a9e('0x198')];}_0x5cfe15[_0x0a9e('0x199')]=_0x419d9e;return ami['Action']({'actionid':_0x45aa98,'action':_0x0a9e('0x17a'),'channel':_0x3cfcc3[_0x0a9e('0xe1')](_0x5cfe15[_0x0a9e('0x7a')])?util[_0x0a9e('0x7f')]('SIP/%s/%s%s',_0x5cfe15[_0x0a9e('0x7a')][_0x0a9e('0x41')],isNotNull(_0x5cfe15[_0x0a9e('0x5e')])?_0x5cfe15[_0x0a9e('0x5e')][_0x0a9e('0x19a')]()||'':'',_0x5cfe15['dialCutDigit']>0x0?_0x35b0e6[_0x0a9e('0x198')][_0x0a9e('0x19b')](_0x5cfe15['dialCutDigit']):_0x35b0e6[_0x0a9e('0x198')]):util['format'](_0x0a9e('0x19c'),_[_0x0a9e('0xaf')](_0x5cfe15[_0x0a9e('0x194')])?_0x5cfe15[_0x0a9e('0x7a')][_0x0a9e('0x41')]:_0x5cfe15[_0x0a9e('0x194')][_0x0a9e('0x41')],isNotNull(_0x5cfe15[_0x0a9e('0x5e')])?_0x5cfe15[_0x0a9e('0x5e')][_0x0a9e('0x19a')]()||'':'',_0x5cfe15[_0x0a9e('0x19d')]>0x0?_0x35b0e6[_0x0a9e('0x198')][_0x0a9e('0x19b')](_0x5cfe15[_0x0a9e('0x19d')]):_0x35b0e6[_0x0a9e('0x198')]),'callerid':_0x34b3d8,'Exten':'xcally-motion-dialer','Context':_0x0a9e('0x19e'),'Priority':'1','variable':_0x419d9e,'timeout':(_0x5cfe15[_0x0a9e('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45aa98})[_0x0a9e('0xb9')](function(_0xf35801){return _0x126620(_0xf35801);})[_0x0a9e('0xba')](function(_0x3d7d73){_0x5cfe15[_0x0a9e('0x67')]+=0x1;var _0x1fbf62=new History(_0x3cfcc3['actions'][_0x45aa98]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x0a9e('0x4a')](_0x3d7d73)));_0x1fbf62['state']=0xe;_0x1fbf62['statedesc']='OriginateError';_0x1fbf62[_0x0a9e('0xa9')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));_0x1fbf62[_0x0a9e('0xa8')]=_0x1fbf62['starttime'];_0x3cfcc3['createHistory'](_0x1fbf62)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x19f')));_0x3cfcc3[_0x0a9e('0xcf')](_0x1fbf62)[_0x0a9e('0xba')](loggerCatch('[originate][error]'))[_0x0a9e('0x13c')](function(){delete _0x3cfcc3[_0x0a9e('0x24')][_0x45aa98];return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x49'),_0x0a9e('0x1a0')));});});});};Dialer[_0x0a9e('0x1a')]['syncOriginateResponse']=function(_0x298a78){var _0x5056d5=this['actions'][_0x298a78[_0x0a9e('0x131')]];if(_0x5056d5){delete this['actions'][_0x298a78[_0x0a9e('0x131')]];_0x5056d5[_0x0a9e('0x11e')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));var _0xe87eb3=_0x5056d5[_0x0a9e('0x4d')]===_0x0a9e('0x7e')?this[_0x0a9e('0x1f')][_0x5056d5[_0x0a9e('0xb5')]]:this['voiceQueues'][_0x5056d5[_0x0a9e('0x1a1')]()];if(!this[_0x0a9e('0xdf')](_0x298a78['response'])){this[_0x0a9e('0xb4')](_0xe87eb3);return this[_0x0a9e('0x1a2')](_0x5056d5,_0xe87eb3,_0x298a78)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1a3')));}this['uniqueId'][_0x298a78[_0x0a9e('0xe9')]]=_0x5056d5;}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1a4')]=function(_0x44b14c,_0x1aa179,_0x5840d5){var _0x4c08b3=new History(_0x1aa179);if(_0x4c08b3[_0x0a9e('0x107')]+_0x4c08b3['countcongestionretry']+_0x4c08b3[_0x0a9e('0x1a5')]+_0x4c08b3['countnosuchnumberretry']+_0x4c08b3[_0x0a9e('0x109')]+_0x4c08b3['countabandonedretry']+_0x4c08b3[_0x0a9e('0xf6')]+_0x4c08b3['countagentrejectretry']>=_0x5840d5[_0x0a9e('0xfc')]-0x1){return!![];}switch(_0x44b14c){case 0x3:if(_0x4c08b3[_0x0a9e('0x1a5')]>=_0x5840d5[_0x0a9e('0x1a6')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4c08b3['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5['dialNoAnswerRetryFrequency'],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1a7')));break;case 0x5:if(_0x4c08b3[_0x0a9e('0x107')]>=_0x5840d5[_0x0a9e('0x1a8')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countbusyretry':_0x4c08b3[_0x0a9e('0x107')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1a9')],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4c08b3[_0x0a9e('0xf9')]>=_0x5840d5['dialCongestionMaxRetry']-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countcongestionretry':_0x4c08b3['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1aa')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1ab')));break;case 0x0:if(_0x4c08b3['countnosuchnumberretry']>=_0x5840d5[_0x0a9e('0x1ac')]-0x1){return!![];}else{this[_0x0a9e('0x10b')]({'active':![],'countnosuchnumberretry':_0x4c08b3[_0x0a9e('0x108')]+=0x1,'scheduledat':moment()['add'](_0x5840d5['dialNoSuchNumberRetryFrequency'],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1ad')));}break;case 0xa:if(_0x4c08b3['countdropretry']>=_0x5840d5[_0x0a9e('0x126')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x4c08b3['countdropretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x122')],'minutes')['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x127')));break;case 0xb:if(_0x4c08b3['countabandonedretry']>=_0x5840d5['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countabandonedretry':_0x4c08b3[_0x0a9e('0xfa')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1ae')],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x12e')));break;case 0x13:if(_0x4c08b3[_0x0a9e('0xf6')]>=_0x5840d5[_0x0a9e('0xfe')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countmachineretry':_0x4c08b3[_0x0a9e('0xf6')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x102')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));break;case 0x14:if(_0x4c08b3[_0x0a9e('0xfb')]>=_0x5840d5[_0x0a9e('0x1af')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countagentrejectretry':_0x4c08b3[_0x0a9e('0xfb')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1b0')],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3['ListId'],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1b1')));break;default:return!![];}};Dialer['prototype'][_0x0a9e('0x1a2')]=function(_0x174487,_0x5cacc0,_0x15f892){var _0x22b47b=this;var _0x57d648=new History(_0x174487);var _0x4b24bd=![];var _0x5a7379;var _0x34f612;return new Promise(function(_0x2d6673,_0x25bc80){if(_['isUndefined'](_0x5cacc0)&&typeof _0x5cacc0!=='object'){return _0x25bc80(msgResponse(_0x0a9e('0x1b2'),_0x0a9e('0x14c'),_0x0a9e('0x1b3')));}if(_[_0x0a9e('0x3e')](_0x15f892)&&typeof _0x15f892!=='object'){return _0x25bc80(msgResponse(_0x0a9e('0x1b2'),'Failure','evt\x20is\x20undefine'));}_0x22b47b[_0x0a9e('0xbe')](_0x57d648,_0x15f892[_0x0a9e('0x114')],_0x5cacc0)[_0x0a9e('0xb9')](function(_0x5763cb){if(_0x5763cb[_0x0a9e('0x125')]==0x1)_0x4b24bd=!![];switch(_0x15f892[_0x0a9e('0x114')]){case'0':_0x5cacc0[_0x0a9e('0x66')]+=0x1;_0x57d648['state']=0x0;_0x57d648['statedesc']=_0x0a9e('0x1b4');_0x57d648[_0x0a9e('0x108')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x0a9e('0xef')](_0x174487,'nosuchnumber'));_0x5a7379=_0x5cacc0['dialNoSuchNumberRetryFrequency'];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0x22b47b['checkRetriveMax'](0x0,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x108')]>=_0x5cacc0[_0x0a9e('0x1ac')]){_0x22b47b['createStateFinal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1b5'));}else{_0x22b47b['stateGlobal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1b5'));}}break;case'3':_0x5cacc0[_0x0a9e('0x65')]+=0x1;_0x57d648['state']=0x3;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1b6');_0x57d648[_0x0a9e('0x1a5')]+=0x1;_0x57d648['countglobal']+=0x1;var _0x10f9fe=ut[_0x0a9e('0x1b7')](_0x174487,_0x5cacc0);ami[_0x0a9e('0xed')]('custom:agentnoanswer',_0x10f9fe);_0x5a7379=_0x5cacc0[_0x0a9e('0x1b8')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x1b9')));if(_0x22b47b[_0x0a9e('0x1a4')](0x3,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x1a5')]>=_0x5cacc0[_0x0a9e('0x1a6')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1ba'));}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1ba'));}}break;case'5':_0x5cacc0['outboundBusyCallsDay']+=0x1;_0x57d648[_0x0a9e('0xa7')]=0x5;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1bb');_0x57d648[_0x0a9e('0x107')]+=0x1;_0x57d648['countglobal']+=0x1;ami[_0x0a9e('0xed')](_0x0a9e('0x1bc'),ut['buildObj'](_0x174487,_0x0a9e('0x1bd')));_0x5a7379=_0x5cacc0[_0x0a9e('0x1a9')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1be')));if(_0x22b47b[_0x0a9e('0x1a4')](0x5,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x107')]>=_0x5cacc0['dialBusyMaxRetry']){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,'reason\x205\x20busy');}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1bf'));}}break;case'8':_0x5cacc0['outboundCongestionCallsDay']+=0x1;_0x57d648[_0x0a9e('0xa7')]=0x8;_0x57d648[_0x0a9e('0xea')]='Congestion';_0x57d648[_0x0a9e('0xf9')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;_0x5a7379=_0x5cacc0['dialCongestionRetryFrequency'];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x174487,_0x0a9e('0x1c0')));_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x1c1')));if(_0x22b47b[_0x0a9e('0x1a4')](0x8,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648['countcongestionretry']>=_0x5cacc0[_0x0a9e('0x1c2')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,'reason\x208\x20congestion');}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c3'));}}break;case'11':_0x5cacc0[_0x0a9e('0x1c4')]+=0x1;_0x57d648['state']=0xb;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x57d648[_0x0a9e('0xfa')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;_0x5a7379=_0x5cacc0[_0x0a9e('0x1ae')];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x12f')));if(_0x22b47b[_0x0a9e('0x1a4')](0xb,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0xfa')]>=_0x5cacc0[_0x0a9e('0x12d')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c5'));}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c5'));}}break;case'20':_0x5cacc0[_0x0a9e('0x69')]+=0x1;_0x57d648['state']=0x14;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1c6');_0x57d648[_0x0a9e('0xfb')]+=0x1;_0x57d648['countglobal']+=0x1;_0x5a7379=_0x5cacc0['dialAgentRejectRetryFrequency'];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentreject',ut[_0x0a9e('0xef')](_0x174487,'agentreject'));_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1c7')));if(_0x22b47b[_0x0a9e('0x1a4')](0x14,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0xfb')]>=_0x5cacc0[_0x0a9e('0x1af')]){_0x22b47b['createStateFinal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c8'));}else{_0x22b47b['stateGlobal'](_0x57d648,_0x2d6673,_0x25bc80,'reason\x2020\x20agentreject');}}break;default:_0x5cacc0[_0x0a9e('0x6a')]+=0x1;_0x57d648['state']=0xc;_0x57d648[_0x0a9e('0xea')]=_0x15f892['reason'];_0x5a7379=_0x5cacc0[_0x0a9e('0x1b0')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1c9')));if(_0x22b47b['checkRetriveMax'](_0x15f892[_0x0a9e('0x114')],_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x107')]+_0x57d648['countcongestionretry']+_0x57d648[_0x0a9e('0x1a5')]+_0x57d648[_0x0a9e('0x108')]+_0x57d648['countdropretry']+_0x57d648[_0x0a9e('0xfa')]+_0x57d648[_0x0a9e('0xf6')]+_0x57d648[_0x0a9e('0xfb')]>=_0x5cacc0[_0x0a9e('0xfc')]){_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x15f892[_0x0a9e('0x114')]);}else{_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x15f892['reason']);}}}})[_0x0a9e('0xb9')](function(){if(_0x4b24bd){_0x22b47b[_0x0a9e('0xc0')](_0x57d648,_0x5a7379,_0x34f612)[_0x0a9e('0xb9')](function(){return _0x2d6673(0x1);});}});});};Dialer[_0x0a9e('0x1a')]['stateGlobal']=function(_0x19e176,_0x300474,_0x189e15,_0x12bc40){var _0x32c53e=new Final(_0x19e176);_0x32c53e[_0x0a9e('0xa7')]=0xf;_0x32c53e[_0x0a9e('0xea')]=_0x0a9e('0x1ca');this['createStateFinal'](_0x32c53e,_0x300474,_0x189e15,_0x12bc40);};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xff')]=function(_0x315236,_0x4a80a0,_0x3da853,_0x101e33){this[_0x0a9e('0xcf')](_0x315236)[_0x0a9e('0xb9')](function(){return _0x4a80a0(msgResponse(_0x0a9e('0x1b2'),_0x0a9e('0xe0'),_0x101e33));})[_0x0a9e('0xba')](function(){return _0x3da853(msgResponse(_0x0a9e('0x1cb'),_0x0a9e('0x14c'),_0x0a9e('0x1cc')));});};Dialer['prototype'][_0x0a9e('0x8')]=function(_0x3a87e7){var _0x21f245=_0x3a87e7['dialPredictiveOptimizationPercentage']/0x64;var _0x4d473a=_0x3a87e7[_0x0a9e('0x64')]/(_0x3a87e7[_0x0a9e('0x64')]+_0x3a87e7[_0x0a9e('0x60')]);var _0x73014f=Math[_0x0a9e('0x1cd')](_0x3a87e7[_0x0a9e('0x74')]*(_0x3a87e7[_0x0a9e('0x1ce')]/0x64));var _0x236a28=Math[_0x0a9e('0x1cd')](_0x3a87e7['predictiveIntervalAvailable']*(_0x3a87e7[_0x0a9e('0x1cf')]/0x64));var _0x41ae51=_0x3a87e7['available']+_0x3a87e7[_0x0a9e('0x53')];var _0xa0ec15=Math['floor'](_0x3a87e7['erlangCalls']*_0x3a87e7[_0x0a9e('0x8d')]*_0x3a87e7[_0x0a9e('0x71')]*_0x3a87e7[_0x0a9e('0x72')]);if(_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x79')])){if(!_['isUndefined'](_0x3a87e7[_0x0a9e('0x27')])){_0x3a87e7['startPredictive']=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x0a9e('0x1d0'));}if(!_['isUndefined'](_0x3a87e7['handlePredictive'])){loggerPredictive['error'](_0x0a9e('0x1d1'),_0x0a9e('0x1d2'));clearInterval(_0x3a87e7[_0x0a9e('0x92')]);_0x3a87e7[_0x0a9e('0x92')]=undefined;}_0x3a87e7['startProgressive']=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1d3'),_0x3a87e7[_0x0a9e('0x79')]);this['handlePower'](_0x3a87e7,0x1);}else if(ifInterval(_0x3a87e7['dialPredictiveInterval'],_0x3a87e7['startProgressive'])){this[_0x0a9e('0x15f')](_0x3a87e7,0x1);loggerPredictiveCalls[_0x0a9e('0x82')](_0x0a9e('0x1d4'),_0x3a87e7[_0x0a9e('0x79')],_0x3a87e7[_0x0a9e('0x41')]);_0x3a87e7['erlangCalls']=0x0;_0x3a87e7[_0x0a9e('0x70')]=0x0;}else if(_0x21f245<_0x4d473a&&_0x3a87e7[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x1d7'),_0x0a9e('0x1d8'),_0x4d473a,'startProgressive',_0x3a87e7[_0x0a9e('0x41')]);}else if(_0xa0ec15<_0x3a87e7[_0x0a9e('0x70')]&&_0x3a87e7[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x1d9'),_0x0a9e('0x1da'),_0xa0ec15,_0x0a9e('0x1db'),_0x3a87e7[_0x0a9e('0x70')],_0x0a9e('0x79'),_0x3a87e7[_0x0a9e('0x41')]);}else if(!ifInterval(_0x3a87e7[_0x0a9e('0x1dc')],_0x3a87e7[_0x0a9e('0x79')])&&_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x27')])&&!_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x79')])){_0x3a87e7[_0x0a9e('0x27')]=moment()['format'](_0x0a9e('0x104'));loggerPredictive[_0x0a9e('0x82')](_0x3a87e7['name'],'started\x20in\x20predictive\x20at',_0x3a87e7['startPredictive']);this[_0x0a9e('0xc3')](_0x3a87e7[_0x0a9e('0x1dc')])['then'](this[_0x0a9e('0x1dd')](_0x3a87e7))[_0x0a9e('0xb9')](mergeDataErlangB(_0x3a87e7))['then'](this[_0x0a9e('0x1de')](_0x3a87e7))['catch'](loggerCatchPredictive(_0x0a9e('0x1df'),_0x3a87e7));}else if(!ifInterval(_0x3a87e7['dialPredictiveInterval'],_0x3a87e7[_0x0a9e('0x27')])){_0x3a87e7[_0x0a9e('0x70')]=0x0;_0x3a87e7[_0x0a9e('0x27')]=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0a9e('0x82')](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1e0'),_0x3a87e7['startPredictive']);clearInterval(_0x3a87e7['handlePredictive']);_0x3a87e7['handlePredictive']=undefined;this['averageHandleTime'](_0x3a87e7[_0x0a9e('0x1dc')])[_0x0a9e('0xb9')](this[_0x0a9e('0x1dd')](_0x3a87e7))[_0x0a9e('0xb9')](mergeDataErlangB(_0x3a87e7))[_0x0a9e('0xb9')](this['startMethodPredictive'](_0x3a87e7))[_0x0a9e('0xba')](loggerCatchPredictive(_0x0a9e('0x1e1'),_0x3a87e7));}else if(_0x3a87e7[_0x0a9e('0x74')]&&_0x41ae51<_0x3a87e7[_0x0a9e('0x74')]-_0x236a28){freeVariablesPredictive(_0x3a87e7);loggerPredictive['info'](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1e2'),_0x41ae51,_0x0a9e('0x1e3'),_0x3a87e7[_0x0a9e('0x74')],'-',_0x236a28,'=',_0x3a87e7[_0x0a9e('0x74')]-_0x236a28,')');}else if(_0x3a87e7['predictiveIntervalAvailable']&&_0x41ae51>_0x3a87e7[_0x0a9e('0x74')]+_0x73014f){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x3a87e7[_0x0a9e('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x41ae51,_0x0a9e('0x1e4'),_0x3a87e7['predictiveIntervalAvailable'],'+',_0x73014f,'=',_0x3a87e7[_0x0a9e('0x74')]+_0x73014f,')');}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1dd')]=function(_0xda737b){var _0x415fce=this;return function(_0x59f11d){return new Promise(function(_0x4bacf7,_0x1428a7){_[_0x0a9e('0x8f')](_0xda737b,_0x59f11d[0x0]);if(checkGetDataPredictive(_0x59f11d[0x0])){var _0x44b401=_0xda737b[_0x0a9e('0x74')]=_0xda737b['talking']+_0xda737b[_0x0a9e('0xa2')];var _0x706802=_0xda737b[_0x0a9e('0x1dc')]*0x3c;var _0x5bba8b=_0x59f11d[0x0][_0x0a9e('0x6d')]+_0x59f11d[0x0]['predictiveIntervalAvgHoldtime'];var _0x479441=(_0x59f11d[0x0][_0x0a9e('0x6b')]+_0x59f11d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59f11d[0x0][_0x0a9e('0x6e')])/_0x59f11d[0x0][_0x0a9e('0x75')];_0xda737b[_0x0a9e('0x71')]=_0x479441>0x0?_0x479441:0x1;switch(_0xda737b['dialPredictiveOptimization']){case _0x0a9e('0x1d6'):var _0x25d456=_0xda737b[_0x0a9e('0x1e5')]/0x64;return _0x415fce[_0x0a9e('0x1e6')](_0x44b401,_0x706802,_0x5bba8b,_0x479441,_0x25d456)[_0x0a9e('0xb9')](function(_0x26fd45){return _0x4bacf7(_0x26fd45);});case _0x0a9e('0x1e7'):var _0x1c3f66=_0xda737b['dialPredictiveOptimizationPercentage']/0x64;return _0x415fce[_0x0a9e('0x1e8')](_0x44b401,_0x706802,_0x5bba8b,_0x479441,_0x1c3f66)[_0x0a9e('0xb9')](function(_0x3ea9f1){return _0x4bacf7(_0x3ea9f1);});default:return _0x1428a7(msgResponse(_0x0a9e('0x1e9'),_0x0a9e('0x14c'),'Unknown\x20Predictive'));}}else{return _0x1428a7(msgResponse('[getDataPredictive]',_0x0a9e('0x14c'),'check\x20failure'));}});};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1ea')]=function(_0x58b3f3){var _0x2eb471=this;return function(_0x239eef){return new Promise(function(_0xc91243,_0x49973b){_[_0x0a9e('0x8f')](_0x58b3f3,_0x239eef[0x0]);if(checkGetDataPredictive(_0x239eef[0x0])){loggerPredictive[_0x0a9e('0x82')](JSON[_0x0a9e('0x4a')](_0x239eef[0x0]));if(_0x58b3f3[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){return _0x2eb471[_0x0a9e('0xce')](_0x58b3f3['id'])[_0x0a9e('0xb9')](function(_0x305a4b){var _0x5695b6=_0x58b3f3[_0x0a9e('0x1eb')]-_0x305a4b[0x0][_0x0a9e('0x1ec')];var _0x459efc=_0x58b3f3[_0x0a9e('0x1dc')]*0x3c;var _0x727652=_0x239eef[0x0]['predictiveIntervalAvgTalktime']+_0x239eef[0x0][_0x0a9e('0x6c')];var _0x4fb1ea=(_0x239eef[0x0][_0x0a9e('0x6b')]+_0x239eef[0x0][_0x0a9e('0x6f')]+_0x239eef[0x0][_0x0a9e('0x6e')])/_0x239eef[0x0]['predictiveIntervalTotalCalls'];var _0x43ff93=_0x58b3f3['dialPredictiveOptimizationPercentage']/0x64;_0x58b3f3[_0x0a9e('0x73')]=_0x305a4b[0x0][_0x0a9e('0x1ec')]||0x0;_0x58b3f3[_0x0a9e('0x71')]=_0x4fb1ea>0x0?_0x4fb1ea:0x1;return _0x2eb471[_0x0a9e('0x1e6')](_0x5695b6,_0x459efc,_0x727652,_0x4fb1ea,_0x43ff93);})['then'](function(_0x323936){return _0xc91243(_0x323936);})['catch'](function(_0x334e91){return _0x49973b(msgResponse(_0x0a9e('0x1ed'),'Failure',JSON[_0x0a9e('0x4a')](_0x334e91)));});}if(_0x58b3f3[_0x0a9e('0x1d5')]===_0x0a9e('0x1e7')){return _0x2eb471['getVoiceQueueRtPauses'](_0x58b3f3['id'])[_0x0a9e('0xb9')](function(_0x5608ed){var _0xdbcd6=_0x58b3f3[_0x0a9e('0x1eb')]-_0x5608ed[0x0]['outboundQueuePauses'];var _0x4df5cc=_0x58b3f3['dialPredictiveInterval']*0x3c;var _0x495820=_0x239eef[0x0][_0x0a9e('0x6d')]+_0x239eef[0x0][_0x0a9e('0x6c')];var _0x3d7fb6=(_0x239eef[0x0][_0x0a9e('0x6b')]+_0x239eef[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x239eef[0x0][_0x0a9e('0x6e')])/_0x239eef[0x0]['predictiveIntervalTotalCalls'];var _0x400b85=_0x58b3f3[_0x0a9e('0x1e5')]/0x64;_0x58b3f3['predictiveIntervalPauses']=_0x5608ed[0x0][_0x0a9e('0x1ec')]||0x0;_0x58b3f3[_0x0a9e('0x71')]=_0x3d7fb6>0x0?_0x3d7fb6:0x1;return _0x2eb471[_0x0a9e('0x1e8')](_0xdbcd6,_0x4df5cc,_0x495820,_0x3d7fb6,_0x400b85);})[_0x0a9e('0xb9')](function(_0x37c272){return _0xc91243(_0x37c272);})[_0x0a9e('0xba')](function(_0xf01ef8){return _0x49973b(msgResponse('[CatchErlangB]',_0x0a9e('0x14c'),JSON[_0x0a9e('0x4a')](_0xf01ef8)));});}}else{return _0x49973b(msgResponse(_0x0a9e('0x1e9'),_0x0a9e('0x14c'),_0x0a9e('0x1ee')));}});};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1de')]=function(_0xd66cc3){var _0x2dc3df=this;return function(){var _0x43fd4c=0x0;var _0x10e1b9=Math['floor'](_0xd66cc3[_0x0a9e('0x77')]*0x3e8);if(_0x10e1b9>0x0){_0x10e1b9=_0x10e1b9<0x64?0x64:_0x10e1b9;loggerPredictive[_0x0a9e('0x82')](_0xd66cc3[_0x0a9e('0x41')],_0x0a9e('0x1ef'),_0x10e1b9,_0x0a9e('0x4b'));_0xd66cc3[_0x0a9e('0x92')]=setInterval(function(){_0x2dc3df[_0x0a9e('0x92')](_0xd66cc3);loggerPredictiveCalls['info'](_0x0a9e('0x1f0'),_0x43fd4c+=0x1);},_0x10e1b9);}else{loggerPredictive[_0x0a9e('0x82')](_0xd66cc3[_0x0a9e('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1f1')]=function(_0x2e082a,_0x4c7e3b){var _0x5d3ad3=this;return function(_0x23b67e){if(_[_0x0a9e('0x48')](_0x23b67e)){if(_[_0x0a9e('0xaf')](_0x4c7e3b[_0x0a9e('0xda')])||!_0x4c7e3b[_0x0a9e('0x1f2')]){if(_0x2e082a['dialMethod']===_0x0a9e('0x7')){_0x2e082a['queueStatusComplete']=_[_0x0a9e('0x3e')](_0x2e082a[_0x0a9e('0x136')])?!![]:_0x2e082a['queueStatusComplete'];var _0x449dd9=uuid['v4']();_0x5d3ad3['actions'][_0x449dd9]=new Action(_0x2e082a,_0x4c7e3b,_0x449dd9);loggerBooked[_0x0a9e('0x82')](_0x0a9e('0x1f3'),_0x449dd9,'queueStatusComplete:\x20',JSON[_0x0a9e('0x4a')](_0x2e082a[_0x0a9e('0x136')]),_0x0a9e('0x1f4'),_0x2e082a['name']);if(_0x2e082a[_0x0a9e('0x136')]){_0x2e082a[_0x0a9e('0x136')]=![];_0x5d3ad3[_0x0a9e('0x134')][_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xb5')]]=[];ami[_0x0a9e('0xb0')]({'actionid':_0x449dd9,'action':'queuestatus','queue':_0x2e082a[_0x0a9e('0x41')]})[_0x0a9e('0xba')](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);_0x5d3ad3[_0x0a9e('0x10b')]({'active':![],'ContactId':_0x5d3ad3['actions'][_0x449dd9]['ContactId'],'ListId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xd9')],'VoiceQueueId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9]['VoiceQueueId']||undefined,'CampaignId':_0x5d3ad3['actions'][_0x449dd9][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5d3ad3[_0x0a9e('0x24')][_0x449dd9];});}else{loggerBooked[_0x0a9e('0x82')]('[booked][checkContactBlack][else]',JSON[_0x0a9e('0x4a')](_0x2e082a[_0x0a9e('0x136')]),_0x0a9e('0x1f4'),_0x2e082a[_0x0a9e('0x41')]);_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);_0x5d3ad3['rescheduleContact']({'active':![],'ContactId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xd8')],'ListId':_0x5d3ad3['actions'][_0x449dd9][_0x0a9e('0xd9')],'VoiceQueueId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xdb')]||undefined,'CampaignId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x1f5')));delete _0x5d3ad3[_0x0a9e('0x24')][_0x449dd9];}}else{return _0x5d3ad3['actionOriginate'](_0x2e082a,_0x4c7e3b);}}else{if(getDiff(_0x4c7e3b['scheduledat'])<_0x2e082a[_0x0a9e('0x1f6')]*0x3c){if(_0x4c7e3b[_0x0a9e('0x165')]&&!_0x4c7e3b['Agent']['voicePause']){_0x5d3ad3[_0x0a9e('0x1d')][_0x0a9e('0x139')](_0x4c7e3b['id'])[_0x0a9e('0x13c')](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);});}else{_0x5d3ad3[_0x0a9e('0xc7')]({'active':![]},_0x4c7e3b['id'],0x1)['finally'](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);});}}else{_0x2e082a['outboundReCallsDay']+=0x1;_0x5d3ad3['updateOriginated'](_0x2e082a);if(_0x2e082a[_0x0a9e('0x1f7')]){_0x5d3ad3['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c7e3b[_0x0a9e('0xd8')],'ListId':_0x4c7e3b['ListId'],'VoiceQueueId':_0x4c7e3b[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c7e3b['CampaignId']||undefined})['catch'](loggerCatch(_0x0a9e('0x1f8')));_0x5d3ad3[_0x0a9e('0xd1')](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1f9'),0x17,'RecallInQueue'))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5d3ad3[_0x0a9e('0xd6')](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1fa'),0x16,'RecallFailedTimeout'),_0x0a9e('0x1fb'),'[Originate][HistoryRecallClose]');}}}}else{_0x2e082a[_0x0a9e('0x61')]+=0x1;_0x5d3ad3['saveInDb'](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1fc'),0xd,_0x0a9e('0x1fd')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1fe')]=function(_0x149a5d){var _0x2f8a0a=this;var _0x311544=_0x149a5d[_0x0a9e('0x1ff')]-_0x149a5d[_0x0a9e('0x76')]-_0x149a5d[_0x0a9e('0xca')];emitCampaignSummary(_0x149a5d);if(_0x311544>0x0){if(_0x311544>this[_0x0a9e('0x22')]){_0x311544=this[_0x0a9e('0x22')];}_0x149a5d[_0x0a9e('0xca')]+=_0x311544;this[_0x0a9e('0xcc')](_0x149a5d['id'],_0x311544,_0x149a5d[_0x0a9e('0x200')],_0x149a5d)[_0x0a9e('0xb9')](function(_0x2e8669){_0x149a5d['temp']-=_0x311544;_0x149a5d['temp']=_0x149a5d[_0x0a9e('0xca')]>0x0?_0x149a5d[_0x0a9e('0xca')]:0x0;if(!checkContactEmpty(_0x2e8669)){_0x149a5d[_0x0a9e('0x3f')]=_0x0a9e('0x9f');logger['info'](_0x0a9e('0x201')+_0x149a5d['name']);}else{_0x149a5d[_0x0a9e('0x76')]+=_0x2e8669['length'];_0x149a5d[_0x0a9e('0x3f')]='RUNNING';for(var _0x50985c=0x0;_0x50985c<_0x2e8669[_0x0a9e('0x9a')];_0x50985c+=0x1){_0x149a5d[_0x0a9e('0x202')]+=0x1;if(_[_0x0a9e('0xaf')](_0x2e8669[_0x50985c])||_[_0x0a9e('0xaf')](_0x2e8669[_0x50985c]['Contact'])||_['isNil'](_0x2e8669[_0x50985c][_0x0a9e('0x198')])){_0x2f8a0a['emptyContact'](_0x0a9e('0x203'),_0x149a5d,_0x2e8669[_0x50985c]);}else{_0x2f8a0a[_0x0a9e('0xc2')](_['pick'](_0x2e8669[_0x50985c],[_0x0a9e('0xdc'),'Contact.phone']))[_0x0a9e('0xb9')](_0x2f8a0a[_0x0a9e('0x1f1')](_0x149a5d,_0x2e8669[_0x50985c]))[_0x0a9e('0xba')](_0x2f8a0a[_0x0a9e('0xd4')](_0x0a9e('0x204'),_0x149a5d));}}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x205'),_0x149a5d,_0x311544));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x15f')]=function(_0x342861,_0x2d4b26){var _0x2070da=this;var _0x29930d=[];var _0x68d005=_0x2d4b26>=0x1?_0x2d4b26:0x1;if(_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')){_0x68d005=0x1;}var _0x5b42ef=Math[_0x0a9e('0x206')](_0x342861[_0x0a9e('0xa2')]*_0x68d005)-_0x342861[_0x0a9e('0x76')]-_0x342861['temp'];emitVoiceQueueSummary(_0x342861);if(_0x342861[_0x0a9e('0x207')]>0x0){var _0x312cf5=_0x342861[_0x0a9e('0x207')]-_0x342861[_0x0a9e('0x76')]-_0x342861[_0x0a9e('0x53')]-_0x342861[_0x0a9e('0xca')]-_0x342861[_0x0a9e('0x50')];if(_0x5b42ef>_0x312cf5){_0x5b42ef=_0x312cf5;}}if(_0x5b42ef>0x0){if(_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')){_0x5b42ef=0x1;}if(_0x5b42ef>this[_0x0a9e('0x22')]){_0x5b42ef=this[_0x0a9e('0x22')];}_0x342861['temp']+=_0x5b42ef;for(var _0x189849 in this[_0x0a9e('0x20')]){if(typeof this[_0x0a9e('0x20')][_0x189849]!=='undefined'){if(this[_0x0a9e('0x20')][_0x189849]['state']==='not_inuse'&&this[_0x0a9e('0x20')][_0x189849]['status']===_0x0a9e('0x170')){_0x29930d['push'](this[_0x0a9e('0x20')][_0x189849]['id']);}}}this[_0x0a9e('0xc9')](_0x342861['id'],_0x29930d,_0x5b42ef,_0x342861[_0x0a9e('0x200')],_0x342861)['then'](function(_0x1676f3){_0x342861['temp']-=_0x5b42ef;_0x342861['temp']=_0x342861[_0x0a9e('0xca')]>0x0?_0x342861[_0x0a9e('0xca')]:0x0;if(!checkContactEmpty(_0x1676f3)){_0x2070da[_0x0a9e('0xb8')](_0x342861)[_0x0a9e('0xb9')](sendMessageReschedule(_0x342861))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x208')));}else{_0x342861['originated']+=_0x1676f3[_0x0a9e('0x9a')];_0x342861[_0x0a9e('0x3f')]=_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')?_0x0a9e('0x180'):'RUNNING';for(var _0xda6cd8=0x0;_0xda6cd8<_0x1676f3[_0x0a9e('0x9a')];_0xda6cd8+=0x1){if(_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8])||_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8][_0x0a9e('0x18f')])||_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8][_0x0a9e('0x198')])){_0x2070da[_0x0a9e('0x209')](_0x0a9e('0x203'),_0x342861,_0x1676f3[_0xda6cd8]);}else{_0x2070da[_0x0a9e('0xbc')](_[_0x0a9e('0xd7')](_0x1676f3[_0xda6cd8],[_0x0a9e('0xdb'),_0x0a9e('0x20a')]))['then'](_0x2070da['checkContactBlack'](_0x342861,_0x1676f3[_0xda6cd8]))[_0x0a9e('0xba')](_0x2070da[_0x0a9e('0xd4')]('[actionOriginate]\x20',_0x342861));}}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x20b'),_0x342861,_0x5b42ef));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x92')]=function(_0x2fdb67){if(_0x2fdb67['dialLimitQueue']>0x0){var _0x5d85ab=_0x2fdb67['dialLimitQueue']-_0x2fdb67[_0x0a9e('0x76')]-_0x2fdb67[_0x0a9e('0x53')];if(_0x5d85ab>0x0){this[_0x0a9e('0x20c')](_0x2fdb67);}else{loggerPredictiveCalls[_0x0a9e('0x82')](_0x0a9e('0x20d'));}}else{this[_0x0a9e('0x20c')](_0x2fdb67);}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x20c')]=function(_0x44c694){var _0x4ee67f=this;var _0x4a0c23=[];_0x44c694[_0x0a9e('0x76')]+=0x1;for(var _0x45fac7 in this[_0x0a9e('0x20')]){if(typeof this[_0x0a9e('0x20')][_0x45fac7]!==_0x0a9e('0x9b')){if(this[_0x0a9e('0x20')][_0x45fac7][_0x0a9e('0xa7')]===_0x0a9e('0x20e')&&this[_0x0a9e('0x20')][_0x45fac7][_0x0a9e('0xb1')]==='reachable'){_0x4a0c23[_0x0a9e('0x150')](this['agents'][_0x45fac7]['id']);}}}this['getContactDialer'](_0x44c694['id'],_0x4a0c23,0x1,_0x44c694[_0x0a9e('0x200')],_0x44c694)[_0x0a9e('0xb9')](function(_0x115423){if(!checkContactEmpty(_0x115423)){checkContactLowerLimitOriginate(_0x44c694,0x1,0x0);_0x4ee67f[_0x0a9e('0xb8')](_0x44c694)[_0x0a9e('0xb9')](sendMessageReschedule(_0x44c694))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x208')));}else{_0x44c694[_0x0a9e('0x3f')]=_0x0a9e('0x20f');if(_['isNil'](_0x115423[0x0])||_[_0x0a9e('0xaf')](_0x115423[0x0][_0x0a9e('0x18f')])||_[_0x0a9e('0xaf')](_0x115423[0x0]['phone'])){_0x4ee67f[_0x0a9e('0x209')](_0x0a9e('0x203'),_0x44c694,_0x115423[0x0]);}else{_0x4ee67f['checkIsBlackList'](_['pick'](_0x115423[0x0],['VoiceQueueId','Contact.phone']))[_0x0a9e('0xb9')](_0x4ee67f[_0x0a9e('0x1f1')](_0x44c694,_0x115423[0x0]))['catch'](_0x4ee67f[_0x0a9e('0xd4')]('[actionOriginatePredictive]\x20',_0x44c694));}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x210'),_0x44c694,0x1));emitVoiceQueueSummary(_0x44c694);};Dialer[_0x0a9e('0x1a')]['abandonmentRate']=function(_0x5976d2,_0x4165be,_0x14c011,_0xb68b,_0x42d9ca,_0x1a1cb2){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x211'));loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x212'),_0x5976d2);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x213'),_0x4165be);loggerPredictive['info'](_0x0a9e('0x214'),_0x14c011);loggerPredictive[_0x0a9e('0x82')]('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',_0xb68b);loggerPredictive['info'](_0x0a9e('0x215'),_0x42d9ca);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));return new Promise(function(_0x3366f2,_0x31981e){if(_0x5976d2<=0x0||isNaN(_0x5976d2)){return _0x31981e(msgResponse('[abandonmentRate]',_0x0a9e('0x49'),_0x0a9e('0x216')+_0x5976d2));}if(_0x14c011<=0x0||isNaN(_0x14c011)){return _0x31981e(msgResponse('[abandonmentRate]',_0x0a9e('0x49'),'Ts\x20=\x20'+_0x14c011));}if(_0xb68b<=0x0||isNaN(_0xb68b)){return _0x31981e(msgResponse('[abandonmentRate]','Error',_0x0a9e('0x217')+_0xb68b));}if(_0x4165be<=0x0||isNaN(_0x4165be)){return _0x31981e(msgResponse(_0x0a9e('0x218'),'Error','interval\x20=\x20'+_0x4165be));}if(_0x42d9ca<=0x0||isNaN(_0x42d9ca)){return _0x31981e(msgResponse(_0x0a9e('0x218'),_0x0a9e('0x49'),_0x0a9e('0x219')+_0x42d9ca));}_0x1a1cb2=_0x1a1cb2||0x0;var _0x1682dc=0x1/_0x14c011;var _0x5db09e=0x0;var _0xe9bc8e=0x0;var _0x3eac52=0x0;var _0x12d833=0x0;for(var _0x483d88=0x0;_0x3eac52<_0x42d9ca;_0x483d88+=0x1){_0xe9bc8e=_0x483d88/_0x4165be;_0x5db09e=(_0xb68b*_0xe9bc8e+_0x1a1cb2)/_0x1682dc;_0x3eac52=erlangb(_0x5db09e,_0x5976d2);_0x12d833=_0x5db09e/_0x5976d2*(0x1-erlangb(_0x5db09e,_0x5976d2));}return _0x3366f2({'erlangCalls':_0x483d88,'erlangCallToSecond':_0x4165be/_0x483d88,'erlangAbandonmentRate':_0x3eac52,'erlangBusyFactor':_0x12d833});});};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1e8')]=function(_0x400f7a,_0x3a1953,_0x2cdbbf,_0x5a240f,_0x5b862a,_0x171660){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x21a'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x400f7a);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a1953);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x214'),_0x2cdbbf);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x21b'),_0x5a240f);loggerPredictive[_0x0a9e('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b862a);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));return new Promise(function(_0x34f39f,_0x2e40a9){if(_0x400f7a<=0x0||isNaN(_0x400f7a)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error',_0x0a9e('0x216')+_0x400f7a));}if(_0x2cdbbf<=0x0||isNaN(_0x2cdbbf)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),_0x0a9e('0x49'),_0x0a9e('0x21d')+_0x2cdbbf));}if(_0x5a240f<=0x0||isNaN(_0x5a240f)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error',_0x0a9e('0x217')+_0x5a240f));}if(_0x3a1953<=0x0||isNaN(_0x3a1953)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error','interval\x20=\x20'+_0x3a1953));}if(_0x5b862a<=0x0||isNaN(_0x5b862a)){return _0x2e40a9(msgResponse('[busyFactor]',_0x0a9e('0x49'),_0x0a9e('0x21e')+_0x5b862a));}_0x171660=_0x171660||0x0;var _0x4dafc8=0x1/_0x2cdbbf;var _0x23fc30=0x0;var _0x5e2a11=0x0;var _0x58503f=0x0;var _0x4b1969=0x0;for(var _0x4e0508=0x0;_0x4b1969<_0x5b862a;_0x4e0508+=0x1){_0x5e2a11=_0x4e0508/_0x3a1953;_0x23fc30=(_0x5a240f*_0x5e2a11+_0x171660)/_0x4dafc8;_0x58503f=erlangb(_0x23fc30,_0x400f7a);_0x4b1969=_0x23fc30/_0x400f7a*(0x1-erlangb(_0x23fc30,_0x400f7a));}return _0x34f39f({'erlangCalls':_0x4e0508,'erlangCallToSecond':_0x3a1953/_0x4e0508,'erlangAbandonmentRate':_0x58503f,'erlangBusyFactor':_0x4b1969});});};module[_0x0a9e('0x21f')]=Dialer; \ No newline at end of file +var _0xa9e0=['reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countbusyretry','countnosuchnumberretry','countdropretry','stateGlobal','rescheduleContact','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','stateinterface','queueBooked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','inspect','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','push','command','iftime\x20%s,%s','timezones','indexOf','true','content','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','syncQueueSummary','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','syncCampaigns','checkIfTime','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','originate','voiceQueue\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','outbound','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','phone','variables','trim','substring','SIP/%s/%s%s','dialCutDigit','from-sip','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','[countReScheduled]\x20','emptyContact','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','RUNNING','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','p\x20=\x20','[abandonmentRate]','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]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','seconds','type','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','md5','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','catch','resolve','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','amdstatus','exten','dialAMDActive','value','HANGUP','uniqueid','statedesc','HangupInAMD','membername','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var ut=require('../preview/util/util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerBooked=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var loggerPredictive=require('../../../config/logger')(_0x0a9e('0x8'));var loggerPredictiveCalls=require(_0x0a9e('0x5'))(_0x0a9e('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x0a9e('0xa'));config['redis']=_['defaults'](config[_0x0a9e('0xb')],{'host':_0x0a9e('0xc'),'port':0x18eb});var io=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xb')]));var cmHopper=require(_0x0a9e('0xe'));var cmHopperHistory=require(_0x0a9e('0xf'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x0a9e('0x10'));var History=require(_0x0a9e('0x11'));var Final=require(_0x0a9e('0x12'));var AgentComplete=require(_0x0a9e('0x13'));var QueueCallerAbandon=require(_0x0a9e('0x14'));var Hangup=require(_0x0a9e('0x15'));var ipAgi=process['env'][_0x0a9e('0x16')]||_0x0a9e('0x17');var strategy={'rrmemory':_0x0a9e('0x18'),'roundrobin':_0x0a9e('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0a9e('0x1a')][_0x0a9e('0x1b')]=function(_0x52a03d){this[_0x0a9e('0x1c')]=this['tail']?this[_0x0a9e('0x1c')]['finally'](_0x52a03d):_0x52a03d();};function Dialer(_0x16033c,_0x12066b){this['sequence']=new Sequence();this[_0x0a9e('0x1d')]=_0x12066b;this['voiceQueues']=_0x16033c[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x16033c[_0x0a9e('0x1f')];this[_0x0a9e('0x20')]=_0x16033c[_0x0a9e('0x20')];this[_0x0a9e('0x21')]=_0x16033c[_0x0a9e('0x21')];this[_0x0a9e('0x22')]=config[_0x0a9e('0x22')]||0x2;this[_0x0a9e('0x23')]={};this[_0x0a9e('0x24')]={};this[_0x0a9e('0x25')]={};this['uniqueId']={};this[_0x0a9e('0x26')]={};this[_0x0a9e('0x27')]={};this['startProgressive']={};this[_0x0a9e('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x0a9e('0x29'),this[_0x0a9e('0x2a')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2c'),this['syncQueueCallerAbandon'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2d'),this[_0x0a9e('0x2e')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x2f'),this[_0x0a9e('0x30')][_0x0a9e('0x2b')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x31'),this[_0x0a9e('0x32')][_0x0a9e('0x2b')](this));ami['on']('hangup',this[_0x0a9e('0x33')]['bind'](this));ami['on'](_0x0a9e('0x34'),this['syncNewExten'][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x35'),this[_0x0a9e('0x36')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x37'),this[_0x0a9e('0x38')][_0x0a9e('0x2b')](this));ami['on'](_0x0a9e('0x39'),this['syncQueueStatusComplete'][_0x0a9e('0x2b')](this));this[_0x0a9e('0x3a')]();this[_0x0a9e('0x3b')]();RpcSetting[_0x0a9e('0x3c')]()['then'](function(_0x15b200){previewRecallmeReminderInterval=_0x15b200[_0x0a9e('0x3d')];});}function isNotNull(_0x1843b2){return _0x1843b2!==null&&!_[_0x0a9e('0x3e')](_0x1843b2);}function checkIsLoggedIn(_0x58b06f,_0x563b45){return function(){if(_0x563b45<=0x0){_0x58b06f[_0x0a9e('0x3f')]=_0x0a9e('0x40');throw _0x58b06f[_0x0a9e('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x426950){return _0x426950;}function checkIsActive(_0x5d1e0e,_0x2407f9){return function(){if(!isActive(_0x2407f9)){_0x5d1e0e[_0x0a9e('0x3f')]=_0x0a9e('0x42');throw _0x5d1e0e[_0x0a9e('0x41')]+_0x0a9e('0x43');}};}function checkInterval(_0x5180f1){return function(){if(!isNotNull(_0x5180f1[_0x0a9e('0x44')])){_0x5180f1[_0x0a9e('0x3f')]=_0x0a9e('0x45');throw _0x5180f1[_0x0a9e('0x41')]+_0x0a9e('0x46');}if(!isNotNull(_0x5180f1[_0x0a9e('0x44')][_0x0a9e('0x47')])){_0x5180f1[_0x0a9e('0x3f')]='INTERVAL_IS_NULL';throw _0x5180f1[_0x0a9e('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0a9e('0x48')](_0x5180f1[_0x0a9e('0x44')][_0x0a9e('0x47')]))){_0x5180f1[_0x0a9e('0x3f')]='INTERVAL_IS_NULL';throw _0x5180f1[_0x0a9e('0x41')]+_0x0a9e('0x46');}};}function msgResponse(_0x1fa90d,_0x15de0e,_0x4853b1){return{'action':_0x1fa90d,'response':_0x15de0e,'message':_0x4853b1,'stack':_0x4853b1};}function myreject(_0x54135e){return function(_0x1e8694){return _0x54135e(msgResponse('[ifTime][Action]',_0x0a9e('0x49'),JSON[_0x0a9e('0x4a')](_0x1e8694)));};}function getSeconds(_0x381c37,_0x1ef87a){var _0x4f41ae=moment(_0x381c37)[_0x0a9e('0x4b')](0x0);var _0x3bfce8=moment(_0x1ef87a)[_0x0a9e('0x4b')](0x0);return _0x4f41ae['diff'](_0x3bfce8,_0x0a9e('0x4c'));}function emit(_0x1a180b,_0x289467,_0x4c1c0e){io['to'](_0x1a180b)['emit'](_0x289467,_0x4c1c0e);}function emitVoiceQueueSummary(_0x11b61d){if(_0x11b61d[_0x0a9e('0x4d')]==='outbound'){var _0x2b814e={'id':_0x11b61d['id'],'name':_0x11b61d[_0x0a9e('0x41')],'strategy':_0x11b61d[_0x0a9e('0x4e')],'answered':_0x11b61d[_0x0a9e('0x4f')],'available':_0x11b61d['available'],'loggedIn':_0x11b61d['loggedIn'],'pTalking':_0x11b61d[_0x0a9e('0x50')],'sumBillable':_0x11b61d[_0x0a9e('0x51')],'sumDuration':_0x11b61d['sumDuration'],'sumHoldTime':_0x11b61d[_0x0a9e('0x52')]||0x0,'talking':_0x11b61d[_0x0a9e('0x53')],'total':_0x11b61d[_0x0a9e('0x54')],'type':_0x11b61d['type'],'unmanaged':_0x11b61d[_0x0a9e('0x55')],'abandoned':_0x11b61d[_0x0a9e('0x56')],'waiting':_0x11b61d[_0x0a9e('0x57')],'loggedInDb':_0x11b61d[_0x0a9e('0x58')],'dialActive':_0x11b61d[_0x0a9e('0x59')],'dialMethod':_0x11b61d[_0x0a9e('0x5a')],'dialOriginateCallerIdName':_0x11b61d[_0x0a9e('0x5b')],'dialOriginateCallerIdNumber':_0x11b61d[_0x0a9e('0x5c')],'dialOriginateTimeout':_0x11b61d[_0x0a9e('0x5d')],'dialPrefix':_0x11b61d[_0x0a9e('0x5e')],'outboundAnswerAgiCallsDay':_0x11b61d[_0x0a9e('0x5f')],'outboundAnswerCallsDay':_0x11b61d[_0x0a9e('0x60')],'outboundBlacklistCallsDay':_0x11b61d[_0x0a9e('0x61')],'outboundBusyCallsDay':_0x11b61d[_0x0a9e('0x62')],'outboundCongestionCallsDay':_0x11b61d[_0x0a9e('0x63')],'outboundDropCallsDayACS':_0x11b61d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x11b61d['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x11b61d[_0x0a9e('0x64')],'outboundNoAnswerCallsDay':_0x11b61d[_0x0a9e('0x65')],'outboundNoSuchCallsDay':_0x11b61d[_0x0a9e('0x66')],'outboundOriginateFailureCallsDay':_0x11b61d[_0x0a9e('0x67')],'outboundReCallsDay':_0x11b61d[_0x0a9e('0x68')],'outboundRejectCallsDay':_0x11b61d[_0x0a9e('0x69')],'outboundUnknownCallsDay':_0x11b61d[_0x0a9e('0x6a')],'predictiveIntervalAnsweredCalls':_0x11b61d[_0x0a9e('0x6b')],'predictiveIntervalAvgHoldtime':_0x11b61d[_0x0a9e('0x6c')],'predictiveIntervalAvgTalktime':_0x11b61d[_0x0a9e('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x11b61d[_0x0a9e('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x11b61d[_0x0a9e('0x6f')],'predictiveIntervalErlangCalls':_0x11b61d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x11b61d[_0x0a9e('0x70')],'predictiveIntervalHitRate':_0x11b61d[_0x0a9e('0x71')],'predictiveIntervalMultiplicativeFactor':_0x11b61d[_0x0a9e('0x72')],'predictiveIntervalPauses':_0x11b61d[_0x0a9e('0x73')],'predictiveIntervalAvailable':_0x11b61d[_0x0a9e('0x74')],'predictiveIntervalTotalCalls':_0x11b61d[_0x0a9e('0x75')],'message':_0x11b61d[_0x0a9e('0x3f')],'originated':_0x11b61d[_0x0a9e('0x76')],'erlangCalls':_0x11b61d['erlangCalls'],'erlangCallToSecond':_0x11b61d[_0x0a9e('0x77')],'erlangAbandonmentRate':_0x11b61d['erlangAbandonmentRate'],'erlangBusyFactor':_0x11b61d[_0x0a9e('0x78')],'startPredictive':_0x11b61d[_0x0a9e('0x27')],'startProgressive':_0x11b61d[_0x0a9e('0x79')]};if(_0x11b61d['Trunk']){_0x2b814e[_0x0a9e('0x7a')]={'id':_0x11b61d[_0x0a9e('0x7a')]['id'],'name':_0x11b61d[_0x0a9e('0x7a')][_0x0a9e('0x41')],'active':_0x11b61d[_0x0a9e('0x7a')][_0x0a9e('0x7b')],'callerid':_0x11b61d[_0x0a9e('0x7a')]['callerid']};}if(_0x11b61d[_0x0a9e('0x44')]){_0x2b814e[_0x0a9e('0x44')]={'id':_0x11b61d[_0x0a9e('0x44')]['id'],'name':_0x11b61d[_0x0a9e('0x44')][_0x0a9e('0x41')]};}var _0x992c77=md5(JSON[_0x0a9e('0x4a')](_0x2b814e));if(_0x11b61d[_0x0a9e('0x7c')]!==_0x992c77){_0x11b61d[_0x0a9e('0x7c')]=_0x992c77;emit(util['format'](_0x0a9e('0x7d'),_0x2b814e[_0x0a9e('0x41')]),'voice_queue:save',_0x2b814e);}}}function emitCampaignSummary(_0x4ae14b){if(_0x4ae14b['type']===_0x0a9e('0x7e')){emit(util[_0x0a9e('0x7f')](_0x0a9e('0x80'),_0x4ae14b[_0x0a9e('0x41')]),_0x0a9e('0x81'),_0x4ae14b);}}function checkGetDataPredictive(_0x30decb){if(isNotNull(_0x30decb)&&!_[_0x0a9e('0x48')](_0x30decb)){loggerPredictive[_0x0a9e('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x30decb[_0x0a9e('0x75')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x83'),_0x30decb['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x84'),_0x30decb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x0a9e('0x85'),_0x30decb['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x0a9e('0x82')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x30decb[_0x0a9e('0x6c')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x86'),_0x30decb['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));if(_0x30decb['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x30decb[_0x0a9e('0x6d')])&&_0x30decb[_0x0a9e('0x6d')]>0x0){return!![];}loggerPredictive['info'](_0x0a9e('0x88'));if(!_['isUndefined'](_0x30decb[_0x0a9e('0x6c')])&&_0x30decb['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0a9e('0x82')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x0a9e('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2f7092){return function(_0x65432){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x89'));loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8a'),_0x65432[_0x0a9e('0x8b')]);loggerPredictive[_0x0a9e('0x82')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x65432[_0x0a9e('0x77')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8c'),_0x65432[_0x0a9e('0x8d')]);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8e'),_0x65432['erlangBusyFactor']);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x8c'),_0x65432['erlangAbandonmentRate']);loggerPredictive[_0x0a9e('0x82')]('---------------------------');_[_0x0a9e('0x8f')](_0x2f7092,_0x65432);};}function getDiff(_0x5ba1f9){var _0x4b3c1a=moment()['milliseconds'](0x0);var _0x273cb5=moment(_0x5ba1f9)['milliseconds'](0x0);return _0x4b3c1a[_0x0a9e('0x90')](_0x273cb5,_0x0a9e('0x4c'));}function ifInterval(_0x261adb,_0x7be420){if(_[_0x0a9e('0x3e')](_0x7be420)){return![];}return getDiff(_0x7be420)<_0x261adb*0x3c;}function freeVariablesPredictive(_0x26d7db){if(isNotNull(_0x26d7db)){if(!_['isUndefined'](_0x26d7db[_0x0a9e('0x79')])){_0x26d7db['startProgressive']=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],_0x0a9e('0x91'));}if(!_['isUndefined'](_0x26d7db[_0x0a9e('0x27')])){_0x26d7db[_0x0a9e('0x27')]=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0a9e('0x3e')](_0x26d7db[_0x0a9e('0x92')])){clearInterval(_0x26d7db['handlePredictive']);_0x26d7db[_0x0a9e('0x92')]=undefined;loggerPredictive[_0x0a9e('0x82')](_0x26d7db[_0x0a9e('0x41')],_0x0a9e('0x93'));}}}function erlangb(_0x401837,_0x4d4a35){if(_0x4d4a35===0x0){return 0x0;}var _0x176840=0x1;for(var _0x2937e0=0x1;_0x2937e0<=_0x4d4a35;_0x2937e0+=0x1){_0x176840=0x1+_0x176840*_0x2937e0/_0x401837;}return 0x1/_0x176840;}function isVoiceQueueOutbound(_0x281c7d){return _0x281c7d==='outbound';}function isNotPreview(_0x3528b7){return _0x3528b7!=='preview';}function isCampaignIvr(_0x5211e3){return _0x5211e3===_0x0a9e('0x7e');}function getCallerId(_0x4556c5,_0x9375fb,_0x19c995){if(!_[_0x0a9e('0x3e')](_0x19c995)&&typeof _0x19c995===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x19c995)){if(!_[_0x0a9e('0x3e')](_0x9375fb)&&typeof _0x9375fb===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x9375fb)){return util[_0x0a9e('0x7f')](_0x0a9e('0x95'),_0x9375fb,_0x19c995);}return util[_0x0a9e('0x7f')](_0x0a9e('0x95'),_0x19c995,_0x19c995);}if(!_[_0x0a9e('0x3e')](_0x4556c5)&&typeof _0x4556c5===_0x0a9e('0x94')&&!_[_0x0a9e('0x48')](_0x4556c5)){return _0x4556c5;}return _0x0a9e('0x96');}function loggerCatchQueueSummary(_0x5150a4,_0x1b0b98){return function(_0x295763){freeVariablesPredictive(_0x1b0b98);emitVoiceQueueSummary(_0x1b0b98);emitCampaignSummary(_0x1b0b98);loggerSyncQueueSummary[_0x0a9e('0x97')](_0x5150a4,util['inspect'](_0x295763,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1148a1,_0x30944e){return function(_0x4b341d){loggerPredictive[_0x0a9e('0x98')](_0x30944e[_0x0a9e('0x41')],_0x1148a1);loggerPredictive[_0x0a9e('0x98')](_0x4b341d[_0x0a9e('0x99')]);freeVariablesPredictive(_0x30944e);};}function loggerCatch(_0x13b5c0){return function(_0x4a43a8){logger['error'](_0x13b5c0,util['inspect'](_0x4a43a8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x40fb85){return _0x40fb85&&!_[_0x0a9e('0x3e')](_0x40fb85)&&_0x40fb85[_0x0a9e('0x9a')]>0x0;}function decremetOriginate(_0x23a7d3){if(!_[_0x0a9e('0x3e')](_0x23a7d3)&&_0x23a7d3!==null){if(typeof _0x23a7d3[_0x0a9e('0x76')]!==_0x0a9e('0x9b')){if(_0x23a7d3[_0x0a9e('0x76')]>0x0){_0x23a7d3['originated']-=0x1;}else{logger[_0x0a9e('0x98')](_0x0a9e('0x9c'));}}}else{logger[_0x0a9e('0x98')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2bdc44,_0x583b2e,_0x4437ff){if(_0x583b2e>_0x4437ff){for(var _0x44351d=0x0;_0x44351d<_0x583b2e-_0x4437ff;_0x44351d+=0x1){decremetOriginate(_0x2bdc44);}}}function loggerGetContactDialer(_0x4c46c1,_0x2ed01e,_0x75912a){return function(_0x2cc7a7){checkContactLowerLimitOriginate(_0x2ed01e,_0x75912a,0x0);logger[_0x0a9e('0x98')](_0x4c46c1,util['inspect'](_0x2cc7a7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d442c){return function(_0x2e9552){if(isNotNull(_0x2e9552)&&isNotNull(_0x2e9552[0x0])){if(_0x2e9552[0x0][_0x0a9e('0x9d')]>0x0){_0x1d442c[_0x0a9e('0x3f')]='RESCHEDULED_CONTACTS';logger[_0x0a9e('0x82')](_0x0a9e('0x9e')+_0x1d442c[_0x0a9e('0x41')],_0x2e9552[0x0][_0x0a9e('0x9d')],'contacts');}else{_0x1d442c[_0x0a9e('0x3f')]=_0x0a9e('0x9f');logger[_0x0a9e('0x82')](_0x0a9e('0xa0')+_0x1d442c[_0x0a9e('0x41')]);}}};}function notSendMessagesQueue(_0xdb98ca){if(_0xdb98ca[_0x0a9e('0xa1')]){freeVariablesPredictive(_0xdb98ca);if(_0xdb98ca[_0x0a9e('0x76')]===0x0&&_0xdb98ca[_0x0a9e('0x53')]===0x0&&_0xdb98ca[_0x0a9e('0x57')]===0x0&&(_0xdb98ca[_0x0a9e('0x50')]||0x0)===0x0){_0xdb98ca[_0x0a9e('0xa1')]=![];_0xdb98ca[_0x0a9e('0xa2')]=0x0;_0xdb98ca[_0x0a9e('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa3'),_0xdb98ca[_0x0a9e('0x41')],'is\x20not\x20active');}else{_0xdb98ca[_0x0a9e('0x3f')]=_0x0a9e('0xa4');loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa3'),_0xdb98ca['name'],'is\x20disactive');}emitVoiceQueueSummary(_0xdb98ca);}}function notSendMessagesCampaign(_0x7ebea8){if(_0x7ebea8[_0x0a9e('0xa1')]){if(_0x7ebea8['originated']===0x0){_0x7ebea8[_0x0a9e('0xa1')]=![];_0x7ebea8['message']=_0x0a9e('0x42');loggerSyncQueueSummary[_0x0a9e('0x97')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x7ebea8[_0x0a9e('0x41')],_0x0a9e('0xa5'));}else{_0x7ebea8[_0x0a9e('0x3f')]=_0x0a9e('0xa4');loggerSyncQueueSummary[_0x0a9e('0x97')](_0x0a9e('0xa6'),_0x7ebea8[_0x0a9e('0x41')],'is\x20disactive');}emitCampaignSummary(_0x7ebea8);}}function createObjHistory(_0x2973d3,_0x3ca9b9,_0x45c109,_0x16e5b9,_0x492543){_0x2973d3[_0x0a9e('0x3f')]=_0x45c109;var _0xf0db1=new Action(_0x2973d3,_0x3ca9b9);var _0x4bf3a5=new History(_0xf0db1);_0x4bf3a5[_0x0a9e('0xa7')]=_0x16e5b9;_0x4bf3a5['statedesc']=_0x492543;_0x4bf3a5[_0x0a9e('0xa8')]=_0xf0db1[_0x0a9e('0xa9')];return _0x4bf3a5;}Dialer[_0x0a9e('0x1a')][_0x0a9e('0x3b')]=function(){var _0x5af453=this;setInterval(function(){_0x5af453['clearZombieChannels'](_0x5af453[_0x0a9e('0xaa')],_0x0a9e('0xab'));_0x5af453[_0x0a9e('0xac')](_0x5af453['actions'],_0x0a9e('0xad'));},0x32c8);};Dialer[_0x0a9e('0x1a')]['clearZombieChannels']=function(_0x4e46b2,_0xf0a802){var _0x56acca=this;for(var _0x5ea541 in _0x4e46b2){if(typeof _0x4e46b2[_0x5ea541]!=='undefined'){this[_0x0a9e('0xae')][_0x0a9e('0x1b')](function(){if(!_[_0x0a9e('0xaf')](_0x4e46b2[_0x5ea541])){return ami[_0x0a9e('0xb0')]({'action':_0x0a9e('0xb1'),'channel':_0x4e46b2[_0x5ea541][_0x0a9e('0xb2')]})['catch'](function(_0x5fd5db){if(_0x5fd5db['message']===_0x0a9e('0xb3')){setTimeout(function(){if(_0x4e46b2[_0x5ea541]&&_0x4e46b2[_0x5ea541][_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){_0x56acca[_0x0a9e('0xb4')](_0x56acca['voiceQueues'][_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]]);logger[_0x0a9e('0x98')](_0x0a9e('0xb6'),_0xf0a802,_0x5ea541,_0x4e46b2[_0x5ea541]['queue']);delete _0x4e46b2[_0x5ea541];}if(_0x4e46b2[_0x5ea541]&&_0x4e46b2[_0x5ea541][_0x0a9e('0x4d')]===_0x0a9e('0x7e')){_0x56acca[_0x0a9e('0xb4')](_0x56acca[_0x0a9e('0x1f')][_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]]);logger[_0x0a9e('0x98')](_0x0a9e('0xb7'),_0xf0a802,_0x5ea541,_0x4e46b2[_0x5ea541][_0x0a9e('0xb5')]);delete _0x4e46b2[_0x5ea541];}},0x2328);}});}});}}};Dialer['prototype'][_0x0a9e('0xb8')]=function(_0x3325c5){return Promise['resolve']()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xb8')](_0x3325c5))[_0x0a9e('0xba')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x0a9e('0x1a')]['checkIsBlackList']=function(_0x8c8fbe){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperBlack[_0x0a9e('0xbc')](_0x8c8fbe))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xbd')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xbe')]=function(_0x501050,_0x329d88,_0x31d25a){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperAdditionalPhone[_0x0a9e('0xbe')](_0x501050,_0x329d88,_0x31d25a))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xbf')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc0')]=function(_0x31af8c,_0x151956,_0x3754e2){return Promise[_0x0a9e('0xbb')]()['then'](cmHopperAdditionalPhone[_0x0a9e('0xc0')](_0x31af8c,_0x151956,_0x3754e2))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xc1')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc2')]=function(_0x5d9ddb){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperBlack['checkIsBlackListIvr'](_0x5d9ddb))[_0x0a9e('0xba')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc3')]=function(_0x1d93b1){return Promise[_0x0a9e('0xbb')]()['then'](cmHopperHistory[_0x0a9e('0xc4')](_0x1d93b1))['catch'](loggerCatch(_0x0a9e('0xc5')));};Dialer[_0x0a9e('0x1a')]['rescheduleContact']=function(_0x231c6a){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper['rescheduleContact'](_0x231c6a))['catch'](loggerCatch(_0x0a9e('0xc6')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xc7')]=function(_0x413190,_0x3f2f40,_0x2450a8){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xc7')](_0x413190,_0x3f2f40,_0x2450a8))['catch'](loggerCatch(_0x0a9e('0xc8')));};Dialer['prototype'][_0x0a9e('0xc9')]=function(_0x2f7791,_0x34e745,_0x28ce92,_0x1b61d5,_0x4e7273){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0xc9')](_0x2f7791,_0x34e745,_0x28ce92,_0x1b61d5))[_0x0a9e('0xba')](function(_0x2263f1){_0x4e7273['temp']-=_0x28ce92;_0x4e7273['temp']=_0x4e7273[_0x0a9e('0xca')]>0x0?_0x4e7273['temp']:0x0;loggerCatch(_0x0a9e('0xcb'))(_0x2263f1);});};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xcc')]=function(_0x16313e,_0x2ad54b,_0x213e5d,_0x596312){return Promise['resolve']()[_0x0a9e('0xb9')](cmHopper['getContactDialerIvr'](_0x16313e,_0x2ad54b,_0x213e5d))[_0x0a9e('0xba')](function(_0x5c689c){_0x596312[_0x0a9e('0xca')]-=_0x2ad54b;_0x596312['temp']=_0x596312['temp']>0x0?_0x596312[_0x0a9e('0xca')]:0x0;loggerCatch(_0x0a9e('0xcd'))(_0x5c689c);});};Dialer['prototype'][_0x0a9e('0xce')]=function(_0x17cb30){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](voiceQueueRt[_0x0a9e('0xce')](_0x17cb30))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xcf')]=function(_0x41c8cd){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper['moveContactManagedDialer'](_0x41c8cd))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xd0')));};Dialer['prototype'][_0x0a9e('0xd1')]=function(_0x19fd11){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopperHistory[_0x0a9e('0xd1')](_0x19fd11))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xd2')));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xb4')]=function(_0x16afb3){if(!_['isUndefined'](_0x16afb3)&&_0x16afb3!==null){if(typeof _0x16afb3[_0x0a9e('0x76')]!==_0x0a9e('0x9b')){if(_0x16afb3[_0x0a9e('0x76')]>0x0){_0x16afb3[_0x0a9e('0x76')]-=0x1;}else{logger[_0x0a9e('0x98')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x0a9e('0xd3'));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xd4')]=function(_0x2fea95,_0x34f7b5){var _0x59e46f=this;return function(_0x1339d0){_0x59e46f[_0x0a9e('0xb4')](_0x34f7b5);logger[_0x0a9e('0x98')](_0x2fea95,util['inspect'](_0x1339d0,{'showHidden':![],'depth':null}));};};Dialer[_0x0a9e('0x1a')]['emptyContact']=function(_0x2144ca,_0x4799d4,_0x25b745){var _0x42b833={'state':0x19,'statedesc':_0x0a9e('0xd5')};this['updateOriginated'](_0x4799d4);this[_0x0a9e('0xd6')](_['merge'](_0x42b833,_[_0x0a9e('0xd7')](_0x25b745,[_0x0a9e('0xd8'),_0x0a9e('0xd9'),_0x0a9e('0xda'),_0x0a9e('0xdb'),_0x0a9e('0xdc')])),_0x0a9e('0xdd'),_0x0a9e('0xde'));logger[_0x0a9e('0x98')](_0x2144ca);};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xdf')]=function(_0xc876d4){return _0xc876d4===_0x0a9e('0xe0');};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xe1')]=function(_0x248368){return!_['isUndefined'](_0x248368)&&_0x248368&&!_['isUndefined'](_0x248368[_0x0a9e('0x41')])&&!_['isUndefined'](_0x248368[_0x0a9e('0x7b')])&&_0x248368[_0x0a9e('0x7b')]&&(this['trunks'][util[_0x0a9e('0x7f')](_0x0a9e('0xe2'),_0x248368[_0x0a9e('0x41')])][_0x0a9e('0xb1')]==='reachable'||this[_0x0a9e('0x21')][util[_0x0a9e('0x7f')](_0x0a9e('0xe2'),_0x248368[_0x0a9e('0x41')])]['status']===_0x0a9e('0xe3'));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xd6')]=function(_0x5c838b,_0x2650eb,_0x270df8){this[_0x0a9e('0xd1')](_0x5c838b)['catch'](loggerCatch(_0x2650eb));this[_0x0a9e('0xcf')](_0x5c838b)[_0x0a9e('0xba')](loggerCatch(_0x270df8));};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x36')]=function(_0x2394d3){var _0x555780=this;var _0x3211d2=this[_0x0a9e('0xaa')][_0x2394d3['uniqueid']];var _0x3bab3e;if(!_[_0x0a9e('0xaf')](_0x2394d3)&&!_[_0x0a9e('0xaf')](_0x2394d3['variable'])&&!_['isNil'](_0x2394d3['variable'][_0x0a9e('0xe4')])&&_0x2394d3[_0x0a9e('0xe5')]==='xcally-motion-dialer'&&_0x3211d2){if(_0x3211d2[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&this[_0x0a9e('0x1e')][_0x3211d2['queue']][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xe8')){delete this[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x3211d2['queue']][_0x0a9e('0x60')]+=0x1;this['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;_0x3bab3e=new Hangup(_0x3211d2,_0x2394d3);_0x3bab3e[_0x0a9e('0xa7')]=0x12;_0x3bab3e[_0x0a9e('0xea')]=_0x0a9e('0xeb');_0x3bab3e[_0x0a9e('0xec')]='AMD';ami[_0x0a9e('0xed')](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x3bab3e,_0x0a9e('0xf0')));this['saveInDb'](_0x3bab3e,_0x0a9e('0xf1'),_0x0a9e('0xf2'));}if(_0x3211d2[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&this[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xf3')){return new Promise(function(_0x3539b7,_0x57f0ad){delete _0x555780[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];_0x555780[_0x0a9e('0xb4')](_0x555780[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]]);_0x555780[_0x0a9e('0x1e')][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x60')]+=0x1;_0x555780['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;var _0x1a9ef1=_0x555780['voiceQueues'][_0x3211d2[_0x0a9e('0xb5')]];var _0x41e446=new Hangup(_0x3211d2,_0x2394d3);_0x41e446[_0x0a9e('0xa7')]=0x13;_0x41e446[_0x0a9e('0xea')]=_0x0a9e('0xf4');_0x41e446[_0x0a9e('0xec')]=_0x0a9e('0xf5');_0x41e446[_0x0a9e('0xf6')]+=0x1;_0x41e446[_0x0a9e('0xf7')]+=0x1;_0x41e446[_0x0a9e('0xf0')]=!![];ami['emit'](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x41e446,_0x0a9e('0xf0')));_0x555780[_0x0a9e('0xd1')](_0x41e446)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0x41e446['countbusyretry']+_0x41e446[_0x0a9e('0xf9')]+_0x41e446['countnoanswerretry']+_0x41e446['countnosuchnumberretry']+_0x41e446['countdropretry']+_0x41e446[_0x0a9e('0xfa')]+_0x41e446[_0x0a9e('0xf6')]+_0x41e446[_0x0a9e('0xfb')]>=_0x1a9ef1[_0x0a9e('0xfc')]){_0x555780['stateGlobal'](_0x41e446,_0x3539b7,_0x57f0ad,_0x0a9e('0xfd'));}else{if(_0x41e446[_0x0a9e('0xf6')]>=_0x1a9ef1[_0x0a9e('0xfe')]){_0x555780[_0x0a9e('0xff')](_0x41e446,_0x3539b7,_0x57f0ad,_0x0a9e('0x100'));}else{_0x555780['rescheduleContact']({'active':![],'countmachineretry':_0x41e446['countmachineretry'],'scheduledat':moment()[_0x0a9e('0x101')](_0x1a9ef1[_0x0a9e('0x102')],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x41e446[_0x0a9e('0xd8')],'ListId':_0x41e446[_0x0a9e('0xd9')],'VoiceQueueId':_0x41e446['VoiceQueueId']||undefined,'CampaignId':_0x41e446[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));_0x3539b7({'reschedule':0x1});}}});}if(_0x3211d2['type']===_0x0a9e('0x7e')&&this[_0x0a9e('0x1f')][_0x3211d2[_0x0a9e('0xb5')]]['dialAMDActive']&&_0x2394d3['value']==='HANGUP'){delete this[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1f')][_0x3211d2['queue']]);_0x3bab3e=new Hangup(_0x3211d2,_0x2394d3);_0x3bab3e[_0x0a9e('0xa7')]=0x12;_0x3bab3e['statedesc']=_0x0a9e('0xeb');_0x3bab3e[_0x0a9e('0xec')]=_0x0a9e('0xf5');ami['emit'](_0x0a9e('0xee'),ut[_0x0a9e('0xef')](_0x3bab3e,_0x0a9e('0xf0')));this['saveInDb'](_0x3bab3e,_0x0a9e('0x106'),'[syncHangupInAMDIvr]');}if(_0x3211d2[_0x0a9e('0x4d')]==='ivr'&&this[_0x0a9e('0x1f')][_0x3211d2['queue']][_0x0a9e('0xe6')]&&_0x2394d3[_0x0a9e('0xe7')]===_0x0a9e('0xf3')){return new Promise(function(_0x10ace8,_0x1e306c){delete _0x555780[_0x0a9e('0xaa')][_0x2394d3[_0x0a9e('0xe9')]];_0x555780['updateOriginated'](_0x555780[_0x0a9e('0x1f')][_0x3211d2[_0x0a9e('0xb5')]]);_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x60')]+=0x1;_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;var _0x16b578=_0x555780['campaigns'][_0x3211d2[_0x0a9e('0xb5')]];var _0xf49ed4=new Hangup(_0x3211d2,_0x2394d3);_0xf49ed4[_0x0a9e('0xa7')]=0x13;_0xf49ed4[_0x0a9e('0xea')]=_0x0a9e('0xf4');_0xf49ed4[_0x0a9e('0xec')]=_0x0a9e('0xf5');_0xf49ed4[_0x0a9e('0xf6')]+=0x1;_0xf49ed4[_0x0a9e('0xf7')]+=0x1;_0xf49ed4[_0x0a9e('0xf0')]=!![];ami['emit'](_0x0a9e('0xee'),ut['buildObj'](_0xf49ed4,_0x0a9e('0xf0')));_0x555780[_0x0a9e('0xd1')](_0xf49ed4)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0xf49ed4[_0x0a9e('0x107')]+_0xf49ed4[_0x0a9e('0xf9')]+_0xf49ed4['countnoanswerretry']+_0xf49ed4[_0x0a9e('0x108')]+_0xf49ed4[_0x0a9e('0x109')]+_0xf49ed4[_0x0a9e('0xfa')]+_0xf49ed4['countmachineretry']+_0xf49ed4[_0x0a9e('0xfb')]>=_0x16b578[_0x0a9e('0xfc')]){_0x555780[_0x0a9e('0x10a')](_0xf49ed4,_0x10ace8,_0x1e306c,_0x0a9e('0xfd'));}else{if(_0xf49ed4[_0x0a9e('0xf6')]>=_0x16b578[_0x0a9e('0xfe')]){_0x555780[_0x0a9e('0xff')](_0xf49ed4,_0x10ace8,_0x1e306c,'reason\x2019\x20machine....');}else{_0x555780[_0x0a9e('0x10b')]({'active':![],'countmachineretry':_0xf49ed4[_0x0a9e('0xf6')],'scheduledat':moment()[_0x0a9e('0x101')](_0x16b578[_0x0a9e('0x102')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0xf49ed4['ContactId'],'ListId':_0xf49ed4['ListId'],'VoiceQueueId':_0xf49ed4[_0x0a9e('0xdb')]||undefined,'CampaignId':_0xf49ed4[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));_0x10ace8({'reschedule':0x1});}}});}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x33')]=function(_0x609711){var _0x584854=this[_0x0a9e('0xaa')][_0x609711[_0x0a9e('0xe9')]];var _0x2d8e91;if(_0x584854&&_0x584854[_0x0a9e('0x4d')]===_0x0a9e('0x7e')){delete this[_0x0a9e('0xaa')][_0x609711[_0x0a9e('0xe9')]];this['updateOriginated'](this[_0x0a9e('0x1f')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1f')][_0x584854['queue']][_0x0a9e('0x10c')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);this[_0x0a9e('0xd1')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10d')));this['moveContactManagedDialer'](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10e')));}if(_0x584854&&_0x584854[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&isNotNull(this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x10f')])){delete this[_0x0a9e('0xaa')][_0x609711['uniqueid']];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x584854['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x5f')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);_0x2d8e91['state']=0x10;_0x2d8e91[_0x0a9e('0xea')]=_0x0a9e('0x110');_0x2d8e91['membername']=_0x0a9e('0x111');this['createHistory'](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x2d8e91)['catch'](loggerCatch(_0x0a9e('0x10e')));}if(_0x584854&&_0x584854[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')&&!isNotNull(this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x10f')])){delete this['uniqueId'][_0x609711[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]]);this[_0x0a9e('0x1e')][_0x584854[_0x0a9e('0xb5')]][_0x0a9e('0x6a')]+=0x1;_0x2d8e91=new Hangup(_0x584854,_0x609711);_0x2d8e91['state']=0xc;_0x2d8e91['statedesc']=_0x609711[_0x0a9e('0x112')];_0x2d8e91['membername']=_0x0a9e('0x113');this[_0x0a9e('0xd1')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x10d')));this[_0x0a9e('0xcf')](_0x2d8e91)[_0x0a9e('0xba')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x0a9e('0x1a')]['syncAgentComplete']=function(_0x50e32a){var _0x504403=this['uniqueId'][_0x50e32a[_0x0a9e('0xe9')]];if(this['voiceQueues'][_0x50e32a['queue']]){if(_0x504403&&_0x504403[_0x0a9e('0x4d')]!=='ivr'){delete this[_0x0a9e('0xaa')][_0x50e32a[_0x0a9e('0xe9')]];this[_0x0a9e('0x1e')][_0x50e32a['queue']][_0x0a9e('0x60')]+=0x1;var _0x1209c4=new AgentComplete(_0x504403,_0x50e32a);if(_0x50e32a[_0x0a9e('0x114')]==='agent'){_0x1209c4['agiafterat']=this[_0x0a9e('0x1e')][_0x50e32a[_0x0a9e('0xb5')]][_0x0a9e('0x115')]&&this[_0x0a9e('0x1e')][_0x50e32a[_0x0a9e('0xb5')]][_0x0a9e('0x116')]?moment()[_0x0a9e('0x7f')](_0x0a9e('0x104')):undefined;}this[_0x0a9e('0xd1')](_0x1209c4)[_0x0a9e('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x1209c4)['catch'](loggerCatch(_0x0a9e('0x117')));}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x2a')]=function(_0x2d21c7){if(this[_0x0a9e('0x1e')][_0x2d21c7[_0x0a9e('0xb5')]]){if(this[_0x0a9e('0xaa')][_0x2d21c7[_0x0a9e('0xe9')]]&&this['uniqueId'][_0x2d21c7['uniqueid']][_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){this['updateOriginated'](this[_0x0a9e('0x1e')][_0x2d21c7[_0x0a9e('0xb5')]]);this[_0x0a9e('0xaa')][_0x2d21c7[_0x0a9e('0xe9')]][_0x0a9e('0x118')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));}}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x119')]=function(_0x400800,_0xbd1af3){this[_0x0a9e('0xd1')](_0x400800)['catch'](loggerCatch(_0x0a9e('0x11a')));if(_0xbd1af3==0x0){this[_0x0a9e('0xcf')](_0x400800)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x11b')));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x11c')]=function(_0x292e67){var _0x23bec3=this[_0x0a9e('0xaa')][_0x292e67[_0x0a9e('0xe9')]];var _0x6b048e=this;var _0x3ba472=![];var _0x4e6eb9;var _0x572a72;if(this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]]){if(_0x23bec3&&_0x23bec3[_0x0a9e('0x4d')]!==_0x0a9e('0x7e')){delete this[_0x0a9e('0xaa')][_0x292e67[_0x0a9e('0xe9')]];this[_0x0a9e('0xb4')](this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]]);_0x23bec3['droptime']=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));var _0x1e9f9f=new QueueCallerAbandon(_0x23bec3,_0x292e67);if(getSeconds(_0x23bec3[_0x0a9e('0x11d')],_0x23bec3[_0x0a9e('0x11e')])>=_0x23bec3[_0x0a9e('0x11f')]){this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x6f')]+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x64')]+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x70')]+=0x1;_0x1e9f9f[_0x0a9e('0xa7')]=0xa;_0x1e9f9f['statedesc']='Drop';_0x1e9f9f[_0x0a9e('0x120')]=_0x0a9e('0x121');_0x1e9f9f['agiafterat']=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x115')]?moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1e9f9f[_0x0a9e('0x109')]+=0x1;_0x1e9f9f['countglobal']+=0x1;_0x4e6eb9=this[_0x0a9e('0x1e')][_0x292e67['queue']][_0x0a9e('0x122')];_0x572a72=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x123')];_0x6b048e[_0x0a9e('0xbe')](_0x1e9f9f,_0x1e9f9f['state'],_0x23bec3[_0x0a9e('0x124')])['then'](function(_0x505ffd){_0x3ba472=_0x505ffd[_0x0a9e('0x125')]==0x1;if(_0x1e9f9f[_0x0a9e('0x109')]>=_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x126')]){_0x6b048e[_0x0a9e('0x119')](_0x1e9f9f,_0x505ffd[_0x0a9e('0x125')]);}else{_0x6b048e[_0x0a9e('0x10b')]({'active':![],'countdropretry':_0x1e9f9f[_0x0a9e('0x109')],'scheduledat':moment()[_0x0a9e('0x101')](_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x122')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x23bec3[_0x0a9e('0xd8')],'ListId':_0x23bec3[_0x0a9e('0xd9')],'VoiceQueueId':_0x23bec3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x23bec3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x127')));var _0x543b30=new History(_0x1e9f9f);_0x543b30[_0x0a9e('0xa7')]=0xa;_0x543b30['statedesc']='Drop';_0x543b30['starttime']=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x543b30[_0x0a9e('0xa8')]=_0x543b30[_0x0a9e('0xa9')];_0x543b30[_0x0a9e('0x128')]=_0x1e9f9f[_0x0a9e('0x128')];_0x543b30[_0x0a9e('0x129')]=_0x1e9f9f[_0x0a9e('0x129')];_0x6b048e[_0x0a9e('0xd1')](_0x543b30)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x12a')));}})[_0x0a9e('0xb9')](function(){if(_0x3ba472)_0x6b048e['swapAdditionalPhones'](_0x1e9f9f,_0x4e6eb9,_0x572a72)[_0x0a9e('0xb9')](function(){return 0x1;});});}else{this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x12b')]+=0x1;_0x1e9f9f['state']=0xb;_0x1e9f9f[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x1e9f9f['dropreason']='CALLEREXIT';_0x1e9f9f[_0x0a9e('0xfa')]+=0x1;_0x1e9f9f[_0x0a9e('0xf7')]+=0x1;_0x4e6eb9=this[_0x0a9e('0x1e')][_0x292e67['queue']]['dialAbandonedRetryFrequency'];_0x572a72=this['voiceQueues'][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x123')];_0x6b048e[_0x0a9e('0xbe')](_0x1e9f9f,_0x1e9f9f[_0x0a9e('0xa7')],_0x23bec3[_0x0a9e('0x124')])[_0x0a9e('0xb9')](function(_0x183b9b){if(_0x1e9f9f[_0x0a9e('0xfa')]>=_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]][_0x0a9e('0x12d')]){_0x6b048e[_0x0a9e('0x119')](_0x1e9f9f,_0x183b9b[_0x0a9e('0x125')]);}else{_0x6b048e[_0x0a9e('0x10b')]({'active':![],'countabandonedretry':_0x1e9f9f[_0x0a9e('0xfa')],'scheduledat':moment()[_0x0a9e('0x101')](_0x6b048e[_0x0a9e('0x1e')][_0x292e67[_0x0a9e('0xb5')]]['dialAbandonedRetryFrequency'],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x23bec3[_0x0a9e('0xd8')],'ListId':_0x23bec3[_0x0a9e('0xd9')],'VoiceQueueId':_0x23bec3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x23bec3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x12e')));var _0x3a14d7=new History(_0x1e9f9f);_0x3a14d7[_0x0a9e('0xa7')]=0xb;_0x3a14d7[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x3a14d7[_0x0a9e('0xa9')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));_0x3a14d7['endtime']=_0x3a14d7['starttime'];_0x3a14d7[_0x0a9e('0x128')]=_0x1e9f9f[_0x0a9e('0x128')];_0x3a14d7['calleridnum']=_0x1e9f9f[_0x0a9e('0x129')];_0x6b048e[_0x0a9e('0xd1')](_0x3a14d7)['catch'](loggerCatch(_0x0a9e('0x12f')));}})['then'](function(){if(_0x3ba472)_0x6b048e[_0x0a9e('0xc0')](_0x1e9f9f,_0x4e6eb9,_0x572a72)[_0x0a9e('0xb9')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x0a9e('0x130')]=function(_0x31ab12){if(this['actions'][_0x31ab12[_0x0a9e('0xe9')]]){this[_0x0a9e('0x24')][_0x31ab12['uniqueid']][_0x0a9e('0xb2')]=_0x31ab12[_0x0a9e('0xb2')];}if(this[_0x0a9e('0xaa')][_0x31ab12[_0x0a9e('0xe9')]]){this[_0x0a9e('0xaa')][_0x31ab12[_0x0a9e('0xe9')]]['channel']=_0x31ab12[_0x0a9e('0xb2')];}};Dialer[_0x0a9e('0x1a')]['syncQueueMember']=function(_0x3d63aa){if(strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]===_0x0a9e('0x19')){if(this['actions'][_0x3d63aa['actionid']]&&_['isNil'](this['actions'][_0x3d63aa['actionid']][_0x0a9e('0x132')])&&_0x3d63aa[_0x0a9e('0xb1')]==='1'&&_0x3d63aa['paused']==='0'){if(this['agents'][_0x3d63aa[_0x0a9e('0x133')]]){if(!this['agents'][_0x3d63aa[_0x0a9e('0x133')]][_0x0a9e('0x132')]){this[_0x0a9e('0x20')][_0x3d63aa[_0x0a9e('0x133')]][_0x0a9e('0x132')]=!![];this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0x132')]=!![];this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0x133')]=_0x3d63aa[_0x0a9e('0x133')];}}}}else if((strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]||'rrmemory')===_0x0a9e('0x18')){if(this['actions'][_0x3d63aa[_0x0a9e('0x131')]]){if(this[_0x0a9e('0x20')][_0x3d63aa['stateinterface']]){this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]]['stateinterface']=_0x3d63aa[_0x0a9e('0x133')];if(_['isNil'](this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x3d63aa['actionid']][_0x0a9e('0xb5')]])){this['queueBooked'][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]=[];}this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]['push'](_[_0x0a9e('0x8f')](_[_0x0a9e('0xd7')](this[_0x0a9e('0x24')][_0x3d63aa[_0x0a9e('0x131')]],[_0x0a9e('0x135'),'stateinterface']),{'status':_0x3d63aa[_0x0a9e('0xb1')],'paused':_0x3d63aa['paused']}));}}}};function unlockQueueStatus(_0x5d1159,_0x3a459c){setTimeout(function(){if(_['isUndefined'](_0x5d1159[_0x0a9e('0x136')])){loggerBooked[_0x0a9e('0x98')]('[unlockQueueStatus][undefined]',_0x3a459c);}_0x5d1159[_0x0a9e('0x136')]=!![];loggerBooked[_0x0a9e('0x82')](_0x0a9e('0x137'),_0x3a459c,JSON[_0x0a9e('0x4a')](_[_0x0a9e('0xd7')](_0x5d1159,[_0x0a9e('0x41'),_0x0a9e('0x136')])));},0x1f3);}Dialer[_0x0a9e('0x1a')][_0x0a9e('0x138')]=function(_0x5871d7){var _0x26f1c6=this;var _0x421b6c=_0x26f1c6[_0x0a9e('0x1e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]];if(strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]][_0x0a9e('0x4e')]]===_0x0a9e('0x19')){if(this['actions'][_0x5871d7[_0x0a9e('0x131')]]&&this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')]){this[_0x0a9e('0x1d')][_0x0a9e('0x139')](this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x135')],this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')])[_0x0a9e('0xba')](function(_0x14444e){logger[_0x0a9e('0x98')](_0x0a9e('0x13a'),util[_0x0a9e('0x13b')](_0x14444e,{'showHidden':![],'depth':null}));})[_0x0a9e('0x13c')](function(){_0x26f1c6[_0x0a9e('0xb4')](_0x26f1c6[_0x0a9e('0x1e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]);_0x26f1c6[_0x0a9e('0x20')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0x133')]][_0x0a9e('0x132')]=![];delete _0x26f1c6[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]];unlockQueueStatus(_0x421b6c);});}else{this[_0x0a9e('0xb4')](this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]);this[_0x0a9e('0x10b')]({'active':![],'ContactId':this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xd8')],'ListId':this['actions'][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xd9')],'VoiceQueueId':this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xdb')]||undefined,'CampaignId':this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x13d')));delete this[_0x0a9e('0x24')][_0x5871d7['actionid']];unlockQueueStatus(_0x421b6c);}}else if((strategy[this[_0x0a9e('0x1e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]]['queue']][_0x0a9e('0x4e')]]||_0x0a9e('0x18'))===_0x0a9e('0x18')){var _0x1bf053;if(this['actions'][_0x5871d7[_0x0a9e('0x131')]]&&!_[_0x0a9e('0x48')](this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]]['queue']])){if(this[_0x0a9e('0x13e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]){this[_0x0a9e('0x13e')][_0x26f1c6[_0x0a9e('0x24')][_0x5871d7['actionid']]['queue']]=this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]?this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]:this['queueBooked'][this['actions'][_0x5871d7[_0x0a9e('0x131')]]['queue']]?this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]]['_rr']||0x0:0x0;}this[_0x0a9e('0x134')][this[_0x0a9e('0x24')][_0x5871d7['actionid']][_0x0a9e('0xb5')]]['_rr']=this[_0x0a9e('0x13e')][this[_0x0a9e('0x24')][_0x5871d7[_0x0a9e('0x131')]][_0x0a9e('0xb5')]];for(var _0x223e19=0x0;_0x223e19=0x0;})[_0x0a9e('0xba')](myreject(_0x1e30bc)));}}else{_0x1ebf20[_0x0a9e('0x150')](ami[_0x0a9e('0xb0')]({'action':'command','command':util[_0x0a9e('0x7f')](_0x0a9e('0x152'),_0x4ad6fc,!_[_0x0a9e('0x3e')](config['timezones'][_0xaa43da])?_0xaa43da:'')})[_0x0a9e('0xb9')](function(_0x4f8949){return _0x4f8949[_0x0a9e('0x156')][_0x0a9e('0x154')](_0x0a9e('0x155'))>=0x0;})['catch'](myreject(_0x1e30bc)));}Promise[_0x0a9e('0x157')](_0x1ebf20)[_0x0a9e('0xb9')](function(_0x310f89){var _0x1ecb3b=_[_0x0a9e('0x158')](_0x310f89);if(_0x1ecb3b){return _0xcdd954(_0x1ecb3b);}else{_0x2bc6a3[_0x0a9e('0x3f')]=_0x5174c5?'GLOBAL_INTERVAL_IS_OVERTIME':_0x0a9e('0x159');return _0x1e30bc(msgResponse(_0x0a9e('0x15a'),_0x0a9e('0x14c'),_0x0a9e('0x15b')+_0x5174c5+'\x20'+_0x2ee2fc+_0x0a9e('0x15c')+util[_0x0a9e('0x13b')](_0x4ad6fc,{'showHidden':![],'depth':null})+_0x0a9e('0x15d')+_0xaa43da));}})[_0x0a9e('0xba')](function(_0x597e99){return _0x1e30bc(msgResponse(_0x0a9e('0x14a'),_0x0a9e('0x14c'),JSON[_0x0a9e('0x4a')](_0x597e99)));});});};Dialer[_0x0a9e('0x1a')]['checkDialMethod']=function(_0x388b9c){var _0x57c3c4=this;return function(){switch(_0x388b9c[_0x0a9e('0x5a')]){case _0x0a9e('0x15e'):freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,0x1);break;case'power':freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,_0x388b9c[_0x0a9e('0x160')]);break;case _0x0a9e('0x8'):_0x57c3c4[_0x0a9e('0x8')](_0x388b9c);break;case'booked':freeVariablesPredictive(_0x388b9c);_0x57c3c4[_0x0a9e('0x15f')](_0x388b9c,0x1);break;default:freeVariablesPredictive(_0x388b9c);logger[_0x0a9e('0x98')](_0x0a9e('0x161'),_0x388b9c[_0x0a9e('0x41')],_0x0a9e('0x162'));}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x163')]=function(_0x5af336){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0x164')](_0x5af336['id'],previewRecallmeReminderInterval))[_0x0a9e('0xb9')](function(_0x52cdf4){for(var _0x1b6dde=0x0;_0x1b6dde<_0x52cdf4['length'];_0x1b6dde++){var _0x2b8f51=_0x52cdf4[_0x1b6dde][_0x0a9e('0x165')][_0x0a9e('0x41')];if(_0x2b8f51)io['to'](util[_0x0a9e('0x7f')](_0x0a9e('0x166'),_0x2b8f51))[_0x0a9e('0xed')](_0x0a9e('0x167'),{'hopper':_0x52cdf4[_0x1b6dde]});}})['catch'](function(){});};Dialer[_0x0a9e('0x1a')]['launchHandleIvr']=function(_0x382412){var _0x1612d8=this;return function(){_0x1612d8['handleIvr'](_0x382412);};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x168')]=function(_0x46f728){var _0x3b2dd9=this;if(isNotPreview(_0x46f728['dialMethod'])){if(isVoiceQueueOutbound(_0x46f728[_0x0a9e('0x4d')])&&isActive(_0x46f728[_0x0a9e('0x59')])){_0x46f728['sendMessageOneNotActive']=!![];Promise[_0x0a9e('0xbb')]()['then'](checkIsLoggedIn(_0x46f728,_0x46f728['loggedIn']))['then'](checkIsActive(_0x46f728,_0x46f728[_0x0a9e('0x59')]))[_0x0a9e('0xb9')](checkInterval(_0x46f728))['then'](_0x3b2dd9[_0x0a9e('0x147')](_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9['checkIfTime'](_0x46f728[_0x0a9e('0x169')],_0x46f728[_0x0a9e('0x16a')],_0x46f728[_0x0a9e('0x41')],_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9[_0x0a9e('0x14b')](_0x46f728[_0x0a9e('0x44')],_0x46f728[_0x0a9e('0x16a')],_0x46f728['name'],_0x46f728))[_0x0a9e('0xb9')](_0x3b2dd9['checkDialMethod'](_0x46f728))[_0x0a9e('0xba')](loggerCatchQueueSummary(_0x0a9e('0x16b'),_0x46f728));}else{notSendMessagesQueue(_0x46f728);}}else{freeVariablesPredictive(_0x46f728);}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x32')]=_[_0x0a9e('0x16c')](function(){var _0x184453=_['filter'](this[_0x0a9e('0x1e')],function(_0x2af0c6){return _0x2af0c6[_0x0a9e('0x16d')];});var _0x53e92b=_[_0x0a9e('0x16e')](this[_0x0a9e('0x20')],function(_0xd886e5){return _0xd886e5[_0x0a9e('0x16f')]&&_0xd886e5[_0x0a9e('0xb1')]===_0x0a9e('0x170');});if(_0x184453[_0x0a9e('0x9a')]>0x0&&_0x53e92b[_0x0a9e('0x9a')]>0x0){return Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](cmHopper[_0x0a9e('0x164')](_[_0x0a9e('0x171')](_0x184453,'id'),previewRecallmeReminderInterval,_[_0x0a9e('0x171')](_0x53e92b,'id')))[_0x0a9e('0xb9')](function(_0x3e31dc){for(var _0x2efc65=0x0;_0x2efc65<_0x3e31dc['length'];_0x2efc65++){var _0x20ebd0=_0x3e31dc[_0x2efc65][_0x0a9e('0x165')][_0x0a9e('0x41')];if(_0x20ebd0)io['to'](util['format'](_0x0a9e('0x166'),_0x20ebd0))[_0x0a9e('0xed')](_0x0a9e('0x167'),{'hopper':_0x3e31dc[_0x2efc65]});}})[_0x0a9e('0xba')](function(_0x56f175){logger[_0x0a9e('0x98')](_0x0a9e('0x163'),_0x56f175);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x0a9e('0x1a')][_0x0a9e('0x172')]=function(){var _0x4e8eb9=this;var _0x2b263b;for(var _0x1634cc in this[_0x0a9e('0x1f')]){if(typeof this[_0x0a9e('0x1f')][_0x1634cc]!=='undefined'){_0x2b263b=this['campaigns'][_0x1634cc];if(isCampaignIvr(_0x2b263b[_0x0a9e('0x4d')])&&isActive(_0x2b263b[_0x0a9e('0x7b')])){_0x2b263b[_0x0a9e('0xa1')]=!![];Promise[_0x0a9e('0xbb')]()[_0x0a9e('0xb9')](checkIsActive(_0x2b263b,_0x2b263b[_0x0a9e('0x7b')]))[_0x0a9e('0xb9')](checkInterval(_0x2b263b))[_0x0a9e('0xb9')](_0x4e8eb9[_0x0a9e('0x147')](_0x2b263b))[_0x0a9e('0xb9')](_0x4e8eb9[_0x0a9e('0x173')](_0x2b263b[_0x0a9e('0x169')],_0x2b263b[_0x0a9e('0x16a')],_0x2b263b[_0x0a9e('0x41')],_0x2b263b))['then'](_0x4e8eb9[_0x0a9e('0x14b')](_0x2b263b[_0x0a9e('0x44')],_0x2b263b[_0x0a9e('0x16a')],_0x2b263b['name'],_0x2b263b))['then'](_0x4e8eb9[_0x0a9e('0x174')](_0x2b263b))['catch'](loggerCatchQueueSummary(_0x0a9e('0x175'),_0x2b263b));}else{notSendMessagesCampaign(_0x2b263b);}}}};function getCallerIdRandom(_0xe81ac2,_0x2e3df6){var _0x12a7e;var _0x56caca;var _0x59ce14;if(_0x2e3df6<=0x0){_0x2e3df6=0x1;}_0x12a7e=new RegExp(_0x0a9e('0x176')+_0x2e3df6+'}$');_0x56caca=Math[_0x0a9e('0x177')](0xa,_0x2e3df6-0x1);_0x59ce14=Math[_0x0a9e('0x177')](0xa,_0x2e3df6)-0x1;return util[_0x0a9e('0x7f')]('%s',_['replace'](_0xe81ac2,_0x12a7e,_[_0x0a9e('0x178')](_0x56caca,_0x59ce14)));}function extractCalleridName(_0xc1811b){var _0xa64f55=_0xc1811b[_0x0a9e('0x179')](/"(.*?)"/);return _0xa64f55?_0xa64f55[0x1]:_0xc1811b;}Dialer[_0x0a9e('0x1a')]['actionOriginate']=function(_0x5cfe15,_0x35b0e6){var _0x3cfcc3=this;var _0x45aa98=uuid['v4']();this[_0x0a9e('0x24')][_0x45aa98]=new Action(_0x5cfe15,_0x35b0e6,_0x45aa98);return new Promise(function(_0x126620,_0x25f447){if(_[_0x0a9e('0x3e')](_0x5cfe15)&&typeof _0x5cfe15!=='object'){return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x14c'),_0x0a9e('0x17b')));}if(_['isUndefined'](_0x35b0e6['phone'])||_0x35b0e6['phone']===null){return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x14c'),'contact\x20is\x20undefine'));}var _0x419d9e={'XMD-CALLERID':_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x17c')](),'XMD-AGI':_0x5cfe15['dialQueueProject']?util['format'](_0x0a9e('0x17d'),ipAgi,_0x5cfe15[_0x0a9e('0x10f')]):_0x0a9e('0x17e'),'XMD-AGIAFTER':_0x5cfe15[_0x0a9e('0x115')]?util['format'](_0x0a9e('0x17d'),ipAgi,_0x5cfe15['dialQueueProject2']):'NONE','XMD-QUEUE':_0x5cfe15[_0x0a9e('0x4d')]==='outbound'?util[_0x0a9e('0x7f')](_0x0a9e('0x17f'),_0x5cfe15[_0x0a9e('0x41')],_0x5cfe15['dialQueueOptions']||'',_0x5cfe15[_0x0a9e('0x116')]?'c':'',_0x5cfe15[_0x0a9e('0x11f')]||0x3):_0x0a9e('0x17e'),'XMD-CONTACTID':_0x35b0e6['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x17c')](),'XMD-AMD':_0x5cfe15[_0x0a9e('0xe6')]?_0x0a9e('0x180'):_0x0a9e('0x17e'),'XMD-DESTINATION':_0x0a9e('0x181')};if(_0x5cfe15['dialAMDActive']){_0x419d9e['XMD-AMDINITIALSILENCE']=_0x5cfe15[_0x0a9e('0x182')]||0x9c4;_0x419d9e[_0x0a9e('0x183')]=_0x5cfe15['dialAMDGreeting']||0x5dc;_0x419d9e['XMD-AMDAFTERGREETINGSILENCE']=_0x5cfe15['dialAMDAfterGreetingSilence']||0x320;_0x419d9e['XMD-AMDTOTALANALYSISTIME']=_0x5cfe15['dialAMDTotalAnalysisTime']||0x1388;_0x419d9e['XMD-AMDMINWORDLENGTH']=_0x5cfe15[_0x0a9e('0x184')]||0x64;_0x419d9e['XMD-AMDBETWEENWORDSSILENCE']=_0x5cfe15[_0x0a9e('0x185')]||0x32;_0x419d9e[_0x0a9e('0x186')]=_0x5cfe15[_0x0a9e('0x187')]||0x3;_0x419d9e[_0x0a9e('0x188')]=_0x5cfe15[_0x0a9e('0x189')]||0x100;_0x419d9e[_0x0a9e('0x18a')]=_0x5cfe15[_0x0a9e('0x18b')]||0x1388;}if(_0x5cfe15['type']===_0x0a9e('0x18c')){_0x419d9e[_0x0a9e('0x18d')]=_0x35b0e6[_0x0a9e('0xdb')];}else{_0x419d9e[_0x0a9e('0x18e')]=_0x35b0e6[_0x0a9e('0xdc')];}for(var _0x3d2589 in _0x35b0e6[_0x0a9e('0x18f')]){if(typeof _0x35b0e6[_0x0a9e('0x18f')][_0x3d2589]!==_0x0a9e('0x9b')){if(isNotNull(_0x35b0e6[_0x0a9e('0x18f')][_0x3d2589])&&_0x3d2589!=='id'&&_0x3d2589!==_0x0a9e('0x190')&&_0x3d2589!=='createdAt'&&_0x3d2589!==_0x0a9e('0x191')){_0x419d9e[util[_0x0a9e('0x7f')]('%s%s',_0x0a9e('0x192'),_['toUpper'](_0x3d2589))]=_0x35b0e6[_0x0a9e('0x18f')][_0x3d2589];}}}var _0x34b3d8=_0x3cfcc3['isTrunkReachable'](_0x5cfe15['Trunk'])?getCallerId(_0x5cfe15[_0x0a9e('0x7a')]['callerid'],_0x5cfe15[_0x0a9e('0x5b')],_0x5cfe15[_0x0a9e('0x193')]>0x0?getCallerIdRandom(_0x5cfe15[_0x0a9e('0x5c')],_0x5cfe15[_0x0a9e('0x193')]):_0x5cfe15[_0x0a9e('0x5c')]):getCallerId(_['isNil'](_0x5cfe15[_0x0a9e('0x194')])?_0x5cfe15['Trunk']['callerid']:_0x5cfe15[_0x0a9e('0x194')][_0x0a9e('0x195')],_0x5cfe15[_0x0a9e('0x5b')],_0x5cfe15[_0x0a9e('0x193')]>0x0?getCallerIdRandom(_0x5cfe15[_0x0a9e('0x5c')],_0x5cfe15['dialRandomLastDigitCallerIdNumber']):_0x5cfe15[_0x0a9e('0x5c')]);if(_0x34b3d8){_0x419d9e[_0x0a9e('0x196')]=_0x3cfcc3[_0x0a9e('0x24')][_0x45aa98][_0x0a9e('0x197')]=extractCalleridName(_0x34b3d8);_0x419d9e['XMD-ORIGINATECALLERIDNUM']=_0x35b0e6[_0x0a9e('0x198')];}_0x5cfe15[_0x0a9e('0x199')]=_0x419d9e;return ami['Action']({'actionid':_0x45aa98,'action':_0x0a9e('0x17a'),'channel':_0x3cfcc3[_0x0a9e('0xe1')](_0x5cfe15[_0x0a9e('0x7a')])?util[_0x0a9e('0x7f')]('SIP/%s/%s%s',_0x5cfe15[_0x0a9e('0x7a')][_0x0a9e('0x41')],isNotNull(_0x5cfe15[_0x0a9e('0x5e')])?_0x5cfe15[_0x0a9e('0x5e')][_0x0a9e('0x19a')]()||'':'',_0x5cfe15['dialCutDigit']>0x0?_0x35b0e6[_0x0a9e('0x198')][_0x0a9e('0x19b')](_0x5cfe15['dialCutDigit']):_0x35b0e6[_0x0a9e('0x198')]):util['format'](_0x0a9e('0x19c'),_[_0x0a9e('0xaf')](_0x5cfe15[_0x0a9e('0x194')])?_0x5cfe15[_0x0a9e('0x7a')][_0x0a9e('0x41')]:_0x5cfe15[_0x0a9e('0x194')][_0x0a9e('0x41')],isNotNull(_0x5cfe15[_0x0a9e('0x5e')])?_0x5cfe15[_0x0a9e('0x5e')][_0x0a9e('0x19a')]()||'':'',_0x5cfe15[_0x0a9e('0x19d')]>0x0?_0x35b0e6[_0x0a9e('0x198')][_0x0a9e('0x19b')](_0x5cfe15[_0x0a9e('0x19d')]):_0x35b0e6[_0x0a9e('0x198')]),'callerid':_0x34b3d8,'Exten':'xcally-motion-dialer','Context':_0x0a9e('0x19e'),'Priority':'1','variable':_0x419d9e,'timeout':(_0x5cfe15[_0x0a9e('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45aa98})[_0x0a9e('0xb9')](function(_0xf35801){return _0x126620(_0xf35801);})[_0x0a9e('0xba')](function(_0x3d7d73){_0x5cfe15[_0x0a9e('0x67')]+=0x1;var _0x1fbf62=new History(_0x3cfcc3['actions'][_0x45aa98]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x0a9e('0x4a')](_0x3d7d73)));_0x1fbf62['state']=0xe;_0x1fbf62['statedesc']='OriginateError';_0x1fbf62[_0x0a9e('0xa9')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));_0x1fbf62[_0x0a9e('0xa8')]=_0x1fbf62['starttime'];_0x3cfcc3['createHistory'](_0x1fbf62)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x19f')));_0x3cfcc3[_0x0a9e('0xcf')](_0x1fbf62)[_0x0a9e('0xba')](loggerCatch('[originate][error]'))[_0x0a9e('0x13c')](function(){delete _0x3cfcc3[_0x0a9e('0x24')][_0x45aa98];return _0x25f447(msgResponse(_0x0a9e('0x17a'),_0x0a9e('0x49'),_0x0a9e('0x1a0')));});});});};Dialer[_0x0a9e('0x1a')]['syncOriginateResponse']=function(_0x298a78){var _0x5056d5=this['actions'][_0x298a78[_0x0a9e('0x131')]];if(_0x5056d5){delete this['actions'][_0x298a78[_0x0a9e('0x131')]];_0x5056d5[_0x0a9e('0x11e')]=moment()[_0x0a9e('0x7f')](_0x0a9e('0x104'));var _0xe87eb3=_0x5056d5[_0x0a9e('0x4d')]===_0x0a9e('0x7e')?this[_0x0a9e('0x1f')][_0x5056d5[_0x0a9e('0xb5')]]:this['voiceQueues'][_0x5056d5[_0x0a9e('0x1a1')]()];if(!this[_0x0a9e('0xdf')](_0x298a78['response'])){this[_0x0a9e('0xb4')](_0xe87eb3);return this[_0x0a9e('0x1a2')](_0x5056d5,_0xe87eb3,_0x298a78)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1a3')));}this['uniqueId'][_0x298a78[_0x0a9e('0xe9')]]=_0x5056d5;}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1a4')]=function(_0x44b14c,_0x1aa179,_0x5840d5){var _0x4c08b3=new History(_0x1aa179);if(_0x4c08b3[_0x0a9e('0x107')]+_0x4c08b3['countcongestionretry']+_0x4c08b3[_0x0a9e('0x1a5')]+_0x4c08b3['countnosuchnumberretry']+_0x4c08b3[_0x0a9e('0x109')]+_0x4c08b3['countabandonedretry']+_0x4c08b3[_0x0a9e('0xf6')]+_0x4c08b3['countagentrejectretry']>=_0x5840d5[_0x0a9e('0xfc')]-0x1){return!![];}switch(_0x44b14c){case 0x3:if(_0x4c08b3[_0x0a9e('0x1a5')]>=_0x5840d5[_0x0a9e('0x1a6')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4c08b3['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5['dialNoAnswerRetryFrequency'],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1a7')));break;case 0x5:if(_0x4c08b3[_0x0a9e('0x107')]>=_0x5840d5[_0x0a9e('0x1a8')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countbusyretry':_0x4c08b3[_0x0a9e('0x107')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1a9')],_0x0a9e('0x103'))['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x4c08b3[_0x0a9e('0xf9')]>=_0x5840d5['dialCongestionMaxRetry']-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countcongestionretry':_0x4c08b3['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1aa')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3['CampaignId']||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1ab')));break;case 0x0:if(_0x4c08b3['countnosuchnumberretry']>=_0x5840d5[_0x0a9e('0x1ac')]-0x1){return!![];}else{this[_0x0a9e('0x10b')]({'active':![],'countnosuchnumberretry':_0x4c08b3[_0x0a9e('0x108')]+=0x1,'scheduledat':moment()['add'](_0x5840d5['dialNoSuchNumberRetryFrequency'],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1ad')));}break;case 0xa:if(_0x4c08b3['countdropretry']>=_0x5840d5[_0x0a9e('0x126')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x4c08b3['countdropretry']+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x122')],'minutes')['format'](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3['VoiceQueueId']||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x127')));break;case 0xb:if(_0x4c08b3['countabandonedretry']>=_0x5840d5['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countabandonedretry':_0x4c08b3[_0x0a9e('0xfa')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1ae')],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3['ContactId'],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x12e')));break;case 0x13:if(_0x4c08b3[_0x0a9e('0xf6')]>=_0x5840d5[_0x0a9e('0xfe')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countmachineretry':_0x4c08b3[_0x0a9e('0xf6')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x102')],_0x0a9e('0x103'))[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3[_0x0a9e('0xd9')],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x105')));break;case 0x14:if(_0x4c08b3[_0x0a9e('0xfb')]>=_0x5840d5[_0x0a9e('0x1af')]-0x1){return!![];}this[_0x0a9e('0x10b')]({'active':![],'countagentrejectretry':_0x4c08b3[_0x0a9e('0xfb')]+=0x1,'scheduledat':moment()[_0x0a9e('0x101')](_0x5840d5[_0x0a9e('0x1b0')],'minutes')[_0x0a9e('0x7f')](_0x0a9e('0x104')),'ContactId':_0x4c08b3[_0x0a9e('0xd8')],'ListId':_0x4c08b3['ListId'],'VoiceQueueId':_0x4c08b3[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c08b3[_0x0a9e('0xdc')]||undefined})[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1b1')));break;default:return!![];}};Dialer['prototype'][_0x0a9e('0x1a2')]=function(_0x174487,_0x5cacc0,_0x15f892){var _0x22b47b=this;var _0x57d648=new History(_0x174487);var _0x4b24bd=![];var _0x5a7379;var _0x34f612;return new Promise(function(_0x2d6673,_0x25bc80){if(_['isUndefined'](_0x5cacc0)&&typeof _0x5cacc0!=='object'){return _0x25bc80(msgResponse(_0x0a9e('0x1b2'),_0x0a9e('0x14c'),_0x0a9e('0x1b3')));}if(_[_0x0a9e('0x3e')](_0x15f892)&&typeof _0x15f892!=='object'){return _0x25bc80(msgResponse(_0x0a9e('0x1b2'),'Failure','evt\x20is\x20undefine'));}_0x22b47b[_0x0a9e('0xbe')](_0x57d648,_0x15f892[_0x0a9e('0x114')],_0x5cacc0)[_0x0a9e('0xb9')](function(_0x5763cb){if(_0x5763cb[_0x0a9e('0x125')]==0x1)_0x4b24bd=!![];switch(_0x15f892[_0x0a9e('0x114')]){case'0':_0x5cacc0[_0x0a9e('0x66')]+=0x1;_0x57d648['state']=0x0;_0x57d648['statedesc']=_0x0a9e('0x1b4');_0x57d648[_0x0a9e('0x108')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x0a9e('0xef')](_0x174487,'nosuchnumber'));_0x5a7379=_0x5cacc0['dialNoSuchNumberRetryFrequency'];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0xf8')));if(_0x22b47b['checkRetriveMax'](0x0,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x108')]>=_0x5cacc0[_0x0a9e('0x1ac')]){_0x22b47b['createStateFinal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1b5'));}else{_0x22b47b['stateGlobal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1b5'));}}break;case'3':_0x5cacc0[_0x0a9e('0x65')]+=0x1;_0x57d648['state']=0x3;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1b6');_0x57d648[_0x0a9e('0x1a5')]+=0x1;_0x57d648['countglobal']+=0x1;var _0x10f9fe=ut[_0x0a9e('0x1b7')](_0x174487,_0x5cacc0);ami[_0x0a9e('0xed')]('custom:agentnoanswer',_0x10f9fe);_0x5a7379=_0x5cacc0[_0x0a9e('0x1b8')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x1b9')));if(_0x22b47b[_0x0a9e('0x1a4')](0x3,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x1a5')]>=_0x5cacc0[_0x0a9e('0x1a6')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1ba'));}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1ba'));}}break;case'5':_0x5cacc0['outboundBusyCallsDay']+=0x1;_0x57d648[_0x0a9e('0xa7')]=0x5;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1bb');_0x57d648[_0x0a9e('0x107')]+=0x1;_0x57d648['countglobal']+=0x1;ami[_0x0a9e('0xed')](_0x0a9e('0x1bc'),ut['buildObj'](_0x174487,_0x0a9e('0x1bd')));_0x5a7379=_0x5cacc0[_0x0a9e('0x1a9')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1be')));if(_0x22b47b[_0x0a9e('0x1a4')](0x5,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x107')]>=_0x5cacc0['dialBusyMaxRetry']){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,'reason\x205\x20busy');}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1bf'));}}break;case'8':_0x5cacc0['outboundCongestionCallsDay']+=0x1;_0x57d648[_0x0a9e('0xa7')]=0x8;_0x57d648[_0x0a9e('0xea')]='Congestion';_0x57d648[_0x0a9e('0xf9')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;_0x5a7379=_0x5cacc0['dialCongestionRetryFrequency'];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x174487,_0x0a9e('0x1c0')));_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x1c1')));if(_0x22b47b[_0x0a9e('0x1a4')](0x8,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648['countcongestionretry']>=_0x5cacc0[_0x0a9e('0x1c2')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,'reason\x208\x20congestion');}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c3'));}}break;case'11':_0x5cacc0[_0x0a9e('0x1c4')]+=0x1;_0x57d648['state']=0xb;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x12c');_0x57d648[_0x0a9e('0xfa')]+=0x1;_0x57d648[_0x0a9e('0xf7')]+=0x1;_0x5a7379=_0x5cacc0[_0x0a9e('0x1ae')];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)['catch'](loggerCatch(_0x0a9e('0x12f')));if(_0x22b47b[_0x0a9e('0x1a4')](0xb,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0xfa')]>=_0x5cacc0[_0x0a9e('0x12d')]){_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c5'));}else{_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c5'));}}break;case'20':_0x5cacc0[_0x0a9e('0x69')]+=0x1;_0x57d648['state']=0x14;_0x57d648[_0x0a9e('0xea')]=_0x0a9e('0x1c6');_0x57d648[_0x0a9e('0xfb')]+=0x1;_0x57d648['countglobal']+=0x1;_0x5a7379=_0x5cacc0['dialAgentRejectRetryFrequency'];_0x34f612=_0x5cacc0['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentreject',ut[_0x0a9e('0xef')](_0x174487,'agentreject'));_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1c7')));if(_0x22b47b[_0x0a9e('0x1a4')](0x14,_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0xfb')]>=_0x5cacc0[_0x0a9e('0x1af')]){_0x22b47b['createStateFinal'](_0x57d648,_0x2d6673,_0x25bc80,_0x0a9e('0x1c8'));}else{_0x22b47b['stateGlobal'](_0x57d648,_0x2d6673,_0x25bc80,'reason\x2020\x20agentreject');}}break;default:_0x5cacc0[_0x0a9e('0x6a')]+=0x1;_0x57d648['state']=0xc;_0x57d648[_0x0a9e('0xea')]=_0x15f892['reason'];_0x5a7379=_0x5cacc0[_0x0a9e('0x1b0')];_0x34f612=_0x5cacc0[_0x0a9e('0x123')];_0x22b47b[_0x0a9e('0xd1')](_0x57d648)[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x1c9')));if(_0x22b47b['checkRetriveMax'](_0x15f892[_0x0a9e('0x114')],_0x174487,_0x5cacc0)&&!_0x4b24bd){if(_0x57d648[_0x0a9e('0x107')]+_0x57d648['countcongestionretry']+_0x57d648[_0x0a9e('0x1a5')]+_0x57d648[_0x0a9e('0x108')]+_0x57d648['countdropretry']+_0x57d648[_0x0a9e('0xfa')]+_0x57d648[_0x0a9e('0xf6')]+_0x57d648[_0x0a9e('0xfb')]>=_0x5cacc0[_0x0a9e('0xfc')]){_0x22b47b[_0x0a9e('0x10a')](_0x57d648,_0x2d6673,_0x25bc80,_0x15f892[_0x0a9e('0x114')]);}else{_0x22b47b[_0x0a9e('0xff')](_0x57d648,_0x2d6673,_0x25bc80,_0x15f892['reason']);}}}})[_0x0a9e('0xb9')](function(){if(_0x4b24bd){_0x22b47b[_0x0a9e('0xc0')](_0x57d648,_0x5a7379,_0x34f612)[_0x0a9e('0xb9')](function(){return _0x2d6673(0x1);});}});});};Dialer[_0x0a9e('0x1a')]['stateGlobal']=function(_0x19e176,_0x300474,_0x189e15,_0x12bc40){var _0x32c53e=new Final(_0x19e176);_0x32c53e[_0x0a9e('0xa7')]=0xf;_0x32c53e[_0x0a9e('0xea')]=_0x0a9e('0x1ca');this['createStateFinal'](_0x32c53e,_0x300474,_0x189e15,_0x12bc40);};Dialer[_0x0a9e('0x1a')][_0x0a9e('0xff')]=function(_0x315236,_0x4a80a0,_0x3da853,_0x101e33){this[_0x0a9e('0xcf')](_0x315236)[_0x0a9e('0xb9')](function(){return _0x4a80a0(msgResponse(_0x0a9e('0x1b2'),_0x0a9e('0xe0'),_0x101e33));})[_0x0a9e('0xba')](function(){return _0x3da853(msgResponse(_0x0a9e('0x1cb'),_0x0a9e('0x14c'),_0x0a9e('0x1cc')));});};Dialer['prototype'][_0x0a9e('0x8')]=function(_0x3a87e7){var _0x21f245=_0x3a87e7['dialPredictiveOptimizationPercentage']/0x64;var _0x4d473a=_0x3a87e7[_0x0a9e('0x64')]/(_0x3a87e7[_0x0a9e('0x64')]+_0x3a87e7[_0x0a9e('0x60')]);var _0x73014f=Math[_0x0a9e('0x1cd')](_0x3a87e7[_0x0a9e('0x74')]*(_0x3a87e7[_0x0a9e('0x1ce')]/0x64));var _0x236a28=Math[_0x0a9e('0x1cd')](_0x3a87e7['predictiveIntervalAvailable']*(_0x3a87e7[_0x0a9e('0x1cf')]/0x64));var _0x41ae51=_0x3a87e7['available']+_0x3a87e7[_0x0a9e('0x53')];var _0xa0ec15=Math['floor'](_0x3a87e7['erlangCalls']*_0x3a87e7[_0x0a9e('0x8d')]*_0x3a87e7[_0x0a9e('0x71')]*_0x3a87e7[_0x0a9e('0x72')]);if(_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x79')])){if(!_['isUndefined'](_0x3a87e7[_0x0a9e('0x27')])){_0x3a87e7['startPredictive']=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x0a9e('0x1d0'));}if(!_['isUndefined'](_0x3a87e7['handlePredictive'])){loggerPredictive['error'](_0x0a9e('0x1d1'),_0x0a9e('0x1d2'));clearInterval(_0x3a87e7[_0x0a9e('0x92')]);_0x3a87e7[_0x0a9e('0x92')]=undefined;}_0x3a87e7['startProgressive']=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1d3'),_0x3a87e7[_0x0a9e('0x79')]);this['handlePower'](_0x3a87e7,0x1);}else if(ifInterval(_0x3a87e7['dialPredictiveInterval'],_0x3a87e7['startProgressive'])){this[_0x0a9e('0x15f')](_0x3a87e7,0x1);loggerPredictiveCalls[_0x0a9e('0x82')](_0x0a9e('0x1d4'),_0x3a87e7[_0x0a9e('0x79')],_0x3a87e7[_0x0a9e('0x41')]);_0x3a87e7['erlangCalls']=0x0;_0x3a87e7[_0x0a9e('0x70')]=0x0;}else if(_0x21f245<_0x4d473a&&_0x3a87e7[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x1d7'),_0x0a9e('0x1d8'),_0x4d473a,'startProgressive',_0x3a87e7[_0x0a9e('0x41')]);}else if(_0xa0ec15<_0x3a87e7[_0x0a9e('0x70')]&&_0x3a87e7[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x1d9'),_0x0a9e('0x1da'),_0xa0ec15,_0x0a9e('0x1db'),_0x3a87e7[_0x0a9e('0x70')],_0x0a9e('0x79'),_0x3a87e7[_0x0a9e('0x41')]);}else if(!ifInterval(_0x3a87e7[_0x0a9e('0x1dc')],_0x3a87e7[_0x0a9e('0x79')])&&_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x27')])&&!_[_0x0a9e('0x3e')](_0x3a87e7[_0x0a9e('0x79')])){_0x3a87e7[_0x0a9e('0x27')]=moment()['format'](_0x0a9e('0x104'));loggerPredictive[_0x0a9e('0x82')](_0x3a87e7['name'],'started\x20in\x20predictive\x20at',_0x3a87e7['startPredictive']);this[_0x0a9e('0xc3')](_0x3a87e7[_0x0a9e('0x1dc')])['then'](this[_0x0a9e('0x1dd')](_0x3a87e7))[_0x0a9e('0xb9')](mergeDataErlangB(_0x3a87e7))['then'](this[_0x0a9e('0x1de')](_0x3a87e7))['catch'](loggerCatchPredictive(_0x0a9e('0x1df'),_0x3a87e7));}else if(!ifInterval(_0x3a87e7['dialPredictiveInterval'],_0x3a87e7[_0x0a9e('0x27')])){_0x3a87e7[_0x0a9e('0x70')]=0x0;_0x3a87e7[_0x0a9e('0x27')]=moment()[_0x0a9e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0a9e('0x82')](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1e0'),_0x3a87e7['startPredictive']);clearInterval(_0x3a87e7['handlePredictive']);_0x3a87e7['handlePredictive']=undefined;this['averageHandleTime'](_0x3a87e7[_0x0a9e('0x1dc')])[_0x0a9e('0xb9')](this[_0x0a9e('0x1dd')](_0x3a87e7))[_0x0a9e('0xb9')](mergeDataErlangB(_0x3a87e7))[_0x0a9e('0xb9')](this['startMethodPredictive'](_0x3a87e7))[_0x0a9e('0xba')](loggerCatchPredictive(_0x0a9e('0x1e1'),_0x3a87e7));}else if(_0x3a87e7[_0x0a9e('0x74')]&&_0x41ae51<_0x3a87e7[_0x0a9e('0x74')]-_0x236a28){freeVariablesPredictive(_0x3a87e7);loggerPredictive['info'](_0x3a87e7[_0x0a9e('0x41')],_0x0a9e('0x1e2'),_0x41ae51,_0x0a9e('0x1e3'),_0x3a87e7[_0x0a9e('0x74')],'-',_0x236a28,'=',_0x3a87e7[_0x0a9e('0x74')]-_0x236a28,')');}else if(_0x3a87e7['predictiveIntervalAvailable']&&_0x41ae51>_0x3a87e7[_0x0a9e('0x74')]+_0x73014f){freeVariablesPredictive(_0x3a87e7);loggerPredictive[_0x0a9e('0x82')](_0x3a87e7[_0x0a9e('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x41ae51,_0x0a9e('0x1e4'),_0x3a87e7['predictiveIntervalAvailable'],'+',_0x73014f,'=',_0x3a87e7[_0x0a9e('0x74')]+_0x73014f,')');}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1dd')]=function(_0xda737b){var _0x415fce=this;return function(_0x59f11d){return new Promise(function(_0x4bacf7,_0x1428a7){_[_0x0a9e('0x8f')](_0xda737b,_0x59f11d[0x0]);if(checkGetDataPredictive(_0x59f11d[0x0])){var _0x44b401=_0xda737b[_0x0a9e('0x74')]=_0xda737b['talking']+_0xda737b[_0x0a9e('0xa2')];var _0x706802=_0xda737b[_0x0a9e('0x1dc')]*0x3c;var _0x5bba8b=_0x59f11d[0x0][_0x0a9e('0x6d')]+_0x59f11d[0x0]['predictiveIntervalAvgHoldtime'];var _0x479441=(_0x59f11d[0x0][_0x0a9e('0x6b')]+_0x59f11d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59f11d[0x0][_0x0a9e('0x6e')])/_0x59f11d[0x0][_0x0a9e('0x75')];_0xda737b[_0x0a9e('0x71')]=_0x479441>0x0?_0x479441:0x1;switch(_0xda737b['dialPredictiveOptimization']){case _0x0a9e('0x1d6'):var _0x25d456=_0xda737b[_0x0a9e('0x1e5')]/0x64;return _0x415fce[_0x0a9e('0x1e6')](_0x44b401,_0x706802,_0x5bba8b,_0x479441,_0x25d456)[_0x0a9e('0xb9')](function(_0x26fd45){return _0x4bacf7(_0x26fd45);});case _0x0a9e('0x1e7'):var _0x1c3f66=_0xda737b['dialPredictiveOptimizationPercentage']/0x64;return _0x415fce[_0x0a9e('0x1e8')](_0x44b401,_0x706802,_0x5bba8b,_0x479441,_0x1c3f66)[_0x0a9e('0xb9')](function(_0x3ea9f1){return _0x4bacf7(_0x3ea9f1);});default:return _0x1428a7(msgResponse(_0x0a9e('0x1e9'),_0x0a9e('0x14c'),'Unknown\x20Predictive'));}}else{return _0x1428a7(msgResponse('[getDataPredictive]',_0x0a9e('0x14c'),'check\x20failure'));}});};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1ea')]=function(_0x58b3f3){var _0x2eb471=this;return function(_0x239eef){return new Promise(function(_0xc91243,_0x49973b){_[_0x0a9e('0x8f')](_0x58b3f3,_0x239eef[0x0]);if(checkGetDataPredictive(_0x239eef[0x0])){loggerPredictive[_0x0a9e('0x82')](JSON[_0x0a9e('0x4a')](_0x239eef[0x0]));if(_0x58b3f3[_0x0a9e('0x1d5')]===_0x0a9e('0x1d6')){return _0x2eb471[_0x0a9e('0xce')](_0x58b3f3['id'])[_0x0a9e('0xb9')](function(_0x305a4b){var _0x5695b6=_0x58b3f3[_0x0a9e('0x1eb')]-_0x305a4b[0x0][_0x0a9e('0x1ec')];var _0x459efc=_0x58b3f3[_0x0a9e('0x1dc')]*0x3c;var _0x727652=_0x239eef[0x0]['predictiveIntervalAvgTalktime']+_0x239eef[0x0][_0x0a9e('0x6c')];var _0x4fb1ea=(_0x239eef[0x0][_0x0a9e('0x6b')]+_0x239eef[0x0][_0x0a9e('0x6f')]+_0x239eef[0x0][_0x0a9e('0x6e')])/_0x239eef[0x0]['predictiveIntervalTotalCalls'];var _0x43ff93=_0x58b3f3['dialPredictiveOptimizationPercentage']/0x64;_0x58b3f3[_0x0a9e('0x73')]=_0x305a4b[0x0][_0x0a9e('0x1ec')]||0x0;_0x58b3f3[_0x0a9e('0x71')]=_0x4fb1ea>0x0?_0x4fb1ea:0x1;return _0x2eb471[_0x0a9e('0x1e6')](_0x5695b6,_0x459efc,_0x727652,_0x4fb1ea,_0x43ff93);})['then'](function(_0x323936){return _0xc91243(_0x323936);})['catch'](function(_0x334e91){return _0x49973b(msgResponse(_0x0a9e('0x1ed'),'Failure',JSON[_0x0a9e('0x4a')](_0x334e91)));});}if(_0x58b3f3[_0x0a9e('0x1d5')]===_0x0a9e('0x1e7')){return _0x2eb471['getVoiceQueueRtPauses'](_0x58b3f3['id'])[_0x0a9e('0xb9')](function(_0x5608ed){var _0xdbcd6=_0x58b3f3[_0x0a9e('0x1eb')]-_0x5608ed[0x0]['outboundQueuePauses'];var _0x4df5cc=_0x58b3f3['dialPredictiveInterval']*0x3c;var _0x495820=_0x239eef[0x0][_0x0a9e('0x6d')]+_0x239eef[0x0][_0x0a9e('0x6c')];var _0x3d7fb6=(_0x239eef[0x0][_0x0a9e('0x6b')]+_0x239eef[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x239eef[0x0][_0x0a9e('0x6e')])/_0x239eef[0x0]['predictiveIntervalTotalCalls'];var _0x400b85=_0x58b3f3[_0x0a9e('0x1e5')]/0x64;_0x58b3f3['predictiveIntervalPauses']=_0x5608ed[0x0][_0x0a9e('0x1ec')]||0x0;_0x58b3f3[_0x0a9e('0x71')]=_0x3d7fb6>0x0?_0x3d7fb6:0x1;return _0x2eb471[_0x0a9e('0x1e8')](_0xdbcd6,_0x4df5cc,_0x495820,_0x3d7fb6,_0x400b85);})[_0x0a9e('0xb9')](function(_0x37c272){return _0xc91243(_0x37c272);})[_0x0a9e('0xba')](function(_0xf01ef8){return _0x49973b(msgResponse('[CatchErlangB]',_0x0a9e('0x14c'),JSON[_0x0a9e('0x4a')](_0xf01ef8)));});}}else{return _0x49973b(msgResponse(_0x0a9e('0x1e9'),_0x0a9e('0x14c'),_0x0a9e('0x1ee')));}});};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1de')]=function(_0xd66cc3){var _0x2dc3df=this;return function(){var _0x43fd4c=0x0;var _0x10e1b9=Math['floor'](_0xd66cc3[_0x0a9e('0x77')]*0x3e8);if(_0x10e1b9>0x0){_0x10e1b9=_0x10e1b9<0x64?0x64:_0x10e1b9;loggerPredictive[_0x0a9e('0x82')](_0xd66cc3[_0x0a9e('0x41')],_0x0a9e('0x1ef'),_0x10e1b9,_0x0a9e('0x4b'));_0xd66cc3[_0x0a9e('0x92')]=setInterval(function(){_0x2dc3df[_0x0a9e('0x92')](_0xd66cc3);loggerPredictiveCalls['info'](_0x0a9e('0x1f0'),_0x43fd4c+=0x1);},_0x10e1b9);}else{loggerPredictive[_0x0a9e('0x82')](_0xd66cc3[_0x0a9e('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1f1')]=function(_0x2e082a,_0x4c7e3b){var _0x5d3ad3=this;return function(_0x23b67e){if(_[_0x0a9e('0x48')](_0x23b67e)){if(_[_0x0a9e('0xaf')](_0x4c7e3b[_0x0a9e('0xda')])||!_0x4c7e3b[_0x0a9e('0x1f2')]){if(_0x2e082a['dialMethod']===_0x0a9e('0x7')){_0x2e082a['queueStatusComplete']=_[_0x0a9e('0x3e')](_0x2e082a[_0x0a9e('0x136')])?!![]:_0x2e082a['queueStatusComplete'];var _0x449dd9=uuid['v4']();_0x5d3ad3['actions'][_0x449dd9]=new Action(_0x2e082a,_0x4c7e3b,_0x449dd9);loggerBooked[_0x0a9e('0x82')](_0x0a9e('0x1f3'),_0x449dd9,'queueStatusComplete:\x20',JSON[_0x0a9e('0x4a')](_0x2e082a[_0x0a9e('0x136')]),_0x0a9e('0x1f4'),_0x2e082a['name']);if(_0x2e082a[_0x0a9e('0x136')]){_0x2e082a[_0x0a9e('0x136')]=![];_0x5d3ad3[_0x0a9e('0x134')][_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xb5')]]=[];ami[_0x0a9e('0xb0')]({'actionid':_0x449dd9,'action':'queuestatus','queue':_0x2e082a[_0x0a9e('0x41')]})[_0x0a9e('0xba')](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);_0x5d3ad3[_0x0a9e('0x10b')]({'active':![],'ContactId':_0x5d3ad3['actions'][_0x449dd9]['ContactId'],'ListId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xd9')],'VoiceQueueId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9]['VoiceQueueId']||undefined,'CampaignId':_0x5d3ad3['actions'][_0x449dd9][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5d3ad3[_0x0a9e('0x24')][_0x449dd9];});}else{loggerBooked[_0x0a9e('0x82')]('[booked][checkContactBlack][else]',JSON[_0x0a9e('0x4a')](_0x2e082a[_0x0a9e('0x136')]),_0x0a9e('0x1f4'),_0x2e082a[_0x0a9e('0x41')]);_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);_0x5d3ad3['rescheduleContact']({'active':![],'ContactId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xd8')],'ListId':_0x5d3ad3['actions'][_0x449dd9][_0x0a9e('0xd9')],'VoiceQueueId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xdb')]||undefined,'CampaignId':_0x5d3ad3[_0x0a9e('0x24')][_0x449dd9][_0x0a9e('0xdc')]||undefined})['catch'](loggerCatch(_0x0a9e('0x1f5')));delete _0x5d3ad3[_0x0a9e('0x24')][_0x449dd9];}}else{return _0x5d3ad3['actionOriginate'](_0x2e082a,_0x4c7e3b);}}else{if(getDiff(_0x4c7e3b['scheduledat'])<_0x2e082a[_0x0a9e('0x1f6')]*0x3c){if(_0x4c7e3b[_0x0a9e('0x165')]&&!_0x4c7e3b['Agent']['voicePause']){_0x5d3ad3[_0x0a9e('0x1d')][_0x0a9e('0x139')](_0x4c7e3b['id'])[_0x0a9e('0x13c')](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);});}else{_0x5d3ad3[_0x0a9e('0xc7')]({'active':![]},_0x4c7e3b['id'],0x1)['finally'](function(){_0x5d3ad3[_0x0a9e('0xb4')](_0x2e082a);});}}else{_0x2e082a['outboundReCallsDay']+=0x1;_0x5d3ad3['updateOriginated'](_0x2e082a);if(_0x2e082a[_0x0a9e('0x1f7')]){_0x5d3ad3['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c7e3b[_0x0a9e('0xd8')],'ListId':_0x4c7e3b['ListId'],'VoiceQueueId':_0x4c7e3b[_0x0a9e('0xdb')]||undefined,'CampaignId':_0x4c7e3b['CampaignId']||undefined})['catch'](loggerCatch(_0x0a9e('0x1f8')));_0x5d3ad3[_0x0a9e('0xd1')](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1f9'),0x17,'RecallInQueue'))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5d3ad3[_0x0a9e('0xd6')](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1fa'),0x16,'RecallFailedTimeout'),_0x0a9e('0x1fb'),'[Originate][HistoryRecallClose]');}}}}else{_0x2e082a[_0x0a9e('0x61')]+=0x1;_0x5d3ad3['saveInDb'](createObjHistory(_0x2e082a,_0x4c7e3b,_0x0a9e('0x1fc'),0xd,_0x0a9e('0x1fd')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1fe')]=function(_0x149a5d){var _0x2f8a0a=this;var _0x311544=_0x149a5d[_0x0a9e('0x1ff')]-_0x149a5d[_0x0a9e('0x76')]-_0x149a5d[_0x0a9e('0xca')];emitCampaignSummary(_0x149a5d);if(_0x311544>0x0){if(_0x311544>this[_0x0a9e('0x22')]){_0x311544=this[_0x0a9e('0x22')];}_0x149a5d[_0x0a9e('0xca')]+=_0x311544;this[_0x0a9e('0xcc')](_0x149a5d['id'],_0x311544,_0x149a5d[_0x0a9e('0x200')],_0x149a5d)[_0x0a9e('0xb9')](function(_0x2e8669){_0x149a5d['temp']-=_0x311544;_0x149a5d['temp']=_0x149a5d[_0x0a9e('0xca')]>0x0?_0x149a5d[_0x0a9e('0xca')]:0x0;if(!checkContactEmpty(_0x2e8669)){_0x149a5d[_0x0a9e('0x3f')]=_0x0a9e('0x9f');logger['info'](_0x0a9e('0x201')+_0x149a5d['name']);}else{_0x149a5d[_0x0a9e('0x76')]+=_0x2e8669['length'];_0x149a5d[_0x0a9e('0x3f')]='RUNNING';for(var _0x50985c=0x0;_0x50985c<_0x2e8669[_0x0a9e('0x9a')];_0x50985c+=0x1){_0x149a5d[_0x0a9e('0x202')]+=0x1;if(_[_0x0a9e('0xaf')](_0x2e8669[_0x50985c])||_[_0x0a9e('0xaf')](_0x2e8669[_0x50985c]['Contact'])||_['isNil'](_0x2e8669[_0x50985c][_0x0a9e('0x198')])){_0x2f8a0a['emptyContact'](_0x0a9e('0x203'),_0x149a5d,_0x2e8669[_0x50985c]);}else{_0x2f8a0a[_0x0a9e('0xc2')](_['pick'](_0x2e8669[_0x50985c],[_0x0a9e('0xdc'),'Contact.phone']))[_0x0a9e('0xb9')](_0x2f8a0a[_0x0a9e('0x1f1')](_0x149a5d,_0x2e8669[_0x50985c]))[_0x0a9e('0xba')](_0x2f8a0a[_0x0a9e('0xd4')](_0x0a9e('0x204'),_0x149a5d));}}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x205'),_0x149a5d,_0x311544));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x15f')]=function(_0x342861,_0x2d4b26){var _0x2070da=this;var _0x29930d=[];var _0x68d005=_0x2d4b26>=0x1?_0x2d4b26:0x1;if(_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')){_0x68d005=0x1;}var _0x5b42ef=Math[_0x0a9e('0x206')](_0x342861[_0x0a9e('0xa2')]*_0x68d005)-_0x342861[_0x0a9e('0x76')]-_0x342861['temp'];emitVoiceQueueSummary(_0x342861);if(_0x342861[_0x0a9e('0x207')]>0x0){var _0x312cf5=_0x342861[_0x0a9e('0x207')]-_0x342861[_0x0a9e('0x76')]-_0x342861[_0x0a9e('0x53')]-_0x342861[_0x0a9e('0xca')]-_0x342861[_0x0a9e('0x50')];if(_0x5b42ef>_0x312cf5){_0x5b42ef=_0x312cf5;}}if(_0x5b42ef>0x0){if(_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')){_0x5b42ef=0x1;}if(_0x5b42ef>this[_0x0a9e('0x22')]){_0x5b42ef=this[_0x0a9e('0x22')];}_0x342861['temp']+=_0x5b42ef;for(var _0x189849 in this[_0x0a9e('0x20')]){if(typeof this[_0x0a9e('0x20')][_0x189849]!=='undefined'){if(this[_0x0a9e('0x20')][_0x189849]['state']==='not_inuse'&&this[_0x0a9e('0x20')][_0x189849]['status']===_0x0a9e('0x170')){_0x29930d['push'](this[_0x0a9e('0x20')][_0x189849]['id']);}}}this[_0x0a9e('0xc9')](_0x342861['id'],_0x29930d,_0x5b42ef,_0x342861[_0x0a9e('0x200')],_0x342861)['then'](function(_0x1676f3){_0x342861['temp']-=_0x5b42ef;_0x342861['temp']=_0x342861[_0x0a9e('0xca')]>0x0?_0x342861[_0x0a9e('0xca')]:0x0;if(!checkContactEmpty(_0x1676f3)){_0x2070da[_0x0a9e('0xb8')](_0x342861)[_0x0a9e('0xb9')](sendMessageReschedule(_0x342861))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x208')));}else{_0x342861['originated']+=_0x1676f3[_0x0a9e('0x9a')];_0x342861[_0x0a9e('0x3f')]=_0x342861[_0x0a9e('0x5a')]===_0x0a9e('0x7')?_0x0a9e('0x180'):'RUNNING';for(var _0xda6cd8=0x0;_0xda6cd8<_0x1676f3[_0x0a9e('0x9a')];_0xda6cd8+=0x1){if(_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8])||_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8][_0x0a9e('0x18f')])||_[_0x0a9e('0xaf')](_0x1676f3[_0xda6cd8][_0x0a9e('0x198')])){_0x2070da[_0x0a9e('0x209')](_0x0a9e('0x203'),_0x342861,_0x1676f3[_0xda6cd8]);}else{_0x2070da[_0x0a9e('0xbc')](_[_0x0a9e('0xd7')](_0x1676f3[_0xda6cd8],[_0x0a9e('0xdb'),_0x0a9e('0x20a')]))['then'](_0x2070da['checkContactBlack'](_0x342861,_0x1676f3[_0xda6cd8]))[_0x0a9e('0xba')](_0x2070da[_0x0a9e('0xd4')]('[actionOriginate]\x20',_0x342861));}}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x20b'),_0x342861,_0x5b42ef));}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x92')]=function(_0x2fdb67){if(_0x2fdb67['dialLimitQueue']>0x0){var _0x5d85ab=_0x2fdb67['dialLimitQueue']-_0x2fdb67[_0x0a9e('0x76')]-_0x2fdb67[_0x0a9e('0x53')];if(_0x5d85ab>0x0){this[_0x0a9e('0x20c')](_0x2fdb67);}else{loggerPredictiveCalls[_0x0a9e('0x82')](_0x0a9e('0x20d'));}}else{this[_0x0a9e('0x20c')](_0x2fdb67);}};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x20c')]=function(_0x44c694){var _0x4ee67f=this;var _0x4a0c23=[];_0x44c694[_0x0a9e('0x76')]+=0x1;for(var _0x45fac7 in this[_0x0a9e('0x20')]){if(typeof this[_0x0a9e('0x20')][_0x45fac7]!==_0x0a9e('0x9b')){if(this[_0x0a9e('0x20')][_0x45fac7][_0x0a9e('0xa7')]===_0x0a9e('0x20e')&&this[_0x0a9e('0x20')][_0x45fac7][_0x0a9e('0xb1')]==='reachable'){_0x4a0c23[_0x0a9e('0x150')](this['agents'][_0x45fac7]['id']);}}}this['getContactDialer'](_0x44c694['id'],_0x4a0c23,0x1,_0x44c694[_0x0a9e('0x200')],_0x44c694)[_0x0a9e('0xb9')](function(_0x115423){if(!checkContactEmpty(_0x115423)){checkContactLowerLimitOriginate(_0x44c694,0x1,0x0);_0x4ee67f[_0x0a9e('0xb8')](_0x44c694)[_0x0a9e('0xb9')](sendMessageReschedule(_0x44c694))[_0x0a9e('0xba')](loggerCatch(_0x0a9e('0x208')));}else{_0x44c694[_0x0a9e('0x3f')]=_0x0a9e('0x20f');if(_['isNil'](_0x115423[0x0])||_[_0x0a9e('0xaf')](_0x115423[0x0][_0x0a9e('0x18f')])||_[_0x0a9e('0xaf')](_0x115423[0x0]['phone'])){_0x4ee67f[_0x0a9e('0x209')](_0x0a9e('0x203'),_0x44c694,_0x115423[0x0]);}else{_0x4ee67f['checkIsBlackList'](_['pick'](_0x115423[0x0],['VoiceQueueId','Contact.phone']))[_0x0a9e('0xb9')](_0x4ee67f[_0x0a9e('0x1f1')](_0x44c694,_0x115423[0x0]))['catch'](_0x4ee67f[_0x0a9e('0xd4')]('[actionOriginatePredictive]\x20',_0x44c694));}}})[_0x0a9e('0xba')](loggerGetContactDialer(_0x0a9e('0x210'),_0x44c694,0x1));emitVoiceQueueSummary(_0x44c694);};Dialer[_0x0a9e('0x1a')]['abandonmentRate']=function(_0x5976d2,_0x4165be,_0x14c011,_0xb68b,_0x42d9ca,_0x1a1cb2){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x211'));loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x212'),_0x5976d2);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x213'),_0x4165be);loggerPredictive['info'](_0x0a9e('0x214'),_0x14c011);loggerPredictive[_0x0a9e('0x82')]('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',_0xb68b);loggerPredictive['info'](_0x0a9e('0x215'),_0x42d9ca);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));return new Promise(function(_0x3366f2,_0x31981e){if(_0x5976d2<=0x0||isNaN(_0x5976d2)){return _0x31981e(msgResponse('[abandonmentRate]',_0x0a9e('0x49'),_0x0a9e('0x216')+_0x5976d2));}if(_0x14c011<=0x0||isNaN(_0x14c011)){return _0x31981e(msgResponse('[abandonmentRate]',_0x0a9e('0x49'),'Ts\x20=\x20'+_0x14c011));}if(_0xb68b<=0x0||isNaN(_0xb68b)){return _0x31981e(msgResponse('[abandonmentRate]','Error',_0x0a9e('0x217')+_0xb68b));}if(_0x4165be<=0x0||isNaN(_0x4165be)){return _0x31981e(msgResponse(_0x0a9e('0x218'),'Error','interval\x20=\x20'+_0x4165be));}if(_0x42d9ca<=0x0||isNaN(_0x42d9ca)){return _0x31981e(msgResponse(_0x0a9e('0x218'),_0x0a9e('0x49'),_0x0a9e('0x219')+_0x42d9ca));}_0x1a1cb2=_0x1a1cb2||0x0;var _0x1682dc=0x1/_0x14c011;var _0x5db09e=0x0;var _0xe9bc8e=0x0;var _0x3eac52=0x0;var _0x12d833=0x0;for(var _0x483d88=0x0;_0x3eac52<_0x42d9ca;_0x483d88+=0x1){_0xe9bc8e=_0x483d88/_0x4165be;_0x5db09e=(_0xb68b*_0xe9bc8e+_0x1a1cb2)/_0x1682dc;_0x3eac52=erlangb(_0x5db09e,_0x5976d2);_0x12d833=_0x5db09e/_0x5976d2*(0x1-erlangb(_0x5db09e,_0x5976d2));}return _0x3366f2({'erlangCalls':_0x483d88,'erlangCallToSecond':_0x4165be/_0x483d88,'erlangAbandonmentRate':_0x3eac52,'erlangBusyFactor':_0x12d833});});};Dialer[_0x0a9e('0x1a')][_0x0a9e('0x1e8')]=function(_0x400f7a,_0x3a1953,_0x2cdbbf,_0x5a240f,_0x5b862a,_0x171660){loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x21a'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x400f7a);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a1953);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x214'),_0x2cdbbf);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x21b'),_0x5a240f);loggerPredictive[_0x0a9e('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b862a);loggerPredictive[_0x0a9e('0x82')](_0x0a9e('0x87'));return new Promise(function(_0x34f39f,_0x2e40a9){if(_0x400f7a<=0x0||isNaN(_0x400f7a)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error',_0x0a9e('0x216')+_0x400f7a));}if(_0x2cdbbf<=0x0||isNaN(_0x2cdbbf)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),_0x0a9e('0x49'),_0x0a9e('0x21d')+_0x2cdbbf));}if(_0x5a240f<=0x0||isNaN(_0x5a240f)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error',_0x0a9e('0x217')+_0x5a240f));}if(_0x3a1953<=0x0||isNaN(_0x3a1953)){return _0x2e40a9(msgResponse(_0x0a9e('0x21c'),'Error','interval\x20=\x20'+_0x3a1953));}if(_0x5b862a<=0x0||isNaN(_0x5b862a)){return _0x2e40a9(msgResponse('[busyFactor]',_0x0a9e('0x49'),_0x0a9e('0x21e')+_0x5b862a));}_0x171660=_0x171660||0x0;var _0x4dafc8=0x1/_0x2cdbbf;var _0x23fc30=0x0;var _0x5e2a11=0x0;var _0x58503f=0x0;var _0x4b1969=0x0;for(var _0x4e0508=0x0;_0x4b1969<_0x5b862a;_0x4e0508+=0x1){_0x5e2a11=_0x4e0508/_0x3a1953;_0x23fc30=(_0x5a240f*_0x5e2a11+_0x171660)/_0x4dafc8;_0x58503f=erlangb(_0x23fc30,_0x400f7a);_0x4b1969=_0x23fc30/_0x400f7a*(0x1-erlangb(_0x23fc30,_0x400f7a));}return _0x34f39f({'erlangCalls':_0x4e0508,'erlangCallToSecond':_0x3a1953/_0x4e0508,'erlangAbandonmentRate':_0x58503f,'erlangBusyFactor':_0x4b1969});});};module[_0x0a9e('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c70f901..a965e92 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 _0x9e29=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','talktime','queue','connectedlinename'];(function(_0x1d59e7,_0x323077){var _0x3684aa=function(_0x558700){while(--_0x558700){_0x1d59e7['push'](_0x1d59e7['shift']());}};_0x3684aa(++_0x323077);}(_0x9e29,0xd5));var _0x99e2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x9e29[_0x599f41];return _0x2e4d58;};'use strict';var util=require(_0x99e2('0x0'));var _=require('lodash');var moment=require(_0x99e2('0x1'));function getSeconds(_0xba3b1,_0x55c6f8){var _0x2dc5db=moment(_0xba3b1)['milliseconds'](0x0);var _0x1be0bb=moment(_0x55c6f8)[_0x99e2('0x2')](0x0);return _0x2dc5db['diff'](_0x1be0bb,_0x99e2('0x3'));}function QueueCallerAbandon(_0x5a8249,_0x2b2b45){this['scheduledat']=_0x5a8249[_0x99e2('0x4')];this[_0x99e2('0x5')]=_0x5a8249[_0x99e2('0x5')];this[_0x99e2('0x6')]=_0x5a8249[_0x99e2('0x5')]===_0x99e2('0x7')?'queue':_0x5a8249[_0x99e2('0x5')];this[_0x99e2('0x8')]=_0x5a8249[_0x99e2('0x8')];this[_0x99e2('0x9')]=_0x5a8249[_0x99e2('0x9')];this[_0x99e2('0xa')]=_0x5a8249['countnoanswerretry'];this[_0x99e2('0xb')]=_0x5a8249[_0x99e2('0x8')]+_0x5a8249['countcongestionretry']+_0x5a8249['countnoanswerretry']+_0x5a8249[_0x99e2('0xc')]+_0x5a8249[_0x99e2('0xd')]+_0x5a8249['countabandonedretry']+_0x5a8249[_0x99e2('0xe')]+_0x5a8249[_0x99e2('0xf')];this[_0x99e2('0xc')]=_0x5a8249[_0x99e2('0xc')];this[_0x99e2('0xd')]=_0x5a8249[_0x99e2('0xd')];this[_0x99e2('0x10')]=_0x5a8249[_0x99e2('0x10')];this[_0x99e2('0xe')]=_0x5a8249[_0x99e2('0xe')];this[_0x99e2('0xf')]=_0x5a8249['countagentrejectretry'];this[_0x99e2('0x11')]=_0x2b2b45[_0x99e2('0x11')];this[_0x99e2('0x12')]=_0x5a8249['name'];this[_0x99e2('0x13')]=_0x5a8249[_0x99e2('0x14')];this[_0x99e2('0x15')]=_0x5a8249[_0x99e2('0x15')];this['responsetime']=_0x5a8249[_0x99e2('0x16')];this[_0x99e2('0x17')]=_0x5a8249[_0x99e2('0x17')];this['endtime']=this[_0x99e2('0x17')];this['ringtime']=getSeconds(_0x5a8249[_0x99e2('0x16')],_0x5a8249['starttime']);this['holdtime']=getSeconds(this[_0x99e2('0x17')],_0x5a8249[_0x99e2('0x16')]);this[_0x99e2('0x18')]=0x0;this[_0x99e2('0x19')]=_0x2b2b45[_0x99e2('0x19')];this['membername']=_0x2b2b45[_0x99e2('0x1a')];this['reason']=_0x2b2b45[_0x99e2('0x1b')];this[_0x99e2('0x1c')]=_0x5a8249[_0x99e2('0x1c')];this[_0x99e2('0x1d')]=_0x5a8249[_0x99e2('0x1d')];this[_0x99e2('0x1e')]=_0x5a8249[_0x99e2('0x1e')];this[_0x99e2('0x1f')]=_0x5a8249[_0x99e2('0x1f')];this['ContactId']=_0x5a8249[_0x99e2('0x20')];this[_0x99e2('0x21')]=_0x5a8249[_0x99e2('0x21')];this['UserId']=_0x5a8249[_0x99e2('0x22')];this['VoiceQueueId']=_0x5a8249[_0x99e2('0x23')];this[_0x99e2('0x24')]=_0x5a8249[_0x99e2('0x24')];this[_0x99e2('0x25')]=_0x5a8249[_0x99e2('0x25')]||'';this['originatecalleridname']=_0x5a8249[_0x99e2('0x26')]||'';}module[_0x99e2('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x19fb=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','responsetime','droptime','ringtime','starttime','talktime','membername','connectedlinename','reason'];(function(_0x244d04,_0x559977){var _0x2f1e46=function(_0x271649){while(--_0x271649){_0x244d04['push'](_0x244d04['shift']());}};_0x2f1e46(++_0x559977);}(_0x19fb,0xdd));var _0xb19f=function(_0x24de0b,_0x14e21e){_0x24de0b=_0x24de0b-0x0;var _0x5bf68a=_0x19fb[_0x24de0b];return _0x5bf68a;};'use strict';var util=require(_0xb19f('0x0'));var _=require(_0xb19f('0x1'));var moment=require(_0xb19f('0x2'));function getSeconds(_0x7b1b9f,_0x19d9ff){var _0x3b7552=moment(_0x7b1b9f)['milliseconds'](0x0);var _0x4f0e14=moment(_0x19d9ff)[_0xb19f('0x3')](0x0);return _0x3b7552[_0xb19f('0x4')](_0x4f0e14,_0xb19f('0x5'));}function QueueCallerAbandon(_0x72b7,_0x3ca9c9){this['scheduledat']=_0x72b7[_0xb19f('0x6')];this[_0xb19f('0x7')]=_0x72b7[_0xb19f('0x7')];this[_0xb19f('0x8')]=_0x72b7[_0xb19f('0x7')]===_0xb19f('0x9')?_0xb19f('0xa'):_0x72b7[_0xb19f('0x7')];this['countbusyretry']=_0x72b7[_0xb19f('0xb')];this[_0xb19f('0xc')]=_0x72b7[_0xb19f('0xc')];this[_0xb19f('0xd')]=_0x72b7[_0xb19f('0xd')];this[_0xb19f('0xe')]=_0x72b7[_0xb19f('0xb')]+_0x72b7[_0xb19f('0xc')]+_0x72b7[_0xb19f('0xd')]+_0x72b7[_0xb19f('0xf')]+_0x72b7[_0xb19f('0x10')]+_0x72b7[_0xb19f('0x11')]+_0x72b7[_0xb19f('0x12')]+_0x72b7[_0xb19f('0x13')];this[_0xb19f('0xf')]=_0x72b7['countnosuchnumberretry'];this[_0xb19f('0x10')]=_0x72b7[_0xb19f('0x10')];this[_0xb19f('0x11')]=_0x72b7['countabandonedretry'];this[_0xb19f('0x12')]=_0x72b7[_0xb19f('0x12')];this[_0xb19f('0x13')]=_0x72b7['countagentrejectretry'];this[_0xb19f('0x14')]=_0x3ca9c9[_0xb19f('0x14')];this[_0xb19f('0x15')]=_0x72b7['name'];this[_0xb19f('0x16')]=_0x72b7['number'];this['starttime']=_0x72b7['starttime'];this[_0xb19f('0x17')]=_0x72b7[_0xb19f('0x17')];this[_0xb19f('0x18')]=_0x72b7[_0xb19f('0x18')];this['endtime']=this[_0xb19f('0x18')];this[_0xb19f('0x19')]=getSeconds(_0x72b7['responsetime'],_0x72b7[_0xb19f('0x1a')]);this['holdtime']=getSeconds(this[_0xb19f('0x18')],_0x72b7[_0xb19f('0x17')]);this[_0xb19f('0x1b')]=0x0;this[_0xb19f('0xa')]=_0x3ca9c9[_0xb19f('0xa')];this[_0xb19f('0x1c')]=_0x3ca9c9[_0xb19f('0x1d')];this['reason']=_0x3ca9c9[_0xb19f('0x1e')];this[_0xb19f('0x1f')]=_0x72b7[_0xb19f('0x1f')];this[_0xb19f('0x20')]=_0x72b7['callbackuniqueid'];this[_0xb19f('0x21')]=_0x72b7[_0xb19f('0x21')];this[_0xb19f('0x22')]=_0x72b7[_0xb19f('0x22')];this[_0xb19f('0x23')]=_0x72b7[_0xb19f('0x23')];this[_0xb19f('0x24')]=_0x72b7[_0xb19f('0x24')];this[_0xb19f('0x25')]=_0x72b7[_0xb19f('0x25')];this[_0xb19f('0x26')]=_0x72b7['VoiceQueueId'];this[_0xb19f('0x27')]=_0x72b7[_0xb19f('0x27')];this['originatecalleridnum']=_0x72b7[_0xb19f('0x28')]||'';this[_0xb19f('0x29')]=_0x72b7['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 27202f7..a280579 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(_0x4dd08b,_0x1c17b6){var _0x53e9a5=function(_0x43e4e2){while(--_0x43e4e2){_0x4dd08b['push'](_0x4dd08b['shift']());}};_0x53e9a5(++_0x1c17b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x50fa04,_0x1204a0){var _0x4a7e2e=function(_0x127552){while(--_0x127552){_0x50fa04['push'](_0x50fa04['shift']());}};_0x4a7e2e(++_0x1204a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 5def003..0417d9f 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 _0xed0c=['reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','notify','.pdf','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','pick','response','AttachmentId','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s'];(function(_0x209645,_0x121a4d){var _0x2c7f2a=function(_0x573b2e){while(--_0x573b2e){_0x209645['push'](_0x209645['shift']());}};_0x2c7f2a(++_0x121a4d);}(_0xed0c,0x1d7));var _0xced0=function(_0x4bf280,_0x1d8ff8){_0x4bf280=_0x4bf280-0x0;var _0x473aaf=_0xed0c[_0x4bf280];return _0x473aaf;};'use strict';var util=require(_0xced0('0x0'));var _=require(_0xced0('0x1'));var BPromise=require('bluebird');var uuid=require(_0xced0('0x2'));var moment=require('moment');var path=require(_0xced0('0x3'));var tiff2pdf=require(_0xced0('0x4'));var gs=require(_0xced0('0x5'));var logger=require(_0xced0('0x6'))(_0xced0('0x7'));var ami=require(_0xced0('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0xced0('0x9'));var ut=require('./util/util');var Action=require(_0xced0('0xa'));var faxAccount=require(_0xced0('0xb'));var attachment=require(_0xced0('0xc'));var faxMessage=require(_0xced0('0xd'));function Fax(_0x54b4ff){this[_0xced0('0xe')]={};this[_0xced0('0xf')]=_0x54b4ff['faxAccounts'];this[_0xced0('0x10')]=_0x54b4ff['trunks'];this[_0xced0('0x11')]={};ami['on'](_0xced0('0x12'),this[_0xced0('0x13')][_0xced0('0x14')](this));ami['on'](_0xced0('0x15'),this['syncVarSet'][_0xced0('0x14')](this));ami['on'](_0xced0('0x16'),this[_0xced0('0x17')]['bind'](this));ami['on'](_0xced0('0x18'),this['syncNewExten']['bind'](this));ami['on'](_0xced0('0x19'),this[_0xced0('0x1a')][_0xced0('0x14')](this));ami['on'](_0xced0('0x1b'),this[_0xced0('0x1c')][_0xced0('0x14')](this));ami['on'](_0xced0('0x1d'),this[_0xced0('0x1e')][_0xced0('0x14')](this));ami['on'](_0xced0('0x1f'),this['syncOriginateResponse']['bind'](this));}Fax[_0xced0('0x20')][_0xced0('0x13')]=function(_0x26d8eb){if(_0x26d8eb[_0xced0('0x21')]==='from-voip-provider'){for(var _0x241d40 in this[_0xced0('0xf')]){if(this[_0xced0('0xf')][_0xced0('0x22')](_0x241d40)){if(_0x26d8eb['exten']===this[_0xced0('0xf')][_0x241d40][_0xced0('0x23')]){this['channels'][_0x26d8eb[_0xced0('0x24')]]={};this['channels'][_0x26d8eb['uniqueid']][_0xced0('0x25')]=_0x26d8eb[_0xced0('0x25')];this[_0xced0('0xe')][_0x26d8eb[_0xced0('0x24')]]['id']=this[_0xced0('0xf')][_0x241d40]['id'];this[_0xced0('0xe')][_0x26d8eb['uniqueid']][_0xced0('0x26')]=this[_0xced0('0xf')][_0x241d40][_0xced0('0x26')];logger[_0xced0('0x27')](_0x26d8eb[_0xced0('0x24')],_0xced0('0x28'));}}}}if(this[_0xced0('0x11')][_0x26d8eb[_0xced0('0x24')]]){this[_0xced0('0xe')][_0x26d8eb[_0xced0('0x24')]]={};this[_0xced0('0xe')][_0x26d8eb['uniqueid']][_0xced0('0x25')]=_0x26d8eb[_0xced0('0x25')];logger['info'](_0x26d8eb[_0xced0('0x24')],'\x20syncNewchannel\x20');}};Fax[_0xced0('0x20')][_0xced0('0x29')]=function(_0x10b2c6){if(this[_0xced0('0xe')][_0x10b2c6[_0xced0('0x24')]]){for(var _0x2ea201 in _0x10b2c6[_0xced0('0x2a')]){if(_0x10b2c6[_0xced0('0x2a')]['hasOwnProperty'](_0x2ea201)){this[_0xced0('0xe')][_0x10b2c6[_0xced0('0x24')]][_0x2ea201]=_0x10b2c6[_0xced0('0x2b')];}}}};Fax[_0xced0('0x20')]['syncNewState']=function(_0x457a62){if(this[_0xced0('0xe')][_0x457a62['uniqueid']]){this['channels'][_0x457a62[_0xced0('0x24')]]['channelstate']=_0x457a62['channelstate'];this['channels'][_0x457a62[_0xced0('0x24')]]['channelstatedesc']=_0x457a62[_0xced0('0x2c')];}};Fax[_0xced0('0x20')][_0xced0('0x2d')]=function(_0x3cbfb1){if(this['channels'][_0x3cbfb1[_0xced0('0x24')]]){for(var _0x26d24c in _0x3cbfb1[_0xced0('0x2a')]){if(_0x3cbfb1[_0xced0('0x2a')][_0xced0('0x22')](_0x26d24c)){this[_0xced0('0xe')][_0x3cbfb1[_0xced0('0x24')]][_0x26d24c]=_0x3cbfb1[_0xced0('0x2b')];}}}};Fax[_0xced0('0x20')]['syncFaxStatus']=function(_0x58e834){if(this[_0xced0('0xe')][_0x58e834[_0xced0('0x24')]]){this[_0xced0('0xe')][_0x58e834[_0xced0('0x24')]][_0xced0('0x2e')]=_0x58e834[_0xced0('0x2e')];this[_0xced0('0xe')][_0x58e834['uniqueid']][_0xced0('0x2f')]=_0x58e834[_0xced0('0x2f')];this[_0xced0('0xe')][_0x58e834[_0xced0('0x24')]][_0xced0('0x23')]=_0x58e834[_0xced0('0x23')];this['channels'][_0x58e834[_0xced0('0x24')]][_0xced0('0x30')]=_0x58e834[_0xced0('0x30')];logger['info'](_0x58e834['uniqueid'],_0xced0('0x31'));}};Fax[_0xced0('0x20')][_0xced0('0x1c')]=function(_0x5e641c){var _0xfb2c81=this;if(this['channels'][_0x5e641c[_0xced0('0x24')]]){var _0x2ac8fe=this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]]['id'];this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]][_0xced0('0x32')]=_0x5e641c[_0xced0('0x32')];this[_0xced0('0xe')][_0x5e641c['uniqueid']][_0xced0('0x33')]=_0x5e641c[_0xced0('0x33')];this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]][_0xced0('0x23')]=_0x5e641c['localstationid'];this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]][_0xced0('0x34')]=_0x5e641c[_0xced0('0x34')];this[_0xced0('0xe')][_0x5e641c['uniqueid']][_0xced0('0x35')]=_0x5e641c[_0xced0('0x35')];this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]][_0xced0('0x30')]=_0x5e641c[_0xced0('0x30')];this[_0xced0('0xe')][_0x5e641c[_0xced0('0x24')]][_0xced0('0x36')]=_0x5e641c['calleridnum'];if(this['channels'][_0x5e641c[_0xced0('0x24')]][_0xced0('0x33')]>0x0){tiff2pdf(_0x5e641c[_0xced0('0x30')],_0xced0('0x37'),function(_0x2e468b){logger['info'](_0x5e641c['uniqueid'],_0xced0('0x38'),_0x2e468b[_0xced0('0x39')]);attachment[_0xced0('0x3a')]({'name':path[_0xced0('0x3b')](_0x5e641c[_0xced0('0x30')])[_0xced0('0x26')],'basename':path['parse'](_0x5e641c[_0xced0('0x30')])[_0xced0('0x26')]+'.pdf','type':'application/pdf'})['then'](function(_0x289eb5){faxAccount[_0xced0('0x3c')](_0x2ac8fe,{'from':_0x5e641c[_0xced0('0x36')],'mapKey':_0xced0('0x7'),'body':path[_0xced0('0x3b')](_0x5e641c['filename'])['name']+_0xced0('0x3d'),'AttachmentId':_0x289eb5['id']})['catch'](function(_0x3cd8b2){logger[_0xced0('0x3e')](_0x5e641c['uniqueid'],_0xced0('0x3f'),JSON['stringify'](_0x3cd8b2));});})[_0xced0('0x40')](function(_0x1bcca1){logger[_0xced0('0x3e')](_0x5e641c[_0xced0('0x24')],_0xced0('0x41'),JSON[_0xced0('0x42')](_0x1bcca1));});});}logger['info'](_0x5e641c[_0xced0('0x24')],_0xced0('0x41'));}};Fax[_0xced0('0x20')][_0xced0('0x43')]=function(_0x92afe4){if(this[_0xced0('0x11')][_0x92afe4['uniqueid']]){_[_0xced0('0x44')](this[_0xced0('0xe')][_0x92afe4[_0xced0('0x24')]],_[_0xced0('0x45')](_0x92afe4,[_0xced0('0x46'),'reason']));}};function updateStatus(_0x262f08){if(_0x262f08[_0xced0('0x47')]){faxMessage['update'](_0x262f08['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xced0('0x48')](function(_0x537e78){ut[_0xced0('0x49')](_0xced0('0x4a'),_0x537e78);})[_0xced0('0x40')](function(_0x2a37c2){ut[_0xced0('0x49')](_0xced0('0x4b'),_0x2a37c2);});}else{ut[_0xced0('0x49')](_0xced0('0x4c'));}}Fax[_0xced0('0x20')][_0xced0('0x4d')]=function(_0x3cfd9a,_0x2c1579,_0x309f04){var _0x45eee9=this;var _0x46c4d7={};if(_0x2c1579){_0x46c4d7={'read':_0x2c1579};}else{_0x46c4d7={'failMessage':_0x309f04};}if(this[_0xced0('0x11')][_0x3cfd9a][_0xced0('0x47')]){faxMessage[_0xced0('0x4e')](this[_0xced0('0x11')][_0x3cfd9a][_0xced0('0x47')],_0x46c4d7)[_0xced0('0x48')](function(_0x2c9554){ut[_0xced0('0x49')](_0xced0('0x4f'),_0x2c9554);})['catch'](function(_0x5268ea){ut[_0xced0('0x49')](_0xced0('0x50'),_0x5268ea);})[_0xced0('0x51')](function(){delete _0x45eee9[_0xced0('0xe')][_0x3cfd9a];delete _0x45eee9['actions'][_0x3cfd9a];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xced0('0xe')][_0x3cfd9a];delete this['actions'][_0x3cfd9a];}};Fax['prototype']['syncHangup']=function(_0x3f03e1){var _0xaeb3da=this;if(this['channels'][_0x3f03e1[_0xced0('0x24')]]){if(this[_0xced0('0x11')][_0x3f03e1[_0xced0('0x24')]]){this[_0xced0('0xe')][_0x3f03e1[_0xced0('0x24')]]['id']=this[_0xced0('0x11')][_0x3f03e1[_0xced0('0x24')]]['id'];this[_0xced0('0xe')][_0x3f03e1[_0xced0('0x24')]][_0xced0('0x26')]=this['actions'][_0x3f03e1['uniqueid']][_0xced0('0x26')];}logger['info'](_0x3f03e1[_0xced0('0x24')],this[_0xced0('0x11')][_0x3f03e1['uniqueid']]?_0xced0('0x52'):_0xced0('0x53'),JSON[_0xced0('0x42')](this[_0xced0('0xe')][_0x3f03e1[_0xced0('0x24')]]));if(this[_0xced0('0x11')][_0x3f03e1['uniqueid']]){if(this[_0xced0('0xe')][_0x3f03e1[_0xced0('0x24')]]['faxpages']>0x0&&this['channels'][_0x3f03e1[_0xced0('0x24')]]['faxstatus']===_0xced0('0x54')){this[_0xced0('0x4d')](_0x3f03e1[_0xced0('0x24')],!![]);}else{this[_0xced0('0x4d')](_0x3f03e1[_0xced0('0x24')],![],this[_0xced0('0xe')][_0x3f03e1[_0xced0('0x24')]][_0xced0('0x55')]?_0xced0('0x56')+this[_0xced0('0xe')][_0x3f03e1['uniqueid']][_0xced0('0x55')]:_0xced0('0x57'));}}}};Fax[_0xced0('0x20')][_0xced0('0x58')]=function(_0x480f65){var _0x443997=this;return new BPromise(function(_0x330dcf,_0x534500){_0x443997[_0xced0('0x59')](_0x480f65,_0x443997[_0xced0('0xf')][_0x480f65[_0xced0('0x5a')]])[_0xced0('0x48')](function(_0x1221c1){ut[_0xced0('0x49')]('[Fax][execOriginate][success]',_0x1221c1);_0x330dcf(ut[_0xced0('0x39')]('Fax\x20received'));})[_0xced0('0x40')](function(_0x50d492){ut[_0xced0('0x49')](_0xced0('0x5b'),_0x50d492);updateStatus(_0x480f65);_0x534500(ut['message'](_0xced0('0x5c')));});});};Fax['prototype']['checkAfterSend']=function(_0x1198dc){var _0x1689d2=this;return new BPromise(function(_0x1e093d,_0x4eaa0c){var _0x3b2b4e=_0x1689d2[_0xced0('0x5d')](_0x1689d2['faxAccounts'][_0x1198dc['FaxAccountId']][_0xced0('0x5e')],_0x1198dc);if(_0x3b2b4e['isValid']){_0x1e093d(ut['message'](_0xced0('0x5f')));}else{_0x4eaa0c(ut[_0xced0('0x39')](_0x3b2b4e['message']));}});};function originate(_0x27636a,_0x505ac9,_0x2df619){return new BPromise(function(_0x25bbd0,_0x240d91){if(_0x2df619){var _0x35e80b=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xced0('0x3b')](_0x27636a['path'])[_0xced0('0x26')],_0x27636a[_0xced0('0x3')]);gs[_0xced0('0x60')](_0x35e80b)[_0xced0('0x48')](function(){_0x27636a[_0xced0('0x3')]=util[_0xced0('0x61')](_0xced0('0x62'),path['parse'](_0x27636a[_0xced0('0x3')])[_0xced0('0x63')],path[_0xced0('0x3b')](_0x27636a[_0xced0('0x3')])[_0xced0('0x26')]);_0x505ac9[_0xced0('0x64')]=_0x27636a[_0xced0('0x3')];ut[_0xced0('0x49')](_0xced0('0x65'),'');ami['Action'](ut[_0xced0('0x66')](_0x27636a,_0x505ac9))[_0xced0('0x48')](function(_0x561c9e){_0x25bbd0(_0x561c9e);})[_0xced0('0x40')](function(_0x270d3a){_0x240d91(_0x270d3a);});})[_0xced0('0x40')](function(_0x314385){_0x240d91(_0x314385);});}else{ami[_0xced0('0x67')](ut[_0xced0('0x66')](_0x27636a,_0x505ac9))[_0xced0('0x48')](function(_0x1d5c84){_0x25bbd0(_0x1d5c84);})['catch'](function(_0x128579){_0x240d91(_0x128579);});}});}Fax[_0xced0('0x20')]['execOriginate']=function(_0x1abd4d,_0x4dd82e){var _0x3d4ab2=this;return new BPromise(function(_0x29c833,_0x4ad6bb){var _0x51ce31=uuid['v4']();var _0x35a376=ut['addVariables'](_0x1abd4d,_0x4dd82e);_0x3d4ab2[_0xced0('0x11')][_0x51ce31]=new Action(_0x51ce31,_0x4dd82e,_0x1abd4d);var _0x2580d7=_0x3d4ab2['actions'][_0x51ce31];if(path[_0xced0('0x3b')](_0x1abd4d['path'])[_0xced0('0x68')]===_0xced0('0x3d')){originate(_0x2580d7,_0x35a376,!![])['then'](function(_0x4f5467){_0x29c833(_0x4f5467);})[_0xced0('0x40')](function(_0x35c649){_0x4ad6bb(_0x35c649);});}else{originate(_0x2580d7,_0x35a376,![])[_0xced0('0x48')](function(_0x46d1ea){_0x29c833(_0x46d1ea);})[_0xced0('0x40')](function(_0x508732){_0x4ad6bb(_0x508732);});}});};Fax[_0xced0('0x20')][_0xced0('0x69')]=function(_0x2f4702){return!_['isNil'](_0x2f4702)&&!_[_0xced0('0x6a')](_0x2f4702[_0xced0('0x26')])&&!_[_0xced0('0x6a')](_0x2f4702[_0xced0('0x6b')])&&_0x2f4702[_0xced0('0x6b')]&&!_[_0xced0('0x6a')](this[_0xced0('0x10')][util[_0xced0('0x61')]('SIP/%s',_0x2f4702[_0xced0('0x26')])])&&!_[_0xced0('0x6a')](this[_0xced0('0x10')][util[_0xced0('0x61')](_0xced0('0x6c'),_0x2f4702[_0xced0('0x26')])]['status'])&&(this[_0xced0('0x10')][util[_0xced0('0x61')]('SIP/%s',_0x2f4702[_0xced0('0x26')])][_0xced0('0x2f')]===_0xced0('0x6d')||this['trunks'][util[_0xced0('0x61')](_0xced0('0x6c'),_0x2f4702[_0xced0('0x26')])][_0xced0('0x2f')]==='unmonitored');};Fax[_0xced0('0x20')][_0xced0('0x5d')]=function(_0xc9f07c,_0x281652){if(!this[_0xced0('0x69')](_0xc9f07c)){ut[_0xced0('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0xc9f07c)?'':_0xc9f07c[_0xced0('0x26')]+_0xced0('0x6e'));return{'isValid':![],'message':_0xced0('0x6f')};}if(_['isNil'](_0x281652[_0xced0('0x7')])){ut[_0xced0('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xced0('0x42')](_0x281652));return{'isValid':![],'message':_0xced0('0x70')};}if(_[_0xced0('0x6a')](_0x281652[_0xced0('0x3')])){ut[_0xced0('0x49')](_0xced0('0x71'),JSON[_0xced0('0x42')](_0x281652));return{'isValid':![],'message':_0xced0('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xced0('0x73')]=Fax; \ No newline at end of file +var _0x925d=['Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','bind','newstate','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','prototype','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','then','notify','fax','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk'];(function(_0x3e9ef6,_0x5770b4){var _0x66e840=function(_0x2440c6){while(--_0x2440c6){_0x3e9ef6['push'](_0x3e9ef6['shift']());}};_0x66e840(++_0x5770b4);}(_0x925d,0x94));var _0xd925=function(_0x58fc1c,_0x2eb848){_0x58fc1c=_0x58fc1c-0x0;var _0x36213e=_0x925d[_0x58fc1c];return _0x36213e;};'use strict';var util=require(_0xd925('0x0'));var _=require('lodash');var BPromise=require(_0xd925('0x1'));var uuid=require(_0xd925('0x2'));var moment=require(_0xd925('0x3'));var path=require(_0xd925('0x4'));var tiff2pdf=require(_0xd925('0x5'));var gs=require('./util/gs');var logger=require(_0xd925('0x6'))('fax');var ami=require(_0xd925('0x7'));var rpcDb=require(_0xd925('0x8'));var Channel=require(_0xd925('0x9'));var ut=require(_0xd925('0xa'));var Action=require(_0xd925('0xb'));var faxAccount=require(_0xd925('0xc'));var attachment=require(_0xd925('0xd'));var faxMessage=require(_0xd925('0xe'));function Fax(_0x108199){this['channels']={};this[_0xd925('0xf')]=_0x108199['faxAccounts'];this[_0xd925('0x10')]=_0x108199[_0xd925('0x10')];this[_0xd925('0x11')]={};ami['on'](_0xd925('0x12'),this[_0xd925('0x13')]['bind'](this));ami['on'](_0xd925('0x14'),this['syncVarSet'][_0xd925('0x15')](this));ami['on'](_0xd925('0x16'),this['syncNewState'][_0xd925('0x15')](this));ami['on'](_0xd925('0x17'),this[_0xd925('0x18')][_0xd925('0x15')](this));ami['on']('faxstatus',this[_0xd925('0x19')][_0xd925('0x15')](this));ami['on']('receivefax',this[_0xd925('0x1a')]['bind'](this));ami['on'](_0xd925('0x1b'),this[_0xd925('0x1c')][_0xd925('0x15')](this));ami['on'](_0xd925('0x1d'),this['syncOriginateResponse'][_0xd925('0x15')](this));}Fax['prototype'][_0xd925('0x13')]=function(_0x3a4221){if(_0x3a4221[_0xd925('0x1e')]===_0xd925('0x1f')){for(var _0x3f1eff in this[_0xd925('0xf')]){if(this[_0xd925('0xf')][_0xd925('0x20')](_0x3f1eff)){if(_0x3a4221[_0xd925('0x21')]===this[_0xd925('0xf')][_0x3f1eff][_0xd925('0x22')]){this[_0xd925('0x23')][_0x3a4221[_0xd925('0x24')]]={};this[_0xd925('0x23')][_0x3a4221['uniqueid']][_0xd925('0x25')]=_0x3a4221[_0xd925('0x25')];this[_0xd925('0x23')][_0x3a4221[_0xd925('0x24')]]['id']=this[_0xd925('0xf')][_0x3f1eff]['id'];this['channels'][_0x3a4221[_0xd925('0x24')]]['name']=this['faxAccounts'][_0x3f1eff][_0xd925('0x26')];logger[_0xd925('0x27')](_0x3a4221['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x3a4221[_0xd925('0x24')]]){this['channels'][_0x3a4221['uniqueid']]={};this[_0xd925('0x23')][_0x3a4221[_0xd925('0x24')]][_0xd925('0x25')]=_0x3a4221['channel'];logger[_0xd925('0x27')](_0x3a4221['uniqueid'],_0xd925('0x28'));}};Fax['prototype']['syncVarSet']=function(_0x3dc42d){if(this[_0xd925('0x23')][_0x3dc42d[_0xd925('0x24')]]){for(var _0x409aaa in _0x3dc42d[_0xd925('0x29')]){if(_0x3dc42d[_0xd925('0x29')]['hasOwnProperty'](_0x409aaa)){this[_0xd925('0x23')][_0x3dc42d[_0xd925('0x24')]][_0x409aaa]=_0x3dc42d['value'];}}}};Fax[_0xd925('0x2a')][_0xd925('0x2b')]=function(_0x1f6811){if(this[_0xd925('0x23')][_0x1f6811['uniqueid']]){this[_0xd925('0x23')][_0x1f6811[_0xd925('0x24')]][_0xd925('0x2c')]=_0x1f6811[_0xd925('0x2c')];this['channels'][_0x1f6811[_0xd925('0x24')]][_0xd925('0x2d')]=_0x1f6811[_0xd925('0x2d')];}};Fax[_0xd925('0x2a')][_0xd925('0x18')]=function(_0x4cc082){if(this[_0xd925('0x23')][_0x4cc082[_0xd925('0x24')]]){for(var _0x1dd75b in _0x4cc082[_0xd925('0x29')]){if(_0x4cc082[_0xd925('0x29')][_0xd925('0x20')](_0x1dd75b)){this[_0xd925('0x23')][_0x4cc082[_0xd925('0x24')]][_0x1dd75b]=_0x4cc082['value'];}}}};Fax[_0xd925('0x2a')][_0xd925('0x19')]=function(_0x2d00e3){if(this[_0xd925('0x23')][_0x2d00e3[_0xd925('0x24')]]){this[_0xd925('0x23')][_0x2d00e3[_0xd925('0x24')]][_0xd925('0x2e')]=_0x2d00e3[_0xd925('0x2e')];this[_0xd925('0x23')][_0x2d00e3[_0xd925('0x24')]][_0xd925('0x2f')]=_0x2d00e3[_0xd925('0x2f')];this['channels'][_0x2d00e3[_0xd925('0x24')]][_0xd925('0x22')]=_0x2d00e3[_0xd925('0x22')];this['channels'][_0x2d00e3[_0xd925('0x24')]][_0xd925('0x30')]=_0x2d00e3[_0xd925('0x30')];logger[_0xd925('0x27')](_0x2d00e3[_0xd925('0x24')],_0xd925('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x2e7749){var _0xe2206c=this;if(this[_0xd925('0x23')][_0x2e7749[_0xd925('0x24')]]){var _0x84e311=this[_0xd925('0x23')][_0x2e7749[_0xd925('0x24')]]['id'];this['channels'][_0x2e7749['uniqueid']]['remotestationid']=_0x2e7749[_0xd925('0x32')];this['channels'][_0x2e7749['uniqueid']][_0xd925('0x33')]=_0x2e7749[_0xd925('0x33')];this[_0xd925('0x23')][_0x2e7749[_0xd925('0x24')]][_0xd925('0x22')]=_0x2e7749[_0xd925('0x22')];this[_0xd925('0x23')][_0x2e7749['uniqueid']][_0xd925('0x34')]=_0x2e7749[_0xd925('0x34')];this[_0xd925('0x23')][_0x2e7749['uniqueid']][_0xd925('0x35')]=_0x2e7749[_0xd925('0x35')];this[_0xd925('0x23')][_0x2e7749[_0xd925('0x24')]][_0xd925('0x30')]=_0x2e7749['filename'];this['channels'][_0x2e7749[_0xd925('0x24')]]['calleridnum']=_0x2e7749[_0xd925('0x36')];if(this[_0xd925('0x23')][_0x2e7749[_0xd925('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x2e7749[_0xd925('0x30')],_0xd925('0x37'),function(_0x3860c3){logger[_0xd925('0x27')](_0x2e7749[_0xd925('0x24')],'\x20result\x20conversion\x20file\x20',_0x3860c3[_0xd925('0x38')]);attachment[_0xd925('0x39')]({'name':path[_0xd925('0x3a')](_0x2e7749[_0xd925('0x30')])['name'],'basename':path[_0xd925('0x3a')](_0x2e7749[_0xd925('0x30')])[_0xd925('0x26')]+'.pdf','type':'application/pdf'})[_0xd925('0x3b')](function(_0x147cbf){faxAccount[_0xd925('0x3c')](_0x84e311,{'from':_0x2e7749[_0xd925('0x36')],'mapKey':_0xd925('0x3d'),'body':path[_0xd925('0x3a')](_0x2e7749['filename'])[_0xd925('0x26')]+_0xd925('0x3e'),'AttachmentId':_0x147cbf['id']})[_0xd925('0x3f')](function(_0x54da62){logger[_0xd925('0x40')](_0x2e7749['uniqueid'],_0xd925('0x41'),JSON[_0xd925('0x42')](_0x54da62));});})[_0xd925('0x3f')](function(_0x13a319){logger['error'](_0x2e7749['uniqueid'],_0xd925('0x43'),JSON[_0xd925('0x42')](_0x13a319));});});}logger[_0xd925('0x27')](_0x2e7749[_0xd925('0x24')],_0xd925('0x43'));}};Fax[_0xd925('0x2a')][_0xd925('0x44')]=function(_0x12b24d){if(this[_0xd925('0x11')][_0x12b24d['uniqueid']]){_[_0xd925('0x45')](this[_0xd925('0x23')][_0x12b24d[_0xd925('0x24')]],_[_0xd925('0x46')](_0x12b24d,['response',_0xd925('0x47')]));}};function updateStatus(_0x44f769){if(_0x44f769['AttachmentId']){faxMessage['update'](_0x44f769[_0xd925('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xd925('0x3b')](function(_0x18fcea){ut[_0xd925('0x49')](_0xd925('0x4a'),_0x18fcea);})[_0xd925('0x3f')](function(_0x43a124){ut[_0xd925('0x49')](_0xd925('0x4b'),_0x43a124);});}else{ut['logger'](_0xd925('0x4c'));}}Fax[_0xd925('0x2a')][_0xd925('0x4d')]=function(_0xfa88e8,_0x1605f6,_0x57fa51){var _0x3c9200=this;var _0x3b7aa8={};if(_0x1605f6){_0x3b7aa8={'read':_0x1605f6};}else{_0x3b7aa8={'failMessage':_0x57fa51};}if(this[_0xd925('0x11')][_0xfa88e8]['AttachmentId']){faxMessage[_0xd925('0x4e')](this[_0xd925('0x11')][_0xfa88e8][_0xd925('0x48')],_0x3b7aa8)['then'](function(_0x4c24e3){ut[_0xd925('0x49')](_0xd925('0x4f'),_0x4c24e3);})['catch'](function(_0x5995d9){ut[_0xd925('0x49')]('[Fax][Message][NoUpdate1]',_0x5995d9);})[_0xd925('0x50')](function(){delete _0x3c9200[_0xd925('0x23')][_0xfa88e8];delete _0x3c9200['actions'][_0xfa88e8];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xd925('0x23')][_0xfa88e8];delete this[_0xd925('0x11')][_0xfa88e8];}};Fax['prototype'][_0xd925('0x1c')]=function(_0x151ac){var _0x2f5b91=this;if(this[_0xd925('0x23')][_0x151ac['uniqueid']]){if(this['actions'][_0x151ac[_0xd925('0x24')]]){this[_0xd925('0x23')][_0x151ac[_0xd925('0x24')]]['id']=this[_0xd925('0x11')][_0x151ac[_0xd925('0x24')]]['id'];this[_0xd925('0x23')][_0x151ac[_0xd925('0x24')]]['name']=this[_0xd925('0x11')][_0x151ac[_0xd925('0x24')]][_0xd925('0x26')];}logger[_0xd925('0x27')](_0x151ac[_0xd925('0x24')],this[_0xd925('0x11')][_0x151ac['uniqueid']]?_0xd925('0x51'):_0xd925('0x52'),JSON[_0xd925('0x42')](this[_0xd925('0x23')][_0x151ac[_0xd925('0x24')]]));if(this[_0xd925('0x11')][_0x151ac[_0xd925('0x24')]]){if(this[_0xd925('0x23')][_0x151ac['uniqueid']][_0xd925('0x53')]>0x0&&this[_0xd925('0x23')][_0x151ac[_0xd925('0x24')]][_0xd925('0x54')]==='SUCCESS'){this[_0xd925('0x4d')](_0x151ac[_0xd925('0x24')],!![]);}else{this[_0xd925('0x4d')](_0x151ac[_0xd925('0x24')],![],this[_0xd925('0x23')][_0x151ac[_0xd925('0x24')]][_0xd925('0x55')]?_0xd925('0x56')+this['channels'][_0x151ac[_0xd925('0x24')]][_0xd925('0x55')]:_0xd925('0x57'));}}}};Fax[_0xd925('0x2a')]['send']=function(_0x2a9677){var _0x56dcc1=this;return new BPromise(function(_0x55e8ee,_0x3fcff2){_0x56dcc1['execOriginate'](_0x2a9677,_0x56dcc1[_0xd925('0xf')][_0x2a9677[_0xd925('0x58')]])[_0xd925('0x3b')](function(_0x28c3b8){ut[_0xd925('0x49')]('[Fax][execOriginate][success]',_0x28c3b8);_0x55e8ee(ut['message'](_0xd925('0x59')));})[_0xd925('0x3f')](function(_0x3102bf){ut[_0xd925('0x49')]('[Fax][execOriginate][failure]',_0x3102bf);updateStatus(_0x2a9677);_0x3fcff2(ut[_0xd925('0x38')](_0xd925('0x5a')));});});};Fax[_0xd925('0x2a')][_0xd925('0x5b')]=function(_0x5940b0){var _0x3c6ae5=this;return new BPromise(function(_0x66e6e9,_0x2d11e9){var _0x3cae6c=_0x3c6ae5[_0xd925('0x5c')](_0x3c6ae5[_0xd925('0xf')][_0x5940b0['FaxAccountId']][_0xd925('0x5d')],_0x5940b0);if(_0x3cae6c['isValid']){_0x66e6e9(ut[_0xd925('0x38')](_0xd925('0x5e')));}else{_0x2d11e9(ut[_0xd925('0x38')](_0x3cae6c[_0xd925('0x38')]));}});};function originate(_0x50096d,_0x2dbb26,_0x3a3bea){return new BPromise(function(_0x534efd,_0x528f3f){if(_0x3a3bea){var _0x4875fe=util[_0xd925('0x5f')](_0xd925('0x60'),path[_0xd925('0x3a')](_0x50096d[_0xd925('0x4')])[_0xd925('0x26')],_0x50096d[_0xd925('0x4')]);gs['execute'](_0x4875fe)['then'](function(){_0x50096d[_0xd925('0x4')]=util['format'](_0xd925('0x61'),path[_0xd925('0x3a')](_0x50096d['path'])[_0xd925('0x62')],path['parse'](_0x50096d[_0xd925('0x4')])['name']);_0x2dbb26[_0xd925('0x63')]=_0x50096d[_0xd925('0x4')];ut[_0xd925('0x49')](_0xd925('0x64'),'');ami[_0xd925('0x65')](ut[_0xd925('0x66')](_0x50096d,_0x2dbb26))[_0xd925('0x3b')](function(_0x34d932){_0x534efd(_0x34d932);})['catch'](function(_0x316cac){_0x528f3f(_0x316cac);});})[_0xd925('0x3f')](function(_0x424fe7){_0x528f3f(_0x424fe7);});}else{ami[_0xd925('0x65')](ut['variablesAction'](_0x50096d,_0x2dbb26))[_0xd925('0x3b')](function(_0x511fd5){_0x534efd(_0x511fd5);})[_0xd925('0x3f')](function(_0x1e28bd){_0x528f3f(_0x1e28bd);});}});}Fax['prototype'][_0xd925('0x67')]=function(_0x13e846,_0x8bc959){var _0x45655e=this;return new BPromise(function(_0x3bc5b1,_0x432375){var _0x41d182=uuid['v4']();var _0x18a0bf=ut[_0xd925('0x68')](_0x13e846,_0x8bc959);_0x45655e[_0xd925('0x11')][_0x41d182]=new Action(_0x41d182,_0x8bc959,_0x13e846);var _0x212073=_0x45655e[_0xd925('0x11')][_0x41d182];if(path[_0xd925('0x3a')](_0x13e846['path'])[_0xd925('0x69')]==='.pdf'){originate(_0x212073,_0x18a0bf,!![])['then'](function(_0x257fd6){_0x3bc5b1(_0x257fd6);})[_0xd925('0x3f')](function(_0x25b54c){_0x432375(_0x25b54c);});}else{originate(_0x212073,_0x18a0bf,![])['then'](function(_0x48b39b){_0x3bc5b1(_0x48b39b);})[_0xd925('0x3f')](function(_0x5cb518){_0x432375(_0x5cb518);});}});};Fax[_0xd925('0x2a')][_0xd925('0x6a')]=function(_0x55d175){return!_['isNil'](_0x55d175)&&!_['isNil'](_0x55d175[_0xd925('0x26')])&&!_[_0xd925('0x6b')](_0x55d175[_0xd925('0x6c')])&&_0x55d175[_0xd925('0x6c')]&&!_['isNil'](this['trunks'][util['format'](_0xd925('0x6d'),_0x55d175[_0xd925('0x26')])])&&!_[_0xd925('0x6b')](this[_0xd925('0x10')][util[_0xd925('0x5f')](_0xd925('0x6d'),_0x55d175[_0xd925('0x26')])][_0xd925('0x2f')])&&(this[_0xd925('0x10')][util[_0xd925('0x5f')](_0xd925('0x6d'),_0x55d175[_0xd925('0x26')])][_0xd925('0x2f')]===_0xd925('0x6e')||this[_0xd925('0x10')][util[_0xd925('0x5f')](_0xd925('0x6d'),_0x55d175['name'])][_0xd925('0x2f')]===_0xd925('0x6f'));};Fax[_0xd925('0x2a')]['checkTrunk']=function(_0xcc54ea,_0x2d00e0){if(!this[_0xd925('0x6a')](_0xcc54ea)){ut[_0xd925('0x49')](_0xd925('0x70'),_[_0xd925('0x6b')](_0xcc54ea)?'':_0xcc54ea[_0xd925('0x26')]+_0xd925('0x71'));return{'isValid':![],'message':_0xd925('0x72')};}if(_[_0xd925('0x6b')](_0x2d00e0[_0xd925('0x3d')])){ut[_0xd925('0x49')](_0xd925('0x73'),JSON['stringify'](_0x2d00e0));return{'isValid':![],'message':_0xd925('0x74')};}if(_['isNil'](_0x2d00e0[_0xd925('0x4')])){ut[_0xd925('0x49')](_0xd925('0x75'),JSON[_0xd925('0x42')](_0x2d00e0));return{'isValid':![],'message':_0xd925('0x76')};}return{'isValid':!![],'message':_0xd925('0x77')};};module[_0xd925('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2c52634..53dca9c 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 _0x4455=['notify','catch','util','bluebird','preview','lodash','../rpc/faxAccount','error','resolve','then'];(function(_0x428b82,_0x227533){var _0x397634=function(_0x32a6c6){while(--_0x32a6c6){_0x428b82['push'](_0x428b82['shift']());}};_0x397634(++_0x227533);}(_0x4455,0x106));var _0x5445=function(_0x40e007,_0x36c661){_0x40e007=_0x40e007-0x0;var _0x1a0e13=_0x4455[_0x40e007];return _0x1a0e13;};'use strict';var util=require(_0x5445('0x0'));var BPromise=require(_0x5445('0x1'));var logger=require('../../../config/logger')(_0x5445('0x2'));var _=require(_0x5445('0x3'));var faxAccount=require(_0x5445('0x4'));function loggerCatch(_0x5ca54c){return function(_0x32178e){logger[_0x5445('0x5')](_0x5ca54c,util['inspect'](_0x32178e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2d7b96,_0x4285e6){return BPromise[_0x5445('0x6')]()[_0x5445('0x7')](faxAccount[_0x5445('0x8')](_0x2d7b96,_0x4285e6))[_0x5445('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xd6a9=['bluebird','lodash','error','inspect','notify','[Notify]\x20'];(function(_0xed4e3c,_0x39e976){var _0x4297cc=function(_0x5a0cb8){while(--_0x5a0cb8){_0xed4e3c['push'](_0xed4e3c['shift']());}};_0x4297cc(++_0x39e976);}(_0xd6a9,0xa8));var _0x9d6a=function(_0x57adca,_0x59e980){_0x57adca=_0x57adca-0x0;var _0x4f855d=_0xd6a9[_0x57adca];return _0x4f855d;};'use strict';var util=require('util');var BPromise=require(_0x9d6a('0x0'));var logger=require('../../../config/logger')('preview');var _=require(_0x9d6a('0x1'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x567b79){return function(_0x324b9b){logger[_0x9d6a('0x2')](_0x567b79,util[_0x9d6a('0x3')](_0x324b9b,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x36f894,_0x5ed641){return BPromise['resolve']()['then'](faxAccount[_0x9d6a('0x4')](_0x36f894,_0x5ed641))['catch'](loggerCatch(_0x9d6a('0x5')));}; \ 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 47053cb..95ba5d2 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 _0x7e43=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x4db8f7,_0x297b9a){var _0x51a5ff=function(_0x37ff65){while(--_0x37ff65){_0x4db8f7['push'](_0x4db8f7['shift']());}};_0x51a5ff(++_0x297b9a);}(_0x7e43,0xe0));var _0x37e4=function(_0x4f9601,_0x1983b6){_0x4f9601=_0x4f9601-0x0;var _0x31ce58=_0x7e43[_0x4f9601];return _0x31ce58;};'use strict';var util=require(_0x37e4('0x0'));var logger=require(_0x37e4('0x1'))(_0x37e4('0x2'));var BPromise=require(_0x37e4('0x3'));var exec=require(_0x37e4('0x4'))[_0x37e4('0x5')];exports['execute']=function(_0xbaf0f){return new BPromise(function(_0x3f49ed,_0x132b2c){exec(_0xbaf0f,function(_0x1a163d,_0x284e5c,_0x35e55d){logger[_0x37e4('0x6')](_0x37e4('0x7'),_0x284e5c);if(_0x1a163d){logger[_0x37e4('0x6')]('Exec\x20gs',_0x37e4('0x8'),util[_0x37e4('0x9')](_0x1a163d,{'showHidden':![],'depth':null}),_0x284e5c,_0x35e55d);_0x132b2c(_0x1a163d);}_0x3f49ed(_0x284e5c);});});}; \ No newline at end of file +var _0x10c5=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x10c5,0xe6));var _0x510c=function(_0x5e735f,_0x19f6b1){_0x5e735f=_0x5e735f-0x0;var _0x51cdfb=_0x10c5[_0x5e735f];return _0x51cdfb;};'use strict';var util=require(_0x510c('0x0'));var logger=require(_0x510c('0x1'))(_0x510c('0x2'));var BPromise=require(_0x510c('0x3'));var exec=require(_0x510c('0x4'))[_0x510c('0x5')];exports[_0x510c('0x6')]=function(_0x14c616){return new BPromise(function(_0x434477,_0x5a526b){exec(_0x14c616,function(_0x4a1171,_0xe4cc66,_0x184148){logger[_0x510c('0x7')]('Exec\x20gs',_0xe4cc66);if(_0x4a1171){logger[_0x510c('0x7')](_0x510c('0x8'),_0x510c('0x9'),util['inspect'](_0x4a1171,{'showHidden':![],'depth':null}),_0xe4cc66,_0x184148);_0x5a526b(_0x4a1171);}_0x434477(_0xe4cc66);});});}; \ 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 b5dadff..4a65917 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 _0xbcc0=['../../../../config/logger','fax','logger','info','inspect','addVariables','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','lodash','moment'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0xbcc0,0x1e1));var _0x0bcc=function(_0x239aa5,_0x88ac40){_0x239aa5=_0x239aa5-0x0;var _0x1251a5=_0xbcc0[_0x239aa5];return _0x1251a5;};'use strict';var util=require('util');var _=require(_0x0bcc('0x0'));var moment=require(_0x0bcc('0x1'));var logger=require(_0x0bcc('0x2'))(_0x0bcc('0x3'));exports['message']=function(_0xeab215){return{'message':_0xeab215};};exports[_0x0bcc('0x4')]=function(_0x501dd6,_0x17bbfa){logger[_0x0bcc('0x5')](_0x501dd6,util[_0x0bcc('0x6')](_0x17bbfa,{'showHidden':![],'depth':null}));};exports[_0x0bcc('0x7')]=function(_0x59c17f,_0x411b13){var _0x3df919={'XMF-ECM':_0x411b13['ecm'],'XMF-HEADERINFO':_0x411b13[_0x0bcc('0x8')],'XMF-MINRATE':_0x411b13[_0x0bcc('0x9')],'XMF-MAXRATE':_0x411b13['maxrate'],'XMF-MODEM':util[_0x0bcc('0xa')](_0x0bcc('0xb'),_0x411b13[_0x0bcc('0xc')]),'XMF-GATEWAY':_0x411b13[_0x0bcc('0xd')],'XMF-FAXDETECT':_0x411b13[_0x0bcc('0xe')],'XMF-T38TIMEOUT':_0x411b13['t38timeout'],'XMF-LOCALSTATIONID':_0x411b13[_0x0bcc('0xf')],'XMF-PATH':_0x59c17f[_0x0bcc('0x10')]};return _0x3df919;};exports['variablesAction']=function(_0x3fc62a,_0x473ebc){return{'actionid':_0x3fc62a[_0x0bcc('0x11')],'action':'originate','channel':_0x3fc62a[_0x0bcc('0x12')],'Exten':_0x0bcc('0x13'),'Context':_0x0bcc('0x14'),'Priority':'1','callerid':util[_0x0bcc('0xa')]('\x22%s\x22\x20<%s>',_0x3fc62a['headerinfo']?_0x3fc62a[_0x0bcc('0x8')]:'',_0x3fc62a[_0x0bcc('0xf')]),'variable':_0x473ebc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3fc62a[_0x0bcc('0x11')]};}; \ No newline at end of file +var _0x9c1b=['from-sip','format','util','lodash','moment','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax'];(function(_0x592cb0,_0x3e35cb){var _0x464c30=function(_0x34f158){while(--_0x34f158){_0x592cb0['push'](_0x592cb0['shift']());}};_0x464c30(++_0x3e35cb);}(_0x9c1b,0x98));var _0xb9c1=function(_0x2e79dd,_0x59fcaf){_0x2e79dd=_0x2e79dd-0x0;var _0x113a76=_0x9c1b[_0x2e79dd];return _0x113a76;};'use strict';var util=require(_0xb9c1('0x0'));var _=require(_0xb9c1('0x1'));var moment=require(_0xb9c1('0x2'));var logger=require('../../../../config/logger')(_0xb9c1('0x3'));exports[_0xb9c1('0x4')]=function(_0x420e4e){return{'message':_0x420e4e};};exports[_0xb9c1('0x5')]=function(_0x3b53b9,_0x514e29){logger[_0xb9c1('0x6')](_0x3b53b9,util[_0xb9c1('0x7')](_0x514e29,{'showHidden':![],'depth':null}));};exports[_0xb9c1('0x8')]=function(_0x2bc1e5,_0xc0b83e){var _0xa6cdd5={'XMF-ECM':_0xc0b83e['ecm'],'XMF-HEADERINFO':_0xc0b83e[_0xb9c1('0x9')],'XMF-MINRATE':_0xc0b83e[_0xb9c1('0xa')],'XMF-MAXRATE':_0xc0b83e[_0xb9c1('0xb')],'XMF-MODEM':util['format']('\x22%s\x22',_0xc0b83e[_0xb9c1('0xc')]),'XMF-GATEWAY':_0xc0b83e[_0xb9c1('0xd')],'XMF-FAXDETECT':_0xc0b83e[_0xb9c1('0xe')],'XMF-T38TIMEOUT':_0xc0b83e[_0xb9c1('0xf')],'XMF-LOCALSTATIONID':_0xc0b83e[_0xb9c1('0x10')],'XMF-PATH':_0x2bc1e5[_0xb9c1('0x11')]};return _0xa6cdd5;};exports[_0xb9c1('0x12')]=function(_0x1c48bf,_0x317cb4){return{'actionid':_0x1c48bf[_0xb9c1('0x13')],'action':_0xb9c1('0x14'),'channel':_0x1c48bf[_0xb9c1('0x15')],'Exten':_0xb9c1('0x16'),'Context':_0xb9c1('0x17'),'Priority':'1','callerid':util[_0xb9c1('0x18')]('\x22%s\x22\x20<%s>',_0x1c48bf[_0xb9c1('0x9')]?_0x1c48bf[_0xb9c1('0x9')]:'',_0x1c48bf['localstationid']),'variable':_0x317cb4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1c48bf['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1eb7715..0b92538 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 _0x9174=['getCampaigns','initCampaigns','getVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','listen','sync','catch','error','[index.js][main]','inspect','bluebird','util','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts'];(function(_0x48209c,_0xeefee1){var _0x289d49=function(_0x303a96){while(--_0x303a96){_0x48209c['push'](_0x48209c['shift']());}};_0x289d49(++_0xeefee1);}(_0x9174,0xcf));var _0x4917=function(_0x2243bb,_0x505761){_0x2243bb=_0x2243bb-0x0;var _0x5e203a=_0x9174[_0x2243bb];return _0x5e203a;};'use strict';var BPromise=require(_0x4917('0x0'));var util=require(_0x4917('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x4917('0x2'));var Report=require(_0x4917('0x3'));var Acw=require(_0x4917('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x4917('0x5'));var Preview=require(_0x4917('0x6'));var Fax=require(_0x4917('0x7'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x4917('0x8'));var voiceCallReport=require(_0x4917('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x4917('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x4917('0xb'));var campaign=require(_0x4917('0xc'));var voiceExtension=require(_0x4917('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x4917('0xe'));var sugarcrm=require(_0x4917('0xf'));var freshdesk=require(_0x4917('0x10'));var desk=require(_0x4917('0x11'));var zoho=require(_0x4917('0x12'));var vtiger=require(_0x4917('0x13'));var freshsales=require(_0x4917('0x14'));var servicenow=require(_0x4917('0x15'));var dynamics365=require(_0x4917('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(_0x4917('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4917('0x18')](_0x4917('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4917('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4917('0x1a')]()[_0x4917('0x1b')](user[_0x4917('0x1c')]())[_0x4917('0x1b')](realtime[_0x4917('0x1d')]())['then'](user['getTelephones']())['then'](realtime[_0x4917('0x1e')]())['then'](trunk[_0x4917('0x1f')]())[_0x4917('0x1b')](realtime[_0x4917('0x20')]())['then'](voiceQueue[_0x4917('0x21')]())['then'](realtime[_0x4917('0x22')]())[_0x4917('0x1b')](trigger[_0x4917('0x23')]())[_0x4917('0x1b')](realtime[_0x4917('0x24')]())[_0x4917('0x1b')](template[_0x4917('0x25')]())[_0x4917('0x1b')](realtime[_0x4917('0x26')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0x4917('0x1b')](salesforce['getSalesforceAccounts']())[_0x4917('0x1b')](realtime['initSalesforceAccounts']())['then'](sugarcrm['getSugarcrmAccounts']())[_0x4917('0x1b')](realtime[_0x4917('0x27')]())[_0x4917('0x1b')](freshdesk[_0x4917('0x28')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0x4917('0x29')]())[_0x4917('0x1b')](realtime[_0x4917('0x2a')]())['then'](zoho['getZohoAccounts']())[_0x4917('0x1b')](realtime[_0x4917('0x2b')]())[_0x4917('0x1b')](vtiger['getVtigerAccounts']())[_0x4917('0x1b')](realtime[_0x4917('0x2c')]())[_0x4917('0x1b')](freshsales[_0x4917('0x2d')]())[_0x4917('0x1b')](realtime[_0x4917('0x2e')]())[_0x4917('0x1b')](servicenow[_0x4917('0x2f')]())['then'](realtime['initServicenowAccounts']())[_0x4917('0x1b')](dynamics365['getDynamics365Accounts']())[_0x4917('0x1b')](realtime[_0x4917('0x30')]())[_0x4917('0x1b')](campaign[_0x4917('0x31')]())['then'](realtime[_0x4917('0x32')]())[_0x4917('0x1b')](voiceExtension[_0x4917('0x33')]())[_0x4917('0x1b')](realtime['initVoiceExtensions']())[_0x4917('0x1b')](faxAccount['getFaxAccounts']())['then'](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x4917('0x1a')]()[_0x4917('0x1b')](voiceQueueReport[_0x4917('0x34')]())[_0x4917('0x1b')](realtime[_0x4917('0x35')]())[_0x4917('0x1b')](cmHopperHistory[_0x4917('0x36')]())[_0x4917('0x1b')](realtime[_0x4917('0x37')]())['then'](cmHopperHistory[_0x4917('0x38')]())['then'](realtime[_0x4917('0x39')]())[_0x4917('0x1b')](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x50ee61){logger['error']('[index.js][initParams]',util['inspect'](_0x50ee61,{'showHidden':![],'depth':null}));});}function main(){return server[_0x4917('0x3a')](realtime,preview,fax)[_0x4917('0x1b')](function(_0x46d599){return initRealtime();})[_0x4917('0x1b')](function(){return initParams();})[_0x4917('0x1b')](function(){report[_0x4917('0x3b')]();setInterval(initRealtime,0x1388);})[_0x4917('0x3c')](function(_0x2318b5){logger[_0x4917('0x3d')](_0x4917('0x3e'),util[_0x4917('0x3f')](_0x2318b5,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x6d19=['getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','../../config/logger','get','hour','getAgents','then','initAgents','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x772312,_0x29ba1f){var _0x277299=function(_0x1453bb){while(--_0x1453bb){_0x772312['push'](_0x772312['shift']());}};_0x277299(++_0x29ba1f);}(_0x6d19,0x1a5));var _0x96d1=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x6d19[_0x1d50f2];return _0x3769b8;};'use strict';var BPromise=require('bluebird');var util=require(_0x96d1('0x0'));var moment=require(_0x96d1('0x1'));var server=require(_0x96d1('0x2'));var Realtime=require('./realtime');var Report=require(_0x96d1('0x3'));var Acw=require(_0x96d1('0x4'));var Trigger=require(_0x96d1('0x5'));var Dialer=require('./dialer');var Preview=require(_0x96d1('0x6'));var Fax=require(_0x96d1('0x7'));var user=require('./rpc/user');var voiceQueue=require(_0x96d1('0x8'));var voiceQueueReport=require(_0x96d1('0x9'));var voiceCallReport=require(_0x96d1('0xa'));var trunk=require(_0x96d1('0xb'));var trigger=require(_0x96d1('0xc'));var template=require(_0x96d1('0xd'));var cmHopperHistory=require(_0x96d1('0xe'));var campaign=require(_0x96d1('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x96d1('0x10'));var freshdesk=require(_0x96d1('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x96d1('0x12'));var vtiger=require(_0x96d1('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x96d1('0x14'));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(_0x96d1('0x15'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x96d1('0x16')](_0x96d1('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x96d1('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x96d1('0x18')]())[_0x96d1('0x19')](realtime[_0x96d1('0x1a')]())[_0x96d1('0x19')](user[_0x96d1('0x1b')]())[_0x96d1('0x19')](realtime['initTelephones']())[_0x96d1('0x19')](trunk[_0x96d1('0x1c')]())['then'](realtime[_0x96d1('0x1d')]())[_0x96d1('0x19')](voiceQueue['getVoiceQueues']())[_0x96d1('0x19')](realtime[_0x96d1('0x1e')]())['then'](trigger[_0x96d1('0x1f')]())[_0x96d1('0x19')](realtime[_0x96d1('0x20')]())[_0x96d1('0x19')](template[_0x96d1('0x21')]())[_0x96d1('0x19')](realtime[_0x96d1('0x22')]())[_0x96d1('0x19')](zendesk['getZendeskAccounts']())[_0x96d1('0x19')](realtime['initZendeskAccounts']())[_0x96d1('0x19')](salesforce[_0x96d1('0x23')]())[_0x96d1('0x19')](realtime[_0x96d1('0x24')]())[_0x96d1('0x19')](sugarcrm[_0x96d1('0x25')]())[_0x96d1('0x19')](realtime[_0x96d1('0x26')]())[_0x96d1('0x19')](freshdesk[_0x96d1('0x27')]())[_0x96d1('0x19')](realtime[_0x96d1('0x28')]())[_0x96d1('0x19')](desk[_0x96d1('0x29')]())['then'](realtime[_0x96d1('0x2a')]())[_0x96d1('0x19')](zoho[_0x96d1('0x2b')]())['then'](realtime[_0x96d1('0x2c')]())[_0x96d1('0x19')](vtiger[_0x96d1('0x2d')]())[_0x96d1('0x19')](realtime[_0x96d1('0x2e')]())[_0x96d1('0x19')](freshsales[_0x96d1('0x2f')]())['then'](realtime[_0x96d1('0x30')]())[_0x96d1('0x19')](servicenow['getServicenowAccounts']())['then'](realtime[_0x96d1('0x31')]())[_0x96d1('0x19')](dynamics365[_0x96d1('0x32')]())[_0x96d1('0x19')](realtime['initDynamics365Accounts']())[_0x96d1('0x19')](campaign[_0x96d1('0x33')]())[_0x96d1('0x19')](realtime['initCampaigns']())[_0x96d1('0x19')](voiceExtension[_0x96d1('0x34')]())[_0x96d1('0x19')](realtime[_0x96d1('0x35')]())['then'](faxAccount[_0x96d1('0x36')]())[_0x96d1('0x19')](realtime['initFaxAccounts']())[_0x96d1('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x96d1('0x19')](realtime[_0x96d1('0x37')]())[_0x96d1('0x19')](cmHopperHistory[_0x96d1('0x38')]())[_0x96d1('0x19')](realtime['initVoiceQueueHopperHistory']())[_0x96d1('0x19')](cmHopperHistory[_0x96d1('0x39')]())[_0x96d1('0x19')](realtime[_0x96d1('0x3a')]())[_0x96d1('0x19')](voiceCallReport[_0x96d1('0x3b')]())[_0x96d1('0x19')](realtime[_0x96d1('0x3c')]())[_0x96d1('0x3d')](function(_0x265087){logger[_0x96d1('0x3e')](_0x96d1('0x3f'),util[_0x96d1('0x40')](_0x265087,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x96d1('0x19')](function(_0x32fe69){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x96d1('0x3d')](function(_0x32ccf0){logger[_0x96d1('0x3e')](_0x96d1('0x41'),util[_0x96d1('0x40')](_0x32ccf0,{'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 8006133..44663f9 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x50792f,_0x14307d){var _0x113d60=function(_0x549d18){while(--_0x549d18){_0x50792f['push'](_0x50792f['shift']());}};_0x113d60(++_0x14307d);}(_0xe706,0xa3));var _0x6e70=function(_0x360319,_0x1cd1ee){_0x360319=_0x360319-0x0;var _0x4062fb=_0xe706[_0x360319];return _0x4062fb;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xedd9,0xfc));var _0x9edd=function(_0x295833,_0x345a8d){_0x295833=_0x295833-0x0;var _0x17724d=_0xedd9[_0x295833];return _0x17724d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index a7d6ee1..f622993 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 _0x9875=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9875,0xae));var _0x5987=function(_0x418be7,_0x1ef19f){_0x418be7=_0x418be7-0x0;var _0x4eac33=_0x9875[_0x418be7];return _0x4eac33;};'use strict';function Campaign(_0x2fee82){this['id']=_0x2fee82['id']||0x0;this[_0x5987('0x0')]=_0x2fee82[_0x5987('0x0')]||'';this[_0x5987('0x1')]=_0x2fee82[_0x5987('0x1')]||'campaign';this[_0x5987('0x2')]=0x0;this[_0x5987('0x3')]=0x0;this[_0x5987('0x4')]=0x0;this[_0x5987('0x5')]=0x0;this[_0x5987('0x6')]='';this[_0x5987('0x7')]=!![];this['active']=_0x2fee82['active'];this['limitCalls']=_0x2fee82[_0x5987('0x8')];this[_0x5987('0x9')]=_0x2fee82[_0x5987('0x9')]||null;this['dialGlobalInterval']=_0x2fee82['dialGlobalInterval']?_0x2fee82[_0x5987('0xa')]:null;this[_0x5987('0xb')]=_0x2fee82[_0x5987('0xb')];this[_0x5987('0xc')]=_0x2fee82[_0x5987('0xc')];this[_0x5987('0xd')]=_0x2fee82[_0x5987('0xd')]||0x1e;this[_0x5987('0xe')]=_0x2fee82[_0x5987('0xe')];this['dialCongestionRetryFrequency']=_0x2fee82[_0x5987('0xf')];this[_0x5987('0x10')]=_0x2fee82[_0x5987('0x10')];this[_0x5987('0x11')]=_0x2fee82[_0x5987('0x11')];this[_0x5987('0x12')]=_0x2fee82[_0x5987('0x12')];this[_0x5987('0x13')]=_0x2fee82['dialNoAnswerRetryFrequency'];this[_0x5987('0x14')]=_0x2fee82[_0x5987('0x14')];this[_0x5987('0x15')]=_0x2fee82[_0x5987('0x15')]||0x3;this[_0x5987('0x16')]=_0x2fee82[_0x5987('0x16')]||0x96;this[_0x5987('0x17')]=_0x2fee82[_0x5987('0x17')]||0x3;this[_0x5987('0x18')]=_0x2fee82[_0x5987('0x18')]||0x96;this[_0x5987('0x19')]=_0x2fee82[_0x5987('0x19')]||0x3;this[_0x5987('0x1a')]=_0x2fee82[_0x5987('0x1a')]||0x96;this[_0x5987('0x1b')]=_0x2fee82[_0x5987('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x2fee82[_0x5987('0x1c')]||0x96;this[_0x5987('0x1d')]=_0x2fee82[_0x5987('0x1d')]||0x3;this[_0x5987('0x1e')]=_0x2fee82[_0x5987('0x1e')]||0x96;this[_0x5987('0x1f')]=_0x2fee82['dialOrderByScheduledAt']||'DESC';this[_0x5987('0x20')]=_0x2fee82[_0x5987('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2fee82['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x2fee82[_0x5987('0x21')]||undefined;this[_0x5987('0x22')]=_0x2fee82['TrunkBackup']?_0x2fee82[_0x5987('0x22')]:undefined;this[_0x5987('0x23')]=_0x2fee82[_0x5987('0x23')]?_0x2fee82[_0x5987('0x23')]:undefined;this[_0x5987('0x24')]=_0x2fee82[_0x5987('0x24')]?_0x2fee82[_0x5987('0x24')]:undefined;this[_0x5987('0x25')]=_0x2fee82[_0x5987('0x25')]?_0x2fee82[_0x5987('0x25')]:undefined;this['dialQueueProject']=_0x2fee82[_0x5987('0x25')]?_0x2fee82[_0x5987('0x25')]['name']:undefined;this['dialAMDActive']=_0x2fee82[_0x5987('0x26')]||![];this[_0x5987('0x27')]=_0x2fee82[_0x5987('0x27')];this['dialAMDGreeting']=_0x2fee82['dialAMDGreeting'];this[_0x5987('0x28')]=_0x2fee82[_0x5987('0x28')];this[_0x5987('0x29')]=_0x2fee82[_0x5987('0x29')];this[_0x5987('0x2a')]=_0x2fee82[_0x5987('0x2a')];this[_0x5987('0x2b')]=_0x2fee82[_0x5987('0x2b')];this[_0x5987('0x2c')]=_0x2fee82[_0x5987('0x2c')];this['dialAMDSilenceThreshold']=_0x2fee82[_0x5987('0x2d')];this['dialAMDMaximumWordLength']=_0x2fee82[_0x5987('0x2e')];}module[_0x5987('0x2f')]=Campaign; \ No newline at end of file +var _0x986e=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x986e,0x15e));var _0xe986=function(_0x2f63b9,_0x156b05){_0x2f63b9=_0x2f63b9-0x0;var _0x145472=_0x986e[_0x2f63b9];return _0x145472;};'use strict';function Campaign(_0x415b2d){this['id']=_0x415b2d['id']||0x0;this[_0xe986('0x0')]=_0x415b2d[_0xe986('0x0')]||'';this[_0xe986('0x1')]=_0x415b2d[_0xe986('0x1')]||_0xe986('0x2');this['originated']=0x0;this[_0xe986('0x3')]=0x0;this[_0xe986('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xe986('0x5')]=!![];this[_0xe986('0x6')]=_0x415b2d[_0xe986('0x6')];this['limitCalls']=_0x415b2d[_0xe986('0x7')];this['dialTimezone']=_0x415b2d[_0xe986('0x8')]||null;this[_0xe986('0x9')]=_0x415b2d[_0xe986('0x9')]?_0x415b2d[_0xe986('0x9')]:null;this[_0xe986('0xa')]=_0x415b2d['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x415b2d['dialOriginateCallerIdNumber'];this[_0xe986('0xb')]=_0x415b2d[_0xe986('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x415b2d[_0xe986('0xc')];this[_0xe986('0xd')]=_0x415b2d[_0xe986('0xd')];this['dialBusyMaxRetry']=_0x415b2d[_0xe986('0xe')];this[_0xe986('0xf')]=_0x415b2d[_0xe986('0xf')];this[_0xe986('0x10')]=_0x415b2d[_0xe986('0x10')];this[_0xe986('0x11')]=_0x415b2d[_0xe986('0x11')];this[_0xe986('0x12')]=_0x415b2d[_0xe986('0x12')];this['dialNoSuchNumberMaxRetry']=_0x415b2d[_0xe986('0x13')]||0x3;this[_0xe986('0x14')]=_0x415b2d[_0xe986('0x14')]||0x96;this[_0xe986('0x15')]=_0x415b2d[_0xe986('0x15')]||0x3;this['dialDropRetryFrequency']=_0x415b2d[_0xe986('0x16')]||0x96;this[_0xe986('0x17')]=_0x415b2d[_0xe986('0x17')]||0x3;this[_0xe986('0x18')]=_0x415b2d[_0xe986('0x18')]||0x96;this['dialMachineMaxRetry']=_0x415b2d[_0xe986('0x19')]||0x3;this[_0xe986('0x1a')]=_0x415b2d['dialMachineRetryFrequency']||0x96;this[_0xe986('0x1b')]=_0x415b2d[_0xe986('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x415b2d['dialAgentRejectRetryFrequency']||0x96;this[_0xe986('0x1c')]=_0x415b2d[_0xe986('0x1c')]||'DESC';this[_0xe986('0x1d')]=_0x415b2d[_0xe986('0x1d')]||undefined;this[_0xe986('0x1e')]=_0x415b2d[_0xe986('0x1e')]||undefined;this['dialCutDigit']=_0x415b2d[_0xe986('0x1f')]||undefined;this[_0xe986('0x20')]=_0x415b2d[_0xe986('0x20')]?_0x415b2d[_0xe986('0x20')]:undefined;this[_0xe986('0x21')]=_0x415b2d[_0xe986('0x21')]?_0x415b2d[_0xe986('0x21')]:undefined;this[_0xe986('0x22')]=_0x415b2d['Interval']?_0x415b2d[_0xe986('0x22')]:undefined;this[_0xe986('0x23')]=_0x415b2d[_0xe986('0x23')]?_0x415b2d[_0xe986('0x23')]:undefined;this[_0xe986('0x24')]=_0x415b2d['SquareProject']?_0x415b2d['SquareProject'][_0xe986('0x0')]:undefined;this[_0xe986('0x25')]=_0x415b2d[_0xe986('0x25')]||![];this['dialAMDInitialSilence']=_0x415b2d[_0xe986('0x26')];this[_0xe986('0x27')]=_0x415b2d['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x415b2d[_0xe986('0x28')];this['dialAMDTotalAnalysisTime']=_0x415b2d[_0xe986('0x29')];this['dialAMDMinWordLength']=_0x415b2d[_0xe986('0x2a')];this[_0xe986('0x2b')]=_0x415b2d['dialAMDBetweenWordsSilence'];this[_0xe986('0x2c')]=_0x415b2d[_0xe986('0x2c')];this['dialAMDSilenceThreshold']=_0x415b2d[_0xe986('0x2d')];this[_0xe986('0x2e')]=_0x415b2d[_0xe986('0x2e')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 4edb9bc..570eb5c 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 _0xeaab=['mohtime','starttime','destinationchannel','calleridnum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum','transferType'];(function(_0x2b7703,_0xecf1ee){var _0xef0157=function(_0x89c340){while(--_0x89c340){_0x2b7703['push'](_0x2b7703['shift']());}};_0xef0157(++_0xecf1ee);}(_0xeaab,0xd9));var _0xbeaa=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xeaab[_0x19e35c];return _0x3e1fe8;};'use strict';function Channel(){this[_0xbeaa('0x0')]=null;this['channel']='';this[_0xbeaa('0x1')]='';this[_0xbeaa('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xbeaa('0x3')]=undefined;this[_0xbeaa('0x4')]=0x0;this[_0xbeaa('0x5')]='';this[_0xbeaa('0x6')]=0x0;this[_0xbeaa('0x7')]=0x0;this[_0xbeaa('0x8')]=0x0;this[_0xbeaa('0x9')]=![];this[_0xbeaa('0xa')]=null;this[_0xbeaa('0xb')]=null;this[_0xbeaa('0xc')]=![];this[_0xbeaa('0xd')]=![];this[_0xbeaa('0xe')]='';this[_0xbeaa('0xf')]='';this[_0xbeaa('0x10')]=0x0;this['billableseconds']=0x0;this[_0xbeaa('0x11')]=0x0;this[_0xbeaa('0x12')]=null;this[_0xbeaa('0x13')]=null;this[_0xbeaa('0x14')]=null;this[_0xbeaa('0x15')]=![];this[_0xbeaa('0x16')]=null;this[_0xbeaa('0x17')]=null;this['monitors']=[];this[_0xbeaa('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xbeaa('0x19')]=undefined;this[_0xbeaa('0x1a')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x0f97=['queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answertime','endtime','unmanaged','abandoned','duration','billableseconds','holdtime','type'];(function(_0x5788b0,_0x4f6845){var _0x4bf835=function(_0x24b10b){while(--_0x24b10b){_0x5788b0['push'](_0x5788b0['shift']());}};_0x4bf835(++_0x4f6845);}(_0x0f97,0x196));var _0x70f9=function(_0x2493a8,_0x5a240d){_0x2493a8=_0x2493a8-0x0;var _0x2b06c9=_0x0f97[_0x2493a8];return _0x2b06c9;};'use strict';function Channel(){this[_0x70f9('0x0')]=null;this[_0x70f9('0x1')]='';this[_0x70f9('0x2')]='';this[_0x70f9('0x3')]=0x0;this[_0x70f9('0x4')]='';this[_0x70f9('0x5')]=undefined;this[_0x70f9('0x6')]=undefined;this[_0x70f9('0x7')]=0x0;this[_0x70f9('0x8')]='';this[_0x70f9('0x9')]=0x0;this[_0x70f9('0xa')]=0x0;this['exten']=0x0;this['answered']=![];this[_0x70f9('0xb')]=null;this[_0x70f9('0xc')]=null;this[_0x70f9('0xd')]=![];this[_0x70f9('0xe')]=![];this['lastapplication']='';this['lastdata']='';this[_0x70f9('0xf')]=0x0;this[_0x70f9('0x10')]=0x0;this[_0x70f9('0x11')]=0x0;this[_0x70f9('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x70f9('0x13')]=null;this[_0x70f9('0x14')]=[];this[_0x70f9('0x15')]=undefined;this[_0x70f9('0x16')]=undefined;this['transferType']=undefined;this[_0x70f9('0x17')]=0x0;}module[_0x70f9('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index cff2096..3ba309b 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 _0x83ee=['consumerSecret','token','tokenSecret','type','Configurations','exports','username','remoteUri','authType','password','consumerKey'];(function(_0xb3cec2,_0x1f049f){var _0x1bd89f=function(_0x3d7d69){while(--_0x3d7d69){_0xb3cec2['push'](_0xb3cec2['shift']());}};_0x1bd89f(++_0x1f049f);}(_0x83ee,0x15b));var _0xe83e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x83ee[_0x21aec3];return _0x288bbc;};'use strict';function DeskAccount(_0x3c9812){this['id']=_0x3c9812['id']||0x0;this['name']=_0x3c9812['name']||'';this[_0xe83e('0x0')]=_0x3c9812['username']||'';this['remoteUri']=_0x3c9812[_0xe83e('0x1')]||'';this[_0xe83e('0x2')]=_0x3c9812[_0xe83e('0x2')]||'';this[_0xe83e('0x3')]=_0x3c9812[_0xe83e('0x3')]||'';this['consumerKey']=_0x3c9812[_0xe83e('0x4')]||'';this['consumerSecret']=_0x3c9812[_0xe83e('0x5')]||'';this[_0xe83e('0x6')]=_0x3c9812[_0xe83e('0x6')]||'';this[_0xe83e('0x7')]=_0x3c9812[_0xe83e('0x7')]||'';this[_0xe83e('0x8')]=_0x3c9812[_0xe83e('0x8')]||'';this['serverUrl']=_0x3c9812['serverUrl']||'';this[_0xe83e('0x9')]=_0x3c9812['Configurations']||{};}module[_0xe83e('0xa')]=DeskAccount; \ No newline at end of file +var _0x506d=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey'];(function(_0x3700f0,_0x108202){var _0x326460=function(_0x127d7d){while(--_0x127d7d){_0x3700f0['push'](_0x3700f0['shift']());}};_0x326460(++_0x108202);}(_0x506d,0x72));var _0xd506=function(_0x3f2c5f,_0xe3ed8e){_0x3f2c5f=_0x3f2c5f-0x0;var _0x4faf03=_0x506d[_0x3f2c5f];return _0x4faf03;};'use strict';function DeskAccount(_0x401eb7){this['id']=_0x401eb7['id']||0x0;this[_0xd506('0x0')]=_0x401eb7[_0xd506('0x0')]||'';this['username']=_0x401eb7[_0xd506('0x1')]||'';this[_0xd506('0x2')]=_0x401eb7[_0xd506('0x2')]||'';this[_0xd506('0x3')]=_0x401eb7[_0xd506('0x3')]||'';this['password']=_0x401eb7[_0xd506('0x4')]||'';this[_0xd506('0x5')]=_0x401eb7[_0xd506('0x5')]||'';this['consumerSecret']=_0x401eb7[_0xd506('0x6')]||'';this[_0xd506('0x7')]=_0x401eb7['token']||'';this[_0xd506('0x8')]=_0x401eb7[_0xd506('0x8')]||'';this[_0xd506('0x9')]=_0x401eb7[_0xd506('0x9')]||'';this[_0xd506('0xa')]=_0x401eb7[_0xd506('0xa')]||'';this['Configurations']=_0x401eb7[_0xd506('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 2d575d9..959fff9 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 _0x489e=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x419cb5,_0x5c0f4e){var _0x489005=function(_0x629a22){while(--_0x629a22){_0x419cb5['push'](_0x419cb5['shift']());}};_0x489005(++_0x5c0f4e);}(_0x489e,0x155));var _0xe489=function(_0x1c54cd,_0x3e60d7){_0x1c54cd=_0x1c54cd-0x0;var _0x4e6892=_0x489e[_0x1c54cd];return _0x4e6892;};'use strict';function Dynamics365Account(_0x10d1d0){this['id']=_0x10d1d0['id']||0x0;this[_0xe489('0x0')]=_0x10d1d0[_0xe489('0x0')]||'';this[_0xe489('0x1')]=_0x10d1d0['username']||'';this['password']=_0x10d1d0[_0xe489('0x2')]||'';this[_0xe489('0x3')]=_0x10d1d0[_0xe489('0x3')]||'';this[_0xe489('0x4')]=_0x10d1d0[_0xe489('0x4')]||'';this[_0xe489('0x5')]=_0x10d1d0[_0xe489('0x5')]||'';this[_0xe489('0x6')]=_0x10d1d0[_0xe489('0x6')]||{};this[_0xe489('0x7')]=_0x10d1d0[_0xe489('0x7')]||'';this[_0xe489('0x8')]=_0x10d1d0[_0xe489('0x8')]||![];this[_0xe489('0x9')]=_0x10d1d0[_0xe489('0x9')]||{};this['CloudProvider']=_0x10d1d0[_0xe489('0xa')]||{};}module[_0xe489('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x25ae=['name','username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x5588ed,_0x2a07fa){var _0x24b11c=function(_0xb5933e){while(--_0xb5933e){_0x5588ed['push'](_0x5588ed['shift']());}};_0x24b11c(++_0x2a07fa);}(_0x25ae,0x84));var _0xe25a=function(_0x390e14,_0x1239d6){_0x390e14=_0x390e14-0x0;var _0xa1c050=_0x25ae[_0x390e14];return _0xa1c050;};'use strict';function Dynamics365Account(_0x40ce75){this['id']=_0x40ce75['id']||0x0;this[_0xe25a('0x0')]=_0x40ce75[_0xe25a('0x0')]||'';this[_0xe25a('0x1')]=_0x40ce75[_0xe25a('0x1')]||'';this[_0xe25a('0x2')]=_0x40ce75['password']||'';this[_0xe25a('0x3')]=_0x40ce75['remoteUri']||'';this['tenantId']=_0x40ce75[_0xe25a('0x4')]||'';this['clientId']=_0x40ce75['clientId']||'';this['clientSecret']=_0x40ce75[_0xe25a('0x5')]||{};this['serverUrl']=_0x40ce75[_0xe25a('0x6')]||'';this[_0xe25a('0x7')]=_0x40ce75[_0xe25a('0x7')]||![];this['Configurations']=_0x40ce75[_0xe25a('0x8')]||{};this[_0xe25a('0x9')]=_0x40ce75[_0xe25a('0x9')]||{};}module[_0xe25a('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index e8a5560..1be8730 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 _0xbccd=['tech','SIP','Trunk','ListId','key','exports','name','description','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway','t38timeout'];(function(_0x2aa9ab,_0x138fb1){var _0x2e6f9a=function(_0x294169){while(--_0x294169){_0x2aa9ab['push'](_0x2aa9ab['shift']());}};_0x2e6f9a(++_0x138fb1);}(_0xbccd,0xf6));var _0xdbcc=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbccd[_0x2dea24];return _0x309d58;};'use strict';function FaxAccount(_0x2f06f7){this['id']=_0x2f06f7['id']||0x0;this['name']=_0x2f06f7[_0xdbcc('0x0')]||'';this[_0xdbcc('0x1')]=_0x2f06f7[_0xdbcc('0x1')];this['ecm']=_0x2f06f7['ecm'];this[_0xdbcc('0x2')]=_0x2f06f7[_0xdbcc('0x2')];this[_0xdbcc('0x3')]=_0x2f06f7['localstationid'];this['minrate']=_0x2f06f7['minrate']||0x960;this[_0xdbcc('0x4')]=_0x2f06f7['maxrate']||0x3840;this[_0xdbcc('0x5')]=_0x2f06f7[_0xdbcc('0x5')]||_0xdbcc('0x6');this[_0xdbcc('0x7')]=_0x2f06f7[_0xdbcc('0x7')]||'no';this['faxdetect']=_0x2f06f7['faxdetect']||'no';this[_0xdbcc('0x8')]=_0x2f06f7['t38timeout']||0x1388;this[_0xdbcc('0x9')]=_0x2f06f7['tech']||_0xdbcc('0xa');this[_0xdbcc('0xb')]=_0x2f06f7[_0xdbcc('0xb')]?_0x2f06f7[_0xdbcc('0xb')]:undefined;this[_0xdbcc('0xc')]=_0x2f06f7[_0xdbcc('0xc')];this[_0xdbcc('0xd')]=_0x2f06f7[_0xdbcc('0xd')];}module[_0xdbcc('0xe')]=FaxAccount; \ No newline at end of file +var _0xfae3=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x2f4b38,_0x56456a){var _0x291ace=function(_0x222151){while(--_0x222151){_0x2f4b38['push'](_0x2f4b38['shift']());}};_0x291ace(++_0x56456a);}(_0xfae3,0xa1));var _0x3fae=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xfae3[_0x4cc492];return _0x1f36b9;};'use strict';function FaxAccount(_0x55e5fa){this['id']=_0x55e5fa['id']||0x0;this[_0x3fae('0x0')]=_0x55e5fa[_0x3fae('0x0')]||'';this[_0x3fae('0x1')]=_0x55e5fa[_0x3fae('0x1')];this[_0x3fae('0x2')]=_0x55e5fa[_0x3fae('0x2')];this[_0x3fae('0x3')]=_0x55e5fa[_0x3fae('0x3')];this[_0x3fae('0x4')]=_0x55e5fa[_0x3fae('0x4')];this['minrate']=_0x55e5fa[_0x3fae('0x5')]||0x960;this[_0x3fae('0x6')]=_0x55e5fa['maxrate']||0x3840;this['modem']=_0x55e5fa[_0x3fae('0x7')]||_0x3fae('0x8');this['gateway']=_0x55e5fa[_0x3fae('0x9')]||'no';this[_0x3fae('0xa')]=_0x55e5fa[_0x3fae('0xa')]||'no';this[_0x3fae('0xb')]=_0x55e5fa[_0x3fae('0xb')]||0x1388;this[_0x3fae('0xc')]=_0x55e5fa[_0x3fae('0xc')]||_0x3fae('0xd');this[_0x3fae('0xe')]=_0x55e5fa[_0x3fae('0xe')]?_0x55e5fa[_0x3fae('0xe')]:undefined;this[_0x3fae('0xf')]=_0x55e5fa[_0x3fae('0xf')];this['key']=_0x55e5fa[_0x3fae('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 221e86a..01dfb7b 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 _0x4199=['serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x5cf500,_0x40fbbf){var _0x4dc2ae=function(_0x186533){while(--_0x186533){_0x5cf500['push'](_0x5cf500['shift']());}};_0x4dc2ae(++_0x40fbbf);}(_0x4199,0x13e));var _0x9419=function(_0x3e4ab2,_0x47d031){_0x3e4ab2=_0x3e4ab2-0x0;var _0x41a9c3=_0x4199[_0x3e4ab2];return _0x41a9c3;};'use strict';function FreshdeskAccount(_0x1d94bd){this['id']=_0x1d94bd['id']||0x0;this[_0x9419('0x0')]=_0x1d94bd[_0x9419('0x0')]||'';this[_0x9419('0x1')]=_0x1d94bd[_0x9419('0x1')]||'';this[_0x9419('0x2')]=_0x1d94bd[_0x9419('0x3')]||'';this['remoteUri']=_0x1d94bd['remoteUri']||'';this[_0x9419('0x4')]=_0x1d94bd[_0x9419('0x4')]||'';this[_0x9419('0x5')]=_0x1d94bd[_0x9419('0x5')]||{};}module[_0x9419('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x5d72=['exports','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x2f430a,_0x46d370){var _0x10def3=function(_0x347eaa){while(--_0x347eaa){_0x2f430a['push'](_0x2f430a['shift']());}};_0x10def3(++_0x46d370);}(_0x5d72,0x71));var _0x25d7=function(_0x56ee15,_0x1effd1){_0x56ee15=_0x56ee15-0x0;var _0x94991f=_0x5d72[_0x56ee15];return _0x94991f;};'use strict';function FreshdeskAccount(_0x5f48ae){this['id']=_0x5f48ae['id']||0x0;this['name']=_0x5f48ae['name']||'';this['username']=_0x5f48ae[_0x25d7('0x0')]||'';this[_0x25d7('0x1')]=_0x5f48ae[_0x25d7('0x2')]||'';this[_0x25d7('0x3')]=_0x5f48ae[_0x25d7('0x3')]||'';this[_0x25d7('0x4')]=_0x5f48ae[_0x25d7('0x4')]||'';this[_0x25d7('0x5')]=_0x5f48ae[_0x25d7('0x5')]||{};}module[_0x25d7('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 f32dbc7..3e5a650 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 _0xbf25=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x38e99c,_0x428aa9){var _0x32323d=function(_0x108a7c){while(--_0x108a7c){_0x38e99c['push'](_0x38e99c['shift']());}};_0x32323d(++_0x428aa9);}(_0xbf25,0x15e));var _0x5bf2=function(_0x11bbe7,_0x1fc660){_0x11bbe7=_0x11bbe7-0x0;var _0x5a61d3=_0xbf25[_0x11bbe7];return _0x5a61d3;};'use strict';function FreshsalesAccount(_0x4e3e16){this['id']=_0x4e3e16['id']||0x0;this['name']=_0x4e3e16[_0x5bf2('0x0')]||'';this[_0x5bf2('0x1')]=_0x4e3e16[_0x5bf2('0x1')]||'';this[_0x5bf2('0x2')]=_0x4e3e16[_0x5bf2('0x3')]||'';this[_0x5bf2('0x4')]=_0x4e3e16['remoteUri']||'';this[_0x5bf2('0x5')]=_0x4e3e16['serverUrl']||'';this[_0x5bf2('0x6')]=_0x4e3e16[_0x5bf2('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x2675=['serverUrl','Configurations','exports','username','apiKey','remoteUri'];(function(_0x24075a,_0x49640e){var _0x1f738f=function(_0x284cbc){while(--_0x284cbc){_0x24075a['push'](_0x24075a['shift']());}};_0x1f738f(++_0x49640e);}(_0x2675,0x75));var _0x5267=function(_0x4bec56,_0x26c485){_0x4bec56=_0x4bec56-0x0;var _0x3f5d81=_0x2675[_0x4bec56];return _0x3f5d81;};'use strict';function FreshsalesAccount(_0x1ee0d4){this['id']=_0x1ee0d4['id']||0x0;this['name']=_0x1ee0d4['name']||'';this['username']=_0x1ee0d4[_0x5267('0x0')]||'';this[_0x5267('0x1')]=_0x1ee0d4['token']||'';this[_0x5267('0x2')]=_0x1ee0d4[_0x5267('0x2')]||'';this['serverUrl']=_0x1ee0d4[_0x5267('0x3')]||'';this[_0x5267('0x4')]=_0x1ee0d4[_0x5267('0x4')]||{};}module[_0x5267('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index bd52b65..5c259a6 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 _0xedd0=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd0,0x1d2));var _0x0edd=function(_0x5d91a6,_0x58d887){_0x5d91a6=_0x5d91a6-0x0;var _0x3b9850=_0xedd0[_0x5d91a6];return _0x3b9850;};'use strict';function QueueReport(){this[_0x0edd('0x0')]=_0x0edd('0x1');this[_0x0edd('0x2')]='';this[_0x0edd('0x3')]='';this[_0x0edd('0x4')]='';this[_0x0edd('0x5')]='';this[_0x0edd('0x6')]=null;this[_0x0edd('0x7')]=null;this[_0x0edd('0x8')]=0x1;this[_0x0edd('0x9')]=0x1;this[_0x0edd('0xa')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x0edd('0xb')]=null;this[_0x0edd('0xc')]=![];this['queuecallerexitAt']=null;this[_0x0edd('0xd')]=0x1;this[_0x0edd('0xe')]='';this[_0x0edd('0xf')]='';this[_0x0edd('0x10')]='';this[_0x0edd('0x11')]='';this[_0x0edd('0x12')]='';this[_0x0edd('0x13')]='';this['priority']='';this['holdtime']=0x0;this[_0x0edd('0x14')]=![];this[_0x0edd('0x15')]='';this[_0x0edd('0x16')]=_0x0edd('0x17');this[_0x0edd('0x18')]=0x0;this[_0x0edd('0x19')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x69de=['mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x17472b,_0x295329){var _0x1adc64=function(_0x531cf3){while(--_0x531cf3){_0x17472b['push'](_0x17472b['shift']());}};_0x1adc64(++_0x295329);}(_0x69de,0x98));var _0xe69d=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0x69de[_0x30faee];return _0x3a90ab;};'use strict';function QueueReport(){this[_0xe69d('0x0')]=_0xe69d('0x1');this[_0xe69d('0x2')]='';this[_0xe69d('0x3')]='';this[_0xe69d('0x4')]='';this[_0xe69d('0x5')]='';this[_0xe69d('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xe69d('0x7')]=0x1;this[_0xe69d('0x8')]=0x1;this[_0xe69d('0x9')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xe69d('0xa')]=null;this[_0xe69d('0xb')]=![];this['queuecallerexitAt']=null;this[_0xe69d('0xc')]=0x1;this[_0xe69d('0xd')]='';this[_0xe69d('0xe')]='';this[_0xe69d('0xf')]='';this['accountcode']='';this[_0xe69d('0x10')]='';this[_0xe69d('0x11')]='';this['priority']='';this[_0xe69d('0x12')]=0x0;this[_0xe69d('0x13')]=![];this[_0xe69d('0x14')]='';this[_0xe69d('0x15')]=_0xe69d('0x16');this[_0xe69d('0x17')]=0x0;this['variables']={};}module[_0xe69d('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 7974463..648ef7e 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 _0x0954=['exports','name','username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0954,0x135));var _0x4095=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0x0954[_0x5090d4];return _0x56c310;};'use strict';function SalesforceAccount(_0x37e407){this['id']=_0x37e407['id']||0x0;this['name']=_0x37e407[_0x4095('0x0')]||'';this[_0x4095('0x1')]=_0x37e407['username']||'';this[_0x4095('0x2')]=_0x37e407[_0x4095('0x2')]||'';this[_0x4095('0x3')]=_0x37e407[_0x4095('0x3')]||'';this[_0x4095('0x4')]=_0x37e407[_0x4095('0x4')]||'';this['clientSecret']=_0x37e407['clientSecret']||'';this['securityToken']=_0x37e407[_0x4095('0x5')]||'';this[_0x4095('0x6')]=_0x37e407[_0x4095('0x6')]||_0x4095('0x7');this[_0x4095('0x8')]=_0x37e407[_0x4095('0x8')]||'';this['Configurations']=_0x37e407[_0x4095('0x9')]||{};}module[_0x4095('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xfe0d=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x23a8ec,_0x3ddb28){var _0x2b2ce1=function(_0x598832){while(--_0x598832){_0x23a8ec['push'](_0x23a8ec['shift']());}};_0x2b2ce1(++_0x3ddb28);}(_0xfe0d,0xaf));var _0xdfe0=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfe0d[_0x21a9d9];return _0x46adce;};'use strict';function SalesforceAccount(_0xf060d5){this['id']=_0xf060d5['id']||0x0;this[_0xdfe0('0x0')]=_0xf060d5[_0xdfe0('0x0')]||'';this['username']=_0xf060d5[_0xdfe0('0x1')]||'';this[_0xdfe0('0x2')]=_0xf060d5[_0xdfe0('0x2')]||'';this[_0xdfe0('0x3')]=_0xf060d5[_0xdfe0('0x3')]||'';this[_0xdfe0('0x4')]=_0xf060d5[_0xdfe0('0x4')]||'';this[_0xdfe0('0x5')]=_0xf060d5[_0xdfe0('0x5')]||'';this[_0xdfe0('0x6')]=_0xf060d5[_0xdfe0('0x6')]||'';this['type']=_0xf060d5[_0xdfe0('0x7')]||'integrationTab';this[_0xdfe0('0x8')]=_0xf060d5['serverUrl']||'';this['Configurations']=_0xf060d5[_0xdfe0('0x9')]||{};}module[_0xdfe0('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 27d4d7f..f85d01c 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 _0xc0a7=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc0a7,0x11d));var _0x7c0a=function(_0x124c4a,_0x43949d){_0x124c4a=_0x124c4a-0x0;var _0x2b93d1=_0xc0a7[_0x124c4a];return _0x2b93d1;};'use strict';function ServicenowAccount(_0x3b4c3f){this['id']=_0x3b4c3f['id']||0x0;this[_0x7c0a('0x0')]=_0x3b4c3f[_0x7c0a('0x0')]||'';this[_0x7c0a('0x1')]=_0x3b4c3f[_0x7c0a('0x1')]||'';this[_0x7c0a('0x2')]=_0x3b4c3f[_0x7c0a('0x2')]||'';this['remoteUri']=_0x3b4c3f[_0x7c0a('0x3')]||'';this[_0x7c0a('0x4')]=_0x3b4c3f['serverUrl']||'';this[_0x7c0a('0x5')]=_0x3b4c3f[_0x7c0a('0x5')]||{};}module[_0x7c0a('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x8216=['serverUrl','Configurations','name','password','remoteUri'];(function(_0x256ce4,_0x5a29aa){var _0x35fe50=function(_0x536a94){while(--_0x536a94){_0x256ce4['push'](_0x256ce4['shift']());}};_0x35fe50(++_0x5a29aa);}(_0x8216,0x1ba));var _0x6821=function(_0x2cfc04,_0x2ddb8a){_0x2cfc04=_0x2cfc04-0x0;var _0x2395c1=_0x8216[_0x2cfc04];return _0x2395c1;};'use strict';function ServicenowAccount(_0x4bc27){this['id']=_0x4bc27['id']||0x0;this[_0x6821('0x0')]=_0x4bc27['name']||'';this['username']=_0x4bc27['username']||'';this[_0x6821('0x1')]=_0x4bc27[_0x6821('0x1')]||'';this[_0x6821('0x2')]=_0x4bc27[_0x6821('0x2')]||'';this[_0x6821('0x3')]=_0x4bc27['serverUrl']||'';this[_0x6821('0x4')]=_0x4bc27['Configurations']||{};}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 47b3b48..c690004 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 _0x87a6=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x529c7e,_0xfa31fb){var _0x4499d7=function(_0x242e80){while(--_0x242e80){_0x529c7e['push'](_0x529c7e['shift']());}};_0x4499d7(++_0xfa31fb);}(_0x87a6,0x16d));var _0x687a=function(_0x195534,_0x5b4f40){_0x195534=_0x195534-0x0;var _0xa98cd7=_0x87a6[_0x195534];return _0xa98cd7;};'use strict';function SugarcrmAccount(_0x81c4e2){this['id']=_0x81c4e2['id']||0x0;this[_0x687a('0x0')]=_0x81c4e2[_0x687a('0x0')]||'';this['username']=_0x81c4e2[_0x687a('0x1')]||'';this[_0x687a('0x2')]=_0x81c4e2['password']||'';this['remoteUri']=_0x81c4e2[_0x687a('0x3')]||'';this[_0x687a('0x4')]=_0x81c4e2['serverUrl']||'';this[_0x687a('0x5')]=_0x81c4e2['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x47a6=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x3e80bc,_0x17a492){var _0x4abdbd=function(_0x5c0d8e){while(--_0x5c0d8e){_0x3e80bc['push'](_0x3e80bc['shift']());}};_0x4abdbd(++_0x17a492);}(_0x47a6,0x113));var _0x647a=function(_0xb7c7cd,_0x11e7a0){_0xb7c7cd=_0xb7c7cd-0x0;var _0x19127f=_0x47a6[_0xb7c7cd];return _0x19127f;};'use strict';function SugarcrmAccount(_0x49c04a){this['id']=_0x49c04a['id']||0x0;this['name']=_0x49c04a[_0x647a('0x0')]||'';this[_0x647a('0x1')]=_0x49c04a[_0x647a('0x1')]||'';this[_0x647a('0x2')]=_0x49c04a['password']||'';this[_0x647a('0x3')]=_0x49c04a[_0x647a('0x3')]||'';this[_0x647a('0x4')]=_0x49c04a[_0x647a('0x4')]||'';this[_0x647a('0x5')]=_0x49c04a[_0x647a('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 1c8531d..5d893ee 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 _0xff15=['unknown','exports','name','accountcode','state','stateTime','status'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xff15,0x121));var _0x5ff1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xff15[_0x344a3f];return _0x264712;};'use strict';function Telephone(_0x424129){this['id']=_0x424129['id']||0x0;this[_0x5ff1('0x0')]=_0x424129[_0x5ff1('0x0')]||'';this[_0x5ff1('0x1')]=_0x424129['accountcode']||'';this[_0x5ff1('0x2')]='unknown';this[_0x5ff1('0x3')]=0x0;this[_0x5ff1('0x4')]=_0x5ff1('0x5');this['address']='';}module[_0x5ff1('0x6')]=Telephone; \ No newline at end of file +var _0x266b=['accountcode','state','stateTime','status','address','exports','name'];(function(_0x16aa6e,_0x5d7645){var _0x4322eb=function(_0x1eaf03){while(--_0x1eaf03){_0x16aa6e['push'](_0x16aa6e['shift']());}};_0x4322eb(++_0x5d7645);}(_0x266b,0x1cd));var _0xb266=function(_0x4a698d,_0x16a59b){_0x4a698d=_0x4a698d-0x0;var _0x518e4e=_0x266b[_0x4a698d];return _0x518e4e;};'use strict';function Telephone(_0x2b49c0){this['id']=_0x2b49c0['id']||0x0;this['name']=_0x2b49c0[_0xb266('0x0')]||'';this['accountcode']=_0x2b49c0[_0xb266('0x1')]||'';this[_0xb266('0x2')]='unknown';this[_0xb266('0x3')]=0x0;this[_0xb266('0x4')]='unknown';this[_0xb266('0x5')]='';}module[_0xb266('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index a5ebb0b..ee94320 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x358efd,_0x474619){var _0x84f6d9=function(_0x2e1a8b){while(--_0x2e1a8b){_0x358efd['push'](_0x358efd['shift']());}};_0x84f6d9(++_0x474619);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2ebd1a,_0x4fe60d){var _0x2dec41=function(_0x42726f){while(--_0x42726f){_0x2ebd1a['push'](_0x2ebd1a['shift']());}};_0x2dec41(++_0x4fe60d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 511e643..a4da79e 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x15fa9f,_0x3c8a70){var _0x22215c=function(_0x2aeed9){while(--_0x2aeed9){_0x15fa9f['push'](_0x15fa9f['shift']());}};_0x22215c(++_0x3c8a70);}(_0x2032,0xd9));var _0x2203=function(_0xb01afb,_0x4acf4d){_0xb01afb=_0xb01afb-0x0;var _0x25cc62=_0x2032[_0xb01afb];return _0x25cc62;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x5c5594,_0x576149){var _0x563a04=function(_0x27bc02){while(--_0x27bc02){_0x5c5594['push'](_0x5c5594['shift']());}};_0x563a04(++_0x576149);}(_0x14a0,0x8e));var _0x014a=function(_0x3f1392,_0x5194b3){_0x3f1392=_0x3f1392-0x0;var _0x2f56f1=_0x14a0[_0x3f1392];return _0x2f56f1;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['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 4155314..9a7cac5 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 _0x21ad=['registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','unknown','address','defaultuser','exports','active','name'];(function(_0x4ccde3,_0x38ca57){var _0x3348ac=function(_0x5433f0){while(--_0x5433f0){_0x4ccde3['push'](_0x4ccde3['shift']());}};_0x3348ac(++_0x38ca57);}(_0x21ad,0xa3));var _0xd21a=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x21ad[_0x2df507];return _0x1f7167;};'use strict';function Trunk(_0x112c01){this['id']=_0x112c01['id']||0x0;this[_0xd21a('0x0')]=_0x112c01[_0xd21a('0x0')]||![];this[_0xd21a('0x1')]=_0x112c01['name']||'';this['state']='unknown';this['stateTime']=0x0;this['status']='unknown';this['registry']=_0x112c01[_0xd21a('0x2')]&&_0x112c01[_0xd21a('0x2')][_0xd21a('0x3')](':')?_0x112c01[_0xd21a('0x2')][_0xd21a('0x4')](':')[0x0]:'';this[_0xd21a('0x5')]='';this[_0xd21a('0x6')]='';this[_0xd21a('0x7')]='';this[_0xd21a('0x8')]='';this[_0xd21a('0x9')]='';this[_0xd21a('0xa')]=_0xd21a('0xb');this['registrationtime']='';this[_0xd21a('0xc')]='';this[_0xd21a('0xd')]=_0x112c01[_0xd21a('0xd')]||'';}module[_0xd21a('0xe')]=Trunk; \ No newline at end of file +var _0x8a7f=['address','defaultuser','active','name','unknown','stateTime','registry','indexOf','split','host','port','domain','stateRegistry'];(function(_0x5644cd,_0x193793){var _0xb001a8=function(_0x174232){while(--_0x174232){_0x5644cd['push'](_0x5644cd['shift']());}};_0xb001a8(++_0x193793);}(_0x8a7f,0x17b));var _0xf8a7=function(_0x2bccd6,_0x243d93){_0x2bccd6=_0x2bccd6-0x0;var _0x3ff40b=_0x8a7f[_0x2bccd6];return _0x3ff40b;};'use strict';function Trunk(_0x5ddd16){this['id']=_0x5ddd16['id']||0x0;this['active']=_0x5ddd16[_0xf8a7('0x0')]||![];this[_0xf8a7('0x1')]=_0x5ddd16[_0xf8a7('0x1')]||'';this['state']=_0xf8a7('0x2');this[_0xf8a7('0x3')]=0x0;this['status']=_0xf8a7('0x2');this[_0xf8a7('0x4')]=_0x5ddd16[_0xf8a7('0x4')]&&_0x5ddd16[_0xf8a7('0x4')][_0xf8a7('0x5')](':')?_0x5ddd16[_0xf8a7('0x4')][_0xf8a7('0x6')](':')[0x0]:'';this[_0xf8a7('0x7')]='';this[_0xf8a7('0x8')]='';this[_0xf8a7('0x9')]='';this['domainport']='';this['refresh']='';this[_0xf8a7('0xa')]='unknown';this['registrationtime']='';this[_0xf8a7('0xb')]='';this['defaultuser']=_0x5ddd16[_0xf8a7('0xc')]||'';}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 3b005c4..f22cb25 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 _0x2de3=['none','mandatoryDisposition','exports','exten'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x2de3,0x19f));var _0x32de=function(_0x35f964,_0x554d3d){_0x35f964=_0x35f964-0x0;var _0xdabb85=_0x2de3[_0x35f964];return _0xdabb85;};'use strict';function voiceExtension(_0x44ac45){this['id']=_0x44ac45['id']||0x0;this[_0x32de('0x0')]=_0x44ac45[_0x32de('0x0')]||'';this['recordingFormat']=_0x44ac45['recordingFormat']||_0x32de('0x1');this[_0x32de('0x2')]=_0x44ac45[_0x32de('0x2')]||![];}module[_0x32de('0x3')]=voiceExtension; \ No newline at end of file +var _0x8a8e=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8a8e,0x1c7));var _0xe8a8=function(_0x2f7270,_0x307af1){_0x2f7270=_0x2f7270-0x0;var _0xe1d89a=_0x8a8e[_0x2f7270];return _0xe1d89a;};'use strict';function voiceExtension(_0x68bd48){this['id']=_0x68bd48['id']||0x0;this[_0xe8a8('0x0')]=_0x68bd48['exten']||'';this[_0xe8a8('0x1')]=_0x68bd48[_0xe8a8('0x1')]||_0xe8a8('0x2');this[_0xe8a8('0x3')]=_0x68bd48[_0xe8a8('0x3')]||![];}module[_0xe8a8('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c12c44e..aba5442 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 _0xe5e0=['DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','inbound','waiting','talking','answered','sumHoldTime','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt'];(function(_0x5e83ec,_0x5abaaf){var _0x43c08c=function(_0x24457f){while(--_0x24457f){_0x5e83ec['push'](_0x5e83ec['shift']());}};_0x43c08c(++_0x5abaaf);}(_0xe5e0,0x133));var _0x0e5e=function(_0x84be8b,_0x22741a){_0x84be8b=_0x84be8b-0x0;var _0x5db164=_0xe5e0[_0x84be8b];return _0x5db164;};'use strict';var statusDesc=[_0x0e5e('0x0'),_0x0e5e('0x1'),'inuse',_0x0e5e('0x2'),_0x0e5e('0x3'),_0x0e5e('0x4'),_0x0e5e('0x5'),'ringinuse',_0x0e5e('0x6')];var monitorFormat={'wav':_0x0e5e('0x7'),'wav49':_0x0e5e('0x8'),'gsm':_0x0e5e('0x9')};var strategy={'rrmemory':_0x0e5e('0xa'),'roundrobin':_0x0e5e('0xb')};function VoiceQueue(_0x42b74c){this['id']=_0x42b74c['id']||0x0;this[_0x0e5e('0xc')]=_0x42b74c[_0x0e5e('0xc')]||'';this[_0x0e5e('0xd')]=_0x42b74c[_0x0e5e('0xd')]||'';this['type']=_0x42b74c['type']||_0x0e5e('0xe');this[_0x0e5e('0xf')]=0x0;this[_0x0e5e('0x10')]=0x0;this['total']=0x0;this[_0x0e5e('0x11')]=0x0;this['sumDuration']=0x0;this[_0x0e5e('0x12')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x0e5e('0x13')]=0x0;this[_0x0e5e('0x14')]=0x0;this[_0x0e5e('0x15')]=_0x42b74c[_0x0e5e('0x15')]||![];this[_0x0e5e('0x16')]=_0x42b74c[_0x0e5e('0x16')]||0xa;this[_0x0e5e('0x17')]=_0x42b74c[_0x0e5e('0x17')]||'no';this[_0x0e5e('0x18')]=!![];this[_0x0e5e('0x19')]='';this[_0x0e5e('0x1a')]=0x0;this[_0x0e5e('0x1b')]=0x0;this[_0x0e5e('0x1c')]=_0x42b74c['dialTimezone']||null;this['dialGlobalInterval']=_0x42b74c[_0x0e5e('0x1d')]?_0x42b74c['dialGlobalInterval']:null;this[_0x0e5e('0x1e')]=_0x42b74c[_0x0e5e('0x1e')];this[_0x0e5e('0x1f')]=_0x42b74c['dialMethod']||_0x0e5e('0x20');this[_0x0e5e('0x21')]=_0x42b74c[_0x0e5e('0x21')]||0x0;this[_0x0e5e('0x22')]=_0x42b74c[_0x0e5e('0x22')]||0x0;this[_0x0e5e('0x23')]=_0x42b74c[_0x0e5e('0x23')]||0x1;this['dialPredictiveOptimization']=_0x42b74c[_0x0e5e('0x24')]||_0x0e5e('0x25');this['dialPredictiveOptimizationPercentage']=_0x42b74c[_0x0e5e('0x26')]||0.03;this[_0x0e5e('0x27')]=_0x42b74c[_0x0e5e('0x27')]||0x258;this[_0x0e5e('0x28')]=_0x42b74c[_0x0e5e('0x28')]||'anonymous';this[_0x0e5e('0x29')]=_0x42b74c[_0x0e5e('0x29')]||_0x0e5e('0x2a');this[_0x0e5e('0x2b')]=_0x42b74c['dialOriginateTimeout']||0x1e;this[_0x0e5e('0x2c')]=_0x42b74c[_0x0e5e('0x2c')]||_0x0e5e('0x2d');this[_0x0e5e('0x2e')]=_0x42b74c[_0x0e5e('0x2e')]||0x3;this['dialQueueProject']=_0x42b74c[_0x0e5e('0x2f')]||undefined;this[_0x0e5e('0x30')]=_0x42b74c['dialCongestionMaxRetry']||0x3;this[_0x0e5e('0x31')]=_0x42b74c[_0x0e5e('0x31')]||0x96;this['dialBusyMaxRetry']=_0x42b74c[_0x0e5e('0x32')]||0x3;this[_0x0e5e('0x33')]=_0x42b74c[_0x0e5e('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x42b74c[_0x0e5e('0x34')]||0x3;this[_0x0e5e('0x35')]=_0x42b74c[_0x0e5e('0x35')]||0x96;this[_0x0e5e('0x36')]=_0x42b74c[_0x0e5e('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x42b74c[_0x0e5e('0x37')]||0x96;this[_0x0e5e('0x38')]=_0x42b74c[_0x0e5e('0x38')]||0x3;this[_0x0e5e('0x39')]=_0x42b74c[_0x0e5e('0x39')]||0x96;this[_0x0e5e('0x3a')]=_0x42b74c[_0x0e5e('0x3a')]||0x3;this[_0x0e5e('0x3b')]=_0x42b74c[_0x0e5e('0x3b')]||0x96;this[_0x0e5e('0x3c')]=_0x42b74c[_0x0e5e('0x3c')]||0x3;this['dialMachineRetryFrequency']=_0x42b74c[_0x0e5e('0x3d')]||0x96;this[_0x0e5e('0x3e')]=_0x42b74c[_0x0e5e('0x3e')]||0x3;this[_0x0e5e('0x3f')]=_0x42b74c[_0x0e5e('0x3f')]||0x96;this['callAdditionalPhoneAfterMin']=_0x42b74c[_0x0e5e('0x40')]||0x3;this[_0x0e5e('0x41')]=_0x42b74c['dialGlobalMaxRetry']||0x4;this[_0x0e5e('0x42')]=_0x42b74c['Trunk']?_0x42b74c[_0x0e5e('0x42')]:undefined;this[_0x0e5e('0x43')]=_0x42b74c[_0x0e5e('0x43')]?_0x42b74c[_0x0e5e('0x43')]:undefined;this[_0x0e5e('0x44')]=_0x42b74c[_0x0e5e('0x44')]||undefined;this[_0x0e5e('0x45')]=_0x42b74c['Interval']?_0x42b74c[_0x0e5e('0x45')]:undefined;this[_0x0e5e('0x46')]=_0x42b74c[_0x0e5e('0x46')]||_0x0e5e('0x47');this[_0x0e5e('0x48')]=_0x42b74c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0e5e('0x49')]=_0x42b74c[_0x0e5e('0x49')]||undefined;this[_0x0e5e('0x4a')]=strategy[_0x42b74c[_0x0e5e('0x4a')]]||_0x0e5e('0xa');this['queueStatusComplete']=!![];this[_0x0e5e('0x4b')]=_0x42b74c[_0x0e5e('0x4b')]||![];this['dialAMDInitialSilence']=_0x42b74c[_0x0e5e('0x4c')];this['dialAMDGreeting']=_0x42b74c[_0x0e5e('0x4d')];this[_0x0e5e('0x4e')]=_0x42b74c['dialAMDAfterGreetingSilence'];this[_0x0e5e('0x4f')]=_0x42b74c['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x42b74c['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x42b74c[_0x0e5e('0x50')];this[_0x0e5e('0x51')]=_0x42b74c['dialAMDMaximumNumberOfWords'];this[_0x0e5e('0x52')]=_0x42b74c[_0x0e5e('0x52')];this[_0x0e5e('0x53')]=_0x42b74c[_0x0e5e('0x53')];this[_0x0e5e('0x54')]=0x0;this[_0x0e5e('0x55')]=0x0;this[_0x0e5e('0x56')]=_0x42b74c[_0x0e5e('0x56')];this[_0x0e5e('0x57')]=0x0;this[_0x0e5e('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x0e5e('0x59')]=0x0;this[_0x0e5e('0x5a')]=0x0;this[_0x0e5e('0x5b')]=0x0;this[_0x0e5e('0x5c')]=0x0;this[_0x0e5e('0x5d')]=0x0;this[_0x0e5e('0x5e')]=0x0;this[_0x0e5e('0x5f')]=0x0;this[_0x0e5e('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x0e5e('0x61')]=0x0;this[_0x0e5e('0x62')]=undefined;this[_0x0e5e('0x63')]=undefined;this[_0x0e5e('0x64')]=undefined;this[_0x0e5e('0x65')]=1.05;this[_0x0e5e('0x66')]=0x0;this[_0x0e5e('0x67')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x0e5e('0x68')]=0x0;this[_0x0e5e('0x69')]=0x0;this[_0x0e5e('0x6a')]=0x0;this[_0x0e5e('0x6b')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0e5e('0x6c')]=_0x42b74c[_0x0e5e('0x6d')]||0x14;this[_0x0e5e('0x6e')]=_0x42b74c[_0x0e5e('0x6d')]||0xa;this[_0x0e5e('0x6f')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0e5e('0x70')]=0x0;this[_0x0e5e('0x71')]=0x0;this[_0x0e5e('0x72')]=0x0;this[_0x0e5e('0x73')]=0x0;this[_0x0e5e('0x74')]=_0x42b74c[_0x0e5e('0x74')]||0x1e;this[_0x0e5e('0x75')]=_0x42b74c[_0x0e5e('0x75')]||![];this['dialPreviewAutoRecallMe']=!!_0x42b74c[_0x0e5e('0x76')]||![];this[_0x0e5e('0x77')]=!!_0x42b74c[_0x0e5e('0x77')]||![];this[_0x0e5e('0x78')]=_0x42b74c[_0x0e5e('0x78')]||undefined;this[_0x0e5e('0x79')]=_0x42b74c[_0x0e5e('0x79')]||![];this['dialAgiAfterHangupAgent']=_0x42b74c[_0x0e5e('0x7a')]||![];this['monitor_format']=monitorFormat[_0x42b74c[_0x0e5e('0xd')]]?monitorFormat[_0x42b74c[_0x0e5e('0xd')]]:undefined;this[_0x0e5e('0x7b')]=_0x42b74c[_0x0e5e('0x7b')]||![];this['mandatoryDispositionPause']=_0x42b74c['mandatoryDispositionPause']?_0x42b74c[_0x0e5e('0x7c')]:undefined;}module[_0x0e5e('0x7d')]=VoiceQueue; \ No newline at end of file +var _0xe69b=['talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting'];(function(_0x4150a6,_0x478924){var _0xa71d95=function(_0x1499d0){while(--_0x1499d0){_0x4150a6['push'](_0x4150a6['shift']());}};_0xa71d95(++_0x478924);}(_0xe69b,0x6a));var _0xbe69=function(_0x3a1f5d,_0x461978){_0x3a1f5d=_0x3a1f5d-0x0;var _0x33f2d5=_0xe69b[_0x3a1f5d];return _0x33f2d5;};'use strict';var statusDesc=[_0xbe69('0x0'),_0xbe69('0x1'),_0xbe69('0x2'),'busy',_0xbe69('0x3'),_0xbe69('0x4'),'ringing',_0xbe69('0x5'),_0xbe69('0x6')];var monitorFormat={'wav':_0xbe69('0x7'),'wav49':_0xbe69('0x8'),'gsm':_0xbe69('0x9')};var strategy={'rrmemory':_0xbe69('0xa'),'roundrobin':_0xbe69('0xb')};function VoiceQueue(_0x4e8e39){this['id']=_0x4e8e39['id']||0x0;this[_0xbe69('0xc')]=_0x4e8e39[_0xbe69('0xc')]||'';this[_0xbe69('0xd')]=_0x4e8e39[_0xbe69('0xd')]||'';this[_0xbe69('0xe')]=_0x4e8e39[_0xbe69('0xe')]||_0xbe69('0xf');this[_0xbe69('0x10')]=0x0;this[_0xbe69('0x11')]=0x0;this[_0xbe69('0x12')]=0x0;this[_0xbe69('0x13')]=0x0;this['sumDuration']=0x0;this[_0xbe69('0x14')]=0x0;this[_0xbe69('0x15')]=0x0;this[_0xbe69('0x16')]=0x0;this[_0xbe69('0x17')]=0x0;this[_0xbe69('0x18')]=0x0;this[_0xbe69('0x19')]=0x0;this[_0xbe69('0x1a')]=_0x4e8e39[_0xbe69('0x1a')]||![];this['acwTimeout']=_0x4e8e39['acwTimeout']||0xa;this[_0xbe69('0x1b')]=_0x4e8e39['autopause']||'no';this[_0xbe69('0x1c')]=!![];this[_0xbe69('0x1d')]='';this[_0xbe69('0x1e')]=0x0;this[_0xbe69('0x1f')]=0x0;this[_0xbe69('0x20')]=_0x4e8e39[_0xbe69('0x20')]||null;this[_0xbe69('0x21')]=_0x4e8e39[_0xbe69('0x21')]?_0x4e8e39['dialGlobalInterval']:null;this[_0xbe69('0x22')]=_0x4e8e39[_0xbe69('0x22')];this[_0xbe69('0x23')]=_0x4e8e39[_0xbe69('0x23')]||_0xbe69('0x24');this['dialLimitChannel']=_0x4e8e39[_0xbe69('0x25')]||0x0;this[_0xbe69('0x26')]=_0x4e8e39['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4e8e39[_0xbe69('0x27')]||0x1;this[_0xbe69('0x28')]=_0x4e8e39[_0xbe69('0x28')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x4e8e39[_0xbe69('0x29')]||0.03;this[_0xbe69('0x2a')]=_0x4e8e39['dialPredictiveInterval']||0x258;this[_0xbe69('0x2b')]=_0x4e8e39['dialOriginateCallerIdName']||'anonymous';this[_0xbe69('0x2c')]=_0x4e8e39[_0xbe69('0x2c')]||_0xbe69('0x2d');this[_0xbe69('0x2e')]=_0x4e8e39['dialOriginateTimeout']||0x1e;this[_0xbe69('0x2f')]=_0x4e8e39[_0xbe69('0x2f')]||_0xbe69('0x30');this[_0xbe69('0x31')]=_0x4e8e39['dialQueueTimeout']||0x3;this[_0xbe69('0x32')]=_0x4e8e39[_0xbe69('0x32')]||undefined;this[_0xbe69('0x33')]=_0x4e8e39['dialCongestionMaxRetry']||0x3;this[_0xbe69('0x34')]=_0x4e8e39[_0xbe69('0x34')]||0x96;this[_0xbe69('0x35')]=_0x4e8e39[_0xbe69('0x35')]||0x3;this[_0xbe69('0x36')]=_0x4e8e39[_0xbe69('0x36')]||0x96;this['dialNoAnswerMaxRetry']=_0x4e8e39[_0xbe69('0x37')]||0x3;this[_0xbe69('0x38')]=_0x4e8e39[_0xbe69('0x38')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4e8e39['dialNoSuchNumberMaxRetry']||0x3;this[_0xbe69('0x39')]=_0x4e8e39[_0xbe69('0x39')]||0x96;this[_0xbe69('0x3a')]=_0x4e8e39['dialDropMaxRetry']||0x3;this[_0xbe69('0x3b')]=_0x4e8e39[_0xbe69('0x3b')]||0x96;this[_0xbe69('0x3c')]=_0x4e8e39[_0xbe69('0x3c')]||0x3;this[_0xbe69('0x3d')]=_0x4e8e39['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x4e8e39[_0xbe69('0x3e')]||0x3;this['dialMachineRetryFrequency']=_0x4e8e39[_0xbe69('0x3f')]||0x96;this['dialAgentRejectMaxRetry']=_0x4e8e39[_0xbe69('0x40')]||0x3;this[_0xbe69('0x41')]=_0x4e8e39[_0xbe69('0x41')]||0x96;this['callAdditionalPhoneAfterMin']=_0x4e8e39[_0xbe69('0x42')]||0x3;this[_0xbe69('0x43')]=_0x4e8e39[_0xbe69('0x43')]||0x4;this[_0xbe69('0x44')]=_0x4e8e39[_0xbe69('0x44')]?_0x4e8e39[_0xbe69('0x44')]:undefined;this[_0xbe69('0x45')]=_0x4e8e39[_0xbe69('0x45')]?_0x4e8e39[_0xbe69('0x45')]:undefined;this['dialPrefix']=_0x4e8e39['dialPrefix']||undefined;this['Interval']=_0x4e8e39[_0xbe69('0x46')]?_0x4e8e39[_0xbe69('0x46')]:undefined;this[_0xbe69('0x47')]=_0x4e8e39[_0xbe69('0x47')]||_0xbe69('0x48');this[_0xbe69('0x49')]=_0x4e8e39[_0xbe69('0x49')]||undefined;this[_0xbe69('0x4a')]=_0x4e8e39['dialCutDigit']||undefined;this['strategy']=strategy[_0x4e8e39['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x4e8e39[_0xbe69('0x4b')]||![];this[_0xbe69('0x4c')]=_0x4e8e39[_0xbe69('0x4c')];this[_0xbe69('0x4d')]=_0x4e8e39[_0xbe69('0x4d')];this[_0xbe69('0x4e')]=_0x4e8e39[_0xbe69('0x4e')];this[_0xbe69('0x4f')]=_0x4e8e39[_0xbe69('0x4f')];this[_0xbe69('0x50')]=_0x4e8e39[_0xbe69('0x50')];this[_0xbe69('0x51')]=_0x4e8e39['dialAMDBetweenWordsSilence'];this[_0xbe69('0x52')]=_0x4e8e39[_0xbe69('0x52')];this[_0xbe69('0x53')]=_0x4e8e39[_0xbe69('0x53')];this[_0xbe69('0x54')]=_0x4e8e39[_0xbe69('0x54')];this[_0xbe69('0x55')]=0x0;this['pTalking']=0x0;this['timeout']=_0x4e8e39['timeout'];this[_0xbe69('0x56')]=0x0;this[_0xbe69('0x57')]=0x0;this[_0xbe69('0x58')]=0x0;this[_0xbe69('0x59')]=0x0;this[_0xbe69('0x5a')]=0x0;this[_0xbe69('0x5b')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xbe69('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xbe69('0x5d')]=0x0;this[_0xbe69('0x5e')]=0x0;this[_0xbe69('0x5f')]=0x0;this[_0xbe69('0x60')]=0x0;this[_0xbe69('0x61')]=0x0;this[_0xbe69('0x62')]=undefined;this[_0xbe69('0x63')]=undefined;this[_0xbe69('0x64')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xbe69('0x65')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xbe69('0x66')]=0x0;this[_0xbe69('0x67')]=0x0;this[_0xbe69('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xbe69('0x69')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xbe69('0x6a')]=_0x4e8e39[_0xbe69('0x6b')]||0x14;this[_0xbe69('0x6c')]=_0x4e8e39[_0xbe69('0x6b')]||0xa;this[_0xbe69('0x6d')]=0x0;this[_0xbe69('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xbe69('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xbe69('0x70')]=0x0;this[_0xbe69('0x71')]=_0x4e8e39[_0xbe69('0x71')]||0x1e;this[_0xbe69('0x72')]=_0x4e8e39[_0xbe69('0x72')]||![];this[_0xbe69('0x73')]=!!_0x4e8e39[_0xbe69('0x73')]||![];this[_0xbe69('0x74')]=!!_0x4e8e39[_0xbe69('0x74')]||![];this[_0xbe69('0x75')]=_0x4e8e39[_0xbe69('0x75')]||undefined;this[_0xbe69('0x76')]=_0x4e8e39['dialAgiAfterHangupClient']||![];this[_0xbe69('0x77')]=_0x4e8e39[_0xbe69('0x77')]||![];this[_0xbe69('0xd')]=monitorFormat[_0x4e8e39[_0xbe69('0xd')]]?monitorFormat[_0x4e8e39[_0xbe69('0xd')]]:undefined;this[_0xbe69('0x78')]=_0x4e8e39[_0xbe69('0x78')]||![];this[_0xbe69('0x79')]=_0x4e8e39[_0xbe69('0x79')]?_0x4e8e39[_0xbe69('0x79')]:undefined;}module[_0xbe69('0x7a')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 1fa63a7..079aaab 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 _0xe72d=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x139c85,_0x46f70c){var _0x2e503c=function(_0x2c1e41){while(--_0x2c1e41){_0x139c85['push'](_0x139c85['shift']());}};_0x2e503c(++_0x46f70c);}(_0xe72d,0x1b5));var _0xde72=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xe72d[_0x819464];return _0x49dcc0;};'use strict';function VtigerAccount(_0x154107){this['id']=_0x154107['id']||0x0;this['name']=_0x154107[_0xde72('0x0')]||'';this['username']=_0x154107[_0xde72('0x1')]||'';this[_0xde72('0x2')]=_0x154107[_0xde72('0x2')]||'';this[_0xde72('0x3')]=_0x154107['remoteUri']||'';this['serverUrl']=_0x154107[_0xde72('0x4')]||'';this[_0xde72('0x5')]=_0x154107[_0xde72('0x5')]||{};}module[_0xde72('0x6')]=VtigerAccount; \ No newline at end of file +var _0x9ff9=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9ff9,0x1c3));var _0x99ff=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x9ff9[_0x134c2e];return _0x2825db;};'use strict';function VtigerAccount(_0x7ffbe9){this['id']=_0x7ffbe9['id']||0x0;this[_0x99ff('0x0')]=_0x7ffbe9['name']||'';this[_0x99ff('0x1')]=_0x7ffbe9[_0x99ff('0x1')]||'';this['accessKey']=_0x7ffbe9[_0x99ff('0x2')]||'';this[_0x99ff('0x3')]=_0x7ffbe9[_0x99ff('0x3')]||'';this[_0x99ff('0x4')]=_0x7ffbe9['serverUrl']||'';this[_0x99ff('0x5')]=_0x7ffbe9[_0x99ff('0x5')]||{};}module[_0x99ff('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 c98ae00..246b112 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 _0xbf2b=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','password','token'];(function(_0x2e47c1,_0x1bed12){var _0x1a0364=function(_0x12cf22){while(--_0x12cf22){_0x2e47c1['push'](_0x2e47c1['shift']());}};_0x1a0364(++_0x1bed12);}(_0xbf2b,0x84));var _0xbbf2=function(_0x4fc809,_0x407ff4){_0x4fc809=_0x4fc809-0x0;var _0x408c88=_0xbf2b[_0x4fc809];return _0x408c88;};'use strict';function ZendeskAccount(_0x5ef63f){this['id']=_0x5ef63f['id']||0x0;this[_0xbbf2('0x0')]=_0x5ef63f[_0xbbf2('0x0')]||'';this['username']=_0x5ef63f['username']||'';this[_0xbbf2('0x1')]=_0x5ef63f[_0xbbf2('0x1')]||'';this['token']=_0x5ef63f[_0xbbf2('0x2')]||'';this[_0xbbf2('0x3')]=_0x5ef63f['remoteUri']||'';this['authType']=_0x5ef63f[_0xbbf2('0x4')]||'';this[_0xbbf2('0x5')]=_0x5ef63f[_0xbbf2('0x5')]||_0xbbf2('0x6');this[_0xbbf2('0x7')]=_0x5ef63f[_0xbbf2('0x7')]||'';this['Configurations']=_0x5ef63f[_0xbbf2('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x82f1=['Configurations','exports','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x82f1,0xca));var _0x182f=function(_0x3fed3a,_0x367b6c){_0x3fed3a=_0x3fed3a-0x0;var _0xf746c9=_0x82f1[_0x3fed3a];return _0xf746c9;};'use strict';function ZendeskAccount(_0x42bdf4){this['id']=_0x42bdf4['id']||0x0;this['name']=_0x42bdf4['name']||'';this[_0x182f('0x0')]=_0x42bdf4[_0x182f('0x0')]||'';this[_0x182f('0x1')]=_0x42bdf4[_0x182f('0x1')]||'';this[_0x182f('0x2')]=_0x42bdf4[_0x182f('0x2')]||'';this[_0x182f('0x3')]=_0x42bdf4[_0x182f('0x3')]||'';this['authType']=_0x42bdf4[_0x182f('0x4')]||'';this[_0x182f('0x5')]=_0x42bdf4[_0x182f('0x5')]||_0x182f('0x6');this[_0x182f('0x7')]=_0x42bdf4[_0x182f('0x7')]||'';this[_0x182f('0x8')]=_0x42bdf4[_0x182f('0x8')]||{};}module[_0x182f('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 782515b..46b6e9c 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 _0x758e=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x758e,0x8b));var _0xe758=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x758e[_0x3bf83f];return _0x22c4a9;};'use strict';function ZohoAccount(_0x4b69d1){this['id']=_0x4b69d1['id']||0x0;this[_0xe758('0x0')]=_0x4b69d1[_0xe758('0x0')]||'';this['description']=_0x4b69d1[_0xe758('0x1')]||'';this[_0xe758('0x2')]=_0x4b69d1[_0xe758('0x2')]||'';this[_0xe758('0x3')]=_0x4b69d1[_0xe758('0x3')]||'';this[_0xe758('0x4')]=_0x4b69d1[_0xe758('0x4')]||'';this[_0xe758('0x5')]=_0x4b69d1['clientSecret']||'';this[_0xe758('0x6')]=_0x4b69d1[_0xe758('0x6')]||'';this[_0xe758('0x7')]=_0x4b69d1[_0xe758('0x7')]||'';this[_0xe758('0x8')]=_0x4b69d1[_0xe758('0x8')]||'';this[_0xe758('0x9')]=_0x4b69d1[_0xe758('0x9')]||{};}module[_0xe758('0xa')]=ZohoAccount; \ No newline at end of file +var _0x4d08=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x42ff88,_0x469a4c){var _0x243517=function(_0xbecbae){while(--_0xbecbae){_0x42ff88['push'](_0x42ff88['shift']());}};_0x243517(++_0x469a4c);}(_0x4d08,0x1a9));var _0x84d0=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x4d08[_0x2de020];return _0x182b7c;};'use strict';function ZohoAccount(_0x478d4e){this['id']=_0x478d4e['id']||0x0;this[_0x84d0('0x0')]=_0x478d4e[_0x84d0('0x0')]||'';this['description']=_0x478d4e[_0x84d0('0x1')]||'';this[_0x84d0('0x2')]=_0x478d4e[_0x84d0('0x2')]||'';this[_0x84d0('0x3')]=_0x478d4e[_0x84d0('0x3')]||'';this[_0x84d0('0x4')]=_0x478d4e[_0x84d0('0x4')]||'';this['clientSecret']=_0x478d4e['clientSecret']||'';this[_0x84d0('0x5')]=_0x478d4e['serverUrl']||'';this[_0x84d0('0x6')]=_0x478d4e[_0x84d0('0x6')]||'';this[_0x84d0('0x7')]=_0x478d4e[_0x84d0('0x7')]||'';this['Configurations']=_0x478d4e[_0x84d0('0x8')]||{};}module[_0x84d0('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 7fd5164..ba01188 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 _0x0abf=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback'];(function(_0x9edb44,_0x47ca75){var _0x527ab4=function(_0xaa38d3){while(--_0xaa38d3){_0x9edb44['push'](_0x9edb44['shift']());}};_0x527ab4(++_0x47ca75);}(_0x0abf,0xe8));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0xf0ab('0x0'));var _=require('lodash');var moment=require(_0xf0ab('0x1'));function checkNameSurname(_0x27c8c9,_0x528ef7,_0x598001){var _0x313b14='';if(!_['isNil'](_0x528ef7)&&_0xf0ab('0x2')===typeof _0x528ef7){_0x313b14+=_0x528ef7;}if(!_[_0xf0ab('0x3')](_0x598001)&&_0xf0ab('0x2')===typeof _0x598001){_0x313b14+='\x20'+_0x598001;}if(_0x313b14!==''){return _0x313b14;}return _0x27c8c9;}function Action(_0xbb1f91,_0x2ab7d6,_0x4d2ea8,_0x233afe,_0x57ff3b){this[_0xf0ab('0x4')]=_0x4d2ea8||undefined;this[_0xf0ab('0x5')]=_0xbb1f91['id'];this[_0xf0ab('0x6')]=_0x2ab7d6[_0xf0ab('0x7')];this['type']=_0x2ab7d6[_0xf0ab('0x8')];this[_0xf0ab('0x9')]=_0xf0ab('0x6');this['dialAnswer']=![];this['membername']=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?undefined:_0xbb1f91[_0xf0ab('0xa')][_0xf0ab('0x7')];this[_0xf0ab('0xb')]=this[_0xf0ab('0xc')]?util[_0xf0ab('0xd')](_0xf0ab('0xe'),this[_0xf0ab('0xc')]):_0x233afe||undefined;this['calleridname']=checkNameSurname(_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x10')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x11')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x12')]);this[_0xf0ab('0x13')]=_0xbb1f91[_0xf0ab('0x13')]||![];this[_0xf0ab('0x14')]=_0xbb1f91[_0xf0ab('0x10')];this[_0xf0ab('0x15')]=_0xbb1f91[_0xf0ab('0x15')];this[_0xf0ab('0x16')]=_0xbb1f91[_0xf0ab('0x16')]||0x0;this[_0xf0ab('0x17')]=_0xbb1f91['countcongestionretry']||0x0;this[_0xf0ab('0x18')]=_0xbb1f91[_0xf0ab('0x18')]||0x0;this[_0xf0ab('0x19')]=(_0xbb1f91[_0xf0ab('0x16')]||0x0)+(_0xbb1f91[_0xf0ab('0x17')]||0x0)+(_0xbb1f91[_0xf0ab('0x18')]||0x0)+(_0xbb1f91[_0xf0ab('0x1a')]||0x0)+(_0xbb1f91[_0xf0ab('0x1b')]||0x0)+(_0xbb1f91[_0xf0ab('0x1c')]||0x0)+(_0xbb1f91[_0xf0ab('0x1d')]||0x0)+(_0xbb1f91[_0xf0ab('0x1e')]||0x0);this[_0xf0ab('0x1a')]=_0xbb1f91[_0xf0ab('0x1a')]||0x0;this[_0xf0ab('0x1b')]=_0xbb1f91[_0xf0ab('0x1b')]||0x0;this[_0xf0ab('0x1c')]=_0xbb1f91['countabandonedretry']||0x0;this[_0xf0ab('0x1d')]=_0xbb1f91[_0xf0ab('0x1d')]||0x0;this[_0xf0ab('0x1e')]=_0xbb1f91[_0xf0ab('0x1e')]||0x0;this[_0xf0ab('0x1f')]=_0xbb1f91[_0xf0ab('0x1f')];this[_0xf0ab('0x20')]=_0xbb1f91[_0xf0ab('0x20')];this[_0xf0ab('0x21')]=_0xbb1f91[_0xf0ab('0x21')];this[_0xf0ab('0x22')]=_0xbb1f91['recallme'];this['ContactId']=_0xbb1f91['ContactId'];this[_0xf0ab('0x23')]=_0xbb1f91['ListId'];this[_0xf0ab('0x24')]=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?_0xbb1f91[_0xf0ab('0x24')]:_0xbb1f91[_0xf0ab('0xa')]['id'];this[_0xf0ab('0x25')]=_0xbb1f91[_0xf0ab('0x25')];this[_0xf0ab('0x26')]='';this['originatecalleridname']='';}Action[_0xf0ab('0x27')]['getCaller']=function(){return util['format'](_0xf0ab('0x28'),this[_0xf0ab('0x29')],this[_0xf0ab('0x2a')]);};module[_0xf0ab('0x2b')]=Action; \ No newline at end of file +var _0xfcbb=['name','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x78c4a1,_0x451ea3){_0x78c4a1=_0x78c4a1-0x0;var _0x5bcc14=_0xfcbb[_0x78c4a1];return _0x5bcc14;};'use strict';var util=require(_0xbfcb('0x0'));var _=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));function checkNameSurname(_0x5a1002,_0x5747a4,_0x462349){var _0x280329='';if(!_[_0xbfcb('0x3')](_0x5747a4)&&_0xbfcb('0x4')===typeof _0x5747a4){_0x280329+=_0x5747a4;}if(!_[_0xbfcb('0x3')](_0x462349)&&'string'===typeof _0x462349){_0x280329+='\x20'+_0x462349;}if(_0x280329!==''){return _0x280329;}return _0x5a1002;}function Action(_0x5201d3,_0x32c2aa,_0x4990c,_0x8d4e6a,_0x2df839){this[_0xbfcb('0x5')]=_0x4990c||undefined;this[_0xbfcb('0x6')]=_0x5201d3['id'];this[_0xbfcb('0x7')]=_0x32c2aa['name'];this[_0xbfcb('0x8')]=_0x32c2aa[_0xbfcb('0x8')];this[_0xbfcb('0x9')]='queue';this[_0xbfcb('0xa')]=![];this[_0xbfcb('0xb')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?undefined:_0x5201d3[_0xbfcb('0xc')][_0xbfcb('0xd')];this['channelAgent']=this[_0xbfcb('0xb')]?util[_0xbfcb('0xe')](_0xbfcb('0xf'),this[_0xbfcb('0xb')]):_0x8d4e6a||undefined;this['calleridname']=checkNameSurname(_0x5201d3[_0xbfcb('0x10')]['phone'],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x11')],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x12')]);this[_0xbfcb('0x13')]=_0x5201d3[_0xbfcb('0x13')]||![];this[_0xbfcb('0x14')]=_0x5201d3[_0xbfcb('0x15')];this[_0xbfcb('0x16')]=_0x5201d3[_0xbfcb('0x16')];this[_0xbfcb('0x17')]=_0x5201d3[_0xbfcb('0x17')]||0x0;this[_0xbfcb('0x18')]=_0x5201d3[_0xbfcb('0x18')]||0x0;this[_0xbfcb('0x19')]=_0x5201d3[_0xbfcb('0x19')]||0x0;this[_0xbfcb('0x1a')]=(_0x5201d3[_0xbfcb('0x17')]||0x0)+(_0x5201d3[_0xbfcb('0x18')]||0x0)+(_0x5201d3[_0xbfcb('0x19')]||0x0)+(_0x5201d3[_0xbfcb('0x1b')]||0x0)+(_0x5201d3[_0xbfcb('0x1c')]||0x0)+(_0x5201d3['countabandonedretry']||0x0)+(_0x5201d3[_0xbfcb('0x1d')]||0x0)+(_0x5201d3[_0xbfcb('0x1e')]||0x0);this['countnosuchnumberretry']=_0x5201d3[_0xbfcb('0x1b')]||0x0;this[_0xbfcb('0x1c')]=_0x5201d3['countdropretry']||0x0;this['countabandonedretry']=_0x5201d3[_0xbfcb('0x1f')]||0x0;this[_0xbfcb('0x1d')]=_0x5201d3[_0xbfcb('0x1d')]||0x0;this[_0xbfcb('0x1e')]=_0x5201d3[_0xbfcb('0x1e')]||0x0;this['callback']=_0x5201d3[_0xbfcb('0x20')];this[_0xbfcb('0x21')]=_0x5201d3[_0xbfcb('0x21')];this[_0xbfcb('0x22')]=_0x5201d3[_0xbfcb('0x22')];this[_0xbfcb('0x23')]=_0x5201d3[_0xbfcb('0x23')];this[_0xbfcb('0x24')]=_0x5201d3[_0xbfcb('0x24')];this[_0xbfcb('0x25')]=_0x5201d3[_0xbfcb('0x25')];this[_0xbfcb('0x26')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?_0x5201d3[_0xbfcb('0x26')]:_0x5201d3[_0xbfcb('0xc')]['id'];this['VoiceQueueId']=_0x5201d3[_0xbfcb('0x27')];this[_0xbfcb('0x28')]='';this['originatecalleridname']='';}Action[_0xbfcb('0x29')][_0xbfcb('0x2a')]=function(){return util[_0xbfcb('0xe')](_0xbfcb('0x2b'),this[_0xbfcb('0x2c')],this[_0xbfcb('0x2d')]);};module[_0xbfcb('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 4b33f3d..0b50a99 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 _0x319d=['outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','voice_queue:save','format','voice:queue:%s','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','\x20is\x20not\x20active','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[action]','getContactRecallMe','agentReadyId','agents','length','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','then','additional','callAdditionalPhoneAfterMin','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','BUSY','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','Busy','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','phone','VoiceQueueId','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlockContact','execRun','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','YYYY-MM-DD\x20HH:mm:ss','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','callProgressDetectingCustomer','syncDialEnd','destuniqueid','filterKey','keys','variable','addVariable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','localhost','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix'];(function(_0x3bb15e,_0x377ae2){var _0x1918c6=function(_0x3882d5){while(--_0x3882d5){_0x3bb15e['push'](_0x3bb15e['shift']());}};_0x1918c6(++_0x377ae2);}(_0x319d,0x126));var _0xd319=function(_0x2b43ba,_0x3510f1){_0x2b43ba=_0x2b43ba-0x0;var _0x26d41e=_0x319d[_0x2b43ba];return _0x26d41e;};'use strict';var util=require(_0xd319('0x0'));var _=require('lodash');var uuid=require(_0xd319('0x1'));var moment=require('moment');var md5=require(_0xd319('0x2'));var Redis=require(_0xd319('0x3'));var config=require(_0xd319('0x4'));var logger=require(_0xd319('0x5'))(_0xd319('0x6'));var loggerAction=require(_0xd319('0x5'))(_0xd319('0x7'));var ami=require('../ami');var rpcDb=require(_0xd319('0x8'));var cmHopperAdditionalPhone=require(_0xd319('0x9'));var Action=require(_0xd319('0xa'));var ut=require(_0xd319('0xb'));config['redis']=_[_0xd319('0xc')](config[_0xd319('0xd')],{'host':_0xd319('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xd319('0xf')][_0xd319('0x10')]=function(_0x53be65){this[_0xd319('0x11')]=this[_0xd319('0x11')]?this[_0xd319('0x11')][_0xd319('0x12')](_0x53be65):_0x53be65();};function Preview(_0x49f83d){this['sequence']=new Sequence();this['campaignsPreview']=_0x49f83d[_0xd319('0x13')];this['trunks']=_0x49f83d[_0xd319('0x14')];this[_0xd319('0x15')]={};this['agents']=_0x49f83d['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xd319('0x16'),this['syncOriginateResponse'][_0xd319('0x17')](this));ami['on'](_0xd319('0x18'),this['syncHangup']['bind'](this));ami['on'](_0xd319('0x19'),this[_0xd319('0x1a')][_0xd319('0x17')](this));ami['on'](_0xd319('0x1b'),this['syncDialEnd'][_0xd319('0x17')](this));ami['on'](_0xd319('0x1c'),this[_0xd319('0x1d')][_0xd319('0x17')](this));ami['on']('varset',this[_0xd319('0x1e')]['bind'](this));ami['on']('attendedtransfer',this[_0xd319('0x1f')]['bind'](this));ami['on'](_0xd319('0x20'),this[_0xd319('0x21')][_0xd319('0x17')](this));this[_0xd319('0x22')](this[_0xd319('0x23')]);}function emit(_0x27006e,_0x47a71b,_0x4094a7){io['to'](_0x27006e)['emit'](_0x47a71b,_0x4094a7);}function emitCampaignPreview(_0x1c6724){if(_0x1c6724[_0xd319('0x24')]===_0xd319('0x25')){var _0x21c0ef={'id':_0x1c6724['id'],'name':_0x1c6724[_0xd319('0x26')],'strategy':_0x1c6724[_0xd319('0x27')],'answered':_0x1c6724[_0xd319('0x28')],'available':_0x1c6724['available'],'loggedIn':_0x1c6724[_0xd319('0x29')],'pTalking':_0x1c6724[_0xd319('0x2a')],'sumBillable':_0x1c6724['sumBillable'],'sumDuration':_0x1c6724[_0xd319('0x2b')],'sumHoldTime':_0x1c6724[_0xd319('0x2c')]||0x0,'talking':_0x1c6724[_0xd319('0x2d')],'total':_0x1c6724[_0xd319('0x2e')],'type':_0x1c6724[_0xd319('0x24')],'unmanaged':_0x1c6724['unmanaged'],'abandoned':_0x1c6724[_0xd319('0x2f')],'waiting':_0x1c6724[_0xd319('0x30')],'loggedInDb':_0x1c6724[_0xd319('0x31')],'dialActive':_0x1c6724[_0xd319('0x32')],'dialMethod':_0x1c6724[_0xd319('0x33')],'dialOriginateCallerIdName':_0x1c6724[_0xd319('0x34')],'dialOriginateCallerIdNumber':_0x1c6724['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1c6724[_0xd319('0x35')],'dialPrefix':_0x1c6724[_0xd319('0x36')],'outboundAnswerAgiCallsDay':_0x1c6724[_0xd319('0x37')],'outboundAnswerCallsDay':_0x1c6724[_0xd319('0x38')],'outboundBlacklistCallsDay':_0x1c6724['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1c6724[_0xd319('0x39')],'outboundCongestionCallsDay':_0x1c6724[_0xd319('0x3a')],'outboundDropCallsDayACS':_0x1c6724[_0xd319('0x3b')],'outboundDropCallsDayCallersExit':_0x1c6724[_0xd319('0x3c')],'outboundDropCallsDayTimeout':_0x1c6724['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1c6724[_0xd319('0x3d')],'outboundNoSuchCallsDay':_0x1c6724[_0xd319('0x3e')],'outboundOriginateFailureCallsDay':_0x1c6724[_0xd319('0x3f')],'outboundReCallsDay':_0x1c6724[_0xd319('0x40')],'outboundRejectCallsDay':_0x1c6724[_0xd319('0x41')],'outboundUnknownCallsDay':_0x1c6724['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1c6724[_0xd319('0x42')],'predictiveIntervalAnsweredCalls':_0x1c6724[_0xd319('0x43')],'predictiveIntervalAvgHoldtime':_0x1c6724[_0xd319('0x44')],'predictiveIntervalAvgTalktime':_0x1c6724[_0xd319('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x1c6724[_0xd319('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x1c6724[_0xd319('0x47')],'predictiveIntervalErlangCalls':_0x1c6724[_0xd319('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x1c6724[_0xd319('0x49')],'predictiveIntervalHitRate':_0x1c6724[_0xd319('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x1c6724[_0xd319('0x4b')],'predictiveIntervalPauses':_0x1c6724[_0xd319('0x4c')],'predictiveIntervalAvailable':_0x1c6724[_0xd319('0x4d')],'predictiveIntervalTotalCalls':_0x1c6724[_0xd319('0x4e')],'message':_0x1c6724[_0xd319('0x4f')],'originated':_0x1c6724[_0xd319('0x50')],'erlangCalls':_0x1c6724['erlangCalls'],'erlangCallToSecond':_0x1c6724[_0xd319('0x51')],'erlangAbandonmentRate':_0x1c6724[_0xd319('0x52')],'erlangBusyFactor':_0x1c6724[_0xd319('0x53')],'startPredictive':_0x1c6724[_0xd319('0x54')],'startProgressive':_0x1c6724[_0xd319('0x55')]};if(_0x1c6724[_0xd319('0x56')]){_0x21c0ef['Trunk']={'id':_0x1c6724[_0xd319('0x56')]['id'],'name':_0x1c6724[_0xd319('0x56')]['name'],'active':_0x1c6724['Trunk'][_0xd319('0x57')],'callerid':_0x1c6724[_0xd319('0x56')]['callerid']};}if(_0x1c6724[_0xd319('0x58')]){_0x21c0ef[_0xd319('0x58')]={'id':_0x1c6724['Interval']['id'],'name':_0x1c6724[_0xd319('0x58')][_0xd319('0x26')]};}var _0x19aefe=md5(JSON[_0xd319('0x59')](_0x21c0ef));if(_0x1c6724[_0xd319('0x2')]!==_0x19aefe){_0x1c6724[_0xd319('0x2')]=_0x19aefe;emit(util['format']('voice:queue:%s',_0x21c0ef[_0xd319('0x26')]),_0xd319('0x5a'),_0x21c0ef);}}}function emitVoiceQueueChannelRemove(_0x5b5cca){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd319('0x59')](_0x5b5cca));emit(util[_0xd319('0x5b')](_0xd319('0x5c'),_0x5b5cca['name']),'voice_queue_channel:remove',_0x5b5cca);io[_0xd319('0x5d')](_0xd319('0x5e'),_0x5b5cca);}function notSendMessagesQueue(_0x28028d){if(_0x28028d[_0xd319('0x5f')]){if(_0x28028d['originated']===0x0&&_0x28028d['pTalking']===0x0){_0x28028d['sendMessageOneNotActive']=![];_0x28028d['available']=0x0;_0x28028d[_0xd319('0x60')]=0x0;_0x28028d['message']='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x28028d[_0xd319('0x26')]+_0xd319('0x61'));}else{_0x28028d[_0xd319('0x4f')]='DEACTIVATED';ut[_0xd319('0x62')](_0xd319('0x63'),_0x28028d['name']+_0xd319('0x64'));}emitCampaignPreview(_0x28028d);}}Preview['prototype'][_0xd319('0x22')]=function(){var _0x15d52f=this;setInterval(function(){_0x15d52f[_0xd319('0x65')]();},0x7cf);};Preview[_0xd319('0xf')][_0xd319('0x65')]=function(){var _0x4486a2=this[_0xd319('0x23')];this[_0xd319('0x66')]+=0x1;for(var _0x32da1e in _0x4486a2){if(_0x4486a2[_0xd319('0x67')](_0x32da1e)&&(_0x4486a2[_0x32da1e][_0xd319('0x33')]==='preview'||_0x4486a2[_0x32da1e][_0xd319('0x33')]===_0xd319('0x68'))&&_0x4486a2[_0x32da1e][_0xd319('0x24')]==='outbound'){if(this[_0xd319('0x66')]>0x7){this[_0xd319('0x66')]=0x0;this[_0xd319('0x69')]();}}if(_0x4486a2[_0xd319('0x67')](_0x32da1e)&&_0x4486a2[_0x32da1e][_0xd319('0x33')]===_0xd319('0x6')&&_0x4486a2[_0x32da1e]['type']===_0xd319('0x25')){if(_0x4486a2[_0x32da1e][_0xd319('0x32')]){this['setMessage'](_0x4486a2[_0x32da1e]);if(_0x4486a2[_0x32da1e][_0xd319('0x6a')])this['recallMe'](_0x4486a2[_0x32da1e]);}else{notSendMessagesQueue(_0x4486a2[_0x32da1e]);}}}};Preview['prototype'][_0xd319('0x6b')]=function(_0x359010){var _0x173d25=this;this['sequence'][_0xd319('0x10')](function(){if(!_[_0xd319('0x6c')](_0x173d25[_0xd319('0x15')][_0x359010])){loggerAction[_0xd319('0x6d')](_0xd319('0x6e'),_0x359010,_0xd319('0x6f'),_0x173d25['actions'][_0x359010][_0xd319('0x70')],'originated:\x20',JSON[_0xd319('0x59')](_0x173d25[_0xd319('0x23')][_0x173d25['actions'][_0x359010][_0xd319('0x70')]][_0xd319('0x50')]),'pTalking:\x20',JSON[_0xd319('0x59')](_0x173d25['campaignsPreview'][_0x173d25[_0xd319('0x15')][_0x359010][_0xd319('0x70')]]['pTalking']),JSON[_0xd319('0x59')](_0x173d25[_0xd319('0x15')][_0x359010][_0xd319('0x71')]),JSON[_0xd319('0x59')](_[_0xd319('0x72')](_0x173d25[_0xd319('0x15')][_0x359010],['contactId',_0xd319('0x73'),'VoiceQueueId',_0xd319('0x74')])));return ami[_0xd319('0x75')]({'action':_0xd319('0x76'),'channel':_0x173d25['actions'][_0x359010][_0xd319('0x77')]})[_0xd319('0x78')](function(_0x177c21){if(_0x177c21[_0xd319('0x4f')]===_0xd319('0x79')){setTimeout(function(){if(_0x173d25[_0xd319('0x15')][_0x359010]){ut[_0xd319('0x7a')](_0x173d25[_0xd319('0x23')][_0x173d25[_0xd319('0x15')][_0x359010][_0xd319('0x70')]],_0xd319('0x7b'));if(_0x173d25['actions'][_0x359010]['dialAnswer']===!![]){ut[_0xd319('0x7c')](_0x173d25[_0xd319('0x23')][_0x173d25['actions'][_0x359010][_0xd319('0x70')]],_0xd319('0x7b'));ut['loggerError'](_0xd319('0x7d')+_0x359010,_0x173d25[_0xd319('0x15')][_0x359010]['queue']);}ut[_0xd319('0x7e')]('[Dialer][checkChannel][Preview]'+_0x359010,_0x173d25[_0xd319('0x15')][_0x359010][_0xd319('0x70')]);delete _0x173d25[_0xd319('0x15')][_0x359010];}},0x2328);}});}});};Preview[_0xd319('0xf')][_0xd319('0x69')]=function(){var _0x33dc6b=this;loggerAction[_0xd319('0x6d')](_0xd319('0x7f'),_['size'](this[_0xd319('0x15')]));for(var _0x58ba75 in this[_0xd319('0x15')]){if(_0x33dc6b[_0xd319('0x15')]['hasOwnProperty'](_0x58ba75)){_0x33dc6b[_0xd319('0x6b')](_0x58ba75);}}};Preview[_0xd319('0xf')]['recallMe']=function(_0x494c23){var _0x50123a=this;rpcDb[_0xd319('0x80')](_0x494c23['id'],ut[_0xd319('0x81')](this[_0xd319('0x82')]))['then'](function(_0x52e9e0){if(!_[_0xd319('0x6c')](_0x52e9e0)){for(var _0x3e626=0x0;_0x3e626<_0x52e9e0[_0xd319('0x83')];_0x3e626+=0x1){if(ut['getDiff'](_0x52e9e0[_0x3e626][_0xd319('0x84')])<_0x494c23[_0xd319('0x85')]*0x3c){if(_0x52e9e0[_0x3e626][_0xd319('0x86')]&&!_0x52e9e0[_0x3e626]['Agent']['voicePause']){_0x50123a[_0xd319('0x87')](_0x52e9e0[_0x3e626]['id'])['then'](ut[_0xd319('0x88')](_0xd319('0x89')))['catch'](ut[_0xd319('0x88')](_0xd319('0x89')));}else{rpcDb[_0xd319('0x8a')](_0x52e9e0[_0x3e626]['id']);}}else{var _0x24c54a=new Action(_0x52e9e0[_0x3e626],_0x494c23);_0x24c54a[_0xd319('0x8b')]=moment()[_0xd319('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x494c23[_0xd319('0x40')]+=0x1;ut[_0xd319('0x8c')](_0x24c54a,0x17,_0xd319('0x8d'));if(_0x494c23[_0xd319('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0xd319('0x8f')](_0x52e9e0[_0x3e626]));rpcDb[_0xd319('0x90')](_0x24c54a,_0xd319('0x91'));}else{ut['logCustomer'](_0x24c54a,0x16,_0xd319('0x92'));rpcDb[_0xd319('0x90')](_0x24c54a,_0xd319('0x93'));rpcDb['createCustomerFinal'](_0x24c54a,_0xd319('0x93'));}}}}})[_0xd319('0x78')](ut['logger2'](_0xd319('0x94')));};Preview[_0xd319('0xf')][_0xd319('0x95')]=function(_0x3c07d1){_0x3c07d1[_0xd319('0x5f')]=!![];if(ut['IsNotLoggedIn'](_0x3c07d1[_0xd319('0x29')])){_0x3c07d1['message']=_0xd319('0x96');}else if(!ut['isActive'](_0x3c07d1[_0xd319('0x32')])){_0x3c07d1[_0xd319('0x4f')]=_0xd319('0x97');}else if(!this['isTrunkReachable'](_0x3c07d1[_0xd319('0x56')])){if(!this[_0xd319('0x98')](_0x3c07d1[_0xd319('0x99')])){_0x3c07d1['message']=_0xd319('0x9a');}else{_0x3c07d1[_0xd319('0x4f')]=_0xd319('0x9b');}}else{_0x3c07d1[_0xd319('0x4f')]='ACTIVE';}emitCampaignPreview(_0x3c07d1);};Preview[_0xd319('0xf')]['callProgressDetectingCustomer']=function(_0x107e86,_0x390cdf,_0x3eda8b){var _0x527562=this;var _0x97992b=this[_0xd319('0x15')][_0x390cdf];var _0x20393c=this['campaignsPreview'][_0x97992b[_0xd319('0x70')]];var _0x46100e;var _0x1ba689=![];var _0x269056=0x2;var _0x2ea3ba=0x3;if(_0x20393c){switch(_0x3eda8b){case'1':_0x20393c[_0xd319('0x3e')]+=0x1;_0x97992b[_0xd319('0x9c')]+=0x1;_0x97992b[_0xd319('0x9d')]=ut[_0xd319('0x9e')](_0x97992b);ut['logCustomer'](_0x97992b,0x0,_0xd319('0x9f'));ami[_0xd319('0x5d')](_0xd319('0xa0'),ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xa2')));rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xa3'));_0x527562[_0xd319('0xa4')](_0x97992b,'0',_0x20393c)[_0xd319('0xa5')](function(_0x3ecab9){_0x1ba689=_0x3ecab9[_0xd319('0xa6')]==0x1;_0x269056=_0x20393c['dialNoSuchNumberRetryFrequency'];_0x2ea3ba=_0x20393c[_0xd319('0xa7')];if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c['dialGlobalMaxRetry']){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,_0xd319('0xa9'));rpcDb['createCustomerFinal'](_0x46100e,_0xd319('0xaa'));}else{if(_0x97992b[_0xd319('0x9c')]>=_0x20393c[_0xd319('0xab')]){rpcDb[_0xd319('0xac')](_0x97992b,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xd319('0xad')](ut[_0xd319('0xae')](_0x97992b,_0xd319('0x9c'),_0x20393c[_0xd319('0xaf')]),_0x97992b[_0xd319('0xb0')],_0x97992b[_0xd319('0xb1')]);}}delete this[_0xd319('0x15')][_0x107e86['linkedid']];}else{_0x97992b[_0xd319('0x9c')]++;logger[_0xd319('0x6d')](_0xd319('0xb2'),_0x97992b[_0xd319('0x9c')]);logger[_0xd319('0x6d')]('id',_0x97992b[_0xd319('0xb3')]);_0x527562[_0xd319('0xb4')]({'id':_0x97992b[_0xd319('0xb3')],'field':{'countnosuchnumberretry':_0x97992b[_0xd319('0x9c')]}})[_0xd319('0xa5')](function(){_0x527562['swapAdditionalPhones'](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});break;case'ANSWER':var _0x3caaa7=moment()[_0xd319('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x97992b[_0xd319('0xb5')]=_0x3caaa7;_0x97992b[_0xd319('0xb6')]=_0x3caaa7;_0x97992b[_0xd319('0x71')]=!![];_0x20393c['pTalking']+=0x1;logger['info'](_0xd319('0xb7'),_0x97992b[_0xd319('0xb8')],'\x20Queue',_0x20393c[_0xd319('0x26')],_0xd319('0xb9'),_0x20393c[_0xd319('0x2a')]);ami['emit'](_0xd319('0xba'),ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xbb'),this[_0xd319('0x23')][_0x97992b[_0xd319('0x70')]]));if(_0x20393c[_0xd319('0xbc')]){ami[_0xd319('0x5d')](_0xd319('0xbd'),ut[_0xd319('0xbe')](_0x97992b));}break;case'16':ami[_0xd319('0x5d')]('custom:agentcomplete',ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xbf'),this[_0xd319('0x23')][_0x97992b['queue']]));emitVoiceQueueChannelRemove(ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xbf')));_0x20393c['outboundAnswerCallsDay']+=0x1;_0x20393c[_0xd319('0x2e')]+=0x1;_0x20393c[_0xd319('0x28')]+=0x1;ut[_0xd319('0x7c')](_0x20393c,_0xd319('0xc0'));_0x97992b['countglobal']=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x4,'Answer');rpcDb[_0xd319('0x90')](_0x97992b,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x97992b,_0xd319('0xc1'));rpcDb[_0xd319('0xc2')](_0x97992b);_0x20393c[_0xd319('0x2b')]+=_0x97992b[_0xd319('0xc3')];_0x20393c['sumBillable']+=_0x97992b[_0xd319('0xc3')];logger['info'](_0xd319('0xc4'),_0x97992b[_0xd319('0xb8')],_0xd319('0xc5'),_0x20393c[_0xd319('0x26')],_0xd319('0xb9'),_0x20393c[_0xd319('0x2a')]);delete this[_0xd319('0x15')][_0x107e86[_0xd319('0xc6')]];break;case _0xd319('0xc7'):_0x20393c[_0xd319('0x39')]+=0x1;_0x97992b[_0xd319('0xc8')]+=0x1;_0x97992b['countglobal']=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x5,'Busy');_0x269056=_0x20393c[_0xd319('0xc9')];_0x2ea3ba=_0x20393c[_0xd319('0xa7')];ami[_0xd319('0x5d')](_0xd319('0xca'),ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xcb')));rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xcc'));_0x527562['verifyAdditionalPhones'](_0x97992b,'5',_0x20393c)[_0xd319('0xa5')](function(_0x5cbe6f){_0x1ba689=_0x5cbe6f[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,'Global');rpcDb[_0xd319('0xac')](_0x46100e,_0xd319('0xce'));}else{if(_0x97992b[_0xd319('0xc8')]>=_0x20393c[_0xd319('0xcf')]){rpcDb[_0xd319('0xac')](_0x97992b,_0xd319('0xcc'));}else{rpcDb[_0xd319('0xad')](ut[_0xd319('0xae')](_0x97992b,_0xd319('0xc8'),_0x20393c[_0xd319('0xc9')]),_0x97992b[_0xd319('0xb0')],_0x97992b[_0xd319('0xb1')]);}}}else{_0x97992b['countbusyretry']++;_0x527562[_0xd319('0xb4')]({'id':_0x97992b[_0xd319('0xb3')],'field':{'countbusyretry':_0x97992b[_0xd319('0xc8')]}})['then'](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)['then'](function(){});});}});break;case _0xd319('0xd1'):_0x20393c[_0xd319('0x3d')]+=0x1;_0x97992b[_0xd319('0xd2')]+=0x1;_0x97992b[_0xd319('0x9d')]=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x3,_0xd319('0xd3'));_0x269056=_0x20393c[_0xd319('0xd4')];_0x2ea3ba=_0x20393c['callAdditionalPhoneAfterMin'];var _0x155a6c=ut['buildNoAnswerEventPayload'](_0x97992b,_0x20393c);ami[_0xd319('0x5d')](_0xd319('0xd5'),_0x155a6c);rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xd6'));_0x527562[_0xd319('0xa4')](_0x97992b,'3',_0x20393c)[_0xd319('0xa5')](function(_0x2a4580){_0x1ba689=_0x2a4580['additional']==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,_0xd319('0xa9'));rpcDb[_0xd319('0xac')](_0x46100e,_0xd319('0xd7'));}else{if(_0x97992b[_0xd319('0xd2')]>=_0x20393c[_0xd319('0xd8')]){rpcDb[_0xd319('0xac')](_0x97992b,_0xd319('0xd6'));}else{rpcDb[_0xd319('0xad')](ut['scheduledAt'](_0x97992b,_0xd319('0xd2'),_0x20393c['dialNoAnswerRetryFrequency']),_0x97992b[_0xd319('0xb0')],_0x97992b[_0xd319('0xb1')]);}}}else{_0x97992b['countnoanswerretry']++;_0x527562[_0xd319('0xb4')]({'id':_0x97992b['idContact'],'field':{'countnoanswerretry':_0x97992b[_0xd319('0xd2')]}})[_0xd319('0xa5')](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});break;case _0xd319('0xd9'):_0x20393c[_0xd319('0x3a')]+=0x1;_0x97992b[_0xd319('0xda')]+=0x1;_0x97992b[_0xd319('0x9d')]=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x8,_0xd319('0xdb'));_0x269056=_0x20393c['dialCongestionRetryFrequency'];_0x2ea3ba=_0x20393c[_0xd319('0xa7')];ami['emit'](_0xd319('0xdc'),ut[_0xd319('0xa1')](_0x97992b,'congestion'));rpcDb[_0xd319('0x90')](_0x97992b,'[callProgressDetectingCustomer][logCongestion]');_0x527562[_0xd319('0xa4')](_0x97992b,'8',_0x20393c)[_0xd319('0xa5')](function(_0x72bddf){_0x1ba689=_0x72bddf[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,'Global');rpcDb['createCustomerFinal'](_0x46100e,_0xd319('0xdd'));}else{if(_0x97992b['countcongestionretry']>=_0x20393c[_0xd319('0xde')]){rpcDb[_0xd319('0xac')](_0x97992b,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd319('0xad')](ut[_0xd319('0xae')](_0x97992b,'countcongestionretry',_0x20393c[_0xd319('0xc9')]),_0x97992b[_0xd319('0xb0')],_0x97992b['activeContact']);}}}else{_0x97992b[_0xd319('0xda')]++;_0x527562[_0xd319('0xb4')]({'id':_0x97992b[_0xd319('0xb3')],'field':{'countcongestionretry':_0x97992b[_0xd319('0xda')]}})[_0xd319('0xa5')](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});break;case'CANCEL':_0x20393c[_0xd319('0x41')]+=0x1;_0x97992b[_0xd319('0xdf')]+=0x1;_0x97992b[_0xd319('0x9d')]=ut['totalGlobal'](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x14,_0xd319('0xe0'));_0x269056=_0x20393c[_0xd319('0xe1')];_0x2ea3ba=_0x20393c[_0xd319('0xa7')];ami[_0xd319('0x5d')]('custom:agentreject',ut[_0xd319('0xa1')](_0x97992b,'agentreject'));rpcDb['createCustomerHistory'](_0x97992b,_0xd319('0xe2'));_0x527562[_0xd319('0xa4')](_0x97992b,'20',_0x20393c)[_0xd319('0xa5')](function(_0x103339){_0x1ba689=_0x103339['additional']==0x1;if(!_0x1ba689){if(ut['totalGlobal'](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0x14,_0xd319('0xe0'));rpcDb[_0xd319('0xac')](_0x46100e,_0xd319('0xe3'));}else{if(_0x97992b[_0xd319('0xdf')]>=_0x20393c[_0xd319('0xe4')]){rpcDb[_0xd319('0xac')](_0x97992b,_0xd319('0xe3'));}else{rpcDb[_0xd319('0xad')](ut[_0xd319('0xae')](_0x97992b,'countagentrejectretry',_0x20393c[_0xd319('0xe1')]),_0x97992b[_0xd319('0xb0')],_0x97992b[_0xd319('0xb1')]);}}}else{_0x97992b[_0xd319('0xd2')]++;_0x527562['incrementPreviewCounters']({'id':_0x97992b[_0xd319('0xb3')],'field':{'countnoanswerretry':_0x97992b[_0xd319('0xd2')]}})[_0xd319('0xa5')](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});break;case'ABANDONED':_0x20393c[_0xd319('0x42')]+=0x1;_0x97992b[_0xd319('0xe5')]+=0x1;_0x97992b['countglobal']=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0xb,'Abandoned');rpcDb[_0xd319('0x90')](_0x97992b,'[callProgressDetectingCustomer][logAbandoned]');_0x527562[_0xd319('0xa4')](_0x97992b,'11',_0x20393c)[_0xd319('0xa5')](function(_0x572ec4){_0x1ba689=_0x572ec4[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut['totalGlobal'](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut['cloneAction'](_0x97992b,0xf,'Global');rpcDb[_0xd319('0xac')](_0x46100e,_0xd319('0xe6'));}else{if(_0x97992b['countabandonedetry']>=_0x20393c[_0xd319('0xe7')]){rpcDb['createCustomerFinal'](_0x97992b,_0xd319('0xe6'));}else{rpcDb[_0xd319('0xad')](ut[_0xd319('0xae')](_0x97992b,_0xd319('0xe5'),_0x20393c[_0xd319('0xe8')]),_0x97992b[_0xd319('0xb0')],_0x97992b[_0xd319('0xb1')]);}}}else{_0x97992b[_0xd319('0xd2')]++;_0x527562[_0xd319('0xb4')]({'id':_0x97992b[_0xd319('0xb3')],'field':{'countnoanswerretry':_0x97992b[_0xd319('0xd2')]}})[_0xd319('0xa5')](function(){_0x527562['swapAdditionalPhones'](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});break;case'18':_0x20393c['outboundUnknownCallsDay']+=0x1;_0x97992b[_0xd319('0xe9')]+=0x1;_0x97992b[_0xd319('0x9d')]=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x12,_0x107e86[_0xd319('0xea')]||_0x107e86[_0xd319('0xeb')]);ami['emit'](_0xd319('0xec'),ut[_0xd319('0xa1')](_0x97992b,_0xd319('0xed')));rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xee'));_0x527562[_0xd319('0xa4')](_0x97992b,'18',_0x20393c)['then'](function(_0x401491){_0x1ba689=_0x401491[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0x12,_0xd319('0xa9'));rpcDb['createCustomerFinal'](_0x46100e,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xd319('0xac')](_0x97992b,_0xd319('0xee'));}}else{_0x97992b[_0xd319('0xd2')]++;_0x527562['incrementPreviewCounters']({'id':_0x97992b[_0xd319('0xb3')],'field':{'countnoanswerretry':_0x97992b['countnoanswerretry']}})['then'](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)['then'](function(){});});}});delete this[_0xd319('0x15')][_0x107e86[_0xd319('0xc6')]];break;case'19':_0x20393c[_0xd319('0xef')]+=0x1;_0x97992b['countglobal']=ut[_0xd319('0x9e')](_0x97992b);ut[_0xd319('0x8c')](_0x97992b,0x13,_0x107e86[_0xd319('0xea')]||_0x107e86[_0xd319('0xeb')]);ami[_0xd319('0x5d')](_0xd319('0xec'),ut[_0xd319('0xa1')](_0x97992b,'amd'));rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xf0'));_0x527562[_0xd319('0xa4')](_0x97992b,'18',_0x20393c)[_0xd319('0xa5')](function(_0x6b577){_0x1ba689=_0x6b577[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c[_0xd319('0xcd')]){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,_0xd319('0xa9'));rpcDb['createCustomerFinal'](_0x46100e,_0xd319('0xf0'));}else{rpcDb[_0xd319('0xac')](_0x97992b,'[callProgressDetectingCustomer][machine]');}}else{_0x97992b[_0xd319('0xd2')]++;_0x527562[_0xd319('0xb4')]({'id':_0x97992b[_0xd319('0xb3')],'field':{'countnoanswerretry':_0x97992b[_0xd319('0xd2')]}})[_0xd319('0xa5')](function(){_0x527562[_0xd319('0xd0')](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});});}});delete this['actions'][_0x107e86[_0xd319('0xc6')]];break;default:if(_0x97992b['dialAnswer']){ut[_0xd319('0x7c')](_0x20393c,'[default]');ut[_0xd319('0x7e')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x20393c[_0xd319('0x26')],_0x107e86);}_0x20393c[_0xd319('0xef')]+=0x1;_0x97992b['countglobal']=ut[_0xd319('0x9e')](_0x97992b);ut['logCustomer'](_0x97992b,0xc,_0x107e86[_0xd319('0xea')]||_0x107e86[_0xd319('0xeb')]);_0x269056=_0x20393c[_0xd319('0xe1')];_0x2ea3ba=_0x20393c[_0xd319('0xa7')];rpcDb[_0xd319('0x90')](_0x97992b,_0xd319('0xf1'));_0x527562['verifyAdditionalPhones'](_0x97992b,'20',_0x20393c)[_0xd319('0xa5')](function(_0x4592e2){_0x1ba689=_0x4592e2[_0xd319('0xa6')]==0x1;if(!_0x1ba689){if(ut[_0xd319('0x9e')](_0x97992b)>=_0x20393c['dialGlobalMaxRetry']){_0x46100e=ut[_0xd319('0xa8')](_0x97992b,0xf,_0xd319('0xa9'));rpcDb[_0xd319('0xac')](_0x46100e,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd319('0xac')](_0x97992b,_0xd319('0xf2'));}delete this['actions'][_0x107e86[_0xd319('0xc6')]];}else{_0x527562['swapAdditionalPhones'](_0x97992b,_0x269056,_0x2ea3ba)[_0xd319('0xa5')](function(){});}});}if(!(_0x97992b[_0xd319('0x71')]&&_0x3eda8b==='16')){ut['updateOriginated'](_0x20393c,_0xd319('0xf3'));logger[_0xd319('0x6d')](_0xd319('0xf4'),_0x97992b[_0xd319('0xb8')],'\x20Queue',_0x20393c[_0xd319('0x26')],_0xd319('0xf5'),_0x20393c[_0xd319('0x50')]);}if(_0x3eda8b!==_0xd319('0xf6')){delete this['actions'][_0x107e86[_0xd319('0xc6')]];delete this[_0xd319('0x15')][_0x107e86[_0xd319('0xf7')]];}}};Preview[_0xd319('0xf')][_0xd319('0xf8')]=function(_0x479b53,_0x4d6b04,_0xf86a27){if(_[_0xd319('0xf9')](_0x4d6b04)&&_0xd319('0xfa')!==typeof _0x4d6b04){return;}if(_[_0xd319('0xf9')](_0xf86a27)&&'object'!==typeof _0xf86a27){return;}switch(_0xf86a27[_0xd319('0xfb')]){case'0':ut[_0xd319('0xfc')](_0x479b53,0x0,_0xd319('0x9f'));rpcDb[_0xd319('0xfd')](_0x479b53,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xd319('0xfc')](_0x479b53,0x3,_0xd319('0xd3'));rpcDb['createAgentHistory'](_0x479b53,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x479b53,0x5,_0xd319('0xfe'));rpcDb[_0xd319('0xfd')](_0x479b53,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x479b53,0x8,_0xd319('0xdb'));rpcDb[_0xd319('0xfd')](_0x479b53,_0xd319('0xff'));break;case'22':ut['logAgent'](_0x479b53,0x16,_0xd319('0x100'));rpcDb[_0xd319('0xfd')](_0x479b53,_0xd319('0x101'));break;default:ut[_0xd319('0xfc')](_0x479b53,0xc,_0xf86a27[_0xd319('0xfb')]);rpcDb[_0xd319('0xfd')](_0x479b53,_0xd319('0xff'));}ut[_0xd319('0x7a')](_0x4d6b04,'[callProgressDetectingAgent]');logger[_0xd319('0x6d')]('[originated][decrement][callProgressDetectingAgent]',_0x479b53[_0xd319('0xb8')],'\x20Queue',_0x4d6b04[_0xd319('0x26')],'originated:\x20',_0x4d6b04['originated']);delete this['actions'][_0x479b53[_0xd319('0xb8')]];};Preview[_0xd319('0xf')]['verifyAdditionalPhones']=function(_0x40fda3,_0x48de69,_0xfda5ff){return Promise[_0xd319('0x102')]()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x40fda3,_0x48de69,_0xfda5ff))['catch'](logger[_0xd319('0x6d')](_0xd319('0x103')));};Preview[_0xd319('0xf')][_0xd319('0xd0')]=function(_0x3ac6da,_0xc7c2b7,_0x4baff7){return Promise[_0xd319('0x102')]()[_0xd319('0xa5')](cmHopperAdditionalPhone[_0xd319('0xd0')](_0x3ac6da,_0xc7c2b7,_0x4baff7))[_0xd319('0x78')](logger[_0xd319('0x6d')](_0xd319('0x104')));};Preview[_0xd319('0xf')][_0xd319('0xb4')]=function(_0x1dc0af){return Promise[_0xd319('0x102')]()[_0xd319('0xa5')](cmHopperAdditionalPhone[_0xd319('0xb4')](_0x1dc0af))['catch'](logger[_0xd319('0x6d')]('[incrementPreviewCounters]\x20'));};Preview[_0xd319('0xf')][_0xd319('0x105')]=function(_0x29ed5e,_0x5afa1f,_0x4424bf,_0x34648b,_0x40359a){var _0x24a6a9=this;return new Promise(function(_0x4d2ca9,_0x258f98){if(_[_0xd319('0x6c')](_0x5afa1f)||_[_0xd319('0x6c')](_0x5afa1f['Contact'])||_[_0xd319('0x6c')](_0x5afa1f[_0xd319('0x106')])||_[_0xd319('0x6c')](_0x5afa1f[_0xd319('0x107')])){_0x258f98(ut[_0xd319('0x4f')]('Contact\x20is\x20undefined',_0x34648b,_0x40359a));return;}var _0x8d4dd2=uuid['v4']();var _0x4d88eb=_0x24a6a9[_0xd319('0x23')][_0x5afa1f['Queue'][_0xd319('0x26')]];var _0x17bd9e=_0x4424bf?_0x24a6a9[_0xd319('0x82')][_0x4424bf]['id']:undefined;_0x24a6a9['actions'][_0x8d4dd2]=new Action(_0x5afa1f,_0x4d88eb,_0x8d4dd2,_0x4424bf,_0x17bd9e);var _0x13834f=_0x24a6a9[_0xd319('0x15')][_0x8d4dd2];_0x13834f[_0xd319('0xb0')]=_0x34648b;_0x13834f[_0xd319('0xb1')]=_0x40359a;_0x13834f['lookAgent']=_0x4424bf;if(_['isEmpty'](_0x29ed5e)){_0x24a6a9[_0xd319('0x108')](_0x13834f,_0x4d88eb,_0x5afa1f,_0x4424bf)[_0xd319('0xa5')](function(_0x5b76c1){logger[_0xd319('0x6d')](_0xd319('0x109'),_0xd319('0x10a')+_0x13834f[_0xd319('0x70')]+_0xd319('0x10b')+_0x13834f['idContact'],JSON[_0xd319('0x59')](_0x5b76c1));ami[_0xd319('0x5d')](_0xd319('0x10c'),ut[_0xd319('0xa1')](_0x13834f,_0xd319('0x10d'),_0x24a6a9[_0xd319('0x23')][_0x13834f[_0xd319('0x70')]]));_0x4d2ca9(ut[_0xd319('0x4f')]('Calling'));})[_0xd319('0x78')](function(_0x477b66){ut[_0xd319('0x62')](_0xd319('0x10e'),_0x477b66);_0x258f98(ut[_0xd319('0x4f')](_0xd319('0x10f'),_0x34648b,_0x40359a));});}else{_0x4d88eb[_0xd319('0x110')]+=0x1;ut['logBlacklist'](_0x13834f);rpcDb['createHistory'](_0x13834f,_0xd319('0x111'));delete _0x24a6a9[_0xd319('0x15')][_0x8d4dd2];_0x258f98(ut[_0xd319('0x4f')](_0xd319('0x112'),_0x34648b,_0x40359a));}});};Preview[_0xd319('0xf')][_0xd319('0x98')]=function(_0x1a4049){return!_[_0xd319('0x6c')](_0x1a4049)&&!_[_0xd319('0x6c')](_0x1a4049[_0xd319('0x26')])&&!_[_0xd319('0x6c')](_0x1a4049[_0xd319('0x57')])&&_0x1a4049[_0xd319('0x57')]&&!_[_0xd319('0x6c')](this[_0xd319('0x14')][util[_0xd319('0x5b')]('SIP/%s',_0x1a4049[_0xd319('0x26')])])&&!_[_0xd319('0x6c')](this[_0xd319('0x14')][util[_0xd319('0x5b')](_0xd319('0x113'),_0x1a4049['name'])][_0xd319('0x76')])&&(this[_0xd319('0x14')][util[_0xd319('0x5b')]('SIP/%s',_0x1a4049[_0xd319('0x26')])]['status']===_0xd319('0x114')||this[_0xd319('0x14')][util[_0xd319('0x5b')](_0xd319('0x113'),_0x1a4049['name'])]['status']===_0xd319('0x115'));};Preview[_0xd319('0xf')][_0xd319('0x87')]=function(_0x570915,_0x273df9){var _0x94dbad=this;return new Promise(function(_0x1a8522,_0x2162a9){_0x94dbad['execRun'](_0x570915,_0x273df9)[_0xd319('0xa5')](function(_0x45dff9){_0x1a8522(_[_0xd319('0x72')](_0x45dff9,['message']));})['catch'](function(_0x4844bf){if(_0x4844bf['unlock']){rpcDb[_0xd319('0x116')](_0x570915);}if(_0x4844bf[_0xd319('0x57')]){rpcDb[_0xd319('0x8a')](_0x570915);}_0x2162a9(_['pick'](_0x4844bf,[_0xd319('0x4f')]));});});};Preview[_0xd319('0xf')][_0xd319('0x117')]=function(_0x396822,_0x4946d2){var _0x29d091=this;return new Promise(function(_0x36789a,_0x17b63e){var _0x2e03e4,_0x5135aa;rpcDb['getContactPreview'](_0x396822)[_0xd319('0xa5')](function(_0x2c6a1f){if(!_[_0xd319('0x6c')](_0x2c6a1f[0x0])){_0x5135aa=_0x2c6a1f[0x0][_0xd319('0x118')]?![]:!![];_0x2e03e4=_0x2c6a1f[0x0][_0xd319('0x118')]?!![]:![];_0x2e03e4=_0x4946d2?!![]:_0x2e03e4;}var _0x393d24=_0x29d091[_0xd319('0x119')](_0x2c6a1f);if(_0x393d24[_0xd319('0x11a')]){rpcDb[_0xd319('0x11b')](_[_0xd319('0x72')](_0x2c6a1f[0x0],['VoiceQueueId',_0xd319('0x106')]))[_0xd319('0xa5')](function(_0x4e2ab4){_0x29d091[_0xd319('0x105')](_0x4e2ab4,_0x2c6a1f[0x0],_0x4946d2,_0x5135aa,_0x2e03e4)[_0xd319('0xa5')](function(_0x2dc91e){_0x36789a(_0x2dc91e);})['catch'](function(_0x1f4329){_0x17b63e(_0x1f4329);});})[_0xd319('0x78')](function(_0x197a15){ut[_0xd319('0x62')](_0xd319('0x11c'),_0x197a15);_0x17b63e(ut[_0xd319('0x4f')](_0xd319('0x11d'),_0x5135aa,_0x2e03e4));});}else{_0x17b63e(ut[_0xd319('0x4f')](_0x393d24[_0xd319('0x4f')],_0x5135aa,_0x2e03e4));}})[_0xd319('0x78')](function(_0xf6fd3b){ut['logger'](_0xd319('0x11e'),_0xf6fd3b);_0x17b63e(ut['message'](_0xd319('0x11d'),![],!![]));});});};Preview[_0xd319('0xf')]['validateContact']=function(_0x9efd3c){if(_[_0xd319('0x6c')](_0x9efd3c)||_[_0xd319('0x11f')](_0x9efd3c)||!_[_0xd319('0x6c')](_0x9efd3c[0x0][_0xd319('0x86')])&&_[_0xd319('0x6c')](_0x9efd3c[0x0]['Agent']['name'])){ut[_0xd319('0x62')]('[Preview][validateContact][Empty\x20Contact]',_0x9efd3c);return{'isValid':![],'message':_0xd319('0x120')};}var _0x49f6ae=this[_0xd319('0x23')][_0x9efd3c[0x0]['Queue'][_0xd319('0x26')]];_0x49f6ae[_0xd319('0x4f')]='ACTIVE';if(_[_0xd319('0x6c')](_0x49f6ae)){ut[_0xd319('0x62')](_0xd319('0x121'),_0x49f6ae);return{'isValid':![],'message':_0xd319('0x122')};}if(!this[_0xd319('0x98')](_0x49f6ae[_0xd319('0x56')])){ut[_0xd319('0x62')](_0xd319('0x123'),'campaign\x20Name:\x20'+_0x49f6ae[_0xd319('0x26')]+_0xd319('0x124'));if(!this['isTrunkReachable'](_0x49f6ae[_0xd319('0x99')])){ut[_0xd319('0x62')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x49f6ae[_0xd319('0x26')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xd319('0x125')};}}if(!ut[_0xd319('0x126')](_0x49f6ae[_0xd319('0x32')])){ut['logger'](_0xd319('0x127'),_0x49f6ae[_0xd319('0x26')]+_0xd319('0x128'));return{'isValid':![],'message':_0xd319('0x129')+_0x49f6ae[_0xd319('0x26')]+_0xd319('0x128')};}return{'isValid':!![],'message':_0xd319('0x12a')};};Preview['prototype']['execCall']=function(_0x5bc1b9,_0x5a52f9,_0x29b549,_0x96c313){var _0x5a5c6b=this;return new Promise(function(_0x423981,_0x1f0f7a){var _0x30b4d0=_0x5bc1b9[_0xd319('0xb8')];var _0xc9041f=_0x5a5c6b[_0xd319('0x98')](_0x5a52f9[_0xd319('0x56')])?util[_0xd319('0x5b')](_0xd319('0x12b'),_0x5a52f9[_0xd319('0x56')][_0xd319('0x26')],_['isNil'](_0x5a52f9[_0xd319('0x36')])?'':_0x5a52f9['dialPrefix'][_0xd319('0x12c')]()||'',_0x5a52f9[_0xd319('0x12d')]>0x0?_0x29b549['phone'][_0xd319('0x12e')](_0x5a52f9[_0xd319('0x12d')]):_0x29b549[_0xd319('0x106')]):util[_0xd319('0x5b')](_0xd319('0x12b'),_[_0xd319('0x6c')](_0x5a52f9['TrunkBackup'])?_0x5a52f9[_0xd319('0x56')][_0xd319('0x26')]:_0x5a52f9[_0xd319('0x99')][_0xd319('0x26')],_['isNil'](_0x5a52f9['dialPrefix'])?'':_0x5a52f9['dialPrefix'][_0xd319('0x12c')]()||'',_0x5a52f9[_0xd319('0x12d')]>0x0?_0x29b549[_0xd319('0x106')][_0xd319('0x12e')](_0x5a52f9[_0xd319('0x12d')]):_0x29b549[_0xd319('0x106')]);var _0x4e240f=_0x5a5c6b[_0xd319('0x98')](_0x5a52f9[_0xd319('0x56')])?ut[_0xd319('0x12f')](_0x5a52f9['Trunk'][_0xd319('0x130')],_0x5a52f9['dialOriginateCallerIdName'],_0x5a52f9[_0xd319('0x131')]>0x0?ut[_0xd319('0x132')](_0x5a52f9[_0xd319('0x133')],_0x5a52f9[_0xd319('0x131')]):_0x5a52f9[_0xd319('0x133')]):ut['getCallerId'](_[_0xd319('0x6c')](_0x5a52f9[_0xd319('0x99')])?_0x5a52f9[_0xd319('0x56')][_0xd319('0x130')]:_0x5a52f9[_0xd319('0x99')]['callerid'],_0x5a52f9[_0xd319('0x34')],_0x5a52f9['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x5a52f9[_0xd319('0x133')],_0x5a52f9[_0xd319('0x131')]):_0x5a52f9[_0xd319('0x133')]);if(_0x4e240f){_0x5bc1b9[_0xd319('0x134')]=ut[_0xd319('0x135')](_0x4e240f);_0x5bc1b9['originatecalleridnum']=ut['extractCalleridNumber'](_0x4e240f);}var _0x34c854=ut['addVariables'](_0x5a52f9,_0x29b549,_0xc9041f,_0x4e240f,_0x30b4d0,_0x5bc1b9);_[_0xd319('0x136')](_0x5bc1b9,ut[_0xd319('0x137')](_0x34c854));_0x5bc1b9['starttime']=moment()[_0xd319('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a52f9[_0xd319('0x138')]=_0x34c854;ami['Action'](ut[_0xd319('0x139')](_0x5bc1b9,_0x5a52f9,_0x34c854,_0x5bc1b9[_0xd319('0xb1')],_0x96c313))[_0xd319('0xa5')](function(_0x322fd3){_0x5a52f9[_0xd319('0x50')]+=0x1;logger[_0xd319('0x6d')](_0xd319('0x13a'),_0x30b4d0,_0xd319('0xc5'),_0x5a52f9[_0xd319('0x26')],'originated:\x20',_0x5a52f9[_0xd319('0x50')]);_0x423981(_0x322fd3);})[_0xd319('0x78')](function(_0x5df170){ut[_0xd319('0xfc')](_0x5bc1b9,0xe,_0xd319('0x13b'));rpcDb[_0xd319('0xfd')](_0x5bc1b9,_0xd319('0x13c'));_0x1f0f7a(_0x5df170);});});};Preview['prototype']['syncNewExten']=function(_0x3d7b6b){if(this['actions'][_0x3d7b6b[_0xd319('0xc6')]]){this[_0xd319('0x15')][_0x3d7b6b['linkedid']]['channel']=_0x3d7b6b[_0xd319('0x77')];}};Preview[_0xd319('0xf')][_0xd319('0x13d')]=function(_0x192f9c){var _0x253461=this;var _0x5a5523=this[_0xd319('0x15')][_0x192f9c[_0xd319('0x13e')]];if(_0x5a5523){if(_0x5a5523['lookAgent']&&this[_0xd319('0x82')][_0x5a5523[_0xd319('0x13f')]]){ut[_0xd319('0x140')](_0x5a5523,this[_0xd319('0x82')][_0x5a5523[_0xd319('0x13f')]]['name'],this[_0xd319('0x82')][_0x5a5523[_0xd319('0x13f')]]['id']);}var _0x71208f=_['clone'](_0x5a5523);_0x71208f[_0xd319('0xb5')]=moment()[_0xd319('0x5b')](_0xd319('0x141'));var _0x3e1547=_0x253461[_0xd319('0x23')][_0x5a5523[_0xd319('0x70')]];if(ut[_0xd319('0x142')](_0x192f9c[_0xd319('0x143')])){if(_0x5a5523[_0xd319('0xb0')]){rpcDb['unlockContact'](_0x5a5523[_0xd319('0xb3')]);}if(_0x5a5523[_0xd319('0xb1')]){rpcDb['disableContact'](_0x5a5523[_0xd319('0xb3')]);}ami[_0xd319('0x5d')](_0xd319('0x144'),ut[_0xd319('0xa1')](_0x5a5523,_0xd319('0x145'),this['campaignsPreview'][_0x5a5523[_0xd319('0x70')]]));this['callProgressDetectingAgent'](_0x71208f,_0x3e1547,_0x192f9c);}else{_0x5a5523[_0xd319('0x8b')]=moment()[_0xd319('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xd319('0xfc')](_0x71208f,0x4,_0xd319('0x146'));rpcDb['createAgentHistory'](_0x71208f,_0xd319('0x147'));}}};Preview[_0xd319('0xf')][_0xd319('0x148')]=function(_0x58756e){var _0x34569a=this[_0xd319('0x15')][_0x58756e[_0xd319('0xc6')]];var _0x447ba6;if(_0x34569a){_0x447ba6=this[_0xd319('0x23')][_0x34569a[_0xd319('0x70')]];logger[_0xd319('0x6d')](_0xd319('0x149'),_0x58756e[_0xd319('0xc6')],_0xd319('0xc5'),_0x447ba6[_0xd319('0x26')],_0xd319('0xb9'),_0x447ba6[_0xd319('0x2a')]);}if(this[_0xd319('0x15')][_0x58756e[_0xd319('0xc6')]]&&_0x58756e[_0xd319('0xc6')]!==_0x58756e[_0xd319('0xb8')]){if(_0x58756e[_0xd319('0x14a')]==='16'&&this[_0xd319('0x15')][_0x58756e[_0xd319('0xc6')]][_0xd319('0x71')]){this['callProgressDetectingCustomer'](_0x58756e,_0x58756e['linkedid'],_0x58756e[_0xd319('0x14a')]);}else if(this[_0xd319('0x15')][_0x58756e['linkedid']][_0xd319('0x71')]){logger[_0xd319('0x6d')](_0xd319('0x14b'),_0x58756e[_0xd319('0xc6')],_0x58756e[_0xd319('0x14a')],_0xd319('0xc5'),_0x447ba6[_0xd319('0x26')],_0xd319('0xb9'),_0x447ba6[_0xd319('0x2a')]);this['callProgressDetectingCustomer'](_0x58756e,_0x58756e[_0xd319('0xc6')],_0x58756e[_0xd319('0x14a')]);}}else if(_0x34569a&&_[_0xd319('0x6c')](_0x34569a[_0xd319('0x14c')])&&_0x447ba6[_0xd319('0x14d')]&&_0x58756e['linkedid']===_0x58756e[_0xd319('0xb8')]&&_[_0xd319('0x6c')](_0x58756e[_0xd319('0xfb')])&&_0x58756e[_0xd319('0x14a')]==='16'&&_0x58756e[_0xd319('0x14e')]==='6'&&_[_0xd319('0xf9')](_0x34569a[_0xd319('0x14f')])){if(_0x34569a[_0xd319('0xb0')]){rpcDb[_0xd319('0x116')](_0x34569a[_0xd319('0xb3')]);}if(_0x34569a[_0xd319('0xb1')]){rpcDb[_0xd319('0x8a')](_0x34569a[_0xd319('0xb3')]);}_0x58756e[_0xd319('0xfb')]='22';this[_0xd319('0xf8')](_0x34569a,_0x447ba6,_0x58756e);}else if(_0x34569a&&_0x34569a['transfer']){if(_0x58756e['cause']==='16'&&this['actions'][_0x58756e[_0xd319('0xc6')]][_0xd319('0x71')]){logger['info'](_0xd319('0x150'),_0x58756e[_0xd319('0xc6')],_0x58756e[_0xd319('0x14a')],_0xd319('0xc5'),_0x447ba6[_0xd319('0x26')],_0xd319('0xb9'),_0x447ba6['pTalking']);this[_0xd319('0x151')](_0x58756e,_0x58756e[_0xd319('0xc6')],_0x58756e['cause']);}else if(this[_0xd319('0x15')][_0x58756e['linkedid']][_0xd319('0x71')]){logger[_0xd319('0x6d')](_0xd319('0x14b'),_0x58756e[_0xd319('0xc6')],_0x58756e[_0xd319('0x14a')],'\x20Queue',_0x447ba6['name'],_0xd319('0xb9'),_0x447ba6[_0xd319('0x2a')]);this['callProgressDetectingCustomer'](_0x58756e,_0x58756e[_0xd319('0xc6')],_0x58756e[_0xd319('0x14a')]);}}};Preview[_0xd319('0xf')][_0xd319('0x152')]=function(_0x3dc117){if(this['actions'][_0x3dc117['destlinkedid']]&&_0x3dc117['destlinkedid']!==_0x3dc117[_0xd319('0x153')]){this[_0xd319('0x151')](_0x3dc117,_0x3dc117[_0xd319('0xf7')],_0x3dc117[_0xd319('0xeb')]);}};Preview[_0xd319('0xf')]['syncHangupRequest']=function(_0x17f10a){if(this[_0xd319('0x15')][_0x17f10a[_0xd319('0xc6')]]&&_0x17f10a[_0xd319('0xc6')]!==_0x17f10a[_0xd319('0xb8')]&&!this['actions'][_0x17f10a[_0xd319('0xc6')]][_0xd319('0x71')]){if(_0x17f10a[_0xd319('0x14a')]==='1'){this[_0xd319('0x151')](_0x17f10a,_0x17f10a[_0xd319('0xc6')],_0x17f10a[_0xd319('0x14a')]);}}};Preview[_0xd319('0xf')]['addVariable']=function(_0x275a1a,_0xd08300,_0x114dfd){if(this[_0xd319('0x15')][_0x275a1a]){if(_[_0xd319('0x6c')](this['actions'][_0x275a1a][_0xd319('0x138')])){this[_0xd319('0x15')][_0x275a1a][_0xd319('0x138')]={};}this['actions'][_0x275a1a]['variables'][_0xd08300]=_0x114dfd;}};Preview[_0xd319('0xf')][_0xd319('0x1e')]=function(_0x1bc49f){try{if(!_[_0xd319('0x6c')](_0x1bc49f)){if(ut[_0xd319('0x154')](_[_0xd319('0x155')](_0x1bc49f[_0xd319('0x156')])[0x0])){this[_0xd319('0x157')](_0x1bc49f[_0xd319('0xb8')],_[_0xd319('0x155')](_0x1bc49f[_0xd319('0x156')])[0x0],_0x1bc49f['value']);}}}catch(_0x5d0dc9){logger[_0xd319('0x158')](_0xd319('0x159'),util[_0xd319('0x15a')](_0x5d0dc9,{'showHidden':![],'depth':null}));}};Preview[_0xd319('0xf')][_0xd319('0x1f')]=function(_0x3a1fea){if(_0x3a1fea){if(this[_0xd319('0x15')][_0x3a1fea[_0xd319('0x15b')]]){this[_0xd319('0x15')][_0x3a1fea['transfertargetlinkedid']][_0xd319('0x14f')]=!![];}}};Preview[_0xd319('0xf')][_0xd319('0x21')]=function(_0x418cc7){if(_0x418cc7){if(this['actions'][_0x418cc7[_0xd319('0x15c')]]){this[_0xd319('0x15')][_0x418cc7[_0xd319('0x15c')]][_0xd319('0x14f')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x3b03=['name','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','loopCampaigns','syncCampaigns','clockClearZombieChannels','dialMethod','booked','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','hasOwnProperty','getContactRecallMe','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','setMessage','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','then','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','\x20IdHopper:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','YYYY-MM-DD\x20HH:mm:ss','variables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','response','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','isUndefined','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','uuid','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','finally','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncVarSet','campaignsPreview','emit','outbound'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x3b03,0x13a));var _0x33b0=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3b03[_0x43d11d];return _0x38cd08;};'use strict';var util=require(_0x33b0('0x0'));var _=require('lodash');var uuid=require(_0x33b0('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x33b0('0x2'));var config=require(_0x33b0('0x3'));var logger=require(_0x33b0('0x4'))(_0x33b0('0x5'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x33b0('0x6'));var rpcDb=require(_0x33b0('0x7'));var cmHopperAdditionalPhone=require(_0x33b0('0x8'));var Action=require(_0x33b0('0x9'));var ut=require(_0x33b0('0xa'));config[_0x33b0('0xb')]=_['defaults'](config[_0x33b0('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x33b0('0xc'))(new Redis(config[_0x33b0('0xb')]));var Sequence=function(){};Sequence[_0x33b0('0xd')][_0x33b0('0xe')]=function(_0x39dc62){this[_0x33b0('0xf')]=this[_0x33b0('0xf')]?this['tail'][_0x33b0('0x10')](_0x39dc62):_0x39dc62();};function Preview(_0xec3f16){this['sequence']=new Sequence();this['campaignsPreview']=_0xec3f16[_0x33b0('0x11')];this[_0x33b0('0x12')]=_0xec3f16[_0x33b0('0x12')];this[_0x33b0('0x13')]={};this[_0x33b0('0x14')]=_0xec3f16[_0x33b0('0x14')];this['clockClearZombieChannels']=0x0;ami['on'](_0x33b0('0x15'),this[_0x33b0('0x16')][_0x33b0('0x17')](this));ami['on'](_0x33b0('0x18'),this[_0x33b0('0x19')][_0x33b0('0x17')](this));ami['on'](_0x33b0('0x1a'),this[_0x33b0('0x1b')][_0x33b0('0x17')](this));ami['on'](_0x33b0('0x1c'),this['syncDialEnd'][_0x33b0('0x17')](this));ami['on'](_0x33b0('0x1d'),this['syncNewExten'][_0x33b0('0x17')](this));ami['on']('varset',this[_0x33b0('0x1e')][_0x33b0('0x17')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x33b0('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this['loopCampaigns'](this[_0x33b0('0x1f')]);}function emit(_0x47eb70,_0x43d967,_0x18f845){io['to'](_0x47eb70)[_0x33b0('0x20')](_0x43d967,_0x18f845);}function emitCampaignPreview(_0x5f4800){if(_0x5f4800['type']===_0x33b0('0x21')){var _0x1e8aca={'id':_0x5f4800['id'],'name':_0x5f4800[_0x33b0('0x22')],'strategy':_0x5f4800['strategy'],'answered':_0x5f4800['answered'],'available':_0x5f4800[_0x33b0('0x23')],'loggedIn':_0x5f4800[_0x33b0('0x24')],'pTalking':_0x5f4800[_0x33b0('0x25')],'sumBillable':_0x5f4800[_0x33b0('0x26')],'sumDuration':_0x5f4800[_0x33b0('0x27')],'sumHoldTime':_0x5f4800[_0x33b0('0x28')]||0x0,'talking':_0x5f4800['talking'],'total':_0x5f4800[_0x33b0('0x29')],'type':_0x5f4800[_0x33b0('0x2a')],'unmanaged':_0x5f4800[_0x33b0('0x2b')],'abandoned':_0x5f4800[_0x33b0('0x2c')],'waiting':_0x5f4800['waiting'],'loggedInDb':_0x5f4800[_0x33b0('0x2d')],'dialActive':_0x5f4800[_0x33b0('0x2e')],'dialMethod':_0x5f4800['dialMethod'],'dialOriginateCallerIdName':_0x5f4800[_0x33b0('0x2f')],'dialOriginateCallerIdNumber':_0x5f4800[_0x33b0('0x30')],'dialOriginateTimeout':_0x5f4800[_0x33b0('0x31')],'dialPrefix':_0x5f4800[_0x33b0('0x32')],'outboundAnswerAgiCallsDay':_0x5f4800[_0x33b0('0x33')],'outboundAnswerCallsDay':_0x5f4800[_0x33b0('0x34')],'outboundBlacklistCallsDay':_0x5f4800['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5f4800[_0x33b0('0x35')],'outboundCongestionCallsDay':_0x5f4800[_0x33b0('0x36')],'outboundDropCallsDayACS':_0x5f4800['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5f4800['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5f4800[_0x33b0('0x37')],'outboundNoAnswerCallsDay':_0x5f4800[_0x33b0('0x38')],'outboundNoSuchCallsDay':_0x5f4800['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5f4800['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5f4800[_0x33b0('0x39')],'outboundRejectCallsDay':_0x5f4800[_0x33b0('0x3a')],'outboundUnknownCallsDay':_0x5f4800[_0x33b0('0x3b')],'outboundAbandonedCallsDay':_0x5f4800[_0x33b0('0x3c')],'predictiveIntervalAnsweredCalls':_0x5f4800[_0x33b0('0x3d')],'predictiveIntervalAvgHoldtime':_0x5f4800[_0x33b0('0x3e')],'predictiveIntervalAvgTalktime':_0x5f4800[_0x33b0('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x5f4800['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5f4800[_0x33b0('0x40')],'predictiveIntervalErlangCalls':_0x5f4800['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5f4800[_0x33b0('0x41')],'predictiveIntervalHitRate':_0x5f4800[_0x33b0('0x42')],'predictiveIntervalMultiplicativeFactor':_0x5f4800[_0x33b0('0x43')],'predictiveIntervalPauses':_0x5f4800[_0x33b0('0x44')],'predictiveIntervalAvailable':_0x5f4800[_0x33b0('0x45')],'predictiveIntervalTotalCalls':_0x5f4800[_0x33b0('0x46')],'message':_0x5f4800[_0x33b0('0x47')],'originated':_0x5f4800[_0x33b0('0x48')],'erlangCalls':_0x5f4800[_0x33b0('0x49')],'erlangCallToSecond':_0x5f4800[_0x33b0('0x4a')],'erlangAbandonmentRate':_0x5f4800[_0x33b0('0x4b')],'erlangBusyFactor':_0x5f4800[_0x33b0('0x4c')],'startPredictive':_0x5f4800['startPredictive'],'startProgressive':_0x5f4800['startProgressive']};if(_0x5f4800[_0x33b0('0x4d')]){_0x1e8aca['Trunk']={'id':_0x5f4800[_0x33b0('0x4d')]['id'],'name':_0x5f4800[_0x33b0('0x4d')][_0x33b0('0x22')],'active':_0x5f4800['Trunk']['active'],'callerid':_0x5f4800[_0x33b0('0x4d')][_0x33b0('0x4e')]};}if(_0x5f4800[_0x33b0('0x4f')]){_0x1e8aca['Interval']={'id':_0x5f4800['Interval']['id'],'name':_0x5f4800[_0x33b0('0x4f')]['name']};}var _0xae1ca0=md5(JSON[_0x33b0('0x50')](_0x1e8aca));if(_0x5f4800[_0x33b0('0x51')]!==_0xae1ca0){_0x5f4800[_0x33b0('0x51')]=_0xae1ca0;emit(util[_0x33b0('0x52')](_0x33b0('0x53'),_0x1e8aca['name']),_0x33b0('0x54'),_0x1e8aca);}}}function emitVoiceQueueChannelRemove(_0x594925){logger[_0x33b0('0x55')](_0x33b0('0x56'),JSON['stringify'](_0x594925));emit(util['format'](_0x33b0('0x53'),_0x594925[_0x33b0('0x22')]),'voice_queue_channel:remove',_0x594925);io['emit'](_0x33b0('0x57'),_0x594925);}function notSendMessagesQueue(_0x146769){if(_0x146769[_0x33b0('0x58')]){if(_0x146769[_0x33b0('0x48')]===0x0&&_0x146769['pTalking']===0x0){_0x146769[_0x33b0('0x58')]=![];_0x146769['available']=0x0;_0x146769['paused']=0x0;_0x146769[_0x33b0('0x47')]=_0x33b0('0x59');ut[_0x33b0('0x5a')](_0x33b0('0x5b'),_0x146769[_0x33b0('0x22')]+'\x20is\x20not\x20active');}else{_0x146769[_0x33b0('0x47')]='DEACTIVATED';ut[_0x33b0('0x5a')](_0x33b0('0x5b'),_0x146769[_0x33b0('0x22')]+_0x33b0('0x5c'));}emitCampaignPreview(_0x146769);}}Preview[_0x33b0('0xd')][_0x33b0('0x5d')]=function(){var _0x1f0d8e=this;setInterval(function(){_0x1f0d8e['syncCampaigns']();},0x7cf);};Preview[_0x33b0('0xd')][_0x33b0('0x5e')]=function(){var _0x5e9c93=this[_0x33b0('0x1f')];this[_0x33b0('0x5f')]+=0x1;for(var _0x1bf936 in _0x5e9c93){if(_0x5e9c93['hasOwnProperty'](_0x1bf936)&&(_0x5e9c93[_0x1bf936][_0x33b0('0x60')]===_0x33b0('0x5')||_0x5e9c93[_0x1bf936][_0x33b0('0x60')]===_0x33b0('0x61'))&&_0x5e9c93[_0x1bf936][_0x33b0('0x2a')]===_0x33b0('0x21')){if(this[_0x33b0('0x5f')]>0x7){this[_0x33b0('0x5f')]=0x0;this[_0x33b0('0x62')]();}}if(_0x5e9c93['hasOwnProperty'](_0x1bf936)&&_0x5e9c93[_0x1bf936][_0x33b0('0x60')]===_0x33b0('0x5')&&_0x5e9c93[_0x1bf936][_0x33b0('0x2a')]===_0x33b0('0x21')){if(_0x5e9c93[_0x1bf936][_0x33b0('0x2e')]){this['setMessage'](_0x5e9c93[_0x1bf936]);if(_0x5e9c93[_0x1bf936][_0x33b0('0x63')])this[_0x33b0('0x64')](_0x5e9c93[_0x1bf936]);}else{notSendMessagesQueue(_0x5e9c93[_0x1bf936]);}}}};Preview[_0x33b0('0xd')][_0x33b0('0x65')]=function(_0x2974f0){var _0x5b4787=this;this[_0x33b0('0x66')][_0x33b0('0xe')](function(){if(!_['isNil'](_0x5b4787[_0x33b0('0x13')][_0x2974f0])){loggerAction['info'](_0x33b0('0x67'),_0x2974f0,_0x33b0('0x68'),_0x5b4787[_0x33b0('0x13')][_0x2974f0][_0x33b0('0x69')],_0x33b0('0x6a'),JSON[_0x33b0('0x50')](_0x5b4787[_0x33b0('0x1f')][_0x5b4787[_0x33b0('0x13')][_0x2974f0][_0x33b0('0x69')]][_0x33b0('0x48')]),_0x33b0('0x6b'),JSON[_0x33b0('0x50')](_0x5b4787[_0x33b0('0x1f')][_0x5b4787['actions'][_0x2974f0][_0x33b0('0x69')]][_0x33b0('0x25')]),JSON[_0x33b0('0x50')](_0x5b4787['actions'][_0x2974f0]['dialAnswer']),JSON['stringify'](_[_0x33b0('0x6c')](_0x5b4787['actions'][_0x2974f0],[_0x33b0('0x6d'),_0x33b0('0x6e'),'VoiceQueueId','ListId'])));return ami[_0x33b0('0x6f')]({'action':_0x33b0('0x70'),'channel':_0x5b4787[_0x33b0('0x13')][_0x2974f0][_0x33b0('0x71')]})[_0x33b0('0x72')](function(_0x3d53c0){if(_0x3d53c0['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5b4787[_0x33b0('0x13')][_0x2974f0]){ut[_0x33b0('0x73')](_0x5b4787[_0x33b0('0x1f')][_0x5b4787[_0x33b0('0x13')][_0x2974f0][_0x33b0('0x69')]],_0x33b0('0x74'));if(_0x5b4787['actions'][_0x2974f0][_0x33b0('0x75')]===!![]){ut[_0x33b0('0x76')](_0x5b4787[_0x33b0('0x1f')][_0x5b4787[_0x33b0('0x13')][_0x2974f0]['queue']],_0x33b0('0x74'));ut[_0x33b0('0x77')](_0x33b0('0x78')+_0x2974f0,_0x5b4787[_0x33b0('0x13')][_0x2974f0]['queue']);}ut[_0x33b0('0x77')]('[Dialer][checkChannel][Preview]'+_0x2974f0,_0x5b4787[_0x33b0('0x13')][_0x2974f0]['queue']);delete _0x5b4787[_0x33b0('0x13')][_0x2974f0];}},0x2328);}});}});};Preview['prototype'][_0x33b0('0x62')]=function(){var _0x555c7a=this;loggerAction[_0x33b0('0x55')](_0x33b0('0x79'),_[_0x33b0('0x7a')](this[_0x33b0('0x13')]));for(var _0x1262fa in this[_0x33b0('0x13')]){if(_0x555c7a[_0x33b0('0x13')][_0x33b0('0x7b')](_0x1262fa)){_0x555c7a['clearZombieChannel'](_0x1262fa);}}};Preview[_0x33b0('0xd')][_0x33b0('0x64')]=function(_0x23e3d6){var _0x245e36=this;rpcDb[_0x33b0('0x7c')](_0x23e3d6['id'],ut[_0x33b0('0x7d')](this[_0x33b0('0x14')]))['then'](function(_0x50cd18){if(!_[_0x33b0('0x7e')](_0x50cd18)){for(var _0x55723f=0x0;_0x55723f<_0x50cd18[_0x33b0('0x7f')];_0x55723f+=0x1){if(ut[_0x33b0('0x80')](_0x50cd18[_0x55723f][_0x33b0('0x81')])<_0x23e3d6['dialRecallMeTimeout']*0x3c){if(_0x50cd18[_0x55723f][_0x33b0('0x82')]&&!_0x50cd18[_0x55723f][_0x33b0('0x82')][_0x33b0('0x83')]){_0x245e36[_0x33b0('0x84')](_0x50cd18[_0x55723f]['id'])['then'](ut[_0x33b0('0x85')](_0x33b0('0x86')))[_0x33b0('0x72')](ut['logger2'](_0x33b0('0x86')));}else{rpcDb[_0x33b0('0x87')](_0x50cd18[_0x55723f]['id']);}}else{var _0xa184af=new Action(_0x50cd18[_0x55723f],_0x23e3d6);_0xa184af[_0x33b0('0x88')]=moment()[_0x33b0('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x23e3d6['outboundReCallsDay']+=0x1;ut[_0x33b0('0x89')](_0xa184af,0x17,'RecallInQueue');if(_0x23e3d6[_0x33b0('0x8a')]){rpcDb[_0x33b0('0x8b')](ut[_0x33b0('0x8c')](_0x50cd18[_0x55723f]));rpcDb[_0x33b0('0x8d')](_0xa184af,_0x33b0('0x8e'));}else{ut['logCustomer'](_0xa184af,0x16,_0x33b0('0x8f'));rpcDb[_0x33b0('0x8d')](_0xa184af,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0xa184af,'[HistoryRecallClose]');}}}}})['catch'](ut[_0x33b0('0x85')](_0x33b0('0x90')));};Preview[_0x33b0('0xd')][_0x33b0('0x91')]=function(_0x30c931){_0x30c931['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x30c931[_0x33b0('0x24')])){_0x30c931[_0x33b0('0x47')]=_0x33b0('0x92');}else if(!ut[_0x33b0('0x93')](_0x30c931['dialActive'])){_0x30c931['message']='NOT_ACTIVE';}else if(!this[_0x33b0('0x94')](_0x30c931[_0x33b0('0x4d')])){if(!this[_0x33b0('0x94')](_0x30c931['TrunkBackup'])){_0x30c931[_0x33b0('0x47')]=_0x33b0('0x95');}else{_0x30c931['message']='ACTIVE';}}else{_0x30c931['message']=_0x33b0('0x96');}emitCampaignPreview(_0x30c931);};Preview[_0x33b0('0xd')][_0x33b0('0x97')]=function(_0x9a37e6,_0x719f9b,_0x788862){var _0x4a9479=this;var _0x2878e7=this[_0x33b0('0x13')][_0x719f9b];var _0x1f4ead=this[_0x33b0('0x1f')][_0x2878e7['queue']];var _0xb891f4;var _0x17eddd=![];var _0x1547dd=0x2;var _0x2b4f53=0x3;if(_0x1f4ead){switch(_0x788862){case'1':_0x1f4ead[_0x33b0('0x98')]+=0x1;_0x2878e7[_0x33b0('0x99')]+=0x1;_0x2878e7[_0x33b0('0x9a')]=ut[_0x33b0('0x9b')](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0x0,_0x33b0('0x9c'));ami['emit'](_0x33b0('0x9d'),ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0x9f')));rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xa0'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'0',_0x1f4ead)[_0x33b0('0xa2')](function(_0x1c31e7){_0x17eddd=_0x1c31e7['additional']==0x1;_0x1547dd=_0x1f4ead[_0x33b0('0xa3')];_0x2b4f53=_0x1f4ead[_0x33b0('0xa4')];if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead[_0x33b0('0xa5')]){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb['createCustomerFinal'](_0xb891f4,_0x33b0('0xa8'));}else{if(_0x2878e7[_0x33b0('0x99')]>=_0x1f4ead[_0x33b0('0xa9')]){rpcDb[_0x33b0('0xaa')](_0x2878e7,_0x33b0('0xa8'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2878e7,_0x33b0('0x99'),_0x1f4ead[_0x33b0('0xa3')]),_0x2878e7[_0x33b0('0xab')],_0x2878e7[_0x33b0('0xac')]);}}delete this['actions'][_0x9a37e6[_0x33b0('0xad')]];}else{_0x2878e7['countnosuchnumberretry']++;logger[_0x33b0('0x55')](_0x33b0('0xae'),_0x2878e7['countnosuchnumberretry']);logger[_0x33b0('0x55')]('id',_0x2878e7['idContact']);_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countnosuchnumberretry':_0x2878e7['countnosuchnumberretry']}})['then'](function(){_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});break;case _0x33b0('0xb2'):var _0x1c7429=moment()[_0x33b0('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x2878e7[_0x33b0('0xb3')]=_0x1c7429;_0x2878e7[_0x33b0('0xb4')]=_0x1c7429;_0x2878e7[_0x33b0('0x75')]=!![];_0x1f4ead[_0x33b0('0x25')]+=0x1;logger[_0x33b0('0x55')](_0x33b0('0xb5'),_0x2878e7[_0x33b0('0xb6')],_0x33b0('0xb7'),_0x1f4ead[_0x33b0('0x22')],'pTalking:\x20',_0x1f4ead[_0x33b0('0x25')]);ami[_0x33b0('0x20')](_0x33b0('0xb8'),ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0xb9'),this['campaignsPreview'][_0x2878e7[_0x33b0('0x69')]]));if(_0x1f4ead[_0x33b0('0xba')]){ami[_0x33b0('0x20')](_0x33b0('0xbb'),ut['buildAcw'](_0x2878e7));}break;case'16':ami[_0x33b0('0x20')]('custom:agentcomplete',ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0xbc'),this[_0x33b0('0x1f')][_0x2878e7['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2878e7,_0x33b0('0xbc')));_0x1f4ead[_0x33b0('0x34')]+=0x1;_0x1f4ead['total']+=0x1;_0x1f4ead[_0x33b0('0xbd')]+=0x1;ut[_0x33b0('0x76')](_0x1f4ead,_0x33b0('0xbe'));_0x2878e7[_0x33b0('0x9a')]=ut[_0x33b0('0x9b')](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0x4,_0x33b0('0xbf'));rpcDb['createCustomerHistory'](_0x2878e7,_0x33b0('0xc0'));rpcDb[_0x33b0('0xaa')](_0x2878e7,_0x33b0('0xc1'));rpcDb['crateCustomerReportQueue'](_0x2878e7);_0x1f4ead[_0x33b0('0x27')]+=_0x2878e7[_0x33b0('0xc2')];_0x1f4ead['sumBillable']+=_0x2878e7['talktime'];logger[_0x33b0('0x55')](_0x33b0('0xc3'),_0x2878e7['uniqueid'],_0x33b0('0xb7'),_0x1f4ead[_0x33b0('0x22')],_0x33b0('0x6b'),_0x1f4ead[_0x33b0('0x25')]);delete this[_0x33b0('0x13')][_0x9a37e6['linkedid']];break;case _0x33b0('0xc4'):_0x1f4ead['outboundBusyCallsDay']+=0x1;_0x2878e7[_0x33b0('0xc5')]+=0x1;_0x2878e7['countglobal']=ut[_0x33b0('0x9b')](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0x5,_0x33b0('0xc6'));_0x1547dd=_0x1f4ead['dialBusyRetryFrequency'];_0x2b4f53=_0x1f4ead[_0x33b0('0xa4')];ami[_0x33b0('0x20')](_0x33b0('0xc7'),ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0xc8')));rpcDb['createCustomerHistory'](_0x2878e7,_0x33b0('0xc9'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'5',_0x1f4ead)[_0x33b0('0xa2')](function(_0x4adb6c){_0x17eddd=_0x4adb6c[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead['dialGlobalMaxRetry']){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb[_0x33b0('0xaa')](_0xb891f4,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2878e7[_0x33b0('0xc5')]>=_0x1f4ead[_0x33b0('0xcb')]){rpcDb['createCustomerFinal'](_0x2878e7,_0x33b0('0xc9'));}else{rpcDb[_0x33b0('0xcc')](ut[_0x33b0('0xcd')](_0x2878e7,'countbusyretry',_0x1f4ead[_0x33b0('0xce')]),_0x2878e7[_0x33b0('0xab')],_0x2878e7[_0x33b0('0xac')]);}}}else{_0x2878e7['countbusyretry']++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countbusyretry':_0x2878e7[_0x33b0('0xc5')]}})[_0x33b0('0xa2')](function(){_0x4a9479['swapAdditionalPhones'](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});break;case _0x33b0('0xcf'):_0x1f4ead[_0x33b0('0x38')]+=0x1;_0x2878e7['countnoanswerretry']+=0x1;_0x2878e7['countglobal']=ut[_0x33b0('0x9b')](_0x2878e7);ut['logCustomer'](_0x2878e7,0x3,'NoAnswer');_0x1547dd=_0x1f4ead[_0x33b0('0xd0')];_0x2b4f53=_0x1f4ead['callAdditionalPhoneAfterMin'];var _0x22f5b4=ut[_0x33b0('0xd1')](_0x2878e7,_0x1f4ead);ami['emit'](_0x33b0('0xd2'),_0x22f5b4);rpcDb['createCustomerHistory'](_0x2878e7,_0x33b0('0xd3'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'3',_0x1f4ead)[_0x33b0('0xa2')](function(_0x226f21){_0x17eddd=_0x226f21[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead[_0x33b0('0xa5')]){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,'Global');rpcDb[_0x33b0('0xaa')](_0xb891f4,_0x33b0('0xd4'));}else{if(_0x2878e7[_0x33b0('0xd5')]>=_0x1f4ead[_0x33b0('0xd6')]){rpcDb['createCustomerFinal'](_0x2878e7,_0x33b0('0xd3'));}else{rpcDb[_0x33b0('0xcc')](ut['scheduledAt'](_0x2878e7,'countnoanswerretry',_0x1f4ead[_0x33b0('0xd0')]),_0x2878e7[_0x33b0('0xab')],_0x2878e7[_0x33b0('0xac')]);}}}else{_0x2878e7['countnoanswerretry']++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countnoanswerretry':_0x2878e7[_0x33b0('0xd5')]}})[_0x33b0('0xa2')](function(){_0x4a9479['swapAdditionalPhones'](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});break;case'CONGESTION':_0x1f4ead['outboundCongestionCallsDay']+=0x1;_0x2878e7[_0x33b0('0xd7')]+=0x1;_0x2878e7[_0x33b0('0x9a')]=ut[_0x33b0('0x9b')](_0x2878e7);ut['logCustomer'](_0x2878e7,0x8,_0x33b0('0xd8'));_0x1547dd=_0x1f4ead[_0x33b0('0xd9')];_0x2b4f53=_0x1f4ead['callAdditionalPhoneAfterMin'];ami['emit'](_0x33b0('0xda'),ut['buildObj'](_0x2878e7,_0x33b0('0xdb')));rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xdc'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'8',_0x1f4ead)[_0x33b0('0xa2')](function(_0x571a67){_0x17eddd=_0x571a67[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead['dialGlobalMaxRetry']){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb['createCustomerFinal'](_0xb891f4,_0x33b0('0xdd'));}else{if(_0x2878e7[_0x33b0('0xd7')]>=_0x1f4ead[_0x33b0('0xde')]){rpcDb[_0x33b0('0xaa')](_0x2878e7,_0x33b0('0xdc'));}else{rpcDb[_0x33b0('0xcc')](ut['scheduledAt'](_0x2878e7,_0x33b0('0xd7'),_0x1f4ead['dialBusyRetryFrequency']),_0x2878e7[_0x33b0('0xab')],_0x2878e7[_0x33b0('0xac')]);}}}else{_0x2878e7[_0x33b0('0xd7')]++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countcongestionretry':_0x2878e7[_0x33b0('0xd7')]}})[_0x33b0('0xa2')](function(){_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});break;case _0x33b0('0xdf'):_0x1f4ead['outboundRejectCallsDay']+=0x1;_0x2878e7[_0x33b0('0xe0')]+=0x1;_0x2878e7['countglobal']=ut['totalGlobal'](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0x14,'AgentReject');_0x1547dd=_0x1f4ead['dialAgentRejectRetryFrequency'];_0x2b4f53=_0x1f4ead['callAdditionalPhoneAfterMin'];ami[_0x33b0('0x20')](_0x33b0('0xe1'),ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0xe2')));rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xe3'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'20',_0x1f4ead)['then'](function(_0x1bc7e7){_0x17eddd=_0x1bc7e7['additional']==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead['dialGlobalMaxRetry']){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0x14,_0x33b0('0xe4'));rpcDb['createCustomerFinal'](_0xb891f4,_0x33b0('0xe5'));}else{if(_0x2878e7[_0x33b0('0xe0')]>=_0x1f4ead[_0x33b0('0xe6')]){rpcDb[_0x33b0('0xaa')](_0x2878e7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x33b0('0xcc')](ut['scheduledAt'](_0x2878e7,_0x33b0('0xe0'),_0x1f4ead[_0x33b0('0xe7')]),_0x2878e7[_0x33b0('0xab')],_0x2878e7['activeContact']);}}}else{_0x2878e7[_0x33b0('0xd5')]++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countnoanswerretry':_0x2878e7[_0x33b0('0xd5')]}})[_0x33b0('0xa2')](function(){_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)['then'](function(){});});}});break;case _0x33b0('0xe8'):_0x1f4ead['outboundAbandonedCallsDay']+=0x1;_0x2878e7[_0x33b0('0xe9')]+=0x1;_0x2878e7['countglobal']=ut[_0x33b0('0x9b')](_0x2878e7);ut['logCustomer'](_0x2878e7,0xb,'Abandoned');rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xea'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'11',_0x1f4ead)[_0x33b0('0xa2')](function(_0x573c7f){_0x17eddd=_0x573c7f[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead[_0x33b0('0xa5')]){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb[_0x33b0('0xaa')](_0xb891f4,_0x33b0('0xea'));}else{if(_0x2878e7[_0x33b0('0xeb')]>=_0x1f4ead[_0x33b0('0xec')]){rpcDb['createCustomerFinal'](_0x2878e7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x33b0('0xcd')](_0x2878e7,'countabandonedretry',_0x1f4ead[_0x33b0('0xed')]),_0x2878e7[_0x33b0('0xab')],_0x2878e7[_0x33b0('0xac')]);}}}else{_0x2878e7[_0x33b0('0xd5')]++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7['idContact'],'field':{'countnoanswerretry':_0x2878e7[_0x33b0('0xd5')]}})[_0x33b0('0xa2')](function(){_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});break;case'18':_0x1f4ead[_0x33b0('0x3b')]+=0x1;_0x2878e7['countmachineretry']+=0x1;_0x2878e7['countglobal']=ut[_0x33b0('0x9b')](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0x12,_0x9a37e6['cause-txt']||_0x9a37e6[_0x33b0('0xee')]);ami[_0x33b0('0x20')](_0x33b0('0xef'),ut['buildObj'](_0x2878e7,_0x33b0('0xf0')));rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xf1'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'18',_0x1f4ead)[_0x33b0('0xa2')](function(_0x26b777){_0x17eddd=_0x26b777[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut['totalGlobal'](_0x2878e7)>=_0x1f4ead['dialGlobalMaxRetry']){_0xb891f4=ut['cloneAction'](_0x2878e7,0x12,_0x33b0('0xa7'));rpcDb[_0x33b0('0xaa')](_0xb891f4,_0x33b0('0xf1'));}else{rpcDb[_0x33b0('0xaa')](_0x2878e7,_0x33b0('0xf1'));}}else{_0x2878e7[_0x33b0('0xd5')]++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countnoanswerretry':_0x2878e7[_0x33b0('0xd5')]}})[_0x33b0('0xa2')](function(){_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});delete this[_0x33b0('0x13')][_0x9a37e6[_0x33b0('0xad')]];break;case'19':_0x1f4ead[_0x33b0('0x3b')]+=0x1;_0x2878e7[_0x33b0('0x9a')]=ut[_0x33b0('0x9b')](_0x2878e7);ut['logCustomer'](_0x2878e7,0x13,_0x9a37e6[_0x33b0('0xf2')]||_0x9a37e6[_0x33b0('0xee')]);ami[_0x33b0('0x20')](_0x33b0('0xef'),ut[_0x33b0('0x9e')](_0x2878e7,_0x33b0('0xf0')));rpcDb['createCustomerHistory'](_0x2878e7,_0x33b0('0xf3'));_0x4a9479['verifyAdditionalPhones'](_0x2878e7,'18',_0x1f4ead)[_0x33b0('0xa2')](function(_0x536ad7){_0x17eddd=_0x536ad7[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut[_0x33b0('0x9b')](_0x2878e7)>=_0x1f4ead[_0x33b0('0xa5')]){_0xb891f4=ut[_0x33b0('0xa6')](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb[_0x33b0('0xaa')](_0xb891f4,_0x33b0('0xf3'));}else{rpcDb[_0x33b0('0xaa')](_0x2878e7,_0x33b0('0xf3'));}}else{_0x2878e7[_0x33b0('0xd5')]++;_0x4a9479[_0x33b0('0xaf')]({'id':_0x2878e7[_0x33b0('0xb0')],'field':{'countnoanswerretry':_0x2878e7[_0x33b0('0xd5')]}})[_0x33b0('0xa2')](function(){_0x4a9479['swapAdditionalPhones'](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});});}});delete this[_0x33b0('0x13')][_0x9a37e6[_0x33b0('0xad')]];break;default:if(_0x2878e7[_0x33b0('0x75')]){ut[_0x33b0('0x76')](_0x1f4ead,_0x33b0('0xf4'));ut[_0x33b0('0x77')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x1f4ead[_0x33b0('0x22')],_0x9a37e6);}_0x1f4ead['outboundUnknownCallsDay']+=0x1;_0x2878e7['countglobal']=ut[_0x33b0('0x9b')](_0x2878e7);ut[_0x33b0('0x89')](_0x2878e7,0xc,_0x9a37e6[_0x33b0('0xf2')]||_0x9a37e6[_0x33b0('0xee')]);_0x1547dd=_0x1f4ead[_0x33b0('0xe7')];_0x2b4f53=_0x1f4ead['callAdditionalPhoneAfterMin'];rpcDb[_0x33b0('0x8d')](_0x2878e7,_0x33b0('0xf5'));_0x4a9479[_0x33b0('0xa1')](_0x2878e7,'20',_0x1f4ead)[_0x33b0('0xa2')](function(_0x3f1fbd){_0x17eddd=_0x3f1fbd[_0x33b0('0xca')]==0x1;if(!_0x17eddd){if(ut['totalGlobal'](_0x2878e7)>=_0x1f4ead[_0x33b0('0xa5')]){_0xb891f4=ut['cloneAction'](_0x2878e7,0xf,_0x33b0('0xa7'));rpcDb['createCustomerFinal'](_0xb891f4,_0x33b0('0xf6'));}else{rpcDb['createCustomerFinal'](_0x2878e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x33b0('0x13')][_0x9a37e6[_0x33b0('0xad')]];}else{_0x4a9479[_0x33b0('0xb1')](_0x2878e7,_0x1547dd,_0x2b4f53)[_0x33b0('0xa2')](function(){});}});}if(!(_0x2878e7[_0x33b0('0x75')]&&_0x788862==='16')){ut['updateOriginated'](_0x1f4ead,_0x33b0('0xf7'));logger[_0x33b0('0x55')](_0x33b0('0xf8'),_0x2878e7['uniqueid'],_0x33b0('0xb7'),_0x1f4ead[_0x33b0('0x22')],_0x33b0('0x6a'),_0x1f4ead[_0x33b0('0x48')]);}if(_0x788862!==_0x33b0('0xb2')){delete this[_0x33b0('0x13')][_0x9a37e6[_0x33b0('0xad')]];delete this[_0x33b0('0x13')][_0x9a37e6[_0x33b0('0xf9')]];}}};Preview['prototype'][_0x33b0('0xfa')]=function(_0x4c951f,_0x8d3712,_0x2501e5){if(_['isUndefined'](_0x8d3712)&&'object'!==typeof _0x8d3712){return;}if(_['isUndefined'](_0x2501e5)&&_0x33b0('0xfb')!==typeof _0x2501e5){return;}switch(_0x2501e5[_0x33b0('0xfc')]){case'0':ut[_0x33b0('0xfd')](_0x4c951f,0x0,'NoSuchNumber');rpcDb[_0x33b0('0xfe')](_0x4c951f,_0x33b0('0xff'));break;case'3':ut[_0x33b0('0xfd')](_0x4c951f,0x3,_0x33b0('0x100'));rpcDb[_0x33b0('0xfe')](_0x4c951f,_0x33b0('0x101'));break;case'5':ut['logAgent'](_0x4c951f,0x5,_0x33b0('0xc6'));rpcDb[_0x33b0('0xfe')](_0x4c951f,_0x33b0('0x102'));break;case'8':ut[_0x33b0('0xfd')](_0x4c951f,0x8,_0x33b0('0xd8'));rpcDb[_0x33b0('0xfe')](_0x4c951f,_0x33b0('0x103'));break;case'22':ut['logAgent'](_0x4c951f,0x16,_0x33b0('0x104'));rpcDb[_0x33b0('0xfe')](_0x4c951f,_0x33b0('0x105'));break;default:ut[_0x33b0('0xfd')](_0x4c951f,0xc,_0x2501e5[_0x33b0('0xfc')]);rpcDb['createAgentHistory'](_0x4c951f,_0x33b0('0x103'));}ut[_0x33b0('0x73')](_0x8d3712,_0x33b0('0x106'));logger[_0x33b0('0x55')](_0x33b0('0x107'),_0x4c951f['uniqueid'],_0x33b0('0xb7'),_0x8d3712[_0x33b0('0x22')],_0x33b0('0x6a'),_0x8d3712[_0x33b0('0x48')]);delete this[_0x33b0('0x13')][_0x4c951f['uniqueid']];};Preview[_0x33b0('0xd')][_0x33b0('0xa1')]=function(_0xfae70,_0x3c1a29,_0x1ae99e){return Promise[_0x33b0('0x108')]()[_0x33b0('0xa2')](cmHopperAdditionalPhone[_0x33b0('0xa1')](_0xfae70,_0x3c1a29,_0x1ae99e))[_0x33b0('0x72')](logger[_0x33b0('0x55')](_0x33b0('0x109')));};Preview['prototype'][_0x33b0('0xb1')]=function(_0x91e7e,_0x1cd27f,_0x4764eb){return Promise[_0x33b0('0x108')]()[_0x33b0('0xa2')](cmHopperAdditionalPhone[_0x33b0('0xb1')](_0x91e7e,_0x1cd27f,_0x4764eb))[_0x33b0('0x72')](logger['info']('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0x33b0('0xaf')]=function(_0x1b8863){return Promise[_0x33b0('0x108')]()[_0x33b0('0xa2')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x1b8863))[_0x33b0('0x72')](logger['info'](_0x33b0('0x10a')));};Preview[_0x33b0('0xd')][_0x33b0('0x10b')]=function(_0x33e597,_0x566621,_0x5b03ee,_0x50630b,_0x6a3a98){var _0x578dc7=this;return new Promise(function(_0x31a901,_0x2a4dfd){if(_['isNil'](_0x566621)||_[_0x33b0('0x7e')](_0x566621['Contact'])||_['isNil'](_0x566621[_0x33b0('0x10c')])||_[_0x33b0('0x7e')](_0x566621[_0x33b0('0x10d')])){_0x2a4dfd(ut['message'](_0x33b0('0x10e'),_0x50630b,_0x6a3a98));return;}var _0xdf7db6=uuid['v4']();var _0x341f12=_0x578dc7[_0x33b0('0x1f')][_0x566621[_0x33b0('0x68')][_0x33b0('0x22')]];var _0x3571c7=_0x5b03ee?_0x578dc7[_0x33b0('0x14')][_0x5b03ee]['id']:undefined;_0x578dc7['actions'][_0xdf7db6]=new Action(_0x566621,_0x341f12,_0xdf7db6,_0x5b03ee,_0x3571c7);var _0x90c356=_0x578dc7['actions'][_0xdf7db6];_0x90c356[_0x33b0('0xab')]=_0x50630b;_0x90c356[_0x33b0('0xac')]=_0x6a3a98;_0x90c356[_0x33b0('0x10f')]=_0x5b03ee;if(_['isEmpty'](_0x33e597)){_0x578dc7['execCall'](_0x90c356,_0x341f12,_0x566621,_0x5b03ee)[_0x33b0('0xa2')](function(_0x42515d){logger[_0x33b0('0x55')]('[Preview][execCall][success]','Queue:\x20'+_0x90c356[_0x33b0('0x69')]+_0x33b0('0x110')+_0x90c356[_0x33b0('0xb0')],JSON[_0x33b0('0x50')](_0x42515d));ami[_0x33b0('0x20')]('custom:agentcalled',ut[_0x33b0('0x9e')](_0x90c356,'called',_0x578dc7['campaignsPreview'][_0x90c356[_0x33b0('0x69')]]));_0x31a901(ut[_0x33b0('0x47')](_0x33b0('0x111')));})['catch'](function(_0x5c9a25){ut['logger'](_0x33b0('0x112'),_0x5c9a25);_0x2a4dfd(ut[_0x33b0('0x47')](_0x33b0('0x113'),_0x50630b,_0x6a3a98));});}else{_0x341f12[_0x33b0('0x114')]+=0x1;ut[_0x33b0('0x115')](_0x90c356);rpcDb[_0x33b0('0x116')](_0x90c356,_0x33b0('0x117'));delete _0x578dc7[_0x33b0('0x13')][_0xdf7db6];_0x2a4dfd(ut[_0x33b0('0x47')]('Contact\x20in\x20black\x20List',_0x50630b,_0x6a3a98));}});};Preview[_0x33b0('0xd')]['isTrunkReachable']=function(_0x8d6cd1){return!_['isNil'](_0x8d6cd1)&&!_[_0x33b0('0x7e')](_0x8d6cd1['name'])&&!_[_0x33b0('0x7e')](_0x8d6cd1[_0x33b0('0x118')])&&_0x8d6cd1[_0x33b0('0x118')]&&!_[_0x33b0('0x7e')](this[_0x33b0('0x12')][util[_0x33b0('0x52')]('SIP/%s',_0x8d6cd1['name'])])&&!_[_0x33b0('0x7e')](this[_0x33b0('0x12')][util[_0x33b0('0x52')]('SIP/%s',_0x8d6cd1[_0x33b0('0x22')])][_0x33b0('0x70')])&&(this[_0x33b0('0x12')][util['format'](_0x33b0('0x119'),_0x8d6cd1[_0x33b0('0x22')])][_0x33b0('0x70')]===_0x33b0('0x11a')||this['trunks'][util[_0x33b0('0x52')](_0x33b0('0x119'),_0x8d6cd1[_0x33b0('0x22')])][_0x33b0('0x70')]===_0x33b0('0x11b'));};Preview[_0x33b0('0xd')][_0x33b0('0x84')]=function(_0x49c692,_0x3ad01d){var _0x1cf012=this;return new Promise(function(_0x482234,_0x14e100){_0x1cf012[_0x33b0('0x11c')](_0x49c692,_0x3ad01d)[_0x33b0('0xa2')](function(_0x2f1a1f){_0x482234(_[_0x33b0('0x6c')](_0x2f1a1f,['message']));})[_0x33b0('0x72')](function(_0x2c156d){if(_0x2c156d[_0x33b0('0x11d')]){rpcDb[_0x33b0('0x11e')](_0x49c692);}if(_0x2c156d[_0x33b0('0x118')]){rpcDb[_0x33b0('0x87')](_0x49c692);}_0x14e100(_[_0x33b0('0x6c')](_0x2c156d,[_0x33b0('0x47')]));});});};Preview[_0x33b0('0xd')][_0x33b0('0x11c')]=function(_0x412303,_0x55bf40){var _0x482f1c=this;return new Promise(function(_0x412b0e,_0x162d34){var _0x37cc98,_0xc3e6b2;rpcDb[_0x33b0('0x11f')](_0x412303)['then'](function(_0x43206a){if(!_[_0x33b0('0x7e')](_0x43206a[0x0])){_0xc3e6b2=_0x43206a[0x0][_0x33b0('0x120')]?![]:!![];_0x37cc98=_0x43206a[0x0][_0x33b0('0x120')]?!![]:![];_0x37cc98=_0x55bf40?!![]:_0x37cc98;}var _0x50625c=_0x482f1c[_0x33b0('0x121')](_0x43206a);if(_0x50625c['isValid']){rpcDb['checkIsBlackList'](_[_0x33b0('0x6c')](_0x43206a[0x0],['VoiceQueueId','phone']))['then'](function(_0x1ce391){_0x482f1c[_0x33b0('0x10b')](_0x1ce391,_0x43206a[0x0],_0x55bf40,_0xc3e6b2,_0x37cc98)[_0x33b0('0xa2')](function(_0x5ba8f1){_0x412b0e(_0x5ba8f1);})['catch'](function(_0x3080cb){_0x162d34(_0x3080cb);});})['catch'](function(_0x5d73a9){ut[_0x33b0('0x5a')](_0x33b0('0x122'),_0x5d73a9);_0x162d34(ut['message']('Call\x20unsuccessful',_0xc3e6b2,_0x37cc98));});}else{_0x162d34(ut[_0x33b0('0x47')](_0x50625c[_0x33b0('0x47')],_0xc3e6b2,_0x37cc98));}})[_0x33b0('0x72')](function(_0x36e320){ut[_0x33b0('0x5a')](_0x33b0('0x123'),_0x36e320);_0x162d34(ut[_0x33b0('0x47')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x33b0('0xd')][_0x33b0('0x121')]=function(_0x57a482){if(_[_0x33b0('0x7e')](_0x57a482)||_[_0x33b0('0x124')](_0x57a482)||!_[_0x33b0('0x7e')](_0x57a482[0x0][_0x33b0('0x82')])&&_['isNil'](_0x57a482[0x0][_0x33b0('0x82')][_0x33b0('0x22')])){ut[_0x33b0('0x5a')](_0x33b0('0x125'),_0x57a482);return{'isValid':![],'message':_0x33b0('0x126')};}var _0x4bf076=this[_0x33b0('0x1f')][_0x57a482[0x0]['Queue'][_0x33b0('0x22')]];_0x4bf076[_0x33b0('0x47')]=_0x33b0('0x96');if(_[_0x33b0('0x7e')](_0x4bf076)){ut[_0x33b0('0x5a')](_0x33b0('0x127'),_0x4bf076);return{'isValid':![],'message':_0x33b0('0x128')};}if(!this['isTrunkReachable'](_0x4bf076[_0x33b0('0x4d')])){ut[_0x33b0('0x5a')](_0x33b0('0x129'),'campaign\x20Name:\x20'+_0x4bf076[_0x33b0('0x22')]+_0x33b0('0x12a'));if(!this[_0x33b0('0x94')](_0x4bf076[_0x33b0('0x12b')])){ut['logger'](_0x33b0('0x129'),_0x4bf076[_0x33b0('0x22')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x33b0('0x12c')};}}if(!ut[_0x33b0('0x93')](_0x4bf076[_0x33b0('0x2e')])){ut[_0x33b0('0x5a')]('[Preview][validateContact][Campaign\x20Active]',_0x4bf076[_0x33b0('0x22')]+_0x33b0('0x12d'));return{'isValid':![],'message':_0x33b0('0x12e')+_0x4bf076[_0x33b0('0x22')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x33b0('0x12f')};};Preview[_0x33b0('0xd')]['execCall']=function(_0x28a546,_0x5242d6,_0x54922b,_0xb26196){var _0x18e8b6=this;return new Promise(function(_0x581409,_0x55d8bf){var _0x4c3ae4=_0x28a546[_0x33b0('0xb6')];var _0x2f8214=_0x18e8b6[_0x33b0('0x94')](_0x5242d6['Trunk'])?util['format'](_0x33b0('0x130'),_0x5242d6[_0x33b0('0x4d')][_0x33b0('0x22')],_[_0x33b0('0x7e')](_0x5242d6[_0x33b0('0x32')])?'':_0x5242d6[_0x33b0('0x32')][_0x33b0('0x131')]()||'',_0x5242d6[_0x33b0('0x132')]>0x0?_0x54922b[_0x33b0('0x10c')]['substring'](_0x5242d6[_0x33b0('0x132')]):_0x54922b[_0x33b0('0x10c')]):util[_0x33b0('0x52')](_0x33b0('0x130'),_[_0x33b0('0x7e')](_0x5242d6['TrunkBackup'])?_0x5242d6[_0x33b0('0x4d')][_0x33b0('0x22')]:_0x5242d6[_0x33b0('0x12b')][_0x33b0('0x22')],_[_0x33b0('0x7e')](_0x5242d6[_0x33b0('0x32')])?'':_0x5242d6[_0x33b0('0x32')]['trim']()||'',_0x5242d6[_0x33b0('0x132')]>0x0?_0x54922b['phone'][_0x33b0('0x133')](_0x5242d6[_0x33b0('0x132')]):_0x54922b['phone']);var _0x890922=_0x18e8b6[_0x33b0('0x94')](_0x5242d6['Trunk'])?ut[_0x33b0('0x134')](_0x5242d6[_0x33b0('0x4d')][_0x33b0('0x4e')],_0x5242d6['dialOriginateCallerIdName'],_0x5242d6[_0x33b0('0x135')]>0x0?ut['getCallerIdRandom'](_0x5242d6['dialOriginateCallerIdNumber'],_0x5242d6[_0x33b0('0x135')]):_0x5242d6['dialOriginateCallerIdNumber']):ut[_0x33b0('0x134')](_[_0x33b0('0x7e')](_0x5242d6['TrunkBackup'])?_0x5242d6[_0x33b0('0x4d')][_0x33b0('0x4e')]:_0x5242d6['TrunkBackup']['callerid'],_0x5242d6[_0x33b0('0x2f')],_0x5242d6[_0x33b0('0x135')]>0x0?ut[_0x33b0('0x136')](_0x5242d6[_0x33b0('0x30')],_0x5242d6[_0x33b0('0x135')]):_0x5242d6[_0x33b0('0x30')]);if(_0x890922){_0x28a546[_0x33b0('0x137')]=ut[_0x33b0('0x138')](_0x890922);_0x28a546[_0x33b0('0x139')]=ut['extractCalleridNumber'](_0x890922);}var _0x3d2265=ut[_0x33b0('0x13a')](_0x5242d6,_0x54922b,_0x2f8214,_0x890922,_0x4c3ae4,_0x28a546);_[_0x33b0('0x13b')](_0x28a546,ut[_0x33b0('0x13c')](_0x3d2265));_0x28a546[_0x33b0('0x88')]=moment()[_0x33b0('0x52')](_0x33b0('0x13d'));_0x5242d6[_0x33b0('0x13e')]=_0x3d2265;ami['Action'](ut[_0x33b0('0x13f')](_0x28a546,_0x5242d6,_0x3d2265,_0x28a546[_0x33b0('0xac')],_0xb26196))[_0x33b0('0xa2')](function(_0x2ba63d){_0x5242d6[_0x33b0('0x48')]+=0x1;logger[_0x33b0('0x55')]('[originated][increment]',_0x4c3ae4,_0x33b0('0xb7'),_0x5242d6['name'],_0x33b0('0x6a'),_0x5242d6[_0x33b0('0x48')]);_0x581409(_0x2ba63d);})[_0x33b0('0x72')](function(_0x5b7e56){ut[_0x33b0('0xfd')](_0x28a546,0xe,_0x33b0('0x140'));rpcDb[_0x33b0('0xfe')](_0x28a546,_0x33b0('0x141'));_0x55d8bf(_0x5b7e56);});});};Preview['prototype'][_0x33b0('0x142')]=function(_0xfac6c2){if(this[_0x33b0('0x13')][_0xfac6c2[_0x33b0('0xad')]]){this[_0x33b0('0x13')][_0xfac6c2[_0x33b0('0xad')]]['channel']=_0xfac6c2[_0x33b0('0x71')];}};Preview[_0x33b0('0xd')]['syncOriginateResponse']=function(_0x168416){var _0x1b39ef=this;var _0x208af2=this['actions'][_0x168416[_0x33b0('0x143')]];if(_0x208af2){if(_0x208af2[_0x33b0('0x10f')]&&this[_0x33b0('0x14')][_0x208af2['lookAgent']]){ut[_0x33b0('0x144')](_0x208af2,this[_0x33b0('0x14')][_0x208af2[_0x33b0('0x10f')]][_0x33b0('0x22')],this[_0x33b0('0x14')][_0x208af2[_0x33b0('0x10f')]]['id']);}var _0x23bfd7=_[_0x33b0('0x145')](_0x208af2);_0x23bfd7[_0x33b0('0xb3')]=moment()[_0x33b0('0x52')](_0x33b0('0x13d'));var _0x2beb36=_0x1b39ef[_0x33b0('0x1f')][_0x208af2['queue']];if(ut['isFailure'](_0x168416[_0x33b0('0x146')])){if(_0x208af2[_0x33b0('0xab')]){rpcDb[_0x33b0('0x11e')](_0x208af2[_0x33b0('0xb0')]);}if(_0x208af2[_0x33b0('0xac')]){rpcDb['disableContact'](_0x208af2[_0x33b0('0xb0')]);}ami[_0x33b0('0x20')]('custom:agentringnoanswer',ut[_0x33b0('0x9e')](_0x208af2,'rejected',this[_0x33b0('0x1f')][_0x208af2['queue']]));this['callProgressDetectingAgent'](_0x23bfd7,_0x2beb36,_0x168416);}else{_0x208af2['starttime']=moment()[_0x33b0('0x52')](_0x33b0('0x13d'));ut[_0x33b0('0xfd')](_0x23bfd7,0x4,_0x33b0('0xbf'));rpcDb['createAgentHistory'](_0x23bfd7,_0x33b0('0x147'));}}};Preview[_0x33b0('0xd')][_0x33b0('0x19')]=function(_0x9c43fe){var _0xa869c0=this[_0x33b0('0x13')][_0x9c43fe[_0x33b0('0xad')]];var _0x30ac92;if(_0xa869c0){_0x30ac92=this['campaignsPreview'][_0xa869c0[_0x33b0('0x69')]];logger['info'](_0x33b0('0x148'),_0x9c43fe[_0x33b0('0xad')],_0x33b0('0xb7'),_0x30ac92[_0x33b0('0x22')],_0x33b0('0x6b'),_0x30ac92[_0x33b0('0x25')]);}if(this[_0x33b0('0x13')][_0x9c43fe[_0x33b0('0xad')]]&&_0x9c43fe['linkedid']!==_0x9c43fe[_0x33b0('0xb6')]){if(_0x9c43fe[_0x33b0('0x149')]==='16'&&this[_0x33b0('0x13')][_0x9c43fe[_0x33b0('0xad')]]['dialAnswer']){this[_0x33b0('0x97')](_0x9c43fe,_0x9c43fe['linkedid'],_0x9c43fe['cause']);}else if(this[_0x33b0('0x13')][_0x9c43fe[_0x33b0('0xad')]][_0x33b0('0x75')]){logger[_0x33b0('0x55')]('[syncHangup][talking][cause]',_0x9c43fe[_0x33b0('0xad')],_0x9c43fe[_0x33b0('0x149')],_0x33b0('0xb7'),_0x30ac92['name'],_0x33b0('0x6b'),_0x30ac92['pTalking']);this[_0x33b0('0x97')](_0x9c43fe,_0x9c43fe[_0x33b0('0xad')],_0x9c43fe['cause']);}}else if(_0xa869c0&&_[_0x33b0('0x7e')](_0xa869c0[_0x33b0('0x14a')])&&_0x30ac92['dialQueueProject']&&_0x9c43fe[_0x33b0('0xad')]===_0x9c43fe[_0x33b0('0xb6')]&&_[_0x33b0('0x7e')](_0x9c43fe[_0x33b0('0xfc')])&&_0x9c43fe[_0x33b0('0x149')]==='16'&&_0x9c43fe['channelstate']==='6'&&_[_0x33b0('0x14b')](_0xa869c0[_0x33b0('0x14c')])){if(_0xa869c0[_0x33b0('0xab')]){rpcDb[_0x33b0('0x11e')](_0xa869c0[_0x33b0('0xb0')]);}if(_0xa869c0[_0x33b0('0xac')]){rpcDb[_0x33b0('0x87')](_0xa869c0[_0x33b0('0xb0')]);}_0x9c43fe['reason']='22';this[_0x33b0('0xfa')](_0xa869c0,_0x30ac92,_0x9c43fe);}else if(_0xa869c0&&_0xa869c0[_0x33b0('0x14c')]){if(_0x9c43fe[_0x33b0('0x149')]==='16'&&this['actions'][_0x9c43fe['linkedid']]['dialAnswer']){logger['info'](_0x33b0('0x14d'),_0x9c43fe[_0x33b0('0xad')],_0x9c43fe[_0x33b0('0x149')],_0x33b0('0xb7'),_0x30ac92[_0x33b0('0x22')],_0x33b0('0x6b'),_0x30ac92[_0x33b0('0x25')]);this[_0x33b0('0x97')](_0x9c43fe,_0x9c43fe[_0x33b0('0xad')],_0x9c43fe[_0x33b0('0x149')]);}else if(this[_0x33b0('0x13')][_0x9c43fe['linkedid']][_0x33b0('0x75')]){logger['info'](_0x33b0('0x14e'),_0x9c43fe[_0x33b0('0xad')],_0x9c43fe['cause'],_0x33b0('0xb7'),_0x30ac92[_0x33b0('0x22')],_0x33b0('0x6b'),_0x30ac92[_0x33b0('0x25')]);this[_0x33b0('0x97')](_0x9c43fe,_0x9c43fe[_0x33b0('0xad')],_0x9c43fe[_0x33b0('0x149')]);}}};Preview[_0x33b0('0xd')][_0x33b0('0x14f')]=function(_0x5dedd5){if(this[_0x33b0('0x13')][_0x5dedd5[_0x33b0('0xf9')]]&&_0x5dedd5[_0x33b0('0xf9')]!==_0x5dedd5['destuniqueid']){this['callProgressDetectingCustomer'](_0x5dedd5,_0x5dedd5[_0x33b0('0xf9')],_0x5dedd5[_0x33b0('0xee')]);}};Preview[_0x33b0('0xd')][_0x33b0('0x1b')]=function(_0x3ebfc7){if(this[_0x33b0('0x13')][_0x3ebfc7[_0x33b0('0xad')]]&&_0x3ebfc7['linkedid']!==_0x3ebfc7[_0x33b0('0xb6')]&&!this[_0x33b0('0x13')][_0x3ebfc7[_0x33b0('0xad')]][_0x33b0('0x75')]){if(_0x3ebfc7[_0x33b0('0x149')]==='1'){this[_0x33b0('0x97')](_0x3ebfc7,_0x3ebfc7[_0x33b0('0xad')],_0x3ebfc7[_0x33b0('0x149')]);}}};Preview[_0x33b0('0xd')][_0x33b0('0x150')]=function(_0x2125bd,_0x4d9d6e,_0x388a5d){if(this[_0x33b0('0x13')][_0x2125bd]){if(_['isNil'](this[_0x33b0('0x13')][_0x2125bd][_0x33b0('0x13e')])){this['actions'][_0x2125bd][_0x33b0('0x13e')]={};}this[_0x33b0('0x13')][_0x2125bd]['variables'][_0x4d9d6e]=_0x388a5d;}};Preview[_0x33b0('0xd')][_0x33b0('0x1e')]=function(_0x4bba1d){try{if(!_[_0x33b0('0x7e')](_0x4bba1d)){if(ut[_0x33b0('0x151')](_[_0x33b0('0x152')](_0x4bba1d[_0x33b0('0x153')])[0x0])){this[_0x33b0('0x150')](_0x4bba1d[_0x33b0('0xb6')],_[_0x33b0('0x152')](_0x4bba1d['variable'])[0x0],_0x4bba1d[_0x33b0('0x154')]);}}}catch(_0x2fcac2){logger[_0x33b0('0x155')](_0x33b0('0x156'),util[_0x33b0('0x157')](_0x2fcac2,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x33b0('0x158')]=function(_0xf0b0ba){if(_0xf0b0ba){if(this[_0x33b0('0x13')][_0xf0b0ba[_0x33b0('0x159')]]){this['actions'][_0xf0b0ba[_0x33b0('0x159')]][_0x33b0('0x14c')]=!![];}}};Preview[_0x33b0('0xd')][_0x33b0('0x15a')]=function(_0x51c83c){if(_0x51c83c){if(this[_0x33b0('0x13')][_0x51c83c[_0x33b0('0x15b')]]){this[_0x33b0('0x13')][_0x51c83c[_0x33b0('0x15b')]]['transfer']=!![];}}};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 afc118b..2150aba 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 _0x222b=['../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','resolve','createHistory','[createHistory]\x20','catch','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','preview','lodash','../rpc/cmHopper'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x222b,0x1b6));var _0xb222=function(_0x4caf0d,_0x580ea2){_0x4caf0d=_0x4caf0d-0x0;var _0x473297=_0x222b[_0x4caf0d];return _0x473297;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xb222('0x0'));var _=require(_0xb222('0x1'));var cmHopper=require(_0xb222('0x2'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xb222('0x3'));var cmHopperBlack=require(_0xb222('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xb222('0x5'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x19a94b){return function(_0x1c07a0){logger[_0xb222('0x6')](_0x19a94b,util[_0xb222('0x7')](_0x1c07a0,{'showHidden':![],'depth':null}));};}function create(_0x1cfedb){return BPromise[_0xb222('0x8')]()['then'](cmHopperHistory[_0xb222('0x9')](_0x1cfedb))['catch'](loggerCatch(_0xb222('0xa')));}function createAgent(_0x23e4e2){return BPromise[_0xb222('0x8')]()['then'](agentReportPreview['createHistory'](_0x23e4e2))[_0xb222('0xb')](loggerCatch(_0xb222('0xa')));}function moveContact(_0x4cda50){return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](cmHopper[_0xb222('0xd')](_0x4cda50,!![]))['catch'](loggerCatch(_0xb222('0xe')));}exports[_0xb222('0xf')]=function(_0x56bda1){return BPromise['resolve']()[_0xb222('0xc')](cmHopperBlack[_0xb222('0xf')](_0x56bda1))[_0xb222('0xb')](loggerCatch(_0xb222('0x10')));};exports[_0xb222('0x11')]=function(_0x36cf73){return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](cmHopper[_0xb222('0x11')](_0x36cf73))[_0xb222('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0xb222('0x9')]=function(_0x526567,_0x481d2d){create(_0x526567)[_0xb222('0xb')](loggerCatch(_0x481d2d));moveContact(_0x526567)[_0xb222('0xb')](loggerCatch(_0x481d2d));};exports[_0xb222('0x12')]=function(_0x5b0921,_0xba6089){createAgent(_0x5b0921)[_0xb222('0xb')](loggerCatch(_0xba6089));};exports[_0xb222('0x13')]=function(_0x3dc4b5,_0x5c36a2){create(_0x3dc4b5)[_0xb222('0xb')](loggerCatch(_0x5c36a2));};exports['createCustomerFinal']=function(_0x122017,_0x5330b1){moveContact(_0x122017)[_0xb222('0xb')](loggerCatch(_0x5330b1));};exports[_0xb222('0x14')]=function(_0x4e146a,_0x3a59c8,_0x19d0e0){if(_0x3a59c8){_0x4e146a[_0xb222('0x15')]=null;}if(_0x19d0e0){_0x4e146a['active']=![];}return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](cmHopper['rescheduleContact'](_0x4e146a))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xb222('0x16')]=function(_0x2fa4a8){return BPromise[_0xb222('0x8')]()['then'](cmHopper['countReScheduled'](_0x2fa4a8))[_0xb222('0xb')](loggerCatch('[countReScheduled]\x20'));};exports[_0xb222('0x17')]=function(_0x2da2ee){return BPromise[_0xb222('0x8')]()['then'](cmHopper[_0xb222('0x17')]({'UserId':null},_0x2da2ee,0x1))[_0xb222('0xb')](loggerCatch(_0xb222('0x18')));};exports[_0xb222('0x19')]=function(_0x5e4aa2){return BPromise[_0xb222('0x8')]()['then'](cmHopper['unlockContact']({'active':![]},_0x5e4aa2,0x1))[_0xb222('0xb')](loggerCatch(_0xb222('0x1a')));};exports[_0xb222('0x1b')]=function(_0x192d85){var _0x5364ba={};_0x5364ba[_0xb222('0x1c')]=_0x192d85[_0xb222('0x1c')];_0x5364ba[_0xb222('0x1d')]=_0x192d85['uniqueid'];_0x5364ba[_0xb222('0x1e')]=_0x192d85['calleridnum'];_0x5364ba[_0xb222('0x1f')]=_0x192d85[_0xb222('0x1f')];_0x5364ba['queue']=_0x192d85['queue'];_0x5364ba[_0xb222('0x20')]=_0x192d85['answertime'];_0x5364ba['queuecallerleaveAt']=_0x192d85[_0xb222('0x21')];_0x5364ba['queuecallercomplete']=0x1;_0x5364ba['queuecallercompleteAt']=_0x192d85['endtime'];_0x5364ba[_0xb222('0x22')]=_0x192d85[_0xb222('0x23')];_0x5364ba[_0xb222('0x24')]=_0xb222('0x25');_0x5364ba[_0xb222('0x26')]='xcally-motion-preview';_0x5364ba[_0xb222('0x27')]=0x0;_0x5364ba[_0xb222('0x28')]=0x1;_0x5364ba[_0xb222('0x29')]=_0x192d85[_0xb222('0x23')];_0x5364ba[_0xb222('0x2a')]=_0xb222('0x2b');return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](voiceQueueReport[_0xb222('0x2c')](_0x5364ba))[_0xb222('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xb222('0x2d')]=function(_0x2d2f74,_0x592209){return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](cmHopper[_0xb222('0x2d')](_0x2d2f74,_0x592209))[_0xb222('0xb')](loggerCatch(_0xb222('0x2e')));};exports[_0xb222('0x2f')]=function(_0x340f02){return BPromise[_0xb222('0x8')]()[_0xb222('0xc')](cmHopper[_0xb222('0x14')](_0x340f02,!![],!![]))[_0xb222('0xb')](loggerCatch(_0xb222('0x30')));}; \ No newline at end of file +var _0x0de3=['queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','queue','queuecallerleaveAt','answertime','queuecallercomplete'];(function(_0x13b6bc,_0x2e4237){var _0x39b9f2=function(_0x3cbda3){while(--_0x3cbda3){_0x13b6bc['push'](_0x13b6bc['shift']());}};_0x39b9f2(++_0x2e4237);}(_0x0de3,0x81));var _0x30de=function(_0x18091b,_0x5d2ca6){_0x18091b=_0x18091b-0x0;var _0x3550a8=_0x0de3[_0x18091b];return _0x3550a8;};'use strict';var util=require(_0x30de('0x0'));var BPromise=require(_0x30de('0x1'));var logger=require(_0x30de('0x2'))(_0x30de('0x3'));var _=require(_0x30de('0x4'));var cmHopper=require(_0x30de('0x5'));var cmHopperFinal=require(_0x30de('0x6'));var cmHopperHistory=require(_0x30de('0x7'));var cmHopperBlack=require(_0x30de('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x30de('0x9'));var voiceQueueReport=require(_0x30de('0xa'));function loggerCatch(_0xb206fd){return function(_0xf8d8d5){logger[_0x30de('0xb')](_0xb206fd,util[_0x30de('0xc')](_0xf8d8d5,{'showHidden':![],'depth':null}));};}function create(_0x3d55e2){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopperHistory[_0x30de('0xf')](_0x3d55e2))[_0x30de('0x10')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x52607b){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](agentReportPreview['createHistory'](_0x52607b))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x247b8d){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper[_0x30de('0x11')](_0x247b8d,!![]))[_0x30de('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x30de('0x12')]=function(_0x3caf56){return BPromise['resolve']()[_0x30de('0xe')](cmHopperBlack['checkIsBlackList'](_0x3caf56))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x30de('0x13')]=function(_0x5d1dc7){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper[_0x30de('0x13')](_0x5d1dc7))[_0x30de('0x10')](loggerCatch(_0x30de('0x14')));};exports[_0x30de('0xf')]=function(_0x1cffe,_0x4e011f){create(_0x1cffe)['catch'](loggerCatch(_0x4e011f));moveContact(_0x1cffe)[_0x30de('0x10')](loggerCatch(_0x4e011f));};exports[_0x30de('0x15')]=function(_0x19b9dd,_0x4ce821){createAgent(_0x19b9dd)[_0x30de('0x10')](loggerCatch(_0x4ce821));};exports[_0x30de('0x16')]=function(_0x91ddff,_0xe0ca51){create(_0x91ddff)[_0x30de('0x10')](loggerCatch(_0xe0ca51));};exports[_0x30de('0x17')]=function(_0x184e82,_0x15021c){moveContact(_0x184e82)[_0x30de('0x10')](loggerCatch(_0x15021c));};exports[_0x30de('0x18')]=function(_0x4deee2,_0x28131f,_0x447d7c){if(_0x28131f){_0x4deee2[_0x30de('0x19')]=null;}if(_0x447d7c){_0x4deee2[_0x30de('0x1a')]=![];}return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper[_0x30de('0x18')](_0x4deee2))[_0x30de('0x10')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x30de('0x1b')]=function(_0x1b6229){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper['countReScheduled'](_0x1b6229))[_0x30de('0x10')](loggerCatch(_0x30de('0x1c')));};exports[_0x30de('0x1d')]=function(_0x344afa){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper[_0x30de('0x1d')]({'UserId':null},_0x344afa,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x30de('0x1e')]=function(_0x27fc2c){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper['unlockContact']({'active':![]},_0x27fc2c,0x1))[_0x30de('0x10')](loggerCatch(_0x30de('0x1f')));};exports[_0x30de('0x20')]=function(_0x47f6be){var _0x4ed587={};_0x4ed587[_0x30de('0x21')]=_0x47f6be['type'];_0x4ed587['uniqueid']=_0x47f6be['uniqueid'];_0x4ed587[_0x30de('0x22')]=_0x47f6be[_0x30de('0x22')];_0x4ed587['calleridname']=_0x47f6be['calleridname'];_0x4ed587['queue']=_0x47f6be[_0x30de('0x23')];_0x4ed587['queuecallerjoinAt']=_0x47f6be['answertime'];_0x4ed587[_0x30de('0x24')]=_0x47f6be[_0x30de('0x25')];_0x4ed587[_0x30de('0x26')]=0x1;_0x4ed587[_0x30de('0x27')]=_0x47f6be[_0x30de('0x28')];_0x4ed587[_0x30de('0x29')]=_0x47f6be['membername'];_0x4ed587[_0x30de('0x2a')]=_0x30de('0x2b');_0x4ed587[_0x30de('0x2c')]='xcally-motion-preview';_0x4ed587[_0x30de('0x2d')]=0x0;_0x4ed587['assigned']=0x1;_0x4ed587[_0x30de('0x2e')]=_0x47f6be[_0x30de('0x2f')];_0x4ed587[_0x30de('0x30')]=_0x30de('0x31');return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](voiceQueueReport[_0x30de('0x32')](_0x4ed587))[_0x30de('0x10')](loggerCatch(_0x30de('0x33')));};exports[_0x30de('0x34')]=function(_0x5862b3,_0x1f0ea4){return BPromise[_0x30de('0xd')]()[_0x30de('0xe')](cmHopper[_0x30de('0x34')](_0x5862b3,_0x1f0ea4))[_0x30de('0x10')](loggerCatch(_0x30de('0x35')));};exports[_0x30de('0x36')]=function(_0x22d0a0){return BPromise['resolve']()[_0x30de('0xe')](cmHopper[_0x30de('0x18')](_0x22d0a0,!![],!![]))[_0x30de('0x10')](loggerCatch(_0x30de('0x37')));}; \ 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 e4abd99..dd15739 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 _0xc522=['originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','createdAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','logCustomer','endtime','answertime','isFailure','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','active','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','error','logger','info','inspect','loggerError','logger2','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','NONE','\x22agi://%s/square,%s\x22'];(function(_0x1b2cd4,_0x220d18){var _0x3e2ff5=function(_0x5ef59c){while(--_0x5ef59c){_0x1b2cd4['push'](_0x1b2cd4['shift']());}};_0x3e2ff5(++_0x220d18);}(_0xc522,0x100));var _0x2c52=function(_0x1650d0,_0x12a933){_0x1650d0=_0x1650d0-0x0;var _0x5a5c83=_0xc522[_0x1650d0];return _0x5a5c83;};'use strict';var util=require('util');var _=require(_0x2c52('0x0'));var moment=require(_0x2c52('0x1'));var logger=require(_0x2c52('0x2'))(_0x2c52('0x3'));var ipAgi=process['env'][_0x2c52('0x4')]||'127.0.0.1';function getSeconds(_0x543c29,_0xeb1d96){var _0x28837d=moment(_0x543c29)[_0x2c52('0x5')](0x0);var _0x292afd=moment(_0xeb1d96)[_0x2c52('0x5')](0x0);return _0x28837d[_0x2c52('0x6')](_0x292afd,_0x2c52('0x7'));}exports['loggerCatch']=function(_0x2eb170){return function(_0x4576d7){logger[_0x2c52('0x8')](_0x2eb170,util['inspect'](_0x4576d7,{'showHidden':![],'depth':null}));};};exports[_0x2c52('0x9')]=function(_0x60c64e,_0x49385f){logger[_0x2c52('0xa')](_0x60c64e,util[_0x2c52('0xb')](_0x49385f,{'showHidden':![],'depth':null}));};exports[_0x2c52('0xc')]=function(_0x47338f,_0xaf96e2){logger[_0x2c52('0x8')](_0x47338f,util['inspect'](_0xaf96e2,{'showHidden':![],'depth':null}));};exports[_0x2c52('0xd')]=function(_0xca0dbe){return function(_0x1cabc5){logger[_0x2c52('0xa')](_0xca0dbe,util[_0x2c52('0xb')](_0x1cabc5,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x410a9d,_0x4e8667,_0x539dce){return{'message':_0x410a9d,'unlock':_0x4e8667,'active':_0x539dce};};exports['getCallerId']=function(_0x368657,_0xa0cbe7,_0x8577cd){if(!_[_0x2c52('0xe')](_0x8577cd)&&'string'===typeof _0x8577cd&&!_[_0x2c52('0xf')](_0x8577cd)){if(!_[_0x2c52('0xe')](_0xa0cbe7)&&_0x2c52('0x10')===typeof _0xa0cbe7&&!_[_0x2c52('0xf')](_0xa0cbe7)){return util['format'](_0x2c52('0x11'),_0xa0cbe7,_0x8577cd);}return util[_0x2c52('0x12')](_0x2c52('0x11'),_0x8577cd,_0x8577cd);}if(!_[_0x2c52('0xe')](_0x368657)&&'string'===typeof _0x368657&&!_[_0x2c52('0xf')](_0x368657)){return _0x368657;}return _0x2c52('0x13');};exports['isActive']=function(_0x3a5463){if(_[_0x2c52('0x14')](_0x3a5463)){return![];}return _0x3a5463;};exports[_0x2c52('0x15')]=function(_0x4e8eba,_0xda1ee1,_0x149efb,_0xe6f3c7,_0x4e4d13,_0x7bbbe2){var _0x2f6b97={'XMD-QUEUE':_0xda1ee1[_0x2c52('0x16')]?_0xda1ee1['Queue']['name']:'','XMD-CALLERID':_0xe6f3c7,'XMD-CALLERID-PREVIEW':_0x7bbbe2?util[_0x2c52('0x12')]('\x22%s\x22\x20<%s>',_0x7bbbe2[_0x2c52('0x17')],_0x7bbbe2[_0x2c52('0x18')]):_0xe6f3c7,'XMD-DIALID':_0x4e4d13,'XMD-CONTACTID':_0xda1ee1['ContactId'],'XMD-CDRTYPE':_0x2c52('0x19'),'CALLERID(all)':_0xe6f3c7,'XMD-VOICEQUEUEID':_0xda1ee1[_0x2c52('0x1a')],'XMD-DIALCHANNEL':_0x149efb,'XMD-DIALTIMEOUT':_0x4e8eba[_0x2c52('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x2c52('0x12')](_0x2c52('0x1c'),_0x4e8eba[_0x2c52('0x1d')]?'g':'',_[_0x2c52('0xf')](_0x4e8eba[_0x2c52('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4e8eba['dialPreviewUrl']||'','XMD-AGI':_0x4e8eba[_0x2c52('0x1f')]?util[_0x2c52('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4e8eba[_0x2c52('0x1f')]):_0x2c52('0x20'),'XMD-AGIAFTER':_0x4e8eba[_0x2c52('0x1d')]?util['format'](_0x2c52('0x21'),ipAgi,_0x4e8eba[_0x2c52('0x1d')]):_0x2c52('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x7bbbe2?_0x7bbbe2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x7bbbe2?_0x7bbbe2[_0x2c52('0x22')]:'','XMD-DESTINATION':_0x2c52('0x23'),'SIPADDHEADER':_0x2c52('0x24')};if(!_[_0x2c52('0xf')](_0x4e8eba['monitor_format'])){_0x2f6b97[util[_0x2c52('0x12')]('%s',_0x2c52('0x25'))]=_0x4e8eba[_0x2c52('0x1e')];_0x2f6b97[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4e4d13;}if(_0xda1ee1&&_0xda1ee1[_0x2c52('0x26')]){for(var _0x3bc69a in _0xda1ee1[_0x2c52('0x26')]){if(_0xda1ee1[_0x2c52('0x26')]['hasOwnProperty'](_0x3bc69a)){if(!_['isNil'](_0xda1ee1[_0x2c52('0x26')][_0x3bc69a])&&_0x3bc69a!=='id'&&_0x3bc69a!=='tags'&&_0x3bc69a!==_0x2c52('0x27')&&_0x3bc69a!=='updatedAt'){_0x2f6b97[util[_0x2c52('0x12')](_0x2c52('0x28'),_0x2c52('0x29'),_[_0x2c52('0x2a')](_0x3bc69a))]=_0xda1ee1['Contact'][_0x3bc69a];}}}}return _0x2f6b97;};exports[_0x2c52('0x2b')]=function(_0x41db56){var _0x25d392={};for(var _0x12b56a in _0x41db56){if(_0x41db56[_0x2c52('0x2c')](_0x12b56a)){_0x25d392[util[_0x2c52('0x12')]('%s',_['toLower'](_0x12b56a))]=_0x41db56[_0x12b56a];}}return{'variables':_0x25d392};};exports[_0x2c52('0x2d')]=function(_0xc7fa09,_0x450fef){if(!_['isNil'](_0xc7fa09)){if(_0xc7fa09[_0x2c52('0x2c')](_0x2c52('0x2e'))){if(_0xc7fa09[_0x2c52('0x2e')]>0x0){_0xc7fa09[_0x2c52('0x2e')]-=0x1;}else{logger[_0x2c52('0x8')](_0x2c52('0x2f'),_0x450fef);}}}else{logger[_0x2c52('0x8')](_0x2c52('0x30'),_0x450fef);}};exports[_0x2c52('0x31')]=function(_0x132309){var _0x42d58f=moment()[_0x2c52('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x132309[_0x2c52('0x32')]=0xd;_0x132309[_0x2c52('0x33')]='Blacklist';_0x132309[_0x2c52('0x34')]=_0x42d58f;_0x132309[_0x2c52('0x35')]=_0x42d58f;_0x132309['endtime']=_0x42d58f;};exports[_0x2c52('0x36')]=function(_0x88573b,_0x2f43e8,_0x5c8bb0){var _0x34c84f=moment()[_0x2c52('0x12')](_0x2c52('0x37'));_0x88573b[_0x2c52('0x32')]=_0x2f43e8;_0x88573b['statedesc']=_0x5c8bb0;_0x88573b[_0x2c52('0x35')]=_0x34c84f;_0x88573b[_0x2c52('0x38')]=getSeconds(_0x88573b[_0x2c52('0x35')],_0x88573b['starttime']);};exports[_0x2c52('0x39')]=function(_0x42c440,_0x2d9296,_0x1a7f6e){_0x42c440[_0x2c52('0x3a')]=_0x2d9296;_0x42c440['UserId']=_0x1a7f6e;};exports[_0x2c52('0x3b')]=function(_0xe2cbeb,_0x359102,_0x302616){var _0x48546f=moment()[_0x2c52('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xe2cbeb[_0x2c52('0x32')]=_0x359102;_0xe2cbeb[_0x2c52('0x33')]=_0x302616;_0xe2cbeb[_0x2c52('0x35')]=_0xe2cbeb['responsetime']?_0xe2cbeb['responsetime']:_0x48546f;_0xe2cbeb[_0x2c52('0x3c')]=_0xe2cbeb[_0x2c52('0x3c')]?_0xe2cbeb[_0x2c52('0x3c')]:_0x48546f;_0xe2cbeb['ringtime']=getSeconds(_0xe2cbeb[_0x2c52('0x35')]||0x0,_0xe2cbeb['starttime']||0x0);_0xe2cbeb['talktime']=_0xe2cbeb[_0x2c52('0x3d')]?getSeconds(_0xe2cbeb[_0x2c52('0x3c')],_0xe2cbeb[_0x2c52('0x3d')]):0x0;};exports[_0x2c52('0x3e')]=function(_0x4e26ed){return _0x4e26ed==='Failure';};exports['variablesAction']=function(_0x213a85,_0x39e1f8,_0xa35116,_0x49afd5,_0x4c90d2){var _0x36e18b=_0x49afd5?_0x2c52('0x3f'):_0x213a85[_0x2c52('0x17')];_0x36e18b=_0x4c90d2?_0x2c52('0x40'):_0x36e18b;return{'actionid':_0x213a85[_0x2c52('0x41')],'action':'originate','channel':_0x213a85[_0x2c52('0x42')],'callerid':util[_0x2c52('0x12')](_0x2c52('0x11'),_0x36e18b,_0x213a85['calleridnum']),'Exten':_0x2c52('0x23'),'Context':_0x2c52('0x43'),'Priority':'1','variable':_0xa35116,'timeout':(_0x39e1f8[_0x2c52('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x213a85[_0x2c52('0x41')]};};exports[_0x2c52('0x45')]=function(_0x230f44){return _0x230f44[_0x2c52('0x46')]+_0x230f44[_0x2c52('0x47')]+_0x230f44['countnoanswerretry']+_0x230f44[_0x2c52('0x48')]+_0x230f44[_0x2c52('0x49')];};exports[_0x2c52('0x4a')]=function(_0x4d9a7d){var _0x5c6285=_[_0x2c52('0x4b')](_0x4d9a7d);_0x5c6285['state']=0xf;_0x5c6285[_0x2c52('0x33')]=_0x2c52('0x4c');return _0x5c6285;};exports['scheduledAt']=function(_0x5a8480,_0x530eb9,_0x535461){var _0x40dcf9={};_0x40dcf9[_0x530eb9]=_0x5a8480[_0x530eb9];_0x40dcf9['active']=![];_0x40dcf9[_0x2c52('0x4d')]=moment()[_0x2c52('0x4e')](_0x535461,_0x2c52('0x4f'))['format'](_0x2c52('0x37'));_0x40dcf9[_0x2c52('0x50')]=_0x5a8480[_0x2c52('0x50')];_0x40dcf9['ListId']=_0x5a8480[_0x2c52('0x51')];_0x40dcf9['VoiceQueueId']=_0x5a8480[_0x2c52('0x1a')]||undefined;return _0x40dcf9;};exports[_0x2c52('0x52')]=function(_0x139f4a,_0x3e76ea){if(!_[_0x2c52('0x14')](_0x139f4a)){if(_0x139f4a[_0x2c52('0x53')]>0x0){_0x139f4a[_0x2c52('0x53')]-=0x1;}else{logger[_0x2c52('0x8')](_0x3e76ea,_0x2c52('0x54'));}}else{logger['error'](_0x3e76ea,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2c52('0x55')]=function(_0x2ddf80){if(_0x2ddf80<=0x0){return!![];}return![];};function buildObj(_0x42406d,_0x28a450,_0x4e2055){_0x42406d['lastevent']=_0x28a450;_0x42406d[_0x2c52('0x56')]=_0x42406d[_0x2c52('0x57')];_0x42406d[_0x2c52('0x58')]=_0x42406d['channelAgent'];_0x42406d[_0x2c52('0x59')]=_0x2c52('0x5a');if(_0x4e2055){_0x42406d[_0x2c52('0x5b')]=_0x4e2055[_0x2c52('0x5b')];}return _0x42406d;}exports[_0x2c52('0x5c')]=buildObj;exports[_0x2c52('0x5d')]=function(_0x215208){var _0x225661={};_0x225661[_0x2c52('0x57')]=_0x215208[_0x2c52('0x57')];_0x225661[_0x2c52('0x58')]=_0x215208['channelAgent'];_0x225661['uniqueid']=_0x215208[_0x2c52('0x41')];return _0x225661;};exports[_0x2c52('0x5e')]=function(_0x4ae237){var _0x6cc91c=[];for(var _0x36ff84 in _0x4ae237){if(_0x4ae237['hasOwnProperty'](_0x36ff84)){if(!_['isNil'](_0x4ae237[_0x36ff84])&&_0x4ae237[_0x36ff84][_0x2c52('0x32')]==='not_inuse'&&_0x4ae237[_0x36ff84][_0x2c52('0x5f')]===_0x2c52('0x60')){_0x6cc91c['push'](_0x4ae237[_0x36ff84]['id']);}}}return _0x6cc91c;};exports[_0x2c52('0x61')]=function(_0x1e12f7){var _0x272fc1=moment()['milliseconds'](0x0);var _0x12a98b=moment(_0x1e12f7)['milliseconds'](0x0);return _0x272fc1[_0x2c52('0x6')](_0x12a98b,_0x2c52('0x7'));};exports[_0x2c52('0x62')]=function(_0x1511a0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1511a0[_0x2c52('0x50')],'ListId':_0x1511a0[_0x2c52('0x51')],'VoiceQueueId':_0x1511a0[_0x2c52('0x1a')]||undefined,'CampaignId':_0x1511a0[_0x2c52('0x63')]||undefined};};exports[_0x2c52('0x64')]=function(_0x377e43){if(_0x377e43==='uniqueid'||_0x377e43===_0x2c52('0x65')||_0x377e43===_0x2c52('0x57')||_0x377e43==='type'||_0x377e43===_0x2c52('0x66')||_0x377e43==='dialAnswer'||_0x377e43==='membername'||_0x377e43==='channelAgent'||_0x377e43===_0x2c52('0x17')||_0x377e43===_0x2c52('0x67')||_0x377e43===_0x2c52('0x18')||_0x377e43===_0x2c52('0x4d')||_0x377e43==='countbusyretry'||_0x377e43===_0x2c52('0x47')||_0x377e43==='countnoanswerretry'||_0x377e43===_0x2c52('0x68')||_0x377e43===_0x2c52('0x69')||_0x377e43===_0x2c52('0x6a')||_0x377e43==='callbackat'||_0x377e43===_0x2c52('0x6b')||_0x377e43===_0x2c52('0x50')||_0x377e43===_0x2c52('0x51')||_0x377e43===_0x2c52('0x6c')||_0x377e43===_0x2c52('0x1a')||_0x377e43===_0x2c52('0x6d')||_0x377e43===_0x2c52('0x6e')||_0x377e43===_0x2c52('0x6f')||_0x377e43===_0x2c52('0x70')||_0x377e43===_0x2c52('0x71')||_0x377e43===_0x2c52('0x72')||_0x377e43===_0x2c52('0x73')||_0x377e43===_0x2c52('0x74')||_0x377e43===_0x2c52('0x75')||_0x377e43==='xmd-dialchannel'||_0x377e43===_0x2c52('0x76')||_0x377e43===_0x2c52('0x77')||_0x377e43===_0x2c52('0x78')||_0x377e43==='xmd-agiafter'||_0x377e43===_0x2c52('0x79')||_0x377e43===_0x2c52('0x7a')||_0x377e43===_0x2c52('0x7b')||_0x377e43===_0x2c52('0x7c')||_0x377e43===_0x2c52('0x7d')||_0x377e43===_0x2c52('0x7e')||_0x377e43==='rtpaudioqoslossbridged'||_0x377e43===_0x2c52('0x7f')||_0x377e43==='rtpaudioqosrttbridged'||_0x377e43===_0x2c52('0x7a')||_0x377e43===_0x2c52('0x7b')||_0x377e43===_0x2c52('0x7c')||_0x377e43===_0x2c52('0x7d')||_0x377e43==='rtpaudioqosloss'||_0x377e43===_0x2c52('0x80')||_0x377e43===_0x2c52('0x7f')||_0x377e43===_0x2c52('0x81')||_0x377e43===_0x2c52('0x82')||_0x377e43==='bridgepvtcallid'||_0x377e43==='state'||_0x377e43===_0x2c52('0x33')){return![];}return!![];};exports[_0x2c52('0x83')]=function(_0x31926b,_0x43c885){var _0xedff7f,_0x372019,_0x97a197;if(_0x43c885<=0x0){_0x43c885=0x1;}_0xedff7f=new RegExp(_0x2c52('0x84')+_0x43c885+'}$');_0x372019=Math['pow'](0xa,_0x43c885-0x1);_0x97a197=Math[_0x2c52('0x85')](0xa,_0x43c885)-0x1;return util[_0x2c52('0x12')]('%s',_[_0x2c52('0x86')](_0x31926b,_0xedff7f,_[_0x2c52('0x87')](_0x372019,_0x97a197)));};exports[_0x2c52('0x88')]=function(_0x58405a){var _0x20b49e=_0x58405a[_0x2c52('0x89')](/"(.*?)"/);return _0x20b49e?_0x20b49e[0x1]:_0x58405a;};exports[_0x2c52('0x8a')]=function(_0x2f0f9f){var _0x30fe27=_0x2f0f9f[_0x2c52('0x89')](/<(.*?)>/);return _0x30fe27?_0x30fe27[0x1]:_0x2f0f9f;};function buildNoAnswerEventPayload(_0x2893fa,_0x24f859){var _0x2d775d=buildObj(_0x2893fa,_0x2c52('0x8b'));if(!_['isEmpty'](_0x24f859[_0x2c52('0x8c')])){Object[_0x2c52('0x8d')](_0x24f859[_0x2c52('0x8c')])[_0x2c52('0x8e')](function(_0x9c14f4){_0x2d775d[_0x9c14f4[_0x2c52('0x8f')]()]=_0x24f859[_0x2c52('0x8c')][_0x9c14f4];});}return _0x2d775d;}exports[_0x2c52('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x22b4=['rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','toLowerCase','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','inspect','info','loggerError','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','mandatoryDisposition','buildObj','buildAcw','hasOwnProperty','not_inuse','status','push','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos'];(function(_0x325227,_0x18fa99){var _0x3e3bce=function(_0x4c3123){while(--_0x4c3123){_0x325227['push'](_0x325227['shift']());}};_0x3e3bce(++_0x18fa99);}(_0x22b4,0x1be));var _0x422b=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x22b4[_0x1c8c28];return _0x1f59b4;};'use strict';var util=require(_0x422b('0x0'));var _=require('lodash');var moment=require(_0x422b('0x1'));var logger=require(_0x422b('0x2'))(_0x422b('0x3'));var ipAgi=process[_0x422b('0x4')][_0x422b('0x5')]||'127.0.0.1';function getSeconds(_0x36e806,_0x5adcd2){var _0x3cf266=moment(_0x36e806)[_0x422b('0x6')](0x0);var _0x37f094=moment(_0x5adcd2)[_0x422b('0x6')](0x0);return _0x3cf266[_0x422b('0x7')](_0x37f094,_0x422b('0x8'));}exports['loggerCatch']=function(_0xadf1e4){return function(_0x5974c3){logger[_0x422b('0x9')](_0xadf1e4,util[_0x422b('0xa')](_0x5974c3,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x359d4b,_0x2a958d){logger[_0x422b('0xb')](_0x359d4b,util[_0x422b('0xa')](_0x2a958d,{'showHidden':![],'depth':null}));};exports[_0x422b('0xc')]=function(_0x50647f,_0x167584){logger['error'](_0x50647f,util[_0x422b('0xa')](_0x167584,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x564a12){return function(_0x418881){logger['info'](_0x564a12,util['inspect'](_0x418881,{'showHidden':![],'depth':null}));};};exports[_0x422b('0xd')]=function(_0x483cc6,_0x3121d1,_0x31498a){return{'message':_0x483cc6,'unlock':_0x3121d1,'active':_0x31498a};};exports[_0x422b('0xe')]=function(_0x3b1acc,_0x16602f,_0x24e803){if(!_[_0x422b('0xf')](_0x24e803)&&'string'===typeof _0x24e803&&!_[_0x422b('0x10')](_0x24e803)){if(!_[_0x422b('0xf')](_0x16602f)&&'string'===typeof _0x16602f&&!_[_0x422b('0x10')](_0x16602f)){return util[_0x422b('0x11')](_0x422b('0x12'),_0x16602f,_0x24e803);}return util[_0x422b('0x11')](_0x422b('0x12'),_0x24e803,_0x24e803);}if(!_[_0x422b('0xf')](_0x3b1acc)&&'string'===typeof _0x3b1acc&&!_[_0x422b('0x10')](_0x3b1acc)){return _0x3b1acc;}return'\x22\x22\x20<>';};exports[_0x422b('0x13')]=function(_0x5b3428){if(_[_0x422b('0x14')](_0x5b3428)){return![];}return _0x5b3428;};exports[_0x422b('0x15')]=function(_0x3c006f,_0x26aa0,_0x34b375,_0x3afbbb,_0x3ad30c,_0x543ad1){var _0xd1de3a={'XMD-QUEUE':_0x26aa0['Queue']?_0x26aa0[_0x422b('0x16')][_0x422b('0x17')]:'','XMD-CALLERID':_0x3afbbb,'XMD-CALLERID-PREVIEW':_0x543ad1?util['format'](_0x422b('0x12'),_0x543ad1[_0x422b('0x18')],_0x543ad1[_0x422b('0x19')]):_0x3afbbb,'XMD-DIALID':_0x3ad30c,'XMD-CONTACTID':_0x26aa0['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3afbbb,'XMD-VOICEQUEUEID':_0x26aa0['VoiceQueueId'],'XMD-DIALCHANNEL':_0x34b375,'XMD-DIALTIMEOUT':_0x3c006f[_0x422b('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x422b('0x11')](_0x422b('0x1b'),_0x3c006f['dialQueueProject2']?'g':'',_[_0x422b('0x10')](_0x3c006f[_0x422b('0x1c')])?'':_0x422b('0x1d')),'XMD-DIALURL':_0x3c006f['dialPreviewUrl']||'','XMD-AGI':_0x3c006f[_0x422b('0x1e')]?util[_0x422b('0x11')](_0x422b('0x1f'),ipAgi,_0x3c006f['dialQueueProject']):_0x422b('0x20'),'XMD-AGIAFTER':_0x3c006f[_0x422b('0x21')]?util[_0x422b('0x11')](_0x422b('0x1f'),ipAgi,_0x3c006f['dialQueueProject2']):_0x422b('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x543ad1?_0x543ad1[_0x422b('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x543ad1?_0x543ad1[_0x422b('0x23')]:'','XMD-DESTINATION':_0x422b('0x24'),'SIPADDHEADER':_0x422b('0x25')};if(!_[_0x422b('0x10')](_0x3c006f[_0x422b('0x1c')])){_0xd1de3a[util[_0x422b('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3c006f['monitor_format'];_0xd1de3a[util[_0x422b('0x11')]('%s',_0x422b('0x26'))]=_0x3ad30c;}if(_0x26aa0&&_0x26aa0[_0x422b('0x27')]){for(var _0x3e4f63 in _0x26aa0[_0x422b('0x27')]){if(_0x26aa0[_0x422b('0x27')]['hasOwnProperty'](_0x3e4f63)){if(!_[_0x422b('0x14')](_0x26aa0['Contact'][_0x3e4f63])&&_0x3e4f63!=='id'&&_0x3e4f63!==_0x422b('0x28')&&_0x3e4f63!==_0x422b('0x29')&&_0x3e4f63!==_0x422b('0x2a')){_0xd1de3a[util[_0x422b('0x11')]('%s%s',_0x422b('0x2b'),_[_0x422b('0x2c')](_0x3e4f63))]=_0x26aa0[_0x422b('0x27')][_0x3e4f63];}}}}return _0xd1de3a;};exports[_0x422b('0x2d')]=function(_0x4406d7){var _0x459c8b={};for(var _0x5e7f65 in _0x4406d7){if(_0x4406d7['hasOwnProperty'](_0x5e7f65)){_0x459c8b[util[_0x422b('0x11')]('%s',_[_0x422b('0x2e')](_0x5e7f65))]=_0x4406d7[_0x5e7f65];}}return{'variables':_0x459c8b};};exports[_0x422b('0x2f')]=function(_0x4278b1,_0x1d7546){if(!_[_0x422b('0x14')](_0x4278b1)){if(_0x4278b1['hasOwnProperty'](_0x422b('0x30'))){if(_0x4278b1[_0x422b('0x30')]>0x0){_0x4278b1[_0x422b('0x30')]-=0x1;}else{logger[_0x422b('0x9')](_0x422b('0x31'),_0x1d7546);}}}else{logger[_0x422b('0x9')](_0x422b('0x32'),_0x1d7546);}};exports[_0x422b('0x33')]=function(_0x3808ef){var _0x35e482=moment()[_0x422b('0x11')](_0x422b('0x34'));_0x3808ef[_0x422b('0x35')]=0xd;_0x3808ef[_0x422b('0x36')]=_0x422b('0x37');_0x3808ef[_0x422b('0x38')]=_0x35e482;_0x3808ef[_0x422b('0x39')]=_0x35e482;_0x3808ef[_0x422b('0x3a')]=_0x35e482;};exports[_0x422b('0x3b')]=function(_0x116a03,_0xea874f,_0x385885){var _0x571c22=moment()['format'](_0x422b('0x34'));_0x116a03[_0x422b('0x35')]=_0xea874f;_0x116a03[_0x422b('0x36')]=_0x385885;_0x116a03[_0x422b('0x39')]=_0x571c22;_0x116a03[_0x422b('0x3c')]=getSeconds(_0x116a03[_0x422b('0x39')],_0x116a03['starttime']);};exports[_0x422b('0x3d')]=function(_0x2dc459,_0x4925ed,_0x1a83a3){_0x2dc459[_0x422b('0x3e')]=_0x4925ed;_0x2dc459[_0x422b('0x3f')]=_0x1a83a3;};exports[_0x422b('0x40')]=function(_0x48131d,_0x1b668d,_0x1999f5){var _0x15bc0d=moment()[_0x422b('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x48131d['state']=_0x1b668d;_0x48131d['statedesc']=_0x1999f5;_0x48131d['responsetime']=_0x48131d[_0x422b('0x39')]?_0x48131d[_0x422b('0x39')]:_0x15bc0d;_0x48131d[_0x422b('0x3a')]=_0x48131d[_0x422b('0x3a')]?_0x48131d['endtime']:_0x15bc0d;_0x48131d['ringtime']=getSeconds(_0x48131d[_0x422b('0x39')]||0x0,_0x48131d[_0x422b('0x38')]||0x0);_0x48131d[_0x422b('0x41')]=_0x48131d[_0x422b('0x42')]?getSeconds(_0x48131d[_0x422b('0x3a')],_0x48131d[_0x422b('0x42')]):0x0;};exports['isFailure']=function(_0x2794cd){return _0x2794cd===_0x422b('0x43');};exports[_0x422b('0x44')]=function(_0x297c65,_0x4b6791,_0x5a3b08,_0x5773aa,_0x414ef7){var _0x3914aa=_0x5773aa?'RECALL':_0x297c65['calleridname'];_0x3914aa=_0x414ef7?'BOOKED':_0x3914aa;return{'actionid':_0x297c65[_0x422b('0x45')],'action':_0x422b('0x46'),'channel':_0x297c65[_0x422b('0x47')],'callerid':util[_0x422b('0x11')]('\x22%s\x22\x20<%s>',_0x3914aa,_0x297c65[_0x422b('0x19')]),'Exten':'xcally-motion-preview','Context':_0x422b('0x48'),'Priority':'1','variable':_0x5a3b08,'timeout':(_0x4b6791[_0x422b('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x297c65['uniqueid']};};exports['totalGlobal']=function(_0x372cd6){return _0x372cd6['countbusyretry']+_0x372cd6['countcongestionretry']+_0x372cd6[_0x422b('0x4a')]+_0x372cd6[_0x422b('0x4b')]+_0x372cd6['countnosuchnumberretry'];};exports[_0x422b('0x4c')]=function(_0xcadcb3){var _0x3cb354=_[_0x422b('0x4d')](_0xcadcb3);_0x3cb354['state']=0xf;_0x3cb354[_0x422b('0x36')]='Global';return _0x3cb354;};exports[_0x422b('0x4e')]=function(_0x16d28f,_0x1185bb,_0x2373e3){var _0x42de39={};_0x42de39[_0x1185bb]=_0x16d28f[_0x1185bb];_0x42de39[_0x422b('0x4f')]=![];_0x42de39[_0x422b('0x50')]=moment()['add'](_0x2373e3,_0x422b('0x51'))[_0x422b('0x11')](_0x422b('0x34'));_0x42de39[_0x422b('0x52')]=_0x16d28f[_0x422b('0x52')];_0x42de39[_0x422b('0x53')]=_0x16d28f[_0x422b('0x53')];_0x42de39[_0x422b('0x54')]=_0x16d28f[_0x422b('0x54')]||undefined;return _0x42de39;};exports[_0x422b('0x55')]=function(_0x29c612,_0x27af4f){if(!_[_0x422b('0x14')](_0x29c612)){if(_0x29c612[_0x422b('0x56')]>0x0){_0x29c612[_0x422b('0x56')]-=0x1;}else{logger['error'](_0x27af4f,_0x422b('0x57'));}}else{logger[_0x422b('0x9')](_0x27af4f,_0x422b('0x58'));}};exports[_0x422b('0x59')]=function(_0x26808b){if(_0x26808b<=0x0){return!![];}return![];};function buildObj(_0x6390e4,_0x43644e,_0xa5656a){_0x6390e4[_0x422b('0x5a')]=_0x43644e;_0x6390e4[_0x422b('0x17')]=_0x6390e4[_0x422b('0x5b')];_0x6390e4[_0x422b('0x5c')]=_0x6390e4[_0x422b('0x47')];_0x6390e4['motionChannel']='voice';if(_0xa5656a){_0x6390e4[_0x422b('0x5d')]=_0xa5656a[_0x422b('0x5d')];}return _0x6390e4;}exports[_0x422b('0x5e')]=buildObj;exports[_0x422b('0x5f')]=function(_0x4a3bb1){var _0x2a0c08={};_0x2a0c08[_0x422b('0x5b')]=_0x4a3bb1[_0x422b('0x5b')];_0x2a0c08['interface']=_0x4a3bb1['channelAgent'];_0x2a0c08[_0x422b('0x45')]=_0x4a3bb1[_0x422b('0x45')];return _0x2a0c08;};exports['agentReadyId']=function(_0x1bdd8b){var _0x1d0e36=[];for(var _0x58f643 in _0x1bdd8b){if(_0x1bdd8b[_0x422b('0x60')](_0x58f643)){if(!_[_0x422b('0x14')](_0x1bdd8b[_0x58f643])&&_0x1bdd8b[_0x58f643]['state']===_0x422b('0x61')&&_0x1bdd8b[_0x58f643][_0x422b('0x62')]==='reachable'){_0x1d0e36[_0x422b('0x63')](_0x1bdd8b[_0x58f643]['id']);}}}return _0x1d0e36;};exports['getDiff']=function(_0x4cf5d6){var _0x2ee9b0=moment()[_0x422b('0x6')](0x0);var _0x3129c8=moment(_0x4cf5d6)[_0x422b('0x6')](0x0);return _0x2ee9b0[_0x422b('0x7')](_0x3129c8,'seconds');};exports[_0x422b('0x64')]=function(_0x3c5a45){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c5a45[_0x422b('0x52')],'ListId':_0x3c5a45[_0x422b('0x53')],'VoiceQueueId':_0x3c5a45[_0x422b('0x54')]||undefined,'CampaignId':_0x3c5a45['CampaignId']||undefined};};exports[_0x422b('0x65')]=function(_0x4335b0){if(_0x4335b0==='uniqueid'||_0x4335b0===_0x422b('0x66')||_0x4335b0==='queue'||_0x4335b0===_0x422b('0x67')||_0x4335b0===_0x422b('0x68')||_0x4335b0===_0x422b('0x69')||_0x4335b0==='membername'||_0x4335b0===_0x422b('0x47')||_0x4335b0==='calleridname'||_0x4335b0===_0x422b('0x4f')||_0x4335b0===_0x422b('0x19')||_0x4335b0==='scheduledat'||_0x4335b0==='countbusyretry'||_0x4335b0===_0x422b('0x6a')||_0x4335b0===_0x422b('0x4a')||_0x4335b0==='countglobal'||_0x4335b0==='callback'||_0x4335b0===_0x422b('0x6b')||_0x4335b0==='callbackat'||_0x4335b0==='recallme'||_0x4335b0==='ContactId'||_0x4335b0===_0x422b('0x53')||_0x4335b0===_0x422b('0x3f')||_0x4335b0===_0x422b('0x54')||_0x4335b0===_0x422b('0x6c')||_0x4335b0===_0x422b('0x6d')||_0x4335b0==='xmd-queue'||_0x4335b0===_0x422b('0x6e')||_0x4335b0===_0x422b('0x6f')||_0x4335b0===_0x422b('0x70')||_0x4335b0===_0x422b('0x71')||_0x4335b0===_0x422b('0x72')||_0x4335b0===_0x422b('0x73')||_0x4335b0===_0x422b('0x74')||_0x4335b0===_0x422b('0x75')||_0x4335b0===_0x422b('0x76')||_0x4335b0===_0x422b('0x77')||_0x4335b0==='xmd-agiafter'||_0x4335b0===_0x422b('0x78')||_0x4335b0===_0x422b('0x79')||_0x4335b0==='rtpaudioqosbridged'||_0x4335b0==='rtpaudioqosjitter'||_0x4335b0===_0x422b('0x7a')||_0x4335b0===_0x422b('0x7b')||_0x4335b0==='rtpaudioqoslossbridged'||_0x4335b0===_0x422b('0x7c')||_0x4335b0===_0x422b('0x7d')||_0x4335b0===_0x422b('0x79')||_0x4335b0===_0x422b('0x7e')||_0x4335b0===_0x422b('0x7f')||_0x4335b0===_0x422b('0x7a')||_0x4335b0===_0x422b('0x7b')||_0x4335b0===_0x422b('0x80')||_0x4335b0===_0x422b('0x7c')||_0x4335b0==='rtpaudioqosrttbridged'||_0x4335b0===_0x422b('0x81')||_0x4335b0==='bridgepvtcallid'||_0x4335b0==='state'||_0x4335b0===_0x422b('0x36')){return![];}return!![];};exports[_0x422b('0x82')]=function(_0x13f6b6,_0x272551){var _0x113bb9,_0x5c332c,_0x348721;if(_0x272551<=0x0){_0x272551=0x1;}_0x113bb9=new RegExp(_0x422b('0x83')+_0x272551+'}$');_0x5c332c=Math[_0x422b('0x84')](0xa,_0x272551-0x1);_0x348721=Math['pow'](0xa,_0x272551)-0x1;return util[_0x422b('0x11')]('%s',_[_0x422b('0x85')](_0x13f6b6,_0x113bb9,_[_0x422b('0x86')](_0x5c332c,_0x348721)));};exports[_0x422b('0x87')]=function(_0x5ad09d){var _0x514d58=_0x5ad09d[_0x422b('0x88')](/"(.*?)"/);return _0x514d58?_0x514d58[0x1]:_0x5ad09d;};exports[_0x422b('0x89')]=function(_0x542b7d){var _0xaa1460=_0x542b7d[_0x422b('0x88')](/<(.*?)>/);return _0xaa1460?_0xaa1460[0x1]:_0x542b7d;};function buildNoAnswerEventPayload(_0x66cedb,_0x3919da){var _0x4acc5f=buildObj(_0x66cedb,_0x422b('0x8a'));if(!_[_0x422b('0x10')](_0x3919da[_0x422b('0x8b')])){Object[_0x422b('0x8c')](_0x3919da[_0x422b('0x8b')])['forEach'](function(_0x4ed7b6){_0x4acc5f[_0x4ed7b6[_0x422b('0x8d')]()]=_0x3919da['variables'][_0x4ed7b6];});}return _0x4acc5f;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index fdd41a0..73cad3b 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 _0x1c36=['queueadd','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x4aa931,_0x19e5d3){var _0x323459=function(_0x1bf5d9){while(--_0x1bf5d9){_0x4aa931['push'](_0x4aa931['shift']());}};_0x323459(++_0x19e5d3);}(_0x1c36,0x14a));var _0x61c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c36[_0x2641f9];return _0x585741;};'use strict';exports[_0x61c3('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x61c3('0x1'),'required':!![]},'membername':{'type':_0x61c3('0x1'),'required':!![]},'penalty':{'type':_0x61c3('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x61c3('0x3')]={'queue':{'type':_0x61c3('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x61c3('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x61c3('0x5')},'reason':{'type':_0x61c3('0x1'),'required':![]}};exports[_0x61c3('0x6')]={'module':{'type':_0x61c3('0x1'),'required':![]}};exports[_0x61c3('0x7')]={'uniqueid':{'type':_0x61c3('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x61c3('0x1'),'required':!![]},'filename':{'type':_0x61c3('0x1')},'format':{'type':_0x61c3('0x1')},'mixmonitorid':{'type':_0x61c3('0x1')}};exports[_0x61c3('0x8')]={'uniqueid':{'type':_0x61c3('0x1'),'required':!![]}};exports[_0x61c3('0x9')]={'uniqueid':{'type':_0x61c3('0x1'),'required':!![]},'exten':{'type':_0x61c3('0x1'),'required':!![]},'context':{'type':_0x61c3('0x1')}}; \ No newline at end of file +var _0x6b6b=['voicequeuechannelredirect','queueadd','string','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6b6b,0x197));var _0xb6b6=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x6b6b[_0x218ca4];return _0x1b3ff9;};'use strict';exports[_0xb6b6('0x0')]={'queue':{'type':_0xb6b6('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xb6b6('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xb6b6('0x1'),'required':!![]},'interface':{'type':_0xb6b6('0x1'),'required':!![]}};exports[_0xb6b6('0x2')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xb6b6('0x1'),'required':![]}};exports[_0xb6b6('0x3')]={'module':{'type':'string','required':![]}};exports[_0xb6b6('0x4')]={'uniqueid':{'type':_0xb6b6('0x1'),'required':!![]}};exports[_0xb6b6('0x5')]={'uniqueid':{'type':_0xb6b6('0x1'),'required':!![]},'filename':{'type':_0xb6b6('0x1')},'format':{'type':_0xb6b6('0x1')},'mixmonitorid':{'type':_0xb6b6('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xb6b6('0x6')]={'uniqueid':{'type':_0xb6b6('0x1'),'required':!![]},'exten':{'type':_0xb6b6('0x1'),'required':!![]},'context':{'type':_0xb6b6('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 986a14f..1e04d0f 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 _0x720b=['outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','util','lodash','moment','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','queueChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','interface','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','total','answered','unmanaged','abandoned','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x720b,0x1d8));var _0xb720=function(_0x3cb6fe,_0x5e7169){_0x3cb6fe=_0x3cb6fe-0x0;var _0x45e075=_0x720b[_0x3cb6fe];return _0x45e075;};'use strict';var util=require(_0xb720('0x0'));var _=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var Agent=require('../model/agent');var Telephone=require(_0xb720('0x3'));var Trunk=require(_0xb720('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xb720('0x5'));var Template=require(_0xb720('0x6'));var Campaign=require(_0xb720('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xb720('0x8'));var SalesforceAccount=require(_0xb720('0x9'));var FreshdeskAccount=require(_0xb720('0xa'));var SugarcrmAccount=require(_0xb720('0xb'));var ZohoAccount=require(_0xb720('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xb720('0xd'));var Dynamics365Account=require(_0xb720('0xe'));var FreshsalesAccount=require(_0xb720('0xf'));var FaxAccount=require(_0xb720('0x10'));var Realtime=function(){this[_0xb720('0x11')]={};this[_0xb720('0x12')]={};this[_0xb720('0x13')]={};this[_0xb720('0x14')]={};this['triggers']={};this[_0xb720('0x15')]={};this[_0xb720('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb720('0x17')]={};this['channels']={};this[_0xb720('0x18')]={};this['outboundChannels']={};this[_0xb720('0x19')]={};this[_0xb720('0x1a')]={};this[_0xb720('0x1b')]={};this[_0xb720('0x1c')]={};this[_0xb720('0x1d')]={};this[_0xb720('0x1e')]={};this[_0xb720('0x1f')]={};this[_0xb720('0x20')]={};this['vtigerAccounts']={};this[_0xb720('0x21')]={};this[_0xb720('0x22')]={};this[_0xb720('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x4edde2,_0xc890b,_0x39df81){var _0x373303=_['mapKeys'](_0x4edde2,function(_0x1bda26,_0x142540){return _0x1bda26[_0x39df81];});for(var _0x453c43 in _0xc890b){if(_0xc890b[_0xb720('0x24')](_0x453c43)){if(!_0x373303[_0x453c43]){delete _0xc890b[_0x453c43];}}}}function freeIsNotKeySip(_0x395d6a,_0x730e0f){var _0x4203ce=_[_0xb720('0x25')](_0x395d6a,function(_0x3d8fa4,_0x96435c){return util[_0xb720('0x26')](_0xb720('0x27'),_0x3d8fa4[_0xb720('0x28')]);});for(var _0x3bcca2 in _0x730e0f){if(_0x730e0f[_0xb720('0x24')](_0x3bcca2)){if(!_0x4203ce[_0x3bcca2]){delete _0x730e0f[_0x3bcca2];}}}}function freeIsNotKeyAgent(_0x141dd5,_0x25acb4){var _0x1f1b20=_[_0xb720('0x25')](_0x141dd5,function(_0x8b19ea,_0x4e366a){var _0x5359b5=_['isNil'](_0x8b19ea[_0xb720('0x29')])?util['format'](_0xb720('0x27'),_0x8b19ea[_0xb720('0x28')]):_0x8b19ea[_0xb720('0x29')];return _0x5359b5;});for(var _0x2ad9b5 in _0x25acb4){if(_0x25acb4[_0xb720('0x24')](_0x2ad9b5)){if(!_0x1f1b20[_0x2ad9b5]){delete _0x25acb4[_0x2ad9b5];}}}}function clearVoiceCallReports(_0xa0f8a4){_0xa0f8a4['total']=0x0;_0xa0f8a4['answered']=0x0;_0xa0f8a4['sumHoldTime']=0x0;_0xa0f8a4[_0xb720('0x2a')]=0x0;_0xa0f8a4[_0xb720('0x2b')]=0x0;}function clearCampaigns(_0x5f1e03){if(!_['isEmpty'](_0x5f1e03)){for(var _0x1c3805 in _0x5f1e03){if(_0x5f1e03['hasOwnProperty'](_0x1c3805)){_0x5f1e03[_0x1c3805][_0xb720('0x2c')]=0x0;_0x5f1e03[_0x1c3805]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4e436f){if(!_[_0xb720('0x2d')](_0x4e436f)){for(var _0x401d97 in _0x4e436f){if(_0x4e436f[_0xb720('0x24')](_0x401d97)){_0x4e436f[_0x401d97][_0xb720('0x2e')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x2f')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x30')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x31')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x32')]=0x0;_0x4e436f[_0x401d97]['sumDuration']=0x0;_0x4e436f[_0x401d97]['sumBillable']=0x0;_0x4e436f[_0x401d97]['outboundAnswerAgiCallsDay']=0x0;_0x4e436f[_0x401d97][_0xb720('0x33')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x34')]=0x0;_0x4e436f[_0x401d97]['outboundCongestionCallsDay']=0x0;_0x4e436f[_0x401d97][_0xb720('0x35')]=0x0;_0x4e436f[_0x401d97]['outboundUnknownCallsDay']=0x0;_0x4e436f[_0x401d97][_0xb720('0x36')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x37')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x38')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x39')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x3a')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x3b')]=0x0;_0x4e436f[_0x401d97]['outboundAnswerAgiCallsDay']=0x0;_0x4e436f[_0x401d97][_0xb720('0x3c')]=0x0;_0x4e436f[_0x401d97][_0xb720('0x3d')]=!![];}}}}Realtime[_0xb720('0x3e')]['mergeFromDatabase']=function(_0x346837,_0x20cec1){for(var _0x56cf0a in _0x20cec1){if(_0x346837['hasOwnProperty'](_0x56cf0a)){_0x346837[_0x56cf0a]=_0x20cec1[_0x56cf0a];}}};Realtime[_0xb720('0x3e')]['initAgents']=function(){var _0x1af713=this;return function(_0x470a6c){if(_0x470a6c){freeIsNotKeyAgent(_0x470a6c,_0x1af713[_0xb720('0x11')]);for(var _0x395afa=0x0,_0x510550={},_0x591b0e={};_0x395afa<_0x470a6c[_0xb720('0x3f')];_0x395afa+=0x1){_0x510550=_0x470a6c[_0x395afa];var _0x9d5954=_[_0xb720('0x40')](_0x510550[_0xb720('0x29')])?util[_0xb720('0x26')]('SIP/%s',_0x510550['name']):_0x510550[_0xb720('0x29')];if(_[_0xb720('0x41')](_0x1af713[_0xb720('0x11')][_0x9d5954])){_0x1af713[_0xb720('0x11')][_0x9d5954]=new Agent(_0x510550);}else{_0x1af713[_0xb720('0x42')](_0x1af713[_0xb720('0x11')][_0x9d5954],_0x510550);}}}return _0x1af713[_0xb720('0x11')];};};Realtime[_0xb720('0x3e')][_0xb720('0x43')]=function(){var _0x4f25b1=this;return function(_0x57c61e){if(_0x57c61e){freeIsNotKeySip(_0x57c61e,_0x4f25b1[_0xb720('0x12')]);for(var _0x221d39=0x0,_0x453f21={},_0x22df0a={};_0x221d39<_0x57c61e[_0xb720('0x3f')];_0x221d39+=0x1){_0x453f21=_0x57c61e[_0x221d39];if(_[_0xb720('0x41')](_0x4f25b1[_0xb720('0x12')][util[_0xb720('0x26')](_0xb720('0x27'),_0x453f21[_0xb720('0x28')])])){_0x4f25b1[_0xb720('0x12')][util[_0xb720('0x26')](_0xb720('0x27'),_0x453f21[_0xb720('0x28')])]=new Telephone(_0x453f21);}else{_0x4f25b1['mergeFromDatabase'](_0x4f25b1[_0xb720('0x12')][util[_0xb720('0x26')](_0xb720('0x27'),_0x453f21[_0xb720('0x28')])],_0x453f21);}}}return _0x4f25b1[_0xb720('0x12')];};};Realtime[_0xb720('0x3e')][_0xb720('0x44')]=function(){var _0x5cf8b1=this;return function(_0x2897ee){if(_0x2897ee){freeIsNotKeySip(_0x2897ee,_0x5cf8b1[_0xb720('0x13')]);for(var _0xf71528=0x0,_0x41423b={},_0x110eb9={};_0xf71528<_0x2897ee['length'];_0xf71528+=0x1){_0x41423b=_0x2897ee[_0xf71528];if(_[_0xb720('0x41')](_0x5cf8b1[_0xb720('0x13')][util[_0xb720('0x26')]('SIP/%s',_0x41423b[_0xb720('0x28')])])){_0x5cf8b1['trunks'][util['format'](_0xb720('0x27'),_0x41423b[_0xb720('0x28')])]=new Trunk(_0x41423b);}else{_0x5cf8b1[_0xb720('0x42')](_0x5cf8b1[_0xb720('0x13')][util['format'](_0xb720('0x27'),_0x41423b[_0xb720('0x28')])],_0x41423b);}}}return _0x5cf8b1['trunks'];};};Realtime[_0xb720('0x3e')][_0xb720('0x45')]=function(){var _0x15694e=this;return function(_0x1168f9){if(_0x1168f9){freeIsNotKey(_0x1168f9,_0x15694e[_0xb720('0x14')],_0xb720('0x28'));for(var _0x79b190=0x0,_0x45416d={},_0x5d4490={};_0x79b190<_0x1168f9[_0xb720('0x3f')];_0x79b190+=0x1){_0x45416d=_0x1168f9[_0x79b190];if(_[_0xb720('0x41')](_0x15694e['voiceQueues'][_0x45416d[_0xb720('0x28')]])){_0x15694e['voiceQueues'][_0x45416d[_0xb720('0x28')]]=new VoiceQueue(_0x45416d);}else{_0x15694e[_0xb720('0x42')](_0x15694e[_0xb720('0x14')][_0x45416d[_0xb720('0x28')]],_0x45416d);}}}return _0x15694e[_0xb720('0x14')];};};Realtime[_0xb720('0x3e')][_0xb720('0x46')]=function(){var _0x586f7b=this;return function(_0x43c83c){if(_0x43c83c){freeIsNotKey(_0x43c83c,_0x586f7b['triggers'],'id');for(var _0x106be1=0x0,_0x5bc36d={},_0x32c59f={};_0x106be1<_0x43c83c[_0xb720('0x3f')];_0x106be1+=0x1){_0x5bc36d=_0x43c83c[_0x106be1];if(_[_0xb720('0x41')](_0x586f7b[_0xb720('0x47')][_0x5bc36d['id']])){_0x586f7b[_0xb720('0x47')][_0x5bc36d['id']]=new Trigger(_0x5bc36d);}else{_0x586f7b[_0xb720('0x42')](_0x586f7b[_0xb720('0x47')][_0x5bc36d['id']],_0x5bc36d);}}}return _0x586f7b[_0xb720('0x47')];};};Realtime[_0xb720('0x3e')]['initTemplates']=function(){var _0x5565c9=this;return function(_0x1375f9){if(_0x1375f9){freeIsNotKey(_0x1375f9,_0x5565c9[_0xb720('0x16')],'id');for(var _0x3050ae=0x0,_0xa736f9={},_0x586a18={};_0x3050ae<_0x1375f9[_0xb720('0x3f')];_0x3050ae+=0x1){_0xa736f9=_0x1375f9[_0x3050ae];if(_[_0xb720('0x41')](_0x5565c9['templates'][_0xa736f9['id']])){_0x5565c9[_0xb720('0x16')][_0xa736f9['id']]=new Template(_0xa736f9);}else{_0x5565c9[_0xb720('0x42')](_0x5565c9['templates'][_0xa736f9['id']],_0xa736f9);}}}return _0x5565c9[_0xb720('0x16')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x1bc261=this;return function(_0x433bc7){if(_0x433bc7){freeIsNotKey(_0x433bc7,_0x1bc261[_0xb720('0x1b')],'id');for(var _0x3a51f9=0x0,_0x17e0fd={},_0x1f79dc={};_0x3a51f9<_0x433bc7[_0xb720('0x3f')];_0x3a51f9+=0x1){_0x17e0fd=_0x433bc7[_0x3a51f9];if(_[_0xb720('0x41')](_0x1bc261[_0xb720('0x1b')][_0x17e0fd['id']])){_0x1bc261[_0xb720('0x1b')][_0x17e0fd['id']]=new ZendeskAccount(_0x17e0fd);}else{_0x1bc261[_0xb720('0x42')](_0x1bc261[_0xb720('0x1b')][_0x17e0fd['id']],_0x17e0fd);}}}return _0x1bc261['zendeskAccounts'];};};Realtime[_0xb720('0x3e')][_0xb720('0x48')]=function(){var _0x38196a=this;return function(_0x50395b){if(_0x50395b){freeIsNotKey(_0x50395b,_0x38196a['salesforceAccounts'],'id');for(var _0x12458d=0x0,_0x2ea74c={},_0x2e29f9={};_0x12458d<_0x50395b[_0xb720('0x3f')];_0x12458d+=0x1){_0x2ea74c=_0x50395b[_0x12458d];if(_[_0xb720('0x41')](_0x38196a['salesforceAccounts'][_0x2ea74c['id']])){_0x38196a['salesforceAccounts'][_0x2ea74c['id']]=new SalesforceAccount(_0x2ea74c);}else{_0x38196a['mergeFromDatabase'](_0x38196a[_0xb720('0x1c')][_0x2ea74c['id']],_0x2ea74c);}}}return _0x38196a['salesforceAccounts'];};};Realtime[_0xb720('0x3e')]['initFreshdeskAccounts']=function(){var _0x33174e=this;return function(_0x7e73f){if(_0x7e73f){freeIsNotKey(_0x7e73f,_0x33174e[_0xb720('0x1e')],'id');for(var _0x6ab561=0x0,_0x5254a3={},_0x24e69f={};_0x6ab561<_0x7e73f[_0xb720('0x3f')];_0x6ab561+=0x1){_0x5254a3=_0x7e73f[_0x6ab561];if(_[_0xb720('0x41')](_0x33174e[_0xb720('0x1e')][_0x5254a3['id']])){_0x33174e['freshdeskAccounts'][_0x5254a3['id']]=new FreshdeskAccount(_0x5254a3);}else{_0x33174e['mergeFromDatabase'](_0x33174e[_0xb720('0x1e')][_0x5254a3['id']],_0x5254a3);}}}return _0x33174e[_0xb720('0x1e')];};};Realtime[_0xb720('0x3e')][_0xb720('0x49')]=function(){var _0x44b3ff=this;return function(_0x32eb55){if(_0x32eb55){freeIsNotKey(_0x32eb55,_0x44b3ff[_0xb720('0x1f')],'id');for(var _0x54cf05=0x0,_0x3291ce={},_0x43a906={};_0x54cf05<_0x32eb55[_0xb720('0x3f')];_0x54cf05+=0x1){_0x3291ce=_0x32eb55[_0x54cf05];if(_[_0xb720('0x41')](_0x44b3ff[_0xb720('0x1f')][_0x3291ce['id']])){_0x44b3ff[_0xb720('0x1f')][_0x3291ce['id']]=new ZohoAccount(_0x3291ce);}else{_0x44b3ff[_0xb720('0x42')](_0x44b3ff[_0xb720('0x1f')][_0x3291ce['id']],_0x3291ce);}}}return _0x44b3ff['zohoAccounts'];};};Realtime[_0xb720('0x3e')][_0xb720('0x4a')]=function(){var _0x9e6d91=this;return function(_0x38f88e){if(_0x38f88e){freeIsNotKey(_0x38f88e,_0x9e6d91[_0xb720('0x20')],'id');for(var _0x10b64=0x0,_0xf8e586={},_0x2c9ac5={};_0x10b64<_0x38f88e[_0xb720('0x3f')];_0x10b64+=0x1){_0xf8e586=_0x38f88e[_0x10b64];if(_[_0xb720('0x41')](_0x9e6d91['deskAccounts'][_0xf8e586['id']])){_0x9e6d91['deskAccounts'][_0xf8e586['id']]=new DeskAccount(_0xf8e586);}else{_0x9e6d91[_0xb720('0x42')](_0x9e6d91['deskAccounts'][_0xf8e586['id']],_0xf8e586);}}}return _0x9e6d91[_0xb720('0x20')];};};Realtime['prototype'][_0xb720('0x4b')]=function(){var _0x1273a2=this;return function(_0xe21b05){if(_0xe21b05){freeIsNotKey(_0xe21b05,_0x1273a2[_0xb720('0x1d')],'id');for(var _0xbb6594=0x0,_0x3bba9e={},_0x51112f={};_0xbb6594<_0xe21b05[_0xb720('0x3f')];_0xbb6594+=0x1){_0x3bba9e=_0xe21b05[_0xbb6594];if(_[_0xb720('0x41')](_0x1273a2[_0xb720('0x1d')][_0x3bba9e['id']])){_0x1273a2[_0xb720('0x1d')][_0x3bba9e['id']]=new SugarcrmAccount(_0x3bba9e);}else{_0x1273a2['mergeFromDatabase'](_0x1273a2[_0xb720('0x1d')][_0x3bba9e['id']],_0x3bba9e);}}}return _0x1273a2[_0xb720('0x1d')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x4a170c=this;return function(_0x4ef828){if(_0x4ef828){freeIsNotKey(_0x4ef828,_0x4a170c[_0xb720('0x4c')],'id');for(var _0x4d8c2a=0x0,_0x98950={},_0x3bc09b={};_0x4d8c2a<_0x4ef828['length'];_0x4d8c2a+=0x1){_0x98950=_0x4ef828[_0x4d8c2a];if(_[_0xb720('0x41')](_0x4a170c[_0xb720('0x4c')][_0x98950['id']])){_0x4a170c['vtigerAccounts'][_0x98950['id']]=new VtigerAccount(_0x98950);}else{_0x4a170c['mergeFromDatabase'](_0x4a170c[_0xb720('0x4c')][_0x98950['id']],_0x98950);}}}return _0x4a170c[_0xb720('0x4c')];};};Realtime[_0xb720('0x3e')][_0xb720('0x4d')]=function(){var _0x476165=this;return function(_0x362760){if(_0x362760){freeIsNotKey(_0x362760,_0x476165[_0xb720('0x21')],'id');for(var _0x57c5a9=0x0,_0x1d5318={},_0x359a9c={};_0x57c5a9<_0x362760[_0xb720('0x3f')];_0x57c5a9+=0x1){_0x1d5318=_0x362760[_0x57c5a9];if(_['isUndefined'](_0x476165[_0xb720('0x21')][_0x1d5318['id']])){_0x476165[_0xb720('0x21')][_0x1d5318['id']]=new ServicenowAccount(_0x1d5318);}else{_0x476165[_0xb720('0x42')](_0x476165[_0xb720('0x21')][_0x1d5318['id']],_0x1d5318);}}}return _0x476165[_0xb720('0x21')];};};Realtime[_0xb720('0x3e')][_0xb720('0x4e')]=function(){var _0x269cc2=this;return function(_0x4ac533){if(_0x4ac533){freeIsNotKey(_0x4ac533,_0x269cc2[_0xb720('0x22')],'id');for(var _0x5c889b=0x0,_0x412b5f={},_0x2470f9={};_0x5c889b<_0x4ac533[_0xb720('0x3f')];_0x5c889b+=0x1){_0x412b5f=_0x4ac533[_0x5c889b];if(_['isUndefined'](_0x269cc2['dynamics365Accounts'][_0x412b5f['id']])){_0x269cc2[_0xb720('0x22')][_0x412b5f['id']]=new Dynamics365Account(_0x412b5f);}else{_0x269cc2[_0xb720('0x42')](_0x269cc2[_0xb720('0x22')][_0x412b5f['id']],_0x412b5f);}}}return _0x269cc2[_0xb720('0x22')];};};Realtime[_0xb720('0x3e')]['initFreshsalesAccounts']=function(){var _0x3371f6=this;return function(_0x2149b4){if(_0x2149b4){freeIsNotKey(_0x2149b4,_0x3371f6[_0xb720('0x23')],'id');for(var _0x195507=0x0,_0xeba4a={},_0x52d599={};_0x195507<_0x2149b4[_0xb720('0x3f')];_0x195507+=0x1){_0xeba4a=_0x2149b4[_0x195507];if(_[_0xb720('0x41')](_0x3371f6[_0xb720('0x23')][_0xeba4a['id']])){_0x3371f6['freshsalesAccounts'][_0xeba4a['id']]=new FreshsalesAccount(_0xeba4a);}else{_0x3371f6['mergeFromDatabase'](_0x3371f6[_0xb720('0x23')][_0xeba4a['id']],_0xeba4a);}}}return _0x3371f6['freshsalesAccounts'];};};Realtime[_0xb720('0x3e')][_0xb720('0x4f')]=function(){var _0x33b2f9=this;return function(_0x2bf14e){for(var _0x44d205=0x0;_0x44d205<_0x2bf14e[_0xb720('0x3f')];_0x44d205+=0x1){_[_0xb720('0x50')](_0x33b2f9[_0xb720('0x14')][_0x2bf14e[_0x44d205][_0xb720('0x28')]],_0x2bf14e[_0x44d205]);}return _0x33b2f9[_0xb720('0x14')];};};Realtime[_0xb720('0x3e')][_0xb720('0x51')]=function(){var _0x4a77ae=this;return function(_0x5671dc){clearVoiceQueues(_0x4a77ae[_0xb720('0x14')]);if(_0x5671dc){_0x5671dc=_[_0xb720('0x52')](_0x5671dc,_0xb720('0x53'));for(var _0x51bc6c in _0x5671dc){if(_0x5671dc[_0xb720('0x24')](_0x51bc6c)){var _0x395bc3={};for(var _0x3e6f05=0x0;_0x3e6f05<_0x5671dc[_0x51bc6c][_0xb720('0x3f')];_0x3e6f05+=0x1){var _0x4073eb=_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x54')];if(_0x4a77ae[_0xb720('0x14')][_0x4073eb]){if(_0x5671dc[_0x51bc6c][_0x3e6f05]['queuecallerexit']){_0x4a77ae['voiceQueues'][_0x4073eb][_0xb720('0x30')]+=0x1;}if(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x55')]){_0x4a77ae[_0xb720('0x14')][_0x4073eb]['abandoned']+=0x1;}_0x4a77ae['voiceQueues'][_0x4073eb][_0xb720('0x32')]+=moment(_0x5671dc[_0x51bc6c][_0x3e6f05]['queuecallerleaveAt'])[_0xb720('0x56')](moment(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x57')]),_0xb720('0x58'))||0x0;if(_0x3e6f05===_0x5671dc[_0x51bc6c][_0xb720('0x3f')]-0x1){_0x4a77ae[_0xb720('0x14')][_0x4073eb][_0xb720('0x2a')]+=moment(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x59')]||_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x5a')]||_0x5671dc[_0x51bc6c][_0x3e6f05]['queuecallerexitAt'])[_0xb720('0x56')](moment(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x57')]),'seconds')||0x0;_0x4a77ae[_0xb720('0x14')][_0x4073eb]['total']+=0x1;if(_0x5671dc[_0x51bc6c][_0x3e6f05]['queuecallercomplete']){_0x4a77ae['voiceQueues'][_0x4073eb][_0xb720('0x2f')]+=0x1;_0x4a77ae[_0xb720('0x14')][_0x4073eb][_0xb720('0x2b')]+=moment(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x59')])['diff'](moment(_0x5671dc[_0x51bc6c][_0x3e6f05][_0xb720('0x5b')]),_0xb720('0x58'))||0x0;}}else{_0x4a77ae['voiceQueues'][_0x4073eb]['sumDuration']+=_0x4a77ae[_0xb720('0x14')][_0x4073eb]['sumHoldTime']||0x0;}}}}}}return _0x4a77ae[_0xb720('0x14')];};};Realtime[_0xb720('0x3e')][_0xb720('0x5c')]=function(){var _0x4454ba=this;return function(_0x23c119){clearVoiceCallReports(_0x4454ba[_0xb720('0x5d')]);if(_0x23c119){for(var _0x14d0fb=0x0;_0x14d0fb<_0x23c119[_0xb720('0x3f')];_0x14d0fb+=0x1){_0x4454ba['outbound'][_0xb720('0x2e')]+=0x1;_0x4454ba[_0xb720('0x5d')][_0xb720('0x2a')]+=_0x23c119[_0x14d0fb][_0xb720('0x5e')];if(_0x23c119[_0x14d0fb][_0xb720('0x5f')]===_0xb720('0x60')){_0x4454ba[_0xb720('0x5d')][_0xb720('0x2f')]+=0x1;_0x4454ba['outbound'][_0xb720('0x32')]+=_0x23c119[_0x14d0fb][_0xb720('0x5e')]-_0x23c119[_0x14d0fb][_0xb720('0x61')]||0x0;_0x4454ba[_0xb720('0x5d')][_0xb720('0x2b')]+=_0x23c119[_0x14d0fb][_0xb720('0x61')];}}}return _0x4454ba[_0xb720('0x5d')];};};Realtime[_0xb720('0x3e')][_0xb720('0x62')]=function(){var _0x5137d3=this;return function(_0x1375de){if(_0x1375de){freeIsNotKey(_0x1375de,_0x5137d3['campaigns'],_0xb720('0x28'));for(var _0x1d4b61=0x0,_0x4f0637={};_0x1d4b61<_0x1375de['length'];_0x1d4b61+=0x1){_0x4f0637=_0x1375de[_0x1d4b61];if(_[_0xb720('0x41')](_0x5137d3[_0xb720('0x15')][_0x4f0637[_0xb720('0x28')]])){_0x5137d3[_0xb720('0x15')][_0x4f0637['name']]=new Campaign(_0x4f0637);}else{_0x5137d3['mergeFromDatabase'](_0x5137d3[_0xb720('0x15')][_0x4f0637[_0xb720('0x28')]],_0x4f0637);_0x5137d3[_0xb720('0x15')][_0x4f0637[_0xb720('0x28')]][_0xb720('0x63')]=_0x4f0637[_0xb720('0x64')]?_0x4f0637['SquareProject'][_0xb720('0x28')]:undefined;}}}return _0x5137d3['campaigns'];};};Realtime['prototype'][_0xb720('0x65')]=function(){var _0x4df3a9=this;return function(_0x5ac34e){if(_0x5ac34e){freeIsNotKey(_0x5ac34e,_0x4df3a9[_0xb720('0x17')],'id');for(var _0x556ece=0x0,_0x53cde6={};_0x556ece<_0x5ac34e[_0xb720('0x3f')];_0x556ece+=0x1){_0x53cde6=_0x5ac34e[_0x556ece];if(_[_0xb720('0x41')](_0x4df3a9[_0xb720('0x17')][_0x53cde6['id']])){_0x4df3a9['voiceExtensions'][_0x53cde6['id']]=new VoiceExtension(_0x53cde6);}else{_0x4df3a9['mergeFromDatabase'](_0x4df3a9[_0xb720('0x17')][_0x53cde6['id']],_0x53cde6);}}}return _0x4df3a9[_0xb720('0x17')];};};Realtime[_0xb720('0x3e')][_0xb720('0x66')]=function(){var _0x3be18d=this;return function(_0x179520){clearCampaigns(_0x3be18d[_0xb720('0x15')]);for(var _0x5c9b1e=0x0;_0x5c9b1e<_0x179520[_0xb720('0x3f')];_0x5c9b1e+=0x1){_[_0xb720('0x50')](_0x3be18d['campaigns'][_0x179520[_0x5c9b1e][_0xb720('0x28')]],_0x179520[_0x5c9b1e]);}return _0x3be18d['campaigns'];};};Realtime[_0xb720('0x3e')]['initFaxAccounts']=function(){var _0x5cc7e0=this;return function(_0x2d4fa4){if(_0x2d4fa4){freeIsNotKey(_0x2d4fa4,_0x5cc7e0[_0xb720('0x67')],'id');for(var _0x1d941d=0x0,_0x11f944={},_0x7d7fdb={};_0x1d941d<_0x2d4fa4[_0xb720('0x3f')];_0x1d941d+=0x1){_0x11f944=_0x2d4fa4[_0x1d941d];if(_[_0xb720('0x41')](_0x5cc7e0[_0xb720('0x67')][_0x11f944['id']])){_0x5cc7e0[_0xb720('0x67')][_0x11f944['id']]=new FaxAccount(_0x11f944);}else{_0x5cc7e0[_0xb720('0x42')](_0x5cc7e0[_0xb720('0x67')][_0x11f944['id']],_0x11f944);}}}return _0x5cc7e0['faxAccounts'];};};module[_0xb720('0x68')]=Realtime; \ No newline at end of file +var _0xcf8c=['initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','servicenowAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','outbound','voiceExtensions','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','total','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','answered','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','format','initVoiceQueues','voiceQueues','triggers','initTemplates','templates','initZendeskAccounts'];(function(_0x354459,_0xefa25e){var _0x451021=function(_0x37234e){while(--_0x37234e){_0x354459['push'](_0x354459['shift']());}};_0x451021(++_0xefa25e);}(_0xcf8c,0xf0));var _0xccf8=function(_0x33e1f1,_0x5ef1ea){_0x33e1f1=_0x33e1f1-0x0;var _0x164a4f=_0xcf8c[_0x33e1f1];return _0x164a4f;};'use strict';var util=require(_0xccf8('0x0'));var _=require(_0xccf8('0x1'));var moment=require(_0xccf8('0x2'));var Agent=require(_0xccf8('0x3'));var Telephone=require(_0xccf8('0x4'));var Trunk=require(_0xccf8('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xccf8('0x6'));var Campaign=require(_0xccf8('0x7'));var VoiceExtension=require(_0xccf8('0x8'));var ZendeskAccount=require(_0xccf8('0x9'));var SalesforceAccount=require(_0xccf8('0xa'));var FreshdeskAccount=require(_0xccf8('0xb'));var SugarcrmAccount=require(_0xccf8('0xc'));var ZohoAccount=require(_0xccf8('0xd'));var DeskAccount=require(_0xccf8('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xccf8('0xf'));var FreshsalesAccount=require(_0xccf8('0x10'));var FaxAccount=require(_0xccf8('0x11'));var Realtime=function(){this[_0xccf8('0x12')]={};this[_0xccf8('0x13')]={};this[_0xccf8('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0xccf8('0x15')]={};this['templates']={};this[_0xccf8('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xccf8('0x17')]={};this['channels']={};this[_0xccf8('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0xccf8('0x19')]={};this[_0xccf8('0x1a')]={};this[_0xccf8('0x1b')]={};this[_0xccf8('0x1c')]={};this[_0xccf8('0x1d')]={};this['zohoAccounts']={};this[_0xccf8('0x1e')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xccf8('0x1f')]={};this[_0xccf8('0x20')]={};this[_0xccf8('0x21')]={};};function freeIsNotKey(_0x3fcc88,_0xbb6770,_0x195608){var _0x1e1bdc=_[_0xccf8('0x22')](_0x3fcc88,function(_0x340c64,_0x5a4b4e){return _0x340c64[_0x195608];});for(var _0x569322 in _0xbb6770){if(_0xbb6770[_0xccf8('0x23')](_0x569322)){if(!_0x1e1bdc[_0x569322]){delete _0xbb6770[_0x569322];}}}}function freeIsNotKeySip(_0x40a9af,_0x1ebb7e){var _0x1bab19=_[_0xccf8('0x22')](_0x40a9af,function(_0x313fb5,_0x535735){return util['format'](_0xccf8('0x24'),_0x313fb5[_0xccf8('0x25')]);});for(var _0x2e26a9 in _0x1ebb7e){if(_0x1ebb7e[_0xccf8('0x23')](_0x2e26a9)){if(!_0x1bab19[_0x2e26a9]){delete _0x1ebb7e[_0x2e26a9];}}}}function freeIsNotKeyAgent(_0x548437,_0x40d771){var _0xe03a49=_[_0xccf8('0x22')](_0x548437,function(_0xef5169,_0x498537){var _0xc38a8d=_[_0xccf8('0x26')](_0xef5169[_0xccf8('0x27')])?util['format'](_0xccf8('0x24'),_0xef5169['name']):_0xef5169['interface'];return _0xc38a8d;});for(var _0x40bebe in _0x40d771){if(_0x40d771[_0xccf8('0x23')](_0x40bebe)){if(!_0xe03a49[_0x40bebe]){delete _0x40d771[_0x40bebe];}}}}function clearVoiceCallReports(_0x2a79da){_0x2a79da[_0xccf8('0x28')]=0x0;_0x2a79da['answered']=0x0;_0x2a79da[_0xccf8('0x29')]=0x0;_0x2a79da[_0xccf8('0x2a')]=0x0;_0x2a79da['sumBillable']=0x0;}function clearCampaigns(_0x6e0375){if(!_[_0xccf8('0x2b')](_0x6e0375)){for(var _0x47b6b7 in _0x6e0375){if(_0x6e0375[_0xccf8('0x23')](_0x47b6b7)){_0x6e0375[_0x47b6b7][_0xccf8('0x2c')]=0x0;_0x6e0375[_0x47b6b7]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x8f3e4e){if(!_[_0xccf8('0x2b')](_0x8f3e4e)){for(var _0x354d23 in _0x8f3e4e){if(_0x8f3e4e[_0xccf8('0x23')](_0x354d23)){_0x8f3e4e[_0x354d23][_0xccf8('0x28')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x2d')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x2e')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x2f')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x29')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x2a')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x30')]=0x0;_0x8f3e4e[_0x354d23]['outboundAnswerAgiCallsDay']=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x31')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x32')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x33')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x34')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x35')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x36')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x37')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x38')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x39')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x3a')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x3b')]=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x3c')]=0x0;_0x8f3e4e[_0x354d23]['outboundAnswerCallsDay']=0x0;_0x8f3e4e[_0x354d23][_0xccf8('0x3d')]=!![];}}}}Realtime[_0xccf8('0x3e')][_0xccf8('0x3f')]=function(_0x197076,_0x3fef37){for(var _0x44e1b5 in _0x3fef37){if(_0x197076[_0xccf8('0x23')](_0x44e1b5)){_0x197076[_0x44e1b5]=_0x3fef37[_0x44e1b5];}}};Realtime[_0xccf8('0x3e')][_0xccf8('0x40')]=function(){var _0x46124e=this;return function(_0x4a7915){if(_0x4a7915){freeIsNotKeyAgent(_0x4a7915,_0x46124e[_0xccf8('0x12')]);for(var _0x5eac4f=0x0,_0x313fe5={},_0x2e4461={};_0x5eac4f<_0x4a7915['length'];_0x5eac4f+=0x1){_0x313fe5=_0x4a7915[_0x5eac4f];var _0x44907b=_['isNil'](_0x313fe5[_0xccf8('0x27')])?util['format'](_0xccf8('0x24'),_0x313fe5[_0xccf8('0x25')]):_0x313fe5[_0xccf8('0x27')];if(_[_0xccf8('0x41')](_0x46124e[_0xccf8('0x12')][_0x44907b])){_0x46124e['agents'][_0x44907b]=new Agent(_0x313fe5);}else{_0x46124e[_0xccf8('0x3f')](_0x46124e[_0xccf8('0x12')][_0x44907b],_0x313fe5);}}}return _0x46124e['agents'];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x42')]=function(){var _0x599d64=this;return function(_0x4b13aa){if(_0x4b13aa){freeIsNotKeySip(_0x4b13aa,_0x599d64[_0xccf8('0x13')]);for(var _0x357cf9=0x0,_0x51c354={},_0x619a0a={};_0x357cf9<_0x4b13aa[_0xccf8('0x43')];_0x357cf9+=0x1){_0x51c354=_0x4b13aa[_0x357cf9];if(_['isUndefined'](_0x599d64[_0xccf8('0x13')][util[_0xccf8('0x44')](_0xccf8('0x24'),_0x51c354['name'])])){_0x599d64[_0xccf8('0x13')][util[_0xccf8('0x44')](_0xccf8('0x24'),_0x51c354[_0xccf8('0x25')])]=new Telephone(_0x51c354);}else{_0x599d64['mergeFromDatabase'](_0x599d64[_0xccf8('0x13')][util[_0xccf8('0x44')](_0xccf8('0x24'),_0x51c354[_0xccf8('0x25')])],_0x51c354);}}}return _0x599d64[_0xccf8('0x13')];};};Realtime[_0xccf8('0x3e')]['initTrunks']=function(){var _0x214db3=this;return function(_0x336fe3){if(_0x336fe3){freeIsNotKeySip(_0x336fe3,_0x214db3['trunks']);for(var _0x4207d7=0x0,_0x37608d={},_0x4f6243={};_0x4207d7<_0x336fe3[_0xccf8('0x43')];_0x4207d7+=0x1){_0x37608d=_0x336fe3[_0x4207d7];if(_[_0xccf8('0x41')](_0x214db3[_0xccf8('0x14')][util[_0xccf8('0x44')](_0xccf8('0x24'),_0x37608d[_0xccf8('0x25')])])){_0x214db3['trunks'][util[_0xccf8('0x44')](_0xccf8('0x24'),_0x37608d[_0xccf8('0x25')])]=new Trunk(_0x37608d);}else{_0x214db3[_0xccf8('0x3f')](_0x214db3[_0xccf8('0x14')][util['format'](_0xccf8('0x24'),_0x37608d[_0xccf8('0x25')])],_0x37608d);}}}return _0x214db3[_0xccf8('0x14')];};};Realtime['prototype'][_0xccf8('0x45')]=function(){var _0x1df7b7=this;return function(_0x21b8b7){if(_0x21b8b7){freeIsNotKey(_0x21b8b7,_0x1df7b7[_0xccf8('0x46')],_0xccf8('0x25'));for(var _0x2ffdb9=0x0,_0x43643e={},_0x1c063e={};_0x2ffdb9<_0x21b8b7[_0xccf8('0x43')];_0x2ffdb9+=0x1){_0x43643e=_0x21b8b7[_0x2ffdb9];if(_[_0xccf8('0x41')](_0x1df7b7[_0xccf8('0x46')][_0x43643e[_0xccf8('0x25')]])){_0x1df7b7[_0xccf8('0x46')][_0x43643e['name']]=new VoiceQueue(_0x43643e);}else{_0x1df7b7[_0xccf8('0x3f')](_0x1df7b7[_0xccf8('0x46')][_0x43643e[_0xccf8('0x25')]],_0x43643e);}}}return _0x1df7b7['voiceQueues'];};};Realtime[_0xccf8('0x3e')]['initTriggers']=function(){var _0x32726a=this;return function(_0x4808d8){if(_0x4808d8){freeIsNotKey(_0x4808d8,_0x32726a[_0xccf8('0x47')],'id');for(var _0xd93ee7=0x0,_0x1d5b7d={},_0x14db7c={};_0xd93ee7<_0x4808d8['length'];_0xd93ee7+=0x1){_0x1d5b7d=_0x4808d8[_0xd93ee7];if(_['isUndefined'](_0x32726a[_0xccf8('0x47')][_0x1d5b7d['id']])){_0x32726a['triggers'][_0x1d5b7d['id']]=new Trigger(_0x1d5b7d);}else{_0x32726a['mergeFromDatabase'](_0x32726a[_0xccf8('0x47')][_0x1d5b7d['id']],_0x1d5b7d);}}}return _0x32726a[_0xccf8('0x47')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x48')]=function(){var _0x463db9=this;return function(_0xdf752f){if(_0xdf752f){freeIsNotKey(_0xdf752f,_0x463db9[_0xccf8('0x49')],'id');for(var _0x2b391d=0x0,_0x479579={},_0x10aa36={};_0x2b391d<_0xdf752f[_0xccf8('0x43')];_0x2b391d+=0x1){_0x479579=_0xdf752f[_0x2b391d];if(_[_0xccf8('0x41')](_0x463db9['templates'][_0x479579['id']])){_0x463db9[_0xccf8('0x49')][_0x479579['id']]=new Template(_0x479579);}else{_0x463db9['mergeFromDatabase'](_0x463db9[_0xccf8('0x49')][_0x479579['id']],_0x479579);}}}return _0x463db9['templates'];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x4a')]=function(){var _0x5f520a=this;return function(_0xe2a3d5){if(_0xe2a3d5){freeIsNotKey(_0xe2a3d5,_0x5f520a[_0xccf8('0x1a')],'id');for(var _0x6d1103=0x0,_0x596d29={},_0x2e1f85={};_0x6d1103<_0xe2a3d5[_0xccf8('0x43')];_0x6d1103+=0x1){_0x596d29=_0xe2a3d5[_0x6d1103];if(_[_0xccf8('0x41')](_0x5f520a['zendeskAccounts'][_0x596d29['id']])){_0x5f520a[_0xccf8('0x1a')][_0x596d29['id']]=new ZendeskAccount(_0x596d29);}else{_0x5f520a[_0xccf8('0x3f')](_0x5f520a[_0xccf8('0x1a')][_0x596d29['id']],_0x596d29);}}}return _0x5f520a['zendeskAccounts'];};};Realtime['prototype'][_0xccf8('0x4b')]=function(){var _0x4cf970=this;return function(_0x580452){if(_0x580452){freeIsNotKey(_0x580452,_0x4cf970['salesforceAccounts'],'id');for(var _0xa05e2a=0x0,_0x405f04={},_0xb23349={};_0xa05e2a<_0x580452[_0xccf8('0x43')];_0xa05e2a+=0x1){_0x405f04=_0x580452[_0xa05e2a];if(_[_0xccf8('0x41')](_0x4cf970[_0xccf8('0x1b')][_0x405f04['id']])){_0x4cf970[_0xccf8('0x1b')][_0x405f04['id']]=new SalesforceAccount(_0x405f04);}else{_0x4cf970[_0xccf8('0x3f')](_0x4cf970['salesforceAccounts'][_0x405f04['id']],_0x405f04);}}}return _0x4cf970['salesforceAccounts'];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x4c')]=function(){var _0x265fcc=this;return function(_0x237a16){if(_0x237a16){freeIsNotKey(_0x237a16,_0x265fcc[_0xccf8('0x1d')],'id');for(var _0x100bcd=0x0,_0x17b4b2={},_0x265966={};_0x100bcd<_0x237a16[_0xccf8('0x43')];_0x100bcd+=0x1){_0x17b4b2=_0x237a16[_0x100bcd];if(_[_0xccf8('0x41')](_0x265fcc[_0xccf8('0x1d')][_0x17b4b2['id']])){_0x265fcc['freshdeskAccounts'][_0x17b4b2['id']]=new FreshdeskAccount(_0x17b4b2);}else{_0x265fcc[_0xccf8('0x3f')](_0x265fcc[_0xccf8('0x1d')][_0x17b4b2['id']],_0x17b4b2);}}}return _0x265fcc['freshdeskAccounts'];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x4d')]=function(){var _0x4aed26=this;return function(_0x41dd64){if(_0x41dd64){freeIsNotKey(_0x41dd64,_0x4aed26[_0xccf8('0x4e')],'id');for(var _0x2b1db2=0x0,_0x55aea6={},_0x20df50={};_0x2b1db2<_0x41dd64['length'];_0x2b1db2+=0x1){_0x55aea6=_0x41dd64[_0x2b1db2];if(_[_0xccf8('0x41')](_0x4aed26[_0xccf8('0x4e')][_0x55aea6['id']])){_0x4aed26[_0xccf8('0x4e')][_0x55aea6['id']]=new ZohoAccount(_0x55aea6);}else{_0x4aed26[_0xccf8('0x3f')](_0x4aed26[_0xccf8('0x4e')][_0x55aea6['id']],_0x55aea6);}}}return _0x4aed26['zohoAccounts'];};};Realtime[_0xccf8('0x3e')]['initDeskAccounts']=function(){var _0xc455c2=this;return function(_0x56c1eb){if(_0x56c1eb){freeIsNotKey(_0x56c1eb,_0xc455c2[_0xccf8('0x1e')],'id');for(var _0x44d2b0=0x0,_0x5cde71={},_0x183d8b={};_0x44d2b0<_0x56c1eb[_0xccf8('0x43')];_0x44d2b0+=0x1){_0x5cde71=_0x56c1eb[_0x44d2b0];if(_[_0xccf8('0x41')](_0xc455c2[_0xccf8('0x1e')][_0x5cde71['id']])){_0xc455c2[_0xccf8('0x1e')][_0x5cde71['id']]=new DeskAccount(_0x5cde71);}else{_0xc455c2[_0xccf8('0x3f')](_0xc455c2['deskAccounts'][_0x5cde71['id']],_0x5cde71);}}}return _0xc455c2[_0xccf8('0x1e')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x4f')]=function(){var _0x593592=this;return function(_0x56ee5e){if(_0x56ee5e){freeIsNotKey(_0x56ee5e,_0x593592['sugarcrmAccounts'],'id');for(var _0x5c12ed=0x0,_0x10d995={},_0x1aaec7={};_0x5c12ed<_0x56ee5e[_0xccf8('0x43')];_0x5c12ed+=0x1){_0x10d995=_0x56ee5e[_0x5c12ed];if(_[_0xccf8('0x41')](_0x593592[_0xccf8('0x1c')][_0x10d995['id']])){_0x593592['sugarcrmAccounts'][_0x10d995['id']]=new SugarcrmAccount(_0x10d995);}else{_0x593592[_0xccf8('0x3f')](_0x593592[_0xccf8('0x1c')][_0x10d995['id']],_0x10d995);}}}return _0x593592[_0xccf8('0x1c')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x50')]=function(){var _0x54bbf3=this;return function(_0x345043){if(_0x345043){freeIsNotKey(_0x345043,_0x54bbf3['vtigerAccounts'],'id');for(var _0x456d95=0x0,_0x4618c5={},_0x424539={};_0x456d95<_0x345043['length'];_0x456d95+=0x1){_0x4618c5=_0x345043[_0x456d95];if(_['isUndefined'](_0x54bbf3['vtigerAccounts'][_0x4618c5['id']])){_0x54bbf3[_0xccf8('0x51')][_0x4618c5['id']]=new VtigerAccount(_0x4618c5);}else{_0x54bbf3[_0xccf8('0x3f')](_0x54bbf3['vtigerAccounts'][_0x4618c5['id']],_0x4618c5);}}}return _0x54bbf3['vtigerAccounts'];};};Realtime[_0xccf8('0x3e')]['initServicenowAccounts']=function(){var _0x395868=this;return function(_0x3ecd64){if(_0x3ecd64){freeIsNotKey(_0x3ecd64,_0x395868['servicenowAccounts'],'id');for(var _0x275644=0x0,_0x4562fe={},_0x450b97={};_0x275644<_0x3ecd64[_0xccf8('0x43')];_0x275644+=0x1){_0x4562fe=_0x3ecd64[_0x275644];if(_[_0xccf8('0x41')](_0x395868['servicenowAccounts'][_0x4562fe['id']])){_0x395868[_0xccf8('0x52')][_0x4562fe['id']]=new ServicenowAccount(_0x4562fe);}else{_0x395868[_0xccf8('0x3f')](_0x395868['servicenowAccounts'][_0x4562fe['id']],_0x4562fe);}}}return _0x395868[_0xccf8('0x52')];};};Realtime[_0xccf8('0x3e')]['initDynamics365Accounts']=function(){var _0x145e55=this;return function(_0x56d1f5){if(_0x56d1f5){freeIsNotKey(_0x56d1f5,_0x145e55['dynamics365Accounts'],'id');for(var _0x1337aa=0x0,_0x20cb62={},_0x317fdf={};_0x1337aa<_0x56d1f5['length'];_0x1337aa+=0x1){_0x20cb62=_0x56d1f5[_0x1337aa];if(_[_0xccf8('0x41')](_0x145e55[_0xccf8('0x1f')][_0x20cb62['id']])){_0x145e55[_0xccf8('0x1f')][_0x20cb62['id']]=new Dynamics365Account(_0x20cb62);}else{_0x145e55['mergeFromDatabase'](_0x145e55[_0xccf8('0x1f')][_0x20cb62['id']],_0x20cb62);}}}return _0x145e55[_0xccf8('0x1f')];};};Realtime[_0xccf8('0x3e')]['initFreshsalesAccounts']=function(){var _0x555bba=this;return function(_0x457e4e){if(_0x457e4e){freeIsNotKey(_0x457e4e,_0x555bba[_0xccf8('0x20')],'id');for(var _0x191c80=0x0,_0x523d19={},_0x1f6712={};_0x191c80<_0x457e4e[_0xccf8('0x43')];_0x191c80+=0x1){_0x523d19=_0x457e4e[_0x191c80];if(_['isUndefined'](_0x555bba['freshsalesAccounts'][_0x523d19['id']])){_0x555bba[_0xccf8('0x20')][_0x523d19['id']]=new FreshsalesAccount(_0x523d19);}else{_0x555bba[_0xccf8('0x3f')](_0x555bba[_0xccf8('0x20')][_0x523d19['id']],_0x523d19);}}}return _0x555bba[_0xccf8('0x20')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x53')]=function(){var _0x32302f=this;return function(_0x3d5781){for(var _0x424507=0x0;_0x424507<_0x3d5781[_0xccf8('0x43')];_0x424507+=0x1){_[_0xccf8('0x54')](_0x32302f[_0xccf8('0x46')][_0x3d5781[_0x424507]['name']],_0x3d5781[_0x424507]);}return _0x32302f[_0xccf8('0x46')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x55')]=function(){var _0x256dee=this;return function(_0x54d7c7){clearVoiceQueues(_0x256dee[_0xccf8('0x46')]);if(_0x54d7c7){_0x54d7c7=_['groupBy'](_0x54d7c7,_0xccf8('0x56'));for(var _0x8a230a in _0x54d7c7){if(_0x54d7c7[_0xccf8('0x23')](_0x8a230a)){var _0x105f76={};for(var _0x4747ed=0x0;_0x4747ed<_0x54d7c7[_0x8a230a][_0xccf8('0x43')];_0x4747ed+=0x1){var _0xb02282=_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x57')];if(_0x256dee['voiceQueues'][_0xb02282]){if(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x58')]){_0x256dee['voiceQueues'][_0xb02282]['unmanaged']+=0x1;}if(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x59')]){_0x256dee[_0xccf8('0x46')][_0xb02282][_0xccf8('0x2f')]+=0x1;}_0x256dee[_0xccf8('0x46')][_0xb02282]['sumHoldTime']+=moment(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5a')])[_0xccf8('0x5b')](moment(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5c')]),_0xccf8('0x5d'))||0x0;if(_0x4747ed===_0x54d7c7[_0x8a230a][_0xccf8('0x43')]-0x1){_0x256dee[_0xccf8('0x46')][_0xb02282]['sumDuration']+=moment(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5e')]||_0x54d7c7[_0x8a230a][_0x4747ed]['queuecallerabandonAt']||_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5f')])[_0xccf8('0x5b')](moment(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5c')]),_0xccf8('0x5d'))||0x0;_0x256dee[_0xccf8('0x46')][_0xb02282][_0xccf8('0x28')]+=0x1;if(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x60')]){_0x256dee['voiceQueues'][_0xb02282][_0xccf8('0x2d')]+=0x1;_0x256dee[_0xccf8('0x46')][_0xb02282][_0xccf8('0x30')]+=moment(_0x54d7c7[_0x8a230a][_0x4747ed][_0xccf8('0x5e')])[_0xccf8('0x5b')](moment(_0x54d7c7[_0x8a230a][_0x4747ed]['queuecallerleaveAt']),_0xccf8('0x5d'))||0x0;}}else{_0x256dee[_0xccf8('0x46')][_0xb02282]['sumDuration']+=_0x256dee['voiceQueues'][_0xb02282][_0xccf8('0x29')]||0x0;}}}}}}return _0x256dee[_0xccf8('0x46')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x61')]=function(){var _0x126c9e=this;return function(_0x152576){clearVoiceCallReports(_0x126c9e[_0xccf8('0x16')]);if(_0x152576){for(var _0x575a83=0x0;_0x575a83<_0x152576[_0xccf8('0x43')];_0x575a83+=0x1){_0x126c9e[_0xccf8('0x16')]['total']+=0x1;_0x126c9e[_0xccf8('0x16')][_0xccf8('0x2a')]+=_0x152576[_0x575a83]['duration'];if(_0x152576[_0x575a83][_0xccf8('0x62')]===_0xccf8('0x63')){_0x126c9e[_0xccf8('0x16')][_0xccf8('0x2d')]+=0x1;_0x126c9e['outbound'][_0xccf8('0x29')]+=_0x152576[_0x575a83][_0xccf8('0x64')]-_0x152576[_0x575a83]['billableseconds']||0x0;_0x126c9e['outbound'][_0xccf8('0x30')]+=_0x152576[_0x575a83]['billableseconds'];}}}return _0x126c9e['outbound'];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x65')]=function(){var _0x4a927c=this;return function(_0x48a62e){if(_0x48a62e){freeIsNotKey(_0x48a62e,_0x4a927c[_0xccf8('0x15')],_0xccf8('0x25'));for(var _0x19939f=0x0,_0x4c4666={};_0x19939f<_0x48a62e[_0xccf8('0x43')];_0x19939f+=0x1){_0x4c4666=_0x48a62e[_0x19939f];if(_['isUndefined'](_0x4a927c[_0xccf8('0x15')][_0x4c4666[_0xccf8('0x25')]])){_0x4a927c[_0xccf8('0x15')][_0x4c4666[_0xccf8('0x25')]]=new Campaign(_0x4c4666);}else{_0x4a927c[_0xccf8('0x3f')](_0x4a927c['campaigns'][_0x4c4666['name']],_0x4c4666);_0x4a927c['campaigns'][_0x4c4666[_0xccf8('0x25')]]['dialQueueProject']=_0x4c4666[_0xccf8('0x66')]?_0x4c4666[_0xccf8('0x66')][_0xccf8('0x25')]:undefined;}}}return _0x4a927c[_0xccf8('0x15')];};};Realtime[_0xccf8('0x3e')][_0xccf8('0x67')]=function(){var _0x18d747=this;return function(_0xc415bb){if(_0xc415bb){freeIsNotKey(_0xc415bb,_0x18d747[_0xccf8('0x17')],'id');for(var _0x2ac8af=0x0,_0x3a1022={};_0x2ac8af<_0xc415bb['length'];_0x2ac8af+=0x1){_0x3a1022=_0xc415bb[_0x2ac8af];if(_[_0xccf8('0x41')](_0x18d747['voiceExtensions'][_0x3a1022['id']])){_0x18d747[_0xccf8('0x17')][_0x3a1022['id']]=new VoiceExtension(_0x3a1022);}else{_0x18d747[_0xccf8('0x3f')](_0x18d747['voiceExtensions'][_0x3a1022['id']],_0x3a1022);}}}return _0x18d747[_0xccf8('0x17')];};};Realtime['prototype'][_0xccf8('0x68')]=function(){var _0x35448d=this;return function(_0x436da2){clearCampaigns(_0x35448d['campaigns']);for(var _0x4e04ab=0x0;_0x4e04ab<_0x436da2[_0xccf8('0x43')];_0x4e04ab+=0x1){_[_0xccf8('0x54')](_0x35448d[_0xccf8('0x15')][_0x436da2[_0x4e04ab]['name']],_0x436da2[_0x4e04ab]);}return _0x35448d[_0xccf8('0x15')];};};Realtime[_0xccf8('0x3e')]['initFaxAccounts']=function(){var _0x113a28=this;return function(_0x3c5b13){if(_0x3c5b13){freeIsNotKey(_0x3c5b13,_0x113a28[_0xccf8('0x21')],'id');for(var _0x5f52eb=0x0,_0x3a207d={},_0x2f4e61={};_0x5f52eb<_0x3c5b13[_0xccf8('0x43')];_0x5f52eb+=0x1){_0x3a207d=_0x3c5b13[_0x5f52eb];if(_['isUndefined'](_0x113a28[_0xccf8('0x21')][_0x3a207d['id']])){_0x113a28[_0xccf8('0x21')][_0x3a207d['id']]=new FaxAccount(_0x3a207d);}else{_0x113a28[_0xccf8('0x3f')](_0x113a28[_0xccf8('0x21')][_0x3a207d['id']],_0x3a207d);}}}return _0x113a28[_0xccf8('0x21')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 823336c..c136880 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 _0x95d1=['connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','mobile','indexOf','transfererlinkedid','exports','lodash','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','agents','name','isNil','find','interface','format','voiceQueueReport','length','findAgent','connectedlinenum','accountcode','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','create','match','getAgentByInternal','keys','getCallType','channel','split','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','originatecalleridnum','destinationchannel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','createdAt','xcally-motion-preview'];(function(_0x555ed7,_0x41bcb2){var _0x5864ed=function(_0x25835b){while(--_0x25835b){_0x555ed7['push'](_0x555ed7['shift']());}};_0x5864ed(++_0x41bcb2);}(_0x95d1,0x119));var _0x195d=function(_0x33af52,_0x4a992f){_0x33af52=_0x33af52-0x0;var _0x5ac5bb=_0x95d1[_0x33af52];return _0x5ac5bb;};'use strict';var _=require(_0x195d('0x0'));var moment=require('moment');var util=require(_0x195d('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x195d('0x2'));var RpcVoiceCallReport=require(_0x195d('0x3'));var RpcVoiceDialReport=require(_0x195d('0x4'));var RpcMemberReport=require(_0x195d('0x5'));var RpcVoiceQueueReport=require(_0x195d('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x195d('0x7'));var VoiceQueueReport=require(_0x195d('0x8'));var VoiceCallReport=require(_0x195d('0x9'));var VoiceAgentReport=require(_0x195d('0xa'));var VoiceDialReport=require(_0x195d('0xb'));var UserReport=require(_0x195d('0xc'));function Report(_0x473dc3){this['realtime']=_0x473dc3;this['agents']=_0x473dc3['agents'];this[_0x195d('0xd')]=_0x473dc3[_0x195d('0xd')];}Report[_0x195d('0xe')][_0x195d('0xf')]=function(_0x42a32b){var _0x1e8b3b=new VoiceQueueReport(this[_0x195d('0x10')]);var _0x16782f=new VoiceAgentReport(this[_0x195d('0x10')]);var _0x31906f=new VoiceDialReport(this[_0x195d('0x10')]);var _0x114117=new VoiceCallReport(this[_0x195d('0x10')]);var _0x539410=new UserReport(this['realtime']);if(config['xdr']&&config[_0x195d('0x11')]['disabled']){ami['on'](_0x195d('0x12'),this['voiceQueueReport'][_0x195d('0x13')](this));ami['on']('custom:voiceCallReport',this[_0x195d('0x14')][_0x195d('0x13')](this));ami['on'](_0x195d('0x15'),this[_0x195d('0x16')][_0x195d('0x13')](this));ami['on'](_0x195d('0x17'),this[_0x195d('0x18')][_0x195d('0x13')](this));ami['on'](_0x195d('0x19'),this[_0x195d('0x1a')][_0x195d('0x13')](this));ami['on'](_0x195d('0x1b'),this[_0x195d('0x1c')]['bind'](this));}};Report['prototype']['findAgent']=function(_0x26b181){var _0x420bc1;_0x420bc1=_['find'](this[_0x195d('0x1d')],function(_0x3332f6){return _0x3332f6['accountcode']==_0x26b181||_0x3332f6[_0x195d('0x1e')]==_0x26b181;});if(_[_0x195d('0x1f')](_0x420bc1)){var _0x1e1670=_[_0x195d('0x20')](this[_0x195d('0xd')],function(_0x19e794){return _0x19e794['accountcode']==_0x26b181||_0x19e794[_0x195d('0x1e')]==_0x26b181;});if(_0x1e1670){_0x420bc1=_['find'](this[_0x195d('0x1d')],function(_0x4826b9){return _0x4826b9[_0x195d('0x21')]==util[_0x195d('0x22')]('SIP/%s',_0x1e1670[_0x195d('0x1e')]);});}}return _0x420bc1;};Report[_0x195d('0xe')][_0x195d('0x23')]=function(_0x13eff4){for(var _0x42be3e=0x0;_0x42be3e<_0x13eff4[_0x195d('0x24')];_0x42be3e+=0x1){var _0x3f234b=this[_0x195d('0x25')](_0x13eff4[_0x42be3e][_0x195d('0x26')]);if(_0x3f234b){_0x13eff4[_0x42be3e]['accountcode']=_0x3f234b[_0x195d('0x27')];_0x13eff4[_0x42be3e][_0x195d('0x28')]=!![];_0x13eff4[_0x42be3e][_0x195d('0x29')]=_0x3f234b['name'];_0x13eff4[_0x42be3e][_0x195d('0x21')]=_[_0x195d('0x1f')](_0x3f234b[_0x195d('0x21')])?util[_0x195d('0x22')](_0x195d('0x2a'),_0x3f234b['name']):_0x3f234b[_0x195d('0x21')];if(_0x13eff4[_0x42be3e][_0x195d('0x2b')]){_0x13eff4[_0x42be3e][_0x195d('0x2c')]=moment()[_0x195d('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x13eff4[_0x42be3e]['queuecallerexit']){_0x13eff4[_0x42be3e]['queuecallerexitAt']=moment()[_0x195d('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x195d('0x23')](_0x13eff4[_0x42be3e]);}RpcVoiceQueueReport[_0x195d('0x2d')](_0x13eff4[_0x42be3e]);}};function extractCalleridNumber(_0x1c4a8d){var _0x2b1ef3=_0x1c4a8d[_0x195d('0x2e')](/<(.*?)>/);return _0x2b1ef3?_0x2b1ef3[0x1]:_0x1c4a8d;}Report[_0x195d('0xe')][_0x195d('0x2f')]=function(_0x1e20af){for(var _0x5137d4=0x0;_0x5137d4','linkedid','transfers','uniqueid','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinenum','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','name','isNil','accountcode','interface','SIP/%s','length','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','callerid','context','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel'];(function(_0x44fac3,_0x1796b5){var _0x418e77=function(_0x178caf){while(--_0x178caf){_0x44fac3['push'](_0x44fac3['shift']());}};_0x418e77(++_0x1796b5);}(_0x04c7,0x12b));var _0x704c=function(_0x28e71a,_0x4405bd){_0x28e71a=_0x28e71a-0x0;var _0x268fed=_0x04c7[_0x28e71a];return _0x268fed;};'use strict';var _=require(_0x704c('0x0'));var moment=require('moment');var util=require(_0x704c('0x1'));var config=require(_0x704c('0x2'));var ami=require(_0x704c('0x3'));var RpcVoiceAgentReport=require(_0x704c('0x4'));var RpcVoiceCallReport=require(_0x704c('0x5'));var RpcVoiceDialReport=require(_0x704c('0x6'));var RpcMemberReport=require(_0x704c('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x704c('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x704c('0x9'));var VoiceCallReport=require(_0x704c('0xa'));var VoiceAgentReport=require(_0x704c('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x704c('0xc'));function Report(_0x22bd8d){this['realtime']=_0x22bd8d;this[_0x704c('0xd')]=_0x22bd8d['agents'];this['telephones']=_0x22bd8d[_0x704c('0xe')];}Report[_0x704c('0xf')][_0x704c('0x10')]=function(_0x369fb4){var _0x5b5a3a=new VoiceQueueReport(this[_0x704c('0x11')]);var _0x51105c=new VoiceAgentReport(this[_0x704c('0x11')]);var _0x2cc15b=new VoiceDialReport(this['realtime']);var _0x356262=new VoiceCallReport(this[_0x704c('0x11')]);var _0x134aa2=new UserReport(this[_0x704c('0x11')]);if(config['xdr']&&config['xdr'][_0x704c('0x12')]){ami['on'](_0x704c('0x13'),this['voiceQueueReport']['bind'](this));ami['on'](_0x704c('0x14'),this[_0x704c('0x15')][_0x704c('0x16')](this));ami['on'](_0x704c('0x17'),this[_0x704c('0x18')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x704c('0x19')][_0x704c('0x16')](this));ami['on'](_0x704c('0x1a'),this[_0x704c('0x1b')][_0x704c('0x16')](this));ami['on'](_0x704c('0x1c'),this['attendedTransfer'][_0x704c('0x16')](this));}};Report[_0x704c('0xf')][_0x704c('0x1d')]=function(_0x48267e){var _0x3da7f0;_0x3da7f0=_[_0x704c('0x1e')](this['agents'],function(_0x4fa4ac){return _0x4fa4ac['accountcode']==_0x48267e||_0x4fa4ac[_0x704c('0x1f')]==_0x48267e;});if(_[_0x704c('0x20')](_0x3da7f0)){var _0x5766a4=_[_0x704c('0x1e')](this[_0x704c('0xe')],function(_0x118ba6){return _0x118ba6[_0x704c('0x21')]==_0x48267e||_0x118ba6['name']==_0x48267e;});if(_0x5766a4){_0x3da7f0=_[_0x704c('0x1e')](this['agents'],function(_0xa45ea0){return _0xa45ea0[_0x704c('0x22')]==util['format'](_0x704c('0x23'),_0x5766a4[_0x704c('0x1f')]);});}}return _0x3da7f0;};Report[_0x704c('0xf')]['voiceQueueReport']=function(_0xa89108){for(var _0x18b5bc=0x0;_0x18b5bc<_0xa89108[_0x704c('0x24')];_0x18b5bc+=0x1){var _0x2f4a8b=this[_0x704c('0x1d')](_0xa89108[_0x18b5bc]['connectedlinenum']);if(_0x2f4a8b){_0xa89108[_0x18b5bc]['accountcode']=_0x2f4a8b[_0x704c('0x21')];_0xa89108[_0x18b5bc][_0x704c('0x25')]=!![];_0xa89108[_0x18b5bc]['lastAssignedTo']=_0x2f4a8b['name'];_0xa89108[_0x18b5bc]['interface']=_[_0x704c('0x20')](_0x2f4a8b['interface'])?util['format'](_0x704c('0x23'),_0x2f4a8b['name']):_0x2f4a8b['interface'];if(_0xa89108[_0x18b5bc][_0x704c('0x26')]){_0xa89108[_0x18b5bc][_0x704c('0x27')]=moment()['format'](_0x704c('0x28'));}if(_0xa89108[_0x18b5bc][_0x704c('0x29')]){_0xa89108[_0x18b5bc][_0x704c('0x2a')]=moment()['format'](_0x704c('0x28'));}RpcMemberReport['voiceQueueReport'](_0xa89108[_0x18b5bc]);}RpcVoiceQueueReport[_0x704c('0x2b')](_0xa89108[_0x18b5bc]);}};function extractCalleridNumber(_0x525a62){var _0x35d61f=_0x525a62[_0x704c('0x2c')](/<(.*?)>/);return _0x35d61f?_0x35d61f[0x1]:_0x525a62;}Report[_0x704c('0xf')][_0x704c('0x2d')]=function(_0x4c98c9){for(var _0x15bfdd=0x0;_0x15bfdd0x0?_0x430409:0x0;this['voiceQueues'][_0x48776c['queue']][_0xc242('0x34')]=this[_0xc242('0x12')][_0x48776c['queue']]['talking']>_[_0xc242('0x76')](_0x48776c['loggedin'])?_[_0xc242('0x76')](_0x48776c[_0xc242('0x77')]):this['voiceQueues'][_0x48776c['queue']][_0xc242('0x34')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x48776c[_0xc242('0x70')]],_0xc242('0x16'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xc242('0x43')](this[_0xc242('0x12')][_0x48776c['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xc242('0x78'),this['voiceQueues'][_0x48776c[_0xc242('0x70')]]);}}}catch(_0x275d40){logger[_0xc242('0x41')](_0xc242('0x6d'),util[_0xc242('0x43')](_0x275d40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')][_0xc242('0x19')]=function(_0x336f20){logger[_0xc242('0x4b')](_0xc242('0x79'),util[_0xc242('0x43')](_0x336f20,{'showHidden':![],'depth':null}));ami[_0xc242('0x49')](_0xc242('0x7a'),{});this[_0xc242('0x13')]=!![];};VoiceQueueReport[_0xc242('0xd')][_0xc242('0x1b')]=function(_0x345718){try{if(this[_0xc242('0x6f')](_0x345718)){logger[_0xc242('0x4b')](_0xc242('0x7b'),_0x345718[_0xc242('0x54')],util[_0xc242('0x43')](_0x345718,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xc242('0xf')][_0x345718[_0xc242('0x54')]]))this[_0xc242('0xf')][_0x345718[_0xc242('0x54')]]=[];if(_[_0xc242('0x6a')](this[_0xc242('0x10')][_0x345718[_0xc242('0x54')]]))this[_0xc242('0x10')][_0x345718[_0xc242('0x54')]]={};var _0x5c2d18=new QueueReport();_0x5c2d18['name']=_0x345718[_0xc242('0x70')];_0x5c2d18[_0xc242('0x59')]=this[_0xc242('0x12')][_0x5c2d18['name']]&&this[_0xc242('0x12')][_0x5c2d18[_0xc242('0x50')]][_0xc242('0x59')]?this[_0xc242('0x12')][_0x5c2d18[_0xc242('0x50')]][_0xc242('0x59')]||'inbound':_0xc242('0x5a');_0x5c2d18[_0xc242('0x70')]=_0x345718['queue'];_0x5c2d18[_0xc242('0x7c')]=moment()[_0xc242('0x4e')](_0xc242('0x7d'));_0x5c2d18[_0xc242('0x7e')]=_0x345718['position'];_0x5c2d18[_0xc242('0x7f')]=_0x345718[_0xc242('0x7f')];_0x5c2d18[_0xc242('0x54')]=_0x345718[_0xc242('0x54')];_0x5c2d18[_0xc242('0x80')]=this[_0xc242('0x10')][_0x345718['uniqueid']][_0xc242('0x80')];logger[_0xc242('0x72')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5c2d18['name'],_0x5c2d18[_0xc242('0x59')]);_['merge'](_0x5c2d18,_[_0xc242('0x81')](_0x345718,_[_0xc242('0x82')](_0x5c2d18)));this[_0xc242('0xf')][_0x345718['uniqueid']][_0xc242('0x83')](_0x5c2d18);this[_0xc242('0x10')][_0x345718[_0xc242('0x54')]]=_0x5c2d18;this[_0xc242('0x4a')](_0x5c2d18,_0xc242('0x1a'));}}catch(_0x5b548a){logger[_0xc242('0x41')](_0xc242('0x7b'),_0x345718[_0xc242('0x54')],util[_0xc242('0x43')](_0x5b548a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')][_0xc242('0x84')]=function(_0x1b3be2){try{if(this[_0xc242('0x6f')](_0x1b3be2)){logger[_0xc242('0x4b')](_0xc242('0x85'),_0x1b3be2[_0xc242('0x54')],util['inspect'](_0x1b3be2,{'showHidden':![],'depth':null}));if(this[_0xc242('0xf')][_0x1b3be2[_0xc242('0x54')]]){var _0x14bf0b=_[_0xc242('0x86')](this[_0xc242('0xf')][_0x1b3be2[_0xc242('0x54')]]);_0x14bf0b[_0xc242('0x87')]=![];_0x14bf0b[_0xc242('0x88')]=null;_0x14bf0b[_0xc242('0x89')]=_0x1b3be2[_0xc242('0x89')];_0x14bf0b['originalposition']=_0x1b3be2[_0xc242('0x8a')];_0x14bf0b[_0xc242('0x1c')]=!![];_0x14bf0b['queuecallerabandonAt']=moment()[_0xc242('0x4e')](_0xc242('0x7d'));_0x14bf0b[_0xc242('0x55')]=_0xc242('0x8b');_0x14bf0b[_0xc242('0x8c')]=null;logger[_0xc242('0x72')](_0xc242('0x8d'),_0x14bf0b[_0xc242('0x50')],_0x14bf0b[_0xc242('0x59')]);this[_0xc242('0x10')][_0x1b3be2['uniqueid']]=_0x14bf0b;this[_0xc242('0x47')](_0x14bf0b,_0xc242('0x1c'));}}}catch(_0x48e3b5){logger[_0xc242('0x41')](_0xc242('0x85'),_0x1b3be2[_0xc242('0x54')],util[_0xc242('0x43')](_0x48e3b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')][_0xc242('0x1e')]=function(_0x4895f2){try{if(this[_0xc242('0x6f')](_0x4895f2)){logger[_0xc242('0x4b')](_0xc242('0x8e'),_0x4895f2[_0xc242('0x54')],util[_0xc242('0x43')](_0x4895f2,{'showHidden':![],'depth':null}));if(this[_0xc242('0xf')][_0x4895f2['uniqueid']]){var _0x426d0c=_[_0xc242('0x86')](this['queueReports'][_0x4895f2[_0xc242('0x54')]]);_0x426d0c[_0xc242('0x8f')]=moment()[_0xc242('0x4e')](_0xc242('0x7d'));_0x426d0c[_0xc242('0x90')]=_0x4895f2[_0xc242('0x90')];_0x426d0c[_0xc242('0x91')]=_0x4895f2[_0xc242('0x91')];logger[_0xc242('0x72')](_0xc242('0x92'),_0x426d0c[_0xc242('0x50')],_0x426d0c[_0xc242('0x59')],_0x4895f2[_0xc242('0x90')],_0x4895f2[_0xc242('0x91')]);this[_0xc242('0x10')][_0x4895f2[_0xc242('0x54')]]=_0x426d0c;this[_0xc242('0x4a')](_0x426d0c,_0xc242('0x1d'));}}}catch(_0x186967){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x4895f2[_0xc242('0x54')],util[_0xc242('0x43')](_0x186967,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')][_0xc242('0x22')]=function(_0x4cbfa4){try{if(this['isNotNull'](_0x4cbfa4)){logger[_0xc242('0x4b')](_0xc242('0x93'),_0x4cbfa4[_0xc242('0x54')],util[_0xc242('0x43')](_0x4cbfa4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4cbfa4[_0xc242('0x54')]]){var _0x980ce8=_['last'](this[_0xc242('0xf')][_0x4cbfa4[_0xc242('0x54')]]);_0x980ce8[_0xc242('0x87')]=!![];_0x980ce8[_0xc242('0x55')]='COMPLETEDBYAGENT';logger[_0xc242('0x72')](_0xc242('0x94'),_0x980ce8[_0xc242('0x50')],_0x980ce8[_0xc242('0x59')]);}}}catch(_0x4840e){logger[_0xc242('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x4cbfa4[_0xc242('0x54')],util[_0xc242('0x43')](_0x4840e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')]['syncAgentComplete']=function(_0x528df2){try{if(this[_0xc242('0x6f')](_0x528df2)){logger['debug'](_0xc242('0x95'),_0x528df2[_0xc242('0x54')],util['inspect'](_0x528df2,{'showHidden':![],'depth':null}));if(this[_0xc242('0xf')][_0x528df2[_0xc242('0x54')]]){var _0x21d209=_[_0xc242('0x86')](this[_0xc242('0xf')][_0x528df2[_0xc242('0x54')]]);_0x21d209[_0xc242('0x1c')]=![];_0x21d209[_0xc242('0x96')]=null;_0x21d209['assigned']=!![];_0x21d209['lastAssignedTo']=_0x528df2[_0xc242('0x97')];_0x21d209[_0xc242('0x89')]=_0x528df2[_0xc242('0x89')];_0x21d209[_0xc242('0x87')]=!![];_0x21d209[_0xc242('0x98')]=![];_0x21d209[_0xc242('0x99')]=null;if(!_0x21d209[_0xc242('0x9a')]){if(_0x528df2[_0xc242('0x9b')]==_0xc242('0x9a')){_0x21d209[_0xc242('0x55')]=_0xc242('0x9c');logger['info'](_0xc242('0x9d'),_0x21d209[_0xc242('0x50')],_0x21d209[_0xc242('0x59')]);}else{if(_[_0xc242('0x9e')](_0x528df2[_0xc242('0x3e')][_0xc242('0x9f')](),_0xc242('0xa0'))){if(this[_0xc242('0xf')][_0x528df2[_0xc242('0xa1')]]){var _0x5d8d84=_[_0xc242('0x86')](this['queueReports'][_0x528df2[_0xc242('0xa1')]]);_0x5d8d84[_0xc242('0x87')]=![];_0x5d8d84[_0xc242('0x98')]=!![];_0x5d8d84[_0xc242('0x99')]=moment(_0x21d209['queuecallerjoinAt'])[_0xc242('0xa2')](_0x528df2[_0xc242('0x89')],_0xc242('0xa3'))[_0xc242('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d8d84[_0xc242('0x55')]=_0xc242('0xa4');_0x5d8d84[_0xc242('0x9a')]=!![];_0x5d8d84[_0xc242('0xa5')]=_0xc242('0xa6');_0x5d8d84[_0xc242('0xa7')]=_0x528df2[_0xc242('0xa8')];_0x5d8d84[_0xc242('0xa9')]=_0x528df2[_0xc242('0x54')];logger[_0xc242('0x72')](_0xc242('0xaa'),_0x5d8d84[_0xc242('0x50')],_0x5d8d84[_0xc242('0x59')]);var _0x4c5549=this['queueReports'][_0x528df2[_0xc242('0xa1')]];this['queueReports'][_0x528df2[_0xc242('0xa1')]]=this[_0xc242('0xf')][_0x528df2['uniqueid']];this[_0xc242('0xf')][_0x528df2[_0xc242('0x54')]]=_0x4c5549;}}else{_0x21d209['queuecallerexitreason']=_0xc242('0xab')+_0x528df2[_0xc242('0x9b')]['toUpperCase']();logger[_0xc242('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x21d209['name'],_0x21d209[_0xc242('0x59')],_0x21d209[_0xc242('0x55')]);}}}this['channels'][_0x528df2[_0xc242('0x54')]]=_0x21d209;this['emitVoiceQueueChannelRemove'](_0x21d209,_0xc242('0x1f'));}}}catch(_0x463dc9){logger[_0xc242('0x41')](_0xc242('0x95'),_0x528df2[_0xc242('0x54')],util[_0xc242('0x43')](_0x463dc9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')]['syncVarSet']=function(_0x84a324){try{if(this[_0xc242('0x6f')](_0x84a324)){logger[_0xc242('0x4b')]('[%s][voiceQueueReport][varset]',_0x84a324[_0xc242('0x54')],util[_0xc242('0x43')](_0x84a324,{'showHidden':![],'depth':null}));this[_0xc242('0xac')](_0x84a324['uniqueid'],_[_0xc242('0x82')](_0x84a324[_0xc242('0xad')])[0x0],_0x84a324[_0xc242('0xae')]);if(this['queueReports'][_0x84a324['uniqueid']]){var _0x1803da=_[_0xc242('0x86')](this[_0xc242('0xf')][_0x84a324[_0xc242('0x54')]]);if(_0x1803da){if(this[_0xc242('0x6f')](_0x84a324['variable'])&&this[_0xc242('0x6f')](_0x84a324['variable'][_0xc242('0xaf')])){switch(_0x84a324[_0xc242('0xae')]){case'CONTINUE':_0x1803da[_0xc242('0x98')]=![];_0x1803da[_0xc242('0x99')]=null;break;case _0xc242('0xb0'):_0x1803da[_0xc242('0xb1')]=_0xc242('0xb2');_0x1803da['queuecallerexit']=!![];_0x1803da[_0xc242('0x99')]=moment()[_0xc242('0x4e')](_0xc242('0x7d'));_0x1803da[_0xc242('0x8f')]=moment()[_0xc242('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xc242('0x4b')](_0xc242('0xb3'),_0x84a324[_0xc242('0x54')],util[_0xc242('0x43')](_0x1803da,{'showHidden':![],'depth':null}));ami['emit'](_0xc242('0xb4'),_0x1803da);break;default:_0x1803da[_0xc242('0x98')]=!![];_0x1803da[_0xc242('0x99')]=moment()['format'](_0xc242('0x7d'));_0x1803da['queuecallerleaveAt']=moment()[_0xc242('0x4e')](_0xc242('0x7d'));}_0x1803da[_0xc242('0x1c')]=![];_0x1803da[_0xc242('0x96')]=null;_0x1803da['queuecallerexitreason']=_0x84a324[_0xc242('0xae')];this[_0xc242('0x10')][_0x84a324[_0xc242('0x54')]]=_0x1803da;this[_0xc242('0x47')](_0x1803da,'varset');}else if(this[_0xc242('0x6f')](_0x84a324[_0xc242('0xad')])&&this[_0xc242('0x6f')](_0x84a324[_0xc242('0xad')]['queueposition'])){if(!_0x1803da[_0xc242('0x1c')]){_0x1803da[_0xc242('0x98')]=!![];_0x1803da['queuecallerexitAt']=moment()[_0xc242('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1803da[_0xc242('0x55')]=_0xc242('0xb5');_0x1803da[_0xc242('0x8f')]=moment()['format'](_0xc242('0x7d'));this[_0xc242('0x10')][_0x84a324['uniqueid']]=_0x1803da;}}logger[_0xc242('0x72')](_0xc242('0xb6'),_0x84a324['uniqueid'],_0x1803da[_0xc242('0x50')],_0x1803da['type'],_['keys'](_0x84a324[_0xc242('0xad')])[0x0],_0x84a324[_0xc242('0xae')]);_0x1803da['variables']=this[_0xc242('0x15')][_0x84a324['uniqueid']];}}}}catch(_0x23e01d){logger['error'](_0xc242('0xb7'),_0x84a324[_0xc242('0x54')],util[_0xc242('0x43')](_0x23e01d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc242('0xd')][_0xc242('0xac')]=function(_0x208338,_0x38c1ee,_0x39a62e){var _0x190f3d=['rtpaudioqos',_0xc242('0xb8'),_0xc242('0xb9'),_0xc242('0xba'),_0xc242('0xbb'),_0xc242('0xbc'),_0xc242('0xbd'),_0xc242('0xbe'),_0xc242('0xbf'),_0xc242('0xc0'),_0xc242('0xc1'),_0xc242('0xc2'),_0xc242('0xc3'),_0xc242('0xc4'),_0xc242('0xc5'),_0xc242('0xc6'),'membername',_0xc242('0xc7'),_0xc242('0xc8')];if(!_['isNil'](_0x38c1ee)&&!_['includes'](_0x190f3d,_0x38c1ee)){if(_['isUndefined'](this[_0xc242('0x15')][_0x208338])){this[_0xc242('0x15')][_0x208338]={};}this[_0xc242('0x15')][_0x208338][_0x38c1ee]=_0x39a62e;}};VoiceQueueReport['prototype'][_0xc242('0xc9')]=function(_0x31935e,_0x5458d6,_0x5c19da){var _0x40891b={};for(var _0x12a680=0x0;_0x12a6800x0?_0x48738c:0x0;this[_0xf855('0x10')][_0x2bb8d3[_0xf855('0x67')]][_0xf855('0x2d')]=this[_0xf855('0x10')][_0x2bb8d3[_0xf855('0x67')]][_0xf855('0x2d')]>_[_0xf855('0x6a')](_0x2bb8d3[_0xf855('0x6c')])?_[_0xf855('0x6a')](_0x2bb8d3[_0xf855('0x6c')]):this[_0xf855('0x10')][_0x2bb8d3[_0xf855('0x67')]][_0xf855('0x2d')];this[_0xf855('0x52')](this['voiceQueues'][_0x2bb8d3[_0xf855('0x67')]],_0xf855('0x14'));}logger['debug'](_0xf855('0x6e'),util[_0xf855('0x3b')](this[_0xf855('0x10')][_0x2bb8d3[_0xf855('0x67')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf855('0x6f'),this[_0xf855('0x10')][_0x2bb8d3[_0xf855('0x67')]]);}}}catch(_0x4da8f0){logger[_0xf855('0x3c')](_0xf855('0x65'),util[_0xf855('0x3b')](_0x4da8f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf855('0x8')][_0xf855('0x17')]=function(_0x31214f){logger[_0xf855('0x46')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x31214f,{'showHidden':![],'depth':null}));ami[_0xf855('0x44')](_0xf855('0x70'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0xf855('0x8')]['syncQueueCallerJoin']=function(_0x256e76){try{if(this[_0xf855('0x60')](_0x256e76)){logger[_0xf855('0x46')](_0xf855('0x71'),_0x256e76['uniqueid'],util[_0xf855('0x3b')](_0x256e76,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xf855('0xc')][_0x256e76[_0xf855('0x49')]]))this[_0xf855('0xc')][_0x256e76[_0xf855('0x49')]]=[];if(_[_0xf855('0x72')](this[_0xf855('0xe')][_0x256e76[_0xf855('0x49')]]))this['channels'][_0x256e76[_0xf855('0x49')]]={};var _0x3d9512=new QueueReport();_0x3d9512['name']=_0x256e76[_0xf855('0x67')];_0x3d9512[_0xf855('0x53')]=this[_0xf855('0x10')][_0x3d9512['name']]&&this['voiceQueues'][_0x3d9512[_0xf855('0x4c')]][_0xf855('0x53')]?this[_0xf855('0x10')][_0x3d9512[_0xf855('0x4c')]]['type']||_0xf855('0x73'):_0xf855('0x73');_0x3d9512[_0xf855('0x67')]=_0x256e76[_0xf855('0x67')];_0x3d9512[_0xf855('0x74')]=moment()[_0xf855('0x4a')](_0xf855('0x75'));_0x3d9512[_0xf855('0x76')]=_0x256e76[_0xf855('0x76')];_0x3d9512['count']=_0x256e76[_0xf855('0x77')];_0x3d9512[_0xf855('0x49')]=_0x256e76['uniqueid'];_0x3d9512['routealias']=this[_0xf855('0xe')][_0x256e76[_0xf855('0x49')]][_0xf855('0x78')];logger[_0xf855('0x79')](_0xf855('0x7a'),_0x3d9512[_0xf855('0x4c')],_0x3d9512[_0xf855('0x53')]);_[_0xf855('0x7b')](_0x3d9512,_[_0xf855('0x7c')](_0x256e76,_['keys'](_0x3d9512)));this[_0xf855('0xc')][_0x256e76[_0xf855('0x49')]]['push'](_0x3d9512);this[_0xf855('0xe')][_0x256e76[_0xf855('0x49')]]=_0x3d9512;this[_0xf855('0x45')](_0x3d9512,_0xf855('0x18'));}}catch(_0x4cbdf6){logger[_0xf855('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x256e76[_0xf855('0x49')],util['inspect'](_0x4cbdf6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf855('0x8')][_0xf855('0x7d')]=function(_0x29f143){try{if(this[_0xf855('0x60')](_0x29f143)){logger[_0xf855('0x46')](_0xf855('0x7e'),_0x29f143[_0xf855('0x49')],util[_0xf855('0x3b')](_0x29f143,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29f143[_0xf855('0x49')]]){var _0x71ff85=_['last'](this[_0xf855('0xc')][_0x29f143['uniqueid']]);_0x71ff85[_0xf855('0x7f')]=![];_0x71ff85['queuecallercompleteAt']=null;_0x71ff85[_0xf855('0x80')]=_0x29f143[_0xf855('0x80')];_0x71ff85[_0xf855('0x81')]=_0x29f143[_0xf855('0x81')];_0x71ff85[_0xf855('0x1a')]=!![];_0x71ff85[_0xf855('0x82')]=moment()[_0xf855('0x4a')](_0xf855('0x75'));_0x71ff85['queuecallerexitreason']=_0xf855('0x83');_0x71ff85['lastAssignedTo']=null;logger[_0xf855('0x79')](_0xf855('0x84'),_0x71ff85[_0xf855('0x4c')],_0x71ff85[_0xf855('0x53')]);this[_0xf855('0xe')][_0x29f143['uniqueid']]=_0x71ff85;this['emitVoiceQueueChannelRemove'](_0x71ff85,_0xf855('0x1a'));}}}catch(_0x4200d2){logger['error'](_0xf855('0x7e'),_0x29f143[_0xf855('0x49')],util['inspect'](_0x4200d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf855('0x8')][_0xf855('0x1c')]=function(_0x5d29fb){try{if(this[_0xf855('0x60')](_0x5d29fb)){logger['debug'](_0xf855('0x85'),_0x5d29fb['uniqueid'],util[_0xf855('0x3b')](_0x5d29fb,{'showHidden':![],'depth':null}));if(this[_0xf855('0xc')][_0x5d29fb[_0xf855('0x49')]]){var _0x5de96e=_[_0xf855('0x86')](this['queueReports'][_0x5d29fb[_0xf855('0x49')]]);_0x5de96e[_0xf855('0x87')]=moment()[_0xf855('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5de96e[_0xf855('0x88')]=_0x5d29fb[_0xf855('0x88')];_0x5de96e['connectedlinename']=_0x5d29fb[_0xf855('0x89')];logger[_0xf855('0x79')](_0xf855('0x8a'),_0x5de96e['name'],_0x5de96e[_0xf855('0x53')],_0x5d29fb[_0xf855('0x88')],_0x5d29fb[_0xf855('0x89')]);this[_0xf855('0xe')][_0x5d29fb['uniqueid']]=_0x5de96e;this[_0xf855('0x45')](_0x5de96e,_0xf855('0x1b'));}}}catch(_0x594ca5){logger['error'](_0xf855('0x85'),_0x5d29fb[_0xf855('0x49')],util[_0xf855('0x3b')](_0x594ca5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf855('0x8')][_0xf855('0x1f')]=function(_0x1f11e0){try{if(this[_0xf855('0x60')](_0x1f11e0)){logger[_0xf855('0x46')](_0xf855('0x8b'),_0x1f11e0['uniqueid'],util[_0xf855('0x3b')](_0x1f11e0,{'showHidden':![],'depth':null}));if(this[_0xf855('0xc')][_0x1f11e0['uniqueid']]){var _0x508486=_[_0xf855('0x86')](this['queueReports'][_0x1f11e0[_0xf855('0x49')]]);_0x508486[_0xf855('0x7f')]=!![];_0x508486[_0xf855('0x4f')]='COMPLETEDBYAGENT';logger[_0xf855('0x79')](_0xf855('0x8c'),_0x508486['name'],_0x508486[_0xf855('0x53')]);}}}catch(_0x3aa7bc){logger[_0xf855('0x3c')](_0xf855('0x8b'),_0x1f11e0[_0xf855('0x49')],util['inspect'](_0x3aa7bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf855('0x8')][_0xf855('0x8d')]=function(_0x258e56){try{if(this['isNotNull'](_0x258e56)){logger[_0xf855('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x258e56[_0xf855('0x49')],util['inspect'](_0x258e56,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x258e56[_0xf855('0x49')]]){var _0xc3f90=_['last'](this[_0xf855('0xc')][_0x258e56[_0xf855('0x49')]]);_0xc3f90[_0xf855('0x1a')]=![];_0xc3f90[_0xf855('0x82')]=null;_0xc3f90[_0xf855('0x8e')]=!![];_0xc3f90[_0xf855('0x8f')]=_0x258e56['membername'];_0xc3f90[_0xf855('0x80')]=_0x258e56[_0xf855('0x80')];_0xc3f90[_0xf855('0x7f')]=!![];_0xc3f90['queuecallerexit']=![];_0xc3f90[_0xf855('0x90')]=null;if(!_0xc3f90[_0xf855('0x91')]){if(_0x258e56[_0xf855('0x92')]==_0xf855('0x91')){_0xc3f90[_0xf855('0x4f')]=_0xf855('0x93');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xc3f90['name'],_0xc3f90['type']);}else{if(_[_0xf855('0x94')](_0x258e56[_0xf855('0x36')][_0xf855('0x95')](),_0xf855('0x96'))){if(this[_0xf855('0xc')][_0x258e56['linkedid']]){var _0x4821a4=_['last'](this['queueReports'][_0x258e56['linkedid']]);_0x4821a4[_0xf855('0x7f')]=![];_0x4821a4[_0xf855('0x97')]=!![];_0x4821a4[_0xf855('0x90')]=moment(_0xc3f90[_0xf855('0x74')])[_0xf855('0x98')](_0x258e56[_0xf855('0x80')],_0xf855('0x99'))[_0xf855('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4821a4['queuecallerexitreason']=_0xf855('0x9a');_0x4821a4[_0xf855('0x91')]=!![];_0x4821a4['transfertype']='FORWARD';_0x4821a4['transferexten']=_0x258e56[_0xf855('0x9b')];_0x4821a4[_0xf855('0x9c')]=_0x258e56['uniqueid'];logger['info'](_0xf855('0x9d'),_0x4821a4[_0xf855('0x4c')],_0x4821a4[_0xf855('0x53')]);var _0x204446=this[_0xf855('0xc')][_0x258e56[_0xf855('0x9e')]];this[_0xf855('0xc')][_0x258e56['linkedid']]=this['queueReports'][_0x258e56[_0xf855('0x49')]];this[_0xf855('0xc')][_0x258e56[_0xf855('0x49')]]=_0x204446;}}else{_0xc3f90[_0xf855('0x4f')]=_0xf855('0x9f')+_0x258e56[_0xf855('0x92')][_0xf855('0xa0')]();logger[_0xf855('0x79')](_0xf855('0xa1'),_0xc3f90[_0xf855('0x4c')],_0xc3f90['type'],_0xc3f90[_0xf855('0x4f')]);}}}this[_0xf855('0xe')][_0x258e56[_0xf855('0x49')]]=_0xc3f90;this[_0xf855('0x42')](_0xc3f90,'agentcomplete');}}}catch(_0x3c1cf0){logger[_0xf855('0x3c')](_0xf855('0xa2'),_0x258e56['uniqueid'],util[_0xf855('0x3b')](_0x3c1cf0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0xcf83b8){try{if(this[_0xf855('0x60')](_0xcf83b8)){logger['debug']('[%s][voiceQueueReport][varset]',_0xcf83b8[_0xf855('0x49')],util['inspect'](_0xcf83b8,{'showHidden':![],'depth':null}));this[_0xf855('0xa3')](_0xcf83b8[_0xf855('0x49')],_[_0xf855('0xa4')](_0xcf83b8[_0xf855('0xa5')])[0x0],_0xcf83b8[_0xf855('0xa6')]);if(this[_0xf855('0xc')][_0xcf83b8['uniqueid']]){var _0x1117e5=_[_0xf855('0x86')](this[_0xf855('0xc')][_0xcf83b8[_0xf855('0x49')]]);if(_0x1117e5){if(this[_0xf855('0x60')](_0xcf83b8[_0xf855('0xa5')])&&this[_0xf855('0x60')](_0xcf83b8[_0xf855('0xa5')][_0xf855('0xa7')])){switch(_0xcf83b8['value']){case'CONTINUE':_0x1117e5[_0xf855('0x97')]=![];_0x1117e5[_0xf855('0x90')]=null;break;case _0xf855('0xa8'):_0x1117e5[_0xf855('0xa9')]=_0xf855('0xaa');_0x1117e5['queuecallerexit']=!![];_0x1117e5[_0xf855('0x90')]=moment()[_0xf855('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1117e5[_0xf855('0x87')]=moment()[_0xf855('0x4a')](_0xf855('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xcf83b8['uniqueid'],util[_0xf855('0x3b')](_0x1117e5,{'showHidden':![],'depth':null}));ami[_0xf855('0x44')]('custom:timeout',_0x1117e5);break;default:_0x1117e5[_0xf855('0x97')]=!![];_0x1117e5[_0xf855('0x90')]=moment()[_0xf855('0x4a')](_0xf855('0x75'));_0x1117e5[_0xf855('0x87')]=moment()['format'](_0xf855('0x75'));}_0x1117e5[_0xf855('0x1a')]=![];_0x1117e5[_0xf855('0x82')]=null;_0x1117e5[_0xf855('0x4f')]=_0xcf83b8['value'];this[_0xf855('0xe')][_0xcf83b8['uniqueid']]=_0x1117e5;this[_0xf855('0x42')](_0x1117e5,_0xf855('0x20'));}else if(this[_0xf855('0x60')](_0xcf83b8[_0xf855('0xa5')])&&this[_0xf855('0x60')](_0xcf83b8[_0xf855('0xa5')]['queueposition'])){if(!_0x1117e5[_0xf855('0x1a')]){_0x1117e5[_0xf855('0x97')]=!![];_0x1117e5[_0xf855('0x90')]=moment()['format'](_0xf855('0x75'));_0x1117e5[_0xf855('0x4f')]=_0xf855('0xab');_0x1117e5[_0xf855('0x87')]=moment()[_0xf855('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf855('0xe')][_0xcf83b8[_0xf855('0x49')]]=_0x1117e5;}}logger[_0xf855('0x79')](_0xf855('0xac'),_0xcf83b8[_0xf855('0x49')],_0x1117e5['name'],_0x1117e5['type'],_[_0xf855('0xa4')](_0xcf83b8[_0xf855('0xa5')])[0x0],_0xcf83b8[_0xf855('0xa6')]);_0x1117e5[_0xf855('0x13')]=this[_0xf855('0x13')][_0xcf83b8[_0xf855('0x49')]];}}}}catch(_0x3e7489){logger[_0xf855('0x3c')](_0xf855('0xad'),_0xcf83b8[_0xf855('0x49')],util[_0xf855('0x3b')](_0x3e7489,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf855('0xa3')]=function(_0x72c445,_0x5be925,_0x174b21){var _0x4ddda2=[_0xf855('0xae'),_0xf855('0xaf'),_0xf855('0xb0'),_0xf855('0xb1'),_0xf855('0xb2'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0xf855('0xb3'),'bridgepeer',_0xf855('0xb4'),_0xf855('0xb5'),_0xf855('0xb6'),_0xf855('0xb7'),_0xf855('0xb8'),'membername','memberpenalty',_0xf855('0xb9')];if(!_['isNil'](_0x5be925)&&!_['includes'](_0x4ddda2,_0x5be925)){if(_[_0xf855('0x72')](this[_0xf855('0x13')][_0x72c445])){this[_0xf855('0x13')][_0x72c445]={};}this[_0xf855('0x13')][_0x72c445][_0x5be925]=_0x174b21;}};VoiceQueueReport['prototype'][_0xf855('0xba')]=function(_0xbd9c48,_0x302425,_0x37ce55){var _0x295432={};for(var _0x148032=0x0;_0x148032=0x0?moment(_0x58dd88[_0x912a('0x19')])['diff'](_0x58dd88[_0x912a('0x18')],_0x912a('0xf')):null,'data1':_0x912a('0x1a'),'data2':_0x58dd88[_0x912a('0x13')],'data3':_0x58dd88[_0x912a('0x1b')],'data4':_0x58dd88[_0x912a('0x1c')]||null,'role':'agent','internal':_0x58dd88[_0x912a('0x13')]?_[_0x912a('0x1d')](_0x58dd88[_0x912a('0x13')]):undefined,'uniqueid':_0x58dd88[_0x912a('0x14')]},'log':_0x912a('0x5')});}; \ No newline at end of file +var _0x7758=['seconds','inbound','queue','toNumber','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','exten','dialstring','agent','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','TALKING','queuecallerleaveAt','diff'];(function(_0x283dd1,_0x47dcb7){var _0x2601ec=function(_0x2f8475){while(--_0x2f8475){_0x283dd1['push'](_0x283dd1['shift']());}};_0x2601ec(++_0x47dcb7);}(_0x7758,0x186));var _0x8775=function(_0x596835,_0x3cc17f){_0x596835=_0x596835-0x0;var _0x44c2c9=_0x7758[_0x596835];return _0x44c2c9;};'use strict';var moment=require(_0x8775('0x0'));var _=require(_0x8775('0x1'));var util=require(_0x8775('0x2'));var client=require(_0x8775('0x3'));exports[_0x8775('0x4')]=function(_0x2557ae){var _0x5a98a7=_0x2557ae[_0x8775('0x5')]||_0x2557ae[_0x8775('0x6')];return client[_0x8775('0x7')](_0x8775('0x8'),{'body':{'channel':_0x8775('0x9'),'membername':_0x2557ae[_0x8775('0xa')],'interface':_['isNil'](_0x2557ae[_0x8775('0xb')])?util[_0x8775('0xc')]('SIP/%s',_0x2557ae['lastAssignedTo']):_0x2557ae[_0x8775('0xb')],'type':_0x8775('0xd'),'enterAt':_0x2557ae[_0x8775('0xe')],'exitAt':_0x5a98a7,'duration':moment(_0x5a98a7)[_0x8775('0xf')](_0x2557ae[_0x8775('0xe')],_0x8775('0x10')),'data1':_0x8775('0x11'),'data2':_0x2557ae['calleridnum'],'data3':_0x2557ae['exten'],'data4':null,'data5':_0x2557ae[_0x8775('0x12')],'role':'agent','internal':_0x2557ae['accountcode']?_[_0x8775('0x13')](_0x2557ae[_0x8775('0x14')]):undefined,'uniqueid':_0x2557ae[_0x8775('0x15')]},'log':_0x8775('0x8')});};exports[_0x8775('0x16')]=function(_0x40d95e){return client[_0x8775('0x7')]('CreateMemberReport',{'body':{'channel':_0x8775('0x9'),'membername':_0x40d95e[_0x8775('0x17')],'interface':_0x40d95e[_0x8775('0xb')],'type':'TALKING','enterAt':_0x40d95e[_0x8775('0x18')],'exitAt':_0x40d95e['endtime'],'duration':moment(_0x40d95e[_0x8775('0x19')])[_0x8775('0xf')](_0x40d95e[_0x8775('0x18')],_0x8775('0x10'))>=0x0?moment(_0x40d95e[_0x8775('0x19')])[_0x8775('0xf')](_0x40d95e['starttime'],_0x8775('0x10')):null,'data1':'outbound','data2':_0x40d95e[_0x8775('0x14')],'data3':_0x40d95e[_0x8775('0x1a')],'data4':_0x40d95e[_0x8775('0x1b')]||null,'role':_0x8775('0x1c'),'internal':_0x40d95e[_0x8775('0x14')]?_[_0x8775('0x13')](_0x40d95e['accountcode']):undefined,'uniqueid':_0x40d95e['uniqueid']},'log':_0x8775('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index bee37d4..046d4c7 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 _0x2f8b=['../client','getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x12393e,_0x46da90){var _0x1dceb4=function(_0x31620d){while(--_0x31620d){_0x12393e['push'](_0x12393e['shift']());}};_0x1dceb4(++_0x46da90);}(_0x2f8b,0x96));var _0xb2f8=function(_0x327efe,_0x188932){_0x327efe=_0x327efe-0x0;var _0x333185=_0x2f8b[_0x327efe];return _0x333185;};'use strict';var client=require(_0xb2f8('0x0'));exports[_0xb2f8('0x1')]=function(){return client['Request'](_0xb2f8('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb2f8('0x3'),_0xb2f8('0x4')]},'log':_0xb2f8('0x5')});}; \ No newline at end of file +var _0x5e30=['Request','ShowSetting','stopRecordingOnTransfer','../client','getSettings'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5e30,0x7b));var _0x05e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e30[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x05e3('0x0'));exports[_0x05e3('0x1')]=function(){return client[_0x05e3('0x2')](_0x05e3('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x05e3('0x4'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 84002b1..f1262fe 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 _0xd868=['getTemplates','Request','GetTemplate','name'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xd868,0x164));var _0x8d86=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xd868[_0x28d18d];return _0x470640;};'use strict';var client=require('../client');exports[_0x8d86('0x0')]=function(_0x53cbdc){return function(_0x1bc943){return client[_0x8d86('0x1')](_0x8d86('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8d86('0x3'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x9a6b=['name','html','Request','GetTemplate'];(function(_0x35a208,_0x4ec676){var _0x2efd1e=function(_0x44d130){while(--_0x44d130){_0x35a208['push'](_0x35a208['shift']());}};_0x2efd1e(++_0x4ec676);}(_0x9a6b,0x13e));var _0xb9a6=function(_0x1336fb,_0x1bdb89){_0x1336fb=_0x1336fb-0x0;var _0x54acf8=_0x9a6b[_0x1336fb];return _0x54acf8;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x58e42d){return function(_0x5c3a64){return client[_0xb9a6('0x0')](_0xb9a6('0x1'),{'options':{'raw':!![],'attributes':['id',_0xb9a6('0x2'),_0xb9a6('0x3')]},'log':_0xb9a6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 32e6800..c302a39 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 _0x47ef=['data5','GetTrigger','name','status','Condition','AllConditions','field','operator','value','Actions','action','data1','data3','data4'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x47ef,0x8d));var _0xf47e=function(_0xb64f84,_0x2e09a8){_0xb64f84=_0xb64f84-0x0;var _0x2d50e4=_0x47ef[_0xb64f84];return _0x2d50e4;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x57e1ba){return function(_0x365a9d){return client['Request'](_0xf47e('0x0'),{'options':{'raw':![],'attributes':['id',_0xf47e('0x1'),'channel',_0xf47e('0x2')],'include':[{'model':_0xf47e('0x3'),'as':_0xf47e('0x4'),'attributes':['id',_0xf47e('0x5'),_0xf47e('0x6'),_0xf47e('0x7')]},{'model':_0xf47e('0x3'),'as':'AnyConditions','attributes':['id',_0xf47e('0x5'),_0xf47e('0x6'),_0xf47e('0x7')]},{'model':'Action','as':_0xf47e('0x8'),'attributes':['id',_0xf47e('0x9'),_0xf47e('0xa'),'data2',_0xf47e('0xb'),_0xf47e('0xc'),_0xf47e('0xd'),'data6','data7']}]},'log':_0xf47e('0x0')});};}; \ No newline at end of file +var _0x00af=['data6','../client','Request','GetTrigger','name','field','operator','value','Condition','AnyConditions','Action','data1','data2','data3','data5'];(function(_0xd1b4df,_0x118a9a){var _0x24b551=function(_0x438cfc){while(--_0x438cfc){_0xd1b4df['push'](_0xd1b4df['shift']());}};_0x24b551(++_0x118a9a);}(_0x00af,0xd3));var _0xf00a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00af[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf00a('0x0'));exports['getTriggers']=function(_0x38b21f){return function(_0x501005){return client[_0xf00a('0x1')](_0xf00a('0x2'),{'options':{'raw':![],'attributes':['id',_0xf00a('0x3'),'channel','status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xf00a('0x4'),_0xf00a('0x5'),_0xf00a('0x6')]},{'model':_0xf00a('0x7'),'as':_0xf00a('0x8'),'attributes':['id',_0xf00a('0x4'),_0xf00a('0x5'),_0xf00a('0x6')]},{'model':_0xf00a('0x9'),'as':'Actions','attributes':['id','action',_0xf00a('0xa'),_0xf00a('0xb'),_0xf00a('0xc'),'data4',_0xf00a('0xd'),_0xf00a('0xe'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c79668e..5a57d6a 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 _0xabe8=['../client','getTrunks','Request','GetTrunk','registry'];(function(_0x8636e3,_0x4d2709){var _0x37a7bf=function(_0x17b17e){while(--_0x17b17e){_0x8636e3['push'](_0x8636e3['shift']());}};_0x37a7bf(++_0x4d2709);}(_0xabe8,0x8c));var _0x8abe=function(_0x2bec83,_0x5089f2){_0x2bec83=_0x2bec83-0x0;var _0xc846b7=_0xabe8[_0x2bec83];return _0xc846b7;};'use strict';var client=require(_0x8abe('0x0'));exports[_0x8abe('0x1')]=function(_0x4705ea){return function(_0x50de9b){return client[_0x8abe('0x2')](_0x8abe('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x8abe('0x4'),'defaultuser']},'log':_0x8abe('0x3')});};}; \ No newline at end of file +var _0xd285=['getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x3cecd4,_0xb0bcf6){var _0x3d3577=function(_0x10a3fe){while(--_0x10a3fe){_0x3cecd4['push'](_0x3cecd4['shift']());}};_0x3d3577(++_0xb0bcf6);}(_0xd285,0x132));var _0x5d28=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xd285[_0xc4001c];return _0x49f7bc;};'use strict';var client=require('../client');exports[_0x5d28('0x0')]=function(_0x21f23a){return function(_0x4daa44){return client[_0x5d28('0x1')](_0x5d28('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5d28('0x3'),_0x5d28('0x4'),_0x5d28('0x5')]},'log':_0x5d28('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 8c15be5..c866d8a 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x11816c,_0x136fde){var _0x5f27d0=function(_0x151022){while(--_0x151022){_0x11816c['push'](_0x11816c['shift']());}};_0x5f27d0(++_0x136fde);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0xcb91[_0x10c16d];return _0x5896f4;};'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 +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x3c7979,_0x2399d9){var _0x24cb24=function(_0x53d5b9){while(--_0x53d5b9){_0x3c7979['push'](_0x3c7979['shift']());}};_0x24cb24(++_0x2399d9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3631306..dbb1799 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 _0x1482=['update','../client','Request','CreateVoiceAgentReport'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0x1482,0x18d));var _0x2148=function(_0x253b52,_0x43fa36){_0x253b52=_0x253b52-0x0;var _0x371cfb=_0x1482[_0x253b52];return _0x371cfb;};'use strict';var client=require(_0x2148('0x0'));exports['create']=function(_0x2ab230){return client[_0x2148('0x1')](_0x2148('0x2'),{'body':_0x2ab230,'log':_0x2148('0x2')});};exports[_0x2148('0x3')]=function(_0x1e2485,_0xc33a1,_0x43c054){return client[_0x2148('0x1')]('UpdateVoiceAgentReport',{'body':_0x1e2485,'options':{'where':{'uniqueid':_0xc33a1,'interface':_0x43c054,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x8401=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0xc9bc0f,_0x12e2ac){var _0x4aacbc=function(_0x518b76){while(--_0x518b76){_0xc9bc0f['push'](_0xc9bc0f['shift']());}};_0x4aacbc(++_0x12e2ac);}(_0x8401,0x1b9));var _0x1840=function(_0x167e10,_0x13a03d){_0x167e10=_0x167e10-0x0;var _0xcd67a3=_0x8401[_0x167e10];return _0xcd67a3;};'use strict';var client=require(_0x1840('0x0'));exports[_0x1840('0x1')]=function(_0x4806fe){return client[_0x1840('0x2')](_0x1840('0x3'),{'body':_0x4806fe,'log':_0x1840('0x3')});};exports[_0x1840('0x4')]=function(_0x33cb90,_0x4f6789,_0x2a7afa){return client[_0x1840('0x2')](_0x1840('0x5'),{'body':_0x33cb90,'options':{'where':{'uniqueid':_0x4f6789,'interface':_0x2a7afa,'agentcomplete':!![]}},'log':_0x1840('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b2bb875..b589fe6 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 _0x461e=['startOf','day','format','duration','billableseconds','GetVoiceCallReports','moment','lodash','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x1b9ccd,_0x421ed4){var _0x56e80c=function(_0x23c1fc){while(--_0x23c1fc){_0x1b9ccd['push'](_0x1b9ccd['shift']());}};_0x56e80c(++_0x421ed4);}(_0x461e,0x8e));var _0xe461=function(_0x2e964d,_0x46851d){_0x2e964d=_0x2e964d-0x0;var _0x3a02c0=_0x461e[_0x2e964d];return _0x3a02c0;};'use strict';var moment=require(_0xe461('0x0'));var util=require('util');var _=require(_0xe461('0x1'));var client=require('../client');exports['create']=function(_0xf56d52){return client[_0xe461('0x2')](_0xe461('0x3'),{'body':_['merge'](_0xf56d52,{'source':_0xf56d52[_0xe461('0x4')],'destinationcontext':_0xf56d52[_0xe461('0x5')],'callerid':_0xf56d52[_0xe461('0x6')],'amaflags':_0xe461('0x7')}),'log':'CreateVoiceCallReport'});};exports[_0xe461('0x8')]=function(){return function(){return client[_0xe461('0x2')](_0xe461('0x9'),{'options':{'where':{'type':[_0xe461('0xa')],'createdAt':{'$between':[moment()[_0xe461('0xb')](_0xe461('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xe461('0xc'))[_0xe461('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xe461('0xe'),_0xe461('0xf')]},'log':_0xe461('0x10')});};}; \ No newline at end of file +var _0x9cc0=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','duration','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9cc0,0x1bb));var _0x09cc=function(_0x1e1fe9,_0x216dd9){_0x1e1fe9=_0x1e1fe9-0x0;var _0x4eeb06=_0x9cc0[_0x1e1fe9];return _0x4eeb06;};'use strict';var moment=require(_0x09cc('0x0'));var util=require('util');var _=require(_0x09cc('0x1'));var client=require(_0x09cc('0x2'));exports[_0x09cc('0x3')]=function(_0x227efc){return client[_0x09cc('0x4')](_0x09cc('0x5'),{'body':_['merge'](_0x227efc,{'source':_0x227efc[_0x09cc('0x6')],'destinationcontext':_0x227efc['context'],'callerid':_0x227efc[_0x09cc('0x7')],'amaflags':_0x09cc('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x09cc('0x9')]=function(){return function(){return client['Request'](_0x09cc('0xa'),{'options':{'where':{'type':[_0x09cc('0xb')],'createdAt':{'$between':[moment()[_0x09cc('0xc')](_0x09cc('0xd'))[_0x09cc('0xe')](_0x09cc('0xf')),moment()[_0x09cc('0x10')](_0x09cc('0xd'))[_0x09cc('0xe')](_0x09cc('0xf'))]}},'attributes':['type','disposition',_0x09cc('0x11'),'billableseconds']},'log':_0x09cc('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 7e0c812..ad5a6f3 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 _0x5c66=['create','Request','CreateVoiceDialReport','../client'];(function(_0x28c8bb,_0x10aae5){var _0x166c09=function(_0x50f660){while(--_0x50f660){_0x28c8bb['push'](_0x28c8bb['shift']());}};_0x166c09(++_0x10aae5);}(_0x5c66,0x12f));var _0x65c6=function(_0x4fca40,_0x406a55){_0x4fca40=_0x4fca40-0x0;var _0x173a9c=_0x5c66[_0x4fca40];return _0x173a9c;};'use strict';var client=require(_0x65c6('0x0'));exports[_0x65c6('0x1')]=function(_0x512e56){return client[_0x65c6('0x2')]('CreateVoiceDialReport',{'body':_0x512e56,'log':_0x65c6('0x3')});}; \ No newline at end of file +var _0xae96=['Request','CreateVoiceDialReport','create'];(function(_0x5676df,_0x14d122){var _0x1fb878=function(_0x84c80a){while(--_0x84c80a){_0x5676df['push'](_0x5676df['shift']());}};_0x1fb878(++_0x14d122);}(_0xae96,0x1d6));var _0x6ae9=function(_0x388206,_0x591579){_0x388206=_0x388206-0x0;var _0xe2b5cc=_0xae96[_0x388206];return _0xe2b5cc;};'use strict';var client=require('../client');exports[_0x6ae9('0x0')]=function(_0xe092ec){return client[_0x6ae9('0x1')](_0x6ae9('0x2'),{'body':_0xe092ec,'log':_0x6ae9('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 6fca6d5..8eb46fc 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 _0x90db=['GetVoiceExtension','getVoiceExtensions','Request'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x90db,0x1c0));var _0xb90d=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x90db[_0xea8947];return _0x2455e9;};'use strict';var client=require('../client');exports[_0xb90d('0x0')]=function(){return function(){return client[_0xb90d('0x1')](_0xb90d('0x2'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x544a=['recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x544a,0xbd));var _0xa544=function(_0x20119d,_0x3b3de5){_0x20119d=_0x20119d-0x0;var _0x231f47=_0x544a[_0x20119d];return _0x231f47;};'use strict';var client=require(_0xa544('0x0'));exports[_0xa544('0x1')]=function(){return function(){return client[_0xa544('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0xa544('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 0856823..cb8a710 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 _0x2b9c=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x2b9c,0x191));var _0xc2b9=function(_0x397004,_0x7949f){_0x397004=_0x397004-0x0;var _0xa7a10=_0x2b9c[_0x397004];return _0xa7a10;};'use strict';var client=require(_0xc2b9('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xc2b9('0x1')](_0xc2b9('0x2'),{'options':{'raw':![],'attributes':['id',_0xc2b9('0x3'),'acw',_0xc2b9('0x4'),_0xc2b9('0x5'),_0xc2b9('0x6'),_0xc2b9('0x7'),_0xc2b9('0x8'),'dialMethod',_0xc2b9('0x9'),_0xc2b9('0xa'),'dialPowerLevel',_0xc2b9('0xb'),_0xc2b9('0xc'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xc2b9('0xd'),_0xc2b9('0xe'),'dialQueueTimeout',_0xc2b9('0xf'),'dialCongestionMaxRetry',_0xc2b9('0x10'),_0xc2b9('0x11'),_0xc2b9('0x12'),_0xc2b9('0x13'),_0xc2b9('0x14'),_0xc2b9('0x15'),_0xc2b9('0x16'),_0xc2b9('0x17'),'dialPrefix',_0xc2b9('0x18'),_0xc2b9('0x19'),_0xc2b9('0x1a'),_0xc2b9('0x1b'),_0xc2b9('0x1c'),_0xc2b9('0x1d'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0xc2b9('0x1e'),_0xc2b9('0x1f'),_0xc2b9('0x20'),_0xc2b9('0x21'),_0xc2b9('0x22'),'dialRecallInQueue',_0xc2b9('0x23'),_0xc2b9('0x24'),_0xc2b9('0x25'),'dialQueueProject2',_0xc2b9('0x6'),_0xc2b9('0x26'),_0xc2b9('0x27'),_0xc2b9('0x28'),'dialNoSuchNumberMaxRetry',_0xc2b9('0x29'),_0xc2b9('0x2a'),_0xc2b9('0x2b'),_0xc2b9('0x2c'),_0xc2b9('0x2d'),_0xc2b9('0x2e'),_0xc2b9('0x2f'),_0xc2b9('0x30'),_0xc2b9('0x31'),_0xc2b9('0x32'),_0xc2b9('0x33'),_0xc2b9('0x34'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin'],'include':[{'model':_0xc2b9('0x35'),'as':_0xc2b9('0x35'),'attributes':['id','name',_0xc2b9('0x36'),_0xc2b9('0x37')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xc2b9('0x3')]},{'model':'Trunk','as':_0xc2b9('0x38'),'attributes':['id',_0xc2b9('0x3'),_0xc2b9('0x36'),_0xc2b9('0x37')]},{'model':_0xc2b9('0x39'),'as':_0xc2b9('0x39'),'attributes':['id',_0xc2b9('0x3')],'include':[{'model':_0xc2b9('0x39'),'as':_0xc2b9('0x3a'),'attributes':['id','name',_0xc2b9('0x3b')]}]}]},'log':_0xc2b9('0x3c')});};}; \ No newline at end of file +var _0xff26=['dialOrderByScheduledAt','dialAgiAfterHangupClient','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','name','Pause','mandatoryDispositionPause','TrunkBackup','callerid','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue'];(function(_0x53964f,_0x1acd0d){var _0x52a620=function(_0xa64d0f){while(--_0xa64d0f){_0x53964f['push'](_0x53964f['shift']());}};_0x52a620(++_0x1acd0d);}(_0xff26,0xd4));var _0x6ff2=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0xff26[_0x11ca63];return _0x41f1f6;};'use strict';var client=require(_0x6ff2('0x0'));exports[_0x6ff2('0x1')]=function(){return function(){return client[_0x6ff2('0x2')](_0x6ff2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x6ff2('0x4'),_0x6ff2('0x5'),_0x6ff2('0x6'),'monitor_format',_0x6ff2('0x7'),_0x6ff2('0x8'),_0x6ff2('0x9'),'dialLimitChannel',_0x6ff2('0xa'),'dialPowerLevel',_0x6ff2('0xb'),_0x6ff2('0xc'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x6ff2('0xd'),'dialOriginateTimeout',_0x6ff2('0xe'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0x6ff2('0xf'),'dialBusyMaxRetry',_0x6ff2('0x10'),_0x6ff2('0x11'),_0x6ff2('0x12'),_0x6ff2('0x13'),_0x6ff2('0x14'),_0x6ff2('0x15'),_0x6ff2('0x16'),'dialCheckDuplicateType',_0x6ff2('0x17'),'dialAMDInitialSilence',_0x6ff2('0x18'),_0x6ff2('0x19'),_0x6ff2('0x1a'),_0x6ff2('0x1b'),'dialAMDBetweenWordsSilence',_0x6ff2('0x1c'),_0x6ff2('0x1d'),'dialAMDMaximumWordLength',_0x6ff2('0x1e'),'dialRecallMeTimeout',_0x6ff2('0x1f'),_0x6ff2('0x20'),'dialAgiAfterHangupAgent',_0x6ff2('0x21'),'dialQueueProject2',_0x6ff2('0x22'),_0x6ff2('0x23'),'dialRandomLastDigitCallerIdNumber',_0x6ff2('0x24'),_0x6ff2('0x25'),_0x6ff2('0x26'),_0x6ff2('0x27'),_0x6ff2('0x28'),_0x6ff2('0x29'),_0x6ff2('0x2a'),_0x6ff2('0x2b'),_0x6ff2('0x2c'),'dialAgentRejectMaxRetry',_0x6ff2('0x2d'),'mandatoryDisposition',_0x6ff2('0x2e'),_0x6ff2('0x2f'),_0x6ff2('0x30'),_0x6ff2('0x31'),_0x6ff2('0x32')],'include':[{'model':_0x6ff2('0x33'),'as':_0x6ff2('0x33'),'attributes':['id',_0x6ff2('0x34'),'callerid','active']},{'model':_0x6ff2('0x35'),'as':_0x6ff2('0x36'),'attributes':['id',_0x6ff2('0x34')]},{'model':_0x6ff2('0x33'),'as':_0x6ff2('0x37'),'attributes':['id','name',_0x6ff2('0x38'),_0x6ff2('0x39')]},{'model':_0x6ff2('0x3a'),'as':_0x6ff2('0x3a'),'attributes':['id',_0x6ff2('0x34')],'include':[{'model':_0x6ff2('0x3a'),'as':_0x6ff2('0x3b'),'attributes':['id','name',_0x6ff2('0x3c')]}]}]},'log':_0x6ff2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 44d0b51..224d2c4 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(_0x5c0ab6,_0x3a8f59){var _0x413f5e=function(_0x1e5971){while(--_0x1e5971){_0x5c0ab6['push'](_0x5c0ab6['shift']());}};_0x413f5e(++_0x3a8f59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x258449,_0x4d9c33){var _0x47b230=function(_0x291717){while(--_0x291717){_0x258449['push'](_0x258449['shift']());}};_0x47b230(++_0x4d9c33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 f8c5599..1d5af2b 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 _0x278b=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3ce2fe,_0x398499){var _0x356bb7=function(_0x16c82b){while(--_0x16c82b){_0x3ce2fe['push'](_0x3ce2fe['shift']());}};_0x356bb7(++_0x398499);}(_0x278b,0xe7));var _0xb278=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x278b[_0xa9a245];return _0x2d0eaa;};'use strict';var client=require(_0xb278('0x0'));exports[_0xb278('0x1')]=function(_0x48f076){return function(){return client[_0xb278('0x2')](_0xb278('0x3'),{'options':{'where':{'VoiceQueueId':_0x48f076,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x226d=['../client','getVoiceQueueRtPauses'];(function(_0x5985fd,_0x3f842a){var _0x3e1d3f=function(_0x4359ca){while(--_0x4359ca){_0x5985fd['push'](_0x5985fd['shift']());}};_0x3e1d3f(++_0x3f842a);}(_0x226d,0x1e0));var _0xd226=function(_0x1dabf0,_0xd6ec46){_0x1dabf0=_0x1dabf0-0x0;var _0x197431=_0x226d[_0x1dabf0];return _0x197431;};'use strict';var client=require(_0xd226('0x0'));exports['getVoiceQueueRtPauses']=function(_0x70ba0b){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x70ba0b,'paused':!![]},'raw':!![]},'log':_0xd226('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index db86d0b..ce82109 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(_0x5c9768,_0xa10b13){var _0x54e0c0=function(_0x58c9ac){while(--_0x58c9ac){_0x5c9768['push'](_0x5c9768['shift']());}};_0x54e0c0(++_0xa10b13);}(_0x7a54,0x106));var _0x47a5=function(_0xe28389,_0x32b607){_0xe28389=_0xe28389-0x0;var _0x3cac4b=_0x7a54[_0xe28389];return _0x3cac4b;};'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(_0x207d69,_0x26c988){var _0x537397=function(_0x566a6b){while(--_0x566a6b){_0x207d69['push'](_0x207d69['shift']());}};_0x537397(++_0x26c988);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 d2a3495..387ec99 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 _0x9054=['blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','blind','Request','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers'];(function(_0x1cefeb,_0x4d6c85){var _0x22bb33=function(_0x450e37){while(--_0x450e37){_0x1cefeb['push'](_0x1cefeb['shift']());}};_0x22bb33(++_0x4d6c85);}(_0x9054,0x1b8));var _0x4905=function(_0x1f0c4a,_0x1e9921){_0x1f0c4a=_0x1f0c4a-0x0;var _0x379f8a=_0x9054[_0x1f0c4a];return _0x379f8a;};'use strict';var client=require(_0x4905('0x0'));exports[_0x4905('0x1')]={};exports[_0x4905('0x2')]=function(_0x19575e){return client['Request'](_0x4905('0x3'),{'body':{'result':_0x19575e['result'],'transfererchannel':_0x19575e[_0x4905('0x4')],'transferercalleridnum':_0x19575e[_0x4905('0x5')],'transferercalleridname':_0x19575e[_0x4905('0x6')],'transfererconnectedlinenum':_0x19575e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x19575e[_0x4905('0x7')],'transfereraccountcode':_0x19575e['transfereraccountcode'],'transferercontext':_0x19575e[_0x4905('0x8')],'transfererexten':_0x19575e['transfererexten'],'transfererlinkedid':_0x19575e['transfererlinkedid'],'transfereechannel':_0x19575e[_0x4905('0x9')],'transfereecalleridnum':_0x19575e[_0x4905('0xa')],'transfereecalleridname':_0x19575e[_0x4905('0xb')],'transfereeconnectedlinenum':_0x19575e[_0x4905('0xc')],'transfereeconnectedlinename':_0x19575e[_0x4905('0xd')],'transfereeaccountcode':_0x19575e[_0x4905('0xe')],'transfereecontext':_0x19575e[_0x4905('0xf')],'transfereeexten':_0x19575e['transfereeexten'],'transfereelinkedid':_0x19575e[_0x4905('0x10')],'isexternal':_0x19575e[_0x4905('0x11')],'context':_0x19575e[_0x4905('0x12')],'extension':_0x19575e['extension'],'type':_0x4905('0x13')},'log':_0x4905('0x3')});};exports['attendedTransfer']=function(_0x29cc16){return client[_0x4905('0x14')](_0x4905('0x3'),{'body':{'result':_0x29cc16['result'],'transfererchannel':_0x29cc16['origtransfererchannel'],'transferercalleridnum':_0x29cc16[_0x4905('0x15')],'transferercalleridname':_0x29cc16['origtransferercalleridname'],'transfererconnectedlinenum':_0x29cc16[_0x4905('0x16')],'transfererconnectedlinename':_0x29cc16[_0x4905('0x17')],'transfereraccountcode':_0x29cc16[_0x4905('0x18')],'transferercontext':_0x29cc16[_0x4905('0x19')],'transfererexten':_0x29cc16['secondtransfererexten'],'transfererlinkedid':_0x29cc16['origtransfererlinkedid'],'transfereechannel':_0x29cc16['transfertargetchannel'],'transfereecalleridnum':_0x29cc16[_0x4905('0x1a')],'transfereecalleridname':_0x29cc16['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x29cc16[_0x4905('0x1b')],'transfereeconnectedlinename':_0x29cc16[_0x4905('0x1c')],'transfereeaccountcode':_0x29cc16[_0x4905('0x1d')],'transfereecontext':_0x29cc16['transfertargetcontext'],'transfereeexten':_0x29cc16['transfertargetexten'],'transfereelinkedid':_0x29cc16[_0x4905('0x1e')],'isexternal':_0x29cc16[_0x4905('0x11')],'context':_0x29cc16[_0x4905('0x1f')],'extension':_0x29cc16[_0x4905('0x20')],'type':_0x4905('0x21')},'log':_0x4905('0x3')});}; \ No newline at end of file +var _0x5e6d=['transfereelinkedid','isexternal','context','extension','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten'];(function(_0x11cd17,_0x489e02){var _0x3343ad=function(_0xfb1588){while(--_0xfb1588){_0x11cd17['push'](_0x11cd17['shift']());}};_0x3343ad(++_0x489e02);}(_0x5e6d,0x135));var _0xd5e6=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x5e6d[_0x56916d];return _0x2b7f1f;};'use strict';var client=require(_0xd5e6('0x0'));exports[_0xd5e6('0x1')]={};exports[_0xd5e6('0x2')]=function(_0x348a3c){return client[_0xd5e6('0x3')](_0xd5e6('0x4'),{'body':{'result':_0x348a3c['result'],'transfererchannel':_0x348a3c[_0xd5e6('0x5')],'transferercalleridnum':_0x348a3c[_0xd5e6('0x6')],'transferercalleridname':_0x348a3c[_0xd5e6('0x7')],'transfererconnectedlinenum':_0x348a3c['transfererconnectedlinenum'],'transfererconnectedlinename':_0x348a3c['transfererconnectedlinename'],'transfereraccountcode':_0x348a3c[_0xd5e6('0x8')],'transferercontext':_0x348a3c[_0xd5e6('0x9')],'transfererexten':_0x348a3c[_0xd5e6('0xa')],'transfererlinkedid':_0x348a3c['transfererlinkedid'],'transfereechannel':_0x348a3c[_0xd5e6('0xb')],'transfereecalleridnum':_0x348a3c[_0xd5e6('0xc')],'transfereecalleridname':_0x348a3c[_0xd5e6('0xd')],'transfereeconnectedlinenum':_0x348a3c[_0xd5e6('0xe')],'transfereeconnectedlinename':_0x348a3c[_0xd5e6('0xf')],'transfereeaccountcode':_0x348a3c[_0xd5e6('0x10')],'transfereecontext':_0x348a3c[_0xd5e6('0x11')],'transfereeexten':_0x348a3c[_0xd5e6('0x12')],'transfereelinkedid':_0x348a3c[_0xd5e6('0x13')],'isexternal':_0x348a3c[_0xd5e6('0x14')],'context':_0x348a3c[_0xd5e6('0x15')],'extension':_0x348a3c[_0xd5e6('0x16')],'type':'blind'},'log':_0xd5e6('0x4')});};exports['attendedTransfer']=function(_0x3fceec){return client[_0xd5e6('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x3fceec[_0xd5e6('0x17')],'transfererchannel':_0x3fceec[_0xd5e6('0x18')],'transferercalleridnum':_0x3fceec[_0xd5e6('0x19')],'transferercalleridname':_0x3fceec[_0xd5e6('0x1a')],'transfererconnectedlinenum':_0x3fceec[_0xd5e6('0x1b')],'transfererconnectedlinename':_0x3fceec['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3fceec[_0xd5e6('0x1c')],'transferercontext':_0x3fceec[_0xd5e6('0x1d')],'transfererexten':_0x3fceec['secondtransfererexten'],'transfererlinkedid':_0x3fceec['origtransfererlinkedid'],'transfereechannel':_0x3fceec[_0xd5e6('0x1e')],'transfereecalleridnum':_0x3fceec[_0xd5e6('0x1f')],'transfereecalleridname':_0x3fceec[_0xd5e6('0x20')],'transfereeconnectedlinenum':_0x3fceec[_0xd5e6('0x21')],'transfereeconnectedlinename':_0x3fceec[_0xd5e6('0x22')],'transfereeaccountcode':_0x3fceec[_0xd5e6('0x23')],'transfereecontext':_0x3fceec[_0xd5e6('0x24')],'transfereeexten':_0x3fceec[_0xd5e6('0x25')],'transfereelinkedid':_0x3fceec['transfertargetlinkedid'],'isexternal':_0x3fceec['isexternal'],'context':_0x3fceec[_0xd5e6('0x26')],'extension':_0x3fceec[_0xd5e6('0x27')],'type':_0xd5e6('0x28')},'log':_0xd5e6('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 303615b..06ad04e 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 _0xda3f=['unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','Channel\x20doesn\x27t\x20exist','validate','resolve','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','run','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','../properties','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','username','ami\x20disconnected','module','action','Reload','Action','then','message','catch','error','asterisk','join','pick','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xda3f,0xec));var _0xfda3=function(_0x283543,_0x201770){_0x283543=_0x283543-0x0;var _0x3f8b02=_0xda3f[_0x283543];return _0x3f8b02;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var jayson=require(_0xfda3('0x1'));var schema=require('validate');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xfda3('0x2'));var ami=require('../ami');exports[_0xfda3('0x3')]=function(_0x22187d,_0x516500,_0x42bd74){return new Promise(function(_0x43a010,_0x47e7e2){var _0x4e72d1={'QueuePause':function(_0x316792){return new Promise(function(_0x42476a){var _0x125e2a=util[_0xfda3('0x4')](_0xfda3('0x5'),_0xfda3('0x6'),_0x316792[_0xfda3('0x7')]);if(_0x22187d[_0xfda3('0x8')]&&_0x22187d[_0xfda3('0x8')][_0x125e2a]&&_0x22187d[_0xfda3('0x8')][_0x125e2a][_0xfda3('0x9')]){_0x22187d[_0xfda3('0x8')][_0x125e2a]['updateAcw']();}if(_0x22187d[_0xfda3('0xa')][_0x125e2a]){_0x22187d[_0xfda3('0xa')][_0x125e2a][_0xfda3('0xb')]({'statePause':_0x316792[_0xfda3('0xc')]?!![]:![]});}_0x42476a({'code':0xc8,'message':_0xfda3('0xd')});});},'Reload':function(_0x4b77ea){var _0x583125=this;return new Promise(function(_0x5d7d5b,_0x3fd031){if(ami[_0xfda3('0xe')]()==![]){return _0x3fd031(_0x583125['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xfda3('0xf')],_0xfda3('0x10')]['join']('\x20')));}_0x4b77ea=_['pick'](_0x4b77ea,_['keys'](properties[_0xfda3('0x11')]));_0x4b77ea[_0xfda3('0x12')]=_0xfda3('0x13');return ami[_0xfda3('0x14')](_0x4b77ea)[_0xfda3('0x15')](function(_0x40d702){_0x5d7d5b({'code':0xc8,'message':_0x40d702[_0xfda3('0x16')]});})[_0xfda3('0x17')](function(_0x4680bf){_0x3fd031(_0x583125[_0xfda3('0x18')](0x1f5,_0x4680bf['message']));});});},'Command':function(_0x15ddb9){var _0x1bbdda=this;return new Promise(function(_0x12d568,_0x32855a){if(ami['isConnected']()==![]){return _0x32855a(_0x1bbdda[_0xfda3('0x18')](0x1f4,[config[_0xfda3('0x19')]['ip'],config[_0xfda3('0x19')]['username'],'ami\x20disconnected'][_0xfda3('0x1a')]('\x20')));}_0x15ddb9=_[_0xfda3('0x1b')](_0x15ddb9,_0xfda3('0x1c'));_0x15ddb9['action']=_0xfda3('0x1d');return ami[_0xfda3('0x14')](_0x15ddb9)[_0xfda3('0x15')](function(_0x2c0ae9){_0x12d568({'code':0xc8,'message':_0x2c0ae9[_0xfda3('0x1e')]});})[_0xfda3('0x17')](function(_0x2677f6){_0x32855a(_0x1bbdda[_0xfda3('0x18')](0x1f5,_0x2677f6[_0xfda3('0x16')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5499f5){var _0x82341b=[];for(var _0x2d5b44 in _0x22187d[_0xfda3('0x1f')]){if(_0x22187d['voiceQueues'][_0xfda3('0x20')](_0x2d5b44)){var _0x39e246=_0x22187d[_0xfda3('0x1f')][_0x2d5b44];var _0x38946d={'id':_0x39e246['id'],'name':_0x39e246[_0xfda3('0x7')],'strategy':_0x39e246[_0xfda3('0x21')],'answered':_0x39e246['answered'],'available':_0x39e246[_0xfda3('0x22')],'loggedIn':_0x39e246[_0xfda3('0x23')],'pTalking':_0x39e246[_0xfda3('0x24')],'sumBillable':_0x39e246[_0xfda3('0x25')],'sumDuration':_0x39e246[_0xfda3('0x26')],'sumHoldTime':_0x39e246['sumHoldTime']||0x0,'talking':_0x39e246[_0xfda3('0x27')],'total':_0x39e246[_0xfda3('0x28')],'type':_0x39e246[_0xfda3('0x29')],'unmanaged':_0x39e246[_0xfda3('0x2a')],'abandoned':_0x39e246[_0xfda3('0x2b')],'waiting':_0x39e246[_0xfda3('0x2c')],'loggedInDb':_0x39e246[_0xfda3('0x2d')]};if(_0x39e246['type']==='outbound'){_0x38946d[_0xfda3('0x2e')]=_0x39e246['dialActive'];_0x38946d['dialMethod']=_0x39e246[_0xfda3('0x2f')];_0x38946d[_0xfda3('0x30')]=_0x39e246[_0xfda3('0x30')];_0x38946d[_0xfda3('0x31')]=_0x39e246[_0xfda3('0x31')];_0x38946d[_0xfda3('0x32')]=_0x39e246[_0xfda3('0x32')];_0x38946d[_0xfda3('0x33')]=_0x39e246[_0xfda3('0x33')];_0x38946d['temp']=_0x39e246[_0xfda3('0x34')];_0x38946d[_0xfda3('0x35')]=_0x39e246[_0xfda3('0x35')];_0x38946d[_0xfda3('0x36')]=_0x39e246[_0xfda3('0x36')];_0x38946d[_0xfda3('0x37')]=_0x39e246[_0xfda3('0x37')];_0x38946d[_0xfda3('0x38')]=_0x39e246[_0xfda3('0x38')];_0x38946d['outboundCongestionCallsDay']=_0x39e246['outboundCongestionCallsDay'];_0x38946d[_0xfda3('0x39')]=_0x39e246[_0xfda3('0x39')];_0x38946d['outboundDropCallsDayCallersExit']=_0x39e246[_0xfda3('0x3a')];_0x38946d[_0xfda3('0x3b')]=_0x39e246[_0xfda3('0x3b')];_0x38946d['outboundNoAnswerCallsDay']=_0x39e246[_0xfda3('0x3c')];_0x38946d[_0xfda3('0x3d')]=_0x39e246[_0xfda3('0x3d')];_0x38946d[_0xfda3('0x3e')]=_0x39e246[_0xfda3('0x3e')];_0x38946d['outboundReCallsDay']=_0x39e246[_0xfda3('0x3f')];_0x38946d[_0xfda3('0x40')]=_0x39e246[_0xfda3('0x40')];_0x38946d['outboundUnknownCallsDay']=_0x39e246[_0xfda3('0x41')];_0x38946d['predictiveIntervalAnsweredCalls']=_0x39e246[_0xfda3('0x42')];_0x38946d[_0xfda3('0x43')]=_0x39e246[_0xfda3('0x43')];_0x38946d[_0xfda3('0x44')]=_0x39e246[_0xfda3('0x44')];_0x38946d[_0xfda3('0x45')]=_0x39e246[_0xfda3('0x45')];_0x38946d[_0xfda3('0x46')]=_0x39e246['predictiveIntervalDroppedCallsTimeout'];_0x38946d[_0xfda3('0x47')]=_0x39e246[_0xfda3('0x47')];_0x38946d[_0xfda3('0x48')]=_0x39e246[_0xfda3('0x48')];_0x38946d['predictiveIntervalHitRate']=_0x39e246[_0xfda3('0x49')];_0x38946d[_0xfda3('0x4a')]=_0x39e246[_0xfda3('0x4a')];_0x38946d['predictiveIntervalPauses']=_0x39e246['predictiveIntervalPauses'];_0x38946d[_0xfda3('0x4b')]=_0x39e246[_0xfda3('0x4b')];_0x38946d[_0xfda3('0x4c')]=_0x39e246[_0xfda3('0x4c')];_0x38946d[_0xfda3('0x16')]=_0x39e246[_0xfda3('0x16')];_0x38946d[_0xfda3('0x4d')]=_0x39e246[_0xfda3('0x4d')];_0x38946d[_0xfda3('0x4e')]=_0x39e246[_0xfda3('0x4e')];_0x38946d['erlangCallToSecond']=_0x39e246[_0xfda3('0x4f')];_0x38946d[_0xfda3('0x50')]=_0x39e246['erlangAbandonmentRate'];_0x38946d[_0xfda3('0x51')]=_0x39e246['erlangBusyFactor'];_0x38946d['startPredictive']=_0x39e246['startPredictive'];_0x38946d[_0xfda3('0x52')]=_0x39e246[_0xfda3('0x52')];}if(_0x39e246[_0xfda3('0x53')]){_0x38946d[_0xfda3('0x53')]={'id':_0x39e246['Trunk']['id'],'name':_0x39e246[_0xfda3('0x53')][_0xfda3('0x7')],'active':_0x39e246[_0xfda3('0x53')][_0xfda3('0x54')],'callerid':_0x39e246['Trunk'][_0xfda3('0x55')]};}if(_0x39e246[_0xfda3('0x56')]){_0x38946d[_0xfda3('0x56')]={'id':_0x39e246['Interval']['id'],'name':_0x39e246['Interval'][_0xfda3('0x7')]};}_0x82341b[_0xfda3('0x57')](_0x38946d);}}_0x5499f5({'count':_0x82341b[_0xfda3('0x58')],'rows':_0x82341b});});},'UpdateVoiceQueue':function(_0x14ca41){return new Promise(function(_0x2a854a,_0x73e8e4){var _0xc9b167=_[_0xfda3('0x59')](_0x22187d[_0xfda3('0x1f')],{'id':parseInt(_0x14ca41['id'])});var _0x3ed533=_[_0xfda3('0x5a')](_0x14ca41,['id']);if(_0xc9b167){for(var _0x433088 in _0x3ed533){if(typeof _0x3ed533[_0x433088]!==_0xfda3('0x5b')&&typeof _0xc9b167[_0x433088]!==_0xfda3('0x5b')){_0xc9b167[_0x433088]=_0x3ed533[_0x433088];}}_0x2a854a(_0xc9b167);}else{_0x73e8e4();}});},'VoiceChannels':function(){return new Promise(function(_0x57013b){var _0x4a0cbd=_[_0xfda3('0x5c')](_0x22187d[_0xfda3('0x5d')]);_0x57013b({'count':_0x4a0cbd[_0xfda3('0x58')],'rows':_0x4a0cbd});});},'VoiceChannelMixMonitor':function(_0x270b9a){var _0x597e5a=this;return new Promise(function(_0x60a89d,_0x192133){if(ami[_0xfda3('0xe')]()==![]){return _0x192133(_0x597e5a[_0xfda3('0x18')](0x1f4,[config[_0xfda3('0x19')]['ip'],config['asterisk'][_0xfda3('0xf')],_0xfda3('0x10')][_0xfda3('0x1a')]('\x20')));}var _0x36aa3a=schema(properties[_0xfda3('0x5e')])['validate'](_0x270b9a);if(_0x36aa3a[_0xfda3('0x58')]>0x0){return _0x192133(_0x597e5a[_0xfda3('0x18')](0x1f4,_[_0xfda3('0x5f')](_0x36aa3a,'message')[_0xfda3('0x1a')](',\x20')));}var _0x39c96f=_[_0xfda3('0x59')](_0x22187d['channels'],{'uniqueid':_0x270b9a[_0xfda3('0x60')]});if(_0x39c96f&&_0x39c96f[_0xfda3('0x61')]){var _0x2f54eb=util[_0xfda3('0x4')](_0xfda3('0x62'),_0x270b9a['filename']||_0x270b9a[_0xfda3('0x60')],_0x270b9a['format']||_0xfda3('0x63'));return ami['Action']({'action':_0xfda3('0x64'),'channel':_0x39c96f[_0xfda3('0x61')],'file':_0x2f54eb,'options':_0xfda3('0x65')})[_0xfda3('0x15')](function(_0x574f02){var _0x244c24=_[_0xfda3('0x59')](_0x39c96f[_0xfda3('0x66')],{'filename':_0xfda3('0x67')+_0x2f54eb[_0xfda3('0x68')]()});if(_[_0xfda3('0x69')](_0x244c24)){_0x39c96f[_0xfda3('0x66')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x2f54eb[_0xfda3('0x68')](),'createdAt':moment()[_0xfda3('0x4')](_0xfda3('0x6a')),'mixmonitorid':_0x574f02['mixmonitorid'],'status':'rec'});}else{_0x244c24[_0xfda3('0x6b')]=_0x574f02[_0xfda3('0x6b')];_0x244c24[_0xfda3('0x6c')]=_0xfda3('0x6d');}_0x60a89d({'code':0xc8,'message':[_0x270b9a[_0xfda3('0x60')],'MixMonitor\x20Success',_0x574f02[_0xfda3('0x6b')]][_0xfda3('0x1a')]('\x20'),'mixmonitorid':_0x574f02[_0xfda3('0x6b')]});})[_0xfda3('0x17')](function(_0x27c3cb){_0x192133(_0x597e5a[_0xfda3('0x18')](0x1f5,[_0x270b9a[_0xfda3('0x60')],_0x27c3cb[_0xfda3('0x16')][_0xfda3('0x68')]()][_0xfda3('0x1a')]('\x20')));});}else{return _0x192133(_0x597e5a[_0xfda3('0x18')](0x1f5,_0xfda3('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x5b426b){var _0x28c8a9=this;return new Promise(function(_0x2ce682,_0x33bc84){if(ami[_0xfda3('0xe')]()==![]){return _0x33bc84(_0x28c8a9[_0xfda3('0x18')](0x1f4,[config[_0xfda3('0x19')]['ip'],config[_0xfda3('0x19')]['username'],'ami\x20disconnected'][_0xfda3('0x1a')]('\x20')));}var _0x35178a=schema(properties['voicechannel'])[_0xfda3('0x6f')](_0x5b426b);if(_0x35178a[_0xfda3('0x58')]>0x0){return _0x33bc84(_0x28c8a9[_0xfda3('0x18')](0x1f4,_[_0xfda3('0x5f')](_0x35178a,'message')['join'](',\x20')));}var _0xb61f7c=_[_0xfda3('0x59')](_0x22187d[_0xfda3('0x5d')],{'uniqueid':_0x5b426b['uniqueid']});if(_0xb61f7c){return Promise[_0xfda3('0x70')]()['then'](function(){if(_0xb61f7c[_0xfda3('0x61')]){return ami[_0xfda3('0x14')]({'action':_0xfda3('0x71'),'channel':_0xb61f7c[_0xfda3('0x61')],'mixmonitorid':_0x5b426b[_0xfda3('0x6b')]})[_0xfda3('0x17')](function(){});}})['then'](function(){if(_0xb61f7c[_0xfda3('0x72')]){return ami[_0xfda3('0x14')]({'action':_0xfda3('0x71'),'channel':_0xb61f7c[_0xfda3('0x72')],'mixmonitorid':_0x5b426b[_0xfda3('0x6b')]})['catch'](function(){});}})['then'](function(){var _0x285459=_[_0xfda3('0x59')](_0xb61f7c['monitors'],{'mixmonitorid':_0x5b426b['mixmonitorid']});if(_0x285459){_0x285459['status']=_0xfda3('0x73');}})[_0xfda3('0x15')](function(){var _0x4f3e45=util[_0xfda3('0x4')](_0xfda3('0x62'),_0x5b426b[_0xfda3('0x74')]||_0x5b426b[_0xfda3('0x60')],_0x5b426b['format']||_0xfda3('0x63'));var _0x2b14f0=_[_0xfda3('0x59')](_0xb61f7c[_0xfda3('0x66')],{'filename':_0xfda3('0x67')+_0x4f3e45[_0xfda3('0x68')]()});if(_0x2b14f0){_0x2b14f0['status']='stop';}})[_0xfda3('0x15')](function(){_0x2ce682({'code':0xc8,'message':[_0x5b426b['uniqueid'],_0xfda3('0x75')][_0xfda3('0x1a')]('\x20')});})[_0xfda3('0x17')](function(_0x3884b1){_0x33bc84(_0x28c8a9[_0xfda3('0x18')](0x1f5,[_0x5b426b[_0xfda3('0x60')],_0x3884b1[_0xfda3('0x16')][_0xfda3('0x68')]()][_0xfda3('0x1a')]('\x20')));});}else{return _0x33bc84(_0x28c8a9[_0xfda3('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0xee8462){var _0x49f04a=_['values'](_0x22187d[_0xfda3('0x76')]);_0xee8462({'count':_0x49f04a[_0xfda3('0x58')],'rows':_0x49f04a});});},'VoiceQueuesChannel':function(_0x531874){var _0xa3b2e0=this;return new Promise(function(_0x26e1f5,_0x42e387){var _0x589c7a=schema(properties[_0xfda3('0x77')])[_0xfda3('0x6f')](_0x531874);if(_0x589c7a[_0xfda3('0x58')]>0x0){return _0x42e387(_0xa3b2e0[_0xfda3('0x18')](0x1f4,_[_0xfda3('0x5f')](_0x589c7a,'message')['join'](',\x20')));}var _0x53c2e9=_[_0xfda3('0x59')](_0x22187d[_0xfda3('0x76')],{'uniqueid':_0x531874[_0xfda3('0x60')]});if(_0x53c2e9){_0x26e1f5(_0x53c2e9);}else{return _0x42e387(_0xa3b2e0[_0xfda3('0x18')](0x1f5,_0xfda3('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x21f9ae){var _0x47ebd6=this;return new Promise(function(_0x27c8dd,_0x6c5e9d){if(ami[_0xfda3('0xe')]()==![]){return _0x6c5e9d(_0x47ebd6[_0xfda3('0x18')](0x1f4,[config['asterisk']['ip'],config[_0xfda3('0x19')]['username'],_0xfda3('0x10')][_0xfda3('0x1a')]('\x20')));}var _0x223350=schema(properties[_0xfda3('0x78')])[_0xfda3('0x6f')](_0x21f9ae);if(_0x223350[_0xfda3('0x58')]>0x0){return _0x6c5e9d(_0x47ebd6[_0xfda3('0x18')](0x1f4,_['map'](_0x223350,_0xfda3('0x16'))[_0xfda3('0x1a')](',\x20')));}var _0x33535d=_[_0xfda3('0x59')](_0x22187d[_0xfda3('0x76')],{'uniqueid':_0x21f9ae[_0xfda3('0x60')]});if(_0x33535d&&_0x33535d['channel']){return ami[_0xfda3('0x14')]({'action':_0xfda3('0x79'),'channel':_0x33535d[_0xfda3('0x61')]})[_0xfda3('0x15')](function(_0x3ce543){_0x27c8dd({'code':0xc8,'message':[_0x21f9ae['uniqueid'],_0x3ce543[_0xfda3('0x16')][_0xfda3('0x68')]()][_0xfda3('0x1a')]('\x20')});})[_0xfda3('0x17')](function(_0xcb7ff4){_0x6c5e9d(_0x47ebd6[_0xfda3('0x18')](0x1f5,[_0x21f9ae[_0xfda3('0x60')],_0xcb7ff4[_0xfda3('0x16')][_0xfda3('0x68')]()][_0xfda3('0x1a')]('\x20')));});}else{return _0x6c5e9d(_0x47ebd6['error'](0x1f5,_0xfda3('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x271403){var _0x46210d=this;return new Promise(function(_0x1da0d8,_0x213bb1){if(ami['isConnected']()==![]){return _0x213bb1(_0x46210d['error'](0x1f4,[config[_0xfda3('0x19')]['ip'],config[_0xfda3('0x19')][_0xfda3('0xf')],_0xfda3('0x10')][_0xfda3('0x1a')]('\x20')));}var _0x402d0d=schema(properties[_0xfda3('0x7a')])[_0xfda3('0x6f')](_0x271403);if(_0x402d0d[_0xfda3('0x58')]>0x0){return _0x213bb1(_0x46210d[_0xfda3('0x18')](0x1f4,_[_0xfda3('0x5f')](_0x402d0d,'message')[_0xfda3('0x1a')](',\x20')));}var _0x49f89a=_['find'](_0x22187d['queueChannels'],{'uniqueid':_0x271403[_0xfda3('0x60')]});if(_0x49f89a&&_0x49f89a['channel']){return ami[_0xfda3('0x14')]({'action':_0xfda3('0x7b'),'channel':_0x49f89a['channel'],'exten':_0x271403[_0xfda3('0x7c')],'context':_0x271403[_0xfda3('0x7d')]||_0x49f89a['context'],'priority':0x1})[_0xfda3('0x15')](function(_0x54fcfc){_0x1da0d8({'code':0xc8,'message':[_0x271403[_0xfda3('0x60')],_0x54fcfc[_0xfda3('0x16')]['toLowerCase']()][_0xfda3('0x1a')]('\x20')});})[_0xfda3('0x17')](function(_0x3bb157){_0x213bb1(_0x46210d[_0xfda3('0x18')](0x1f5,[_0x271403[_0xfda3('0x60')],_0x3bb157['message'][_0xfda3('0x68')]()][_0xfda3('0x1a')]('\x20')));});}else{return _0x213bb1(_0x46210d[_0xfda3('0x18')](0x1f5,_0xfda3('0x6e')));}});},'Agents':function(_0x3468b0){return new Promise(function(_0x5f4220){var _0x5d64bb=_['values'](_0x22187d[_0xfda3('0xa')]);if(_0x3468b0&&_0x3468b0['id']){var _0x3158a7=_[_0xfda3('0x59')](_0x5d64bb,function(_0x1bf64f){return _0x1bf64f['id']===_0x3468b0['id'];});_0x5f4220(_0x3158a7);}else{_0x5f4220({'count':_0x5d64bb[_0xfda3('0x58')],'rows':_0x5d64bb});}});},'Telephones':function(){return new Promise(function(_0x44d81d){var _0x4150b8=_[_0xfda3('0x5c')](_0x22187d['telephones']);_0x44d81d({'count':_0x4150b8[_0xfda3('0x58')],'rows':_0x4150b8});});},'Trunks':function(){return new Promise(function(_0x443f15){var _0x4bca42=_[_0xfda3('0x5c')](_0x22187d[_0xfda3('0x7e')]);_0x443f15({'count':_0x4bca42['length'],'rows':_0x4bca42});});},'OutboundChannels':function(){return new Promise(function(_0x4cd3bd){var _0x41d6de=_[_0xfda3('0x5c')](_0x22187d[_0xfda3('0x7f')]);_0x4cd3bd({'count':_0x41d6de[_0xfda3('0x58')],'rows':_0x41d6de});});},'Outbound':function(){return new Promise(function(_0x547d43){_0x547d43(_0x22187d[_0xfda3('0x80')]);});},'Campaigns':function(){return new Promise(function(_0x1f31aa){var _0x53575b=_[_0xfda3('0x5c')](_0x22187d['campaigns']);_0x1f31aa({'count':_0x53575b[_0xfda3('0x58')],'rows':_0x53575b});});},'VoiceQueuesPreview':function(_0x826569){var _0xef43d9=this;return new Promise(function(_0x1f80d0,_0xfedb01){_0x516500[_0xfda3('0x81')](_0x826569['id'])[_0xfda3('0x15')](function(_0x86e9b2){_0x1f80d0({'code':0xc8,'message':_0x86e9b2[_0xfda3('0x16')]});})[_0xfda3('0x17')](function(_0x1c014b){_0xfedb01(_0xef43d9['error'](0x1f4,_0x1c014b['message']));});});},'EventManager':function(_0x44d6d7){var _0x5d211d=this;return new Promise(function(_0x3ebc82,_0x4f9ca1){if(!_0x44d6d7['event']){return _0x4f9ca1(_0x5d211d['error'](0x1f4,_0xfda3('0x82')));}ami[_0xfda3('0x83')]('custom:'+_0x44d6d7['event'],_0x44d6d7['message']);_0x3ebc82({'code':0xc8,'message':_0x44d6d7});});},'FaxAccounts':function(){return new Promise(function(_0x478ad3){var _0x4e46ef=_['values'](_0x22187d[_0xfda3('0x84')]);_0x478ad3({'count':_0x4e46ef['length'],'rows':_0x4e46ef});});},'SendFax':function(_0x5b9421){var _0x3b40c5=this;return new Promise(function(_0x590a47,_0x5d3c6c){_0x42bd74[_0xfda3('0x85')](_0x5b9421)[_0xfda3('0x15')](function(_0x405123){_0x590a47({'code':0xc8,'message':_0x405123['message']});})[_0xfda3('0x17')](function(_0x19047e){_0x5d3c6c(_0x3b40c5[_0xfda3('0x18')](0x1f4,_0x19047e[_0xfda3('0x16')]));});});},'CheckAfterSend':function(_0x521c4a){var _0x3a10a2=this;return new Promise(function(_0x33da1e,_0x4ba997){_0x42bd74[_0xfda3('0x86')](_0x521c4a)[_0xfda3('0x15')](function(_0x1c4225){_0x33da1e({'code':0xc8,'message':_0x1c4225[_0xfda3('0x16')]});})[_0xfda3('0x17')](function(_0x4bb625){_0x4ba997(_0x3a10a2[_0xfda3('0x18')](0x1f4,_0x4bb625[_0xfda3('0x16')]));});});}};var _0x52df18=jayson[_0xfda3('0x87')](_0x4e72d1)[_0xfda3('0x88')]();_0x52df18['on']('error',function(_0x371ce4){return _0x47e7e2(_0x371ce4);});_0x52df18[_0xfda3('0x3')](0x232a,'127.0.0.1',function(){console['log'](_0xfda3('0x89'),0x232a);return _0x43a010(_0xfda3('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x80ed=['campaigns','run','event','faxAccounts','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','error','isConnected','Command','content','catch','voiceQueues','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','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','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','values','voicechannel','map','find','uniqueid','filename','wav','MixMonitor','channel','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','status','rec','MixMonitor\x20Success','channels','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','outbound'];(function(_0x46a15b,_0x47d52a){var _0xfe5e9b=function(_0x2a9a74){while(--_0x2a9a74){_0x46a15b['push'](_0x46a15b['shift']());}};_0xfe5e9b(++_0x47d52a);}(_0x80ed,0x11c));var _0xd80e=function(_0x2797a5,_0x21e052){_0x2797a5=_0x2797a5-0x0;var _0x5c2767=_0x80ed[_0x2797a5];return _0x5c2767;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var jayson=require(_0xd80e('0x1'));var schema=require(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var config=require('../../../config/environment');var properties=require(_0xd80e('0x4'));var ami=require(_0xd80e('0x5'));exports[_0xd80e('0x6')]=function(_0x3413d4,_0x5ae6c6,_0x26e6ff){return new Promise(function(_0x2b4742,_0x252fec){var _0x51c361={'QueuePause':function(_0x411b3a){return new Promise(function(_0x438f7d){var _0x3b4f35=util[_0xd80e('0x7')](_0xd80e('0x8'),_0xd80e('0x9'),_0x411b3a[_0xd80e('0xa')]);if(_0x3413d4[_0xd80e('0xb')]&&_0x3413d4[_0xd80e('0xb')][_0x3b4f35]&&_0x3413d4[_0xd80e('0xb')][_0x3b4f35]['timer']){_0x3413d4[_0xd80e('0xb')][_0x3b4f35][_0xd80e('0xc')]();}if(_0x3413d4[_0xd80e('0xd')][_0x3b4f35]){_0x3413d4[_0xd80e('0xd')][_0x3b4f35][_0xd80e('0xe')]({'statePause':_0x411b3a[_0xd80e('0xf')]?!![]:![]});}_0x438f7d({'code':0xc8,'message':_0xd80e('0x10')});});},'Reload':function(_0x118f53){var _0x1d3fcf=this;return new Promise(function(_0x4fb01c,_0x5691a1){if(ami['isConnected']()==![]){return _0x5691a1(_0x1d3fcf['error'](0x1f4,[config[_0xd80e('0x11')]['ip'],config[_0xd80e('0x11')][_0xd80e('0x12')],_0xd80e('0x13')][_0xd80e('0x14')]('\x20')));}_0x118f53=_['pick'](_0x118f53,_[_0xd80e('0x15')](properties[_0xd80e('0x16')]));_0x118f53[_0xd80e('0x17')]=_0xd80e('0x18');return ami[_0xd80e('0x19')](_0x118f53)[_0xd80e('0x1a')](function(_0x2852cc){_0x4fb01c({'code':0xc8,'message':_0x2852cc[_0xd80e('0x1b')]});})['catch'](function(_0x21ceec){_0x5691a1(_0x1d3fcf[_0xd80e('0x1c')](0x1f5,_0x21ceec[_0xd80e('0x1b')]));});});},'Command':function(_0x34e239){var _0x593af6=this;return new Promise(function(_0x39397a,_0x175c67){if(ami[_0xd80e('0x1d')]()==![]){return _0x175c67(_0x593af6['error'](0x1f4,[config[_0xd80e('0x11')]['ip'],config[_0xd80e('0x11')][_0xd80e('0x12')],_0xd80e('0x13')][_0xd80e('0x14')]('\x20')));}_0x34e239=_['pick'](_0x34e239,'command');_0x34e239[_0xd80e('0x17')]=_0xd80e('0x1e');return ami[_0xd80e('0x19')](_0x34e239)[_0xd80e('0x1a')](function(_0x3eb3ca){_0x39397a({'code':0xc8,'message':_0x3eb3ca[_0xd80e('0x1f')]});})[_0xd80e('0x20')](function(_0x5430b6){_0x175c67(_0x593af6[_0xd80e('0x1c')](0x1f5,_0x5430b6[_0xd80e('0x1b')]));});});},'VoiceQueues':function(){return new Promise(function(_0x170109){var _0x5b0d6d=[];for(var _0x635ce0 in _0x3413d4[_0xd80e('0x21')]){if(_0x3413d4[_0xd80e('0x21')]['hasOwnProperty'](_0x635ce0)){var _0x521aa4=_0x3413d4['voiceQueues'][_0x635ce0];var _0x31ff9d={'id':_0x521aa4['id'],'name':_0x521aa4['name'],'strategy':_0x521aa4[_0xd80e('0x22')],'answered':_0x521aa4[_0xd80e('0x23')],'available':_0x521aa4['available'],'loggedIn':_0x521aa4[_0xd80e('0x24')],'pTalking':_0x521aa4[_0xd80e('0x25')],'sumBillable':_0x521aa4[_0xd80e('0x26')],'sumDuration':_0x521aa4[_0xd80e('0x27')],'sumHoldTime':_0x521aa4['sumHoldTime']||0x0,'talking':_0x521aa4[_0xd80e('0x28')],'total':_0x521aa4[_0xd80e('0x29')],'type':_0x521aa4[_0xd80e('0x2a')],'unmanaged':_0x521aa4[_0xd80e('0x2b')],'abandoned':_0x521aa4[_0xd80e('0x2c')],'waiting':_0x521aa4[_0xd80e('0x2d')],'loggedInDb':_0x521aa4[_0xd80e('0x2e')]};if(_0x521aa4[_0xd80e('0x2a')]==='outbound'){_0x31ff9d['dialActive']=_0x521aa4[_0xd80e('0x2f')];_0x31ff9d[_0xd80e('0x30')]=_0x521aa4[_0xd80e('0x30')];_0x31ff9d[_0xd80e('0x31')]=_0x521aa4[_0xd80e('0x31')];_0x31ff9d[_0xd80e('0x32')]=_0x521aa4['dialOriginateCallerIdNumber'];_0x31ff9d['dialOriginateTimeout']=_0x521aa4[_0xd80e('0x33')];_0x31ff9d[_0xd80e('0x34')]=_0x521aa4[_0xd80e('0x34')];_0x31ff9d[_0xd80e('0x35')]=_0x521aa4[_0xd80e('0x35')];_0x31ff9d[_0xd80e('0x36')]=_0x521aa4[_0xd80e('0x36')];_0x31ff9d[_0xd80e('0x37')]=_0x521aa4['outboundAnswerCallsDay'];_0x31ff9d['outboundBlacklistCallsDay']=_0x521aa4[_0xd80e('0x38')];_0x31ff9d[_0xd80e('0x39')]=_0x521aa4[_0xd80e('0x39')];_0x31ff9d[_0xd80e('0x3a')]=_0x521aa4[_0xd80e('0x3a')];_0x31ff9d[_0xd80e('0x3b')]=_0x521aa4[_0xd80e('0x3b')];_0x31ff9d[_0xd80e('0x3c')]=_0x521aa4[_0xd80e('0x3c')];_0x31ff9d[_0xd80e('0x3d')]=_0x521aa4['outboundDropCallsDayTimeout'];_0x31ff9d[_0xd80e('0x3e')]=_0x521aa4['outboundNoAnswerCallsDay'];_0x31ff9d[_0xd80e('0x3f')]=_0x521aa4[_0xd80e('0x3f')];_0x31ff9d[_0xd80e('0x40')]=_0x521aa4[_0xd80e('0x40')];_0x31ff9d['outboundReCallsDay']=_0x521aa4[_0xd80e('0x41')];_0x31ff9d['outboundRejectCallsDay']=_0x521aa4[_0xd80e('0x42')];_0x31ff9d['outboundUnknownCallsDay']=_0x521aa4[_0xd80e('0x43')];_0x31ff9d[_0xd80e('0x44')]=_0x521aa4['predictiveIntervalAnsweredCalls'];_0x31ff9d[_0xd80e('0x45')]=_0x521aa4[_0xd80e('0x45')];_0x31ff9d[_0xd80e('0x46')]=_0x521aa4['predictiveIntervalAvgTalktime'];_0x31ff9d[_0xd80e('0x47')]=_0x521aa4[_0xd80e('0x47')];_0x31ff9d[_0xd80e('0x48')]=_0x521aa4[_0xd80e('0x48')];_0x31ff9d[_0xd80e('0x49')]=_0x521aa4[_0xd80e('0x49')];_0x31ff9d[_0xd80e('0x4a')]=_0x521aa4[_0xd80e('0x4a')];_0x31ff9d[_0xd80e('0x4b')]=_0x521aa4['predictiveIntervalHitRate'];_0x31ff9d['predictiveIntervalMultiplicativeFactor']=_0x521aa4['predictiveIntervalMultiplicativeFactor'];_0x31ff9d[_0xd80e('0x4c')]=_0x521aa4[_0xd80e('0x4c')];_0x31ff9d['predictiveIntervalAvailable']=_0x521aa4[_0xd80e('0x4d')];_0x31ff9d['predictiveIntervalTotalCalls']=_0x521aa4[_0xd80e('0x4e')];_0x31ff9d['message']=_0x521aa4[_0xd80e('0x1b')];_0x31ff9d[_0xd80e('0x4f')]=_0x521aa4['originated'];_0x31ff9d['erlangCalls']=_0x521aa4[_0xd80e('0x50')];_0x31ff9d[_0xd80e('0x51')]=_0x521aa4[_0xd80e('0x51')];_0x31ff9d[_0xd80e('0x52')]=_0x521aa4[_0xd80e('0x52')];_0x31ff9d[_0xd80e('0x53')]=_0x521aa4[_0xd80e('0x53')];_0x31ff9d[_0xd80e('0x54')]=_0x521aa4[_0xd80e('0x54')];_0x31ff9d[_0xd80e('0x55')]=_0x521aa4[_0xd80e('0x55')];}if(_0x521aa4[_0xd80e('0x56')]){_0x31ff9d[_0xd80e('0x56')]={'id':_0x521aa4[_0xd80e('0x56')]['id'],'name':_0x521aa4[_0xd80e('0x56')][_0xd80e('0xa')],'active':_0x521aa4['Trunk']['active'],'callerid':_0x521aa4['Trunk'][_0xd80e('0x57')]};}if(_0x521aa4['Interval']){_0x31ff9d[_0xd80e('0x58')]={'id':_0x521aa4[_0xd80e('0x58')]['id'],'name':_0x521aa4[_0xd80e('0x58')][_0xd80e('0xa')]};}_0x5b0d6d[_0xd80e('0x59')](_0x31ff9d);}}_0x170109({'count':_0x5b0d6d[_0xd80e('0x5a')],'rows':_0x5b0d6d});});},'UpdateVoiceQueue':function(_0x506fd0){return new Promise(function(_0x5cf97a,_0x4953ff){var _0x2ea201=_['find'](_0x3413d4[_0xd80e('0x21')],{'id':parseInt(_0x506fd0['id'])});var _0x3f866d=_[_0xd80e('0x5b')](_0x506fd0,['id']);if(_0x2ea201){for(var _0x4b5c8 in _0x3f866d){if(typeof _0x3f866d[_0x4b5c8]!==_0xd80e('0x5c')&&typeof _0x2ea201[_0x4b5c8]!=='undefined'){_0x2ea201[_0x4b5c8]=_0x3f866d[_0x4b5c8];}}_0x5cf97a(_0x2ea201);}else{_0x4953ff();}});},'VoiceChannels':function(){return new Promise(function(_0x98628c){var _0x4353f2=_[_0xd80e('0x5d')](_0x3413d4['channels']);_0x98628c({'count':_0x4353f2[_0xd80e('0x5a')],'rows':_0x4353f2});});},'VoiceChannelMixMonitor':function(_0x42ce0){var _0x1b9ee5=this;return new Promise(function(_0x52f536,_0x8d5cb8){if(ami[_0xd80e('0x1d')]()==![]){return _0x8d5cb8(_0x1b9ee5[_0xd80e('0x1c')](0x1f4,[config[_0xd80e('0x11')]['ip'],config[_0xd80e('0x11')][_0xd80e('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x275985=schema(properties[_0xd80e('0x5e')])[_0xd80e('0x2')](_0x42ce0);if(_0x275985['length']>0x0){return _0x8d5cb8(_0x1b9ee5['error'](0x1f4,_[_0xd80e('0x5f')](_0x275985,_0xd80e('0x1b'))[_0xd80e('0x14')](',\x20')));}var _0x1c0da8=_[_0xd80e('0x60')](_0x3413d4['channels'],{'uniqueid':_0x42ce0[_0xd80e('0x61')]});if(_0x1c0da8&&_0x1c0da8['channel']){var _0x46c781=util[_0xd80e('0x7')]('%s.%s',_0x42ce0[_0xd80e('0x62')]||_0x42ce0[_0xd80e('0x61')],_0x42ce0[_0xd80e('0x7')]||_0xd80e('0x63'));return ami[_0xd80e('0x19')]({'action':_0xd80e('0x64'),'channel':_0x1c0da8[_0xd80e('0x65')],'file':_0x46c781,'options':'ai(mixmonitorid)'})[_0xd80e('0x1a')](function(_0x377e68){var _0x419df7=_['find'](_0x1c0da8['monitors'],{'filename':_0xd80e('0x66')+_0x46c781[_0xd80e('0x67')]()});if(_[_0xd80e('0x68')](_0x419df7)){_0x1c0da8[_0xd80e('0x69')][_0xd80e('0x59')]({'filename':_0xd80e('0x66')+_0x46c781[_0xd80e('0x67')](),'createdAt':moment()[_0xd80e('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x377e68[_0xd80e('0x6a')],'status':'rec'});}else{_0x419df7[_0xd80e('0x6a')]=_0x377e68[_0xd80e('0x6a')];_0x419df7[_0xd80e('0x6b')]=_0xd80e('0x6c');}_0x52f536({'code':0xc8,'message':[_0x42ce0[_0xd80e('0x61')],_0xd80e('0x6d'),_0x377e68['mixmonitorid']][_0xd80e('0x14')]('\x20'),'mixmonitorid':_0x377e68['mixmonitorid']});})[_0xd80e('0x20')](function(_0x6e506){_0x8d5cb8(_0x1b9ee5['error'](0x1f5,[_0x42ce0['uniqueid'],_0x6e506[_0xd80e('0x1b')][_0xd80e('0x67')]()][_0xd80e('0x14')]('\x20')));});}else{return _0x8d5cb8(_0x1b9ee5['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1ba0ed){var _0x387561=this;return new Promise(function(_0x522df4,_0x386918){if(ami[_0xd80e('0x1d')]()==![]){return _0x386918(_0x387561[_0xd80e('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0xd80e('0x11')]['username'],_0xd80e('0x13')][_0xd80e('0x14')]('\x20')));}var _0x3d8e46=schema(properties[_0xd80e('0x5e')])['validate'](_0x1ba0ed);if(_0x3d8e46[_0xd80e('0x5a')]>0x0){return _0x386918(_0x387561['error'](0x1f4,_[_0xd80e('0x5f')](_0x3d8e46,'message')[_0xd80e('0x14')](',\x20')));}var _0x321a22=_[_0xd80e('0x60')](_0x3413d4[_0xd80e('0x6e')],{'uniqueid':_0x1ba0ed['uniqueid']});if(_0x321a22){return Promise[_0xd80e('0x6f')]()[_0xd80e('0x1a')](function(){if(_0x321a22['channel']){return ami[_0xd80e('0x19')]({'action':_0xd80e('0x70'),'channel':_0x321a22[_0xd80e('0x65')],'mixmonitorid':_0x1ba0ed[_0xd80e('0x6a')]})['catch'](function(){});}})[_0xd80e('0x1a')](function(){if(_0x321a22[_0xd80e('0x71')]){return ami['Action']({'action':_0xd80e('0x70'),'channel':_0x321a22[_0xd80e('0x71')],'mixmonitorid':_0x1ba0ed[_0xd80e('0x6a')]})['catch'](function(){});}})['then'](function(){var _0x4c9383=_['find'](_0x321a22[_0xd80e('0x69')],{'mixmonitorid':_0x1ba0ed['mixmonitorid']});if(_0x4c9383){_0x4c9383[_0xd80e('0x6b')]=_0xd80e('0x72');}})[_0xd80e('0x1a')](function(){var _0x4e1b08=util[_0xd80e('0x7')](_0xd80e('0x73'),_0x1ba0ed[_0xd80e('0x62')]||_0x1ba0ed[_0xd80e('0x61')],_0x1ba0ed[_0xd80e('0x7')]||_0xd80e('0x63'));var _0x385453=_[_0xd80e('0x60')](_0x321a22[_0xd80e('0x69')],{'filename':'/var/spool/asterisk/monitor/'+_0x4e1b08['toLowerCase']()});if(_0x385453){_0x385453[_0xd80e('0x6b')]=_0xd80e('0x72');}})[_0xd80e('0x1a')](function(){_0x522df4({'code':0xc8,'message':[_0x1ba0ed[_0xd80e('0x61')],'StopMixMonitor\x20Success'][_0xd80e('0x14')]('\x20')});})[_0xd80e('0x20')](function(_0x4fc21b){_0x386918(_0x387561[_0xd80e('0x1c')](0x1f5,[_0x1ba0ed[_0xd80e('0x61')],_0x4fc21b['message'][_0xd80e('0x67')]()][_0xd80e('0x14')]('\x20')));});}else{return _0x386918(_0x387561[_0xd80e('0x1c')](0x1f5,_0xd80e('0x74')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x53971e){var _0x215f2d=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0x75')]);_0x53971e({'count':_0x215f2d[_0xd80e('0x5a')],'rows':_0x215f2d});});},'VoiceQueuesChannel':function(_0x433782){var _0x1edcf4=this;return new Promise(function(_0x5cb11c,_0x3e3176){var _0x393fb6=schema(properties['voicequeuechannel'])[_0xd80e('0x2')](_0x433782);if(_0x393fb6[_0xd80e('0x5a')]>0x0){return _0x3e3176(_0x1edcf4[_0xd80e('0x1c')](0x1f4,_[_0xd80e('0x5f')](_0x393fb6,'message')[_0xd80e('0x14')](',\x20')));}var _0x571951=_[_0xd80e('0x60')](_0x3413d4[_0xd80e('0x75')],{'uniqueid':_0x433782[_0xd80e('0x61')]});if(_0x571951){_0x5cb11c(_0x571951);}else{return _0x3e3176(_0x1edcf4[_0xd80e('0x1c')](0x1f5,_0xd80e('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x55becf){var _0x1ad05c=this;return new Promise(function(_0x2fe14a,_0x25e86d){if(ami[_0xd80e('0x1d')]()==![]){return _0x25e86d(_0x1ad05c['error'](0x1f4,[config[_0xd80e('0x11')]['ip'],config[_0xd80e('0x11')]['username'],_0xd80e('0x13')][_0xd80e('0x14')]('\x20')));}var _0xd6e3b=schema(properties[_0xd80e('0x76')])[_0xd80e('0x2')](_0x55becf);if(_0xd6e3b[_0xd80e('0x5a')]>0x0){return _0x25e86d(_0x1ad05c['error'](0x1f4,_['map'](_0xd6e3b,_0xd80e('0x1b'))['join'](',\x20')));}var _0x58a38a=_[_0xd80e('0x60')](_0x3413d4[_0xd80e('0x75')],{'uniqueid':_0x55becf[_0xd80e('0x61')]});if(_0x58a38a&&_0x58a38a[_0xd80e('0x65')]){return ami[_0xd80e('0x19')]({'action':_0xd80e('0x77'),'channel':_0x58a38a[_0xd80e('0x65')]})[_0xd80e('0x1a')](function(_0x4b1856){_0x2fe14a({'code':0xc8,'message':[_0x55becf[_0xd80e('0x61')],_0x4b1856[_0xd80e('0x1b')][_0xd80e('0x67')]()][_0xd80e('0x14')]('\x20')});})['catch'](function(_0x192178){_0x25e86d(_0x1ad05c[_0xd80e('0x1c')](0x1f5,[_0x55becf['uniqueid'],_0x192178[_0xd80e('0x1b')][_0xd80e('0x67')]()]['join']('\x20')));});}else{return _0x25e86d(_0x1ad05c[_0xd80e('0x1c')](0x1f5,_0xd80e('0x74')));}});},'VoiceQueuesChannelRedirect':function(_0x472dd3){var _0x3fb194=this;return new Promise(function(_0x18299b,_0x18a6de){if(ami[_0xd80e('0x1d')]()==![]){return _0x18a6de(_0x3fb194[_0xd80e('0x1c')](0x1f4,[config[_0xd80e('0x11')]['ip'],config[_0xd80e('0x11')]['username'],_0xd80e('0x13')][_0xd80e('0x14')]('\x20')));}var _0x57ff82=schema(properties[_0xd80e('0x78')])[_0xd80e('0x2')](_0x472dd3);if(_0x57ff82[_0xd80e('0x5a')]>0x0){return _0x18a6de(_0x3fb194['error'](0x1f4,_[_0xd80e('0x5f')](_0x57ff82,'message')[_0xd80e('0x14')](',\x20')));}var _0x40d9b4=_[_0xd80e('0x60')](_0x3413d4[_0xd80e('0x75')],{'uniqueid':_0x472dd3[_0xd80e('0x61')]});if(_0x40d9b4&&_0x40d9b4['channel']){return ami[_0xd80e('0x19')]({'action':_0xd80e('0x79'),'channel':_0x40d9b4[_0xd80e('0x65')],'exten':_0x472dd3[_0xd80e('0x7a')],'context':_0x472dd3[_0xd80e('0x7b')]||_0x40d9b4[_0xd80e('0x7b')],'priority':0x1})[_0xd80e('0x1a')](function(_0x12ae3e){_0x18299b({'code':0xc8,'message':[_0x472dd3[_0xd80e('0x61')],_0x12ae3e[_0xd80e('0x1b')][_0xd80e('0x67')]()][_0xd80e('0x14')]('\x20')});})[_0xd80e('0x20')](function(_0x1873d2){_0x18a6de(_0x3fb194['error'](0x1f5,[_0x472dd3[_0xd80e('0x61')],_0x1873d2['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x18a6de(_0x3fb194[_0xd80e('0x1c')](0x1f5,_0xd80e('0x74')));}});},'Agents':function(_0x2d8f13){return new Promise(function(_0x2ae752){var _0x4983c2=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0xd')]);if(_0x2d8f13&&_0x2d8f13['id']){var _0x12f485=_['find'](_0x4983c2,function(_0x4dc91f){return _0x4dc91f['id']===_0x2d8f13['id'];});_0x2ae752(_0x12f485);}else{_0x2ae752({'count':_0x4983c2[_0xd80e('0x5a')],'rows':_0x4983c2});}});},'Telephones':function(){return new Promise(function(_0x5ad79d){var _0x51ffa0=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0x7c')]);_0x5ad79d({'count':_0x51ffa0[_0xd80e('0x5a')],'rows':_0x51ffa0});});},'Trunks':function(){return new Promise(function(_0x442f3b){var _0x32d445=_[_0xd80e('0x5d')](_0x3413d4['trunks']);_0x442f3b({'count':_0x32d445['length'],'rows':_0x32d445});});},'OutboundChannels':function(){return new Promise(function(_0x50af3b){var _0x1d1561=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0x7d')]);_0x50af3b({'count':_0x1d1561[_0xd80e('0x5a')],'rows':_0x1d1561});});},'Outbound':function(){return new Promise(function(_0x2355e3){_0x2355e3(_0x3413d4[_0xd80e('0x7e')]);});},'Campaigns':function(){return new Promise(function(_0x2c3ec9){var _0x444ce1=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0x7f')]);_0x2c3ec9({'count':_0x444ce1[_0xd80e('0x5a')],'rows':_0x444ce1});});},'VoiceQueuesPreview':function(_0x201f42){var _0xebea83=this;return new Promise(function(_0x4cecdb,_0x16abdc){_0x5ae6c6[_0xd80e('0x80')](_0x201f42['id'])[_0xd80e('0x1a')](function(_0x2e8124){_0x4cecdb({'code':0xc8,'message':_0x2e8124[_0xd80e('0x1b')]});})[_0xd80e('0x20')](function(_0x34fcb2){_0x16abdc(_0xebea83[_0xd80e('0x1c')](0x1f4,_0x34fcb2[_0xd80e('0x1b')]));});});},'EventManager':function(_0xa0dfd8){var _0x57ec15=this;return new Promise(function(_0x364af6,_0x44656f){if(!_0xa0dfd8[_0xd80e('0x81')]){return _0x44656f(_0x57ec15[_0xd80e('0x1c')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0xa0dfd8[_0xd80e('0x81')],_0xa0dfd8[_0xd80e('0x1b')]);_0x364af6({'code':0xc8,'message':_0xa0dfd8});});},'FaxAccounts':function(){return new Promise(function(_0x5a9bdc){var _0xb5b831=_[_0xd80e('0x5d')](_0x3413d4[_0xd80e('0x82')]);_0x5a9bdc({'count':_0xb5b831['length'],'rows':_0xb5b831});});},'SendFax':function(_0x3a98aa){var _0x5b8a23=this;return new Promise(function(_0x145c93,_0x247ebc){_0x26e6ff['send'](_0x3a98aa)[_0xd80e('0x1a')](function(_0x946afe){_0x145c93({'code':0xc8,'message':_0x946afe[_0xd80e('0x1b')]});})[_0xd80e('0x20')](function(_0x511baa){_0x247ebc(_0x5b8a23[_0xd80e('0x1c')](0x1f4,_0x511baa['message']));});});},'CheckAfterSend':function(_0x120907){var _0x39721f=this;return new Promise(function(_0x3b7a11,_0x3b730e){_0x26e6ff[_0xd80e('0x83')](_0x120907)[_0xd80e('0x1a')](function(_0x1782d2){_0x3b7a11({'code':0xc8,'message':_0x1782d2[_0xd80e('0x1b')]});})[_0xd80e('0x20')](function(_0x2003f4){_0x3b730e(_0x39721f[_0xd80e('0x1c')](0x1f4,_0x2003f4['message']));});});}};var _0x4f02f8=jayson['server'](_0x51c361)[_0xd80e('0x84')]();_0x4f02f8['on'](_0xd80e('0x1c'),function(_0x1b6eec){return _0x252fec(_0x1b6eec);});_0x4f02f8[_0xd80e('0x6')](0x232a,_0xd80e('0x85'),function(){console[_0xd80e('0x86')](_0xd80e('0x87'),0x232a);return _0x2b4742(_0xd80e('0x88')+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 4c61334..60dec28 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 _0x98f1=['calleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','destcalleridname','format','user:%s','name','trigger:%s','action','toLowerCase','length','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','data3','split','phone','map','calleridnum','routeId','destcalleridnum','firstName','lastName','ListId','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil'];(function(_0x2b80f7,_0x114fd1){var _0x4638eb=function(_0x561c6a){while(--_0x561c6a){_0x2b80f7['push'](_0x2b80f7['shift']());}};_0x4638eb(++_0x114fd1);}(_0x98f1,0x1cf));var _0x198f=function(_0x2e8935,_0x15d23b){_0x2e8935=_0x2e8935-0x0;var _0x57b7f5=_0x98f1[_0x2e8935];return _0x57b7f5;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x198f('0x0'));var util=require(_0x198f('0x1'));var config=require(_0x198f('0x2'));var logger=require(_0x198f('0x3'))(_0x198f('0x4'));var cmContactRpc=require(_0x198f('0x5'));config['redis']=_[_0x198f('0x6')](config[_0x198f('0x7')],{'host':_0x198f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x198f('0x7')]));function emit(_0x193097,_0x387f25,_0x5f55ad,_0x36474d,_0x48d681){logger[_0x198f('0x9')](_0x198f('0xa'),_0x193097,_0x387f25['id'],_0x5f55ad,_0x36474d,JSON[_0x198f('0xb')](_0x48d681));io['to'](_0x5f55ad)[_0x198f('0xc')](_0x36474d,_0x48d681);}exports[_0x198f('0xd')]=function(_0x10ad77,_0x41adf3,_0x1e67b0,_0x28bff5){var _0x2d3e90,_0x29d102;var _0x1a2933={};var _0x4c1728;var _0x254c70=Number(_0x1e67b0[_0x198f('0xe')]);var _0x3e1fc7=_0x1e67b0[_0x198f('0xf')]?Boolean(Number(_0x1e67b0[_0x198f('0xf')])):![];var _0x1332ec;var _0x426f29=![];if(!_['isNil'](_0x1e67b0[_0x198f('0x10')])){if(_0x1e67b0[_0x198f('0x10')]=='1')_0x426f29=!![];}if(!_0x426f29){if(_0x28bff5['xmd-contactid']){_0x1a2933['id']=_0x28bff5[_0x198f('0x11')];}}if(!_0x1a2933['id']){_0x1a2933['ListId']=_0x254c70;_0x1332ec=_0x1e67b0['data3']&&_0x1e67b0[_0x198f('0x12')]!=='0'?_0x1e67b0['data3'][_0x198f('0x13')](','):[_0x198f('0x14')];_0x1a2933['$or']=_[_0x198f('0x15')](_0x1332ec,function(_0x498f4b){var _0x1075ab={};_0x1075ab[_0x498f4b]=_0x28bff5['routeId']?_0x28bff5['destcalleridnum']:_0x28bff5[_0x198f('0x16')];return _0x1075ab;});_0x4c1728=_0x28bff5[_0x198f('0x17')]?_0x28bff5[_0x198f('0x18')]:_0x28bff5[_0x198f('0x16')];}var _0x5eba0a=['id',_0x198f('0x19'),_0x198f('0x1a'),_0x198f('0x14'),'mobile','fax',_0x198f('0x1b'),_0x198f('0x1c'),'scheduledAt',_0x198f('0x1d')];var _0x2089d2=_[_0x198f('0x1e')](_0x5eba0a,_0x1332ec);BPromise[_0x198f('0x1f')]()[_0x198f('0x20')](cmContactRpc[_0x198f('0x21')]({'attributes':_0x2089d2,'where':_0x1a2933,'phone':_0x4c1728}))[_0x198f('0x20')](function(_0x313e92){_0x29d102=_0x313e92;if(!_[_0x198f('0x22')](_0x29d102)){if(_0x29d102['length']===0x1){_0x2d3e90=_0x29d102[0x0];logger[_0x198f('0x9')](_0x198f('0x23'),_0x28bff5[_0x198f('0x24')],_0x41adf3['id'],_0x2d3e90['id']);}else{logger[_0x198f('0x9')](_0x198f('0x25'),_0x28bff5['uniqueid'],_0x41adf3['id'],_[_0x198f('0x15')](_0x29d102,'id')[_0x198f('0x26')](','));}return;}else{logger[_0x198f('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x28bff5[_0x198f('0x24')],_0x41adf3['id']);var _0x511c32={'ListId':_0x254c70};var _0x4d03c2=_0x1e67b0[_0x198f('0x27')]&&_0x1e67b0[_0x198f('0x27')]!=='0'?_0x1e67b0[_0x198f('0x27')]:'phone';if(_0x3e1fc7){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x28bff5['uniqueid'],_0x41adf3['id']);_0x511c32[_0x4d03c2]=_[_0x198f('0x28')](_0x28bff5['routeId'])?_0x28bff5[_0x198f('0x16')]:_0x28bff5[_0x198f('0x18')];if(_[_0x198f('0x28')](_0x28bff5[_0x198f('0x17')])){_0x511c32['firstName']=_0x28bff5[_0x198f('0x29')]&&_0x28bff5[_0x198f('0x29')]!==_0x198f('0x2a')?_0x28bff5[_0x198f('0x29')]:'Unknown';}else{_0x511c32[_0x198f('0x19')]=_0x28bff5['destcalleridname']&&_0x28bff5['destcalleridname']!==_0x198f('0x2a')?_0x28bff5['destcalleridname']:'Unknown';}return BPromise[_0x198f('0x1f')]()[_0x198f('0x20')](cmContactRpc[_0x198f('0x2b')](_0x511c32))[_0x198f('0x20')](function(_0xb436af){_0x2d3e90=_0xb436af;_0x29d102[_0x198f('0x2c')](_0xb436af);if(_0x2d3e90){logger[_0x198f('0x9')](_0x198f('0x2d'),_0x28bff5[_0x198f('0x24')],_0x41adf3['id'],_0x2d3e90['id']);}return;});}else{logger[_0x198f('0x9')](_0x198f('0x2e'),_0x28bff5[_0x198f('0x24')],_0x41adf3['id']);_0x511c32[_0x4d03c2]=_[_0x198f('0x28')](_0x28bff5['routeId'])?_0x28bff5[_0x198f('0x16')]:_0x28bff5[_0x198f('0x18')];if(_[_0x198f('0x28')](_0x28bff5['routeId'])){_0x511c32[_0x198f('0x19')]=_0x28bff5['calleridname']&&_0x28bff5[_0x198f('0x29')]!==''?_0x28bff5[_0x198f('0x29')]:_0x198f('0x2f');}else{_0x511c32[_0x198f('0x19')]=_0x28bff5[_0x198f('0x30')]&&_0x28bff5[_0x198f('0x30')]!==_0x198f('0x2a')?_0x28bff5[_0x198f('0x30')]:_0x198f('0x2f');}_0x2d3e90=_0x511c32;_0x29d102[_0x198f('0x2c')](_0x511c32);return;}}})[_0x198f('0x20')](function(){if(_0x10ad77){emit(_0x28bff5[_0x198f('0x24')],_0x41adf3,util[_0x198f('0x31')](_0x198f('0x32'),_0x10ad77[_0x198f('0x33')]),util[_0x198f('0x31')](_0x198f('0x34'),_0x1e67b0[_0x198f('0x35')][_0x198f('0x36')]()),{'evt':_['merge'](_0x28bff5,{'autoCreate':_0x3e1fc7}),'contact':_0x2d3e90===undefined?{}:_0x2d3e90,'contacts':_0x29d102[_0x198f('0x37')]===0x0?undefined:_0x29d102});}});}; \ No newline at end of file +var _0x5432=['lastName','mobile','fax','scheduledAt','union','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','format','trigger:%s','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','phone','$or','routeId','calleridnum','destcalleridnum','firstName'];(function(_0x5717d8,_0x52e576){var _0x51eacb=function(_0x469b61){while(--_0x469b61){_0x5717d8['push'](_0x5717d8['shift']());}};_0x51eacb(++_0x52e576);}(_0x5432,0xc8));var _0x2543=function(_0x50de14,_0x39bf59){_0x50de14=_0x50de14-0x0;var _0x8a186e=_0x5432[_0x50de14];return _0x8a186e;};'use strict';var _=require(_0x2543('0x0'));var BPromise=require(_0x2543('0x1'));var Redis=require(_0x2543('0x2'));var util=require(_0x2543('0x3'));var config=require(_0x2543('0x4'));var logger=require(_0x2543('0x5'))(_0x2543('0x6'));var cmContactRpc=require(_0x2543('0x7'));config[_0x2543('0x8')]=_[_0x2543('0x9')](config[_0x2543('0x8')],{'host':_0x2543('0xa'),'port':0x18eb});var io=require(_0x2543('0xb'))(new Redis(config['redis']));function emit(_0x24d480,_0x989700,_0x338089,_0x9d3609,_0x457028){logger[_0x2543('0xc')](_0x2543('0xd'),_0x24d480,_0x989700['id'],_0x338089,_0x9d3609,JSON[_0x2543('0xe')](_0x457028));io['to'](_0x338089)['emit'](_0x9d3609,_0x457028);}exports[_0x2543('0xf')]=function(_0x2ba8cf,_0x54f1cc,_0x16ec48,_0x2f4c91){var _0x5eef94,_0x2a47cf;var _0x32ca5d={};var _0x1a9349;var _0xc85a26=Number(_0x16ec48[_0x2543('0x10')]);var _0x54ea21=_0x16ec48[_0x2543('0x11')]?Boolean(Number(_0x16ec48[_0x2543('0x11')])):![];var _0xf982fb;var _0x5f3d01=![];if(!_[_0x2543('0x12')](_0x16ec48[_0x2543('0x13')])){if(_0x16ec48[_0x2543('0x13')]=='1')_0x5f3d01=!![];}if(!_0x5f3d01){if(_0x2f4c91['xmd-contactid']){_0x32ca5d['id']=_0x2f4c91['xmd-contactid'];}}if(!_0x32ca5d['id']){_0x32ca5d[_0x2543('0x14')]=_0xc85a26;_0xf982fb=_0x16ec48[_0x2543('0x15')]&&_0x16ec48['data3']!=='0'?_0x16ec48[_0x2543('0x15')]['split'](','):[_0x2543('0x16')];_0x32ca5d[_0x2543('0x17')]=_['map'](_0xf982fb,function(_0x238287){var _0x5be3d2={};_0x5be3d2[_0x238287]=_0x2f4c91[_0x2543('0x18')]?_0x2f4c91['destcalleridnum']:_0x2f4c91[_0x2543('0x19')];return _0x5be3d2;});_0x1a9349=_0x2f4c91['routeId']?_0x2f4c91[_0x2543('0x1a')]:_0x2f4c91[_0x2543('0x19')];}var _0x34310f=['id',_0x2543('0x1b'),_0x2543('0x1c'),'phone',_0x2543('0x1d'),_0x2543('0x1e'),_0x2543('0x14'),'createdAt',_0x2543('0x1f'),'updatedAt'];var _0x2cf269=_[_0x2543('0x20')](_0x34310f,_0xf982fb);BPromise['resolve']()[_0x2543('0x21')](cmContactRpc['getContacts']({'attributes':_0x2cf269,'where':_0x32ca5d,'phone':_0x1a9349}))[_0x2543('0x21')](function(_0x37b5d0){_0x2a47cf=_0x37b5d0;if(!_[_0x2543('0x22')](_0x2a47cf)){if(_0x2a47cf[_0x2543('0x23')]===0x1){_0x5eef94=_0x2a47cf[0x0];logger['info'](_0x2543('0x24'),_0x2f4c91[_0x2543('0x25')],_0x54f1cc['id'],_0x5eef94['id']);}else{logger[_0x2543('0xc')](_0x2543('0x26'),_0x2f4c91['uniqueid'],_0x54f1cc['id'],_[_0x2543('0x27')](_0x2a47cf,'id')[_0x2543('0x28')](','));}return;}else{logger[_0x2543('0xc')](_0x2543('0x29'),_0x2f4c91['uniqueid'],_0x54f1cc['id']);var _0x5d068b={'ListId':_0xc85a26};var _0x2bb56f=_0x16ec48[_0x2543('0x2a')]&&_0x16ec48[_0x2543('0x2a')]!=='0'?_0x16ec48[_0x2543('0x2a')]:_0x2543('0x16');if(_0x54ea21){logger[_0x2543('0xc')](_0x2543('0x2b'),_0x2f4c91[_0x2543('0x25')],_0x54f1cc['id']);_0x5d068b[_0x2bb56f]=_[_0x2543('0x12')](_0x2f4c91[_0x2543('0x18')])?_0x2f4c91['calleridnum']:_0x2f4c91[_0x2543('0x1a')];if(_[_0x2543('0x12')](_0x2f4c91[_0x2543('0x18')])){_0x5d068b[_0x2543('0x1b')]=_0x2f4c91[_0x2543('0x2c')]&&_0x2f4c91[_0x2543('0x2c')]!==_0x2543('0x2d')?_0x2f4c91[_0x2543('0x2c')]:_0x2543('0x2e');}else{_0x5d068b['firstName']=_0x2f4c91['destcalleridname']&&_0x2f4c91[_0x2543('0x2f')]!==_0x2543('0x2d')?_0x2f4c91['destcalleridname']:_0x2543('0x2e');}return BPromise[_0x2543('0x30')]()[_0x2543('0x21')](cmContactRpc[_0x2543('0x31')](_0x5d068b))[_0x2543('0x21')](function(_0x4e68e5){_0x5eef94=_0x4e68e5;_0x2a47cf[_0x2543('0x32')](_0x4e68e5);if(_0x5eef94){logger[_0x2543('0xc')](_0x2543('0x33'),_0x2f4c91['uniqueid'],_0x54f1cc['id'],_0x5eef94['id']);}return;});}else{logger[_0x2543('0xc')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2f4c91[_0x2543('0x25')],_0x54f1cc['id']);_0x5d068b[_0x2bb56f]=_[_0x2543('0x12')](_0x2f4c91[_0x2543('0x18')])?_0x2f4c91[_0x2543('0x19')]:_0x2f4c91[_0x2543('0x1a')];if(_[_0x2543('0x12')](_0x2f4c91[_0x2543('0x18')])){_0x5d068b[_0x2543('0x1b')]=_0x2f4c91[_0x2543('0x2c')]&&_0x2f4c91['calleridname']!==''?_0x2f4c91['calleridname']:'Unknown';}else{_0x5d068b[_0x2543('0x1b')]=_0x2f4c91[_0x2543('0x2f')]&&_0x2f4c91[_0x2543('0x2f')]!==_0x2543('0x2d')?_0x2f4c91[_0x2543('0x2f')]:'Unknown';}_0x5eef94=_0x5d068b;_0x2a47cf['push'](_0x5d068b);return;}}})['then'](function(){if(_0x2ba8cf){emit(_0x2f4c91['uniqueid'],_0x54f1cc,util['format'](_0x2543('0x34'),_0x2ba8cf[_0x2543('0x35')]),util[_0x2543('0x36')](_0x2543('0x37'),_0x16ec48['action']['toLowerCase']()),{'evt':_[_0x2543('0x38')](_0x2f4c91,{'autoCreate':_0x54ea21}),'contact':_0x5eef94===undefined?{}:_0x5eef94,'contacts':_0x2a47cf[_0x2543('0x23')]===0x0?undefined:_0x2a47cf});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e9ce8bd..1a3e73a 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 _0x276d=['templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:dialconnect','syncAgentDial','custom:dialend','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','checkTrigger','variables','Actions','length','action','contactmanager','motionbar','data2','html','template\x20not\x20found','uri','data3','isNil','location','uriLocation','data4','windowWidth','data5','data6','600','winApplication','winArguments','format','user:%s','interface','name','trigger:%s:%s','toLowerCase','merge','jscripty','trigger:%s','data1','exec','script','buildUri','parse','render','replace','channel','AllConditions','every','checkConditions','AnyConditions','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','event','queue','agent','membername','lastevent','routeId','null','substatus','offlineMessage','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues'];(function(_0x48ccc1,_0x55e9cb){var _0x9ffe13=function(_0x323a36){while(--_0x323a36){_0x48ccc1['push'](_0x48ccc1['shift']());}};_0x9ffe13(++_0x55e9cb);}(_0x276d,0xe3));var _0xd276=function(_0x1b4f9e,_0x650bd1){_0x1b4f9e=_0x1b4f9e-0x0;var _0x52ced4=_0x276d[_0x1b4f9e];return _0x52ced4;};'use strict';var util=require(_0xd276('0x0'));var _=require(_0xd276('0x1'));var url=require('url');var Mustache=require(_0xd276('0x2'));var Redis=require(_0xd276('0x3'));var urlforward=require(_0xd276('0x4'));var integration=require(_0xd276('0x5'));var cmContact=require(_0xd276('0x6'));var script=require(_0xd276('0x7'));var config=require('../../../config/environment');var logger=require(_0xd276('0x8'))(_0xd276('0x9'));var ami=require(_0xd276('0xa'));config[_0xd276('0xb')]=_[_0xd276('0xc')](config[_0xd276('0xb')],{'host':_0xd276('0xd'),'port':0x18eb});var io=require(_0xd276('0xe'))(new Redis(config[_0xd276('0xb')]));var operators={'equals':function(_0x2df541,_0x3b7129){return _0x2df541==_0x3b7129;},'not_equals':function(_0x1ae393,_0x388214){return _0x1ae393!=_0x388214;}};var barAndWebActions=[_0xd276('0xf'),_0xd276('0x10'),_0xd276('0x11')];function Trigger(_0x185c26){this['triggers']=_0x185c26[_0xd276('0x12')];this[_0xd276('0x13')]=_0x185c26[_0xd276('0x13')];this['voiceQueues']=_0x185c26[_0xd276('0x14')];this['templates']=_0x185c26[_0xd276('0x15')];this[_0xd276('0x16')]=_0x185c26[_0xd276('0x16')];this[_0xd276('0x17')]=_0x185c26[_0xd276('0x17')];this[_0xd276('0x18')]=_0x185c26['freshdeskAccounts'];this[_0xd276('0x19')]=_0x185c26[_0xd276('0x19')];this['sugarcrmAccounts']=_0x185c26[_0xd276('0x1a')];this['zohoAccounts']=_0x185c26[_0xd276('0x1b')];this['deskAccounts']=_0x185c26[_0xd276('0x1c')];this['vtigerAccounts']=_0x185c26['vtigerAccounts'];this[_0xd276('0x1d')]=_0x185c26[_0xd276('0x1d')];this[_0xd276('0x1e')]=_0x185c26[_0xd276('0x1e')];this[_0xd276('0x1f')]=_0x185c26[_0xd276('0x1f')];this[_0xd276('0x20')]={'zendesk':this[_0xd276('0x17')],'salesforce':this[_0xd276('0x19')],'freshdesk':this[_0xd276('0x18')],'sugarcrm':this[_0xd276('0x1a')],'zoho':this[_0xd276('0x1b')],'desk':this[_0xd276('0x1c')],'vtiger':this[_0xd276('0x21')],'dynamics365':this[_0xd276('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xd276('0x1d')]};ami['on']('custom:agentcalled',this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x24'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x25'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x26'),this[_0xd276('0x22')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x27'),this['syncCustomEvent'][_0xd276('0x23')](this));ami['on'](_0xd276('0x28'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x29'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x2a'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on']('custom:amd',this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x2b'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on']('custom:timeout',this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0xd276('0x23')](this));ami['on'](_0xd276('0x2c'),this[_0xd276('0x2d')][_0xd276('0x23')](this));ami['on'](_0xd276('0x2e'),this[_0xd276('0x2d')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0xd276('0x23')](this));ami['on']('custom:closedinteraction',this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x2f'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x30'),this['syncCustomEvent'][_0xd276('0x23')](this));ami['on'](_0xd276('0x31'),this[_0xd276('0x22')]['bind'](this));ami['on'](_0xd276('0x32'),this[_0xd276('0x22')]['bind'](this));ami['on'](_0xd276('0x33'),this[_0xd276('0x22')][_0xd276('0x23')](this));ami['on'](_0xd276('0x34'),this[_0xd276('0x22')][_0xd276('0x23')](this));}Trigger['prototype'][_0xd276('0x35')]=function(_0x13336d,_0x5d7180,_0x2dff24){logger[_0xd276('0x36')](_0x13336d,_0x5d7180,JSON[_0xd276('0x37')](_0x2dff24));io['to'](_0x13336d)[_0xd276('0x35')](_0x5d7180,_0x2dff24);};Trigger[_0xd276('0x38')][_0xd276('0x22')]=function(_0xfb50f5){var _0x15615c=_[_0xd276('0x39')](_0xfb50f5);if(typeof _0x15615c[_0xd276('0x3a')]===_0xd276('0x3b')){_0x15615c[_0xd276('0x3a')]=_0xd276('0x3c');}this['checkTriggers'](_0x15615c);};Trigger[_0xd276('0x38')][_0xd276('0x2d')]=function(_0x56b82f){if(this[_0xd276('0x13')][_0x56b82f['interface']]){this['syncCustomEvent'](_0x56b82f);}};Trigger[_0xd276('0x38')][_0xd276('0x3d')]=function(_0x492d8e){var _0x5071e0;for(var _0x2ae16a in this[_0xd276('0x12')]){if(this['triggers']['hasOwnProperty'](_0x2ae16a)){if(this[_0xd276('0x12')][_0x2ae16a]['status']){_0x5071e0=this[_0xd276('0x3e')](this[_0xd276('0x12')][_0x2ae16a],_0x492d8e);if(_0x5071e0){_['merge'](_0x492d8e,_0x492d8e[_0xd276('0x3f')]);for(var _0x8c96be=0x0,_0x2b75b6,_0x4a1303,_0x8f1c62;_0x8c96be0x0){_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 _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x326f,0xd1));var _0xf326=function(_0x104c2f,_0x3561b3){_0x104c2f=_0x104c2f-0x0;var _0x31ae0c=_0x326f[_0x104c2f];return _0x31ae0c;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 7d7e75f..57920c6 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 _0xd22b=['length','internalemailaddress','info',']\x20Agent\x20found\x20','userId','systemuserid','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','lastIndexOf','enduserId','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','substring','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','odata-entityid','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','data7','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data2','resolve','data5','POST','clientId','remoteUri','username','password','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email'];(function(_0x6ad2c7,_0xb22a9a){var _0x435d5f=function(_0x38ec10){while(--_0x38ec10){_0x6ad2c7['push'](_0x6ad2c7['shift']());}};_0x435d5f(++_0xb22a9a);}(_0xd22b,0x126));var _0xbd22=function(_0xf26ae2,_0x4bef7f){_0xf26ae2=_0xf26ae2-0x0;var _0x486601=_0xd22b[_0xf26ae2];return _0x486601;};'use strict';var _=require('lodash');var rp=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var intUtil=require(_0xbd22('0x2'));var md5=require(_0xbd22('0x3'));var Redis=require(_0xbd22('0x4'));var logger=require(_0xbd22('0x5'))(_0xbd22('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0xbd22('0x7')](config[_0xbd22('0x8')],{'host':_0xbd22('0x9'),'port':0x18eb});var io=require(_0xbd22('0xa'))(new Redis(config['redis']));function getAuthToken(_0x31d54f,_0x52b0a6,_0x2f42d9){if(_0x31d54f[_0xbd22('0xb')]){_0x31d54f['remoteUri']=_0x31d54f[_0xbd22('0xc')]['data7'];_0x31d54f['tenantId']=_0x31d54f[_0xbd22('0xc')][_0xbd22('0xd')];return Promise[_0xbd22('0xe')](_0x31d54f[_0xbd22('0xc')][_0xbd22('0xf')]);}var _0x4d6d80={'method':_0xbd22('0x10'),'uri':_0x52b0a6,'form':{'client_id':_0x31d54f[_0xbd22('0x11')],'resource':_0x31d54f[_0xbd22('0x12')],'username':_0x31d54f[_0xbd22('0x13')],'password':_0x31d54f['password'],'grant_type':_0xbd22('0x14'),'client_secret':_0x31d54f['clientSecret']},'json':!![]};return rp(_0x4d6d80)['then'](function(_0x44ed61){return _0x44ed61[_0xbd22('0x15')];})[_0xbd22('0x16')](function(_0x2c2e37){logger[_0xbd22('0x17')]('['+[_0x2f42d9[_0xbd22('0x18')]()]+_0xbd22('0x19'));return _0x2c2e37[_0xbd22('0x1a')];});}function getUser(_0x137f0a,_0x232339,_0x1c0db4,_0x1f01df,_0xac62e0,_0x12b3b7){return new Promise(function(_0x15a9fb,_0x2f99c9){return getAuthToken(_0x232339,_0x1f01df,_0x12b3b7)[_0xbd22('0x1b')](function(_0x2b9ac0){var _0x2d6eba={'method':_0xbd22('0x1c'),'uri':_0xac62e0+_0xbd22('0x1d'),'headers':{'Authorization':_0xbd22('0x1e')+_0x2b9ac0,'OData-Version':_0xbd22('0x1f')},'json':!![]};return rp(_0x2d6eba);})['then'](function(_0x360e1d){var _0x486c44=_0x360e1d[_0xbd22('0x20')];var _0x3945e7=![];var _0x189002=null;if(!_[_0xbd22('0x21')](_0x1c0db4)){if(intUtil[_0xbd22('0x22')](_0x1c0db4[_0xbd22('0x23')])){_0x137f0a['userEmail']=_0x1c0db4[_0xbd22('0x23')];for(_0x189002=0x0;_0x189002<_0x486c44[_0xbd22('0x24')];_0x189002++){if(_0x486c44[_0x189002][_0xbd22('0x25')]===_0x1c0db4[_0xbd22('0x23')]&&!_0x486c44[_0x189002]['isdisabled']){_0x3945e7=!![];logger[_0xbd22('0x26')]('['+[_0x12b3b7[_0xbd22('0x18')]()]+_0xbd22('0x27')+_0x486c44[_0x189002]['systemuserid']+'!');_0x137f0a[_0xbd22('0x28')]=_0x486c44[_0x189002][_0xbd22('0x29')];}}}}if(!_0x3945e7){logger['info']('['+[_0x12b3b7[_0xbd22('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x137f0a[_0xbd22('0x2a')]=_0x232339['username'];for(_0x189002=0x0;_0x189002<_0x486c44[_0xbd22('0x24')];_0x189002++){if(_0x486c44[_0x189002][_0xbd22('0x25')]===_0x232339['username']){_0x137f0a[_0xbd22('0x28')]=_0x486c44[_0x189002][_0xbd22('0x29')];}}}_0x15a9fb(_0x137f0a);})['catch'](function(_0x19bfb2){_0x2f99c9(_0x19bfb2['message']);});});}function createEndUser(_0x42aa3b,_0x498180,_0x47ff92,_0xac7d62,_0xd32414,_0x56b2c0,_0x32b1dd){return new Promise(function(_0x75c64b,_0x2ae74e){return getAuthToken(_0x498180,_0x47ff92,_0x56b2c0)[_0xbd22('0x1b')](function(_0xcba0ae){var _0x54eb17=_0x56b2c0[_0xbd22('0x2b')]()===_0xbd22('0x2c')?_0xd32414[_0xbd22('0x2d')]:_0xd32414[_0xbd22('0x2e')];var _0x3d4e9f={'method':_0xbd22('0x10'),'uri':_0xac7d62+_0xbd22('0x2f'),'body':{'fullname':_0x54eb17,'firstname':_0x54eb17,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbd22('0x30')+_0x42aa3b[_0xbd22('0x28')]+')'},'headers':{'Authorization':_0xbd22('0x1e')+_0xcba0ae,'OData-Version':_0xbd22('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x3d4e9f['body'][_0x32b1dd]=_0x54eb17;return rp(_0x3d4e9f);})['then'](function(_0xe786cf){var _0x47943c=_0xe786cf['headers']['odata-entityid'];var _0x40f81d=_0x47943c['substring'](_0x47943c[_0xbd22('0x31')]('(')+0x1,_0x47943c[_0xbd22('0x31')](')'));_0x42aa3b[_0xbd22('0x32')]=_0x40f81d;_0x75c64b(_0x42aa3b);})['catch'](function(_0x484658){_0x2ae74e(_0x484658[_0xbd22('0x1a')]);});});}function getEndUser(_0x2a55ca,_0x3385b2,_0x559eed,_0xe1be4c,_0x40437e,_0x3036f8,_0x49fa64,_0x5db7b1){var _0x2b3789=_0x3036f8[_0xbd22('0x2b')]()===_0xbd22('0x2c')?_0x40437e['destcalleridnum']:_0x40437e[_0xbd22('0x2e')];return getAuthToken(_0x3385b2,_0x559eed,_0x3036f8)[_0xbd22('0x1b')](function(_0xb690ed){_0x5db7b1=_0x5db7b1?_0x5db7b1:_0xbd22('0x33');var _0x13382e={'method':'GET','uri':_0xe1be4c+_0xbd22('0x34')+_0x5db7b1+'&$filter='+_0x5db7b1+_0xbd22('0x35')+_0x2b3789[_0xbd22('0x36')]('+',_0xbd22('0x37'))+'\x27','headers':{'Authorization':_0xbd22('0x1e')+_0xb690ed,'If-None-Match':null,'OData-Version':_0xbd22('0x1f')},'json':!![]};return rp(_0x13382e);})['then'](function(_0x510b55){var _0x142e18=![];if(!_0x510b55)return _0x142e18;var _0x1dc41a=_0x510b55[_0xbd22('0x20')];for(var _0x3ae398=0x0;_0x3ae398<_0x1dc41a['length'];_0x3ae398++){if(_0x1dc41a[_0x3ae398][_0x5db7b1]===_0x2b3789){_0x142e18=!![];_0x2a55ca[_0xbd22('0x32')]=_0x1dc41a[_0x3ae398]['contactid'];}}return _0x142e18;})[_0xbd22('0x1b')](function(_0x579cb3){if(_0x579cb3)return _0x2a55ca;if(_0x49fa64===_0xbd22('0x38')){logger[_0xbd22('0x26')]('['+[_0x3036f8['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x2a55ca;}return createEndUser(_0x2a55ca,_0x3385b2,_0x559eed,_0xe1be4c,_0x40437e,_0x3036f8,_0x5db7b1)['then'](function(_0x296c7f){logger[_0xbd22('0x26')]('['+[_0x3036f8[_0xbd22('0x18')]()]+_0xbd22('0x39'),_0x296c7f['enduserId']);return _0x296c7f;});});}function getCustomFields(_0x2dd21e,_0x57edee,_0x87d9f7){var _0x2c2ef1={};if(_0x2dd21e[_0xbd22('0x24')]>0x0){_[_0xbd22('0x3a')](_0x2dd21e,function(_0x629447){if(_[_0xbd22('0x3b')]([_0xbd22('0x3c'),_0xbd22('0x3d')],_0x629447[_0xbd22('0x3e')])&&_0x629447[_0xbd22('0x3f')]&&!_0x629447[_0xbd22('0x40')]){var _0x5aff9c=_0x629447[_0xbd22('0x41')][_0xbd22('0x2b')]();var _0x299ddc=_0x5aff9c[_0xbd22('0x42')](0x0,_0x5aff9c[_0xbd22('0x43')]('_'));var _0x1da96a=_0x5aff9c[_0xbd22('0x42')](_0x5aff9c[_0xbd22('0x43')]('_')+0x1);if(_0x299ddc===_0x87d9f7){_0x2c2ef1[_0x1da96a]=_0x629447['content'];}}});}return _0x2c2ef1;}function getTicket(_0x4de086,_0x10b073,_0x5020f3,_0x3c4274,_0x4bab2c,_0xaf9d28,_0x3f13fc){return new Promise(function(_0xbc73f0,_0x2c0e0f){var _0x550a7d;return getAuthToken(_0x10b073,_0x5020f3,_0x3f13fc)['then'](function(_0x303375){if(_0xaf9d28['ticketType']===_0xbd22('0x44')){_0x550a7d={'method':'POST','uri':_0x3c4274+_0xbd22('0x45'),'body':Object[_0xbd22('0x46')]({},{'title':intUtil[_0xbd22('0x47')](_0xaf9d28[_0xbd22('0x48')],_0x4bab2c,'\x20'),'description':intUtil[_0xbd22('0x47')](_0xaf9d28[_0xbd22('0x49')],_0x4bab2c,'\x0a'),'customerid_contact@odata.bind':_0x4de086[_0xbd22('0x32')]?_0xbd22('0x4a')+_0x4de086[_0xbd22('0x32')]+')':undefined,'ownerid@odata.bind':_0xbd22('0x30')+_0x4de086[_0xbd22('0x28')]+')','caseorigincode':'1'},getCustomFields(_0xaf9d28[_0xbd22('0x4b')],_0x4bab2c,_0xaf9d28[_0xbd22('0x4c')])),'headers':{'Authorization':_0xbd22('0x1e')+_0x303375,'OData-Version':_0xbd22('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xaf9d28[_0xbd22('0x4c')]===_0xbd22('0x4d')){var _0x5a79a2=_0x4de086['enduserId']?[{'partyid_systemuser@odata.bind':_0xbd22('0x30')+_0x4de086[_0xbd22('0x28')]+')','participationtypemask':_0x4de086[_0xbd22('0x4e')]===_0xbd22('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0xbd22('0x4a')+_0x4de086[_0xbd22('0x32')]+')','participationtypemask':_0x4de086[_0xbd22('0x4e')]===_0xbd22('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4de086[_0xbd22('0x28')]+')','participationtypemask':_0x4de086['callDirection']==='queue'?0x2:0x1}];_0x550a7d={'method':_0xbd22('0x10'),'uri':_0x3c4274+_0xbd22('0x50'),'body':Object[_0xbd22('0x46')]({},{'subject':intUtil[_0xbd22('0x47')](_0xaf9d28[_0xbd22('0x48')],_0x4bab2c,'\x20'),'phonenumber':String(_0x4bab2c[_0xbd22('0x2e')]),'description':intUtil[_0xbd22('0x47')](_0xaf9d28[_0xbd22('0x49')],_0x4bab2c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4de086[_0xbd22('0x32')]?_0xbd22('0x4a')+_0x4de086[_0xbd22('0x32')]+')':undefined,'ownerid@odata.bind':_0xbd22('0x30')+_0x4de086[_0xbd22('0x28')]+')','directioncode':_0x4de086[_0xbd22('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x5a79a2},getCustomFields(_0xaf9d28[_0xbd22('0x4b')],_0x4bab2c,_0xaf9d28[_0xbd22('0x4c')])),'headers':{'Authorization':_0xbd22('0x1e')+_0x303375,'OData-Version':_0xbd22('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x550a7d);})['then'](function(_0x1c5e2c){var _0x4e72de=_0x1c5e2c['headers'][_0xbd22('0x51')];var _0x1c3a19=_0x4e72de[_0xbd22('0x42')](_0x4e72de[_0xbd22('0x31')]('(')+0x1,_0x4e72de[_0xbd22('0x31')](')'));_0x4de086[_0xbd22('0x52')]=_0x1c3a19;_0xbc73f0(_0x4de086);})[_0xbd22('0x16')](function(_0x9c001d){_0x2c0e0f(_0x9c001d[_0xbd22('0x1a')]);});});}function emit(_0x3b6d7e,_0x1b09b9,_0x2dae59,_0x1e5e17){var _0x5c2dcf={'uri':util[_0xbd22('0x53')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x3b6d7e,_0x2dae59,_0x1e5e17)};io['to'](util[_0xbd22('0x53')](_0xbd22('0x54'),_0x1b09b9))[_0xbd22('0x55')](_0xbd22('0x56'),_0x5c2dcf);}exports['cs']=function(_0x5dfb12,_0x332de,_0x30f09a,_0x18a8a3,_0x51322a,_0x112533,_0x3d8450,_0x193e2e){var _0x40616b={};_0x112533[_0xbd22('0x12')]=_0x112533[_0xbd22('0xb')]?intUtil[_0xbd22('0x57')](_0x112533[_0xbd22('0xc')]['data7']):intUtil['stripTrailingSlash'](_0x112533[_0xbd22('0x12')]);_0x112533[_0xbd22('0x58')]=intUtil[_0xbd22('0x57')](_0x112533[_0xbd22('0x58')]);_0x40616b[_0xbd22('0x4e')]=_0x193e2e===_0xbd22('0x4f')||_0x193e2e===_0xbd22('0x59')?_0xbd22('0x4f'):'outbound';var _0x3d37b3=_0x112533[_0xbd22('0xb')]?util[_0xbd22('0x53')]('%s/api/data/v9.0/',_0x112533[_0xbd22('0xc')][_0xbd22('0x5a')]):util[_0xbd22('0x53')](_0xbd22('0x5b'),_0x112533[_0xbd22('0x12')]);var _0x3e0396=util['format'](_0xbd22('0x5c'),_0x112533['tenantId']);var _0x26d6b3=util['format'](_0xbd22('0x5d'),_0x112533[_0xbd22('0x58')],_0x332de[_0xbd22('0x5e')],md5(_0x332de[_0xbd22('0x5e')]));if(_0x51322a&&_0x51322a[_0xbd22('0x5f')]){logger[_0xbd22('0x26')](_0xbd22('0x60'),_0xbd22('0x61'));_0x332de['recordingURL']=_0x26d6b3;}else if(_0x3d8450&&_0x3d8450[_0xbd22('0x62')]&&_0x3d8450[_0xbd22('0x62')]!==_0xbd22('0x63')){logger[_0xbd22('0x26')](_0xbd22('0x64'),_0xbd22('0x61'));_0x332de['recordingURL']=_0x26d6b3;}else{_0x332de[_0xbd22('0x65')]='';}return getUser(_0x40616b,_0x112533,_0x18a8a3,_0x3e0396,_0x3d37b3,_0x193e2e)[_0xbd22('0x1b')](function(_0x1da199){logger[_0xbd22('0x26')]('['+_0x193e2e['toUpperCase']()+_0xbd22('0x66'),_0x1da199[_0xbd22('0x28')]);logger[_0xbd22('0x26')]('['+_0x193e2e[_0xbd22('0x18')]()+_0xbd22('0x67'),_0x1da199['userEmail']);return getEndUser(_0x1da199,_0x112533,_0x3e0396,_0x3d37b3,_0x332de,_0x193e2e,_0x30f09a['moduleCreate'],_0x30f09a[_0xbd22('0x68')]);})[_0xbd22('0x1b')](function(_0x979058){logger[_0xbd22('0x26')]('['+_0x193e2e['toUpperCase']()+_0xbd22('0x69'),_0x979058[_0xbd22('0x32')]);logger[_0xbd22('0x26')]('['+_0x193e2e['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x332de[_0xbd22('0x2e')]);return getTicket(_0x979058,_0x112533,_0x3e0396,_0x3d37b3,_0x332de,_0x30f09a,_0x193e2e);})[_0xbd22('0x1b')](function(_0x3471fc){logger[_0xbd22('0x26')](util[_0xbd22('0x53')]('['+_0x193e2e['toUpperCase']()+_0xbd22('0x6a'),_0x30f09a[_0xbd22('0x4c')],_0x3471fc['ticketId']));logger[_0xbd22('0x26')](util[_0xbd22('0x53')]('['+_0x193e2e[_0xbd22('0x18')]()+']\x20Call\x20direction:\x20%s',_0x193e2e));if(_0x193e2e!==_0xbd22('0x59')&&_0x30f09a[_0xbd22('0x6b')]){logger['info']('['+_0x193e2e[_0xbd22('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x112533[_0xbd22('0x12')],_0x18a8a3['name'],_0x30f09a[_0xbd22('0x4c')],_0x3471fc[_0xbd22('0x52')]);}})[_0xbd22('0x16')](function(_0x19d353){logger[_0xbd22('0x17')]('['+_0x193e2e[_0xbd22('0x18')]()+_0xbd22('0x6c'),_0x19d353['message']);console[_0xbd22('0x17')](_0xbd22('0x6d'),_0x19d353);});}; \ No newline at end of file +var _0x7fc1=['value','isNil','validateEmail','userEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','destcalleridnum','POST','contacts','/systemusers(','body','headers','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','4.0','phonecall','callDirection','queue','phonecalls','calleridnum','Fields','odata-entityid','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','clientId','username','password','then','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20'];(function(_0x46d183,_0x2c3ccd){var _0x56dc55=function(_0x54271f){while(--_0x54271f){_0x46d183['push'](_0x46d183['shift']());}};_0x56dc55(++_0x2c3ccd);}(_0x7fc1,0xc1));var _0x17fc=function(_0x18ef89,_0x3a3079){_0x18ef89=_0x18ef89-0x0;var _0x448e41=_0x7fc1[_0x18ef89];return _0x448e41;};'use strict';var _=require('lodash');var rp=require(_0x17fc('0x0'));var util=require(_0x17fc('0x1'));var intUtil=require(_0x17fc('0x2'));var md5=require(_0x17fc('0x3'));var Redis=require(_0x17fc('0x4'));var logger=require(_0x17fc('0x5'))('dynamics365');var config=require(_0x17fc('0x6'));config[_0x17fc('0x7')]=_[_0x17fc('0x8')](config[_0x17fc('0x7')],{'host':_0x17fc('0x9'),'port':0x18eb});var io=require(_0x17fc('0xa'))(new Redis(config[_0x17fc('0x7')]));function getAuthToken(_0x5694d5,_0x1203ac,_0x1494a4){if(_0x5694d5[_0x17fc('0xb')]){_0x5694d5[_0x17fc('0xc')]=_0x5694d5[_0x17fc('0xd')]['data7'];_0x5694d5[_0x17fc('0xe')]=_0x5694d5['CloudProvider'][_0x17fc('0xf')];return Promise[_0x17fc('0x10')](_0x5694d5[_0x17fc('0xd')]['data5']);}var _0x5eb714={'method':'POST','uri':_0x1203ac,'form':{'client_id':_0x5694d5[_0x17fc('0x11')],'resource':_0x5694d5[_0x17fc('0xc')],'username':_0x5694d5[_0x17fc('0x12')],'password':_0x5694d5[_0x17fc('0x13')],'grant_type':_0x17fc('0x13'),'client_secret':_0x5694d5['clientSecret']},'json':!![]};return rp(_0x5eb714)[_0x17fc('0x14')](function(_0x138d1b){return _0x138d1b['access_token'];})['catch'](function(_0x220916){logger['error']('['+[_0x1494a4[_0x17fc('0x15')]()]+']\x20Wrong\x20credentials!');return _0x220916[_0x17fc('0x16')];});}function getUser(_0xf9f46b,_0x54ab48,_0x2c2879,_0x3353a0,_0x44b56d,_0x3a9586){return new Promise(function(_0x260c27,_0x58e1d2){return getAuthToken(_0x54ab48,_0x3353a0,_0x3a9586)[_0x17fc('0x14')](function(_0xbce95){var _0x5c3351={'method':'GET','uri':_0x44b56d+_0x17fc('0x17'),'headers':{'Authorization':_0x17fc('0x18')+_0xbce95,'OData-Version':'4.0'},'json':!![]};return rp(_0x5c3351);})['then'](function(_0x3929bf){var _0x32f648=_0x3929bf[_0x17fc('0x19')];var _0x144d43=![];var _0x30b5de=null;if(!_[_0x17fc('0x1a')](_0x2c2879)){if(intUtil[_0x17fc('0x1b')](_0x2c2879['email'])){_0xf9f46b[_0x17fc('0x1c')]=_0x2c2879[_0x17fc('0x1d')];for(_0x30b5de=0x0;_0x30b5de<_0x32f648[_0x17fc('0x1e')];_0x30b5de++){if(_0x32f648[_0x30b5de][_0x17fc('0x1f')]===_0x2c2879[_0x17fc('0x1d')]&&!_0x32f648[_0x30b5de]['isdisabled']){_0x144d43=!![];logger['info']('['+[_0x3a9586[_0x17fc('0x15')]()]+_0x17fc('0x20')+_0x32f648[_0x30b5de][_0x17fc('0x21')]+'!');_0xf9f46b[_0x17fc('0x22')]=_0x32f648[_0x30b5de][_0x17fc('0x21')];}}}}if(!_0x144d43){logger[_0x17fc('0x23')]('['+[_0x3a9586[_0x17fc('0x15')]()]+_0x17fc('0x24'));_0xf9f46b[_0x17fc('0x1c')]=_0x54ab48[_0x17fc('0x12')];for(_0x30b5de=0x0;_0x30b5de<_0x32f648[_0x17fc('0x1e')];_0x30b5de++){if(_0x32f648[_0x30b5de][_0x17fc('0x1f')]===_0x54ab48[_0x17fc('0x12')]){_0xf9f46b[_0x17fc('0x22')]=_0x32f648[_0x30b5de][_0x17fc('0x21')];}}}_0x260c27(_0xf9f46b);})[_0x17fc('0x25')](function(_0x435433){_0x58e1d2(_0x435433[_0x17fc('0x16')]);});});}function createEndUser(_0x9c0a60,_0x4c1bbe,_0x4519c3,_0x5c7c06,_0x16de27,_0x40ba21,_0x52f30b){return new Promise(function(_0x41ea17,_0x352272){return getAuthToken(_0x4c1bbe,_0x4519c3,_0x40ba21)[_0x17fc('0x14')](function(_0x5fb453){var _0x31ea39=_0x40ba21[_0x17fc('0x26')]()===_0x17fc('0x27')?_0x16de27[_0x17fc('0x28')]:_0x16de27['calleridnum'];var _0x13efb6={'method':_0x17fc('0x29'),'uri':_0x5c7c06+_0x17fc('0x2a'),'body':{'fullname':_0x31ea39,'firstname':_0x31ea39,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x17fc('0x2b')+_0x9c0a60['userId']+')'},'headers':{'Authorization':_0x17fc('0x18')+_0x5fb453,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x13efb6[_0x17fc('0x2c')][_0x52f30b]=_0x31ea39;return rp(_0x13efb6);})['then'](function(_0x247785){var _0x1ab563=_0x247785[_0x17fc('0x2d')]['odata-entityid'];var _0x524148=_0x1ab563[_0x17fc('0x2e')](_0x1ab563[_0x17fc('0x2f')]('(')+0x1,_0x1ab563['lastIndexOf'](')'));_0x9c0a60[_0x17fc('0x30')]=_0x524148;_0x41ea17(_0x9c0a60);})[_0x17fc('0x25')](function(_0x14bfd6){_0x352272(_0x14bfd6['message']);});});}function getEndUser(_0x1ea60d,_0x406e7a,_0x344a81,_0x28e3d4,_0x3b0341,_0x1ce68b,_0x596c9a,_0x24b2e0){var _0x11dda7=_0x1ce68b[_0x17fc('0x26')]()==='outbound'?_0x3b0341['destcalleridnum']:_0x3b0341['calleridnum'];return getAuthToken(_0x406e7a,_0x344a81,_0x1ce68b)[_0x17fc('0x14')](function(_0x4f4e84){_0x24b2e0=_0x24b2e0?_0x24b2e0:_0x17fc('0x31');var _0x2248fd={'method':_0x17fc('0x32'),'uri':_0x28e3d4+_0x17fc('0x33')+_0x24b2e0+_0x17fc('0x34')+_0x24b2e0+_0x17fc('0x35')+_0x11dda7[_0x17fc('0x36')]('+',_0x17fc('0x37'))+'\x27','headers':{'Authorization':_0x17fc('0x18')+_0x4f4e84,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2248fd);})['then'](function(_0x99c84b){var _0xb66b31=![];if(!_0x99c84b)return _0xb66b31;var _0x503b23=_0x99c84b[_0x17fc('0x19')];for(var _0x30986f=0x0;_0x30986f<_0x503b23[_0x17fc('0x1e')];_0x30986f++){if(_0x503b23[_0x30986f][_0x24b2e0]===_0x11dda7){_0xb66b31=!![];_0x1ea60d[_0x17fc('0x30')]=_0x503b23[_0x30986f]['contactid'];}}return _0xb66b31;})[_0x17fc('0x14')](function(_0x2f943a){if(_0x2f943a)return _0x1ea60d;if(_0x596c9a===_0x17fc('0x38')){logger[_0x17fc('0x23')]('['+[_0x1ce68b['toUpperCase']()]+_0x17fc('0x39'));return _0x1ea60d;}return createEndUser(_0x1ea60d,_0x406e7a,_0x344a81,_0x28e3d4,_0x3b0341,_0x1ce68b,_0x24b2e0)[_0x17fc('0x14')](function(_0xcaf503){logger[_0x17fc('0x23')]('['+[_0x1ce68b[_0x17fc('0x15')]()]+_0x17fc('0x3a'),_0xcaf503[_0x17fc('0x30')]);return _0xcaf503;});});}function getCustomFields(_0x46b153,_0x3f60be,_0x6637a6){var _0x2f8bfd={};if(_0x46b153[_0x17fc('0x1e')]>0x0){_[_0x17fc('0x3b')](_0x46b153,function(_0x1ec9e8){if(_['includes']([_0x17fc('0x3c'),'picklist'],_0x1ec9e8[_0x17fc('0x3d')])&&_0x1ec9e8[_0x17fc('0x3e')]&&!_0x1ec9e8[_0x17fc('0x3f')]){var _0x1e8497=_0x1ec9e8[_0x17fc('0x40')][_0x17fc('0x26')]();var _0x1495a1=_0x1e8497[_0x17fc('0x2e')](0x0,_0x1e8497[_0x17fc('0x41')]('_'));var _0x45aa3d=_0x1e8497['substring'](_0x1e8497[_0x17fc('0x41')]('_')+0x1);if(_0x1495a1===_0x6637a6){_0x2f8bfd[_0x45aa3d]=_0x1ec9e8[_0x17fc('0x42')];}}});}return _0x2f8bfd;}function getTicket(_0xa61b26,_0x2dc464,_0x3690ce,_0x189f04,_0x4dfdf3,_0x332679,_0x128884){return new Promise(function(_0x5323f8,_0x57385d){var _0x51e261;return getAuthToken(_0x2dc464,_0x3690ce,_0x128884)['then'](function(_0xfcf1ac){if(_0x332679[_0x17fc('0x43')]===_0x17fc('0x44')){_0x51e261={'method':'POST','uri':_0x189f04+_0x17fc('0x45'),'body':Object[_0x17fc('0x46')]({},{'title':intUtil[_0x17fc('0x47')](_0x332679[_0x17fc('0x48')],_0x4dfdf3,'\x20'),'description':intUtil[_0x17fc('0x47')](_0x332679[_0x17fc('0x49')],_0x4dfdf3,'\x0a'),'customerid_contact@odata.bind':_0xa61b26['enduserId']?_0x17fc('0x4a')+_0xa61b26[_0x17fc('0x30')]+')':undefined,'ownerid@odata.bind':_0x17fc('0x2b')+_0xa61b26[_0x17fc('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x332679['Fields'],_0x4dfdf3,_0x332679[_0x17fc('0x43')])),'headers':{'Authorization':_0x17fc('0x18')+_0xfcf1ac,'OData-Version':_0x17fc('0x4b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x332679[_0x17fc('0x43')]===_0x17fc('0x4c')){var _0x25b369=_0xa61b26[_0x17fc('0x30')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0xa61b26[_0x17fc('0x22')]+')','participationtypemask':_0xa61b26[_0x17fc('0x4d')]===_0x17fc('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xa61b26[_0x17fc('0x30')]+')','participationtypemask':_0xa61b26[_0x17fc('0x4d')]===_0x17fc('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x17fc('0x2b')+_0xa61b26['userId']+')','participationtypemask':_0xa61b26[_0x17fc('0x4d')]===_0x17fc('0x4e')?0x2:0x1}];_0x51e261={'method':'POST','uri':_0x189f04+_0x17fc('0x4f'),'body':Object[_0x17fc('0x46')]({},{'subject':intUtil['getString'](_0x332679[_0x17fc('0x48')],_0x4dfdf3,'\x20'),'phonenumber':String(_0x4dfdf3[_0x17fc('0x50')]),'description':intUtil[_0x17fc('0x47')](_0x332679[_0x17fc('0x49')],_0x4dfdf3,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa61b26['enduserId']?'/contacts('+_0xa61b26[_0x17fc('0x30')]+')':undefined,'ownerid@odata.bind':_0x17fc('0x2b')+_0xa61b26[_0x17fc('0x22')]+')','directioncode':_0xa61b26['callDirection']===_0x17fc('0x4e')?![]:!![],'phonecall_activity_parties':_0x25b369},getCustomFields(_0x332679[_0x17fc('0x51')],_0x4dfdf3,_0x332679[_0x17fc('0x43')])),'headers':{'Authorization':_0x17fc('0x18')+_0xfcf1ac,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x51e261);})[_0x17fc('0x14')](function(_0x2836a0){var _0x49dc84=_0x2836a0[_0x17fc('0x2d')][_0x17fc('0x52')];var _0x416d20=_0x49dc84[_0x17fc('0x2e')](_0x49dc84['lastIndexOf']('(')+0x1,_0x49dc84[_0x17fc('0x2f')](')'));_0xa61b26['ticketId']=_0x416d20;_0x5323f8(_0xa61b26);})[_0x17fc('0x25')](function(_0x3b2c61){_0x57385d(_0x3b2c61[_0x17fc('0x16')]);});});}function emit(_0x9a9153,_0xa6948c,_0x128c09,_0x3dbffa){var _0x1494e5={'uri':util['format'](_0x17fc('0x53'),_0x9a9153,_0x128c09,_0x3dbffa)};io['to'](util[_0x17fc('0x54')]('user:%s',_0xa6948c))['emit'](_0x17fc('0x55'),_0x1494e5);}exports['cs']=function(_0x10b2d8,_0x44a724,_0x35dc1a,_0x1914a9,_0x2f192e,_0xc6d8b1,_0x546c7b,_0x13c9d5){var _0x3672d7={};_0xc6d8b1[_0x17fc('0xc')]=_0xc6d8b1[_0x17fc('0xb')]?intUtil[_0x17fc('0x56')](_0xc6d8b1[_0x17fc('0xd')][_0x17fc('0x57')]):intUtil[_0x17fc('0x56')](_0xc6d8b1['remoteUri']);_0xc6d8b1[_0x17fc('0x58')]=intUtil[_0x17fc('0x56')](_0xc6d8b1[_0x17fc('0x58')]);_0x3672d7['callDirection']=_0x13c9d5==='queue'||_0x13c9d5===_0x17fc('0x59')?_0x17fc('0x4e'):_0x17fc('0x27');var _0x2ba95d=_0xc6d8b1[_0x17fc('0xb')]?util[_0x17fc('0x54')](_0x17fc('0x5a'),_0xc6d8b1[_0x17fc('0xd')][_0x17fc('0x57')]):util['format']('%s/api/data/v9.0/',_0xc6d8b1[_0x17fc('0xc')]);var _0xb9c59=util[_0x17fc('0x54')]('https://login.microsoftonline.com/%s/oauth2/token',_0xc6d8b1['tenantId']);var _0x1b7c39=util[_0x17fc('0x54')](_0x17fc('0x5b'),_0xc6d8b1[_0x17fc('0x58')],_0x44a724[_0x17fc('0x5c')],md5(_0x44a724[_0x17fc('0x5c')]));if(_0x2f192e&&_0x2f192e[_0x17fc('0x5d')]){logger[_0x17fc('0x23')]('[QUEUE]',_0x17fc('0x5e'));_0x44a724['recordingURL']=_0x1b7c39;}else if(_0x546c7b&&_0x546c7b[_0x17fc('0x5f')]&&_0x546c7b['recordingFormat']!=='none'){logger[_0x17fc('0x23')](_0x17fc('0x60'),'Recording\x20is\x20enabled!');_0x44a724[_0x17fc('0x61')]=_0x1b7c39;}else{_0x44a724[_0x17fc('0x61')]='';}return getUser(_0x3672d7,_0xc6d8b1,_0x1914a9,_0xb9c59,_0x2ba95d,_0x13c9d5)['then'](function(_0x2e0e0d){logger['info']('['+_0x13c9d5[_0x17fc('0x15')]()+_0x17fc('0x62'),_0x2e0e0d[_0x17fc('0x22')]);logger[_0x17fc('0x23')]('['+_0x13c9d5[_0x17fc('0x15')]()+_0x17fc('0x63'),_0x2e0e0d['userEmail']);return getEndUser(_0x2e0e0d,_0xc6d8b1,_0xb9c59,_0x2ba95d,_0x44a724,_0x13c9d5,_0x35dc1a[_0x17fc('0x64')],_0x35dc1a['additionalSearchContact']);})[_0x17fc('0x14')](function(_0x5bf49f){logger[_0x17fc('0x23')]('['+_0x13c9d5[_0x17fc('0x15')]()+_0x17fc('0x65'),_0x5bf49f[_0x17fc('0x30')]);logger[_0x17fc('0x23')]('['+_0x13c9d5['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x44a724['calleridnum']);return getTicket(_0x5bf49f,_0xc6d8b1,_0xb9c59,_0x2ba95d,_0x44a724,_0x35dc1a,_0x13c9d5);})['then'](function(_0x2599fd){logger['info'](util['format']('['+_0x13c9d5[_0x17fc('0x15')]()+_0x17fc('0x66'),_0x35dc1a['ticketType'],_0x2599fd[_0x17fc('0x67')]));logger['info'](util[_0x17fc('0x54')]('['+_0x13c9d5[_0x17fc('0x15')]()+_0x17fc('0x68'),_0x13c9d5));if(_0x13c9d5!==_0x17fc('0x59')&&_0x35dc1a[_0x17fc('0x69')]){logger[_0x17fc('0x23')]('['+_0x13c9d5[_0x17fc('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xc6d8b1[_0x17fc('0xc')],_0x1914a9[_0x17fc('0x6a')],_0x35dc1a[_0x17fc('0x43')],_0x2599fd[_0x17fc('0x67')]);}})[_0x17fc('0x25')](function(_0x629225){logger[_0x17fc('0x6b')]('['+_0x13c9d5['toUpperCase']()+_0x17fc('0x6c'),_0x629225[_0x17fc('0x16')]);console[_0x17fc('0x6b')]('Error\x20running\x20Dynamics365\x20integration',_0x629225);});}; \ 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 51c4539..631756a 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 _0x1546=['toUpperCase','Authorization','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','variableName','push','Variable','name','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','unmanaged','lastevent'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1546,0xb6));var _0x6154=function(_0x2a5a4e,_0x1132cb){_0x2a5a4e=_0x2a5a4e-0x0;var _0x1e6297=_0x1546[_0x2a5a4e];return _0x1e6297;};'use strict';var _=require(_0x6154('0x0'));var rp=require(_0x6154('0x1'));var md5=require(_0x6154('0x2'));var util=require(_0x6154('0x3'));var Redis=require(_0x6154('0x4'));var intUtil=require('./util');var config=require(_0x6154('0x5'));var logger=require(_0x6154('0x6'))('freshdesk');config[_0x6154('0x7')]=_[_0x6154('0x8')](config[_0x6154('0x7')],{'host':_0x6154('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6154('0x7')]));var headers={'Content-Type':_0x6154('0xa'),'Accept':'application/json'};function emit(_0x1cf5a9,_0x4f1cb6,_0x344b08){io['to'](_0x1cf5a9)[_0x6154('0xb')](_0x4f1cb6,_0x344b08);}function getTicket(_0x106d93,_0x43a982,_0x59cd7c,_0x1527ed,_0x47b55c){logger[_0x6154('0xc')](_0x6154('0xd'));var _0x273689=_[_0x6154('0xe')]({'responder_id':_0x43a982['id'],'requester_id':_0x59cd7c['id'],'name':util['format'](_0x6154('0xf'),_0x47b55c[_0x6154('0x10')]),'phone':_0x47b55c[_0x6154('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1527ed[_0x6154('0x12')],_0x47b55c,'\x20'),'description':intUtil['getString'](_0x1527ed[_0x6154('0x13')],_0x47b55c,_0x6154('0x14')),'tags':getTags(_0x1527ed[_0x6154('0x15')],'name')},getCustomFields(_0x1527ed[_0x6154('0x16')],_0x47b55c));_0x273689['custom_fields']=_[_0x6154('0x17')](_[_0x6154('0x18')](_0x273689[_0x6154('0x19')],'id'),'value');return request({'uri':util[_0x6154('0x1a')](_0x6154('0x1b'),_0x106d93['remoteUri']),'method':_0x6154('0x1c'),'body':_0x273689})[_0x6154('0x1d')](function(_0x2010f5){logger[_0x6154('0xc')](_0x6154('0x1e'));return _0x2010f5;});}function getUser(_0x48cc42,_0x5bc2a9){if(intUtil['validateEmail'](_0x5bc2a9)){return request({'uri':util[_0x6154('0x1a')](_0x6154('0x1f'),_0x48cc42[_0x6154('0x20')]),'qs':{'email':_0x5bc2a9}})[_0x6154('0x1d')](function(_0x5aa0b9){if(_0x5aa0b9[_0x6154('0x21')]){logger[_0x6154('0xc')](_0x6154('0x22'));return _[_0x6154('0x23')](_0x5aa0b9,function(_0x2b6f41){return _0x2b6f41['contact'][_0x6154('0x24')]===_0x5bc2a9;});}else{logger[_0x6154('0xc')](_0x6154('0x25'));return request({'uri':util[_0x6154('0x1a')](_0x6154('0x26'),_0x48cc42[_0x6154('0x20')])})[_0x6154('0x1d')](function(_0x1b8480){logger[_0x6154('0xc')](_0x6154('0x27'));return _0x1b8480;});}});}else{logger[_0x6154('0xc')](_0x6154('0x28'));return request({'uri':util[_0x6154('0x1a')](_0x6154('0x26'),_0x48cc42['remoteUri'])})[_0x6154('0x1d')](function(_0x8100fa){logger[_0x6154('0xc')](_0x6154('0x27'));return _0x8100fa;});}}function getEndUser(_0x56e184,_0x57159e,_0x254f31){logger[_0x6154('0xc')](_0x6154('0x29'),_0x254f31);return request({'uri':util[_0x6154('0x1a')](_0x6154('0x2a'),_0x56e184[_0x6154('0x20')]),'qs':{'phone':_0x254f31}})['then'](function(_0x449abf){if(_0x449abf[_0x6154('0x21')]){logger['info'](_0x6154('0x2b'));return _[_0x6154('0x23')](_0x449abf,{'phone':_0x254f31});}else{logger['info'](_0x6154('0x2c'));return request({'uri':util[_0x6154('0x1a')]('%s/api/v2/contacts',_0x56e184[_0x6154('0x20')]),'method':_0x6154('0x1c'),'body':{'name':_0x57159e,'phone':_0x254f31}})[_0x6154('0x1d')](function(_0x51058f){logger[_0x6154('0xc')](_0x6154('0x2d'));return _0x51058f;});}});}function getAuth(_0x454c47){return util[_0x6154('0x1a')](_0x6154('0x2e'),new Buffer(_0x454c47[_0x6154('0x2f')]+':X')[_0x6154('0x30')]('base64'));}function request(_0x5f2704){logger['debug'](_0x6154('0x31'),JSON[_0x6154('0x32')](_0x5f2704));return rp(_[_0x6154('0x8')](_0x5f2704,{'method':_0x6154('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x47dee0,_0xfe8d1f){var _0xe5c8ee=[];if(_0x47dee0&&_0x47dee0[_0x6154('0x21')]>0x0){_0xe5c8ee=_[_0x6154('0x34')](_0x47dee0,_0xfe8d1f);}return _0xe5c8ee;}function getCustomFields(_0x2520a5,_0x55569f){var _0x250781=[];var _0x23813c={'custom_fields':[]};if(_0x2520a5[_0x6154('0x21')]>0x0){_['forEach'](_0x2520a5,function(_0x1fd6f7){if(_[_0x6154('0x35')]([_0x6154('0x36'),_0x6154('0x37')],_0x1fd6f7[_0x6154('0x38')])&&_0x1fd6f7['nameField']&&!_0x1fd6f7[_0x6154('0x39')]){_0x23813c[_0x1fd6f7[_0x6154('0x3a')][_0x6154('0x3b')]()]=_0x1fd6f7[_0x6154('0x3c')]['toString']();}else if(_[_0x6154('0x35')]([_0x6154('0x36'),_0x6154('0x37')],_0x1fd6f7[_0x6154('0x38')])&&_0x1fd6f7[_0x6154('0x3d')]&&_0x1fd6f7[_0x6154('0x39')]){_0x23813c[_0x6154('0x19')]['push']({'id':_0x1fd6f7['idField'],'value':_0x1fd6f7[_0x6154('0x3c')][_0x6154('0x30')]()});}else if(_0x1fd6f7[_0x6154('0x38')]==='variable'&&_0x1fd6f7[_0x6154('0x3e')]&&_0x1fd6f7[_0x6154('0x3d')]&&_0x1fd6f7[_0x6154('0x39')]){_0x55569f[_0x1fd6f7[_0x6154('0x3e')]]&&_0x23813c[_0x6154('0x19')][_0x6154('0x3f')]({'id':_0x1fd6f7['idField'],'value':_0x55569f[_0x1fd6f7[_0x6154('0x3e')]][_0x6154('0x30')]()});}else if(_0x1fd6f7[_0x6154('0x38')]==='customVariable'&&_0x1fd6f7[_0x6154('0x40')]&&_0x1fd6f7[_0x6154('0x40')][_0x6154('0x41')]&&_0x1fd6f7[_0x6154('0x3d')]&&_0x1fd6f7[_0x6154('0x39')]){_0x55569f[_0x1fd6f7['Variable'][_0x6154('0x41')][_0x6154('0x3b')]()]&&_0x23813c[_0x6154('0x19')][_0x6154('0x3f')]({'id':_0x1fd6f7[_0x6154('0x3d')],'value':_0x55569f[_0x1fd6f7['Variable'][_0x6154('0x41')][_0x6154('0x3b')]()][_0x6154('0x30')]()});}});}return _0x23813c;}exports['queue']=function(_0x407735,_0x162801,_0x3bdb0e,_0x3af7bf,_0x22b862,_0x499f0c){var _0x576330,_0x42a40b;_0x499f0c['remoteUri']=intUtil[_0x6154('0x42')](_0x499f0c[_0x6154('0x20')]);_0x499f0c[_0x6154('0x43')]=intUtil[_0x6154('0x42')](_0x499f0c[_0x6154('0x43')]);if(_0x22b862&&_0x22b862['monitor_format']){logger[_0x6154('0xc')](_0x6154('0x44'),_0x6154('0x45'));_0x162801[_0x6154('0x46')]=util[_0x6154('0x1a')](_0x6154('0x47'),_0x499f0c['serverUrl'],_0x162801[_0x6154('0x48')],md5(_0x162801[_0x6154('0x48')]));}else{_0x162801[_0x6154('0x46')]='';}headers['Authorization']=getAuth(_0x499f0c);return getUser(_0x499f0c,_0x3af7bf['email'])[_0x6154('0x1d')](function(_0x3ab8d8){_0x576330=_0x3ab8d8;logger[_0x6154('0xc')]('The\x20User\x20ID\x20is:',_0x576330['id']);return getEndUser(_0x499f0c,_0x162801[_0x6154('0x10')],_0x162801[_0x6154('0x11')]);})[_0x6154('0x1d')](function(_0x2daa62){_0x42a40b=_0x2daa62;logger[_0x6154('0xc')]('The\x20Enduser\x20ID\x20is:',_0x42a40b['id']);return getTicket(_0x499f0c,_0x576330,_0x42a40b,_0x3bdb0e,_0x162801);})[_0x6154('0x1d')](function(_0x4ee93a){if(_0x4ee93a&&_0x4ee93a['id']){logger['info'](_0x6154('0x1e'));logger[_0x6154('0xc')](_0x6154('0x49'),_0x4ee93a['id']);logger[_0x6154('0xc')](_0x6154('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6154('0x1a')](_0x6154('0x4a'),_0x3af7bf['name']),_0x6154('0x4b'),{'uri':util[_0x6154('0x1a')]('%s/helpdesk/tickets/%d',_0x499f0c[_0x6154('0x20')],_0x4ee93a['id'])});}})['catch'](function(_0x214c92){logger['error'](_0x6154('0x44'),JSON[_0x6154('0x32')](_0x214c92));});};exports[_0x6154('0x4c')]=function(_0x22a6a6,_0x1074c0,_0x54aa65,_0x137373,_0x250f0a,_0x5cb0b5,_0x1390c8){var _0xc661a9,_0x3b1528;_0x5cb0b5[_0x6154('0x20')]=intUtil[_0x6154('0x42')](_0x5cb0b5[_0x6154('0x20')]);_0x5cb0b5[_0x6154('0x43')]=intUtil['stripTrailingSlash'](_0x5cb0b5[_0x6154('0x43')]);if(_0x1390c8&&_0x1390c8[_0x6154('0x4d')]&&_0x1390c8[_0x6154('0x4d')]!=='none'){logger[_0x6154('0xc')](_0x6154('0x4e'),_0x6154('0x45'));_0x1074c0[_0x6154('0x46')]=util['format'](_0x6154('0x47'),_0x5cb0b5['serverUrl'],_0x1074c0[_0x6154('0x48')],md5(_0x1074c0[_0x6154('0x48')]));}headers['Authorization']=getAuth(_0x5cb0b5);return getUser(_0x5cb0b5,_0x137373['email'])['then'](function(_0x2218b2){_0xc661a9=_0x2218b2;logger['info'](_0x6154('0x4f'),_0xc661a9['id']);return getEndUser(_0x5cb0b5,_0x1074c0[_0x6154('0x50')],_0x1074c0[_0x6154('0x51')]);})[_0x6154('0x1d')](function(_0x507c51){_0x3b1528=_0x507c51;logger['info'](_0x6154('0x52'),_0x3b1528['id']);return getTicket(_0x5cb0b5,_0xc661a9,_0x3b1528,_0x54aa65,_0x1074c0);})[_0x6154('0x1d')](function(_0x45ef31){if(_0x45ef31&&_0x45ef31['id']){logger[_0x6154('0xc')]('Ticket\x20created!');logger['info'](_0x6154('0x49'),_0x45ef31['id']);logger['info'](_0x6154('0x4e'),_0x6154('0x53'));emit(util[_0x6154('0x1a')]('user:%s',_0x137373[_0x6154('0x41')]),_0x6154('0x4b'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x5cb0b5['remoteUri'],_0x45ef31['id'])});}})[_0x6154('0x54')](function(_0x45ef8b){logger[_0x6154('0x55')](_0x6154('0x4e'),JSON[_0x6154('0x32')](_0x45ef8b));});};exports[_0x6154('0x56')]=function(_0x1a3540,_0x264591,_0x3bf15c,_0x598035,_0x4e7bd2,_0x2cd3e0){var _0x516cf8,_0x169aab;_0x2cd3e0[_0x6154('0x20')]=intUtil[_0x6154('0x42')](_0x2cd3e0[_0x6154('0x20')]);_0x2cd3e0[_0x6154('0x43')]=intUtil[_0x6154('0x42')](_0x2cd3e0[_0x6154('0x43')]);if(_0x4e7bd2&&_0x4e7bd2['monitor_format']){logger[_0x6154('0xc')]('['+_0x264591[_0x6154('0x57')][_0x6154('0x58')]()+']',_0x6154('0x45'));_0x264591[_0x6154('0x46')]=util[_0x6154('0x1a')](_0x6154('0x47'),_0x2cd3e0[_0x6154('0x43')],_0x264591[_0x6154('0x48')],md5(_0x264591['uniqueid']));}else{_0x264591['recordingURL']='';}headers[_0x6154('0x59')]=getAuth(_0x2cd3e0);return getUser(_0x2cd3e0,'')[_0x6154('0x1d')](function(_0x2fff12){_0x516cf8=_0x2fff12;logger[_0x6154('0xc')](_0x6154('0x4f'),_0x516cf8['id']);return getEndUser(_0x2cd3e0,_0x264591[_0x6154('0x10')],_0x264591[_0x6154('0x11')]);})[_0x6154('0x1d')](function(_0x4999de){_0x169aab=_0x4999de;logger['info']('The\x20Enduser\x20ID\x20is:',_0x169aab['id']);return getTicket(_0x2cd3e0,_0x516cf8,_0x169aab,_0x3bf15c,_0x264591);})[_0x6154('0x1d')](function(_0x40135c){if(_0x40135c){logger[_0x6154('0xc')](_0x6154('0x1e'));logger['info'](_0x6154('0x49'),_0x40135c['id']);}})['catch'](function(_0x4f5604){logger[_0x6154('0x55')]('['+_0x264591[_0x6154('0x57')][_0x6154('0x58')]()+']',JSON[_0x6154('0x32')](_0x4f5604));});}; \ No newline at end of file +var _0x7068=['[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','GET','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x7068,0x76));var _0x8706=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x7068[_0x45ee03];return _0x13d535;};'use strict';var _=require(_0x8706('0x0'));var rp=require(_0x8706('0x1'));var md5=require(_0x8706('0x2'));var util=require(_0x8706('0x3'));var Redis=require(_0x8706('0x4'));var intUtil=require(_0x8706('0x5'));var config=require(_0x8706('0x6'));var logger=require(_0x8706('0x7'))(_0x8706('0x8'));config[_0x8706('0x9')]=_[_0x8706('0xa')](config[_0x8706('0x9')],{'host':_0x8706('0xb'),'port':0x18eb});var io=require(_0x8706('0xc'))(new Redis(config[_0x8706('0x9')]));var headers={'Content-Type':'application/json','Accept':_0x8706('0xd')};function emit(_0x2911ec,_0x4beb74,_0x1defd1){io['to'](_0x2911ec)[_0x8706('0xe')](_0x4beb74,_0x1defd1);}function getTicket(_0xca67f5,_0x556e82,_0x1f0f7f,_0x3d9079,_0x26cc13){logger[_0x8706('0xf')]('Creating\x20new\x20ticket...');var _0x3918e6=_[_0x8706('0x10')]({'responder_id':_0x556e82['id'],'requester_id':_0x1f0f7f['id'],'name':util[_0x8706('0x11')]('Caller\x20-\x20%s',_0x26cc13[_0x8706('0x12')]),'phone':_0x26cc13[_0x8706('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8706('0x14')](_0x3d9079[_0x8706('0x15')],_0x26cc13,'\x20'),'description':intUtil[_0x8706('0x14')](_0x3d9079[_0x8706('0x16')],_0x26cc13,_0x8706('0x17')),'tags':getTags(_0x3d9079[_0x8706('0x18')],_0x8706('0x19'))},getCustomFields(_0x3d9079[_0x8706('0x1a')],_0x26cc13));_0x3918e6['custom_fields']=_['mapValues'](_[_0x8706('0x1b')](_0x3918e6['custom_fields'],'id'),_0x8706('0x1c'));return request({'uri':util[_0x8706('0x11')](_0x8706('0x1d'),_0xca67f5[_0x8706('0x1e')]),'method':_0x8706('0x1f'),'body':_0x3918e6})['then'](function(_0x58a8fd){logger[_0x8706('0xf')](_0x8706('0x20'));return _0x58a8fd;});}function getUser(_0x44411c,_0x5ea0f3){if(intUtil[_0x8706('0x21')](_0x5ea0f3)){return request({'uri':util[_0x8706('0x11')](_0x8706('0x22'),_0x44411c[_0x8706('0x1e')]),'qs':{'email':_0x5ea0f3}})[_0x8706('0x23')](function(_0x599e1d){if(_0x599e1d[_0x8706('0x24')]){logger['info'](_0x8706('0x25'));return _[_0x8706('0x26')](_0x599e1d,function(_0x4370d3){return _0x4370d3[_0x8706('0x27')][_0x8706('0x28')]===_0x5ea0f3;});}else{logger[_0x8706('0xf')](_0x8706('0x29'));return request({'uri':util[_0x8706('0x11')](_0x8706('0x2a'),_0x44411c[_0x8706('0x1e')])})[_0x8706('0x23')](function(_0x42b40a){logger[_0x8706('0xf')](_0x8706('0x2b'));return _0x42b40a;});}});}else{logger[_0x8706('0xf')](_0x8706('0x2c'));return request({'uri':util[_0x8706('0x11')](_0x8706('0x2a'),_0x44411c[_0x8706('0x1e')])})['then'](function(_0x355bdc){logger[_0x8706('0xf')](_0x8706('0x2b'));return _0x355bdc;});}}function getEndUser(_0x4054d4,_0x57eea5,_0x10812e){logger[_0x8706('0xf')](_0x8706('0x2d'),_0x10812e);return request({'uri':util[_0x8706('0x11')]('%s/api/v2/contacts',_0x4054d4[_0x8706('0x1e')]),'qs':{'phone':_0x10812e}})['then'](function(_0x27b5a8){if(_0x27b5a8[_0x8706('0x24')]){logger['info'](_0x8706('0x2e'));return _[_0x8706('0x26')](_0x27b5a8,{'phone':_0x10812e});}else{logger[_0x8706('0xf')](_0x8706('0x2f'));return request({'uri':util[_0x8706('0x11')](_0x8706('0x30'),_0x4054d4[_0x8706('0x1e')]),'method':_0x8706('0x1f'),'body':{'name':_0x57eea5,'phone':_0x10812e}})[_0x8706('0x23')](function(_0xfc9474){logger[_0x8706('0xf')](_0x8706('0x31'));return _0xfc9474;});}});}function getAuth(_0x1a065a){return util['format'](_0x8706('0x32'),new Buffer(_0x1a065a[_0x8706('0x33')]+':X')[_0x8706('0x34')](_0x8706('0x35')));}function request(_0x5796e1){logger[_0x8706('0x36')]('[HTTP]',JSON['stringify'](_0x5796e1));return rp(_['defaults'](_0x5796e1,{'method':_0x8706('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x1c2f52,_0x17975d){var _0x31a630=[];if(_0x1c2f52&&_0x1c2f52[_0x8706('0x24')]>0x0){_0x31a630=_['map'](_0x1c2f52,_0x17975d);}return _0x31a630;}function getCustomFields(_0x58325c,_0x3e5829){var _0x417adb=[];var _0x2aac9a={'custom_fields':[]};if(_0x58325c['length']>0x0){_[_0x8706('0x38')](_0x58325c,function(_0x28e7aa){if(_[_0x8706('0x39')]([_0x8706('0x3a'),'picklist'],_0x28e7aa[_0x8706('0x3b')])&&_0x28e7aa[_0x8706('0x3c')]&&!_0x28e7aa[_0x8706('0x3d')]){_0x2aac9a[_0x28e7aa['nameField'][_0x8706('0x3e')]()]=_0x28e7aa[_0x8706('0x3f')]['toString']();}else if(_[_0x8706('0x39')]([_0x8706('0x3a'),_0x8706('0x40')],_0x28e7aa[_0x8706('0x3b')])&&_0x28e7aa[_0x8706('0x41')]&&_0x28e7aa[_0x8706('0x3d')]){_0x2aac9a[_0x8706('0x42')][_0x8706('0x43')]({'id':_0x28e7aa[_0x8706('0x41')],'value':_0x28e7aa['content'][_0x8706('0x34')]()});}else if(_0x28e7aa[_0x8706('0x3b')]===_0x8706('0x44')&&_0x28e7aa[_0x8706('0x45')]&&_0x28e7aa['idField']&&_0x28e7aa[_0x8706('0x3d')]){_0x3e5829[_0x28e7aa[_0x8706('0x45')]]&&_0x2aac9a['custom_fields'][_0x8706('0x43')]({'id':_0x28e7aa['idField'],'value':_0x3e5829[_0x28e7aa[_0x8706('0x45')]][_0x8706('0x34')]()});}else if(_0x28e7aa[_0x8706('0x3b')]===_0x8706('0x46')&&_0x28e7aa[_0x8706('0x47')]&&_0x28e7aa['Variable']['name']&&_0x28e7aa[_0x8706('0x41')]&&_0x28e7aa[_0x8706('0x3d')]){_0x3e5829[_0x28e7aa[_0x8706('0x47')][_0x8706('0x19')]['toLowerCase']()]&&_0x2aac9a[_0x8706('0x42')][_0x8706('0x43')]({'id':_0x28e7aa[_0x8706('0x41')],'value':_0x3e5829[_0x28e7aa[_0x8706('0x47')][_0x8706('0x19')][_0x8706('0x3e')]()][_0x8706('0x34')]()});}});}return _0x2aac9a;}exports[_0x8706('0x48')]=function(_0x1f55a5,_0x495d64,_0x19c366,_0x2b5e08,_0x45439c,_0x466267){var _0x5772b4,_0x2874de;_0x466267[_0x8706('0x1e')]=intUtil[_0x8706('0x49')](_0x466267['remoteUri']);_0x466267[_0x8706('0x4a')]=intUtil[_0x8706('0x49')](_0x466267[_0x8706('0x4a')]);if(_0x45439c&&_0x45439c[_0x8706('0x4b')]){logger[_0x8706('0xf')](_0x8706('0x4c'),_0x8706('0x4d'));_0x495d64['recordingURL']=util[_0x8706('0x11')](_0x8706('0x4e'),_0x466267[_0x8706('0x4a')],_0x495d64[_0x8706('0x4f')],md5(_0x495d64['uniqueid']));}else{_0x495d64[_0x8706('0x50')]='';}headers['Authorization']=getAuth(_0x466267);return getUser(_0x466267,_0x2b5e08[_0x8706('0x28')])[_0x8706('0x23')](function(_0x365449){_0x5772b4=_0x365449;logger[_0x8706('0xf')](_0x8706('0x51'),_0x5772b4['id']);return getEndUser(_0x466267,_0x495d64[_0x8706('0x12')],_0x495d64['calleridnum']);})[_0x8706('0x23')](function(_0x2d8187){_0x2874de=_0x2d8187;logger[_0x8706('0xf')]('The\x20Enduser\x20ID\x20is:',_0x2874de['id']);return getTicket(_0x466267,_0x5772b4,_0x2874de,_0x19c366,_0x495d64);})['then'](function(_0x2ccfe6){if(_0x2ccfe6&&_0x2ccfe6['id']){logger['info']('Ticket\x20created!');logger['info'](_0x8706('0x52'),_0x2ccfe6['id']);logger[_0x8706('0xf')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8706('0x11')]('user:%s',_0x2b5e08[_0x8706('0x19')]),_0x8706('0x53'),{'uri':util['format'](_0x8706('0x54'),_0x466267[_0x8706('0x1e')],_0x2ccfe6['id'])});}})[_0x8706('0x55')](function(_0x4f8f7b){logger[_0x8706('0x56')](_0x8706('0x4c'),JSON[_0x8706('0x57')](_0x4f8f7b));});};exports[_0x8706('0x58')]=function(_0x4385bd,_0x31e359,_0x45fb89,_0x36e0a8,_0x134f20,_0x2c39a4,_0x56ae79){var _0x66beae,_0x30ec3c;_0x2c39a4[_0x8706('0x1e')]=intUtil[_0x8706('0x49')](_0x2c39a4[_0x8706('0x1e')]);_0x2c39a4['serverUrl']=intUtil[_0x8706('0x49')](_0x2c39a4[_0x8706('0x4a')]);if(_0x56ae79&&_0x56ae79[_0x8706('0x59')]&&_0x56ae79['recordingFormat']!==_0x8706('0x5a')){logger[_0x8706('0xf')](_0x8706('0x5b'),_0x8706('0x4d'));_0x31e359[_0x8706('0x50')]=util[_0x8706('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c39a4['serverUrl'],_0x31e359[_0x8706('0x4f')],md5(_0x31e359[_0x8706('0x4f')]));}headers['Authorization']=getAuth(_0x2c39a4);return getUser(_0x2c39a4,_0x36e0a8[_0x8706('0x28')])[_0x8706('0x23')](function(_0xa4e70e){_0x66beae=_0xa4e70e;logger[_0x8706('0xf')](_0x8706('0x51'),_0x66beae['id']);return getEndUser(_0x2c39a4,_0x31e359['destcalleridname'],_0x31e359[_0x8706('0x5c')]);})[_0x8706('0x23')](function(_0x26a73e){_0x30ec3c=_0x26a73e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x30ec3c['id']);return getTicket(_0x2c39a4,_0x66beae,_0x30ec3c,_0x45fb89,_0x31e359);})[_0x8706('0x23')](function(_0x477f6c){if(_0x477f6c&&_0x477f6c['id']){logger[_0x8706('0xf')](_0x8706('0x20'));logger[_0x8706('0xf')](_0x8706('0x52'),_0x477f6c['id']);logger[_0x8706('0xf')](_0x8706('0x5b'),_0x8706('0x5d'));emit(util['format'](_0x8706('0x5e'),_0x36e0a8[_0x8706('0x19')]),_0x8706('0x53'),{'uri':util[_0x8706('0x11')](_0x8706('0x54'),_0x2c39a4[_0x8706('0x1e')],_0x477f6c['id'])});}})[_0x8706('0x55')](function(_0x3b76f8){logger[_0x8706('0x56')]('[OUTBOUND]',JSON['stringify'](_0x3b76f8));});};exports['unmanaged']=function(_0x2734f7,_0x345462,_0x488148,_0x544f14,_0x2cebcb,_0x552e26){var _0xe067b5,_0x423720;_0x552e26[_0x8706('0x1e')]=intUtil[_0x8706('0x49')](_0x552e26[_0x8706('0x1e')]);_0x552e26[_0x8706('0x4a')]=intUtil['stripTrailingSlash'](_0x552e26[_0x8706('0x4a')]);if(_0x2cebcb&&_0x2cebcb['monitor_format']){logger[_0x8706('0xf')]('['+_0x345462[_0x8706('0x5f')][_0x8706('0x60')]()+']',_0x8706('0x4d'));_0x345462[_0x8706('0x50')]=util[_0x8706('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x552e26[_0x8706('0x4a')],_0x345462[_0x8706('0x4f')],md5(_0x345462[_0x8706('0x4f')]));}else{_0x345462[_0x8706('0x50')]='';}headers['Authorization']=getAuth(_0x552e26);return getUser(_0x552e26,'')[_0x8706('0x23')](function(_0x4ac96f){_0xe067b5=_0x4ac96f;logger[_0x8706('0xf')]('The\x20User\x20ID\x20is:',_0xe067b5['id']);return getEndUser(_0x552e26,_0x345462[_0x8706('0x12')],_0x345462[_0x8706('0x13')]);})['then'](function(_0x5d4de9){_0x423720=_0x5d4de9;logger[_0x8706('0xf')]('The\x20Enduser\x20ID\x20is:',_0x423720['id']);return getTicket(_0x552e26,_0xe067b5,_0x423720,_0x488148,_0x345462);})['then'](function(_0x1fc948){if(_0x1fc948){logger[_0x8706('0xf')](_0x8706('0x20'));logger[_0x8706('0xf')]('The\x20Ticket\x20ID\x20is:',_0x1fc948['id']);}})[_0x8706('0x55')](function(_0x44149d){logger[_0x8706('0x56')]('['+_0x345462[_0x8706('0x5f')][_0x8706('0x60')]()+']',JSON[_0x8706('0x57')](_0x44149d));});}; \ 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 73ff38c..6c00dcd 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 _0xd720=['work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','length','email','adminEmail','adminId','info','Admin\x20found:','catch','error','toUpperCase','Getting\x20user\x20list','then','users','agentEmail','userId','User\x20found:','userEmail','Requested\x20Resource\x20not\x20Found','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:'];(function(_0x4b6804,_0x301b24){var _0x11b4f1=function(_0x31e66c){while(--_0x31e66c){_0x4b6804['push'](_0x4b6804['shift']());}};_0x11b4f1(++_0x301b24);}(_0xd720,0x139));var _0x0d72=function(_0x3e37e6,_0x22dd74){_0x3e37e6=_0x3e37e6-0x0;var _0xea6828=_0xd720[_0x3e37e6];return _0xea6828;};'use strict';var _=require(_0x0d72('0x0'));var rp=require(_0x0d72('0x1'));var md5=require(_0x0d72('0x2'));var util=require(_0x0d72('0x3'));var moment=require(_0x0d72('0x4'));var Promise=require(_0x0d72('0x5'));var Redis=require(_0x0d72('0x6'));var intUtil=require(_0x0d72('0x7'));var config=require(_0x0d72('0x8'));var logger=require(_0x0d72('0x9'))(_0x0d72('0xa'));config['redis']=_[_0x0d72('0xb')](config[_0x0d72('0xc')],{'host':_0x0d72('0xd'),'port':0x18eb});var io=require(_0x0d72('0xe'))(new Redis(config[_0x0d72('0xc')]));function getAdminId(_0x1d1606,_0x354136,_0x4cdc57,_0x3a6b39){return new Promise(function(_0x22daa8,_0x39f789){var _0x1a33ff=![];var _0x50911a={'method':_0x0d72('0xf'),'uri':_0x3a6b39+_0x0d72('0x10'),'json':!![]};_0x50911a[_0x0d72('0x11')]=_0x4cdc57;logger['info'](_0x0d72('0x12'));return rp(_0x50911a)['then'](function(_0x414569){if(_0x414569){var _0x46be92=_0x414569['users'];var _0x136744=null;for(_0x136744=0x0;_0x136744<_0x46be92[_0x0d72('0x13')];_0x136744++){if(_0x46be92[_0x136744][_0x0d72('0x14')]===_0x1d1606[_0x0d72('0x15')]){_0x1d1606[_0x0d72('0x16')]=_0x46be92[_0x136744]['id'];_0x1a33ff=!![];}}if(_0x1a33ff){logger[_0x0d72('0x17')](_0x0d72('0x18'),_0x1d1606[_0x0d72('0x16')]);_0x22daa8(_0x1d1606);}else{_0x39f789({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x39f789({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x0d72('0x19')](function(_0x3dab24){logger[_0x0d72('0x1a')]('['+[_0x354136[_0x0d72('0x1b')]()]+']',_0x3dab24['message']);_0x39f789(_0x3dab24);});});}function getUser(_0x56a68c,_0xea6acb,_0x2f3e44){return function(_0x49b02b){return new Promise(function(_0x2707b9,_0x5e8404){var _0x25f167={'method':_0x0d72('0xf'),'uri':_0x2f3e44+_0x0d72('0x10'),'json':!![]};_0x25f167[_0x0d72('0x11')]=_0xea6acb;logger['info'](_0x0d72('0x1c'));return rp(_0x25f167)[_0x0d72('0x1d')](function(_0x453196){if(_0x453196){var _0x14de59=_0x453196[_0x0d72('0x1e')];var _0x476fa9=![];var _0x3fab1c=null;if(_0x49b02b[_0x0d72('0x1f')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x49b02b['agentEmail']);_0x49b02b['userEmail']=_0x49b02b['agentEmail'];for(_0x3fab1c=0x0;_0x3fab1c<_0x14de59['length'];_0x3fab1c++){if(_0x14de59[_0x3fab1c][_0x0d72('0x14')]===_0x49b02b[_0x0d72('0x1f')]){_0x476fa9=!![];_0x49b02b[_0x0d72('0x20')]=_0x14de59[_0x3fab1c]['id'];logger[_0x0d72('0x17')](_0x0d72('0x21'),_0x49b02b[_0x0d72('0x20')]);}}}if(!_0x476fa9){logger['info']('Admin\x20selected');_0x49b02b[_0x0d72('0x22')]=_0x49b02b[_0x0d72('0x15')];_0x49b02b[_0x0d72('0x20')]=_0x49b02b[_0x0d72('0x16')];_0x476fa9=!![];}if(_0x476fa9){_0x2707b9(_0x49b02b);}else{_0x5e8404({'statusCode':0x194,'message':_0x0d72('0x23')});}}else{_0x5e8404({'statusCode':0x194,'message':_0x0d72('0x23')});}})[_0x0d72('0x19')](function(_0x5c1919){logger[_0x0d72('0x1a')]('['+[_0x56a68c[_0x0d72('0x1b')]()]+']',_0x5c1919[_0x0d72('0x24')]);_0x5e8404(_0x5c1919);});});};}function searchContact(_0x23e648,_0x37ccfd,_0x236a27,_0x8f417c){return new Promise(function(_0x468bdb,_0x340c0b){var _0x2c161a={'method':_0x0d72('0xf'),'headers':_0x37ccfd,'uri':_0x23e648+_0x0d72('0x25')+_0x8f417c+_0x0d72('0x26')+_0x236a27+_0x0d72('0x27'),'json':!![]};rp(_0x2c161a)[_0x0d72('0x1d')](function(_0x4087de){var _0x259b26=_[_0x0d72('0x28')](_0x4087de['contacts'][_0x0d72('0x29')],[_0x236a27,_0x8f417c]);_0x468bdb(_0x259b26);})[_0x0d72('0x19')](function(_0x2e1fce){_0x340c0b(_0x2e1fce);});});}function getEndUser(_0x23d8f7,_0x4c7b95,_0x3cb204){return function(_0x5ddfc0){return new Promise(function(_0x12c350,_0x1cc54a){logger[_0x0d72('0x17')](util[_0x0d72('0x2a')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5ddfc0[_0x0d72('0x2b')]));searchContact(_0x3cb204,_0x4c7b95,_0x0d72('0x2c'),_0x5ddfc0['contactNumber'])['then'](function(_0x3d59e8){if(_0x3d59e8){_0x5ddfc0[_0x0d72('0x2d')]=_0x3d59e8['id'];logger[_0x0d72('0x17')](_0x0d72('0x2e'),_0x5ddfc0[_0x0d72('0x2d')]);return _0x12c350(_0x5ddfc0);}searchContact(_0x3cb204,_0x4c7b95,_0x0d72('0x2f'),_0x5ddfc0[_0x0d72('0x2b')])['then'](function(_0x15b21f){if(_0x15b21f){_0x5ddfc0[_0x0d72('0x2d')]=_0x15b21f['id'];logger['info'](_0x0d72('0x30'),_0x5ddfc0[_0x0d72('0x2d')]);return _0x12c350(_0x5ddfc0);}createEndUser(_0x5ddfc0,_0x23d8f7,_0x4c7b95,_0x3cb204)[_0x0d72('0x1d')](function(_0x2e2029){logger[_0x0d72('0x17')](_0x0d72('0x31'),_0x2e2029[_0x0d72('0x2d')]);return _0x12c350(_0x2e2029);});});})[_0x0d72('0x19')](function(_0x175674){_0x1cc54a(_0x175674);});});};}function createEndUser(_0x470546,_0x2cf257,_0x315493,_0x5a791f){return new Promise(function(_0x401362,_0x23ac8c){var _0x507966=moment();var _0x31f6ab={'method':'POST','uri':_0x5a791f+_0x0d72('0x32'),'body':{'contact':{'last_name':_0x470546['contactNumber'],'work_number':_0x470546[_0x0d72('0x2b')],'mobile_number':_0x470546[_0x0d72('0x2b')],'owner_id':_0x470546[_0x0d72('0x20')],'created_at':_0x507966[_0x0d72('0x2a')](_0x0d72('0x33'))}},'json':!![]};_0x31f6ab['headers']=_0x315493;logger[_0x0d72('0x17')](_0x0d72('0x34'));return rp(_0x31f6ab)[_0x0d72('0x1d')](function(_0x59b602){_0x470546[_0x0d72('0x2d')]=_0x59b602[_0x0d72('0x35')]['id'];_0x401362(_0x470546);})[_0x0d72('0x19')](function(_0x2d1ffa){logger[_0x0d72('0x1a')]('['+[_0x2cf257[_0x0d72('0x1b')]()]+']',_0x2d1ffa[_0x0d72('0x24')]);_0x23ac8c(_0x2d1ffa[_0x0d72('0x24')]);});});}function getTicket(_0x546b14,_0x2e3edf,_0x44c60c,_0x451b48,_0x2c117e){return function(_0x203f45){logger[_0x0d72('0x17')](_0x0d72('0x36'));return new Promise(function(_0x2ad9d1,_0x2fd9ce){var _0x3631e5=moment();var _0x2eb0ed={'method':_0x0d72('0x37'),'uri':_0x44c60c+_0x0d72('0x38'),'body':{'title':intUtil[_0x0d72('0x39')](_0x451b48[_0x0d72('0x3a')],_0x2c117e,'\x20'),'description':intUtil[_0x0d72('0x39')](_0x451b48['Descriptions'],_0x2c117e,'\x0a'),'owner_id':_0x203f45[_0x0d72('0x20')],'creater_id':_0x203f45[_0x0d72('0x16')],'targetable_id':_0x203f45[_0x0d72('0x2d')],'targetable_type':_0x0d72('0x3b'),'created_at':_0x3631e5[_0x0d72('0x2a')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3631e5[_0x0d72('0x3c')](0x1e,'m')[_0x0d72('0x2a')](_0x0d72('0x33'))},'json':!![]};_0x2eb0ed[_0x0d72('0x11')]=_0x2e3edf;return rp(_0x2eb0ed)[_0x0d72('0x1d')](function(_0x5dcd6c){_0x203f45[_0x0d72('0x3d')]=_0x5dcd6c[_0x0d72('0x3e')]['id'];logger[_0x0d72('0x17')](_0x0d72('0x3f'),_0x203f45[_0x0d72('0x3d')]);_0x2ad9d1(_0x203f45);})['catch'](function(_0x21d9d1){logger[_0x0d72('0x1a')]('['+[_0x546b14[_0x0d72('0x1b')]()]+']',_0x21d9d1[_0x0d72('0x24')]);_0x2fd9ce(_0x21d9d1[_0x0d72('0x24')]);});});};}function emit(_0x5550ff,_0x16e7cd,_0x1007cd){var _0x14b30c={'uri':_0x5550ff+_0x0d72('0x40')+_0x1007cd};io['to'](util[_0x0d72('0x2a')]('user:%s',_0x16e7cd))[_0x0d72('0x41')](_0x0d72('0x42'),_0x14b30c);}exports['cs']=function(_0xda6d0e,_0x5ee176,_0x298b8c,_0x4a90b4,_0x2f681f,_0x2ca1a4,_0x1a9673,_0x11f589){var _0x2d2761={};var _0x2fc19e={'Authorization':_0x0d72('0x43')+_0x2ca1a4[_0x0d72('0x44')]};_0x2ca1a4[_0x0d72('0x45')]=intUtil[_0x0d72('0x46')](_0x2ca1a4[_0x0d72('0x45')]);_0x2ca1a4['serverUrl']=intUtil[_0x0d72('0x46')](_0x2ca1a4[_0x0d72('0x47')]);var _0x12b69f=_0x2ca1a4[_0x0d72('0x45')];_0x2d2761['adminEmail']=_0x2ca1a4['username'];_0x2d2761[_0x0d72('0x2b')]=_0x11f589['toLowerCase']()===_0x0d72('0x48')?_0x5ee176[_0x0d72('0x49')]:_0x5ee176['calleridnum'];_0x2d2761[_0x0d72('0x4a')]=_0x11f589===_0x0d72('0x4b')||_0x11f589===_0x0d72('0x4c')?'queue':_0x0d72('0x48');if(_0x4a90b4){_0x2d2761[_0x0d72('0x1f')]=_0x4a90b4['email'];}var _0x23e0c2=util[_0x0d72('0x2a')](_0x0d72('0x4d'),_0x2ca1a4[_0x0d72('0x47')],_0x5ee176[_0x0d72('0x4e')],md5(_0x5ee176[_0x0d72('0x4e')]));if(_0x2f681f&&_0x2f681f[_0x0d72('0x4f')]){logger[_0x0d72('0x17')](_0x0d72('0x50'),_0x0d72('0x51'));_0x5ee176[_0x0d72('0x52')]=_0x23e0c2;}else if(_0x1a9673&&_0x1a9673[_0x0d72('0x53')]&&_0x1a9673[_0x0d72('0x53')]!=='none'){logger[_0x0d72('0x17')](_0x0d72('0x54'),'Recording\x20is\x20enabled!');_0x5ee176[_0x0d72('0x52')]=_0x23e0c2;}else{_0x5ee176[_0x0d72('0x52')]='';}return getAdminId(_0x2d2761,_0x11f589,_0x2fc19e,_0x12b69f)['then'](getUser(_0x11f589,_0x2fc19e,_0x12b69f))[_0x0d72('0x1d')](getEndUser(_0x11f589,_0x2fc19e,_0x12b69f))[_0x0d72('0x1d')](getTicket(_0x11f589,_0x2fc19e,_0x12b69f,_0x298b8c,_0x5ee176))[_0x0d72('0x1d')](function(_0x1b91a3){logger[_0x0d72('0x17')](util['format'](_0x0d72('0x55'),_0x1b91a3[_0x0d72('0x3d')]));if(_0x11f589!==_0x0d72('0x4c')){logger[_0x0d72('0x17')]('['+[_0x11f589['toUpperCase']()]+']',_0x0d72('0x56'));emit(_0x12b69f,_0x4a90b4[_0x0d72('0x57')],_0x1b91a3[_0x0d72('0x2d')]);}})[_0x0d72('0x19')](function(_0x4e01dc){logger[_0x0d72('0x1a')]('['+[_0x11f589[_0x0d72('0x1b')]()]+_0x0d72('0x58'),util[_0x0d72('0x59')](_0x4e01dc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x34af=['Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','adminEmail','toLowerCase','outbound','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info'];(function(_0x15b474,_0x417c65){var _0x38473a=function(_0x5b8984){while(--_0x5b8984){_0x15b474['push'](_0x15b474['shift']());}};_0x38473a(++_0x417c65);}(_0x34af,0xeb));var _0xf34a=function(_0x192b3d,_0x3d08d2){_0x192b3d=_0x192b3d-0x0;var _0xe0f3e7=_0x34af[_0x192b3d];return _0xe0f3e7;};'use strict';var _=require(_0xf34a('0x0'));var rp=require(_0xf34a('0x1'));var md5=require(_0xf34a('0x2'));var util=require('util');var moment=require(_0xf34a('0x3'));var Promise=require(_0xf34a('0x4'));var Redis=require(_0xf34a('0x5'));var intUtil=require(_0xf34a('0x6'));var config=require(_0xf34a('0x7'));var logger=require(_0xf34a('0x8'))(_0xf34a('0x9'));config[_0xf34a('0xa')]=_[_0xf34a('0xb')](config[_0xf34a('0xa')],{'host':_0xf34a('0xc'),'port':0x18eb});var io=require(_0xf34a('0xd'))(new Redis(config[_0xf34a('0xa')]));function getAdminId(_0x2577db,_0x223b6f,_0x2662f7,_0x37d98d){return new Promise(function(_0x2c6699,_0x116a03){var _0x1336b6=![];var _0xe77894={'method':_0xf34a('0xe'),'uri':_0x37d98d+'/api/selector/owners','json':!![]};_0xe77894[_0xf34a('0xf')]=_0x2662f7;logger[_0xf34a('0x10')](_0xf34a('0x11'));return rp(_0xe77894)[_0xf34a('0x12')](function(_0x1c5da2){if(_0x1c5da2){var _0x3ee712=_0x1c5da2['users'];var _0x37037c=null;for(_0x37037c=0x0;_0x37037c<_0x3ee712[_0xf34a('0x13')];_0x37037c++){if(_0x3ee712[_0x37037c][_0xf34a('0x14')]===_0x2577db['adminEmail']){_0x2577db[_0xf34a('0x15')]=_0x3ee712[_0x37037c]['id'];_0x1336b6=!![];}}if(_0x1336b6){logger[_0xf34a('0x10')](_0xf34a('0x16'),_0x2577db['adminId']);_0x2c6699(_0x2577db);}else{_0x116a03({'statusCode':0x194,'message':_0xf34a('0x17')});}}else{_0x116a03({'statusCode':0x194,'message':_0xf34a('0x17')});}})[_0xf34a('0x18')](function(_0x3ead10){logger[_0xf34a('0x19')]('['+[_0x223b6f[_0xf34a('0x1a')]()]+']',_0x3ead10[_0xf34a('0x1b')]);_0x116a03(_0x3ead10);});});}function getUser(_0x36c58d,_0x242f93,_0xc0d1ad){return function(_0x119b33){return new Promise(function(_0x45de25,_0x386d89){var _0x2b3fe2={'method':_0xf34a('0xe'),'uri':_0xc0d1ad+_0xf34a('0x1c'),'json':!![]};_0x2b3fe2[_0xf34a('0xf')]=_0x242f93;logger[_0xf34a('0x10')](_0xf34a('0x1d'));return rp(_0x2b3fe2)[_0xf34a('0x12')](function(_0x5550fb){if(_0x5550fb){var _0x7f67ab=_0x5550fb[_0xf34a('0x1e')];var _0x112c29=![];var _0x21c407=null;if(_0x119b33[_0xf34a('0x1f')]!==null){logger['info'](_0xf34a('0x20'),_0x119b33[_0xf34a('0x1f')]);_0x119b33[_0xf34a('0x21')]=_0x119b33[_0xf34a('0x1f')];for(_0x21c407=0x0;_0x21c407<_0x7f67ab[_0xf34a('0x13')];_0x21c407++){if(_0x7f67ab[_0x21c407]['email']===_0x119b33[_0xf34a('0x1f')]){_0x112c29=!![];_0x119b33[_0xf34a('0x22')]=_0x7f67ab[_0x21c407]['id'];logger[_0xf34a('0x10')](_0xf34a('0x23'),_0x119b33['userId']);}}}if(!_0x112c29){logger[_0xf34a('0x10')]('Admin\x20selected');_0x119b33[_0xf34a('0x21')]=_0x119b33['adminEmail'];_0x119b33['userId']=_0x119b33[_0xf34a('0x15')];_0x112c29=!![];}if(_0x112c29){_0x45de25(_0x119b33);}else{_0x386d89({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x386d89({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf34a('0x18')](function(_0x18c0c7){logger[_0xf34a('0x19')]('['+[_0x36c58d[_0xf34a('0x1a')]()]+']',_0x18c0c7[_0xf34a('0x1b')]);_0x386d89(_0x18c0c7);});});};}function searchContact(_0x2c51c5,_0x5d93e0,_0x595a5f,_0x2b141a){return new Promise(function(_0x21dfed,_0xf4208d){var _0x55cf97={'method':_0xf34a('0xe'),'headers':_0x5d93e0,'uri':_0x2c51c5+'/api/lookup?q='+_0x2b141a+'&f='+_0x595a5f+_0xf34a('0x24'),'json':!![]};rp(_0x55cf97)[_0xf34a('0x12')](function(_0x32fedf){var _0x52539c=_['find'](_0x32fedf[_0xf34a('0x25')][_0xf34a('0x25')],[_0x595a5f,_0x2b141a]);_0x21dfed(_0x52539c);})[_0xf34a('0x18')](function(_0x2d3ae9){_0xf4208d(_0x2d3ae9);});});}function getEndUser(_0x5e8c4b,_0x105204,_0x13d662){return function(_0x5ee944){return new Promise(function(_0x9ff0d4,_0x366004){logger[_0xf34a('0x10')](util[_0xf34a('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5ee944[_0xf34a('0x27')]));searchContact(_0x13d662,_0x105204,_0xf34a('0x28'),_0x5ee944[_0xf34a('0x27')])[_0xf34a('0x12')](function(_0x5c3b25){if(_0x5c3b25){_0x5ee944[_0xf34a('0x29')]=_0x5c3b25['id'];logger['info'](_0xf34a('0x2a'),_0x5ee944['endUserId']);return _0x9ff0d4(_0x5ee944);}searchContact(_0x13d662,_0x105204,_0xf34a('0x2b'),_0x5ee944['contactNumber'])[_0xf34a('0x12')](function(_0x4f033c){if(_0x4f033c){_0x5ee944[_0xf34a('0x29')]=_0x4f033c['id'];logger[_0xf34a('0x10')](_0xf34a('0x2c'),_0x5ee944[_0xf34a('0x29')]);return _0x9ff0d4(_0x5ee944);}createEndUser(_0x5ee944,_0x5e8c4b,_0x105204,_0x13d662)[_0xf34a('0x12')](function(_0x5e543f){logger[_0xf34a('0x10')](_0xf34a('0x2d'),_0x5e543f[_0xf34a('0x29')]);return _0x9ff0d4(_0x5e543f);});});})[_0xf34a('0x18')](function(_0x109bf3){_0x366004(_0x109bf3);});});};}function createEndUser(_0x36a3c7,_0x4b45ef,_0x447d36,_0x5c4c01){return new Promise(function(_0x593e02,_0x2e6d69){var _0x559120=moment();var _0x5c4fa3={'method':_0xf34a('0x2e'),'uri':_0x5c4c01+'/api/contacts','body':{'contact':{'last_name':_0x36a3c7[_0xf34a('0x27')],'work_number':_0x36a3c7[_0xf34a('0x27')],'mobile_number':_0x36a3c7['contactNumber'],'owner_id':_0x36a3c7[_0xf34a('0x22')],'created_at':_0x559120[_0xf34a('0x26')](_0xf34a('0x2f'))}},'json':!![]};_0x5c4fa3['headers']=_0x447d36;logger[_0xf34a('0x10')](_0xf34a('0x30'));return rp(_0x5c4fa3)[_0xf34a('0x12')](function(_0x3d65a5){_0x36a3c7[_0xf34a('0x29')]=_0x3d65a5[_0xf34a('0x31')]['id'];_0x593e02(_0x36a3c7);})[_0xf34a('0x18')](function(_0x607d17){logger[_0xf34a('0x19')]('['+[_0x4b45ef[_0xf34a('0x1a')]()]+']',_0x607d17[_0xf34a('0x1b')]);_0x2e6d69(_0x607d17[_0xf34a('0x1b')]);});});}function getTicket(_0x20ed5b,_0x2bd745,_0x4ed7af,_0x139aaa,_0x36d854){return function(_0x7668e1){logger[_0xf34a('0x10')](_0xf34a('0x32'));return new Promise(function(_0x49f0a7,_0x599a8f){var _0x4f1276=moment();var _0x6d854f={'method':_0xf34a('0x2e'),'uri':_0x4ed7af+_0xf34a('0x33'),'body':{'title':intUtil[_0xf34a('0x34')](_0x139aaa[_0xf34a('0x35')],_0x36d854,'\x20'),'description':intUtil[_0xf34a('0x34')](_0x139aaa[_0xf34a('0x36')],_0x36d854,'\x0a'),'owner_id':_0x7668e1[_0xf34a('0x22')],'creater_id':_0x7668e1[_0xf34a('0x15')],'targetable_id':_0x7668e1['endUserId'],'targetable_type':_0xf34a('0x37'),'created_at':_0x4f1276[_0xf34a('0x26')](_0xf34a('0x2f')),'due_date':_0x4f1276[_0xf34a('0x38')](0x1e,'m')['format'](_0xf34a('0x2f'))},'json':!![]};_0x6d854f['headers']=_0x2bd745;return rp(_0x6d854f)['then'](function(_0x28675d){_0x7668e1[_0xf34a('0x39')]=_0x28675d[_0xf34a('0x3a')]['id'];logger[_0xf34a('0x10')](_0xf34a('0x3b'),_0x7668e1['ticketId']);_0x49f0a7(_0x7668e1);})[_0xf34a('0x18')](function(_0x533c14){logger[_0xf34a('0x19')]('['+[_0x20ed5b[_0xf34a('0x1a')]()]+']',_0x533c14[_0xf34a('0x1b')]);_0x599a8f(_0x533c14[_0xf34a('0x1b')]);});});};}function emit(_0x298835,_0x46299d,_0x20d0bd){var _0x19f428={'uri':_0x298835+'/contacts/'+_0x20d0bd};io['to'](util[_0xf34a('0x26')](_0xf34a('0x3c'),_0x46299d))[_0xf34a('0x3d')](_0xf34a('0x3e'),_0x19f428);}exports['cs']=function(_0xb165dd,_0x4beab6,_0x27f246,_0x1e1e3f,_0x465013,_0x4e6e22,_0x599733,_0x322992){var _0xdc68ac={};var _0x1a8aba={'Authorization':_0xf34a('0x3f')+_0x4e6e22['apiKey']};_0x4e6e22[_0xf34a('0x40')]=intUtil[_0xf34a('0x41')](_0x4e6e22[_0xf34a('0x40')]);_0x4e6e22[_0xf34a('0x42')]=intUtil[_0xf34a('0x41')](_0x4e6e22['serverUrl']);var _0x141f4b=_0x4e6e22[_0xf34a('0x40')];_0xdc68ac[_0xf34a('0x43')]=_0x4e6e22['username'];_0xdc68ac[_0xf34a('0x27')]=_0x322992[_0xf34a('0x44')]()===_0xf34a('0x45')?_0x4beab6[_0xf34a('0x46')]:_0x4beab6['calleridnum'];_0xdc68ac[_0xf34a('0x47')]=_0x322992==='queue'||_0x322992===_0xf34a('0x48')?_0xf34a('0x49'):_0xf34a('0x45');if(_0x1e1e3f){_0xdc68ac[_0xf34a('0x1f')]=_0x1e1e3f['email'];}var _0x3c8914=util[_0xf34a('0x26')](_0xf34a('0x4a'),_0x4e6e22[_0xf34a('0x42')],_0x4beab6[_0xf34a('0x4b')],md5(_0x4beab6[_0xf34a('0x4b')]));if(_0x465013&&_0x465013['monitor_format']){logger[_0xf34a('0x10')]('[QUEUE]',_0xf34a('0x4c'));_0x4beab6['recordingURL']=_0x3c8914;}else if(_0x599733&&_0x599733['recordingFormat']&&_0x599733[_0xf34a('0x4d')]!==_0xf34a('0x4e')){logger[_0xf34a('0x10')]('[OUTBOUND]',_0xf34a('0x4c'));_0x4beab6[_0xf34a('0x4f')]=_0x3c8914;}else{_0x4beab6[_0xf34a('0x4f')]='';}return getAdminId(_0xdc68ac,_0x322992,_0x1a8aba,_0x141f4b)[_0xf34a('0x12')](getUser(_0x322992,_0x1a8aba,_0x141f4b))[_0xf34a('0x12')](getEndUser(_0x322992,_0x1a8aba,_0x141f4b))[_0xf34a('0x12')](getTicket(_0x322992,_0x1a8aba,_0x141f4b,_0x27f246,_0x4beab6))[_0xf34a('0x12')](function(_0x4c465e){logger[_0xf34a('0x10')](util['format'](_0xf34a('0x50'),_0x4c465e[_0xf34a('0x39')]));if(_0x322992!==_0xf34a('0x48')){logger[_0xf34a('0x10')]('['+[_0x322992[_0xf34a('0x1a')]()]+']',_0xf34a('0x51'));emit(_0x141f4b,_0x1e1e3f[_0xf34a('0x52')],_0x4c465e[_0xf34a('0x29')]);}})['catch'](function(_0x28d447){logger['error']('['+[_0x322992[_0xf34a('0x1a')]()]+_0xf34a('0x53'),util['inspect'](_0x28d447,{'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 cfb9d57..7f2f96c 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 _0x2df4=['data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','unmanaged','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2df4,0x1b3));var _0x42df=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x2df4[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x42df('0x0'));var util=require(_0x42df('0x1'));var zendesk=require(_0x42df('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x42df('0x3'));var freshdesk=require(_0x42df('0x4'));var zoho=require(_0x42df('0x5'));var desk=require(_0x42df('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0x42df('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0x42df('0x8'));var integrations=[_0x42df('0x9'),_0x42df('0xa'),_0x42df('0xb'),_0x42df('0xc'),_0x42df('0xd'),_0x42df('0xe'),_0x42df('0xf'),_0x42df('0x10'),_0x42df('0x11'),_0x42df('0x12')];exports[_0x42df('0x13')]=function(_0x569c1a,_0x40382a,_0x228387,_0xed0386,_0x1ac47f,_0x51f65a){if(_0x228387){if(_[_0x42df('0x14')](integrations,_0x569c1a[_0x42df('0x15')][_0x42df('0x16')]())){try{var _0x826eee=null;var _0x10e117='';var _0xe63a2d=_0x228387[_0x569c1a['data1'][_0x42df('0x16')]()];if(_0xe63a2d){var _0x5219f3=_0xe63a2d[_0x569c1a[_0x42df('0x17')]];if(_0x5219f3){var _0x4dc606=_[_0x42df('0x18')](_0x5219f3[_0x42df('0x19')],{'id':parseInt(_0x569c1a[_0x42df('0x1a')],0xa)});if(_0x4dc606){if(_0xed0386){if(_0x1ac47f&&_0x40382a[_0x42df('0x1b')]){_0x10e117=_0x42df('0x1b');}else if(_0x40382a[_0x42df('0x1c')]){_0x10e117='outbound';}else{console[_0x42df('0x1d')]('EVENT\x20UNKNOWN',_0x40382a);}}else{_0x10e117=_0x42df('0x1e');}switch(_0x569c1a[_0x42df('0x15')][_0x42df('0x16')]()){case _0x42df('0x9'):zendesk[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case _0x42df('0xa'):salesforce[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case _0x42df('0xb'):sugarcrm[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case'freshdesk':freshdesk[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case'zoho':zoho[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case'desk':desk[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case _0x42df('0xf'):vtiger[_0x10e117](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a);break;case _0x42df('0x11'):freshsales['cs'](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a,_0x10e117);break;case _0x42df('0x12'):servicenow['cs'](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a,_0x10e117);break;case _0x42df('0x10'):dynamics365['cs'](_0x569c1a,_0x40382a,_0x4dc606,_0xed0386,_0x1ac47f,_0x5219f3,_0x51f65a,_0x10e117);break;default:console[_0x42df('0x1d')](_0x42df('0x1f'));}}else{_0x826eee=require(_0x42df('0x20'))(_0x569c1a[_0x42df('0x15')][_0x42df('0x16')]());_0x826eee['error']('[EXEC]',util[_0x42df('0x21')](_0x42df('0x22'),_0x569c1a[_0x42df('0x15')][_0x42df('0x16')](),_0x569c1a[_0x42df('0x1a')]));}}else{_0x826eee=require('../../../../config/logger')(_0x569c1a[_0x42df('0x15')]['toLowerCase']());_0x826eee[_0x42df('0x23')](_0x42df('0x24'),util['format'](_0x42df('0x25'),_0x569c1a[_0x42df('0x15')][_0x42df('0x16')](),_0x569c1a['data2']));}}else{}}catch(_0x166a3f){console[_0x42df('0x23')](_0x166a3f);}}}}; \ No newline at end of file +var _0x1a81=['queue','log','EVENT\x20UNKNOWN','salesforce','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3'];(function(_0x23ccf6,_0x7710ce){var _0x1b7eb0=function(_0x398172){while(--_0x398172){_0x23ccf6['push'](_0x23ccf6['shift']());}};_0x1b7eb0(++_0x7710ce);}(_0x1a81,0x107));var _0x11a8=function(_0x57add5,_0x3bd03e){_0x57add5=_0x57add5-0x0;var _0x8d9cd4=_0x1a81[_0x57add5];return _0x8d9cd4;};'use strict';var _=require(_0x11a8('0x0'));var util=require(_0x11a8('0x1'));var zendesk=require(_0x11a8('0x2'));var salesforce=require(_0x11a8('0x3'));var sugarcrm=require(_0x11a8('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x11a8('0x5'));var desk=require('./desk');var vtiger=require(_0x11a8('0x6'));var servicenow=require(_0x11a8('0x7'));var dynamics365=require(_0x11a8('0x8'));var freshsales=require('./freshsales');var integrations=[_0x11a8('0x9'),'salesforce',_0x11a8('0xa'),_0x11a8('0xb'),_0x11a8('0xc'),_0x11a8('0xd'),_0x11a8('0xe'),_0x11a8('0xf'),_0x11a8('0x10'),_0x11a8('0x11')];exports[_0x11a8('0x12')]=function(_0xfae6a1,_0x5030a9,_0xe6f2d4,_0x12b2c3,_0x7a65,_0x2ae2e1){if(_0xe6f2d4){if(_[_0x11a8('0x13')](integrations,_0xfae6a1[_0x11a8('0x14')]['toLowerCase']())){try{var _0x517bf7=null;var _0x3f9e5c='';var _0x6c4a04=_0xe6f2d4[_0xfae6a1[_0x11a8('0x14')][_0x11a8('0x15')]()];if(_0x6c4a04){var _0xe8176d=_0x6c4a04[_0xfae6a1['data2']];if(_0xe8176d){var _0x3f1bc0=_[_0x11a8('0x16')](_0xe8176d[_0x11a8('0x17')],{'id':parseInt(_0xfae6a1[_0x11a8('0x18')],0xa)});if(_0x3f1bc0){if(_0x12b2c3){if(_0x7a65&&_0x5030a9[_0x11a8('0x19')]){_0x3f9e5c=_0x11a8('0x19');}else if(_0x5030a9['routeId']){_0x3f9e5c='outbound';}else{console[_0x11a8('0x1a')](_0x11a8('0x1b'),_0x5030a9);}}else{_0x3f9e5c='unmanaged';}switch(_0xfae6a1[_0x11a8('0x14')]['toLowerCase']()){case _0x11a8('0x9'):zendesk[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0x1c'):salesforce[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0xa'):sugarcrm[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0xb'):freshdesk[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case'zoho':zoho[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0xd'):desk[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0xe'):vtiger[_0x3f9e5c](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1);break;case _0x11a8('0x10'):freshsales['cs'](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1,_0x3f9e5c);break;case'servicenow':servicenow['cs'](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1,_0x3f9e5c);break;case'dynamics365':dynamics365['cs'](_0xfae6a1,_0x5030a9,_0x3f1bc0,_0x12b2c3,_0x7a65,_0xe8176d,_0x2ae2e1,_0x3f9e5c);break;default:console[_0x11a8('0x1a')](_0x11a8('0x1d'));}}else{_0x517bf7=require('../../../../config/logger')(_0xfae6a1[_0x11a8('0x14')][_0x11a8('0x15')]());_0x517bf7[_0x11a8('0x1e')](_0x11a8('0x1f'),util[_0x11a8('0x20')](_0x11a8('0x21'),_0xfae6a1['data1'][_0x11a8('0x15')](),_0xfae6a1['data3']));}}else{_0x517bf7=require(_0x11a8('0x22'))(_0xfae6a1['data1'][_0x11a8('0x15')]());_0x517bf7[_0x11a8('0x1e')](_0x11a8('0x1f'),util[_0x11a8('0x20')](_0x11a8('0x23'),_0xfae6a1['data1']['toLowerCase'](),_0xfae6a1['data2']));}}else{}}catch(_0xd30aa3){console[_0x11a8('0x1e')](_0xd30aa3);}}}}; \ 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 2ef959e..ca3f83d 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 _0x6fdf=['destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','account','WhatId','Case','AccountId','leadId','info','sobject','ticketType','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname'];(function(_0x1b09f5,_0x52d403){var _0x3974bf=function(_0x24bb98){while(--_0x24bb98){_0x1b09f5['push'](_0x1b09f5['shift']());}};_0x3974bf(++_0x52d403);}(_0x6fdf,0xfc));var _0xf6fd=function(_0x273508,_0x52ec79){_0x273508=_0x273508-0x0;var _0x5d44b6=_0x6fdf[_0x273508];return _0x5d44b6;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xf6fd('0x0'));var BPromise=require(_0xf6fd('0x1'));var md5=require(_0xf6fd('0x2'));var jsforce=require(_0xf6fd('0x3'));var util=require(_0xf6fd('0x4'));var Redis=require('ioredis');var intUtil=require(_0xf6fd('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config[_0xf6fd('0x6')]=_['defaults'](config[_0xf6fd('0x6')],{'host':_0xf6fd('0x7'),'port':0x18eb});var io=require(_0xf6fd('0x8'))(new Redis(config[_0xf6fd('0x6')]));function emit(_0x2d9155,_0x3737f3,_0x3d3f7b){io['to'](_0x2d9155)[_0xf6fd('0x9')](_0x3737f3,_0x3d3f7b);}function getTicket(_0x17a393,_0x7dac00,_0xd986e9,_0x3e693a,_0x9a5819,_0x563526,_0x294b0f,_0x48c8be){var _0x575866=Object[_0xf6fd('0xa')]({},{'OwnerId':_0x7dac00['id'],'Subject':intUtil[_0xf6fd('0xb')](_0x3e693a['Subjects'],_0x9a5819,'\x20'),'Description':intUtil['getString'](_0x3e693a[_0xf6fd('0xc')],_0x9a5819,'\x0a')},getCustomFields(_0x563526,_0x9a5819));if(_0xd986e9){if(_0x3e693a['ticketType']===_0xf6fd('0xd')){_0x575866[_0xf6fd('0xe')]=moment[_0xf6fd('0xf')]();_0x575866[_0xf6fd('0x10')]=![];_0x575866[_0xf6fd('0x11')]=![];if(_0xd986e9['endUserType']===_0xf6fd('0x12')||_0xd986e9[_0xf6fd('0x13')]===_0xf6fd('0x14')){_0x575866['WhoId']=_0xd986e9['id'];}else if(_0xd986e9[_0xf6fd('0x13')]===_0xf6fd('0x15')){_0x575866[_0xf6fd('0x16')]=_0xd986e9['id'];}}else if(_0x3e693a['ticketType']===_0xf6fd('0x17')){if(_0xd986e9[_0xf6fd('0x13')]===_0xf6fd('0x12')){_0x575866['ContactId']=_0xd986e9['id'];}else if(_0xd986e9[_0xf6fd('0x13')]===_0xf6fd('0x15')){_0x575866[_0xf6fd('0x18')]=_0xd986e9['id'];}else if(_0xd986e9[_0xf6fd('0x13')]===_0xf6fd('0x14')&&_0x3e693a[_0xf6fd('0x19')]){_0x575866[_0x3e693a[_0xf6fd('0x19')]]=_0xd986e9['id'];}else{logger[_0xf6fd('0x1a')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x294b0f[_0xf6fd('0x1b')](_0x3e693a[_0xf6fd('0x1c')])['create'](_0x575866);}function getUser(_0x1cbb17,_0x3af715,_0xbcb2e4){if(!_[_0xf6fd('0x1d')](_0x3af715)&&intUtil[_0xf6fd('0x1e')](_0x3af715)){var _0x4ee4ce={'Email':_0x3af715};var _0x51d776={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xbcb2e4[_0xf6fd('0x1b')](_0xf6fd('0x1f'))[_0xf6fd('0x20')](_0x4ee4ce,_0x51d776)[_0xf6fd('0x21')]()[_0xf6fd('0x22')](function(_0xfa80b9){if(_0xfa80b9[_0xf6fd('0x23')]){var _0x21218c=_['find'](_0xfa80b9,function(_0x24b4d7){return _0x24b4d7[_0xf6fd('0x24')]===_0x3af715;});if(_0x21218c){logger['info'](_0xf6fd('0x25'),_0x3af715);return BPromise[_0xf6fd('0x26')]({'id':_0x21218c['Id'],'name':_0x21218c[_0xf6fd('0x27')]});}}else{logger[_0xf6fd('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3af715);return _0xbcb2e4[_0xf6fd('0x28')]()[_0xf6fd('0x22')](function(_0x476cf1){return BPromise[_0xf6fd('0x26')]({'id':_0x476cf1[_0xf6fd('0x29')],'name':_0x476cf1[_0xf6fd('0x2a')]});});}});}else{logger['info'](_0xf6fd('0x2b'),_0x3af715);return _0xbcb2e4[_0xf6fd('0x28')]()[_0xf6fd('0x22')](function(_0x5ad057){return BPromise['resolve']({'id':_0x5ad057[_0xf6fd('0x29')],'name':_0x5ad057[_0xf6fd('0x2a')]});});}}function getEndUser(_0x55cae0,_0x426355,_0x106044,_0x1c66cc,_0x19ea12){var _0x34fec2={'$or':{'Phone':_0x1c66cc}};var _0x480d5e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf6fd('0x26')]()['then'](function(){logger[_0xf6fd('0x1a')](_0xf6fd('0x2c'),_0x1c66cc,_0x426355[_0xf6fd('0x2d')]);switch(_0x426355['moduleSearch']){case _0xf6fd('0x2e'):var _0x5bda5c=_['cloneDeep'](_0x34fec2);if(_0x426355[_0xf6fd('0x2f')]){var _0x502752={};_0x502752[_0x426355[_0xf6fd('0x2f')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0x5bda5c[_0xf6fd('0x31')],_0x502752);}return _0x19ea12[_0xf6fd('0x1b')](_0xf6fd('0x32'))[_0xf6fd('0x20')](_0x5bda5c,_0x480d5e)['execute']()[_0xf6fd('0x22')](function(_0x243288){if(_0x243288&&_0x243288[_0xf6fd('0x23')]){return _0x243288;}else{var _0xb7944=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355[_0xf6fd('0x34')]){var _0x4d4c03={};_0x4d4c03[_0x426355[_0xf6fd('0x34')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0xb7944['$or'],_0x4d4c03);}return _0x19ea12[_0xf6fd('0x1b')](_0xf6fd('0x35'))[_0xf6fd('0x20')](_0xb7944,_0x480d5e);}});case _0xf6fd('0x36'):var _0x216d9b=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355['additionalSearchAccount']){var _0x502752={};_0x502752[_0x426355['additionalSearchAccount']]=_0x1c66cc;_[_0xf6fd('0x30')](_0x216d9b[_0xf6fd('0x31')],_0x502752);}return _0x19ea12['sobject']('Account')[_0xf6fd('0x20')](_0x216d9b,_0x480d5e)[_0xf6fd('0x21')]()[_0xf6fd('0x22')](function(_0x445faa){if(_0x445faa&&_0x445faa[_0xf6fd('0x23')]){return _0x445faa;}else{var _0x5da623=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355['additionalSearchContact']){var _0x264a60={};_0x264a60[_0x426355[_0xf6fd('0x2f')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0x5da623[_0xf6fd('0x31')],_0x264a60);}return _0x19ea12[_0xf6fd('0x1b')](_0xf6fd('0x32'))['find'](_0x5da623,_0x480d5e)[_0xf6fd('0x22')](function(_0x20ee9e){if(_0x20ee9e&&_0x20ee9e[_0xf6fd('0x23')]){return _0x20ee9e;}else{var _0x3400c2=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355['additionalSearchLead']){var _0x4ed62={};_0x4ed62[_0x426355[_0xf6fd('0x34')]]=_0x1c66cc;_['merge'](_0x3400c2[_0xf6fd('0x31')],_0x4ed62);}return _0x19ea12['sobject'](_0xf6fd('0x35'))[_0xf6fd('0x20')](_0x3400c2,_0x480d5e);}});}});case'contact':var _0x5bda5c=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355[_0xf6fd('0x2f')]){var _0x502752={};_0x502752[_0x426355[_0xf6fd('0x2f')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0x5bda5c[_0xf6fd('0x31')],_0x502752);}return _0x19ea12['sobject']('Contact')[_0xf6fd('0x20')](_0x5bda5c,_0x480d5e)['execute']();case'lead':var _0x193bd4=_['cloneDeep'](_0x34fec2);if(_0x426355[_0xf6fd('0x34')]){var _0x502752={};_0x502752[_0x426355[_0xf6fd('0x34')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0x193bd4[_0xf6fd('0x31')],_0x502752);}return _0x19ea12['sobject'](_0xf6fd('0x35'))['find'](_0x193bd4,_0x480d5e);case _0xf6fd('0x15'):var _0x216d9b=_[_0xf6fd('0x33')](_0x34fec2);if(_0x426355['additionalSearchAccount']){var _0x502752={};_0x502752[_0x426355[_0xf6fd('0x37')]]=_0x1c66cc;_[_0xf6fd('0x30')](_0x216d9b[_0xf6fd('0x31')],_0x502752);}return _0x19ea12[_0xf6fd('0x1b')](_0xf6fd('0x38'))['find'](_0x216d9b,_0x480d5e);default:return null;}})[_0xf6fd('0x22')](function(_0x531311){if(_0x531311&&_0x531311[_0xf6fd('0x23')]){var _0x303521=_['first'](_0x531311);if(_0x303521){return BPromise[_0xf6fd('0x26')]({'id':_0x303521['Id'],'name':_0x303521[_0xf6fd('0x27')],'phone':_0x303521[_0xf6fd('0x39')],'endUserType':_0x303521['attributes'][_0xf6fd('0x3a')][_0xf6fd('0x3b')]()});}}})[_0xf6fd('0x22')](function(_0xe1927d){if(_0xe1927d){logger[_0xf6fd('0x1a')](_0xf6fd('0x3c'),_0xe1927d[_0xf6fd('0x13')],_0x1c66cc);return BPromise[_0xf6fd('0x26')](_0xe1927d);}else{logger[_0xf6fd('0x1a')](_0xf6fd('0x3d'),_0x1c66cc);var _0x19a856={'Phone':_0x1c66cc};if(_0x426355[_0xf6fd('0x3e')]){if(_0x426355[_0xf6fd('0x3e')]===_0xf6fd('0x12')){logger[_0xf6fd('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1c66cc,_0x426355['moduleCreate']);_0x19a856[_0xf6fd('0x3f')]=_0x106044!==_0xf6fd('0x40')?_0x106044:util[_0xf6fd('0x41')](_0xf6fd('0x42'),_0x1c66cc);}else if(_0x426355[_0xf6fd('0x3e')]===_0xf6fd('0x14')){logger[_0xf6fd('0x1a')](_0xf6fd('0x43'),_0x1c66cc,_0x426355[_0xf6fd('0x3e')]);_0x19a856[_0xf6fd('0x3f')]=_0x106044!==''?_0x106044:util[_0xf6fd('0x41')](_0xf6fd('0x42'),_0x1c66cc);_0x19a856['Company']=_0xf6fd('0x44');}else if(_0x426355['moduleCreate']==='account'){logger[_0xf6fd('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1c66cc,_0x426355[_0xf6fd('0x3e')]);_0x19a856[_0xf6fd('0x27')]=_0x106044!==_0xf6fd('0x40')?_0x106044:util[_0xf6fd('0x41')](_0xf6fd('0x42'),_0x1c66cc);}else{return null;}}return _0x19ea12[_0xf6fd('0x1b')](_[_0xf6fd('0x45')](_0x426355['moduleCreate']))['create'](_0x19a856)[_0xf6fd('0x22')](function(_0x3b6817){return BPromise[_0xf6fd('0x26')]({'id':_0x3b6817['id'],'endUserType':_0x426355[_0xf6fd('0x3e')]});});}});}function getCustomFields(_0x359e35,_0x5a4197){var _0x261d63={};if(_0x359e35[_0xf6fd('0x23')]>0x0){_['forEach'](_0x359e35,function(_0x32b15d){if(_[_0xf6fd('0x46')]([_0xf6fd('0x47'),'picklist'],_0x32b15d[_0xf6fd('0x3a')])&&_0x32b15d[_0xf6fd('0x48')]){_0x261d63[_0x32b15d[_0xf6fd('0x48')]]=_0x32b15d[_0xf6fd('0x49')][_0xf6fd('0x4a')]();}else if(_0x32b15d[_0xf6fd('0x3a')]===_0xf6fd('0x4b')&&_0x32b15d[_0xf6fd('0x4c')]&&_0x32b15d[_0xf6fd('0x48')]){_0x5a4197[_0x32b15d[_0xf6fd('0x4c')]]&&(_0x261d63[_0x32b15d[_0xf6fd('0x48')]]=_0x5a4197[_0x32b15d[_0xf6fd('0x4c')]][_0xf6fd('0x4a')]());}else if(_0x32b15d[_0xf6fd('0x3a')]===_0xf6fd('0x4d')&&_0x32b15d[_0xf6fd('0x4e')]&&_0x32b15d['Variable'][_0xf6fd('0x4f')]&&_0x32b15d[_0xf6fd('0x48')]){_0x5a4197[_0x32b15d[_0xf6fd('0x4e')][_0xf6fd('0x4f')]['toLowerCase']()]&&(_0x261d63[_0x32b15d[_0xf6fd('0x48')]]=_0x5a4197[_0x32b15d[_0xf6fd('0x4e')][_0xf6fd('0x4f')][_0xf6fd('0x3b')]()][_0xf6fd('0x4a')]());}});}return _0x261d63;}function getConnection(_0xb648d8){var _0x4e864=_0xb648d8['password'][_0xf6fd('0x50')](_0xb648d8['securityToken']);var _0xbbb246=new jsforce[(_0xf6fd('0x51'))]({'oauth2':{'loginUrl':_0xb648d8[_0xf6fd('0x52')]||_0xf6fd('0x53'),'clientId':_0xb648d8[_0xf6fd('0x54')],'clientSecret':_0xb648d8[_0xf6fd('0x55')]}});return _0xbbb246['login'](_0xb648d8[_0xf6fd('0x56')],_0x4e864)[_0xf6fd('0x22')](function(){logger[_0xf6fd('0x1a')](_0xf6fd('0x57'));return _0xbbb246;});}exports['queue']=function(_0x485c7c,_0x737113,_0x45e09c,_0x55e500,_0x2abcad,_0x334aac){var _0x48d9a2,_0x24d105,_0x39a1a1,_0x19a0be;_0x334aac[_0xf6fd('0x58')]=intUtil[_0xf6fd('0x59')](_0x334aac['serverUrl']);_0x334aac[_0xf6fd('0x52')]=intUtil[_0xf6fd('0x59')](_0x334aac[_0xf6fd('0x52')]);if(_0x2abcad&&_0x2abcad[_0xf6fd('0x5a')]){logger[_0xf6fd('0x1a')]('[QUEUE]',_0xf6fd('0x5b'));_0x737113[_0xf6fd('0x5c')]=util[_0xf6fd('0x41')](_0xf6fd('0x5d'),_0x334aac[_0xf6fd('0x58')],_0x737113[_0xf6fd('0x5e')],md5(_0x737113[_0xf6fd('0x5e')]));}else{_0x737113[_0xf6fd('0x5c')]='';}return getConnection(_0x334aac)[_0xf6fd('0x22')](function(_0x32fd71){_0x19a0be=_0x32fd71;return getUser(_0x334aac,_0x55e500[_0xf6fd('0x5f')],_0x19a0be);})[_0xf6fd('0x22')](function(_0x5d3708){_0x48d9a2=_0x5d3708;return getEndUser(_0x334aac,_0x45e09c,_0x737113['calleridname'],_0x737113[_0xf6fd('0x60')],_0x19a0be);})['then'](function(_0x14be0a){_0x24d105=_0x14be0a;return getTicket(_0x334aac,_0x48d9a2,_0x24d105,_0x45e09c,_0x737113,_0x45e09c[_0xf6fd('0x61')],_0x19a0be,_0xf6fd('0x62'));})[_0xf6fd('0x22')](function(_0x18b1c6){_0x39a1a1=_0x18b1c6;logger[_0xf6fd('0x1a')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x39a1a1['id']);logger[_0xf6fd('0x1a')](_0xf6fd('0x63'),_0x39a1a1['id'],_0x55e500[_0xf6fd('0x4f')],_0x334aac[_0xf6fd('0x3a')]);switch(_0x334aac[_0xf6fd('0x3a')]){case _0xf6fd('0x64'):emit(util[_0xf6fd('0x41')](_0xf6fd('0x65'),_0x55e500[_0xf6fd('0x4f')]),_0xf6fd('0x66'),{'recordId':_0x39a1a1['id']});break;case _0xf6fd('0x67'):emit(util[_0xf6fd('0x41')](_0xf6fd('0x65'),_0x55e500[_0xf6fd('0x4f')]),_0xf6fd('0x68'),{'uri':util[_0xf6fd('0x41')](_0xf6fd('0x69'),_0x19a0be[_0xf6fd('0x6a')],_0x39a1a1['id'])});break;default:logger[_0xf6fd('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xf6fd('0x6c')](function(_0x269b00){logger[_0xf6fd('0x6b')](_0xf6fd('0x6d'),_0x269b00);});};exports[_0xf6fd('0x6e')]=function(_0xf6b95c,_0x3a529f,_0xfbaaf6,_0xc3db47,_0x5d0a92,_0x2a2407,_0x2dbc1e){var _0x7b02b9,_0x5447c5,_0x51a3c0,_0x855273;_0x2a2407[_0xf6fd('0x58')]=intUtil['stripTrailingSlash'](_0x2a2407[_0xf6fd('0x58')]);_0x2a2407[_0xf6fd('0x52')]=intUtil['stripTrailingSlash'](_0x2a2407[_0xf6fd('0x52')]);if(_0x2dbc1e&&_0x2dbc1e[_0xf6fd('0x6f')]&&_0x2dbc1e[_0xf6fd('0x6f')]!=='none'){logger[_0xf6fd('0x1a')](_0xf6fd('0x70'),'Recording\x20is\x20enabled!');_0x3a529f[_0xf6fd('0x5c')]=util[_0xf6fd('0x41')](_0xf6fd('0x5d'),_0x2a2407['serverUrl'],_0x3a529f['uniqueid'],md5(_0x3a529f[_0xf6fd('0x5e')]));}return getConnection(_0x2a2407)[_0xf6fd('0x22')](function(_0x28d559){_0x855273=_0x28d559;return getUser(_0x2a2407,_0xc3db47[_0xf6fd('0x5f')],_0x855273);})['then'](function(_0x40a764){_0x7b02b9=_0x40a764;return getEndUser(_0x2a2407,_0xfbaaf6,_0x3a529f[_0xf6fd('0x71')],_0x3a529f[_0xf6fd('0x72')],_0x855273);})[_0xf6fd('0x22')](function(_0x41f266){_0x5447c5=_0x41f266;return getTicket(_0x2a2407,_0x7b02b9,_0x5447c5,_0xfbaaf6,_0x3a529f,_0xfbaaf6[_0xf6fd('0x61')],_0x855273,_0xf6fd('0x6e'));})[_0xf6fd('0x22')](function(_0x5ccef2){_0x51a3c0=_0x5ccef2;logger['info'](_0xf6fd('0x73'),_0x51a3c0['id']);logger[_0xf6fd('0x1a')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x51a3c0['id'],_0xc3db47[_0xf6fd('0x4f')],_0x2a2407['type']);switch(_0x2a2407[_0xf6fd('0x3a')]){case'integrationTab':emit(util[_0xf6fd('0x41')](_0xf6fd('0x65'),_0xc3db47[_0xf6fd('0x4f')]),'trigger:salesforce:display',{'recordId':_0x51a3c0['id']});break;case _0xf6fd('0x67'):emit(util[_0xf6fd('0x41')](_0xf6fd('0x65'),_0xc3db47['name']),_0xf6fd('0x68'),{'uri':util[_0xf6fd('0x41')](_0xf6fd('0x69'),_0x855273[_0xf6fd('0x6a')],_0x51a3c0['id'])});break;default:logger[_0xf6fd('0x6b')](_0xf6fd('0x70'),_0xf6fd('0x74'));}})[_0xf6fd('0x6c')](function(_0x213769){logger[_0xf6fd('0x6b')](_0xf6fd('0x70'),_0x213769);});};exports['unmanaged']=function(_0x41517b,_0x4f34ae,_0x2b135f,_0xd0a7cc,_0x5e14eb,_0x47aa9b){var _0x23ea3a,_0x29cf06,_0x24ef33,_0x43ce39;_0x47aa9b[_0xf6fd('0x58')]=intUtil[_0xf6fd('0x59')](_0x47aa9b['serverUrl']);_0x47aa9b[_0xf6fd('0x52')]=intUtil[_0xf6fd('0x59')](_0x47aa9b[_0xf6fd('0x52')]);if(_0x5e14eb&&_0x5e14eb[_0xf6fd('0x5a')]){logger[_0xf6fd('0x1a')]('['+_0x4f34ae[_0xf6fd('0x75')][_0xf6fd('0x76')]()+']','Recording\x20is\x20enabled!');_0x4f34ae['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47aa9b[_0xf6fd('0x58')],_0x4f34ae[_0xf6fd('0x5e')],md5(_0x4f34ae[_0xf6fd('0x5e')]));}else{_0x4f34ae[_0xf6fd('0x5c')]='';}return getConnection(_0x47aa9b)['then'](function(_0x3a56d5){_0x43ce39=_0x3a56d5;if(!_[_0xf6fd('0x1d')](_0xd0a7cc)){return getUser(_0x47aa9b,_0xd0a7cc[_0xf6fd('0x4f')],_0x43ce39);}else{return getUser(_0x47aa9b,null,_0x43ce39);}})[_0xf6fd('0x22')](function(_0x47d696){_0x23ea3a=_0x47d696;return getEndUser(_0x47aa9b,_0x2b135f,_0x4f34ae[_0xf6fd('0x77')],_0x4f34ae['calleridnum'],_0x43ce39);})[_0xf6fd('0x22')](function(_0x2be1d8){_0x29cf06=_0x2be1d8;return getTicket(_0x47aa9b,_0x23ea3a,_0x29cf06,_0x2b135f,_0x4f34ae,_0x2b135f[_0xf6fd('0x61')],_0x43ce39);})[_0xf6fd('0x22')](function(_0x4e7b1f){_0x24ef33=_0x4e7b1f;logger[_0xf6fd('0x1a')]('['+_0x4f34ae[_0xf6fd('0x75')][_0xf6fd('0x76')]()+_0xf6fd('0x78'),_0x24ef33['id']);logger[_0xf6fd('0x1a')]('['+_0x4f34ae[_0xf6fd('0x75')][_0xf6fd('0x76')]()+_0xf6fd('0x79'),_0x47aa9b[_0xf6fd('0x3a')]);})['catch'](function(_0x5ea444){logger['error']('['+_0x4f34ae['lastevent']['toUpperCase']()+']',_0x5ea444);});}; \ No newline at end of file +var _0xdfd0=['Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','picklist','idField','content','toString','variable','variableName','customVariable','name','Variable','toLowerCase','password','securityToken','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.','catch','request-promise','moment','bluebird','md5','jsforce','../../../../config/logger','salesforce','socket.io-emitter','redis','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','ContactId','AccountId','lead','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','length'];(function(_0x2734f3,_0x2f8e2d){var _0x11fa4=function(_0x3f3dce){while(--_0x3f3dce){_0x2734f3['push'](_0x2734f3['shift']());}};_0x11fa4(++_0x2f8e2d);}(_0xdfd0,0x14d));var _0x0dfd=function(_0x4c6afd,_0x2c88a3){_0x4c6afd=_0x4c6afd-0x0;var _0x55a61=_0xdfd0[_0x4c6afd];return _0x55a61;};'use strict';var _=require('lodash');var rp=require(_0x0dfd('0x0'));var moment=require(_0x0dfd('0x1'));var BPromise=require(_0x0dfd('0x2'));var md5=require(_0x0dfd('0x3'));var jsforce=require(_0x0dfd('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x0dfd('0x5'))(_0x0dfd('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0dfd('0x7'))(new Redis(config[_0x0dfd('0x8')]));function emit(_0x40d93b,_0x32c3ae,_0x40a4c7){io['to'](_0x40d93b)[_0x0dfd('0x9')](_0x32c3ae,_0x40a4c7);}function getTicket(_0x43088c,_0x378002,_0x5217b5,_0x3dd997,_0x273ce2,_0x13e635,_0x314889,_0x297322){var _0x320178=Object[_0x0dfd('0xa')]({},{'OwnerId':_0x378002['id'],'Subject':intUtil[_0x0dfd('0xb')](_0x3dd997['Subjects'],_0x273ce2,'\x20'),'Description':intUtil['getString'](_0x3dd997[_0x0dfd('0xc')],_0x273ce2,'\x0a')},getCustomFields(_0x13e635,_0x273ce2));if(_0x5217b5){if(_0x3dd997[_0x0dfd('0xd')]===_0x0dfd('0xe')){_0x320178[_0x0dfd('0xf')]=moment['utc']();_0x320178[_0x0dfd('0x10')]=![];_0x320178[_0x0dfd('0x11')]=![];if(_0x5217b5[_0x0dfd('0x12')]===_0x0dfd('0x13')||_0x5217b5[_0x0dfd('0x12')]==='lead'){_0x320178[_0x0dfd('0x14')]=_0x5217b5['id'];}else if(_0x5217b5['endUserType']===_0x0dfd('0x15')){_0x320178[_0x0dfd('0x16')]=_0x5217b5['id'];}}else if(_0x3dd997['ticketType']===_0x0dfd('0x17')){if(_0x5217b5[_0x0dfd('0x12')]===_0x0dfd('0x13')){_0x320178[_0x0dfd('0x18')]=_0x5217b5['id'];}else if(_0x5217b5[_0x0dfd('0x12')]===_0x0dfd('0x15')){_0x320178[_0x0dfd('0x19')]=_0x5217b5['id'];}else if(_0x5217b5[_0x0dfd('0x12')]===_0x0dfd('0x1a')&&_0x3dd997['leadId']){_0x320178[_0x3dd997['leadId']]=_0x5217b5['id'];}else{logger['info'](_0x0dfd('0x1b'));}}}return _0x314889[_0x0dfd('0x1c')](_0x3dd997[_0x0dfd('0xd')])[_0x0dfd('0x1d')](_0x320178);}function getUser(_0x2a7185,_0xc85b09,_0x50c4c9){if(!_[_0x0dfd('0x1e')](_0xc85b09)&&intUtil[_0x0dfd('0x1f')](_0xc85b09)){var _0x963da8={'Email':_0xc85b09};var _0x16cf55={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x50c4c9[_0x0dfd('0x1c')]('User')[_0x0dfd('0x20')](_0x963da8,_0x16cf55)[_0x0dfd('0x21')]()[_0x0dfd('0x22')](function(_0x5130fb){if(_0x5130fb[_0x0dfd('0x23')]){var _0x2d5857=_['find'](_0x5130fb,function(_0xf1e170){return _0xf1e170[_0x0dfd('0x24')]===_0xc85b09;});if(_0x2d5857){logger[_0x0dfd('0x25')](_0x0dfd('0x26'),_0xc85b09);return BPromise[_0x0dfd('0x27')]({'id':_0x2d5857['Id'],'name':_0x2d5857[_0x0dfd('0x28')]});}}else{logger[_0x0dfd('0x25')](_0x0dfd('0x29'),_0xc85b09);return _0x50c4c9[_0x0dfd('0x2a')]()[_0x0dfd('0x22')](function(_0x3d723a){return BPromise[_0x0dfd('0x27')]({'id':_0x3d723a['user_id'],'name':_0x3d723a[_0x0dfd('0x2b')]});});}});}else{logger[_0x0dfd('0x25')](_0x0dfd('0x29'),_0xc85b09);return _0x50c4c9['identity']()[_0x0dfd('0x22')](function(_0x1163ef){return BPromise[_0x0dfd('0x27')]({'id':_0x1163ef[_0x0dfd('0x2c')],'name':_0x1163ef[_0x0dfd('0x2b')]});});}}function getEndUser(_0xf4953,_0x1e4f3c,_0x531c74,_0xfbc151,_0x266710){var _0x1e1c7e={'$or':{'Phone':_0xfbc151}};var _0x26d65a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x0dfd('0x25')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0xfbc151,_0x1e4f3c[_0x0dfd('0x2d')]);switch(_0x1e4f3c['moduleSearch']){case'contact_lead':var _0x515d00=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x2f')]){var _0xee6196={};_0xee6196[_0x1e4f3c['additionalSearchContact']]=_0xfbc151;_[_0x0dfd('0x30')](_0x515d00[_0x0dfd('0x31')],_0xee6196);}return _0x266710[_0x0dfd('0x1c')]('Contact')[_0x0dfd('0x20')](_0x515d00,_0x26d65a)['execute']()['then'](function(_0x2b5329){if(_0x2b5329&&_0x2b5329[_0x0dfd('0x23')]){return _0x2b5329;}else{var _0x2cfdaf=_['cloneDeep'](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x32')]){var _0x2fb7af={};_0x2fb7af[_0x1e4f3c[_0x0dfd('0x32')]]=_0xfbc151;_['merge'](_0x2cfdaf[_0x0dfd('0x31')],_0x2fb7af);}return _0x266710[_0x0dfd('0x1c')](_0x0dfd('0x33'))[_0x0dfd('0x20')](_0x2cfdaf,_0x26d65a);}});case _0x0dfd('0x34'):var _0x8ccf15=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x35')]){var _0xee6196={};_0xee6196[_0x1e4f3c[_0x0dfd('0x35')]]=_0xfbc151;_[_0x0dfd('0x30')](_0x8ccf15[_0x0dfd('0x31')],_0xee6196);}return _0x266710[_0x0dfd('0x1c')](_0x0dfd('0x36'))[_0x0dfd('0x20')](_0x8ccf15,_0x26d65a)[_0x0dfd('0x21')]()[_0x0dfd('0x22')](function(_0x1aea64){if(_0x1aea64&&_0x1aea64[_0x0dfd('0x23')]){return _0x1aea64;}else{var _0x5db66c=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x2f')]){var _0x580a5d={};_0x580a5d[_0x1e4f3c['additionalSearchContact']]=_0xfbc151;_[_0x0dfd('0x30')](_0x5db66c[_0x0dfd('0x31')],_0x580a5d);}return _0x266710[_0x0dfd('0x1c')]('Contact')[_0x0dfd('0x20')](_0x5db66c,_0x26d65a)[_0x0dfd('0x22')](function(_0x32c0d1){if(_0x32c0d1&&_0x32c0d1[_0x0dfd('0x23')]){return _0x32c0d1;}else{var _0x91ef22=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x32')]){var _0x42f512={};_0x42f512[_0x1e4f3c['additionalSearchLead']]=_0xfbc151;_[_0x0dfd('0x30')](_0x91ef22[_0x0dfd('0x31')],_0x42f512);}return _0x266710['sobject'](_0x0dfd('0x33'))[_0x0dfd('0x20')](_0x91ef22,_0x26d65a);}});}});case _0x0dfd('0x13'):var _0x515d00=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x2f')]){var _0xee6196={};_0xee6196[_0x1e4f3c[_0x0dfd('0x2f')]]=_0xfbc151;_[_0x0dfd('0x30')](_0x515d00[_0x0dfd('0x31')],_0xee6196);}return _0x266710['sobject'](_0x0dfd('0x37'))[_0x0dfd('0x20')](_0x515d00,_0x26d65a)[_0x0dfd('0x21')]();case'lead':var _0x3db354=_[_0x0dfd('0x2e')](_0x1e1c7e);if(_0x1e4f3c[_0x0dfd('0x32')]){var _0xee6196={};_0xee6196[_0x1e4f3c[_0x0dfd('0x32')]]=_0xfbc151;_['merge'](_0x3db354[_0x0dfd('0x31')],_0xee6196);}return _0x266710[_0x0dfd('0x1c')](_0x0dfd('0x33'))['find'](_0x3db354,_0x26d65a);case _0x0dfd('0x15'):var _0x8ccf15=_['cloneDeep'](_0x1e1c7e);if(_0x1e4f3c['additionalSearchAccount']){var _0xee6196={};_0xee6196[_0x1e4f3c[_0x0dfd('0x35')]]=_0xfbc151;_[_0x0dfd('0x30')](_0x8ccf15[_0x0dfd('0x31')],_0xee6196);}return _0x266710[_0x0dfd('0x1c')]('Account')[_0x0dfd('0x20')](_0x8ccf15,_0x26d65a);default:return null;}})['then'](function(_0x5853dd){if(_0x5853dd&&_0x5853dd[_0x0dfd('0x23')]){var _0x52fbe8=_[_0x0dfd('0x38')](_0x5853dd);if(_0x52fbe8){return BPromise[_0x0dfd('0x27')]({'id':_0x52fbe8['Id'],'name':_0x52fbe8[_0x0dfd('0x28')],'phone':_0x52fbe8[_0x0dfd('0x39')],'endUserType':_0x52fbe8[_0x0dfd('0x3a')][_0x0dfd('0x3b')]['toLowerCase']()});}}})[_0x0dfd('0x22')](function(_0x40c77b){if(_0x40c77b){logger[_0x0dfd('0x25')](_0x0dfd('0x3c'),_0x40c77b['endUserType'],_0xfbc151);return BPromise[_0x0dfd('0x27')](_0x40c77b);}else{logger['info'](_0x0dfd('0x3d'),_0xfbc151);var _0x2a6a91={'Phone':_0xfbc151};if(_0x1e4f3c[_0x0dfd('0x3e')]){if(_0x1e4f3c[_0x0dfd('0x3e')]===_0x0dfd('0x13')){logger['info'](_0x0dfd('0x3f'),_0xfbc151,_0x1e4f3c[_0x0dfd('0x3e')]);_0x2a6a91[_0x0dfd('0x40')]=_0x531c74!==_0x0dfd('0x41')?_0x531c74:util[_0x0dfd('0x42')](_0x0dfd('0x43'),_0xfbc151);}else if(_0x1e4f3c['moduleCreate']===_0x0dfd('0x1a')){logger[_0x0dfd('0x25')](_0x0dfd('0x3f'),_0xfbc151,_0x1e4f3c['moduleCreate']);_0x2a6a91[_0x0dfd('0x40')]=_0x531c74!==_0x0dfd('0x41')?_0x531c74:util[_0x0dfd('0x42')]('Caller\x20-\x20%s',_0xfbc151);_0x2a6a91[_0x0dfd('0x44')]=_0x0dfd('0x45');}else if(_0x1e4f3c['moduleCreate']===_0x0dfd('0x15')){logger[_0x0dfd('0x25')](_0x0dfd('0x3f'),_0xfbc151,_0x1e4f3c[_0x0dfd('0x3e')]);_0x2a6a91[_0x0dfd('0x28')]=_0x531c74!==_0x0dfd('0x41')?_0x531c74:util[_0x0dfd('0x42')](_0x0dfd('0x43'),_0xfbc151);}else{return null;}}return _0x266710[_0x0dfd('0x1c')](_['upperFirst'](_0x1e4f3c['moduleCreate']))[_0x0dfd('0x1d')](_0x2a6a91)[_0x0dfd('0x22')](function(_0x451fa5){return BPromise[_0x0dfd('0x27')]({'id':_0x451fa5['id'],'endUserType':_0x1e4f3c['moduleCreate']});});}});}function getCustomFields(_0x21d814,_0xd1c854){var _0x4c2c84={};if(_0x21d814['length']>0x0){_[_0x0dfd('0x46')](_0x21d814,function(_0x4c1bd6){if(_[_0x0dfd('0x47')](['string',_0x0dfd('0x48')],_0x4c1bd6[_0x0dfd('0x3b')])&&_0x4c1bd6[_0x0dfd('0x49')]){_0x4c2c84[_0x4c1bd6[_0x0dfd('0x49')]]=_0x4c1bd6[_0x0dfd('0x4a')][_0x0dfd('0x4b')]();}else if(_0x4c1bd6[_0x0dfd('0x3b')]===_0x0dfd('0x4c')&&_0x4c1bd6[_0x0dfd('0x4d')]&&_0x4c1bd6[_0x0dfd('0x49')]){_0xd1c854[_0x4c1bd6[_0x0dfd('0x4d')]]&&(_0x4c2c84[_0x4c1bd6[_0x0dfd('0x49')]]=_0xd1c854[_0x4c1bd6[_0x0dfd('0x4d')]][_0x0dfd('0x4b')]());}else if(_0x4c1bd6[_0x0dfd('0x3b')]===_0x0dfd('0x4e')&&_0x4c1bd6['Variable']&&_0x4c1bd6['Variable'][_0x0dfd('0x4f')]&&_0x4c1bd6[_0x0dfd('0x49')]){_0xd1c854[_0x4c1bd6[_0x0dfd('0x50')]['name'][_0x0dfd('0x51')]()]&&(_0x4c2c84[_0x4c1bd6[_0x0dfd('0x49')]]=_0xd1c854[_0x4c1bd6[_0x0dfd('0x50')]['name']['toLowerCase']()][_0x0dfd('0x4b')]());}});}return _0x4c2c84;}function getConnection(_0x34aeb4){var _0x460a20=_0x34aeb4[_0x0dfd('0x52')]['concat'](_0x34aeb4[_0x0dfd('0x53')]);var _0x2e02f4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x34aeb4[_0x0dfd('0x54')]||_0x0dfd('0x55'),'clientId':_0x34aeb4[_0x0dfd('0x56')],'clientSecret':_0x34aeb4['clientSecret']}});return _0x2e02f4[_0x0dfd('0x57')](_0x34aeb4[_0x0dfd('0x58')],_0x460a20)[_0x0dfd('0x22')](function(){logger[_0x0dfd('0x25')](_0x0dfd('0x59'));return _0x2e02f4;});}exports['queue']=function(_0x32e3fb,_0x313337,_0x59fb13,_0x198ddb,_0xeadc5d,_0x548cbd){var _0x4d0fca,_0x5d1cd5,_0x5b2ac6,_0x3f26e4;_0x548cbd[_0x0dfd('0x5a')]=intUtil[_0x0dfd('0x5b')](_0x548cbd[_0x0dfd('0x5a')]);_0x548cbd[_0x0dfd('0x54')]=intUtil['stripTrailingSlash'](_0x548cbd[_0x0dfd('0x54')]);if(_0xeadc5d&&_0xeadc5d[_0x0dfd('0x5c')]){logger[_0x0dfd('0x25')](_0x0dfd('0x5d'),_0x0dfd('0x5e'));_0x313337[_0x0dfd('0x5f')]=util[_0x0dfd('0x42')](_0x0dfd('0x60'),_0x548cbd[_0x0dfd('0x5a')],_0x313337[_0x0dfd('0x61')],md5(_0x313337[_0x0dfd('0x61')]));}else{_0x313337[_0x0dfd('0x5f')]='';}return getConnection(_0x548cbd)[_0x0dfd('0x22')](function(_0x53eb93){_0x3f26e4=_0x53eb93;return getUser(_0x548cbd,_0x198ddb['email'],_0x3f26e4);})[_0x0dfd('0x22')](function(_0x1dd2ab){_0x4d0fca=_0x1dd2ab;return getEndUser(_0x548cbd,_0x59fb13,_0x313337[_0x0dfd('0x62')],_0x313337['calleridnum'],_0x3f26e4);})['then'](function(_0x1e18c5){_0x5d1cd5=_0x1e18c5;return getTicket(_0x548cbd,_0x4d0fca,_0x5d1cd5,_0x59fb13,_0x313337,_0x59fb13[_0x0dfd('0x63')],_0x3f26e4,_0x0dfd('0x64'));})['then'](function(_0x22a1bf){_0x5b2ac6=_0x22a1bf;logger[_0x0dfd('0x25')](_0x0dfd('0x65'),_0x5b2ac6['id']);logger[_0x0dfd('0x25')](_0x0dfd('0x66'),_0x5b2ac6['id'],_0x198ddb[_0x0dfd('0x4f')],_0x548cbd[_0x0dfd('0x3b')]);switch(_0x548cbd['type']){case _0x0dfd('0x67'):emit(util[_0x0dfd('0x42')](_0x0dfd('0x68'),_0x198ddb['name']),_0x0dfd('0x69'),{'recordId':_0x5b2ac6['id']});break;case _0x0dfd('0x6a'):emit(util['format'](_0x0dfd('0x68'),_0x198ddb[_0x0dfd('0x4f')]),_0x0dfd('0x6b'),{'uri':util[_0x0dfd('0x42')](_0x0dfd('0x6c'),_0x3f26e4[_0x0dfd('0x6d')],_0x5b2ac6['id'])});break;default:logger[_0x0dfd('0x6e')](_0x0dfd('0x6f'));}})['catch'](function(_0x3d5607){logger['error'](_0x0dfd('0x5d'),_0x3d5607);});};exports[_0x0dfd('0x70')]=function(_0x26d564,_0x31d47d,_0x455a1a,_0x288cff,_0x45cd8d,_0x1ab163,_0x89d19b){var _0x52859b,_0x2d2b58,_0x5c036e,_0x4dee5f;_0x1ab163['serverUrl']=intUtil[_0x0dfd('0x5b')](_0x1ab163[_0x0dfd('0x5a')]);_0x1ab163[_0x0dfd('0x54')]=intUtil[_0x0dfd('0x5b')](_0x1ab163['remoteUri']);if(_0x89d19b&&_0x89d19b[_0x0dfd('0x71')]&&_0x89d19b[_0x0dfd('0x71')]!=='none'){logger[_0x0dfd('0x25')](_0x0dfd('0x72'),_0x0dfd('0x5e'));_0x31d47d[_0x0dfd('0x5f')]=util[_0x0dfd('0x42')](_0x0dfd('0x60'),_0x1ab163['serverUrl'],_0x31d47d[_0x0dfd('0x61')],md5(_0x31d47d[_0x0dfd('0x61')]));}return getConnection(_0x1ab163)[_0x0dfd('0x22')](function(_0x1e1a85){_0x4dee5f=_0x1e1a85;return getUser(_0x1ab163,_0x288cff['email'],_0x4dee5f);})['then'](function(_0xa1793f){_0x52859b=_0xa1793f;return getEndUser(_0x1ab163,_0x455a1a,_0x31d47d['destcalleridname'],_0x31d47d['destcalleridnum'],_0x4dee5f);})[_0x0dfd('0x22')](function(_0x1a0e6c){_0x2d2b58=_0x1a0e6c;return getTicket(_0x1ab163,_0x52859b,_0x2d2b58,_0x455a1a,_0x31d47d,_0x455a1a[_0x0dfd('0x63')],_0x4dee5f,'outbound');})[_0x0dfd('0x22')](function(_0x511c49){_0x5c036e=_0x511c49;logger['info'](_0x0dfd('0x73'),_0x5c036e['id']);logger['info'](_0x0dfd('0x74'),_0x5c036e['id'],_0x288cff[_0x0dfd('0x4f')],_0x1ab163[_0x0dfd('0x3b')]);switch(_0x1ab163[_0x0dfd('0x3b')]){case _0x0dfd('0x67'):emit(util[_0x0dfd('0x42')](_0x0dfd('0x68'),_0x288cff[_0x0dfd('0x4f')]),_0x0dfd('0x69'),{'recordId':_0x5c036e['id']});break;case _0x0dfd('0x6a'):emit(util[_0x0dfd('0x42')](_0x0dfd('0x68'),_0x288cff[_0x0dfd('0x4f')]),_0x0dfd('0x6b'),{'uri':util[_0x0dfd('0x42')](_0x0dfd('0x6c'),_0x4dee5f['instanceUrl'],_0x5c036e['id'])});break;default:logger['error'](_0x0dfd('0x72'),_0x0dfd('0x75'));}})['catch'](function(_0x2ff394){logger[_0x0dfd('0x6e')](_0x0dfd('0x72'),_0x2ff394);});};exports['unmanaged']=function(_0x59a4ed,_0x54122c,_0xc156fb,_0x3b9527,_0x497f52,_0x3343ae){var _0x3019ae,_0x5a85fc,_0xef0b8f,_0x3e7c7c;_0x3343ae['serverUrl']=intUtil['stripTrailingSlash'](_0x3343ae[_0x0dfd('0x5a')]);_0x3343ae[_0x0dfd('0x54')]=intUtil[_0x0dfd('0x5b')](_0x3343ae[_0x0dfd('0x54')]);if(_0x497f52&&_0x497f52[_0x0dfd('0x5c')]){logger[_0x0dfd('0x25')]('['+_0x54122c[_0x0dfd('0x76')][_0x0dfd('0x77')]()+']',_0x0dfd('0x5e'));_0x54122c['recordingURL']=util['format'](_0x0dfd('0x60'),_0x3343ae['serverUrl'],_0x54122c[_0x0dfd('0x61')],md5(_0x54122c[_0x0dfd('0x61')]));}else{_0x54122c[_0x0dfd('0x5f')]='';}return getConnection(_0x3343ae)[_0x0dfd('0x22')](function(_0x3e235a){_0x3e7c7c=_0x3e235a;if(!_[_0x0dfd('0x1e')](_0x3b9527)){return getUser(_0x3343ae,_0x3b9527[_0x0dfd('0x4f')],_0x3e7c7c);}else{return getUser(_0x3343ae,null,_0x3e7c7c);}})[_0x0dfd('0x22')](function(_0x4ed912){_0x3019ae=_0x4ed912;return getEndUser(_0x3343ae,_0xc156fb,_0x54122c[_0x0dfd('0x62')],_0x54122c[_0x0dfd('0x78')],_0x3e7c7c);})['then'](function(_0x1a2b4f){_0x5a85fc=_0x1a2b4f;return getTicket(_0x3343ae,_0x3019ae,_0x5a85fc,_0xc156fb,_0x54122c,_0xc156fb[_0x0dfd('0x63')],_0x3e7c7c);})[_0x0dfd('0x22')](function(_0xc18d62){_0xef0b8f=_0xc18d62;logger[_0x0dfd('0x25')]('['+_0x54122c[_0x0dfd('0x76')][_0x0dfd('0x77')]()+_0x0dfd('0x79'),_0xef0b8f['id']);logger['info']('['+_0x54122c[_0x0dfd('0x76')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x3343ae[_0x0dfd('0x3b')]);})[_0x0dfd('0x7a')](function(_0x39fb65){logger[_0x0dfd('0x6e')]('['+_0x54122c[_0x0dfd('0x76')][_0x0dfd('0x77')]()+']',_0x39fb65);});}; \ 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 742fa3f..b796724 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 _0x68e2=['],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','nameField','customField','toLowerCase','toString','picklist','type','content','variable','variableName','idField','Variable','name','outbound','POST','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','label','?sysparm_query=name%3D','label_entry','incident','Incident\x20-\x20','ticketNumber','push','all','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','format','username','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','],\x20getAdminUser\x20crm','catch','error','message','info','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x68e2,0xab));var _0x268e=function(_0x12e264,_0x58ea6c){_0x12e264=_0x12e264-0x0;var _0xce64c4=_0x68e2[_0x12e264];return _0xce64c4;};'use strict';var _=require('lodash');var Promise=require(_0x268e('0x0'));var rp=require(_0x268e('0x1'));var util=require(_0x268e('0x2'));var md5=require(_0x268e('0x3'));var Redis=require(_0x268e('0x4'));var intUtil=require(_0x268e('0x5'));var config=require('../../../../config/environment');var logger=require(_0x268e('0x6'))(_0x268e('0x7'));config[_0x268e('0x8')]=_['defaults'](config['redis'],{'host':_0x268e('0x9'),'port':0x18eb});var io=require(_0x268e('0xa'))(new Redis(config[_0x268e('0x8')]));function getAdminUser(_0x18156a,_0x3f3cf1,_0x56fa53,_0x1f61c6,_0x240c99,_0x237cda){return new Promise(function(_0x11e55a,_0x599b13){var _0x5b6fe3={'method':_0x268e('0xb'),'uri':_0x1f61c6+_0x268e('0xc')+'&'+_0x240c99+'&'+_0x237cda,'auth':_0x3f3cf1,'json':!![]};return rp(_0x5b6fe3)[_0x268e('0xd')](function(_0x45b77b){if(_0x45b77b[_0x268e('0xe')][_0x268e('0xf')]>0x0){_0x56fa53['adminId']=_0x45b77b[_0x268e('0xe')][0x0][_0x268e('0x10')];}logger['info']('['+[_0x18156a['toUpperCase']()]+_0x268e('0x11'),_0x56fa53);_0x11e55a(_0x56fa53);})[_0x268e('0x12')](function(_0xc3b539){logger[_0x268e('0x13')]('['+[_0x18156a['toUpperCase']()]+']',_0xc3b539[_0x268e('0x14')]);_0x599b13(_0xc3b539[_0x268e('0x14')]);});});}function getUser(_0x1357fb,_0x37e1e2,_0x6e2a28,_0x2b1d0c,_0x5b328f){return function(_0x11cc08){logger[_0x268e('0x15')]('['+[_0x1357fb[_0x268e('0x16')]()]+_0x268e('0x17'),_0x11cc08);return new Promise(function(_0x8954e0,_0x253c25){if(intUtil[_0x268e('0x18')](_0x11cc08[_0x268e('0x19')])){var _0x39f36c={'method':'GET','uri':_0x6e2a28+_0x268e('0x1a')+_0x11cc08['userEmail']+'&'+_0x2b1d0c+'&'+_0x5b328f,'auth':_0x37e1e2,'json':!![]};logger[_0x268e('0x15')]('['+[_0x1357fb[_0x268e('0x16')]()]+_0x268e('0x1b'),_0x39f36c);return rp(_0x39f36c)[_0x268e('0xd')](function(_0x2a3ce8){logger[_0x268e('0x15')]('['+[_0x1357fb['toUpperCase']()]+_0x268e('0x1c'),_0x2a3ce8);if(_0x2a3ce8[_0x268e('0xe')][_0x268e('0xf')]>0x0&&String(_0x2a3ce8[_0x268e('0xe')][0x0]['active'])===_0x268e('0x1d')){_0x11cc08[_0x268e('0x1e')]=_0x2a3ce8[_0x268e('0xe')][0x0]['sys_id'];}else{_0x11cc08[_0x268e('0x1e')]=_0x11cc08['adminId'];_0x11cc08['userEmail']=_0x11cc08[_0x268e('0x1f')];}logger[_0x268e('0x15')]('['+[_0x1357fb[_0x268e('0x16')]()]+'],\x20getUser\x20crm',_0x11cc08);_0x8954e0(_0x11cc08);})[_0x268e('0x12')](function(_0x19490d){logger['error']('['+[_0x1357fb['toUpperCase']()]+']',_0x19490d[_0x268e('0x14')]);_0x253c25(_0x19490d[_0x268e('0x14')]);});}else{logger['info']('['+[_0x1357fb[_0x268e('0x16')]()]+_0x268e('0x20'));_0x11cc08[_0x268e('0x1e')]=_0x11cc08['adminId'];_0x11cc08['userEmail']=_0x11cc08['adminEmail'];_0x8954e0(_0x11cc08);}});};}function createEndUser(_0x40f89e,_0x298807,_0x53ec22,_0xe6092f,_0x5a5227){logger[_0x268e('0x15')]('['+[_0x40f89e['toUpperCase']()]+_0x268e('0x21'),_0x53ec22);return new Promise(function(_0x3862e6,_0x4a5444){var _0x208239={'method':'POST','uri':_0xe6092f+_0x268e('0x22')+_0x5a5227,'body':{'user_name':_0x53ec22[_0x268e('0x23')],'roles':'user','first_name':_0x53ec22[_0x268e('0x23')],'active':_0x268e('0x1d'),'date_format':_0x268e('0x24'),'phone':_0x53ec22[_0x268e('0x23')]},'auth':_0x298807,'json':!![]};return rp(_0x208239)[_0x268e('0xd')](function(_0x5d0441){logger[_0x268e('0x15')]('['+[_0x40f89e['toUpperCase']()]+_0x268e('0x25'),_0x5d0441[_0x268e('0xe')]);_0x53ec22[_0x268e('0x26')]=_0x5d0441[_0x268e('0xe')][_0x268e('0x10')];_0x3862e6(_0x53ec22);})['catch'](function(_0x127e3f){logger[_0x268e('0x13')]('['+[_0x40f89e[_0x268e('0x16')]()]+']',_0x127e3f[_0x268e('0x14')]);_0x4a5444(_0x127e3f[_0x268e('0x14')]);});});}function getEndUser(_0x373337,_0x10834c,_0x2dcee1,_0x2c3609,_0x1759c9){return function(_0x3d0705){logger[_0x268e('0x15')]('['+[_0x373337[_0x268e('0x16')]()]+_0x268e('0x27'),_0x3d0705);return new Promise(function(_0x1e3b55,_0x4f8483){var _0x3fcb62={'method':_0x268e('0xb'),'uri':_0x2dcee1+_0x268e('0x28')+_0x3d0705[_0x268e('0x23')]+'&'+_0x2c3609+'&'+_0x1759c9,'auth':_0x10834c,'json':!![]};return rp(_0x3fcb62)[_0x268e('0xd')](function(_0x2ca31e){if(_0x2ca31e[_0x268e('0xe')][_0x268e('0xf')]>0x0){_0x3d0705[_0x268e('0x26')]=_0x2ca31e[_0x268e('0xe')][0x0][_0x268e('0x10')];logger[_0x268e('0x15')]('['+[_0x373337[_0x268e('0x16')]()]+'],\x20getEndUser\x20crm',_0x3d0705);_0x1e3b55(_0x3d0705);}else{return createEndUser(_0x373337,_0x10834c,_0x3d0705,_0x2dcee1,_0x2c3609)[_0x268e('0xd')](function(_0x227f42){logger[_0x268e('0x15')]('['+[_0x373337[_0x268e('0x16')]()]+_0x268e('0x29'),_0x227f42);_0x1e3b55(_0x227f42);});}})[_0x268e('0x12')](function(_0xfff186){logger[_0x268e('0x13')]('['+[_0x373337[_0x268e('0x16')]()]+']',_0xfff186['message']);_0x4f8483(_0xfff186[_0x268e('0x14')]);});});};}function getCustomFields(_0x5b7e4d,_0x5be20a){var _0x258d6e={};if(_0x5b7e4d[_0x268e('0xf')]>0x0){_[_0x268e('0x2a')](_0x5b7e4d,function(_0x5976fc){if(_[_0x268e('0x2b')]([_0x268e('0x2c'),'picklist'],_0x5976fc['type'])&&_0x5976fc[_0x268e('0x2d')]&&!_0x5976fc[_0x268e('0x2e')]){_0x258d6e[_0x5976fc[_0x268e('0x2d')][_0x268e('0x2f')]()]=_0x5976fc['content'][_0x268e('0x30')]();}else if(_[_0x268e('0x2b')]([_0x268e('0x2c'),_0x268e('0x31')],_0x5976fc[_0x268e('0x32')])&&_0x5976fc['idField']&&_0x5976fc[_0x268e('0x2e')]){_0x258d6e[_0x5976fc['idField'][_0x268e('0x2f')]()]=_0x5976fc[_0x268e('0x33')][_0x268e('0x30')]();}else if(_0x5976fc[_0x268e('0x32')]===_0x268e('0x34')&&_0x5976fc[_0x268e('0x35')]&&_0x5976fc['idField']&&_0x5976fc['customField']){_0x258d6e[_0x5976fc[_0x268e('0x36')][_0x268e('0x2f')]()]=_0x5be20a[_0x5976fc[_0x268e('0x35')]][_0x268e('0x30')]();}else if(_0x5976fc[_0x268e('0x32')]==='customVariable'&&_0x5976fc[_0x268e('0x37')]&&_0x5976fc[_0x268e('0x37')][_0x268e('0x38')]&&_0x5976fc['idField']&&_0x5976fc['customField']){_0x258d6e[_0x5976fc[_0x268e('0x36')][_0x268e('0x2f')]()]=_0x5be20a[_0x5976fc['Variable'][_0x268e('0x38')][_0x268e('0x2f')]()][_0x268e('0x30')]();}});}return _0x258d6e;}function getTicket(_0x3d59ae,_0x4fa5cd,_0x29cc4a,_0x25f23d,_0x3148dd,_0x2aca62){return function(_0x3c5f2b){logger[_0x268e('0x15')]('['+[_0x3d59ae['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x3c5f2b);return new Promise(function(_0x812ac2,_0x43b797){var _0x4421c3=_0x3d59ae[_0x268e('0x2f')]()===_0x268e('0x39')?_0x3c5f2b[_0x268e('0x1e')]:_0x3c5f2b[_0x268e('0x26')];var _0x40452a={'method':_0x268e('0x3a'),'uri':_0x29cc4a+'incident'+'?'+_0x2aca62,'body':Object[_0x268e('0x3b')]({},{'active':'true','caller_id':_0x4421c3,'assigned_to':_0x3c5f2b['userId'],'short_description':intUtil[_0x268e('0x3c')](_0x25f23d[_0x268e('0x3d')],_0x3148dd,'\x20'),'description':intUtil[_0x268e('0x3c')](_0x25f23d[_0x268e('0x3e')],_0x3148dd,'\x0a')},getCustomFields(_0x25f23d['Fields'],_0x3148dd)),'auth':_0x4fa5cd,'json':!![]};return rp(_0x40452a)[_0x268e('0xd')](function(_0x28bde4){logger[_0x268e('0x15')]('['+[_0x3d59ae[_0x268e('0x16')]()]+_0x268e('0x3f'),_0x28bde4[_0x268e('0xe')]);_0x3c5f2b[_0x268e('0x40')]=_0x28bde4[_0x268e('0xe')][_0x268e('0x10')];_0x3c5f2b['ticketNumber']=_0x28bde4['result']['number'];logger['info']('['+[_0x3d59ae[_0x268e('0x16')]()]+']\x20getTicket\x20crm',_0x3c5f2b);_0x812ac2(_0x3c5f2b);})[_0x268e('0x12')](function(_0x1e29f1){logger[_0x268e('0x13')]('['+[_0x3d59ae[_0x268e('0x16')]()]+']',_0x1e29f1[_0x268e('0x14')]);_0x43b797(_0x1e29f1['message']);});});};}function createRemoteTag(_0x1f847c,_0x94069f,_0x1c9456,_0x260450){return new Promise(function(_0x3b7119,_0x562b3f){var _0x4e6d95={'method':_0x268e('0x3a'),'uri':_0x1c9456+_0x268e('0x41')+'?'+_0x260450,'body':{'short_description':_0x1f847c,'global':!![],'active':!![],'name':_0x1f847c},'auth':_0x94069f,'json':!![]};return rp(_0x4e6d95)['then'](function(_0x43f5c4){var _0x389017=_0x43f5c4[_0x268e('0xe')][_0x268e('0x10')];_0x3b7119(_0x389017);});});}function getRemoteTag(_0x666ff6,_0x35b4a2,_0x20e026,_0x56ee3c,_0xbbdf3f){return new Promise(function(_0x328663,_0x3597d3){var _0x3272a5={'method':_0x268e('0xb'),'uri':_0x20e026+_0x268e('0x41')+_0x268e('0x42')+_0x666ff6+'&'+_0x56ee3c,'auth':_0x35b4a2,'json':!![]};return rp(_0x3272a5)[_0x268e('0xd')](function(_0x5bb0d0){if(_0x5bb0d0[_0x268e('0xe')][_0x268e('0xf')]>0x0){var _0x5aeecb=_0x5bb0d0[_0x268e('0xe')][0x0][_0x268e('0x10')];_0x328663(_0x5aeecb);}else{return createRemoteTag(_0x666ff6,_0x35b4a2,_0x20e026,_0x56ee3c)[_0x268e('0xd')](function(_0x4fb682){_0x328663(_0x4fb682);});}});});}function assignTagToIncident(_0x24189b,_0x55fcbd,_0x2b7ecc,_0x20a301,_0x32e515){return new Promise(function(_0xf00d4b,_0x30264c){var _0x228627={'method':_0x268e('0x3a'),'uri':_0x2b7ecc+_0x268e('0x43')+'?'+_0x32e515,'body':{'label':_0x24189b,'table':_0x268e('0x44'),'id_type':'Incident','table_key':_0x20a301[_0x268e('0x40')],'title':_0x268e('0x45')+_0x20a301[_0x268e('0x46')],'id_display':_0x20a301['ticketNumber']},'auth':_0x55fcbd,'json':!![]};return rp(_0x228627)[_0x268e('0xd')](function(_0x4c093e){_0xf00d4b();})[_0x268e('0x12')](function(){_0xf00d4b();});});}function manageTags(_0x1baa23,_0x38bc3c,_0x1b3d16,_0x16d20e,_0x46b7e9,_0x2947f7,_0x586f0b){return new Promise(function(_0x20b4db,_0x5764bb){var _0x45a8d1=[];_0x38bc3c[_0x268e('0x2a')](function(_0x35e818){_0x45a8d1[_0x268e('0x47')](getRemoteTag(_0x35e818,_0x1b3d16,_0x16d20e,_0x2947f7,_0x586f0b));});return Promise[_0x268e('0x48')](_0x45a8d1)[_0x268e('0xd')](function(_0x39cd29){if(_0x39cd29['length']){logger['info']('['+[_0x1baa23[_0x268e('0x16')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x39cd29);var _0x4f8a4b=[];_0x39cd29['forEach'](function(_0x4e1543){_0x4f8a4b[_0x268e('0x47')](assignTagToIncident(_0x4e1543,_0x1b3d16,_0x16d20e,_0x46b7e9,_0x2947f7));});return Promise[_0x268e('0x48')](_0x4f8a4b)[_0x268e('0xd')](function(){_0x20b4db();})[_0x268e('0x12')](function(){_0x20b4db();});}else{_0x20b4db();}});});}function getTags(_0x52f177,_0x30a687,_0x38066e,_0x44f67a,_0x56172a,_0x45a3d9){return function(_0x24d40c){return new Promise(function(_0xc51c1b,_0x262927){var _0x594125=[];var _0x5c60e1=_0x44f67a['Tags'];if(_0x5c60e1&&_0x5c60e1['length']>0x0){_0x594125=_['map'](_0x5c60e1,'name');}if(_0x594125[_0x268e('0xf')]>0x0){return manageTags(_0x52f177,_0x594125,_0x30a687,_0x38066e,_0x24d40c,_0x56172a,_0x45a3d9)[_0x268e('0xd')](function(){_0xc51c1b(_0x24d40c);});}else{_0xc51c1b(_0x24d40c);}});};}function emit(_0x2b2264,_0x547e04,_0x513a7d){var _0x2faa8b=_0x268e('0x49')+_0x268e('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x13b99={'uri':_0x2b2264+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x513a7d+_0x2faa8b};io['to'](util[_0x268e('0x4b')]('user:%s',_0x547e04))['emit']('trigger:browser:url',_0x13b99);}exports['cs']=function(_0x233f7f,_0x1daa71,_0x441514,_0xa40a99,_0x527050,_0x2b7388,_0x2a0c66,_0x39b369){var _0x2cadb9={};var _0x2e7f30={'user':_0x2b7388[_0x268e('0x4c')],'pass':_0x2b7388['password']};var _0x28a0da='sysparm_limit=1';var _0x1ed265=_0x268e('0x4d');_0x2b7388['remoteUri']=intUtil['stripTrailingSlash'](_0x2b7388['remoteUri']);_0x2b7388[_0x268e('0x4e')]=intUtil[_0x268e('0x4f')](_0x2b7388[_0x268e('0x4e')]);var _0x42db9d=util[_0x268e('0x4b')](_0x268e('0x50'),_0x2b7388[_0x268e('0x51')]);_0x2cadb9[_0x268e('0x19')]=!_['isNil'](_0xa40a99)?_0xa40a99[_0x268e('0x52')]:null;_0x2cadb9[_0x268e('0x1f')]=_0x2b7388[_0x268e('0x52')];_0x2cadb9['endUserNumber']=_0x39b369['toLowerCase']()===_0x268e('0x39')?_0x1daa71['destcalleridnum']:_0x1daa71[_0x268e('0x53')];_0x2cadb9[_0x268e('0x54')]=_0x39b369===_0x268e('0x55')||_0x39b369===_0x268e('0x56')?_0x268e('0x55'):_0x268e('0x39');var _0x3a19e2=util[_0x268e('0x4b')](_0x268e('0x57'),_0x2b7388[_0x268e('0x4e')],_0x1daa71['uniqueid'],md5(_0x1daa71[_0x268e('0x58')]));if(_0x527050&&_0x527050[_0x268e('0x59')]){logger[_0x268e('0x15')]('[QUEUE]',_0x268e('0x5a'));_0x1daa71[_0x268e('0x5b')]=_0x3a19e2;}else if(_0x2a0c66&&_0x2a0c66['recordingFormat']&&_0x2a0c66[_0x268e('0x5c')]!==_0x268e('0x5d')){logger[_0x268e('0x15')](_0x268e('0x5e'),_0x268e('0x5a'));_0x1daa71[_0x268e('0x5b')]=_0x3a19e2;}else{_0x1daa71[_0x268e('0x5b')]='';}return getAdminUser(_0x39b369,_0x2e7f30,_0x2cadb9,_0x42db9d,_0x1ed265,_0x28a0da)[_0x268e('0xd')](getUser(_0x39b369,_0x2e7f30,_0x42db9d,_0x1ed265,_0x28a0da))['then'](getEndUser(_0x39b369,_0x2e7f30,_0x42db9d,_0x1ed265,_0x28a0da))['then'](getTicket(_0x39b369,_0x2e7f30,_0x42db9d,_0x441514,_0x1daa71,_0x1ed265))[_0x268e('0xd')](function(_0x1d41ae){logger['info'](util[_0x268e('0x4b')](_0x268e('0x5f'),_0x1d41ae[_0x268e('0x40')]));logger['info'](util[_0x268e('0x4b')]('call\x20direction:\x20%s',_0x39b369));if(_0x39b369!==_0x268e('0x56')){logger[_0x268e('0x15')]('['+[_0x39b369[_0x268e('0x16')]()]+']',_0x268e('0x60'));emit(_0x2b7388['remoteUri'],_0xa40a99[_0x268e('0x38')],_0x1d41ae['ticketId']);}})['catch'](function(_0x180625){logger[_0x268e('0x13')]('['+[_0x39b369[_0x268e('0x16')]()]+_0x268e('0x61'),util[_0x268e('0x62')](_0x180625,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x54cc=[']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','inspect','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','content','toString','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54cc,0x100));var _0xc54c=function(_0x1e841b,_0x4f5421){_0x1e841b=_0x1e841b-0x0;var _0x4e7096=_0x54cc[_0x1e841b];return _0x4e7096;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xc54c('0x0'));var util=require(_0xc54c('0x1'));var md5=require('md5');var Redis=require(_0xc54c('0x2'));var intUtil=require(_0xc54c('0x3'));var config=require(_0xc54c('0x4'));var logger=require(_0xc54c('0x5'))(_0xc54c('0x6'));config[_0xc54c('0x7')]=_[_0xc54c('0x8')](config[_0xc54c('0x7')],{'host':_0xc54c('0x9'),'port':0x18eb});var io=require(_0xc54c('0xa'))(new Redis(config[_0xc54c('0x7')]));function getAdminUser(_0x5bb723,_0x2098f0,_0x337b4f,_0xe8a30c,_0x9dde28,_0x115243){return new Promise(function(_0x343588,_0x6208dd){var _0x3e73ec={'method':_0xc54c('0xb'),'uri':_0xe8a30c+_0xc54c('0xc')+'&'+_0x9dde28+'&'+_0x115243,'auth':_0x2098f0,'json':!![]};return rp(_0x3e73ec)[_0xc54c('0xd')](function(_0x135bc1){if(_0x135bc1['result'][_0xc54c('0xe')]>0x0){_0x337b4f[_0xc54c('0xf')]=_0x135bc1[_0xc54c('0x10')][0x0][_0xc54c('0x11')];}logger[_0xc54c('0x12')]('['+[_0x5bb723[_0xc54c('0x13')]()]+'],\x20getAdminUser\x20crm',_0x337b4f);_0x343588(_0x337b4f);})['catch'](function(_0x32c2df){logger['error']('['+[_0x5bb723[_0xc54c('0x13')]()]+']',_0x32c2df[_0xc54c('0x14')]);_0x6208dd(_0x32c2df[_0xc54c('0x14')]);});});}function getUser(_0x1cd925,_0x32d0ae,_0x133ff7,_0x4c5cb2,_0x436e3f){return function(_0x17eeae){logger[_0xc54c('0x12')]('['+[_0x1cd925[_0xc54c('0x13')]()]+_0xc54c('0x15'),_0x17eeae);return new Promise(function(_0x58e8d1,_0xfa2808){if(intUtil[_0xc54c('0x16')](_0x17eeae[_0xc54c('0x17')])){var _0x214b33={'method':_0xc54c('0xb'),'uri':_0x133ff7+_0xc54c('0x18')+_0x17eeae[_0xc54c('0x17')]+'&'+_0x4c5cb2+'&'+_0x436e3f,'auth':_0x32d0ae,'json':!![]};logger[_0xc54c('0x12')]('['+[_0x1cd925[_0xc54c('0x13')]()]+_0xc54c('0x19'),_0x214b33);return rp(_0x214b33)[_0xc54c('0xd')](function(_0x32f05a){logger[_0xc54c('0x12')]('['+[_0x1cd925['toUpperCase']()]+_0xc54c('0x1a'),_0x32f05a);if(_0x32f05a['result'][_0xc54c('0xe')]>0x0&&String(_0x32f05a[_0xc54c('0x10')][0x0][_0xc54c('0x1b')])===_0xc54c('0x1c')){_0x17eeae['userId']=_0x32f05a[_0xc54c('0x10')][0x0][_0xc54c('0x11')];}else{_0x17eeae[_0xc54c('0x1d')]=_0x17eeae['adminId'];_0x17eeae[_0xc54c('0x17')]=_0x17eeae[_0xc54c('0x1e')];}logger[_0xc54c('0x12')]('['+[_0x1cd925[_0xc54c('0x13')]()]+_0xc54c('0x1f'),_0x17eeae);_0x58e8d1(_0x17eeae);})[_0xc54c('0x20')](function(_0x2c827c){logger[_0xc54c('0x21')]('['+[_0x1cd925[_0xc54c('0x13')]()]+']',_0x2c827c[_0xc54c('0x14')]);_0xfa2808(_0x2c827c[_0xc54c('0x14')]);});}else{logger[_0xc54c('0x12')]('['+[_0x1cd925['toUpperCase']()]+_0xc54c('0x22'));_0x17eeae['userId']=_0x17eeae[_0xc54c('0xf')];_0x17eeae['userEmail']=_0x17eeae[_0xc54c('0x1e')];_0x58e8d1(_0x17eeae);}});};}function createEndUser(_0x16c32c,_0x3326a6,_0x19684f,_0x33d542,_0x5f254a){logger[_0xc54c('0x12')]('['+[_0x16c32c[_0xc54c('0x13')]()]+_0xc54c('0x23'),_0x19684f);return new Promise(function(_0x14cf35,_0x259c45){var _0x5c2943={'method':_0xc54c('0x24'),'uri':_0x33d542+_0xc54c('0x25')+_0x5f254a,'body':{'user_name':_0x19684f['endUserNumber'],'roles':_0xc54c('0x26'),'first_name':_0x19684f[_0xc54c('0x27')],'active':_0xc54c('0x1c'),'date_format':'System','phone':_0x19684f[_0xc54c('0x27')]},'auth':_0x3326a6,'json':!![]};return rp(_0x5c2943)[_0xc54c('0xd')](function(_0x2a6ab0){logger['info']('['+[_0x16c32c[_0xc54c('0x13')]()]+_0xc54c('0x28'),_0x2a6ab0[_0xc54c('0x10')]);_0x19684f['endUserId']=_0x2a6ab0[_0xc54c('0x10')][_0xc54c('0x11')];_0x14cf35(_0x19684f);})[_0xc54c('0x20')](function(_0x22120c){logger[_0xc54c('0x21')]('['+[_0x16c32c['toUpperCase']()]+']',_0x22120c[_0xc54c('0x14')]);_0x259c45(_0x22120c[_0xc54c('0x14')]);});});}function getEndUser(_0x28ced4,_0x53a94d,_0x59aa20,_0x5e5d23,_0xbb99e8){return function(_0x548fa0){logger[_0xc54c('0x12')]('['+[_0x28ced4['toUpperCase']()]+_0xc54c('0x29'),_0x548fa0);return new Promise(function(_0x4f6998,_0x2a5eeb){var _0x2aa1d0={'method':_0xc54c('0xb'),'uri':_0x59aa20+_0xc54c('0x2a')+_0x548fa0[_0xc54c('0x27')]+'&'+_0x5e5d23+'&'+_0xbb99e8,'auth':_0x53a94d,'json':!![]};return rp(_0x2aa1d0)[_0xc54c('0xd')](function(_0x4c97c8){if(_0x4c97c8['result'][_0xc54c('0xe')]>0x0){_0x548fa0[_0xc54c('0x2b')]=_0x4c97c8[_0xc54c('0x10')][0x0][_0xc54c('0x11')];logger[_0xc54c('0x12')]('['+[_0x28ced4[_0xc54c('0x13')]()]+'],\x20getEndUser\x20crm',_0x548fa0);_0x4f6998(_0x548fa0);}else{return createEndUser(_0x28ced4,_0x53a94d,_0x548fa0,_0x59aa20,_0x5e5d23)['then'](function(_0x313ff6){logger['info']('['+[_0x28ced4[_0xc54c('0x13')]()]+_0xc54c('0x2c'),_0x313ff6);_0x4f6998(_0x313ff6);});}})['catch'](function(_0x420a7a){logger[_0xc54c('0x21')]('['+[_0x28ced4[_0xc54c('0x13')]()]+']',_0x420a7a[_0xc54c('0x14')]);_0x2a5eeb(_0x420a7a[_0xc54c('0x14')]);});});};}function getCustomFields(_0x52b9a8,_0x5f56d5){var _0x482a8f={};if(_0x52b9a8[_0xc54c('0xe')]>0x0){_[_0xc54c('0x2d')](_0x52b9a8,function(_0x2c514f){if(_[_0xc54c('0x2e')]([_0xc54c('0x2f'),_0xc54c('0x30')],_0x2c514f[_0xc54c('0x31')])&&_0x2c514f[_0xc54c('0x32')]&&!_0x2c514f[_0xc54c('0x33')]){_0x482a8f[_0x2c514f[_0xc54c('0x32')]['toLowerCase']()]=_0x2c514f[_0xc54c('0x34')][_0xc54c('0x35')]();}else if(_['includes'](['string','picklist'],_0x2c514f[_0xc54c('0x31')])&&_0x2c514f[_0xc54c('0x36')]&&_0x2c514f[_0xc54c('0x33')]){_0x482a8f[_0x2c514f[_0xc54c('0x36')][_0xc54c('0x37')]()]=_0x2c514f['content']['toString']();}else if(_0x2c514f[_0xc54c('0x31')]===_0xc54c('0x38')&&_0x2c514f[_0xc54c('0x39')]&&_0x2c514f[_0xc54c('0x36')]&&_0x2c514f[_0xc54c('0x33')]){_0x482a8f[_0x2c514f[_0xc54c('0x36')]['toLowerCase']()]=_0x5f56d5[_0x2c514f[_0xc54c('0x39')]][_0xc54c('0x35')]();}else if(_0x2c514f[_0xc54c('0x31')]==='customVariable'&&_0x2c514f['Variable']&&_0x2c514f[_0xc54c('0x3a')][_0xc54c('0x3b')]&&_0x2c514f['idField']&&_0x2c514f[_0xc54c('0x33')]){_0x482a8f[_0x2c514f[_0xc54c('0x36')]['toLowerCase']()]=_0x5f56d5[_0x2c514f['Variable'][_0xc54c('0x3b')][_0xc54c('0x37')]()]['toString']();}});}return _0x482a8f;}function getTicket(_0x111d7c,_0x47e033,_0x408edd,_0x58149d,_0x2ce5a3,_0x3a38d0){return function(_0x5ac3ed){logger[_0xc54c('0x12')]('['+[_0x111d7c[_0xc54c('0x13')]()]+_0xc54c('0x3c'),_0x5ac3ed);return new Promise(function(_0x3e2ae1,_0x51d134){var _0x3a36c5=_0x111d7c['toLowerCase']()===_0xc54c('0x3d')?_0x5ac3ed[_0xc54c('0x1d')]:_0x5ac3ed[_0xc54c('0x2b')];var _0x44cc10={'method':_0xc54c('0x24'),'uri':_0x408edd+_0xc54c('0x3e')+'?'+_0x3a38d0,'body':Object[_0xc54c('0x3f')]({},{'active':_0xc54c('0x1c'),'caller_id':_0x3a36c5,'assigned_to':_0x5ac3ed[_0xc54c('0x1d')],'short_description':intUtil[_0xc54c('0x40')](_0x58149d[_0xc54c('0x41')],_0x2ce5a3,'\x20'),'description':intUtil[_0xc54c('0x40')](_0x58149d[_0xc54c('0x42')],_0x2ce5a3,'\x0a')},getCustomFields(_0x58149d[_0xc54c('0x43')],_0x2ce5a3)),'auth':_0x47e033,'json':!![]};return rp(_0x44cc10)[_0xc54c('0xd')](function(_0x2d9657){logger['info']('['+[_0x111d7c[_0xc54c('0x13')]()]+_0xc54c('0x44'),_0x2d9657[_0xc54c('0x10')]);_0x5ac3ed[_0xc54c('0x45')]=_0x2d9657['result']['sys_id'];_0x5ac3ed['ticketNumber']=_0x2d9657[_0xc54c('0x10')][_0xc54c('0x46')];logger[_0xc54c('0x12')]('['+[_0x111d7c[_0xc54c('0x13')]()]+_0xc54c('0x47'),_0x5ac3ed);_0x3e2ae1(_0x5ac3ed);})[_0xc54c('0x20')](function(_0x15c6fa){logger[_0xc54c('0x21')]('['+[_0x111d7c[_0xc54c('0x13')]()]+']',_0x15c6fa[_0xc54c('0x14')]);_0x51d134(_0x15c6fa['message']);});});};}function createRemoteTag(_0x2b7c09,_0x3a610d,_0xddb17c,_0x503c26){return new Promise(function(_0x15f298,_0x35994c){var _0x234550={'method':_0xc54c('0x24'),'uri':_0xddb17c+'label'+'?'+_0x503c26,'body':{'short_description':_0x2b7c09,'global':!![],'active':!![],'name':_0x2b7c09},'auth':_0x3a610d,'json':!![]};return rp(_0x234550)['then'](function(_0xc1f76a){var _0x9fe3c4=_0xc1f76a['result']['sys_id'];_0x15f298(_0x9fe3c4);});});}function getRemoteTag(_0x27af8b,_0x37b9c7,_0x4dc17f,_0x474b81,_0x1407ee){return new Promise(function(_0x269c44,_0x1253d1){var _0x50c7e0={'method':'GET','uri':_0x4dc17f+_0xc54c('0x48')+'?sysparm_query=name%3D'+_0x27af8b+'&'+_0x474b81,'auth':_0x37b9c7,'json':!![]};return rp(_0x50c7e0)[_0xc54c('0xd')](function(_0x273cdc){if(_0x273cdc[_0xc54c('0x10')]['length']>0x0){var _0x228825=_0x273cdc[_0xc54c('0x10')][0x0][_0xc54c('0x11')];_0x269c44(_0x228825);}else{return createRemoteTag(_0x27af8b,_0x37b9c7,_0x4dc17f,_0x474b81)['then'](function(_0x3164f3){_0x269c44(_0x3164f3);});}});});}function assignTagToIncident(_0x4e6b09,_0x1b6f57,_0x476f12,_0x30f497,_0x3fe5b7){return new Promise(function(_0x1c0d6a,_0x2125e6){var _0x17da5c={'method':'POST','uri':_0x476f12+_0xc54c('0x49')+'?'+_0x3fe5b7,'body':{'label':_0x4e6b09,'table':_0xc54c('0x3e'),'id_type':_0xc54c('0x4a'),'table_key':_0x30f497['ticketId'],'title':_0xc54c('0x4b')+_0x30f497[_0xc54c('0x4c')],'id_display':_0x30f497['ticketNumber']},'auth':_0x1b6f57,'json':!![]};return rp(_0x17da5c)[_0xc54c('0xd')](function(_0x46ce46){_0x1c0d6a();})[_0xc54c('0x20')](function(){_0x1c0d6a();});});}function manageTags(_0x4bca44,_0xe66fff,_0x322bf6,_0x52a6b5,_0xf13443,_0x441401,_0x44ad84){return new Promise(function(_0x32dc3d,_0x46d9d1){var _0x532c73=[];_0xe66fff['forEach'](function(_0x16c828){_0x532c73[_0xc54c('0x4d')](getRemoteTag(_0x16c828,_0x322bf6,_0x52a6b5,_0x441401,_0x44ad84));});return Promise[_0xc54c('0x4e')](_0x532c73)[_0xc54c('0xd')](function(_0x2f16ef){if(_0x2f16ef[_0xc54c('0xe')]){logger[_0xc54c('0x12')]('['+[_0x4bca44[_0xc54c('0x13')]()]+_0xc54c('0x4f'),_0x2f16ef);var _0xeba60f=[];_0x2f16ef[_0xc54c('0x2d')](function(_0x2e798f){_0xeba60f[_0xc54c('0x4d')](assignTagToIncident(_0x2e798f,_0x322bf6,_0x52a6b5,_0xf13443,_0x441401));});return Promise[_0xc54c('0x4e')](_0xeba60f)['then'](function(){_0x32dc3d();})['catch'](function(){_0x32dc3d();});}else{_0x32dc3d();}});});}function getTags(_0x1a08b6,_0x99a11d,_0x519de6,_0x14ec95,_0x60049f,_0x377c46){return function(_0x23edd1){return new Promise(function(_0x163a43,_0x32534a){var _0x184aa6=[];var _0x36c9f4=_0x14ec95[_0xc54c('0x50')];if(_0x36c9f4&&_0x36c9f4['length']>0x0){_0x184aa6=_['map'](_0x36c9f4,'name');}if(_0x184aa6[_0xc54c('0xe')]>0x0){return manageTags(_0x1a08b6,_0x184aa6,_0x99a11d,_0x519de6,_0x23edd1,_0x60049f,_0x377c46)[_0xc54c('0xd')](function(){_0x163a43(_0x23edd1);});}else{_0x163a43(_0x23edd1);}});};}function emit(_0x40a479,_0x2d537e,_0x23b4fb){var _0x43d899=_0xc54c('0x51')+_0xc54c('0x52')+_0xc54c('0x53')+'%255EORDERBYDESCnumber';var _0x346bfd={'uri':_0x40a479+_0xc54c('0x54')+_0x23b4fb+_0x43d899};io['to'](util[_0xc54c('0x55')](_0xc54c('0x56'),_0x2d537e))[_0xc54c('0x57')]('trigger:browser:url',_0x346bfd);}exports['cs']=function(_0x1039ae,_0x55a28d,_0x4a98d1,_0x58d23b,_0x491233,_0x3c4d11,_0x2f1f01,_0x5cf56b){var _0x30d70c={};var _0xfec3d4={'user':_0x3c4d11[_0xc54c('0x58')],'pass':_0x3c4d11['password']};var _0xcf556e=_0xc54c('0x59');var _0x4248c1='sysparm_display_value=true';_0x3c4d11[_0xc54c('0x5a')]=intUtil['stripTrailingSlash'](_0x3c4d11['remoteUri']);_0x3c4d11['serverUrl']=intUtil[_0xc54c('0x5b')](_0x3c4d11[_0xc54c('0x5c')]);var _0x300e3a=util[_0xc54c('0x55')](_0xc54c('0x5d'),_0x3c4d11[_0xc54c('0x5a')]);_0x30d70c[_0xc54c('0x17')]=!_['isNil'](_0x58d23b)?_0x58d23b[_0xc54c('0x5e')]:null;_0x30d70c[_0xc54c('0x1e')]=_0x3c4d11[_0xc54c('0x5e')];_0x30d70c['endUserNumber']=_0x5cf56b[_0xc54c('0x37')]()===_0xc54c('0x3d')?_0x55a28d[_0xc54c('0x5f')]:_0x55a28d[_0xc54c('0x60')];_0x30d70c[_0xc54c('0x61')]=_0x5cf56b===_0xc54c('0x62')||_0x5cf56b===_0xc54c('0x63')?_0xc54c('0x62'):'outbound';var _0x144bb7=util[_0xc54c('0x55')](_0xc54c('0x64'),_0x3c4d11['serverUrl'],_0x55a28d[_0xc54c('0x65')],md5(_0x55a28d['uniqueid']));if(_0x491233&&_0x491233[_0xc54c('0x66')]){logger[_0xc54c('0x12')](_0xc54c('0x67'),'Recording\x20is\x20enabled!');_0x55a28d[_0xc54c('0x68')]=_0x144bb7;}else if(_0x2f1f01&&_0x2f1f01[_0xc54c('0x69')]&&_0x2f1f01[_0xc54c('0x69')]!=='none'){logger['info']('[OUTBOUND]',_0xc54c('0x6a'));_0x55a28d[_0xc54c('0x68')]=_0x144bb7;}else{_0x55a28d[_0xc54c('0x68')]='';}return getAdminUser(_0x5cf56b,_0xfec3d4,_0x30d70c,_0x300e3a,_0x4248c1,_0xcf556e)[_0xc54c('0xd')](getUser(_0x5cf56b,_0xfec3d4,_0x300e3a,_0x4248c1,_0xcf556e))[_0xc54c('0xd')](getEndUser(_0x5cf56b,_0xfec3d4,_0x300e3a,_0x4248c1,_0xcf556e))[_0xc54c('0xd')](getTicket(_0x5cf56b,_0xfec3d4,_0x300e3a,_0x4a98d1,_0x55a28d,_0x4248c1))[_0xc54c('0xd')](function(_0x1159cd){logger[_0xc54c('0x12')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x1159cd['ticketId']));logger['info'](util[_0xc54c('0x55')]('call\x20direction:\x20%s',_0x5cf56b));if(_0x5cf56b!==_0xc54c('0x63')){logger[_0xc54c('0x12')]('['+[_0x5cf56b[_0xc54c('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3c4d11[_0xc54c('0x5a')],_0x58d23b[_0xc54c('0x3b')],_0x1159cd[_0xc54c('0x45')]);}})['catch'](function(_0x1b67a4){logger[_0xc54c('0x21')]('['+[_0x5cf56b[_0xc54c('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc54c('0x6b')](_0x1b67a4,{'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 e2b283f..253f362 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 _0xde5d=['sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','users','version','user:%s','trigger:browser:url','unmanaged','lastevent','Recording\x20is\x20enabled!','toUpperCase','lodash','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','value','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','string','nameField','customField','toLowerCase','custom_fields','content','variable','type','Variable','login','PLAIN','xCALLY\x20Motion\x20integration'];(function(_0x1038b7,_0xc83279){var _0x388562=function(_0x25e5ea){while(--_0x25e5ea){_0x1038b7['push'](_0x1038b7['shift']());}};_0x388562(++_0xc83279);}(_0xde5d,0xa4));var _0xdde5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xde5d[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xdde5('0x0'));var rp=require('request-promise');var BPromise=require(_0xdde5('0x1'));var md5=require(_0xdde5('0x2'));var util=require(_0xdde5('0x3'));var Redis=require(_0xdde5('0x4'));var intUtil=require('./util');var config=require(_0xdde5('0x5'));var logger=require(_0xdde5('0x6'))(_0xdde5('0x7'));config[_0xdde5('0x8')]=_[_0xdde5('0x9')](config[_0xdde5('0x8')],{'host':_0xdde5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdde5('0x8')]));var def={'method':_0xdde5('0xb'),'json':!![]};function emit(_0x585733,_0x30ad83,_0xa2a4c7){io['to'](_0x585733)[_0xdde5('0xc')](_0x30ad83,_0xa2a4c7);}function getTicket(_0x5dd8a1,_0x4e2b97,_0x417ba2,_0x1102bc,_0x2a577e,_0x2c5272,_0x1e9f16,_0x626489){logger['info']('Creating\x20new\x20ticket...');var _0x5c436a=new Date();var _0x463178=[{'name':_0xdde5('0xd'),'value':intUtil[_0xdde5('0xe')](_0x1102bc['Subjects'],_0x2a577e,'\x20')},{'name':_0xdde5('0xf'),'value':_0x4e2b97['id']},{'name':_0xdde5('0x10'),'value':_0x4e2b97['id']},{'name':_0xdde5('0x11'),'value':intUtil[_0xdde5('0xe')](_0x1102bc[_0xdde5('0x12')],_0x2a577e,'\x0a')},{'name':_0xdde5('0x13'),'value':_0x5c436a[_0xdde5('0x14')]()[_0xdde5('0x15')](0x0,0x13)[_0xdde5('0x16')]('T','\x20')},{'name':_0xdde5('0x17'),'value':'0'},{'name':_0xdde5('0x18'),'value':'15'},{'name':_0xdde5('0x19'),'value':_0x417ba2['id']},{'name':_0xdde5('0x1a'),'value':'Contacts'},{'name':_0xdde5('0x1b'),'value':_0x417ba2[_0xdde5('0xd')]},{'name':'direction','value':_0x626489}];if(_0x2c5272[_0xdde5('0x1c')]){_[_0xdde5('0x1d')](_0x2c5272,function(_0x4de199){if(_0x2a577e[_0x4de199[_0xdde5('0x1e')]]){_0x463178[_0xdde5('0x1f')]({'name':_0x4de199[_0xdde5('0x20')],'value':_0x2a577e[_0x4de199[_0xdde5('0x1e')]]});}});}return request({'form':{'method':_0xdde5('0x21'),'input_type':_0xdde5('0x22'),'response_type':'JSON','rest_data':JSON[_0xdde5('0x23')]({'session':_0x1e9f16['id'],'module_name':_0xdde5('0x24'),'name_value_list':_0x463178})}});}function getAuth(_0x370037){return util['format'](_0xdde5('0x25'),new Buffer(_0x370037[_0xdde5('0x26')]+':X')[_0xdde5('0x27')]('base64'));}function getServerInfo(_0x4396fe){return request({'form':{'method':_0xdde5('0x28'),'input_type':_0xdde5('0x22'),'response_type':_0xdde5('0x22'),'rest_data':JSON[_0xdde5('0x23')]({'session':_0x4396fe['id']})}});}function getUser(_0x5d0909,_0x1bd7ec,_0x258456){if(!_[_0xdde5('0x29')](_0x1bd7ec)){logger[_0xdde5('0x2a')](_0xdde5('0x2b'),_0x1bd7ec);return request({'form':{'method':'get_entry_list','input_type':_0xdde5('0x22'),'response_type':_0xdde5('0x22'),'rest_data':JSON[_0xdde5('0x23')]({'session':_0x258456['id'],'module_name':_0xdde5('0x2c'),'query':util[_0xdde5('0x2d')](_0xdde5('0x2e'),_0x1bd7ec),'order_by':'','offset':'0','select_fields':['id',_0xdde5('0xd'),_0xdde5('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdde5('0x30')](function(_0x234be3){if(_0x234be3['entry_list'][_0xdde5('0x1c')]){var _0x3462bd=_[_0xdde5('0x31')](_0x234be3['entry_list'],function(_0x51e2b0){return _0x51e2b0['name_value_list'][_0xdde5('0x2f')]['value']===_0x1bd7ec;});if(_0x3462bd){logger[_0xdde5('0x2a')](_0xdde5('0x32'));return BPromise['resolve']({'id':_0x3462bd[_0xdde5('0x33')]['id']['value'],'name':_0x3462bd[_0xdde5('0x33')][_0xdde5('0xd')]['value']});}}logger[_0xdde5('0x2a')](_0xdde5('0x34'));return BPromise[_0xdde5('0x35')]({'id':_0x258456[_0xdde5('0x33')]['user_id'][_0xdde5('0x36')],'name':_0x258456[_0xdde5('0x33')][_0xdde5('0x2f')]['value']});});}else{logger[_0xdde5('0x2a')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xdde5('0x35')]({'id':_0x258456[_0xdde5('0x33')][_0xdde5('0x37')][_0xdde5('0x36')],'name':_0x258456['name_value_list'][_0xdde5('0x2f')][_0xdde5('0x36')]});}}function getEndUser(_0x11b5d4,_0x401c66,_0x3a177c,_0x416877){logger['info'](_0xdde5('0x38'),_0x3a177c);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xdde5('0x22'),'rest_data':JSON[_0xdde5('0x23')]({'session':_0x416877['id'],'module_name':'Contacts','query':util['format'](_0xdde5('0x39'),_0x3a177c),'order_by':'','offset':'0','select_fields':['id',_0xdde5('0xd'),_0xdde5('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdde5('0x30')](function(_0x1cf7d8){if(_0x1cf7d8[_0xdde5('0x3b')][_0xdde5('0x1c')]){var _0x4a4120=_[_0xdde5('0x31')](_0x1cf7d8[_0xdde5('0x3b')],function(_0x40edd5){return _0x40edd5[_0xdde5('0x33')][_0xdde5('0x3a')][_0xdde5('0x36')]===_0x3a177c;});if(_0x4a4120){logger[_0xdde5('0x2a')](_0xdde5('0x3c'));return BPromise[_0xdde5('0x35')]({'id':_0x4a4120[_0xdde5('0x33')]['id']['value'],'name':_0x4a4120[_0xdde5('0x33')][_0xdde5('0xd')][_0xdde5('0x36')],'phone':_0x4a4120[_0xdde5('0x33')][_0xdde5('0x3a')]['value']});}}else{logger[_0xdde5('0x2a')](_0xdde5('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xdde5('0x22'),'rest_data':JSON[_0xdde5('0x23')]({'session':_0x416877['id'],'module_name':_0xdde5('0x3e'),'name_value_list':[{'name':_0xdde5('0x3f'),'value':_0x401c66!==_0xdde5('0x40')?_0x401c66:util['format'](_0xdde5('0x41'),_0x3a177c)},{'name':_0xdde5('0x3a'),'value':_0x3a177c}]})}})[_0xdde5('0x30')](function(_0x207f8c){logger[_0xdde5('0x2a')](_0xdde5('0x42'));return BPromise[_0xdde5('0x35')]({'id':_0x207f8c['id'],'name':_0x207f8c['entry_list']['first_name']['value'],'phone':_0x207f8c[_0xdde5('0x3b')][_0xdde5('0x3a')][_0xdde5('0x36')]});});}});}function request(_0x1b8cf9){logger['debug'](_0xdde5('0x43'),JSON['stringify'](_0x1b8cf9));return rp(_[_0xdde5('0x44')](def,_0x1b8cf9));}function getTags(_0x4015d8,_0x40146e){var _0x52c17b=[];if(_0x4015d8&&_0x4015d8['length']>0x0){_0x52c17b=_[_0xdde5('0x45')](_0x4015d8,_0x40146e);}return _0x52c17b;}function getCustomFields(_0x2759d9,_0x2a2f1b){var _0x1ba0e5=[];var _0x23adfa={'custom_fields':[]};if(_0x2759d9['length']>0x0){_['forEach'](_0x2759d9,function(_0x5bd96d){if(_0x5bd96d['type']===_0xdde5('0x46')&&_0x5bd96d[_0xdde5('0x47')]&&!_0x5bd96d[_0xdde5('0x48')]){_0x23adfa[_0x5bd96d[_0xdde5('0x47')][_0xdde5('0x49')]()]=_0x5bd96d['content']['toString']();}else if(_0x5bd96d['type']==='string'&&_0x5bd96d['idField']&&_0x5bd96d['customField']){_0x23adfa[_0xdde5('0x4a')][_0xdde5('0x1f')]({'id':_0x5bd96d['idField'],'value':_0x5bd96d[_0xdde5('0x4b')][_0xdde5('0x27')]()});}else if(_0x5bd96d['type']===_0xdde5('0x4c')&&_0x5bd96d[_0xdde5('0x1e')]&&_0x5bd96d['idField']&&_0x5bd96d[_0xdde5('0x48')]){_0x2a2f1b[_0x5bd96d['variableName']]&&_0x23adfa[_0xdde5('0x4a')]['push']({'id':_0x5bd96d[_0xdde5('0x20')],'value':_0x2a2f1b[_0x5bd96d[_0xdde5('0x1e')]][_0xdde5('0x27')]()});}else if(_0x5bd96d[_0xdde5('0x4d')]==='customVariable'&&_0x5bd96d['Variable']&&_0x5bd96d[_0xdde5('0x4e')][_0xdde5('0xd')]&&_0x5bd96d[_0xdde5('0x20')]&&_0x5bd96d['customField']){_0x2a2f1b[_0x5bd96d[_0xdde5('0x4e')][_0xdde5('0xd')][_0xdde5('0x49')]()]&&_0x23adfa[_0xdde5('0x4a')][_0xdde5('0x1f')]({'id':_0x5bd96d['idField'],'value':_0x2a2f1b[_0x5bd96d[_0xdde5('0x4e')][_0xdde5('0xd')][_0xdde5('0x49')]()][_0xdde5('0x27')]()});}});}return _0x23adfa;}function getConnection(_0x9740db){return request({'method':'POST','form':{'method':_0xdde5('0x4f'),'input_type':'JSON','response_type':_0xdde5('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x9740db['username'],'password':_0x9740db['password'],'encryption':_0xdde5('0x50')},'application':_0xdde5('0x51')})}})[_0xdde5('0x30')](function(_0x40c262){var _0x58c6e7=_0x40c262;if(_0x58c6e7['id']){def[_0xdde5('0x52')]=_0x58c6e7['id'];return BPromise[_0xdde5('0x35')](_0x58c6e7);}else{throw new Error(util[_0xdde5('0x2d')]('Account\x20%d\x20is\x20not\x20valid',_0x9740db['id']));}});}function setRelationship(_0x1eec33,_0x5a4513,_0x309aeb,_0x4387c6){return request({'form':{'method':_0xdde5('0x53'),'input_type':_0xdde5('0x22'),'response_type':'JSON','rest_data':JSON[_0xdde5('0x23')]({'session':_0x1eec33['id'],'module_name':'Calls','module_id':_0x309aeb['id'],'link_field_name':_0x4387c6,'related_ids':[_0x5a4513['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x47d112,_0x1d5887,_0x2a012b,_0x85076b,_0x3ffe10,_0x55551f){var _0x5e72e1,_0xd6833d,_0x4ed932,_0x3151ae;_0x55551f[_0xdde5('0x54')]=intUtil[_0xdde5('0x55')](_0x55551f['remoteUri']);_0x55551f['serverUrl']=intUtil[_0xdde5('0x55')](_0x55551f[_0xdde5('0x56')]);def[_0xdde5('0x57')]=util[_0xdde5('0x2d')](_0xdde5('0x58'),_0x55551f[_0xdde5('0x54')]);if(_0x3ffe10&&_0x3ffe10[_0xdde5('0x59')]){logger['info'](_0xdde5('0x5a'),'Recording\x20is\x20enabled!');_0x1d5887[_0xdde5('0x5b')]=util[_0xdde5('0x2d')](_0xdde5('0x5c'),_0x55551f[_0xdde5('0x56')],_0x1d5887['uniqueid'],md5(_0x1d5887[_0xdde5('0x5d')]));}else{_0x1d5887[_0xdde5('0x5b')]='';}return getConnection(_0x55551f)['then'](function(_0x1aaf1e){_0x3151ae=_0x1aaf1e;return getUser(_0x55551f,_0x85076b[_0xdde5('0xd')],_0x3151ae);})[_0xdde5('0x30')](function(_0x449514){_0x5e72e1=_0x449514;logger[_0xdde5('0x2a')](_0xdde5('0x5e'),_0x5e72e1['id']);return getEndUser(_0x55551f,_0x1d5887[_0xdde5('0x5f')],_0x1d5887[_0xdde5('0x60')],_0x3151ae);})[_0xdde5('0x30')](function(_0x44e861){_0xd6833d=_0x44e861;logger[_0xdde5('0x2a')](_0xdde5('0x61'),_0xd6833d['id']);return getTicket(_0x55551f,_0x5e72e1,_0xd6833d,_0x2a012b,_0x1d5887,_0x2a012b[_0xdde5('0x62')],_0x3151ae,_0xdde5('0x63'));})['then'](function(_0x341229){_0x4ed932=_0x341229;logger[_0xdde5('0x2a')](_0xdde5('0x64'));logger[_0xdde5('0x2a')](_0xdde5('0x65'),_0x4ed932['id']);return setRelationship(_0x3151ae,_0x5e72e1,_0x4ed932,'users');})[_0xdde5('0x30')](function(){return setRelationship(_0x3151ae,_0xd6833d,_0x4ed932,_0xdde5('0x66'));})[_0xdde5('0x30')](function(){return getServerInfo(_0x3151ae);})[_0xdde5('0x30')](function(_0x1a461d){var _0x1452df=parseInt(_0x1a461d['version'][_0xdde5('0x67')](0x0));var _0x2b9592=util['format'](_0xdde5('0x68'),_0x55551f[_0xdde5('0x54')],_0x4ed932['id']);if(_0x1452df>0x6){_0x2b9592=util[_0xdde5('0x2d')](_0xdde5('0x69'),_0x55551f[_0xdde5('0x54')],_0x4ed932['id']);}logger[_0xdde5('0x2a')](_0xdde5('0x5a'),_0xdde5('0x6a'));emit(util[_0xdde5('0x2d')]('user:%s',_0x85076b[_0xdde5('0xd')]),'trigger:browser:url',{'uri':_0x2b9592});})[_0xdde5('0x6b')](function(_0x258a9e){logger[_0xdde5('0x6c')]('[QUEUE]',JSON[_0xdde5('0x23')](_0x258a9e));});};exports[_0xdde5('0x6d')]=function(_0x170fae,_0x539cca,_0x28e2b4,_0x17a374,_0x120f9d,_0x19b6aa,_0x1e0cf8){var _0x324af6,_0x39bb8c,_0x3a7851,_0x27c8c3;_0x19b6aa[_0xdde5('0x54')]=intUtil[_0xdde5('0x55')](_0x19b6aa[_0xdde5('0x54')]);_0x19b6aa[_0xdde5('0x56')]=intUtil[_0xdde5('0x55')](_0x19b6aa[_0xdde5('0x56')]);def[_0xdde5('0x57')]=util[_0xdde5('0x2d')](_0xdde5('0x58'),_0x19b6aa['remoteUri']);if(_0x1e0cf8&&_0x1e0cf8[_0xdde5('0x6e')]&&_0x1e0cf8['recordingFormat']!=='none'){logger[_0xdde5('0x2a')](_0xdde5('0x6f'),'Recording\x20is\x20enabled!');_0x539cca[_0xdde5('0x5b')]=util[_0xdde5('0x2d')](_0xdde5('0x5c'),_0x19b6aa[_0xdde5('0x56')],_0x539cca[_0xdde5('0x5d')],md5(_0x539cca[_0xdde5('0x5d')]));}return getConnection(_0x19b6aa)[_0xdde5('0x30')](function(_0x20993b){_0x27c8c3=_0x20993b;return getUser(_0x19b6aa,_0x17a374[_0xdde5('0xd')],_0x27c8c3);})['then'](function(_0x7df441){_0x324af6=_0x7df441;logger[_0xdde5('0x2a')]('The\x20User\x20ID\x20is:',_0x324af6['id']);return getEndUser(_0x19b6aa,_0x539cca[_0xdde5('0x70')],_0x539cca[_0xdde5('0x71')],_0x27c8c3);})['then'](function(_0x426733){_0x39bb8c=_0x426733;logger[_0xdde5('0x2a')](_0xdde5('0x61'),_0x39bb8c['id']);return getTicket(_0x19b6aa,_0x324af6,_0x39bb8c,_0x28e2b4,_0x539cca,_0x28e2b4[_0xdde5('0x62')],_0x27c8c3,_0xdde5('0x72'));})[_0xdde5('0x30')](function(_0x443e7a){_0x3a7851=_0x443e7a;logger[_0xdde5('0x2a')](_0xdde5('0x64'));logger[_0xdde5('0x2a')](_0xdde5('0x65'),_0x3a7851['id']);return setRelationship(_0x27c8c3,_0x324af6,_0x3a7851,_0xdde5('0x73'));})[_0xdde5('0x30')](function(){return setRelationship(_0x27c8c3,_0x39bb8c,_0x3a7851,_0xdde5('0x66'));})[_0xdde5('0x30')](function(){return getServerInfo(_0x27c8c3);})[_0xdde5('0x30')](function(_0x308f92){var _0x2a507f=parseInt(_0x308f92[_0xdde5('0x74')][_0xdde5('0x67')](0x0));var _0x2a5fb2=util[_0xdde5('0x2d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x19b6aa['remoteUri'],_0x3a7851['id']);if(_0x2a507f>0x6){_0x2a5fb2=util['format'](_0xdde5('0x69'),_0x19b6aa['remoteUri'],_0x3a7851['id']);}logger[_0xdde5('0x2a')](_0xdde5('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdde5('0x2d')](_0xdde5('0x75'),_0x17a374[_0xdde5('0xd')]),_0xdde5('0x76'),{'uri':_0x2a5fb2});})[_0xdde5('0x6b')](function(_0x5c5e6e){logger['error'](_0xdde5('0x6f'),JSON[_0xdde5('0x23')](_0x5c5e6e));});};exports[_0xdde5('0x77')]=function(_0xb54963,_0x1c0693,_0x1c58f6,_0x469dd0,_0x4bb2e5,_0x2dd386){var _0x518f89,_0x52c55f,_0x480483,_0x54a651;_0x2dd386[_0xdde5('0x54')]=intUtil[_0xdde5('0x55')](_0x2dd386[_0xdde5('0x54')]);_0x2dd386[_0xdde5('0x56')]=intUtil[_0xdde5('0x55')](_0x2dd386[_0xdde5('0x56')]);def['uri']=util[_0xdde5('0x2d')](_0xdde5('0x58'),_0x2dd386[_0xdde5('0x54')]);if(_0x4bb2e5&&_0x4bb2e5['monitor_format']){logger['info']('['+_0x1c0693[_0xdde5('0x78')]['toUpperCase']()+']',_0xdde5('0x79'));_0x1c0693[_0xdde5('0x5b')]=util[_0xdde5('0x2d')](_0xdde5('0x5c'),_0x2dd386[_0xdde5('0x56')],_0x1c0693[_0xdde5('0x5d')],md5(_0x1c0693['uniqueid']));}else{_0x1c0693['recordingURL']='';}return getConnection(_0x2dd386)[_0xdde5('0x30')](function(_0x14d0b3){_0x54a651=_0x14d0b3;if(!_['isNil'](_0x469dd0)){return getUser(_0x2dd386,_0x469dd0[_0xdde5('0xd')],_0x54a651);}else{return getUser(_0x2dd386,null,_0x54a651);}})[_0xdde5('0x30')](function(_0x1c51a9){_0x518f89=_0x1c51a9;logger[_0xdde5('0x2a')](_0xdde5('0x5e'),_0x518f89['id']);return getEndUser(_0x2dd386,_0x1c0693[_0xdde5('0x5f')],_0x1c0693[_0xdde5('0x60')],_0x54a651);})[_0xdde5('0x30')](function(_0x5d579c){_0x52c55f=_0x5d579c;logger[_0xdde5('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x52c55f['id']);return getTicket(_0x2dd386,_0x518f89,_0x52c55f,_0x1c58f6,_0x1c0693,_0x1c58f6[_0xdde5('0x62')],_0x54a651,_0xdde5('0x63'));})[_0xdde5('0x30')](function(_0x5624c7){_0x480483=_0x5624c7;logger[_0xdde5('0x2a')](_0xdde5('0x64'));logger[_0xdde5('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x480483['id']);return setRelationship(_0x54a651,_0x518f89,_0x480483,_0xdde5('0x73'));})['then'](function(){return setRelationship(_0x54a651,_0x52c55f,_0x480483,_0xdde5('0x66'));})[_0xdde5('0x30')](function(){return getServerInfo(_0x54a651);})[_0xdde5('0x6b')](function(_0x9ca921){logger['error']('['+_0x1c0693[_0xdde5('0x78')][_0xdde5('0x7a')]()+']',JSON['stringify'](_0x9ca921));});}; \ No newline at end of file +var _0xf29e=['%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','trigger:browser:url','catch','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','monitor_format','lastevent','toUpperCase','Fields','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','info','name','getString','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','direction','length','forEach','variableName','idField','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','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','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','custom_fields','push','customVariable','Variable','customField','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf29e,0x1e6));var _0xef29=function(_0x58b1e2,_0x43367e){_0x58b1e2=_0x58b1e2-0x0;var _0x5a4fa4=_0xf29e[_0x58b1e2];return _0x5a4fa4;};'use strict';var _=require('lodash');var rp=require(_0xef29('0x0'));var BPromise=require(_0xef29('0x1'));var md5=require(_0xef29('0x2'));var util=require(_0xef29('0x3'));var Redis=require(_0xef29('0x4'));var intUtil=require('./util');var config=require(_0xef29('0x5'));var logger=require(_0xef29('0x6'))('sugarcrm');config['redis']=_[_0xef29('0x7')](config[_0xef29('0x8')],{'host':_0xef29('0x9'),'port':0x18eb});var io=require(_0xef29('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x697acd,_0xda3cc7,_0x2e26e1){io['to'](_0x697acd)[_0xef29('0xb')](_0xda3cc7,_0x2e26e1);}function getTicket(_0x214549,_0x584327,_0x48b0fe,_0x5c375f,_0x56af5a,_0x5acbb5,_0x393064,_0x139a66){logger[_0xef29('0xc')]('Creating\x20new\x20ticket...');var _0x1b177d=new Date();var _0x4bc054=[{'name':_0xef29('0xd'),'value':intUtil[_0xef29('0xe')](_0x5c375f['Subjects'],_0x56af5a,'\x20')},{'name':'assigned_user_id','value':_0x584327['id']},{'name':_0xef29('0xf'),'value':_0x584327['id']},{'name':_0xef29('0x10'),'value':intUtil[_0xef29('0xe')](_0x5c375f[_0xef29('0x11')],_0x56af5a,'\x0a')},{'name':_0xef29('0x12'),'value':_0x1b177d['toISOString']()[_0xef29('0x13')](0x0,0x13)[_0xef29('0x14')]('T','\x20')},{'name':_0xef29('0x15'),'value':'0'},{'name':_0xef29('0x16'),'value':'15'},{'name':_0xef29('0x17'),'value':_0x48b0fe['id']},{'name':_0xef29('0x18'),'value':'Contacts'},{'name':'parent_name','value':_0x48b0fe[_0xef29('0xd')]},{'name':_0xef29('0x19'),'value':_0x139a66}];if(_0x5acbb5[_0xef29('0x1a')]){_[_0xef29('0x1b')](_0x5acbb5,function(_0x12c694){if(_0x56af5a[_0x12c694[_0xef29('0x1c')]]){_0x4bc054['push']({'name':_0x12c694[_0xef29('0x1d')],'value':_0x56af5a[_0x12c694[_0xef29('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xef29('0x1e'),'rest_data':JSON[_0xef29('0x1f')]({'session':_0x393064['id'],'module_name':_0xef29('0x20'),'name_value_list':_0x4bc054})}});}function getAuth(_0x4146b6){return util[_0xef29('0x21')]('Basic\x20%s',new Buffer(_0x4146b6[_0xef29('0x22')]+':X')[_0xef29('0x23')](_0xef29('0x24')));}function getServerInfo(_0x2cff26){return request({'form':{'method':_0xef29('0x25'),'input_type':_0xef29('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2cff26['id']})}});}function getUser(_0x1faedc,_0xb41248,_0x536f8b){if(!_[_0xef29('0x26')](_0xb41248)){logger[_0xef29('0xc')](_0xef29('0x27'),_0xb41248);return request({'form':{'method':_0xef29('0x28'),'input_type':_0xef29('0x1e'),'response_type':_0xef29('0x1e'),'rest_data':JSON[_0xef29('0x1f')]({'session':_0x536f8b['id'],'module_name':_0xef29('0x29'),'query':util[_0xef29('0x21')](_0xef29('0x2a'),_0xb41248),'order_by':'','offset':'0','select_fields':['id',_0xef29('0xd'),_0xef29('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xef29('0x2c')](function(_0x2d97d7){if(_0x2d97d7['entry_list'][_0xef29('0x1a')]){var _0x36d3fe=_[_0xef29('0x2d')](_0x2d97d7[_0xef29('0x2e')],function(_0x1d749a){return _0x1d749a[_0xef29('0x2f')][_0xef29('0x2b')]['value']===_0xb41248;});if(_0x36d3fe){logger[_0xef29('0xc')](_0xef29('0x30'));return BPromise[_0xef29('0x31')]({'id':_0x36d3fe['name_value_list']['id'][_0xef29('0x32')],'name':_0x36d3fe['name_value_list']['name']['value']});}}logger[_0xef29('0xc')](_0xef29('0x33'));return BPromise[_0xef29('0x31')]({'id':_0x536f8b[_0xef29('0x2f')]['user_id'][_0xef29('0x32')],'name':_0x536f8b[_0xef29('0x2f')][_0xef29('0x2b')][_0xef29('0x32')]});});}else{logger[_0xef29('0xc')](_0xef29('0x34'));return BPromise[_0xef29('0x31')]({'id':_0x536f8b[_0xef29('0x2f')][_0xef29('0x35')][_0xef29('0x32')],'name':_0x536f8b[_0xef29('0x2f')][_0xef29('0x2b')][_0xef29('0x32')]});}}function getEndUser(_0x113826,_0x5809bd,_0x71a658,_0x204905){logger[_0xef29('0xc')](_0xef29('0x36'),_0x71a658);return request({'form':{'method':_0xef29('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xef29('0x1f')]({'session':_0x204905['id'],'module_name':'Contacts','query':util[_0xef29('0x21')](_0xef29('0x37'),_0x71a658),'order_by':'','offset':'0','select_fields':['id',_0xef29('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xef29('0x2c')](function(_0x5b38f5){if(_0x5b38f5[_0xef29('0x2e')][_0xef29('0x1a')]){var _0x2cdf0b=_['find'](_0x5b38f5[_0xef29('0x2e')],function(_0x5036b1){return _0x5036b1[_0xef29('0x2f')][_0xef29('0x38')][_0xef29('0x32')]===_0x71a658;});if(_0x2cdf0b){logger[_0xef29('0xc')](_0xef29('0x39'));return BPromise[_0xef29('0x31')]({'id':_0x2cdf0b[_0xef29('0x2f')]['id']['value'],'name':_0x2cdf0b['name_value_list'][_0xef29('0xd')][_0xef29('0x32')],'phone':_0x2cdf0b[_0xef29('0x2f')]['phone_home'][_0xef29('0x32')]});}}else{logger['info'](_0xef29('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xef29('0x1e'),'response_type':'JSON','rest_data':JSON[_0xef29('0x1f')]({'session':_0x204905['id'],'module_name':'Contacts','name_value_list':[{'name':_0xef29('0x3b'),'value':_0x5809bd!==_0xef29('0x3c')?_0x5809bd:util[_0xef29('0x21')](_0xef29('0x3d'),_0x71a658)},{'name':_0xef29('0x38'),'value':_0x71a658}]})}})[_0xef29('0x2c')](function(_0x5df55c){logger[_0xef29('0xc')](_0xef29('0x3e'));return BPromise['resolve']({'id':_0x5df55c['id'],'name':_0x5df55c[_0xef29('0x2e')]['first_name'][_0xef29('0x32')],'phone':_0x5df55c[_0xef29('0x2e')]['phone_home'][_0xef29('0x32')]});});}});}function request(_0x2e4ed){logger[_0xef29('0x3f')](_0xef29('0x40'),JSON[_0xef29('0x1f')](_0x2e4ed));return rp(_[_0xef29('0x41')](def,_0x2e4ed));}function getTags(_0x3d7154,_0x14884c){var _0x397f9f=[];if(_0x3d7154&&_0x3d7154[_0xef29('0x1a')]>0x0){_0x397f9f=_[_0xef29('0x42')](_0x3d7154,_0x14884c);}return _0x397f9f;}function getCustomFields(_0x2c3175,_0x54f574){var _0x11a6a8=[];var _0x294b6a={'custom_fields':[]};if(_0x2c3175['length']>0x0){_[_0xef29('0x1b')](_0x2c3175,function(_0x18092f){if(_0x18092f[_0xef29('0x43')]===_0xef29('0x44')&&_0x18092f[_0xef29('0x45')]&&!_0x18092f['customField']){_0x294b6a[_0x18092f['nameField'][_0xef29('0x46')]()]=_0x18092f[_0xef29('0x47')][_0xef29('0x23')]();}else if(_0x18092f['type']===_0xef29('0x44')&&_0x18092f[_0xef29('0x1d')]&&_0x18092f['customField']){_0x294b6a[_0xef29('0x48')][_0xef29('0x49')]({'id':_0x18092f['idField'],'value':_0x18092f[_0xef29('0x47')][_0xef29('0x23')]()});}else if(_0x18092f[_0xef29('0x43')]==='variable'&&_0x18092f[_0xef29('0x1c')]&&_0x18092f[_0xef29('0x1d')]&&_0x18092f['customField']){_0x54f574[_0x18092f[_0xef29('0x1c')]]&&_0x294b6a[_0xef29('0x48')]['push']({'id':_0x18092f[_0xef29('0x1d')],'value':_0x54f574[_0x18092f[_0xef29('0x1c')]][_0xef29('0x23')]()});}else if(_0x18092f[_0xef29('0x43')]===_0xef29('0x4a')&&_0x18092f[_0xef29('0x4b')]&&_0x18092f[_0xef29('0x4b')][_0xef29('0xd')]&&_0x18092f[_0xef29('0x1d')]&&_0x18092f[_0xef29('0x4c')]){_0x54f574[_0x18092f[_0xef29('0x4b')][_0xef29('0xd')]['toLowerCase']()]&&_0x294b6a[_0xef29('0x48')]['push']({'id':_0x18092f[_0xef29('0x1d')],'value':_0x54f574[_0x18092f['Variable'][_0xef29('0xd')]['toLowerCase']()][_0xef29('0x23')]()});}});}return _0x294b6a;}function getConnection(_0xfe6b0c){return request({'method':'POST','form':{'method':_0xef29('0x4d'),'input_type':'JSON','response_type':_0xef29('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xfe6b0c[_0xef29('0x4e')],'password':_0xfe6b0c[_0xef29('0x4f')],'encryption':_0xef29('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xef29('0x2c')](function(_0x134a6c){var _0x1591af=_0x134a6c;if(_0x1591af['id']){def[_0xef29('0x51')]=_0x1591af['id'];return BPromise[_0xef29('0x31')](_0x1591af);}else{throw new Error(util[_0xef29('0x21')](_0xef29('0x52'),_0xfe6b0c['id']));}});}function setRelationship(_0x33f4aa,_0x43df4b,_0x1cae0d,_0x15f599){return request({'form':{'method':_0xef29('0x53'),'input_type':_0xef29('0x1e'),'response_type':_0xef29('0x1e'),'rest_data':JSON[_0xef29('0x1f')]({'session':_0x33f4aa['id'],'module_name':_0xef29('0x20'),'module_id':_0x1cae0d['id'],'link_field_name':_0x15f599,'related_ids':[_0x43df4b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xef29('0x54')]=function(_0x5ebe1b,_0x30144f,_0x33ed8d,_0x4906d0,_0x3d1a0a,_0x4ead9b){var _0xe46a27,_0x420e67,_0xc1c81d,_0x15b677;_0x4ead9b['remoteUri']=intUtil[_0xef29('0x55')](_0x4ead9b[_0xef29('0x56')]);_0x4ead9b[_0xef29('0x57')]=intUtil[_0xef29('0x55')](_0x4ead9b[_0xef29('0x57')]);def[_0xef29('0x58')]=util[_0xef29('0x21')](_0xef29('0x59'),_0x4ead9b[_0xef29('0x56')]);if(_0x3d1a0a&&_0x3d1a0a['monitor_format']){logger[_0xef29('0xc')](_0xef29('0x5a'),_0xef29('0x5b'));_0x30144f[_0xef29('0x5c')]=util[_0xef29('0x21')](_0xef29('0x5d'),_0x4ead9b['serverUrl'],_0x30144f[_0xef29('0x5e')],md5(_0x30144f[_0xef29('0x5e')]));}else{_0x30144f[_0xef29('0x5c')]='';}return getConnection(_0x4ead9b)[_0xef29('0x2c')](function(_0x1f31de){_0x15b677=_0x1f31de;return getUser(_0x4ead9b,_0x4906d0[_0xef29('0xd')],_0x15b677);})[_0xef29('0x2c')](function(_0x61818f){_0xe46a27=_0x61818f;logger['info'](_0xef29('0x5f'),_0xe46a27['id']);return getEndUser(_0x4ead9b,_0x30144f[_0xef29('0x60')],_0x30144f[_0xef29('0x61')],_0x15b677);})['then'](function(_0x6bf9f9){_0x420e67=_0x6bf9f9;logger['info'](_0xef29('0x62'),_0x420e67['id']);return getTicket(_0x4ead9b,_0xe46a27,_0x420e67,_0x33ed8d,_0x30144f,_0x33ed8d['Fields'],_0x15b677,_0xef29('0x63'));})[_0xef29('0x2c')](function(_0x5bac0e){_0xc1c81d=_0x5bac0e;logger['info'](_0xef29('0x64'));logger[_0xef29('0xc')](_0xef29('0x65'),_0xc1c81d['id']);return setRelationship(_0x15b677,_0xe46a27,_0xc1c81d,'users');})[_0xef29('0x2c')](function(){return setRelationship(_0x15b677,_0x420e67,_0xc1c81d,_0xef29('0x66'));})[_0xef29('0x2c')](function(){return getServerInfo(_0x15b677);})[_0xef29('0x2c')](function(_0x4ee884){var _0xa612a5=parseInt(_0x4ee884[_0xef29('0x67')]['charAt'](0x0));var _0xda0a7e=util['format'](_0xef29('0x68'),_0x4ead9b[_0xef29('0x56')],_0xc1c81d['id']);if(_0xa612a5>0x6){_0xda0a7e=util[_0xef29('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4ead9b[_0xef29('0x56')],_0xc1c81d['id']);}logger[_0xef29('0xc')](_0xef29('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xef29('0x21')](_0xef29('0x69'),_0x4906d0['name']),_0xef29('0x6a'),{'uri':_0xda0a7e});})[_0xef29('0x6b')](function(_0x55c184){logger['error']('[QUEUE]',JSON[_0xef29('0x1f')](_0x55c184));});};exports['outbound']=function(_0x192d8e,_0x4a39f1,_0x4389aa,_0x10c67b,_0x523aef,_0x26343e,_0xa321ab){var _0x189e89,_0x4c1dfd,_0x18a7bb,_0x416c0e;_0x26343e['remoteUri']=intUtil[_0xef29('0x55')](_0x26343e[_0xef29('0x56')]);_0x26343e['serverUrl']=intUtil[_0xef29('0x55')](_0x26343e[_0xef29('0x57')]);def['uri']=util[_0xef29('0x21')](_0xef29('0x59'),_0x26343e['remoteUri']);if(_0xa321ab&&_0xa321ab[_0xef29('0x6c')]&&_0xa321ab['recordingFormat']!==_0xef29('0x6d')){logger[_0xef29('0xc')](_0xef29('0x6e'),_0xef29('0x5b'));_0x4a39f1[_0xef29('0x5c')]=util[_0xef29('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26343e[_0xef29('0x57')],_0x4a39f1[_0xef29('0x5e')],md5(_0x4a39f1[_0xef29('0x5e')]));}return getConnection(_0x26343e)[_0xef29('0x2c')](function(_0x4a18db){_0x416c0e=_0x4a18db;return getUser(_0x26343e,_0x10c67b[_0xef29('0xd')],_0x416c0e);})[_0xef29('0x2c')](function(_0x55b6ae){_0x189e89=_0x55b6ae;logger['info'](_0xef29('0x5f'),_0x189e89['id']);return getEndUser(_0x26343e,_0x4a39f1['destcalleridname'],_0x4a39f1[_0xef29('0x6f')],_0x416c0e);})[_0xef29('0x2c')](function(_0x1a75de){_0x4c1dfd=_0x1a75de;logger[_0xef29('0xc')](_0xef29('0x62'),_0x4c1dfd['id']);return getTicket(_0x26343e,_0x189e89,_0x4c1dfd,_0x4389aa,_0x4a39f1,_0x4389aa['Fields'],_0x416c0e,'Outbound');})['then'](function(_0x2d7a9d){_0x18a7bb=_0x2d7a9d;logger[_0xef29('0xc')]('Ticket\x20created!');logger[_0xef29('0xc')](_0xef29('0x65'),_0x18a7bb['id']);return setRelationship(_0x416c0e,_0x189e89,_0x18a7bb,'users');})[_0xef29('0x2c')](function(){return setRelationship(_0x416c0e,_0x4c1dfd,_0x18a7bb,_0xef29('0x66'));})[_0xef29('0x2c')](function(){return getServerInfo(_0x416c0e);})[_0xef29('0x2c')](function(_0x4f1303){var _0x416520=parseInt(_0x4f1303[_0xef29('0x67')]['charAt'](0x0));var _0x5cb971=util[_0xef29('0x21')](_0xef29('0x68'),_0x26343e[_0xef29('0x56')],_0x18a7bb['id']);if(_0x416520>0x6){_0x5cb971=util[_0xef29('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x26343e['remoteUri'],_0x18a7bb['id']);}logger[_0xef29('0xc')](_0xef29('0x6e'),_0xef29('0x70'));emit(util[_0xef29('0x21')]('user:%s',_0x10c67b[_0xef29('0xd')]),_0xef29('0x6a'),{'uri':_0x5cb971});})['catch'](function(_0x4a9480){logger[_0xef29('0x71')](_0xef29('0x6e'),JSON['stringify'](_0x4a9480));});};exports['unmanaged']=function(_0x5c7c1d,_0x524179,_0x45ad6b,_0x25a4b4,_0x333412,_0x3cfab9){var _0x4b8d52,_0x5dc13e,_0x136621,_0x436484;_0x3cfab9[_0xef29('0x56')]=intUtil[_0xef29('0x55')](_0x3cfab9[_0xef29('0x56')]);_0x3cfab9[_0xef29('0x57')]=intUtil[_0xef29('0x55')](_0x3cfab9[_0xef29('0x57')]);def['uri']=util['format'](_0xef29('0x59'),_0x3cfab9[_0xef29('0x56')]);if(_0x333412&&_0x333412[_0xef29('0x72')]){logger[_0xef29('0xc')]('['+_0x524179[_0xef29('0x73')][_0xef29('0x74')]()+']',_0xef29('0x5b'));_0x524179[_0xef29('0x5c')]=util[_0xef29('0x21')](_0xef29('0x5d'),_0x3cfab9['serverUrl'],_0x524179[_0xef29('0x5e')],md5(_0x524179[_0xef29('0x5e')]));}else{_0x524179[_0xef29('0x5c')]='';}return getConnection(_0x3cfab9)[_0xef29('0x2c')](function(_0x4eb6cd){_0x436484=_0x4eb6cd;if(!_['isNil'](_0x25a4b4)){return getUser(_0x3cfab9,_0x25a4b4['name'],_0x436484);}else{return getUser(_0x3cfab9,null,_0x436484);}})[_0xef29('0x2c')](function(_0x341a35){_0x4b8d52=_0x341a35;logger['info']('The\x20User\x20ID\x20is:',_0x4b8d52['id']);return getEndUser(_0x3cfab9,_0x524179['calleridname'],_0x524179[_0xef29('0x61')],_0x436484);})[_0xef29('0x2c')](function(_0x569fec){_0x5dc13e=_0x569fec;logger[_0xef29('0xc')](_0xef29('0x62'),_0x5dc13e['id']);return getTicket(_0x3cfab9,_0x4b8d52,_0x5dc13e,_0x45ad6b,_0x524179,_0x45ad6b[_0xef29('0x75')],_0x436484,_0xef29('0x63'));})[_0xef29('0x2c')](function(_0x55449d){_0x136621=_0x55449d;logger[_0xef29('0xc')](_0xef29('0x64'));logger[_0xef29('0xc')](_0xef29('0x65'),_0x136621['id']);return setRelationship(_0x436484,_0x4b8d52,_0x136621,'users');})[_0xef29('0x2c')](function(){return setRelationship(_0x436484,_0x5dc13e,_0x136621,_0xef29('0x66'));})[_0xef29('0x2c')](function(){return getServerInfo(_0x436484);})[_0xef29('0x6b')](function(_0x4ff14d){logger['error']('['+_0x524179[_0xef29('0x73')][_0xef29('0x74')]()+']',JSON[_0xef29('0x1f')](_0x4ff14d));});}; \ 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 57be426..e93d3d2 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 _0xa6cc=['keyValue','key','format','%s:\x20%s','keyContent','keyType','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','getString','sortBy','length','type','string','push','content','variableName','customVariable','Variable','name','toLowerCase','toString'];(function(_0x36fbdd,_0x427ca5){var _0x5c8b5a=function(_0x49d92f){while(--_0x49d92f){_0x36fbdd['push'](_0x36fbdd['shift']());}};_0x5c8b5a(++_0x427ca5);}(_0xa6cc,0x15e));var _0xca6c=function(_0x38c1fe,_0x3f2e6f){_0x38c1fe=_0x38c1fe-0x0;var _0x24d5f5=_0xa6cc[_0x38c1fe];return _0x24d5f5;};'use strict';var _=require(_0xca6c('0x0'));var util=require('util');exports[_0xca6c('0x1')]=function(_0x35714a,_0x25d1ab,_0xf3b2b4){var _0x1aa068=[];if(_0x35714a['length']>0x0){var _0x3671c0=_[_0xca6c('0x2')](_0x35714a,['id']);for(var _0x4d4964=0x0;_0x4d4964<_0x3671c0[_0xca6c('0x3')];_0x4d4964++){var _0x46bde4=_0x3671c0[_0x4d4964];if(_0x46bde4[_0xca6c('0x4')]===_0xca6c('0x5')){_0x1aa068[_0xca6c('0x6')](_0x46bde4[_0xca6c('0x7')]);}else if(_0x46bde4[_0xca6c('0x4')]==='variable'&&_0x46bde4[_0xca6c('0x8')]){_0x25d1ab[_0x46bde4[_0xca6c('0x8')]]&&_0x1aa068['push'](_0x25d1ab[_0x46bde4['variableName']]['toString']());}else if(_0x46bde4['type']===_0xca6c('0x9')&&_0x46bde4[_0xca6c('0xa')]&&_0x46bde4[_0xca6c('0xa')]['name']){_0x25d1ab[_0x46bde4[_0xca6c('0xa')][_0xca6c('0xb')][_0xca6c('0xc')]()]&&_0x1aa068[_0xca6c('0x6')](_0x25d1ab[_0x46bde4['Variable'][_0xca6c('0xb')][_0xca6c('0xc')]()][_0xca6c('0xd')]());}else if(_0x46bde4['type']===_0xca6c('0xe')){if(_0x46bde4['keyType']==='string'&&_0x46bde4[_0xca6c('0xf')]){_0x1aa068[_0xca6c('0x6')](util[_0xca6c('0x10')](_0xca6c('0x11'),_0x46bde4[_0xca6c('0xf')],_0x46bde4[_0xca6c('0x12')]));}else if(_0x46bde4[_0xca6c('0x13')]===_0xca6c('0x14')&&_0x46bde4[_0xca6c('0x8')]&&_0x46bde4[_0xca6c('0xf')]){_0x25d1ab[_0x46bde4['variableName']]&&_0x1aa068[_0xca6c('0x6')](util[_0xca6c('0x10')](_0xca6c('0x11'),_0x46bde4[_0xca6c('0xf')],_0x25d1ab[_0x46bde4['variableName']]));}else if(_0x46bde4[_0xca6c('0x13')]===_0xca6c('0x9')&&_0x46bde4[_0xca6c('0xa')]&&_0x46bde4[_0xca6c('0xa')]['name']&&_0x46bde4[_0xca6c('0xf')]){_0x25d1ab[_0x46bde4[_0xca6c('0xa')]['name'][_0xca6c('0xc')]()]&&_0x1aa068[_0xca6c('0x6')](util[_0xca6c('0x10')](_0xca6c('0x11'),_0x46bde4[_0xca6c('0xf')],_0x25d1ab[_0x46bde4[_0xca6c('0xa')]['name'][_0xca6c('0xc')]()]));}}}}return _0x1aa068[_0xca6c('0x15')](_0xf3b2b4);};exports[_0xca6c('0x16')]=function(_0x321427){var _0x118c5c=_0x321427[_0xca6c('0x17')](-0x1);if(_0x118c5c==='/'){_0x321427=_0x321427[_0xca6c('0x18')](0x0,_0x321427[_0xca6c('0x19')](_0x118c5c));}return _0x321427;};exports['validateEmail']=function(_0x1b517d){if(!_[_0xca6c('0x1a')](_0x1b517d)&&_0x1b517d!==''){var _0x4e9652=/^(([^<>()\[\]\\.,;:\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 _0x4e9652[_0xca6c('0x1b')](String(_0x1b517d)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x6be6=['key','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','test','lodash','util','getString','length','sortBy','type','string','content','variable','variableName','push','toString','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','keyContent'];(function(_0x1fddb6,_0x3a19cd){var _0x493488=function(_0x596537){while(--_0x596537){_0x1fddb6['push'](_0x1fddb6['shift']());}};_0x493488(++_0x3a19cd);}(_0x6be6,0x158));var _0x66be=function(_0x56373f,_0x1b7bfe){_0x56373f=_0x56373f-0x0;var _0x22638b=_0x6be6[_0x56373f];return _0x22638b;};'use strict';var _=require(_0x66be('0x0'));var util=require(_0x66be('0x1'));exports[_0x66be('0x2')]=function(_0x2cf2ae,_0xcd64c,_0xf6a119){var _0x47fa56=[];if(_0x2cf2ae[_0x66be('0x3')]>0x0){var _0x28ddce=_[_0x66be('0x4')](_0x2cf2ae,['id']);for(var _0x88d36c=0x0;_0x88d36c<_0x28ddce['length'];_0x88d36c++){var _0x467bc8=_0x28ddce[_0x88d36c];if(_0x467bc8[_0x66be('0x5')]===_0x66be('0x6')){_0x47fa56['push'](_0x467bc8[_0x66be('0x7')]);}else if(_0x467bc8[_0x66be('0x5')]===_0x66be('0x8')&&_0x467bc8[_0x66be('0x9')]){_0xcd64c[_0x467bc8[_0x66be('0x9')]]&&_0x47fa56[_0x66be('0xa')](_0xcd64c[_0x467bc8['variableName']][_0x66be('0xb')]());}else if(_0x467bc8['type']==='customVariable'&&_0x467bc8[_0x66be('0xc')]&&_0x467bc8[_0x66be('0xc')][_0x66be('0xd')]){_0xcd64c[_0x467bc8[_0x66be('0xc')][_0x66be('0xd')]['toLowerCase']()]&&_0x47fa56[_0x66be('0xa')](_0xcd64c[_0x467bc8[_0x66be('0xc')][_0x66be('0xd')][_0x66be('0xe')]()][_0x66be('0xb')]());}else if(_0x467bc8['type']===_0x66be('0xf')){if(_0x467bc8[_0x66be('0x10')]===_0x66be('0x6')&&_0x467bc8['key']){_0x47fa56['push'](util[_0x66be('0x11')](_0x66be('0x12'),_0x467bc8['key'],_0x467bc8[_0x66be('0x13')]));}else if(_0x467bc8[_0x66be('0x10')]===_0x66be('0x8')&&_0x467bc8[_0x66be('0x9')]&&_0x467bc8['key']){_0xcd64c[_0x467bc8[_0x66be('0x9')]]&&_0x47fa56[_0x66be('0xa')](util[_0x66be('0x11')](_0x66be('0x12'),_0x467bc8[_0x66be('0x14')],_0xcd64c[_0x467bc8['variableName']]));}else if(_0x467bc8[_0x66be('0x10')]===_0x66be('0x15')&&_0x467bc8[_0x66be('0xc')]&&_0x467bc8[_0x66be('0xc')][_0x66be('0xd')]&&_0x467bc8[_0x66be('0x14')]){_0xcd64c[_0x467bc8[_0x66be('0xc')]['name'][_0x66be('0xe')]()]&&_0x47fa56[_0x66be('0xa')](util[_0x66be('0x11')](_0x66be('0x12'),_0x467bc8[_0x66be('0x14')],_0xcd64c[_0x467bc8[_0x66be('0xc')][_0x66be('0xd')][_0x66be('0xe')]()]));}}}}return _0x47fa56[_0x66be('0x16')](_0xf6a119);};exports[_0x66be('0x17')]=function(_0x491cbc){var _0x1f8b9a=_0x491cbc[_0x66be('0x18')](-0x1);if(_0x1f8b9a==='/'){_0x491cbc=_0x491cbc[_0x66be('0x19')](0x0,_0x491cbc[_0x66be('0x1a')](_0x1f8b9a));}return _0x491cbc;};exports['validateEmail']=function(_0x5d30f7){if(!_['isNil'](_0x5d30f7)&&_0x5d30f7!==''){var _0x50f226=/^(([^<>()\[\]\\.,;:\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 _0x50f226[_0x66be('0x1b')](String(_0x5d30f7)[_0x66be('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 4d60fec..4722414 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x14402a,_0x3b1bf4){var _0x575376=function(_0x1c3f24){while(--_0x1c3f24){_0x14402a['push'](_0x14402a['shift']());}};_0x575376(++_0x3b1bf4);}(_0x34e8,0x12c));var _0x834e=function(_0x262ae5,_0x4a14ab){_0x262ae5=_0x262ae5-0x0;var _0x467a8a=_0x34e8[_0x262ae5];return _0x467a8a;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 1df658a..95af824 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 _0xa0ee=['recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','Agent\x20found!','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','authType','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','custom_fields','idField','content','variableName','push','customVariable','Variable','name','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xa0ee,0xe5));var _0xea0e=function(_0x331ce0,_0xe335b9){_0x331ce0=_0x331ce0-0x0;var _0x31c3c7=_0xa0ee[_0x331ce0];return _0x31c3c7;};'use strict';var _=require(_0xea0e('0x0'));var rp=require(_0xea0e('0x1'));var md5=require(_0xea0e('0x2'));var util=require(_0xea0e('0x3'));var Redis=require(_0xea0e('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xea0e('0x5'))('zendesk');config[_0xea0e('0x6')]=_['defaults'](config[_0xea0e('0x6')],{'host':_0xea0e('0x7'),'port':0x18eb});var io=require(_0xea0e('0x8'))(new Redis(config[_0xea0e('0x6')]));function emit(_0x134cbf,_0x259309,_0x474839){io['to'](_0x134cbf)['emit'](_0x259309,_0x474839);}var headers={'Content-Type':'application/json','Accept':_0xea0e('0x9')};function getTicket(_0x3fa999,_0x123780,_0x5d174d,_0x4ec9c3,_0x41228){logger[_0xea0e('0xa')](_0xea0e('0xb'));return request({'uri':util[_0xea0e('0xc')](_0xea0e('0xd'),_0x3fa999[_0xea0e('0xe')]),'method':_0xea0e('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x5d174d['id'],'submitter_id':_0x123780?_0x123780['id']:undefined,'assignee_id':_0x123780?_0x123780['id']:undefined,'tags':getTags(_0x4ec9c3[_0xea0e('0x10')],'name'),'subject':intUtil[_0xea0e('0x11')](_0x4ec9c3['Subjects'],_0x41228,'\x20'),'description':intUtil['getString'](_0x4ec9c3[_0xea0e('0x12')],_0x41228,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4ec9c3[_0xea0e('0x12')],_0x41228,'\x0a')}},getCustomFields(_0x4ec9c3[_0xea0e('0x13')],_0x41228))}})[_0xea0e('0x14')](function(_0x47b9de){logger[_0xea0e('0xa')](_0xea0e('0x15'));return _0x47b9de[_0xea0e('0x16')];});}function getUser(_0x3495ef,_0x51f58f){if(intUtil['validateEmail'](_0x51f58f)){logger[_0xea0e('0xa')](_0xea0e('0x17'),_0x51f58f);return request({'uri':util[_0xea0e('0xc')]('%s/search.json',_0x3495ef[_0xea0e('0xe')]),'qs':{'query':util[_0xea0e('0xc')](_0xea0e('0x18'),_0x51f58f)}})[_0xea0e('0x14')](function(_0x382e3a){if(_0x382e3a['count']){logger[_0xea0e('0xa')](_0xea0e('0x19'));return _['find'](_0x382e3a['results'],{'email':_0x51f58f,'role':_0xea0e('0x1a')});}else{logger['info'](_0xea0e('0x1b'));return request({'uri':util[_0xea0e('0xc')]('%s/users/me.json',_0x3495ef['remoteUri'])})['then'](function(_0xfb6013){logger[_0xea0e('0xa')](_0xea0e('0x1c'));return _0xfb6013[_0xea0e('0x1d')];});}});}else{logger[_0xea0e('0xa')](_0xea0e('0x1b'));return request({'uri':util[_0xea0e('0xc')](_0xea0e('0x1e'),_0x3495ef[_0xea0e('0xe')])})['then'](function(_0x13c542){logger['info'](_0xea0e('0x1c'));return _0x13c542[_0xea0e('0x1d')];});}}function getEndUser(_0x1b72a1,_0xbe88f8,_0x3dafa8){logger[_0xea0e('0xa')](_0xea0e('0x1f'),_0x3dafa8);return request({'uri':util[_0xea0e('0xc')](_0xea0e('0x20'),_0x1b72a1['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x3dafa8)}})[_0xea0e('0x14')](function(_0x4f2d32){var _0x5ced18;if(_0x4f2d32[_0xea0e('0x21')][_0xea0e('0x22')]){_0x4f2d32[_0xea0e('0x21')]=_[_0xea0e('0x23')](_0x4f2d32[_0xea0e('0x21')],{'suspended':![],'role':'end-user'});if(_0x4f2d32[_0xea0e('0x21')][_0xea0e('0x22')]){_0x5ced18=_[_0xea0e('0x24')](_0x4f2d32[_0xea0e('0x21')]);}}if(_0x5ced18){logger[_0xea0e('0xa')](_0xea0e('0x25'));return _0x5ced18;}else{logger[_0xea0e('0xa')](_0xea0e('0x26'));return request({'uri':util[_0xea0e('0xc')](_0xea0e('0x27'),_0x1b72a1[_0xea0e('0xe')]),'method':_0xea0e('0xf'),'body':{'user':{'role':_0xea0e('0x28'),'name':util[_0xea0e('0xc')]('Caller\x20-\x20%s',_0xbe88f8||_0x3dafa8),'phone':_0x3dafa8}}})[_0xea0e('0x14')](function(_0x1f7ca5){logger[_0xea0e('0xa')]('Enduser\x20created.');return _0x1f7ca5[_0xea0e('0x1d')];});}});}function getAuth(_0x1dd3a5){var _0x15a332;if(_0x1dd3a5[_0xea0e('0x29')]==='password'){_0x15a332=util['format']('%s:%s',_0x1dd3a5[_0xea0e('0x2a')],_0x1dd3a5[_0xea0e('0x2b')]);}else if(_0x1dd3a5[_0xea0e('0x29')]===_0xea0e('0x2c')){_0x15a332=util[_0xea0e('0xc')](_0xea0e('0x2d'),_0x1dd3a5['username'],_0x1dd3a5['token']);}return util['format'](_0xea0e('0x2e'),new Buffer(_0x15a332)[_0xea0e('0x2f')](_0xea0e('0x30')));}function request(_0x4dff64){logger[_0xea0e('0x31')](_0xea0e('0x32'),JSON[_0xea0e('0x33')](_0x4dff64));return rp(_[_0xea0e('0x34')](_0x4dff64,{'method':_0xea0e('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x5f4c38,_0x4c87aa){var _0x3a8c71=[];if(_0x5f4c38&&_0x5f4c38[_0xea0e('0x22')]>0x0){_0x3a8c71=_[_0xea0e('0x36')](_0x5f4c38,_0x4c87aa);}return _0x3a8c71;}function getCustomFields(_0x47ae44,_0x45a938){var _0x2954d5=[];var _0x367328={'custom_fields':[]};if(_0x47ae44[_0xea0e('0x22')]>0x0){_[_0xea0e('0x37')](_0x47ae44,function(_0x343a7f){if(_['includes']([_0xea0e('0x38'),_0xea0e('0x39')],_0x343a7f[_0xea0e('0x3a')])&&_0x343a7f[_0xea0e('0x3b')]&&!_0x343a7f[_0xea0e('0x3c')]){_0x367328[_0x343a7f[_0xea0e('0x3b')][_0xea0e('0x3d')]()]=_0x343a7f['content'][_0xea0e('0x2f')]();}else if(_[_0xea0e('0x3e')](['string','picklist'],_0x343a7f[_0xea0e('0x3a')])&&_0x343a7f['idField']&&_0x343a7f[_0xea0e('0x3c')]){_0x367328[_0xea0e('0x3f')]['push']({'id':_0x343a7f[_0xea0e('0x40')],'value':_0x343a7f[_0xea0e('0x41')][_0xea0e('0x2f')]()});}else if(_0x343a7f[_0xea0e('0x3a')]==='variable'&&_0x343a7f['variableName']&&_0x343a7f[_0xea0e('0x40')]&&_0x343a7f['customField']){_0x45a938[_0x343a7f[_0xea0e('0x42')]]&&_0x367328[_0xea0e('0x3f')][_0xea0e('0x43')]({'id':_0x343a7f[_0xea0e('0x40')],'value':_0x45a938[_0x343a7f[_0xea0e('0x42')]][_0xea0e('0x2f')]()});}else if(_0x343a7f[_0xea0e('0x3a')]===_0xea0e('0x44')&&_0x343a7f[_0xea0e('0x45')]&&_0x343a7f[_0xea0e('0x45')][_0xea0e('0x46')]&&_0x343a7f['idField']&&_0x343a7f[_0xea0e('0x3c')]){_0x45a938[_0x343a7f[_0xea0e('0x45')][_0xea0e('0x46')][_0xea0e('0x3d')]()]&&_0x367328[_0xea0e('0x3f')][_0xea0e('0x43')]({'id':_0x343a7f[_0xea0e('0x40')],'value':_0x45a938[_0x343a7f[_0xea0e('0x45')]['name']['toLowerCase']()]['toString']()});}});}return _0x367328;}exports['queue']=function(_0x53c739,_0x17883f,_0x3a119e,_0x2ddab3,_0x27d4e3,_0x4c69a9){var _0x7c6ca4,_0x54f8d8;_0x4c69a9[_0xea0e('0xe')]=intUtil['stripTrailingSlash'](_0x4c69a9[_0xea0e('0xe')]);_0x4c69a9[_0xea0e('0x47')]=intUtil[_0xea0e('0x48')](_0x4c69a9[_0xea0e('0x47')]);if(_0x27d4e3&&_0x27d4e3[_0xea0e('0x49')]){logger[_0xea0e('0xa')](_0xea0e('0x4a'),_0xea0e('0x4b'));_0x17883f[_0xea0e('0x4c')]=util[_0xea0e('0xc')](_0xea0e('0x4d'),_0x4c69a9[_0xea0e('0x47')],_0x17883f[_0xea0e('0x4e')],md5(_0x17883f[_0xea0e('0x4e')]));}else{_0x17883f[_0xea0e('0x4c')]='';}headers[_0xea0e('0x4f')]=getAuth(_0x4c69a9);return getUser(_0x4c69a9,_0x2ddab3[_0xea0e('0x50')])['then'](function(_0x3efd83){_0x7c6ca4=_0x3efd83;logger[_0xea0e('0xa')]('The\x20User\x20ID\x20is:',_0x7c6ca4['id']);return getEndUser(_0x4c69a9,_0x17883f[_0xea0e('0x51')],_0x17883f['calleridnum']);})[_0xea0e('0x14')](function(_0x57c09e){_0x54f8d8=_0x57c09e;logger[_0xea0e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x54f8d8['id']);return getTicket(_0x4c69a9,_0x7c6ca4,_0x54f8d8,_0x3a119e,_0x17883f);})['then'](function(_0x5bfb68){if(_0x5bfb68){logger[_0xea0e('0xa')](_0xea0e('0x52'),_0x5bfb68['id']);switch(_0x4c69a9[_0xea0e('0x3a')]){case _0xea0e('0x53'):logger[_0xea0e('0xa')](_0xea0e('0x4a'),_0xea0e('0x54'));return request({'uri':util[_0xea0e('0xc')](_0xea0e('0x55'),_0x4c69a9[_0xea0e('0xe')],_0x7c6ca4['id'],_0x5bfb68['id']),'method':_0xea0e('0xf')});case _0xea0e('0x56'):logger[_0xea0e('0xa')](_0xea0e('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea0e('0xc')](_0xea0e('0x57'),_0x2ddab3['name']),_0xea0e('0x58'),{'uri':util['format'](_0xea0e('0x59'),_0x4c69a9['remoteUri'][_0xea0e('0x5a')](_0xea0e('0x5b'),''),_0x5bfb68['id'])});break;default:logger[_0xea0e('0x5c')]('[QUEUE]',_0xea0e('0x5d'));}}})[_0xea0e('0x5e')](function(_0x318a2c){logger['error'](_0xea0e('0x5f'),util[_0xea0e('0x60')](_0x318a2c,{'showHidden':!![],'depth':null}));});};exports[_0xea0e('0x61')]=function(_0x195f03,_0x3ae3b4,_0x9a87a9,_0x5b889d,_0x2cd6ed,_0x50e666,_0x5d6e2b){var _0x4a275b,_0x57191d;_0x50e666[_0xea0e('0xe')]=intUtil[_0xea0e('0x48')](_0x50e666[_0xea0e('0xe')]);_0x50e666[_0xea0e('0x47')]=intUtil[_0xea0e('0x48')](_0x50e666[_0xea0e('0x47')]);if(_0x5d6e2b&&_0x5d6e2b['recordingFormat']&&_0x5d6e2b[_0xea0e('0x62')]!==_0xea0e('0x63')){logger[_0xea0e('0xa')]('[OUTBOUND]',_0xea0e('0x4b'));_0x3ae3b4[_0xea0e('0x4c')]=util[_0xea0e('0xc')](_0xea0e('0x4d'),_0x50e666['serverUrl'],_0x3ae3b4[_0xea0e('0x4e')],md5(_0x3ae3b4['uniqueid']));}headers[_0xea0e('0x4f')]=getAuth(_0x50e666);return getUser(_0x50e666,_0x5b889d[_0xea0e('0x50')])[_0xea0e('0x14')](function(_0x106304){_0x4a275b=_0x106304;logger['info'](_0xea0e('0x64'),_0x4a275b['id']);return getEndUser(_0x50e666,_0x3ae3b4[_0xea0e('0x65')],_0x3ae3b4[_0xea0e('0x66')]);})['then'](function(_0x205931){_0x57191d=_0x205931;logger[_0xea0e('0xa')](_0xea0e('0x67'),_0x57191d['id']);return getTicket(_0x50e666,_0x4a275b,_0x57191d,_0x9a87a9,_0x3ae3b4);})[_0xea0e('0x14')](function(_0x33d071){if(_0x33d071){logger[_0xea0e('0xa')](_0xea0e('0x52'),_0x33d071['id']);switch(_0x50e666[_0xea0e('0x3a')]){case _0xea0e('0x53'):logger[_0xea0e('0xa')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xea0e('0xc')](_0xea0e('0x55'),_0x50e666[_0xea0e('0xe')],_0x4a275b['id'],_0x33d071['id']),'method':_0xea0e('0xf')});case'newTab':logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea0e('0xc')](_0xea0e('0x57'),_0x5b889d[_0xea0e('0x46')]),_0xea0e('0x58'),{'uri':util['format'](_0xea0e('0x59'),_0x50e666['remoteUri'][_0xea0e('0x5a')]('/api/v2',''),_0x33d071['id'])});break;default:logger[_0xea0e('0x5c')](_0xea0e('0x68'),_0xea0e('0x5d'));}}})['catch'](function(_0x233ddc){logger['error'](_0xea0e('0x69'),util[_0xea0e('0x60')](_0x233ddc,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x405fd7,_0x4db9a1,_0x1121d3,_0x53dfa3,_0x304a68,_0x391c05){var _0x1e2522,_0xa9d50f;_0x391c05['remoteUri']=intUtil['stripTrailingSlash'](_0x391c05['remoteUri']);_0x391c05[_0xea0e('0x47')]=intUtil[_0xea0e('0x48')](_0x391c05[_0xea0e('0x47')]);if(_0x304a68&&_0x304a68[_0xea0e('0x49')]){logger[_0xea0e('0xa')]('['+_0x4db9a1[_0xea0e('0x6a')][_0xea0e('0x6b')]()+']',_0xea0e('0x4b'));_0x4db9a1['recordingURL']=util[_0xea0e('0xc')](_0xea0e('0x4d'),_0x391c05['serverUrl'],_0x4db9a1[_0xea0e('0x4e')],md5(_0x4db9a1[_0xea0e('0x4e')]));}else{_0x4db9a1['recordingURL']='';}headers[_0xea0e('0x4f')]=getAuth(_0x391c05);return getUser(_0x391c05)[_0xea0e('0x14')](function(_0x533660){_0x1e2522=_0x533660;logger[_0xea0e('0xa')](_0xea0e('0x64'),_0x1e2522['id']);return getEndUser(_0x391c05,_0x4db9a1[_0xea0e('0x51')],_0x4db9a1[_0xea0e('0x6c')]);})[_0xea0e('0x14')](function(_0xb26e61){_0xa9d50f=_0xb26e61;logger[_0xea0e('0xa')](_0xea0e('0x67'),_0xa9d50f['id']);return getTicket(_0x391c05,_0x1e2522,_0xa9d50f,_0x1121d3,_0x4db9a1);})[_0xea0e('0x14')](function(_0x1659cf){if(_0x1659cf){logger[_0xea0e('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1659cf['id']);}})[_0xea0e('0x5e')](function(_0x8c30b7){logger[_0xea0e('0x5c')]('['+_0x4db9a1[_0xea0e('0x6a')][_0xea0e('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x8c30b7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x225c=['zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','%s/users.json','Enduser\x20created.','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','customField','queue','serverUrl','stripTrailingSlash','monitor_format','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','./util','../../../../config/environment','../../../../config/logger'];(function(_0x180fcb,_0x208b94){var _0x515f0d=function(_0x1be895){while(--_0x1be895){_0x180fcb['push'](_0x180fcb['shift']());}};_0x515f0d(++_0x208b94);}(_0x225c,0xd9));var _0xc225=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x225c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc225('0x0'));var rp=require('request-promise');var md5=require(_0xc225('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xc225('0x2'));var config=require(_0xc225('0x3'));var logger=require(_0xc225('0x4'))(_0xc225('0x5'));config[_0xc225('0x6')]=_[_0xc225('0x7')](config[_0xc225('0x6')],{'host':_0xc225('0x8'),'port':0x18eb});var io=require(_0xc225('0x9'))(new Redis(config[_0xc225('0x6')]));function emit(_0x3d9066,_0x46cd8d,_0x153366){io['to'](_0x3d9066)[_0xc225('0xa')](_0x46cd8d,_0x153366);}var headers={'Content-Type':_0xc225('0xb'),'Accept':'application/json'};function getTicket(_0x4d4e85,_0x1a7410,_0x24d53b,_0x3ea9e3,_0x251ce0){logger[_0xc225('0xc')](_0xc225('0xd'));return request({'uri':util['format'](_0xc225('0xe'),_0x4d4e85[_0xc225('0xf')]),'method':_0xc225('0x10'),'body':{'ticket':_[_0xc225('0x11')]({'requester_id':_0x24d53b['id'],'submitter_id':_0x1a7410?_0x1a7410['id']:undefined,'assignee_id':_0x1a7410?_0x1a7410['id']:undefined,'tags':getTags(_0x3ea9e3[_0xc225('0x12')],'name'),'subject':intUtil[_0xc225('0x13')](_0x3ea9e3[_0xc225('0x14')],_0x251ce0,'\x20'),'description':intUtil[_0xc225('0x13')](_0x3ea9e3[_0xc225('0x15')],_0x251ce0,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc225('0x13')](_0x3ea9e3[_0xc225('0x15')],_0x251ce0,'\x0a')}},getCustomFields(_0x3ea9e3[_0xc225('0x16')],_0x251ce0))}})[_0xc225('0x17')](function(_0x468753){logger[_0xc225('0xc')](_0xc225('0x18'));return _0x468753['ticket'];});}function getUser(_0x131a94,_0x3dcef6){if(intUtil[_0xc225('0x19')](_0x3dcef6)){logger[_0xc225('0xc')](_0xc225('0x1a'),_0x3dcef6);return request({'uri':util[_0xc225('0x1b')](_0xc225('0x1c'),_0x131a94['remoteUri']),'qs':{'query':util[_0xc225('0x1b')](_0xc225('0x1d'),_0x3dcef6)}})[_0xc225('0x17')](function(_0x41e58d){if(_0x41e58d[_0xc225('0x1e')]){logger[_0xc225('0xc')]('Agent\x20found!');return _[_0xc225('0x1f')](_0x41e58d[_0xc225('0x20')],{'email':_0x3dcef6,'role':'agent'});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x131a94['remoteUri'])})['then'](function(_0x588d89){logger['info'](_0xc225('0x21'));return _0x588d89[_0xc225('0x22')];});}});}else{logger[_0xc225('0xc')](_0xc225('0x23'));return request({'uri':util[_0xc225('0x1b')](_0xc225('0x24'),_0x131a94['remoteUri'])})[_0xc225('0x17')](function(_0x257d44){logger['info'](_0xc225('0x21'));return _0x257d44[_0xc225('0x22')];});}}function getEndUser(_0x291f3a,_0x54068e,_0x339f52){logger[_0xc225('0xc')]('Searching\x20enduser\x20with\x20phone',_0x339f52);return request({'uri':util[_0xc225('0x1b')](_0xc225('0x1c'),_0x291f3a[_0xc225('0xf')]),'qs':{'query':util[_0xc225('0x1b')](_0xc225('0x25'),_0x339f52)}})[_0xc225('0x17')](function(_0x148e88){var _0x1ea1cb;if(_0x148e88['results'][_0xc225('0x26')]){_0x148e88['results']=_[_0xc225('0x27')](_0x148e88[_0xc225('0x20')],{'suspended':![],'role':_0xc225('0x28')});if(_0x148e88[_0xc225('0x20')]['length']){_0x1ea1cb=_[_0xc225('0x29')](_0x148e88['results']);}}if(_0x1ea1cb){logger[_0xc225('0xc')]('Enduser\x20found!');return _0x1ea1cb;}else{logger[_0xc225('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xc225('0x2a'),_0x291f3a[_0xc225('0xf')]),'method':'POST','body':{'user':{'role':_0xc225('0x28'),'name':util[_0xc225('0x1b')]('Caller\x20-\x20%s',_0x54068e||_0x339f52),'phone':_0x339f52}}})[_0xc225('0x17')](function(_0x39c832){logger[_0xc225('0xc')](_0xc225('0x2b'));return _0x39c832[_0xc225('0x22')];});}});}function getAuth(_0x14e0ee){var _0x2bb05e;if(_0x14e0ee['authType']===_0xc225('0x2c')){_0x2bb05e=util[_0xc225('0x1b')](_0xc225('0x2d'),_0x14e0ee[_0xc225('0x2e')],_0x14e0ee['password']);}else if(_0x14e0ee['authType']===_0xc225('0x2f')){_0x2bb05e=util[_0xc225('0x1b')](_0xc225('0x30'),_0x14e0ee[_0xc225('0x2e')],_0x14e0ee[_0xc225('0x2f')]);}return util[_0xc225('0x1b')](_0xc225('0x31'),new Buffer(_0x2bb05e)[_0xc225('0x32')]('base64'));}function request(_0x31698a){logger[_0xc225('0x33')](_0xc225('0x34'),JSON['stringify'](_0x31698a));return rp(_[_0xc225('0x7')](_0x31698a,{'method':_0xc225('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x9793ba,_0x557d10){var _0x1d4637=[];if(_0x9793ba&&_0x9793ba[_0xc225('0x26')]>0x0){_0x1d4637=_[_0xc225('0x36')](_0x9793ba,_0x557d10);}return _0x1d4637;}function getCustomFields(_0x4b372e,_0x7462e9){var _0x2bda9f=[];var _0x50eba6={'custom_fields':[]};if(_0x4b372e[_0xc225('0x26')]>0x0){_[_0xc225('0x37')](_0x4b372e,function(_0x2517c7){if(_[_0xc225('0x38')]([_0xc225('0x39'),_0xc225('0x3a')],_0x2517c7[_0xc225('0x3b')])&&_0x2517c7[_0xc225('0x3c')]&&!_0x2517c7['customField']){_0x50eba6[_0x2517c7['nameField'][_0xc225('0x3d')]()]=_0x2517c7[_0xc225('0x3e')]['toString']();}else if(_['includes']([_0xc225('0x39'),_0xc225('0x3a')],_0x2517c7['type'])&&_0x2517c7[_0xc225('0x3f')]&&_0x2517c7['customField']){_0x50eba6[_0xc225('0x40')][_0xc225('0x41')]({'id':_0x2517c7['idField'],'value':_0x2517c7[_0xc225('0x3e')]['toString']()});}else if(_0x2517c7['type']===_0xc225('0x42')&&_0x2517c7[_0xc225('0x43')]&&_0x2517c7[_0xc225('0x3f')]&&_0x2517c7['customField']){_0x7462e9[_0x2517c7[_0xc225('0x43')]]&&_0x50eba6[_0xc225('0x40')][_0xc225('0x41')]({'id':_0x2517c7['idField'],'value':_0x7462e9[_0x2517c7[_0xc225('0x43')]][_0xc225('0x32')]()});}else if(_0x2517c7['type']===_0xc225('0x44')&&_0x2517c7['Variable']&&_0x2517c7[_0xc225('0x45')][_0xc225('0x46')]&&_0x2517c7['idField']&&_0x2517c7[_0xc225('0x47')]){_0x7462e9[_0x2517c7[_0xc225('0x45')][_0xc225('0x46')][_0xc225('0x3d')]()]&&_0x50eba6[_0xc225('0x40')][_0xc225('0x41')]({'id':_0x2517c7[_0xc225('0x3f')],'value':_0x7462e9[_0x2517c7[_0xc225('0x45')][_0xc225('0x46')][_0xc225('0x3d')]()][_0xc225('0x32')]()});}});}return _0x50eba6;}exports[_0xc225('0x48')]=function(_0x1b0cc6,_0x44ce60,_0x5f2356,_0xc65b7c,_0x30785a,_0x1f7202){var _0x584f99,_0x8534df;_0x1f7202[_0xc225('0xf')]=intUtil['stripTrailingSlash'](_0x1f7202[_0xc225('0xf')]);_0x1f7202[_0xc225('0x49')]=intUtil[_0xc225('0x4a')](_0x1f7202[_0xc225('0x49')]);if(_0x30785a&&_0x30785a[_0xc225('0x4b')]){logger[_0xc225('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x44ce60[_0xc225('0x4c')]=util[_0xc225('0x1b')](_0xc225('0x4d'),_0x1f7202[_0xc225('0x49')],_0x44ce60[_0xc225('0x4e')],md5(_0x44ce60[_0xc225('0x4e')]));}else{_0x44ce60[_0xc225('0x4c')]='';}headers[_0xc225('0x4f')]=getAuth(_0x1f7202);return getUser(_0x1f7202,_0xc65b7c[_0xc225('0x50')])[_0xc225('0x17')](function(_0x42d338){_0x584f99=_0x42d338;logger[_0xc225('0xc')](_0xc225('0x51'),_0x584f99['id']);return getEndUser(_0x1f7202,_0x44ce60[_0xc225('0x52')],_0x44ce60[_0xc225('0x53')]);})[_0xc225('0x17')](function(_0x2253fd){_0x8534df=_0x2253fd;logger[_0xc225('0xc')](_0xc225('0x54'),_0x8534df['id']);return getTicket(_0x1f7202,_0x584f99,_0x8534df,_0x5f2356,_0x44ce60);})[_0xc225('0x17')](function(_0x288bdd){if(_0x288bdd){logger['info'](_0xc225('0x55'),_0x288bdd['id']);switch(_0x1f7202[_0xc225('0x3b')]){case _0xc225('0x56'):logger[_0xc225('0xc')](_0xc225('0x57'),_0xc225('0x58'));return request({'uri':util['format'](_0xc225('0x59'),_0x1f7202['remoteUri'],_0x584f99['id'],_0x288bdd['id']),'method':_0xc225('0x10')});case _0xc225('0x5a'):logger['info'](_0xc225('0x57'),_0xc225('0x5b'));emit(util[_0xc225('0x1b')](_0xc225('0x5c'),_0xc65b7c[_0xc225('0x46')]),_0xc225('0x5d'),{'uri':util['format']('%s/agent/tickets/%s',_0x1f7202[_0xc225('0xf')][_0xc225('0x5e')](_0xc225('0x5f'),''),_0x288bdd['id'])});break;default:logger['error'](_0xc225('0x57'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc225('0x60')](function(_0x3e8c26){logger[_0xc225('0x61')](_0xc225('0x62'),util[_0xc225('0x63')](_0x3e8c26,{'showHidden':!![],'depth':null}));});};exports[_0xc225('0x64')]=function(_0x4965dd,_0x2eea3a,_0x24ba5f,_0x19b4a3,_0x1ba125,_0x22aaa8,_0x4b7a6e){var _0xdb9df,_0x1b16e1;_0x22aaa8[_0xc225('0xf')]=intUtil[_0xc225('0x4a')](_0x22aaa8['remoteUri']);_0x22aaa8[_0xc225('0x49')]=intUtil[_0xc225('0x4a')](_0x22aaa8[_0xc225('0x49')]);if(_0x4b7a6e&&_0x4b7a6e['recordingFormat']&&_0x4b7a6e['recordingFormat']!==_0xc225('0x65')){logger['info'](_0xc225('0x66'),_0xc225('0x67'));_0x2eea3a[_0xc225('0x4c')]=util[_0xc225('0x1b')](_0xc225('0x4d'),_0x22aaa8[_0xc225('0x49')],_0x2eea3a['uniqueid'],md5(_0x2eea3a[_0xc225('0x4e')]));}headers[_0xc225('0x4f')]=getAuth(_0x22aaa8);return getUser(_0x22aaa8,_0x19b4a3[_0xc225('0x50')])[_0xc225('0x17')](function(_0x5938eb){_0xdb9df=_0x5938eb;logger['info'](_0xc225('0x51'),_0xdb9df['id']);return getEndUser(_0x22aaa8,_0x2eea3a[_0xc225('0x68')],_0x2eea3a[_0xc225('0x69')]);})[_0xc225('0x17')](function(_0x55bc26){_0x1b16e1=_0x55bc26;logger[_0xc225('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1b16e1['id']);return getTicket(_0x22aaa8,_0xdb9df,_0x1b16e1,_0x24ba5f,_0x2eea3a);})[_0xc225('0x17')](function(_0x17aa2d){if(_0x17aa2d){logger[_0xc225('0xc')](_0xc225('0x55'),_0x17aa2d['id']);switch(_0x22aaa8['type']){case _0xc225('0x56'):logger[_0xc225('0xc')]('[OUTBOUND]',_0xc225('0x58'));return request({'uri':util[_0xc225('0x1b')](_0xc225('0x59'),_0x22aaa8[_0xc225('0xf')],_0xdb9df['id'],_0x17aa2d['id']),'method':_0xc225('0x10')});case _0xc225('0x5a'):logger[_0xc225('0xc')](_0xc225('0x66'),_0xc225('0x5b'));emit(util[_0xc225('0x1b')](_0xc225('0x5c'),_0x19b4a3[_0xc225('0x46')]),_0xc225('0x5d'),{'uri':util['format']('%s/agent/tickets/%s',_0x22aaa8[_0xc225('0xf')][_0xc225('0x5e')](_0xc225('0x5f'),''),_0x17aa2d['id'])});break;default:logger[_0xc225('0x61')](_0xc225('0x66'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xc225('0x60')](function(_0xd711b6){logger[_0xc225('0x61')](_0xc225('0x6a'),util[_0xc225('0x63')](_0xd711b6,{'showHidden':!![],'depth':null}));});};exports[_0xc225('0x6b')]=function(_0x273cdd,_0x21a6e4,_0x4c7384,_0x188cb9,_0x3ddef3,_0x1882e4){var _0x2c506a,_0x282c79;_0x1882e4['remoteUri']=intUtil['stripTrailingSlash'](_0x1882e4[_0xc225('0xf')]);_0x1882e4[_0xc225('0x49')]=intUtil[_0xc225('0x4a')](_0x1882e4['serverUrl']);if(_0x3ddef3&&_0x3ddef3['monitor_format']){logger[_0xc225('0xc')]('['+_0x21a6e4[_0xc225('0x6c')][_0xc225('0x6d')]()+']',_0xc225('0x67'));_0x21a6e4[_0xc225('0x4c')]=util[_0xc225('0x1b')](_0xc225('0x4d'),_0x1882e4['serverUrl'],_0x21a6e4['uniqueid'],md5(_0x21a6e4[_0xc225('0x4e')]));}else{_0x21a6e4[_0xc225('0x4c')]='';}headers[_0xc225('0x4f')]=getAuth(_0x1882e4);return getUser(_0x1882e4)[_0xc225('0x17')](function(_0x4580ff){_0x2c506a=_0x4580ff;logger[_0xc225('0xc')]('The\x20User\x20ID\x20is:',_0x2c506a['id']);return getEndUser(_0x1882e4,_0x21a6e4[_0xc225('0x52')],_0x21a6e4[_0xc225('0x53')]);})['then'](function(_0x593e38){_0x282c79=_0x593e38;logger[_0xc225('0xc')](_0xc225('0x54'),_0x282c79['id']);return getTicket(_0x1882e4,_0x2c506a,_0x282c79,_0x4c7384,_0x21a6e4);})[_0xc225('0x17')](function(_0xa6e917){if(_0xa6e917){logger['info'](_0xc225('0x55'),_0xa6e917['id']);}})[_0xc225('0x60')](function(_0x123e40){logger[_0xc225('0x61')]('['+_0x21a6e4[_0xc225('0x6c')][_0xc225('0x6d')]()+']'+_0xc225('0x6e'),util[_0xc225('0x63')](_0x123e40,{'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 c8b2f2b..efa8926 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 _0x3b43=['refresh_token','then','add','catch','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','details','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','moduleCreate','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','Leads','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','zoho','defaults','localhost','socket.io-emitter','redis','emit','[HTTP]','stringify','forEach','string','picklist','type','idField','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret'];(function(_0x56ac6c,_0x472c9b){var _0x4fb5ec=function(_0x1ce461){while(--_0x1ce461){_0x56ac6c['push'](_0x56ac6c['shift']());}};_0x4fb5ec(++_0x472c9b);}(_0x3b43,0x71));var _0x33b4=function(_0x2c7813,_0x3bcad3){_0x2c7813=_0x2c7813-0x0;var _0x4e23a9=_0x3b43[_0x2c7813];return _0x4e23a9;};'use strict';var _=require(_0x33b4('0x0'));var rp=require(_0x33b4('0x1'));var md5=require(_0x33b4('0x2'));var util=require(_0x33b4('0x3'));var intUtil=require(_0x33b4('0x4'));var moment=require(_0x33b4('0x5'));var Redis=require('ioredis');var BPromise=require(_0x33b4('0x6'));var config=require(_0x33b4('0x7'));var logger=require('../../../../config/logger')(_0x33b4('0x8'));config['redis']=_[_0x33b4('0x9')](config['redis'],{'host':_0x33b4('0xa'),'port':0x18eb});var io=require(_0x33b4('0xb'))(new Redis(config[_0x33b4('0xc')]));function emit(_0x2ca486,_0x15f06e,_0x1e616b){io['to'](_0x2ca486)[_0x33b4('0xd')](_0x15f06e,_0x1e616b);}function request(_0x3b743e){logger['debug'](_0x33b4('0xe'),JSON[_0x33b4('0xf')](_0x3b743e));return rp(_0x3b743e);}function getCustomFields(_0x11105d,_0x6b05ae){var _0x5568cc={};if(_0x11105d['length']>0x0){_[_0x33b4('0x10')](_0x11105d,function(_0x4ed59b){if(_['includes']([_0x33b4('0x11'),_0x33b4('0x12')],_0x4ed59b[_0x33b4('0x13')])&&_0x4ed59b[_0x33b4('0x14')]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x4ed59b['content']['toString']();}else if(_0x4ed59b[_0x33b4('0x13')]===_0x33b4('0x15')&&_0x4ed59b['variableName']&&_0x4ed59b[_0x33b4('0x14')]&&_0x6b05ae[_0x4ed59b[_0x33b4('0x16')]]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x6b05ae[_0x4ed59b['variableName']][_0x33b4('0x17')]();}else if(_0x4ed59b['type']==='customVariable'&&_0x4ed59b[_0x33b4('0x18')]&&_0x4ed59b[_0x33b4('0x18')]['name']&&_0x4ed59b[_0x33b4('0x14')]&&_0x6b05ae[_0x4ed59b['Variable'][_0x33b4('0x19')][_0x33b4('0x1a')]()]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x6b05ae[_0x4ed59b[_0x33b4('0x18')][_0x33b4('0x19')][_0x33b4('0x1a')]()][_0x33b4('0x17')]();}});}return _0x5568cc;}function getName(_0x1b356f){if(_0x1b356f[_0x33b4('0x1b')]('\x20')>0x0){var _0x3142b3=_0x1b356f[_0x33b4('0x1c')](/ (.+)/);if(_0x3142b3[0x1]){return _0x3142b3;}}return[_0x1b356f,_0x1b356f];}var accountsTokens={};function getAccessToken(_0x49220b){return new Promise(function(_0x24df08,_0x248949){if(!_[_0x33b4('0x1d')](accountsTokens[_0x49220b['id']])&&!_['isNil'](accountsTokens[_0x49220b['id']][_0x33b4('0x1e')])){if(moment()[_0x33b4('0x1f')](accountsTokens[_0x49220b['id']][_0x33b4('0x20')])){_0x24df08(accountsTokens[_0x49220b['id']]['access_token']);}}var _0x22c2d2;switch(_0x49220b['zone']){case'US':_0x22c2d2=_0x33b4('0x21');break;case'AU':_0x22c2d2=_0x33b4('0x22');break;case'EU':_0x22c2d2=_0x33b4('0x23');break;case'IN':_0x22c2d2=_0x33b4('0x24');break;case'CN':_0x22c2d2='https://accounts.zoho.com.cn';break;default:_0x22c2d2=_0x33b4('0x23');break;}var _0x1a005c={'method':_0x33b4('0x25'),'uri':_0x22c2d2+'/oauth/v2/token','qs':{'refresh_token':_0x49220b[_0x33b4('0x26')],'client_id':_0x49220b[_0x33b4('0x27')],'client_secret':_0x49220b[_0x33b4('0x28')],'grant_type':_0x33b4('0x29')},'json':!![]};return rp(_0x1a005c)[_0x33b4('0x2a')](function(_0x33bff0){accountsTokens[_0x49220b['id']]={'access_token':_0x33bff0[_0x33b4('0x1e')],'expires_in':moment()[_0x33b4('0x2b')](_0x33bff0[_0x33b4('0x20')],'seconds')};_0x24df08(_0x33bff0[_0x33b4('0x1e')]);})[_0x33b4('0x2c')](function(_0x1ab3d4){logger['error']('Failing\x20creating\x20the\x20access_token',_0x1ab3d4['stack']);_0x248949(_0x1ab3d4);});});}function getUser(_0x3e0b8e,_0xf1e1c6,_0x1ebb5e,_0x560437){logger['info'](_0x33b4('0x2d'));return request({'method':_0x33b4('0x2e'),'uri':util[_0x33b4('0x2f')](_0x33b4('0x30'),_0xf1e1c6),'qs':{'type':_0x33b4('0x31')},'headers':{'Authorization':_0x33b4('0x32')+_0x3e0b8e},'json':!![]})['then'](function(_0x3f4e10){if(_0x3f4e10['users']){var _0x110e56=-0x1;if(_[_0x33b4('0x33')](_0x3f4e10['users'])){if(!_[_0x33b4('0x1d')](_0x560437)){_0x110e56=_[_0x33b4('0x34')](_0x3f4e10[_0x33b4('0x35')],function(_0x81146e){return _0x81146e['email']===_0x560437;});}if(_0x110e56>=0x0){logger[_0x33b4('0x36')](_0x33b4('0x37'));}else{logger[_0x33b4('0x36')](_0x33b4('0x38'));_0x110e56=_[_0x33b4('0x34')](_0x3f4e10[_0x33b4('0x35')],function(_0x42daf7){return _0x42daf7[_0x33b4('0x39')][_0x33b4('0x19')]===_0x33b4('0x3a');});}return _0x3f4e10[_0x33b4('0x35')][_0x110e56];}else{if(_0x3f4e10[_0x33b4('0x3b')][_0x33b4('0x39')][_0x33b4('0x19')]==='Administrator'){logger[_0x33b4('0x36')]('Using\x20the\x20admin\x20account!');user=_0x3f4e10[_0x33b4('0x3b')];return user;}else{logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON['stringify'](_0x3f4e10));throw new Error(_0x33b4('0x3e')+JSON[_0x33b4('0xf')](_0x3f4e10));}}}else{logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON[_0x33b4('0xf')](_0x3f4e10));throw new Error(_0x33b4('0x3e')+JSON['stringify'](_0x3f4e10));}})[_0x33b4('0x2c')](function(_0x36d96a){console[_0x33b4('0x3c')](_0x36d96a);});}function getZohoUser(_0x5dad76,_0x17c78){return new BPromise(function(_0x13143b,_0x29e4d1){request(_0x5dad76)['then'](function(_0x564a9f){var _0x332733=null;if(_0x564a9f){_0x332733=_0x564a9f[_0x33b4('0x3f')][0x0];_0x332733['enduserType']=_0x17c78;}_0x13143b(_0x332733);})[_0x33b4('0x2c')](function(_0x3700b8){_0x29e4d1(_0x3700b8);});});}function createEndUser(_0x2bef15,_0x373c61,_0x3d77c9,_0x3e13ef,_0x318584,_0x48d77f){var _0x3d77c9=getName(_0x3d77c9);return request({'method':_0x33b4('0x25'),'uri':_0x33b4('0x40')+_0x373c61+_0x33b4('0x41')+_[_0x33b4('0x42')](_0x48d77f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3d77c9[0x1],'First_Name':_0x3d77c9[0x0],'Phone':_0x3e13ef,'Owner':{'name':!_[_0x33b4('0x1d')](_0x318584[_0x33b4('0x43')]['name'])?_0x318584[_0x33b4('0x43')][_0x33b4('0x19')]:!_[_0x33b4('0x1d')](_0x318584[_0x33b4('0x44')])?_0x318584[_0x33b4('0x44')]+'\x20'+_0x318584[_0x33b4('0x45')]:_0x318584[_0x33b4('0x45')],'id':_0x318584['id']}}]},'headers':{'Authorization':_0x33b4('0x32')+_0x2bef15},'json':!![]})['then'](function(_0x3b5122){if(_0x3b5122&&_0x3b5122[_0x33b4('0x3f')][0x0][_0x33b4('0x46')]==='SUCCESS'){var _0x1bab1f=_0x3b5122[_0x33b4('0x3f')][0x0][_0x33b4('0x47')];_0x1bab1f['enduserType']=_[_0x33b4('0x42')](_0x48d77f['moduleCreate'])+'s';return _0x1bab1f;}logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON['stringify'](data));throw new Error(_0x33b4('0x48')+JSON[_0x33b4('0xf')](data));})['catch'](function(_0x555cf8){console[_0x33b4('0x49')]('CREATE\x20ERROR',_0x555cf8);});}function getEndUser(_0x806980,_0x32855a,_0x497a5a,_0x335674,_0x2126da,_0x547707,_0x36d913){var _0xa18ca6={'method':'GET','uri':'','headers':{'Authorization':_0x33b4('0x32')+_0x806980},'json':!![]};switch(_0x36d913[_0x33b4('0x4a')]){case'contact_lead':_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+_0x33b4('0x4c')+_0x2126da+'))';return getZohoUser(_0xa18ca6,_0x33b4('0x4d'))[_0x33b4('0x2a')](function(_0x24394a){if(_0x24394a)return _0x24394a;_0xa18ca6[_0x33b4('0x4b')]=_0x33b4('0x40')+_0x32855a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2126da+'))';return getZohoUser(_0xa18ca6,'Leads')['then'](function(_0x2c68f7){if(_0x2c68f7)return _0x2c68f7;if(_0x36d913[_0x33b4('0x4e')]!=_0x33b4('0x4f')){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});});break;case _0x33b4('0x50'):_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2126da+'))';return getZohoUser(_0xa18ca6,_0x33b4('0x4d'))['then'](function(_0x5bf802){if(_0x5bf802)return _0x5bf802;if(_0x36d913[_0x33b4('0x4e')]!='nothing'){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});break;case _0x33b4('0x51'):_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+_0x33b4('0x52')+_0x2126da+'))';return getZohoUser(_0xa18ca6,'Leads')[_0x33b4('0x2a')](function(_0x1016aa){if(_0x1016aa)return _0x1016aa;if(_0x36d913['moduleCreate']!='nothing'){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});break;}}function getCall(_0x555894,_0x40f90a,_0x55b7fd,_0x47d190,_0x28d7c0,_0x18c35f,_0x1c3a09,_0x6483cc){logger[_0x33b4('0x36')](_0x33b4('0x53'));var _0x47e9f1={};_0x47e9f1[_0x33b4('0x54')]={'name':!_['isNil'](_0x47d190[_0x33b4('0x43')][_0x33b4('0x19')])&&!_['isNil'](_0x47d190[_0x33b4('0x39')][_0x33b4('0x19')])&&_0x47d190[_0x33b4('0x39')][_0x33b4('0x19')]===_0x33b4('0x55')?_0x47d190[_0x33b4('0x43')]['name']:!_['isNil'](_0x47d190['first_name'])?_0x47d190[_0x33b4('0x44')]+'\x20'+_0x47d190[_0x33b4('0x45')]:_0x47d190[_0x33b4('0x45')],'id':_0x47d190['id']};_0x47e9f1['Subject']=intUtil[_0x33b4('0x56')](_0x18c35f[_0x33b4('0x57')],_0x1c3a09,'\x20');_0x47e9f1[_0x33b4('0x58')]=intUtil[_0x33b4('0x56')](_0x18c35f[_0x33b4('0x59')],_0x1c3a09,'\x0a');if(_0x28d7c0[_0x33b4('0x5a')]===_0x33b4('0x4d')){_0x47e9f1[_0x33b4('0x5b')]={'name':!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5c')])?_0x28d7c0['Full_Name']:!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5d')])?_0x28d7c0[_0x33b4('0x5d')]+'\x20'+_0x28d7c0[_0x33b4('0x5e')]:_0x28d7c0[_0x33b4('0x5e')],'id':_0x28d7c0['id']};}if(_0x28d7c0['enduserType']===_0x33b4('0x5f')){_0x47e9f1['What_Id']={'name':!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5c')])?_0x28d7c0['Full_Name']:!_['isNil'](_0x28d7c0[_0x33b4('0x5d')])?_0x28d7c0[_0x33b4('0x5d')]+'\x20'+_0x28d7c0[_0x33b4('0x5e')]:_0x28d7c0['Last_Name'],'id':_0x28d7c0['id']};_0x47e9f1[_0x33b4('0x60')]=_[_0x33b4('0x42')](_0x28d7c0[_0x33b4('0x5a')]);}if(_0x1c3a09['talktime']){_0x47e9f1[_0x33b4('0x61')]=moment[_0x33b4('0x62')](parseInt(_0x1c3a09[_0x33b4('0x63')])*0x3e8)['format'](_0x33b4('0x64'));}else if(_0x1c3a09[_0x33b4('0x65')]&&_0x1c3a09[_0x33b4('0x66')]){_0x47e9f1[_0x33b4('0x61')]=moment[_0x33b4('0x62')](moment(_0x1c3a09[_0x33b4('0x66')],_0x33b4('0x67'))[_0x33b4('0x68')](moment(_0x1c3a09[_0x33b4('0x69')],_0x33b4('0x67'))))[_0x33b4('0x2f')](_0x33b4('0x64'));}switch(_0x1c3a09['lastevent']){case _0x33b4('0x6a'):_0x47e9f1[_0x33b4('0x6b')]='Called';break;case'complete':case'connect':_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x6c');break;case _0x33b4('0x6d'):_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x6e');break;case _0x33b4('0x6f'):_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x70');break;case'timeout':_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x71');default:}_0x47e9f1[_0x33b4('0x72')]=(_0x6483cc===_0x33b4('0x73')?moment(_0x1c3a09[_0x33b4('0x69')])[_0x33b4('0x2f')](_0x33b4('0x67')):moment(_0x1c3a09['agentcalledAt'])['format'](_0x33b4('0x67')))||moment()[_0x33b4('0x2f')](_0x33b4('0x67'));_0x47e9f1[_0x33b4('0x74')]=_0x6483cc||_0x33b4('0x75');_0x47e9f1=_['merge'](_0x47e9f1,getCustomFields(_0x18c35f[_0x33b4('0x76')],_0x1c3a09));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x40f90a+_0x33b4('0x77'),'headers':{'Authorization':_0x33b4('0x32')+_0x555894},'body':{'data':[_0x47e9f1]},'json':!![]})['then'](function(_0x48864d){if(_0x48864d&&_0x48864d[_0x33b4('0x3f')][0x0][_0x33b4('0x46')]===_0x33b4('0x78')){logger[_0x33b4('0x36')](_0x33b4('0x79'));return{'id':_0x48864d[_0x33b4('0x3f')][0x0][_0x33b4('0x47')]['id']};}})['catch'](function(_0x5e423a){logger['info'](_0x33b4('0x7a'),_0x5e423a[_0x33b4('0x7b')]);console[_0x33b4('0x49')](_0x33b4('0x7a'),_0x5e423a);});}exports[_0x33b4('0x7c')]=function(_0x107023,_0xa46eef,_0x309d6a,_0x103c92,_0x2f964e,_0x3829b1){var _0x1350f9,_0x7dbf50,_0x2445d7;_0x3829b1[_0x33b4('0x7d')]=intUtil[_0x33b4('0x7e')](_0x3829b1[_0x33b4('0x7d')]);_0x3829b1[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x3829b1[_0x33b4('0x7f')]);if(_0x2f964e&&_0x2f964e[_0x33b4('0x80')]){logger[_0x33b4('0x36')](_0x33b4('0x81'),_0x33b4('0x82'));_0xa46eef[_0x33b4('0x83')]=_0x3829b1[_0x33b4('0x7f')]+_0x33b4('0x84')+_0xa46eef['uniqueid']+_0x33b4('0x85')+md5(_0xa46eef[_0x33b4('0x86')]);}else{_0xa46eef[_0x33b4('0x83')]='';}var _0x2b8fbf=_0x3829b1[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x3829b1)[_0x33b4('0x2a')](function(_0x446116){_0x2445d7=_0x446116;return getUser(_0x2445d7,_0x2b8fbf,_0x3829b1,_0x103c92[_0x33b4('0x89')]);})[_0x33b4('0x2a')](function(_0x4d9fdc){_0x1350f9=_0x4d9fdc;logger[_0x33b4('0x36')]('The\x20User\x20ID\x20is:',_0x1350f9['id']);return getEndUser(_0x2445d7,_0x2b8fbf,_0x3829b1,_0xa46eef[_0x33b4('0x8a')],_0xa46eef['calleridnum'],_0x1350f9,_0x309d6a);})[_0x33b4('0x2a')](function(_0x579e6b){_0x7dbf50=_0x579e6b;return getCall(_0x2445d7,_0x2b8fbf,_0x3829b1,_0x1350f9,_0x7dbf50,_0x309d6a,_0xa46eef,'Inbound');})['then'](function(_0x1844cd){if(_0x1844cd){logger[_0x33b4('0x36')](_0x33b4('0x8b'),_0x1844cd['id']);logger[_0x33b4('0x36')](_0x33b4('0x81'),_0x33b4('0x8c'));emit(util[_0x33b4('0x2f')](_0x33b4('0x8d'),_0x103c92[_0x33b4('0x19')]),'trigger:browser:url',{'uri':_0x33b4('0x8e')+_0x3829b1[_0x33b4('0x7d')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1844cd['id']});}})['catch'](function(_0x5cb308){logger[_0x33b4('0x3c')](_0x33b4('0x81'),JSON[_0x33b4('0xf')](_0x5cb308));});};exports['outbound']=function(_0x58f877,_0x32c6fd,_0x2fbc68,_0x548d94,_0x20faa3,_0x10a2d0,_0x59213b){var _0x20bce6,_0x6758b8,_0x4087ba;_0x10a2d0['host']=intUtil[_0x33b4('0x7e')](_0x10a2d0[_0x33b4('0x7d')]);_0x10a2d0[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x10a2d0['serverUrl']);if(_0x59213b&&_0x59213b[_0x33b4('0x8f')]&&_0x59213b[_0x33b4('0x8f')]!=='none'){logger[_0x33b4('0x36')]('[OUTBOUND]',_0x33b4('0x82'));_0x32c6fd[_0x33b4('0x83')]=_0x10a2d0[_0x33b4('0x7f')]+_0x33b4('0x84')+_0x32c6fd[_0x33b4('0x86')]+_0x33b4('0x85')+md5(_0x32c6fd['uniqueid']);}var _0x3bd1c0=_0x10a2d0[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x10a2d0)[_0x33b4('0x2a')](function(_0x457e78){_0x4087ba=_0x457e78;return getUser(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x548d94[_0x33b4('0x89')]);})[_0x33b4('0x2a')](function(_0x21dc5d){_0x20bce6=_0x21dc5d;logger[_0x33b4('0x36')]('The\x20User\x20ID\x20is:',_0x20bce6['id']);return getEndUser(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x32c6fd[_0x33b4('0x90')],_0x32c6fd[_0x33b4('0x91')],_0x20bce6,_0x2fbc68);})[_0x33b4('0x2a')](function(_0x31c0bb){_0x6758b8=_0x31c0bb;return getCall(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x20bce6,_0x6758b8,_0x2fbc68,_0x32c6fd,_0x33b4('0x92'));})[_0x33b4('0x2a')](function(_0x53fd4f){if(_0x53fd4f){logger[_0x33b4('0x36')](_0x33b4('0x8b'),_0x53fd4f['id']);logger['info'](_0x33b4('0x93'),_0x33b4('0x8c'));emit(util[_0x33b4('0x2f')]('user:%s',_0x548d94[_0x33b4('0x19')]),_0x33b4('0x94'),{'uri':_0x33b4('0x8e')+_0x10a2d0['host']+_0x33b4('0x95')+_0x53fd4f['id']});}})['catch'](function(_0xf2a49e){logger[_0x33b4('0x3c')](_0x33b4('0x93'),JSON['stringify'](_0xf2a49e));});};exports['unmanaged']=function(_0x8ed985,_0x1af8cf,_0x466551,_0x1be726,_0xad391f,_0x4a9a99){var _0xcd1eed,_0x294250,_0xfb4cc6;_0x4a9a99[_0x33b4('0x7d')]=intUtil[_0x33b4('0x7e')](_0x4a9a99[_0x33b4('0x7d')]);_0x4a9a99[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x4a9a99[_0x33b4('0x7f')]);if(_0xad391f&&_0xad391f['monitor_format']){logger[_0x33b4('0x36')]('['+_0x1af8cf[_0x33b4('0x96')][_0x33b4('0x97')]()+']',_0x33b4('0x82'));_0x1af8cf[_0x33b4('0x83')]=_0x4a9a99['serverUrl']+_0x33b4('0x84')+_0x1af8cf[_0x33b4('0x86')]+_0x33b4('0x85')+md5(_0x1af8cf['uniqueid']);}else{_0x1af8cf[_0x33b4('0x83')]='';}var _0xd30942=_0x4a9a99[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x4a9a99)[_0x33b4('0x2a')](function(_0x26cd89){_0xfb4cc6=_0x26cd89;return getUser(_0xfb4cc6,_0xd30942,_0x4a9a99);})[_0x33b4('0x2a')](function(_0x146fa1){_0xcd1eed=_0x146fa1;logger['info'](_0x33b4('0x98'),_0xcd1eed['id']);return getEndUser(_0xfb4cc6,_0xd30942,_0x4a9a99,_0x1af8cf[_0x33b4('0x8a')],_0x1af8cf[_0x33b4('0x99')],_0xcd1eed,_0x466551);})[_0x33b4('0x2a')](function(_0x28650b){_0x294250=_0x28650b;return getCall(_0xfb4cc6,_0xd30942,_0x4a9a99,_0xcd1eed,_0x294250,_0x466551,_0x1af8cf,'Inbound');})[_0x33b4('0x2a')](function(_0x500561){if(_0x500561){logger['info'](_0x33b4('0x8b'),_0x500561['id']);}})[_0x33b4('0x2c')](function(_0x5dd026){logger[_0x33b4('0x3c')]('['+_0x1af8cf[_0x33b4('0x96')][_0x33b4('0x97')]()+']',JSON[_0x33b4('0xf')](_0x5dd026));});}; \ No newline at end of file +var _0xceef=['recordingURL','zoho.eu','com','calleridname','calleridnum','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','defaults','localhost','socket.io-emitter','redis','debug','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','email','info','Agent\x20found!','users','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','first_name','code','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','uri','Contacts','nothing','lead','Creating\x20new\x20call...','role','last_name','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','answertime','endtime','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','Timeout','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','/downloads?type=uniqueid&token='];(function(_0x197a9f,_0x4bafe7){var _0x28d1a5=function(_0x3915c2){while(--_0x3915c2){_0x197a9f['push'](_0x197a9f['shift']());}};_0x28d1a5(++_0x4bafe7);}(_0xceef,0x13f));var _0xfcee=function(_0x31659b,_0x3f07a1){_0x31659b=_0x31659b-0x0;var _0x48b140=_0xceef[_0x31659b];return _0x48b140;};'use strict';var _=require(_0xfcee('0x0'));var rp=require(_0xfcee('0x1'));var md5=require(_0xfcee('0x2'));var util=require(_0xfcee('0x3'));var intUtil=require(_0xfcee('0x4'));var moment=require(_0xfcee('0x5'));var Redis=require(_0xfcee('0x6'));var BPromise=require(_0xfcee('0x7'));var config=require(_0xfcee('0x8'));var logger=require('../../../../config/logger')(_0xfcee('0x9'));config['redis']=_[_0xfcee('0xa')](config['redis'],{'host':_0xfcee('0xb'),'port':0x18eb});var io=require(_0xfcee('0xc'))(new Redis(config[_0xfcee('0xd')]));function emit(_0xea860c,_0x4a42db,_0x3fdf26){io['to'](_0xea860c)['emit'](_0x4a42db,_0x3fdf26);}function request(_0x31b489){logger[_0xfcee('0xe')](_0xfcee('0xf'),JSON[_0xfcee('0x10')](_0x31b489));return rp(_0x31b489);}function getCustomFields(_0x5d7e5b,_0x398a1d){var _0x1d3174={};if(_0x5d7e5b[_0xfcee('0x11')]>0x0){_[_0xfcee('0x12')](_0x5d7e5b,function(_0x2839cb){if(_[_0xfcee('0x13')](['string',_0xfcee('0x14')],_0x2839cb[_0xfcee('0x15')])&&_0x2839cb[_0xfcee('0x16')]){_0x1d3174[_0x2839cb[_0xfcee('0x16')]]=_0x2839cb['content'][_0xfcee('0x17')]();}else if(_0x2839cb[_0xfcee('0x15')]===_0xfcee('0x18')&&_0x2839cb['variableName']&&_0x2839cb[_0xfcee('0x16')]&&_0x398a1d[_0x2839cb[_0xfcee('0x19')]]){_0x1d3174[_0x2839cb[_0xfcee('0x16')]]=_0x398a1d[_0x2839cb[_0xfcee('0x19')]][_0xfcee('0x17')]();}else if(_0x2839cb[_0xfcee('0x15')]===_0xfcee('0x1a')&&_0x2839cb[_0xfcee('0x1b')]&&_0x2839cb[_0xfcee('0x1b')][_0xfcee('0x1c')]&&_0x2839cb[_0xfcee('0x16')]&&_0x398a1d[_0x2839cb[_0xfcee('0x1b')][_0xfcee('0x1c')][_0xfcee('0x1d')]()]){_0x1d3174[_0x2839cb['idField']]=_0x398a1d[_0x2839cb[_0xfcee('0x1b')][_0xfcee('0x1c')][_0xfcee('0x1d')]()][_0xfcee('0x17')]();}});}return _0x1d3174;}function getName(_0x2257fc){if(_0x2257fc['indexOf']('\x20')>0x0){var _0x23522b=_0x2257fc[_0xfcee('0x1e')](/ (.+)/);if(_0x23522b[0x1]){return _0x23522b;}}return[_0x2257fc,_0x2257fc];}var accountsTokens={};function getAccessToken(_0x227b0c){return new Promise(function(_0x13b10a,_0x5498b2){if(!_[_0xfcee('0x1f')](accountsTokens[_0x227b0c['id']])&&!_[_0xfcee('0x1f')](accountsTokens[_0x227b0c['id']][_0xfcee('0x20')])){if(moment()[_0xfcee('0x21')](accountsTokens[_0x227b0c['id']][_0xfcee('0x22')])){_0x13b10a(accountsTokens[_0x227b0c['id']][_0xfcee('0x20')]);}}var _0x16296f;switch(_0x227b0c['zone']){case'US':_0x16296f=_0xfcee('0x23');break;case'AU':_0x16296f=_0xfcee('0x24');break;case'EU':_0x16296f=_0xfcee('0x25');break;case'IN':_0x16296f='https://accounts.zoho.in';break;case'CN':_0x16296f=_0xfcee('0x26');break;default:_0x16296f='https://accounts.zoho.eu';break;}var _0x4ad20b={'method':_0xfcee('0x27'),'uri':_0x16296f+_0xfcee('0x28'),'qs':{'refresh_token':_0x227b0c['refreshToken'],'client_id':_0x227b0c[_0xfcee('0x29')],'client_secret':_0x227b0c[_0xfcee('0x2a')],'grant_type':_0xfcee('0x2b')},'json':!![]};return rp(_0x4ad20b)[_0xfcee('0x2c')](function(_0x1c487c){accountsTokens[_0x227b0c['id']]={'access_token':_0x1c487c[_0xfcee('0x20')],'expires_in':moment()[_0xfcee('0x2d')](_0x1c487c[_0xfcee('0x22')],'seconds')};_0x13b10a(_0x1c487c[_0xfcee('0x20')]);})[_0xfcee('0x2e')](function(_0x3605e7){logger[_0xfcee('0x2f')](_0xfcee('0x30'),_0x3605e7[_0xfcee('0x31')]);_0x5498b2(_0x3605e7);});});}function getUser(_0x149eea,_0x467a92,_0x461dbb,_0x2ef635){logger['info'](_0xfcee('0x32'));return request({'method':_0xfcee('0x33'),'uri':util[_0xfcee('0x34')](_0xfcee('0x35'),_0x467a92),'qs':{'type':_0xfcee('0x36')},'headers':{'Authorization':_0xfcee('0x37')+_0x149eea},'json':!![]})[_0xfcee('0x2c')](function(_0xb3d8b7){if(_0xb3d8b7['users']){var _0x1fa784=-0x1;if(_[_0xfcee('0x38')](_0xb3d8b7['users'])){if(!_[_0xfcee('0x1f')](_0x2ef635)){_0x1fa784=_[_0xfcee('0x39')](_0xb3d8b7['users'],function(_0x267418){return _0x267418[_0xfcee('0x3a')]===_0x2ef635;});}if(_0x1fa784>=0x0){logger[_0xfcee('0x3b')](_0xfcee('0x3c'));}else{logger[_0xfcee('0x3b')]('Using\x20the\x20admin\x20account!');_0x1fa784=_[_0xfcee('0x39')](_0xb3d8b7[_0xfcee('0x3d')],function(_0x399fad){return _0x399fad[_0xfcee('0x3e')][_0xfcee('0x1c')]===_0xfcee('0x3f');});}return _0xb3d8b7['users'][_0x1fa784];}else{if(_0xb3d8b7[_0xfcee('0x40')][_0xfcee('0x3e')]['name']===_0xfcee('0x3f')){logger['info']('Using\x20the\x20admin\x20account!');user=_0xb3d8b7['user'];return user;}else{logger[_0xfcee('0x2f')](_0xfcee('0x41'),JSON[_0xfcee('0x10')](_0xb3d8b7));throw new Error(_0xfcee('0x42')+JSON[_0xfcee('0x10')](_0xb3d8b7));}}}else{logger[_0xfcee('0x2f')](_0xfcee('0x41'),JSON[_0xfcee('0x10')](_0xb3d8b7));throw new Error(_0xfcee('0x42')+JSON[_0xfcee('0x10')](_0xb3d8b7));}})['catch'](function(_0x342ad1){console[_0xfcee('0x2f')](_0x342ad1);});}function getZohoUser(_0x595893,_0xcf5946){return new BPromise(function(_0x1a9c08,_0x37f4bd){request(_0x595893)[_0xfcee('0x2c')](function(_0x304636){var _0xbc68ec=null;if(_0x304636){_0xbc68ec=_0x304636[_0xfcee('0x43')][0x0];_0xbc68ec[_0xfcee('0x44')]=_0xcf5946;}_0x1a9c08(_0xbc68ec);})[_0xfcee('0x2e')](function(_0x43aa81){_0x37f4bd(_0x43aa81);});});}function createEndUser(_0x892db4,_0x163da1,_0x48064f,_0x2de2dd,_0x211244,_0x51f094){var _0x48064f=getName(_0x48064f);return request({'method':_0xfcee('0x27'),'uri':_0xfcee('0x45')+_0x163da1+'/crm/v2/'+_[_0xfcee('0x46')](_0x51f094[_0xfcee('0x47')])+'s','body':{'data':[{'Last_Name':_0x48064f[0x1],'First_Name':_0x48064f[0x0],'Phone':_0x2de2dd,'Owner':{'name':!_[_0xfcee('0x1f')](_0x211244['role'][_0xfcee('0x1c')])?_0x211244['role']['name']:!_['isNil'](_0x211244[_0xfcee('0x48')])?_0x211244[_0xfcee('0x48')]+'\x20'+_0x211244['last_name']:_0x211244['last_name'],'id':_0x211244['id']}}]},'headers':{'Authorization':_0xfcee('0x37')+_0x892db4},'json':!![]})[_0xfcee('0x2c')](function(_0x392902){if(_0x392902&&_0x392902[_0xfcee('0x43')][0x0][_0xfcee('0x49')]==='SUCCESS'){var _0x950ccc=_0x392902['data'][0x0]['details'];_0x950ccc[_0xfcee('0x44')]=_[_0xfcee('0x46')](_0x51f094['moduleCreate'])+'s';return _0x950ccc;}logger[_0xfcee('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xfcee('0x10')](data));throw new Error('Error:\x20'+JSON[_0xfcee('0x10')](data));})[_0xfcee('0x2e')](function(_0x3b7652){console['log'](_0xfcee('0x4a'),_0x3b7652);});}function getEndUser(_0x2caa96,_0x26cf2c,_0x13bd11,_0x3bcbd4,_0x3010fe,_0x31a2bc,_0x45ceb5){var _0x4dcb15={'method':_0xfcee('0x33'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2caa96},'json':!![]};switch(_0x45ceb5[_0xfcee('0x4b')]){case _0xfcee('0x4c'):_0x4dcb15['uri']='https://www.zohoapis.'+_0x26cf2c+_0xfcee('0x4d')+_0x3010fe+'))';return getZohoUser(_0x4dcb15,'Contacts')[_0xfcee('0x2c')](function(_0x400470){if(_0x400470)return _0x400470;_0x4dcb15['uri']=_0xfcee('0x45')+_0x26cf2c+_0xfcee('0x4e')+_0x3010fe+'))';return getZohoUser(_0x4dcb15,_0xfcee('0x4f'))[_0xfcee('0x2c')](function(_0xd7a890){if(_0xd7a890)return _0xd7a890;if(_0x45ceb5[_0xfcee('0x47')]!='nothing'){return createEndUser(_0x2caa96,_0x26cf2c,_0x3bcbd4,_0x3010fe,_0x31a2bc,_0x45ceb5);}else{return{};}});});break;case _0xfcee('0x50'):_0x4dcb15[_0xfcee('0x51')]=_0xfcee('0x45')+_0x26cf2c+_0xfcee('0x4d')+_0x3010fe+'))';return getZohoUser(_0x4dcb15,_0xfcee('0x52'))[_0xfcee('0x2c')](function(_0x25f562){if(_0x25f562)return _0x25f562;if(_0x45ceb5['moduleCreate']!=_0xfcee('0x53')){return createEndUser(_0x2caa96,_0x26cf2c,_0x3bcbd4,_0x3010fe,_0x31a2bc,_0x45ceb5);}else{return{};}});break;case _0xfcee('0x54'):_0x4dcb15[_0xfcee('0x51')]='https://www.zohoapis.'+_0x26cf2c+_0xfcee('0x4e')+_0x3010fe+'))';return getZohoUser(_0x4dcb15,'Leads')[_0xfcee('0x2c')](function(_0x5d8a74){if(_0x5d8a74)return _0x5d8a74;if(_0x45ceb5[_0xfcee('0x47')]!=_0xfcee('0x53')){return createEndUser(_0x2caa96,_0x26cf2c,_0x3bcbd4,_0x3010fe,_0x31a2bc,_0x45ceb5);}else{return{};}});break;}}function getCall(_0x33d748,_0x8c73b2,_0x4bb9b1,_0x225685,_0x1a673c,_0x6e90ac,_0x43204b,_0x328e15){logger[_0xfcee('0x3b')](_0xfcee('0x55'));var _0x5b7daa={};_0x5b7daa['Owner']={'name':!_['isNil'](_0x225685[_0xfcee('0x56')]['name'])&&!_[_0xfcee('0x1f')](_0x225685[_0xfcee('0x3e')]['name'])&&_0x225685[_0xfcee('0x3e')][_0xfcee('0x1c')]==='administrator'?_0x225685[_0xfcee('0x56')][_0xfcee('0x1c')]:!_[_0xfcee('0x1f')](_0x225685[_0xfcee('0x48')])?_0x225685['first_name']+'\x20'+_0x225685[_0xfcee('0x57')]:_0x225685['last_name'],'id':_0x225685['id']};_0x5b7daa['Subject']=intUtil[_0xfcee('0x58')](_0x6e90ac[_0xfcee('0x59')],_0x43204b,'\x20');_0x5b7daa[_0xfcee('0x5a')]=intUtil['getString'](_0x6e90ac[_0xfcee('0x5b')],_0x43204b,'\x0a');if(_0x1a673c['enduserType']===_0xfcee('0x52')){_0x5b7daa[_0xfcee('0x5c')]={'name':!_[_0xfcee('0x1f')](_0x1a673c[_0xfcee('0x5d')])?_0x1a673c['Full_Name']:!_[_0xfcee('0x1f')](_0x1a673c[_0xfcee('0x5e')])?_0x1a673c[_0xfcee('0x5e')]+'\x20'+_0x1a673c[_0xfcee('0x5f')]:_0x1a673c[_0xfcee('0x5f')],'id':_0x1a673c['id']};}if(_0x1a673c['enduserType']===_0xfcee('0x4f')){_0x5b7daa[_0xfcee('0x60')]={'name':!_[_0xfcee('0x1f')](_0x1a673c['Full_Name'])?_0x1a673c[_0xfcee('0x5d')]:!_['isNil'](_0x1a673c[_0xfcee('0x5e')])?_0x1a673c[_0xfcee('0x5e')]+'\x20'+_0x1a673c['Last_Name']:_0x1a673c[_0xfcee('0x5f')],'id':_0x1a673c['id']};_0x5b7daa['$se_module']=_[_0xfcee('0x46')](_0x1a673c['enduserType']);}if(_0x43204b[_0xfcee('0x61')]){_0x5b7daa['Call_Duration']=moment[_0xfcee('0x62')](parseInt(_0x43204b[_0xfcee('0x61')])*0x3e8)[_0xfcee('0x34')]('mm:ss');}else if(_0x43204b[_0xfcee('0x63')]&&_0x43204b['endtime']){_0x5b7daa['Call_Duration']=moment[_0xfcee('0x62')](moment(_0x43204b[_0xfcee('0x64')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x43204b[_0xfcee('0x65')],_0xfcee('0x66'))))[_0xfcee('0x34')](_0xfcee('0x67'));}switch(_0x43204b['lastevent']){case'called':_0x5b7daa[_0xfcee('0x68')]=_0xfcee('0x69');break;case _0xfcee('0x6a'):case _0xfcee('0x6b'):_0x5b7daa[_0xfcee('0x68')]=_0xfcee('0x6c');break;case _0xfcee('0x6d'):_0x5b7daa['Call_Result']=_0xfcee('0x6e');break;case'abandoned':_0x5b7daa[_0xfcee('0x68')]=_0xfcee('0x6f');break;case'timeout':_0x5b7daa['Call_Result']=_0xfcee('0x70');default:}_0x5b7daa['Call_Start_Time']=(_0x328e15===_0xfcee('0x71')?moment(_0x43204b['starttime'])[_0xfcee('0x34')](_0xfcee('0x66')):moment(_0x43204b[_0xfcee('0x72')])[_0xfcee('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xfcee('0x34')](_0xfcee('0x66'));_0x5b7daa[_0xfcee('0x73')]=_0x328e15||_0xfcee('0x74');_0x5b7daa=_['merge'](_0x5b7daa,getCustomFields(_0x6e90ac[_0xfcee('0x75')],_0x43204b));return request({'method':_0xfcee('0x27'),'uri':_0xfcee('0x45')+_0x8c73b2+_0xfcee('0x76'),'headers':{'Authorization':_0xfcee('0x37')+_0x33d748},'body':{'data':[_0x5b7daa]},'json':!![]})[_0xfcee('0x2c')](function(_0x23b991){if(_0x23b991&&_0x23b991['data'][0x0]['code']==='SUCCESS'){logger[_0xfcee('0x3b')](_0xfcee('0x77'));return{'id':_0x23b991[_0xfcee('0x43')][0x0][_0xfcee('0x78')]['id']};}})['catch'](function(_0x468859){logger[_0xfcee('0x3b')](_0xfcee('0x79'),_0x468859[_0xfcee('0x31')]);console[_0xfcee('0x7a')](_0xfcee('0x79'),_0x468859);});}exports[_0xfcee('0x7b')]=function(_0x15cafb,_0x112f43,_0x39fff6,_0x3468dd,_0x266fe2,_0x3db609){var _0x14f685,_0x45fc4f,_0x9e68ae;_0x3db609[_0xfcee('0x7c')]=intUtil[_0xfcee('0x7d')](_0x3db609[_0xfcee('0x7c')]);_0x3db609[_0xfcee('0x7e')]=intUtil['stripTrailingSlash'](_0x3db609[_0xfcee('0x7e')]);if(_0x266fe2&&_0x266fe2[_0xfcee('0x7f')]){logger['info'](_0xfcee('0x80'),'Recording\x20is\x20enabled!');_0x112f43['recordingURL']=_0x3db609['serverUrl']+'/api/voice/recordings/'+_0x112f43[_0xfcee('0x81')]+_0xfcee('0x82')+md5(_0x112f43[_0xfcee('0x81')]);}else{_0x112f43[_0xfcee('0x83')]='';}var _0x85c5b5=_0x3db609[_0xfcee('0x7c')]===_0xfcee('0x84')?'eu':_0xfcee('0x85');return getAccessToken(_0x3db609)[_0xfcee('0x2c')](function(_0x5a4892){_0x9e68ae=_0x5a4892;return getUser(_0x9e68ae,_0x85c5b5,_0x3db609,_0x3468dd[_0xfcee('0x3a')]);})[_0xfcee('0x2c')](function(_0x768b78){_0x14f685=_0x768b78;logger['info']('The\x20User\x20ID\x20is:',_0x14f685['id']);return getEndUser(_0x9e68ae,_0x85c5b5,_0x3db609,_0x112f43[_0xfcee('0x86')],_0x112f43[_0xfcee('0x87')],_0x14f685,_0x39fff6);})[_0xfcee('0x2c')](function(_0x1a3e99){_0x45fc4f=_0x1a3e99;return getCall(_0x9e68ae,_0x85c5b5,_0x3db609,_0x14f685,_0x45fc4f,_0x39fff6,_0x112f43,_0xfcee('0x74'));})[_0xfcee('0x2c')](function(_0x2c83dd){if(_0x2c83dd){logger[_0xfcee('0x3b')]('The\x20Call\x20ID\x20is:',_0x2c83dd['id']);logger['info'](_0xfcee('0x80'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfcee('0x34')](_0xfcee('0x88'),_0x3468dd[_0xfcee('0x1c')]),_0xfcee('0x89'),{'uri':'https://crm.'+_0x3db609[_0xfcee('0x7c')]+_0xfcee('0x8a')+_0x2c83dd['id']});}})[_0xfcee('0x2e')](function(_0x285c5b){logger[_0xfcee('0x2f')](_0xfcee('0x80'),JSON[_0xfcee('0x10')](_0x285c5b));});};exports[_0xfcee('0x71')]=function(_0x1bd42f,_0x524361,_0x5ad082,_0x1ae8d4,_0x3d1c47,_0x911e74,_0x4fb5ad){var _0xb3d20a,_0x29f4f5,_0x5b370a;_0x911e74[_0xfcee('0x7c')]=intUtil['stripTrailingSlash'](_0x911e74['host']);_0x911e74[_0xfcee('0x7e')]=intUtil['stripTrailingSlash'](_0x911e74[_0xfcee('0x7e')]);if(_0x4fb5ad&&_0x4fb5ad[_0xfcee('0x8b')]&&_0x4fb5ad[_0xfcee('0x8b')]!=='none'){logger[_0xfcee('0x3b')](_0xfcee('0x8c'),_0xfcee('0x8d'));_0x524361[_0xfcee('0x83')]=_0x911e74[_0xfcee('0x7e')]+_0xfcee('0x8e')+_0x524361[_0xfcee('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x524361[_0xfcee('0x81')]);}var _0x1ab0ab=_0x911e74[_0xfcee('0x7c')]===_0xfcee('0x84')?'eu':'com';return getAccessToken(_0x911e74)['then'](function(_0x10a527){_0x5b370a=_0x10a527;return getUser(_0x5b370a,_0x1ab0ab,_0x911e74,_0x1ae8d4[_0xfcee('0x3a')]);})['then'](function(_0x4cb9c8){_0xb3d20a=_0x4cb9c8;logger['info']('The\x20User\x20ID\x20is:',_0xb3d20a['id']);return getEndUser(_0x5b370a,_0x1ab0ab,_0x911e74,_0x524361[_0xfcee('0x8f')],_0x524361[_0xfcee('0x90')],_0xb3d20a,_0x5ad082);})[_0xfcee('0x2c')](function(_0x41b523){_0x29f4f5=_0x41b523;return getCall(_0x5b370a,_0x1ab0ab,_0x911e74,_0xb3d20a,_0x29f4f5,_0x5ad082,_0x524361,'Outbound');})[_0xfcee('0x2c')](function(_0x4720b7){if(_0x4720b7){logger[_0xfcee('0x3b')](_0xfcee('0x91'),_0x4720b7['id']);logger[_0xfcee('0x3b')]('[OUTBOUND]',_0xfcee('0x92'));emit(util[_0xfcee('0x34')](_0xfcee('0x88'),_0x1ae8d4[_0xfcee('0x1c')]),_0xfcee('0x89'),{'uri':'https://crm.'+_0x911e74[_0xfcee('0x7c')]+_0xfcee('0x8a')+_0x4720b7['id']});}})[_0xfcee('0x2e')](function(_0x537ec2){logger[_0xfcee('0x2f')]('[OUTBOUND]',JSON[_0xfcee('0x10')](_0x537ec2));});};exports[_0xfcee('0x93')]=function(_0x53cd53,_0x379f12,_0xc2eb76,_0x2aa896,_0x36d06b,_0x53fc30){var _0x401430,_0x5c1589,_0x5b92d6;_0x53fc30[_0xfcee('0x7c')]=intUtil[_0xfcee('0x7d')](_0x53fc30[_0xfcee('0x7c')]);_0x53fc30[_0xfcee('0x7e')]=intUtil[_0xfcee('0x7d')](_0x53fc30['serverUrl']);if(_0x36d06b&&_0x36d06b[_0xfcee('0x7f')]){logger[_0xfcee('0x3b')]('['+_0x379f12[_0xfcee('0x94')][_0xfcee('0x95')]()+']',_0xfcee('0x8d'));_0x379f12[_0xfcee('0x83')]=_0x53fc30[_0xfcee('0x7e')]+_0xfcee('0x8e')+_0x379f12[_0xfcee('0x81')]+_0xfcee('0x82')+md5(_0x379f12[_0xfcee('0x81')]);}else{_0x379f12[_0xfcee('0x83')]='';}var _0x50b8f5=_0x53fc30['host']==='zoho.eu'?'eu':_0xfcee('0x85');return getAccessToken(_0x53fc30)[_0xfcee('0x2c')](function(_0x55625c){_0x5b92d6=_0x55625c;return getUser(_0x5b92d6,_0x50b8f5,_0x53fc30);})[_0xfcee('0x2c')](function(_0x1572e1){_0x401430=_0x1572e1;logger['info']('The\x20User\x20ID\x20is:',_0x401430['id']);return getEndUser(_0x5b92d6,_0x50b8f5,_0x53fc30,_0x379f12[_0xfcee('0x86')],_0x379f12['calleridnum'],_0x401430,_0xc2eb76);})[_0xfcee('0x2c')](function(_0x45fadf){_0x5c1589=_0x45fadf;return getCall(_0x5b92d6,_0x50b8f5,_0x53fc30,_0x401430,_0x5c1589,_0xc2eb76,_0x379f12,_0xfcee('0x74'));})[_0xfcee('0x2c')](function(_0x41cfc1){if(_0x41cfc1){logger[_0xfcee('0x3b')](_0xfcee('0x91'),_0x41cfc1['id']);}})[_0xfcee('0x2e')](function(_0x2d5da9){logger[_0xfcee('0x2f')]('['+_0x379f12[_0xfcee('0x94')][_0xfcee('0x95')]()+']',JSON[_0xfcee('0x10')](_0x2d5da9));});}; \ 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 03fc727..4de0c45 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 _0x18ba=['error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec'];(function(_0x327f6c,_0x245c1b){var _0x33a5be=function(_0x5c4db7){while(--_0x5c4db7){_0x327f6c['push'](_0x327f6c['shift']());}};_0x33a5be(++_0x245c1b);}(_0x18ba,0x13b));var _0xa18b=function(_0x149a87,_0x2c1f2a){_0x149a87=_0x149a87-0x0;var _0x551ebf=_0x18ba[_0x149a87];return _0x551ebf;};'use strict';var util=require(_0xa18b('0x0'));var sh=require(_0xa18b('0x1'));var Mustache=require(_0xa18b('0x2'));var logger=require('../../../../config/logger')(_0xa18b('0x3'));exports[_0xa18b('0x4')]=function(_0x51abd1,_0x3f456a){var _0x34a73a=_0x51abd1['data2']?_0x51abd1['data2']:'Script';var _0x43f289=_0x51abd1['data3']?Mustache['render'](_0x51abd1['data3'],_0x3f456a):_0x3f456a;sh[_0xa18b('0x4')](_0x43f289,function(_0x131458,_0x45dba1,_0x7dc64d){if(_0x131458!==0x0){logger[_0xa18b('0x5')](util[_0xa18b('0x6')](_0xa18b('0x7'),_0x34a73a,_0x43f289,_0x131458,_0x7dc64d));}else{logger[_0xa18b('0x8')](util['format'](_0xa18b('0x9'),_0x34a73a,_0x43f289,_0x45dba1));}});}; \ No newline at end of file +var _0x817c=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','data2','Script','data3','render','exec','error','format'];(function(_0x11f975,_0x5d9305){var _0x55e316=function(_0x5d09b7){while(--_0x5d09b7){_0x11f975['push'](_0x11f975['shift']());}};_0x55e316(++_0x5d9305);}(_0x817c,0x1f1));var _0xc817=function(_0x592e8e,_0x182f70){_0x592e8e=_0x592e8e-0x0;var _0x59fcfa=_0x817c[_0x592e8e];return _0x59fcfa;};'use strict';var util=require(_0xc817('0x0'));var sh=require(_0xc817('0x1'));var Mustache=require('mustache');var logger=require(_0xc817('0x2'))('trigger');exports['exec']=function(_0x4cf05a,_0x1b9f09){var _0x216d1c=_0x4cf05a['data2']?_0x4cf05a[_0xc817('0x3')]:_0xc817('0x4');var _0x4803d1=_0x4cf05a[_0xc817('0x5')]?Mustache[_0xc817('0x6')](_0x4cf05a['data3'],_0x1b9f09):_0x1b9f09;sh[_0xc817('0x7')](_0x4803d1,function(_0x27e283,_0x279ced,_0x58c282){if(_0x27e283!==0x0){logger[_0xc817('0x8')](util[_0xc817('0x9')](_0xc817('0xa'),_0x216d1c,_0x4803d1,_0x27e283,_0x58c282));}else{logger[_0xc817('0xb')](util['format'](_0xc817('0xc'),_0x216d1c,_0x4803d1,_0x279ced));}});}; \ 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 802d1c6..ae510f6 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 _0x2143=['DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET'];(function(_0x2eb52c,_0x3d3a5b){var _0x34521f=function(_0x42a5c2){while(--_0x42a5c2){_0x2eb52c['push'](_0x2eb52c['shift']());}};_0x34521f(++_0x3d3a5b);}(_0x2143,0xb5));var _0x3214=function(_0x29313f,_0x234b48){_0x29313f=_0x29313f-0x0;var _0x35b18b=_0x2143[_0x29313f];return _0x35b18b;};'use strict';var rp=require(_0x3214('0x0'));var util=require(_0x3214('0x1'));var _=require('lodash');var Mustache=require(_0x3214('0x2'));var logger=require(_0x3214('0x3'))(_0x3214('0x4'));exports['exec']=function(_0x28472c,_0x2659ab){var _0x5d57ec,_0x2326cb;var _0x368501={'method':_0x28472c[_0x3214('0x5')][_0x3214('0x6')](),'uri':Mustache[_0x3214('0x7')](_0x28472c[_0x3214('0x8')],_0x2659ab),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x28472c[_0x3214('0x9')])===_0x3214('0xa')&&parseInt(_0x28472c[_0x3214('0x9')])>=0x1&&parseInt(_0x28472c[_0x3214('0x9')])<=0xa?parseInt(_0x28472c['data5'])*0x3e8:0x5*0x3e8};try{_0x368501[_0x3214('0xb')]=_0x28472c[_0x3214('0xc')]?JSON[_0x3214('0xd')](Mustache[_0x3214('0x7')](_0x28472c['data6'],_0x2659ab)):{};}catch(_0x4cfa45){logger[_0x3214('0xe')](_0x4cfa45[_0x3214('0xf')]);}switch(_0x28472c[_0x3214('0x5')][_0x3214('0x6')]()){case _0x3214('0x10'):case _0x3214('0x11'):_0x5d57ec=null;_0x368501['qs']=_0x2659ab;break;case'POST':case _0x3214('0x12'):if(_0x28472c[_0x3214('0x13')]){try{_0x5d57ec=JSON['parse'](Mustache[_0x3214('0x7')](_0x28472c['data7'],_0x2659ab));_0x368501[_0x3214('0x14')]=_0x5d57ec;}catch(_0x50465e){logger[_0x3214('0xe')](_0x50465e['stack']);logger[_0x3214('0xe')](_0x3214('0x15'));}}else{_0x5d57ec=_0x2659ab;_0x368501['body']=_0x5d57ec;}break;}logger[_0x3214('0x16')](util[_0x3214('0x17')](_0x3214('0x18'),_0x28472c['data1'],_0x28472c[_0x3214('0x8')],JSON[_0x3214('0x19')](_0x368501)));rp(_0x368501)['then'](function(_0x2dc83b){_0x5d57ec=!_[_0x3214('0x1a')](_0x5d57ec)?',\x20request\x20body:\x20'+_0x5d57ec:'';_0x2326cb=typeof _0x2dc83b[_0x3214('0x14')]===_0x3214('0x1b')?JSON[_0x3214('0x19')](_0x2dc83b['body']):_0x2dc83b[_0x3214('0x14')];logger[_0x3214('0x16')](util[_0x3214('0x17')](_0x3214('0x1c'),_0x28472c[_0x3214('0x5')],_0x28472c[_0x3214('0x8')],_0x2dc83b[_0x3214('0x1d')],_0x2326cb));})[_0x3214('0x1e')](function(_0x3c1c2e){logger[_0x3214('0xe')](util['format'](_0x3214('0x1f'),_0x28472c[_0x3214('0x5')],_0x28472c[_0x3214('0x8')],_0x3c1c2e[_0x3214('0x1d')],_0x3c1c2e[_0x3214('0x20')],_0x3c1c2e['message']));});}; \ No newline at end of file +var _0xe248=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','mustache','../../../../config/logger','exec','data1','data5','number','headers','data6','parse','stack','toUpperCase','GET','DELETE','POST','PUT','render','body','error'];(function(_0x1e0e18,_0x5e6174){var _0x9194db=function(_0x336c4e){while(--_0x336c4e){_0x1e0e18['push'](_0x1e0e18['shift']());}};_0x9194db(++_0x5e6174);}(_0xe248,0x116));var _0x8e24=function(_0x2c5772,_0x3dda69){_0x2c5772=_0x2c5772-0x0;var _0x18450c=_0xe248[_0x2c5772];return _0x18450c;};'use strict';var rp=require(_0x8e24('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x8e24('0x1'));var logger=require(_0x8e24('0x2'))('trigger');exports[_0x8e24('0x3')]=function(_0x58d219,_0x4143a8){var _0x54f9c6,_0xc5ac21;var _0x126f8d={'method':_0x58d219[_0x8e24('0x4')]['toUpperCase'](),'uri':Mustache['render'](_0x58d219['data2'],_0x4143a8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x58d219[_0x8e24('0x5')])===_0x8e24('0x6')&&parseInt(_0x58d219[_0x8e24('0x5')])>=0x1&&parseInt(_0x58d219[_0x8e24('0x5')])<=0xa?parseInt(_0x58d219[_0x8e24('0x5')])*0x3e8:0x5*0x3e8};try{_0x126f8d[_0x8e24('0x7')]=_0x58d219[_0x8e24('0x8')]?JSON[_0x8e24('0x9')](Mustache['render'](_0x58d219[_0x8e24('0x8')],_0x4143a8)):{};}catch(_0x3c9133){logger['error'](_0x3c9133[_0x8e24('0xa')]);}switch(_0x58d219['data1'][_0x8e24('0xb')]()){case _0x8e24('0xc'):case _0x8e24('0xd'):_0x54f9c6=null;_0x126f8d['qs']=_0x4143a8;break;case _0x8e24('0xe'):case _0x8e24('0xf'):if(_0x58d219['data7']){try{_0x54f9c6=JSON['parse'](Mustache[_0x8e24('0x10')](_0x58d219['data7'],_0x4143a8));_0x126f8d[_0x8e24('0x11')]=_0x54f9c6;}catch(_0x1bb4b9){logger[_0x8e24('0x12')](_0x1bb4b9['stack']);logger[_0x8e24('0x12')](_0x8e24('0x13'));}}else{_0x54f9c6=_0x4143a8;_0x126f8d[_0x8e24('0x11')]=_0x54f9c6;}break;}logger['info'](util[_0x8e24('0x14')](_0x8e24('0x15'),_0x58d219['data1'],_0x58d219[_0x8e24('0x16')],JSON['stringify'](_0x126f8d)));rp(_0x126f8d)[_0x8e24('0x17')](function(_0x3e48e4){_0x54f9c6=!_[_0x8e24('0x18')](_0x54f9c6)?_0x8e24('0x19')+_0x54f9c6:'';_0xc5ac21=typeof _0x3e48e4[_0x8e24('0x11')]==='object'?JSON['stringify'](_0x3e48e4[_0x8e24('0x11')]):_0x3e48e4[_0x8e24('0x11')];logger[_0x8e24('0x1a')](util[_0x8e24('0x14')](_0x8e24('0x1b'),_0x58d219[_0x8e24('0x4')],_0x58d219['data2'],_0x3e48e4[_0x8e24('0x1c')],_0xc5ac21));})[_0x8e24('0x1d')](function(_0x390f65){logger[_0x8e24('0x12')](util[_0x8e24('0x14')](_0x8e24('0x1e'),_0x58d219[_0x8e24('0x4')],_0x58d219[_0x8e24('0x16')],_0x390f65[_0x8e24('0x1c')],_0x390f65[_0x8e24('0x1f')],_0x390f65[_0x8e24('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index a50fbf7..387c187 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 _0xba11=['then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','request'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0xba11,0x72));var _0x1ba1=function(_0x311cfe,_0x42e904){_0x311cfe=_0x311cfe-0x0;var _0x40ce33=_0xba11[_0x311cfe];return _0x40ce33;};'use strict';var jayson=require(_0x1ba1('0x0'));var BPromise=require(_0x1ba1('0x1'));var logger=require(_0x1ba1('0x2'))('routing');var client=jayson['client'][_0x1ba1('0x3')]({'port':0x2329});client[_0x1ba1('0x4')]=function(_0x8d6fd4,_0x573ce7){return new BPromise(function(_0xf1b97f,_0x151e3b){return client[_0x1ba1('0x5')](_0x8d6fd4,_0x573ce7)[_0x1ba1('0x6')](function(_0x45de43){logger[_0x1ba1('0x7')](_0x1ba1('0x8'),_0x1ba1('0x9'),_0x8d6fd4,_0x573ce7,_0x45de43);if(_0x45de43[_0x1ba1('0xa')]){logger[_0x1ba1('0xa')](_0x1ba1('0x8'),'routing',_0x8d6fd4,_0x45de43['error'][_0x1ba1('0xb')],_0x573ce7);return _0x151e3b(_0x45de43[_0x1ba1('0xa')][_0x1ba1('0xb')]);}else{return _0xf1b97f(_0x45de43[_0x1ba1('0xc')]);}})[_0x1ba1('0xd')](function(_0x2933a1){logger[_0x1ba1('0xa')]('rpc','routing',_0x8d6fd4,_0x2933a1,_0x573ce7);return _0x151e3b(_0x2933a1);});});};module[_0x1ba1('0xe')]=client; \ No newline at end of file +var _0x8585=['then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','request'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x8585,0xdb));var _0x5858=function(_0x313f43,_0x69bc5a){_0x313f43=_0x313f43-0x0;var _0x543835=_0x8585[_0x313f43];return _0x543835;};'use strict';var jayson=require(_0x5858('0x0'));var BPromise=require(_0x5858('0x1'));var logger=require(_0x5858('0x2'))('routing');var client=jayson[_0x5858('0x3')][_0x5858('0x4')]({'port':0x2329});client['Request']=function(_0x4c2544,_0x54945f){return new BPromise(function(_0x57aa31,_0x1d7c1c){return client[_0x5858('0x5')](_0x4c2544,_0x54945f)[_0x5858('0x6')](function(_0x1966f8){logger[_0x5858('0x7')](_0x5858('0x8'),_0x5858('0x9'),_0x4c2544,_0x54945f,_0x1966f8);if(_0x1966f8[_0x5858('0xa')]){logger[_0x5858('0xa')](_0x5858('0x8'),_0x5858('0x9'),_0x4c2544,_0x1966f8[_0x5858('0xa')][_0x5858('0xb')],_0x54945f);return _0x1d7c1c(_0x1966f8['error'][_0x5858('0xb')]);}else{return _0x57aa31(_0x1966f8[_0x5858('0xc')]);}})[_0x5858('0xd')](function(_0x5a429b){logger[_0x5858('0xa')]('rpc',_0x5858('0x9'),_0x4c2544,_0x5a429b,_0x54945f);return _0x1d7c1c(_0x5a429b);});});};module[_0x5858('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 802cc99..72b391f 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 _0x6cda=['mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','refresh'];(function(_0x4daeff,_0x304c69){var _0x3bda21=function(_0xee4365){while(--_0xee4365){_0x4daeff['push'](_0x4daeff['shift']());}};_0x3bda21(++_0x304c69);}(_0x6cda,0xae));var _0xa6cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6cda[_0x3dd15e];return _0x231fd0;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xa6cd('0x0'));var mailAccount=require(_0xa6cd('0x1'));var setting=require(_0xa6cd('0x2'));var logger=require('../../config/logger')(_0xa6cd('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa6cd('0x4')]()[_0xa6cd('0x5')](mailAccount[_0xa6cd('0x6')]())['then'](realtime['initMailAccounts']())['then'](function(){email[_0xa6cd('0x7')](realtime[_0xa6cd('0x8')]);return realtime;});}function main(){return server[_0xa6cd('0x9')](realtime,email)[_0xa6cd('0x5')](function(){return initRealtime();})[_0xa6cd('0x5')](function(){return setting[_0xa6cd('0xa')]();})[_0xa6cd('0x5')](function(_0x164b36){return setInterval(initRealtime,_0x164b36['loginMailFrequency']*0x3e8);})[_0xa6cd('0xb')](function(_0x3940ba){logger[_0xa6cd('0xc')](_0xa6cd('0xd'),_0x3940ba);});}main(); \ No newline at end of file +var _0xf499=['./realtime','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./server'];(function(_0x3b49bf,_0x4c5a97){var _0x48904c=function(_0x5ed4a8){while(--_0x5ed4a8){_0x3b49bf['push'](_0x3b49bf['shift']());}};_0x48904c(++_0x4c5a97);}(_0xf499,0x7d));var _0x9f49=function(_0x1949f7,_0xfdc8d5){_0x1949f7=_0x1949f7-0x0;var _0x323f37=_0xf499[_0x1949f7];return _0x323f37;};'use strict';var server=require(_0x9f49('0x0'));var Realtime=require(_0x9f49('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x9f49('0x2'))(_0x9f49('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x9f49('0x4')]()[_0x9f49('0x5')](mailAccount[_0x9f49('0x6')]())[_0x9f49('0x5')](realtime[_0x9f49('0x7')]())['then'](function(){email['refresh'](realtime[_0x9f49('0x8')]);return realtime;});}function main(){return server[_0x9f49('0x9')](realtime,email)[_0x9f49('0x5')](function(){return initRealtime();})[_0x9f49('0x5')](function(){return setting[_0x9f49('0xa')]();})[_0x9f49('0x5')](function(_0x332265){return setInterval(initRealtime,_0x332265['loginMailFrequency']*0x3e8);})[_0x9f49('0xb')](function(_0x33fdb8){logger[_0x9f49('0xc')](_0x9f49('0xd'),_0x33fdb8);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 7b6d46c..f18fbd0 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 _0x1be5=['Smtp','verify','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','messageStatus','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','bind','end','error','isNil','disabled','handleImapBox','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','handleImapError','sendMail','send'];(function(_0x369a02,_0x43d67b){var _0x48bff0=function(_0x42bb8e){while(--_0x42bb8e){_0x369a02['push'](_0x369a02['shift']());}};_0x48bff0(++_0x43d67b);}(_0x1be5,0xa1));var _0x51be=function(_0x373c7d,_0x5eb32d){_0x373c7d=_0x373c7d-0x0;var _0x27c82d=_0x1be5[_0x373c7d];return _0x27c82d;};'use strict';var _=require('lodash');var moment=require(_0x51be('0x0'));var BPromise=require(_0x51be('0x1'));var md5=require(_0x51be('0x2'));var Redis=require(_0x51be('0x3'));var config=require(_0x51be('0x4'));var logger=require(_0x51be('0x5'))(_0x51be('0x6'));config[_0x51be('0x7')]=_['defaults'](config[_0x51be('0x7')],{'host':_0x51be('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x51be('0x7')]));var EmailImap=require(_0x51be('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x51be('0xa'));var md5Accounts={};function EmailChannel(_0x5ede46){logger[_0x51be('0xb')]('start\x20email\x20channel');this[_0x51be('0xc')]=_0x5ede46[_0x51be('0xc')];this[_0x51be('0xd')]={};this[_0x51be('0xe')]=new EmailSmtp();}EmailChannel[_0x51be('0xf')][_0x51be('0x10')]=function(_0x47e794){var _0x457173=this[_0x51be('0xc')][_0x47e794];var _0x26af6a={'id':_0x457173['id'],'name':_0x457173[_0x51be('0x11')],'key':_0x457173['key'],'active':_0x457173[_0x51be('0x12')],'Imap':{'status':_0x457173['Imap'][_0x51be('0x13')],'messageStatus':_0x457173[_0x51be('0x14')][_0x51be('0x15')],'total':_0x457173[_0x51be('0x14')]['total']}};if(_['isNil'](md5Accounts[_0x47e794])){md5Accounts[_0x47e794]={};}var _0x442f14=md5(JSON['stringify'](_0x26af6a));if(md5Accounts[_0x47e794]['md5']!==_0x442f14){md5Accounts[_0x47e794]['md5']=_0x442f14;io[_0x51be('0x10')](_0x51be('0x16'),_0x26af6a);}};EmailChannel['prototype'][_0x51be('0x17')]=function(_0x338609){for(var _0x553911 in _0x338609){if(_0x338609[_0x51be('0x18')](_0x553911)){if(_0x338609[_0x553911][_0x51be('0x14')]&&_0x338609[_0x553911][_0x51be('0x12')]){var _0x415446=_0x338609[_0x553911]['Imap'];if(!_0x415446[_0x51be('0x19')]&&_0x338609[_0x553911][_0x51be('0x1a')]!==_0x51be('0x1b'))_0x415446[_0x51be('0x19')]=_0x338609[_0x553911][_0x51be('0x1a')];if(!this[_0x51be('0xd')][_0x51be('0x18')](_0x415446['id'])){this[_0x51be('0xd')][_0x415446['id']]=new EmailImap(_0x415446,_0x338609[_0x553911][_0x51be('0x6')]);this[_0x51be('0xd')][_0x415446['id']]['on'](_0x51be('0x1c'),this['handleImapBox']['bind'](this,_0x553911));this['imapAccounts'][_0x415446['id']]['on'](_0x51be('0x6'),this['handleImapEmail'][_0x51be('0x1d')](this,_0x553911));this[_0x51be('0xd')][_0x415446['id']]['on'](_0x51be('0x1e'),this['handleImapEnd'][_0x51be('0x1d')](this,_0x553911));this[_0x51be('0xd')][_0x415446['id']]['on'](_0x51be('0x1f'),this['handleImapError'][_0x51be('0x1d')](this,_0x553911));}}else{if(_[_0x51be('0x20')](this[_0x51be('0xc')][_0x553911][_0x51be('0x14')])){this[_0x51be('0xc')][_0x553911][_0x51be('0x14')]={};}this[_0x51be('0xc')][_0x553911][_0x51be('0x14')][_0x51be('0x13')]=_0x51be('0x21');this[_0x51be('0xc')][_0x553911][_0x51be('0x14')][_0x51be('0x15')]='';this['emit'](_0x553911);}}}};EmailChannel[_0x51be('0xf')][_0x51be('0x22')]=function(_0x19f89a,_0x54df40){if(this[_0x51be('0xc')][_0x19f89a]){this[_0x51be('0xc')][_0x19f89a][_0x51be('0x14')][_0x51be('0x13')]=_0x51be('0x23');this[_0x51be('0xc')][_0x19f89a][_0x51be('0x14')][_0x51be('0x15')]=_0x54df40[_0x51be('0x11')];if(_0x54df40[_0x51be('0x24')]){this[_0x51be('0xc')][_0x19f89a][_0x51be('0x14')]['total']=_0x54df40[_0x51be('0x24')]['total'];}return this[_0x51be('0x10')](_0x19f89a);}};EmailChannel[_0x51be('0xf')][_0x51be('0x25')]=function(_0x57b598,_0x42c243){logger[_0x51be('0xb')](_0x51be('0x26'),_0x42c243[_0x51be('0x27')],_0x42c243[_0x51be('0x28')],_0x42c243['from'],_0x57b598);if(this[_0x51be('0xc')][_0x57b598]){return mailAccount[_0x51be('0x29')](_0x57b598,_0x42c243)[_0x51be('0x2a')](function(_0xb0b9ef){if(_0xb0b9ef){logger[_0x51be('0xb')](_0x51be('0x2b'));}})['catch'](function(_0x33ee00){logger[_0x51be('0x1f')](_0x51be('0x2c'),JSON[_0x51be('0x2d')](_0x33ee00));});}};EmailChannel[_0x51be('0xf')][_0x51be('0x2e')]=function(_0x2a561e){if(this['mailAccounts'][_0x2a561e]&&this['mailAccounts'][_0x2a561e][_0x51be('0x14')]){if(this[_0x51be('0xd')][this['mailAccounts'][_0x2a561e][_0x51be('0x14')]['id']]){delete this['imapAccounts'][this[_0x51be('0xc')][_0x2a561e][_0x51be('0x14')]['id']];}this[_0x51be('0xc')][_0x2a561e]['Imap'][_0x51be('0x2f')]=moment();this['emit'](_0x2a561e);}};EmailChannel[_0x51be('0xf')][_0x51be('0x30')]=function(_0x1473cc,_0x4e050e){if(this[_0x51be('0xc')][_0x1473cc]){this[_0x51be('0xc')][_0x1473cc][_0x51be('0x14')][_0x51be('0x13')]='error';this[_0x51be('0xc')][_0x1473cc][_0x51be('0x14')][_0x51be('0x15')]=_0x4e050e;return this[_0x51be('0x10')](_0x1473cc);}};EmailChannel['prototype'][_0x51be('0x31')]=function(_0x3a31fe,_0x3276a2){return this[_0x51be('0xe')][_0x51be('0x32')](_0x3a31fe,_0x3276a2);};EmailChannel[_0x51be('0xf')]['verifySmtp']=function(_0x4d5d9f){var _0x32fd1c=this;if(this[_0x51be('0xc')][_0x4d5d9f['id']]){if(_['isNil'](this[_0x51be('0xc')][_0x4d5d9f['id']]['Smtp'])){this[_0x51be('0xc')][_0x4d5d9f['id']]['Smtp']={};}this[_0x51be('0xc')][_0x4d5d9f['id']][_0x51be('0x33')]['lastSync']=moment();return new BPromise(function(_0x102448,_0x14afe7){return _0x32fd1c[_0x51be('0xe')][_0x51be('0x34')](_0x4d5d9f)[_0x51be('0x2a')](function(_0xbd38aa){_0x32fd1c[_0x51be('0xc')][_0x4d5d9f['id']][_0x51be('0x33')]['status']='verified';_0x32fd1c[_0x51be('0xc')][_0x4d5d9f['id']][_0x51be('0x33')][_0x51be('0x15')]='';_0x32fd1c[_0x51be('0x10')](_0x4d5d9f['id']);_0x102448(_0xbd38aa);})['catch'](function(_0x365f17){_0x32fd1c['mailAccounts'][_0x4d5d9f['id']]['Smtp'][_0x51be('0x13')]=_0x51be('0x1f');_0x32fd1c[_0x51be('0xc')][_0x4d5d9f['id']]['Smtp']['messageStatus']=_0x365f17;_0x32fd1c[_0x51be('0x10')](_0x4d5d9f['id']);_0x14afe7(_0x365f17);});});}return this[_0x51be('0xe')]['verify'](_0x4d5d9f);};module['exports']=EmailChannel; \ No newline at end of file +var _0xa017=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','hasOwnProperty','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','messages','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0xa017,0x1c3));var _0x7a01=function(_0x34537f,_0x213a48){_0x34537f=_0x34537f-0x0;var _0x4bc478=_0xa017[_0x34537f];return _0x4bc478;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x7a01('0x0'));var md5=require(_0x7a01('0x1'));var Redis=require('ioredis');var config=require(_0x7a01('0x2'));var logger=require(_0x7a01('0x3'))(_0x7a01('0x4'));config[_0x7a01('0x5')]=_[_0x7a01('0x6')](config[_0x7a01('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7a01('0x7'))(new Redis(config[_0x7a01('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0x7a01('0x8'));var md5Accounts={};function EmailChannel(_0xf38b0a){logger[_0x7a01('0x9')](_0x7a01('0xa'));this[_0x7a01('0xb')]=_0xf38b0a[_0x7a01('0xb')];this[_0x7a01('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x7a01('0xd')][_0x7a01('0xe')]=function(_0x5d0b0a){var _0x2bbf07=this['mailAccounts'][_0x5d0b0a];var _0x22b515={'id':_0x2bbf07['id'],'name':_0x2bbf07[_0x7a01('0xf')],'key':_0x2bbf07[_0x7a01('0x10')],'active':_0x2bbf07[_0x7a01('0x11')],'Imap':{'status':_0x2bbf07['Imap'][_0x7a01('0x12')],'messageStatus':_0x2bbf07[_0x7a01('0x13')][_0x7a01('0x14')],'total':_0x2bbf07['Imap'][_0x7a01('0x15')]}};if(_[_0x7a01('0x16')](md5Accounts[_0x5d0b0a])){md5Accounts[_0x5d0b0a]={};}var _0x57431f=md5(JSON[_0x7a01('0x17')](_0x22b515));if(md5Accounts[_0x5d0b0a][_0x7a01('0x1')]!==_0x57431f){md5Accounts[_0x5d0b0a]['md5']=_0x57431f;io['emit'](_0x7a01('0x18'),_0x22b515);}};EmailChannel[_0x7a01('0xd')][_0x7a01('0x19')]=function(_0x2cad2d){for(var _0x235394 in _0x2cad2d){if(_0x2cad2d['hasOwnProperty'](_0x235394)){if(_0x2cad2d[_0x235394][_0x7a01('0x13')]&&_0x2cad2d[_0x235394][_0x7a01('0x11')]){var _0x11e310=_0x2cad2d[_0x235394]['Imap'];if(!_0x11e310[_0x7a01('0x1a')]&&_0x2cad2d[_0x235394]['provider']!=='custom')_0x11e310['service']=_0x2cad2d[_0x235394]['provider'];if(!this['imapAccounts'][_0x7a01('0x1b')](_0x11e310['id'])){this['imapAccounts'][_0x11e310['id']]=new EmailImap(_0x11e310,_0x2cad2d[_0x235394][_0x7a01('0x4')]);this[_0x7a01('0xc')][_0x11e310['id']]['on']('box',this[_0x7a01('0x1c')][_0x7a01('0x1d')](this,_0x235394));this[_0x7a01('0xc')][_0x11e310['id']]['on']('email',this['handleImapEmail'][_0x7a01('0x1d')](this,_0x235394));this[_0x7a01('0xc')][_0x11e310['id']]['on'](_0x7a01('0x1e'),this[_0x7a01('0x1f')][_0x7a01('0x1d')](this,_0x235394));this[_0x7a01('0xc')][_0x11e310['id']]['on'](_0x7a01('0x20'),this[_0x7a01('0x21')]['bind'](this,_0x235394));}}else{if(_[_0x7a01('0x16')](this[_0x7a01('0xb')][_0x235394][_0x7a01('0x13')])){this[_0x7a01('0xb')][_0x235394][_0x7a01('0x13')]={};}this[_0x7a01('0xb')][_0x235394][_0x7a01('0x13')][_0x7a01('0x12')]=_0x7a01('0x22');this[_0x7a01('0xb')][_0x235394][_0x7a01('0x13')][_0x7a01('0x14')]='';this[_0x7a01('0xe')](_0x235394);}}}};EmailChannel[_0x7a01('0xd')][_0x7a01('0x1c')]=function(_0x42d394,_0x3c5eb6){if(this[_0x7a01('0xb')][_0x42d394]){this[_0x7a01('0xb')][_0x42d394][_0x7a01('0x13')][_0x7a01('0x12')]='connected';this['mailAccounts'][_0x42d394]['Imap'][_0x7a01('0x14')]=_0x3c5eb6[_0x7a01('0xf')];if(_0x3c5eb6['messages']){this[_0x7a01('0xb')][_0x42d394]['Imap'][_0x7a01('0x15')]=_0x3c5eb6[_0x7a01('0x23')][_0x7a01('0x15')];}return this[_0x7a01('0xe')](_0x42d394);}};EmailChannel[_0x7a01('0xd')]['handleImapEmail']=function(_0x2f3f21,_0x5be07d){logger[_0x7a01('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5be07d['firstName'],_0x5be07d['lastName'],_0x5be07d[_0x7a01('0x24')],_0x2f3f21);if(this[_0x7a01('0xb')][_0x2f3f21]){return mailAccount[_0x7a01('0x25')](_0x2f3f21,_0x5be07d)[_0x7a01('0x26')](function(_0x47a66a){if(_0x47a66a){logger[_0x7a01('0x9')](_0x7a01('0x27'));}})[_0x7a01('0x28')](function(_0x3f3f70){logger[_0x7a01('0x20')](_0x7a01('0x29'),JSON[_0x7a01('0x17')](_0x3f3f70));});}};EmailChannel[_0x7a01('0xd')][_0x7a01('0x1f')]=function(_0x4625b0){if(this[_0x7a01('0xb')][_0x4625b0]&&this['mailAccounts'][_0x4625b0][_0x7a01('0x13')]){if(this[_0x7a01('0xc')][this[_0x7a01('0xb')][_0x4625b0][_0x7a01('0x13')]['id']]){delete this[_0x7a01('0xc')][this['mailAccounts'][_0x4625b0][_0x7a01('0x13')]['id']];}this[_0x7a01('0xb')][_0x4625b0][_0x7a01('0x13')][_0x7a01('0x2a')]=moment();this['emit'](_0x4625b0);}};EmailChannel['prototype'][_0x7a01('0x21')]=function(_0x4aadcf,_0xeec84b){if(this[_0x7a01('0xb')][_0x4aadcf]){this[_0x7a01('0xb')][_0x4aadcf]['Imap']['status']='error';this[_0x7a01('0xb')][_0x4aadcf][_0x7a01('0x13')][_0x7a01('0x14')]=_0xeec84b;return this[_0x7a01('0xe')](_0x4aadcf);}};EmailChannel['prototype'][_0x7a01('0x2b')]=function(_0x37feb2,_0x37e625){return this[_0x7a01('0x2c')][_0x7a01('0x2d')](_0x37feb2,_0x37e625);};EmailChannel[_0x7a01('0xd')][_0x7a01('0x2e')]=function(_0x2d3f06){var _0x3f9744=this;if(this[_0x7a01('0xb')][_0x2d3f06['id']]){if(_[_0x7a01('0x16')](this['mailAccounts'][_0x2d3f06['id']][_0x7a01('0x2f')])){this[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')]={};}this[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')][_0x7a01('0x2a')]=moment();return new BPromise(function(_0x23699b,_0x5019a8){return _0x3f9744[_0x7a01('0x2c')][_0x7a01('0x30')](_0x2d3f06)[_0x7a01('0x26')](function(_0x1df10b){_0x3f9744[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')][_0x7a01('0x12')]=_0x7a01('0x31');_0x3f9744[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')]['messageStatus']='';_0x3f9744[_0x7a01('0xe')](_0x2d3f06['id']);_0x23699b(_0x1df10b);})[_0x7a01('0x28')](function(_0x132d63){_0x3f9744[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')]['status']='error';_0x3f9744[_0x7a01('0xb')][_0x2d3f06['id']][_0x7a01('0x2f')]['messageStatus']=_0x132d63;_0x3f9744[_0x7a01('0xe')](_0x2d3f06['id']);_0x5019a8(_0x132d63);});});}return this['smtp'][_0x7a01('0x30')](_0x2d3f06);};module[_0x7a01('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index e7f17e4..4cb0624 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 _0x6365=['handleFetchEnd','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','handleEnd','bind','error','handleError','connect','inherits','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','handleReadUnseen','fetch','handleFetchMessage','handleFetchError'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6365,0x148));var _0x5636=function(_0x17fbf2,_0x31612a){_0x17fbf2=_0x17fbf2-0x0;var _0xd46e7a=_0x6365[_0x17fbf2];return _0xd46e7a;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var Imap=require(_0x5636('0x2'));var simpleParser=require(_0x5636('0x3'))['simpleParser'];var Iconv=require(_0x5636('0x4'))[_0x5636('0x5')];var EventEmitter=require(_0x5636('0x6'))[_0x5636('0x7')];var utils=require(_0x5636('0x8'));var logger=require('../../../config/logger')(_0x5636('0x9'));function EmailImap(_0x230d78,_0x2a12df){this[_0x5636('0xa')]='INBOX';this[_0x5636('0xb')]=this[_0x5636('0xc')](_0x230d78,_0x2a12df);this['imap']=new Imap(this['account']);this[_0x5636('0x2')][_0x5636('0xd')](_0x5636('0xe'),this[_0x5636('0xf')]['bind'](this));this['imap'][_0x5636('0xd')]('end',this[_0x5636('0x10')][_0x5636('0x11')](this));this[_0x5636('0x2')]['on'](_0x5636('0x12'),this[_0x5636('0x13')][_0x5636('0x11')](this));this['imap'][_0x5636('0x14')]();}util[_0x5636('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x5636('0xc')]=function(_0x196741,_0x51eaa7){var _0x565538={'connTimeout':_0x196741[_0x5636('0x16')]?_0x196741[_0x5636('0x16')]*0x3e8:0x2710,'authTimeout':_0x196741[_0x5636('0x17')]?_0x196741[_0x5636('0x17')]*0x3e8:0x1388};if(_0x196741[_0x5636('0x18')]){_0x565538['user']=_0x196741[_0x5636('0x19')];_0x565538['email']=_0x51eaa7||_0x196741['user']||_0x5636('0x1a');if(_0x196741[_0x5636('0x1b')]){_0x565538[_0x5636('0x1c')]=utils[_0x5636('0x1d')](_0x196741[_0x5636('0x1e')][_0x5636('0x1f')],_0x196741[_0x5636('0x19')]);}else{_0x565538[_0x5636('0x20')]=_0x196741['password'];}}else{if(_0x196741['authentication']){_0x565538[_0x5636('0x19')]=_0x196741[_0x5636('0x19')];_0x565538[_0x5636('0x20')]=_0x196741['password'];}}_0x565538[_0x5636('0x21')]=_0x196741[_0x5636('0x21')];_0x565538[_0x5636('0x22')]=_0x196741[_0x5636('0x22')]||0x3e1;if(_0x196741[_0x5636('0x23')]){_0x565538['tls']=!![];}else{_0x565538[_0x5636('0x23')]=![];_0x565538[_0x5636('0x24')]=_0x5636('0x25');}return _0x565538;};EmailImap[_0x5636('0x26')]['handleReady']=function(){this['imap'][_0x5636('0x27')](this['mailbox'],![],this[_0x5636('0x28')][_0x5636('0x11')](this));};EmailImap[_0x5636('0x26')][_0x5636('0x28')]=function(_0x51e5cc,_0x3a1575){if(_0x51e5cc){this['handleError'](_0x51e5cc,!![]);}else{this[_0x5636('0x29')]('box',_0x3a1575);this[_0x5636('0x2a')]();}};EmailImap[_0x5636('0x26')][_0x5636('0x2b')]=function(_0x278316){if(_0x278316){this['handleError'](_0x278316,!![]);}else{this[_0x5636('0x2')][_0x5636('0x2c')]();}};EmailImap[_0x5636('0x26')][_0x5636('0x2a')]=function(){this['imap'][_0x5636('0x2d')](['UNSEEN'],this[_0x5636('0x2e')]['bind'](this));};EmailImap[_0x5636('0x26')]['handleReadUnseen']=function(_0x2ad433,_0x4f0ac2){if(_0x2ad433){this[_0x5636('0x13')](_0x2ad433,!![]);}else{if(_0x4f0ac2['length']){try{var _0x183f69=this[_0x5636('0x2')][_0x5636('0x2f')](_0x4f0ac2,{'bodies':'','markSeen':!![]});_0x183f69['on']('message',this[_0x5636('0x30')][_0x5636('0x11')](this));_0x183f69[_0x5636('0xd')]('error',this[_0x5636('0x31')][_0x5636('0x11')](this));_0x183f69[_0x5636('0xd')](_0x5636('0x2c'),this[_0x5636('0x32')][_0x5636('0x11')](this));}catch(_0x499f04){logger['error'](_0x499f04);}}else{this[_0x5636('0x2')]['closeBox'](!![],this[_0x5636('0x2b')]['bind'](this));}}};EmailImap[_0x5636('0x26')][_0x5636('0x30')]=function(_0x35e684){_0x35e684['on'](_0x5636('0x33'),this['handleMessageBody'][_0x5636('0x11')](this));_0x35e684['once'](_0x5636('0x34'),this[_0x5636('0x35')][_0x5636('0x11')](this));_0x35e684['once']('end',this[_0x5636('0x36')][_0x5636('0x11')](this));};EmailImap[_0x5636('0x26')][_0x5636('0x37')]=function(_0x3f7d5d){simpleParser(_0x3f7d5d,{'Iconv':Iconv},this[_0x5636('0x38')][_0x5636('0x11')](this));};EmailImap['prototype'][_0x5636('0x35')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x5636('0x26')][_0x5636('0x38')]=function(_0x346d23,_0x313ac9){if(_0x346d23){logger[_0x5636('0x12')](_0x346d23);}else{var _0x39e4e5=this;utils[_0x5636('0x39')](this[_0x5636('0xb')],_0x313ac9,function(_0x383583){_0x39e4e5[_0x5636('0x29')](_0x5636('0x9'),_0x383583);});}};EmailImap[_0x5636('0x26')]['handleFetchEnd']=function(){this['imap'][_0x5636('0x3a')](!![],this[_0x5636('0x2b')]['bind'](this));};EmailImap['prototype'][_0x5636('0x31')]=function(_0x1b6430){this[_0x5636('0x13')](_0x1b6430);this[_0x5636('0x2')][_0x5636('0x3a')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x5636('0x26')][_0x5636('0x10')]=function(){this[_0x5636('0x29')](_0x5636('0x2c'));};EmailImap['prototype']['handleError']=function(_0x2a3da2,_0x32c139){logger[_0x5636('0x12')]('handleError',this['account'][_0x5636('0x9')],JSON[_0x5636('0x3b')](_0x2a3da2));var _0x11bf7c='';if(_0x2a3da2){if(_0x2a3da2[_0x5636('0x3c')]){_0x11bf7c=_0x2a3da2['textCode'];}else{for(var _0x19e159 in _0x2a3da2){if(_0x2a3da2[_0x5636('0x3d')](_0x19e159)){_0x11bf7c+=_[_0x5636('0x3e')](_0x19e159)+':\x20'+_0x2a3da2[_0x19e159]+'\x0a';}}}}if(_0x32c139){this[_0x5636('0x2')][_0x5636('0x2c')]();}else{this[_0x5636('0x29')](_0x5636('0x12'),_0x11bf7c);this[_0x5636('0x29')](_0x5636('0x2c'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xa46e=['emit','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','once','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','mailparser','simpleParser','iconv','events','./utils','email','mailbox','account','getAccount','imap','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','generateXOAuth2Token','CloudProvider','password','host','tls','required','handleReady','openBox','handleOpenBox'];(function(_0x529917,_0x32129c){var _0x2e6d39=function(_0x23a49a){while(--_0x23a49a){_0x529917['push'](_0x529917['shift']());}};_0x2e6d39(++_0x32129c);}(_0xa46e,0x8a));var _0xea46=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xa46e[_0x355ce8];return _0x1db8b8;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var Imap=require('imap');var simpleParser=require(_0xea46('0x2'))[_0xea46('0x3')];var Iconv=require(_0xea46('0x4'))['Iconv'];var EventEmitter=require(_0xea46('0x5'))['EventEmitter'];var utils=require(_0xea46('0x6'));var logger=require('../../../config/logger')(_0xea46('0x7'));function EmailImap(_0x528404,_0x10bee5){this[_0xea46('0x8')]='INBOX';this[_0xea46('0x9')]=this[_0xea46('0xa')](_0x528404,_0x10bee5);this[_0xea46('0xb')]=new Imap(this[_0xea46('0x9')]);this[_0xea46('0xb')]['once']('ready',this['handleReady'][_0xea46('0xc')](this));this[_0xea46('0xb')]['once'](_0xea46('0xd'),this[_0xea46('0xe')][_0xea46('0xc')](this));this['imap']['on'](_0xea46('0xf'),this[_0xea46('0x10')]['bind'](this));this[_0xea46('0xb')][_0xea46('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xea46('0x12')]['getAccount']=function(_0x3024af,_0x42c328){var _0x6c4bc4={'connTimeout':_0x3024af[_0xea46('0x13')]?_0x3024af[_0xea46('0x13')]*0x3e8:0x2710,'authTimeout':_0x3024af[_0xea46('0x14')]?_0x3024af[_0xea46('0x14')]*0x3e8:0x1388};if(_0x3024af[_0xea46('0x15')]){_0x6c4bc4[_0xea46('0x16')]=_0x3024af['user'];_0x6c4bc4[_0xea46('0x7')]=_0x42c328||_0x3024af[_0xea46('0x16')]||_0xea46('0x17');if(_0x3024af['modernAuthentication']){_0x6c4bc4['xoauth2']=utils[_0xea46('0x18')](_0x3024af[_0xea46('0x19')]['data5'],_0x3024af['user']);}else{_0x6c4bc4[_0xea46('0x1a')]=_0x3024af[_0xea46('0x1a')];}}else{if(_0x3024af['authentication']){_0x6c4bc4[_0xea46('0x16')]=_0x3024af[_0xea46('0x16')];_0x6c4bc4[_0xea46('0x1a')]=_0x3024af[_0xea46('0x1a')];}}_0x6c4bc4['host']=_0x3024af[_0xea46('0x1b')];_0x6c4bc4['port']=_0x3024af['port']||0x3e1;if(_0x3024af[_0xea46('0x1c')]){_0x6c4bc4['tls']=!![];}else{_0x6c4bc4['tls']=![];_0x6c4bc4['autotls']=_0xea46('0x1d');}return _0x6c4bc4;};EmailImap[_0xea46('0x12')][_0xea46('0x1e')]=function(){this['imap'][_0xea46('0x1f')](this['mailbox'],![],this[_0xea46('0x20')][_0xea46('0xc')](this));};EmailImap['prototype'][_0xea46('0x20')]=function(_0x5480eb,_0x2b3a8f){if(_0x5480eb){this[_0xea46('0x10')](_0x5480eb,!![]);}else{this[_0xea46('0x21')]('box',_0x2b3a8f);this['readUnseen']();}};EmailImap[_0xea46('0x12')][_0xea46('0x22')]=function(_0x4b369c){if(_0x4b369c){this[_0xea46('0x10')](_0x4b369c,!![]);}else{this['imap'][_0xea46('0xd')]();}};EmailImap['prototype'][_0xea46('0x23')]=function(){this[_0xea46('0xb')][_0xea46('0x24')]([_0xea46('0x25')],this[_0xea46('0x26')][_0xea46('0xc')](this));};EmailImap['prototype'][_0xea46('0x26')]=function(_0x338e96,_0x200e10){if(_0x338e96){this['handleError'](_0x338e96,!![]);}else{if(_0x200e10[_0xea46('0x27')]){try{var _0x3cdf96=this[_0xea46('0xb')]['fetch'](_0x200e10,{'bodies':'','markSeen':!![]});_0x3cdf96['on']('message',this['handleFetchMessage'][_0xea46('0xc')](this));_0x3cdf96[_0xea46('0x28')](_0xea46('0xf'),this[_0xea46('0x29')][_0xea46('0xc')](this));_0x3cdf96[_0xea46('0x28')](_0xea46('0xd'),this[_0xea46('0x2a')][_0xea46('0xc')](this));}catch(_0x1c7201){logger[_0xea46('0xf')](_0x1c7201);}}else{this['imap'][_0xea46('0x2b')](!![],this[_0xea46('0x22')][_0xea46('0xc')](this));}}};EmailImap[_0xea46('0x12')][_0xea46('0x2c')]=function(_0x23aefd){_0x23aefd['on'](_0xea46('0x2d'),this['handleMessageBody'][_0xea46('0xc')](this));_0x23aefd[_0xea46('0x28')](_0xea46('0x2e'),this[_0xea46('0x2f')][_0xea46('0xc')](this));_0x23aefd['once']('end',this[_0xea46('0x30')][_0xea46('0xc')](this));};EmailImap['prototype'][_0xea46('0x31')]=function(_0x2de735){simpleParser(_0x2de735,{'Iconv':Iconv},this[_0xea46('0x32')][_0xea46('0xc')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0xea46('0x12')]['handleMessageEnd']=function(){};EmailImap[_0xea46('0x12')][_0xea46('0x32')]=function(_0x5aa717,_0x1e61fd){if(_0x5aa717){logger[_0xea46('0xf')](_0x5aa717);}else{var _0x5f5697=this;utils[_0xea46('0x33')](this[_0xea46('0x9')],_0x1e61fd,function(_0x5f37f2){_0x5f5697[_0xea46('0x21')](_0xea46('0x7'),_0x5f37f2);});}};EmailImap[_0xea46('0x12')][_0xea46('0x2a')]=function(){this['imap'][_0xea46('0x2b')](!![],this[_0xea46('0x22')][_0xea46('0xc')](this));};EmailImap[_0xea46('0x12')][_0xea46('0x29')]=function(_0x504ad3){this[_0xea46('0x10')](_0x504ad3);this[_0xea46('0xb')]['closeBox'](!![],this[_0xea46('0x22')][_0xea46('0xc')](this));};EmailImap[_0xea46('0x12')][_0xea46('0xe')]=function(){this['emit'](_0xea46('0xd'));};EmailImap[_0xea46('0x12')][_0xea46('0x10')]=function(_0x4d0129,_0x39fd2d){logger[_0xea46('0xf')](_0xea46('0x10'),this[_0xea46('0x9')][_0xea46('0x7')],JSON[_0xea46('0x34')](_0x4d0129));var _0x23940c='';if(_0x4d0129){if(_0x4d0129[_0xea46('0x35')]){_0x23940c=_0x4d0129[_0xea46('0x35')];}else{for(var _0x23ab02 in _0x4d0129){if(_0x4d0129[_0xea46('0x36')](_0x23ab02)){_0x23940c+=_[_0xea46('0x37')](_0x23ab02)+':\x20'+_0x4d0129[_0x23ab02]+'\x0a';}}}}if(_0x39fd2d){this[_0xea46('0xb')][_0xea46('0xd')]();}else{this[_0xea46('0x21')]('error',_0x23940c);this['emit'](_0xea46('0xd'));}};module[_0xea46('0x38')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index aa97772..ca5b0b1 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 _0xa2b3=['exports','nodemailer-plugin-inline-base64','createTransport','use','compile','verify','toString','Not\x20verifired'];(function(_0xa951b0,_0x2b74af){var _0x38da67=function(_0x50120b){while(--_0x50120b){_0xa951b0['push'](_0xa951b0['shift']());}};_0x38da67(++_0x2b74af);}(_0xa2b3,0x69));var _0x3a2b=function(_0x497ded,_0x3bb53c){_0x497ded=_0x497ded-0x0;var _0x21f720=_0xa2b3[_0x497ded];return _0x21f720;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x3a2b('0x0'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x4af7e0,_0x410473){return new Promise(function(_0x228008,_0x5ac154){var _0x20dea4=nodemailer[_0x3a2b('0x1')](_0x4af7e0);_0x20dea4[_0x3a2b('0x2')](_0x3a2b('0x3'),inlineBase64());_0x20dea4['sendMail'](_0x410473,function(_0x1803c9,_0x53ae27){if(_0x1803c9){_0x5ac154(_0x1803c9['toString']());}else{_0x228008(_0x53ae27);}});});};EmailSmtp['prototype'][_0x3a2b('0x4')]=function(_0xa14682){return new Promise(function(_0x2c9b55,_0x295da2){var _0x5d34bb=nodemailer[_0x3a2b('0x1')](_0xa14682);_0x5d34bb['verify'](function(_0x4df0b9,_0x2973b9){if(_0x4df0b9){_0x295da2(_0x4df0b9[_0x3a2b('0x5')]());}else{if(_0x2973b9){_0x2c9b55(_0x2973b9);}else{_0x295da2(_0x3a2b('0x6'));}}});});};module[_0x3a2b('0x7')]=EmailSmtp; \ No newline at end of file +var _0x50b0=['compile','toString','verify','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use'];(function(_0x1c5c5f,_0x574f4b){var _0x376339=function(_0x5464ac){while(--_0x5464ac){_0x1c5c5f['push'](_0x1c5c5f['shift']());}};_0x376339(++_0x574f4b);}(_0x50b0,0x173));var _0x050b=function(_0x240615,_0x1aa87a){_0x240615=_0x240615-0x0;var _0x4aa8c5=_0x50b0[_0x240615];return _0x4aa8c5;};'use strict';var nodemailer=require(_0x050b('0x0'));var inlineBase64=require(_0x050b('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x050b('0x2')]=function(_0x276b7e,_0xe66b1b){return new Promise(function(_0x2aec83,_0x5ec836){var _0x410b55=nodemailer[_0x050b('0x3')](_0x276b7e);_0x410b55[_0x050b('0x4')](_0x050b('0x5'),inlineBase64());_0x410b55['sendMail'](_0xe66b1b,function(_0x475fc1,_0x2c6e07){if(_0x475fc1){_0x5ec836(_0x475fc1[_0x050b('0x6')]());}else{_0x2aec83(_0x2c6e07);}});});};EmailSmtp['prototype'][_0x050b('0x7')]=function(_0x249488){return new Promise(function(_0x378ada,_0x53cfa2){var _0x25e606=nodemailer[_0x050b('0x3')](_0x249488);_0x25e606['verify'](function(_0x50103d,_0x3bb1fb){if(_0x50103d){_0x53cfa2(_0x50103d[_0x050b('0x6')]());}else{if(_0x3bb1fb){_0x378ada(_0x3bb1fb);}else{_0x53cfa2('Not\x20verifired');}}});});};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 c69babf..9acff29 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 _0xd2bf=['\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','user=','utf-8','toString','base64','lodash','randomstring','path','email','head','address','anonymous','generate','value','name','indexOf','split','Anonymous','pop','length','isEmpty','@xcally.com','test','html','replace','includes'];(function(_0x13ea75,_0x70adf2){var _0x188f64=function(_0x4580e5){while(--_0x4580e5){_0x13ea75['push'](_0x13ea75['shift']());}};_0x188f64(++_0x70adf2);}(_0xd2bf,0x75));var _0xfd2b=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0xd2bf[_0x5ca353];return _0x4f2fe5;};'use strict';var _=require(_0xfd2b('0x0'));var moment=require('moment');var random=require(_0xfd2b('0x1'));var fs=require('fs');var path=require(_0xfd2b('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xfd2b('0x3'));var config=require('../../../config/environment');function getAddress(_0x12a300){var _0x155324=_[_0xfd2b('0x4')](_0x12a300['value']);return _0x155324&&_0x155324[_0xfd2b('0x5')]?_0x155324[_0xfd2b('0x5')]:_0xfd2b('0x6')+random[_0xfd2b('0x7')](0x6)+'@xcally.com';}function getFirstName(_0x1c05b2){var _0x4c2c98=_[_0xfd2b('0x4')](_0x1c05b2[_0xfd2b('0x8')]);if(_0x4c2c98&&_0x4c2c98[_0xfd2b('0x9')]){if(_0x4c2c98[_0xfd2b('0x9')]==_0x4c2c98[_0xfd2b('0x5')]){return _0x4c2c98[_0xfd2b('0x9')]['substring'](0x0,_0x4c2c98[_0xfd2b('0x9')][_0xfd2b('0xa')]('@'));}var _0x459d1d=_0x4c2c98[_0xfd2b('0x9')][_0xfd2b('0xb')](/\s+/);return _0x459d1d['length']>0x1?_0x459d1d['slice'](0x0,-0x1)['join']('\x20'):_0x4c2c98[_0xfd2b('0x9')];}return _0xfd2b('0xc');}function getLastName(_0xd22a77){var _0x5eb7c0=_[_0xfd2b('0x4')](_0xd22a77[_0xfd2b('0x8')]);if(_0x5eb7c0&&_0x5eb7c0[_0xfd2b('0x9')]){var _0x319caf=_0x5eb7c0[_0xfd2b('0x9')][_0xfd2b('0xb')](/\s+/);return _0x319caf['length']>0x1?_0x319caf[_0xfd2b('0xd')]():'';}return'';}function getMails(_0x46d8e9,_0x529f1c){var _0x21783c='';for(var _0x194e9c=0x0;_0x194e9c<_0x529f1c[_0xfd2b('0x8')][_0xfd2b('0xe')];_0x194e9c+=0x1){if(_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]!==_0x46d8e9){if(!_[_0xfd2b('0xf')](_0x21783c)){_0x21783c+=',';}_0x21783c+=_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x9')]||_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]||'';_0x21783c+='\x20<';_0x21783c+=_0x529f1c[_0xfd2b('0x8')][_0x194e9c][_0xfd2b('0x5')]?_0x529f1c[_0xfd2b('0x8')][_0x194e9c]['address']:_0xfd2b('0x6')+random['generate'](0x6)+_0xfd2b('0x10');_0x21783c+='>';}}return _0x21783c;}function parseEmail(_0x1b1d1b,_0x1f36cb,_0x34562d){if(_0x1f36cb['html']){var _0x2987f3=/)<[^<]*)*<\/script>/gi;while(_0x2987f3[_0xfd2b('0x11')](_0x1f36cb[_0xfd2b('0x12')])){_0x1f36cb[_0xfd2b('0x12')]=_0x1f36cb[_0xfd2b('0x12')][_0xfd2b('0x13')](_0x2987f3,'');}if(_0x1f36cb[_0xfd2b('0x12')][_0xfd2b('0x14')](_0xfd2b('0x15'))){var _0x241084=[];_0x1f36cb[_0xfd2b('0x16')]['forEach'](_0x34755a=>{_0x241084[_0xfd2b('0x17')](_0x34755a[_0xfd2b('0x18')]);});var _0x557373=/]+>/g;var _0x15f6e9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3980fe=_0x1f36cb['html'][_0xfd2b('0x13')](_0x15f6e9,'_SRC');var _0x4574ab=_0x3980fe[_0xfd2b('0x13')](_0x557373,_0xfd2b('0x19'));for(let _0x33bfb3=0x0;_0x33bfb3<_0x241084[_0xfd2b('0xe')];_0x33bfb3++){var _0x6c2ac1=_0x4574ab[_0xfd2b('0x13')](_0xfd2b('0x19'),_0xfd2b('0x1a')+_0x241084[_0x33bfb3]+_0xfd2b('0x1b'));_0x4574ab=_0x6c2ac1;}_0x1f36cb['html']=_0x4574ab;}_0x34562d[_0xfd2b('0x1c')]=_0x1f36cb[_0xfd2b('0x12')];}else{_0x34562d[_0xfd2b('0x1c')]=_0x1f36cb[_0xfd2b('0x1d')];}if(_0x34562d[_0xfd2b('0x1c')]){_0x34562d[_0xfd2b('0x1c')]=_0x34562d[_0xfd2b('0x1c')][_0xfd2b('0x13')](/0x0){var _0x5066ed=[_0xfd2b('0x2f'),_0xfd2b('0x30'),_0xfd2b('0x31')];for(var _0x543b59=0x0;_0x543b59<_0x1f36cb[_0xfd2b('0x2e')][_0xfd2b('0xe')];_0x543b59++){var _0x346958=_[_0xfd2b('0xa')](_0x5066ed,_0x1f36cb[_0xfd2b('0x2e')][_0x543b59]['line']);if(_0x346958>=0x0){_0x34562d['isAutoreply']=!![];}}}return _0x34562d;}exports[_0xfd2b('0x32')]=function(_0x18944f,_0x229a0c,_0x536830){var _0x2688d2={'from':getAddress(_0x229a0c['from']),'firstName':getFirstName(_0x229a0c['from']),'lastName':getLastName(_0x229a0c[_0xfd2b('0x33')]),'mapKey':_0xfd2b('0x3'),'message':{'from':getMails(_0x18944f['email'],_0x229a0c[_0xfd2b('0x33')]),'to':_0x18944f['email'],'cc':'','subject':_0x229a0c['subject']||'','messageId':_0x229a0c[_0xfd2b('0x34')],'inReplyTo':_0x229a0c[_0xfd2b('0x35')],'sentAt':moment(_0x229a0c[_0xfd2b('0x36')])[_0xfd2b('0x27')](_0xfd2b('0x37')),'attach':![],'attachments':[]}};if(!_0x229a0c[_0xfd2b('0x12')]&&!_0x229a0c[_0xfd2b('0x1d')]){var _0x463d05=_[_0xfd2b('0x38')](_0x229a0c[_0xfd2b('0x16')],{'contentType':'application/ms-tnef'});if(_0x463d05[_0xfd2b('0xe')]){logger[_0xfd2b('0x39')](util['format'](_0xfd2b('0x3a'),_0x229a0c[_0xfd2b('0x34')]));tnef[_0xfd2b('0x3b')](_['first'](_0x463d05)[_0xfd2b('0x3c')],function(_0x43ff8c,_0xae351a){if(_0xae351a){_0x229a0c[_0xfd2b('0x12')]=_0xae351a[_0xfd2b('0x3d')]||_0xfd2b('0x3e');if(_0xae351a[_0xfd2b('0x3f')]){for(var _0x44c978=0x0;_0x44c978<_0xae351a[_0xfd2b('0x3f')][_0xfd2b('0xe')];_0x44c978++){var _0x28b049=_0xae351a[_0xfd2b('0x3f')][_0x44c978];_0x2688d2[_0xfd2b('0x20')][_0xfd2b('0x16')][_0xfd2b('0x17')]({'filename':_0x28b049['Title'],'content':Buffer['from'](_0x28b049[_0xfd2b('0x40')])});}}}_0x536830(parseEmail(_0x18944f,_0x229a0c,_0x2688d2));});}else{_0x229a0c[_0xfd2b('0x12')]=_0xfd2b('0x3e');_0x536830(parseEmail(_0x18944f,_0x229a0c,_0x2688d2));}}else{_0x536830(parseEmail(_0x18944f,_0x229a0c,_0x2688d2));}};exports['generateXOAuth2Token']=function(_0x5639e0,_0x54a384){var _0x138ee6=[_0xfd2b('0x41')+(_0x54a384||''),'auth=Bearer\x20'+_0x5639e0,'',''];return Buffer[_0xfd2b('0x33')](_0x138ee6[_0xfd2b('0x2a')](''),_0xfd2b('0x42'))[_0xfd2b('0x43')](_0xfd2b('0x44'));}; \ No newline at end of file +var _0x52ce=['Anonymous','split','pop','isEmpty','html','test','replace','includes','push','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','length','slice','join'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x52ce,0x118));var _0xe52c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x52ce[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xe52c('0x0'));var moment=require(_0xe52c('0x1'));var random=require(_0xe52c('0x2'));var fs=require('fs');var path=require(_0xe52c('0x3'));var util=require(_0xe52c('0x4'));var tnef=require(_0xe52c('0x5'));var logger=require('../../../config/logger')(_0xe52c('0x6'));var config=require(_0xe52c('0x7'));function getAddress(_0x101ed3){var _0x3670ef=_['head'](_0x101ed3[_0xe52c('0x8')]);return _0x3670ef&&_0x3670ef[_0xe52c('0x9')]?_0x3670ef[_0xe52c('0x9')]:_0xe52c('0xa')+random[_0xe52c('0xb')](0x6)+_0xe52c('0xc');}function getFirstName(_0xd7f5f3){var _0x5c56a9=_[_0xe52c('0xd')](_0xd7f5f3['value']);if(_0x5c56a9&&_0x5c56a9[_0xe52c('0xe')]){if(_0x5c56a9['name']==_0x5c56a9[_0xe52c('0x9')]){return _0x5c56a9[_0xe52c('0xe')][_0xe52c('0xf')](0x0,_0x5c56a9[_0xe52c('0xe')][_0xe52c('0x10')]('@'));}var _0x20fc0f=_0x5c56a9[_0xe52c('0xe')]['split'](/\s+/);return _0x20fc0f[_0xe52c('0x11')]>0x1?_0x20fc0f[_0xe52c('0x12')](0x0,-0x1)[_0xe52c('0x13')]('\x20'):_0x5c56a9[_0xe52c('0xe')];}return _0xe52c('0x14');}function getLastName(_0x1b5cb0){var _0x21d68f=_[_0xe52c('0xd')](_0x1b5cb0[_0xe52c('0x8')]);if(_0x21d68f&&_0x21d68f['name']){var _0x5ab343=_0x21d68f[_0xe52c('0xe')][_0xe52c('0x15')](/\s+/);return _0x5ab343[_0xe52c('0x11')]>0x1?_0x5ab343[_0xe52c('0x16')]():'';}return'';}function getMails(_0x45cfa9,_0x5342a2){var _0x209d34='';for(var _0x5eeb03=0x0;_0x5eeb03<_0x5342a2[_0xe52c('0x8')][_0xe52c('0x11')];_0x5eeb03+=0x1){if(_0x5342a2[_0xe52c('0x8')][_0x5eeb03]['address']!==_0x45cfa9){if(!_[_0xe52c('0x17')](_0x209d34)){_0x209d34+=',';}_0x209d34+=_0x5342a2['value'][_0x5eeb03][_0xe52c('0xe')]||_0x5342a2[_0xe52c('0x8')][_0x5eeb03]['address']||'';_0x209d34+='\x20<';_0x209d34+=_0x5342a2[_0xe52c('0x8')][_0x5eeb03]['address']?_0x5342a2[_0xe52c('0x8')][_0x5eeb03][_0xe52c('0x9')]:_0xe52c('0xa')+random[_0xe52c('0xb')](0x6)+_0xe52c('0xc');_0x209d34+='>';}}return _0x209d34;}function parseEmail(_0x474e17,_0x41e819,_0x57d71b){if(_0x41e819[_0xe52c('0x18')]){var _0x1af8cb=/)<[^<]*)*<\/script>/gi;while(_0x1af8cb[_0xe52c('0x19')](_0x41e819[_0xe52c('0x18')])){_0x41e819['html']=_0x41e819[_0xe52c('0x18')][_0xe52c('0x1a')](_0x1af8cb,'');}if(_0x41e819['html'][_0xe52c('0x1b')]('{_0x819360[_0xe52c('0x1c')](_0xb5cccd['filename']);});var _0x2f194a=/]+>/g;var _0x1f86b9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4b97eb=_0x41e819['html']['replace'](_0x1f86b9,_0xe52c('0x1d'));var _0x8b19cb=_0x4b97eb[_0xe52c('0x1a')](_0x2f194a,_0xe52c('0x1e'));for(let _0x2dd902=0x0;_0x2dd902<_0x819360[_0xe52c('0x11')];_0x2dd902++){var _0x45080a=_0x8b19cb[_0xe52c('0x1a')](_0xe52c('0x1e'),_0xe52c('0x1f')+_0x819360[_0x2dd902]+_0xe52c('0x20'));_0x8b19cb=_0x45080a;}_0x41e819[_0xe52c('0x18')]=_0x8b19cb;}_0x57d71b[_0xe52c('0x21')]=_0x41e819[_0xe52c('0x18')];}else{_0x57d71b[_0xe52c('0x21')]=_0x41e819[_0xe52c('0x22')];}if(_0x57d71b[_0xe52c('0x21')]){_0x57d71b[_0xe52c('0x21')]=_0x57d71b[_0xe52c('0x21')][_0xe52c('0x1a')](/0x0){var _0x12d42a=[_0xe52c('0x30'),_0xe52c('0x31'),'Precedence:\x20auto_reply'];for(var _0x4e0970=0x0;_0x4e0970<_0x41e819[_0xe52c('0x2f')][_0xe52c('0x11')];_0x4e0970++){var _0x4d5545=_[_0xe52c('0x10')](_0x12d42a,_0x41e819[_0xe52c('0x2f')][_0x4e0970][_0xe52c('0x32')]);if(_0x4d5545>=0x0){_0x57d71b[_0xe52c('0x33')]=!![];}}}return _0x57d71b;}exports[_0xe52c('0x34')]=function(_0x202793,_0x4eeb42,_0x10cd00){var _0x2e4f3d={'from':getAddress(_0x4eeb42[_0xe52c('0x35')]),'firstName':getFirstName(_0x4eeb42[_0xe52c('0x35')]),'lastName':getLastName(_0x4eeb42[_0xe52c('0x35')]),'mapKey':'email','message':{'from':getMails(_0x202793[_0xe52c('0x6')],_0x4eeb42['from']),'to':_0x202793[_0xe52c('0x6')],'cc':'','subject':_0x4eeb42[_0xe52c('0x36')]||'','messageId':_0x4eeb42[_0xe52c('0x37')],'inReplyTo':_0x4eeb42[_0xe52c('0x38')],'sentAt':moment(_0x4eeb42[_0xe52c('0x39')])[_0xe52c('0x29')](_0xe52c('0x3a')),'attach':![],'attachments':[]}};if(!_0x4eeb42['html']&&!_0x4eeb42[_0xe52c('0x22')]){var _0x55206f=_[_0xe52c('0x3b')](_0x4eeb42[_0xe52c('0x26')],{'contentType':_0xe52c('0x3c')});if(_0x55206f[_0xe52c('0x11')]){logger[_0xe52c('0x3d')](util[_0xe52c('0x29')](_0xe52c('0x3e'),_0x4eeb42[_0xe52c('0x37')]));tnef[_0xe52c('0x3f')](_['first'](_0x55206f)[_0xe52c('0x2d')],function(_0x1f43ab,_0x427925){if(_0x427925){_0x4eeb42['html']=_0x427925[_0xe52c('0x40')]||_0xe52c('0x41');if(_0x427925[_0xe52c('0x42')]){for(var _0x400ed5=0x0;_0x400ed5<_0x427925[_0xe52c('0x42')]['length'];_0x400ed5++){var _0x235723=_0x427925[_0xe52c('0x42')][_0x400ed5];_0x2e4f3d[_0xe52c('0x24')]['attachments'][_0xe52c('0x1c')]({'filename':_0x235723[_0xe52c('0x43')],'content':Buffer[_0xe52c('0x35')](_0x235723[_0xe52c('0x44')])});}}}_0x10cd00(parseEmail(_0x202793,_0x4eeb42,_0x2e4f3d));});}else{_0x4eeb42[_0xe52c('0x18')]='

Empty\x20message

';_0x10cd00(parseEmail(_0x202793,_0x4eeb42,_0x2e4f3d));}}else{_0x10cd00(parseEmail(_0x202793,_0x4eeb42,_0x2e4f3d));}};exports[_0xe52c('0x45')]=function(_0x84dbc,_0x4a6b9d){var _0x482f56=[_0xe52c('0x46')+(_0x4a6b9d||''),_0xe52c('0x47')+_0x84dbc,'',''];return Buffer[_0xe52c('0x35')](_0x482f56[_0xe52c('0x13')](''),_0xe52c('0x48'))[_0xe52c('0x49')](_0xe52c('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 034fea6..6998f00 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 _0x3847=['Imap','Smtp','exports','name','Service','key','active'];(function(_0x35c74e,_0x3285f6){var _0x1ce8a0=function(_0x225f0f){while(--_0x225f0f){_0x35c74e['push'](_0x35c74e['shift']());}};_0x1ce8a0(++_0x3285f6);}(_0x3847,0x184));var _0x7384=function(_0x53063d,_0x2218a2){_0x53063d=_0x53063d-0x0;var _0xb1a2e5=_0x3847[_0x53063d];return _0xb1a2e5;};'use strict';var _=require('lodash');function MailAccount(_0x1e825f){this['id']=_0x1e825f['id']||0x0;this[_0x7384('0x0')]=_0x1e825f[_0x7384('0x0')]||_0x7384('0x1');this[_0x7384('0x2')]=_0x1e825f['key']||'SERV';this['active']=_0x1e825f[_0x7384('0x3')]||![];this['Imap']=_0x1e825f[_0x7384('0x4')]||[];this[_0x7384('0x5')]=_0x1e825f[_0x7384('0x5')]||[];}module[_0x7384('0x6')]=MailAccount; \ No newline at end of file +var _0x8d06=['key','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0xd3d50c,_0x3f7ac4){var _0x5ab342=function(_0x49a91e){while(--_0x49a91e){_0xd3d50c['push'](_0xd3d50c['shift']());}};_0x5ab342(++_0x3f7ac4);}(_0x8d06,0x1e5));var _0x68d0=function(_0x30c8cc,_0x126ac7){_0x30c8cc=_0x30c8cc-0x0;var _0x3a6afb=_0x8d06[_0x30c8cc];return _0x3a6afb;};'use strict';var _=require(_0x68d0('0x0'));function MailAccount(_0x2738b6){this['id']=_0x2738b6['id']||0x0;this[_0x68d0('0x1')]=_0x2738b6[_0x68d0('0x1')]||_0x68d0('0x2');this[_0x68d0('0x3')]=_0x2738b6['key']||'SERV';this[_0x68d0('0x4')]=_0x2738b6['active']||![];this[_0x68d0('0x5')]=_0x2738b6[_0x68d0('0x5')]||[];this[_0x68d0('0x6')]=_0x2738b6['Smtp']||[];}module[_0x68d0('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index a59aa18..559e1f7 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 _0x5119=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','initMailAccounts','length','isUndefined','merge'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x5119,0x191));var _0x9511=function(_0x4bf8ca,_0x1f6333){_0x4bf8ca=_0x4bf8ca-0x0;var _0x181a12=_0x5119[_0x4bf8ca];return _0x181a12;};'use strict';var _=require(_0x9511('0x0'));var MailAccount=require(_0x9511('0x1'));var Realtime=function(){this[_0x9511('0x2')]={};};function freeIsNotKey(_0x163bea,_0xb02bfb,_0x281256){var _0xa837fc=_[_0x9511('0x3')](_0x163bea,function(_0x27efc8,_0x5886da){return _0x27efc8[_0x281256];});for(var _0x5bf91e in _0xb02bfb){if(_0xb02bfb['hasOwnProperty'](_0x5bf91e)){if(!_0xa837fc[_0x5bf91e]){delete _0xb02bfb[_0x5bf91e];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35bca0,_0x3716c1){for(var _0x3a86b7 in _0x3716c1){if(_0x35bca0[_0x9511('0x4')](_0x3a86b7)){_0x35bca0[_0x3a86b7]=_0x3716c1[_0x3a86b7];}}};Realtime['prototype'][_0x9511('0x5')]=function(){var _0x483958=this;return function(_0x446e80){if(_0x446e80){freeIsNotKey(_0x446e80,_0x483958[_0x9511('0x2')],'id');for(var _0x4b63cd=0x0,_0x4da637={},_0x524252={};_0x4b63cd<_0x446e80[_0x9511('0x6')];_0x4b63cd+=0x1){_0x4da637=_0x446e80[_0x4b63cd];if(_[_0x9511('0x7')](_0x483958[_0x9511('0x2')][_0x4da637['id']])){_0x483958[_0x9511('0x2')][_0x4da637['id']]=new MailAccount(_0x4da637);}else{_[_0x9511('0x8')](_0x483958[_0x9511('0x2')][_0x4da637['id']],_0x4da637);}}}return _0x483958[_0x9511('0x2')];};};module[_0x9511('0x9')]=Realtime; \ No newline at end of file +var _0x7ae8=['lodash','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','merge','exports'];(function(_0x13f54d,_0x4c780a){var _0x501ed0=function(_0x3bf272){while(--_0x3bf272){_0x13f54d['push'](_0x13f54d['shift']());}};_0x501ed0(++_0x4c780a);}(_0x7ae8,0x171));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x87ae('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x39f24c,_0x4b647e,_0x29088d){var _0x4a630f=_[_0x87ae('0x1')](_0x39f24c,function(_0x32f59e,_0x505562){return _0x32f59e[_0x29088d];});for(var _0x2cd880 in _0x4b647e){if(_0x4b647e[_0x87ae('0x2')](_0x2cd880)){if(!_0x4a630f[_0x2cd880]){delete _0x4b647e[_0x2cd880];}}}}Realtime[_0x87ae('0x3')][_0x87ae('0x4')]=function(_0x4aab2e,_0x5ea585){for(var _0x3759be in _0x5ea585){if(_0x4aab2e[_0x87ae('0x2')](_0x3759be)){_0x4aab2e[_0x3759be]=_0x5ea585[_0x3759be];}}};Realtime[_0x87ae('0x3')][_0x87ae('0x5')]=function(){var _0xc006e7=this;return function(_0x574204){if(_0x574204){freeIsNotKey(_0x574204,_0xc006e7[_0x87ae('0x6')],'id');for(var _0x861aa2=0x0,_0x17f7bf={},_0x3b3f9f={};_0x861aa2<_0x574204['length'];_0x861aa2+=0x1){_0x17f7bf=_0x574204[_0x861aa2];if(_['isUndefined'](_0xc006e7[_0x87ae('0x6')][_0x17f7bf['id']])){_0xc006e7[_0x87ae('0x6')][_0x17f7bf['id']]=new MailAccount(_0x17f7bf);}else{_[_0x87ae('0x7')](_0xc006e7[_0x87ae('0x6')][_0x17f7bf['id']],_0x17f7bf);}}}return _0xc006e7[_0x87ae('0x6')];};};module[_0x87ae('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 215dc85..a36a71e 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 _0x4aeb=['getMailAccounts','Request','GetMailAccount','provider','service','email','key','CloudProvider','name','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x34a5c3,_0x1ca84c){var _0x3933ba=function(_0x3595b1){while(--_0x3595b1){_0x34a5c3['push'](_0x34a5c3['shift']());}};_0x3933ba(++_0x1ca84c);}(_0x4aeb,0x131));var _0xb4ae=function(_0x12baa8,_0x43ce92){_0x12baa8=_0x12baa8-0x0;var _0x49e7b7=_0x4aeb[_0x12baa8];return _0x49e7b7;};'use strict';var client=require(_0xb4ae('0x0'));exports[_0xb4ae('0x1')]=function(){return function(){return client[_0xb4ae('0x2')](_0xb4ae('0x3'),{'options':{'attributes':['id','name',_0xb4ae('0x4'),_0xb4ae('0x5'),_0xb4ae('0x6'),'active',_0xb4ae('0x7'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xb4ae('0x8'),'attributes':['id',_0xb4ae('0x9'),'service',_0xb4ae('0xa'),_0xb4ae('0xb')],'as':_0xb4ae('0x8')}]},{'model':_0xb4ae('0xc'),'as':_0xb4ae('0xd'),'include':[{'model':_0xb4ae('0x8'),'attributes':['id',_0xb4ae('0x9'),_0xb4ae('0x5'),_0xb4ae('0xa'),_0xb4ae('0xb')],'as':_0xb4ae('0x8')}]}]},'log':_0xb4ae('0xe')});};};exports[_0xb4ae('0xf')]=function(_0x2084c1,_0x5eadd5){return client[_0xb4ae('0x2')](_0xb4ae('0x10'),{'account':{'id':_0x2084c1},'body':_0x5eadd5,'log':_0xb4ae('0x10')});}; \ No newline at end of file +var _0xb4b6=['getMailAccounts','Request','GetMailAccount','name','provider','service','email','active','key','TemplateId','Imap','CloudProvider','type','MailServerOut','Smtp','data5','getMailAccount','NotifyMailAccount'];(function(_0x422e26,_0xea787b){var _0x60612b=function(_0x19a29a){while(--_0x19a29a){_0x422e26['push'](_0x422e26['shift']());}};_0x60612b(++_0xea787b);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x47e200,_0xdc0d00){_0x47e200=_0x47e200-0x0;var _0xb9e9e4=_0xb4b6[_0x47e200];return _0xb9e9e4;};'use strict';var client=require('../client');exports[_0x6b4b('0x0')]=function(){return function(){return client[_0x6b4b('0x1')](_0x6b4b('0x2'),{'options':{'attributes':['id',_0x6b4b('0x3'),_0x6b4b('0x4'),_0x6b4b('0x5'),_0x6b4b('0x6'),_0x6b4b('0x7'),_0x6b4b('0x8'),'ListId',_0x6b4b('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0x6b4b('0xa'),'include':[{'model':_0x6b4b('0xb'),'attributes':['id',_0x6b4b('0x3'),_0x6b4b('0x5'),_0x6b4b('0xc'),'data5'],'as':_0x6b4b('0xb')}]},{'model':_0x6b4b('0xd'),'as':_0x6b4b('0xe'),'include':[{'model':_0x6b4b('0xb'),'attributes':['id',_0x6b4b('0x3'),_0x6b4b('0x5'),_0x6b4b('0xc'),_0x6b4b('0xf')],'as':'CloudProvider'}]}]},'log':_0x6b4b('0x10')});};};exports['notify']=function(_0x166fbb,_0x2f5ada){return client[_0x6b4b('0x1')](_0x6b4b('0x11'),{'account':{'id':_0x166fbb},'body':_0x2f5ada,'log':_0x6b4b('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index fb4a197..f89b938 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 _0x1c7a=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x48f393,_0x4d877b){var _0xbf408=function(_0x1fcfaa){while(--_0x1fcfaa){_0x48f393['push'](_0x48f393['shift']());}};_0xbf408(++_0x4d877b);}(_0x1c7a,0x8d));var _0xa1c7=function(_0x3b2ee3,_0x506d13){_0x3b2ee3=_0x3b2ee3-0x0;var _0xa32a04=_0x1c7a[_0x3b2ee3];return _0xa32a04;};'use strict';var client=require(_0xa1c7('0x0'));exports[_0xa1c7('0x1')]=function(){return client[_0xa1c7('0x2')](_0xa1c7('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa1c7('0x4')});}; \ No newline at end of file +var _0xbb9b=['Request','ShowSetting','GetSettings','../client','getSettings'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xbb9b,0x175));var _0xbbb9=function(_0x2c64df,_0x29f51b){_0x2c64df=_0x2c64df-0x0;var _0x3108dd=_0xbb9b[_0x2c64df];return _0x3108dd;};'use strict';var client=require(_0xbbb9('0x0'));exports[_0xbbb9('0x1')]=function(){return client[_0xbbb9('0x2')](_0xbbb9('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xbbb9('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 13ea64d..93b4202 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 53a019d..ea63851 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 _0x9072=['exports','lodash','express','sticky-session','../../config/environment','listen','port','socket.io','websocket','polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x5f5089,_0x154e1b){var _0x1d55ac=function(_0x493aaf){while(--_0x493aaf){_0x5f5089['push'](_0x5f5089['shift']());}};_0x1d55ac(++_0x154e1b);}(_0x9072,0x1a3));var _0x2907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9072[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2907('0x0'));var http=require('http');var express=require(_0x2907('0x1'));var sticky=require(_0x2907('0x2'));var Redis=require('ioredis');var config=require(_0x2907('0x3'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0x2907('0x4')](server,config[_0x2907('0x5')])){var socketio=require(_0x2907('0x6'))(server,{'transports':[_0x2907('0x7'),_0x2907('0x8')]});config[_0x2907('0x9')]=_[_0x2907('0xa')](config[_0x2907('0x9')],{'host':'localhost','port':0x18eb});socketio[_0x2907('0xb')](require(_0x2907('0xc'))({'pubClient':new Redis(config[_0x2907('0x9')]),'subClient':new Redis(config[_0x2907('0x9')])}));require(_0x2907('0xd'))[_0x2907('0xe')]();require(_0x2907('0xf'))[_0x2907('0xe')](socketio);require(_0x2907('0x10'))[_0x2907('0xe')](app);require(_0x2907('0x11'))[_0x2907('0xe')](app);}else{server[_0x2907('0x12')](_0x2907('0x13'),function(){console['log'](_0x2907('0x14'),config[_0x2907('0x5')]);});}exports=module[_0x2907('0x15')]=app; \ No newline at end of file +var _0x4638=['listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','port','socket.io','websocket','redis','defaults','adapter','socket.io-redis','../../config/socketio','default','../../config/express','once'];(function(_0x208cb8,_0x32d5a9){var _0x2efd74=function(_0x5bb6e4){while(--_0x5bb6e4){_0x208cb8['push'](_0x208cb8['shift']());}};_0x2efd74(++_0x32d5a9);}(_0x4638,0x1e6));var _0x8463=function(_0x5a288e,_0x3a6972){_0x5a288e=_0x5a288e-0x0;var _0x15afcb=_0x4638[_0x5a288e];return _0x15afcb;};'use strict';var _=require(_0x8463('0x0'));var http=require(_0x8463('0x1'));var express=require(_0x8463('0x2'));var sticky=require(_0x8463('0x3'));var Redis=require(_0x8463('0x4'));var config=require(_0x8463('0x5'));var app=express();var server=http[_0x8463('0x6')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x8463('0x7')])){var socketio=require(_0x8463('0x8'))(server,{'transports':[_0x8463('0x9'),'polling']});config[_0x8463('0xa')]=_[_0x8463('0xb')](config[_0x8463('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x8463('0xc')](require(_0x8463('0xd'))({'pubClient':new Redis(config[_0x8463('0xa')]),'subClient':new Redis(config[_0x8463('0xa')])}));require('../../config/triggers')['default']();require(_0x8463('0xe'))[_0x8463('0xf')](socketio);require(_0x8463('0x10'))[_0x8463('0xf')](app);require('../../routes')[_0x8463('0xf')](app);}else{server[_0x8463('0x11')](_0x8463('0x12'),function(){console['log'](_0x8463('0x13'),config['port']);});}exports=module[_0x8463('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fcc45af..d0c4979 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 _0xe251=['request','debug','error','rpc','message','result','catch','exports','jayson/promise','../../config/logger','routing','Request'];(function(_0x1c3c80,_0x5be85a){var _0x1454d4=function(_0x2845eb){while(--_0x2845eb){_0x1c3c80['push'](_0x1c3c80['shift']());}};_0x1454d4(++_0x5be85a);}(_0xe251,0x80));var _0x1e25=function(_0x17e88d,_0x5330f7){_0x17e88d=_0x17e88d-0x0;var _0x52137a=_0xe251[_0x17e88d];return _0x52137a;};'use strict';var jayson=require(_0x1e25('0x0'));var BPromise=require('bluebird');var logger=require(_0x1e25('0x1'))(_0x1e25('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x1e25('0x3')]=function(_0x552b85,_0x3d483c){return new BPromise(function(_0x9cbca6,_0x4d8dd8){return client[_0x1e25('0x4')](_0x552b85,_0x3d483c)['then'](function(_0x238191){logger[_0x1e25('0x5')]('rpc','routing',_0x552b85,_0x3d483c,_0x238191);if(_0x238191[_0x1e25('0x6')]){logger[_0x1e25('0x6')](_0x1e25('0x7'),_0x1e25('0x2'),_0x552b85,_0x238191['error'][_0x1e25('0x8')],_0x3d483c);return _0x4d8dd8(_0x238191[_0x1e25('0x6')]['message']);}else{return _0x9cbca6(_0x238191[_0x1e25('0x9')]);}})[_0x1e25('0xa')](function(_0x3cb97a){logger[_0x1e25('0x6')](_0x1e25('0x7'),_0x1e25('0x2'),_0x552b85,_0x3cb97a,_0x3d483c);return _0x4d8dd8(_0x3cb97a);});});};module[_0x1e25('0xb')]=client; \ No newline at end of file +var _0x1a2a=['then','debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x3b7239,_0x32c10c){var _0xf6230e=function(_0x36eb82){while(--_0x36eb82){_0x3b7239['push'](_0x3b7239['shift']());}};_0xf6230e(++_0x32c10c);}(_0x1a2a,0x116));var _0xa1a2=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0x1a2a[_0x4da28f];return _0xe49192;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa1a2('0x0'));var logger=require(_0xa1a2('0x1'))(_0xa1a2('0x2'));var client=jayson[_0xa1a2('0x3')][_0xa1a2('0x4')]({'port':0x2329});client[_0xa1a2('0x5')]=function(_0x5cc049,_0x440b95){return new BPromise(function(_0x5e5671,_0x3da215){return client[_0xa1a2('0x6')](_0x5cc049,_0x440b95)[_0xa1a2('0x7')](function(_0x5e6bfa){logger[_0xa1a2('0x8')](_0xa1a2('0x9'),_0xa1a2('0x2'),_0x5cc049,_0x440b95,_0x5e6bfa);if(_0x5e6bfa[_0xa1a2('0xa')]){logger[_0xa1a2('0xa')](_0xa1a2('0x9'),_0xa1a2('0x2'),_0x5cc049,_0x5e6bfa['error'][_0xa1a2('0xb')],_0x440b95);return _0x3da215(_0x5e6bfa[_0xa1a2('0xa')][_0xa1a2('0xb')]);}else{return _0x5e5671(_0x5e6bfa[_0xa1a2('0xc')]);}})[_0xa1a2('0xd')](function(_0xd656bf){logger[_0xa1a2('0xa')]('rpc','routing',_0x5cc049,_0xd656bf,_0x440b95);return _0x3da215(_0xd656bf);});});};module[_0xa1a2('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 181a796..40725bf 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 _0x232e=['getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues'];(function(_0x55477e,_0x286dea){var _0x58b303=function(_0x294bb3){while(--_0x294bb3){_0x55477e['push'](_0x55477e['shift']());}};_0x58b303(++_0x286dea);}(_0x232e,0x190));var _0xe232=function(_0x119549,_0x8ac874){_0x119549=_0x119549-0x0;var _0x22debd=_0x232e[_0x119549];return _0x22debd;};'use strict';var BPromise=require(_0xe232('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0xe232('0x1'));var interval=require(_0xe232('0x2'));var openchannelQueue=require(_0xe232('0x3'));var chatQueue=require(_0xe232('0x4'));var smsQueue=require(_0xe232('0x5'));var mailQueue=require(_0xe232('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xe232('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe232('0x8')]()[_0xe232('0x9')](user[_0xe232('0xa')]())[_0xe232('0x9')](realtime[_0xe232('0xb')]())[_0xe232('0x9')](interval[_0xe232('0xc')]())[_0xe232('0x9')](realtime[_0xe232('0xd')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xe232('0x9')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xe232('0xe')]())[_0xe232('0x9')](realtime[_0xe232('0xf')]())[_0xe232('0x9')](smsQueue[_0xe232('0x10')]())[_0xe232('0x9')](realtime[_0xe232('0x11')]())[_0xe232('0x9')](mailQueue[_0xe232('0x12')]())['then'](realtime[_0xe232('0x13')]())[_0xe232('0x9')](faxQueue[_0xe232('0x14')]())['then'](realtime[_0xe232('0x15')]())[_0xe232('0x9')](whatsappQueue[_0xe232('0x16')]())[_0xe232('0x9')](realtime[_0xe232('0x17')]())[_0xe232('0x9')](function(){return realtime;});}function main(){return server[_0xe232('0x18')](realtime)[_0xe232('0x9')](function(_0x59cf02){return initRealtime();})[_0xe232('0x9')](function(_0x43ce6e){return setInterval(initRealtime,0x1388);})[_0xe232('0x19')](function(_0x1208d3){console['log'](_0x1208d3);});}main(); \ No newline at end of file +var _0x796b=['initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x796b,0x158));var _0xb796=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x796b[_0x238671];return _0x474844;};'use strict';var BPromise=require('bluebird');var server=require(_0xb796('0x0'));var Realtime=require(_0xb796('0x1'));var user=require(_0xb796('0x2'));var interval=require(_0xb796('0x3'));var openchannelQueue=require(_0xb796('0x4'));var chatQueue=require(_0xb796('0x5'));var smsQueue=require(_0xb796('0x6'));var mailQueue=require(_0xb796('0x7'));var faxQueue=require(_0xb796('0x8'));var whatsappQueue=require(_0xb796('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xb796('0xa')](user[_0xb796('0xb')]())[_0xb796('0xa')](realtime[_0xb796('0xc')]())[_0xb796('0xa')](interval['getIntervals']())[_0xb796('0xa')](realtime['initIntervals']())['then'](openchannelQueue[_0xb796('0xd')]())['then'](realtime[_0xb796('0xe')]())[_0xb796('0xa')](chatQueue[_0xb796('0xf')]())[_0xb796('0xa')](realtime['initChatQueues']())[_0xb796('0xa')](smsQueue[_0xb796('0x10')]())[_0xb796('0xa')](realtime[_0xb796('0x11')]())[_0xb796('0xa')](mailQueue[_0xb796('0x12')]())[_0xb796('0xa')](realtime['initMailQueues']())['then'](faxQueue[_0xb796('0x13')]())[_0xb796('0xa')](realtime[_0xb796('0x14')]())['then'](whatsappQueue[_0xb796('0x15')]())[_0xb796('0xa')](realtime[_0xb796('0x16')]())[_0xb796('0xa')](function(){return realtime;});}function main(){return server[_0xb796('0x17')](realtime)[_0xb796('0xa')](function(_0x3210ed){return initRealtime();})[_0xb796('0xa')](function(_0x19e706){return setInterval(initRealtime,0x1388);})[_0xb796('0x18')](function(_0x401955){console[_0xb796('0x19')](_0x401955);});}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 2d60c5f..fa381ae 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x1bcf14,_0xca5f9f){var _0x484f33=function(_0x43557f){while(--_0x43557f){_0x1bcf14['push'](_0x1bcf14['shift']());}};_0x484f33(++_0xca5f9f);}(_0xe14b,0x93));var _0xbe14=function(_0x4a3714,_0x4fdce9){_0x4a3714=_0x4a3714-0x0;var _0x16dea7=_0xe14b[_0x4a3714];return _0x16dea7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0x1261[_0x39010b];return _0x3d8797;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2fda61d..d87c01c 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 _0x4b09=['jayson/promise','http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b09,0x9f));var _0x94b0=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x4b09[_0x3203a1];return _0x24215e;};'use strict';var BPromise=require(_0x94b0('0x0'));var jayson=require(_0x94b0('0x1'));var client=jayson['client'][_0x94b0('0x2')]({'port':0x232b});function request(_0x3283ea,_0x2cddd8){return new BPromise(function(_0x9a978,_0x52ce74){return client[_0x94b0('0x3')](_0x3283ea,_0x2cddd8)['then'](function(_0x4cb59b){if(_0x4cb59b[_0x94b0('0x4')]){return _0x52ce74(_0x4cb59b['error'][_0x94b0('0x5')]);}else{return _0x9a978(_0x4cb59b[_0x94b0('0x6')]);}})[_0x94b0('0x7')](function(_0xfca65e){return _0x52ce74(_0xfca65e);});});}exports[_0x94b0('0x8')]=function(_0x59ea3c,_0x3d0fe1){return request(_0x94b0('0x9'),{'account':_0x59ea3c,'message':_0x3d0fe1});}; \ No newline at end of file +var _0x0cfc=['sendMailMessage','SendMail','bluebird','client','http','request','then','message','result','catch'];(function(_0x2be947,_0x37cdd9){var _0x103ff0=function(_0x189212){while(--_0x189212){_0x2be947['push'](_0x2be947['shift']());}};_0x103ff0(++_0x37cdd9);}(_0x0cfc,0x1ec));var _0xc0cf=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0cfc[_0x46698a];return _0x356db0;};'use strict';var BPromise=require(_0xc0cf('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xc0cf('0x1')][_0xc0cf('0x2')]({'port':0x232b});function request(_0x26787b,_0x26346e){return new BPromise(function(_0x100e64,_0xbf82ef){return client[_0xc0cf('0x3')](_0x26787b,_0x26346e)[_0xc0cf('0x4')](function(_0x55eccd){if(_0x55eccd['error']){return _0xbf82ef(_0x55eccd['error'][_0xc0cf('0x5')]);}else{return _0x100e64(_0x55eccd[_0xc0cf('0x6')]);}})[_0xc0cf('0x7')](function(_0x5743c){return _0xbf82ef(_0x5743c);});});}exports[_0xc0cf('0x8')]=function(_0x44f29d,_0x373de2){return request(_0xc0cf('0x9'),{'account':_0x44f29d,'message':_0x373de2});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 916d98f..802f7ec 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 _0xaa92=['mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatusTime','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','toNumber','format','mailPause','faxStatus','faxStatusTime','smsStatus','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','stringify','emit','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus'];(function(_0x2497e4,_0x5bec2b){var _0xb988a=function(_0x2b463f){while(--_0x2b463f){_0x2497e4['push'](_0x2497e4['shift']());}};_0xb988a(++_0x5bec2b);}(_0xaa92,0x166));var _0x2aa9=function(_0x203d64,_0x1ec79c){_0x203d64=_0x203d64-0x0;var _0x462ab3=_0xaa92[_0x203d64];return _0x462ab3;};'use strict';var _=require(_0x2aa9('0x0'));var moment=require('moment');var md5=require(_0x2aa9('0x1'));var Redis=require(_0x2aa9('0x2'));var config=require('../../../config/environment');config[_0x2aa9('0x3')]=_[_0x2aa9('0x4')](config[_0x2aa9('0x3')],{'host':_0x2aa9('0x5'),'port':0x18eb});var io=require(_0x2aa9('0x6'))(new Redis(config[_0x2aa9('0x3')]));function Agent(_0x3d7c6d){this['id']=_0x3d7c6d['id']||0x0;this[_0x2aa9('0x7')]=_0x3d7c6d['name']||'';this[_0x2aa9('0x8')]=_0x3d7c6d['online']||!![];this['voicePause']=_0x3d7c6d[_0x2aa9('0x9')]||![];this[_0x2aa9('0xa')]=_0x3d7c6d[_0x2aa9('0xa')]||![];this['mailPause']=_0x3d7c6d['mailPause']||![];this[_0x2aa9('0xb')]=_0x3d7c6d[_0x2aa9('0xb')]||![];this[_0x2aa9('0xc')]=_0x3d7c6d['smsPause']||![];this['openchannelPause']=_0x3d7c6d[_0x2aa9('0xd')]||![];this[_0x2aa9('0xe')]=_0x2aa9('0xf');this[_0x2aa9('0x10')]=0x0;this[_0x2aa9('0x11')]=_0x3d7c6d['chatCapacity']||0x0;this[_0x2aa9('0x12')]=0x0;this[_0x2aa9('0x13')]=_0x2aa9('0xf');this[_0x2aa9('0x14')]=0x0;this[_0x2aa9('0x15')]=_0x3d7c6d[_0x2aa9('0x15')]||0x0;this[_0x2aa9('0x16')]=0x0;this['faxStatus']=_0x2aa9('0xf');this['faxStatusTime']=0x0;this[_0x2aa9('0x17')]=_0x3d7c6d['faxCapacity']||0x0;this[_0x2aa9('0x18')]=0x0;this['smsStatus']=_0x2aa9('0xf');this[_0x2aa9('0x19')]=0x0;this[_0x2aa9('0x1a')]=_0x3d7c6d['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x2aa9('0x1b')]=0x0;this['whatsappCapacity']=_0x3d7c6d['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x2aa9('0x1c')]=_0x2aa9('0xf');this[_0x2aa9('0x1d')]=0x0;this['openchannelCapacity']=_0x3d7c6d[_0x2aa9('0x1e')]||0x0;this[_0x2aa9('0x1f')]=0x0;this[_0x2aa9('0x20')]=![];this[_0x2aa9('0x21')]=undefined;this[_0x2aa9('0x1')]='';this[_0x2aa9('0x22')]();}Agent[_0x2aa9('0x23')]['getChannelStatus']=function(_0x427056){if(this[_0x427056+'CurrentCapacity']>0x0){if(this[_0x427056+_0x2aa9('0x24')]>0x0&&this[_0x427056+_0x2aa9('0x25')]>=this[_0x427056+'Capacity']){return _0x2aa9('0x26');}else{return _0x2aa9('0x27');}}else{return _0x2aa9('0x28');}};Agent[_0x2aa9('0x23')]['updateRealtime']=function(){var _0x14fcdf=[_0x2aa9('0x29'),_0x2aa9('0x2a'),_0x2aa9('0x2b'),_0x2aa9('0x2c'),_0x2aa9('0x2d'),_0x2aa9('0x2e')];for(var _0x1cb6b4=0x0;_0x1cb6b4<_0x14fcdf[_0x2aa9('0x2f')];_0x1cb6b4+=0x1){var _0x4a3382=this[_0x2aa9('0x30')](_0x14fcdf[_0x1cb6b4]);if(this[_0x14fcdf[_0x1cb6b4]+_0x2aa9('0x31')]!==_0x4a3382){this[_0x14fcdf[_0x1cb6b4]+'StatusTime']=_[_0x2aa9('0x32')](moment()[_0x2aa9('0x33')]('x'));}this[_0x14fcdf[_0x1cb6b4]+'Status']=_0x4a3382;}var _0x2028d2={'id':this['id'],'name':this[_0x2aa9('0x7')],'online':this[_0x2aa9('0x8')],'voicePause':this[_0x2aa9('0x9')],'chatPause':this[_0x2aa9('0xa')],'mailPause':this[_0x2aa9('0x34')],'smsPause':this['smsPause'],'faxPause':this[_0x2aa9('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x2aa9('0xe')],'chatStatusTime':this[_0x2aa9('0x10')],'chatCapacity':this[_0x2aa9('0x11')],'chatCurrentCapacity':this[_0x2aa9('0x12')],'mailStatus':this[_0x2aa9('0x13')],'mailStatusTime':this[_0x2aa9('0x14')],'mailCapacity':this[_0x2aa9('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x2aa9('0x35')],'faxStatusTime':this[_0x2aa9('0x36')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x2aa9('0x18')],'smsStatus':this[_0x2aa9('0x37')],'smsStatusTime':this[_0x2aa9('0x19')],'smsCapacity':this[_0x2aa9('0x1a')],'smsCurrentCapacity':this[_0x2aa9('0x38')],'whatsappStatus':this[_0x2aa9('0x39')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x2aa9('0x3a')],'whatsappCurrentCapacity':this[_0x2aa9('0x3b')],'openchannelStatus':this[_0x2aa9('0x1c')],'openchannelStatusTime':this[_0x2aa9('0x1d')],'openchannelCapacity':this[_0x2aa9('0x1e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x47e2f7=md5(JSON[_0x2aa9('0x3c')](_0x2028d2));if(this['md5']!==_0x47e2f7){this[_0x2aa9('0x1')]=_0x47e2f7;io[_0x2aa9('0x3d')]('user:save',_0x2028d2);}};module[_0x2aa9('0x3e')]=Agent; \ No newline at end of file +var _0x4797=['openchannel','length','toNumber','format','Status','mailStatus','faxCurrentCapacity','smsStatus','whatsappStatusTime','openchannelStatus','emit','user:save','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','prototype','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4797,0x150));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x7479('0x0'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x7479('0x1'));config[_0x7479('0x2')]=_[_0x7479('0x3')](config[_0x7479('0x2')],{'host':_0x7479('0x4'),'port':0x18eb});var io=require(_0x7479('0x5'))(new Redis(config[_0x7479('0x2')]));function Agent(_0x5a26db){this['id']=_0x5a26db['id']||0x0;this[_0x7479('0x6')]=_0x5a26db[_0x7479('0x6')]||'';this[_0x7479('0x7')]=_0x5a26db[_0x7479('0x7')]||!![];this[_0x7479('0x8')]=_0x5a26db[_0x7479('0x8')]||![];this[_0x7479('0x9')]=_0x5a26db[_0x7479('0x9')]||![];this['mailPause']=_0x5a26db[_0x7479('0xa')]||![];this[_0x7479('0xb')]=_0x5a26db[_0x7479('0xb')]||![];this['smsPause']=_0x5a26db[_0x7479('0xc')]||![];this[_0x7479('0xd')]=_0x5a26db[_0x7479('0xd')]||![];this[_0x7479('0xe')]=_0x7479('0xf');this[_0x7479('0x10')]=0x0;this[_0x7479('0x11')]=_0x5a26db[_0x7479('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x7479('0xf');this[_0x7479('0x12')]=0x0;this['mailCapacity']=_0x5a26db[_0x7479('0x13')]||0x0;this[_0x7479('0x14')]=0x0;this[_0x7479('0x15')]=_0x7479('0xf');this[_0x7479('0x16')]=0x0;this[_0x7479('0x17')]=_0x5a26db[_0x7479('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0x7479('0xf');this[_0x7479('0x18')]=0x0;this['smsCapacity']=_0x5a26db[_0x7479('0x19')]||0x0;this[_0x7479('0x1a')]=0x0;this['whatsappStatus']=_0x7479('0xf');this['whatsappStatusTime']=0x0;this[_0x7479('0x1b')]=_0x5a26db['whatsappCapacity']||0x0;this[_0x7479('0x1c')]=0x0;this['openchannelStatus']=_0x7479('0xf');this[_0x7479('0x1d')]=0x0;this[_0x7479('0x1e')]=_0x5a26db[_0x7479('0x1e')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x7479('0x1f')]=![];this[_0x7479('0x20')]=undefined;this[_0x7479('0x21')]='';this['updateRealtime']();}Agent[_0x7479('0x22')]['getChannelStatus']=function(_0x207c6b){if(this[_0x207c6b+'CurrentCapacity']>0x0){if(this[_0x207c6b+_0x7479('0x23')]>0x0&&this[_0x207c6b+_0x7479('0x24')]>=this[_0x207c6b+_0x7479('0x23')]){return _0x7479('0x25');}else{return _0x7479('0x26');}}else{return _0x7479('0x27');}};Agent[_0x7479('0x22')]['updateRealtime']=function(){var _0x3a6032=[_0x7479('0x28'),_0x7479('0x29'),_0x7479('0x2a'),'fax','sms','whatsapp'];for(var _0x23b931=0x0;_0x23b931<_0x3a6032[_0x7479('0x2b')];_0x23b931+=0x1){var _0x59f118=this['getChannelStatus'](_0x3a6032[_0x23b931]);if(this[_0x3a6032[_0x23b931]+'Status']!==_0x59f118){this[_0x3a6032[_0x23b931]+'StatusTime']=_[_0x7479('0x2c')](moment()[_0x7479('0x2d')]('x'));}this[_0x3a6032[_0x23b931]+_0x7479('0x2e')]=_0x59f118;}var _0x2f8138={'id':this['id'],'name':this['name'],'online':this[_0x7479('0x7')],'voicePause':this[_0x7479('0x8')],'chatPause':this[_0x7479('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x7479('0xc')],'faxPause':this[_0x7479('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x7479('0xe')],'chatStatusTime':this[_0x7479('0x10')],'chatCapacity':this[_0x7479('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x7479('0x2f')],'mailStatusTime':this[_0x7479('0x12')],'mailCapacity':this[_0x7479('0x13')],'mailCurrentCapacity':this[_0x7479('0x14')],'faxStatus':this[_0x7479('0x15')],'faxStatusTime':this[_0x7479('0x16')],'faxCapacity':this[_0x7479('0x17')],'faxCurrentCapacity':this[_0x7479('0x30')],'smsStatus':this[_0x7479('0x31')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7479('0x19')],'smsCurrentCapacity':this[_0x7479('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x7479('0x32')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x7479('0x33')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x7479('0x1e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x7479('0x20')]};var _0x54b07e=md5(JSON['stringify'](_0x2f8138));if(this[_0x7479('0x21')]!==_0x54b07e){this['md5']=_0x54b07e;io[_0x7479('0x34')](_0x7479('0x35'),_0x2f8138);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d43b0a5..85953f8 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 _0x43cc=['online','chatPause','paused','available','name','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length'];(function(_0x3cf030,_0x3e95a0){var _0x8461ec=function(_0x13648f){while(--_0x13648f){_0x3cf030['push'](_0x3cf030['shift']());}};_0x8461ec(++_0x3e95a0);}(_0x43cc,0x14b));var _0xc43c=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x43cc[_0xdaab62];return _0x13d767;};'use strict';var _=require(_0xc43c('0x0'));var md5=require(_0xc43c('0x1'));var util=require(_0xc43c('0x2'));var Redis=require('ioredis');var config=require(_0xc43c('0x3'));config[_0xc43c('0x4')]=_['defaults'](config[_0xc43c('0x4')],{'host':_0xc43c('0x5'),'port':0x18eb});var io=require(_0xc43c('0x6'))(new Redis(config[_0xc43c('0x4')]));function ChatQueue(_0x3ab4c2){this['id']=_0x3ab4c2['id']||0x0;this['name']=_0x3ab4c2['name']||'';this[_0xc43c('0x7')]=_0x3ab4c2[_0xc43c('0x7')]||0xa;this['strategy']=_0x3ab4c2[_0xc43c('0x8')]||_0xc43c('0x9');this[_0xc43c('0xa')]=_0x3ab4c2['Agents'];this[_0xc43c('0xb')]={};this[_0xc43c('0xc')]=0x0;this[_0xc43c('0x1')]='';this[_0xc43c('0xd')]();this[_0xc43c('0xe')]();}ChatQueue[_0xc43c('0xf')][_0xc43c('0xd')]=function(){var _0x5ccbf3=this[_0xc43c('0xb')]['_rr'];this[_0xc43c('0xb')]=_[_0xc43c('0x10')](this[_0xc43c('0xa')],'id');this[_0xc43c('0xb')][_0xc43c('0x11')]=_0x5ccbf3;};ChatQueue[_0xc43c('0xf')][_0xc43c('0xe')]=function(){this[_0xc43c('0x12')]=0x0;this['paused']=0x0;for(var _0x3050c3=0x0;_0x3050c3=0x0?this[_0xc43c('0x17')]:0x0;var _0x55aa9c={'id':this['id'],'available':this[_0xc43c('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xc43c('0x18')],'paused':this['paused'],'waiting':this[_0xc43c('0xc')]};var _0x23fa8c=md5(JSON['stringify'](_0x55aa9c));if(this[_0xc43c('0x1')]!==_0x23fa8c){this['md5']=_0x23fa8c;io['to'](util['format']('chat:queue:%s',_0x55aa9c[_0xc43c('0x18')]))['emit'](_0xc43c('0x19'),_0x55aa9c);}};module[_0xc43c('0x1a')]=ChatQueue; \ No newline at end of file +var _0x24dd=['util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5'];(function(_0x3bd003,_0x4b3dda){var _0x36d652=function(_0x27fbc7){while(--_0x27fbc7){_0x3bd003['push'](_0x3bd003['shift']());}};_0x36d652(++_0x4b3dda);}(_0x24dd,0xac));var _0xd24d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x24dd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd24d('0x0'));var md5=require(_0xd24d('0x1'));var util=require(_0xd24d('0x2'));var Redis=require(_0xd24d('0x3'));var config=require(_0xd24d('0x4'));config[_0xd24d('0x5')]=_[_0xd24d('0x6')](config[_0xd24d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x5b8ac7){this['id']=_0x5b8ac7['id']||0x0;this[_0xd24d('0x7')]=_0x5b8ac7['name']||'';this[_0xd24d('0x8')]=_0x5b8ac7[_0xd24d('0x8')]||0xa;this[_0xd24d('0x9')]=_0x5b8ac7[_0xd24d('0x9')]||'beepall';this[_0xd24d('0xa')]=_0x5b8ac7[_0xd24d('0xa')];this[_0xd24d('0xb')]={};this[_0xd24d('0xc')]=0x0;this[_0xd24d('0x1')]='';this[_0xd24d('0xd')]();this[_0xd24d('0xe')]();}ChatQueue[_0xd24d('0xf')]['updateRouting']=function(){var _0x462108=this[_0xd24d('0xb')][_0xd24d('0x10')];this['mapAgentsId']=_[_0xd24d('0x11')](this[_0xd24d('0xa')],'id');this['mapAgentsId'][_0xd24d('0x10')]=_0x462108;};ChatQueue[_0xd24d('0xf')][_0xd24d('0xe')]=function(){this[_0xd24d('0x12')]=0x0;this[_0xd24d('0x13')]=0x0;for(var _0x5a3cfb=0x0;_0x5a3cfb=0x0?this[_0xd24d('0x17')]:0x0;var _0x1013fd={'id':this['id'],'available':this[_0xd24d('0x17')],'loggedIn':this[_0xd24d('0x12')],'name':this[_0xd24d('0x7')],'paused':this[_0xd24d('0x13')],'waiting':this[_0xd24d('0xc')]};var _0x1437b1=md5(JSON[_0xd24d('0x18')](_0x1013fd));if(this[_0xd24d('0x1')]!==_0x1437b1){this[_0xd24d('0x1')]=_0x1437b1;io['to'](util[_0xd24d('0x19')](_0xd24d('0x1a'),_0x1013fd[_0xd24d('0x7')]))[_0xd24d('0x1b')](_0xd24d('0x1c'),_0x1013fd);}};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 d3c8476..35ed040 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 _0x49dd=['available','loggedIn','stringify','fax:queue:%s','fax_queue:save','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','paused','length','online'];(function(_0x3fb181,_0x50da95){var _0x10cc65=function(_0x165b9c){while(--_0x165b9c){_0x3fb181['push'](_0x3fb181['shift']());}};_0x10cc65(++_0x50da95);}(_0x49dd,0xdd));var _0xd49d=function(_0x136cd1,_0x28434e){_0x136cd1=_0x136cd1-0x0;var _0x47b3c2=_0x49dd[_0x136cd1];return _0x47b3c2;};'use strict';var _=require('lodash');var md5=require(_0xd49d('0x0'));var util=require(_0xd49d('0x1'));var Redis=require(_0xd49d('0x2'));var config=require('../../../config/environment');config[_0xd49d('0x3')]=_[_0xd49d('0x4')](config[_0xd49d('0x3')],{'host':_0xd49d('0x5'),'port':0x18eb});var io=require(_0xd49d('0x6'))(new Redis(config[_0xd49d('0x3')]));function FaxQueue(_0x5a742c){this['id']=_0x5a742c['id']||0x0;this[_0xd49d('0x7')]=_0x5a742c[_0xd49d('0x7')]||'';this['timeout']=_0x5a742c[_0xd49d('0x8')]||0xa;this[_0xd49d('0x9')]=_0x5a742c['strategy']||_0xd49d('0xa');this['Agents']=_0x5a742c['Agents'];this['mapAgentsId']={};this[_0xd49d('0xb')]=0x0;this['md5']='';this[_0xd49d('0xc')]();this[_0xd49d('0xd')]();}FaxQueue['prototype'][_0xd49d('0xc')]=function(){var _0x5ab101=this[_0xd49d('0xe')][_0xd49d('0xf')];this[_0xd49d('0xe')]=_[_0xd49d('0x10')](this[_0xd49d('0x11')],'id');this['mapAgentsId']['_rr']=_0x5ab101;};FaxQueue[_0xd49d('0x12')][_0xd49d('0xd')]=function(){this['loggedIn']=0x0;this[_0xd49d('0x13')]=0x0;for(var _0x22312f=0x0;_0x22312f=0x0?this['available']:0x0;var _0x24b75d={'id':this['id'],'available':this[_0xd49d('0x16')],'loggedIn':this[_0xd49d('0x17')],'name':this[_0xd49d('0x7')],'paused':this[_0xd49d('0x13')],'waiting':this[_0xd49d('0xb')]};var _0x3ae597=md5(JSON[_0xd49d('0x18')](_0x24b75d));if(this[_0xd49d('0x0')]!==_0x3ae597){this[_0xd49d('0x0')]=_0x3ae597;io['to'](util['format'](_0xd49d('0x19'),_0x24b75d[_0xd49d('0x7')]))['emit'](_0xd49d('0x1a'),_0x24b75d);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xce3e=['length','online','loggedIn','available','paused','waiting','stringify','format','fax:queue:%s','name','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xce3e,0x12d));var _0xece3=function(_0x499236,_0x23203e){_0x499236=_0x499236-0x0;var _0x365731=_0xce3e[_0x499236];return _0x365731;};'use strict';var _=require(_0xece3('0x0'));var md5=require(_0xece3('0x1'));var util=require(_0xece3('0x2'));var Redis=require(_0xece3('0x3'));var config=require(_0xece3('0x4'));config[_0xece3('0x5')]=_[_0xece3('0x6')](config[_0xece3('0x5')],{'host':_0xece3('0x7'),'port':0x18eb});var io=require(_0xece3('0x8'))(new Redis(config[_0xece3('0x5')]));function FaxQueue(_0x24d1af){this['id']=_0x24d1af['id']||0x0;this['name']=_0x24d1af['name']||'';this[_0xece3('0x9')]=_0x24d1af[_0xece3('0x9')]||0xa;this[_0xece3('0xa')]=_0x24d1af[_0xece3('0xa')]||_0xece3('0xb');this['Agents']=_0x24d1af[_0xece3('0xc')];this[_0xece3('0xd')]={};this['waiting']=0x0;this[_0xece3('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xece3('0xe')]=function(){var _0x24f947=this['mapAgentsId'][_0xece3('0xf')];this['mapAgentsId']=_[_0xece3('0x10')](this[_0xece3('0xc')],'id');this[_0xece3('0xd')][_0xece3('0xf')]=_0x24f947;};FaxQueue[_0xece3('0x11')][_0xece3('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x46d79f=0x0;_0x46d79f=0x0?this[_0xece3('0x16')]:0x0;var _0x51929a={'id':this['id'],'available':this[_0xece3('0x16')],'loggedIn':this[_0xece3('0x15')],'name':this['name'],'paused':this[_0xece3('0x17')],'waiting':this[_0xece3('0x18')]};var _0x12c69c=md5(JSON[_0xece3('0x19')](_0x51929a));if(this['md5']!==_0x12c69c){this['md5']=_0x12c69c;io['to'](util[_0xece3('0x1a')](_0xece3('0x1b'),_0x51929a[_0xece3('0x1c')]))[_0xece3('0x1d')](_0xece3('0x1e'),_0x51929a);}};module[_0xece3('0x1f')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1cecc0c..ae1feb1 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 _0xf57c=['name','Intervals','exports'];(function(_0x375b29,_0x49e46f){var _0x36a4b0=function(_0x27fd4f){while(--_0x27fd4f){_0x375b29['push'](_0x375b29['shift']());}};_0x36a4b0(++_0x49e46f);}(_0xf57c,0x126));var _0xcf57=function(_0xe4ee1e,_0xea8b9b){_0xe4ee1e=_0xe4ee1e-0x0;var _0x22f903=_0xf57c[_0xe4ee1e];return _0x22f903;};'use strict';function Interval(_0x3a3a76){this['id']=_0x3a3a76['id']||0x0;this[_0xcf57('0x0')]=_0x3a3a76[_0xcf57('0x0')]||'';this[_0xcf57('0x1')]=_0x3a3a76[_0xcf57('0x1')]||{};}module[_0xcf57('0x2')]=Interval; \ No newline at end of file +var _0xed83=['Intervals','exports','name'];(function(_0x357a02,_0x37268d){var _0x3b8b4d=function(_0x1c6f5b){while(--_0x1c6f5b){_0x357a02['push'](_0x357a02['shift']());}};_0x3b8b4d(++_0x37268d);}(_0xed83,0x18e));var _0x3ed8=function(_0x18bb67,_0x5eff3d){_0x18bb67=_0x18bb67-0x0;var _0x149f9a=_0xed83[_0x18bb67];return _0x149f9a;};'use strict';function Interval(_0x32a9b8){this['id']=_0x32a9b8['id']||0x0;this[_0x3ed8('0x0')]=_0x32a9b8[_0x3ed8('0x0')]||'';this[_0x3ed8('0x1')]=_0x32a9b8['Intervals']||{};}module[_0x3ed8('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 4fd42ad..fc3cb99 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 _0xa5df=['format','mail:queue:%s','lodash','util','ioredis','redis','defaults','localhost','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','name'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa5df,0x1dd));var _0xfa5d=function(_0x4523ed,_0x68ef42){_0x4523ed=_0x4523ed-0x0;var _0x28503a=_0xa5df[_0x4523ed];return _0x28503a;};'use strict';var _=require(_0xfa5d('0x0'));var md5=require('md5');var util=require(_0xfa5d('0x1'));var Redis=require(_0xfa5d('0x2'));var config=require('../../../config/environment');config[_0xfa5d('0x3')]=_[_0xfa5d('0x4')](config[_0xfa5d('0x3')],{'host':_0xfa5d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x1914c5){this['id']=_0x1914c5['id']||0x0;this['name']=_0x1914c5['name']||'';this[_0xfa5d('0x6')]=_0x1914c5['timeout']||0xa;this[_0xfa5d('0x7')]=_0x1914c5[_0xfa5d('0x7')]||'beepall';this['Agents']=_0x1914c5[_0xfa5d('0x8')];this['mapAgentsId']={};this[_0xfa5d('0x9')]=0x0;this[_0xfa5d('0xa')]='';this[_0xfa5d('0xb')]();this[_0xfa5d('0xc')]();}MailQueue[_0xfa5d('0xd')][_0xfa5d('0xb')]=function(){var _0x3ed3b3=this[_0xfa5d('0xe')][_0xfa5d('0xf')];this[_0xfa5d('0xe')]=_[_0xfa5d('0x10')](this['Agents'],'id');this[_0xfa5d('0xe')][_0xfa5d('0xf')]=_0x3ed3b3;};MailQueue[_0xfa5d('0xd')][_0xfa5d('0xc')]=function(){this[_0xfa5d('0x11')]=0x0;this[_0xfa5d('0x12')]=0x0;for(var _0xfe015=0x0;_0xfe015=0x0?this['available']:0x0;var _0x3ca3ad={'id':this['id'],'available':this[_0xfa5d('0x15')],'loggedIn':this[_0xfa5d('0x11')],'name':this[_0xfa5d('0x16')],'paused':this[_0xfa5d('0x12')],'waiting':this[_0xfa5d('0x9')]};var _0x495305=md5(JSON['stringify'](_0x3ca3ad));if(this[_0xfa5d('0xa')]!==_0x495305){this['md5']=_0x495305;io['to'](util[_0xfa5d('0x17')](_0xfa5d('0x18'),_0x3ca3ad[_0xfa5d('0x16')]))['emit']('mail_queue:save',_0x3ca3ad);}};module['exports']=MailQueue; \ No newline at end of file +var _0x617e=['exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','paused','length','loggedIn','mailPause','available','waiting','stringify','mail:queue:%s','emit'];(function(_0x539264,_0x30bd95){var _0x40fe20=function(_0x457084){while(--_0x457084){_0x539264['push'](_0x539264['shift']());}};_0x40fe20(++_0x30bd95);}(_0x617e,0xe1));var _0xe617=function(_0x1ccc48,_0x11e531){_0x1ccc48=_0x1ccc48-0x0;var _0x4af470=_0x617e[_0x1ccc48];return _0x4af470;};'use strict';var _=require(_0xe617('0x0'));var md5=require(_0xe617('0x1'));var util=require(_0xe617('0x2'));var Redis=require(_0xe617('0x3'));var config=require(_0xe617('0x4'));config['redis']=_[_0xe617('0x5')](config[_0xe617('0x6')],{'host':_0xe617('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x2e7891){this['id']=_0x2e7891['id']||0x0;this[_0xe617('0x8')]=_0x2e7891[_0xe617('0x8')]||'';this['timeout']=_0x2e7891[_0xe617('0x9')]||0xa;this[_0xe617('0xa')]=_0x2e7891[_0xe617('0xa')]||_0xe617('0xb');this[_0xe617('0xc')]=_0x2e7891[_0xe617('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xe617('0x1')]='';this['updateRouting']();this[_0xe617('0xd')]();}MailQueue[_0xe617('0xe')][_0xe617('0xf')]=function(){var _0x4be5e2=this[_0xe617('0x10')]['_rr'];this[_0xe617('0x10')]=_['map'](this[_0xe617('0xc')],'id');this[_0xe617('0x10')][_0xe617('0x11')]=_0x4be5e2;};MailQueue[_0xe617('0xe')][_0xe617('0xd')]=function(){this['loggedIn']=0x0;this[_0xe617('0x12')]=0x0;for(var _0x5c8faf=0x0;_0x5c8faf=0x0?this[_0xe617('0x16')]:0x0;var _0x41af54={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe617('0x14')],'name':this[_0xe617('0x8')],'paused':this['paused'],'waiting':this[_0xe617('0x17')]};var _0x56bb73=md5(JSON[_0xe617('0x18')](_0x41af54));if(this['md5']!==_0x56bb73){this[_0xe617('0x1')]=_0x56bb73;io['to'](util['format'](_0xe617('0x19'),_0x41af54[_0xe617('0x8')]))[_0xe617('0x1a')]('mail_queue:save',_0x41af54);}};module[_0xe617('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 8ac4f8e..84b50fe 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0xadb5,0xad));var _0x5adb=function(_0x292c9f,_0x4076b5){_0x292c9f=_0x292c9f-0x0;var _0x586b75=_0xadb5[_0x292c9f];return _0x586b75;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x35fd89,_0xf9c8f7){var _0x575f91=function(_0x510ba7){while(--_0x510ba7){_0x35fd89['push'](_0x35fd89['shift']());}};_0x575f91(++_0xf9c8f7);}(_0x814b,0x1a2));var _0xb814=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0x814b[_0x4fc421];return _0x8c6d63;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 54dde4c..58688f4 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 _0xac55=['ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','updateRouting','prototype','mapAgentsId','_rr','map','loggedIn','smsPause','paused','available','name','waiting','format','sms:queue:%s','emit','exports','lodash','md5','util'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xac55,0x1c8));var _0x5ac5=function(_0x276b22,_0x19e95e){_0x276b22=_0x276b22-0x0;var _0x37c279=_0xac55[_0x276b22];return _0x37c279;};'use strict';var _=require(_0x5ac5('0x0'));var md5=require(_0x5ac5('0x1'));var util=require(_0x5ac5('0x2'));var Redis=require(_0x5ac5('0x3'));var config=require('../../../config/environment');config[_0x5ac5('0x4')]=_[_0x5ac5('0x5')](config[_0x5ac5('0x4')],{'host':_0x5ac5('0x6'),'port':0x18eb});var io=require(_0x5ac5('0x7'))(new Redis(config[_0x5ac5('0x4')]));function SmsQueue(_0x234650){this['id']=_0x234650['id']||0x0;this['name']=_0x234650['name']||'';this[_0x5ac5('0x8')]=_0x234650[_0x5ac5('0x8')]||0xa;this[_0x5ac5('0x9')]=_0x234650[_0x5ac5('0x9')]||_0x5ac5('0xa');this[_0x5ac5('0xb')]=_0x234650[_0x5ac5('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x5ac5('0x1')]='';this[_0x5ac5('0xc')]();this['updateRealtime']();}SmsQueue[_0x5ac5('0xd')][_0x5ac5('0xc')]=function(){var _0x5a2aaa=this[_0x5ac5('0xe')][_0x5ac5('0xf')];this['mapAgentsId']=_[_0x5ac5('0x10')](this[_0x5ac5('0xb')],'id');this[_0x5ac5('0xe')][_0x5ac5('0xf')]=_0x5a2aaa;};SmsQueue[_0x5ac5('0xd')]['updateRealtime']=function(){this[_0x5ac5('0x11')]=0x0;this['paused']=0x0;for(var _0x1ce256=0x0;_0x1ce256=0x0?this['available']:0x0;var _0x3c6062={'id':this['id'],'available':this[_0x5ac5('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x5ac5('0x15')],'paused':this['paused'],'waiting':this[_0x5ac5('0x16')]};var _0x5b4b80=md5(JSON['stringify'](_0x3c6062));if(this[_0x5ac5('0x1')]!==_0x5b4b80){this['md5']=_0x5b4b80;io['to'](util[_0x5ac5('0x17')](_0x5ac5('0x18'),_0x3c6062['name']))[_0x5ac5('0x19')]('sms_queue:save',_0x3c6062);}};module[_0x5ac5('0x1a')]=SmsQueue; \ No newline at end of file +var _0xfe57=['_rr','map','prototype','loggedIn','smsPause','paused','available','waiting','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime'];(function(_0x57f2d0,_0x1bdacb){var _0x5d2b95=function(_0x33c62e){while(--_0x33c62e){_0x57f2d0['push'](_0x57f2d0['shift']());}};_0x5d2b95(++_0x1bdacb);}(_0xfe57,0x195));var _0x7fe5=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0xfe57[_0x56fe98];return _0x212f4f;};'use strict';var _=require(_0x7fe5('0x0'));var md5=require(_0x7fe5('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x7fe5('0x2'));config[_0x7fe5('0x3')]=_[_0x7fe5('0x4')](config[_0x7fe5('0x3')],{'host':_0x7fe5('0x5'),'port':0x18eb});var io=require(_0x7fe5('0x6'))(new Redis(config[_0x7fe5('0x3')]));function SmsQueue(_0x444eb5){this['id']=_0x444eb5['id']||0x0;this[_0x7fe5('0x7')]=_0x444eb5[_0x7fe5('0x7')]||'';this[_0x7fe5('0x8')]=_0x444eb5[_0x7fe5('0x8')]||0xa;this[_0x7fe5('0x9')]=_0x444eb5['strategy']||_0x7fe5('0xa');this['Agents']=_0x444eb5[_0x7fe5('0xb')];this[_0x7fe5('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x7fe5('0xd')]();this[_0x7fe5('0xe')]();}SmsQueue['prototype'][_0x7fe5('0xd')]=function(){var _0x5f494d=this['mapAgentsId'][_0x7fe5('0xf')];this[_0x7fe5('0xc')]=_[_0x7fe5('0x10')](this[_0x7fe5('0xb')],'id');this['mapAgentsId'][_0x7fe5('0xf')]=_0x5f494d;};SmsQueue[_0x7fe5('0x11')]['updateRealtime']=function(){this[_0x7fe5('0x12')]=0x0;this['paused']=0x0;for(var _0x1f84b5=0x0;_0x1f84b5=0x0?this[_0x7fe5('0x15')]:0x0;var _0x1be963={'id':this['id'],'available':this[_0x7fe5('0x15')],'loggedIn':this[_0x7fe5('0x12')],'name':this[_0x7fe5('0x7')],'paused':this[_0x7fe5('0x14')],'waiting':this[_0x7fe5('0x16')]};var _0x3b98cd=md5(JSON['stringify'](_0x1be963));if(this['md5']!==_0x3b98cd){this[_0x7fe5('0x1')]=_0x3b98cd;io['to'](util[_0x7fe5('0x17')](_0x7fe5('0x18'),_0x1be963[_0x7fe5('0x7')]))[_0x7fe5('0x19')](_0x7fe5('0x1a'),_0x1be963);}};module[_0x7fe5('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 988dd61..546fbee 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 _0xa5d5=['available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','util','../../../config/environment','localhost','name','timeout','strategy','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','online','whatsappPause'];(function(_0x1f7ebf,_0x1886d1){var _0xc57e2a=function(_0x38d961){while(--_0x38d961){_0x1f7ebf['push'](_0x1f7ebf['shift']());}};_0xc57e2a(++_0x1886d1);}(_0xa5d5,0x16d));var _0x5a5d=function(_0x599267,_0x2a58b3){_0x599267=_0x599267-0x0;var _0x10346c=_0xa5d5[_0x599267];return _0x10346c;};'use strict';var _=require(_0x5a5d('0x0'));var md5=require(_0x5a5d('0x1'));var util=require(_0x5a5d('0x2'));var Redis=require('ioredis');var config=require(_0x5a5d('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x5a5d('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x2074a1){this['id']=_0x2074a1['id']||0x0;this[_0x5a5d('0x5')]=_0x2074a1[_0x5a5d('0x5')]||'';this[_0x5a5d('0x6')]=_0x2074a1[_0x5a5d('0x6')]||0xa;this[_0x5a5d('0x7')]=_0x2074a1['strategy']||'beepall';this[_0x5a5d('0x8')]=_0x2074a1[_0x5a5d('0x8')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x5a5d('0x9')]();this[_0x5a5d('0xa')]();}WhatsappQueue[_0x5a5d('0xb')][_0x5a5d('0x9')]=function(){var _0x444346=this[_0x5a5d('0xc')][_0x5a5d('0xd')];this[_0x5a5d('0xc')]=_[_0x5a5d('0xe')](this['Agents'],'id');this[_0x5a5d('0xc')][_0x5a5d('0xd')]=_0x444346;};WhatsappQueue[_0x5a5d('0xb')][_0x5a5d('0xa')]=function(){this[_0x5a5d('0xf')]=0x0;this[_0x5a5d('0x10')]=0x0;for(var _0x1cde72=0x0;_0x1cde72=0x0?this[_0x5a5d('0x13')]:0x0;var _0x89cfb3={'id':this['id'],'available':this[_0x5a5d('0x13')],'loggedIn':this[_0x5a5d('0xf')],'name':this[_0x5a5d('0x5')],'paused':this[_0x5a5d('0x10')],'waiting':this['waiting']};var _0x5ce00e=md5(JSON[_0x5a5d('0x14')](_0x89cfb3));if(this[_0x5a5d('0x1')]!==_0x5ce00e){this[_0x5a5d('0x1')]=_0x5ce00e;io['to'](util[_0x5a5d('0x15')](_0x5a5d('0x16'),_0x89cfb3[_0x5a5d('0x5')]))['emit'](_0x5a5d('0x17'),_0x89cfb3);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x2e19=['whatsapp_queue:save','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','paused','length','online','whatsappPause','available','emit'];(function(_0x285f27,_0x1515f8){var _0x4a6225=function(_0x3d0ea6){while(--_0x3d0ea6){_0x285f27['push'](_0x285f27['shift']());}};_0x4a6225(++_0x1515f8);}(_0x2e19,0x106));var _0x92e1=function(_0x10dab2,_0x56336f){_0x10dab2=_0x10dab2-0x0;var _0x221288=_0x2e19[_0x10dab2];return _0x221288;};'use strict';var _=require(_0x92e1('0x0'));var md5=require(_0x92e1('0x1'));var util=require(_0x92e1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x92e1('0x3')]=_['defaults'](config[_0x92e1('0x3')],{'host':_0x92e1('0x4'),'port':0x18eb});var io=require(_0x92e1('0x5'))(new Redis(config[_0x92e1('0x3')]));function WhatsappQueue(_0x3ea840){this['id']=_0x3ea840['id']||0x0;this[_0x92e1('0x6')]=_0x3ea840[_0x92e1('0x6')]||'';this[_0x92e1('0x7')]=_0x3ea840['timeout']||0xa;this[_0x92e1('0x8')]=_0x3ea840[_0x92e1('0x8')]||_0x92e1('0x9');this['Agents']=_0x3ea840[_0x92e1('0xa')];this['mapAgentsId']={};this[_0x92e1('0xb')]=0x0;this[_0x92e1('0x1')]='';this['updateRouting']();this[_0x92e1('0xc')]();}WhatsappQueue[_0x92e1('0xd')][_0x92e1('0xe')]=function(){var _0x378f50=this[_0x92e1('0xf')]['_rr'];this[_0x92e1('0xf')]=_['map'](this[_0x92e1('0xa')],'id');this['mapAgentsId'][_0x92e1('0x10')]=_0x378f50;};WhatsappQueue[_0x92e1('0xd')][_0x92e1('0xc')]=function(){this[_0x92e1('0x11')]=0x0;this[_0x92e1('0x12')]=0x0;for(var _0x2351c8=0x0;_0x2351c8=0x0?this[_0x92e1('0x16')]:0x0;var _0x32592b={'id':this['id'],'available':this[_0x92e1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x92e1('0x6')],'paused':this[_0x92e1('0x12')],'waiting':this[_0x92e1('0xb')]};var _0x5ad634=md5(JSON['stringify'](_0x32592b));if(this[_0x92e1('0x1')]!==_0x5ad634){this['md5']=_0x5ad634;io['to'](util['format']('whatsapp:queue:%s',_0x32592b[_0x92e1('0x6')]))[_0x92e1('0x17')](_0x92e1('0x18'),_0x32592b);}};module[_0x92e1('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index a7c417f..d33947e 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(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4224b4,_0x34032d){var _0x121cd3=function(_0x4a7dbb){while(--_0x4a7dbb){_0x4224b4['push'](_0x4224b4['shift']());}};_0x121cd3(++_0x34032d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4239bd,_0x1f310b){_0x4239bd=_0x4239bd-0x0;var _0x21f061=_0xb10b[_0x4239bd];return _0x21f061;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index c5c537c..66a33ca 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 _0xe872=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe872,0x15d));var _0x2e87=function(_0x57d1ad,_0x267606){_0x57d1ad=_0x57d1ad-0x0;var _0x5ce501=_0xe872[_0x57d1ad];return _0x5ce501;};'use strict';var client=require('../client');exports[_0x2e87('0x0')]=function(_0x144b72,_0x3ddf9d){return client[_0x2e87('0x1')](_0x2e87('0x2'),{'body':_0x3ddf9d,'options':{'where':{'id':_0x144b72}},'log':_0x2e87('0x3')});};exports[_0x2e87('0x4')]=function(_0x42320a,_0xda20b2){return client[_0x2e87('0x1')](_0x2e87('0x5'),{'body':_0xda20b2,'options':{'where':{'id':_0x42320a}},'log':_0x2e87('0x6')});}; \ No newline at end of file +var _0x04fb=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update'];(function(_0x201361,_0x3d6778){var _0x300db2=function(_0x3b3c10){while(--_0x3b3c10){_0x201361['push'](_0x201361['shift']());}};_0x300db2(++_0x3d6778);}(_0x04fb,0x15c));var _0xb04f=function(_0x106ac6,_0xed7a14){_0x106ac6=_0x106ac6-0x0;var _0x24d9f8=_0x04fb[_0x106ac6];return _0x24d9f8;};'use strict';var client=require(_0xb04f('0x0'));exports[_0xb04f('0x1')]=function(_0x2e5959,_0x1138b5){return client[_0xb04f('0x2')](_0xb04f('0x3'),{'body':_0x1138b5,'options':{'where':{'id':_0x2e5959}},'log':_0xb04f('0x4')});};exports[_0xb04f('0x5')]=function(_0x245549,_0x5e9c47){return client[_0xb04f('0x2')](_0xb04f('0x6'),{'body':_0x5e9c47,'options':{'where':{'id':_0x245549}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 8aacedf..2383616 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 _0xddc4=['CreateChatMessage','createChatMessage','Request'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xddc4,0x6e));var _0x4ddc=function(_0x5e999d,_0xc59d1b){_0x5e999d=_0x5e999d-0x0;var _0x29d7d9=_0xddc4[_0x5e999d];return _0x29d7d9;};'use strict';var client=require('../client');exports['create']=function(_0x4d149a){return client[_0x4ddc('0x0')](_0x4ddc('0x1'),{'body':_0x4d149a,'log':_0x4ddc('0x2')});}; \ No newline at end of file +var _0x2418=['create','Request','CreateChatMessage'];(function(_0x382ac9,_0x14e8f0){var _0x4761a8=function(_0x4e4d05){while(--_0x4e4d05){_0x382ac9['push'](_0x382ac9['shift']());}};_0x4761a8(++_0x14e8f0);}(_0x2418,0x6f));var _0x8241=function(_0x43a148,_0x556c00){_0x43a148=_0x43a148-0x0;var _0x1adb39=_0x2418[_0x43a148];return _0x1adb39;};'use strict';var client=require('../client');exports[_0x8241('0x0')]=function(_0x5621e0){return client[_0x8241('0x1')](_0x8241('0x2'),{'body':_0x5621e0,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c008002..be157de 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 _0x43fd=['getChatQueues','name','timeout','User','online','chatPause'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x43fd,0x1ec));var _0xd43f=function(_0x51aeb7,_0x4c8b78){_0x51aeb7=_0x51aeb7-0x0;var _0x54d6ba=_0x43fd[_0x51aeb7];return _0x54d6ba;};'use strict';var client=require('../client');exports[_0xd43f('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xd43f('0x1'),_0xd43f('0x2'),'strategy'],'include':[{'model':_0xd43f('0x3'),'as':'Agents','attributes':['id',_0xd43f('0x1'),_0xd43f('0x4'),_0xd43f('0x5')]}]},'log':_0xd43f('0x0')});};}; \ No newline at end of file +var _0xe314=['GetChatQueue','name','timeout','strategy','User','Agents','online','getChatQueues','Request'];(function(_0x40bbf8,_0x1e3061){var _0x5ca481=function(_0x298aef){while(--_0x298aef){_0x40bbf8['push'](_0x40bbf8['shift']());}};_0x5ca481(++_0x1e3061);}(_0xe314,0x7c));var _0x4e31=function(_0x403a64,_0x518e0f){_0x403a64=_0x403a64-0x0;var _0x15de4e=_0xe314[_0x403a64];return _0x15de4e;};'use strict';var client=require('../client');exports[_0x4e31('0x0')]=function(){return function(){return client[_0x4e31('0x1')](_0x4e31('0x2'),{'options':{'raw':![],'attributes':['id',_0x4e31('0x3'),_0x4e31('0x4'),_0x4e31('0x5')],'include':[{'model':_0x4e31('0x6'),'as':_0x4e31('0x7'),'attributes':['id',_0x4e31('0x3'),_0x4e31('0x8'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index abe4948..bca53b7 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 _0x5fc7=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x556bc7,_0x1fdfa0){var _0x1108a4=function(_0x140b08){while(--_0x140b08){_0x556bc7['push'](_0x556bc7['shift']());}};_0x1108a4(++_0x1fdfa0);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x5fc7[_0x346737];return _0x1ade2e;};'use strict';var client=require(_0x75fc('0x0'));exports[_0x75fc('0x1')]=function(_0x13ae0d){return client[_0x75fc('0x2')](_0x75fc('0x3'),{'body':_0x13ae0d,'log':_0x75fc('0x3')});};exports[_0x75fc('0x4')]=function(_0x34103c,_0x756c32){return client[_0x75fc('0x2')](_0x75fc('0x5'),{'body':_0x756c32,'options':{'where':{'uniqueid':_0x34103c},'order':[['id',_0x75fc('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x99e9=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x41d04f,_0x31aab7){var _0x530783=function(_0x466dfc){while(--_0x466dfc){_0x41d04f['push'](_0x41d04f['shift']());}};_0x530783(++_0x31aab7);}(_0x99e9,0xb4));var _0x999e=function(_0x205b46,_0x3ca65b){_0x205b46=_0x205b46-0x0;var _0x2b6ae8=_0x99e9[_0x205b46];return _0x2b6ae8;};'use strict';var client=require('../client');exports[_0x999e('0x0')]=function(_0x783676){return client[_0x999e('0x1')](_0x999e('0x2'),{'body':_0x783676,'log':'CreateChatQueueReport'});};exports[_0x999e('0x3')]=function(_0x2f803e,_0x3aac27){return client['Request'](_0x999e('0x4'),{'body':_0x3aac27,'options':{'where':{'uniqueid':_0x2f803e},'order':[['id','DESC']],'limit':0x1},'log':_0x999e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8544e9a..ca16356 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xfeb5d4,_0x211945){var _0x167b53=function(_0x10f15d){while(--_0x10f15d){_0xfeb5d4['push'](_0xfeb5d4['shift']());}};_0x167b53(++_0x211945);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x7a54,0x106));var _0x47a5=function(_0x48f33c,_0x550ba5){_0x48f33c=_0x48f33c-0x0;var _0x2f3c41=_0x7a54[_0x48f33c];return _0x2f3c41;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 9e831e9..447c501 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 _0xd47b=['createFaxMessage','../client','create','Request'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd47b,0xa5));var _0xbd47=function(_0x499044,_0x1b0dd0){_0x499044=_0x499044-0x0;var _0x1d004b=_0xd47b[_0x499044];return _0x1d004b;};'use strict';var client=require(_0xbd47('0x0'));exports[_0xbd47('0x1')]=function(_0x9e5517){return client[_0xbd47('0x2')]('CreateFaxMessage',{'body':_0x9e5517,'log':_0xbd47('0x3')});}; \ No newline at end of file +var _0x695d=['Request','CreateFaxMessage','create'];(function(_0x4d09d0,_0xf0f13b){var _0x598ef8=function(_0x4a4ce8){while(--_0x4a4ce8){_0x4d09d0['push'](_0x4d09d0['shift']());}};_0x598ef8(++_0xf0f13b);}(_0x695d,0x1f1));var _0xd695=function(_0x4b6792,_0x1098bb){_0x4b6792=_0x4b6792-0x0;var _0x406802=_0x695d[_0x4b6792];return _0x406802;};'use strict';var client=require('../client');exports[_0xd695('0x0')]=function(_0x2e113f){return client[_0xd695('0x1')](_0xd695('0x2'),{'body':_0x2e113f,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 18388d5..bae899d 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 _0x100c=['online','getFaxQueues','../client','Request','GetFaxQueue','name','strategy'];(function(_0x7a5583,_0x163db0){var _0x26d6ec=function(_0x54cfa3){while(--_0x54cfa3){_0x7a5583['push'](_0x7a5583['shift']());}};_0x26d6ec(++_0x163db0);}(_0x100c,0x72));var _0xc100=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x100c[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0xc100('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xc100('0x1')](_0xc100('0x2'),{'options':{'raw':![],'attributes':['id',_0xc100('0x3'),'timeout',_0xc100('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xc100('0x3'),_0xc100('0x5'),'faxPause']}]},'log':_0xc100('0x6')});};}; \ No newline at end of file +var _0x331e=['getFaxQueues','Request','GetFaxQueue','timeout','strategy','Agents','../client'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x331e,0x68));var _0xe331=function(_0x527aab,_0x1bb5d8){_0x527aab=_0x527aab-0x0;var _0x549ef1=_0x331e[_0x527aab];return _0x549ef1;};'use strict';var client=require(_0xe331('0x0'));exports[_0xe331('0x1')]=function(){return function(){return client[_0xe331('0x2')](_0xe331('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe331('0x4'),_0xe331('0x5')],'include':[{'model':'User','as':_0xe331('0x6'),'attributes':['id','name','online','faxPause']}]},'log':_0xe331('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f72952b..aff429a 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 _0x65ae=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','create'];(function(_0x2d44a3,_0x3d1ecf){var _0x55ca81=function(_0x246228){while(--_0x246228){_0x2d44a3['push'](_0x2d44a3['shift']());}};_0x55ca81(++_0x3d1ecf);}(_0x65ae,0xe0));var _0xe65a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x65ae[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xe65a('0x0')]=function(_0x226166){return client['Request'](_0xe65a('0x1'),{'body':_0x226166,'log':'CreateFaxQueueReport'});};exports[_0xe65a('0x2')]=function(_0x40599c,_0x5da9a0){return client[_0xe65a('0x3')](_0xe65a('0x4'),{'body':_0x5da9a0,'options':{'where':{'uniqueid':_0x40599c},'order':[['id','DESC']],'limit':0x1},'log':_0xe65a('0x4')});}; \ No newline at end of file +var _0x9ebf=['UpdateFaxQueueReport','Request','CreateFaxQueueReport','update'];(function(_0x4a7874,_0x5464ed){var _0x336b94=function(_0x4bc55e){while(--_0x4bc55e){_0x4a7874['push'](_0x4a7874['shift']());}};_0x336b94(++_0x5464ed);}(_0x9ebf,0x1b5));var _0xf9eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9ebf[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['create']=function(_0x372b3d){return client[_0xf9eb('0x0')](_0xf9eb('0x1'),{'body':_0x372b3d,'log':_0xf9eb('0x1')});};exports[_0xf9eb('0x2')]=function(_0x3511ed,_0x4f47a3){return client['Request']('UpdateFaxQueueReport',{'body':_0x4f47a3,'options':{'where':{'uniqueid':_0x3511ed},'order':[['id','DESC']],'limit':0x1},'log':_0xf9eb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 57fec86..a6b1aed 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 _0x2163=['../client','Request','GetInterval','Interval','name','interval','getIntervals'];(function(_0xb8f8e9,_0x54c94c){var _0x161c43=function(_0x22099d){while(--_0x22099d){_0xb8f8e9['push'](_0xb8f8e9['shift']());}};_0x161c43(++_0x54c94c);}(_0x2163,0x134));var _0x3216=function(_0xb5b282,_0x5c188d){_0xb5b282=_0xb5b282-0x0;var _0x44547a=_0x2163[_0xb5b282];return _0x44547a;};'use strict';var client=require(_0x3216('0x0'));exports['getIntervals']=function(){return function(){return client[_0x3216('0x1')](_0x3216('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3216('0x3'),'as':'Intervals','attributes':['id',_0x3216('0x4'),_0x3216('0x5')]}]},'log':_0x3216('0x6')});};}; \ No newline at end of file +var _0x16de=['GetInterval','name','interval','getIntervals','../client','Request'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x16de,0x118));var _0xe16d=function(_0x1c532a,_0x791a93){_0x1c532a=_0x1c532a-0x0;var _0x16e144=_0x16de[_0x1c532a];return _0x16e144;};'use strict';var client=require(_0xe16d('0x0'));exports['getIntervals']=function(){return function(){return client[_0xe16d('0x1')](_0xe16d('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe16d('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xe16d('0x3'),_0xe16d('0x4')]}]},'log':_0xe16d('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1fac023..2eb64e5 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 _0x6a95=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6a95,0x1db));var _0x56a9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6a95[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x15574a,_0xce37aa){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'body':_0xce37aa,'options':{'where':{'id':_0x15574a}},'log':_0x56a9('0x4')});};exports['addTags']=function(_0x512f52,_0x12cd60){return client[_0x56a9('0x2')](_0x56a9('0x5'),{'body':_0x12cd60,'options':{'where':{'id':_0x512f52}},'log':_0x56a9('0x6')});}; \ No newline at end of file +var _0xda2d=['UpdateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x46ede2,_0x31d324){var _0x39e6e9=function(_0x22c4e3){while(--_0x22c4e3){_0x46ede2['push'](_0x46ede2['shift']());}};_0x39e6e9(++_0x31d324);}(_0xda2d,0x102));var _0xdda2=function(_0x3cb7f4,_0x4ee1f1){_0x3cb7f4=_0x3cb7f4-0x0;var _0x133f6f=_0xda2d[_0x3cb7f4];return _0x133f6f;};'use strict';var client=require('../client');exports[_0xdda2('0x0')]=function(_0x35f029,_0xd495d2){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'body':_0xd495d2,'options':{'where':{'id':_0x35f029}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x5a5f9f,_0x357e97){return client[_0xdda2('0x1')](_0xdda2('0x3'),{'body':_0x357e97,'options':{'where':{'id':_0x5a5f9f}},'log':_0xdda2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 160b6e9..e3f6d72 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 _0xe254=['CreateMailMessage','../client','create','Request'];(function(_0x21a98e,_0x850670){var _0x4b1374=function(_0x468b06){while(--_0x468b06){_0x21a98e['push'](_0x21a98e['shift']());}};_0x4b1374(++_0x850670);}(_0xe254,0x1b1));var _0x4e25=function(_0x48e388,_0x46fb73){_0x48e388=_0x48e388-0x0;var _0x14d980=_0xe254[_0x48e388];return _0x14d980;};'use strict';var client=require(_0x4e25('0x0'));exports[_0x4e25('0x1')]=function(_0x50ff7e){return client[_0x4e25('0x2')](_0x4e25('0x3'),{'body':_0x50ff7e,'log':'createMailMessage'});}; \ No newline at end of file +var _0x02f5=['create','Request','createMailMessage'];(function(_0x4e7512,_0x341454){var _0x41658a=function(_0x1c040c){while(--_0x1c040c){_0x4e7512['push'](_0x4e7512['shift']());}};_0x41658a(++_0x341454);}(_0x02f5,0x168));var _0x502f=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x02f5[_0x50e593];return _0x3821d0;};'use strict';var client=require('../client');exports[_0x502f('0x0')]=function(_0x4d4b9b){return client[_0x502f('0x1')]('CreateMailMessage',{'body':_0x4d4b9b,'log':_0x502f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 8d8563c..4199223 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 _0x67b2=['timeout','User','Agents','online','mailPause','../client','Request','GetMailQueue','name'];(function(_0x35c608,_0x332562){var _0x25a250=function(_0x56a8d4){while(--_0x56a8d4){_0x35c608['push'](_0x35c608['shift']());}};_0x25a250(++_0x332562);}(_0x67b2,0x1d9));var _0x267b=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x67b2[_0x4bd06e];return _0x85ebb;};'use strict';var client=require(_0x267b('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x267b('0x1')](_0x267b('0x2'),{'options':{'raw':![],'attributes':['id',_0x267b('0x3'),_0x267b('0x4'),'strategy'],'include':[{'model':_0x267b('0x5'),'as':_0x267b('0x6'),'attributes':['id','name',_0x267b('0x7'),_0x267b('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xa0db=['Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','strategy','User'];(function(_0xdd3ee9,_0x58a87a){var _0x52bb7a=function(_0x47d34f){while(--_0x47d34f){_0xdd3ee9['push'](_0xdd3ee9['shift']());}};_0x52bb7a(++_0x58a87a);}(_0xa0db,0x1a1));var _0xba0d=function(_0xe08c54,_0x745336){_0xe08c54=_0xe08c54-0x0;var _0x2ebe40=_0xa0db[_0xe08c54];return _0x2ebe40;};'use strict';var client=require(_0xba0d('0x0'));exports[_0xba0d('0x1')]=function(){return function(){return client[_0xba0d('0x2')](_0xba0d('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xba0d('0x4')],'include':[{'model':_0xba0d('0x5'),'as':_0xba0d('0x6'),'attributes':['id','name',_0xba0d('0x7'),_0xba0d('0x8')]}]},'log':_0xba0d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 34019fb..dfaf6ed 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 _0xc0dc=['UpdateMailQueueReport','create','CreateMailQueueReport','update'];(function(_0x414260,_0x1d7d05){var _0x37fb8a=function(_0x197e4a){while(--_0x197e4a){_0x414260['push'](_0x414260['shift']());}};_0x37fb8a(++_0x1d7d05);}(_0xc0dc,0x1b1));var _0xcc0d=function(_0x392f88,_0x1bec55){_0x392f88=_0x392f88-0x0;var _0x48895a=_0xc0dc[_0x392f88];return _0x48895a;};'use strict';var client=require('../client');exports[_0xcc0d('0x0')]=function(_0x4f2b78){return client['Request'](_0xcc0d('0x1'),{'body':_0x4f2b78,'log':_0xcc0d('0x1')});};exports[_0xcc0d('0x2')]=function(_0x2afac6,_0x765b80){return client['Request']('UpdateMailQueueReport',{'body':_0x765b80,'options':{'where':{'uniqueid':_0x2afac6},'order':[['id','DESC']],'limit':0x1},'log':_0xcc0d('0x3')});}; \ No newline at end of file +var _0xa3c9=['../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x25fc26,_0x37fbba){var _0x3f1cb6=function(_0x188e8f){while(--_0x188e8f){_0x25fc26['push'](_0x25fc26['shift']());}};_0x3f1cb6(++_0x37fbba);}(_0xa3c9,0xd2));var _0x9a3c=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xa3c9[_0x450bf9];return _0x268350;};'use strict';var client=require(_0x9a3c('0x0'));exports['create']=function(_0x1a4880){return client[_0x9a3c('0x1')](_0x9a3c('0x2'),{'body':_0x1a4880,'log':_0x9a3c('0x2')});};exports[_0x9a3c('0x3')]=function(_0xe3e456,_0x3e85fd){return client[_0x9a3c('0x1')](_0x9a3c('0x4'),{'body':_0x3e85fd,'options':{'where':{'uniqueid':_0xe3e456},'order':[['id','DESC']],'limit':0x1},'log':_0x9a3c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 5b8fea1..210487f 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 _0x3140=['updateOpenchannelInteraction','addTags','Request','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x11259f,_0x2f279e){var _0x54b726=function(_0x211493){while(--_0x211493){_0x11259f['push'](_0x11259f['shift']());}};_0x54b726(++_0x2f279e);}(_0x3140,0x1ee));var _0x0314=function(_0x5a594d,_0x5cd018){_0x5a594d=_0x5a594d-0x0;var _0x45a07e=_0x3140[_0x5a594d];return _0x45a07e;};'use strict';var client=require(_0x0314('0x0'));exports[_0x0314('0x1')]=function(_0x19c68d,_0xe8c13f){return client['Request'](_0x0314('0x2'),{'body':_0xe8c13f,'options':{'where':{'id':_0x19c68d}},'log':_0x0314('0x3')});};exports[_0x0314('0x4')]=function(_0x16559f,_0x33407d){return client[_0x0314('0x5')]('AddTagsToOpenchannelInteraction',{'body':_0x33407d,'options':{'where':{'id':_0x16559f}},'log':_0x0314('0x6')});}; \ No newline at end of file +var _0x7e7c=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x7e7c,0x179));var _0xc7e7=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x7e7c[_0x2df1f2];return _0x38652b;};'use strict';var client=require(_0xc7e7('0x0'));exports[_0xc7e7('0x1')]=function(_0x41436a,_0x204297){return client[_0xc7e7('0x2')]('UpdateOpenchannelInteraction',{'body':_0x204297,'options':{'where':{'id':_0x41436a}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x40560c,_0x5f19fe){return client[_0xc7e7('0x2')](_0xc7e7('0x3'),{'body':_0x5f19fe,'options':{'where':{'id':_0x40560c}},'log':_0xc7e7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b2c3cd6..c99993e 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 _0xec57=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x4ec2cc,_0x446a03){var _0x10d23d=function(_0x346107){while(--_0x346107){_0x4ec2cc['push'](_0x4ec2cc['shift']());}};_0x10d23d(++_0x446a03);}(_0xec57,0x1ef));var _0x7ec5=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xec57[_0x30bd4d];return _0x306915;};'use strict';var client=require(_0x7ec5('0x0'));exports[_0x7ec5('0x1')]=function(_0x1d5b18){return client['Request'](_0x7ec5('0x2'),{'body':_0x1d5b18,'log':_0x7ec5('0x3')});}; \ No newline at end of file +var _0x1bdc=['createOpenchannelMessage','../client','create','CreateOpenchannelMessage'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1bdc,0x119));var _0xc1bd=function(_0x16a1f8,_0xd57bbd){_0x16a1f8=_0x16a1f8-0x0;var _0x207a17=_0x1bdc[_0x16a1f8];return _0x207a17;};'use strict';var client=require(_0xc1bd('0x0'));exports[_0xc1bd('0x1')]=function(_0xb7807a){return client['Request'](_0xc1bd('0x2'),{'body':_0xb7807a,'log':_0xc1bd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 95115c8..b37acbe 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 _0x6bff=['GetOpenchannelQueue','name','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x70291a,_0xb0f838){var _0x669f38=function(_0x3b124c){while(--_0x3b124c){_0x70291a['push'](_0x70291a['shift']());}};_0x669f38(++_0xb0f838);}(_0x6bff,0xd6));var _0xf6bf=function(_0x1f80fb,_0x156420){_0x1f80fb=_0x1f80fb-0x0;var _0x4e293f=_0x6bff[_0x1f80fb];return _0x4e293f;};'use strict';var client=require('../client');exports[_0xf6bf('0x0')]=function(){return function(){return client[_0xf6bf('0x1')](_0xf6bf('0x2'),{'options':{'raw':![],'attributes':['id',_0xf6bf('0x3'),'timeout',_0xf6bf('0x4')],'include':[{'model':_0xf6bf('0x5'),'as':_0xf6bf('0x6'),'attributes':['id',_0xf6bf('0x3'),_0xf6bf('0x7'),_0xf6bf('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x7ce9=['getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x2c5b6b,_0x1e6181){var _0x1359d8=function(_0x4b7fe3){while(--_0x4b7fe3){_0x2c5b6b['push'](_0x2c5b6b['shift']());}};_0x1359d8(++_0x1e6181);}(_0x7ce9,0xf0));var _0x97ce=function(_0x23da4d,_0x63498c){_0x23da4d=_0x23da4d-0x0;var _0x4ae55=_0x7ce9[_0x23da4d];return _0x4ae55;};'use strict';var client=require('../client');exports[_0x97ce('0x0')]=function(){return function(){return client[_0x97ce('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x97ce('0x2'),_0x97ce('0x3'),_0x97ce('0x4')],'include':[{'model':_0x97ce('0x5'),'as':_0x97ce('0x6'),'attributes':['id','name','online',_0x97ce('0x7')]}]},'log':_0x97ce('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6c56873..732626c 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 _0xbfba=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xbfba,0x1ac));var _0xabfb=function(_0xead539,_0x55e078){_0xead539=_0xead539-0x0;var _0x26c05e=_0xbfba[_0xead539];return _0x26c05e;};'use strict';var client=require(_0xabfb('0x0'));exports[_0xabfb('0x1')]=function(_0x2fab6a){return client[_0xabfb('0x2')](_0xabfb('0x3'),{'body':_0x2fab6a,'log':_0xabfb('0x3')});};exports['update']=function(_0x2c2c49,_0x5340cc){return client[_0xabfb('0x2')](_0xabfb('0x4'),{'body':_0x5340cc,'options':{'where':{'uniqueid':_0x2c2c49},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xf26c=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create'];(function(_0x4dff89,_0x5050bd){var _0x53e0f4=function(_0x2d622d){while(--_0x2d622d){_0x4dff89['push'](_0x4dff89['shift']());}};_0x53e0f4(++_0x5050bd);}(_0xf26c,0x1b0));var _0xcf26=function(_0x3aca86,_0x3165a2){_0x3aca86=_0x3aca86-0x0;var _0x23b52f=_0xf26c[_0x3aca86];return _0x23b52f;};'use strict';var client=require(_0xcf26('0x0'));exports[_0xcf26('0x1')]=function(_0x3f35d3){return client[_0xcf26('0x2')](_0xcf26('0x3'),{'body':_0x3f35d3,'log':_0xcf26('0x3')});};exports[_0xcf26('0x4')]=function(_0x3d12f7,_0x38fa91){return client[_0xcf26('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x38fa91,'options':{'where':{'uniqueid':_0x3d12f7},'order':[['id',_0xcf26('0x5')]],'limit':0x1},'log':_0xcf26('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f1c81c7..4cb6229 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 _0xf2ca=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x14ea32,_0x262909){_0x14ea32=_0x14ea32-0x0;var _0x137bbb=_0xf2ca[_0x14ea32];return _0x137bbb;};'use strict';var client=require(_0xaf2c('0x0'));exports[_0xaf2c('0x1')]=function(_0x26a8a7,_0x598667){return client[_0xaf2c('0x2')](_0xaf2c('0x3'),{'body':_0x598667,'options':{'where':{'id':_0x26a8a7}},'log':_0xaf2c('0x4')});};exports[_0xaf2c('0x5')]=function(_0x3a724c,_0x10c910){return client['Request'](_0xaf2c('0x6'),{'body':_0x10c910,'options':{'where':{'id':_0x3a724c}},'log':_0xaf2c('0x7')});}; \ No newline at end of file +var _0x8c32=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x4a3c0b,_0x515e97){var _0x5ec563=function(_0xd95097){while(--_0xd95097){_0x4a3c0b['push'](_0x4a3c0b['shift']());}};_0x5ec563(++_0x515e97);}(_0x8c32,0x130));var _0x28c3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8c32[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0x28c3('0x0'));exports[_0x28c3('0x1')]=function(_0x35ae01,_0x5c0a8a){return client[_0x28c3('0x2')](_0x28c3('0x3'),{'body':_0x5c0a8a,'options':{'where':{'id':_0x35ae01}},'log':_0x28c3('0x4')});};exports[_0x28c3('0x5')]=function(_0x2f94e0,_0x40df22){return client[_0x28c3('0x2')](_0x28c3('0x6'),{'body':_0x40df22,'options':{'where':{'id':_0x2f94e0}},'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 2cd60c8..1a4e93d 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 _0xed85=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed85,0x65));var _0x5ed8=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xed85[_0x381372];return _0x4e959a;};'use strict';var client=require(_0x5ed8('0x0'));exports[_0x5ed8('0x1')]=function(_0x2a577f){return client[_0x5ed8('0x2')](_0x5ed8('0x3'),{'body':_0x2a577f,'log':_0x5ed8('0x4')});}; \ No newline at end of file +var _0xe84e=['create','Request','CreateSmsMessage','../client'];(function(_0x1cd477,_0x42d4cd){var _0x3d9007=function(_0x1f3f4d){while(--_0x1f3f4d){_0x1cd477['push'](_0x1cd477['shift']());}};_0x3d9007(++_0x42d4cd);}(_0xe84e,0xf7));var _0xee84=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0xe84e[_0x10e8ed];return _0x4aea4a;};'use strict';var client=require(_0xee84('0x0'));exports[_0xee84('0x1')]=function(_0x4693e2){return client[_0xee84('0x2')](_0xee84('0x3'),{'body':_0x4693e2,'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 3da35f7..6788b59 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x20be17,_0xf56f22){var _0x110cdb=function(_0x451a85){while(--_0x451a85){_0x20be17['push'](_0x20be17['shift']());}};_0x110cdb(++_0xf56f22);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb7e7[_0x1ae5ab];return _0x1ce001;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 63ae178..237c916 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(_0x3bdbff,_0x20887e){var _0x1dbe39=function(_0x3b85f1){while(--_0x3b85f1){_0x3bdbff['push'](_0x3bdbff['shift']());}};_0x1dbe39(++_0x20887e);}(_0x3e74,0x175));var _0x43e7=function(_0x3eb620,_0x27dc25){_0x3eb620=_0x3eb620-0x0;var _0x1f04cc=_0x3e74[_0x3eb620];return _0x1f04cc;};'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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0xedd9,0xfc));var _0x9edd=function(_0x2bd7ef,_0x279212){_0x2bd7ef=_0x2bd7ef-0x0;var _0x42e78a=_0xedd9[_0x2bd7ef];return _0x42e78a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 96b0854..c078ec6 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(_0x3ea89b,_0x3c8161){var _0x15d675=function(_0x1ea258){while(--_0x1ea258){_0x3ea89b['push'](_0x3ea89b['shift']());}};_0x15d675(++_0x3c8161);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x2ac57f,_0xfa965a){var _0x2e5d96=function(_0x4f1a61){while(--_0x4f1a61){_0x2ac57f['push'](_0x2ac57f['shift']());}};_0x2e5d96(++_0xfa965a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 3b2baf7..3c95e2c 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 _0xf69d=['addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0xaff91c,_0x520313){var _0x432895=function(_0x36cd94){while(--_0x36cd94){_0xaff91c['push'](_0xaff91c['shift']());}};_0x432895(++_0x520313);}(_0xf69d,0xd3));var _0xdf69=function(_0x40206d,_0x47c4c5){_0x40206d=_0x40206d-0x0;var _0x257ad8=_0xf69d[_0x40206d];return _0x257ad8;};'use strict';var client=require(_0xdf69('0x0'));exports[_0xdf69('0x1')]=function(_0x32d6ba,_0xe063fc){return client[_0xdf69('0x2')]('UpdateWhatsappInteraction',{'body':_0xe063fc,'options':{'where':{'id':_0x32d6ba}},'log':_0xdf69('0x3')});};exports[_0xdf69('0x4')]=function(_0x5b5eec,_0x13ecb6){return client[_0xdf69('0x2')](_0xdf69('0x5'),{'body':_0x13ecb6,'options':{'where':{'id':_0x5b5eec}},'log':_0xdf69('0x6')});}; \ No newline at end of file +var _0x6b1b=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3c12ab,_0x5234e9){var _0x29f920=function(_0x4f78fb){while(--_0x4f78fb){_0x3c12ab['push'](_0x3c12ab['shift']());}};_0x29f920(++_0x5234e9);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x6b1b[_0x37bd26];return _0xe83dc4;};'use strict';var client=require('../client');exports[_0xb6b1('0x0')]=function(_0xe9ad5b,_0x446608){return client['Request'](_0xb6b1('0x1'),{'body':_0x446608,'options':{'where':{'id':_0xe9ad5b}},'log':_0xb6b1('0x2')});};exports[_0xb6b1('0x3')]=function(_0xaaa201,_0x1f218b){return client[_0xb6b1('0x4')](_0xb6b1('0x5'),{'body':_0x1f218b,'options':{'where':{'id':_0xaaa201}},'log':_0xb6b1('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 424a104..2b5f305 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 _0x7697=['../client','create','Request','CreateWhatsappMessage'];(function(_0x248afa,_0xc057df){var _0x26d2d2=function(_0x337547){while(--_0x337547){_0x248afa['push'](_0x248afa['shift']());}};_0x26d2d2(++_0xc057df);}(_0x7697,0xdc));var _0x7769=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0x7697[_0x9b7a64];return _0x33fd98;};'use strict';var client=require(_0x7769('0x0'));exports[_0x7769('0x1')]=function(_0x7c63f6){return client[_0x7769('0x2')](_0x7769('0x3'),{'body':_0x7c63f6,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x3973=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x89b671,_0x4e8bb0){var _0x4fb0ca=function(_0x494e93){while(--_0x494e93){_0x89b671['push'](_0x89b671['shift']());}};_0x4fb0ca(++_0x4e8bb0);}(_0x3973,0x1bc));var _0x3397=function(_0xa949bb,_0x5b0e91){_0xa949bb=_0xa949bb-0x0;var _0x34e8ab=_0x3973[_0xa949bb];return _0x34e8ab;};'use strict';var client=require(_0x3397('0x0'));exports[_0x3397('0x1')]=function(_0x19c61a){return client['Request'](_0x3397('0x2'),{'body':_0x19c61a,'log':_0x3397('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 9613233..3d61d4f 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 _0x9537=['timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0xbb63be,_0x3de5da){var _0x5679bf=function(_0x21418f){while(--_0x21418f){_0xbb63be['push'](_0xbb63be['shift']());}};_0x5679bf(++_0x3de5da);}(_0x9537,0x164));var _0x7953=function(_0x5ca84d,_0x4ab826){_0x5ca84d=_0x5ca84d-0x0;var _0x39f824=_0x9537[_0x5ca84d];return _0x39f824;};'use strict';var client=require(_0x7953('0x0'));exports[_0x7953('0x1')]=function(){return function(){return client['Request'](_0x7953('0x2'),{'options':{'raw':![],'attributes':['id',_0x7953('0x3'),_0x7953('0x4'),'strategy'],'include':[{'model':_0x7953('0x5'),'as':_0x7953('0x6'),'attributes':['id',_0x7953('0x3'),_0x7953('0x7'),_0x7953('0x8')]}]},'log':_0x7953('0x1')});};}; \ No newline at end of file +var _0x8002=['User','Agents','online','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout','strategy'];(function(_0x24c2b9,_0x91727c){var _0x53d9b3=function(_0x5c0eb0){while(--_0x5c0eb0){_0x24c2b9['push'](_0x24c2b9['shift']());}};_0x53d9b3(++_0x91727c);}(_0x8002,0x176));var _0x2800=function(_0x2043d9,_0x45aef3){_0x2043d9=_0x2043d9-0x0;var _0x2a8f5e=_0x8002[_0x2043d9];return _0x2a8f5e;};'use strict';var client=require(_0x2800('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x2800('0x1')](_0x2800('0x2'),{'options':{'raw':![],'attributes':['id',_0x2800('0x3'),_0x2800('0x4'),_0x2800('0x5')],'include':[{'model':_0x2800('0x6'),'as':_0x2800('0x7'),'attributes':['id',_0x2800('0x3'),_0x2800('0x8'),'whatsappPause']}]},'log':_0x2800('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 85b3529..ab7c914 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 _0x6d3f=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6d3f,0x13a));var _0xf6d3=function(_0x224332,_0x3b7200){_0x224332=_0x224332-0x0;var _0x5e44ff=_0x6d3f[_0x224332];return _0x5e44ff;};'use strict';var client=require(_0xf6d3('0x0'));exports[_0xf6d3('0x1')]=function(_0x2a6b2d){return client[_0xf6d3('0x2')](_0xf6d3('0x3'),{'body':_0x2a6b2d,'log':_0xf6d3('0x3')});};exports[_0xf6d3('0x4')]=function(_0xf1365c,_0x399f22){return client[_0xf6d3('0x2')](_0xf6d3('0x5'),{'body':_0x399f22,'options':{'where':{'uniqueid':_0xf1365c},'order':[['id',_0xf6d3('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x4e88=['UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x1186ba,_0x421a86){var _0x13a347=function(_0x357acb){while(--_0x357acb){_0x1186ba['push'](_0x1186ba['shift']());}};_0x13a347(++_0x421a86);}(_0x4e88,0x1b8));var _0x84e8=function(_0x40675f,_0x509872){_0x40675f=_0x40675f-0x0;var _0x2b799f=_0x4e88[_0x40675f];return _0x2b799f;};'use strict';var client=require(_0x84e8('0x0'));exports['create']=function(_0x4e5777){return client[_0x84e8('0x1')](_0x84e8('0x2'),{'body':_0x4e5777,'log':'CreateWhatsappQueueReport'});};exports[_0x84e8('0x3')]=function(_0x252e67,_0x2d8929){return client[_0x84e8('0x1')](_0x84e8('0x4'),{'body':_0x2d8929,'options':{'where':{'uniqueid':_0x252e67},'order':[['id',_0x84e8('0x5')]],'limit':0x1},'log':_0x84e8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 0ff03b5..cae6ffb 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 _0xd594=['[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find','name','timeout','createQueue','atimeout','channel','START:%s','rules','end'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xd594,0x113));var _0x4d59=function(_0x4e74fd,_0x40c558){_0x4e74fd=_0x4e74fd-0x0;var _0x43c29f=_0xd594[_0x4e74fd];return _0x43c29f;};'use strict';var schema=require(_0x4d59('0x0'));var _=require(_0x4d59('0x1'));var util=require(_0x4d59('0x2'));var seqqueue=require(_0x4d59('0x3'));var logger=require(_0x4d59('0x4'))('routing');var strategy=require(_0x4d59('0x5'));var queue=schema({'name':{'type':_0x4d59('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x4d59('0x7'),'message':_0x4d59('0x8')}});function writeLog(_0x32d0dc,_0x1bb1ac,_0x6955c3){return logger[_0x4d59('0x9')](util[_0x4d59('0xa')](_0x4d59('0xb'),_0x32d0dc,_0x1bb1ac['name'],_0x6955c3));}function handleFindAgent(_0x2b85e9){return function(_0x4cc7c0){return _0x4cc7c0['name'][_0x4d59('0xc')]()===_0x2b85e9['toLowerCase']();};}exports[_0x4d59('0xd')]=function(_0x183b54,_0x18d343,_0x44781a,_0x16f69c){return function(_0x3988b6){try{var _0x2c307b={'name':_0x18d343[0x0],'timeout':_0x18d343[0x1]};var _0x50da04=queue[_0x4d59('0x0')](_0x2c307b,{'typecast':!![]});if(_0x50da04[_0x4d59('0xe')]){logger[_0x4d59('0xf')](_0x4d59('0x10'),_0x183b54,_[_0x4d59('0x11')](_0x50da04,'message')[_0x4d59('0x12')](',\x20'));_0x3988b6[_0x4d59('0x13')]();}else{var _0x451d26=_[_0x4d59('0x14')](_0x44781a['agents'],handleFindAgent(_0x2c307b[_0x4d59('0x15')]));if(_0x451d26){var _0x38e00d=(_0x2c307b[_0x4d59('0x16')]||0xa)*0x3e8;var _0x12f3b0,_0x547231;var _0x5c2a95=seqqueue[_0x4d59('0x17')](_0x38e00d);_0x5c2a95['id']=_0x183b54;_0x5c2a95[_0x4d59('0x18')]=_0x38e00d;_0x5c2a95[_0x4d59('0x19')]=_0x16f69c[_0x4d59('0x19')];writeLog(_0x183b54,_0x451d26,util[_0x4d59('0xa')](_0x4d59('0x1a'),_0x38e00d));_0x44781a[_0x4d59('0x1b')][_0x183b54]['on'](_0x4d59('0x1c'),function(){logger[_0x4d59('0x9')](_0x4d59('0x1d'),_0x183b54);clearTimeout(_0x547231);_0x547231=undefined;_0x5c2a95[_0x4d59('0x1e')]();if(_0x44781a[_0x4d59('0x1b')][_0x183b54]){delete _0x44781a[_0x4d59('0x1b')][_0x183b54];}_0x3988b6[_0x4d59('0x13')]();});_0x44781a[_0x4d59('0x1b')][_0x183b54]['on'](_0x4d59('0x1f'),function(){if(_0x44781a[_0x4d59('0x1b')][_0x183b54]){delete _0x44781a[_0x4d59('0x1b')][_0x183b54];}});_0x547231=setTimeout(function(){logger[_0x4d59('0x9')](_0x4d59('0x20'),_0x183b54);clearTimeout(_0x547231);_0x5c2a95[_0x4d59('0x1e')]();_0x3988b6[_0x4d59('0x21')]();},_0x38e00d);strategy[_0x4d59('0x22')](_0x5c2a95,_0x451d26,_0x44781a,_0x16f69c);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x183b54,_0x2c307b[_0x4d59('0x15')]);_0x3988b6[_0x4d59('0x13')]();}}}catch(_0xe02f67){console[_0x4d59('0x23')](_0xe02f67);logger[_0x4d59('0xf')](_0x4d59('0x24'),_0x183b54,_0xe02f67[_0x4d59('0x25')]);_0x3988b6[_0x4d59('0x13')]();}};}; \ No newline at end of file +var _0xf6c3=['join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','error','[%s][AGENT]\x20%s','map','message'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0xf6c3,0x9a));var _0x3f6c=function(_0x4a7b0f,_0x4a026d){_0x4a7b0f=_0x4a7b0f-0x0;var _0x5a9f76=_0xf6c3[_0x4a7b0f];return _0x5a9f76;};'use strict';var schema=require(_0x3f6c('0x0'));var _=require(_0x3f6c('0x1'));var util=require(_0x3f6c('0x2'));var seqqueue=require(_0x3f6c('0x3'));var logger=require(_0x3f6c('0x4'))(_0x3f6c('0x5'));var strategy=require(_0x3f6c('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x3f6c('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4ce0f3,_0x34d1bc,_0xf90661){return logger[_0x3f6c('0x8')](util['format'](_0x3f6c('0x9'),_0x4ce0f3,_0x34d1bc[_0x3f6c('0xa')],_0xf90661));}function handleFindAgent(_0x34ca9b){return function(_0x256288){return _0x256288[_0x3f6c('0xa')]['toLowerCase']()===_0x34ca9b['toLowerCase']();};}exports[_0x3f6c('0xb')]=function(_0x10a723,_0x1e27f8,_0x11c4f8,_0xe9ba17){return function(_0x4f7bc1){try{var _0x376e16={'name':_0x1e27f8[0x0],'timeout':_0x1e27f8[0x1]};var _0x5ea4a2=queue[_0x3f6c('0x0')](_0x376e16,{'typecast':!![]});if(_0x5ea4a2['length']){logger[_0x3f6c('0xc')](_0x3f6c('0xd'),_0x10a723,_[_0x3f6c('0xe')](_0x5ea4a2,_0x3f6c('0xf'))[_0x3f6c('0x10')](',\x20'));_0x4f7bc1[_0x3f6c('0x11')]();}else{var _0x1c1e64=_[_0x3f6c('0x12')](_0x11c4f8[_0x3f6c('0x13')],handleFindAgent(_0x376e16[_0x3f6c('0xa')]));if(_0x1c1e64){var _0x529161=(_0x376e16[_0x3f6c('0x14')]||0xa)*0x3e8;var _0x267de8,_0x166729;var _0x38ac55=seqqueue[_0x3f6c('0x15')](_0x529161);_0x38ac55['id']=_0x10a723;_0x38ac55['atimeout']=_0x529161;_0x38ac55[_0x3f6c('0x16')]=_0xe9ba17[_0x3f6c('0x16')];writeLog(_0x10a723,_0x1c1e64,util['format'](_0x3f6c('0x17'),_0x529161));_0x11c4f8[_0x3f6c('0x18')][_0x10a723]['on'](_0x3f6c('0x19'),function(){logger[_0x3f6c('0x8')](_0x3f6c('0x1a'),_0x10a723);clearTimeout(_0x166729);_0x166729=undefined;_0x38ac55[_0x3f6c('0x1b')]();if(_0x11c4f8[_0x3f6c('0x18')][_0x10a723]){delete _0x11c4f8[_0x3f6c('0x18')][_0x10a723];}_0x4f7bc1['stop']();});_0x11c4f8['rules'][_0x10a723]['on'](_0x3f6c('0x1c'),function(){if(_0x11c4f8[_0x3f6c('0x18')][_0x10a723]){delete _0x11c4f8[_0x3f6c('0x18')][_0x10a723];}});_0x166729=setTimeout(function(){logger[_0x3f6c('0x8')](_0x3f6c('0x1d'),_0x10a723);clearTimeout(_0x166729);_0x38ac55[_0x3f6c('0x1b')]();_0x4f7bc1[_0x3f6c('0x1e')]();},_0x529161);strategy['agent'](_0x38ac55,_0x1c1e64,_0x11c4f8,_0xe9ba17);}else{logger['error'](_0x3f6c('0x1f'),_0x10a723,_0x376e16[_0x3f6c('0xa')]);_0x4f7bc1['stop']();}}}catch(_0x89afd3){console[_0x3f6c('0x20')](_0x89afd3);logger['error'](_0x3f6c('0x21'),_0x10a723,_0x89afd3['stack']);_0x4f7bc1[_0x3f6c('0x11')]();}};}; \ 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 b84d1b5..c640ff7 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 _0x5bdd=['error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','postText','next','providerName','providerResponse','dialogState','Failed','stringify','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x5bdd,0x1e4));var _0xd5bd=function(_0x43f9d8,_0x4f5a7a){_0x43f9d8=_0x43f9d8-0x0;var _0x4c0720=_0x5bdd[_0x43f9d8];return _0x4c0720;};'use strict';var _=require('lodash');var moment=require(_0xd5bd('0x0'));var AWS=require(_0xd5bd('0x1'));var utils=require(_0xd5bd('0x2'));var logger=require(_0xd5bd('0x3'))('routing');var rpc={'chatMessage':require(_0xd5bd('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd5bd('0x5')),'smsMessage':require(_0xd5bd('0x6')),'faxMessage':require(_0xd5bd('0x7')),'whatsappMessage':require(_0xd5bd('0x8'))};exports[_0xd5bd('0x9')]=function(_0x182dcd,_0x2b7241){return function(_0x4fca65){try{if(!_[_0xd5bd('0xa')](this[_0xd5bd('0xb')][_0xd5bd('0xc')])){logger[_0xd5bd('0xd')]('[%s][AMAZONLEX]\x20%s',_0x182dcd,_0xd5bd('0xe'));return _0x4fca65['next']();}var _0x196406={'ContactId':this[_0xd5bd('0xf')]['id'],'sentAt':moment()[_0xd5bd('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xd5bd('0x11')]==='sms'||this['channel']===_0xd5bd('0x12')){_0x196406[_0xd5bd('0x13')]=this[_0xd5bd('0xb')][_0xd5bd('0x13')];}var _0xbb8a64=this[_0xd5bd('0x11')];if(_0xbb8a64===_0xd5bd('0x14')){_0x196406['ChatWebsiteId']=this[_0xd5bd('0x15')]['id'];}else{_0x196406[_[_0xd5bd('0x16')](_0xbb8a64)+_0xd5bd('0x17')]=this[_0xd5bd('0x15')]['id'];}_0x196406[_['upperFirst'](_0xbb8a64)+_0xd5bd('0x18')]=this[_0xd5bd('0xb')]['id'];if(this['interaction'][_0xd5bd('0x19')]){var _0x5a71cf=_0x2b7241[0x4];if(!_['isEmpty'](_0x5a71cf)){_0x196406[_0xd5bd('0x1a')]=utils[_0xd5bd('0x1b')](_0x5a71cf,this);return rpc[_0xbb8a64+_0xd5bd('0x1c')][_0xd5bd('0x1d')](_0x196406)[_0xd5bd('0x1e')](function(_0x2b271c){logger['info'](_0xd5bd('0x1f'),_0x182dcd,_0x196406['body']);})[_0xd5bd('0x20')](function(_0x248907){logger[_0xd5bd('0x21')]('[%s][AMAZONLEX]\x20%s',_0x182dcd,JSON['stringify'](_0x248907));})[_0xd5bd('0x22')](function(){logger['info'](_0xd5bd('0x23'),_0x182dcd);_0x4fca65[_0xd5bd('0x24')]();});}else{logger['info'](_0xd5bd('0x25'),_0x182dcd);_0x4fca65['stop']();}}else{var _0x244f1e=this;var _0x2c60bc=new AWS['LexRuntime']({'accessKeyId':_0x2b7241[0x0],'secretAccessKey':_0x2b7241[0x1],'region':_0x2b7241[0x2]});var _0x2febf2={'botAlias':_0xd5bd('0x26'),'botName':_0x2b7241[0x3],'inputText':this[_0xd5bd('0x27')][_0xd5bd('0x1a')],'userId':this['channel']+':'+this[_0xd5bd('0xb')]['id']['toString']()};_0x2c60bc[_0xd5bd('0x28')](_0x2febf2,function(_0x471e4c,_0x736c1c){if(_0x471e4c){logger[_0xd5bd('0x21')]('[%s][AMAZONLEX]\x20%s',_0x182dcd,_0x471e4c[_0xd5bd('0x27')]);_0x4fca65[_0xd5bd('0x29')]();}else if(_0x736c1c&&_0x736c1c[_0xd5bd('0x27')]){_0x244f1e[_0xd5bd('0x1a')]['amazonlex']=_0x736c1c;_0x196406[_0xd5bd('0x1a')]=_0x736c1c[_0xd5bd('0x27')];_0x196406[_0xd5bd('0x2a')]='amazonlex';_0x196406[_0xd5bd('0x2b')]=JSON['stringify'](_0x736c1c);return rpc[_0xbb8a64+'Message']['create'](_0x196406)[_0xd5bd('0x1e')](function(_0x12c878){logger[_0xd5bd('0xd')](_0xd5bd('0x1f'),_0x182dcd,_0x196406['body']);if(_0x736c1c[_0xd5bd('0x2c')]==_0xd5bd('0x2d')){_0x4fca65['next']();}else{_0x4fca65['stop']();}})[_0xd5bd('0x20')](function(_0x176094){logger[_0xd5bd('0x21')](_0xd5bd('0x1f'),_0x182dcd,JSON[_0xd5bd('0x2e')](_0x176094));_0x4fca65[_0xd5bd('0x29')]();});}else{_0x4fca65[_0xd5bd('0x29')]();}});}}catch(_0x465b31){logger[_0xd5bd('0x21')](_0xd5bd('0x1f'),_0x182dcd,JSON[_0xd5bd('0x2e')](_0x465b31));_0x4fca65[_0xd5bd('0x24')]();}};}; \ No newline at end of file +var _0x141c=['aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','postText','message','amazonlex','providerName','providerResponse','Message','then','dialogState','Failed','stringify','lodash','moment'];(function(_0x307dae,_0x2c853f){var _0x355ab2=function(_0x4bdf71){while(--_0x4bdf71){_0x307dae['push'](_0x307dae['shift']());}};_0x355ab2(++_0x2c853f);}(_0x141c,0x94));var _0xc141=function(_0x402985,_0x2ac5d4){_0x402985=_0x402985-0x0;var _0x3f6382=_0x141c[_0x402985];return _0x3f6382;};'use strict';var _=require(_0xc141('0x0'));var moment=require(_0xc141('0x1'));var AWS=require(_0xc141('0x2'));var utils=require('./utils');var logger=require(_0xc141('0x3'))(_0xc141('0x4'));var rpc={'chatMessage':require(_0xc141('0x5')),'openchannelMessage':require(_0xc141('0x6')),'mailMessage':require(_0xc141('0x7')),'smsMessage':require(_0xc141('0x8')),'faxMessage':require(_0xc141('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xc141('0xa')]=function(_0x487085,_0x5d8b5e){return function(_0x1de4c3){try{if(!_[_0xc141('0xb')](this[_0xc141('0xc')][_0xc141('0xd')])){logger[_0xc141('0xe')](_0xc141('0xf'),_0x487085,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1de4c3[_0xc141('0x10')]();}var _0x1aebe7={'ContactId':this['contact']['id'],'sentAt':moment()[_0xc141('0x11')](_0xc141('0x12')),'direction':'out'};if(this[_0xc141('0x13')]==='sms'||this[_0xc141('0x13')]===_0xc141('0x14')){_0x1aebe7[_0xc141('0x15')]=this[_0xc141('0xc')][_0xc141('0x15')];}var _0x54c051=this['channel'];if(_0x54c051===_0xc141('0x16')){_0x1aebe7[_0xc141('0x17')]=this[_0xc141('0x18')]['id'];}else{_0x1aebe7[_['upperFirst'](_0x54c051)+_0xc141('0x19')]=this[_0xc141('0x18')]['id'];}_0x1aebe7[_[_0xc141('0x1a')](_0x54c051)+_0xc141('0x1b')]=this[_0xc141('0xc')]['id'];if(this['interaction'][_0xc141('0x1c')]){var _0x7609ce=_0x5d8b5e[0x4];if(!_[_0xc141('0x1d')](_0x7609ce)){_0x1aebe7[_0xc141('0x1e')]=utils[_0xc141('0x1f')](_0x7609ce,this);return rpc[_0x54c051+'Message'][_0xc141('0x20')](_0x1aebe7)['then'](function(_0x24096c){logger[_0xc141('0xe')](_0xc141('0xf'),_0x487085,_0x1aebe7[_0xc141('0x1e')]);})[_0xc141('0x21')](function(_0x3ca594){logger[_0xc141('0x22')](_0xc141('0xf'),_0x487085,JSON['stringify'](_0x3ca594));})[_0xc141('0x23')](function(){logger['info'](_0xc141('0x24'),_0x487085);_0x1de4c3[_0xc141('0x25')]();});}else{logger[_0xc141('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x487085);_0x1de4c3[_0xc141('0x25')]();}}else{var _0x512c75=this;var _0x18c213=new AWS[(_0xc141('0x26'))]({'accessKeyId':_0x5d8b5e[0x0],'secretAccessKey':_0x5d8b5e[0x1],'region':_0x5d8b5e[0x2]});var _0x41b708={'botAlias':_0xc141('0x27'),'botName':_0x5d8b5e[0x3],'inputText':this['message'][_0xc141('0x1e')],'userId':this[_0xc141('0x13')]+':'+this[_0xc141('0xc')]['id']['toString']()};_0x18c213[_0xc141('0x28')](_0x41b708,function(_0x5bb001,_0x22e195){if(_0x5bb001){logger[_0xc141('0x22')](_0xc141('0xf'),_0x487085,_0x5bb001[_0xc141('0x29')]);_0x1de4c3['next']();}else if(_0x22e195&&_0x22e195[_0xc141('0x29')]){_0x512c75[_0xc141('0x1e')][_0xc141('0x2a')]=_0x22e195;_0x1aebe7[_0xc141('0x1e')]=_0x22e195[_0xc141('0x29')];_0x1aebe7[_0xc141('0x2b')]=_0xc141('0x2a');_0x1aebe7[_0xc141('0x2c')]=JSON['stringify'](_0x22e195);return rpc[_0x54c051+_0xc141('0x2d')][_0xc141('0x20')](_0x1aebe7)[_0xc141('0x2e')](function(_0x2b5674){logger[_0xc141('0xe')]('[%s][AMAZONLEX]\x20%s',_0x487085,_0x1aebe7[_0xc141('0x1e')]);if(_0x22e195[_0xc141('0x2f')]==_0xc141('0x30')){_0x1de4c3['next']();}else{_0x1de4c3[_0xc141('0x25')]();}})[_0xc141('0x21')](function(_0x59f05b){logger[_0xc141('0x22')]('[%s][AMAZONLEX]\x20%s',_0x487085,JSON[_0xc141('0x31')](_0x59f05b));_0x1de4c3[_0xc141('0x10')]();});}else{_0x1de4c3[_0xc141('0x10')]();}});}}catch(_0x2b262a){logger[_0xc141('0x22')](_0xc141('0xf'),_0x487085,JSON[_0xc141('0x31')](_0x2b262a));_0x1de4c3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 3e9f9fa..87f7131 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 _0x44f1=['consequence','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','body','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','','headers','auto-replied','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','error','autoreplyExecuted','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc'];(function(_0x4d5f37,_0x431410){var _0x5ef460=function(_0x414c76){while(--_0x414c76){_0x4d5f37['push'](_0x4d5f37['shift']());}};_0x5ef460(++_0x431410);}(_0x44f1,0x13e));var _0x144f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x44f1[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var moment=require(_0x144f('0x0'));var utils=require(_0x144f('0x1'));var logger=require(_0x144f('0x2'))('routing');var rpc={'chatMessage':require(_0x144f('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x144f('0x4')),'smsMessage':require(_0x144f('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x144f('0x6')),'chatInteraction':require(_0x144f('0x7')),'openchannelInteraction':require(_0x144f('0x8')),'mailInteraction':require(_0x144f('0x9')),'smsInteraction':require(_0x144f('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x144f('0xb'));exports[_0x144f('0xc')]=function(_0x4135d1,_0x22676b,_0x124072,_0x28ef66){return function(_0x90fd00){try{var _0x33112e=this['channel'];if(_0x33112e===_0x144f('0xd')&&_0x28ef66['body'][_0x144f('0xe')]){logger[_0x144f('0xf')](_0x144f('0x10'),_0x4135d1,_0x144f('0x11'));return _0x90fd00[_0x144f('0x12')]();}if(_0x22676b[0x0]==='1'&&(_[_0x144f('0x13')](this[_0x144f('0x14')][_0x144f('0x15')])||!this[_0x144f('0x14')]['created'])){logger[_0x144f('0xf')](_0x144f('0x10'),_0x4135d1,'Autoreply\x20already\x20sent');return _0x90fd00[_0x144f('0x12')]();}if(_0x22676b[0x0]==='2'&&this[_0x144f('0x14')]['autoreplyExecuted']){logger[_0x144f('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4135d1,'One\x20Time\x20already\x20sent');return _0x90fd00[_0x144f('0x12')]();}var _0x4c2433={'ContactId':this[_0x144f('0x16')]['id'],'sentAt':moment()[_0x144f('0x17')](_0x144f('0x18')),'direction':_0x144f('0x19')};if(this[_0x144f('0x1a')]===_0x144f('0xd')){_0x4c2433['body']=utils[_0x144f('0x1b')](_0x22676b[0x2],this);}else{_0x4c2433[_0x144f('0x1c')]=utils['getMustacheRender'](_0x22676b[0x1],this);}if(this[_0x144f('0x1d')]){_0x4c2433['to']=this[_0x144f('0x1d')]['from']||'';if(this['channel']===_0x144f('0xd')&&_0x22676b[0x1]==='1'){_0x4c2433['cc']=this[_0x144f('0x1d')]['cc']||'';}_0x4c2433['from']=this[_0x144f('0x1d')]['to']||'';_0x4c2433[_0x144f('0x1e')]=this[_0x144f('0x1d')]['phone']||'';_0x4c2433[_0x144f('0x1f')]=!![];if(this['message'][_0x144f('0x20')]){_0x4c2433['subject']='';_0x4c2433[_0x144f('0x20')]+=_[_0x144f('0x21')](this[_0x144f('0x1d')][_0x144f('0x20')],_0x144f('0x22'))?'':_0x144f('0x23');_0x4c2433[_0x144f('0x20')]+=this[_0x144f('0x1d')][_0x144f('0x20')];}}if(this[_0x144f('0x1a')]===_0x144f('0x24')){_0x4c2433[_0x144f('0x25')]=this[_0x144f('0x26')]['id'];}else{_0x4c2433[_[_0x144f('0x27')](this[_0x144f('0x1a')])+_0x144f('0x28')]=this[_0x144f('0x26')]['id'];}_0x4c2433[_[_0x144f('0x27')](this[_0x144f('0x1a')])+'InteractionId']=this[_0x144f('0x14')]['id'];var _0x18a091=this[_0x144f('0x14')];if(rpc[this[_0x144f('0x1a')]+_0x144f('0x29')]){if(this[_0x144f('0x1a')]==='mail'){_0x4c2433[_0x144f('0x2a')]=this[_0x144f('0x1d')][_0x144f('0x2b')];_0x4c2433[_0x144f('0x2c')]=_0x144f('0x2d')+_['replace'](_0x4c2433[_0x144f('0x1c')],_0x144f('0x2e'),'','replace','','headers','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','finally','resolve','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject'];(function(_0x2f8f91,_0x2224a3){var _0x4ffe69=function(_0x178f7d){while(--_0x178f7d){_0x2f8f91['push'](_0x2f8f91['shift']());}};_0x4ffe69(++_0x2224a3);}(_0x9b86,0x1c4));var _0x69b8=function(_0x1f26c5,_0x543dd4){_0x1f26c5=_0x1f26c5-0x0;var _0x2268ab=_0x9b86[_0x1f26c5];return _0x2268ab;};'use strict';var _=require(_0x69b8('0x0'));var moment=require(_0x69b8('0x1'));var utils=require(_0x69b8('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x69b8('0x3')),'openchannelMessage':require(_0x69b8('0x4')),'mailMessage':require(_0x69b8('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x69b8('0x6')),'whatsappMessage':require(_0x69b8('0x7')),'chatInteraction':require(_0x69b8('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x69b8('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x69b8('0xa')),'whatsappInteraction':require(_0x69b8('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x69b8('0xc')]=function(_0x3c213c,_0x10f315,_0x3ac508,_0x34fc59){return function(_0x1da4f8){try{var _0x227f04=this[_0x69b8('0xd')];if(_0x227f04===_0x69b8('0xe')&&_0x34fc59[_0x69b8('0xf')][_0x69b8('0x10')]){logger[_0x69b8('0x11')](_0x69b8('0x12'),_0x3c213c,_0x69b8('0x13'));return _0x1da4f8[_0x69b8('0x14')]();}if(_0x10f315[0x0]==='1'&&(_[_0x69b8('0x15')](this[_0x69b8('0x16')][_0x69b8('0x17')])||!this['interaction'][_0x69b8('0x17')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3c213c,_0x69b8('0x18'));return _0x1da4f8[_0x69b8('0x14')]();}if(_0x10f315[0x0]==='2'&&this['interaction'][_0x69b8('0x19')]){logger[_0x69b8('0x11')](_0x69b8('0x1a'),_0x3c213c,_0x69b8('0x1b'));return _0x1da4f8[_0x69b8('0x14')]();}var _0x26fa26={'ContactId':this[_0x69b8('0x1c')]['id'],'sentAt':moment()[_0x69b8('0x1d')](_0x69b8('0x1e')),'direction':_0x69b8('0x1f')};if(this[_0x69b8('0xd')]===_0x69b8('0xe')){_0x26fa26[_0x69b8('0xf')]=utils['getMustacheRender'](_0x10f315[0x2],this);}else{_0x26fa26[_0x69b8('0xf')]=utils[_0x69b8('0x20')](_0x10f315[0x1],this);}if(this['message']){_0x26fa26['to']=this[_0x69b8('0x21')]['from']||'';if(this[_0x69b8('0xd')]===_0x69b8('0xe')&&_0x10f315[0x1]==='1'){_0x26fa26['cc']=this['message']['cc']||'';}_0x26fa26[_0x69b8('0x22')]=this[_0x69b8('0x21')]['to']||'';_0x26fa26[_0x69b8('0x23')]=this[_0x69b8('0x21')][_0x69b8('0x23')]||'';_0x26fa26[_0x69b8('0x24')]=!![];if(this[_0x69b8('0x21')]['subject']){_0x26fa26['subject']='';_0x26fa26[_0x69b8('0x25')]+=_[_0x69b8('0x26')](this[_0x69b8('0x21')]['subject'],_0x69b8('0x27'))?'':_0x69b8('0x28');_0x26fa26[_0x69b8('0x25')]+=this[_0x69b8('0x21')][_0x69b8('0x25')];}}if(this['channel']==='chat'){_0x26fa26[_0x69b8('0x29')]=this[_0x69b8('0x2a')]['id'];}else{_0x26fa26[_[_0x69b8('0x2b')](this[_0x69b8('0xd')])+_0x69b8('0x2c')]=this[_0x69b8('0x2a')]['id'];}_0x26fa26[_[_0x69b8('0x2b')](this['channel'])+_0x69b8('0x2d')]=this['interaction']['id'];var _0x2ee286=this[_0x69b8('0x16')];if(rpc[this[_0x69b8('0xd')]+_0x69b8('0x2e')]){if(this['channel']===_0x69b8('0xe')){_0x26fa26['inReplyTo']=this[_0x69b8('0x21')][_0x69b8('0x2f')];_0x26fa26[_0x69b8('0x30')]=_0x69b8('0x31')+_[_0x69b8('0x32')](_0x26fa26['body'],_0x69b8('0x33'),']+(>|$)/g,''),'priorityTrue':_0x263b0f[0x1],'priorityFalse':_0x263b0f[0x2]};var _0x320d29=gotoif[_0x2f15('0x0')](_0x2f7a1b,{'typecast':!![]});if(_0x320d29[_0x2f15('0xc')]){logger[_0x2f15('0xd')](_0x2f15('0xe'),_0x5f1168,_[_0x2f15('0xf')](_0x320d29,'message')[_0x2f15('0x10')](',\x20'));_0x1e04c4[_0x2f15('0x11')]();}else{try{var _0x3b2c6f=eval('('+_0x2f7a1b[_0x2f15('0x12')]+')');var _0x2242b6=_0x3b2c6f?_0x2f7a1b[_0x2f15('0x13')]:_0x2f7a1b[_0x2f15('0x14')];logger[_0x2f15('0x15')](_0x2f15('0x16'),_0x5f1168,_0x2f7a1b[_0x2f15('0x12')],_0x3b2c6f,_0x2242b6||_0x2f15('0x17'));if(_0x2242b6){var _0x47377b=_[_0x2f15('0x18')](_0x1e04c4[_0x2f15('0x19')](),{'p':_0x2242b6});if(_0x47377b>=0x0){logger[_0x2f15('0x15')](_0x2f15('0x1a'),_0x5f1168,_0x2242b6||'next',_0x47377b);_0x1e04c4[_0x2f15('0x17')](_0x47377b);}else{logger[_0x2f15('0x15')](_0x2f15('0x1b'),_0x5f1168,_0x2242b6||'next');_0x1e04c4[_0x2f15('0x11')]();}}else{_0x1e04c4[_0x2f15('0x17')]();}}catch(_0x1b49db){logger[_0x2f15('0xd')](_0x2f15('0x1c'),_0x5f1168,_0x1b49db[_0x2f15('0x1d')]);_0x1e04c4[_0x2f15('0x11')]();}}}catch(_0x2c2d2a){logger[_0x2f15('0xd')](_0x2f15('0xe'),_0x5f1168,JSON[_0x2f15('0x1e')](_0x2c2d2a));_0x1e04c4[_0x2f15('0x11')]();}};}; \ No newline at end of file +var _0x3b6c=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x2bd3fc,_0x2e2d87){var _0x4d02fc=function(_0x200bd1){while(--_0x200bd1){_0x2bd3fc['push'](_0x2bd3fc['shift']());}};_0x4d02fc(++_0x2e2d87);}(_0x3b6c,0x162));var _0xc3b6=function(_0x3d05ce,_0x76a238){_0x3d05ce=_0x3d05ce-0x0;var _0x534881=_0x3b6c[_0x3d05ce];return _0x534881;};'use strict';var schema=require(_0xc3b6('0x0'));var _=require(_0xc3b6('0x1'));var htmlToText=require(_0xc3b6('0x2'));var utils=require(_0xc3b6('0x3'));var logger=require(_0xc3b6('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xc3b6('0x5')},'priorityTrue':{'type':_0xc3b6('0x6'),'message':_0xc3b6('0x7')},'priorityFalse':{'type':'number','message':_0xc3b6('0x8')}});exports[_0xc3b6('0x9')]=function(_0x2eb0ae,_0x2c05de){return function(_0x1f3d13){try{var _0x314349={'condition':htmlToText[_0xc3b6('0xa')](utils['getMustacheRender'](_0x2c05de[0x0],this),{'wordwrap':![]})[_0xc3b6('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c05de[0x1],'priorityFalse':_0x2c05de[0x2]};var _0x3a9832=gotoif[_0xc3b6('0x0')](_0x314349,{'typecast':!![]});if(_0x3a9832[_0xc3b6('0xc')]){logger[_0xc3b6('0xd')](_0xc3b6('0xe'),_0x2eb0ae,_[_0xc3b6('0xf')](_0x3a9832,_0xc3b6('0x10'))[_0xc3b6('0x11')](',\x20'));_0x1f3d13['stop']();}else{try{var _0x2c5e7a=eval('('+_0x314349[_0xc3b6('0x12')]+')');var _0x4083ad=_0x2c5e7a?_0x314349[_0xc3b6('0x13')]:_0x314349['priorityFalse'];logger[_0xc3b6('0x14')](_0xc3b6('0x15'),_0x2eb0ae,_0x314349[_0xc3b6('0x12')],_0x2c5e7a,_0x4083ad||_0xc3b6('0x16'));if(_0x4083ad){var _0x3b94c5=_[_0xc3b6('0x17')](_0x1f3d13[_0xc3b6('0x18')](),{'p':_0x4083ad});if(_0x3b94c5>=0x0){logger[_0xc3b6('0x14')](_0xc3b6('0x19'),_0x2eb0ae,_0x4083ad||_0xc3b6('0x16'),_0x3b94c5);_0x1f3d13[_0xc3b6('0x16')](_0x3b94c5);}else{logger['info'](_0xc3b6('0x1a'),_0x2eb0ae,_0x4083ad||_0xc3b6('0x16'));_0x1f3d13['stop']();}}else{_0x1f3d13[_0xc3b6('0x16')]();}}catch(_0x4e1083){logger[_0xc3b6('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2eb0ae,_0x4e1083[_0xc3b6('0x10')]);_0x1f3d13[_0xc3b6('0x1b')]();}}}catch(_0x1cfc6f){logger[_0xc3b6('0xd')](_0xc3b6('0xe'),_0x2eb0ae,JSON[_0xc3b6('0x1c')](_0x1cfc6f));_0x1f3d13[_0xc3b6('0x1b')]();}};}; \ 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 b375edf..8c9e9f7 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 _0x7875=['stringify','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s'];(function(_0x416c15,_0x186d0a){var _0x75a7cc=function(_0x20120a){while(--_0x20120a){_0x416c15['push'](_0x416c15['shift']());}};_0x75a7cc(++_0x186d0a);}(_0x7875,0x119));var _0x5787=function(_0x2e0a85,_0x242749){_0x2e0a85=_0x2e0a85-0x0;var _0x2c49bb=_0x7875[_0x2e0a85];return _0x2c49bb;};'use strict';var schema=require(_0x5787('0x0'));var _=require(_0x5787('0x1'));var logger=require(_0x5787('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5787('0x3')}});exports[_0x5787('0x4')]=function(_0x187459,_0x41da7e){return function(_0x39e22d){try{var _0x2cd572={'priority':_0x41da7e[0x0]};var _0xc7668a=gotop[_0x5787('0x0')](_0x2cd572,{'typecast':!![]});if(_0xc7668a[_0x5787('0x5')]){logger[_0x5787('0x6')]('[%s][GOTOP]\x20%s',_0x187459,_[_0x5787('0x7')](_0xc7668a,_0x5787('0x8'))[_0x5787('0x9')](',\x20'));_0x39e22d[_0x5787('0xa')]();}else{logger['info'](_0x5787('0xb'),_0x187459,_0x2cd572['priority']);if(_0x2cd572[_0x5787('0xc')]){var _0x3acb6c=_[_0x5787('0xd')](_0x39e22d[_0x5787('0xe')](),{'p':_0x2cd572['priority']});if(_0x3acb6c>=0x0){logger[_0x5787('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x187459,_0x2cd572[_0x5787('0xc')]||_0x5787('0x10'),_0x3acb6c);_0x39e22d[_0x5787('0x10')](_0x3acb6c);}else{logger[_0x5787('0xf')](_0x5787('0x11'),_0x187459,_0x2cd572[_0x5787('0xc')]||_0x5787('0x10'));_0x39e22d[_0x5787('0xa')]();}}else{_0x39e22d[_0x5787('0x10')]();}}}catch(_0x1c583c){logger[_0x5787('0x6')](_0x5787('0x12'),_0x187459,JSON[_0x5787('0x13')](_0x1c583c));_0x39e22d['stop']();}};}; \ No newline at end of file +var _0x1f44=['message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s'];(function(_0x3dd38d,_0x40a2b9){var _0x1e401d=function(_0x1f61fd){while(--_0x1f61fd){_0x3dd38d['push'](_0x3dd38d['shift']());}};_0x1e401d(++_0x40a2b9);}(_0x1f44,0xa4));var _0x41f4=function(_0xcfcbc2,_0x4cc3ae){_0xcfcbc2=_0xcfcbc2-0x0;var _0x214dab=_0x1f44[_0xcfcbc2];return _0x214dab;};'use strict';var schema=require(_0x41f4('0x0'));var _=require('lodash');var logger=require(_0x41f4('0x1'))('routing');var gotop=schema({'priority':{'type':_0x41f4('0x2'),'required':!![],'message':_0x41f4('0x3')}});exports[_0x41f4('0x4')]=function(_0x149052,_0x974931){return function(_0x3eb4be){try{var _0x131e7b={'priority':_0x974931[0x0]};var _0x108fad=gotop[_0x41f4('0x0')](_0x131e7b,{'typecast':!![]});if(_0x108fad['length']){logger['error'](_0x41f4('0x5'),_0x149052,_['map'](_0x108fad,_0x41f4('0x6'))[_0x41f4('0x7')](',\x20'));_0x3eb4be[_0x41f4('0x8')]();}else{logger['info'](_0x41f4('0x9'),_0x149052,_0x131e7b[_0x41f4('0xa')]);if(_0x131e7b[_0x41f4('0xa')]){var _0x4411fb=_[_0x41f4('0xb')](_0x3eb4be['rules'](),{'p':_0x131e7b['priority']});if(_0x4411fb>=0x0){logger['info'](_0x41f4('0xc'),_0x149052,_0x131e7b[_0x41f4('0xa')]||_0x41f4('0xd'),_0x4411fb);_0x3eb4be[_0x41f4('0xd')](_0x4411fb);}else{logger[_0x41f4('0xe')](_0x41f4('0xf'),_0x149052,_0x131e7b[_0x41f4('0xa')]||_0x41f4('0xd'));_0x3eb4be[_0x41f4('0x8')]();}}else{_0x3eb4be[_0x41f4('0xd')]();}}}catch(_0x1a9c90){logger[_0x41f4('0x10')](_0x41f4('0x5'),_0x149052,JSON['stringify'](_0x1a9c90));_0x3eb4be[_0x41f4('0x8')]();}};}; \ 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 cb2541f..03cb793 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 _0x45d3=['../../rpc/whatsappMessage','consequence','getMustacheRender','chat','ChatWebsiteId','upperFirst','channel','AccountId','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x3bcb35,_0x233157){var _0x6a6bf=function(_0xa8be2b){while(--_0xa8be2b){_0x3bcb35['push'](_0x3bcb35['shift']());}};_0x6a6bf(++_0x233157);}(_0x45d3,0x148));var _0x345d=function(_0x556b4c,_0x43f1af){_0x556b4c=_0x556b4c-0x0;var _0x20b878=_0x45d3[_0x556b4c];return _0x20b878;};'use strict';var _=require('lodash');var utils=require(_0x345d('0x0'));var logger=require(_0x345d('0x1'))(_0x345d('0x2'));var rpc={'chatMessage':require(_0x345d('0x3')),'openchannelMessage':require(_0x345d('0x4')),'mailMessage':require(_0x345d('0x5')),'smsMessage':require(_0x345d('0x6')),'faxMessage':require(_0x345d('0x7')),'whatsappMessage':require(_0x345d('0x8'))};exports[_0x345d('0x9')]=function(_0x21e5e2,_0x40f2ab){return function(_0x459be2){try{var _0x15dfe2={'body':utils[_0x345d('0xa')](_0x40f2ab[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x345d('0xb')){_0x15dfe2[_0x345d('0xc')]=this['account']['id'];}else{_0x15dfe2[_[_0x345d('0xd')](this[_0x345d('0xe')])+_0x345d('0xf')]=this['account']['id'];}_0x15dfe2[_[_0x345d('0xd')](this[_0x345d('0xe')])+_0x345d('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0x345d('0x11')]){return rpc[this[_0x345d('0xe')]+_0x345d('0x11')][_0x345d('0x12')](_0x15dfe2)[_0x345d('0x13')](function(_0x49e432){logger[_0x345d('0x14')](_0x345d('0x15'),_0x21e5e2,_0x15dfe2[_0x345d('0x16')]);_0x459be2[_0x345d('0x17')]();})[_0x345d('0x18')](function(_0xb923e6){logger[_0x345d('0x19')](_0x345d('0x15'),_0x21e5e2,JSON[_0x345d('0x1a')](_0xb923e6));_0x459be2[_0x345d('0x1b')]();});}}catch(_0x611d5f){logger[_0x345d('0x19')](_0x345d('0x15'),_0x21e5e2,JSON[_0x345d('0x1a')](_0x611d5f));_0x459be2[_0x345d('0x1b')]();}};}; \ No newline at end of file +var _0xa5ea=['../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x67fe51,_0x305702){var _0x8a5b43=function(_0x206e7c){while(--_0x206e7c){_0x67fe51['push'](_0x67fe51['shift']());}};_0x8a5b43(++_0x305702);}(_0xa5ea,0x6d));var _0xaa5e=function(_0x2fc8b4,_0x4af1c8){_0x2fc8b4=_0x2fc8b4-0x0;var _0x4cf7cb=_0xa5ea[_0x2fc8b4];return _0x4cf7cb;};'use strict';var _=require('lodash');var utils=require(_0xaa5e('0x0'));var logger=require(_0xaa5e('0x1'))(_0xaa5e('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xaa5e('0x3')),'smsMessage':require(_0xaa5e('0x4')),'faxMessage':require(_0xaa5e('0x5')),'whatsappMessage':require(_0xaa5e('0x6'))};exports[_0xaa5e('0x7')]=function(_0x2b8770,_0x5ad467){return function(_0x48961b){try{var _0x16d3c5={'body':utils[_0xaa5e('0x8')](_0x5ad467[0x0],this),'ContactId':this[_0xaa5e('0x9')]['id']};if(this[_0xaa5e('0xa')]==='chat'){_0x16d3c5[_0xaa5e('0xb')]=this['account']['id'];}else{_0x16d3c5[_[_0xaa5e('0xc')](this[_0xaa5e('0xa')])+'AccountId']=this['account']['id'];}_0x16d3c5[_['upperFirst'](this[_0xaa5e('0xa')])+_0xaa5e('0xd')]=this['interaction']['id'];if(rpc[this[_0xaa5e('0xa')]+_0xaa5e('0xe')]){return rpc[this[_0xaa5e('0xa')]+_0xaa5e('0xe')][_0xaa5e('0xf')](_0x16d3c5)['then'](function(_0x29df2a){logger[_0xaa5e('0x10')](_0xaa5e('0x11'),_0x2b8770,_0x16d3c5[_0xaa5e('0x12')]);_0x48961b[_0xaa5e('0x13')]();})[_0xaa5e('0x14')](function(_0x524ba7){logger['error'](_0xaa5e('0x11'),_0x2b8770,JSON[_0xaa5e('0x15')](_0x524ba7));_0x48961b[_0xaa5e('0x16')]();});}}catch(_0x369068){logger['error'](_0xaa5e('0x11'),_0x2b8770,JSON[_0xaa5e('0x15')](_0x369068));_0x48961b[_0xaa5e('0x16')]();}};}; \ 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 7eb7853..c0cf794 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 _0xa9ac=['getMustacheRender','next','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x137c51,_0x1b0ab4){var _0x77b4d3=function(_0x246695){while(--_0x246695){_0x137c51['push'](_0x137c51['shift']());}};_0x77b4d3(++_0x1b0ab4);}(_0xa9ac,0x10b));var _0xca9a=function(_0x152697,_0x1a27e4){_0x152697=_0x152697-0x0;var _0x8094ff=_0xa9ac[_0x152697];return _0x8094ff;};'use strict';var utils=require(_0xca9a('0x0'));var logger=require(_0xca9a('0x1'))(_0xca9a('0x2'));exports['consequence']=function(_0x36116a,_0x3a7f7a){return function(_0x2df95d){try{logger[_0xca9a('0x3')](_0xca9a('0x4'),_0x36116a,utils[_0xca9a('0x5')](_0x3a7f7a[0x0],this));_0x2df95d[_0xca9a('0x6')]();}catch(_0x41347d){logger['error'](_0xca9a('0x4'),_0x36116a,JSON['stringify'](_0x41347d));_0x2df95d[_0xca9a('0x7')]();}};}; \ No newline at end of file +var _0x7218=['error','stringify','stop','../../../../config/logger','consequence','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x7218,0x163));var _0x8721=function(_0x3f2aef,_0x225a00){_0x3f2aef=_0x3f2aef-0x0;var _0x253638=_0x7218[_0x3f2aef];return _0x253638;};'use strict';var utils=require('./utils');var logger=require(_0x8721('0x0'))('routing');exports[_0x8721('0x1')]=function(_0x5b92d3,_0x392e42){return function(_0x332756){try{logger['info'](_0x8721('0x2'),_0x5b92d3,utils[_0x8721('0x3')](_0x392e42[0x0],this));_0x332756[_0x8721('0x4')]();}catch(_0x2c65a2){logger[_0x8721('0x5')](_0x8721('0x2'),_0x5b92d3,JSON[_0x8721('0x6')](_0x2c65a2));_0x332756[_0x8721('0x7')]();}};}; \ 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 3e5c99f..50f86a5 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 _0xfdc9=['beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','queue','from','joinAt','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','update','update\x20queue\x20report','timeout','toLowerCase','consequence','validate','length','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory'];(function(_0x360195,_0x53f8d6){var _0x1126e3=function(_0x5b0bba){while(--_0x5b0bba){_0x360195['push'](_0x360195['shift']());}};_0x1126e3(++_0x53f8d6);}(_0xfdc9,0xe9));var _0x9fdc=function(_0x327c0f,_0x188c04){_0x327c0f=_0x327c0f-0x0;var _0x1a936d=_0xfdc9[_0x327c0f];return _0x1a936d;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x9fdc('0x0'));var seqqueue=require(_0x9fdc('0x1'));var moment=require('moment');var Redis=require(_0x9fdc('0x2'));var config=require(_0x9fdc('0x3'));var logger=require(_0x9fdc('0x4'))(_0x9fdc('0x5'));var strategy=require(_0x9fdc('0x6'));config[_0x9fdc('0x7')]=_[_0x9fdc('0x8')](config['redis'],{'host':_0x9fdc('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9fdc('0x7')]));var attributes=['id',_0x9fdc('0xa'),'account',_0x9fdc('0xb'),_0x9fdc('0xc'),_0x9fdc('0xd')];function emit(_0x243e67,_0x24db6e,_0x4700c8){io['to'](_0x243e67)['emit'](_0x24db6e,_0x4700c8);}function emitChannelQueueInteraction(_0x5018cc,_0xfd9092,_0x52c6d7,_0x36929f,_0x573ac9,_0x1c0da4,_0x17b506,_0x5493c7){var _0x33947f=_[_0x9fdc('0xe')](_0x52c6d7);_0x33947f[_0x9fdc('0xa')]=_0x5493c7;_0x33947f[_0x9fdc('0xb')]=_0xfd9092;_0x33947f[_0x9fdc('0xf')]=_0x36929f;_0x33947f['id']=_0x573ac9;if(_0x1c0da4){_0x17b506[util[_0x9fdc('0x10')](_0x9fdc('0x11'),_0x5018cc)][_0x573ac9]=_[_0x9fdc('0x12')](_0x33947f,attributes);}else{delete _0x17b506[util[_0x9fdc('0x10')](_0x9fdc('0x11'),_0x5018cc)][_0x573ac9];}emit(util['format'](_0x9fdc('0x13'),_0x5018cc,_0xfd9092),util[_0x9fdc('0x10')](_0x9fdc('0x14'),_0x5018cc,_0x1c0da4?'save':_0x9fdc('0x15')),_[_0x9fdc('0x12')](_0x33947f,attributes));}var rpc={'openchannelQueueReport':require(_0x9fdc('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x9fdc('0x17')),'smsQueueReport':require(_0x9fdc('0x18')),'faxQueueReport':require(_0x9fdc('0x19')),'whatsappQueueReport':require(_0x9fdc('0x1a'))};var queue=schema({'name':{'type':_0x9fdc('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9fdc('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x5c12f3,_0x13edbe,_0x441a70,_0x166c66){if(_0x5c12f3&&_0x13edbe&&_0x441a70){_0x13edbe[_0x9fdc('0x1d')]+=0x1;var _0x578e70={'uniqueid':_0x5c12f3,'from':_0x441a70[_0x9fdc('0x1e')]?_0x441a70[_0x9fdc('0x1e')]['from']:'','joinAt':moment()[_0x9fdc('0x10')](_0x9fdc('0x1f')),'ContactId':_0x441a70['contact']?_0x441a70[_0x9fdc('0x20')]['id']:null,'ListId':_0x441a70[_0x9fdc('0x21')]?_0x441a70[_0x9fdc('0x21')]['id']:null};_0x578e70[_['upperFirst'](_0x441a70[_0x9fdc('0x22')])+_0x9fdc('0x23')]=_0x13edbe['id']||null;_0x578e70[_[_0x9fdc('0x24')](_0x441a70[_0x9fdc('0x22')])+_0x9fdc('0x25')]=_0x441a70[_0x9fdc('0x26')]?_0x441a70[_0x9fdc('0x26')]['id']:null;_0x578e70[_[_0x9fdc('0x24')](_0x441a70[_0x9fdc('0x22')])+'MessageId']=_0x441a70[_0x9fdc('0x27')]?_0x441a70[_0x9fdc('0x27')]['id']:null;_0x578e70[_[_0x9fdc('0x24')](_0x441a70[_0x9fdc('0x22')])+(_0x441a70[_0x9fdc('0x22')]!==_0x9fdc('0x28')?_0x9fdc('0x29'):_0x9fdc('0x2a'))]=_0x441a70[_0x9fdc('0xf')]?_0x441a70[_0x9fdc('0xf')]['id']:null;logger[_0x9fdc('0x2b')](util[_0x9fdc('0x10')](_0x9fdc('0x2c'),_0x5c12f3,_0x13edbe[_0x9fdc('0x2d')]));emitChannelQueueInteraction(_0x441a70[_0x9fdc('0x22')],_0x13edbe[_0x9fdc('0x2d')],_0x578e70,_0x441a70[_0x9fdc('0xf')][_0x9fdc('0x2d')],_0x441a70[_0x9fdc('0x27')]['id'],!![],_0x166c66,_0x13edbe['id']);if(rpc[_0x441a70['channel']+_0x9fdc('0x2e')]){return rpc[_0x441a70[_0x9fdc('0x22')]+_0x9fdc('0x2e')][_0x9fdc('0x2f')](_0x578e70)[_0x9fdc('0x30')](function(_0x11eb7c){logger[_0x9fdc('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x1feff1,_0x1a99d5,_0x57ca08,_0x48c7d6){if(_0x1feff1&&_0x1a99d5){_0x1a99d5[_0x9fdc('0x1d')]-=0x1;var _0x55580a={'leaveAt':moment()[_0x9fdc('0x10')](_0x9fdc('0x1f')),'acceptAt':moment()[_0x9fdc('0x10')](_0x9fdc('0x1f')),'reason':'accepted'};logger[_0x9fdc('0x2b')](util[_0x9fdc('0x10')]('[%s][STOP:QUEUE][NAME:%s]',_0x1feff1,_0x1a99d5[_0x9fdc('0x2d')]));emitChannelQueueInteraction(_0x57ca08[_0x9fdc('0x22')],_0x1a99d5[_0x9fdc('0x2d')],_0x57ca08['body'],_0x57ca08['account'][_0x9fdc('0x2d')],_0x57ca08[_0x9fdc('0x27')]['id'],![],_0x48c7d6,_0x1a99d5['id']);if(rpc[_0x57ca08['channel']+_0x9fdc('0x2e')]){return rpc[_0x57ca08[_0x9fdc('0x22')]+_0x9fdc('0x2e')][_0x9fdc('0x32')](_0x1feff1,_0x55580a)[_0x9fdc('0x30')](function(_0x35d801){logger[_0x9fdc('0x31')](_0x9fdc('0x33'));});}}}function endRouting(_0x4ebc7d,_0x117787,_0x3c28a7,_0x163cc9){if(_0x4ebc7d&&_0x117787){_0x117787[_0x9fdc('0x1d')]-=0x1;var _0xccde4e={'leaveAt':moment()[_0x9fdc('0x10')](_0x9fdc('0x1f')),'exitAt':moment()['format'](_0x9fdc('0x1f')),'reason':_0x9fdc('0x34')};logger['info'](util[_0x9fdc('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x4ebc7d,_0x117787['name']));emitChannelQueueInteraction(_0x3c28a7['channel'],_0x117787[_0x9fdc('0x2d')],_0x3c28a7[_0x9fdc('0x1e')],_0x3c28a7[_0x9fdc('0xf')][_0x9fdc('0x2d')],_0x3c28a7[_0x9fdc('0x27')]['id'],![],_0x163cc9);if(rpc[_0x3c28a7[_0x9fdc('0x22')]+_0x9fdc('0x2e')]){return rpc[_0x3c28a7['channel']+_0x9fdc('0x2e')][_0x9fdc('0x32')](_0x4ebc7d,_0xccde4e)['catch'](function(_0x2e4589){logger[_0x9fdc('0x31')](_0x9fdc('0x33'));});}}}function handleFindQueue(_0x2c28c4){return function(_0x5225e5){return _0x5225e5[_0x9fdc('0x2d')][_0x9fdc('0x35')]()===_0x2c28c4[_0x9fdc('0x35')]();};}exports[_0x9fdc('0x36')]=function(_0x4a9258,_0x56110e,_0x3dac48,_0x29d814){return function(_0x547802){try{var _0x2c4684={'name':_0x56110e[0x0],'timeout':_0x56110e[0x1]};var _0x20a9e6=queue[_0x9fdc('0x37')](_0x2c4684,{'typecast':!![]});if(_0x20a9e6[_0x9fdc('0x38')]){logger[_0x9fdc('0x31')]('[%s][QUEUE]\x20%s',_0x4a9258,_['map'](_0x20a9e6,_0x9fdc('0x27'))[_0x9fdc('0x39')](',\x20'));_0x547802[_0x9fdc('0x3a')]();}else{var _0x2165a1=_[_0x9fdc('0x3b')](_0x3dac48[_0x29d814['channel']+'Queues'],handleFindQueue(_0x2c4684[_0x9fdc('0x2d')]));if(_0x2165a1){startRouting(_0x4a9258,_0x2165a1,_0x29d814,_0x3dac48);var _0x527860=(_0x2165a1[_0x9fdc('0x34')]||0xa)*0x3e8;var _0x1eb4cc=(_0x2c4684[_0x9fdc('0x34')]||0x14)*0x3e8;var _0x1b7a04,_0x561b57;if(_0x527860>_0x1eb4cc){_0x1eb4cc=_0x527860;}var _0x327dac=seqqueue[_0x9fdc('0x3c')](_0x527860);_0x327dac['id']=_0x4a9258;_0x327dac[_0x9fdc('0x3d')]=_0x527860;_0x327dac[_0x9fdc('0x3e')]=_0x1eb4cc;_0x327dac[_0x9fdc('0x22')]=_0x29d814[_0x9fdc('0x22')];_0x3dac48[_0x9fdc('0x3f')][_0x4a9258]['on'](_0x9fdc('0x40'),function(){logger[_0x9fdc('0x2b')](_0x9fdc('0x41'),_0x4a9258);stopRouting(_0x4a9258,_0x2165a1,_0x29d814,_0x3dac48);clearTimeout(_0x1b7a04);_0x1b7a04=undefined;_0x327dac[_0x9fdc('0x42')](!![]);if(_0x3dac48['rules'][_0x4a9258]){delete _0x3dac48[_0x9fdc('0x3f')][_0x4a9258];}_0x547802[_0x9fdc('0x3a')]();});_0x3dac48['rules'][_0x4a9258]['on'](_0x9fdc('0x43'),function(){if(_0x3dac48[_0x9fdc('0x3f')][_0x4a9258]){delete _0x3dac48[_0x9fdc('0x3f')][_0x4a9258];}});_0x1b7a04=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x4a9258);endRouting(_0x4a9258,_0x2165a1,_0x29d814,_0x3dac48);clearTimeout(_0x1b7a04);_0x327dac['close'](!![]);_0x547802[_0x9fdc('0x44')]();},_0x1eb4cc);switch(_0x2165a1[_0x9fdc('0x45')]){case _0x9fdc('0x46'):strategy[_0x9fdc('0x46')](_0x327dac,_0x2165a1,_0x3dac48,_0x29d814);break;default:strategy[_0x9fdc('0x47')](_0x327dac,_0x2165a1,_0x3dac48,_0x29d814);}}else{logger[_0x9fdc('0x31')](_0x9fdc('0x48'),_0x4a9258,_0x2c4684[_0x9fdc('0x2d')]);_0x547802[_0x9fdc('0x3a')]();}}}catch(_0x4a3872){console[_0x9fdc('0x49')](_0x4a3872);logger[_0x9fdc('0x31')](_0x9fdc('0x4a'),_0x4a9258,_0x4a3872[_0x9fdc('0x4b')]);_0x547802[_0x9fdc('0x3a')]();}};}; \ No newline at end of file +var _0x8145=['redis','queue_id','queue','from','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','QueueId','channel','interaction','MessageId','message','chat','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','update','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','rules','end','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','defaults','localhost','socket.io-emitter'];(function(_0x34029d,_0x29b2ea){var _0x3aa5db=function(_0x2104d8){while(--_0x2104d8){_0x34029d['push'](_0x34029d['shift']());}};_0x3aa5db(++_0x29b2ea);}(_0x8145,0xdd));var _0x5814=function(_0x2b92ec,_0x18e0e3){_0x2b92ec=_0x2b92ec-0x0;var _0x12be46=_0x8145[_0x2b92ec];return _0x12be46;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x5814('0x0'));var seqqueue=require(_0x5814('0x1'));var moment=require(_0x5814('0x2'));var Redis=require(_0x5814('0x3'));var config=require(_0x5814('0x4'));var logger=require('../../../../config/logger')(_0x5814('0x5'));var strategy=require(_0x5814('0x6'));config['redis']=_[_0x5814('0x7')](config['redis'],{'host':_0x5814('0x8'),'port':0x18eb});var io=require(_0x5814('0x9'))(new Redis(config[_0x5814('0xa')]));var attributes=['id',_0x5814('0xb'),'account',_0x5814('0xc'),_0x5814('0xd'),_0x5814('0xe')];function emit(_0x5dd689,_0xed2252,_0x1310a1){io['to'](_0x5dd689)[_0x5814('0xf')](_0xed2252,_0x1310a1);}function emitChannelQueueInteraction(_0x4c436a,_0x15215c,_0x31d2f7,_0x250017,_0x10f046,_0x3c62d1,_0x433520,_0x1e6f6b){var _0x449b8f=_[_0x5814('0x10')](_0x31d2f7);_0x449b8f[_0x5814('0xb')]=_0x1e6f6b;_0x449b8f[_0x5814('0xc')]=_0x15215c;_0x449b8f['account']=_0x250017;_0x449b8f['id']=_0x10f046;if(_0x3c62d1){_0x433520[util[_0x5814('0x11')]('%sQueuesWaitingInteractions',_0x4c436a)][_0x10f046]=_[_0x5814('0x12')](_0x449b8f,attributes);}else{delete _0x433520[util[_0x5814('0x11')](_0x5814('0x13'),_0x4c436a)][_0x10f046];}emit(util['format']('%s:queue:%s',_0x4c436a,_0x15215c),util['format'](_0x5814('0x14'),_0x4c436a,_0x3c62d1?_0x5814('0x15'):_0x5814('0x16')),_[_0x5814('0x12')](_0x449b8f,attributes));}var rpc={'openchannelQueueReport':require(_0x5814('0x17')),'mailQueueReport':require(_0x5814('0x18')),'chatQueueReport':require(_0x5814('0x19')),'smsQueueReport':require(_0x5814('0x1a')),'faxQueueReport':require(_0x5814('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x5814('0x1c'),'required':!![],'message':_0x5814('0x1d')},'timeout':{'type':_0x5814('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x47a860,_0x29ee7c,_0x169776,_0x2cf69f){if(_0x47a860&&_0x29ee7c&&_0x169776){_0x29ee7c['waiting']+=0x1;var _0x30c3e6={'uniqueid':_0x47a860,'from':_0x169776[_0x5814('0x1f')]?_0x169776['body'][_0x5814('0xd')]:'','joinAt':moment()['format'](_0x5814('0x20')),'ContactId':_0x169776['contact']?_0x169776['contact']['id']:null,'ListId':_0x169776['list']?_0x169776[_0x5814('0x21')]['id']:null};_0x30c3e6[_[_0x5814('0x22')](_0x169776['channel'])+_0x5814('0x23')]=_0x29ee7c['id']||null;_0x30c3e6[_[_0x5814('0x22')](_0x169776[_0x5814('0x24')])+'InteractionId']=_0x169776[_0x5814('0x25')]?_0x169776[_0x5814('0x25')]['id']:null;_0x30c3e6[_[_0x5814('0x22')](_0x169776[_0x5814('0x24')])+_0x5814('0x26')]=_0x169776[_0x5814('0x27')]?_0x169776[_0x5814('0x27')]['id']:null;_0x30c3e6[_['upperFirst'](_0x169776[_0x5814('0x24')])+(_0x169776[_0x5814('0x24')]!==_0x5814('0x28')?'AccountId':'WebsiteId')]=_0x169776['account']?_0x169776[_0x5814('0x29')]['id']:null;logger[_0x5814('0x2a')](util['format'](_0x5814('0x2b'),_0x47a860,_0x29ee7c[_0x5814('0x2c')]));emitChannelQueueInteraction(_0x169776[_0x5814('0x24')],_0x29ee7c[_0x5814('0x2c')],_0x30c3e6,_0x169776['account']['name'],_0x169776[_0x5814('0x27')]['id'],!![],_0x2cf69f,_0x29ee7c['id']);if(rpc[_0x169776[_0x5814('0x24')]+'QueueReport']){return rpc[_0x169776['channel']+_0x5814('0x2d')][_0x5814('0x2e')](_0x30c3e6)[_0x5814('0x2f')](function(_0x38e6d7){logger[_0x5814('0x30')](_0x5814('0x31'));});}}}function stopRouting(_0x397566,_0x5b1c94,_0x4bbeb3,_0x6c4e95){if(_0x397566&&_0x5b1c94){_0x5b1c94[_0x5814('0x32')]-=0x1;var _0x48d6e0={'leaveAt':moment()[_0x5814('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x5814('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x5814('0x2a')](util[_0x5814('0x11')](_0x5814('0x33'),_0x397566,_0x5b1c94['name']));emitChannelQueueInteraction(_0x4bbeb3[_0x5814('0x24')],_0x5b1c94[_0x5814('0x2c')],_0x4bbeb3[_0x5814('0x1f')],_0x4bbeb3[_0x5814('0x29')][_0x5814('0x2c')],_0x4bbeb3[_0x5814('0x27')]['id'],![],_0x6c4e95,_0x5b1c94['id']);if(rpc[_0x4bbeb3[_0x5814('0x24')]+'QueueReport']){return rpc[_0x4bbeb3[_0x5814('0x24')]+_0x5814('0x2d')]['update'](_0x397566,_0x48d6e0)['catch'](function(_0x3d31c2){logger[_0x5814('0x30')](_0x5814('0x34'));});}}}function endRouting(_0xac8985,_0x3896b3,_0x4310a4,_0x31f551){if(_0xac8985&&_0x3896b3){_0x3896b3['waiting']-=0x1;var _0x3d4570={'leaveAt':moment()[_0x5814('0x11')](_0x5814('0x20')),'exitAt':moment()['format'](_0x5814('0x20')),'reason':_0x5814('0x35')};logger[_0x5814('0x2a')](util[_0x5814('0x11')]('[%s][END:QUEUE][NAME:%s]',_0xac8985,_0x3896b3[_0x5814('0x2c')]));emitChannelQueueInteraction(_0x4310a4['channel'],_0x3896b3['name'],_0x4310a4['body'],_0x4310a4['account'][_0x5814('0x2c')],_0x4310a4[_0x5814('0x27')]['id'],![],_0x31f551);if(rpc[_0x4310a4['channel']+_0x5814('0x2d')]){return rpc[_0x4310a4['channel']+_0x5814('0x2d')][_0x5814('0x36')](_0xac8985,_0x3d4570)[_0x5814('0x2f')](function(_0x55bee1){logger[_0x5814('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x37d843){return function(_0x38a64d){return _0x38a64d['name'][_0x5814('0x37')]()===_0x37d843[_0x5814('0x37')]();};}exports[_0x5814('0x38')]=function(_0x231832,_0xa8f17c,_0x472635,_0x414bd3){return function(_0x444231){try{var _0x5c9a3c={'name':_0xa8f17c[0x0],'timeout':_0xa8f17c[0x1]};var _0x5d5569=queue[_0x5814('0x39')](_0x5c9a3c,{'typecast':!![]});if(_0x5d5569[_0x5814('0x3a')]){logger[_0x5814('0x30')](_0x5814('0x3b'),_0x231832,_[_0x5814('0x3c')](_0x5d5569,'message')[_0x5814('0x3d')](',\x20'));_0x444231[_0x5814('0x3e')]();}else{var _0x44b7ef=_[_0x5814('0x3f')](_0x472635[_0x414bd3[_0x5814('0x24')]+_0x5814('0x40')],handleFindQueue(_0x5c9a3c[_0x5814('0x2c')]));if(_0x44b7ef){startRouting(_0x231832,_0x44b7ef,_0x414bd3,_0x472635);var _0x24d6af=(_0x44b7ef['timeout']||0xa)*0x3e8;var _0x211b59=(_0x5c9a3c[_0x5814('0x35')]||0x14)*0x3e8;var _0x496200,_0x5afca8;if(_0x24d6af>_0x211b59){_0x211b59=_0x24d6af;}var _0xe209a8=seqqueue[_0x5814('0x41')](_0x24d6af);_0xe209a8['id']=_0x231832;_0xe209a8[_0x5814('0x42')]=_0x24d6af;_0xe209a8['qtimeout']=_0x211b59;_0xe209a8['channel']=_0x414bd3[_0x5814('0x24')];_0x472635[_0x5814('0x43')][_0x231832]['on'](_0x5814('0x44'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x231832);stopRouting(_0x231832,_0x44b7ef,_0x414bd3,_0x472635);clearTimeout(_0x496200);_0x496200=undefined;_0xe209a8[_0x5814('0x45')](!![]);if(_0x472635[_0x5814('0x43')][_0x231832]){delete _0x472635[_0x5814('0x43')][_0x231832];}_0x444231[_0x5814('0x3e')]();});_0x472635[_0x5814('0x43')][_0x231832]['on'](_0x5814('0x46'),function(){if(_0x472635['rules'][_0x231832]){delete _0x472635[_0x5814('0x43')][_0x231832];}});_0x496200=setTimeout(function(){logger[_0x5814('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x231832);endRouting(_0x231832,_0x44b7ef,_0x414bd3,_0x472635);clearTimeout(_0x496200);_0xe209a8[_0x5814('0x45')](!![]);_0x444231[_0x5814('0x47')]();},_0x211b59);switch(_0x44b7ef[_0x5814('0x48')]){case _0x5814('0x49'):strategy['rrmemory'](_0xe209a8,_0x44b7ef,_0x472635,_0x414bd3);break;default:strategy[_0x5814('0x4a')](_0xe209a8,_0x44b7ef,_0x472635,_0x414bd3);}}else{logger[_0x5814('0x30')](_0x5814('0x4b'),_0x231832,_0x5c9a3c[_0x5814('0x2c')]);_0x444231['stop']();}}}catch(_0x1dc435){console['log'](_0x1dc435);logger[_0x5814('0x30')]('[%s][QUEUE]\x20%s',_0x231832,_0x1dc435[_0x5814('0x4c')]);_0x444231['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 612fb18..7b35087 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 _0x96e9=['../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','exports','uuid','./util'];(function(_0x66bab3,_0x2edf10){var _0x3a7bef=function(_0x2bfaf5){while(--_0x2bfaf5){_0x66bab3['push'](_0x66bab3['shift']());}};_0x3a7bef(++_0x2edf10);}(_0x96e9,0x82));var _0x996e=function(_0x9e6d97,_0x18f2e5){_0x9e6d97=_0x9e6d97-0x0;var _0x45c547=_0x96e9[_0x9e6d97];return _0x45c547;};'use strict';var _=require('lodash');var uuid=require(_0x996e('0x0'));var util=require(_0x996e('0x1'));var logger=require(_0x996e('0x2'))(_0x996e('0x3'));var Agent=function(_0x27232b,_0x5deb0b,_0x47ed30,_0x1d0cc2){this[_0x996e('0x4')]=uuid['v4']();this['squeue']=_0x27232b;this[_0x996e('0x5')]=_0x5deb0b;this['realtime']=_0x47ed30;this[_0x996e('0x3')]=_0x1d0cc2;this[_0x996e('0x6')][_0x996e('0x7')](this[_0x996e('0x8')][_0x996e('0x9')](this),this[_0x996e('0xa')][_0x996e('0x9')](this));this[_0x996e('0x6')]['on'](_0x996e('0xb'),this['handleTimeout']['bind'](this));this[_0x996e('0x6')]['on'](_0x996e('0xc'),this[_0x996e('0xd')][_0x996e('0x9')](this));};Agent['prototype'][_0x996e('0x7')]=function(){this[_0x996e('0x6')][_0x996e('0x7')](this[_0x996e('0x8')]['bind'](this),this[_0x996e('0xa')][_0x996e('0x9')](this));};Agent[_0x996e('0xe')]['handleDrained']=function(){this[_0x996e('0xa')](!![]);};Agent['prototype'][_0x996e('0x8')]=function(){logger[_0x996e('0xf')](_0x996e('0x10'),this['squeue']['id'],this[_0x996e('0x5')]['id']);if(_[_0x996e('0x11')](this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']])){logger[_0x996e('0xf')](_0x996e('0x14'),this[_0x996e('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x996e('0x7')]['bind'](this),0x3e8);}else{if(this['routing'][_0x996e('0x15')]||util[_0x996e('0x16')](this[_0x996e('0x6')]['id'],this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']],this['squeue'][_0x996e('0x17')],![])){this['realtime'][_0x996e('0x13')][this[_0x996e('0x5')]['id']][_0x996e('0x18')]=!![];this[_0x996e('0x12')][_0x996e('0x13')][this['agent']['id']][_0x996e('0x19')]=undefined;util['showNotification'](this[_0x996e('0x4')],this[_0x996e('0x6')]['id'],this['realtime'][_0x996e('0x13')][this[_0x996e('0x5')]['id']],null,this[_0x996e('0x3')]);util[_0x996e('0x1a')](this[_0x996e('0x6')]['id'],this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']],'RINGING'+(this['routing'][_0x996e('0x15')]?_0x996e('0x1b'):''));}else{logger[_0x996e('0xf')](_0x996e('0x1c'),this[_0x996e('0x6')]['id'],this[_0x996e('0x5')]['id']);setTimeout(this[_0x996e('0x7')]['bind'](this),0x3e8);}}};Agent[_0x996e('0xe')]['handleTimeout']=function(_0x5a3f06){if(_[_0x996e('0x11')](this[_0x996e('0x12')]['agents'][this[_0x996e('0x5')]['id']])){return logger[_0x996e('0xf')](_0x996e('0x14'),this['squeue']['id'],this[_0x996e('0x5')]['id']);}else{logger[_0x996e('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x996e('0x6')]['id'],this[_0x996e('0x5')]['id']);util[_0x996e('0x1d')](this[_0x996e('0x4')],this['squeue']['id'],this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']],null,this[_0x996e('0x3')]);this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']]['busy']=![];this[_0x996e('0x12')][_0x996e('0x13')][this[_0x996e('0x5')]['id']][_0x996e('0x19')]=undefined;util[_0x996e('0x1a')](this[_0x996e('0x6')]['id'],this[_0x996e('0x12')][_0x996e('0x13')][this['agent']['id']],_0x5a3f06?_0x996e('0x1e'):_0x996e('0x1f'));}if(!_0x5a3f06){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x1b150a,_0x25ccec,_0x2544a2,_0x5d6222){return new Agent(_0x1b150a,_0x25ccec,_0x2544a2,_0x5d6222);}module[_0x996e('0x20')]=agent; \ No newline at end of file +var _0x24e3=['timeout','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','handleRun','bind','handleTimeout'];(function(_0x76d44d,_0x10e814){var _0x4b6ca3=function(_0x452378){while(--_0x452378){_0x76d44d['push'](_0x76d44d['shift']());}};_0x4b6ca3(++_0x10e814);}(_0x24e3,0xfe));var _0x324e=function(_0x53112d,_0x53f30e){_0x53112d=_0x53112d-0x0;var _0x5824ad=_0x24e3[_0x53112d];return _0x5824ad;};'use strict';var _=require('lodash');var uuid=require(_0x324e('0x0'));var util=require(_0x324e('0x1'));var logger=require(_0x324e('0x2'))(_0x324e('0x3'));var Agent=function(_0x3e2b2c,_0x5b14f4,_0x570395,_0x5ba869){this[_0x324e('0x4')]=uuid['v4']();this['squeue']=_0x3e2b2c;this['agent']=_0x5b14f4;this[_0x324e('0x5')]=_0x570395;this['routing']=_0x5ba869;this[_0x324e('0x6')]['push'](this[_0x324e('0x7')][_0x324e('0x8')](this),this[_0x324e('0x9')][_0x324e('0x8')](this));this[_0x324e('0x6')]['on'](_0x324e('0xa'),this[_0x324e('0x9')][_0x324e('0x8')](this));this[_0x324e('0x6')]['on']('drained',this[_0x324e('0xb')][_0x324e('0x8')](this));};Agent[_0x324e('0xc')]['push']=function(){this[_0x324e('0x6')][_0x324e('0xd')](this[_0x324e('0x7')][_0x324e('0x8')](this),this[_0x324e('0x9')][_0x324e('0x8')](this));};Agent[_0x324e('0xc')][_0x324e('0xb')]=function(){this[_0x324e('0x9')](!![]);};Agent[_0x324e('0xc')][_0x324e('0x7')]=function(){logger['debug'](_0x324e('0xe'),this[_0x324e('0x6')]['id'],this[_0x324e('0xf')]['id']);if(_[_0x324e('0x10')](this[_0x324e('0x5')][_0x324e('0x11')][this['agent']['id']])){logger[_0x324e('0x12')](_0x324e('0x13'),this[_0x324e('0x6')]['id'],this[_0x324e('0xf')]['id']);setTimeout(this[_0x324e('0xd')][_0x324e('0x8')](this),0x3e8);}else{if(this[_0x324e('0x3')][_0x324e('0x14')]||util[_0x324e('0x15')](this['squeue']['id'],this[_0x324e('0x5')][_0x324e('0x11')][this[_0x324e('0xf')]['id']],this[_0x324e('0x6')][_0x324e('0x16')],![])){this[_0x324e('0x5')]['agents'][this[_0x324e('0xf')]['id']][_0x324e('0x17')]=!![];this['realtime']['agents'][this[_0x324e('0xf')]['id']][_0x324e('0x18')]=undefined;util[_0x324e('0x19')](this[_0x324e('0x4')],this[_0x324e('0x6')]['id'],this[_0x324e('0x5')][_0x324e('0x11')][this[_0x324e('0xf')]['id']],null,this[_0x324e('0x3')]);util['writeLog'](this[_0x324e('0x6')]['id'],this[_0x324e('0x5')][_0x324e('0x11')][this['agent']['id']],_0x324e('0x1a')+(this[_0x324e('0x3')]['forcedOwnership']?_0x324e('0x1b'):''));}else{logger[_0x324e('0x12')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x324e('0xf')]['id']);setTimeout(this[_0x324e('0xd')][_0x324e('0x8')](this),0x3e8);}}};Agent[_0x324e('0xc')]['handleTimeout']=function(_0x52efc5){if(_['isNil'](this[_0x324e('0x5')][_0x324e('0x11')][this['agent']['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x324e('0x6')]['id'],this[_0x324e('0xf')]['id']);}else{logger['debug'](_0x324e('0x1c'),this['squeue']['id'],this[_0x324e('0xf')]['id']);util['hideNotification'](this[_0x324e('0x4')],this['squeue']['id'],this[_0x324e('0x5')][_0x324e('0x11')][this['agent']['id']],null,this['routing']);this[_0x324e('0x5')][_0x324e('0x11')][this[_0x324e('0xf')]['id']][_0x324e('0x17')]=![];this[_0x324e('0x5')][_0x324e('0x11')][this[_0x324e('0xf')]['id']][_0x324e('0x18')]=undefined;util[_0x324e('0x1d')](this[_0x324e('0x6')]['id'],this[_0x324e('0x5')]['agents'][this[_0x324e('0xf')]['id']],_0x52efc5?_0x324e('0x1e'):_0x324e('0x1f'));}if(!_0x52efc5){setTimeout(this[_0x324e('0xd')][_0x324e('0x8')](this),0x3e8);}};function agent(_0x52c486,_0x52b179,_0xc77189,_0xecd44a){return new Agent(_0x52c486,_0x52b179,_0xc77189,_0xecd44a);}module[_0x324e('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index c05692d..01d285d 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 _0x5106=['handleDrained','prototype','push','handleRun','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','exports','lodash','./util','routing','notificationId','squeue','queue','realtime','bind','timeout','handleTimeout'];(function(_0x349490,_0x58fe3a){var _0x570f32=function(_0x485185){while(--_0x485185){_0x349490['push'](_0x349490['shift']());}};_0x570f32(++_0x58fe3a);}(_0x5106,0x116));var _0x6510=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5106[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6510('0x0'));var uuid=require('uuid');var util=require(_0x6510('0x1'));var logger=require('../../../../../config/logger')(_0x6510('0x2'));var Beepall=function(_0x4b0419,_0x579fe8,_0x4d9e2c,_0x25620c){this[_0x6510('0x3')]=uuid['v4']();this[_0x6510('0x4')]=_0x4b0419;this[_0x6510('0x5')]=_0x579fe8;this[_0x6510('0x6')]=_0x4d9e2c;this[_0x6510('0x2')]=_0x25620c;this['squeue']['push'](this['handleRun'][_0x6510('0x7')](this),this['handleTimeout'][_0x6510('0x7')](this));this['squeue']['on'](_0x6510('0x8'),this[_0x6510('0x9')][_0x6510('0x7')](this));this['squeue']['on']('drained',this[_0x6510('0xa')][_0x6510('0x7')](this));};Beepall[_0x6510('0xb')][_0x6510('0xc')]=function(){this[_0x6510('0x4')]['push'](this[_0x6510('0xd')][_0x6510('0x7')](this),this[_0x6510('0x9')][_0x6510('0x7')](this));};Beepall[_0x6510('0xb')]['handleDrained']=function(){this['handleTimeout'](!![]);};Beepall[_0x6510('0xb')][_0x6510('0xd')]=function(){var _0x2961d7=!![];if(!_[_0x6510('0xe')](this[_0x6510('0x5')])&&!_['isNil'](this['queue'][_0x6510('0xf')])&&this[_0x6510('0x5')][_0x6510('0xf')][_0x6510('0x10')]>0x0){for(var _0x4b20f1=0x0,_0x184c0c;_0x4b20f10x0){for(var _0x2b3d7b=0x0,_0x4939a2;_0x2b3d7b0x0&&_0xf8f722[_0x517c00+'CurrentCapacity']>=_0xf8f722[_0x517c00+_0x76f4('0x25')]){writeLog(_0x24ecac,_0xf8f722,_0x517c00['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x470242,_0x38300d,_0xd368a2,_0x1d1fe6,_0x13d219){return sendNotification(!![],_0x470242,_0x38300d,_0xd368a2,_0x1d1fe6,_0x13d219);};exports[_0x76f4('0x26')]=function(_0x5ca31f,_0x306cb4,_0x59d133,_0x5346be,_0x5b3f07){return sendNotification(![],_0x5ca31f,_0x306cb4,_0x59d133,_0x5346be,_0x5b3f07);};exports[_0x76f4('0x27')]=writeLog; \ No newline at end of file +var _0x6aa7=['hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','format','user:%s','emit','user:save','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE'];(function(_0x9bce3c,_0x56614b){var _0x2beb89=function(_0xcccb6b){while(--_0xcccb6b){_0x9bce3c['push'](_0x9bce3c['shift']());}};_0x2beb89(++_0x56614b);}(_0x6aa7,0x178));var _0x76aa=function(_0x3cac1a,_0x2a9c84){_0x3cac1a=_0x3cac1a-0x0;var _0x168aaf=_0x6aa7[_0x3cac1a];return _0x168aaf;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var utils=require(_0x76aa('0x1'));var Redis=require(_0x76aa('0x2'));var config=require(_0x76aa('0x3'));var logger=require(_0x76aa('0x4'))('routing');config[_0x76aa('0x5')]=_[_0x76aa('0x6')](config[_0x76aa('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x76aa('0x5')]));function sendNotification(_0x4d53f6,_0x32dee5,_0x36d12b,_0xa9b695,_0x56d6bc,_0x3dae33){io['to'](util[_0x76aa('0x7')](_0x76aa('0x8'),_0xa9b695['name']))[_0x76aa('0x9')](_0x76aa('0xa'),_0xa9b695);var _0x41643a=_0x3dae33||{};var _0x16cb50=_0x36d12b[_0x76aa('0xb')]('.');var _0x128435={'uniqueid':_0x32dee5,'channel':_0x16cb50[0x0],'id':_0x16cb50[0x1],'title':_0x16cb50[0x0]+_0x76aa('0xc'),'interactionId':_0x16cb50[0x2],'queue':_0x56d6bc?_0x56d6bc[_0x76aa('0xd')]:null,'sound':_0x41643a[_0x76aa('0xe')][_0x76aa('0xf')],'shake':_0x41643a['account'][_0x76aa('0x10')]};try{if(!_0x41643a['body']){_0x41643a[_0x76aa('0x11')]={};}if(_0x56d6bc){_0x41643a[_0x76aa('0x11')][_0x76aa('0x12')]=_0x56d6bc;}else if(_0x41643a[_0x76aa('0x11')][_0x76aa('0x12')]){delete _0x41643a['body']['queue'];}_0x128435[_0x76aa('0x13')]=utils['getMustacheRender'](_0x41643a[_0x76aa('0xe')][_0x76aa('0x14')],_0x41643a);}catch(_0x5cf594){_0x128435[_0x76aa('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x76aa('0x15')](util['format'](_0x76aa('0x16'),_0x32dee5,_0x5cf594[_0x76aa('0x17')]));}io['to'](util[_0x76aa('0x7')](_0x76aa('0x8'),_0xa9b695[_0x76aa('0xd')]))[_0x76aa('0x9')](util['format']('notification:%s',_0x4d53f6?_0x76aa('0x18'):_0x76aa('0x19')),_0x128435);}function writeLog(_0xf0711,_0x15b931,_0x15109b){return logger[_0x76aa('0x1a')](util[_0x76aa('0x7')](_0x76aa('0x1b'),_0xf0711,_0x15b931[_0x76aa('0xd')],_0x15109b));}exports['isAgentAvailable']=function(_0x39ac5a,_0x21064c,_0x338a6b,_0x5b3f55){if(_0x21064c[_0x76aa('0x1c')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x1d'));return![];}if(!_0x21064c[_0x76aa('0x1e')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x1f'));return![];}if(_0x21064c[_0x338a6b+_0x76aa('0x20')]){writeLog(_0x39ac5a,_0x21064c,_0x76aa('0x21'));return![];}if(_0x5b3f55&&_0x21064c[_0x76aa('0x22')](_0x338a6b+_0x76aa('0x23'))&&_0x21064c[_0x76aa('0x22')](_0x338a6b+_0x76aa('0x24'))){if(_0x21064c[_0x338a6b+_0x76aa('0x23')]>0x0&&_0x21064c[_0x338a6b+_0x76aa('0x24')]>=_0x21064c[_0x338a6b+_0x76aa('0x23')]){writeLog(_0x39ac5a,_0x21064c,_0x338a6b['toUpperCase']()+_0x76aa('0x25'));return![];}}return!![];};exports[_0x76aa('0x26')]=function(_0x25c614,_0x2e7ab4,_0xa1e6,_0x2f9316,_0x25a803){return sendNotification(!![],_0x25c614,_0x2e7ab4,_0xa1e6,_0x2f9316,_0x25a803);};exports[_0x76aa('0x27')]=function(_0xd12a99,_0x1bdc3d,_0x545b06,_0x3fcb7f,_0x5a8030){return sendNotification(![],_0xd12a99,_0x1bdc3d,_0x545b06,_0x3fcb7f,_0x5a8030);};exports[_0x76aa('0x28')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 7c5863a..dd1128c 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 _0x3770=['consequence','error','[%s][SYSTEM]\x20%s','message','join','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x32ea42,_0x2bd1c3){var _0x5f99f5=function(_0x25a0f2){while(--_0x25a0f2){_0x32ea42['push'](_0x32ea42['shift']());}};_0x5f99f5(++_0x2bd1c3);}(_0x3770,0x13c));var _0x0377=function(_0x4b5922,_0x143443){_0x4b5922=_0x4b5922-0x0;var _0xe625c3=_0x3770[_0x4b5922];return _0xe625c3;};'use strict';var schema=require(_0x0377('0x0'));var sh=require(_0x0377('0x1'));var _=require(_0x0377('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x0377('0x3'));var system=schema({'command':{'type':_0x0377('0x4'),'required':!![],'message':_0x0377('0x5')}});exports[_0x0377('0x6')]=function(_0x4e4363,_0x2d4bd9){return function(_0x1f6924){try{var _0x5ef187={'command':_0x2d4bd9[0x0]};var _0x43524e=system[_0x0377('0x0')](_0x5ef187,{'typecast':!![]});if(_0x43524e['length']){logger[_0x0377('0x7')](_0x0377('0x8'),_0x4e4363,_['map'](_0x43524e,_0x0377('0x9'))[_0x0377('0xa')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4e4363);_0x1f6924[_0x0377('0xb')]();}else{var _0x4ce4ae=this;var _0xf85f8c=utils[_0x0377('0xc')](_0x2d4bd9[0x0],this);logger[_0x0377('0xd')](_0x0377('0xe'),_0x4e4363,_0xf85f8c);sh[_0x0377('0xf')](_[_0x0377('0x10')](_0xf85f8c),function(_0x32d230,_0x2b747d){logger[_0x0377('0xd')](_0x0377('0x11'),_0x4e4363,_0x32d230);if(_0x32d230==0x0){var _0x38e55e=_0x2b747d[_0x0377('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x0377('0x13')](_0x2d4bd9[0x1])||_['isEmpty'](_0x2d4bd9[0x1])){logger[_0x0377('0xd')](_0x0377('0x14'),_0x4e4363);_0x4ce4ae['body'][_0x2d4bd9[0x1]]=_0x38e55e;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4e4363,_0x2d4bd9[0x1],_0x38e55e);_0x4ce4ae['body'][_0x2d4bd9[0x1]]=_0x38e55e;}}_0x1f6924[_0x0377('0xb')]();});}}catch(_0x339cb8){logger[_0x0377('0x7')]('[%s][SYSTEM]\x20%s',_0x4e4363,_['isObject'](_0x339cb8)?JSON[_0x0377('0x15')](_0x339cb8):_0x339cb8);logger[_0x0377('0xd')](_0x0377('0x16'),_0x4e4363);_0x1f6924[_0x0377('0xb')]();}};}; \ No newline at end of file +var _0xe80c=['consequence','validate','error','map','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','[%s][SYSTEM]\x20%s','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x86f0cf,_0x549d1f){var _0x2a97d0=function(_0x3a63ff){while(--_0x3a63ff){_0x86f0cf['push'](_0x86f0cf['shift']());}};_0x2a97d0(++_0x549d1f);}(_0xe80c,0x1c2));var _0xce80=function(_0x52947d,_0x3d7173){_0x52947d=_0x52947d-0x0;var _0xa3acec=_0xe80c[_0x52947d];return _0xa3acec;};'use strict';var schema=require('validate');var sh=require(_0xce80('0x0'));var _=require(_0xce80('0x1'));var utils=require(_0xce80('0x2'));var logger=require(_0xce80('0x3'))(_0xce80('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0xce80('0x5')}});exports[_0xce80('0x6')]=function(_0x411d5e,_0x1da6a5){return function(_0x5f3a52){try{var _0xb10325={'command':_0x1da6a5[0x0]};var _0x150f6a=system[_0xce80('0x7')](_0xb10325,{'typecast':!![]});if(_0x150f6a['length']){logger[_0xce80('0x8')]('[%s][SYSTEM]\x20%s',_0x411d5e,_[_0xce80('0x9')](_0x150f6a,'message')[_0xce80('0xa')](',\x20'));logger[_0xce80('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x411d5e);_0x5f3a52['next']();}else{var _0x2d7bf3=this;var _0x159969=utils[_0xce80('0xc')](_0x1da6a5[0x0],this);logger[_0xce80('0xb')](_0xce80('0xd'),_0x411d5e,_0x159969);sh[_0xce80('0xe')](_[_0xce80('0xf')](_0x159969),function(_0xb1f142,_0x4ac266){logger[_0xce80('0xb')](_0xce80('0x10'),_0x411d5e,_0xb1f142);if(_0xb1f142==0x0){var _0x12d8c7=_0x4ac266['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1da6a5[0x1])||_[_0xce80('0x11')](_0x1da6a5[0x1])){logger[_0xce80('0xb')](_0xce80('0x12'),_0x411d5e);_0x2d7bf3[_0xce80('0x13')][_0x1da6a5[0x1]]=_0x12d8c7;}else{logger['info'](_0xce80('0x14'),_0x411d5e,_0x1da6a5[0x1],_0x12d8c7);_0x2d7bf3['body'][_0x1da6a5[0x1]]=_0x12d8c7;}}_0x5f3a52[_0xce80('0x15')]();});}}catch(_0x48796f){logger[_0xce80('0x8')](_0xce80('0x16'),_0x411d5e,_['isObject'](_0x48796f)?JSON['stringify'](_0x48796f):_0x48796f);logger['info'](_0xce80('0x17'),_0x411d5e);_0x5f3a52[_0xce80('0x15')]();}};}; \ 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 b806770..a065695 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 _0xa5ac=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','consequence','length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','finally','stringify','validate'];(function(_0x15a149,_0x90644){var _0x2c0e68=function(_0x4ce89b){while(--_0x4ce89b){_0x15a149['push'](_0x15a149['shift']());}};_0x2c0e68(++_0x90644);}(_0xa5ac,0x137));var _0xca5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ac[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xca5a('0x0'));var _=require(_0xca5a('0x1'));var rpc={'chatInteraction':require(_0xca5a('0x2')),'openchannelInteraction':require(_0xca5a('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xca5a('0x4')),'whatsappInteraction':require(_0xca5a('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xca5a('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xca5a('0x7')]=function(_0x1863d4,_0x54e930,_0x495826,_0x4a174b){return function(_0x15cc8c){try{var _0x49c8c7={'tag':_0x54e930[0x0]};var _0x4f2a1d=tag[_0xca5a('0x0')](_0x49c8c7,{'typecast':!![]});if(_0x4f2a1d[_0xca5a('0x8')]){logger[_0xca5a('0x9')](_0xca5a('0xa'),_0x1863d4,_['map'](_0x4f2a1d,'message')[_0xca5a('0xb')](',\x20'));logger[_0xca5a('0xc')](_0xca5a('0xd'),_0x1863d4);_0x15cc8c[_0xca5a('0xe')]();}else{var _0x4051a4={'ids':[_0x54e930[0x0]]};if(rpc[_0x4a174b[_0xca5a('0xf')]+_0xca5a('0x10')]){rpc[_0x4a174b[_0xca5a('0xf')]+'Interaction'][_0xca5a('0x11')](_0x4a174b[_0xca5a('0x12')]['id'],_0x4051a4)[_0xca5a('0x13')](function(_0x51492f){logger['info'](_0xca5a('0x14'),_0x1863d4,_0x54e930[0x1],_0x4a174b[_0xca5a('0xf')],_0x4a174b[_0xca5a('0x12')]['id']);})[_0xca5a('0x15')](function(_0x267990){logger['error'](_0xca5a('0xa'),_0x1863d4,JSON['stringify'](_0x267990));logger['info'](_0xca5a('0xd'),_0x1863d4);})[_0xca5a('0x16')](function(){_0x15cc8c['next']();});}}}catch(_0x20c713){logger[_0xca5a('0x9')](_0xca5a('0xa'),_0x1863d4,_['isObject'](_0x20c713)?JSON[_0xca5a('0x17')](_0x20c713):_0x20c713);logger['info'](_0xca5a('0xd'),_0x1863d4);_0x15cc8c[_0xca5a('0xe')]();}};}; \ No newline at end of file +var _0xffaf=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then'];(function(_0x4319a6,_0xd991f0){var _0x63dd73=function(_0x16379c){while(--_0x16379c){_0x4319a6['push'](_0x4319a6['shift']());}};_0x63dd73(++_0xd991f0);}(_0xffaf,0xdc));var _0xfffa=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xffaf[_0x5d4607];return _0x5e4a86;};'use strict';var schema=require(_0xfffa('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xfffa('0x1')),'openchannelInteraction':require(_0xfffa('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xfffa('0x3')),'whatsappInteraction':require(_0xfffa('0x4'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0xfffa('0x5')}});exports[_0xfffa('0x6')]=function(_0x7332df,_0x2a27f4,_0x594e61,_0x5e8b14){return function(_0x3b749c){try{var _0x423804={'tag':_0x2a27f4[0x0]};var _0x3578cc=tag[_0xfffa('0x0')](_0x423804,{'typecast':!![]});if(_0x3578cc[_0xfffa('0x7')]){logger[_0xfffa('0x8')](_0xfffa('0x9'),_0x7332df,_[_0xfffa('0xa')](_0x3578cc,_0xfffa('0xb'))['join'](',\x20'));logger[_0xfffa('0xc')](_0xfffa('0xd'),_0x7332df);_0x3b749c[_0xfffa('0xe')]();}else{var _0x34bb6e={'ids':[_0x2a27f4[0x0]]};if(rpc[_0x5e8b14[_0xfffa('0xf')]+_0xfffa('0x10')]){rpc[_0x5e8b14[_0xfffa('0xf')]+'Interaction'][_0xfffa('0x11')](_0x5e8b14[_0xfffa('0x12')]['id'],_0x34bb6e)[_0xfffa('0x13')](function(_0x372cec){logger[_0xfffa('0xc')](_0xfffa('0x14'),_0x7332df,_0x2a27f4[0x1],_0x5e8b14[_0xfffa('0xf')],_0x5e8b14['interaction']['id']);})['catch'](function(_0x5f2e92){logger[_0xfffa('0x8')]('[%s][TAG]\x20%s',_0x7332df,JSON[_0xfffa('0x15')](_0x5f2e92));logger[_0xfffa('0xc')](_0xfffa('0xd'),_0x7332df);})[_0xfffa('0x16')](function(){_0x3b749c['next']();});}}}catch(_0x222b30){logger['error'](_0xfffa('0x9'),_0x7332df,_[_0xfffa('0x17')](_0x222b30)?JSON[_0xfffa('0x15')](_0x222b30):_0x222b30);logger[_0xfffa('0xc')](_0xfffa('0xd'),_0x7332df);_0x3b749c[_0xfffa('0xe')]();}};}; \ 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 e86a0ef..5b4e623 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 _0xa72f=['stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','replace','includes','push','urlOnAnswer','urlOnRing','?params=','jsonrpc','2.0','method','params','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0xa72f,0x13d));var _0xfa72=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xa72f[_0x4cd846];return _0x2f2a7d;};'use strict';var rp=require(_0xfa72('0x0'));var logger=require(_0xfa72('0x1'))(_0xfa72('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x5bd2b8,_0x17fd0c){return function(_0x3c6910){var _0x5502a2=_0x17fd0c[0xa];var _0x4bab3f=_0x17fd0c[0xb];var _0x5d45a9=_0x17fd0c[0xc];var _0x19ff1b=_0x17fd0c[0xd];var _0x1178dc=_0x17fd0c[0xe];var _0x192bdb=_0x17fd0c[0xf]['replace'](/\n/g,'\x20-\x20');var _0x442f94=_0x17fd0c[0x10][_0xfa72('0x3')](/\n/g,'\x20');if(!arr[_0xfa72('0x4')](_0x4bab3f)){arr[_0xfa72('0x5')](_0x4bab3f);var _0x246bab=_0x17fd0c[0x3];var _0x104f64=_0x17fd0c[0x4];var _0x577999=_0x17fd0c[0x1];var _0x166759=_0x17fd0c[0x0];var _0x520350={};_0x520350[_0xfa72('0x6')]=_0x17fd0c[0x8]+'?params='+_0x5d45a9+'|'+_0x5502a2+'|'+_0x19ff1b+'|'+_0x4bab3f+'|'+_0x1178dc;_0x520350[_0xfa72('0x7')]=_0x17fd0c[0x7]+_0xfa72('0x8')+_0x5d45a9+'|'+_0x5502a2+'|'+_0x19ff1b+'|'+_0x4bab3f+'|'+_0x1178dc+'|'+_0x192bdb+'|'+_0x442f94;_0x520350['title']=_0x17fd0c[0x9];var _0x428663={};_0x428663[_0xfa72('0x9')]=_0xfa72('0xa');_0x428663[_0xfa72('0xb')]='login';var _0x5b460d=[];_0x5b460d['push'](_0x17fd0c[0x2]);_0x5b460d[_0xfa72('0x5')](_0x17fd0c[0x5]);_0x5b460d[_0xfa72('0x5')](_0x17fd0c[0x6]);_0x428663[_0xfa72('0xc')]=_0x5b460d;_0x428663['id']=0x1;var _0x585bd0=JSON['stringify'](_0x428663);var _0x44cfb3={'encoding':'utf8','method':_0xfa72('0xd'),'timeout':0x2710,'url':_0x246bab,'headers':{'Content-Type':_0xfa72('0xe')},'body':_0x585bd0};return rp(_0x44cfb3)[_0xfa72('0xf')](function(_0x2c3a68){const _0x4a8855=JSON[_0xfa72('0x10')](_0x2c3a68);if(!_0x4a8855[_0xfa72('0x11')]['logged']){throw new Error(_0xfa72('0x12'));}var _0x38554f=_0x4bab3f;var _0x5bc0c7='channelId='+_0x577999+_0xfa72('0x13')+_0x166759+_0xfa72('0x14')+_0x38554f+_0xfa72('0x15')+JSON[_0xfa72('0x16')](_0x520350);var _0x48c017=_0x104f64+'?'+_0x5bc0c7;return rp(_0x48c017);})[_0xfa72('0xf')](function(_0x52dd3f){logger['info'](_0xfa72('0x17'),_0x5bd2b8,_0x52dd3f);_0x3c6910[_0xfa72('0x18')]();})[_0xfa72('0x19')](function(_0x2d852a){logger['error'](_0xfa72('0x1a'),_0x5bd2b8,_[_0xfa72('0x1b')](_0x2d852a)?JSON[_0xfa72('0x16')](_0x2d852a):_0x2d852a);_0x3c6910[_0xfa72('0x18')]();});}else{logger[_0xfa72('0x1c')](_0xfa72('0x1d'),_0x5bd2b8);_0x3c6910[_0xfa72('0x1e')]();}};}; \ No newline at end of file +var _0x244f=['urlOnRing','title','jsonrpc','2.0','params','stringify','POST','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','replace','\x20-\x20','includes','push','urlOnAnswer','?params='];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x244f,0xa0));var _0xf244=function(_0x5c96ce,_0x31fc87){_0x5c96ce=_0x5c96ce-0x0;var _0x182ab4=_0x244f[_0x5c96ce];return _0x182ab4;};'use strict';var rp=require('request-promise');var logger=require(_0xf244('0x0'))(_0xf244('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x1e43de,_0x1d70b6){return function(_0x436bc1){var _0x2ec733=_0x1d70b6[0xa];var _0x329b9d=_0x1d70b6[0xb];var _0xbeb95e=_0x1d70b6[0xc];var _0x34b6ca=_0x1d70b6[0xd];var _0x577207=_0x1d70b6[0xe];var _0x17da34=_0x1d70b6[0xf][_0xf244('0x2')](/\n/g,_0xf244('0x3'));var _0x264787=_0x1d70b6[0x10][_0xf244('0x2')](/\n/g,'\x20');if(!arr[_0xf244('0x4')](_0x329b9d)){arr[_0xf244('0x5')](_0x329b9d);var _0x904c40=_0x1d70b6[0x3];var _0x34e7d1=_0x1d70b6[0x4];var _0x3499ac=_0x1d70b6[0x1];var _0x3364b7=_0x1d70b6[0x0];var _0x22a627={};_0x22a627[_0xf244('0x6')]=_0x1d70b6[0x8]+_0xf244('0x7')+_0xbeb95e+'|'+_0x2ec733+'|'+_0x34b6ca+'|'+_0x329b9d+'|'+_0x577207;_0x22a627[_0xf244('0x8')]=_0x1d70b6[0x7]+'?params='+_0xbeb95e+'|'+_0x2ec733+'|'+_0x34b6ca+'|'+_0x329b9d+'|'+_0x577207+'|'+_0x17da34+'|'+_0x264787;_0x22a627[_0xf244('0x9')]=_0x1d70b6[0x9];var _0x59c59d={};_0x59c59d[_0xf244('0xa')]=_0xf244('0xb');_0x59c59d['method']='login';var _0x2474e3=[];_0x2474e3[_0xf244('0x5')](_0x1d70b6[0x2]);_0x2474e3[_0xf244('0x5')](_0x1d70b6[0x5]);_0x2474e3[_0xf244('0x5')](_0x1d70b6[0x6]);_0x59c59d[_0xf244('0xc')]=_0x2474e3;_0x59c59d['id']=0x1;var _0x53eda8=JSON[_0xf244('0xd')](_0x59c59d);var _0x5b67dd={'encoding':'utf8','method':_0xf244('0xe'),'timeout':0x2710,'url':_0x904c40,'headers':{'Content-Type':'application/json-rpc'},'body':_0x53eda8};return rp(_0x5b67dd)[_0xf244('0xf')](function(_0x2917e3){const _0x4a20c6=JSON[_0xf244('0x10')](_0x2917e3);if(!_0x4a20c6[_0xf244('0x11')]['logged']){throw new Error(_0xf244('0x12'));}var _0x2ffba4=_0x329b9d;var _0x382970=_0xf244('0x13')+_0x3499ac+_0xf244('0x14')+_0x3364b7+'&sessionId='+_0x2ffba4+_0xf244('0x15')+JSON[_0xf244('0xd')](_0x22a627);var _0x302bee=_0x34e7d1+'?'+_0x382970;return rp(_0x302bee);})[_0xf244('0xf')](function(_0x485f4a){logger[_0xf244('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1e43de,_0x485f4a);_0x436bc1[_0xf244('0x17')]();})[_0xf244('0x18')](function(_0x2eae1c){logger['error'](_0xf244('0x19'),_0x1e43de,_[_0xf244('0x1a')](_0x2eae1c)?JSON[_0xf244('0xd')](_0x2eae1c):_0x2eae1c);_0x436bc1[_0xf244('0x17')]();});}else{logger[_0xf244('0x16')](_0xf244('0x1b'),_0x1e43de);_0x436bc1['next']();}};}; \ 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 6488776..6bddc34 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5c8cb9,_0x3eb077){var _0x5f3a01=function(_0x4818be){while(--_0x4818be){_0x5c8cb9['push'](_0x5c8cb9['shift']());}};_0x5f3a01(++_0x3eb077);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5499e5,_0xcc0d84){var _0x4d0074=function(_0x51cb32){while(--_0x51cb32){_0x5499e5['push'](_0x5499e5['shift']());}};_0x4d0074(++_0xcc0d84);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d446d50..68786df 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 _0x7794=['stack','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','interaction','applications','length','existsSync','join','app','.js','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','message','tag','TagId','tvox','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','priority','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute'];(function(_0x3d1083,_0x4de90a){var _0xb7f0c5=function(_0x65e4d2){while(--_0x65e4d2){_0x3d1083['push'](_0x3d1083['shift']());}};_0xb7f0c5(++_0x4de90a);}(_0x7794,0x7b));var _0x4779=function(_0x4723e2,_0x3d507f){_0x4723e2=_0x4723e2-0x0;var _0xf45615=_0x7794[_0x4723e2];return _0xf45615;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var path=require(_0x4779('0x1'));var fs=require('fs');var jayson=require(_0x4779('0x2'));var BPromise=require(_0x4779('0x3'));var utils=require('./applications/utils');var logger=require(_0x4779('0x4'))(_0x4779('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4779('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4779('0x7'))};var RuleEngine=require(_0x4779('0x8'));function getId(_0x523c93,_0xb3fe18,_0x13bb66){return util[_0x4779('0x9')](_0x4779('0xa'),_0x523c93,_0xb3fe18||0x0,_0x13bb66||0x0);}function getIntervals(_0x9d7a62,_0x7179e1){var _0x42e4c0=[];if(!_['isNil'](_0x7179e1[_0x4779('0xb')])&&!_[_0x4779('0xc')](_0x9d7a62[_0x7179e1[_0x4779('0xb')]])&&!_[_0x4779('0xc')](_0x9d7a62[_0x7179e1[_0x4779('0xb')]][_0x4779('0xd')])){_0x42e4c0=_[_0x4779('0xe')](_0x9d7a62[_0x7179e1[_0x4779('0xb')]][_0x4779('0xd')],_0x4779('0xf'));}else if(!_['isNil'](_0x7179e1['interval'])){_0x42e4c0=[_0x7179e1['interval']];}return _0x42e4c0;}exports[_0x4779('0x10')]=function(_0x274bf3){_0x274bf3[_0x4779('0x11')]={};return new BPromise(function(_0xddf5cd,_0x4fe370){var _0x1a2e4f={'Start':function(_0x3e6106){var _0x4d71a0=this;return new Promise(function(_0x599deb,_0x1dbbe1){if(_0x3e6106){try{var _0x2de2be=[];var _0x7d34fe=getId(_0x3e6106[_0x4779('0x12')],_0x3e6106['message']?_0x3e6106['message']['id']:0x0,_0x3e6106[_0x4779('0x13')]?_0x3e6106[_0x4779('0x13')]['id']:0x0);if(_0x3e6106[_0x4779('0x14')]&&_['isArray'](_0x3e6106[_0x4779('0x14')])&&_0x3e6106['applications'][_0x4779('0x15')]){for(var _0x1e50c0=0x0;_0x1e50c0<_0x3e6106['applications'][_0x4779('0x15')];_0x1e50c0+=0x1){var _0x492f31=_0x3e6106[_0x4779('0x14')][_0x1e50c0];if(fs[_0x4779('0x16')](path[_0x4779('0x17')](__dirname,_0x4779('0x14'),_0x492f31[_0x4779('0x18')]+_0x4779('0x19')))){var _0x4c70b7=[];switch(_0x492f31[_0x4779('0x18')]['toLowerCase']()){case'autoreply':var _0xd983f0=_0x492f31[_0x4779('0x1a')][_0x4779('0x1b')](',');if(_0x3e6106[_0x4779('0x12')]==='mail'){_0x4c70b7[_0x4779('0x1c')](_0xd983f0[0x0]);_0x4c70b7[_0x4779('0x1c')](_0xd983f0[0x1]);_0x4c70b7[_0x4779('0x1c')](_0xd983f0['slice'](0x2,_0xd983f0[_0x4779('0x15')])[_0x4779('0x17')](','));}else{_0x4c70b7['push'](_0xd983f0[0x0]);_0x4c70b7[_0x4779('0x1c')](_0xd983f0[_0x4779('0x1d')](0x1,_0xd983f0['length'])[_0x4779('0x17')](','));}break;case _0x4779('0x1e'):var _0x211af1=_0x492f31[_0x4779('0x1a')][_0x4779('0x1b')](',');_0x4c70b7[_0x4779('0x1c')](_0x211af1[0x0]);_0x4c70b7[_0x4779('0x1c')](_0x211af1[0x1]);_0x4c70b7[_0x4779('0x1c')](_0x211af1['slice'](0x2,_0x211af1[_0x4779('0x15')])[_0x4779('0x17')](','));break;case _0x4779('0x1f'):var _0x28a261=_0x492f31[_0x4779('0x1a')][_0x4779('0x1b')](',');_0x4c70b7[_0x4779('0x1c')](_0x28a261[0x0]);_0x4c70b7[_0x4779('0x1c')](_0x28a261[0x1]);_0x4c70b7['push'](_0x28a261[0x2]);_0x4c70b7['push'](_0x28a261[0x3]);_0x4c70b7[_0x4779('0x1c')](_0x28a261[_0x4779('0x1d')](0x4,_0x28a261[_0x4779('0x15')])[_0x4779('0x17')](','));break;case _0x4779('0x20'):var _0x5a32ce=_0x492f31[_0x4779('0x1a')][_0x4779('0x1b')](',');_0x4c70b7[_0x4779('0x1c')](_0x5a32ce[0x0]);_0x4c70b7[_0x4779('0x1c')](_0x5a32ce[0x1]);_0x4c70b7['push'](_0x5a32ce[0x2]);_0x4c70b7['push'](_0x5a32ce[0x3]);_0x4c70b7[_0x4779('0x1c')](_0x5a32ce['slice'](0x4,_0x5a32ce[_0x4779('0x15')])[_0x4779('0x17')](','));break;case _0x4779('0x21'):_0x4c70b7[_0x4779('0x1c')](_0x492f31[_0x4779('0x1a')]);break;case _0x4779('0x22'):_0x4c70b7[_0x4779('0x1c')](_0x492f31[_0x4779('0x23')]);_0x4c70b7[_0x4779('0x1c')](_0x492f31[_0x4779('0x1a')]);break;case _0x4779('0x24'):var _0x37cf30=utils['getMustacheRender'](_0x3e6106['account'][_0x4779('0x25')],_0x3e6106);var _0x522ef4=_0x492f31[_0x4779('0x1a')]['split'](',');_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x0]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x1]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x2]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x3]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x4]);_0x4c70b7['push'](_0x522ef4[0x5]);_0x4c70b7['push'](_0x522ef4[0x6]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x7]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x8]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0x9]);_0x4c70b7[_0x4779('0x1c')](_0x522ef4[0xa]);_0x4c70b7[_0x4779('0x1c')](_0x3e6106[_0x4779('0x13')]['id']);_0x4c70b7[_0x4779('0x1c')](_0x3e6106[_0x4779('0x21')]['id']);_0x4c70b7[_0x4779('0x1c')](_0x492f31[_0x4779('0x26')]);_0x4c70b7[_0x4779('0x1c')](_0x3e6106[_0x4779('0x13')][_0x4779('0x27')]);_0x4c70b7[_0x4779('0x1c')](_0x3e6106[_0x4779('0x28')][_0x4779('0x28')]);_0x4c70b7[_0x4779('0x1c')](_0x37cf30);break;default:_0x4c70b7=_[_0x4779('0xc')](_0x492f31[_0x4779('0x1a')])?[]:_0x492f31['appdata'][_0x4779('0x1b')](',');}var _0x58ca36={'id':util[_0x4779('0x9')](_0x4779('0x29'),_0x7d34fe,_0x492f31['id'],_0x492f31[_0x4779('0x18')]),'condition':require(_0x4779('0x2a'))[_0x4779('0x2b')](_0x7d34fe,getIntervals(_0x274bf3[_0x4779('0x2c')],_0x492f31),_0x274bf3),'consequence':require('./applications/'+_0x492f31[_0x4779('0x18')])['consequence'](_0x7d34fe,_0x4c70b7,_0x274bf3,_0x3e6106),'p':_0x492f31[_0x4779('0x2d')]||0x0};logger[_0x4779('0x2e')](_0x4779('0x2f'),_0x58ca36['id'],_0x4779('0x30'),getIntervals(_0x274bf3[_0x4779('0x2c')],_0x492f31)[_0x4779('0x17')]('\x20|\x20'));_0x2de2be[_0x4779('0x1c')](_0x58ca36);}else{logger['error'](_0x4779('0x31'),path[_0x4779('0x17')](__dirname,_0x4779('0x14'),_0x492f31['app']+_0x4779('0x19')));}}_0x274bf3[_0x4779('0x11')][_0x7d34fe]=new RuleEngine(_0x2de2be);_0x274bf3[_0x4779('0x11')][_0x7d34fe][_0x4779('0x32')](_0x3e6106,function(_0xbc5a86){logger[_0x4779('0x2e')](_0x4779('0x33'),JSON[_0x4779('0x34')](_0xbc5a86[_0x4779('0x35')]));if(_0x274bf3[_0x4779('0x11')][_0x7d34fe]){_0x274bf3[_0x4779('0x11')][_0x7d34fe][_0x4779('0x36')](_0x4779('0x37'));}});return _0x599deb({'code':0xc8,'message':_0x3e6106});}else{logger[_0x4779('0x2e')](_0x4779('0x38'));return _0x599deb({'code':0xc8,'message':_0x3e6106});}}catch(_0x4f93e3){logger['error'](_0x4f93e3[_0x4779('0x39')]);return _0x1dbbe1(_0x4d71a0[_0x4779('0x3a')](0x1f4,_0x4f93e3));}}return _0x1dbbe1(_0x4779('0x3b'));});},'AcceptMessage':function(_0x272c6a){var _0x361d66=this;return new Promise(function(_0xb96e0a,_0x38de49){if(_0x272c6a[_0x4779('0x3c')]&&_0x272c6a['agent']['id']){if(_0x274bf3[_0x4779('0x3d')][_0x272c6a[_0x4779('0x3c')]['id']]){_0x274bf3[_0x4779('0x3d')][_0x272c6a[_0x4779('0x3c')]['id']][_0x4779('0x3e')]=![];_0x274bf3[_0x4779('0x3d')][_0x272c6a['agent']['id']][_0x4779('0x3f')]=undefined;}}if(_0x272c6a[_0x4779('0x21')]&&_0x272c6a[_0x4779('0x21')]['id']){try{var _0x3f14af=getId(_0x272c6a[_0x4779('0x12')],_0x272c6a['message']?_0x272c6a[_0x4779('0x21')]['id']:0x0,_0x272c6a[_0x4779('0x13')]?_0x272c6a[_0x4779('0x13')]['id']:0x0);if(_0x274bf3['rules'][_0x3f14af]){_0x274bf3[_0x4779('0x11')][_0x3f14af]['emit'](_0x4779('0x40'));if(rpc[_0x272c6a[_0x4779('0x12')]+_0x4779('0x41')]){rpc[_0x272c6a['channel']+_0x4779('0x41')]['update'](_0x3f14af,{'UserId':_0x272c6a[_0x4779('0x21')][_0x4779('0x42')]})[_0x4779('0x43')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0xb96e0a({'code':0xc8,'message':_0x272c6a});}catch(_0x5dc79a){logger[_0x4779('0x3a')](_0x5dc79a[_0x4779('0x39')]);return _0x38de49(_0x361d66['error'](0x1f4,_0x5dc79a));}}logger[_0x4779('0x3a')](_0x4779('0x44'));return _0x38de49(_0x361d66[_0x4779('0x3a')](0x1f4,_0x4779('0x44')));});},'RejectMessage':function(_0x200de3){var _0x4edbdd=this;return new Promise(function(_0x27d0ed,_0x29448a){if(_0x200de3[_0x4779('0x3c')]&&_0x200de3[_0x4779('0x3c')]['id']){try{if(_0x274bf3[_0x4779('0x3d')][_0x200de3[_0x4779('0x3c')]['id']]){_0x274bf3[_0x4779('0x3d')][_0x200de3[_0x4779('0x3c')]['id']]['busy']=![];_0x274bf3['agents'][_0x200de3[_0x4779('0x3c')]['id']][_0x4779('0x3f')]=undefined;}return _0x27d0ed({'code':0xc8,'message':_0x200de3});}catch(_0x35d357){logger[_0x4779('0x3a')](_0x35d357['stack']);return _0x29448a(_0x4edbdd[_0x4779('0x3a')](0x1f4,_0x35d357));}}logger[_0x4779('0x3a')]('message\x20is\x20empty');return _0x29448a(_0x4edbdd[_0x4779('0x3a')](0x1f4,_0x4779('0x44')));});},'AbandonInteraction':function(_0x3f677e){var _0x499924=this;return new Promise(function(_0x5b744f,_0x225734){if(_0x3f677e[_0x4779('0x12')]&&_0x3f677e['interaction']&&_0x3f677e[_0x4779('0x13')]['id']){try{var _0x19a021=getId(_0x3f677e[_0x4779('0x12')],_0x3f677e[_0x4779('0x21')]?_0x3f677e[_0x4779('0x21')]['id']:0x0,_0x3f677e[_0x4779('0x13')]?_0x3f677e[_0x4779('0x13')]['id']:0x0);if(_0x274bf3[_0x4779('0x11')][_0x19a021]){_0x274bf3[_0x4779('0x11')][_0x19a021][_0x4779('0x36')](_0x4779('0x40'));}return _0x5b744f({'code':0xc8,'message':_0x3f677e});}catch(_0x366da3){logger[_0x4779('0x3a')](_0x366da3[_0x4779('0x39')]);return _0x225734(_0x499924['error'](0x1f4,_0x366da3));}}logger['error'](_0x4779('0x44'));return _0x225734(_0x499924[_0x4779('0x3a')](0x1f4,_0x4779('0x44')));});},'AgentCapacity':function(_0x5518dc){var _0x2f21ef=this;return new Promise(function(_0x45b103,_0x8034a2){if(_0x274bf3[_0x4779('0x3d')][_0x4779('0x45')](_0x5518dc['id'])){for(var _0x50f22c in _0x5518dc[_0x4779('0x46')]){if(_0x5518dc[_0x4779('0x46')][_0x4779('0x45')](_0x50f22c)){if(_0x274bf3[_0x4779('0x3d')][_0x5518dc['id']][_0x4779('0x45')](_0x50f22c+_0x4779('0x47'))){_0x274bf3['agents'][_0x5518dc['id']][_0x50f22c+_0x4779('0x47')]=parseInt(_0x5518dc[_0x4779('0x46')][_0x50f22c],0xa);}}}_0x274bf3[_0x4779('0x3d')][_0x5518dc['id']]['updateRealtime']();return _0x45b103({'code':0xc8,'message':_0x274bf3[_0x4779('0x3d')][_0x5518dc['id']]});}else{return _0x8034a2(_0x2f21ef[_0x4779('0x3a')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2e0e0e){return new Promise(function(_0x2d22ec){var _0x4722a9=_[_0x4779('0x48')](_0x274bf3[_0x4779('0x3d')]);if(_0x2e0e0e&&_0x2e0e0e['id']){var _0x4bbe15=_['find'](_0x4722a9,function(_0x4466ce){return _0x4466ce['id']===_0x2e0e0e['id'];});_0x2d22ec(_0x4bbe15);}else{_0x2d22ec({'count':_0x4722a9[_0x4779('0x15')],'rows':_0x4722a9});}});},'ChatQueues':function(){return new Promise(function(_0x4c1e2f){var _0x4cdb9f=[];for(var _0xd2d567 in _0x274bf3[_0x4779('0x49')]){if(_0x274bf3['chatQueues'][_0x4779('0x45')](_0xd2d567)){var _0x5c3587=_0x274bf3[_0x4779('0x49')][_0xd2d567];var _0x4bab30={'id':_0x5c3587['id'],'available':_0x5c3587['available'],'loggedIn':_0x5c3587[_0x4779('0x4a')],'name':_0x5c3587[_0x4779('0x4b')],'paused':_0x5c3587[_0x4779('0x4c')],'waiting':_0x5c3587[_0x4779('0x4d')]};_0x4cdb9f[_0x4779('0x1c')](_0x4bab30);}}_0x4c1e2f({'count':_0x4cdb9f['length'],'rows':_0x4cdb9f});});},'MailQueues':function(){return new Promise(function(_0x99b9df){var _0x170ea3=[];for(var _0x401e14 in _0x274bf3['mailQueues']){if(_0x274bf3['mailQueues']['hasOwnProperty'](_0x401e14)){var _0x7823ae=_0x274bf3[_0x4779('0x4e')][_0x401e14];var _0x5aee0e={'id':_0x7823ae['id'],'available':_0x7823ae['available'],'loggedIn':_0x7823ae[_0x4779('0x4a')],'name':_0x7823ae[_0x4779('0x4b')],'paused':_0x7823ae[_0x4779('0x4c')],'waiting':_0x7823ae[_0x4779('0x4d')]};_0x170ea3[_0x4779('0x1c')](_0x5aee0e);}}_0x99b9df({'count':_0x170ea3[_0x4779('0x15')],'rows':_0x170ea3});});},'OpenchannelQueues':function(){return new Promise(function(_0x350a0e){var _0x5b350e=[];for(var _0x38ac91 in _0x274bf3['openchannelQueues']){if(_0x274bf3[_0x4779('0x4f')][_0x4779('0x45')](_0x38ac91)){var _0xe9ddf8=_0x274bf3[_0x4779('0x4f')][_0x38ac91];var _0x58d75d={'id':_0xe9ddf8['id'],'available':_0xe9ddf8[_0x4779('0x50')],'loggedIn':_0xe9ddf8[_0x4779('0x4a')],'name':_0xe9ddf8[_0x4779('0x4b')],'paused':_0xe9ddf8['paused'],'waiting':_0xe9ddf8[_0x4779('0x4d')]};_0x5b350e['push'](_0x58d75d);}}_0x350a0e({'count':_0x5b350e[_0x4779('0x15')],'rows':_0x5b350e});});},'SmsQueues':function(){return new Promise(function(_0x2d1c6b){var _0x253e32=[];for(var _0x1792f1 in _0x274bf3[_0x4779('0x51')]){if(_0x274bf3[_0x4779('0x51')]['hasOwnProperty'](_0x1792f1)){var _0x435359=_0x274bf3[_0x4779('0x51')][_0x1792f1];var _0x2791e3={'id':_0x435359['id'],'available':_0x435359[_0x4779('0x50')],'loggedIn':_0x435359[_0x4779('0x4a')],'name':_0x435359[_0x4779('0x4b')],'paused':_0x435359[_0x4779('0x4c')],'waiting':_0x435359['waiting']};_0x253e32['push'](_0x2791e3);}}_0x2d1c6b({'count':_0x253e32[_0x4779('0x15')],'rows':_0x253e32});});},'FaxQueues':function(){return new Promise(function(_0x47f6aa){var _0x3bac4e=[];for(var _0x2bbcba in _0x274bf3[_0x4779('0x52')]){if(_0x274bf3['faxQueues'][_0x4779('0x45')](_0x2bbcba)){var _0x2bfd9a=_0x274bf3['faxQueues'][_0x2bbcba];var _0x59cb85={'id':_0x2bfd9a['id'],'available':_0x2bfd9a[_0x4779('0x50')],'loggedIn':_0x2bfd9a[_0x4779('0x4a')],'name':_0x2bfd9a['name'],'paused':_0x2bfd9a['paused'],'waiting':_0x2bfd9a[_0x4779('0x4d')]};_0x3bac4e[_0x4779('0x1c')](_0x59cb85);}}_0x47f6aa({'count':_0x3bac4e[_0x4779('0x15')],'rows':_0x3bac4e});});},'WhatsappQueues':function(){return new Promise(function(_0xc7d320){var _0x3be9f1=[];for(var _0x3fc7dc in _0x274bf3['whatsappQueues']){if(_0x274bf3[_0x4779('0x53')]['hasOwnProperty'](_0x3fc7dc)){var _0x1493e8=_0x274bf3[_0x4779('0x53')][_0x3fc7dc];var _0x17a22f={'id':_0x1493e8['id'],'available':_0x1493e8['available'],'loggedIn':_0x1493e8[_0x4779('0x4a')],'name':_0x1493e8[_0x4779('0x4b')],'paused':_0x1493e8[_0x4779('0x4c')],'waiting':_0x1493e8[_0x4779('0x4d')]};_0x3be9f1['push'](_0x17a22f);}}_0xc7d320({'count':_0x3be9f1[_0x4779('0x15')],'rows':_0x3be9f1});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5010fe){var _0x2ff054=_[_0x4779('0x48')](_0x274bf3['chatQueuesWaitingInteractions']);_0x5010fe({'count':_0x2ff054[_0x4779('0x15')],'rows':_0x2ff054});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3ecdca){var _0x54e748=_['values'](_0x274bf3[_0x4779('0x54')]);_0x3ecdca({'count':_0x54e748[_0x4779('0x15')],'rows':_0x54e748});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xecdfb1){var _0x4c6137=_[_0x4779('0x48')](_0x274bf3['openchannelQueuesWaitingInteractions']);_0xecdfb1({'count':_0x4c6137[_0x4779('0x15')],'rows':_0x4c6137});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1ea03e){var _0x4027fd=_[_0x4779('0x48')](_0x274bf3[_0x4779('0x55')]);_0x1ea03e({'count':_0x4027fd[_0x4779('0x15')],'rows':_0x4027fd});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x24b7f2){var _0x28eebd=_[_0x4779('0x48')](_0x274bf3[_0x4779('0x56')]);_0x24b7f2({'count':_0x28eebd[_0x4779('0x15')],'rows':_0x28eebd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2906c0){var _0xc6f113=_['values'](_0x274bf3[_0x4779('0x57')]);_0x2906c0({'count':_0xc6f113[_0x4779('0x15')],'rows':_0xc6f113});});}};var _0x3e7f54=jayson['server'](_0x1a2e4f)['http']();_0x3e7f54['on'](_0x4779('0x3a'),function(_0x4e997a){logger[_0x4779('0x3a')](JSON[_0x4779('0x34')](_0x4e997a));return _0x4fe370(_0x4e997a);});_0x3e7f54[_0x4779('0x10')](0x232c,'127.0.0.1',function(){console[_0x4779('0x58')](_0x4779('0x59'),0x232c);return _0xddf5cd('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x9c44=['../../../config/logger','routing','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','appdata','mail','push','slice','dialogflow','split','dialogflowv2','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','available','mailQueues','loggedIn','name','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','./applications/utils'];(function(_0x12b9a8,_0x544357){var _0x367e80=function(_0x57afd5){while(--_0x57afd5){_0x12b9a8['push'](_0x12b9a8['shift']());}};_0x367e80(++_0x544357);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x49c4('0x0'));var fs=require('fs');var jayson=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var utils=require(_0x49c4('0x3'));var logger=require(_0x49c4('0x4'))(_0x49c4('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x49c4('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x49c4('0x7')),'whatsappQueueReport':require(_0x49c4('0x8'))};var RuleEngine=require(_0x49c4('0x9'));function getId(_0x2c4e2e,_0x436234,_0x511d53){return util[_0x49c4('0xa')](_0x49c4('0xb'),_0x2c4e2e,_0x436234||0x0,_0x511d53||0x0);}function getIntervals(_0x1d13fb,_0x4487ca){var _0x4c7d3a=[];if(!_['isNil'](_0x4487ca[_0x49c4('0xc')])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca['IntervalId']])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]]['Intervals'])){_0x4c7d3a=_['map'](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]][_0x49c4('0xe')],'interval');}else if(!_[_0x49c4('0xd')](_0x4487ca[_0x49c4('0xf')])){_0x4c7d3a=[_0x4487ca['interval']];}return _0x4c7d3a;}exports[_0x49c4('0x10')]=function(_0x280996){_0x280996[_0x49c4('0x11')]={};return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c={'Start':function(_0x75ea8){var _0x3de397=this;return new Promise(function(_0x58d177,_0x3acd06){if(_0x75ea8){try{var _0x141003=[];var _0x13a2db=getId(_0x75ea8[_0x49c4('0x12')],_0x75ea8[_0x49c4('0x13')]?_0x75ea8['message']['id']:0x0,_0x75ea8[_0x49c4('0x14')]?_0x75ea8[_0x49c4('0x14')]['id']:0x0);if(_0x75ea8['applications']&&_['isArray'](_0x75ea8[_0x49c4('0x15')])&&_0x75ea8[_0x49c4('0x15')][_0x49c4('0x16')]){for(var _0x59f29b=0x0;_0x59f29b<_0x75ea8[_0x49c4('0x15')]['length'];_0x59f29b+=0x1){var _0x2cbd50=_0x75ea8[_0x49c4('0x15')][_0x59f29b];if(fs[_0x49c4('0x17')](path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')))){var _0x46e475=[];switch(_0x2cbd50[_0x49c4('0x19')]['toLowerCase']()){case'autoreply':var _0x57f502=_0x2cbd50[_0x49c4('0x1b')]['split'](',');if(_0x75ea8['channel']===_0x49c4('0x1c')){_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475[_0x49c4('0x1d')](_0x57f502[0x1]);_0x46e475[_0x49c4('0x1d')](_0x57f502['slice'](0x2,_0x57f502['length'])[_0x49c4('0x18')](','));}else{_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475['push'](_0x57f502[_0x49c4('0x1e')](0x1,_0x57f502[_0x49c4('0x16')])[_0x49c4('0x18')](','));}break;case _0x49c4('0x1f'):var _0x531d92=_0x2cbd50['appdata'][_0x49c4('0x20')](',');_0x46e475['push'](_0x531d92[0x0]);_0x46e475[_0x49c4('0x1d')](_0x531d92[0x1]);_0x46e475[_0x49c4('0x1d')](_0x531d92[_0x49c4('0x1e')](0x2,_0x531d92[_0x49c4('0x16')])['join'](','));break;case _0x49c4('0x21'):var _0x2b2793=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x0]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x1]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x2]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x3]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[_0x49c4('0x1e')](0x4,_0x2b2793[_0x49c4('0x16')])['join'](','));break;case'amazonlex':var _0x59eb84=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x0]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x1]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x2]);_0x46e475['push'](_0x59eb84[0x3]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[_0x49c4('0x1e')](0x4,_0x59eb84[_0x49c4('0x16')])[_0x49c4('0x18')](','));break;case'message':_0x46e475['push'](_0x2cbd50[_0x49c4('0x1b')]);break;case _0x49c4('0x22'):_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x23')]);_0x46e475[_0x49c4('0x1d')](_0x2cbd50['appdata']);break;case _0x49c4('0x24'):var _0x84c621=utils[_0x49c4('0x25')](_0x75ea8['account']['notificationTemplate'],_0x75ea8);var _0x85dce2=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x0]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x1]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x2]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x3]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x4]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x5]);_0x46e475['push'](_0x85dce2[0x6]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x7]);_0x46e475['push'](_0x85dce2[0x8]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x9]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0xa]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x14')]['id']);_0x46e475['push'](_0x75ea8[_0x49c4('0x13')]['id']);_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x26')]);_0x46e475['push'](_0x75ea8[_0x49c4('0x14')][_0x49c4('0x27')]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x28')][_0x49c4('0x28')]);_0x46e475[_0x49c4('0x1d')](_0x84c621);break;default:_0x46e475=_[_0x49c4('0xd')](_0x2cbd50[_0x49c4('0x1b')])?[]:_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');}var _0x1e506a={'id':util['format'](_0x49c4('0x29'),_0x13a2db,_0x2cbd50['id'],_0x2cbd50[_0x49c4('0x19')]),'condition':require(_0x49c4('0x2a'))[_0x49c4('0x2b')](_0x13a2db,getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50),_0x280996),'consequence':require(_0x49c4('0x2d')+_0x2cbd50[_0x49c4('0x19')])[_0x49c4('0x2e')](_0x13a2db,_0x46e475,_0x280996,_0x75ea8),'p':_0x2cbd50[_0x49c4('0x2f')]||0x0};logger[_0x49c4('0x30')](_0x49c4('0x31'),_0x1e506a['id'],_0x49c4('0x32'),getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50)['join'](_0x49c4('0x33')));_0x141003['push'](_0x1e506a);}else{logger[_0x49c4('0x34')](_0x49c4('0x35'),path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')));}}_0x280996['rules'][_0x13a2db]=new RuleEngine(_0x141003);_0x280996['rules'][_0x13a2db][_0x49c4('0x36')](_0x75ea8,function(_0x1e7bdc){logger[_0x49c4('0x30')](_0x49c4('0x37'),JSON['stringify'](_0x1e7bdc[_0x49c4('0x38')]));if(_0x280996[_0x49c4('0x11')][_0x13a2db]){_0x280996[_0x49c4('0x11')][_0x13a2db][_0x49c4('0x39')](_0x49c4('0x3a'));}});return _0x58d177({'code':0xc8,'message':_0x75ea8});}else{logger[_0x49c4('0x30')](_0x49c4('0x3b'));return _0x58d177({'code':0xc8,'message':_0x75ea8});}}catch(_0x3351c1){logger[_0x49c4('0x34')](_0x3351c1['stack']);return _0x3acd06(_0x3de397[_0x49c4('0x34')](0x1f4,_0x3351c1));}}return _0x3acd06('routing\x20is\x20empty');});},'AcceptMessage':function(_0x33696e){var _0x628423=this;return new Promise(function(_0x301def,_0x258abe){if(_0x33696e[_0x49c4('0x3c')]&&_0x33696e['agent']['id']){if(_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']][_0x49c4('0x3e')]=![];_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}}if(_0x33696e[_0x49c4('0x13')]&&_0x33696e['message']['id']){try{var _0x3f7379=getId(_0x33696e[_0x49c4('0x12')],_0x33696e[_0x49c4('0x13')]?_0x33696e[_0x49c4('0x13')]['id']:0x0,_0x33696e[_0x49c4('0x14')]?_0x33696e[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x3f7379]){_0x280996['rules'][_0x3f7379][_0x49c4('0x39')](_0x49c4('0x3f'));if(rpc[_0x33696e['channel']+_0x49c4('0x40')]){rpc[_0x33696e[_0x49c4('0x12')]+_0x49c4('0x40')][_0x49c4('0x41')](_0x3f7379,{'UserId':_0x33696e['message']['UserId']})[_0x49c4('0x42')](function(){logger['error'](_0x49c4('0x43'));});}}return _0x301def({'code':0xc8,'message':_0x33696e});}catch(_0x1f941f){logger[_0x49c4('0x34')](_0x1f941f[_0x49c4('0x44')]);return _0x258abe(_0x628423[_0x49c4('0x34')](0x1f4,_0x1f941f));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x258abe(_0x628423['error'](0x1f4,_0x49c4('0x45')));});},'RejectMessage':function(_0x1550ce){var _0x3936d3=this;return new Promise(function(_0x3d944c,_0x17ef75){if(_0x1550ce[_0x49c4('0x3c')]&&_0x1550ce[_0x49c4('0x3c')]['id']){try{if(_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x1550ce['agent']['id']]['busy']=![];_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}return _0x3d944c({'code':0xc8,'message':_0x1550ce});}catch(_0x59a8bc){logger[_0x49c4('0x34')](_0x59a8bc['stack']);return _0x17ef75(_0x3936d3['error'](0x1f4,_0x59a8bc));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x17ef75(_0x3936d3[_0x49c4('0x34')](0x1f4,_0x49c4('0x45')));});},'AbandonInteraction':function(_0x2884ca){var _0x16949a=this;return new Promise(function(_0x35724e,_0x50798e){if(_0x2884ca[_0x49c4('0x12')]&&_0x2884ca[_0x49c4('0x14')]&&_0x2884ca[_0x49c4('0x14')]['id']){try{var _0x208208=getId(_0x2884ca[_0x49c4('0x12')],_0x2884ca[_0x49c4('0x13')]?_0x2884ca['message']['id']:0x0,_0x2884ca['interaction']?_0x2884ca[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x208208]){_0x280996[_0x49c4('0x11')][_0x208208][_0x49c4('0x39')](_0x49c4('0x3f'));}return _0x35724e({'code':0xc8,'message':_0x2884ca});}catch(_0x6b2592){logger[_0x49c4('0x34')](_0x6b2592['stack']);return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,_0x6b2592));}}logger[_0x49c4('0x34')]('message\x20is\x20empty');return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2f966c){var _0x147ebd=this;return new Promise(function(_0x9eaa84,_0x2fe89a){if(_0x280996[_0x49c4('0x3d')][_0x49c4('0x46')](_0x2f966c['id'])){for(var _0x3eb66d in _0x2f966c[_0x49c4('0x47')]){if(_0x2f966c['capacity'][_0x49c4('0x46')](_0x3eb66d)){if(_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['hasOwnProperty'](_0x3eb66d+_0x49c4('0x48'))){_0x280996[_0x49c4('0x3d')][_0x2f966c['id']][_0x3eb66d+'CurrentCapacity']=parseInt(_0x2f966c[_0x49c4('0x47')][_0x3eb66d],0xa);}}}_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['updateRealtime']();return _0x9eaa84({'code':0xc8,'message':_0x280996['agents'][_0x2f966c['id']]});}else{return _0x2fe89a(_0x147ebd['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc43386){return new Promise(function(_0x54947d){var _0xb20a5d=_[_0x49c4('0x49')](_0x280996['agents']);if(_0xc43386&&_0xc43386['id']){var _0x679134=_[_0x49c4('0x4a')](_0xb20a5d,function(_0x5ac9f0){return _0x5ac9f0['id']===_0xc43386['id'];});_0x54947d(_0x679134);}else{_0x54947d({'count':_0xb20a5d[_0x49c4('0x16')],'rows':_0xb20a5d});}});},'ChatQueues':function(){return new Promise(function(_0x3dcf4c){var _0x167e84=[];for(var _0x35f46f in _0x280996['chatQueues']){if(_0x280996[_0x49c4('0x4b')][_0x49c4('0x46')](_0x35f46f)){var _0x3cc604=_0x280996[_0x49c4('0x4b')][_0x35f46f];var _0x5d3375={'id':_0x3cc604['id'],'available':_0x3cc604[_0x49c4('0x4c')],'loggedIn':_0x3cc604['loggedIn'],'name':_0x3cc604['name'],'paused':_0x3cc604['paused'],'waiting':_0x3cc604['waiting']};_0x167e84[_0x49c4('0x1d')](_0x5d3375);}}_0x3dcf4c({'count':_0x167e84[_0x49c4('0x16')],'rows':_0x167e84});});},'MailQueues':function(){return new Promise(function(_0x2ac7df){var _0x28bbf3=[];for(var _0x5b056e in _0x280996['mailQueues']){if(_0x280996[_0x49c4('0x4d')][_0x49c4('0x46')](_0x5b056e)){var _0x342326=_0x280996[_0x49c4('0x4d')][_0x5b056e];var _0x102c15={'id':_0x342326['id'],'available':_0x342326[_0x49c4('0x4c')],'loggedIn':_0x342326[_0x49c4('0x4e')],'name':_0x342326[_0x49c4('0x4f')],'paused':_0x342326['paused'],'waiting':_0x342326[_0x49c4('0x50')]};_0x28bbf3['push'](_0x102c15);}}_0x2ac7df({'count':_0x28bbf3[_0x49c4('0x16')],'rows':_0x28bbf3});});},'OpenchannelQueues':function(){return new Promise(function(_0x264902){var _0x1a5d4c=[];for(var _0x1ea1b4 in _0x280996[_0x49c4('0x51')]){if(_0x280996[_0x49c4('0x51')][_0x49c4('0x46')](_0x1ea1b4)){var _0x3feb0b=_0x280996[_0x49c4('0x51')][_0x1ea1b4];var _0x1743d0={'id':_0x3feb0b['id'],'available':_0x3feb0b[_0x49c4('0x4c')],'loggedIn':_0x3feb0b[_0x49c4('0x4e')],'name':_0x3feb0b[_0x49c4('0x4f')],'paused':_0x3feb0b[_0x49c4('0x52')],'waiting':_0x3feb0b[_0x49c4('0x50')]};_0x1a5d4c[_0x49c4('0x1d')](_0x1743d0);}}_0x264902({'count':_0x1a5d4c[_0x49c4('0x16')],'rows':_0x1a5d4c});});},'SmsQueues':function(){return new Promise(function(_0x3485c0){var _0x4e1544=[];for(var _0x5ec201 in _0x280996[_0x49c4('0x53')]){if(_0x280996[_0x49c4('0x53')]['hasOwnProperty'](_0x5ec201)){var _0x1a15f3=_0x280996[_0x49c4('0x53')][_0x5ec201];var _0x2939fd={'id':_0x1a15f3['id'],'available':_0x1a15f3[_0x49c4('0x4c')],'loggedIn':_0x1a15f3['loggedIn'],'name':_0x1a15f3['name'],'paused':_0x1a15f3['paused'],'waiting':_0x1a15f3[_0x49c4('0x50')]};_0x4e1544[_0x49c4('0x1d')](_0x2939fd);}}_0x3485c0({'count':_0x4e1544[_0x49c4('0x16')],'rows':_0x4e1544});});},'FaxQueues':function(){return new Promise(function(_0x2f4289){var _0x118fc4=[];for(var _0x146706 in _0x280996[_0x49c4('0x54')]){if(_0x280996[_0x49c4('0x54')][_0x49c4('0x46')](_0x146706)){var _0x54dea5=_0x280996[_0x49c4('0x54')][_0x146706];var _0x10fb84={'id':_0x54dea5['id'],'available':_0x54dea5[_0x49c4('0x4c')],'loggedIn':_0x54dea5['loggedIn'],'name':_0x54dea5[_0x49c4('0x4f')],'paused':_0x54dea5[_0x49c4('0x52')],'waiting':_0x54dea5[_0x49c4('0x50')]};_0x118fc4[_0x49c4('0x1d')](_0x10fb84);}}_0x2f4289({'count':_0x118fc4[_0x49c4('0x16')],'rows':_0x118fc4});});},'WhatsappQueues':function(){return new Promise(function(_0x2fd749){var _0x35fa39=[];for(var _0xfc5e17 in _0x280996['whatsappQueues']){if(_0x280996[_0x49c4('0x55')][_0x49c4('0x46')](_0xfc5e17)){var _0x85540f=_0x280996[_0x49c4('0x55')][_0xfc5e17];var _0x1e948a={'id':_0x85540f['id'],'available':_0x85540f['available'],'loggedIn':_0x85540f['loggedIn'],'name':_0x85540f[_0x49c4('0x4f')],'paused':_0x85540f['paused'],'waiting':_0x85540f[_0x49c4('0x50')]};_0x35fa39['push'](_0x1e948a);}}_0x2fd749({'count':_0x35fa39[_0x49c4('0x16')],'rows':_0x35fa39});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x27b77d){var _0x3b03dd=_[_0x49c4('0x49')](_0x280996['chatQueuesWaitingInteractions']);_0x27b77d({'count':_0x3b03dd[_0x49c4('0x16')],'rows':_0x3b03dd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x38d7d3){var _0x2ceada=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x56')]);_0x38d7d3({'count':_0x2ceada[_0x49c4('0x16')],'rows':_0x2ceada});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x38b291){var _0x23bb1c=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x57')]);_0x38b291({'count':_0x23bb1c['length'],'rows':_0x23bb1c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x228189){var _0x46e4fd=_['values'](_0x280996[_0x49c4('0x58')]);_0x228189({'count':_0x46e4fd['length'],'rows':_0x46e4fd});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1e6644){var _0x1bfb8d=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x59')]);_0x1e6644({'count':_0x1bfb8d[_0x49c4('0x16')],'rows':_0x1bfb8d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x58b90c){var _0x16f618=_[_0x49c4('0x49')](_0x280996['whatsappQueuesWaitingInteractions']);_0x58b90c({'count':_0x16f618[_0x49c4('0x16')],'rows':_0x16f618});});}};var _0x167e41=jayson['server'](_0x18211c)[_0x49c4('0x5a')]();_0x167e41['on'](_0x49c4('0x34'),function(_0x57b137){logger[_0x49c4('0x34')](JSON[_0x49c4('0x5b')](_0x57b137));return _0x12777c(_0x57b137);});_0x167e41[_0x49c4('0x10')](0x232c,_0x49c4('0x5c'),function(){console['log'](_0x49c4('0x5d'),0x232c);return _0x2decee(_0x49c4('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 113b370..6adea42 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 _0x2a0d=['iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','then','some','\x20|\x20','when','log','join','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format'];(function(_0x3ce35e,_0x27adac){var _0x2982bd=function(_0x4e824b){while(--_0x4e824b){_0x3ce35e['push'](_0x3ce35e['shift']());}};_0x2982bd(++_0x27adac);}(_0x2a0d,0x121));var _0xd2a0=function(_0x4838fc,_0x57b01f){_0x4838fc=_0x4838fc-0x0;var _0x2b24f2=_0x2a0d[_0x4838fc];return _0x2b24f2;};'use strict';var util=require(_0xd2a0('0x0'));var BPromise=require(_0xd2a0('0x1'));var jayson=require(_0xd2a0('0x2'));var _=require(_0xd2a0('0x3'));var logger=require(_0xd2a0('0x4'))(_0xd2a0('0x5'));var client=jayson[_0xd2a0('0x6')][_0xd2a0('0x7')]({'port':0x232a});function request(_0x1e5b89,_0x9827fc){return new BPromise(function(_0x25870b,_0x57d466){return client['request'](_0x1e5b89,_0x9827fc)['then'](function(_0x3e153a){if(_0x3e153a[_0xd2a0('0x8')]){return _0x57d466(_0x3e153a[_0xd2a0('0x8')][_0xd2a0('0x9')]);}else{return _0x25870b(_0x3e153a[_0xd2a0('0xa')]);}})[_0xd2a0('0xb')](function(_0xfc62a1){return _0x57d466(_0xfc62a1);});});}exports[_0xd2a0('0xc')]=function(_0x32f54e,_0x3bdef7,_0x2846e7){return function(_0x358877){if(_0x2846e7['rules']&&!_0x2846e7[_0xd2a0('0xd')][_0x32f54e]){logger[_0xd2a0('0xe')](_0xd2a0('0xf'),_0x32f54e);return _0x358877[_0xd2a0('0x10')]();}var _0x323e6f=[];for(var _0x1c9231=0x0;_0x1c9231<_0x3bdef7[_0xd2a0('0x11')];_0x1c9231+=0x1){_0x323e6f[_0xd2a0('0x12')](request(_0xd2a0('0x13'),{'command':util[_0xd2a0('0x14')](_0xd2a0('0x15'),_0x3bdef7[_0x1c9231])})['then'](function(_0x5aba2f){return _0x5aba2f&&_0x5aba2f[_0xd2a0('0x9')]&&_0x5aba2f['message']['indexOf'](_0xd2a0('0x16'))>=0x0?!![]:![];})[_0xd2a0('0xb')](function(_0x589d7d){logger[_0xd2a0('0x8')](_0xd2a0('0x17'),_0x32f54e,_0x3bdef7[_0x1c9231]);}));}BPromise[_0xd2a0('0x18')](_0x323e6f)[_0xd2a0('0x19')](function(_0x801139){var _0x13e319=_[_0xd2a0('0x1a')](_0x801139);logger[_0xd2a0('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x32f54e,_0x3bdef7['join'](_0xd2a0('0x1b')),_0x13e319);_0x358877[_0xd2a0('0x1c')](_0x13e319);})[_0xd2a0('0xb')](function(_0x1d49c1){console[_0xd2a0('0x1d')](_0x1d49c1);logger[_0xd2a0('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x32f54e,_0x3bdef7[_0xd2a0('0x1e')](_0xd2a0('0x1b')),_0x1d49c1['stack']);_0x358877[_0xd2a0('0x10')]();});};}; \ No newline at end of file +var _0x31cb=['format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result','condition','rules','info','length','Command'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x31cb,0x9e));var _0xb31c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x31cb[_0xbca1b1];return _0x4e1686;};'use strict';var util=require(_0xb31c('0x0'));var BPromise=require('bluebird');var jayson=require(_0xb31c('0x1'));var _=require(_0xb31c('0x2'));var logger=require(_0xb31c('0x3'))('routing');var client=jayson[_0xb31c('0x4')][_0xb31c('0x5')]({'port':0x232a});function request(_0x7ac934,_0x178d15){return new BPromise(function(_0x386314,_0x30638d){return client[_0xb31c('0x6')](_0x7ac934,_0x178d15)[_0xb31c('0x7')](function(_0x4628ca){if(_0x4628ca[_0xb31c('0x8')]){return _0x30638d(_0x4628ca[_0xb31c('0x8')][_0xb31c('0x9')]);}else{return _0x386314(_0x4628ca[_0xb31c('0xa')]);}})['catch'](function(_0x4641f7){return _0x30638d(_0x4641f7);});});}exports[_0xb31c('0xb')]=function(_0x4c8787,_0x17c637,_0x47745b){return function(_0x10026c){if(_0x47745b['rules']&&!_0x47745b[_0xb31c('0xc')][_0x4c8787]){logger[_0xb31c('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x4c8787);return _0x10026c['stop']();}var _0x41cf5d=[];for(var _0x1bb38f=0x0;_0x1bb38f<_0x17c637[_0xb31c('0xe')];_0x1bb38f+=0x1){_0x41cf5d['push'](request(_0xb31c('0xf'),{'command':util[_0xb31c('0x10')](_0xb31c('0x11'),_0x17c637[_0x1bb38f])})[_0xb31c('0x7')](function(_0x99b5d5){return _0x99b5d5&&_0x99b5d5[_0xb31c('0x9')]&&_0x99b5d5[_0xb31c('0x9')][_0xb31c('0x12')](_0xb31c('0x13'))>=0x0?!![]:![];})[_0xb31c('0x14')](function(_0x4e0c34){logger['error'](_0xb31c('0x15'),_0x4c8787,_0x17c637[_0x1bb38f]);}));}BPromise[_0xb31c('0x16')](_0x41cf5d)[_0xb31c('0x7')](function(_0x178e5f){var _0x5e5cb6=_[_0xb31c('0x17')](_0x178e5f);logger[_0xb31c('0xd')](_0xb31c('0x18'),_0x4c8787,_0x17c637['join'](_0xb31c('0x19')),_0x5e5cb6);_0x10026c[_0xb31c('0x1a')](_0x5e5cb6);})[_0xb31c('0x14')](function(_0x3e3789){console[_0xb31c('0x1b')](_0x3e3789);logger[_0xb31c('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x4c8787,_0x17c637['join'](_0xb31c('0x19')),_0x3e3789[_0xb31c('0x1c')]);_0x10026c['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f3abbdd..d8e3b19 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 _0xea28=['agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','reason','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid'];(function(_0x203cb8,_0x567543){var _0x257591=function(_0x2febca){while(--_0x2febca){_0x203cb8['push'](_0x203cb8['shift']());}};_0x257591(++_0x567543);}(_0xea28,0x13a));var _0x8ea2=function(_0xf2ec40,_0x18616f){_0xf2ec40=_0xf2ec40-0x0;var _0xf66a6=_0xea28[_0xf2ec40];return _0xf66a6;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var utils=require(_0x8ea2('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26155f,_0x459c4e){utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x5'),_0x26155f['uniqueid'],_0x26155f[_0x8ea2('0x6')],_0x26155f[_0x8ea2('0x7')],_0x26155f[_0x8ea2('0x8')],_0x26155f['interface'],_0x26155f[_0x8ea2('0x9')],_0x26155f[_0x8ea2('0xa')],_0x26155f[_0x8ea2('0xb')]));if(_0x26155f[_0x8ea2('0x7')]){utils[_0x8ea2('0xc')](_0x26155f[_0x8ea2('0x7')])[_0x8ea2('0xd')](function(_0x320750){if(_0x320750){_0x26155f[_0x8ea2('0xe')]=_0x320750[_0x8ea2('0xe')];_0x26155f[_0x8ea2('0xf')]=_0x26155f[_0x8ea2('0x10')]?_0x320750['acw']:![];_0x26155f['acwtime']=_0x26155f[_0x8ea2('0xf')]?_0x320750[_0x8ea2('0x11')]:0x0;}utils[_0x8ea2('0x12')]('CreateVoiceAgentReport',_0x26155f);});}else{utils[_0x8ea2('0x12')](_0x8ea2('0x13'),_0x26155f);}if(_0x459c4e){delete transfers[_0x26155f[_0x8ea2('0x14')]];}else{delete agents[_0x26155f[_0x8ea2('0x15')]];}}exports[_0x8ea2('0x16')]=function(_0x5e662e){try{utils[_0x8ea2('0x17')](util['format']('[%s][agents][agentcalled]',_0x5e662e[_0x8ea2('0x14')]),_0x5e662e);agents[_0x5e662e[_0x8ea2('0x15')]]=_0x5e662e;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x1a');agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0xa')]=null;agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=null;utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x1c'),_0x5e662e[_0x8ea2('0x14')],agents[_0x5e662e[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x5e662e[_0x8ea2('0x15')]));}catch(_0x233a40){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')]('[%s][agents][agentcalled]',_0x5e662e['uniqueid']),_0x233a40);}};exports[_0x8ea2('0x1e')]=function(_0x248c18){try{if(!_[_0x8ea2('0x1f')](agents[_0x248c18['destuniqueid']])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][agentringnoanswer]',_0x248c18[_0x8ea2('0x14')]),_0x248c18);utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x20'),_0x248c18[_0x8ea2('0x14')],agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x248c18[_0x8ea2('0x15')]));agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswer']=!![];agents[_0x248c18[_0x8ea2('0x15')]]['agentringnoanswerAt']=utils[_0x8ea2('0x19')]();agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0xb')]='timeout';agents[_0x248c18['destuniqueid']][_0x8ea2('0x21')]='timeout';agents[_0x248c18[_0x8ea2('0x15')]]['holdtime']=_0x248c18[_0x8ea2('0x22')]?parseInt(_0x248c18[_0x8ea2('0x22')])/0x3e8:0x0;agents[_0x248c18[_0x8ea2('0x15')]][_0x8ea2('0x23')]=0x0;unanswered['push'](_0x248c18['destuniqueid']);}}catch(_0xacaa6c){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x24'),_0x248c18[_0x8ea2('0x14')]),_0xacaa6c);}};exports[_0x8ea2('0x25')]=function(_0x307c74){try{_[_0x8ea2('0x26')](agents,function(_0x32e225,_0x316707){if(_0x32e225[_0x8ea2('0x14')]==_0x307c74[_0x8ea2('0x14')]&&!_['includes'](unanswered,_0x32e225['destuniqueid'])){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')]('[%s][agents][queuecallerabandon]',_0x307c74['uniqueid']),_0x307c74);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x27'),_0x307c74[_0x8ea2('0x14')],_0x32e225['membername'],_0x32e225[_0x8ea2('0x15')]));_0x32e225[_0x8ea2('0x1e')]=!![];_0x32e225[_0x8ea2('0x28')]=utils['now']();_0x32e225['lastevent']='abandoned';_0x32e225[_0x8ea2('0x21')]=_0x8ea2('0x29');_0x32e225[_0x8ea2('0x2a')]=_0x307c74['holdtime'];_0x32e225[_0x8ea2('0x23')]=0x0;writeDB(_0x32e225);}});}catch(_0x391b08){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x2b'),_0x307c74[_0x8ea2('0x14')]),_0x391b08);}};exports[_0x8ea2('0x2c')]=function(_0x1fc76a){try{if(agents[_0x1fc76a['destuniqueid']]){utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x1fc76a);utils['info'](util[_0x8ea2('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x1fc76a[_0x8ea2('0x14')],agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x1fc76a[_0x8ea2('0x15')]));agents[_0x1fc76a['destuniqueid']][_0x8ea2('0x2e')]=utils['now']();agents[_0x1fc76a['destuniqueid']][_0x8ea2('0xa')]=_0x1fc76a['connectedlinenum'];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x1b')]=_0x1fc76a[_0x8ea2('0x1b')];agents[_0x1fc76a[_0x8ea2('0x15')]][_0x8ea2('0x2a')]=_0x1fc76a['ringtime'];agents[_0x1fc76a[_0x8ea2('0x15')]]['lastevent']=_0x8ea2('0x2f');_[_0x8ea2('0x26')](agents,function(_0x6d0e0c,_0x3995ff){if(_0x6d0e0c['destuniqueid']!=_0x1fc76a[_0x8ea2('0x15')]&&_0x6d0e0c['uniqueid']==_0x1fc76a[_0x8ea2('0x14')]){_0x6d0e0c['talktime']=0x0;_0x6d0e0c[_0x8ea2('0x2a')]=_0x1fc76a[_0x8ea2('0x22')];_0x6d0e0c[_0x8ea2('0x1e')]=!![];_0x6d0e0c[_0x8ea2('0x28')]=utils[_0x8ea2('0x19')]();_0x6d0e0c[_0x8ea2('0xb')]=_0x8ea2('0x30');_0x6d0e0c['reason']='answered_elsewhere';_0x6d0e0c[_0x8ea2('0x31')]=_0x1fc76a['destuniqueid'];_0x6d0e0c['answeredelsewheremembername']=_0x1fc76a['membername'];writeDB(_0x6d0e0c);}});}}catch(_0x3cbc09){utils['error'](util[_0x8ea2('0x4')](_0x8ea2('0x2d'),_0x1fc76a[_0x8ea2('0x14')]),_0x3cbc09);}};exports[_0x8ea2('0x10')]=function(_0x989d9b){try{if(!_[_0x8ea2('0x1f')](agents[_0x989d9b[_0x8ea2('0x15')]])){utils[_0x8ea2('0x17')](util['format'](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x989d9b);utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x33'),_0x989d9b[_0x8ea2('0x14')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x8')],_0x989d9b[_0x8ea2('0x15')]));agents[_0x989d9b['destuniqueid']][_0x8ea2('0x10')]=!![];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')]=utils['now']();agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x34')],agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x2e')]);agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0x21')]=_0x989d9b[_0x8ea2('0x21')];agents[_0x989d9b[_0x8ea2('0x15')]][_0x8ea2('0xb')]=_0x8ea2('0x36');writeDB(agents[_0x989d9b[_0x8ea2('0x15')]]);}}catch(_0x5c1212){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x32'),_0x989d9b[_0x8ea2('0x14')]),_0x5c1212);}};exports[_0x8ea2('0x37')]=function(_0x1daa25){try{if(!_[_0x8ea2('0x1f')](agents[_0x1daa25[_0x8ea2('0x38')]])){utils['debug'](util[_0x8ea2('0x4')](_0x8ea2('0x39'),_0x1daa25[_0x8ea2('0x14')]),_0x1daa25);utils['info'](util['format'](_0x8ea2('0x3a'),_0x1daa25[_0x8ea2('0x14')],agents[_0x1daa25[_0x8ea2('0x38')]]['membername'],agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')]));agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3b')]=!![];agents[_0x1daa25[_0x8ea2('0x38')]]['transfertype']='blind';agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x3c')]=_0x1daa25[_0x8ea2('0x3d')];agents[_0x1daa25['transfereruniqueid']][_0x8ea2('0x3e')]=agents[_0x1daa25[_0x8ea2('0x38')]][_0x8ea2('0x14')];}}catch(_0x54c9d7){utils['error'](util['format']('[%s][agents][blindtransfer]',_0x1daa25['uniqueid']),_0x54c9d7);}};exports[_0x8ea2('0x3f')]=function(_0x3020ad){try{utils['debug'](util['format'](_0x8ea2('0x40'),_0x3020ad[_0x8ea2('0x41')]),_0x3020ad);if(_0x3020ad[_0x8ea2('0x41')]==_0x3020ad['origtransfererlinkedid']){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad[_0x8ea2('0x42')]])){utils['info'](util[_0x8ea2('0x4')](_0x8ea2('0x43'),_0x3020ad[_0x8ea2('0x41')],agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x8')]));agents[_0x3020ad['secondtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x44')]=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x46')];agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x3e')]=_0x3020ad['origtransfereruniqueid'];}if(_0x3020ad['transfereeuniqueid']&&agents[_0x3020ad['transfereeuniqueid']]){agents[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x47')]]=_[_0x8ea2('0x49')](agents[_0x3020ad['transfereeuniqueid']]);transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x9')]=agents[_0x3020ad['secondtransfereruniqueid']][_0x8ea2('0x9')];transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x42')]][_0x8ea2('0x4a')];transfers[_0x3020ad['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x47')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfereeuniqueid']][_0x8ea2('0x48')]=0x2;}}else if(_0x3020ad[_0x8ea2('0x42')]==_0x3020ad[_0x8ea2('0x4b')]){if(!_[_0x8ea2('0x1f')](agents[_0x3020ad['origtransfereruniqueid']])){utils[_0x8ea2('0x3')](util['format'](_0x8ea2('0x43'),_0x3020ad['origtransfereruniqueid'],agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x8')]));agents[_0x3020ad['origtransfereruniqueid']]['transfer']=!![];agents[_0x3020ad[_0x8ea2('0x41')]]['transfertype']=_0x8ea2('0x45');agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x3c')]=_0x3020ad[_0x8ea2('0x4c')];agents[_0x3020ad['origtransfereruniqueid']][_0x8ea2('0x3e')]=_0x3020ad[_0x8ea2('0x42')];}if(_0x3020ad[_0x8ea2('0x4d')]&&agents[_0x3020ad[_0x8ea2('0x4d')]]){agents[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x48')]=0x1;transfers[_0x3020ad[_0x8ea2('0x4d')]]=_[_0x8ea2('0x49')](agents[_0x3020ad[_0x8ea2('0x4d')]]);transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x9')]=agents[_0x3020ad[_0x8ea2('0x41')]]['calleridnum'];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x4a')]=agents[_0x3020ad[_0x8ea2('0x41')]][_0x8ea2('0x4a')];transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x18')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2e')]=utils[_0x8ea2('0x19')]();transfers[_0x3020ad[_0x8ea2('0x4d')]][_0x8ea2('0x2a')]=0x0;transfers[_0x3020ad['transfertargetuniqueid']][_0x8ea2('0x48')]=0x2;}}}catch(_0x383027){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x40'),_0x3020ad['origtransfereruniqueid']),_0x383027);}};exports['hangup']=function(_0x5d4d9e){try{utils[_0x8ea2('0x17')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x5d4d9e);if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e[_0x8ea2('0x14')]]['reason']===_0x8ea2('0x4f')){if(_0x5d4d9e[_0x8ea2('0x50')]==='21'){agents[_0x5d4d9e['uniqueid']]['reason']=_0x8ea2('0x51');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x51');}utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e['uniqueid'],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);var _0x115d5f=unanswered['indexOf'](_0x5d4d9e[_0x8ea2('0x14')]);if(_0x115d5f>-0x1){unanswered['splice'](_0x115d5f,0x1);}}if(transfers[_0x5d4d9e['uniqueid']]){transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x10')]=!![];transfers[_0x5d4d9e['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x5d4d9e[_0x8ea2('0x14')]]['talktime']=utils['diffTime'](transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x2e')]);transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')]=_0x8ea2('0x53');transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils[_0x8ea2('0x3')](util[_0x8ea2('0x4')](_0x8ea2('0x52'),_0x5d4d9e[_0x8ea2('0x14')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],transfers[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],transfers[_0x5d4d9e['uniqueid']][_0x8ea2('0xb')]));writeDB(transfers[_0x5d4d9e['uniqueid']],!![]);}if(agents[_0x5d4d9e[_0x8ea2('0x14')]]&&agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x2e')]){agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x10')]=!![];agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentcompleteAt']=utils[_0x8ea2('0x19')]();agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x23')]=utils[_0x8ea2('0x35')](agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x34')],agents[_0x5d4d9e[_0x8ea2('0x14')]]['agentconnectAt']);agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x21')]=agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x3b')]?_0x8ea2('0x3b'):_0x8ea2('0x53');agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]=_0x8ea2('0x36');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5d4d9e[_0x8ea2('0x14')],agents[_0x5d4d9e['uniqueid']][_0x8ea2('0x8')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0x21')],agents[_0x5d4d9e[_0x8ea2('0x14')]][_0x8ea2('0xb')]));writeDB(agents[_0x5d4d9e[_0x8ea2('0x14')]]);}}catch(_0x4b4d64){utils[_0x8ea2('0x1d')](util[_0x8ea2('0x4')](_0x8ea2('0x4e'),_0x5d4d9e[_0x8ea2('0x14')]),_0x4b4d64);}}; \ No newline at end of file +var _0x7072=['acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','format','[%s][agents][agentcalled]','now','connectedlinename','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','holdtime','ringtime','talktime','push','error','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfer','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','util','./utils','info','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7072,0x138));var _0x2707=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7072[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var utils=require(_0x2707('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x127e9c,_0x1bbc92){utils[_0x2707('0x2')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x127e9c[_0x2707('0x3')],_0x127e9c['channel'],_0x127e9c[_0x2707('0x4')],_0x127e9c[_0x2707('0x5')],_0x127e9c[_0x2707('0x6')],_0x127e9c[_0x2707('0x7')],_0x127e9c[_0x2707('0x8')],_0x127e9c[_0x2707('0x9')]));if(_0x127e9c[_0x2707('0x4')]){utils[_0x2707('0xa')](_0x127e9c[_0x2707('0x4')])[_0x2707('0xb')](function(_0x51ffc4){if(_0x51ffc4){_0x127e9c['type']=_0x51ffc4[_0x2707('0xc')];_0x127e9c[_0x2707('0xd')]=_0x127e9c[_0x2707('0xe')]?_0x51ffc4[_0x2707('0xf')]:![];_0x127e9c[_0x2707('0x10')]=_0x127e9c[_0x2707('0xd')]?_0x51ffc4[_0x2707('0x11')]:0x0;}utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);});}else{utils[_0x2707('0x12')](_0x2707('0x13'),_0x127e9c);}if(_0x1bbc92){delete transfers[_0x127e9c[_0x2707('0x3')]];}else{delete agents[_0x127e9c[_0x2707('0x14')]];}}exports['agentcalled']=function(_0x44c1d7){try{utils['debug'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x44c1d7);agents[_0x44c1d7[_0x2707('0x14')]]=_0x44c1d7;agents[_0x44c1d7[_0x2707('0x14')]]['agentcalledAt']=utils[_0x2707('0x17')]();agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x9')]='called';agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x8')]=null;agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x18')]=null;utils[_0x2707('0x2')](util[_0x2707('0x15')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x44c1d7[_0x2707('0x3')],agents[_0x44c1d7[_0x2707('0x14')]][_0x2707('0x5')],_0x44c1d7['destuniqueid']));}catch(_0x529936){utils['error'](util[_0x2707('0x15')](_0x2707('0x16'),_0x44c1d7[_0x2707('0x3')]),_0x529936);}};exports[_0x2707('0x19')]=function(_0x1a0e1a){try{if(!_[_0x2707('0x1a')](agents[_0x1a0e1a[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x1c'),_0x1a0e1a[_0x2707('0x3')]),_0x1a0e1a);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x1d'),_0x1a0e1a['uniqueid'],agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x5')],_0x1a0e1a[_0x2707('0x14')]));agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x19')]=!![];agents[_0x1a0e1a[_0x2707('0x14')]]['agentringnoanswerAt']=utils[_0x2707('0x17')]();agents[_0x1a0e1a[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x1e');agents[_0x1a0e1a[_0x2707('0x14')]]['reason']=_0x2707('0x1e');agents[_0x1a0e1a['destuniqueid']][_0x2707('0x1f')]=_0x1a0e1a[_0x2707('0x20')]?parseInt(_0x1a0e1a[_0x2707('0x20')])/0x3e8:0x0;agents[_0x1a0e1a['destuniqueid']][_0x2707('0x21')]=0x0;unanswered[_0x2707('0x22')](_0x1a0e1a[_0x2707('0x14')]);}}catch(_0x529be8){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentringnoanswer]',_0x1a0e1a[_0x2707('0x3')]),_0x529be8);}};exports['queuecallerabandon']=function(_0x5aaffb){try{_[_0x2707('0x24')](agents,function(_0x4e0c93,_0x2a0d24){if(_0x4e0c93[_0x2707('0x3')]==_0x5aaffb[_0x2707('0x3')]&&!_[_0x2707('0x25')](unanswered,_0x4e0c93['destuniqueid'])){utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x5aaffb);utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x27'),_0x5aaffb[_0x2707('0x3')],_0x4e0c93[_0x2707('0x5')],_0x4e0c93['destuniqueid']));_0x4e0c93[_0x2707('0x19')]=!![];_0x4e0c93[_0x2707('0x28')]=utils['now']();_0x4e0c93['lastevent']='abandoned';_0x4e0c93['reason']='abandoned';_0x4e0c93[_0x2707('0x1f')]=_0x5aaffb['holdtime'];_0x4e0c93['talktime']=0x0;writeDB(_0x4e0c93);}});}catch(_0x4558bb){utils[_0x2707('0x23')](util['format'](_0x2707('0x26'),_0x5aaffb[_0x2707('0x3')]),_0x4558bb);}};exports['agentconnect']=function(_0x5e6b51){try{if(agents[_0x5e6b51[_0x2707('0x14')]]){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x5e6b51);utils[_0x2707('0x2')](util['format'](_0x2707('0x29'),_0x5e6b51[_0x2707('0x3')],agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x5')],_0x5e6b51[_0x2707('0x14')]));agents[_0x5e6b51[_0x2707('0x14')]]['agentconnectAt']=utils[_0x2707('0x17')]();agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x8')]=_0x5e6b51[_0x2707('0x8')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x18')]=_0x5e6b51[_0x2707('0x18')];agents[_0x5e6b51['destuniqueid']][_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];agents[_0x5e6b51[_0x2707('0x14')]][_0x2707('0x9')]=_0x2707('0x2a');_[_0x2707('0x24')](agents,function(_0x3ed513,_0x39d9f6){if(_0x3ed513[_0x2707('0x14')]!=_0x5e6b51[_0x2707('0x14')]&&_0x3ed513[_0x2707('0x3')]==_0x5e6b51[_0x2707('0x3')]){_0x3ed513[_0x2707('0x21')]=0x0;_0x3ed513[_0x2707('0x1f')]=_0x5e6b51[_0x2707('0x20')];_0x3ed513[_0x2707('0x19')]=!![];_0x3ed513['agentringnoanswerAt']=utils[_0x2707('0x17')]();_0x3ed513[_0x2707('0x9')]='answered_elsewhere';_0x3ed513[_0x2707('0x2b')]='answered_elsewhere';_0x3ed513[_0x2707('0x2c')]=_0x5e6b51[_0x2707('0x14')];_0x3ed513[_0x2707('0x2d')]=_0x5e6b51[_0x2707('0x5')];writeDB(_0x3ed513);}});}}catch(_0x13e1c0){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][agentconnect]',_0x5e6b51[_0x2707('0x3')]),_0x13e1c0);}};exports[_0x2707('0xe')]=function(_0x4c8dbf){try{if(!_[_0x2707('0x1a')](agents[_0x4c8dbf[_0x2707('0x14')]])){utils[_0x2707('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x4c8dbf[_0x2707('0x3')]),_0x4c8dbf);utils[_0x2707('0x2')](util['format'](_0x2707('0x2e'),_0x4c8dbf['uniqueid'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x5')],_0x4c8dbf[_0x2707('0x14')]));agents[_0x4c8dbf[_0x2707('0x14')]]['agentcomplete']=!![];agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x4c8dbf[_0x2707('0x14')]]['agentcompleteAt'],agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x31')]);agents[_0x4c8dbf[_0x2707('0x14')]][_0x2707('0x2b')]=_0x4c8dbf[_0x2707('0x2b')];agents[_0x4c8dbf['destuniqueid']][_0x2707('0x9')]='complete';writeDB(agents[_0x4c8dbf[_0x2707('0x14')]]);}}catch(_0x6ada76){utils['error'](util[_0x2707('0x15')](_0x2707('0x32'),_0x4c8dbf[_0x2707('0x3')]),_0x6ada76);}};exports['blindtransfer']=function(_0x1a8034){try{if(!_['isNil'](agents[_0x1a8034[_0x2707('0x33')]])){utils[_0x2707('0x1b')](util['format'](_0x2707('0x34'),_0x1a8034[_0x2707('0x3')]),_0x1a8034);utils[_0x2707('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1a8034[_0x2707('0x3')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x5')],agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x3')]));agents[_0x1a8034['transfereruniqueid']]['transfer']=!![];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x35')]=_0x2707('0x36');agents[_0x1a8034[_0x2707('0x33')]][_0x2707('0x37')]=_0x1a8034[_0x2707('0x38')];agents[_0x1a8034['transfereruniqueid']][_0x2707('0x39')]=agents[_0x1a8034[_0x2707('0x33')]]['uniqueid'];}}catch(_0x482ed1){utils[_0x2707('0x23')](util[_0x2707('0x15')](_0x2707('0x34'),_0x1a8034['uniqueid']),_0x482ed1);}};exports[_0x2707('0x3a')]=function(_0x40a1a8){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8[_0x2707('0x3b')]),_0x40a1a8);if(_0x40a1a8[_0x2707('0x3b')]==_0x40a1a8[_0x2707('0x3c')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3d')]])){utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3d')]]['membername']));agents[_0x40a1a8[_0x2707('0x3d')]]['transfer']=!![];agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x35')]='ATTENDED';agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x37')]=_0x40a1a8[_0x2707('0x3f')];agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x39')]=_0x40a1a8[_0x2707('0x3b')];}if(_0x40a1a8[_0x2707('0x40')]&&agents[_0x40a1a8[_0x2707('0x40')]]){agents[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x40')]]=_[_0x2707('0x42')](agents[_0x40a1a8['transfereeuniqueid']]);transfers[_0x40a1a8['transfereeuniqueid']]['calleridnum']=agents[_0x40a1a8[_0x2707('0x3d')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x40')]]['calleridname']=agents[_0x40a1a8['secondtransfereruniqueid']][_0x2707('0x43')];transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x40')]]['agentconnectAt']=utils['now']();transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x40')]][_0x2707('0x41')]=0x2;}}else if(_0x40a1a8[_0x2707('0x3d')]==_0x40a1a8[_0x2707('0x45')]){if(!_[_0x2707('0x1a')](agents[_0x40a1a8[_0x2707('0x3b')]])){utils[_0x2707('0x2')](util['format'](_0x2707('0x3e'),_0x40a1a8[_0x2707('0x3b')],agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x5')]));agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x46')]=!![];agents[_0x40a1a8['origtransfereruniqueid']]['transfertype']=_0x2707('0x47');agents[_0x40a1a8[_0x2707('0x3b')]]['transferexten']=_0x40a1a8['secondtransfererexten'];agents[_0x40a1a8['origtransfereruniqueid']]['transferuniqueid']=_0x40a1a8[_0x2707('0x3d')];}if(_0x40a1a8[_0x2707('0x48')]&&agents[_0x40a1a8['transfertargetuniqueid']]){agents[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x1;transfers[_0x40a1a8[_0x2707('0x48')]]=_['clone'](agents[_0x40a1a8['transfertargetuniqueid']]);transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x7')]=agents[_0x40a1a8[_0x2707('0x3b')]][_0x2707('0x7')];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x43')]=agents[_0x40a1a8[_0x2707('0x3b')]]['calleridname'];transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x44')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x31')]=utils[_0x2707('0x17')]();transfers[_0x40a1a8['transfertargetuniqueid']][_0x2707('0x1f')]=0x0;transfers[_0x40a1a8[_0x2707('0x48')]][_0x2707('0x41')]=0x2;}}}catch(_0x142606){utils[_0x2707('0x23')](util[_0x2707('0x15')]('[%s][agents][attendedtransfer]',_0x40a1a8['origtransfereruniqueid']),_0x142606);}};exports[_0x2707('0x49')]=function(_0x2b0df0){try{utils[_0x2707('0x1b')](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x2b0df0);if(agents[_0x2b0df0['uniqueid']]&&agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]==='timeout'){if(_0x2b0df0[_0x2707('0x4b')]==='21'){agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')]=_0x2707('0x4c');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]='rejected';}utils[_0x2707('0x2')](util['format'](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],agents[_0x2b0df0['uniqueid']][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]));writeDB(agents[_0x2b0df0['uniqueid']]);var _0x3bfec3=unanswered[_0x2707('0x4e')](_0x2b0df0[_0x2707('0x3')]);if(_0x3bfec3>-0x1){unanswered[_0x2707('0x4f')](_0x3bfec3,0x1);}}if(transfers[_0x2b0df0[_0x2707('0x3')]]){transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0xe')]=!![];transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')]=utils[_0x2707('0x17')]();transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);transfers[_0x2b0df0[_0x2707('0x3')]]['reason']=_0x2707('0x50');transfers[_0x2b0df0['uniqueid']]['lastevent']=_0x2707('0x51');utils[_0x2707('0x2')](util[_0x2707('0x15')](_0x2707('0x4d'),_0x2b0df0[_0x2707('0x3')],transfers[_0x2b0df0[_0x2707('0x3')]]['membername'],transfers[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],transfers[_0x2b0df0[_0x2707('0x3')]]['lastevent']));writeDB(transfers[_0x2b0df0[_0x2707('0x3')]],!![]);}if(agents[_0x2b0df0[_0x2707('0x3')]]&&agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]){agents[_0x2b0df0['uniqueid']][_0x2707('0xe')]=!![];agents[_0x2b0df0['uniqueid']][_0x2707('0x2f')]=utils[_0x2707('0x17')]();agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x21')]=utils[_0x2707('0x30')](agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2f')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x31')]);agents[_0x2b0df0['uniqueid']][_0x2707('0x2b')]=agents[_0x2b0df0['uniqueid']][_0x2707('0x46')]?_0x2707('0x46'):_0x2707('0x50');agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x9')]=_0x2707('0x51');utils['info'](util['format'](_0x2707('0x4d'),_0x2b0df0['uniqueid'],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x5')],agents[_0x2b0df0[_0x2707('0x3')]][_0x2707('0x2b')],agents[_0x2b0df0['uniqueid']][_0x2707('0x9')]));writeDB(agents[_0x2b0df0[_0x2707('0x3')]]);}}catch(_0x17b7b7){utils['error'](util[_0x2707('0x15')](_0x2707('0x4a'),_0x2b0df0[_0x2707('0x3')]),_0x17b7b7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6b7bb9b..63a4666 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 _0x5a43=['application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','blinds','transfereeuniqueid','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','now','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','debug','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]','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','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0x36261c,_0x22c9f4){var _0x387b3e=function(_0x226180){while(--_0x226180){_0x36261c['push'](_0x36261c['shift']());}};_0x387b3e(++_0x22c9f4);}(_0x5a43,0xf1));var _0x35a4=function(_0x9ce957,_0x21123d){_0x9ce957=_0x9ce957-0x0;var _0x2e1cd9=_0x5a43[_0x9ce957];return _0x2e1cd9;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var utils=require(_0x35a4('0x2'));var transfers=require(_0x35a4('0x3'));var dispositions=[_0x35a4('0x4'),_0x35a4('0x5'),_0x35a4('0x5'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x35a4('0x6'),_0x35a4('0x5'),_0x35a4('0x5'),_0x35a4('0x5')];var channels={};function writeDB(_0x384a3e){var _0xa4665e;if(transfers['blinds'][_0x384a3e[_0x35a4('0x7')]]){_0xa4665e=_0x384a3e[_0x35a4('0x7')];_0x384a3e[_0x35a4('0x7')]=transfers[_0x35a4('0x8')][_0x384a3e[_0x35a4('0x7')]][_0x35a4('0x9')];}utils['info'](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x384a3e[_0x35a4('0x7')],_0x384a3e['channel'],_0x384a3e[_0x35a4('0xa')],_0x384a3e[_0x35a4('0xb')],_0x384a3e[_0x35a4('0xc')],_0x384a3e['calleridnum'],_0x384a3e[_0x35a4('0xd')],_0x384a3e[_0x35a4('0xe')]));if(_0x384a3e[_0x35a4('0xf')]){utils[_0x35a4('0x10')](_0x384a3e['accountcode'])[_0x35a4('0x11')](function(_0xf9f6d3){if(_0xf9f6d3){_0x384a3e['UserId']=_0xf9f6d3['id'];}utils[_0x35a4('0x12')]('CreateVoiceCallReport',_0x384a3e);});}else{utils[_0x35a4('0x12')](_0x35a4('0x13'),_0x384a3e);}if(channels[_0x384a3e[_0x35a4('0x7')]]){delete channels[_0x384a3e[_0x35a4('0x7')]];}else if(_0xa4665e&&channels[_0xa4665e]){if(!transfers[_0x35a4('0x8')][_0xa4665e][_0x35a4('0x14')])delete transfers[_0x35a4('0x8')][_0xa4665e];delete channels[_0xa4665e];}}exports[_0x35a4('0x15')]=function(_0x20cc63){try{utils['debug'](util[_0x35a4('0x16')](_0x35a4('0x17'),_0x20cc63[_0x35a4('0x7')]),_0x20cc63);if(_0x20cc63[_0x35a4('0x7')]==_0x20cc63[_0x35a4('0x18')]&&_0x20cc63[_0x35a4('0x19')]!=_0x35a4('0x1a')){utils[_0x35a4('0x1b')](util['format'](_0x35a4('0x1c'),_0x20cc63['uniqueid'],_0x20cc63['context'],_0x20cc63[_0x35a4('0x1d')]));channels[_0x20cc63[_0x35a4('0x7')]]={'uniqueid':_0x20cc63[_0x35a4('0x7')],'accountcode':_0x20cc63['accountcode'],'source':_0x20cc63[_0x35a4('0x1e')],'destination':_0x20cc63[_0x35a4('0x1d')],'destinationcontext':_0x20cc63[_0x35a4('0x1f')],'channel':_0x20cc63['channel'],'starttime':utils[_0x35a4('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x35a4('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x13fc5a){utils[_0x35a4('0x21')](util[_0x35a4('0x16')](_0x35a4('0x17'),_0x20cc63['uniqueid']),_0x13fc5a);}};exports['newstate']=function(_0x7a193c){try{utils['debug'](util[_0x35a4('0x16')](_0x35a4('0x22'),_0x7a193c[_0x35a4('0x7')]),_0x7a193c);if(!_[_0x35a4('0x23')](channels[_0x7a193c[_0x35a4('0x7')]])&&_0x7a193c[_0x35a4('0x24')]==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x7a193c[_0x35a4('0x7')],_0x7a193c[_0x35a4('0x1f')],_0x7a193c['channel']));if(_['isNil'](channels[_0x7a193c[_0x35a4('0x7')]][_0x35a4('0x25')])){channels[_0x7a193c[_0x35a4('0x7')]][_0x35a4('0x25')]=utils['now']();}}else if(!_['isNil'](channels[_0x7a193c['linkedid']])&&_0x7a193c['channelstate']==0x6&&_0x7a193c[_0x35a4('0x1f')]!=_0x35a4('0x26')){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x27'),_0x7a193c[_0x35a4('0x7')],_0x7a193c[_0x35a4('0x18')],_0x7a193c[_0x35a4('0x1f')],_0x7a193c[_0x35a4('0x19')]));channels[_0x7a193c[_0x35a4('0x18')]][_0x35a4('0xf')]=_0x7a193c[_0x35a4('0xf')];channels[_0x7a193c[_0x35a4('0x18')]][_0x35a4('0x28')]=_0x7a193c[_0x35a4('0x19')];if(_[_0x35a4('0x23')](channels[_0x7a193c['linkedid']][_0x35a4('0x29')])){channels[_0x7a193c[_0x35a4('0x18')]][_0x35a4('0x29')]=utils['now']();}channels[_0x7a193c[_0x35a4('0x18')]][_0x35a4('0x2a')]=dispositions[_[_0x35a4('0x2b')](_0x7a193c['channelstate'])]||'ANSWERED';}}catch(_0x4419ab){utils['error'](util[_0x35a4('0x16')](_0x35a4('0x22'),_0x7a193c[_0x35a4('0x7')]),_0x4419ab);}};exports['hangup']=function(_0x5cc3a4){try{if(!_[_0x35a4('0x23')](channels[_0x5cc3a4[_0x35a4('0x7')]])){utils[_0x35a4('0x2c')](util[_0x35a4('0x16')](_0x35a4('0x2d'),_0x5cc3a4[_0x35a4('0x7')]),_0x5cc3a4);if(_[_0x35a4('0x23')](channels[_0x5cc3a4[_0x35a4('0x7')]]['callerid'])){channels[_0x5cc3a4['uniqueid']][_0x35a4('0x2e')]=_0x5cc3a4[_0x35a4('0x2f')]+'\x20<'+_0x5cc3a4[_0x35a4('0x1e')]+'>';}utils[_0x35a4('0x1b')](util[_0x35a4('0x16')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5cc3a4[_0x35a4('0x7')],channels[_0x5cc3a4['uniqueid']][_0x35a4('0x2e')],_0x5cc3a4['cause-txt']));channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x30')]=utils[_0x35a4('0x20')]();channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x31')]=utils[_0x35a4('0x32')](channels[_0x5cc3a4['uniqueid']][_0x35a4('0x30')],channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x33')]);channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x34')]=channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x29')]?utils[_0x35a4('0x32')](channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x30')],channels[_0x5cc3a4[_0x35a4('0x7')]][_0x35a4('0x29')]):0x0;writeDB(channels[_0x5cc3a4['uniqueid']]);}}catch(_0x253047){utils['error'](util[_0x35a4('0x16')](_0x35a4('0x2d'),_0x5cc3a4[_0x35a4('0x7')]),_0x253047);}};exports[_0x35a4('0x35')]=function(_0x2afed0){try{if(!_[_0x35a4('0x23')](channels[_0x2afed0[_0x35a4('0x36')]])){utils[_0x35a4('0x2c')](util[_0x35a4('0x16')](_0x35a4('0x37'),_0x2afed0['origtransfereruniqueid']),_0x2afed0);if(channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x19')]==_0x2afed0[_0x35a4('0x38')]){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x39'),_0x2afed0[_0x35a4('0x3a')],_0x2afed0['localtwolinkedid'],_0x2afed0[_0x35a4('0x3b')]));channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x28')]=_0x2afed0['secondtransfererchannel'];channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x3c')]=_0x35a4('0x3d');}else if(channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x19')]=_0x2afed0[_0x35a4('0x3e')]){utils[_0x35a4('0x1b')](util['format'](_0x35a4('0x39'),_0x2afed0['origtransfereruniqueid'],_0x2afed0[_0x35a4('0x36')],_0x2afed0[_0x35a4('0x3f')]));channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x28')]=_0x2afed0['origtransfererchannel'];channels[_0x2afed0[_0x35a4('0x36')]][_0x35a4('0x3c')]=_0x35a4('0x3d');}}}catch(_0x951746){utils[_0x35a4('0x21')](util[_0x35a4('0x16')](_0x35a4('0x37'),_0x2afed0[_0x35a4('0x3a')]),_0x951746);}};exports[_0x35a4('0x40')]=function(_0x535575){try{if(!_[_0x35a4('0x23')](channels[_0x535575[_0x35a4('0x7')]])){utils['debug'](util[_0x35a4('0x16')](_0x35a4('0x41'),_0x535575[_0x35a4('0x7')]),_0x535575);channels[_0x535575[_0x35a4('0x7')]]['musiconholdstartAt']=utils[_0x35a4('0x20')]();utils[_0x35a4('0x1b')](util[_0x35a4('0x16')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x535575[_0x35a4('0x7')],channels[_0x535575['uniqueid']][_0x35a4('0x42')]));}}catch(_0x1223b5){utils['error'](util[_0x35a4('0x16')]('[%s][calls][musiconholdstart]',_0x535575[_0x35a4('0x7')]),_0x1223b5);}};exports['musiconholdstop']=function(_0xec1d64){try{if(!_[_0x35a4('0x23')](channels[_0xec1d64[_0x35a4('0x7')]])){utils[_0x35a4('0x2c')](util['format']('[%s][calls][musiconholdstop]',_0xec1d64[_0x35a4('0x7')]),_0xec1d64);if(!_[_0x35a4('0x23')](channels[_0xec1d64[_0x35a4('0x7')]][_0x35a4('0x42')])){channels[_0xec1d64['uniqueid']][_0x35a4('0x43')]+=utils[_0x35a4('0x32')](utils[_0x35a4('0x20')](),channels[_0xec1d64['uniqueid']]['musiconholdstartAt']);utils[_0x35a4('0x1b')](util[_0x35a4('0x16')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0xec1d64[_0x35a4('0x7')],channels[_0xec1d64['uniqueid']][_0x35a4('0x43')]));delete channels[_0xec1d64[_0x35a4('0x7')]][_0x35a4('0x42')];}}}catch(_0xf543b5){utils[_0x35a4('0x21')](util[_0x35a4('0x16')](_0x35a4('0x44'),_0xec1d64[_0x35a4('0x7')]),_0xf543b5);}};exports[_0x35a4('0x45')]=function(_0x456f8a){try{if(!_[_0x35a4('0x23')](channels[_0x456f8a['uniqueid']])){utils['debug'](util[_0x35a4('0x16')](_0x35a4('0x46'),_0x456f8a['uniqueid']),_0x456f8a);if(!_[_0x35a4('0x23')](_0x456f8a[_0x35a4('0x47')][_0x35a4('0x48')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x49'),_0x456f8a[_0x35a4('0x7')],_0x456f8a['value']));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x4a')]=_0x456f8a[_0x35a4('0x4b')];}if(!_[_0x35a4('0x23')](_0x456f8a['variable'][_0x35a4('0x4c')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x4d'),_0x456f8a['uniqueid'],_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x4e')]=_0x456f8a['value'];channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x2e')]='\x22'+_0x456f8a[_0x35a4('0x4b')]+_0x35a4('0x4f')+_0x456f8a[_0x35a4('0x4b')]+'>';}if(!_['isNil'](_0x456f8a[_0x35a4('0x47')][_0x35a4('0x50')])||!_['isNil'](_0x456f8a['variable'][_0x35a4('0x51')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x52'),_0x456f8a['uniqueid'],!_[_0x35a4('0x23')](_0x456f8a[_0x35a4('0x47')][_0x35a4('0x50')])?'xmd-callerid-preview':'xmd-callerid',_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x2e')]=_0x456f8a[_0x35a4('0x4b')];}if(!_['isNil'](_0x456f8a['variable'][_0x35a4('0x53')])||!_[_0x35a4('0x23')](_0x456f8a[_0x35a4('0x47')]['xmcs-queue'])){utils['info'](util[_0x35a4('0x16')](_0x35a4('0x52'),_0x456f8a['uniqueid'],!_[_0x35a4('0x23')](_0x456f8a['variable']['xmd-queue'])?'xmd-queue':_0x35a4('0x54'),_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x55')]='Queue';channels[_0x456f8a[_0x35a4('0x7')]]['lastdata']=_0x456f8a[_0x35a4('0x4b')];channels[_0x456f8a['uniqueid']][_0x35a4('0xa')]=!![];}if(!_['isNil'](_0x456f8a[_0x35a4('0x47')][_0x35a4('0x56')])){utils['info'](util[_0x35a4('0x16')](_0x35a4('0x57'),_0x456f8a['uniqueid'],_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a['uniqueid']][_0x35a4('0x58')]=_0x456f8a[_0x35a4('0x4b')];}if(!_[_0x35a4('0x23')](_0x456f8a['variable'][_0x35a4('0x59')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x456f8a[_0x35a4('0x7')],_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]]['type']=_0x456f8a[_0x35a4('0x4b')];}if(!_[_0x35a4('0x23')](_0x456f8a['variable'][_0x35a4('0x5a')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x5b'),_0x456f8a['uniqueid'],_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x5c')]=_0x456f8a[_0x35a4('0x4b')];}if(!_[_0x35a4('0x23')](_0x456f8a[_0x35a4('0x47')][_0x35a4('0x5d')])){utils[_0x35a4('0x1b')](util[_0x35a4('0x16')](_0x35a4('0x5e'),_0x456f8a[_0x35a4('0x7')],_0x456f8a[_0x35a4('0x4b')]));channels[_0x456f8a[_0x35a4('0x7')]][_0x35a4('0x5d')]=_0x456f8a[_0x35a4('0x4b')];}}}catch(_0x6f6af0){utils[_0x35a4('0x21')](util[_0x35a4('0x16')](_0x35a4('0x46'),_0x456f8a[_0x35a4('0x7')]),_0x6f6af0);}};exports[_0x35a4('0x5f')]=function(_0x103571){try{if(!_['isNil'](channels[_0x103571[_0x35a4('0x7')]])){utils['debug'](util[_0x35a4('0x16')](_0x35a4('0x60'),_0x103571[_0x35a4('0x7')]),_0x103571);utils['info'](util[_0x35a4('0x16')](_0x35a4('0x61'),_0x103571['uniqueid'],_0x103571[_0x35a4('0x62')],_0x103571[_0x35a4('0x63')]));if(_0x103571['application']['toLowerCase']()==_0x35a4('0x64')&&_[_0x35a4('0x65')](_0x103571[_0x35a4('0x63')][_0x35a4('0x66')](),_0x35a4('0x67'))){var _0x2864f5=_0x103571[_0x35a4('0x63')][_0x35a4('0x68')]('=');var _0x7a5d42=_0x2864f5[0x0][_0x35a4('0x69')](_0x2864f5[0x0][_0x35a4('0x6a')]('(')+0x1,_0x2864f5[0x0]['lastIndexOf'](')'));var _0x681b87=_0x2864f5[0x1];channels[_0x103571[_0x35a4('0x7')]][_0x7a5d42]=_0x681b87;}if(!_[_0x35a4('0x6b')]([_0x35a4('0x6c'),_0x35a4('0x6d'),_0x35a4('0x6e'),'set',_0x35a4('0x6f')],_0x103571['application'][_0x35a4('0x66')]())){channels[_0x103571[_0x35a4('0x7')]][_0x35a4('0x55')]=_0x103571[_0x35a4('0x62')];channels[_0x103571[_0x35a4('0x7')]][_0x35a4('0x70')]=_0x103571['appdata'];}}}catch(_0x5a8084){utils[_0x35a4('0x21')](util[_0x35a4('0x16')](_0x35a4('0x60'),_0x103571[_0x35a4('0x7')]),_0x5a8084);}}; \ No newline at end of file +var _0xb53e=['[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','debug','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','diffTime','attendedtransfer','localtwolinkedid'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xb53e,0xa9));var _0xeb53=function(_0x40d3aa,_0x477d2d){_0x40d3aa=_0x40d3aa-0x0;var _0x4f526a=_0xb53e[_0x40d3aa];return _0x4f526a;};'use strict';var _=require(_0xeb53('0x0'));var util=require(_0xeb53('0x1'));var utils=require('./utils');var transfers=require(_0xeb53('0x2'));var dispositions=[_0xeb53('0x3'),'FAILED',_0xeb53('0x4'),_0xeb53('0x3'),'NO\x20ANSWER',_0xeb53('0x3'),_0xeb53('0x5'),'BUSY','FAILED',_0xeb53('0x4'),_0xeb53('0x4')];var channels={};function writeDB(_0x39e1a8){var _0x5741a1;if(transfers[_0xeb53('0x6')][_0x39e1a8['uniqueid']]){_0x5741a1=_0x39e1a8['uniqueid'];_0x39e1a8[_0xeb53('0x7')]=transfers[_0xeb53('0x6')][_0x39e1a8[_0xeb53('0x7')]][_0xeb53('0x8')];}utils['info'](util[_0xeb53('0x9')](_0xeb53('0xa'),_0x39e1a8[_0xeb53('0x7')],_0x39e1a8[_0xeb53('0xb')],_0x39e1a8[_0xeb53('0xc')],_0x39e1a8[_0xeb53('0xd')],_0x39e1a8[_0xeb53('0xe')],_0x39e1a8['calleridnum'],_0x39e1a8[_0xeb53('0xf')],_0x39e1a8[_0xeb53('0x10')]));if(_0x39e1a8[_0xeb53('0x11')]){utils['getUserByInternal'](_0x39e1a8['accountcode'])[_0xeb53('0x12')](function(_0x1e2530){if(_0x1e2530){_0x39e1a8[_0xeb53('0x13')]=_0x1e2530['id'];}utils[_0xeb53('0x14')](_0xeb53('0x15'),_0x39e1a8);});}else{utils['request'](_0xeb53('0x15'),_0x39e1a8);}if(channels[_0x39e1a8[_0xeb53('0x7')]]){delete channels[_0x39e1a8[_0xeb53('0x7')]];}else if(_0x5741a1&&channels[_0x5741a1]){if(!transfers[_0xeb53('0x6')][_0x5741a1][_0xeb53('0x16')])delete transfers[_0xeb53('0x6')][_0x5741a1];delete channels[_0x5741a1];}}exports['newchannel']=function(_0x405995){try{utils['debug'](util[_0xeb53('0x9')](_0xeb53('0x17'),_0x405995[_0xeb53('0x7')]),_0x405995);if(_0x405995[_0xeb53('0x7')]==_0x405995['linkedid']&&_0x405995[_0xeb53('0xb')]!=_0xeb53('0x18')){utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x1a'),_0x405995[_0xeb53('0x7')],_0x405995[_0xeb53('0x1b')],_0x405995[_0xeb53('0x1c')]));channels[_0x405995[_0xeb53('0x7')]]={'uniqueid':_0x405995['uniqueid'],'accountcode':_0x405995[_0xeb53('0x11')],'source':_0x405995[_0xeb53('0x1d')],'destination':_0x405995[_0xeb53('0x1c')],'destinationcontext':_0x405995[_0xeb53('0x1b')],'channel':_0x405995['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xeb53('0x3'),'amaflags':_0xeb53('0x1e')};}}catch(_0x303973){utils[_0xeb53('0x1f')](util[_0xeb53('0x9')](_0xeb53('0x17'),_0x405995[_0xeb53('0x7')]),_0x303973);}};exports[_0xeb53('0x20')]=function(_0x42f26e){try{utils['debug'](util[_0xeb53('0x9')](_0xeb53('0x21'),_0x42f26e['uniqueid']),_0x42f26e);if(!_[_0xeb53('0x22')](channels[_0x42f26e[_0xeb53('0x7')]])&&_0x42f26e[_0xeb53('0x23')]==0x6){utils[_0xeb53('0x19')](util['format'](_0xeb53('0x24'),_0x42f26e[_0xeb53('0x7')],_0x42f26e[_0xeb53('0x1b')],_0x42f26e[_0xeb53('0xb')]));if(_[_0xeb53('0x22')](channels[_0x42f26e[_0xeb53('0x7')]][_0xeb53('0x25')])){channels[_0x42f26e[_0xeb53('0x7')]][_0xeb53('0x25')]=utils[_0xeb53('0x26')]();}}else if(!_['isNil'](channels[_0x42f26e[_0xeb53('0x27')]])&&_0x42f26e[_0xeb53('0x23')]==0x6&&_0x42f26e[_0xeb53('0x1b')]!=_0xeb53('0x28')){utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x29'),_0x42f26e[_0xeb53('0x7')],_0x42f26e[_0xeb53('0x27')],_0x42f26e[_0xeb53('0x1b')],_0x42f26e['channel']));channels[_0x42f26e[_0xeb53('0x27')]][_0xeb53('0x11')]=_0x42f26e['accountcode'];channels[_0x42f26e[_0xeb53('0x27')]]['destinationchannel']=_0x42f26e[_0xeb53('0xb')];if(_[_0xeb53('0x22')](channels[_0x42f26e[_0xeb53('0x27')]][_0xeb53('0x2a')])){channels[_0x42f26e[_0xeb53('0x27')]][_0xeb53('0x2a')]=utils[_0xeb53('0x26')]();}channels[_0x42f26e[_0xeb53('0x27')]][_0xeb53('0x2b')]=dispositions[_[_0xeb53('0x2c')](_0x42f26e['channelstate'])]||_0xeb53('0x5');}}catch(_0x29246f){utils[_0xeb53('0x1f')](util[_0xeb53('0x9')](_0xeb53('0x21'),_0x42f26e[_0xeb53('0x7')]),_0x29246f);}};exports[_0xeb53('0x2d')]=function(_0xe6b303){try{if(!_[_0xeb53('0x22')](channels[_0xe6b303[_0xeb53('0x7')]])){utils[_0xeb53('0x2e')](util[_0xeb53('0x9')](_0xeb53('0x2f'),_0xe6b303['uniqueid']),_0xe6b303);if(_['isNil'](channels[_0xe6b303['uniqueid']]['callerid'])){channels[_0xe6b303['uniqueid']][_0xeb53('0x30')]=_0xe6b303['calleridname']+'\x20<'+_0xe6b303[_0xeb53('0x1d')]+'>';}utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x31'),_0xe6b303[_0xeb53('0x7')],channels[_0xe6b303['uniqueid']][_0xeb53('0x30')],_0xe6b303[_0xeb53('0x32')]));channels[_0xe6b303[_0xeb53('0x7')]][_0xeb53('0x33')]=utils['now']();channels[_0xe6b303[_0xeb53('0x7')]][_0xeb53('0x34')]=utils['diffTime'](channels[_0xe6b303[_0xeb53('0x7')]]['endtime'],channels[_0xe6b303['uniqueid']][_0xeb53('0x35')]);channels[_0xe6b303['uniqueid']]['billableseconds']=channels[_0xe6b303[_0xeb53('0x7')]][_0xeb53('0x2a')]?utils[_0xeb53('0x36')](channels[_0xe6b303['uniqueid']][_0xeb53('0x33')],channels[_0xe6b303[_0xeb53('0x7')]][_0xeb53('0x2a')]):0x0;writeDB(channels[_0xe6b303['uniqueid']]);}}catch(_0x2713e9){utils['error'](util[_0xeb53('0x9')]('[%s][calls][hangup]',_0xe6b303['uniqueid']),_0x2713e9);}};exports[_0xeb53('0x37')]=function(_0x36d613){try{if(!_[_0xeb53('0x22')](channels[_0x36d613[_0xeb53('0x38')]])){utils[_0xeb53('0x2e')](util[_0xeb53('0x9')](_0xeb53('0x39'),_0x36d613[_0xeb53('0x3a')]),_0x36d613);if(channels[_0x36d613[_0xeb53('0x38')]]['channel']==_0x36d613[_0xeb53('0x3b')]){utils['info'](util[_0xeb53('0x9')](_0xeb53('0x3c'),_0x36d613['origtransfereruniqueid'],_0x36d613[_0xeb53('0x38')],_0x36d613[_0xeb53('0x3d')]));channels[_0x36d613[_0xeb53('0x38')]][_0xeb53('0x3e')]=_0x36d613['secondtransfererchannel'];channels[_0x36d613[_0xeb53('0x38')]]['userfield']=_0xeb53('0x3f');}else if(channels[_0x36d613[_0xeb53('0x38')]][_0xeb53('0xb')]=_0x36d613[_0xeb53('0x40')]){utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x3c'),_0x36d613[_0xeb53('0x3a')],_0x36d613['localtwolinkedid'],_0x36d613[_0xeb53('0x41')]));channels[_0x36d613[_0xeb53('0x38')]][_0xeb53('0x3e')]=_0x36d613['origtransfererchannel'];channels[_0x36d613['localtwolinkedid']]['userfield']=_0xeb53('0x3f');}}}catch(_0x48ca98){utils[_0xeb53('0x1f')](util[_0xeb53('0x9')](_0xeb53('0x39'),_0x36d613['origtransfereruniqueid']),_0x48ca98);}};exports[_0xeb53('0x42')]=function(_0x26c314){try{if(!_[_0xeb53('0x22')](channels[_0x26c314[_0xeb53('0x7')]])){utils[_0xeb53('0x2e')](util[_0xeb53('0x9')](_0xeb53('0x43'),_0x26c314[_0xeb53('0x7')]),_0x26c314);channels[_0x26c314[_0xeb53('0x7')]][_0xeb53('0x44')]=utils['now']();utils[_0xeb53('0x19')](util['format'](_0xeb53('0x45'),_0x26c314['uniqueid'],channels[_0x26c314[_0xeb53('0x7')]]['musiconholdstartAt']));}}catch(_0x57b209){utils['error'](util[_0xeb53('0x9')](_0xeb53('0x43'),_0x26c314[_0xeb53('0x7')]),_0x57b209);}};exports[_0xeb53('0x46')]=function(_0x55977b){try{if(!_[_0xeb53('0x22')](channels[_0x55977b[_0xeb53('0x7')]])){utils[_0xeb53('0x2e')](util[_0xeb53('0x9')](_0xeb53('0x47'),_0x55977b[_0xeb53('0x7')]),_0x55977b);if(!_[_0xeb53('0x22')](channels[_0x55977b[_0xeb53('0x7')]]['musiconholdstartAt'])){channels[_0x55977b['uniqueid']][_0xeb53('0x48')]+=utils['diffTime'](utils[_0xeb53('0x26')](),channels[_0x55977b[_0xeb53('0x7')]]['musiconholdstartAt']);utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x49'),_0x55977b[_0xeb53('0x7')],channels[_0x55977b[_0xeb53('0x7')]][_0xeb53('0x48')]));delete channels[_0x55977b[_0xeb53('0x7')]][_0xeb53('0x44')];}}}catch(_0x1cd412){utils[_0xeb53('0x1f')](util[_0xeb53('0x9')](_0xeb53('0x47'),_0x55977b[_0xeb53('0x7')]),_0x1cd412);}};exports['varset']=function(_0x4db0a7){try{if(!_[_0xeb53('0x22')](channels[_0x4db0a7[_0xeb53('0x7')]])){utils[_0xeb53('0x2e')](util[_0xeb53('0x9')]('[%s][calls][varset]',_0x4db0a7[_0xeb53('0x7')]),_0x4db0a7);if(!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x4b')])){utils['info'](util['format'](_0xeb53('0x4c'),_0x4db0a7[_0xeb53('0x7')],_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x4e')]=_0x4db0a7[_0xeb53('0x4d')];}if(!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x4f')])){utils['info'](util[_0xeb53('0x9')](_0xeb53('0x50'),_0x4db0a7[_0xeb53('0x7')],_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7['uniqueid']][_0xeb53('0x51')]=_0x4db0a7[_0xeb53('0x4d')];channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x30')]='\x22'+_0x4db0a7['value']+_0xeb53('0x52')+_0x4db0a7[_0xeb53('0x4d')]+'>';}if(!_[_0xeb53('0x22')](_0x4db0a7['variable'][_0xeb53('0x53')])||!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x54')])){utils['info'](util['format'](_0xeb53('0x55'),_0x4db0a7[_0xeb53('0x7')],!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x53')])?_0xeb53('0x53'):_0xeb53('0x54'),_0x4db0a7['value']));channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x30')]=_0x4db0a7[_0xeb53('0x4d')];}if(!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')]['xmd-queue'])||!_['isNil'](_0x4db0a7['variable'][_0xeb53('0x56')])){utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x55'),_0x4db0a7['uniqueid'],!_['isNil'](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x57')])?_0xeb53('0x57'):_0xeb53('0x56'),_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7['uniqueid']][_0xeb53('0x58')]=_0xeb53('0x59');channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x5a')]=_0x4db0a7['value'];channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0xc')]=!![];}if(!_['isNil'](_0x4db0a7['variable'][_0xeb53('0x5b')])){utils[_0xeb53('0x19')](util[_0xeb53('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4db0a7[_0xeb53('0x7')],_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7[_0xeb53('0x7')]]['ContactId']=_0x4db0a7[_0xeb53('0x4d')];}if(!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x5c')])){utils['info'](util[_0xeb53('0x9')](_0xeb53('0x5d'),_0x4db0a7[_0xeb53('0x7')],_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x5e')]=_0x4db0a7[_0xeb53('0x4d')];}if(!_[_0xeb53('0x22')](_0x4db0a7[_0xeb53('0x4a')]['outboundrouteid'])){utils['info'](util['format'](_0xeb53('0x5f'),_0x4db0a7[_0xeb53('0x7')],_0x4db0a7[_0xeb53('0x4d')]));channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x60')]=_0x4db0a7['value'];}if(!_['isNil'](_0x4db0a7[_0xeb53('0x4a')][_0xeb53('0x61')])){utils[_0xeb53('0x19')](util[_0xeb53('0x9')](_0xeb53('0x62'),_0x4db0a7[_0xeb53('0x7')],_0x4db0a7['value']));channels[_0x4db0a7[_0xeb53('0x7')]][_0xeb53('0x61')]=_0x4db0a7[_0xeb53('0x4d')];}}}catch(_0x4e4402){utils[_0xeb53('0x1f')](util['format'](_0xeb53('0x63'),_0x4db0a7['uniqueid']),_0x4e4402);}};exports['newexten']=function(_0x2ec9d7){try{if(!_[_0xeb53('0x22')](channels[_0x2ec9d7['uniqueid']])){utils['debug'](util['format']('[%s][calls][newexten]',_0x2ec9d7['uniqueid']),_0x2ec9d7);utils[_0xeb53('0x19')](util[_0xeb53('0x9')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2ec9d7[_0xeb53('0x7')],_0x2ec9d7[_0xeb53('0x64')],_0x2ec9d7['appdata']));if(_0x2ec9d7[_0xeb53('0x64')][_0xeb53('0x65')]()==_0xeb53('0x66')&&_[_0xeb53('0x67')](_0x2ec9d7[_0xeb53('0x68')][_0xeb53('0x65')](),'cdr')){var _0xe7bdf7=_0x2ec9d7[_0xeb53('0x68')][_0xeb53('0x69')]('=');var _0x1718d3=_0xe7bdf7[0x0][_0xeb53('0x6a')](_0xe7bdf7[0x0][_0xeb53('0x6b')]('(')+0x1,_0xe7bdf7[0x0]['lastIndexOf'](')'));var _0x1791e4=_0xe7bdf7[0x1];channels[_0x2ec9d7[_0xeb53('0x7')]][_0x1718d3]=_0x1791e4;}if(!_[_0xeb53('0x6c')]([_0xeb53('0x2d'),_0xeb53('0x6d'),_0xeb53('0x6e'),'set',_0xeb53('0x6f')],_0x2ec9d7[_0xeb53('0x64')][_0xeb53('0x65')]())){channels[_0x2ec9d7['uniqueid']][_0xeb53('0x58')]=_0x2ec9d7['application'];channels[_0x2ec9d7['uniqueid']][_0xeb53('0x5a')]=_0x2ec9d7[_0xeb53('0x68')];}}}catch(_0x34ea4d){utils['error'](util[_0xeb53('0x9')](_0xeb53('0x70'),_0x2ec9d7[_0xeb53('0x7')]),_0x34ea4d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 7da95f8..f42f808 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 _0x5315=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x516044,_0x3677f7){var _0x31684b=function(_0x80be21){while(--_0x80be21){_0x516044['push'](_0x516044['shift']());}};_0x31684b(++_0x3677f7);}(_0x5315,0x1a5));var _0x5531=function(_0x186e07,_0x47fe3b){_0x186e07=_0x186e07-0x0;var _0x25167d=_0x5315[_0x186e07];return _0x25167d;};'use strict';var utils=require(_0x5531('0x0'));exports[_0x5531('0x1')]=function(){utils[_0x5531('0x2')](_0x5531('0x3'));};exports[_0x5531('0x4')]=function(){utils[_0x5531('0x2')]('[core]\x20shutdown');};exports[_0x5531('0x5')]=function(){utils[_0x5531('0x2')](_0x5531('0x6'));};exports[_0x5531('0x7')]=function(_0x139a3f){utils[_0x5531('0x7')](_0x5531('0x8'),_0x139a3f);};exports[_0x5531('0x9')]=function(){utils[_0x5531('0x2')](_0x5531('0xa'));};exports[_0x5531('0xb')]=function(_0x1eec92){}; \ No newline at end of file +var _0x2842=['managerevent','connect','info','[core]\x20connected','shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2842,0x1ba));var _0x2284=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2842[_0xbca1b1];return _0x4e1686;};'use strict';var utils=require('./utils');exports[_0x2284('0x0')]=function(){utils[_0x2284('0x1')](_0x2284('0x2'));};exports[_0x2284('0x3')]=function(){utils[_0x2284('0x1')]('[core]\x20shutdown');};exports[_0x2284('0x4')]=function(){utils[_0x2284('0x1')]('[core]\x20fullybooted');};exports[_0x2284('0x5')]=function(_0x2160b3){utils[_0x2284('0x5')](_0x2284('0x6'),_0x2160b3);};exports[_0x2284('0x7')]=function(){utils[_0x2284('0x1')]('[core]\x20close');};exports[_0x2284('0x8')]=function(_0x4eac24){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 307f971..e795848 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 _0x247e=['endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','debug','variable','outboundrouteid','value','isNil','[%s][dials][dialbegin]','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime'];(function(_0x4f08b6,_0x9317fe){var _0x5a3879=function(_0x4b6cf8){while(--_0x4b6cf8){_0x4f08b6['push'](_0x4f08b6['shift']());}};_0x5a3879(++_0x9317fe);}(_0x247e,0x6d));var _0xe247=function(_0x9290e5,_0x294298){_0x9290e5=_0x9290e5-0x0;var _0x125c7d=_0x247e[_0x9290e5];return _0x125c7d;};'use strict';var _=require(_0xe247('0x0'));var util=require(_0xe247('0x1'));var utils=require(_0xe247('0x2'));var dials={};function writeDB(_0x47f714){utils[_0xe247('0x3')](util[_0xe247('0x4')](_0xe247('0x5'),_0x47f714[_0xe247('0x6')],_0x47f714[_0xe247('0x7')],_0x47f714[_0xe247('0x8')],_0x47f714[_0xe247('0x9')],_0x47f714[_0xe247('0xa')],_0x47f714['dialstatus']));utils[_0xe247('0xb')](_0xe247('0xc'),_0x47f714);delete dials[_0x47f714['uniqueid']];}exports['newexten']=function(_0x26661f){try{utils['debug'](util['format'](_0xe247('0xd'),_0x26661f[_0xe247('0x6')]),_0x26661f);utils[_0xe247('0x3')](util[_0xe247('0x4')](_0xe247('0xe'),_0x26661f[_0xe247('0x6')],_0x26661f[_0xe247('0xf')],_0x26661f[_0xe247('0x10')]));if(_0x26661f[_0xe247('0xf')][_0xe247('0x11')]()==_0xe247('0x12')&&_[_0xe247('0x13')](_0x26661f[_0xe247('0x10')][_0xe247('0x11')](),_0xe247('0x14'))){var _0x487e69=_0x26661f['appdata'][_0xe247('0x15')]('=');dials[_0x26661f[_0xe247('0x6')]]={'routeId':_0x487e69[0x1]};}}catch(_0x2a270b){utils[_0xe247('0x16')](util[_0xe247('0x4')](_0xe247('0xd'),_0x26661f['uniqueid']),_0x2a270b);}};exports[_0xe247('0x17')]=function(_0x7d3452){try{utils[_0xe247('0x18')](util[_0xe247('0x4')]('[%s][dials][varset]',_0x7d3452[_0xe247('0x6')]),_0x7d3452);if(!_['isNil'](_0x7d3452[_0xe247('0x19')][_0xe247('0x1a')])){utils[_0xe247('0x3')](util[_0xe247('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x7d3452[_0xe247('0x6')],_0x7d3452['value']));dials[_0x7d3452[_0xe247('0x6')]]={'routeId':_0x7d3452[_0xe247('0x1b')]};}}catch(_0x2648d6){utils[_0xe247('0x16')](util[_0xe247('0x4')]('[%s][dials][varset]',_0x7d3452[_0xe247('0x6')]),_0x2648d6);}};exports['dialbegin']=function(_0x46752d){try{if(!_[_0xe247('0x1c')](dials[_0x46752d[_0xe247('0x6')]])){utils[_0xe247('0x18')](util[_0xe247('0x4')](_0xe247('0x1d'),_0x46752d['uniqueid']),_0x46752d);dials[_0x46752d[_0xe247('0x6')]]=_['assign'](dials[_0x46752d[_0xe247('0x6')]],_0x46752d);dials[_0x46752d[_0xe247('0x6')]][_0xe247('0x1e')]=utils[_0xe247('0x1f')]();dials[_0x46752d['uniqueid']]['lastevent']=_0xe247('0x20');utils[_0xe247('0x3')](util[_0xe247('0x4')](_0xe247('0x21'),_0x46752d[_0xe247('0x6')],dials[_0x46752d[_0xe247('0x6')]]['starttime']));}}catch(_0x50f08f){utils[_0xe247('0x16')](util[_0xe247('0x4')]('[%s][dials][dialbegin]',_0x46752d[_0xe247('0x6')]),_0x50f08f);}};exports[_0xe247('0x22')]=function(_0x343e6c){try{if(!_[_0xe247('0x1c')](dials[_0x343e6c[_0xe247('0x6')]])){utils[_0xe247('0x18')](util['format'](_0xe247('0x23'),_0x343e6c['uniqueid']),_0x343e6c);dials[_0x343e6c[_0xe247('0x6')]][_0xe247('0x24')]=_0x343e6c['dialstatus'];if(_0x343e6c[_0xe247('0x24')]==_0xe247('0x25')){dials[_0x343e6c['uniqueid']]=_[_0xe247('0x26')](dials[_0x343e6c['uniqueid']],_0x343e6c);dials[_0x343e6c[_0xe247('0x6')]][_0xe247('0x27')]=utils[_0xe247('0x1f')]();dials[_0x343e6c['uniqueid']]['lastevent']=_0xe247('0x28');utils['info'](util[_0xe247('0x4')](_0xe247('0x29'),_0x343e6c[_0xe247('0x6')],_0x343e6c[_0xe247('0x24')],dials[_0x343e6c[_0xe247('0x6')]][_0xe247('0x27')]));}else{utils[_0xe247('0x3')](util[_0xe247('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x343e6c[_0xe247('0x6')],_0x343e6c['dialstatus']));}}}catch(_0x456fb5){utils[_0xe247('0x16')](util[_0xe247('0x4')](_0xe247('0x23'),_0x343e6c[_0xe247('0x6')]),_0x456fb5);}};exports[_0xe247('0x2a')]=function(_0x3e2025){try{if(!_[_0xe247('0x1c')](dials[_0x3e2025[_0xe247('0x6')]])){utils[_0xe247('0x18')](util['format'](_0xe247('0x2b'),_0x3e2025[_0xe247('0x6')]),_0x3e2025);utils[_0xe247('0x3')](util[_0xe247('0x4')](_0xe247('0x2c'),_0x3e2025[_0xe247('0x6')],_0x3e2025[_0xe247('0x9')],_0x3e2025[_0xe247('0x2d')],_0x3e2025[_0xe247('0x2e')]));dials[_0x3e2025['uniqueid']]=_[_0xe247('0x26')](dials[_0x3e2025[_0xe247('0x6')]],{'endtime':utils[_0xe247('0x1f')](),'lastevent':_0xe247('0x2f')});dials[_0x3e2025['uniqueid']][_0xe247('0x30')]=utils[_0xe247('0x31')](dials[_0x3e2025[_0xe247('0x6')]][_0xe247('0x32')],dials[_0x3e2025[_0xe247('0x6')]][_0xe247('0x1e')]);dials[_0x3e2025[_0xe247('0x6')]][_0xe247('0x33')]=utils[_0xe247('0x31')](dials[_0x3e2025[_0xe247('0x6')]]['answertime']||dials[_0x3e2025['uniqueid']][_0xe247('0x32')],dials[_0x3e2025[_0xe247('0x6')]][_0xe247('0x1e')]);dials[_0x3e2025[_0xe247('0x6')]][_0xe247('0x34')]=dials[_0x3e2025[_0xe247('0x6')]]['answertime']?utils['diffTime'](dials[_0x3e2025[_0xe247('0x6')]]['endtime'],dials[_0x3e2025[_0xe247('0x6')]]['answertime']):0x0;writeDB(dials[_0x3e2025[_0xe247('0x6')]]);}}catch(_0x2174fc){utils[_0xe247('0x16')](util[_0xe247('0x4')](_0xe247('0x2b'),_0x3e2025[_0xe247('0x6')]),_0x2174fc);}}; \ No newline at end of file +var _0x88db=['value','error','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','outboundrouteid'];(function(_0x48a24a,_0x3cb63c){var _0x5e35d8=function(_0x406d56){while(--_0x406d56){_0x48a24a['push'](_0x48a24a['shift']());}};_0x5e35d8(++_0x3cb63c);}(_0x88db,0x194));var _0xb88d=function(_0xe8391e,_0x40598e){_0xe8391e=_0xe8391e-0x0;var _0x445201=_0x88db[_0xe8391e];return _0x445201;};'use strict';var _=require('lodash');var util=require(_0xb88d('0x0'));var utils=require(_0xb88d('0x1'));var dials={};function writeDB(_0x3026da){utils[_0xb88d('0x2')](util['format'](_0xb88d('0x3'),_0x3026da[_0xb88d('0x4')],_0x3026da[_0xb88d('0x5')],_0x3026da[_0xb88d('0x6')],_0x3026da[_0xb88d('0x7')],_0x3026da[_0xb88d('0x8')],_0x3026da[_0xb88d('0x9')]));utils[_0xb88d('0xa')](_0xb88d('0xb'),_0x3026da);delete dials[_0x3026da[_0xb88d('0x4')]];}exports[_0xb88d('0xc')]=function(_0x4990ed){try{utils['debug'](util[_0xb88d('0xd')](_0xb88d('0xe'),_0x4990ed['uniqueid']),_0x4990ed);utils[_0xb88d('0x2')](util[_0xb88d('0xd')](_0xb88d('0xf'),_0x4990ed[_0xb88d('0x4')],_0x4990ed['application'],_0x4990ed[_0xb88d('0x10')]));if(_0x4990ed[_0xb88d('0x11')]['toLowerCase']()==_0xb88d('0x12')&&_[_0xb88d('0x13')](_0x4990ed[_0xb88d('0x10')][_0xb88d('0x14')](),_0xb88d('0x15'))){var _0x36a02e=_0x4990ed[_0xb88d('0x10')][_0xb88d('0x16')]('=');dials[_0x4990ed['uniqueid']]={'routeId':_0x36a02e[0x1]};}}catch(_0x29b789){utils['error'](util[_0xb88d('0xd')](_0xb88d('0xe'),_0x4990ed[_0xb88d('0x4')]),_0x29b789);}};exports[_0xb88d('0x17')]=function(_0x8f3c3e){try{utils[_0xb88d('0x18')](util['format'](_0xb88d('0x19'),_0x8f3c3e[_0xb88d('0x4')]),_0x8f3c3e);if(!_[_0xb88d('0x1a')](_0x8f3c3e['variable'][_0xb88d('0x1b')])){utils['info'](util[_0xb88d('0xd')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x8f3c3e[_0xb88d('0x4')],_0x8f3c3e[_0xb88d('0x1c')]));dials[_0x8f3c3e[_0xb88d('0x4')]]={'routeId':_0x8f3c3e[_0xb88d('0x1c')]};}}catch(_0x4f2a73){utils[_0xb88d('0x1d')](util[_0xb88d('0xd')](_0xb88d('0x19'),_0x8f3c3e[_0xb88d('0x4')]),_0x4f2a73);}};exports[_0xb88d('0x1e')]=function(_0x3baa19){try{if(!_['isNil'](dials[_0x3baa19['uniqueid']])){utils[_0xb88d('0x18')](util[_0xb88d('0xd')](_0xb88d('0x1f'),_0x3baa19[_0xb88d('0x4')]),_0x3baa19);dials[_0x3baa19['uniqueid']]=_[_0xb88d('0x20')](dials[_0x3baa19['uniqueid']],_0x3baa19);dials[_0x3baa19[_0xb88d('0x4')]]['starttime']=utils[_0xb88d('0x21')]();dials[_0x3baa19['uniqueid']][_0xb88d('0x22')]=_0xb88d('0x23');utils[_0xb88d('0x2')](util[_0xb88d('0xd')](_0xb88d('0x24'),_0x3baa19[_0xb88d('0x4')],dials[_0x3baa19[_0xb88d('0x4')]][_0xb88d('0x25')]));}}catch(_0x3c4296){utils[_0xb88d('0x1d')](util['format']('[%s][dials][dialbegin]',_0x3baa19[_0xb88d('0x4')]),_0x3c4296);}};exports[_0xb88d('0x26')]=function(_0x2f5fed){try{if(!_[_0xb88d('0x1a')](dials[_0x2f5fed[_0xb88d('0x4')]])){utils[_0xb88d('0x18')](util['format'](_0xb88d('0x27'),_0x2f5fed[_0xb88d('0x4')]),_0x2f5fed);dials[_0x2f5fed['uniqueid']][_0xb88d('0x9')]=_0x2f5fed[_0xb88d('0x9')];if(_0x2f5fed[_0xb88d('0x9')]==_0xb88d('0x28')){dials[_0x2f5fed[_0xb88d('0x4')]]=_['assign'](dials[_0x2f5fed[_0xb88d('0x4')]],_0x2f5fed);dials[_0x2f5fed[_0xb88d('0x4')]][_0xb88d('0x29')]=utils[_0xb88d('0x21')]();dials[_0x2f5fed[_0xb88d('0x4')]][_0xb88d('0x22')]=_0xb88d('0x2a');utils['info'](util[_0xb88d('0xd')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x2f5fed[_0xb88d('0x4')],_0x2f5fed['dialstatus'],dials[_0x2f5fed[_0xb88d('0x4')]][_0xb88d('0x29')]));}else{utils[_0xb88d('0x2')](util[_0xb88d('0xd')](_0xb88d('0x2b'),_0x2f5fed[_0xb88d('0x4')],_0x2f5fed[_0xb88d('0x9')]));}}}catch(_0x9bec95){utils[_0xb88d('0x1d')](util[_0xb88d('0xd')](_0xb88d('0x27'),_0x2f5fed[_0xb88d('0x4')]),_0x9bec95);}};exports[_0xb88d('0x2c')]=function(_0x5ce76e){try{if(!_[_0xb88d('0x1a')](dials[_0x5ce76e['uniqueid']])){utils[_0xb88d('0x18')](util[_0xb88d('0xd')](_0xb88d('0x2d'),_0x5ce76e['uniqueid']),_0x5ce76e);utils[_0xb88d('0x2')](util[_0xb88d('0xd')](_0xb88d('0x2e'),_0x5ce76e[_0xb88d('0x4')],_0x5ce76e[_0xb88d('0x7')],_0x5ce76e[_0xb88d('0x2f')],_0x5ce76e['cause-txt']));dials[_0x5ce76e[_0xb88d('0x4')]]=_[_0xb88d('0x20')](dials[_0x5ce76e['uniqueid']],{'endtime':utils[_0xb88d('0x21')](),'lastevent':_0xb88d('0x30')});dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x31')]=utils['diffTime'](dials[_0x5ce76e['uniqueid']][_0xb88d('0x32')],dials[_0x5ce76e[_0xb88d('0x4')]]['starttime']);dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x33')]=utils[_0xb88d('0x34')](dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x29')]||dials[_0x5ce76e['uniqueid']]['endtime'],dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x25')]);dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x35')]=dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x29')]?utils[_0xb88d('0x34')](dials[_0x5ce76e[_0xb88d('0x4')]]['endtime'],dials[_0x5ce76e[_0xb88d('0x4')]][_0xb88d('0x29')]):0x0;writeDB(dials[_0x5ce76e[_0xb88d('0x4')]]);}}catch(_0x42d779){utils[_0xb88d('0x1d')](util[_0xb88d('0xd')](_0xb88d('0x2d'),_0x5ce76e[_0xb88d('0x4')]),_0x42d779);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 217658f..6ebd348 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 _0x5247=['agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialend]','dialend','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','password','XDR\x20DISABLED','info','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0x5247,0x1af));var _0x7524=function(_0x55b87b,_0x2dade6){_0x55b87b=_0x55b87b-0x0;var _0x5691ae=_0x5247[_0x55b87b];return _0x5691ae;};var AsteriskManager=require('asterisk-manager');var config=require(_0x7524('0x0'));var utils=require(_0x7524('0x1'));var util=require(_0x7524('0x2'));var isXDREnabled=config['xdr']&&config[_0x7524('0x3')][_0x7524('0x4')]?!config['xdr'][_0x7524('0x4')]:!![];var isProduction=config[_0x7524('0x5')]===_0x7524('0x6')||![];var isLocalAsterisk=config[_0x7524('0x3')]&&config[_0x7524('0x3')][_0x7524('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x7524('0x8')],config[_0x7524('0x9')]['ip'],config['asterisk']['username'],config[_0x7524('0x9')][_0x7524('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x7524('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x7524('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x7524('0xd'));var queues=require(_0x7524('0xe'));var recordings=require(_0x7524('0xf'));var members=require(_0x7524('0x10'));var dials=require('./dials.controller');var transfers=require(_0x7524('0x11'));var core=require('./core.controller');ami['on'](_0x7524('0x12'),core[_0x7524('0x12')]);ami['on']('shutdown',core[_0x7524('0x13')]);ami['on']('fullybooted',core[_0x7524('0x14')]);ami['on'](_0x7524('0x15'),core['error']);ami['on'](_0x7524('0x16'),core['close']);ami['on'](_0x7524('0x17'),core['managerevent']);ami['on'](_0x7524('0x18'),function(_0x3d3c5d){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')]('[%s][index][devicestatechange]',_0x3d3c5d[_0x7524('0x1b')]),_0x3d3c5d);members[_0x7524('0x18')](_0x3d3c5d);}catch(_0x82f20a){utils['error'](util[_0x7524('0x1a')](_0x7524('0x1c'),_0x3d3c5d[_0x7524('0x1b')]),_0x82f20a);}});ami['on']('agentcalled',function(_0xa661a0){try{utils['debug'](util['format'](_0x7524('0x1d'),_0xa661a0[_0x7524('0x1e')]),_0xa661a0);agents[_0x7524('0x1f')](_0xa661a0);}catch(_0x53ed84){utils[_0x7524('0x15')](util[_0x7524('0x1a')]('[%s][index][agentcalled]',_0xa661a0[_0x7524('0x1e')]),_0x53ed84);}});ami['on']('agentringnoanswer',function(_0x4fe9dc){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x20'),_0x4fe9dc[_0x7524('0x1e')]),_0x4fe9dc);agents[_0x7524('0x21')](_0x4fe9dc);}catch(_0xb39897){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x20'),_0x4fe9dc[_0x7524('0x1e')]),_0xb39897);}});ami['on'](_0x7524('0x22'),function(_0x5b2817){try{utils['debug'](util[_0x7524('0x1a')](_0x7524('0x23'),_0x5b2817['uniqueid']),_0x5b2817);agents[_0x7524('0x22')](_0x5b2817);queues[_0x7524('0x22')](_0x5b2817);}catch(_0x14c6eb){utils['error'](util['format']('[%s][index][agentconnect]',_0x5b2817[_0x7524('0x1e')]),_0x14c6eb);}});ami['on'](_0x7524('0x24'),function(_0x18a69a){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x25'),_0x18a69a[_0x7524('0x1e')]),_0x18a69a);agents['agentcomplete'](_0x18a69a);queues[_0x7524('0x24')](_0x18a69a);members['agentcomplete'](_0x18a69a);}catch(_0x5b767a){utils[_0x7524('0x15')](util['format'](_0x7524('0x25'),_0x18a69a[_0x7524('0x1e')]),_0x5b767a);}});ami['on'](_0x7524('0x26'),function(_0x835e3d){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x27'),_0x835e3d[_0x7524('0x1e')]),_0x835e3d);agents[_0x7524('0x26')](_0x835e3d);queues[_0x7524('0x26')](_0x835e3d);}catch(_0x5e3d0d){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x27'),_0x835e3d[_0x7524('0x1e')]),_0x5e3d0d);}});ami['on'](_0x7524('0x28'),function(_0x5efabc){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x29'),_0x5efabc[_0x7524('0x1e')]),_0x5efabc);queues[_0x7524('0x28')](_0x5efabc);recordings[_0x7524('0x28')](_0x5efabc);}catch(_0x1dbd63){utils[_0x7524('0x15')](util[_0x7524('0x1a')]('[%s][index][queuecallerjoin]',_0x5efabc['uniqueid']),_0x1dbd63);}});ami['on'](_0x7524('0x2a'),function(_0x4f0a96){try{utils['debug'](util[_0x7524('0x1a')](_0x7524('0x2b'),_0x4f0a96[_0x7524('0x1e')]),_0x4f0a96);queues['queuecallerleave'](_0x4f0a96);}catch(_0x2a2016){utils['error'](util[_0x7524('0x1a')](_0x7524('0x2b'),_0x4f0a96[_0x7524('0x1e')]),_0x2a2016);}});ami['on'](_0x7524('0x2c'),function(_0x161192){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x2d'),_0x161192['uniqueid']),_0x161192);queues[_0x7524('0x2c')](_0x161192);calls[_0x7524('0x2c')](_0x161192);}catch(_0x336d65){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x2d'),_0x161192[_0x7524('0x1e')]),_0x336d65);}});ami['on'](_0x7524('0x2e'),function(_0x4b7de0){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')]('[%s][index][musiconholdstop]',_0x4b7de0[_0x7524('0x1e')]),_0x4b7de0);queues[_0x7524('0x2e')](_0x4b7de0);calls[_0x7524('0x2e')](_0x4b7de0);}catch(_0x17fd63){utils['error'](util[_0x7524('0x1a')]('[%s][index][musiconholdstop]',_0x4b7de0[_0x7524('0x1e')]),_0x17fd63);}});ami['on'](_0x7524('0x2f'),function(_0x4adb13){try{utils['debug'](util[_0x7524('0x1a')](_0x7524('0x30'),_0x4adb13['uniqueid']),_0x4adb13);calls[_0x7524('0x2f')](_0x4adb13);recordings['newstate'](_0x4adb13);}catch(_0x44cf9e){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x30'),_0x4adb13[_0x7524('0x1e')]),_0x44cf9e);}});ami['on'](_0x7524('0x31'),function(_0x59d444){try{utils['debug'](util[_0x7524('0x1a')](_0x7524('0x32'),_0x59d444['uniqueid']),_0x59d444);calls[_0x7524('0x31')](_0x59d444);recordings[_0x7524('0x31')](_0x59d444);dials[_0x7524('0x31')](_0x59d444);agents[_0x7524('0x31')](_0x59d444);queues[_0x7524('0x31')](_0x59d444);}catch(_0x3f68d2){utils[_0x7524('0x15')](util[_0x7524('0x1a')]('[%s][index][hangup]',_0x59d444['uniqueid']),_0x3f68d2);}});ami['on']('cdr',function(_0x33bde9){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')]('[%s][index][cdr]',_0x33bde9[_0x7524('0x1e')]),_0x33bde9);members['cdr'](_0x33bde9);}catch(_0x425ea6){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x33'),_0x33bde9[_0x7524('0x1e')]),_0x425ea6);}});ami['on'](_0x7524('0x34'),function(_0xad8db6){try{utils[_0x7524('0x19')](util['format'](_0x7524('0x35'),_0xad8db6['uniqueid']),_0xad8db6);queues[_0x7524('0x34')](_0xad8db6);agents[_0x7524('0x34')](_0xad8db6);transfers['blindtransfer'](_0xad8db6);recordings['blindtransfer'](_0xad8db6);}catch(_0x144311){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x35'),_0xad8db6[_0x7524('0x1e')]),_0x144311);}});ami['on']('attendedtransfer',function(_0x8b0cb1){try{utils[_0x7524('0x19')](util['format'](_0x7524('0x36'),_0x8b0cb1[_0x7524('0x37')]),_0x8b0cb1);queues[_0x7524('0x38')](_0x8b0cb1);transfers[_0x7524('0x38')](_0x8b0cb1);agents[_0x7524('0x38')](_0x8b0cb1);calls[_0x7524('0x38')](_0x8b0cb1);}catch(_0x2cb7bd){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x36'),_0x8b0cb1[_0x7524('0x37')]),_0x2cb7bd);}});ami['on'](_0x7524('0x39'),function(_0x2393e8){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')]('[%s][index][varset]',_0x2393e8[_0x7524('0x1e')]),_0x2393e8);queues[_0x7524('0x39')](_0x2393e8);recordings['varset'](_0x2393e8);calls[_0x7524('0x39')](_0x2393e8);dials[_0x7524('0x39')](_0x2393e8);}catch(_0x520e18){utils[_0x7524('0x15')](util['format'](_0x7524('0x3a'),_0x2393e8[_0x7524('0x1e')]),_0x520e18);}});ami['on'](_0x7524('0x3b'),function(_0x1ac10f){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x3c'),_0x1ac10f[_0x7524('0x1e')]),_0x1ac10f);calls[_0x7524('0x3b')](_0x1ac10f);recordings[_0x7524('0x3b')](_0x1ac10f);dials['newexten'](_0x1ac10f);}catch(_0x341934){utils['error'](util['format'](_0x7524('0x3c'),_0x1ac10f[_0x7524('0x1e')]),_0x341934);}});ami['on'](_0x7524('0x3d'),function(_0x3d04ea){try{utils[_0x7524('0x19')](util[_0x7524('0x1a')](_0x7524('0x3e'),_0x3d04ea[_0x7524('0x1e')]),_0x3d04ea);calls[_0x7524('0x3d')](_0x3d04ea);recordings[_0x7524('0x3d')](_0x3d04ea);}catch(_0x74ad0e){utils[_0x7524('0x15')](util['format'](_0x7524('0x3e'),_0x3d04ea[_0x7524('0x1e')]),_0x74ad0e);}});ami['on'](_0x7524('0x3f'),function(_0x42a03b){try{utils['debug'](util[_0x7524('0x1a')]('[%s][index][dialbegin]',_0x42a03b[_0x7524('0x1e')]),_0x42a03b);dials[_0x7524('0x3f')](_0x42a03b);}catch(_0x23e73b){utils[_0x7524('0x15')](util[_0x7524('0x1a')]('[%s]dialbegin',_0x42a03b['uniqueid']),_0x23e73b);}});ami['on']('dialend',function(_0x3c57eb){try{utils['debug'](util[_0x7524('0x1a')](_0x7524('0x40'),_0x3c57eb[_0x7524('0x1e')]),_0x3c57eb);dials[_0x7524('0x41')](_0x3c57eb);}catch(_0x8a50e8){utils[_0x7524('0x15')](util[_0x7524('0x1a')](_0x7524('0x40'),_0x3c57eb[_0x7524('0x1e')]),_0x8a50e8);}});} \ No newline at end of file +var _0x49ef=['format','device','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug'];(function(_0xa6d2fd,_0x3c9d44){var _0x126310=function(_0x39b7b4){while(--_0x39b7b4){_0xa6d2fd['push'](_0xa6d2fd['shift']());}};_0x126310(++_0x3c9d44);}(_0x49ef,0xf1));var _0xf49e=function(_0x4a0192,_0x23d329){_0x4a0192=_0x4a0192-0x0;var _0x363789=_0x49ef[_0x4a0192];return _0x363789;};var AsteriskManager=require(_0xf49e('0x0'));var config=require(_0xf49e('0x1'));var utils=require('./utils');var util=require(_0xf49e('0x2'));var isXDREnabled=config[_0xf49e('0x3')]&&config[_0xf49e('0x3')][_0xf49e('0x4')]?!config[_0xf49e('0x3')][_0xf49e('0x4')]:!![];var isProduction=config[_0xf49e('0x5')]===_0xf49e('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0xf49e('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xf49e('0x7')]['port'],config[_0xf49e('0x7')]['ip'],config[_0xf49e('0x7')][_0xf49e('0x8')],config[_0xf49e('0x7')][_0xf49e('0x9')],!![]);ami[_0xf49e('0xa')]();if(!isXDREnabled){utils[_0xf49e('0xb')](_0xf49e('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xf49e('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0xf49e('0xe'));var queues=require(_0xf49e('0xf'));var recordings=require(_0xf49e('0x10'));var members=require(_0xf49e('0x11'));var dials=require(_0xf49e('0x12'));var transfers=require('./transfers.controller');var core=require(_0xf49e('0x13'));ami['on'](_0xf49e('0x14'),core[_0xf49e('0x14')]);ami['on'](_0xf49e('0x15'),core[_0xf49e('0x15')]);ami['on'](_0xf49e('0x16'),core[_0xf49e('0x16')]);ami['on']('error',core[_0xf49e('0x17')]);ami['on'](_0xf49e('0x18'),core[_0xf49e('0x18')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0xf49e('0x19'),function(_0x3ff539){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][devicestatechange]',_0x3ff539[_0xf49e('0x1c')]),_0x3ff539);members[_0xf49e('0x19')](_0x3ff539);}catch(_0x2b84ac){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x1d'),_0x3ff539['device']),_0x2b84ac);}});ami['on']('agentcalled',function(_0x687220){try{utils[_0xf49e('0x1a')](util['format'](_0xf49e('0x1e'),_0x687220[_0xf49e('0x1f')]),_0x687220);agents[_0xf49e('0x20')](_0x687220);}catch(_0x332950){utils['error'](util[_0xf49e('0x1b')](_0xf49e('0x1e'),_0x687220[_0xf49e('0x1f')]),_0x332950);}});ami['on'](_0xf49e('0x21'),function(_0x5cdc9e){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][agentringnoanswer]',_0x5cdc9e[_0xf49e('0x1f')]),_0x5cdc9e);agents[_0xf49e('0x21')](_0x5cdc9e);}catch(_0x34fd20){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x22'),_0x5cdc9e[_0xf49e('0x1f')]),_0x34fd20);}});ami['on'](_0xf49e('0x23'),function(_0x4c58be){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')](_0xf49e('0x24'),_0x4c58be['uniqueid']),_0x4c58be);agents[_0xf49e('0x23')](_0x4c58be);queues[_0xf49e('0x23')](_0x4c58be);}catch(_0x30d114){utils['error'](util[_0xf49e('0x1b')](_0xf49e('0x24'),_0x4c58be[_0xf49e('0x1f')]),_0x30d114);}});ami['on']('agentcomplete',function(_0x46a67a){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][agentcomplete]',_0x46a67a[_0xf49e('0x1f')]),_0x46a67a);agents[_0xf49e('0x25')](_0x46a67a);queues[_0xf49e('0x25')](_0x46a67a);members[_0xf49e('0x25')](_0x46a67a);}catch(_0x37be50){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')]('[%s][index][agentcomplete]',_0x46a67a['uniqueid']),_0x37be50);}});ami['on'](_0xf49e('0x26'),function(_0x49945b){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][queuecallerabandon]',_0x49945b[_0xf49e('0x1f')]),_0x49945b);agents['queuecallerabandon'](_0x49945b);queues[_0xf49e('0x26')](_0x49945b);}catch(_0x4d5c82){utils['error'](util[_0xf49e('0x1b')]('[%s][index][queuecallerabandon]',_0x49945b[_0xf49e('0x1f')]),_0x4d5c82);}});ami['on'](_0xf49e('0x27'),function(_0x4069bd){try{utils[_0xf49e('0x1a')](util['format'](_0xf49e('0x28'),_0x4069bd[_0xf49e('0x1f')]),_0x4069bd);queues[_0xf49e('0x27')](_0x4069bd);recordings[_0xf49e('0x27')](_0x4069bd);}catch(_0x187340){utils[_0xf49e('0x17')](util['format'](_0xf49e('0x28'),_0x4069bd['uniqueid']),_0x187340);}});ami['on']('queuecallerleave',function(_0xc03988){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')](_0xf49e('0x29'),_0xc03988[_0xf49e('0x1f')]),_0xc03988);queues[_0xf49e('0x2a')](_0xc03988);}catch(_0x510bbb){utils[_0xf49e('0x17')](util['format'](_0xf49e('0x29'),_0xc03988['uniqueid']),_0x510bbb);}});ami['on'](_0xf49e('0x2b'),function(_0x336dc9){try{utils['debug'](util[_0xf49e('0x1b')](_0xf49e('0x2c'),_0x336dc9['uniqueid']),_0x336dc9);queues[_0xf49e('0x2b')](_0x336dc9);calls[_0xf49e('0x2b')](_0x336dc9);}catch(_0x5391ac){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x2c'),_0x336dc9[_0xf49e('0x1f')]),_0x5391ac);}});ami['on'](_0xf49e('0x2d'),function(_0x120416){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][musiconholdstop]',_0x120416[_0xf49e('0x1f')]),_0x120416);queues[_0xf49e('0x2d')](_0x120416);calls[_0xf49e('0x2d')](_0x120416);}catch(_0x488db6){utils['error'](util['format'](_0xf49e('0x2e'),_0x120416[_0xf49e('0x1f')]),_0x488db6);}});ami['on'](_0xf49e('0x2f'),function(_0x349b4a){try{utils['debug'](util[_0xf49e('0x1b')]('[%s][index][newstate]',_0x349b4a[_0xf49e('0x1f')]),_0x349b4a);calls[_0xf49e('0x2f')](_0x349b4a);recordings['newstate'](_0x349b4a);}catch(_0x5983c3){utils[_0xf49e('0x17')](util['format'](_0xf49e('0x30'),_0x349b4a[_0xf49e('0x1f')]),_0x5983c3);}});ami['on']('hangup',function(_0x2bde24){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][hangup]',_0x2bde24['uniqueid']),_0x2bde24);calls[_0xf49e('0x31')](_0x2bde24);recordings['hangup'](_0x2bde24);dials[_0xf49e('0x31')](_0x2bde24);agents[_0xf49e('0x31')](_0x2bde24);queues['hangup'](_0x2bde24);}catch(_0x4763c){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')]('[%s][index][hangup]',_0x2bde24['uniqueid']),_0x4763c);}});ami['on'](_0xf49e('0x32'),function(_0x3c5520){try{utils['debug'](util[_0xf49e('0x1b')](_0xf49e('0x33'),_0x3c5520[_0xf49e('0x1f')]),_0x3c5520);members[_0xf49e('0x32')](_0x3c5520);}catch(_0xc4dbf7){utils['error'](util[_0xf49e('0x1b')]('[%s][index][cdr]',_0x3c5520['uniqueid']),_0xc4dbf7);}});ami['on'](_0xf49e('0x34'),function(_0x1ead4c){try{utils['debug'](util[_0xf49e('0x1b')](_0xf49e('0x35'),_0x1ead4c[_0xf49e('0x1f')]),_0x1ead4c);queues['blindtransfer'](_0x1ead4c);agents[_0xf49e('0x34')](_0x1ead4c);transfers[_0xf49e('0x34')](_0x1ead4c);recordings[_0xf49e('0x34')](_0x1ead4c);}catch(_0x33d021){utils['error'](util[_0xf49e('0x1b')](_0xf49e('0x35'),_0x1ead4c['uniqueid']),_0x33d021);}});ami['on'](_0xf49e('0x36'),function(_0x1cc950){try{utils[_0xf49e('0x1a')](util['format'](_0xf49e('0x37'),_0x1cc950[_0xf49e('0x38')]),_0x1cc950);queues[_0xf49e('0x36')](_0x1cc950);transfers['attendedtransfer'](_0x1cc950);agents[_0xf49e('0x36')](_0x1cc950);calls['attendedtransfer'](_0x1cc950);}catch(_0x3938ee){utils['error'](util[_0xf49e('0x1b')](_0xf49e('0x37'),_0x1cc950[_0xf49e('0x38')]),_0x3938ee);}});ami['on'](_0xf49e('0x39'),function(_0x4cfff9){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')]('[%s][index][varset]',_0x4cfff9['uniqueid']),_0x4cfff9);queues[_0xf49e('0x39')](_0x4cfff9);recordings[_0xf49e('0x39')](_0x4cfff9);calls['varset'](_0x4cfff9);dials[_0xf49e('0x39')](_0x4cfff9);}catch(_0x209daf){utils[_0xf49e('0x17')](util['format'](_0xf49e('0x3a'),_0x4cfff9[_0xf49e('0x1f')]),_0x209daf);}});ami['on']('newexten',function(_0x3e065a){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')](_0xf49e('0x3b'),_0x3e065a[_0xf49e('0x1f')]),_0x3e065a);calls[_0xf49e('0x3c')](_0x3e065a);recordings['newexten'](_0x3e065a);dials[_0xf49e('0x3c')](_0x3e065a);}catch(_0x4ab2ff){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x3b'),_0x3e065a[_0xf49e('0x1f')]),_0x4ab2ff);}});ami['on'](_0xf49e('0x3d'),function(_0x51b194){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')](_0xf49e('0x3e'),_0x51b194[_0xf49e('0x1f')]),_0x51b194);calls['newchannel'](_0x51b194);recordings['newchannel'](_0x51b194);}catch(_0x31af26){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x3e'),_0x51b194[_0xf49e('0x1f')]),_0x31af26);}});ami['on'](_0xf49e('0x3f'),function(_0x1c1f09){try{utils[_0xf49e('0x1a')](util['format']('[%s][index][dialbegin]',_0x1c1f09[_0xf49e('0x1f')]),_0x1c1f09);dials[_0xf49e('0x3f')](_0x1c1f09);}catch(_0x3f41b7){utils[_0xf49e('0x17')](util[_0xf49e('0x1b')](_0xf49e('0x40'),_0x1c1f09[_0xf49e('0x1f')]),_0x3f41b7);}});ami['on'](_0xf49e('0x41'),function(_0x26aea3){try{utils[_0xf49e('0x1a')](util[_0xf49e('0x1b')](_0xf49e('0x42'),_0x26aea3[_0xf49e('0x1f')]),_0x26aea3);dials['dialend'](_0x26aea3);}catch(_0x2059ed){utils['error'](util[_0xf49e('0x1b')](_0xf49e('0x42'),_0x26aea3[_0xf49e('0x1f')]),_0x2059ed);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6a4b65c..89d2a70 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 _0x0f50=['startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','debug','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','[%s][members][writeDB]','some'];(function(_0x3e956a,_0x24eb4e){var _0x38848b=function(_0x4fac97){while(--_0x4fac97){_0x3e956a['push'](_0x3e956a['shift']());}};_0x38848b(++_0x24eb4e);}(_0x0f50,0x1ce));var _0x00f5=function(_0x19f135,_0x98059c){_0x19f135=_0x19f135-0x0;var _0x942ddf=_0x0f50[_0x19f135];return _0x942ddf;};'use strict';var _=require(_0x00f5('0x0'));var util=require(_0x00f5('0x1'));var utils=require(_0x00f5('0x2'));var members={};var exclude=[_0x00f5('0x3'),_0x00f5('0x4')];function writeDB(_0x436218){utils[_0x00f5('0x5')](util[_0x00f5('0x6')](_0x00f5('0x7'),_0x436218[_0x00f5('0x8')],_0x436218[_0x00f5('0x9')],_0x436218[_0x00f5('0xa')],_0x436218['data2'],_0x436218[_0x00f5('0xb')],_0x436218[_0x00f5('0xc')]));if(_0x436218[_0x00f5('0x9')]){utils[_0x00f5('0xd')](_0x436218['interface'])['then'](function(_0x4a06a3){if(_0x4a06a3){_0x436218['membername']=_0x4a06a3[_0x00f5('0xe')];_0x436218[_0x00f5('0xf')]=_0x4a06a3['internal'];utils[_0x00f5('0x10')](_0x00f5('0x11'),_0x436218);}else{utils[_0x00f5('0x12')](_0x436218[_0x00f5('0x9')][_0x00f5('0x13')]('/')[0x1])[_0x00f5('0x14')](function(_0x3a5c43){if(_0x3a5c43){_0x436218['membername']=_0x3a5c43['name'];_0x436218['internal']=_0x3a5c43['internal'];utils[_0x00f5('0x10')](_0x00f5('0x11'),_0x436218);}});}})[_0x00f5('0x15')](function(_0x27bcd7){utils['error'](util[_0x00f5('0x6')](_0x00f5('0x16'),_0x436218[_0x00f5('0x8')]),_0x27bcd7);});}delete members[_0x436218[_0x00f5('0x9')]];}function startsWith(_0x2a8403,_0x1f4279){return _[_0x00f5('0x17')](_0x2a8403,function(_0x461fc3){return _[_0x00f5('0x18')](_0x1f4279,_0x461fc3);});}exports[_0x00f5('0x19')]=function(_0x284922){try{utils['debug'](util[_0x00f5('0x6')](_0x00f5('0x1a'),members[_0x284922[_0x00f5('0x1b')]]?members[_0x284922[_0x00f5('0x1b')]]['uniqueid']:_0x284922[_0x00f5('0x1b')]),_0x284922);utils[_0x00f5('0x5')](util[_0x00f5('0x6')](_0x00f5('0x1c'),members[_0x284922[_0x00f5('0x1b')]]?members[_0x284922[_0x00f5('0x1b')]]['uniqueid']:_0x284922[_0x00f5('0x1b')],_0x284922[_0x00f5('0x1d')],_0x284922[_0x00f5('0x1b')]));switch(_0x284922['state']){case _0x00f5('0x1e'):case _0x00f5('0x1f'):if(!startsWith(exclude,_0x284922[_0x00f5('0x1b')])){members[_0x284922['device']]={'channel':_0x00f5('0x20'),'interface':_0x284922[_0x00f5('0x1b')],'type':'TALKING','enterAt':utils[_0x00f5('0x21')](),'role':'agent'};}break;case _0x00f5('0x22'):if(!_[_0x00f5('0x23')](members[_0x284922[_0x00f5('0x1b')]])){members[_0x284922['device']]['exitAt']=utils['now']();members[_0x284922[_0x00f5('0x1b')]][_0x00f5('0x24')]=utils[_0x00f5('0x25')](members[_0x284922['device']][_0x00f5('0x26')],members[_0x284922[_0x00f5('0x1b')]][_0x00f5('0x27')]);if(members[_0x284922[_0x00f5('0x1b')]][_0x00f5('0x8')]){writeDB(members[_0x284922[_0x00f5('0x1b')]]);}}break;default:break;}}catch(_0x4025b3){utils[_0x00f5('0x28')](util[_0x00f5('0x6')](_0x00f5('0x1a'),members[_0x284922[_0x00f5('0x1b')]]?members[_0x284922[_0x00f5('0x1b')]][_0x00f5('0x8')]:_0x284922[_0x00f5('0x1b')]),_0x4025b3);}};exports[_0x00f5('0x29')]=function(_0x5ee802){try{if(!_[_0x00f5('0x23')](members[_0x5ee802[_0x00f5('0x9')]])){utils['debug'](util['format'](_0x00f5('0x2a'),_0x5ee802['uniqueid']),_0x5ee802);utils[_0x00f5('0x5')](util[_0x00f5('0x6')](_0x00f5('0x2b'),_0x5ee802[_0x00f5('0x8')],_0x5ee802[_0x00f5('0x9')],_0x5ee802[_0x00f5('0x2c')]));members[_0x5ee802['interface']]=_['assign'](members[_0x5ee802[_0x00f5('0x9')]],{'data4':_0x5ee802[_0x00f5('0x2c')],'uniqueid':_0x5ee802[_0x00f5('0x8')]});}}catch(_0x11129e){utils['error'](util[_0x00f5('0x6')](_0x00f5('0x2a'),_0x5ee802[_0x00f5('0x8')]),_0x11129e);}};exports['cdr']=function(_0x5a7c72){try{utils[_0x00f5('0x2d')](util[_0x00f5('0x6')]('[%s][members][cdr]',_0x5a7c72[_0x00f5('0x8')]),_0x5a7c72);if(_0x5a7c72['channel']){var _0x26b712=_0x5a7c72[_0x00f5('0xa')]['split']('-')[0x0];if(!_[_0x00f5('0x23')](members[_0x26b712])){members[_0x26b712]=_['assign'](members[_0x26b712],{'data1':members[_0x26b712]['data1']||_0x5a7c72['type'],'data2':members[_0x26b712][_0x00f5('0x2e')]||_0x5a7c72[_0x00f5('0x2f')],'data3':members[_0x26b712][_0x00f5('0x30')]||_0x5a7c72[_0x00f5('0x31')],'uniqueid':members[_0x26b712]['uniqueid']||_0x5a7c72['uniqueid']});utils[_0x00f5('0x5')](util[_0x00f5('0x6')](_0x00f5('0x32'),_0x5a7c72[_0x00f5('0x8')],members[_0x26b712][_0x00f5('0x33')],members[_0x26b712]['data2'],members[_0x26b712][_0x00f5('0x30')]));if(members[_0x26b712]['exitAt']){writeDB(members[_0x26b712]);}}}if(_0x5a7c72['destinationchannel']){var _0x4e4eb5=_0x5a7c72[_0x00f5('0x34')][_0x00f5('0x13')]('-')[0x0];if(!_[_0x00f5('0x23')](members[_0x4e4eb5])){members[_0x4e4eb5]=_['assign'](members[_0x4e4eb5],{'data1':members[_0x4e4eb5][_0x00f5('0x33')]||_0x5a7c72['type'],'data2':members[_0x4e4eb5][_0x00f5('0x2e')]||_0x5a7c72[_0x00f5('0x2f')],'data3':members[_0x4e4eb5][_0x00f5('0x30')]||_0x5a7c72[_0x00f5('0x31')],'uniqueid':members[_0x4e4eb5]['uniqueid']||_0x5a7c72[_0x00f5('0x8')]});utils[_0x00f5('0x5')](util[_0x00f5('0x6')](_0x00f5('0x32'),_0x5a7c72[_0x00f5('0x8')],members[_0x4e4eb5][_0x00f5('0x33')],members[_0x4e4eb5][_0x00f5('0x2e')],members[_0x4e4eb5][_0x00f5('0x30')]));if(members[_0x4e4eb5]['exitAt']){writeDB(members[_0x4e4eb5]);}}}}catch(_0x184575){utils[_0x00f5('0x28')](util[_0x00f5('0x6')](_0x00f5('0x35'),_0x5a7c72[_0x00f5('0x8')]),_0x184575);}}; \ No newline at end of file +var _0xdfbe=['debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','now','agent','NOT_INUSE','isNil','exitAt','diffTime','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','interface','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','error','[%s][members][writeDB]','some','startsWith'];(function(_0x50af3b,_0x33dc1a){var _0x14914a=function(_0x3980c1){while(--_0x3980c1){_0x50af3b['push'](_0x50af3b['shift']());}};_0x14914a(++_0x33dc1a);}(_0xdfbe,0x1ab));var _0xedfb=function(_0x4ff72a,_0x3de0d8){_0x4ff72a=_0x4ff72a-0x0;var _0x267ff0=_0xdfbe[_0x4ff72a];return _0x267ff0;};'use strict';var _=require('lodash');var util=require(_0xedfb('0x0'));var utils=require('./utils');var members={};var exclude=[_0xedfb('0x1'),_0xedfb('0x2')];function writeDB(_0x2fbbcf){utils[_0xedfb('0x3')](util[_0xedfb('0x4')](_0xedfb('0x5'),_0x2fbbcf[_0xedfb('0x6')],_0x2fbbcf['interface'],_0x2fbbcf[_0xedfb('0x7')],_0x2fbbcf[_0xedfb('0x8')],_0x2fbbcf[_0xedfb('0x9')],_0x2fbbcf['type']));if(_0x2fbbcf[_0xedfb('0xa')]){utils[_0xedfb('0xb')](_0x2fbbcf[_0xedfb('0xa')])[_0xedfb('0xc')](function(_0x4f639c){if(_0x4f639c){_0x2fbbcf[_0xedfb('0x9')]=_0x4f639c[_0xedfb('0xd')];_0x2fbbcf[_0xedfb('0xe')]=_0x4f639c[_0xedfb('0xe')];utils[_0xedfb('0xf')]('CreateMemberReport',_0x2fbbcf);}else{utils[_0xedfb('0x10')](_0x2fbbcf['interface'][_0xedfb('0x11')]('/')[0x1])[_0xedfb('0xc')](function(_0x337d78){if(_0x337d78){_0x2fbbcf[_0xedfb('0x9')]=_0x337d78[_0xedfb('0xd')];_0x2fbbcf[_0xedfb('0xe')]=_0x337d78['internal'];utils['request'](_0xedfb('0x12'),_0x2fbbcf);}});}})['catch'](function(_0x32a284){utils[_0xedfb('0x13')](util['format'](_0xedfb('0x14'),_0x2fbbcf[_0xedfb('0x6')]),_0x32a284);});}delete members[_0x2fbbcf['interface']];}function startsWith(_0x54218b,_0x5bc64b){return _[_0xedfb('0x15')](_0x54218b,function(_0xd0d3fd){return _[_0xedfb('0x16')](_0x5bc64b,_0xd0d3fd);});}exports['devicestatechange']=function(_0x545fe0){try{utils[_0xedfb('0x17')](util[_0xedfb('0x4')]('[%s][members][devicestatechange]',members[_0x545fe0['device']]?members[_0x545fe0[_0xedfb('0x18')]][_0xedfb('0x6')]:_0x545fe0['device']),_0x545fe0);utils[_0xedfb('0x3')](util[_0xedfb('0x4')](_0xedfb('0x19'),members[_0x545fe0[_0xedfb('0x18')]]?members[_0x545fe0[_0xedfb('0x18')]][_0xedfb('0x6')]:_0x545fe0[_0xedfb('0x18')],_0x545fe0[_0xedfb('0x1a')],_0x545fe0[_0xedfb('0x18')]));switch(_0x545fe0['state']){case _0xedfb('0x1b'):case _0xedfb('0x1c'):if(!startsWith(exclude,_0x545fe0['device'])){members[_0x545fe0[_0xedfb('0x18')]]={'channel':'voice','interface':_0x545fe0[_0xedfb('0x18')],'type':'TALKING','enterAt':utils[_0xedfb('0x1d')](),'role':_0xedfb('0x1e')};}break;case _0xedfb('0x1f'):if(!_[_0xedfb('0x20')](members[_0x545fe0['device']])){members[_0x545fe0['device']][_0xedfb('0x21')]=utils[_0xedfb('0x1d')]();members[_0x545fe0[_0xedfb('0x18')]]['duration']=utils[_0xedfb('0x22')](members[_0x545fe0[_0xedfb('0x18')]]['exitAt'],members[_0x545fe0[_0xedfb('0x18')]]['enterAt']);if(members[_0x545fe0['device']][_0xedfb('0x6')]){writeDB(members[_0x545fe0[_0xedfb('0x18')]]);}}break;default:break;}}catch(_0x31fd49){utils[_0xedfb('0x13')](util['format'](_0xedfb('0x23'),members[_0x545fe0[_0xedfb('0x18')]]?members[_0x545fe0[_0xedfb('0x18')]][_0xedfb('0x6')]:_0x545fe0['device']),_0x31fd49);}};exports[_0xedfb('0x24')]=function(_0x167fbc){try{if(!_[_0xedfb('0x20')](members[_0x167fbc[_0xedfb('0xa')]])){utils['debug'](util[_0xedfb('0x4')]('[%s][members][agentcomplete]',_0x167fbc[_0xedfb('0x6')]),_0x167fbc);utils[_0xedfb('0x3')](util[_0xedfb('0x4')](_0xedfb('0x25'),_0x167fbc[_0xedfb('0x6')],_0x167fbc[_0xedfb('0xa')],_0x167fbc[_0xedfb('0x26')]));members[_0x167fbc[_0xedfb('0xa')]]=_[_0xedfb('0x27')](members[_0x167fbc['interface']],{'data4':_0x167fbc[_0xedfb('0x26')],'uniqueid':_0x167fbc[_0xedfb('0x6')]});}}catch(_0x3676fd){utils[_0xedfb('0x13')](util[_0xedfb('0x4')](_0xedfb('0x28'),_0x167fbc[_0xedfb('0x6')]),_0x3676fd);}};exports[_0xedfb('0x29')]=function(_0x56b9d6){try{utils[_0xedfb('0x17')](util['format'](_0xedfb('0x2a'),_0x56b9d6['uniqueid']),_0x56b9d6);if(_0x56b9d6[_0xedfb('0x7')]){var _0x4e4bae=_0x56b9d6[_0xedfb('0x7')][_0xedfb('0x11')]('-')[0x0];if(!_['isNil'](members[_0x4e4bae])){members[_0x4e4bae]=_[_0xedfb('0x27')](members[_0x4e4bae],{'data1':members[_0x4e4bae][_0xedfb('0x2b')]||_0x56b9d6[_0xedfb('0x2c')],'data2':members[_0x4e4bae][_0xedfb('0x8')]||_0x56b9d6[_0xedfb('0x2d')],'data3':members[_0x4e4bae][_0xedfb('0x2e')]||_0x56b9d6[_0xedfb('0x2f')],'uniqueid':members[_0x4e4bae][_0xedfb('0x6')]||_0x56b9d6[_0xedfb('0x6')]});utils['info'](util[_0xedfb('0x4')](_0xedfb('0x30'),_0x56b9d6['uniqueid'],members[_0x4e4bae][_0xedfb('0x2b')],members[_0x4e4bae][_0xedfb('0x8')],members[_0x4e4bae]['data3']));if(members[_0x4e4bae][_0xedfb('0x21')]){writeDB(members[_0x4e4bae]);}}}if(_0x56b9d6['destinationchannel']){var _0x233d8b=_0x56b9d6[_0xedfb('0x31')]['split']('-')[0x0];if(!_['isNil'](members[_0x233d8b])){members[_0x233d8b]=_[_0xedfb('0x27')](members[_0x233d8b],{'data1':members[_0x233d8b]['data1']||_0x56b9d6[_0xedfb('0x2c')],'data2':members[_0x233d8b]['data2']||_0x56b9d6[_0xedfb('0x2d')],'data3':members[_0x233d8b][_0xedfb('0x2e')]||_0x56b9d6['destination'],'uniqueid':members[_0x233d8b][_0xedfb('0x6')]||_0x56b9d6['uniqueid']});utils[_0xedfb('0x3')](util['format'](_0xedfb('0x30'),_0x56b9d6[_0xedfb('0x6')],members[_0x233d8b][_0xedfb('0x2b')],members[_0x233d8b]['data2'],members[_0x233d8b][_0xedfb('0x2e')]));if(members[_0x233d8b][_0xedfb('0x21')]){writeDB(members[_0x233d8b]);}}}}catch(_0x3dee20){utils['error'](util['format'](_0xedfb('0x2a'),_0x56b9d6['uniqueid']),_0x3dee20);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index fa397e1..15f7956 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 _0x359d=['COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','position','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','mohtime','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt'];(function(_0x365440,_0x29195c){var _0x17c203=function(_0x39f3b8){while(--_0x39f3b8){_0x365440['push'](_0x365440['shift']());}};_0x17c203(++_0x29195c);}(_0x359d,0x1f2));var _0xd359=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x359d[_0xdbb6cb];return _0x476b50;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd359('0x0'));var queues={};function writeDB(_0x221e14){utils[_0xd359('0x1')](util['format'](_0xd359('0x2'),_0x221e14[_0xd359('0x3')],_0x221e14['channel'],_0x221e14[_0xd359('0x4')],_0x221e14['lastAssignedTo'],_0x221e14[_0xd359('0x5')],_0x221e14[_0xd359('0x6')],_0x221e14[_0xd359('0x7')]));if(_0x221e14[_0xd359('0x4')]){utils[_0xd359('0x8')](_0x221e14['queue'])[_0xd359('0x9')](function(_0xcbf89d){if(_0xcbf89d){_0x221e14[_0xd359('0xa')]=_0xcbf89d['type'];}utils[_0xd359('0xb')](_0xd359('0xc'),_0x221e14);});}else{utils[_0xd359('0xb')](_0xd359('0xc'),_0x221e14);}if(_0x221e14[_0xd359('0xd')]){delete queues[_0x221e14[_0xd359('0xd')]];}else{delete queues[_0x221e14[_0xd359('0x3')]];}}exports['queuecallerjoin']=function(_0x510955){try{utils[_0xd359('0xe')](util[_0xd359('0xf')]('[%s][queues][queuecallerjoin]',_0x510955['uniqueid']),_0x510955);utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x10'),_0x510955[_0xd359('0x3')],_0x510955[_0xd359('0x4')],_0x510955['position']));queues[_0x510955['uniqueid']]=_[_0xd359('0x11')](_0x510955,{'originalposition':_0x510955['position'],'queuecallerjoinAt':utils[_0xd359('0x12')](),'mohtime':0x0});}catch(_0x12e766){utils[_0xd359('0x13')](util[_0xd359('0xf')]('[%s][queues][queuecallerjoin]',_0x510955[_0xd359('0x3')]),_0x12e766);}};exports[_0xd359('0x14')]=function(_0x5d4d2e){try{if(!_[_0xd359('0x15')](queues[_0x5d4d2e[_0xd359('0x3')]])){utils[_0xd359('0xe')](util[_0xd359('0xf')](_0xd359('0x16'),_0x5d4d2e[_0xd359('0x3')]),_0x5d4d2e);if(queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0x17')]){if(!queues[_0x5d4d2e['uniqueid']]['queuecallerabandon']&&!queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0x18')]){queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0x19')]=!![];queues[_0x5d4d2e['uniqueid']][_0xd359('0x1a')]=utils[_0xd359('0x12')]();queues[_0x5d4d2e[_0xd359('0x3')]]['queuecallerexitreason']=_0xd359('0x1b');}utils[_0xd359('0x1')](util['format'](_0xd359('0x1c'),_0x5d4d2e[_0xd359('0x3')],queues[_0x5d4d2e[_0xd359('0x3')]]['name'],queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0x7')]));writeDB(queues[_0x5d4d2e[_0xd359('0x3')]]);}else if(queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0xd')]){utils[_0xd359('0x1')](util['format'](_0xd359('0x1d'),_0x5d4d2e[_0xd359('0x3')],queues[_0x5d4d2e[_0xd359('0x3')]]['name'],queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0xd')]));queues[queues[_0x5d4d2e[_0xd359('0x3')]][_0xd359('0xd')]]=queues[_0x5d4d2e[_0xd359('0x3')]];queues[queues[_0x5d4d2e['uniqueid']]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x5d4d2e['uniqueid']];}}}catch(_0x5d79f1){utils[_0xd359('0x13')](util[_0xd359('0xf')](_0xd359('0x16'),_0x5d4d2e['uniqueid']),_0x5d79f1);}};exports[_0xd359('0x1e')]=function(_0x17ac17){try{utils[_0xd359('0xe')](util[_0xd359('0xf')](_0xd359('0x1f'),_0x17ac17[_0xd359('0x3')]),_0x17ac17);if(!_[_0xd359('0x15')](_0x17ac17[_0xd359('0x20')][_0xd359('0x21')])&&_0x17ac17[_0xd359('0x22')][_0xd359('0x23')]()!==_0xd359('0x24')){if(!_[_0xd359('0x15')](queues[_0x17ac17[_0xd359('0x3')]])){queues[_0x17ac17[_0xd359('0x3')]]['queuecallerabandon']=![];queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x25')]=null;queues[_0x17ac17['uniqueid']][_0xd359('0x18')]=!![];queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x26')]=utils['now']();queues[_0x17ac17['uniqueid']][_0xd359('0x7')]=_0x17ac17[_0xd359('0x22')][_0xd359('0x23')]();utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x27'),_0x17ac17[_0xd359('0x3')],queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x28')],_0x17ac17[_0xd359('0x22')],queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x7')]));writeDB(queues[_0x17ac17['uniqueid']]);}}else if(!_['isNil'](_0x17ac17[_0xd359('0x20')][_0xd359('0x29')])){if(!_[_0xd359('0x15')](queues[_0x17ac17['uniqueid']])&&!queues[_0x17ac17['uniqueid']][_0xd359('0x2a')]){queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x2a')]=![];queues[_0x17ac17[_0xd359('0x3')]]['queuecallerabandonAt']=null;queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x18')]=!![];queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x26')]=utils[_0xd359('0x12')]();queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x7')]=_0xd359('0x2b');utils[_0xd359('0x1')](util['format'](_0xd359('0x2c'),_0x17ac17['uniqueid'],queues[_0x17ac17[_0xd359('0x3')]]['name'],_0x17ac17['value'],queues[_0x17ac17[_0xd359('0x3')]][_0xd359('0x7')]));}}}catch(_0x3f0652){utils[_0xd359('0x13')](util[_0xd359('0xf')](_0xd359('0x1f'),_0x17ac17[_0xd359('0x3')]),_0x3f0652);}};exports[_0xd359('0x2a')]=function(_0x1a9616){try{if(!_['isNil'](queues[_0x1a9616[_0xd359('0x3')]])){utils[_0xd359('0xe')](util['format'](_0xd359('0x2d'),_0x1a9616[_0xd359('0x3')]),_0x1a9616);queues[_0x1a9616[_0xd359('0x3')]]['queuecallerexit']=![];queues[_0x1a9616['uniqueid']][_0xd359('0x26')]=null;queues[_0x1a9616['uniqueid']][_0xd359('0x2a')]=!![];queues[_0x1a9616['uniqueid']][_0xd359('0x25')]=utils['now']();queues[_0x1a9616[_0xd359('0x3')]][_0xd359('0x7')]=_0xd359('0x2e');utils[_0xd359('0x1')](util[_0xd359('0xf')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1a9616[_0xd359('0x3')],queues[_0x1a9616[_0xd359('0x3')]]['name'],queues[_0x1a9616['uniqueid']][_0xd359('0x7')]));}}catch(_0x2db9fe){utils[_0xd359('0x13')](util['format'](_0xd359('0x2d'),_0x1a9616[_0xd359('0x3')]),_0x2db9fe);}};exports[_0xd359('0x2f')]=function(_0x524f55){try{if(!_['isNil'](queues[_0x524f55['uniqueid']])){utils['debug'](util[_0xd359('0xf')](_0xd359('0x30'),_0x524f55[_0xd359('0x3')]),_0x524f55);utils['info'](util['format'](_0xd359('0x31'),_0x524f55['uniqueid'],queues[_0x524f55['uniqueid']][_0xd359('0x28')],_0x524f55[_0xd359('0x32')],_0x524f55[_0xd359('0x33')]));queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x2f')]=!![];queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x17')]=utils['now']();queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x34')]=utils[_0xd359('0x35')](queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x17')],queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x36')]);queues[_0x524f55['uniqueid']][_0xd359('0x37')]=_0x524f55[_0xd359('0x37')];queues[_0x524f55['uniqueid']][_0xd359('0x38')]=_0x524f55[_0xd359('0x38')];queues[_0x524f55['uniqueid']]['connectedlinenum']=_0x524f55[_0xd359('0x32')];queues[_0x524f55[_0xd359('0x3')]][_0xd359('0x33')]=_0x524f55[_0xd359('0x33')];}}catch(_0x22c7dd){utils['error'](util['format'](_0xd359('0x30'),_0x524f55['uniqueid']),_0x22c7dd);}};exports['agentconnect']=function(_0x15c502){try{if(!_[_0xd359('0x15')](queues[_0x15c502[_0xd359('0x3')]])){utils['debug'](util['format']('[%s][queues][agentconnect]',_0x15c502['uniqueid']),_0x15c502);utils[_0xd359('0x1')](util['format'](_0xd359('0x39'),_0x15c502['uniqueid'],queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x28')],_0x15c502[_0xd359('0x3a')],_0x15c502[_0xd359('0x3b')]));queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x2a')]=![];queues[_0x15c502[_0xd359('0x3')]]['queuecallerabandon']=![];queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x25')]=null;queues[_0x15c502['uniqueid']][_0xd359('0x18')]=![];queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x7')]=null;queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x26')]=null;queues[_0x15c502['uniqueid']][_0xd359('0x3c')]=!![];queues[_0x15c502['uniqueid']][_0xd359('0x6')]=_0x15c502[_0xd359('0x3b')];queues[_0x15c502[_0xd359('0x3')]][_0xd359('0x3d')]=_0x15c502[_0xd359('0x3a')];}}catch(_0x2b28c8){utils[_0xd359('0x13')](util['format']('[%s][queues][agentconnect]',_0x15c502[_0xd359('0x3')]),_0x2b28c8);}};exports[_0xd359('0x3e')]=function(_0x25d430){try{if(!_[_0xd359('0x15')](queues[_0x25d430[_0xd359('0x3')]])){if(queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x17')]){utils[_0xd359('0xe')](util['format'](_0xd359('0x3f'),_0x25d430['uniqueid']),_0x25d430);queues[_0x25d430['uniqueid']][_0xd359('0x2a')]=![];queues[_0x25d430[_0xd359('0x3')]]['queuecallerabandon']=![];queues[_0x25d430['uniqueid']][_0xd359('0x25')]=null;queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x18')]=![];queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x26')]=null;queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x3c')]=!![];queues[_0x25d430[_0xd359('0x3')]]['lastAssignedTo']=_0x25d430[_0xd359('0x3a')];queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x19')]=!![];queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x1a')]=utils['now']();if(_0x25d430[_0xd359('0x40')]==_0xd359('0x41')){if(!queues[_0x25d430[_0xd359('0x3')]][_0xd359('0x41')]){queues[_0x25d430['uniqueid']][_0xd359('0x7')]=_0xd359('0x42');}}else{queues[_0x25d430['uniqueid']][_0xd359('0x7')]='COMPLETEDBY'+_0x25d430['reason'][_0xd359('0x23')]();}utils[_0xd359('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x25d430[_0xd359('0x3')],queues[_0x25d430['uniqueid']][_0xd359('0x28')],_0x25d430[_0xd359('0x3a')],queues[_0x25d430[_0xd359('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x25d430[_0xd359('0x3')]]);}}}catch(_0x42b5e8){utils['error'](util[_0xd359('0xf')]('[%s][queues][agentcomplete]',_0x25d430[_0xd359('0x3')]),_0x42b5e8);}};exports[_0xd359('0x43')]=function(_0x25cbd3){try{if(!_['isNil'](queues[_0x25cbd3[_0xd359('0x44')]])){utils[_0xd359('0xe')](util[_0xd359('0xf')](_0xd359('0x45'),_0x25cbd3['uniqueid']),_0x25cbd3);queues[_0x25cbd3[_0xd359('0x44')]][_0xd359('0x41')]=!![];queues[_0x25cbd3[_0xd359('0x44')]]['transfertype']=_0xd359('0x46');queues[_0x25cbd3[_0xd359('0x44')]][_0xd359('0x47')]=_0x25cbd3[_0xd359('0x48')];queues[_0x25cbd3[_0xd359('0x44')]][_0xd359('0x49')]=_0x25cbd3[_0xd359('0x44')];queues[_0x25cbd3[_0xd359('0x44')]][_0xd359('0x7')]=_0xd359('0x4a');utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x4b'),_0x25cbd3[_0xd359('0x3')],queues[_0x25cbd3['transfereeuniqueid']][_0xd359('0x28')],_0x25cbd3[_0xd359('0x44')],_0x25cbd3[_0xd359('0x48')]));}}catch(_0x14eff2){utils['error'](util[_0xd359('0xf')](_0xd359('0x45'),_0x25cbd3['uniqueid']),_0x14eff2);}};exports['attendedtransfer']=function(_0xcdc089){try{utils[_0xd359('0xe')](util[_0xd359('0xf')](_0xd359('0x4c'),_0xcdc089['origtransfereruniqueid']),_0xcdc089);if(_0xcdc089[_0xd359('0x4d')]==_0xcdc089[_0xd359('0x4e')]){if(!_[_0xd359('0x15')](queues[_0xcdc089[_0xd359('0x4f')]])){utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x50'),_0xcdc089[_0xd359('0x4d')],queues[_0xcdc089[_0xd359('0x4f')]][_0xd359('0x28')],_0xcdc089[_0xd359('0x51')]));queues[_0xcdc089[_0xd359('0x4f')]][_0xd359('0x41')]=!![];queues[_0xcdc089[_0xd359('0x4f')]][_0xd359('0x52')]=_0xd359('0x53');queues[_0xcdc089[_0xd359('0x4f')]]['transferexten']=_0xcdc089[_0xd359('0x51')];queues[_0xcdc089[_0xd359('0x4f')]]['transferuniqueid']=_0xcdc089[_0xd359('0x4d')];queues[_0xcdc089[_0xd359('0x4f')]]['queuecallerexitreason']=_0xd359('0x54');}if(!_[_0xd359('0x15')](queues[_0xcdc089[_0xd359('0x4e')]])){if(_0xcdc089[_0xd359('0x55')]&&queues[_0xcdc089[_0xd359('0x55')]]){queues[_0xcdc089[_0xd359('0x55')]][_0xd359('0x56')]=0x1;queues[_0xcdc089[_0xd359('0x44')]]=_['clone'](queues[_0xcdc089[_0xd359('0x55')]]);queues[_0xcdc089['transfereeuniqueid']]['transfereduniqueid']=_0xcdc089[_0xd359('0x57')];queues[_0xcdc089[_0xd359('0x44')]]['queuecallerenterreason']=0x2;queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x5')]=queues[_0xcdc089['secondtransfererlinkedid']]['calleridnum'];queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x58')]=queues[_0xcdc089[_0xd359('0x4f')]][_0xd359('0x58')];queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x36')]=utils[_0xd359('0x12')]();queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x17')]=utils[_0xd359('0x12')]();queues[_0xcdc089[_0xd359('0x44')]]['holdtime']=0x0;queues[_0xcdc089[_0xd359('0x44')]]['mohtime']=0x0;utils[_0xd359('0x1')](util['format'](_0xd359('0x59'),_0xcdc089['origtransfereruniqueid'],queues[_0xcdc089['transfereeuniqueid']][_0xd359('0x28')],queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x5')],queues[_0xcdc089[_0xd359('0x44')]][_0xd359('0x58')]));}else{utils['info'](util[_0xd359('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xcdc089[_0xd359('0x4d')],queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x28')],_0xcdc089[_0xd359('0x4f')]));queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0xd')]=_0xcdc089[_0xd359('0x4f')];}}}else if(_0xcdc089[_0xd359('0x5a')]==_0xcdc089[_0xd359('0x4f')]){if(!_[_0xd359('0x15')](queues[_0xcdc089[_0xd359('0x4e')]])){utils[_0xd359('0x1')](util['format'](_0xd359('0x5b'),_0xcdc089[_0xd359('0x4d')],queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x28')],_0xcdc089[_0xd359('0x5a')],_0xcdc089[_0xd359('0x5c')]));queues[_0xcdc089[_0xd359('0x4e')]]['transfer']=!![];queues[_0xcdc089['origtransfererlinkedid']][_0xd359('0x52')]=_0xd359('0x53');queues[_0xcdc089['origtransfererlinkedid']][_0xd359('0x47')]=_0xcdc089[_0xd359('0x5c')];queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x49')]=_0xcdc089[_0xd359('0x5a')];queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x7')]=_0xd359('0x54');}if(!_['isNil'](queues[_0xcdc089['secondtransfererlinkedid']])){if(_0xcdc089[_0xd359('0x5d')]&&queues[_0xcdc089['transfertargetlinkedid']]){queues[_0xcdc089[_0xd359('0x5d')]][_0xd359('0x56')]=0x1;queues[_0xcdc089[_0xd359('0x57')]]=_[_0xd359('0x5e')](queues[_0xcdc089[_0xd359('0x5d')]]);queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0xd')]=_0xcdc089[_0xd359('0x57')];queues[_0xcdc089['transfertargetuniqueid']][_0xd359('0x56')]=0x2;queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x5')]=queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x5')];queues[_0xcdc089['transfertargetuniqueid']][_0xd359('0x58')]=queues[_0xcdc089[_0xd359('0x4e')]][_0xd359('0x58')];queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x36')]=utils[_0xd359('0x12')]();queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x17')]=utils[_0xd359('0x12')]();queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x34')]=0x0;queues[_0xcdc089[_0xd359('0x57')]]['mohtime']=0x0;utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x5f'),_0xcdc089['origtransfereruniqueid'],queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x28')],queues[_0xcdc089[_0xd359('0x57')]]['transfereduniqueid'],queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x5')],queues[_0xcdc089[_0xd359('0x57')]][_0xd359('0x58')]));}else{utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x60'),_0xcdc089[_0xd359('0x4d')],queues[_0xcdc089[_0xd359('0x4f')]]['name'],_0xcdc089[_0xd359('0x4e')]));queues[_0xcdc089[_0xd359('0x4f')]]['transfereduniqueid']=_0xcdc089[_0xd359('0x4e')];}}}}catch(_0x5567a5){utils[_0xd359('0x13')](util['format'](_0xd359('0x4c'),_0xcdc089['origtransfereruniqueid']),_0x5567a5);}};exports[_0xd359('0x61')]=function(_0xb1fde){try{if(!_[_0xd359('0x15')](queues[_0xb1fde['uniqueid']])){utils['debug'](util['format'](_0xd359('0x62'),_0xb1fde[_0xd359('0x3')]),_0xb1fde);queues[_0xb1fde[_0xd359('0x3')]][_0xd359('0x63')]=utils['now']();utils['info'](util['format'](_0xd359('0x64'),_0xb1fde[_0xd359('0x3')],queues[_0xb1fde[_0xd359('0x3')]][_0xd359('0x28')],queues[_0xb1fde['uniqueid']][_0xd359('0x63')]));}}catch(_0x4b6166){utils[_0xd359('0x13')](util[_0xd359('0xf')](_0xd359('0x62'),_0xb1fde[_0xd359('0x3')]),_0x4b6166);}};exports[_0xd359('0x65')]=function(_0x3b7718){try{if(!_[_0xd359('0x15')](queues[_0x3b7718[_0xd359('0x3')]])){if(!_[_0xd359('0x15')](queues[_0x3b7718[_0xd359('0x3')]][_0xd359('0x63')])){utils[_0xd359('0xe')](util['format'](_0xd359('0x66'),_0x3b7718[_0xd359('0x3')]),_0x3b7718);queues[_0x3b7718[_0xd359('0x3')]]['mohtime']+=utils[_0xd359('0x35')](utils[_0xd359('0x12')](),queues[_0x3b7718[_0xd359('0x3')]]['musiconholdstartAt']);utils[_0xd359('0x1')](util[_0xd359('0xf')](_0xd359('0x67'),_0x3b7718[_0xd359('0x3')],queues[_0x3b7718[_0xd359('0x3')]][_0xd359('0x28')],queues[_0x3b7718[_0xd359('0x3')]][_0xd359('0x68')]));delete queues[_0x3b7718[_0xd359('0x3')]]['musiconholdstartAt'];}}}catch(_0x224bef){utils[_0xd359('0x13')](util[_0xd359('0xf')](_0xd359('0x66'),_0x3b7718[_0xd359('0x3')]),_0x224bef);}}; \ No newline at end of file +var _0x5f3d=['COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][queuecallerabandon]','queuecallerleave','connectedlinenum','connectedlinename','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','agentcomplete','[%s][queues][agentcomplete]','transfer','reason','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','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','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt'];(function(_0x5c96dd,_0x3017af){var _0x20416f=function(_0x30a54e){while(--_0x30a54e){_0x5c96dd['push'](_0x5c96dd['shift']());}};_0x20416f(++_0x3017af);}(_0x5f3d,0xaf));var _0xd5f3=function(_0x3ddda1,_0x586a23){_0x3ddda1=_0x3ddda1-0x0;var _0x4b443a=_0x5f3d[_0x3ddda1];return _0x4b443a;};'use strict';var _=require(_0xd5f3('0x0'));var util=require(_0xd5f3('0x1'));var utils=require(_0xd5f3('0x2'));var queues={};function writeDB(_0x1faacc){utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')](_0xd5f3('0x5'),_0x1faacc[_0xd5f3('0x6')],_0x1faacc[_0xd5f3('0x7')],_0x1faacc[_0xd5f3('0x8')],_0x1faacc[_0xd5f3('0x9')],_0x1faacc[_0xd5f3('0xa')],_0x1faacc['accountcode'],_0x1faacc[_0xd5f3('0xb')]));if(_0x1faacc[_0xd5f3('0x8')]){utils[_0xd5f3('0xc')](_0x1faacc[_0xd5f3('0x8')])['then'](function(_0x25a39a){if(_0x25a39a){_0x1faacc[_0xd5f3('0xd')]=_0x25a39a['type'];}utils[_0xd5f3('0xe')](_0xd5f3('0xf'),_0x1faacc);});}else{utils[_0xd5f3('0xe')](_0xd5f3('0xf'),_0x1faacc);}if(_0x1faacc[_0xd5f3('0x10')]){delete queues[_0x1faacc[_0xd5f3('0x10')]];}else{delete queues[_0x1faacc[_0xd5f3('0x6')]];}}exports[_0xd5f3('0x11')]=function(_0x5eeac2){try{utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x13'),_0x5eeac2[_0xd5f3('0x6')]),_0x5eeac2);utils[_0xd5f3('0x3')](util['format'](_0xd5f3('0x14'),_0x5eeac2[_0xd5f3('0x6')],_0x5eeac2[_0xd5f3('0x8')],_0x5eeac2['position']));queues[_0x5eeac2[_0xd5f3('0x6')]]=_[_0xd5f3('0x15')](_0x5eeac2,{'originalposition':_0x5eeac2[_0xd5f3('0x16')],'queuecallerjoinAt':utils[_0xd5f3('0x17')](),'mohtime':0x0});}catch(_0xaedddf){utils[_0xd5f3('0x18')](util[_0xd5f3('0x4')](_0xd5f3('0x13'),_0x5eeac2[_0xd5f3('0x6')]),_0xaedddf);}};exports[_0xd5f3('0x19')]=function(_0xd4711d){try{if(!_[_0xd5f3('0x1a')](queues[_0xd4711d['uniqueid']])){utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x1b'),_0xd4711d[_0xd5f3('0x6')]),_0xd4711d);if(queues[_0xd4711d['uniqueid']][_0xd5f3('0x1c')]){if(!queues[_0xd4711d['uniqueid']][_0xd5f3('0x1d')]&&!queues[_0xd4711d['uniqueid']][_0xd5f3('0x1e')]){queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0x1f')]=!![];queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0x20')]=utils[_0xd5f3('0x17')]();queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0xb')]=_0xd5f3('0x21');}utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')](_0xd5f3('0x22'),_0xd4711d['uniqueid'],queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0x23')],queues[_0xd4711d[_0xd5f3('0x6')]]['queuecallerexitreason']));writeDB(queues[_0xd4711d[_0xd5f3('0x6')]]);}else if(queues[_0xd4711d['uniqueid']]['transfereduniqueid']){utils[_0xd5f3('0x3')](util['format'](_0xd5f3('0x24'),_0xd4711d[_0xd5f3('0x6')],queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0x23')],queues[_0xd4711d['uniqueid']][_0xd5f3('0x10')]));queues[queues[_0xd4711d['uniqueid']][_0xd5f3('0x10')]]=queues[_0xd4711d[_0xd5f3('0x6')]];queues[queues[_0xd4711d[_0xd5f3('0x6')]][_0xd5f3('0x10')]][_0xd5f3('0x25')]=0x2;delete queues[_0xd4711d['uniqueid']];}}}catch(_0xf35451){utils[_0xd5f3('0x18')](util['format'](_0xd5f3('0x1b'),_0xd4711d[_0xd5f3('0x6')]),_0xf35451);}};exports[_0xd5f3('0x26')]=function(_0x181170){try{utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x27'),_0x181170[_0xd5f3('0x6')]),_0x181170);if(!_[_0xd5f3('0x1a')](_0x181170[_0xd5f3('0x28')]['queuestatus'])&&_0x181170[_0xd5f3('0x29')]['toUpperCase']()!==_0xd5f3('0x2a')){if(!_[_0xd5f3('0x1a')](queues[_0x181170[_0xd5f3('0x6')]])){queues[_0x181170[_0xd5f3('0x6')]]['queuecallerabandon']=![];queues[_0x181170['uniqueid']][_0xd5f3('0x2b')]=null;queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x1e')]=!![];queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x2c')]=utils[_0xd5f3('0x17')]();queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0xb')]=_0x181170[_0xd5f3('0x29')]['toUpperCase']();utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')](_0xd5f3('0x2d'),_0x181170['uniqueid'],queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x23')],_0x181170[_0xd5f3('0x29')],queues[_0x181170['uniqueid']][_0xd5f3('0xb')]));writeDB(queues[_0x181170['uniqueid']]);}}else if(!_[_0xd5f3('0x1a')](_0x181170[_0xd5f3('0x28')][_0xd5f3('0x2e')])){if(!_[_0xd5f3('0x1a')](queues[_0x181170[_0xd5f3('0x6')]])&&!queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x1d')]){queues[_0x181170[_0xd5f3('0x6')]]['queuecallerabandon']=![];queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x2b')]=null;queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0x1e')]=!![];queues[_0x181170[_0xd5f3('0x6')]]['queuecallerexitAt']=utils[_0xd5f3('0x17')]();queues[_0x181170['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x181170[_0xd5f3('0x6')],queues[_0x181170['uniqueid']][_0xd5f3('0x23')],_0x181170[_0xd5f3('0x29')],queues[_0x181170[_0xd5f3('0x6')]][_0xd5f3('0xb')]));}}}catch(_0x260f87){utils[_0xd5f3('0x18')](util[_0xd5f3('0x4')]('[%s][queues][varset]',_0x181170[_0xd5f3('0x6')]),_0x260f87);}};exports['queuecallerabandon']=function(_0x2b4546){try{if(!_[_0xd5f3('0x1a')](queues[_0x2b4546[_0xd5f3('0x6')]])){utils['debug'](util[_0xd5f3('0x4')]('[%s][queues][queuecallerabandon]',_0x2b4546[_0xd5f3('0x6')]),_0x2b4546);queues[_0x2b4546[_0xd5f3('0x6')]]['queuecallerexit']=![];queues[_0x2b4546[_0xd5f3('0x6')]][_0xd5f3('0x2c')]=null;queues[_0x2b4546[_0xd5f3('0x6')]][_0xd5f3('0x1d')]=!![];queues[_0x2b4546['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x2b4546[_0xd5f3('0x6')]][_0xd5f3('0xb')]='ABANDONED';utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2b4546['uniqueid'],queues[_0x2b4546[_0xd5f3('0x6')]][_0xd5f3('0x23')],queues[_0x2b4546[_0xd5f3('0x6')]][_0xd5f3('0xb')]));}}catch(_0x1b544f){utils[_0xd5f3('0x18')](util['format'](_0xd5f3('0x2f'),_0x2b4546[_0xd5f3('0x6')]),_0x1b544f);}};exports[_0xd5f3('0x30')]=function(_0x3d9b1d){try{if(!_['isNil'](queues[_0x3d9b1d[_0xd5f3('0x6')]])){utils['debug'](util['format']('[%s][queues][queuecallerleave]',_0x3d9b1d['uniqueid']),_0x3d9b1d);utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3d9b1d[_0xd5f3('0x6')],queues[_0x3d9b1d[_0xd5f3('0x6')]]['name'],_0x3d9b1d[_0xd5f3('0x31')],_0x3d9b1d[_0xd5f3('0x32')]));queues[_0x3d9b1d[_0xd5f3('0x6')]][_0xd5f3('0x30')]=!![];queues[_0x3d9b1d[_0xd5f3('0x6')]][_0xd5f3('0x1c')]=utils[_0xd5f3('0x17')]();queues[_0x3d9b1d[_0xd5f3('0x6')]]['holdtime']=utils['diffTime'](queues[_0x3d9b1d['uniqueid']][_0xd5f3('0x1c')],queues[_0x3d9b1d[_0xd5f3('0x6')]]['queuecallerjoinAt']);queues[_0x3d9b1d[_0xd5f3('0x6')]][_0xd5f3('0x16')]=_0x3d9b1d[_0xd5f3('0x16')];queues[_0x3d9b1d['uniqueid']][_0xd5f3('0x33')]=_0x3d9b1d['count'];queues[_0x3d9b1d[_0xd5f3('0x6')]]['connectedlinenum']=_0x3d9b1d[_0xd5f3('0x31')];queues[_0x3d9b1d[_0xd5f3('0x6')]]['connectedlinename']=_0x3d9b1d[_0xd5f3('0x32')];}}catch(_0x5ea732){utils[_0xd5f3('0x18')](util[_0xd5f3('0x4')](_0xd5f3('0x34'),_0x3d9b1d['uniqueid']),_0x5ea732);}};exports[_0xd5f3('0x35')]=function(_0x4ab3a2){try{if(!_[_0xd5f3('0x1a')](queues[_0x4ab3a2[_0xd5f3('0x6')]])){utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x36'),_0x4ab3a2[_0xd5f3('0x6')]),_0x4ab3a2);utils[_0xd5f3('0x3')](util['format'](_0xd5f3('0x37'),_0x4ab3a2[_0xd5f3('0x6')],queues[_0x4ab3a2[_0xd5f3('0x6')]][_0xd5f3('0x23')],_0x4ab3a2[_0xd5f3('0x38')],_0x4ab3a2[_0xd5f3('0x39')]));queues[_0x4ab3a2[_0xd5f3('0x6')]]['queuecallerabandon']=![];queues[_0x4ab3a2[_0xd5f3('0x6')]][_0xd5f3('0x1d')]=![];queues[_0x4ab3a2[_0xd5f3('0x6')]][_0xd5f3('0x2b')]=null;queues[_0x4ab3a2['uniqueid']][_0xd5f3('0x1e')]=![];queues[_0x4ab3a2[_0xd5f3('0x6')]]['queuecallerexitreason']=null;queues[_0x4ab3a2[_0xd5f3('0x6')]][_0xd5f3('0x2c')]=null;queues[_0x4ab3a2['uniqueid']][_0xd5f3('0x3a')]=!![];queues[_0x4ab3a2[_0xd5f3('0x6')]][_0xd5f3('0x3b')]=_0x4ab3a2[_0xd5f3('0x39')];queues[_0x4ab3a2['uniqueid']][_0xd5f3('0x9')]=_0x4ab3a2[_0xd5f3('0x38')];}}catch(_0x259324){utils[_0xd5f3('0x18')](util[_0xd5f3('0x4')](_0xd5f3('0x36'),_0x4ab3a2[_0xd5f3('0x6')]),_0x259324);}};exports[_0xd5f3('0x3c')]=function(_0x563835){try{if(!_[_0xd5f3('0x1a')](queues[_0x563835[_0xd5f3('0x6')]])){if(queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x1c')]){utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x3d'),_0x563835[_0xd5f3('0x6')]),_0x563835);queues[_0x563835['uniqueid']][_0xd5f3('0x1d')]=![];queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x1d')]=![];queues[_0x563835[_0xd5f3('0x6')]]['queuecallerabandonAt']=null;queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x1e')]=![];queues[_0x563835['uniqueid']][_0xd5f3('0x2c')]=null;queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x3a')]=!![];queues[_0x563835[_0xd5f3('0x6')]]['lastAssignedTo']=_0x563835[_0xd5f3('0x38')];queues[_0x563835[_0xd5f3('0x6')]]['queuecallercomplete']=!![];queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x20')]=utils[_0xd5f3('0x17')]();if(_0x563835['reason']==_0xd5f3('0x3e')){if(!queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x3e')]){queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0xb')]='TRANSFER';}}else{queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0xb')]='COMPLETEDBY'+_0x563835[_0xd5f3('0x3f')][_0xd5f3('0x40')]();}utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x563835['uniqueid'],queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0x23')],_0x563835[_0xd5f3('0x38')],queues[_0x563835[_0xd5f3('0x6')]][_0xd5f3('0xb')]));writeDB(queues[_0x563835[_0xd5f3('0x6')]]);}}}catch(_0x4a31e9){utils[_0xd5f3('0x18')](util[_0xd5f3('0x4')](_0xd5f3('0x3d'),_0x563835['uniqueid']),_0x4a31e9);}};exports[_0xd5f3('0x41')]=function(_0x578601){try{if(!_[_0xd5f3('0x1a')](queues[_0x578601[_0xd5f3('0x42')]])){utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')]('[%s][queues][blindtransfer]',_0x578601[_0xd5f3('0x6')]),_0x578601);queues[_0x578601[_0xd5f3('0x42')]][_0xd5f3('0x3e')]=!![];queues[_0x578601['transfereeuniqueid']][_0xd5f3('0x43')]=_0xd5f3('0x44');queues[_0x578601[_0xd5f3('0x42')]][_0xd5f3('0x45')]=_0x578601[_0xd5f3('0x46')];queues[_0x578601[_0xd5f3('0x42')]][_0xd5f3('0x47')]=_0x578601[_0xd5f3('0x42')];queues[_0x578601[_0xd5f3('0x42')]]['queuecallerexitreason']=_0xd5f3('0x48');utils[_0xd5f3('0x3')](util['format'](_0xd5f3('0x49'),_0x578601[_0xd5f3('0x6')],queues[_0x578601[_0xd5f3('0x42')]][_0xd5f3('0x23')],_0x578601[_0xd5f3('0x42')],_0x578601[_0xd5f3('0x46')]));}}catch(_0x212d17){utils[_0xd5f3('0x18')](util['format']('[%s][queues][blindtransfer]',_0x578601['uniqueid']),_0x212d17);}};exports[_0xd5f3('0x4a')]=function(_0x4ba854){try{utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x4b'),_0x4ba854[_0xd5f3('0x4c')]),_0x4ba854);if(_0x4ba854[_0xd5f3('0x4c')]==_0x4ba854[_0xd5f3('0x4d')]){if(!_[_0xd5f3('0x1a')](queues[_0x4ba854[_0xd5f3('0x4e')]])){utils['info'](util[_0xd5f3('0x4')](_0xd5f3('0x4f'),_0x4ba854['origtransfereruniqueid'],queues[_0x4ba854[_0xd5f3('0x4e')]][_0xd5f3('0x23')],_0x4ba854[_0xd5f3('0x50')]));queues[_0x4ba854[_0xd5f3('0x4e')]]['transfer']=!![];queues[_0x4ba854['secondtransfererlinkedid']][_0xd5f3('0x43')]=_0xd5f3('0x51');queues[_0x4ba854['secondtransfererlinkedid']][_0xd5f3('0x45')]=_0x4ba854['origtransfererexten'];queues[_0x4ba854[_0xd5f3('0x4e')]]['transferuniqueid']=_0x4ba854[_0xd5f3('0x4c')];queues[_0x4ba854[_0xd5f3('0x4e')]][_0xd5f3('0xb')]=_0xd5f3('0x52');}if(!_[_0xd5f3('0x1a')](queues[_0x4ba854[_0xd5f3('0x4d')]])){if(_0x4ba854['transfereelinkedid']&&queues[_0x4ba854[_0xd5f3('0x53')]]){queues[_0x4ba854[_0xd5f3('0x53')]][_0xd5f3('0x25')]=0x1;queues[_0x4ba854[_0xd5f3('0x42')]]=_['clone'](queues[_0x4ba854[_0xd5f3('0x53')]]);queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x10')]=_0x4ba854[_0xd5f3('0x54')];queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x25')]=0x2;queues[_0x4ba854['transfereeuniqueid']][_0xd5f3('0xa')]=queues[_0x4ba854[_0xd5f3('0x4e')]]['calleridnum'];queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x55')]=queues[_0x4ba854[_0xd5f3('0x4e')]][_0xd5f3('0x55')];queues[_0x4ba854['transfereeuniqueid']][_0xd5f3('0x56')]=utils[_0xd5f3('0x17')]();queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x1c')]=utils[_0xd5f3('0x17')]();queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x57')]=0x0;queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x58')]=0x0;utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')](_0xd5f3('0x59'),_0x4ba854[_0xd5f3('0x4c')],queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x23')],queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0xa')],queues[_0x4ba854[_0xd5f3('0x42')]][_0xd5f3('0x55')]));}else{utils[_0xd5f3('0x3')](util[_0xd5f3('0x4')](_0xd5f3('0x5a'),_0x4ba854[_0xd5f3('0x4c')],queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0x23')],_0x4ba854['secondtransfererlinkedid']));queues[_0x4ba854[_0xd5f3('0x4d')]]['transfereduniqueid']=_0x4ba854[_0xd5f3('0x4e')];}}}else if(_0x4ba854[_0xd5f3('0x5b')]==_0x4ba854[_0xd5f3('0x4e')]){if(!_['isNil'](queues[_0x4ba854[_0xd5f3('0x4d')]])){utils['info'](util[_0xd5f3('0x4')](_0xd5f3('0x5c'),_0x4ba854[_0xd5f3('0x4c')],queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0x23')],_0x4ba854[_0xd5f3('0x5b')],_0x4ba854[_0xd5f3('0x5d')]));queues[_0x4ba854['origtransfererlinkedid']]['transfer']=!![];queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0x43')]=_0xd5f3('0x51');queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0x45')]=_0x4ba854[_0xd5f3('0x5d')];queues[_0x4ba854['origtransfererlinkedid']][_0xd5f3('0x47')]=_0x4ba854[_0xd5f3('0x5b')];queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0xb')]=_0xd5f3('0x52');}if(!_[_0xd5f3('0x1a')](queues[_0x4ba854[_0xd5f3('0x4e')]])){if(_0x4ba854['transfertargetlinkedid']&&queues[_0x4ba854[_0xd5f3('0x5e')]]){queues[_0x4ba854['transfertargetlinkedid']][_0xd5f3('0x25')]=0x1;queues[_0x4ba854['transfertargetuniqueid']]=_[_0xd5f3('0x5f')](queues[_0x4ba854[_0xd5f3('0x5e')]]);queues[_0x4ba854['transfertargetuniqueid']][_0xd5f3('0x10')]=_0x4ba854['transfertargetuniqueid'];queues[_0x4ba854['transfertargetuniqueid']][_0xd5f3('0x25')]=0x2;queues[_0x4ba854[_0xd5f3('0x54')]]['calleridnum']=queues[_0x4ba854[_0xd5f3('0x4d')]]['calleridnum'];queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0x55')]=queues[_0x4ba854[_0xd5f3('0x4d')]][_0xd5f3('0x55')];queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0x56')]=utils['now']();queues[_0x4ba854['transfertargetuniqueid']][_0xd5f3('0x1c')]=utils[_0xd5f3('0x17')]();queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0x57')]=0x0;queues[_0x4ba854[_0xd5f3('0x54')]]['mohtime']=0x0;utils['info'](util['format'](_0xd5f3('0x60'),_0x4ba854[_0xd5f3('0x4c')],queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0x23')],queues[_0x4ba854[_0xd5f3('0x54')]]['transfereduniqueid'],queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0xa')],queues[_0x4ba854[_0xd5f3('0x54')]][_0xd5f3('0x55')]));}else{utils[_0xd5f3('0x3')](util['format'](_0xd5f3('0x5a'),_0x4ba854[_0xd5f3('0x4c')],queues[_0x4ba854[_0xd5f3('0x4e')]]['name'],_0x4ba854['origtransfererlinkedid']));queues[_0x4ba854['secondtransfererlinkedid']][_0xd5f3('0x10')]=_0x4ba854['origtransfererlinkedid'];}}}}catch(_0x261cfc){utils[_0xd5f3('0x18')](util['format'](_0xd5f3('0x4b'),_0x4ba854[_0xd5f3('0x4c')]),_0x261cfc);}};exports[_0xd5f3('0x61')]=function(_0xccdd7f){try{if(!_[_0xd5f3('0x1a')](queues[_0xccdd7f['uniqueid']])){utils['debug'](util['format']('[%s][queues][musiconholdstart]',_0xccdd7f['uniqueid']),_0xccdd7f);queues[_0xccdd7f[_0xd5f3('0x6')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0xd5f3('0x4')](_0xd5f3('0x62'),_0xccdd7f[_0xd5f3('0x6')],queues[_0xccdd7f[_0xd5f3('0x6')]][_0xd5f3('0x23')],queues[_0xccdd7f[_0xd5f3('0x6')]]['musiconholdstartAt']));}}catch(_0x317ebb){utils['error'](util[_0xd5f3('0x4')](_0xd5f3('0x63'),_0xccdd7f[_0xd5f3('0x6')]),_0x317ebb);}};exports['musiconholdstop']=function(_0x52cf67){try{if(!_['isNil'](queues[_0x52cf67[_0xd5f3('0x6')]])){if(!_['isNil'](queues[_0x52cf67[_0xd5f3('0x6')]][_0xd5f3('0x64')])){utils[_0xd5f3('0x12')](util[_0xd5f3('0x4')](_0xd5f3('0x65'),_0x52cf67[_0xd5f3('0x6')]),_0x52cf67);queues[_0x52cf67[_0xd5f3('0x6')]]['mohtime']+=utils[_0xd5f3('0x66')](utils[_0xd5f3('0x17')](),queues[_0x52cf67[_0xd5f3('0x6')]][_0xd5f3('0x64')]);utils['info'](util[_0xd5f3('0x4')](_0xd5f3('0x67'),_0x52cf67[_0xd5f3('0x6')],queues[_0x52cf67[_0xd5f3('0x6')]][_0xd5f3('0x23')],queues[_0x52cf67[_0xd5f3('0x6')]][_0xd5f3('0x58')]));delete queues[_0x52cf67['uniqueid']][_0xd5f3('0x64')];}}}catch(_0xe8ac70){utils[_0xd5f3('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x52cf67[_0xd5f3('0x6')]),_0xe8ac70);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index cc77caa..a49a2d5 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 _0xaec3=['isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','info','format','uniqueid','blinds','transfereeuniqueid','getUserByInternal','then','membername','name','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','accountcode','channel','error','newstate','[%s][recordings][newstate]'];(function(_0x52a0af,_0xfd174d){var _0x4eb75d=function(_0x5e4922){while(--_0x5e4922){_0x52a0af['push'](_0x52a0af['shift']());}};_0x4eb75d(++_0xfd174d);}(_0xaec3,0x187));var _0x3aec=function(_0x2ea631,_0x340325){_0x2ea631=_0x2ea631-0x0;var _0x356308=_0xaec3[_0x2ea631];return _0x356308;};'use strict';var _=require(_0x3aec('0x0'));var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x725e7f){var _0x4b78fa;utils[_0x3aec('0x1')](util[_0x3aec('0x2')]('[%s][recordings][writeDB]',_0x725e7f[_0x3aec('0x3')]));if(transfers['blinds'][_0x725e7f[_0x3aec('0x3')]]){_0x4b78fa=_0x725e7f[_0x3aec('0x3')];_0x725e7f[_0x3aec('0x3')]=transfers[_0x3aec('0x4')][_0x725e7f[_0x3aec('0x3')]][_0x3aec('0x5')];}if(_0x725e7f['accountcode']){utils[_0x3aec('0x6')](_0x725e7f['accountcode'])[_0x3aec('0x7')](function(_0x3c0969){if(_0x3c0969){_0x725e7f[_0x3aec('0x8')]=_0x3c0969[_0x3aec('0x9')];_0x725e7f['UserId']=_0x3c0969['id'];}utils['request'](_0x3aec('0xa'),_0x725e7f);});}else{utils[_0x3aec('0xb')](_0x3aec('0xa'),_0x725e7f);}if(_0x4b78fa)delete transfers[_0x3aec('0x4')][_0x4b78fa];}exports[_0x3aec('0xc')]=function(_0x4119e9){try{utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0xe'),_0x4119e9[_0x3aec('0x3')]),_0x4119e9);if(_0x4119e9[_0x3aec('0x3')]==_0x4119e9[_0x3aec('0xf')]){utils[_0x3aec('0x1')](util[_0x3aec('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x4119e9['uniqueid'],_0x4119e9[_0x3aec('0x10')],_0x4119e9[_0x3aec('0x11')]));recordings[_0x4119e9[_0x3aec('0x3')]]={'uniqueid':_0x4119e9[_0x3aec('0x3')],'accountcode':_0x4119e9[_0x3aec('0x12')],'exten':_0x4119e9[_0x3aec('0x11')],'context':_0x4119e9[_0x3aec('0x10')],'channel':_0x4119e9[_0x3aec('0x13')],'monitors':[]};}}catch(_0x358edf){utils[_0x3aec('0x14')](util[_0x3aec('0x2')](_0x3aec('0xe'),_0x4119e9[_0x3aec('0x3')]),_0x358edf);}};exports[_0x3aec('0x15')]=function(_0x1e47ae){try{utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0x16'),_0x1e47ae[_0x3aec('0x3')]),_0x1e47ae);if(!_[_0x3aec('0x17')](recordings[_0x1e47ae[_0x3aec('0x3')]])&&_0x1e47ae[_0x3aec('0x18')]==0x6){utils[_0x3aec('0x1')](util[_0x3aec('0x2')](_0x3aec('0x19'),_0x1e47ae[_0x3aec('0x3')],_0x1e47ae[_0x3aec('0x10')],_0x1e47ae[_0x3aec('0x13')]));}else if(!_[_0x3aec('0x17')](recordings[_0x1e47ae['linkedid']])&&_0x1e47ae['channelstate']==0x6&&_0x1e47ae[_0x3aec('0x10')]!='transfer'){utils[_0x3aec('0x1')](util[_0x3aec('0x2')](_0x3aec('0x1a'),_0x1e47ae['uniqueid'],_0x1e47ae[_0x3aec('0xf')],_0x1e47ae[_0x3aec('0x10')],_0x1e47ae[_0x3aec('0x13')]));recordings[_0x1e47ae[_0x3aec('0xf')]][_0x3aec('0x12')]=_0x1e47ae[_0x3aec('0x12')];}}catch(_0x4a99ef){utils[_0x3aec('0x14')](util[_0x3aec('0x2')]('[%s][recordings][newstate]',_0x1e47ae[_0x3aec('0x3')]),_0x4a99ef);}};exports[_0x3aec('0x1b')]=function(_0xe16196){try{if(!_['isNil'](_0xe16196[_0x3aec('0x1c')])&&!_[_0x3aec('0x17')](_0xe16196[_0x3aec('0x1c')]['mixmonitor_filename'])){utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0x1d'),_0xe16196[_0x3aec('0x3')]),_0xe16196);utils[_0x3aec('0x1')](util[_0x3aec('0x2')](_0x3aec('0x1e'),_0xe16196['uniqueid'],_0xe16196[_0x3aec('0x1c')],_0xe16196['value']));if(_['endsWith'](_0xe16196[_0x3aec('0x1f')],_0x3aec('0x20'))){_0xe16196[_0x3aec('0x1f')]=_0xe16196['value'][_0x3aec('0x21')]('.wav49','.WAV');}if(recordings[_0xe16196[_0x3aec('0xf')]]){var _0x5b6aeb=_[_0x3aec('0x22')](recordings[_0xe16196[_0x3aec('0xf')]]['monitors'],{'value':_0xe16196[_0x3aec('0x1f')]});if(_[_0x3aec('0x17')](_0x5b6aeb)){recordings[_0xe16196[_0x3aec('0xf')]][_0x3aec('0x23')][_0x3aec('0x24')]({'value':_0xe16196[_0x3aec('0x1f')]});}}}}catch(_0x588240){utils['error'](util[_0x3aec('0x2')](_0x3aec('0x1d'),_0xe16196['uniqueid']),_0x588240);}};exports[_0x3aec('0x25')]=function(_0x3a2aab){try{if(!_[_0x3aec('0x17')](recordings[_0x3a2aab[_0x3aec('0x3')]])){utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0x26'),_0x3a2aab['uniqueid']),_0x3a2aab);utils[_0x3aec('0x1')](util['format'](_0x3aec('0x27'),_0x3a2aab[_0x3aec('0x3')],_0x3a2aab['calleridnum'],_0x3a2aab[_0x3aec('0x28')],_0x3a2aab[_0x3aec('0x29')]));recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2a')]=_0x3a2aab[_0x3aec('0x2a')];recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x28')]=_0x3a2aab['calleridname'];recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2b')]=_0x3a2aab['connectedlinenum'];recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2c')]=_0x3a2aab[_0x3aec('0x2c')];if(recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2d')]==_0x3aec('0x2e')&&recordings[_0x3a2aab['uniqueid']][_0x3aec('0x12')]){recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2b')]=recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x12')];recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x2c')]='';}recordings[_0x3a2aab[_0x3aec('0x3')]][_0x3aec('0x23')][_0x3aec('0x2f')](function(_0x263802){var _0x3195c3=_['clone'](recordings[_0x3a2aab[_0x3aec('0x3')]]);_0x3195c3[_0x3aec('0x1f')]=_0x263802[_0x3aec('0x1f')];writeDB(_0x3195c3);});delete recordings[_0x3a2aab[_0x3aec('0x3')]];}}catch(_0x4bfd62){utils['error'](util[_0x3aec('0x2')]('[%s][recordings][hangup]',_0x3a2aab['uniqueid']),_0x4bfd62);}};exports['newexten']=function(_0x4c8f57){try{if(!_['isNil'](recordings[_0x4c8f57[_0x3aec('0x3')]])){utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0x30'),_0x4c8f57[_0x3aec('0x3')]),_0x4c8f57);utils['info'](util['format'](_0x3aec('0x31'),_0x4c8f57['uniqueid'],_0x4c8f57['application'],_0x4c8f57['appdata']));if(_0x4c8f57[_0x3aec('0x32')][_0x3aec('0x33')]()==_0x3aec('0x34')&&_[_0x3aec('0x35')](_0x4c8f57[_0x3aec('0x36')]['toLowerCase'](),_0x3aec('0x37'))){var _0x5d2317=_0x4c8f57[_0x3aec('0x36')]['split']('=');var _0x254a82=_0x5d2317[0x0][_0x3aec('0x38')](_0x5d2317[0x0][_0x3aec('0x39')]('(')+0x1,_0x5d2317[0x0][_0x3aec('0x39')](')'));var _0x49abf2=_0x5d2317[0x1];recordings[_0x4c8f57[_0x3aec('0x3')]][_0x254a82]=_0x49abf2;}}}catch(_0x5da152){utils[_0x3aec('0x14')](util['format']('[%s][recordings][newexten]',_0x4c8f57[_0x3aec('0x3')]),_0x5da152);}};exports['queuecallerjoin']=function(_0x1f7947){try{if(!_[_0x3aec('0x17')](recordings[_0x1f7947['uniqueid']])){utils[_0x3aec('0xd')](util[_0x3aec('0x2')](_0x3aec('0x3a'),_0x1f7947[_0x3aec('0x3')]),_0x1f7947);utils[_0x3aec('0x1')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1f7947[_0x3aec('0x3')],_0x1f7947[_0x3aec('0x3b')]));recordings[_0x1f7947['uniqueid']][_0x3aec('0x3b')]=_0x1f7947['queue'];}}catch(_0x534dd3){utils['error'](util['format'](_0x3aec('0x3a'),_0x1f7947[_0x3aec('0x3')]),_0x534dd3);}};exports[_0x3aec('0x3c')]=function(_0x1f1a45){try{utils['debug'](util[_0x3aec('0x2')](_0x3aec('0x3d'),_0x1f1a45[_0x3aec('0x3')]),_0x1f1a45);utils[_0x3aec('0x1')](util[_0x3aec('0x2')](_0x3aec('0x3e'),_0x1f1a45[_0x3aec('0x3')],_0x1f1a45[_0x3aec('0x3f')],_0x1f1a45[_0x3aec('0x40')],_0x1f1a45[_0x3aec('0x41')],_0x1f1a45[_0x3aec('0x42')]));if(recordings[_0x1f1a45['transfereruniqueid']]&&transfers['blinds'][_0x1f1a45[_0x3aec('0x43')]]){transfers['blinds'][_0x1f1a45['transfereruniqueid']][_0x3aec('0x44')]=!![];}}catch(_0x319086){utils[_0x3aec('0x14')](util[_0x3aec('0x2')](_0x3aec('0x3d'),_0x1f1a45[_0x3aec('0x3')]),_0x319086);}}; \ No newline at end of file +var _0xe79e=['clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound'];(function(_0xf56f13,_0x104d7e){var _0x5191e5=function(_0x1431ba){while(--_0x1431ba){_0xf56f13['push'](_0xf56f13['shift']());}};_0x5191e5(++_0x104d7e);}(_0xe79e,0x13b));var _0xee79=function(_0x43438b,_0x58d859){_0x43438b=_0x43438b-0x0;var _0x4fcb2d=_0xe79e[_0x43438b];return _0x4fcb2d;};'use strict';var _=require(_0xee79('0x0'));var util=require(_0xee79('0x1'));var utils=require(_0xee79('0x2'));var transfers=require(_0xee79('0x3'));var recordings={};function writeDB(_0x1f1137){var _0x43a903;utils['info'](util[_0xee79('0x4')](_0xee79('0x5'),_0x1f1137[_0xee79('0x6')]));if(transfers[_0xee79('0x7')][_0x1f1137[_0xee79('0x6')]]){_0x43a903=_0x1f1137[_0xee79('0x6')];_0x1f1137[_0xee79('0x6')]=transfers[_0xee79('0x7')][_0x1f1137['uniqueid']][_0xee79('0x8')];}if(_0x1f1137[_0xee79('0x9')]){utils[_0xee79('0xa')](_0x1f1137['accountcode'])['then'](function(_0x41d1b4){if(_0x41d1b4){_0x1f1137[_0xee79('0xb')]=_0x41d1b4[_0xee79('0xc')];_0x1f1137[_0xee79('0xd')]=_0x41d1b4['id'];}utils[_0xee79('0xe')](_0xee79('0xf'),_0x1f1137);});}else{utils[_0xee79('0xe')]('CreateVoiceRecording',_0x1f1137);}if(_0x43a903)delete transfers[_0xee79('0x7')][_0x43a903];}exports[_0xee79('0x10')]=function(_0x4d9470){try{utils[_0xee79('0x11')](util[_0xee79('0x4')](_0xee79('0x12'),_0x4d9470[_0xee79('0x6')]),_0x4d9470);if(_0x4d9470[_0xee79('0x6')]==_0x4d9470[_0xee79('0x13')]){utils[_0xee79('0x14')](util[_0xee79('0x4')](_0xee79('0x15'),_0x4d9470[_0xee79('0x6')],_0x4d9470[_0xee79('0x16')],_0x4d9470[_0xee79('0x17')]));recordings[_0x4d9470[_0xee79('0x6')]]={'uniqueid':_0x4d9470[_0xee79('0x6')],'accountcode':_0x4d9470[_0xee79('0x9')],'exten':_0x4d9470['exten'],'context':_0x4d9470[_0xee79('0x16')],'channel':_0x4d9470[_0xee79('0x18')],'monitors':[]};}}catch(_0x17f2bb){utils[_0xee79('0x19')](util[_0xee79('0x4')](_0xee79('0x12'),_0x4d9470[_0xee79('0x6')]),_0x17f2bb);}};exports[_0xee79('0x1a')]=function(_0x2d6edc){try{utils['debug'](util[_0xee79('0x4')](_0xee79('0x1b'),_0x2d6edc['uniqueid']),_0x2d6edc);if(!_[_0xee79('0x1c')](recordings[_0x2d6edc[_0xee79('0x6')]])&&_0x2d6edc[_0xee79('0x1d')]==0x6){utils['info'](util[_0xee79('0x4')](_0xee79('0x1e'),_0x2d6edc[_0xee79('0x6')],_0x2d6edc[_0xee79('0x16')],_0x2d6edc[_0xee79('0x18')]));}else if(!_[_0xee79('0x1c')](recordings[_0x2d6edc[_0xee79('0x13')]])&&_0x2d6edc['channelstate']==0x6&&_0x2d6edc[_0xee79('0x16')]!=_0xee79('0x1f')){utils['info'](util[_0xee79('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2d6edc[_0xee79('0x6')],_0x2d6edc['linkedid'],_0x2d6edc['context'],_0x2d6edc[_0xee79('0x18')]));recordings[_0x2d6edc['linkedid']]['accountcode']=_0x2d6edc[_0xee79('0x9')];}}catch(_0x7cec94){utils[_0xee79('0x19')](util[_0xee79('0x4')]('[%s][recordings][newstate]',_0x2d6edc['uniqueid']),_0x7cec94);}};exports[_0xee79('0x20')]=function(_0x542355){try{if(!_['isNil'](_0x542355['variable'])&&!_['isNil'](_0x542355[_0xee79('0x21')]['mixmonitor_filename'])){utils['debug'](util[_0xee79('0x4')]('[%s][recordings][varset]',_0x542355['uniqueid']),_0x542355);utils[_0xee79('0x14')](util[_0xee79('0x4')](_0xee79('0x22'),_0x542355[_0xee79('0x6')],_0x542355[_0xee79('0x21')],_0x542355[_0xee79('0x23')]));if(_[_0xee79('0x24')](_0x542355[_0xee79('0x23')],_0xee79('0x25'))){_0x542355[_0xee79('0x23')]=_0x542355['value'][_0xee79('0x26')](_0xee79('0x25'),_0xee79('0x27'));}if(recordings[_0x542355[_0xee79('0x13')]]){var _0x41784c=_['find'](recordings[_0x542355[_0xee79('0x13')]][_0xee79('0x28')],{'value':_0x542355['value']});if(_['isNil'](_0x41784c)){recordings[_0x542355[_0xee79('0x13')]]['monitors'][_0xee79('0x29')]({'value':_0x542355[_0xee79('0x23')]});}}}}catch(_0x35b5ff){utils[_0xee79('0x19')](util[_0xee79('0x4')]('[%s][recordings][varset]',_0x542355[_0xee79('0x6')]),_0x35b5ff);}};exports['hangup']=function(_0x2b8e3d){try{if(!_['isNil'](recordings[_0x2b8e3d[_0xee79('0x6')]])){utils[_0xee79('0x11')](util[_0xee79('0x4')](_0xee79('0x2a'),_0x2b8e3d['uniqueid']),_0x2b8e3d);utils[_0xee79('0x14')](util[_0xee79('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x2b8e3d[_0xee79('0x6')],_0x2b8e3d[_0xee79('0x2b')],_0x2b8e3d[_0xee79('0x2c')],_0x2b8e3d[_0xee79('0x2d')]));recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x2b')]=_0x2b8e3d[_0xee79('0x2b')];recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x2c')]=_0x2b8e3d[_0xee79('0x2c')];recordings[_0x2b8e3d[_0xee79('0x6')]]['connectedlinenum']=_0x2b8e3d[_0xee79('0x2e')];recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x2f')]=_0x2b8e3d[_0xee79('0x2f')];if(recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x30')]==_0xee79('0x31')&&recordings[_0x2b8e3d[_0xee79('0x6')]]['accountcode']){recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x2e')]=recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x9')];recordings[_0x2b8e3d[_0xee79('0x6')]][_0xee79('0x2f')]='';}recordings[_0x2b8e3d['uniqueid']][_0xee79('0x28')]['forEach'](function(_0x309bf6){var _0x1c6a1f=_[_0xee79('0x32')](recordings[_0x2b8e3d[_0xee79('0x6')]]);_0x1c6a1f[_0xee79('0x23')]=_0x309bf6[_0xee79('0x23')];writeDB(_0x1c6a1f);});delete recordings[_0x2b8e3d[_0xee79('0x6')]];}}catch(_0x1e1e71){utils[_0xee79('0x19')](util[_0xee79('0x4')](_0xee79('0x2a'),_0x2b8e3d[_0xee79('0x6')]),_0x1e1e71);}};exports[_0xee79('0x33')]=function(_0x4ba8d0){try{if(!_['isNil'](recordings[_0x4ba8d0[_0xee79('0x6')]])){utils[_0xee79('0x11')](util[_0xee79('0x4')](_0xee79('0x34'),_0x4ba8d0[_0xee79('0x6')]),_0x4ba8d0);utils[_0xee79('0x14')](util[_0xee79('0x4')](_0xee79('0x35'),_0x4ba8d0[_0xee79('0x6')],_0x4ba8d0[_0xee79('0x36')],_0x4ba8d0['appdata']));if(_0x4ba8d0[_0xee79('0x36')][_0xee79('0x37')]()=='set'&&_[_0xee79('0x38')](_0x4ba8d0[_0xee79('0x39')][_0xee79('0x37')](),_0xee79('0x3a'))){var _0x34f324=_0x4ba8d0[_0xee79('0x39')][_0xee79('0x3b')]('=');var _0x208195=_0x34f324[0x0][_0xee79('0x3c')](_0x34f324[0x0][_0xee79('0x3d')]('(')+0x1,_0x34f324[0x0][_0xee79('0x3d')](')'));var _0x91c51f=_0x34f324[0x1];recordings[_0x4ba8d0[_0xee79('0x6')]][_0x208195]=_0x91c51f;}}}catch(_0x42de1b){utils[_0xee79('0x19')](util['format']('[%s][recordings][newexten]',_0x4ba8d0[_0xee79('0x6')]),_0x42de1b);}};exports[_0xee79('0x3e')]=function(_0x203b39){try{if(!_['isNil'](recordings[_0x203b39[_0xee79('0x6')]])){utils['debug'](util[_0xee79('0x4')]('[%s][recordings][queuecallerjoin]',_0x203b39[_0xee79('0x6')]),_0x203b39);utils[_0xee79('0x14')](util[_0xee79('0x4')](_0xee79('0x3f'),_0x203b39[_0xee79('0x6')],_0x203b39[_0xee79('0x40')]));recordings[_0x203b39[_0xee79('0x6')]]['queue']=_0x203b39[_0xee79('0x40')];}}catch(_0x6fbf){utils[_0xee79('0x19')](util[_0xee79('0x4')]('[%s][recordings][queuecallerjoin]',_0x203b39['uniqueid']),_0x6fbf);}};exports[_0xee79('0x41')]=function(_0x55827a){try{utils[_0xee79('0x11')](util[_0xee79('0x4')]('[%s][recordings][blindtransfer]',_0x55827a[_0xee79('0x6')]),_0x55827a);utils[_0xee79('0x14')](util[_0xee79('0x4')](_0xee79('0x42'),_0x55827a['uniqueid'],_0x55827a[_0xee79('0x43')],_0x55827a[_0xee79('0x44')],_0x55827a[_0xee79('0x45')],_0x55827a[_0xee79('0x46')]));if(recordings[_0x55827a['transfereruniqueid']]&&transfers[_0xee79('0x7')][_0x55827a[_0xee79('0x47')]]){transfers['blinds'][_0x55827a[_0xee79('0x47')]]['recording']=!![];}}catch(_0x33d80b){utils[_0xee79('0x19')](util[_0xee79('0x4')](_0xee79('0x48'),_0x55827a[_0xee79('0x6')]),_0x33d80b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8607016..812066a 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 _0x09dd=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','assign','origtransferercalleridnum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x14d1f2,_0x4e1ebb){var _0x32dc59=function(_0x481c55){while(--_0x481c55){_0x14d1f2['push'](_0x14d1f2['shift']());}};_0x32dc59(++_0x4e1ebb);}(_0x09dd,0xf3));var _0xd09d=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x09dd[_0x18a81a];return _0x114027;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var utils=require('./utils');function writeDB(_0x350a64){utils[_0xd09d('0x2')](util[_0xd09d('0x3')](_0xd09d('0x4'),_0x350a64[_0xd09d('0x5')]===_0xd09d('0x6')?_0x350a64[_0xd09d('0x7')]:_0x350a64[_0xd09d('0x8')],_0x350a64[_0xd09d('0x5')]));utils[_0xd09d('0x9')](_0xd09d('0xa'),_0x350a64);}exports[_0xd09d('0xb')]={};exports[_0xd09d('0xc')]=function(_0x3ce63a){try{utils[_0xd09d('0xd')](util[_0xd09d('0x3')](_0xd09d('0xe'),_0x3ce63a['uniqueid']),_0x3ce63a);utils['info'](util[_0xd09d('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3ce63a[_0xd09d('0x8')],_0x3ce63a[_0xd09d('0xf')],_0x3ce63a[_0xd09d('0x10')],_0x3ce63a[_0xd09d('0x11')],_0x3ce63a[_0xd09d('0x12')]));_0x3ce63a[_0xd09d('0x5')]=_0xd09d('0x13');exports[_0xd09d('0xb')][_0x3ce63a[_0xd09d('0x14')]]=_0x3ce63a;writeDB(_0x3ce63a);}catch(_0x34dccb){utils[_0xd09d('0x15')](util[_0xd09d('0x3')](_0xd09d('0xe'),_0x3ce63a['uniqueid']),_0x34dccb);}};exports['attendedtransfer']=function(_0x4d5ccd){try{utils[_0xd09d('0xd')](util[_0xd09d('0x3')](_0xd09d('0x16'),_0x4d5ccd[_0xd09d('0x7')]),_0x4d5ccd);utils[_0xd09d('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4d5ccd[_0xd09d('0x7')],_0x4d5ccd['origtransferercalleridnum'],_0x4d5ccd[_0xd09d('0x17')],_0x4d5ccd[_0xd09d('0x18')],_0x4d5ccd['transfertargetcalleridname']));_0x4d5ccd=_[_0xd09d('0x19')](_0x4d5ccd,{'transfererchannel':_0x4d5ccd['origtransfererchannel'],'transferercalleridnum':_0x4d5ccd[_0xd09d('0x1a')],'transferercalleridname':_0x4d5ccd[_0xd09d('0x17')],'transfererconnectedlinenum':_0x4d5ccd['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4d5ccd[_0xd09d('0x1b')],'transfereraccountcode':_0x4d5ccd['origtransfereraccountcode'],'transferercontext':_0x4d5ccd['secondtransferercontext'],'transfererexten':_0x4d5ccd[_0xd09d('0x1c')],'transfererlinkedid':_0x4d5ccd[_0xd09d('0x1d')],'context':_0x4d5ccd['origtransferercontext'],'extension':_0x4d5ccd['origtransfererexten'],'type':_0xd09d('0x6')});if(_[_0xd09d('0x1e')](_0x4d5ccd[_0xd09d('0x1f')])){_0x4d5ccd=_[_0xd09d('0x19')](_0x4d5ccd,{'transfereechannel':_0x4d5ccd[_0xd09d('0x20')],'transfereecalleridnum':_0x4d5ccd[_0xd09d('0x18')],'transfereecalleridname':_0x4d5ccd[_0xd09d('0x21')],'transfereeconnectedlinenum':_0x4d5ccd[_0xd09d('0x22')],'transfereeconnectedlinename':_0x4d5ccd[_0xd09d('0x23')],'transfereeaccountcode':_0x4d5ccd[_0xd09d('0x24')],'transfereecontext':_0x4d5ccd[_0xd09d('0x25')],'transfereeexten':_0x4d5ccd[_0xd09d('0x26')],'transfereelinkedid':_0x4d5ccd[_0xd09d('0x27')]});}writeDB(_0x4d5ccd);}catch(_0x5e95d7){utils[_0xd09d('0x15')](util[_0xd09d('0x3')](_0xd09d('0x16'),_0x4d5ccd['origtransfereruniqueid']),_0x5e95d7);}}; \ No newline at end of file +var _0x96af=['format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','blinds','debug','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils'];(function(_0x4a3b02,_0x3f5b31){var _0x40d53c=function(_0x792cc7){while(--_0x792cc7){_0x4a3b02['push'](_0x4a3b02['shift']());}};_0x40d53c(++_0x3f5b31);}(_0x96af,0xd5));var _0xf96a=function(_0x3253f3,_0x1c57d8){_0x3253f3=_0x3253f3-0x0;var _0x598c26=_0x96af[_0x3253f3];return _0x598c26;};'use strict';var _=require(_0xf96a('0x0'));var util=require(_0xf96a('0x1'));var utils=require(_0xf96a('0x2'));function writeDB(_0x257017){utils['info'](util[_0xf96a('0x3')](_0xf96a('0x4'),_0x257017['type']===_0xf96a('0x5')?_0x257017[_0xf96a('0x6')]:_0x257017[_0xf96a('0x7')],_0x257017[_0xf96a('0x8')]));utils[_0xf96a('0x9')]('CreateVoiceTransferReport',_0x257017);}exports[_0xf96a('0xa')]={};exports['blindtransfer']=function(_0x323815){try{utils[_0xf96a('0xb')](util[_0xf96a('0x3')]('[%s][transfers][blindtransfer]',_0x323815[_0xf96a('0x7')]),_0x323815);utils[_0xf96a('0xc')](util[_0xf96a('0x3')](_0xf96a('0xd'),_0x323815[_0xf96a('0x7')],_0x323815[_0xf96a('0xe')],_0x323815[_0xf96a('0xf')],_0x323815[_0xf96a('0x10')],_0x323815['transfereecalleridname']));_0x323815[_0xf96a('0x8')]=_0xf96a('0x11');exports['blinds'][_0x323815[_0xf96a('0x12')]]=_0x323815;writeDB(_0x323815);}catch(_0xa445c8){utils['error'](util[_0xf96a('0x3')]('[%s][transfers][blindtransfer]',_0x323815[_0xf96a('0x7')]),_0xa445c8);}};exports['attendedtransfer']=function(_0x404fcb){try{utils['debug'](util[_0xf96a('0x3')](_0xf96a('0x13'),_0x404fcb[_0xf96a('0x6')]),_0x404fcb);utils[_0xf96a('0xc')](util['format'](_0xf96a('0x14'),_0x404fcb[_0xf96a('0x6')],_0x404fcb['origtransferercalleridnum'],_0x404fcb['origtransferercalleridname'],_0x404fcb[_0xf96a('0x15')],_0x404fcb['transfertargetcalleridname']));_0x404fcb=_[_0xf96a('0x16')](_0x404fcb,{'transfererchannel':_0x404fcb['origtransfererchannel'],'transferercalleridnum':_0x404fcb[_0xf96a('0x17')],'transferercalleridname':_0x404fcb[_0xf96a('0x18')],'transfererconnectedlinenum':_0x404fcb['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x404fcb[_0xf96a('0x19')],'transfereraccountcode':_0x404fcb[_0xf96a('0x1a')],'transferercontext':_0x404fcb[_0xf96a('0x1b')],'transfererexten':_0x404fcb[_0xf96a('0x1c')],'transfererlinkedid':_0x404fcb[_0xf96a('0x1d')],'context':_0x404fcb['origtransferercontext'],'extension':_0x404fcb[_0xf96a('0x1e')],'type':_0xf96a('0x5')});if(_['isNil'](_0x404fcb['transfereechannel'])){_0x404fcb=_[_0xf96a('0x16')](_0x404fcb,{'transfereechannel':_0x404fcb['transfertargetchannel'],'transfereecalleridnum':_0x404fcb[_0xf96a('0x15')],'transfereecalleridname':_0x404fcb['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x404fcb[_0xf96a('0x1f')],'transfereeconnectedlinename':_0x404fcb['transfertargetconnectedlinename'],'transfereeaccountcode':_0x404fcb[_0xf96a('0x20')],'transfereecontext':_0x404fcb['transfertargetcontext'],'transfereeexten':_0x404fcb[_0xf96a('0x21')],'transfereelinkedid':_0x404fcb[_0xf96a('0x22')]});}writeDB(_0x404fcb);}catch(_0x5d0e4d){utils[_0xf96a('0x23')](util[_0xf96a('0x3')](_0xf96a('0x13'),_0x404fcb['origtransfereruniqueid']),_0x5d0e4d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 7cdb898..d8ab67c 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 _0xb01a=['diffTime','diff','now','isAfter','isBefore','bluebird','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract'];(function(_0x103170,_0x1dffb6){var _0x447aa7=function(_0x4b2a74){while(--_0x4b2a74){_0x103170['push'](_0x103170['shift']());}};_0x447aa7(++_0x1dffb6);}(_0xb01a,0x124));var _0xab01=function(_0x589162,_0x1e8537){_0x589162=_0x589162-0x0;var _0x2826e6=_0xb01a[_0x589162];return _0x2826e6;};'use strict';var BPromise=require(_0xab01('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0xab01('0x1'));var client=jayson[_0xab01('0x2')]['http']({'port':0x2329});var logger=require(_0xab01('0x3'))('xdr');exports['info']=function(_0x34e57b,_0x530c06){logger[_0xab01('0x4')](_0x34e57b,_0x530c06?util[_0xab01('0x5')](_0x530c06,{'showHidden':![],'depth':null}):'');};exports[_0xab01('0x6')]=function(_0x1ec418,_0x346a3b){logger[_0xab01('0x6')](_0x1ec418,_0x346a3b?util[_0xab01('0x5')](_0x346a3b,{'showHidden':![],'depth':null}):'');};exports[_0xab01('0x7')]=function(_0x52a216,_0x2ca37e){logger[_0xab01('0x7')](_0x52a216,_0x2ca37e?util[_0xab01('0x5')](_0x2ca37e,{'showHidden':![],'depth':null}):'');};exports[_0xab01('0x8')]=function(_0x3f732e,_0x2c9570){return client[_0xab01('0x8')](_0x3f732e,{'body':_0x2c9570})[_0xab01('0x9')](function(_0x1c1d5c){logger[_0xab01('0x6')](_0xab01('0xa'),_0x3f732e,_0x1c1d5c?util['inspect'](_0x1c1d5c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x511afc){logger[_0xab01('0x7')](_0xab01('0xa'),_0x3f732e,_0x511afc?util['inspect'](_0x511afc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e7056){return client[_0xab01('0x8')](_0xab01('0xb'),{'options':{'raw':!![],'attributes':['id',_0xab01('0xc'),_0xab01('0xd'),_0xab01('0xe')],'where':_0x5e7056,'limit':0x1}})['then'](function(_0x45ba2e){logger[_0xab01('0x6')](_0xab01('0xf'),JSON['stringify'](_0x5e7056),_0x45ba2e?util[_0xab01('0x5')](_0x45ba2e,{'showHidden':![],'depth':null}):'');return _0x45ba2e['result'][_0xab01('0x10')]?_0x45ba2e[_0xab01('0x11')][0x0]:null;});}exports[_0xab01('0x12')]=function(_0x1f11f7){return new BPromise(function(_0x2aa6b5,_0x70eae8){if(_0x1f11f7){return getUser({'internal':_0x1f11f7})['then'](function(_0x37a895){logger[_0xab01('0x4')](_0xab01('0x13'),_0x1f11f7,_0x37a895?_0xab01('0x14'):'notfound');return _0x2aa6b5(_0x37a895);})[_0xab01('0x15')](function(_0x1525c8){logger['error'](_0xab01('0x16'),_0x1525c8?util[_0xab01('0x5')](_0x1525c8,{'showHidden':![],'depth':null}):'');return _0x2aa6b5(null);});}return _0x2aa6b5(null);});};exports['getUserByInterface']=function(_0x3def4c){return new BPromise(function(_0x4ebe9a,_0x92b5cf){if(_0x3def4c){return getUser({'interface':_0x3def4c})[_0xab01('0x9')](function(_0x295bfa){logger[_0xab01('0x4')](_0xab01('0x17'),_0x3def4c,_0x295bfa?_0xab01('0x14'):_0xab01('0x18'));return _0x4ebe9a(_0x295bfa);})[_0xab01('0x15')](function(_0x389478){logger[_0xab01('0x7')](_0xab01('0x19'),_0x389478?util['inspect'](_0x389478,{'showHidden':![],'depth':null}):'');return _0x4ebe9a(null);});}return _0x4ebe9a(null);});};exports[_0xab01('0x1a')]=function(_0x48b726){return new BPromise(function(_0x39a3f2,_0x2efc38){if(_0x48b726){return getUser({'name':_0x48b726})[_0xab01('0x9')](function(_0xe0541){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x48b726,_0xe0541?_0xab01('0x14'):'notfound');return _0x39a3f2(_0xe0541);})['catch'](function(_0x2e5745){logger[_0xab01('0x7')](_0xab01('0x1b'),_0x2e5745?util[_0xab01('0x5')](_0x2e5745,{'showHidden':![],'depth':null}):'');return _0x39a3f2(null);});}return _0x39a3f2(null);});};exports['getVoiceQueueByName']=function(_0x2f6d12){return new BPromise(function(_0x1204da,_0x2b961c){if(_0x2f6d12){return client[_0xab01('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xab01('0xd'),_0xab01('0x1c'),'acw','acwTimeout'],'where':{'name':_0x2f6d12},'limit':0x1}})[_0xab01('0x9')](function(_0x219e16){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x2f6d12,_0x219e16?util[_0xab01('0x5')](_0x219e16,{'showHidden':![],'depth':null}):'');logger[_0xab01('0x4')](_0xab01('0x1d'),_0x2f6d12,_0x219e16?_0xab01('0x14'):_0xab01('0x18'));return _0x1204da(_0x219e16['result']['length']?_0x219e16[_0xab01('0x11')][0x0]:null);})['catch'](function(_0x10d842){logger[_0xab01('0x7')]('[utils][getVoiceQueueByName]',_0x10d842?util[_0xab01('0x5')](_0x10d842,{'showHidden':![],'depth':null}):'');return _0x1204da(null);});}return _0x1204da(null);});};exports['addTime']=function(_0x3d7a60,_0x4270ab){return moment(_0x3d7a60)[_0xab01('0x1e')](_0x4270ab,_0xab01('0x1f'))[_0xab01('0x20')](_0xab01('0x21'));};exports[_0xab01('0x22')]=function(_0x176f05,_0x43b108){return moment(_0x176f05)[_0xab01('0x23')](_0x43b108,_0xab01('0x1f'))[_0xab01('0x20')](_0xab01('0x21'));};exports[_0xab01('0x24')]=function(_0x556e3a,_0x38ed7d){return moment(_0x556e3a)[_0xab01('0x25')](moment(_0x38ed7d),'seconds');};exports['sumTime']=function(_0xe7b76,_0x2579b2){return parseInt(_0xe7b76,0xa)+parseInt(_0x2579b2,0xa);};exports[_0xab01('0x26')]=function(){return moment()[_0xab01('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xab01('0x27')]=function(_0x340a6a,_0x110e6f){if(_0x110e6f){return moment(_0x340a6a)['isAfter'](_0x110e6f);}return!![];};exports[_0xab01('0x28')]=function(_0x31c2af,_0x41318f){if(_0x41318f){return moment(_0x31c2af)['isBefore'](_0x41318f);}else if(_0x31c2af){return!![];}return![];}; \ No newline at end of file +var _0x1590=['sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','length','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1590,0x154));var _0x0159=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1590[_0x27af45];return _0x18df21;};'use strict';var BPromise=require(_0x0159('0x0'));var jayson=require(_0x0159('0x1'));var moment=require('moment');var util=require(_0x0159('0x2'));var client=jayson[_0x0159('0x3')][_0x0159('0x4')]({'port':0x2329});var logger=require(_0x0159('0x5'))(_0x0159('0x6'));exports['info']=function(_0x880d7,_0x25b431){logger[_0x0159('0x7')](_0x880d7,_0x25b431?util[_0x0159('0x8')](_0x25b431,{'showHidden':![],'depth':null}):'');};exports[_0x0159('0x9')]=function(_0x2f43df,_0x52dae5){logger['debug'](_0x2f43df,_0x52dae5?util[_0x0159('0x8')](_0x52dae5,{'showHidden':![],'depth':null}):'');};exports[_0x0159('0xa')]=function(_0x318d00,_0x30f7a1){logger['error'](_0x318d00,_0x30f7a1?util[_0x0159('0x8')](_0x30f7a1,{'showHidden':![],'depth':null}):'');};exports[_0x0159('0xb')]=function(_0x492677,_0x28275d){return client[_0x0159('0xb')](_0x492677,{'body':_0x28275d})[_0x0159('0xc')](function(_0x1cff37){logger[_0x0159('0x9')](_0x0159('0xd'),_0x492677,_0x1cff37?util[_0x0159('0x8')](_0x1cff37,{'showHidden':![],'depth':null}):'');})[_0x0159('0xe')](function(_0xf4aaa9){logger['error'](_0x0159('0xd'),_0x492677,_0xf4aaa9?util[_0x0159('0x8')](_0xf4aaa9,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2b0775){return client[_0x0159('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x0159('0xf'),_0x0159('0x10'),_0x0159('0x11')],'where':_0x2b0775,'limit':0x1}})[_0x0159('0xc')](function(_0x3433a0){logger[_0x0159('0x9')](_0x0159('0x12'),JSON['stringify'](_0x2b0775),_0x3433a0?util[_0x0159('0x8')](_0x3433a0,{'showHidden':![],'depth':null}):'');return _0x3433a0[_0x0159('0x13')]['length']?_0x3433a0['result'][0x0]:null;});}exports[_0x0159('0x14')]=function(_0x2fb7b8){return new BPromise(function(_0x3b563a,_0x1d4be6){if(_0x2fb7b8){return getUser({'internal':_0x2fb7b8})[_0x0159('0xc')](function(_0x240c1d){logger['info'](_0x0159('0x15'),_0x2fb7b8,_0x240c1d?_0x0159('0x16'):_0x0159('0x17'));return _0x3b563a(_0x240c1d);})[_0x0159('0xe')](function(_0x18318e){logger[_0x0159('0xa')](_0x0159('0x18'),_0x18318e?util[_0x0159('0x8')](_0x18318e,{'showHidden':![],'depth':null}):'');return _0x3b563a(null);});}return _0x3b563a(null);});};exports[_0x0159('0x19')]=function(_0x181207){return new BPromise(function(_0x164aee,_0x3c8291){if(_0x181207){return getUser({'interface':_0x181207})[_0x0159('0xc')](function(_0x55530f){logger[_0x0159('0x7')](_0x0159('0x1a'),_0x181207,_0x55530f?_0x0159('0x16'):_0x0159('0x17'));return _0x164aee(_0x55530f);})['catch'](function(_0x51c4e8){logger[_0x0159('0xa')](_0x0159('0x1b'),_0x51c4e8?util[_0x0159('0x8')](_0x51c4e8,{'showHidden':![],'depth':null}):'');return _0x164aee(null);});}return _0x164aee(null);});};exports['getUserByName']=function(_0x57d898){return new BPromise(function(_0x53e4ef,_0x32b66a){if(_0x57d898){return getUser({'name':_0x57d898})[_0x0159('0xc')](function(_0x4fe8fd){logger[_0x0159('0x7')](_0x0159('0x1c'),_0x57d898,_0x4fe8fd?_0x0159('0x16'):_0x0159('0x17'));return _0x53e4ef(_0x4fe8fd);})[_0x0159('0xe')](function(_0x37fdf4){logger['error'](_0x0159('0x1d'),_0x37fdf4?util[_0x0159('0x8')](_0x37fdf4,{'showHidden':![],'depth':null}):'');return _0x53e4ef(null);});}return _0x53e4ef(null);});};exports[_0x0159('0x1e')]=function(_0x28e563){return new BPromise(function(_0x294d7b,_0x1f9695){if(_0x28e563){return client['request'](_0x0159('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x0159('0x10'),'type',_0x0159('0x20'),'acwTimeout'],'where':{'name':_0x28e563},'limit':0x1}})[_0x0159('0xc')](function(_0x31ce72){logger[_0x0159('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x28e563,_0x31ce72?util[_0x0159('0x8')](_0x31ce72,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x28e563,_0x31ce72?_0x0159('0x16'):_0x0159('0x17'));return _0x294d7b(_0x31ce72[_0x0159('0x13')][_0x0159('0x21')]?_0x31ce72[_0x0159('0x13')][0x0]:null);})[_0x0159('0xe')](function(_0x1e5e34){logger[_0x0159('0xa')](_0x0159('0x22'),_0x1e5e34?util[_0x0159('0x8')](_0x1e5e34,{'showHidden':![],'depth':null}):'');return _0x294d7b(null);});}return _0x294d7b(null);});};exports[_0x0159('0x23')]=function(_0xd81743,_0x42037f){return moment(_0xd81743)[_0x0159('0x24')](_0x42037f,'seconds')[_0x0159('0x25')](_0x0159('0x26'));};exports[_0x0159('0x27')]=function(_0x4f24bb,_0x2ca87a){return moment(_0x4f24bb)[_0x0159('0x28')](_0x2ca87a,_0x0159('0x29'))[_0x0159('0x25')](_0x0159('0x26'));};exports[_0x0159('0x2a')]=function(_0x5e6fd1,_0x2a8619){return moment(_0x5e6fd1)[_0x0159('0x2b')](moment(_0x2a8619),_0x0159('0x29'));};exports[_0x0159('0x2c')]=function(_0x8f8f3d,_0x1e7bed){return parseInt(_0x8f8f3d,0xa)+parseInt(_0x1e7bed,0xa);};exports[_0x0159('0x2d')]=function(){return moment()[_0x0159('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0159('0x2e')]=function(_0x187989,_0x50aeb0){if(_0x50aeb0){return moment(_0x187989)['isAfter'](_0x50aeb0);}return!![];};exports[_0x0159('0x2f')]=function(_0x50fa2a,_0xccda9b){if(_0xccda9b){return moment(_0x50fa2a)[_0x0159('0x2f')](_0xccda9b);}else if(_0x50fa2a){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 2549b1c..88a9e09 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d74=['lodash','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','ensureDir','then','user','data','timestamp','catch','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','device','method','name','other','agent_name','test','fs-extra'];(function(_0x1c33dc,_0x177c7e){var _0x405580=function(_0x556105){while(--_0x556105){_0x1c33dc['push'](_0x1c33dc['shift']());}};_0x405580(++_0x177c7e);}(_0x8d74,0xa7));var _0x48d7=function(_0x147402,_0xc60045){_0x147402=_0x147402-0x0;var _0x294b04=_0x8d74[_0x147402];return _0x294b04;};var fs=require(_0x48d7('0x0'));var _=require(_0x48d7('0x1'));var ewinston=require(_0x48d7('0x2'));var path=require(_0x48d7('0x3'));var util=require(_0x48d7('0x4'));var fileLogger=require('./loggers')[_0x48d7('0x5')];var safeTemplate=require('./safe-template')[_0x48d7('0x6')];var maskSensitiveData=require(_0x48d7('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x294691(_0x5c9310){var _0x27e60d=path[_0x48d7('0x8')](_0x48d7('0x9'),_0x48d7('0xa'),_0x48d7('0xb'));var _0x1b1490=path[_0x48d7('0x8')]('client',_0x5c9310[_0x48d7('0xc')]+'-'+_0x5c9310['name']);return fs[_0x48d7('0xd')](path[_0x48d7('0x8')](_0x27e60d,_0x1b1490))[_0x48d7('0xe')](function(){var _0x2ca102=fileLogger('client',path[_0x48d7('0x8')](_0x27e60d,_0x1b1490));return _0x2ca102;})['catch'](function(_0x2a0bb7){throw _0x2a0bb7;});}this[_0x48d7('0xa')]=function(_0x5c7cea,_0x59e291,_0x259754,_0x53fda8){return _0x294691(_0x5c7cea[_0x48d7('0xf')])[_0x48d7('0xe')](function(_0x296cc1){var _0x24a657=_0x296cc1[_0x59e291];return _0x24a657;})[_0x48d7('0xe')](function(_0x5d498a){var _0x3a638b=_0x5c7cea['user']?_0x5c7cea[_0x48d7('0xf')]['id']:'no-user';var _0x4f6dd0=_0x53fda8[_0x48d7('0x10')];var _0x152329=_0x53fda8[_0x48d7('0x11')];var _0x1cf410=new Date(Number(_0x152329));return _0x5d498a(_0x3a638b,_0x1cf410,_0x259754,_0x4f6dd0);})[_0x48d7('0x12')](function(_0x3d3ad6){fileLogger('client')[_0x48d7('0x13')](_0x3d3ad6);});};}function setupLoggers(_0x31aae6){return new Promise(function(_0x515597){var _0x4f83b5=new ClientSideLogger();var _0x184766=fileLogger(_0x48d7('0x14'));var _0x249325=fileLogger(_0x48d7('0x15'));_0x31aae6['set'](_0x48d7('0x16'),_0x4f83b5);_0x31aae6[_0x48d7('0x17')](ewinston[_0x48d7('0x18')]({'winstonInstance':_0x184766,'meta':![],'statusLevels':!![],'msg':function(_0x262aac,_0x385ec7){var _0x3f69fa=_0x48d7('0x19');if(!_[_0x48d7('0x1a')](_0x262aac['body'])){_0x3f69fa+='\x20body=%s';var _0x23d373=_0x262aac[_0x48d7('0x1b')];maskSensitiveData(_0x23d373);}return safeTemplate(util[_0x48d7('0x1c')](_0x3f69fa,_0x262aac['method'],_0x262aac[_0x48d7('0x1d')][_0x48d7('0x1e')]?_0x262aac['headers'][_0x48d7('0x1e')]:_0x262aac[_0x48d7('0x1f')][_0x48d7('0x20')]||_0x262aac['ip'],_0x262aac[_0x48d7('0x21')],_0x385ec7[_0x48d7('0x22')],_0x385ec7[_0x48d7('0x23')],_0x262aac[_0x48d7('0xf')]?_0x262aac['user']['id']:null,_0x262aac[_0x48d7('0xf')]?_0x262aac[_0x48d7('0xf')]['name']:null,_0x262aac[_0x48d7('0xf')]?_0x262aac[_0x48d7('0xf')]['role']:null,_0x23d373?util['inspect'](_0x23d373,![],null):''));}}));_0x31aae6[_0x48d7('0x17')](ewinston[_0x48d7('0x18')]({'winstonInstance':_0x249325,'meta':![],'statusLevels':!![],'msg':function(_0x426bff,_0x1420fe){var _0x558fc5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x426bff['body']&&_0x426bff[_0x48d7('0x1b')][_0x48d7('0x24')]&&_0x426bff['body']['agent_id']){_0x558fc5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x48d7('0x1c')](_0x558fc5,_0x426bff[_0x48d7('0x25')],_0x426bff[_0x48d7('0x1d')]['x-forwarded-for']?_0x426bff[_0x48d7('0x1d')][_0x48d7('0x1e')]:_0x426bff['connection'][_0x48d7('0x20')]||_0x426bff['ip'],_0x426bff[_0x48d7('0x21')],_0x1420fe[_0x48d7('0x22')],_0x1420fe[_0x48d7('0x23')],_0x426bff[_0x48d7('0xf')]?_0x426bff[_0x48d7('0xf')]['id']:null,_0x426bff['user']?_0x426bff['user'][_0x48d7('0x26')]:null,_0x426bff['user']?_0x426bff[_0x48d7('0xf')][_0x48d7('0xc')]:null,_0x426bff[_0x48d7('0x1b')]&&_0x426bff[_0x48d7('0x1b')][_0x48d7('0x24')]?_0x426bff['body']['device']:_0x48d7('0x27'),_0x426bff[_0x48d7('0x1b')]&&_0x426bff[_0x48d7('0x1b')]['agent_id']?_0x426bff['body']['agent_id']:'',_0x426bff['body']&&_0x426bff['body']['agent_name']?_0x426bff[_0x48d7('0x1b')][_0x48d7('0x28')]:'');},'ignoreRoute':function(_0x132fb3){var _0x345afe=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x345afe[_0x48d7('0x29')](_0x132fb3['url']);}}));return _0x515597();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xecf9=['statusCode','responseTime','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','log','client','name','ensureDir','then','user','no-user','timestamp','error','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','remoteAddress','url'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0xecf9,0x1c4));var _0x9ecf=function(_0xfd6b7d,_0x32959d){_0xfd6b7d=_0xfd6b7d-0x0;var _0x1b10ec=_0xecf9[_0xfd6b7d];return _0x1b10ec;};var fs=require(_0x9ecf('0x0'));var _=require(_0x9ecf('0x1'));var ewinston=require(_0x9ecf('0x2'));var path=require('path');var util=require(_0x9ecf('0x3'));var fileLogger=require(_0x9ecf('0x4'))['fileLogger'];var safeTemplate=require(_0x9ecf('0x5'))[_0x9ecf('0x6')];var maskSensitiveData=require(_0x9ecf('0x7'))[_0x9ecf('0x8')];function ClientSideLogger(){function _0x10cc7d(_0xc0289d){var _0x26e766=path[_0x9ecf('0x9')]('/var',_0x9ecf('0xa'),'xcally');var _0x45a391=path['join'](_0x9ecf('0xb'),_0xc0289d['role']+'-'+_0xc0289d[_0x9ecf('0xc')]);return fs[_0x9ecf('0xd')](path['join'](_0x26e766,_0x45a391))[_0x9ecf('0xe')](function(){var _0x42deae=fileLogger(_0x9ecf('0xb'),path[_0x9ecf('0x9')](_0x26e766,_0x45a391));return _0x42deae;})['catch'](function(_0x751549){throw _0x751549;});}this['log']=function(_0x493b75,_0x11d7ad,_0x1fd8ac,_0x31b450){return _0x10cc7d(_0x493b75['user'])[_0x9ecf('0xe')](function(_0x2e0d10){var _0x4e29b2=_0x2e0d10[_0x11d7ad];return _0x4e29b2;})[_0x9ecf('0xe')](function(_0x36eac1){var _0x26c63d=_0x493b75[_0x9ecf('0xf')]?_0x493b75['user']['id']:_0x9ecf('0x10');var _0x18d087=_0x31b450['data'];var _0x599623=_0x31b450[_0x9ecf('0x11')];var _0x26badd=new Date(Number(_0x599623));return _0x36eac1(_0x26c63d,_0x26badd,_0x1fd8ac,_0x18d087);})['catch'](function(_0x256db3){fileLogger(_0x9ecf('0xb'))[_0x9ecf('0x12')](_0x256db3);});};}function setupLoggers(_0x1b1f2d){return new Promise(function(_0x31023c){var _0x35ba7b=new ClientSideLogger();var _0x10658a=fileLogger(_0x9ecf('0x13'));var _0x5f492d=fileLogger(_0x9ecf('0x14'));_0x1b1f2d['set']('client-side-logger',_0x35ba7b);_0x1b1f2d[_0x9ecf('0x15')](ewinston[_0x9ecf('0x16')]({'winstonInstance':_0x10658a,'meta':![],'statusLevels':!![],'msg':function(_0x16ed25,_0x3c35f6){var _0x3bdbc0=_0x9ecf('0x17');if(!_[_0x9ecf('0x18')](_0x16ed25[_0x9ecf('0x19')])){_0x3bdbc0+='\x20body=%s';var _0x2d35cb=_0x16ed25[_0x9ecf('0x19')];maskSensitiveData(_0x2d35cb);}return safeTemplate(util[_0x9ecf('0x1a')](_0x3bdbc0,_0x16ed25[_0x9ecf('0x1b')],_0x16ed25[_0x9ecf('0x1c')][_0x9ecf('0x1d')]?_0x16ed25[_0x9ecf('0x1c')][_0x9ecf('0x1d')]:_0x16ed25['connection'][_0x9ecf('0x1e')]||_0x16ed25['ip'],_0x16ed25[_0x9ecf('0x1f')],_0x3c35f6[_0x9ecf('0x20')],_0x3c35f6[_0x9ecf('0x21')],_0x16ed25[_0x9ecf('0xf')]?_0x16ed25[_0x9ecf('0xf')]['id']:null,_0x16ed25[_0x9ecf('0xf')]?_0x16ed25[_0x9ecf('0xf')][_0x9ecf('0xc')]:null,_0x16ed25[_0x9ecf('0xf')]?_0x16ed25[_0x9ecf('0xf')][_0x9ecf('0x22')]:null,_0x2d35cb?util['inspect'](_0x2d35cb,![],null):''));}}));_0x1b1f2d[_0x9ecf('0x15')](ewinston[_0x9ecf('0x16')]({'winstonInstance':_0x5f492d,'meta':![],'statusLevels':!![],'msg':function(_0xa6117b,_0x53dc45){var _0x9bb02f=_0x9ecf('0x23');if(_0xa6117b[_0x9ecf('0x19')]&&_0xa6117b[_0x9ecf('0x19')]['device']&&_0xa6117b[_0x9ecf('0x19')][_0x9ecf('0x24')]){_0x9bb02f=_0x9ecf('0x25');}return util[_0x9ecf('0x1a')](_0x9bb02f,_0xa6117b[_0x9ecf('0x1b')],_0xa6117b[_0x9ecf('0x1c')]['x-forwarded-for']?_0xa6117b[_0x9ecf('0x1c')][_0x9ecf('0x1d')]:_0xa6117b[_0x9ecf('0x26')][_0x9ecf('0x1e')]||_0xa6117b['ip'],_0xa6117b[_0x9ecf('0x1f')],_0x53dc45[_0x9ecf('0x20')],_0x53dc45[_0x9ecf('0x21')],_0xa6117b[_0x9ecf('0xf')]?_0xa6117b['user']['id']:null,_0xa6117b[_0x9ecf('0xf')]?_0xa6117b[_0x9ecf('0xf')][_0x9ecf('0xc')]:null,_0xa6117b[_0x9ecf('0xf')]?_0xa6117b['user'][_0x9ecf('0x22')]:null,_0xa6117b[_0x9ecf('0x19')]&&_0xa6117b[_0x9ecf('0x19')][_0x9ecf('0x27')]?_0xa6117b[_0x9ecf('0x19')][_0x9ecf('0x27')]:_0x9ecf('0x28'),_0xa6117b[_0x9ecf('0x19')]&&_0xa6117b['body'][_0x9ecf('0x24')]?_0xa6117b[_0x9ecf('0x19')][_0x9ecf('0x24')]:'',_0xa6117b[_0x9ecf('0x19')]&&_0xa6117b['body'][_0x9ecf('0x29')]?_0xa6117b['body'][_0x9ecf('0x29')]:'');},'ignoreRoute':function(_0x1b703){var _0x4386ac=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4386ac[_0x9ecf('0x2a')](_0x1b703[_0x9ecf('0x1f')]);}}));return _0x31023c();});}exports[_0x9ecf('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index af36d8e..1a39f1f 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59ee=['bold\x20cyan','/var/log/xcally','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','info','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue'];(function(_0x444716,_0x1fd1ef){var _0x9e6df5=function(_0x445503){while(--_0x445503){_0x444716['push'](_0x444716['shift']());}};_0x9e6df5(++_0x1fd1ef);}(_0x59ee,0xac));var _0xe59e=function(_0x4f219b,_0x841f7e){_0x4f219b=_0x4f219b-0x0;var _0x8a7718=_0x59ee[_0x4f219b];return _0x8a7718;};'use strict';var path=require(_0xe59e('0x0'));var util=require(_0xe59e('0x1'));var moment=require(_0xe59e('0x2'));var winston=require('winston');var config=require(_0xe59e('0x3'));var debugLevel=config[_0xe59e('0x4')]?config['debugLevel']['toLowerCase']():_0xe59e('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0xe59e('0x6'),'info':_0xe59e('0x7'),'print':_0xe59e('0x8'),'success':_0xe59e('0x9'),'http':_0xe59e('0xa'),'verbose':_0xe59e('0xb'),'debug':_0xe59e('0xc'),'silly':_0xe59e('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x586130,_0x5ba1fc,_0x2bd316){var _0x3c6e8a=_0x586130||_0xe59e('0xe');return path[_0xe59e('0xf')](_0x3c6e8a,util[_0xe59e('0x10')]('%s-%s.log',_0x5ba1fc,_0x2bd316));}function formatter(_0x397863,_0xf8140a){_0xf8140a[_0xe59e('0x11')]=_0xf8140a[_0xe59e('0x11')][_0xe59e('0x12')](/@@{/g,'{{{')['replace'](/}@@/g,_0xe59e('0x13'))[_0xe59e('0x12')](/@{/g,'{{')[_0xe59e('0x12')](/}@/g,'}}');return util[_0xe59e('0x10')](_0xe59e('0x14'),moment()[_0xe59e('0x10')](_0xe59e('0x15')),_0xf8140a[_0xe59e('0x16')]['toUpperCase'](),_0x397863,_0xf8140a[_0xe59e('0x11')]);}function fileFormat(_0x2ac474,_0x717168){_0x717168[_0xe59e('0x11')]=_0x717168['message'][_0xe59e('0x12')](/@@{/g,_0xe59e('0x17'))['replace'](/}@@/g,_0xe59e('0x13'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x26f3ba=_0x717168[_0xe59e('0x18')]&&Object[_0xe59e('0x19')](_0x717168[_0xe59e('0x18')])[_0xe59e('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x717168[_0xe59e('0x18')]):'';return util['format'](_0xe59e('0x1b'),moment()[_0xe59e('0x10')](_0xe59e('0x15')),_0x717168[_0xe59e('0x16')][_0xe59e('0x1c')](),_0x2ac474,_0x717168[_0xe59e('0x11')],_0x26f3ba);}function consoleLogger(){var _0x3721e9=new winston[(_0xe59e('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe59e('0x1e'))][(_0xe59e('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x20e3a6){return formatter('',_0x20e3a6);}})]});return _0x3721e9;}function fileLogger(_0x3ceafc,_0x142162){var _0xeeb31a=new winston[(_0xe59e('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe59e('0x1e'))]['File']({'name':util['format'](_0xe59e('0x20'),_0x3ceafc,_0xe59e('0x21')),'filename':getLogFileName(_0x142162,_0x3ceafc,'error'),'level':_0xe59e('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1beb56){return fileFormat(_0x3ceafc,_0x1beb56);}}),new winston[(_0xe59e('0x1e'))]['File']({'name':util['format'](_0xe59e('0x20'),_0x3ceafc,debugLevel),'filename':getLogFileName(_0x142162,_0x3ceafc,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bdf98){return fileFormat(_0x3ceafc,_0x3bdf98);}}),new winston[(_0xe59e('0x1e'))][(_0xe59e('0x1f'))]({'level':_0xe59e('0x22'),'json':![],'formatter':function(_0x38719f){return fileFormat(_0x3ceafc,_0x38719f);}})]});return _0xeeb31a;}exports[_0xe59e('0x23')]=consoleLogger;exports[_0xe59e('0x24')]=fileLogger; \ No newline at end of file +var _0xcf13=['[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','warn','File','%s-%s','error','transports','consoleLogger','fileLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','white','bold\x20white','bold\x20green','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','%s-%s.log','message','replace','{{{','}}}'];(function(_0x1b1c65,_0x23ca6d){var _0x1b86d9=function(_0x1e8559){while(--_0x1e8559){_0x1b1c65['push'](_0x1b1c65['shift']());}};_0x1b86d9(++_0x23ca6d);}(_0xcf13,0x1e6));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var util=require(_0x3cf1('0x0'));var moment=require(_0x3cf1('0x1'));var winston=require(_0x3cf1('0x2'));var config=require(_0x3cf1('0x3'));var debugLevel=config[_0x3cf1('0x4')]?config[_0x3cf1('0x4')][_0x3cf1('0x5')]():_0x3cf1('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x3cf1('0x7'),'error':_0x3cf1('0x8'),'warn':'bold\x20yellow','info':_0x3cf1('0x9'),'print':_0x3cf1('0xa'),'success':_0x3cf1('0xb'),'http':'gray','verbose':'bold\x20magenta','debug':_0x3cf1('0xc'),'silly':_0x3cf1('0xd')};winston[_0x3cf1('0xe')](XC_LOG_COLORS);function getLogFileName(_0x50c1c6,_0xe3b9ba,_0x59edf1){var _0x5a883f=_0x50c1c6||_0x3cf1('0xf');return path['join'](_0x5a883f,util['format'](_0x3cf1('0x10'),_0xe3b9ba,_0x59edf1));}function formatter(_0x45264a,_0x35bf6d){_0x35bf6d[_0x3cf1('0x11')]=_0x35bf6d['message'][_0x3cf1('0x12')](/@@{/g,_0x3cf1('0x13'))[_0x3cf1('0x12')](/}@@/g,_0x3cf1('0x14'))[_0x3cf1('0x12')](/@{/g,'{{')[_0x3cf1('0x12')](/}@/g,'}}');return util['format'](_0x3cf1('0x15'),moment()[_0x3cf1('0x16')](_0x3cf1('0x17')),_0x35bf6d[_0x3cf1('0x18')][_0x3cf1('0x19')](),_0x45264a,_0x35bf6d[_0x3cf1('0x11')]);}function fileFormat(_0xda96f7,_0xe27a17){_0xe27a17['message']=_0xe27a17['message'][_0x3cf1('0x12')](/@@{/g,_0x3cf1('0x13'))['replace'](/}@@/g,_0x3cf1('0x14'))['replace'](/@{/g,'{{')[_0x3cf1('0x12')](/}@/g,'}}');var _0x8db08f=_0xe27a17[_0x3cf1('0x1a')]&&Object['keys'](_0xe27a17['meta'])[_0x3cf1('0x1b')]?'\x0a\x09'+JSON[_0x3cf1('0x1c')](_0xe27a17[_0x3cf1('0x1a')]):'';return util[_0x3cf1('0x16')](_0x3cf1('0x1d'),moment()[_0x3cf1('0x16')](_0x3cf1('0x17')),_0xe27a17[_0x3cf1('0x18')][_0x3cf1('0x19')](),_0xda96f7,_0xe27a17[_0x3cf1('0x11')],_0x8db08f);}function consoleLogger(){var _0x874fe6=new winston[(_0x3cf1('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x3cf1('0x1f'))]({'level':_0x3cf1('0x20'),'json':![],'formatter':function(_0x39b46b){return formatter('',_0x39b46b);}})]});return _0x874fe6;}function fileLogger(_0x44406d,_0x4bea39){var _0x557631=new winston[(_0x3cf1('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x3cf1('0x21'))]({'name':util[_0x3cf1('0x16')](_0x3cf1('0x22'),_0x44406d,'error'),'filename':getLogFileName(_0x4bea39,_0x44406d,_0x3cf1('0x23')),'level':_0x3cf1('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd0cced){return fileFormat(_0x44406d,_0xd0cced);}}),new winston[(_0x3cf1('0x24'))][(_0x3cf1('0x21'))]({'name':util[_0x3cf1('0x16')](_0x3cf1('0x22'),_0x44406d,debugLevel),'filename':getLogFileName(_0x4bea39,_0x44406d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x49d802){return fileFormat(_0x44406d,_0x49d802);}}),new winston['transports'][(_0x3cf1('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x40b411){return fileFormat(_0x44406d,_0x40b411);}})]});return _0x557631;}exports[_0x3cf1('0x25')]=consoleLogger;exports[_0x3cf1('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 009b510..fe60a38 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x1bbec1,_0x7e86d3){var _0x10ab97=function(_0xd461ca){while(--_0xd461ca){_0x1bbec1['push'](_0x1bbec1['shift']());}};_0x10ab97(++_0x7e86d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x39ebc3,_0x549a7c){_0x39ebc3=_0x39ebc3-0x0;var _0x6c7df1=_0x2ef3[_0x39ebc3];return _0x6c7df1;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x15f27c,_0x288bd8){var _0x44ac6b=function(_0x4fea1e){while(--_0x4fea1e){_0x15f27c['push'](_0x15f27c['shift']());}};_0x44ac6b(++_0x288bd8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 5511d55..4b2f2c6 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','safeTemplate','lodash'];(function(_0x204714,_0x124c3d){var _0x5da297=function(_0x370259){while(--_0x370259){_0x204714['push'](_0x204714['shift']());}};_0x5da297(++_0x124c3d);}(_0x7916,0x128));var _0x6791=function(_0x3e0975,_0x190509){_0x3e0975=_0x3e0975-0x0;var _0x52f9c8=_0x7916[_0x3e0975];return _0x52f9c8;};var _=require(_0x6791('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5eaf3a){return _0x5eaf3a==='{{'?_0x6791('0x1'):_0x6791('0x2');}function safeTemplate(_0x4ca50a){var _0x325c54=_0x4ca50a;if(typeof _0x4ca50a===_0x6791('0x3')){_0x325c54=_0x4ca50a[_0x6791('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6791('0x5')](_0x4ca50a)){_0x325c54=_0x4ca50a['map'](function(_0xe98396){return safeTemplate(_0xe98396);});}else if(_['isPlainObject'](_0x4ca50a)){_0x325c54=Object[_0x6791('0x6')](_0x4ca50a)[_0x6791('0x7')](function(_0x5ad8c0,_0x8b85ff){_0x5ad8c0[_0x8b85ff]=safeTemplate(_0x4ca50a[_0x8b85ff]);return _0x5ad8c0;},{});}return _0x325c54;}module['exports'][_0x6791('0x8')]=safeTemplate; \ No newline at end of file +var _0x0abf=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x455b91,_0x3a5d03){var _0x5b7542=function(_0x3d2a8f){while(--_0x3d2a8f){_0x455b91['push'](_0x455b91['shift']());}};_0x5b7542(++_0x3a5d03);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};var _=require(_0xf0ab('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4d04cc){return _0x4d04cc==='{{'?_0xf0ab('0x1'):_0xf0ab('0x2');}function safeTemplate(_0x528ef7){var _0x598001=_0x528ef7;if(typeof _0x528ef7===_0xf0ab('0x3')){_0x598001=_0x528ef7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf0ab('0x4')](_0x528ef7)){_0x598001=_0x528ef7[_0xf0ab('0x5')](function(_0x2efe43){return safeTemplate(_0x2efe43);});}else if(_[_0xf0ab('0x6')](_0x528ef7)){_0x598001=Object[_0xf0ab('0x7')](_0x528ef7)[_0xf0ab('0x8')](function(_0x233afe,_0x57ff3b){_0x233afe[_0x57ff3b]=safeTemplate(_0x528ef7[_0x57ff3b]);return _0x233afe;},{});}return _0x598001;}module[_0xf0ab('0x9')][_0xf0ab('0xa')]=safeTemplate; \ No newline at end of file